From 665329b17872071551c8f9507d77c46ae42635ba Mon Sep 17 00:00:00 2001 From: Andrea Bianco Date: Sat, 1 Jan 2022 22:31:49 +0100 Subject: [PATCH] Built motion from commit c102fb6e.|2.5.44 --- apidoc/api_project.js | 2 +- apidoc/api_project.json | 2 +- server/api/action/action.attributes.js | 2 +- server/api/action/action.controller.js | 2 +- server/api/action/action.model.js | 2 +- server/api/action/action.rpc.js | 2 +- server/api/action/index.js | 2 +- .../analyticCustomReport.attributes.js | 2 +- .../analyticCustomReport.controller.js | 2 +- .../analyticCustomReport.model.js | 2 +- .../analyticCustomReport.rpc.js | 2 +- server/api/analyticCustomReport/index.js | 2 +- .../analyticDefaultReport.attributes.js | 2 +- .../analyticDefaultReport.controller.js | 2 +- .../analyticDefaultReport.model.js | 2 +- .../analyticDefaultReport.rpc.js | 2 +- server/api/analyticDefaultReport/index.js | 2 +- .../analyticExtractedReport.attributes.js | 2 +- .../analyticExtractedReport.controller.js | 2 +- .../analyticExtractedReport.model.js | 2 +- .../analyticExtractedReport.rpc.js | 2 +- server/api/analyticExtractedReport/index.js | 2 +- .../analyticFieldReport.attributes.js | 2 +- .../analyticFieldReport.controller.js | 2 +- .../analyticFieldReport.model.js | 2 +- .../analyticFieldReport/analyticFieldReport.rpc.js | 2 +- server/api/analyticFieldReport/index.js | 2 +- .../analyticMetric/analyticMetric.attributes.js | 2 +- .../analyticMetric/analyticMetric.controller.js | 2 +- server/api/analyticMetric/analyticMetric.model.js | 2 +- server/api/analyticMetric/analyticMetric.rpc.js | 2 +- server/api/analyticMetric/index.js | 2 +- .../analyticTreeReport.attributes.js | 2 +- .../analyticTreeReport.controller.js | 2 +- .../analyticTreeReport/analyticTreeReport.model.js | 2 +- .../analyticTreeReport/analyticTreeReport.rpc.js | 2 +- server/api/analyticTreeReport/index.js | 2 +- server/api/attachment/attachment.attributes.js | 2 +- server/api/attachment/attachment.controller.js | 2 +- server/api/attachment/attachment.model.js | 2 +- server/api/attachment/attachment.rpc.js | 2 +- server/api/attachment/index.js | 2 +- .../authActiveDirectory.controller.js | 2 +- server/api/authActiveDirectory/index.js | 2 +- server/api/authGoogle/authGoogle.controller.js | 2 +- server/api/authGoogle/index.js | 2 +- server/api/authLocal/authLocal.controller.js | 2 +- server/api/authLocal/index.js | 2 +- server/api/automation/automation.attributes.js | 2 +- server/api/automation/automation.controller.js | 2 +- server/api/automation/automation.model.js | 2 +- server/api/automation/automation.rpc.js | 2 +- server/api/automation/index.js | 2 +- server/api/campaign/campaign.attributes.js | 2 +- server/api/campaign/campaign.controller.js | 2 +- server/api/campaign/campaign.model.js | 2 +- server/api/campaign/campaign.rpc.js | 2 +- server/api/campaign/index.js | 2 +- server/api/cannedAnswer/cannedAnswer.attributes.js | 2 +- server/api/cannedAnswer/cannedAnswer.controller.js | 2 +- server/api/cannedAnswer/cannedAnswer.model.js | 2 +- server/api/cannedAnswer/cannedAnswer.rpc.js | 2 +- server/api/cannedAnswer/index.js | 2 +- server/api/cdr/cdr.attributes.js | 2 +- server/api/cdr/cdr.controller.js | 2 +- server/api/cdr/cdr.model.js | 2 +- server/api/cdr/cdr.rpc.js | 2 +- server/api/cdr/index.js | 2 +- .../chatApplication/chatApplication.attributes.js | 2 +- .../chatApplication/chatApplication.controller.js | 2 +- .../api/chatApplication/chatApplication.model.js | 2 +- server/api/chatApplication/chatApplication.rpc.js | 2 +- server/api/chatApplication/index.js | 2 +- server/api/chatGroup/chatGroup.attributes.js | 2 +- server/api/chatGroup/chatGroup.controller.js | 2 +- server/api/chatGroup/chatGroup.events.js | 2 +- server/api/chatGroup/chatGroup.model.js | 2 +- server/api/chatGroup/chatGroup.rpc.js | 2 +- server/api/chatGroup/chatGroup.socket.js | 2 +- server/api/chatGroup/index.js | 2 +- .../chatInteraction/chatInteraction.attributes.js | 2 +- .../chatInteraction/chatInteraction.controller.js | 2 +- .../api/chatInteraction/chatInteraction.events.js | 2 +- .../api/chatInteraction/chatInteraction.model.js | 2 +- server/api/chatInteraction/chatInteraction.rpc.js | 2 +- .../api/chatInteraction/chatInteraction.socket.js | 2 +- server/api/chatInteraction/index.js | 2 +- .../chatInternalMessage.attributes.js | 2 +- .../chatInternalMessage.controller.js | 2 +- .../chatInternalMessage.events.js | 2 +- .../chatInternalMessage.model.js | 2 +- .../chatInternalMessage/chatInternalMessage.rpc.js | 2 +- .../chatInternalMessage.socket.js | 2 +- server/api/chatInternalMessage/index.js | 2 +- server/api/chatMessage/chatMessage.attributes.js | 2 +- server/api/chatMessage/chatMessage.controller.js | 2 +- server/api/chatMessage/chatMessage.events.js | 2 +- server/api/chatMessage/chatMessage.model.js | 2 +- server/api/chatMessage/chatMessage.rpc.js | 2 +- server/api/chatMessage/chatMessage.socket.js | 2 +- server/api/chatMessage/index.js | 2 +- .../chatOfflineMessage.attributes.js | 2 +- .../chatOfflineMessage.controller.js | 2 +- .../chatOfflineMessage.events.js | 2 +- .../chatOfflineMessage/chatOfflineMessage.model.js | 2 +- .../chatOfflineMessage/chatOfflineMessage.rpc.js | 2 +- server/api/chatOfflineMessage/index.js | 2 +- .../chatProactiveAction.attributes.js | 2 +- .../chatProactiveAction.controller.js | 2 +- .../chatProactiveAction.model.js | 2 +- .../chatProactiveAction/chatProactiveAction.rpc.js | 2 +- server/api/chatProactiveAction/index.js | 2 +- server/api/chatQueue/chatQueue.attributes.js | 2 +- server/api/chatQueue/chatQueue.controller.js | 2 +- server/api/chatQueue/chatQueue.events.js | 2 +- server/api/chatQueue/chatQueue.model.js | 2 +- server/api/chatQueue/chatQueue.rpc.js | 2 +- server/api/chatQueue/chatQueue.socket.js | 2 +- server/api/chatQueue/index.js | 2 +- .../chatQueueReport/chatQueueReport.attributes.js | 2 +- .../chatQueueReport/chatQueueReport.controller.js | 2 +- .../api/chatQueueReport/chatQueueReport.model.js | 2 +- server/api/chatQueueReport/chatQueueReport.rpc.js | 2 +- server/api/chatQueueReport/index.js | 2 +- .../chatTransferReport.attributes.js | 2 +- .../chatTransferReport.controller.js | 2 +- .../chatTransferReport/chatTransferReport.model.js | 2 +- .../chatTransferReport/chatTransferReport.rpc.js | 2 +- server/api/chatTransferReport/index.js | 2 +- server/api/chatWebsite/chatWebsite.attributes.js | 2 +- server/api/chatWebsite/chatWebsite.controller.js | 2 +- server/api/chatWebsite/chatWebsite.events.js | 2 +- server/api/chatWebsite/chatWebsite.model.js | 2 +- server/api/chatWebsite/chatWebsite.rpc.js | 2 +- server/api/chatWebsite/chatWebsite.socket.js | 2 +- server/api/chatWebsite/index.js | 2 +- server/api/client-side-logs.js | 2 +- .../api/cloudProvider/cloudProvider.attributes.js | 2 +- .../api/cloudProvider/cloudProvider.controller.js | 2 +- server/api/cloudProvider/cloudProvider.model.js | 2 +- server/api/cloudProvider/cloudProvider.oauth.js | 2 +- server/api/cloudProvider/cloudProvider.rpc.js | 2 +- server/api/cloudProvider/index.js | 2 +- server/api/cmCompany/cmCompany.attributes.js | 2 +- server/api/cmCompany/cmCompany.controller.js | 2 +- server/api/cmCompany/cmCompany.model.js | 2 +- server/api/cmCompany/cmCompany.rpc.js | 2 +- server/api/cmCompany/index.js | 2 +- server/api/cmContact/cmContact.attributes.js | 2 +- server/api/cmContact/cmContact.controller.js | 2 +- server/api/cmContact/cmContact.events.js | 2 +- server/api/cmContact/cmContact.model.js | 2 +- server/api/cmContact/cmContact.rpc.js | 2 +- server/api/cmContact/cmContact.socket.js | 2 +- server/api/cmContact/index.js | 2 +- .../api/cmCustomField/cmCustomField.attributes.js | 2 +- .../api/cmCustomField/cmCustomField.controller.js | 2 +- server/api/cmCustomField/cmCustomField.model.js | 2 +- server/api/cmCustomField/cmCustomField.rpc.js | 2 +- server/api/cmCustomField/index.js | 2 +- server/api/cmHopper/cmHopper.attributes.js | 2 +- server/api/cmHopper/cmHopper.controller.js | 2 +- server/api/cmHopper/cmHopper.model.js | 2 +- server/api/cmHopper/cmHopper.rpc.js | 2 +- server/api/cmHopper/index.js | 2 +- .../api/cmHopperBlack/cmHopperBlack.attributes.js | 2 +- .../api/cmHopperBlack/cmHopperBlack.controller.js | 2 +- server/api/cmHopperBlack/cmHopperBlack.model.js | 2 +- server/api/cmHopperBlack/cmHopperBlack.rpc.js | 2 +- server/api/cmHopperBlack/index.js | 2 +- .../api/cmHopperFinal/cmHopperFinal.attributes.js | 2 +- .../api/cmHopperFinal/cmHopperFinal.controller.js | 2 +- server/api/cmHopperFinal/cmHopperFinal.model.js | 2 +- server/api/cmHopperFinal/cmHopperFinal.rpc.js | 2 +- server/api/cmHopperFinal/index.js | 2 +- .../cmHopperHistory/cmHopperHistory.attributes.js | 2 +- .../cmHopperHistory/cmHopperHistory.controller.js | 2 +- .../api/cmHopperHistory/cmHopperHistory.model.js | 2 +- server/api/cmHopperHistory/cmHopperHistory.rpc.js | 2 +- server/api/cmHopperHistory/index.js | 2 +- server/api/cmList/cmList.attributes.js | 2 +- server/api/cmList/cmList.controller.js | 2 +- server/api/cmList/cmList.events.js | 2 +- server/api/cmList/cmList.model.js | 2 +- server/api/cmList/cmList.rpc.js | 2 +- server/api/cmList/cmList.socket.js | 2 +- server/api/cmList/index.js | 2 +- server/api/condition/condition.attributes.js | 2 +- server/api/condition/condition.controller.js | 2 +- server/api/condition/condition.model.js | 2 +- server/api/condition/condition.rpc.js | 2 +- server/api/condition/index.js | 2 +- server/api/dashboard/dashboard.attributes.js | 2 +- server/api/dashboard/dashboard.controller.js | 2 +- server/api/dashboard/dashboard.events.js | 2 +- server/api/dashboard/dashboard.model.js | 2 +- server/api/dashboard/dashboard.rpc.js | 2 +- server/api/dashboard/dashboard.socket.js | 2 +- server/api/dashboard/index.js | 2 +- .../api/dashboardItem/dashboardItem.attributes.js | 2 +- .../api/dashboardItem/dashboardItem.controller.js | 2 +- server/api/dashboardItem/dashboardItem.events.js | 2 +- server/api/dashboardItem/dashboardItem.model.js | 2 +- server/api/dashboardItem/dashboardItem.rpc.js | 2 +- server/api/dashboardItem/dashboardItem.socket.js | 2 +- server/api/dashboardItem/index.js | 2 +- server/api/disposition/disposition.attributes.js | 2 +- server/api/disposition/disposition.controller.js | 2 +- server/api/disposition/disposition.model.js | 2 +- server/api/disposition/disposition.rpc.js | 2 +- server/api/disposition/index.js | 2 +- server/api/faxAccount/faxAccount.attributes.js | 2 +- server/api/faxAccount/faxAccount.controller.js | 2 +- server/api/faxAccount/faxAccount.events.js | 2 +- server/api/faxAccount/faxAccount.model.js | 2 +- server/api/faxAccount/faxAccount.rpc.js | 2 +- server/api/faxAccount/faxAccount.socket.js | 2 +- server/api/faxAccount/index.js | 2 +- .../faxApplication/faxApplication.attributes.js | 2 +- .../faxApplication/faxApplication.controller.js | 2 +- server/api/faxApplication/faxApplication.model.js | 2 +- server/api/faxApplication/faxApplication.rpc.js | 2 +- server/api/faxApplication/index.js | 2 +- .../faxInteraction/faxInteraction.attributes.js | 2 +- .../faxInteraction/faxInteraction.controller.js | 2 +- server/api/faxInteraction/faxInteraction.events.js | 2 +- server/api/faxInteraction/faxInteraction.model.js | 2 +- server/api/faxInteraction/faxInteraction.rpc.js | 2 +- server/api/faxInteraction/faxInteraction.socket.js | 2 +- server/api/faxInteraction/index.js | 2 +- server/api/faxMessage/faxMessage.attributes.js | 2 +- server/api/faxMessage/faxMessage.controller.js | 2 +- server/api/faxMessage/faxMessage.events.js | 2 +- server/api/faxMessage/faxMessage.model.js | 2 +- server/api/faxMessage/faxMessage.rpc.js | 2 +- server/api/faxMessage/faxMessage.socket.js | 2 +- server/api/faxMessage/index.js | 2 +- server/api/faxQueue/faxQueue.attributes.js | 2 +- server/api/faxQueue/faxQueue.controller.js | 2 +- server/api/faxQueue/faxQueue.events.js | 2 +- server/api/faxQueue/faxQueue.model.js | 2 +- server/api/faxQueue/faxQueue.rpc.js | 2 +- server/api/faxQueue/faxQueue.socket.js | 2 +- server/api/faxQueue/index.js | 2 +- .../faxQueueReport/faxQueueReport.attributes.js | 2 +- .../faxQueueReport/faxQueueReport.controller.js | 2 +- server/api/faxQueueReport/faxQueueReport.model.js | 2 +- server/api/faxQueueReport/faxQueueReport.rpc.js | 2 +- server/api/faxQueueReport/index.js | 2 +- .../faxTransferReport.attributes.js | 2 +- .../faxTransferReport.controller.js | 2 +- .../faxTransferReport/faxTransferReport.model.js | 2 +- .../api/faxTransferReport/faxTransferReport.rpc.js | 2 +- server/api/faxTransferReport/index.js | 2 +- server/api/intDeskAccount/index.js | 2 +- .../intDeskAccount/intDeskAccount.attributes.js | 2 +- .../intDeskAccount/intDeskAccount.controller.js | 2 +- server/api/intDeskAccount/intDeskAccount.model.js | 2 +- server/api/intDeskAccount/intDeskAccount.rpc.js | 2 +- server/api/intDeskConfiguration/index.js | 2 +- .../intDeskConfiguration.attributes.js | 2 +- .../intDeskConfiguration.controller.js | 2 +- .../intDeskConfiguration.model.js | 2 +- .../intDeskConfiguration.rpc.js | 2 +- server/api/intDeskField/index.js | 2 +- server/api/intDeskField/intDeskField.attributes.js | 2 +- server/api/intDeskField/intDeskField.controller.js | 2 +- server/api/intDeskField/intDeskField.model.js | 2 +- server/api/intDeskField/intDeskField.rpc.js | 2 +- server/api/intDynamics365Account/index.js | 2 +- .../intDynamics365Account.attributes.js | 2 +- .../intDynamics365Account.controller.js | 2 +- .../intDynamics365Account.model.js | 2 +- .../intDynamics365Account.rpc.js | 2 +- server/api/intDynamics365Configuration/index.js | 2 +- .../intDynamics365Configuration.attributes.js | 2 +- .../intDynamics365Configuration.controller.js | 2 +- .../intDynamics365Configuration.model.js | 2 +- .../intDynamics365Configuration.rpc.js | 2 +- server/api/intDynamics365Field/index.js | 2 +- .../intDynamics365Field.attributes.js | 2 +- .../intDynamics365Field.controller.js | 2 +- .../intDynamics365Field.model.js | 2 +- .../intDynamics365Field/intDynamics365Field.rpc.js | 2 +- server/api/intFreshdeskAccount/index.js | 2 +- .../intFreshdeskAccount.attributes.js | 2 +- .../intFreshdeskAccount.controller.js | 2 +- .../intFreshdeskAccount.model.js | 2 +- .../intFreshdeskAccount/intFreshdeskAccount.rpc.js | 2 +- server/api/intFreshdeskConfiguration/index.js | 2 +- .../intFreshdeskConfiguration.attributes.js | 2 +- .../intFreshdeskConfiguration.controller.js | 2 +- .../intFreshdeskConfiguration.model.js | 2 +- .../intFreshdeskConfiguration.rpc.js | 2 +- server/api/intFreshdeskField/index.js | 2 +- .../intFreshdeskField.attributes.js | 2 +- .../intFreshdeskField.controller.js | 2 +- .../intFreshdeskField/intFreshdeskField.model.js | 2 +- .../api/intFreshdeskField/intFreshdeskField.rpc.js | 2 +- server/api/intFreshsalesAccount/index.js | 2 +- .../intFreshsalesAccount.attributes.js | 2 +- .../intFreshsalesAccount.controller.js | 2 +- .../intFreshsalesAccount.model.js | 2 +- .../intFreshsalesAccount.rpc.js | 2 +- server/api/intFreshsalesConfiguration/index.js | 2 +- .../intFreshsalesConfiguration.attributes.js | 2 +- .../intFreshsalesConfiguration.controller.js | 2 +- .../intFreshsalesConfiguration.model.js | 2 +- .../intFreshsalesConfiguration.rpc.js | 2 +- server/api/intFreshsalesField/index.js | 2 +- .../intFreshsalesField.attributes.js | 2 +- .../intFreshsalesField.controller.js | 2 +- .../intFreshsalesField/intFreshsalesField.model.js | 2 +- .../intFreshsalesField/intFreshsalesField.rpc.js | 2 +- server/api/intSalesforceAccount/index.js | 2 +- .../intSalesforceAccount.attributes.js | 2 +- .../intSalesforceAccount.controller.js | 2 +- .../intSalesforceAccount.model.js | 2 +- .../intSalesforceAccount.rpc.js | 2 +- server/api/intSalesforceConfiguration/index.js | 2 +- .../intSalesforceConfiguration.attributes.js | 2 +- .../intSalesforceConfiguration.controller.js | 2 +- .../intSalesforceConfiguration.model.js | 2 +- .../intSalesforceConfiguration.rpc.js | 2 +- server/api/intSalesforceField/index.js | 2 +- .../intSalesforceField.attributes.js | 2 +- .../intSalesforceField.controller.js | 2 +- .../intSalesforceField/intSalesforceField.model.js | 2 +- .../intSalesforceField/intSalesforceField.rpc.js | 2 +- server/api/intServicenowAccount/index.js | 2 +- .../intServicenowAccount.attributes.js | 2 +- .../intServicenowAccount.controller.js | 2 +- .../intServicenowAccount.model.js | 2 +- .../intServicenowAccount.rpc.js | 2 +- server/api/intServicenowConfiguration/index.js | 2 +- .../intServicenowConfiguration.attributes.js | 2 +- .../intServicenowConfiguration.controller.js | 2 +- .../intServicenowConfiguration.model.js | 2 +- .../intServicenowConfiguration.rpc.js | 2 +- server/api/intServicenowField/index.js | 2 +- .../intServicenowField.attributes.js | 2 +- .../intServicenowField.controller.js | 2 +- .../intServicenowField/intServicenowField.model.js | 2 +- .../intServicenowField/intServicenowField.rpc.js | 2 +- server/api/intSugarcrmAccount/index.js | 2 +- .../intSugarcrmAccount.attributes.js | 2 +- .../intSugarcrmAccount.controller.js | 2 +- .../intSugarcrmAccount/intSugarcrmAccount.model.js | 2 +- .../intSugarcrmAccount/intSugarcrmAccount.rpc.js | 2 +- server/api/intSugarcrmConfiguration/index.js | 2 +- .../intSugarcrmConfiguration.attributes.js | 2 +- .../intSugarcrmConfiguration.controller.js | 2 +- .../intSugarcrmConfiguration.model.js | 2 +- .../intSugarcrmConfiguration.rpc.js | 2 +- server/api/intSugarcrmField/index.js | 2 +- .../intSugarcrmField.attributes.js | 2 +- .../intSugarcrmField.controller.js | 2 +- .../api/intSugarcrmField/intSugarcrmField.model.js | 2 +- .../api/intSugarcrmField/intSugarcrmField.rpc.js | 2 +- server/api/intVtigerAccount/index.js | 2 +- .../intVtigerAccount.attributes.js | 2 +- .../intVtigerAccount.controller.js | 2 +- .../api/intVtigerAccount/intVtigerAccount.model.js | 2 +- .../api/intVtigerAccount/intVtigerAccount.rpc.js | 2 +- server/api/intVtigerConfiguration/index.js | 2 +- .../intVtigerConfiguration.attributes.js | 2 +- .../intVtigerConfiguration.controller.js | 2 +- .../intVtigerConfiguration.model.js | 2 +- .../intVtigerConfiguration.rpc.js | 2 +- server/api/intVtigerField/index.js | 2 +- .../intVtigerField/intVtigerField.attributes.js | 2 +- .../intVtigerField/intVtigerField.controller.js | 2 +- server/api/intVtigerField/intVtigerField.model.js | 2 +- server/api/intVtigerField/intVtigerField.rpc.js | 2 +- server/api/intZendeskAccount/index.js | 2 +- .../intZendeskAccount.attributes.js | 2 +- .../intZendeskAccount.controller.js | 2 +- .../intZendeskAccount/intZendeskAccount.model.js | 2 +- .../api/intZendeskAccount/intZendeskAccount.rpc.js | 2 +- server/api/intZendeskConfiguration/index.js | 2 +- .../intZendeskConfiguration.attributes.js | 2 +- .../intZendeskConfiguration.controller.js | 2 +- .../intZendeskConfiguration.model.js | 2 +- .../intZendeskConfiguration.rpc.js | 2 +- server/api/intZendeskField/index.js | 2 +- .../intZendeskField/intZendeskField.attributes.js | 2 +- .../intZendeskField/intZendeskField.controller.js | 2 +- .../api/intZendeskField/intZendeskField.model.js | 2 +- server/api/intZendeskField/intZendeskField.rpc.js | 2 +- server/api/intZohoAccount/index.js | 2 +- .../intZohoAccount/intZohoAccount.attributes.js | 2 +- .../intZohoAccount/intZohoAccount.controller.js | 2 +- server/api/intZohoAccount/intZohoAccount.model.js | 2 +- server/api/intZohoAccount/intZohoAccount.rpc.js | 2 +- server/api/intZohoConfiguration/index.js | 2 +- .../intZohoConfiguration.attributes.js | 2 +- .../intZohoConfiguration.controller.js | 2 +- .../intZohoConfiguration.model.js | 2 +- .../intZohoConfiguration.rpc.js | 2 +- server/api/intZohoField/index.js | 2 +- server/api/intZohoField/intZohoField.attributes.js | 2 +- server/api/intZohoField/intZohoField.controller.js | 2 +- server/api/intZohoField/intZohoField.model.js | 2 +- server/api/intZohoField/intZohoField.rpc.js | 2 +- server/api/integration/index.js | 2 +- server/api/integration/integration.attributes.js | 2 +- server/api/integration/integration.controller.js | 2 +- server/api/integration/integration.model.js | 2 +- server/api/integration/integration.rpc.js | 2 +- server/api/integrationReport/index.js | 2 +- .../integrationReport.attributes.js | 2 +- .../integrationReport.controller.js | 2 +- .../integrationReport/integrationReport.model.js | 2 +- .../api/integrationReport/integrationReport.rpc.js | 2 +- server/api/interval/index.js | 2 +- server/api/interval/interval.attributes.js | 2 +- server/api/interval/interval.controller.js | 2 +- server/api/interval/interval.model.js | 2 +- server/api/interval/interval.rpc.js | 2 +- server/api/jira/index.js | 2 +- server/api/jira/jira.controller.js | 2 +- server/api/jscriptyAnswerReport/index.js | 2 +- .../jscriptyAnswerReport.attributes.js | 2 +- .../jscriptyAnswerReport.controller.js | 2 +- .../jscriptyAnswerReport.model.js | 2 +- .../jscriptyAnswerReport.rpc.js | 2 +- server/api/jscriptyProject/index.js | 2 +- .../jscriptyProject/jscriptyProject.attributes.js | 2 +- .../jscriptyProject/jscriptyProject.controller.js | 2 +- .../api/jscriptyProject/jscriptyProject.model.js | 2 +- server/api/jscriptyProject/jscriptyProject.rpc.js | 2 +- server/api/jscriptyQuestionReport/index.js | 2 +- .../jscriptyQuestionReport.attributes.js | 2 +- .../jscriptyQuestionReport.controller.js | 2 +- .../jscriptyQuestionReport.model.js | 2 +- .../jscriptyQuestionReport.rpc.js | 2 +- server/api/jscriptySessionReport/index.js | 2 +- .../jscriptySessionReport.attributes.js | 2 +- .../jscriptySessionReport.controller.js | 2 +- .../jscriptySessionReport.model.js | 2 +- .../jscriptySessionReport.rpc.js | 2 +- server/api/license/index.js | 2 +- server/api/license/license.attributes.js | 2 +- server/api/license/license.controller.js | 2 +- server/api/license/license.model.js | 2 +- server/api/license/license.rpc.js | 2 +- server/api/mailAccount/index.js | 2 +- server/api/mailAccount/mailAccount.attributes.js | 2 +- server/api/mailAccount/mailAccount.controller.js | 2 +- server/api/mailAccount/mailAccount.events.js | 2 +- server/api/mailAccount/mailAccount.model.js | 2 +- server/api/mailAccount/mailAccount.rpc.js | 2 +- server/api/mailAccount/mailAccount.socket.js | 2 +- server/api/mailApplication/index.js | 2 +- .../mailApplication/mailApplication.attributes.js | 2 +- .../mailApplication/mailApplication.controller.js | 2 +- .../api/mailApplication/mailApplication.model.js | 2 +- server/api/mailApplication/mailApplication.rpc.js | 2 +- server/api/mailInteraction/index.js | 2 +- .../mailInteraction/mailInteraction.attributes.js | 2 +- .../mailInteraction/mailInteraction.controller.js | 2 +- .../api/mailInteraction/mailInteraction.events.js | 2 +- .../api/mailInteraction/mailInteraction.model.js | 2 +- server/api/mailInteraction/mailInteraction.rpc.js | 2 +- .../api/mailInteraction/mailInteraction.socket.js | 2 +- server/api/mailMessage/index.js | 2 +- server/api/mailMessage/mailMessage.attributes.js | 2 +- server/api/mailMessage/mailMessage.controller.js | 2 +- server/api/mailMessage/mailMessage.events.js | 2 +- server/api/mailMessage/mailMessage.model.js | 2 +- server/api/mailMessage/mailMessage.rpc.js | 2 +- server/api/mailMessage/mailMessage.socket.js | 2 +- server/api/mailQueue/index.js | 2 +- server/api/mailQueue/mailQueue.attributes.js | 2 +- server/api/mailQueue/mailQueue.controller.js | 2 +- server/api/mailQueue/mailQueue.events.js | 2 +- server/api/mailQueue/mailQueue.model.js | 2 +- server/api/mailQueue/mailQueue.rpc.js | 2 +- server/api/mailQueue/mailQueue.socket.js | 2 +- server/api/mailQueueReport/index.js | 2 +- .../mailQueueReport/mailQueueReport.attributes.js | 2 +- .../mailQueueReport/mailQueueReport.controller.js | 2 +- .../api/mailQueueReport/mailQueueReport.model.js | 2 +- server/api/mailQueueReport/mailQueueReport.rpc.js | 2 +- server/api/mailServerIn/index.js | 2 +- server/api/mailServerIn/mailServerIn.attributes.js | 2 +- server/api/mailServerIn/mailServerIn.model.js | 2 +- server/api/mailServerIn/mailServerIn.rpc.js | 2 +- server/api/mailServerOut/index.js | 2 +- .../api/mailServerOut/mailServerOut.attributes.js | 2 +- .../api/mailServerOut/mailServerOut.controller.js | 2 +- server/api/mailServerOut/mailServerOut.model.js | 2 +- server/api/mailServerOut/mailServerOut.rpc.js | 2 +- server/api/mailSubstatus/index.js | 2 +- .../api/mailSubstatus/mailSubstatus.attributes.js | 2 +- .../api/mailSubstatus/mailSubstatus.controller.js | 2 +- server/api/mailSubstatus/mailSubstatus.events.js | 2 +- server/api/mailSubstatus/mailSubstatus.model.js | 2 +- server/api/mailSubstatus/mailSubstatus.rpc.js | 2 +- server/api/mailTransferReport/index.js | 2 +- .../mailTransferReport.attributes.js | 2 +- .../mailTransferReport.controller.js | 2 +- .../mailTransferReport/mailTransferReport.model.js | 2 +- .../mailTransferReport/mailTransferReport.rpc.js | 2 +- server/api/memberReport/index.js | 2 +- server/api/memberReport/memberReport.attributes.js | 2 +- server/api/memberReport/memberReport.controller.js | 2 +- server/api/memberReport/memberReport.model.js | 2 +- server/api/memberReport/memberReport.rpc.js | 2 +- server/api/migration/index.js | 2 +- server/api/migration/migration.attributes.js | 2 +- server/api/migration/migration.controller.js | 2 +- server/api/migration/migration.model.js | 2 +- server/api/migration/migration.rpc.js | 2 +- server/api/network/index.js | 2 +- server/api/network/network.attributes.js | 2 +- server/api/network/network.controller.js | 2 +- server/api/network/network.model.js | 2 +- server/api/network/network.rpc.js | 2 +- server/api/openchannelAccount/index.js | 2 +- .../openchannelAccount.attributes.js | 2 +- .../openchannelAccount.controller.js | 2 +- .../openchannelAccount.events.js | 2 +- .../openchannelAccount/openchannelAccount.model.js | 2 +- .../openchannelAccount/openchannelAccount.rpc.js | 2 +- .../openchannelAccount.socket.js | 2 +- server/api/openchannelApplication/index.js | 2 +- .../openchannelApplication.attributes.js | 2 +- .../openchannelApplication.controller.js | 2 +- .../openchannelApplication.model.js | 2 +- .../openchannelApplication.rpc.js | 2 +- server/api/openchannelInteraction/index.js | 2 +- .../openchannelInteraction.attributes.js | 2 +- .../openchannelInteraction.controller.js | 2 +- .../openchannelInteraction.events.js | 2 +- .../openchannelInteraction.model.js | 2 +- .../openchannelInteraction.rpc.js | 2 +- .../openchannelInteraction.socket.js | 2 +- server/api/openchannelMessage/index.js | 2 +- .../openchannelMessage.attributes.js | 2 +- .../openchannelMessage.controller.js | 2 +- .../openchannelMessage.events.js | 2 +- .../openchannelMessage/openchannelMessage.model.js | 2 +- .../openchannelMessage/openchannelMessage.rpc.js | 2 +- .../openchannelMessage.socket.js | 2 +- server/api/openchannelQueue/index.js | 2 +- .../openchannelQueue.attributes.js | 2 +- .../openchannelQueue.controller.js | 2 +- .../openchannelQueue/openchannelQueue.events.js | 2 +- .../api/openchannelQueue/openchannelQueue.model.js | 2 +- .../api/openchannelQueue/openchannelQueue.rpc.js | 2 +- .../openchannelQueue/openchannelQueue.socket.js | 2 +- server/api/openchannelQueueReport/index.js | 2 +- .../openchannelQueueReport.attributes.js | 2 +- .../openchannelQueueReport.controller.js | 2 +- .../openchannelQueueReport.model.js | 2 +- .../openchannelQueueReport.rpc.js | 2 +- server/api/openchannelTransferReport/index.js | 2 +- .../openchannelTransferReport.attributes.js | 2 +- .../openchannelTransferReport.controller.js | 2 +- .../openchannelTransferReport.model.js | 2 +- .../openchannelTransferReport.rpc.js | 2 +- server/api/pause/index.js | 2 +- server/api/pause/pause.attributes.js | 2 +- server/api/pause/pause.controller.js | 2 +- server/api/pause/pause.model.js | 2 +- server/api/pause/pause.rpc.js | 2 +- server/api/plugin/index.js | 2 +- server/api/plugin/plugin.attributes.js | 2 +- server/api/plugin/plugin.controller.js | 2 +- server/api/plugin/plugin.events.js | 2 +- server/api/plugin/plugin.model.js | 2 +- server/api/plugin/plugin.rpc.js | 2 +- server/api/plugin/plugin.socket.js | 2 +- server/api/pm2/index.js | 2 +- server/api/pm2/pm2.controller.js | 2 +- server/api/realtime/index.js | 2 +- server/api/realtime/realtime.controller.js | 2 +- server/api/reportAgentPreview/index.js | 2 +- .../reportAgentPreview.attributes.js | 2 +- .../reportAgentPreview/reportAgentPreview.model.js | 2 +- .../reportAgentPreview/reportAgentPreview.rpc.js | 2 +- server/api/rpc/index.js | 2 +- server/api/rpc/rpc.controller.js | 2 +- server/api/schedule/index.js | 2 +- server/api/schedule/schedule.attributes.js | 2 +- server/api/schedule/schedule.controller.js | 2 +- server/api/schedule/schedule.model.js | 2 +- server/api/schedule/schedule.rpc.js | 2 +- server/api/screenRecording/index.js | 2 +- .../screenRecording/screenRecording.attributes.js | 2 +- .../screenRecording/screenRecording.controller.js | 2 +- .../api/screenRecording/screenRecording.model.js | 2 +- server/api/screenRecording/screenRecording.rpc.js | 2 +- server/api/setting/index.js | 2 +- server/api/setting/setting.attributes.js | 2 +- server/api/setting/setting.controller.js | 2 +- server/api/setting/setting.model.js | 2 +- server/api/setting/setting.rpc.js | 2 +- server/api/smsAccount/index.js | 2 +- server/api/smsAccount/smsAccount.attributes.js | 2 +- server/api/smsAccount/smsAccount.controller.js | 2 +- server/api/smsAccount/smsAccount.events.js | 2 +- server/api/smsAccount/smsAccount.model.js | 2 +- server/api/smsAccount/smsAccount.rpc.js | 2 +- server/api/smsAccount/smsAccount.socket.js | 2 +- server/api/smsApplication/index.js | 2 +- .../smsApplication/smsApplication.attributes.js | 2 +- .../smsApplication/smsApplication.controller.js | 2 +- server/api/smsApplication/smsApplication.model.js | 2 +- server/api/smsApplication/smsApplication.rpc.js | 2 +- server/api/smsInteraction/index.js | 2 +- .../smsInteraction/smsInteraction.attributes.js | 2 +- .../smsInteraction/smsInteraction.controller.js | 2 +- server/api/smsInteraction/smsInteraction.events.js | 2 +- server/api/smsInteraction/smsInteraction.model.js | 2 +- server/api/smsInteraction/smsInteraction.rpc.js | 2 +- server/api/smsInteraction/smsInteraction.socket.js | 2 +- server/api/smsMessage/index.js | 2 +- server/api/smsMessage/smsMessage.attributes.js | 2 +- server/api/smsMessage/smsMessage.controller.js | 2 +- server/api/smsMessage/smsMessage.events.js | 2 +- server/api/smsMessage/smsMessage.model.js | 2 +- server/api/smsMessage/smsMessage.rpc.js | 2 +- server/api/smsMessage/smsMessage.socket.js | 2 +- server/api/smsQueue/index.js | 2 +- server/api/smsQueue/smsQueue.attributes.js | 2 +- server/api/smsQueue/smsQueue.controller.js | 2 +- server/api/smsQueue/smsQueue.events.js | 2 +- server/api/smsQueue/smsQueue.model.js | 2 +- server/api/smsQueue/smsQueue.rpc.js | 2 +- server/api/smsQueue/smsQueue.socket.js | 2 +- server/api/smsQueueReport/index.js | 2 +- .../smsQueueReport/smsQueueReport.attributes.js | 2 +- .../smsQueueReport/smsQueueReport.controller.js | 2 +- server/api/smsQueueReport/smsQueueReport.model.js | 2 +- server/api/smsQueueReport/smsQueueReport.rpc.js | 2 +- server/api/smsTransferReport/index.js | 2 +- .../smsTransferReport.attributes.js | 2 +- .../smsTransferReport.controller.js | 2 +- .../smsTransferReport/smsTransferReport.model.js | 2 +- .../api/smsTransferReport/smsTransferReport.rpc.js | 2 +- server/api/sound/index.js | 2 +- server/api/sound/sound.attributes.js | 2 +- server/api/sound/sound.controller.js | 2 +- server/api/sound/sound.model.js | 2 +- server/api/sound/sound.rpc.js | 2 +- server/api/squareMessage/index.js | 2 +- .../api/squareMessage/squareMessage.attributes.js | 2 +- .../api/squareMessage/squareMessage.controller.js | 2 +- server/api/squareMessage/squareMessage.model.js | 2 +- server/api/squareMessage/squareMessage.rpc.js | 2 +- server/api/squareOdbc/index.js | 2 +- server/api/squareOdbc/squareOdbc.attributes.js | 2 +- server/api/squareOdbc/squareOdbc.controller.js | 2 +- server/api/squareOdbc/squareOdbc.model.js | 2 +- server/api/squareOdbc/squareOdbc.rpc.js | 2 +- server/api/squareProject/index.js | 2 +- .../api/squareProject/squareProject.attributes.js | 2 +- .../api/squareProject/squareProject.controller.js | 2 +- server/api/squareProject/squareProject.events.js | 2 +- server/api/squareProject/squareProject.model.js | 2 +- server/api/squareProject/squareProject.rpc.js | 2 +- server/api/squareProject/squareProject.socket.js | 2 +- server/api/squareRecording/index.js | 2 +- .../squareRecording/squareRecording.attributes.js | 2 +- .../squareRecording/squareRecording.controller.js | 2 +- .../api/squareRecording/squareRecording.model.js | 2 +- server/api/squareRecording/squareRecording.rpc.js | 2 +- server/api/squareReport/index.js | 2 +- server/api/squareReport/squareReport.attributes.js | 2 +- server/api/squareReport/squareReport.controller.js | 2 +- server/api/squareReport/squareReport.model.js | 2 +- server/api/squareReport/squareReport.rpc.js | 2 +- server/api/squareReportDetail/index.js | 2 +- .../squareReportDetail.attributes.js | 2 +- .../squareReportDetail.controller.js | 2 +- .../squareReportDetail/squareReportDetail.model.js | 2 +- .../squareReportDetail/squareReportDetail.rpc.js | 2 +- server/api/system/index.js | 2 +- server/api/system/system.controller.js | 2 +- server/api/tag/index.js | 2 +- server/api/tag/tag.attributes.js | 2 +- server/api/tag/tag.controller.js | 2 +- server/api/tag/tag.model.js | 2 +- server/api/tag/tag.rpc.js | 2 +- server/api/team/index.js | 2 +- server/api/team/team.attributes.js | 2 +- server/api/team/team.controller.js | 2 +- server/api/team/team.events.js | 2 +- server/api/team/team.model.js | 2 +- server/api/team/team.rpc.js | 2 +- server/api/team/team.socket.js | 2 +- .../teamVoicePrefix/teamVoicePrefix.attributes.js | 2 +- .../api/teamVoicePrefix/teamVoicePrefix.model.js | 2 +- server/api/teamVoiceQueue/index.js | 2 +- .../teamVoiceQueue/teamVoiceQueue.attributes.js | 2 +- server/api/teamVoiceQueue/teamVoiceQueue.model.js | 2 +- server/api/teamVoiceQueue/teamVoiceQueue.rpc.js | 2 +- server/api/template/index.js | 2 +- server/api/template/template.attributes.js | 2 +- server/api/template/template.controller.js | 2 +- server/api/template/template.model.js | 2 +- server/api/template/template.rpc.js | 2 +- server/api/trigger/index.js | 2 +- server/api/trigger/trigger.attributes.js | 2 +- server/api/trigger/trigger.controller.js | 2 +- server/api/trigger/trigger.model.js | 2 +- server/api/trigger/trigger.rpc.js | 2 +- server/api/trunk/index.js | 2 +- server/api/trunk/trunk.attributes.js | 2 +- server/api/trunk/trunk.controller.js | 2 +- server/api/trunk/trunk.model.js | 2 +- server/api/trunk/trunk.rpc.js | 2 +- server/api/user-setting/index.js | 2 +- server/api/user-setting/user-setting.attributes.js | 2 +- server/api/user-setting/user-setting.controller.js | 2 +- server/api/user-setting/user-setting.events.js | 2 +- server/api/user-setting/user-setting.model.js | 2 +- server/api/user-setting/user-setting.socket.js | 2 +- server/api/user/index.js | 2 +- server/api/user/user.attributes.js | 2 +- server/api/user/user.controller.js | 2 +- server/api/user/user.events.js | 2 +- server/api/user/user.model.js | 2 +- server/api/user/user.rpc.js | 2 +- server/api/user/user.socket.js | 2 +- server/api/userChatQueue/index.js | 2 +- .../api/userChatQueue/userChatQueue.attributes.js | 2 +- server/api/userChatQueue/userChatQueue.model.js | 2 +- server/api/userChatQueue/userChatQueue.rpc.js | 2 +- server/api/userFaxQueue/index.js | 2 +- server/api/userFaxQueue/userFaxQueue.attributes.js | 2 +- server/api/userFaxQueue/userFaxQueue.model.js | 2 +- server/api/userFaxQueue/userFaxQueue.rpc.js | 2 +- server/api/userMailQueue/index.js | 2 +- .../api/userMailQueue/userMailQueue.attributes.js | 2 +- server/api/userMailQueue/userMailQueue.model.js | 2 +- server/api/userMailQueue/userMailQueue.rpc.js | 2 +- server/api/userNotification/index.js | 2 +- .../userNotification.attributes.js | 2 +- .../userNotification.controller.js | 2 +- .../userNotification/userNotification.events.js | 2 +- .../api/userNotification/userNotification.model.js | 2 +- .../api/userNotification/userNotification.rpc.js | 2 +- .../userNotification/userNotification.socket.js | 2 +- server/api/userOpenchannelQueue/index.js | 2 +- .../userOpenchannelQueue.attributes.js | 2 +- .../userOpenchannelQueue.model.js | 2 +- .../userOpenchannelQueue.rpc.js | 2 +- server/api/userProfile/index.js | 2 +- server/api/userProfile/userProfile.attributes.js | 2 +- server/api/userProfile/userProfile.controller.js | 2 +- server/api/userProfile/userProfile.events.js | 2 +- server/api/userProfile/userProfile.model.js | 2 +- server/api/userProfile/userProfile.rpc.js | 2 +- server/api/userProfile/userProfile.socket.js | 2 +- server/api/userProfileResource/index.js | 2 +- .../userProfileResource.attributes.js | 2 +- .../userProfileResource.controller.js | 2 +- .../userProfileResource.model.js | 2 +- .../userProfileResource/userProfileResource.rpc.js | 2 +- server/api/userProfileSection/index.js | 2 +- .../userProfileSection.attributes.js | 2 +- .../userProfileSection.controller.js | 2 +- .../userProfileSection/userProfileSection.model.js | 2 +- .../userProfileSection/userProfileSection.rpc.js | 2 +- server/api/userSmsQueue/index.js | 2 +- server/api/userSmsQueue/userSmsQueue.attributes.js | 2 +- server/api/userSmsQueue/userSmsQueue.model.js | 2 +- server/api/userSmsQueue/userSmsQueue.rpc.js | 2 +- .../userVoicePrefix/userVoicePrefix.attributes.js | 2 +- .../api/userVoicePrefix/userVoicePrefix.model.js | 2 +- server/api/userVoiceQueue/index.js | 2 +- .../userVoiceQueue/userVoiceQueue.attributes.js | 2 +- server/api/userVoiceQueue/userVoiceQueue.model.js | 2 +- server/api/userVoiceQueue/userVoiceQueue.rpc.js | 2 +- server/api/userVoiceQueueRt/index.js | 2 +- .../userVoiceQueueRt.attributes.js | 2 +- .../userVoiceQueueRt/userVoiceQueueRt.events.js | 2 +- .../api/userVoiceQueueRt/userVoiceQueueRt.model.js | 2 +- .../api/userVoiceQueueRt/userVoiceQueueRt.rpc.js | 2 +- .../userVoiceQueueRt/userVoiceQueueRt.socket.js | 2 +- server/api/userWhatsappQueue/index.js | 2 +- .../userWhatsappQueue.attributes.js | 2 +- .../userWhatsappQueue/userWhatsappQueue.model.js | 2 +- .../api/userWhatsappQueue/userWhatsappQueue.rpc.js | 2 +- server/api/variable/index.js | 2 +- server/api/variable/variable.attributes.js | 2 +- server/api/variable/variable.controller.js | 2 +- server/api/variable/variable.model.js | 2 +- server/api/variable/variable.rpc.js | 2 +- server/api/version/index.js | 2 +- server/api/version/version.controller.js | 2 +- server/api/voiceAgentReport/index.js | 2 +- .../voiceAgentReport.attributes.js | 2 +- .../voiceAgentReport.controller.js | 2 +- .../api/voiceAgentReport/voiceAgentReport.model.js | 2 +- .../api/voiceAgentReport/voiceAgentReport.rpc.js | 2 +- server/api/voiceCallReport/index.js | 2 +- .../voiceCallReport/voiceCallReport.attributes.js | 2 +- .../voiceCallReport/voiceCallReport.controller.js | 2 +- .../api/voiceCallReport/voiceCallReport.model.js | 2 +- server/api/voiceCallReport/voiceCallReport.rpc.js | 2 +- server/api/voiceChanSpy/index.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.attributes.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.controller.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.model.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.rpc.js | 2 +- server/api/voiceContext/index.js | 2 +- server/api/voiceContext/voiceContext.attributes.js | 2 +- server/api/voiceContext/voiceContext.controller.js | 2 +- server/api/voiceContext/voiceContext.model.js | 2 +- server/api/voiceContext/voiceContext.rpc.js | 2 +- server/api/voiceDialReport/index.js | 2 +- .../voiceDialReport/voiceDialReport.attributes.js | 2 +- .../voiceDialReport/voiceDialReport.controller.js | 2 +- .../api/voiceDialReport/voiceDialReport.model.js | 2 +- server/api/voiceDialReport/voiceDialReport.rpc.js | 2 +- server/api/voiceExtension/index.js | 2 +- .../voiceExtension/voiceExtension.attributes.js | 2 +- .../voiceExtension/voiceExtension.controller.js | 2 +- server/api/voiceExtension/voiceExtension.events.js | 2 +- server/api/voiceExtension/voiceExtension.model.js | 2 +- server/api/voiceExtension/voiceExtension.rpc.js | 2 +- server/api/voiceExtension/voiceExtension.socket.js | 2 +- server/api/voiceMail/index.js | 2 +- server/api/voiceMail/voiceMail.attributes.js | 2 +- server/api/voiceMail/voiceMail.controller.js | 2 +- server/api/voiceMail/voiceMail.model.js | 2 +- server/api/voiceMail/voiceMail.rpc.js | 2 +- server/api/voiceMailMessage/index.js | 2 +- .../voiceMailMessage.attributes.js | 2 +- .../voiceMailMessage.controller.js | 2 +- .../api/voiceMailMessage/voiceMailMessage.model.js | 2 +- .../api/voiceMailMessage/voiceMailMessage.rpc.js | 2 +- server/api/voiceMusicOnHold/index.js | 2 +- .../voiceMusicOnHold.attributes.js | 2 +- .../voiceMusicOnHold.controller.js | 2 +- .../api/voiceMusicOnHold/voiceMusicOnHold.model.js | 2 +- .../api/voiceMusicOnHold/voiceMusicOnHold.rpc.js | 2 +- server/api/voicePrefix/index.js | 2 +- server/api/voicePrefix/voicePrefix.attributes.js | 2 +- server/api/voicePrefix/voicePrefix.controller.js | 2 +- server/api/voicePrefix/voicePrefix.events.js | 2 +- server/api/voicePrefix/voicePrefix.model.js | 2 +- server/api/voicePrefix/voicePrefix.rpc.js | 2 +- server/api/voicePrefix/voicePrefix.socket.js | 2 +- server/api/voiceQueue/index.js | 2 +- server/api/voiceQueue/voiceQueue.attributes.js | 2 +- server/api/voiceQueue/voiceQueue.controller.js | 2 +- server/api/voiceQueue/voiceQueue.events.js | 2 +- server/api/voiceQueue/voiceQueue.model.js | 2 +- server/api/voiceQueue/voiceQueue.rpc.js | 2 +- server/api/voiceQueue/voiceQueue.socket.js | 2 +- server/api/voiceQueueReport/index.js | 2 +- .../voiceQueueReport.attributes.js | 2 +- .../voiceQueueReport.controller.js | 2 +- .../voiceQueueReport/voiceQueueReport.events.js | 2 +- .../api/voiceQueueReport/voiceQueueReport.model.js | 2 +- .../api/voiceQueueReport/voiceQueueReport.rpc.js | 2 +- .../voiceQueueReport/voiceQueueReport.socket.js | 2 +- server/api/voiceQueuesLog/index.js | 2 +- .../voiceQueuesLog/voiceQueuesLog.attributes.js | 2 +- .../voiceQueuesLog/voiceQueuesLog.controller.js | 2 +- server/api/voiceQueuesLog/voiceQueuesLog.model.js | 2 +- server/api/voiceQueuesLog/voiceQueuesLog.rpc.js | 2 +- server/api/voiceRecording/index.js | 2 +- .../voiceRecording/voiceRecording.attributes.js | 2 +- .../voiceRecording/voiceRecording.controller.js | 2 +- server/api/voiceRecording/voiceRecording.model.js | 2 +- server/api/voiceRecording/voiceRecording.rpc.js | 2 +- server/api/voiceTransferReport/index.js | 2 +- .../voiceTransferReport.attributes.js | 2 +- .../voiceTransferReport.controller.js | 2 +- .../voiceTransferReport.model.js | 2 +- .../voiceTransferReport/voiceTransferReport.rpc.js | 2 +- server/api/webbar/index.js | 2 +- server/api/webbar/webbar.controller.js | 2 +- server/api/whatsappAccount/index.js | 2 +- .../whatsappAccount/whatsappAccount.attributes.js | 2 +- .../whatsappAccount/whatsappAccount.controller.js | 2 +- .../api/whatsappAccount/whatsappAccount.events.js | 2 +- .../api/whatsappAccount/whatsappAccount.model.js | 2 +- server/api/whatsappAccount/whatsappAccount.rpc.js | 2 +- .../api/whatsappAccount/whatsappAccount.socket.js | 2 +- server/api/whatsappApplication/index.js | 2 +- .../whatsappApplication.attributes.js | 2 +- .../whatsappApplication.controller.js | 2 +- .../whatsappApplication.model.js | 2 +- .../whatsappApplication/whatsappApplication.rpc.js | 2 +- server/api/whatsappInteraction/index.js | 2 +- .../whatsappInteraction.attributes.js | 2 +- .../whatsappInteraction.controller.js | 2 +- .../whatsappInteraction.events.js | 2 +- .../whatsappInteraction.model.js | 2 +- .../whatsappInteraction/whatsappInteraction.rpc.js | 2 +- .../whatsappInteraction.socket.js | 2 +- server/api/whatsappMessage/index.js | 2 +- .../whatsappMessage/whatsappMessage.attributes.js | 2 +- .../whatsappMessage/whatsappMessage.controller.js | 2 +- .../api/whatsappMessage/whatsappMessage.events.js | 2 +- .../api/whatsappMessage/whatsappMessage.model.js | 2 +- server/api/whatsappMessage/whatsappMessage.rpc.js | 2 +- .../api/whatsappMessage/whatsappMessage.socket.js | 2 +- server/api/whatsappQueue/index.js | 2 +- .../api/whatsappQueue/whatsappQueue.attributes.js | 2 +- .../api/whatsappQueue/whatsappQueue.controller.js | 2 +- server/api/whatsappQueue/whatsappQueue.events.js | 2 +- server/api/whatsappQueue/whatsappQueue.model.js | 2 +- server/api/whatsappQueue/whatsappQueue.rpc.js | 2 +- server/api/whatsappQueue/whatsappQueue.socket.js | 2 +- server/api/whatsappQueueReport/index.js | 2 +- .../whatsappQueueReport.attributes.js | 2 +- .../whatsappQueueReport.controller.js | 2 +- .../whatsappQueueReport.model.js | 2 +- .../whatsappQueueReport/whatsappQueueReport.rpc.js | 2 +- server/api/whatsappTransferReport/index.js | 2 +- .../whatsappTransferReport.attributes.js | 2 +- .../whatsappTransferReport.controller.js | 2 +- .../whatsappTransferReport.model.js | 2 +- .../whatsappTransferReport.rpc.js | 2 +- server/app.js | 2 +- server/components/auth/service.js | 2 +- server/components/encryptor/index.js | 2 +- server/components/export/csv.js | 2 +- server/components/export/pdf.js | 2 +- server/components/export/xlsx.js | 2 +- server/components/extensions/rewrite.js | 2 +- server/components/import/cm/csv.js | 2 +- server/components/import/cm/csv2.js | 2 +- server/components/integrations/configuration.js | 2 +- server/components/interaction/service.js | 2 +- server/components/license/service.js | 2 +- server/components/parsers/advancedSearch.js | 2 +- server/components/parsers/qs.js | 2 +- server/config/express.js | 2 +- server/config/license/hardware.js | 2 +- server/config/license/index.js | 2 +- server/config/license/util.js | 2 +- server/config/local.env.js | 2 +- server/config/logger.js | 2 +- server/config/pm2/config.js | 2 +- server/config/pm2/index.js | 2 +- server/config/schedule/chat.js | 2 +- server/config/schedule/cloud-provider.js | 2 +- server/config/schedule/index.js | 2 +- server/config/schedule/transcribe.js | 2 +- server/config/schedule/whatsapp.js | 2 +- server/config/seedContact.js | 2 +- server/config/seedUsers.js | 2 +- server/config/socketio.js | 2 +- server/config/triggers/index.js | 2 +- server/config/utils.js | 2 +- server/errors/index.js | 2 +- server/mysqldb/index.js | 2 +- server/routes.js | 2 +- server/rpc/index.js | 2 +- server/services/agi/channel.js | 2 +- server/services/agi/error.js | 2 +- server/services/agi/graph/index.js | 2 +- server/services/agi/index.js | 2 +- server/services/agi/mailRpc/index.js | 2 +- server/services/agi/reply.js | 2 +- server/services/agi/rpc/index.js | 2 +- server/services/agi/scripts/aws/index.js | 2 +- server/services/agi/scripts/aws/lex/index.js | 2 +- server/services/agi/scripts/aws/lex/lib/api.js | 2 +- server/services/agi/scripts/aws/polly/index.js | 2 +- server/services/agi/scripts/aws/polly/lib/api.js | 2 +- server/services/agi/scripts/google/asr/index.js | 2 +- server/services/agi/scripts/google/asr/lib/api.js | 2 +- server/services/agi/scripts/google/index.js | 2 +- server/services/agi/scripts/index.js | 2 +- server/services/agi/scripts/sestek/index.js | 2 +- server/services/agi/scripts/sestek/nda/index.js | 2 +- server/services/agi/scripts/tilde/asr/index.js | 2 +- server/services/agi/scripts/tilde/asr/lib/api.js | 2 +- server/services/agi/scripts/tilde/index.js | 2 +- server/services/agi/server.js | 2 +- server/services/agi/vertices.js | 2 +- server/services/ami/acw/index.js | 2 +- server/services/ami/ami.js | 2 +- server/services/ami/client.js | 2 +- server/services/ami/dialer/action.js | 2 +- server/services/ami/dialer/agentComplete.js | 2 +- server/services/ami/dialer/final.js | 2 +- server/services/ami/dialer/hangup.js | 2 +- server/services/ami/dialer/history.js | 2 +- server/services/ami/dialer/index.js | 2 +- server/services/ami/dialer/queueCallerAbandon.js | 2 +- server/services/ami/fax/action.js | 2 +- server/services/ami/fax/index.js | 2 +- server/services/ami/fax/rpcDb.js | 2 +- server/services/ami/fax/util/gs.js | 2 +- server/services/ami/fax/util/util.js | 2 +- server/services/ami/index.js | 2 +- server/services/ami/model/agent.js | 2 +- server/services/ami/model/campaign.js | 2 +- server/services/ami/model/channel.js | 2 +- server/services/ami/model/deskAccount.js | 2 +- server/services/ami/model/dynamics365Account.js | 2 +- server/services/ami/model/faxAccount.js | 2 +- server/services/ami/model/freshdeskAccount.js | 2 +- server/services/ami/model/freshsalesAccount.js | 2 +- server/services/ami/model/queueReport.js | 2 +- server/services/ami/model/salesforceAccount.js | 2 +- server/services/ami/model/servicenowAccount.js | 2 +- server/services/ami/model/sugarcrmAccount.js | 2 +- server/services/ami/model/telephone.js | 2 +- server/services/ami/model/template.js | 2 +- server/services/ami/model/trigger.js | 2 +- server/services/ami/model/trunk.js | 2 +- server/services/ami/model/voiceExtension.js | 2 +- server/services/ami/model/voiceQueue.js | 2 +- server/services/ami/model/vtigerAccount.js | 2 +- server/services/ami/model/zendeskAccount.js | 2 +- server/services/ami/model/zohoAccount.js | 2 +- server/services/ami/preview/action.js | 2 +- server/services/ami/preview/index.js | 2 +- server/services/ami/preview/rpcDb.js | 2 +- server/services/ami/preview/util/util.js | 2 +- server/services/ami/properties.js | 2 +- server/services/ami/realtime/index.js | 2 +- server/services/ami/report/index.js | 2 +- server/services/ami/report/userReport.js | 2 +- server/services/ami/report/voiceAgentReport.js | 2 +- server/services/ami/report/voiceCallReport.js | 2 +- server/services/ami/report/voiceDialReport.js | 2 +- server/services/ami/report/voiceQueueReport.js | 2 +- server/services/ami/rpc/agentReportPreview.js | 2 +- server/services/ami/rpc/attachment.js | 2 +- server/services/ami/rpc/campaign.js | 2 +- server/services/ami/rpc/cmContact.js | 2 +- server/services/ami/rpc/cmHopper.js | 2 +- server/services/ami/rpc/cmHopperBlack.js | 2 +- server/services/ami/rpc/cmHopperFinal.js | 2 +- server/services/ami/rpc/cmHopperHistory.js | 2 +- server/services/ami/rpc/faxAccount.js | 2 +- server/services/ami/rpc/faxMessage.js | 2 +- server/services/ami/rpc/integrations/desk.js | 2 +- .../services/ami/rpc/integrations/dynamics365.js | 2 +- server/services/ami/rpc/integrations/freshdesk.js | 2 +- server/services/ami/rpc/integrations/freshsales.js | 2 +- server/services/ami/rpc/integrations/salesforce.js | 2 +- server/services/ami/rpc/integrations/servicenow.js | 2 +- server/services/ami/rpc/integrations/sugarcrm.js | 2 +- server/services/ami/rpc/integrations/vtiger.js | 2 +- server/services/ami/rpc/integrations/zendesk.js | 2 +- server/services/ami/rpc/integrations/zoho.js | 2 +- server/services/ami/rpc/memberReport.js | 2 +- server/services/ami/rpc/setting.js | 2 +- server/services/ami/rpc/template.js | 2 +- server/services/ami/rpc/trigger.js | 2 +- server/services/ami/rpc/trunk.js | 2 +- server/services/ami/rpc/user.js | 2 +- server/services/ami/rpc/voiceAgentReport.js | 2 +- server/services/ami/rpc/voiceCallReport.js | 2 +- server/services/ami/rpc/voiceDialReport.js | 2 +- server/services/ami/rpc/voiceExtension.js | 2 +- server/services/ami/rpc/voiceQueue.js | 2 +- server/services/ami/rpc/voiceQueueReport.js | 2 +- server/services/ami/rpc/voiceQueueRt.js | 2 +- server/services/ami/rpc/voiceRecording.js | 2 +- server/services/ami/rpc/voiceTransferReport.js | 2 +- server/services/ami/server/index.js | 2 +- server/services/ami/trigger/cmContact/index.js | 2 +- server/services/ami/trigger/index.js | 2 +- server/services/ami/trigger/integration/desk.js | 2 +- .../ami/trigger/integration/dynamics365.js | 2 +- .../services/ami/trigger/integration/freshdesk.js | 2 +- .../services/ami/trigger/integration/freshsales.js | 2 +- server/services/ami/trigger/integration/index.js | 2 +- .../services/ami/trigger/integration/salesforce.js | 2 +- .../services/ami/trigger/integration/servicenow.js | 2 +- .../services/ami/trigger/integration/sugarcrm.js | 2 +- server/services/ami/trigger/integration/util.js | 2 +- server/services/ami/trigger/integration/vtiger.js | 2 +- server/services/ami/trigger/integration/zendesk.js | 2 +- server/services/ami/trigger/integration/zoho.js | 2 +- server/services/ami/trigger/script/index.js | 2 +- server/services/ami/trigger/urlforward/index.js | 2 +- server/services/email/client.js | 2 +- server/services/email/index.js | 2 +- server/services/email/lib/email.js | 2 +- server/services/email/lib/imap.js | 2 +- server/services/email/lib/smtp.js | 2 +- server/services/email/lib/utils.js | 2 +- server/services/email/model/mailAccount.js | 2 +- server/services/email/realtime/index.js | 2 +- server/services/email/rpc/mailAccount.js | 2 +- server/services/email/rpc/setting.js | 2 +- server/services/email/server/index.js | 2 +- server/services/express/index.js | 2 +- server/services/routing/client.js | 2 +- server/services/routing/index.js | 2 +- server/services/routing/lib/rule-engine.js | 2 +- server/services/routing/mailRpc/index.js | 2 +- server/services/routing/model/agent.js | 2 +- server/services/routing/model/chatQueue.js | 2 +- server/services/routing/model/faxQueue.js | 2 +- server/services/routing/model/interval.js | 2 +- server/services/routing/model/mailQueue.js | 2 +- server/services/routing/model/openchannelQueue.js | 2 +- server/services/routing/model/smsQueue.js | 2 +- server/services/routing/model/whatsappQueue.js | 2 +- server/services/routing/realtime/index.js | 2 +- server/services/routing/rpc/chatInteraction.js | 2 +- server/services/routing/rpc/chatMessage.js | 2 +- server/services/routing/rpc/chatQueue.js | 2 +- server/services/routing/rpc/chatQueueReport.js | 2 +- server/services/routing/rpc/faxInteraction.js | 2 +- server/services/routing/rpc/faxMessage.js | 2 +- server/services/routing/rpc/faxQueue.js | 2 +- server/services/routing/rpc/faxQueueReport.js | 2 +- server/services/routing/rpc/interval.js | 2 +- server/services/routing/rpc/mailInteraction.js | 2 +- server/services/routing/rpc/mailMessage.js | 2 +- server/services/routing/rpc/mailQueue.js | 2 +- server/services/routing/rpc/mailQueueReport.js | 2 +- .../services/routing/rpc/openchannelInteraction.js | 2 +- server/services/routing/rpc/openchannelMessage.js | 2 +- server/services/routing/rpc/openchannelQueue.js | 2 +- .../services/routing/rpc/openchannelQueueReport.js | 2 +- server/services/routing/rpc/smsInteraction.js | 2 +- server/services/routing/rpc/smsMessage.js | 2 +- server/services/routing/rpc/smsQueue.js | 2 +- server/services/routing/rpc/smsQueueReport.js | 2 +- server/services/routing/rpc/user.js | 2 +- server/services/routing/rpc/whatsappInteraction.js | 2 +- server/services/routing/rpc/whatsappMessage.js | 2 +- server/services/routing/rpc/whatsappQueue.js | 2 +- server/services/routing/rpc/whatsappQueueReport.js | 2 +- .../services/routing/server/applications/agent.js | 2 +- .../routing/server/applications/amazonlex.js | 2 +- .../routing/server/applications/autoreply.js | 2 +- .../services/routing/server/applications/close.js | 2 +- .../routing/server/applications/dialogflow.js | 2 +- .../routing/server/applications/dialogflowV2.js | 2 +- .../services/routing/server/applications/gotoif.js | 2 +- .../services/routing/server/applications/gotop.js | 2 +- .../routing/server/applications/message.js | 2 +- .../services/routing/server/applications/noop.js | 2 +- .../services/routing/server/applications/queue.js | 2 +- .../routing/server/applications/strategy/agent.js | 2 +- .../server/applications/strategy/beepall.js | 2 +- .../routing/server/applications/strategy/index.js | 2 +- .../server/applications/strategy/rrmemory.js | 2 +- .../routing/server/applications/strategy/util.js | 2 +- .../services/routing/server/applications/system.js | 2 +- server/services/routing/server/applications/tag.js | 2 +- .../services/routing/server/applications/tvox.js | 2 +- .../services/routing/server/applications/utils.js | 2 +- server/services/routing/server/index.js | 2 +- server/services/routing/server/interval.js | 2 +- server/services/xdr/agents.controller.js | 2 +- server/services/xdr/calls.controller.js | 2 +- server/services/xdr/core.controller.js | 2 +- server/services/xdr/dials.controller.js | 2 +- server/services/xdr/index.js | 2 +- server/services/xdr/members.controller.js | 2 +- server/services/xdr/queues.controller.js | 2 +- server/services/xdr/recordings.controller.js | 2 +- server/services/xdr/transfers.controller.js | 2 +- server/services/xdr/utils.js | 2 +- server/utils/client-side-logger.js | 2 +- server/utils/loggers.js | 2 +- server/utils/mask-sensitive-data.js | 2 +- server/utils/safe-template.js | 2 +- 1169 files changed, 1169 insertions(+), 1169 deletions(-) diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 447374e..726b257 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-12-31T14:37:19.750Z", + "time": "2022-01-01T21:08:49.331Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 00887be..5bcd773 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-12-31T14:37:19.750Z", + "time": "2022-01-01T21:08:49.331Z", "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 220a67b..e9a7afd 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 _0x1376=['VIRTUAL','getDataValue','action','STRING','contactManager','motionbar','jscripty','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[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[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','exports'];(function(_0x58345f,_0x4631db){var _0x27d9ef=function(_0x3ac80a){while(--_0x3ac80a){_0x58345f['push'](_0x58345f['shift']());}};_0x27d9ef(++_0x4631db);}(_0x1376,0x6f));var _0x6137=function(_0x1d2992,_0x598caa){_0x1d2992=_0x1d2992-0x0;var _0x30f362=_0x1376[_0x1d2992];return _0x30f362;};'use strict';var Sequelize=require('sequelize');module[_0x6137('0x0')]={'name':{'type':Sequelize[_0x6137('0x1')],'get':function(_0x97fa5){return this[_0x6137('0x2')](_0x6137('0x3'));}},'action':{'type':Sequelize[_0x6137('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x6137('0x5'),'integration',_0x6137('0x6'),_0x6137('0x7'),'urlForward','browser','bot',_0x6137('0x8')]],'msg':_0x6137('0x9')}},'comment':_0x6137('0x9')},'data1':{'type':Sequelize[_0x6137('0x4')](0x1000),'comment':_0x6137('0xa')},'data2':{'type':Sequelize[_0x6137('0x4')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0x6137('0x4')](0x1000),'comment':_0x6137('0xb')},'data4':{'type':Sequelize[_0x6137('0x4')](0x1000),'comments':_0x6137('0xc')},'data5':{'type':Sequelize[_0x6137('0x4')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize['STRING'],'comments':_0x6137('0xd')},'data7':{'type':Sequelize[_0x6137('0xe')],'comments':_0x6137('0xf')}}; \ No newline at end of file +var _0x4f05=['contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','STRING','integration','jscripty','browser','bot','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)]'];(function(_0x15535b,_0x3274f1){var _0xb3b7b1=function(_0x54393f){while(--_0x54393f){_0x15535b['push'](_0x15535b['shift']());}};_0xb3b7b1(++_0x3274f1);}(_0x4f05,0x138));var _0x54f0=function(_0x3c8e9a,_0x384306){_0x3c8e9a=_0x3c8e9a-0x0;var _0x2d4c57=_0x4f05[_0x3c8e9a];return _0x2d4c57;};'use strict';var Sequelize=require(_0x54f0('0x0'));module[_0x54f0('0x1')]={'name':{'type':Sequelize[_0x54f0('0x2')],'get':function(_0x1cce02){return this[_0x54f0('0x3')]('action');}},'action':{'type':Sequelize[_0x54f0('0x4')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x54f0('0x5'),'motionbar',_0x54f0('0x6'),'urlForward',_0x54f0('0x7'),_0x54f0('0x8'),_0x54f0('0x9')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x54f0('0xa')},'data1':{'type':Sequelize[_0x54f0('0x4')](0x1000),'comment':_0x54f0('0xb')},'data2':{'type':Sequelize[_0x54f0('0x4')](0x1000),'comment':_0x54f0('0xc')},'data3':{'type':Sequelize[_0x54f0('0x4')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0x54f0('0x4')](0x1000),'comments':_0x54f0('0xd')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x54f0('0xe')},'data6':{'type':Sequelize[_0x54f0('0x4')],'comments':_0x54f0('0xf')},'data7':{'type':Sequelize[_0x54f0('0x10')],'comments':_0x54f0('0x11')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 7ea1277..0566bb8 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 _0x9e76=['send','body','Action','find','params','catch','eml-format','rimraf','zip-dir','bluebird','util','path','to-csv','ejs','lodash','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','offset','undefined','limit','count','set','apply','save','update','then','destroy','error','stack','name'];(function(_0x3b826d,_0x1d0b68){var _0x38e1b3=function(_0x314620){while(--_0x314620){_0x3b826d['push'](_0x3b826d['shift']());}};_0x38e1b3(++_0x1d0b68);}(_0x9e76,0x114));var _0x69e7=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0x9e76[_0x1762b4];return _0x29beda;};'use strict';var emlformat=require(_0x69e7('0x0'));var rimraf=require(_0x69e7('0x1'));var zipdir=require(_0x69e7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x69e7('0x3'));var Mustache=require('mustache');var util=require(_0x69e7('0x4'));var path=require(_0x69e7('0x5'));var sox=require('sox');var csv=require(_0x69e7('0x6'));var ejs=require(_0x69e7('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x69e7('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x69e7('0x9'));var toCsv=require(_0x69e7('0x6'));var querystring=require(_0x69e7('0xa'));var Papa=require(_0x69e7('0xb'));var Redis=require(_0x69e7('0xc'));var authService=require(_0x69e7('0xd'));var qs=require(_0x69e7('0xe'));var as=require(_0x69e7('0xf'));var hardwareService=require(_0x69e7('0x10'));var logger=require(_0x69e7('0x11'))('api');var utils=require(_0x69e7('0x12'));var config=require(_0x69e7('0x13'));var licenseUtil=require(_0x69e7('0x14'));var db=require(_0x69e7('0x15'))['db'];function respondWithStatusCode(_0x344ee2,_0xc0478d){_0xc0478d=_0xc0478d||0xcc;return function(_0x4a0e23){if(_0x4a0e23){return _0x344ee2[_0x69e7('0x16')](_0xc0478d);}return _0x344ee2[_0x69e7('0x17')](_0xc0478d)[_0x69e7('0x18')]();};}function respondWithResult(_0xff9b77,_0x35eef4){_0x35eef4=_0x35eef4||0xc8;return function(_0x5650ea){if(_0x5650ea){return _0xff9b77[_0x69e7('0x17')](_0x35eef4)[_0x69e7('0x19')](_0x5650ea);}};}function respondWithFilteredResult(_0x233318,_0x533dca){return function(_0x165cca){if(_0x165cca){var _0x33c195=typeof _0x533dca[_0x69e7('0x1a')]===_0x69e7('0x1b')&&typeof _0x533dca[_0x69e7('0x1c')]==='undefined';var _0x41a5ac=_0x165cca[_0x69e7('0x1d')];var _0x1fc4d5=_0x33c195?0x0:_0x533dca[_0x69e7('0x1a')];var _0x50d52f=_0x33c195?_0x165cca[_0x69e7('0x1d')]:_0x533dca['offset']+_0x533dca[_0x69e7('0x1c')];var _0x19be00;if(_0x50d52f>=_0x41a5ac){_0x50d52f=_0x41a5ac;_0x19be00=0xc8;}else{_0x19be00=0xce;}_0x233318[_0x69e7('0x17')](_0x19be00);return _0x233318[_0x69e7('0x1e')]('Content-Range',_0x1fc4d5+'-'+_0x50d52f+'/'+_0x41a5ac)[_0x69e7('0x19')](_0x165cca);}return null;};}function patchUpdates(_0x4519dc){return function(_0x2b9024){try{jsonpatch[_0x69e7('0x1f')](_0x2b9024,_0x4519dc,!![]);}catch(_0x363774){return BPromise['reject'](_0x363774);}return _0x2b9024[_0x69e7('0x20')]();};}function saveUpdates(_0x5371ef,_0x4e9038){return function(_0x16f3f5){if(_0x16f3f5){return _0x16f3f5[_0x69e7('0x21')](_0x5371ef)[_0x69e7('0x22')](function(_0x547b06){return _0x547b06;});}return null;};}function removeEntity(_0xac79a9,_0x86a808){return function(_0x45ab24){if(_0x45ab24){return _0x45ab24[_0x69e7('0x23')]()['then'](function(){_0xac79a9[_0x69e7('0x17')](0xcc)[_0x69e7('0x18')]();});}};}function handleEntityNotFound(_0x2709fc,_0x48d0e9){return function(_0x48adfa){if(!_0x48adfa){_0x2709fc[_0x69e7('0x16')](0x194);}return _0x48adfa;};}function handleError(_0x117efc,_0x1fa0af){_0x1fa0af=_0x1fa0af||0x1f4;return function(_0x188ece){logger[_0x69e7('0x24')](_0x188ece[_0x69e7('0x25')]);if(_0x188ece[_0x69e7('0x26')]){delete _0x188ece[_0x69e7('0x26')];}_0x117efc[_0x69e7('0x17')](_0x1fa0af)[_0x69e7('0x27')](_0x188ece);};}exports[_0x69e7('0x21')]=function(_0x519a47,_0x54af35){if(_0x519a47[_0x69e7('0x28')]['id']){delete _0x519a47[_0x69e7('0x28')]['id'];}return db[_0x69e7('0x29')][_0x69e7('0x2a')]({'where':{'id':_0x519a47[_0x69e7('0x2b')]['id']}})[_0x69e7('0x22')](handleEntityNotFound(_0x54af35,null))[_0x69e7('0x22')](saveUpdates(_0x519a47['body'],null))[_0x69e7('0x22')](respondWithResult(_0x54af35,null))['catch'](handleError(_0x54af35,null));};exports[_0x69e7('0x23')]=function(_0x3f2261,_0x9dcc3e){return db['Action'][_0x69e7('0x2a')]({'where':{'id':_0x3f2261[_0x69e7('0x2b')]['id']}})['then'](handleEntityNotFound(_0x9dcc3e,null))[_0x69e7('0x22')](removeEntity(_0x9dcc3e,null))[_0x69e7('0x2c')](handleError(_0x9dcc3e,null));}; \ No newline at end of file +var _0xaff1=['json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','end','error','stack','send','body','Action','params','then','catch','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x323bb3,_0x1d1484){var _0x3f9474=function(_0x3bef05){while(--_0x3bef05){_0x323bb3['push'](_0x323bb3['shift']());}};_0x3f9474(++_0x1d1484);}(_0xaff1,0x1b6));var _0x1aff=function(_0x27d33c,_0x5795a6){_0x27d33c=_0x27d33c-0x0;var _0x4ea439=_0xaff1[_0x27d33c];return _0x4ea439;};'use strict';var emlformat=require(_0x1aff('0x0'));var rimraf=require(_0x1aff('0x1'));var zipdir=require(_0x1aff('0x2'));var jsonpatch=require(_0x1aff('0x3'));var rp=require(_0x1aff('0x4'));var moment=require('moment');var BPromise=require(_0x1aff('0x5'));var Mustache=require(_0x1aff('0x6'));var util=require(_0x1aff('0x7'));var path=require(_0x1aff('0x8'));var sox=require('sox');var csv=require(_0x1aff('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1aff('0xa'));var _=require(_0x1aff('0xb'));var squel=require(_0x1aff('0xc'));var crypto=require(_0x1aff('0xd'));var jsforce=require(_0x1aff('0xe'));var deskjs=require(_0x1aff('0xf'));var toCsv=require('to-csv');var querystring=require(_0x1aff('0x10'));var Papa=require(_0x1aff('0x11'));var Redis=require(_0x1aff('0x12'));var authService=require(_0x1aff('0x13'));var qs=require(_0x1aff('0x14'));var as=require(_0x1aff('0x15'));var hardwareService=require(_0x1aff('0x16'));var logger=require('../../config/logger')(_0x1aff('0x17'));var utils=require(_0x1aff('0x18'));var config=require(_0x1aff('0x19'));var licenseUtil=require(_0x1aff('0x1a'));var db=require(_0x1aff('0x1b'))['db'];function respondWithStatusCode(_0x521825,_0xdb1a5a){_0xdb1a5a=_0xdb1a5a||0xcc;return function(_0x19d4f8){if(_0x19d4f8){return _0x521825[_0x1aff('0x1c')](_0xdb1a5a);}return _0x521825[_0x1aff('0x1d')](_0xdb1a5a)['end']();};}function respondWithResult(_0x174db6,_0x2af981){_0x2af981=_0x2af981||0xc8;return function(_0x20ba0d){if(_0x20ba0d){return _0x174db6[_0x1aff('0x1d')](_0x2af981)[_0x1aff('0x1e')](_0x20ba0d);}};}function respondWithFilteredResult(_0x2ebbc5,_0xa5c018){return function(_0x27c33f){if(_0x27c33f){var _0x54bed6=typeof _0xa5c018[_0x1aff('0x1f')]===_0x1aff('0x20')&&typeof _0xa5c018[_0x1aff('0x21')]==='undefined';var _0x211f17=_0x27c33f['count'];var _0x1f6974=_0x54bed6?0x0:_0xa5c018[_0x1aff('0x1f')];var _0x148603=_0x54bed6?_0x27c33f[_0x1aff('0x22')]:_0xa5c018['offset']+_0xa5c018['limit'];var _0x3e5144;if(_0x148603>=_0x211f17){_0x148603=_0x211f17;_0x3e5144=0xc8;}else{_0x3e5144=0xce;}_0x2ebbc5[_0x1aff('0x1d')](_0x3e5144);return _0x2ebbc5[_0x1aff('0x23')](_0x1aff('0x24'),_0x1f6974+'-'+_0x148603+'/'+_0x211f17)[_0x1aff('0x1e')](_0x27c33f);}return null;};}function patchUpdates(_0xed7919){return function(_0xe81c8f){try{jsonpatch[_0x1aff('0x25')](_0xe81c8f,_0xed7919,!![]);}catch(_0x5d1d60){return BPromise[_0x1aff('0x26')](_0x5d1d60);}return _0xe81c8f[_0x1aff('0x27')]();};}function saveUpdates(_0x217bfb,_0x129a69){return function(_0x5bb637){if(_0x5bb637){return _0x5bb637[_0x1aff('0x28')](_0x217bfb)['then'](function(_0x507b8f){return _0x507b8f;});}return null;};}function removeEntity(_0x42b6ac,_0x1af55e){return function(_0x4015b9){if(_0x4015b9){return _0x4015b9[_0x1aff('0x29')]()['then'](function(){_0x42b6ac[_0x1aff('0x1d')](0xcc)[_0x1aff('0x2a')]();});}};}function handleEntityNotFound(_0x1de111,_0x2d313c){return function(_0x20bcf3){if(!_0x20bcf3){_0x1de111[_0x1aff('0x1c')](0x194);}return _0x20bcf3;};}function handleError(_0x4e930a,_0x49c8a6){_0x49c8a6=_0x49c8a6||0x1f4;return function(_0x8c30a5){logger[_0x1aff('0x2b')](_0x8c30a5[_0x1aff('0x2c')]);if(_0x8c30a5['name']){delete _0x8c30a5['name'];}_0x4e930a[_0x1aff('0x1d')](_0x49c8a6)[_0x1aff('0x2d')](_0x8c30a5);};}exports[_0x1aff('0x28')]=function(_0x4f375e,_0x165a44){if(_0x4f375e[_0x1aff('0x2e')]['id']){delete _0x4f375e[_0x1aff('0x2e')]['id'];}return db[_0x1aff('0x2f')]['find']({'where':{'id':_0x4f375e[_0x1aff('0x30')]['id']}})['then'](handleEntityNotFound(_0x165a44,null))[_0x1aff('0x31')](saveUpdates(_0x4f375e['body'],null))[_0x1aff('0x31')](respondWithResult(_0x165a44,null))[_0x1aff('0x32')](handleError(_0x165a44,null));};exports[_0x1aff('0x29')]=function(_0x14bf81,_0x5e5138){return db['Action'][_0x1aff('0x33')]({'where':{'id':_0x14bf81['params']['id']}})['then'](handleEntityNotFound(_0x5e5138,null))[_0x1aff('0x31')](removeEntity(_0x5e5138,null))['catch'](handleError(_0x5e5138,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 6144453..ae34861 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 _0x5a41=['tools_actions','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./action.attributes','define'];(function(_0x2f3d29,_0x150e7b){var _0x53d69d=function(_0x45f6ec){while(--_0x45f6ec){_0x2f3d29['push'](_0x2f3d29['shift']());}};_0x53d69d(++_0x150e7b);}(_0x5a41,0x1b1));var _0x15a4=function(_0x3d09e2,_0x58e784){_0x3d09e2=_0x3d09e2-0x0;var _0x5d03cd=_0x5a41[_0x3d09e2];return _0x5d03cd;};'use strict';var _=require(_0x15a4('0x0'));var util=require(_0x15a4('0x1'));var logger=require(_0x15a4('0x2'))(_0x15a4('0x3'));var moment=require(_0x15a4('0x4'));var BPromise=require('bluebird');var rp=require(_0x15a4('0x5'));var fs=require('fs');var path=require(_0x15a4('0x6'));var rimraf=require(_0x15a4('0x7'));var config=require(_0x15a4('0x8'));var attributes=require(_0x15a4('0x9'));module['exports']=function(_0x28841f,_0x209552){return _0x28841f[_0x15a4('0xa')]('Action',attributes,{'tableName':_0x15a4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe6a1=['moment','bluebird','request-promise','../../config/environment','./action.attributes','exports','define','Action','tools_actions','util','../../config/logger'];(function(_0x273dc9,_0x5924f4){var _0x1eaa00=function(_0x252db4){while(--_0x252db4){_0x273dc9['push'](_0x273dc9['shift']());}};_0x1eaa00(++_0x5924f4);}(_0xe6a1,0x111));var _0x1e6a=function(_0x35de88,_0x4e5b00){_0x35de88=_0x35de88-0x0;var _0x525419=_0xe6a1[_0x35de88];return _0x525419;};'use strict';var _=require('lodash');var util=require(_0x1e6a('0x0'));var logger=require(_0x1e6a('0x1'))('api');var moment=require(_0x1e6a('0x2'));var BPromise=require(_0x1e6a('0x3'));var rp=require(_0x1e6a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1e6a('0x5'));var attributes=require(_0x1e6a('0x6'));module[_0x1e6a('0x7')]=function(_0x4dbbdb,_0x485a2f){return _0x4dbbdb[_0x1e6a('0x8')](_0x1e6a('0x9'),attributes,{'tableName':_0x1e6a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index d2d7a83..d3da28c 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 _0x814b=['info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x814b,0x1a2));var _0xb814=function(_0x27a3cb,_0x4af597){_0x27a3cb=_0x27a3cb-0x0;var _0x54ff38=_0x814b[_0x27a3cb];return _0x54ff38;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('Action,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});} \ No newline at end of file +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(_0x1c3796,_0x2f0fd1){var _0x344725=function(_0x597835){while(--_0x597835){_0x1c3796['push'](_0x1c3796['shift']());}};_0x344725(++_0x2f0fd1);}(_0x5fc3,0xa8));var _0x35fc=function(_0x2eb3db,_0x4a32c0){_0x2eb3db=_0x2eb3db-0x0;var _0x358f33=_0x5fc3[_0x2eb3db];return _0x358f33;};'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 diff --git a/server/api/action/index.js b/server/api/action/index.js index c948935..eee75b2 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 _0xabbf=['exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./action.controller','/:id','isAuthenticated','delete'];(function(_0x2855b9,_0x53188f){var _0x70ea14=function(_0x191616){while(--_0x191616){_0x2855b9['push'](_0x2855b9['shift']());}};_0x70ea14(++_0x53188f);}(_0xabbf,0x1c4));var _0xfabb=function(_0x25c988,_0xce8221){_0x25c988=_0x25c988-0x0;var _0x45fcc2=_0xabbf[_0x25c988];return _0x45fcc2;};'use strict';var multer=require('multer');var util=require(_0xfabb('0x0'));var path=require(_0xfabb('0x1'));var timeout=require('connect-timeout');var express=require(_0xfabb('0x2'));var router=express['Router']();var fs_extra=require(_0xfabb('0x3'));var auth=require(_0xfabb('0x4'));var interaction=require(_0xfabb('0x5'));var config=require('../../config/environment');var controller=require(_0xfabb('0x6'));router['put'](_0xfabb('0x7'),auth[_0xfabb('0x8')](),controller['update']);router[_0xfabb('0x9')]('/:id',auth[_0xfabb('0x8')](),controller['destroy']);module[_0xfabb('0xa')]=router; \ No newline at end of file +var _0xb5db=['../../config/environment','./action.controller','put','/:id','isAuthenticated','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x3802a0,_0x278238){var _0x3fb7b6=function(_0x4958e5){while(--_0x4958e5){_0x3802a0['push'](_0x3802a0['shift']());}};_0x3fb7b6(++_0x278238);}(_0xb5db,0x80));var _0xbb5d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb5db[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xbb5d('0x0'));var util=require(_0xbb5d('0x1'));var path=require(_0xbb5d('0x2'));var timeout=require(_0xbb5d('0x3'));var express=require(_0xbb5d('0x4'));var router=express[_0xbb5d('0x5')]();var fs_extra=require(_0xbb5d('0x6'));var auth=require(_0xbb5d('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xbb5d('0x8'));var controller=require(_0xbb5d('0x9'));router[_0xbb5d('0xa')](_0xbb5d('0xb'),auth[_0xbb5d('0xc')](),controller[_0xbb5d('0xd')]);router[_0xbb5d('0xe')](_0xbb5d('0xb'),auth['isAuthenticated'](),controller[_0xbb5d('0xf')]);module[_0xbb5d('0x10')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 1e56c61..9539546 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 _0xafc4=['sequelize','STRING','TEXT'];(function(_0x27530d,_0x46480a){var _0x59e561=function(_0x395fe9){while(--_0x395fe9){_0x27530d['push'](_0x27530d['shift']());}};_0x59e561(++_0x46480a);}(_0xafc4,0x69));var _0x4afc=function(_0x3469b4,_0x3cc80d){_0x3469b4=_0x3469b4-0x0;var _0x263397=_0xafc4[_0x3469b4];return _0x263397;};'use strict';var Sequelize=require(_0x4afc('0x0'));module['exports']={'name':{'type':Sequelize[_0x4afc('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x4afc('0x1')]},'table':{'type':Sequelize[_0x4afc('0x1')]},'conditions':{'type':Sequelize[_0x4afc('0x2')]},'joins':{'type':Sequelize[_0x4afc('0x2')]}}; \ No newline at end of file +var _0x5d17=['sequelize','exports','STRING','TEXT'];(function(_0x5d39bb,_0x4e860d){var _0xad03d=function(_0x18af10){while(--_0x18af10){_0x5d39bb['push'](_0x5d39bb['shift']());}};_0xad03d(++_0x4e860d);}(_0x5d17,0x114));var _0x75d1=function(_0x3875b1,_0x47cf1a){_0x3875b1=_0x3875b1-0x0;var _0x1e9c55=_0x5d17[_0x3875b1];return _0x1e9c55;};'use strict';var Sequelize=require(_0x75d1('0x0'));module[_0x75d1('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x75d1('0x2')]},'table':{'type':Sequelize[_0x75d1('0x2')]},'conditions':{'type':Sequelize[_0x75d1('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index a7a8547..9eba5fd 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 _0xd4a3=['name','send','index','AnalyticCustomReport','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','length','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','function','format','replace','groupBy','orderBy','DESC','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','cross_join','ROUND(%s)','IS\x20NOT\x20NULL','value','Sequelize','from','alias','%s.%s\x20=\x20%s.%s','generate','output','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','fork','countTable','COUNT(*)','run','runReport','right_join','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','eml-format','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','get','CustomReports','error'];(function(_0x29ebf,_0x5d73f0){var _0x3261f2=function(_0x26b9d5){while(--_0x26b9d5){_0x29ebf['push'](_0x29ebf['shift']());}};_0x3261f2(++_0x5d73f0);}(_0xd4a3,0x7a));var _0x3d4a=function(_0x1cfd2d,_0xc2bfae){_0x1cfd2d=_0x1cfd2d-0x0;var _0x227ed0=_0xd4a3[_0x1cfd2d];return _0x227ed0;};'use strict';var emlformat=require(_0x3d4a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3d4a('0x1'));var moment=require(_0x3d4a('0x2'));var BPromise=require(_0x3d4a('0x3'));var Mustache=require(_0x3d4a('0x4'));var util=require('util');var path=require('path');var sox=require(_0x3d4a('0x5'));var csv=require(_0x3d4a('0x6'));var ejs=require(_0x3d4a('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3d4a('0x8'));var toCsv=require('to-csv');var querystring=require(_0x3d4a('0x9'));var Papa=require(_0x3d4a('0xa'));var Redis=require(_0x3d4a('0xb'));var authService=require(_0x3d4a('0xc'));var qs=require(_0x3d4a('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3d4a('0xe'));var logger=require(_0x3d4a('0xf'))(_0x3d4a('0x10'));var utils=require(_0x3d4a('0x11'));var config=require(_0x3d4a('0x12'));var licenseUtil=require(_0x3d4a('0x13'));var db=require(_0x3d4a('0x14'))['db'];var dbH=require('../../mysqldb')[_0x3d4a('0x15')];function respondWithStatusCode(_0x428024,_0x46367d){_0x46367d=_0x46367d||0xcc;return function(_0xfa35b9){if(_0xfa35b9){return _0x428024[_0x3d4a('0x16')](_0x46367d);}return _0x428024[_0x3d4a('0x17')](_0x46367d)[_0x3d4a('0x18')]();};}function respondWithResult(_0x3b5658,_0x4fda68){_0x4fda68=_0x4fda68||0xc8;return function(_0x5f2282){if(_0x5f2282){return _0x3b5658['status'](_0x4fda68)[_0x3d4a('0x19')](_0x5f2282);}};}function respondWithFilteredResult(_0x149f55,_0x4cf75d){return function(_0x2e29ed){if(_0x2e29ed){var _0x850685=typeof _0x4cf75d[_0x3d4a('0x1a')]===_0x3d4a('0x1b')&&typeof _0x4cf75d[_0x3d4a('0x1c')]===_0x3d4a('0x1b');var _0x3d8944=_0x2e29ed[_0x3d4a('0x1d')];var _0x1274b0=_0x850685?0x0:_0x4cf75d[_0x3d4a('0x1a')];var _0x3aa044=_0x850685?_0x2e29ed[_0x3d4a('0x1d')]:_0x4cf75d[_0x3d4a('0x1a')]+_0x4cf75d[_0x3d4a('0x1c')];var _0x43bb14;if(_0x3aa044>=_0x3d8944){_0x3aa044=_0x3d8944;_0x43bb14=0xc8;}else{_0x43bb14=0xce;}_0x149f55['status'](_0x43bb14);return _0x149f55['set'](_0x3d4a('0x1e'),_0x1274b0+'-'+_0x3aa044+'/'+_0x3d8944)['json'](_0x2e29ed);}return null;};}function patchUpdates(_0x261690){return function(_0x21aa17){try{jsonpatch[_0x3d4a('0x1f')](_0x21aa17,_0x261690,!![]);}catch(_0x3df475){return BPromise[_0x3d4a('0x20')](_0x3df475);}return _0x21aa17[_0x3d4a('0x21')]();};}function saveUpdates(_0x1d4e79,_0x5b1741){return function(_0x19d663){if(_0x19d663){return _0x19d663['update'](_0x1d4e79)[_0x3d4a('0x22')](function(_0x1a10c9){return _0x1a10c9;});}return null;};}function removeEntity(_0x1bd0f6,_0x36038e){return function(_0x544fcc){if(_0x544fcc){return _0x544fcc[_0x3d4a('0x23')]()[_0x3d4a('0x22')](function(){var _0x83880=_0x544fcc[_0x3d4a('0x24')]({'plain':!![]});var _0xfd631f=_0x3d4a('0x25');return db['UserProfileResource'][_0x3d4a('0x23')]({'where':{'type':_0xfd631f,'resourceId':_0x83880['id']}})[_0x3d4a('0x22')](function(){return _0x544fcc;});})['then'](function(){_0x1bd0f6[_0x3d4a('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3de273,_0x323e19){return function(_0x46a717){if(!_0x46a717){_0x3de273[_0x3d4a('0x16')](0x194);}return _0x46a717;};}function handleError(_0x1a6570,_0x441d58){_0x441d58=_0x441d58||0x1f4;return function(_0x5eaa4c){logger[_0x3d4a('0x26')](_0x5eaa4c['stack']);if(_0x5eaa4c['name']){delete _0x5eaa4c[_0x3d4a('0x27')];}_0x1a6570[_0x3d4a('0x17')](_0x441d58)[_0x3d4a('0x28')](_0x5eaa4c);};}exports[_0x3d4a('0x29')]=function(_0x496fc5,_0x2a947c){var _0x9047ef={},_0x487a9d={},_0x51111a={'count':0x0,'rows':[]};var _0x3e0661=_['map'](db[_0x3d4a('0x2a')][_0x3d4a('0x2b')],function(_0x755c7b){return{'name':_0x755c7b[_0x3d4a('0x2c')],'type':_0x755c7b[_0x3d4a('0x2d')]['key']};});_0x487a9d[_0x3d4a('0x2e')]=_[_0x3d4a('0x2f')](_0x3e0661,'name');_0x487a9d[_0x3d4a('0x30')]=_[_0x3d4a('0x31')](_0x496fc5[_0x3d4a('0x30')]);_0x487a9d[_0x3d4a('0x32')]=_[_0x3d4a('0x33')](_0x487a9d[_0x3d4a('0x2e')],_0x487a9d[_0x3d4a('0x30')]);_0x9047ef[_0x3d4a('0x34')]=_[_0x3d4a('0x33')](_0x487a9d[_0x3d4a('0x2e')],qs[_0x3d4a('0x35')](_0x496fc5[_0x3d4a('0x30')][_0x3d4a('0x35')]));_0x9047ef[_0x3d4a('0x34')]=_0x9047ef[_0x3d4a('0x34')]['length']?_0x9047ef[_0x3d4a('0x34')]:_0x487a9d[_0x3d4a('0x2e')];if(!_0x496fc5[_0x3d4a('0x30')][_0x3d4a('0x36')](_0x3d4a('0x37'))){_0x9047ef[_0x3d4a('0x1c')]=qs[_0x3d4a('0x1c')](_0x496fc5[_0x3d4a('0x30')]['limit']);_0x9047ef[_0x3d4a('0x1a')]=qs[_0x3d4a('0x1a')](_0x496fc5[_0x3d4a('0x30')]['offset']);}_0x9047ef[_0x3d4a('0x38')]=qs[_0x3d4a('0x39')](_0x496fc5[_0x3d4a('0x30')][_0x3d4a('0x39')]);_0x9047ef[_0x3d4a('0x3a')]=qs[_0x3d4a('0x32')](_[_0x3d4a('0x3b')](_0x496fc5['query'],_0x487a9d[_0x3d4a('0x32')]),_0x3e0661);if(_0x496fc5[_0x3d4a('0x30')][_0x3d4a('0x3c')]){_0x9047ef[_0x3d4a('0x3a')]=_[_0x3d4a('0x3d')](_0x9047ef[_0x3d4a('0x3a')],{'$or':_[_0x3d4a('0x2f')](_0x3e0661,function(_0x4d17fb){if(_0x4d17fb[_0x3d4a('0x2d')]!==_0x3d4a('0x3e')){var _0x3b9a6a={};_0x3b9a6a[_0x4d17fb[_0x3d4a('0x27')]]={'$like':'%'+_0x496fc5['query'][_0x3d4a('0x3c')]+'%'};return _0x3b9a6a;}})});}_0x9047ef=_[_0x3d4a('0x3d')]({},_0x9047ef,_0x496fc5[_0x3d4a('0x3f')]);var _0x481225={'where':_0x9047ef[_0x3d4a('0x3a')]};return db[_0x3d4a('0x2a')][_0x3d4a('0x1d')](_0x481225)[_0x3d4a('0x22')](function(_0x3103fa){_0x51111a['count']=_0x3103fa;if(_0x496fc5[_0x3d4a('0x30')][_0x3d4a('0x40')]){_0x9047ef[_0x3d4a('0x41')]=[{'all':!![]}];}return db[_0x3d4a('0x2a')][_0x3d4a('0x42')](_0x9047ef);})[_0x3d4a('0x22')](function(_0x355aaf){_0x51111a[_0x3d4a('0x43')]=_0x355aaf;return _0x51111a;})[_0x3d4a('0x22')](respondWithFilteredResult(_0x2a947c,_0x9047ef))['catch'](handleError(_0x2a947c,null));};exports['show']=function(_0x27abc2,_0x48c257){var _0x4b5ce1={'raw':![],'where':{'id':_0x27abc2[_0x3d4a('0x44')]['id']}},_0x529a65={};_0x529a65[_0x3d4a('0x2e')]=_[_0x3d4a('0x31')](db['AnalyticCustomReport'][_0x3d4a('0x2b')]);_0x529a65[_0x3d4a('0x30')]=_[_0x3d4a('0x31')](_0x27abc2['query']);_0x529a65[_0x3d4a('0x32')]=_[_0x3d4a('0x33')](_0x529a65['model'],_0x529a65[_0x3d4a('0x30')]);_0x4b5ce1[_0x3d4a('0x34')]=_[_0x3d4a('0x33')](_0x529a65[_0x3d4a('0x2e')],qs[_0x3d4a('0x35')](_0x27abc2['query'][_0x3d4a('0x35')]));_0x4b5ce1[_0x3d4a('0x34')]=_0x4b5ce1[_0x3d4a('0x34')][_0x3d4a('0x45')]?_0x4b5ce1['attributes']:_0x529a65[_0x3d4a('0x2e')];if(_0x27abc2['query'][_0x3d4a('0x40')]){_0x4b5ce1['include']=[{'all':!![]}];}_0x4b5ce1=_[_0x3d4a('0x3d')]({},_0x4b5ce1,_0x27abc2[_0x3d4a('0x3f')]);return db[_0x3d4a('0x2a')]['find'](_0x4b5ce1)[_0x3d4a('0x22')](handleEntityNotFound(_0x48c257,null))[_0x3d4a('0x22')](respondWithResult(_0x48c257,null))['catch'](handleError(_0x48c257,null));};exports[_0x3d4a('0x46')]=function(_0x364651,_0xaab3b3){return db[_0x3d4a('0x2a')][_0x3d4a('0x46')](_0x364651['body'],{})[_0x3d4a('0x22')](function(_0x4de6a0){var _0x1f3b91=_0x364651[_0x3d4a('0x47')]['get']({'plain':!![]});if(!_0x1f3b91)throw new Error(_0x3d4a('0x48'));if(_0x1f3b91[_0x3d4a('0x49')]===_0x3d4a('0x47')){var _0x1d8a01=_0x4de6a0[_0x3d4a('0x24')]({'plain':!![]});var _0x1c301f=_0x3d4a('0x4a');return db[_0x3d4a('0x4b')][_0x3d4a('0x4c')]({'where':{'name':_0x1c301f,'userProfileId':_0x1f3b91[_0x3d4a('0x4d')]},'raw':!![]})[_0x3d4a('0x22')](function(_0x4a56c9){if(_0x4a56c9&&_0x4a56c9[_0x3d4a('0x4e')]===0x0){return db[_0x3d4a('0x4f')][_0x3d4a('0x46')]({'name':_0x1d8a01['name'],'resourceId':_0x1d8a01['id'],'type':_0x3d4a('0x25'),'sectionId':_0x4a56c9['id']},{})[_0x3d4a('0x22')](function(){return _0x4de6a0;});}else{return _0x4de6a0;}})[_0x3d4a('0x50')](function(_0x1bec5d){logger['error'](_0x3d4a('0x51'),_0x1bec5d);throw _0x1bec5d;});}return _0x4de6a0;})[_0x3d4a('0x22')](respondWithResult(_0xaab3b3,0xc9))[_0x3d4a('0x50')](handleError(_0xaab3b3,null));};exports[_0x3d4a('0x52')]=function(_0x1d7d4d,_0x3e4c05){if(_0x1d7d4d['body']['id']){delete _0x1d7d4d['body']['id'];}return db[_0x3d4a('0x2a')][_0x3d4a('0x4c')]({'where':{'id':_0x1d7d4d[_0x3d4a('0x44')]['id']}})[_0x3d4a('0x22')](handleEntityNotFound(_0x3e4c05,null))[_0x3d4a('0x22')](saveUpdates(_0x1d7d4d['body'],null))[_0x3d4a('0x22')](respondWithResult(_0x3e4c05,null))[_0x3d4a('0x50')](handleError(_0x3e4c05,null));};exports[_0x3d4a('0x23')]=function(_0x19a237,_0x56009f){return db[_0x3d4a('0x2a')][_0x3d4a('0x4c')]({'where':{'id':_0x19a237[_0x3d4a('0x44')]['id']}})[_0x3d4a('0x22')](handleEntityNotFound(_0x56009f,null))['then'](removeEntity(_0x56009f,null))[_0x3d4a('0x50')](handleError(_0x56009f,null));};exports[_0x3d4a('0x53')]=function(_0x21b55d,_0x13e592){var _0x2bcf50=0xa;var _0x188e28=[_0x3d4a('0x54'),_0x3d4a('0x55'),'right_join','cross_join'];var _0x3e33a9={'SUM':_0x3d4a('0x56'),'COUNT':_0x3d4a('0x57'),'COUNT DISTINCT':_0x3d4a('0x58'),'MAX':_0x3d4a('0x59'),'MIN':_0x3d4a('0x5a'),'AVG':_0x3d4a('0x5b'),'GROUP_CONCAT':_0x3d4a('0x5c'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x3d4a('0x5d')};var _0x3547a9={'SEC_TO_TIME':_0x3d4a('0x5e'),'DATE':_0x3d4a('0x5f'),'HOUR':_0x3d4a('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x3d4a('0x61')};var _0x1b5b7d=function(_0xc7d9ca){return!_[_0x3d4a('0x62')]([_0x3d4a('0x63'),'IS\x20NOT\x20NULL',_0x3d4a('0x64'),_0x3d4a('0x65')],_0xc7d9ca);};var _0x22fe52=function(_0x2bb5ec){if(!_0x2bb5ec||!_0x2bb5ec[_0x3d4a('0x66')][_0x3d4a('0x45')]){return'';}for(var _0x2d1d46='(',_0xed2a93=0x0;_0xed2a93<_0x2bb5ec[_0x3d4a('0x66')]['length'];_0xed2a93+=0x1){_0xed2a93>0x0&&(_0x2d1d46+='\x20'+_0x2bb5ec[_0x3d4a('0x67')]+'\x20');_0x2d1d46+=_0x2bb5ec['rules'][_0xed2a93][_0x3d4a('0x68')]?_0x22fe52(_0x2bb5ec['rules'][_0xed2a93][_0x3d4a('0x68')]):_0x2bb5ec['rules'][_0xed2a93][_0x3d4a('0x69')]+'\x20'+_0x2bb5ec[_0x3d4a('0x66')][_0xed2a93][_0x3d4a('0x6a')]+(_0x1b5b7d(_0x2bb5ec[_0x3d4a('0x66')][_0xed2a93][_0x3d4a('0x6a')])?'\x20'+_0x2bb5ec[_0x3d4a('0x66')][_0xed2a93]['value']:'');}return _0x2d1d46+')';};var _0x40cf1e={'where':{'id':_0x21b55d[_0x3d4a('0x44')]['id']}},_0x3c1b87,_0x154feb,_0x2a0744,_0x141ee0,_0x398a47;_0x40cf1e=_['merge']({},_0x40cf1e,_0x21b55d[_0x3d4a('0x3f')]);return db[_0x3d4a('0x2a')][_0x3d4a('0x4c')](_0x40cf1e)[_0x3d4a('0x22')](function(_0x951038){if(_0x951038){_0x3c1b87=_0x951038;return _0x951038[_0x3d4a('0x6b')]();}return null;})[_0x3d4a('0x22')](function(_0xa5bdb1){if(_0xa5bdb1){if(!_0xa5bdb1['length']){throw new db['Sequelize'][(_0x3d4a('0x6c'))](_0x3d4a('0x6d'),0x193);}_0x154feb=_0xa5bdb1;return db[_0x3d4a('0x6e')][_0x3d4a('0x42')]({'raw':!![]});}return null;})['then'](function(_0x58e1c8){if(_0x58e1c8){_0x2a0744=_[_0x3d4a('0x6f')](_0x58e1c8,'id');var _0x50cb32;var _0x26ddca=squel[_0x3d4a('0x70')]();_0x26ddca['from'](_0x3c1b87[_0x3d4a('0x71')]);for(var _0x2e65cc=0x0;_0x2e65cc<_0x154feb['length'];_0x2e65cc+=0x1){_0x50cb32=_0x154feb[_0x2e65cc][_0x3d4a('0x72')]?_0x2a0744[_0x154feb[_0x2e65cc][_0x3d4a('0x72')]][_0x3d4a('0x73')]:_0x154feb[_0x2e65cc][_0x3d4a('0x69')];_0x50cb32=_0x154feb[_0x2e65cc][_0x3d4a('0x74')]?_['replace'](_0x3e33a9[_0x154feb[_0x2e65cc]['function']],'%s',_0x50cb32):_0x50cb32;_0x50cb32=_0x154feb[_0x2e65cc][_0x3d4a('0x75')]?_[_0x3d4a('0x76')](_0x3547a9[_0x154feb[_0x2e65cc][_0x3d4a('0x75')]],'%s',_0x50cb32):_0x50cb32;if(_0x154feb[_0x2e65cc][_0x3d4a('0x77')]){_0x26ddca[_0x3d4a('0x68')](_0x50cb32);}_0x154feb[_0x2e65cc][_0x3d4a('0x78')]&&_0x26ddca[_0x3d4a('0x38')](_0x50cb32,_0x154feb[_0x2e65cc]['orderBy']===_0x3d4a('0x79')?![]:!![]);_0x26ddca[_0x3d4a('0x69')](_0x50cb32,_0x154feb[_0x2e65cc]['alias']||_0x50cb32);}if(_0x3c1b87[_0x3d4a('0x7a')]){_0x3c1b87['joins']=JSON[_0x3d4a('0x7b')](_0x3c1b87[_0x3d4a('0x7a')]);for(var _0x640afb=0x0;_0x640afb<_0x3c1b87[_0x3d4a('0x7a')][_0x3d4a('0x45')];_0x640afb+=0x1){if(_0x3c1b87[_0x3d4a('0x7a')][_0x640afb][_0x3d4a('0x2d')]&&_[_0x3d4a('0x62')](_0x188e28,_0x3c1b87[_0x3d4a('0x7a')][_0x640afb][_0x3d4a('0x2d')])&&_0x3c1b87[_0x3d4a('0x7a')][_0x640afb][_0x3d4a('0x7c')]&&_0x3c1b87['joins'][_0x640afb][_0x3d4a('0x7d')]&&_0x3c1b87[_0x3d4a('0x7a')][_0x640afb][_0x3d4a('0x7e')]){_0x26ddca[_0x3c1b87[_0x3d4a('0x7a')][_0x640afb][_0x3d4a('0x2d')]](_0x3c1b87['joins'][_0x640afb][_0x3d4a('0x7d')],null,util[_0x3d4a('0x75')]('%s.%s\x20=\x20%s.%s',_0x3c1b87[_0x3d4a('0x71')],_0x3c1b87['joins'][_0x640afb][_0x3d4a('0x7c')],_0x3c1b87[_0x3d4a('0x7a')][_0x640afb][_0x3d4a('0x7d')],_0x3c1b87[_0x3d4a('0x7a')][_0x640afb][_0x3d4a('0x7e')]));}}}if(_0x3c1b87['conditions']){_0x3c1b87[_0x3d4a('0x7f')]=JSON['parse'](_0x3c1b87[_0x3d4a('0x7f')]);_0x26ddca[_0x3d4a('0x3a')](_0x22fe52(_0x3c1b87[_0x3d4a('0x7f')][_0x3d4a('0x68')]));}_0x398a47=_0x26ddca[_0x3d4a('0x80')]();_0x26ddca['limit'](_0x2bcf50);_0x26ddca[_0x3d4a('0x1a')](0x0);logger[_0x3d4a('0x81')](_0x3d4a('0x82'),_0x26ddca[_0x3d4a('0x83')]());return dbH[_0x3d4a('0x84')][_0x3d4a('0x30')](_0x26ddca['toString'](),{'type':dbH[_0x3d4a('0x84')][_0x3d4a('0x85')][_0x3d4a('0x86')]});}})['then'](respondWithResult(_0x13e592,null))[_0x3d4a('0x50')](handleError(_0x13e592,null));};function runReport(_0x5a78b8,_0xfc1912,_0x5efeb1){var _0x270d0a=_0xfc1912['name'];var _0x3002ff=0xa;var _0x102bb2=[_0x3d4a('0x54'),_0x3d4a('0x55'),'right_join',_0x3d4a('0x87')];var _0x3d7553={'SUM':_0x3d4a('0x56'),'COUNT':_0x3d4a('0x57'),'COUNT DISTINCT':_0x3d4a('0x58'),'MAX':_0x3d4a('0x59'),'MIN':_0x3d4a('0x5a'),'AVG':_0x3d4a('0x5b'),'GROUP_CONCAT':_0x3d4a('0x5c'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x18217f={'SEC_TO_TIME':_0x3d4a('0x5e'),'DATE':_0x3d4a('0x5f'),'HOUR':_0x3d4a('0x60'),'ROUND':_0x3d4a('0x88'),'UNIX_TIMESTAMP':_0x3d4a('0x61')};var _0xec11ce=function(_0x27010a){return!_[_0x3d4a('0x62')](['IS\x20NULL',_0x3d4a('0x89'),_0x3d4a('0x64'),_0x3d4a('0x65')],_0x27010a);};var _0x4ad5db=function(_0x10335d){if(!_0x10335d||!_0x10335d[_0x3d4a('0x66')][_0x3d4a('0x45')]){return'';}for(var _0x3160e1='(',_0x505c88=0x0;_0x505c88<_0x10335d[_0x3d4a('0x66')][_0x3d4a('0x45')];_0x505c88+=0x1){_0x505c88>0x0&&(_0x3160e1+='\x20'+_0x10335d[_0x3d4a('0x67')]+'\x20');_0x3160e1+=_0x10335d[_0x3d4a('0x66')][_0x505c88][_0x3d4a('0x68')]?_0x4ad5db(_0x10335d['rules'][_0x505c88]['group']):_0x10335d['rules'][_0x505c88][_0x3d4a('0x69')]+'\x20'+_0x10335d[_0x3d4a('0x66')][_0x505c88][_0x3d4a('0x6a')]+(_0xec11ce(_0x10335d[_0x3d4a('0x66')][_0x505c88][_0x3d4a('0x6a')])?'\x20'+_0x10335d['rules'][_0x505c88][_0x3d4a('0x8a')]:'');}return _0x3160e1+')';};var _0x499708={'where':{'id':_0x5a78b8['id']}},_0x16d3e5,_0x3caa95,_0x9f73b6,_0x332a1d,_0x242c7c;_0x499708=_[_0x3d4a('0x3d')]({},_0x499708,_0x5efeb1);return db['AnalyticCustomReport'][_0x3d4a('0x4c')](_0x499708)[_0x3d4a('0x22')](function(_0x3f7d86){if(_0x3f7d86){_0x16d3e5=_0x3f7d86;return _0x3f7d86[_0x3d4a('0x6b')]();}return null;})[_0x3d4a('0x22')](function(_0x5cc8f2){if(_0x5cc8f2){if(!_0x5cc8f2[_0x3d4a('0x45')]){throw new db[(_0x3d4a('0x8b'))][(_0x3d4a('0x6c'))](_0x3d4a('0x6d'),0x193);}_0x3caa95=_0x5cc8f2;return db[_0x3d4a('0x6e')][_0x3d4a('0x42')]({'raw':!![]});}return null;})[_0x3d4a('0x22')](function(_0x39e42a){if(_0x39e42a){_0x9f73b6=_[_0x3d4a('0x6f')](_0x39e42a,'id');var _0x11d38c;var _0x30cb71=squel[_0x3d4a('0x70')]();_0x30cb71[_0x3d4a('0x8c')](_0x16d3e5['table']);for(var _0x2f10b0=0x0;_0x2f10b0<_0x3caa95[_0x3d4a('0x45')];_0x2f10b0+=0x1){_0x11d38c=_0x3caa95[_0x2f10b0][_0x3d4a('0x72')]?_0x9f73b6[_0x3caa95[_0x2f10b0][_0x3d4a('0x72')]]['metric']:_0x3caa95[_0x2f10b0]['field'];_0x11d38c=_0x3caa95[_0x2f10b0][_0x3d4a('0x74')]?_['replace'](_0x3d7553[_0x3caa95[_0x2f10b0][_0x3d4a('0x74')]],'%s',_0x11d38c):_0x11d38c;_0x11d38c=_0x3caa95[_0x2f10b0]['format']?_[_0x3d4a('0x76')](_0x18217f[_0x3caa95[_0x2f10b0][_0x3d4a('0x75')]],'%s',_0x11d38c):_0x11d38c;if(_0x3caa95[_0x2f10b0]['groupBy']){_0x30cb71[_0x3d4a('0x68')](_0x11d38c);}_0x3caa95[_0x2f10b0][_0x3d4a('0x78')]&&_0x30cb71[_0x3d4a('0x38')](_0x11d38c,_0x3caa95[_0x2f10b0][_0x3d4a('0x78')]===_0x3d4a('0x79')?![]:!![]);_0x30cb71['field'](_0x11d38c,_0x3caa95[_0x2f10b0][_0x3d4a('0x8d')]||_0x11d38c);}if(_0x16d3e5[_0x3d4a('0x7a')]){_0x16d3e5[_0x3d4a('0x7a')]=JSON[_0x3d4a('0x7b')](_0x16d3e5[_0x3d4a('0x7a')]);for(var _0x59ca45=0x0;_0x59ca45<_0x16d3e5[_0x3d4a('0x7a')][_0x3d4a('0x45')];_0x59ca45+=0x1){if(_0x16d3e5[_0x3d4a('0x7a')][_0x59ca45][_0x3d4a('0x2d')]&&_[_0x3d4a('0x62')](_0x102bb2,_0x16d3e5['joins'][_0x59ca45][_0x3d4a('0x2d')])&&_0x16d3e5['joins'][_0x59ca45][_0x3d4a('0x7c')]&&_0x16d3e5['joins'][_0x59ca45][_0x3d4a('0x7d')]&&_0x16d3e5[_0x3d4a('0x7a')][_0x59ca45][_0x3d4a('0x7e')]){_0x30cb71[_0x16d3e5[_0x3d4a('0x7a')][_0x59ca45]['type']](_0x16d3e5['joins'][_0x59ca45][_0x3d4a('0x7d')],null,util['format'](_0x3d4a('0x8e'),_0x16d3e5[_0x3d4a('0x71')],_0x16d3e5['joins'][_0x59ca45][_0x3d4a('0x7c')],_0x16d3e5['joins'][_0x59ca45]['foreignTable'],_0x16d3e5[_0x3d4a('0x7a')][_0x59ca45][_0x3d4a('0x7e')]));}}}if(_0x16d3e5[_0x3d4a('0x7f')]){_0x16d3e5[_0x3d4a('0x7f')]=JSON[_0x3d4a('0x7b')](_0x16d3e5[_0x3d4a('0x7f')]);_0x30cb71[_0x3d4a('0x3a')](_0x4ad5db(_0x16d3e5[_0x3d4a('0x7f')][_0x3d4a('0x68')]));}_0x242c7c=_0x30cb71['clone']();_0x30cb71[_0x3d4a('0x1c')](_0x3002ff);_0x30cb71[_0x3d4a('0x1a')](0x0);return;}})[_0x3d4a('0x22')](function(){if(_0xfc1912['output']==='web'){return null;}var _0x2fb169=_['merge'](_0xfc1912,{'name':_0xfc1912['fullPath']||_0xfc1912[_0x3d4a('0x27')]||_0x16d3e5['name'],'basename':_0x270d0a,'savename':util[_0x3d4a('0x75')]('%s-%s.%s',_0xfc1912['name']||_0x16d3e5['name'],require('randomstring')[_0x3d4a('0x8f')](0x4),_0xfc1912[_0x3d4a('0x90')]||_0x3d4a('0x91')),'reportId':_0x16d3e5['id'],'reportType':_0x3d4a('0x92')});return db[_0x3d4a('0x93')][_0x3d4a('0x46')](_0x2fb169,{'raw':!![]});})[_0x3d4a('0x22')](function(_0x2420bb){if(_0x16d3e5[_0x3d4a('0x71')]===_0x3d4a('0x94')){_0x242c7c[_0x3d4a('0x3a')](_0x16d3e5['table']+_0x3d4a('0x95'),_0xfc1912[_0x3d4a('0x96')],_0xfc1912['endDate']);}else{_0x242c7c[_0x3d4a('0x3a')](_0x16d3e5[_0x3d4a('0x71')]+_0x3d4a('0x97'),_0xfc1912[_0x3d4a('0x96')],_0xfc1912['endDate']);}if(_0x2420bb){logger[_0x3d4a('0x98')]('Run\x20Query:',_0x242c7c[_0x3d4a('0x83')]());require(_0x3d4a('0x99'))[_0x3d4a('0x9a')](path[_0x3d4a('0x54')](__dirname,'../../components/export/',_0x2420bb[_0x3d4a('0x90')]),[_0x2420bb['id'],_0x242c7c[_0x3d4a('0x83')](),path[_0x3d4a('0x54')](__dirname,'../../files/reports',_0x2420bb['savename']),_0x270d0a]);return _0x2420bb;}else{var _0x317125=squel[_0x3d4a('0x70')]();_0x317125[_0x3d4a('0x8c')]('('+_0x242c7c['toString']()+')',_0x3d4a('0x9b'));_0x317125[_0x3d4a('0x69')](_0x3d4a('0x9c'),_0x3d4a('0x1d'));_0x242c7c[_0x3d4a('0x1c')](_0xfc1912[_0x3d4a('0x1c')]||_0x3002ff);_0x242c7c[_0x3d4a('0x1a')](_0xfc1912['offset']||0x0);return dbH[_0x3d4a('0x84')][_0x3d4a('0x30')](_0x317125[_0x3d4a('0x83')](),{'type':dbH[_0x3d4a('0x84')][_0x3d4a('0x85')][_0x3d4a('0x86')]})[_0x3d4a('0x22')](function(_0x5a0719){if(!_0x5a0719[_0x3d4a('0x45')]){_0x332a1d=0x0;}else{_0x332a1d=_0x5a0719[0x0][_0x3d4a('0x1d')]||0x0;}return dbH[_0x3d4a('0x84')][_0x3d4a('0x30')](_0x242c7c[_0x3d4a('0x83')](),{'type':dbH[_0x3d4a('0x84')][_0x3d4a('0x85')]['SELECT']});})[_0x3d4a('0x22')](function(_0x21fb14){return{'rows':_0x21fb14||[],'count':_0x332a1d};});}});}exports[_0x3d4a('0x9d')]=function(_0x3696b5,_0x1a52d2){return runReport(_0x3696b5[_0x3d4a('0x44')],_0x3696b5[_0x3d4a('0x30')],_0x3696b5[_0x3d4a('0x3f')])['then'](respondWithResult(_0x1a52d2,null))[_0x3d4a('0x50')](handleError(_0x1a52d2,null));};exports[_0x3d4a('0x9e')]=runReport;exports[_0x3d4a('0x30')]=function(_0x5efdc5,_0x1e5240){var _0x2a6c7e=0xa;var _0x508f2e=['join',_0x3d4a('0x55'),_0x3d4a('0x9f'),_0x3d4a('0x87')];var _0x3583ae={'SUM':'SUM(%s)','COUNT':_0x3d4a('0x57'),'COUNT DISTINCT':_0x3d4a('0x58'),'MAX':_0x3d4a('0x59'),'MIN':_0x3d4a('0x5a'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x3d4a('0x5c'),'GROUP_CONCAT ASC':_0x3d4a('0xa0'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5b1118={'SEC_TO_TIME':_0x3d4a('0x5e'),'DATE':_0x3d4a('0x5f'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x3d4a('0x61')};var _0x1c0697=function(_0x5e11a6){return!_[_0x3d4a('0x62')]([_0x3d4a('0x63'),_0x3d4a('0x89'),_0x3d4a('0x64'),_0x3d4a('0x65')],_0x5e11a6);};var _0x31540a=function(_0x3a2988){if(!_0x3a2988||!_0x3a2988[_0x3d4a('0x66')]['length']){return'';}for(var _0x10a8d0='(',_0x2d94f5=0x0;_0x2d94f5<_0x3a2988[_0x3d4a('0x66')][_0x3d4a('0x45')];_0x2d94f5+=0x1){_0x2d94f5>0x0&&(_0x10a8d0+='\x20'+_0x3a2988[_0x3d4a('0x67')]+'\x20');_0x10a8d0+=_0x3a2988[_0x3d4a('0x66')][_0x2d94f5][_0x3d4a('0x68')]?_0x31540a(_0x3a2988[_0x3d4a('0x66')][_0x2d94f5][_0x3d4a('0x68')]):_0x3a2988['rules'][_0x2d94f5]['field']+'\x20'+_0x3a2988[_0x3d4a('0x66')][_0x2d94f5][_0x3d4a('0x6a')]+(_0x1c0697(_0x3a2988['rules'][_0x2d94f5][_0x3d4a('0x6a')])?'\x20'+_0x3a2988[_0x3d4a('0x66')][_0x2d94f5]['value']:'');}return _0x10a8d0+')';};var _0x176618={'where':{'id':_0x5efdc5[_0x3d4a('0x44')]['id']}},_0x182208,_0x1a0f7e,_0x306d45,_0x5ee4f5,_0x54ff53;_0x176618=_[_0x3d4a('0x3d')]({},_0x176618,_0x5efdc5[_0x3d4a('0x3f')]);return db['AnalyticCustomReport']['find'](_0x176618)[_0x3d4a('0x22')](function(_0x41efbb){if(_0x41efbb){_0x182208=_0x41efbb;return _0x41efbb[_0x3d4a('0x6b')]();}return null;})[_0x3d4a('0x22')](function(_0x163f91){if(_0x163f91){if(!_0x163f91[_0x3d4a('0x45')]){throw new db[(_0x3d4a('0x8b'))][(_0x3d4a('0x6c'))](_0x3d4a('0x6d'),0x193);}_0x1a0f7e=_0x163f91;return db[_0x3d4a('0x6e')][_0x3d4a('0x42')]({'raw':!![]});}return null;})[_0x3d4a('0x22')](function(_0x2eb139){if(_0x2eb139){_0x306d45=_[_0x3d4a('0x6f')](_0x2eb139,'id');var _0x3d3478;var _0xf58c86=squel[_0x3d4a('0x70')]();_0xf58c86[_0x3d4a('0x8c')](_0x182208[_0x3d4a('0x71')]);for(var _0x454c3f=0x0;_0x454c3f<_0x1a0f7e['length'];_0x454c3f+=0x1){_0x3d3478=_0x1a0f7e[_0x454c3f][_0x3d4a('0x72')]?_0x306d45[_0x1a0f7e[_0x454c3f][_0x3d4a('0x72')]][_0x3d4a('0x73')]:_0x1a0f7e[_0x454c3f][_0x3d4a('0x69')];_0x3d3478=_0x1a0f7e[_0x454c3f][_0x3d4a('0x74')]?_[_0x3d4a('0x76')](_0x3583ae[_0x1a0f7e[_0x454c3f][_0x3d4a('0x74')]],'%s',_0x3d3478):_0x3d3478;_0x3d3478=_0x1a0f7e[_0x454c3f][_0x3d4a('0x75')]?_[_0x3d4a('0x76')](_0x5b1118[_0x1a0f7e[_0x454c3f][_0x3d4a('0x75')]],'%s',_0x3d3478):_0x3d3478;if(_0x1a0f7e[_0x454c3f]['groupBy']){_0xf58c86[_0x3d4a('0x68')](_0x3d3478);}_0x1a0f7e[_0x454c3f][_0x3d4a('0x78')]&&_0xf58c86[_0x3d4a('0x38')](_0x3d3478,_0x1a0f7e[_0x454c3f][_0x3d4a('0x78')]===_0x3d4a('0x79')?![]:!![]);_0xf58c86[_0x3d4a('0x69')](_0x3d3478,_0x1a0f7e[_0x454c3f][_0x3d4a('0x8d')]||_0x3d3478);}if(_0x182208[_0x3d4a('0x7a')]){_0x182208['joins']=JSON[_0x3d4a('0x7b')](_0x182208[_0x3d4a('0x7a')]);for(var _0x3e049c=0x0;_0x3e049c<_0x182208[_0x3d4a('0x7a')][_0x3d4a('0x45')];_0x3e049c+=0x1){if(_0x182208['joins'][_0x3e049c][_0x3d4a('0x2d')]&&_[_0x3d4a('0x62')](_0x508f2e,_0x182208[_0x3d4a('0x7a')][_0x3e049c][_0x3d4a('0x2d')])&&_0x182208[_0x3d4a('0x7a')][_0x3e049c][_0x3d4a('0x7c')]&&_0x182208['joins'][_0x3e049c][_0x3d4a('0x7d')]&&_0x182208[_0x3d4a('0x7a')][_0x3e049c][_0x3d4a('0x7e')]){_0xf58c86[_0x182208['joins'][_0x3e049c]['type']](_0x182208[_0x3d4a('0x7a')][_0x3e049c]['foreignTable'],null,util[_0x3d4a('0x75')](_0x3d4a('0x8e'),_0x182208['table'],_0x182208[_0x3d4a('0x7a')][_0x3e049c][_0x3d4a('0x7c')],_0x182208[_0x3d4a('0x7a')][_0x3e049c]['foreignTable'],_0x182208[_0x3d4a('0x7a')][_0x3e049c][_0x3d4a('0x7e')]));}}}if(_0x182208[_0x3d4a('0x7f')]){_0x182208[_0x3d4a('0x7f')]=JSON[_0x3d4a('0x7b')](_0x182208[_0x3d4a('0x7f')]);_0xf58c86['where'](_0x31540a(_0x182208['conditions'][_0x3d4a('0x68')]));}_0x54ff53=_0xf58c86[_0x3d4a('0x80')]();_0xf58c86['limit'](_0x2a6c7e);_0xf58c86[_0x3d4a('0x1a')](0x0);logger[_0x3d4a('0x81')](_0x3d4a('0x82'),_0xf58c86['toString']());return dbH[_0x3d4a('0x84')][_0x3d4a('0x30')](_0xf58c86['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0x3d4a('0x86')]});}})['then'](function(){return{'sql':_0x54ff53[_0x3d4a('0x83')]()};})[_0x3d4a('0x22')](respondWithResult(_0x1e5240,null))[_0x3d4a('0x50')](handleError(_0x1e5240,null));}; \ No newline at end of file +var _0x8907=['autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','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','order','alias','parse','joins','parentKey','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','join','left_join','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20EMPTY','operator','%s.%s\x20=\x20%s.%s','output','web','%s-%s.%s','randomstring','generate','custom','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','run','COUNT(DISTINCT\x20%s)','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','apply','save','update','then','destroy','get','CustomReports','UserProfileResource','stack','name','AnalyticCustomReport','fieldName','key','map','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId'];(function(_0x7a112,_0x2eb4a0){var _0x136dc5=function(_0x437650){while(--_0x437650){_0x7a112['push'](_0x7a112['shift']());}};_0x136dc5(++_0x2eb4a0);}(_0x8907,0x19d));var _0x7890=function(_0x3e72da,_0x7909e3){_0x3e72da=_0x3e72da-0x0;var _0x20a27d=_0x8907[_0x3e72da];return _0x20a27d;};'use strict';var emlformat=require(_0x7890('0x0'));var rimraf=require(_0x7890('0x1'));var zipdir=require(_0x7890('0x2'));var jsonpatch=require(_0x7890('0x3'));var rp=require(_0x7890('0x4'));var moment=require(_0x7890('0x5'));var BPromise=require(_0x7890('0x6'));var Mustache=require(_0x7890('0x7'));var util=require('util');var path=require(_0x7890('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7890('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7890('0xa'));var squel=require(_0x7890('0xb'));var crypto=require(_0x7890('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7890('0xd'));var toCsv=require(_0x7890('0xe'));var querystring=require(_0x7890('0xf'));var Papa=require('papaparse');var Redis=require(_0x7890('0x10'));var authService=require(_0x7890('0x11'));var qs=require(_0x7890('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7890('0x13'))(_0x7890('0x14'));var utils=require('../../config/utils');var config=require(_0x7890('0x15'));var licenseUtil=require(_0x7890('0x16'));var db=require(_0x7890('0x17'))['db'];var dbH=require(_0x7890('0x17'))['dbH'];function respondWithStatusCode(_0x55c27a,_0xbed44){_0xbed44=_0xbed44||0xcc;return function(_0x12bca5){if(_0x12bca5){return _0x55c27a[_0x7890('0x18')](_0xbed44);}return _0x55c27a['status'](_0xbed44)[_0x7890('0x19')]();};}function respondWithResult(_0x8b7e54,_0x34c527){_0x34c527=_0x34c527||0xc8;return function(_0x50c41a){if(_0x50c41a){return _0x8b7e54[_0x7890('0x1a')](_0x34c527)['json'](_0x50c41a);}};}function respondWithFilteredResult(_0x123657,_0x12344f){return function(_0x5cbb56){if(_0x5cbb56){var _0x3fe3ae=typeof _0x12344f[_0x7890('0x1b')]===_0x7890('0x1c')&&typeof _0x12344f['limit']===_0x7890('0x1c');var _0x215633=_0x5cbb56[_0x7890('0x1d')];var _0x55ca07=_0x3fe3ae?0x0:_0x12344f[_0x7890('0x1b')];var _0x212e1e=_0x3fe3ae?_0x5cbb56['count']:_0x12344f[_0x7890('0x1b')]+_0x12344f[_0x7890('0x1e')];var _0x355ee6;if(_0x212e1e>=_0x215633){_0x212e1e=_0x215633;_0x355ee6=0xc8;}else{_0x355ee6=0xce;}_0x123657['status'](_0x355ee6);return _0x123657[_0x7890('0x1f')](_0x7890('0x20'),_0x55ca07+'-'+_0x212e1e+'/'+_0x215633)[_0x7890('0x21')](_0x5cbb56);}return null;};}function patchUpdates(_0x43e30b){return function(_0xc6839e){try{jsonpatch[_0x7890('0x22')](_0xc6839e,_0x43e30b,!![]);}catch(_0x21df4f){return BPromise['reject'](_0x21df4f);}return _0xc6839e[_0x7890('0x23')]();};}function saveUpdates(_0x38937a,_0x5e7450){return function(_0x27136b){if(_0x27136b){return _0x27136b[_0x7890('0x24')](_0x38937a)[_0x7890('0x25')](function(_0x4c845f){return _0x4c845f;});}return null;};}function removeEntity(_0xbb3208,_0xbe0621){return function(_0x15cc9c){if(_0x15cc9c){return _0x15cc9c[_0x7890('0x26')]()[_0x7890('0x25')](function(){var _0x52c0db=_0x15cc9c[_0x7890('0x27')]({'plain':!![]});var _0x103952=_0x7890('0x28');return db[_0x7890('0x29')][_0x7890('0x26')]({'where':{'type':_0x103952,'resourceId':_0x52c0db['id']}})[_0x7890('0x25')](function(){return _0x15cc9c;});})['then'](function(){_0xbb3208[_0x7890('0x1a')](0xcc)[_0x7890('0x19')]();});}};}function handleEntityNotFound(_0x471b84,_0x4a7f91){return function(_0xb27eba){if(!_0xb27eba){_0x471b84[_0x7890('0x18')](0x194);}return _0xb27eba;};}function handleError(_0x363f32,_0x5ea102){_0x5ea102=_0x5ea102||0x1f4;return function(_0x5ca96b){logger['error'](_0x5ca96b[_0x7890('0x2a')]);if(_0x5ca96b[_0x7890('0x2b')]){delete _0x5ca96b[_0x7890('0x2b')];}_0x363f32[_0x7890('0x1a')](_0x5ea102)['send'](_0x5ca96b);};}exports['index']=function(_0x564ca8,_0x502c75){var _0x4fd915={},_0x1f74d5={},_0x3095d1={'count':0x0,'rows':[]};var _0x176714=_['map'](db[_0x7890('0x2c')]['rawAttributes'],function(_0x2a95d6){return{'name':_0x2a95d6[_0x7890('0x2d')],'type':_0x2a95d6['type'][_0x7890('0x2e')]};});_0x1f74d5['model']=_[_0x7890('0x2f')](_0x176714,_0x7890('0x2b'));_0x1f74d5[_0x7890('0x30')]=_[_0x7890('0x31')](_0x564ca8[_0x7890('0x30')]);_0x1f74d5[_0x7890('0x32')]=_[_0x7890('0x33')](_0x1f74d5['model'],_0x1f74d5[_0x7890('0x30')]);_0x4fd915[_0x7890('0x34')]=_[_0x7890('0x33')](_0x1f74d5['model'],qs[_0x7890('0x35')](_0x564ca8[_0x7890('0x30')][_0x7890('0x35')]));_0x4fd915[_0x7890('0x34')]=_0x4fd915[_0x7890('0x34')][_0x7890('0x36')]?_0x4fd915['attributes']:_0x1f74d5[_0x7890('0x37')];if(!_0x564ca8[_0x7890('0x30')][_0x7890('0x38')](_0x7890('0x39'))){_0x4fd915[_0x7890('0x1e')]=qs[_0x7890('0x1e')](_0x564ca8[_0x7890('0x30')][_0x7890('0x1e')]);_0x4fd915[_0x7890('0x1b')]=qs[_0x7890('0x1b')](_0x564ca8[_0x7890('0x30')][_0x7890('0x1b')]);}_0x4fd915['order']=qs[_0x7890('0x3a')](_0x564ca8['query'][_0x7890('0x3a')]);_0x4fd915['where']=qs[_0x7890('0x32')](_[_0x7890('0x3b')](_0x564ca8['query'],_0x1f74d5[_0x7890('0x32')]),_0x176714);if(_0x564ca8[_0x7890('0x30')][_0x7890('0x3c')]){_0x4fd915[_0x7890('0x3d')]=_[_0x7890('0x3e')](_0x4fd915[_0x7890('0x3d')],{'$or':_[_0x7890('0x2f')](_0x176714,function(_0x27ca63){if(_0x27ca63[_0x7890('0x3f')]!==_0x7890('0x40')){var _0x1b728a={};_0x1b728a[_0x27ca63[_0x7890('0x2b')]]={'$like':'%'+_0x564ca8[_0x7890('0x30')][_0x7890('0x3c')]+'%'};return _0x1b728a;}})});}_0x4fd915=_['merge']({},_0x4fd915,_0x564ca8[_0x7890('0x41')]);var _0x44ea76={'where':_0x4fd915[_0x7890('0x3d')]};return db[_0x7890('0x2c')]['count'](_0x44ea76)[_0x7890('0x25')](function(_0x8f3129){_0x3095d1[_0x7890('0x1d')]=_0x8f3129;if(_0x564ca8[_0x7890('0x30')][_0x7890('0x42')]){_0x4fd915[_0x7890('0x43')]=[{'all':!![]}];}return db[_0x7890('0x2c')][_0x7890('0x44')](_0x4fd915);})['then'](function(_0x23df5d){_0x3095d1[_0x7890('0x45')]=_0x23df5d;return _0x3095d1;})[_0x7890('0x25')](respondWithFilteredResult(_0x502c75,_0x4fd915))[_0x7890('0x46')](handleError(_0x502c75,null));};exports[_0x7890('0x47')]=function(_0x42c553,_0x516503){var _0x42d48e={'raw':![],'where':{'id':_0x42c553[_0x7890('0x48')]['id']}},_0x1c419c={};_0x1c419c[_0x7890('0x37')]=_['keys'](db[_0x7890('0x2c')][_0x7890('0x49')]);_0x1c419c[_0x7890('0x30')]=_[_0x7890('0x31')](_0x42c553[_0x7890('0x30')]);_0x1c419c['filters']=_[_0x7890('0x33')](_0x1c419c['model'],_0x1c419c[_0x7890('0x30')]);_0x42d48e[_0x7890('0x34')]=_[_0x7890('0x33')](_0x1c419c[_0x7890('0x37')],qs['fields'](_0x42c553[_0x7890('0x30')]['fields']));_0x42d48e[_0x7890('0x34')]=_0x42d48e[_0x7890('0x34')]['length']?_0x42d48e['attributes']:_0x1c419c[_0x7890('0x37')];if(_0x42c553[_0x7890('0x30')][_0x7890('0x42')]){_0x42d48e[_0x7890('0x43')]=[{'all':!![]}];}_0x42d48e=_[_0x7890('0x3e')]({},_0x42d48e,_0x42c553['options']);return db[_0x7890('0x2c')][_0x7890('0x4a')](_0x42d48e)[_0x7890('0x25')](handleEntityNotFound(_0x516503,null))['then'](respondWithResult(_0x516503,null))[_0x7890('0x46')](handleError(_0x516503,null));};exports['create']=function(_0x467880,_0x515f5f){return db[_0x7890('0x2c')][_0x7890('0x4b')](_0x467880[_0x7890('0x4c')],{})[_0x7890('0x25')](function(_0x2585d7){var _0xe04cb8=_0x467880[_0x7890('0x4d')][_0x7890('0x27')]({'plain':!![]});if(!_0xe04cb8)throw new Error(_0x7890('0x4e'));if(_0xe04cb8[_0x7890('0x4f')]===_0x7890('0x4d')){var _0x44922a=_0x2585d7[_0x7890('0x27')]({'plain':!![]});var _0xb5bcbb='Reports';return db[_0x7890('0x50')][_0x7890('0x4a')]({'where':{'name':_0xb5bcbb,'userProfileId':_0xe04cb8[_0x7890('0x51')]},'raw':!![]})[_0x7890('0x25')](function(_0x5e972c){if(_0x5e972c&&_0x5e972c[_0x7890('0x52')]===0x0){return db[_0x7890('0x29')][_0x7890('0x4b')]({'name':_0x44922a['name'],'resourceId':_0x44922a['id'],'type':_0x7890('0x28'),'sectionId':_0x5e972c['id']},{})[_0x7890('0x25')](function(){return _0x2585d7;});}else{return _0x2585d7;}})[_0x7890('0x46')](function(_0xfafc2e){logger[_0x7890('0x53')](_0x7890('0x54'),_0xfafc2e);throw _0xfafc2e;});}return _0x2585d7;})['then'](respondWithResult(_0x515f5f,0xc9))[_0x7890('0x46')](handleError(_0x515f5f,null));};exports[_0x7890('0x24')]=function(_0xd5338e,_0x27c5e9){if(_0xd5338e[_0x7890('0x4c')]['id']){delete _0xd5338e[_0x7890('0x4c')]['id'];}return db[_0x7890('0x2c')][_0x7890('0x4a')]({'where':{'id':_0xd5338e[_0x7890('0x48')]['id']}})['then'](handleEntityNotFound(_0x27c5e9,null))[_0x7890('0x25')](saveUpdates(_0xd5338e[_0x7890('0x4c')],null))[_0x7890('0x25')](respondWithResult(_0x27c5e9,null))['catch'](handleError(_0x27c5e9,null));};exports[_0x7890('0x26')]=function(_0x4115b9,_0x2732d1){return db[_0x7890('0x2c')][_0x7890('0x4a')]({'where':{'id':_0x4115b9[_0x7890('0x48')]['id']}})[_0x7890('0x25')](handleEntityNotFound(_0x2732d1,null))[_0x7890('0x25')](removeEntity(_0x2732d1,null))[_0x7890('0x46')](handleError(_0x2732d1,null));};exports[_0x7890('0x55')]=function(_0x5d8f1b,_0x3665ed){var _0x1195c7=0xa;var _0x46db1a=['join','left_join',_0x7890('0x56'),_0x7890('0x57')];var _0x11438d={'SUM':_0x7890('0x58'),'COUNT':_0x7890('0x59'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x7890('0x5a'),'MIN':_0x7890('0x5b'),'AVG':_0x7890('0x5c'),'GROUP_CONCAT':_0x7890('0x5d'),'GROUP_CONCAT ASC':_0x7890('0x5e'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x3c04f4={'SEC_TO_TIME':_0x7890('0x5f'),'DATE':_0x7890('0x60'),'HOUR':_0x7890('0x61'),'ROUND':_0x7890('0x62'),'UNIX_TIMESTAMP':_0x7890('0x63')};var _0x5f5698=function(_0x56ca3f){return!_[_0x7890('0x64')]([_0x7890('0x65'),_0x7890('0x66'),'IS\x20EMPTY',_0x7890('0x67')],_0x56ca3f);};var _0x127e7a=function(_0x4518c6){if(!_0x4518c6||!_0x4518c6['rules'][_0x7890('0x36')]){return'';}for(var _0x5e4fbc='(',_0x5abc08=0x0;_0x5abc08<_0x4518c6[_0x7890('0x68')][_0x7890('0x36')];_0x5abc08+=0x1){_0x5abc08>0x0&&(_0x5e4fbc+='\x20'+_0x4518c6['operator']+'\x20');_0x5e4fbc+=_0x4518c6[_0x7890('0x68')][_0x5abc08][_0x7890('0x69')]?_0x127e7a(_0x4518c6[_0x7890('0x68')][_0x5abc08][_0x7890('0x69')]):_0x4518c6['rules'][_0x5abc08][_0x7890('0x6a')]+'\x20'+_0x4518c6[_0x7890('0x68')][_0x5abc08][_0x7890('0x6b')]+(_0x5f5698(_0x4518c6[_0x7890('0x68')][_0x5abc08][_0x7890('0x6b')])?'\x20'+_0x4518c6[_0x7890('0x68')][_0x5abc08][_0x7890('0x6c')]:'');}return _0x5e4fbc+')';};var _0x5eea8b={'where':{'id':_0x5d8f1b[_0x7890('0x48')]['id']}},_0x1212fa,_0x173203,_0x27440e,_0x687a54,_0x2f3011;_0x5eea8b=_[_0x7890('0x3e')]({},_0x5eea8b,_0x5d8f1b['options']);return db['AnalyticCustomReport'][_0x7890('0x4a')](_0x5eea8b)[_0x7890('0x25')](function(_0x58ecf5){if(_0x58ecf5){_0x1212fa=_0x58ecf5;return _0x58ecf5[_0x7890('0x6d')]();}return null;})[_0x7890('0x25')](function(_0x4d82e2){if(_0x4d82e2){if(!_0x4d82e2['length']){throw new db[(_0x7890('0x6e'))][(_0x7890('0x6f'))](_0x7890('0x70'),0x193);}_0x173203=_0x4d82e2;return db[_0x7890('0x71')][_0x7890('0x44')]({'raw':!![]});}return null;})[_0x7890('0x25')](function(_0x518417){if(_0x518417){_0x27440e=_[_0x7890('0x72')](_0x518417,'id');var _0x17b275;var _0x32f26e=squel[_0x7890('0x73')]();_0x32f26e[_0x7890('0x74')](_0x1212fa[_0x7890('0x75')]);for(var _0x2856da=0x0;_0x2856da<_0x173203[_0x7890('0x36')];_0x2856da+=0x1){_0x17b275=_0x173203[_0x2856da][_0x7890('0x76')]?_0x27440e[_0x173203[_0x2856da]['MetricId']][_0x7890('0x77')]:_0x173203[_0x2856da]['field'];_0x17b275=_0x173203[_0x2856da][_0x7890('0x78')]?_[_0x7890('0x79')](_0x11438d[_0x173203[_0x2856da][_0x7890('0x78')]],'%s',_0x17b275):_0x17b275;_0x17b275=_0x173203[_0x2856da][_0x7890('0x7a')]?_[_0x7890('0x79')](_0x3c04f4[_0x173203[_0x2856da][_0x7890('0x7a')]],'%s',_0x17b275):_0x17b275;if(_0x173203[_0x2856da][_0x7890('0x7b')]){_0x32f26e[_0x7890('0x69')](_0x17b275);}_0x173203[_0x2856da][_0x7890('0x7c')]&&_0x32f26e[_0x7890('0x7d')](_0x17b275,_0x173203[_0x2856da]['orderBy']==='DESC'?![]:!![]);_0x32f26e[_0x7890('0x6a')](_0x17b275,_0x173203[_0x2856da][_0x7890('0x7e')]||_0x17b275);}if(_0x1212fa['joins']){_0x1212fa['joins']=JSON[_0x7890('0x7f')](_0x1212fa[_0x7890('0x80')]);for(var _0x1e74c1=0x0;_0x1e74c1<_0x1212fa[_0x7890('0x80')][_0x7890('0x36')];_0x1e74c1+=0x1){if(_0x1212fa['joins'][_0x1e74c1][_0x7890('0x3f')]&&_[_0x7890('0x64')](_0x46db1a,_0x1212fa[_0x7890('0x80')][_0x1e74c1][_0x7890('0x3f')])&&_0x1212fa['joins'][_0x1e74c1][_0x7890('0x81')]&&_0x1212fa[_0x7890('0x80')][_0x1e74c1][_0x7890('0x82')]&&_0x1212fa['joins'][_0x1e74c1]['foreignKey']){_0x32f26e[_0x1212fa[_0x7890('0x80')][_0x1e74c1][_0x7890('0x3f')]](_0x1212fa['joins'][_0x1e74c1][_0x7890('0x82')],null,util[_0x7890('0x7a')]('%s.%s\x20=\x20%s.%s',_0x1212fa[_0x7890('0x75')],_0x1212fa[_0x7890('0x80')][_0x1e74c1][_0x7890('0x81')],_0x1212fa[_0x7890('0x80')][_0x1e74c1]['foreignTable'],_0x1212fa[_0x7890('0x80')][_0x1e74c1][_0x7890('0x83')]));}}}if(_0x1212fa['conditions']){_0x1212fa[_0x7890('0x84')]=JSON[_0x7890('0x7f')](_0x1212fa['conditions']);_0x32f26e[_0x7890('0x3d')](_0x127e7a(_0x1212fa[_0x7890('0x84')]['group']));}_0x2f3011=_0x32f26e[_0x7890('0x85')]();_0x32f26e[_0x7890('0x1e')](_0x1195c7);_0x32f26e['offset'](0x0);logger[_0x7890('0x86')](_0x7890('0x87'),_0x32f26e[_0x7890('0x88')]());return dbH[_0x7890('0x89')]['query'](_0x32f26e[_0x7890('0x88')](),{'type':dbH[_0x7890('0x89')][_0x7890('0x8a')][_0x7890('0x8b')]});}})[_0x7890('0x25')](respondWithResult(_0x3665ed,null))['catch'](handleError(_0x3665ed,null));};function runReport(_0x668294,_0x3613db,_0x1d3f7e){var _0x1aa3c2=_0x3613db[_0x7890('0x2b')];var _0xe57492=0xa;var _0x68bfbb=[_0x7890('0x8c'),_0x7890('0x8d'),_0x7890('0x56'),_0x7890('0x57')];var _0x31ea80={'SUM':_0x7890('0x58'),'COUNT':_0x7890('0x59'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x7890('0x5a'),'MIN':_0x7890('0x5b'),'AVG':_0x7890('0x5c'),'GROUP_CONCAT':_0x7890('0x5d'),'GROUP_CONCAT ASC':_0x7890('0x5e'),'GROUP_CONCAT DESC':_0x7890('0x8e')};var _0x44597b={'SEC_TO_TIME':_0x7890('0x5f'),'DATE':_0x7890('0x60'),'HOUR':_0x7890('0x61'),'ROUND':_0x7890('0x62'),'UNIX_TIMESTAMP':_0x7890('0x63')};var _0x18cd5f=function(_0x1b9e0c){return!_['includes']([_0x7890('0x65'),_0x7890('0x66'),_0x7890('0x8f'),_0x7890('0x67')],_0x1b9e0c);};var _0x3f407e=function(_0x497bb7){if(!_0x497bb7||!_0x497bb7[_0x7890('0x68')][_0x7890('0x36')]){return'';}for(var _0x5270f1='(',_0xb2ac2=0x0;_0xb2ac2<_0x497bb7['rules']['length'];_0xb2ac2+=0x1){_0xb2ac2>0x0&&(_0x5270f1+='\x20'+_0x497bb7[_0x7890('0x90')]+'\x20');_0x5270f1+=_0x497bb7[_0x7890('0x68')][_0xb2ac2][_0x7890('0x69')]?_0x3f407e(_0x497bb7[_0x7890('0x68')][_0xb2ac2]['group']):_0x497bb7[_0x7890('0x68')][_0xb2ac2][_0x7890('0x6a')]+'\x20'+_0x497bb7['rules'][_0xb2ac2][_0x7890('0x6b')]+(_0x18cd5f(_0x497bb7['rules'][_0xb2ac2][_0x7890('0x6b')])?'\x20'+_0x497bb7['rules'][_0xb2ac2][_0x7890('0x6c')]:'');}return _0x5270f1+')';};var _0x48b6c2={'where':{'id':_0x668294['id']}},_0x46bd12,_0x36de95,_0x13875c,_0xe4b81a,_0x5d38df;_0x48b6c2=_[_0x7890('0x3e')]({},_0x48b6c2,_0x1d3f7e);return db['AnalyticCustomReport']['find'](_0x48b6c2)[_0x7890('0x25')](function(_0x45270b){if(_0x45270b){_0x46bd12=_0x45270b;return _0x45270b[_0x7890('0x6d')]();}return null;})['then'](function(_0x39ca0b){if(_0x39ca0b){if(!_0x39ca0b[_0x7890('0x36')]){throw new db[(_0x7890('0x6e'))][(_0x7890('0x6f'))](_0x7890('0x70'),0x193);}_0x36de95=_0x39ca0b;return db[_0x7890('0x71')]['findAll']({'raw':!![]});}return null;})[_0x7890('0x25')](function(_0x13c4b2){if(_0x13c4b2){_0x13875c=_[_0x7890('0x72')](_0x13c4b2,'id');var _0xfc4a33;var _0x1cf91a=squel[_0x7890('0x73')]();_0x1cf91a[_0x7890('0x74')](_0x46bd12['table']);for(var _0x25fd81=0x0;_0x25fd81<_0x36de95[_0x7890('0x36')];_0x25fd81+=0x1){_0xfc4a33=_0x36de95[_0x25fd81][_0x7890('0x76')]?_0x13875c[_0x36de95[_0x25fd81][_0x7890('0x76')]][_0x7890('0x77')]:_0x36de95[_0x25fd81][_0x7890('0x6a')];_0xfc4a33=_0x36de95[_0x25fd81][_0x7890('0x78')]?_[_0x7890('0x79')](_0x31ea80[_0x36de95[_0x25fd81][_0x7890('0x78')]],'%s',_0xfc4a33):_0xfc4a33;_0xfc4a33=_0x36de95[_0x25fd81][_0x7890('0x7a')]?_[_0x7890('0x79')](_0x44597b[_0x36de95[_0x25fd81][_0x7890('0x7a')]],'%s',_0xfc4a33):_0xfc4a33;if(_0x36de95[_0x25fd81][_0x7890('0x7b')]){_0x1cf91a['group'](_0xfc4a33);}_0x36de95[_0x25fd81]['orderBy']&&_0x1cf91a[_0x7890('0x7d')](_0xfc4a33,_0x36de95[_0x25fd81][_0x7890('0x7c')]==='DESC'?![]:!![]);_0x1cf91a['field'](_0xfc4a33,_0x36de95[_0x25fd81][_0x7890('0x7e')]||_0xfc4a33);}if(_0x46bd12[_0x7890('0x80')]){_0x46bd12['joins']=JSON['parse'](_0x46bd12['joins']);for(var _0x32ef74=0x0;_0x32ef74<_0x46bd12[_0x7890('0x80')][_0x7890('0x36')];_0x32ef74+=0x1){if(_0x46bd12[_0x7890('0x80')][_0x32ef74][_0x7890('0x3f')]&&_['includes'](_0x68bfbb,_0x46bd12[_0x7890('0x80')][_0x32ef74][_0x7890('0x3f')])&&_0x46bd12['joins'][_0x32ef74][_0x7890('0x81')]&&_0x46bd12['joins'][_0x32ef74]['foreignTable']&&_0x46bd12[_0x7890('0x80')][_0x32ef74]['foreignKey']){_0x1cf91a[_0x46bd12[_0x7890('0x80')][_0x32ef74][_0x7890('0x3f')]](_0x46bd12[_0x7890('0x80')][_0x32ef74][_0x7890('0x82')],null,util[_0x7890('0x7a')](_0x7890('0x91'),_0x46bd12[_0x7890('0x75')],_0x46bd12[_0x7890('0x80')][_0x32ef74]['parentKey'],_0x46bd12[_0x7890('0x80')][_0x32ef74][_0x7890('0x82')],_0x46bd12[_0x7890('0x80')][_0x32ef74][_0x7890('0x83')]));}}}if(_0x46bd12[_0x7890('0x84')]){_0x46bd12[_0x7890('0x84')]=JSON[_0x7890('0x7f')](_0x46bd12['conditions']);_0x1cf91a[_0x7890('0x3d')](_0x3f407e(_0x46bd12[_0x7890('0x84')][_0x7890('0x69')]));}_0x5d38df=_0x1cf91a[_0x7890('0x85')]();_0x1cf91a[_0x7890('0x1e')](_0xe57492);_0x1cf91a[_0x7890('0x1b')](0x0);return;}})[_0x7890('0x25')](function(){if(_0x3613db[_0x7890('0x92')]===_0x7890('0x93')){return null;}var _0x2c2623=_[_0x7890('0x3e')](_0x3613db,{'name':_0x3613db['fullPath']||_0x3613db[_0x7890('0x2b')]||_0x46bd12[_0x7890('0x2b')],'basename':_0x1aa3c2,'savename':util[_0x7890('0x7a')](_0x7890('0x94'),_0x3613db['name']||_0x46bd12[_0x7890('0x2b')],require(_0x7890('0x95'))[_0x7890('0x96')](0x4),_0x3613db[_0x7890('0x92')]||'csv'),'reportId':_0x46bd12['id'],'reportType':_0x7890('0x97')});return db[_0x7890('0x98')][_0x7890('0x4b')](_0x2c2623,{'raw':!![]});})[_0x7890('0x25')](function(_0x5d0af5){if(_0x46bd12['table']===_0x7890('0x99')){_0x5d38df[_0x7890('0x3d')](_0x46bd12[_0x7890('0x75')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x3613db[_0x7890('0x9a')],_0x3613db[_0x7890('0x9b')]);}else{_0x5d38df[_0x7890('0x3d')](_0x46bd12[_0x7890('0x75')]+_0x7890('0x9c'),_0x3613db[_0x7890('0x9a')],_0x3613db[_0x7890('0x9b')]);}if(_0x5d0af5){logger['info'](_0x7890('0x9d'),_0x5d38df[_0x7890('0x88')]());require(_0x7890('0x9e'))[_0x7890('0x9f')](path[_0x7890('0x8c')](__dirname,_0x7890('0xa0'),_0x5d0af5[_0x7890('0x92')]),[_0x5d0af5['id'],_0x5d38df[_0x7890('0x88')](),path['join'](__dirname,_0x7890('0xa1'),_0x5d0af5[_0x7890('0xa2')]),_0x1aa3c2]);return _0x5d0af5;}else{var _0x3e5b3f=squel[_0x7890('0x73')]();_0x3e5b3f[_0x7890('0x74')]('('+_0x5d38df[_0x7890('0x88')]()+')','countTable');_0x3e5b3f[_0x7890('0x6a')]('COUNT(*)','count');_0x5d38df['limit'](_0x3613db[_0x7890('0x1e')]||_0xe57492);_0x5d38df[_0x7890('0x1b')](_0x3613db['offset']||0x0);return dbH[_0x7890('0x89')][_0x7890('0x30')](_0x3e5b3f[_0x7890('0x88')](),{'type':dbH[_0x7890('0x89')][_0x7890('0x8a')][_0x7890('0x8b')]})[_0x7890('0x25')](function(_0x3ca53b){if(!_0x3ca53b[_0x7890('0x36')]){_0xe4b81a=0x0;}else{_0xe4b81a=_0x3ca53b[0x0]['count']||0x0;}return dbH[_0x7890('0x89')]['query'](_0x5d38df['toString'](),{'type':dbH[_0x7890('0x89')]['QueryTypes'][_0x7890('0x8b')]});})[_0x7890('0x25')](function(_0x4e294b){return{'rows':_0x4e294b||[],'count':_0xe4b81a};});}});}exports[_0x7890('0xa3')]=function(_0x514916,_0x5f1c8e){return runReport(_0x514916[_0x7890('0x48')],_0x514916[_0x7890('0x30')],_0x514916['options'])[_0x7890('0x25')](respondWithResult(_0x5f1c8e,null))['catch'](handleError(_0x5f1c8e,null));};exports['runReport']=runReport;exports[_0x7890('0x30')]=function(_0x3df855,_0x32a1f5){var _0x39e56b=0xa;var _0x396b80=[_0x7890('0x8c'),_0x7890('0x8d'),_0x7890('0x56'),_0x7890('0x57')];var _0x4aac42={'SUM':'SUM(%s)','COUNT':_0x7890('0x59'),'COUNT DISTINCT':_0x7890('0xa4'),'MAX':_0x7890('0x5a'),'MIN':'MIN(%s)','AVG':_0x7890('0x5c'),'GROUP_CONCAT':_0x7890('0x5d'),'GROUP_CONCAT ASC':_0x7890('0x5e'),'GROUP_CONCAT DESC':_0x7890('0x8e')};var _0x5cd5b1={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x7890('0x60'),'HOUR':'HOUR(%s)','ROUND':_0x7890('0x62'),'UNIX_TIMESTAMP':_0x7890('0x63')};var _0x209f5a=function(_0x11d2ee){return!_['includes']([_0x7890('0x65'),_0x7890('0x66'),_0x7890('0x8f'),_0x7890('0x67')],_0x11d2ee);};var _0x3fab8b=function(_0x39aa40){if(!_0x39aa40||!_0x39aa40[_0x7890('0x68')]['length']){return'';}for(var _0x2de1cb='(',_0x6d1947=0x0;_0x6d1947<_0x39aa40['rules'][_0x7890('0x36')];_0x6d1947+=0x1){_0x6d1947>0x0&&(_0x2de1cb+='\x20'+_0x39aa40[_0x7890('0x90')]+'\x20');_0x2de1cb+=_0x39aa40[_0x7890('0x68')][_0x6d1947]['group']?_0x3fab8b(_0x39aa40['rules'][_0x6d1947]['group']):_0x39aa40['rules'][_0x6d1947][_0x7890('0x6a')]+'\x20'+_0x39aa40[_0x7890('0x68')][_0x6d1947][_0x7890('0x6b')]+(_0x209f5a(_0x39aa40[_0x7890('0x68')][_0x6d1947][_0x7890('0x6b')])?'\x20'+_0x39aa40[_0x7890('0x68')][_0x6d1947][_0x7890('0x6c')]:'');}return _0x2de1cb+')';};var _0x4f294c={'where':{'id':_0x3df855[_0x7890('0x48')]['id']}},_0x2e9247,_0x2158ae,_0x252552,_0x4efa93,_0x496273;_0x4f294c=_[_0x7890('0x3e')]({},_0x4f294c,_0x3df855[_0x7890('0x41')]);return db[_0x7890('0x2c')][_0x7890('0x4a')](_0x4f294c)[_0x7890('0x25')](function(_0xe4c598){if(_0xe4c598){_0x2e9247=_0xe4c598;return _0xe4c598[_0x7890('0x6d')]();}return null;})['then'](function(_0x3c829d){if(_0x3c829d){if(!_0x3c829d[_0x7890('0x36')]){throw new db[(_0x7890('0x6e'))][(_0x7890('0x6f'))](_0x7890('0x70'),0x193);}_0x2158ae=_0x3c829d;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})['then'](function(_0x427e9d){if(_0x427e9d){_0x252552=_['keyBy'](_0x427e9d,'id');var _0x5833d3;var _0x3fb2bd=squel[_0x7890('0x73')]();_0x3fb2bd['from'](_0x2e9247[_0x7890('0x75')]);for(var _0x1c3376=0x0;_0x1c3376<_0x2158ae[_0x7890('0x36')];_0x1c3376+=0x1){_0x5833d3=_0x2158ae[_0x1c3376][_0x7890('0x76')]?_0x252552[_0x2158ae[_0x1c3376][_0x7890('0x76')]][_0x7890('0x77')]:_0x2158ae[_0x1c3376]['field'];_0x5833d3=_0x2158ae[_0x1c3376][_0x7890('0x78')]?_[_0x7890('0x79')](_0x4aac42[_0x2158ae[_0x1c3376][_0x7890('0x78')]],'%s',_0x5833d3):_0x5833d3;_0x5833d3=_0x2158ae[_0x1c3376]['format']?_[_0x7890('0x79')](_0x5cd5b1[_0x2158ae[_0x1c3376][_0x7890('0x7a')]],'%s',_0x5833d3):_0x5833d3;if(_0x2158ae[_0x1c3376]['groupBy']){_0x3fb2bd[_0x7890('0x69')](_0x5833d3);}_0x2158ae[_0x1c3376][_0x7890('0x7c')]&&_0x3fb2bd[_0x7890('0x7d')](_0x5833d3,_0x2158ae[_0x1c3376][_0x7890('0x7c')]==='DESC'?![]:!![]);_0x3fb2bd['field'](_0x5833d3,_0x2158ae[_0x1c3376][_0x7890('0x7e')]||_0x5833d3);}if(_0x2e9247[_0x7890('0x80')]){_0x2e9247['joins']=JSON[_0x7890('0x7f')](_0x2e9247[_0x7890('0x80')]);for(var _0x463ecd=0x0;_0x463ecd<_0x2e9247[_0x7890('0x80')][_0x7890('0x36')];_0x463ecd+=0x1){if(_0x2e9247[_0x7890('0x80')][_0x463ecd]['type']&&_[_0x7890('0x64')](_0x396b80,_0x2e9247[_0x7890('0x80')][_0x463ecd][_0x7890('0x3f')])&&_0x2e9247[_0x7890('0x80')][_0x463ecd][_0x7890('0x81')]&&_0x2e9247[_0x7890('0x80')][_0x463ecd][_0x7890('0x82')]&&_0x2e9247[_0x7890('0x80')][_0x463ecd][_0x7890('0x83')]){_0x3fb2bd[_0x2e9247[_0x7890('0x80')][_0x463ecd]['type']](_0x2e9247[_0x7890('0x80')][_0x463ecd][_0x7890('0x82')],null,util['format'](_0x7890('0x91'),_0x2e9247[_0x7890('0x75')],_0x2e9247['joins'][_0x463ecd][_0x7890('0x81')],_0x2e9247[_0x7890('0x80')][_0x463ecd][_0x7890('0x82')],_0x2e9247[_0x7890('0x80')][_0x463ecd][_0x7890('0x83')]));}}}if(_0x2e9247['conditions']){_0x2e9247[_0x7890('0x84')]=JSON[_0x7890('0x7f')](_0x2e9247['conditions']);_0x3fb2bd[_0x7890('0x3d')](_0x3fab8b(_0x2e9247[_0x7890('0x84')][_0x7890('0x69')]));}_0x496273=_0x3fb2bd[_0x7890('0x85')]();_0x3fb2bd[_0x7890('0x1e')](_0x39e56b);_0x3fb2bd[_0x7890('0x1b')](0x0);logger[_0x7890('0x86')](_0x7890('0x87'),_0x3fb2bd['toString']());return dbH['sequelize'][_0x7890('0x30')](_0x3fb2bd['toString'](),{'type':dbH['sequelize'][_0x7890('0x8a')][_0x7890('0x8b')]});}})['then'](function(){return{'sql':_0x496273['toString']()};})['then'](respondWithResult(_0x32a1f5,null))[_0x7890('0x46')](handleError(_0x32a1f5,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 04ec93f..2968e5d 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 _0x2d72=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','AnalyticCustomReport','analytics_custom_reports'];(function(_0xbdc2be,_0x1b9b1e){var _0x3702cc=function(_0x2fde47){while(--_0x2fde47){_0xbdc2be['push'](_0xbdc2be['shift']());}};_0x3702cc(++_0x1b9b1e);}(_0x2d72,0xa8));var _0x22d7=function(_0x391cdd,_0x3c4065){_0x391cdd=_0x391cdd-0x0;var _0x111c4c=_0x2d72[_0x391cdd];return _0x111c4c;};'use strict';var _=require(_0x22d7('0x0'));var util=require(_0x22d7('0x1'));var logger=require(_0x22d7('0x2'))(_0x22d7('0x3'));var moment=require(_0x22d7('0x4'));var BPromise=require(_0x22d7('0x5'));var rp=require(_0x22d7('0x6'));var fs=require('fs');var path=require(_0x22d7('0x7'));var rimraf=require(_0x22d7('0x8'));var config=require(_0x22d7('0x9'));var attributes=require(_0x22d7('0xa'));module[_0x22d7('0xb')]=function(_0x208b5b,_0x100426){return _0x208b5b['define'](_0x22d7('0xc'),attributes,{'tableName':_0x22d7('0xd'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa117=['request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','analytics_custom_reports','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x437aed,_0x2faa84){var _0x26575b=function(_0x1af1a1){while(--_0x1af1a1){_0x437aed['push'](_0x437aed['shift']());}};_0x26575b(++_0x2faa84);}(_0xa117,0x104));var _0x7a11=function(_0x35f69e,_0x57d7e2){_0x35f69e=_0x35f69e-0x0;var _0x25c8ac=_0xa117[_0x35f69e];return _0x25c8ac;};'use strict';var _=require(_0x7a11('0x0'));var util=require(_0x7a11('0x1'));var logger=require(_0x7a11('0x2'))(_0x7a11('0x3'));var moment=require(_0x7a11('0x4'));var BPromise=require(_0x7a11('0x5'));var rp=require(_0x7a11('0x6'));var fs=require('fs');var path=require(_0x7a11('0x7'));var rimraf=require(_0x7a11('0x8'));var config=require(_0x7a11('0x9'));var attributes=require(_0x7a11('0xa'));module[_0x7a11('0xb')]=function(_0x27738a,_0x26ab39){return _0x27738a[_0x7a11('0xc')]('AnalyticCustomReport',attributes,{'tableName':_0x7a11('0xd'),'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 a261e49..2f5fdce 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 _0xc090=['request\x20sent','debug','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','request','then','info','AnalyticCustomReport,\x20%s,\x20%s'];(function(_0xb6b229,_0x3637b6){var _0x4aa2cf=function(_0x1a7d7f){while(--_0x1a7d7f){_0xb6b229['push'](_0xb6b229['shift']());}};_0x4aa2cf(++_0x3637b6);}(_0xc090,0x10c));var _0x0c09=function(_0x435470,_0x519a29){_0x435470=_0x435470-0x0;var _0x35ac9a=_0xc090[_0x435470];return _0x35ac9a;};'use strict';var _=require(_0x0c09('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0c09('0x1'));var rs=require(_0x0c09('0x2'));var fs=require('fs');var Redis=require(_0x0c09('0x3'));var db=require(_0x0c09('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0c09('0x5'))('rpc');var config=require(_0x0c09('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x0c09('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4bb58d,_0x12a03d,_0x746b9d){return new BPromise(function(_0xb3636f,_0x59eff2){return client[_0x0c09('0x8')](_0x4bb58d,_0x746b9d)[_0x0c09('0x9')](function(_0x2da373){logger[_0x0c09('0xa')](_0x0c09('0xb'),_0x12a03d,_0x0c09('0xc'));logger[_0x0c09('0xd')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x12a03d,_0x0c09('0xc'),JSON[_0x0c09('0xe')](_0x2da373));if(_0x2da373[_0x0c09('0xf')]){if(_0x2da373[_0x0c09('0xf')][_0x0c09('0x10')]===0x1f4){logger[_0x0c09('0xf')](_0x0c09('0xb'),_0x12a03d,_0x2da373['error'][_0x0c09('0x11')]);return _0x59eff2(_0x2da373[_0x0c09('0xf')][_0x0c09('0x11')]);}logger[_0x0c09('0xf')](_0x0c09('0xb'),_0x12a03d,_0x2da373['error']['message']);return _0xb3636f(_0x2da373[_0x0c09('0xf')][_0x0c09('0x11')]);}else{logger[_0x0c09('0xa')](_0x0c09('0xb'),_0x12a03d,_0x0c09('0xc'));_0xb3636f(_0x2da373[_0x0c09('0x12')][_0x0c09('0x11')]);}})[_0x0c09('0x13')](function(_0x28ce2c){logger['error'](_0x0c09('0xb'),_0x12a03d,_0x28ce2c);_0x59eff2(_0x28ce2c);});});} \ No newline at end of file +var _0x7035=['AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','lodash','util','moment','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x7035,0x1c1));var _0x5703=function(_0x2b9919,_0x3270a8){_0x2b9919=_0x2b9919-0x0;var _0x278951=_0x7035[_0x2b9919];return _0x278951;};'use strict';var _=require(_0x5703('0x0'));var util=require(_0x5703('0x1'));var moment=require(_0x5703('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5703('0x3'));var logger=require(_0x5703('0x4'))(_0x5703('0x5'));var config=require(_0x5703('0x6'));var jayson=require(_0x5703('0x7'));var client=jayson['client'][_0x5703('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x258ece,_0x1b6986,_0xdb7f8d){return new BPromise(function(_0x46fc13,_0x48d2e2){return client[_0x5703('0x9')](_0x258ece,_0xdb7f8d)[_0x5703('0xa')](function(_0x5745f1){logger['info'](_0x5703('0xb'),_0x1b6986,_0x5703('0xc'));logger[_0x5703('0xd')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x1b6986,_0x5703('0xc'),JSON[_0x5703('0xe')](_0x5745f1));if(_0x5745f1['error']){if(_0x5745f1['error']['code']===0x1f4){logger[_0x5703('0xf')](_0x5703('0xb'),_0x1b6986,_0x5745f1['error'][_0x5703('0x10')]);return _0x48d2e2(_0x5745f1[_0x5703('0xf')][_0x5703('0x10')]);}logger[_0x5703('0xf')]('AnalyticCustomReport,\x20%s,\x20%s',_0x1b6986,_0x5745f1[_0x5703('0xf')][_0x5703('0x10')]);return _0x46fc13(_0x5745f1['error']['message']);}else{logger[_0x5703('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x1b6986,_0x5703('0xc'));_0x46fc13(_0x5745f1[_0x5703('0x12')]['message']);}})[_0x5703('0x13')](function(_0x155c0b){logger[_0x5703('0xf')](_0x5703('0xb'),_0x1b6986,_0x155c0b);_0x48d2e2(_0x155c0b);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index a205dd7..1e87fce 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 _0x83a6=['/:id/query','query','post','create','put','/:id','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/preview','preview','/:id/run','run'];(function(_0x173060,_0xf5ad1){var _0x122cad=function(_0x10a570){while(--_0x10a570){_0x173060['push'](_0x173060['shift']());}};_0x122cad(++_0xf5ad1);}(_0x83a6,0x190));var _0x683a=function(_0x5703f6,_0x4910f9){_0x5703f6=_0x5703f6-0x0;var _0x5cf623=_0x83a6[_0x5703f6];return _0x5cf623;};'use strict';var multer=require(_0x683a('0x0'));var util=require('util');var path=require(_0x683a('0x1'));var timeout=require('connect-timeout');var express=require(_0x683a('0x2'));var router=express[_0x683a('0x3')]();var fs_extra=require(_0x683a('0x4'));var auth=require(_0x683a('0x5'));var interaction=require(_0x683a('0x6'));var config=require(_0x683a('0x7'));var controller=require('./analyticCustomReport.controller');router[_0x683a('0x8')]('/',auth[_0x683a('0x9')](),controller[_0x683a('0xa')]);router['get']('/:id',auth[_0x683a('0x9')](),controller[_0x683a('0xb')]);router['get'](_0x683a('0xc'),auth[_0x683a('0x9')](),controller[_0x683a('0xd')]);router[_0x683a('0x8')](_0x683a('0xe'),auth[_0x683a('0x9')](),controller[_0x683a('0xf')]);router[_0x683a('0x8')](_0x683a('0x10'),auth[_0x683a('0x9')](),controller[_0x683a('0x11')]);router[_0x683a('0x12')]('/',auth[_0x683a('0x9')](),controller[_0x683a('0x13')]);router[_0x683a('0x14')](_0x683a('0x15'),auth['isAuthenticated'](),controller[_0x683a('0x16')]);router[_0x683a('0x17')]('/:id',auth[_0x683a('0x9')](),controller[_0x683a('0x18')]);module[_0x683a('0x19')]=router; \ No newline at end of file +var _0x03e7=['/:id/run','run','/:id/query','query','post','create','put','update','delete','destroy','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview'];(function(_0x38f1d3,_0x21c5b1){var _0x16b463=function(_0x27cee5){while(--_0x27cee5){_0x38f1d3['push'](_0x38f1d3['shift']());}};_0x16b463(++_0x21c5b1);}(_0x03e7,0x1d3));var _0x703e=function(_0x3037f7,_0x478d56){_0x3037f7=_0x3037f7-0x0;var _0x1a2765=_0x03e7[_0x3037f7];return _0x1a2765;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x703e('0x0'));var timeout=require(_0x703e('0x1'));var express=require(_0x703e('0x2'));var router=express['Router']();var fs_extra=require(_0x703e('0x3'));var auth=require(_0x703e('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x703e('0x5'));router[_0x703e('0x6')]('/',auth[_0x703e('0x7')](),controller[_0x703e('0x8')]);router[_0x703e('0x6')](_0x703e('0x9'),auth[_0x703e('0x7')](),controller[_0x703e('0xa')]);router[_0x703e('0x6')](_0x703e('0xb'),auth['isAuthenticated'](),controller[_0x703e('0xc')]);router[_0x703e('0x6')](_0x703e('0xd'),auth[_0x703e('0x7')](),controller[_0x703e('0xe')]);router[_0x703e('0x6')](_0x703e('0xf'),auth[_0x703e('0x7')](),controller[_0x703e('0x10')]);router[_0x703e('0x11')]('/',auth['isAuthenticated'](),controller[_0x703e('0x12')]);router[_0x703e('0x13')](_0x703e('0x9'),auth[_0x703e('0x7')](),controller[_0x703e('0x14')]);router[_0x703e('0x15')](_0x703e('0x9'),auth[_0x703e('0x7')](),controller[_0x703e('0x16')]);module[_0x703e('0x17')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 1f7c0b2..ef34fd5 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 _0xe14b=['exports','STRING','TEXT','sequelize'];(function(_0x53f6fb,_0x289c49){var _0x74a568=function(_0x197cba){while(--_0x197cba){_0x53f6fb['push'](_0x53f6fb['shift']());}};_0x74a568(++_0x289c49);}(_0xe14b,0x93));var _0xbe14=function(_0x5b16fa,_0x157f60){_0x5b16fa=_0x5b16fa-0x0;var _0x35dd49=_0xe14b[_0x5b16fa];return _0x35dd49;};'use strict';var Sequelize=require(_0xbe14('0x0'));module[_0xbe14('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0xbe14('0x2')]},'table':{'type':Sequelize[_0xbe14('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xbe14('0x3')]}}; \ No newline at end of file +var _0x2bd8=['TEXT','sequelize','STRING'];(function(_0x1ca741,_0x5c758c){var _0x54a577=function(_0x574b9f){while(--_0x574b9f){_0x1ca741['push'](_0x1ca741['shift']());}};_0x54a577(++_0x5c758c);}(_0x2bd8,0x130));var _0x82bd=function(_0xe38fcb,_0x41a08c){_0xe38fcb=_0xe38fcb-0x0;var _0x515d67=_0x2bd8[_0xe38fcb];return _0x515d67;};'use strict';var Sequelize=require(_0x82bd('0x0'));module['exports']={'name':{'type':Sequelize[_0x82bd('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x82bd('0x1')]},'parent':{'type':Sequelize[_0x82bd('0x1')]},'table':{'type':Sequelize[_0x82bd('0x1')]},'conditions':{'type':Sequelize[_0x82bd('0x2')]},'joins':{'type':Sequelize[_0x82bd('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 0eb4a72..afa0073 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 _0xc4aa=['Content-Range','apply','reject','save','update','then','destroy','get','DefaultReports','UserProfileResource','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','AnalyticDefaultReport','findAll','rows','catch','show','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','MAX(%s)','AVG(%s)','SEC_TO_TIME(%s)','IS\x20NOT\x20EMPTY','value','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','groupBy','alias','includes','foreignKey','output','web','fullPath','%s-%s.%s','randomstring','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','child_process','fork','countTable','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x1a73f7,_0x274c12){var _0x3570fa=function(_0xdb9fc0){while(--_0xdb9fc0){_0x1a73f7['push'](_0x1a73f7['shift']());}};_0x3570fa(++_0x274c12);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xc4aa[_0x5c2e3e];return _0x53f64a;};'use strict';var emlformat=require(_0xac4a('0x0'));var rimraf=require(_0xac4a('0x1'));var zipdir=require(_0xac4a('0x2'));var jsonpatch=require(_0xac4a('0x3'));var rp=require(_0xac4a('0x4'));var moment=require(_0xac4a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xac4a('0x6'));var sox=require(_0xac4a('0x7'));var csv=require(_0xac4a('0x8'));var ejs=require(_0xac4a('0x9'));var fs=require('fs');var fs_extra=require(_0xac4a('0xa'));var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x8'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xac4a('0x15'));var db=require(_0xac4a('0x16'))['db'];var dbH=require(_0xac4a('0x16'))['dbH'];function respondWithStatusCode(_0x21a79,_0x68424a){_0x68424a=_0x68424a||0xcc;return function(_0x247b78){if(_0x247b78){return _0x21a79[_0xac4a('0x17')](_0x68424a);}return _0x21a79[_0xac4a('0x18')](_0x68424a)[_0xac4a('0x19')]();};}function respondWithResult(_0x34bc01,_0x33c287){_0x33c287=_0x33c287||0xc8;return function(_0x190418){if(_0x190418){return _0x34bc01[_0xac4a('0x18')](_0x33c287)[_0xac4a('0x1a')](_0x190418);}};}function respondWithFilteredResult(_0x26dbb8,_0x4a2119){return function(_0x402fff){if(_0x402fff){var _0x34d797=typeof _0x4a2119[_0xac4a('0x1b')]===_0xac4a('0x1c')&&typeof _0x4a2119[_0xac4a('0x1d')]===_0xac4a('0x1c');var _0x28e304=_0x402fff[_0xac4a('0x1e')];var _0x546c5d=_0x34d797?0x0:_0x4a2119['offset'];var _0x21a729=_0x34d797?_0x402fff[_0xac4a('0x1e')]:_0x4a2119[_0xac4a('0x1b')]+_0x4a2119['limit'];var _0x39e83e;if(_0x21a729>=_0x28e304){_0x21a729=_0x28e304;_0x39e83e=0xc8;}else{_0x39e83e=0xce;}_0x26dbb8[_0xac4a('0x18')](_0x39e83e);return _0x26dbb8[_0xac4a('0x1f')](_0xac4a('0x20'),_0x546c5d+'-'+_0x21a729+'/'+_0x28e304)[_0xac4a('0x1a')](_0x402fff);}return null;};}function patchUpdates(_0x3e829c){return function(_0xe38996){try{jsonpatch[_0xac4a('0x21')](_0xe38996,_0x3e829c,!![]);}catch(_0x534092){return BPromise[_0xac4a('0x22')](_0x534092);}return _0xe38996[_0xac4a('0x23')]();};}function saveUpdates(_0x599787,_0x3d7ce0){return function(_0x4169c0){if(_0x4169c0){return _0x4169c0[_0xac4a('0x24')](_0x599787)[_0xac4a('0x25')](function(_0x4d2d6c){return _0x4d2d6c;});}return null;};}function removeEntity(_0x1b7998,_0x2503d8){return function(_0x15435c){if(_0x15435c){return _0x15435c[_0xac4a('0x26')]()[_0xac4a('0x25')](function(){var _0x2b0dc2=_0x15435c[_0xac4a('0x27')]({'plain':!![]});var _0x36054a=_0xac4a('0x28');return db[_0xac4a('0x29')][_0xac4a('0x26')]({'where':{'type':_0x36054a,'resourceId':_0x2b0dc2['id']}})[_0xac4a('0x25')](function(){return _0x15435c;});})[_0xac4a('0x25')](function(){_0x1b7998[_0xac4a('0x18')](0xcc)[_0xac4a('0x19')]();});}};}function handleEntityNotFound(_0x20202c,_0x4e17ce){return function(_0x23b061){if(!_0x23b061){_0x20202c[_0xac4a('0x17')](0x194);}return _0x23b061;};}function handleError(_0x42a33c,_0x2772fe){_0x2772fe=_0x2772fe||0x1f4;return function(_0x116700){logger['error'](_0x116700['stack']);if(_0x116700[_0xac4a('0x2a')]){delete _0x116700[_0xac4a('0x2a')];}_0x42a33c[_0xac4a('0x18')](_0x2772fe)['send'](_0x116700);};}exports['index']=function(_0x355755,_0x2896bc){var _0x228629={},_0x432066={},_0x17118e={'count':0x0,'rows':[]};var _0x53d3a5=_[_0xac4a('0x2b')](db['AnalyticDefaultReport'][_0xac4a('0x2c')],function(_0x57adcf){return{'name':_0x57adcf[_0xac4a('0x2d')],'type':_0x57adcf[_0xac4a('0x2e')][_0xac4a('0x2f')]};});_0x432066[_0xac4a('0x30')]=_[_0xac4a('0x2b')](_0x53d3a5,_0xac4a('0x2a'));_0x432066[_0xac4a('0x31')]=_[_0xac4a('0x32')](_0x355755[_0xac4a('0x31')]);_0x432066[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x432066[_0xac4a('0x30')],_0x432066[_0xac4a('0x31')]);_0x228629[_0xac4a('0x35')]=_['intersection'](_0x432066[_0xac4a('0x30')],qs[_0xac4a('0x36')](_0x355755['query'][_0xac4a('0x36')]));_0x228629[_0xac4a('0x35')]=_0x228629['attributes']['length']?_0x228629[_0xac4a('0x35')]:_0x432066[_0xac4a('0x30')];if(!_0x355755[_0xac4a('0x31')][_0xac4a('0x37')]('nolimit')){_0x228629[_0xac4a('0x1d')]=qs[_0xac4a('0x1d')](_0x355755['query'][_0xac4a('0x1d')]);_0x228629[_0xac4a('0x1b')]=qs[_0xac4a('0x1b')](_0x355755['query'][_0xac4a('0x1b')]);}_0x228629[_0xac4a('0x38')]=qs[_0xac4a('0x39')](_0x355755['query'][_0xac4a('0x39')]);_0x228629[_0xac4a('0x3a')]=qs['filters'](_['pick'](_0x355755[_0xac4a('0x31')],_0x432066['filters']),_0x53d3a5);if(_0x355755['query']['filter']){_0x228629['where']=_[_0xac4a('0x3b')](_0x228629[_0xac4a('0x3a')],{'$or':_[_0xac4a('0x2b')](_0x53d3a5,function(_0x472484){if(_0x472484[_0xac4a('0x2e')]!==_0xac4a('0x3c')){var _0x4220e2={};_0x4220e2[_0x472484[_0xac4a('0x2a')]]={'$like':'%'+_0x355755[_0xac4a('0x31')][_0xac4a('0x3d')]+'%'};return _0x4220e2;}})});}_0x228629=_[_0xac4a('0x3b')]({},_0x228629,_0x355755[_0xac4a('0x3e')]);var _0x4e4994={'where':_0x228629['where']};return db['AnalyticDefaultReport'][_0xac4a('0x1e')](_0x4e4994)[_0xac4a('0x25')](function(_0x14e80b){_0x17118e[_0xac4a('0x1e')]=_0x14e80b;if(_0x355755[_0xac4a('0x31')][_0xac4a('0x3f')]){_0x228629[_0xac4a('0x40')]=[{'all':!![]}];}return db[_0xac4a('0x41')][_0xac4a('0x42')](_0x228629);})[_0xac4a('0x25')](function(_0x561cb7){_0x17118e[_0xac4a('0x43')]=_0x561cb7;return _0x17118e;})[_0xac4a('0x25')](respondWithFilteredResult(_0x2896bc,_0x228629))[_0xac4a('0x44')](handleError(_0x2896bc,null));};exports[_0xac4a('0x45')]=function(_0x1a96cf,_0x57b879){var _0x8700b4={'raw':!![],'where':{'id':_0x1a96cf['params']['id']}},_0x1b77bb={};_0x1b77bb[_0xac4a('0x30')]=_['keys'](db[_0xac4a('0x41')][_0xac4a('0x2c')]);_0x1b77bb[_0xac4a('0x31')]=_[_0xac4a('0x32')](_0x1a96cf[_0xac4a('0x31')]);_0x1b77bb[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x1b77bb[_0xac4a('0x30')],_0x1b77bb[_0xac4a('0x31')]);_0x8700b4[_0xac4a('0x35')]=_[_0xac4a('0x34')](_0x1b77bb[_0xac4a('0x30')],qs['fields'](_0x1a96cf[_0xac4a('0x31')][_0xac4a('0x36')]));_0x8700b4[_0xac4a('0x35')]=_0x8700b4['attributes'][_0xac4a('0x46')]?_0x8700b4[_0xac4a('0x35')]:_0x1b77bb['model'];if(_0x1a96cf[_0xac4a('0x31')]['includeAll']){_0x8700b4[_0xac4a('0x40')]=[{'all':!![]}];}_0x8700b4=_[_0xac4a('0x3b')]({},_0x8700b4,_0x1a96cf[_0xac4a('0x3e')]);return db['AnalyticDefaultReport']['find'](_0x8700b4)[_0xac4a('0x25')](handleEntityNotFound(_0x57b879,null))['then'](respondWithResult(_0x57b879,null))[_0xac4a('0x44')](handleError(_0x57b879,null));};exports['create']=function(_0x3d2aaf,_0x530bbb){return db[_0xac4a('0x41')][_0xac4a('0x47')](_0x3d2aaf[_0xac4a('0x48')],{})[_0xac4a('0x25')](function(_0x54782f){var _0x31c794=_0x3d2aaf[_0xac4a('0x49')][_0xac4a('0x27')]({'plain':!![]});if(!_0x31c794)throw new Error(_0xac4a('0x4a'));if(_0x31c794[_0xac4a('0x4b')]===_0xac4a('0x49')){var _0x187306=_0x54782f['get']({'plain':!![]});var _0x35dee5=_0xac4a('0x4c');return db['UserProfileSection'][_0xac4a('0x4d')]({'where':{'name':_0x35dee5,'userProfileId':_0x31c794[_0xac4a('0x4e')]},'raw':!![]})[_0xac4a('0x25')](function(_0x3ac36e){if(_0x3ac36e&&_0x3ac36e['autoAssociation']===0x0){return db[_0xac4a('0x29')][_0xac4a('0x47')]({'name':_0x187306[_0xac4a('0x2a')],'resourceId':_0x187306['id'],'type':_0xac4a('0x28'),'sectionId':_0x3ac36e['id']},{})[_0xac4a('0x25')](function(){return _0x54782f;});}else{return _0x54782f;}})['catch'](function(_0x179373){logger['error'](_0xac4a('0x4f'),_0x179373);throw _0x179373;});}return _0x54782f;})[_0xac4a('0x25')](respondWithResult(_0x530bbb,0xc9))['catch'](handleError(_0x530bbb,null));};exports['update']=function(_0x437466,_0x70fdc3){if(_0x437466['body']['id']){delete _0x437466[_0xac4a('0x48')]['id'];}return db[_0xac4a('0x41')][_0xac4a('0x4d')]({'where':{'id':_0x437466[_0xac4a('0x50')]['id']}})['then'](handleEntityNotFound(_0x70fdc3,null))[_0xac4a('0x25')](saveUpdates(_0x437466[_0xac4a('0x48')],null))[_0xac4a('0x25')](respondWithResult(_0x70fdc3,null))[_0xac4a('0x44')](handleError(_0x70fdc3,null));};exports[_0xac4a('0x26')]=function(_0x411547,_0x36179a){return db['AnalyticDefaultReport'][_0xac4a('0x4d')]({'where':{'id':_0x411547[_0xac4a('0x50')]['id']}})[_0xac4a('0x25')](handleEntityNotFound(_0x36179a,null))[_0xac4a('0x25')](removeEntity(_0x36179a,null))[_0xac4a('0x44')](handleError(_0x36179a,null));};exports[_0xac4a('0x51')]=function(_0x213df2,_0x236f57){var _0x159e43=0xa;var _0x786d9=[_0xac4a('0x52'),_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0x5222f3={'SUM':_0xac4a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xac4a('0x57'),'MAX':'MAX(%s)','MIN':_0xac4a('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0x5cac9b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xac4a('0x5b'),'HOUR':_0xac4a('0x5c'),'ROUND':_0xac4a('0x5d'),'UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x2f9940=function(_0xb7b884){return!_['includes']([_0xac4a('0x5f'),'IS\x20NOT\x20NULL',_0xac4a('0x60'),'IS\x20NOT\x20EMPTY'],_0xb7b884);};var _0x347880=function(_0x19ce2c){if(!_0x19ce2c||!_0x19ce2c[_0xac4a('0x61')][_0xac4a('0x46')]){return'';}for(var _0x429273='(',_0x2bc39a=0x0;_0x2bc39a<_0x19ce2c[_0xac4a('0x61')][_0xac4a('0x46')];_0x2bc39a+=0x1){_0x2bc39a>0x0&&(_0x429273+='\x20'+_0x19ce2c[_0xac4a('0x62')]+'\x20');_0x429273+=_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x63')]?_0x347880(_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x63')]):_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x64')]+'\x20'+_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x65')]+(_0x2f9940(_0x19ce2c['rules'][_0x2bc39a][_0xac4a('0x65')])?'\x20'+_0x19ce2c[_0xac4a('0x61')][_0x2bc39a]['value']:'');}return _0x429273+')';};var _0x3c3576={'where':{'id':_0x213df2['params']['id']}},_0x34bd1c,_0x2d24c7,_0x2b8562,_0x357cac,_0x4d1440;_0x3c3576=_[_0xac4a('0x3b')]({},_0x3c3576,_0x213df2[_0xac4a('0x3e')]);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0x3c3576)[_0xac4a('0x25')](function(_0x21ef8b){if(_0x21ef8b){_0x34bd1c=_0x21ef8b;return _0x21ef8b[_0xac4a('0x66')]();}return null;})[_0xac4a('0x25')](function(_0x44c60b){if(_0x44c60b){if(!_0x44c60b[_0xac4a('0x46')]){throw new db[(_0xac4a('0x67'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2d24c7=_0x44c60b;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x423f70){if(_0x423f70){_0x2b8562=_[_0xac4a('0x69')](_0x423f70,'id');var _0x283107;var _0x1d24bb=squel[_0xac4a('0x6a')]();_0x1d24bb[_0xac4a('0x6b')](_0x34bd1c[_0xac4a('0x6c')]);for(var _0xb09b89=0x0;_0xb09b89<_0x2d24c7[_0xac4a('0x46')];_0xb09b89+=0x1){_0x283107=_0x2d24c7[_0xb09b89]['MetricId']?_0x2b8562[_0x2d24c7[_0xb09b89][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x2d24c7[_0xb09b89][_0xac4a('0x64')];_0x283107=_0x2d24c7[_0xb09b89][_0xac4a('0x6f')]?_['replace'](_0x5222f3[_0x2d24c7[_0xb09b89][_0xac4a('0x6f')]],'%s',_0x283107):_0x283107;_0x283107=_0x2d24c7[_0xb09b89]['format']?_[_0xac4a('0x70')](_0x5cac9b[_0x2d24c7[_0xb09b89][_0xac4a('0x71')]],'%s',_0x283107):_0x283107;if(_0x2d24c7[_0xb09b89]['groupBy']){_0x1d24bb['group'](_0x283107);}_0x2d24c7[_0xb09b89][_0xac4a('0x72')]&&_0x1d24bb[_0xac4a('0x38')](_0x283107,_0x2d24c7[_0xb09b89][_0xac4a('0x72')]==='DESC'?![]:!![]);_0x1d24bb[_0xac4a('0x64')](_0x283107,_0x2d24c7[_0xb09b89]['alias']||_0x283107);}if(_0x34bd1c[_0xac4a('0x73')]){_0x34bd1c['joins']=JSON['parse'](_0x34bd1c[_0xac4a('0x73')]);for(var _0x56ef2a=0x0;_0x56ef2a<_0x34bd1c[_0xac4a('0x73')]['length'];_0x56ef2a+=0x1){if(_0x34bd1c[_0xac4a('0x73')][_0x56ef2a][_0xac4a('0x2e')]&&_['includes'](_0x786d9,_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['type'])&&_0x34bd1c[_0xac4a('0x73')][_0x56ef2a][_0xac4a('0x74')]&&_0x34bd1c['joins'][_0x56ef2a][_0xac4a('0x75')]&&_0x34bd1c['joins'][_0x56ef2a]['foreignKey']){_0x1d24bb[_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['type']](_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['foreignTable'],null,util['format'](_0xac4a('0x76'),_0x34bd1c[_0xac4a('0x6c')],_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['parentKey'],_0x34bd1c['joins'][_0x56ef2a][_0xac4a('0x75')],_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['foreignKey']));}}}if(_0x34bd1c['conditions']){_0x34bd1c[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x34bd1c[_0xac4a('0x77')]);_0x1d24bb[_0xac4a('0x3a')](_0x347880(_0x34bd1c[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x4d1440=_0x1d24bb[_0xac4a('0x79')]();_0x1d24bb[_0xac4a('0x1d')](_0x159e43);_0x1d24bb[_0xac4a('0x1b')](0x0);logger['debug'](_0xac4a('0x7a'),_0x1d24bb[_0xac4a('0x7b')]());return dbH[_0xac4a('0x7c')]['query'](_0x1d24bb[_0xac4a('0x7b')](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')][_0xac4a('0x7e')]});}})[_0xac4a('0x25')](respondWithResult(_0x236f57,null))['catch'](handleError(_0x236f57,null));};function runReport(_0x290a73,_0x19ce24,_0xc9d040){var _0x37e519=_0x19ce24[_0xac4a('0x2a')];var _0x451248=0xa;var _0xd7bdd6=['join',_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0x35a97c={'SUM':_0xac4a('0x56'),'COUNT':_0xac4a('0x7f'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xac4a('0x80'),'MIN':_0xac4a('0x58'),'AVG':_0xac4a('0x81'),'GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0x56a934={'SEC_TO_TIME':_0xac4a('0x82'),'DATE':_0xac4a('0x5b'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x212a22=function(_0x1fe86a){return!_['includes']([_0xac4a('0x5f'),'IS\x20NOT\x20NULL',_0xac4a('0x60'),_0xac4a('0x83')],_0x1fe86a);};var _0x406b64=function(_0x35328e){if(!_0x35328e||!_0x35328e[_0xac4a('0x61')]['length']){return'';}for(var _0x50f471='(',_0x31cda0=0x0;_0x31cda0<_0x35328e[_0xac4a('0x61')][_0xac4a('0x46')];_0x31cda0+=0x1){_0x31cda0>0x0&&(_0x50f471+='\x20'+_0x35328e[_0xac4a('0x62')]+'\x20');_0x50f471+=_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x63')]?_0x406b64(_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x63')]):_0x35328e['rules'][_0x31cda0]['field']+'\x20'+_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x65')]+(_0x212a22(_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x65')])?'\x20'+_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x84')]:'');}return _0x50f471+')';};var _0xdaa2ef={'where':{'id':_0x290a73['id']}},_0x2e704b,_0x540d8e,_0x5e0be4,_0x32fd0c,_0x168f30;_0xdaa2ef=_[_0xac4a('0x3b')]({},_0xdaa2ef,_0xc9d040);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0xdaa2ef)[_0xac4a('0x25')](function(_0x338af3){if(_0x338af3){_0x2e704b=_0x338af3;return _0x338af3['getFields']();}return null;})[_0xac4a('0x25')](function(_0x1bacf2){if(_0x1bacf2){if(!_0x1bacf2[_0xac4a('0x46')]){throw new db['Sequelize'][(_0xac4a('0x85'))](_0xac4a('0x86'),0x193);}_0x540d8e=_0x1bacf2;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x27d023){if(_0x27d023){_0x5e0be4=_[_0xac4a('0x69')](_0x27d023,'id');var _0x2ef42a;var _0x322465=squel['select']();_0x322465[_0xac4a('0x6b')](_0x2e704b['table']);for(var _0x203321=0x0;_0x203321<_0x540d8e[_0xac4a('0x46')];_0x203321+=0x1){_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x6d')]?_0x5e0be4[_0x540d8e[_0x203321][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x540d8e[_0x203321][_0xac4a('0x64')];_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x6f')]?_['replace'](_0x35a97c[_0x540d8e[_0x203321][_0xac4a('0x6f')]],'%s',_0x2ef42a):_0x2ef42a;_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x71')]?_[_0xac4a('0x70')](_0x56a934[_0x540d8e[_0x203321][_0xac4a('0x71')]],'%s',_0x2ef42a):_0x2ef42a;if(_0x540d8e[_0x203321][_0xac4a('0x87')]){_0x322465['group'](_0x2ef42a);}_0x540d8e[_0x203321][_0xac4a('0x72')]&&_0x322465[_0xac4a('0x38')](_0x2ef42a,_0x540d8e[_0x203321]['orderBy']==='DESC'?![]:!![]);_0x322465[_0xac4a('0x64')](_0x2ef42a,_0x540d8e[_0x203321][_0xac4a('0x88')]||_0x2ef42a);}if(_0x2e704b['joins']){_0x2e704b[_0xac4a('0x73')]=JSON[_0xac4a('0x78')](_0x2e704b[_0xac4a('0x73')]);for(var _0x37657e=0x0;_0x37657e<_0x2e704b[_0xac4a('0x73')][_0xac4a('0x46')];_0x37657e+=0x1){if(_0x2e704b['joins'][_0x37657e][_0xac4a('0x2e')]&&_[_0xac4a('0x89')](_0xd7bdd6,_0x2e704b[_0xac4a('0x73')][_0x37657e]['type'])&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x74')]&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x75')]&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x8a')]){_0x322465[_0x2e704b['joins'][_0x37657e][_0xac4a('0x2e')]](_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignTable'],null,util[_0xac4a('0x71')]('%s.%s\x20=\x20%s.%s',_0x2e704b[_0xac4a('0x6c')],_0x2e704b[_0xac4a('0x73')][_0x37657e]['parentKey'],_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignTable'],_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignKey']));}}}if(_0x2e704b[_0xac4a('0x77')]){_0x2e704b[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x2e704b[_0xac4a('0x77')]);_0x322465[_0xac4a('0x3a')](_0x406b64(_0x2e704b[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x168f30=_0x322465[_0xac4a('0x79')]();_0x322465[_0xac4a('0x1d')](_0x451248);_0x322465[_0xac4a('0x1b')](0x0);return;}})[_0xac4a('0x25')](function(){if(_0x19ce24[_0xac4a('0x8b')]===_0xac4a('0x8c')){return null;}var _0x4217df=_['merge'](_0x19ce24,{'name':_0x19ce24[_0xac4a('0x8d')]||_0x19ce24[_0xac4a('0x2a')]||_0x2e704b['name'],'basename':_0x37e519,'savename':util[_0xac4a('0x71')](_0xac4a('0x8e'),_0x19ce24[_0xac4a('0x2a')]||_0x2e704b[_0xac4a('0x2a')],require(_0xac4a('0x8f'))['generate'](0x4),_0x19ce24[_0xac4a('0x8b')]||'csv'),'reportId':_0x2e704b['id'],'reportType':_0xac4a('0x90')});return db[_0xac4a('0x91')][_0xac4a('0x47')](_0x4217df,{'raw':!![]});})[_0xac4a('0x25')](function(_0x53f23d){if(_0x2e704b[_0xac4a('0x6c')]==='cdr'){_0x168f30[_0xac4a('0x3a')](_0x2e704b[_0xac4a('0x6c')]+_0xac4a('0x92'),_0x19ce24['startDate'],_0x19ce24[_0xac4a('0x93')]);}else{_0x168f30[_0xac4a('0x3a')](_0x2e704b[_0xac4a('0x6c')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x19ce24[_0xac4a('0x94')],_0x19ce24[_0xac4a('0x93')]);}if(_0x53f23d){logger[_0xac4a('0x95')](_0xac4a('0x96'),_0x168f30[_0xac4a('0x7b')]());require(_0xac4a('0x97'))[_0xac4a('0x98')](path[_0xac4a('0x52')](__dirname,'../../components/export/',_0x53f23d[_0xac4a('0x8b')]),[_0x53f23d['id'],_0x168f30['toString'](),path['join'](__dirname,'../../files/reports',_0x53f23d['savename']),_0x37e519]);return _0x53f23d;}else{var _0x502275=squel[_0xac4a('0x6a')]();_0x502275[_0xac4a('0x6b')]('('+_0x168f30[_0xac4a('0x7b')]()+')',_0xac4a('0x99'));_0x502275[_0xac4a('0x64')]('COUNT(*)',_0xac4a('0x1e'));_0x168f30[_0xac4a('0x1d')](_0x19ce24[_0xac4a('0x1d')]||_0x451248);_0x168f30[_0xac4a('0x1b')](_0x19ce24[_0xac4a('0x1b')]||0x0);return dbH[_0xac4a('0x7c')][_0xac4a('0x31')](_0x502275[_0xac4a('0x7b')](),{'type':dbH['sequelize'][_0xac4a('0x7d')][_0xac4a('0x7e')]})[_0xac4a('0x25')](function(_0x25331f){if(!_0x25331f[_0xac4a('0x46')]){_0x32fd0c=0x0;}else{_0x32fd0c=_0x25331f[0x0][_0xac4a('0x1e')]||0x0;}return dbH[_0xac4a('0x7c')]['query'](_0x168f30['toString'](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')]['SELECT']});})[_0xac4a('0x25')](function(_0x366f5a){return{'rows':_0x366f5a||[],'count':_0x32fd0c};});}});}exports['run']=function(_0x5bd013,_0x2fe103){return runReport(_0x5bd013[_0xac4a('0x50')],_0x5bd013[_0xac4a('0x31')],_0x5bd013[_0xac4a('0x3e')])[_0xac4a('0x25')](respondWithResult(_0x2fe103,null))['catch'](handleError(_0x2fe103,null));};exports[_0xac4a('0x9a')]=runReport;exports['query']=function(_0x4f2d85,_0x538cfd){var _0x63c30=0xa;var _0x4301c3=[_0xac4a('0x52'),_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0xcad25d={'SUM':_0xac4a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xac4a('0x58'),'AVG':_0xac4a('0x81'),'GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':_0xac4a('0x9b'),'GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0xcd140e={'SEC_TO_TIME':_0xac4a('0x82'),'DATE':_0xac4a('0x5b'),'HOUR':_0xac4a('0x5c'),'ROUND':_0xac4a('0x5d'),'UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x37cb49=function(_0xe0fd57){return!_[_0xac4a('0x89')]([_0xac4a('0x5f'),_0xac4a('0x9c'),_0xac4a('0x60'),_0xac4a('0x83')],_0xe0fd57);};var _0x41cdb5=function(_0x172d03){if(!_0x172d03||!_0x172d03[_0xac4a('0x61')][_0xac4a('0x46')]){return'';}for(var _0x3e2575='(',_0x4cc581=0x0;_0x4cc581<_0x172d03[_0xac4a('0x61')][_0xac4a('0x46')];_0x4cc581+=0x1){_0x4cc581>0x0&&(_0x3e2575+='\x20'+_0x172d03[_0xac4a('0x62')]+'\x20');_0x3e2575+=_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x63')]?_0x41cdb5(_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x63')]):_0x172d03[_0xac4a('0x61')][_0x4cc581]['field']+'\x20'+_0x172d03['rules'][_0x4cc581][_0xac4a('0x65')]+(_0x37cb49(_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x65')])?'\x20'+_0x172d03['rules'][_0x4cc581]['value']:'');}return _0x3e2575+')';};var _0x5de198={'where':{'id':_0x4f2d85[_0xac4a('0x50')]['id']}},_0x2b6773,_0x52df82,_0x59e82c,_0x216055,_0x52963c;_0x5de198=_['merge']({},_0x5de198,_0x4f2d85[_0xac4a('0x3e')]);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0x5de198)[_0xac4a('0x25')](function(_0x403a16){if(_0x403a16){_0x2b6773=_0x403a16;return _0x403a16[_0xac4a('0x66')]();}return null;})['then'](function(_0x25bf23){if(_0x25bf23){if(!_0x25bf23[_0xac4a('0x46')]){throw new db[(_0xac4a('0x67'))]['ValidationErrorItem'](_0xac4a('0x86'),0x193);}_0x52df82=_0x25bf23;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x5bb911){if(_0x5bb911){_0x59e82c=_[_0xac4a('0x69')](_0x5bb911,'id');var _0x403f5a;var _0x3eae2f=squel[_0xac4a('0x6a')]();_0x3eae2f[_0xac4a('0x6b')](_0x2b6773[_0xac4a('0x6c')]);for(var _0x4a0cd9=0x0;_0x4a0cd9<_0x52df82['length'];_0x4a0cd9+=0x1){_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x6d')]?_0x59e82c[_0x52df82[_0x4a0cd9][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x52df82[_0x4a0cd9][_0xac4a('0x64')];_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x6f')]?_[_0xac4a('0x70')](_0xcad25d[_0x52df82[_0x4a0cd9]['function']],'%s',_0x403f5a):_0x403f5a;_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x71')]?_['replace'](_0xcd140e[_0x52df82[_0x4a0cd9][_0xac4a('0x71')]],'%s',_0x403f5a):_0x403f5a;if(_0x52df82[_0x4a0cd9]['groupBy']){_0x3eae2f[_0xac4a('0x63')](_0x403f5a);}_0x52df82[_0x4a0cd9][_0xac4a('0x72')]&&_0x3eae2f[_0xac4a('0x38')](_0x403f5a,_0x52df82[_0x4a0cd9][_0xac4a('0x72')]==='DESC'?![]:!![]);_0x3eae2f[_0xac4a('0x64')](_0x403f5a,_0x52df82[_0x4a0cd9][_0xac4a('0x88')]||_0x403f5a);}if(_0x2b6773[_0xac4a('0x73')]){_0x2b6773[_0xac4a('0x73')]=JSON[_0xac4a('0x78')](_0x2b6773['joins']);for(var _0x3dd60a=0x0;_0x3dd60a<_0x2b6773[_0xac4a('0x73')][_0xac4a('0x46')];_0x3dd60a+=0x1){if(_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x2e')]&&_['includes'](_0x4301c3,_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x2e')])&&_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x74')]&&_0x2b6773[_0xac4a('0x73')][_0x3dd60a]['foreignTable']&&_0x2b6773['joins'][_0x3dd60a]['foreignKey']){_0x3eae2f[_0x2b6773['joins'][_0x3dd60a][_0xac4a('0x2e')]](_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x75')],null,util[_0xac4a('0x71')](_0xac4a('0x76'),_0x2b6773['table'],_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x74')],_0x2b6773['joins'][_0x3dd60a][_0xac4a('0x75')],_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x8a')]));}}}if(_0x2b6773['conditions']){_0x2b6773[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x2b6773[_0xac4a('0x77')]);_0x3eae2f[_0xac4a('0x3a')](_0x41cdb5(_0x2b6773[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x52963c=_0x3eae2f[_0xac4a('0x79')]();_0x3eae2f[_0xac4a('0x1d')](_0x63c30);_0x3eae2f[_0xac4a('0x1b')](0x0);logger['debug'](_0xac4a('0x7a'),_0x3eae2f[_0xac4a('0x7b')]());return dbH['sequelize'][_0xac4a('0x31')](_0x3eae2f['toString'](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')]['SELECT']});}})[_0xac4a('0x25')](function(){return{'sql':_0x52963c[_0xac4a('0x7b')]()};})[_0xac4a('0x25')](respondWithResult(_0x538cfd,null))[_0xac4a('0x44')](handleError(_0x538cfd,null));}; \ No newline at end of file +var _0x7a54=['options','AnalyticDefaultReport','includeAll','include','show','keys','attributes','create','body','user','role','get','Reports','UserProfileSection','userProfileId','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','params','right_join','cross_join','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','group','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','MetricId','metric','field','function','replace','format','orderBy','DESC','joins','parse','type','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','debug','toString','sequelize','QueryTypes','SELECT','join','left_join','COUNT(DISTINCT\x20%s)','MAX(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','operator','groupBy','alias','output','web','fullPath','%s-%s.%s','generate','default','AnalyticExtractedReport','cdr','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','getFields','clone','Limited\x20Query:','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','dbH','sendStatus','status','end','json','limit','count','offset','Content-Range','apply','save','then','destroy','DefaultReports','error','stack','name','index','map','fieldName','model','query','filters','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge'];(function(_0x389318,_0x13a53d){var _0x7919e3=function(_0x2985d1){while(--_0x2985d1){_0x389318['push'](_0x389318['shift']());}};_0x7919e3(++_0x13a53d);}(_0x7a54,0x106));var _0x47a5=function(_0x2434a1,_0x15d24c){_0x2434a1=_0x2434a1-0x0;var _0xc29e01=_0x7a54[_0x2434a1];return _0xc29e01;};'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'];var dbH=require(_0x47a5('0x15'))[_0x47a5('0x16')];function respondWithStatusCode(_0x5beb89,_0x44bd3e){_0x44bd3e=_0x44bd3e||0xcc;return function(_0x221b54){if(_0x221b54){return _0x5beb89[_0x47a5('0x17')](_0x44bd3e);}return _0x5beb89[_0x47a5('0x18')](_0x44bd3e)[_0x47a5('0x19')]();};}function respondWithResult(_0x620ee9,_0x3c6c46){_0x3c6c46=_0x3c6c46||0xc8;return function(_0x190faa){if(_0x190faa){return _0x620ee9['status'](_0x3c6c46)[_0x47a5('0x1a')](_0x190faa);}};}function respondWithFilteredResult(_0x11faf5,_0x3b001e){return function(_0x2a2cbb){if(_0x2a2cbb){var _0x1ef44c=typeof _0x3b001e['offset']==='undefined'&&typeof _0x3b001e[_0x47a5('0x1b')]==='undefined';var _0x5247fd=_0x2a2cbb[_0x47a5('0x1c')];var _0xaf70a6=_0x1ef44c?0x0:_0x3b001e[_0x47a5('0x1d')];var _0x1ef371=_0x1ef44c?_0x2a2cbb[_0x47a5('0x1c')]:_0x3b001e[_0x47a5('0x1d')]+_0x3b001e[_0x47a5('0x1b')];var _0xe3c618;if(_0x1ef371>=_0x5247fd){_0x1ef371=_0x5247fd;_0xe3c618=0xc8;}else{_0xe3c618=0xce;}_0x11faf5[_0x47a5('0x18')](_0xe3c618);return _0x11faf5['set'](_0x47a5('0x1e'),_0xaf70a6+'-'+_0x1ef371+'/'+_0x5247fd)[_0x47a5('0x1a')](_0x2a2cbb);}return null;};}function patchUpdates(_0x47cf3c){return function(_0x2b0360){try{jsonpatch[_0x47a5('0x1f')](_0x2b0360,_0x47cf3c,!![]);}catch(_0x36874d){return BPromise['reject'](_0x36874d);}return _0x2b0360[_0x47a5('0x20')]();};}function saveUpdates(_0x2f142b,_0x23db32){return function(_0x7a9f9e){if(_0x7a9f9e){return _0x7a9f9e['update'](_0x2f142b)[_0x47a5('0x21')](function(_0x385687){return _0x385687;});}return null;};}function removeEntity(_0x513981,_0x28747d){return function(_0xc4cd63){if(_0xc4cd63){return _0xc4cd63[_0x47a5('0x22')]()[_0x47a5('0x21')](function(){var _0x3abd6a=_0xc4cd63['get']({'plain':!![]});var _0x53078a=_0x47a5('0x23');return db['UserProfileResource'][_0x47a5('0x22')]({'where':{'type':_0x53078a,'resourceId':_0x3abd6a['id']}})['then'](function(){return _0xc4cd63;});})[_0x47a5('0x21')](function(){_0x513981[_0x47a5('0x18')](0xcc)[_0x47a5('0x19')]();});}};}function handleEntityNotFound(_0x1dac65,_0x21f296){return function(_0x3ba0b7){if(!_0x3ba0b7){_0x1dac65[_0x47a5('0x17')](0x194);}return _0x3ba0b7;};}function handleError(_0x136b14,_0x16631f){_0x16631f=_0x16631f||0x1f4;return function(_0x361bfa){logger[_0x47a5('0x24')](_0x361bfa[_0x47a5('0x25')]);if(_0x361bfa[_0x47a5('0x26')]){delete _0x361bfa['name'];}_0x136b14[_0x47a5('0x18')](_0x16631f)['send'](_0x361bfa);};}exports[_0x47a5('0x27')]=function(_0x9ac908,_0x16901f){var _0x4d6b57={},_0x256650={},_0x625952={'count':0x0,'rows':[]};var _0x39b50b=_[_0x47a5('0x28')](db['AnalyticDefaultReport']['rawAttributes'],function(_0x6f9a12){return{'name':_0x6f9a12[_0x47a5('0x29')],'type':_0x6f9a12['type']['key']};});_0x256650[_0x47a5('0x2a')]=_[_0x47a5('0x28')](_0x39b50b,'name');_0x256650[_0x47a5('0x2b')]=_['keys'](_0x9ac908[_0x47a5('0x2b')]);_0x256650[_0x47a5('0x2c')]=_['intersection'](_0x256650['model'],_0x256650[_0x47a5('0x2b')]);_0x4d6b57['attributes']=_[_0x47a5('0x2d')](_0x256650[_0x47a5('0x2a')],qs[_0x47a5('0x2e')](_0x9ac908['query'][_0x47a5('0x2e')]));_0x4d6b57['attributes']=_0x4d6b57['attributes'][_0x47a5('0x2f')]?_0x4d6b57['attributes']:_0x256650[_0x47a5('0x2a')];if(!_0x9ac908['query'][_0x47a5('0x30')](_0x47a5('0x31'))){_0x4d6b57[_0x47a5('0x1b')]=qs[_0x47a5('0x1b')](_0x9ac908[_0x47a5('0x2b')][_0x47a5('0x1b')]);_0x4d6b57[_0x47a5('0x1d')]=qs[_0x47a5('0x1d')](_0x9ac908[_0x47a5('0x2b')]['offset']);}_0x4d6b57[_0x47a5('0x32')]=qs[_0x47a5('0x33')](_0x9ac908['query'][_0x47a5('0x33')]);_0x4d6b57[_0x47a5('0x34')]=qs[_0x47a5('0x2c')](_['pick'](_0x9ac908[_0x47a5('0x2b')],_0x256650[_0x47a5('0x2c')]),_0x39b50b);if(_0x9ac908['query'][_0x47a5('0x35')]){_0x4d6b57[_0x47a5('0x34')]=_['merge'](_0x4d6b57['where'],{'$or':_['map'](_0x39b50b,function(_0x12d9f2){if(_0x12d9f2['type']!==_0x47a5('0x36')){var _0x1f9631={};_0x1f9631[_0x12d9f2[_0x47a5('0x26')]]={'$like':'%'+_0x9ac908[_0x47a5('0x2b')][_0x47a5('0x35')]+'%'};return _0x1f9631;}})});}_0x4d6b57=_[_0x47a5('0x37')]({},_0x4d6b57,_0x9ac908[_0x47a5('0x38')]);var _0x1f3d01={'where':_0x4d6b57[_0x47a5('0x34')]};return db[_0x47a5('0x39')][_0x47a5('0x1c')](_0x1f3d01)[_0x47a5('0x21')](function(_0x23d6d8){_0x625952['count']=_0x23d6d8;if(_0x9ac908[_0x47a5('0x2b')][_0x47a5('0x3a')]){_0x4d6b57[_0x47a5('0x3b')]=[{'all':!![]}];}return db[_0x47a5('0x39')]['findAll'](_0x4d6b57);})[_0x47a5('0x21')](function(_0x528ef3){_0x625952['rows']=_0x528ef3;return _0x625952;})['then'](respondWithFilteredResult(_0x16901f,_0x4d6b57))['catch'](handleError(_0x16901f,null));};exports[_0x47a5('0x3c')]=function(_0x5ec4e5,_0x2bb502){var _0x3a740b={'raw':!![],'where':{'id':_0x5ec4e5['params']['id']}},_0x448610={};_0x448610[_0x47a5('0x2a')]=_[_0x47a5('0x3d')](db['AnalyticDefaultReport']['rawAttributes']);_0x448610[_0x47a5('0x2b')]=_['keys'](_0x5ec4e5[_0x47a5('0x2b')]);_0x448610[_0x47a5('0x2c')]=_[_0x47a5('0x2d')](_0x448610[_0x47a5('0x2a')],_0x448610[_0x47a5('0x2b')]);_0x3a740b[_0x47a5('0x3e')]=_[_0x47a5('0x2d')](_0x448610[_0x47a5('0x2a')],qs[_0x47a5('0x2e')](_0x5ec4e5[_0x47a5('0x2b')][_0x47a5('0x2e')]));_0x3a740b[_0x47a5('0x3e')]=_0x3a740b[_0x47a5('0x3e')][_0x47a5('0x2f')]?_0x3a740b[_0x47a5('0x3e')]:_0x448610[_0x47a5('0x2a')];if(_0x5ec4e5['query'][_0x47a5('0x3a')]){_0x3a740b[_0x47a5('0x3b')]=[{'all':!![]}];}_0x3a740b=_['merge']({},_0x3a740b,_0x5ec4e5['options']);return db[_0x47a5('0x39')]['find'](_0x3a740b)[_0x47a5('0x21')](handleEntityNotFound(_0x2bb502,null))[_0x47a5('0x21')](respondWithResult(_0x2bb502,null))['catch'](handleError(_0x2bb502,null));};exports['create']=function(_0x3d85cc,_0x52d409){return db[_0x47a5('0x39')][_0x47a5('0x3f')](_0x3d85cc[_0x47a5('0x40')],{})[_0x47a5('0x21')](function(_0x44fe8a){var _0x26acd2=_0x3d85cc[_0x47a5('0x41')]['get']({'plain':!![]});if(!_0x26acd2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x26acd2[_0x47a5('0x42')]===_0x47a5('0x41')){var _0x1163e3=_0x44fe8a[_0x47a5('0x43')]({'plain':!![]});var _0x2c7020=_0x47a5('0x44');return db[_0x47a5('0x45')]['find']({'where':{'name':_0x2c7020,'userProfileId':_0x26acd2[_0x47a5('0x46')]},'raw':!![]})[_0x47a5('0x21')](function(_0x5f6a){if(_0x5f6a&&_0x5f6a['autoAssociation']===0x0){return db[_0x47a5('0x47')]['create']({'name':_0x1163e3[_0x47a5('0x26')],'resourceId':_0x1163e3['id'],'type':_0x47a5('0x23'),'sectionId':_0x5f6a['id']},{})[_0x47a5('0x21')](function(){return _0x44fe8a;});}else{return _0x44fe8a;}})[_0x47a5('0x48')](function(_0x588551){logger[_0x47a5('0x24')](_0x47a5('0x49'),_0x588551);throw _0x588551;});}return _0x44fe8a;})[_0x47a5('0x21')](respondWithResult(_0x52d409,0xc9))[_0x47a5('0x48')](handleError(_0x52d409,null));};exports[_0x47a5('0x4a')]=function(_0x6a53b3,_0x24e9f4){if(_0x6a53b3['body']['id']){delete _0x6a53b3[_0x47a5('0x40')]['id'];}return db[_0x47a5('0x39')][_0x47a5('0x4b')]({'where':{'id':_0x6a53b3[_0x47a5('0x4c')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x24e9f4,null))[_0x47a5('0x21')](saveUpdates(_0x6a53b3['body'],null))[_0x47a5('0x21')](respondWithResult(_0x24e9f4,null))[_0x47a5('0x48')](handleError(_0x24e9f4,null));};exports[_0x47a5('0x22')]=function(_0x53871e,_0x4c5ed){return db[_0x47a5('0x39')][_0x47a5('0x4b')]({'where':{'id':_0x53871e['params']['id']}})['then'](handleEntityNotFound(_0x4c5ed,null))[_0x47a5('0x21')](removeEntity(_0x4c5ed,null))[_0x47a5('0x48')](handleError(_0x4c5ed,null));};exports['preview']=function(_0x4cf792,_0x6d6b2b){var _0x4d6a82=0xa;var _0x16bb8a=['join','left_join',_0x47a5('0x4d'),_0x47a5('0x4e')];var _0x53eedf={'SUM':_0x47a5('0x4f'),'COUNT':_0x47a5('0x50'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x47a5('0x51'),'AVG':_0x47a5('0x52'),'GROUP_CONCAT':_0x47a5('0x53'),'GROUP_CONCAT ASC':_0x47a5('0x54'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x199621={'SEC_TO_TIME':_0x47a5('0x55'),'DATE':_0x47a5('0x56'),'HOUR':'HOUR(%s)','ROUND':_0x47a5('0x57'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x485e3c=function(_0x470da6){return!_[_0x47a5('0x58')]([_0x47a5('0x59'),_0x47a5('0x5a'),'IS\x20EMPTY',_0x47a5('0x5b')],_0x470da6);};var _0x5d1550=function(_0x5cbe97){if(!_0x5cbe97||!_0x5cbe97['rules']['length']){return'';}for(var _0x212d92='(',_0x6cd4ea=0x0;_0x6cd4ea<_0x5cbe97[_0x47a5('0x5c')]['length'];_0x6cd4ea+=0x1){_0x6cd4ea>0x0&&(_0x212d92+='\x20'+_0x5cbe97['operator']+'\x20');_0x212d92+=_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea][_0x47a5('0x5d')]?_0x5d1550(_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea][_0x47a5('0x5d')]):_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea]['field']+'\x20'+_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea]['condition']+(_0x485e3c(_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea][_0x47a5('0x5e')])?'\x20'+_0x5cbe97['rules'][_0x6cd4ea][_0x47a5('0x5f')]:'');}return _0x212d92+')';};var _0x345104={'where':{'id':_0x4cf792[_0x47a5('0x4c')]['id']}},_0x132854,_0x3e8274,_0x2d6494,_0x215634,_0x35cca8;_0x345104=_['merge']({},_0x345104,_0x4cf792[_0x47a5('0x38')]);return db[_0x47a5('0x39')][_0x47a5('0x4b')](_0x345104)[_0x47a5('0x21')](function(_0x396cb0){if(_0x396cb0){_0x132854=_0x396cb0;return _0x396cb0['getFields']();}return null;})[_0x47a5('0x21')](function(_0xdfcecc){if(_0xdfcecc){if(!_0xdfcecc[_0x47a5('0x2f')]){throw new db[(_0x47a5('0x60'))][(_0x47a5('0x61'))](_0x47a5('0x62'),0x193);}_0x3e8274=_0xdfcecc;return db[_0x47a5('0x63')][_0x47a5('0x64')]({'raw':!![]});}return null;})[_0x47a5('0x21')](function(_0x44cb90){if(_0x44cb90){_0x2d6494=_[_0x47a5('0x65')](_0x44cb90,'id');var _0x44fda9;var _0x3c0006=squel[_0x47a5('0x66')]();_0x3c0006[_0x47a5('0x67')](_0x132854['table']);for(var _0x42dd7d=0x0;_0x42dd7d<_0x3e8274[_0x47a5('0x2f')];_0x42dd7d+=0x1){_0x44fda9=_0x3e8274[_0x42dd7d][_0x47a5('0x68')]?_0x2d6494[_0x3e8274[_0x42dd7d]['MetricId']][_0x47a5('0x69')]:_0x3e8274[_0x42dd7d][_0x47a5('0x6a')];_0x44fda9=_0x3e8274[_0x42dd7d][_0x47a5('0x6b')]?_[_0x47a5('0x6c')](_0x53eedf[_0x3e8274[_0x42dd7d]['function']],'%s',_0x44fda9):_0x44fda9;_0x44fda9=_0x3e8274[_0x42dd7d][_0x47a5('0x6d')]?_['replace'](_0x199621[_0x3e8274[_0x42dd7d][_0x47a5('0x6d')]],'%s',_0x44fda9):_0x44fda9;if(_0x3e8274[_0x42dd7d]['groupBy']){_0x3c0006[_0x47a5('0x5d')](_0x44fda9);}_0x3e8274[_0x42dd7d]['orderBy']&&_0x3c0006[_0x47a5('0x32')](_0x44fda9,_0x3e8274[_0x42dd7d][_0x47a5('0x6e')]===_0x47a5('0x6f')?![]:!![]);_0x3c0006['field'](_0x44fda9,_0x3e8274[_0x42dd7d]['alias']||_0x44fda9);}if(_0x132854['joins']){_0x132854[_0x47a5('0x70')]=JSON[_0x47a5('0x71')](_0x132854[_0x47a5('0x70')]);for(var _0x117510=0x0;_0x117510<_0x132854['joins'][_0x47a5('0x2f')];_0x117510+=0x1){if(_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x72')]&&_[_0x47a5('0x58')](_0x16bb8a,_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x72')])&&_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x73')]&&_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x74')]&&_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x75')]){_0x3c0006[_0x132854['joins'][_0x117510][_0x47a5('0x72')]](_0x132854['joins'][_0x117510][_0x47a5('0x74')],null,util[_0x47a5('0x6d')](_0x47a5('0x76'),_0x132854[_0x47a5('0x77')],_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x73')],_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x74')],_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x75')]));}}}if(_0x132854[_0x47a5('0x78')]){_0x132854[_0x47a5('0x78')]=JSON[_0x47a5('0x71')](_0x132854[_0x47a5('0x78')]);_0x3c0006[_0x47a5('0x34')](_0x5d1550(_0x132854['conditions']['group']));}_0x35cca8=_0x3c0006['clone']();_0x3c0006['limit'](_0x4d6a82);_0x3c0006[_0x47a5('0x1d')](0x0);logger[_0x47a5('0x79')]('Limited\x20Query:',_0x3c0006[_0x47a5('0x7a')]());return dbH[_0x47a5('0x7b')][_0x47a5('0x2b')](_0x3c0006[_0x47a5('0x7a')](),{'type':dbH[_0x47a5('0x7b')][_0x47a5('0x7c')][_0x47a5('0x7d')]});}})[_0x47a5('0x21')](respondWithResult(_0x6d6b2b,null))[_0x47a5('0x48')](handleError(_0x6d6b2b,null));};function runReport(_0x1ffe3c,_0x24a6c1,_0x5e5f16){var _0x18fa31=_0x24a6c1[_0x47a5('0x26')];var _0x420671=0xa;var _0x4f35ff=[_0x47a5('0x7e'),_0x47a5('0x7f'),_0x47a5('0x4d'),'cross_join'];var _0x19dc8c={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x47a5('0x80'),'MAX':_0x47a5('0x81'),'MIN':_0x47a5('0x51'),'AVG':_0x47a5('0x52'),'GROUP_CONCAT':_0x47a5('0x53'),'GROUP_CONCAT ASC':_0x47a5('0x54'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x592322={'SEC_TO_TIME':_0x47a5('0x55'),'DATE':'DATE(%s)','HOUR':_0x47a5('0x82'),'ROUND':_0x47a5('0x57'),'UNIX_TIMESTAMP':_0x47a5('0x83')};var _0xb16bdd=function(_0x53ea2b){return!_[_0x47a5('0x58')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x47a5('0x84'),_0x47a5('0x5b')],_0x53ea2b);};var _0x5b91f7=function(_0x1926bd){if(!_0x1926bd||!_0x1926bd[_0x47a5('0x5c')][_0x47a5('0x2f')]){return'';}for(var _0x4c25ec='(',_0x280372=0x0;_0x280372<_0x1926bd['rules'][_0x47a5('0x2f')];_0x280372+=0x1){_0x280372>0x0&&(_0x4c25ec+='\x20'+_0x1926bd[_0x47a5('0x85')]+'\x20');_0x4c25ec+=_0x1926bd[_0x47a5('0x5c')][_0x280372]['group']?_0x5b91f7(_0x1926bd[_0x47a5('0x5c')][_0x280372][_0x47a5('0x5d')]):_0x1926bd[_0x47a5('0x5c')][_0x280372]['field']+'\x20'+_0x1926bd[_0x47a5('0x5c')][_0x280372]['condition']+(_0xb16bdd(_0x1926bd[_0x47a5('0x5c')][_0x280372]['condition'])?'\x20'+_0x1926bd[_0x47a5('0x5c')][_0x280372][_0x47a5('0x5f')]:'');}return _0x4c25ec+')';};var _0x20a742={'where':{'id':_0x1ffe3c['id']}},_0x211fbf,_0x51738b,_0x42fcce,_0x2ae130,_0x23c393;_0x20a742=_[_0x47a5('0x37')]({},_0x20a742,_0x5e5f16);return db[_0x47a5('0x39')]['find'](_0x20a742)['then'](function(_0x569550){if(_0x569550){_0x211fbf=_0x569550;return _0x569550['getFields']();}return null;})[_0x47a5('0x21')](function(_0xa8809a){if(_0xa8809a){if(!_0xa8809a[_0x47a5('0x2f')]){throw new db['Sequelize'][(_0x47a5('0x61'))](_0x47a5('0x62'),0x193);}_0x51738b=_0xa8809a;return db['AnalyticMetric'][_0x47a5('0x64')]({'raw':!![]});}return null;})[_0x47a5('0x21')](function(_0x19acfa){if(_0x19acfa){_0x42fcce=_[_0x47a5('0x65')](_0x19acfa,'id');var _0x58dacd;var _0x4b5353=squel[_0x47a5('0x66')]();_0x4b5353[_0x47a5('0x67')](_0x211fbf['table']);for(var _0x27d422=0x0;_0x27d422<_0x51738b[_0x47a5('0x2f')];_0x27d422+=0x1){_0x58dacd=_0x51738b[_0x27d422]['MetricId']?_0x42fcce[_0x51738b[_0x27d422][_0x47a5('0x68')]][_0x47a5('0x69')]:_0x51738b[_0x27d422][_0x47a5('0x6a')];_0x58dacd=_0x51738b[_0x27d422]['function']?_[_0x47a5('0x6c')](_0x19dc8c[_0x51738b[_0x27d422]['function']],'%s',_0x58dacd):_0x58dacd;_0x58dacd=_0x51738b[_0x27d422][_0x47a5('0x6d')]?_['replace'](_0x592322[_0x51738b[_0x27d422][_0x47a5('0x6d')]],'%s',_0x58dacd):_0x58dacd;if(_0x51738b[_0x27d422][_0x47a5('0x86')]){_0x4b5353['group'](_0x58dacd);}_0x51738b[_0x27d422][_0x47a5('0x6e')]&&_0x4b5353['order'](_0x58dacd,_0x51738b[_0x27d422][_0x47a5('0x6e')]===_0x47a5('0x6f')?![]:!![]);_0x4b5353[_0x47a5('0x6a')](_0x58dacd,_0x51738b[_0x27d422][_0x47a5('0x87')]||_0x58dacd);}if(_0x211fbf['joins']){_0x211fbf[_0x47a5('0x70')]=JSON['parse'](_0x211fbf['joins']);for(var _0x2bb2df=0x0;_0x2bb2df<_0x211fbf[_0x47a5('0x70')][_0x47a5('0x2f')];_0x2bb2df+=0x1){if(_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x72')]&&_['includes'](_0x4f35ff,_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x72')])&&_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x73')]&&_0x211fbf['joins'][_0x2bb2df][_0x47a5('0x74')]&&_0x211fbf['joins'][_0x2bb2df][_0x47a5('0x75')]){_0x4b5353[_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x72')]](_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x74')],null,util[_0x47a5('0x6d')](_0x47a5('0x76'),_0x211fbf[_0x47a5('0x77')],_0x211fbf[_0x47a5('0x70')][_0x2bb2df]['parentKey'],_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x74')],_0x211fbf['joins'][_0x2bb2df][_0x47a5('0x75')]));}}}if(_0x211fbf[_0x47a5('0x78')]){_0x211fbf[_0x47a5('0x78')]=JSON['parse'](_0x211fbf['conditions']);_0x4b5353[_0x47a5('0x34')](_0x5b91f7(_0x211fbf[_0x47a5('0x78')]['group']));}_0x23c393=_0x4b5353['clone']();_0x4b5353[_0x47a5('0x1b')](_0x420671);_0x4b5353[_0x47a5('0x1d')](0x0);return;}})['then'](function(){if(_0x24a6c1[_0x47a5('0x88')]===_0x47a5('0x89')){return null;}var _0x4c9e6a=_[_0x47a5('0x37')](_0x24a6c1,{'name':_0x24a6c1[_0x47a5('0x8a')]||_0x24a6c1[_0x47a5('0x26')]||_0x211fbf[_0x47a5('0x26')],'basename':_0x18fa31,'savename':util[_0x47a5('0x6d')](_0x47a5('0x8b'),_0x24a6c1['name']||_0x211fbf['name'],require('randomstring')[_0x47a5('0x8c')](0x4),_0x24a6c1[_0x47a5('0x88')]||'csv'),'reportId':_0x211fbf['id'],'reportType':_0x47a5('0x8d')});return db[_0x47a5('0x8e')][_0x47a5('0x3f')](_0x4c9e6a,{'raw':!![]});})[_0x47a5('0x21')](function(_0xcdbfd7){if(_0x211fbf['table']===_0x47a5('0x8f')){_0x23c393['where'](_0x211fbf['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x24a6c1[_0x47a5('0x90')],_0x24a6c1['endDate']);}else{_0x23c393[_0x47a5('0x34')](_0x211fbf[_0x47a5('0x77')]+_0x47a5('0x91'),_0x24a6c1['startDate'],_0x24a6c1[_0x47a5('0x92')]);}if(_0xcdbfd7){logger[_0x47a5('0x93')](_0x47a5('0x94'),_0x23c393[_0x47a5('0x7a')]());require(_0x47a5('0x95'))['fork'](path[_0x47a5('0x7e')](__dirname,_0x47a5('0x96'),_0xcdbfd7['output']),[_0xcdbfd7['id'],_0x23c393[_0x47a5('0x7a')](),path[_0x47a5('0x7e')](__dirname,_0x47a5('0x97'),_0xcdbfd7[_0x47a5('0x98')]),_0x18fa31]);return _0xcdbfd7;}else{var _0x3c117a=squel[_0x47a5('0x66')]();_0x3c117a['from']('('+_0x23c393[_0x47a5('0x7a')]()+')',_0x47a5('0x99'));_0x3c117a['field'](_0x47a5('0x9a'),_0x47a5('0x1c'));_0x23c393[_0x47a5('0x1b')](_0x24a6c1[_0x47a5('0x1b')]||_0x420671);_0x23c393['offset'](_0x24a6c1['offset']||0x0);return dbH['sequelize']['query'](_0x3c117a[_0x47a5('0x7a')](),{'type':dbH[_0x47a5('0x7b')][_0x47a5('0x7c')][_0x47a5('0x7d')]})[_0x47a5('0x21')](function(_0x6bc37b){if(!_0x6bc37b[_0x47a5('0x2f')]){_0x2ae130=0x0;}else{_0x2ae130=_0x6bc37b[0x0][_0x47a5('0x1c')]||0x0;}return dbH['sequelize'][_0x47a5('0x2b')](_0x23c393[_0x47a5('0x7a')](),{'type':dbH[_0x47a5('0x7b')][_0x47a5('0x7c')]['SELECT']});})['then'](function(_0x3770ae){return{'rows':_0x3770ae||[],'count':_0x2ae130};});}});}exports['run']=function(_0x4cb8e4,_0x1b6a5c){return runReport(_0x4cb8e4[_0x47a5('0x4c')],_0x4cb8e4['query'],_0x4cb8e4[_0x47a5('0x38')])[_0x47a5('0x21')](respondWithResult(_0x1b6a5c,null))[_0x47a5('0x48')](handleError(_0x1b6a5c,null));};exports['runReport']=runReport;exports[_0x47a5('0x2b')]=function(_0xee23c7,_0x48a491){var _0x1172fd=0xa;var _0x280b7b=[_0x47a5('0x7e'),_0x47a5('0x7f'),_0x47a5('0x4d'),_0x47a5('0x4e')];var _0x482c87={'SUM':_0x47a5('0x4f'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x47a5('0x80'),'MAX':_0x47a5('0x81'),'MIN':_0x47a5('0x51'),'AVG':_0x47a5('0x52'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x47a5('0x54'),'GROUP_CONCAT DESC':_0x47a5('0x9b')};var _0x151540={'SEC_TO_TIME':_0x47a5('0x55'),'DATE':_0x47a5('0x56'),'HOUR':_0x47a5('0x82'),'ROUND':_0x47a5('0x57'),'UNIX_TIMESTAMP':_0x47a5('0x83')};var _0x1b3e82=function(_0xa2045c){return!_[_0x47a5('0x58')]([_0x47a5('0x59'),'IS\x20NOT\x20NULL',_0x47a5('0x84'),_0x47a5('0x5b')],_0xa2045c);};var _0x591bde=function(_0x55d955){if(!_0x55d955||!_0x55d955[_0x47a5('0x5c')][_0x47a5('0x2f')]){return'';}for(var _0x2ccf21='(',_0x2ff467=0x0;_0x2ff467<_0x55d955['rules'][_0x47a5('0x2f')];_0x2ff467+=0x1){_0x2ff467>0x0&&(_0x2ccf21+='\x20'+_0x55d955[_0x47a5('0x85')]+'\x20');_0x2ccf21+=_0x55d955[_0x47a5('0x5c')][_0x2ff467][_0x47a5('0x5d')]?_0x591bde(_0x55d955[_0x47a5('0x5c')][_0x2ff467][_0x47a5('0x5d')]):_0x55d955[_0x47a5('0x5c')][_0x2ff467]['field']+'\x20'+_0x55d955['rules'][_0x2ff467][_0x47a5('0x5e')]+(_0x1b3e82(_0x55d955['rules'][_0x2ff467][_0x47a5('0x5e')])?'\x20'+_0x55d955['rules'][_0x2ff467][_0x47a5('0x5f')]:'');}return _0x2ccf21+')';};var _0x8b4354={'where':{'id':_0xee23c7[_0x47a5('0x4c')]['id']}},_0x134c1a,_0x2bc7ae,_0x49cb8c,_0x220557,_0x11f07b;_0x8b4354=_['merge']({},_0x8b4354,_0xee23c7['options']);return db[_0x47a5('0x39')][_0x47a5('0x4b')](_0x8b4354)[_0x47a5('0x21')](function(_0xfccf9c){if(_0xfccf9c){_0x134c1a=_0xfccf9c;return _0xfccf9c[_0x47a5('0x9c')]();}return null;})[_0x47a5('0x21')](function(_0x1c0323){if(_0x1c0323){if(!_0x1c0323[_0x47a5('0x2f')]){throw new db['Sequelize'][(_0x47a5('0x61'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2bc7ae=_0x1c0323;return db[_0x47a5('0x63')][_0x47a5('0x64')]({'raw':!![]});}return null;})['then'](function(_0x48d4cf){if(_0x48d4cf){_0x49cb8c=_[_0x47a5('0x65')](_0x48d4cf,'id');var _0x41d2da;var _0x530387=squel[_0x47a5('0x66')]();_0x530387[_0x47a5('0x67')](_0x134c1a[_0x47a5('0x77')]);for(var _0x44567e=0x0;_0x44567e<_0x2bc7ae['length'];_0x44567e+=0x1){_0x41d2da=_0x2bc7ae[_0x44567e][_0x47a5('0x68')]?_0x49cb8c[_0x2bc7ae[_0x44567e]['MetricId']]['metric']:_0x2bc7ae[_0x44567e]['field'];_0x41d2da=_0x2bc7ae[_0x44567e][_0x47a5('0x6b')]?_['replace'](_0x482c87[_0x2bc7ae[_0x44567e][_0x47a5('0x6b')]],'%s',_0x41d2da):_0x41d2da;_0x41d2da=_0x2bc7ae[_0x44567e][_0x47a5('0x6d')]?_[_0x47a5('0x6c')](_0x151540[_0x2bc7ae[_0x44567e][_0x47a5('0x6d')]],'%s',_0x41d2da):_0x41d2da;if(_0x2bc7ae[_0x44567e][_0x47a5('0x86')]){_0x530387[_0x47a5('0x5d')](_0x41d2da);}_0x2bc7ae[_0x44567e][_0x47a5('0x6e')]&&_0x530387[_0x47a5('0x32')](_0x41d2da,_0x2bc7ae[_0x44567e][_0x47a5('0x6e')]===_0x47a5('0x6f')?![]:!![]);_0x530387[_0x47a5('0x6a')](_0x41d2da,_0x2bc7ae[_0x44567e][_0x47a5('0x87')]||_0x41d2da);}if(_0x134c1a[_0x47a5('0x70')]){_0x134c1a[_0x47a5('0x70')]=JSON[_0x47a5('0x71')](_0x134c1a['joins']);for(var _0xdd95c8=0x0;_0xdd95c8<_0x134c1a[_0x47a5('0x70')][_0x47a5('0x2f')];_0xdd95c8+=0x1){if(_0x134c1a[_0x47a5('0x70')][_0xdd95c8]['type']&&_[_0x47a5('0x58')](_0x280b7b,_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x72')])&&_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x73')]&&_0x134c1a[_0x47a5('0x70')][_0xdd95c8][_0x47a5('0x74')]&&_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x75')]){_0x530387[_0x134c1a[_0x47a5('0x70')][_0xdd95c8][_0x47a5('0x72')]](_0x134c1a['joins'][_0xdd95c8]['foreignTable'],null,util[_0x47a5('0x6d')](_0x47a5('0x76'),_0x134c1a[_0x47a5('0x77')],_0x134c1a[_0x47a5('0x70')][_0xdd95c8][_0x47a5('0x73')],_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x74')],_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x75')]));}}}if(_0x134c1a[_0x47a5('0x78')]){_0x134c1a[_0x47a5('0x78')]=JSON[_0x47a5('0x71')](_0x134c1a['conditions']);_0x530387['where'](_0x591bde(_0x134c1a[_0x47a5('0x78')][_0x47a5('0x5d')]));}_0x11f07b=_0x530387[_0x47a5('0x9d')]();_0x530387[_0x47a5('0x1b')](_0x1172fd);_0x530387[_0x47a5('0x1d')](0x0);logger[_0x47a5('0x79')](_0x47a5('0x9e'),_0x530387[_0x47a5('0x7a')]());return dbH[_0x47a5('0x7b')]['query'](_0x530387['toString'](),{'type':dbH[_0x47a5('0x7b')]['QueryTypes'][_0x47a5('0x7d')]});}})[_0x47a5('0x21')](function(){return{'sql':_0x11f07b[_0x47a5('0x7a')]()};})['then'](respondWithResult(_0x48a491,null))[_0x47a5('0x48')](handleError(_0x48a491,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index efea234..1bdf6c8 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 _0x21b0=['bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api','moment'];(function(_0x1ab5b5,_0x582f1b){var _0x53fafa=function(_0x44e1ff){while(--_0x44e1ff){_0x1ab5b5['push'](_0x1ab5b5['shift']());}};_0x53fafa(++_0x582f1b);}(_0x21b0,0x183));var _0x021b=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x21b0[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x021b('0x0'));var util=require(_0x021b('0x1'));var logger=require(_0x021b('0x2'))(_0x021b('0x3'));var moment=require(_0x021b('0x4'));var BPromise=require(_0x021b('0x5'));var rp=require(_0x021b('0x6'));var fs=require('fs');var path=require(_0x021b('0x7'));var rimraf=require(_0x021b('0x8'));var config=require(_0x021b('0x9'));var attributes=require(_0x021b('0xa'));module['exports']=function(_0x216e92,_0x4cb36c){return _0x216e92[_0x021b('0xb')](_0x021b('0xc'),attributes,{'tableName':_0x021b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5711=['rimraf','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x3107e7,_0x259bc1){var _0x1f97bc=function(_0x495e40){while(--_0x495e40){_0x3107e7['push'](_0x3107e7['shift']());}};_0x1f97bc(++_0x259bc1);}(_0x5711,0x158));var _0x1571=function(_0xc77819,_0x139fdc){_0xc77819=_0xc77819-0x0;var _0x1c9434=_0x5711[_0xc77819];return _0x1c9434;};'use strict';var _=require(_0x1571('0x0'));var util=require(_0x1571('0x1'));var logger=require(_0x1571('0x2'))('api');var moment=require(_0x1571('0x3'));var BPromise=require(_0x1571('0x4'));var rp=require(_0x1571('0x5'));var fs=require('fs');var path=require(_0x1571('0x6'));var rimraf=require(_0x1571('0x7'));var config=require('../../config/environment');var attributes=require(_0x1571('0x8'));module[_0x1571('0x9')]=function(_0x5be704,_0x3d754f){return _0x5be704[_0x1571('0xa')](_0x1571('0xb'),attributes,{'tableName':_0x1571('0xc'),'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 94abff7..c1194b9 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 _0x44ba=['request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x44ba,0x1b6));var _0xa44b=function(_0x2e2eab,_0x2e609a){_0x2e2eab=_0x2e2eab-0x0;var _0x2357bc=_0x44ba[_0x2e2eab];return _0x2357bc;};'use strict';var _=require(_0xa44b('0x0'));var util=require(_0xa44b('0x1'));var moment=require(_0xa44b('0x2'));var BPromise=require('bluebird');var rs=require(_0xa44b('0x3'));var fs=require('fs');var Redis=require(_0xa44b('0x4'));var db=require(_0xa44b('0x5'))['db'];var utils=require(_0xa44b('0x6'));var logger=require(_0xa44b('0x7'))(_0xa44b('0x8'));var config=require(_0xa44b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa44b('0xa')][_0xa44b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x218a5d,_0x1c7589,_0x2244b0){return new BPromise(function(_0x594017,_0x3d048a){return client[_0xa44b('0xc')](_0x218a5d,_0x2244b0)[_0xa44b('0xd')](function(_0x28cc8e){logger[_0xa44b('0xe')](_0xa44b('0xf'),_0x1c7589,'request\x20sent');logger[_0xa44b('0x10')](_0xa44b('0x11'),_0x1c7589,_0xa44b('0x12'),JSON[_0xa44b('0x13')](_0x28cc8e));if(_0x28cc8e[_0xa44b('0x14')]){if(_0x28cc8e['error'][_0xa44b('0x15')]===0x1f4){logger[_0xa44b('0x14')](_0xa44b('0xf'),_0x1c7589,_0x28cc8e[_0xa44b('0x14')]['message']);return _0x3d048a(_0x28cc8e['error'][_0xa44b('0x16')]);}logger[_0xa44b('0x14')](_0xa44b('0xf'),_0x1c7589,_0x28cc8e[_0xa44b('0x14')][_0xa44b('0x16')]);return _0x594017(_0x28cc8e[_0xa44b('0x14')][_0xa44b('0x16')]);}else{logger[_0xa44b('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x1c7589,_0xa44b('0x12'));_0x594017(_0x28cc8e[_0xa44b('0x17')][_0xa44b('0x16')]);}})[_0xa44b('0x18')](function(_0x41897c){logger['error'](_0xa44b('0xf'),_0x1c7589,_0x41897c);_0x3d048a(_0x41897c);});});} \ No newline at end of file +var _0x75e8=['then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x269ff5,_0x3b4514){var _0x16b4b4=function(_0x2c6dd7){while(--_0x2c6dd7){_0x269ff5['push'](_0x269ff5['shift']());}};_0x16b4b4(++_0x3b4514);}(_0x75e8,0xf2));var _0x875e=function(_0x884c3c,_0x3941ff){_0x884c3c=_0x884c3c-0x0;var _0x269116=_0x75e8[_0x884c3c];return _0x269116;};'use strict';var _=require(_0x875e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x875e('0x1'));var rs=require(_0x875e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x875e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x875e('0x4'))(_0x875e('0x5'));var config=require('../../config/environment');var jayson=require(_0x875e('0x6'));var client=jayson[_0x875e('0x7')][_0x875e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x231ce6,_0x20c875,_0x33640c){return new BPromise(function(_0x37ae9a,_0x8d8db1){return client[_0x875e('0x9')](_0x231ce6,_0x33640c)[_0x875e('0xa')](function(_0x4b9f0a){logger['info'](_0x875e('0xb'),_0x20c875,_0x875e('0xc'));logger[_0x875e('0xd')](_0x875e('0xe'),_0x20c875,_0x875e('0xc'),JSON[_0x875e('0xf')](_0x4b9f0a));if(_0x4b9f0a[_0x875e('0x10')]){if(_0x4b9f0a[_0x875e('0x10')][_0x875e('0x11')]===0x1f4){logger[_0x875e('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x20c875,_0x4b9f0a[_0x875e('0x10')][_0x875e('0x12')]);return _0x8d8db1(_0x4b9f0a[_0x875e('0x10')][_0x875e('0x12')]);}logger[_0x875e('0x10')](_0x875e('0xb'),_0x20c875,_0x4b9f0a['error'][_0x875e('0x12')]);return _0x37ae9a(_0x4b9f0a[_0x875e('0x10')][_0x875e('0x12')]);}else{logger[_0x875e('0x13')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x20c875,_0x875e('0xc'));_0x37ae9a(_0x4b9f0a['result'][_0x875e('0x12')]);}})[_0x875e('0x14')](function(_0x2c4ffb){logger[_0x875e('0x10')](_0x875e('0xb'),_0x20c875,_0x2c4ffb);_0x8d8db1(_0x2c4ffb);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 6923dcf..f617e6c 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 _0xcc8d=['get','isAuthenticated','/:id','run','/:id/query','query','post','create','put','update','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xcc8d,0xfc));var _0xdcc8=function(_0x8abd64,_0x539570){_0x8abd64=_0x8abd64-0x0;var _0xd2511e=_0xcc8d[_0x8abd64];return _0xd2511e;};'use strict';var multer=require(_0xdcc8('0x0'));var util=require(_0xdcc8('0x1'));var path=require('path');var timeout=require(_0xdcc8('0x2'));var express=require('express');var router=express[_0xdcc8('0x3')]();var fs_extra=require(_0xdcc8('0x4'));var auth=require(_0xdcc8('0x5'));var interaction=require(_0xdcc8('0x6'));var config=require(_0xdcc8('0x7'));var controller=require('./analyticDefaultReport.controller');router[_0xdcc8('0x8')]('/',auth[_0xdcc8('0x9')](),controller['index']);router[_0xdcc8('0x8')](_0xdcc8('0xa'),auth[_0xdcc8('0x9')](),controller['show']);router[_0xdcc8('0x8')]('/:id/preview',auth['isAuthenticated'](),controller['preview']);router['get']('/:id/run',auth[_0xdcc8('0x9')](),controller[_0xdcc8('0xb')]);router[_0xdcc8('0x8')](_0xdcc8('0xc'),auth[_0xdcc8('0x9')](),controller[_0xdcc8('0xd')]);router[_0xdcc8('0xe')]('/',auth[_0xdcc8('0x9')](),controller[_0xdcc8('0xf')]);router[_0xdcc8('0x10')](_0xdcc8('0xa'),auth[_0xdcc8('0x9')](),controller[_0xdcc8('0x11')]);router['delete'](_0xdcc8('0xa'),auth[_0xdcc8('0x9')](),controller[_0xdcc8('0x12')]);module[_0xdcc8('0x13')]=router; \ No newline at end of file +var _0xc90c=['show','/:id/preview','preview','/:id/run','run','/:id/query','query','create','put','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id'];(function(_0xaf785f,_0x35cfcd){var _0xda140e=function(_0x93da81){while(--_0x93da81){_0xaf785f['push'](_0xaf785f['shift']());}};_0xda140e(++_0x35cfcd);}(_0xc90c,0x1ab));var _0xcc90=function(_0x43d62e,_0x4dc83f){_0x43d62e=_0x43d62e-0x0;var _0x41c270=_0xc90c[_0x43d62e];return _0x41c270;};'use strict';var multer=require(_0xcc90('0x0'));var util=require(_0xcc90('0x1'));var path=require(_0xcc90('0x2'));var timeout=require(_0xcc90('0x3'));var express=require(_0xcc90('0x4'));var router=express[_0xcc90('0x5')]();var fs_extra=require(_0xcc90('0x6'));var auth=require(_0xcc90('0x7'));var interaction=require(_0xcc90('0x8'));var config=require(_0xcc90('0x9'));var controller=require(_0xcc90('0xa'));router[_0xcc90('0xb')]('/',auth[_0xcc90('0xc')](),controller[_0xcc90('0xd')]);router['get'](_0xcc90('0xe'),auth[_0xcc90('0xc')](),controller[_0xcc90('0xf')]);router[_0xcc90('0xb')](_0xcc90('0x10'),auth[_0xcc90('0xc')](),controller[_0xcc90('0x11')]);router[_0xcc90('0xb')](_0xcc90('0x12'),auth[_0xcc90('0xc')](),controller[_0xcc90('0x13')]);router[_0xcc90('0xb')](_0xcc90('0x14'),auth[_0xcc90('0xc')](),controller[_0xcc90('0x15')]);router['post']('/',auth['isAuthenticated'](),controller[_0xcc90('0x16')]);router[_0xcc90('0x17')](_0xcc90('0xe'),auth[_0xcc90('0xc')](),controller[_0xcc90('0x18')]);router['delete']('/:id',auth[_0xcc90('0xc')](),controller[_0xcc90('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index a05fb1d..9dd4e46 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 _0xc785=['manual','sequelize','exports','STRING','csv','pdf','Loading','ENUM'];(function(_0x59397f,_0x297dd5){var _0x3b6829=function(_0x4d8d42){while(--_0x4d8d42){_0x59397f['push'](_0x59397f['shift']());}};_0x3b6829(++_0x297dd5);}(_0xc785,0x161));var _0x5c78=function(_0x4e4e4f,_0x54d91b){_0x4e4e4f=_0x4e4e4f-0x0;var _0xb4f281=_0xc785[_0x4e4e4f];return _0xb4f281;};'use strict';var Sequelize=require(_0x5c78('0x0'));var moment=require('moment');module[_0x5c78('0x1')]={'name':{'type':Sequelize[_0x5c78('0x2')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x5c78('0x3'),_0x5c78('0x4'),'xlsx'),'allowNull':![],'defaultValue':_0x5c78('0x3')},'savename':{'type':Sequelize[_0x5c78('0x2')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x5c78('0x2')],'defaultValue':_0x5c78('0x5')},'type':{'type':Sequelize[_0x5c78('0x6')](_0x5c78('0x7'),'scheduled'),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize['INTEGER'](0xb)['UNSIGNED']},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1004=['STRING','csv','DATE','ENUM','manual','scheduled','INTEGER','moment'];(function(_0xe1a3a5,_0xd3e341){var _0x362646=function(_0xdcef03){while(--_0xdcef03){_0xe1a3a5['push'](_0xe1a3a5['shift']());}};_0x362646(++_0xd3e341);}(_0x1004,0x9f));var _0x4100=function(_0x3e3a9d,_0x39b404){_0x3e3a9d=_0x3e3a9d-0x0;var _0x514381=_0x1004[_0x3e3a9d];return _0x514381;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x4100('0x0'));module['exports']={'name':{'type':Sequelize[_0x4100('0x1')],'allowNull':![]},'basename':{'type':Sequelize[_0x4100('0x1')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x4100('0x2'),'pdf','xlsx'),'allowNull':![],'defaultValue':_0x4100('0x2')},'savename':{'type':Sequelize[_0x4100('0x1')],'allowNull':![]},'startDate':{'type':Sequelize[_0x4100('0x3')]},'endDate':{'type':Sequelize[_0x4100('0x3')]},'status':{'type':Sequelize['STRING'],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x4100('0x4')](_0x4100('0x5'),_0x4100('0x6')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0x4100('0x7')](0xb)['UNSIGNED']},'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 e084797..6bddb30 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 _0x09df=['existsSync','join','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','download','root','server/files/reports','format','%s.%s','output','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','stack','name','index','AnalyticExtractedReport','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','rawAttributes','create','user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','basename','savename'];(function(_0x198070,_0x8b89a4){var _0x3e3aac=function(_0x1b89eb){while(--_0x1b89eb){_0x198070['push'](_0x198070['shift']());}};_0x3e3aac(++_0x8b89a4);}(_0x09df,0x123));var _0xf09d=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0x09df[_0x2aa0e7];return _0x1472c0;};'use strict';var emlformat=require(_0xf09d('0x0'));var rimraf=require(_0xf09d('0x1'));var zipdir=require(_0xf09d('0x2'));var jsonpatch=require(_0xf09d('0x3'));var rp=require(_0xf09d('0x4'));var moment=require(_0xf09d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf09d('0x6'));var util=require(_0xf09d('0x7'));var path=require(_0xf09d('0x8'));var sox=require(_0xf09d('0x9'));var csv=require(_0xf09d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf09d('0xb'));var _=require(_0xf09d('0xc'));var squel=require(_0xf09d('0xd'));var crypto=require('crypto');var jsforce=require(_0xf09d('0xe'));var deskjs=require(_0xf09d('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf09d('0x10'));var Redis=require('ioredis');var authService=require(_0xf09d('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf09d('0x12'));var logger=require(_0xf09d('0x13'))(_0xf09d('0x14'));var utils=require(_0xf09d('0x15'));var config=require(_0xf09d('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xf09d('0x17'))['db'];function respondWithStatusCode(_0x2d8814,_0x3cf76f){_0x3cf76f=_0x3cf76f||0xcc;return function(_0x27f885){if(_0x27f885){return _0x2d8814[_0xf09d('0x18')](_0x3cf76f);}return _0x2d8814[_0xf09d('0x19')](_0x3cf76f)[_0xf09d('0x1a')]();};}function respondWithResult(_0x386e2a,_0x4bff69){_0x4bff69=_0x4bff69||0xc8;return function(_0x46798e){if(_0x46798e){return _0x386e2a[_0xf09d('0x19')](_0x4bff69)[_0xf09d('0x1b')](_0x46798e);}};}function respondWithFilteredResult(_0x4a5eef,_0x2570ed){return function(_0x37e245){if(_0x37e245){var _0x532efc=typeof _0x2570ed[_0xf09d('0x1c')]===_0xf09d('0x1d')&&typeof _0x2570ed['limit']===_0xf09d('0x1d');var _0x2c4934=_0x37e245[_0xf09d('0x1e')];var _0x5a7dab=_0x532efc?0x0:_0x2570ed[_0xf09d('0x1c')];var _0x170d79=_0x532efc?_0x37e245[_0xf09d('0x1e')]:_0x2570ed['offset']+_0x2570ed[_0xf09d('0x1f')];var _0x3c7a85;if(_0x170d79>=_0x2c4934){_0x170d79=_0x2c4934;_0x3c7a85=0xc8;}else{_0x3c7a85=0xce;}_0x4a5eef[_0xf09d('0x19')](_0x3c7a85);return _0x4a5eef[_0xf09d('0x20')]('Content-Range',_0x5a7dab+'-'+_0x170d79+'/'+_0x2c4934)[_0xf09d('0x1b')](_0x37e245);}return null;};}function patchUpdates(_0x3e4a5b){return function(_0x2e3ba5){try{jsonpatch['apply'](_0x2e3ba5,_0x3e4a5b,!![]);}catch(_0x397ec9){return BPromise[_0xf09d('0x21')](_0x397ec9);}return _0x2e3ba5[_0xf09d('0x22')]();};}function saveUpdates(_0xc9778e,_0x2777b1){return function(_0x5b4ebb){if(_0x5b4ebb){return _0x5b4ebb[_0xf09d('0x23')](_0xc9778e)[_0xf09d('0x24')](function(_0x443cf2){return _0x443cf2;});}return null;};}function removeEntity(_0x71f53e,_0x42d47e){return function(_0x328bf5){if(_0x328bf5){return _0x328bf5[_0xf09d('0x25')]()['then'](function(){var _0x5313f2=_0x328bf5[_0xf09d('0x26')]({'plain':!![]});var _0x40262e=_0xf09d('0x27');return db[_0xf09d('0x28')][_0xf09d('0x25')]({'where':{'type':_0x40262e,'resourceId':_0x5313f2['id']}})[_0xf09d('0x24')](function(){return _0x328bf5;});})[_0xf09d('0x24')](function(){_0x71f53e[_0xf09d('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d554b,_0x38d0ea){return function(_0x585e9a){if(!_0x585e9a){_0x3d554b['sendStatus'](0x194);}return _0x585e9a;};}function handleError(_0x211c40,_0x15927e){_0x15927e=_0x15927e||0x1f4;return function(_0x27bbbc){logger['error'](_0x27bbbc[_0xf09d('0x29')]);if(_0x27bbbc[_0xf09d('0x2a')]){delete _0x27bbbc[_0xf09d('0x2a')];}_0x211c40[_0xf09d('0x19')](_0x15927e)['send'](_0x27bbbc);};}exports[_0xf09d('0x2b')]=function(_0x19af85,_0x45c080){var _0x2a5fa7={},_0x57c7d1={},_0x59a54f={'count':0x0,'rows':[]};var _0x20cd68=_['map'](db[_0xf09d('0x2c')]['rawAttributes'],function(_0x2d3745){return{'name':_0x2d3745[_0xf09d('0x2d')],'type':_0x2d3745['type'][_0xf09d('0x2e')]};});_0x57c7d1[_0xf09d('0x2f')]=_[_0xf09d('0x30')](_0x20cd68,_0xf09d('0x2a'));_0x57c7d1[_0xf09d('0x31')]=_[_0xf09d('0x32')](_0x19af85['query']);_0x57c7d1[_0xf09d('0x33')]=_[_0xf09d('0x34')](_0x57c7d1[_0xf09d('0x2f')],_0x57c7d1[_0xf09d('0x31')]);_0x2a5fa7[_0xf09d('0x35')]=_[_0xf09d('0x34')](_0x57c7d1[_0xf09d('0x2f')],qs[_0xf09d('0x36')](_0x19af85['query'][_0xf09d('0x36')]));_0x2a5fa7[_0xf09d('0x35')]=_0x2a5fa7[_0xf09d('0x35')][_0xf09d('0x37')]?_0x2a5fa7['attributes']:_0x57c7d1[_0xf09d('0x2f')];if(!_0x19af85[_0xf09d('0x31')][_0xf09d('0x38')](_0xf09d('0x39'))){_0x2a5fa7['limit']=qs[_0xf09d('0x1f')](_0x19af85[_0xf09d('0x31')][_0xf09d('0x1f')]);_0x2a5fa7[_0xf09d('0x1c')]=qs[_0xf09d('0x1c')](_0x19af85['query']['offset']);}_0x2a5fa7['order']=qs['sort'](_0x19af85[_0xf09d('0x31')]['sort']);_0x2a5fa7[_0xf09d('0x3a')]=qs[_0xf09d('0x33')](_[_0xf09d('0x3b')](_0x19af85[_0xf09d('0x31')],_0x57c7d1[_0xf09d('0x33')]),_0x20cd68);if(_0x19af85[_0xf09d('0x31')][_0xf09d('0x3c')]){_0x2a5fa7[_0xf09d('0x3a')]=_[_0xf09d('0x3d')](_0x2a5fa7['where'],{'$or':_['map'](_0x20cd68,function(_0x46f5dd){if(_0x46f5dd[_0xf09d('0x3e')]!==_0xf09d('0x3f')){var _0x4a8bcd={};_0x4a8bcd[_0x46f5dd[_0xf09d('0x2a')]]={'$like':'%'+_0x19af85['query'][_0xf09d('0x3c')]+'%'};return _0x4a8bcd;}})});}_0x2a5fa7=_['merge']({},_0x2a5fa7,_0x19af85[_0xf09d('0x40')]);var _0x92fb14={'where':_0x2a5fa7['where']};return db[_0xf09d('0x2c')]['count'](_0x92fb14)[_0xf09d('0x24')](function(_0x52e046){_0x59a54f['count']=_0x52e046;if(_0x19af85[_0xf09d('0x31')][_0xf09d('0x41')]){_0x2a5fa7[_0xf09d('0x42')]=[{'all':!![]}];}return db['AnalyticExtractedReport']['findAll'](_0x2a5fa7);})[_0xf09d('0x24')](function(_0x41ebcb){_0x59a54f[_0xf09d('0x43')]=_0x41ebcb;return _0x59a54f;})['then'](respondWithFilteredResult(_0x45c080,_0x2a5fa7))[_0xf09d('0x44')](handleError(_0x45c080,null));};exports['show']=function(_0x3c82a0,_0x25923d){var _0x38de1e={'raw':!![],'where':{'id':_0x3c82a0['params']['id']}},_0x5c3565={};_0x5c3565[_0xf09d('0x2f')]=_[_0xf09d('0x32')](db[_0xf09d('0x2c')][_0xf09d('0x45')]);_0x5c3565[_0xf09d('0x31')]=_[_0xf09d('0x32')](_0x3c82a0[_0xf09d('0x31')]);_0x5c3565[_0xf09d('0x33')]=_[_0xf09d('0x34')](_0x5c3565[_0xf09d('0x2f')],_0x5c3565['query']);_0x38de1e[_0xf09d('0x35')]=_['intersection'](_0x5c3565[_0xf09d('0x2f')],qs[_0xf09d('0x36')](_0x3c82a0[_0xf09d('0x31')][_0xf09d('0x36')]));_0x38de1e['attributes']=_0x38de1e['attributes'][_0xf09d('0x37')]?_0x38de1e[_0xf09d('0x35')]:_0x5c3565[_0xf09d('0x2f')];if(_0x3c82a0[_0xf09d('0x31')][_0xf09d('0x41')]){_0x38de1e['include']=[{'all':!![]}];}_0x38de1e=_[_0xf09d('0x3d')]({},_0x38de1e,_0x3c82a0[_0xf09d('0x40')]);return db['AnalyticExtractedReport']['find'](_0x38de1e)[_0xf09d('0x24')](handleEntityNotFound(_0x25923d,null))[_0xf09d('0x24')](respondWithResult(_0x25923d,null))['catch'](handleError(_0x25923d,null));};exports[_0xf09d('0x46')]=function(_0x519450,_0xddedc0){return db[_0xf09d('0x2c')][_0xf09d('0x46')](_0x519450['body'],{})['then'](function(_0x46cfd3){var _0x164229=_0x519450[_0xf09d('0x47')]['get']({'plain':!![]});if(!_0x164229)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x164229[_0xf09d('0x48')]===_0xf09d('0x47')){var _0x514884=_0x46cfd3[_0xf09d('0x26')]({'plain':!![]});var _0x1b88ac=_0xf09d('0x27');return db['UserProfileSection'][_0xf09d('0x49')]({'where':{'name':_0x1b88ac,'userProfileId':_0x164229[_0xf09d('0x4a')]},'raw':!![]})['then'](function(_0x1e4332){if(_0x1e4332&&_0x1e4332[_0xf09d('0x4b')]===0x0){return db['UserProfileResource']['create']({'name':_0x514884[_0xf09d('0x2a')],'resourceId':_0x514884['id'],'type':_0x1e4332['name'],'sectionId':_0x1e4332['id']},{})[_0xf09d('0x24')](function(){return _0x46cfd3;});}else{return _0x46cfd3;}})[_0xf09d('0x44')](function(_0x2ef3af){logger['error'](_0xf09d('0x4c'),_0x2ef3af);throw _0x2ef3af;});}return _0x46cfd3;})['then'](respondWithResult(_0xddedc0,0xc9))['catch'](handleError(_0xddedc0,null));};exports[_0xf09d('0x23')]=function(_0x446ccc,_0x30244a){if(_0x446ccc[_0xf09d('0x4d')]['id']){delete _0x446ccc['body']['id'];}return db[_0xf09d('0x2c')][_0xf09d('0x49')]({'where':{'id':_0x446ccc[_0xf09d('0x4e')]['id']}})[_0xf09d('0x24')](handleEntityNotFound(_0x30244a,null))[_0xf09d('0x24')](saveUpdates(_0x446ccc[_0xf09d('0x4d')],null))[_0xf09d('0x24')](respondWithResult(_0x30244a,null))[_0xf09d('0x44')](handleError(_0x30244a,null));};exports[_0xf09d('0x25')]=function(_0x504b8f,_0x17759a){return db[_0xf09d('0x2c')]['find']({'where':{'id':_0x504b8f[_0xf09d('0x4e')]['id']}})[_0xf09d('0x24')](handleEntityNotFound(_0x17759a,null))[_0xf09d('0x24')](removeEntity(_0x17759a,null))[_0xf09d('0x44')](handleError(_0x17759a,null));};exports['download']=function(_0xf10987,_0x29101b,_0x42c16e){return db[_0xf09d('0x2c')][_0xf09d('0x49')]({'where':{'id':_0xf10987['params']['id']},'attributes':[_0xf09d('0x2a'),_0xf09d('0x4f'),_0xf09d('0x50'),'output'],'raw':!![]})['then'](handleEntityNotFound(_0x29101b,null))[_0xf09d('0x24')](function(_0x38a956){if(_0x38a956){if(!fs[_0xf09d('0x51')](path[_0xf09d('0x52')](config['root'],'server/files/reports',_0x38a956[_0xf09d('0x50')]))){throw new db[(_0xf09d('0x53'))][(_0xf09d('0x54'))](_0xf09d('0x55'));}if(_0xf10987['query']['exists']){return _0x29101b[_0xf09d('0x18')](0xc8);}return _0x29101b[_0xf09d('0x56')](path[_0xf09d('0x52')](config[_0xf09d('0x57')],_0xf09d('0x58'),_0x38a956[_0xf09d('0x50')]),util[_0xf09d('0x59')](_0xf09d('0x5a'),_0x38a956[_0xf09d('0x4f')]||_0x38a956[_0xf09d('0x2a')],_0x38a956[_0xf09d('0x5b')][_0xf09d('0x5c')]()));}})[_0xf09d('0x44')](handleError(_0x29101b,null));}; \ No newline at end of file +var _0xbc34=['ExtractedReports','UserProfileResource','end','error','stack','name','index','map','AnalyticExtractedReport','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','download','savename','output','existsSync','root','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','join','server/files/reports','format','%s.%s','basename','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','get'];(function(_0x542efb,_0x5424e9){var _0x4bc7f5=function(_0x2b9953){while(--_0x2b9953){_0x542efb['push'](_0x542efb['shift']());}};_0x4bc7f5(++_0x5424e9);}(_0xbc34,0x9e));var _0x4bc3=function(_0x2da371,_0x3d8847){_0x2da371=_0x2da371-0x0;var _0x448712=_0xbc34[_0x2da371];return _0x448712;};'use strict';var emlformat=require(_0x4bc3('0x0'));var rimraf=require(_0x4bc3('0x1'));var zipdir=require(_0x4bc3('0x2'));var jsonpatch=require(_0x4bc3('0x3'));var rp=require(_0x4bc3('0x4'));var moment=require(_0x4bc3('0x5'));var BPromise=require(_0x4bc3('0x6'));var Mustache=require(_0x4bc3('0x7'));var util=require(_0x4bc3('0x8'));var path=require(_0x4bc3('0x9'));var sox=require(_0x4bc3('0xa'));var csv=require(_0x4bc3('0xb'));var ejs=require(_0x4bc3('0xc'));var fs=require('fs');var fs_extra=require(_0x4bc3('0xd'));var _=require(_0x4bc3('0xe'));var squel=require('squel');var crypto=require(_0x4bc3('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x4bc3('0x10'));var toCsv=require(_0x4bc3('0xb'));var querystring=require(_0x4bc3('0x11'));var Papa=require('papaparse');var Redis=require(_0x4bc3('0x12'));var authService=require(_0x4bc3('0x13'));var qs=require(_0x4bc3('0x14'));var as=require(_0x4bc3('0x15'));var hardwareService=require(_0x4bc3('0x16'));var logger=require(_0x4bc3('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x4bc3('0x18'));var licenseUtil=require(_0x4bc3('0x19'));var db=require(_0x4bc3('0x1a'))['db'];function respondWithStatusCode(_0x2c5e8e,_0x5d364a){_0x5d364a=_0x5d364a||0xcc;return function(_0x5c63b3){if(_0x5c63b3){return _0x2c5e8e[_0x4bc3('0x1b')](_0x5d364a);}return _0x2c5e8e['status'](_0x5d364a)['end']();};}function respondWithResult(_0x37fd30,_0x50ff53){_0x50ff53=_0x50ff53||0xc8;return function(_0x4f0ebd){if(_0x4f0ebd){return _0x37fd30[_0x4bc3('0x1c')](_0x50ff53)['json'](_0x4f0ebd);}};}function respondWithFilteredResult(_0x1e941e,_0x5e8db2){return function(_0x23b860){if(_0x23b860){var _0x2ff50d=typeof _0x5e8db2[_0x4bc3('0x1d')]===_0x4bc3('0x1e')&&typeof _0x5e8db2[_0x4bc3('0x1f')]===_0x4bc3('0x1e');var _0x3e4f7e=_0x23b860[_0x4bc3('0x20')];var _0x5e5083=_0x2ff50d?0x0:_0x5e8db2[_0x4bc3('0x1d')];var _0x277222=_0x2ff50d?_0x23b860[_0x4bc3('0x20')]:_0x5e8db2[_0x4bc3('0x1d')]+_0x5e8db2[_0x4bc3('0x1f')];var _0x5b8b93;if(_0x277222>=_0x3e4f7e){_0x277222=_0x3e4f7e;_0x5b8b93=0xc8;}else{_0x5b8b93=0xce;}_0x1e941e[_0x4bc3('0x1c')](_0x5b8b93);return _0x1e941e[_0x4bc3('0x21')](_0x4bc3('0x22'),_0x5e5083+'-'+_0x277222+'/'+_0x3e4f7e)[_0x4bc3('0x23')](_0x23b860);}return null;};}function patchUpdates(_0x58aea0){return function(_0x2964aa){try{jsonpatch[_0x4bc3('0x24')](_0x2964aa,_0x58aea0,!![]);}catch(_0x17d7ca){return BPromise[_0x4bc3('0x25')](_0x17d7ca);}return _0x2964aa['save']();};}function saveUpdates(_0x45f28e,_0x5a7810){return function(_0x228ef2){if(_0x228ef2){return _0x228ef2[_0x4bc3('0x26')](_0x45f28e)[_0x4bc3('0x27')](function(_0x816b9d){return _0x816b9d;});}return null;};}function removeEntity(_0x1d3c73,_0x4dc03a){return function(_0x4e5f81){if(_0x4e5f81){return _0x4e5f81[_0x4bc3('0x28')]()['then'](function(){var _0x28b6b1=_0x4e5f81[_0x4bc3('0x29')]({'plain':!![]});var _0x2cede3=_0x4bc3('0x2a');return db[_0x4bc3('0x2b')][_0x4bc3('0x28')]({'where':{'type':_0x2cede3,'resourceId':_0x28b6b1['id']}})['then'](function(){return _0x4e5f81;});})['then'](function(){_0x1d3c73[_0x4bc3('0x1c')](0xcc)[_0x4bc3('0x2c')]();});}};}function handleEntityNotFound(_0x5ba536,_0x1162e5){return function(_0x4de5b5){if(!_0x4de5b5){_0x5ba536[_0x4bc3('0x1b')](0x194);}return _0x4de5b5;};}function handleError(_0x4cf6f9,_0x1cdbbd){_0x1cdbbd=_0x1cdbbd||0x1f4;return function(_0x16b59d){logger[_0x4bc3('0x2d')](_0x16b59d[_0x4bc3('0x2e')]);if(_0x16b59d[_0x4bc3('0x2f')]){delete _0x16b59d[_0x4bc3('0x2f')];}_0x4cf6f9[_0x4bc3('0x1c')](_0x1cdbbd)['send'](_0x16b59d);};}exports[_0x4bc3('0x30')]=function(_0xff77aa,_0x26e11f){var _0x4f22d8={},_0x1e47f6={},_0x29628a={'count':0x0,'rows':[]};var _0x2310fa=_[_0x4bc3('0x31')](db[_0x4bc3('0x32')]['rawAttributes'],function(_0xd58263){return{'name':_0xd58263[_0x4bc3('0x33')],'type':_0xd58263[_0x4bc3('0x34')]['key']};});_0x1e47f6[_0x4bc3('0x35')]=_[_0x4bc3('0x31')](_0x2310fa,'name');_0x1e47f6[_0x4bc3('0x36')]=_[_0x4bc3('0x37')](_0xff77aa[_0x4bc3('0x36')]);_0x1e47f6[_0x4bc3('0x38')]=_[_0x4bc3('0x39')](_0x1e47f6['model'],_0x1e47f6['query']);_0x4f22d8[_0x4bc3('0x3a')]=_[_0x4bc3('0x39')](_0x1e47f6['model'],qs['fields'](_0xff77aa[_0x4bc3('0x36')][_0x4bc3('0x3b')]));_0x4f22d8['attributes']=_0x4f22d8['attributes'][_0x4bc3('0x3c')]?_0x4f22d8[_0x4bc3('0x3a')]:_0x1e47f6['model'];if(!_0xff77aa[_0x4bc3('0x36')][_0x4bc3('0x3d')]('nolimit')){_0x4f22d8[_0x4bc3('0x1f')]=qs[_0x4bc3('0x1f')](_0xff77aa['query'][_0x4bc3('0x1f')]);_0x4f22d8[_0x4bc3('0x1d')]=qs[_0x4bc3('0x1d')](_0xff77aa[_0x4bc3('0x36')][_0x4bc3('0x1d')]);}_0x4f22d8[_0x4bc3('0x3e')]=qs['sort'](_0xff77aa['query'][_0x4bc3('0x3f')]);_0x4f22d8[_0x4bc3('0x40')]=qs[_0x4bc3('0x38')](_['pick'](_0xff77aa['query'],_0x1e47f6[_0x4bc3('0x38')]),_0x2310fa);if(_0xff77aa[_0x4bc3('0x36')][_0x4bc3('0x41')]){_0x4f22d8[_0x4bc3('0x40')]=_['merge'](_0x4f22d8['where'],{'$or':_[_0x4bc3('0x31')](_0x2310fa,function(_0x2d53e8){if(_0x2d53e8[_0x4bc3('0x34')]!==_0x4bc3('0x42')){var _0x5ecdf6={};_0x5ecdf6[_0x2d53e8['name']]={'$like':'%'+_0xff77aa[_0x4bc3('0x36')][_0x4bc3('0x41')]+'%'};return _0x5ecdf6;}})});}_0x4f22d8=_[_0x4bc3('0x43')]({},_0x4f22d8,_0xff77aa[_0x4bc3('0x44')]);var _0x3f538b={'where':_0x4f22d8[_0x4bc3('0x40')]};return db['AnalyticExtractedReport']['count'](_0x3f538b)[_0x4bc3('0x27')](function(_0x2df1dc){_0x29628a[_0x4bc3('0x20')]=_0x2df1dc;if(_0xff77aa[_0x4bc3('0x36')][_0x4bc3('0x45')]){_0x4f22d8[_0x4bc3('0x46')]=[{'all':!![]}];}return db[_0x4bc3('0x32')][_0x4bc3('0x47')](_0x4f22d8);})['then'](function(_0x6a8650){_0x29628a[_0x4bc3('0x48')]=_0x6a8650;return _0x29628a;})['then'](respondWithFilteredResult(_0x26e11f,_0x4f22d8))[_0x4bc3('0x49')](handleError(_0x26e11f,null));};exports['show']=function(_0x3aa9e2,_0x198dc9){var _0x2b3f54={'raw':!![],'where':{'id':_0x3aa9e2['params']['id']}},_0x341552={};_0x341552['model']=_[_0x4bc3('0x37')](db[_0x4bc3('0x32')][_0x4bc3('0x4a')]);_0x341552[_0x4bc3('0x36')]=_['keys'](_0x3aa9e2[_0x4bc3('0x36')]);_0x341552['filters']=_['intersection'](_0x341552[_0x4bc3('0x35')],_0x341552[_0x4bc3('0x36')]);_0x2b3f54[_0x4bc3('0x3a')]=_[_0x4bc3('0x39')](_0x341552[_0x4bc3('0x35')],qs[_0x4bc3('0x3b')](_0x3aa9e2[_0x4bc3('0x36')][_0x4bc3('0x3b')]));_0x2b3f54[_0x4bc3('0x3a')]=_0x2b3f54['attributes'][_0x4bc3('0x3c')]?_0x2b3f54[_0x4bc3('0x3a')]:_0x341552['model'];if(_0x3aa9e2[_0x4bc3('0x36')]['includeAll']){_0x2b3f54['include']=[{'all':!![]}];}_0x2b3f54=_['merge']({},_0x2b3f54,_0x3aa9e2['options']);return db[_0x4bc3('0x32')][_0x4bc3('0x4b')](_0x2b3f54)['then'](handleEntityNotFound(_0x198dc9,null))[_0x4bc3('0x27')](respondWithResult(_0x198dc9,null))[_0x4bc3('0x49')](handleError(_0x198dc9,null));};exports['create']=function(_0x3ed4fa,_0x14d32a){return db[_0x4bc3('0x32')][_0x4bc3('0x4c')](_0x3ed4fa[_0x4bc3('0x4d')],{})[_0x4bc3('0x27')](function(_0x1308d1){var _0x2d9850=_0x3ed4fa[_0x4bc3('0x4e')][_0x4bc3('0x29')]({'plain':!![]});if(!_0x2d9850)throw new Error(_0x4bc3('0x4f'));if(_0x2d9850[_0x4bc3('0x50')]===_0x4bc3('0x4e')){var _0x2e0f22=_0x1308d1[_0x4bc3('0x29')]({'plain':!![]});var _0x316551=_0x4bc3('0x2a');return db[_0x4bc3('0x51')]['find']({'where':{'name':_0x316551,'userProfileId':_0x2d9850[_0x4bc3('0x52')]},'raw':!![]})[_0x4bc3('0x27')](function(_0x2faf96){if(_0x2faf96&&_0x2faf96[_0x4bc3('0x53')]===0x0){return db[_0x4bc3('0x2b')][_0x4bc3('0x4c')]({'name':_0x2e0f22[_0x4bc3('0x2f')],'resourceId':_0x2e0f22['id'],'type':_0x2faf96[_0x4bc3('0x2f')],'sectionId':_0x2faf96['id']},{})[_0x4bc3('0x27')](function(){return _0x1308d1;});}else{return _0x1308d1;}})[_0x4bc3('0x49')](function(_0x4802c0){logger['error'](_0x4bc3('0x54'),_0x4802c0);throw _0x4802c0;});}return _0x1308d1;})[_0x4bc3('0x27')](respondWithResult(_0x14d32a,0xc9))[_0x4bc3('0x49')](handleError(_0x14d32a,null));};exports[_0x4bc3('0x26')]=function(_0x3b2425,_0x22c5cc){if(_0x3b2425['body']['id']){delete _0x3b2425['body']['id'];}return db['AnalyticExtractedReport'][_0x4bc3('0x4b')]({'where':{'id':_0x3b2425[_0x4bc3('0x55')]['id']}})[_0x4bc3('0x27')](handleEntityNotFound(_0x22c5cc,null))[_0x4bc3('0x27')](saveUpdates(_0x3b2425[_0x4bc3('0x4d')],null))[_0x4bc3('0x27')](respondWithResult(_0x22c5cc,null))[_0x4bc3('0x49')](handleError(_0x22c5cc,null));};exports['destroy']=function(_0x65b4d6,_0x5ac22c){return db[_0x4bc3('0x32')][_0x4bc3('0x4b')]({'where':{'id':_0x65b4d6[_0x4bc3('0x55')]['id']}})[_0x4bc3('0x27')](handleEntityNotFound(_0x5ac22c,null))[_0x4bc3('0x27')](removeEntity(_0x5ac22c,null))[_0x4bc3('0x49')](handleError(_0x5ac22c,null));};exports[_0x4bc3('0x56')]=function(_0x2853d3,_0x173dd3,_0x5dba9e){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x2853d3[_0x4bc3('0x55')]['id']},'attributes':['name','basename',_0x4bc3('0x57'),_0x4bc3('0x58')],'raw':!![]})[_0x4bc3('0x27')](handleEntityNotFound(_0x173dd3,null))[_0x4bc3('0x27')](function(_0x263f71){if(_0x263f71){if(!fs[_0x4bc3('0x59')](path['join'](config[_0x4bc3('0x5a')],'server/files/reports',_0x263f71[_0x4bc3('0x57')]))){throw new db['Sequelize'][(_0x4bc3('0x5b'))](_0x4bc3('0x5c'));}if(_0x2853d3[_0x4bc3('0x36')][_0x4bc3('0x5d')]){return _0x173dd3[_0x4bc3('0x1b')](0xc8);}return _0x173dd3[_0x4bc3('0x56')](path[_0x4bc3('0x5e')](config[_0x4bc3('0x5a')],_0x4bc3('0x5f'),_0x263f71[_0x4bc3('0x57')]),util[_0x4bc3('0x60')](_0x4bc3('0x61'),_0x263f71[_0x4bc3('0x62')]||_0x263f71[_0x4bc3('0x2f')],_0x263f71[_0x4bc3('0x58')][_0x4bc3('0x63')]()));}})[_0x4bc3('0x49')](handleError(_0x173dd3,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 2db5538..15f86f3 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 _0xcb8b=['AnalyticExtractedReport','analytics_extracted_reports','util','../../config/logger','api','moment','path','rimraf','../../config/environment','define'];(function(_0x15feaf,_0x53ff1c){var _0x4dbbec=function(_0x44ffbb){while(--_0x44ffbb){_0x15feaf['push'](_0x15feaf['shift']());}};_0x4dbbec(++_0x53ff1c);}(_0xcb8b,0x1b0));var _0xbcb8=function(_0x498a7a,_0x95fce){_0x498a7a=_0x498a7a-0x0;var _0x4ff437=_0xcb8b[_0x498a7a];return _0x4ff437;};'use strict';var _=require('lodash');var util=require(_0xbcb8('0x0'));var logger=require(_0xbcb8('0x1'))(_0xbcb8('0x2'));var moment=require(_0xbcb8('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbcb8('0x4'));var rimraf=require(_0xbcb8('0x5'));var config=require(_0xbcb8('0x6'));var attributes=require('./analyticExtractedReport.attributes');module['exports']=function(_0x574b9f,_0x5ea062){return _0x574b9f[_0xbcb8('0x7')](_0xbcb8('0x8'),attributes,{'tableName':_0xbcb8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e15=['request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','analytics_extracted_reports','util','../../config/logger','api','bluebird'];(function(_0x21eb63,_0xf3eeac){var _0x217c84=function(_0x5ebf8d){while(--_0x5ebf8d){_0x21eb63['push'](_0x21eb63['shift']());}};_0x217c84(++_0xf3eeac);}(_0x3e15,0xd8));var _0x53e1=function(_0x2176a4,_0x4ae96f){_0x2176a4=_0x2176a4-0x0;var _0x3c3b21=_0x3e15[_0x2176a4];return _0x3c3b21;};'use strict';var _=require('lodash');var util=require(_0x53e1('0x0'));var logger=require(_0x53e1('0x1'))(_0x53e1('0x2'));var moment=require('moment');var BPromise=require(_0x53e1('0x3'));var rp=require(_0x53e1('0x4'));var fs=require('fs');var path=require(_0x53e1('0x5'));var rimraf=require(_0x53e1('0x6'));var config=require(_0x53e1('0x7'));var attributes=require(_0x53e1('0x8'));module[_0x53e1('0x9')]=function(_0x4b640f,_0x28b5df){return _0x4b640f['define']('AnalyticExtractedReport',attributes,{'tableName':_0x53e1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js index ef4b097..fe1ee99 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 _0x1458=['jayson/promise','client','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x35a5e3,_0xb14268){var _0x5653bb=function(_0x3048f0){while(--_0x3048f0){_0x35a5e3['push'](_0x35a5e3['shift']());}};_0x5653bb(++_0xb14268);}(_0x1458,0x16c));var _0x8145=function(_0x431186,_0x592739){_0x431186=_0x431186-0x0;var _0x401ce8=_0x1458[_0x431186];return _0x401ce8;};'use strict';var _=require(_0x8145('0x0'));var util=require(_0x8145('0x1'));var moment=require(_0x8145('0x2'));var BPromise=require(_0x8145('0x3'));var rs=require(_0x8145('0x4'));var fs=require('fs');var Redis=require(_0x8145('0x5'));var db=require(_0x8145('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x8145('0x7'))(_0x8145('0x8'));var config=require(_0x8145('0x9'));var jayson=require(_0x8145('0xa'));var client=jayson[_0x8145('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe25a1b,_0x5f3a02,_0x5b7b04){return new BPromise(function(_0x5d2f25,_0x22468d){return client['request'](_0xe25a1b,_0x5b7b04)[_0x8145('0xc')](function(_0x1bb760){logger['info'](_0x8145('0xd'),_0x5f3a02,_0x8145('0xe'));logger[_0x8145('0xf')](_0x8145('0x10'),_0x5f3a02,_0x8145('0xe'),JSON['stringify'](_0x1bb760));if(_0x1bb760[_0x8145('0x11')]){if(_0x1bb760[_0x8145('0x11')][_0x8145('0x12')]===0x1f4){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x5f3a02,_0x1bb760[_0x8145('0x11')][_0x8145('0x13')]);return _0x22468d(_0x1bb760[_0x8145('0x11')][_0x8145('0x13')]);}logger[_0x8145('0x11')](_0x8145('0xd'),_0x5f3a02,_0x1bb760[_0x8145('0x11')]['message']);return _0x5d2f25(_0x1bb760[_0x8145('0x11')][_0x8145('0x13')]);}else{logger[_0x8145('0x14')](_0x8145('0xd'),_0x5f3a02,'request\x20sent');_0x5d2f25(_0x1bb760['result'][_0x8145('0x13')]);}})[_0x8145('0x15')](function(_0x19b151){logger[_0x8145('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x5f3a02,_0x19b151);_0x22468d(_0x19b151);});});} \ No newline at end of file +var _0x3bd1=['lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x30cbb3,_0x30a8ea){var _0x146d30=function(_0x4df660){while(--_0x4df660){_0x30cbb3['push'](_0x30cbb3['shift']());}};_0x146d30(++_0x30a8ea);}(_0x3bd1,0x111));var _0x13bd=function(_0x163085,_0x48a6ca){_0x163085=_0x163085-0x0;var _0x2b5abe=_0x3bd1[_0x163085];return _0x2b5abe;};'use strict';var _=require(_0x13bd('0x0'));var util=require('util');var moment=require(_0x13bd('0x1'));var BPromise=require(_0x13bd('0x2'));var rs=require(_0x13bd('0x3'));var fs=require('fs');var Redis=require(_0x13bd('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x13bd('0x5'));var logger=require(_0x13bd('0x6'))(_0x13bd('0x7'));var config=require(_0x13bd('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x13bd('0x9')][_0x13bd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f6a83,_0x2aa817,_0x1024b5){return new BPromise(function(_0x19b63c,_0x183108){return client['request'](_0x3f6a83,_0x1024b5)[_0x13bd('0xb')](function(_0x58ef27){logger[_0x13bd('0xc')](_0x13bd('0xd'),_0x2aa817,_0x13bd('0xe'));logger[_0x13bd('0xf')](_0x13bd('0x10'),_0x2aa817,'request\x20sent',JSON['stringify'](_0x58ef27));if(_0x58ef27['error']){if(_0x58ef27[_0x13bd('0x11')][_0x13bd('0x12')]===0x1f4){logger[_0x13bd('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x2aa817,_0x58ef27[_0x13bd('0x11')]['message']);return _0x183108(_0x58ef27['error'][_0x13bd('0x13')]);}logger[_0x13bd('0x11')](_0x13bd('0xd'),_0x2aa817,_0x58ef27['error']['message']);return _0x19b63c(_0x58ef27[_0x13bd('0x11')][_0x13bd('0x13')]);}else{logger['info'](_0x13bd('0xd'),_0x2aa817,'request\x20sent');_0x19b63c(_0x58ef27[_0x13bd('0x14')]['message']);}})['catch'](function(_0x160b79){logger[_0x13bd('0x11')](_0x13bd('0xd'),_0x2aa817,_0x160b79);_0x183108(_0x160b79);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 7a7cde9..4f720b4 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 _0x5a4e=['index','get','show','download','post','create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','isAuthenticated'];(function(_0x4b9652,_0x43b335){var _0x35f6e8=function(_0x5efc1c){while(--_0x5efc1c){_0x4b9652['push'](_0x4b9652['shift']());}};_0x35f6e8(++_0x43b335);}(_0x5a4e,0x155));var _0xe5a4=function(_0x35ba71,_0xa2fbbd){_0x35ba71=_0x35ba71-0x0;var _0x5f04f4=_0x5a4e[_0x35ba71];return _0x5f04f4;};'use strict';var multer=require(_0xe5a4('0x0'));var util=require(_0xe5a4('0x1'));var path=require(_0xe5a4('0x2'));var timeout=require(_0xe5a4('0x3'));var express=require('express');var router=express[_0xe5a4('0x4')]();var fs_extra=require(_0xe5a4('0x5'));var auth=require(_0xe5a4('0x6'));var interaction=require(_0xe5a4('0x7'));var config=require(_0xe5a4('0x8'));var controller=require(_0xe5a4('0x9'));router['get']('/',auth[_0xe5a4('0xa')](),controller[_0xe5a4('0xb')]);router[_0xe5a4('0xc')]('/:id',auth[_0xe5a4('0xa')](),controller[_0xe5a4('0xd')]);router[_0xe5a4('0xc')]('/:id/download',auth[_0xe5a4('0xa')](),controller[_0xe5a4('0xe')]);router[_0xe5a4('0xf')]('/',auth[_0xe5a4('0xa')](),controller[_0xe5a4('0x10')]);router[_0xe5a4('0x11')](_0xe5a4('0x12'),auth[_0xe5a4('0xa')](),controller[_0xe5a4('0x13')]);router['delete'](_0xe5a4('0x12'),auth[_0xe5a4('0xa')](),controller[_0xe5a4('0x14')]);module[_0xe5a4('0x15')]=router; \ No newline at end of file +var _0xcbfd=['index','/:id','/:id/download','download','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','get','isAuthenticated'];(function(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0xcbfd,0x196));var _0xdcbf=function(_0x5e009c,_0x1c221a){_0x5e009c=_0x5e009c-0x0;var _0x520017=_0xcbfd[_0x5e009c];return _0x520017;};'use strict';var multer=require(_0xdcbf('0x0'));var util=require(_0xdcbf('0x1'));var path=require(_0xdcbf('0x2'));var timeout=require(_0xdcbf('0x3'));var express=require(_0xdcbf('0x4'));var router=express[_0xdcbf('0x5')]();var fs_extra=require(_0xdcbf('0x6'));var auth=require(_0xdcbf('0x7'));var interaction=require(_0xdcbf('0x8'));var config=require('../../config/environment');var controller=require(_0xdcbf('0x9'));router[_0xdcbf('0xa')]('/',auth[_0xdcbf('0xb')](),controller[_0xdcbf('0xc')]);router[_0xdcbf('0xa')](_0xdcbf('0xd'),auth[_0xdcbf('0xb')](),controller['show']);router[_0xdcbf('0xa')](_0xdcbf('0xe'),auth['isAuthenticated'](),controller[_0xdcbf('0xf')]);router[_0xdcbf('0x10')]('/',auth[_0xdcbf('0xb')](),controller['create']);router[_0xdcbf('0x11')](_0xdcbf('0xd'),auth[_0xdcbf('0xb')](),controller[_0xdcbf('0x12')]);router[_0xdcbf('0x13')]('/:id',auth[_0xdcbf('0xb')](),controller[_0xdcbf('0x14')]);module[_0xdcbf('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 02d2e20..e6fd8e9 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 _0xa04e=['BOOLEAN','sequelize','exports','TEXT','STRING'];(function(_0x5c590f,_0x4b5aa4){var _0x52ef41=function(_0x2ef2d7){while(--_0x2ef2d7){_0x5c590f['push'](_0x5c590f['shift']());}};_0x52ef41(++_0x4b5aa4);}(_0xa04e,0x6a));var _0xea04=function(_0x57f590,_0x31e929){_0x57f590=_0x57f590-0x0;var _0x3181dd=_0xa04e[_0x57f590];return _0x3181dd;};'use strict';var Sequelize=require(_0xea04('0x0'));module[_0xea04('0x1')]={'field':{'type':Sequelize[_0xea04('0x2')]},'alias':{'type':Sequelize[_0xea04('0x3')]},'function':{'type':Sequelize[_0xea04('0x3')]},'format':{'type':Sequelize[_0xea04('0x3')]},'groupBy':{'type':Sequelize[_0xea04('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xea04('0x3')]},'custom':{'type':Sequelize[_0xea04('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x1cb4=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x58dc25,_0x49b9d5){var _0x21b0a7=function(_0x38a186){while(--_0x38a186){_0x58dc25['push'](_0x58dc25['shift']());}};_0x21b0a7(++_0x49b9d5);}(_0x1cb4,0x14d));var _0x41cb=function(_0x130ce8,_0x536d2d){_0x130ce8=_0x130ce8-0x0;var _0x3fe325=_0x1cb4[_0x130ce8];return _0x3fe325;};'use strict';var Sequelize=require(_0x41cb('0x0'));module[_0x41cb('0x1')]={'field':{'type':Sequelize[_0x41cb('0x2')]},'alias':{'type':Sequelize[_0x41cb('0x3')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x41cb('0x3')]},'groupBy':{'type':Sequelize[_0x41cb('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x41cb('0x3')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index da28dbc..5e69d0c 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 _0xb6a7=['fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','bulkCreate','body','bulkDestroy','ids','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x52b0b2,_0xf6dbf9){var _0x322769=function(_0x3ad9da){while(--_0x3ad9da){_0x52b0b2['push'](_0x52b0b2['shift']());}};_0x322769(++_0xf6dbf9);}(_0xb6a7,0xf6));var _0x7b6a=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0xb6a7[_0x565ed7];return _0x183ad7;};'use strict';var emlformat=require(_0x7b6a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7b6a('0x1'));var jsonpatch=require(_0x7b6a('0x2'));var rp=require(_0x7b6a('0x3'));var moment=require(_0x7b6a('0x4'));var BPromise=require(_0x7b6a('0x5'));var Mustache=require(_0x7b6a('0x6'));var util=require(_0x7b6a('0x7'));var path=require(_0x7b6a('0x8'));var sox=require(_0x7b6a('0x9'));var csv=require(_0x7b6a('0xa'));var ejs=require(_0x7b6a('0xb'));var fs=require('fs');var fs_extra=require(_0x7b6a('0xc'));var _=require(_0x7b6a('0xd'));var squel=require(_0x7b6a('0xe'));var crypto=require(_0x7b6a('0xf'));var jsforce=require(_0x7b6a('0x10'));var deskjs=require(_0x7b6a('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7b6a('0x12'));var Redis=require(_0x7b6a('0x13'));var authService=require(_0x7b6a('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x7b6a('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7b6a('0x16'))('api');var utils=require(_0x7b6a('0x17'));var config=require(_0x7b6a('0x18'));var licenseUtil=require(_0x7b6a('0x19'));var db=require(_0x7b6a('0x1a'))['db'];function respondWithStatusCode(_0x2dd736,_0x1396c0){_0x1396c0=_0x1396c0||0xcc;return function(_0x513ac6){if(_0x513ac6){return _0x2dd736[_0x7b6a('0x1b')](_0x1396c0);}return _0x2dd736[_0x7b6a('0x1c')](_0x1396c0)[_0x7b6a('0x1d')]();};}function respondWithResult(_0x96e7e4,_0x577410){_0x577410=_0x577410||0xc8;return function(_0xb2f03d){if(_0xb2f03d){return _0x96e7e4[_0x7b6a('0x1c')](_0x577410)[_0x7b6a('0x1e')](_0xb2f03d);}};}function respondWithFilteredResult(_0x55f7bd,_0x2eb663){return function(_0x9a6cae){if(_0x9a6cae){var _0x6543b4=typeof _0x2eb663[_0x7b6a('0x1f')]==='undefined'&&typeof _0x2eb663[_0x7b6a('0x20')]===_0x7b6a('0x21');var _0x20f0ad=_0x9a6cae['count'];var _0x9bbeef=_0x6543b4?0x0:_0x2eb663[_0x7b6a('0x1f')];var _0x5b12ec=_0x6543b4?_0x9a6cae[_0x7b6a('0x22')]:_0x2eb663['offset']+_0x2eb663[_0x7b6a('0x20')];var _0x2cb364;if(_0x5b12ec>=_0x20f0ad){_0x5b12ec=_0x20f0ad;_0x2cb364=0xc8;}else{_0x2cb364=0xce;}_0x55f7bd[_0x7b6a('0x1c')](_0x2cb364);return _0x55f7bd[_0x7b6a('0x23')](_0x7b6a('0x24'),_0x9bbeef+'-'+_0x5b12ec+'/'+_0x20f0ad)[_0x7b6a('0x1e')](_0x9a6cae);}return null;};}function patchUpdates(_0x2bff4a){return function(_0x5d45b1){try{jsonpatch['apply'](_0x5d45b1,_0x2bff4a,!![]);}catch(_0x17eb6a){return BPromise[_0x7b6a('0x25')](_0x17eb6a);}return _0x5d45b1[_0x7b6a('0x26')]();};}function saveUpdates(_0x4f9392,_0x72c364){return function(_0x2b092f){if(_0x2b092f){return _0x2b092f[_0x7b6a('0x27')](_0x4f9392)[_0x7b6a('0x28')](function(_0x584ae0){return _0x584ae0;});}return null;};}function removeEntity(_0x2ddab4,_0xc5e36f){return function(_0x5ec37f){if(_0x5ec37f){return _0x5ec37f[_0x7b6a('0x29')]()['then'](function(){_0x2ddab4[_0x7b6a('0x1c')](0xcc)[_0x7b6a('0x1d')]();});}};}function handleEntityNotFound(_0x52de06,_0x218952){return function(_0xbf66a1){if(!_0xbf66a1){_0x52de06['sendStatus'](0x194);}return _0xbf66a1;};}function handleError(_0x3a59a0,_0x41fe1b){_0x41fe1b=_0x41fe1b||0x1f4;return function(_0x3afda3){logger[_0x7b6a('0x2a')](_0x3afda3[_0x7b6a('0x2b')]);if(_0x3afda3[_0x7b6a('0x2c')]){delete _0x3afda3[_0x7b6a('0x2c')];}_0x3a59a0[_0x7b6a('0x1c')](_0x41fe1b)[_0x7b6a('0x2d')](_0x3afda3);};}exports['index']=function(_0x5731aa,_0x300803){var _0x59d689={},_0x3c9e91={},_0x19e449={'count':0x0,'rows':[]};var _0x588598=_[_0x7b6a('0x2e')](db[_0x7b6a('0x2f')][_0x7b6a('0x30')],function(_0x58f045){return{'name':_0x58f045[_0x7b6a('0x31')],'type':_0x58f045[_0x7b6a('0x32')][_0x7b6a('0x33')]};});_0x3c9e91[_0x7b6a('0x34')]=_[_0x7b6a('0x2e')](_0x588598,_0x7b6a('0x2c'));_0x3c9e91[_0x7b6a('0x35')]=_['keys'](_0x5731aa[_0x7b6a('0x35')]);_0x3c9e91[_0x7b6a('0x36')]=_[_0x7b6a('0x37')](_0x3c9e91['model'],_0x3c9e91[_0x7b6a('0x35')]);_0x59d689[_0x7b6a('0x38')]=_[_0x7b6a('0x37')](_0x3c9e91[_0x7b6a('0x34')],qs[_0x7b6a('0x39')](_0x5731aa[_0x7b6a('0x35')][_0x7b6a('0x39')]));_0x59d689[_0x7b6a('0x38')]=_0x59d689[_0x7b6a('0x38')]['length']?_0x59d689['attributes']:_0x3c9e91[_0x7b6a('0x34')];if(!_0x5731aa['query']['hasOwnProperty']('nolimit')){_0x59d689['limit']=qs['limit'](_0x5731aa['query'][_0x7b6a('0x20')]);_0x59d689[_0x7b6a('0x1f')]=qs['offset'](_0x5731aa[_0x7b6a('0x35')][_0x7b6a('0x1f')]);}_0x59d689[_0x7b6a('0x3a')]=qs[_0x7b6a('0x3b')](_0x5731aa['query'][_0x7b6a('0x3b')]);_0x59d689[_0x7b6a('0x3c')]=qs[_0x7b6a('0x36')](_[_0x7b6a('0x3d')](_0x5731aa[_0x7b6a('0x35')],_0x3c9e91[_0x7b6a('0x36')]),_0x588598);if(_0x5731aa[_0x7b6a('0x35')][_0x7b6a('0x3e')]){_0x59d689['where']=_[_0x7b6a('0x3f')](_0x59d689[_0x7b6a('0x3c')],{'$or':_[_0x7b6a('0x2e')](_0x588598,function(_0x42b366){if(_0x42b366[_0x7b6a('0x32')]!==_0x7b6a('0x40')){var _0xf75a11={};_0xf75a11[_0x42b366[_0x7b6a('0x2c')]]={'$like':'%'+_0x5731aa[_0x7b6a('0x35')][_0x7b6a('0x3e')]+'%'};return _0xf75a11;}})});}_0x59d689=_[_0x7b6a('0x3f')]({},_0x59d689,_0x5731aa[_0x7b6a('0x41')]);var _0x184c13={'where':_0x59d689[_0x7b6a('0x3c')]};return db['AnalyticFieldReport'][_0x7b6a('0x22')](_0x184c13)[_0x7b6a('0x28')](function(_0x3abdaa){_0x19e449[_0x7b6a('0x22')]=_0x3abdaa;if(_0x5731aa[_0x7b6a('0x35')][_0x7b6a('0x42')]){_0x59d689[_0x7b6a('0x43')]=[{'all':!![]}];}return db[_0x7b6a('0x2f')][_0x7b6a('0x44')](_0x59d689);})['then'](function(_0x2be885){_0x19e449[_0x7b6a('0x45')]=_0x2be885;return _0x19e449;})[_0x7b6a('0x28')](respondWithFilteredResult(_0x300803,_0x59d689))[_0x7b6a('0x46')](handleError(_0x300803,null));};exports[_0x7b6a('0x47')]=function(_0x54fe12,_0x11ac65){var _0x5e2331={'raw':![],'where':{'id':_0x54fe12[_0x7b6a('0x48')]['id']}},_0x566434={};_0x566434[_0x7b6a('0x34')]=_[_0x7b6a('0x49')](db[_0x7b6a('0x2f')][_0x7b6a('0x30')]);_0x566434[_0x7b6a('0x35')]=_['keys'](_0x54fe12[_0x7b6a('0x35')]);_0x566434[_0x7b6a('0x36')]=_[_0x7b6a('0x37')](_0x566434['model'],_0x566434[_0x7b6a('0x35')]);_0x5e2331[_0x7b6a('0x38')]=_['intersection'](_0x566434['model'],qs[_0x7b6a('0x39')](_0x54fe12['query'][_0x7b6a('0x39')]));_0x5e2331[_0x7b6a('0x38')]=_0x5e2331[_0x7b6a('0x38')][_0x7b6a('0x4a')]?_0x5e2331[_0x7b6a('0x38')]:_0x566434[_0x7b6a('0x34')];if(_0x54fe12[_0x7b6a('0x35')][_0x7b6a('0x42')]){_0x5e2331[_0x7b6a('0x43')]=[{'all':!![]}];}_0x5e2331=_['merge']({},_0x5e2331,_0x54fe12['options']);return db[_0x7b6a('0x2f')][_0x7b6a('0x4b')](_0x5e2331)[_0x7b6a('0x28')](handleEntityNotFound(_0x11ac65,null))[_0x7b6a('0x28')](respondWithResult(_0x11ac65,null))['catch'](handleError(_0x11ac65,null));};exports[_0x7b6a('0x4c')]=function(_0xcaec43,_0x423e92){return db[_0x7b6a('0x2f')][_0x7b6a('0x4c')](_0xcaec43['body'],{})[_0x7b6a('0x28')](respondWithResult(_0x423e92,0xc9))[_0x7b6a('0x46')](handleError(_0x423e92,null));};exports[_0x7b6a('0x4d')]=function(_0x3ac714,_0x47531b){return db[_0x7b6a('0x2f')][_0x7b6a('0x4d')](_0x3ac714['body'],{'raw':![],'individualHooks':!![]})[_0x7b6a('0x28')](respondWithResult(_0x47531b,0xc9))[_0x7b6a('0x46')](handleError(_0x47531b,null));};exports[_0x7b6a('0x27')]=function(_0x189e87,_0xa21ed3){if(_0x189e87[_0x7b6a('0x4e')]['id']){delete _0x189e87[_0x7b6a('0x4e')]['id'];}return db[_0x7b6a('0x2f')][_0x7b6a('0x4b')]({'where':{'id':_0x189e87[_0x7b6a('0x48')]['id']}})[_0x7b6a('0x28')](handleEntityNotFound(_0xa21ed3,null))['then'](saveUpdates(_0x189e87[_0x7b6a('0x4e')],null))['then'](respondWithResult(_0xa21ed3,null))[_0x7b6a('0x46')](handleError(_0xa21ed3,null));};exports[_0x7b6a('0x29')]=function(_0xa8d595,_0x548408){return db[_0x7b6a('0x2f')][_0x7b6a('0x4b')]({'where':{'id':_0xa8d595[_0x7b6a('0x48')]['id']}})[_0x7b6a('0x28')](handleEntityNotFound(_0x548408,null))['then'](removeEntity(_0x548408,null))['catch'](handleError(_0x548408,null));};exports[_0x7b6a('0x4f')]=function(_0x3d7ede,_0xc93eff){return db[_0x7b6a('0x2f')][_0x7b6a('0x29')]({'where':{'id':_0x3d7ede[_0x7b6a('0x35')][_0x7b6a('0x50')]||[]},'raw':![],'individualHooks':!![]})[_0x7b6a('0x28')](respondWithResult(_0xc93eff,0xcc))[_0x7b6a('0x46')](handleError(_0xc93eff,null));};exports['addFields']=function(_0x2d13f3,_0x2fb96a,_0x936728){return db[_0x7b6a('0x51')][_0x7b6a('0x52')]({'where':{'id':_0x2d13f3[_0x7b6a('0x48')]['id']}})[_0x7b6a('0x28')](handleEntityNotFound(_0x2fb96a,null))[_0x7b6a('0x28')](function(_0x2b4312){if(_0x2b4312){return db[_0x7b6a('0x53')][_0x7b6a('0x54')](function(_0x2f900f){return db['AnalyticFieldReport']['destroy']({'where':{'CustomReportId':_0x2d13f3['params']['id']},'transaction':_0x2f900f})[_0x7b6a('0x28')](function(_0x2a7bd2){var _0x1f40bb=_['map'](_0x2d13f3[_0x7b6a('0x4e')],function(_0x18532e){delete _0x18532e['id'];_0x18532e[_0x7b6a('0x55')]=_0x2d13f3[_0x7b6a('0x48')]['id'];return _0x18532e;});return db[_0x7b6a('0x2f')][_0x7b6a('0x4d')](_0x1f40bb,{'transaction':_0x2f900f});});})['then'](function(){return db[_0x7b6a('0x2f')][_0x7b6a('0x44')]({'where':{'CustomReportId':_0x2d13f3['params']['id']}});});}})['then'](respondWithResult(_0x2fb96a,null))['catch'](handleError(_0x2fb96a,null));}; \ No newline at end of file +var _0xa65b=['findOne','sequelize','transaction','CustomReportId','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','type','key','query','filters','attributes','intersection','model','length','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','fields','merge','find','create','body','bulkCreate','destroy','bulkDestroy','ids','addFields'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xa65b,0x100));var _0xba65=function(_0x1f1856,_0x15aafb){_0x1f1856=_0x1f1856-0x0;var _0x4fd8e9=_0xa65b[_0x1f1856];return _0x4fd8e9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xba65('0x0'));var zipdir=require(_0xba65('0x1'));var jsonpatch=require(_0xba65('0x2'));var rp=require('request-promise');var moment=require(_0xba65('0x3'));var BPromise=require(_0xba65('0x4'));var Mustache=require(_0xba65('0x5'));var util=require(_0xba65('0x6'));var path=require(_0xba65('0x7'));var sox=require(_0xba65('0x8'));var csv=require(_0xba65('0x9'));var ejs=require(_0xba65('0xa'));var fs=require('fs');var fs_extra=require(_0xba65('0xb'));var _=require(_0xba65('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xba65('0xd'));var deskjs=require(_0xba65('0xe'));var toCsv=require(_0xba65('0x9'));var querystring=require(_0xba65('0xf'));var Papa=require(_0xba65('0x10'));var Redis=require(_0xba65('0x11'));var authService=require(_0xba65('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xba65('0x13'));var hardwareService=require(_0xba65('0x14'));var logger=require(_0xba65('0x15'))('api');var utils=require(_0xba65('0x16'));var config=require(_0xba65('0x17'));var licenseUtil=require(_0xba65('0x18'));var db=require(_0xba65('0x19'))['db'];function respondWithStatusCode(_0x389e43,_0x26a240){_0x26a240=_0x26a240||0xcc;return function(_0x339853){if(_0x339853){return _0x389e43[_0xba65('0x1a')](_0x26a240);}return _0x389e43['status'](_0x26a240)[_0xba65('0x1b')]();};}function respondWithResult(_0x1a68a8,_0x377c72){_0x377c72=_0x377c72||0xc8;return function(_0x1b2bdf){if(_0x1b2bdf){return _0x1a68a8[_0xba65('0x1c')](_0x377c72)[_0xba65('0x1d')](_0x1b2bdf);}};}function respondWithFilteredResult(_0x16cd46,_0x51f949){return function(_0x94f768){if(_0x94f768){var _0x125083=typeof _0x51f949[_0xba65('0x1e')]==='undefined'&&typeof _0x51f949[_0xba65('0x1f')]==='undefined';var _0x10dfc4=_0x94f768[_0xba65('0x20')];var _0x477a42=_0x125083?0x0:_0x51f949[_0xba65('0x1e')];var _0x52fc02=_0x125083?_0x94f768['count']:_0x51f949['offset']+_0x51f949[_0xba65('0x1f')];var _0x5d937e;if(_0x52fc02>=_0x10dfc4){_0x52fc02=_0x10dfc4;_0x5d937e=0xc8;}else{_0x5d937e=0xce;}_0x16cd46[_0xba65('0x1c')](_0x5d937e);return _0x16cd46[_0xba65('0x21')](_0xba65('0x22'),_0x477a42+'-'+_0x52fc02+'/'+_0x10dfc4)[_0xba65('0x1d')](_0x94f768);}return null;};}function patchUpdates(_0x54f9bf){return function(_0x31374e){try{jsonpatch[_0xba65('0x23')](_0x31374e,_0x54f9bf,!![]);}catch(_0xb02352){return BPromise[_0xba65('0x24')](_0xb02352);}return _0x31374e['save']();};}function saveUpdates(_0x4900dc,_0x2ebf8a){return function(_0x34173d){if(_0x34173d){return _0x34173d[_0xba65('0x25')](_0x4900dc)[_0xba65('0x26')](function(_0x215e99){return _0x215e99;});}return null;};}function removeEntity(_0x1ea2bb,_0x516f86){return function(_0xe427ad){if(_0xe427ad){return _0xe427ad['destroy']()[_0xba65('0x26')](function(){_0x1ea2bb['status'](0xcc)[_0xba65('0x1b')]();});}};}function handleEntityNotFound(_0x3dbd7d,_0x4d2a63){return function(_0x5eaa88){if(!_0x5eaa88){_0x3dbd7d[_0xba65('0x1a')](0x194);}return _0x5eaa88;};}function handleError(_0x58fc2f,_0x1b26f1){_0x1b26f1=_0x1b26f1||0x1f4;return function(_0x4452bf){logger[_0xba65('0x27')](_0x4452bf[_0xba65('0x28')]);if(_0x4452bf[_0xba65('0x29')]){delete _0x4452bf[_0xba65('0x29')];}_0x58fc2f[_0xba65('0x1c')](_0x1b26f1)[_0xba65('0x2a')](_0x4452bf);};}exports[_0xba65('0x2b')]=function(_0x1d5be0,_0x4a6604){var _0x2925f6={},_0x5d4e08={},_0x4f7bc9={'count':0x0,'rows':[]};var _0x1efc84=_[_0xba65('0x2c')](db[_0xba65('0x2d')][_0xba65('0x2e')],function(_0xf6618c){return{'name':_0xf6618c['fieldName'],'type':_0xf6618c[_0xba65('0x2f')][_0xba65('0x30')]};});_0x5d4e08['model']=_[_0xba65('0x2c')](_0x1efc84,_0xba65('0x29'));_0x5d4e08['query']=_['keys'](_0x1d5be0[_0xba65('0x31')]);_0x5d4e08[_0xba65('0x32')]=_['intersection'](_0x5d4e08['model'],_0x5d4e08[_0xba65('0x31')]);_0x2925f6[_0xba65('0x33')]=_[_0xba65('0x34')](_0x5d4e08[_0xba65('0x35')],qs['fields'](_0x1d5be0[_0xba65('0x31')]['fields']));_0x2925f6[_0xba65('0x33')]=_0x2925f6[_0xba65('0x33')][_0xba65('0x36')]?_0x2925f6[_0xba65('0x33')]:_0x5d4e08[_0xba65('0x35')];if(!_0x1d5be0[_0xba65('0x31')][_0xba65('0x37')]('nolimit')){_0x2925f6['limit']=qs[_0xba65('0x1f')](_0x1d5be0[_0xba65('0x31')][_0xba65('0x1f')]);_0x2925f6['offset']=qs['offset'](_0x1d5be0[_0xba65('0x31')]['offset']);}_0x2925f6[_0xba65('0x38')]=qs['sort'](_0x1d5be0[_0xba65('0x31')][_0xba65('0x39')]);_0x2925f6['where']=qs[_0xba65('0x32')](_[_0xba65('0x3a')](_0x1d5be0['query'],_0x5d4e08[_0xba65('0x32')]),_0x1efc84);if(_0x1d5be0[_0xba65('0x31')][_0xba65('0x3b')]){_0x2925f6[_0xba65('0x3c')]=_['merge'](_0x2925f6['where'],{'$or':_['map'](_0x1efc84,function(_0x42b5f4){if(_0x42b5f4[_0xba65('0x2f')]!==_0xba65('0x3d')){var _0x38ef4d={};_0x38ef4d[_0x42b5f4[_0xba65('0x29')]]={'$like':'%'+_0x1d5be0[_0xba65('0x31')][_0xba65('0x3b')]+'%'};return _0x38ef4d;}})});}_0x2925f6=_['merge']({},_0x2925f6,_0x1d5be0[_0xba65('0x3e')]);var _0x565692={'where':_0x2925f6['where']};return db[_0xba65('0x2d')][_0xba65('0x20')](_0x565692)['then'](function(_0x162aca){_0x4f7bc9[_0xba65('0x20')]=_0x162aca;if(_0x1d5be0[_0xba65('0x31')][_0xba65('0x3f')]){_0x2925f6[_0xba65('0x40')]=[{'all':!![]}];}return db[_0xba65('0x2d')][_0xba65('0x41')](_0x2925f6);})['then'](function(_0x481c35){_0x4f7bc9[_0xba65('0x42')]=_0x481c35;return _0x4f7bc9;})['then'](respondWithFilteredResult(_0x4a6604,_0x2925f6))[_0xba65('0x43')](handleError(_0x4a6604,null));};exports['show']=function(_0x47bf4a,_0x4c0154){var _0x34ac80={'raw':![],'where':{'id':_0x47bf4a[_0xba65('0x44')]['id']}},_0x27e6a5={};_0x27e6a5[_0xba65('0x35')]=_[_0xba65('0x45')](db['AnalyticFieldReport'][_0xba65('0x2e')]);_0x27e6a5[_0xba65('0x31')]=_[_0xba65('0x45')](_0x47bf4a['query']);_0x27e6a5['filters']=_[_0xba65('0x34')](_0x27e6a5[_0xba65('0x35')],_0x27e6a5[_0xba65('0x31')]);_0x34ac80[_0xba65('0x33')]=_[_0xba65('0x34')](_0x27e6a5[_0xba65('0x35')],qs[_0xba65('0x46')](_0x47bf4a[_0xba65('0x31')][_0xba65('0x46')]));_0x34ac80['attributes']=_0x34ac80[_0xba65('0x33')][_0xba65('0x36')]?_0x34ac80[_0xba65('0x33')]:_0x27e6a5[_0xba65('0x35')];if(_0x47bf4a[_0xba65('0x31')][_0xba65('0x3f')]){_0x34ac80[_0xba65('0x40')]=[{'all':!![]}];}_0x34ac80=_[_0xba65('0x47')]({},_0x34ac80,_0x47bf4a[_0xba65('0x3e')]);return db['AnalyticFieldReport'][_0xba65('0x48')](_0x34ac80)[_0xba65('0x26')](handleEntityNotFound(_0x4c0154,null))[_0xba65('0x26')](respondWithResult(_0x4c0154,null))[_0xba65('0x43')](handleError(_0x4c0154,null));};exports['create']=function(_0x34faa6,_0x3ce225){return db[_0xba65('0x2d')][_0xba65('0x49')](_0x34faa6[_0xba65('0x4a')],{})[_0xba65('0x26')](respondWithResult(_0x3ce225,0xc9))[_0xba65('0x43')](handleError(_0x3ce225,null));};exports[_0xba65('0x4b')]=function(_0x4a2358,_0x5d2bb0){return db[_0xba65('0x2d')][_0xba65('0x4b')](_0x4a2358['body'],{'raw':![],'individualHooks':!![]})[_0xba65('0x26')](respondWithResult(_0x5d2bb0,0xc9))[_0xba65('0x43')](handleError(_0x5d2bb0,null));};exports[_0xba65('0x25')]=function(_0x4ae21d,_0x3fba91){if(_0x4ae21d[_0xba65('0x4a')]['id']){delete _0x4ae21d[_0xba65('0x4a')]['id'];}return db[_0xba65('0x2d')][_0xba65('0x48')]({'where':{'id':_0x4ae21d[_0xba65('0x44')]['id']}})[_0xba65('0x26')](handleEntityNotFound(_0x3fba91,null))[_0xba65('0x26')](saveUpdates(_0x4ae21d[_0xba65('0x4a')],null))['then'](respondWithResult(_0x3fba91,null))[_0xba65('0x43')](handleError(_0x3fba91,null));};exports[_0xba65('0x4c')]=function(_0x423444,_0x27b198){return db['AnalyticFieldReport'][_0xba65('0x48')]({'where':{'id':_0x423444[_0xba65('0x44')]['id']}})['then'](handleEntityNotFound(_0x27b198,null))[_0xba65('0x26')](removeEntity(_0x27b198,null))['catch'](handleError(_0x27b198,null));};exports[_0xba65('0x4d')]=function(_0x1854e3,_0x1572fd){return db[_0xba65('0x2d')]['destroy']({'where':{'id':_0x1854e3['query'][_0xba65('0x4e')]||[]},'raw':![],'individualHooks':!![]})[_0xba65('0x26')](respondWithResult(_0x1572fd,0xcc))[_0xba65('0x43')](handleError(_0x1572fd,null));};exports[_0xba65('0x4f')]=function(_0x2c85f3,_0x40ccd9,_0x526fcf){return db['AnalyticCustomReport'][_0xba65('0x50')]({'where':{'id':_0x2c85f3[_0xba65('0x44')]['id']}})[_0xba65('0x26')](handleEntityNotFound(_0x40ccd9,null))[_0xba65('0x26')](function(_0x33dfe6){if(_0x33dfe6){return db[_0xba65('0x51')][_0xba65('0x52')](function(_0x547231){return db[_0xba65('0x2d')][_0xba65('0x4c')]({'where':{'CustomReportId':_0x2c85f3[_0xba65('0x44')]['id']},'transaction':_0x547231})[_0xba65('0x26')](function(_0x33bd98){var _0x350129=_[_0xba65('0x2c')](_0x2c85f3[_0xba65('0x4a')],function(_0x2021ac){delete _0x2021ac['id'];_0x2021ac[_0xba65('0x53')]=_0x2c85f3[_0xba65('0x44')]['id'];return _0x2021ac;});return db['AnalyticFieldReport'][_0xba65('0x4b')](_0x350129,{'transaction':_0x547231});});})[_0xba65('0x26')](function(){return db[_0xba65('0x2d')][_0xba65('0x41')]({'where':{'CustomReportId':_0x2c85f3[_0xba65('0x44')]['id']}});});}})[_0xba65('0x26')](respondWithResult(_0x40ccd9,null))[_0xba65('0x43')](handleError(_0x40ccd9,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 8bfb1f4..5136022 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 _0x1346=['path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x36a7cf,_0x2dfa31){var _0x4862ec=function(_0x4b8fd1){while(--_0x4b8fd1){_0x36a7cf['push'](_0x36a7cf['shift']());}};_0x4862ec(++_0x2dfa31);}(_0x1346,0xf6));var _0x6134=function(_0xf44ff2,_0x5e9e66){_0xf44ff2=_0xf44ff2-0x0;var _0x241096=_0x1346[_0xf44ff2];return _0x241096;};'use strict';var _=require(_0x6134('0x0'));var util=require(_0x6134('0x1'));var logger=require(_0x6134('0x2'))('api');var moment=require(_0x6134('0x3'));var BPromise=require(_0x6134('0x4'));var rp=require(_0x6134('0x5'));var fs=require('fs');var path=require(_0x6134('0x6'));var rimraf=require(_0x6134('0x7'));var config=require(_0x6134('0x8'));var attributes=require(_0x6134('0x9'));module[_0x6134('0xa')]=function(_0x50e981,_0x4b8d61){return _0x50e981[_0x6134('0xb')](_0x6134('0xc'),attributes,{'tableName':_0x6134('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x736e=['moment','bluebird','request-promise','path','../../config/environment','./analyticFieldReport.attributes','exports','define','analytics_report_fields','lodash','../../config/logger','api'];(function(_0x198615,_0x45040a){var _0x435f7a=function(_0x49461d){while(--_0x49461d){_0x198615['push'](_0x198615['shift']());}};_0x435f7a(++_0x45040a);}(_0x736e,0xb1));var _0xe736=function(_0x54f474,_0x5e0d7c){_0x54f474=_0x54f474-0x0;var _0x513689=_0x736e[_0x54f474];return _0x513689;};'use strict';var _=require(_0xe736('0x0'));var util=require('util');var logger=require(_0xe736('0x1'))(_0xe736('0x2'));var moment=require(_0xe736('0x3'));var BPromise=require(_0xe736('0x4'));var rp=require(_0xe736('0x5'));var fs=require('fs');var path=require(_0xe736('0x6'));var rimraf=require('rimraf');var config=require(_0xe736('0x7'));var attributes=require(_0xe736('0x8'));module[_0xe736('0x9')]=function(_0x5b1093,_0x4b592f){return _0x5b1093[_0xe736('0xa')]('AnalyticFieldReport',attributes,{'tableName':_0xe736('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js index 931db44..88fce38 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 _0x7a1f=['client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise'];(function(_0x2034d2,_0x59d479){var _0x2b99af=function(_0x322771){while(--_0x322771){_0x2034d2['push'](_0x2034d2['shift']());}};_0x2b99af(++_0x59d479);}(_0x7a1f,0x134));var _0xf7a1=function(_0x11946c,_0x12152c){_0x11946c=_0x11946c-0x0;var _0x383935=_0x7a1f[_0x11946c];return _0x383935;};'use strict';var _=require(_0xf7a1('0x0'));var util=require(_0xf7a1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf7a1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf7a1('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf7a1('0x4'))('rpc');var config=require(_0xf7a1('0x5'));var jayson=require(_0xf7a1('0x6'));var client=jayson[_0xf7a1('0x7')][_0xf7a1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xe76d88,_0x169f3c,_0x4ae197){return new BPromise(function(_0x9ed9c2,_0x104700){return client[_0xf7a1('0x9')](_0xe76d88,_0x4ae197)[_0xf7a1('0xa')](function(_0x234691){logger[_0xf7a1('0xb')](_0xf7a1('0xc'),_0x169f3c,_0xf7a1('0xd'));logger['debug'](_0xf7a1('0xe'),_0x169f3c,'request\x20sent',JSON[_0xf7a1('0xf')](_0x234691));if(_0x234691['error']){if(_0x234691[_0xf7a1('0x10')][_0xf7a1('0x11')]===0x1f4){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x169f3c,_0x234691[_0xf7a1('0x10')][_0xf7a1('0x12')]);return _0x104700(_0x234691['error']['message']);}logger[_0xf7a1('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x169f3c,_0x234691[_0xf7a1('0x10')][_0xf7a1('0x12')]);return _0x9ed9c2(_0x234691['error'][_0xf7a1('0x12')]);}else{logger[_0xf7a1('0xb')](_0xf7a1('0xc'),_0x169f3c,_0xf7a1('0xd'));_0x9ed9c2(_0x234691[_0xf7a1('0x13')][_0xf7a1('0x12')]);}})[_0xf7a1('0x14')](function(_0x28a43e){logger[_0xf7a1('0x10')](_0xf7a1('0xc'),_0x169f3c,_0x28a43e);_0x104700(_0x28a43e);});});} \ No newline at end of file +var _0xf456=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird'];(function(_0x34bf97,_0xc60f9d){var _0x292719=function(_0x31354e){while(--_0x31354e){_0x34bf97['push'](_0x34bf97['shift']());}};_0x292719(++_0xc60f9d);}(_0xf456,0x1ac));var _0x6f45=function(_0x34a83d,_0x31945f){_0x34a83d=_0x34a83d-0x0;var _0x3887b3=_0xf456[_0x34a83d];return _0x3887b3;};'use strict';var _=require(_0x6f45('0x0'));var util=require(_0x6f45('0x1'));var moment=require(_0x6f45('0x2'));var BPromise=require(_0x6f45('0x3'));var rs=require(_0x6f45('0x4'));var fs=require('fs');var Redis=require(_0x6f45('0x5'));var db=require(_0x6f45('0x6'))['db'];var utils=require(_0x6f45('0x7'));var logger=require('../../config/logger')(_0x6f45('0x8'));var config=require('../../config/environment');var jayson=require(_0x6f45('0x9'));var client=jayson[_0x6f45('0xa')][_0x6f45('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x59611f,_0x4ada66,_0x4b0790){return new BPromise(function(_0x3b72d8,_0x118480){return client[_0x6f45('0xc')](_0x59611f,_0x4b0790)['then'](function(_0x1d541c){logger['info'](_0x6f45('0xd'),_0x4ada66,_0x6f45('0xe'));logger[_0x6f45('0xf')](_0x6f45('0x10'),_0x4ada66,'request\x20sent',JSON[_0x6f45('0x11')](_0x1d541c));if(_0x1d541c[_0x6f45('0x12')]){if(_0x1d541c['error'][_0x6f45('0x13')]===0x1f4){logger[_0x6f45('0x12')](_0x6f45('0xd'),_0x4ada66,_0x1d541c[_0x6f45('0x12')][_0x6f45('0x14')]);return _0x118480(_0x1d541c[_0x6f45('0x12')][_0x6f45('0x14')]);}logger[_0x6f45('0x12')](_0x6f45('0xd'),_0x4ada66,_0x1d541c['error']['message']);return _0x3b72d8(_0x1d541c[_0x6f45('0x12')]['message']);}else{logger[_0x6f45('0x15')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4ada66,_0x6f45('0xe'));_0x3b72d8(_0x1d541c[_0x6f45('0x16')][_0x6f45('0x14')]);}})[_0x6f45('0x17')](function(_0x471606){logger[_0x6f45('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4ada66,_0x471606);_0x118480(_0x471606);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index cb74356..3199693 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(_0x276999,_0x786d6f){var _0x4ac783=function(_0x38ecc2){while(--_0x38ecc2){_0x276999['push'](_0x276999['shift']());}};_0x4ac783(++_0x786d6f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'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(_0x3d6445,_0x5cf50c){var _0xc0b055=function(_0x52bb57){while(--_0x52bb57){_0x3d6445['push'](_0x3d6445['shift']());}};_0xc0b055(++_0x5cf50c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('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 021e770..871d90c 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 _0xd8b0=['STRING','sequelize','exports','TEXT'];(function(_0x2c341e,_0x414d11){var _0x43c1e8=function(_0xe783f3){while(--_0xe783f3){_0x2c341e['push'](_0x2c341e['shift']());}};_0x43c1e8(++_0x414d11);}(_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')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x0d8b('0x2')]},'description':{'type':Sequelize[_0x0d8b('0x3')]}}; \ No newline at end of file +var _0x9bb4=['STRING','name','TEXT','sequelize','exports'];(function(_0x3d2b19,_0x349a5b){var _0x29769b=function(_0x5048ad){while(--_0x5048ad){_0x3d2b19['push'](_0x3d2b19['shift']());}};_0x29769b(++_0x349a5b);}(_0x9bb4,0xd5));var _0x49bb=function(_0x3f47f0,_0x176e20){_0x3f47f0=_0x3f47f0-0x0;var _0x9aab84=_0x9bb4[_0x3f47f0];return _0x9aab84;};'use strict';var Sequelize=require(_0x49bb('0x0'));module[_0x49bb('0x1')]={'name':{'type':Sequelize[_0x49bb('0x2')],'allowNull':![],'unique':_0x49bb('0x3')},'table':{'type':Sequelize[_0x49bb('0x2')]},'metric':{'type':Sequelize[_0x49bb('0x4')]},'description':{'type':Sequelize[_0x49bb('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 7d082a8..56a7ec8 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 _0x8d0e=['then','get','Metrics','UserProfileResource','end','sendStatus','error','stack','name','send','AnalyticMetric','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','fields','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','offset','count','set','apply','reject','save','update','destroy'];(function(_0x1f88d4,_0x3f2a9c){var _0x31970d=function(_0x439a8a){while(--_0x439a8a){_0x1f88d4['push'](_0x1f88d4['shift']());}};_0x31970d(++_0x3f2a9c);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x1fa400,_0x850a42){_0x1fa400=_0x1fa400-0x0;var _0x65cddc=_0x8d0e[_0x1fa400];return _0x65cddc;};'use strict';var emlformat=require(_0xe8d0('0x0'));var rimraf=require(_0xe8d0('0x1'));var zipdir=require(_0xe8d0('0x2'));var jsonpatch=require(_0xe8d0('0x3'));var rp=require(_0xe8d0('0x4'));var moment=require(_0xe8d0('0x5'));var BPromise=require(_0xe8d0('0x6'));var Mustache=require(_0xe8d0('0x7'));var util=require(_0xe8d0('0x8'));var path=require('path');var sox=require(_0xe8d0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe8d0('0xa'));var _=require(_0xe8d0('0xb'));var squel=require(_0xe8d0('0xc'));var crypto=require(_0xe8d0('0xd'));var jsforce=require(_0xe8d0('0xe'));var deskjs=require(_0xe8d0('0xf'));var toCsv=require(_0xe8d0('0x10'));var querystring=require(_0xe8d0('0x11'));var Papa=require('papaparse');var Redis=require(_0xe8d0('0x12'));var authService=require(_0xe8d0('0x13'));var qs=require(_0xe8d0('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe8d0('0x15'))(_0xe8d0('0x16'));var utils=require(_0xe8d0('0x17'));var config=require(_0xe8d0('0x18'));var licenseUtil=require(_0xe8d0('0x19'));var db=require(_0xe8d0('0x1a'))['db'];function respondWithStatusCode(_0x5934b2,_0x38fac0){_0x38fac0=_0x38fac0||0xcc;return function(_0x15b9e5){if(_0x15b9e5){return _0x5934b2['sendStatus'](_0x38fac0);}return _0x5934b2[_0xe8d0('0x1b')](_0x38fac0)['end']();};}function respondWithResult(_0x59b4b7,_0x90a1ea){_0x90a1ea=_0x90a1ea||0xc8;return function(_0x2aa906){if(_0x2aa906){return _0x59b4b7[_0xe8d0('0x1b')](_0x90a1ea)[_0xe8d0('0x1c')](_0x2aa906);}};}function respondWithFilteredResult(_0x15d3a1,_0x7151c6){return function(_0x52818a){if(_0x52818a){var _0x6ccffa=typeof _0x7151c6['offset']===_0xe8d0('0x1d')&&typeof _0x7151c6[_0xe8d0('0x1e')]===_0xe8d0('0x1d');var _0x4d1db4=_0x52818a['count'];var _0x47c67a=_0x6ccffa?0x0:_0x7151c6[_0xe8d0('0x1f')];var _0x384854=_0x6ccffa?_0x52818a[_0xe8d0('0x20')]:_0x7151c6[_0xe8d0('0x1f')]+_0x7151c6[_0xe8d0('0x1e')];var _0x588133;if(_0x384854>=_0x4d1db4){_0x384854=_0x4d1db4;_0x588133=0xc8;}else{_0x588133=0xce;}_0x15d3a1[_0xe8d0('0x1b')](_0x588133);return _0x15d3a1[_0xe8d0('0x21')]('Content-Range',_0x47c67a+'-'+_0x384854+'/'+_0x4d1db4)['json'](_0x52818a);}return null;};}function patchUpdates(_0x554402){return function(_0x384a60){try{jsonpatch[_0xe8d0('0x22')](_0x384a60,_0x554402,!![]);}catch(_0x25363b){return BPromise[_0xe8d0('0x23')](_0x25363b);}return _0x384a60[_0xe8d0('0x24')]();};}function saveUpdates(_0x23a945,_0x1bd25c){return function(_0x28a6b5){if(_0x28a6b5){return _0x28a6b5[_0xe8d0('0x25')](_0x23a945)['then'](function(_0xed8f2e){return _0xed8f2e;});}return null;};}function removeEntity(_0x9f747,_0x572c25){return function(_0x106614){if(_0x106614){return _0x106614[_0xe8d0('0x26')]()[_0xe8d0('0x27')](function(){var _0xd86c76=_0x106614[_0xe8d0('0x28')]({'plain':!![]});var _0x149dfd=_0xe8d0('0x29');return db[_0xe8d0('0x2a')][_0xe8d0('0x26')]({'where':{'type':_0x149dfd,'resourceId':_0xd86c76['id']}})[_0xe8d0('0x27')](function(){return _0x106614;});})[_0xe8d0('0x27')](function(){_0x9f747['status'](0xcc)[_0xe8d0('0x2b')]();});}};}function handleEntityNotFound(_0x26dd52,_0x10dec2){return function(_0x486f49){if(!_0x486f49){_0x26dd52[_0xe8d0('0x2c')](0x194);}return _0x486f49;};}function handleError(_0x343b08,_0x526240){_0x526240=_0x526240||0x1f4;return function(_0x1519e2){logger[_0xe8d0('0x2d')](_0x1519e2[_0xe8d0('0x2e')]);if(_0x1519e2[_0xe8d0('0x2f')]){delete _0x1519e2[_0xe8d0('0x2f')];}_0x343b08['status'](_0x526240)[_0xe8d0('0x30')](_0x1519e2);};}exports['index']=function(_0x5d3276,_0x50ad3c){var _0x547a2b={},_0x13cd4c={},_0x36ccec={'count':0x0,'rows':[]};var _0x5151fa=_['map'](db[_0xe8d0('0x31')]['rawAttributes'],function(_0x3b5d31){return{'name':_0x3b5d31[_0xe8d0('0x32')],'type':_0x3b5d31[_0xe8d0('0x33')][_0xe8d0('0x34')]};});_0x13cd4c[_0xe8d0('0x35')]=_['map'](_0x5151fa,_0xe8d0('0x2f'));_0x13cd4c[_0xe8d0('0x36')]=_[_0xe8d0('0x37')](_0x5d3276[_0xe8d0('0x36')]);_0x13cd4c['filters']=_[_0xe8d0('0x38')](_0x13cd4c[_0xe8d0('0x35')],_0x13cd4c['query']);_0x547a2b[_0xe8d0('0x39')]=_['intersection'](_0x13cd4c[_0xe8d0('0x35')],qs['fields'](_0x5d3276[_0xe8d0('0x36')]['fields']));_0x547a2b[_0xe8d0('0x39')]=_0x547a2b[_0xe8d0('0x39')][_0xe8d0('0x3a')]?_0x547a2b[_0xe8d0('0x39')]:_0x13cd4c['model'];if(!_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x3b')](_0xe8d0('0x3c'))){_0x547a2b['limit']=qs[_0xe8d0('0x1e')](_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x1e')]);_0x547a2b[_0xe8d0('0x1f')]=qs[_0xe8d0('0x1f')](_0x5d3276['query'][_0xe8d0('0x1f')]);}_0x547a2b[_0xe8d0('0x3d')]=qs[_0xe8d0('0x3e')](_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x3e')]);_0x547a2b[_0xe8d0('0x3f')]=qs[_0xe8d0('0x40')](_[_0xe8d0('0x41')](_0x5d3276['query'],_0x13cd4c['filters']),_0x5151fa);if(_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x42')]){_0x547a2b[_0xe8d0('0x3f')]=_[_0xe8d0('0x43')](_0x547a2b[_0xe8d0('0x3f')],{'$or':_['map'](_0x5151fa,function(_0x2e4362){if(_0x2e4362['type']!==_0xe8d0('0x44')){var _0x458294={};_0x458294[_0x2e4362[_0xe8d0('0x2f')]]={'$like':'%'+_0x5d3276['query'][_0xe8d0('0x42')]+'%'};return _0x458294;}})});}_0x547a2b=_[_0xe8d0('0x43')]({},_0x547a2b,_0x5d3276[_0xe8d0('0x45')]);var _0x230a90={'where':_0x547a2b[_0xe8d0('0x3f')]};return db['AnalyticMetric']['count'](_0x230a90)['then'](function(_0x4cf0da){_0x36ccec[_0xe8d0('0x20')]=_0x4cf0da;if(_0x5d3276['query'][_0xe8d0('0x46')]){_0x547a2b[_0xe8d0('0x47')]=[{'all':!![]}];}return db[_0xe8d0('0x31')][_0xe8d0('0x48')](_0x547a2b);})[_0xe8d0('0x27')](function(_0x1156da){_0x36ccec[_0xe8d0('0x49')]=_0x1156da;return _0x36ccec;})[_0xe8d0('0x27')](respondWithFilteredResult(_0x50ad3c,_0x547a2b))['catch'](handleError(_0x50ad3c,null));};exports[_0xe8d0('0x4a')]=function(_0x1da8b2,_0x4a3740){var _0x4bcdff={'raw':!![],'where':{'id':_0x1da8b2[_0xe8d0('0x4b')]['id']}},_0x3825a1={};_0x3825a1[_0xe8d0('0x35')]=_['keys'](db[_0xe8d0('0x31')][_0xe8d0('0x4c')]);_0x3825a1['query']=_[_0xe8d0('0x37')](_0x1da8b2[_0xe8d0('0x36')]);_0x3825a1['filters']=_[_0xe8d0('0x38')](_0x3825a1[_0xe8d0('0x35')],_0x3825a1[_0xe8d0('0x36')]);_0x4bcdff[_0xe8d0('0x39')]=_[_0xe8d0('0x38')](_0x3825a1[_0xe8d0('0x35')],qs[_0xe8d0('0x4d')](_0x1da8b2[_0xe8d0('0x36')]['fields']));_0x4bcdff[_0xe8d0('0x39')]=_0x4bcdff[_0xe8d0('0x39')][_0xe8d0('0x3a')]?_0x4bcdff[_0xe8d0('0x39')]:_0x3825a1[_0xe8d0('0x35')];if(_0x1da8b2[_0xe8d0('0x36')][_0xe8d0('0x46')]){_0x4bcdff[_0xe8d0('0x47')]=[{'all':!![]}];}_0x4bcdff=_[_0xe8d0('0x43')]({},_0x4bcdff,_0x1da8b2[_0xe8d0('0x45')]);return db[_0xe8d0('0x31')][_0xe8d0('0x4e')](_0x4bcdff)['then'](handleEntityNotFound(_0x4a3740,null))[_0xe8d0('0x27')](respondWithResult(_0x4a3740,null))[_0xe8d0('0x4f')](handleError(_0x4a3740,null));};exports[_0xe8d0('0x50')]=function(_0xad7d94,_0x34047c){return db[_0xe8d0('0x31')][_0xe8d0('0x50')](_0xad7d94['body'],{})[_0xe8d0('0x27')](function(_0x424764){var _0x151cf4=_0xad7d94[_0xe8d0('0x51')]['get']({'plain':!![]});if(!_0x151cf4)throw new Error(_0xe8d0('0x52'));if(_0x151cf4['role']===_0xe8d0('0x51')){var _0x382ae9=_0x424764[_0xe8d0('0x28')]({'plain':!![]});var _0x158d24=_0xe8d0('0x29');return db[_0xe8d0('0x53')][_0xe8d0('0x4e')]({'where':{'name':_0x158d24,'userProfileId':_0x151cf4['userProfileId']},'raw':!![]})[_0xe8d0('0x27')](function(_0x55f93d){if(_0x55f93d&&_0x55f93d['autoAssociation']===0x0){return db[_0xe8d0('0x2a')]['create']({'name':_0x382ae9[_0xe8d0('0x2f')],'resourceId':_0x382ae9['id'],'type':_0x55f93d['name'],'sectionId':_0x55f93d['id']},{})[_0xe8d0('0x27')](function(){return _0x424764;});}else{return _0x424764;}})[_0xe8d0('0x4f')](function(_0x13713c){logger[_0xe8d0('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13713c);throw _0x13713c;});}return _0x424764;})[_0xe8d0('0x27')](respondWithResult(_0x34047c,0xc9))[_0xe8d0('0x4f')](handleError(_0x34047c,null));};exports[_0xe8d0('0x25')]=function(_0x2e3f1d,_0x18cc14){if(_0x2e3f1d['body']['id']){delete _0x2e3f1d[_0xe8d0('0x54')]['id'];}return db[_0xe8d0('0x31')][_0xe8d0('0x4e')]({'where':{'id':_0x2e3f1d['params']['id']}})[_0xe8d0('0x27')](handleEntityNotFound(_0x18cc14,null))['then'](saveUpdates(_0x2e3f1d['body'],null))[_0xe8d0('0x27')](respondWithResult(_0x18cc14,null))[_0xe8d0('0x4f')](handleError(_0x18cc14,null));};exports['destroy']=function(_0xcb6ce2,_0x3a8074){return db['AnalyticMetric'][_0xe8d0('0x4e')]({'where':{'id':_0xcb6ce2[_0xe8d0('0x4b')]['id']}})[_0xe8d0('0x27')](handleEntityNotFound(_0x3a8074,null))[_0xe8d0('0x27')](removeEntity(_0x3a8074,null))['catch'](handleError(_0x3a8074,null));}; \ No newline at end of file +var _0x3e74=['status','set','Content-Range','apply','save','update','then','destroy','get','Metrics','sendStatus','stack','name','send','index','map','AnalyticMetric','fieldName','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','sort','where','filters','pick','merge','VIRTUAL','filter','include','findAll','rows','catch','params','rawAttributes','length','includeAll','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','json','undefined','limit','offset','count'];(function(_0x2234d6,_0x46c0da){var _0x71b944=function(_0x2807cf){while(--_0x2807cf){_0x2234d6['push'](_0x2234d6['shift']());}};_0x71b944(++_0x46c0da);}(_0x3e74,0x175));var _0x43e7=function(_0x27c6a6,_0x357076){_0x27c6a6=_0x27c6a6-0x0;var _0x540e85=_0x3e74[_0x27c6a6];return _0x540e85;};'use strict';var emlformat=require(_0x43e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43e7('0x1'));var jsonpatch=require(_0x43e7('0x2'));var rp=require(_0x43e7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x43e7('0x4'));var util=require('util');var path=require(_0x43e7('0x5'));var sox=require(_0x43e7('0x6'));var csv=require(_0x43e7('0x7'));var ejs=require(_0x43e7('0x8'));var fs=require('fs');var fs_extra=require(_0x43e7('0x9'));var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x7'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x43e7('0x14'))['db'];function respondWithStatusCode(_0xc960ea,_0x2718d3){_0x2718d3=_0x2718d3||0xcc;return function(_0x3bb83f){if(_0x3bb83f){return _0xc960ea['sendStatus'](_0x2718d3);}return _0xc960ea['status'](_0x2718d3)[_0x43e7('0x15')]();};}function respondWithResult(_0x21fdd3,_0x44b0bd){_0x44b0bd=_0x44b0bd||0xc8;return function(_0x51b974){if(_0x51b974){return _0x21fdd3['status'](_0x44b0bd)[_0x43e7('0x16')](_0x51b974);}};}function respondWithFilteredResult(_0x14c146,_0x203378){return function(_0x328445){if(_0x328445){var _0x4de324=typeof _0x203378['offset']===_0x43e7('0x17')&&typeof _0x203378[_0x43e7('0x18')]===_0x43e7('0x17');var _0x5d346f=_0x328445['count'];var _0x446986=_0x4de324?0x0:_0x203378[_0x43e7('0x19')];var _0x9037d3=_0x4de324?_0x328445[_0x43e7('0x1a')]:_0x203378[_0x43e7('0x19')]+_0x203378[_0x43e7('0x18')];var _0x619236;if(_0x9037d3>=_0x5d346f){_0x9037d3=_0x5d346f;_0x619236=0xc8;}else{_0x619236=0xce;}_0x14c146[_0x43e7('0x1b')](_0x619236);return _0x14c146[_0x43e7('0x1c')](_0x43e7('0x1d'),_0x446986+'-'+_0x9037d3+'/'+_0x5d346f)[_0x43e7('0x16')](_0x328445);}return null;};}function patchUpdates(_0x177ee1){return function(_0x4b5d64){try{jsonpatch[_0x43e7('0x1e')](_0x4b5d64,_0x177ee1,!![]);}catch(_0x3c6625){return BPromise['reject'](_0x3c6625);}return _0x4b5d64[_0x43e7('0x1f')]();};}function saveUpdates(_0x3e281e,_0x3945bb){return function(_0x28aacc){if(_0x28aacc){return _0x28aacc[_0x43e7('0x20')](_0x3e281e)[_0x43e7('0x21')](function(_0x54a9e7){return _0x54a9e7;});}return null;};}function removeEntity(_0x454359,_0x4eea52){return function(_0x4c9df3){if(_0x4c9df3){return _0x4c9df3[_0x43e7('0x22')]()[_0x43e7('0x21')](function(){var _0x4b2b9f=_0x4c9df3[_0x43e7('0x23')]({'plain':!![]});var _0x4ca5cf=_0x43e7('0x24');return db['UserProfileResource'][_0x43e7('0x22')]({'where':{'type':_0x4ca5cf,'resourceId':_0x4b2b9f['id']}})[_0x43e7('0x21')](function(){return _0x4c9df3;});})[_0x43e7('0x21')](function(){_0x454359[_0x43e7('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52b7b3,_0x805b54){return function(_0x501551){if(!_0x501551){_0x52b7b3[_0x43e7('0x25')](0x194);}return _0x501551;};}function handleError(_0x40dc8f,_0x3565cf){_0x3565cf=_0x3565cf||0x1f4;return function(_0xb1fc63){logger['error'](_0xb1fc63[_0x43e7('0x26')]);if(_0xb1fc63[_0x43e7('0x27')]){delete _0xb1fc63[_0x43e7('0x27')];}_0x40dc8f[_0x43e7('0x1b')](_0x3565cf)[_0x43e7('0x28')](_0xb1fc63);};}exports[_0x43e7('0x29')]=function(_0x2b85a5,_0x31b2a6){var _0x3bf475={},_0x35dbcd={},_0x17df44={'count':0x0,'rows':[]};var _0x19725a=_[_0x43e7('0x2a')](db[_0x43e7('0x2b')]['rawAttributes'],function(_0x238321){return{'name':_0x238321[_0x43e7('0x2c')],'type':_0x238321[_0x43e7('0x2d')][_0x43e7('0x2e')]};});_0x35dbcd[_0x43e7('0x2f')]=_['map'](_0x19725a,_0x43e7('0x27'));_0x35dbcd[_0x43e7('0x30')]=_[_0x43e7('0x31')](_0x2b85a5[_0x43e7('0x30')]);_0x35dbcd['filters']=_['intersection'](_0x35dbcd['model'],_0x35dbcd[_0x43e7('0x30')]);_0x3bf475[_0x43e7('0x32')]=_[_0x43e7('0x33')](_0x35dbcd[_0x43e7('0x2f')],qs[_0x43e7('0x34')](_0x2b85a5[_0x43e7('0x30')]['fields']));_0x3bf475['attributes']=_0x3bf475['attributes']['length']?_0x3bf475['attributes']:_0x35dbcd['model'];if(!_0x2b85a5['query'][_0x43e7('0x35')]('nolimit')){_0x3bf475[_0x43e7('0x18')]=qs[_0x43e7('0x18')](_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x18')]);_0x3bf475[_0x43e7('0x19')]=qs[_0x43e7('0x19')](_0x2b85a5[_0x43e7('0x30')]['offset']);}_0x3bf475['order']=qs['sort'](_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x36')]);_0x3bf475[_0x43e7('0x37')]=qs[_0x43e7('0x38')](_[_0x43e7('0x39')](_0x2b85a5[_0x43e7('0x30')],_0x35dbcd[_0x43e7('0x38')]),_0x19725a);if(_0x2b85a5[_0x43e7('0x30')]['filter']){_0x3bf475[_0x43e7('0x37')]=_[_0x43e7('0x3a')](_0x3bf475['where'],{'$or':_[_0x43e7('0x2a')](_0x19725a,function(_0x4c0c7a){if(_0x4c0c7a[_0x43e7('0x2d')]!==_0x43e7('0x3b')){var _0x1c6f45={};_0x1c6f45[_0x4c0c7a[_0x43e7('0x27')]]={'$like':'%'+_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x3c')]+'%'};return _0x1c6f45;}})});}_0x3bf475=_['merge']({},_0x3bf475,_0x2b85a5['options']);var _0x30dfa9={'where':_0x3bf475[_0x43e7('0x37')]};return db[_0x43e7('0x2b')][_0x43e7('0x1a')](_0x30dfa9)[_0x43e7('0x21')](function(_0x4a4a85){_0x17df44[_0x43e7('0x1a')]=_0x4a4a85;if(_0x2b85a5[_0x43e7('0x30')]['includeAll']){_0x3bf475[_0x43e7('0x3d')]=[{'all':!![]}];}return db['AnalyticMetric'][_0x43e7('0x3e')](_0x3bf475);})['then'](function(_0x3d81ae){_0x17df44[_0x43e7('0x3f')]=_0x3d81ae;return _0x17df44;})[_0x43e7('0x21')](respondWithFilteredResult(_0x31b2a6,_0x3bf475))[_0x43e7('0x40')](handleError(_0x31b2a6,null));};exports['show']=function(_0x47d6a1,_0x103393){var _0x40c509={'raw':!![],'where':{'id':_0x47d6a1[_0x43e7('0x41')]['id']}},_0xe979b5={};_0xe979b5['model']=_['keys'](db['AnalyticMetric'][_0x43e7('0x42')]);_0xe979b5['query']=_[_0x43e7('0x31')](_0x47d6a1['query']);_0xe979b5['filters']=_[_0x43e7('0x33')](_0xe979b5['model'],_0xe979b5[_0x43e7('0x30')]);_0x40c509[_0x43e7('0x32')]=_[_0x43e7('0x33')](_0xe979b5[_0x43e7('0x2f')],qs['fields'](_0x47d6a1[_0x43e7('0x30')][_0x43e7('0x34')]));_0x40c509[_0x43e7('0x32')]=_0x40c509[_0x43e7('0x32')][_0x43e7('0x43')]?_0x40c509[_0x43e7('0x32')]:_0xe979b5['model'];if(_0x47d6a1['query'][_0x43e7('0x44')]){_0x40c509[_0x43e7('0x3d')]=[{'all':!![]}];}_0x40c509=_[_0x43e7('0x3a')]({},_0x40c509,_0x47d6a1['options']);return db['AnalyticMetric']['find'](_0x40c509)[_0x43e7('0x21')](handleEntityNotFound(_0x103393,null))[_0x43e7('0x21')](respondWithResult(_0x103393,null))['catch'](handleError(_0x103393,null));};exports[_0x43e7('0x45')]=function(_0x47686e,_0x3c96fe){return db['AnalyticMetric']['create'](_0x47686e['body'],{})['then'](function(_0x214e7e){var _0xe955fc=_0x47686e['user'][_0x43e7('0x23')]({'plain':!![]});if(!_0xe955fc)throw new Error(_0x43e7('0x46'));if(_0xe955fc[_0x43e7('0x47')]===_0x43e7('0x48')){var _0x4a0ce5=_0x214e7e[_0x43e7('0x23')]({'plain':!![]});var _0x483f20='Metrics';return db[_0x43e7('0x49')][_0x43e7('0x4a')]({'where':{'name':_0x483f20,'userProfileId':_0xe955fc[_0x43e7('0x4b')]},'raw':!![]})[_0x43e7('0x21')](function(_0x13503c){if(_0x13503c&&_0x13503c[_0x43e7('0x4c')]===0x0){return db[_0x43e7('0x4d')][_0x43e7('0x45')]({'name':_0x4a0ce5[_0x43e7('0x27')],'resourceId':_0x4a0ce5['id'],'type':_0x13503c[_0x43e7('0x27')],'sectionId':_0x13503c['id']},{})['then'](function(){return _0x214e7e;});}else{return _0x214e7e;}})[_0x43e7('0x40')](function(_0x46c910){logger['error'](_0x43e7('0x4e'),_0x46c910);throw _0x46c910;});}return _0x214e7e;})['then'](respondWithResult(_0x3c96fe,0xc9))[_0x43e7('0x40')](handleError(_0x3c96fe,null));};exports[_0x43e7('0x20')]=function(_0x34e2ec,_0x1f561f){if(_0x34e2ec[_0x43e7('0x4f')]['id']){delete _0x34e2ec['body']['id'];}return db['AnalyticMetric'][_0x43e7('0x4a')]({'where':{'id':_0x34e2ec[_0x43e7('0x41')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x1f561f,null))[_0x43e7('0x21')](saveUpdates(_0x34e2ec[_0x43e7('0x4f')],null))[_0x43e7('0x21')](respondWithResult(_0x1f561f,null))[_0x43e7('0x40')](handleError(_0x1f561f,null));};exports[_0x43e7('0x22')]=function(_0x26d86c,_0x24e758){return db[_0x43e7('0x2b')]['find']({'where':{'id':_0x26d86c[_0x43e7('0x41')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x24e758,null))['then'](removeEntity(_0x24e758,null))[_0x43e7('0x40')](handleError(_0x24e758,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 9d1caeb..1906d12 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 _0xe4d9=['moment','path','rimraf','./analyticMetric.attributes','exports','define','lodash','util','../../config/logger'];(function(_0x1e43f3,_0x842e34){var _0x56f416=function(_0x221a26){while(--_0x221a26){_0x1e43f3['push'](_0x1e43f3['shift']());}};_0x56f416(++_0x842e34);}(_0xe4d9,0x141));var _0x9e4d=function(_0x2c62a1,_0x320c52){_0x2c62a1=_0x2c62a1-0x0;var _0xd6e286=_0xe4d9[_0x2c62a1];return _0xd6e286;};'use strict';var _=require(_0x9e4d('0x0'));var util=require(_0x9e4d('0x1'));var logger=require(_0x9e4d('0x2'))('api');var moment=require(_0x9e4d('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9e4d('0x4'));var rimraf=require(_0x9e4d('0x5'));var config=require('../../config/environment');var attributes=require(_0x9e4d('0x6'));module[_0x9e4d('0x7')]=function(_0x5a4881,_0x493fb5){return _0x5a4881[_0x9e4d('0x8')]('AnalyticMetric',attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x644f=['define','AnalyticMetric','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports'];(function(_0x15ad47,_0x4cd079){var _0x2f0495=function(_0x11af30){while(--_0x11af30){_0x15ad47['push'](_0x15ad47['shift']());}};_0x2f0495(++_0x4cd079);}(_0x644f,0xc2));var _0xf644=function(_0x597484,_0x199340){_0x597484=_0x597484-0x0;var _0x218e64=_0x644f[_0x597484];return _0x218e64;};'use strict';var _=require(_0xf644('0x0'));var util=require(_0xf644('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xf644('0x2'));var BPromise=require(_0xf644('0x3'));var rp=require(_0xf644('0x4'));var fs=require('fs');var path=require(_0xf644('0x5'));var rimraf=require(_0xf644('0x6'));var config=require(_0xf644('0x7'));var attributes=require(_0xf644('0x8'));module[_0xf644('0x9')]=function(_0x9938ed,_0x1a6cbb){return _0x9938ed[_0xf644('0xa')](_0xf644('0xb'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index c9cb516..62054c7 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 _0x876a=['rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x559757,_0x3be899){var _0x160474=function(_0x4f5a2b){while(--_0x4f5a2b){_0x559757['push'](_0x559757['shift']());}};_0x160474(++_0x3be899);}(_0x876a,0x1f2));var _0xa876=function(_0x2c8574,_0x2c6cde){_0x2c8574=_0x2c8574-0x0;var _0x4c8129=_0x876a[_0x2c8574];return _0x4c8129;};'use strict';var _=require(_0xa876('0x0'));var util=require(_0xa876('0x1'));var moment=require('moment');var BPromise=require(_0xa876('0x2'));var rs=require(_0xa876('0x3'));var fs=require('fs');var Redis=require(_0xa876('0x4'));var db=require(_0xa876('0x5'))['db'];var utils=require(_0xa876('0x6'));var logger=require(_0xa876('0x7'))(_0xa876('0x8'));var config=require(_0xa876('0x9'));var jayson=require(_0xa876('0xa'));var client=jayson[_0xa876('0xb')][_0xa876('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1e49e4,_0x2e8c80,_0x4b8a85){return new BPromise(function(_0x138be1,_0x519ea6){return client['request'](_0x1e49e4,_0x4b8a85)[_0xa876('0xd')](function(_0x4578c9){logger[_0xa876('0xe')](_0xa876('0xf'),_0x2e8c80,_0xa876('0x10'));logger[_0xa876('0x11')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x2e8c80,_0xa876('0x10'),JSON[_0xa876('0x12')](_0x4578c9));if(_0x4578c9['error']){if(_0x4578c9[_0xa876('0x13')]['code']===0x1f4){logger[_0xa876('0x13')](_0xa876('0xf'),_0x2e8c80,_0x4578c9['error'][_0xa876('0x14')]);return _0x519ea6(_0x4578c9[_0xa876('0x13')][_0xa876('0x14')]);}logger[_0xa876('0x13')](_0xa876('0xf'),_0x2e8c80,_0x4578c9[_0xa876('0x13')]['message']);return _0x138be1(_0x4578c9[_0xa876('0x13')][_0xa876('0x14')]);}else{logger[_0xa876('0xe')](_0xa876('0xf'),_0x2e8c80,'request\x20sent');_0x138be1(_0x4578c9[_0xa876('0x15')][_0xa876('0x14')]);}})[_0xa876('0x16')](function(_0x21243d){logger[_0xa876('0x13')](_0xa876('0xf'),_0x2e8c80,_0x21243d);_0x519ea6(_0x21243d);});});} \ No newline at end of file +var _0xd90b=['request','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x23e09b,_0x57658e){var _0x57d532=function(_0x59a749){while(--_0x59a749){_0x23e09b['push'](_0x23e09b['shift']());}};_0x57d532(++_0x57658e);}(_0xd90b,0xa5));var _0xbd90=function(_0xb7a88,_0x41dfe0){_0xb7a88=_0xb7a88-0x0;var _0x215c60=_0xd90b[_0xb7a88];return _0x215c60;};'use strict';var _=require('lodash');var util=require(_0xbd90('0x0'));var moment=require(_0xbd90('0x1'));var BPromise=require(_0xbd90('0x2'));var rs=require(_0xbd90('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbd90('0x4'))['db'];var utils=require(_0xbd90('0x5'));var logger=require(_0xbd90('0x6'))('rpc');var config=require(_0xbd90('0x7'));var jayson=require(_0xbd90('0x8'));var client=jayson[_0xbd90('0x9')][_0xbd90('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x55917b,_0x57e3ad,_0x5f5941){return new BPromise(function(_0x3c525f,_0x9f4543){return client[_0xbd90('0xb')](_0x55917b,_0x5f5941)['then'](function(_0x21d7e4){logger[_0xbd90('0xc')](_0xbd90('0xd'),_0x57e3ad,_0xbd90('0xe'));logger[_0xbd90('0xf')](_0xbd90('0x10'),_0x57e3ad,_0xbd90('0xe'),JSON['stringify'](_0x21d7e4));if(_0x21d7e4[_0xbd90('0x11')]){if(_0x21d7e4[_0xbd90('0x11')][_0xbd90('0x12')]===0x1f4){logger[_0xbd90('0x11')](_0xbd90('0xd'),_0x57e3ad,_0x21d7e4['error']['message']);return _0x9f4543(_0x21d7e4[_0xbd90('0x11')][_0xbd90('0x13')]);}logger[_0xbd90('0x11')](_0xbd90('0xd'),_0x57e3ad,_0x21d7e4[_0xbd90('0x11')][_0xbd90('0x13')]);return _0x3c525f(_0x21d7e4[_0xbd90('0x11')][_0xbd90('0x13')]);}else{logger[_0xbd90('0xc')](_0xbd90('0xd'),_0x57e3ad,_0xbd90('0xe'));_0x3c525f(_0x21d7e4[_0xbd90('0x14')][_0xbd90('0x13')]);}})[_0xbd90('0x15')](function(_0x319d75){logger['error'](_0xbd90('0xd'),_0x57e3ad,_0x319d75);_0x9f4543(_0x319d75);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index d9c5e53..0fbe5c6 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 _0x3561=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','show','post','put','/:id','update','exports','multer','path','connect-timeout','express'];(function(_0x367eca,_0x20ebf4){var _0x53888a=function(_0x1eea02){while(--_0x1eea02){_0x367eca['push'](_0x367eca['shift']());}};_0x53888a(++_0x20ebf4);}(_0x3561,0x94));var _0x1356=function(_0x5350f4,_0x48a111){_0x5350f4=_0x5350f4-0x0;var _0xf76cfc=_0x3561[_0x5350f4];return _0xf76cfc;};'use strict';var multer=require(_0x1356('0x0'));var util=require('util');var path=require(_0x1356('0x1'));var timeout=require(_0x1356('0x2'));var express=require(_0x1356('0x3'));var router=express[_0x1356('0x4')]();var fs_extra=require(_0x1356('0x5'));var auth=require(_0x1356('0x6'));var interaction=require(_0x1356('0x7'));var config=require(_0x1356('0x8'));var controller=require(_0x1356('0x9'));router[_0x1356('0xa')]('/',auth[_0x1356('0xb')](),controller[_0x1356('0xc')]);router[_0x1356('0xa')]('/:id',auth[_0x1356('0xb')](),controller[_0x1356('0xd')]);router[_0x1356('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1356('0xf')](_0x1356('0x10'),auth['isAuthenticated'](),controller[_0x1356('0x11')]);router['delete'](_0x1356('0x10'),auth[_0x1356('0xb')](),controller['destroy']);module[_0x1356('0x12')]=router; \ No newline at end of file +var _0x692c=['post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','/:id','show'];(function(_0x25b606,_0x36f556){var _0x2568c7=function(_0x215e5c){while(--_0x215e5c){_0x25b606['push'](_0x25b606['shift']());}};_0x2568c7(++_0x36f556);}(_0x692c,0x6a));var _0xc692=function(_0x3aab1d,_0x1b1c54){_0x3aab1d=_0x3aab1d-0x0;var _0x3d99d3=_0x692c[_0x3aab1d];return _0x3d99d3;};'use strict';var multer=require(_0xc692('0x0'));var util=require(_0xc692('0x1'));var path=require(_0xc692('0x2'));var timeout=require(_0xc692('0x3'));var express=require(_0xc692('0x4'));var router=express[_0xc692('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc692('0x6'));var interaction=require(_0xc692('0x7'));var config=require(_0xc692('0x8'));var controller=require(_0xc692('0x9'));router[_0xc692('0xa')]('/',auth[_0xc692('0xb')](),controller['index']);router['get'](_0xc692('0xc'),auth[_0xc692('0xb')](),controller[_0xc692('0xd')]);router[_0xc692('0xe')]('/',auth[_0xc692('0xb')](),controller[_0xc692('0xf')]);router[_0xc692('0x10')]('/:id',auth[_0xc692('0xb')](),controller[_0xc692('0x11')]);router[_0xc692('0x12')](_0xc692('0xc'),auth[_0xc692('0xb')](),controller['destroy']);module[_0xc692('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index b6f3ad8..4a808dc 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 _0x70e2=['sequelize','exports','TEXT'];(function(_0x39665a,_0xc729df){var _0x173185=function(_0x2263f4){while(--_0x2263f4){_0x39665a['push'](_0x39665a['shift']());}};_0x173185(++_0xc729df);}(_0x70e2,0xc3));var _0x270e=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x70e2[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0x270e('0x0'));module[_0x270e('0x1')]={'tree':{'type':Sequelize[_0x270e('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x228e=['exports','TEXT'];(function(_0x4f9cd8,_0x4168f6){var _0x99912f=function(_0x5d17f3){while(--_0x5d17f3){_0x4f9cd8['push'](_0x4f9cd8['shift']());}};_0x99912f(++_0x4168f6);}(_0x228e,0x158));var _0xe228=function(_0x264e06,_0x12336e){_0x264e06=_0x264e06-0x0;var _0x580fe0=_0x228e[_0x264e06];return _0x580fe0;};'use strict';var Sequelize=require('sequelize');module[_0xe228('0x0')]={'tree':{'type':Sequelize[_0xe228('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 8726bf0..cbae332 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 _0xe70b=['params','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','map','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','options','AnalyticTreeReport','catch','show','rawAttributes','length','includeAll','include','find','create','body'];(function(_0x7293b,_0x5a478e){var _0x54e309=function(_0x211dda){while(--_0x211dda){_0x7293b['push'](_0x7293b['shift']());}};_0x54e309(++_0x5a478e);}(_0xe70b,0xd6));var _0xbe70=function(_0x56c8a8,_0x834642){_0x56c8a8=_0x56c8a8-0x0;var _0x3a4430=_0xe70b[_0x56c8a8];return _0x3a4430;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbe70('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbe70('0x1'));var rp=require('request-promise');var moment=require(_0xbe70('0x2'));var BPromise=require(_0xbe70('0x3'));var Mustache=require(_0xbe70('0x4'));var util=require(_0xbe70('0x5'));var path=require(_0xbe70('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xbe70('0x7'));var fs=require('fs');var fs_extra=require(_0xbe70('0x8'));var _=require(_0xbe70('0x9'));var squel=require(_0xbe70('0xa'));var crypto=require(_0xbe70('0xb'));var jsforce=require(_0xbe70('0xc'));var deskjs=require(_0xbe70('0xd'));var toCsv=require(_0xbe70('0xe'));var querystring=require('querystring');var Papa=require(_0xbe70('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xbe70('0x10'));var as=require(_0xbe70('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbe70('0x12'))(_0xbe70('0x13'));var utils=require(_0xbe70('0x14'));var config=require(_0xbe70('0x15'));var licenseUtil=require(_0xbe70('0x16'));var db=require(_0xbe70('0x17'))['db'];function respondWithStatusCode(_0x3ed655,_0x2ab0c2){_0x2ab0c2=_0x2ab0c2||0xcc;return function(_0x1eb5de){if(_0x1eb5de){return _0x3ed655[_0xbe70('0x18')](_0x2ab0c2);}return _0x3ed655[_0xbe70('0x19')](_0x2ab0c2)['end']();};}function respondWithResult(_0x5628c4,_0x47adfa){_0x47adfa=_0x47adfa||0xc8;return function(_0xe04dc0){if(_0xe04dc0){return _0x5628c4[_0xbe70('0x19')](_0x47adfa)[_0xbe70('0x1a')](_0xe04dc0);}};}function respondWithFilteredResult(_0x1b9f34,_0x5782d4){return function(_0x3c0871){if(_0x3c0871){var _0x5c82a7=typeof _0x5782d4['offset']===_0xbe70('0x1b')&&typeof _0x5782d4['limit']==='undefined';var _0x150689=_0x3c0871[_0xbe70('0x1c')];var _0x2bdc18=_0x5c82a7?0x0:_0x5782d4['offset'];var _0x15b6a5=_0x5c82a7?_0x3c0871['count']:_0x5782d4[_0xbe70('0x1d')]+_0x5782d4[_0xbe70('0x1e')];var _0x47b131;if(_0x15b6a5>=_0x150689){_0x15b6a5=_0x150689;_0x47b131=0xc8;}else{_0x47b131=0xce;}_0x1b9f34[_0xbe70('0x19')](_0x47b131);return _0x1b9f34[_0xbe70('0x1f')](_0xbe70('0x20'),_0x2bdc18+'-'+_0x15b6a5+'/'+_0x150689)[_0xbe70('0x1a')](_0x3c0871);}return null;};}function patchUpdates(_0x276682){return function(_0x1f11e9){try{jsonpatch[_0xbe70('0x21')](_0x1f11e9,_0x276682,!![]);}catch(_0x43b4fb){return BPromise[_0xbe70('0x22')](_0x43b4fb);}return _0x1f11e9[_0xbe70('0x23')]();};}function saveUpdates(_0x1646e2,_0x194925){return function(_0xdbb4b6){if(_0xdbb4b6){return _0xdbb4b6[_0xbe70('0x24')](_0x1646e2)[_0xbe70('0x25')](function(_0x76afeb){return _0x76afeb;});}return null;};}function removeEntity(_0x1a69ec,_0x33714c){return function(_0x36a176){if(_0x36a176){return _0x36a176[_0xbe70('0x26')]()['then'](function(){_0x1a69ec[_0xbe70('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xafaf24,_0x4cc937){return function(_0x6f56f4){if(!_0x6f56f4){_0xafaf24[_0xbe70('0x18')](0x194);}return _0x6f56f4;};}function handleError(_0x565f11,_0x164859){_0x164859=_0x164859||0x1f4;return function(_0x57b7a8){logger['error'](_0x57b7a8['stack']);if(_0x57b7a8[_0xbe70('0x27')]){delete _0x57b7a8[_0xbe70('0x27')];}_0x565f11[_0xbe70('0x19')](_0x164859)[_0xbe70('0x28')](_0x57b7a8);};}exports[_0xbe70('0x29')]=function(_0x136b1b,_0x312b02){var _0x59f602={},_0x3d7fa3={},_0x1b0937={'count':0x0,'rows':[]};var _0x22acd6=_[_0xbe70('0x2a')](db['AnalyticTreeReport']['rawAttributes'],function(_0x1d2b23){return{'name':_0x1d2b23[_0xbe70('0x2b')],'type':_0x1d2b23[_0xbe70('0x2c')]['key']};});_0x3d7fa3[_0xbe70('0x2d')]=_[_0xbe70('0x2a')](_0x22acd6,'name');_0x3d7fa3[_0xbe70('0x2e')]=_[_0xbe70('0x2f')](_0x136b1b['query']);_0x3d7fa3[_0xbe70('0x30')]=_[_0xbe70('0x31')](_0x3d7fa3[_0xbe70('0x2d')],_0x3d7fa3[_0xbe70('0x2e')]);_0x59f602[_0xbe70('0x32')]=_[_0xbe70('0x31')](_0x3d7fa3[_0xbe70('0x2d')],qs[_0xbe70('0x33')](_0x136b1b[_0xbe70('0x2e')][_0xbe70('0x33')]));_0x59f602[_0xbe70('0x32')]=_0x59f602[_0xbe70('0x32')]['length']?_0x59f602[_0xbe70('0x32')]:_0x3d7fa3[_0xbe70('0x2d')];if(!_0x136b1b[_0xbe70('0x2e')][_0xbe70('0x34')]('nolimit')){_0x59f602[_0xbe70('0x1e')]=qs[_0xbe70('0x1e')](_0x136b1b[_0xbe70('0x2e')][_0xbe70('0x1e')]);_0x59f602[_0xbe70('0x1d')]=qs['offset'](_0x136b1b['query'][_0xbe70('0x1d')]);}_0x59f602[_0xbe70('0x35')]=qs[_0xbe70('0x36')](_0x136b1b['query']['sort']);_0x59f602[_0xbe70('0x37')]=qs['filters'](_[_0xbe70('0x38')](_0x136b1b['query'],_0x3d7fa3['filters']),_0x22acd6);if(_0x136b1b[_0xbe70('0x2e')][_0xbe70('0x39')]){_0x59f602['where']=_[_0xbe70('0x3a')](_0x59f602[_0xbe70('0x37')],{'$or':_['map'](_0x22acd6,function(_0x368148){if(_0x368148[_0xbe70('0x2c')]!=='VIRTUAL'){var _0x250c39={};_0x250c39[_0x368148[_0xbe70('0x27')]]={'$like':'%'+_0x136b1b[_0xbe70('0x2e')][_0xbe70('0x39')]+'%'};return _0x250c39;}})});}_0x59f602=_[_0xbe70('0x3a')]({},_0x59f602,_0x136b1b[_0xbe70('0x3b')]);var _0x3a704c={'where':_0x59f602['where']};return db['AnalyticTreeReport']['count'](_0x3a704c)[_0xbe70('0x25')](function(_0xac99e0){_0x1b0937[_0xbe70('0x1c')]=_0xac99e0;if(_0x136b1b[_0xbe70('0x2e')]['includeAll']){_0x59f602['include']=[{'all':!![]}];}return db[_0xbe70('0x3c')]['findAll'](_0x59f602);})[_0xbe70('0x25')](function(_0x25f5f8){_0x1b0937['rows']=_0x25f5f8;return _0x1b0937;})['then'](respondWithFilteredResult(_0x312b02,_0x59f602))[_0xbe70('0x3d')](handleError(_0x312b02,null));};exports[_0xbe70('0x3e')]=function(_0x453010,_0x4e272e){var _0xe62f79={'raw':!![],'where':{'id':_0x453010['params']['id']}},_0x510764={};_0x510764['model']=_[_0xbe70('0x2f')](db[_0xbe70('0x3c')][_0xbe70('0x3f')]);_0x510764[_0xbe70('0x2e')]=_[_0xbe70('0x2f')](_0x453010[_0xbe70('0x2e')]);_0x510764[_0xbe70('0x30')]=_[_0xbe70('0x31')](_0x510764[_0xbe70('0x2d')],_0x510764[_0xbe70('0x2e')]);_0xe62f79[_0xbe70('0x32')]=_['intersection'](_0x510764[_0xbe70('0x2d')],qs[_0xbe70('0x33')](_0x453010['query'][_0xbe70('0x33')]));_0xe62f79['attributes']=_0xe62f79[_0xbe70('0x32')][_0xbe70('0x40')]?_0xe62f79[_0xbe70('0x32')]:_0x510764['model'];if(_0x453010['query'][_0xbe70('0x41')]){_0xe62f79[_0xbe70('0x42')]=[{'all':!![]}];}_0xe62f79=_['merge']({},_0xe62f79,_0x453010[_0xbe70('0x3b')]);return db['AnalyticTreeReport'][_0xbe70('0x43')](_0xe62f79)[_0xbe70('0x25')](handleEntityNotFound(_0x4e272e,null))[_0xbe70('0x25')](respondWithResult(_0x4e272e,null))[_0xbe70('0x3d')](handleError(_0x4e272e,null));};exports[_0xbe70('0x44')]=function(_0x47b43d,_0x1ebcc8){return db['AnalyticTreeReport'][_0xbe70('0x44')](_0x47b43d['body'],{})['then'](respondWithResult(_0x1ebcc8,0xc9))[_0xbe70('0x3d')](handleError(_0x1ebcc8,null));};exports['update']=function(_0x286819,_0x441c78){if(_0x286819[_0xbe70('0x45')]['id']){delete _0x286819[_0xbe70('0x45')]['id'];}return db[_0xbe70('0x3c')][_0xbe70('0x43')]({'where':{'id':_0x286819[_0xbe70('0x46')]['id']}})[_0xbe70('0x25')](handleEntityNotFound(_0x441c78,null))[_0xbe70('0x25')](saveUpdates(_0x286819[_0xbe70('0x45')],null))[_0xbe70('0x25')](respondWithResult(_0x441c78,null))[_0xbe70('0x3d')](handleError(_0x441c78,null));};exports[_0xbe70('0x26')]=function(_0x3390e5,_0x547b89){return db['AnalyticTreeReport'][_0xbe70('0x43')]({'where':{'id':_0x3390e5[_0xbe70('0x46')]['id']}})[_0xbe70('0x25')](handleEntityNotFound(_0x547b89,null))['then'](removeEntity(_0x547b89,null))[_0xbe70('0x3d')](handleError(_0x547b89,null));}; \ No newline at end of file +var _0xe76e=['catch','show','params','keys','length','include','find','create','body','rimraf','fast-json-patch','request-promise','moment','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/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','key','query','filters','model','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','merge','options','includeAll','findAll','rows'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe76e,0x194));var _0xee76=function(_0x4cf54d,_0x1d544b){_0x4cf54d=_0x4cf54d-0x0;var _0x1dd27e=_0xe76e[_0x4cf54d];return _0x1dd27e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xee76('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xee76('0x1'));var rp=require(_0xee76('0x2'));var moment=require(_0xee76('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xee76('0x4'));var path=require(_0xee76('0x5'));var sox=require(_0xee76('0x6'));var csv=require(_0xee76('0x7'));var ejs=require(_0xee76('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xee76('0x9'));var squel=require(_0xee76('0xa'));var crypto=require(_0xee76('0xb'));var jsforce=require(_0xee76('0xc'));var deskjs=require(_0xee76('0xd'));var toCsv=require('to-csv');var querystring=require(_0xee76('0xe'));var Papa=require(_0xee76('0xf'));var Redis=require('ioredis');var authService=require(_0xee76('0x10'));var qs=require(_0xee76('0x11'));var as=require(_0xee76('0x12'));var hardwareService=require(_0xee76('0x13'));var logger=require(_0xee76('0x14'))(_0xee76('0x15'));var utils=require(_0xee76('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xee76('0x17'));var db=require(_0xee76('0x18'))['db'];function respondWithStatusCode(_0x1c8672,_0x2e861f){_0x2e861f=_0x2e861f||0xcc;return function(_0x4eee9e){if(_0x4eee9e){return _0x1c8672[_0xee76('0x19')](_0x2e861f);}return _0x1c8672[_0xee76('0x1a')](_0x2e861f)['end']();};}function respondWithResult(_0x4d5181,_0xb506bf){_0xb506bf=_0xb506bf||0xc8;return function(_0x5e2913){if(_0x5e2913){return _0x4d5181['status'](_0xb506bf)[_0xee76('0x1b')](_0x5e2913);}};}function respondWithFilteredResult(_0x562d25,_0x346de2){return function(_0x4fa110){if(_0x4fa110){var _0x280019=typeof _0x346de2[_0xee76('0x1c')]===_0xee76('0x1d')&&typeof _0x346de2[_0xee76('0x1e')]===_0xee76('0x1d');var _0x4fd10a=_0x4fa110[_0xee76('0x1f')];var _0x3eebdc=_0x280019?0x0:_0x346de2[_0xee76('0x1c')];var _0x362682=_0x280019?_0x4fa110['count']:_0x346de2[_0xee76('0x1c')]+_0x346de2[_0xee76('0x1e')];var _0xf9da93;if(_0x362682>=_0x4fd10a){_0x362682=_0x4fd10a;_0xf9da93=0xc8;}else{_0xf9da93=0xce;}_0x562d25['status'](_0xf9da93);return _0x562d25[_0xee76('0x20')](_0xee76('0x21'),_0x3eebdc+'-'+_0x362682+'/'+_0x4fd10a)[_0xee76('0x1b')](_0x4fa110);}return null;};}function patchUpdates(_0x36bb6c){return function(_0xded4a2){try{jsonpatch[_0xee76('0x22')](_0xded4a2,_0x36bb6c,!![]);}catch(_0x5448d2){return BPromise[_0xee76('0x23')](_0x5448d2);}return _0xded4a2[_0xee76('0x24')]();};}function saveUpdates(_0x41d0a5,_0x5e3560){return function(_0x680181){if(_0x680181){return _0x680181[_0xee76('0x25')](_0x41d0a5)[_0xee76('0x26')](function(_0x21a5ad){return _0x21a5ad;});}return null;};}function removeEntity(_0x251612,_0x2d6f6a){return function(_0x24a0fb){if(_0x24a0fb){return _0x24a0fb[_0xee76('0x27')]()[_0xee76('0x26')](function(){_0x251612[_0xee76('0x1a')](0xcc)[_0xee76('0x28')]();});}};}function handleEntityNotFound(_0x17b82d,_0x160be9){return function(_0x550653){if(!_0x550653){_0x17b82d[_0xee76('0x19')](0x194);}return _0x550653;};}function handleError(_0x29a7ea,_0x3a569e){_0x3a569e=_0x3a569e||0x1f4;return function(_0x475021){logger[_0xee76('0x29')](_0x475021[_0xee76('0x2a')]);if(_0x475021[_0xee76('0x2b')]){delete _0x475021['name'];}_0x29a7ea['status'](_0x3a569e)[_0xee76('0x2c')](_0x475021);};}exports[_0xee76('0x2d')]=function(_0x5c35cc,_0x241e7e){var _0x2af5c3={},_0x2171cb={},_0x20f286={'count':0x0,'rows':[]};var _0x1773ad=_[_0xee76('0x2e')](db[_0xee76('0x2f')][_0xee76('0x30')],function(_0x187df8){return{'name':_0x187df8[_0xee76('0x31')],'type':_0x187df8['type'][_0xee76('0x32')]};});_0x2171cb['model']=_[_0xee76('0x2e')](_0x1773ad,_0xee76('0x2b'));_0x2171cb[_0xee76('0x33')]=_['keys'](_0x5c35cc['query']);_0x2171cb[_0xee76('0x34')]=_['intersection'](_0x2171cb[_0xee76('0x35')],_0x2171cb[_0xee76('0x33')]);_0x2af5c3['attributes']=_[_0xee76('0x36')](_0x2171cb[_0xee76('0x35')],qs[_0xee76('0x37')](_0x5c35cc['query'][_0xee76('0x37')]));_0x2af5c3[_0xee76('0x38')]=_0x2af5c3[_0xee76('0x38')]['length']?_0x2af5c3[_0xee76('0x38')]:_0x2171cb[_0xee76('0x35')];if(!_0x5c35cc[_0xee76('0x33')][_0xee76('0x39')](_0xee76('0x3a'))){_0x2af5c3[_0xee76('0x1e')]=qs[_0xee76('0x1e')](_0x5c35cc[_0xee76('0x33')][_0xee76('0x1e')]);_0x2af5c3[_0xee76('0x1c')]=qs[_0xee76('0x1c')](_0x5c35cc[_0xee76('0x33')][_0xee76('0x1c')]);}_0x2af5c3[_0xee76('0x3b')]=qs[_0xee76('0x3c')](_0x5c35cc[_0xee76('0x33')]['sort']);_0x2af5c3[_0xee76('0x3d')]=qs['filters'](_['pick'](_0x5c35cc[_0xee76('0x33')],_0x2171cb[_0xee76('0x34')]),_0x1773ad);if(_0x5c35cc['query'][_0xee76('0x3e')]){_0x2af5c3[_0xee76('0x3d')]=_['merge'](_0x2af5c3['where'],{'$or':_[_0xee76('0x2e')](_0x1773ad,function(_0x1cea68){if(_0x1cea68[_0xee76('0x3f')]!==_0xee76('0x40')){var _0xfa05e3={};_0xfa05e3[_0x1cea68[_0xee76('0x2b')]]={'$like':'%'+_0x5c35cc['query'][_0xee76('0x3e')]+'%'};return _0xfa05e3;}})});}_0x2af5c3=_[_0xee76('0x41')]({},_0x2af5c3,_0x5c35cc[_0xee76('0x42')]);var _0xb621c8={'where':_0x2af5c3['where']};return db[_0xee76('0x2f')]['count'](_0xb621c8)['then'](function(_0x16e42d){_0x20f286[_0xee76('0x1f')]=_0x16e42d;if(_0x5c35cc[_0xee76('0x33')][_0xee76('0x43')]){_0x2af5c3['include']=[{'all':!![]}];}return db[_0xee76('0x2f')][_0xee76('0x44')](_0x2af5c3);})[_0xee76('0x26')](function(_0x7410f5){_0x20f286[_0xee76('0x45')]=_0x7410f5;return _0x20f286;})[_0xee76('0x26')](respondWithFilteredResult(_0x241e7e,_0x2af5c3))[_0xee76('0x46')](handleError(_0x241e7e,null));};exports[_0xee76('0x47')]=function(_0x1934b9,_0x54bd0c){var _0x32c7f7={'raw':!![],'where':{'id':_0x1934b9[_0xee76('0x48')]['id']}},_0x966a1d={};_0x966a1d[_0xee76('0x35')]=_[_0xee76('0x49')](db[_0xee76('0x2f')][_0xee76('0x30')]);_0x966a1d['query']=_['keys'](_0x1934b9['query']);_0x966a1d[_0xee76('0x34')]=_[_0xee76('0x36')](_0x966a1d['model'],_0x966a1d[_0xee76('0x33')]);_0x32c7f7[_0xee76('0x38')]=_[_0xee76('0x36')](_0x966a1d[_0xee76('0x35')],qs[_0xee76('0x37')](_0x1934b9[_0xee76('0x33')][_0xee76('0x37')]));_0x32c7f7[_0xee76('0x38')]=_0x32c7f7[_0xee76('0x38')][_0xee76('0x4a')]?_0x32c7f7[_0xee76('0x38')]:_0x966a1d[_0xee76('0x35')];if(_0x1934b9[_0xee76('0x33')][_0xee76('0x43')]){_0x32c7f7[_0xee76('0x4b')]=[{'all':!![]}];}_0x32c7f7=_[_0xee76('0x41')]({},_0x32c7f7,_0x1934b9[_0xee76('0x42')]);return db[_0xee76('0x2f')][_0xee76('0x4c')](_0x32c7f7)[_0xee76('0x26')](handleEntityNotFound(_0x54bd0c,null))[_0xee76('0x26')](respondWithResult(_0x54bd0c,null))['catch'](handleError(_0x54bd0c,null));};exports[_0xee76('0x4d')]=function(_0x27fbcd,_0x28f010){return db['AnalyticTreeReport'][_0xee76('0x4d')](_0x27fbcd[_0xee76('0x4e')],{})[_0xee76('0x26')](respondWithResult(_0x28f010,0xc9))[_0xee76('0x46')](handleError(_0x28f010,null));};exports[_0xee76('0x25')]=function(_0x53a50b,_0x402076){if(_0x53a50b[_0xee76('0x4e')]['id']){delete _0x53a50b['body']['id'];}return db[_0xee76('0x2f')]['find']({'where':{'id':_0x53a50b[_0xee76('0x48')]['id']}})[_0xee76('0x26')](handleEntityNotFound(_0x402076,null))[_0xee76('0x26')](saveUpdates(_0x53a50b['body'],null))['then'](respondWithResult(_0x402076,null))['catch'](handleError(_0x402076,null));};exports[_0xee76('0x27')]=function(_0x28fe68,_0x1539ac){return db[_0xee76('0x2f')]['find']({'where':{'id':_0x28fe68[_0xee76('0x48')]['id']}})['then'](handleEntityNotFound(_0x1539ac,null))[_0xee76('0x26')](removeEntity(_0x1539ac,null))['catch'](handleError(_0x1539ac,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 5aebac7..f14c675 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 _0xd15f=['../../config/environment','./analyticTreeReport.attributes','exports','define','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x24259d,_0x64a194){var _0x5a701=function(_0x204516){while(--_0x204516){_0x24259d['push'](_0x24259d['shift']());}};_0x5a701(++_0x64a194);}(_0xd15f,0xf6));var _0xfd15=function(_0x1e8b1e,_0x407bbd){_0x1e8b1e=_0x1e8b1e-0x0;var _0x4a0fde=_0xd15f[_0x1e8b1e];return _0x4a0fde;};'use strict';var _=require(_0xfd15('0x0'));var util=require(_0xfd15('0x1'));var logger=require(_0xfd15('0x2'))(_0xfd15('0x3'));var moment=require(_0xfd15('0x4'));var BPromise=require('bluebird');var rp=require(_0xfd15('0x5'));var fs=require('fs');var path=require(_0xfd15('0x6'));var rimraf=require('rimraf');var config=require(_0xfd15('0x7'));var attributes=require(_0xfd15('0x8'));module[_0xfd15('0x9')]=function(_0x2c6dc9,_0x2e7f87){return _0x2c6dc9[_0xfd15('0xa')]('AnalyticTreeReport',attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8212=['define','lodash','util','api','moment','bluebird','request-promise','path','exports'];(function(_0x173452,_0x3aa870){var _0xee3fd0=function(_0x10eb01){while(--_0x10eb01){_0x173452['push'](_0x173452['shift']());}};_0xee3fd0(++_0x3aa870);}(_0x8212,0xd9));var _0x2821=function(_0x2e0748,_0x55284){_0x2e0748=_0x2e0748-0x0;var _0x15d429=_0x8212[_0x2e0748];return _0x15d429;};'use strict';var _=require(_0x2821('0x0'));var util=require(_0x2821('0x1'));var logger=require('../../config/logger')(_0x2821('0x2'));var moment=require(_0x2821('0x3'));var BPromise=require(_0x2821('0x4'));var rp=require(_0x2821('0x5'));var fs=require('fs');var path=require(_0x2821('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./analyticTreeReport.attributes');module[_0x2821('0x7')]=function(_0x3d49c9,_0x3c90dc){return _0x3d49c9[_0x2821('0x8')]('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 2c14b1b..58f6e22 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 _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(_0x2de1da,_0x49b428){var _0x10ca5f=function(_0x4276cb){while(--_0x4276cb){_0x2de1da['push'](_0x2de1da['shift']());}};_0x10ca5f(++_0x49b428);}(_0x5f2f,0x73));var _0xf5f2=function(_0x707aaa,_0x25752e){_0x707aaa=_0x707aaa-0x0;var _0x1931d3=_0x5f2f[_0x707aaa];return _0x1931d3;};'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 +var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x24ffff,_0x35af2d){var _0x38b03e=function(_0x2302ed){while(--_0x2302ed){_0x24ffff['push'](_0x24ffff['shift']());}};_0x38b03e(++_0x35af2d);}(_0xdb28,0x106));var _0x8db2=function(_0x189f28,_0x4dfc71){_0x189f28=_0x189f28-0x0;var _0x1430b7=_0xdb28[_0x189f28];return _0x1430b7;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index bcdb64b..226bea6 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 _0xd848=['get','isAuthenticated','index','show','post','create','put','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller'];(function(_0x430a79,_0x17b2af){var _0xda6181=function(_0x488aca){while(--_0x488aca){_0x430a79['push'](_0x430a79['shift']());}};_0xda6181(++_0x17b2af);}(_0xd848,0x1ad));var _0x8d84=function(_0x4dcc2d,_0x422839){_0x4dcc2d=_0x4dcc2d-0x0;var _0x1bbd79=_0xd848[_0x4dcc2d];return _0x1bbd79;};'use strict';var multer=require(_0x8d84('0x0'));var util=require(_0x8d84('0x1'));var path=require(_0x8d84('0x2'));var timeout=require(_0x8d84('0x3'));var express=require(_0x8d84('0x4'));var router=express[_0x8d84('0x5')]();var fs_extra=require(_0x8d84('0x6'));var auth=require(_0x8d84('0x7'));var interaction=require(_0x8d84('0x8'));var config=require(_0x8d84('0x9'));var controller=require(_0x8d84('0xa'));router[_0x8d84('0xb')]('/',auth[_0x8d84('0xc')](),controller[_0x8d84('0xd')]);router[_0x8d84('0xb')]('/:id',auth[_0x8d84('0xc')](),controller[_0x8d84('0xe')]);router[_0x8d84('0xf')]('/',auth['isAuthenticated'](),controller[_0x8d84('0x10')]);router[_0x8d84('0x11')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x8d84('0x12')](_0x8d84('0x13'),auth[_0x8d84('0xc')](),controller[_0x8d84('0x14')]);module[_0x8d84('0x15')]=router; \ No newline at end of file +var _0x4b81=['index','/:id','show','isAuthenticated','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get'];(function(_0x16713c,_0x19d624){var _0x28634a=function(_0xa77094){while(--_0xa77094){_0x16713c['push'](_0x16713c['shift']());}};_0x28634a(++_0x19d624);}(_0x4b81,0xc8));var _0x14b8=function(_0x1f1a63,_0x3b5924){_0x1f1a63=_0x1f1a63-0x0;var _0x21492a=_0x4b81[_0x1f1a63];return _0x21492a;};'use strict';var multer=require('multer');var util=require(_0x14b8('0x0'));var path=require(_0x14b8('0x1'));var timeout=require(_0x14b8('0x2'));var express=require(_0x14b8('0x3'));var router=express['Router']();var fs_extra=require(_0x14b8('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x14b8('0x5'));var config=require(_0x14b8('0x6'));var controller=require(_0x14b8('0x7'));router[_0x14b8('0x8')]('/',auth['isAuthenticated'](),controller[_0x14b8('0x9')]);router['get'](_0x14b8('0xa'),auth['isAuthenticated'](),controller[_0x14b8('0xb')]);router['post']('/',auth[_0x14b8('0xc')](),controller[_0x14b8('0xd')]);router[_0x14b8('0xe')](_0x14b8('0xa'),auth[_0x14b8('0xc')](),controller[_0x14b8('0xf')]);router[_0x14b8('0x10')]('/:id',auth[_0x14b8('0xc')](),controller[_0x14b8('0x11')]);module[_0x14b8('0x12')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 1c5509e..1ce02a7 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 _0x3cd1=['exports','STRING'];(function(_0x34baf0,_0x44d55c){var _0x30e3a0=function(_0x36445d){while(--_0x36445d){_0x34baf0['push'](_0x34baf0['shift']());}};_0x30e3a0(++_0x44d55c);}(_0x3cd1,0x112));var _0x13cd=function(_0x46cef6,_0x1d434c){_0x46cef6=_0x46cef6-0x0;var _0x239be7=_0x3cd1[_0x46cef6];return _0x239be7;};'use strict';var Sequelize=require('sequelize');module[_0x13cd('0x0')]={'name':{'type':Sequelize[_0x13cd('0x1')]},'basename':{'type':Sequelize[_0x13cd('0x1')]},'type':{'type':Sequelize[_0x13cd('0x1')]}}; \ No newline at end of file +var _0xe1f0=['exports','STRING'];(function(_0x1aaa15,_0x4b6c71){var _0x2712cc=function(_0x37f0ae){while(--_0x37f0ae){_0x1aaa15['push'](_0x1aaa15['shift']());}};_0x2712cc(++_0x4b6c71);}(_0xe1f0,0x1c2));var _0x0e1f=function(_0x8f22d,_0x57f430){_0x8f22d=_0x8f22d-0x0;var _0x282eb4=_0xe1f0[_0x8f22d];return _0x282eb4;};'use strict';var Sequelize=require('sequelize');module[_0x0e1f('0x0')]={'name':{'type':Sequelize[_0x0e1f('0x1')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x0e1f('0x1')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index e5901db..3c81993 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 _0xe7de=['find','catch','get','omit','createdAt','updatedAt','body','create','file','originalname','basename','mimetype','ChatOfflineMessageId','join','root','download','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','apply','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','keys','query','filters','attributes','intersection','fields','model','nolimit','order','sort','where','filter','VIRTUAL','merge','Attachment','includeAll','findAll','rows','show','params','include','options'];(function(_0x3340fa,_0x54eae8){var _0x309e22=function(_0x1095ff){while(--_0x1095ff){_0x3340fa['push'](_0x3340fa['shift']());}};_0x309e22(++_0x54eae8);}(_0xe7de,0x109));var _0xee7d=function(_0x53fd72,_0x29776b){_0x53fd72=_0x53fd72-0x0;var _0x52a03a=_0xe7de[_0x53fd72];return _0x52a03a;};'use strict';var emlformat=require(_0xee7d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xee7d('0x1'));var jsonpatch=require(_0xee7d('0x2'));var rp=require(_0xee7d('0x3'));var moment=require('moment');var BPromise=require(_0xee7d('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xee7d('0x5'));var sox=require(_0xee7d('0x6'));var csv=require(_0xee7d('0x7'));var ejs=require(_0xee7d('0x8'));var fs=require('fs');var fs_extra=require(_0xee7d('0x9'));var _=require(_0xee7d('0xa'));var squel=require(_0xee7d('0xb'));var crypto=require(_0xee7d('0xc'));var jsforce=require(_0xee7d('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xee7d('0xe'));var Redis=require(_0xee7d('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xee7d('0x10'));var as=require(_0xee7d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xee7d('0x12'))(_0xee7d('0x13'));var utils=require('../../config/utils');var config=require(_0xee7d('0x14'));var licenseUtil=require(_0xee7d('0x15'));var db=require(_0xee7d('0x16'))['db'];function respondWithStatusCode(_0x59ecbd,_0x4cc96b){_0x4cc96b=_0x4cc96b||0xcc;return function(_0x44552d){if(_0x44552d){return _0x59ecbd[_0xee7d('0x17')](_0x4cc96b);}return _0x59ecbd[_0xee7d('0x18')](_0x4cc96b)[_0xee7d('0x19')]();};}function respondWithResult(_0x4d0a37,_0x40593b){_0x40593b=_0x40593b||0xc8;return function(_0x7428fd){if(_0x7428fd){return _0x4d0a37[_0xee7d('0x18')](_0x40593b)['json'](_0x7428fd);}};}function respondWithFilteredResult(_0x5ee6ea,_0x245027){return function(_0x1f30ae){if(_0x1f30ae){var _0x266469=typeof _0x245027[_0xee7d('0x1a')]===_0xee7d('0x1b')&&typeof _0x245027[_0xee7d('0x1c')]===_0xee7d('0x1b');var _0x3bc737=_0x1f30ae[_0xee7d('0x1d')];var _0x54853d=_0x266469?0x0:_0x245027[_0xee7d('0x1a')];var _0x1231d2=_0x266469?_0x1f30ae[_0xee7d('0x1d')]:_0x245027[_0xee7d('0x1a')]+_0x245027[_0xee7d('0x1c')];var _0x3fe539;if(_0x1231d2>=_0x3bc737){_0x1231d2=_0x3bc737;_0x3fe539=0xc8;}else{_0x3fe539=0xce;}_0x5ee6ea[_0xee7d('0x18')](_0x3fe539);return _0x5ee6ea['set']('Content-Range',_0x54853d+'-'+_0x1231d2+'/'+_0x3bc737)['json'](_0x1f30ae);}return null;};}function patchUpdates(_0xc163f4){return function(_0x512e45){try{jsonpatch[_0xee7d('0x1e')](_0x512e45,_0xc163f4,!![]);}catch(_0x140188){return BPromise[_0xee7d('0x1f')](_0x140188);}return _0x512e45[_0xee7d('0x20')]();};}function saveUpdates(_0x452c88,_0x15a746){return function(_0x215bfe){if(_0x215bfe){return _0x215bfe[_0xee7d('0x21')](_0x452c88)[_0xee7d('0x22')](function(_0x19fd60){return _0x19fd60;});}return null;};}function removeEntity(_0x3d578c,_0xcfeb7e){return function(_0x1e8179){if(_0x1e8179){return _0x1e8179[_0xee7d('0x23')]()[_0xee7d('0x22')](function(){_0x3d578c['status'](0xcc)[_0xee7d('0x19')]();});}};}function handleEntityNotFound(_0x4dc643,_0x48c279){return function(_0x2c14e8){if(!_0x2c14e8){_0x4dc643['sendStatus'](0x194);}return _0x2c14e8;};}function handleError(_0x2bd9f5,_0x541fbc){_0x541fbc=_0x541fbc||0x1f4;return function(_0x1b24d2){logger[_0xee7d('0x24')](_0x1b24d2[_0xee7d('0x25')]);if(_0x1b24d2[_0xee7d('0x26')]){delete _0x1b24d2[_0xee7d('0x26')];}_0x2bd9f5[_0xee7d('0x18')](_0x541fbc)['send'](_0x1b24d2);};}exports[_0xee7d('0x27')]=function(_0x239368,_0x2b7e0d){var _0x5ad5f4={},_0x521e9f={},_0x37466e={'count':0x0,'rows':[]};var _0x182174=_[_0xee7d('0x28')](db['Attachment'][_0xee7d('0x29')],function(_0x48e0e9){return{'name':_0x48e0e9[_0xee7d('0x2a')],'type':_0x48e0e9[_0xee7d('0x2b')][_0xee7d('0x2c')]};});_0x521e9f['model']=_[_0xee7d('0x28')](_0x182174,'name');_0x521e9f['query']=_[_0xee7d('0x2d')](_0x239368[_0xee7d('0x2e')]);_0x521e9f[_0xee7d('0x2f')]=_['intersection'](_0x521e9f['model'],_0x521e9f['query']);_0x5ad5f4[_0xee7d('0x30')]=_[_0xee7d('0x31')](_0x521e9f['model'],qs[_0xee7d('0x32')](_0x239368['query'][_0xee7d('0x32')]));_0x5ad5f4[_0xee7d('0x30')]=_0x5ad5f4[_0xee7d('0x30')]['length']?_0x5ad5f4['attributes']:_0x521e9f[_0xee7d('0x33')];if(!_0x239368[_0xee7d('0x2e')]['hasOwnProperty'](_0xee7d('0x34'))){_0x5ad5f4[_0xee7d('0x1c')]=qs[_0xee7d('0x1c')](_0x239368[_0xee7d('0x2e')]['limit']);_0x5ad5f4[_0xee7d('0x1a')]=qs[_0xee7d('0x1a')](_0x239368['query'][_0xee7d('0x1a')]);}_0x5ad5f4[_0xee7d('0x35')]=qs[_0xee7d('0x36')](_0x239368[_0xee7d('0x2e')]['sort']);_0x5ad5f4[_0xee7d('0x37')]=qs['filters'](_['pick'](_0x239368[_0xee7d('0x2e')],_0x521e9f[_0xee7d('0x2f')]),_0x182174);if(_0x239368[_0xee7d('0x2e')][_0xee7d('0x38')]){_0x5ad5f4[_0xee7d('0x37')]=_['merge'](_0x5ad5f4[_0xee7d('0x37')],{'$or':_[_0xee7d('0x28')](_0x182174,function(_0x4ef8ac){if(_0x4ef8ac[_0xee7d('0x2b')]!==_0xee7d('0x39')){var _0x33a04f={};_0x33a04f[_0x4ef8ac[_0xee7d('0x26')]]={'$like':'%'+_0x239368[_0xee7d('0x2e')][_0xee7d('0x38')]+'%'};return _0x33a04f;}})});}_0x5ad5f4=_[_0xee7d('0x3a')]({},_0x5ad5f4,_0x239368['options']);var _0x895c3f={'where':_0x5ad5f4[_0xee7d('0x37')]};return db[_0xee7d('0x3b')][_0xee7d('0x1d')](_0x895c3f)[_0xee7d('0x22')](function(_0x10e97a){_0x37466e[_0xee7d('0x1d')]=_0x10e97a;if(_0x239368[_0xee7d('0x2e')][_0xee7d('0x3c')]){_0x5ad5f4['include']=[{'all':!![]}];}return db[_0xee7d('0x3b')][_0xee7d('0x3d')](_0x5ad5f4);})[_0xee7d('0x22')](function(_0x2ead51){_0x37466e[_0xee7d('0x3e')]=_0x2ead51;return _0x37466e;})[_0xee7d('0x22')](respondWithFilteredResult(_0x2b7e0d,_0x5ad5f4))['catch'](handleError(_0x2b7e0d,null));};exports[_0xee7d('0x3f')]=function(_0xfcf96b,_0x18fbbf){var _0x9f0627={'raw':!![],'where':{'id':_0xfcf96b[_0xee7d('0x40')]['id']}},_0x4e4e06={};_0x4e4e06[_0xee7d('0x33')]=_[_0xee7d('0x2d')](db[_0xee7d('0x3b')][_0xee7d('0x29')]);_0x4e4e06[_0xee7d('0x2e')]=_[_0xee7d('0x2d')](_0xfcf96b[_0xee7d('0x2e')]);_0x4e4e06[_0xee7d('0x2f')]=_['intersection'](_0x4e4e06['model'],_0x4e4e06[_0xee7d('0x2e')]);_0x9f0627[_0xee7d('0x30')]=_[_0xee7d('0x31')](_0x4e4e06[_0xee7d('0x33')],qs[_0xee7d('0x32')](_0xfcf96b[_0xee7d('0x2e')]['fields']));_0x9f0627['attributes']=_0x9f0627['attributes']['length']?_0x9f0627['attributes']:_0x4e4e06[_0xee7d('0x33')];if(_0xfcf96b['query'][_0xee7d('0x3c')]){_0x9f0627[_0xee7d('0x41')]=[{'all':!![]}];}_0x9f0627=_[_0xee7d('0x3a')]({},_0x9f0627,_0xfcf96b[_0xee7d('0x42')]);return db[_0xee7d('0x3b')][_0xee7d('0x43')](_0x9f0627)[_0xee7d('0x22')](handleEntityNotFound(_0x18fbbf,null))['then'](respondWithResult(_0x18fbbf,null))[_0xee7d('0x44')](handleError(_0x18fbbf,null));};exports['clone']=function(_0x2f4dcd,_0x11e781){var _0x5637d8={'where':{'id':_0x2f4dcd['params']['id']}},_0x8ac70c={};_0x8ac70c[_0xee7d('0x33')]=_[_0xee7d('0x2d')](db[_0xee7d('0x3b')][_0xee7d('0x29')]);_0x5637d8[_0xee7d('0x30')]=_[_0xee7d('0x31')](_0x8ac70c['model'],qs[_0xee7d('0x32')](_0x2f4dcd[_0xee7d('0x2e')][_0xee7d('0x32')]));_0x5637d8[_0xee7d('0x30')]=_0x5637d8[_0xee7d('0x30')]['length']?_0x5637d8['attributes']:_0x8ac70c[_0xee7d('0x33')];if(_0x2f4dcd[_0xee7d('0x2e')][_0xee7d('0x3c')]){_0x5637d8['include']=[{'all':!![]}];}_0x5637d8=_[_0xee7d('0x3a')]({},_0x5637d8,_0x2f4dcd[_0xee7d('0x42')]);return db[_0xee7d('0x3b')]['find'](_0x5637d8)[_0xee7d('0x22')](handleEntityNotFound(_0x11e781,null))[_0xee7d('0x22')](function(_0xeeec01){if(_0xeeec01){var _0x8ed839=_0xeeec01[_0xee7d('0x45')]({'plain':!![]});_0x8ed839=qs[_0xee7d('0x46')](_0x8ed839,['id',_0xee7d('0x47'),_0xee7d('0x48')]);_0x2f4dcd[_0xee7d('0x49')]=_[_0xee7d('0x46')](_0x2f4dcd[_0xee7d('0x49')],['id','createdAt',_0xee7d('0x48')]);return db[_0xee7d('0x3b')][_0xee7d('0x4a')](_[_0xee7d('0x3a')](_0x8ed839,_0x2f4dcd['body']),{'include':_0x2f4dcd[_0xee7d('0x2e')][_0xee7d('0x3c')]?[{'all':!![]}]:undefined});}})[_0xee7d('0x22')](respondWithResult(_0x11e781,0xc9))[_0xee7d('0x44')](handleError(_0x11e781,null));};exports[_0xee7d('0x21')]=function(_0x5be6a0,_0x197cb7){if(_0x5be6a0['body']['id']){delete _0x5be6a0[_0xee7d('0x49')]['id'];}return db[_0xee7d('0x3b')]['find']({'where':{'id':_0x5be6a0['params']['id']}})[_0xee7d('0x22')](handleEntityNotFound(_0x197cb7,null))[_0xee7d('0x22')](saveUpdates(_0x5be6a0[_0xee7d('0x49')],null))[_0xee7d('0x22')](respondWithResult(_0x197cb7,null))['catch'](handleError(_0x197cb7,null));};exports[_0xee7d('0x23')]=function(_0x3cc7a3,_0x1ab3a9){return db[_0xee7d('0x3b')][_0xee7d('0x43')]({'where':{'id':_0x3cc7a3[_0xee7d('0x40')]['id']}})[_0xee7d('0x22')](handleEntityNotFound(_0x1ab3a9,null))['then'](removeEntity(_0x1ab3a9,null))['catch'](handleError(_0x1ab3a9,null));};exports['create']=function(_0x5c1457,_0x492f81,_0xa45a09){_0x5c1457[_0xee7d('0x49')]['name']=_0x5c1457[_0xee7d('0x4b')][_0xee7d('0x4c')];_0x5c1457[_0xee7d('0x49')][_0xee7d('0x4d')]=_0x5c1457[_0xee7d('0x4b')]['filename'];_0x5c1457['body'][_0xee7d('0x2b')]=_0x5c1457[_0xee7d('0x4b')][_0xee7d('0x4e')];return db['Attachment']['create'](_0x5c1457[_0xee7d('0x49')])['then'](respondWithResult(_0x492f81,0xc9))[_0xee7d('0x44')](handleError(_0x492f81,null));};exports['download']=function(_0x58b348,_0x3b2153,_0x246994){return db['Attachment']['findOne']({'where':{'id':_0x58b348['params']['id']},'raw':!![]})[_0xee7d('0x22')](handleEntityNotFound(_0x3b2153,null))['then'](function(_0x34888e){if(_0x34888e){var _0x15d4f0=_0x34888e[_0xee7d('0x4f')]!==null;var _0x3398a1=path[_0xee7d('0x50')](config[_0xee7d('0x51')],'server/files/attachments/');if(_0x15d4f0){_0x3398a1=path['join'](_0x3398a1,'offline-chat/');}var _0x38039b=path[_0xee7d('0x50')](_0x3398a1,_0x34888e[_0xee7d('0x4d')]);return _0x3b2153[_0xee7d('0x52')](_0x38039b);}})[_0xee7d('0x44')](handleError(_0x3b2153,null));}; \ No newline at end of file +var _0xcef2=['Content-Range','json','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','Attachment','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','limit','order','sort','pick','filter','where','VIRTUAL','merge','include','findAll','rows','show','params','length','includeAll','find','catch','clone','options','createdAt','body','omit','destroy','create','file','originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','offset','undefined','count','status','set'];(function(_0x35c8f5,_0x399f44){var _0xb5c718=function(_0x50450c){while(--_0x50450c){_0x35c8f5['push'](_0x35c8f5['shift']());}};_0xb5c718(++_0x399f44);}(_0xcef2,0x150));var _0x2cef=function(_0x297856,_0xd3d540){_0x297856=_0x297856-0x0;var _0x413d73=_0xcef2[_0x297856];return _0x413d73;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2cef('0x0'));var zipdir=require(_0x2cef('0x1'));var jsonpatch=require(_0x2cef('0x2'));var rp=require('request-promise');var moment=require(_0x2cef('0x3'));var BPromise=require(_0x2cef('0x4'));var Mustache=require(_0x2cef('0x5'));var util=require(_0x2cef('0x6'));var path=require(_0x2cef('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2cef('0x8'));var fs=require('fs');var fs_extra=require(_0x2cef('0x9'));var _=require(_0x2cef('0xa'));var squel=require(_0x2cef('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2cef('0xc'));var toCsv=require('to-csv');var querystring=require(_0x2cef('0xd'));var Papa=require('papaparse');var Redis=require(_0x2cef('0xe'));var authService=require(_0x2cef('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x2cef('0x10'));var hardwareService=require(_0x2cef('0x11'));var logger=require('../../config/logger')(_0x2cef('0x12'));var utils=require(_0x2cef('0x13'));var config=require(_0x2cef('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x2cef('0x15'))['db'];function respondWithStatusCode(_0x42397c,_0x57b279){_0x57b279=_0x57b279||0xcc;return function(_0xab00b0){if(_0xab00b0){return _0x42397c['sendStatus'](_0x57b279);}return _0x42397c['status'](_0x57b279)[_0x2cef('0x16')]();};}function respondWithResult(_0x5075e0,_0x1af370){_0x1af370=_0x1af370||0xc8;return function(_0x5b593d){if(_0x5b593d){return _0x5075e0['status'](_0x1af370)['json'](_0x5b593d);}};}function respondWithFilteredResult(_0xe82169,_0x4a87fc){return function(_0x59f942){if(_0x59f942){var _0x10ddc2=typeof _0x4a87fc[_0x2cef('0x17')]==='undefined'&&typeof _0x4a87fc['limit']===_0x2cef('0x18');var _0x171d01=_0x59f942['count'];var _0x12cc4a=_0x10ddc2?0x0:_0x4a87fc[_0x2cef('0x17')];var _0x1dedb4=_0x10ddc2?_0x59f942[_0x2cef('0x19')]:_0x4a87fc['offset']+_0x4a87fc['limit'];var _0x5e4265;if(_0x1dedb4>=_0x171d01){_0x1dedb4=_0x171d01;_0x5e4265=0xc8;}else{_0x5e4265=0xce;}_0xe82169[_0x2cef('0x1a')](_0x5e4265);return _0xe82169[_0x2cef('0x1b')](_0x2cef('0x1c'),_0x12cc4a+'-'+_0x1dedb4+'/'+_0x171d01)[_0x2cef('0x1d')](_0x59f942);}return null;};}function patchUpdates(_0x560eb3){return function(_0x2e41e8){try{jsonpatch[_0x2cef('0x1e')](_0x2e41e8,_0x560eb3,!![]);}catch(_0x97f6b){return BPromise[_0x2cef('0x1f')](_0x97f6b);}return _0x2e41e8[_0x2cef('0x20')]();};}function saveUpdates(_0x15cd23,_0x14f312){return function(_0xad3e5d){if(_0xad3e5d){return _0xad3e5d[_0x2cef('0x21')](_0x15cd23)[_0x2cef('0x22')](function(_0x150700){return _0x150700;});}return null;};}function removeEntity(_0x521512,_0x45e8a8){return function(_0x3c4694){if(_0x3c4694){return _0x3c4694['destroy']()[_0x2cef('0x22')](function(){_0x521512[_0x2cef('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20d2d4,_0x45ee04){return function(_0x416ce4){if(!_0x416ce4){_0x20d2d4[_0x2cef('0x23')](0x194);}return _0x416ce4;};}function handleError(_0x367741,_0x9631c0){_0x9631c0=_0x9631c0||0x1f4;return function(_0x1243d6){logger[_0x2cef('0x24')](_0x1243d6[_0x2cef('0x25')]);if(_0x1243d6[_0x2cef('0x26')]){delete _0x1243d6[_0x2cef('0x26')];}_0x367741[_0x2cef('0x1a')](_0x9631c0)[_0x2cef('0x27')](_0x1243d6);};}exports[_0x2cef('0x28')]=function(_0x3d7b48,_0xd3fa46){var _0x10b65a={},_0x2f2c70={},_0x1872b0={'count':0x0,'rows':[]};var _0x4ca85a=_['map'](db[_0x2cef('0x29')][_0x2cef('0x2a')],function(_0x3ee72c){return{'name':_0x3ee72c[_0x2cef('0x2b')],'type':_0x3ee72c[_0x2cef('0x2c')][_0x2cef('0x2d')]};});_0x2f2c70[_0x2cef('0x2e')]=_[_0x2cef('0x2f')](_0x4ca85a,_0x2cef('0x26'));_0x2f2c70[_0x2cef('0x30')]=_[_0x2cef('0x31')](_0x3d7b48[_0x2cef('0x30')]);_0x2f2c70[_0x2cef('0x32')]=_[_0x2cef('0x33')](_0x2f2c70['model'],_0x2f2c70[_0x2cef('0x30')]);_0x10b65a['attributes']=_[_0x2cef('0x33')](_0x2f2c70[_0x2cef('0x2e')],qs[_0x2cef('0x34')](_0x3d7b48[_0x2cef('0x30')][_0x2cef('0x34')]));_0x10b65a[_0x2cef('0x35')]=_0x10b65a[_0x2cef('0x35')]['length']?_0x10b65a['attributes']:_0x2f2c70['model'];if(!_0x3d7b48[_0x2cef('0x30')][_0x2cef('0x36')]('nolimit')){_0x10b65a['limit']=qs[_0x2cef('0x37')](_0x3d7b48['query']['limit']);_0x10b65a[_0x2cef('0x17')]=qs['offset'](_0x3d7b48[_0x2cef('0x30')][_0x2cef('0x17')]);}_0x10b65a[_0x2cef('0x38')]=qs[_0x2cef('0x39')](_0x3d7b48[_0x2cef('0x30')]['sort']);_0x10b65a['where']=qs['filters'](_[_0x2cef('0x3a')](_0x3d7b48[_0x2cef('0x30')],_0x2f2c70[_0x2cef('0x32')]),_0x4ca85a);if(_0x3d7b48[_0x2cef('0x30')][_0x2cef('0x3b')]){_0x10b65a[_0x2cef('0x3c')]=_['merge'](_0x10b65a['where'],{'$or':_['map'](_0x4ca85a,function(_0x1b000a){if(_0x1b000a['type']!==_0x2cef('0x3d')){var _0x431080={};_0x431080[_0x1b000a[_0x2cef('0x26')]]={'$like':'%'+_0x3d7b48[_0x2cef('0x30')][_0x2cef('0x3b')]+'%'};return _0x431080;}})});}_0x10b65a=_[_0x2cef('0x3e')]({},_0x10b65a,_0x3d7b48['options']);var _0x332937={'where':_0x10b65a[_0x2cef('0x3c')]};return db[_0x2cef('0x29')]['count'](_0x332937)['then'](function(_0xfec542){_0x1872b0['count']=_0xfec542;if(_0x3d7b48[_0x2cef('0x30')]['includeAll']){_0x10b65a[_0x2cef('0x3f')]=[{'all':!![]}];}return db[_0x2cef('0x29')][_0x2cef('0x40')](_0x10b65a);})['then'](function(_0x3ab048){_0x1872b0[_0x2cef('0x41')]=_0x3ab048;return _0x1872b0;})[_0x2cef('0x22')](respondWithFilteredResult(_0xd3fa46,_0x10b65a))['catch'](handleError(_0xd3fa46,null));};exports[_0x2cef('0x42')]=function(_0x2b2149,_0x28335b){var _0x5209e6={'raw':!![],'where':{'id':_0x2b2149[_0x2cef('0x43')]['id']}},_0x1967c4={};_0x1967c4[_0x2cef('0x2e')]=_[_0x2cef('0x31')](db[_0x2cef('0x29')][_0x2cef('0x2a')]);_0x1967c4['query']=_[_0x2cef('0x31')](_0x2b2149[_0x2cef('0x30')]);_0x1967c4[_0x2cef('0x32')]=_['intersection'](_0x1967c4[_0x2cef('0x2e')],_0x1967c4[_0x2cef('0x30')]);_0x5209e6['attributes']=_['intersection'](_0x1967c4['model'],qs[_0x2cef('0x34')](_0x2b2149[_0x2cef('0x30')]['fields']));_0x5209e6[_0x2cef('0x35')]=_0x5209e6['attributes'][_0x2cef('0x44')]?_0x5209e6[_0x2cef('0x35')]:_0x1967c4[_0x2cef('0x2e')];if(_0x2b2149[_0x2cef('0x30')][_0x2cef('0x45')]){_0x5209e6[_0x2cef('0x3f')]=[{'all':!![]}];}_0x5209e6=_[_0x2cef('0x3e')]({},_0x5209e6,_0x2b2149['options']);return db[_0x2cef('0x29')][_0x2cef('0x46')](_0x5209e6)[_0x2cef('0x22')](handleEntityNotFound(_0x28335b,null))['then'](respondWithResult(_0x28335b,null))[_0x2cef('0x47')](handleError(_0x28335b,null));};exports[_0x2cef('0x48')]=function(_0x5c02a3,_0x5e440f){var _0x54aaa4={'where':{'id':_0x5c02a3[_0x2cef('0x43')]['id']}},_0x49b4ef={};_0x49b4ef[_0x2cef('0x2e')]=_['keys'](db[_0x2cef('0x29')]['rawAttributes']);_0x54aaa4[_0x2cef('0x35')]=_[_0x2cef('0x33')](_0x49b4ef['model'],qs['fields'](_0x5c02a3[_0x2cef('0x30')][_0x2cef('0x34')]));_0x54aaa4[_0x2cef('0x35')]=_0x54aaa4[_0x2cef('0x35')][_0x2cef('0x44')]?_0x54aaa4[_0x2cef('0x35')]:_0x49b4ef['model'];if(_0x5c02a3[_0x2cef('0x30')][_0x2cef('0x45')]){_0x54aaa4[_0x2cef('0x3f')]=[{'all':!![]}];}_0x54aaa4=_[_0x2cef('0x3e')]({},_0x54aaa4,_0x5c02a3[_0x2cef('0x49')]);return db[_0x2cef('0x29')][_0x2cef('0x46')](_0x54aaa4)['then'](handleEntityNotFound(_0x5e440f,null))['then'](function(_0x40febf){if(_0x40febf){var _0x5e6255=_0x40febf['get']({'plain':!![]});_0x5e6255=qs['omit'](_0x5e6255,['id',_0x2cef('0x4a'),'updatedAt']);_0x5c02a3[_0x2cef('0x4b')]=_[_0x2cef('0x4c')](_0x5c02a3[_0x2cef('0x4b')],['id',_0x2cef('0x4a'),'updatedAt']);return db[_0x2cef('0x29')]['create'](_[_0x2cef('0x3e')](_0x5e6255,_0x5c02a3[_0x2cef('0x4b')]),{'include':_0x5c02a3[_0x2cef('0x30')][_0x2cef('0x45')]?[{'all':!![]}]:undefined});}})[_0x2cef('0x22')](respondWithResult(_0x5e440f,0xc9))[_0x2cef('0x47')](handleError(_0x5e440f,null));};exports['update']=function(_0x162191,_0x58aa30){if(_0x162191[_0x2cef('0x4b')]['id']){delete _0x162191['body']['id'];}return db['Attachment']['find']({'where':{'id':_0x162191[_0x2cef('0x43')]['id']}})['then'](handleEntityNotFound(_0x58aa30,null))[_0x2cef('0x22')](saveUpdates(_0x162191[_0x2cef('0x4b')],null))['then'](respondWithResult(_0x58aa30,null))[_0x2cef('0x47')](handleError(_0x58aa30,null));};exports[_0x2cef('0x4d')]=function(_0x227951,_0x25b05e){return db['Attachment']['find']({'where':{'id':_0x227951[_0x2cef('0x43')]['id']}})[_0x2cef('0x22')](handleEntityNotFound(_0x25b05e,null))[_0x2cef('0x22')](removeEntity(_0x25b05e,null))[_0x2cef('0x47')](handleError(_0x25b05e,null));};exports[_0x2cef('0x4e')]=function(_0x568c62,_0x3a7798,_0x544cca){_0x568c62[_0x2cef('0x4b')]['name']=_0x568c62[_0x2cef('0x4f')][_0x2cef('0x50')];_0x568c62['body'][_0x2cef('0x51')]=_0x568c62['file'][_0x2cef('0x52')];_0x568c62['body'][_0x2cef('0x2c')]=_0x568c62['file'][_0x2cef('0x53')];return db[_0x2cef('0x29')][_0x2cef('0x4e')](_0x568c62['body'])[_0x2cef('0x22')](respondWithResult(_0x3a7798,0xc9))[_0x2cef('0x47')](handleError(_0x3a7798,null));};exports[_0x2cef('0x54')]=function(_0x121b8a,_0x3903cd,_0x19d6b7){return db[_0x2cef('0x29')][_0x2cef('0x55')]({'where':{'id':_0x121b8a[_0x2cef('0x43')]['id']},'raw':!![]})[_0x2cef('0x22')](handleEntityNotFound(_0x3903cd,null))[_0x2cef('0x22')](function(_0x24729c){if(_0x24729c){var _0x49cb9b=_0x24729c[_0x2cef('0x56')]!==null;var _0x2869f2=path[_0x2cef('0x57')](config[_0x2cef('0x58')],_0x2cef('0x59'));if(_0x49cb9b){_0x2869f2=path[_0x2cef('0x57')](_0x2869f2,_0x2cef('0x5a'));}var _0x35527d=path['join'](_0x2869f2,_0x24729c[_0x2cef('0x51')]);return _0x3903cd[_0x2cef('0x54')](_0x35527d);}})[_0x2cef('0x47')](handleError(_0x3903cd,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 4e03c27..e9f87df 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 _0x05a9=['attachments','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','./attachment.attributes','exports','define','Attachment'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0x05a9,0x9b));var _0x905a=function(_0x2c3869,_0x514109){_0x2c3869=_0x2c3869-0x0;var _0x3af880=_0x05a9[_0x2c3869];return _0x3af880;};'use strict';var _=require(_0x905a('0x0'));var util=require('util');var logger=require(_0x905a('0x1'))('api');var moment=require(_0x905a('0x2'));var BPromise=require(_0x905a('0x3'));var rp=require(_0x905a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x905a('0x5'));var config=require('../../config/environment');var attributes=require(_0x905a('0x6'));module[_0x905a('0x7')]=function(_0x1933e6,_0x224201){return _0x1933e6[_0x905a('0x8')](_0x905a('0x9'),attributes,{'tableName':_0x905a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb1f9=['api','moment','bluebird','path','rimraf','../../config/environment','./attachment.attributes','define','Attachment','attachments','lodash','util'];(function(_0x5580b2,_0x1b008e){var _0x24be0d=function(_0x3bb607){while(--_0x3bb607){_0x5580b2['push'](_0x5580b2['shift']());}};_0x24be0d(++_0x1b008e);}(_0xb1f9,0x82));var _0x9b1f=function(_0x89418d,_0x1345c8){_0x89418d=_0x89418d-0x0;var _0x33577b=_0xb1f9[_0x89418d];return _0x33577b;};'use strict';var _=require(_0x9b1f('0x0'));var util=require(_0x9b1f('0x1'));var logger=require('../../config/logger')(_0x9b1f('0x2'));var moment=require(_0x9b1f('0x3'));var BPromise=require(_0x9b1f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9b1f('0x5'));var rimraf=require(_0x9b1f('0x6'));var config=require(_0x9b1f('0x7'));var attributes=require(_0x9b1f('0x8'));module['exports']=function(_0x56648c,_0x28f207){return _0x56648c[_0x9b1f('0x9')](_0x9b1f('0xa'),attributes,{'tableName':_0x9b1f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index 27d6220..00f55b1 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 _0xfa2b=['Attachment','create','options','raw','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','code','error','message','result','CreateAttachment'];(function(_0x41582d,_0x291b1c){var _0x59c504=function(_0x4d967e){while(--_0x4d967e){_0x41582d['push'](_0x41582d['shift']());}};_0x59c504(++_0x291b1c);}(_0xfa2b,0x1b7));var _0xbfa2=function(_0x14ff16,_0x18a9ab){_0x14ff16=_0x14ff16-0x0;var _0x16c67a=_0xfa2b[_0x14ff16];return _0x16c67a;};'use strict';var _=require(_0xbfa2('0x0'));var util=require(_0xbfa2('0x1'));var moment=require(_0xbfa2('0x2'));var BPromise=require(_0xbfa2('0x3'));var rs=require(_0xbfa2('0x4'));var fs=require('fs');var Redis=require(_0xbfa2('0x5'));var db=require(_0xbfa2('0x6'))['db'];var utils=require(_0xbfa2('0x7'));var logger=require(_0xbfa2('0x8'))(_0xbfa2('0x9'));var config=require(_0xbfa2('0xa'));var jayson=require(_0xbfa2('0xb'));var client=jayson[_0xbfa2('0xc')][_0xbfa2('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x26ed93,_0x26e9bf,_0x4cd9ae){return new BPromise(function(_0x46a151,_0x4f17e6){return client[_0xbfa2('0xe')](_0x26ed93,_0x4cd9ae)[_0xbfa2('0xf')](function(_0x1b1c13){logger[_0xbfa2('0x10')](_0xbfa2('0x11'),_0x26e9bf,_0xbfa2('0x12'));logger[_0xbfa2('0x13')](_0xbfa2('0x14'),_0x26e9bf,_0xbfa2('0x12'),JSON['stringify'](_0x1b1c13));if(_0x1b1c13['error']){if(_0x1b1c13['error'][_0xbfa2('0x15')]===0x1f4){logger[_0xbfa2('0x16')](_0xbfa2('0x11'),_0x26e9bf,_0x1b1c13[_0xbfa2('0x16')][_0xbfa2('0x17')]);return _0x4f17e6(_0x1b1c13[_0xbfa2('0x16')]['message']);}logger[_0xbfa2('0x16')](_0xbfa2('0x11'),_0x26e9bf,_0x1b1c13[_0xbfa2('0x16')][_0xbfa2('0x17')]);return _0x46a151(_0x1b1c13[_0xbfa2('0x16')]['message']);}else{logger[_0xbfa2('0x10')]('Attachment,\x20%s,\x20%s',_0x26e9bf,'request\x20sent');_0x46a151(_0x1b1c13[_0xbfa2('0x18')]['message']);}})['catch'](function(_0xab2c91){logger[_0xbfa2('0x16')]('Attachment,\x20%s,\x20%s',_0x26e9bf,_0xab2c91);_0x4f17e6(_0xab2c91);});});}exports[_0xbfa2('0x19')]=function(_0x12627a){var _0x28fe6f=this;return new Promise(function(_0x4088c5,_0x37aed6){return db[_0xbfa2('0x1a')][_0xbfa2('0x1b')](_0x12627a['body'],{'raw':_0x12627a[_0xbfa2('0x1c')]?_0x12627a[_0xbfa2('0x1c')][_0xbfa2('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x2ac6c3){logger[_0xbfa2('0x10')]('CreateAttachment',_0x12627a);logger[_0xbfa2('0x13')]('CreateAttachment',_0x12627a,JSON['stringify'](_0x2ac6c3));_0x4088c5(_0x2ac6c3);})[_0xbfa2('0x1e')](function(_0xdb059b){logger[_0xbfa2('0x16')](_0xbfa2('0x19'),_0xdb059b['message'],_0x12627a);_0x37aed6(_0x28fe6f['error'](0x1f4,_0xdb059b[_0xbfa2('0x17')]));});});}; \ No newline at end of file +var _0xb6b1=['raw','lodash','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','Attachment,\x20%s,\x20%s','message','info','result','catch','CreateAttachment','Attachment','create','body','options'];(function(_0x16af15,_0x55bc76){var _0xfeda8a=function(_0x13ad56){while(--_0x13ad56){_0x16af15['push'](_0x16af15['shift']());}};_0xfeda8a(++_0x55bc76);}(_0xb6b1,0x17b));var _0x1b6b=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xb6b1[_0x1d1779];return _0x2377e9;};'use strict';var _=require(_0x1b6b('0x0'));var util=require('util');var moment=require(_0x1b6b('0x1'));var BPromise=require('bluebird');var rs=require(_0x1b6b('0x2'));var fs=require('fs');var Redis=require(_0x1b6b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1b6b('0x4'));var logger=require('../../config/logger')(_0x1b6b('0x5'));var config=require(_0x1b6b('0x6'));var jayson=require(_0x1b6b('0x7'));var client=jayson[_0x1b6b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41d09e,_0x51cfed,_0xae4115){return new BPromise(function(_0x5042f7,_0x21f403){return client[_0x1b6b('0x9')](_0x41d09e,_0xae4115)[_0x1b6b('0xa')](function(_0x29258a){logger['info']('Attachment,\x20%s,\x20%s',_0x51cfed,_0x1b6b('0xb'));logger[_0x1b6b('0xc')](_0x1b6b('0xd'),_0x51cfed,_0x1b6b('0xb'),JSON[_0x1b6b('0xe')](_0x29258a));if(_0x29258a[_0x1b6b('0xf')]){if(_0x29258a[_0x1b6b('0xf')]['code']===0x1f4){logger[_0x1b6b('0xf')](_0x1b6b('0x10'),_0x51cfed,_0x29258a[_0x1b6b('0xf')]['message']);return _0x21f403(_0x29258a[_0x1b6b('0xf')]['message']);}logger['error'](_0x1b6b('0x10'),_0x51cfed,_0x29258a[_0x1b6b('0xf')][_0x1b6b('0x11')]);return _0x5042f7(_0x29258a[_0x1b6b('0xf')][_0x1b6b('0x11')]);}else{logger[_0x1b6b('0x12')](_0x1b6b('0x10'),_0x51cfed,'request\x20sent');_0x5042f7(_0x29258a[_0x1b6b('0x13')][_0x1b6b('0x11')]);}})[_0x1b6b('0x14')](function(_0x33dc7e){logger['error'](_0x1b6b('0x10'),_0x51cfed,_0x33dc7e);_0x21f403(_0x33dc7e);});});}exports[_0x1b6b('0x15')]=function(_0x2e608b){var _0x59e671=this;return new Promise(function(_0x923711,_0x15d44b){return db[_0x1b6b('0x16')][_0x1b6b('0x17')](_0x2e608b[_0x1b6b('0x18')],{'raw':_0x2e608b[_0x1b6b('0x19')]?_0x2e608b[_0x1b6b('0x19')][_0x1b6b('0x1a')]===undefined?!![]:![]:!![]})[_0x1b6b('0xa')](function(_0x20a5a3){logger['info'](_0x1b6b('0x15'),_0x2e608b);logger[_0x1b6b('0xc')](_0x1b6b('0x15'),_0x2e608b,JSON[_0x1b6b('0xe')](_0x20a5a3));_0x923711(_0x20a5a3);})[_0x1b6b('0x14')](function(_0x276713){logger[_0x1b6b('0xf')](_0x1b6b('0x15'),_0x276713[_0x1b6b('0x11')],_0x2e608b);_0x15d44b(_0x59e671['error'](0x1f4,_0x276713[_0x1b6b('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 83de210..a4aa339 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 _0x2032=['./attachment.controller','get','isAuthenticated','index','/:id','show','download','/:id/clone','clone','root','server/files/attachments/','now','post','single','file','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x2ef8d9,_0x2fb8d0){var _0x18d1db=function(_0x4165bb){while(--_0x4165bb){_0x2ef8d9['push'](_0x2ef8d9['shift']());}};_0x18d1db(++_0x2fb8d0);}(_0x2032,0xd9));var _0x2203=function(_0xb6a7a6,_0x36f65f){_0xb6a7a6=_0xb6a7a6-0x0;var _0x4fdfb2=_0x2032[_0xb6a7a6];return _0x4fdfb2;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['post'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x849049,_0x4a6832,_0x3f690a){_0x3f690a(null,path['join'](config[_0x2203('0x10')],_0x2203('0x11')));},'filename':function(_0x4b9376,_0x583bc7,_0x585c76){_0x585c76(null,util['format']('%s-%s',Date[_0x2203('0x12')](),_0x583bc7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2203('0x13')]('/',upload[_0x2203('0x14')](_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x18')]);router[_0x2203('0x19')](_0x2203('0xb'),auth['isAuthenticated'](),controller[_0x2203('0x1a')]);module[_0x2203('0x1b')]=router; \ No newline at end of file +var _0x2032=['./attachment.controller','get','isAuthenticated','index','/:id','show','download','/:id/clone','clone','root','server/files/attachments/','now','post','single','file','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x407f8b,_0x139a19){var _0x692e66=function(_0x3cb0df){while(--_0x3cb0df){_0x407f8b['push'](_0x407f8b['shift']());}};_0x692e66(++_0x139a19);}(_0x2032,0xd9));var _0x2203=function(_0x9b6c7c,_0x27ee2c){_0x9b6c7c=_0x9b6c7c-0x0;var _0x26aa2f=_0x2032[_0x9b6c7c];return _0x26aa2f;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['post'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x849049,_0x4a6832,_0x3f690a){_0x3f690a(null,path['join'](config[_0x2203('0x10')],_0x2203('0x11')));},'filename':function(_0x4b9376,_0x583bc7,_0x585c76){_0x585c76(null,util['format']('%s-%s',Date[_0x2203('0x12')](),_0x583bc7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2203('0x13')]('/',upload[_0x2203('0x14')](_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x18')]);router[_0x2203('0x19')](_0x2203('0xb'),auth['isAuthenticated'](),controller[_0x2203('0x1a')]);module[_0x2203('0x1b')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index 0812d9d..9354cc3 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 _0x6a99=['undefined','error','Error\x20authenticate\x20%s:\x20%s','inspect','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','name','password','role','blocked','blockedAt','online','admin','user','agent','domain','clearBlockUser','getLicense','catch','status','login','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','use','User','passport','passport-local','moment','activedirectory2','../../mysqldb','../../components/auth/service','../../config/logger','activedirectory'];(function(_0xc26c95,_0xed8018){var _0x5626f6=function(_0x4dbc04){while(--_0x4dbc04){_0xc26c95['push'](_0xc26c95['shift']());}};_0x5626f6(++_0xed8018);}(_0x6a99,0x148));var _0x96a9=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6a99[_0x20a584];return _0x4b41a8;};'use strict';var passport=require(_0x96a9('0x0'));var LocalStrategy=require(_0x96a9('0x1'))['Strategy'];var moment=require(_0x96a9('0x2'));var ActiveDirectory=require(_0x96a9('0x3'));var BPromise=require('bluebird');var util=require('util');var db=require(_0x96a9('0x4'))['db'];var authService=require(_0x96a9('0x5'));var utils=require('../../config/utils');var config=require('../../config/environment');var logger=require(_0x96a9('0x6'))('api');function isActiveDirectoryConfigured(_0xa8aa2){var _0x4b7fbf=![];if(typeof _0xa8aa2[_0x96a9('0x7')]!==_0x96a9('0x8')){_0x4b7fbf=_0xa8aa2[_0x96a9('0x7')]['baseDN']&&_0xa8aa2[_0x96a9('0x7')]['url']&&_0xa8aa2['activedirectory']['domain'];}return _0x4b7fbf;}function adAuthenticate(_0x4fb216,_0x1d856f,_0xf0fbc1){return new BPromise(function(_0x16f995,_0x4e7ba9){try{var _0x26c207=new ActiveDirectory(_0x4fb216);_0x26c207['authenticate'](_0x1d856f,_0xf0fbc1,function(_0x5a8ab6,_0x16000f){if(_0x5a8ab6){logger[_0x96a9('0x9')](_0x96a9('0xa'),_0x1d856f,util[_0x96a9('0xb')](_0x5a8ab6,{'showHidden':![],'depth':null}));_0x4e7ba9('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x16000f){logger[_0x96a9('0x9')](_0x96a9('0xc'),_0x1d856f);_0x4e7ba9('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x16f995(_0x16000f);}});}catch(_0x201b2d){_0x4e7ba9(_0x201b2d);}});}function ActiveDirectoryAuthenticate(_0x4417df,_0x24be2f,_0x57041e,_0x4db3d3){var _0x31843a,_0x4a5208;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x96a9('0xd'),_0x24be2f);return _0x4db3d3(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x96a9('0xe')][_0x96a9('0xf')]({'where':{'id':0x1},'attributes':[_0x96a9('0x10'),_0x96a9('0x11')],'raw':!![]})[_0x96a9('0x12')](function(_0x1a7ac6){_0x31843a=_0x1a7ac6;if(!_0x31843a[_0x96a9('0x10')]){logger[_0x96a9('0x9')](_0x96a9('0x13'),_0x24be2f);throw new Error(_0x96a9('0x14'));}return _0x4417df['findOne']({'logging':!![],'attributes':['id',_0x96a9('0x15'),_0x96a9('0x16'),'salt',_0x96a9('0x17'),'disabled',_0x96a9('0x18'),_0x96a9('0x19'),_0x96a9('0x1a')],'where':{'name':_0x24be2f,'role':{'$or':[_0x96a9('0x1b'),_0x96a9('0x1c'),_0x96a9('0x1d')]},'adSsoEnabled':!![]}});})[_0x96a9('0x12')](function(_0x2b0d91){if(!_0x2b0d91||_0x2b0d91&&_0x2b0d91['name']!==_0x24be2f){throw new Error(_0x96a9('0x14'));}_0x4a5208=_0x2b0d91;var _0x51aa4b=_0x4a5208[_0x96a9('0x15')]+'@'+config[_0x96a9('0x7')][_0x96a9('0x1e')];return adAuthenticate(config[_0x96a9('0x7')],_0x51aa4b,_0x57041e);})[_0x96a9('0x12')](function(_0x191074){if(_0x4a5208['disabled']){throw new Error(_0x96a9('0x14'));}if(_0x31843a[_0x96a9('0x11')]>0x0){if(_0x4a5208[_0x96a9('0x18')]){if(moment(_0x4a5208[_0x96a9('0x19')])['add'](_0x31843a[_0x96a9('0x11')],'minutes')>moment()){throw new Error(_0x96a9('0x14'));}return utils[_0x96a9('0x1f')](_0x4a5208,0x0,![],null)[_0x96a9('0x12')](function(){return utils[_0x96a9('0x20')](_0x4a5208);})[_0x96a9('0x12')](function(){return _0x4db3d3(null,_0x4a5208);});}else{return utils['getLicense'](_0x4a5208)[_0x96a9('0x12')](function(){return _0x4db3d3(null,_0x4a5208);});}}else{return utils[_0x96a9('0x20')](_0x4a5208)[_0x96a9('0x12')](function(){return _0x4db3d3(null,_0x4a5208);});}})[_0x96a9('0x21')](function(_0x51d99d){return _0x4db3d3(null,![],_0x51d99d);});}function handleError(_0x120b79,_0x452cde,_0x16e0ec){return _0x120b79[_0x96a9('0x22')](_0x452cde||0x1f4)['send']({'message':_0x16e0ec?_0x16e0ec['message']||_0x16e0ec:''});}exports[_0x96a9('0x23')]=function(_0x210c82,_0x3b977f,_0x2b8ac3){passport[_0x96a9('0x24')](_0x96a9('0x25'),function(_0x387c99,_0x3d232f,_0x5b2dbc){var _0x39ad3f=_0x387c99||_0x5b2dbc;if(_0x39ad3f){return handleError(_0x3b977f,0x191,_0x39ad3f);}if(!_0x3d232f){return handleError(_0x3b977f,0x194,{'message':_0x96a9('0x26')});}else{var _0x66c693={'payload':{'id':_0x3d232f['id'],'role':_0x3d232f[_0x96a9('0x17')]},'options':{'expiresIn':0x15180}};return authService[_0x96a9('0x27')](_0x66c693)[_0x96a9('0x12')](function(_0x14c13b){_0x3b977f['json']({'id':_0x3d232f['id'],'token':_0x14c13b,'statusCall':'','isAlreadyLogged':_0x3d232f['online']});});}})(_0x210c82,_0x3b977f,_0x2b8ac3);};passport[_0x96a9('0x28')](_0x96a9('0x25'),new LocalStrategy({'usernameField':_0x96a9('0x15'),'passwordField':'password'},function(_0x1c0319,_0x177dc,_0x6a98c0){return ActiveDirectoryAuthenticate(db[_0x96a9('0x29')],_0x1c0319,_0x177dc,_0x6a98c0);})); \ No newline at end of file +var _0x0e00=['Error\x20authenticate\x20%s:\x20%s','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','then','password','disabled','blocked','blockedAt','online','user','agent','name','domain','add','minutes','getLicense','catch','status','send','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','User','passport','passport-local','Strategy','moment','activedirectory2','bluebird','../../mysqldb','../../components/auth/service','../../config/environment','../../config/logger','api','activedirectory','baseDN','url','authenticate'];(function(_0x2f99ee,_0x31cf40){var _0x1e5c1a=function(_0xdde07b){while(--_0xdde07b){_0x2f99ee['push'](_0x2f99ee['shift']());}};_0x1e5c1a(++_0x31cf40);}(_0x0e00,0x1ca));var _0x00e0=function(_0x5bd20f,_0x51e22c){_0x5bd20f=_0x5bd20f-0x0;var _0x24c6b0=_0x0e00[_0x5bd20f];return _0x24c6b0;};'use strict';var passport=require(_0x00e0('0x0'));var LocalStrategy=require(_0x00e0('0x1'))[_0x00e0('0x2')];var moment=require(_0x00e0('0x3'));var ActiveDirectory=require(_0x00e0('0x4'));var BPromise=require(_0x00e0('0x5'));var util=require('util');var db=require(_0x00e0('0x6'))['db'];var authService=require(_0x00e0('0x7'));var utils=require('../../config/utils');var config=require(_0x00e0('0x8'));var logger=require(_0x00e0('0x9'))(_0x00e0('0xa'));function isActiveDirectoryConfigured(_0x44127a){var _0x487946=![];if(typeof _0x44127a[_0x00e0('0xb')]!=='undefined'){_0x487946=_0x44127a['activedirectory'][_0x00e0('0xc')]&&_0x44127a['activedirectory'][_0x00e0('0xd')]&&_0x44127a[_0x00e0('0xb')]['domain'];}return _0x487946;}function adAuthenticate(_0x4595ad,_0x24cc0d,_0x369b68){return new BPromise(function(_0x40b581,_0x5d94ae){try{var _0x1588ae=new ActiveDirectory(_0x4595ad);_0x1588ae[_0x00e0('0xe')](_0x24cc0d,_0x369b68,function(_0x1e20c6,_0x293581){if(_0x1e20c6){logger['error'](_0x00e0('0xf'),_0x24cc0d,util['inspect'](_0x1e20c6,{'showHidden':![],'depth':null}));_0x5d94ae(_0x00e0('0x10'));}else if(!_0x293581){logger['error']('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x24cc0d);_0x5d94ae(_0x00e0('0x10'));}else{_0x40b581(_0x293581);}});}catch(_0x453d35){_0x5d94ae(_0x453d35);}});}function ActiveDirectoryAuthenticate(_0x28df2d,_0x48222b,_0x3c6a61,_0x3d5325){var _0x44503d,_0x4bf6c5;if(!isActiveDirectoryConfigured(config)){logger[_0x00e0('0x11')](_0x00e0('0x12'),_0x48222b);return _0x3d5325(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x00e0('0x13')][_0x00e0('0x14')]({'where':{'id':0x1},'attributes':[_0x00e0('0x15'),_0x00e0('0x16')],'raw':!![]})[_0x00e0('0x17')](function(_0x5610cb){_0x44503d=_0x5610cb;if(!_0x44503d[_0x00e0('0x15')]){logger[_0x00e0('0x11')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x48222b);throw new Error(_0x00e0('0x10'));}return _0x28df2d['findOne']({'logging':!![],'attributes':['id','name',_0x00e0('0x18'),'salt','role',_0x00e0('0x19'),_0x00e0('0x1a'),_0x00e0('0x1b'),_0x00e0('0x1c')],'where':{'name':_0x48222b,'role':{'$or':['admin',_0x00e0('0x1d'),_0x00e0('0x1e')]},'adSsoEnabled':!![]}});})[_0x00e0('0x17')](function(_0x3653ca){if(!_0x3653ca||_0x3653ca&&_0x3653ca['name']!==_0x48222b){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x4bf6c5=_0x3653ca;var _0x34def2=_0x4bf6c5[_0x00e0('0x1f')]+'@'+config[_0x00e0('0xb')][_0x00e0('0x20')];return adAuthenticate(config[_0x00e0('0xb')],_0x34def2,_0x3c6a61);})[_0x00e0('0x17')](function(_0x14b3a5){if(_0x4bf6c5[_0x00e0('0x19')]){throw new Error(_0x00e0('0x10'));}if(_0x44503d['blockDuration']>0x0){if(_0x4bf6c5[_0x00e0('0x1a')]){if(moment(_0x4bf6c5['blockedAt'])[_0x00e0('0x21')](_0x44503d['blockDuration'],_0x00e0('0x22'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils['clearBlockUser'](_0x4bf6c5,0x0,![],null)[_0x00e0('0x17')](function(){return utils[_0x00e0('0x23')](_0x4bf6c5);})['then'](function(){return _0x3d5325(null,_0x4bf6c5);});}else{return utils[_0x00e0('0x23')](_0x4bf6c5)[_0x00e0('0x17')](function(){return _0x3d5325(null,_0x4bf6c5);});}}else{return utils[_0x00e0('0x23')](_0x4bf6c5)[_0x00e0('0x17')](function(){return _0x3d5325(null,_0x4bf6c5);});}})[_0x00e0('0x24')](function(_0x273c20){return _0x3d5325(null,![],_0x273c20);});}function handleError(_0x5825e6,_0xed78f2,_0x5b6ce9){return _0x5825e6[_0x00e0('0x25')](_0xed78f2||0x1f4)[_0x00e0('0x26')]({'message':_0x5b6ce9?_0x5b6ce9['message']||_0x5b6ce9:''});}exports[_0x00e0('0x27')]=function(_0x3063a7,_0x5cb968,_0x381d9f){passport['authenticate'](_0x00e0('0x28'),function(_0x3158f6,_0x290332,_0x61707a){var _0x424cce=_0x3158f6||_0x61707a;if(_0x424cce){return handleError(_0x5cb968,0x191,_0x424cce);}if(!_0x290332){return handleError(_0x5cb968,0x194,{'message':_0x00e0('0x29')});}else{var _0x1bdde2={'payload':{'id':_0x290332['id'],'role':_0x290332['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x1bdde2)['then'](function(_0x3301c9){_0x5cb968['json']({'id':_0x290332['id'],'token':_0x3301c9,'statusCall':'','isAlreadyLogged':_0x290332['online']});});}})(_0x3063a7,_0x5cb968,_0x381d9f);};passport['use'](_0x00e0('0x28'),new LocalStrategy({'usernameField':'name','passwordField':_0x00e0('0x18')},function(_0x4fff50,_0x255c2e,_0x3aff47){return ActiveDirectoryAuthenticate(db[_0x00e0('0x2a')],_0x4fff50,_0x255c2e,_0x3aff47);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 5eca1dc..ab1b7a0 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 _0xcd5e=['login','exports','express','./authActiveDirectory.controller','post'];(function(_0x40df65,_0x317cec){var _0x3c0717=function(_0x128475){while(--_0x128475){_0x40df65['push'](_0x40df65['shift']());}};_0x3c0717(++_0x317cec);}(_0xcd5e,0xe8));var _0xecd5=function(_0xc33e1c,_0x52abd6){_0xc33e1c=_0xc33e1c-0x0;var _0x48a39d=_0xcd5e[_0xc33e1c];return _0x48a39d;};'use strict';var express=require(_0xecd5('0x0'));var router=express['Router']();var controller=require(_0xecd5('0x1'));router[_0xecd5('0x2')]('/',controller[_0xecd5('0x3')]);module[_0xecd5('0x4')]=router; \ No newline at end of file +var _0x1f7a=['express','Router','./authActiveDirectory.controller','post','login','exports'];(function(_0x4bfac3,_0x58324d){var _0x15f0f2=function(_0xf0c511){while(--_0xf0c511){_0x4bfac3['push'](_0x4bfac3['shift']());}};_0x15f0f2(++_0x58324d);}(_0x1f7a,0x114));var _0xa1f7=function(_0x34728b,_0x19fd7a){_0x34728b=_0x34728b-0x0;var _0x45ad5f=_0x1f7a[_0x34728b];return _0x45ad5f;};'use strict';var express=require(_0xa1f7('0x0'));var router=express[_0xa1f7('0x1')]();var controller=require(_0xa1f7('0x2'));router[_0xa1f7('0x3')]('/',controller[_0xa1f7('0x4')]);module[_0xa1f7('0x5')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index e42ea44..222efc0 100644 --- a/server/api/authGoogle/authGoogle.controller.js +++ b/server/api/authGoogle/authGoogle.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x7a54,0x106));var _0x47a5=function(_0xbfb1ac,_0x5352e9){_0xbfb1ac=_0xbfb1ac-0x0;var _0x79e76d=_0x7a54[_0xbfb1ac];return _0x79e76d;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file +var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0x7a54,0x106));var _0x47a5=function(_0x53ebc4,_0x1ea9a1){_0x53ebc4=_0x53ebc4-0x0;var _0x1886b3=_0x7a54[_0x53ebc4];return _0x1886b3;};'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 3627148..bcb7f38 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 _0xb7fb=['Router','../user/user.controller.js','../../components/auth/service','get','login','/callback','callback','isMiddleware','setTokenCookie','exports','express','passport'];(function(_0x319aee,_0x344705){var _0x596984=function(_0x277dad){while(--_0x277dad){_0x319aee['push'](_0x319aee['shift']());}};_0x596984(++_0x344705);}(_0xb7fb,0x76));var _0xbb7f=function(_0x485fc,_0x170c23){_0x485fc=_0x485fc-0x0;var _0x5ee62c=_0xb7fb[_0x485fc];return _0x5ee62c;};'use strict';var express=require(_0xbb7f('0x0'));var passport=require(_0xbb7f('0x1'));var router=express[_0xbb7f('0x2')]();var controller=require('./authGoogle.controller');var userController=require(_0xbb7f('0x3'));var authService=require(_0xbb7f('0x4'));router[_0xbb7f('0x5')]('/',controller[_0xbb7f('0x6')]);router[_0xbb7f('0x5')](_0xbb7f('0x7'),controller[_0xbb7f('0x8')],authService[_0xbb7f('0x9')],userController[_0xbb7f('0x6')],authService[_0xbb7f('0xa')]);module[_0xbb7f('0xb')]=router; \ No newline at end of file +var _0xab8f=['passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback','callback','setTokenCookie','exports','express'];(function(_0x504dc3,_0x547139){var _0x2d352c=function(_0x3cb526){while(--_0x3cb526){_0x504dc3['push'](_0x504dc3['shift']());}};_0x2d352c(++_0x547139);}(_0xab8f,0x12b));var _0xfab8=function(_0x68363c,_0x2b20ff){_0x68363c=_0x68363c-0x0;var _0x4b9418=_0xab8f[_0x68363c];return _0x4b9418;};'use strict';var express=require(_0xfab8('0x0'));var passport=require(_0xfab8('0x1'));var router=express[_0xfab8('0x2')]();var controller=require(_0xfab8('0x3'));var userController=require(_0xfab8('0x4'));var authService=require(_0xfab8('0x5'));router[_0xfab8('0x6')]('/',controller[_0xfab8('0x7')]);router[_0xfab8('0x6')](_0xfab8('0x8'),controller[_0xfab8('0x9')],authService['isMiddleware'],userController[_0xfab8('0x7')],authService[_0xfab8('0xa')]);module[_0xfab8('0xb')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index b70e0a5..9bb85c6 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 _0x6403=['login','authenticate','body','Email\x20parameter\x20is\x20missing','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','/reset/','send','Reset\x20Email\x20sent!','reset','params','token','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','password','status','Password\x20reset!','use','local-login','passport','passport-local','Strategy','lodash','randomstring','moment','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','salt','role','disabled','blockedAt','user','agent','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','loginAttempts','blocked','add','clearBlockUser','minutes','getLicense','catch','MailAccount','find','email','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','pass','format','SendMail','error','stringify','message'];(function(_0x2a8e5f,_0x317747){var _0x425b4a=function(_0x16b158){while(--_0x16b158){_0x2a8e5f['push'](_0x2a8e5f['shift']());}};_0x425b4a(++_0x317747);}(_0x6403,0x71));var _0x3640=function(_0x5c29ef,_0x4c73dd){_0x5c29ef=_0x5c29ef-0x0;var _0x2dad94=_0x6403[_0x5c29ef];return _0x2dad94;};'use strict';var util=require('util');var passport=require(_0x3640('0x0'));var LocalStrategy=require(_0x3640('0x1'))[_0x3640('0x2')];var jayson=require('jayson/promise');var _=require(_0x3640('0x3'));var rs=require(_0x3640('0x4'));var moment=require(_0x3640('0x5'));var db=require('../../mysqldb')['db'];var authService=require('../../components/auth/service');var utils=require(_0x3640('0x6'));var client=jayson[_0x3640('0x7')][_0x3640('0x8')]({'port':0x232b});function localAuthenticate(_0x466de0,_0x227068,_0x1c5509,_0x1d5726){var _0x2db085,_0x2042ae;return db[_0x3640('0x9')][_0x3640('0xa')]({'where':{'id':0x1},'attributes':[_0x3640('0xb'),_0x3640('0xc')],'raw':!![]})[_0x3640('0xd')](function(_0x2604db){_0x2db085=_0x2604db;return _0x466de0[_0x3640('0xa')]({'attributes':['id','name','password',_0x3640('0xe'),_0x3640('0xf'),_0x3640('0x10'),'blocked',_0x3640('0x11'),'loginAttempts'],'where':{'name':_0x227068,'role':{'$or':['admin',_0x3640('0x12'),_0x3640('0x13')]}}});})['then'](function(_0xa2a20d){if(!_0xa2a20d||_0xa2a20d&&_0xa2a20d[_0x3640('0x14')]!==_0x227068){throw new Error(_0x3640('0x15'));}else{_0x2042ae=_0xa2a20d;return _0x2042ae;}})[_0x3640('0xd')](function(){_0x2042ae['authenticate'](_0x1c5509,function(_0x3f03ba,_0x538f1b){var _0x57ce78=_0x2042ae[_0x3640('0x16')]+0x1;if(_0x3f03ba){return _0x1d5726(_0x3f03ba);}else if(!_0x538f1b){if(_0x2042ae['disabled']){return _0x1d5726(null,![],{'message':_0x3640('0x15')});}else if(_0x2db085['allowedLoginAttempts']>0x0){if(_0x2042ae[_0x3640('0x17')]){if(_0x2db085[_0x3640('0xc')]>0x0){if(moment(_0x2042ae[_0x3640('0x11')])[_0x3640('0x18')](_0x2db085[_0x3640('0xc')],'minutes')>moment()){return _0x1d5726(null,![],{'message':_0x3640('0x15')});}else{return utils[_0x3640('0x19')](_0x2042ae,_0x57ce78,![],null)[_0x3640('0xd')](function(){return _0x1d5726(null,![],{'message':_0x3640('0x15')});});}}else{return _0x1d5726(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x57ce78>=_0x2db085[_0x3640('0xb')]){return utils[_0x3640('0x19')](_0x2042ae,0x0,!![],moment())[_0x3640('0xd')](function(){return _0x1d5726(null,![],{'message':_0x3640('0x15')});});}else{return utils[_0x3640('0x19')](_0x2042ae,_0x57ce78,![],null)['then'](function(){return _0x1d5726(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x1d5726(null,![],{'message':_0x3640('0x15')});}}else{if(_0x2042ae[_0x3640('0x10')]){return _0x1d5726(null,![],{'message':_0x3640('0x15')});}else if(_0x2db085[_0x3640('0xb')]>0x0){if(_0x2042ae['blocked']){if(_0x2db085[_0x3640('0xc')]>0x0){if(moment(_0x2042ae[_0x3640('0x11')])[_0x3640('0x18')](_0x2db085[_0x3640('0xc')],_0x3640('0x1a'))>moment()){return _0x1d5726(null,![],{'message':_0x3640('0x15')});}else{return utils[_0x3640('0x19')](_0x2042ae,0x0,![],null)[_0x3640('0xd')](function(){return utils[_0x3640('0x1b')](_0x2042ae);})['then'](function(){return _0x1d5726(null,_0x2042ae);});}}else{return _0x1d5726(null,![],{'message':_0x3640('0x15')});}}else{return utils[_0x3640('0x19')](_0x2042ae,0x0,![],null)[_0x3640('0xd')](function(){return utils[_0x3640('0x1b')](_0x2042ae);})[_0x3640('0xd')](function(){return _0x1d5726(null,_0x2042ae);})[_0x3640('0x1c')](function(_0x520c87){return _0x1d5726(null,![],_0x520c87);});}}else{if(_0x2042ae['blocked']){return _0x1d5726(null,![],{'message':_0x3640('0x15')});}else{return utils['getLicense'](_0x2042ae)[_0x3640('0xd')](function(){return _0x1d5726(null,_0x2042ae);});}}}});})[_0x3640('0x1c')](function(_0x1f307f){return _0x1d5726(null,![],_0x1f307f);});}function sendServiceMail(_0xfec7b9){return db[_0x3640('0x1d')][_0x3640('0x1e')]({'where':{'service':!![]},'attributes':['id',_0x3640('0x14'),_0x3640('0x1f')],'include':[{'model':db['MailServerOut'],'as':_0x3640('0x20')}]})[_0x3640('0xd')](function(_0xa2de9a){if(!_0xa2de9a){throw new Error(_0x3640('0x21'));}var _0x476a46={'tls':{'rejectUnauthorized':![]}};if(_0xa2de9a[_0x3640('0x20')][_0x3640('0x22')]){_0x476a46[_0x3640('0x22')]=_0xa2de9a[_0x3640('0x20')]['service'];}else{_0x476a46['host']=_0xa2de9a[_0x3640('0x20')][_0x3640('0x23')];_0x476a46[_0x3640('0x24')]=_0xa2de9a[_0x3640('0x20')][_0x3640('0x24')];_0x476a46['secure']=_0xa2de9a[_0x3640('0x20')][_0x3640('0x25')];}if(_0xa2de9a['Smtp'][_0x3640('0x26')]){_0x476a46['auth']={'user':_0xa2de9a[_0x3640('0x20')][_0x3640('0x12')],'pass':_0xa2de9a['Smtp'][_0x3640('0x27')]};}var _0x355d68={'account':_0x476a46,'message':_['merge']({'from':util[_0x3640('0x28')]('\x22%s\x22\x20<%s>',_0xa2de9a[_0x3640('0x14')],_0xa2de9a[_0x3640('0x1f')]||_0xa2de9a[_0x3640('0x20')][_0x3640('0x12')])},_0xfec7b9)};return client['request'](_0x3640('0x29'),_0x355d68);})[_0x3640('0xd')](function(_0x90cf36){if(_0x90cf36[_0x3640('0x2a')]){throw new Error(util[_0x3640('0x28')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x90cf36[_0x3640('0x2a')]['message']||JSON[_0x3640('0x2b')](_0x90cf36['error'])));}return!![];});}function handleError(_0x4fdf56,_0x1ba96d,_0x2b975f){return _0x4fdf56['status'](_0x1ba96d||0x1f4)['send']({'message':_0x2b975f?_0x2b975f[_0x3640('0x2c')]||_0x2b975f:''});}exports[_0x3640('0x2d')]=function(_0x19bf95,_0x52ede4,_0x47c897){passport[_0x3640('0x2e')]('local-login',function(_0x5bc006,_0x479705,_0x42e1a2){var _0x2d6418=_0x5bc006||_0x42e1a2;if(_0x2d6418){return handleError(_0x52ede4,0x191,_0x2d6418);}if(!_0x479705){return handleError(_0x52ede4,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x4a2368={'payload':{'id':_0x479705['id'],'role':_0x479705[_0x3640('0xf')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x4a2368)['then'](function(_0x489f3d){_0x52ede4['json']({'id':_0x479705['id'],'token':_0x489f3d,'statusCall':'','isAlreadyLogged':_0x479705['online']});});}})(_0x19bf95,_0x52ede4,_0x47c897);};exports['forgot']=function(_0x292fdf,_0x275652,_0x5a76f9){if(!_0x292fdf[_0x3640('0x2f')]['email']){return handleError(_0x275652,0x1f4,{'message':_0x3640('0x30')});}var _0x19bb22=rs['generate']();_0x292fdf[_0x3640('0x2f')][_0x3640('0x1f')]=_0x292fdf[_0x3640('0x2f')][_0x3640('0x1f')][_0x3640('0x31')]()[_0x3640('0x32')]();var _0x494e99;return db[_0x3640('0x9')][_0x3640('0xa')]({'where':{'id':0x1},'attributes':[_0x3640('0xb'),_0x3640('0xc')],'raw':!![]})[_0x3640('0xd')](function(_0xdace8e){_0x494e99=_0xdace8e;return db[_0x3640('0x33')][_0x3640('0x1e')]({'where':{'email':_0x292fdf[_0x3640('0x2f')][_0x3640('0x1f')]}});})[_0x3640('0xd')](function(_0xb26788){if(!_0xb26788){throw new Error(_0x3640('0x34'));}if(_0xb26788[_0x3640('0x10')]){throw new Error(_0x3640('0x35'));}if(_0xb26788[_0x3640('0x17')]){if(moment(_0xb26788[_0x3640('0x11')])['add'](_0x494e99['blockDuration'],_0x3640('0x1a'))>moment()){throw new Error(_0x3640('0x36'));}else{_0xb26788[_0x3640('0x17')]=![];_0xb26788['blockedAt']=null;}}_0xb26788[_0x3640('0x37')]=_0x19bb22;_0xb26788[_0x3640('0x38')]=Date[_0x3640('0x39')]()+0x36ee80;return _0xb26788[_0x3640('0x3a')]();})['then'](function(){return sendServiceMail({'to':_0x292fdf[_0x3640('0x2f')][_0x3640('0x1f')],'subject':_0x3640('0x3b'),'text':_0x3640('0x3c')+_0x3640('0x3d')+_0x3640('0x3e')+_0x292fdf['headers']['host']+_0x3640('0x3f')+_0x19bb22+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})['then'](function(){_0x275652['status'](0xc8)[_0x3640('0x40')]({'message':_0x3640('0x41')});})['catch'](function(_0x539acd){return handleError(_0x275652,0x1f4,_0x539acd);});};exports[_0x3640('0x42')]=function(_0x48be2e,_0x43ff2d,_0xd708e0){return db[_0x3640('0x33')][_0x3640('0x1e')]({'where':{'resetPasswordToken':_0x48be2e[_0x3640('0x43')][_0x3640('0x44')],'resetPasswordExpires':{'$gt':Date[_0x3640('0x39')]()}}})[_0x3640('0xd')](function(_0x3e1a71){if(!_0x3e1a71){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0x3640('0x9')][_0x3640('0xa')]({'attributes':['id',_0x3640('0x45'),_0x3640('0x46'),_0x3640('0x47')]})[_0x3640('0xd')](function(_0x157b9f){if(_0x157b9f[_0x3640('0x45')])authService[_0x3640('0x48')](_0x48be2e[_0x3640('0x2f')]['password']);if(!_0x157b9f[_0x3640('0x46')]||!_0x3e1a71[_0x3640('0x49')])return _0x3e1a71;authService['validatePasswordHistory'](_0x48be2e[_0x3640('0x2f')][_0x3640('0x4a')],_0x3e1a71[_0x3640('0x49')],_0x157b9f['passwordHistoryLimit']);return _0x3e1a71;})['then'](function(){_0x3e1a71[_0x3640('0x4a')]=_0x48be2e[_0x3640('0x2f')][_0x3640('0x4a')];_0x3e1a71[_0x3640('0x37')]=null;_0x3e1a71[_0x3640('0x38')]=null;return _0x3e1a71[_0x3640('0x3a')]();});})['then'](function(){_0x43ff2d[_0x3640('0x4b')](0xc8)[_0x3640('0x40')]({'message':_0x3640('0x4c')});})[_0x3640('0x1c')](function(_0x109c31){return handleError(_0x43ff2d,0x1f4,_0x109c31);});};passport[_0x3640('0x4d')](_0x3640('0x4e'),new LocalStrategy({'usernameField':_0x3640('0x14'),'passwordField':'password'},function(_0x5e3418,_0x3f7ef0,_0x2ac1bc){return localAuthenticate(db[_0x3640('0x33')],_0x5e3418,_0x3f7ef0,_0x2ac1bc);})); \ No newline at end of file +var _0x1bac=['http','Setting','findOne','blockDuration','name','salt','blocked','blockedAt','loginAttempts','admin','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','disabled','allowedLoginAttempts','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','authentication','auth','pass','merge','format','user','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','status','send','message','login','authenticate','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','online','forgot','Email\x20parameter\x20is\x20missing','body','toLowerCase','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','add','resetPasswordExpires','now','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','validatePasswordPattern','password','enforcePasswordHistory','previousPasswords','validatePasswordHistory','resetPasswordToken','use','util','passport','passport-local','Strategy','randomstring','../../mysqldb','../../components/auth/service','client'];(function(_0x5e0ce6,_0x2fa775){var _0x1393e1=function(_0x54ae0a){while(--_0x54ae0a){_0x5e0ce6['push'](_0x5e0ce6['shift']());}};_0x1393e1(++_0x2fa775);}(_0x1bac,0xfa));var _0xc1ba=function(_0x1f28e4,_0x2b41ae){_0x1f28e4=_0x1f28e4-0x0;var _0x3e5acd=_0x1bac[_0x1f28e4];return _0x3e5acd;};'use strict';var util=require(_0xc1ba('0x0'));var passport=require(_0xc1ba('0x1'));var LocalStrategy=require(_0xc1ba('0x2'))[_0xc1ba('0x3')];var jayson=require('jayson/promise');var _=require('lodash');var rs=require(_0xc1ba('0x4'));var moment=require('moment');var db=require(_0xc1ba('0x5'))['db'];var authService=require(_0xc1ba('0x6'));var utils=require('../../config/utils');var client=jayson[_0xc1ba('0x7')][_0xc1ba('0x8')]({'port':0x232b});function localAuthenticate(_0x3327b2,_0x1a2b8d,_0x5aaa96,_0x1cd076){var _0x16f361,_0x330ceb;return db[_0xc1ba('0x9')][_0xc1ba('0xa')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xc1ba('0xb')],'raw':!![]})['then'](function(_0x198d84){_0x16f361=_0x198d84;return _0x3327b2[_0xc1ba('0xa')]({'attributes':['id',_0xc1ba('0xc'),'password',_0xc1ba('0xd'),'role','disabled',_0xc1ba('0xe'),_0xc1ba('0xf'),_0xc1ba('0x10')],'where':{'name':_0x1a2b8d,'role':{'$or':[_0xc1ba('0x11'),'user','agent']}}});})[_0xc1ba('0x12')](function(_0x538d77){if(!_0x538d77||_0x538d77&&_0x538d77[_0xc1ba('0xc')]!==_0x1a2b8d){throw new Error(_0xc1ba('0x13'));}else{_0x330ceb=_0x538d77;return _0x330ceb;}})['then'](function(){_0x330ceb['authenticate'](_0x5aaa96,function(_0x82eaa5,_0x3c382b){var _0x58a014=_0x330ceb[_0xc1ba('0x10')]+0x1;if(_0x82eaa5){return _0x1cd076(_0x82eaa5);}else if(!_0x3c382b){if(_0x330ceb[_0xc1ba('0x14')]){return _0x1cd076(null,![],{'message':_0xc1ba('0x13')});}else if(_0x16f361[_0xc1ba('0x15')]>0x0){if(_0x330ceb['blocked']){if(_0x16f361['blockDuration']>0x0){if(moment(_0x330ceb[_0xc1ba('0xf')])['add'](_0x16f361['blockDuration'],_0xc1ba('0x16'))>moment()){return _0x1cd076(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x330ceb,_0x58a014,![],null)[_0xc1ba('0x12')](function(){return _0x1cd076(null,![],{'message':_0xc1ba('0x13')});});}}else{return _0x1cd076(null,![],{'message':_0xc1ba('0x13')});}}else{if(_0x58a014>=_0x16f361[_0xc1ba('0x15')]){return utils[_0xc1ba('0x17')](_0x330ceb,0x0,!![],moment())[_0xc1ba('0x12')](function(){return _0x1cd076(null,![],{'message':_0xc1ba('0x13')});});}else{return utils['clearBlockUser'](_0x330ceb,_0x58a014,![],null)[_0xc1ba('0x12')](function(){return _0x1cd076(null,![],{'message':_0xc1ba('0x13')});});}}}else{return _0x1cd076(null,![],{'message':_0xc1ba('0x13')});}}else{if(_0x330ceb[_0xc1ba('0x14')]){return _0x1cd076(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x16f361[_0xc1ba('0x15')]>0x0){if(_0x330ceb[_0xc1ba('0xe')]){if(_0x16f361[_0xc1ba('0xb')]>0x0){if(moment(_0x330ceb[_0xc1ba('0xf')])['add'](_0x16f361['blockDuration'],_0xc1ba('0x16'))>moment()){return _0x1cd076(null,![],{'message':_0xc1ba('0x13')});}else{return utils[_0xc1ba('0x17')](_0x330ceb,0x0,![],null)[_0xc1ba('0x12')](function(){return utils[_0xc1ba('0x18')](_0x330ceb);})[_0xc1ba('0x12')](function(){return _0x1cd076(null,_0x330ceb);});}}else{return _0x1cd076(null,![],{'message':_0xc1ba('0x13')});}}else{return utils[_0xc1ba('0x17')](_0x330ceb,0x0,![],null)[_0xc1ba('0x12')](function(){return utils[_0xc1ba('0x18')](_0x330ceb);})[_0xc1ba('0x12')](function(){return _0x1cd076(null,_0x330ceb);})[_0xc1ba('0x19')](function(_0xbc27b9){return _0x1cd076(null,![],_0xbc27b9);});}}else{if(_0x330ceb[_0xc1ba('0xe')]){return _0x1cd076(null,![],{'message':_0xc1ba('0x13')});}else{return utils[_0xc1ba('0x18')](_0x330ceb)['then'](function(){return _0x1cd076(null,_0x330ceb);});}}}});})['catch'](function(_0x1b7044){return _0x1cd076(null,![],_0x1b7044);});}function sendServiceMail(_0x109b32){return db[_0xc1ba('0x1a')][_0xc1ba('0x1b')]({'where':{'service':!![]},'attributes':['id',_0xc1ba('0xc'),_0xc1ba('0x1c')],'include':[{'model':db[_0xc1ba('0x1d')],'as':_0xc1ba('0x1e')}]})[_0xc1ba('0x12')](function(_0x4b2c6c){if(!_0x4b2c6c){throw new Error(_0xc1ba('0x1f'));}var _0xf9e497={'tls':{'rejectUnauthorized':![]}};if(_0x4b2c6c[_0xc1ba('0x1e')][_0xc1ba('0x20')]){_0xf9e497['service']=_0x4b2c6c[_0xc1ba('0x1e')]['service'];}else{_0xf9e497['host']=_0x4b2c6c['Smtp'][_0xc1ba('0x21')];_0xf9e497[_0xc1ba('0x22')]=_0x4b2c6c[_0xc1ba('0x1e')][_0xc1ba('0x22')];_0xf9e497['secure']=_0x4b2c6c['Smtp']['secure'];}if(_0x4b2c6c[_0xc1ba('0x1e')][_0xc1ba('0x23')]){_0xf9e497[_0xc1ba('0x24')]={'user':_0x4b2c6c[_0xc1ba('0x1e')]['user'],'pass':_0x4b2c6c['Smtp'][_0xc1ba('0x25')]};}var _0x219276={'account':_0xf9e497,'message':_[_0xc1ba('0x26')]({'from':util[_0xc1ba('0x27')]('\x22%s\x22\x20<%s>',_0x4b2c6c['name'],_0x4b2c6c['email']||_0x4b2c6c['Smtp'][_0xc1ba('0x28')])},_0x109b32)};return client[_0xc1ba('0x29')](_0xc1ba('0x2a'),_0x219276);})[_0xc1ba('0x12')](function(_0x1ad3d5){if(_0x1ad3d5[_0xc1ba('0x2b')]){throw new Error(util[_0xc1ba('0x27')](_0xc1ba('0x2c'),_0x1ad3d5[_0xc1ba('0x2b')]['message']||JSON[_0xc1ba('0x2d')](_0x1ad3d5[_0xc1ba('0x2b')])));}return!![];});}function handleError(_0x4f459b,_0x3e6945,_0x2897d1){return _0x4f459b[_0xc1ba('0x2e')](_0x3e6945||0x1f4)[_0xc1ba('0x2f')]({'message':_0x2897d1?_0x2897d1[_0xc1ba('0x30')]||_0x2897d1:''});}exports[_0xc1ba('0x31')]=function(_0x270122,_0x591bec,_0x2d0bbe){passport[_0xc1ba('0x32')](_0xc1ba('0x33'),function(_0x496a40,_0x4bdee9,_0x3ea7d0){var _0x2195b2=_0x496a40||_0x3ea7d0;if(_0x2195b2){return handleError(_0x591bec,0x191,_0x2195b2);}if(!_0x4bdee9){return handleError(_0x591bec,0x194,{'message':_0xc1ba('0x34')});}else{var _0x29ea78={'payload':{'id':_0x4bdee9['id'],'role':_0x4bdee9[_0xc1ba('0x35')]},'options':{'expiresIn':0x15180}};return authService[_0xc1ba('0x36')](_0x29ea78)[_0xc1ba('0x12')](function(_0x46bc75){_0x591bec[_0xc1ba('0x37')]({'id':_0x4bdee9['id'],'token':_0x46bc75,'statusCall':'','isAlreadyLogged':_0x4bdee9[_0xc1ba('0x38')]});});}})(_0x270122,_0x591bec,_0x2d0bbe);};exports[_0xc1ba('0x39')]=function(_0x589704,_0x4c5e58,_0x59745d){if(!_0x589704['body'][_0xc1ba('0x1c')]){return handleError(_0x4c5e58,0x1f4,{'message':_0xc1ba('0x3a')});}var _0x18ae38=rs['generate']();_0x589704[_0xc1ba('0x3b')][_0xc1ba('0x1c')]=_0x589704['body'][_0xc1ba('0x1c')]['trim']()[_0xc1ba('0x3c')]();var _0x4be9f8;return db[_0xc1ba('0x9')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xc1ba('0xb')],'raw':!![]})[_0xc1ba('0x12')](function(_0x3d408c){_0x4be9f8=_0x3d408c;return db[_0xc1ba('0x3d')]['find']({'where':{'email':_0x589704[_0xc1ba('0x3b')][_0xc1ba('0x1c')]}});})[_0xc1ba('0x12')](function(_0x170e34){if(!_0x170e34){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x170e34[_0xc1ba('0x14')]){throw new Error(_0xc1ba('0x3e'));}if(_0x170e34[_0xc1ba('0xe')]){if(moment(_0x170e34[_0xc1ba('0xf')])[_0xc1ba('0x3f')](_0x4be9f8[_0xc1ba('0xb')],_0xc1ba('0x16'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x170e34[_0xc1ba('0xe')]=![];_0x170e34[_0xc1ba('0xf')]=null;}}_0x170e34['resetPasswordToken']=_0x18ae38;_0x170e34[_0xc1ba('0x40')]=Date[_0xc1ba('0x41')]()+0x36ee80;return _0x170e34['save']();})[_0xc1ba('0x12')](function(){return sendServiceMail({'to':_0x589704[_0xc1ba('0x3b')][_0xc1ba('0x1c')],'subject':_0xc1ba('0x42'),'text':_0xc1ba('0x43')+_0xc1ba('0x44')+_0xc1ba('0x45')+_0x589704[_0xc1ba('0x46')][_0xc1ba('0x21')]+'/reset/'+_0x18ae38+'\x0a\x0a'+_0xc1ba('0x47')});})[_0xc1ba('0x12')](function(){_0x4c5e58[_0xc1ba('0x2e')](0xc8)[_0xc1ba('0x2f')]({'message':_0xc1ba('0x48')});})['catch'](function(_0x198984){return handleError(_0x4c5e58,0x1f4,_0x198984);});};exports[_0xc1ba('0x49')]=function(_0x671f,_0x402c64,_0x2b6008){return db[_0xc1ba('0x3d')][_0xc1ba('0x1b')]({'where':{'resetPasswordToken':_0x671f[_0xc1ba('0x4a')][_0xc1ba('0x4b')],'resetPasswordExpires':{'$gt':Date[_0xc1ba('0x41')]()}}})[_0xc1ba('0x12')](function(_0x24f9e5){if(!_0x24f9e5){throw new Error(_0xc1ba('0x4c'));}return db[_0xc1ba('0x9')][_0xc1ba('0xa')]({'attributes':['id',_0xc1ba('0x4d'),'enforcePasswordHistory',_0xc1ba('0x4e')]})[_0xc1ba('0x12')](function(_0x252265){if(_0x252265['securePassword'])authService[_0xc1ba('0x4f')](_0x671f[_0xc1ba('0x3b')][_0xc1ba('0x50')]);if(!_0x252265[_0xc1ba('0x51')]||!_0x24f9e5[_0xc1ba('0x52')])return _0x24f9e5;authService[_0xc1ba('0x53')](_0x671f[_0xc1ba('0x3b')][_0xc1ba('0x50')],_0x24f9e5[_0xc1ba('0x52')],_0x252265['passwordHistoryLimit']);return _0x24f9e5;})['then'](function(){_0x24f9e5[_0xc1ba('0x50')]=_0x671f[_0xc1ba('0x3b')]['password'];_0x24f9e5[_0xc1ba('0x54')]=null;_0x24f9e5[_0xc1ba('0x40')]=null;return _0x24f9e5['save']();});})[_0xc1ba('0x12')](function(){_0x402c64[_0xc1ba('0x2e')](0xc8)[_0xc1ba('0x2f')]({'message':'Password\x20reset!'});})[_0xc1ba('0x19')](function(_0x1a1ada){return handleError(_0x402c64,0x1f4,_0x1a1ada);});};passport[_0xc1ba('0x55')](_0xc1ba('0x33'),new LocalStrategy({'usernameField':_0xc1ba('0xc'),'passwordField':_0xc1ba('0x50')},function(_0x55cf55,_0x56abaf,_0x271d4a){return localAuthenticate(db[_0xc1ba('0x3d')],_0x55cf55,_0x56abaf,_0x271d4a);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 9d0e615..a328f9c 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 _0xeba4=['/reset/:token','reset','exports','express','Router','./authLocal.controller','post','login','forgot'];(function(_0x30f73d,_0x5387af){var _0x20b23d=function(_0x387c1b){while(--_0x387c1b){_0x30f73d['push'](_0x30f73d['shift']());}};_0x20b23d(++_0x5387af);}(_0xeba4,0xc0));var _0x4eba=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0xeba4[_0x3fba9f];return _0x192cf1;};'use strict';var express=require(_0x4eba('0x0'));var router=express[_0x4eba('0x1')]();var controller=require(_0x4eba('0x2'));router[_0x4eba('0x3')]('/',controller[_0x4eba('0x4')]);router['post']('/forgot',controller[_0x4eba('0x5')]);router[_0x4eba('0x3')](_0x4eba('0x6'),controller[_0x4eba('0x7')]);module[_0x4eba('0x8')]=router; \ No newline at end of file +var _0x4312=['./authLocal.controller','post','login','/forgot','/reset/:token','exports','express','Router'];(function(_0x230aed,_0x35cddd){var _0x2a98a6=function(_0x5e0f07){while(--_0x5e0f07){_0x230aed['push'](_0x230aed['shift']());}};_0x2a98a6(++_0x35cddd);}(_0x4312,0x9e));var _0x2431=function(_0x178f3e,_0x567056){_0x178f3e=_0x178f3e-0x0;var _0x2c73ab=_0x4312[_0x178f3e];return _0x2c73ab;};'use strict';var express=require(_0x2431('0x0'));var router=express[_0x2431('0x1')]();var controller=require(_0x2431('0x2'));router[_0x2431('0x3')]('/',controller[_0x2431('0x4')]);router[_0x2431('0x3')](_0x2431('0x5'),controller['forgot']);router[_0x2431('0x3')](_0x2431('0x6'),controller['reset']);module[_0x2431('0x7')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 0621020..7a77bce 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 _0xa9c0=['INTEGER','sequelize','exports','STRING'];(function(_0x5ca79e,_0x185d0e){var _0x8d5177=function(_0x19f16c){while(--_0x19f16c){_0x5ca79e['push'](_0x5ca79e['shift']());}};_0x8d5177(++_0x185d0e);}(_0xa9c0,0x1a9));var _0x0a9c=function(_0x9e1f67,_0x1d30c1){_0x9e1f67=_0x9e1f67-0x0;var _0x8a177d=_0xa9c0[_0x9e1f67];return _0x8a177d;};'use strict';var Sequelize=require(_0x0a9c('0x0'));module[_0x0a9c('0x1')]={'name':{'type':Sequelize[_0x0a9c('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x0a9c('0x2')]},'description':{'type':Sequelize[_0x0a9c('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x0a9c('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0xa550=['sequelize','exports','STRING','INTEGER'];(function(_0x21a1a6,_0x1474bf){var _0x5cec0e=function(_0x13abb9){while(--_0x13abb9){_0x21a1a6['push'](_0x21a1a6['shift']());}};_0x5cec0e(++_0x1474bf);}(_0xa550,0x1a4));var _0x0a55=function(_0x2d31b8,_0x242597){_0x2d31b8=_0x2d31b8-0x0;var _0x547be0=_0xa550[_0x2d31b8];return _0x547be0;};'use strict';var Sequelize=require(_0x0a55('0x0'));module[_0x0a55('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x0a55('0x2')]},'description':{'type':Sequelize[_0x0a55('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x0a55('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 d7acc8a..9ed7428 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 _0xcd70=['end','error','name','send','index','map','Automation','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','then','rows','catch','params','find','create','body','omit','ids','getConditions','findOne','Condition','rawAttributes','addActions','getActions','Action','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy'];(function(_0x57104f,_0x15879c){var _0x234152=function(_0x4b0a79){while(--_0x4b0a79){_0x57104f['push'](_0x57104f['shift']());}};_0x234152(++_0x15879c);}(_0xcd70,0x1c2));var _0x0cd7=function(_0x817d9b,_0x3c37e3){_0x817d9b=_0x817d9b-0x0;var _0x2752e1=_0xcd70[_0x817d9b];return _0x2752e1;};'use strict';var emlformat=require(_0x0cd7('0x0'));var rimraf=require(_0x0cd7('0x1'));var zipdir=require(_0x0cd7('0x2'));var jsonpatch=require(_0x0cd7('0x3'));var rp=require(_0x0cd7('0x4'));var moment=require(_0x0cd7('0x5'));var BPromise=require(_0x0cd7('0x6'));var Mustache=require(_0x0cd7('0x7'));var util=require(_0x0cd7('0x8'));var path=require(_0x0cd7('0x9'));var sox=require(_0x0cd7('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0cd7('0xb'));var _=require(_0x0cd7('0xc'));var squel=require(_0x0cd7('0xd'));var crypto=require(_0x0cd7('0xe'));var jsforce=require(_0x0cd7('0xf'));var deskjs=require(_0x0cd7('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0cd7('0x11'));var Redis=require(_0x0cd7('0x12'));var authService=require(_0x0cd7('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x0cd7('0x14'));var hardwareService=require(_0x0cd7('0x15'));var logger=require(_0x0cd7('0x16'))('api');var utils=require(_0x0cd7('0x17'));var config=require(_0x0cd7('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1e4019,_0x440a9e){_0x440a9e=_0x440a9e||0xcc;return function(_0x73d96b){if(_0x73d96b){return _0x1e4019[_0x0cd7('0x19')](_0x440a9e);}return _0x1e4019[_0x0cd7('0x1a')](_0x440a9e)['end']();};}function respondWithResult(_0x5319e9,_0x5d7ee0){_0x5d7ee0=_0x5d7ee0||0xc8;return function(_0x1a63b8){if(_0x1a63b8){return _0x5319e9[_0x0cd7('0x1a')](_0x5d7ee0)[_0x0cd7('0x1b')](_0x1a63b8);}};}function respondWithFilteredResult(_0x22c3fe,_0x2207c5){return function(_0x19834f){if(_0x19834f){var _0x2c0698=typeof _0x2207c5[_0x0cd7('0x1c')]===_0x0cd7('0x1d')&&typeof _0x2207c5[_0x0cd7('0x1e')]==='undefined';var _0xacb65e=_0x19834f['count'];var _0x526141=_0x2c0698?0x0:_0x2207c5['offset'];var _0x3c69e0=_0x2c0698?_0x19834f[_0x0cd7('0x1f')]:_0x2207c5[_0x0cd7('0x1c')]+_0x2207c5['limit'];var _0x3e1e06;if(_0x3c69e0>=_0xacb65e){_0x3c69e0=_0xacb65e;_0x3e1e06=0xc8;}else{_0x3e1e06=0xce;}_0x22c3fe[_0x0cd7('0x1a')](_0x3e1e06);return _0x22c3fe[_0x0cd7('0x20')](_0x0cd7('0x21'),_0x526141+'-'+_0x3c69e0+'/'+_0xacb65e)['json'](_0x19834f);}return null;};}function patchUpdates(_0x23a2d0){return function(_0x4c5db4){try{jsonpatch['apply'](_0x4c5db4,_0x23a2d0,!![]);}catch(_0x4e91c0){return BPromise['reject'](_0x4e91c0);}return _0x4c5db4['save']();};}function saveUpdates(_0x2b0e11,_0x4138eb){return function(_0x30942a){if(_0x30942a){return _0x30942a[_0x0cd7('0x22')](_0x2b0e11)['then'](function(_0x3c3d6a){return _0x3c3d6a;});}return null;};}function removeEntity(_0x59de24,_0x16881d){return function(_0x2fc374){if(_0x2fc374){return _0x2fc374[_0x0cd7('0x23')]()['then'](function(){_0x59de24[_0x0cd7('0x1a')](0xcc)[_0x0cd7('0x24')]();});}};}function handleEntityNotFound(_0x4728c7,_0x235eee){return function(_0x1d6f8c){if(!_0x1d6f8c){_0x4728c7['sendStatus'](0x194);}return _0x1d6f8c;};}function handleError(_0x39f79e,_0x285f79){_0x285f79=_0x285f79||0x1f4;return function(_0x350f23){logger[_0x0cd7('0x25')](_0x350f23['stack']);if(_0x350f23['name']){delete _0x350f23[_0x0cd7('0x26')];}_0x39f79e[_0x0cd7('0x1a')](_0x285f79)[_0x0cd7('0x27')](_0x350f23);};}exports[_0x0cd7('0x28')]=function(_0x325717,_0x1d81ca){var _0x65fea0={},_0x2da9e2={},_0x3219aa={'count':0x0,'rows':[]};var _0x57d59a=_[_0x0cd7('0x29')](db[_0x0cd7('0x2a')]['rawAttributes'],function(_0x4e61dc){return{'name':_0x4e61dc[_0x0cd7('0x2b')],'type':_0x4e61dc[_0x0cd7('0x2c')]['key']};});_0x2da9e2[_0x0cd7('0x2d')]=_[_0x0cd7('0x29')](_0x57d59a,_0x0cd7('0x26'));_0x2da9e2[_0x0cd7('0x2e')]=_[_0x0cd7('0x2f')](_0x325717[_0x0cd7('0x2e')]);_0x2da9e2[_0x0cd7('0x30')]=_['intersection'](_0x2da9e2[_0x0cd7('0x2d')],_0x2da9e2[_0x0cd7('0x2e')]);_0x65fea0[_0x0cd7('0x31')]=_[_0x0cd7('0x32')](_0x2da9e2[_0x0cd7('0x2d')],qs[_0x0cd7('0x33')](_0x325717[_0x0cd7('0x2e')]['fields']));_0x65fea0[_0x0cd7('0x31')]=_0x65fea0[_0x0cd7('0x31')][_0x0cd7('0x34')]?_0x65fea0['attributes']:_0x2da9e2[_0x0cd7('0x2d')];if(!_0x325717[_0x0cd7('0x2e')][_0x0cd7('0x35')](_0x0cd7('0x36'))){_0x65fea0['limit']=qs['limit'](_0x325717[_0x0cd7('0x2e')][_0x0cd7('0x1e')]);_0x65fea0[_0x0cd7('0x1c')]=qs[_0x0cd7('0x1c')](_0x325717['query']['offset']);}_0x65fea0[_0x0cd7('0x37')]=qs[_0x0cd7('0x38')](_0x325717['query']['sort']);_0x65fea0[_0x0cd7('0x39')]=qs[_0x0cd7('0x30')](_[_0x0cd7('0x3a')](_0x325717['query'],_0x2da9e2['filters']),_0x57d59a);if(_0x325717[_0x0cd7('0x2e')][_0x0cd7('0x3b')]){_0x65fea0['where']=_[_0x0cd7('0x3c')](_0x65fea0[_0x0cd7('0x39')],{'$or':_['map'](_0x57d59a,function(_0x2a43df){if(_0x2a43df['type']!==_0x0cd7('0x3d')){var _0x133b9d={};_0x133b9d[_0x2a43df[_0x0cd7('0x26')]]={'$like':'%'+_0x325717[_0x0cd7('0x2e')][_0x0cd7('0x3b')]+'%'};return _0x133b9d;}})});}_0x65fea0=_['merge']({},_0x65fea0,_0x325717[_0x0cd7('0x3e')]);var _0x2a355f={'where':_0x65fea0[_0x0cd7('0x39')]};return db['Automation']['count'](_0x2a355f)['then'](function(_0x3b61be){_0x3219aa[_0x0cd7('0x1f')]=_0x3b61be;if(_0x325717['query'][_0x0cd7('0x3f')]){_0x65fea0[_0x0cd7('0x40')]=[{'all':!![]}];}return db[_0x0cd7('0x2a')]['findAll'](_0x65fea0);})[_0x0cd7('0x41')](function(_0x41b826){_0x3219aa[_0x0cd7('0x42')]=_0x41b826;return _0x3219aa;})['then'](respondWithFilteredResult(_0x1d81ca,_0x65fea0))[_0x0cd7('0x43')](handleError(_0x1d81ca,null));};exports['show']=function(_0x4b6334,_0x58c6f3){var _0x3f4a86={'raw':![],'where':{'id':_0x4b6334[_0x0cd7('0x44')]['id']}},_0x3dc960={};_0x3dc960[_0x0cd7('0x2d')]=_[_0x0cd7('0x2f')](db[_0x0cd7('0x2a')]['rawAttributes']);_0x3dc960[_0x0cd7('0x2e')]=_[_0x0cd7('0x2f')](_0x4b6334[_0x0cd7('0x2e')]);_0x3dc960[_0x0cd7('0x30')]=_['intersection'](_0x3dc960[_0x0cd7('0x2d')],_0x3dc960[_0x0cd7('0x2e')]);_0x3f4a86[_0x0cd7('0x31')]=_['intersection'](_0x3dc960[_0x0cd7('0x2d')],qs[_0x0cd7('0x33')](_0x4b6334[_0x0cd7('0x2e')]['fields']));_0x3f4a86['attributes']=_0x3f4a86[_0x0cd7('0x31')][_0x0cd7('0x34')]?_0x3f4a86['attributes']:_0x3dc960[_0x0cd7('0x2d')];if(_0x4b6334[_0x0cd7('0x2e')][_0x0cd7('0x3f')]){_0x3f4a86[_0x0cd7('0x40')]=[{'all':!![]}];}_0x3f4a86=_[_0x0cd7('0x3c')]({},_0x3f4a86,_0x4b6334['options']);return db[_0x0cd7('0x2a')][_0x0cd7('0x45')](_0x3f4a86)[_0x0cd7('0x41')](handleEntityNotFound(_0x58c6f3,null))[_0x0cd7('0x41')](respondWithResult(_0x58c6f3,null))[_0x0cd7('0x43')](handleError(_0x58c6f3,null));};exports[_0x0cd7('0x46')]=function(_0x13b9a6,_0x5a337a){return db[_0x0cd7('0x2a')][_0x0cd7('0x46')](_0x13b9a6[_0x0cd7('0x47')],{})['then'](respondWithResult(_0x5a337a,0xc9))[_0x0cd7('0x43')](handleError(_0x5a337a,null));};exports[_0x0cd7('0x22')]=function(_0x8e81cc,_0x5b6b63){if(_0x8e81cc['body']['id']){delete _0x8e81cc['body']['id'];}return db[_0x0cd7('0x2a')][_0x0cd7('0x45')]({'where':{'id':_0x8e81cc['params']['id']}})[_0x0cd7('0x41')](handleEntityNotFound(_0x5b6b63,null))[_0x0cd7('0x41')](saveUpdates(_0x8e81cc[_0x0cd7('0x47')],null))[_0x0cd7('0x41')](respondWithResult(_0x5b6b63,null))['catch'](handleError(_0x5b6b63,null));};exports['destroy']=function(_0x35eaa9,_0x26e05e){return db[_0x0cd7('0x2a')][_0x0cd7('0x45')]({'where':{'id':_0x35eaa9[_0x0cd7('0x44')]['id']}})[_0x0cd7('0x41')](handleEntityNotFound(_0x26e05e,null))[_0x0cd7('0x41')](removeEntity(_0x26e05e,null))['catch'](handleError(_0x26e05e,null));};exports['addConditions']=function(_0x2646d4,_0xea5dec,_0x303c94){return db['Condition'][_0x0cd7('0x45')]({'where':{'id':_0x2646d4[_0x0cd7('0x44')]['id']}})[_0x0cd7('0x41')](handleEntityNotFound(_0xea5dec,null))[_0x0cd7('0x41')](function(_0x13902d){if(_0x13902d){return _0x13902d['addConditions'](_0x2646d4['body']['ids'],_[_0x0cd7('0x48')](_0x2646d4[_0x0cd7('0x47')],[_0x0cd7('0x49'),'id'])||{});}})[_0x0cd7('0x41')](respondWithResult(_0xea5dec,null))['catch'](handleError(_0xea5dec,null));};exports[_0x0cd7('0x4a')]=function(_0x3683a7,_0x47d2bb,_0x407dcb){var _0x402c7c={};var _0x3b8665={};var _0x1bcec6;var _0x2823da;return db['Automation'][_0x0cd7('0x4b')]({'where':{'id':_0x3683a7[_0x0cd7('0x44')]['id']}})['then'](handleEntityNotFound(_0x47d2bb,null))[_0x0cd7('0x41')](function(_0x26138a){if(_0x26138a){_0x1bcec6=_0x26138a;_0x3b8665[_0x0cd7('0x2d')]=_[_0x0cd7('0x2f')](db[_0x0cd7('0x4c')][_0x0cd7('0x4d')]);_0x3b8665[_0x0cd7('0x2e')]=_[_0x0cd7('0x2f')](_0x3683a7[_0x0cd7('0x2e')]);_0x3b8665[_0x0cd7('0x30')]=_[_0x0cd7('0x32')](_0x3b8665[_0x0cd7('0x2d')],_0x3b8665[_0x0cd7('0x2e')]);_0x402c7c['attributes']=_['intersection'](_0x3b8665[_0x0cd7('0x2d')],qs[_0x0cd7('0x33')](_0x3683a7[_0x0cd7('0x2e')][_0x0cd7('0x33')]));_0x402c7c[_0x0cd7('0x31')]=_0x402c7c[_0x0cd7('0x31')][_0x0cd7('0x34')]?_0x402c7c[_0x0cd7('0x31')]:_0x3b8665[_0x0cd7('0x2d')];_0x402c7c['order']=qs['sort'](_0x3683a7['query'][_0x0cd7('0x38')]);_0x402c7c['where']=qs['filters'](_[_0x0cd7('0x3a')](_0x3683a7[_0x0cd7('0x2e')],_0x3b8665[_0x0cd7('0x30')]));if(_0x3683a7[_0x0cd7('0x2e')][_0x0cd7('0x3b')]){_0x402c7c[_0x0cd7('0x39')]=_[_0x0cd7('0x3c')](_0x402c7c[_0x0cd7('0x39')],{'$or':_[_0x0cd7('0x29')](_0x402c7c['attributes'],function(_0x4dc7b1){var _0x50f8e6={};_0x50f8e6[_0x4dc7b1]={'$like':'%'+_0x3683a7[_0x0cd7('0x2e')]['filter']+'%'};return _0x50f8e6;})});}_0x402c7c=_[_0x0cd7('0x3c')]({},_0x402c7c,_0x3683a7[_0x0cd7('0x3e')]);return _0x1bcec6[_0x0cd7('0x4a')](_0x402c7c);}})[_0x0cd7('0x41')](function(_0x2816b0){if(_0x2816b0){_0x2823da=_0x2816b0['length'];if(!_0x3683a7[_0x0cd7('0x2e')][_0x0cd7('0x35')](_0x0cd7('0x36'))){_0x402c7c[_0x0cd7('0x1e')]=qs['limit'](_0x3683a7[_0x0cd7('0x2e')][_0x0cd7('0x1e')]);_0x402c7c['offset']=qs[_0x0cd7('0x1c')](_0x3683a7[_0x0cd7('0x2e')]['offset']);}return _0x1bcec6[_0x0cd7('0x4a')](_0x402c7c);}})[_0x0cd7('0x41')](function(_0x112417){if(_0x112417){return _0x112417?{'count':_0x2823da,'rows':_0x112417}:null;}})[_0x0cd7('0x41')](respondWithResult(_0x47d2bb,null))[_0x0cd7('0x43')](handleError(_0x47d2bb,null));};exports[_0x0cd7('0x4e')]=function(_0x5e643f,_0x413a20,_0xb1fe20){return db['Action']['find']({'where':{'id':_0x5e643f[_0x0cd7('0x44')]['id']}})[_0x0cd7('0x41')](handleEntityNotFound(_0x413a20,null))[_0x0cd7('0x41')](function(_0x14da63){if(_0x14da63){return _0x14da63[_0x0cd7('0x4e')](_0x5e643f[_0x0cd7('0x47')][_0x0cd7('0x49')],_['omit'](_0x5e643f[_0x0cd7('0x47')],[_0x0cd7('0x49'),'id'])||{});}})[_0x0cd7('0x41')](respondWithResult(_0x413a20,null))['catch'](handleError(_0x413a20,null));};exports[_0x0cd7('0x4f')]=function(_0x391248,_0x33d7d4,_0x5be048){var _0x58162b={};var _0xf374b={};var _0x2cfb68;var _0xd1c99d;return db[_0x0cd7('0x2a')][_0x0cd7('0x4b')]({'where':{'id':_0x391248[_0x0cd7('0x44')]['id']}})[_0x0cd7('0x41')](handleEntityNotFound(_0x33d7d4,null))[_0x0cd7('0x41')](function(_0x541fff){if(_0x541fff){_0x2cfb68=_0x541fff;_0xf374b[_0x0cd7('0x2d')]=_[_0x0cd7('0x2f')](db[_0x0cd7('0x50')][_0x0cd7('0x4d')]);_0xf374b[_0x0cd7('0x2e')]=_[_0x0cd7('0x2f')](_0x391248[_0x0cd7('0x2e')]);_0xf374b[_0x0cd7('0x30')]=_[_0x0cd7('0x32')](_0xf374b[_0x0cd7('0x2d')],_0xf374b['query']);_0x58162b[_0x0cd7('0x31')]=_['intersection'](_0xf374b[_0x0cd7('0x2d')],qs[_0x0cd7('0x33')](_0x391248[_0x0cd7('0x2e')]['fields']));_0x58162b['attributes']=_0x58162b[_0x0cd7('0x31')][_0x0cd7('0x34')]?_0x58162b[_0x0cd7('0x31')]:_0xf374b[_0x0cd7('0x2d')];_0x58162b['order']=qs['sort'](_0x391248['query'][_0x0cd7('0x38')]);_0x58162b[_0x0cd7('0x39')]=qs[_0x0cd7('0x30')](_['pick'](_0x391248[_0x0cd7('0x2e')],_0xf374b[_0x0cd7('0x30')]));if(_0x391248['query']['filter']){_0x58162b[_0x0cd7('0x39')]=_[_0x0cd7('0x3c')](_0x58162b[_0x0cd7('0x39')],{'$or':_[_0x0cd7('0x29')](_0x58162b[_0x0cd7('0x31')],function(_0x348768){var _0x1211d3={};_0x1211d3[_0x348768]={'$like':'%'+_0x391248[_0x0cd7('0x2e')]['filter']+'%'};return _0x1211d3;})});}_0x58162b=_[_0x0cd7('0x3c')]({},_0x58162b,_0x391248[_0x0cd7('0x3e')]);return _0x2cfb68['getActions'](_0x58162b);}})['then'](function(_0x97fea6){if(_0x97fea6){_0xd1c99d=_0x97fea6['length'];if(!_0x391248['query'][_0x0cd7('0x35')](_0x0cd7('0x36'))){_0x58162b[_0x0cd7('0x1e')]=qs[_0x0cd7('0x1e')](_0x391248['query']['limit']);_0x58162b[_0x0cd7('0x1c')]=qs[_0x0cd7('0x1c')](_0x391248[_0x0cd7('0x2e')][_0x0cd7('0x1c')]);}return _0x2cfb68[_0x0cd7('0x4f')](_0x58162b);}})['then'](function(_0x121ac7){if(_0x121ac7){return _0x121ac7?{'count':_0xd1c99d,'rows':_0x121ac7}:null;}})[_0x0cd7('0x41')](respondWithResult(_0x33d7d4,null))['catch'](handleError(_0x33d7d4,null));}; \ No newline at end of file +var _0x9bec=['sendStatus','status','end','json','offset','undefined','limit','count','apply','update','then','destroy','name','index','map','Automation','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','length','includeAll','find','body','params','addConditions','Condition','ids','findOne','getConditions','nolimit','addActions','Action','omit','getActions','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x9bec,0xd2));var _0xc9be=function(_0x50aa2e,_0xfbd6f0){_0x50aa2e=_0x50aa2e-0x0;var _0x5e07f0=_0x9bec[_0x50aa2e];return _0x5e07f0;};'use strict';var emlformat=require(_0xc9be('0x0'));var rimraf=require(_0xc9be('0x1'));var zipdir=require(_0xc9be('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc9be('0x3'));var moment=require('moment');var BPromise=require(_0xc9be('0x4'));var Mustache=require(_0xc9be('0x5'));var util=require(_0xc9be('0x6'));var path=require(_0xc9be('0x7'));var sox=require(_0xc9be('0x8'));var csv=require(_0xc9be('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc9be('0xa'));var _=require('lodash');var squel=require(_0xc9be('0xb'));var crypto=require(_0xc9be('0xc'));var jsforce=require(_0xc9be('0xd'));var deskjs=require(_0xc9be('0xe'));var toCsv=require(_0xc9be('0x9'));var querystring=require(_0xc9be('0xf'));var Papa=require('papaparse');var Redis=require(_0xc9be('0x10'));var authService=require(_0xc9be('0x11'));var qs=require(_0xc9be('0x12'));var as=require(_0xc9be('0x13'));var hardwareService=require(_0xc9be('0x14'));var logger=require(_0xc9be('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xc9be('0x16'));var licenseUtil=require(_0xc9be('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf3448a,_0x3e2c1f){_0x3e2c1f=_0x3e2c1f||0xcc;return function(_0x1798d2){if(_0x1798d2){return _0xf3448a[_0xc9be('0x18')](_0x3e2c1f);}return _0xf3448a[_0xc9be('0x19')](_0x3e2c1f)[_0xc9be('0x1a')]();};}function respondWithResult(_0x252f22,_0x2fc944){_0x2fc944=_0x2fc944||0xc8;return function(_0x2d3cd7){if(_0x2d3cd7){return _0x252f22[_0xc9be('0x19')](_0x2fc944)[_0xc9be('0x1b')](_0x2d3cd7);}};}function respondWithFilteredResult(_0x4896cd,_0x576013){return function(_0x4b0f02){if(_0x4b0f02){var _0x378eec=typeof _0x576013[_0xc9be('0x1c')]===_0xc9be('0x1d')&&typeof _0x576013[_0xc9be('0x1e')]===_0xc9be('0x1d');var _0x5e3087=_0x4b0f02[_0xc9be('0x1f')];var _0x1616b6=_0x378eec?0x0:_0x576013['offset'];var _0x2419ea=_0x378eec?_0x4b0f02[_0xc9be('0x1f')]:_0x576013[_0xc9be('0x1c')]+_0x576013[_0xc9be('0x1e')];var _0x1f397a;if(_0x2419ea>=_0x5e3087){_0x2419ea=_0x5e3087;_0x1f397a=0xc8;}else{_0x1f397a=0xce;}_0x4896cd[_0xc9be('0x19')](_0x1f397a);return _0x4896cd['set']('Content-Range',_0x1616b6+'-'+_0x2419ea+'/'+_0x5e3087)[_0xc9be('0x1b')](_0x4b0f02);}return null;};}function patchUpdates(_0x57e883){return function(_0x1df3cd){try{jsonpatch[_0xc9be('0x20')](_0x1df3cd,_0x57e883,!![]);}catch(_0x16c00b){return BPromise['reject'](_0x16c00b);}return _0x1df3cd['save']();};}function saveUpdates(_0x10b93a,_0x5459fd){return function(_0x436a83){if(_0x436a83){return _0x436a83[_0xc9be('0x21')](_0x10b93a)[_0xc9be('0x22')](function(_0x39c2f9){return _0x39c2f9;});}return null;};}function removeEntity(_0x5ca2f8,_0x48514e){return function(_0x429fa9){if(_0x429fa9){return _0x429fa9[_0xc9be('0x23')]()[_0xc9be('0x22')](function(){_0x5ca2f8[_0xc9be('0x19')](0xcc)[_0xc9be('0x1a')]();});}};}function handleEntityNotFound(_0x3ef1df,_0x153265){return function(_0x3f6aaa){if(!_0x3f6aaa){_0x3ef1df[_0xc9be('0x18')](0x194);}return _0x3f6aaa;};}function handleError(_0x3bacc7,_0x19a0fd){_0x19a0fd=_0x19a0fd||0x1f4;return function(_0x231b05){logger['error'](_0x231b05['stack']);if(_0x231b05[_0xc9be('0x24')]){delete _0x231b05[_0xc9be('0x24')];}_0x3bacc7[_0xc9be('0x19')](_0x19a0fd)['send'](_0x231b05);};}exports[_0xc9be('0x25')]=function(_0x4b8c7c,_0x56afcf){var _0x1c60ea={},_0x1c79d7={},_0x57a90b={'count':0x0,'rows':[]};var _0x2ed48c=_[_0xc9be('0x26')](db[_0xc9be('0x27')][_0xc9be('0x28')],function(_0x121e98){return{'name':_0x121e98[_0xc9be('0x29')],'type':_0x121e98[_0xc9be('0x2a')]['key']};});_0x1c79d7[_0xc9be('0x2b')]=_[_0xc9be('0x26')](_0x2ed48c,_0xc9be('0x24'));_0x1c79d7['query']=_[_0xc9be('0x2c')](_0x4b8c7c[_0xc9be('0x2d')]);_0x1c79d7[_0xc9be('0x2e')]=_[_0xc9be('0x2f')](_0x1c79d7[_0xc9be('0x2b')],_0x1c79d7[_0xc9be('0x2d')]);_0x1c60ea[_0xc9be('0x30')]=_['intersection'](_0x1c79d7[_0xc9be('0x2b')],qs[_0xc9be('0x31')](_0x4b8c7c[_0xc9be('0x2d')]['fields']));_0x1c60ea[_0xc9be('0x30')]=_0x1c60ea[_0xc9be('0x30')]['length']?_0x1c60ea[_0xc9be('0x30')]:_0x1c79d7[_0xc9be('0x2b')];if(!_0x4b8c7c[_0xc9be('0x2d')][_0xc9be('0x32')]('nolimit')){_0x1c60ea[_0xc9be('0x1e')]=qs['limit'](_0x4b8c7c[_0xc9be('0x2d')]['limit']);_0x1c60ea[_0xc9be('0x1c')]=qs['offset'](_0x4b8c7c[_0xc9be('0x2d')]['offset']);}_0x1c60ea[_0xc9be('0x33')]=qs[_0xc9be('0x34')](_0x4b8c7c[_0xc9be('0x2d')][_0xc9be('0x34')]);_0x1c60ea[_0xc9be('0x35')]=qs[_0xc9be('0x2e')](_[_0xc9be('0x36')](_0x4b8c7c[_0xc9be('0x2d')],_0x1c79d7[_0xc9be('0x2e')]),_0x2ed48c);if(_0x4b8c7c['query'][_0xc9be('0x37')]){_0x1c60ea[_0xc9be('0x35')]=_['merge'](_0x1c60ea[_0xc9be('0x35')],{'$or':_[_0xc9be('0x26')](_0x2ed48c,function(_0x332430){if(_0x332430[_0xc9be('0x2a')]!=='VIRTUAL'){var _0x1f8dcc={};_0x1f8dcc[_0x332430[_0xc9be('0x24')]]={'$like':'%'+_0x4b8c7c[_0xc9be('0x2d')][_0xc9be('0x37')]+'%'};return _0x1f8dcc;}})});}_0x1c60ea=_[_0xc9be('0x38')]({},_0x1c60ea,_0x4b8c7c[_0xc9be('0x39')]);var _0x5682b3={'where':_0x1c60ea[_0xc9be('0x35')]};return db['Automation'][_0xc9be('0x1f')](_0x5682b3)['then'](function(_0x4cc57a){_0x57a90b[_0xc9be('0x1f')]=_0x4cc57a;if(_0x4b8c7c[_0xc9be('0x2d')]['includeAll']){_0x1c60ea[_0xc9be('0x3a')]=[{'all':!![]}];}return db[_0xc9be('0x27')][_0xc9be('0x3b')](_0x1c60ea);})[_0xc9be('0x22')](function(_0x5a4d08){_0x57a90b[_0xc9be('0x3c')]=_0x5a4d08;return _0x57a90b;})[_0xc9be('0x22')](respondWithFilteredResult(_0x56afcf,_0x1c60ea))[_0xc9be('0x3d')](handleError(_0x56afcf,null));};exports[_0xc9be('0x3e')]=function(_0x595cfd,_0x56da03){var _0x4c1af4={'raw':![],'where':{'id':_0x595cfd['params']['id']}},_0x503231={};_0x503231['model']=_[_0xc9be('0x2c')](db[_0xc9be('0x27')][_0xc9be('0x28')]);_0x503231[_0xc9be('0x2d')]=_[_0xc9be('0x2c')](_0x595cfd[_0xc9be('0x2d')]);_0x503231[_0xc9be('0x2e')]=_[_0xc9be('0x2f')](_0x503231[_0xc9be('0x2b')],_0x503231['query']);_0x4c1af4[_0xc9be('0x30')]=_[_0xc9be('0x2f')](_0x503231[_0xc9be('0x2b')],qs[_0xc9be('0x31')](_0x595cfd['query'][_0xc9be('0x31')]));_0x4c1af4[_0xc9be('0x30')]=_0x4c1af4[_0xc9be('0x30')][_0xc9be('0x3f')]?_0x4c1af4[_0xc9be('0x30')]:_0x503231[_0xc9be('0x2b')];if(_0x595cfd[_0xc9be('0x2d')][_0xc9be('0x40')]){_0x4c1af4[_0xc9be('0x3a')]=[{'all':!![]}];}_0x4c1af4=_[_0xc9be('0x38')]({},_0x4c1af4,_0x595cfd[_0xc9be('0x39')]);return db['Automation'][_0xc9be('0x41')](_0x4c1af4)[_0xc9be('0x22')](handleEntityNotFound(_0x56da03,null))[_0xc9be('0x22')](respondWithResult(_0x56da03,null))[_0xc9be('0x3d')](handleError(_0x56da03,null));};exports['create']=function(_0x5271d7,_0x2297b4){return db[_0xc9be('0x27')]['create'](_0x5271d7[_0xc9be('0x42')],{})[_0xc9be('0x22')](respondWithResult(_0x2297b4,0xc9))[_0xc9be('0x3d')](handleError(_0x2297b4,null));};exports[_0xc9be('0x21')]=function(_0x3353ab,_0x3c1d19){if(_0x3353ab[_0xc9be('0x42')]['id']){delete _0x3353ab[_0xc9be('0x42')]['id'];}return db[_0xc9be('0x27')]['find']({'where':{'id':_0x3353ab[_0xc9be('0x43')]['id']}})[_0xc9be('0x22')](handleEntityNotFound(_0x3c1d19,null))['then'](saveUpdates(_0x3353ab[_0xc9be('0x42')],null))[_0xc9be('0x22')](respondWithResult(_0x3c1d19,null))[_0xc9be('0x3d')](handleError(_0x3c1d19,null));};exports[_0xc9be('0x23')]=function(_0x4f9603,_0x5e65d1){return db['Automation']['find']({'where':{'id':_0x4f9603['params']['id']}})[_0xc9be('0x22')](handleEntityNotFound(_0x5e65d1,null))['then'](removeEntity(_0x5e65d1,null))[_0xc9be('0x3d')](handleError(_0x5e65d1,null));};exports[_0xc9be('0x44')]=function(_0x29f3f9,_0x54fd69,_0x2a2aed){return db[_0xc9be('0x45')][_0xc9be('0x41')]({'where':{'id':_0x29f3f9[_0xc9be('0x43')]['id']}})[_0xc9be('0x22')](handleEntityNotFound(_0x54fd69,null))['then'](function(_0x24cd36){if(_0x24cd36){return _0x24cd36[_0xc9be('0x44')](_0x29f3f9['body']['ids'],_['omit'](_0x29f3f9[_0xc9be('0x42')],[_0xc9be('0x46'),'id'])||{});}})[_0xc9be('0x22')](respondWithResult(_0x54fd69,null))[_0xc9be('0x3d')](handleError(_0x54fd69,null));};exports['getConditions']=function(_0xc5083,_0x1ecdd5,_0x42cada){var _0x3eee1a={};var _0xac06e8={};var _0x49ad64;var _0x374e54;return db[_0xc9be('0x27')][_0xc9be('0x47')]({'where':{'id':_0xc5083['params']['id']}})[_0xc9be('0x22')](handleEntityNotFound(_0x1ecdd5,null))['then'](function(_0x22684d){if(_0x22684d){_0x49ad64=_0x22684d;_0xac06e8[_0xc9be('0x2b')]=_[_0xc9be('0x2c')](db[_0xc9be('0x45')][_0xc9be('0x28')]);_0xac06e8[_0xc9be('0x2d')]=_[_0xc9be('0x2c')](_0xc5083[_0xc9be('0x2d')]);_0xac06e8[_0xc9be('0x2e')]=_[_0xc9be('0x2f')](_0xac06e8['model'],_0xac06e8[_0xc9be('0x2d')]);_0x3eee1a[_0xc9be('0x30')]=_[_0xc9be('0x2f')](_0xac06e8[_0xc9be('0x2b')],qs['fields'](_0xc5083[_0xc9be('0x2d')][_0xc9be('0x31')]));_0x3eee1a[_0xc9be('0x30')]=_0x3eee1a[_0xc9be('0x30')]['length']?_0x3eee1a['attributes']:_0xac06e8['model'];_0x3eee1a[_0xc9be('0x33')]=qs[_0xc9be('0x34')](_0xc5083['query'][_0xc9be('0x34')]);_0x3eee1a[_0xc9be('0x35')]=qs[_0xc9be('0x2e')](_[_0xc9be('0x36')](_0xc5083[_0xc9be('0x2d')],_0xac06e8[_0xc9be('0x2e')]));if(_0xc5083['query'][_0xc9be('0x37')]){_0x3eee1a[_0xc9be('0x35')]=_[_0xc9be('0x38')](_0x3eee1a[_0xc9be('0x35')],{'$or':_[_0xc9be('0x26')](_0x3eee1a[_0xc9be('0x30')],function(_0x3341ed){var _0x3a916d={};_0x3a916d[_0x3341ed]={'$like':'%'+_0xc5083[_0xc9be('0x2d')][_0xc9be('0x37')]+'%'};return _0x3a916d;})});}_0x3eee1a=_[_0xc9be('0x38')]({},_0x3eee1a,_0xc5083[_0xc9be('0x39')]);return _0x49ad64[_0xc9be('0x48')](_0x3eee1a);}})[_0xc9be('0x22')](function(_0x1c36df){if(_0x1c36df){_0x374e54=_0x1c36df['length'];if(!_0xc5083[_0xc9be('0x2d')][_0xc9be('0x32')](_0xc9be('0x49'))){_0x3eee1a['limit']=qs[_0xc9be('0x1e')](_0xc5083[_0xc9be('0x2d')][_0xc9be('0x1e')]);_0x3eee1a[_0xc9be('0x1c')]=qs['offset'](_0xc5083['query']['offset']);}return _0x49ad64[_0xc9be('0x48')](_0x3eee1a);}})['then'](function(_0x27feb2){if(_0x27feb2){return _0x27feb2?{'count':_0x374e54,'rows':_0x27feb2}:null;}})['then'](respondWithResult(_0x1ecdd5,null))[_0xc9be('0x3d')](handleError(_0x1ecdd5,null));};exports[_0xc9be('0x4a')]=function(_0x19c141,_0xcc67bb,_0x5f5b05){return db[_0xc9be('0x4b')][_0xc9be('0x41')]({'where':{'id':_0x19c141[_0xc9be('0x43')]['id']}})[_0xc9be('0x22')](handleEntityNotFound(_0xcc67bb,null))['then'](function(_0x36f140){if(_0x36f140){return _0x36f140[_0xc9be('0x4a')](_0x19c141[_0xc9be('0x42')][_0xc9be('0x46')],_[_0xc9be('0x4c')](_0x19c141['body'],['ids','id'])||{});}})[_0xc9be('0x22')](respondWithResult(_0xcc67bb,null))[_0xc9be('0x3d')](handleError(_0xcc67bb,null));};exports[_0xc9be('0x4d')]=function(_0x2c9977,_0x4a1439,_0x5ab0ba){var _0x4eea01={};var _0x523225={};var _0xf84435;var _0x40415d;return db['Automation']['findOne']({'where':{'id':_0x2c9977[_0xc9be('0x43')]['id']}})[_0xc9be('0x22')](handleEntityNotFound(_0x4a1439,null))[_0xc9be('0x22')](function(_0x56b064){if(_0x56b064){_0xf84435=_0x56b064;_0x523225[_0xc9be('0x2b')]=_[_0xc9be('0x2c')](db[_0xc9be('0x4b')][_0xc9be('0x28')]);_0x523225[_0xc9be('0x2d')]=_[_0xc9be('0x2c')](_0x2c9977[_0xc9be('0x2d')]);_0x523225[_0xc9be('0x2e')]=_[_0xc9be('0x2f')](_0x523225['model'],_0x523225[_0xc9be('0x2d')]);_0x4eea01[_0xc9be('0x30')]=_[_0xc9be('0x2f')](_0x523225['model'],qs[_0xc9be('0x31')](_0x2c9977[_0xc9be('0x2d')][_0xc9be('0x31')]));_0x4eea01[_0xc9be('0x30')]=_0x4eea01['attributes'][_0xc9be('0x3f')]?_0x4eea01[_0xc9be('0x30')]:_0x523225[_0xc9be('0x2b')];_0x4eea01[_0xc9be('0x33')]=qs['sort'](_0x2c9977[_0xc9be('0x2d')][_0xc9be('0x34')]);_0x4eea01[_0xc9be('0x35')]=qs[_0xc9be('0x2e')](_[_0xc9be('0x36')](_0x2c9977[_0xc9be('0x2d')],_0x523225['filters']));if(_0x2c9977['query'][_0xc9be('0x37')]){_0x4eea01[_0xc9be('0x35')]=_[_0xc9be('0x38')](_0x4eea01['where'],{'$or':_[_0xc9be('0x26')](_0x4eea01[_0xc9be('0x30')],function(_0x289897){var _0x2e827b={};_0x2e827b[_0x289897]={'$like':'%'+_0x2c9977[_0xc9be('0x2d')][_0xc9be('0x37')]+'%'};return _0x2e827b;})});}_0x4eea01=_[_0xc9be('0x38')]({},_0x4eea01,_0x2c9977[_0xc9be('0x39')]);return _0xf84435['getActions'](_0x4eea01);}})[_0xc9be('0x22')](function(_0x2186a8){if(_0x2186a8){_0x40415d=_0x2186a8[_0xc9be('0x3f')];if(!_0x2c9977[_0xc9be('0x2d')][_0xc9be('0x32')](_0xc9be('0x49'))){_0x4eea01['limit']=qs[_0xc9be('0x1e')](_0x2c9977[_0xc9be('0x2d')][_0xc9be('0x1e')]);_0x4eea01[_0xc9be('0x1c')]=qs[_0xc9be('0x1c')](_0x2c9977['query'][_0xc9be('0x1c')]);}return _0xf84435['getActions'](_0x4eea01);}})['then'](function(_0x2b9457){if(_0x2b9457){return _0x2b9457?{'count':_0x40415d,'rows':_0x2b9457}:null;}})[_0xc9be('0x22')](respondWithResult(_0x4a1439,null))[_0xc9be('0x3d')](handleError(_0x4a1439,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index a47d8e0..7b6ae2a 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 _0x16dd=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./automation.attributes','exports','Automation','tools_automations','util','../../config/logger'];(function(_0x942780,_0x865231){var _0x2fbdd5=function(_0x32ae9b){while(--_0x32ae9b){_0x942780['push'](_0x942780['shift']());}};_0x2fbdd5(++_0x865231);}(_0x16dd,0x17e));var _0xd16d=function(_0x2ea66e,_0xafd23a){_0x2ea66e=_0x2ea66e-0x0;var _0x1d5cf6=_0x16dd[_0x2ea66e];return _0x1d5cf6;};'use strict';var _=require('lodash');var util=require(_0xd16d('0x0'));var logger=require(_0xd16d('0x1'))(_0xd16d('0x2'));var moment=require(_0xd16d('0x3'));var BPromise=require(_0xd16d('0x4'));var rp=require(_0xd16d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd16d('0x6'));var config=require(_0xd16d('0x7'));var attributes=require(_0xd16d('0x8'));module[_0xd16d('0x9')]=function(_0x5d9f39,_0x3da107){return _0x5d9f39['define'](_0xd16d('0xa'),attributes,{'tableName':_0xd16d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4be6=['tools_automations','lodash','../../config/logger','api','moment','bluebird','request-promise','path','./automation.attributes','exports','define','Automation'];(function(_0x5c3be4,_0x442ebf){var _0x1e9e1d=function(_0x6cef7e){while(--_0x6cef7e){_0x5c3be4['push'](_0x5c3be4['shift']());}};_0x1e9e1d(++_0x442ebf);}(_0x4be6,0x199));var _0x64be=function(_0x204ce5,_0x46fb75){_0x204ce5=_0x204ce5-0x0;var _0x4f5a44=_0x4be6[_0x204ce5];return _0x4f5a44;};'use strict';var _=require(_0x64be('0x0'));var util=require('util');var logger=require(_0x64be('0x1'))(_0x64be('0x2'));var moment=require(_0x64be('0x3'));var BPromise=require(_0x64be('0x4'));var rp=require(_0x64be('0x5'));var fs=require('fs');var path=require(_0x64be('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x64be('0x7'));module[_0x64be('0x8')]=function(_0x4c1829,_0x426960){return _0x4c1829[_0x64be('0x9')](_0x64be('0xa'),attributes,{'tableName':_0x64be('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index 974ba55..4d8c7b0 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 _0xe2ab=['Automation,\x20%s,\x20%s,\x20%s','stringify','error','Automation,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','info','request\x20sent','debug'];(function(_0x584d37,_0x13fb20){var _0x1a1dbf=function(_0x23cd11){while(--_0x23cd11){_0x584d37['push'](_0x584d37['shift']());}};_0x1a1dbf(++_0x13fb20);}(_0xe2ab,0xc4));var _0xbe2a=function(_0x5cfcaa,_0x70377e){_0x5cfcaa=_0x5cfcaa-0x0;var _0x5e1e7b=_0xe2ab[_0x5cfcaa];return _0x5e1e7b;};'use strict';var _=require(_0xbe2a('0x0'));var util=require(_0xbe2a('0x1'));var moment=require(_0xbe2a('0x2'));var BPromise=require(_0xbe2a('0x3'));var rs=require(_0xbe2a('0x4'));var fs=require('fs');var Redis=require(_0xbe2a('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe2a('0x6'));var logger=require(_0xbe2a('0x7'))(_0xbe2a('0x8'));var config=require(_0xbe2a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xbe2a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f504b,_0x58b8f1,_0x5a8a5d){return new BPromise(function(_0xfccbff,_0x232194){return client['request'](_0x2f504b,_0x5a8a5d)['then'](function(_0x83d775){logger[_0xbe2a('0xb')]('Automation,\x20%s,\x20%s',_0x58b8f1,_0xbe2a('0xc'));logger[_0xbe2a('0xd')](_0xbe2a('0xe'),_0x58b8f1,_0xbe2a('0xc'),JSON[_0xbe2a('0xf')](_0x83d775));if(_0x83d775['error']){if(_0x83d775['error']['code']===0x1f4){logger[_0xbe2a('0x10')](_0xbe2a('0x11'),_0x58b8f1,_0x83d775[_0xbe2a('0x10')][_0xbe2a('0x12')]);return _0x232194(_0x83d775[_0xbe2a('0x10')]['message']);}logger[_0xbe2a('0x10')](_0xbe2a('0x11'),_0x58b8f1,_0x83d775[_0xbe2a('0x10')]['message']);return _0xfccbff(_0x83d775[_0xbe2a('0x10')][_0xbe2a('0x12')]);}else{logger[_0xbe2a('0xb')](_0xbe2a('0x11'),_0x58b8f1,_0xbe2a('0xc'));_0xfccbff(_0x83d775[_0xbe2a('0x13')][_0xbe2a('0x12')]);}})[_0xbe2a('0x14')](function(_0x4395fe){logger['error'](_0xbe2a('0x11'),_0x58b8f1,_0x4395fe);_0x232194(_0x4395fe);});});} \ No newline at end of file +var _0x3c8e=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','randomstring'];(function(_0x242b33,_0x4a124d){var _0xb19caf=function(_0x59b655){while(--_0x59b655){_0x242b33['push'](_0x242b33['shift']());}};_0xb19caf(++_0x4a124d);}(_0x3c8e,0x89));var _0xe3c8=function(_0x2bb154,_0x5f31cc){_0x2bb154=_0x2bb154-0x0;var _0x5869e3=_0x3c8e[_0x2bb154];return _0x5869e3;};'use strict';var _=require(_0xe3c8('0x0'));var util=require(_0xe3c8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe3c8('0x2'));var fs=require('fs');var Redis=require(_0xe3c8('0x3'));var db=require(_0xe3c8('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe3c8('0x5'))(_0xe3c8('0x6'));var config=require(_0xe3c8('0x7'));var jayson=require(_0xe3c8('0x8'));var client=jayson['client'][_0xe3c8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x16acf1,_0x2fe9e5,_0x222f26){return new BPromise(function(_0xf4387f,_0x5f3375){return client[_0xe3c8('0xa')](_0x16acf1,_0x222f26)['then'](function(_0x1b6e5e){logger[_0xe3c8('0xb')](_0xe3c8('0xc'),_0x2fe9e5,_0xe3c8('0xd'));logger['debug'](_0xe3c8('0xe'),_0x2fe9e5,_0xe3c8('0xd'),JSON[_0xe3c8('0xf')](_0x1b6e5e));if(_0x1b6e5e['error']){if(_0x1b6e5e[_0xe3c8('0x10')]['code']===0x1f4){logger[_0xe3c8('0x10')]('Automation,\x20%s,\x20%s',_0x2fe9e5,_0x1b6e5e['error'][_0xe3c8('0x11')]);return _0x5f3375(_0x1b6e5e[_0xe3c8('0x10')][_0xe3c8('0x11')]);}logger['error'](_0xe3c8('0xc'),_0x2fe9e5,_0x1b6e5e[_0xe3c8('0x10')][_0xe3c8('0x11')]);return _0xf4387f(_0x1b6e5e[_0xe3c8('0x10')][_0xe3c8('0x11')]);}else{logger[_0xe3c8('0xb')]('Automation,\x20%s,\x20%s',_0x2fe9e5,_0xe3c8('0xd'));_0xf4387f(_0x1b6e5e[_0xe3c8('0x12')]['message']);}})[_0xe3c8('0x13')](function(_0x10d57b){logger[_0xe3c8('0x10')]('Automation,\x20%s,\x20%s',_0x2fe9e5,_0x10d57b);_0x5f3375(_0x10d57b);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 080f2f2..68e6e0d 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 _0x1798=['getConditions','/:id/actions','getActions','post','addConditions','put','update','delete','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./automation.controller','get','/:id','show','/:id/conditions','isAuthenticated'];(function(_0x123623,_0x9694e2){var _0x3b00d1=function(_0x7e48e0){while(--_0x7e48e0){_0x123623['push'](_0x123623['shift']());}};_0x3b00d1(++_0x9694e2);}(_0x1798,0x1d6));var _0x8179=function(_0x8f3ae9,_0x119634){_0x8f3ae9=_0x8f3ae9-0x0;var _0x53d8a4=_0x1798[_0x8f3ae9];return _0x53d8a4;};'use strict';var multer=require(_0x8179('0x0'));var util=require('util');var path=require(_0x8179('0x1'));var timeout=require(_0x8179('0x2'));var express=require('express');var router=express[_0x8179('0x3')]();var fs_extra=require(_0x8179('0x4'));var auth=require(_0x8179('0x5'));var interaction=require(_0x8179('0x6'));var config=require('../../config/environment');var controller=require(_0x8179('0x7'));router[_0x8179('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8179('0x8')](_0x8179('0x9'),auth['isAuthenticated'](),controller[_0x8179('0xa')]);router[_0x8179('0x8')](_0x8179('0xb'),auth[_0x8179('0xc')](),controller[_0x8179('0xd')]);router['get'](_0x8179('0xe'),auth[_0x8179('0xc')](),controller[_0x8179('0xf')]);router[_0x8179('0x10')]('/',auth[_0x8179('0xc')](),controller['create']);router[_0x8179('0x10')](_0x8179('0xb'),auth[_0x8179('0xc')](),controller[_0x8179('0x11')]);router[_0x8179('0x10')]('/:id/actions',auth['isAuthenticated'](),controller['addActions']);router[_0x8179('0x12')](_0x8179('0x9'),auth['isAuthenticated'](),controller[_0x8179('0x13')]);router[_0x8179('0x14')](_0x8179('0x9'),auth[_0x8179('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x046b=['create','addActions','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','/:id','isAuthenticated','show','/:id/conditions','getConditions','/:id/actions','getActions','post'];(function(_0x5e5c64,_0x19b9fb){var _0x1bf287=function(_0x19fb98){while(--_0x19fb98){_0x5e5c64['push'](_0x5e5c64['shift']());}};_0x1bf287(++_0x19b9fb);}(_0x046b,0x147));var _0xb046=function(_0x441f16,_0x1849ae){_0x441f16=_0x441f16-0x0;var _0x1efcf0=_0x046b[_0x441f16];return _0x1efcf0;};'use strict';var multer=require('multer');var util=require(_0xb046('0x0'));var path=require(_0xb046('0x1'));var timeout=require(_0xb046('0x2'));var express=require(_0xb046('0x3'));var router=express[_0xb046('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb046('0x5'));var interaction=require(_0xb046('0x6'));var config=require(_0xb046('0x7'));var controller=require(_0xb046('0x8'));router[_0xb046('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb046('0x9')](_0xb046('0xa'),auth[_0xb046('0xb')](),controller[_0xb046('0xc')]);router[_0xb046('0x9')](_0xb046('0xd'),auth[_0xb046('0xb')](),controller[_0xb046('0xe')]);router['get'](_0xb046('0xf'),auth['isAuthenticated'](),controller[_0xb046('0x10')]);router[_0xb046('0x11')]('/',auth[_0xb046('0xb')](),controller[_0xb046('0x12')]);router[_0xb046('0x11')]('/:id/conditions',auth['isAuthenticated'](),controller['addConditions']);router[_0xb046('0x11')](_0xb046('0xf'),auth['isAuthenticated'](),controller[_0xb046('0x13')]);router['put'](_0xb046('0xa'),auth[_0xb046('0xb')](),controller['update']);router[_0xb046('0x14')](_0xb046('0xa'),auth[_0xb046('0xb')](),controller[_0xb046('0x15')]);module[_0xb046('0x16')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index bf92b90..7a6d01a 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 _0xb52a=['#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'];(function(_0x1fb6be,_0x2fd9a3){var _0x1eebff=function(_0x427c9b){while(--_0x427c9b){_0x1fb6be['push'](_0x1fb6be['shift']());}};_0x1eebff(++_0x2fd9a3);}(_0xb52a,0x76));var _0xab52=function(_0x246148,_0x1358ee){_0x246148=_0x246148-0x0;var _0x453d94=_0xb52a[_0x246148];return _0x453d94;};'use strict';var Sequelize=require('sequelize');module[_0xab52('0x0')]={'name':{'type':Sequelize[_0xab52('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xab52('0x2')),'allowNull':![],'defaultValue':_0xab52('0x2')},'description':{'type':Sequelize[_0xab52('0x1')]},'active':{'type':Sequelize[_0xab52('0x3')],'defaultValue':0x0,'comment':_0xab52('0x4')},'limitCalls':{'type':Sequelize[_0xab52('0x5')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xab52('0x6')},'dialOriginateCallerIdName':{'type':Sequelize[_0xab52('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xab52('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xab52('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xab52('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0xab52('0x5')](0x3)[_0xab52('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xab52('0x5')](0x5)[_0xab52('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xab52('0x5')](0x3)[_0xab52('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xab52('0x9')},'dialBusyRetryFrequency':{'type':Sequelize[_0xab52('0x5')](0x5)[_0xab52('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xab52('0xa')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xab52('0x7')],'defaultValue':0x3,'comment':_0xab52('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xab52('0x5')](0x5)[_0xab52('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xab52('0xc')},'dialGlobalMaxRetry':{'type':Sequelize[_0xab52('0x5')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xab52('0xd')},'dialTimezone':{'type':Sequelize[_0xab52('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xab52('0x1')],'defaultValue':_0xab52('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0xab52('0xf')](_0xab52('0x10'),_0xab52('0x11'),_0xab52('0x12')),'defaultValue':_0xab52('0x10')},'dialAMDActive':{'type':Sequelize[_0xab52('0x3')],'defaultValue':0x0,'comment':_0xab52('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0xab52('0x5')](0x9)[_0xab52('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xab52('0x14')},'dialAMDGreeting':{'type':Sequelize[_0xab52('0x5')](0x9)[_0xab52('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xab52('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xab52('0x5')](0x9)[_0xab52('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xab52('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xab52('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0xab52('0x5')](0x9)[_0xab52('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xab52('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xab52('0x5')](0x9)[_0xab52('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xab52('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xab52('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xab52('0x5')](0x5)[_0xab52('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xab52('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xab52('0x5')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xab52('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0xab52('0xf')](_0xab52('0x1b'),_0xab52('0x1c')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xab52('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xab52('0x5')](0x3)[_0xab52('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xab52('0x1d')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xab52('0x5')](0x3)[_0xab52('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xab52('0x5')](0x5)[_0xab52('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xab52('0x5')](0x3)[_0xab52('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xab52('0x1e')},'dialDropRetryFrequency':{'type':Sequelize[_0xab52('0x5')](0x5)[_0xab52('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xab52('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xab52('0x1f')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xab52('0x5')](0x5)[_0xab52('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xab52('0x20')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xab52('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xab52('0x21')},'dialMachineRetryFrequency':{'type':Sequelize[_0xab52('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xab52('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xab52('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xab52('0x5')](0x5)[_0xab52('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xab52('0x23')}}; \ No newline at end of file +var _0xec81=['#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\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)','sequelize','exports','STRING','name','ivr','BOOLEAN','INTEGER','UNSIGNED','Max\x20200\x20calls.','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x4a0de5,_0x14bf0d){var _0x3fafff=function(_0x53d009){while(--_0x53d009){_0x4a0de5['push'](_0x4a0de5['shift']());}};_0x3fafff(++_0x14bf0d);}(_0xec81,0xf6));var _0x1ec8=function(_0x1aafbe,_0x3441c9){_0x1aafbe=_0x1aafbe-0x0;var _0x7de560=_0xec81[_0x1aafbe];return _0x7de560;};'use strict';var Sequelize=require(_0x1ec8('0x0'));module[_0x1ec8('0x1')]={'name':{'type':Sequelize[_0x1ec8('0x2')],'unique':_0x1ec8('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x1ec8('0x4')),'allowNull':![],'defaultValue':_0x1ec8('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x1ec8('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x1ec8('0x6')](0x4)[_0x1ec8('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x1ec8('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x1ec8('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x1ec8('0x6')](0x3)[_0x1ec8('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1ec8('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1ec8('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x1ec8('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1ec8('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x1ec8('0x6')](0x5)[_0x1ec8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1ec8('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x1ec8('0x6')](0x3)[_0x1ec8('0x7')],'defaultValue':0x3,'comment':_0x1ec8('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x1ec8('0x6')](0x5)[_0x1ec8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1ec8('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0x1ec8('0x6')](0x3)[_0x1ec8('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x1ec8('0xf')},'dialTimezone':{'type':Sequelize[_0x1ec8('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x1ec8('0x2')],'defaultValue':_0x1ec8('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0x1ec8('0x11')](_0x1ec8('0x12'),_0x1ec8('0x13'),_0x1ec8('0x14')),'defaultValue':_0x1ec8('0x12')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x1ec8('0x6')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x1ec8('0x15')},'dialAMDGreeting':{'type':Sequelize[_0x1ec8('0x6')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x1ec8('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x1ec8('0x6')](0x9)[_0x1ec8('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x1ec8('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x1ec8('0x6')](0x9)[_0x1ec8('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1ec8('0x18')},'dialAMDMinWordLength':{'type':Sequelize[_0x1ec8('0x6')](0x9)[_0x1ec8('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x1ec8('0x6')](0x9)[_0x1ec8('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x1ec8('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x1ec8('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x1ec8('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x1ec8('0x6')](0x9)[_0x1ec8('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1ec8('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0x1ec8('0x11')](_0x1ec8('0x1b'),_0x1ec8('0x1c')),'defaultValue':_0x1ec8('0x1b')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x1ec8('0x6')](0x3)[_0x1ec8('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1ec8('0x1d')},'dialCutDigit':{'type':Sequelize[_0x1ec8('0x6')](0x3)[_0x1ec8('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x1ec8('0x6')](0x3)[_0x1ec8('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1ec8('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x1ec8('0x6')](0x5)[_0x1ec8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1ec8('0x1f')},'dialDropMaxRetry':{'type':Sequelize[_0x1ec8('0x6')](0x3)[_0x1ec8('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x1ec8('0x6')](0x5)[_0x1ec8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1ec8('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x1ec8('0x6')](0x3)[_0x1ec8('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1ec8('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x1ec8('0x6')](0x5)[_0x1ec8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x1ec8('0x6')](0x3)[_0x1ec8('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1ec8('0x22')},'dialMachineRetryFrequency':{'type':Sequelize[_0x1ec8('0x6')](0x5)[_0x1ec8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1ec8('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1ec8('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x1ec8('0x6')](0x5)[_0x1ec8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1ec8('0x24')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 4de4fc7..a2482a4 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 _0x9990=['into','cm_hopper','ListId','select','field','NOW()','scheduledAt','ContactId','CmListId','toString','updatedAt','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','fromQuery','phone','sequelize','all','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','push','removeBlackLists','eml-format','zip-dir','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','Campaign','rawAttributes','fieldName','type','key','model','filters','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','include','findAll','rows','catch','params','keys','intersection','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','omit','createdAt','IvrCampaigns','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','CampaignId','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','insert'];(function(_0x18f713,_0x379588){var _0x4d524a=function(_0x405ef4){while(--_0x405ef4){_0x18f713['push'](_0x18f713['shift']());}};_0x4d524a(++_0x379588);}(_0x9990,0xa8));var _0x0999=function(_0x8033a9,_0x23db75){_0x8033a9=_0x8033a9-0x0;var _0x4af01f=_0x9990[_0x8033a9];return _0x4af01f;};'use strict';var emlformat=require(_0x0999('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0999('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0999('0x2'));var moment=require(_0x0999('0x3'));var BPromise=require(_0x0999('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x0999('0x5'));var sox=require(_0x0999('0x6'));var csv=require('to-csv');var ejs=require(_0x0999('0x7'));var fs=require('fs');var fs_extra=require(_0x0999('0x8'));var _=require(_0x0999('0x9'));var squel=require(_0x0999('0xa'));var crypto=require(_0x0999('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x0999('0xc'));var toCsv=require(_0x0999('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0999('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x0999('0xf'));var as=require(_0x0999('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0999('0x11'))(_0x0999('0x12'));var utils=require(_0x0999('0x13'));var config=require(_0x0999('0x14'));var licenseUtil=require(_0x0999('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x50af2c,_0x508f94){_0x508f94=_0x508f94||0xcc;return function(_0x70c45c){if(_0x70c45c){return _0x50af2c[_0x0999('0x16')](_0x508f94);}return _0x50af2c[_0x0999('0x17')](_0x508f94)[_0x0999('0x18')]();};}function respondWithResult(_0x45fb10,_0xe74d67){_0xe74d67=_0xe74d67||0xc8;return function(_0x6181eb){if(_0x6181eb){return _0x45fb10[_0x0999('0x17')](_0xe74d67)['json'](_0x6181eb);}};}function respondWithFilteredResult(_0x1066f3,_0x97bdaa){return function(_0x1e1d51){if(_0x1e1d51){var _0x11ec09=typeof _0x97bdaa['offset']===_0x0999('0x19')&&typeof _0x97bdaa['limit']==='undefined';var _0x495588=_0x1e1d51[_0x0999('0x1a')];var _0x3f86d8=_0x11ec09?0x0:_0x97bdaa['offset'];var _0x4354d8=_0x11ec09?_0x1e1d51[_0x0999('0x1a')]:_0x97bdaa[_0x0999('0x1b')]+_0x97bdaa[_0x0999('0x1c')];var _0x128933;if(_0x4354d8>=_0x495588){_0x4354d8=_0x495588;_0x128933=0xc8;}else{_0x128933=0xce;}_0x1066f3[_0x0999('0x17')](_0x128933);return _0x1066f3[_0x0999('0x1d')](_0x0999('0x1e'),_0x3f86d8+'-'+_0x4354d8+'/'+_0x495588)[_0x0999('0x1f')](_0x1e1d51);}return null;};}function patchUpdates(_0x55761f){return function(_0x430e77){try{jsonpatch[_0x0999('0x20')](_0x430e77,_0x55761f,!![]);}catch(_0x2605f5){return BPromise[_0x0999('0x21')](_0x2605f5);}return _0x430e77['save']();};}function saveUpdates(_0x45a790,_0x35da19){return function(_0x5c6f8b){if(_0x5c6f8b){return _0x5c6f8b[_0x0999('0x22')](_0x45a790)[_0x0999('0x23')](function(_0xe75920){return _0xe75920;});}return null;};}function removeEntity(_0x1b3a4a,_0x154671){return function(_0x46a931){if(_0x46a931){return _0x46a931[_0x0999('0x24')]()[_0x0999('0x23')](function(){var _0xc95bb2=_0x46a931[_0x0999('0x25')]({'plain':!![]});var _0x5dab60='IvrCampaigns';return db[_0x0999('0x26')][_0x0999('0x24')]({'where':{'type':_0x5dab60,'resourceId':_0xc95bb2['id']}})[_0x0999('0x23')](function(){return _0x46a931;});})[_0x0999('0x23')](function(){_0x1b3a4a[_0x0999('0x17')](0xcc)[_0x0999('0x18')]();});}};}function handleEntityNotFound(_0x47e22c,_0x1221d4){return function(_0x4f1ca1){if(!_0x4f1ca1){_0x47e22c['sendStatus'](0x194);}return _0x4f1ca1;};}function handleError(_0x40c277,_0x4ab939){_0x4ab939=_0x4ab939||0x1f4;return function(_0x400acf){logger[_0x0999('0x27')](_0x400acf[_0x0999('0x28')]);if(_0x400acf[_0x0999('0x29')]){delete _0x400acf[_0x0999('0x29')];}_0x40c277[_0x0999('0x17')](_0x4ab939)[_0x0999('0x2a')](_0x400acf);};}exports[_0x0999('0x2b')]=function(_0x1bde8a,_0x232c73){var _0x320851={},_0x327f86={},_0x25b238={'count':0x0,'rows':[]};var _0x2c0ca1=_[_0x0999('0x2c')](db[_0x0999('0x2d')][_0x0999('0x2e')],function(_0x463678){return{'name':_0x463678[_0x0999('0x2f')],'type':_0x463678[_0x0999('0x30')][_0x0999('0x31')]};});_0x327f86[_0x0999('0x32')]=_['map'](_0x2c0ca1,_0x0999('0x29'));_0x327f86['query']=_['keys'](_0x1bde8a['query']);_0x327f86[_0x0999('0x33')]=_['intersection'](_0x327f86[_0x0999('0x32')],_0x327f86[_0x0999('0x34')]);_0x320851[_0x0999('0x35')]=_['intersection'](_0x327f86[_0x0999('0x32')],qs[_0x0999('0x36')](_0x1bde8a[_0x0999('0x34')]['fields']));_0x320851['attributes']=_0x320851[_0x0999('0x35')][_0x0999('0x37')]?_0x320851[_0x0999('0x35')]:_0x327f86[_0x0999('0x32')];if(!_0x1bde8a[_0x0999('0x34')][_0x0999('0x38')](_0x0999('0x39'))){_0x320851[_0x0999('0x1c')]=qs[_0x0999('0x1c')](_0x1bde8a[_0x0999('0x34')][_0x0999('0x1c')]);_0x320851[_0x0999('0x1b')]=qs[_0x0999('0x1b')](_0x1bde8a[_0x0999('0x34')][_0x0999('0x1b')]);}_0x320851[_0x0999('0x3a')]=qs['sort'](_0x1bde8a[_0x0999('0x34')][_0x0999('0x3b')]);_0x320851['where']=qs[_0x0999('0x33')](_[_0x0999('0x3c')](_0x1bde8a['query'],_0x327f86[_0x0999('0x33')]),_0x2c0ca1);if(_0x1bde8a[_0x0999('0x34')][_0x0999('0x3d')]){_0x320851[_0x0999('0x3e')]=_['merge'](_0x320851[_0x0999('0x3e')],{'$or':_['map'](_0x2c0ca1,function(_0x20454){if(_0x20454[_0x0999('0x30')]!==_0x0999('0x3f')){var _0x438758={};_0x438758[_0x20454[_0x0999('0x29')]]={'$like':'%'+_0x1bde8a['query'][_0x0999('0x3d')]+'%'};return _0x438758;}})});}_0x320851=_[_0x0999('0x40')]({},_0x320851,_0x1bde8a[_0x0999('0x41')]);var _0x5e27d1={'where':_0x320851[_0x0999('0x3e')]};return db[_0x0999('0x2d')]['count'](_0x5e27d1)[_0x0999('0x23')](function(_0x4d11c3){_0x25b238[_0x0999('0x1a')]=_0x4d11c3;if(_0x1bde8a[_0x0999('0x34')]['includeAll']){_0x320851[_0x0999('0x42')]=[{'all':!![]}];}return db[_0x0999('0x2d')][_0x0999('0x43')](_0x320851);})['then'](function(_0x294a8e){_0x25b238[_0x0999('0x44')]=_0x294a8e;return _0x25b238;})['then'](respondWithFilteredResult(_0x232c73,_0x320851))[_0x0999('0x45')](handleError(_0x232c73,null));};exports['show']=function(_0x45b798,_0x464d53){var _0x24c71e={'raw':![],'where':{'id':_0x45b798[_0x0999('0x46')]['id']}},_0x2c6686={};_0x2c6686['model']=_[_0x0999('0x47')](db['Campaign']['rawAttributes']);_0x2c6686[_0x0999('0x34')]=_['keys'](_0x45b798[_0x0999('0x34')]);_0x2c6686[_0x0999('0x33')]=_[_0x0999('0x48')](_0x2c6686[_0x0999('0x32')],_0x2c6686[_0x0999('0x34')]);_0x24c71e[_0x0999('0x35')]=_[_0x0999('0x48')](_0x2c6686[_0x0999('0x32')],qs[_0x0999('0x36')](_0x45b798['query'][_0x0999('0x36')]));_0x24c71e['attributes']=_0x24c71e[_0x0999('0x35')][_0x0999('0x37')]?_0x24c71e[_0x0999('0x35')]:_0x2c6686[_0x0999('0x32')];if(_0x45b798['query'][_0x0999('0x49')]){_0x24c71e[_0x0999('0x42')]=[{'all':!![]}];}_0x24c71e=_[_0x0999('0x40')]({},_0x24c71e,_0x45b798[_0x0999('0x41')]);return db[_0x0999('0x2d')][_0x0999('0x4a')](_0x24c71e)[_0x0999('0x23')](handleEntityNotFound(_0x464d53,null))[_0x0999('0x23')](respondWithResult(_0x464d53,null))[_0x0999('0x45')](handleError(_0x464d53,null));};exports[_0x0999('0x4b')]=function(_0x15abcb,_0x2b7bcf){return db[_0x0999('0x2d')]['create'](_0x15abcb[_0x0999('0x4c')],{})[_0x0999('0x23')](function(_0x557ab5){var _0x457f7c=_0x15abcb[_0x0999('0x4d')][_0x0999('0x25')]({'plain':!![]});if(!_0x457f7c)throw new Error(_0x0999('0x4e'));if(_0x457f7c[_0x0999('0x4f')]==='user'){var _0x28841a=_0x557ab5[_0x0999('0x25')]({'plain':!![]});var _0x43fe4a='IvrCampaigns';return db[_0x0999('0x50')][_0x0999('0x4a')]({'where':{'name':_0x43fe4a,'userProfileId':_0x457f7c[_0x0999('0x51')]},'raw':!![]})[_0x0999('0x23')](function(_0x44db1d){if(_0x44db1d&&_0x44db1d['autoAssociation']===0x0){return db[_0x0999('0x26')][_0x0999('0x4b')]({'name':_0x28841a[_0x0999('0x29')],'resourceId':_0x28841a['id'],'type':_0x44db1d[_0x0999('0x29')],'sectionId':_0x44db1d['id']},{})['then'](function(){return _0x557ab5;});}else{return _0x557ab5;}})[_0x0999('0x45')](function(_0x497e2d){logger[_0x0999('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x497e2d);throw _0x497e2d;});}return _0x557ab5;})[_0x0999('0x23')](respondWithResult(_0x2b7bcf,0xc9))[_0x0999('0x45')](handleError(_0x2b7bcf,null));};exports['clone']=function(_0x265785,_0x1c7418){var _0x1ba2ee={'where':{'id':_0x265785[_0x0999('0x46')]['id']}},_0x36f561={};_0x36f561[_0x0999('0x32')]=_['keys'](db[_0x0999('0x2d')][_0x0999('0x2e')]);_0x1ba2ee[_0x0999('0x35')]=_[_0x0999('0x48')](_0x36f561[_0x0999('0x32')],qs[_0x0999('0x36')](_0x265785[_0x0999('0x34')][_0x0999('0x36')]));_0x1ba2ee['attributes']=_0x1ba2ee[_0x0999('0x35')][_0x0999('0x37')]?_0x1ba2ee[_0x0999('0x35')]:_0x36f561[_0x0999('0x32')];if(_0x265785[_0x0999('0x34')]['includeAll']){_0x1ba2ee[_0x0999('0x42')]=[{'all':!![]}];}_0x1ba2ee=_['merge']({},_0x1ba2ee,_0x265785[_0x0999('0x41')]);return db[_0x0999('0x2d')][_0x0999('0x4a')](_0x1ba2ee)[_0x0999('0x23')](handleEntityNotFound(_0x1c7418,null))[_0x0999('0x23')](function(_0x64576d){if(_0x64576d){var _0x24ef48=_0x64576d[_0x0999('0x25')]({'plain':!![]});_0x24ef48=qs[_0x0999('0x52')](_0x24ef48,['id',_0x0999('0x53'),'updatedAt']);_0x265785[_0x0999('0x4c')]=_[_0x0999('0x52')](_0x265785[_0x0999('0x4c')],['id',_0x0999('0x53'),'updatedAt']);return db[_0x0999('0x2d')][_0x0999('0x4b')](_[_0x0999('0x40')](_0x24ef48,_0x265785[_0x0999('0x4c')]),{'include':_0x265785['query']['includeAll']?[{'all':!![]}]:undefined})[_0x0999('0x23')](function(_0xa83846){var _0x4428b6=_0x265785['user']['get']({'plain':!![]});if(!_0x4428b6)throw new Error(_0x0999('0x4e'));if(_0x4428b6[_0x0999('0x4f')]==='user'){var _0x106068=_0xa83846[_0x0999('0x25')]({'plain':!![]});var _0x21a436=_0x0999('0x54');return db['UserProfileSection']['find']({'where':{'name':_0x21a436,'userProfileId':_0x4428b6['userProfileId']},'raw':!![]})['then'](function(_0x3e3a56){if(_0x3e3a56&&_0x3e3a56[_0x0999('0x55')]===0x0){return db[_0x0999('0x26')][_0x0999('0x4b')]({'name':_0x106068[_0x0999('0x29')],'resourceId':_0x106068['id'],'type':_0x3e3a56[_0x0999('0x29')],'sectionId':_0x3e3a56['id']},{})[_0x0999('0x23')](function(){return _0xa83846;});}else{return _0xa83846;}})['catch'](function(_0x3f0196){logger[_0x0999('0x27')](_0x0999('0x56'),_0x3f0196);throw _0x3f0196;});}return _0xa83846;});}})['then'](respondWithResult(_0x1c7418,0xc9))[_0x0999('0x45')](handleError(_0x1c7418,null));};exports['update']=function(_0x28b440,_0x386da0){if(_0x28b440[_0x0999('0x4c')]['id']){delete _0x28b440[_0x0999('0x4c')]['id'];}return db[_0x0999('0x2d')][_0x0999('0x4a')]({'where':{'id':_0x28b440[_0x0999('0x46')]['id']}})[_0x0999('0x23')](handleEntityNotFound(_0x386da0,null))['then'](saveUpdates(_0x28b440[_0x0999('0x4c')],null))[_0x0999('0x23')](respondWithResult(_0x386da0,null))[_0x0999('0x45')](handleError(_0x386da0,null));};exports[_0x0999('0x24')]=function(_0xc7b3f4,_0x198a43){return db[_0x0999('0x2d')][_0x0999('0x4a')]({'where':{'id':_0xc7b3f4[_0x0999('0x46')]['id']}})[_0x0999('0x23')](handleEntityNotFound(_0x198a43,null))['then'](removeEntity(_0x198a43,null))[_0x0999('0x45')](handleError(_0x198a43,null));};exports[_0x0999('0x57')]=function(_0x5b8770,_0x4d4607,_0x2a9edc){var _0x4ae2de={'raw':!![],'where':{}};var _0x30a0da={};var _0x3987ee={'count':0x0,'rows':[]};return db[_0x0999('0x2d')][_0x0999('0x58')]({'where':{'id':_0x5b8770[_0x0999('0x46')]['id']}})[_0x0999('0x23')](handleEntityNotFound(_0x4d4607,null))['then'](function(_0x246e42){if(_0x246e42){_0x30a0da['model']=_['keys'](db[_0x0999('0x59')][_0x0999('0x2e')]);_0x30a0da[_0x0999('0x34')]=_[_0x0999('0x47')](_0x5b8770['query']);_0x30a0da[_0x0999('0x33')]=_[_0x0999('0x48')](_0x30a0da[_0x0999('0x32')],_0x30a0da['query']);_0x4ae2de[_0x0999('0x35')]=_['intersection'](_0x30a0da[_0x0999('0x32')],qs[_0x0999('0x36')](_0x5b8770['query'][_0x0999('0x36')]));_0x4ae2de[_0x0999('0x35')]=_0x4ae2de[_0x0999('0x35')][_0x0999('0x37')]?_0x4ae2de[_0x0999('0x35')]:_0x30a0da['model'];if(!_0x5b8770[_0x0999('0x34')][_0x0999('0x38')](_0x0999('0x39'))){_0x4ae2de['limit']=qs['limit'](_0x5b8770[_0x0999('0x34')][_0x0999('0x1c')]);_0x4ae2de[_0x0999('0x1b')]=qs[_0x0999('0x1b')](_0x5b8770[_0x0999('0x34')][_0x0999('0x1b')]);}_0x4ae2de['order']=qs[_0x0999('0x3b')](_0x5b8770[_0x0999('0x34')][_0x0999('0x3b')]);_0x4ae2de[_0x0999('0x3e')]=qs['filters'](_[_0x0999('0x3c')](_0x5b8770[_0x0999('0x34')],_0x30a0da['filters']));_0x4ae2de[_0x0999('0x3e')]['CampaignId']=_0x246e42['id'];if(_0x5b8770[_0x0999('0x34')][_0x0999('0x3d')]){_0x4ae2de[_0x0999('0x3e')]=_[_0x0999('0x40')](_0x4ae2de[_0x0999('0x3e')],{'$or':_['map'](_0x4ae2de[_0x0999('0x35')],function(_0x3712c2){var _0x152aaf={};_0x152aaf[_0x3712c2]={'$like':'%'+_0x5b8770[_0x0999('0x34')][_0x0999('0x3d')]+'%'};return _0x152aaf;})});}_0x4ae2de=_[_0x0999('0x40')]({},_0x4ae2de,_0x5b8770[_0x0999('0x41')]);return db[_0x0999('0x59')][_0x0999('0x1a')]({'where':_0x4ae2de[_0x0999('0x3e')]})[_0x0999('0x23')](function(_0x4452b6){_0x3987ee[_0x0999('0x1a')]=_0x4452b6;if(_0x5b8770[_0x0999('0x34')][_0x0999('0x49')]){_0x4ae2de[_0x0999('0x42')]=[{'all':!![]}];}return db['CmHopper'][_0x0999('0x43')](_0x4ae2de);})['then'](function(_0x2dbd3a){_0x3987ee[_0x0999('0x44')]=_0x2dbd3a;return _0x3987ee;});}})[_0x0999('0x23')](respondWithFilteredResult(_0x4d4607,_0x4ae2de))['catch'](handleError(_0x4d4607,null));};exports[_0x0999('0x5a')]=function(_0x2ee7dd,_0x3526a4,_0x1224ab){var _0x28e7c1={'raw':!![],'where':{}};var _0x1495d5={};var _0x2f8a46={'count':0x0,'rows':[]};return db[_0x0999('0x2d')][_0x0999('0x58')]({'where':{'id':_0x2ee7dd[_0x0999('0x46')]['id']}})['then'](handleEntityNotFound(_0x3526a4,null))[_0x0999('0x23')](function(_0x34c021){if(_0x34c021){_0x1495d5[_0x0999('0x32')]=_[_0x0999('0x47')](db[_0x0999('0x5b')][_0x0999('0x2e')]);_0x1495d5[_0x0999('0x34')]=_[_0x0999('0x47')](_0x2ee7dd[_0x0999('0x34')]);_0x1495d5['filters']=_['intersection'](_0x1495d5[_0x0999('0x32')],_0x1495d5[_0x0999('0x34')]);_0x28e7c1[_0x0999('0x35')]=_[_0x0999('0x48')](_0x1495d5[_0x0999('0x32')],qs[_0x0999('0x36')](_0x2ee7dd[_0x0999('0x34')]['fields']));_0x28e7c1['attributes']=_0x28e7c1[_0x0999('0x35')][_0x0999('0x37')]?_0x28e7c1['attributes']:_0x1495d5[_0x0999('0x32')];if(!_0x2ee7dd[_0x0999('0x34')][_0x0999('0x38')](_0x0999('0x39'))){_0x28e7c1[_0x0999('0x1c')]=qs[_0x0999('0x1c')](_0x2ee7dd[_0x0999('0x34')][_0x0999('0x1c')]);_0x28e7c1[_0x0999('0x1b')]=qs[_0x0999('0x1b')](_0x2ee7dd[_0x0999('0x34')][_0x0999('0x1b')]);}_0x28e7c1[_0x0999('0x3a')]=qs['sort'](_0x2ee7dd['query'][_0x0999('0x3b')]);_0x28e7c1[_0x0999('0x3e')]=qs['filters'](_[_0x0999('0x3c')](_0x2ee7dd[_0x0999('0x34')],_0x1495d5[_0x0999('0x33')]));_0x28e7c1[_0x0999('0x3e')]['CampaignId']=_0x34c021['id'];if(_0x2ee7dd['query']['filter']){_0x28e7c1[_0x0999('0x3e')]=_[_0x0999('0x40')](_0x28e7c1[_0x0999('0x3e')],{'$or':_[_0x0999('0x2c')](_0x28e7c1[_0x0999('0x35')],function(_0x2cc80d){var _0x46847e={};_0x46847e[_0x2cc80d]={'$like':'%'+_0x2ee7dd[_0x0999('0x34')]['filter']+'%'};return _0x46847e;})});}_0x28e7c1=_['merge']({},_0x28e7c1,_0x2ee7dd[_0x0999('0x41')]);return db[_0x0999('0x5b')][_0x0999('0x1a')]({'where':_0x28e7c1[_0x0999('0x3e')]})[_0x0999('0x23')](function(_0x2009f8){_0x2f8a46[_0x0999('0x1a')]=_0x2009f8;if(_0x2ee7dd['query'][_0x0999('0x49')]){_0x28e7c1[_0x0999('0x42')]=[{'all':!![]}];}return db[_0x0999('0x5b')][_0x0999('0x43')](_0x28e7c1);})['then'](function(_0x21b1d5){_0x2f8a46[_0x0999('0x44')]=_0x21b1d5;return _0x2f8a46;});}})[_0x0999('0x23')](respondWithFilteredResult(_0x3526a4,_0x28e7c1))[_0x0999('0x45')](handleError(_0x3526a4,null));};exports[_0x0999('0x5c')]=function(_0x59bd3b,_0x35c1fd,_0x37e888){var _0x219d8b={'raw':!![],'where':{}};var _0x2fea6f={};var _0x2a0265={'count':0x0,'rows':[]};return db[_0x0999('0x2d')]['findOne']({'where':{'id':_0x59bd3b['params']['id']}})[_0x0999('0x23')](handleEntityNotFound(_0x35c1fd,null))['then'](function(_0x525bbe){if(_0x525bbe){_0x2fea6f[_0x0999('0x32')]=_[_0x0999('0x47')](db[_0x0999('0x5d')][_0x0999('0x2e')]);_0x2fea6f[_0x0999('0x34')]=_[_0x0999('0x47')](_0x59bd3b[_0x0999('0x34')]);_0x2fea6f[_0x0999('0x33')]=_['intersection'](_0x2fea6f[_0x0999('0x32')],_0x2fea6f[_0x0999('0x34')]);_0x219d8b[_0x0999('0x35')]=_[_0x0999('0x48')](_0x2fea6f[_0x0999('0x32')],qs[_0x0999('0x36')](_0x59bd3b[_0x0999('0x34')][_0x0999('0x36')]));_0x219d8b[_0x0999('0x35')]=_0x219d8b[_0x0999('0x35')]['length']?_0x219d8b[_0x0999('0x35')]:_0x2fea6f[_0x0999('0x32')];if(!_0x59bd3b[_0x0999('0x34')]['hasOwnProperty'](_0x0999('0x39'))){_0x219d8b[_0x0999('0x1c')]=qs[_0x0999('0x1c')](_0x59bd3b['query'][_0x0999('0x1c')]);_0x219d8b[_0x0999('0x1b')]=qs['offset'](_0x59bd3b[_0x0999('0x34')][_0x0999('0x1b')]);}_0x219d8b['order']=qs[_0x0999('0x3b')](_0x59bd3b[_0x0999('0x34')][_0x0999('0x3b')]);_0x219d8b[_0x0999('0x3e')]=qs[_0x0999('0x33')](_[_0x0999('0x3c')](_0x59bd3b['query'],_0x2fea6f[_0x0999('0x33')]));_0x219d8b['where'][_0x0999('0x5e')]=_0x525bbe['id'];if(_0x59bd3b[_0x0999('0x34')]['filter']){_0x219d8b[_0x0999('0x3e')]=_[_0x0999('0x40')](_0x219d8b[_0x0999('0x3e')],{'$or':_['map'](_0x219d8b[_0x0999('0x35')],function(_0x58ffe7){var _0x54e7d9={};_0x54e7d9[_0x58ffe7]={'$like':'%'+_0x59bd3b[_0x0999('0x34')]['filter']+'%'};return _0x54e7d9;})});}_0x219d8b=_[_0x0999('0x40')]({},_0x219d8b,_0x59bd3b[_0x0999('0x41')]);return db[_0x0999('0x5d')]['count']({'where':_0x219d8b['where']})[_0x0999('0x23')](function(_0xd6019a){_0x2a0265[_0x0999('0x1a')]=_0xd6019a;if(_0x59bd3b[_0x0999('0x34')][_0x0999('0x49')]){_0x219d8b[_0x0999('0x42')]=[{'all':!![]}];}return db[_0x0999('0x5d')][_0x0999('0x43')](_0x219d8b);})[_0x0999('0x23')](function(_0x5c35cf){_0x2a0265[_0x0999('0x44')]=_0x5c35cf;return _0x2a0265;});}})['then'](respondWithFilteredResult(_0x35c1fd,_0x219d8b))['catch'](handleError(_0x35c1fd,null));};exports['getHopperBlacks']=function(_0xb51bb8,_0x3ea772,_0x4a5516){var _0xe9bd52={'raw':!![],'where':{}};var _0x156b05={};var _0x5b47f4={'count':0x0,'rows':[]};return db[_0x0999('0x2d')][_0x0999('0x58')]({'where':{'id':_0xb51bb8[_0x0999('0x46')]['id']}})['then'](handleEntityNotFound(_0x3ea772,null))[_0x0999('0x23')](function(_0x4721aa){if(_0x4721aa){_0x156b05[_0x0999('0x32')]=_[_0x0999('0x47')](db[_0x0999('0x5f')]['rawAttributes']);_0x156b05['query']=_[_0x0999('0x47')](_0xb51bb8[_0x0999('0x34')]);_0x156b05[_0x0999('0x33')]=_[_0x0999('0x48')](_0x156b05['model'],_0x156b05['query']);_0xe9bd52[_0x0999('0x35')]=_[_0x0999('0x48')](_0x156b05[_0x0999('0x32')],qs['fields'](_0xb51bb8[_0x0999('0x34')][_0x0999('0x36')]));_0xe9bd52[_0x0999('0x35')]=_0xe9bd52[_0x0999('0x35')][_0x0999('0x37')]?_0xe9bd52[_0x0999('0x35')]:_0x156b05[_0x0999('0x32')];if(!_0xb51bb8[_0x0999('0x34')][_0x0999('0x38')](_0x0999('0x39'))){_0xe9bd52[_0x0999('0x1c')]=qs[_0x0999('0x1c')](_0xb51bb8['query']['limit']);_0xe9bd52['offset']=qs['offset'](_0xb51bb8['query']['offset']);}_0xe9bd52[_0x0999('0x3a')]=qs[_0x0999('0x3b')](_0xb51bb8['query'][_0x0999('0x3b')]);_0xe9bd52[_0x0999('0x3e')]=qs[_0x0999('0x33')](_[_0x0999('0x3c')](_0xb51bb8[_0x0999('0x34')],_0x156b05[_0x0999('0x33')]));_0xe9bd52['where'][_0x0999('0x5e')]=_0x4721aa['id'];if(_0xb51bb8[_0x0999('0x34')][_0x0999('0x3d')]){_0xe9bd52[_0x0999('0x3e')]=_['merge'](_0xe9bd52[_0x0999('0x3e')],{'$or':_[_0x0999('0x2c')](_0xe9bd52[_0x0999('0x35')],function(_0x241809){var _0x15f647={};_0x15f647[_0x241809]={'$like':'%'+_0xb51bb8['query'][_0x0999('0x3d')]+'%'};return _0x15f647;})});}_0xe9bd52=_[_0x0999('0x40')]({},_0xe9bd52,_0xb51bb8['options']);return db['CmHopperBlack']['count']({'where':_0xe9bd52[_0x0999('0x3e')]})['then'](function(_0x7048b8){_0x5b47f4[_0x0999('0x1a')]=_0x7048b8;if(_0xb51bb8[_0x0999('0x34')][_0x0999('0x49')]){_0xe9bd52[_0x0999('0x42')]=[{'all':!![]}];}return db[_0x0999('0x5f')][_0x0999('0x43')](_0xe9bd52);})['then'](function(_0x74efb2){_0x5b47f4[_0x0999('0x44')]=_0x74efb2;return _0x5b47f4;});}})['then'](respondWithFilteredResult(_0x3ea772,_0xe9bd52))[_0x0999('0x45')](handleError(_0x3ea772,null));};exports[_0x0999('0x60')]=function(_0x5635d6,_0x1bdd98,_0x5382e5){var _0x3fc723={};var _0x4ddf2a={};var _0x2c0d4e;var _0x4cd956;return db[_0x0999('0x2d')]['findOne']({'where':{'id':_0x5635d6[_0x0999('0x46')]['id']}})['then'](handleEntityNotFound(_0x1bdd98,null))['then'](function(_0x5d6c00){if(_0x5d6c00){_0x2c0d4e=_0x5d6c00;_0x4ddf2a[_0x0999('0x32')]=_[_0x0999('0x47')](db['CmList'][_0x0999('0x2e')]);_0x4ddf2a[_0x0999('0x34')]=_[_0x0999('0x47')](_0x5635d6[_0x0999('0x34')]);_0x4ddf2a[_0x0999('0x33')]=_[_0x0999('0x48')](_0x4ddf2a[_0x0999('0x32')],_0x4ddf2a[_0x0999('0x34')]);_0x3fc723['attributes']=_['intersection'](_0x4ddf2a[_0x0999('0x32')],qs[_0x0999('0x36')](_0x5635d6[_0x0999('0x34')][_0x0999('0x36')]));_0x3fc723['attributes']=_0x3fc723[_0x0999('0x35')][_0x0999('0x37')]?_0x3fc723[_0x0999('0x35')]:_0x4ddf2a[_0x0999('0x32')];_0x3fc723[_0x0999('0x3a')]=qs[_0x0999('0x3b')](_0x5635d6[_0x0999('0x34')][_0x0999('0x3b')]);_0x3fc723[_0x0999('0x3e')]=qs[_0x0999('0x33')](_[_0x0999('0x3c')](_0x5635d6[_0x0999('0x34')],_0x4ddf2a[_0x0999('0x33')]));if(_0x5635d6[_0x0999('0x34')][_0x0999('0x3d')]){_0x3fc723[_0x0999('0x3e')]=_[_0x0999('0x40')](_0x3fc723[_0x0999('0x3e')],{'$or':_[_0x0999('0x2c')](_0x3fc723[_0x0999('0x35')],function(_0x2187ab){var _0x5b2a13={};_0x5b2a13[_0x2187ab]={'$like':'%'+_0x5635d6[_0x0999('0x34')][_0x0999('0x3d')]+'%'};return _0x5b2a13;})});}_0x3fc723=_[_0x0999('0x40')]({},_0x3fc723,_0x5635d6[_0x0999('0x41')]);return _0x2c0d4e[_0x0999('0x60')](_0x3fc723);}})['then'](function(_0x5eb6ca){if(_0x5eb6ca){_0x4cd956=_0x5eb6ca[_0x0999('0x37')];if(!_0x5635d6[_0x0999('0x34')][_0x0999('0x38')]('nolimit')){_0x3fc723[_0x0999('0x1c')]=qs[_0x0999('0x1c')](_0x5635d6[_0x0999('0x34')]['limit']);_0x3fc723['offset']=qs[_0x0999('0x1b')](_0x5635d6[_0x0999('0x34')][_0x0999('0x1b')]);}return _0x2c0d4e[_0x0999('0x60')](_0x3fc723);}})['then'](function(_0x5f41f6){if(_0x5f41f6){return _0x5f41f6?{'count':_0x4cd956,'rows':_0x5f41f6}:null;}})[_0x0999('0x23')](respondWithResult(_0x1bdd98,null))[_0x0999('0x45')](handleError(_0x1bdd98,null));};exports[_0x0999('0x61')]=function(_0xb51c01,_0x47cfe2,_0x4546c7){var _0x25c88f,_0x2e759b;return db[_0x0999('0x2d')][_0x0999('0x4a')]({'where':{'id':_0xb51c01[_0x0999('0x46')]['id']}})['then'](handleEntityNotFound(_0x47cfe2,null))['then'](function(_0x809ddd){if(_0x809ddd){_0x2e759b=_0x809ddd;return _0x809ddd[_0x0999('0x61')](_0xb51c01[_0x0999('0x4c')][_0x0999('0x62')],_[_0x0999('0x52')](_0xb51c01[_0x0999('0x4c')],[_0x0999('0x62'),'id'])||{});}return null;})[_0x0999('0x63')](function(_0x8956c){var _0x59e545;_0x25c88f=_0x8956c||[];var _0x1ff849=[];if(_0x8956c){for(var _0x547249=0x0;_0x547249<_0x8956c['length'];_0x547249+=0x1){var _0x27d318=_0x8956c[_0x547249][_0x0999('0x25')]({'plain':!![]});_0x2e759b[_0x0999('0x64')]=_0xb51c01[_0x0999('0x4c')]['dialCheckDuplicateType']?_0xb51c01[_0x0999('0x4c')]['dialCheckDuplicateType']:_0x2e759b[_0x0999('0x64')];switch(_0x2e759b[_0x0999('0x64')]){case'always':_0x59e545=squel[_0x0999('0x65')]()[_0x0999('0x66')](_0x0999('0x67'))['fromQuery'](['phone','scheduledAt','ContactId',_0x0999('0x68'),_0x0999('0x5e'),_0x0999('0x53'),'updatedAt'],squel[_0x0999('0x69')]()['field']('phone','phone')[_0x0999('0x6a')](_0x0999('0x6b'),_0x0999('0x6c'))[_0x0999('0x6a')]('id',_0x0999('0x6d'))[_0x0999('0x6a')](_0x27d318[_0x0999('0x6e')][_0x0999('0x6f')](),_0x0999('0x68'))[_0x0999('0x6a')](_0xb51c01[_0x0999('0x46')]['id']['toString'](),_0x0999('0x5e'))[_0x0999('0x6a')](_0x0999('0x6b'),'createdAt')['field'](_0x0999('0x6b'),_0x0999('0x70'))['from'](_0x0999('0x71'))[_0x0999('0x3e')](_0x0999('0x72'))[_0x0999('0x3e')](_0x0999('0x73'),_0x27d318[_0x0999('0x6e')]['toString']())['where'](_0x0999('0x74'))[_0x0999('0x3e')]('phone\x20NOT\x20IN\x20(?)',squel[_0x0999('0x69')]()[_0x0999('0x6a')](_0x0999('0x75'))[_0x0999('0x76')](_0x0999('0x77'))[_0x0999('0x3e')](_0x0999('0x78'),_0xb51c01[_0x0999('0x46')]['id']['toString']()))[_0x0999('0x3e')](_0x0999('0x79'),squel[_0x0999('0x69')]()[_0x0999('0x6a')](_0x0999('0x7a'))['from'](_0x0999('0x67'))[_0x0999('0x3e')](_0x0999('0x78'),_0xb51c01[_0x0999('0x46')]['id'][_0x0999('0x6f')]())))[_0x0999('0x6f')]();break;case _0x0999('0x7b'):_0x59e545=squel['insert']()[_0x0999('0x66')]('cm_hopper')[_0x0999('0x7c')]([_0x0999('0x7d'),'scheduledAt',_0x0999('0x6d'),_0x0999('0x68'),_0x0999('0x5e'),_0x0999('0x53'),_0x0999('0x70')],squel[_0x0999('0x69')]()[_0x0999('0x6a')](_0x0999('0x7d'),_0x0999('0x7d'))[_0x0999('0x6a')](_0x0999('0x6b'),_0x0999('0x6c'))[_0x0999('0x6a')]('id',_0x0999('0x6d'))['field'](_0x27d318['CmListId'][_0x0999('0x6f')](),_0x0999('0x68'))[_0x0999('0x6a')](_0xb51c01[_0x0999('0x46')]['id'][_0x0999('0x6f')](),_0x0999('0x5e'))[_0x0999('0x6a')](_0x0999('0x6b'),_0x0999('0x53'))[_0x0999('0x6a')](_0x0999('0x6b'),'updatedAt')[_0x0999('0x76')](_0x0999('0x71'))[_0x0999('0x3e')](_0x0999('0x72'))[_0x0999('0x3e')](_0x0999('0x73'),_0x27d318['CmListId']['toString']())['where'](_0x0999('0x74'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x0999('0x69')]()[_0x0999('0x6a')](_0x0999('0x7a'))[_0x0999('0x76')]('cm_hopper')['where'](_0x0999('0x78'),_0xb51c01[_0x0999('0x46')]['id']['toString']())))[_0x0999('0x6f')]();break;default:_0x59e545=squel[_0x0999('0x65')]()[_0x0999('0x66')]('cm_hopper')[_0x0999('0x7c')]([_0x0999('0x7d'),_0x0999('0x6c'),'ContactId',_0x0999('0x68'),_0x0999('0x5e'),'createdAt',_0x0999('0x70')],squel[_0x0999('0x69')]()[_0x0999('0x6a')](_0x0999('0x7d'),_0x0999('0x7d'))[_0x0999('0x6a')](_0x0999('0x6b'),_0x0999('0x6c'))['field']('id',_0x0999('0x6d'))[_0x0999('0x6a')](_0x27d318[_0x0999('0x6e')]['toString'](),'ListId')['field'](_0xb51c01[_0x0999('0x46')]['id'][_0x0999('0x6f')](),_0x0999('0x5e'))[_0x0999('0x6a')]('NOW()','createdAt')[_0x0999('0x6a')](_0x0999('0x6b'),_0x0999('0x70'))[_0x0999('0x76')](_0x0999('0x71'))[_0x0999('0x3e')](_0x0999('0x72'))[_0x0999('0x3e')](_0x0999('0x73'),_0x27d318['CmListId'][_0x0999('0x6f')]())[_0x0999('0x3e')](_0x0999('0x74')))[_0x0999('0x6f')]();}_0x1ff849['push'](db[_0x0999('0x7e')][_0x0999('0x34')](_0x59e545));}return BPromise[_0x0999('0x7f')](_0x1ff849);}})[_0x0999('0x23')](function(){return _0x25c88f;})[_0x0999('0x23')](respondWithResult(_0x47cfe2,null))[_0x0999('0x45')](handleError(_0x47cfe2,null));};exports['removeLists']=function(_0x2a4d7a,_0xa13da4,_0x55e8c9){return db[_0x0999('0x2d')][_0x0999('0x4a')]({'where':{'id':_0x2a4d7a[_0x0999('0x46')]['id']}})['then'](handleEntityNotFound(_0xa13da4,null))[_0x0999('0x23')](function(_0x2fdc0b){if(_0x2fdc0b){return _0x2fdc0b[_0x0999('0x80')](_0x2a4d7a[_0x0999('0x34')]['ids']);}})['then'](function(_0x521afa){if(_0x521afa){return db[_0x0999('0x59')]['destroy']({'where':{'ListId':_0x2a4d7a[_0x0999('0x34')][_0x0999('0x62')],'CampaignId':_0x2a4d7a['params']['id']}})[_0x0999('0x23')](function(){return _0x521afa;});}})[_0x0999('0x23')](respondWithStatusCode(_0xa13da4,null))['catch'](handleError(_0xa13da4,null));};exports[_0x0999('0x81')]=function(_0xf542f9,_0x240568,_0x318b79){var _0x5afd71={};var _0x29979d={};var _0x4b4a62;var _0x242913;return db['Campaign']['findOne']({'where':{'id':_0xf542f9[_0x0999('0x46')]['id']}})['then'](handleEntityNotFound(_0x240568,null))[_0x0999('0x23')](function(_0x134b1f){if(_0x134b1f){_0x4b4a62=_0x134b1f;_0x29979d[_0x0999('0x32')]=_[_0x0999('0x47')](db[_0x0999('0x82')][_0x0999('0x2e')]);_0x29979d[_0x0999('0x34')]=_['keys'](_0xf542f9[_0x0999('0x34')]);_0x29979d['filters']=_['intersection'](_0x29979d[_0x0999('0x32')],_0x29979d['query']);_0x5afd71['attributes']=_[_0x0999('0x48')](_0x29979d[_0x0999('0x32')],qs[_0x0999('0x36')](_0xf542f9[_0x0999('0x34')][_0x0999('0x36')]));_0x5afd71[_0x0999('0x35')]=_0x5afd71[_0x0999('0x35')][_0x0999('0x37')]?_0x5afd71[_0x0999('0x35')]:_0x29979d[_0x0999('0x32')];_0x5afd71[_0x0999('0x3a')]=qs[_0x0999('0x3b')](_0xf542f9['query'][_0x0999('0x3b')]);_0x5afd71[_0x0999('0x3e')]=qs[_0x0999('0x33')](_[_0x0999('0x3c')](_0xf542f9[_0x0999('0x34')],_0x29979d[_0x0999('0x33')]));if(_0xf542f9[_0x0999('0x34')][_0x0999('0x3d')]){_0x5afd71['where']=_[_0x0999('0x40')](_0x5afd71[_0x0999('0x3e')],{'$or':_[_0x0999('0x2c')](_0x5afd71[_0x0999('0x35')],function(_0x4dada5){var _0x211877={};_0x211877[_0x4dada5]={'$like':'%'+_0xf542f9[_0x0999('0x34')][_0x0999('0x3d')]+'%'};return _0x211877;})});}_0x5afd71=_[_0x0999('0x40')]({},_0x5afd71,_0xf542f9['options']);return _0x4b4a62[_0x0999('0x81')](_0x5afd71);}})[_0x0999('0x23')](function(_0x19cfb5){if(_0x19cfb5){_0x242913=_0x19cfb5[_0x0999('0x37')];if(!_0xf542f9[_0x0999('0x34')][_0x0999('0x38')](_0x0999('0x39'))){_0x5afd71[_0x0999('0x1c')]=qs[_0x0999('0x1c')](_0xf542f9[_0x0999('0x34')][_0x0999('0x1c')]);_0x5afd71['offset']=qs[_0x0999('0x1b')](_0xf542f9[_0x0999('0x34')][_0x0999('0x1b')]);}return _0x4b4a62['getBlackLists'](_0x5afd71);}})[_0x0999('0x23')](function(_0x2c5bee){if(_0x2c5bee){return _0x2c5bee?{'count':_0x242913,'rows':_0x2c5bee}:null;}})[_0x0999('0x23')](respondWithResult(_0x240568,null))['catch'](handleError(_0x240568,null));};exports[_0x0999('0x83')]=function(_0x50e95f,_0x43f7bb,_0x42191b){var _0xd31557,_0x704d2f;return db[_0x0999('0x2d')][_0x0999('0x4a')]({'where':{'id':_0x50e95f[_0x0999('0x46')]['id']}})[_0x0999('0x23')](handleEntityNotFound(_0x43f7bb,null))[_0x0999('0x23')](function(_0x319ec8){if(_0x319ec8){_0x704d2f=_0x319ec8;return _0x319ec8['addBlackLists'](_0x50e95f[_0x0999('0x4c')]['ids'],_[_0x0999('0x52')](_0x50e95f[_0x0999('0x4c')],[_0x0999('0x62'),'id'])||{});}return null;})[_0x0999('0x63')](function(_0x5b6e10){var _0x16ae05;_0xd31557=_0x5b6e10||[];var _0x42cdeb=[];if(_0x5b6e10){for(var _0x2c36d1=0x0;_0x2c36d1<_0x5b6e10['length'];_0x2c36d1+=0x1){var _0x2cd537=_0x5b6e10[_0x2c36d1][_0x0999('0x25')]({'plain':!![]});_0x16ae05=squel[_0x0999('0x65')]()[_0x0999('0x66')](_0x0999('0x84'))['fromQuery'](['phone',_0x0999('0x6d'),'ListId','CampaignId',_0x0999('0x53'),_0x0999('0x70')],squel[_0x0999('0x69')]()[_0x0999('0x6a')](_0x0999('0x7d'),_0x0999('0x7d'))[_0x0999('0x6a')]('id',_0x0999('0x6d'))['field'](_0x2cd537[_0x0999('0x6e')][_0x0999('0x6f')](),_0x0999('0x68'))['field'](_0x50e95f[_0x0999('0x46')]['id'][_0x0999('0x6f')](),_0x0999('0x5e'))[_0x0999('0x6a')](_0x0999('0x6b'),_0x0999('0x53'))['field'](_0x0999('0x6b'),'updatedAt')[_0x0999('0x76')](_0x0999('0x71'))['where'](_0x0999('0x72'))['where'](_0x0999('0x73'),_0x2cd537[_0x0999('0x6e')][_0x0999('0x6f')]())['where'](_0x0999('0x74')))[_0x0999('0x6f')]();_0x42cdeb[_0x0999('0x85')](db['sequelize'][_0x0999('0x34')](_0x16ae05));}return BPromise[_0x0999('0x7f')](_0x42cdeb);}})['then'](function(){return _0xd31557;})[_0x0999('0x23')](respondWithResult(_0x43f7bb,null))[_0x0999('0x45')](handleError(_0x43f7bb,null));};exports['removeBlackLists']=function(_0x2080d4,_0x55a2a5,_0x1f2102){return db[_0x0999('0x2d')]['find']({'where':{'id':_0x2080d4[_0x0999('0x46')]['id']}})[_0x0999('0x23')](handleEntityNotFound(_0x55a2a5,null))[_0x0999('0x23')](function(_0x18964f){if(_0x18964f){return _0x18964f[_0x0999('0x86')](_0x2080d4[_0x0999('0x34')]['ids']);}})['then'](function(_0x459baf){if(_0x459baf){return db['CmHopperBlack'][_0x0999('0x24')]({'where':{'ListId':_0x2080d4[_0x0999('0x34')][_0x0999('0x62')],'CampaignId':_0x2080d4['params']['id']}})[_0x0999('0x23')](function(){return _0x459baf;});}})['then'](respondWithStatusCode(_0x55a2a5,null))[_0x0999('0x45')](handleError(_0x55a2a5,null));}; \ No newline at end of file +var _0x1bc8=['limit','undefined','count','offset','set','Content-Range','apply','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','Campaign','includeAll','include','findAll','rows','catch','params','find','body','user','role','UserProfileSection','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','getHoppers','nolimit','CampaignId','CmHopper','CmHopperHistory','getHopperFinals','findOne','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','fromQuery','phone','scheduledAt','ListId','select','field','NOW()','ContactId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','cm_hopper','CampaignId\x20=\x20?','onlyIfOpen','insert','into','CmListId','phone\x20IS\x20NOT\x20NULL','COALESCE(phone,\x27\x27)','ListId\x20=\x20?','push','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','sequelize','removeBlackLists','CmHopperBlack','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','end'];(function(_0x319bb7,_0x23b732){var _0x4e2ddf=function(_0x4fed00){while(--_0x4fed00){_0x319bb7['push'](_0x319bb7['shift']());}};_0x4e2ddf(++_0x23b732);}(_0x1bc8,0x17c));var _0x81bc=function(_0x3076ed,_0x23db8a){_0x3076ed=_0x3076ed-0x0;var _0x25a6a9=_0x1bc8[_0x3076ed];return _0x25a6a9;};'use strict';var emlformat=require(_0x81bc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x81bc('0x1'));var jsonpatch=require(_0x81bc('0x2'));var rp=require('request-promise');var moment=require(_0x81bc('0x3'));var BPromise=require(_0x81bc('0x4'));var Mustache=require(_0x81bc('0x5'));var util=require(_0x81bc('0x6'));var path=require(_0x81bc('0x7'));var sox=require('sox');var csv=require(_0x81bc('0x8'));var ejs=require(_0x81bc('0x9'));var fs=require('fs');var fs_extra=require(_0x81bc('0xa'));var _=require(_0x81bc('0xb'));var squel=require(_0x81bc('0xc'));var crypto=require('crypto');var jsforce=require(_0x81bc('0xd'));var deskjs=require(_0x81bc('0xe'));var toCsv=require('to-csv');var querystring=require(_0x81bc('0xf'));var Papa=require(_0x81bc('0x10'));var Redis=require(_0x81bc('0x11'));var authService=require(_0x81bc('0x12'));var qs=require(_0x81bc('0x13'));var as=require(_0x81bc('0x14'));var hardwareService=require(_0x81bc('0x15'));var logger=require(_0x81bc('0x16'))(_0x81bc('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x81bc('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x188e2b,_0x5e7626){_0x5e7626=_0x5e7626||0xcc;return function(_0x59651d){if(_0x59651d){return _0x188e2b[_0x81bc('0x19')](_0x5e7626);}return _0x188e2b[_0x81bc('0x1a')](_0x5e7626)[_0x81bc('0x1b')]();};}function respondWithResult(_0x165cf1,_0x5ef171){_0x5ef171=_0x5ef171||0xc8;return function(_0x3cf9fa){if(_0x3cf9fa){return _0x165cf1['status'](_0x5ef171)['json'](_0x3cf9fa);}};}function respondWithFilteredResult(_0x4b11c1,_0x1142eb){return function(_0x556a51){if(_0x556a51){var _0x41623c=typeof _0x1142eb['offset']==='undefined'&&typeof _0x1142eb[_0x81bc('0x1c')]===_0x81bc('0x1d');var _0x4702d2=_0x556a51[_0x81bc('0x1e')];var _0xef513d=_0x41623c?0x0:_0x1142eb[_0x81bc('0x1f')];var _0x4edfe1=_0x41623c?_0x556a51[_0x81bc('0x1e')]:_0x1142eb[_0x81bc('0x1f')]+_0x1142eb[_0x81bc('0x1c')];var _0x59f29f;if(_0x4edfe1>=_0x4702d2){_0x4edfe1=_0x4702d2;_0x59f29f=0xc8;}else{_0x59f29f=0xce;}_0x4b11c1[_0x81bc('0x1a')](_0x59f29f);return _0x4b11c1[_0x81bc('0x20')](_0x81bc('0x21'),_0xef513d+'-'+_0x4edfe1+'/'+_0x4702d2)['json'](_0x556a51);}return null;};}function patchUpdates(_0x31fb8e){return function(_0x5051b9){try{jsonpatch[_0x81bc('0x22')](_0x5051b9,_0x31fb8e,!![]);}catch(_0x5a39ec){return BPromise['reject'](_0x5a39ec);}return _0x5051b9[_0x81bc('0x23')]();};}function saveUpdates(_0x8e8ed6,_0x50d0b3){return function(_0x3757c1){if(_0x3757c1){return _0x3757c1[_0x81bc('0x24')](_0x8e8ed6)[_0x81bc('0x25')](function(_0x516b97){return _0x516b97;});}return null;};}function removeEntity(_0x46882b,_0x537d56){return function(_0x510180){if(_0x510180){return _0x510180[_0x81bc('0x26')]()[_0x81bc('0x25')](function(){var _0x5d0190=_0x510180[_0x81bc('0x27')]({'plain':!![]});var _0x4a5635=_0x81bc('0x28');return db[_0x81bc('0x29')][_0x81bc('0x26')]({'where':{'type':_0x4a5635,'resourceId':_0x5d0190['id']}})[_0x81bc('0x25')](function(){return _0x510180;});})['then'](function(){_0x46882b['status'](0xcc)[_0x81bc('0x1b')]();});}};}function handleEntityNotFound(_0x248a4d,_0x310f8e){return function(_0x3468ca){if(!_0x3468ca){_0x248a4d['sendStatus'](0x194);}return _0x3468ca;};}function handleError(_0x54b40a,_0x38af59){_0x38af59=_0x38af59||0x1f4;return function(_0x1444e3){logger[_0x81bc('0x2a')](_0x1444e3[_0x81bc('0x2b')]);if(_0x1444e3[_0x81bc('0x2c')]){delete _0x1444e3['name'];}_0x54b40a[_0x81bc('0x1a')](_0x38af59)[_0x81bc('0x2d')](_0x1444e3);};}exports[_0x81bc('0x2e')]=function(_0x398fc1,_0x531ce9){var _0x16ba57={},_0x5967ed={},_0x52db27={'count':0x0,'rows':[]};var _0x101e08=_[_0x81bc('0x2f')](db['Campaign'][_0x81bc('0x30')],function(_0x39c9c1){return{'name':_0x39c9c1[_0x81bc('0x31')],'type':_0x39c9c1[_0x81bc('0x32')][_0x81bc('0x33')]};});_0x5967ed[_0x81bc('0x34')]=_['map'](_0x101e08,_0x81bc('0x2c'));_0x5967ed[_0x81bc('0x35')]=_[_0x81bc('0x36')](_0x398fc1[_0x81bc('0x35')]);_0x5967ed['filters']=_[_0x81bc('0x37')](_0x5967ed['model'],_0x5967ed[_0x81bc('0x35')]);_0x16ba57[_0x81bc('0x38')]=_[_0x81bc('0x37')](_0x5967ed[_0x81bc('0x34')],qs[_0x81bc('0x39')](_0x398fc1[_0x81bc('0x35')][_0x81bc('0x39')]));_0x16ba57[_0x81bc('0x38')]=_0x16ba57[_0x81bc('0x38')][_0x81bc('0x3a')]?_0x16ba57[_0x81bc('0x38')]:_0x5967ed[_0x81bc('0x34')];if(!_0x398fc1[_0x81bc('0x35')][_0x81bc('0x3b')]('nolimit')){_0x16ba57[_0x81bc('0x1c')]=qs[_0x81bc('0x1c')](_0x398fc1['query'][_0x81bc('0x1c')]);_0x16ba57['offset']=qs[_0x81bc('0x1f')](_0x398fc1[_0x81bc('0x35')]['offset']);}_0x16ba57[_0x81bc('0x3c')]=qs[_0x81bc('0x3d')](_0x398fc1[_0x81bc('0x35')][_0x81bc('0x3d')]);_0x16ba57[_0x81bc('0x3e')]=qs[_0x81bc('0x3f')](_[_0x81bc('0x40')](_0x398fc1[_0x81bc('0x35')],_0x5967ed['filters']),_0x101e08);if(_0x398fc1[_0x81bc('0x35')][_0x81bc('0x41')]){_0x16ba57[_0x81bc('0x3e')]=_[_0x81bc('0x42')](_0x16ba57['where'],{'$or':_[_0x81bc('0x2f')](_0x101e08,function(_0x1a581e){if(_0x1a581e[_0x81bc('0x32')]!==_0x81bc('0x43')){var _0x236948={};_0x236948[_0x1a581e[_0x81bc('0x2c')]]={'$like':'%'+_0x398fc1[_0x81bc('0x35')][_0x81bc('0x41')]+'%'};return _0x236948;}})});}_0x16ba57=_[_0x81bc('0x42')]({},_0x16ba57,_0x398fc1[_0x81bc('0x44')]);var _0x335472={'where':_0x16ba57[_0x81bc('0x3e')]};return db[_0x81bc('0x45')][_0x81bc('0x1e')](_0x335472)[_0x81bc('0x25')](function(_0xb379f7){_0x52db27[_0x81bc('0x1e')]=_0xb379f7;if(_0x398fc1['query'][_0x81bc('0x46')]){_0x16ba57[_0x81bc('0x47')]=[{'all':!![]}];}return db[_0x81bc('0x45')][_0x81bc('0x48')](_0x16ba57);})[_0x81bc('0x25')](function(_0x5a0bc9){_0x52db27[_0x81bc('0x49')]=_0x5a0bc9;return _0x52db27;})['then'](respondWithFilteredResult(_0x531ce9,_0x16ba57))[_0x81bc('0x4a')](handleError(_0x531ce9,null));};exports['show']=function(_0x33d083,_0x17a09d){var _0x4e1823={'raw':![],'where':{'id':_0x33d083[_0x81bc('0x4b')]['id']}},_0x347afa={};_0x347afa[_0x81bc('0x34')]=_[_0x81bc('0x36')](db['Campaign']['rawAttributes']);_0x347afa[_0x81bc('0x35')]=_[_0x81bc('0x36')](_0x33d083['query']);_0x347afa['filters']=_[_0x81bc('0x37')](_0x347afa[_0x81bc('0x34')],_0x347afa['query']);_0x4e1823['attributes']=_[_0x81bc('0x37')](_0x347afa['model'],qs['fields'](_0x33d083['query'][_0x81bc('0x39')]));_0x4e1823[_0x81bc('0x38')]=_0x4e1823[_0x81bc('0x38')][_0x81bc('0x3a')]?_0x4e1823['attributes']:_0x347afa[_0x81bc('0x34')];if(_0x33d083[_0x81bc('0x35')][_0x81bc('0x46')]){_0x4e1823[_0x81bc('0x47')]=[{'all':!![]}];}_0x4e1823=_['merge']({},_0x4e1823,_0x33d083[_0x81bc('0x44')]);return db[_0x81bc('0x45')][_0x81bc('0x4c')](_0x4e1823)[_0x81bc('0x25')](handleEntityNotFound(_0x17a09d,null))[_0x81bc('0x25')](respondWithResult(_0x17a09d,null))[_0x81bc('0x4a')](handleError(_0x17a09d,null));};exports['create']=function(_0x9427cd,_0x3740ca){return db[_0x81bc('0x45')]['create'](_0x9427cd[_0x81bc('0x4d')],{})[_0x81bc('0x25')](function(_0x1d0ff0){var _0x535855=_0x9427cd[_0x81bc('0x4e')][_0x81bc('0x27')]({'plain':!![]});if(!_0x535855)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x535855[_0x81bc('0x4f')]===_0x81bc('0x4e')){var _0x2f7483=_0x1d0ff0[_0x81bc('0x27')]({'plain':!![]});var _0x2e4f46=_0x81bc('0x28');return db[_0x81bc('0x50')][_0x81bc('0x4c')]({'where':{'name':_0x2e4f46,'userProfileId':_0x535855[_0x81bc('0x51')]},'raw':!![]})[_0x81bc('0x25')](function(_0x3236e7){if(_0x3236e7&&_0x3236e7['autoAssociation']===0x0){return db[_0x81bc('0x29')][_0x81bc('0x52')]({'name':_0x2f7483[_0x81bc('0x2c')],'resourceId':_0x2f7483['id'],'type':_0x3236e7[_0x81bc('0x2c')],'sectionId':_0x3236e7['id']},{})[_0x81bc('0x25')](function(){return _0x1d0ff0;});}else{return _0x1d0ff0;}})[_0x81bc('0x4a')](function(_0x442488){logger[_0x81bc('0x2a')](_0x81bc('0x53'),_0x442488);throw _0x442488;});}return _0x1d0ff0;})['then'](respondWithResult(_0x3740ca,0xc9))[_0x81bc('0x4a')](handleError(_0x3740ca,null));};exports[_0x81bc('0x54')]=function(_0x5f21af,_0x5b5646){var _0x87ecd1={'where':{'id':_0x5f21af[_0x81bc('0x4b')]['id']}},_0x5895ac={};_0x5895ac[_0x81bc('0x34')]=_[_0x81bc('0x36')](db[_0x81bc('0x45')][_0x81bc('0x30')]);_0x87ecd1[_0x81bc('0x38')]=_[_0x81bc('0x37')](_0x5895ac['model'],qs[_0x81bc('0x39')](_0x5f21af[_0x81bc('0x35')]['fields']));_0x87ecd1['attributes']=_0x87ecd1['attributes']['length']?_0x87ecd1[_0x81bc('0x38')]:_0x5895ac['model'];if(_0x5f21af[_0x81bc('0x35')][_0x81bc('0x46')]){_0x87ecd1[_0x81bc('0x47')]=[{'all':!![]}];}_0x87ecd1=_[_0x81bc('0x42')]({},_0x87ecd1,_0x5f21af[_0x81bc('0x44')]);return db[_0x81bc('0x45')]['find'](_0x87ecd1)[_0x81bc('0x25')](handleEntityNotFound(_0x5b5646,null))['then'](function(_0x50d69b){if(_0x50d69b){var _0x5d0d2a=_0x50d69b[_0x81bc('0x27')]({'plain':!![]});_0x5d0d2a=qs[_0x81bc('0x55')](_0x5d0d2a,['id',_0x81bc('0x56'),_0x81bc('0x57')]);_0x5f21af['body']=_[_0x81bc('0x55')](_0x5f21af[_0x81bc('0x4d')],['id',_0x81bc('0x56'),'updatedAt']);return db[_0x81bc('0x45')][_0x81bc('0x52')](_[_0x81bc('0x42')](_0x5d0d2a,_0x5f21af[_0x81bc('0x4d')]),{'include':_0x5f21af[_0x81bc('0x35')]['includeAll']?[{'all':!![]}]:undefined})[_0x81bc('0x25')](function(_0x2524a9){var _0x115aeb=_0x5f21af[_0x81bc('0x4e')]['get']({'plain':!![]});if(!_0x115aeb)throw new Error(_0x81bc('0x58'));if(_0x115aeb[_0x81bc('0x4f')]===_0x81bc('0x4e')){var _0xb3c53b=_0x2524a9[_0x81bc('0x27')]({'plain':!![]});var _0x2bc3e0=_0x81bc('0x28');return db[_0x81bc('0x50')][_0x81bc('0x4c')]({'where':{'name':_0x2bc3e0,'userProfileId':_0x115aeb['userProfileId']},'raw':!![]})['then'](function(_0xf6c3f4){if(_0xf6c3f4&&_0xf6c3f4['autoAssociation']===0x0){return db[_0x81bc('0x29')][_0x81bc('0x52')]({'name':_0xb3c53b[_0x81bc('0x2c')],'resourceId':_0xb3c53b['id'],'type':_0xf6c3f4[_0x81bc('0x2c')],'sectionId':_0xf6c3f4['id']},{})[_0x81bc('0x25')](function(){return _0x2524a9;});}else{return _0x2524a9;}})[_0x81bc('0x4a')](function(_0x2b175d){logger[_0x81bc('0x2a')](_0x81bc('0x53'),_0x2b175d);throw _0x2b175d;});}return _0x2524a9;});}})['then'](respondWithResult(_0x5b5646,0xc9))['catch'](handleError(_0x5b5646,null));};exports['update']=function(_0x21673e,_0x41fb1f){if(_0x21673e[_0x81bc('0x4d')]['id']){delete _0x21673e['body']['id'];}return db[_0x81bc('0x45')][_0x81bc('0x4c')]({'where':{'id':_0x21673e['params']['id']}})[_0x81bc('0x25')](handleEntityNotFound(_0x41fb1f,null))[_0x81bc('0x25')](saveUpdates(_0x21673e[_0x81bc('0x4d')],null))[_0x81bc('0x25')](respondWithResult(_0x41fb1f,null))[_0x81bc('0x4a')](handleError(_0x41fb1f,null));};exports['destroy']=function(_0x1b8335,_0x146779){return db[_0x81bc('0x45')][_0x81bc('0x4c')]({'where':{'id':_0x1b8335[_0x81bc('0x4b')]['id']}})[_0x81bc('0x25')](handleEntityNotFound(_0x146779,null))[_0x81bc('0x25')](removeEntity(_0x146779,null))['catch'](handleError(_0x146779,null));};exports[_0x81bc('0x59')]=function(_0x5e33b7,_0x508eec,_0x53046c){var _0x5580b3={'raw':!![],'where':{}};var _0x3d0107={};var _0x4a2f45={'count':0x0,'rows':[]};return db[_0x81bc('0x45')]['findOne']({'where':{'id':_0x5e33b7[_0x81bc('0x4b')]['id']}})[_0x81bc('0x25')](handleEntityNotFound(_0x508eec,null))[_0x81bc('0x25')](function(_0x5dc53c){if(_0x5dc53c){_0x3d0107[_0x81bc('0x34')]=_[_0x81bc('0x36')](db['CmHopper']['rawAttributes']);_0x3d0107[_0x81bc('0x35')]=_[_0x81bc('0x36')](_0x5e33b7[_0x81bc('0x35')]);_0x3d0107['filters']=_[_0x81bc('0x37')](_0x3d0107[_0x81bc('0x34')],_0x3d0107[_0x81bc('0x35')]);_0x5580b3[_0x81bc('0x38')]=_['intersection'](_0x3d0107['model'],qs['fields'](_0x5e33b7[_0x81bc('0x35')]['fields']));_0x5580b3[_0x81bc('0x38')]=_0x5580b3[_0x81bc('0x38')][_0x81bc('0x3a')]?_0x5580b3['attributes']:_0x3d0107['model'];if(!_0x5e33b7[_0x81bc('0x35')]['hasOwnProperty'](_0x81bc('0x5a'))){_0x5580b3[_0x81bc('0x1c')]=qs[_0x81bc('0x1c')](_0x5e33b7[_0x81bc('0x35')][_0x81bc('0x1c')]);_0x5580b3[_0x81bc('0x1f')]=qs['offset'](_0x5e33b7['query'][_0x81bc('0x1f')]);}_0x5580b3[_0x81bc('0x3c')]=qs['sort'](_0x5e33b7[_0x81bc('0x35')]['sort']);_0x5580b3['where']=qs[_0x81bc('0x3f')](_[_0x81bc('0x40')](_0x5e33b7[_0x81bc('0x35')],_0x3d0107[_0x81bc('0x3f')]));_0x5580b3[_0x81bc('0x3e')][_0x81bc('0x5b')]=_0x5dc53c['id'];if(_0x5e33b7[_0x81bc('0x35')]['filter']){_0x5580b3['where']=_['merge'](_0x5580b3['where'],{'$or':_['map'](_0x5580b3[_0x81bc('0x38')],function(_0x37c554){var _0x6f4d62={};_0x6f4d62[_0x37c554]={'$like':'%'+_0x5e33b7[_0x81bc('0x35')][_0x81bc('0x41')]+'%'};return _0x6f4d62;})});}_0x5580b3=_[_0x81bc('0x42')]({},_0x5580b3,_0x5e33b7[_0x81bc('0x44')]);return db[_0x81bc('0x5c')]['count']({'where':_0x5580b3[_0x81bc('0x3e')]})[_0x81bc('0x25')](function(_0x58b103){_0x4a2f45['count']=_0x58b103;if(_0x5e33b7[_0x81bc('0x35')][_0x81bc('0x46')]){_0x5580b3['include']=[{'all':!![]}];}return db[_0x81bc('0x5c')][_0x81bc('0x48')](_0x5580b3);})[_0x81bc('0x25')](function(_0x157693){_0x4a2f45['rows']=_0x157693;return _0x4a2f45;});}})[_0x81bc('0x25')](respondWithFilteredResult(_0x508eec,_0x5580b3))[_0x81bc('0x4a')](handleError(_0x508eec,null));};exports['getHopperHistories']=function(_0x299edc,_0x4d0cef,_0x24f716){var _0x31f950={'raw':!![],'where':{}};var _0x311d89={};var _0x539c02={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x299edc[_0x81bc('0x4b')]['id']}})[_0x81bc('0x25')](handleEntityNotFound(_0x4d0cef,null))[_0x81bc('0x25')](function(_0x115971){if(_0x115971){_0x311d89['model']=_[_0x81bc('0x36')](db[_0x81bc('0x5d')][_0x81bc('0x30')]);_0x311d89['query']=_['keys'](_0x299edc[_0x81bc('0x35')]);_0x311d89[_0x81bc('0x3f')]=_[_0x81bc('0x37')](_0x311d89[_0x81bc('0x34')],_0x311d89[_0x81bc('0x35')]);_0x31f950['attributes']=_[_0x81bc('0x37')](_0x311d89[_0x81bc('0x34')],qs[_0x81bc('0x39')](_0x299edc[_0x81bc('0x35')][_0x81bc('0x39')]));_0x31f950[_0x81bc('0x38')]=_0x31f950[_0x81bc('0x38')]['length']?_0x31f950[_0x81bc('0x38')]:_0x311d89[_0x81bc('0x34')];if(!_0x299edc[_0x81bc('0x35')][_0x81bc('0x3b')](_0x81bc('0x5a'))){_0x31f950[_0x81bc('0x1c')]=qs[_0x81bc('0x1c')](_0x299edc[_0x81bc('0x35')][_0x81bc('0x1c')]);_0x31f950['offset']=qs[_0x81bc('0x1f')](_0x299edc[_0x81bc('0x35')][_0x81bc('0x1f')]);}_0x31f950[_0x81bc('0x3c')]=qs[_0x81bc('0x3d')](_0x299edc['query'][_0x81bc('0x3d')]);_0x31f950[_0x81bc('0x3e')]=qs[_0x81bc('0x3f')](_[_0x81bc('0x40')](_0x299edc['query'],_0x311d89[_0x81bc('0x3f')]));_0x31f950[_0x81bc('0x3e')][_0x81bc('0x5b')]=_0x115971['id'];if(_0x299edc[_0x81bc('0x35')]['filter']){_0x31f950[_0x81bc('0x3e')]=_[_0x81bc('0x42')](_0x31f950[_0x81bc('0x3e')],{'$or':_['map'](_0x31f950[_0x81bc('0x38')],function(_0x28796f){var _0x56f671={};_0x56f671[_0x28796f]={'$like':'%'+_0x299edc[_0x81bc('0x35')][_0x81bc('0x41')]+'%'};return _0x56f671;})});}_0x31f950=_[_0x81bc('0x42')]({},_0x31f950,_0x299edc['options']);return db[_0x81bc('0x5d')][_0x81bc('0x1e')]({'where':_0x31f950[_0x81bc('0x3e')]})[_0x81bc('0x25')](function(_0x2e26d0){_0x539c02[_0x81bc('0x1e')]=_0x2e26d0;if(_0x299edc[_0x81bc('0x35')][_0x81bc('0x46')]){_0x31f950[_0x81bc('0x47')]=[{'all':!![]}];}return db[_0x81bc('0x5d')]['findAll'](_0x31f950);})['then'](function(_0x4ac4ae){_0x539c02[_0x81bc('0x49')]=_0x4ac4ae;return _0x539c02;});}})[_0x81bc('0x25')](respondWithFilteredResult(_0x4d0cef,_0x31f950))[_0x81bc('0x4a')](handleError(_0x4d0cef,null));};exports[_0x81bc('0x5e')]=function(_0x5f4d67,_0x5c2ac5,_0x5d3b2c){var _0x5c72f8={'raw':!![],'where':{}};var _0x5d505d={};var _0x3da3e4={'count':0x0,'rows':[]};return db[_0x81bc('0x45')]['findOne']({'where':{'id':_0x5f4d67[_0x81bc('0x4b')]['id']}})[_0x81bc('0x25')](handleEntityNotFound(_0x5c2ac5,null))[_0x81bc('0x25')](function(_0x20b7b8){if(_0x20b7b8){_0x5d505d[_0x81bc('0x34')]=_[_0x81bc('0x36')](db['CmHopperFinal']['rawAttributes']);_0x5d505d[_0x81bc('0x35')]=_[_0x81bc('0x36')](_0x5f4d67[_0x81bc('0x35')]);_0x5d505d[_0x81bc('0x3f')]=_[_0x81bc('0x37')](_0x5d505d[_0x81bc('0x34')],_0x5d505d[_0x81bc('0x35')]);_0x5c72f8[_0x81bc('0x38')]=_[_0x81bc('0x37')](_0x5d505d[_0x81bc('0x34')],qs[_0x81bc('0x39')](_0x5f4d67['query'][_0x81bc('0x39')]));_0x5c72f8[_0x81bc('0x38')]=_0x5c72f8['attributes'][_0x81bc('0x3a')]?_0x5c72f8[_0x81bc('0x38')]:_0x5d505d[_0x81bc('0x34')];if(!_0x5f4d67[_0x81bc('0x35')][_0x81bc('0x3b')](_0x81bc('0x5a'))){_0x5c72f8[_0x81bc('0x1c')]=qs['limit'](_0x5f4d67['query'][_0x81bc('0x1c')]);_0x5c72f8['offset']=qs[_0x81bc('0x1f')](_0x5f4d67[_0x81bc('0x35')]['offset']);}_0x5c72f8[_0x81bc('0x3c')]=qs[_0x81bc('0x3d')](_0x5f4d67[_0x81bc('0x35')][_0x81bc('0x3d')]);_0x5c72f8['where']=qs['filters'](_[_0x81bc('0x40')](_0x5f4d67['query'],_0x5d505d[_0x81bc('0x3f')]));_0x5c72f8[_0x81bc('0x3e')][_0x81bc('0x5b')]=_0x20b7b8['id'];if(_0x5f4d67[_0x81bc('0x35')][_0x81bc('0x41')]){_0x5c72f8['where']=_[_0x81bc('0x42')](_0x5c72f8[_0x81bc('0x3e')],{'$or':_[_0x81bc('0x2f')](_0x5c72f8['attributes'],function(_0x2edff9){var _0x154d31={};_0x154d31[_0x2edff9]={'$like':'%'+_0x5f4d67[_0x81bc('0x35')][_0x81bc('0x41')]+'%'};return _0x154d31;})});}_0x5c72f8=_[_0x81bc('0x42')]({},_0x5c72f8,_0x5f4d67[_0x81bc('0x44')]);return db['CmHopperFinal'][_0x81bc('0x1e')]({'where':_0x5c72f8[_0x81bc('0x3e')]})[_0x81bc('0x25')](function(_0x584976){_0x3da3e4['count']=_0x584976;if(_0x5f4d67['query'][_0x81bc('0x46')]){_0x5c72f8[_0x81bc('0x47')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x5c72f8);})[_0x81bc('0x25')](function(_0x5c9358){_0x3da3e4['rows']=_0x5c9358;return _0x3da3e4;});}})[_0x81bc('0x25')](respondWithFilteredResult(_0x5c2ac5,_0x5c72f8))[_0x81bc('0x4a')](handleError(_0x5c2ac5,null));};exports['getHopperBlacks']=function(_0x290415,_0x219274,_0x30ad3f){var _0x512d57={'raw':!![],'where':{}};var _0x5f517b={};var _0x3b8321={'count':0x0,'rows':[]};return db[_0x81bc('0x45')][_0x81bc('0x5f')]({'where':{'id':_0x290415[_0x81bc('0x4b')]['id']}})[_0x81bc('0x25')](handleEntityNotFound(_0x219274,null))[_0x81bc('0x25')](function(_0x195591){if(_0x195591){_0x5f517b[_0x81bc('0x34')]=_[_0x81bc('0x36')](db['CmHopperBlack'][_0x81bc('0x30')]);_0x5f517b[_0x81bc('0x35')]=_[_0x81bc('0x36')](_0x290415['query']);_0x5f517b['filters']=_[_0x81bc('0x37')](_0x5f517b[_0x81bc('0x34')],_0x5f517b[_0x81bc('0x35')]);_0x512d57['attributes']=_[_0x81bc('0x37')](_0x5f517b['model'],qs[_0x81bc('0x39')](_0x290415[_0x81bc('0x35')]['fields']));_0x512d57[_0x81bc('0x38')]=_0x512d57[_0x81bc('0x38')]['length']?_0x512d57[_0x81bc('0x38')]:_0x5f517b['model'];if(!_0x290415[_0x81bc('0x35')][_0x81bc('0x3b')]('nolimit')){_0x512d57[_0x81bc('0x1c')]=qs[_0x81bc('0x1c')](_0x290415[_0x81bc('0x35')][_0x81bc('0x1c')]);_0x512d57[_0x81bc('0x1f')]=qs[_0x81bc('0x1f')](_0x290415[_0x81bc('0x35')]['offset']);}_0x512d57[_0x81bc('0x3c')]=qs[_0x81bc('0x3d')](_0x290415['query'][_0x81bc('0x3d')]);_0x512d57['where']=qs[_0x81bc('0x3f')](_[_0x81bc('0x40')](_0x290415[_0x81bc('0x35')],_0x5f517b[_0x81bc('0x3f')]));_0x512d57[_0x81bc('0x3e')]['CampaignId']=_0x195591['id'];if(_0x290415[_0x81bc('0x35')][_0x81bc('0x41')]){_0x512d57[_0x81bc('0x3e')]=_['merge'](_0x512d57[_0x81bc('0x3e')],{'$or':_[_0x81bc('0x2f')](_0x512d57[_0x81bc('0x38')],function(_0xd27526){var _0xbe4c2e={};_0xbe4c2e[_0xd27526]={'$like':'%'+_0x290415[_0x81bc('0x35')][_0x81bc('0x41')]+'%'};return _0xbe4c2e;})});}_0x512d57=_[_0x81bc('0x42')]({},_0x512d57,_0x290415[_0x81bc('0x44')]);return db['CmHopperBlack'][_0x81bc('0x1e')]({'where':_0x512d57[_0x81bc('0x3e')]})[_0x81bc('0x25')](function(_0x2c3ad7){_0x3b8321[_0x81bc('0x1e')]=_0x2c3ad7;if(_0x290415[_0x81bc('0x35')]['includeAll']){_0x512d57['include']=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x512d57);})[_0x81bc('0x25')](function(_0x52ba7c){_0x3b8321['rows']=_0x52ba7c;return _0x3b8321;});}})[_0x81bc('0x25')](respondWithFilteredResult(_0x219274,_0x512d57))[_0x81bc('0x4a')](handleError(_0x219274,null));};exports[_0x81bc('0x60')]=function(_0x16c014,_0xeabb5e,_0x5b11ca){var _0x3d648b={};var _0x1601c5={};var _0x45b704;var _0x4774c1;return db[_0x81bc('0x45')][_0x81bc('0x5f')]({'where':{'id':_0x16c014[_0x81bc('0x4b')]['id']}})['then'](handleEntityNotFound(_0xeabb5e,null))['then'](function(_0x3da51d){if(_0x3da51d){_0x45b704=_0x3da51d;_0x1601c5[_0x81bc('0x34')]=_['keys'](db[_0x81bc('0x61')][_0x81bc('0x30')]);_0x1601c5['query']=_['keys'](_0x16c014[_0x81bc('0x35')]);_0x1601c5[_0x81bc('0x3f')]=_[_0x81bc('0x37')](_0x1601c5[_0x81bc('0x34')],_0x1601c5[_0x81bc('0x35')]);_0x3d648b['attributes']=_[_0x81bc('0x37')](_0x1601c5['model'],qs['fields'](_0x16c014[_0x81bc('0x35')][_0x81bc('0x39')]));_0x3d648b[_0x81bc('0x38')]=_0x3d648b[_0x81bc('0x38')][_0x81bc('0x3a')]?_0x3d648b['attributes']:_0x1601c5[_0x81bc('0x34')];_0x3d648b[_0x81bc('0x3c')]=qs['sort'](_0x16c014[_0x81bc('0x35')]['sort']);_0x3d648b[_0x81bc('0x3e')]=qs[_0x81bc('0x3f')](_[_0x81bc('0x40')](_0x16c014['query'],_0x1601c5[_0x81bc('0x3f')]));if(_0x16c014[_0x81bc('0x35')][_0x81bc('0x41')]){_0x3d648b['where']=_[_0x81bc('0x42')](_0x3d648b[_0x81bc('0x3e')],{'$or':_[_0x81bc('0x2f')](_0x3d648b['attributes'],function(_0x3a1864){var _0x17537f={};_0x17537f[_0x3a1864]={'$like':'%'+_0x16c014[_0x81bc('0x35')][_0x81bc('0x41')]+'%'};return _0x17537f;})});}_0x3d648b=_['merge']({},_0x3d648b,_0x16c014[_0x81bc('0x44')]);return _0x45b704[_0x81bc('0x60')](_0x3d648b);}})['then'](function(_0x450c38){if(_0x450c38){_0x4774c1=_0x450c38['length'];if(!_0x16c014['query'][_0x81bc('0x3b')](_0x81bc('0x5a'))){_0x3d648b['limit']=qs['limit'](_0x16c014[_0x81bc('0x35')]['limit']);_0x3d648b[_0x81bc('0x1f')]=qs[_0x81bc('0x1f')](_0x16c014[_0x81bc('0x35')]['offset']);}return _0x45b704['getLists'](_0x3d648b);}})['then'](function(_0x4c9aac){if(_0x4c9aac){return _0x4c9aac?{'count':_0x4774c1,'rows':_0x4c9aac}:null;}})['then'](respondWithResult(_0xeabb5e,null))['catch'](handleError(_0xeabb5e,null));};exports[_0x81bc('0x62')]=function(_0x4c86a9,_0x303f61,_0x270711){var _0x5b95e9,_0x37f9e1;return db['Campaign'][_0x81bc('0x4c')]({'where':{'id':_0x4c86a9[_0x81bc('0x4b')]['id']}})[_0x81bc('0x25')](handleEntityNotFound(_0x303f61,null))[_0x81bc('0x25')](function(_0x33298b){if(_0x33298b){_0x37f9e1=_0x33298b;return _0x33298b['addLists'](_0x4c86a9[_0x81bc('0x4d')][_0x81bc('0x63')],_[_0x81bc('0x55')](_0x4c86a9[_0x81bc('0x4d')],[_0x81bc('0x63'),'id'])||{});}return null;})[_0x81bc('0x64')](function(_0x325fcd){var _0x535386;_0x5b95e9=_0x325fcd||[];var _0x266b6d=[];if(_0x325fcd){for(var _0x5c0d3e=0x0;_0x5c0d3e<_0x325fcd[_0x81bc('0x3a')];_0x5c0d3e+=0x1){var _0x2be2c3=_0x325fcd[_0x5c0d3e][_0x81bc('0x27')]({'plain':!![]});_0x37f9e1[_0x81bc('0x65')]=_0x4c86a9['body']['dialCheckDuplicateType']?_0x4c86a9[_0x81bc('0x4d')][_0x81bc('0x65')]:_0x37f9e1[_0x81bc('0x65')];switch(_0x37f9e1[_0x81bc('0x65')]){case _0x81bc('0x66'):_0x535386=squel['insert']()['into']('cm_hopper')[_0x81bc('0x67')]([_0x81bc('0x68'),_0x81bc('0x69'),'ContactId',_0x81bc('0x6a'),'CampaignId','createdAt',_0x81bc('0x57')],squel[_0x81bc('0x6b')]()[_0x81bc('0x6c')](_0x81bc('0x68'),_0x81bc('0x68'))[_0x81bc('0x6c')](_0x81bc('0x6d'),_0x81bc('0x69'))[_0x81bc('0x6c')]('id',_0x81bc('0x6e'))[_0x81bc('0x6c')](_0x2be2c3['CmListId'][_0x81bc('0x6f')](),'ListId')[_0x81bc('0x6c')](_0x4c86a9[_0x81bc('0x4b')]['id']['toString'](),'CampaignId')[_0x81bc('0x6c')](_0x81bc('0x6d'),_0x81bc('0x56'))['field'](_0x81bc('0x6d'),_0x81bc('0x57'))[_0x81bc('0x70')](_0x81bc('0x71'))[_0x81bc('0x3e')](_0x81bc('0x72'))[_0x81bc('0x3e')]('ListId\x20=\x20?',_0x2be2c3['CmListId'][_0x81bc('0x6f')]())[_0x81bc('0x3e')]('phone\x20IS\x20NOT\x20NULL')[_0x81bc('0x3e')](_0x81bc('0x73'),squel[_0x81bc('0x6b')]()[_0x81bc('0x6c')](_0x81bc('0x74'))[_0x81bc('0x70')](_0x81bc('0x75'))['where']('CampaignId\x20=\x20?',_0x4c86a9[_0x81bc('0x4b')]['id'][_0x81bc('0x6f')]()))[_0x81bc('0x3e')](_0x81bc('0x73'),squel['select']()[_0x81bc('0x6c')]('COALESCE(phone,\x27\x27)')[_0x81bc('0x70')](_0x81bc('0x76'))[_0x81bc('0x3e')](_0x81bc('0x77'),_0x4c86a9[_0x81bc('0x4b')]['id'][_0x81bc('0x6f')]())))[_0x81bc('0x6f')]();break;case _0x81bc('0x78'):_0x535386=squel[_0x81bc('0x79')]()[_0x81bc('0x7a')](_0x81bc('0x76'))[_0x81bc('0x67')](['phone',_0x81bc('0x69'),'ContactId',_0x81bc('0x6a'),_0x81bc('0x5b'),_0x81bc('0x56'),_0x81bc('0x57')],squel[_0x81bc('0x6b')]()[_0x81bc('0x6c')]('phone',_0x81bc('0x68'))[_0x81bc('0x6c')](_0x81bc('0x6d'),'scheduledAt')[_0x81bc('0x6c')]('id',_0x81bc('0x6e'))[_0x81bc('0x6c')](_0x2be2c3[_0x81bc('0x7b')][_0x81bc('0x6f')](),_0x81bc('0x6a'))[_0x81bc('0x6c')](_0x4c86a9[_0x81bc('0x4b')]['id'][_0x81bc('0x6f')](),_0x81bc('0x5b'))['field'](_0x81bc('0x6d'),_0x81bc('0x56'))[_0x81bc('0x6c')](_0x81bc('0x6d'),_0x81bc('0x57'))[_0x81bc('0x70')](_0x81bc('0x71'))[_0x81bc('0x3e')](_0x81bc('0x72'))['where']('ListId\x20=\x20?',_0x2be2c3[_0x81bc('0x7b')][_0x81bc('0x6f')]())[_0x81bc('0x3e')](_0x81bc('0x7c'))[_0x81bc('0x3e')]('phone\x20NOT\x20IN\x20(?)',squel[_0x81bc('0x6b')]()[_0x81bc('0x6c')](_0x81bc('0x7d'))['from'](_0x81bc('0x76'))[_0x81bc('0x3e')](_0x81bc('0x77'),_0x4c86a9[_0x81bc('0x4b')]['id']['toString']())))[_0x81bc('0x6f')]();break;default:_0x535386=squel[_0x81bc('0x79')]()[_0x81bc('0x7a')](_0x81bc('0x76'))[_0x81bc('0x67')](['phone','scheduledAt',_0x81bc('0x6e'),'ListId',_0x81bc('0x5b'),'createdAt',_0x81bc('0x57')],squel[_0x81bc('0x6b')]()[_0x81bc('0x6c')]('phone','phone')[_0x81bc('0x6c')](_0x81bc('0x6d'),_0x81bc('0x69'))[_0x81bc('0x6c')]('id',_0x81bc('0x6e'))[_0x81bc('0x6c')](_0x2be2c3[_0x81bc('0x7b')][_0x81bc('0x6f')](),_0x81bc('0x6a'))['field'](_0x4c86a9[_0x81bc('0x4b')]['id'][_0x81bc('0x6f')](),_0x81bc('0x5b'))['field']('NOW()',_0x81bc('0x56'))[_0x81bc('0x6c')](_0x81bc('0x6d'),_0x81bc('0x57'))[_0x81bc('0x70')](_0x81bc('0x71'))[_0x81bc('0x3e')]('deletedAt\x20IS\x20NULL')['where'](_0x81bc('0x7e'),_0x2be2c3[_0x81bc('0x7b')][_0x81bc('0x6f')]())['where'](_0x81bc('0x7c')))[_0x81bc('0x6f')]();}_0x266b6d[_0x81bc('0x7f')](db['sequelize'][_0x81bc('0x35')](_0x535386));}return BPromise[_0x81bc('0x80')](_0x266b6d);}})[_0x81bc('0x25')](function(){return _0x5b95e9;})['then'](respondWithResult(_0x303f61,null))[_0x81bc('0x4a')](handleError(_0x303f61,null));};exports[_0x81bc('0x81')]=function(_0x42a37c,_0x41db69,_0x516a00){return db[_0x81bc('0x45')]['find']({'where':{'id':_0x42a37c[_0x81bc('0x4b')]['id']}})[_0x81bc('0x25')](handleEntityNotFound(_0x41db69,null))[_0x81bc('0x25')](function(_0x32f196){if(_0x32f196){return _0x32f196[_0x81bc('0x81')](_0x42a37c[_0x81bc('0x35')][_0x81bc('0x63')]);}})['then'](function(_0x43f469){if(_0x43f469){return db[_0x81bc('0x5c')][_0x81bc('0x26')]({'where':{'ListId':_0x42a37c[_0x81bc('0x35')][_0x81bc('0x63')],'CampaignId':_0x42a37c[_0x81bc('0x4b')]['id']}})['then'](function(){return _0x43f469;});}})['then'](respondWithStatusCode(_0x41db69,null))[_0x81bc('0x4a')](handleError(_0x41db69,null));};exports[_0x81bc('0x82')]=function(_0x1edd1d,_0x9d8dcd,_0xae8668){var _0x3fa46d={};var _0x3b8868={};var _0xb7b759;var _0x505fb9;return db[_0x81bc('0x45')]['findOne']({'where':{'id':_0x1edd1d[_0x81bc('0x4b')]['id']}})[_0x81bc('0x25')](handleEntityNotFound(_0x9d8dcd,null))[_0x81bc('0x25')](function(_0x1f8b2b){if(_0x1f8b2b){_0xb7b759=_0x1f8b2b;_0x3b8868[_0x81bc('0x34')]=_['keys'](db[_0x81bc('0x61')]['rawAttributes']);_0x3b8868[_0x81bc('0x35')]=_['keys'](_0x1edd1d[_0x81bc('0x35')]);_0x3b8868[_0x81bc('0x3f')]=_[_0x81bc('0x37')](_0x3b8868[_0x81bc('0x34')],_0x3b8868[_0x81bc('0x35')]);_0x3fa46d['attributes']=_[_0x81bc('0x37')](_0x3b8868['model'],qs[_0x81bc('0x39')](_0x1edd1d[_0x81bc('0x35')]['fields']));_0x3fa46d[_0x81bc('0x38')]=_0x3fa46d[_0x81bc('0x38')]['length']?_0x3fa46d[_0x81bc('0x38')]:_0x3b8868['model'];_0x3fa46d[_0x81bc('0x3c')]=qs[_0x81bc('0x3d')](_0x1edd1d['query'][_0x81bc('0x3d')]);_0x3fa46d[_0x81bc('0x3e')]=qs[_0x81bc('0x3f')](_['pick'](_0x1edd1d[_0x81bc('0x35')],_0x3b8868['filters']));if(_0x1edd1d[_0x81bc('0x35')][_0x81bc('0x41')]){_0x3fa46d[_0x81bc('0x3e')]=_[_0x81bc('0x42')](_0x3fa46d['where'],{'$or':_[_0x81bc('0x2f')](_0x3fa46d[_0x81bc('0x38')],function(_0x296378){var _0x5b701f={};_0x5b701f[_0x296378]={'$like':'%'+_0x1edd1d[_0x81bc('0x35')][_0x81bc('0x41')]+'%'};return _0x5b701f;})});}_0x3fa46d=_[_0x81bc('0x42')]({},_0x3fa46d,_0x1edd1d[_0x81bc('0x44')]);return _0xb7b759['getBlackLists'](_0x3fa46d);}})[_0x81bc('0x25')](function(_0x4153a5){if(_0x4153a5){_0x505fb9=_0x4153a5[_0x81bc('0x3a')];if(!_0x1edd1d[_0x81bc('0x35')][_0x81bc('0x3b')](_0x81bc('0x5a'))){_0x3fa46d[_0x81bc('0x1c')]=qs[_0x81bc('0x1c')](_0x1edd1d[_0x81bc('0x35')][_0x81bc('0x1c')]);_0x3fa46d[_0x81bc('0x1f')]=qs[_0x81bc('0x1f')](_0x1edd1d['query']['offset']);}return _0xb7b759[_0x81bc('0x82')](_0x3fa46d);}})[_0x81bc('0x25')](function(_0x2dacc7){if(_0x2dacc7){return _0x2dacc7?{'count':_0x505fb9,'rows':_0x2dacc7}:null;}})[_0x81bc('0x25')](respondWithResult(_0x9d8dcd,null))[_0x81bc('0x4a')](handleError(_0x9d8dcd,null));};exports[_0x81bc('0x83')]=function(_0x1ea758,_0x56f4d6,_0x29fc43){var _0x134828,_0x5d5f42;return db['Campaign']['find']({'where':{'id':_0x1ea758[_0x81bc('0x4b')]['id']}})[_0x81bc('0x25')](handleEntityNotFound(_0x56f4d6,null))[_0x81bc('0x25')](function(_0x2fc3f4){if(_0x2fc3f4){_0x5d5f42=_0x2fc3f4;return _0x2fc3f4[_0x81bc('0x83')](_0x1ea758[_0x81bc('0x4d')]['ids'],_['omit'](_0x1ea758[_0x81bc('0x4d')],[_0x81bc('0x63'),'id'])||{});}return null;})['spread'](function(_0x3134c3){var _0x499af6;_0x134828=_0x3134c3||[];var _0x41c018=[];if(_0x3134c3){for(var _0x3c36d7=0x0;_0x3c36d7<_0x3134c3['length'];_0x3c36d7+=0x1){var _0xb10307=_0x3134c3[_0x3c36d7][_0x81bc('0x27')]({'plain':!![]});_0x499af6=squel[_0x81bc('0x79')]()['into'](_0x81bc('0x84'))['fromQuery']([_0x81bc('0x68'),'ContactId','ListId',_0x81bc('0x5b'),_0x81bc('0x56'),_0x81bc('0x57')],squel[_0x81bc('0x6b')]()[_0x81bc('0x6c')](_0x81bc('0x68'),_0x81bc('0x68'))['field']('id','ContactId')[_0x81bc('0x6c')](_0xb10307[_0x81bc('0x7b')][_0x81bc('0x6f')](),_0x81bc('0x6a'))[_0x81bc('0x6c')](_0x1ea758['params']['id'][_0x81bc('0x6f')](),'CampaignId')[_0x81bc('0x6c')](_0x81bc('0x6d'),_0x81bc('0x56'))[_0x81bc('0x6c')](_0x81bc('0x6d'),'updatedAt')['from'](_0x81bc('0x71'))[_0x81bc('0x3e')](_0x81bc('0x72'))[_0x81bc('0x3e')](_0x81bc('0x7e'),_0xb10307[_0x81bc('0x7b')][_0x81bc('0x6f')]())[_0x81bc('0x3e')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x41c018[_0x81bc('0x7f')](db[_0x81bc('0x85')][_0x81bc('0x35')](_0x499af6));}return BPromise[_0x81bc('0x80')](_0x41c018);}})['then'](function(){return _0x134828;})[_0x81bc('0x25')](respondWithResult(_0x56f4d6,null))[_0x81bc('0x4a')](handleError(_0x56f4d6,null));};exports['removeBlackLists']=function(_0x3c48b2,_0x259aff,_0x186cf7){return db[_0x81bc('0x45')][_0x81bc('0x4c')]({'where':{'id':_0x3c48b2[_0x81bc('0x4b')]['id']}})['then'](handleEntityNotFound(_0x259aff,null))[_0x81bc('0x25')](function(_0x190f73){if(_0x190f73){return _0x190f73[_0x81bc('0x86')](_0x3c48b2[_0x81bc('0x35')][_0x81bc('0x63')]);}})[_0x81bc('0x25')](function(_0x223e33){if(_0x223e33){return db[_0x81bc('0x87')][_0x81bc('0x26')]({'where':{'ListId':_0x3c48b2[_0x81bc('0x35')][_0x81bc('0x63')],'CampaignId':_0x3c48b2[_0x81bc('0x4b')]['id']}})[_0x81bc('0x25')](function(){return _0x223e33;});}})[_0x81bc('0x25')](respondWithStatusCode(_0x259aff,null))['catch'](handleError(_0x259aff,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index f1fbe1b..c829b75 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x1c50d6,_0x1097f2){var _0x566560=function(_0x7fad7){while(--_0x7fad7){_0x1c50d6['push'](_0x1c50d6['shift']());}};_0x566560(++_0x1097f2);}(_0x7a54,0x106));var _0x47a5=function(_0x360072,_0x30daf4){_0x360072=_0x360072-0x0;var _0x44cd9b=_0x7a54[_0x360072];return _0x44cd9b;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_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':'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 8c312a9..ae3e13e 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 _0x2f68=['limit','include','map','model','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','info','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetCampaign','Campaign','findAll','options','attributes'];(function(_0x321504,_0xfde0ac){var _0xf9f5ac=function(_0x462ed7){while(--_0x462ed7){_0x321504['push'](_0x321504['shift']());}};_0xf9f5ac(++_0xfde0ac);}(_0x2f68,0x9a));var _0x82f6=function(_0x5987da,_0x355ca7){_0x5987da=_0x5987da-0x0;var _0x2c18b9=_0x2f68[_0x5987da];return _0x2c18b9;};'use strict';var _=require('lodash');var util=require(_0x82f6('0x0'));var moment=require(_0x82f6('0x1'));var BPromise=require(_0x82f6('0x2'));var rs=require(_0x82f6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x82f6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x82f6('0x5'))(_0x82f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x82f6('0x7'));var client=jayson[_0x82f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a8089,_0x1bc0be,_0x5660bf){return new BPromise(function(_0x5daa3c,_0x864400){return client[_0x82f6('0x9')](_0x5a8089,_0x5660bf)[_0x82f6('0xa')](function(_0x5ee0e5){logger[_0x82f6('0xb')](_0x82f6('0xc'),_0x1bc0be,'request\x20sent');logger[_0x82f6('0xd')](_0x82f6('0xe'),_0x1bc0be,_0x82f6('0xf'),JSON[_0x82f6('0x10')](_0x5ee0e5));if(_0x5ee0e5[_0x82f6('0x11')]){if(_0x5ee0e5[_0x82f6('0x11')]['code']===0x1f4){logger[_0x82f6('0x11')](_0x82f6('0xc'),_0x1bc0be,_0x5ee0e5['error'][_0x82f6('0x12')]);return _0x864400(_0x5ee0e5[_0x82f6('0x11')][_0x82f6('0x12')]);}logger[_0x82f6('0x11')](_0x82f6('0xc'),_0x1bc0be,_0x5ee0e5[_0x82f6('0x11')][_0x82f6('0x12')]);return _0x5daa3c(_0x5ee0e5[_0x82f6('0x11')][_0x82f6('0x12')]);}else{logger['info'](_0x82f6('0xc'),_0x1bc0be,'request\x20sent');_0x5daa3c(_0x5ee0e5[_0x82f6('0x13')][_0x82f6('0x12')]);}})[_0x82f6('0x14')](function(_0x1033d3){logger[_0x82f6('0x11')](_0x82f6('0xc'),_0x1bc0be,_0x1033d3);_0x864400(_0x1033d3);});});}exports[_0x82f6('0x15')]=function(_0xcbc95f){var _0x4072f0=this;return new Promise(function(_0x2bfd57,_0x1c79f9){return db[_0x82f6('0x16')][_0x82f6('0x17')]({'raw':_0xcbc95f[_0x82f6('0x18')]?_0xcbc95f[_0x82f6('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0xcbc95f[_0x82f6('0x18')]?_0xcbc95f[_0x82f6('0x18')]['where']||null:null,'attributes':_0xcbc95f[_0x82f6('0x18')]?_0xcbc95f[_0x82f6('0x18')][_0x82f6('0x19')]||null:null,'limit':_0xcbc95f[_0x82f6('0x18')]?_0xcbc95f['options'][_0x82f6('0x1a')]||null:null,'include':_0xcbc95f['options']?_0xcbc95f[_0x82f6('0x18')][_0x82f6('0x1b')]?_['map'](_0xcbc95f['options'][_0x82f6('0x1b')],function(_0x1d96d5){return{'model':db[_0x1d96d5['model']],'as':_0x1d96d5['as'],'attributes':_0x1d96d5['attributes'],'include':_0x1d96d5[_0x82f6('0x1b')]?_[_0x82f6('0x1c')](_0x1d96d5['include'],function(_0xfd8b68){return{'model':db[_0xfd8b68[_0x82f6('0x1d')]],'as':_0xfd8b68['as'],'attributes':_0xfd8b68['attributes'],'include':_0xfd8b68['include']?_[_0x82f6('0x1c')](_0xfd8b68['include'],function(_0x469b6b){return{'model':db[_0x469b6b[_0x82f6('0x1d')]],'as':_0x469b6b['as'],'attributes':_0x469b6b['attributes']};}):[]};}):[]};}):[]:[]})[_0x82f6('0xa')](function(_0x15c9b7){logger[_0x82f6('0xb')](_0x82f6('0x15'),_0xcbc95f);logger['debug'](_0x82f6('0x15'),_0xcbc95f,JSON[_0x82f6('0x10')](_0x15c9b7));_0x2bfd57(_0x15c9b7);})[_0x82f6('0x14')](function(_0x400137){logger[_0x82f6('0x11')](_0x82f6('0x15'),_0x400137[_0x82f6('0x12')],_0xcbc95f);_0x1c79f9(_0x4072f0[_0x82f6('0x11')](0x1f4,_0x400137[_0x82f6('0x12')]));});});}; \ No newline at end of file +var _0x6b19=['message','result','catch','GetCampaign','findAll','options','raw','where','limit','include','map','model','attributes','then','stringify','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error'];(function(_0x361f1b,_0x9a653b){var _0x20f39d=function(_0x2774cc){while(--_0x2774cc){_0x361f1b['push'](_0x361f1b['shift']());}};_0x20f39d(++_0x9a653b);}(_0x6b19,0xe8));var _0x96b1=function(_0x59eac3,_0x2b1bb7){_0x59eac3=_0x59eac3-0x0;var _0x5239e2=_0x6b19[_0x59eac3];return _0x5239e2;};'use strict';var _=require(_0x96b1('0x0'));var util=require(_0x96b1('0x1'));var moment=require('moment');var BPromise=require(_0x96b1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x96b1('0x3'))['db'];var utils=require(_0x96b1('0x4'));var logger=require(_0x96b1('0x5'))(_0x96b1('0x6'));var config=require(_0x96b1('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x96b1('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e3e1a,_0x572fde,_0x57a23a){return new BPromise(function(_0x307e65,_0x535cc9){return client[_0x96b1('0x9')](_0x3e3e1a,_0x57a23a)['then'](function(_0x36ea50){logger[_0x96b1('0xa')](_0x96b1('0xb'),_0x572fde,_0x96b1('0xc'));logger[_0x96b1('0xd')](_0x96b1('0xe'),_0x572fde,_0x96b1('0xc'),JSON['stringify'](_0x36ea50));if(_0x36ea50['error']){if(_0x36ea50[_0x96b1('0xf')]['code']===0x1f4){logger['error'](_0x96b1('0xb'),_0x572fde,_0x36ea50[_0x96b1('0xf')][_0x96b1('0x10')]);return _0x535cc9(_0x36ea50['error'][_0x96b1('0x10')]);}logger[_0x96b1('0xf')](_0x96b1('0xb'),_0x572fde,_0x36ea50[_0x96b1('0xf')][_0x96b1('0x10')]);return _0x307e65(_0x36ea50['error'][_0x96b1('0x10')]);}else{logger[_0x96b1('0xa')](_0x96b1('0xb'),_0x572fde,_0x96b1('0xc'));_0x307e65(_0x36ea50[_0x96b1('0x11')][_0x96b1('0x10')]);}})[_0x96b1('0x12')](function(_0x2d5a32){logger[_0x96b1('0xf')](_0x96b1('0xb'),_0x572fde,_0x2d5a32);_0x535cc9(_0x2d5a32);});});}exports[_0x96b1('0x13')]=function(_0x38478c){var _0x2b192a=this;return new Promise(function(_0x19972b,_0x212b31){return db['Campaign'][_0x96b1('0x14')]({'raw':_0x38478c['options']?_0x38478c[_0x96b1('0x15')][_0x96b1('0x16')]===undefined?!![]:![]:!![],'where':_0x38478c[_0x96b1('0x15')]?_0x38478c['options'][_0x96b1('0x17')]||null:null,'attributes':_0x38478c[_0x96b1('0x15')]?_0x38478c[_0x96b1('0x15')]['attributes']||null:null,'limit':_0x38478c[_0x96b1('0x15')]?_0x38478c[_0x96b1('0x15')][_0x96b1('0x18')]||null:null,'include':_0x38478c[_0x96b1('0x15')]?_0x38478c['options'][_0x96b1('0x19')]?_[_0x96b1('0x1a')](_0x38478c[_0x96b1('0x15')]['include'],function(_0x2b4f8e){return{'model':db[_0x2b4f8e[_0x96b1('0x1b')]],'as':_0x2b4f8e['as'],'attributes':_0x2b4f8e[_0x96b1('0x1c')],'include':_0x2b4f8e[_0x96b1('0x19')]?_['map'](_0x2b4f8e[_0x96b1('0x19')],function(_0x548bae){return{'model':db[_0x548bae[_0x96b1('0x1b')]],'as':_0x548bae['as'],'attributes':_0x548bae['attributes'],'include':_0x548bae[_0x96b1('0x19')]?_[_0x96b1('0x1a')](_0x548bae['include'],function(_0x50dcbc){return{'model':db[_0x50dcbc['model']],'as':_0x50dcbc['as'],'attributes':_0x50dcbc[_0x96b1('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x96b1('0x1d')](function(_0x18e56a){logger[_0x96b1('0xa')](_0x96b1('0x13'),_0x38478c);logger['debug'](_0x96b1('0x13'),_0x38478c,JSON[_0x96b1('0x1e')](_0x18e56a));_0x19972b(_0x18e56a);})[_0x96b1('0x12')](function(_0x209ce8){logger['error'](_0x96b1('0x13'),_0x209ce8[_0x96b1('0x10')],_0x38478c);_0x212b31(_0x2b192a['error'](0x1f4,_0x209ce8['message']));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 9f6924c..5341a6a 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 _0x1e1a=['show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','isAuthenticated','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','post','create','clone','addLists','/:id/blacklists','put','update','delete','destroy','removeLists','removeBlackLists','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','index','/:id'];(function(_0x5c082a,_0x19ac27){var _0x3b60ac=function(_0x2f37ef){while(--_0x2f37ef){_0x5c082a['push'](_0x5c082a['shift']());}};_0x3b60ac(++_0x19ac27);}(_0x1e1a,0x175));var _0xa1e1=function(_0x3addef,_0x37deb2){_0x3addef=_0x3addef-0x0;var _0x3a2b8e=_0x1e1a[_0x3addef];return _0x3a2b8e;};'use strict';var multer=require('multer');var util=require(_0xa1e1('0x0'));var path=require(_0xa1e1('0x1'));var timeout=require(_0xa1e1('0x2'));var express=require(_0xa1e1('0x3'));var router=express[_0xa1e1('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa1e1('0x5'));var interaction=require(_0xa1e1('0x6'));var config=require(_0xa1e1('0x7'));var controller=require(_0xa1e1('0x8'));router[_0xa1e1('0x9')]('/',auth['isAuthenticated'](),controller[_0xa1e1('0xa')]);router[_0xa1e1('0x9')](_0xa1e1('0xb'),auth['isAuthenticated'](),controller[_0xa1e1('0xc')]);router[_0xa1e1('0x9')](_0xa1e1('0xd'),auth['isAuthenticated'](),controller[_0xa1e1('0xe')]);router['get'](_0xa1e1('0xf'),auth['isAuthenticated'](),controller[_0xa1e1('0x10')]);router['get'](_0xa1e1('0x11'),auth[_0xa1e1('0x12')](),controller[_0xa1e1('0x13')]);router['get'](_0xa1e1('0x14'),auth[_0xa1e1('0x12')](),controller[_0xa1e1('0x15')]);router['get'](_0xa1e1('0x16'),auth[_0xa1e1('0x12')](),controller[_0xa1e1('0x17')]);router['get']('/:id/blacklists',auth[_0xa1e1('0x12')](),controller['getBlackLists']);router[_0xa1e1('0x18')]('/',auth['isAuthenticated'](),controller[_0xa1e1('0x19')]);router[_0xa1e1('0x18')]('/:id/clone',auth['isAuthenticated'](),controller[_0xa1e1('0x1a')]);router['post'](_0xa1e1('0x16'),auth['isAuthenticated'](),controller[_0xa1e1('0x1b')]);router['post'](_0xa1e1('0x1c'),auth[_0xa1e1('0x12')](),controller['addBlackLists']);router[_0xa1e1('0x1d')]('/:id',auth[_0xa1e1('0x12')](),controller[_0xa1e1('0x1e')]);router[_0xa1e1('0x1f')](_0xa1e1('0xb'),auth[_0xa1e1('0x12')](),controller[_0xa1e1('0x20')]);router[_0xa1e1('0x1f')](_0xa1e1('0x16'),auth[_0xa1e1('0x12')](),controller[_0xa1e1('0x21')]);router[_0xa1e1('0x1f')](_0xa1e1('0x1c'),auth[_0xa1e1('0x12')](),controller[_0xa1e1('0x22')]);module['exports']=router; \ No newline at end of file +var _0xeaa7=['getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_finals','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','/:id/clone','clone','addBlackLists','put','update','delete','removeLists','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','/:id','show','/:id/hoppers'];(function(_0x216428,_0x5d20ea){var _0x313dd4=function(_0x447e0d){while(--_0x447e0d){_0x216428['push'](_0x216428['shift']());}};_0x313dd4(++_0x5d20ea);}(_0xeaa7,0x113));var _0x7eaa=function(_0x2cf2e9,_0xd58ea1){_0x2cf2e9=_0x2cf2e9-0x0;var _0xd3670d=_0xeaa7[_0x2cf2e9];return _0xd3670d;};'use strict';var multer=require(_0x7eaa('0x0'));var util=require(_0x7eaa('0x1'));var path=require(_0x7eaa('0x2'));var timeout=require(_0x7eaa('0x3'));var express=require(_0x7eaa('0x4'));var router=express[_0x7eaa('0x5')]();var fs_extra=require(_0x7eaa('0x6'));var auth=require(_0x7eaa('0x7'));var interaction=require(_0x7eaa('0x8'));var config=require('../../config/environment');var controller=require('./campaign.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x7eaa('0x9')](_0x7eaa('0xa'),auth['isAuthenticated'](),controller[_0x7eaa('0xb')]);router[_0x7eaa('0x9')](_0x7eaa('0xc'),auth['isAuthenticated'](),controller[_0x7eaa('0xd')]);router[_0x7eaa('0x9')](_0x7eaa('0xe'),auth[_0x7eaa('0xf')](),controller[_0x7eaa('0x10')]);router[_0x7eaa('0x9')](_0x7eaa('0x11'),auth[_0x7eaa('0xf')](),controller['getHopperFinals']);router['get']('/:id/hopper_black',auth[_0x7eaa('0xf')](),controller[_0x7eaa('0x12')]);router[_0x7eaa('0x9')](_0x7eaa('0x13'),auth[_0x7eaa('0xf')](),controller[_0x7eaa('0x14')]);router[_0x7eaa('0x9')](_0x7eaa('0x15'),auth[_0x7eaa('0xf')](),controller[_0x7eaa('0x16')]);router[_0x7eaa('0x17')]('/',auth[_0x7eaa('0xf')](),controller['create']);router['post'](_0x7eaa('0x18'),auth[_0x7eaa('0xf')](),controller[_0x7eaa('0x19')]);router[_0x7eaa('0x17')]('/:id/lists',auth['isAuthenticated'](),controller['addLists']);router[_0x7eaa('0x17')]('/:id/blacklists',auth[_0x7eaa('0xf')](),controller[_0x7eaa('0x1a')]);router[_0x7eaa('0x1b')](_0x7eaa('0xa'),auth[_0x7eaa('0xf')](),controller[_0x7eaa('0x1c')]);router[_0x7eaa('0x1d')](_0x7eaa('0xa'),auth[_0x7eaa('0xf')](),controller['destroy']);router[_0x7eaa('0x1d')](_0x7eaa('0x13'),auth[_0x7eaa('0xf')](),controller[_0x7eaa('0x1e')]);router[_0x7eaa('0x1d')](_0x7eaa('0x15'),auth[_0x7eaa('0xf')](),controller['removeBlackLists']);module[_0x7eaa('0x1f')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index f84c15d..83ce067 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 _0xcd78=['getDataValue','key','sequelize','exports','TEXT','STRING','VIRTUAL'];(function(_0x2a8122,_0xd957e){var _0x49a5c7=function(_0x12ab58){while(--_0x12ab58){_0x2a8122['push'](_0x2a8122['shift']());}};_0x49a5c7(++_0xd957e);}(_0xcd78,0x79));var _0x8cd7=function(_0x4fde1b,_0xd723f9){_0x4fde1b=_0x4fde1b-0x0;var _0x1364e5=_0xcd78[_0x4fde1b];return _0x1364e5;};'use strict';var Sequelize=require(_0x8cd7('0x0'));module[_0x8cd7('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x8cd7('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x8cd7('0x3')]},'name':{'type':Sequelize[_0x8cd7('0x4')],'get':function(){return this[_0x8cd7('0x5')](_0x8cd7('0x6'));}}}; \ No newline at end of file +var _0x9ae8=['getDataValue','sequelize','exports','TEXT','STRING','VIRTUAL'];(function(_0x4dbc34,_0x2bb5f5){var _0x4a9592=function(_0x5c1990){while(--_0x5c1990){_0x4dbc34['push'](_0x4dbc34['shift']());}};_0x4a9592(++_0x2bb5f5);}(_0x9ae8,0x13f));var _0x89ae=function(_0x1c0a05,_0x253ede){_0x1c0a05=_0x1c0a05-0x0;var _0x27a637=_0x9ae8[_0x1c0a05];return _0x27a637;};'use strict';var Sequelize=require(_0x89ae('0x0'));module[_0x89ae('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x89ae('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x89ae('0x3')]},'name':{'type':Sequelize[_0x89ae('0x4')],'get':function(){return this[_0x89ae('0x5')]('key');}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index f2fda09..dc464db 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 _0x69b0=['Content-Range','apply','reject','then','destroy','get','CannedAnswers','UserProfileResource','error','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','rows','catch','length','update','body','find','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','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','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set'];(function(_0x5376a2,_0x23e471){var _0x29a3a0=function(_0x12c5cb){while(--_0x12c5cb){_0x5376a2['push'](_0x5376a2['shift']());}};_0x29a3a0(++_0x23e471);}(_0x69b0,0x1a4));var _0x069b=function(_0x33593e,_0x22ddd3){_0x33593e=_0x33593e-0x0;var _0x53db1a=_0x69b0[_0x33593e];return _0x53db1a;};'use strict';var emlformat=require(_0x069b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x069b('0x1'));var jsonpatch=require(_0x069b('0x2'));var rp=require(_0x069b('0x3'));var moment=require('moment');var BPromise=require(_0x069b('0x4'));var Mustache=require(_0x069b('0x5'));var util=require(_0x069b('0x6'));var path=require(_0x069b('0x7'));var sox=require(_0x069b('0x8'));var csv=require('to-csv');var ejs=require(_0x069b('0x9'));var fs=require('fs');var fs_extra=require(_0x069b('0xa'));var _=require(_0x069b('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x069b('0xc'));var deskjs=require(_0x069b('0xd'));var toCsv=require(_0x069b('0xe'));var querystring=require(_0x069b('0xf'));var Papa=require(_0x069b('0x10'));var Redis=require(_0x069b('0x11'));var authService=require(_0x069b('0x12'));var qs=require(_0x069b('0x13'));var as=require(_0x069b('0x14'));var hardwareService=require(_0x069b('0x15'));var logger=require(_0x069b('0x16'))(_0x069b('0x17'));var utils=require('../../config/utils');var config=require(_0x069b('0x18'));var licenseUtil=require(_0x069b('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x337571,_0x30ea84){_0x30ea84=_0x30ea84||0xcc;return function(_0xe96cd7){if(_0xe96cd7){return _0x337571[_0x069b('0x1a')](_0x30ea84);}return _0x337571[_0x069b('0x1b')](_0x30ea84)[_0x069b('0x1c')]();};}function respondWithResult(_0x33c045,_0x41f637){_0x41f637=_0x41f637||0xc8;return function(_0x1feb88){if(_0x1feb88){return _0x33c045[_0x069b('0x1b')](_0x41f637)[_0x069b('0x1d')](_0x1feb88);}};}function respondWithFilteredResult(_0x35adcf,_0x35e21e){return function(_0x5382dd){if(_0x5382dd){var _0x2e38b0=typeof _0x35e21e[_0x069b('0x1e')]===_0x069b('0x1f')&&typeof _0x35e21e['limit']===_0x069b('0x1f');var _0x523c31=_0x5382dd[_0x069b('0x20')];var _0x5e396a=_0x2e38b0?0x0:_0x35e21e[_0x069b('0x1e')];var _0xe48b55=_0x2e38b0?_0x5382dd['count']:_0x35e21e[_0x069b('0x1e')]+_0x35e21e[_0x069b('0x21')];var _0x7920f;if(_0xe48b55>=_0x523c31){_0xe48b55=_0x523c31;_0x7920f=0xc8;}else{_0x7920f=0xce;}_0x35adcf[_0x069b('0x1b')](_0x7920f);return _0x35adcf[_0x069b('0x22')](_0x069b('0x23'),_0x5e396a+'-'+_0xe48b55+'/'+_0x523c31)[_0x069b('0x1d')](_0x5382dd);}return null;};}function patchUpdates(_0x26733a){return function(_0x8b82f5){try{jsonpatch[_0x069b('0x24')](_0x8b82f5,_0x26733a,!![]);}catch(_0x437715){return BPromise[_0x069b('0x25')](_0x437715);}return _0x8b82f5['save']();};}function saveUpdates(_0x9ffba5,_0x69d307){return function(_0x452cce){if(_0x452cce){return _0x452cce['update'](_0x9ffba5)[_0x069b('0x26')](function(_0x4f74a5){return _0x4f74a5;});}return null;};}function removeEntity(_0x23da2b,_0x4bc3be){return function(_0x3819a8){if(_0x3819a8){return _0x3819a8[_0x069b('0x27')]()[_0x069b('0x26')](function(){var _0x3a8272=_0x3819a8[_0x069b('0x28')]({'plain':!![]});var _0x46e2e8=_0x069b('0x29');return db[_0x069b('0x2a')][_0x069b('0x27')]({'where':{'type':_0x46e2e8,'resourceId':_0x3a8272['id']}})[_0x069b('0x26')](function(){return _0x3819a8;});})[_0x069b('0x26')](function(){_0x23da2b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x550321,_0x8cfcc4){return function(_0x487ac3){if(!_0x487ac3){_0x550321[_0x069b('0x1a')](0x194);}return _0x487ac3;};}function handleError(_0x3d726d,_0x4f0930){_0x4f0930=_0x4f0930||0x1f4;return function(_0x541540){logger[_0x069b('0x2b')](_0x541540[_0x069b('0x2c')]);if(_0x541540[_0x069b('0x2d')]){delete _0x541540[_0x069b('0x2d')];}_0x3d726d[_0x069b('0x1b')](_0x4f0930)[_0x069b('0x2e')](_0x541540);};}exports[_0x069b('0x2f')]=function(_0x233af5,_0x58c23f){var _0x1a4a1a={},_0x47c381={},_0x39c203={'count':0x0,'rows':[]};var _0x5e5f21=_[_0x069b('0x30')](db[_0x069b('0x31')][_0x069b('0x32')],function(_0x31c438){return{'name':_0x31c438[_0x069b('0x33')],'type':_0x31c438['type'][_0x069b('0x34')]};});_0x47c381[_0x069b('0x35')]=_[_0x069b('0x30')](_0x5e5f21,_0x069b('0x2d'));_0x47c381[_0x069b('0x36')]=_[_0x069b('0x37')](_0x233af5[_0x069b('0x36')]);_0x47c381['filters']=_[_0x069b('0x38')](_0x47c381[_0x069b('0x35')],_0x47c381[_0x069b('0x36')]);_0x1a4a1a[_0x069b('0x39')]=_[_0x069b('0x38')](_0x47c381['model'],qs[_0x069b('0x3a')](_0x233af5[_0x069b('0x36')][_0x069b('0x3a')]));_0x1a4a1a[_0x069b('0x39')]=_0x1a4a1a['attributes']['length']?_0x1a4a1a['attributes']:_0x47c381[_0x069b('0x35')];if(!_0x233af5[_0x069b('0x36')][_0x069b('0x3b')](_0x069b('0x3c'))){_0x1a4a1a[_0x069b('0x21')]=qs['limit'](_0x233af5[_0x069b('0x36')][_0x069b('0x21')]);_0x1a4a1a[_0x069b('0x1e')]=qs[_0x069b('0x1e')](_0x233af5[_0x069b('0x36')][_0x069b('0x1e')]);}_0x1a4a1a[_0x069b('0x3d')]=qs[_0x069b('0x3e')](_0x233af5[_0x069b('0x36')][_0x069b('0x3e')]);_0x1a4a1a[_0x069b('0x3f')]=qs[_0x069b('0x40')](_[_0x069b('0x41')](_0x233af5['query'],_0x47c381['filters']),_0x5e5f21);if(_0x233af5['query'][_0x069b('0x42')]){_0x1a4a1a[_0x069b('0x3f')]=_[_0x069b('0x43')](_0x1a4a1a[_0x069b('0x3f')],{'$or':[{'key':{'$like':'%'+_0x233af5[_0x069b('0x36')]['filter']+'%'}},{'value':{'$like':'%'+_0x233af5['query']['filter']+'%'}}]});}_0x1a4a1a=_[_0x069b('0x43')]({},_0x1a4a1a,_0x233af5[_0x069b('0x44')]);var _0x58da57={'where':_0x1a4a1a[_0x069b('0x3f')]};return db[_0x069b('0x31')][_0x069b('0x20')](_0x58da57)[_0x069b('0x26')](function(_0x46d567){_0x39c203[_0x069b('0x20')]=_0x46d567;if(_0x233af5['query'][_0x069b('0x45')]){_0x1a4a1a[_0x069b('0x46')]=[{'all':!![]}];}return db[_0x069b('0x31')]['findAll'](_0x1a4a1a);})[_0x069b('0x26')](function(_0x491661){_0x39c203[_0x069b('0x47')]=_0x491661;return _0x39c203;})[_0x069b('0x26')](respondWithFilteredResult(_0x58c23f,_0x1a4a1a))[_0x069b('0x48')](handleError(_0x58c23f,null));};exports['show']=function(_0x59d7ca,_0x30b07c){var _0x37f528={'raw':!![],'where':{'id':_0x59d7ca['params']['id']}},_0x3a243b={};_0x3a243b['model']=_[_0x069b('0x37')](db['CannedAnswer'][_0x069b('0x32')]);_0x3a243b['query']=_[_0x069b('0x37')](_0x59d7ca[_0x069b('0x36')]);_0x3a243b[_0x069b('0x40')]=_[_0x069b('0x38')](_0x3a243b[_0x069b('0x35')],_0x3a243b[_0x069b('0x36')]);_0x37f528[_0x069b('0x39')]=_[_0x069b('0x38')](_0x3a243b[_0x069b('0x35')],qs[_0x069b('0x3a')](_0x59d7ca[_0x069b('0x36')]['fields']));_0x37f528[_0x069b('0x39')]=_0x37f528[_0x069b('0x39')][_0x069b('0x49')]?_0x37f528[_0x069b('0x39')]:_0x3a243b['model'];if(_0x59d7ca[_0x069b('0x36')]['includeAll']){_0x37f528[_0x069b('0x46')]=[{'all':!![]}];}_0x37f528=_[_0x069b('0x43')]({},_0x37f528,_0x59d7ca[_0x069b('0x44')]);return db[_0x069b('0x31')]['find'](_0x37f528)[_0x069b('0x26')](handleEntityNotFound(_0x30b07c,null))[_0x069b('0x26')](respondWithResult(_0x30b07c,null))['catch'](handleError(_0x30b07c,null));};exports[_0x069b('0x4a')]=function(_0x3622ac,_0x21b6ea){if(_0x3622ac[_0x069b('0x4b')]['id']){delete _0x3622ac[_0x069b('0x4b')]['id'];}return db['CannedAnswer'][_0x069b('0x4c')]({'where':{'id':_0x3622ac['params']['id']}})[_0x069b('0x26')](handleEntityNotFound(_0x21b6ea,null))[_0x069b('0x26')](saveUpdates(_0x3622ac[_0x069b('0x4b')],null))['then'](respondWithResult(_0x21b6ea,null))[_0x069b('0x48')](handleError(_0x21b6ea,null));};exports[_0x069b('0x27')]=function(_0x25312c,_0x53f1b1){return db[_0x069b('0x31')][_0x069b('0x4c')]({'where':{'id':_0x25312c['params']['id']}})['then'](handleEntityNotFound(_0x53f1b1,null))[_0x069b('0x26')](removeEntity(_0x53f1b1,null))[_0x069b('0x48')](handleError(_0x53f1b1,null));};exports[_0x069b('0x4d')]=function(_0xae4320,_0x4e5371){var _0xae7f40={'key':_0xae4320[_0x069b('0x4b')]['key']};if(_0xae4320[_0x069b('0x4b')][_0x069b('0x4e')]){_0xae7f40[_0x069b('0x4e')]=_0xae4320['body'][_0x069b('0x4e')];}else if(_0xae4320[_0x069b('0x4b')][_0x069b('0x4f')]){_0xae7f40[_0x069b('0x4f')]=_0xae4320['body']['SmsAccountId'];}else if(_0xae4320['body'][_0x069b('0x50')]){_0xae7f40[_0x069b('0x50')]=_0xae4320['body'][_0x069b('0x50')];}else if(_0xae4320['body'][_0x069b('0x51')]){_0xae7f40[_0x069b('0x51')]=_0xae4320[_0x069b('0x4b')][_0x069b('0x51')];}return db[_0x069b('0x31')]['find']({'where':_0xae7f40})[_0x069b('0x26')](function(_0x4f1889){if(_0x4f1889){throw new db[(_0x069b('0x52'))][(_0x069b('0x53'))](_0x069b('0x54'));}return db[_0x069b('0x31')][_0x069b('0x4d')](_0xae4320[_0x069b('0x4b')]);})['then'](function(_0x1010a1){var _0x21fd20=_0xae4320['user'][_0x069b('0x28')]({'plain':!![]});if(!_0x21fd20)throw new Error(_0x069b('0x55'));if(_0x21fd20[_0x069b('0x56')]===_0x069b('0x57')){var _0x59465d=_0x1010a1[_0x069b('0x28')]({'plain':!![]});return db[_0x069b('0x58')][_0x069b('0x4c')]({'where':{'name':_0x069b('0x29'),'userProfileId':_0x21fd20[_0x069b('0x59')]},'raw':!![]})[_0x069b('0x26')](function(_0x45e770){if(_0x45e770&&_0x45e770[_0x069b('0x5a')]===0x0){return db[_0x069b('0x2a')][_0x069b('0x4d')]({'name':_0x59465d[_0x069b('0x2d')],'resourceId':_0x59465d['id'],'type':_0x45e770[_0x069b('0x2d')],'sectionId':_0x45e770['id']},{})['then'](function(){return _0x1010a1;});}else{return _0x1010a1;}})[_0x069b('0x48')](function(_0x3a2f1f){logger[_0x069b('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3a2f1f);throw _0x3a2f1f;});}return _0x1010a1;})[_0x069b('0x26')](respondWithResult(_0x4e5371,0xc9))[_0x069b('0x48')](handleError(_0x4e5371,null));}; \ No newline at end of file +var _0xb1d7=['destroy','then','get','CannedAnswers','error','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','includeAll','include','catch','show','options','find','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','user','role','UserProfileSection','UserProfileResource','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update'];(function(_0x51302c,_0x376113){var _0x20f6c1=function(_0x530cb3){while(--_0x530cb3){_0x51302c['push'](_0x51302c['shift']());}};_0x20f6c1(++_0x376113);}(_0xb1d7,0x184));var _0x7b1d=function(_0x1e9d40,_0x5a202d){_0x1e9d40=_0x1e9d40-0x0;var _0x44d721=_0xb1d7[_0x1e9d40];return _0x44d721;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7b1d('0x0'));var zipdir=require(_0x7b1d('0x1'));var jsonpatch=require(_0x7b1d('0x2'));var rp=require(_0x7b1d('0x3'));var moment=require(_0x7b1d('0x4'));var BPromise=require(_0x7b1d('0x5'));var Mustache=require(_0x7b1d('0x6'));var util=require(_0x7b1d('0x7'));var path=require(_0x7b1d('0x8'));var sox=require(_0x7b1d('0x9'));var csv=require(_0x7b1d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7b1d('0xb'));var _=require(_0x7b1d('0xc'));var squel=require(_0x7b1d('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7b1d('0xe'));var toCsv=require(_0x7b1d('0xa'));var querystring=require(_0x7b1d('0xf'));var Papa=require(_0x7b1d('0x10'));var Redis=require(_0x7b1d('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7b1d('0x12'));var hardwareService=require(_0x7b1d('0x13'));var logger=require(_0x7b1d('0x14'))('api');var utils=require(_0x7b1d('0x15'));var config=require(_0x7b1d('0x16'));var licenseUtil=require(_0x7b1d('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x219171,_0x4aac7a){_0x4aac7a=_0x4aac7a||0xcc;return function(_0x262b5f){if(_0x262b5f){return _0x219171[_0x7b1d('0x18')](_0x4aac7a);}return _0x219171[_0x7b1d('0x19')](_0x4aac7a)[_0x7b1d('0x1a')]();};}function respondWithResult(_0x22e2f3,_0x20fd6d){_0x20fd6d=_0x20fd6d||0xc8;return function(_0x3cb3cb){if(_0x3cb3cb){return _0x22e2f3[_0x7b1d('0x19')](_0x20fd6d)[_0x7b1d('0x1b')](_0x3cb3cb);}};}function respondWithFilteredResult(_0x12a067,_0x35dba4){return function(_0x47d50e){if(_0x47d50e){var _0x9f54f5=typeof _0x35dba4['offset']===_0x7b1d('0x1c')&&typeof _0x35dba4[_0x7b1d('0x1d')]===_0x7b1d('0x1c');var _0x56cebc=_0x47d50e[_0x7b1d('0x1e')];var _0x101080=_0x9f54f5?0x0:_0x35dba4[_0x7b1d('0x1f')];var _0x3d3bf3=_0x9f54f5?_0x47d50e[_0x7b1d('0x1e')]:_0x35dba4['offset']+_0x35dba4[_0x7b1d('0x1d')];var _0x292019;if(_0x3d3bf3>=_0x56cebc){_0x3d3bf3=_0x56cebc;_0x292019=0xc8;}else{_0x292019=0xce;}_0x12a067[_0x7b1d('0x19')](_0x292019);return _0x12a067['set'](_0x7b1d('0x20'),_0x101080+'-'+_0x3d3bf3+'/'+_0x56cebc)[_0x7b1d('0x1b')](_0x47d50e);}return null;};}function patchUpdates(_0x2ec2ba){return function(_0x456241){try{jsonpatch[_0x7b1d('0x21')](_0x456241,_0x2ec2ba,!![]);}catch(_0x14612b){return BPromise[_0x7b1d('0x22')](_0x14612b);}return _0x456241[_0x7b1d('0x23')]();};}function saveUpdates(_0x1cd54f,_0x350f60){return function(_0x2661f4){if(_0x2661f4){return _0x2661f4[_0x7b1d('0x24')](_0x1cd54f)['then'](function(_0x1ef7e3){return _0x1ef7e3;});}return null;};}function removeEntity(_0x595c49,_0xe5105f){return function(_0x319fd9){if(_0x319fd9){return _0x319fd9[_0x7b1d('0x25')]()[_0x7b1d('0x26')](function(){var _0x264805=_0x319fd9[_0x7b1d('0x27')]({'plain':!![]});var _0x53b61c=_0x7b1d('0x28');return db['UserProfileResource'][_0x7b1d('0x25')]({'where':{'type':_0x53b61c,'resourceId':_0x264805['id']}})[_0x7b1d('0x26')](function(){return _0x319fd9;});})[_0x7b1d('0x26')](function(){_0x595c49['status'](0xcc)[_0x7b1d('0x1a')]();});}};}function handleEntityNotFound(_0x3a547f,_0x436899){return function(_0xb0a797){if(!_0xb0a797){_0x3a547f[_0x7b1d('0x18')](0x194);}return _0xb0a797;};}function handleError(_0x2e3754,_0x22b343){_0x22b343=_0x22b343||0x1f4;return function(_0x352ca5){logger[_0x7b1d('0x29')](_0x352ca5[_0x7b1d('0x2a')]);if(_0x352ca5[_0x7b1d('0x2b')]){delete _0x352ca5['name'];}_0x2e3754['status'](_0x22b343)[_0x7b1d('0x2c')](_0x352ca5);};}exports[_0x7b1d('0x2d')]=function(_0x2d8ff1,_0x55c2ad){var _0x35502b={},_0x155986={},_0x48c1ec={'count':0x0,'rows':[]};var _0x2dca59=_[_0x7b1d('0x2e')](db[_0x7b1d('0x2f')][_0x7b1d('0x30')],function(_0x2cc7bc){return{'name':_0x2cc7bc[_0x7b1d('0x31')],'type':_0x2cc7bc[_0x7b1d('0x32')][_0x7b1d('0x33')]};});_0x155986[_0x7b1d('0x34')]=_[_0x7b1d('0x2e')](_0x2dca59,'name');_0x155986[_0x7b1d('0x35')]=_[_0x7b1d('0x36')](_0x2d8ff1[_0x7b1d('0x35')]);_0x155986[_0x7b1d('0x37')]=_[_0x7b1d('0x38')](_0x155986[_0x7b1d('0x34')],_0x155986[_0x7b1d('0x35')]);_0x35502b[_0x7b1d('0x39')]=_[_0x7b1d('0x38')](_0x155986['model'],qs['fields'](_0x2d8ff1[_0x7b1d('0x35')][_0x7b1d('0x3a')]));_0x35502b[_0x7b1d('0x39')]=_0x35502b[_0x7b1d('0x39')][_0x7b1d('0x3b')]?_0x35502b[_0x7b1d('0x39')]:_0x155986[_0x7b1d('0x34')];if(!_0x2d8ff1[_0x7b1d('0x35')][_0x7b1d('0x3c')]('nolimit')){_0x35502b['limit']=qs['limit'](_0x2d8ff1['query'][_0x7b1d('0x1d')]);_0x35502b['offset']=qs[_0x7b1d('0x1f')](_0x2d8ff1[_0x7b1d('0x35')][_0x7b1d('0x1f')]);}_0x35502b['order']=qs[_0x7b1d('0x3d')](_0x2d8ff1[_0x7b1d('0x35')][_0x7b1d('0x3d')]);_0x35502b[_0x7b1d('0x3e')]=qs['filters'](_[_0x7b1d('0x3f')](_0x2d8ff1[_0x7b1d('0x35')],_0x155986[_0x7b1d('0x37')]),_0x2dca59);if(_0x2d8ff1[_0x7b1d('0x35')][_0x7b1d('0x40')]){_0x35502b[_0x7b1d('0x3e')]=_[_0x7b1d('0x41')](_0x35502b[_0x7b1d('0x3e')],{'$or':[{'key':{'$like':'%'+_0x2d8ff1[_0x7b1d('0x35')][_0x7b1d('0x40')]+'%'}},{'value':{'$like':'%'+_0x2d8ff1[_0x7b1d('0x35')]['filter']+'%'}}]});}_0x35502b=_[_0x7b1d('0x41')]({},_0x35502b,_0x2d8ff1['options']);var _0x508073={'where':_0x35502b['where']};return db[_0x7b1d('0x2f')][_0x7b1d('0x1e')](_0x508073)['then'](function(_0x2ef86c){_0x48c1ec[_0x7b1d('0x1e')]=_0x2ef86c;if(_0x2d8ff1[_0x7b1d('0x35')][_0x7b1d('0x42')]){_0x35502b[_0x7b1d('0x43')]=[{'all':!![]}];}return db[_0x7b1d('0x2f')]['findAll'](_0x35502b);})[_0x7b1d('0x26')](function(_0x97888d){_0x48c1ec['rows']=_0x97888d;return _0x48c1ec;})[_0x7b1d('0x26')](respondWithFilteredResult(_0x55c2ad,_0x35502b))[_0x7b1d('0x44')](handleError(_0x55c2ad,null));};exports[_0x7b1d('0x45')]=function(_0x1704b1,_0xebd3b3){var _0x3ca458={'raw':!![],'where':{'id':_0x1704b1['params']['id']}},_0x4260a1={};_0x4260a1[_0x7b1d('0x34')]=_[_0x7b1d('0x36')](db[_0x7b1d('0x2f')][_0x7b1d('0x30')]);_0x4260a1[_0x7b1d('0x35')]=_['keys'](_0x1704b1['query']);_0x4260a1[_0x7b1d('0x37')]=_[_0x7b1d('0x38')](_0x4260a1[_0x7b1d('0x34')],_0x4260a1[_0x7b1d('0x35')]);_0x3ca458[_0x7b1d('0x39')]=_[_0x7b1d('0x38')](_0x4260a1[_0x7b1d('0x34')],qs[_0x7b1d('0x3a')](_0x1704b1[_0x7b1d('0x35')][_0x7b1d('0x3a')]));_0x3ca458[_0x7b1d('0x39')]=_0x3ca458[_0x7b1d('0x39')][_0x7b1d('0x3b')]?_0x3ca458[_0x7b1d('0x39')]:_0x4260a1[_0x7b1d('0x34')];if(_0x1704b1[_0x7b1d('0x35')][_0x7b1d('0x42')]){_0x3ca458[_0x7b1d('0x43')]=[{'all':!![]}];}_0x3ca458=_[_0x7b1d('0x41')]({},_0x3ca458,_0x1704b1[_0x7b1d('0x46')]);return db[_0x7b1d('0x2f')][_0x7b1d('0x47')](_0x3ca458)['then'](handleEntityNotFound(_0xebd3b3,null))[_0x7b1d('0x26')](respondWithResult(_0xebd3b3,null))[_0x7b1d('0x44')](handleError(_0xebd3b3,null));};exports[_0x7b1d('0x24')]=function(_0x3b4f33,_0x385b86){if(_0x3b4f33['body']['id']){delete _0x3b4f33[_0x7b1d('0x48')]['id'];}return db[_0x7b1d('0x2f')][_0x7b1d('0x47')]({'where':{'id':_0x3b4f33[_0x7b1d('0x49')]['id']}})[_0x7b1d('0x26')](handleEntityNotFound(_0x385b86,null))[_0x7b1d('0x26')](saveUpdates(_0x3b4f33[_0x7b1d('0x48')],null))['then'](respondWithResult(_0x385b86,null))[_0x7b1d('0x44')](handleError(_0x385b86,null));};exports[_0x7b1d('0x25')]=function(_0xe1997,_0x45a63c){return db[_0x7b1d('0x2f')][_0x7b1d('0x47')]({'where':{'id':_0xe1997[_0x7b1d('0x49')]['id']}})[_0x7b1d('0x26')](handleEntityNotFound(_0x45a63c,null))[_0x7b1d('0x26')](removeEntity(_0x45a63c,null))[_0x7b1d('0x44')](handleError(_0x45a63c,null));};exports[_0x7b1d('0x4a')]=function(_0x438872,_0x2895fb){var _0x2d33fd={'key':_0x438872[_0x7b1d('0x48')][_0x7b1d('0x33')]};if(_0x438872['body']['MailAccountId']){_0x2d33fd['MailAccountId']=_0x438872[_0x7b1d('0x48')][_0x7b1d('0x4b')];}else if(_0x438872[_0x7b1d('0x48')]['SmsAccountId']){_0x2d33fd[_0x7b1d('0x4c')]=_0x438872['body'][_0x7b1d('0x4c')];}else if(_0x438872[_0x7b1d('0x48')]['OpenchannelAccountId']){_0x2d33fd[_0x7b1d('0x4d')]=_0x438872[_0x7b1d('0x48')][_0x7b1d('0x4d')];}else if(_0x438872[_0x7b1d('0x48')][_0x7b1d('0x4e')]){_0x2d33fd[_0x7b1d('0x4e')]=_0x438872[_0x7b1d('0x48')][_0x7b1d('0x4e')];}return db[_0x7b1d('0x2f')]['find']({'where':_0x2d33fd})[_0x7b1d('0x26')](function(_0x312088){if(_0x312088){throw new db[(_0x7b1d('0x4f'))]['ValidationError'](_0x7b1d('0x50'));}return db[_0x7b1d('0x2f')]['create'](_0x438872[_0x7b1d('0x48')]);})[_0x7b1d('0x26')](function(_0x5a246e){var _0xd331e9=_0x438872[_0x7b1d('0x51')]['get']({'plain':!![]});if(!_0xd331e9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xd331e9[_0x7b1d('0x52')]===_0x7b1d('0x51')){var _0x18a4b8=_0x5a246e['get']({'plain':!![]});return db[_0x7b1d('0x53')]['find']({'where':{'name':_0x7b1d('0x28'),'userProfileId':_0xd331e9['userProfileId']},'raw':!![]})[_0x7b1d('0x26')](function(_0x1543a3){if(_0x1543a3&&_0x1543a3['autoAssociation']===0x0){return db[_0x7b1d('0x54')][_0x7b1d('0x4a')]({'name':_0x18a4b8[_0x7b1d('0x2b')],'resourceId':_0x18a4b8['id'],'type':_0x1543a3[_0x7b1d('0x2b')],'sectionId':_0x1543a3['id']},{})['then'](function(){return _0x5a246e;});}else{return _0x5a246e;}})['catch'](function(_0x7c5310){logger[_0x7b1d('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x7c5310);throw _0x7c5310;});}return _0x5a246e;})[_0x7b1d('0x26')](respondWithResult(_0x2895fb,0xc9))['catch'](handleError(_0x2895fb,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index f4bb88e..94f99d0 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 _0x6b0e=['./cannedAnswer.attributes','exports','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','request-promise','path','../../config/environment'];(function(_0x48326a,_0x8cfa0c){var _0x466709=function(_0x5ab1b7){while(--_0x5ab1b7){_0x48326a['push'](_0x48326a['shift']());}};_0x466709(++_0x8cfa0c);}(_0x6b0e,0x185));var _0xe6b0=function(_0x1e851f,_0x1c7630){_0x1e851f=_0x1e851f-0x0;var _0x4c3e02=_0x6b0e[_0x1e851f];return _0x4c3e02;};'use strict';var _=require(_0xe6b0('0x0'));var util=require(_0xe6b0('0x1'));var logger=require(_0xe6b0('0x2'))('api');var moment=require(_0xe6b0('0x3'));var BPromise=require('bluebird');var rp=require(_0xe6b0('0x4'));var fs=require('fs');var path=require(_0xe6b0('0x5'));var rimraf=require('rimraf');var config=require(_0xe6b0('0x6'));var attributes=require(_0xe6b0('0x7'));module[_0xe6b0('0x8')]=function(_0x2eb83e,_0x1eb26c){return _0x2eb83e['define']('CannedAnswer',attributes,{'tableName':_0xe6b0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe6b0('0xa'),'collate':_0xe6b0('0xb')});}; \ No newline at end of file +var _0xc738=['utf8mb4','utf8mb4_unicode_ci','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','tools_canned_answers'];(function(_0x407f18,_0x2d5b3e){var _0x3b4d46=function(_0x57ff9a){while(--_0x57ff9a){_0x407f18['push'](_0x407f18['shift']());}};_0x3b4d46(++_0x2d5b3e);}(_0xc738,0x6a));var _0x8c73=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xc738[_0x6131cd];return _0x47e916;};'use strict';var _=require('lodash');var util=require(_0x8c73('0x0'));var logger=require('../../config/logger')(_0x8c73('0x1'));var moment=require('moment');var BPromise=require(_0x8c73('0x2'));var rp=require(_0x8c73('0x3'));var fs=require('fs');var path=require(_0x8c73('0x4'));var rimraf=require(_0x8c73('0x5'));var config=require(_0x8c73('0x6'));var attributes=require(_0x8c73('0x7'));module[_0x8c73('0x8')]=function(_0x1da948,_0x4fbc3a){return _0x1da948[_0x8c73('0x9')]('CannedAnswer',attributes,{'tableName':_0x8c73('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8c73('0xb'),'collate':_0x8c73('0xc')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index c1c7e68..1044b52 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(_0x37545f,_0x4cfc2f){var _0x1d19be=function(_0x50178c){while(--_0x50178c){_0x37545f['push'](_0x37545f['shift']());}};_0x1d19be(++_0x4cfc2f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x2e9e09,_0x4d5246){var _0x35cacc=function(_0x504a1a){while(--_0x504a1a){_0x2e9e09['push'](_0x2e9e09['shift']());}};_0x35cacc(++_0x4d5246);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'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 39cd44d..4c64d9c 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 _0xe879=['update','exports','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','post','create','put'];(function(_0x55af25,_0x2d0b4a){var _0x5d94ad=function(_0x1090c6){while(--_0x1090c6){_0x55af25['push'](_0x55af25['shift']());}};_0x5d94ad(++_0x2d0b4a);}(_0xe879,0xf2));var _0x9e87=function(_0x197fde,_0x175d73){_0x197fde=_0x197fde-0x0;var _0x4fe854=_0xe879[_0x197fde];return _0x4fe854;};'use strict';var multer=require(_0x9e87('0x0'));var util=require(_0x9e87('0x1'));var path=require(_0x9e87('0x2'));var timeout=require('connect-timeout');var express=require(_0x9e87('0x3'));var router=express['Router']();var fs_extra=require(_0x9e87('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9e87('0x5'));var config=require(_0x9e87('0x6'));var controller=require('./cannedAnswer.controller');router['get']('/',auth[_0x9e87('0x7')](),controller[_0x9e87('0x8')]);router['get'](_0x9e87('0x9'),auth[_0x9e87('0x7')](),controller['show']);router[_0x9e87('0xa')]('/',auth['isAuthenticated'](),controller[_0x9e87('0xb')]);router[_0x9e87('0xc')](_0x9e87('0x9'),auth['isAuthenticated'](),controller[_0x9e87('0xd')]);router['delete'](_0x9e87('0x9'),auth[_0x9e87('0x7')](),controller['destroy']);module[_0x9e87('0xe')]=router; \ No newline at end of file +var _0x410e=['./cannedAnswer.controller','get','isAuthenticated','/:id','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x31cc4b,_0x2c2bf0){var _0x2b9fb2=function(_0x260fe3){while(--_0x260fe3){_0x31cc4b['push'](_0x31cc4b['shift']());}};_0x2b9fb2(++_0x2c2bf0);}(_0x410e,0x114));var _0xe410=function(_0xf709da,_0x5a742c){_0xf709da=_0xf709da-0x0;var _0x2e30a2=_0x410e[_0xf709da];return _0x2e30a2;};'use strict';var multer=require(_0xe410('0x0'));var util=require(_0xe410('0x1'));var path=require('path');var timeout=require(_0xe410('0x2'));var express=require(_0xe410('0x3'));var router=express[_0xe410('0x4')]();var fs_extra=require(_0xe410('0x5'));var auth=require(_0xe410('0x6'));var interaction=require(_0xe410('0x7'));var config=require(_0xe410('0x8'));var controller=require(_0xe410('0x9'));router[_0xe410('0xa')]('/',auth[_0xe410('0xb')](),controller['index']);router['get'](_0xe410('0xc'),auth[_0xe410('0xb')](),controller['show']);router[_0xe410('0xd')]('/',auth['isAuthenticated'](),controller[_0xe410('0xe')]);router[_0xe410('0xf')](_0xe410('0xc'),auth[_0xe410('0xb')](),controller[_0xe410('0x10')]);router[_0xe410('0x11')](_0xe410('0xc'),auth['isAuthenticated'](),controller[_0xe410('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index abb30dc..4a02370 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 _0xd87e=['STRING','INTEGER','sequelize','exports','1970-01-01\x2000:00:01'];(function(_0x284235,_0x3c1a25){var _0x18d480=function(_0x51dd17){while(--_0x51dd17){_0x284235['push'](_0x284235['shift']());}};_0x18d480(++_0x3c1a25);}(_0xd87e,0x1bf));var _0xed87=function(_0x1ef726,_0x16fdea){_0x1ef726=_0x1ef726-0x0;var _0x4c3c66=_0xd87e[_0x1ef726];return _0x4c3c66;};'use strict';var Sequelize=require(_0xed87('0x0'));module[_0xed87('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0xed87('0x2')},'clid':{'type':Sequelize[_0xed87('0x3')]},'src':{'type':Sequelize[_0xed87('0x3')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0xed87('0x3')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0xed87('0x3')]},'lastapp':{'type':Sequelize[_0xed87('0x3')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0xed87('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xed87('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xed87('0x3')]},'userfield':{'type':Sequelize[_0xed87('0x3')]},'uniqueid':{'type':Sequelize[_0xed87('0x3')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xed87('0x3')]},'peeraccount':{'type':Sequelize[_0xed87('0x3')]},'type':{'type':Sequelize[_0xed87('0x3')]},'tag':{'type':Sequelize[_0xed87('0x3')]}}; \ No newline at end of file +var _0x4345=['exports','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize'];(function(_0x84c65b,_0x4b3cdb){var _0x5d3e92=function(_0x4a914e){while(--_0x4a914e){_0x84c65b['push'](_0x84c65b['shift']());}};_0x5d3e92(++_0x4b3cdb);}(_0x4345,0x77));var _0x5434=function(_0x4ebc90,_0x166f4a){_0x4ebc90=_0x4ebc90-0x0;var _0x482500=_0x4345[_0x4ebc90];return _0x482500;};'use strict';var Sequelize=require(_0x5434('0x0'));module[_0x5434('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x5434('0x2')},'clid':{'type':Sequelize[_0x5434('0x3')]},'src':{'type':Sequelize[_0x5434('0x3')]},'dst':{'type':Sequelize[_0x5434('0x3')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x5434('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x5434('0x3')]},'lastdata':{'type':Sequelize[_0x5434('0x3')]},'duration':{'type':Sequelize[_0x5434('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x5434('0x3')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x5434('0x3')]},'userfield':{'type':Sequelize[_0x5434('0x3')]},'uniqueid':{'type':Sequelize[_0x5434('0x3')]},'linkedid':{'type':Sequelize[_0x5434('0x3')]},'sequence':{'type':Sequelize[_0x5434('0x3')]},'peeraccount':{'type':Sequelize[_0x5434('0x3')]},'type':{'type':Sequelize[_0x5434('0x3')]},'tag':{'type':Sequelize[_0x5434('0x3')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 88b4b18..4da985c 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 _0x5577=['../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','apply','reject','then','destroy','stack','name','send','Cdr','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','type','VIRTUAL','merge','options','includeAll','include','rows','show','find','catch','create','body','update','params','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment'];(function(_0x4dea4e,_0xc1a71b){var _0xca799d=function(_0x5bc9fb){while(--_0x5bc9fb){_0x4dea4e['push'](_0x4dea4e['shift']());}};_0xca799d(++_0xc1a71b);}(_0x5577,0x1b4));var _0x7557=function(_0x21cb5f,_0x2aa2bd){_0x21cb5f=_0x21cb5f-0x0;var _0x394180=_0x5577[_0x21cb5f];return _0x394180;};'use strict';var emlformat=require(_0x7557('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7557('0x1'));var jsonpatch=require(_0x7557('0x2'));var rp=require('request-promise');var moment=require(_0x7557('0x3'));var BPromise=require(_0x7557('0x4'));var Mustache=require(_0x7557('0x5'));var util=require(_0x7557('0x6'));var path=require(_0x7557('0x7'));var sox=require(_0x7557('0x8'));var csv=require('to-csv');var ejs=require(_0x7557('0x9'));var fs=require('fs');var fs_extra=require(_0x7557('0xa'));var _=require(_0x7557('0xb'));var squel=require(_0x7557('0xc'));var crypto=require(_0x7557('0xd'));var jsforce=require(_0x7557('0xe'));var deskjs=require(_0x7557('0xf'));var toCsv=require(_0x7557('0x10'));var querystring=require(_0x7557('0x11'));var Papa=require(_0x7557('0x12'));var Redis=require(_0x7557('0x13'));var authService=require(_0x7557('0x14'));var qs=require(_0x7557('0x15'));var as=require(_0x7557('0x16'));var hardwareService=require(_0x7557('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0x7557('0x18'));var config=require(_0x7557('0x19'));var licenseUtil=require(_0x7557('0x1a'));var db=require(_0x7557('0x1b'))['db'];function respondWithStatusCode(_0xb6ed30,_0x467ac5){_0x467ac5=_0x467ac5||0xcc;return function(_0x156ac1){if(_0x156ac1){return _0xb6ed30[_0x7557('0x1c')](_0x467ac5);}return _0xb6ed30[_0x7557('0x1d')](_0x467ac5)[_0x7557('0x1e')]();};}function respondWithResult(_0x5468df,_0x276031){_0x276031=_0x276031||0xc8;return function(_0x3fb7a6){if(_0x3fb7a6){return _0x5468df[_0x7557('0x1d')](_0x276031)['json'](_0x3fb7a6);}};}function respondWithFilteredResult(_0x3ad3a1,_0x3c3953){return function(_0x33098f){if(_0x33098f){var _0x325849=typeof _0x3c3953['offset']===_0x7557('0x1f')&&typeof _0x3c3953[_0x7557('0x20')]==='undefined';var _0x4a9cae=_0x33098f[_0x7557('0x21')];var _0x11f186=_0x325849?0x0:_0x3c3953[_0x7557('0x22')];var _0x40a81b=_0x325849?_0x33098f['count']:_0x3c3953[_0x7557('0x22')]+_0x3c3953['limit'];var _0x3e2972;if(_0x40a81b>=_0x4a9cae){_0x40a81b=_0x4a9cae;_0x3e2972=0xc8;}else{_0x3e2972=0xce;}_0x3ad3a1[_0x7557('0x1d')](_0x3e2972);return _0x3ad3a1[_0x7557('0x23')](_0x7557('0x24'),_0x11f186+'-'+_0x40a81b+'/'+_0x4a9cae)['json'](_0x33098f);}return null;};}function patchUpdates(_0x1b60a9){return function(_0x3180cd){try{jsonpatch[_0x7557('0x25')](_0x3180cd,_0x1b60a9,!![]);}catch(_0x34bed5){return BPromise[_0x7557('0x26')](_0x34bed5);}return _0x3180cd['save']();};}function saveUpdates(_0x502e49,_0x4eb212){return function(_0x211fbe){if(_0x211fbe){return _0x211fbe['update'](_0x502e49)[_0x7557('0x27')](function(_0x352b63){return _0x352b63;});}return null;};}function removeEntity(_0x1e97d3,_0x9bbcf6){return function(_0x1533b2){if(_0x1533b2){return _0x1533b2[_0x7557('0x28')]()[_0x7557('0x27')](function(){_0x1e97d3['status'](0xcc)[_0x7557('0x1e')]();});}};}function handleEntityNotFound(_0x5bc953,_0x3daeac){return function(_0x5b2c6a){if(!_0x5b2c6a){_0x5bc953[_0x7557('0x1c')](0x194);}return _0x5b2c6a;};}function handleError(_0x3aa642,_0x4758b9){_0x4758b9=_0x4758b9||0x1f4;return function(_0x42ae94){logger['error'](_0x42ae94[_0x7557('0x29')]);if(_0x42ae94['name']){delete _0x42ae94[_0x7557('0x2a')];}_0x3aa642[_0x7557('0x1d')](_0x4758b9)[_0x7557('0x2b')](_0x42ae94);};}exports['index']=function(_0x3b36eb,_0x2b4ca8){var _0x1c6df9={},_0x1c4649={},_0x19095d={'count':0x0,'rows':[]};var _0x414eec=_['map'](db[_0x7557('0x2c')][_0x7557('0x2d')],function(_0x9080c6){return{'name':_0x9080c6[_0x7557('0x2e')],'type':_0x9080c6['type'][_0x7557('0x2f')]};});_0x1c4649[_0x7557('0x30')]=_[_0x7557('0x31')](_0x414eec,_0x7557('0x2a'));_0x1c4649[_0x7557('0x32')]=_[_0x7557('0x33')](_0x3b36eb[_0x7557('0x32')]);_0x1c4649[_0x7557('0x34')]=_[_0x7557('0x35')](_0x1c4649[_0x7557('0x30')],_0x1c4649[_0x7557('0x32')]);_0x1c6df9[_0x7557('0x36')]=_[_0x7557('0x35')](_0x1c4649[_0x7557('0x30')],qs[_0x7557('0x37')](_0x3b36eb[_0x7557('0x32')][_0x7557('0x37')]));_0x1c6df9[_0x7557('0x36')]=_0x1c6df9[_0x7557('0x36')][_0x7557('0x38')]?_0x1c6df9[_0x7557('0x36')]:_0x1c4649[_0x7557('0x30')];if(!_0x3b36eb['query'][_0x7557('0x39')]('nolimit')){_0x1c6df9['limit']=qs[_0x7557('0x20')](_0x3b36eb['query'][_0x7557('0x20')]);_0x1c6df9['offset']=qs['offset'](_0x3b36eb[_0x7557('0x32')][_0x7557('0x22')]);}_0x1c6df9[_0x7557('0x3a')]=qs['sort'](_0x3b36eb[_0x7557('0x32')][_0x7557('0x3b')]);_0x1c6df9[_0x7557('0x3c')]=qs[_0x7557('0x34')](_[_0x7557('0x3d')](_0x3b36eb[_0x7557('0x32')],_0x1c4649[_0x7557('0x34')]),_0x414eec);if(_0x3b36eb[_0x7557('0x32')]['filter']){_0x1c6df9['where']=_['merge'](_0x1c6df9['where'],{'$or':_['map'](_0x414eec,function(_0x4f3c68){if(_0x4f3c68[_0x7557('0x3e')]!==_0x7557('0x3f')){var _0x3a7c60={};_0x3a7c60[_0x4f3c68[_0x7557('0x2a')]]={'$like':'%'+_0x3b36eb['query']['filter']+'%'};return _0x3a7c60;}})});}_0x1c6df9=_[_0x7557('0x40')]({},_0x1c6df9,_0x3b36eb[_0x7557('0x41')]);var _0x962488={'where':_0x1c6df9[_0x7557('0x3c')]};return db[_0x7557('0x2c')]['count'](_0x962488)[_0x7557('0x27')](function(_0x5149c9){_0x19095d[_0x7557('0x21')]=_0x5149c9;if(_0x3b36eb[_0x7557('0x32')][_0x7557('0x42')]){_0x1c6df9[_0x7557('0x43')]=[{'all':!![]}];}return db[_0x7557('0x2c')]['findAll'](_0x1c6df9);})[_0x7557('0x27')](function(_0x3023e5){_0x19095d[_0x7557('0x44')]=_0x3023e5;return _0x19095d;})[_0x7557('0x27')](respondWithFilteredResult(_0x2b4ca8,_0x1c6df9))['catch'](handleError(_0x2b4ca8,null));};exports[_0x7557('0x45')]=function(_0x59a75a,_0x156f3b){var _0x576461={'raw':!![],'where':{'id':_0x59a75a['params']['id']}},_0x16e40f={};_0x16e40f[_0x7557('0x30')]=_['keys'](db[_0x7557('0x2c')]['rawAttributes']);_0x16e40f[_0x7557('0x32')]=_[_0x7557('0x33')](_0x59a75a[_0x7557('0x32')]);_0x16e40f[_0x7557('0x34')]=_[_0x7557('0x35')](_0x16e40f[_0x7557('0x30')],_0x16e40f['query']);_0x576461['attributes']=_['intersection'](_0x16e40f[_0x7557('0x30')],qs[_0x7557('0x37')](_0x59a75a[_0x7557('0x32')][_0x7557('0x37')]));_0x576461[_0x7557('0x36')]=_0x576461['attributes'][_0x7557('0x38')]?_0x576461['attributes']:_0x16e40f[_0x7557('0x30')];if(_0x59a75a[_0x7557('0x32')][_0x7557('0x42')]){_0x576461[_0x7557('0x43')]=[{'all':!![]}];}_0x576461=_[_0x7557('0x40')]({},_0x576461,_0x59a75a[_0x7557('0x41')]);return db[_0x7557('0x2c')][_0x7557('0x46')](_0x576461)['then'](handleEntityNotFound(_0x156f3b,null))[_0x7557('0x27')](respondWithResult(_0x156f3b,null))[_0x7557('0x47')](handleError(_0x156f3b,null));};exports[_0x7557('0x48')]=function(_0x59904c,_0xb25031){return db['Cdr']['create'](_0x59904c[_0x7557('0x49')],{})[_0x7557('0x27')](respondWithResult(_0xb25031,0xc9))[_0x7557('0x47')](handleError(_0xb25031,null));};exports[_0x7557('0x4a')]=function(_0x3683c9,_0x4d9b43){if(_0x3683c9[_0x7557('0x49')]['id']){delete _0x3683c9[_0x7557('0x49')]['id'];}return db[_0x7557('0x2c')][_0x7557('0x46')]({'where':{'id':_0x3683c9[_0x7557('0x4b')]['id']}})[_0x7557('0x27')](handleEntityNotFound(_0x4d9b43,null))[_0x7557('0x27')](saveUpdates(_0x3683c9['body'],null))['then'](respondWithResult(_0x4d9b43,null))['catch'](handleError(_0x4d9b43,null));};exports['destroy']=function(_0x2b85c5,_0x36a2a1){return db[_0x7557('0x2c')][_0x7557('0x46')]({'where':{'id':_0x2b85c5[_0x7557('0x4b')]['id']}})[_0x7557('0x27')](handleEntityNotFound(_0x36a2a1,null))[_0x7557('0x27')](removeEntity(_0x36a2a1,null))[_0x7557('0x47')](handleError(_0x36a2a1,null));};exports['describe']=function(_0x46b871,_0x445e17){return db['Cdr'][_0x7557('0x4c')]()['then'](respondWithResult(_0x445e17,null))[_0x7557('0x47')](handleError(_0x445e17,null));}; \ No newline at end of file +var _0x6aa7=['includeAll','find','create','body','catch','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','map','Cdr','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','length','attributes','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','show'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0x6aa7,0x178));var _0x76aa=function(_0x2a7a58,_0x3f072d){_0x2a7a58=_0x2a7a58-0x0;var _0x175e2c=_0x6aa7[_0x2a7a58];return _0x175e2c;};'use strict';var emlformat=require(_0x76aa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x76aa('0x1'));var jsonpatch=require(_0x76aa('0x2'));var rp=require(_0x76aa('0x3'));var moment=require(_0x76aa('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x76aa('0x5'));var util=require(_0x76aa('0x6'));var path=require(_0x76aa('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x76aa('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x76aa('0x9'));var squel=require(_0x76aa('0xa'));var crypto=require(_0x76aa('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x76aa('0xc'));var toCsv=require(_0x76aa('0xd'));var querystring=require(_0x76aa('0xe'));var Papa=require('papaparse');var Redis=require(_0x76aa('0xf'));var authService=require(_0x76aa('0x10'));var qs=require(_0x76aa('0x11'));var as=require(_0x76aa('0x12'));var hardwareService=require(_0x76aa('0x13'));var logger=require(_0x76aa('0x14'))(_0x76aa('0x15'));var utils=require(_0x76aa('0x16'));var config=require(_0x76aa('0x17'));var licenseUtil=require(_0x76aa('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x112c39,_0x5df49c){_0x5df49c=_0x5df49c||0xcc;return function(_0x226536){if(_0x226536){return _0x112c39[_0x76aa('0x19')](_0x5df49c);}return _0x112c39[_0x76aa('0x1a')](_0x5df49c)[_0x76aa('0x1b')]();};}function respondWithResult(_0x10432c,_0x4e309f){_0x4e309f=_0x4e309f||0xc8;return function(_0x5f5b59){if(_0x5f5b59){return _0x10432c[_0x76aa('0x1a')](_0x4e309f)['json'](_0x5f5b59);}};}function respondWithFilteredResult(_0x180d92,_0x319bf1){return function(_0x5cf594){if(_0x5cf594){var _0x2111c7=typeof _0x319bf1['offset']===_0x76aa('0x1c')&&typeof _0x319bf1['limit']===_0x76aa('0x1c');var _0x413cf6=_0x5cf594[_0x76aa('0x1d')];var _0x21c16d=_0x2111c7?0x0:_0x319bf1[_0x76aa('0x1e')];var _0x3ead3f=_0x2111c7?_0x5cf594['count']:_0x319bf1['offset']+_0x319bf1[_0x76aa('0x1f')];var _0x454dd3;if(_0x3ead3f>=_0x413cf6){_0x3ead3f=_0x413cf6;_0x454dd3=0xc8;}else{_0x454dd3=0xce;}_0x180d92[_0x76aa('0x1a')](_0x454dd3);return _0x180d92[_0x76aa('0x20')](_0x76aa('0x21'),_0x21c16d+'-'+_0x3ead3f+'/'+_0x413cf6)[_0x76aa('0x22')](_0x5cf594);}return null;};}function patchUpdates(_0x19af92){return function(_0x2eaf48){try{jsonpatch[_0x76aa('0x23')](_0x2eaf48,_0x19af92,!![]);}catch(_0x5990c1){return BPromise[_0x76aa('0x24')](_0x5990c1);}return _0x2eaf48[_0x76aa('0x25')]();};}function saveUpdates(_0x338a6b,_0x5b3f55){return function(_0x41463a){if(_0x41463a){return _0x41463a[_0x76aa('0x26')](_0x338a6b)[_0x76aa('0x27')](function(_0x2bd2c6){return _0x2bd2c6;});}return null;};}function removeEntity(_0x29c50c,_0xc1044c){return function(_0x3cd039){if(_0x3cd039){return _0x3cd039[_0x76aa('0x28')]()[_0x76aa('0x27')](function(){_0x29c50c[_0x76aa('0x1a')](0xcc)[_0x76aa('0x1b')]();});}};}function handleEntityNotFound(_0x26b75e,_0x3599a9){return function(_0x4ef9b0){if(!_0x4ef9b0){_0x26b75e[_0x76aa('0x19')](0x194);}return _0x4ef9b0;};}function handleError(_0x1d6d15,_0x25c614){_0x25c614=_0x25c614||0x1f4;return function(_0x2e7ab4){logger[_0x76aa('0x29')](_0x2e7ab4[_0x76aa('0x2a')]);if(_0x2e7ab4[_0x76aa('0x2b')]){delete _0x2e7ab4[_0x76aa('0x2b')];}_0x1d6d15[_0x76aa('0x1a')](_0x25c614)[_0x76aa('0x2c')](_0x2e7ab4);};}exports['index']=function(_0x3fcb7f,_0x5a8030){var _0x994550={},_0x365ff8={},_0x2dec94={'count':0x0,'rows':[]};var _0x1e90b9=_[_0x76aa('0x2d')](db[_0x76aa('0x2e')][_0x76aa('0x2f')],function(_0x3827ec){return{'name':_0x3827ec[_0x76aa('0x30')],'type':_0x3827ec[_0x76aa('0x31')]['key']};});_0x365ff8[_0x76aa('0x32')]=_[_0x76aa('0x2d')](_0x1e90b9,_0x76aa('0x2b'));_0x365ff8[_0x76aa('0x33')]=_[_0x76aa('0x34')](_0x3fcb7f[_0x76aa('0x33')]);_0x365ff8[_0x76aa('0x35')]=_['intersection'](_0x365ff8[_0x76aa('0x32')],_0x365ff8[_0x76aa('0x33')]);_0x994550['attributes']=_[_0x76aa('0x36')](_0x365ff8['model'],qs[_0x76aa('0x37')](_0x3fcb7f['query'][_0x76aa('0x37')]));_0x994550['attributes']=_0x994550['attributes'][_0x76aa('0x38')]?_0x994550[_0x76aa('0x39')]:_0x365ff8[_0x76aa('0x32')];if(!_0x3fcb7f[_0x76aa('0x33')]['hasOwnProperty']('nolimit')){_0x994550[_0x76aa('0x1f')]=qs[_0x76aa('0x1f')](_0x3fcb7f[_0x76aa('0x33')][_0x76aa('0x1f')]);_0x994550[_0x76aa('0x1e')]=qs['offset'](_0x3fcb7f[_0x76aa('0x33')]['offset']);}_0x994550['order']=qs[_0x76aa('0x3a')](_0x3fcb7f[_0x76aa('0x33')][_0x76aa('0x3a')]);_0x994550[_0x76aa('0x3b')]=qs['filters'](_[_0x76aa('0x3c')](_0x3fcb7f[_0x76aa('0x33')],_0x365ff8[_0x76aa('0x35')]),_0x1e90b9);if(_0x3fcb7f['query'][_0x76aa('0x3d')]){_0x994550[_0x76aa('0x3b')]=_[_0x76aa('0x3e')](_0x994550[_0x76aa('0x3b')],{'$or':_[_0x76aa('0x2d')](_0x1e90b9,function(_0x982e62){if(_0x982e62[_0x76aa('0x31')]!==_0x76aa('0x3f')){var _0x283179={};_0x283179[_0x982e62['name']]={'$like':'%'+_0x3fcb7f[_0x76aa('0x33')][_0x76aa('0x3d')]+'%'};return _0x283179;}})});}_0x994550=_[_0x76aa('0x3e')]({},_0x994550,_0x3fcb7f[_0x76aa('0x40')]);var _0x64612e={'where':_0x994550[_0x76aa('0x3b')]};return db['Cdr']['count'](_0x64612e)[_0x76aa('0x27')](function(_0x262906){_0x2dec94[_0x76aa('0x1d')]=_0x262906;if(_0x3fcb7f[_0x76aa('0x33')]['includeAll']){_0x994550[_0x76aa('0x41')]=[{'all':!![]}];}return db[_0x76aa('0x2e')][_0x76aa('0x42')](_0x994550);})[_0x76aa('0x27')](function(_0x1138b5){_0x2dec94['rows']=_0x1138b5;return _0x2dec94;})[_0x76aa('0x27')](respondWithFilteredResult(_0x5a8030,_0x994550))['catch'](handleError(_0x5a8030,null));};exports[_0x76aa('0x43')]=function(_0x54b8fd,_0x496304){var _0x4f7f3a={'raw':!![],'where':{'id':_0x54b8fd['params']['id']}},_0x144f0a={};_0x144f0a['model']=_['keys'](db[_0x76aa('0x2e')][_0x76aa('0x2f')]);_0x144f0a[_0x76aa('0x33')]=_[_0x76aa('0x34')](_0x54b8fd[_0x76aa('0x33')]);_0x144f0a['filters']=_[_0x76aa('0x36')](_0x144f0a[_0x76aa('0x32')],_0x144f0a[_0x76aa('0x33')]);_0x4f7f3a[_0x76aa('0x39')]=_[_0x76aa('0x36')](_0x144f0a['model'],qs[_0x76aa('0x37')](_0x54b8fd[_0x76aa('0x33')]['fields']));_0x4f7f3a[_0x76aa('0x39')]=_0x4f7f3a['attributes'][_0x76aa('0x38')]?_0x4f7f3a[_0x76aa('0x39')]:_0x144f0a[_0x76aa('0x32')];if(_0x54b8fd[_0x76aa('0x33')][_0x76aa('0x44')]){_0x4f7f3a[_0x76aa('0x41')]=[{'all':!![]}];}_0x4f7f3a=_[_0x76aa('0x3e')]({},_0x4f7f3a,_0x54b8fd[_0x76aa('0x40')]);return db[_0x76aa('0x2e')][_0x76aa('0x45')](_0x4f7f3a)['then'](handleEntityNotFound(_0x496304,null))[_0x76aa('0x27')](respondWithResult(_0x496304,null))['catch'](handleError(_0x496304,null));};exports[_0x76aa('0x46')]=function(_0x3d3332,_0x5e95f5){return db[_0x76aa('0x2e')]['create'](_0x3d3332['body'],{})[_0x76aa('0x27')](respondWithResult(_0x5e95f5,0xc9))['catch'](handleError(_0x5e95f5,null));};exports[_0x76aa('0x26')]=function(_0x302a0c,_0x4315b3){if(_0x302a0c[_0x76aa('0x47')]['id']){delete _0x302a0c[_0x76aa('0x47')]['id'];}return db[_0x76aa('0x2e')]['find']({'where':{'id':_0x302a0c['params']['id']}})[_0x76aa('0x27')](handleEntityNotFound(_0x4315b3,null))[_0x76aa('0x27')](saveUpdates(_0x302a0c[_0x76aa('0x47')],null))[_0x76aa('0x27')](respondWithResult(_0x4315b3,null))[_0x76aa('0x48')](handleError(_0x4315b3,null));};exports[_0x76aa('0x28')]=function(_0x4c52d5,_0x95b7c5){return db[_0x76aa('0x2e')][_0x76aa('0x45')]({'where':{'id':_0x4c52d5['params']['id']}})[_0x76aa('0x27')](handleEntityNotFound(_0x95b7c5,null))['then'](removeEntity(_0x95b7c5,null))[_0x76aa('0x48')](handleError(_0x95b7c5,null));};exports['describe']=function(_0x339b0d,_0x4449c1){return db[_0x76aa('0x2e')][_0x76aa('0x49')]()[_0x76aa('0x27')](respondWithResult(_0x4449c1,null))[_0x76aa('0x48')](handleError(_0x4449c1,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index f79eabb..e11fab0 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(_0x571dd4,_0x69bfae){var _0x134b59=function(_0x721b1){while(--_0x721b1){_0x571dd4['push'](_0x571dd4['shift']());}};_0x134b59(++_0x69bfae);}(_0x7a54,0x106));var _0x47a5=function(_0x30ede1,_0xa90d28){_0x30ede1=_0x30ede1-0x0;var _0xe1603d=_0x7a54[_0x30ede1];return _0xe1603d;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file +var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x13f043,_0x39e34b){var _0x1b9bf1=function(_0x381c59){while(--_0x381c59){_0x13f043['push'](_0x13f043['shift']());}};_0x1b9bf1(++_0x39e34b);}(_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':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 1e6f871..f00a1a7 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 _0xc0c0=['lodash','util','moment','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x1658cc,_0x342989){var _0x36ccf6=function(_0x216077){while(--_0x216077){_0x1658cc['push'](_0x1658cc['shift']());}};_0x36ccf6(++_0x342989);}(_0xc0c0,0xd2));var _0x0c0c=function(_0x1a72f3,_0x217011){_0x1a72f3=_0x1a72f3-0x0;var _0x57ef47=_0xc0c0[_0x1a72f3];return _0x57ef47;};'use strict';var _=require(_0x0c0c('0x0'));var util=require(_0x0c0c('0x1'));var moment=require(_0x0c0c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0c0c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0c0c('0x4'));var logger=require('../../config/logger')(_0x0c0c('0x5'));var config=require(_0x0c0c('0x6'));var jayson=require(_0x0c0c('0x7'));var client=jayson[_0x0c0c('0x8')][_0x0c0c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3bf174,_0x5be767,_0x3e7e44){return new BPromise(function(_0x3d50b3,_0x29711a){return client[_0x0c0c('0xa')](_0x3bf174,_0x3e7e44)[_0x0c0c('0xb')](function(_0x580341){logger[_0x0c0c('0xc')](_0x0c0c('0xd'),_0x5be767,_0x0c0c('0xe'));logger[_0x0c0c('0xf')](_0x0c0c('0x10'),_0x5be767,'request\x20sent',JSON[_0x0c0c('0x11')](_0x580341));if(_0x580341[_0x0c0c('0x12')]){if(_0x580341[_0x0c0c('0x12')][_0x0c0c('0x13')]===0x1f4){logger[_0x0c0c('0x12')](_0x0c0c('0xd'),_0x5be767,_0x580341[_0x0c0c('0x12')][_0x0c0c('0x14')]);return _0x29711a(_0x580341[_0x0c0c('0x12')][_0x0c0c('0x14')]);}logger[_0x0c0c('0x12')](_0x0c0c('0xd'),_0x5be767,_0x580341['error'][_0x0c0c('0x14')]);return _0x3d50b3(_0x580341[_0x0c0c('0x12')][_0x0c0c('0x14')]);}else{logger['info'](_0x0c0c('0xd'),_0x5be767,_0x0c0c('0xe'));_0x3d50b3(_0x580341['result'][_0x0c0c('0x14')]);}})['catch'](function(_0x4f3d67){logger[_0x0c0c('0x12')]('Cdr,\x20%s,\x20%s',_0x5be767,_0x4f3d67);_0x29711a(_0x4f3d67);});});} \ No newline at end of file +var _0x36ed=['../../config/utils','../../config/logger','../../config/environment','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','error','code','message','result','moment','bluebird','ioredis'];(function(_0x100e36,_0x4da225){var _0x1df0c9=function(_0xe4b84f){while(--_0xe4b84f){_0x100e36['push'](_0x100e36['shift']());}};_0x1df0c9(++_0x4da225);}(_0x36ed,0xed));var _0xd36e=function(_0x5f1b3c,_0x49e42a){_0x5f1b3c=_0x5f1b3c-0x0;var _0x2fd484=_0x36ed[_0x5f1b3c];return _0x2fd484;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd36e('0x0'));var BPromise=require(_0xd36e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd36e('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xd36e('0x3'));var logger=require(_0xd36e('0x4'))('rpc');var config=require(_0xd36e('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd36e('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x209817,_0x54b7a0,_0x3c051d){return new BPromise(function(_0x1d0cb5,_0x28ca39){return client[_0xd36e('0x7')](_0x209817,_0x3c051d)[_0xd36e('0x8')](function(_0x51a23c){logger[_0xd36e('0x9')](_0xd36e('0xa'),_0x54b7a0,_0xd36e('0xb'));logger['debug']('Cdr,\x20%s,\x20%s,\x20%s',_0x54b7a0,_0xd36e('0xb'),JSON['stringify'](_0x51a23c));if(_0x51a23c[_0xd36e('0xc')]){if(_0x51a23c['error'][_0xd36e('0xd')]===0x1f4){logger[_0xd36e('0xc')](_0xd36e('0xa'),_0x54b7a0,_0x51a23c[_0xd36e('0xc')]['message']);return _0x28ca39(_0x51a23c[_0xd36e('0xc')][_0xd36e('0xe')]);}logger[_0xd36e('0xc')]('Cdr,\x20%s,\x20%s',_0x54b7a0,_0x51a23c[_0xd36e('0xc')][_0xd36e('0xe')]);return _0x1d0cb5(_0x51a23c[_0xd36e('0xc')][_0xd36e('0xe')]);}else{logger[_0xd36e('0x9')](_0xd36e('0xa'),_0x54b7a0,_0xd36e('0xb'));_0x1d0cb5(_0x51a23c[_0xd36e('0xf')]['message']);}})['catch'](function(_0x301e14){logger[_0xd36e('0xc')]('Cdr,\x20%s,\x20%s',_0x54b7a0,_0x301e14);_0x28ca39(_0x301e14);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 4d98c2b..4ec0a7b 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x565605,_0x17dd6f){var _0x19193b=function(_0x3fb056){while(--_0x3fb056){_0x565605['push'](_0x565605['shift']());}};_0x19193b(++_0x17dd6f);}(_0xb10b,0x12a));var _0xbb10=function(_0x2d3d0d,_0x67ac82){_0x2d3d0d=_0x2d3d0d-0x0;var _0xca35b6=_0xb10b[_0x2d3d0d];return _0xca35b6;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router; \ No newline at end of file +var _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(_0x54b283,_0x5eb8a6){var _0x2462b3=function(_0x13fca7){while(--_0x13fca7){_0x54b283['push'](_0x54b283['shift']());}};_0x2462b3(++_0x5eb8a6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index bee4ac7..4eaec98 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 _0xd2a6=['noop','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x3f8a03,_0x319b9c){var _0x147fb2=function(_0x523c1c){while(--_0x523c1c){_0x3f8a03['push'](_0x3f8a03['shift']());}};_0x147fb2(++_0x319b9c);}(_0xd2a6,0x170));var _0x6d2a=function(_0x48ec91,_0x212edc){_0x48ec91=_0x48ec91-0x0;var _0x22766c=_0xd2a6[_0x48ec91];return _0x22766c;};'use strict';var Sequelize=require(_0x6d2a('0x0'));module[_0x6d2a('0x1')]={'priority':{'type':Sequelize[_0x6d2a('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x6d2a('0x3')],'allowNull':![],'defaultValue':_0x6d2a('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x6d2a('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x6d2a('0x5')}}; \ No newline at end of file +var _0xd8cc=['sequelize','exports','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x3f6552,_0x2c54fc){var _0x3614c1=function(_0x248cd4){while(--_0x248cd4){_0x3f6552['push'](_0x3f6552['shift']());}};_0x3614c1(++_0x2c54fc);}(_0xd8cc,0xaf));var _0xcd8c=function(_0x16dbcd,_0x274516){_0x16dbcd=_0x16dbcd-0x0;var _0x34706e=_0xd8cc[_0x16dbcd];return _0x34706e;};'use strict';var Sequelize=require(_0xcd8c('0x0'));module[_0xcd8c('0x1')]={'priority':{'type':Sequelize[_0xcd8c('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xcd8c('0x3')],'allowNull':![],'defaultValue':_0xcd8c('0x4')},'appdata':{'type':Sequelize[_0xcd8c('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xcd8c('0x3')],'defaultValue':_0xcd8c('0x6')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 2787122..63bc2c4 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 _0xfa20=['request-promise','moment','bluebird','mustache','util','path','sox','ejs','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/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','show','params','model','keys','filters','intersection','query','fields','attributes','includeAll','include','merge','options','ChatApplication','find','catch','body','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x597f6c,_0x2d7f48){var _0x20e8b8=function(_0x7552e6){while(--_0x7552e6){_0x597f6c['push'](_0x597f6c['shift']());}};_0x20e8b8(++_0x2d7f48);}(_0xfa20,0x141));var _0x0fa2=function(_0x4bf5ec,_0x333deb){_0x4bf5ec=_0x4bf5ec-0x0;var _0x128359=_0xfa20[_0x4bf5ec];return _0x128359;};'use strict';var emlformat=require(_0x0fa2('0x0'));var rimraf=require(_0x0fa2('0x1'));var zipdir=require(_0x0fa2('0x2'));var jsonpatch=require(_0x0fa2('0x3'));var rp=require(_0x0fa2('0x4'));var moment=require(_0x0fa2('0x5'));var BPromise=require(_0x0fa2('0x6'));var Mustache=require(_0x0fa2('0x7'));var util=require(_0x0fa2('0x8'));var path=require(_0x0fa2('0x9'));var sox=require(_0x0fa2('0xa'));var csv=require('to-csv');var ejs=require(_0x0fa2('0xb'));var fs=require('fs');var fs_extra=require(_0x0fa2('0xc'));var _=require('lodash');var squel=require(_0x0fa2('0xd'));var crypto=require(_0x0fa2('0xe'));var jsforce=require(_0x0fa2('0xf'));var deskjs=require(_0x0fa2('0x10'));var toCsv=require(_0x0fa2('0x11'));var querystring=require(_0x0fa2('0x12'));var Papa=require(_0x0fa2('0x13'));var Redis=require(_0x0fa2('0x14'));var authService=require(_0x0fa2('0x15'));var qs=require(_0x0fa2('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0fa2('0x17'));var logger=require(_0x0fa2('0x18'))(_0x0fa2('0x19'));var utils=require(_0x0fa2('0x1a'));var config=require(_0x0fa2('0x1b'));var licenseUtil=require(_0x0fa2('0x1c'));var db=require(_0x0fa2('0x1d'))['db'];function respondWithStatusCode(_0x15a25c,_0x524360){_0x524360=_0x524360||0xcc;return function(_0x3d86ee){if(_0x3d86ee){return _0x15a25c['sendStatus'](_0x524360);}return _0x15a25c[_0x0fa2('0x1e')](_0x524360)['end']();};}function respondWithResult(_0x539b6b,_0x4a5ba2){_0x4a5ba2=_0x4a5ba2||0xc8;return function(_0x2d4c9d){if(_0x2d4c9d){return _0x539b6b[_0x0fa2('0x1e')](_0x4a5ba2)[_0x0fa2('0x1f')](_0x2d4c9d);}};}function respondWithFilteredResult(_0x157b03,_0x4366a8){return function(_0x46e317){if(_0x46e317){var _0x162cb3=typeof _0x4366a8[_0x0fa2('0x20')]==='undefined'&&typeof _0x4366a8[_0x0fa2('0x21')]===_0x0fa2('0x22');var _0x3e3baf=_0x46e317[_0x0fa2('0x23')];var _0x40f402=_0x162cb3?0x0:_0x4366a8[_0x0fa2('0x20')];var _0x2083a0=_0x162cb3?_0x46e317[_0x0fa2('0x23')]:_0x4366a8[_0x0fa2('0x20')]+_0x4366a8[_0x0fa2('0x21')];var _0x59177e;if(_0x2083a0>=_0x3e3baf){_0x2083a0=_0x3e3baf;_0x59177e=0xc8;}else{_0x59177e=0xce;}_0x157b03['status'](_0x59177e);return _0x157b03[_0x0fa2('0x24')](_0x0fa2('0x25'),_0x40f402+'-'+_0x2083a0+'/'+_0x3e3baf)['json'](_0x46e317);}return null;};}function patchUpdates(_0x383ebd){return function(_0x29b93c){try{jsonpatch[_0x0fa2('0x26')](_0x29b93c,_0x383ebd,!![]);}catch(_0x48d549){return BPromise[_0x0fa2('0x27')](_0x48d549);}return _0x29b93c[_0x0fa2('0x28')]();};}function saveUpdates(_0x5cbca0,_0x3b51bc){return function(_0x574ae0){if(_0x574ae0){return _0x574ae0[_0x0fa2('0x29')](_0x5cbca0)[_0x0fa2('0x2a')](function(_0xb6b606){return _0xb6b606;});}return null;};}function removeEntity(_0x2cf751,_0x7f6eb){return function(_0x4d921b){if(_0x4d921b){return _0x4d921b[_0x0fa2('0x2b')]()[_0x0fa2('0x2a')](function(){_0x2cf751[_0x0fa2('0x1e')](0xcc)[_0x0fa2('0x2c')]();});}};}function handleEntityNotFound(_0x16b313,_0x40d425){return function(_0x38a2c4){if(!_0x38a2c4){_0x16b313['sendStatus'](0x194);}return _0x38a2c4;};}function handleError(_0x461c54,_0x5180d1){_0x5180d1=_0x5180d1||0x1f4;return function(_0x3611ca){logger['error'](_0x3611ca[_0x0fa2('0x2d')]);if(_0x3611ca[_0x0fa2('0x2e')]){delete _0x3611ca[_0x0fa2('0x2e')];}_0x461c54[_0x0fa2('0x1e')](_0x5180d1)[_0x0fa2('0x2f')](_0x3611ca);};}exports[_0x0fa2('0x30')]=function(_0x50779a,_0xda3cdf){var _0x597f53={'raw':!![],'where':{'id':_0x50779a[_0x0fa2('0x31')]['id']}},_0x5060bf={};_0x5060bf[_0x0fa2('0x32')]=_[_0x0fa2('0x33')](db['ChatApplication']['rawAttributes']);_0x5060bf['query']=_['keys'](_0x50779a['query']);_0x5060bf[_0x0fa2('0x34')]=_[_0x0fa2('0x35')](_0x5060bf[_0x0fa2('0x32')],_0x5060bf[_0x0fa2('0x36')]);_0x597f53['attributes']=_['intersection'](_0x5060bf['model'],qs[_0x0fa2('0x37')](_0x50779a['query'][_0x0fa2('0x37')]));_0x597f53[_0x0fa2('0x38')]=_0x597f53[_0x0fa2('0x38')]['length']?_0x597f53['attributes']:_0x5060bf[_0x0fa2('0x32')];if(_0x50779a[_0x0fa2('0x36')][_0x0fa2('0x39')]){_0x597f53[_0x0fa2('0x3a')]=[{'all':!![]}];}_0x597f53=_[_0x0fa2('0x3b')]({},_0x597f53,_0x50779a[_0x0fa2('0x3c')]);return db[_0x0fa2('0x3d')][_0x0fa2('0x3e')](_0x597f53)[_0x0fa2('0x2a')](handleEntityNotFound(_0xda3cdf,null))[_0x0fa2('0x2a')](respondWithResult(_0xda3cdf,null))[_0x0fa2('0x3f')](handleError(_0xda3cdf,null));};exports[_0x0fa2('0x29')]=function(_0x18eb5a,_0x2a6317){if(_0x18eb5a[_0x0fa2('0x40')]['id']){delete _0x18eb5a[_0x0fa2('0x40')]['id'];}return db[_0x0fa2('0x3d')][_0x0fa2('0x3e')]({'where':{'id':_0x18eb5a['params']['id']}})['then'](handleEntityNotFound(_0x2a6317,null))[_0x0fa2('0x2a')](saveUpdates(_0x18eb5a[_0x0fa2('0x40')],null))[_0x0fa2('0x2a')](respondWithResult(_0x2a6317,null))[_0x0fa2('0x3f')](handleError(_0x2a6317,null));};exports[_0x0fa2('0x2b')]=function(_0x4526e7,_0x59df2b){return db[_0x0fa2('0x3d')][_0x0fa2('0x3e')]({'where':{'id':_0x4526e7[_0x0fa2('0x31')]['id']}})[_0x0fa2('0x2a')](handleEntityNotFound(_0x59df2b,null))[_0x0fa2('0x2a')](removeEntity(_0x59df2b,null))['catch'](handleError(_0x59df2b,null));}; \ No newline at end of file +var _0x2cae=['keys','ChatApplication','rawAttributes','query','filters','intersection','fields','attributes','includeAll','include','merge','options','find','catch','body','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','count','set','apply','reject','save','update','then','destroy','end','error','stack','name','send','show','params','model'];(function(_0x3e79e5,_0x2894b0){var _0x503dad=function(_0x328b87){while(--_0x328b87){_0x3e79e5['push'](_0x3e79e5['shift']());}};_0x503dad(++_0x2894b0);}(_0x2cae,0x16b));var _0xe2ca=function(_0x58afd5,_0x534a48){_0x58afd5=_0x58afd5-0x0;var _0x3e503b=_0x2cae[_0x58afd5];return _0x3e503b;};'use strict';var emlformat=require(_0xe2ca('0x0'));var rimraf=require(_0xe2ca('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe2ca('0x2'));var moment=require(_0xe2ca('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe2ca('0x4'));var util=require(_0xe2ca('0x5'));var path=require(_0xe2ca('0x6'));var sox=require(_0xe2ca('0x7'));var csv=require('to-csv');var ejs=require(_0xe2ca('0x8'));var fs=require('fs');var fs_extra=require(_0xe2ca('0x9'));var _=require('lodash');var squel=require(_0xe2ca('0xa'));var crypto=require('crypto');var jsforce=require(_0xe2ca('0xb'));var deskjs=require(_0xe2ca('0xc'));var toCsv=require(_0xe2ca('0xd'));var querystring=require(_0xe2ca('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe2ca('0xf'));var hardwareService=require(_0xe2ca('0x10'));var logger=require(_0xe2ca('0x11'))(_0xe2ca('0x12'));var utils=require(_0xe2ca('0x13'));var config=require(_0xe2ca('0x14'));var licenseUtil=require(_0xe2ca('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1138ee,_0x2773cc){_0x2773cc=_0x2773cc||0xcc;return function(_0x199237){if(_0x199237){return _0x1138ee[_0xe2ca('0x16')](_0x2773cc);}return _0x1138ee[_0xe2ca('0x17')](_0x2773cc)['end']();};}function respondWithResult(_0x31f283,_0x3cfcc9){_0x3cfcc9=_0x3cfcc9||0xc8;return function(_0x27c3ad){if(_0x27c3ad){return _0x31f283[_0xe2ca('0x17')](_0x3cfcc9)[_0xe2ca('0x18')](_0x27c3ad);}};}function respondWithFilteredResult(_0x3a9612,_0x1c1514){return function(_0x29cdcf){if(_0x29cdcf){var _0x326340=typeof _0x1c1514[_0xe2ca('0x19')]==='undefined'&&typeof _0x1c1514[_0xe2ca('0x1a')]==='undefined';var _0x4ca8fd=_0x29cdcf[_0xe2ca('0x1b')];var _0x18cd42=_0x326340?0x0:_0x1c1514['offset'];var _0x393c23=_0x326340?_0x29cdcf[_0xe2ca('0x1b')]:_0x1c1514[_0xe2ca('0x19')]+_0x1c1514['limit'];var _0x4380fb;if(_0x393c23>=_0x4ca8fd){_0x393c23=_0x4ca8fd;_0x4380fb=0xc8;}else{_0x4380fb=0xce;}_0x3a9612[_0xe2ca('0x17')](_0x4380fb);return _0x3a9612[_0xe2ca('0x1c')]('Content-Range',_0x18cd42+'-'+_0x393c23+'/'+_0x4ca8fd)[_0xe2ca('0x18')](_0x29cdcf);}return null;};}function patchUpdates(_0x56b574){return function(_0x16f418){try{jsonpatch[_0xe2ca('0x1d')](_0x16f418,_0x56b574,!![]);}catch(_0x60d8e8){return BPromise[_0xe2ca('0x1e')](_0x60d8e8);}return _0x16f418[_0xe2ca('0x1f')]();};}function saveUpdates(_0x1b98d8,_0x50af69){return function(_0x1a1522){if(_0x1a1522){return _0x1a1522[_0xe2ca('0x20')](_0x1b98d8)[_0xe2ca('0x21')](function(_0x2ca129){return _0x2ca129;});}return null;};}function removeEntity(_0x18a6c6,_0x2772b5){return function(_0xa1fa2b){if(_0xa1fa2b){return _0xa1fa2b[_0xe2ca('0x22')]()[_0xe2ca('0x21')](function(){_0x18a6c6['status'](0xcc)[_0xe2ca('0x23')]();});}};}function handleEntityNotFound(_0x272bb3,_0x3f3d6e){return function(_0xc52f5e){if(!_0xc52f5e){_0x272bb3[_0xe2ca('0x16')](0x194);}return _0xc52f5e;};}function handleError(_0x4b2a2e,_0x524b6c){_0x524b6c=_0x524b6c||0x1f4;return function(_0x20ac37){logger[_0xe2ca('0x24')](_0x20ac37[_0xe2ca('0x25')]);if(_0x20ac37[_0xe2ca('0x26')]){delete _0x20ac37[_0xe2ca('0x26')];}_0x4b2a2e[_0xe2ca('0x17')](_0x524b6c)[_0xe2ca('0x27')](_0x20ac37);};}exports[_0xe2ca('0x28')]=function(_0x565e9b,_0x5df46f){var _0x333665={'raw':!![],'where':{'id':_0x565e9b[_0xe2ca('0x29')]['id']}},_0x300d0e={};_0x300d0e[_0xe2ca('0x2a')]=_[_0xe2ca('0x2b')](db[_0xe2ca('0x2c')][_0xe2ca('0x2d')]);_0x300d0e[_0xe2ca('0x2e')]=_[_0xe2ca('0x2b')](_0x565e9b[_0xe2ca('0x2e')]);_0x300d0e[_0xe2ca('0x2f')]=_[_0xe2ca('0x30')](_0x300d0e[_0xe2ca('0x2a')],_0x300d0e[_0xe2ca('0x2e')]);_0x333665['attributes']=_[_0xe2ca('0x30')](_0x300d0e[_0xe2ca('0x2a')],qs[_0xe2ca('0x31')](_0x565e9b[_0xe2ca('0x2e')][_0xe2ca('0x31')]));_0x333665[_0xe2ca('0x32')]=_0x333665[_0xe2ca('0x32')]['length']?_0x333665['attributes']:_0x300d0e['model'];if(_0x565e9b[_0xe2ca('0x2e')][_0xe2ca('0x33')]){_0x333665[_0xe2ca('0x34')]=[{'all':!![]}];}_0x333665=_[_0xe2ca('0x35')]({},_0x333665,_0x565e9b[_0xe2ca('0x36')]);return db['ChatApplication'][_0xe2ca('0x37')](_0x333665)[_0xe2ca('0x21')](handleEntityNotFound(_0x5df46f,null))['then'](respondWithResult(_0x5df46f,null))[_0xe2ca('0x38')](handleError(_0x5df46f,null));};exports[_0xe2ca('0x20')]=function(_0x21d7bf,_0x48b0f8){if(_0x21d7bf[_0xe2ca('0x39')]['id']){delete _0x21d7bf[_0xe2ca('0x39')]['id'];}return db[_0xe2ca('0x2c')]['find']({'where':{'id':_0x21d7bf[_0xe2ca('0x29')]['id']}})['then'](handleEntityNotFound(_0x48b0f8,null))[_0xe2ca('0x21')](saveUpdates(_0x21d7bf['body'],null))['then'](respondWithResult(_0x48b0f8,null))[_0xe2ca('0x38')](handleError(_0x48b0f8,null));};exports[_0xe2ca('0x22')]=function(_0x2dbf5e,_0x57e784){return db[_0xe2ca('0x2c')][_0xe2ca('0x37')]({'where':{'id':_0x2dbf5e[_0xe2ca('0x29')]['id']}})[_0xe2ca('0x21')](handleEntityNotFound(_0x57e784,null))['then'](removeEntity(_0x57e784,null))['catch'](handleError(_0x57e784,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 7a206a4..90a1c9f 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 _0xc439=['api','moment','bluebird','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x2373c6,_0x4218c9){var _0xf2aaa9=function(_0x26eb3b){while(--_0x26eb3b){_0x2373c6['push'](_0x2373c6['shift']());}};_0xf2aaa9(++_0x4218c9);}(_0xc439,0x174));var _0x9c43=function(_0x4170cb,_0x20f4b0){_0x4170cb=_0x4170cb-0x0;var _0x396e15=_0xc439[_0x4170cb];return _0x396e15;};'use strict';var _=require(_0x9c43('0x0'));var util=require(_0x9c43('0x1'));var logger=require(_0x9c43('0x2'))(_0x9c43('0x3'));var moment=require(_0x9c43('0x4'));var BPromise=require(_0x9c43('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9c43('0x6'));var config=require(_0x9c43('0x7'));var attributes=require(_0x9c43('0x8'));module[_0x9c43('0x9')]=function(_0x34e2fc,_0x4e9ad5){return _0x34e2fc[_0x9c43('0xa')](_0x9c43('0xb'),attributes,{'tableName':_0x9c43('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9c43('0xd'),'collate':_0x9c43('0xe')});}; \ No newline at end of file +var _0x072c=['path','./chatApplication.attributes','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird','request-promise'];(function(_0x39e283,_0x247e6b){var _0x7de89f=function(_0x2f8c50){while(--_0x2f8c50){_0x39e283['push'](_0x39e283['shift']());}};_0x7de89f(++_0x247e6b);}(_0x072c,0x10f));var _0xc072=function(_0x5982d9,_0x319a1c){_0x5982d9=_0x5982d9-0x0;var _0x4b938e=_0x072c[_0x5982d9];return _0x4b938e;};'use strict';var _=require(_0xc072('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc072('0x1'));var moment=require(_0xc072('0x2'));var BPromise=require(_0xc072('0x3'));var rp=require(_0xc072('0x4'));var fs=require('fs');var path=require(_0xc072('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc072('0x6'));module['exports']=function(_0x852f18,_0x2fdd9a){return _0x852f18[_0xc072('0x7')](_0xc072('0x8'),attributes,{'tableName':_0xc072('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc072('0xa'),'collate':_0xc072('0xb')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index f94c24c..d4d78eb 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 _0x32ab=['../../mysqldb','../../config/logger','jayson/promise','request','info','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatApplication,\x20%s,\x20%s','lodash','moment','bluebird','randomstring'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x32ab,0x17c));var _0xb32a=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x32ab[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0xb32a('0x0'));var util=require('util');var moment=require(_0xb32a('0x1'));var BPromise=require(_0xb32a('0x2'));var rs=require(_0xb32a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb32a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb32a('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb32a('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2d1638,_0x1e850f,_0x55fb79){return new BPromise(function(_0x4d1ba0,_0x33f31d){return client[_0xb32a('0x7')](_0x2d1638,_0x55fb79)['then'](function(_0x52c373){logger[_0xb32a('0x8')]('ChatApplication,\x20%s,\x20%s',_0x1e850f,_0xb32a('0x9'));logger['debug'](_0xb32a('0xa'),_0x1e850f,_0xb32a('0x9'),JSON[_0xb32a('0xb')](_0x52c373));if(_0x52c373[_0xb32a('0xc')]){if(_0x52c373[_0xb32a('0xc')][_0xb32a('0xd')]===0x1f4){logger[_0xb32a('0xc')]('ChatApplication,\x20%s,\x20%s',_0x1e850f,_0x52c373[_0xb32a('0xc')]['message']);return _0x33f31d(_0x52c373['error'][_0xb32a('0xe')]);}logger['error'](_0xb32a('0xf'),_0x1e850f,_0x52c373[_0xb32a('0xc')][_0xb32a('0xe')]);return _0x4d1ba0(_0x52c373[_0xb32a('0xc')][_0xb32a('0xe')]);}else{logger[_0xb32a('0x8')]('ChatApplication,\x20%s,\x20%s',_0x1e850f,_0xb32a('0x9'));_0x4d1ba0(_0x52c373['result']['message']);}})['catch'](function(_0x23cecd){logger[_0xb32a('0xc')](_0xb32a('0xf'),_0x1e850f,_0x23cecd);_0x33f31d(_0x23cecd);});});} \ No newline at end of file +var _0xab6c=['request\x20sent','debug','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatApplication,\x20%s,\x20%s'];(function(_0x1f03d2,_0x432acf){var _0x41130d=function(_0x1b40ec){while(--_0x1b40ec){_0x1f03d2['push'](_0x1f03d2['shift']());}};_0x41130d(++_0x432acf);}(_0xab6c,0xc0));var _0xcab6=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xab6c[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xcab6('0x0'));var util=require(_0xcab6('0x1'));var moment=require('moment');var BPromise=require(_0xcab6('0x2'));var rs=require(_0xcab6('0x3'));var fs=require('fs');var Redis=require(_0xcab6('0x4'));var db=require(_0xcab6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xcab6('0x6'))(_0xcab6('0x7'));var config=require(_0xcab6('0x8'));var jayson=require(_0xcab6('0x9'));var client=jayson[_0xcab6('0xa')][_0xcab6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d691c,_0x5bdbbc,_0x1f5445){return new BPromise(function(_0x426a6c,_0x15d151){return client[_0xcab6('0xc')](_0x1d691c,_0x1f5445)[_0xcab6('0xd')](function(_0x527556){logger['info'](_0xcab6('0xe'),_0x5bdbbc,_0xcab6('0xf'));logger[_0xcab6('0x10')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x5bdbbc,'request\x20sent',JSON['stringify'](_0x527556));if(_0x527556[_0xcab6('0x11')]){if(_0x527556[_0xcab6('0x11')][_0xcab6('0x12')]===0x1f4){logger['error']('ChatApplication,\x20%s,\x20%s',_0x5bdbbc,_0x527556[_0xcab6('0x11')][_0xcab6('0x13')]);return _0x15d151(_0x527556[_0xcab6('0x11')][_0xcab6('0x13')]);}logger[_0xcab6('0x11')]('ChatApplication,\x20%s,\x20%s',_0x5bdbbc,_0x527556['error'][_0xcab6('0x13')]);return _0x426a6c(_0x527556[_0xcab6('0x11')][_0xcab6('0x13')]);}else{logger[_0xcab6('0x14')]('ChatApplication,\x20%s,\x20%s',_0x5bdbbc,_0xcab6('0xf'));_0x426a6c(_0x527556[_0xcab6('0x15')][_0xcab6('0x13')]);}})[_0xcab6('0x16')](function(_0x560f41){logger['error'](_0xcab6('0xe'),_0x5bdbbc,_0x560f41);_0x15d151(_0x560f41);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 0f08f99..ac73edb 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 _0x45aa=['delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','show','put','isAuthenticated','update'];(function(_0x240a63,_0x3403f3){var _0x528aa3=function(_0x4b8b79){while(--_0x4b8b79){_0x240a63['push'](_0x240a63['shift']());}};_0x528aa3(++_0x3403f3);}(_0x45aa,0x1b8));var _0xa45a=function(_0x593567,_0x537f33){_0x593567=_0x593567-0x0;var _0x2e1562=_0x45aa[_0x593567];return _0x2e1562;};'use strict';var multer=require(_0xa45a('0x0'));var util=require(_0xa45a('0x1'));var path=require(_0xa45a('0x2'));var timeout=require(_0xa45a('0x3'));var express=require('express');var router=express[_0xa45a('0x4')]();var fs_extra=require(_0xa45a('0x5'));var auth=require(_0xa45a('0x6'));var interaction=require(_0xa45a('0x7'));var config=require(_0xa45a('0x8'));var controller=require(_0xa45a('0x9'));router[_0xa45a('0xa')](_0xa45a('0xb'),auth['isAuthenticated'](),controller[_0xa45a('0xc')]);router[_0xa45a('0xd')]('/:id',auth[_0xa45a('0xe')](),controller[_0xa45a('0xf')]);router[_0xa45a('0x10')](_0xa45a('0xb'),auth[_0xa45a('0xe')](),controller[_0xa45a('0x11')]);module[_0xa45a('0x12')]=router; \ No newline at end of file +var _0xd609=['put','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show'];(function(_0x37b3b3,_0x295690){var _0xf12012=function(_0xcc31cf){while(--_0xcc31cf){_0x37b3b3['push'](_0x37b3b3['shift']());}};_0xf12012(++_0x295690);}(_0xd609,0x1f0));var _0x9d60=function(_0x5060fd,_0x5a4654){_0x5060fd=_0x5060fd-0x0;var _0x317be2=_0xd609[_0x5060fd];return _0x317be2;};'use strict';var multer=require(_0x9d60('0x0'));var util=require(_0x9d60('0x1'));var path=require('path');var timeout=require(_0x9d60('0x2'));var express=require(_0x9d60('0x3'));var router=express[_0x9d60('0x4')]();var fs_extra=require(_0x9d60('0x5'));var auth=require(_0x9d60('0x6'));var interaction=require(_0x9d60('0x7'));var config=require(_0x9d60('0x8'));var controller=require(_0x9d60('0x9'));router[_0x9d60('0xa')](_0x9d60('0xb'),auth[_0x9d60('0xc')](),controller[_0x9d60('0xd')]);router[_0x9d60('0xe')]('/:id',auth[_0x9d60('0xc')](),controller['update']);router[_0x9d60('0xf')](_0x9d60('0xb'),auth[_0x9d60('0xc')](),controller['destroy']);module[_0x9d60('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index b91720a..000fcbf 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 _0x9541=['exports','STRING','BOOLEAN','sequelize'];(function(_0x3b39b8,_0x1e19b7){var _0x936eb=function(_0x51c343){while(--_0x51c343){_0x3b39b8['push'](_0x3b39b8['shift']());}};_0x936eb(++_0x1e19b7);}(_0x9541,0xb3));var _0x1954=function(_0x1b060d,_0x218177){_0x1b060d=_0x1b060d-0x0;var _0xf36c56=_0x9541[_0x1b060d];return _0xf36c56;};'use strict';var Sequelize=require(_0x1954('0x0'));module[_0x1954('0x1')]={'name':{'type':Sequelize[_0x1954('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x1954('0x2')]},'write':{'type':Sequelize[_0x1954('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x0db8=['STRING','BOOLEAN','sequelize'];(function(_0xb52ec4,_0x594a54){var _0xea5904=function(_0x408f97){while(--_0x408f97){_0xb52ec4['push'](_0xb52ec4['shift']());}};_0xea5904(++_0x594a54);}(_0x0db8,0x1cd));var _0x80db=function(_0x49f30e,_0xf28439){_0x49f30e=_0x49f30e-0x0;var _0x2cafd5=_0x0db8[_0x49f30e];return _0x2cafd5;};'use strict';var Sequelize=require(_0x80db('0x0'));module['exports']={'name':{'type':Sequelize[_0x80db('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x80db('0x1')]},'write':{'type':Sequelize[_0x80db('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 794c73d..df21735 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 _0x0b4e=['VIRTUAL','filter','options','includeAll','findAll','catch','show','params','length','include','body','find','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','rawAttributes','nolimit','removeMembers','addMessage','ChatGroupId','create','getMessages','$gte','split','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','localhost','socket.io-emitter','redis','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','update','then','destroy','error','stack','name','send','map','ChatGroup','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','merge'];(function(_0x42fced,_0x55d428){var _0x12c61e=function(_0x29d41b){while(--_0x29d41b){_0x42fced['push'](_0x42fced['shift']());}};_0x12c61e(++_0x55d428);}(_0x0b4e,0x7f));var _0xe0b4=function(_0xe327b1,_0x333197){_0xe327b1=_0xe327b1-0x0;var _0x364891=_0x0b4e[_0xe327b1];return _0x364891;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe0b4('0x0'));var zipdir=require(_0xe0b4('0x1'));var jsonpatch=require(_0xe0b4('0x2'));var rp=require(_0xe0b4('0x3'));var moment=require(_0xe0b4('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xe0b4('0x5'));var sox=require(_0xe0b4('0x6'));var csv=require('to-csv');var ejs=require(_0xe0b4('0x7'));var fs=require('fs');var fs_extra=require(_0xe0b4('0x8'));var _=require(_0xe0b4('0x9'));var squel=require(_0xe0b4('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe0b4('0xb'));var toCsv=require(_0xe0b4('0xc'));var querystring=require('querystring');var Papa=require(_0xe0b4('0xd'));var Redis=require(_0xe0b4('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xe0b4('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe0b4('0x10'));var logger=require('../../config/logger')(_0xe0b4('0x11'));var utils=require(_0xe0b4('0x12'));var config=require(_0xe0b4('0x13'));var licenseUtil=require(_0xe0b4('0x14'));var db=require(_0xe0b4('0x15'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xe0b4('0x16'),'port':0x18eb});var socket=require(_0xe0b4('0x17'))(new Redis(config[_0xe0b4('0x18')]));require(_0xe0b4('0x19'))[_0xe0b4('0x1a')](socket);function respondWithStatusCode(_0x4dffdc,_0x495562){_0x495562=_0x495562||0xcc;return function(_0x4bce2e){if(_0x4bce2e){return _0x4dffdc[_0xe0b4('0x1b')](_0x495562);}return _0x4dffdc[_0xe0b4('0x1c')](_0x495562)[_0xe0b4('0x1d')]();};}function respondWithResult(_0xbcdd80,_0x5cb099){_0x5cb099=_0x5cb099||0xc8;return function(_0x52ebaa){if(_0x52ebaa){return _0xbcdd80['status'](_0x5cb099)[_0xe0b4('0x1e')](_0x52ebaa);}};}function respondWithFilteredResult(_0x432fc8,_0x5d9bf0){return function(_0x54a73a){if(_0x54a73a){var _0x173522=typeof _0x5d9bf0[_0xe0b4('0x1f')]===_0xe0b4('0x20')&&typeof _0x5d9bf0['limit']==='undefined';var _0x1b1e3c=_0x54a73a[_0xe0b4('0x21')];var _0x220069=_0x173522?0x0:_0x5d9bf0[_0xe0b4('0x1f')];var _0x1a7e93=_0x173522?_0x54a73a[_0xe0b4('0x21')]:_0x5d9bf0[_0xe0b4('0x1f')]+_0x5d9bf0[_0xe0b4('0x22')];var _0x3fad9e;if(_0x1a7e93>=_0x1b1e3c){_0x1a7e93=_0x1b1e3c;_0x3fad9e=0xc8;}else{_0x3fad9e=0xce;}_0x432fc8[_0xe0b4('0x1c')](_0x3fad9e);return _0x432fc8[_0xe0b4('0x23')]('Content-Range',_0x220069+'-'+_0x1a7e93+'/'+_0x1b1e3c)['json'](_0x54a73a);}return null;};}function patchUpdates(_0x532479){return function(_0x65c20d){try{jsonpatch[_0xe0b4('0x24')](_0x65c20d,_0x532479,!![]);}catch(_0x4276d6){return BPromise[_0xe0b4('0x25')](_0x4276d6);}return _0x65c20d['save']();};}function saveUpdates(_0x1d4adb,_0x2a52c7){return function(_0x5c2332){if(_0x5c2332){return _0x5c2332[_0xe0b4('0x26')](_0x1d4adb)[_0xe0b4('0x27')](function(_0x533106){return _0x533106;});}return null;};}function removeEntity(_0x2d33e0,_0x3a06f6){return function(_0x27a6e1){if(_0x27a6e1){return _0x27a6e1[_0xe0b4('0x28')]()[_0xe0b4('0x27')](function(){_0x2d33e0['status'](0xcc)[_0xe0b4('0x1d')]();});}};}function handleEntityNotFound(_0xf459c,_0x33b99f){return function(_0xa1d4bd){if(!_0xa1d4bd){_0xf459c[_0xe0b4('0x1b')](0x194);}return _0xa1d4bd;};}function handleError(_0x12bb5f,_0x4bb78e){_0x4bb78e=_0x4bb78e||0x1f4;return function(_0x415932){logger[_0xe0b4('0x29')](_0x415932[_0xe0b4('0x2a')]);if(_0x415932[_0xe0b4('0x2b')]){delete _0x415932['name'];}_0x12bb5f[_0xe0b4('0x1c')](_0x4bb78e)[_0xe0b4('0x2c')](_0x415932);};}exports['index']=function(_0x4ae48e,_0x3a8c64){var _0x116622={},_0x2e5796={},_0x29c353={'count':0x0,'rows':[]};var _0x416950=_[_0xe0b4('0x2d')](db[_0xe0b4('0x2e')]['rawAttributes'],function(_0x301cc7){return{'name':_0x301cc7[_0xe0b4('0x2f')],'type':_0x301cc7[_0xe0b4('0x30')][_0xe0b4('0x31')]};});_0x2e5796[_0xe0b4('0x32')]=_['map'](_0x416950,'name');_0x2e5796[_0xe0b4('0x33')]=_[_0xe0b4('0x34')](_0x4ae48e['query']);_0x2e5796['filters']=_[_0xe0b4('0x35')](_0x2e5796[_0xe0b4('0x32')],_0x2e5796[_0xe0b4('0x33')]);_0x116622[_0xe0b4('0x36')]=_[_0xe0b4('0x35')](_0x2e5796['model'],qs['fields'](_0x4ae48e[_0xe0b4('0x33')][_0xe0b4('0x37')]));_0x116622[_0xe0b4('0x36')]=_0x116622[_0xe0b4('0x36')]['length']?_0x116622['attributes']:_0x2e5796[_0xe0b4('0x32')];if(!_0x4ae48e[_0xe0b4('0x33')][_0xe0b4('0x38')]('nolimit')){_0x116622['limit']=qs[_0xe0b4('0x22')](_0x4ae48e['query'][_0xe0b4('0x22')]);_0x116622['offset']=qs[_0xe0b4('0x1f')](_0x4ae48e['query'][_0xe0b4('0x1f')]);}_0x116622[_0xe0b4('0x39')]=qs[_0xe0b4('0x3a')](_0x4ae48e[_0xe0b4('0x33')]['sort']);_0x116622[_0xe0b4('0x3b')]=qs[_0xe0b4('0x3c')](_[_0xe0b4('0x3d')](_0x4ae48e[_0xe0b4('0x33')],_0x2e5796[_0xe0b4('0x3c')]),_0x416950);if(_0x4ae48e['query']['filter']){_0x116622[_0xe0b4('0x3b')]=_[_0xe0b4('0x3e')](_0x116622[_0xe0b4('0x3b')],{'$or':_[_0xe0b4('0x2d')](_0x416950,function(_0x14ca18){if(_0x14ca18[_0xe0b4('0x30')]!==_0xe0b4('0x3f')){var _0x24deb1={};_0x24deb1[_0x14ca18[_0xe0b4('0x2b')]]={'$like':'%'+_0x4ae48e[_0xe0b4('0x33')][_0xe0b4('0x40')]+'%'};return _0x24deb1;}})});}_0x116622=_[_0xe0b4('0x3e')]({},_0x116622,_0x4ae48e[_0xe0b4('0x41')]);var _0xf3e698={'where':_0x116622['where']};return db['ChatGroup'][_0xe0b4('0x21')](_0xf3e698)['then'](function(_0x399b6f){_0x29c353[_0xe0b4('0x21')]=_0x399b6f;if(_0x4ae48e[_0xe0b4('0x33')][_0xe0b4('0x42')]){_0x116622['include']=[{'all':!![]}];}return db[_0xe0b4('0x2e')][_0xe0b4('0x43')](_0x116622);})[_0xe0b4('0x27')](function(_0x29e899){_0x29c353['rows']=_0x29e899;return _0x29c353;})[_0xe0b4('0x27')](respondWithFilteredResult(_0x3a8c64,_0x116622))[_0xe0b4('0x44')](handleError(_0x3a8c64,null));};exports[_0xe0b4('0x45')]=function(_0x47d508,_0x5cf259){var _0x61082e={'raw':!![],'where':{'id':_0x47d508[_0xe0b4('0x46')]['id']}},_0x18aa76={};_0x18aa76[_0xe0b4('0x32')]=_[_0xe0b4('0x34')](db[_0xe0b4('0x2e')]['rawAttributes']);_0x18aa76[_0xe0b4('0x33')]=_['keys'](_0x47d508[_0xe0b4('0x33')]);_0x18aa76[_0xe0b4('0x3c')]=_[_0xe0b4('0x35')](_0x18aa76[_0xe0b4('0x32')],_0x18aa76[_0xe0b4('0x33')]);_0x61082e[_0xe0b4('0x36')]=_[_0xe0b4('0x35')](_0x18aa76[_0xe0b4('0x32')],qs[_0xe0b4('0x37')](_0x47d508['query']['fields']));_0x61082e[_0xe0b4('0x36')]=_0x61082e['attributes'][_0xe0b4('0x47')]?_0x61082e[_0xe0b4('0x36')]:_0x18aa76[_0xe0b4('0x32')];if(_0x47d508[_0xe0b4('0x33')][_0xe0b4('0x42')]){_0x61082e[_0xe0b4('0x48')]=[{'all':!![]}];}_0x61082e=_[_0xe0b4('0x3e')]({},_0x61082e,_0x47d508[_0xe0b4('0x41')]);return db['ChatGroup']['find'](_0x61082e)['then'](handleEntityNotFound(_0x5cf259,null))[_0xe0b4('0x27')](respondWithResult(_0x5cf259,null))['catch'](handleError(_0x5cf259,null));};exports['create']=function(_0xe6e600,_0x23778a){return db[_0xe0b4('0x2e')]['create'](_0xe6e600[_0xe0b4('0x49')],{})['then'](respondWithResult(_0x23778a,0xc9))[_0xe0b4('0x44')](handleError(_0x23778a,null));};exports[_0xe0b4('0x26')]=function(_0x348271,_0x1aa0bf){if(_0x348271['body']['id']){delete _0x348271[_0xe0b4('0x49')]['id'];}return db[_0xe0b4('0x2e')][_0xe0b4('0x4a')]({'where':{'id':_0x348271['params']['id']}})[_0xe0b4('0x27')](handleEntityNotFound(_0x1aa0bf,null))[_0xe0b4('0x27')](saveUpdates(_0x348271[_0xe0b4('0x49')],null))[_0xe0b4('0x27')](respondWithResult(_0x1aa0bf,null))['catch'](handleError(_0x1aa0bf,null));};exports[_0xe0b4('0x28')]=function(_0x34f3a5,_0x540ac7){return db[_0xe0b4('0x2e')]['find']({'where':{'id':_0x34f3a5[_0xe0b4('0x46')]['id']}})['then'](handleEntityNotFound(_0x540ac7,null))[_0xe0b4('0x27')](removeEntity(_0x540ac7,null))['catch'](handleError(_0x540ac7,null));};exports[_0xe0b4('0x4b')]=function(_0x11b03d,_0x2f831b){return db[_0xe0b4('0x2e')][_0xe0b4('0x4b')]()[_0xe0b4('0x27')](respondWithResult(_0x2f831b,null))['catch'](handleError(_0x2f831b,null));};exports[_0xe0b4('0x4c')]=function(_0x1771fe,_0x194136,_0x53bf30){return db[_0xe0b4('0x4d')][_0xe0b4('0x21')]({'where':{'ChatGroupId':_0x1771fe[_0xe0b4('0x46')]['id'],'ToId':_0x1771fe[_0xe0b4('0x4e')]['id'],'read':![]}})[_0xe0b4('0x27')](function(_0x3b7337){return{'id':_[_0xe0b4('0x4f')](_0x1771fe[_0xe0b4('0x46')]['id']),'count':_0x3b7337};})[_0xe0b4('0x27')](respondWithResult(_0x194136,null))[_0xe0b4('0x44')](handleError(_0x194136,null));};exports[_0xe0b4('0x50')]=function(_0x84a5e1,_0x576415,_0x562ac3){return db[_0xe0b4('0x2e')][_0xe0b4('0x4a')]({'where':{'id':_0x84a5e1[_0xe0b4('0x46')]['id']}})[_0xe0b4('0x27')](handleEntityNotFound(_0x576415,null))[_0xe0b4('0x27')](function(_0x3e53f4){if(_0x3e53f4){return _0x3e53f4['addMembers'](_0x84a5e1['body'][_0xe0b4('0x51')],_[_0xe0b4('0x52')](_0x84a5e1[_0xe0b4('0x49')],[_0xe0b4('0x51'),'id'])||{});}})[_0xe0b4('0x27')](respondWithResult(_0x576415,null))[_0xe0b4('0x44')](handleError(_0x576415,null));};exports[_0xe0b4('0x53')]=function(_0x556f72,_0x38dc59,_0x201988){var _0x58feea={};var _0x54a853={};var _0xdd8172;var _0x18fa0e;return db[_0xe0b4('0x2e')][_0xe0b4('0x54')]({'where':{'id':_0x556f72[_0xe0b4('0x46')]['id']}})[_0xe0b4('0x27')](handleEntityNotFound(_0x38dc59,null))[_0xe0b4('0x27')](function(_0x52f26b){if(_0x52f26b){_0xdd8172=_0x52f26b;_0x54a853[_0xe0b4('0x32')]=_[_0xe0b4('0x34')](db[_0xe0b4('0x55')][_0xe0b4('0x56')]);_0x54a853[_0xe0b4('0x33')]=_[_0xe0b4('0x34')](_0x556f72[_0xe0b4('0x33')]);_0x54a853[_0xe0b4('0x3c')]=_[_0xe0b4('0x35')](_0x54a853[_0xe0b4('0x32')],_0x54a853[_0xe0b4('0x33')]);_0x58feea[_0xe0b4('0x36')]=_['intersection'](_0x54a853[_0xe0b4('0x32')],qs['fields'](_0x556f72['query'][_0xe0b4('0x37')]));_0x58feea[_0xe0b4('0x36')]=_0x58feea['attributes'][_0xe0b4('0x47')]?_0x58feea[_0xe0b4('0x36')]:_0x54a853[_0xe0b4('0x32')];_0x58feea[_0xe0b4('0x39')]=qs[_0xe0b4('0x3a')](_0x556f72[_0xe0b4('0x33')][_0xe0b4('0x3a')]);_0x58feea[_0xe0b4('0x3b')]=qs[_0xe0b4('0x3c')](_['pick'](_0x556f72[_0xe0b4('0x33')],_0x54a853[_0xe0b4('0x3c')]));if(_0x556f72['query'][_0xe0b4('0x40')]){_0x58feea[_0xe0b4('0x3b')]=_[_0xe0b4('0x3e')](_0x58feea[_0xe0b4('0x3b')],{'$or':_[_0xe0b4('0x2d')](_0x58feea['attributes'],function(_0x1b6725){var _0x3be9be={};_0x3be9be[_0x1b6725]={'$like':'%'+_0x556f72[_0xe0b4('0x33')][_0xe0b4('0x40')]+'%'};return _0x3be9be;})});}_0x58feea=_[_0xe0b4('0x3e')]({},_0x58feea,_0x556f72[_0xe0b4('0x41')]);return _0xdd8172[_0xe0b4('0x53')](_0x58feea);}})[_0xe0b4('0x27')](function(_0x1b92c2){if(_0x1b92c2){_0x18fa0e=_0x1b92c2[_0xe0b4('0x47')];if(!_0x556f72[_0xe0b4('0x33')]['hasOwnProperty'](_0xe0b4('0x57'))){_0x58feea[_0xe0b4('0x22')]=qs[_0xe0b4('0x22')](_0x556f72[_0xe0b4('0x33')][_0xe0b4('0x22')]);_0x58feea[_0xe0b4('0x1f')]=qs[_0xe0b4('0x1f')](_0x556f72[_0xe0b4('0x33')]['offset']);}return _0xdd8172['getMembers'](_0x58feea);}})[_0xe0b4('0x27')](function(_0x125dd2){if(_0x125dd2){return _0x125dd2?{'count':_0x18fa0e,'rows':_0x125dd2}:null;}})[_0xe0b4('0x27')](respondWithResult(_0x38dc59,null))['catch'](handleError(_0x38dc59,null));};exports['removeMembers']=function(_0x4f456e,_0x7718f5,_0x39bc72){return db[_0xe0b4('0x2e')]['find']({'where':{'id':_0x4f456e['params']['id']}})[_0xe0b4('0x27')](handleEntityNotFound(_0x7718f5,null))[_0xe0b4('0x27')](function(_0x2127f7){if(_0x2127f7){return _0x2127f7[_0xe0b4('0x58')](_0x4f456e['query'][_0xe0b4('0x51')]);}})[_0xe0b4('0x27')](respondWithStatusCode(_0x7718f5,null))[_0xe0b4('0x44')](handleError(_0x7718f5,null));};exports[_0xe0b4('0x59')]=function(_0x476332,_0x3aee75,_0x376ace){if(_0x476332[_0xe0b4('0x49')]['id']){delete _0x476332[_0xe0b4('0x49')]['id'];}return db[_0xe0b4('0x2e')]['find']({'where':{'id':_0x476332['params']['id']}})[_0xe0b4('0x27')](handleEntityNotFound(_0x3aee75,null))[_0xe0b4('0x27')](function(_0x2c521e){if(_0x2c521e){_0x476332['body'][_0xe0b4('0x5a')]=_0x2c521e['id'];return db['ChatInternalMessage'][_0xe0b4('0x5b')](_0x476332['body']);}})['then'](respondWithResult(_0x3aee75,null))[_0xe0b4('0x44')](handleError(_0x3aee75,null));};exports[_0xe0b4('0x5c')]=function(_0x9038a5,_0x21a939,_0x1e9d89){var _0x59f82c={};var _0x2ca12d={};var _0x4bdf99;var _0x136a3d;return db[_0xe0b4('0x2e')][_0xe0b4('0x54')]({'where':{'id':_0x9038a5[_0xe0b4('0x46')]['id']}})[_0xe0b4('0x27')](handleEntityNotFound(_0x21a939,null))[_0xe0b4('0x27')](function(_0x4eb0ed){if(_0x4eb0ed){_0x4bdf99=_0x4eb0ed;_0x2ca12d[_0xe0b4('0x32')]=_['keys'](db[_0xe0b4('0x4d')]['rawAttributes']);_0x2ca12d[_0xe0b4('0x33')]=_[_0xe0b4('0x34')](_0x9038a5[_0xe0b4('0x33')]);_0x2ca12d[_0xe0b4('0x3c')]=_[_0xe0b4('0x35')](_0x2ca12d[_0xe0b4('0x32')],_0x2ca12d['query']);_0x59f82c['attributes']=_[_0xe0b4('0x35')](_0x2ca12d[_0xe0b4('0x32')],qs[_0xe0b4('0x37')](_0x9038a5['query']['fields']));_0x59f82c['attributes']=_0x59f82c[_0xe0b4('0x36')][_0xe0b4('0x47')]?_0x59f82c[_0xe0b4('0x36')]:_0x2ca12d[_0xe0b4('0x32')];_0x59f82c[_0xe0b4('0x39')]=qs['sort'](_0x9038a5[_0xe0b4('0x33')][_0xe0b4('0x3a')]);_0x59f82c[_0xe0b4('0x3b')]=qs['filters'](_['pick'](_0x9038a5[_0xe0b4('0x33')],_0x2ca12d['filters']));if(_0x9038a5['query'][_0xe0b4('0x40')]){_0x59f82c[_0xe0b4('0x3b')]=_[_0xe0b4('0x3e')](_0x59f82c['where'],{'$or':_['map'](_0x59f82c['attributes'],function(_0x46cb1c){var _0x22ca84={};_0x22ca84[_0x46cb1c]={'$like':'%'+_0x9038a5[_0xe0b4('0x33')]['filter']+'%'};return _0x22ca84;})});}if(_0x9038a5[_0xe0b4('0x33')]['$gte']){var _0x352203=_0x9038a5[_0xe0b4('0x33')][_0xe0b4('0x5d')][_0xe0b4('0x5e')](',');var _0x9b9392={};_0x9b9392[_0x352203[0x0]]={'$gte':moment(_0x352203[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x59f82c[_0xe0b4('0x3b')]=_[_0xe0b4('0x3e')](_0x59f82c['where'],_0x9b9392);}_0x59f82c=_[_0xe0b4('0x3e')]({},_0x59f82c,_0x9038a5[_0xe0b4('0x41')]);return _0x4bdf99['getMessages'](_0x59f82c);}})[_0xe0b4('0x27')](function(_0x15206d){if(_0x15206d){_0x136a3d=_0x15206d['length'];if(!_0x9038a5[_0xe0b4('0x33')][_0xe0b4('0x38')]('nolimit')){_0x59f82c[_0xe0b4('0x22')]=qs['limit'](_0x9038a5[_0xe0b4('0x33')][_0xe0b4('0x22')]);_0x59f82c[_0xe0b4('0x1f')]=qs[_0xe0b4('0x1f')](_0x9038a5[_0xe0b4('0x33')][_0xe0b4('0x1f')]);}return _0x4bdf99[_0xe0b4('0x5c')](_0x59f82c);}})[_0xe0b4('0x27')](function(_0x29e322){if(_0x29e322){return _0x29e322?{'count':_0x136a3d,'rows':_0x29e322}:null;}})[_0xe0b4('0x27')](respondWithResult(_0x21a939,null))[_0xe0b4('0x44')](handleError(_0x21a939,null));}; \ No newline at end of file +var _0x0786=['where','filters','merge','filter','options','includeAll','findAll','catch','show','params','length','include','find','create','body','destroy','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','omit','findOne','pick','getMembers','removeMembers','$gte','split','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','query','keys','attributes','intersection','model','fields','hasOwnProperty','nolimit','order','sort'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0786,0x148));var _0x6078=function(_0x519228,_0x2bcbc2){_0x519228=_0x519228-0x0;var _0xc3c605=_0x0786[_0x519228];return _0xc3c605;};'use strict';var emlformat=require(_0x6078('0x0'));var rimraf=require(_0x6078('0x1'));var zipdir=require(_0x6078('0x2'));var jsonpatch=require(_0x6078('0x3'));var rp=require(_0x6078('0x4'));var moment=require(_0x6078('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6078('0x6'));var util=require(_0x6078('0x7'));var path=require(_0x6078('0x8'));var sox=require(_0x6078('0x9'));var csv=require(_0x6078('0xa'));var ejs=require(_0x6078('0xb'));var fs=require('fs');var fs_extra=require(_0x6078('0xc'));var _=require(_0x6078('0xd'));var squel=require('squel');var crypto=require(_0x6078('0xe'));var jsforce=require(_0x6078('0xf'));var deskjs=require(_0x6078('0x10'));var toCsv=require(_0x6078('0xa'));var querystring=require('querystring');var Papa=require(_0x6078('0x11'));var Redis=require(_0x6078('0x12'));var authService=require(_0x6078('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x6078('0x14'));var hardwareService=require(_0x6078('0x15'));var logger=require(_0x6078('0x16'))(_0x6078('0x17'));var utils=require(_0x6078('0x18'));var config=require(_0x6078('0x19'));var licenseUtil=require(_0x6078('0x1a'));var db=require(_0x6078('0x1b'))['db'];config[_0x6078('0x1c')]=_['defaults'](config[_0x6078('0x1c')],{'host':_0x6078('0x1d'),'port':0x18eb});var socket=require(_0x6078('0x1e'))(new Redis(config[_0x6078('0x1c')]));require(_0x6078('0x1f'))[_0x6078('0x20')](socket);function respondWithStatusCode(_0xf9458b,_0xd2abdf){_0xd2abdf=_0xd2abdf||0xcc;return function(_0x26a2db){if(_0x26a2db){return _0xf9458b[_0x6078('0x21')](_0xd2abdf);}return _0xf9458b[_0x6078('0x22')](_0xd2abdf)[_0x6078('0x23')]();};}function respondWithResult(_0x4ce8d9,_0x478231){_0x478231=_0x478231||0xc8;return function(_0x2d3b4f){if(_0x2d3b4f){return _0x4ce8d9[_0x6078('0x22')](_0x478231)[_0x6078('0x24')](_0x2d3b4f);}};}function respondWithFilteredResult(_0xfe1f6f,_0x196577){return function(_0x1e6e43){if(_0x1e6e43){var _0x1ee271=typeof _0x196577[_0x6078('0x25')]==='undefined'&&typeof _0x196577['limit']===_0x6078('0x26');var _0x58309c=_0x1e6e43[_0x6078('0x27')];var _0x10415e=_0x1ee271?0x0:_0x196577[_0x6078('0x25')];var _0x2e6fa1=_0x1ee271?_0x1e6e43[_0x6078('0x27')]:_0x196577[_0x6078('0x25')]+_0x196577[_0x6078('0x28')];var _0x43149a;if(_0x2e6fa1>=_0x58309c){_0x2e6fa1=_0x58309c;_0x43149a=0xc8;}else{_0x43149a=0xce;}_0xfe1f6f['status'](_0x43149a);return _0xfe1f6f[_0x6078('0x29')](_0x6078('0x2a'),_0x10415e+'-'+_0x2e6fa1+'/'+_0x58309c)['json'](_0x1e6e43);}return null;};}function patchUpdates(_0x1552ce){return function(_0xe740c6){try{jsonpatch[_0x6078('0x2b')](_0xe740c6,_0x1552ce,!![]);}catch(_0xcb0090){return BPromise[_0x6078('0x2c')](_0xcb0090);}return _0xe740c6['save']();};}function saveUpdates(_0x2e8748,_0x48637a){return function(_0x5c62cf){if(_0x5c62cf){return _0x5c62cf[_0x6078('0x2d')](_0x2e8748)[_0x6078('0x2e')](function(_0x278af6){return _0x278af6;});}return null;};}function removeEntity(_0x143756,_0x4514ec){return function(_0x1aa8e0){if(_0x1aa8e0){return _0x1aa8e0['destroy']()[_0x6078('0x2e')](function(){_0x143756[_0x6078('0x22')](0xcc)[_0x6078('0x23')]();});}};}function handleEntityNotFound(_0x1168f9,_0x45d501){return function(_0x216c3c){if(!_0x216c3c){_0x1168f9[_0x6078('0x21')](0x194);}return _0x216c3c;};}function handleError(_0x4ef92b,_0x261caf){_0x261caf=_0x261caf||0x1f4;return function(_0xe5c01f){logger[_0x6078('0x2f')](_0xe5c01f[_0x6078('0x30')]);if(_0xe5c01f[_0x6078('0x31')]){delete _0xe5c01f[_0x6078('0x31')];}_0x4ef92b[_0x6078('0x22')](_0x261caf)[_0x6078('0x32')](_0xe5c01f);};}exports[_0x6078('0x33')]=function(_0x46799b,_0x62cd23){var _0x3ab6d7={},_0x4adba4={},_0x37e1e7={'count':0x0,'rows':[]};var _0x2faa59=_[_0x6078('0x34')](db[_0x6078('0x35')][_0x6078('0x36')],function(_0x20a084){return{'name':_0x20a084[_0x6078('0x37')],'type':_0x20a084[_0x6078('0x38')][_0x6078('0x39')]};});_0x4adba4['model']=_['map'](_0x2faa59,_0x6078('0x31'));_0x4adba4[_0x6078('0x3a')]=_[_0x6078('0x3b')](_0x46799b[_0x6078('0x3a')]);_0x4adba4['filters']=_['intersection'](_0x4adba4['model'],_0x4adba4[_0x6078('0x3a')]);_0x3ab6d7[_0x6078('0x3c')]=_[_0x6078('0x3d')](_0x4adba4[_0x6078('0x3e')],qs[_0x6078('0x3f')](_0x46799b[_0x6078('0x3a')][_0x6078('0x3f')]));_0x3ab6d7[_0x6078('0x3c')]=_0x3ab6d7[_0x6078('0x3c')]['length']?_0x3ab6d7['attributes']:_0x4adba4[_0x6078('0x3e')];if(!_0x46799b['query'][_0x6078('0x40')](_0x6078('0x41'))){_0x3ab6d7['limit']=qs[_0x6078('0x28')](_0x46799b['query'][_0x6078('0x28')]);_0x3ab6d7['offset']=qs[_0x6078('0x25')](_0x46799b[_0x6078('0x3a')][_0x6078('0x25')]);}_0x3ab6d7[_0x6078('0x42')]=qs[_0x6078('0x43')](_0x46799b[_0x6078('0x3a')][_0x6078('0x43')]);_0x3ab6d7[_0x6078('0x44')]=qs[_0x6078('0x45')](_['pick'](_0x46799b[_0x6078('0x3a')],_0x4adba4[_0x6078('0x45')]),_0x2faa59);if(_0x46799b['query']['filter']){_0x3ab6d7[_0x6078('0x44')]=_[_0x6078('0x46')](_0x3ab6d7[_0x6078('0x44')],{'$or':_[_0x6078('0x34')](_0x2faa59,function(_0x4df069){if(_0x4df069['type']!=='VIRTUAL'){var _0x28551e={};_0x28551e[_0x4df069[_0x6078('0x31')]]={'$like':'%'+_0x46799b[_0x6078('0x3a')][_0x6078('0x47')]+'%'};return _0x28551e;}})});}_0x3ab6d7=_[_0x6078('0x46')]({},_0x3ab6d7,_0x46799b[_0x6078('0x48')]);var _0x27eb05={'where':_0x3ab6d7[_0x6078('0x44')]};return db[_0x6078('0x35')][_0x6078('0x27')](_0x27eb05)[_0x6078('0x2e')](function(_0x112c3f){_0x37e1e7[_0x6078('0x27')]=_0x112c3f;if(_0x46799b[_0x6078('0x3a')][_0x6078('0x49')]){_0x3ab6d7['include']=[{'all':!![]}];}return db[_0x6078('0x35')][_0x6078('0x4a')](_0x3ab6d7);})[_0x6078('0x2e')](function(_0x22893b){_0x37e1e7['rows']=_0x22893b;return _0x37e1e7;})[_0x6078('0x2e')](respondWithFilteredResult(_0x62cd23,_0x3ab6d7))[_0x6078('0x4b')](handleError(_0x62cd23,null));};exports[_0x6078('0x4c')]=function(_0x18a8cc,_0x257543){var _0x5e4409={'raw':!![],'where':{'id':_0x18a8cc[_0x6078('0x4d')]['id']}},_0x4e07ce={};_0x4e07ce[_0x6078('0x3e')]=_[_0x6078('0x3b')](db[_0x6078('0x35')]['rawAttributes']);_0x4e07ce[_0x6078('0x3a')]=_[_0x6078('0x3b')](_0x18a8cc[_0x6078('0x3a')]);_0x4e07ce[_0x6078('0x45')]=_[_0x6078('0x3d')](_0x4e07ce[_0x6078('0x3e')],_0x4e07ce[_0x6078('0x3a')]);_0x5e4409['attributes']=_['intersection'](_0x4e07ce['model'],qs[_0x6078('0x3f')](_0x18a8cc[_0x6078('0x3a')][_0x6078('0x3f')]));_0x5e4409['attributes']=_0x5e4409[_0x6078('0x3c')][_0x6078('0x4e')]?_0x5e4409['attributes']:_0x4e07ce[_0x6078('0x3e')];if(_0x18a8cc['query']['includeAll']){_0x5e4409[_0x6078('0x4f')]=[{'all':!![]}];}_0x5e4409=_['merge']({},_0x5e4409,_0x18a8cc[_0x6078('0x48')]);return db[_0x6078('0x35')][_0x6078('0x50')](_0x5e4409)[_0x6078('0x2e')](handleEntityNotFound(_0x257543,null))[_0x6078('0x2e')](respondWithResult(_0x257543,null))[_0x6078('0x4b')](handleError(_0x257543,null));};exports[_0x6078('0x51')]=function(_0x2140ae,_0x4ace3f){return db[_0x6078('0x35')][_0x6078('0x51')](_0x2140ae[_0x6078('0x52')],{})['then'](respondWithResult(_0x4ace3f,0xc9))['catch'](handleError(_0x4ace3f,null));};exports[_0x6078('0x2d')]=function(_0x16a50b,_0x40051f){if(_0x16a50b['body']['id']){delete _0x16a50b[_0x6078('0x52')]['id'];}return db[_0x6078('0x35')][_0x6078('0x50')]({'where':{'id':_0x16a50b[_0x6078('0x4d')]['id']}})[_0x6078('0x2e')](handleEntityNotFound(_0x40051f,null))[_0x6078('0x2e')](saveUpdates(_0x16a50b[_0x6078('0x52')],null))[_0x6078('0x2e')](respondWithResult(_0x40051f,null))[_0x6078('0x4b')](handleError(_0x40051f,null));};exports[_0x6078('0x53')]=function(_0x35de86,_0x24daf7){return db[_0x6078('0x35')][_0x6078('0x50')]({'where':{'id':_0x35de86[_0x6078('0x4d')]['id']}})[_0x6078('0x2e')](handleEntityNotFound(_0x24daf7,null))['then'](removeEntity(_0x24daf7,null))[_0x6078('0x4b')](handleError(_0x24daf7,null));};exports[_0x6078('0x54')]=function(_0x278115,_0x12fc18){return db[_0x6078('0x35')][_0x6078('0x54')]()[_0x6078('0x2e')](respondWithResult(_0x12fc18,null))['catch'](handleError(_0x12fc18,null));};exports[_0x6078('0x55')]=function(_0x2dbff9,_0x292941,_0x4473c5){return db[_0x6078('0x56')]['count']({'where':{'ChatGroupId':_0x2dbff9['params']['id'],'ToId':_0x2dbff9['user']['id'],'read':![]}})[_0x6078('0x2e')](function(_0x1825c7){return{'id':_[_0x6078('0x57')](_0x2dbff9['params']['id']),'count':_0x1825c7};})[_0x6078('0x2e')](respondWithResult(_0x292941,null))[_0x6078('0x4b')](handleError(_0x292941,null));};exports['addMembers']=function(_0x4bc7fe,_0x3dffca,_0x4d53a9){return db['ChatGroup']['find']({'where':{'id':_0x4bc7fe['params']['id']}})['then'](handleEntityNotFound(_0x3dffca,null))[_0x6078('0x2e')](function(_0x47a4e5){if(_0x47a4e5){return _0x47a4e5[_0x6078('0x58')](_0x4bc7fe['body'][_0x6078('0x59')],_[_0x6078('0x5a')](_0x4bc7fe[_0x6078('0x52')],[_0x6078('0x59'),'id'])||{});}})['then'](respondWithResult(_0x3dffca,null))[_0x6078('0x4b')](handleError(_0x3dffca,null));};exports['getMembers']=function(_0x179bef,_0x4ba0f2,_0x32afea){var _0x7da3e0={};var _0x17e8bc={};var _0x554c0a;var _0x552389;return db[_0x6078('0x35')][_0x6078('0x5b')]({'where':{'id':_0x179bef[_0x6078('0x4d')]['id']}})[_0x6078('0x2e')](handleEntityNotFound(_0x4ba0f2,null))[_0x6078('0x2e')](function(_0x3a324e){if(_0x3a324e){_0x554c0a=_0x3a324e;_0x17e8bc[_0x6078('0x3e')]=_[_0x6078('0x3b')](db['User']['rawAttributes']);_0x17e8bc[_0x6078('0x3a')]=_[_0x6078('0x3b')](_0x179bef[_0x6078('0x3a')]);_0x17e8bc[_0x6078('0x45')]=_[_0x6078('0x3d')](_0x17e8bc[_0x6078('0x3e')],_0x17e8bc[_0x6078('0x3a')]);_0x7da3e0[_0x6078('0x3c')]=_[_0x6078('0x3d')](_0x17e8bc[_0x6078('0x3e')],qs[_0x6078('0x3f')](_0x179bef[_0x6078('0x3a')][_0x6078('0x3f')]));_0x7da3e0['attributes']=_0x7da3e0[_0x6078('0x3c')][_0x6078('0x4e')]?_0x7da3e0[_0x6078('0x3c')]:_0x17e8bc[_0x6078('0x3e')];_0x7da3e0[_0x6078('0x42')]=qs[_0x6078('0x43')](_0x179bef['query']['sort']);_0x7da3e0['where']=qs['filters'](_[_0x6078('0x5c')](_0x179bef[_0x6078('0x3a')],_0x17e8bc[_0x6078('0x45')]));if(_0x179bef[_0x6078('0x3a')][_0x6078('0x47')]){_0x7da3e0['where']=_[_0x6078('0x46')](_0x7da3e0[_0x6078('0x44')],{'$or':_[_0x6078('0x34')](_0x7da3e0[_0x6078('0x3c')],function(_0x5abdc0){var _0x512245={};_0x512245[_0x5abdc0]={'$like':'%'+_0x179bef['query'][_0x6078('0x47')]+'%'};return _0x512245;})});}_0x7da3e0=_['merge']({},_0x7da3e0,_0x179bef[_0x6078('0x48')]);return _0x554c0a[_0x6078('0x5d')](_0x7da3e0);}})[_0x6078('0x2e')](function(_0x33f980){if(_0x33f980){_0x552389=_0x33f980[_0x6078('0x4e')];if(!_0x179bef[_0x6078('0x3a')]['hasOwnProperty'](_0x6078('0x41'))){_0x7da3e0['limit']=qs[_0x6078('0x28')](_0x179bef[_0x6078('0x3a')][_0x6078('0x28')]);_0x7da3e0[_0x6078('0x25')]=qs[_0x6078('0x25')](_0x179bef[_0x6078('0x3a')]['offset']);}return _0x554c0a[_0x6078('0x5d')](_0x7da3e0);}})['then'](function(_0x2b7d38){if(_0x2b7d38){return _0x2b7d38?{'count':_0x552389,'rows':_0x2b7d38}:null;}})['then'](respondWithResult(_0x4ba0f2,null))[_0x6078('0x4b')](handleError(_0x4ba0f2,null));};exports['removeMembers']=function(_0x5db757,_0x173bd8,_0x38be01){return db[_0x6078('0x35')][_0x6078('0x50')]({'where':{'id':_0x5db757[_0x6078('0x4d')]['id']}})[_0x6078('0x2e')](handleEntityNotFound(_0x173bd8,null))[_0x6078('0x2e')](function(_0xa20566){if(_0xa20566){return _0xa20566[_0x6078('0x5e')](_0x5db757[_0x6078('0x3a')][_0x6078('0x59')]);}})['then'](respondWithStatusCode(_0x173bd8,null))['catch'](handleError(_0x173bd8,null));};exports['addMessage']=function(_0x4dbd01,_0x21c8ce,_0x5ae18c){if(_0x4dbd01[_0x6078('0x52')]['id']){delete _0x4dbd01[_0x6078('0x52')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0x4dbd01['params']['id']}})['then'](handleEntityNotFound(_0x21c8ce,null))['then'](function(_0x1eab83){if(_0x1eab83){_0x4dbd01[_0x6078('0x52')]['ChatGroupId']=_0x1eab83['id'];return db[_0x6078('0x56')][_0x6078('0x51')](_0x4dbd01[_0x6078('0x52')]);}})[_0x6078('0x2e')](respondWithResult(_0x21c8ce,null))[_0x6078('0x4b')](handleError(_0x21c8ce,null));};exports['getMessages']=function(_0x1c5965,_0x3bbd8f,_0x397ddb){var _0x5ad212={};var _0x3dbe6a={};var _0x439274;var _0x4f2a04;return db[_0x6078('0x35')][_0x6078('0x5b')]({'where':{'id':_0x1c5965[_0x6078('0x4d')]['id']}})[_0x6078('0x2e')](handleEntityNotFound(_0x3bbd8f,null))['then'](function(_0x27f14d){if(_0x27f14d){_0x439274=_0x27f14d;_0x3dbe6a[_0x6078('0x3e')]=_['keys'](db[_0x6078('0x56')][_0x6078('0x36')]);_0x3dbe6a[_0x6078('0x3a')]=_[_0x6078('0x3b')](_0x1c5965[_0x6078('0x3a')]);_0x3dbe6a[_0x6078('0x45')]=_[_0x6078('0x3d')](_0x3dbe6a['model'],_0x3dbe6a[_0x6078('0x3a')]);_0x5ad212[_0x6078('0x3c')]=_[_0x6078('0x3d')](_0x3dbe6a[_0x6078('0x3e')],qs[_0x6078('0x3f')](_0x1c5965[_0x6078('0x3a')][_0x6078('0x3f')]));_0x5ad212[_0x6078('0x3c')]=_0x5ad212[_0x6078('0x3c')][_0x6078('0x4e')]?_0x5ad212[_0x6078('0x3c')]:_0x3dbe6a['model'];_0x5ad212[_0x6078('0x42')]=qs[_0x6078('0x43')](_0x1c5965[_0x6078('0x3a')][_0x6078('0x43')]);_0x5ad212[_0x6078('0x44')]=qs[_0x6078('0x45')](_[_0x6078('0x5c')](_0x1c5965['query'],_0x3dbe6a[_0x6078('0x45')]));if(_0x1c5965[_0x6078('0x3a')][_0x6078('0x47')]){_0x5ad212[_0x6078('0x44')]=_[_0x6078('0x46')](_0x5ad212[_0x6078('0x44')],{'$or':_[_0x6078('0x34')](_0x5ad212[_0x6078('0x3c')],function(_0x24e63c){var _0x30413f={};_0x30413f[_0x24e63c]={'$like':'%'+_0x1c5965[_0x6078('0x3a')]['filter']+'%'};return _0x30413f;})});}if(_0x1c5965['query'][_0x6078('0x5f')]){var _0x3d8f07=_0x1c5965['query'][_0x6078('0x5f')][_0x6078('0x60')](',');var _0x32c48a={};_0x32c48a[_0x3d8f07[0x0]]={'$gte':moment(_0x3d8f07[0x1])['format'](_0x6078('0x61'))};_0x5ad212['where']=_['merge'](_0x5ad212[_0x6078('0x44')],_0x32c48a);}_0x5ad212=_[_0x6078('0x46')]({},_0x5ad212,_0x1c5965[_0x6078('0x48')]);return _0x439274[_0x6078('0x62')](_0x5ad212);}})[_0x6078('0x2e')](function(_0x2fa9a6){if(_0x2fa9a6){_0x4f2a04=_0x2fa9a6['length'];if(!_0x1c5965[_0x6078('0x3a')][_0x6078('0x40')](_0x6078('0x41'))){_0x5ad212[_0x6078('0x28')]=qs['limit'](_0x1c5965['query'][_0x6078('0x28')]);_0x5ad212[_0x6078('0x25')]=qs['offset'](_0x1c5965[_0x6078('0x3a')][_0x6078('0x25')]);}return _0x439274['getMessages'](_0x5ad212);}})[_0x6078('0x2e')](function(_0x535e40){if(_0x535e40){return _0x535e40?{'count':_0x4f2a04,'rows':_0x535e40}:null;}})[_0x6078('0x2e')](respondWithResult(_0x3bbd8f,null))['catch'](handleError(_0x3bbd8f,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index cfb1948..e6f9703 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 _0x2186=['update','remove','emit','events','save'];(function(_0x38569a,_0x1279f2){var _0x5aa538=function(_0xc7747f){while(--_0xc7747f){_0x38569a['push'](_0x38569a['shift']());}};_0x5aa538(++_0x1279f2);}(_0x2186,0x1ca));var _0x6218=function(_0x41c011,_0x49be6f){_0x41c011=_0x41c011-0x0;var _0x2bbb98=_0x2186[_0x41c011];return _0x2bbb98;};'use strict';var EventEmitter=require(_0x6218('0x0'));var ChatGroup=require('../../mysqldb')['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6218('0x1'),'afterUpdate':_0x6218('0x2'),'afterDestroy':_0x6218('0x3')};function emitEvent(_0x587b23){return function(_0x10aa49,_0x1bc6b1,_0x2b0e28){ChatGroupEvents[_0x6218('0x4')](_0x587b23+':'+_0x10aa49['id'],_0x10aa49);ChatGroupEvents[_0x6218('0x4')](_0x587b23,_0x10aa49);_0x2b0e28(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file +var _0xd5c8=['exports','ChatGroup','setMaxListeners','save','update','remove','emit'];(function(_0x364b32,_0x4dec35){var _0x3f3ea0=function(_0x1911a8){while(--_0x1911a8){_0x364b32['push'](_0x364b32['shift']());}};_0x3f3ea0(++_0x4dec35);}(_0xd5c8,0x166));var _0x8d5c=function(_0x146837,_0x2aa6a2){_0x146837=_0x146837-0x0;var _0x3d7e60=_0xd5c8[_0x146837];return _0x3d7e60;};'use strict';var EventEmitter=require('events');var ChatGroup=require('../../mysqldb')['db'][_0x8d5c('0x0')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x8d5c('0x1')](0x0);var events={'afterCreate':_0x8d5c('0x2'),'afterUpdate':_0x8d5c('0x3'),'afterDestroy':_0x8d5c('0x4')};function emitEvent(_0x2c6d78){return function(_0xf26b15,_0x3dbbfc,_0x885e2){ChatGroupEvents['emit'](_0x2c6d78+':'+_0xf26b15['id'],_0xf26b15);ChatGroupEvents[_0x8d5c('0x5')](_0x2c6d78,_0xf26b15);_0x885e2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x8d5c('0x6')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 1459413..1ec8bbe 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 _0xce54=['../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash','moment','bluebird','request-promise','rimraf'];(function(_0x2503dc,_0x24d155){var _0x317eb8=function(_0x41c240){while(--_0x41c240){_0x2503dc['push'](_0x2503dc['shift']());}};_0x317eb8(++_0x24d155);}(_0xce54,0x1c9));var _0x4ce5=function(_0x34c7f3,_0x530552){_0x34c7f3=_0x34c7f3-0x0;var _0x45f682=_0xce54[_0x34c7f3];return _0x45f682;};'use strict';var _=require(_0x4ce5('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x4ce5('0x1'));var BPromise=require(_0x4ce5('0x2'));var rp=require(_0x4ce5('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4ce5('0x4'));var config=require(_0x4ce5('0x5'));var attributes=require(_0x4ce5('0x6'));module[_0x4ce5('0x7')]=function(_0x4ebfe4,_0x389848){return _0x4ebfe4[_0x4ce5('0x8')](_0x4ce5('0x9'),attributes,{'tableName':_0x4ce5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3695=['request-promise','rimraf','../../config/environment','./chatGroup.attributes','define','chat_groups','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x3695,0xf6));var _0x5369=function(_0x506291,_0x3e8323){_0x506291=_0x506291-0x0;var _0x1e1b8b=_0x3695[_0x506291];return _0x1e1b8b;};'use strict';var _=require(_0x5369('0x0'));var util=require(_0x5369('0x1'));var logger=require(_0x5369('0x2'))(_0x5369('0x3'));var moment=require(_0x5369('0x4'));var BPromise=require(_0x5369('0x5'));var rp=require(_0x5369('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5369('0x7'));var config=require(_0x5369('0x8'));var attributes=require(_0x5369('0x9'));module['exports']=function(_0x34308e,_0x5e37b2){return _0x34308e[_0x5369('0xa')]('ChatGroup',attributes,{'tableName':_0x5369('0xb'),'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 f4f0a1c..85d0f30 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 _0x1670=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util'];(function(_0xc5e02a,_0xd9da3c){var _0xbeca77=function(_0x2a7d11){while(--_0x2a7d11){_0xc5e02a['push'](_0xc5e02a['shift']());}};_0xbeca77(++_0xd9da3c);}(_0x1670,0x9a));var _0x0167=function(_0x1c3bb1,_0x5a7c99){_0x1c3bb1=_0x1c3bb1-0x0;var _0xf6cc1d=_0x1670[_0x1c3bb1];return _0xf6cc1d;};'use strict';var _=require(_0x0167('0x0'));var util=require(_0x0167('0x1'));var moment=require('moment');var BPromise=require(_0x0167('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0167('0x3'));var db=require(_0x0167('0x4'))['db'];var utils=require(_0x0167('0x5'));var logger=require(_0x0167('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0167('0x7'));var client=jayson[_0x0167('0x8')][_0x0167('0x9')]({'port':0x232a});config[_0x0167('0xa')]=_[_0x0167('0xb')](config[_0x0167('0xa')],{'host':_0x0167('0xc'),'port':0x18eb});var socket=require(_0x0167('0xd'))(new Redis(config['redis']));require('./chatGroup.socket')[_0x0167('0xe')](socket);function respondWithRpcPromise(_0x178f5f,_0x2b88ec,_0x1632d4){return new BPromise(function(_0x338288,_0x364dc7){return client[_0x0167('0xf')](_0x178f5f,_0x1632d4)[_0x0167('0x10')](function(_0x257ed6){logger[_0x0167('0x11')](_0x0167('0x12'),_0x2b88ec,_0x0167('0x13'));logger[_0x0167('0x14')](_0x0167('0x15'),_0x2b88ec,'request\x20sent',JSON[_0x0167('0x16')](_0x257ed6));if(_0x257ed6['error']){if(_0x257ed6[_0x0167('0x17')]['code']===0x1f4){logger[_0x0167('0x17')](_0x0167('0x12'),_0x2b88ec,_0x257ed6[_0x0167('0x17')]['message']);return _0x364dc7(_0x257ed6['error']['message']);}logger[_0x0167('0x17')](_0x0167('0x12'),_0x2b88ec,_0x257ed6['error'][_0x0167('0x18')]);return _0x338288(_0x257ed6['error']['message']);}else{logger[_0x0167('0x11')]('ChatGroup,\x20%s,\x20%s',_0x2b88ec,_0x0167('0x13'));_0x338288(_0x257ed6['result'][_0x0167('0x18')]);}})[_0x0167('0x19')](function(_0x170207){logger[_0x0167('0x17')](_0x0167('0x12'),_0x2b88ec,_0x170207);_0x364dc7(_0x170207);});});} \ No newline at end of file +var _0x4499=['catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x376971,_0x3d9579){var _0x2286ff=function(_0x10c7db){while(--_0x10c7db){_0x376971['push'](_0x376971['shift']());}};_0x2286ff(++_0x3d9579);}(_0x4499,0x145));var _0x9449=function(_0x5649c2,_0x5c8d04){_0x5649c2=_0x5649c2-0x0;var _0x28b072=_0x4499[_0x5649c2];return _0x28b072;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9449('0x0'));var BPromise=require(_0x9449('0x1'));var rs=require(_0x9449('0x2'));var fs=require('fs');var Redis=require(_0x9449('0x3'));var db=require(_0x9449('0x4'))['db'];var utils=require(_0x9449('0x5'));var logger=require('../../config/logger')(_0x9449('0x6'));var config=require(_0x9449('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9449('0x8')]({'port':0x232a});config[_0x9449('0x9')]=_[_0x9449('0xa')](config[_0x9449('0x9')],{'host':_0x9449('0xb'),'port':0x18eb});var socket=require(_0x9449('0xc'))(new Redis(config['redis']));require(_0x9449('0xd'))[_0x9449('0xe')](socket);function respondWithRpcPromise(_0xe7ec09,_0x1c34d0,_0x7784bd){return new BPromise(function(_0x5ad461,_0x405dc5){return client[_0x9449('0xf')](_0xe7ec09,_0x7784bd)[_0x9449('0x10')](function(_0x5d903e){logger[_0x9449('0x11')](_0x9449('0x12'),_0x1c34d0,_0x9449('0x13'));logger[_0x9449('0x14')](_0x9449('0x15'),_0x1c34d0,_0x9449('0x13'),JSON[_0x9449('0x16')](_0x5d903e));if(_0x5d903e[_0x9449('0x17')]){if(_0x5d903e[_0x9449('0x17')][_0x9449('0x18')]===0x1f4){logger[_0x9449('0x17')](_0x9449('0x12'),_0x1c34d0,_0x5d903e[_0x9449('0x17')][_0x9449('0x19')]);return _0x405dc5(_0x5d903e[_0x9449('0x17')][_0x9449('0x19')]);}logger[_0x9449('0x17')](_0x9449('0x12'),_0x1c34d0,_0x5d903e[_0x9449('0x17')][_0x9449('0x19')]);return _0x5ad461(_0x5d903e[_0x9449('0x17')]['message']);}else{logger['info'](_0x9449('0x12'),_0x1c34d0,_0x9449('0x13'));_0x5ad461(_0x5d903e['result'][_0x9449('0x19')]);}})[_0x9449('0x1a')](function(_0x2b76c8){logger[_0x9449('0x17')](_0x9449('0x12'),_0x1c34d0,_0x2b76c8);_0x405dc5(_0x2b76c8);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index ad62b6a..40e0531 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 _0x7182=['save','update','emit','removeListener','length','./chatGroup.events'];(function(_0x16ecd6,_0x23b605){var _0x4c4cf9=function(_0xd85893){while(--_0xd85893){_0x16ecd6['push'](_0x16ecd6['shift']());}};_0x4c4cf9(++_0x23b605);}(_0x7182,0xb9));var _0x2718=function(_0x4d0c0c,_0x4f82e8){_0x4d0c0c=_0x4d0c0c-0x0;var _0x5bbee8=_0x7182[_0x4d0c0c];return _0x5bbee8;};'use strict';var ChatGroupEvents=require(_0x2718('0x0'));var events=[_0x2718('0x1'),'remove',_0x2718('0x2')];function createListener(_0x11e8d1,_0x1f019f){return function(_0x1eb4e9){_0x1f019f[_0x2718('0x3')](_0x11e8d1,_0x1eb4e9);};}function removeListener(_0x2bfc07,_0x37edf7){return function(){ChatGroupEvents[_0x2718('0x4')](_0x2bfc07,_0x37edf7);};}exports['register']=function(_0x570198){for(var _0x2d8340=0x0,_0x3842ce=events[_0x2718('0x5')];_0x2d8340<_0x3842ce;_0x2d8340++){var _0x218771=events[_0x2d8340];var _0x144dbc=createListener('chatGroup:'+_0x218771,_0x570198);ChatGroupEvents['on'](_0x218771,_0x144dbc);}}; \ No newline at end of file +var _0xd4dd=['chatGroup:','save','remove','update','emit','removeListener','register','length'];(function(_0x3a73ab,_0x1bcf37){var _0x536d2c=function(_0x411599){while(--_0x411599){_0x3a73ab['push'](_0x3a73ab['shift']());}};_0x536d2c(++_0x1bcf37);}(_0xd4dd,0x71));var _0xdd4d=function(_0x10969f,_0x2617be){_0x10969f=_0x10969f-0x0;var _0x123e98=_0xd4dd[_0x10969f];return _0x123e98;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0xdd4d('0x0'),_0xdd4d('0x1'),_0xdd4d('0x2')];function createListener(_0x58f823,_0x54eb9a){return function(_0x2f59b9){_0x54eb9a[_0xdd4d('0x3')](_0x58f823,_0x2f59b9);};}function removeListener(_0x5d50b9,_0x10163e){return function(){ChatGroupEvents[_0xdd4d('0x4')](_0x5d50b9,_0x10163e);};}exports[_0xdd4d('0x5')]=function(_0x5b53e1){for(var _0x39a29b=0x0,_0x3815a5=events[_0xdd4d('0x6')];_0x39a29b<_0x3815a5;_0x39a29b++){var _0x17ef90=events[_0x39a29b];var _0x561f13=createListener(_0xdd4d('0x7')+_0x17ef90,_0x5b53e1);ChatGroupEvents['on'](_0x17ef90,_0x561f13);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index b4cf03b..104df76 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 _0xcdcc=['getMessages','post','create','addMembers','addMessage','update','delete','destroy','removeMembers','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','/describe','get','/:id','show','getUnread','/:id/members','getMembers','/:id/messages'];(function(_0x55e58c,_0x5278e9){var _0x32ce31=function(_0x4098d2){while(--_0x4098d2){_0x55e58c['push'](_0x55e58c['shift']());}};_0x32ce31(++_0x5278e9);}(_0xcdcc,0x13e));var _0xccdc=function(_0x5657ed,_0x48f5cb){_0x5657ed=_0x5657ed-0x0;var _0x23b0d8=_0xcdcc[_0x5657ed];return _0x23b0d8;};'use strict';var multer=require(_0xccdc('0x0'));var util=require(_0xccdc('0x1'));var path=require(_0xccdc('0x2'));var timeout=require(_0xccdc('0x3'));var express=require(_0xccdc('0x4'));var router=express['Router']();var fs_extra=require(_0xccdc('0x5'));var auth=require(_0xccdc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xccdc('0x7'));var controller=require('./chatGroup.controller');router['get']('/',auth[_0xccdc('0x8')](),controller[_0xccdc('0x9')]);router['get'](_0xccdc('0xa'),auth[_0xccdc('0x8')](),controller['describe']);router[_0xccdc('0xb')](_0xccdc('0xc'),auth[_0xccdc('0x8')](),controller[_0xccdc('0xd')]);router[_0xccdc('0xb')]('/:id/unread',auth[_0xccdc('0x8')](),controller[_0xccdc('0xe')]);router['get'](_0xccdc('0xf'),auth[_0xccdc('0x8')](),controller[_0xccdc('0x10')]);router[_0xccdc('0xb')](_0xccdc('0x11'),auth['isAuthenticated'](),controller[_0xccdc('0x12')]);router[_0xccdc('0x13')]('/',auth[_0xccdc('0x8')](),controller[_0xccdc('0x14')]);router[_0xccdc('0x13')](_0xccdc('0xf'),auth[_0xccdc('0x8')](),controller[_0xccdc('0x15')]);router[_0xccdc('0x13')](_0xccdc('0x11'),auth[_0xccdc('0x8')](),controller[_0xccdc('0x16')]);router['put'](_0xccdc('0xc'),auth[_0xccdc('0x8')](),controller[_0xccdc('0x17')]);router[_0xccdc('0x18')](_0xccdc('0xc'),auth['isAuthenticated'](),controller[_0xccdc('0x19')]);router[_0xccdc('0x18')]('/:id/members',auth[_0xccdc('0x8')](),controller[_0xccdc('0x1a')]);module[_0xccdc('0x1b')]=router; \ No newline at end of file +var _0x10bd=['express','../../components/auth/service','../../config/environment','isAuthenticated','index','/describe','describe','get','/:id','show','/:id/unread','getUnread','getMembers','/:id/messages','getMessages','create','post','/:id/members','addMembers','addMessage','update','delete','destroy','util','path','connect-timeout'];(function(_0x28237e,_0x2a7f11){var _0x1c014b=function(_0xaa0d6d){while(--_0xaa0d6d){_0x28237e['push'](_0x28237e['shift']());}};_0x1c014b(++_0x2a7f11);}(_0x10bd,0x1b7));var _0xd10b=function(_0xf663ee,_0xc6fefb){_0xf663ee=_0xf663ee-0x0;var _0x424e0a=_0x10bd[_0xf663ee];return _0x424e0a;};'use strict';var multer=require('multer');var util=require(_0xd10b('0x0'));var path=require(_0xd10b('0x1'));var timeout=require(_0xd10b('0x2'));var express=require(_0xd10b('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd10b('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xd10b('0x5'));var controller=require('./chatGroup.controller');router['get']('/',auth[_0xd10b('0x6')](),controller[_0xd10b('0x7')]);router['get'](_0xd10b('0x8'),auth[_0xd10b('0x6')](),controller[_0xd10b('0x9')]);router[_0xd10b('0xa')](_0xd10b('0xb'),auth[_0xd10b('0x6')](),controller[_0xd10b('0xc')]);router[_0xd10b('0xa')](_0xd10b('0xd'),auth[_0xd10b('0x6')](),controller[_0xd10b('0xe')]);router[_0xd10b('0xa')]('/:id/members',auth[_0xd10b('0x6')](),controller[_0xd10b('0xf')]);router[_0xd10b('0xa')](_0xd10b('0x10'),auth[_0xd10b('0x6')](),controller[_0xd10b('0x11')]);router['post']('/',auth[_0xd10b('0x6')](),controller[_0xd10b('0x12')]);router[_0xd10b('0x13')](_0xd10b('0x14'),auth[_0xd10b('0x6')](),controller[_0xd10b('0x15')]);router[_0xd10b('0x13')](_0xd10b('0x10'),auth[_0xd10b('0x6')](),controller[_0xd10b('0x16')]);router['put']('/:id',auth[_0xd10b('0x6')](),controller[_0xd10b('0x17')]);router[_0xd10b('0x18')](_0xd10b('0xb'),auth['isAuthenticated'](),controller[_0xd10b('0x19')]);router[_0xd10b('0x18')](_0xd10b('0x14'),auth[_0xd10b('0x6')](),controller['removeMembers']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index afb0a5f..5075ad3 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 _0x4e81=['DATE','long','ENUM','out','sequelize','exports','BOOLEAN','thumb','star','TEXT','STRING'];(function(_0x1f60c2,_0x361dfd){var _0x2958f8=function(_0x3ecdf6){while(--_0x3ecdf6){_0x1f60c2['push'](_0x1f60c2['shift']());}};_0x2958f8(++_0x361dfd);}(_0x4e81,0x1bc));var _0x14e8=function(_0x52ea08,_0x15d935){_0x52ea08=_0x52ea08-0x0;var _0x28d546=_0x4e81[_0x52ea08];return _0x28d546;};'use strict';var Sequelize=require(_0x14e8('0x0'));module[_0x14e8('0x1')]={'closed':{'type':Sequelize[_0x14e8('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize['ENUM']('star',_0x14e8('0x3')),'defaultValue':_0x14e8('0x4')},'ratingMessage':{'type':Sequelize[_0x14e8('0x5')]},'pathTranscript':{'type':Sequelize[_0x14e8('0x5')]},'mailTranscript':{'type':Sequelize[_0x14e8('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x14e8('0x7')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x14e8('0x6')]},'note':{'type':Sequelize[_0x14e8('0x6')]},'browserName':{'type':Sequelize[_0x14e8('0x6')]},'browserVersion':{'type':Sequelize[_0x14e8('0x6')]},'osName':{'type':Sequelize[_0x14e8('0x6')]},'osVersion':{'type':Sequelize[_0x14e8('0x6')]},'deviceModel':{'type':Sequelize[_0x14e8('0x6')]},'deviceVendor':{'type':Sequelize[_0x14e8('0x6')]},'deviceType':{'type':Sequelize[_0x14e8('0x6')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x14e8('0x6')]},'formData':{'type':Sequelize[_0x14e8('0x5')](_0x14e8('0x8'))},'read1stAt':{'type':Sequelize[_0x14e8('0x7')]},'lastMsgAt':{'type':Sequelize[_0x14e8('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x14e8('0x9')]('in',_0x14e8('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x14e8('0x6')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x14e8('0x5')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xbcff=['TEXT','STRING','long','DATE','out','sequelize','exports','BOOLEAN','ENUM','star','thumb'];(function(_0x284c96,_0x3e1bec){var _0xbdbb1e=function(_0xb9050){while(--_0xb9050){_0x284c96['push'](_0x284c96['shift']());}};_0xbdbb1e(++_0x3e1bec);}(_0xbcff,0x12e));var _0xfbcf=function(_0xa9b620,_0x239db7){_0xa9b620=_0xa9b620-0x0;var _0x4b8b22=_0xbcff[_0xa9b620];return _0x4b8b22;};'use strict';var Sequelize=require(_0xfbcf('0x0'));module[_0xfbcf('0x1')]={'closed':{'type':Sequelize[_0xfbcf('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0xfbcf('0x3')](_0xfbcf('0x4'),_0xfbcf('0x5')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0xfbcf('0x6')]},'pathTranscript':{'type':Sequelize[_0xfbcf('0x6')]},'mailTranscript':{'type':Sequelize[_0xfbcf('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xfbcf('0x7')]},'secondDisposition':{'type':Sequelize[_0xfbcf('0x7')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xfbcf('0x7')]},'browserName':{'type':Sequelize[_0xfbcf('0x7')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0xfbcf('0x7')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0xfbcf('0x7')]},'deviceVendor':{'type':Sequelize[_0xfbcf('0x7')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0xfbcf('0x7')]},'formData':{'type':Sequelize[_0xfbcf('0x6')](_0xfbcf('0x8'))},'read1stAt':{'type':Sequelize[_0xfbcf('0x9')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xfbcf('0x3')]('in',_0xfbcf('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xfbcf('0x7')]},'customerPort':{'type':Sequelize[_0xfbcf('0x7')]},'vidaooSessionId':{'type':Sequelize[_0xfbcf('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0xfbcf('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index cdced43..697b16d 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 _0x6b2b=['pick','YYYY-MM-DD\x20HH:mm:ss','options','findAll','getMyMessages','includeAgent','spread','emit','chatInteractionTags:save','removeTags','server','files','tmp','transcript-%d-%s.zip','lastName','Account','Owner','get','Chat','osName','referer','N.A.','tail','existsSync','createReadStream','pipe','firstName','renderFile','views','downloadInteraction.ejs','.pdf','log','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','request\x20sent','debug','stringify','error','ChatInteraction,\x20%s,\x20%s','message','info','result','sendStatus','end','status','offset','limit','undefined','count','Content-Range','apply','reject','update','then','destroy','stack','name','render','merge','contact','interaction','Users','TagIds','Tags','split','forEach','push','catch','waiting','unmanaged','abandoned','total','UserId','talking','closed','disposition','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','field','color','from','tools_tags','select','u.fullname','ui.ChatInteractionId','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','conditions','find','unreadMessages','`\x20=\x200','having','`\x20>\x200','Contact','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','keys','some','compact','isEmpty','ChatWebsiteId','concat','createdAt','parse','$gte','$lte','null','\x20=\x20?','read','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','clone','contactName','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','agent','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','sequelize','toString','keyBy','ChatInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','show','params','includeAll','include','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','account','isNull','follow','metadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','out','ChatMessage','create','customUpdate','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','AbandonInteraction','attachmentUpload','file','originalname','filename','mimetype','Attachment','attachmentDownload','json','Unauthorized','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','basename','download','close','mailTranscript','root','format','now','pathTranscript','Messages','CmContact','agentAlias','customer','Visitor','agentIdentifier','%s%d','System','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailServerOut','Smtp','service','host','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit'];(function(_0x4c445a,_0x4ee80f){var _0x2f611c=function(_0x4f3699){while(--_0x4f3699){_0x4c445a['push'](_0x4c445a['shift']());}};_0x2f611c(++_0x4ee80f);}(_0x6b2b,0x159));var _0xb6b2=function(_0x1abb09,_0x18ee91){_0x1abb09=_0x1abb09-0x0;var _0xea1c07=_0x6b2b[_0x1abb09];return _0xea1c07;};'use strict';var emlformat=require(_0xb6b2('0x0'));var rimraf=require(_0xb6b2('0x1'));var zipdir=require(_0xb6b2('0x2'));var jsonpatch=require(_0xb6b2('0x3'));var rp=require(_0xb6b2('0x4'));var moment=require(_0xb6b2('0x5'));var BPromise=require(_0xb6b2('0x6'));var Mustache=require('mustache');var util=require(_0xb6b2('0x7'));var path=require(_0xb6b2('0x8'));var sox=require('sox');var csv=require(_0xb6b2('0x9'));var ejs=require(_0xb6b2('0xa'));var fs=require('fs');var fs_extra=require(_0xb6b2('0xb'));var _=require(_0xb6b2('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb6b2('0xd'));var toCsv=require(_0xb6b2('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb6b2('0xe'));var authService=require(_0xb6b2('0xf'));var qs=require(_0xb6b2('0x10'));var as=require('../../components/parsers/advancedSearch');var pdf=require('../../components/export/pdf');var hardwareService=require(_0xb6b2('0x11'));var logger=require(_0xb6b2('0x12'))(_0xb6b2('0x13'));var utils=require(_0xb6b2('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xb6b2('0x15')]=_['defaults'](config['redis'],{'host':_0xb6b2('0x16'),'port':0x18eb});var socket=require(_0xb6b2('0x17'))(new Redis(config[_0xb6b2('0x15')]));require('./chatInteraction.socket')[_0xb6b2('0x18')](socket);var jayson=require(_0xb6b2('0x19'));var client=jayson[_0xb6b2('0x1a')][_0xb6b2('0x1b')]({'port':0x232b});var client9004=jayson[_0xb6b2('0x1a')][_0xb6b2('0x1b')]({'port':0x232c});function respondWithRpcPromise(_0x1df918,_0xf772c1,_0x3c404f,_0x486b34){return new BPromise(function(_0x4ad7d8,_0x190814){var _0x5de903=_0x486b34||client;return _0x5de903[_0xb6b2('0x1c')](_0x1df918,_0x3c404f)['then'](function(_0x559b69){logger['info']('ChatInteraction,\x20%s,\x20%s',_0xf772c1,_0xb6b2('0x1d'));logger[_0xb6b2('0x1e')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0xf772c1,_0xb6b2('0x1d'),JSON[_0xb6b2('0x1f')](_0x559b69));if(_0x559b69[_0xb6b2('0x20')]){if(_0x559b69[_0xb6b2('0x20')]['code']===0x1f4){logger[_0xb6b2('0x20')](_0xb6b2('0x21'),_0xf772c1,_0x559b69[_0xb6b2('0x20')][_0xb6b2('0x22')]);return _0x190814(_0x559b69[_0xb6b2('0x20')]['message']);}logger[_0xb6b2('0x20')](_0xb6b2('0x21'),_0xf772c1,_0x559b69[_0xb6b2('0x20')][_0xb6b2('0x22')]);return _0x4ad7d8(_0x559b69[_0xb6b2('0x20')][_0xb6b2('0x22')]);}else{logger[_0xb6b2('0x23')](_0xb6b2('0x21'),_0xf772c1,_0xb6b2('0x1d'));_0x4ad7d8(_0x559b69[_0xb6b2('0x24')][_0xb6b2('0x22')]);}})['catch'](function(_0x213fa6){logger[_0xb6b2('0x20')](_0xb6b2('0x21'),_0xf772c1,_0x213fa6);_0x190814(_0x213fa6);});});}function respondWithStatusCode(_0xa24596,_0xced468){_0xced468=_0xced468||0xcc;return function(_0x2609cf){if(_0x2609cf){return _0xa24596[_0xb6b2('0x25')](_0xced468);}return _0xa24596['status'](_0xced468)[_0xb6b2('0x26')]();};}function respondWithResult(_0x38e42b,_0x54d614){_0x54d614=_0x54d614||0xc8;return function(_0x4586e2){if(_0x4586e2){return _0x38e42b[_0xb6b2('0x27')](_0x54d614)['json'](_0x4586e2);}};}function respondWithFilteredResult(_0x42f738,_0x280981){return function(_0x3d12ab){if(_0x3d12ab){var _0x3876dc=typeof _0x280981[_0xb6b2('0x28')]==='undefined'&&typeof _0x280981[_0xb6b2('0x29')]===_0xb6b2('0x2a');var _0x40d714=_0x3d12ab[_0xb6b2('0x2b')];var _0xb7a94a=_0x3876dc?0x0:_0x280981['offset'];var _0x348077=_0x3876dc?_0x3d12ab[_0xb6b2('0x2b')]:_0x280981['offset']+_0x280981['limit'];var _0x2ff4e0;if(_0x348077>=_0x40d714){_0x348077=_0x40d714;_0x2ff4e0=0xc8;}else{_0x2ff4e0=0xce;}_0x42f738[_0xb6b2('0x27')](_0x2ff4e0);return _0x42f738['set'](_0xb6b2('0x2c'),_0xb7a94a+'-'+_0x348077+'/'+_0x40d714)['json'](_0x3d12ab);}return null;};}function patchUpdates(_0x21cff1){return function(_0x3bc0ba){try{jsonpatch[_0xb6b2('0x2d')](_0x3bc0ba,_0x21cff1,!![]);}catch(_0xcfdc4d){return BPromise[_0xb6b2('0x2e')](_0xcfdc4d);}return _0x3bc0ba['save']();};}function saveUpdates(_0x25a175,_0x527401){return function(_0x16d410){if(_0x16d410){return _0x16d410[_0xb6b2('0x2f')](_0x25a175)[_0xb6b2('0x30')](function(_0x413158){return _0x413158;});}return null;};}function removeEntity(_0x117b89,_0x407ed1){return function(_0x1f109b){if(_0x1f109b){return _0x1f109b[_0xb6b2('0x31')]()[_0xb6b2('0x30')](function(){_0x117b89[_0xb6b2('0x27')](0xcc)[_0xb6b2('0x26')]();});}};}function handleEntityNotFound(_0x250324,_0x2ae87d){return function(_0x4c05e5){if(!_0x4c05e5){_0x250324[_0xb6b2('0x25')](0x194);}return _0x4c05e5;};}function handleError(_0x218683,_0x5d3eb0){_0x5d3eb0=_0x5d3eb0||0x1f4;return function(_0x224a3e){logger[_0xb6b2('0x20')](_0x224a3e[_0xb6b2('0x32')]);if(_0x224a3e[_0xb6b2('0x33')]){delete _0x224a3e[_0xb6b2('0x33')];}_0x218683['status'](_0x5d3eb0)['send'](_0x224a3e);};}function getMustacheRender(_0x477351,_0x29146c){return Mustache[_0xb6b2('0x34')](_0x477351,_[_0xb6b2('0x35')](_0x29146c['body'],{'contact':_0x29146c[_0xb6b2('0x36')],'message':_0x29146c[_0xb6b2('0x22')],'agent':_0x29146c['agent'],'interaction':_0x29146c[_0xb6b2('0x37')],'account':_0x29146c['account']}))||'';}function getInteractionUsers(_0x8167e6,_0x4f9309){return new BPromise(function(_0x367e5e,_0x1a9865){try{if(_0x4f9309[_0x8167e6['id']]){_0x8167e6[_0xb6b2('0x38')]=_['map'](_0x4f9309[_0x8167e6['id']],function(_0x468075){return{'id':_0x468075['id'],'fullname':_0x468075['fullname']};});}}catch(_0x1b366b){_0x1a9865(_0x1b366b);}_0x367e5e(_0x8167e6);});}function getInteractionTags(_0x474f4f,_0x567330){return new BPromise(function(_0xf530c1,_0x4da618){try{if(_0x474f4f[_0xb6b2('0x39')]){_0x474f4f[_0xb6b2('0x3a')]=[];_0x474f4f[_0xb6b2('0x39')][_0xb6b2('0x3b')](',')[_0xb6b2('0x3c')](function(_0x1e8e01){_0x474f4f[_0xb6b2('0x3a')][_0xb6b2('0x3d')](_0x567330[_0x1e8e01]);});}delete _0x474f4f[_0xb6b2('0x39')];}catch(_0x15b076){_0x4da618(_0x15b076);}_0xf530c1(_0x474f4f);});}function updateChatInteraction(_0x50deeb,_0x22bf5c,_0x34c5ab){return new BPromise(function(_0x52f17e,_0x4b3163){return getInteractionUsers(_0x50deeb,_0x34c5ab)[_0xb6b2('0x30')](function(_0x1b0a76){return getInteractionTags(_0x1b0a76,_0x22bf5c);})['then'](function(_0x194359){return getStateInteraction(_0x194359);})[_0xb6b2('0x30')](function(_0x238ce8){_0x52f17e(_0x238ce8);})[_0xb6b2('0x3e')](function(_0x495280){_0x4b3163(_0x495280);});});}function getStateInteraction(_0x30c3c3){return new BPromise(function(_0x4de027){_0x30c3c3[_0xb6b2('0x3f')]=0x0;_0x30c3c3['talking']=0x0;_0x30c3c3['answered']=0x0;_0x30c3c3[_0xb6b2('0x40')]=0x0;_0x30c3c3[_0xb6b2('0x41')]=0x0;_0x30c3c3[_0xb6b2('0x42')]=0x0;if(!_0x30c3c3['closed']&&!_0x30c3c3['UserId']){_0x30c3c3['waiting']+=0x1;}if(!_0x30c3c3['closed']&&_0x30c3c3[_0xb6b2('0x43')]){_0x30c3c3[_0xb6b2('0x44')]+=0x1;if(_0x30c3c3[_0xb6b2('0x3f')]){_0x30c3c3[_0xb6b2('0x3f')]-=0x1;}}if(_0x30c3c3[_0xb6b2('0x45')]&&_0x30c3c3[_0xb6b2('0x46')]===_0xb6b2('0x41')){_0x30c3c3[_0xb6b2('0x41')]+=0x1;if(_0x30c3c3[_0xb6b2('0x3f')]){_0x30c3c3[_0xb6b2('0x3f')]-=0x1;}}else if(_0x30c3c3['closed']&&!_0x30c3c3[_0xb6b2('0x43')]&&_0x30c3c3['disposition']){_0x30c3c3[_0xb6b2('0x40')]+=0x1;if(_0x30c3c3[_0xb6b2('0x3f')]){_0x30c3c3[_0xb6b2('0x3f')]-=0x1;}}else if(_0x30c3c3['closed']&&_0x30c3c3['UserId']){_0x30c3c3['answered']+=0x1;if(_0x30c3c3[_0xb6b2('0x44')]){_0x30c3c3[_0xb6b2('0x44')]-=0x1;}}_0x30c3c3['total']+=0x1;_0x4de027(_0x30c3c3);});}exports['index']=function(_0x3f1723,_0x31c71e){var _0xe03c4d={},_0x1bfc58={},_0x25f015={'count':0x0,'rows':[]};var _0x39a308=_[_0xb6b2('0x47')](db['ChatInteraction'][_0xb6b2('0x48')],function(_0x4220c3){return{'name':_0x4220c3[_0xb6b2('0x49')],'type':_0x4220c3[_0xb6b2('0x4a')][_0xb6b2('0x4b')]};});_0x1bfc58[_0xb6b2('0x4c')]=_[_0xb6b2('0x47')](_0x39a308,'name');_0x1bfc58['query']=_['keys'](_0x3f1723[_0xb6b2('0x4d')]);_0x1bfc58[_0xb6b2('0x4e')]=_['intersection'](_0x1bfc58[_0xb6b2('0x4c')],_0x1bfc58[_0xb6b2('0x4d')]);_0xe03c4d[_0xb6b2('0x4f')]=_[_0xb6b2('0x50')](_0x1bfc58[_0xb6b2('0x4c')],qs[_0xb6b2('0x51')](_0x3f1723[_0xb6b2('0x4d')][_0xb6b2('0x51')]));_0xe03c4d[_0xb6b2('0x4f')]=_0xe03c4d['attributes'][_0xb6b2('0x52')]?_0xe03c4d[_0xb6b2('0x4f')]:_0x1bfc58[_0xb6b2('0x4c')];if(!_0x3f1723[_0xb6b2('0x4d')][_0xb6b2('0x53')](_0xb6b2('0x54'))){_0xe03c4d['limit']=qs[_0xb6b2('0x29')](_0x3f1723[_0xb6b2('0x4d')][_0xb6b2('0x29')]);_0xe03c4d[_0xb6b2('0x28')]=qs[_0xb6b2('0x28')](_0x3f1723[_0xb6b2('0x4d')][_0xb6b2('0x28')]);}_0xe03c4d[_0xb6b2('0x55')]=qs[_0xb6b2('0x56')](_0x3f1723[_0xb6b2('0x4d')][_0xb6b2('0x56')]);_0xe03c4d[_0xb6b2('0x57')]=qs[_0xb6b2('0x4e')](_['pick'](_0x3f1723[_0xb6b2('0x4d')],_0x1bfc58[_0xb6b2('0x4e')]),_0x39a308);var _0xf564af=[];var _0x1d28e2=squel['select']()[_0xb6b2('0x58')]('id')[_0xb6b2('0x58')](_0xb6b2('0x33'))[_0xb6b2('0x58')](_0xb6b2('0x59'))[_0xb6b2('0x5a')](_0xb6b2('0x5b'));var _0x413f62=squel[_0xb6b2('0x5c')]()[_0xb6b2('0x58')]('u.id')[_0xb6b2('0x58')](_0xb6b2('0x5d'))[_0xb6b2('0x58')](_0xb6b2('0x5e'))[_0xb6b2('0x5a')]('user_has_chat_interactions','ui')[_0xb6b2('0x5f')](_0xb6b2('0x60'),'u',_0xb6b2('0x61'));var _0x562144=squel[_0xb6b2('0x5c')]()['from'](_0xb6b2('0x62'),'i')['left_join'](_0xb6b2('0x63'),'c',_0xb6b2('0x64'))[_0xb6b2('0x5f')](_0xb6b2('0x60'),'o',_0xb6b2('0x65'))[_0xb6b2('0x5f')](_0xb6b2('0x66'),'a',_0xb6b2('0x67'))[_0xb6b2('0x5f')](_0xb6b2('0x68'),'me','me.ChatInteractionId\x20=\x20i.id')['left_join'](_0xb6b2('0x69'),'it',_0xb6b2('0x6a'))[_0xb6b2('0x5f')](_0xb6b2('0x5b'),'t',_0xb6b2('0x6b'));var _0x39be05=squel[_0xb6b2('0x6c')]();var _0x10f99f=[];var _0x2f270e=squel['expr']();var _0x50b05d;if(_0x3f1723[_0xb6b2('0x4d')]['search']){_0x50b05d=as[_0xb6b2('0x6d')](_0x3f1723[_0xb6b2('0x4d')][_0xb6b2('0x6e')]);var _0x5bb7c2=_0x50b05d['sqlOperator'];for(var _0x4b4f0c=0x0;_0x4b4f0c<_0x50b05d['conditions'][_0xb6b2('0x52')];_0x4b4f0c++){var _0x3a156e=_0x50b05d[_0xb6b2('0x6f')][_0x4b4f0c];var _0x43ce06='i';var _0x589603=_[_0xb6b2('0x70')](_0x39a308,[_0xb6b2('0x33'),_0x3a156e[_0xb6b2('0x58')]]);if(!_0x589603){switch(_0x3a156e[_0xb6b2('0x58')]){case _0xb6b2('0x71'):if(_0x3a156e['value']==0x1){_0x562144['having']('`'+_0x3a156e['field']+_0xb6b2('0x72'));}else{_0x562144[_0xb6b2('0x73')]('`'+_0x3a156e['field']+_0xb6b2('0x74'));}break;case _0xb6b2('0x75'):if(_0x3a156e['operator']===_0xb6b2('0x76')){if(_0x3a156e[_0xb6b2('0x77')]['split']('\x20')[_0xb6b2('0x52')]>0x1){_0x39be05[_0x5bb7c2](_0xb6b2('0x78'),qs[_0xb6b2('0x79')](_0x3a156e[_0xb6b2('0x77')]),null);}else{var _0x5880bc='%'+_0x3a156e[_0xb6b2('0x77')]+'%';_0x39be05[_0x5bb7c2](_0xb6b2('0x7a'),_0x5880bc,_0x5880bc,_0x5880bc);}}else{_0x589603=_[_0xb6b2('0x70')](_0x39a308,[_0xb6b2('0x33'),_0xb6b2('0x7b')]);_0x3a156e[_0xb6b2('0x58')]=_0xb6b2('0x7b');_0x50ca0c=as[_0xb6b2('0x7c')](_0x43ce06,_0x589603[_0xb6b2('0x4a')],_0x3a156e);_0x39be05[_0x5bb7c2](_0x50ca0c[_0xb6b2('0x7d')],_0x50ca0c[_0xb6b2('0x77')][_0xb6b2('0x7e')],_0x50ca0c[_0xb6b2('0x77')][_0xb6b2('0x26')]);}break;case _0xb6b2('0x7f'):var _0x5176ba=_0x3a156e[_0xb6b2('0x77')][_0xb6b2('0x3b')](',')[_0xb6b2('0x47')](function(_0x24be70){return Number(_0x24be70);});_0x5176ba[_0xb6b2('0x3c')](function(_0x3433ec){_0x2f270e['or'](_0xb6b2('0x80'),'%,'+_0x3433ec+',%');});_0x10f99f=_[_0xb6b2('0x81')](_0x10f99f,_0x5176ba);break;case _0xb6b2('0x82'):if(_0x3a156e['operator']==='$substring'){_0x39be05[_0x5bb7c2](_0xb6b2('0x83'),'%'+_0x3a156e['value']+'%',null);}else{_0x589603=_['find'](_0x39a308,[_0xb6b2('0x33'),_0xb6b2('0x43')]);_0x3a156e[_0xb6b2('0x58')]=_0xb6b2('0x43');_0x50ca0c=as[_0xb6b2('0x7c')](_0x43ce06,_0x589603[_0xb6b2('0x4a')],_0x3a156e);_0x39be05[_0x5bb7c2](_0x50ca0c[_0xb6b2('0x7d')],_0x50ca0c['value'][_0xb6b2('0x7e')],_0x50ca0c[_0xb6b2('0x77')]['end']);}break;case _0xb6b2('0x84'):_0x50ca0c=as[_0xb6b2('0x7c')]('me',null,_0x3a156e);_0x39be05[_0x5bb7c2](_0x50ca0c[_0xb6b2('0x7d')],_0x50ca0c['value'][_0xb6b2('0x7e')],_0x50ca0c[_0xb6b2('0x77')][_0xb6b2('0x26')]);break;}}else{var _0x50ca0c=as[_0xb6b2('0x7c')](_0x43ce06,_0x589603[_0xb6b2('0x4a')],_0x3a156e);_0x39be05[_0x5bb7c2](_0x50ca0c['text'],_0x50ca0c[_0xb6b2('0x77')][_0xb6b2('0x7e')],_0x50ca0c[_0xb6b2('0x77')][_0xb6b2('0x26')]);}}}else{var _0x32d111=_(_0x3f1723['query'])[_0xb6b2('0x85')]()[_0xb6b2('0x47')](function(_0xda9b6b){return _[_0xb6b2('0x86')](_0x39a308,[_0xb6b2('0x33'),_0xda9b6b])?_0xda9b6b:undefined;})[_0xb6b2('0x87')]()[_0xb6b2('0x77')]();if(!_[_0xb6b2('0x88')](_0x32d111)){_0x32d111[_0xb6b2('0x3c')](function(_0x33ff3a){if(_0x33ff3a===_0xb6b2('0x89')){_0x562144[_0xb6b2('0x57')]('i.ChatWebsiteId\x20IN\x20?',[][_0xb6b2('0x8a')](_0x3f1723['query'][_0x33ff3a]));}else if(_0x33ff3a===_0xb6b2('0x8b')){var _0x4e7443=JSON[_0xb6b2('0x8c')](_0x3f1723['query'][_0x33ff3a])[_0xb6b2('0x8d')];var _0x9138ea=JSON[_0xb6b2('0x8c')](_0x3f1723['query'][_0x33ff3a])[_0xb6b2('0x8e')];_0x562144[_0xb6b2('0x57')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4e7443,_0x9138ea);}else{if(_0x3f1723[_0xb6b2('0x4d')][_0x33ff3a]===_0xb6b2('0x8f')){_0x562144['where']('i.'+_0x33ff3a+'\x20IS\x20NULL');}else{_0x562144[_0xb6b2('0x57')]('i.'+_0x33ff3a+_0xb6b2('0x90'),_0x3f1723[_0xb6b2('0x4d')][_0x33ff3a]);}}});}if(_0x3f1723['query'][_0xb6b2('0x91')]){if(_0x3f1723['query'][_0xb6b2('0x91')]==0x1){_0x562144['having']('`unreadMessages`\x20=\x200');}else{_0x562144[_0xb6b2('0x73')](_0xb6b2('0x92'));}}if(_0x3f1723[_0xb6b2('0x4d')]['tag']){_0x10f99f=_[_0xb6b2('0x93')](_0x3f1723[_0xb6b2('0x4d')][_0xb6b2('0x94')])?_0x3f1723[_0xb6b2('0x4d')]['tag']:new Array(_0x3f1723[_0xb6b2('0x4d')][_0xb6b2('0x94')]);_0x10f99f[_0xb6b2('0x3c')](function(_0x1e7faa){_0x2f270e['or'](_0xb6b2('0x80'),'%,'+_0x1e7faa+',%');});}if(_0x3f1723[_0xb6b2('0x4d')][_0xb6b2('0x95')]){var _0x494900=_0x3f1723['query']['filter'][_0xb6b2('0x96')]('\x5c','\x5c\x5c')[_0xb6b2('0x96')](/'/g,'\x27\x27');if(qs[_0xb6b2('0x97')](_0x494900)){_0x39be05['or'](_0xb6b2('0x98'),_0x494900+'%');}else{_0x39be05['or'](_0xb6b2('0x99'),qs['getFullTextValue'](_0x494900))['or'](_0xb6b2('0x9a'),_0x494900+'%');}}}_0x562144[_0xb6b2('0x57')](_0x39be05);_0x562144[_0xb6b2('0x9b')](_0xb6b2('0x9c'));var _0x2b69b9={'type':db[_0xb6b2('0x9d')]['QueryTypes'][_0xb6b2('0x9e')],'raw':!![]};var _0x467bcc=_0x562144[_0xb6b2('0x9f')]();_0x467bcc['field'](_0xb6b2('0x9c'));_0x467bcc['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xb6b2('0x71'));if(_0xe03c4d[_0xb6b2('0x55')]){_0xe03c4d[_0xb6b2('0x55')][_0xb6b2('0x3c')](function(_0x2bffe4){var _0x4b12f6=_0x2bffe4[0x0]===_0xb6b2('0xa0')?_0x2bffe4[0x0]:'i.'+_0x2bffe4[0x0];_0x562144[_0xb6b2('0x55')](_0x4b12f6,_0x2bffe4[0x1]==='DESC'?![]:!![]);});}if(!_[_0xb6b2('0x88')](_0x10f99f)){_0x562144[_0xb6b2('0x73')](_0x2f270e);_0x467bcc[_0xb6b2('0x57')](_0xb6b2('0xa1'),_0x10f99f);}BPromise[_0xb6b2('0xa2')]()[_0xb6b2('0x30')](function(){if(!_0x50b05d){if(_0x3f1723[_0xb6b2('0x4d')][_0xb6b2('0x89')])return;_0x467bcc[_0xb6b2('0x57')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x562144[_0xb6b2('0x57')](_0xb6b2('0xa3'));return;}if(_0x3f1723[_0xb6b2('0xa4')][_0xb6b2('0xa5')]!==_0xb6b2('0xa6'))return;return _0x3f1723[_0xb6b2('0xa4')][_0xb6b2('0xa7')]({'attributes':['id'],'raw':!![]})[_0xb6b2('0x30')](function(_0x311dc1){if(_[_0xb6b2('0x88')](_0x311dc1)){_0x467bcc[_0xb6b2('0x57')](_0xb6b2('0xa8'));_0x562144['where']('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x467bcc[_0xb6b2('0x57')](_0xb6b2('0xa9'),_[_0xb6b2('0x47')](_0x311dc1,'id'));_0x562144[_0xb6b2('0x57')]('i.ChatWebsiteId\x20IN\x20?',_[_0xb6b2('0x47')](_0x311dc1,'id'));}});})[_0xb6b2('0x30')](function(){if(_0x3f1723[_0xb6b2('0xa4')][_0xb6b2('0xa5')]===_0xb6b2('0xa6')&&!_0x50b05d&&!_0x3f1723[_0xb6b2('0x4d')]['ChatWebsiteId'])return[];return db[_0xb6b2('0xaa')][_0xb6b2('0x4d')](_0x467bcc[_0xb6b2('0xab')](),_0x2b69b9);})[_0xb6b2('0x30')](function(_0x54b460){_0x25f015[_0xb6b2('0x2b')]=_0x54b460['length'];if(_0x25f015[_0xb6b2('0x2b')]===0x0)return[];return db[_0xb6b2('0xaa')]['query'](_0x1d28e2[_0xb6b2('0xab')](),_0x2b69b9)[_0xb6b2('0x30')](function(_0x28861f){_0xf564af=_[_0xb6b2('0xac')](_0x28861f,'id');_0x2b69b9=_[_0xb6b2('0x35')](_0x2b69b9,{'model':db[_0xb6b2('0xad')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3f1723['query'][_0xb6b2('0x51')]){_0xe03c4d[_0xb6b2('0x4f')][_0xb6b2('0x3c')](function(_0x307c12){_0x562144[_0xb6b2('0x58')]('i.'+_0x307c12);});}else{_0x562144[_0xb6b2('0x58')](_0xb6b2('0xae'),'unreadMessages');_0x562144['field'](_0xb6b2('0xaf'),_0xb6b2('0xb0'));_0x562144[_0xb6b2('0x58')]('a.mandatoryDisposition',_0xb6b2('0xb1'));_0x562144[_0xb6b2('0x58')](_0xb6b2('0xb2'),_0xb6b2('0xa0'));_0x562144[_0xb6b2('0x58')](_0xb6b2('0xb3'));_0x562144['field']('c.firstName',_0xb6b2('0xb4'));_0x562144[_0xb6b2('0x58')]('c.lastName',_0xb6b2('0xb5'));_0x562144[_0xb6b2('0x58')]('c.email',_0xb6b2('0xb6'));_0x562144[_0xb6b2('0x58')](_0xb6b2('0xb7'),_0xb6b2('0xb8'));_0x562144[_0xb6b2('0x58')](_0xb6b2('0xb9'),_0xb6b2('0xba'));_0x562144[_0xb6b2('0x58')](_0xb6b2('0xbb'),_0xb6b2('0xbc'));_0x562144[_0xb6b2('0x58')]('o.fullname','Owner.fullname');_0x562144[_0xb6b2('0x58')](_0xb6b2('0xbd'),_0xb6b2('0xbe'));_0x562144[_0xb6b2('0x58')](_0xb6b2('0xbf'),'TagIds');}if(_0xe03c4d['limit'])_0x562144[_0xb6b2('0x29')](_0xe03c4d[_0xb6b2('0x29')]);if(_0xe03c4d['offset'])_0x562144['offset'](_0xe03c4d[_0xb6b2('0x28')]);return db['sequelize']['query'](_0x562144[_0xb6b2('0xab')](),_0x2b69b9);})['then'](function(_0x42801a){if(_0x42801a['length']>0x0)_0x413f62[_0xb6b2('0x57')](_0xb6b2('0xc0'),_[_0xb6b2('0x47')](_0x42801a,'id'));return db[_0xb6b2('0xaa')][_0xb6b2('0x4d')](_0x413f62['toString'](),_0x2b69b9)['then'](function(_0x579822){var _0x2a1a72=_[_0xb6b2('0xc1')](_0x579822,_0xb6b2('0xc2'));var _0x18033d=[];_0x42801a[_0xb6b2('0x3c')](function(_0x16eca0){_0x18033d['push'](updateChatInteraction(_0x16eca0,_0xf564af,_0x2a1a72));});return BPromise[_0xb6b2('0xc3')](_0x18033d);});});})['then'](function(_0x544207){_0x25f015[_0xb6b2('0xc4')]=_0x544207;return _0x25f015;})['then'](respondWithFilteredResult(_0x31c71e,_0xe03c4d))[_0xb6b2('0x3e')](handleError(_0x31c71e,null));};exports[_0xb6b2('0xc5')]=function(_0x38a48a,_0x6b42b2){var _0x498ae6={'raw':![],'where':{'id':_0x38a48a[_0xb6b2('0xc6')]['id']}},_0x4bb27d={};_0x4bb27d[_0xb6b2('0x4c')]=_[_0xb6b2('0x85')](db[_0xb6b2('0xad')][_0xb6b2('0x48')]);_0x4bb27d[_0xb6b2('0x4d')]=_[_0xb6b2('0x85')](_0x38a48a['query']);_0x4bb27d[_0xb6b2('0x4e')]=_[_0xb6b2('0x50')](_0x4bb27d['model'],_0x4bb27d[_0xb6b2('0x4d')]);_0x498ae6[_0xb6b2('0x4f')]=_['intersection'](_0x4bb27d[_0xb6b2('0x4c')],qs['fields'](_0x38a48a[_0xb6b2('0x4d')][_0xb6b2('0x51')]));_0x498ae6[_0xb6b2('0x4f')]=_0x498ae6[_0xb6b2('0x4f')][_0xb6b2('0x52')]?_0x498ae6[_0xb6b2('0x4f')]:_0x4bb27d['model'];if(_0x38a48a[_0xb6b2('0x4d')][_0xb6b2('0xc7')]){_0x498ae6[_0xb6b2('0xc8')]=[{'all':!![]}];}_0x498ae6=_[_0xb6b2('0x35')]({},_0x498ae6,_0x38a48a['options']);return db['ChatInteraction'][_0xb6b2('0x70')](_0x498ae6)[_0xb6b2('0x30')](handleEntityNotFound(_0x6b42b2,null))[_0xb6b2('0x30')](respondWithResult(_0x6b42b2,null))['catch'](handleError(_0x6b42b2,null));};exports['create']=function(_0x17efe8,_0x5e26f6){return db[_0xb6b2('0xad')]['create'](_0x17efe8[_0xb6b2('0x84')],{})[_0xb6b2('0x30')](respondWithResult(_0x5e26f6,0xc9))['catch'](handleError(_0x5e26f6,null));};exports[_0xb6b2('0x2f')]=function(_0xc842d1,_0x188993){if(_0xc842d1['body']['id']){delete _0xc842d1['body']['id'];}return db[_0xb6b2('0xad')]['find']({'where':{'id':_0xc842d1[_0xb6b2('0xc6')]['id']}})[_0xb6b2('0x30')](handleEntityNotFound(_0x188993,null))['then'](saveUpdates(_0xc842d1[_0xb6b2('0x84')],null))['then'](respondWithResult(_0x188993,null))['catch'](handleError(_0x188993,null));};exports[_0xb6b2('0x31')]=function(_0x3b6d6e,_0x13404a){return db['ChatInteraction'][_0xb6b2('0x70')]({'where':{'id':_0x3b6d6e[_0xb6b2('0xc6')]['id']}})[_0xb6b2('0x30')](handleEntityNotFound(_0x13404a,null))[_0xb6b2('0x30')](removeEntity(_0x13404a,null))['catch'](handleError(_0x13404a,null));};exports[_0xb6b2('0xc9')]=function(_0x58389d,_0x2a5635){return db[_0xb6b2('0xad')][_0xb6b2('0xc9')]()['then'](respondWithResult(_0x2a5635,null))['catch'](handleError(_0x2a5635,null));};exports[_0xb6b2('0xca')]=function(_0x46b423,_0x4faeba){var _0x556665=_0x46b423[_0xb6b2('0xc6')]['id'];var _0x48f595;var _0x4c644e;var _0x3bd135;return db[_0xb6b2('0xad')][_0xb6b2('0xcb')]({'where':{'id':_0x556665}})[_0xb6b2('0x30')](function(_0x27605d){_0x48f595=_0x27605d;return db[_0xb6b2('0xcc')][_0xb6b2('0xcb')]({'where':{'id':_0x27605d[_0xb6b2('0x89')]},'attributes':['id',_0xb6b2('0xcd'),_0xb6b2('0xce'),_0xb6b2('0xcf'),_0xb6b2('0xd0'),_0xb6b2('0xd1')],'raw':!![]});})[_0xb6b2('0x30')](function(_0x10c516){if(_0x10c516&&_0x10c516[_0xb6b2('0xcd')]&&_0x10c516[_0xb6b2('0xce')]){_0x4c644e=_0x10c516;var _0x359314={'interaction':{'id':_0x556665},'agent':{'id':_0x46b423[_0xb6b2('0xa4')]['id'],'name':_0x46b423[_0xb6b2('0xa4')][_0xb6b2('0x33')],'fullname':_0x46b423[_0xb6b2('0xa4')][_0xb6b2('0xd2')],'email':_0x46b423[_0xb6b2('0xa4')][_0xb6b2('0xd3')]},'contact':_0x46b423[_0xb6b2('0x84')][_0xb6b2('0x36')],'account':_0x46b423['body'][_0xb6b2('0xd4')]};var _0x5665b4={'rejectUnauthorized':![],'method':'POST','url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x10c516[_0xb6b2('0xcd')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x46b423[_0xb6b2('0xa4')][_0xb6b2('0xd3')]],'buttons':null,'topic':_0x4c644e[_0xb6b2('0xcf')],'note':_[_0xb6b2('0xd5')](_0x4c644e[_0xb6b2('0xd0')])?null:getMustacheRender(_0x4c644e[_0xb6b2('0xd0')],_0x359314),'metadata':null},'redirect':_0xb6b2('0xd6'),'json':!![]};try{if(!_[_0xb6b2('0xd5')](_0x4c644e['vidaooMetadata'])){var _0x2c3831=getMustacheRender(_0x4c644e['vidaooMetadata'],_0x359314);var _0x18ddaa=JSON[_0xb6b2('0x8c')](_0x2c3831);_0x5665b4['body'][_0xb6b2('0xd7')]=_0x18ddaa;}}catch(_0x585a9a){throw new db['Sequelize']['ValidationError']('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x5665b4);}else{throw new db[(_0xb6b2('0x9d'))][(_0xb6b2('0xd8'))](_0xb6b2('0xd9'));}})[_0xb6b2('0x30')](function(_0x11aaa0){_0x3bd135=_0x11aaa0;if(_0x3bd135['id']){var _0x3d9379={'body':_0x3bd135['join_url'],'ChatWebsiteId':_0x4c644e['id'],'ChatInteractionId':_0x48f595['id'],'direction':_0xb6b2('0xda'),'UserId':_0x46b423[_0xb6b2('0xa4')]['id']};return db[_0xb6b2('0xdb')][_0xb6b2('0xdc')](_0x3d9379,{});}else{throw new db[(_0xb6b2('0x9d'))][(_0xb6b2('0xd8'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0xb6b2('0x30')](function(){return _0x48f595['updateAttributes']({'vidaooSessionId':_0x3bd135['id']});})[_0xb6b2('0x30')](respondWithResult(_0x4faeba,null))[_0xb6b2('0x3e')](handleError(_0x4faeba,null));};exports[_0xb6b2('0xdd')]=function(_0x1d6aea,_0x369788){if(_0x1d6aea[_0xb6b2('0x84')]['id']){delete _0x1d6aea['body']['id'];}return db[_0xb6b2('0xad')][_0xb6b2('0x70')]({'where':{'id':_0x1d6aea[_0xb6b2('0xc6')]['id']},'include':[{'model':db['CmContact'],'as':_0xb6b2('0x75')}]})['then'](handleEntityNotFound(_0x369788,null))[_0xb6b2('0x30')](saveUpdates(_0x1d6aea[_0xb6b2('0x84')],null))[_0xb6b2('0x30')](respondWithResult(_0x369788,null))[_0xb6b2('0x3e')](handleError(_0x369788,null));};exports[_0xb6b2('0xde')]=function(_0x3c1a40,_0x4c0f3b,_0x42fff2){if(_0x3c1a40['body']['id']){delete _0x3c1a40['body']['id'];}return db[_0xb6b2('0xad')]['find']({'where':{'id':_0x3c1a40['params']['id']}})[_0xb6b2('0x30')](function(_0x16864f){if(!_0x16864f){logger['error']('abandonInteraction,\x20%s,\x20%s,\x20%s',_0xb6b2('0xde'),0x194,_0xb6b2('0xdf'));_0x4c0f3b['sendStatus'](0x194);}else{if(_0x16864f[_0xb6b2('0x43')]){throw new db[(_0xb6b2('0x9d'))]['ValidationError'](_0xb6b2('0xe0'));}}return _0x16864f;})[_0xb6b2('0x30')](function(_0x184b74){if(_0x184b74){return _0x184b74[_0xb6b2('0x2f')]({'closed':_0x3c1a40[_0xb6b2('0x84')]['closed'],'disposition':_0x3c1a40[_0xb6b2('0x84')][_0xb6b2('0x46')]})[_0xb6b2('0x30')](function(_0x26d7b9){return _0x26d7b9;});}})['then'](function(_0x26c9dc){return respondWithRpcPromise(_0xb6b2('0xe1'),_0xb6b2('0xde'),_0x3c1a40[_0xb6b2('0x84')],client9004);})['then'](respondWithResult(_0x4c0f3b,null))['catch'](handleError(_0x4c0f3b,null));};exports[_0xb6b2('0xe2')]=function(_0x5f1d67,_0x3b4797,_0x4910f0){_0x5f1d67[_0xb6b2('0x84')][_0xb6b2('0x33')]=_0x5f1d67[_0xb6b2('0xe3')][_0xb6b2('0xe4')];_0x5f1d67[_0xb6b2('0x84')]['basename']=_0x5f1d67[_0xb6b2('0xe3')][_0xb6b2('0xe5')];_0x5f1d67['body'][_0xb6b2('0x4a')]=_0x5f1d67[_0xb6b2('0xe3')][_0xb6b2('0xe6')];return db[_0xb6b2('0xe7')][_0xb6b2('0xdc')](_0x5f1d67[_0xb6b2('0x84')])['then'](respondWithResult(_0x3b4797,0xc9))[_0xb6b2('0x3e')](handleError(_0x3b4797,null));};exports[_0xb6b2('0xe8')]=function(_0x121900,_0xeff631,_0xe796e0){return db[_0xb6b2('0xad')][_0xb6b2('0xcb')]({'where':{'id':_0x121900[_0xb6b2('0xc6')]['id']},'raw':!![]})[_0xb6b2('0x30')](handleEntityNotFound(_0xeff631,null))[_0xb6b2('0x30')](function(_0x2e44b1){if(_0x2e44b1){if(_0x2e44b1[_0xb6b2('0x45')]){return _0xeff631[_0xb6b2('0x27')](0x193)[_0xb6b2('0xe9')]({'status':0x193,'message':_0xb6b2('0xea')});}return db['Attachment']['findOne']({'where':{'id':_0x121900[_0xb6b2('0x4d')]['attachId']},'raw':!![]})[_0xb6b2('0x30')](handleEntityNotFound(_0xeff631,null));}})[_0xb6b2('0x30')](function(_0x45443a){if(_0x45443a){var _0x1e711a=_0x45443a[_0xb6b2('0xeb')]!==null;var _0xfcdf13=path[_0xb6b2('0xec')](config['root'],_0xb6b2('0xed'));if(_0x1e711a){_0xfcdf13=path[_0xb6b2('0xec')](_0xfcdf13,_0xb6b2('0xee'));}var _0x139bda=path[_0xb6b2('0xec')](_0xfcdf13,_0x45443a[_0xb6b2('0xef')]);return _0xeff631[_0xb6b2('0xf0')](_0x139bda);}})['catch'](handleError(_0xeff631,null));};exports[_0xb6b2('0xf1')]=function(_0x536151,_0x2011aa){var _0x2eb30e=null;var _0x47dff2=null;var _0x461a20=null;var _0x17edce=null;if(_0x536151[_0xb6b2('0x84')]['id']){delete _0x536151[_0xb6b2('0x84')]['id'];}if(_0x536151[_0xb6b2('0x84')][_0xb6b2('0xf2')]){_0x17edce=path['join'](config[_0xb6b2('0xf3')],'server/files/chat/upload/',util[_0xb6b2('0xf4')]('transcript-%s.txt',Date[_0xb6b2('0xf5')]()));_0x536151[_0xb6b2('0x84')][_0xb6b2('0xf6')]=_0x17edce;}return db['ChatInteraction'][_0xb6b2('0x70')]({'where':{'id':_0x536151['params']['id']},'include':[{'model':db[_0xb6b2('0xdb')],'as':_0xb6b2('0xf7'),'include':[{'model':db[_0xb6b2('0x82')],'as':'User'}]}]})[_0xb6b2('0x30')](handleEntityNotFound(_0x2011aa,null))[_0xb6b2('0x30')](saveUpdates(_0x536151[_0xb6b2('0x84')],null))[_0xb6b2('0x30')](function(_0x674576){if(_0x674576){_0x2eb30e=_0x674576;return db[_0xb6b2('0xcc')][_0xb6b2('0x70')]({'where':{'id':_0x2eb30e[_0xb6b2('0x89')]}});}})[_0xb6b2('0x30')](function(_0x5187b7){if(_0x5187b7){_0x461a20=_0x5187b7;return db[_0xb6b2('0xf8')]['find']({'where':{'id':_0x2eb30e[_0xb6b2('0x7b')]}});}})[_0xb6b2('0x30')](function(_0x72931f){if(_0x72931f){_0x47dff2=_0x72931f;if(_0x17edce){var _0x41392e=null;for(var _0x5a656e=0x1;_0x5a656e<_0x2eb30e[_0xb6b2('0xf7')][_0xb6b2('0x52')];++_0x5a656e){_0x41392e=_0x2eb30e[_0xb6b2('0xf7')][_0x5a656e];var _0x29d098=_0x41392e['UserId']?util[_0xb6b2('0xf4')]('%s%d',_0x461a20[_0xb6b2('0xf9')],_0x41392e[_0xb6b2('0x43')]):'System';var _0x2f95ba=_0x536151['body'][_0xb6b2('0xfa')]||util[_0xb6b2('0xf4')]('%s%d',_0xb6b2('0xfb'),_0x41392e[_0xb6b2('0x7b')]);switch(_0x461a20[_0xb6b2('0xfc')]){case'website_alias':_0x29d098=_0x41392e[_0xb6b2('0x43')]?util[_0xb6b2('0xf4')](_0xb6b2('0xfd'),_0x461a20[_0xb6b2('0xf9')],_0x41392e[_0xb6b2('0x43')]):_0xb6b2('0xfe');break;case _0xb6b2('0xff'):_0x29d098=_0x41392e['UserId']?_0x41392e[_0xb6b2('0x82')][_0xb6b2('0x100')]||_0x41392e[_0xb6b2('0x82')][_0xb6b2('0xd2')]:'System';break;case _0xb6b2('0x101'):_0x29d098=_0x41392e[_0xb6b2('0x43')]?_0x41392e[_0xb6b2('0x82')][_0xb6b2('0xd2')]:_0xb6b2('0xfe');break;default:_0x29d098=_0x41392e['UserId']?util[_0xb6b2('0xf4')](_0xb6b2('0xfd'),_0x461a20[_0xb6b2('0xf9')],_0x41392e[_0xb6b2('0x43')]):_0xb6b2('0xfe');}var _0x224bcc=util[_0xb6b2('0xf4')](_0xb6b2('0x102'),moment(_0x41392e['createdAt'])[_0xb6b2('0xf4')](_0xb6b2('0x103')),_0x41392e[_0xb6b2('0x104')]==='in'?_0x2f95ba:_0x29d098,_0x41392e['body']);if(!_0x41392e[_0xb6b2('0x105')]){fs[_0xb6b2('0x106')](_0x17edce,_0x224bcc);}}return db['MailAccount'][_0xb6b2('0xcb')]({'where':{'service':!![]},'include':[{'model':db[_0xb6b2('0x107')],'as':_0xb6b2('0x108'),'raw':!![]}]});}}})['then'](function(_0x5b068a){if(_0x5b068a&&_0x5b068a[_0xb6b2('0x108')]&&_0x536151['body']){var _0x2a3e7c={'tls':{'rejectUnauthorized':![]}};if(_0x5b068a[_0xb6b2('0x108')][_0xb6b2('0x109')]){_0x2a3e7c[_0xb6b2('0x109')]=_0x5b068a[_0xb6b2('0x108')][_0xb6b2('0x109')];}else{_0x2a3e7c[_0xb6b2('0x10a')]=_0x5b068a[_0xb6b2('0x108')][_0xb6b2('0x10a')];_0x2a3e7c['port']=_0x5b068a['Smtp']['port'];_0x2a3e7c[_0xb6b2('0x10b')]=_0x5b068a[_0xb6b2('0x108')][_0xb6b2('0x10b')];}if(_0x5b068a[_0xb6b2('0x108')][_0xb6b2('0x10c')]){_0x2a3e7c[_0xb6b2('0x10d')]={'user':_0x5b068a[_0xb6b2('0x108')][_0xb6b2('0xa4')],'pass':_0x5b068a['Smtp'][_0xb6b2('0x10e')]};}return respondWithRpcPromise(_0xb6b2('0x10f'),_0xb6b2('0x110'),{'account':_0x2a3e7c,'message':{'from':util[_0xb6b2('0xf4')](_0xb6b2('0x111'),_0x5b068a[_0xb6b2('0x33')],_0x5b068a[_0xb6b2('0xd3')]||_0x5b068a[_0xb6b2('0x108')]['user']),'to':_0x536151['body']['mailTranscript'],'subject':_0xb6b2('0x112'),'text':util[_0xb6b2('0xf4')](_0xb6b2('0x113'),_0x536151[_0xb6b2('0x84')][_0xb6b2('0xf2')]),'attachments':[{'path':_0x17edce}]}})[_0xb6b2('0x30')](function(){return _0x2eb30e;})[_0xb6b2('0x3e')](function(_0x29a939){console[_0xb6b2('0x20')](_0x29a939);});}else{return _0x2eb30e;}})[_0xb6b2('0x30')](respondWithStatusCode(_0x2011aa,0xc8))['catch'](handleError(_0x2011aa,null));};exports[_0xb6b2('0x114')]=function(_0x1e6db7,_0x1fa7e5,_0x5e1544){return db[_0xb6b2('0xdb')][_0xb6b2('0x70')]({'where':{'id':_0x1e6db7[_0xb6b2('0xc6')]['id']}})[_0xb6b2('0x30')](handleEntityNotFound(_0x1fa7e5,null))[_0xb6b2('0x30')](function(_0x492d85){if(_0x492d85){return _0x492d85[_0xb6b2('0x114')](_0x1e6db7['body'][_0xb6b2('0x115')],_[_0xb6b2('0x116')](_0x1e6db7['body'],[_0xb6b2('0x115'),'id'])||{});}})[_0xb6b2('0x30')](respondWithResult(_0x1fa7e5,null))[_0xb6b2('0x3e')](handleError(_0x1fa7e5,null));};exports['getMessages']=function(_0x259eef,_0x55a2d8,_0x48f78d){var _0x3229fc={'raw':![],'where':{}};var _0x8458cc={};var _0x543449={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xb6b2('0xcb')]({'where':{'id':_0x259eef[_0xb6b2('0xc6')]['id']}})[_0xb6b2('0x30')](handleEntityNotFound(_0x55a2d8,null))[_0xb6b2('0x30')](function(_0x1b5e04){if(_0x1b5e04){_0x8458cc[_0xb6b2('0x4c')]=_['keys'](db[_0xb6b2('0xdb')]['rawAttributes']);_0x8458cc['query']=_['keys'](_0x259eef['query']);_0x8458cc[_0xb6b2('0x4e')]=_[_0xb6b2('0x50')](_0x8458cc[_0xb6b2('0x4c')],_0x8458cc['query']);_0x3229fc['attributes']=_['intersection'](_0x8458cc[_0xb6b2('0x4c')],qs[_0xb6b2('0x51')](_0x259eef[_0xb6b2('0x4d')]['fields']));_0x3229fc['attributes']=_0x3229fc[_0xb6b2('0x4f')][_0xb6b2('0x52')]?_0x3229fc['attributes']:_0x8458cc[_0xb6b2('0x4c')];if(!_0x259eef[_0xb6b2('0x4d')][_0xb6b2('0x53')](_0xb6b2('0x54'))){_0x3229fc[_0xb6b2('0x29')]=qs[_0xb6b2('0x29')](_0x259eef[_0xb6b2('0x4d')]['limit']);_0x3229fc[_0xb6b2('0x28')]=qs['offset'](_0x259eef[_0xb6b2('0x4d')][_0xb6b2('0x28')]);}_0x3229fc['order']=qs['sort'](_0x259eef['query'][_0xb6b2('0x56')]);_0x3229fc[_0xb6b2('0x57')]=qs[_0xb6b2('0x4e')](_[_0xb6b2('0x117')](_0x259eef[_0xb6b2('0x4d')],_0x8458cc[_0xb6b2('0x4e')]));_0x3229fc[_0xb6b2('0x57')]['ChatInteractionId']=_0x1b5e04['id'];if(_0x259eef[_0xb6b2('0x4d')]['filter']){_0x3229fc['where']=_[_0xb6b2('0x35')](_0x3229fc['where'],{'$or':_['map'](_0x3229fc[_0xb6b2('0x4f')],function(_0x502878){var _0x50be29={};_0x50be29[_0x502878]={'$like':'%'+_0x259eef[_0xb6b2('0x4d')]['filter']+'%'};return _0x50be29;})});}if(_0x259eef[_0xb6b2('0x4d')][_0xb6b2('0x8d')]){var _0x1c23e8=_0x259eef[_0xb6b2('0x4d')][_0xb6b2('0x8d')][_0xb6b2('0x3b')](',');var _0x1bf9ea={};_0x1bf9ea[_0x1c23e8[0x0]]={'$gte':moment(_0x1c23e8[0x1])[_0xb6b2('0xf4')](_0xb6b2('0x118'))};_0x3229fc['where']=_['merge'](_0x3229fc[_0xb6b2('0x57')],_0x1bf9ea);}_0x3229fc=_[_0xb6b2('0x35')]({},_0x3229fc,_0x259eef[_0xb6b2('0x119')]);return db['ChatMessage'][_0xb6b2('0x2b')]({'where':_0x3229fc[_0xb6b2('0x57')]})[_0xb6b2('0x30')](function(_0x406c72){_0x543449[_0xb6b2('0x2b')]=_0x406c72;if(_0x259eef[_0xb6b2('0x4d')][_0xb6b2('0xc7')]){_0x3229fc[_0xb6b2('0xc8')]=[{'all':!![]}];}return db['ChatMessage'][_0xb6b2('0x11a')](_0x3229fc);})[_0xb6b2('0x30')](function(_0x29e297){_0x543449[_0xb6b2('0xc4')]=_0x29e297;return _0x543449;});}})['then'](respondWithFilteredResult(_0x55a2d8,_0x3229fc))[_0xb6b2('0x3e')](handleError(_0x55a2d8,null));};exports[_0xb6b2('0x11b')]=function(_0x7368f3,_0xb9017a,_0x31e38f){var _0x2ddca3={'where':{}},_0x27d92c={},_0x5ba306={'count':0x0,'rows':[]};return db[_0xb6b2('0xad')][_0xb6b2('0xcb')]({'where':{'id':_0x7368f3[_0xb6b2('0xc6')]['id']}})[_0xb6b2('0x30')](handleEntityNotFound(_0xb9017a,null))[_0xb6b2('0x30')](function(_0x37fcc8){if(_0x37fcc8){_0x27d92c[_0xb6b2('0x4c')]=_[_0xb6b2('0x85')](db[_0xb6b2('0xdb')][_0xb6b2('0x48')]);_0x27d92c[_0xb6b2('0x4d')]=_[_0xb6b2('0x85')](_0x7368f3[_0xb6b2('0x4d')]);_0x27d92c[_0xb6b2('0x4e')]=_['intersection'](_0x27d92c['model'],_0x27d92c[_0xb6b2('0x4d')]);_0x2ddca3[_0xb6b2('0x4f')]=_[_0xb6b2('0x50')](_0x27d92c[_0xb6b2('0x4c')],qs[_0xb6b2('0x51')](_0x7368f3[_0xb6b2('0x4d')][_0xb6b2('0x51')]));_0x2ddca3[_0xb6b2('0x4f')]=_0x2ddca3[_0xb6b2('0x4f')][_0xb6b2('0x52')]?_0x2ddca3['attributes']:_0x27d92c[_0xb6b2('0x4c')];if(!_0x7368f3[_0xb6b2('0x4d')][_0xb6b2('0x53')](_0xb6b2('0x54'))){_0x2ddca3[_0xb6b2('0x29')]=qs[_0xb6b2('0x29')](_0x7368f3[_0xb6b2('0x4d')]['limit']);_0x2ddca3[_0xb6b2('0x28')]=qs[_0xb6b2('0x28')](_0x7368f3[_0xb6b2('0x4d')][_0xb6b2('0x28')]);}_0x2ddca3['order']=qs[_0xb6b2('0x56')](_0x7368f3[_0xb6b2('0x4d')][_0xb6b2('0x56')]);_0x2ddca3['where']=qs['filters'](_[_0xb6b2('0x117')](_0x7368f3[_0xb6b2('0x4d')],_0x27d92c[_0xb6b2('0x4e')]));_0x2ddca3[_0xb6b2('0x57')][_0xb6b2('0xc2')]=_0x37fcc8['id'];if(_0x7368f3['query']['filter']){_0x2ddca3[_0xb6b2('0x57')]=_[_0xb6b2('0x35')](_0x2ddca3['where'],{'$or':_['map'](_0x2ddca3[_0xb6b2('0x4f')],function(_0x15ea1e){var _0x20c077={};_0x20c077[_0x15ea1e]={'$like':'%'+_0x7368f3[_0xb6b2('0x4d')][_0xb6b2('0x95')]+'%'};return _0x20c077;})});}_0x2ddca3['where'][_0xb6b2('0x105')]=![];if(_0x7368f3[_0xb6b2('0x4d')]['id']){_0x2ddca3[_0xb6b2('0x57')]['id']={'$gt':_0x7368f3[_0xb6b2('0x4d')]['id']};}_0x2ddca3=_[_0xb6b2('0x35')]({},_0x2ddca3,_0x7368f3['options']);return db[_0xb6b2('0xdb')][_0xb6b2('0x2b')]({'where':_0x2ddca3['where']})[_0xb6b2('0x30')](function(_0x8d955c){_0x5ba306['count']=_0x8d955c;_0x2ddca3[_0xb6b2('0xc8')]=[];if(_0x7368f3[_0xb6b2('0x4d')][_0xb6b2('0x11c')]){_0x2ddca3[_0xb6b2('0xc8')]['push']({'model':db[_0xb6b2('0x82')],'as':'User','attributes':['id',_0xb6b2('0xd2'),_0xb6b2('0x100')]});}if(_0x7368f3[_0xb6b2('0x4d')][_0xb6b2('0xc7')]){_0x2ddca3[_0xb6b2('0xc8')]=[{'all':!![]}];}return db[_0xb6b2('0xdb')][_0xb6b2('0x11a')](_0x2ddca3);})[_0xb6b2('0x30')](function(_0x42281b){_0x5ba306[_0xb6b2('0xc4')]=_0x42281b;return _0x5ba306;});}})['then'](respondWithFilteredResult(_0xb9017a,_0x2ddca3))[_0xb6b2('0x3e')](handleError(_0xb9017a,null));};exports['addTags']=function(_0x27bd38,_0x2ae9dc,_0x126984){return db[_0xb6b2('0xad')]['find']({'where':{'id':_0x27bd38['params']['id']}})['then'](handleEntityNotFound(_0x2ae9dc,null))[_0xb6b2('0x30')](function(_0x173edb){if(_0x173edb){return _0x173edb['setTags'](_0x27bd38['body']['ids'],_[_0xb6b2('0x116')](_0x27bd38[_0xb6b2('0x84')],['ids','id'])||{})[_0xb6b2('0x11d')](function(){return db[_0xb6b2('0x7f')][_0xb6b2('0x11a')]({'attributes':['id','name',_0xb6b2('0x59')],'where':{'id':_0x27bd38[_0xb6b2('0x84')][_0xb6b2('0x115')]}});})[_0xb6b2('0x30')](function(_0xbdef8f){socket[_0xb6b2('0x11e')](_0xb6b2('0x11f'),{'id':Number(_0x27bd38[_0xb6b2('0xc6')]['id']),'tags':_0xbdef8f||[]});return{'id':Number(_0x27bd38[_0xb6b2('0xc6')]['id']),'tags':_0xbdef8f||[]};});}})[_0xb6b2('0x30')](respondWithResult(_0x2ae9dc,null))['catch'](handleError(_0x2ae9dc,null));};exports[_0xb6b2('0x120')]=function(_0x27cd16,_0x1a10aa,_0x3a6610){return db[_0xb6b2('0xad')]['find']({'where':{'id':_0x27cd16['params']['id']}})[_0xb6b2('0x30')](handleEntityNotFound(_0x1a10aa,null))['then'](function(_0x40bd7d){if(_0x40bd7d){return _0x40bd7d[_0xb6b2('0x120')](_0x27cd16[_0xb6b2('0x4d')][_0xb6b2('0x115')]);}})['then'](respondWithStatusCode(_0x1a10aa,null))[_0xb6b2('0x3e')](handleError(_0x1a10aa,null));};exports[_0xb6b2('0xf0')]=function(_0xb33f09,_0x431b79){var _0xb273b7=moment()['unix']()[_0xb6b2('0xab')]();var _0x50328e=path[_0xb6b2('0xec')](config['root'],_0xb6b2('0x121'),_0xb6b2('0x122'),_0xb6b2('0x123'));var _0x40942a=path[_0xb6b2('0xec')](config[_0xb6b2('0xf3')],'server',_0xb6b2('0x122'),'attachments');var _0x92eeba=path[_0xb6b2('0xec')](_0x50328e,_0xb273b7);var _0x3d1f79=util[_0xb6b2('0xf4')](_0xb6b2('0x124'),_0xb33f09['params']['id'],_0xb273b7);var _0x289110=path[_0xb6b2('0xec')](_0x50328e,_0x3d1f79);var _0x34be29=[];_0x34be29[_0xb6b2('0x3d')]({'model':db[_0xb6b2('0x82')],'as':_0xb6b2('0x82'),'attributes':['id',_0xb6b2('0xd2')],'raw':!![]});_0x34be29[_0xb6b2('0x3d')]({'model':db[_0xb6b2('0xf8')],'as':_0xb6b2('0x75'),'attributes':['id','firstName',_0xb6b2('0x125')],'raw':!![]});if(_0xb33f09[_0xb6b2('0x4d')]['attachments']){_0x34be29[_0xb6b2('0x3d')]({'model':db[_0xb6b2('0xe7')],'as':_0xb6b2('0xe7'),'raw':!![]});}var _0x2d0c9f=[{'model':db[_0xb6b2('0xdb')],'as':_0xb6b2('0xf7'),'attributes':['id',_0xb6b2('0x84'),_0xb6b2('0x8b'),_0xb6b2('0x104'),_0xb6b2('0x105'),_0xb6b2('0x91')],'include':_0x34be29}];_0x2d0c9f['push']({'model':db['ChatWebsite'],'as':_0xb6b2('0x126'),'attributes':['id',_0xb6b2('0x33')]});_0x2d0c9f[_0xb6b2('0x3d')]({'model':db[_0xb6b2('0x82')],'as':_0xb6b2('0x127'),'attributes':['id','fullname']});return db[_0xb6b2('0xad')][_0xb6b2('0x70')]({'where':{'id':_0xb33f09[_0xb6b2('0xc6')]['id']},'include':_0x2d0c9f})['then'](handleEntityNotFound(_0x431b79,null))[_0xb6b2('0x30')](function(_0x20ff2e){if(_0x20ff2e){var _0x40f6c1=_0x20ff2e[_0xb6b2('0x128')]({'plain':!![]});fs['mkdirSync'](_0x92eeba);var _0x4bec5f={'channel':_0xb6b2('0x129'),'account':_0x40f6c1[_0xb6b2('0x126')][_0xb6b2('0x33')],'agent':_0x40f6c1['Owner']?_0x40f6c1[_0xb6b2('0x127')][_0xb6b2('0xd2')]:'N.A.','createdAt':moment(_0x40f6c1['createdAt'])[_0xb6b2('0xf4')](_0xb6b2('0x118'))['toString'](),'closedAt':_0x40f6c1['closed']?moment(_0x40f6c1['closedAt'])['format'](_0xb6b2('0x118'))[_0xb6b2('0xab')]():'','disposition':_0x40f6c1[_0xb6b2('0x46')],'chatInfo':{'browser':_0x40f6c1['browserName'],'os':_0x40f6c1[_0xb6b2('0x12a')],'referer':_0x40f6c1[_0xb6b2('0x12b')],'customerIp':_0x40f6c1['customerIp'],'customerPort':_0x40f6c1['customerPort']?_0x40f6c1['customerPort']:_0xb6b2('0x12c')},'messages':_(_0x40f6c1[_0xb6b2('0xf7')])[_0xb6b2('0x12d')]()[_0xb6b2('0x95')]({'secret':![]})['map'](function(_0x4e226e){if(_0x4e226e[_0xb6b2('0xe7')]){var _0x28c834=path['join'](_0x40942a,_0x4e226e[_0xb6b2('0xe7')][_0xb6b2('0xef')]);if(fs[_0xb6b2('0x12e')](_0x28c834)){fs[_0xb6b2('0x12f')](_0x28c834)[_0xb6b2('0x130')](fs['createWriteStream'](path[_0xb6b2('0xec')](_0x92eeba,_0x4e226e[_0xb6b2('0xe7')][_0xb6b2('0xef')])));}}return{'date':moment(_0x4e226e['createdAt'])[_0xb6b2('0xf4')](_0xb6b2('0x118'))['toString'](),'sender':_0x4e226e[_0xb6b2('0x104')]===_0xb6b2('0xda')?_0x4e226e[_0xb6b2('0x82')]?_0x4e226e['User']['fullname']:_0xb6b2('0xfe'):_0x4e226e['Contact'][_0xb6b2('0x131')]+(_0x4e226e['Contact'][_0xb6b2('0x125')]?'\x20'+_0x4e226e[_0xb6b2('0x75')][_0xb6b2('0x125')]:''),'body':_0x4e226e[_0xb6b2('0xe7')]?_0x4e226e[_0xb6b2('0xe7')][_0xb6b2('0xef')]:_0x4e226e[_0xb6b2('0x84')],'direction':_0x4e226e[_0xb6b2('0x104')]===_0xb6b2('0xda')?'A':'C','secret':_0x4e226e[_0xb6b2('0x105')],'read':_0x4e226e[_0xb6b2('0x91')],'attachment':_0x4e226e[_0xb6b2('0xe7')]};})[_0xb6b2('0x77')]()};return ejs[_0xb6b2('0x132')](path[_0xb6b2('0xec')](config['root'],'server',_0xb6b2('0x133'),_0xb6b2('0x134')),{'interaction':_0x4bec5f})['then'](function(_0x3824a2){var _0x53aa75=path[_0xb6b2('0xec')](_0x92eeba,'transcript-'+_0x40f6c1['id']+'-'+_0xb273b7+_0xb6b2('0x135'));var _0x4d9b2a={'path':_0x53aa75,'channel':_0xb6b2('0x129'),'interactionId':_0x40f6c1['id']};return pdf['createPdfFromHTML'](_0x3824a2,_0x4d9b2a);})[_0xb6b2('0x30')](function(){return new BPromise(function(_0x131ad9,_0x5dbe7f){zipdir(_0x92eeba,{'saveTo':_0x289110},function(_0xb6b198,_0x2a8d9b){if(_0xb6b198)return _0x5dbe7f(_0xb6b198);return _0x131ad9(_0x2a8d9b);});})['then'](function(){return new BPromise(function(_0x225ce0,_0x432fd1){rimraf(_0x92eeba,function(_0x36abe8){if(_0x36abe8)_0x432fd1(_0x36abe8);return _0x225ce0();});});})['then'](function(){return _0x431b79['download'](_0x289110,_0x3d1f79,function(_0x1cde6c){if(_0x1cde6c){console[_0xb6b2('0x136')]('err',_0x1cde6c);}else{fs[_0xb6b2('0x137')](_0x289110);}});});});}else{return _0x431b79[_0xb6b2('0x25')](0xc8);}})[_0xb6b2('0x3e')](handleError(_0x431b79,null));}; \ No newline at end of file +var _0xc22b=['Account','N.A.','closedAt','browserName','referer','customerIp','customerPort','existsSync','createReadStream','pipe','renderFile','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','zip-dir','request-promise','moment','bluebird','mustache','util','lodash','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','destroy','end','sendStatus','stack','name','render','body','contact','interaction','account','Users','map','fullname','TagIds','Tags','split','forEach','push','waiting','talking','answered','abandoned','total','closed','UserId','disposition','unmanaged','ChatInteraction','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','select','field','color','from','tools_tags','u.id','u.fullname','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','chat_messages','chat_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','conditions','unreadMessages','value','having','`\x20>\x200','Contact','operator','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','Tag','union','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','some','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','QueryTypes','SELECT','clone','order','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','agent','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','ChatInteractionId','show','params','includeAll','include','merge','options','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooMetadata','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooNote','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Sequelize','Error\x20in\x20Vidaoo\x20configuration','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','attachmentUpload','file','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','join','root','offline-chat/','basename','close','mailTranscript','server/files/chat/upload/','pathTranscript','Messages','User','CmContact','format','%s%d','agentAlias','System','Visitor','agentIdentifier','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','sendMail','\x22%s\x22\x20<%s>','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','nolimit','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','getMyMessages','includeAgent','addTags','setTags','spread','chatInteractionTags:save','removeTags','download','unix','tmp','server','files','attachments','firstName','lastName','Owner','get','mkdirSync','Chat'];(function(_0x5128e5,_0x319cb1){var _0x31b9b4=function(_0x81bcff){while(--_0x81bcff){_0x5128e5['push'](_0x5128e5['shift']());}};_0x31b9b4(++_0x319cb1);}(_0xc22b,0x14d));var _0xbc22=function(_0x3a5ce5,_0x501ad8){_0x3a5ce5=_0x3a5ce5-0x0;var _0x45ab6c=_0xc22b[_0x3a5ce5];return _0x45ab6c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xbc22('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbc22('0x1'));var moment=require(_0xbc22('0x2'));var BPromise=require(_0xbc22('0x3'));var Mustache=require(_0xbc22('0x4'));var util=require(_0xbc22('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbc22('0x6'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xbc22('0x7'));var deskjs=require(_0xbc22('0x8'));var toCsv=require(_0xbc22('0x9'));var querystring=require('querystring');var Papa=require(_0xbc22('0xa'));var Redis=require('ioredis');var authService=require(_0xbc22('0xb'));var qs=require(_0xbc22('0xc'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xbc22('0xd'));var hardwareService=require(_0xbc22('0xe'));var logger=require(_0xbc22('0xf'))(_0xbc22('0x10'));var utils=require('../../config/utils');var config=require(_0xbc22('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0xbc22('0x12'))['db'];config[_0xbc22('0x13')]=_[_0xbc22('0x14')](config[_0xbc22('0x13')],{'host':_0xbc22('0x15'),'port':0x18eb});var socket=require(_0xbc22('0x16'))(new Redis(config['redis']));require('./chatInteraction.socket')[_0xbc22('0x17')](socket);var jayson=require(_0xbc22('0x18'));var client=jayson[_0xbc22('0x19')][_0xbc22('0x1a')]({'port':0x232b});var client9004=jayson[_0xbc22('0x19')]['http']({'port':0x232c});function respondWithRpcPromise(_0x1193d4,_0x3637fb,_0x3b682b,_0x26a6d2){return new BPromise(function(_0x5ad2e9,_0x16d77f){var _0x192023=_0x26a6d2||client;return _0x192023[_0xbc22('0x1b')](_0x1193d4,_0x3b682b)[_0xbc22('0x1c')](function(_0xb1dfe0){logger[_0xbc22('0x1d')](_0xbc22('0x1e'),_0x3637fb,_0xbc22('0x1f'));logger[_0xbc22('0x20')](_0xbc22('0x21'),_0x3637fb,_0xbc22('0x1f'),JSON[_0xbc22('0x22')](_0xb1dfe0));if(_0xb1dfe0['error']){if(_0xb1dfe0[_0xbc22('0x23')][_0xbc22('0x24')]===0x1f4){logger[_0xbc22('0x23')](_0xbc22('0x1e'),_0x3637fb,_0xb1dfe0['error'][_0xbc22('0x25')]);return _0x16d77f(_0xb1dfe0[_0xbc22('0x23')][_0xbc22('0x25')]);}logger[_0xbc22('0x23')](_0xbc22('0x1e'),_0x3637fb,_0xb1dfe0['error']['message']);return _0x5ad2e9(_0xb1dfe0['error'][_0xbc22('0x25')]);}else{logger[_0xbc22('0x1d')]('ChatInteraction,\x20%s,\x20%s',_0x3637fb,_0xbc22('0x1f'));_0x5ad2e9(_0xb1dfe0[_0xbc22('0x26')][_0xbc22('0x25')]);}})[_0xbc22('0x27')](function(_0x3dbe4d){logger[_0xbc22('0x23')](_0xbc22('0x1e'),_0x3637fb,_0x3dbe4d);_0x16d77f(_0x3dbe4d);});});}function respondWithStatusCode(_0x54204f,_0x3fb59a){_0x3fb59a=_0x3fb59a||0xcc;return function(_0x105930){if(_0x105930){return _0x54204f['sendStatus'](_0x3fb59a);}return _0x54204f[_0xbc22('0x28')](_0x3fb59a)['end']();};}function respondWithResult(_0x3b2dba,_0x3ef71a){_0x3ef71a=_0x3ef71a||0xc8;return function(_0x33f010){if(_0x33f010){return _0x3b2dba[_0xbc22('0x28')](_0x3ef71a)[_0xbc22('0x29')](_0x33f010);}};}function respondWithFilteredResult(_0x4b41f3,_0x17aef3){return function(_0x88b2d2){if(_0x88b2d2){var _0x560333=typeof _0x17aef3[_0xbc22('0x2a')]==='undefined'&&typeof _0x17aef3['limit']===_0xbc22('0x2b');var _0x40c9be=_0x88b2d2['count'];var _0x32f970=_0x560333?0x0:_0x17aef3[_0xbc22('0x2a')];var _0x34311a=_0x560333?_0x88b2d2[_0xbc22('0x2c')]:_0x17aef3[_0xbc22('0x2a')]+_0x17aef3[_0xbc22('0x2d')];var _0x4ee60c;if(_0x34311a>=_0x40c9be){_0x34311a=_0x40c9be;_0x4ee60c=0xc8;}else{_0x4ee60c=0xce;}_0x4b41f3['status'](_0x4ee60c);return _0x4b41f3[_0xbc22('0x2e')](_0xbc22('0x2f'),_0x32f970+'-'+_0x34311a+'/'+_0x40c9be)[_0xbc22('0x29')](_0x88b2d2);}return null;};}function patchUpdates(_0x25a666){return function(_0x2f1d0f){try{jsonpatch[_0xbc22('0x30')](_0x2f1d0f,_0x25a666,!![]);}catch(_0xef3436){return BPromise[_0xbc22('0x31')](_0xef3436);}return _0x2f1d0f['save']();};}function saveUpdates(_0x46112d,_0x40485c){return function(_0x537dc2){if(_0x537dc2){return _0x537dc2[_0xbc22('0x32')](_0x46112d)[_0xbc22('0x1c')](function(_0x4fb994){return _0x4fb994;});}return null;};}function removeEntity(_0x314b89,_0x40de9e){return function(_0x1ec5cd){if(_0x1ec5cd){return _0x1ec5cd[_0xbc22('0x33')]()[_0xbc22('0x1c')](function(){_0x314b89[_0xbc22('0x28')](0xcc)[_0xbc22('0x34')]();});}};}function handleEntityNotFound(_0x190c1c,_0x6749f4){return function(_0x44dad0){if(!_0x44dad0){_0x190c1c[_0xbc22('0x35')](0x194);}return _0x44dad0;};}function handleError(_0x599025,_0x3d7738){_0x3d7738=_0x3d7738||0x1f4;return function(_0x5737ca){logger['error'](_0x5737ca[_0xbc22('0x36')]);if(_0x5737ca[_0xbc22('0x37')]){delete _0x5737ca[_0xbc22('0x37')];}_0x599025[_0xbc22('0x28')](_0x3d7738)['send'](_0x5737ca);};}function getMustacheRender(_0x5841d3,_0x272aa4){return Mustache[_0xbc22('0x38')](_0x5841d3,_['merge'](_0x272aa4[_0xbc22('0x39')],{'contact':_0x272aa4[_0xbc22('0x3a')],'message':_0x272aa4[_0xbc22('0x25')],'agent':_0x272aa4['agent'],'interaction':_0x272aa4[_0xbc22('0x3b')],'account':_0x272aa4[_0xbc22('0x3c')]}))||'';}function getInteractionUsers(_0x39f893,_0x107330){return new BPromise(function(_0x2a5e00,_0x124a1c){try{if(_0x107330[_0x39f893['id']]){_0x39f893[_0xbc22('0x3d')]=_[_0xbc22('0x3e')](_0x107330[_0x39f893['id']],function(_0x58c049){return{'id':_0x58c049['id'],'fullname':_0x58c049[_0xbc22('0x3f')]};});}}catch(_0x15596c){_0x124a1c(_0x15596c);}_0x2a5e00(_0x39f893);});}function getInteractionTags(_0xd31348,_0x1ff4cc){return new BPromise(function(_0x3cc86f,_0x159c56){try{if(_0xd31348[_0xbc22('0x40')]){_0xd31348[_0xbc22('0x41')]=[];_0xd31348[_0xbc22('0x40')][_0xbc22('0x42')](',')[_0xbc22('0x43')](function(_0x2a8968){_0xd31348[_0xbc22('0x41')][_0xbc22('0x44')](_0x1ff4cc[_0x2a8968]);});}delete _0xd31348[_0xbc22('0x40')];}catch(_0x245a25){_0x159c56(_0x245a25);}_0x3cc86f(_0xd31348);});}function updateChatInteraction(_0x463d1f,_0x468301,_0x44f911){return new BPromise(function(_0xef14da,_0x44fe7b){return getInteractionUsers(_0x463d1f,_0x44f911)['then'](function(_0x48ee8b){return getInteractionTags(_0x48ee8b,_0x468301);})[_0xbc22('0x1c')](function(_0x151450){return getStateInteraction(_0x151450);})['then'](function(_0x2da21f){_0xef14da(_0x2da21f);})[_0xbc22('0x27')](function(_0x42762d){_0x44fe7b(_0x42762d);});});}function getStateInteraction(_0x317230){return new BPromise(function(_0x21aef4){_0x317230[_0xbc22('0x45')]=0x0;_0x317230[_0xbc22('0x46')]=0x0;_0x317230[_0xbc22('0x47')]=0x0;_0x317230['unmanaged']=0x0;_0x317230[_0xbc22('0x48')]=0x0;_0x317230[_0xbc22('0x49')]=0x0;if(!_0x317230[_0xbc22('0x4a')]&&!_0x317230[_0xbc22('0x4b')]){_0x317230[_0xbc22('0x45')]+=0x1;}if(!_0x317230[_0xbc22('0x4a')]&&_0x317230[_0xbc22('0x4b')]){_0x317230[_0xbc22('0x46')]+=0x1;if(_0x317230[_0xbc22('0x45')]){_0x317230[_0xbc22('0x45')]-=0x1;}}if(_0x317230['closed']&&_0x317230[_0xbc22('0x4c')]==='abandoned'){_0x317230[_0xbc22('0x48')]+=0x1;if(_0x317230[_0xbc22('0x45')]){_0x317230[_0xbc22('0x45')]-=0x1;}}else if(_0x317230['closed']&&!_0x317230[_0xbc22('0x4b')]&&_0x317230[_0xbc22('0x4c')]){_0x317230[_0xbc22('0x4d')]+=0x1;if(_0x317230[_0xbc22('0x45')]){_0x317230[_0xbc22('0x45')]-=0x1;}}else if(_0x317230[_0xbc22('0x4a')]&&_0x317230[_0xbc22('0x4b')]){_0x317230['answered']+=0x1;if(_0x317230['talking']){_0x317230[_0xbc22('0x46')]-=0x1;}}_0x317230[_0xbc22('0x49')]+=0x1;_0x21aef4(_0x317230);});}exports['index']=function(_0x14b80d,_0x1caab1){var _0x553290={},_0xcd954f={},_0xd81a5={'count':0x0,'rows':[]};var _0x384bb7=_[_0xbc22('0x3e')](db[_0xbc22('0x4e')][_0xbc22('0x4f')],function(_0x4d75c4){return{'name':_0x4d75c4[_0xbc22('0x50')],'type':_0x4d75c4[_0xbc22('0x51')][_0xbc22('0x52')]};});_0xcd954f[_0xbc22('0x53')]=_['map'](_0x384bb7,_0xbc22('0x37'));_0xcd954f[_0xbc22('0x54')]=_[_0xbc22('0x55')](_0x14b80d['query']);_0xcd954f['filters']=_[_0xbc22('0x56')](_0xcd954f[_0xbc22('0x53')],_0xcd954f['query']);_0x553290[_0xbc22('0x57')]=_[_0xbc22('0x56')](_0xcd954f[_0xbc22('0x53')],qs[_0xbc22('0x58')](_0x14b80d['query'][_0xbc22('0x58')]));_0x553290[_0xbc22('0x57')]=_0x553290[_0xbc22('0x57')][_0xbc22('0x59')]?_0x553290[_0xbc22('0x57')]:_0xcd954f['model'];if(!_0x14b80d['query'][_0xbc22('0x5a')]('nolimit')){_0x553290[_0xbc22('0x2d')]=qs[_0xbc22('0x2d')](_0x14b80d['query'][_0xbc22('0x2d')]);_0x553290['offset']=qs[_0xbc22('0x2a')](_0x14b80d[_0xbc22('0x54')]['offset']);}_0x553290['order']=qs[_0xbc22('0x5b')](_0x14b80d[_0xbc22('0x54')][_0xbc22('0x5b')]);_0x553290[_0xbc22('0x5c')]=qs[_0xbc22('0x5d')](_[_0xbc22('0x5e')](_0x14b80d['query'],_0xcd954f[_0xbc22('0x5d')]),_0x384bb7);var _0x2ea03d=[];var _0x4e5f74=squel[_0xbc22('0x5f')]()[_0xbc22('0x60')]('id')[_0xbc22('0x60')](_0xbc22('0x37'))['field'](_0xbc22('0x61'))[_0xbc22('0x62')](_0xbc22('0x63'));var _0x2b79dd=squel['select']()['field'](_0xbc22('0x64'))[_0xbc22('0x60')](_0xbc22('0x65'))[_0xbc22('0x60')]('ui.ChatInteractionId')['from']('user_has_chat_interactions','ui')[_0xbc22('0x66')](_0xbc22('0x67'),'u',_0xbc22('0x68'));var _0x2da8be=squel[_0xbc22('0x5f')]()[_0xbc22('0x62')](_0xbc22('0x69'),'i')[_0xbc22('0x66')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xbc22('0x66')](_0xbc22('0x67'),'o',_0xbc22('0x6a'))['left_join']('chat_websites','a',_0xbc22('0x6b'))[_0xbc22('0x66')](_0xbc22('0x6c'),'me','me.ChatInteractionId\x20=\x20i.id')[_0xbc22('0x66')](_0xbc22('0x6d'),'it','it.ChatInteractionId\x20=\x20i.id')[_0xbc22('0x66')](_0xbc22('0x63'),'t',_0xbc22('0x6e'));var _0x39feff=squel['expr']();var _0x1749f1=[];var _0x55b176=squel[_0xbc22('0x6f')]();var _0x2cd30c;if(_0x14b80d[_0xbc22('0x54')]['search']){_0x2cd30c=as['parseSearch'](_0x14b80d[_0xbc22('0x54')][_0xbc22('0x70')]);var _0x4857eb=_0x2cd30c['sqlOperator'];for(var _0x2d56f0=0x0;_0x2d56f0<_0x2cd30c[_0xbc22('0x71')]['length'];_0x2d56f0++){var _0x43fce5=_0x2cd30c[_0xbc22('0x71')][_0x2d56f0];var _0x5b8643='i';var _0x17cf5a=_['find'](_0x384bb7,['name',_0x43fce5[_0xbc22('0x60')]]);if(!_0x17cf5a){switch(_0x43fce5[_0xbc22('0x60')]){case _0xbc22('0x72'):if(_0x43fce5[_0xbc22('0x73')]==0x1){_0x2da8be[_0xbc22('0x74')]('`'+_0x43fce5[_0xbc22('0x60')]+'`\x20=\x200');}else{_0x2da8be[_0xbc22('0x74')]('`'+_0x43fce5[_0xbc22('0x60')]+_0xbc22('0x75'));}break;case _0xbc22('0x76'):if(_0x43fce5[_0xbc22('0x77')]==='$substring'){if(_0x43fce5[_0xbc22('0x73')][_0xbc22('0x42')]('\x20')[_0xbc22('0x59')]>0x1){_0x39feff[_0x4857eb]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xbc22('0x78')](_0x43fce5['value']),null);}else{var _0x40bc3b='%'+_0x43fce5[_0xbc22('0x73')]+'%';_0x39feff[_0x4857eb](_0xbc22('0x79'),_0x40bc3b,_0x40bc3b,_0x40bc3b);}}else{_0x17cf5a=_[_0xbc22('0x7a')](_0x384bb7,[_0xbc22('0x37'),_0xbc22('0x7b')]);_0x43fce5[_0xbc22('0x60')]=_0xbc22('0x7b');_0x15b980=as[_0xbc22('0x7c')](_0x5b8643,_0x17cf5a[_0xbc22('0x51')],_0x43fce5);_0x39feff[_0x4857eb](_0x15b980[_0xbc22('0x7d')],_0x15b980['value'][_0xbc22('0x7e')],_0x15b980['value'][_0xbc22('0x34')]);}break;case _0xbc22('0x7f'):var _0x35ccd4=_0x43fce5[_0xbc22('0x73')]['split'](',')['map'](function(_0x2d4acf){return Number(_0x2d4acf);});_0x35ccd4['forEach'](function(_0x4c9d0e){_0x55b176['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4c9d0e+',%');});_0x1749f1=_[_0xbc22('0x80')](_0x1749f1,_0x35ccd4);break;case'User':if(_0x43fce5['operator']===_0xbc22('0x81')){_0x39feff[_0x4857eb](_0xbc22('0x82'),'%'+_0x43fce5['value']+'%',null);}else{_0x17cf5a=_[_0xbc22('0x7a')](_0x384bb7,[_0xbc22('0x37'),_0xbc22('0x4b')]);_0x43fce5['field']=_0xbc22('0x4b');_0x15b980=as[_0xbc22('0x7c')](_0x5b8643,_0x17cf5a[_0xbc22('0x51')],_0x43fce5);_0x39feff[_0x4857eb](_0x15b980[_0xbc22('0x7d')],_0x15b980[_0xbc22('0x73')][_0xbc22('0x7e')],_0x15b980[_0xbc22('0x73')][_0xbc22('0x34')]);}break;case _0xbc22('0x39'):_0x15b980=as[_0xbc22('0x7c')]('me',null,_0x43fce5);_0x39feff[_0x4857eb](_0x15b980['text'],_0x15b980['value'][_0xbc22('0x7e')],_0x15b980[_0xbc22('0x73')][_0xbc22('0x34')]);break;}}else{var _0x15b980=as['buildExpression'](_0x5b8643,_0x17cf5a[_0xbc22('0x51')],_0x43fce5);_0x39feff[_0x4857eb](_0x15b980[_0xbc22('0x7d')],_0x15b980['value'][_0xbc22('0x7e')],_0x15b980[_0xbc22('0x73')][_0xbc22('0x34')]);}}}else{var _0x4f13e8=_(_0x14b80d[_0xbc22('0x54')])[_0xbc22('0x55')]()[_0xbc22('0x3e')](function(_0x1c7c20){return _[_0xbc22('0x83')](_0x384bb7,[_0xbc22('0x37'),_0x1c7c20])?_0x1c7c20:undefined;})[_0xbc22('0x84')]()[_0xbc22('0x73')]();if(!_[_0xbc22('0x85')](_0x4f13e8)){_0x4f13e8[_0xbc22('0x43')](function(_0x23ff5e){if(_0x23ff5e===_0xbc22('0x86')){_0x2da8be['where'](_0xbc22('0x87'),[][_0xbc22('0x88')](_0x14b80d['query'][_0x23ff5e]));}else if(_0x23ff5e===_0xbc22('0x89')){var _0x2e1f93=JSON[_0xbc22('0x8a')](_0x14b80d[_0xbc22('0x54')][_0x23ff5e])[_0xbc22('0x8b')];var _0x2c1623=JSON[_0xbc22('0x8a')](_0x14b80d[_0xbc22('0x54')][_0x23ff5e])['$lte'];_0x2da8be[_0xbc22('0x5c')](_0xbc22('0x8c'),_0x2e1f93,_0x2c1623);}else{if(_0x14b80d['query'][_0x23ff5e]===_0xbc22('0x8d')){_0x2da8be[_0xbc22('0x5c')]('i.'+_0x23ff5e+_0xbc22('0x8e'));}else{_0x2da8be[_0xbc22('0x5c')]('i.'+_0x23ff5e+_0xbc22('0x8f'),_0x14b80d[_0xbc22('0x54')][_0x23ff5e]);}}});}if(_0x14b80d[_0xbc22('0x54')][_0xbc22('0x90')]){if(_0x14b80d[_0xbc22('0x54')][_0xbc22('0x90')]==0x1){_0x2da8be[_0xbc22('0x74')](_0xbc22('0x91'));}else{_0x2da8be['having'](_0xbc22('0x92'));}}if(_0x14b80d[_0xbc22('0x54')][_0xbc22('0x93')]){_0x1749f1=_[_0xbc22('0x94')](_0x14b80d[_0xbc22('0x54')][_0xbc22('0x93')])?_0x14b80d[_0xbc22('0x54')]['tag']:new Array(_0x14b80d[_0xbc22('0x54')][_0xbc22('0x93')]);_0x1749f1[_0xbc22('0x43')](function(_0x2c9c83){_0x55b176['or'](_0xbc22('0x95'),'%,'+_0x2c9c83+',%');});}if(_0x14b80d[_0xbc22('0x54')][_0xbc22('0x96')]){var _0xe527ab=_0x14b80d['query'][_0xbc22('0x96')][_0xbc22('0x97')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xbc22('0x98')](_0xe527ab)){_0x39feff['or'](_0xbc22('0x99'),_0xe527ab+'%');}else{_0x39feff['or'](_0xbc22('0x9a'),qs[_0xbc22('0x78')](_0xe527ab))['or'](_0xbc22('0x9b'),_0xe527ab+'%');}}}_0x2da8be[_0xbc22('0x5c')](_0x39feff);_0x2da8be['group'](_0xbc22('0x9c'));var _0xf56a4f={'type':db['Sequelize'][_0xbc22('0x9d')][_0xbc22('0x9e')],'raw':!![]};var _0x605a20=_0x2da8be[_0xbc22('0x9f')]();_0x605a20[_0xbc22('0x60')](_0xbc22('0x9c'));_0x605a20[_0xbc22('0x60')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xbc22('0x72'));if(_0x553290[_0xbc22('0xa0')]){_0x553290['order'][_0xbc22('0x43')](function(_0x298edb){var _0x217f73=_0x298edb[0x0]==='contactName'?_0x298edb[0x0]:'i.'+_0x298edb[0x0];_0x2da8be[_0xbc22('0xa0')](_0x217f73,_0x298edb[0x1]===_0xbc22('0xa1')?![]:!![]);});}if(!_[_0xbc22('0x85')](_0x1749f1)){_0x2da8be[_0xbc22('0x74')](_0x55b176);_0x605a20[_0xbc22('0x5c')](_0xbc22('0xa2'),_0x1749f1);}BPromise[_0xbc22('0xa3')]()['then'](function(){if(!_0x2cd30c){if(_0x14b80d[_0xbc22('0x54')][_0xbc22('0x86')])return;_0x605a20[_0xbc22('0x5c')](_0xbc22('0xa4'));_0x2da8be['where']('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x14b80d[_0xbc22('0xa5')][_0xbc22('0xa6')]!==_0xbc22('0xa7'))return;return _0x14b80d['user'][_0xbc22('0xa8')]({'attributes':['id'],'raw':!![]})['then'](function(_0x46e40d){if(_[_0xbc22('0x85')](_0x46e40d)){_0x605a20[_0xbc22('0x5c')](_0xbc22('0xa9'));_0x2da8be['where'](_0xbc22('0xa9'));}else{_0x605a20[_0xbc22('0x5c')](_0xbc22('0x87'),_['map'](_0x46e40d,'id'));_0x2da8be['where']('i.ChatWebsiteId\x20IN\x20?',_['map'](_0x46e40d,'id'));}});})['then'](function(){if(_0x14b80d[_0xbc22('0xa5')][_0xbc22('0xa6')]==='agent'&&!_0x2cd30c&&!_0x14b80d[_0xbc22('0x54')][_0xbc22('0x86')])return[];return db[_0xbc22('0xaa')][_0xbc22('0x54')](_0x605a20[_0xbc22('0xab')](),_0xf56a4f);})['then'](function(_0x1d8398){_0xd81a5['count']=_0x1d8398['length'];if(_0xd81a5['count']===0x0)return[];return db[_0xbc22('0xaa')][_0xbc22('0x54')](_0x4e5f74[_0xbc22('0xab')](),_0xf56a4f)[_0xbc22('0x1c')](function(_0x8abba0){_0x2ea03d=_[_0xbc22('0xac')](_0x8abba0,'id');_0xf56a4f=_['merge'](_0xf56a4f,{'model':db[_0xbc22('0x4e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x14b80d['query'][_0xbc22('0x58')]){_0x553290['attributes']['forEach'](function(_0x426cc6){_0x2da8be['field']('i.'+_0x426cc6);});}else{_0x2da8be['field'](_0xbc22('0xad'),'unreadMessages');_0x2da8be[_0xbc22('0x60')](_0xbc22('0xae'),_0xbc22('0xaf'));_0x2da8be[_0xbc22('0x60')](_0xbc22('0xb0'),'Account.mandatoryDisposition');_0x2da8be[_0xbc22('0x60')](_0xbc22('0xb1'),_0xbc22('0xb2'));_0x2da8be[_0xbc22('0x60')](_0xbc22('0xb3'));_0x2da8be['field'](_0xbc22('0xb4'),_0xbc22('0xb5'));_0x2da8be['field'](_0xbc22('0xb6'),_0xbc22('0xb7'));_0x2da8be[_0xbc22('0x60')]('c.email',_0xbc22('0xb8'));_0x2da8be[_0xbc22('0x60')](_0xbc22('0xb9'),'Contact.phone');_0x2da8be[_0xbc22('0x60')](_0xbc22('0xba'),_0xbc22('0xbb'));_0x2da8be[_0xbc22('0x60')]('c.fax',_0xbc22('0xbc'));_0x2da8be[_0xbc22('0x60')](_0xbc22('0xbd'),'Owner.fullname');_0x2da8be[_0xbc22('0x60')](_0xbc22('0xbe'),_0xbc22('0xbf'));_0x2da8be['field'](_0xbc22('0xc0'),_0xbc22('0x40'));}if(_0x553290[_0xbc22('0x2d')])_0x2da8be[_0xbc22('0x2d')](_0x553290['limit']);if(_0x553290['offset'])_0x2da8be[_0xbc22('0x2a')](_0x553290[_0xbc22('0x2a')]);return db[_0xbc22('0xaa')]['query'](_0x2da8be['toString'](),_0xf56a4f);})[_0xbc22('0x1c')](function(_0x1cc606){if(_0x1cc606[_0xbc22('0x59')]>0x0)_0x2b79dd[_0xbc22('0x5c')]('ui.ChatInteractionId\x20IN\x20?',_[_0xbc22('0x3e')](_0x1cc606,'id'));return db[_0xbc22('0xaa')]['query'](_0x2b79dd[_0xbc22('0xab')](),_0xf56a4f)[_0xbc22('0x1c')](function(_0x4e5752){var _0x2e946d=_[_0xbc22('0xc1')](_0x4e5752,_0xbc22('0xc2'));var _0x3c91b3=[];_0x1cc606[_0xbc22('0x43')](function(_0x2e1592){_0x3c91b3['push'](updateChatInteraction(_0x2e1592,_0x2ea03d,_0x2e946d));});return BPromise['all'](_0x3c91b3);});});})['then'](function(_0x4a4be7){_0xd81a5['rows']=_0x4a4be7;return _0xd81a5;})[_0xbc22('0x1c')](respondWithFilteredResult(_0x1caab1,_0x553290))['catch'](handleError(_0x1caab1,null));};exports[_0xbc22('0xc3')]=function(_0x1ca974,_0x12c3a1){var _0x113ef6={'raw':![],'where':{'id':_0x1ca974[_0xbc22('0xc4')]['id']}},_0x4965e0={};_0x4965e0[_0xbc22('0x53')]=_[_0xbc22('0x55')](db['ChatInteraction'][_0xbc22('0x4f')]);_0x4965e0[_0xbc22('0x54')]=_['keys'](_0x1ca974[_0xbc22('0x54')]);_0x4965e0[_0xbc22('0x5d')]=_['intersection'](_0x4965e0[_0xbc22('0x53')],_0x4965e0[_0xbc22('0x54')]);_0x113ef6[_0xbc22('0x57')]=_[_0xbc22('0x56')](_0x4965e0['model'],qs['fields'](_0x1ca974['query'][_0xbc22('0x58')]));_0x113ef6[_0xbc22('0x57')]=_0x113ef6[_0xbc22('0x57')][_0xbc22('0x59')]?_0x113ef6[_0xbc22('0x57')]:_0x4965e0[_0xbc22('0x53')];if(_0x1ca974['query'][_0xbc22('0xc5')]){_0x113ef6[_0xbc22('0xc6')]=[{'all':!![]}];}_0x113ef6=_[_0xbc22('0xc7')]({},_0x113ef6,_0x1ca974[_0xbc22('0xc8')]);return db[_0xbc22('0x4e')][_0xbc22('0x7a')](_0x113ef6)['then'](handleEntityNotFound(_0x12c3a1,null))[_0xbc22('0x1c')](respondWithResult(_0x12c3a1,null))[_0xbc22('0x27')](handleError(_0x12c3a1,null));};exports[_0xbc22('0xc9')]=function(_0x345490,_0x13bc89){return db['ChatInteraction'][_0xbc22('0xc9')](_0x345490[_0xbc22('0x39')],{})[_0xbc22('0x1c')](respondWithResult(_0x13bc89,0xc9))[_0xbc22('0x27')](handleError(_0x13bc89,null));};exports['update']=function(_0x4ff77b,_0x58ea6e){if(_0x4ff77b[_0xbc22('0x39')]['id']){delete _0x4ff77b[_0xbc22('0x39')]['id'];}return db[_0xbc22('0x4e')]['find']({'where':{'id':_0x4ff77b['params']['id']}})[_0xbc22('0x1c')](handleEntityNotFound(_0x58ea6e,null))[_0xbc22('0x1c')](saveUpdates(_0x4ff77b[_0xbc22('0x39')],null))[_0xbc22('0x1c')](respondWithResult(_0x58ea6e,null))['catch'](handleError(_0x58ea6e,null));};exports[_0xbc22('0x33')]=function(_0x36793b,_0xc02b95){return db[_0xbc22('0x4e')][_0xbc22('0x7a')]({'where':{'id':_0x36793b[_0xbc22('0xc4')]['id']}})[_0xbc22('0x1c')](handleEntityNotFound(_0xc02b95,null))[_0xbc22('0x1c')](removeEntity(_0xc02b95,null))['catch'](handleError(_0xc02b95,null));};exports[_0xbc22('0xca')]=function(_0x5ebe68,_0x153d87){return db[_0xbc22('0x4e')][_0xbc22('0xca')]()[_0xbc22('0x1c')](respondWithResult(_0x153d87,null))[_0xbc22('0x27')](handleError(_0x153d87,null));};exports[_0xbc22('0xcb')]=function(_0x424ff7,_0x13b747){var _0x26f0b0=_0x424ff7['params']['id'];var _0x344461;var _0x448e19;var _0x1b0395;return db[_0xbc22('0x4e')][_0xbc22('0xcc')]({'where':{'id':_0x26f0b0}})['then'](function(_0x111816){_0x344461=_0x111816;return db[_0xbc22('0xcd')][_0xbc22('0xcc')]({'where':{'id':_0x111816['ChatWebsiteId']},'attributes':['id',_0xbc22('0xce'),_0xbc22('0xcf'),_0xbc22('0xd0'),'vidaooNote',_0xbc22('0xd1')],'raw':!![]});})[_0xbc22('0x1c')](function(_0x59efe4){if(_0x59efe4&&_0x59efe4[_0xbc22('0xce')]&&_0x59efe4[_0xbc22('0xcf')]){_0x448e19=_0x59efe4;var _0x750385={'interaction':{'id':_0x26f0b0},'agent':{'id':_0x424ff7[_0xbc22('0xa5')]['id'],'name':_0x424ff7[_0xbc22('0xa5')][_0xbc22('0x37')],'fullname':_0x424ff7['user'][_0xbc22('0x3f')],'email':_0x424ff7[_0xbc22('0xa5')][_0xbc22('0xd2')]},'contact':_0x424ff7[_0xbc22('0x39')]['contact'],'account':_0x424ff7[_0xbc22('0x39')][_0xbc22('0x3c')]};var _0x886f7d={'rejectUnauthorized':![],'method':_0xbc22('0xd3'),'url':_0xbc22('0xd4'),'headers':{'X-APIKEY':_0x59efe4[_0xbc22('0xce')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x424ff7['user'][_0xbc22('0xd2')]],'buttons':null,'topic':_0x448e19[_0xbc22('0xd0')],'note':_[_0xbc22('0xd5')](_0x448e19[_0xbc22('0xd6')])?null:getMustacheRender(_0x448e19[_0xbc22('0xd6')],_0x750385),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0xbc22('0xd5')](_0x448e19[_0xbc22('0xd1')])){var _0x23ae7d=getMustacheRender(_0x448e19[_0xbc22('0xd1')],_0x750385);var _0x59f570=JSON['parse'](_0x23ae7d);_0x886f7d[_0xbc22('0x39')]['metadata']=_0x59f570;}}catch(_0x25f1b9){throw new db['Sequelize'][(_0xbc22('0xd7'))](_0xbc22('0xd8'));}return rp(_0x886f7d);}else{throw new db[(_0xbc22('0xd9'))][(_0xbc22('0xd7'))](_0xbc22('0xda'));}})['then'](function(_0x237198){_0x1b0395=_0x237198;if(_0x1b0395['id']){var _0x4039ce={'body':_0x1b0395['join_url'],'ChatWebsiteId':_0x448e19['id'],'ChatInteractionId':_0x344461['id'],'direction':_0xbc22('0xdb'),'UserId':_0x424ff7[_0xbc22('0xa5')]['id']};return db[_0xbc22('0xdc')][_0xbc22('0xc9')](_0x4039ce,{});}else{throw new db[(_0xbc22('0xd9'))]['ValidationError'](_0xbc22('0xdd'));}})[_0xbc22('0x1c')](function(){return _0x344461['updateAttributes']({'vidaooSessionId':_0x1b0395['id']});})[_0xbc22('0x1c')](respondWithResult(_0x13b747,null))[_0xbc22('0x27')](handleError(_0x13b747,null));};exports[_0xbc22('0xde')]=function(_0x5bce00,_0x25a17d){if(_0x5bce00[_0xbc22('0x39')]['id']){delete _0x5bce00['body']['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x5bce00[_0xbc22('0xc4')]['id']},'include':[{'model':db['CmContact'],'as':'Contact'}]})['then'](handleEntityNotFound(_0x25a17d,null))[_0xbc22('0x1c')](saveUpdates(_0x5bce00[_0xbc22('0x39')],null))[_0xbc22('0x1c')](respondWithResult(_0x25a17d,null))[_0xbc22('0x27')](handleError(_0x25a17d,null));};exports[_0xbc22('0xdf')]=function(_0x1df06a,_0x475494,_0x14856f){if(_0x1df06a[_0xbc22('0x39')]['id']){delete _0x1df06a[_0xbc22('0x39')]['id'];}return db[_0xbc22('0x4e')][_0xbc22('0x7a')]({'where':{'id':_0x1df06a[_0xbc22('0xc4')]['id']}})[_0xbc22('0x1c')](function(_0x5c94c2){if(!_0x5c94c2){logger[_0xbc22('0x23')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0xbc22('0xdf'),0x194,_0xbc22('0xe0'));_0x475494[_0xbc22('0x35')](0x194);}else{if(_0x5c94c2['UserId']){throw new db['Sequelize'][(_0xbc22('0xd7'))](_0xbc22('0xe1'));}}return _0x5c94c2;})[_0xbc22('0x1c')](function(_0x427b72){if(_0x427b72){return _0x427b72[_0xbc22('0x32')]({'closed':_0x1df06a['body'][_0xbc22('0x4a')],'disposition':_0x1df06a[_0xbc22('0x39')][_0xbc22('0x4c')]})[_0xbc22('0x1c')](function(_0x3e853e){return _0x3e853e;});}})[_0xbc22('0x1c')](function(_0x537934){return respondWithRpcPromise('AbandonInteraction','abandon',_0x1df06a[_0xbc22('0x39')],client9004);})[_0xbc22('0x1c')](respondWithResult(_0x475494,null))[_0xbc22('0x27')](handleError(_0x475494,null));};exports[_0xbc22('0xe2')]=function(_0x5cc8b6,_0x15e9dd,_0x35ad2f){_0x5cc8b6[_0xbc22('0x39')]['name']=_0x5cc8b6[_0xbc22('0xe3')]['originalname'];_0x5cc8b6[_0xbc22('0x39')]['basename']=_0x5cc8b6[_0xbc22('0xe3')][_0xbc22('0xe4')];_0x5cc8b6['body'][_0xbc22('0x51')]=_0x5cc8b6[_0xbc22('0xe3')][_0xbc22('0xe5')];return db[_0xbc22('0xe6')][_0xbc22('0xc9')](_0x5cc8b6[_0xbc22('0x39')])[_0xbc22('0x1c')](respondWithResult(_0x15e9dd,0xc9))[_0xbc22('0x27')](handleError(_0x15e9dd,null));};exports[_0xbc22('0xe7')]=function(_0x2fc954,_0x3ac4b9,_0x27f355){return db[_0xbc22('0x4e')][_0xbc22('0xcc')]({'where':{'id':_0x2fc954[_0xbc22('0xc4')]['id']},'raw':!![]})[_0xbc22('0x1c')](handleEntityNotFound(_0x3ac4b9,null))[_0xbc22('0x1c')](function(_0x56d95d){if(_0x56d95d){if(_0x56d95d[_0xbc22('0x4a')]){return _0x3ac4b9[_0xbc22('0x28')](0x193)[_0xbc22('0x29')]({'status':0x193,'message':_0xbc22('0xe8')});}return db[_0xbc22('0xe6')][_0xbc22('0xcc')]({'where':{'id':_0x2fc954[_0xbc22('0x54')][_0xbc22('0xe9')]},'raw':!![]})[_0xbc22('0x1c')](handleEntityNotFound(_0x3ac4b9,null));}})[_0xbc22('0x1c')](function(_0x2e0767){if(_0x2e0767){var _0x422b6b=_0x2e0767['ChatOfflineMessageId']!==null;var _0x4e6a9a=path[_0xbc22('0xea')](config[_0xbc22('0xeb')],'server/files/attachments/');if(_0x422b6b){_0x4e6a9a=path[_0xbc22('0xea')](_0x4e6a9a,_0xbc22('0xec'));}var _0x20a42c=path[_0xbc22('0xea')](_0x4e6a9a,_0x2e0767[_0xbc22('0xed')]);return _0x3ac4b9['download'](_0x20a42c);}})[_0xbc22('0x27')](handleError(_0x3ac4b9,null));};exports[_0xbc22('0xee')]=function(_0x7aa0de,_0x5b2209){var _0x5cb61d=null;var _0x58e0a9=null;var _0x586d52=null;var _0xde20d7=null;if(_0x7aa0de[_0xbc22('0x39')]['id']){delete _0x7aa0de['body']['id'];}if(_0x7aa0de[_0xbc22('0x39')][_0xbc22('0xef')]){_0xde20d7=path[_0xbc22('0xea')](config[_0xbc22('0xeb')],_0xbc22('0xf0'),util['format']('transcript-%s.txt',Date['now']()));_0x7aa0de[_0xbc22('0x39')][_0xbc22('0xf1')]=_0xde20d7;}return db[_0xbc22('0x4e')][_0xbc22('0x7a')]({'where':{'id':_0x7aa0de[_0xbc22('0xc4')]['id']},'include':[{'model':db[_0xbc22('0xdc')],'as':_0xbc22('0xf2'),'include':[{'model':db['User'],'as':_0xbc22('0xf3')}]}]})['then'](handleEntityNotFound(_0x5b2209,null))[_0xbc22('0x1c')](saveUpdates(_0x7aa0de[_0xbc22('0x39')],null))[_0xbc22('0x1c')](function(_0x5b2b06){if(_0x5b2b06){_0x5cb61d=_0x5b2b06;return db[_0xbc22('0xcd')][_0xbc22('0x7a')]({'where':{'id':_0x5cb61d[_0xbc22('0x86')]}});}})[_0xbc22('0x1c')](function(_0x3bd1e8){if(_0x3bd1e8){_0x586d52=_0x3bd1e8;return db[_0xbc22('0xf4')][_0xbc22('0x7a')]({'where':{'id':_0x5cb61d[_0xbc22('0x7b')]}});}})['then'](function(_0x3eecd4){if(_0x3eecd4){_0x58e0a9=_0x3eecd4;if(_0xde20d7){var _0x2da35a=null;for(var _0x65e471=0x1;_0x65e471<_0x5cb61d[_0xbc22('0xf2')][_0xbc22('0x59')];++_0x65e471){_0x2da35a=_0x5cb61d['Messages'][_0x65e471];var _0x1b11e8=_0x2da35a[_0xbc22('0x4b')]?util[_0xbc22('0xf5')](_0xbc22('0xf6'),_0x586d52[_0xbc22('0xf7')],_0x2da35a[_0xbc22('0x4b')]):_0xbc22('0xf8');var _0x4a6e85=_0x7aa0de[_0xbc22('0x39')]['customer']||util['format'](_0xbc22('0xf6'),_0xbc22('0xf9'),_0x2da35a[_0xbc22('0x7b')]);switch(_0x586d52[_0xbc22('0xfa')]){case'website_alias':_0x1b11e8=_0x2da35a[_0xbc22('0x4b')]?util[_0xbc22('0xf5')]('%s%d',_0x586d52[_0xbc22('0xf7')],_0x2da35a[_0xbc22('0x4b')]):'System';break;case _0xbc22('0xfb'):_0x1b11e8=_0x2da35a[_0xbc22('0x4b')]?_0x2da35a['User'][_0xbc22('0xfc')]||_0x2da35a[_0xbc22('0xf3')][_0xbc22('0x3f')]:_0xbc22('0xf8');break;case _0xbc22('0xfd'):_0x1b11e8=_0x2da35a[_0xbc22('0x4b')]?_0x2da35a[_0xbc22('0xf3')][_0xbc22('0x3f')]:_0xbc22('0xf8');break;default:_0x1b11e8=_0x2da35a['UserId']?util[_0xbc22('0xf5')](_0xbc22('0xf6'),_0x586d52[_0xbc22('0xf7')],_0x2da35a['UserId']):_0xbc22('0xf8');}var _0x588a54=util['format'](_0xbc22('0xfe'),moment(_0x2da35a[_0xbc22('0x89')])[_0xbc22('0xf5')](_0xbc22('0xff')),_0x2da35a[_0xbc22('0x100')]==='in'?_0x4a6e85:_0x1b11e8,_0x2da35a[_0xbc22('0x39')]);if(!_0x2da35a[_0xbc22('0x101')]){fs[_0xbc22('0x102')](_0xde20d7,_0x588a54);}}return db[_0xbc22('0x103')][_0xbc22('0xcc')]({'where':{'service':!![]},'include':[{'model':db[_0xbc22('0x104')],'as':_0xbc22('0x105'),'raw':!![]}]});}}})['then'](function(_0x4a2ae3){if(_0x4a2ae3&&_0x4a2ae3['Smtp']&&_0x7aa0de['body']){var _0x524246={'tls':{'rejectUnauthorized':![]}};if(_0x4a2ae3[_0xbc22('0x105')]['service']){_0x524246[_0xbc22('0x106')]=_0x4a2ae3[_0xbc22('0x105')][_0xbc22('0x106')];}else{_0x524246['host']=_0x4a2ae3[_0xbc22('0x105')][_0xbc22('0x107')];_0x524246[_0xbc22('0x108')]=_0x4a2ae3[_0xbc22('0x105')][_0xbc22('0x108')];_0x524246['secure']=_0x4a2ae3[_0xbc22('0x105')][_0xbc22('0x109')];}if(_0x4a2ae3[_0xbc22('0x105')][_0xbc22('0x10a')]){_0x524246[_0xbc22('0x10b')]={'user':_0x4a2ae3[_0xbc22('0x105')]['user'],'pass':_0x4a2ae3['Smtp'][_0xbc22('0x10c')]};}return respondWithRpcPromise('SendMail',_0xbc22('0x10d'),{'account':_0x524246,'message':{'from':util[_0xbc22('0xf5')](_0xbc22('0x10e'),_0x4a2ae3[_0xbc22('0x37')],_0x4a2ae3[_0xbc22('0xd2')]||_0x4a2ae3['Smtp']['user']),'to':_0x7aa0de[_0xbc22('0x39')][_0xbc22('0xef')],'subject':'Mail\x20Transcript','text':util[_0xbc22('0xf5')](_0xbc22('0x10f'),_0x7aa0de[_0xbc22('0x39')][_0xbc22('0xef')]),'attachments':[{'path':_0xde20d7}]}})[_0xbc22('0x1c')](function(){return _0x5cb61d;})['catch'](function(_0x30f855){console[_0xbc22('0x23')](_0x30f855);});}else{return _0x5cb61d;}})[_0xbc22('0x1c')](respondWithStatusCode(_0x5b2209,0xc8))[_0xbc22('0x27')](handleError(_0x5b2209,null));};exports[_0xbc22('0x110')]=function(_0x5a960b,_0x30b45a,_0x16e38c){return db[_0xbc22('0xdc')][_0xbc22('0x7a')]({'where':{'id':_0x5a960b['params']['id']}})['then'](handleEntityNotFound(_0x30b45a,null))['then'](function(_0x47c616){if(_0x47c616){return _0x47c616[_0xbc22('0x110')](_0x5a960b[_0xbc22('0x39')][_0xbc22('0x111')],_[_0xbc22('0x112')](_0x5a960b[_0xbc22('0x39')],[_0xbc22('0x111'),'id'])||{});}})[_0xbc22('0x1c')](respondWithResult(_0x30b45a,null))[_0xbc22('0x27')](handleError(_0x30b45a,null));};exports[_0xbc22('0x113')]=function(_0x5cf3c9,_0xdae268,_0x5aa775){var _0x5cb1bf={'raw':![],'where':{}};var _0x390785={};var _0x30b796={'count':0x0,'rows':[]};return db[_0xbc22('0x4e')][_0xbc22('0xcc')]({'where':{'id':_0x5cf3c9[_0xbc22('0xc4')]['id']}})[_0xbc22('0x1c')](handleEntityNotFound(_0xdae268,null))[_0xbc22('0x1c')](function(_0xd8ffaa){if(_0xd8ffaa){_0x390785['model']=_[_0xbc22('0x55')](db[_0xbc22('0xdc')]['rawAttributes']);_0x390785[_0xbc22('0x54')]=_[_0xbc22('0x55')](_0x5cf3c9[_0xbc22('0x54')]);_0x390785[_0xbc22('0x5d')]=_[_0xbc22('0x56')](_0x390785[_0xbc22('0x53')],_0x390785['query']);_0x5cb1bf[_0xbc22('0x57')]=_[_0xbc22('0x56')](_0x390785['model'],qs[_0xbc22('0x58')](_0x5cf3c9[_0xbc22('0x54')][_0xbc22('0x58')]));_0x5cb1bf['attributes']=_0x5cb1bf[_0xbc22('0x57')][_0xbc22('0x59')]?_0x5cb1bf[_0xbc22('0x57')]:_0x390785[_0xbc22('0x53')];if(!_0x5cf3c9[_0xbc22('0x54')][_0xbc22('0x5a')](_0xbc22('0x114'))){_0x5cb1bf[_0xbc22('0x2d')]=qs[_0xbc22('0x2d')](_0x5cf3c9['query']['limit']);_0x5cb1bf[_0xbc22('0x2a')]=qs[_0xbc22('0x2a')](_0x5cf3c9[_0xbc22('0x54')]['offset']);}_0x5cb1bf['order']=qs['sort'](_0x5cf3c9[_0xbc22('0x54')][_0xbc22('0x5b')]);_0x5cb1bf['where']=qs[_0xbc22('0x5d')](_['pick'](_0x5cf3c9[_0xbc22('0x54')],_0x390785[_0xbc22('0x5d')]));_0x5cb1bf['where']['ChatInteractionId']=_0xd8ffaa['id'];if(_0x5cf3c9[_0xbc22('0x54')][_0xbc22('0x96')]){_0x5cb1bf['where']=_[_0xbc22('0xc7')](_0x5cb1bf['where'],{'$or':_[_0xbc22('0x3e')](_0x5cb1bf[_0xbc22('0x57')],function(_0x5885ed){var _0x21a262={};_0x21a262[_0x5885ed]={'$like':'%'+_0x5cf3c9[_0xbc22('0x54')][_0xbc22('0x96')]+'%'};return _0x21a262;})});}if(_0x5cf3c9[_0xbc22('0x54')][_0xbc22('0x8b')]){var _0x3ee325=_0x5cf3c9[_0xbc22('0x54')][_0xbc22('0x8b')][_0xbc22('0x42')](',');var _0x5bb211={};_0x5bb211[_0x3ee325[0x0]]={'$gte':moment(_0x3ee325[0x1])[_0xbc22('0xf5')](_0xbc22('0x115'))};_0x5cb1bf[_0xbc22('0x5c')]=_[_0xbc22('0xc7')](_0x5cb1bf[_0xbc22('0x5c')],_0x5bb211);}_0x5cb1bf=_[_0xbc22('0xc7')]({},_0x5cb1bf,_0x5cf3c9['options']);return db[_0xbc22('0xdc')][_0xbc22('0x2c')]({'where':_0x5cb1bf['where']})[_0xbc22('0x1c')](function(_0x541f35){_0x30b796[_0xbc22('0x2c')]=_0x541f35;if(_0x5cf3c9[_0xbc22('0x54')][_0xbc22('0xc5')]){_0x5cb1bf[_0xbc22('0xc6')]=[{'all':!![]}];}return db['ChatMessage'][_0xbc22('0x116')](_0x5cb1bf);})[_0xbc22('0x1c')](function(_0x3a53ce){_0x30b796[_0xbc22('0x117')]=_0x3a53ce;return _0x30b796;});}})[_0xbc22('0x1c')](respondWithFilteredResult(_0xdae268,_0x5cb1bf))[_0xbc22('0x27')](handleError(_0xdae268,null));};exports[_0xbc22('0x118')]=function(_0x490eab,_0x5e5485,_0x254dfc){var _0xa3e070={'where':{}},_0x5ad37c={},_0x169e75={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xbc22('0xcc')]({'where':{'id':_0x490eab['params']['id']}})[_0xbc22('0x1c')](handleEntityNotFound(_0x5e5485,null))[_0xbc22('0x1c')](function(_0x37bf80){if(_0x37bf80){_0x5ad37c[_0xbc22('0x53')]=_[_0xbc22('0x55')](db['ChatMessage']['rawAttributes']);_0x5ad37c[_0xbc22('0x54')]=_[_0xbc22('0x55')](_0x490eab[_0xbc22('0x54')]);_0x5ad37c[_0xbc22('0x5d')]=_['intersection'](_0x5ad37c['model'],_0x5ad37c[_0xbc22('0x54')]);_0xa3e070[_0xbc22('0x57')]=_[_0xbc22('0x56')](_0x5ad37c[_0xbc22('0x53')],qs['fields'](_0x490eab[_0xbc22('0x54')]['fields']));_0xa3e070['attributes']=_0xa3e070[_0xbc22('0x57')][_0xbc22('0x59')]?_0xa3e070[_0xbc22('0x57')]:_0x5ad37c['model'];if(!_0x490eab['query'][_0xbc22('0x5a')](_0xbc22('0x114'))){_0xa3e070['limit']=qs[_0xbc22('0x2d')](_0x490eab[_0xbc22('0x54')][_0xbc22('0x2d')]);_0xa3e070[_0xbc22('0x2a')]=qs[_0xbc22('0x2a')](_0x490eab[_0xbc22('0x54')][_0xbc22('0x2a')]);}_0xa3e070[_0xbc22('0xa0')]=qs[_0xbc22('0x5b')](_0x490eab[_0xbc22('0x54')][_0xbc22('0x5b')]);_0xa3e070['where']=qs[_0xbc22('0x5d')](_[_0xbc22('0x5e')](_0x490eab[_0xbc22('0x54')],_0x5ad37c[_0xbc22('0x5d')]));_0xa3e070[_0xbc22('0x5c')][_0xbc22('0xc2')]=_0x37bf80['id'];if(_0x490eab[_0xbc22('0x54')][_0xbc22('0x96')]){_0xa3e070[_0xbc22('0x5c')]=_['merge'](_0xa3e070['where'],{'$or':_[_0xbc22('0x3e')](_0xa3e070['attributes'],function(_0x504430){var _0x18f444={};_0x18f444[_0x504430]={'$like':'%'+_0x490eab[_0xbc22('0x54')][_0xbc22('0x96')]+'%'};return _0x18f444;})});}_0xa3e070['where']['secret']=![];if(_0x490eab[_0xbc22('0x54')]['id']){_0xa3e070[_0xbc22('0x5c')]['id']={'$gt':_0x490eab['query']['id']};}_0xa3e070=_[_0xbc22('0xc7')]({},_0xa3e070,_0x490eab[_0xbc22('0xc8')]);return db[_0xbc22('0xdc')]['count']({'where':_0xa3e070[_0xbc22('0x5c')]})[_0xbc22('0x1c')](function(_0x5d4b4f){_0x169e75[_0xbc22('0x2c')]=_0x5d4b4f;_0xa3e070[_0xbc22('0xc6')]=[];if(_0x490eab[_0xbc22('0x54')][_0xbc22('0x119')]){_0xa3e070['include'][_0xbc22('0x44')]({'model':db[_0xbc22('0xf3')],'as':_0xbc22('0xf3'),'attributes':['id',_0xbc22('0x3f'),_0xbc22('0xfc')]});}if(_0x490eab[_0xbc22('0x54')][_0xbc22('0xc5')]){_0xa3e070[_0xbc22('0xc6')]=[{'all':!![]}];}return db['ChatMessage'][_0xbc22('0x116')](_0xa3e070);})[_0xbc22('0x1c')](function(_0x411450){_0x169e75['rows']=_0x411450;return _0x169e75;});}})[_0xbc22('0x1c')](respondWithFilteredResult(_0x5e5485,_0xa3e070))['catch'](handleError(_0x5e5485,null));};exports[_0xbc22('0x11a')]=function(_0x1dca17,_0x2d6b1c,_0x43ad71){return db[_0xbc22('0x4e')]['find']({'where':{'id':_0x1dca17[_0xbc22('0xc4')]['id']}})[_0xbc22('0x1c')](handleEntityNotFound(_0x2d6b1c,null))[_0xbc22('0x1c')](function(_0x482629){if(_0x482629){return _0x482629[_0xbc22('0x11b')](_0x1dca17[_0xbc22('0x39')]['ids'],_[_0xbc22('0x112')](_0x1dca17[_0xbc22('0x39')],[_0xbc22('0x111'),'id'])||{})[_0xbc22('0x11c')](function(){return db[_0xbc22('0x7f')][_0xbc22('0x116')]({'attributes':['id','name',_0xbc22('0x61')],'where':{'id':_0x1dca17[_0xbc22('0x39')][_0xbc22('0x111')]}});})['then'](function(_0x4116c3){socket['emit'](_0xbc22('0x11d'),{'id':Number(_0x1dca17['params']['id']),'tags':_0x4116c3||[]});return{'id':Number(_0x1dca17[_0xbc22('0xc4')]['id']),'tags':_0x4116c3||[]};});}})[_0xbc22('0x1c')](respondWithResult(_0x2d6b1c,null))['catch'](handleError(_0x2d6b1c,null));};exports[_0xbc22('0x11e')]=function(_0x4f3ca9,_0x5493f0,_0x43fc04){return db[_0xbc22('0x4e')][_0xbc22('0x7a')]({'where':{'id':_0x4f3ca9[_0xbc22('0xc4')]['id']}})[_0xbc22('0x1c')](handleEntityNotFound(_0x5493f0,null))['then'](function(_0x1006cf){if(_0x1006cf){return _0x1006cf[_0xbc22('0x11e')](_0x4f3ca9[_0xbc22('0x54')][_0xbc22('0x111')]);}})[_0xbc22('0x1c')](respondWithStatusCode(_0x5493f0,null))[_0xbc22('0x27')](handleError(_0x5493f0,null));};exports[_0xbc22('0x11f')]=function(_0x3444d5,_0x2719a9){var _0xfdb23f=moment()[_0xbc22('0x120')]()[_0xbc22('0xab')]();var _0x4ac701=path[_0xbc22('0xea')](config[_0xbc22('0xeb')],'server','files',_0xbc22('0x121'));var _0x2aa91a=path[_0xbc22('0xea')](config[_0xbc22('0xeb')],_0xbc22('0x122'),_0xbc22('0x123'),_0xbc22('0x124'));var _0x4d2f0b=path[_0xbc22('0xea')](_0x4ac701,_0xfdb23f);var _0xeb7d63=util['format']('transcript-%d-%s.zip',_0x3444d5[_0xbc22('0xc4')]['id'],_0xfdb23f);var _0xe70e8c=path[_0xbc22('0xea')](_0x4ac701,_0xeb7d63);var _0x240f63=[];_0x240f63['push']({'model':db[_0xbc22('0xf3')],'as':'User','attributes':['id',_0xbc22('0x3f')],'raw':!![]});_0x240f63[_0xbc22('0x44')]({'model':db[_0xbc22('0xf4')],'as':'Contact','attributes':['id',_0xbc22('0x125'),_0xbc22('0x126')],'raw':!![]});if(_0x3444d5[_0xbc22('0x54')][_0xbc22('0x124')]){_0x240f63['push']({'model':db['Attachment'],'as':_0xbc22('0xe6'),'raw':!![]});}var _0x9f561d=[{'model':db[_0xbc22('0xdc')],'as':_0xbc22('0xf2'),'attributes':['id','body',_0xbc22('0x89'),'direction','secret','read'],'include':_0x240f63}];_0x9f561d[_0xbc22('0x44')]({'model':db[_0xbc22('0xcd')],'as':'Account','attributes':['id',_0xbc22('0x37')]});_0x9f561d['push']({'model':db[_0xbc22('0xf3')],'as':_0xbc22('0x127'),'attributes':['id',_0xbc22('0x3f')]});return db['ChatInteraction'][_0xbc22('0x7a')]({'where':{'id':_0x3444d5[_0xbc22('0xc4')]['id']},'include':_0x9f561d})['then'](handleEntityNotFound(_0x2719a9,null))[_0xbc22('0x1c')](function(_0x553a28){if(_0x553a28){var _0x30bb85=_0x553a28[_0xbc22('0x128')]({'plain':!![]});fs[_0xbc22('0x129')](_0x4d2f0b);var _0x50c287={'channel':_0xbc22('0x12a'),'account':_0x30bb85[_0xbc22('0x12b')][_0xbc22('0x37')],'agent':_0x30bb85['Owner']?_0x30bb85['Owner']['fullname']:_0xbc22('0x12c'),'createdAt':moment(_0x30bb85[_0xbc22('0x89')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x30bb85['closed']?moment(_0x30bb85[_0xbc22('0x12d')])[_0xbc22('0xf5')](_0xbc22('0x115'))[_0xbc22('0xab')]():'','disposition':_0x30bb85[_0xbc22('0x4c')],'chatInfo':{'browser':_0x30bb85[_0xbc22('0x12e')],'os':_0x30bb85['osName'],'referer':_0x30bb85[_0xbc22('0x12f')],'customerIp':_0x30bb85[_0xbc22('0x130')],'customerPort':_0x30bb85[_0xbc22('0x131')]?_0x30bb85[_0xbc22('0x131')]:'N.A.'},'messages':_(_0x30bb85[_0xbc22('0xf2')])['tail']()[_0xbc22('0x96')]({'secret':![]})[_0xbc22('0x3e')](function(_0x26d36e){if(_0x26d36e['Attachment']){var _0x562959=path[_0xbc22('0xea')](_0x2aa91a,_0x26d36e[_0xbc22('0xe6')]['basename']);if(fs[_0xbc22('0x132')](_0x562959)){fs[_0xbc22('0x133')](_0x562959)[_0xbc22('0x134')](fs['createWriteStream'](path['join'](_0x4d2f0b,_0x26d36e['Attachment'][_0xbc22('0xed')])));}}return{'date':moment(_0x26d36e['createdAt'])[_0xbc22('0xf5')](_0xbc22('0x115'))[_0xbc22('0xab')](),'sender':_0x26d36e[_0xbc22('0x100')]===_0xbc22('0xdb')?_0x26d36e['User']?_0x26d36e[_0xbc22('0xf3')][_0xbc22('0x3f')]:'System':_0x26d36e[_0xbc22('0x76')][_0xbc22('0x125')]+(_0x26d36e[_0xbc22('0x76')][_0xbc22('0x126')]?'\x20'+_0x26d36e['Contact'][_0xbc22('0x126')]:''),'body':_0x26d36e[_0xbc22('0xe6')]?_0x26d36e[_0xbc22('0xe6')][_0xbc22('0xed')]:_0x26d36e[_0xbc22('0x39')],'direction':_0x26d36e['direction']===_0xbc22('0xdb')?'A':'C','secret':_0x26d36e[_0xbc22('0x101')],'read':_0x26d36e[_0xbc22('0x90')],'attachment':_0x26d36e['Attachment']};})[_0xbc22('0x73')]()};return ejs[_0xbc22('0x135')](path['join'](config[_0xbc22('0xeb')],_0xbc22('0x122'),'views',_0xbc22('0x136')),{'interaction':_0x50c287})[_0xbc22('0x1c')](function(_0x45c2cf){var _0x26c77c=path['join'](_0x4d2f0b,_0xbc22('0x137')+_0x30bb85['id']+'-'+_0xfdb23f+_0xbc22('0x138'));var _0xf276ba={'path':_0x26c77c,'channel':_0xbc22('0x12a'),'interactionId':_0x30bb85['id']};return pdf[_0xbc22('0x139')](_0x45c2cf,_0xf276ba);})[_0xbc22('0x1c')](function(){return new BPromise(function(_0x227fd4,_0x5c8992){zipdir(_0x4d2f0b,{'saveTo':_0xe70e8c},function(_0x49574b,_0x220d75){if(_0x49574b)return _0x5c8992(_0x49574b);return _0x227fd4(_0x220d75);});})['then'](function(){return new BPromise(function(_0x5951cc,_0x42c4a8){rimraf(_0x4d2f0b,function(_0x4a2007){if(_0x4a2007)_0x42c4a8(_0x4a2007);return _0x5951cc();});});})[_0xbc22('0x1c')](function(){return _0x2719a9['download'](_0xe70e8c,_0xeb7d63,function(_0xe592f8){if(_0xe592f8){console[_0xbc22('0x13a')](_0xbc22('0x13b'),_0xe592f8);}else{fs['unlinkSync'](_0xe70e8c);}});});});}else{return _0x2719a9['sendStatus'](0xc8);}})[_0xbc22('0x27')](handleError(_0x2719a9,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 737d217..db62e93 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 _0xe6f0=['setMaxListeners','save','remove','then','setDataValue','map','findAll','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe6f0,0x1a5));var _0x0e6f=function(_0x3fec1f,_0x563512){_0x3fec1f=_0x3fec1f-0x0;var _0x5cb79b=_0xe6f0[_0x3fec1f];return _0x5cb79b;};'use strict';var EventEmitter=require(_0x0e6f('0x0'));var ChatInteraction=require(_0x0e6f('0x1'))['db'][_0x0e6f('0x2')];var ChatMessage=require('../../mysqldb')['db'][_0x0e6f('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x0e6f('0x4')](0x0);var events={'afterCreate':_0x0e6f('0x5'),'afterUpdate':'update','afterDestroy':_0x0e6f('0x6')};function emitEvent(_0x3a6e7c){return function(_0x3b60b4,_0x54a845,_0x29197d){_0x3b60b4['getUsers']({'attributes':['id'],'raw':!![]})[_0x0e6f('0x7')](function(_0x4271be){_0x3b60b4[_0x0e6f('0x8')]('Users',_0x4271be[_0x0e6f('0x9')](function(_0x57ac2b){return{'id':_0x57ac2b['id']};}));return ChatMessage[_0x0e6f('0xa')]({'where':{'ChatInteractionId':_0x3b60b4['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0e6f('0x7')](function(_0x238ad9){_0x3b60b4[_0x0e6f('0x8')](_0x0e6f('0xb'),_0x238ad9[_0x0e6f('0xc')]);ChatInteractionEvents[_0x0e6f('0xd')](_0x3a6e7c+':'+_0x3b60b4['id'],_0x3b60b4);ChatInteractionEvents['emit'](_0x3a6e7c,_0x3b60b4);_0x29197d(null);})[_0x0e6f('0xe')](_0x29197d(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x0e6f('0xf')](e,emitEvent(event));}}module[_0x0e6f('0x10')]=ChatInteractionEvents; \ No newline at end of file +var _0xb6ae=['../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','hasOwnProperty','hook','exports','events'];(function(_0x19b5d5,_0x154edf){var _0x3e1ef3=function(_0x3744de){while(--_0x3744de){_0x19b5d5['push'](_0x19b5d5['shift']());}};_0x3e1ef3(++_0x154edf);}(_0xb6ae,0x7d));var _0xeb6a=function(_0x124f88,_0x3ad501){_0x124f88=_0x124f88-0x0;var _0xed0e3b=_0xb6ae[_0x124f88];return _0xed0e3b;};'use strict';var EventEmitter=require(_0xeb6a('0x0'));var ChatInteraction=require(_0xeb6a('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0xeb6a('0x1'))['db'][_0xeb6a('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xeb6a('0x3')](0x0);var events={'afterCreate':_0xeb6a('0x4'),'afterUpdate':_0xeb6a('0x5'),'afterDestroy':_0xeb6a('0x6')};function emitEvent(_0x29a21d){return function(_0x599021,_0x41c1ff,_0x2e55ca){_0x599021['getUsers']({'attributes':['id'],'raw':!![]})[_0xeb6a('0x7')](function(_0x69ba04){_0x599021[_0xeb6a('0x8')](_0xeb6a('0x9'),_0x69ba04[_0xeb6a('0xa')](function(_0x4b24c3){return{'id':_0x4b24c3['id']};}));return ChatMessage[_0xeb6a('0xb')]({'where':{'ChatInteractionId':_0x599021['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x24d8d5){_0x599021[_0xeb6a('0x8')](_0xeb6a('0xc'),_0x24d8d5[_0xeb6a('0xd')]);ChatInteractionEvents[_0xeb6a('0xe')](_0x29a21d+':'+_0x599021['id'],_0x599021);ChatInteractionEvents[_0xeb6a('0xe')](_0x29a21d,_0x599021);_0x2e55ca(null);})['catch'](_0x2e55ca(null));};}for(var e in events){if(events[_0xeb6a('0xf')](e)){var event=events[e];ChatInteraction[_0xeb6a('0x10')](e,emitEvent(event));}}module[_0xeb6a('0x11')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 8aebf4e..b09b3a6 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 _0x692c=['api','moment','bluebird','request-promise','rimraf','define','chat_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','lodash','util','../../config/logger'];(function(_0x533b87,_0x591790){var _0xf39d05=function(_0x3a5f60){while(--_0x3a5f60){_0x533b87['push'](_0x533b87['shift']());}};_0xf39d05(++_0x591790);}(_0x692c,0x84));var _0xc692=function(_0x698254,_0x487811){_0x698254=_0x698254-0x0;var _0x1736c6=_0x692c[_0x698254];return _0x1736c6;};'use strict';var _=require(_0xc692('0x0'));var util=require(_0xc692('0x1'));var logger=require(_0xc692('0x2'))(_0xc692('0x3'));var moment=require(_0xc692('0x4'));var BPromise=require(_0xc692('0x5'));var rp=require(_0xc692('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc692('0x7'));var config=require('../../config/environment');var attributes=require('./chatInteraction.attributes');module['exports']=function(_0x4c837a,_0x400fbd){return _0x4c837a[_0xc692('0x8')]('ChatInteraction',attributes,{'tableName':_0xc692('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xc93261,_0x4c01c4,_0x598332){if(_0xc93261[_0xc692('0xa')](_0xc692('0xb'))){_0xc93261[_0xc692('0xc')]=moment()['format'](_0xc692('0xd'));}_0x598332(null,_0xc93261);}},'charset':_0xc692('0xe'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xe612=['YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','ChatInteraction','chat_interactions','changed','closed','closedAt'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0xe612,0xe3));var _0x2e61=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xe612[_0x5ddb1c];return _0x354adc;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2e61('0x0'))(_0x2e61('0x1'));var moment=require(_0x2e61('0x2'));var BPromise=require('bluebird');var rp=require(_0x2e61('0x3'));var fs=require('fs');var path=require(_0x2e61('0x4'));var rimraf=require(_0x2e61('0x5'));var config=require(_0x2e61('0x6'));var attributes=require('./chatInteraction.attributes');module[_0x2e61('0x7')]=function(_0xb5a926,_0x4d410c){return _0xb5a926['define'](_0x2e61('0x8'),attributes,{'tableName':_0x2e61('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2c93c5,_0x350b54,_0x35d108){if(_0x2c93c5[_0x2e61('0xa')](_0x2e61('0xb'))){_0x2c93c5[_0x2e61('0xc')]=moment()['format'](_0x2e61('0xd'));}_0x35d108(null,_0x2c93c5);}},'charset':_0x2e61('0xe'),'collate':_0x2e61('0xf')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index b1b7158..09193bd 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 _0xd062=['socket.io-emitter','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','UpdateChatInteraction','update','body','options','raw','where','attributes','stringify','catch','AddTagsToChatInteraction','find','addTags','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x87c726,_0x2235d3){var _0xbcdcdd=function(_0x22565c){while(--_0x22565c){_0x87c726['push'](_0x87c726['shift']());}};_0xbcdcdd(++_0x2235d3);}(_0xd062,0xa0));var _0x2d06=function(_0x543dd8,_0xfe806e){_0x543dd8=_0x543dd8-0x0;var _0x2f8b46=_0xd062[_0x543dd8];return _0x2f8b46;};'use strict';var _=require('lodash');var util=require(_0x2d06('0x0'));var moment=require(_0x2d06('0x1'));var BPromise=require(_0x2d06('0x2'));var rs=require(_0x2d06('0x3'));var fs=require('fs');var Redis=require(_0x2d06('0x4'));var db=require(_0x2d06('0x5'))['db'];var utils=require(_0x2d06('0x6'));var logger=require(_0x2d06('0x7'))(_0x2d06('0x8'));var config=require(_0x2d06('0x9'));var jayson=require(_0x2d06('0xa'));var client=jayson[_0x2d06('0xb')][_0x2d06('0xc')]({'port':0x232a});config[_0x2d06('0xd')]=_[_0x2d06('0xe')](config[_0x2d06('0xd')],{'host':_0x2d06('0xf'),'port':0x18eb});var socket=require(_0x2d06('0x10'))(new Redis(config[_0x2d06('0xd')]));require(_0x2d06('0x11'))[_0x2d06('0x12')](socket);function respondWithRpcPromise(_0x16e6d3,_0x82e084,_0x40e510){return new BPromise(function(_0xd9117d,_0x344c29){return client['request'](_0x16e6d3,_0x40e510)[_0x2d06('0x13')](function(_0x5dd5a9){logger[_0x2d06('0x14')](_0x2d06('0x15'),_0x82e084,'request\x20sent');logger[_0x2d06('0x16')](_0x2d06('0x17'),_0x82e084,_0x2d06('0x18'),JSON['stringify'](_0x5dd5a9));if(_0x5dd5a9[_0x2d06('0x19')]){if(_0x5dd5a9['error'][_0x2d06('0x1a')]===0x1f4){logger['error'](_0x2d06('0x15'),_0x82e084,_0x5dd5a9['error'][_0x2d06('0x1b')]);return _0x344c29(_0x5dd5a9[_0x2d06('0x19')][_0x2d06('0x1b')]);}logger[_0x2d06('0x19')](_0x2d06('0x15'),_0x82e084,_0x5dd5a9[_0x2d06('0x19')][_0x2d06('0x1b')]);return _0xd9117d(_0x5dd5a9['error'][_0x2d06('0x1b')]);}else{logger['info'](_0x2d06('0x15'),_0x82e084,_0x2d06('0x18'));_0xd9117d(_0x5dd5a9['result'][_0x2d06('0x1b')]);}})['catch'](function(_0x3310bf){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x82e084,_0x3310bf);_0x344c29(_0x3310bf);});});}exports[_0x2d06('0x1c')]=function(_0x4f0a96){var _0x4ed3ee=this;return new Promise(function(_0x318168,_0x2bf91e){return db['ChatInteraction'][_0x2d06('0x1d')](_0x4f0a96[_0x2d06('0x1e')],{'raw':_0x4f0a96[_0x2d06('0x1f')]?_0x4f0a96[_0x2d06('0x1f')][_0x2d06('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f0a96[_0x2d06('0x1f')]?_0x4f0a96[_0x2d06('0x1f')][_0x2d06('0x21')]||null:null,'attributes':_0x4f0a96[_0x2d06('0x1f')]?_0x4f0a96[_0x2d06('0x1f')][_0x2d06('0x22')]||null:null,'limit':_0x4f0a96[_0x2d06('0x1f')]?_0x4f0a96[_0x2d06('0x1f')]['limit']||null:null})[_0x2d06('0x13')](function(_0x5b97f4){logger[_0x2d06('0x14')](_0x2d06('0x1c'),_0x4f0a96);logger[_0x2d06('0x16')](_0x2d06('0x1c'),_0x4f0a96,JSON[_0x2d06('0x23')](_0x5b97f4));_0x318168(_0x5b97f4);})[_0x2d06('0x24')](function(_0x3271c7){logger[_0x2d06('0x19')]('UpdateChatInteraction',_0x3271c7[_0x2d06('0x1b')],_0x4f0a96);_0x2bf91e(_0x4ed3ee[_0x2d06('0x19')](0x1f4,_0x3271c7['message']));});});};exports[_0x2d06('0x25')]=function(_0x8a2f80){return new Promise(function(_0x2d26a7,_0x5d91ac){return db['ChatInteraction'][_0x2d06('0x26')]({'where':_0x8a2f80[_0x2d06('0x1f')]?_0x8a2f80[_0x2d06('0x1f')][_0x2d06('0x21')]||null:null})[_0x2d06('0x13')](function(_0x1096a9){if(_0x1096a9){return _0x1096a9[_0x2d06('0x27')](_0x8a2f80[_0x2d06('0x1e')][_0x2d06('0x28')],_[_0x2d06('0x29')](_0x8a2f80[_0x2d06('0x1e')],['ids','id'])||{});}})[_0x2d06('0x2a')](function(_0x37ce58){logger[_0x2d06('0x14')](_0x2d06('0x2b'),_0x8a2f80);logger[_0x2d06('0x16')](_0x2d06('0x2b'),_0x8a2f80,JSON['stringify'](_0x37ce58));_0x2d26a7(_0x37ce58);})[_0x2d06('0x24')](function(_0x186c7f){logger[_0x2d06('0x19')](_0x2d06('0x2b'),_0x186c7f[_0x2d06('0x1b')],_0x8a2f80);_0x5d91ac(_this[_0x2d06('0x19')](0x1f4,_0x186c7f[_0x2d06('0x1b')]));});});}; \ No newline at end of file +var _0xc936=['rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateChatInteraction','ChatInteraction','update','options','raw','where','attributes','debug','catch','addTags','body','ids','omit','spread','AddTags','util','moment','randomstring','../../config/logger'];(function(_0x361fa2,_0x3cca67){var _0x30597a=function(_0x2feede){while(--_0x2feede){_0x361fa2['push'](_0x361fa2['shift']());}};_0x30597a(++_0x3cca67);}(_0xc936,0x182));var _0x6c93=function(_0x47be0c,_0x5c22b9){_0x47be0c=_0x47be0c-0x0;var _0x4037af=_0xc936[_0x47be0c];return _0x4037af;};'use strict';var _=require('lodash');var util=require(_0x6c93('0x0'));var moment=require(_0x6c93('0x1'));var BPromise=require('bluebird');var rs=require(_0x6c93('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6c93('0x3'))(_0x6c93('0x4'));var config=require(_0x6c93('0x5'));var jayson=require(_0x6c93('0x6'));var client=jayson[_0x6c93('0x7')][_0x6c93('0x8')]({'port':0x232a});config[_0x6c93('0x9')]=_[_0x6c93('0xa')](config['redis'],{'host':_0x6c93('0xb'),'port':0x18eb});var socket=require(_0x6c93('0xc'))(new Redis(config['redis']));require(_0x6c93('0xd'))['register'](socket);function respondWithRpcPromise(_0x31cdd2,_0x48ed83,_0x387c92){return new BPromise(function(_0x550e29,_0x45ff0b){return client['request'](_0x31cdd2,_0x387c92)[_0x6c93('0xe')](function(_0x181aba){logger[_0x6c93('0xf')](_0x6c93('0x10'),_0x48ed83,_0x6c93('0x11'));logger['debug'](_0x6c93('0x12'),_0x48ed83,_0x6c93('0x11'),JSON[_0x6c93('0x13')](_0x181aba));if(_0x181aba[_0x6c93('0x14')]){if(_0x181aba['error'][_0x6c93('0x15')]===0x1f4){logger[_0x6c93('0x14')](_0x6c93('0x10'),_0x48ed83,_0x181aba[_0x6c93('0x14')][_0x6c93('0x16')]);return _0x45ff0b(_0x181aba['error'][_0x6c93('0x16')]);}logger[_0x6c93('0x14')](_0x6c93('0x10'),_0x48ed83,_0x181aba[_0x6c93('0x14')][_0x6c93('0x16')]);return _0x550e29(_0x181aba['error']['message']);}else{logger[_0x6c93('0xf')](_0x6c93('0x10'),_0x48ed83,_0x6c93('0x11'));_0x550e29(_0x181aba[_0x6c93('0x17')][_0x6c93('0x16')]);}})['catch'](function(_0x4a2f03){logger[_0x6c93('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x48ed83,_0x4a2f03);_0x45ff0b(_0x4a2f03);});});}exports[_0x6c93('0x18')]=function(_0x3a4dfa){var _0x19433b=this;return new Promise(function(_0x1da4da,_0x1449f6){return db[_0x6c93('0x19')][_0x6c93('0x1a')](_0x3a4dfa['body'],{'raw':_0x3a4dfa['options']?_0x3a4dfa[_0x6c93('0x1b')][_0x6c93('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a4dfa[_0x6c93('0x1b')]?_0x3a4dfa[_0x6c93('0x1b')][_0x6c93('0x1d')]||null:null,'attributes':_0x3a4dfa[_0x6c93('0x1b')]?_0x3a4dfa[_0x6c93('0x1b')][_0x6c93('0x1e')]||null:null,'limit':_0x3a4dfa[_0x6c93('0x1b')]?_0x3a4dfa[_0x6c93('0x1b')]['limit']||null:null})['then'](function(_0x188538){logger['info']('UpdateChatInteraction',_0x3a4dfa);logger[_0x6c93('0x1f')]('UpdateChatInteraction',_0x3a4dfa,JSON[_0x6c93('0x13')](_0x188538));_0x1da4da(_0x188538);})[_0x6c93('0x20')](function(_0x4a08db){logger['error'](_0x6c93('0x18'),_0x4a08db[_0x6c93('0x16')],_0x3a4dfa);_0x1449f6(_0x19433b[_0x6c93('0x14')](0x1f4,_0x4a08db[_0x6c93('0x16')]));});});};exports['AddTagsToChatInteraction']=function(_0xa923dd){return new Promise(function(_0x44549c,_0x3c38fc){return db['ChatInteraction']['find']({'where':_0xa923dd[_0x6c93('0x1b')]?_0xa923dd[_0x6c93('0x1b')][_0x6c93('0x1d')]||null:null})[_0x6c93('0xe')](function(_0x3754a8){if(_0x3754a8){return _0x3754a8[_0x6c93('0x21')](_0xa923dd[_0x6c93('0x22')][_0x6c93('0x23')],_[_0x6c93('0x24')](_0xa923dd[_0x6c93('0x22')],[_0x6c93('0x23'),'id'])||{});}})[_0x6c93('0x25')](function(_0x90ecbe){logger['info']('AddTags',_0xa923dd);logger['debug']('AddTags',_0xa923dd,JSON[_0x6c93('0x13')](_0x90ecbe));_0x44549c(_0x90ecbe);})['catch'](function(_0xce172c){logger[_0x6c93('0x14')](_0x6c93('0x26'),_0xce172c[_0x6c93('0x16')],_0xa923dd);_0x3c38fc(_this[_0x6c93('0x14')](0x1f4,_0xce172c[_0x6c93('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index f1db2d5..d471d0c 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 _0xea85=['removeListener','register','length','chatInteraction:','./chatInteraction.events','save','remove','update','emit'];(function(_0x26a591,_0x2202a6){var _0x25bbc3=function(_0x34ba10){while(--_0x34ba10){_0x26a591['push'](_0x26a591['shift']());}};_0x25bbc3(++_0x2202a6);}(_0xea85,0x1ea));var _0x5ea8=function(_0x2dcc5e,_0xee1ec2){_0x2dcc5e=_0x2dcc5e-0x0;var _0x40c2d4=_0xea85[_0x2dcc5e];return _0x40c2d4;};'use strict';var ChatInteractionEvents=require(_0x5ea8('0x0'));var events=[_0x5ea8('0x1'),_0x5ea8('0x2'),_0x5ea8('0x3')];function createListener(_0x664ad7,_0x483e29){return function(_0x2a620b){_0x483e29[_0x5ea8('0x4')](_0x664ad7,_0x2a620b);};}function removeListener(_0x159005,_0x2e9052){return function(){ChatInteractionEvents[_0x5ea8('0x5')](_0x159005,_0x2e9052);};}exports[_0x5ea8('0x6')]=function(_0x4f5975){for(var _0x563fc9=0x0,_0x333b3c=events[_0x5ea8('0x7')];_0x563fc9<_0x333b3c;_0x563fc9++){var _0x2f4142=events[_0x563fc9];var _0x20dd3c=createListener(_0x5ea8('0x8')+_0x2f4142,_0x4f5975);ChatInteractionEvents['on'](_0x2f4142,_0x20dd3c);}}; \ No newline at end of file +var _0x2d57=['save','remove','emit','register','length'];(function(_0x322bef,_0x4890d4){var _0x229e60=function(_0x45f89b){while(--_0x45f89b){_0x322bef['push'](_0x322bef['shift']());}};_0x229e60(++_0x4890d4);}(_0x2d57,0xaf));var _0x72d5=function(_0x111e94,_0x31c837){_0x111e94=_0x111e94-0x0;var _0x3de107=_0x2d57[_0x111e94];return _0x3de107;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x72d5('0x0'),_0x72d5('0x1'),'update'];function createListener(_0x5790a9,_0x50e7de){return function(_0x401855){_0x50e7de[_0x72d5('0x2')](_0x5790a9,_0x401855);};}function removeListener(_0x5de1e1,_0x12314e){return function(){ChatInteractionEvents['removeListener'](_0x5de1e1,_0x12314e);};}exports[_0x72d5('0x3')]=function(_0x2bf1fa){for(var _0x5afb9a=0x0,_0x557e57=events[_0x72d5('0x4')];_0x5afb9a<_0x557e57;_0x5afb9a++){var _0x912c70=events[_0x5afb9a];var _0x4d1060=createListener('chatInteraction:'+_0x912c70,_0x2bf1fa);ChatInteractionEvents['on'](_0x912c70,_0x4d1060);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 6fbef4e..b5f8300 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 _0xb18f=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','isAuthenticated','/describe','describe','get','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','create','post','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','%s-%s','now','originalname','replace','/:id/attachment_upload','addMessage','tracked','chatinteraction:addtags','put','chatinteraction:update','update','customUpdate','/:id/close','close','delete','chat','destroy','removeTags','exports','multer','path','connect-timeout','Router','fs-extra'];(function(_0x39d182,_0x4c4547){var _0x575302=function(_0x10b878){while(--_0x10b878){_0x39d182['push'](_0x39d182['shift']());}};_0x575302(++_0x4c4547);}(_0xb18f,0x91));var _0xfb18=function(_0x27091c,_0x309348){_0x27091c=_0x27091c-0x0;var _0x3ad65a=_0xb18f[_0x27091c];return _0x3ad65a;};'use strict';var multer=require(_0xfb18('0x0'));var util=require('util');var path=require(_0xfb18('0x1'));var timeout=require(_0xfb18('0x2'));var express=require('express');var router=express[_0xfb18('0x3')]();var fs_extra=require(_0xfb18('0x4'));var auth=require(_0xfb18('0x5'));var interaction=require(_0xfb18('0x6'));var config=require(_0xfb18('0x7'));var controller=require(_0xfb18('0x8'));router['get']('/',auth[_0xfb18('0x9')](),controller['index']);router['get'](_0xfb18('0xa'),auth[_0xfb18('0x9')](),controller[_0xfb18('0xb')]);router[_0xfb18('0xc')](_0xfb18('0xd'),auth[_0xfb18('0xe')](),controller[_0xfb18('0xf')]);router[_0xfb18('0xc')](_0xfb18('0x10'),auth['isChatInteractionAuthorized'](),controller['attachmentDownload']);router[_0xfb18('0xc')](_0xfb18('0x11'),auth[_0xfb18('0x9')](),controller[_0xfb18('0x12')]);router[_0xfb18('0xc')](_0xfb18('0x13'),auth[_0xfb18('0xe')](),controller[_0xfb18('0x14')]);router[_0xfb18('0xc')](_0xfb18('0x15'),auth['isAuthenticated'](),controller[_0xfb18('0x16')]);router['post']('/',auth[_0xfb18('0x9')](),controller[_0xfb18('0x17')]);router[_0xfb18('0x18')](_0xfb18('0x19'),auth['isAuthenticated'](),controller[_0xfb18('0x1a')]);var upload=multer({'storage':multer[_0xfb18('0x1b')]({'destination':function(_0x51d6af,_0x352c92,_0x2b1e0a){_0x2b1e0a(null,path[_0xfb18('0x1c')](config[_0xfb18('0x1d')],_0xfb18('0x1e')));},'filename':function(_0x4fe169,_0xadf240,_0x3ae776){_0x3ae776(null,util['format'](_0xfb18('0x1f'),Date[_0xfb18('0x20')](),_0xadf240[_0xfb18('0x21')][_0xfb18('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0xfb18('0x23'),upload['single']('file'),controller['attachmentUpload']);router[_0xfb18('0x18')](_0xfb18('0x11'),auth['isChatInteractionAuthorized'](),controller[_0xfb18('0x24')]);router[_0xfb18('0x18')]('/:id/tags',auth['isAuthenticated'](),interaction[_0xfb18('0x25')]('chat',_0xfb18('0x26')),controller['addTags']);router[_0xfb18('0x27')]('/:id',auth[_0xfb18('0x9')](),interaction[_0xfb18('0x25')]('chat',_0xfb18('0x28')),controller[_0xfb18('0x29')]);router[_0xfb18('0x27')]('/:id/custom_update',controller[_0xfb18('0x2a')]);router[_0xfb18('0x27')]('/:id/abandon',auth['isChatInteractionAuthorized'](),controller['abandon']);router[_0xfb18('0x27')](_0xfb18('0x2b'),controller[_0xfb18('0x2c')]);router[_0xfb18('0x2d')](_0xfb18('0xd'),auth[_0xfb18('0x9')](),interaction[_0xfb18('0x25')](_0xfb18('0x2e'),'chatinteraction:destroy'),controller[_0xfb18('0x2f')]);router[_0xfb18('0x2d')]('/:id/tags',auth[_0xfb18('0x9')](),controller[_0xfb18('0x30')]);module[_0xfb18('0x31')]=router; \ No newline at end of file +var _0xa82c=['customUpdate','/:id/abandon','abandon','close','/:id','chatinteraction:destroy','destroy','delete','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','describe','getMessages','/:id/my_messages','isChatInteractionAuthorized','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','server/files/attachments/','format','%s-%s','now','originalname','/:id/attachment_upload','file','/:id/messages','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','/:id/custom_update'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0xa82c,0xc0));var _0xca82=function(_0x4ded64,_0x21a971){_0x4ded64=_0x4ded64-0x0;var _0x12b320=_0xa82c[_0x4ded64];return _0x12b320;};'use strict';var multer=require(_0xca82('0x0'));var util=require(_0xca82('0x1'));var path=require(_0xca82('0x2'));var timeout=require('connect-timeout');var express=require(_0xca82('0x3'));var router=express['Router']();var fs_extra=require(_0xca82('0x4'));var auth=require(_0xca82('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xca82('0x6'));var controller=require(_0xca82('0x7'));router[_0xca82('0x8')]('/',auth[_0xca82('0x9')](),controller[_0xca82('0xa')]);router[_0xca82('0x8')]('/describe',auth[_0xca82('0x9')](),controller[_0xca82('0xb')]);router[_0xca82('0x8')]('/:id',auth['isChatInteractionAuthorized'](),controller['show']);router[_0xca82('0x8')]('/:id/attachment_download',auth['isChatInteractionAuthorized'](),controller['attachmentDownload']);router[_0xca82('0x8')]('/:id/messages',auth[_0xca82('0x9')](),controller[_0xca82('0xc')]);router[_0xca82('0x8')](_0xca82('0xd'),auth[_0xca82('0xe')](),controller['getMyMessages']);router[_0xca82('0x8')](_0xca82('0xf'),auth['isAuthenticated'](),controller[_0xca82('0x10')]);router[_0xca82('0x11')]('/',auth['isAuthenticated'](),controller[_0xca82('0x12')]);router[_0xca82('0x11')](_0xca82('0x13'),auth[_0xca82('0x9')](),controller[_0xca82('0x14')]);var upload=multer({'storage':multer[_0xca82('0x15')]({'destination':function(_0x131b26,_0xf57e31,_0x120c49){_0x120c49(null,path['join'](config['root'],_0xca82('0x16')));},'filename':function(_0xcce01b,_0x2f12fa,_0x3293d5){_0x3293d5(null,util[_0xca82('0x17')](_0xca82('0x18'),Date[_0xca82('0x19')](),_0x2f12fa[_0xca82('0x1a')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xca82('0x11')](_0xca82('0x1b'),upload['single'](_0xca82('0x1c')),controller['attachmentUpload']);router[_0xca82('0x11')](_0xca82('0x1d'),auth[_0xca82('0xe')](),controller[_0xca82('0x1e')]);router['post'](_0xca82('0x1f'),auth['isAuthenticated'](),interaction[_0xca82('0x20')](_0xca82('0x21'),_0xca82('0x22')),controller[_0xca82('0x23')]);router[_0xca82('0x24')]('/:id',auth[_0xca82('0x9')](),interaction[_0xca82('0x20')]('chat','chatinteraction:update'),controller['update']);router['put'](_0xca82('0x25'),controller[_0xca82('0x26')]);router[_0xca82('0x24')](_0xca82('0x27'),auth[_0xca82('0xe')](),controller[_0xca82('0x28')]);router[_0xca82('0x24')]('/:id/close',controller[_0xca82('0x29')]);router['delete'](_0xca82('0x2a'),auth[_0xca82('0x9')](),interaction[_0xca82('0x20')](_0xca82('0x21'),_0xca82('0x2b')),controller[_0xca82('0x2c')]);router[_0xca82('0x2d')](_0xca82('0x1f'),auth[_0xca82('0x9')](),controller['removeTags']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 7877309..d78fca8 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 _0x4daa=['BOOLEAN','medium'];(function(_0x39a3e1,_0x7aea5d){var _0x5c142b=function(_0x3e2233){while(--_0x3e2233){_0x39a3e1['push'](_0x39a3e1['shift']());}};_0x5c142b(++_0x7aea5d);}(_0x4daa,0x1c1));var _0xa4da=function(_0x3e3d0a,_0x4745dd){_0x3e3d0a=_0x3e3d0a-0x0;var _0x3fc765=_0x4daa[_0x3e3d0a];return _0x3fc765;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT'](_0xa4da('0x0')),'allowNull':![]},'read':{'type':Sequelize[_0xa4da('0x1')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xf2d7=['INTEGER','sequelize','exports','medium','BOOLEAN'];(function(_0x540687,_0x1f5277){var _0x53e71a=function(_0x2ea95a){while(--_0x2ea95a){_0x540687['push'](_0x540687['shift']());}};_0x53e71a(++_0x1f5277);}(_0xf2d7,0xa6));var _0x7f2d=function(_0x5436c0,_0x45beac){_0x5436c0=_0x5436c0-0x0;var _0x51a455=_0xf2d7[_0x5436c0];return _0x51a455;};'use strict';var Sequelize=require(_0x7f2d('0x0'));module[_0x7f2d('0x1')]={'body':{'type':Sequelize['TEXT'](_0x7f2d('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x7f2d('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x7f2d('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 4ce0f35..04e2c01 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 _0x8a20=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','ChatInternalMessage','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','fullname','role','userpic','internal','online','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','isEmpty','length','resourceId','push','FromId','read','-createdAt','all','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/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x39fe18,_0x5a2db7){var _0x9fc66b=function(_0x408b30){while(--_0x408b30){_0x39fe18['push'](_0x39fe18['shift']());}};_0x9fc66b(++_0x5a2db7);}(_0x8a20,0x14e));var _0x08a2=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x8a20[_0x160c73];return _0xd9302;};'use strict';var emlformat=require(_0x08a2('0x0'));var rimraf=require(_0x08a2('0x1'));var zipdir=require(_0x08a2('0x2'));var jsonpatch=require(_0x08a2('0x3'));var rp=require('request-promise');var moment=require(_0x08a2('0x4'));var BPromise=require(_0x08a2('0x5'));var Mustache=require(_0x08a2('0x6'));var util=require('util');var path=require(_0x08a2('0x7'));var sox=require('sox');var csv=require(_0x08a2('0x8'));var ejs=require(_0x08a2('0x9'));var fs=require('fs');var fs_extra=require(_0x08a2('0xa'));var _=require(_0x08a2('0xb'));var squel=require(_0x08a2('0xc'));var crypto=require(_0x08a2('0xd'));var jsforce=require(_0x08a2('0xe'));var deskjs=require(_0x08a2('0xf'));var toCsv=require('to-csv');var querystring=require(_0x08a2('0x10'));var Papa=require('papaparse');var Redis=require(_0x08a2('0x11'));var authService=require(_0x08a2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x08a2('0x13'));var hardwareService=require(_0x08a2('0x14'));var logger=require(_0x08a2('0x15'))(_0x08a2('0x16'));var utils=require(_0x08a2('0x17'));var config=require(_0x08a2('0x18'));var licenseUtil=require(_0x08a2('0x19'));var db=require(_0x08a2('0x1a'))['db'];config[_0x08a2('0x1b')]=_[_0x08a2('0x1c')](config[_0x08a2('0x1b')],{'host':_0x08a2('0x1d'),'port':0x18eb});var socket=require(_0x08a2('0x1e'))(new Redis(config[_0x08a2('0x1b')]));require(_0x08a2('0x1f'))[_0x08a2('0x20')](socket);function respondWithStatusCode(_0x1cec65,_0x523eff){_0x523eff=_0x523eff||0xcc;return function(_0x9fd3ff){if(_0x9fd3ff){return _0x1cec65['sendStatus'](_0x523eff);}return _0x1cec65['status'](_0x523eff)[_0x08a2('0x21')]();};}function respondWithResult(_0x313119,_0x267dfa){_0x267dfa=_0x267dfa||0xc8;return function(_0x5ae8db){if(_0x5ae8db){return _0x313119[_0x08a2('0x22')](_0x267dfa)[_0x08a2('0x23')](_0x5ae8db);}};}function respondWithFilteredResult(_0x4a299c,_0x26b48d){return function(_0x21deea){if(_0x21deea){var _0x508540=typeof _0x26b48d[_0x08a2('0x24')]===_0x08a2('0x25')&&typeof _0x26b48d[_0x08a2('0x26')]==='undefined';var _0x3e6190=_0x21deea[_0x08a2('0x27')];var _0x29f29d=_0x508540?0x0:_0x26b48d[_0x08a2('0x24')];var _0x3b5621=_0x508540?_0x21deea['count']:_0x26b48d['offset']+_0x26b48d[_0x08a2('0x26')];var _0x1bffd3;if(_0x3b5621>=_0x3e6190){_0x3b5621=_0x3e6190;_0x1bffd3=0xc8;}else{_0x1bffd3=0xce;}_0x4a299c[_0x08a2('0x22')](_0x1bffd3);return _0x4a299c[_0x08a2('0x28')](_0x08a2('0x29'),_0x29f29d+'-'+_0x3b5621+'/'+_0x3e6190)[_0x08a2('0x23')](_0x21deea);}return null;};}function patchUpdates(_0x4778b1){return function(_0x49137a){try{jsonpatch[_0x08a2('0x2a')](_0x49137a,_0x4778b1,!![]);}catch(_0x14fc52){return BPromise[_0x08a2('0x2b')](_0x14fc52);}return _0x49137a['save']();};}function saveUpdates(_0x28aac,_0x487596){return function(_0x30ac06){if(_0x30ac06){return _0x30ac06[_0x08a2('0x2c')](_0x28aac)[_0x08a2('0x2d')](function(_0x437ecd){return _0x437ecd;});}return null;};}function removeEntity(_0x1a6bb5,_0x16e0dd){return function(_0x14ac39){if(_0x14ac39){return _0x14ac39[_0x08a2('0x2e')]()[_0x08a2('0x2d')](function(){_0x1a6bb5[_0x08a2('0x22')](0xcc)[_0x08a2('0x21')]();});}};}function handleEntityNotFound(_0x3aaac7,_0x50b518){return function(_0x1d1049){if(!_0x1d1049){_0x3aaac7['sendStatus'](0x194);}return _0x1d1049;};}function handleError(_0x415fce,_0x1a9e2c){_0x1a9e2c=_0x1a9e2c||0x1f4;return function(_0x16c435){logger[_0x08a2('0x2f')](_0x16c435[_0x08a2('0x30')]);if(_0x16c435[_0x08a2('0x31')]){delete _0x16c435[_0x08a2('0x31')];}_0x415fce[_0x08a2('0x22')](_0x1a9e2c)[_0x08a2('0x32')](_0x16c435);};}exports[_0x08a2('0x33')]=function(_0x4d0d70,_0x15d4e1){var _0x106733={},_0x436cfc={},_0x85944a={'count':0x0,'rows':[]};var _0x3b3315=_[_0x08a2('0x34')](db['ChatInternalMessage'][_0x08a2('0x35')],function(_0x4248b4){return{'name':_0x4248b4['fieldName'],'type':_0x4248b4[_0x08a2('0x36')][_0x08a2('0x37')]};});_0x436cfc['model']=_[_0x08a2('0x34')](_0x3b3315,'name');_0x436cfc[_0x08a2('0x38')]=_[_0x08a2('0x39')](_0x4d0d70[_0x08a2('0x38')]);_0x436cfc[_0x08a2('0x3a')]=_[_0x08a2('0x3b')](_0x436cfc['model'],_0x436cfc[_0x08a2('0x38')]);_0x106733['attributes']=_[_0x08a2('0x3b')](_0x436cfc[_0x08a2('0x3c')],qs[_0x08a2('0x3d')](_0x4d0d70[_0x08a2('0x38')]['fields']));_0x106733['attributes']=_0x106733['attributes']['length']?_0x106733[_0x08a2('0x3e')]:_0x436cfc[_0x08a2('0x3c')];if(!_0x4d0d70[_0x08a2('0x38')][_0x08a2('0x3f')]('nolimit')){_0x106733[_0x08a2('0x26')]=qs[_0x08a2('0x26')](_0x4d0d70[_0x08a2('0x38')][_0x08a2('0x26')]);_0x106733[_0x08a2('0x24')]=qs[_0x08a2('0x24')](_0x4d0d70[_0x08a2('0x38')][_0x08a2('0x24')]);}_0x106733[_0x08a2('0x40')]=qs['sort'](_0x4d0d70[_0x08a2('0x38')][_0x08a2('0x41')]);_0x106733['where']=qs[_0x08a2('0x3a')](_[_0x08a2('0x42')](_0x4d0d70[_0x08a2('0x38')],_0x436cfc[_0x08a2('0x3a')]),_0x3b3315);if(_0x4d0d70['query'][_0x08a2('0x43')]){_0x106733[_0x08a2('0x44')]=_[_0x08a2('0x45')](_0x106733['where'],{'$or':_['map'](_0x3b3315,function(_0x25f8d5){if(_0x25f8d5['type']!==_0x08a2('0x46')){var _0x3a7d81={};_0x3a7d81[_0x25f8d5['name']]={'$like':'%'+_0x4d0d70[_0x08a2('0x38')][_0x08a2('0x43')]+'%'};return _0x3a7d81;}})});}_0x106733=_[_0x08a2('0x45')]({},_0x106733,_0x4d0d70['options']);var _0x341132={'where':_0x106733[_0x08a2('0x44')]};return db[_0x08a2('0x47')][_0x08a2('0x27')](_0x341132)['then'](function(_0x54c019){_0x85944a[_0x08a2('0x27')]=_0x54c019;if(_0x4d0d70[_0x08a2('0x38')][_0x08a2('0x48')]){_0x106733[_0x08a2('0x49')]=[{'all':!![]}];}return db[_0x08a2('0x47')][_0x08a2('0x4a')](_0x106733);})[_0x08a2('0x2d')](function(_0x416504){_0x85944a[_0x08a2('0x4b')]=_0x416504;return _0x85944a;})[_0x08a2('0x2d')](respondWithFilteredResult(_0x15d4e1,_0x106733))[_0x08a2('0x4c')](handleError(_0x15d4e1,null));};exports[_0x08a2('0x4d')]=function(_0x55cc7a,_0x5f5391){var _0x3fde89={'raw':!![],'where':{'id':_0x55cc7a[_0x08a2('0x4e')]['id']}},_0x19267b={};_0x19267b[_0x08a2('0x3c')]=_[_0x08a2('0x39')](db[_0x08a2('0x47')]['rawAttributes']);_0x19267b[_0x08a2('0x38')]=_[_0x08a2('0x39')](_0x55cc7a['query']);_0x19267b[_0x08a2('0x3a')]=_['intersection'](_0x19267b[_0x08a2('0x3c')],_0x19267b[_0x08a2('0x38')]);_0x3fde89[_0x08a2('0x3e')]=_['intersection'](_0x19267b[_0x08a2('0x3c')],qs[_0x08a2('0x3d')](_0x55cc7a[_0x08a2('0x38')][_0x08a2('0x3d')]));_0x3fde89[_0x08a2('0x3e')]=_0x3fde89[_0x08a2('0x3e')]['length']?_0x3fde89[_0x08a2('0x3e')]:_0x19267b[_0x08a2('0x3c')];if(_0x55cc7a['query'][_0x08a2('0x48')]){_0x3fde89[_0x08a2('0x49')]=[{'all':!![]}];}_0x3fde89=_[_0x08a2('0x45')]({},_0x3fde89,_0x55cc7a[_0x08a2('0x4f')]);return db[_0x08a2('0x47')][_0x08a2('0x50')](_0x3fde89)[_0x08a2('0x2d')](handleEntityNotFound(_0x5f5391,null))[_0x08a2('0x2d')](respondWithResult(_0x5f5391,null))[_0x08a2('0x4c')](handleError(_0x5f5391,null));};exports[_0x08a2('0x51')]=function(_0x40dc0c,_0x8f39a1){return db[_0x08a2('0x47')][_0x08a2('0x51')](_0x40dc0c[_0x08a2('0x52')],{})[_0x08a2('0x2d')](respondWithResult(_0x8f39a1,0xc9))['catch'](handleError(_0x8f39a1,null));};exports[_0x08a2('0x2c')]=function(_0x17fe4f,_0x51494c){if(_0x17fe4f[_0x08a2('0x52')]['id']){delete _0x17fe4f[_0x08a2('0x52')]['id'];}return db[_0x08a2('0x47')][_0x08a2('0x50')]({'where':{'id':_0x17fe4f[_0x08a2('0x4e')]['id']}})[_0x08a2('0x2d')](handleEntityNotFound(_0x51494c,null))['then'](saveUpdates(_0x17fe4f[_0x08a2('0x52')],null))[_0x08a2('0x2d')](respondWithResult(_0x51494c,null))[_0x08a2('0x4c')](handleError(_0x51494c,null));};exports[_0x08a2('0x2e')]=function(_0x447065,_0x13f789){return db[_0x08a2('0x47')][_0x08a2('0x50')]({'where':{'id':_0x447065[_0x08a2('0x4e')]['id']}})[_0x08a2('0x2d')](handleEntityNotFound(_0x13f789,null))[_0x08a2('0x2d')](removeEntity(_0x13f789,null))['catch'](handleError(_0x13f789,null));};exports[_0x08a2('0x53')]=function(_0x48ec2a,_0x451159){return db[_0x08a2('0x47')][_0x08a2('0x53')]()[_0x08a2('0x2d')](respondWithResult(_0x451159,null))[_0x08a2('0x4c')](handleError(_0x451159,null));};function wrapUser(_0x3d6055){return function(_0x471e3b){var _0x59f9e3=_0x3d6055[_0x08a2('0x54')]({'plain':!![]});_0x59f9e3[_0x08a2('0x55')]=[];if(_0x471e3b){_0x59f9e3[_0x08a2('0x56')]=_0x471e3b[_0x08a2('0x57')];_0x59f9e3[_0x08a2('0x58')]=_0x471e3b;}else{_0x59f9e3[_0x08a2('0x56')]=moment(0x0)[_0x08a2('0x59')](_0x08a2('0x5a'));_0x59f9e3[_0x08a2('0x58')]={};}return _0x59f9e3;};}exports[_0x08a2('0x5b')]=function(_0x5040af,_0x2f13c1,_0x4caaa6){var _0x3278a7=[];return db[_0x08a2('0x5c')]['findAll']({'where':{'role':[_0x08a2('0x5d'),_0x08a2('0x5e'),_0x08a2('0x5f')]},'attributes':['id',_0x08a2('0x60'),_0x08a2('0x31'),_0x08a2('0x61'),_0x08a2('0x62'),_0x08a2('0x63'),_0x08a2('0x64'),'lastLoginAt',_0x08a2('0x65'),_0x08a2('0x66')],'order':qs['sort'](_0x08a2('0x67')),'include':[{'model':db[_0x08a2('0x68')],'as':_0x08a2('0x69'),'attributes':['id',_0x08a2('0x31'),_0x08a2('0x36')],'through':{'attributes':[]}}]})[_0x08a2('0x2d')](function(_0x16a12c){if(_0x16a12c){var _0x5dc640=_0x5040af[_0x08a2('0x5f')][_0x08a2('0x54')]({'plain':!![]});if(!_0x5dc640)throw new Error(_0x08a2('0x6a'));if(_0x5dc640[_0x08a2('0x61')]===_0x08a2('0x5f')){return db[_0x08a2('0x6b')][_0x08a2('0x50')]({'where':{'name':'Agents','userProfileId':_0x5dc640[_0x08a2('0x6c')]},'raw':!![]})[_0x08a2('0x2d')](function(_0x476ad1){if(_0x476ad1){if(_0x476ad1[_0x08a2('0x6d')]===0x0){return db[_0x08a2('0x6e')][_0x08a2('0x4a')]({'where':{'sectionId':_0x476ad1['id']},'raw':!![]})[_0x08a2('0x2d')](function(_0x5adf01){var _0x5bc953=[];if(_[_0x08a2('0x6f')](_0x5adf01)){_0x5bc953=_[_0x08a2('0x43')](_0x16a12c,function(_0x1417c3){if(_0x1417c3[_0x08a2('0x61')]!==_0x08a2('0x5d')){return _0x1417c3;}});return _0x5bc953;}else{for(var _0x138b26=0x0;_0x138b26<_0x16a12c[_0x08a2('0x70')];_0x138b26++){var _0x15f291=_0x16a12c[_0x138b26];if(_0x15f291[_0x08a2('0x61')]==='agent'){var _0x195486=_[_0x08a2('0x50')](_0x5adf01,function(_0x2db0d4){return _0x2db0d4[_0x08a2('0x71')]===_0x15f291['id'];});if(_0x195486)_0x5bc953[_0x08a2('0x72')](_0x15f291);}else{_0x5bc953[_0x08a2('0x72')](_0x15f291);}}return _0x5bc953;}});}else{return _0x16a12c;}}else{var _0x433c21=_['filter'](_0x16a12c,function(_0x52eff6){if(_0x52eff6['role']!==_0x08a2('0x5d')){return _0x52eff6;}});return _0x433c21;}});}else{return _0x16a12c;}}})[_0x08a2('0x2d')](function(_0x4c3a7b){var _0x1de82b=[];if(_0x4c3a7b){_0x3278a7=_0x4c3a7b;for(var _0x497d21=0x0;_0x497d21<_0x4c3a7b['length'];_0x497d21+=0x1){_0x3278a7[_0x497d21][_0x08a2('0x55')]=[];_0x1de82b['push'](db[_0x08a2('0x47')][_0x08a2('0x50')]({'where':{'FromId':[_0x5040af[_0x08a2('0x5f')]['id'],_0x4c3a7b[_0x497d21]['id']],'ToId':[_0x5040af[_0x08a2('0x5f')]['id'],_0x4c3a7b[_0x497d21]['id']],'ChatGroupId':null},'attributes':['id',_0x08a2('0x57'),_0x08a2('0x73'),'ToId',_0x08a2('0x74'),'body'],'order':qs['sort'](_0x08a2('0x75')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x08a2('0x2d')](wrapUser(_0x4c3a7b[_0x497d21])));}return BPromise[_0x08a2('0x76')](_0x1de82b);}return[];})[_0x08a2('0x2d')](function(_0x37a9a2){return{'rows':_0x37a9a2,'count':_0x37a9a2[_0x08a2('0x70')]};})['then'](respondWithResult(_0x2f13c1,null))['catch'](handleError(_0x2f13c1,null));}; \ No newline at end of file +var _0x2a4c=['showWebBar','VoiceQueues','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','createdAt','FromId','read','-createdAt','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','then','error','stack','name','index','map','rawAttributes','fieldName','type','model','keys','query','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','ChatInternalMessage','includeAll','include','findAll','rows','show','params','filters','catch','create','body','update','destroy','find','describe','get','messages','lastMessageAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','fullname','role','userpic','internal','lastLoginAt','allowmessenger'];(function(_0x323a3d,_0x2be54b){var _0x498c54=function(_0x112640){while(--_0x112640){_0x323a3d['push'](_0x323a3d['shift']());}};_0x498c54(++_0x2be54b);}(_0x2a4c,0x7e));var _0xc2a4=function(_0x17ceb4,_0x5ea813){_0x17ceb4=_0x17ceb4-0x0;var _0x580289=_0x2a4c[_0x17ceb4];return _0x580289;};'use strict';var emlformat=require(_0xc2a4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc2a4('0x1'));var jsonpatch=require(_0xc2a4('0x2'));var rp=require(_0xc2a4('0x3'));var moment=require(_0xc2a4('0x4'));var BPromise=require(_0xc2a4('0x5'));var Mustache=require('mustache');var util=require(_0xc2a4('0x6'));var path=require(_0xc2a4('0x7'));var sox=require(_0xc2a4('0x8'));var csv=require(_0xc2a4('0x9'));var ejs=require(_0xc2a4('0xa'));var fs=require('fs');var fs_extra=require(_0xc2a4('0xb'));var _=require(_0xc2a4('0xc'));var squel=require('squel');var crypto=require(_0xc2a4('0xd'));var jsforce=require(_0xc2a4('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xc2a4('0x9'));var querystring=require(_0xc2a4('0xf'));var Papa=require(_0xc2a4('0x10'));var Redis=require(_0xc2a4('0x11'));var authService=require(_0xc2a4('0x12'));var qs=require(_0xc2a4('0x13'));var as=require(_0xc2a4('0x14'));var hardwareService=require(_0xc2a4('0x15'));var logger=require('../../config/logger')(_0xc2a4('0x16'));var utils=require(_0xc2a4('0x17'));var config=require(_0xc2a4('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xc2a4('0x19'))['db'];config[_0xc2a4('0x1a')]=_[_0xc2a4('0x1b')](config['redis'],{'host':_0xc2a4('0x1c'),'port':0x18eb});var socket=require(_0xc2a4('0x1d'))(new Redis(config[_0xc2a4('0x1a')]));require(_0xc2a4('0x1e'))['register'](socket);function respondWithStatusCode(_0x3fa07c,_0x2da8b4){_0x2da8b4=_0x2da8b4||0xcc;return function(_0x124989){if(_0x124989){return _0x3fa07c[_0xc2a4('0x1f')](_0x2da8b4);}return _0x3fa07c[_0xc2a4('0x20')](_0x2da8b4)[_0xc2a4('0x21')]();};}function respondWithResult(_0x4ed283,_0x3f3844){_0x3f3844=_0x3f3844||0xc8;return function(_0x2986dc){if(_0x2986dc){return _0x4ed283['status'](_0x3f3844)[_0xc2a4('0x22')](_0x2986dc);}};}function respondWithFilteredResult(_0x39a34b,_0x57b27c){return function(_0x3dcd2e){if(_0x3dcd2e){var _0x2ccec8=typeof _0x57b27c[_0xc2a4('0x23')]===_0xc2a4('0x24')&&typeof _0x57b27c[_0xc2a4('0x25')]===_0xc2a4('0x24');var _0x5eb5a0=_0x3dcd2e[_0xc2a4('0x26')];var _0x5728c7=_0x2ccec8?0x0:_0x57b27c[_0xc2a4('0x23')];var _0x151991=_0x2ccec8?_0x3dcd2e['count']:_0x57b27c[_0xc2a4('0x23')]+_0x57b27c[_0xc2a4('0x25')];var _0x174615;if(_0x151991>=_0x5eb5a0){_0x151991=_0x5eb5a0;_0x174615=0xc8;}else{_0x174615=0xce;}_0x39a34b[_0xc2a4('0x20')](_0x174615);return _0x39a34b['set'](_0xc2a4('0x27'),_0x5728c7+'-'+_0x151991+'/'+_0x5eb5a0)['json'](_0x3dcd2e);}return null;};}function patchUpdates(_0x3bd78a){return function(_0x702dd2){try{jsonpatch[_0xc2a4('0x28')](_0x702dd2,_0x3bd78a,!![]);}catch(_0x509962){return BPromise['reject'](_0x509962);}return _0x702dd2[_0xc2a4('0x29')]();};}function saveUpdates(_0x40f6e1,_0x18f463){return function(_0x753580){if(_0x753580){return _0x753580['update'](_0x40f6e1)[_0xc2a4('0x2a')](function(_0xc66b32){return _0xc66b32;});}return null;};}function removeEntity(_0x1f2179,_0x1921c0){return function(_0x3cbf9f){if(_0x3cbf9f){return _0x3cbf9f['destroy']()[_0xc2a4('0x2a')](function(){_0x1f2179[_0xc2a4('0x20')](0xcc)[_0xc2a4('0x21')]();});}};}function handleEntityNotFound(_0x323c13,_0x79f1e4){return function(_0x17f3c2){if(!_0x17f3c2){_0x323c13['sendStatus'](0x194);}return _0x17f3c2;};}function handleError(_0x50cb7d,_0x25ee27){_0x25ee27=_0x25ee27||0x1f4;return function(_0x5a80cb){logger[_0xc2a4('0x2b')](_0x5a80cb[_0xc2a4('0x2c')]);if(_0x5a80cb[_0xc2a4('0x2d')]){delete _0x5a80cb[_0xc2a4('0x2d')];}_0x50cb7d[_0xc2a4('0x20')](_0x25ee27)['send'](_0x5a80cb);};}exports[_0xc2a4('0x2e')]=function(_0x35315a,_0x32a184){var _0x45042b={},_0x2844ea={},_0x47934b={'count':0x0,'rows':[]};var _0x187f96=_[_0xc2a4('0x2f')](db['ChatInternalMessage'][_0xc2a4('0x30')],function(_0x2b22a5){return{'name':_0x2b22a5[_0xc2a4('0x31')],'type':_0x2b22a5[_0xc2a4('0x32')]['key']};});_0x2844ea[_0xc2a4('0x33')]=_[_0xc2a4('0x2f')](_0x187f96,'name');_0x2844ea['query']=_[_0xc2a4('0x34')](_0x35315a[_0xc2a4('0x35')]);_0x2844ea['filters']=_[_0xc2a4('0x36')](_0x2844ea[_0xc2a4('0x33')],_0x2844ea[_0xc2a4('0x35')]);_0x45042b['attributes']=_[_0xc2a4('0x36')](_0x2844ea[_0xc2a4('0x33')],qs[_0xc2a4('0x37')](_0x35315a[_0xc2a4('0x35')]['fields']));_0x45042b[_0xc2a4('0x38')]=_0x45042b[_0xc2a4('0x38')][_0xc2a4('0x39')]?_0x45042b[_0xc2a4('0x38')]:_0x2844ea[_0xc2a4('0x33')];if(!_0x35315a[_0xc2a4('0x35')]['hasOwnProperty'](_0xc2a4('0x3a'))){_0x45042b[_0xc2a4('0x25')]=qs[_0xc2a4('0x25')](_0x35315a[_0xc2a4('0x35')][_0xc2a4('0x25')]);_0x45042b[_0xc2a4('0x23')]=qs[_0xc2a4('0x23')](_0x35315a[_0xc2a4('0x35')]['offset']);}_0x45042b['order']=qs[_0xc2a4('0x3b')](_0x35315a[_0xc2a4('0x35')][_0xc2a4('0x3b')]);_0x45042b[_0xc2a4('0x3c')]=qs['filters'](_[_0xc2a4('0x3d')](_0x35315a[_0xc2a4('0x35')],_0x2844ea['filters']),_0x187f96);if(_0x35315a[_0xc2a4('0x35')][_0xc2a4('0x3e')]){_0x45042b[_0xc2a4('0x3c')]=_[_0xc2a4('0x3f')](_0x45042b[_0xc2a4('0x3c')],{'$or':_[_0xc2a4('0x2f')](_0x187f96,function(_0x3f6299){if(_0x3f6299[_0xc2a4('0x32')]!==_0xc2a4('0x40')){var _0x36757c={};_0x36757c[_0x3f6299[_0xc2a4('0x2d')]]={'$like':'%'+_0x35315a['query'][_0xc2a4('0x3e')]+'%'};return _0x36757c;}})});}_0x45042b=_['merge']({},_0x45042b,_0x35315a[_0xc2a4('0x41')]);var _0x57c1ec={'where':_0x45042b[_0xc2a4('0x3c')]};return db[_0xc2a4('0x42')][_0xc2a4('0x26')](_0x57c1ec)[_0xc2a4('0x2a')](function(_0x43461c){_0x47934b[_0xc2a4('0x26')]=_0x43461c;if(_0x35315a[_0xc2a4('0x35')][_0xc2a4('0x43')]){_0x45042b[_0xc2a4('0x44')]=[{'all':!![]}];}return db[_0xc2a4('0x42')][_0xc2a4('0x45')](_0x45042b);})['then'](function(_0x397929){_0x47934b[_0xc2a4('0x46')]=_0x397929;return _0x47934b;})[_0xc2a4('0x2a')](respondWithFilteredResult(_0x32a184,_0x45042b))['catch'](handleError(_0x32a184,null));};exports[_0xc2a4('0x47')]=function(_0x1d805f,_0x3a2585){var _0x413ad4={'raw':!![],'where':{'id':_0x1d805f[_0xc2a4('0x48')]['id']}},_0x382e29={};_0x382e29[_0xc2a4('0x33')]=_[_0xc2a4('0x34')](db[_0xc2a4('0x42')][_0xc2a4('0x30')]);_0x382e29[_0xc2a4('0x35')]=_['keys'](_0x1d805f[_0xc2a4('0x35')]);_0x382e29[_0xc2a4('0x49')]=_[_0xc2a4('0x36')](_0x382e29['model'],_0x382e29[_0xc2a4('0x35')]);_0x413ad4[_0xc2a4('0x38')]=_[_0xc2a4('0x36')](_0x382e29[_0xc2a4('0x33')],qs[_0xc2a4('0x37')](_0x1d805f[_0xc2a4('0x35')][_0xc2a4('0x37')]));_0x413ad4[_0xc2a4('0x38')]=_0x413ad4[_0xc2a4('0x38')][_0xc2a4('0x39')]?_0x413ad4[_0xc2a4('0x38')]:_0x382e29[_0xc2a4('0x33')];if(_0x1d805f[_0xc2a4('0x35')][_0xc2a4('0x43')]){_0x413ad4['include']=[{'all':!![]}];}_0x413ad4=_[_0xc2a4('0x3f')]({},_0x413ad4,_0x1d805f[_0xc2a4('0x41')]);return db[_0xc2a4('0x42')]['find'](_0x413ad4)[_0xc2a4('0x2a')](handleEntityNotFound(_0x3a2585,null))['then'](respondWithResult(_0x3a2585,null))[_0xc2a4('0x4a')](handleError(_0x3a2585,null));};exports['create']=function(_0x5725b4,_0x2b8c2c){return db[_0xc2a4('0x42')][_0xc2a4('0x4b')](_0x5725b4[_0xc2a4('0x4c')],{})['then'](respondWithResult(_0x2b8c2c,0xc9))[_0xc2a4('0x4a')](handleError(_0x2b8c2c,null));};exports[_0xc2a4('0x4d')]=function(_0x2996c7,_0x4cd54c){if(_0x2996c7[_0xc2a4('0x4c')]['id']){delete _0x2996c7['body']['id'];}return db[_0xc2a4('0x42')]['find']({'where':{'id':_0x2996c7['params']['id']}})[_0xc2a4('0x2a')](handleEntityNotFound(_0x4cd54c,null))[_0xc2a4('0x2a')](saveUpdates(_0x2996c7[_0xc2a4('0x4c')],null))[_0xc2a4('0x2a')](respondWithResult(_0x4cd54c,null))['catch'](handleError(_0x4cd54c,null));};exports[_0xc2a4('0x4e')]=function(_0x518f55,_0x27ad06){return db[_0xc2a4('0x42')][_0xc2a4('0x4f')]({'where':{'id':_0x518f55[_0xc2a4('0x48')]['id']}})[_0xc2a4('0x2a')](handleEntityNotFound(_0x27ad06,null))[_0xc2a4('0x2a')](removeEntity(_0x27ad06,null))[_0xc2a4('0x4a')](handleError(_0x27ad06,null));};exports[_0xc2a4('0x50')]=function(_0xa25e58,_0x44d839){return db[_0xc2a4('0x42')]['describe']()[_0xc2a4('0x2a')](respondWithResult(_0x44d839,null))['catch'](handleError(_0x44d839,null));};function wrapUser(_0x20ecac){return function(_0x4b8b19){var _0x3bdc31=_0x20ecac[_0xc2a4('0x51')]({'plain':!![]});_0x3bdc31[_0xc2a4('0x52')]=[];if(_0x4b8b19){_0x3bdc31[_0xc2a4('0x53')]=_0x4b8b19['createdAt'];_0x3bdc31[_0xc2a4('0x54')]=_0x4b8b19;}else{_0x3bdc31['lastMessageAt']=moment(0x0)[_0xc2a4('0x55')](_0xc2a4('0x56'));_0x3bdc31['lastMessage']={};}return _0x3bdc31;};}exports[_0xc2a4('0x57')]=function(_0x27b9ad,_0x21f60e,_0x4aaf67){var _0x5afa22=[];return db[_0xc2a4('0x58')][_0xc2a4('0x45')]({'where':{'role':[_0xc2a4('0x59'),_0xc2a4('0x5a'),_0xc2a4('0x5b')]},'attributes':['id',_0xc2a4('0x5c'),_0xc2a4('0x2d'),_0xc2a4('0x5d'),_0xc2a4('0x5e'),_0xc2a4('0x5f'),'online',_0xc2a4('0x60'),_0xc2a4('0x61'),_0xc2a4('0x62')],'order':qs[_0xc2a4('0x3b')]('-online'),'include':[{'model':db['VoiceQueue'],'as':_0xc2a4('0x63'),'attributes':['id',_0xc2a4('0x2d'),_0xc2a4('0x32')],'through':{'attributes':[]}}]})['then'](function(_0x15ca9e){if(_0x15ca9e){var _0x4057c4=_0x27b9ad[_0xc2a4('0x5b')][_0xc2a4('0x51')]({'plain':!![]});if(!_0x4057c4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4057c4[_0xc2a4('0x5d')]===_0xc2a4('0x5b')){return db[_0xc2a4('0x64')][_0xc2a4('0x4f')]({'where':{'name':_0xc2a4('0x65'),'userProfileId':_0x4057c4[_0xc2a4('0x66')]},'raw':!![]})[_0xc2a4('0x2a')](function(_0x3b7b99){if(_0x3b7b99){if(_0x3b7b99[_0xc2a4('0x67')]===0x0){return db[_0xc2a4('0x68')][_0xc2a4('0x45')]({'where':{'sectionId':_0x3b7b99['id']},'raw':!![]})[_0xc2a4('0x2a')](function(_0x44d743){var _0x43897f=[];if(_[_0xc2a4('0x69')](_0x44d743)){_0x43897f=_[_0xc2a4('0x3e')](_0x15ca9e,function(_0x17292a){if(_0x17292a[_0xc2a4('0x5d')]!==_0xc2a4('0x59')){return _0x17292a;}});return _0x43897f;}else{for(var _0x195c59=0x0;_0x195c59<_0x15ca9e['length'];_0x195c59++){var _0x3b97ab=_0x15ca9e[_0x195c59];if(_0x3b97ab['role']===_0xc2a4('0x59')){var _0xd0496d=_[_0xc2a4('0x4f')](_0x44d743,function(_0x2bcc73){return _0x2bcc73[_0xc2a4('0x6a')]===_0x3b97ab['id'];});if(_0xd0496d)_0x43897f[_0xc2a4('0x6b')](_0x3b97ab);}else{_0x43897f[_0xc2a4('0x6b')](_0x3b97ab);}}return _0x43897f;}});}else{return _0x15ca9e;}}else{var _0x1544a3=_['filter'](_0x15ca9e,function(_0x3556e3){if(_0x3556e3['role']!==_0xc2a4('0x59')){return _0x3556e3;}});return _0x1544a3;}});}else{return _0x15ca9e;}}})[_0xc2a4('0x2a')](function(_0x400ea9){var _0x281b11=[];if(_0x400ea9){_0x5afa22=_0x400ea9;for(var _0x29fbad=0x0;_0x29fbad<_0x400ea9[_0xc2a4('0x39')];_0x29fbad+=0x1){_0x5afa22[_0x29fbad][_0xc2a4('0x52')]=[];_0x281b11['push'](db['ChatInternalMessage'][_0xc2a4('0x4f')]({'where':{'FromId':[_0x27b9ad['user']['id'],_0x400ea9[_0x29fbad]['id']],'ToId':[_0x27b9ad[_0xc2a4('0x5b')]['id'],_0x400ea9[_0x29fbad]['id']],'ChatGroupId':null},'attributes':['id',_0xc2a4('0x6c'),_0xc2a4('0x6d'),'ToId',_0xc2a4('0x6e'),'body'],'order':qs[_0xc2a4('0x3b')](_0xc2a4('0x6f')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xc2a4('0x2a')](wrapUser(_0x400ea9[_0x29fbad])));}return BPromise['all'](_0x281b11);}return[];})[_0xc2a4('0x2a')](function(_0x15ba2f){return{'rows':_0x15ba2f,'count':_0x15ba2f[_0xc2a4('0x39')]};})[_0xc2a4('0x2a')](respondWithResult(_0x21f60e,null))[_0xc2a4('0x4a')](handleError(_0x21f60e,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 5fc1845..4598863 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 _0xfd6e=['hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x314a07,_0x5bf266){var _0x5ecb57=function(_0x1416bf){while(--_0x1416bf){_0x314a07['push'](_0x314a07['shift']());}};_0x5ecb57(++_0x5bf266);}(_0xfd6e,0x1b0));var _0xefd6=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xfd6e[_0x3ab51d];return _0x29a04e;};'use strict';var EventEmitter=require(_0xefd6('0x0'));var ChatInternalMessage=require(_0xefd6('0x1'))['db'][_0xefd6('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xefd6('0x3')](0x0);var events={'afterCreate':_0xefd6('0x4'),'afterUpdate':_0xefd6('0x5'),'afterDestroy':'remove'};function emitEvent(_0x433511){return function(_0x839f34,_0x1eb842,_0x2df7ed){ChatInternalMessageEvents[_0xefd6('0x6')](_0x433511+':'+_0x839f34['id'],_0x839f34);ChatInternalMessageEvents[_0xefd6('0x6')](_0x433511,_0x839f34);_0x2df7ed(null);};}for(var e in events){if(events[_0xefd6('0x7')](e)){var event=events[e];ChatInternalMessage[_0xefd6('0x8')](e,emitEvent(event));}}module[_0xefd6('0x9')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x774a=['emit','exports','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','remove'];(function(_0x469ac7,_0x38e416){var _0x22f3b0=function(_0x1a1447){while(--_0x1a1447){_0x469ac7['push'](_0x469ac7['shift']());}};_0x22f3b0(++_0x38e416);}(_0x774a,0xa2));var _0xa774=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x774a[_0x432682];return _0x463d05;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0xa774('0x0'))['db'][_0xa774('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xa774('0x2')](0x0);var events={'afterCreate':_0xa774('0x3'),'afterUpdate':_0xa774('0x4'),'afterDestroy':_0xa774('0x5')};function emitEvent(_0x453c98){return function(_0x24b340,_0x16c354,_0x1a0abb){ChatInternalMessageEvents[_0xa774('0x6')](_0x453c98+':'+_0x24b340['id'],_0x24b340);ChatInternalMessageEvents[_0xa774('0x6')](_0x453c98,_0x24b340);_0x1a0abb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xa774('0x7')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index cf32996..b8d6e74 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 _0x4213=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','ChatInternalMessage','chat_internal_messages','utf8mb4_unicode_ci','lodash','util'];(function(_0x10616d,_0x55e992){var _0x2b9b47=function(_0x34c345){while(--_0x34c345){_0x10616d['push'](_0x10616d['shift']());}};_0x2b9b47(++_0x55e992);}(_0x4213,0x140));var _0x3421=function(_0x1532ae,_0xa14bcc){_0x1532ae=_0x1532ae-0x0;var _0x5c09d1=_0x4213[_0x1532ae];return _0x5c09d1;};'use strict';var _=require(_0x3421('0x0'));var util=require(_0x3421('0x1'));var logger=require(_0x3421('0x2'))(_0x3421('0x3'));var moment=require(_0x3421('0x4'));var BPromise=require(_0x3421('0x5'));var rp=require(_0x3421('0x6'));var fs=require('fs');var path=require(_0x3421('0x7'));var rimraf=require(_0x3421('0x8'));var config=require(_0x3421('0x9'));var attributes=require(_0x3421('0xa'));module['exports']=function(_0x1566de,_0xe1d745){return _0x1566de['define'](_0x3421('0xb'),attributes,{'tableName':_0x3421('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x3421('0xd')});}; \ No newline at end of file +var _0x2a49=['bluebird','request-promise','path','../../config/environment','define','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment'];(function(_0x2aeedd,_0x1951b0){var _0x1ae237=function(_0x48273d){while(--_0x48273d){_0x2aeedd['push'](_0x2aeedd['shift']());}};_0x1ae237(++_0x1951b0);}(_0x2a49,0x97));var _0x92a4=function(_0x3a19c0,_0x5cd24c){_0x3a19c0=_0x3a19c0-0x0;var _0x21763b=_0x2a49[_0x3a19c0];return _0x21763b;};'use strict';var _=require(_0x92a4('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x92a4('0x1'));var moment=require(_0x92a4('0x2'));var BPromise=require(_0x92a4('0x3'));var rp=require(_0x92a4('0x4'));var fs=require('fs');var path=require(_0x92a4('0x5'));var rimraf=require('rimraf');var config=require(_0x92a4('0x6'));var attributes=require('./chatInternalMessage.attributes');module['exports']=function(_0x158ca6,_0x1be390){return _0x158ca6[_0x92a4('0x7')](_0x92a4('0x8'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x92a4('0x9'),'collate':_0x92a4('0xa')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index a9dc3f9..48001ff 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 _0xd370=['rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','register','request','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2a453b,_0x479c50){var _0x132f79=function(_0x5e3d83){while(--_0x5e3d83){_0x2a453b['push'](_0x2a453b['shift']());}};_0x132f79(++_0x479c50);}(_0xd370,0x1d3));var _0x0d37=function(_0x28beaf,_0x122959){_0x28beaf=_0x28beaf-0x0;var _0x2df201=_0xd370[_0x28beaf];return _0x2df201;};'use strict';var _=require(_0x0d37('0x0'));var util=require(_0x0d37('0x1'));var moment=require(_0x0d37('0x2'));var BPromise=require(_0x0d37('0x3'));var rs=require(_0x0d37('0x4'));var fs=require('fs');var Redis=require(_0x0d37('0x5'));var db=require(_0x0d37('0x6'))['db'];var utils=require(_0x0d37('0x7'));var logger=require(_0x0d37('0x8'))(_0x0d37('0x9'));var config=require(_0x0d37('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x0d37('0xb')][_0x0d37('0xc')]({'port':0x232a});config[_0x0d37('0xd')]=_[_0x0d37('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0d37('0xf'))(new Redis(config[_0x0d37('0xd')]));require('./chatInternalMessage.socket')[_0x0d37('0x10')](socket);function respondWithRpcPromise(_0x56a47d,_0x49d2e0,_0x14eede){return new BPromise(function(_0x2afe78,_0x5c1a46){return client[_0x0d37('0x11')](_0x56a47d,_0x14eede)['then'](function(_0x5847f4){logger['info'](_0x0d37('0x12'),_0x49d2e0,_0x0d37('0x13'));logger[_0x0d37('0x14')](_0x0d37('0x15'),_0x49d2e0,'request\x20sent',JSON['stringify'](_0x5847f4));if(_0x5847f4[_0x0d37('0x16')]){if(_0x5847f4[_0x0d37('0x16')][_0x0d37('0x17')]===0x1f4){logger[_0x0d37('0x16')](_0x0d37('0x12'),_0x49d2e0,_0x5847f4['error'][_0x0d37('0x18')]);return _0x5c1a46(_0x5847f4[_0x0d37('0x16')][_0x0d37('0x18')]);}logger[_0x0d37('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x49d2e0,_0x5847f4['error'][_0x0d37('0x18')]);return _0x2afe78(_0x5847f4[_0x0d37('0x16')]['message']);}else{logger[_0x0d37('0x19')](_0x0d37('0x12'),_0x49d2e0,'request\x20sent');_0x2afe78(_0x5847f4[_0x0d37('0x1a')][_0x0d37('0x18')]);}})[_0x0d37('0x1b')](function(_0x5db285){logger[_0x0d37('0x16')](_0x0d37('0x12'),_0x49d2e0,_0x5db285);_0x5c1a46(_0x5db285);});});} \ No newline at end of file +var _0xb0d2=['ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','localhost','./chatInternalMessage.socket','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x155506,_0x202f81){var _0x14b973=function(_0x560bd2){while(--_0x560bd2){_0x155506['push'](_0x155506['shift']());}};_0x14b973(++_0x202f81);}(_0xb0d2,0x1cf));var _0x2b0d=function(_0x12df7e,_0xa01ff2){_0x12df7e=_0x12df7e-0x0;var _0x54603f=_0xb0d2[_0x12df7e];return _0x54603f;};'use strict';var _=require(_0x2b0d('0x0'));var util=require(_0x2b0d('0x1'));var moment=require(_0x2b0d('0x2'));var BPromise=require(_0x2b0d('0x3'));var rs=require(_0x2b0d('0x4'));var fs=require('fs');var Redis=require(_0x2b0d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2b0d('0x6'));var logger=require('../../config/logger')(_0x2b0d('0x7'));var config=require(_0x2b0d('0x8'));var jayson=require(_0x2b0d('0x9'));var client=jayson['client'][_0x2b0d('0xa')]({'port':0x232a});config[_0x2b0d('0xb')]=_['defaults'](config[_0x2b0d('0xb')],{'host':_0x2b0d('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2b0d('0xb')]));require(_0x2b0d('0xd'))['register'](socket);function respondWithRpcPromise(_0x1621d8,_0xf2ad86,_0x123adc){return new BPromise(function(_0x2f4cc7,_0xea8ef3){return client[_0x2b0d('0xe')](_0x1621d8,_0x123adc)[_0x2b0d('0xf')](function(_0x322a01){logger[_0x2b0d('0x10')](_0x2b0d('0x11'),_0xf2ad86,_0x2b0d('0x12'));logger[_0x2b0d('0x13')](_0x2b0d('0x14'),_0xf2ad86,'request\x20sent',JSON[_0x2b0d('0x15')](_0x322a01));if(_0x322a01['error']){if(_0x322a01[_0x2b0d('0x16')][_0x2b0d('0x17')]===0x1f4){logger[_0x2b0d('0x16')](_0x2b0d('0x11'),_0xf2ad86,_0x322a01[_0x2b0d('0x16')][_0x2b0d('0x18')]);return _0xea8ef3(_0x322a01['error'][_0x2b0d('0x18')]);}logger[_0x2b0d('0x16')](_0x2b0d('0x11'),_0xf2ad86,_0x322a01[_0x2b0d('0x16')]['message']);return _0x2f4cc7(_0x322a01['error'][_0x2b0d('0x18')]);}else{logger[_0x2b0d('0x10')](_0x2b0d('0x11'),_0xf2ad86,_0x2b0d('0x12'));_0x2f4cc7(_0x322a01['result'][_0x2b0d('0x18')]);}})[_0x2b0d('0x19')](function(_0x58ffc8){logger[_0x2b0d('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0xf2ad86,_0x58ffc8);_0xea8ef3(_0x58ffc8);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index e2b8527..297e73e 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 _0xc960=['emit','register','length','chatInternalMessage:','./chatInternalMessage.events','save','remove','update'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xc960,0x114));var _0x0c96=function(_0x12fae2,_0x4045c1){_0x12fae2=_0x12fae2-0x0;var _0x5d6abc=_0xc960[_0x12fae2];return _0x5d6abc;};'use strict';var ChatInternalMessageEvents=require(_0x0c96('0x0'));var events=[_0x0c96('0x1'),_0x0c96('0x2'),_0x0c96('0x3')];function createListener(_0x262812,_0x43699c){return function(_0x1200aa){_0x43699c[_0x0c96('0x4')](_0x262812,_0x1200aa);};}function removeListener(_0x296beb,_0x495e7a){return function(){ChatInternalMessageEvents['removeListener'](_0x296beb,_0x495e7a);};}exports[_0x0c96('0x5')]=function(_0x3b8d56){for(var _0x1aa866=0x0,_0x5886e8=events[_0x0c96('0x6')];_0x1aa866<_0x5886e8;_0x1aa866++){var _0x573004=events[_0x1aa866];var _0x10a702=createListener(_0x0c96('0x7')+_0x573004,_0x3b8d56);ChatInternalMessageEvents['on'](_0x573004,_0x10a702);}}; \ No newline at end of file +var _0xddb5=['./chatInternalMessage.events','save','update','emit','removeListener','register','length','chatInternalMessage:'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xddb5,0x108));var _0x5ddb=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xddb5[_0x3947c9];return _0x2e7871;};'use strict';var ChatInternalMessageEvents=require(_0x5ddb('0x0'));var events=[_0x5ddb('0x1'),'remove',_0x5ddb('0x2')];function createListener(_0x4b638f,_0x3e2efe){return function(_0x37c0f5){_0x3e2efe[_0x5ddb('0x3')](_0x4b638f,_0x37c0f5);};}function removeListener(_0x3cf3eb,_0x456bbb){return function(){ChatInternalMessageEvents[_0x5ddb('0x4')](_0x3cf3eb,_0x456bbb);};}exports[_0x5ddb('0x5')]=function(_0x193dab){for(var _0x46506f=0x0,_0x16caa3=events[_0x5ddb('0x6')];_0x46506f<_0x16caa3;_0x46506f++){var _0x478d1f=events[_0x46506f];var _0x54466f=createListener(_0x5ddb('0x7')+_0x478d1f,_0x193dab);ChatInternalMessageEvents['on'](_0x478d1f,_0x54466f);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 6f0f1e2..f59af33 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 _0x30f0=['index','/describe','describe','/users','show','post','create','put','/:id','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x30f0,0x12b));var _0x030f=function(_0x3e9784,_0xf05e6e){_0x3e9784=_0x3e9784-0x0;var _0x2994a1=_0x30f0[_0x3e9784];return _0x2994a1;};'use strict';var multer=require(_0x030f('0x0'));var util=require(_0x030f('0x1'));var path=require(_0x030f('0x2'));var timeout=require(_0x030f('0x3'));var express=require(_0x030f('0x4'));var router=express[_0x030f('0x5')]();var fs_extra=require(_0x030f('0x6'));var auth=require(_0x030f('0x7'));var interaction=require(_0x030f('0x8'));var config=require(_0x030f('0x9'));var controller=require(_0x030f('0xa'));router[_0x030f('0xb')]('/',auth[_0x030f('0xc')](),controller[_0x030f('0xd')]);router[_0x030f('0xb')](_0x030f('0xe'),auth[_0x030f('0xc')](),controller[_0x030f('0xf')]);router[_0x030f('0xb')](_0x030f('0x10'),auth[_0x030f('0xc')](),controller['getUsers']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x030f('0x11')]);router[_0x030f('0x12')]('/',auth[_0x030f('0xc')](),controller[_0x030f('0x13')]);router[_0x030f('0x14')](_0x030f('0x15'),controller['update']);router[_0x030f('0x16')](_0x030f('0x15'),auth[_0x030f('0xc')](),controller['destroy']);module[_0x030f('0x17')]=router; \ No newline at end of file +var _0xdee0=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','isAuthenticated','index','get','/describe','describe','/users','getUsers','/:id','show','post','create','put','update'];(function(_0x217ff6,_0x36f75d){var _0x417c93=function(_0x4787d2){while(--_0x4787d2){_0x217ff6['push'](_0x217ff6['shift']());}};_0x417c93(++_0x36f75d);}(_0xdee0,0xdb));var _0x0dee=function(_0x226920,_0x21ce02){_0x226920=_0x226920-0x0;var _0x18b964=_0xdee0[_0x226920];return _0x18b964;};'use strict';var multer=require(_0x0dee('0x0'));var util=require(_0x0dee('0x1'));var path=require(_0x0dee('0x2'));var timeout=require(_0x0dee('0x3'));var express=require(_0x0dee('0x4'));var router=express[_0x0dee('0x5')]();var fs_extra=require(_0x0dee('0x6'));var auth=require(_0x0dee('0x7'));var interaction=require(_0x0dee('0x8'));var config=require(_0x0dee('0x9'));var controller=require(_0x0dee('0xa'));router['get']('/',auth[_0x0dee('0xb')](),controller[_0x0dee('0xc')]);router[_0x0dee('0xd')](_0x0dee('0xe'),auth['isAuthenticated'](),controller[_0x0dee('0xf')]);router[_0x0dee('0xd')](_0x0dee('0x10'),auth['isAuthenticated'](),controller[_0x0dee('0x11')]);router[_0x0dee('0xd')](_0x0dee('0x12'),auth['isAuthenticated'](),controller[_0x0dee('0x13')]);router[_0x0dee('0x14')]('/',auth[_0x0dee('0xb')](),controller[_0x0dee('0x15')]);router[_0x0dee('0x16')](_0x0dee('0x12'),controller[_0x0dee('0x17')]);router[_0x0dee('0x18')](_0x0dee('0x12'),auth[_0x0dee('0xb')](),controller[_0x0dee('0x19')]);module[_0x0dee('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 774dd2e..89e20a3 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 _0xd2bf=['DATE','STRING','TEXT','sequelize','BOOLEAN','out'];(function(_0x457d1a,_0x6b408d){var _0x51388c=function(_0x478abe){while(--_0x478abe){_0x457d1a['push'](_0x457d1a['shift']());}};_0x51388c(++_0x6b408d);}(_0xd2bf,0x1dd));var _0xfd2b=function(_0x199bc4,_0x338105){_0x199bc4=_0x199bc4-0x0;var _0x136ffb=_0xd2bf[_0x199bc4];return _0x136ffb;};'use strict';var Sequelize=require(_0xfd2b('0x0'));module['exports']={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xfd2b('0x1')],'defaultValue':![]},'secret':{'type':Sequelize[_0xfd2b('0x1')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xfd2b('0x2')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xfd2b('0x3')]},'providerName':{'type':Sequelize[_0xfd2b('0x4')]},'providerResponse':{'type':Sequelize[_0xfd2b('0x5')]}}; \ No newline at end of file +var _0x659c=['medium','BOOLEAN','ENUM','out','STRING','TEXT','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x659c,0x1aa));var _0xc659=function(_0x4aa348,_0x1659bd){_0x4aa348=_0x4aa348-0x0;var _0x3d1670=_0x659c[_0x4aa348];return _0x3d1670;};'use strict';var Sequelize=require(_0xc659('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0xc659('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xc659('0x2')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xc659('0x3')]('in',_0xc659('0x4')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0xc659('0x5')]},'providerResponse':{'type':Sequelize[_0xc659('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index a44dc26..f0074d2 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 _0x068a=['path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','map','ChatMessage','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','hasOwnProperty','sort','pick','where','type','VIRTUAL','merge','options','includeAll','findAll','rows','show','params','keys','length','find','create','body','describe','chat-interactions','chat','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','parse','RejectMessage','rejectMessage','Sequelize','contact','User','eml-format','rimraf','zip-dir','moment','bluebird','mustache'];(function(_0x1c81d7,_0x23fb0f){var _0x52961e=function(_0x2b0022){while(--_0x2b0022){_0x1c81d7['push'](_0x1c81d7['shift']());}};_0x52961e(++_0x23fb0f);}(_0x068a,0xfe));var _0xa068=function(_0x30fddd,_0x16fe5f){_0x30fddd=_0x30fddd-0x0;var _0x3005e3=_0x068a[_0x30fddd];return _0x3005e3;};'use strict';var emlformat=require(_0xa068('0x0'));var rimraf=require(_0xa068('0x1'));var zipdir=require(_0xa068('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa068('0x3'));var BPromise=require(_0xa068('0x4'));var Mustache=require(_0xa068('0x5'));var util=require('util');var path=require(_0xa068('0x6'));var sox=require('sox');var csv=require(_0xa068('0x7'));var ejs=require(_0xa068('0x8'));var fs=require('fs');var fs_extra=require(_0xa068('0x9'));var _=require(_0xa068('0xa'));var squel=require('squel');var crypto=require(_0xa068('0xb'));var jsforce=require(_0xa068('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa068('0xd'));var Papa=require(_0xa068('0xe'));var Redis=require(_0xa068('0xf'));var authService=require(_0xa068('0x10'));var qs=require(_0xa068('0x11'));var as=require(_0xa068('0x12'));var hardwareService=require(_0xa068('0x13'));var logger=require(_0xa068('0x14'))('api');var utils=require(_0xa068('0x15'));var config=require(_0xa068('0x16'));var licenseUtil=require(_0xa068('0x17'));var db=require(_0xa068('0x18'))['db'];config[_0xa068('0x19')]=_[_0xa068('0x1a')](config['redis'],{'host':_0xa068('0x1b'),'port':0x18eb});var socket=require(_0xa068('0x1c'))(new Redis(config[_0xa068('0x19')]));require(_0xa068('0x1d'))[_0xa068('0x1e')](socket);var jayson=require(_0xa068('0x1f'));var client=jayson[_0xa068('0x20')][_0xa068('0x21')]({'port':0x232c});var client9002=jayson[_0xa068('0x20')][_0xa068('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x1246a1,_0x32391e,_0x8251c6,_0x59d4f0){return new BPromise(function(_0x1eef08,_0x58f0e3){var _0x1860d7=_0x59d4f0||client;return _0x1860d7[_0xa068('0x22')](_0x1246a1,_0x8251c6)['then'](function(_0xbd45db){logger[_0xa068('0x23')](_0xa068('0x24'),_0x32391e,_0xa068('0x25'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x32391e,_0xa068('0x25'),JSON[_0xa068('0x26')](_0xbd45db));if(_0xbd45db['error']){if(_0xbd45db[_0xa068('0x27')]['code']===0x1f4){logger[_0xa068('0x27')](_0xa068('0x24'),_0x32391e,_0xbd45db[_0xa068('0x27')][_0xa068('0x28')]);return _0x58f0e3(_0xbd45db[_0xa068('0x27')][_0xa068('0x28')]);}logger[_0xa068('0x27')](_0xa068('0x24'),_0x32391e,_0xbd45db[_0xa068('0x27')]['message']);return _0x1eef08(_0xbd45db['error'][_0xa068('0x28')]);}else{logger[_0xa068('0x23')](_0xa068('0x24'),_0x32391e,_0xa068('0x25'));_0x1eef08(_0xbd45db['result']['message']);}})[_0xa068('0x29')](function(_0x3523a8){logger['error'](_0xa068('0x24'),_0x32391e,_0x3523a8);_0x58f0e3(_0x3523a8);});});}function respondWithStatusCode(_0x4dc0b0,_0x14e25e){_0x14e25e=_0x14e25e||0xcc;return function(_0x27455d){if(_0x27455d){return _0x4dc0b0['sendStatus'](_0x14e25e);}return _0x4dc0b0['status'](_0x14e25e)['end']();};}function respondWithResult(_0x42b4b0,_0x5b4b5b){_0x5b4b5b=_0x5b4b5b||0xc8;return function(_0x72acd6){if(_0x72acd6){return _0x42b4b0[_0xa068('0x2a')](_0x5b4b5b)[_0xa068('0x2b')](_0x72acd6);}};}function respondWithFilteredResult(_0x39a785,_0x5d79d8){return function(_0x3c15e2){if(_0x3c15e2){var _0xa305a5=typeof _0x5d79d8[_0xa068('0x2c')]===_0xa068('0x2d')&&typeof _0x5d79d8[_0xa068('0x2e')]===_0xa068('0x2d');var _0x615939=_0x3c15e2[_0xa068('0x2f')];var _0x2ca324=_0xa305a5?0x0:_0x5d79d8[_0xa068('0x2c')];var _0x5cf276=_0xa305a5?_0x3c15e2['count']:_0x5d79d8[_0xa068('0x2c')]+_0x5d79d8['limit'];var _0x53d19f;if(_0x5cf276>=_0x615939){_0x5cf276=_0x615939;_0x53d19f=0xc8;}else{_0x53d19f=0xce;}_0x39a785[_0xa068('0x2a')](_0x53d19f);return _0x39a785[_0xa068('0x30')](_0xa068('0x31'),_0x2ca324+'-'+_0x5cf276+'/'+_0x615939)[_0xa068('0x2b')](_0x3c15e2);}return null;};}function patchUpdates(_0x106b10){return function(_0x12b1bf){try{jsonpatch[_0xa068('0x32')](_0x12b1bf,_0x106b10,!![]);}catch(_0x4abb8a){return BPromise[_0xa068('0x33')](_0x4abb8a);}return _0x12b1bf[_0xa068('0x34')]();};}function saveUpdates(_0x1c8da8,_0x379bd6){return function(_0x405474){if(_0x405474){return _0x405474[_0xa068('0x35')](_0x1c8da8)[_0xa068('0x36')](function(_0x838f58){return _0x838f58;});}return null;};}function removeEntity(_0x2cc4da,_0x31567a){return function(_0x2c8280){if(_0x2c8280){return _0x2c8280[_0xa068('0x37')]()['then'](function(){_0x2cc4da[_0xa068('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e0f5f,_0x524f25){return function(_0x67a15f){if(!_0x67a15f){_0x2e0f5f[_0xa068('0x38')](0x194);}return _0x67a15f;};}function handleError(_0x24406b,_0x3a9db6){_0x3a9db6=_0x3a9db6||0x1f4;return function(_0xde8dec){logger[_0xa068('0x27')](_0xde8dec[_0xa068('0x39')]);if(_0xde8dec[_0xa068('0x3a')]){delete _0xde8dec[_0xa068('0x3a')];}_0x24406b[_0xa068('0x2a')](_0x3a9db6)[_0xa068('0x3b')](_0xde8dec);};}exports['index']=function(_0x3aea29,_0x4d9b3e){var _0x2f1117={},_0xe3b1b8={},_0x2525c8={'count':0x0,'rows':[]};var _0x38f756=_[_0xa068('0x3c')](db[_0xa068('0x3d')][_0xa068('0x3e')],function(_0x35bbf2){return{'name':_0x35bbf2[_0xa068('0x3f')],'type':_0x35bbf2['type']['key']};});_0xe3b1b8[_0xa068('0x40')]=_[_0xa068('0x3c')](_0x38f756,'name');_0xe3b1b8['query']=_['keys'](_0x3aea29[_0xa068('0x41')]);_0xe3b1b8[_0xa068('0x42')]=_[_0xa068('0x43')](_0xe3b1b8[_0xa068('0x40')],_0xe3b1b8[_0xa068('0x41')]);_0x2f1117[_0xa068('0x44')]=_[_0xa068('0x43')](_0xe3b1b8[_0xa068('0x40')],qs[_0xa068('0x45')](_0x3aea29[_0xa068('0x41')][_0xa068('0x45')]));_0x2f1117[_0xa068('0x44')]=_0x2f1117[_0xa068('0x44')]['length']?_0x2f1117[_0xa068('0x44')]:_0xe3b1b8['model'];if(!_0x3aea29['query'][_0xa068('0x46')]('nolimit')){_0x2f1117[_0xa068('0x2e')]=qs[_0xa068('0x2e')](_0x3aea29[_0xa068('0x41')]['limit']);_0x2f1117[_0xa068('0x2c')]=qs[_0xa068('0x2c')](_0x3aea29[_0xa068('0x41')]['offset']);}_0x2f1117['order']=qs[_0xa068('0x47')](_0x3aea29[_0xa068('0x41')][_0xa068('0x47')]);_0x2f1117['where']=qs[_0xa068('0x42')](_[_0xa068('0x48')](_0x3aea29[_0xa068('0x41')],_0xe3b1b8[_0xa068('0x42')]),_0x38f756);if(_0x3aea29['query']['filter']){_0x2f1117[_0xa068('0x49')]=_['merge'](_0x2f1117[_0xa068('0x49')],{'$or':_[_0xa068('0x3c')](_0x38f756,function(_0x54c2c5){if(_0x54c2c5[_0xa068('0x4a')]!==_0xa068('0x4b')){var _0x31cfd7={};_0x31cfd7[_0x54c2c5[_0xa068('0x3a')]]={'$like':'%'+_0x3aea29[_0xa068('0x41')]['filter']+'%'};return _0x31cfd7;}})});}_0x2f1117=_[_0xa068('0x4c')]({},_0x2f1117,_0x3aea29[_0xa068('0x4d')]);var _0x1d6736={'where':_0x2f1117[_0xa068('0x49')]};return db[_0xa068('0x3d')]['count'](_0x1d6736)[_0xa068('0x36')](function(_0x3655c6){_0x2525c8['count']=_0x3655c6;if(_0x3aea29['query'][_0xa068('0x4e')]){_0x2f1117['include']=[{'all':!![]}];}return db[_0xa068('0x3d')][_0xa068('0x4f')](_0x2f1117);})['then'](function(_0x32028b){_0x2525c8[_0xa068('0x50')]=_0x32028b;return _0x2525c8;})['then'](respondWithFilteredResult(_0x4d9b3e,_0x2f1117))[_0xa068('0x29')](handleError(_0x4d9b3e,null));};exports[_0xa068('0x51')]=function(_0x3d16c8,_0x3533b0){var _0x432594={'raw':!![],'where':{'id':_0x3d16c8[_0xa068('0x52')]['id']}},_0x3efd99={};_0x3efd99[_0xa068('0x40')]=_[_0xa068('0x53')](db[_0xa068('0x3d')][_0xa068('0x3e')]);_0x3efd99[_0xa068('0x41')]=_['keys'](_0x3d16c8[_0xa068('0x41')]);_0x3efd99[_0xa068('0x42')]=_[_0xa068('0x43')](_0x3efd99['model'],_0x3efd99[_0xa068('0x41')]);_0x432594[_0xa068('0x44')]=_['intersection'](_0x3efd99[_0xa068('0x40')],qs[_0xa068('0x45')](_0x3d16c8[_0xa068('0x41')][_0xa068('0x45')]));_0x432594[_0xa068('0x44')]=_0x432594['attributes'][_0xa068('0x54')]?_0x432594[_0xa068('0x44')]:_0x3efd99['model'];if(_0x3d16c8[_0xa068('0x41')][_0xa068('0x4e')]){_0x432594['include']=[{'all':!![]}];}_0x432594=_[_0xa068('0x4c')]({},_0x432594,_0x3d16c8['options']);return db[_0xa068('0x3d')][_0xa068('0x55')](_0x432594)[_0xa068('0x36')](handleEntityNotFound(_0x3533b0,null))[_0xa068('0x36')](respondWithResult(_0x3533b0,null))[_0xa068('0x29')](handleError(_0x3533b0,null));};exports[_0xa068('0x56')]=function(_0x20c793,_0x1d1a6d){return db[_0xa068('0x3d')][_0xa068('0x56')](_0x20c793[_0xa068('0x57')],{})[_0xa068('0x36')](respondWithResult(_0x1d1a6d,0xc9))[_0xa068('0x29')](handleError(_0x1d1a6d,null));};exports[_0xa068('0x35')]=function(_0x3ffba6,_0x4cd5f3){if(_0x3ffba6[_0xa068('0x57')]['id']){delete _0x3ffba6[_0xa068('0x57')]['id'];}return db[_0xa068('0x3d')][_0xa068('0x55')]({'where':{'id':_0x3ffba6['params']['id']}})[_0xa068('0x36')](handleEntityNotFound(_0x4cd5f3,null))[_0xa068('0x36')](saveUpdates(_0x3ffba6[_0xa068('0x57')],null))[_0xa068('0x36')](respondWithResult(_0x4cd5f3,null))[_0xa068('0x29')](handleError(_0x4cd5f3,null));};exports[_0xa068('0x37')]=function(_0xf6b510,_0x27be55){return db[_0xa068('0x3d')][_0xa068('0x55')]({'where':{'id':_0xf6b510['params']['id']}})[_0xa068('0x36')](handleEntityNotFound(_0x27be55,null))['then'](removeEntity(_0x27be55,null))['catch'](handleError(_0x27be55,null));};exports[_0xa068('0x58')]=function(_0x4c64cd,_0x2d375c){return db['ChatMessage'][_0xa068('0x58')]()[_0xa068('0x36')](respondWithResult(_0x2d375c,null))[_0xa068('0x29')](handleError(_0x2d375c,null));};var interaction_log=require(_0xa068('0x14'))(_0xa068('0x59'));exports['accept']=function(_0x242f4c,_0x58087b,_0x49b49c){var _0x563238={'agent':{},'channel':_0xa068('0x5a')};if(_0x242f4c[_0xa068('0x57')]['id']){delete _0x242f4c[_0xa068('0x57')]['id'];}_0x242f4c['body']['read']=!![];_0x242f4c[_0xa068('0x57')][_0xa068('0x5b')]=moment()[_0xa068('0x5c')](_0xa068('0x5d'));_0x242f4c[_0xa068('0x57')][_0xa068('0x5e')]=_0x242f4c['body']['UserId']||_0x242f4c[_0xa068('0x5f')]['id'];_0x563238[_0xa068('0x60')]['id']=_0x242f4c[_0xa068('0x57')][_0xa068('0x5e')];return db[_0xa068('0x3d')][_0xa068('0x55')]({'where':{'id':_0x242f4c[_0xa068('0x52')]['id'],'UserId':null}})[_0xa068('0x36')](handleEntityNotFound(_0x58087b,null))[_0xa068('0x36')](saveUpdates(_0x242f4c[_0xa068('0x57')],null))['then'](function(_0x24e995){if(_0x24e995){_0x563238[_0xa068('0x28')]=_0x24e995[_0xa068('0x61')]({'plain':!![]});return db[_0xa068('0x62')][_0xa068('0x55')]({'where':{'id':_0x24e995['ChatInteractionId']}});}return null;})[_0xa068('0x36')](handleEntityNotFound(_0x58087b,null))[_0xa068('0x36')](function(_0x4642cf){if(_0x4642cf){return _0x4642cf[_0xa068('0x35')]({'UserId':_0x242f4c[_0xa068('0x57')][_0xa068('0x5e')],'read1stAt':_[_0xa068('0x63')](_0x4642cf[_0xa068('0x64')])?moment()[_0xa068('0x5c')](_0xa068('0x5d')):undefined});}return null;})[_0xa068('0x36')](function(_0x31304a){if(_0x31304a){_0x563238[_0xa068('0x65')]=_0x31304a[_0xa068('0x61')]({'plain':!![]});interaction_log[_0xa068('0x23')](_0xa068('0x66'),_0x242f4c[_0xa068('0x5f')]['id'],_0x242f4c[_0xa068('0x5f')]['name'],_0x242f4c[_0xa068('0x5f')][_0xa068('0x67')],_0x563238[_0xa068('0x65')]['id'],_0x242f4c[_0xa068('0x57')]?JSON[_0xa068('0x26')](_0x242f4c[_0xa068('0x57')]):_0xa068('0x68'));return respondWithRpcPromise(_0xa068('0x69'),_0xa068('0x6a'),_0x563238);}return null;})['then'](function(_0x5a596f){var _0x3fa311=_0xa068('0x6b')+_0x5a596f['message'][_0xa068('0x6c')];return db[_0xa068('0x6d')][_0xa068('0x41')](_0x3fa311,{'type':db['Sequelize'][_0xa068('0x6e')][_0xa068('0x6f')],'raw':!![]})['then'](function(_0x30a6){return _0x30a6;});})[_0xa068('0x36')](function(_0x2ba909){if(_0x2ba909){_0x563238[_0xa068('0x28')]['contact']=_0x2ba909[0x0];if(!_0x242f4c['body']['UserId'])return;return db['User']['find']({'where':{'id':_0x242f4c[_0xa068('0x57')][_0xa068('0x5e')],'role':_0xa068('0x60')},'attributes':['id',_0xa068('0x3a'),_0xa068('0x70'),_0xa068('0x71'),_0xa068('0x72')],'raw':!![]});}return null;})['then'](function(_0x3621f7){if(!_0x3621f7)return null;_0x563238[_0xa068('0x28')][_0xa068('0x60')]=_0x3621f7;return _0x563238;})[_0xa068('0x36')](function(_0x551ab4){if(_0x551ab4){if(_0x242f4c['body'][_0xa068('0x73')]){_0x563238[_0xa068('0x28')][_0xa068('0x74')]=util[_0xa068('0x5c')](_0xa068('0x75'),_0x242f4c['user'][_0xa068('0x3a')]);_0x563238['message']['channel']=_0x563238[_0xa068('0x76')];_0x563238[_0xa068('0x28')][_0xa068('0x77')]=_0x563238[_0xa068('0x76')];_0x563238[_0xa068('0x28')][_0xa068('0x78')]=_0xa068('0x79');return respondWithRpcPromise(_0xa068('0x7a'),'EventManager',{'event':_0xa068('0x7b'),'message':_[_0xa068('0x4c')](_0x563238[_0xa068('0x28')],JSON[_0xa068('0x7c')](_0x563238[_0xa068('0x65')]['formData']))},client9002)['then'](function(){return _0x563238;});}return _0x563238;}return null;})[_0xa068('0x36')](respondWithResult(_0x58087b,null))['catch'](handleError(_0x58087b,null));};var interaction_log=require('../../config/logger')(_0xa068('0x59'));exports[_0xa068('0x33')]=function(_0x4b16d5,_0x1fee28,_0x5258a8){var _0x3bc5b6={'agent':{},'channel':_0xa068('0x5a')};if(_0x4b16d5[_0xa068('0x57')]['id']){delete _0x4b16d5[_0xa068('0x57')]['id'];}_0x4b16d5[_0xa068('0x57')][_0xa068('0x5e')]=_0x4b16d5[_0xa068('0x57')][_0xa068('0x5e')]||_0x4b16d5[_0xa068('0x5f')]['id'];_0x3bc5b6[_0xa068('0x60')]['id']=_0x4b16d5[_0xa068('0x57')]['UserId'];return db[_0xa068('0x3d')]['find']({'where':{'id':_0x4b16d5[_0xa068('0x52')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1fee28,null))[_0xa068('0x36')](function(_0x222668){if(_0x222668){_0x3bc5b6[_0xa068('0x28')]=_0x222668[_0xa068('0x61')]({'plain':!![]});return db[_0xa068('0x62')][_0xa068('0x55')]({'where':{'id':_0x222668['ChatInteractionId']}});}return null;})[_0xa068('0x36')](handleEntityNotFound(_0x1fee28,null))[_0xa068('0x36')](function(_0x44bc92){if(_0x44bc92){_0x3bc5b6[_0xa068('0x65')]=_0x44bc92[_0xa068('0x61')]({'plain':!![]});interaction_log[_0xa068('0x23')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4b16d5[_0xa068('0x5f')]['id'],_0x4b16d5[_0xa068('0x5f')][_0xa068('0x3a')],_0x4b16d5[_0xa068('0x5f')][_0xa068('0x67')],_0x3bc5b6[_0xa068('0x65')]['id'],_0x4b16d5[_0xa068('0x57')]?JSON[_0xa068('0x26')](_0x4b16d5[_0xa068('0x57')]):_0xa068('0x68'));return respondWithRpcPromise(_0xa068('0x7d'),_0xa068('0x7e'),_0x3bc5b6);}return null;})[_0xa068('0x36')](function(_0x4d9922){var _0x381e75=_0xa068('0x6b')+_0x4d9922[_0xa068('0x28')][_0xa068('0x6c')];return db[_0xa068('0x6d')][_0xa068('0x41')](_0x381e75,{'type':db[_0xa068('0x7f')][_0xa068('0x6e')][_0xa068('0x6f')],'raw':!![]})[_0xa068('0x36')](function(_0x55d97f){return _0x55d97f;});})['then'](function(_0x1cc41b){if(_0x1cc41b){_0x3bc5b6[_0xa068('0x28')][_0xa068('0x80')]=_0x1cc41b[0x0];if(!_0x4b16d5[_0xa068('0x57')][_0xa068('0x5e')])return;return db[_0xa068('0x81')]['find']({'where':{'id':_0x4b16d5['body'][_0xa068('0x5e')],'role':_0xa068('0x60')},'attributes':['id',_0xa068('0x3a'),_0xa068('0x70'),_0xa068('0x71'),_0xa068('0x72')],'raw':!![]});}return null;})[_0xa068('0x36')](function(_0x30be5d){if(!_0x30be5d)return null;_0x3bc5b6[_0xa068('0x28')][_0xa068('0x60')]=_0x30be5d;return _0x3bc5b6;})[_0xa068('0x36')](function(_0x3ee4b7){if(_0x3ee4b7){_0x3ee4b7['message'][_0xa068('0x74')]=util[_0xa068('0x5c')]('SIP/%s',_0x4b16d5['user'][_0xa068('0x3a')]);_0x3ee4b7['message']['channel']=_0x3bc5b6['channel'];_0x3ee4b7[_0xa068('0x28')][_0xa068('0x77')]=_0x3bc5b6[_0xa068('0x76')];_0x3ee4b7[_0xa068('0x28')][_0xa068('0x78')]=_0xa068('0x33');respondWithRpcPromise('EventManager','EventManager',{'event':'rejectmessage','message':_[_0xa068('0x4c')](_0x3bc5b6[_0xa068('0x28')],JSON[_0xa068('0x7c')](_0x3bc5b6[_0xa068('0x65')]['formData']))},client9002);return _0x3bc5b6;}return null;})['then'](respondWithResult(_0x1fee28,null))['catch'](handleError(_0x1fee28,null));}; \ No newline at end of file +var _0x6921=['name','send','index','map','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','options','ChatMessage','count','include','catch','params','includeAll','find','create','body','describe','chat-interactions','accept','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','ChatInteraction','ChatInteractionId','isNil','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','contact','fullname','email','internal','manual','interface','SIP/%s','motionChannel','channel','event','EventManager','acceptmessage','parse','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','SELECT','User','format','rejectmessage','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','./chatMessage.socket','jayson/promise','client','http','request','info','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ChatMessage,\x20%s,\x20%s','message','result','end','status','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack'];(function(_0x433f44,_0xa365ce){var _0x73664=function(_0x14501b){while(--_0x14501b){_0x433f44['push'](_0x433f44['shift']());}};_0x73664(++_0xa365ce);}(_0x6921,0x157));var _0x1692=function(_0x2edcdf,_0x2c1680){_0x2edcdf=_0x2edcdf-0x0;var _0x11a8ae=_0x6921[_0x2edcdf];return _0x11a8ae;};'use strict';var emlformat=require(_0x1692('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1692('0x1'));var jsonpatch=require(_0x1692('0x2'));var rp=require(_0x1692('0x3'));var moment=require(_0x1692('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1692('0x5'));var util=require('util');var path=require('path');var sox=require(_0x1692('0x6'));var csv=require(_0x1692('0x7'));var ejs=require(_0x1692('0x8'));var fs=require('fs');var fs_extra=require(_0x1692('0x9'));var _=require(_0x1692('0xa'));var squel=require(_0x1692('0xb'));var crypto=require(_0x1692('0xc'));var jsforce=require(_0x1692('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1692('0xe'));var authService=require(_0x1692('0xf'));var qs=require(_0x1692('0x10'));var as=require(_0x1692('0x11'));var hardwareService=require(_0x1692('0x12'));var logger=require(_0x1692('0x13'))('api');var utils=require(_0x1692('0x14'));var config=require(_0x1692('0x15'));var licenseUtil=require(_0x1692('0x16'));var db=require(_0x1692('0x17'))['db'];config['redis']=_[_0x1692('0x18')](config['redis'],{'host':_0x1692('0x19'),'port':0x18eb});var socket=require(_0x1692('0x1a'))(new Redis(config['redis']));require(_0x1692('0x1b'))['register'](socket);var jayson=require(_0x1692('0x1c'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x1692('0x1d')][_0x1692('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x289bdd,_0x1b68e,_0x42bccd,_0x378571){return new BPromise(function(_0x5063e5,_0x51fe19){var _0x7dad01=_0x378571||client;return _0x7dad01[_0x1692('0x1f')](_0x289bdd,_0x42bccd)['then'](function(_0x489116){logger[_0x1692('0x20')]('ChatMessage,\x20%s,\x20%s',_0x1b68e,'request\x20sent');logger[_0x1692('0x21')](_0x1692('0x22'),_0x1b68e,_0x1692('0x23'),JSON[_0x1692('0x24')](_0x489116));if(_0x489116[_0x1692('0x25')]){if(_0x489116[_0x1692('0x25')]['code']===0x1f4){logger[_0x1692('0x25')](_0x1692('0x26'),_0x1b68e,_0x489116[_0x1692('0x25')][_0x1692('0x27')]);return _0x51fe19(_0x489116['error'][_0x1692('0x27')]);}logger['error'](_0x1692('0x26'),_0x1b68e,_0x489116[_0x1692('0x25')]['message']);return _0x5063e5(_0x489116[_0x1692('0x25')][_0x1692('0x27')]);}else{logger[_0x1692('0x20')](_0x1692('0x26'),_0x1b68e,'request\x20sent');_0x5063e5(_0x489116[_0x1692('0x28')][_0x1692('0x27')]);}})['catch'](function(_0x487aa4){logger[_0x1692('0x25')](_0x1692('0x26'),_0x1b68e,_0x487aa4);_0x51fe19(_0x487aa4);});});}function respondWithStatusCode(_0x59ed9b,_0x3a046b){_0x3a046b=_0x3a046b||0xcc;return function(_0x1c3af9){if(_0x1c3af9){return _0x59ed9b['sendStatus'](_0x3a046b);}return _0x59ed9b['status'](_0x3a046b)[_0x1692('0x29')]();};}function respondWithResult(_0x40f9b2,_0xb0d45a){_0xb0d45a=_0xb0d45a||0xc8;return function(_0x2a8e23){if(_0x2a8e23){return _0x40f9b2[_0x1692('0x2a')](_0xb0d45a)['json'](_0x2a8e23);}};}function respondWithFilteredResult(_0x18fcca,_0x34336e){return function(_0x435ff5){if(_0x435ff5){var _0x28eef9=typeof _0x34336e[_0x1692('0x2b')]===_0x1692('0x2c')&&typeof _0x34336e[_0x1692('0x2d')]===_0x1692('0x2c');var _0x35dae4=_0x435ff5['count'];var _0x29327c=_0x28eef9?0x0:_0x34336e['offset'];var _0x28b1a5=_0x28eef9?_0x435ff5['count']:_0x34336e[_0x1692('0x2b')]+_0x34336e[_0x1692('0x2d')];var _0x35addd;if(_0x28b1a5>=_0x35dae4){_0x28b1a5=_0x35dae4;_0x35addd=0xc8;}else{_0x35addd=0xce;}_0x18fcca[_0x1692('0x2a')](_0x35addd);return _0x18fcca[_0x1692('0x2e')](_0x1692('0x2f'),_0x29327c+'-'+_0x28b1a5+'/'+_0x35dae4)['json'](_0x435ff5);}return null;};}function patchUpdates(_0x65662c){return function(_0x177fc6){try{jsonpatch[_0x1692('0x30')](_0x177fc6,_0x65662c,!![]);}catch(_0x5ad166){return BPromise[_0x1692('0x31')](_0x5ad166);}return _0x177fc6[_0x1692('0x32')]();};}function saveUpdates(_0x107af2,_0x5d1f0e){return function(_0x4620dc){if(_0x4620dc){return _0x4620dc[_0x1692('0x33')](_0x107af2)[_0x1692('0x34')](function(_0x2d359d){return _0x2d359d;});}return null;};}function removeEntity(_0x3e399d,_0x94350f){return function(_0x341718){if(_0x341718){return _0x341718[_0x1692('0x35')]()[_0x1692('0x34')](function(){_0x3e399d[_0x1692('0x2a')](0xcc)[_0x1692('0x29')]();});}};}function handleEntityNotFound(_0x155e69,_0x22a26f){return function(_0x308951){if(!_0x308951){_0x155e69[_0x1692('0x36')](0x194);}return _0x308951;};}function handleError(_0x31cfad,_0x23abaf){_0x23abaf=_0x23abaf||0x1f4;return function(_0x542cce){logger[_0x1692('0x25')](_0x542cce[_0x1692('0x37')]);if(_0x542cce['name']){delete _0x542cce[_0x1692('0x38')];}_0x31cfad[_0x1692('0x2a')](_0x23abaf)[_0x1692('0x39')](_0x542cce);};}exports[_0x1692('0x3a')]=function(_0x49c0ff,_0x314a36){var _0x422648={},_0x7d4c04={},_0x464901={'count':0x0,'rows':[]};var _0x4d384c=_[_0x1692('0x3b')](db['ChatMessage'][_0x1692('0x3c')],function(_0x35f837){return{'name':_0x35f837['fieldName'],'type':_0x35f837['type'][_0x1692('0x3d')]};});_0x7d4c04[_0x1692('0x3e')]=_[_0x1692('0x3b')](_0x4d384c,_0x1692('0x38'));_0x7d4c04[_0x1692('0x3f')]=_[_0x1692('0x40')](_0x49c0ff[_0x1692('0x3f')]);_0x7d4c04[_0x1692('0x41')]=_[_0x1692('0x42')](_0x7d4c04['model'],_0x7d4c04[_0x1692('0x3f')]);_0x422648[_0x1692('0x43')]=_[_0x1692('0x42')](_0x7d4c04[_0x1692('0x3e')],qs[_0x1692('0x44')](_0x49c0ff['query'][_0x1692('0x44')]));_0x422648['attributes']=_0x422648[_0x1692('0x43')][_0x1692('0x45')]?_0x422648[_0x1692('0x43')]:_0x7d4c04['model'];if(!_0x49c0ff[_0x1692('0x3f')][_0x1692('0x46')](_0x1692('0x47'))){_0x422648['limit']=qs[_0x1692('0x2d')](_0x49c0ff[_0x1692('0x3f')][_0x1692('0x2d')]);_0x422648[_0x1692('0x2b')]=qs[_0x1692('0x2b')](_0x49c0ff[_0x1692('0x3f')][_0x1692('0x2b')]);}_0x422648[_0x1692('0x48')]=qs[_0x1692('0x49')](_0x49c0ff['query'][_0x1692('0x49')]);_0x422648[_0x1692('0x4a')]=qs[_0x1692('0x41')](_['pick'](_0x49c0ff['query'],_0x7d4c04[_0x1692('0x41')]),_0x4d384c);if(_0x49c0ff[_0x1692('0x3f')]['filter']){_0x422648[_0x1692('0x4a')]=_[_0x1692('0x4b')](_0x422648['where'],{'$or':_[_0x1692('0x3b')](_0x4d384c,function(_0x3d0ee5){if(_0x3d0ee5[_0x1692('0x4c')]!==_0x1692('0x4d')){var _0x568232={};_0x568232[_0x3d0ee5['name']]={'$like':'%'+_0x49c0ff[_0x1692('0x3f')]['filter']+'%'};return _0x568232;}})});}_0x422648=_[_0x1692('0x4b')]({},_0x422648,_0x49c0ff[_0x1692('0x4e')]);var _0x442ee6={'where':_0x422648[_0x1692('0x4a')]};return db[_0x1692('0x4f')][_0x1692('0x50')](_0x442ee6)['then'](function(_0x6be107){_0x464901[_0x1692('0x50')]=_0x6be107;if(_0x49c0ff[_0x1692('0x3f')]['includeAll']){_0x422648[_0x1692('0x51')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x422648);})[_0x1692('0x34')](function(_0x1c1d14){_0x464901['rows']=_0x1c1d14;return _0x464901;})[_0x1692('0x34')](respondWithFilteredResult(_0x314a36,_0x422648))[_0x1692('0x52')](handleError(_0x314a36,null));};exports['show']=function(_0x2bf2ce,_0x116cd6){var _0x318d20={'raw':!![],'where':{'id':_0x2bf2ce[_0x1692('0x53')]['id']}},_0x4da772={};_0x4da772[_0x1692('0x3e')]=_[_0x1692('0x40')](db[_0x1692('0x4f')][_0x1692('0x3c')]);_0x4da772[_0x1692('0x3f')]=_['keys'](_0x2bf2ce[_0x1692('0x3f')]);_0x4da772['filters']=_[_0x1692('0x42')](_0x4da772[_0x1692('0x3e')],_0x4da772[_0x1692('0x3f')]);_0x318d20[_0x1692('0x43')]=_[_0x1692('0x42')](_0x4da772['model'],qs[_0x1692('0x44')](_0x2bf2ce[_0x1692('0x3f')]['fields']));_0x318d20[_0x1692('0x43')]=_0x318d20[_0x1692('0x43')][_0x1692('0x45')]?_0x318d20[_0x1692('0x43')]:_0x4da772[_0x1692('0x3e')];if(_0x2bf2ce[_0x1692('0x3f')][_0x1692('0x54')]){_0x318d20[_0x1692('0x51')]=[{'all':!![]}];}_0x318d20=_[_0x1692('0x4b')]({},_0x318d20,_0x2bf2ce[_0x1692('0x4e')]);return db[_0x1692('0x4f')][_0x1692('0x55')](_0x318d20)[_0x1692('0x34')](handleEntityNotFound(_0x116cd6,null))[_0x1692('0x34')](respondWithResult(_0x116cd6,null))['catch'](handleError(_0x116cd6,null));};exports[_0x1692('0x56')]=function(_0x196cb4,_0x2e6a5e){return db[_0x1692('0x4f')][_0x1692('0x56')](_0x196cb4[_0x1692('0x57')],{})[_0x1692('0x34')](respondWithResult(_0x2e6a5e,0xc9))[_0x1692('0x52')](handleError(_0x2e6a5e,null));};exports['update']=function(_0x15c70b,_0xb19b61){if(_0x15c70b[_0x1692('0x57')]['id']){delete _0x15c70b[_0x1692('0x57')]['id'];}return db[_0x1692('0x4f')][_0x1692('0x55')]({'where':{'id':_0x15c70b[_0x1692('0x53')]['id']}})[_0x1692('0x34')](handleEntityNotFound(_0xb19b61,null))[_0x1692('0x34')](saveUpdates(_0x15c70b[_0x1692('0x57')],null))[_0x1692('0x34')](respondWithResult(_0xb19b61,null))['catch'](handleError(_0xb19b61,null));};exports[_0x1692('0x35')]=function(_0x2d6a39,_0x2da7b4){return db[_0x1692('0x4f')][_0x1692('0x55')]({'where':{'id':_0x2d6a39[_0x1692('0x53')]['id']}})[_0x1692('0x34')](handleEntityNotFound(_0x2da7b4,null))['then'](removeEntity(_0x2da7b4,null))[_0x1692('0x52')](handleError(_0x2da7b4,null));};exports['describe']=function(_0xb6bccf,_0x1ddc6e){return db[_0x1692('0x4f')][_0x1692('0x58')]()[_0x1692('0x34')](respondWithResult(_0x1ddc6e,null))[_0x1692('0x52')](handleError(_0x1ddc6e,null));};var interaction_log=require(_0x1692('0x13'))(_0x1692('0x59'));exports[_0x1692('0x5a')]=function(_0x3b49f2,_0x2f9240,_0x1484d7){var _0x4f1a6d={'agent':{},'channel':_0x1692('0x5b')};if(_0x3b49f2['body']['id']){delete _0x3b49f2[_0x1692('0x57')]['id'];}_0x3b49f2['body'][_0x1692('0x5c')]=!![];_0x3b49f2[_0x1692('0x57')][_0x1692('0x5d')]=moment()['format'](_0x1692('0x5e'));_0x3b49f2[_0x1692('0x57')]['UserId']=_0x3b49f2[_0x1692('0x57')][_0x1692('0x5f')]||_0x3b49f2[_0x1692('0x60')]['id'];_0x4f1a6d[_0x1692('0x61')]['id']=_0x3b49f2[_0x1692('0x57')][_0x1692('0x5f')];return db[_0x1692('0x4f')][_0x1692('0x55')]({'where':{'id':_0x3b49f2['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2f9240,null))[_0x1692('0x34')](saveUpdates(_0x3b49f2[_0x1692('0x57')],null))[_0x1692('0x34')](function(_0x355c22){if(_0x355c22){_0x4f1a6d[_0x1692('0x27')]=_0x355c22['get']({'plain':!![]});return db[_0x1692('0x62')][_0x1692('0x55')]({'where':{'id':_0x355c22[_0x1692('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x2f9240,null))[_0x1692('0x34')](function(_0x3e1d50){if(_0x3e1d50){return _0x3e1d50[_0x1692('0x33')]({'UserId':_0x3b49f2[_0x1692('0x57')][_0x1692('0x5f')],'read1stAt':_[_0x1692('0x64')](_0x3e1d50['read1stAt'])?moment()['format'](_0x1692('0x5e')):undefined});}return null;})['then'](function(_0x256bf0){if(_0x256bf0){_0x4f1a6d['interaction']=_0x256bf0[_0x1692('0x65')]({'plain':!![]});interaction_log[_0x1692('0x20')](_0x1692('0x66'),_0x3b49f2['user']['id'],_0x3b49f2['user']['name'],_0x3b49f2[_0x1692('0x60')][_0x1692('0x67')],_0x4f1a6d[_0x1692('0x68')]['id'],_0x3b49f2[_0x1692('0x57')]?JSON[_0x1692('0x24')](_0x3b49f2[_0x1692('0x57')]):_0x1692('0x69'));return respondWithRpcPromise('AcceptMessage',_0x1692('0x6a'),_0x4f1a6d);}return null;})[_0x1692('0x34')](function(_0x5cfc46){var _0x581d28=_0x1692('0x6b')+_0x5cfc46[_0x1692('0x27')]['ContactId'];return db[_0x1692('0x6c')][_0x1692('0x3f')](_0x581d28,{'type':db[_0x1692('0x6d')][_0x1692('0x6e')]['SELECT'],'raw':!![]})[_0x1692('0x34')](function(_0x361e68){return _0x361e68;});})['then'](function(_0x3ca539){if(_0x3ca539){_0x4f1a6d[_0x1692('0x27')][_0x1692('0x6f')]=_0x3ca539[0x0];if(!_0x3b49f2[_0x1692('0x57')]['UserId'])return;return db['User']['find']({'where':{'id':_0x3b49f2[_0x1692('0x57')][_0x1692('0x5f')],'role':_0x1692('0x61')},'attributes':['id',_0x1692('0x38'),_0x1692('0x70'),_0x1692('0x71'),_0x1692('0x72')],'raw':!![]});}return null;})[_0x1692('0x34')](function(_0x19e389){if(!_0x19e389)return null;_0x4f1a6d[_0x1692('0x27')]['agent']=_0x19e389;return _0x4f1a6d;})[_0x1692('0x34')](function(_0x2772cb){if(_0x2772cb){if(_0x3b49f2['body'][_0x1692('0x73')]){_0x4f1a6d[_0x1692('0x27')][_0x1692('0x74')]=util['format'](_0x1692('0x75'),_0x3b49f2[_0x1692('0x60')][_0x1692('0x38')]);_0x4f1a6d['message']['channel']=_0x4f1a6d['channel'];_0x4f1a6d[_0x1692('0x27')][_0x1692('0x76')]=_0x4f1a6d[_0x1692('0x77')];_0x4f1a6d[_0x1692('0x27')][_0x1692('0x78')]=_0x1692('0x5a');return respondWithRpcPromise(_0x1692('0x79'),_0x1692('0x79'),{'event':_0x1692('0x7a'),'message':_['merge'](_0x4f1a6d[_0x1692('0x27')],JSON[_0x1692('0x7b')](_0x4f1a6d[_0x1692('0x68')][_0x1692('0x7c')]))},client9002)[_0x1692('0x34')](function(){return _0x4f1a6d;});}return _0x4f1a6d;}return null;})['then'](respondWithResult(_0x2f9240,null))[_0x1692('0x52')](handleError(_0x2f9240,null));};var interaction_log=require(_0x1692('0x13'))('chat-interactions');exports[_0x1692('0x31')]=function(_0x3e2362,_0x56858d,_0x53f22b){var _0x77ba2d={'agent':{},'channel':_0x1692('0x5b')};if(_0x3e2362[_0x1692('0x57')]['id']){delete _0x3e2362[_0x1692('0x57')]['id'];}_0x3e2362['body']['UserId']=_0x3e2362[_0x1692('0x57')][_0x1692('0x5f')]||_0x3e2362[_0x1692('0x60')]['id'];_0x77ba2d[_0x1692('0x61')]['id']=_0x3e2362['body'][_0x1692('0x5f')];return db[_0x1692('0x4f')][_0x1692('0x55')]({'where':{'id':_0x3e2362[_0x1692('0x53')]['id'],'UserId':null}})[_0x1692('0x34')](handleEntityNotFound(_0x56858d,null))[_0x1692('0x34')](function(_0x3252ca){if(_0x3252ca){_0x77ba2d[_0x1692('0x27')]=_0x3252ca[_0x1692('0x65')]({'plain':!![]});return db[_0x1692('0x62')][_0x1692('0x55')]({'where':{'id':_0x3252ca[_0x1692('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x56858d,null))[_0x1692('0x34')](function(_0x1e651a){if(_0x1e651a){_0x77ba2d[_0x1692('0x68')]=_0x1e651a['get']({'plain':!![]});interaction_log[_0x1692('0x20')](_0x1692('0x7d'),_0x3e2362[_0x1692('0x60')]['id'],_0x3e2362['user']['name'],_0x3e2362['user'][_0x1692('0x67')],_0x77ba2d[_0x1692('0x68')]['id'],_0x3e2362['body']?JSON[_0x1692('0x24')](_0x3e2362['body']):_0x1692('0x69'));return respondWithRpcPromise(_0x1692('0x7e'),_0x1692('0x7f'),_0x77ba2d);}return null;})[_0x1692('0x34')](function(_0x482bc7){var _0x13d099=_0x1692('0x6b')+_0x482bc7['message'][_0x1692('0x80')];return db['sequelize'][_0x1692('0x3f')](_0x13d099,{'type':db['Sequelize'][_0x1692('0x6e')][_0x1692('0x81')],'raw':!![]})['then'](function(_0x5d3b1d){return _0x5d3b1d;});})[_0x1692('0x34')](function(_0x1cb462){if(_0x1cb462){_0x77ba2d[_0x1692('0x27')][_0x1692('0x6f')]=_0x1cb462[0x0];if(!_0x3e2362[_0x1692('0x57')][_0x1692('0x5f')])return;return db[_0x1692('0x82')][_0x1692('0x55')]({'where':{'id':_0x3e2362[_0x1692('0x57')][_0x1692('0x5f')],'role':_0x1692('0x61')},'attributes':['id',_0x1692('0x38'),_0x1692('0x70'),_0x1692('0x71'),_0x1692('0x72')],'raw':!![]});}return null;})['then'](function(_0x549c45){if(!_0x549c45)return null;_0x77ba2d[_0x1692('0x27')][_0x1692('0x61')]=_0x549c45;return _0x77ba2d;})[_0x1692('0x34')](function(_0x20d961){if(_0x20d961){_0x20d961['message'][_0x1692('0x74')]=util[_0x1692('0x83')](_0x1692('0x75'),_0x3e2362[_0x1692('0x60')][_0x1692('0x38')]);_0x20d961['message']['channel']=_0x77ba2d['channel'];_0x20d961[_0x1692('0x27')][_0x1692('0x76')]=_0x77ba2d[_0x1692('0x77')];_0x20d961[_0x1692('0x27')]['event']='reject';respondWithRpcPromise('EventManager',_0x1692('0x79'),{'event':_0x1692('0x84'),'message':_['merge'](_0x77ba2d[_0x1692('0x27')],JSON['parse'](_0x77ba2d[_0x1692('0x68')][_0x1692('0x7c')]))},client9002);return _0x77ba2d;}return null;})[_0x1692('0x34')](respondWithResult(_0x56858d,null))[_0x1692('0x52')](handleError(_0x56858d,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index c728a62..ab7d3ca 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 _0x2cef=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage'];(function(_0x4966a4,_0x39662c){var _0x3c6bf6=function(_0x53c4f2){while(--_0x53c4f2){_0x4966a4['push'](_0x4966a4['shift']());}};_0x3c6bf6(++_0x39662c);}(_0x2cef,0x97));var _0xf2ce=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x2cef[_0x1facfa];return _0x9ec701;};'use strict';var EventEmitter=require(_0xf2ce('0x0'));var ChatMessage=require(_0xf2ce('0x1'))['db'][_0xf2ce('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xf2ce('0x3')](0x0);var events={'afterCreate':_0xf2ce('0x4'),'afterUpdate':_0xf2ce('0x5'),'afterDestroy':_0xf2ce('0x6')};function emitEvent(_0x5334cf){return function(_0x4f1b4a,_0x4ef215,_0x3329c1){ChatMessageEvents[_0xf2ce('0x7')](_0x5334cf+':'+_0x4f1b4a['id'],_0x4f1b4a);ChatMessageEvents[_0xf2ce('0x7')](_0x5334cf,_0x4f1b4a);_0x3329c1(null);};}for(var e in events){if(events[_0xf2ce('0x8')](e)){var event=events[e];ChatMessage[_0xf2ce('0x9')](e,emitEvent(event));}}module[_0xf2ce('0xa')]=ChatMessageEvents; \ No newline at end of file +var _0x041d=['events','../../mysqldb','ChatMessage','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x041d,0x10e));var _0xd041=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x041d[_0x525c7b];return _0x27b33e;};'use strict';var EventEmitter=require(_0xd041('0x0'));var ChatMessage=require(_0xd041('0x1'))['db'][_0xd041('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xd041('0x3')](0x0);var events={'afterCreate':_0xd041('0x4'),'afterUpdate':'update','afterDestroy':_0xd041('0x5')};function emitEvent(_0x1879c6){return function(_0x8883b9,_0x53e04f,_0x4aa86b){ChatMessageEvents[_0xd041('0x6')](_0x1879c6+':'+_0x8883b9['id'],_0x8883b9);ChatMessageEvents[_0xd041('0x6')](_0x1879c6,_0x8883b9);_0x4aa86b(null);};}for(var e in events){if(events[_0xd041('0x7')](e)){var event=events[e];ChatMessage[_0xd041('0x8')](e,emitEvent(event));}}module[_0xd041('0x9')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 5a3e620..e5321a0 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 _0x1f36=['UserId','ChatInteraction','ChatInteractionId','update','catch','error','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./chatMessage.attributes','exports','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','out','secret'];(function(_0xbe200f,_0x4b50eb){var _0x192597=function(_0x106cfd){while(--_0x106cfd){_0xbe200f['push'](_0xbe200f['shift']());}};_0x192597(++_0x4b50eb);}(_0x1f36,0x1ed));var _0x61f3=function(_0x5989e9,_0xef6905){_0x5989e9=_0x5989e9-0x0;var _0xac49f2=_0x1f36[_0x5989e9];return _0xac49f2;};'use strict';var _=require(_0x61f3('0x0'));var util=require(_0x61f3('0x1'));var logger=require(_0x61f3('0x2'))(_0x61f3('0x3'));var moment=require('moment');var BPromise=require(_0x61f3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x61f3('0x5'));var rimraf=require(_0x61f3('0x6'));var config=require(_0x61f3('0x7'));var attributes=require(_0x61f3('0x8'));module[_0x61f3('0x9')]=function(_0x12c372,_0x72af3d){return _0x12c372['define'](_0x61f3('0xa'),attributes,{'tableName':_0x61f3('0xb'),'paranoid':![],'indexes':[{'name':_0x61f3('0xc'),'fields':[_0x61f3('0xd')],'type':_0x61f3('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3e184d,_0x3e7987,_0x51f786){var _0x1dba23=_0x12c372[_0x61f3('0xf')];var _0x14b24e=_0x3e184d[_0x61f3('0x10')]({'plain':!![]});if(_0x14b24e[_0x61f3('0x11')]['toLowerCase']()==='in'||_0x14b24e[_0x61f3('0x11')]['toLowerCase']()===_0x61f3('0x12')&&!_0x14b24e[_0x61f3('0x13')]&&!_['isNil'](_0x14b24e[_0x61f3('0x14')])){_0x1dba23[_0x61f3('0x15')]['findOne']({'where':{'id':_0x14b24e[_0x61f3('0x16')]}})['then'](function(_0x42c8b4){if(_0x42c8b4){_0x42c8b4[_0x61f3('0x17')]({'lastMsgAt':_0x14b24e['createdAt'],'lastMsgDirection':_0x14b24e[_0x61f3('0x11')]['toLowerCase']()});}})[_0x61f3('0x18')](function(_0x222d54){console[_0x61f3('0x19')](_0x222d54);});}_0x51f786();}},'charset':'utf8mb4','collate':_0x61f3('0x1a')});}; \ No newline at end of file +var _0xfa1e=['ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','define','ChatMessage','chat_messages','fti_chat_messages','models','get','direction','toLowerCase','out','secret','isNil'];(function(_0x4a9028,_0xfd691){var _0x5da302=function(_0x185c50){while(--_0x185c50){_0x4a9028['push'](_0x4a9028['shift']());}};_0x5da302(++_0xfd691);}(_0xfa1e,0xb1));var _0xefa1=function(_0x3f5dca,_0x59472b){_0x3f5dca=_0x3f5dca-0x0;var _0x5b833a=_0xfa1e[_0x3f5dca];return _0x5b833a;};'use strict';var _=require(_0xefa1('0x0'));var util=require('util');var logger=require(_0xefa1('0x1'))(_0xefa1('0x2'));var moment=require(_0xefa1('0x3'));var BPromise=require(_0xefa1('0x4'));var rp=require(_0xefa1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xefa1('0x6'));var config=require(_0xefa1('0x7'));var attributes=require('./chatMessage.attributes');module['exports']=function(_0x1b7a93,_0x13e091){return _0x1b7a93[_0xefa1('0x8')](_0xefa1('0x9'),attributes,{'tableName':_0xefa1('0xa'),'paranoid':![],'indexes':[{'name':_0xefa1('0xb'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5b2059,_0x3b9774,_0x52b9fa){var _0x3cf990=_0x1b7a93[_0xefa1('0xc')];var _0x4aa5a4=_0x5b2059[_0xefa1('0xd')]({'plain':!![]});if(_0x4aa5a4[_0xefa1('0xe')][_0xefa1('0xf')]()==='in'||_0x4aa5a4[_0xefa1('0xe')][_0xefa1('0xf')]()===_0xefa1('0x10')&&!_0x4aa5a4[_0xefa1('0x11')]&&!_[_0xefa1('0x12')](_0x4aa5a4['UserId'])){_0x3cf990[_0xefa1('0x13')][_0xefa1('0x14')]({'where':{'id':_0x4aa5a4[_0xefa1('0x15')]}})[_0xefa1('0x16')](function(_0x1fd773){if(_0x1fd773){_0x1fd773[_0xefa1('0x17')]({'lastMsgAt':_0x4aa5a4[_0xefa1('0x18')],'lastMsgDirection':_0x4aa5a4[_0xefa1('0xe')][_0xefa1('0xf')]()});}})[_0xefa1('0x19')](function(_0xc3adfd){console['error'](_0xc3adfd);});}_0x52b9fa();}},'charset':_0xefa1('0x1a'),'collate':_0xefa1('0x1b')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index e0452ab..5edec92 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 _0xae4e=['client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatMessage','create','body','options','raw','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x138293,_0x197e7f){var _0x34c4a2=function(_0x20192b){while(--_0x20192b){_0x138293['push'](_0x138293['shift']());}};_0x34c4a2(++_0x197e7f);}(_0xae4e,0x116));var _0xeae4=function(_0x13c223,_0x433b38){_0x13c223=_0x13c223-0x0;var _0x3e8d83=_0xae4e[_0x13c223];return _0x3e8d83;};'use strict';var _=require(_0xeae4('0x0'));var util=require(_0xeae4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xeae4('0x2'));var fs=require('fs');var Redis=require(_0xeae4('0x3'));var db=require(_0xeae4('0x4'))['db'];var utils=require(_0xeae4('0x5'));var logger=require(_0xeae4('0x6'))(_0xeae4('0x7'));var config=require(_0xeae4('0x8'));var jayson=require(_0xeae4('0x9'));var client=jayson[_0xeae4('0xa')][_0xeae4('0xb')]({'port':0x232a});config[_0xeae4('0xc')]=_[_0xeae4('0xd')](config['redis'],{'host':_0xeae4('0xe'),'port':0x18eb});var socket=require(_0xeae4('0xf'))(new Redis(config[_0xeae4('0xc')]));require(_0xeae4('0x10'))[_0xeae4('0x11')](socket);function respondWithRpcPromise(_0x412af8,_0xea104a,_0x8cbd2d){return new BPromise(function(_0x95276f,_0x44e6c8){return client[_0xeae4('0x12')](_0x412af8,_0x8cbd2d)[_0xeae4('0x13')](function(_0x3f7de4){logger[_0xeae4('0x14')](_0xeae4('0x15'),_0xea104a,_0xeae4('0x16'));logger[_0xeae4('0x17')](_0xeae4('0x18'),_0xea104a,_0xeae4('0x16'),JSON[_0xeae4('0x19')](_0x3f7de4));if(_0x3f7de4[_0xeae4('0x1a')]){if(_0x3f7de4[_0xeae4('0x1a')][_0xeae4('0x1b')]===0x1f4){logger['error'](_0xeae4('0x15'),_0xea104a,_0x3f7de4[_0xeae4('0x1a')][_0xeae4('0x1c')]);return _0x44e6c8(_0x3f7de4['error'][_0xeae4('0x1c')]);}logger[_0xeae4('0x1a')](_0xeae4('0x15'),_0xea104a,_0x3f7de4['error'][_0xeae4('0x1c')]);return _0x95276f(_0x3f7de4['error'][_0xeae4('0x1c')]);}else{logger[_0xeae4('0x14')]('ChatMessage,\x20%s,\x20%s',_0xea104a,_0xeae4('0x16'));_0x95276f(_0x3f7de4[_0xeae4('0x1d')]['message']);}})[_0xeae4('0x1e')](function(_0x414b4a){logger['error'](_0xeae4('0x15'),_0xea104a,_0x414b4a);_0x44e6c8(_0x414b4a);});});}exports[_0xeae4('0x1f')]=function(_0x5efb17){var _0x3bc873=this;return new Promise(function(_0x11f20c,_0x3d98d1){return db['ChatMessage'][_0xeae4('0x20')](_0x5efb17[_0xeae4('0x21')],{'raw':_0x5efb17[_0xeae4('0x22')]?_0x5efb17['options'][_0xeae4('0x23')]===undefined?!![]:![]:!![]})[_0xeae4('0x13')](function(_0x8103be){logger['info'](_0xeae4('0x1f'),_0x5efb17);logger[_0xeae4('0x17')](_0xeae4('0x1f'),_0x5efb17,JSON[_0xeae4('0x19')](_0x8103be));_0x11f20c(_0x8103be);})['catch'](function(_0x341738){logger[_0xeae4('0x1a')](_0xeae4('0x1f'),_0x341738['message'],_0x5efb17);_0x3d98d1(_0x3bc873[_0xeae4('0x1a')](0x1f4,_0x341738['message']));});});}; \ No newline at end of file +var _0xf62d=['register','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','redis','localhost','socket.io-emitter','./chatMessage.socket'];(function(_0x1c3f44,_0x3b9db4){var _0x1bc285=function(_0x4f1781){while(--_0x4f1781){_0x1c3f44['push'](_0x1c3f44['shift']());}};_0x1bc285(++_0x3b9db4);}(_0xf62d,0x1c0));var _0xdf62=function(_0x3cf636,_0x47f6f4){_0x3cf636=_0x3cf636-0x0;var _0x102851=_0xf62d[_0x3cf636];return _0x102851;};'use strict';var _=require(_0xdf62('0x0'));var util=require(_0xdf62('0x1'));var moment=require('moment');var BPromise=require(_0xdf62('0x2'));var rs=require(_0xdf62('0x3'));var fs=require('fs');var Redis=require(_0xdf62('0x4'));var db=require(_0xdf62('0x5'))['db'];var utils=require(_0xdf62('0x6'));var logger=require(_0xdf62('0x7'))(_0xdf62('0x8'));var config=require(_0xdf62('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xdf62('0xa')]=_['defaults'](config[_0xdf62('0xa')],{'host':_0xdf62('0xb'),'port':0x18eb});var socket=require(_0xdf62('0xc'))(new Redis(config[_0xdf62('0xa')]));require(_0xdf62('0xd'))[_0xdf62('0xe')](socket);function respondWithRpcPromise(_0x2a3460,_0x1316f3,_0xfb08d7){return new BPromise(function(_0x58cd3d,_0x29c360){return client['request'](_0x2a3460,_0xfb08d7)[_0xdf62('0xf')](function(_0x496b40){logger[_0xdf62('0x10')](_0xdf62('0x11'),_0x1316f3,_0xdf62('0x12'));logger[_0xdf62('0x13')](_0xdf62('0x14'),_0x1316f3,_0xdf62('0x12'),JSON['stringify'](_0x496b40));if(_0x496b40[_0xdf62('0x15')]){if(_0x496b40[_0xdf62('0x15')][_0xdf62('0x16')]===0x1f4){logger[_0xdf62('0x15')]('ChatMessage,\x20%s,\x20%s',_0x1316f3,_0x496b40['error'][_0xdf62('0x17')]);return _0x29c360(_0x496b40['error'][_0xdf62('0x17')]);}logger[_0xdf62('0x15')](_0xdf62('0x11'),_0x1316f3,_0x496b40[_0xdf62('0x15')]['message']);return _0x58cd3d(_0x496b40['error'][_0xdf62('0x17')]);}else{logger[_0xdf62('0x10')]('ChatMessage,\x20%s,\x20%s',_0x1316f3,'request\x20sent');_0x58cd3d(_0x496b40[_0xdf62('0x18')][_0xdf62('0x17')]);}})[_0xdf62('0x19')](function(_0x39b9b0){logger[_0xdf62('0x15')](_0xdf62('0x11'),_0x1316f3,_0x39b9b0);_0x29c360(_0x39b9b0);});});}exports[_0xdf62('0x1a')]=function(_0x47a69b){var _0x93bcb9=this;return new Promise(function(_0x537d43,_0x281519){return db[_0xdf62('0x1b')][_0xdf62('0x1c')](_0x47a69b[_0xdf62('0x1d')],{'raw':_0x47a69b[_0xdf62('0x1e')]?_0x47a69b['options'][_0xdf62('0x1f')]===undefined?!![]:![]:!![]})[_0xdf62('0xf')](function(_0x361057){logger[_0xdf62('0x10')](_0xdf62('0x1a'),_0x47a69b);logger[_0xdf62('0x13')]('CreateChatMessage',_0x47a69b,JSON[_0xdf62('0x20')](_0x361057));_0x537d43(_0x361057);})[_0xdf62('0x19')](function(_0x3da7f4){logger['error']('CreateChatMessage',_0x3da7f4[_0xdf62('0x17')],_0x47a69b);_0x281519(_0x93bcb9[_0xdf62('0x15')](0x1f4,_0x3da7f4[_0xdf62('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 2ce798c..0e90b99 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 _0x29d4=['removeListener','register','length','./chatMessage.events','remove','update'];(function(_0x522a3b,_0x22b40a){var _0x761494=function(_0x4c599a){while(--_0x4c599a){_0x522a3b['push'](_0x522a3b['shift']());}};_0x761494(++_0x22b40a);}(_0x29d4,0x1a1));var _0x429d=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0x29d4[_0x54d4fe];return _0x1ab5bb;};'use strict';var ChatMessageEvents=require(_0x429d('0x0'));var events=['save',_0x429d('0x1'),_0x429d('0x2')];function createListener(_0x16ce75,_0x472fc9){return function(_0x45df1c){_0x472fc9['emit'](_0x16ce75,_0x45df1c);};}function removeListener(_0xc3989d,_0x3f43f5){return function(){ChatMessageEvents[_0x429d('0x3')](_0xc3989d,_0x3f43f5);};}exports[_0x429d('0x4')]=function(_0x1c55aa){for(var _0xa71445=0x0,_0x56aa2f=events[_0x429d('0x5')];_0xa71445<_0x56aa2f;_0xa71445++){var _0x4befb9=events[_0xa71445];var _0x9fc337=createListener('chatMessage:'+_0x4befb9,_0x1c55aa);ChatMessageEvents['on'](_0x4befb9,_0x9fc337);}}; \ No newline at end of file +var _0x3e9d=['chatMessage:','./chatMessage.events','save','update','removeListener','register','length'];(function(_0x59ef68,_0x33eb5d){var _0x338883=function(_0x54f450){while(--_0x54f450){_0x59ef68['push'](_0x59ef68['shift']());}};_0x338883(++_0x33eb5d);}(_0x3e9d,0x1ba));var _0xd3e9=function(_0x595300,_0x528932){_0x595300=_0x595300-0x0;var _0x3a027b=_0x3e9d[_0x595300];return _0x3a027b;};'use strict';var ChatMessageEvents=require(_0xd3e9('0x0'));var events=[_0xd3e9('0x1'),'remove',_0xd3e9('0x2')];function createListener(_0x4bc1c3,_0x328e91){return function(_0x2ebba5){_0x328e91['emit'](_0x4bc1c3,_0x2ebba5);};}function removeListener(_0x4887ba,_0xa499a3){return function(){ChatMessageEvents[_0xd3e9('0x3')](_0x4887ba,_0xa499a3);};}exports[_0xd3e9('0x4')]=function(_0x3dea0a){for(var _0x568eea=0x0,_0x4dc1de=events[_0xd3e9('0x5')];_0x568eea<_0x4dc1de;_0x568eea++){var _0x140f2d=events[_0x568eea];var _0x45364e=createListener(_0xd3e9('0x6')+_0x140f2d,_0x3dea0a);ChatMessageEvents['on'](_0x140f2d,_0x45364e);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index b192b48..5372053 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 _0xaeee=['/:id/accept','accept','delete','/:id','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','post','tracked','chat','chatmessage:create','create','put','update'];(function(_0x51dd8b,_0x326222){var _0x11cc3d=function(_0x2f1138){while(--_0x2f1138){_0x51dd8b['push'](_0x51dd8b['shift']());}};_0x11cc3d(++_0x326222);}(_0xaeee,0x124));var _0xeaee=function(_0x330bdf,_0x4f10f3){_0x330bdf=_0x330bdf-0x0;var _0x3db14d=_0xaeee[_0x330bdf];return _0x3db14d;};'use strict';var multer=require(_0xeaee('0x0'));var util=require('util');var path=require(_0xeaee('0x1'));var timeout=require(_0xeaee('0x2'));var express=require(_0xeaee('0x3'));var router=express['Router']();var fs_extra=require(_0xeaee('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xeaee('0x5'));var config=require(_0xeaee('0x6'));var controller=require('./chatMessage.controller');router[_0xeaee('0x7')]('/',auth[_0xeaee('0x8')](),controller[_0xeaee('0x9')]);router['get'](_0xeaee('0xa'),auth[_0xeaee('0x8')](),controller[_0xeaee('0xb')]);router[_0xeaee('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xeaee('0xc')]);router[_0xeaee('0xd')]('/',auth[_0xeaee('0x8')](),interaction[_0xeaee('0xe')](_0xeaee('0xf'),_0xeaee('0x10')),controller[_0xeaee('0x11')]);router[_0xeaee('0x12')]('/:id',controller[_0xeaee('0x13')]);router['put'](_0xeaee('0x14'),auth[_0xeaee('0x8')](),controller[_0xeaee('0x15')]);router[_0xeaee('0x12')]('/:id/reject',auth[_0xeaee('0x8')](),controller['reject']);router[_0xeaee('0x16')](_0xeaee('0x17'),auth[_0xeaee('0x8')](),controller[_0xeaee('0x18')]);module[_0xeaee('0x19')]=router; \ No newline at end of file +var _0xba8b=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','/:id','post','chat','chatmessage:create','create','update','put','/:id/accept','delete','destroy','exports','multer','util','path'];(function(_0x2872b2,_0x1dddd0){var _0x2d537d=function(_0xe22932){while(--_0xe22932){_0x2872b2['push'](_0x2872b2['shift']());}};_0x2d537d(++_0x1dddd0);}(_0xba8b,0xac));var _0xbba8=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0xba8b[_0x5f309e];return _0x487b5e;};'use strict';var multer=require(_0xbba8('0x0'));var util=require(_0xbba8('0x1'));var path=require(_0xbba8('0x2'));var timeout=require(_0xbba8('0x3'));var express=require(_0xbba8('0x4'));var router=express['Router']();var fs_extra=require(_0xbba8('0x5'));var auth=require(_0xbba8('0x6'));var interaction=require(_0xbba8('0x7'));var config=require(_0xbba8('0x8'));var controller=require(_0xbba8('0x9'));router[_0xbba8('0xa')]('/',auth[_0xbba8('0xb')](),controller[_0xbba8('0xc')]);router[_0xbba8('0xa')](_0xbba8('0xd'),auth[_0xbba8('0xb')](),controller['describe']);router[_0xbba8('0xa')](_0xbba8('0xe'),auth[_0xbba8('0xb')](),controller['show']);router[_0xbba8('0xf')]('/',auth[_0xbba8('0xb')](),interaction['tracked'](_0xbba8('0x10'),_0xbba8('0x11')),controller[_0xbba8('0x12')]);router['put'](_0xbba8('0xe'),controller[_0xbba8('0x13')]);router[_0xbba8('0x14')](_0xbba8('0x15'),auth[_0xbba8('0xb')](),controller['accept']);router[_0xbba8('0x14')]('/:id/reject',auth['isAuthenticated'](),controller['reject']);router[_0xbba8('0x16')](_0xbba8('0xe'),auth[_0xbba8('0xb')](),controller[_0xbba8('0x17')]);module[_0xbba8('0x18')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index c2cd8c0..4ae1fc2 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 _0x5f66=['medium','TEXT','exports'];(function(_0x51b9cd,_0x2f3f83){var _0x4ebcf7=function(_0x588728){while(--_0x588728){_0x51b9cd['push'](_0x51b9cd['shift']());}};_0x4ebcf7(++_0x2f3f83);}(_0x5f66,0x1a0));var _0x65f6=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x5f66[_0xefd519];return _0x4bb882;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'body':{'type':Sequelize['TEXT'](_0x65f6('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x65f6('0x2')](_0x65f6('0x1')),'allowNull':![]}}; \ No newline at end of file +var _0x0b0e=['medium','sequelize','TEXT'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x0b0e,0x187));var _0xe0b0=function(_0x5b4c44,_0x2e495e){_0x5b4c44=_0x5b4c44-0x0;var _0x58485a=_0x0b0e[_0x5b4c44];return _0x58485a;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe0b0('0x1')](_0xe0b0('0x2')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index ebc95b5..a039755 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(_0x32612d,_0x17aa87){var _0x487e65=function(_0x5a9fad){while(--_0x5a9fad){_0x32612d['push'](_0x32612d['shift']());}};_0x487e65(++_0x17aa87);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file +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(_0x1e93f9,_0x1c8388){var _0x3c2f41=function(_0x2f371e){while(--_0x2f371e){_0x1e93f9['push'](_0x1e93f9['shift']());}};_0x3c2f41(++_0x1c8388);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index e859fb5..ad10d05 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.events.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x099f=['exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x2610ff,_0x54f0b7){var _0x1c88c3=function(_0x354890){while(--_0x354890){_0x2610ff['push'](_0x2610ff['shift']());}};_0x1c88c3(++_0x54f0b7);}(_0x099f,0x133));var _0xf099=function(_0x1dfb1e,_0x888459){_0x1dfb1e=_0x1dfb1e-0x0;var _0x1d45d0=_0x099f[_0x1dfb1e];return _0x1d45d0;};'use strict';var EventEmitter=require(_0xf099('0x0'));var ChatOfflineMessage=require(_0xf099('0x1'))['db'][_0xf099('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xf099('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf099('0x4'),'afterDestroy':_0xf099('0x5')};function emitEvent(_0x8c3488){return function(_0x24270f,_0x3f46c0,_0x35a43a){ChatOfflineMessageEvents[_0xf099('0x6')](_0x8c3488+':'+_0x24270f['id'],_0x24270f);ChatOfflineMessageEvents['emit'](_0x8c3488,_0x24270f);_0x35a43a(null);};}for(var e in events){if(events[_0xf099('0x7')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0xf099('0x8')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0xbeea=['remove','emit','hasOwnProperty','exports','events','update'];(function(_0x55d7c2,_0x4ce6fb){var _0x1755ef=function(_0xddc25c){while(--_0xddc25c){_0x55d7c2['push'](_0x55d7c2['shift']());}};_0x1755ef(++_0x4ce6fb);}(_0xbeea,0xfa));var _0xabee=function(_0x518502,_0x23df26){_0x518502=_0x518502-0x0;var _0x59791d=_0xbeea[_0x518502];return _0x59791d;};'use strict';var EventEmitter=require(_0xabee('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xabee('0x1'),'afterDestroy':_0xabee('0x2')};function emitEvent(_0x21c081){return function(_0x274882,_0x2ea93c,_0x222b23){ChatOfflineMessageEvents[_0xabee('0x3')](_0x21c081+':'+_0x274882['id'],_0x274882);ChatOfflineMessageEvents[_0xabee('0x3')](_0x21c081,_0x274882);_0x222b23(null);};}for(var e in events){if(events[_0xabee('0x4')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0xabee('0x5')]=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 8c731d3..69f10b8 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 _0xe667=['utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports','define','chat_offline_messages'];(function(_0x2c97be,_0x36e2ab){var _0x305a3f=function(_0x3f40b2){while(--_0x3f40b2){_0x2c97be['push'](_0x2c97be['shift']());}};_0x305a3f(++_0x36e2ab);}(_0xe667,0xb0));var _0x7e66=function(_0x3976c2,_0x60dd0f){_0x3976c2=_0x3976c2-0x0;var _0x1d3076=_0xe667[_0x3976c2];return _0x1d3076;};'use strict';var attributes=require(_0x7e66('0x0'));module[_0x7e66('0x1')]=function(_0x54ee81){return _0x54ee81[_0x7e66('0x2')]('ChatOfflineMessage',attributes,{'tableName':_0x7e66('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7e66('0x4'),'collate':_0x7e66('0x5')});}; \ No newline at end of file +var _0xfc44=['chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports'];(function(_0x501b1f,_0x3eec44){var _0x46303e=function(_0x50cb9f){while(--_0x50cb9f){_0x501b1f['push'](_0x501b1f['shift']());}};_0x46303e(++_0x3eec44);}(_0xfc44,0xdf));var _0x4fc4=function(_0x33fe92,_0x2f9e93){_0x33fe92=_0x33fe92-0x0;var _0x56e956=_0xfc44[_0x33fe92];return _0x56e956;};'use strict';var attributes=require(_0x4fc4('0x0'));module[_0x4fc4('0x1')]=function(_0x4f7e68){return _0x4f7e68['define']('ChatOfflineMessage',attributes,{'tableName':_0x4fc4('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4fc4('0x3'),'collate':_0x4fc4('0x4')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 7896332..bdb858c 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 _0x0b1a=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0b1a,0x10c));var _0xa0b1=function(_0x5914a0,_0x4c5621){_0x5914a0=_0x5914a0-0x0;var _0x487478=_0x0b1a[_0x5914a0];return _0x487478;};'use strict';var _=require(_0xa0b1('0x0'));var util=require(_0xa0b1('0x1'));var moment=require(_0xa0b1('0x2'));var BPromise=require(_0xa0b1('0x3'));var rs=require(_0xa0b1('0x4'));var fs=require('fs');var Redis=require(_0xa0b1('0x5'));var db=require(_0xa0b1('0x6'))['db'];var utils=require(_0xa0b1('0x7'));var logger=require(_0xa0b1('0x8'))(_0xa0b1('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa0b1('0xa')][_0xa0b1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e6d17,_0x692771,_0x96fa55){return new BPromise(function(_0x5d94ca,_0x56a728){return client[_0xa0b1('0xc')](_0x2e6d17,_0x96fa55)[_0xa0b1('0xd')](function(_0x50c1c0){logger[_0xa0b1('0xe')](_0xa0b1('0xf'),_0x692771,_0xa0b1('0x10'));logger[_0xa0b1('0x11')](_0xa0b1('0x12'),_0x692771,'request\x20sent',JSON['stringify'](_0x50c1c0));if(_0x50c1c0[_0xa0b1('0x13')]){if(_0x50c1c0[_0xa0b1('0x13')][_0xa0b1('0x14')]===0x1f4){logger[_0xa0b1('0x13')](_0xa0b1('0xf'),_0x692771,_0x50c1c0[_0xa0b1('0x13')][_0xa0b1('0x15')]);return _0x56a728(_0x50c1c0['error'][_0xa0b1('0x15')]);}logger[_0xa0b1('0x13')]('ChatOfflineMessage,\x20%s,\x20%s',_0x692771,_0x50c1c0[_0xa0b1('0x13')]['message']);return _0x5d94ca(_0x50c1c0[_0xa0b1('0x13')][_0xa0b1('0x15')]);}else{logger['info'](_0xa0b1('0xf'),_0x692771,'request\x20sent');_0x5d94ca(_0x50c1c0[_0xa0b1('0x16')][_0xa0b1('0x15')]);}})[_0xa0b1('0x17')](function(_0x3b1918){logger[_0xa0b1('0x13')](_0xa0b1('0xf'),_0x692771,_0x3b1918);_0x56a728(_0x3b1918);});});} \ No newline at end of file +var _0x1580=['../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','ChatOfflineMessage,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x18f152,_0x41585a){var _0xa10b34=function(_0x1e9798){while(--_0x1e9798){_0x18f152['push'](_0x18f152['shift']());}};_0xa10b34(++_0x41585a);}(_0x1580,0x15a));var _0x0158=function(_0xa77c4f,_0x474fad){_0xa77c4f=_0xa77c4f-0x0;var _0x1a37ee=_0x1580[_0xa77c4f];return _0x1a37ee;};'use strict';var _=require(_0x0158('0x0'));var util=require(_0x0158('0x1'));var moment=require(_0x0158('0x2'));var BPromise=require(_0x0158('0x3'));var rs=require(_0x0158('0x4'));var fs=require('fs');var Redis=require(_0x0158('0x5'));var db=require(_0x0158('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0158('0x7'))('rpc');var config=require(_0x0158('0x8'));var jayson=require(_0x0158('0x9'));var client=jayson['client'][_0x0158('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b9af3,_0xecf81c,_0x2d7a30){return new BPromise(function(_0x3e885c,_0x4d5047){return client[_0x0158('0xb')](_0x2b9af3,_0x2d7a30)[_0x0158('0xc')](function(_0x4b5450){logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0xecf81c,_0x0158('0xd'));logger['debug'](_0x0158('0xe'),_0xecf81c,_0x0158('0xd'),JSON[_0x0158('0xf')](_0x4b5450));if(_0x4b5450[_0x0158('0x10')]){if(_0x4b5450[_0x0158('0x10')]['code']===0x1f4){logger[_0x0158('0x10')](_0x0158('0x11'),_0xecf81c,_0x4b5450['error'][_0x0158('0x12')]);return _0x4d5047(_0x4b5450[_0x0158('0x10')][_0x0158('0x12')]);}logger[_0x0158('0x10')](_0x0158('0x11'),_0xecf81c,_0x4b5450[_0x0158('0x10')][_0x0158('0x12')]);return _0x3e885c(_0x4b5450[_0x0158('0x10')][_0x0158('0x12')]);}else{logger[_0x0158('0x13')](_0x0158('0x11'),_0xecf81c,_0x0158('0xd'));_0x3e885c(_0x4b5450[_0x0158('0x14')][_0x0158('0x12')]);}})[_0x0158('0x15')](function(_0x52d6af){logger['error'](_0x0158('0x11'),_0xecf81c,_0x52d6af);_0x4d5047(_0x52d6af);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 1183c25..0f57e53 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 _0xbee3=['fs-extra','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','/describe','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x440fde,_0x445ce0){var _0x11052c=function(_0x49f547){while(--_0x49f547){_0x440fde['push'](_0x440fde['shift']());}};_0x11052c(++_0x445ce0);}(_0xbee3,0x135));var _0x3bee=function(_0x541cc4,_0x4e0979){_0x541cc4=_0x541cc4-0x0;var _0x94514c=_0xbee3[_0x541cc4];return _0x94514c;};'use strict';var multer=require(_0x3bee('0x0'));var util=require(_0x3bee('0x1'));var path=require(_0x3bee('0x2'));var timeout=require(_0x3bee('0x3'));var express=require(_0x3bee('0x4'));var router=express[_0x3bee('0x5')]();var fs_extra=require(_0x3bee('0x6'));var auth=require(_0x3bee('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x3bee('0x8'));var controller=require(_0x3bee('0x9'));router[_0x3bee('0xa')]('/',auth[_0x3bee('0xb')](),controller['index']);router['get'](_0x3bee('0xc'),auth[_0x3bee('0xb')](),controller['describe']);router[_0x3bee('0xa')](_0x3bee('0xd'),auth[_0x3bee('0xb')](),controller[_0x3bee('0xe')]);router[_0x3bee('0xf')]('/',auth[_0x3bee('0xb')](),controller[_0x3bee('0x10')]);router[_0x3bee('0x11')](_0x3bee('0xd'),auth[_0x3bee('0xb')](),controller[_0x3bee('0x12')]);router[_0x3bee('0x13')](_0x3bee('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x3bee('0x14')]=router; \ No newline at end of file +var _0x8934=['update','delete','exports','multer','util','path','express','../../config/environment','get','isAuthenticated','index','describe','show','post','create','put','/:id'];(function(_0x46ec32,_0x1e842f){var _0x338f60=function(_0x10e02c){while(--_0x10e02c){_0x46ec32['push'](_0x46ec32['shift']());}};_0x338f60(++_0x1e842f);}(_0x8934,0x135));var _0x4893=function(_0x512859,_0x42808d){_0x512859=_0x512859-0x0;var _0x596a03=_0x8934[_0x512859];return _0x596a03;};'use strict';var multer=require(_0x4893('0x0'));var util=require(_0x4893('0x1'));var path=require(_0x4893('0x2'));var timeout=require('connect-timeout');var express=require(_0x4893('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4893('0x4'));var controller=require('./chatOfflineMessage.controller');router[_0x4893('0x5')]('/',auth[_0x4893('0x6')](),controller[_0x4893('0x7')]);router[_0x4893('0x5')]('/describe',auth[_0x4893('0x6')](),controller[_0x4893('0x8')]);router[_0x4893('0x5')]('/:id',auth[_0x4893('0x6')](),controller[_0x4893('0x9')]);router[_0x4893('0xa')]('/',auth[_0x4893('0x6')](),controller[_0x4893('0xb')]);router[_0x4893('0xc')](_0x4893('0xd'),auth[_0x4893('0x6')](),controller[_0x4893('0xe')]);router[_0x4893('0xf')](_0x4893('0xd'),auth[_0x4893('0x6')](),controller['destroy']);module[_0x4893('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index d91dc1a..3db130a 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 _0x5bf3=['mouseOver','timeout','STRING','INTEGER','sequelize','exports'];(function(_0x554092,_0x211b5f){var _0x33d000=function(_0x43b7a6){while(--_0x43b7a6){_0x554092['push'](_0x554092['shift']());}};_0x33d000(++_0x211b5f);}(_0x5bf3,0xd0));var _0x35bf=function(_0x18df06,_0x26d5cb){_0x18df06=_0x18df06-0x0;var _0x15553a=_0x5bf3[_0x18df06];return _0x15553a;};'use strict';var Sequelize=require(_0x35bf('0x0'));module[_0x35bf('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x35bf('0x2'),_0x35bf('0x3')),'defaultValue':_0x35bf('0x2')},'selector':{'type':Sequelize[_0x35bf('0x4')]},'timeout':{'type':Sequelize[_0x35bf('0x5')]}}; \ No newline at end of file +var _0x6539=['INTEGER','sequelize','exports','mouseOver','STRING'];(function(_0x1a0637,_0x59771a){var _0x11f9e1=function(_0x57698e){while(--_0x57698e){_0x1a0637['push'](_0x1a0637['shift']());}};_0x11f9e1(++_0x59771a);}(_0x6539,0x1c3));var _0x9653=function(_0x534dbe,_0xdbed7f){_0x534dbe=_0x534dbe-0x0;var _0x2fe58a=_0x6539[_0x534dbe];return _0x2fe58a;};'use strict';var Sequelize=require(_0x9653('0x0'));module[_0x9653('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM']('mouseOver','timeout'),'defaultValue':_0x9653('0x2')},'selector':{'type':Sequelize[_0x9653('0x3')]},'timeout':{'type':Sequelize[_0x9653('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 7d1a0c5..c6d7ebd 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 _0x3ca4=['count','status','Content-Range','apply','reject','save','then','destroy','error','send','show','params','keys','query','filters','intersection','fields','attributes','length','model','includeAll','merge','ChatProactiveAction','find','create','body','catch','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit'];(function(_0x18a8c5,_0x547d26){var _0x2d8579=function(_0x480b7f){while(--_0x480b7f){_0x18a8c5['push'](_0x18a8c5['shift']());}};_0x2d8579(++_0x547d26);}(_0x3ca4,0x17d));var _0x43ca=function(_0x44ace3,_0x52cbcc){_0x44ace3=_0x44ace3-0x0;var _0x1334a2=_0x3ca4[_0x44ace3];return _0x1334a2;};'use strict';var emlformat=require(_0x43ca('0x0'));var rimraf=require(_0x43ca('0x1'));var zipdir=require(_0x43ca('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x43ca('0x3'));var BPromise=require(_0x43ca('0x4'));var Mustache=require(_0x43ca('0x5'));var util=require(_0x43ca('0x6'));var path=require(_0x43ca('0x7'));var sox=require(_0x43ca('0x8'));var csv=require(_0x43ca('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x43ca('0xa'));var _=require(_0x43ca('0xb'));var squel=require(_0x43ca('0xc'));var crypto=require(_0x43ca('0xd'));var jsforce=require(_0x43ca('0xe'));var deskjs=require(_0x43ca('0xf'));var toCsv=require(_0x43ca('0x9'));var querystring=require(_0x43ca('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x43ca('0x11'));var qs=require(_0x43ca('0x12'));var as=require(_0x43ca('0x13'));var hardwareService=require(_0x43ca('0x14'));var logger=require('../../config/logger')(_0x43ca('0x15'));var utils=require(_0x43ca('0x16'));var config=require(_0x43ca('0x17'));var licenseUtil=require(_0x43ca('0x18'));var db=require(_0x43ca('0x19'))['db'];function respondWithStatusCode(_0x246ead,_0x30184f){_0x30184f=_0x30184f||0xcc;return function(_0x2ede07){if(_0x2ede07){return _0x246ead[_0x43ca('0x1a')](_0x30184f);}return _0x246ead['status'](_0x30184f)[_0x43ca('0x1b')]();};}function respondWithResult(_0x13cf26,_0x4b710d){_0x4b710d=_0x4b710d||0xc8;return function(_0x309176){if(_0x309176){return _0x13cf26['status'](_0x4b710d)[_0x43ca('0x1c')](_0x309176);}};}function respondWithFilteredResult(_0x567579,_0xdccc62){return function(_0x1a8bf6){if(_0x1a8bf6){var _0x51a517=typeof _0xdccc62[_0x43ca('0x1d')]===_0x43ca('0x1e')&&typeof _0xdccc62[_0x43ca('0x1f')]==='undefined';var _0x4fb5e4=_0x1a8bf6['count'];var _0x5e50c9=_0x51a517?0x0:_0xdccc62[_0x43ca('0x1d')];var _0x268817=_0x51a517?_0x1a8bf6[_0x43ca('0x20')]:_0xdccc62['offset']+_0xdccc62[_0x43ca('0x1f')];var _0x806f68;if(_0x268817>=_0x4fb5e4){_0x268817=_0x4fb5e4;_0x806f68=0xc8;}else{_0x806f68=0xce;}_0x567579[_0x43ca('0x21')](_0x806f68);return _0x567579['set'](_0x43ca('0x22'),_0x5e50c9+'-'+_0x268817+'/'+_0x4fb5e4)['json'](_0x1a8bf6);}return null;};}function patchUpdates(_0x106d07){return function(_0x9bc5dc){try{jsonpatch[_0x43ca('0x23')](_0x9bc5dc,_0x106d07,!![]);}catch(_0x5ae497){return BPromise[_0x43ca('0x24')](_0x5ae497);}return _0x9bc5dc[_0x43ca('0x25')]();};}function saveUpdates(_0x2af64f,_0x2ad8fa){return function(_0x35d34c){if(_0x35d34c){return _0x35d34c['update'](_0x2af64f)[_0x43ca('0x26')](function(_0x34767e){return _0x34767e;});}return null;};}function removeEntity(_0x557b96,_0x379902){return function(_0x22d6ac){if(_0x22d6ac){return _0x22d6ac[_0x43ca('0x27')]()[_0x43ca('0x26')](function(){_0x557b96[_0x43ca('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2da1ec,_0xc07cde){return function(_0x29f2ee){if(!_0x29f2ee){_0x2da1ec[_0x43ca('0x1a')](0x194);}return _0x29f2ee;};}function handleError(_0x14287e,_0x1de54b){_0x1de54b=_0x1de54b||0x1f4;return function(_0x3b2078){logger[_0x43ca('0x28')](_0x3b2078['stack']);if(_0x3b2078['name']){delete _0x3b2078['name'];}_0x14287e[_0x43ca('0x21')](_0x1de54b)[_0x43ca('0x29')](_0x3b2078);};}exports[_0x43ca('0x2a')]=function(_0x9d09b9,_0x34dc4f){var _0x36884b={'raw':!![],'where':{'id':_0x9d09b9[_0x43ca('0x2b')]['id']}},_0xffad2d={};_0xffad2d['model']=_[_0x43ca('0x2c')](db['ChatProactiveAction']['rawAttributes']);_0xffad2d[_0x43ca('0x2d')]=_[_0x43ca('0x2c')](_0x9d09b9[_0x43ca('0x2d')]);_0xffad2d[_0x43ca('0x2e')]=_[_0x43ca('0x2f')](_0xffad2d['model'],_0xffad2d[_0x43ca('0x2d')]);_0x36884b['attributes']=_[_0x43ca('0x2f')](_0xffad2d['model'],qs[_0x43ca('0x30')](_0x9d09b9[_0x43ca('0x2d')]['fields']));_0x36884b[_0x43ca('0x31')]=_0x36884b[_0x43ca('0x31')][_0x43ca('0x32')]?_0x36884b[_0x43ca('0x31')]:_0xffad2d[_0x43ca('0x33')];if(_0x9d09b9[_0x43ca('0x2d')][_0x43ca('0x34')]){_0x36884b['include']=[{'all':!![]}];}_0x36884b=_[_0x43ca('0x35')]({},_0x36884b,_0x9d09b9['options']);return db[_0x43ca('0x36')][_0x43ca('0x37')](_0x36884b)['then'](handleEntityNotFound(_0x34dc4f,null))[_0x43ca('0x26')](respondWithResult(_0x34dc4f,null))['catch'](handleError(_0x34dc4f,null));};exports['create']=function(_0x10f75c,_0x2f69ba){return db[_0x43ca('0x36')][_0x43ca('0x38')](_0x10f75c[_0x43ca('0x39')],{})[_0x43ca('0x26')](respondWithResult(_0x2f69ba,0xc9))[_0x43ca('0x3a')](handleError(_0x2f69ba,null));};exports['update']=function(_0x43b29b,_0x67b8b0){if(_0x43b29b['body']['id']){delete _0x43b29b[_0x43ca('0x39')]['id'];}return db[_0x43ca('0x36')]['find']({'where':{'id':_0x43b29b[_0x43ca('0x2b')]['id']}})['then'](handleEntityNotFound(_0x67b8b0,null))['then'](saveUpdates(_0x43b29b[_0x43ca('0x39')],null))[_0x43ca('0x26')](respondWithResult(_0x67b8b0,null))[_0x43ca('0x3a')](handleError(_0x67b8b0,null));};exports[_0x43ca('0x27')]=function(_0xa466c9,_0x2205c4){return db[_0x43ca('0x36')][_0x43ca('0x37')]({'where':{'id':_0xa466c9[_0x43ca('0x2b')]['id']}})[_0x43ca('0x26')](handleEntityNotFound(_0x2205c4,null))[_0x43ca('0x26')](removeEntity(_0x2205c4,null))[_0x43ca('0x3a')](handleError(_0x2205c4,null));}; \ No newline at end of file +var _0x2263=['to-csv','ejs','fs-extra','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','show','model','keys','ChatProactiveAction','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','body','catch','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox'];(function(_0x1e43a9,_0x5051f5){var _0x3e51a7=function(_0x4634fb){while(--_0x4634fb){_0x1e43a9['push'](_0x1e43a9['shift']());}};_0x3e51a7(++_0x5051f5);}(_0x2263,0x6e));var _0x3226=function(_0x4ad0f7,_0x1920b0){_0x4ad0f7=_0x4ad0f7-0x0;var _0x30f5c8=_0x2263[_0x4ad0f7];return _0x30f5c8;};'use strict';var emlformat=require(_0x3226('0x0'));var rimraf=require(_0x3226('0x1'));var zipdir=require(_0x3226('0x2'));var jsonpatch=require(_0x3226('0x3'));var rp=require(_0x3226('0x4'));var moment=require(_0x3226('0x5'));var BPromise=require(_0x3226('0x6'));var Mustache=require(_0x3226('0x7'));var util=require('util');var path=require(_0x3226('0x8'));var sox=require(_0x3226('0x9'));var csv=require(_0x3226('0xa'));var ejs=require(_0x3226('0xb'));var fs=require('fs');var fs_extra=require(_0x3226('0xc'));var _=require('lodash');var squel=require(_0x3226('0xd'));var crypto=require(_0x3226('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3226('0xa'));var querystring=require(_0x3226('0xf'));var Papa=require('papaparse');var Redis=require(_0x3226('0x10'));var authService=require(_0x3226('0x11'));var qs=require(_0x3226('0x12'));var as=require(_0x3226('0x13'));var hardwareService=require(_0x3226('0x14'));var logger=require(_0x3226('0x15'))(_0x3226('0x16'));var utils=require('../../config/utils');var config=require(_0x3226('0x17'));var licenseUtil=require(_0x3226('0x18'));var db=require(_0x3226('0x19'))['db'];function respondWithStatusCode(_0x58aed4,_0x4e7fab){_0x4e7fab=_0x4e7fab||0xcc;return function(_0x485859){if(_0x485859){return _0x58aed4['sendStatus'](_0x4e7fab);}return _0x58aed4['status'](_0x4e7fab)['end']();};}function respondWithResult(_0x24ffc4,_0x425030){_0x425030=_0x425030||0xc8;return function(_0x114f4b){if(_0x114f4b){return _0x24ffc4[_0x3226('0x1a')](_0x425030)['json'](_0x114f4b);}};}function respondWithFilteredResult(_0x5b5c77,_0x2808e5){return function(_0xfc7cb5){if(_0xfc7cb5){var _0x86bb0f=typeof _0x2808e5['offset']===_0x3226('0x1b')&&typeof _0x2808e5[_0x3226('0x1c')]===_0x3226('0x1b');var _0x31d4f0=_0xfc7cb5[_0x3226('0x1d')];var _0x4113a1=_0x86bb0f?0x0:_0x2808e5['offset'];var _0x4b3521=_0x86bb0f?_0xfc7cb5[_0x3226('0x1d')]:_0x2808e5['offset']+_0x2808e5[_0x3226('0x1c')];var _0x1149e1;if(_0x4b3521>=_0x31d4f0){_0x4b3521=_0x31d4f0;_0x1149e1=0xc8;}else{_0x1149e1=0xce;}_0x5b5c77[_0x3226('0x1a')](_0x1149e1);return _0x5b5c77[_0x3226('0x1e')](_0x3226('0x1f'),_0x4113a1+'-'+_0x4b3521+'/'+_0x31d4f0)[_0x3226('0x20')](_0xfc7cb5);}return null;};}function patchUpdates(_0x4d4cd8){return function(_0x2b4d38){try{jsonpatch[_0x3226('0x21')](_0x2b4d38,_0x4d4cd8,!![]);}catch(_0x4dc9a8){return BPromise[_0x3226('0x22')](_0x4dc9a8);}return _0x2b4d38[_0x3226('0x23')]();};}function saveUpdates(_0x146362,_0x4eb7a9){return function(_0x29d92f){if(_0x29d92f){return _0x29d92f[_0x3226('0x24')](_0x146362)[_0x3226('0x25')](function(_0x3b7dad){return _0x3b7dad;});}return null;};}function removeEntity(_0x3191f8,_0x1109b7){return function(_0x29be67){if(_0x29be67){return _0x29be67[_0x3226('0x26')]()['then'](function(){_0x3191f8[_0x3226('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d6341,_0x5b8d32){return function(_0x26c845){if(!_0x26c845){_0x3d6341['sendStatus'](0x194);}return _0x26c845;};}function handleError(_0x1d7689,_0x4aff0c){_0x4aff0c=_0x4aff0c||0x1f4;return function(_0x10942a){logger[_0x3226('0x27')](_0x10942a['stack']);if(_0x10942a[_0x3226('0x28')]){delete _0x10942a[_0x3226('0x28')];}_0x1d7689[_0x3226('0x1a')](_0x4aff0c)[_0x3226('0x29')](_0x10942a);};}exports[_0x3226('0x2a')]=function(_0x38c83c,_0x12e26d){var _0x4b9174={'raw':!![],'where':{'id':_0x38c83c['params']['id']}},_0x34d2aa={};_0x34d2aa[_0x3226('0x2b')]=_[_0x3226('0x2c')](db[_0x3226('0x2d')]['rawAttributes']);_0x34d2aa[_0x3226('0x2e')]=_['keys'](_0x38c83c['query']);_0x34d2aa[_0x3226('0x2f')]=_[_0x3226('0x30')](_0x34d2aa[_0x3226('0x2b')],_0x34d2aa[_0x3226('0x2e')]);_0x4b9174[_0x3226('0x31')]=_[_0x3226('0x30')](_0x34d2aa[_0x3226('0x2b')],qs[_0x3226('0x32')](_0x38c83c[_0x3226('0x2e')]['fields']));_0x4b9174[_0x3226('0x31')]=_0x4b9174[_0x3226('0x31')][_0x3226('0x33')]?_0x4b9174[_0x3226('0x31')]:_0x34d2aa[_0x3226('0x2b')];if(_0x38c83c[_0x3226('0x2e')][_0x3226('0x34')]){_0x4b9174[_0x3226('0x35')]=[{'all':!![]}];}_0x4b9174=_[_0x3226('0x36')]({},_0x4b9174,_0x38c83c[_0x3226('0x37')]);return db[_0x3226('0x2d')][_0x3226('0x38')](_0x4b9174)[_0x3226('0x25')](handleEntityNotFound(_0x12e26d,null))[_0x3226('0x25')](respondWithResult(_0x12e26d,null))['catch'](handleError(_0x12e26d,null));};exports['create']=function(_0x323f17,_0x49cb32){return db[_0x3226('0x2d')]['create'](_0x323f17[_0x3226('0x39')],{})[_0x3226('0x25')](respondWithResult(_0x49cb32,0xc9))[_0x3226('0x3a')](handleError(_0x49cb32,null));};exports[_0x3226('0x24')]=function(_0x32438f,_0x4df2a9){if(_0x32438f[_0x3226('0x39')]['id']){delete _0x32438f['body']['id'];}return db[_0x3226('0x2d')]['find']({'where':{'id':_0x32438f[_0x3226('0x3b')]['id']}})[_0x3226('0x25')](handleEntityNotFound(_0x4df2a9,null))[_0x3226('0x25')](saveUpdates(_0x32438f['body'],null))[_0x3226('0x25')](respondWithResult(_0x4df2a9,null))[_0x3226('0x3a')](handleError(_0x4df2a9,null));};exports[_0x3226('0x26')]=function(_0xde7a6f,_0x18099b){return db[_0x3226('0x2d')][_0x3226('0x38')]({'where':{'id':_0xde7a6f[_0x3226('0x3b')]['id']}})[_0x3226('0x25')](handleEntityNotFound(_0x18099b,null))[_0x3226('0x25')](removeEntity(_0x18099b,null))[_0x3226('0x3a')](handleError(_0x18099b,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index bd40416..95ccac3 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 _0xa711=['chat_proactive_actions','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','ChatProactiveAction'];(function(_0x2e7abb,_0x1e2a4a){var _0xb46ecd=function(_0x99533a){while(--_0x99533a){_0x2e7abb['push'](_0x2e7abb['shift']());}};_0xb46ecd(++_0x1e2a4a);}(_0xa711,0x12d));var _0x1a71=function(_0x1c09bf,_0x259ee2){_0x1c09bf=_0x1c09bf-0x0;var _0x40cdfa=_0xa711[_0x1c09bf];return _0x40cdfa;};'use strict';var _=require(_0x1a71('0x0'));var util=require('util');var logger=require(_0x1a71('0x1'))(_0x1a71('0x2'));var moment=require(_0x1a71('0x3'));var BPromise=require(_0x1a71('0x4'));var rp=require(_0x1a71('0x5'));var fs=require('fs');var path=require(_0x1a71('0x6'));var rimraf=require('rimraf');var config=require(_0x1a71('0x7'));var attributes=require('./chatProactiveAction.attributes');module['exports']=function(_0x22d966,_0x3d2e99){return _0x22d966['define'](_0x1a71('0x8'),attributes,{'tableName':_0x1a71('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe844=['../../config/environment','exports','define','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0xf3fb4e,_0x1f8665){var _0x561bdb=function(_0x2a538c){while(--_0x2a538c){_0xf3fb4e['push'](_0xf3fb4e['shift']());}};_0x561bdb(++_0x1f8665);}(_0xe844,0xc1));var _0x4e84=function(_0x238de8,_0x1e0e37){_0x238de8=_0x238de8-0x0;var _0x43e2a7=_0xe844[_0x238de8];return _0x43e2a7;};'use strict';var _=require(_0x4e84('0x0'));var util=require('util');var logger=require(_0x4e84('0x1'))('api');var moment=require(_0x4e84('0x2'));var BPromise=require(_0x4e84('0x3'));var rp=require(_0x4e84('0x4'));var fs=require('fs');var path=require(_0x4e84('0x5'));var rimraf=require(_0x4e84('0x6'));var config=require(_0x4e84('0x7'));var attributes=require('./chatProactiveAction.attributes');module[_0x4e84('0x8')]=function(_0x2cb2b0,_0x512f32){return _0x2cb2b0[_0x4e84('0x9')]('ChatProactiveAction',attributes,{'tableName':'chat_proactive_actions','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 eb43acd..7065855 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 _0xcadc=['debug','stringify','error','code','ChatProactiveAction,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent'];(function(_0xfde4,_0x30585c){var _0x2328fc=function(_0x389859){while(--_0x389859){_0xfde4['push'](_0xfde4['shift']());}};_0x2328fc(++_0x30585c);}(_0xcadc,0x1a6));var _0xccad=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xcadc[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0xccad('0x0'));var moment=require(_0xccad('0x1'));var BPromise=require(_0xccad('0x2'));var rs=require(_0xccad('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xccad('0x4'))['db'];var utils=require(_0xccad('0x5'));var logger=require(_0xccad('0x6'))(_0xccad('0x7'));var config=require(_0xccad('0x8'));var jayson=require(_0xccad('0x9'));var client=jayson[_0xccad('0xa')][_0xccad('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x58dbcf,_0x21e6c0,_0x4cf210){return new BPromise(function(_0x5e4347,_0x1e166d){return client[_0xccad('0xc')](_0x58dbcf,_0x4cf210)[_0xccad('0xd')](function(_0x39897b){logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x21e6c0,_0xccad('0xe'));logger[_0xccad('0xf')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x21e6c0,_0xccad('0xe'),JSON[_0xccad('0x10')](_0x39897b));if(_0x39897b[_0xccad('0x11')]){if(_0x39897b[_0xccad('0x11')][_0xccad('0x12')]===0x1f4){logger['error'](_0xccad('0x13'),_0x21e6c0,_0x39897b[_0xccad('0x11')][_0xccad('0x14')]);return _0x1e166d(_0x39897b[_0xccad('0x11')]['message']);}logger['error'](_0xccad('0x13'),_0x21e6c0,_0x39897b[_0xccad('0x11')][_0xccad('0x14')]);return _0x5e4347(_0x39897b[_0xccad('0x11')][_0xccad('0x14')]);}else{logger['info'](_0xccad('0x13'),_0x21e6c0,_0xccad('0xe'));_0x5e4347(_0x39897b[_0xccad('0x15')]['message']);}})[_0xccad('0x16')](function(_0x3b49fc){logger[_0xccad('0x11')](_0xccad('0x13'),_0x21e6c0,_0x3b49fc);_0x1e166d(_0x3b49fc);});});} \ No newline at end of file +var _0xff86=['message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatProactiveAction,\x20%s,\x20%s'];(function(_0x5a2e19,_0x3a283e){var _0x225ca3=function(_0x260d38){while(--_0x260d38){_0x5a2e19['push'](_0x5a2e19['shift']());}};_0x225ca3(++_0x3a283e);}(_0xff86,0x173));var _0x6ff8=function(_0x15b021,_0xa10159){_0x15b021=_0x15b021-0x0;var _0x27d4ce=_0xff86[_0x15b021];return _0x27d4ce;};'use strict';var _=require(_0x6ff8('0x0'));var util=require(_0x6ff8('0x1'));var moment=require(_0x6ff8('0x2'));var BPromise=require('bluebird');var rs=require(_0x6ff8('0x3'));var fs=require('fs');var Redis=require(_0x6ff8('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6ff8('0x5'));var logger=require(_0x6ff8('0x6'))(_0x6ff8('0x7'));var config=require('../../config/environment');var jayson=require(_0x6ff8('0x8'));var client=jayson[_0x6ff8('0x9')][_0x6ff8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x576c89,_0x377f29,_0x4f8f2c){return new BPromise(function(_0x5a9682,_0x53d98d){return client['request'](_0x576c89,_0x4f8f2c)[_0x6ff8('0xb')](function(_0x3cf90d){logger[_0x6ff8('0xc')]('ChatProactiveAction,\x20%s,\x20%s',_0x377f29,_0x6ff8('0xd'));logger[_0x6ff8('0xe')](_0x6ff8('0xf'),_0x377f29,_0x6ff8('0xd'),JSON[_0x6ff8('0x10')](_0x3cf90d));if(_0x3cf90d[_0x6ff8('0x11')]){if(_0x3cf90d[_0x6ff8('0x11')][_0x6ff8('0x12')]===0x1f4){logger[_0x6ff8('0x11')](_0x6ff8('0x13'),_0x377f29,_0x3cf90d['error'][_0x6ff8('0x14')]);return _0x53d98d(_0x3cf90d['error'][_0x6ff8('0x14')]);}logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x377f29,_0x3cf90d[_0x6ff8('0x11')][_0x6ff8('0x14')]);return _0x5a9682(_0x3cf90d['error'][_0x6ff8('0x14')]);}else{logger[_0x6ff8('0xc')]('ChatProactiveAction,\x20%s,\x20%s',_0x377f29,_0x6ff8('0xd'));_0x5a9682(_0x3cf90d[_0x6ff8('0x15')]['message']);}})[_0x6ff8('0x16')](function(_0x14bd8c){logger[_0x6ff8('0x11')](_0x6ff8('0x13'),_0x377f29,_0x14bd8c);_0x53d98d(_0x14bd8c);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 1de1f28..4eff461 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 _0x4819=['post','isAuthenticated','create','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id'];(function(_0x1f3707,_0x3fd9ca){var _0x577ba7=function(_0x590925){while(--_0x590925){_0x1f3707['push'](_0x1f3707['shift']());}};_0x577ba7(++_0x3fd9ca);}(_0x4819,0xcd));var _0x9481=function(_0x2f7c40,_0xb36203){_0x2f7c40=_0x2f7c40-0x0;var _0x57a4a5=_0x4819[_0x2f7c40];return _0x57a4a5;};'use strict';var multer=require('multer');var util=require(_0x9481('0x0'));var path=require(_0x9481('0x1'));var timeout=require(_0x9481('0x2'));var express=require(_0x9481('0x3'));var router=express[_0x9481('0x4')]();var fs_extra=require(_0x9481('0x5'));var auth=require(_0x9481('0x6'));var interaction=require(_0x9481('0x7'));var config=require(_0x9481('0x8'));var controller=require(_0x9481('0x9'));router['get'](_0x9481('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x9481('0xb')]('/',auth[_0x9481('0xc')](),controller[_0x9481('0xd')]);router[_0x9481('0xe')](_0x9481('0xa'),auth['isAuthenticated'](),controller[_0x9481('0xf')]);router['delete'](_0x9481('0xa'),auth['isAuthenticated'](),controller[_0x9481('0x10')]);module[_0x9481('0x11')]=router; \ No newline at end of file +var _0x7fbe=['show','post','create','put','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated'];(function(_0x5db5b9,_0x10249a){var _0x19519e=function(_0x5a6141){while(--_0x5a6141){_0x5db5b9['push'](_0x5db5b9['shift']());}};_0x19519e(++_0x10249a);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0xaa7629,_0x219723){_0xaa7629=_0xaa7629-0x0;var _0x487c07=_0x7fbe[_0xaa7629];return _0x487c07;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7fb('0x0'));var timeout=require(_0xe7fb('0x1'));var express=require(_0xe7fb('0x2'));var router=express[_0xe7fb('0x3')]();var fs_extra=require(_0xe7fb('0x4'));var auth=require(_0xe7fb('0x5'));var interaction=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var controller=require(_0xe7fb('0x8'));router[_0xe7fb('0x9')](_0xe7fb('0xa'),auth[_0xe7fb('0xb')](),controller[_0xe7fb('0xc')]);router[_0xe7fb('0xd')]('/',auth['isAuthenticated'](),controller[_0xe7fb('0xe')]);router[_0xe7fb('0xf')](_0xe7fb('0xa'),auth[_0xe7fb('0xb')](),controller['update']);router['delete'](_0xe7fb('0xa'),auth[_0xe7fb('0xb')](),controller[_0xe7fb('0x10')]);module[_0xe7fb('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 412fb97..0a1f57d 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 _0x8721=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0x1c95f6,_0x440967){var _0x2192b6=function(_0x1c8efd){while(--_0x1c8efd){_0x1c95f6['push'](_0x1c95f6['shift']());}};_0x2192b6(++_0x440967);}(_0x8721,0x11a));var _0x1872=function(_0x5d4f12,_0x11e67c){_0x5d4f12=_0x5d4f12-0x0;var _0x4eb577=_0x8721[_0x5d4f12];return _0x4eb577;};'use strict';var Sequelize=require(_0x1872('0x0'));module[_0x1872('0x1')]={'name':{'type':Sequelize[_0x1872('0x2')],'unique':_0x1872('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x1872('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1872('0x5')](_0x1872('0x6'),_0x1872('0x7'),_0x1872('0x8'))}}; \ No newline at end of file +var _0x50c6=['ENUM','rrmemory','beepall','exports','STRING','INTEGER'];(function(_0x4017b0,_0x4347db){var _0x5ed4f7=function(_0x706c26){while(--_0x706c26){_0x4017b0['push'](_0x4017b0['shift']());}};_0x5ed4f7(++_0x4347db);}(_0x50c6,0x1ef));var _0x650c=function(_0x552fe3,_0x4f2ea3){_0x552fe3=_0x552fe3-0x0;var _0x368701=_0x50c6[_0x552fe3];return _0x368701;};'use strict';var Sequelize=require('sequelize');module[_0x650c('0x0')]={'name':{'type':Sequelize[_0x650c('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x650c('0x1')]},'timeout':{'type':Sequelize[_0x650c('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x650c('0x3')](_0x650c('0x4'),_0x650c('0x5'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 5453a7b..1db3d50 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 _0x3572=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','client','http','request','info','request\x20sent','debug','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','then','destroy','get','ChatQueues','UserProfileResource','stack','name','index','map','rawAttributes','fieldName','key','query','keys','filters','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','ChatQueue','include','rows','show','params','intersection','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','order','ChatQueueId','findAll','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','format','SIP','getTeams','addTeams','ids','Team','User','Agents','interface','flatMap','sequelize','each','findOrCreate','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','includes','all','union','value','transaction','isEmpty','forEach','userChatQueue:remove','addAgents','spread','emit','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis'];(function(_0xce8fdb,_0x45943c){var _0x3cc5b8=function(_0x287b17){while(--_0x287b17){_0xce8fdb['push'](_0xce8fdb['shift']());}};_0x3cc5b8(++_0x45943c);}(_0x3572,0x87));var _0x2357=function(_0x3c14ab,_0x1bac70){_0x3c14ab=_0x3c14ab-0x0;var _0x2e4a9f=_0x3572[_0x3c14ab];return _0x2e4a9f;};'use strict';var emlformat=require(_0x2357('0x0'));var rimraf=require(_0x2357('0x1'));var zipdir=require(_0x2357('0x2'));var jsonpatch=require(_0x2357('0x3'));var rp=require(_0x2357('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2357('0x5'));var util=require(_0x2357('0x6'));var path=require(_0x2357('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2357('0x8'));var _=require(_0x2357('0x9'));var squel=require(_0x2357('0xa'));var crypto=require(_0x2357('0xb'));var jsforce=require(_0x2357('0xc'));var deskjs=require(_0x2357('0xd'));var toCsv=require(_0x2357('0xe'));var querystring=require('querystring');var Papa=require(_0x2357('0xf'));var Redis=require(_0x2357('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2357('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2357('0x12'))(_0x2357('0x13'));var utils=require(_0x2357('0x14'));var config=require(_0x2357('0x15'));var licenseUtil=require(_0x2357('0x16'));var db=require(_0x2357('0x17'))['db'];config[_0x2357('0x18')]=_[_0x2357('0x19')](config[_0x2357('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x2357('0x1a'))(new Redis(config[_0x2357('0x18')]));require('./chatQueue.socket')[_0x2357('0x1b')](socket);var jayson=require(_0x2357('0x1c'));var client=jayson[_0x2357('0x1d')][_0x2357('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x1ea7e0,_0x23373f,_0x161499,_0x323fe8){return new BPromise(function(_0x2c74c3,_0x3046e2){var _0x450232=_0x323fe8||client;return _0x450232[_0x2357('0x1f')](_0x1ea7e0,_0x161499)['then'](function(_0x59548c){logger[_0x2357('0x20')]('ChatQueue,\x20%s,\x20%s',_0x23373f,_0x2357('0x21'));logger[_0x2357('0x22')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x23373f,_0x2357('0x21'),JSON['stringify'](_0x59548c));if(_0x59548c[_0x2357('0x23')]){if(_0x59548c['error'][_0x2357('0x24')]===0x1f4){logger[_0x2357('0x23')](_0x2357('0x25'),_0x23373f,_0x59548c['error']['message']);return _0x3046e2(_0x59548c[_0x2357('0x23')][_0x2357('0x26')]);}logger[_0x2357('0x23')]('ChatQueue,\x20%s,\x20%s',_0x23373f,_0x59548c[_0x2357('0x23')]['message']);return _0x2c74c3(_0x59548c[_0x2357('0x23')][_0x2357('0x26')]);}else{logger[_0x2357('0x20')]('ChatQueue,\x20%s,\x20%s',_0x23373f,_0x2357('0x21'));_0x2c74c3(_0x59548c[_0x2357('0x27')]['message']);}})[_0x2357('0x28')](function(_0x2e7783){logger[_0x2357('0x23')](_0x2357('0x25'),_0x23373f,_0x2e7783);_0x3046e2(_0x2e7783);});});}function respondWithStatusCode(_0x4972c0,_0x59ed30){_0x59ed30=_0x59ed30||0xcc;return function(_0x1d6594){if(_0x1d6594){return _0x4972c0[_0x2357('0x29')](_0x59ed30);}return _0x4972c0[_0x2357('0x2a')](_0x59ed30)[_0x2357('0x2b')]();};}function respondWithResult(_0x3cb63f,_0xe40b7e){_0xe40b7e=_0xe40b7e||0xc8;return function(_0x5c8c78){if(_0x5c8c78){return _0x3cb63f[_0x2357('0x2a')](_0xe40b7e)[_0x2357('0x2c')](_0x5c8c78);}};}function respondWithFilteredResult(_0x1a4ffc,_0x14ccb6){return function(_0x1479c3){if(_0x1479c3){var _0x50f794=typeof _0x14ccb6[_0x2357('0x2d')]===_0x2357('0x2e')&&typeof _0x14ccb6[_0x2357('0x2f')]===_0x2357('0x2e');var _0x165bff=_0x1479c3[_0x2357('0x30')];var _0x1d89d4=_0x50f794?0x0:_0x14ccb6[_0x2357('0x2d')];var _0x1f8ce0=_0x50f794?_0x1479c3['count']:_0x14ccb6[_0x2357('0x2d')]+_0x14ccb6['limit'];var _0x263949;if(_0x1f8ce0>=_0x165bff){_0x1f8ce0=_0x165bff;_0x263949=0xc8;}else{_0x263949=0xce;}_0x1a4ffc[_0x2357('0x2a')](_0x263949);return _0x1a4ffc[_0x2357('0x31')](_0x2357('0x32'),_0x1d89d4+'-'+_0x1f8ce0+'/'+_0x165bff)[_0x2357('0x2c')](_0x1479c3);}return null;};}function patchUpdates(_0x113dce){return function(_0x2dd8e9){try{jsonpatch[_0x2357('0x33')](_0x2dd8e9,_0x113dce,!![]);}catch(_0x1be753){return BPromise['reject'](_0x1be753);}return _0x2dd8e9['save']();};}function saveUpdates(_0x39d8b6,_0x4f6266){return function(_0x35978c){if(_0x35978c){return _0x35978c['update'](_0x39d8b6)[_0x2357('0x34')](function(_0x300ba0){return _0x300ba0;});}return null;};}function removeEntity(_0x5c97d8,_0x18d53a){return function(_0x7ccb38){if(_0x7ccb38){return _0x7ccb38[_0x2357('0x35')]()[_0x2357('0x34')](function(){var _0x4735f6=_0x7ccb38[_0x2357('0x36')]({'plain':!![]});var _0x44b237=_0x2357('0x37');return db[_0x2357('0x38')][_0x2357('0x35')]({'where':{'type':_0x44b237,'resourceId':_0x4735f6['id']}})[_0x2357('0x34')](function(){return _0x7ccb38;});})[_0x2357('0x34')](function(){_0x5c97d8[_0x2357('0x2a')](0xcc)[_0x2357('0x2b')]();});}};}function handleEntityNotFound(_0x5a5d97,_0x278fce){return function(_0x32eb48){if(!_0x32eb48){_0x5a5d97[_0x2357('0x29')](0x194);}return _0x32eb48;};}function handleError(_0x2436ff,_0x567b22){_0x567b22=_0x567b22||0x1f4;return function(_0x2fc00d){logger['error'](_0x2fc00d[_0x2357('0x39')]);if(_0x2fc00d[_0x2357('0x3a')]){delete _0x2fc00d[_0x2357('0x3a')];}_0x2436ff['status'](_0x567b22)['send'](_0x2fc00d);};}exports[_0x2357('0x3b')]=function(_0x47b921,_0x502dde){var _0xf890cb={},_0x101093={},_0x24539f={'count':0x0,'rows':[]};var _0x2e30d3=_[_0x2357('0x3c')](db['ChatQueue'][_0x2357('0x3d')],function(_0x212293){return{'name':_0x212293[_0x2357('0x3e')],'type':_0x212293['type'][_0x2357('0x3f')]};});_0x101093['model']=_[_0x2357('0x3c')](_0x2e30d3,_0x2357('0x3a'));_0x101093[_0x2357('0x40')]=_[_0x2357('0x41')](_0x47b921[_0x2357('0x40')]);_0x101093[_0x2357('0x42')]=_['intersection'](_0x101093[_0x2357('0x43')],_0x101093['query']);_0xf890cb['attributes']=_['intersection'](_0x101093['model'],qs[_0x2357('0x44')](_0x47b921[_0x2357('0x40')]['fields']));_0xf890cb[_0x2357('0x45')]=_0xf890cb['attributes'][_0x2357('0x46')]?_0xf890cb[_0x2357('0x45')]:_0x101093[_0x2357('0x43')];if(!_0x47b921[_0x2357('0x40')][_0x2357('0x47')](_0x2357('0x48'))){_0xf890cb[_0x2357('0x2f')]=qs['limit'](_0x47b921['query'][_0x2357('0x2f')]);_0xf890cb[_0x2357('0x2d')]=qs[_0x2357('0x2d')](_0x47b921[_0x2357('0x40')][_0x2357('0x2d')]);}_0xf890cb['order']=qs[_0x2357('0x49')](_0x47b921['query'][_0x2357('0x49')]);_0xf890cb[_0x2357('0x4a')]=qs['filters'](_[_0x2357('0x4b')](_0x47b921[_0x2357('0x40')],_0x101093[_0x2357('0x42')]),_0x2e30d3);if(_0x47b921['query'][_0x2357('0x4c')]){_0xf890cb[_0x2357('0x4a')]=_[_0x2357('0x4d')](_0xf890cb[_0x2357('0x4a')],{'$or':_[_0x2357('0x3c')](_0x2e30d3,function(_0x25d4e4){if(_0x25d4e4['type']!=='VIRTUAL'){var _0x2aec50={};_0x2aec50[_0x25d4e4[_0x2357('0x3a')]]={'$like':'%'+_0x47b921[_0x2357('0x40')][_0x2357('0x4c')]+'%'};return _0x2aec50;}})});}_0xf890cb=_['merge']({},_0xf890cb,_0x47b921[_0x2357('0x4e')]);var _0x1be43c={'where':_0xf890cb[_0x2357('0x4a')]};return db[_0x2357('0x4f')][_0x2357('0x30')](_0x1be43c)[_0x2357('0x34')](function(_0x33cab1){_0x24539f['count']=_0x33cab1;if(_0x47b921[_0x2357('0x40')]['includeAll']){_0xf890cb[_0x2357('0x50')]=[{'all':!![]}];}return db['ChatQueue']['findAll'](_0xf890cb);})[_0x2357('0x34')](function(_0x5f326b){_0x24539f[_0x2357('0x51')]=_0x5f326b;return _0x24539f;})[_0x2357('0x34')](respondWithFilteredResult(_0x502dde,_0xf890cb))['catch'](handleError(_0x502dde,null));};exports[_0x2357('0x52')]=function(_0x22d36c,_0x43467a){var _0x3ca3da={'raw':!![],'where':{'id':_0x22d36c[_0x2357('0x53')]['id']}},_0x1cd7ed={};_0x1cd7ed['model']=_['keys'](db[_0x2357('0x4f')][_0x2357('0x3d')]);_0x1cd7ed[_0x2357('0x40')]=_[_0x2357('0x41')](_0x22d36c[_0x2357('0x40')]);_0x1cd7ed['filters']=_[_0x2357('0x54')](_0x1cd7ed['model'],_0x1cd7ed[_0x2357('0x40')]);_0x3ca3da['attributes']=_['intersection'](_0x1cd7ed[_0x2357('0x43')],qs[_0x2357('0x44')](_0x22d36c[_0x2357('0x40')][_0x2357('0x44')]));_0x3ca3da[_0x2357('0x45')]=_0x3ca3da['attributes'][_0x2357('0x46')]?_0x3ca3da[_0x2357('0x45')]:_0x1cd7ed[_0x2357('0x43')];if(_0x22d36c[_0x2357('0x40')][_0x2357('0x55')]){_0x3ca3da['include']=[{'all':!![]}];}_0x3ca3da=_[_0x2357('0x4d')]({},_0x3ca3da,_0x22d36c[_0x2357('0x4e')]);return db['ChatQueue'][_0x2357('0x56')](_0x3ca3da)[_0x2357('0x34')](handleEntityNotFound(_0x43467a,null))[_0x2357('0x34')](respondWithResult(_0x43467a,null))['catch'](handleError(_0x43467a,null));};exports[_0x2357('0x57')]=function(_0x2cbe9e,_0x10a842){return db[_0x2357('0x4f')]['create'](_0x2cbe9e[_0x2357('0x58')],{})['then'](function(_0x21fe74){var _0x27afc0=_0x2cbe9e[_0x2357('0x59')]['get']({'plain':!![]});if(!_0x27afc0)throw new Error(_0x2357('0x5a'));if(_0x27afc0[_0x2357('0x5b')]===_0x2357('0x59')){var _0x3efd6a=_0x21fe74[_0x2357('0x36')]({'plain':!![]});var _0x1df6c9=_0x2357('0x37');return db[_0x2357('0x5c')][_0x2357('0x56')]({'where':{'name':_0x1df6c9,'userProfileId':_0x27afc0[_0x2357('0x5d')]},'raw':!![]})[_0x2357('0x34')](function(_0x410136){if(_0x410136&&_0x410136[_0x2357('0x5e')]===0x0){return db['UserProfileResource'][_0x2357('0x57')]({'name':_0x3efd6a['name'],'resourceId':_0x3efd6a['id'],'type':_0x410136['name'],'sectionId':_0x410136['id']},{})[_0x2357('0x34')](function(){return _0x21fe74;});}else{return _0x21fe74;}})[_0x2357('0x28')](function(_0x4b5319){logger[_0x2357('0x23')](_0x2357('0x5f'),_0x4b5319);throw _0x4b5319;});}return _0x21fe74;})[_0x2357('0x34')](respondWithResult(_0x10a842,0xc9))['catch'](handleError(_0x10a842,null));};exports['update']=function(_0x41fa50,_0x1b72d5){if(_0x41fa50[_0x2357('0x58')]['id']){delete _0x41fa50[_0x2357('0x58')]['id'];}return db[_0x2357('0x4f')]['find']({'where':{'id':_0x41fa50[_0x2357('0x53')]['id']}})['then'](handleEntityNotFound(_0x1b72d5,null))[_0x2357('0x34')](saveUpdates(_0x41fa50['body'],null))[_0x2357('0x34')](respondWithResult(_0x1b72d5,null))[_0x2357('0x28')](handleError(_0x1b72d5,null));};exports[_0x2357('0x35')]=function(_0x16ff9b,_0x221050){return db[_0x2357('0x4f')]['find']({'where':{'id':_0x16ff9b['params']['id']}})['then'](handleEntityNotFound(_0x221050,null))[_0x2357('0x34')](removeEntity(_0x221050,null))['catch'](handleError(_0x221050,null));};exports[_0x2357('0x60')]=function(_0x2843b8,_0x32770a){return db['ChatQueue']['describe']()[_0x2357('0x34')](respondWithResult(_0x32770a,null))['catch'](handleError(_0x32770a,null));};exports[_0x2357('0x61')]=function(_0x16790b,_0x4ea3cc,_0x390697){var _0x6259ea={'raw':!![],'where':{}},_0x241c3f={},_0x37568f;return db[_0x2357('0x4f')][_0x2357('0x62')]({'where':{'id':_0x16790b[_0x2357('0x53')]['id']}})['then'](handleEntityNotFound(_0x4ea3cc,null))[_0x2357('0x34')](function(_0x11575e){if(_0x11575e){_0x37568f=_0x11575e['get']({'plain':!![]});_0x241c3f['model']=_[_0x2357('0x41')](db[_0x2357('0x63')]['rawAttributes']);_0x241c3f['query']=_[_0x2357('0x41')](_0x16790b[_0x2357('0x40')]);_0x241c3f['filters']=_[_0x2357('0x54')](_0x241c3f[_0x2357('0x43')],_0x241c3f[_0x2357('0x40')]);_0x6259ea[_0x2357('0x45')]=_[_0x2357('0x54')](_0x241c3f[_0x2357('0x43')],qs['fields'](_0x16790b[_0x2357('0x40')]['fields']));_0x6259ea[_0x2357('0x45')]=_0x6259ea[_0x2357('0x45')]['length']?_0x6259ea['attributes']:_0x241c3f[_0x2357('0x43')];if(!_0x16790b[_0x2357('0x40')]['hasOwnProperty'](_0x2357('0x48'))){_0x6259ea[_0x2357('0x2f')]=qs['limit'](_0x16790b[_0x2357('0x40')][_0x2357('0x2f')]);_0x6259ea[_0x2357('0x2d')]=qs['offset'](_0x16790b[_0x2357('0x40')][_0x2357('0x2d')]);}_0x6259ea[_0x2357('0x64')]=qs[_0x2357('0x49')](_0x16790b['query'][_0x2357('0x49')]);_0x6259ea[_0x2357('0x4a')]=qs['filters'](_['pick'](_0x16790b[_0x2357('0x40')],_0x241c3f[_0x2357('0x42')]));_0x6259ea[_0x2357('0x4a')][_0x2357('0x65')]=_0x11575e['id'];if(_0x16790b[_0x2357('0x40')][_0x2357('0x4c')]){_0x6259ea[_0x2357('0x4a')]=_[_0x2357('0x4d')](_0x6259ea['where'],{'$or':_[_0x2357('0x3c')](_0x6259ea['attributes'],function(_0x2d7fda){var _0x2fc915={};_0x2fc915[_0x2d7fda]={'$like':'%'+_0x16790b[_0x2357('0x40')][_0x2357('0x4c')]+'%'};return _0x2fc915;})});}_0x6259ea=_[_0x2357('0x4d')]({},_0x6259ea,_0x16790b['options']);return db[_0x2357('0x63')][_0x2357('0x66')](_0x6259ea);}})[_0x2357('0x34')](function(_0xab8a48){if(_0xab8a48){return db['User'][_0x2357('0x67')]({'where':{'id':_[_0x2357('0x3c')](_0xab8a48,_0x2357('0x68')),'role':_0x2357('0x69')},'attributes':['id',_0x2357('0x3a'),_0x2357('0x6a'),_0x2357('0x6b'),_0x2357('0x6c')]});}})[_0x2357('0x34')](function(_0x13f371){if(_0x13f371){return{'count':_0x13f371['count'],'rows':_[_0x2357('0x3c')](_0x13f371[_0x2357('0x51')],function(_0x7077a8){return{'membername':_0x7077a8[_0x2357('0x3a')],'UserId':_0x7077a8['id'],'queue_name':_0x37568f[_0x2357('0x3a')],'ChatQueueId':_0x37568f['id'],'interface':util[_0x2357('0x6d')]('%s/%s',_0x2357('0x6e'),_0x7077a8[_0x2357('0x3a')]),'penalty':0x0,'paused':_0x7077a8['chatPause'],'createdAt':_0x7077a8['createdAt'],'updatedAt':_0x7077a8[_0x2357('0x6b')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x4ea3cc,_0x6259ea))[_0x2357('0x28')](handleError(_0x4ea3cc,null));};exports[_0x2357('0x6f')]=function(_0xcd3e83,_0x8b8546,_0x5e42a5){var _0xd68cbb={};var _0x4dd001={};var _0x285664;var _0x37cef0;return db['ChatQueue'][_0x2357('0x62')]({'where':{'id':_0xcd3e83[_0x2357('0x53')]['id']}})[_0x2357('0x34')](handleEntityNotFound(_0x8b8546,null))[_0x2357('0x34')](function(_0x439670){if(_0x439670){_0x285664=_0x439670;_0x4dd001['model']=_[_0x2357('0x41')](db['Team'][_0x2357('0x3d')]);_0x4dd001[_0x2357('0x40')]=_['keys'](_0xcd3e83[_0x2357('0x40')]);_0x4dd001['filters']=_[_0x2357('0x54')](_0x4dd001[_0x2357('0x43')],_0x4dd001['query']);_0xd68cbb[_0x2357('0x45')]=_[_0x2357('0x54')](_0x4dd001[_0x2357('0x43')],qs['fields'](_0xcd3e83[_0x2357('0x40')]['fields']));_0xd68cbb[_0x2357('0x45')]=_0xd68cbb[_0x2357('0x45')]['length']?_0xd68cbb[_0x2357('0x45')]:_0x4dd001[_0x2357('0x43')];_0xd68cbb['order']=qs[_0x2357('0x49')](_0xcd3e83[_0x2357('0x40')]['sort']);_0xd68cbb[_0x2357('0x4a')]=qs[_0x2357('0x42')](_[_0x2357('0x4b')](_0xcd3e83[_0x2357('0x40')],_0x4dd001[_0x2357('0x42')]));if(_0xcd3e83[_0x2357('0x40')][_0x2357('0x4c')]){_0xd68cbb['where']=_['merge'](_0xd68cbb[_0x2357('0x4a')],{'$or':_[_0x2357('0x3c')](_0xd68cbb['attributes'],function(_0xaa2502){var _0x95900={};_0x95900[_0xaa2502]={'$like':'%'+_0xcd3e83['query'][_0x2357('0x4c')]+'%'};return _0x95900;})});}_0xd68cbb=_[_0x2357('0x4d')]({},_0xd68cbb,_0xcd3e83[_0x2357('0x4e')]);return _0x285664[_0x2357('0x6f')](_0xd68cbb);}})[_0x2357('0x34')](function(_0x11698){if(_0x11698){_0x37cef0=_0x11698[_0x2357('0x46')];if(!_0xcd3e83[_0x2357('0x40')]['hasOwnProperty']('nolimit')){_0xd68cbb['limit']=qs['limit'](_0xcd3e83['query'][_0x2357('0x2f')]);_0xd68cbb[_0x2357('0x2d')]=qs[_0x2357('0x2d')](_0xcd3e83['query']['offset']);}return _0x285664[_0x2357('0x6f')](_0xd68cbb);}})[_0x2357('0x34')](function(_0x4b3e12){if(_0x4b3e12){return _0x4b3e12?{'count':_0x37cef0,'rows':_0x4b3e12}:null;}})[_0x2357('0x34')](respondWithResult(_0x8b8546,null))[_0x2357('0x28')](handleError(_0x8b8546,null));};exports[_0x2357('0x70')]=function(_0x18a956,_0x57b4ee,_0x5bb198){var _0x4c500c=_0x18a956['body'][_0x2357('0x71')];return db[_0x2357('0x72')]['findAll']({'where':{'id':_0x4c500c},'attributes':['id'],'include':[{'model':db[_0x2357('0x73')],'as':_0x2357('0x74'),'attributes':['id',_0x2357('0x3a'),'online','voicePause',_0x2357('0x75')],'raw':!![]}]})[_0x2357('0x34')](function(_0x1701cd){if(_0x1701cd){var _0x55a450=_[_0x2357('0x76')](_0x1701cd,function(_0x54ebd6){var _0x206d6e=_0x54ebd6[_0x2357('0x36')]({'plain':!![]});return _0x206d6e[_0x2357('0x74')];});return db[_0x2357('0x4f')]['find']({'where':{'id':_0x18a956['params']['id']}})[_0x2357('0x34')](function(_0x569cc0){return db[_0x2357('0x77')]['transaction'](function(_0x5dd227){return _0x569cc0[_0x2357('0x70')](_0x4c500c,{'transaction':_0x5dd227})[_0x2357('0x34')](function(){return BPromise[_0x2357('0x78')](_0x55a450,function(_0x5ecdd1){return db[_0x2357('0x63')][_0x2357('0x79')]({'where':{'UserId':_0x5ecdd1['id'],'ChatQueueId':_0x18a956[_0x2357('0x53')]['id']},'transaction':_0x5dd227});});})[_0x2357('0x34')](function(){_0x55a450['forEach'](function(_0x3cc8dd){socket['emit'](_0x2357('0x7a'),{'UserId':_0x3cc8dd['id'],'ChatQueueId':_0x569cc0['id']});});});});});}})['then'](respondWithStatusCode(_0x57b4ee,null))[_0x2357('0x28')](handleError(_0x57b4ee,null));};exports[_0x2357('0x7b')]=function(_0x41bd4c,_0x25a528,_0x2289a9){return db[_0x2357('0x72')][_0x2357('0x66')]({'where':{'id':_0x41bd4c[_0x2357('0x40')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x25a528,null))[_0x2357('0x34')](function(_0x485152){var _0x27d631=_[_0x2357('0x3c')](_0x485152,'id');var _0x17985e=[];var _0x710a0d=[];var _0x2a84d6=squel[_0x2357('0x7c')]();_0x2a84d6[_0x2357('0x7d')](_0x2357('0x7e'))[_0x2357('0x7f')](_0x2357('0x80'),'tq')[_0x2357('0x81')](_0x2357('0x82'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x2357('0x83'),_0x41bd4c['params']['id']);for(var _0x3b1437=0x0;_0x3b1437<_0x485152[_0x2357('0x46')];_0x3b1437+=0x1){let _0x357257=_0x485152[_0x3b1437];for(var _0x3ae48e=0x0;_0x3ae48e<_0x357257[_0x2357('0x74')][_0x2357('0x46')];_0x3ae48e+=0x1){let _0x3a1689=_0x357257[_0x2357('0x74')][_0x3ae48e];var _0x4cc835=_0x2a84d6[_0x2357('0x84')]();_0x4cc835[_0x2357('0x4a')](_0x2357('0x85'),_0x3a1689['id']);_0x710a0d['push'](db[_0x2357('0x77')]['query'](_0x4cc835[_0x2357('0x86')](),{'type':db[_0x2357('0x77')][_0x2357('0x87')][_0x2357('0x88')]})[_0x2357('0x34')](function(_0x1776f4){if(_0x1776f4['length']===0x1){return _0x3a1689['id'];}else{var _0x53c9f3=_[_0x2357('0x89')](_[_0x2357('0x3c')](_0x1776f4,'TeamId'),function(_0x27f7f6){return _[_0x2357('0x8a')](_0x27d631,_0x27f7f6);});if(_0x53c9f3){return _0x3a1689['id'];}}}));}}return BPromise[_0x2357('0x8b')](_0x710a0d)[_0x2357('0x34')](function(_0x52b0c1){_0x17985e=_(_0x17985e)[_0x2357('0x8c')](_0x52b0c1)['compact']()[_0x2357('0x8d')]();return db[_0x2357('0x4f')][_0x2357('0x56')]({'where':{'id':_0x41bd4c['params']['id']}})[_0x2357('0x34')](function(_0x402512){return db[_0x2357('0x77')][_0x2357('0x8e')](function(_0x522c33){return _0x402512['removeTeams'](_0x41bd4c[_0x2357('0x40')][_0x2357('0x71')],{'transaction':_0x522c33})[_0x2357('0x34')](function(){if(!_[_0x2357('0x8f')](_0x17985e)){return _0x402512['removeAgents'](_0x17985e,{'transaction':_0x522c33});}})['then'](function(){_0x17985e[_0x2357('0x90')](function(_0xc9bca9){socket['emit'](_0x2357('0x91'),{'UserId':_0xc9bca9,'ChatQueueId':_0x402512['id']});});});});});});})[_0x2357('0x34')](respondWithStatusCode(_0x25a528,null))[_0x2357('0x28')](handleError(_0x25a528,null));};exports[_0x2357('0x92')]=function(_0x1119da,_0xaa0e6e,_0x230df3){return db['ChatQueue'][_0x2357('0x56')]({'where':{'id':_0x1119da[_0x2357('0x53')]['id']}})[_0x2357('0x34')](handleEntityNotFound(_0xaa0e6e,null))[_0x2357('0x34')](function(_0x78f1de){if(_0x78f1de){return _0x78f1de[_0x2357('0x92')](_0x1119da[_0x2357('0x58')][_0x2357('0x71')],_['omit'](_0x1119da['body'],[_0x2357('0x71'),'id'])||{})[_0x2357('0x93')](function(_0x483da7){for(var _0x4071c9=0x0;_0x4071c9<_0x1119da[_0x2357('0x58')][_0x2357('0x71')][_0x2357('0x46')];_0x4071c9+=0x1){socket[_0x2357('0x94')](_0x2357('0x7a'),{'UserId':Number(_0x1119da[_0x2357('0x58')][_0x2357('0x71')][_0x4071c9]),'ChatQueueId':Number(_0x1119da['params']['id'])});}return _0x483da7;});}})[_0x2357('0x34')](respondWithResult(_0xaa0e6e,null))[_0x2357('0x28')](handleError(_0xaa0e6e,null));};exports['removeAgents']=function(_0x32a35f,_0x5e35c9,_0xbda0fb){return db[_0x2357('0x4f')][_0x2357('0x56')]({'where':{'id':_0x32a35f[_0x2357('0x53')]['id']}})[_0x2357('0x34')](handleEntityNotFound(_0x5e35c9,null))['then'](function(_0x1fd4f3){if(_0x1fd4f3){return _0x1fd4f3[_0x2357('0x95')](_0x32a35f[_0x2357('0x40')][_0x2357('0x71')])[_0x2357('0x34')](function(){if(_[_0x2357('0x96')](_0x32a35f[_0x2357('0x40')]['ids'])){for(var _0x276e05=0x0;_0x276e05<_0x32a35f[_0x2357('0x40')][_0x2357('0x71')][_0x2357('0x46')];_0x276e05+=0x1){socket[_0x2357('0x94')](_0x2357('0x91'),{'UserId':Number(_0x32a35f['query'][_0x2357('0x71')][_0x276e05]),'ChatQueueId':Number(_0x32a35f[_0x2357('0x53')]['id'])});}}else{socket[_0x2357('0x94')]('userChatQueue:remove',{'UserId':Number(_0x32a35f[_0x2357('0x40')][_0x2357('0x71')]),'ChatQueueId':Number(_0x32a35f[_0x2357('0x53')]['id'])});}});}})[_0x2357('0x34')](respondWithStatusCode(_0x5e35c9,null))[_0x2357('0x28')](handleError(_0x5e35c9,null));};exports[_0x2357('0x97')]=function(_0xf2bc43,_0x594815,_0x20f369){var _0x5665a2={};var _0x4e1eea={};var _0x6da90c;var _0x1c9e25;return db[_0x2357('0x4f')]['findOne']({'where':{'id':_0xf2bc43['params']['id']}})[_0x2357('0x34')](handleEntityNotFound(_0x594815,null))[_0x2357('0x34')](function(_0x388e32){if(_0x388e32){_0x6da90c=_0x388e32;_0x4e1eea[_0x2357('0x43')]=_[_0x2357('0x41')](db[_0x2357('0x73')]['rawAttributes']);_0x4e1eea['query']=_['keys'](_0xf2bc43[_0x2357('0x40')]);_0x4e1eea[_0x2357('0x42')]=_[_0x2357('0x54')](_0x4e1eea[_0x2357('0x43')],_0x4e1eea[_0x2357('0x40')]);_0x5665a2[_0x2357('0x45')]=_['intersection'](_0x4e1eea[_0x2357('0x43')],qs['fields'](_0xf2bc43['query'][_0x2357('0x44')]));_0x5665a2[_0x2357('0x45')]=_0x5665a2[_0x2357('0x45')][_0x2357('0x46')]?_0x5665a2[_0x2357('0x45')]:_0x4e1eea[_0x2357('0x43')];_0x5665a2[_0x2357('0x64')]=qs[_0x2357('0x49')](_0xf2bc43[_0x2357('0x40')][_0x2357('0x49')]);_0x5665a2[_0x2357('0x4a')]=qs[_0x2357('0x42')](_[_0x2357('0x4b')](_0xf2bc43[_0x2357('0x40')],_0x4e1eea[_0x2357('0x42')]));if(_0xf2bc43[_0x2357('0x40')][_0x2357('0x4c')]){_0x5665a2[_0x2357('0x4a')]=_[_0x2357('0x4d')](_0x5665a2[_0x2357('0x4a')],{'$or':_['map'](_0x5665a2[_0x2357('0x45')],function(_0x4fb6b1){var _0x379e65={};_0x379e65[_0x4fb6b1]={'$like':'%'+_0xf2bc43[_0x2357('0x40')][_0x2357('0x4c')]+'%'};return _0x379e65;})});}_0x5665a2=_['merge']({},_0x5665a2,_0xf2bc43[_0x2357('0x4e')]);return _0x6da90c[_0x2357('0x97')](_0x5665a2);}})[_0x2357('0x34')](function(_0x48910){if(_0x48910){_0x1c9e25=_0x48910['length'];if(!_0xf2bc43[_0x2357('0x40')][_0x2357('0x47')](_0x2357('0x48'))){_0x5665a2[_0x2357('0x2f')]=qs[_0x2357('0x2f')](_0xf2bc43[_0x2357('0x40')][_0x2357('0x2f')]);_0x5665a2[_0x2357('0x2d')]=qs['offset'](_0xf2bc43[_0x2357('0x40')][_0x2357('0x2d')]);}return _0x6da90c[_0x2357('0x97')](_0x5665a2);}})[_0x2357('0x34')](function(_0x52deed){if(_0x52deed){return _0x52deed?{'count':_0x1c9e25,'rows':_0x52deed}:null;}})[_0x2357('0x34')](respondWithResult(_0x594815,null))[_0x2357('0x28')](handleError(_0x594815,null));}; \ No newline at end of file +var _0x7050=['filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','update','describe','findOne','ChatQueueId','merge','UserChatQueue','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','%s/%s','SIP','Team','getTeams','addTeams','Agents','online','voicePause','interface','flatMap','transaction','each','findOrCreate','forEach','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','every','TeamId','includes','all','value','emit','userChatQueue:remove','addAgents','ids','removeAgents','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./chatQueue.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatQueue,\x20%s,\x20%s','catch','status','end','undefined','limit','count','offset','set','json','apply','reject','save','destroy','get','ChatQueues','UserProfileResource','sendStatus','stack','name','index','map','ChatQueue','rawAttributes','fieldName','type','model','query','keys'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7050,0x17e));var _0x0705=function(_0x3a73bc,_0x550aef){_0x3a73bc=_0x3a73bc-0x0;var _0x32891b=_0x7050[_0x3a73bc];return _0x32891b;};'use strict';var emlformat=require(_0x0705('0x0'));var rimraf=require(_0x0705('0x1'));var zipdir=require(_0x0705('0x2'));var jsonpatch=require(_0x0705('0x3'));var rp=require(_0x0705('0x4'));var moment=require(_0x0705('0x5'));var BPromise=require(_0x0705('0x6'));var Mustache=require(_0x0705('0x7'));var util=require(_0x0705('0x8'));var path=require(_0x0705('0x9'));var sox=require(_0x0705('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0705('0xb'));var _=require(_0x0705('0xc'));var squel=require(_0x0705('0xd'));var crypto=require(_0x0705('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0705('0xf'));var toCsv=require(_0x0705('0x10'));var querystring=require(_0x0705('0x11'));var Papa=require(_0x0705('0x12'));var Redis=require(_0x0705('0x13'));var authService=require(_0x0705('0x14'));var qs=require(_0x0705('0x15'));var as=require(_0x0705('0x16'));var hardwareService=require(_0x0705('0x17'));var logger=require(_0x0705('0x18'))(_0x0705('0x19'));var utils=require(_0x0705('0x1a'));var config=require(_0x0705('0x1b'));var licenseUtil=require(_0x0705('0x1c'));var db=require(_0x0705('0x1d'))['db'];config[_0x0705('0x1e')]=_['defaults'](config[_0x0705('0x1e')],{'host':_0x0705('0x1f'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0705('0x1e')]));require(_0x0705('0x20'))[_0x0705('0x21')](socket);var jayson=require(_0x0705('0x22'));var client=jayson[_0x0705('0x23')][_0x0705('0x24')]({'port':0x232a});function respondWithRpcPromise(_0x116312,_0x6eda79,_0x2bd624,_0x3fdbda){return new BPromise(function(_0x124a42,_0x288cce){var _0x3e0a30=_0x3fdbda||client;return _0x3e0a30[_0x0705('0x25')](_0x116312,_0x2bd624)[_0x0705('0x26')](function(_0x14175b){logger[_0x0705('0x27')]('ChatQueue,\x20%s,\x20%s',_0x6eda79,_0x0705('0x28'));logger['debug'](_0x0705('0x29'),_0x6eda79,_0x0705('0x28'),JSON[_0x0705('0x2a')](_0x14175b));if(_0x14175b[_0x0705('0x2b')]){if(_0x14175b[_0x0705('0x2b')]['code']===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x6eda79,_0x14175b[_0x0705('0x2b')][_0x0705('0x2c')]);return _0x288cce(_0x14175b[_0x0705('0x2b')][_0x0705('0x2c')]);}logger[_0x0705('0x2b')](_0x0705('0x2d'),_0x6eda79,_0x14175b[_0x0705('0x2b')][_0x0705('0x2c')]);return _0x124a42(_0x14175b['error'][_0x0705('0x2c')]);}else{logger[_0x0705('0x27')]('ChatQueue,\x20%s,\x20%s',_0x6eda79,'request\x20sent');_0x124a42(_0x14175b['result'][_0x0705('0x2c')]);}})[_0x0705('0x2e')](function(_0x31585f){logger[_0x0705('0x2b')](_0x0705('0x2d'),_0x6eda79,_0x31585f);_0x288cce(_0x31585f);});});}function respondWithStatusCode(_0x5c40b1,_0x4eb491){_0x4eb491=_0x4eb491||0xcc;return function(_0x5b826d){if(_0x5b826d){return _0x5c40b1['sendStatus'](_0x4eb491);}return _0x5c40b1[_0x0705('0x2f')](_0x4eb491)[_0x0705('0x30')]();};}function respondWithResult(_0x235d11,_0x37344c){_0x37344c=_0x37344c||0xc8;return function(_0x1578b0){if(_0x1578b0){return _0x235d11[_0x0705('0x2f')](_0x37344c)['json'](_0x1578b0);}};}function respondWithFilteredResult(_0x2c3008,_0x91314a){return function(_0x11add0){if(_0x11add0){var _0xcc7fa=typeof _0x91314a['offset']===_0x0705('0x31')&&typeof _0x91314a[_0x0705('0x32')]===_0x0705('0x31');var _0x36fc22=_0x11add0[_0x0705('0x33')];var _0x2ebe73=_0xcc7fa?0x0:_0x91314a['offset'];var _0x598c7b=_0xcc7fa?_0x11add0[_0x0705('0x33')]:_0x91314a[_0x0705('0x34')]+_0x91314a[_0x0705('0x32')];var _0x1c2e1b;if(_0x598c7b>=_0x36fc22){_0x598c7b=_0x36fc22;_0x1c2e1b=0xc8;}else{_0x1c2e1b=0xce;}_0x2c3008['status'](_0x1c2e1b);return _0x2c3008[_0x0705('0x35')]('Content-Range',_0x2ebe73+'-'+_0x598c7b+'/'+_0x36fc22)[_0x0705('0x36')](_0x11add0);}return null;};}function patchUpdates(_0x687b87){return function(_0xb4bec7){try{jsonpatch[_0x0705('0x37')](_0xb4bec7,_0x687b87,!![]);}catch(_0x3ac448){return BPromise[_0x0705('0x38')](_0x3ac448);}return _0xb4bec7[_0x0705('0x39')]();};}function saveUpdates(_0x57ce35,_0x3575ef){return function(_0x1500ec){if(_0x1500ec){return _0x1500ec['update'](_0x57ce35)[_0x0705('0x26')](function(_0x43a579){return _0x43a579;});}return null;};}function removeEntity(_0x5649dd,_0x43ac79){return function(_0x113de2){if(_0x113de2){return _0x113de2[_0x0705('0x3a')]()[_0x0705('0x26')](function(){var _0x3c32d0=_0x113de2[_0x0705('0x3b')]({'plain':!![]});var _0x4c5c0a=_0x0705('0x3c');return db[_0x0705('0x3d')][_0x0705('0x3a')]({'where':{'type':_0x4c5c0a,'resourceId':_0x3c32d0['id']}})[_0x0705('0x26')](function(){return _0x113de2;});})[_0x0705('0x26')](function(){_0x5649dd[_0x0705('0x2f')](0xcc)[_0x0705('0x30')]();});}};}function handleEntityNotFound(_0x5936b7,_0x2acfad){return function(_0x3fc7d1){if(!_0x3fc7d1){_0x5936b7[_0x0705('0x3e')](0x194);}return _0x3fc7d1;};}function handleError(_0x17a558,_0x320e04){_0x320e04=_0x320e04||0x1f4;return function(_0x37a95f){logger[_0x0705('0x2b')](_0x37a95f[_0x0705('0x3f')]);if(_0x37a95f[_0x0705('0x40')]){delete _0x37a95f[_0x0705('0x40')];}_0x17a558[_0x0705('0x2f')](_0x320e04)['send'](_0x37a95f);};}exports[_0x0705('0x41')]=function(_0x417c7b,_0x19a468){var _0x3fc1f0={},_0x5212b8={},_0x355906={'count':0x0,'rows':[]};var _0x5a7807=_[_0x0705('0x42')](db[_0x0705('0x43')][_0x0705('0x44')],function(_0x19fbb1){return{'name':_0x19fbb1[_0x0705('0x45')],'type':_0x19fbb1[_0x0705('0x46')]['key']};});_0x5212b8[_0x0705('0x47')]=_[_0x0705('0x42')](_0x5a7807,_0x0705('0x40'));_0x5212b8[_0x0705('0x48')]=_[_0x0705('0x49')](_0x417c7b[_0x0705('0x48')]);_0x5212b8[_0x0705('0x4a')]=_['intersection'](_0x5212b8[_0x0705('0x47')],_0x5212b8[_0x0705('0x48')]);_0x3fc1f0[_0x0705('0x4b')]=_[_0x0705('0x4c')](_0x5212b8[_0x0705('0x47')],qs['fields'](_0x417c7b[_0x0705('0x48')][_0x0705('0x4d')]));_0x3fc1f0[_0x0705('0x4b')]=_0x3fc1f0[_0x0705('0x4b')][_0x0705('0x4e')]?_0x3fc1f0[_0x0705('0x4b')]:_0x5212b8[_0x0705('0x47')];if(!_0x417c7b['query'][_0x0705('0x4f')](_0x0705('0x50'))){_0x3fc1f0[_0x0705('0x32')]=qs[_0x0705('0x32')](_0x417c7b[_0x0705('0x48')]['limit']);_0x3fc1f0[_0x0705('0x34')]=qs[_0x0705('0x34')](_0x417c7b[_0x0705('0x48')]['offset']);}_0x3fc1f0[_0x0705('0x51')]=qs[_0x0705('0x52')](_0x417c7b[_0x0705('0x48')][_0x0705('0x52')]);_0x3fc1f0[_0x0705('0x53')]=qs[_0x0705('0x4a')](_[_0x0705('0x54')](_0x417c7b[_0x0705('0x48')],_0x5212b8[_0x0705('0x4a')]),_0x5a7807);if(_0x417c7b[_0x0705('0x48')][_0x0705('0x55')]){_0x3fc1f0['where']=_['merge'](_0x3fc1f0[_0x0705('0x53')],{'$or':_[_0x0705('0x42')](_0x5a7807,function(_0x5374cc){if(_0x5374cc[_0x0705('0x46')]!==_0x0705('0x56')){var _0xb17c77={};_0xb17c77[_0x5374cc[_0x0705('0x40')]]={'$like':'%'+_0x417c7b[_0x0705('0x48')]['filter']+'%'};return _0xb17c77;}})});}_0x3fc1f0=_['merge']({},_0x3fc1f0,_0x417c7b[_0x0705('0x57')]);var _0x15dc7c={'where':_0x3fc1f0[_0x0705('0x53')]};return db[_0x0705('0x43')][_0x0705('0x33')](_0x15dc7c)[_0x0705('0x26')](function(_0x422b86){_0x355906[_0x0705('0x33')]=_0x422b86;if(_0x417c7b[_0x0705('0x48')][_0x0705('0x58')]){_0x3fc1f0[_0x0705('0x59')]=[{'all':!![]}];}return db['ChatQueue'][_0x0705('0x5a')](_0x3fc1f0);})[_0x0705('0x26')](function(_0x2d6bde){_0x355906[_0x0705('0x5b')]=_0x2d6bde;return _0x355906;})[_0x0705('0x26')](respondWithFilteredResult(_0x19a468,_0x3fc1f0))[_0x0705('0x2e')](handleError(_0x19a468,null));};exports['show']=function(_0x5544e9,_0x48742d){var _0x3e9f96={'raw':!![],'where':{'id':_0x5544e9[_0x0705('0x5c')]['id']}},_0x396d47={};_0x396d47[_0x0705('0x47')]=_['keys'](db['ChatQueue'][_0x0705('0x44')]);_0x396d47[_0x0705('0x48')]=_[_0x0705('0x49')](_0x5544e9[_0x0705('0x48')]);_0x396d47[_0x0705('0x4a')]=_[_0x0705('0x4c')](_0x396d47[_0x0705('0x47')],_0x396d47[_0x0705('0x48')]);_0x3e9f96['attributes']=_[_0x0705('0x4c')](_0x396d47['model'],qs[_0x0705('0x4d')](_0x5544e9[_0x0705('0x48')][_0x0705('0x4d')]));_0x3e9f96[_0x0705('0x4b')]=_0x3e9f96[_0x0705('0x4b')][_0x0705('0x4e')]?_0x3e9f96[_0x0705('0x4b')]:_0x396d47[_0x0705('0x47')];if(_0x5544e9[_0x0705('0x48')]['includeAll']){_0x3e9f96[_0x0705('0x59')]=[{'all':!![]}];}_0x3e9f96=_['merge']({},_0x3e9f96,_0x5544e9[_0x0705('0x57')]);return db[_0x0705('0x43')][_0x0705('0x5d')](_0x3e9f96)[_0x0705('0x26')](handleEntityNotFound(_0x48742d,null))['then'](respondWithResult(_0x48742d,null))[_0x0705('0x2e')](handleError(_0x48742d,null));};exports[_0x0705('0x5e')]=function(_0x44733c,_0xfebe3a){return db[_0x0705('0x43')][_0x0705('0x5e')](_0x44733c[_0x0705('0x5f')],{})[_0x0705('0x26')](function(_0x4db397){var _0x41b40b=_0x44733c[_0x0705('0x60')][_0x0705('0x3b')]({'plain':!![]});if(!_0x41b40b)throw new Error(_0x0705('0x61'));if(_0x41b40b[_0x0705('0x62')]===_0x0705('0x60')){var _0x6d662c=_0x4db397['get']({'plain':!![]});var _0x3fec73='ChatQueues';return db[_0x0705('0x63')]['find']({'where':{'name':_0x3fec73,'userProfileId':_0x41b40b[_0x0705('0x64')]},'raw':!![]})[_0x0705('0x26')](function(_0x43fc96){if(_0x43fc96&&_0x43fc96['autoAssociation']===0x0){return db['UserProfileResource'][_0x0705('0x5e')]({'name':_0x6d662c['name'],'resourceId':_0x6d662c['id'],'type':_0x43fc96[_0x0705('0x40')],'sectionId':_0x43fc96['id']},{})[_0x0705('0x26')](function(){return _0x4db397;});}else{return _0x4db397;}})[_0x0705('0x2e')](function(_0x339765){logger[_0x0705('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x339765);throw _0x339765;});}return _0x4db397;})[_0x0705('0x26')](respondWithResult(_0xfebe3a,0xc9))['catch'](handleError(_0xfebe3a,null));};exports[_0x0705('0x65')]=function(_0x3c6bbd,_0x57a8c0){if(_0x3c6bbd[_0x0705('0x5f')]['id']){delete _0x3c6bbd[_0x0705('0x5f')]['id'];}return db[_0x0705('0x43')][_0x0705('0x5d')]({'where':{'id':_0x3c6bbd[_0x0705('0x5c')]['id']}})[_0x0705('0x26')](handleEntityNotFound(_0x57a8c0,null))[_0x0705('0x26')](saveUpdates(_0x3c6bbd[_0x0705('0x5f')],null))['then'](respondWithResult(_0x57a8c0,null))['catch'](handleError(_0x57a8c0,null));};exports[_0x0705('0x3a')]=function(_0x27b788,_0x494d2c){return db[_0x0705('0x43')][_0x0705('0x5d')]({'where':{'id':_0x27b788[_0x0705('0x5c')]['id']}})['then'](handleEntityNotFound(_0x494d2c,null))[_0x0705('0x26')](removeEntity(_0x494d2c,null))['catch'](handleError(_0x494d2c,null));};exports[_0x0705('0x66')]=function(_0x358d2c,_0x1c1915){return db[_0x0705('0x43')][_0x0705('0x66')]()[_0x0705('0x26')](respondWithResult(_0x1c1915,null))[_0x0705('0x2e')](handleError(_0x1c1915,null));};exports['getMembers']=function(_0x242a65,_0x497939,_0x20d182){var _0x42a271={'raw':!![],'where':{}},_0x577cd1={},_0xcd9260;return db[_0x0705('0x43')][_0x0705('0x67')]({'where':{'id':_0x242a65['params']['id']}})[_0x0705('0x26')](handleEntityNotFound(_0x497939,null))[_0x0705('0x26')](function(_0x3da91c){if(_0x3da91c){_0xcd9260=_0x3da91c[_0x0705('0x3b')]({'plain':!![]});_0x577cd1[_0x0705('0x47')]=_[_0x0705('0x49')](db['UserChatQueue']['rawAttributes']);_0x577cd1[_0x0705('0x48')]=_[_0x0705('0x49')](_0x242a65[_0x0705('0x48')]);_0x577cd1[_0x0705('0x4a')]=_[_0x0705('0x4c')](_0x577cd1['model'],_0x577cd1['query']);_0x42a271[_0x0705('0x4b')]=_[_0x0705('0x4c')](_0x577cd1[_0x0705('0x47')],qs[_0x0705('0x4d')](_0x242a65['query'][_0x0705('0x4d')]));_0x42a271['attributes']=_0x42a271['attributes'][_0x0705('0x4e')]?_0x42a271['attributes']:_0x577cd1[_0x0705('0x47')];if(!_0x242a65[_0x0705('0x48')][_0x0705('0x4f')](_0x0705('0x50'))){_0x42a271['limit']=qs[_0x0705('0x32')](_0x242a65[_0x0705('0x48')][_0x0705('0x32')]);_0x42a271['offset']=qs[_0x0705('0x34')](_0x242a65[_0x0705('0x48')]['offset']);}_0x42a271['order']=qs[_0x0705('0x52')](_0x242a65[_0x0705('0x48')][_0x0705('0x52')]);_0x42a271[_0x0705('0x53')]=qs[_0x0705('0x4a')](_[_0x0705('0x54')](_0x242a65[_0x0705('0x48')],_0x577cd1[_0x0705('0x4a')]));_0x42a271['where'][_0x0705('0x68')]=_0x3da91c['id'];if(_0x242a65[_0x0705('0x48')][_0x0705('0x55')]){_0x42a271[_0x0705('0x53')]=_['merge'](_0x42a271[_0x0705('0x53')],{'$or':_[_0x0705('0x42')](_0x42a271[_0x0705('0x4b')],function(_0xd29402){var _0x1c4ae3={};_0x1c4ae3[_0xd29402]={'$like':'%'+_0x242a65[_0x0705('0x48')][_0x0705('0x55')]+'%'};return _0x1c4ae3;})});}_0x42a271=_[_0x0705('0x69')]({},_0x42a271,_0x242a65[_0x0705('0x57')]);return db[_0x0705('0x6a')][_0x0705('0x5a')](_0x42a271);}})[_0x0705('0x26')](function(_0x582898){if(_0x582898){return db[_0x0705('0x6b')][_0x0705('0x6c')]({'where':{'id':_[_0x0705('0x42')](_0x582898,_0x0705('0x6d')),'role':_0x0705('0x6e')},'attributes':['id',_0x0705('0x40'),_0x0705('0x6f'),_0x0705('0x70'),_0x0705('0x71')]});}})[_0x0705('0x26')](function(_0x5851f9){if(_0x5851f9){return{'count':_0x5851f9['count'],'rows':_[_0x0705('0x42')](_0x5851f9[_0x0705('0x5b')],function(_0x571166){return{'membername':_0x571166['name'],'UserId':_0x571166['id'],'queue_name':_0xcd9260['name'],'ChatQueueId':_0xcd9260['id'],'interface':util['format'](_0x0705('0x72'),_0x0705('0x73'),_0x571166[_0x0705('0x40')]),'penalty':0x0,'paused':_0x571166['chatPause'],'createdAt':_0x571166[_0x0705('0x71')],'updatedAt':_0x571166['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x497939,_0x42a271))[_0x0705('0x2e')](handleError(_0x497939,null));};exports['getTeams']=function(_0x2e43f6,_0x270d92,_0x5ad4ac){var _0x36190b={};var _0x45bd7f={};var _0x3f8a5a;var _0x20fccc;return db[_0x0705('0x43')]['findOne']({'where':{'id':_0x2e43f6[_0x0705('0x5c')]['id']}})[_0x0705('0x26')](handleEntityNotFound(_0x270d92,null))['then'](function(_0x22dabf){if(_0x22dabf){_0x3f8a5a=_0x22dabf;_0x45bd7f[_0x0705('0x47')]=_[_0x0705('0x49')](db[_0x0705('0x74')][_0x0705('0x44')]);_0x45bd7f['query']=_['keys'](_0x2e43f6[_0x0705('0x48')]);_0x45bd7f[_0x0705('0x4a')]=_[_0x0705('0x4c')](_0x45bd7f['model'],_0x45bd7f['query']);_0x36190b[_0x0705('0x4b')]=_[_0x0705('0x4c')](_0x45bd7f[_0x0705('0x47')],qs[_0x0705('0x4d')](_0x2e43f6[_0x0705('0x48')][_0x0705('0x4d')]));_0x36190b[_0x0705('0x4b')]=_0x36190b[_0x0705('0x4b')][_0x0705('0x4e')]?_0x36190b[_0x0705('0x4b')]:_0x45bd7f[_0x0705('0x47')];_0x36190b[_0x0705('0x51')]=qs[_0x0705('0x52')](_0x2e43f6[_0x0705('0x48')]['sort']);_0x36190b['where']=qs[_0x0705('0x4a')](_[_0x0705('0x54')](_0x2e43f6[_0x0705('0x48')],_0x45bd7f['filters']));if(_0x2e43f6['query'][_0x0705('0x55')]){_0x36190b[_0x0705('0x53')]=_[_0x0705('0x69')](_0x36190b[_0x0705('0x53')],{'$or':_[_0x0705('0x42')](_0x36190b[_0x0705('0x4b')],function(_0xaab347){var _0x3de1fa={};_0x3de1fa[_0xaab347]={'$like':'%'+_0x2e43f6[_0x0705('0x48')][_0x0705('0x55')]+'%'};return _0x3de1fa;})});}_0x36190b=_[_0x0705('0x69')]({},_0x36190b,_0x2e43f6[_0x0705('0x57')]);return _0x3f8a5a['getTeams'](_0x36190b);}})['then'](function(_0x304da5){if(_0x304da5){_0x20fccc=_0x304da5[_0x0705('0x4e')];if(!_0x2e43f6[_0x0705('0x48')][_0x0705('0x4f')]('nolimit')){_0x36190b[_0x0705('0x32')]=qs[_0x0705('0x32')](_0x2e43f6[_0x0705('0x48')]['limit']);_0x36190b['offset']=qs[_0x0705('0x34')](_0x2e43f6[_0x0705('0x48')][_0x0705('0x34')]);}return _0x3f8a5a[_0x0705('0x75')](_0x36190b);}})[_0x0705('0x26')](function(_0x5ca230){if(_0x5ca230){return _0x5ca230?{'count':_0x20fccc,'rows':_0x5ca230}:null;}})[_0x0705('0x26')](respondWithResult(_0x270d92,null))[_0x0705('0x2e')](handleError(_0x270d92,null));};exports[_0x0705('0x76')]=function(_0x392224,_0x2b74ed,_0x253c59){var _0x1e2cea=_0x392224[_0x0705('0x5f')]['ids'];return db[_0x0705('0x74')][_0x0705('0x5a')]({'where':{'id':_0x1e2cea},'attributes':['id'],'include':[{'model':db[_0x0705('0x6b')],'as':_0x0705('0x77'),'attributes':['id',_0x0705('0x40'),_0x0705('0x78'),_0x0705('0x79'),_0x0705('0x7a')],'raw':!![]}]})[_0x0705('0x26')](function(_0xa6b1d8){if(_0xa6b1d8){var _0x142ce4=_[_0x0705('0x7b')](_0xa6b1d8,function(_0x550494){var _0x1b4464=_0x550494['get']({'plain':!![]});return _0x1b4464['Agents'];});return db['ChatQueue'][_0x0705('0x5d')]({'where':{'id':_0x392224[_0x0705('0x5c')]['id']}})[_0x0705('0x26')](function(_0x4261fe){return db['sequelize'][_0x0705('0x7c')](function(_0x13b722){return _0x4261fe[_0x0705('0x76')](_0x1e2cea,{'transaction':_0x13b722})[_0x0705('0x26')](function(){return BPromise[_0x0705('0x7d')](_0x142ce4,function(_0x4b92a1){return db[_0x0705('0x6a')][_0x0705('0x7e')]({'where':{'UserId':_0x4b92a1['id'],'ChatQueueId':_0x392224[_0x0705('0x5c')]['id']},'transaction':_0x13b722});});})['then'](function(){_0x142ce4[_0x0705('0x7f')](function(_0x18b2b8){socket['emit'](_0x0705('0x80'),{'UserId':_0x18b2b8['id'],'ChatQueueId':_0x4261fe['id']});});});});});}})[_0x0705('0x26')](respondWithStatusCode(_0x2b74ed,null))[_0x0705('0x2e')](handleError(_0x2b74ed,null));};exports[_0x0705('0x81')]=function(_0x110848,_0x361a80,_0x25ebf8){return db[_0x0705('0x74')][_0x0705('0x5a')]({'where':{'id':_0x110848[_0x0705('0x48')]['ids']},'attributes':['id'],'include':[{'model':db[_0x0705('0x6b')],'as':_0x0705('0x77'),'attributes':['id'],'raw':!![]}]})[_0x0705('0x26')](handleEntityNotFound(_0x361a80,null))[_0x0705('0x26')](function(_0x304462){var _0x154933=_['map'](_0x304462,'id');var _0x37095d=[];var _0xdb895f=[];var _0x429d55=squel[_0x0705('0x82')]();_0x429d55[_0x0705('0x83')](_0x0705('0x84'))[_0x0705('0x85')](_0x0705('0x86'),'tq')['join']('user_has_teams','ut',_0x0705('0x87'))['where']('ChatQueueId\x20=\x20?',_0x110848['params']['id']);for(var _0x2f1d2b=0x0;_0x2f1d2b<_0x304462[_0x0705('0x4e')];_0x2f1d2b+=0x1){let _0x567bf8=_0x304462[_0x2f1d2b];for(var _0x3e283f=0x0;_0x3e283f<_0x567bf8[_0x0705('0x77')]['length'];_0x3e283f+=0x1){let _0xf836a3=_0x567bf8[_0x0705('0x77')][_0x3e283f];var _0x134606=_0x429d55['clone']();_0x134606['where'](_0x0705('0x88'),_0xf836a3['id']);_0xdb895f[_0x0705('0x89')](db[_0x0705('0x8a')][_0x0705('0x48')](_0x134606[_0x0705('0x8b')](),{'type':db[_0x0705('0x8a')][_0x0705('0x8c')]['SELECT']})[_0x0705('0x26')](function(_0x1da6ee){if(_0x1da6ee[_0x0705('0x4e')]===0x1){return _0xf836a3['id'];}else{var _0x513203=_[_0x0705('0x8d')](_[_0x0705('0x42')](_0x1da6ee,_0x0705('0x8e')),function(_0x1a990b){return _[_0x0705('0x8f')](_0x154933,_0x1a990b);});if(_0x513203){return _0xf836a3['id'];}}}));}}return BPromise[_0x0705('0x90')](_0xdb895f)[_0x0705('0x26')](function(_0x5065ae){_0x37095d=_(_0x37095d)['union'](_0x5065ae)['compact']()[_0x0705('0x91')]();return db[_0x0705('0x43')][_0x0705('0x5d')]({'where':{'id':_0x110848['params']['id']}})[_0x0705('0x26')](function(_0x18f871){return db[_0x0705('0x8a')]['transaction'](function(_0x169f50){return _0x18f871[_0x0705('0x81')](_0x110848[_0x0705('0x48')]['ids'],{'transaction':_0x169f50})[_0x0705('0x26')](function(){if(!_['isEmpty'](_0x37095d)){return _0x18f871['removeAgents'](_0x37095d,{'transaction':_0x169f50});}})[_0x0705('0x26')](function(){_0x37095d['forEach'](function(_0x862de3){socket[_0x0705('0x92')](_0x0705('0x93'),{'UserId':_0x862de3,'ChatQueueId':_0x18f871['id']});});});});});});})[_0x0705('0x26')](respondWithStatusCode(_0x361a80,null))[_0x0705('0x2e')](handleError(_0x361a80,null));};exports['addAgents']=function(_0x4fbf4e,_0x1f1e1e,_0x10229d){return db[_0x0705('0x43')][_0x0705('0x5d')]({'where':{'id':_0x4fbf4e[_0x0705('0x5c')]['id']}})[_0x0705('0x26')](handleEntityNotFound(_0x1f1e1e,null))[_0x0705('0x26')](function(_0x49aaef){if(_0x49aaef){return _0x49aaef[_0x0705('0x94')](_0x4fbf4e[_0x0705('0x5f')]['ids'],_['omit'](_0x4fbf4e[_0x0705('0x5f')],[_0x0705('0x95'),'id'])||{})['spread'](function(_0x2e0661){for(var _0x47fc19=0x0;_0x47fc19<_0x4fbf4e['body']['ids'][_0x0705('0x4e')];_0x47fc19+=0x1){socket[_0x0705('0x92')](_0x0705('0x80'),{'UserId':Number(_0x4fbf4e['body'][_0x0705('0x95')][_0x47fc19]),'ChatQueueId':Number(_0x4fbf4e[_0x0705('0x5c')]['id'])});}return _0x2e0661;});}})[_0x0705('0x26')](respondWithResult(_0x1f1e1e,null))[_0x0705('0x2e')](handleError(_0x1f1e1e,null));};exports[_0x0705('0x96')]=function(_0x2cc361,_0x5c3aae,_0xcdb51d){return db[_0x0705('0x43')]['find']({'where':{'id':_0x2cc361[_0x0705('0x5c')]['id']}})[_0x0705('0x26')](handleEntityNotFound(_0x5c3aae,null))[_0x0705('0x26')](function(_0x8becac){if(_0x8becac){return _0x8becac[_0x0705('0x96')](_0x2cc361[_0x0705('0x48')][_0x0705('0x95')])[_0x0705('0x26')](function(){if(_['isArray'](_0x2cc361[_0x0705('0x48')][_0x0705('0x95')])){for(var _0x577d1f=0x0;_0x577d1f<_0x2cc361[_0x0705('0x48')]['ids'][_0x0705('0x4e')];_0x577d1f+=0x1){socket['emit'](_0x0705('0x93'),{'UserId':Number(_0x2cc361['query']['ids'][_0x577d1f]),'ChatQueueId':Number(_0x2cc361[_0x0705('0x5c')]['id'])});}}else{socket[_0x0705('0x92')](_0x0705('0x93'),{'UserId':Number(_0x2cc361['query'][_0x0705('0x95')]),'ChatQueueId':Number(_0x2cc361[_0x0705('0x5c')]['id'])});}});}})[_0x0705('0x26')](respondWithStatusCode(_0x5c3aae,null))['catch'](handleError(_0x5c3aae,null));};exports['getAgents']=function(_0x49732a,_0x314c00,_0x12cec1){var _0x73e522={};var _0x1def84={};var _0x594a5f;var _0x79672b;return db[_0x0705('0x43')][_0x0705('0x67')]({'where':{'id':_0x49732a[_0x0705('0x5c')]['id']}})['then'](handleEntityNotFound(_0x314c00,null))[_0x0705('0x26')](function(_0x2b034f){if(_0x2b034f){_0x594a5f=_0x2b034f;_0x1def84[_0x0705('0x47')]=_[_0x0705('0x49')](db[_0x0705('0x6b')][_0x0705('0x44')]);_0x1def84[_0x0705('0x48')]=_['keys'](_0x49732a[_0x0705('0x48')]);_0x1def84['filters']=_[_0x0705('0x4c')](_0x1def84[_0x0705('0x47')],_0x1def84[_0x0705('0x48')]);_0x73e522[_0x0705('0x4b')]=_[_0x0705('0x4c')](_0x1def84[_0x0705('0x47')],qs[_0x0705('0x4d')](_0x49732a[_0x0705('0x48')][_0x0705('0x4d')]));_0x73e522[_0x0705('0x4b')]=_0x73e522[_0x0705('0x4b')][_0x0705('0x4e')]?_0x73e522['attributes']:_0x1def84[_0x0705('0x47')];_0x73e522[_0x0705('0x51')]=qs['sort'](_0x49732a[_0x0705('0x48')][_0x0705('0x52')]);_0x73e522[_0x0705('0x53')]=qs[_0x0705('0x4a')](_['pick'](_0x49732a[_0x0705('0x48')],_0x1def84['filters']));if(_0x49732a[_0x0705('0x48')][_0x0705('0x55')]){_0x73e522['where']=_[_0x0705('0x69')](_0x73e522[_0x0705('0x53')],{'$or':_[_0x0705('0x42')](_0x73e522[_0x0705('0x4b')],function(_0x8e5ec4){var _0xea3b06={};_0xea3b06[_0x8e5ec4]={'$like':'%'+_0x49732a[_0x0705('0x48')]['filter']+'%'};return _0xea3b06;})});}_0x73e522=_[_0x0705('0x69')]({},_0x73e522,_0x49732a['options']);return _0x594a5f[_0x0705('0x97')](_0x73e522);}})[_0x0705('0x26')](function(_0x50d318){if(_0x50d318){_0x79672b=_0x50d318['length'];if(!_0x49732a[_0x0705('0x48')]['hasOwnProperty'](_0x0705('0x50'))){_0x73e522[_0x0705('0x32')]=qs[_0x0705('0x32')](_0x49732a['query'][_0x0705('0x32')]);_0x73e522[_0x0705('0x34')]=qs['offset'](_0x49732a[_0x0705('0x48')][_0x0705('0x34')]);}return _0x594a5f[_0x0705('0x97')](_0x73e522);}})[_0x0705('0x26')](function(_0x1e732a){if(_0x1e732a){return _0x1e732a?{'count':_0x79672b,'rows':_0x1e732a}:null;}})['then'](respondWithResult(_0x314c00,null))['catch'](handleError(_0x314c00,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 007b923..330db24 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 _0x0662=['emit','hasOwnProperty','hook','exports','../../mysqldb','ChatQueue','setMaxListeners','save','remove'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0662,0x175));var _0x2066=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x0662[_0x110c3d];return _0x226d67;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x2066('0x0'))['db'][_0x2066('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x2066('0x2')](0x0);var events={'afterCreate':_0x2066('0x3'),'afterUpdate':'update','afterDestroy':_0x2066('0x4')};function emitEvent(_0x1bef84){return function(_0x782930,_0x278653,_0x1db5d5){ChatQueueEvents[_0x2066('0x5')](_0x1bef84+':'+_0x782930['id'],_0x782930);ChatQueueEvents[_0x2066('0x5')](_0x1bef84,_0x782930);_0x1db5d5(null);};}for(var e in events){if(events[_0x2066('0x6')](e)){var event=events[e];ChatQueue[_0x2066('0x7')](e,emitEvent(event));}}module[_0x2066('0x8')]=ChatQueueEvents; \ No newline at end of file +var _0x083e=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','update'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x083e,0x140));var _0xe083=function(_0x31b350,_0x5be290){_0x31b350=_0x31b350-0x0;var _0x1870dc=_0x083e[_0x31b350];return _0x1870dc;};'use strict';var EventEmitter=require(_0xe083('0x0'));var ChatQueue=require(_0xe083('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xe083('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe083('0x3'),'afterDestroy':_0xe083('0x4')};function emitEvent(_0xaf9304){return function(_0x17205d,_0x1dbcad,_0x3f8ad6){ChatQueueEvents[_0xe083('0x5')](_0xaf9304+':'+_0x17205d['id'],_0x17205d);ChatQueueEvents['emit'](_0xaf9304,_0x17205d);_0x3f8ad6(null);};}for(var e in events){if(events[_0xe083('0x6')](e)){var event=events[e];ChatQueue[_0xe083('0x7')](e,emitEvent(event));}}module[_0xe083('0x8')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index dfddacc..660e26c 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 _0x0a5c=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger','api'];(function(_0x31a755,_0x203ce1){var _0x4aa72b=function(_0xa3568c){while(--_0xa3568c){_0x31a755['push'](_0x31a755['shift']());}};_0x4aa72b(++_0x203ce1);}(_0x0a5c,0x1af));var _0xc0a5=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0x0a5c[_0x42bdad];return _0x122626;};'use strict';var _=require(_0xc0a5('0x0'));var util=require(_0xc0a5('0x1'));var logger=require(_0xc0a5('0x2'))(_0xc0a5('0x3'));var moment=require(_0xc0a5('0x4'));var BPromise=require(_0xc0a5('0x5'));var rp=require(_0xc0a5('0x6'));var fs=require('fs');var path=require(_0xc0a5('0x7'));var rimraf=require(_0xc0a5('0x8'));var config=require(_0xc0a5('0x9'));var attributes=require(_0xc0a5('0xa'));module[_0xc0a5('0xb')]=function(_0x3aaaf6,_0x269c4e){return _0x3aaaf6[_0xc0a5('0xc')](_0xc0a5('0xd'),attributes,{'tableName':_0xc0a5('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5045=['./chatQueue.attributes','exports','ChatQueue','chat_queues','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x36e9d6,_0x354e9b){var _0x1fe0e1=function(_0x535a63){while(--_0x535a63){_0x36e9d6['push'](_0x36e9d6['shift']());}};_0x1fe0e1(++_0x354e9b);}(_0x5045,0x1b4));var _0x5504=function(_0x59e3c2,_0x5d21a8){_0x59e3c2=_0x59e3c2-0x0;var _0x2a0b9f=_0x5045[_0x59e3c2];return _0x2a0b9f;};'use strict';var _=require('lodash');var util=require(_0x5504('0x0'));var logger=require(_0x5504('0x1'))(_0x5504('0x2'));var moment=require(_0x5504('0x3'));var BPromise=require('bluebird');var rp=require(_0x5504('0x4'));var fs=require('fs');var path=require(_0x5504('0x5'));var rimraf=require(_0x5504('0x6'));var config=require(_0x5504('0x7'));var attributes=require(_0x5504('0x8'));module[_0x5504('0x9')]=function(_0x55c8f2,_0x1935af){return _0x55c8f2['define'](_0x5504('0xa'),attributes,{'tableName':_0x5504('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js index 6cbeaf4..6bc5783 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 _0x161a=['../../config/logger','jayson/promise','client','http','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','raw','where','attributes','limit','include','map','model','ShowChatQueue','moment','bluebird','ioredis','../../config/utils'];(function(_0x1b3db4,_0x3be734){var _0x294216=function(_0x3bce45){while(--_0x3bce45){_0x1b3db4['push'](_0x1b3db4['shift']());}};_0x294216(++_0x3be734);}(_0x161a,0x140));var _0xa161=function(_0x2de0a7,_0x38d3e7){_0x2de0a7=_0x2de0a7-0x0;var _0x429437=_0x161a[_0x2de0a7];return _0x429437;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa161('0x0'));var BPromise=require(_0xa161('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa161('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xa161('0x3'));var logger=require(_0xa161('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa161('0x5'));var client=jayson[_0xa161('0x6')][_0xa161('0x7')]({'port':0x232a});config[_0xa161('0x8')]=_[_0xa161('0x9')](config[_0xa161('0x8')],{'host':_0xa161('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa161('0x8')]));require(_0xa161('0xb'))[_0xa161('0xc')](socket);function respondWithRpcPromise(_0x3d3074,_0x306e62,_0x1a3301){return new BPromise(function(_0x1c443e,_0x29f617){return client[_0xa161('0xd')](_0x3d3074,_0x1a3301)[_0xa161('0xe')](function(_0x29574e){logger[_0xa161('0xf')](_0xa161('0x10'),_0x306e62,'request\x20sent');logger[_0xa161('0x11')](_0xa161('0x12'),_0x306e62,_0xa161('0x13'),JSON[_0xa161('0x14')](_0x29574e));if(_0x29574e['error']){if(_0x29574e[_0xa161('0x15')][_0xa161('0x16')]===0x1f4){logger['error'](_0xa161('0x10'),_0x306e62,_0x29574e[_0xa161('0x15')]['message']);return _0x29f617(_0x29574e[_0xa161('0x15')][_0xa161('0x17')]);}logger[_0xa161('0x15')]('ChatQueue,\x20%s,\x20%s',_0x306e62,_0x29574e[_0xa161('0x15')][_0xa161('0x17')]);return _0x1c443e(_0x29574e[_0xa161('0x15')][_0xa161('0x17')]);}else{logger[_0xa161('0xf')](_0xa161('0x10'),_0x306e62,_0xa161('0x13'));_0x1c443e(_0x29574e['result'][_0xa161('0x17')]);}})[_0xa161('0x18')](function(_0x55c558){logger[_0xa161('0x15')]('ChatQueue,\x20%s,\x20%s',_0x306e62,_0x55c558);_0x29f617(_0x55c558);});});}exports[_0xa161('0x19')]=function(_0x3ccf0c){var _0x2dd796=this;return new Promise(function(_0x269d56,_0xf6cd86){return db['ChatQueue'][_0xa161('0x1a')]({'raw':_0x3ccf0c[_0xa161('0x1b')]?_0x3ccf0c[_0xa161('0x1b')][_0xa161('0x1c')]===undefined?!![]:![]:!![],'where':_0x3ccf0c[_0xa161('0x1b')]?_0x3ccf0c[_0xa161('0x1b')][_0xa161('0x1d')]||null:null,'attributes':_0x3ccf0c[_0xa161('0x1b')]?_0x3ccf0c[_0xa161('0x1b')][_0xa161('0x1e')]||null:null,'limit':_0x3ccf0c[_0xa161('0x1b')]?_0x3ccf0c['options'][_0xa161('0x1f')]||null:null,'include':_0x3ccf0c[_0xa161('0x1b')]?_0x3ccf0c[_0xa161('0x1b')][_0xa161('0x20')]?_[_0xa161('0x21')](_0x3ccf0c[_0xa161('0x1b')][_0xa161('0x20')],function(_0x2b1331){return{'model':db[_0x2b1331[_0xa161('0x22')]],'as':_0x2b1331['as'],'attributes':_0x2b1331[_0xa161('0x1e')],'include':_0x2b1331[_0xa161('0x20')]?_['map'](_0x2b1331[_0xa161('0x20')],function(_0x492da1){return{'model':db[_0x492da1[_0xa161('0x22')]],'as':_0x492da1['as'],'attributes':_0x492da1[_0xa161('0x1e')],'include':_0x492da1[_0xa161('0x20')]?_[_0xa161('0x21')](_0x492da1[_0xa161('0x20')],function(_0x20ce3c){return{'model':db[_0x20ce3c[_0xa161('0x22')]],'as':_0x20ce3c['as'],'attributes':_0x20ce3c[_0xa161('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xa161('0xe')](function(_0x150e36){logger[_0xa161('0xf')](_0xa161('0x19'),_0x3ccf0c);logger[_0xa161('0x11')](_0xa161('0x19'),_0x3ccf0c,JSON[_0xa161('0x14')](_0x150e36));_0x269d56(_0x150e36);})['catch'](function(_0x3579b6){logger['error'](_0xa161('0x19'),_0x3579b6['message'],_0x3ccf0c);_0xf6cd86(_0x2dd796[_0xa161('0x15')](0x1f4,_0x3579b6[_0xa161('0x17')]));});});};exports[_0xa161('0x23')]=function(_0x15f3d9){var _0x527870=this;return new Promise(function(_0x306cd5,_0x2a2cdf){return db['ChatQueue']['find']({'raw':_0x15f3d9[_0xa161('0x1b')]?_0x15f3d9['options']['raw']===undefined?!![]:![]:!![],'where':_0x15f3d9['options']?_0x15f3d9[_0xa161('0x1b')][_0xa161('0x1d')]||null:null,'attributes':_0x15f3d9[_0xa161('0x1b')]?_0x15f3d9[_0xa161('0x1b')][_0xa161('0x1e')]||null:null,'include':_0x15f3d9[_0xa161('0x1b')]?_0x15f3d9['options'][_0xa161('0x20')]?_['map'](_0x15f3d9[_0xa161('0x1b')][_0xa161('0x20')],function(_0x56417e){return{'model':db[_0x56417e[_0xa161('0x22')]],'as':_0x56417e['as'],'attributes':_0x56417e[_0xa161('0x1e')],'include':_0x56417e[_0xa161('0x20')]?_['map'](_0x56417e[_0xa161('0x20')],function(_0x305902){return{'model':db[_0x305902[_0xa161('0x22')]],'as':_0x305902['as'],'attributes':_0x305902[_0xa161('0x1e')],'include':_0x305902[_0xa161('0x20')]?_[_0xa161('0x21')](_0x305902[_0xa161('0x20')],function(_0x533a27){return{'model':db[_0x533a27[_0xa161('0x22')]],'as':_0x533a27['as'],'attributes':_0x533a27['attributes']};}):[]};}):[]};}):[]:[]})[_0xa161('0xe')](function(_0x54a278){logger[_0xa161('0xf')](_0xa161('0x23'),_0x15f3d9);logger['debug']('ShowChatQueue',_0x15f3d9,JSON['stringify'](_0x54a278));_0x306cd5(_0x54a278);})[_0xa161('0x18')](function(_0x133f1c){logger[_0xa161('0x15')]('ShowChatQueue',_0x133f1c[_0xa161('0x17')],_0x15f3d9);_0x2a2cdf(_0x527870[_0xa161('0x15')](0x1f4,_0x133f1c[_0xa161('0x17')]));});});}; \ No newline at end of file +var _0x4760=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','map','include','model','attributes','stringify','find','ShowChatQueue','lodash','moment','bluebird','randomstring'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x4760,0x1b4));var _0x0476=function(_0x2c6f61,_0x1c8020){_0x2c6f61=_0x2c6f61-0x0;var _0x266f3f=_0x4760[_0x2c6f61];return _0x266f3f;};'use strict';var _=require(_0x0476('0x0'));var util=require('util');var moment=require(_0x0476('0x1'));var BPromise=require(_0x0476('0x2'));var rs=require(_0x0476('0x3'));var fs=require('fs');var Redis=require(_0x0476('0x4'));var db=require(_0x0476('0x5'))['db'];var utils=require(_0x0476('0x6'));var logger=require('../../config/logger')(_0x0476('0x7'));var config=require(_0x0476('0x8'));var jayson=require(_0x0476('0x9'));var client=jayson[_0x0476('0xa')][_0x0476('0xb')]({'port':0x232a});config[_0x0476('0xc')]=_[_0x0476('0xd')](config[_0x0476('0xc')],{'host':_0x0476('0xe'),'port':0x18eb});var socket=require(_0x0476('0xf'))(new Redis(config['redis']));require('./chatQueue.socket')['register'](socket);function respondWithRpcPromise(_0x57c684,_0x2818b4,_0x2d0c24){return new BPromise(function(_0x35db49,_0x572ec2){return client[_0x0476('0x10')](_0x57c684,_0x2d0c24)[_0x0476('0x11')](function(_0x5aee81){logger[_0x0476('0x12')](_0x0476('0x13'),_0x2818b4,_0x0476('0x14'));logger[_0x0476('0x15')](_0x0476('0x16'),_0x2818b4,_0x0476('0x14'),JSON['stringify'](_0x5aee81));if(_0x5aee81[_0x0476('0x17')]){if(_0x5aee81[_0x0476('0x17')][_0x0476('0x18')]===0x1f4){logger[_0x0476('0x17')](_0x0476('0x13'),_0x2818b4,_0x5aee81['error'][_0x0476('0x19')]);return _0x572ec2(_0x5aee81[_0x0476('0x17')][_0x0476('0x19')]);}logger[_0x0476('0x17')](_0x0476('0x13'),_0x2818b4,_0x5aee81[_0x0476('0x17')][_0x0476('0x19')]);return _0x35db49(_0x5aee81['error'][_0x0476('0x19')]);}else{logger[_0x0476('0x12')](_0x0476('0x13'),_0x2818b4,_0x0476('0x14'));_0x35db49(_0x5aee81[_0x0476('0x1a')]['message']);}})[_0x0476('0x1b')](function(_0x9d1d1a){logger[_0x0476('0x17')](_0x0476('0x13'),_0x2818b4,_0x9d1d1a);_0x572ec2(_0x9d1d1a);});});}exports[_0x0476('0x1c')]=function(_0x4f0fd5){var _0x377188=this;return new Promise(function(_0x328f00,_0x45f854){return db[_0x0476('0x1d')][_0x0476('0x1e')]({'raw':_0x4f0fd5[_0x0476('0x1f')]?_0x4f0fd5[_0x0476('0x1f')][_0x0476('0x20')]===undefined?!![]:![]:!![],'where':_0x4f0fd5['options']?_0x4f0fd5['options']['where']||null:null,'attributes':_0x4f0fd5[_0x0476('0x1f')]?_0x4f0fd5[_0x0476('0x1f')]['attributes']||null:null,'limit':_0x4f0fd5[_0x0476('0x1f')]?_0x4f0fd5[_0x0476('0x1f')]['limit']||null:null,'include':_0x4f0fd5['options']?_0x4f0fd5[_0x0476('0x1f')]['include']?_[_0x0476('0x21')](_0x4f0fd5[_0x0476('0x1f')][_0x0476('0x22')],function(_0x192d27){return{'model':db[_0x192d27[_0x0476('0x23')]],'as':_0x192d27['as'],'attributes':_0x192d27['attributes'],'include':_0x192d27['include']?_[_0x0476('0x21')](_0x192d27[_0x0476('0x22')],function(_0x27ef0){return{'model':db[_0x27ef0['model']],'as':_0x27ef0['as'],'attributes':_0x27ef0[_0x0476('0x24')],'include':_0x27ef0[_0x0476('0x22')]?_[_0x0476('0x21')](_0x27ef0['include'],function(_0xf7d72f){return{'model':db[_0xf7d72f[_0x0476('0x23')]],'as':_0xf7d72f['as'],'attributes':_0xf7d72f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0476('0x11')](function(_0x56384a){logger[_0x0476('0x12')](_0x0476('0x1c'),_0x4f0fd5);logger[_0x0476('0x15')](_0x0476('0x1c'),_0x4f0fd5,JSON[_0x0476('0x25')](_0x56384a));_0x328f00(_0x56384a);})[_0x0476('0x1b')](function(_0xeee617){logger[_0x0476('0x17')]('GetChatQueue',_0xeee617[_0x0476('0x19')],_0x4f0fd5);_0x45f854(_0x377188[_0x0476('0x17')](0x1f4,_0xeee617[_0x0476('0x19')]));});});};exports['ShowChatQueue']=function(_0x252028){var _0x217f4d=this;return new Promise(function(_0x316512,_0x51bfd2){return db[_0x0476('0x1d')][_0x0476('0x26')]({'raw':_0x252028[_0x0476('0x1f')]?_0x252028[_0x0476('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x252028['options']?_0x252028[_0x0476('0x1f')]['where']||null:null,'attributes':_0x252028[_0x0476('0x1f')]?_0x252028['options']['attributes']||null:null,'include':_0x252028[_0x0476('0x1f')]?_0x252028[_0x0476('0x1f')]['include']?_[_0x0476('0x21')](_0x252028['options'][_0x0476('0x22')],function(_0x286b63){return{'model':db[_0x286b63[_0x0476('0x23')]],'as':_0x286b63['as'],'attributes':_0x286b63[_0x0476('0x24')],'include':_0x286b63['include']?_[_0x0476('0x21')](_0x286b63['include'],function(_0x3288b7){return{'model':db[_0x3288b7[_0x0476('0x23')]],'as':_0x3288b7['as'],'attributes':_0x3288b7[_0x0476('0x24')],'include':_0x3288b7[_0x0476('0x22')]?_[_0x0476('0x21')](_0x3288b7[_0x0476('0x22')],function(_0x1baef1){return{'model':db[_0x1baef1[_0x0476('0x23')]],'as':_0x1baef1['as'],'attributes':_0x1baef1[_0x0476('0x24')]};}):[]};}):[]};}):[]:[]})[_0x0476('0x11')](function(_0x2208c7){logger['info'](_0x0476('0x27'),_0x252028);logger['debug'](_0x0476('0x27'),_0x252028,JSON[_0x0476('0x25')](_0x2208c7));_0x316512(_0x2208c7);})[_0x0476('0x1b')](function(_0x2903c2){logger[_0x0476('0x17')](_0x0476('0x27'),_0x2903c2[_0x0476('0x19')],_0x252028);_0x51bfd2(_0x217f4d[_0x0476('0x17')](0x1f4,_0x2903c2[_0x0476('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 4668117..cc8b4cb 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 _0xed1f=['register','length','./chatQueue.events','save','remove','update','emit','removeListener'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xed1f,0x6a));var _0xfed1=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xed1f[_0x178e48];return _0x440d7e;};'use strict';var ChatQueueEvents=require(_0xfed1('0x0'));var events=[_0xfed1('0x1'),_0xfed1('0x2'),_0xfed1('0x3')];function createListener(_0xa45937,_0x25f345){return function(_0x1dd614){_0x25f345[_0xfed1('0x4')](_0xa45937,_0x1dd614);};}function removeListener(_0x2209b3,_0x45c3c1){return function(){ChatQueueEvents[_0xfed1('0x5')](_0x2209b3,_0x45c3c1);};}exports[_0xfed1('0x6')]=function(_0x3d6706){for(var _0x42751d=0x0,_0x380e18=events[_0xfed1('0x7')];_0x42751d<_0x380e18;_0x42751d++){var _0x2a6082=events[_0x42751d];var _0x2967ef=createListener('chatQueue:'+_0x2a6082,_0x3d6706);ChatQueueEvents['on'](_0x2a6082,_0x2967ef);}}; \ No newline at end of file +var _0x0e85=['update','removeListener','register','length','chatQueue:','./chatQueue.events','save'];(function(_0x26005e,_0x481ec1){var _0x16df4b=function(_0xedcaab){while(--_0xedcaab){_0x26005e['push'](_0x26005e['shift']());}};_0x16df4b(++_0x481ec1);}(_0x0e85,0x7c));var _0x50e8=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0x0e85[_0x29d915];return _0x160f86;};'use strict';var ChatQueueEvents=require(_0x50e8('0x0'));var events=[_0x50e8('0x1'),'remove',_0x50e8('0x2')];function createListener(_0x682d10,_0x55e515){return function(_0x55cba3){_0x55e515['emit'](_0x682d10,_0x55cba3);};}function removeListener(_0x236cf3,_0x4e90e7){return function(){ChatQueueEvents[_0x50e8('0x3')](_0x236cf3,_0x4e90e7);};}exports[_0x50e8('0x4')]=function(_0xe3151e){for(var _0xfde42=0x0,_0x5e8b01=events[_0x50e8('0x5')];_0xfde42<_0x5e8b01;_0xfde42++){var _0x108edc=events[_0xfde42];var _0x42665e=createListener(_0x50e8('0x6')+_0x108edc,_0xe3151e);ChatQueueEvents['on'](_0x108edc,_0x42665e);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index afbfb80..0e5c195 100644 --- a/server/api/chatQueue/index.js +++ b/server/api/chatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0x6eae2,_0x5e3b82){var _0x5def02=function(_0x168cad){while(--_0x168cad){_0x6eae2['push'](_0x6eae2['shift']());}};_0x5def02(++_0x5e3b82);}(_0x55ca,0x126));var _0xa55c=function(_0x2e689d,_0x4c3b29){_0x2e689d=_0x2e689d-0x0;var _0x540160=_0x55ca[_0x2e689d];return _0x540160;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('0x19')]=router; \ No newline at end of file +var _0x814b=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x36981f,_0x35de12){var _0x4c1845=function(_0xe1ff6b){while(--_0xe1ff6b){_0x36981f['push'](_0x36981f['shift']());}};_0x4c1845(++_0x35de12);}(_0x814b,0x1a2));var _0xb814=function(_0x166d93,_0x301f09){_0x166d93=_0x166d93-0x0;var _0xba708=_0x814b[_0x166d93];return _0xba708;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0xa')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0xa')](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router['get'](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x15')]);router[_0xb814('0x16')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0x16')](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x18')]);router[_0xb814('0x16')](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x19')]);router[_0xb814('0x1a')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller['destroy']);router[_0xb814('0x1c')]('/:id/teams',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xb814('0x1e')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 37ad961..50ecbe2 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 _0x3072=['DATE','sequelize','exports','STRING'];(function(_0x3bde1b,_0x8f8f7d){var _0x1029f2=function(_0x24ad4c){while(--_0x24ad4c){_0x3bde1b['push'](_0x3bde1b['shift']());}};_0x1029f2(++_0x8f8f7d);}(_0x3072,0xe1));var _0x2307=function(_0x4d9540,_0x26cc84){_0x4d9540=_0x4d9540-0x0;var _0x2d211e=_0x3072[_0x4d9540];return _0x2d211e;};'use strict';var moment=require('moment');var Sequelize=require(_0x2307('0x0'));module[_0x2307('0x1')]={'uniqueid':{'type':Sequelize[_0x2307('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x2307('0x2')]},'joinAt':{'type':Sequelize[_0x2307('0x3')]},'leaveAt':{'type':Sequelize[_0x2307('0x3')]},'acceptAt':{'type':Sequelize[_0x2307('0x3')]},'exitAt':{'type':Sequelize[_0x2307('0x3')]},'reason':{'type':Sequelize[_0x2307('0x2')]}}; \ No newline at end of file +var _0x3c15=['STRING','DATE','sequelize','exports'];(function(_0x48c417,_0x44e01d){var _0x30aa48=function(_0x5e089c){while(--_0x5e089c){_0x48c417['push'](_0x48c417['shift']());}};_0x30aa48(++_0x44e01d);}(_0x3c15,0x172));var _0x53c1=function(_0xf64789,_0x55bdfa){_0xf64789=_0xf64789-0x0;var _0x3622f1=_0x3c15[_0xf64789];return _0x3622f1;};'use strict';var moment=require('moment');var Sequelize=require(_0x53c1('0x0'));module[_0x53c1('0x1')]={'uniqueid':{'type':Sequelize[_0x53c1('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x53c1('0x2')]},'joinAt':{'type':Sequelize[_0x53c1('0x3')]},'leaveAt':{'type':Sequelize[_0x53c1('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x53c1('0x3')]},'reason':{'type':Sequelize[_0x53c1('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 0dadd95..27f02d2 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 _0x1db9=['merge','VIRTUAL','include','findAll','rows','show','keys','includeAll','find','catch','create','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','stack','name','index','map','ChatQueueReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where'];(function(_0x87506e,_0x5680ec){var _0x5496a4=function(_0x1e29ab){while(--_0x1e29ab){_0x87506e['push'](_0x87506e['shift']());}};_0x5496a4(++_0x5680ec);}(_0x1db9,0x176));var _0x91db=function(_0x589032,_0x34c698){_0x589032=_0x589032-0x0;var _0x2df59c=_0x1db9[_0x589032];return _0x2df59c;};'use strict';var emlformat=require(_0x91db('0x0'));var rimraf=require(_0x91db('0x1'));var zipdir=require(_0x91db('0x2'));var jsonpatch=require(_0x91db('0x3'));var rp=require(_0x91db('0x4'));var moment=require(_0x91db('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x91db('0x6'));var util=require(_0x91db('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x91db('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x91db('0x9'));var squel=require(_0x91db('0xa'));var crypto=require(_0x91db('0xb'));var jsforce=require(_0x91db('0xc'));var deskjs=require(_0x91db('0xd'));var toCsv=require('to-csv');var querystring=require(_0x91db('0xe'));var Papa=require('papaparse');var Redis=require(_0x91db('0xf'));var authService=require(_0x91db('0x10'));var qs=require(_0x91db('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x91db('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x91db('0x13'));var licenseUtil=require(_0x91db('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x540c48,_0x2b9b98){_0x2b9b98=_0x2b9b98||0xcc;return function(_0x329277){if(_0x329277){return _0x540c48[_0x91db('0x15')](_0x2b9b98);}return _0x540c48[_0x91db('0x16')](_0x2b9b98)[_0x91db('0x17')]();};}function respondWithResult(_0x4c3124,_0x371158){_0x371158=_0x371158||0xc8;return function(_0x285052){if(_0x285052){return _0x4c3124[_0x91db('0x16')](_0x371158)[_0x91db('0x18')](_0x285052);}};}function respondWithFilteredResult(_0x2df307,_0x33b39d){return function(_0x260b56){if(_0x260b56){var _0x143bc4=typeof _0x33b39d[_0x91db('0x19')]===_0x91db('0x1a')&&typeof _0x33b39d[_0x91db('0x1b')]===_0x91db('0x1a');var _0x5f5440=_0x260b56[_0x91db('0x1c')];var _0x23d125=_0x143bc4?0x0:_0x33b39d[_0x91db('0x19')];var _0x42e66c=_0x143bc4?_0x260b56[_0x91db('0x1c')]:_0x33b39d[_0x91db('0x19')]+_0x33b39d['limit'];var _0x4ae820;if(_0x42e66c>=_0x5f5440){_0x42e66c=_0x5f5440;_0x4ae820=0xc8;}else{_0x4ae820=0xce;}_0x2df307[_0x91db('0x16')](_0x4ae820);return _0x2df307[_0x91db('0x1d')](_0x91db('0x1e'),_0x23d125+'-'+_0x42e66c+'/'+_0x5f5440)[_0x91db('0x18')](_0x260b56);}return null;};}function patchUpdates(_0x50cf9c){return function(_0x168dea){try{jsonpatch[_0x91db('0x1f')](_0x168dea,_0x50cf9c,!![]);}catch(_0x6e3ca6){return BPromise[_0x91db('0x20')](_0x6e3ca6);}return _0x168dea[_0x91db('0x21')]();};}function saveUpdates(_0x31b96c,_0xaad1f6){return function(_0x8e323f){if(_0x8e323f){return _0x8e323f[_0x91db('0x22')](_0x31b96c)[_0x91db('0x23')](function(_0x554454){return _0x554454;});}return null;};}function removeEntity(_0x58774f,_0x134caa){return function(_0x2ac8d5){if(_0x2ac8d5){return _0x2ac8d5['destroy']()[_0x91db('0x23')](function(){_0x58774f[_0x91db('0x16')](0xcc)[_0x91db('0x17')]();});}};}function handleEntityNotFound(_0x6e3a9c,_0x3729d3){return function(_0x4e2a8f){if(!_0x4e2a8f){_0x6e3a9c['sendStatus'](0x194);}return _0x4e2a8f;};}function handleError(_0x42e53f,_0x2f0b86){_0x2f0b86=_0x2f0b86||0x1f4;return function(_0x329118){logger['error'](_0x329118[_0x91db('0x24')]);if(_0x329118[_0x91db('0x25')]){delete _0x329118[_0x91db('0x25')];}_0x42e53f[_0x91db('0x16')](_0x2f0b86)['send'](_0x329118);};}exports[_0x91db('0x26')]=function(_0x2a00d1,_0x1805ef){var _0x49c504={},_0x2ff6c8={},_0x69fdc2={'count':0x0,'rows':[]};var _0x2d3ebd=_[_0x91db('0x27')](db[_0x91db('0x28')][_0x91db('0x29')],function(_0x2e6a27){return{'name':_0x2e6a27[_0x91db('0x2a')],'type':_0x2e6a27[_0x91db('0x2b')][_0x91db('0x2c')]};});_0x2ff6c8[_0x91db('0x2d')]=_[_0x91db('0x27')](_0x2d3ebd,_0x91db('0x25'));_0x2ff6c8[_0x91db('0x2e')]=_['keys'](_0x2a00d1[_0x91db('0x2e')]);_0x2ff6c8[_0x91db('0x2f')]=_[_0x91db('0x30')](_0x2ff6c8[_0x91db('0x2d')],_0x2ff6c8[_0x91db('0x2e')]);_0x49c504['attributes']=_[_0x91db('0x30')](_0x2ff6c8[_0x91db('0x2d')],qs[_0x91db('0x31')](_0x2a00d1['query'][_0x91db('0x31')]));_0x49c504['attributes']=_0x49c504[_0x91db('0x32')][_0x91db('0x33')]?_0x49c504[_0x91db('0x32')]:_0x2ff6c8[_0x91db('0x2d')];if(!_0x2a00d1['query'][_0x91db('0x34')](_0x91db('0x35'))){_0x49c504[_0x91db('0x1b')]=qs['limit'](_0x2a00d1[_0x91db('0x2e')][_0x91db('0x1b')]);_0x49c504['offset']=qs[_0x91db('0x19')](_0x2a00d1[_0x91db('0x2e')]['offset']);}_0x49c504[_0x91db('0x36')]=qs['sort'](_0x2a00d1[_0x91db('0x2e')][_0x91db('0x37')]);_0x49c504['where']=qs['filters'](_['pick'](_0x2a00d1[_0x91db('0x2e')],_0x2ff6c8[_0x91db('0x2f')]),_0x2d3ebd);if(_0x2a00d1['query'][_0x91db('0x38')]){_0x49c504[_0x91db('0x39')]=_[_0x91db('0x3a')](_0x49c504[_0x91db('0x39')],{'$or':_[_0x91db('0x27')](_0x2d3ebd,function(_0x3cccc7){if(_0x3cccc7[_0x91db('0x2b')]!==_0x91db('0x3b')){var _0xcdc472={};_0xcdc472[_0x3cccc7[_0x91db('0x25')]]={'$like':'%'+_0x2a00d1[_0x91db('0x2e')]['filter']+'%'};return _0xcdc472;}})});}_0x49c504=_[_0x91db('0x3a')]({},_0x49c504,_0x2a00d1['options']);var _0x14de6d={'where':_0x49c504[_0x91db('0x39')]};return db['ChatQueueReport'][_0x91db('0x1c')](_0x14de6d)[_0x91db('0x23')](function(_0x16a7e9){_0x69fdc2[_0x91db('0x1c')]=_0x16a7e9;if(_0x2a00d1[_0x91db('0x2e')]['includeAll']){_0x49c504[_0x91db('0x3c')]=[{'all':!![]}];}return db[_0x91db('0x28')][_0x91db('0x3d')](_0x49c504);})['then'](function(_0x4733a4){_0x69fdc2[_0x91db('0x3e')]=_0x4733a4;return _0x69fdc2;})[_0x91db('0x23')](respondWithFilteredResult(_0x1805ef,_0x49c504))['catch'](handleError(_0x1805ef,null));};exports[_0x91db('0x3f')]=function(_0x2b7830,_0x29831c){var _0x3d73a7={'raw':!![],'where':{'id':_0x2b7830['params']['id']}},_0x3609e1={};_0x3609e1[_0x91db('0x2d')]=_['keys'](db[_0x91db('0x28')][_0x91db('0x29')]);_0x3609e1[_0x91db('0x2e')]=_[_0x91db('0x40')](_0x2b7830[_0x91db('0x2e')]);_0x3609e1[_0x91db('0x2f')]=_[_0x91db('0x30')](_0x3609e1[_0x91db('0x2d')],_0x3609e1[_0x91db('0x2e')]);_0x3d73a7[_0x91db('0x32')]=_[_0x91db('0x30')](_0x3609e1['model'],qs['fields'](_0x2b7830[_0x91db('0x2e')][_0x91db('0x31')]));_0x3d73a7[_0x91db('0x32')]=_0x3d73a7['attributes'][_0x91db('0x33')]?_0x3d73a7[_0x91db('0x32')]:_0x3609e1[_0x91db('0x2d')];if(_0x2b7830[_0x91db('0x2e')][_0x91db('0x41')]){_0x3d73a7['include']=[{'all':!![]}];}_0x3d73a7=_[_0x91db('0x3a')]({},_0x3d73a7,_0x2b7830['options']);return db[_0x91db('0x28')][_0x91db('0x42')](_0x3d73a7)[_0x91db('0x23')](handleEntityNotFound(_0x29831c,null))[_0x91db('0x23')](respondWithResult(_0x29831c,null))[_0x91db('0x43')](handleError(_0x29831c,null));};exports[_0x91db('0x44')]=function(_0x17f7b3,_0xd5a8fb){return db[_0x91db('0x28')]['create'](_0x17f7b3['body'],{})[_0x91db('0x23')](respondWithResult(_0xd5a8fb,0xc9))[_0x91db('0x43')](handleError(_0xd5a8fb,null));};exports[_0x91db('0x22')]=function(_0x410423,_0x27e224){if(_0x410423['body']['id']){delete _0x410423[_0x91db('0x45')]['id'];}return db[_0x91db('0x28')][_0x91db('0x42')]({'where':{'id':_0x410423[_0x91db('0x46')]['id']}})[_0x91db('0x23')](handleEntityNotFound(_0x27e224,null))['then'](saveUpdates(_0x410423[_0x91db('0x45')],null))[_0x91db('0x23')](respondWithResult(_0x27e224,null))[_0x91db('0x43')](handleError(_0x27e224,null));};exports[_0x91db('0x47')]=function(_0x50b269,_0x3d8dfb){return db['ChatQueueReport']['find']({'where':{'id':_0x50b269[_0x91db('0x46')]['id']}})['then'](handleEntityNotFound(_0x3d8dfb,null))[_0x91db('0x23')](removeEntity(_0x3d8dfb,null))['catch'](handleError(_0x3d8dfb,null));};exports['describe']=function(_0x2c30ff,_0x371277){return db[_0x91db('0x28')]['describe']()[_0x91db('0x23')](respondWithResult(_0x371277,null))[_0x91db('0x43')](handleError(_0x371277,null));}; \ No newline at end of file +var _0xc7b3=['sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','find','create','body','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x3a75a9,_0x146dfd){var _0x562618=function(_0xb160b2){while(--_0xb160b2){_0x3a75a9['push'](_0x3a75a9['shift']());}};_0x562618(++_0x146dfd);}(_0xc7b3,0x1c6));var _0x3c7b=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xc7b3[_0x11005e];return _0x29338f;};'use strict';var emlformat=require(_0x3c7b('0x0'));var rimraf=require(_0x3c7b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3c7b('0x2'));var rp=require(_0x3c7b('0x3'));var moment=require(_0x3c7b('0x4'));var BPromise=require(_0x3c7b('0x5'));var Mustache=require(_0x3c7b('0x6'));var util=require(_0x3c7b('0x7'));var path=require('path');var sox=require(_0x3c7b('0x8'));var csv=require(_0x3c7b('0x9'));var ejs=require(_0x3c7b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3c7b('0xb'));var squel=require(_0x3c7b('0xc'));var crypto=require('crypto');var jsforce=require(_0x3c7b('0xd'));var deskjs=require(_0x3c7b('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3c7b('0xf'));var Papa=require(_0x3c7b('0x10'));var Redis=require(_0x3c7b('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x3c7b('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3c7b('0x13'));var logger=require(_0x3c7b('0x14'))('api');var utils=require(_0x3c7b('0x15'));var config=require(_0x3c7b('0x16'));var licenseUtil=require(_0x3c7b('0x17'));var db=require(_0x3c7b('0x18'))['db'];function respondWithStatusCode(_0x31b453,_0x4450c6){_0x4450c6=_0x4450c6||0xcc;return function(_0x5d1ba2){if(_0x5d1ba2){return _0x31b453[_0x3c7b('0x19')](_0x4450c6);}return _0x31b453['status'](_0x4450c6)[_0x3c7b('0x1a')]();};}function respondWithResult(_0x2136b8,_0x187049){_0x187049=_0x187049||0xc8;return function(_0x31630d){if(_0x31630d){return _0x2136b8[_0x3c7b('0x1b')](_0x187049)[_0x3c7b('0x1c')](_0x31630d);}};}function respondWithFilteredResult(_0x2b4ee8,_0x18054e){return function(_0x326541){if(_0x326541){var _0x38a02c=typeof _0x18054e[_0x3c7b('0x1d')]===_0x3c7b('0x1e')&&typeof _0x18054e['limit']===_0x3c7b('0x1e');var _0x287d05=_0x326541[_0x3c7b('0x1f')];var _0x457c09=_0x38a02c?0x0:_0x18054e[_0x3c7b('0x1d')];var _0x38a9f6=_0x38a02c?_0x326541[_0x3c7b('0x1f')]:_0x18054e[_0x3c7b('0x1d')]+_0x18054e[_0x3c7b('0x20')];var _0x23d01c;if(_0x38a9f6>=_0x287d05){_0x38a9f6=_0x287d05;_0x23d01c=0xc8;}else{_0x23d01c=0xce;}_0x2b4ee8[_0x3c7b('0x1b')](_0x23d01c);return _0x2b4ee8[_0x3c7b('0x21')](_0x3c7b('0x22'),_0x457c09+'-'+_0x38a9f6+'/'+_0x287d05)[_0x3c7b('0x1c')](_0x326541);}return null;};}function patchUpdates(_0x2f1966){return function(_0x1c4878){try{jsonpatch[_0x3c7b('0x23')](_0x1c4878,_0x2f1966,!![]);}catch(_0xd05d3){return BPromise['reject'](_0xd05d3);}return _0x1c4878[_0x3c7b('0x24')]();};}function saveUpdates(_0x2d93eb,_0x29372e){return function(_0x2a390e){if(_0x2a390e){return _0x2a390e[_0x3c7b('0x25')](_0x2d93eb)[_0x3c7b('0x26')](function(_0x2bcd73){return _0x2bcd73;});}return null;};}function removeEntity(_0x45c647,_0x39575b){return function(_0x29acf5){if(_0x29acf5){return _0x29acf5[_0x3c7b('0x27')]()[_0x3c7b('0x26')](function(){_0x45c647[_0x3c7b('0x1b')](0xcc)[_0x3c7b('0x1a')]();});}};}function handleEntityNotFound(_0x47f23c,_0x5866d2){return function(_0x416f8d){if(!_0x416f8d){_0x47f23c[_0x3c7b('0x19')](0x194);}return _0x416f8d;};}function handleError(_0x4d4193,_0x35b449){_0x35b449=_0x35b449||0x1f4;return function(_0x181097){logger[_0x3c7b('0x28')](_0x181097[_0x3c7b('0x29')]);if(_0x181097[_0x3c7b('0x2a')]){delete _0x181097[_0x3c7b('0x2a')];}_0x4d4193[_0x3c7b('0x1b')](_0x35b449)[_0x3c7b('0x2b')](_0x181097);};}exports[_0x3c7b('0x2c')]=function(_0x528556,_0x4f8d48){var _0x44e5ba={},_0x1162e1={},_0x288fe4={'count':0x0,'rows':[]};var _0x2e5974=_[_0x3c7b('0x2d')](db[_0x3c7b('0x2e')][_0x3c7b('0x2f')],function(_0x3793e6){return{'name':_0x3793e6['fieldName'],'type':_0x3793e6[_0x3c7b('0x30')][_0x3c7b('0x31')]};});_0x1162e1[_0x3c7b('0x32')]=_['map'](_0x2e5974,_0x3c7b('0x2a'));_0x1162e1[_0x3c7b('0x33')]=_[_0x3c7b('0x34')](_0x528556['query']);_0x1162e1[_0x3c7b('0x35')]=_[_0x3c7b('0x36')](_0x1162e1[_0x3c7b('0x32')],_0x1162e1['query']);_0x44e5ba[_0x3c7b('0x37')]=_[_0x3c7b('0x36')](_0x1162e1['model'],qs[_0x3c7b('0x38')](_0x528556[_0x3c7b('0x33')][_0x3c7b('0x38')]));_0x44e5ba['attributes']=_0x44e5ba[_0x3c7b('0x37')][_0x3c7b('0x39')]?_0x44e5ba['attributes']:_0x1162e1['model'];if(!_0x528556[_0x3c7b('0x33')][_0x3c7b('0x3a')]('nolimit')){_0x44e5ba[_0x3c7b('0x20')]=qs[_0x3c7b('0x20')](_0x528556[_0x3c7b('0x33')]['limit']);_0x44e5ba[_0x3c7b('0x1d')]=qs[_0x3c7b('0x1d')](_0x528556[_0x3c7b('0x33')][_0x3c7b('0x1d')]);}_0x44e5ba[_0x3c7b('0x3b')]=qs[_0x3c7b('0x3c')](_0x528556[_0x3c7b('0x33')][_0x3c7b('0x3c')]);_0x44e5ba[_0x3c7b('0x3d')]=qs[_0x3c7b('0x35')](_[_0x3c7b('0x3e')](_0x528556['query'],_0x1162e1[_0x3c7b('0x35')]),_0x2e5974);if(_0x528556[_0x3c7b('0x33')][_0x3c7b('0x3f')]){_0x44e5ba[_0x3c7b('0x3d')]=_['merge'](_0x44e5ba['where'],{'$or':_[_0x3c7b('0x2d')](_0x2e5974,function(_0x215987){if(_0x215987[_0x3c7b('0x30')]!==_0x3c7b('0x40')){var _0x2091a6={};_0x2091a6[_0x215987[_0x3c7b('0x2a')]]={'$like':'%'+_0x528556[_0x3c7b('0x33')][_0x3c7b('0x3f')]+'%'};return _0x2091a6;}})});}_0x44e5ba=_[_0x3c7b('0x41')]({},_0x44e5ba,_0x528556[_0x3c7b('0x42')]);var _0x324898={'where':_0x44e5ba['where']};return db[_0x3c7b('0x2e')][_0x3c7b('0x1f')](_0x324898)[_0x3c7b('0x26')](function(_0x57025a){_0x288fe4[_0x3c7b('0x1f')]=_0x57025a;if(_0x528556[_0x3c7b('0x33')][_0x3c7b('0x43')]){_0x44e5ba[_0x3c7b('0x44')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x3c7b('0x45')](_0x44e5ba);})[_0x3c7b('0x26')](function(_0x3abc48){_0x288fe4[_0x3c7b('0x46')]=_0x3abc48;return _0x288fe4;})[_0x3c7b('0x26')](respondWithFilteredResult(_0x4f8d48,_0x44e5ba))[_0x3c7b('0x47')](handleError(_0x4f8d48,null));};exports['show']=function(_0x2afd92,_0x38f8ab){var _0xd58cbf={'raw':!![],'where':{'id':_0x2afd92['params']['id']}},_0x44828e={};_0x44828e['model']=_[_0x3c7b('0x34')](db[_0x3c7b('0x2e')][_0x3c7b('0x2f')]);_0x44828e[_0x3c7b('0x33')]=_[_0x3c7b('0x34')](_0x2afd92['query']);_0x44828e[_0x3c7b('0x35')]=_[_0x3c7b('0x36')](_0x44828e['model'],_0x44828e['query']);_0xd58cbf[_0x3c7b('0x37')]=_[_0x3c7b('0x36')](_0x44828e[_0x3c7b('0x32')],qs[_0x3c7b('0x38')](_0x2afd92[_0x3c7b('0x33')]['fields']));_0xd58cbf[_0x3c7b('0x37')]=_0xd58cbf['attributes'][_0x3c7b('0x39')]?_0xd58cbf[_0x3c7b('0x37')]:_0x44828e[_0x3c7b('0x32')];if(_0x2afd92['query'][_0x3c7b('0x43')]){_0xd58cbf['include']=[{'all':!![]}];}_0xd58cbf=_['merge']({},_0xd58cbf,_0x2afd92[_0x3c7b('0x42')]);return db[_0x3c7b('0x2e')][_0x3c7b('0x48')](_0xd58cbf)[_0x3c7b('0x26')](handleEntityNotFound(_0x38f8ab,null))['then'](respondWithResult(_0x38f8ab,null))[_0x3c7b('0x47')](handleError(_0x38f8ab,null));};exports[_0x3c7b('0x49')]=function(_0x568ab8,_0x4d28eb){return db[_0x3c7b('0x2e')]['create'](_0x568ab8['body'],{})[_0x3c7b('0x26')](respondWithResult(_0x4d28eb,0xc9))[_0x3c7b('0x47')](handleError(_0x4d28eb,null));};exports['update']=function(_0x332f6d,_0x5412d1){if(_0x332f6d[_0x3c7b('0x4a')]['id']){delete _0x332f6d[_0x3c7b('0x4a')]['id'];}return db[_0x3c7b('0x2e')][_0x3c7b('0x48')]({'where':{'id':_0x332f6d[_0x3c7b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5412d1,null))[_0x3c7b('0x26')](saveUpdates(_0x332f6d[_0x3c7b('0x4a')],null))[_0x3c7b('0x26')](respondWithResult(_0x5412d1,null))[_0x3c7b('0x47')](handleError(_0x5412d1,null));};exports['destroy']=function(_0xbf374d,_0xccab2d){return db['ChatQueueReport'][_0x3c7b('0x48')]({'where':{'id':_0xbf374d[_0x3c7b('0x4b')]['id']}})[_0x3c7b('0x26')](handleEntityNotFound(_0xccab2d,null))[_0x3c7b('0x26')](removeEntity(_0xccab2d,null))['catch'](handleError(_0xccab2d,null));};exports[_0x3c7b('0x4c')]=function(_0x5d1dd6,_0xd0634a){return db[_0x3c7b('0x2e')][_0x3c7b('0x4c')]()['then'](respondWithResult(_0xd0634a,null))[_0x3c7b('0x47')](handleError(_0xd0634a,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 4487deb..19dada4 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 _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x2e6448,_0x417d91){var _0xfb736b=function(_0x2b0a86){while(--_0x2b0a86){_0x2e6448['push'](_0x2e6448['shift']());}};_0xfb736b(++_0x417d91);}(_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 logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x3072e2,_0x648a09){var _0x42c45b=function(_0x2ddff5){while(--_0x2ddff5){_0x3072e2['push'](_0x3072e2['shift']());}};_0x42c45b(++_0x648a09);}(_0xe706,0xa3));var _0x6e70=function(_0xcad01d,_0xef9abc){_0xcad01d=_0xcad01d-0x0;var _0x76a4a6=_0xe706[_0xcad01d];return _0x76a4a6;};'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 diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index ca42ea3..78d319a 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 _0x0056=['message','catch','CreateChatQueueReport','body','options','raw','stringify','ChatQueueReport','attributes','limit','UpdateChatQueueReport','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x231b2e,_0x2a33f9){var _0x3feb2a=function(_0x5aa472){while(--_0x5aa472){_0x231b2e['push'](_0x231b2e['shift']());}};_0x3feb2a(++_0x2a33f9);}(_0x0056,0xdb));var _0x6005=function(_0x5bc5fe,_0x2afaef){_0x5bc5fe=_0x5bc5fe-0x0;var _0x298ea7=_0x0056[_0x5bc5fe];return _0x298ea7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6005('0x0'));var BPromise=require(_0x6005('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6005('0x2'));var db=require(_0x6005('0x3'))['db'];var utils=require(_0x6005('0x4'));var logger=require(_0x6005('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6005('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ee6d4,_0x377a38,_0x3aef8a){return new BPromise(function(_0x58491d,_0xa09a6b){return client[_0x6005('0x7')](_0x3ee6d4,_0x3aef8a)[_0x6005('0x8')](function(_0x33d361){logger[_0x6005('0x9')](_0x6005('0xa'),_0x377a38,_0x6005('0xb'));logger[_0x6005('0xc')](_0x6005('0xd'),_0x377a38,_0x6005('0xb'),JSON['stringify'](_0x33d361));if(_0x33d361[_0x6005('0xe')]){if(_0x33d361[_0x6005('0xe')]['code']===0x1f4){logger[_0x6005('0xe')]('ChatQueueReport,\x20%s,\x20%s',_0x377a38,_0x33d361[_0x6005('0xe')][_0x6005('0xf')]);return _0xa09a6b(_0x33d361[_0x6005('0xe')][_0x6005('0xf')]);}logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x377a38,_0x33d361[_0x6005('0xe')][_0x6005('0xf')]);return _0x58491d(_0x33d361[_0x6005('0xe')]['message']);}else{logger[_0x6005('0x9')]('ChatQueueReport,\x20%s,\x20%s',_0x377a38,_0x6005('0xb'));_0x58491d(_0x33d361['result'][_0x6005('0xf')]);}})[_0x6005('0x10')](function(_0x1217f0){logger['error'](_0x6005('0xa'),_0x377a38,_0x1217f0);_0xa09a6b(_0x1217f0);});});}exports[_0x6005('0x11')]=function(_0xf4207a){var _0x4a40c6=this;return new Promise(function(_0x41e7d3,_0x4c0b40){return db['ChatQueueReport']['create'](_0xf4207a[_0x6005('0x12')],{'raw':_0xf4207a[_0x6005('0x13')]?_0xf4207a[_0x6005('0x13')][_0x6005('0x14')]===undefined?!![]:![]:!![]})['then'](function(_0x53c30b){logger[_0x6005('0x9')](_0x6005('0x11'),_0xf4207a);logger[_0x6005('0xc')]('CreateChatQueueReport',_0xf4207a,JSON[_0x6005('0x15')](_0x53c30b));_0x41e7d3(_0x53c30b);})[_0x6005('0x10')](function(_0x213c90){logger[_0x6005('0xe')]('CreateChatQueueReport',_0x213c90[_0x6005('0xf')],_0xf4207a);_0x4c0b40(_0x4a40c6[_0x6005('0xe')](0x1f4,_0x213c90[_0x6005('0xf')]));});});};exports['UpdateChatQueueReport']=function(_0x59f6c9){var _0x3d4d90=this;return new Promise(function(_0x5a8474,_0x4659a4){return db[_0x6005('0x16')]['update'](_0x59f6c9['body'],{'raw':_0x59f6c9[_0x6005('0x13')]?_0x59f6c9[_0x6005('0x13')][_0x6005('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59f6c9['options']?_0x59f6c9[_0x6005('0x13')]['where']||null:null,'attributes':_0x59f6c9[_0x6005('0x13')]?_0x59f6c9[_0x6005('0x13')][_0x6005('0x17')]||null:null,'limit':_0x59f6c9[_0x6005('0x13')]?_0x59f6c9[_0x6005('0x13')][_0x6005('0x18')]||null:null})[_0x6005('0x8')](function(_0x576390){logger[_0x6005('0x9')](_0x6005('0x19'),_0x59f6c9);logger['debug']('UpdateChatQueueReport',_0x59f6c9,JSON['stringify'](_0x576390));_0x5a8474(_0x576390);})['catch'](function(_0x58223c){logger['error']('UpdateChatQueueReport',_0x58223c['message'],_0x59f6c9);_0x4659a4(_0x3d4d90[_0x6005('0xe')](0x1f4,_0x58223c[_0x6005('0xf')]));});});}; \ No newline at end of file +var _0x7e37=['UpdateChatQueueReport','update','where','attributes','limit','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw'];(function(_0x5aa53a,_0x1e952f){var _0x37b309=function(_0x5c3ab3){while(--_0x5c3ab3){_0x5aa53a['push'](_0x5aa53a['shift']());}};_0x37b309(++_0x1e952f);}(_0x7e37,0xf3));var _0x77e3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7e37[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x77e3('0x0'));var util=require(_0x77e3('0x1'));var moment=require(_0x77e3('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x77e3('0x3'));var db=require(_0x77e3('0x4'))['db'];var utils=require(_0x77e3('0x5'));var logger=require(_0x77e3('0x6'))(_0x77e3('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x77e3('0x8')][_0x77e3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xcb6b7,_0x377126,_0x3cedb1){return new BPromise(function(_0xc56c2,_0x5ed9fb){return client[_0x77e3('0xa')](_0xcb6b7,_0x3cedb1)[_0x77e3('0xb')](function(_0x3b9b35){logger['info'](_0x77e3('0xc'),_0x377126,_0x77e3('0xd'));logger[_0x77e3('0xe')](_0x77e3('0xf'),_0x377126,_0x77e3('0xd'),JSON[_0x77e3('0x10')](_0x3b9b35));if(_0x3b9b35[_0x77e3('0x11')]){if(_0x3b9b35['error'][_0x77e3('0x12')]===0x1f4){logger[_0x77e3('0x11')](_0x77e3('0xc'),_0x377126,_0x3b9b35[_0x77e3('0x11')][_0x77e3('0x13')]);return _0x5ed9fb(_0x3b9b35[_0x77e3('0x11')][_0x77e3('0x13')]);}logger[_0x77e3('0x11')](_0x77e3('0xc'),_0x377126,_0x3b9b35[_0x77e3('0x11')][_0x77e3('0x13')]);return _0xc56c2(_0x3b9b35['error']['message']);}else{logger[_0x77e3('0x14')]('ChatQueueReport,\x20%s,\x20%s',_0x377126,'request\x20sent');_0xc56c2(_0x3b9b35[_0x77e3('0x15')][_0x77e3('0x13')]);}})[_0x77e3('0x16')](function(_0x3d2090){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x377126,_0x3d2090);_0x5ed9fb(_0x3d2090);});});}exports[_0x77e3('0x17')]=function(_0x35b769){var _0x3a8f6b=this;return new Promise(function(_0x53a834,_0xc0dba2){return db[_0x77e3('0x18')][_0x77e3('0x19')](_0x35b769[_0x77e3('0x1a')],{'raw':_0x35b769[_0x77e3('0x1b')]?_0x35b769[_0x77e3('0x1b')][_0x77e3('0x1c')]===undefined?!![]:![]:!![]})[_0x77e3('0xb')](function(_0x10dcfb){logger[_0x77e3('0x14')](_0x77e3('0x17'),_0x35b769);logger['debug'](_0x77e3('0x17'),_0x35b769,JSON[_0x77e3('0x10')](_0x10dcfb));_0x53a834(_0x10dcfb);})[_0x77e3('0x16')](function(_0x12dc4a){logger['error']('CreateChatQueueReport',_0x12dc4a[_0x77e3('0x13')],_0x35b769);_0xc0dba2(_0x3a8f6b[_0x77e3('0x11')](0x1f4,_0x12dc4a[_0x77e3('0x13')]));});});};exports[_0x77e3('0x1d')]=function(_0x15bde9){var _0x572309=this;return new Promise(function(_0x44ae6a,_0x3c4a74){return db[_0x77e3('0x18')][_0x77e3('0x1e')](_0x15bde9[_0x77e3('0x1a')],{'raw':_0x15bde9[_0x77e3('0x1b')]?_0x15bde9[_0x77e3('0x1b')][_0x77e3('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x15bde9[_0x77e3('0x1b')]?_0x15bde9[_0x77e3('0x1b')][_0x77e3('0x1f')]||null:null,'attributes':_0x15bde9[_0x77e3('0x1b')]?_0x15bde9[_0x77e3('0x1b')][_0x77e3('0x20')]||null:null,'limit':_0x15bde9[_0x77e3('0x1b')]?_0x15bde9[_0x77e3('0x1b')][_0x77e3('0x21')]||null:null})['then'](function(_0x9b3d3f){logger[_0x77e3('0x14')](_0x77e3('0x1d'),_0x15bde9);logger['debug'](_0x77e3('0x1d'),_0x15bde9,JSON['stringify'](_0x9b3d3f));_0x44ae6a(_0x9b3d3f);})[_0x77e3('0x16')](function(_0x2be6e4){logger[_0x77e3('0x11')](_0x77e3('0x1d'),_0x2be6e4[_0x77e3('0x13')],_0x15bde9);_0x3c4a74(_0x572309[_0x77e3('0x11')](0x1f4,_0x2be6e4[_0x77e3('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 5cbe377..4dd293b 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 _0x2631=['destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','post','create','update','delete','/:id'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2631,0x6a));var _0x1263=function(_0x447fe7,_0x340107){_0x447fe7=_0x447fe7-0x0;var _0x539c72=_0x2631[_0x447fe7];return _0x539c72;};'use strict';var multer=require(_0x1263('0x0'));var util=require(_0x1263('0x1'));var path=require(_0x1263('0x2'));var timeout=require(_0x1263('0x3'));var express=require(_0x1263('0x4'));var router=express[_0x1263('0x5')]();var fs_extra=require(_0x1263('0x6'));var auth=require(_0x1263('0x7'));var interaction=require(_0x1263('0x8'));var config=require(_0x1263('0x9'));var controller=require(_0x1263('0xa'));router[_0x1263('0xb')]('/',auth[_0x1263('0xc')](),controller[_0x1263('0xd')]);router['get'](_0x1263('0xe'),auth['isAuthenticated'](),controller['describe']);router[_0x1263('0xb')]('/:id',auth[_0x1263('0xc')](),controller['show']);router[_0x1263('0xf')]('/',auth[_0x1263('0xc')](),controller[_0x1263('0x10')]);router['put']('/:id',auth[_0x1263('0xc')](),controller[_0x1263('0x11')]);router[_0x1263('0x12')](_0x1263('0x13'),auth[_0x1263('0xc')](),controller[_0x1263('0x14')]);module['exports']=router; \ No newline at end of file +var _0xf080=['destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show','put','update','delete'];(function(_0x532d78,_0x25b6a8){var _0x5990c4=function(_0x3f23fe){while(--_0x3f23fe){_0x532d78['push'](_0x532d78['shift']());}};_0x5990c4(++_0x25b6a8);}(_0xf080,0x74));var _0x0f08=function(_0x4dfc32,_0x2d9f40){_0x4dfc32=_0x4dfc32-0x0;var _0x2e7ae6=_0xf080[_0x4dfc32];return _0x2e7ae6;};'use strict';var multer=require(_0x0f08('0x0'));var util=require(_0x0f08('0x1'));var path=require('path');var timeout=require(_0x0f08('0x2'));var express=require(_0x0f08('0x3'));var router=express[_0x0f08('0x4')]();var fs_extra=require(_0x0f08('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0f08('0x6'));var controller=require(_0x0f08('0x7'));router[_0x0f08('0x8')]('/',auth[_0x0f08('0x9')](),controller[_0x0f08('0xa')]);router['get'](_0x0f08('0xb'),auth[_0x0f08('0x9')](),controller['describe']);router[_0x0f08('0x8')](_0x0f08('0xc'),auth[_0x0f08('0x9')](),controller[_0x0f08('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x0f08('0xe')](_0x0f08('0xc'),auth[_0x0f08('0x9')](),controller[_0x0f08('0xf')]);router[_0x0f08('0x10')](_0x0f08('0xc'),auth[_0x0f08('0x9')](),controller[_0x0f08('0x11')]);module[_0x0f08('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 13145f6..a3a3db8 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 _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x3ba74d,_0x3e0456){var _0x3bcd85=function(_0x464df6){while(--_0x464df6){_0x3ba74d['push'](_0x3ba74d['shift']());}};_0x3bcd85(++_0x3e0456);}(_0xaa88,0x137));var _0x8aa8=function(_0x5ce15c,_0x19c917){_0x5ce15c=_0x5ce15c-0x0;var _0x36e4f5=_0xaa88[_0x5ce15c];return _0x36e4f5;};'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 _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x5e4bec,_0xed6336){var _0x3a6c7a=function(_0x3b111b){while(--_0x3b111b){_0x5e4bec['push'](_0x5e4bec['shift']());}};_0x3a6c7a(++_0xed6336);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x57d370,_0x3ed0f6){_0x57d370=_0x57d370-0x0;var _0x550fd2=_0xf3cd[_0x57d370];return _0x550fd2;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index ecc89ae..97f67c1 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 _0x8972=['lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','then','destroy','error','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','name','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','filter','merge','options','includeAll','findAll','rows','show','params','include','find','create','catch','update','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x319a7a,_0x1d3fef){var _0xd50de4=function(_0x435c1f){while(--_0x435c1f){_0x319a7a['push'](_0x319a7a['shift']());}};_0xd50de4(++_0x1d3fef);}(_0x8972,0xd8));var _0x2897=function(_0x44c7ce,_0x5eea1b){_0x44c7ce=_0x44c7ce-0x0;var _0x2fee57=_0x8972[_0x44c7ce];return _0x2fee57;};'use strict';var emlformat=require(_0x2897('0x0'));var rimraf=require(_0x2897('0x1'));var zipdir=require(_0x2897('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2897('0x3'));var moment=require(_0x2897('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2897('0x5'));var util=require(_0x2897('0x6'));var path=require(_0x2897('0x7'));var sox=require(_0x2897('0x8'));var csv=require(_0x2897('0x9'));var ejs=require(_0x2897('0xa'));var fs=require('fs');var fs_extra=require(_0x2897('0xb'));var _=require(_0x2897('0xc'));var squel=require(_0x2897('0xd'));var crypto=require(_0x2897('0xe'));var jsforce=require(_0x2897('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2897('0x10'));var Papa=require('papaparse');var Redis=require(_0x2897('0x11'));var authService=require(_0x2897('0x12'));var qs=require(_0x2897('0x13'));var as=require(_0x2897('0x14'));var hardwareService=require(_0x2897('0x15'));var logger=require(_0x2897('0x16'))(_0x2897('0x17'));var utils=require('../../config/utils');var config=require(_0x2897('0x18'));var licenseUtil=require(_0x2897('0x19'));var db=require(_0x2897('0x1a'))['db'];function respondWithStatusCode(_0x1e13ea,_0x14bcba){_0x14bcba=_0x14bcba||0xcc;return function(_0x5cc092){if(_0x5cc092){return _0x1e13ea[_0x2897('0x1b')](_0x14bcba);}return _0x1e13ea[_0x2897('0x1c')](_0x14bcba)[_0x2897('0x1d')]();};}function respondWithResult(_0x18d5ce,_0x333dee){_0x333dee=_0x333dee||0xc8;return function(_0x10e536){if(_0x10e536){return _0x18d5ce['status'](_0x333dee)[_0x2897('0x1e')](_0x10e536);}};}function respondWithFilteredResult(_0x476997,_0x36ea56){return function(_0x22e07c){if(_0x22e07c){var _0x3eedaf=typeof _0x36ea56[_0x2897('0x1f')]===_0x2897('0x20')&&typeof _0x36ea56[_0x2897('0x21')]===_0x2897('0x20');var _0x30215c=_0x22e07c['count'];var _0x5298dd=_0x3eedaf?0x0:_0x36ea56[_0x2897('0x1f')];var _0x2e5e07=_0x3eedaf?_0x22e07c[_0x2897('0x22')]:_0x36ea56[_0x2897('0x1f')]+_0x36ea56[_0x2897('0x21')];var _0x531de5;if(_0x2e5e07>=_0x30215c){_0x2e5e07=_0x30215c;_0x531de5=0xc8;}else{_0x531de5=0xce;}_0x476997['status'](_0x531de5);return _0x476997[_0x2897('0x23')](_0x2897('0x24'),_0x5298dd+'-'+_0x2e5e07+'/'+_0x30215c)['json'](_0x22e07c);}return null;};}function patchUpdates(_0x6fa1af){return function(_0x30f920){try{jsonpatch['apply'](_0x30f920,_0x6fa1af,!![]);}catch(_0x3f14ac){return BPromise['reject'](_0x3f14ac);}return _0x30f920[_0x2897('0x25')]();};}function saveUpdates(_0x1929da,_0x2eb70a){return function(_0xcca818){if(_0xcca818){return _0xcca818['update'](_0x1929da)[_0x2897('0x26')](function(_0x576799){return _0x576799;});}return null;};}function removeEntity(_0x21fb77,_0x53de22){return function(_0x59758c){if(_0x59758c){return _0x59758c[_0x2897('0x27')]()[_0x2897('0x26')](function(){_0x21fb77[_0x2897('0x1c')](0xcc)[_0x2897('0x1d')]();});}};}function handleEntityNotFound(_0x4857ff,_0x15a823){return function(_0x56da22){if(!_0x56da22){_0x4857ff['sendStatus'](0x194);}return _0x56da22;};}function handleError(_0x4e62ac,_0x37a20e){_0x37a20e=_0x37a20e||0x1f4;return function(_0x55374f){logger[_0x2897('0x28')](_0x55374f['stack']);if(_0x55374f['name']){delete _0x55374f['name'];}_0x4e62ac['status'](_0x37a20e)[_0x2897('0x29')](_0x55374f);};}exports[_0x2897('0x2a')]=function(_0x942599,_0x84bc74){var _0x3bb17d={},_0x8c4c32={},_0x118288={'count':0x0,'rows':[]};var _0x21579f=_[_0x2897('0x2b')](db[_0x2897('0x2c')][_0x2897('0x2d')],function(_0x2623da){return{'name':_0x2623da[_0x2897('0x2e')],'type':_0x2623da[_0x2897('0x2f')]['key']};});_0x8c4c32['model']=_[_0x2897('0x2b')](_0x21579f,_0x2897('0x30'));_0x8c4c32[_0x2897('0x31')]=_[_0x2897('0x32')](_0x942599[_0x2897('0x31')]);_0x8c4c32[_0x2897('0x33')]=_[_0x2897('0x34')](_0x8c4c32['model'],_0x8c4c32[_0x2897('0x31')]);_0x3bb17d['attributes']=_[_0x2897('0x34')](_0x8c4c32[_0x2897('0x35')],qs['fields'](_0x942599['query'][_0x2897('0x36')]));_0x3bb17d[_0x2897('0x37')]=_0x3bb17d['attributes'][_0x2897('0x38')]?_0x3bb17d[_0x2897('0x37')]:_0x8c4c32[_0x2897('0x35')];if(!_0x942599['query']['hasOwnProperty'](_0x2897('0x39'))){_0x3bb17d[_0x2897('0x21')]=qs['limit'](_0x942599[_0x2897('0x31')][_0x2897('0x21')]);_0x3bb17d[_0x2897('0x1f')]=qs[_0x2897('0x1f')](_0x942599[_0x2897('0x31')][_0x2897('0x1f')]);}_0x3bb17d[_0x2897('0x3a')]=qs[_0x2897('0x3b')](_0x942599[_0x2897('0x31')][_0x2897('0x3b')]);_0x3bb17d[_0x2897('0x3c')]=qs[_0x2897('0x33')](_['pick'](_0x942599['query'],_0x8c4c32[_0x2897('0x33')]),_0x21579f);if(_0x942599[_0x2897('0x31')][_0x2897('0x3d')]){_0x3bb17d[_0x2897('0x3c')]=_[_0x2897('0x3e')](_0x3bb17d[_0x2897('0x3c')],{'$or':_[_0x2897('0x2b')](_0x21579f,function(_0x1a49cd){if(_0x1a49cd[_0x2897('0x2f')]!=='VIRTUAL'){var _0x5ded23={};_0x5ded23[_0x1a49cd['name']]={'$like':'%'+_0x942599[_0x2897('0x31')][_0x2897('0x3d')]+'%'};return _0x5ded23;}})});}_0x3bb17d=_[_0x2897('0x3e')]({},_0x3bb17d,_0x942599[_0x2897('0x3f')]);var _0x2b21af={'where':_0x3bb17d['where']};return db[_0x2897('0x2c')][_0x2897('0x22')](_0x2b21af)[_0x2897('0x26')](function(_0x2dc83a){_0x118288[_0x2897('0x22')]=_0x2dc83a;if(_0x942599[_0x2897('0x31')][_0x2897('0x40')]){_0x3bb17d['include']=[{'all':!![]}];}return db[_0x2897('0x2c')][_0x2897('0x41')](_0x3bb17d);})[_0x2897('0x26')](function(_0x5e6993){_0x118288[_0x2897('0x42')]=_0x5e6993;return _0x118288;})['then'](respondWithFilteredResult(_0x84bc74,_0x3bb17d))['catch'](handleError(_0x84bc74,null));};exports[_0x2897('0x43')]=function(_0x53f349,_0x314bba){var _0x1394dc={'raw':!![],'where':{'id':_0x53f349[_0x2897('0x44')]['id']}},_0x604c4c={};_0x604c4c['model']=_[_0x2897('0x32')](db[_0x2897('0x2c')][_0x2897('0x2d')]);_0x604c4c[_0x2897('0x31')]=_['keys'](_0x53f349[_0x2897('0x31')]);_0x604c4c[_0x2897('0x33')]=_[_0x2897('0x34')](_0x604c4c[_0x2897('0x35')],_0x604c4c[_0x2897('0x31')]);_0x1394dc[_0x2897('0x37')]=_[_0x2897('0x34')](_0x604c4c[_0x2897('0x35')],qs[_0x2897('0x36')](_0x53f349[_0x2897('0x31')][_0x2897('0x36')]));_0x1394dc[_0x2897('0x37')]=_0x1394dc['attributes'][_0x2897('0x38')]?_0x1394dc[_0x2897('0x37')]:_0x604c4c['model'];if(_0x53f349[_0x2897('0x31')][_0x2897('0x40')]){_0x1394dc[_0x2897('0x45')]=[{'all':!![]}];}_0x1394dc=_[_0x2897('0x3e')]({},_0x1394dc,_0x53f349['options']);return db['ChatTransferReport'][_0x2897('0x46')](_0x1394dc)[_0x2897('0x26')](handleEntityNotFound(_0x314bba,null))['then'](respondWithResult(_0x314bba,null))['catch'](handleError(_0x314bba,null));};exports[_0x2897('0x47')]=function(_0x39fd1b,_0x563803){return db[_0x2897('0x2c')][_0x2897('0x47')](_0x39fd1b['body'],{})[_0x2897('0x26')](respondWithResult(_0x563803,0xc9))[_0x2897('0x48')](handleError(_0x563803,null));};exports[_0x2897('0x49')]=function(_0x4b4317,_0x248e51){if(_0x4b4317[_0x2897('0x4a')]['id']){delete _0x4b4317['body']['id'];}return db[_0x2897('0x2c')]['find']({'where':{'id':_0x4b4317[_0x2897('0x44')]['id']}})[_0x2897('0x26')](handleEntityNotFound(_0x248e51,null))['then'](saveUpdates(_0x4b4317[_0x2897('0x4a')],null))[_0x2897('0x26')](respondWithResult(_0x248e51,null))[_0x2897('0x48')](handleError(_0x248e51,null));};exports[_0x2897('0x27')]=function(_0x22a301,_0x52a166){return db['ChatTransferReport']['find']({'where':{'id':_0x22a301[_0x2897('0x44')]['id']}})[_0x2897('0x26')](handleEntityNotFound(_0x52a166,null))['then'](removeEntity(_0x52a166,null))[_0x2897('0x48')](handleError(_0x52a166,null));};exports[_0x2897('0x4b')]=function(_0x49cbed,_0x25f9d9){return db[_0x2897('0x2c')][_0x2897('0x4b')]()['then'](respondWithResult(_0x25f9d9,null))[_0x2897('0x48')](handleError(_0x25f9d9,null));}; \ No newline at end of file +var _0x9714=['attributes','intersection','fields','length','hasOwnProperty','nolimit','where','filters','filter','merge','VIRTUAL','options','ChatTransferReport','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','eml-format','zip-dir','moment','util','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys'];(function(_0xa9a245,_0x2a0387){var _0x2d0eaa=function(_0x2bba86){while(--_0x2bba86){_0xa9a245['push'](_0xa9a245['shift']());}};_0x2d0eaa(++_0x2a0387);}(_0x9714,0xa8));var _0x4971=function(_0x37e886,_0x17d0ad){_0x37e886=_0x37e886-0x0;var _0x57c5cd=_0x9714[_0x37e886];return _0x57c5cd;};'use strict';var emlformat=require(_0x4971('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4971('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4971('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4971('0x3'));var path=require(_0x4971('0x4'));var sox=require(_0x4971('0x5'));var csv=require('to-csv');var ejs=require(_0x4971('0x6'));var fs=require('fs');var fs_extra=require(_0x4971('0x7'));var _=require(_0x4971('0x8'));var squel=require('squel');var crypto=require(_0x4971('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x4971('0xa'));var toCsv=require(_0x4971('0xb'));var querystring=require(_0x4971('0xc'));var Papa=require(_0x4971('0xd'));var Redis=require(_0x4971('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x4971('0xf'));var as=require(_0x4971('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4971('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x4971('0x12'));var licenseUtil=require(_0x4971('0x13'));var db=require(_0x4971('0x14'))['db'];function respondWithStatusCode(_0xb0a49b,_0x2bc01b){_0x2bc01b=_0x2bc01b||0xcc;return function(_0x472961){if(_0x472961){return _0xb0a49b['sendStatus'](_0x2bc01b);}return _0xb0a49b[_0x4971('0x15')](_0x2bc01b)[_0x4971('0x16')]();};}function respondWithResult(_0x38ef6b,_0x5a7db5){_0x5a7db5=_0x5a7db5||0xc8;return function(_0x169dac){if(_0x169dac){return _0x38ef6b['status'](_0x5a7db5)[_0x4971('0x17')](_0x169dac);}};}function respondWithFilteredResult(_0x43f44f,_0x5c764e){return function(_0x2faa74){if(_0x2faa74){var _0x48e35e=typeof _0x5c764e[_0x4971('0x18')]==='undefined'&&typeof _0x5c764e['limit']===_0x4971('0x19');var _0x591975=_0x2faa74[_0x4971('0x1a')];var _0x2fc12b=_0x48e35e?0x0:_0x5c764e[_0x4971('0x18')];var _0x4676fd=_0x48e35e?_0x2faa74[_0x4971('0x1a')]:_0x5c764e['offset']+_0x5c764e[_0x4971('0x1b')];var _0x4e0103;if(_0x4676fd>=_0x591975){_0x4676fd=_0x591975;_0x4e0103=0xc8;}else{_0x4e0103=0xce;}_0x43f44f[_0x4971('0x15')](_0x4e0103);return _0x43f44f[_0x4971('0x1c')](_0x4971('0x1d'),_0x2fc12b+'-'+_0x4676fd+'/'+_0x591975)[_0x4971('0x17')](_0x2faa74);}return null;};}function patchUpdates(_0x19dda7){return function(_0x9d590d){try{jsonpatch[_0x4971('0x1e')](_0x9d590d,_0x19dda7,!![]);}catch(_0x244011){return BPromise[_0x4971('0x1f')](_0x244011);}return _0x9d590d[_0x4971('0x20')]();};}function saveUpdates(_0x4d0490,_0x36bb51){return function(_0x1f37de){if(_0x1f37de){return _0x1f37de[_0x4971('0x21')](_0x4d0490)[_0x4971('0x22')](function(_0x5cdff0){return _0x5cdff0;});}return null;};}function removeEntity(_0x243ea3,_0x490ce6){return function(_0x1975bc){if(_0x1975bc){return _0x1975bc[_0x4971('0x23')]()[_0x4971('0x22')](function(){_0x243ea3[_0x4971('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ac339,_0x8b0f52){return function(_0x4f32fb){if(!_0x4f32fb){_0x2ac339['sendStatus'](0x194);}return _0x4f32fb;};}function handleError(_0xbfb52b,_0x30dd33){_0x30dd33=_0x30dd33||0x1f4;return function(_0xcf105e){logger[_0x4971('0x24')](_0xcf105e[_0x4971('0x25')]);if(_0xcf105e[_0x4971('0x26')]){delete _0xcf105e[_0x4971('0x26')];}_0xbfb52b[_0x4971('0x15')](_0x30dd33)['send'](_0xcf105e);};}exports[_0x4971('0x27')]=function(_0x29d884,_0x21bfb5){var _0x59de69={},_0x2b697c={},_0x35b2b5={'count':0x0,'rows':[]};var _0x10a116=_[_0x4971('0x28')](db['ChatTransferReport'][_0x4971('0x29')],function(_0x34757c){return{'name':_0x34757c[_0x4971('0x2a')],'type':_0x34757c[_0x4971('0x2b')][_0x4971('0x2c')]};});_0x2b697c[_0x4971('0x2d')]=_[_0x4971('0x28')](_0x10a116,_0x4971('0x26'));_0x2b697c[_0x4971('0x2e')]=_[_0x4971('0x2f')](_0x29d884['query']);_0x2b697c['filters']=_['intersection'](_0x2b697c[_0x4971('0x2d')],_0x2b697c['query']);_0x59de69[_0x4971('0x30')]=_[_0x4971('0x31')](_0x2b697c[_0x4971('0x2d')],qs[_0x4971('0x32')](_0x29d884[_0x4971('0x2e')][_0x4971('0x32')]));_0x59de69[_0x4971('0x30')]=_0x59de69[_0x4971('0x30')][_0x4971('0x33')]?_0x59de69[_0x4971('0x30')]:_0x2b697c['model'];if(!_0x29d884[_0x4971('0x2e')][_0x4971('0x34')](_0x4971('0x35'))){_0x59de69[_0x4971('0x1b')]=qs[_0x4971('0x1b')](_0x29d884[_0x4971('0x2e')][_0x4971('0x1b')]);_0x59de69[_0x4971('0x18')]=qs['offset'](_0x29d884[_0x4971('0x2e')][_0x4971('0x18')]);}_0x59de69['order']=qs['sort'](_0x29d884[_0x4971('0x2e')]['sort']);_0x59de69[_0x4971('0x36')]=qs[_0x4971('0x37')](_['pick'](_0x29d884['query'],_0x2b697c['filters']),_0x10a116);if(_0x29d884[_0x4971('0x2e')][_0x4971('0x38')]){_0x59de69['where']=_[_0x4971('0x39')](_0x59de69[_0x4971('0x36')],{'$or':_[_0x4971('0x28')](_0x10a116,function(_0x54ddbf){if(_0x54ddbf['type']!==_0x4971('0x3a')){var _0x39bcb3={};_0x39bcb3[_0x54ddbf[_0x4971('0x26')]]={'$like':'%'+_0x29d884[_0x4971('0x2e')][_0x4971('0x38')]+'%'};return _0x39bcb3;}})});}_0x59de69=_['merge']({},_0x59de69,_0x29d884[_0x4971('0x3b')]);var _0x17033c={'where':_0x59de69[_0x4971('0x36')]};return db[_0x4971('0x3c')][_0x4971('0x1a')](_0x17033c)[_0x4971('0x22')](function(_0x1307d3){_0x35b2b5[_0x4971('0x1a')]=_0x1307d3;if(_0x29d884['query'][_0x4971('0x3d')]){_0x59de69[_0x4971('0x3e')]=[{'all':!![]}];}return db[_0x4971('0x3c')][_0x4971('0x3f')](_0x59de69);})['then'](function(_0x41a7e3){_0x35b2b5[_0x4971('0x40')]=_0x41a7e3;return _0x35b2b5;})[_0x4971('0x22')](respondWithFilteredResult(_0x21bfb5,_0x59de69))[_0x4971('0x41')](handleError(_0x21bfb5,null));};exports[_0x4971('0x42')]=function(_0x37c962,_0x3771fd){var _0x545fd8={'raw':!![],'where':{'id':_0x37c962['params']['id']}},_0x25418d={};_0x25418d[_0x4971('0x2d')]=_['keys'](db[_0x4971('0x3c')]['rawAttributes']);_0x25418d[_0x4971('0x2e')]=_[_0x4971('0x2f')](_0x37c962[_0x4971('0x2e')]);_0x25418d[_0x4971('0x37')]=_[_0x4971('0x31')](_0x25418d['model'],_0x25418d['query']);_0x545fd8[_0x4971('0x30')]=_[_0x4971('0x31')](_0x25418d['model'],qs['fields'](_0x37c962[_0x4971('0x2e')][_0x4971('0x32')]));_0x545fd8[_0x4971('0x30')]=_0x545fd8['attributes'][_0x4971('0x33')]?_0x545fd8['attributes']:_0x25418d['model'];if(_0x37c962[_0x4971('0x2e')]['includeAll']){_0x545fd8[_0x4971('0x3e')]=[{'all':!![]}];}_0x545fd8=_[_0x4971('0x39')]({},_0x545fd8,_0x37c962[_0x4971('0x3b')]);return db[_0x4971('0x3c')][_0x4971('0x43')](_0x545fd8)[_0x4971('0x22')](handleEntityNotFound(_0x3771fd,null))[_0x4971('0x22')](respondWithResult(_0x3771fd,null))[_0x4971('0x41')](handleError(_0x3771fd,null));};exports['create']=function(_0x26d6d2,_0x5aec79){return db[_0x4971('0x3c')][_0x4971('0x44')](_0x26d6d2[_0x4971('0x45')],{})[_0x4971('0x22')](respondWithResult(_0x5aec79,0xc9))[_0x4971('0x41')](handleError(_0x5aec79,null));};exports['update']=function(_0x274675,_0x16e2c6){if(_0x274675[_0x4971('0x45')]['id']){delete _0x274675['body']['id'];}return db[_0x4971('0x3c')][_0x4971('0x43')]({'where':{'id':_0x274675[_0x4971('0x46')]['id']}})[_0x4971('0x22')](handleEntityNotFound(_0x16e2c6,null))[_0x4971('0x22')](saveUpdates(_0x274675[_0x4971('0x45')],null))[_0x4971('0x22')](respondWithResult(_0x16e2c6,null))['catch'](handleError(_0x16e2c6,null));};exports[_0x4971('0x23')]=function(_0x304bd2,_0x5f3bb0){return db[_0x4971('0x3c')][_0x4971('0x43')]({'where':{'id':_0x304bd2['params']['id']}})[_0x4971('0x22')](handleEntityNotFound(_0x5f3bb0,null))[_0x4971('0x22')](removeEntity(_0x5f3bb0,null))['catch'](handleError(_0x5f3bb0,null));};exports[_0x4971('0x47')]=function(_0x44500c,_0x4a99ff){return db[_0x4971('0x3c')][_0x4971('0x47')]()[_0x4971('0x22')](respondWithResult(_0x4a99ff,null))['catch'](handleError(_0x4a99ff,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index db30f08..eb34ec9 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 _0x6106=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','uniqueid','lodash','util','../../config/logger'];(function(_0x721852,_0x3fceef){var _0x5d4ed0=function(_0x880af5){while(--_0x880af5){_0x721852['push'](_0x721852['shift']());}};_0x5d4ed0(++_0x3fceef);}(_0x6106,0x129));var _0x6610=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x6106[_0x36ed48];return _0x51c63a;};'use strict';var _=require(_0x6610('0x0'));var util=require(_0x6610('0x1'));var logger=require(_0x6610('0x2'))(_0x6610('0x3'));var moment=require(_0x6610('0x4'));var BPromise=require(_0x6610('0x5'));var rp=require(_0x6610('0x6'));var fs=require('fs');var path=require(_0x6610('0x7'));var rimraf=require(_0x6610('0x8'));var config=require(_0x6610('0x9'));var attributes=require(_0x6610('0xa'));module[_0x6610('0xb')]=function(_0x1776ca,_0x51b4e5){return _0x1776ca[_0x6610('0xc')](_0x6610('0xd'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x6610('0xe'),'fields':[_0x6610('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd51e=['./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x29d82d,_0x3a5623){var _0xf9d8a1=function(_0x443097){while(--_0x443097){_0x29d82d['push'](_0x29d82d['shift']());}};_0xf9d8a1(++_0x3a5623);}(_0xd51e,0x7e));var _0xed51=function(_0x57b35d,_0x229c1d){_0x57b35d=_0x57b35d-0x0;var _0x3fb76e=_0xd51e[_0x57b35d];return _0x3fb76e;};'use strict';var _=require(_0xed51('0x0'));var util=require(_0xed51('0x1'));var logger=require(_0xed51('0x2'))(_0xed51('0x3'));var moment=require(_0xed51('0x4'));var BPromise=require(_0xed51('0x5'));var rp=require(_0xed51('0x6'));var fs=require('fs');var path=require(_0xed51('0x7'));var rimraf=require('rimraf');var config=require(_0xed51('0x8'));var attributes=require(_0xed51('0x9'));module[_0xed51('0xa')]=function(_0x3baea0,_0x150528){return _0x3baea0[_0xed51('0xb')](_0xed51('0xc'),attributes,{'tableName':_0xed51('0xd'),'paranoid':![],'indexes':[{'name':_0xed51('0xe'),'fields':[_0xed51('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 5dca2fc..b7d4e30 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 _0x0cbb=['info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','then'];(function(_0x1e6659,_0x1f860c){var _0x4d16e4=function(_0x21c05a){while(--_0x21c05a){_0x1e6659['push'](_0x1e6659['shift']());}};_0x4d16e4(++_0x1f860c);}(_0x0cbb,0x16f));var _0xb0cb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0cbb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb0cb('0x0'));var util=require(_0xb0cb('0x1'));var moment=require(_0xb0cb('0x2'));var BPromise=require(_0xb0cb('0x3'));var rs=require(_0xb0cb('0x4'));var fs=require('fs');var Redis=require(_0xb0cb('0x5'));var db=require(_0xb0cb('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xb0cb('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb0cb('0x8'));var client=jayson[_0xb0cb('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c8c76,_0x30244b,_0x3f472d){return new BPromise(function(_0x45d22e,_0x18dc1a){return client['request'](_0x2c8c76,_0x3f472d)[_0xb0cb('0xa')](function(_0x104915){logger[_0xb0cb('0xb')](_0xb0cb('0xc'),_0x30244b,'request\x20sent');logger['debug']('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x30244b,_0xb0cb('0xd'),JSON['stringify'](_0x104915));if(_0x104915[_0xb0cb('0xe')]){if(_0x104915[_0xb0cb('0xe')][_0xb0cb('0xf')]===0x1f4){logger['error'](_0xb0cb('0xc'),_0x30244b,_0x104915['error']['message']);return _0x18dc1a(_0x104915[_0xb0cb('0xe')][_0xb0cb('0x10')]);}logger[_0xb0cb('0xe')](_0xb0cb('0xc'),_0x30244b,_0x104915[_0xb0cb('0xe')][_0xb0cb('0x10')]);return _0x45d22e(_0x104915['error'][_0xb0cb('0x10')]);}else{logger[_0xb0cb('0xb')](_0xb0cb('0xc'),_0x30244b,'request\x20sent');_0x45d22e(_0x104915['result'][_0xb0cb('0x10')]);}})[_0xb0cb('0x11')](function(_0x26f23f){logger['error'](_0xb0cb('0xc'),_0x30244b,_0x26f23f);_0x18dc1a(_0x26f23f);});});} \ No newline at end of file +var _0x8bc2=['../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','ChatTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1c1852,_0x376b11){var _0x47ec77=function(_0x5a073e){while(--_0x5a073e){_0x1c1852['push'](_0x1c1852['shift']());}};_0x47ec77(++_0x376b11);}(_0x8bc2,0xe0));var _0x28bc=function(_0x50fac7,_0x338b99){_0x50fac7=_0x50fac7-0x0;var _0x4983de=_0x8bc2[_0x50fac7];return _0x4983de;};'use strict';var _=require(_0x28bc('0x0'));var util=require(_0x28bc('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x28bc('0x2'));var db=require(_0x28bc('0x3'))['db'];var utils=require(_0x28bc('0x4'));var logger=require(_0x28bc('0x5'))(_0x28bc('0x6'));var config=require(_0x28bc('0x7'));var jayson=require(_0x28bc('0x8'));var client=jayson[_0x28bc('0x9')][_0x28bc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15d9f1,_0x559fad,_0x2f2250){return new BPromise(function(_0x25bfcf,_0xe21cd3){return client[_0x28bc('0xb')](_0x15d9f1,_0x2f2250)[_0x28bc('0xc')](function(_0x30cd1a){logger[_0x28bc('0xd')]('ChatTransferReport,\x20%s,\x20%s',_0x559fad,_0x28bc('0xe'));logger['debug'](_0x28bc('0xf'),_0x559fad,_0x28bc('0xe'),JSON['stringify'](_0x30cd1a));if(_0x30cd1a[_0x28bc('0x10')]){if(_0x30cd1a[_0x28bc('0x10')]['code']===0x1f4){logger[_0x28bc('0x10')](_0x28bc('0x11'),_0x559fad,_0x30cd1a[_0x28bc('0x10')][_0x28bc('0x12')]);return _0xe21cd3(_0x30cd1a[_0x28bc('0x10')][_0x28bc('0x12')]);}logger[_0x28bc('0x10')](_0x28bc('0x11'),_0x559fad,_0x30cd1a[_0x28bc('0x10')][_0x28bc('0x12')]);return _0x25bfcf(_0x30cd1a[_0x28bc('0x10')][_0x28bc('0x12')]);}else{logger[_0x28bc('0xd')](_0x28bc('0x11'),_0x559fad,'request\x20sent');_0x25bfcf(_0x30cd1a[_0x28bc('0x13')][_0x28bc('0x12')]);}})[_0x28bc('0x14')](function(_0x16c019){logger['error'](_0x28bc('0x11'),_0x559fad,_0x16c019);_0xe21cd3(_0x16c019);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 9fe1835..ccc66d4 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 _0xe08f=['post','create','update','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','./chatTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x44989b,_0x1824e8){var _0x1c771c=function(_0xbbfbac){while(--_0xbbfbac){_0x44989b['push'](_0x44989b['shift']());}};_0x1c771c(++_0x1824e8);}(_0xe08f,0x17a));var _0xfe08=function(_0x287af7,_0x241f71){_0x287af7=_0x287af7-0x0;var _0x3dedb8=_0xe08f[_0x287af7];return _0x3dedb8;};'use strict';var multer=require(_0xfe08('0x0'));var util=require(_0xfe08('0x1'));var path=require('path');var timeout=require(_0xfe08('0x2'));var express=require('express');var router=express[_0xfe08('0x3')]();var fs_extra=require(_0xfe08('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xfe08('0x5'));var config=require('../../config/environment');var controller=require(_0xfe08('0x6'));router[_0xfe08('0x7')]('/',auth[_0xfe08('0x8')](),controller['index']);router['get'](_0xfe08('0x9'),auth[_0xfe08('0x8')](),controller[_0xfe08('0xa')]);router[_0xfe08('0x7')](_0xfe08('0xb'),auth[_0xfe08('0x8')](),controller[_0xfe08('0xc')]);router[_0xfe08('0xd')]('/',auth[_0xfe08('0x8')](),controller[_0xfe08('0xe')]);router['put'](_0xfe08('0xb'),auth['isAuthenticated'](),controller[_0xfe08('0xf')]);router['delete'](_0xfe08('0xb'),auth[_0xfe08('0x8')](),controller['destroy']);module[_0xfe08('0x10')]=router; \ No newline at end of file +var _0xa06f=['../../config/environment','get','index','/describe','isAuthenticated','/:id','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x2b0ae1,_0x258625){var _0x2bfcb9=function(_0x306c6f){while(--_0x306c6f){_0x2b0ae1['push'](_0x2b0ae1['shift']());}};_0x2bfcb9(++_0x258625);}(_0xa06f,0x12a));var _0xfa06=function(_0x448b8a,_0x4b8ccc){_0x448b8a=_0x448b8a-0x0;var _0x17e781=_0xa06f[_0x448b8a];return _0x17e781;};'use strict';var multer=require(_0xfa06('0x0'));var util=require(_0xfa06('0x1'));var path=require('path');var timeout=require(_0xfa06('0x2'));var express=require(_0xfa06('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xfa06('0x4'));var interaction=require(_0xfa06('0x5'));var config=require(_0xfa06('0x6'));var controller=require('./chatTransferReport.controller');router[_0xfa06('0x7')]('/',auth['isAuthenticated'](),controller[_0xfa06('0x8')]);router[_0xfa06('0x7')](_0xfa06('0x9'),auth[_0xfa06('0xa')](),controller['describe']);router['get'](_0xfa06('0xb'),auth[_0xfa06('0xa')](),controller['show']);router[_0xfa06('0xc')]('/',auth[_0xfa06('0xa')](),controller[_0xfa06('0xd')]);router[_0xfa06('0xe')]('/:id',auth[_0xfa06('0xa')](),controller[_0xfa06('0xf')]);router[_0xfa06('0x10')](_0xfa06('0xb'),auth[_0xfa06('0xa')](),controller[_0xfa06('0x11')]);module[_0xfa06('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 780c5bb..0ec6b2c 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 _0xead1=['STRING','address','email','Agent','#011F6A','INTEGER','ENUM','rounded','We\x20are\x20here!','Chat','Contact\x20us','BOOLEAN','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!','Send','Skip','Feedback','star','thumb','input','name','text','getDataValue','onlineForm','setDataValue','stringify','Comments','Leave\x20your\x20comments','offlineForm','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.','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','CHAT','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports'];(function(_0x4ec6db,_0x393d10){var _0x5b46fc=function(_0x18d087){while(--_0x18d087){_0x4ec6db['push'](_0x4ec6db['shift']());}};_0x5b46fc(++_0x393d10);}(_0xead1,0x129));var _0x1ead=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xead1[_0x4fc9e6];return _0x551d28;};'use strict';var Sequelize=require(_0x1ead('0x0'));var rs=require(_0x1ead('0x1'));module[_0x1ead('0x2')]={'name':{'type':Sequelize[_0x1ead('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x1ead('0x3')],'allowNull':![],'unique':_0x1ead('0x4')},'description':{'type':Sequelize[_0x1ead('0x3')]},'mapKey':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':_0x1ead('0x5')},'mapKeyOffline':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':_0x1ead('0x5')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':_0x1ead('0x6')},'customerAlias':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1ead('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1ead('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x1ead('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x1ead('0x3')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x1ead('0x9')](_0x1ead('0xa'),'squared'),'defaultValue':_0x1ead('0xa')},'header_online':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':_0x1ead('0xb')},'start_chat_button':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':_0x1ead('0xc')},'offline_chat_button':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':_0x1ead('0xd')},'download_transcript':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x1ead('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':_0x1ead('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x1ead('0x10')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x1ead('0x11')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':_0x1ead('0x12')},'noteTitle':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':_0x1ead('0x13')},'placeholderMessage':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':_0x1ead('0x14')},'closingMessageButton':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':_0x1ead('0x15')},'skipMessageButton':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':_0x1ead('0x16')},'conditionAgreement':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':_0x1ead('0x17')},'ratingType':{'type':Sequelize[_0x1ead('0x9')](_0x1ead('0x18'),_0x1ead('0x19')),'defaultValue':_0x1ead('0x18')},'ratingStarsNumber':{'type':Sequelize[_0x1ead('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x1ead('0x10')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x1ead('0x1a'),'variable':null,'config':{'placeholder':_0x1ead('0x1b'),'type':_0x1ead('0x1c'),'required':!![]},'props':{'title':_0x1ead('0x1b'),'helpText':''}},{'type':_0x1ead('0x1a'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x1ead('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x1ead('0x1d')]('onlineForm')?JSON['parse'](this[_0x1ead('0x1d')](_0x1ead('0x1e'))):{};},'set':function(_0x5a56b1){return this[_0x1ead('0x1f')]('onlineForm',JSON[_0x1ead('0x20')](_0x5a56b1));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x1ead('0x20')]({'items':[{'type':_0x1ead('0x1a'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x1ead('0x5'),'type':_0x1ead('0x5')},'variable':null},{'type':'textarea','config':{'placeholder':'Comments'},'props':{'title':_0x1ead('0x21'),'helpText':_0x1ead('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0x1ead('0x1d')](_0x1ead('0x23'))?JSON['parse'](this[_0x1ead('0x1d')](_0x1ead('0x23'))):{};},'set':function(_0x244b1a){return this['setDataValue'](_0x1ead('0x23'),JSON[_0x1ead('0x20')](_0x244b1a));}},'token':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x1ead('0x3')]},'waitingTitle':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':_0x1ead('0x24')},'waitingMessage':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':_0x1ead('0x25')},'offlineMessageSubject':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':_0x1ead('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':_0x1ead('0x27')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x1ead('0x16')},'sendUnmanaged':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x1ead('0x3')]},'notificationTemplate':{'type':Sequelize[_0x1ead('0x10')],'defaultValue':function(){return _0x1ead('0x28');}},'notificationSound':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':_0x1ead('0x29')},'waitForTheAssignedAgent':{'type':Sequelize[_0x1ead('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x1ead('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':_0x1ead('0x2a')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x1ead('0x2b')},'defaultTitle':{'type':Sequelize[_0x1ead('0x3')]},'customerAvatar':{'type':Sequelize[_0x1ead('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x1ead('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1ead('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':_0x1ead('0x2c')},'systemAvatar':{'type':Sequelize[_0x1ead('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1ead('0x8')],'comment':_0x1ead('0x2d')},'mandatoryDisposition':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':![],'comment':_0x1ead('0x2e'),'set':function(_0x5645bd){if(!_0x5645bd)this[_0x1ead('0x1f')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0x1ead('0x2f'),_0x5645bd);}},'vidaooEscalation':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x1ead('0x3')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1ead('0x30')},'vidaooNote':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':function(){return _0x1ead('0x31');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x1ead('0x10')]}}; \ No newline at end of file +var _0x70c8=['parse','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.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','website_alias','bottom_right','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','randomstring','STRING','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','stringify','name','text','input','onlineForm','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm'];(function(_0xe66337,_0xb5c585){var _0x1a6d47=function(_0x2d260b){while(--_0x2d260b){_0xe66337['push'](_0xe66337['shift']());}};_0x1a6d47(++_0xb5c585);}(_0x70c8,0x196));var _0x870c=function(_0x240eee,_0x565a46){_0x240eee=_0x240eee-0x0;var _0xbc0fd6=_0x70c8[_0x240eee];return _0xbc0fd6;};'use strict';var Sequelize=require(_0x870c('0x0'));var rs=require(_0x870c('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x870c('0x2')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x870c('0x2')]},'mapKey':{'type':Sequelize[_0x870c('0x2')],'defaultValue':_0x870c('0x3')},'mapKeyOffline':{'type':Sequelize[_0x870c('0x2')],'defaultValue':'email'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x870c('0x4')},'customerAlias':{'type':Sequelize[_0x870c('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x870c('0x2')],'allowNull':![],'defaultValue':_0x870c('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x870c('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x870c('0x2')],'allowNull':![],'defaultValue':_0x870c('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x870c('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x870c('0x2')]},'animation':{'type':Sequelize[_0x870c('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x870c('0x9')](_0x870c('0xa'),'squared'),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x870c('0x2')],'defaultValue':_0x870c('0xb')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x870c('0xc')},'offline_chat_button':{'type':Sequelize[_0x870c('0x2')],'defaultValue':_0x870c('0xd')},'header_offline':{'type':Sequelize[_0x870c('0x2')],'defaultValue':_0x870c('0xe')},'download_transcript':{'type':Sequelize[_0x870c('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x870c('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x870c('0x2')],'defaultValue':_0x870c('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0x870c('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x870c('0x10')]},'closingQuestion':{'type':Sequelize[_0x870c('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x870c('0x2')],'defaultValue':_0x870c('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0x870c('0x2')],'defaultValue':_0x870c('0x12')},'noteTitle':{'type':Sequelize[_0x870c('0x2')],'defaultValue':_0x870c('0x13')},'placeholderMessage':{'type':Sequelize[_0x870c('0x2')],'defaultValue':_0x870c('0x14')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x870c('0x15')},'closingMessageButton':{'type':Sequelize[_0x870c('0x2')],'defaultValue':_0x870c('0xd')},'skipMessageButton':{'type':Sequelize[_0x870c('0x2')],'defaultValue':_0x870c('0x16')},'conditionAgreement':{'type':Sequelize[_0x870c('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x870c('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x870c('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x870c('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x870c('0x2')],'defaultValue':_0x870c('0x17')},'ratingType':{'type':Sequelize[_0x870c('0x9')]('star','thumb'),'defaultValue':_0x870c('0x18')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x870c('0x10')],'defaultValue':function(){return JSON[_0x870c('0x19')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x870c('0x1a'),'type':_0x870c('0x1b'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x870c('0x1c'),'props':{'title':_0x870c('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x870c('0x3'),'type':_0x870c('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue']('onlineForm')?JSON['parse'](this['getDataValue'](_0x870c('0x1d'))):{};},'set':function(_0x4d7e6a){return this[_0x870c('0x1e')](_0x870c('0x1d'),JSON[_0x870c('0x19')](_0x4d7e6a));}},'offlineForm':{'type':Sequelize[_0x870c('0x10')],'defaultValue':function(){return JSON[_0x870c('0x19')]({'items':[{'type':_0x870c('0x1c'),'props':{'title':_0x870c('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x870c('0x3'),'type':'email'},'variable':null},{'type':_0x870c('0x1f'),'config':{'placeholder':_0x870c('0x20')},'props':{'title':_0x870c('0x20'),'helpText':_0x870c('0x21')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x870c('0x22'))?JSON[_0x870c('0x23')](this['getDataValue'](_0x870c('0x22'))):{};},'set':function(_0x3d4f56){return this[_0x870c('0x1e')](_0x870c('0x22'),JSON[_0x870c('0x19')](_0x3d4f56));}},'token':{'type':Sequelize[_0x870c('0x2')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x870c('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x870c('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x870c('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x870c('0x2')]},'forwardOffline':{'type':Sequelize[_0x870c('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x870c('0x2')]},'waitingTitle':{'type':Sequelize[_0x870c('0x2')],'defaultValue':_0x870c('0x24')},'waitingMessage':{'type':Sequelize[_0x870c('0x2')],'defaultValue':_0x870c('0x25')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x870c('0x2')],'defaultValue':_0x870c('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0x870c('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x870c('0x2')],'defaultValue':_0x870c('0x27')},'skipUnmanaged':{'type':Sequelize[_0x870c('0x2')],'defaultValue':_0x870c('0x16')},'sendUnmanaged':{'type':Sequelize[_0x870c('0x2')],'defaultValue':_0x870c('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0x870c('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x870c('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x870c('0x10')]},'showAgentAvatar':{'type':Sequelize[_0x870c('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x870c('0x2')]},'notificationTemplate':{'type':Sequelize[_0x870c('0x10')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x870c('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x870c('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x870c('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x870c('0x28')},'waitForTheAssignedAgent':{'type':Sequelize[_0x870c('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x870c('0x29')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x870c('0x2')],'defaultValue':_0x870c('0x2a')},'messagesAlignment':{'type':Sequelize[_0x870c('0x2')],'defaultValue':_0x870c('0x2b')},'defaultTitle':{'type':Sequelize[_0x870c('0x2')]},'customerAvatar':{'type':Sequelize[_0x870c('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0x870c('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x870c('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x870c('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x870c('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x870c('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x870c('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x870c('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x870c('0x2d')},'systemAvatar':{'type':Sequelize[_0x870c('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x870c('0x7')],'comment':_0x870c('0x2e')},'mandatoryDisposition':{'type':Sequelize[_0x870c('0x8')],'defaultValue':![],'comment':_0x870c('0x2f'),'set':function(_0x3d0a47){if(!_0x3d0a47)this[_0x870c('0x1e')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0x870c('0x30'),_0x3d0a47);}},'vidaooEscalation':{'type':Sequelize[_0x870c('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x870c('0x2')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0x870c('0x2')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x870c('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x870c('0x10')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 2c32eaa..7d017fe 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 _0xb10b=['removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','util','path','ejs','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','destroy','get','UserProfileResource','stack','name','index','map','ChatWebsite','rawAttributes','fieldName','key','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','type','filter','options','includeAll','findAll','rows','mandatoryDispositionPause','intersection','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ChatWebsites','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','params','Pause','ChatWebsiteId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','addAvatar','agentAvatar','file','addCustomerAvatar','customerAvatar','filename','systemAvatar','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','user-agent','getResult','chat','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','from','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','CmList','List','Contacts','ChatApplication','Applications','account','applications','list','orderBy','asc','defaults','contact','customerIp','cf-connecting-ip','headers','x-forwarded-for','first','split','firstName','lastName','referer','browser','version','format','%s\x20%s','unknown','device','threadId','ChatInteraction','ContactId','interaction','spread','messageId','created','close','unmanaged','ChatMessage','AttachmentId','UserId','User','unshift','agent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','offline','describe','ListId','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','service','host','port','authentication','auth','pass','sendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','offlineMessageSubject','mimetype','subjectOffline','toPairsIn','mapValues','Chat','MailAccountId','NotifyMailAccount','notifyMail','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Contact','Owner','fullname','internal','Tag','Tags','color','tag','Command','timezone','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','getSnippet','Interval','Intervals','getProactiveActions','getLicense','virtual','License','chatLicenseExceeded','readFileSync','server/files/chat/iframe.ejs','remote','x-real-ip','connection','labelText','textColor','backgroundColor','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','getApplications','addProactiveActions','ChatProactiveAction','getFields','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit'];(function(_0x267a7f,_0x49ebfc){var _0x341f37=function(_0x178ac8){while(--_0x178ac8){_0x267a7f['push'](_0x267a7f['shift']());}};_0x341f37(++_0x49ebfc);}(_0xb10b,0x12a));var _0xbb10=function(_0x39686e,_0x3d83bb){_0x39686e=_0x39686e-0x0;var _0x1b765e=_0xb10b[_0x39686e];return _0x1b765e;};'use strict';var BPromise=require(_0xbb10('0x0'));var Mustache=require('mustache');var util=require(_0xbb10('0x1'));var path=require(_0xbb10('0x2'));var ejs=require(_0xbb10('0x3'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbb10('0x4'));var querystring=require(_0xbb10('0x5'));var Redis=require(_0xbb10('0x6'));var qs=require(_0xbb10('0x7'));var logger=require(_0xbb10('0x8'))(_0xbb10('0x9'));var config=require('../../config/environment');var db=require(_0xbb10('0xa'))['db'];config[_0xbb10('0xb')]=_['defaults'](config[_0xbb10('0xb')],{'host':_0xbb10('0xc'),'port':0x18eb});var socket=require(_0xbb10('0xd'))(new Redis(config[_0xbb10('0xb')]));require(_0xbb10('0xe'))[_0xbb10('0xf')](socket);var htmlToText=require(_0xbb10('0x10'));var jayson=require(_0xbb10('0x11'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0xbb10('0x12')][_0xbb10('0x13')]({'port':0x232a});var client9003=jayson[_0xbb10('0x12')]['http']({'port':0x232b});var client9001=jayson[_0xbb10('0x12')]['http']({'port':0x2329});function respondWithRpcPromise(_0x44fb19,_0x916a32,_0x285009,_0x193a27){return new BPromise(function(_0x442548,_0x147230){var _0x58a612=_0x193a27||client;return _0x58a612[_0xbb10('0x14')](_0x44fb19,_0x285009)[_0xbb10('0x15')](function(_0x45b9d6){logger[_0xbb10('0x16')](_0xbb10('0x17'),_0x916a32,_0xbb10('0x18'));logger[_0xbb10('0x19')](_0xbb10('0x1a'),_0x916a32,_0xbb10('0x18'),JSON[_0xbb10('0x1b')](_0x45b9d6));if(_0x45b9d6['error']){if(_0x45b9d6[_0xbb10('0x1c')][_0xbb10('0x1d')]===0x1f4){logger[_0xbb10('0x1c')](_0xbb10('0x17'),_0x916a32,_0x45b9d6[_0xbb10('0x1c')][_0xbb10('0x1e')]);return _0x147230(_0x45b9d6[_0xbb10('0x1c')][_0xbb10('0x1e')]);}logger[_0xbb10('0x1c')](_0xbb10('0x17'),_0x916a32,_0x45b9d6['error'][_0xbb10('0x1e')]);return _0x442548(_0x45b9d6[_0xbb10('0x1c')][_0xbb10('0x1e')]);}else{logger[_0xbb10('0x16')](_0xbb10('0x17'),_0x916a32,_0xbb10('0x18'));_0x442548(_0x45b9d6['result'][_0xbb10('0x1e')]);}})[_0xbb10('0x1f')](function(_0x50aea1){logger['error'](_0xbb10('0x17'),_0x916a32,_0x50aea1);_0x147230(_0x50aea1);});});}function respondWithStatusCode(_0x311abe,_0x2e911d){_0x2e911d=_0x2e911d||0xcc;return function(_0x317da4){if(_0x317da4){return _0x311abe[_0xbb10('0x20')](_0x2e911d);}return _0x311abe[_0xbb10('0x21')](_0x2e911d)[_0xbb10('0x22')]();};}function respondWithResult(_0x436104,_0x7f2377){_0x7f2377=_0x7f2377||0xc8;return function(_0x395404){if(_0x395404){return _0x436104[_0xbb10('0x21')](_0x7f2377)[_0xbb10('0x23')](_0x395404);}};}function respondWithFilteredResult(_0x537898,_0x4fedac){return function(_0x4fb5e0){if(_0x4fb5e0){var _0xc93a04=typeof _0x4fedac[_0xbb10('0x24')]===_0xbb10('0x25')&&typeof _0x4fedac['limit']===_0xbb10('0x25');var _0x24d586=_0x4fb5e0[_0xbb10('0x26')];var _0x1d5e95=_0xc93a04?0x0:_0x4fedac[_0xbb10('0x24')];var _0x20d946=_0xc93a04?_0x4fb5e0[_0xbb10('0x26')]:_0x4fedac['offset']+_0x4fedac[_0xbb10('0x27')];var _0x21ac54;if(_0x20d946>=_0x24d586){_0x20d946=_0x24d586;_0x21ac54=0xc8;}else{_0x21ac54=0xce;}_0x537898[_0xbb10('0x21')](_0x21ac54);return _0x537898[_0xbb10('0x28')](_0xbb10('0x29'),_0x1d5e95+'-'+_0x20d946+'/'+_0x24d586)[_0xbb10('0x23')](_0x4fb5e0);}return null;};}function saveUpdates(_0x5d5c80){return function(_0x221624){if(_0x221624){return _0x221624['update'](_0x5d5c80)[_0xbb10('0x15')](function(_0x56f2da){return _0x56f2da;});}return null;};}function removeEntity(_0x16ad2a){return function(_0x1dcc9c){if(_0x1dcc9c){return _0x1dcc9c[_0xbb10('0x2a')]()['then'](function(){var _0x518d47=_0x1dcc9c[_0xbb10('0x2b')]({'plain':!![]});var _0x34f65e='ChatWebsites';return db[_0xbb10('0x2c')][_0xbb10('0x2a')]({'where':{'type':_0x34f65e,'resourceId':_0x518d47['id']}})[_0xbb10('0x15')](function(){return _0x1dcc9c;});})[_0xbb10('0x15')](function(){_0x16ad2a[_0xbb10('0x21')](0xcc)[_0xbb10('0x22')]();});}};}function handleEntityNotFound(_0xf85197){return function(_0x4975f5){if(!_0x4975f5){_0xf85197[_0xbb10('0x20')](0x194);}return _0x4975f5;};}function handleError(_0x1da9c9,_0x441d15){_0x441d15=_0x441d15||0x1f4;return function(_0x8c1ce6){logger[_0xbb10('0x1c')](_0x8c1ce6[_0xbb10('0x2d')]);if(_0x8c1ce6[_0xbb10('0x2e')]){delete _0x8c1ce6[_0xbb10('0x2e')];}_0x1da9c9[_0xbb10('0x21')](_0x441d15)['send'](_0x8c1ce6);};}exports[_0xbb10('0x2f')]=function(_0x150107,_0x1ddd9e){var _0x3c3c45={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x570f5a={},_0x111762={'count':0x0,'rows':[]};var _0x3eb3cc=_[_0xbb10('0x30')](db[_0xbb10('0x31')][_0xbb10('0x32')],function(_0x15d895){return{'name':_0x15d895[_0xbb10('0x33')],'type':_0x15d895['type'][_0xbb10('0x34')]};});_0x570f5a[_0xbb10('0x35')]=_['map'](_0x3eb3cc,'name');_0x570f5a['query']=_[_0xbb10('0x36')](_0x150107[_0xbb10('0x37')]);_0x570f5a[_0xbb10('0x38')]=_['intersection'](_0x570f5a[_0xbb10('0x35')],_0x570f5a[_0xbb10('0x37')]);_0x3c3c45[_0xbb10('0x39')]=_['intersection'](_0x570f5a[_0xbb10('0x35')],qs[_0xbb10('0x3a')](_0x150107[_0xbb10('0x37')][_0xbb10('0x3a')]));_0x3c3c45['attributes']=_0x3c3c45[_0xbb10('0x39')][_0xbb10('0x3b')]?_0x3c3c45['attributes']:_0x570f5a[_0xbb10('0x35')];if(!_0x150107[_0xbb10('0x37')][_0xbb10('0x3c')](_0xbb10('0x3d'))){_0x3c3c45[_0xbb10('0x27')]=qs[_0xbb10('0x27')](_0x150107['query'][_0xbb10('0x27')]);_0x3c3c45[_0xbb10('0x24')]=qs[_0xbb10('0x24')](_0x150107[_0xbb10('0x37')]['offset']);}_0x3c3c45[_0xbb10('0x3e')]=qs[_0xbb10('0x3f')](_0x150107[_0xbb10('0x37')][_0xbb10('0x3f')]);_0x3c3c45['where']=qs[_0xbb10('0x38')](_[_0xbb10('0x40')](_0x150107['query'],_0x570f5a['filters']),_0x3eb3cc);if(_0x150107[_0xbb10('0x37')]['filter']){_0x3c3c45[_0xbb10('0x41')]=_[_0xbb10('0x42')](_0x3c3c45['where'],{'$or':_[_0xbb10('0x30')](_0x3eb3cc,function(_0x1d82bf){if(_0x1d82bf[_0xbb10('0x43')]!=='VIRTUAL'){var _0x2dd02b={};_0x2dd02b[_0x1d82bf[_0xbb10('0x2e')]]={'$like':'%'+_0x150107[_0xbb10('0x37')][_0xbb10('0x44')]+'%'};return _0x2dd02b;}})});}_0x3c3c45=_[_0xbb10('0x42')]({},_0x3c3c45,_0x150107[_0xbb10('0x45')]);var _0x190781={'where':_0x3c3c45[_0xbb10('0x41')]};return db[_0xbb10('0x31')][_0xbb10('0x26')](_0x190781)[_0xbb10('0x15')](function(_0x1eadd2){_0x111762['count']=_0x1eadd2;if(_0x150107[_0xbb10('0x37')][_0xbb10('0x46')]){_0x3c3c45['include']=[{'all':!![]}];}return db[_0xbb10('0x31')][_0xbb10('0x47')](_0x3c3c45);})[_0xbb10('0x15')](function(_0x5a5226){_0x111762[_0xbb10('0x48')]=_0x5a5226;return _0x111762;})[_0xbb10('0x15')](respondWithFilteredResult(_0x1ddd9e,_0x3c3c45))[_0xbb10('0x1f')](handleError(_0x1ddd9e,null));};exports['show']=function(_0x4a9793,_0xcb3354){var _0x76a208={'raw':![],'where':{'id':_0x4a9793['params']['id']},'include':[{'model':db['Pause'],'as':_0xbb10('0x49')}]},_0x2b12bd={};_0x2b12bd[_0xbb10('0x35')]=_[_0xbb10('0x36')](db[_0xbb10('0x31')][_0xbb10('0x32')]);_0x2b12bd[_0xbb10('0x37')]=_[_0xbb10('0x36')](_0x4a9793[_0xbb10('0x37')]);_0x2b12bd[_0xbb10('0x38')]=_[_0xbb10('0x4a')](_0x2b12bd['model'],_0x2b12bd['query']);_0x76a208[_0xbb10('0x39')]=_[_0xbb10('0x4a')](_0x2b12bd[_0xbb10('0x35')],qs[_0xbb10('0x3a')](_0x4a9793[_0xbb10('0x37')][_0xbb10('0x3a')]));_0x76a208[_0xbb10('0x39')]=_0x76a208[_0xbb10('0x39')][_0xbb10('0x3b')]?_0x76a208[_0xbb10('0x39')]:_0x2b12bd[_0xbb10('0x35')];if(_0x4a9793[_0xbb10('0x37')][_0xbb10('0x46')]){_0x76a208[_0xbb10('0x4b')]=[{'all':!![]}];}_0x76a208=_[_0xbb10('0x42')]({},_0x76a208,_0x4a9793['options']);return db[_0xbb10('0x31')]['find'](_0x76a208)[_0xbb10('0x15')](handleEntityNotFound(_0xcb3354,null))[_0xbb10('0x15')](respondWithResult(_0xcb3354,null))[_0xbb10('0x1f')](handleError(_0xcb3354,null));};exports[_0xbb10('0x4c')]=function(_0x26e66e,_0x32d8e9){return db[_0xbb10('0x31')][_0xbb10('0x4c')](_0x26e66e[_0xbb10('0x4d')],{})[_0xbb10('0x15')](function(_0x44a056){var _0x1c2dce=_0x26e66e[_0xbb10('0x4e')][_0xbb10('0x2b')]({'plain':!![]});if(!_0x1c2dce)throw new Error(_0xbb10('0x4f'));if(_0x1c2dce['role']===_0xbb10('0x4e')){var _0x466eb7=_0x44a056[_0xbb10('0x2b')]({'plain':!![]});var _0x4ce8e7=_0xbb10('0x50');return db[_0xbb10('0x51')]['find']({'where':{'name':_0x4ce8e7,'userProfileId':_0x1c2dce[_0xbb10('0x52')]},'raw':!![]})[_0xbb10('0x15')](function(_0x2909a1){if(_0x2909a1&&_0x2909a1[_0xbb10('0x53')]===0x0){return db[_0xbb10('0x2c')][_0xbb10('0x4c')]({'name':_0x466eb7[_0xbb10('0x2e')],'resourceId':_0x466eb7['id'],'type':_0x2909a1[_0xbb10('0x2e')],'sectionId':_0x2909a1['id']},{})[_0xbb10('0x15')](function(){return _0x44a056;});}else{return _0x44a056;}})[_0xbb10('0x1f')](function(_0x2eb05a){logger[_0xbb10('0x1c')](_0xbb10('0x54'),_0x2eb05a);throw _0x2eb05a;});}return _0x44a056;})['then'](respondWithResult(_0x32d8e9,0xc9))['catch'](handleError(_0x32d8e9,null));};exports[_0xbb10('0x55')]=function(_0x3e6338,_0x3d0cb7){if(_0x3e6338[_0xbb10('0x4d')]['id']){delete _0x3e6338['body']['id'];}return db['ChatWebsite'][_0xbb10('0x56')]({'where':{'id':_0x3e6338[_0xbb10('0x57')]['id']},'include':[{'model':db[_0xbb10('0x58')],'as':_0xbb10('0x49')}]})[_0xbb10('0x15')](handleEntityNotFound(_0x3d0cb7,null))[_0xbb10('0x15')](saveUpdates(_0x3e6338[_0xbb10('0x4d')],null))['then'](respondWithResult(_0x3d0cb7,null))[_0xbb10('0x1f')](handleError(_0x3d0cb7,null));};exports[_0xbb10('0x2a')]=function(_0x4917a5,_0x5e03cb){return db['ChatWebsite'][_0xbb10('0x56')]({'where':{'id':_0x4917a5[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x5e03cb,null))['then'](removeEntity(_0x5e03cb,null))['catch'](handleError(_0x5e03cb,null));};exports['describe']=function(_0x3ebc5f,_0x249b33){return db[_0xbb10('0x31')]['describe']()[_0xbb10('0x15')](respondWithResult(_0x249b33,null))[_0xbb10('0x1f')](handleError(_0x249b33,null));};exports['addDisposition']=function(_0x4a560c,_0x27d7b9){if(_0x4a560c[_0xbb10('0x4d')]['id']){delete _0x4a560c[_0xbb10('0x4d')]['id'];}return db[_0xbb10('0x31')]['find']({'where':{'id':_0x4a560c[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x27d7b9,null))[_0xbb10('0x15')](function(_0x5202d7){if(_0x5202d7){_0x4a560c[_0xbb10('0x4d')][_0xbb10('0x59')]=_0x5202d7['id'];return db[_0xbb10('0x5a')]['create'](_0x4a560c[_0xbb10('0x4d')]);}})[_0xbb10('0x15')](respondWithResult(_0x27d7b9,null))[_0xbb10('0x1f')](handleError(_0x27d7b9,null));};exports[_0xbb10('0x5b')]=function(_0x5e4a6e,_0x251417){var _0x258e55={'raw':![],'where':{}};var _0x108e5b={};var _0x2d0f4b={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xbb10('0x5c')]({'where':{'id':_0x5e4a6e[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x251417,null))[_0xbb10('0x15')](function(_0x12f750){if(_0x12f750){_0x108e5b[_0xbb10('0x35')]=_[_0xbb10('0x36')](db['Disposition']['rawAttributes']);_0x108e5b['query']=_[_0xbb10('0x36')](_0x5e4a6e[_0xbb10('0x37')]);_0x108e5b[_0xbb10('0x38')]=_['intersection'](_0x108e5b['model'],_0x108e5b[_0xbb10('0x37')]);_0x258e55[_0xbb10('0x39')]=_[_0xbb10('0x4a')](_0x108e5b[_0xbb10('0x35')],qs[_0xbb10('0x3a')](_0x5e4a6e[_0xbb10('0x37')]['fields']));_0x258e55[_0xbb10('0x39')]=_0x258e55[_0xbb10('0x39')][_0xbb10('0x3b')]?_0x258e55[_0xbb10('0x39')]:_0x108e5b[_0xbb10('0x35')];if(!_0x5e4a6e['query']['hasOwnProperty']('nolimit')){_0x258e55[_0xbb10('0x27')]=qs[_0xbb10('0x27')](_0x5e4a6e[_0xbb10('0x37')][_0xbb10('0x27')]);_0x258e55[_0xbb10('0x24')]=qs[_0xbb10('0x24')](_0x5e4a6e['query'][_0xbb10('0x24')]);}_0x258e55['order']=qs['sort'](_0x5e4a6e['query'][_0xbb10('0x3f')]);_0x258e55[_0xbb10('0x41')]=qs[_0xbb10('0x38')](_[_0xbb10('0x40')](_0x5e4a6e['query'],_0x108e5b[_0xbb10('0x38')]));_0x258e55['where']['ChatWebsiteId']=_0x12f750['id'];if(_0x5e4a6e[_0xbb10('0x37')][_0xbb10('0x44')]){_0x258e55[_0xbb10('0x41')]=_[_0xbb10('0x42')](_0x258e55[_0xbb10('0x41')],{'$or':_['map'](_0x258e55[_0xbb10('0x39')],function(_0x19fcec){var _0x2c6429={};_0x2c6429[_0x19fcec]={'$like':'%'+_0x5e4a6e[_0xbb10('0x37')][_0xbb10('0x44')]+'%'};return _0x2c6429;})});}_0x258e55=_[_0xbb10('0x42')]({},_0x258e55,_0x5e4a6e[_0xbb10('0x45')]);return db['Disposition'][_0xbb10('0x26')]({'where':_0x258e55[_0xbb10('0x41')]})[_0xbb10('0x15')](function(_0x322b41){_0x2d0f4b[_0xbb10('0x26')]=_0x322b41;if(_0x5e4a6e[_0xbb10('0x37')][_0xbb10('0x46')]){_0x258e55[_0xbb10('0x4b')]=[{'all':!![]}];}return db['Disposition'][_0xbb10('0x47')](_0x258e55);})[_0xbb10('0x15')](function(_0x145baf){_0x2d0f4b['rows']=_0x145baf;return _0x2d0f4b;});}})['then'](respondWithFilteredResult(_0x251417,_0x258e55))['catch'](handleError(_0x251417,null));};exports[_0xbb10('0x5d')]=function(_0x5a3c44,_0x4e3d6a){return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x5a3c44[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x4e3d6a,null))[_0xbb10('0x15')](function(_0x24dca6){if(_0x24dca6){return _0x24dca6[_0xbb10('0x5d')](_0x5a3c44[_0xbb10('0x37')][_0xbb10('0x5e')]);}})['then'](respondWithStatusCode(_0x4e3d6a,null))[_0xbb10('0x1f')](handleError(_0x4e3d6a,null));};exports[_0xbb10('0x5f')]=function(_0x46b6d2,_0x35b811){if(_0x46b6d2['body']['id']){delete _0x46b6d2['body']['id'];}return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x46b6d2[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x35b811,null))['then'](function(_0x17d596){if(_0x17d596){_0x46b6d2[_0xbb10('0x4d')][_0xbb10('0x59')]=_0x17d596['id'];return db[_0xbb10('0x60')][_0xbb10('0x4c')](_0x46b6d2['body']);}})['then'](respondWithResult(_0x35b811,null))[_0xbb10('0x1f')](handleError(_0x35b811,null));};exports[_0xbb10('0x61')]=function(_0x22c030,_0x5239da){var _0x256b35={'raw':![],'where':{}};var _0x13e2ab={};var _0x50bcc9={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xbb10('0x5c')]({'where':{'id':_0x22c030[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x5239da,null))['then'](function(_0x32d5a5){if(_0x32d5a5){_0x13e2ab[_0xbb10('0x35')]=_[_0xbb10('0x36')](db[_0xbb10('0x60')][_0xbb10('0x32')]);_0x13e2ab[_0xbb10('0x37')]=_[_0xbb10('0x36')](_0x22c030[_0xbb10('0x37')]);_0x13e2ab[_0xbb10('0x38')]=_['intersection'](_0x13e2ab[_0xbb10('0x35')],_0x13e2ab[_0xbb10('0x37')]);_0x256b35[_0xbb10('0x39')]=_[_0xbb10('0x4a')](_0x13e2ab[_0xbb10('0x35')],qs[_0xbb10('0x3a')](_0x22c030[_0xbb10('0x37')][_0xbb10('0x3a')]));_0x256b35[_0xbb10('0x39')]=_0x256b35[_0xbb10('0x39')][_0xbb10('0x3b')]?_0x256b35[_0xbb10('0x39')]:_0x13e2ab['model'];if(!_0x22c030['query'][_0xbb10('0x3c')](_0xbb10('0x3d'))){_0x256b35[_0xbb10('0x27')]=qs[_0xbb10('0x27')](_0x22c030[_0xbb10('0x37')]['limit']);_0x256b35[_0xbb10('0x24')]=qs[_0xbb10('0x24')](_0x22c030[_0xbb10('0x37')][_0xbb10('0x24')]);}_0x256b35[_0xbb10('0x3e')]=qs[_0xbb10('0x3f')](_0x22c030['query'][_0xbb10('0x3f')]);_0x256b35[_0xbb10('0x41')]=qs['filters'](_[_0xbb10('0x40')](_0x22c030['query'],_0x13e2ab[_0xbb10('0x38')]));_0x256b35[_0xbb10('0x41')][_0xbb10('0x59')]=_0x32d5a5['id'];if(_0x22c030[_0xbb10('0x37')][_0xbb10('0x44')]){_0x256b35['where']=_[_0xbb10('0x42')](_0x256b35['where'],{'$or':_[_0xbb10('0x30')](_0x256b35[_0xbb10('0x39')],function(_0x5d767f){var _0x5aaa20={};_0x5aaa20[_0x5d767f]={'$like':'%'+_0x22c030[_0xbb10('0x37')][_0xbb10('0x44')]+'%'};return _0x5aaa20;})});}_0x256b35=_[_0xbb10('0x42')]({},_0x256b35,_0x22c030[_0xbb10('0x45')]);return db[_0xbb10('0x60')][_0xbb10('0x26')]({'where':_0x256b35[_0xbb10('0x41')]})[_0xbb10('0x15')](function(_0x252ab8){_0x50bcc9[_0xbb10('0x26')]=_0x252ab8;if(_0x22c030[_0xbb10('0x37')]['includeAll']){_0x256b35[_0xbb10('0x4b')]=[{'all':!![]}];}return db[_0xbb10('0x60')][_0xbb10('0x47')](_0x256b35);})[_0xbb10('0x15')](function(_0xfe02f5){_0x50bcc9[_0xbb10('0x48')]=_0xfe02f5;return _0x50bcc9;});}})[_0xbb10('0x15')](respondWithFilteredResult(_0x5239da,_0x256b35))[_0xbb10('0x1f')](handleError(_0x5239da,null));};exports[_0xbb10('0x62')]=function(_0x18a136,_0x1c4235){return db[_0xbb10('0x31')]['find']({'where':{'id':_0x18a136[_0xbb10('0x57')]['id']}})['then'](handleEntityNotFound(_0x1c4235,null))[_0xbb10('0x15')](function(_0x3675cd){if(_0x3675cd){return _0x3675cd[_0xbb10('0x62')](_0x18a136[_0xbb10('0x37')][_0xbb10('0x5e')]);}})['then'](respondWithStatusCode(_0x1c4235,null))[_0xbb10('0x1f')](handleError(_0x1c4235,null));};exports[_0xbb10('0x63')]=function(_0x44d1d2,_0x12e89d){_0x44d1d2[_0xbb10('0x4d')][_0xbb10('0x64')]=_0x44d1d2['file']['filename'];return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x44d1d2[_0xbb10('0x57')]['id']}})['then'](handleEntityNotFound(_0x12e89d,null))[_0xbb10('0x15')](saveUpdates(_0x44d1d2[_0xbb10('0x4d')],null))['then'](respondWithResult(_0x12e89d,null))[_0xbb10('0x1f')](handleError(_0x12e89d,null));};exports[_0xbb10('0x65')]=function(_0x5642c3,_0xdd3c7e){_0x5642c3['body'][_0xbb10('0x66')]=_0x5642c3[_0xbb10('0x67')]['filename'];return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x5642c3['params']['id']}})['then'](handleEntityNotFound(_0xdd3c7e,null))[_0xbb10('0x15')](saveUpdates(_0x5642c3[_0xbb10('0x4d')],null))[_0xbb10('0x15')](respondWithResult(_0xdd3c7e,null))[_0xbb10('0x1f')](handleError(_0xdd3c7e,null));};exports[_0xbb10('0x68')]=function(_0x4c3bdc,_0xe7c0a3){_0x4c3bdc[_0xbb10('0x4d')][_0xbb10('0x69')]=_0x4c3bdc['file'][_0xbb10('0x6a')];return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x4c3bdc[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0xe7c0a3,null))[_0xbb10('0x15')](saveUpdates(_0x4c3bdc[_0xbb10('0x4d')],null))[_0xbb10('0x15')](respondWithResult(_0xe7c0a3,null))[_0xbb10('0x1f')](handleError(_0xe7c0a3,null));};exports['addSystemAvatar']=function(_0x4fc544,_0x37e40c){_0x4fc544[_0xbb10('0x4d')][_0xbb10('0x6b')]=_0x4fc544[_0xbb10('0x67')][_0xbb10('0x6a')];return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x4fc544[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x37e40c,null))[_0xbb10('0x15')](saveUpdates(_0x4fc544[_0xbb10('0x4d')],null))[_0xbb10('0x15')](respondWithResult(_0x37e40c,null))[_0xbb10('0x1f')](handleError(_0x37e40c,null));};exports['getLogo']=function(_0x1e022d,_0x123587){var _0x24076a=path[_0xbb10('0x6c')](config[_0xbb10('0x6d')],_0xbb10('0x6e'));var _0x4258fc={'where':{'id':_0x1e022d[_0xbb10('0x57')]['id']},'attributes':['id',_0xbb10('0x64')],'raw':!![]};var _0x3c92f4=![];return require(_0xbb10('0x6f'))['getLicense']()[_0xbb10('0x15')](function(_0x5e1ac5){if(_0x5e1ac5){_0x3c92f4=_0x5e1ac5[_0xbb10('0x70')];}})[_0xbb10('0x15')](function(){return db[_0xbb10('0x31')][_0xbb10('0x56')](_0x4258fc);})[_0xbb10('0x15')](handleEntityNotFound(_0x123587,null))[_0xbb10('0x15')](function(_0x4e9cad){if(_0x4e9cad){if(!_[_0xbb10('0x71')](_0x4e9cad['sitepic'])){if(fs[_0xbb10('0x72')](path[_0xbb10('0x6c')](config[_0xbb10('0x6d')],_0xbb10('0x73'),_0x4e9cad[_0xbb10('0x64')]))&&_0x3c92f4){_0x24076a=path[_0xbb10('0x6c')](config[_0xbb10('0x6d')],_0xbb10('0x73'),_0x4e9cad[_0xbb10('0x64')]);}}return _0x123587[_0xbb10('0x74')](_0x24076a);}})[_0xbb10('0x1f')](handleError(_0x123587,null));};exports[_0xbb10('0x75')]=function(_0x589565,_0x3696b3){var _0x516520=path[_0xbb10('0x6c')](config[_0xbb10('0x6d')],_0xbb10('0x76'));var _0x7673a0={'where':{'id':_0x589565[_0xbb10('0x57')]['id']},'attributes':['id',_0xbb10('0x66')],'raw':!![]};return db[_0xbb10('0x31')]['find'](_0x7673a0)[_0xbb10('0x15')](handleEntityNotFound(_0x3696b3,null))['then'](function(_0x51063a){if(_0x51063a){if(!_[_0xbb10('0x71')](_0x51063a[_0xbb10('0x66')])){if(fs[_0xbb10('0x72')](path[_0xbb10('0x6c')](config[_0xbb10('0x6d')],_0xbb10('0x77'),_0x51063a['agentAvatar']))){_0x516520=path[_0xbb10('0x6c')](config[_0xbb10('0x6d')],_0xbb10('0x77'),_0x51063a[_0xbb10('0x66')]);}}return _0x3696b3[_0xbb10('0x74')](_0x516520);}})[_0xbb10('0x1f')](handleError(_0x3696b3,null));};exports['getCustomerAvatar']=function(_0xdfdc42,_0x4093a4){var _0xb7c454=path[_0xbb10('0x6c')](config[_0xbb10('0x6d')],_0xbb10('0x78'));var _0x2764e1={'where':{'id':_0xdfdc42['params']['id']},'attributes':['id',_0xbb10('0x69'),'showCustomerAvatar'],'raw':!![]};return db[_0xbb10('0x31')]['find'](_0x2764e1)['then'](handleEntityNotFound(_0x4093a4,null))[_0xbb10('0x15')](function(_0x225064){if(_0x225064){if(!_[_0xbb10('0x71')](_0x225064[_0xbb10('0x69')])){if(fs[_0xbb10('0x72')](path['join'](config[_0xbb10('0x6d')],'server/files/images/avatars/',_0x225064['customerAvatar']))&&_0x225064['showCustomerAvatar']){_0xb7c454=path[_0xbb10('0x6c')](config[_0xbb10('0x6d')],_0xbb10('0x77'),_0x225064[_0xbb10('0x69')]);}}return _0x4093a4[_0xbb10('0x74')](_0xb7c454);}})['catch'](handleError(_0x4093a4,null));};exports[_0xbb10('0x79')]=function(_0x42a2d7,_0x352de4){var _0x1bd1c1=path[_0xbb10('0x6c')](config[_0xbb10('0x6d')],_0xbb10('0x7a'));var _0x485c1a={'where':{'id':_0x42a2d7['params']['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xbb10('0x31')][_0xbb10('0x56')](_0x485c1a)[_0xbb10('0x15')](handleEntityNotFound(_0x352de4,null))[_0xbb10('0x15')](function(_0x25cba1){if(_0x25cba1){if(!_[_0xbb10('0x71')](_0x25cba1[_0xbb10('0x6b')])){if(fs[_0xbb10('0x72')](path[_0xbb10('0x6c')](config[_0xbb10('0x6d')],'server/files/images/avatars/',_0x25cba1['systemAvatar']))){_0x1bd1c1=path['join'](config[_0xbb10('0x6d')],_0xbb10('0x77'),_0x25cba1[_0xbb10('0x6b')]);}}return _0x352de4['download'](_0x1bd1c1);}})[_0xbb10('0x1f')](handleError(_0x352de4,null));};exports[_0xbb10('0x7b')]=function(_0x2c638d,_0x290280){var _0x2a6589=require(_0xbb10('0x7c'));var _0x485f46=new _0x2a6589();var _0x57fe03=_0x485f46[_0xbb10('0x7d')](_0x2c638d['headers'][_0xbb10('0x7e')])[_0xbb10('0x7f')]();var _0x152ca9={'body':_0x2c638d[_0xbb10('0x4d')],'channel':_0xbb10('0x80')};var _0x2dfa04=[];var _0x13a29e=[];var _0x1388f6={};var _0xd3c2c8=![];return db[_0xbb10('0x81')]['describe']()[_0xbb10('0x15')](function(_0x5a9277){if(!_0x5a9277){throw new db[(_0xbb10('0x82'))]['ValidationError'](_0xbb10('0x83'));}_0x2dfa04=_[_0xbb10('0x84')](_[_0xbb10('0x36')](_0x5a9277),[_0xbb10('0x85'),'updatedAt']);_0x13a29e=_[_0xbb10('0x84')](_['keys'](_0x5a9277),[_0xbb10('0x85'),_0xbb10('0x86'),_0xbb10('0x87'),'ListId']);if(_0x2c638d[_0xbb10('0x4d')]['id']){delete _0x2c638d[_0xbb10('0x4d')]['id'];}if(_[_0xbb10('0x71')](_0x2c638d[_0xbb10('0x4d')][_0xbb10('0x88')])){throw new db[(_0xbb10('0x82'))]['ValidationError']('from\x20is\x20mandatory');}if(_['isNil'](_0x2c638d[_0xbb10('0x4d')]['body'])||_0x2c638d[_0xbb10('0x4d')]['body']===''){throw new db[(_0xbb10('0x82'))][(_0xbb10('0x89'))](_0xbb10('0x8a'));}if(_['isNil'](_0x2c638d['body'][_0xbb10('0x8b')])){throw new db[(_0xbb10('0x82'))][(_0xbb10('0x89'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x13a29e);}if(!_[_0xbb10('0x8c')](_0x13a29e,_0x2c638d[_0xbb10('0x4d')][_0xbb10('0x8b')])){throw new db['Sequelize']['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x13a29e);}_0x1388f6[_0x2c638d[_0xbb10('0x4d')]['mapKey']]=_0x2c638d[_0xbb10('0x4d')][_0xbb10('0x88')];})[_0xbb10('0x15')](function(){return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x2c638d[_0xbb10('0x57')]['id']},'include':[{'model':db[_0xbb10('0x8d')],'as':_0xbb10('0x8e'),'include':[{'model':db[_0xbb10('0x81')],'as':_0xbb10('0x8f'),'where':_0x1388f6,'limit':0x1,'order':[[_0xbb10('0x86'),'DESC']]}]},{'model':db[_0xbb10('0x90')],'as':_0xbb10('0x91')}]});})['then'](handleEntityNotFound(_0x290280,null))[_0xbb10('0x15')](function(_0x5e3fac){if(_0x5e3fac&&_0x5e3fac['List']){_0x152ca9[_0xbb10('0x92')]=_0x5e3fac;_0x152ca9[_0xbb10('0x93')]=_0x5e3fac[_0xbb10('0x91')];_0x152ca9[_0xbb10('0x94')]=_0x5e3fac[_0xbb10('0x8e')];_0x152ca9['applications']=_[_0xbb10('0x95')](_0x152ca9[_0xbb10('0x93')],['priority'],[_0xbb10('0x96')]);if(_0x152ca9[_0xbb10('0x92')]['Applications']){delete _0x152ca9[_0xbb10('0x92')]['Applications'];}if(_0x152ca9[_0xbb10('0x92')][_0xbb10('0x8e')]&&_0x152ca9[_0xbb10('0x92')][_0xbb10('0x8e')][_0xbb10('0x8f')][_0xbb10('0x3b')]){return _0x152ca9[_0xbb10('0x92')]['List'][_0xbb10('0x8f')][0x0];}var _0x4720a1=_[_0xbb10('0x97')](_0x2c638d[_0xbb10('0x4d')],{'firstName':_0x2c638d[_0xbb10('0x4d')][_0xbb10('0x88')],'ListId':_0x5e3fac['ListId']});_0x4720a1[_0x2c638d['body']['mapKey']]=_0x2c638d[_0xbb10('0x4d')][_0xbb10('0x88')];return db[_0xbb10('0x81')][_0xbb10('0x4c')](_0x4720a1,{'fields':_0x2dfa04,'raw':!![]});}})['then'](handleEntityNotFound(_0x290280,null))[_0xbb10('0x15')](function(_0x3d7b4d){_0x152ca9[_0xbb10('0x98')]=_0x3d7b4d;var _0x577d27=_0x2c638d['body'][_0xbb10('0x99')];if(_0x2c638d['headers'][_0xbb10('0x9a')]){_0x577d27=_0x2c638d[_0xbb10('0x9b')][_0xbb10('0x9a')];}else if(_0x2c638d[_0xbb10('0x9b')][_0xbb10('0x9c')]){_0x577d27=_[_0xbb10('0x9d')](_0x2c638d[_0xbb10('0x9b')]['x-forwarded-for'][_0xbb10('0x9e')](','));}if(_0x3d7b4d){var _0x1eca6c={'ContactId':_0x3d7b4d['id'],'ChatWebsiteId':_0x2c638d['params']['id'],'from':(_0x3d7b4d[_0xbb10('0x9f')]||'')+'\x20'+(_0x3d7b4d[_0xbb10('0xa0')]||''),'customerIp':_0x577d27,'customerPort':_0x2c638d[_0xbb10('0x9b')]['x-real-port']?_0x2c638d['headers']['x-real-port']:null,'referer':_0x2c638d[_0xbb10('0x4d')][_0xbb10('0xa1')],'browserName':_0x57fe03['browser'][_0xbb10('0x2e')]&&_0x57fe03[_0xbb10('0xa2')][_0xbb10('0xa3')]?util[_0xbb10('0xa4')](_0xbb10('0xa5'),_0x57fe03[_0xbb10('0xa2')][_0xbb10('0x2e')],_0x57fe03['browser'][_0xbb10('0xa3')]):'unknown','browserVersion':_0x57fe03['browser']['version']||_0xbb10('0xa6'),'osName':util[_0xbb10('0xa4')]('%s\x20%s',_0x57fe03['os'][_0xbb10('0x2e')],_0x57fe03['os']['version']),'osVersion':_0x57fe03['os'][_0xbb10('0xa3')],'deviceModel':_0x57fe03[_0xbb10('0xa7')][_0xbb10('0x35')]&&_0x57fe03['device']['vendor']?util[_0xbb10('0xa4')]('%s\x20%s\x20%s',_0x57fe03[_0xbb10('0xa7')][_0xbb10('0x35')],_0x57fe03['device']['vendor'],_0x57fe03[_0xbb10('0xa7')][_0xbb10('0x43')]):null,'deviceVendor':_0x57fe03[_0xbb10('0xa7')]['vendor'],'deviceType':_0x57fe03[_0xbb10('0xa7')][_0xbb10('0x43')],'formData':JSON[_0xbb10('0x1b')](_0x2c638d['body'])};var _0x414066={'ChatWebsiteId':_0x2c638d[_0xbb10('0x57')]['id'],'closed':![]};if(_0x2c638d[_0xbb10('0x4d')][_0xbb10('0xa8')]){_0x414066[_0xbb10('0xa8')]=_0x2c638d[_0xbb10('0x4d')][_0xbb10('0xa8')];return db[_0xbb10('0xa9')][_0xbb10('0x56')]({'where':_0x414066})[_0xbb10('0x15')](function(_0x10ca4a){if(_0x10ca4a){return[_0x10ca4a,![]];}_0x1eca6c[_0xbb10('0xa8')]=_0x2c638d[_0xbb10('0x4d')]['threadId'];_0x1eca6c['externalUrl']=_0x2c638d[_0xbb10('0x4d')]['externalUrl'];return db[_0xbb10('0xa9')][_0xbb10('0x4c')](_0x1eca6c)[_0xbb10('0x15')](function(_0x4e5236){return[_0x4e5236,!![]];});});}_0x414066[_0xbb10('0xaa')]=_0x3d7b4d['id'];if(_0x2c638d[_0xbb10('0x4d')][_0xbb10('0xab')]&&_0x2c638d[_0xbb10('0x4d')][_0xbb10('0xab')]['id']){_0x414066['id']=_0x2c638d['body'][_0xbb10('0xab')]['id'];return db[_0xbb10('0xa9')][_0xbb10('0x56')]({'where':_0x414066})[_0xbb10('0x15')](function(_0x150d4c){if(_0x150d4c){return[_0x150d4c,![]];}return db[_0xbb10('0xa9')]['create'](_0x1eca6c)[_0xbb10('0x15')](function(_0x2f0262){return[_0x2f0262,!![]];});});}return db['ChatInteraction'][_0xbb10('0x4c')](_0x1eca6c)[_0xbb10('0x15')](function(_0x2d0de5){return[_0x2d0de5,!![]];});}})[_0xbb10('0xac')](function(_0x3abc15,_0x43df3c){if(_0x3abc15){_0xd3c2c8=_0x43df3c;if(!_0x43df3c){var _0x45593c={'from':(_0x152ca9[_0xbb10('0x98')][_0xbb10('0x9f')]||'')+'\x20'+(_0x152ca9[_0xbb10('0x98')][_0xbb10('0xa0')]||'')};if(_0x2c638d[_0xbb10('0x4d')][_0xbb10('0xa8')]&&_0x2c638d[_0xbb10('0x4d')][_0xbb10('0xad')]&&_0x2c638d['body'][_0xbb10('0xa8')]!=_0x2c638d[_0xbb10('0x4d')]['messageId']){_0x45593c['threadId']=_0x2c638d[_0xbb10('0x4d')][_0xbb10('0xad')];}return _0x3abc15[_0xbb10('0x55')](_0x45593c);}else{return _0x3abc15;}}})[_0xbb10('0x15')](function(_0x27fb82){_0x152ca9[_0xbb10('0xab')]=_0x27fb82[_0xbb10('0x2b')]({'plain':!![]});_0x152ca9[_0xbb10('0xab')][_0xbb10('0xae')]=_0xd3c2c8;if(_0x152ca9['interaction']['created']){if(_0x152ca9['account']['autoclose']){_0x152ca9['applications']['push']({'id':0x0,'priority':_0x152ca9[_0xbb10('0x93')][_0xbb10('0x3b')]+0x1,'app':_0xbb10('0xaf'),'appdata':_0xbb10('0xb0'),'interval':'*,*,*,*'});}}return db[_0xbb10('0xb1')][_0xbb10('0x4c')]({'body':_0x2c638d[_0xbb10('0x4d')][_0xbb10('0x4d')],'ChatWebsiteId':_0x2c638d['params']['id'],'ChatInteractionId':_0x27fb82['id'],'direction':'in','ContactId':_0x152ca9['contact']['id'],'AttachmentId':_0x2c638d[_0xbb10('0x4d')][_0xbb10('0xb2')]});})['then'](function(_0x581832){_0x152ca9[_0xbb10('0x1e')]=_0x581832;if(_0x152ca9[_0xbb10('0xab')][_0xbb10('0xb3')]){return db[_0xbb10('0xb4')][_0xbb10('0x56')]({'attributes':['id','name'],'where':{'id':_0x152ca9[_0xbb10('0xab')]['UserId']}})['then'](function(_0x9d96e2){if(_0x9d96e2){_0x152ca9[_0xbb10('0x93')][_0xbb10('0xb5')]({'id':0x0,'priority':0x0,'app':_0xbb10('0xb6'),'appdata':_0x9d96e2[_0xbb10('0x2e')]+','+(_0x152ca9[_0xbb10('0x92')]['waitForTheAssignedAgent']||0xa),'interval':_0xbb10('0xb7')});_0x152ca9[_0xbb10('0xb8')]=!![];}return respondWithRpcPromise(_0xbb10('0xb9'),_0xbb10('0xba'),_0x152ca9);});}return respondWithRpcPromise(_0xbb10('0xb9'),_0xbb10('0xba'),_0x152ca9);})[_0xbb10('0x15')](function(_0xce60f4){respondWithRpcPromise(_0xbb10('0xbb'),_0xbb10('0xbb'),{'event':_0xbb10('0x7b'),'message':_0xce60f4},client9002);return _0xce60f4;})[_0xbb10('0x15')](respondWithResult(_0x290280,null))[_0xbb10('0x1f')](handleError(_0x290280,null));};exports[_0xbb10('0xbc')]=function(_0x45b31c,_0x3cf074){var _0x232a1b,_0xbdc520,_0x246ee3;var _0x43a203=[];var _0x1ca43e={};var _0x1f84b0=_0x45b31c['files']||[];var _0x2158e2=[];var _0x47883f;return db[_0xbb10('0x81')][_0xbb10('0xbd')]()[_0xbb10('0x15')](function(_0x2b1f0f){if(!_0x2b1f0f){throw new db[(_0xbb10('0x82'))]['ValidationError']('no\x20available\x20attributes');}_0x43a203=_['difference'](_[_0xbb10('0x36')](_0x2b1f0f),[_0xbb10('0x85'),'updatedAt',_0xbb10('0x87'),_0xbb10('0xbe')]);if(_0x45b31c[_0xbb10('0x4d')]['id']){delete _0x45b31c['body']['id'];}if(_[_0xbb10('0x71')](_0x45b31c[_0xbb10('0x4d')][_0xbb10('0x88')])){throw _0x3cf074['status'](0x1f4)[_0xbb10('0xbf')](new db['Sequelize'][(_0xbb10('0x89'))]('from\x20is\x20mandatory'));}if(_['isNil'](_0x45b31c['body']['body'])||_0x45b31c['body']['body']===''){throw _0x3cf074[_0xbb10('0x21')](0x1f4)[_0xbb10('0xbf')](new db[(_0xbb10('0x82'))][(_0xbb10('0x89'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xbb10('0x71')](_0x45b31c[_0xbb10('0x4d')][_0xbb10('0xc0')])){throw _0x3cf074[_0xbb10('0x21')](0x1f4)[_0xbb10('0xbf')](new db[(_0xbb10('0x82'))][(_0xbb10('0x89'))](_0xbb10('0xc1')+_0x43a203));}if(!_[_0xbb10('0x8c')](_0x43a203,_0x45b31c[_0xbb10('0x4d')]['mapKeyOffline'])){throw _0x3cf074[_0xbb10('0x21')](0x1f4)[_0xbb10('0xbf')](new db[(_0xbb10('0x82'))]['ValidationError'](_0xbb10('0xc2')+_0x43a203));}_0x1ca43e[_0x45b31c[_0xbb10('0x4d')][_0xbb10('0xc0')]]=_0x45b31c[_0xbb10('0x4d')]['from'];})[_0xbb10('0x15')](function(){return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x45b31c[_0xbb10('0x57')]['id']},'include':[{'model':db[_0xbb10('0x8d')],'as':_0xbb10('0x8e')},{'model':db[_0xbb10('0xc3')],'as':_0xbb10('0xc3')}]});})[_0xbb10('0x15')](handleEntityNotFound(_0x3cf074,null))[_0xbb10('0x15')](function(_0x3c01ff){if(_0x3c01ff&&_0x3c01ff['List']){_0xbdc520=_0x3c01ff;var _0x59d917=_[_0xbb10('0x97')](_0x45b31c['body'],{'firstName':_0x45b31c['body'][_0xbb10('0x88')],'phone':_0x45b31c[_0xbb10('0x4d')]['from'],'ListId':_0x3c01ff[_0xbb10('0xbe')]});_0x59d917[_0x45b31c[_0xbb10('0x4d')]['mapKeyOffline']]=_0x45b31c[_0xbb10('0x4d')][_0xbb10('0x88')];return db[_0xbb10('0x81')][_0xbb10('0xc4')]({'where':_0x1ca43e,'defaults':_0x59d917});}})[_0xbb10('0xac')](function(_0x4d2c76){if(_0x4d2c76){_0x246ee3=_0x4d2c76;var _0x4fc260=fs['readFileSync'](path[_0xbb10('0x6c')](config['root'],_0xbb10('0xc5')),'utf8');var _0x510467=ejs[_0xbb10('0xc6')](_0x4fc260,{'body':_[_0xbb10('0xc7')](_0x45b31c[_0xbb10('0x4d')][_0xbb10('0x4d')]),'bodyTitle':_0xbdc520[_0xbb10('0xc8')]});return db[_0xbb10('0xc9')]['create']({'body':_0x510467,'plainBody':htmlToText['fromString'](_0x510467),'ContactId':_0x4d2c76['id'],'ChatWebsiteId':_0xbdc520['id']});}})['then'](function(_0x5ad067){_0x47883f=_0x5ad067;if(_0x1f84b0[_0xbb10('0x3b')]){var _0x18632f=_0x1f84b0[_0xbb10('0x30')](function(_0x26bc1c){return{'name':_0x26bc1c[_0xbb10('0xca')],'basename':_0x26bc1c[_0xbb10('0x6a')],'type':_0x26bc1c['mimetype'],'ChatOfflineMessageId':_0x5ad067['id']};});_0x2158e2=_0x18632f[_0xbb10('0x30')](_0x207bbb=>{var _0x35586a={'filename':_0x207bbb[_0xbb10('0x2e')],'path':path['join'](config[_0xbb10('0x6d')],'server','files',_0xbb10('0xcb'),_0xbb10('0xcc'),_0x207bbb[_0xbb10('0xcd')])};return _0x35586a;});if(!_0xbdc520[_0xbb10('0xce')]){return db[_0xbb10('0xcf')][_0xbb10('0xd0')](function(_0x4b7bf8){return db[_0xbb10('0xd1')][_0xbb10('0xd2')](_0x18632f,{'transaction':_0x4b7bf8});});}}})[_0xbb10('0x15')](function(){if(_0x47883f){_0x232a1b=_0x47883f;return db[_0xbb10('0xc3')][_0xbb10('0x5c')]({'where':{'active':!![]},'include':[{'model':db[_0xbb10('0xd3')],'as':_0xbb10('0xd4'),'raw':!![]}]});}})['then'](function(_0x2cbbb6){if(_0x2cbbb6&&_0x2cbbb6[_0xbb10('0xd4')]&&_0xbdc520[_0xbb10('0xd5')]&&_0xbdc520['forwardOfflineAddress']){var _0x595664={'tls':{'rejectUnauthorized':![]}};if(_0x2cbbb6[_0xbb10('0xd4')][_0xbb10('0xd6')]){_0x595664[_0xbb10('0xd6')]=_0x2cbbb6[_0xbb10('0xd4')][_0xbb10('0xd6')];}else{_0x595664[_0xbb10('0xd7')]=_0x2cbbb6[_0xbb10('0xd4')]['host'];_0x595664[_0xbb10('0xd8')]=_0x2cbbb6[_0xbb10('0xd4')][_0xbb10('0xd8')];_0x595664['secure']=_0x2cbbb6['Smtp']['secure'];}if(_0x2cbbb6['Smtp'][_0xbb10('0xd9')]){_0x595664[_0xbb10('0xda')]={'user':_0x2cbbb6[_0xbb10('0xd4')][_0xbb10('0x4e')],'pass':_0x2cbbb6['Smtp'][_0xbb10('0xdb')]};}return respondWithRpcPromise('SendMail',_0xbb10('0xdc'),{'account':_0x595664,'message':{'from':util[_0xbb10('0xa4')](_0xbb10('0xdd'),_0x2cbbb6[_0xbb10('0x2e')],_0x2cbbb6[_0xbb10('0xde')]||_0x2cbbb6[_0xbb10('0xd4')][_0xbb10('0x4e')]),'to':_0xbdc520[_0xbb10('0xdf')],'subject':_0xbdc520[_0xbb10('0xe0')],'html':_0x232a1b[_0xbb10('0x4d')],'attachments':_0x2158e2}},client9003)[_0xbb10('0x15')](function(){return _0x232a1b;})[_0xbb10('0x1f')](function(_0x4c969d){console[_0xbb10('0x1c')](_0x4c969d);});}})[_0xbb10('0x15')](function(){if(_0xbdc520&&_0xbdc520[_0xbb10('0xce')]&&_0xbdc520['MailAccountId']){var _0x204ebf=[];if(_0x1f84b0['length']){_0x204ebf=_0x1f84b0[_0xbb10('0x30')](function(_0x446bcf){return{'name':_0x446bcf[_0xbb10('0xca')],'basename':_0x446bcf[_0xbb10('0x6a')],'type':_0x446bcf[_0xbb10('0xe1')],'ChatOfflineMessageId':_0x47883f['id']};});}var _0x533327;if(!_['isNil'](_0xbdc520[_0xbb10('0xe2')])){var _0x4cf5cc=_['map'](_0x45b31c[_0xbb10('0x4d')],function(_0x5621b1){return _0x5621b1;});var _0xa9ed32=_[_0xbb10('0xe3')](_0x4cf5cc)[0x0];var _0x3f0a4e=_[_0xbb10('0xe4')](_0xa9ed32,function(_0x309b4a){return _0x309b4a;});_0x533327=_0x3f0a4e[0x1][_0xbdc520[_0xbb10('0xe2')]];}var _0x3a0940={'from':_0x246ee3[_0xbb10('0xde')],'firstName':_0x246ee3['firstName'],'lastName':_0x246ee3[_0xbb10('0xa0')],'mapKey':'email','message':{'from':_0x246ee3[_0xbb10('0xde')],'to':_0xbdc520['MailAccount'][_0xbb10('0xde')],'cc':'','subject':_[_0xbb10('0x71')](_0x533327)?_0xbdc520['offlineMessageSubject']:_0x533327,'messageId':'','sentAt':new Date(),'attach':_0x204ebf[_0xbb10('0x3b')],'attachments':_0x204ebf,'originChannel':_0xbb10('0xe5'),'ChatWebsiteId':_0xbdc520['id'],'ChatOfflineMessageId':_0x232a1b['id'],'originTo':_0xbdc520[_0xbb10('0xc3')]['email']},'body':_0x232a1b[_0xbb10('0x4d')]};var _0x1a8503={'account':{'id':_0xbdc520[_0xbb10('0xe6')]},'body':_0x3a0940,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0xbb10('0xe7'),_0xbb10('0xe8'),_0x1a8503,client9001)[_0xbb10('0x15')](function(){return _0x232a1b;})['catch'](function(_0x3e6756){console['error'](_0x3e6756);});}return;})[_0xbb10('0x15')](function(){if(_0x232a1b){return _0x232a1b;}})[_0xbb10('0x15')](respondWithResult(_0x3cf074,null))[_0xbb10('0x1f')](function(_0xd94118){console[_0xbb10('0x1c')](_0xbb10('0x1f'),_0xd94118);for(var _0x23e592 of _0x1f84b0){var _0x44d28a=path[_0xbb10('0x6c')](config[_0xbb10('0x6d')],'server','files',_0xbb10('0xcb'),_0xbb10('0xcc'),_0x23e592[_0xbb10('0x6a')]);fs_extra['remove'](_0x44d28a)[_0xbb10('0x1f')](function(_0x1067f2){console[_0xbb10('0x1c')](_0xbb10('0xe9'),_0x44d28a,_0x1067f2);});}});};exports[_0xbb10('0xea')]=function(_0x431673,_0x81d970){return db[_0xbb10('0xa9')][_0xbb10('0x56')]({'where':{'id':_0x431673['params']['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x81d970,null))[_0xbb10('0x15')](function(_0x4102af){if(_0x4102af){return _0x4102af[_0xbb10('0xea')](_0x431673['body'][_0xbb10('0x5e')],_[_0xbb10('0xeb')](_0x431673[_0xbb10('0x4d')],['ids','id'])||{});}})['then'](respondWithResult(_0x81d970,null))[_0xbb10('0x1f')](handleError(_0x81d970,null));};exports['getInteractions']=function(_0x37c688,_0x4874be){var _0x3fd69e={'raw':![],'where':{}};var _0x1aa860={};var _0x28cd8e={'count':0x0,'rows':[]};return db[_0xbb10('0x31')][_0xbb10('0x5c')]({'where':{'id':_0x37c688[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x4874be,null))['then'](function(_0x20c514){if(_0x20c514){_0x1aa860[_0xbb10('0x35')]=_[_0xbb10('0x36')](db[_0xbb10('0xa9')][_0xbb10('0x32')]);_0x1aa860[_0xbb10('0x37')]=_['keys'](_0x37c688[_0xbb10('0x37')]);_0x1aa860[_0xbb10('0x38')]=_[_0xbb10('0x4a')](_0x1aa860[_0xbb10('0x35')],_0x1aa860[_0xbb10('0x37')]);_0x3fd69e[_0xbb10('0x39')]=_[_0xbb10('0x4a')](_0x1aa860['model'],qs[_0xbb10('0x3a')](_0x37c688[_0xbb10('0x37')][_0xbb10('0x3a')]));_0x3fd69e['attributes']=_0x3fd69e[_0xbb10('0x39')]['length']?_0x3fd69e[_0xbb10('0x39')]:_0x1aa860[_0xbb10('0x35')];if(!_0x37c688[_0xbb10('0x37')]['hasOwnProperty']('nolimit')){_0x3fd69e[_0xbb10('0x27')]=qs[_0xbb10('0x27')](_0x37c688[_0xbb10('0x37')][_0xbb10('0x27')]);_0x3fd69e[_0xbb10('0x24')]=qs[_0xbb10('0x24')](_0x37c688[_0xbb10('0x37')][_0xbb10('0x24')]);}_0x3fd69e[_0xbb10('0x3e')]=qs[_0xbb10('0x3f')](_0x37c688[_0xbb10('0x37')]['sort']);_0x3fd69e['where']=qs[_0xbb10('0x38')](_[_0xbb10('0x40')](_0x37c688['query'],_0x1aa860['filters']));_0x3fd69e[_0xbb10('0x41')][_0xbb10('0x59')]=_0x20c514['id'];if(_0x37c688[_0xbb10('0x37')]['filter']){_0x3fd69e[_0xbb10('0x41')]=_[_0xbb10('0x42')](_0x3fd69e['where'],{'$or':_[_0xbb10('0x30')](_0x3fd69e[_0xbb10('0x39')],function(_0x544c9c){var _0x5a5349={};_0x5a5349[_0x544c9c]={'$like':'%'+_0x37c688[_0xbb10('0x37')][_0xbb10('0x44')]+'%'};return _0x5a5349;})});}_0x3fd69e=_[_0xbb10('0x42')]({},_0x3fd69e,_0x37c688['options']);return db['ChatInteraction'][_0xbb10('0x26')]({'where':_0x3fd69e[_0xbb10('0x41')]})['then'](function(_0x1e9dd2){_0x28cd8e[_0xbb10('0x26')]=_0x1e9dd2;if(_0x37c688['query'][_0xbb10('0x46')]){_0x3fd69e[_0xbb10('0x4b')]=[{'model':db[_0xbb10('0x81')],'as':_0xbb10('0xec'),'required':![]},{'model':db['User'],'as':_0xbb10('0xed'),'attributes':['name',_0xbb10('0xee'),_0xbb10('0xef')],'required':![]},{'model':db[_0xbb10('0xf0')],'as':_0xbb10('0xf1'),'attributes':['id',_0xbb10('0x2e'),_0xbb10('0xf2')],'where':_0x37c688[_0xbb10('0x37')][_0xbb10('0xf3')]?{'id':_0x37c688['query'][_0xbb10('0xf3')]}:undefined,'required':_0x37c688[_0xbb10('0x37')][_0xbb10('0xf3')]?!![]:![]}];}return db[_0xbb10('0xa9')]['findAll'](_0x3fd69e);})['then'](function(_0xd23108){_0x28cd8e[_0xbb10('0x48')]=_0xd23108;return _0x28cd8e;});}})[_0xbb10('0x15')](respondWithFilteredResult(_0x4874be,_0x3fd69e))[_0xbb10('0x1f')](handleError(_0x4874be,null));};function iftimePromise(_0x5b2e0b,_0x215028){return respondWithRpcPromise(_0xbb10('0xf4'),'getSnippet',{'command':_0x215028[_0xbb10('0xf5')]?util['format']('iftime\x20%s,%s',_0x5b2e0b[_0xbb10('0xf6')],_0x215028[_0xbb10('0xf5')]):util[_0xbb10('0xa4')](_0xbb10('0xf7'),_0x5b2e0b[_0xbb10('0xf6')])},client9002)['then'](function(_0x38403e){var _0x262078=_0x38403e&&_0x38403e[_0xbb10('0xf8')](_0xbb10('0xf9'))>=0x0?!![]:![];logger[_0xbb10('0x16')](_0xbb10('0xfa'),_0x215028['id'],_0x5b2e0b['id'],_0x5b2e0b[_0xbb10('0xf6')],_0x262078?_0xbb10('0xfb'):_0xbb10('0xfc'),_0x215028[_0xbb10('0xf5')]?_0x215028[_0xbb10('0xf5')]:_0xbb10('0xfd'));return _0x262078;})[_0xbb10('0x1f')](function(_0x9fcc26){logger[_0xbb10('0x1c')](_0xbb10('0xfa'),_0x215028['id'],_0x5b2e0b['id'],_0x5b2e0b[_0xbb10('0xf6')],util[_0xbb10('0xfe')](_0x9fcc26,{'showHidden':![],'depth':null}),_0x215028[_0xbb10('0xf5')]?_0x215028[_0xbb10('0xf5')]:_0xbb10('0xfd'));return![];});}exports[_0xbb10('0xff')]=function(_0x1b4873,_0x1ca72c){var _0x36615e=0x0;var _0x2f38d3=0x0;var _0x5a4d21=![];var _0x57b891;var _0x19eaa2;return db[_0xbb10('0x31')]['find']({'where':{'id':_0x1b4873[_0xbb10('0x57')]['id']},'include':[{'model':db[_0xbb10('0x100')],'as':'Interval','include':[{'model':db[_0xbb10('0x100')],'as':_0xbb10('0x101'),'attributes':['id','interval'],'raw':!![]}]}]})[_0xbb10('0x15')](handleEntityNotFound(_0x1ca72c,null))[_0xbb10('0x15')](function(_0xb4fdea){if(_0xb4fdea){_0x57b891=_0xb4fdea;return _0xb4fdea[_0xbb10('0x102')]({'raw':!![]});}})['then'](function(_0x170061){if(_0x57b891){if(_0x170061){_0x19eaa2=_0x170061;}}return require(_0xbb10('0x6f'))[_0xbb10('0x103')]();})[_0xbb10('0x15')](function(_0x5c0732){if(_0x5c0732){_0x2f38d3=_0x5c0732[_0xbb10('0x104')];_0x5a4d21=_0x5c0732[_0xbb10('0x70')];}})[_0xbb10('0x15')](function(){return db[_0xbb10('0xa9')][_0xbb10('0x26')]({'where':{'closed':![]}});})[_0xbb10('0x15')](function(_0x2f626b){_0x36615e=_0x2f626b;if(_0x2f38d3&&_0x2f626b>_0x2f38d3){return db[_0xbb10('0x105')][_0xbb10('0x5c')]({'where':{'id':0x1}})[_0xbb10('0x15')](function(_0x2fd942){if(_0x2fd942){_0x2fd942['increment'](_0xbb10('0x106'));}});}})[_0xbb10('0x15')](function(){if(_0x57b891[_0xbb10('0x100')]&&_0x57b891[_0xbb10('0x100')]['Intervals']){var _0x5116d8=[];for(var _0x8bfc0f=0x0;_0x8bfc0f<_0x57b891[_0xbb10('0x100')][_0xbb10('0x101')][_0xbb10('0x3b')];_0x8bfc0f++){var _0x5f0576=_0x57b891[_0xbb10('0x100')][_0xbb10('0x101')][_0x8bfc0f][_0xbb10('0x2b')]({'plain':!![]});_0x5116d8['push'](iftimePromise(_0x5f0576,_0x57b891));}return BPromise['all'](_0x5116d8)[_0xbb10('0x15')](function(_0xd6b33){return _['some'](_0xd6b33);});}else{return!![];}})['then'](function(_0x424bb1){var _0x615606=fs[_0xbb10('0x107')](path[_0xbb10('0x6c')](config[_0xbb10('0x6d')],_0xbb10('0x108')),'utf8');var _0x408544={'remote':_0x57b891[_0xbb10('0x109')],'query':querystring[_0xbb10('0x1b')](_[_0xbb10('0x42')](_0x57b891[_0xbb10('0x2b')]({'plain':!![]}),{'customerIp':_0x1b4873[_0xbb10('0x9b')][_0xbb10('0x9c')]||_0x1b4873[_0xbb10('0x9b')][_0xbb10('0x10a')]||_0x1b4873[_0xbb10('0x10b')]['remoteAddress']||_0x1b4873['ip'],'referer':_0x1b4873[_0xbb10('0x9b')][_0xbb10('0xa1')],'openedInteractions':_0x36615e,'maxInteractions':_0x2f38d3,'virtual':_0x5a4d21['virtual'],'online':_0x424bb1,'custom':_0x5a4d21}))['replace'](/'/g,'\x5c\x27')};_0x1ca72c['send'](ejs['render'](Mustache['render'](_0x615606,_0x408544),{'proactiveActions':_0x19eaa2,'alignment':_0x57b891['alignment'],'verticalAlignment':_0x57b891['verticalAlignment'],'div_color':_0x57b891['color'],'labelText':_0x57b891[_0xbb10('0x10c')],'text_color':_0x57b891[_0xbb10('0x10d')],'button_color':_0x57b891['color_button'],'background_color':_0x57b891[_0xbb10('0x10e')]}));})[_0xbb10('0x1f')](handleError(_0x1ca72c,null));};exports[_0xbb10('0x10f')]=function(_0x3b9bec,_0x1d099a){var _0x1d36fa=_0x3b9bec[_0xbb10('0x57')]['id'];var _0x23179d=_0x3b9bec[_0xbb10('0x4d')];var _0x14d9e7=0xc8;var _0x19dfef=null;return db[_0xbb10('0xcf')]['transaction']({'isolationLevel':db[_0xbb10('0xcf')][_0xbb10('0x110')][_0xbb10('0x111')][_0xbb10('0x112')]},function(_0x155f92){return db['ChatWebsite'][_0xbb10('0x5c')]({'where':{'id':_0x1d36fa},'transaction':_0x155f92})['then'](function(_0x52209c){if(_0x52209c){return db[_0xbb10('0x90')][_0xbb10('0x2a')]({'where':{'ChatWebsiteId':_0x1d36fa},'transaction':_0x155f92})['then'](function(){var _0x3e433b=_[_0xbb10('0x30')](_0x23179d,function(_0x201e05){_0x201e05[_0xbb10('0x59')]=_0x1d36fa;return _0x201e05;});return db[_0xbb10('0x90')]['bulkCreate'](_0x3e433b,{'transaction':_0x155f92});});}else{_0x14d9e7=0x194;_0x19dfef=[];}});})['then'](function(){if(_0x14d9e7!==0x194){return db[_0xbb10('0x90')][_0xbb10('0x113')]({'where':{'ChatWebsiteId':_0x1d36fa},'order':'priority'})[_0xbb10('0x15')](function(_0x4cf976){_0x19dfef=_0x4cf976;});}})[_0xbb10('0x1f')](function(_0x1a2f42){_0x14d9e7=0x1f4;logger[_0xbb10('0x1c')](_0x1a2f42[_0xbb10('0x2d')]);if(_0x1a2f42[_0xbb10('0x2e')]){delete _0x1a2f42[_0xbb10('0x2e')];}_0x19dfef=_0x1a2f42;})[_0xbb10('0x114')](function(){if(_0x19dfef===null){_0x1d099a['sendStatus'](_0x14d9e7);}else{if(_0x14d9e7===0x1f4){_0x1d099a[_0xbb10('0x21')](_0x14d9e7)[_0xbb10('0xbf')](_0x19dfef);}else{_0x1d099a[_0xbb10('0x21')](_0x14d9e7)[_0xbb10('0x23')](_0x19dfef);}}});};exports['getApplications']=function(_0x20347b,_0x22ffc6){var _0x530785={};var _0x49ef50={};var _0xeac82d;var _0x5a4de3;return db[_0xbb10('0x31')][_0xbb10('0x5c')]({'where':{'id':_0x20347b[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x22ffc6,null))['then'](function(_0x90ab9f){if(_0x90ab9f){_0xeac82d=_0x90ab9f;_0x49ef50['model']=_[_0xbb10('0x36')](db[_0xbb10('0x90')][_0xbb10('0x32')]);_0x49ef50[_0xbb10('0x37')]=_[_0xbb10('0x36')](_0x20347b[_0xbb10('0x37')]);_0x49ef50[_0xbb10('0x38')]=_[_0xbb10('0x4a')](_0x49ef50[_0xbb10('0x35')],_0x49ef50['query']);_0x530785[_0xbb10('0x39')]=_[_0xbb10('0x4a')](_0x49ef50[_0xbb10('0x35')],qs[_0xbb10('0x3a')](_0x20347b[_0xbb10('0x37')]['fields']));_0x530785[_0xbb10('0x39')]=_0x530785[_0xbb10('0x39')][_0xbb10('0x3b')]?_0x530785[_0xbb10('0x39')]:_0x49ef50[_0xbb10('0x35')];_0x530785['order']=qs['sort'](_0x20347b['query'][_0xbb10('0x3f')]);_0x530785['where']=qs['filters'](_[_0xbb10('0x40')](_0x20347b['query'],_0x49ef50[_0xbb10('0x38')]));if(_0x20347b[_0xbb10('0x37')]['filter']){_0x530785[_0xbb10('0x41')]=_[_0xbb10('0x42')](_0x530785[_0xbb10('0x41')],{'$or':_[_0xbb10('0x30')](_0x530785['attributes'],function(_0x4b08b2){var _0x57abfe={};_0x57abfe[_0x4b08b2]={'$like':'%'+_0x20347b[_0xbb10('0x37')][_0xbb10('0x44')]+'%'};return _0x57abfe;})});}_0x530785=_['merge']({},_0x530785,_0x20347b[_0xbb10('0x45')]);return _0xeac82d[_0xbb10('0x115')](_0x530785);}})[_0xbb10('0x15')](function(_0x33a92a){if(_0x33a92a){_0x5a4de3=_0x33a92a[_0xbb10('0x3b')];if(!_0x20347b['query'][_0xbb10('0x3c')](_0xbb10('0x3d'))){_0x530785[_0xbb10('0x27')]=qs['limit'](_0x20347b[_0xbb10('0x37')]['limit']);_0x530785[_0xbb10('0x24')]=qs[_0xbb10('0x24')](_0x20347b[_0xbb10('0x37')]['offset']);}return _0xeac82d[_0xbb10('0x115')](_0x530785);}})[_0xbb10('0x15')](function(_0x4ba58f){if(_0x4ba58f){return _0x4ba58f?{'count':_0x5a4de3,'rows':_0x4ba58f}:null;}})[_0xbb10('0x15')](respondWithResult(_0x22ffc6,null))[_0xbb10('0x1f')](handleError(_0x22ffc6,null));};exports[_0xbb10('0x116')]=function(_0x2e03eb,_0x24e7bc){return db['chatProactiveAction']['find']({'where':{'id':_0x2e03eb[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x24e7bc,null))[_0xbb10('0x15')](function(_0x1b0734){if(_0x1b0734){return _0x1b0734[_0xbb10('0x116')](_0x2e03eb['body'][_0xbb10('0x5e')],_[_0xbb10('0xeb')](_0x2e03eb[_0xbb10('0x4d')],[_0xbb10('0x5e'),'id'])||{});}})[_0xbb10('0x15')](respondWithResult(_0x24e7bc,null))['catch'](handleError(_0x24e7bc,null));};exports['getProactiveActions']=function(_0x2f675c,_0x18f6b1){var _0x1052f5={};var _0x119e8f={};var _0x5a031b;var _0x4c8e28;return db[_0xbb10('0x31')]['findOne']({'where':{'id':_0x2f675c['params']['id']}})['then'](handleEntityNotFound(_0x18f6b1,null))['then'](function(_0x3758dd){if(_0x3758dd){_0x5a031b=_0x3758dd;_0x119e8f[_0xbb10('0x35')]=_[_0xbb10('0x36')](db[_0xbb10('0x117')][_0xbb10('0x32')]);_0x119e8f['query']=_[_0xbb10('0x36')](_0x2f675c[_0xbb10('0x37')]);_0x119e8f[_0xbb10('0x38')]=_['intersection'](_0x119e8f[_0xbb10('0x35')],_0x119e8f[_0xbb10('0x37')]);_0x1052f5[_0xbb10('0x39')]=_[_0xbb10('0x4a')](_0x119e8f[_0xbb10('0x35')],qs[_0xbb10('0x3a')](_0x2f675c[_0xbb10('0x37')][_0xbb10('0x3a')]));_0x1052f5[_0xbb10('0x39')]=_0x1052f5[_0xbb10('0x39')][_0xbb10('0x3b')]?_0x1052f5[_0xbb10('0x39')]:_0x119e8f[_0xbb10('0x35')];_0x1052f5[_0xbb10('0x3e')]=qs[_0xbb10('0x3f')](_0x2f675c['query']['sort']);_0x1052f5['where']=qs[_0xbb10('0x38')](_['pick'](_0x2f675c[_0xbb10('0x37')],_0x119e8f['filters']));if(_0x2f675c[_0xbb10('0x37')]['filter']){_0x1052f5['where']=_[_0xbb10('0x42')](_0x1052f5[_0xbb10('0x41')],{'$or':_['map'](_0x1052f5[_0xbb10('0x39')],function(_0x131d48){var _0x338e7a={};_0x338e7a[_0x131d48]={'$like':'%'+_0x2f675c[_0xbb10('0x37')]['filter']+'%'};return _0x338e7a;})});}_0x1052f5=_['merge']({},_0x1052f5,_0x2f675c[_0xbb10('0x45')]);return _0x5a031b[_0xbb10('0x102')](_0x1052f5);}})[_0xbb10('0x15')](function(_0x53f3c2){if(_0x53f3c2){_0x4c8e28=_0x53f3c2[_0xbb10('0x3b')];if(!_0x2f675c[_0xbb10('0x37')][_0xbb10('0x3c')]('nolimit')){_0x1052f5[_0xbb10('0x27')]=qs['limit'](_0x2f675c['query'][_0xbb10('0x27')]);_0x1052f5['offset']=qs[_0xbb10('0x24')](_0x2f675c[_0xbb10('0x37')][_0xbb10('0x24')]);}return _0x5a031b[_0xbb10('0x102')](_0x1052f5);}})[_0xbb10('0x15')](function(_0x57a6bc){if(_0x57a6bc){return _0x57a6bc?{'count':_0x4c8e28,'rows':_0x57a6bc}:null;}})[_0xbb10('0x15')](respondWithResult(_0x18f6b1,null))[_0xbb10('0x1f')](handleError(_0x18f6b1,null));};exports[_0xbb10('0x118')]=function(_0x2701e8,_0x1b0086){var _0x1c387b=_0x2701e8['query']['online']===_0xbb10('0x119')?_0xbb10('0x11a'):_0xbb10('0x11b');return db[_0xbb10('0x31')][_0xbb10('0x56')]({'attributes':['id',_0x1c387b],'where':{'id':_0x2701e8['params']['id']}})['then'](handleEntityNotFound(_0x1b0086,null))[_0xbb10('0x15')](function(_0x23cbf4){if(_0x23cbf4){var _0x536519=_0x23cbf4[_0x1c387b];var _0x50dde9=_0x536519&&_0x536519[_0xbb10('0x11c')]?_0x536519[_0xbb10('0x11c')]:[];_0x1b0086[_0xbb10('0xbf')]({'fromKey':_[_0xbb10('0x71')](_0x536519[_0xbb10('0x11d')])?undefined:_0x536519[_0xbb10('0x11d')],'count':_0x50dde9['length'],'rows':_0x50dde9});}})[_0xbb10('0x1f')](handleError(_0x1b0086,null));};exports[_0xbb10('0x11e')]=function(_0x261c9b,_0x232794){var _0x35b3f8={'raw':![],'where':{}};var _0x3783d0={};var _0xdd7d5c={'count':0x0,'rows':[]};return db[_0xbb10('0x31')][_0xbb10('0x5c')]({'where':{'id':_0x261c9b['params']['id']}})['then'](handleEntityNotFound(_0x232794,null))['then'](function(_0x111c15){if(_0x111c15){_0x3783d0[_0xbb10('0x35')]=_[_0xbb10('0x36')](db[_0xbb10('0xc9')]['rawAttributes']);_0x3783d0['query']=_['keys'](_0x261c9b[_0xbb10('0x37')]);_0x3783d0[_0xbb10('0x38')]=_[_0xbb10('0x4a')](_0x3783d0[_0xbb10('0x35')],_0x3783d0[_0xbb10('0x37')]);_0x35b3f8[_0xbb10('0x39')]=_[_0xbb10('0x4a')](_0x3783d0[_0xbb10('0x35')],qs[_0xbb10('0x3a')](_0x261c9b[_0xbb10('0x37')][_0xbb10('0x3a')]));_0x35b3f8[_0xbb10('0x39')]=_0x35b3f8[_0xbb10('0x39')][_0xbb10('0x3b')]?_0x35b3f8['attributes']:_0x3783d0[_0xbb10('0x35')];if(!_0x261c9b[_0xbb10('0x37')][_0xbb10('0x3c')](_0xbb10('0x3d'))){_0x35b3f8[_0xbb10('0x27')]=qs[_0xbb10('0x27')](_0x261c9b['query'][_0xbb10('0x27')]);_0x35b3f8[_0xbb10('0x24')]=qs[_0xbb10('0x24')](_0x261c9b[_0xbb10('0x37')][_0xbb10('0x24')]);}_0x35b3f8[_0xbb10('0x3e')]=qs[_0xbb10('0x3f')](_0x261c9b[_0xbb10('0x37')][_0xbb10('0x3f')]);_0x35b3f8['where']=qs[_0xbb10('0x38')](_[_0xbb10('0x40')](_0x261c9b[_0xbb10('0x37')],_0x3783d0[_0xbb10('0x38')]));_0x35b3f8[_0xbb10('0x41')][_0xbb10('0x59')]=_0x111c15['id'];if(_0x261c9b[_0xbb10('0x37')][_0xbb10('0x44')]){_0x35b3f8[_0xbb10('0x41')]=_['merge'](_0x35b3f8[_0xbb10('0x41')],{'$or':_['map'](_0x35b3f8[_0xbb10('0x39')],function(_0x2cd1b0){var _0x57e0b2={};_0x57e0b2[_0x2cd1b0]={'$like':'%'+_0x261c9b['query'][_0xbb10('0x44')]+'%'};return _0x57e0b2;})});}_0x35b3f8=_[_0xbb10('0x42')]({},_0x35b3f8,_0x261c9b[_0xbb10('0x45')]);return db[_0xbb10('0xc9')][_0xbb10('0x26')]({'where':_0x35b3f8[_0xbb10('0x41')]})[_0xbb10('0x15')](function(_0x40a208){_0xdd7d5c[_0xbb10('0x26')]=_0x40a208;if(_0x261c9b[_0xbb10('0x37')][_0xbb10('0x46')]){_0x35b3f8[_0xbb10('0x4b')]=[{'all':!![]}];}else{_0x35b3f8[_0xbb10('0x4b')]=[{'model':db[_0xbb10('0x81')],'as':_0xbb10('0xec'),'required':![]},{'model':db['Attachment'],'as':_0xbb10('0x11f'),'required':![]}];}return db['ChatOfflineMessage'][_0xbb10('0x47')](_0x35b3f8);})[_0xbb10('0x15')](function(_0x234dc5){_0xdd7d5c[_0xbb10('0x48')]=_0x234dc5;return _0xdd7d5c;});}})[_0xbb10('0x15')](respondWithFilteredResult(_0x232794,_0x35b3f8))[_0xbb10('0x1f')](handleError(_0x232794,null));};exports[_0xbb10('0x120')]=function(_0x45dcaa,_0x5c88bd){return db['ChatWebsite']['find']({'where':{'id':_0x45dcaa[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x5c88bd,null))[_0xbb10('0x15')](function(_0x54c61c){if(_0x54c61c){return _0x54c61c[_0xbb10('0x120')](_0x45dcaa['body'][_0xbb10('0x5e')],_[_0xbb10('0xeb')](_0x45dcaa['body'],[_0xbb10('0x5e'),'id'])||{})[_0xbb10('0xac')](function(_0xa52322){for(var _0xc1691=0x0;_0xc1691<_0x45dcaa[_0xbb10('0x4d')]['ids'][_0xbb10('0x3b')];_0xc1691+=0x1){socket[_0xbb10('0x121')]('userChatWebsite:save',{'UserId':Number(_0x45dcaa[_0xbb10('0x4d')][_0xbb10('0x5e')][_0xc1691]),'ChatWebsiteId':Number(_0x45dcaa['params']['id'])});}return _0xa52322;});}})[_0xbb10('0x15')](respondWithResult(_0x5c88bd,null))[_0xbb10('0x1f')](handleError(_0x5c88bd,null));};exports[_0xbb10('0x122')]=function(_0x24f1d2,_0x481a0a){return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x24f1d2[_0xbb10('0x57')]['id']}})['then'](handleEntityNotFound(_0x481a0a,null))['then'](function(_0x284b77){if(_0x284b77){return _0x284b77[_0xbb10('0x122')](_0x24f1d2[_0xbb10('0x37')][_0xbb10('0x5e')])['then'](function(){if(_[_0xbb10('0x123')](_0x24f1d2[_0xbb10('0x37')][_0xbb10('0x5e')])){for(var _0x28c680=0x0;_0x28c680<_0x24f1d2[_0xbb10('0x37')]['ids']['length'];_0x28c680+=0x1){socket[_0xbb10('0x121')](_0xbb10('0x124'),{'UserId':Number(_0x24f1d2['query']['ids'][_0x28c680]),'ChatWebsiteId':Number(_0x24f1d2[_0xbb10('0x57')]['id'])});}}else{socket[_0xbb10('0x121')](_0xbb10('0x124'),{'UserId':Number(_0x24f1d2[_0xbb10('0x37')][_0xbb10('0x5e')]),'ChatWebsiteId':Number(_0x24f1d2[_0xbb10('0x57')]['id'])});}});}})['then'](respondWithStatusCode(_0x481a0a,null))['catch'](handleError(_0x481a0a,null));};exports[_0xbb10('0x125')]=function(_0x1c3cbc,_0x24bda8){var _0x27ddfc={};var _0x39a047={};var _0x9a80a7;var _0x5e08c5;return db[_0xbb10('0x31')][_0xbb10('0x5c')]({'where':{'id':_0x1c3cbc[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x24bda8,null))['then'](function(_0x21ad98){if(_0x21ad98){_0x9a80a7=_0x21ad98;_0x39a047[_0xbb10('0x35')]=_[_0xbb10('0x36')](db[_0xbb10('0xb4')][_0xbb10('0x32')]);_0x39a047[_0xbb10('0x37')]=_[_0xbb10('0x36')](_0x1c3cbc[_0xbb10('0x37')]);_0x39a047[_0xbb10('0x38')]=_[_0xbb10('0x4a')](_0x39a047[_0xbb10('0x35')],_0x39a047[_0xbb10('0x37')]);_0x27ddfc['attributes']=_[_0xbb10('0x4a')](_0x39a047[_0xbb10('0x35')],qs['fields'](_0x1c3cbc[_0xbb10('0x37')][_0xbb10('0x3a')]));_0x27ddfc[_0xbb10('0x39')]=_0x27ddfc['attributes'][_0xbb10('0x3b')]?_0x27ddfc[_0xbb10('0x39')]:_0x39a047[_0xbb10('0x35')];_0x27ddfc[_0xbb10('0x3e')]=qs[_0xbb10('0x3f')](_0x1c3cbc[_0xbb10('0x37')]['sort']);_0x27ddfc[_0xbb10('0x41')]=qs['filters'](_[_0xbb10('0x40')](_0x1c3cbc[_0xbb10('0x37')],_0x39a047[_0xbb10('0x38')]));if(_0x1c3cbc[_0xbb10('0x37')]['filter']){_0x27ddfc[_0xbb10('0x41')]=_[_0xbb10('0x42')](_0x27ddfc['where'],{'$or':_[_0xbb10('0x30')](_0x27ddfc['attributes'],function(_0x31c086){var _0x40845c={};_0x40845c[_0x31c086]={'$like':'%'+_0x1c3cbc[_0xbb10('0x37')][_0xbb10('0x44')]+'%'};return _0x40845c;})});}_0x27ddfc=_[_0xbb10('0x42')]({},_0x27ddfc,_0x1c3cbc[_0xbb10('0x45')]);return _0x9a80a7[_0xbb10('0x125')](_0x27ddfc);}})[_0xbb10('0x15')](function(_0x55ee36){if(_0x55ee36){_0x5e08c5=_0x55ee36['length'];if(!_0x1c3cbc[_0xbb10('0x37')][_0xbb10('0x3c')](_0xbb10('0x3d'))){_0x27ddfc[_0xbb10('0x27')]=qs[_0xbb10('0x27')](_0x1c3cbc[_0xbb10('0x37')][_0xbb10('0x27')]);_0x27ddfc[_0xbb10('0x24')]=qs[_0xbb10('0x24')](_0x1c3cbc['query'][_0xbb10('0x24')]);}return _0x9a80a7['getAgents'](_0x27ddfc);}})[_0xbb10('0x15')](function(_0x2a618a){if(_0x2a618a){return _0x2a618a?{'count':_0x5e08c5,'rows':_0x2a618a}:null;}})['then'](respondWithResult(_0x24bda8,null))[_0xbb10('0x1f')](handleError(_0x24bda8,null));}; \ No newline at end of file +var _0x5f66=['Start','startRouting','EventManager','offline','files','send','from\x20is\x20mandatory','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','findOne','MailServerOut','Smtp','forwardOfflineAddress','service','host','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','toPairsIn','mapValues','subjectOffline','Chat','MailAccountId','NotifyMailAccount','notifyMail','attachments','offline-chat','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tags','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','../../config/license/util','virtual','custom','License','increment','chatLicenseExceeded','all','some','x-real-ip','connection','remoteAddress','replace','alignment','color','labelText','textColor','color_button','backgroundColor','addApplications','Transaction','READ_COMMITTED','priority','getApplications','addProactiveActions','ChatProactiveAction','getFields','false','offlineForm','items','fromKey','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','path','ejs','fs-extra','lodash','querystring','../../components/parsers/qs','api','../../config/environment','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','limit','undefined','count','offset','set','Content-Range','json','update','destroy','get','ChatWebsites','UserProfileResource','end','stack','name','index','mandatoryDispositionPause','map','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatWebsite','include','rows','show','params','Pause','keys','rawAttributes','includeAll','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','ChatWebsiteId','Disposition','getDispositions','removeDispositions','addAnswer','getAnswers','CannedAnswer','findAll','removeAnswers','ids','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','getLicense','isNil','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','customerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','getResult','chat','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','ChatApplication','Applications','List','account','applications','list','asc','contact','customerIp','cf-connecting-ip','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','stringify','ChatInteraction','threadId','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','unmanaged','*,*,*,*','AttachmentId','User','unshift','agent','forcedOwnership'];(function(_0x47b5bb,_0xe5e615){var _0x363df1=function(_0x4d1d54){while(--_0x4d1d54){_0x47b5bb['push'](_0x47b5bb['shift']());}};_0x363df1(++_0xe5e615);}(_0x5f66,0x1a0));var _0x65f6=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x5f66[_0x3947c9];return _0x2e7871;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0x65f6('0x0'));var util=require('util');var path=require(_0x65f6('0x1'));var ejs=require(_0x65f6('0x2'));var fs=require('fs');var fs_extra=require(_0x65f6('0x3'));var _=require(_0x65f6('0x4'));var querystring=require(_0x65f6('0x5'));var Redis=require('ioredis');var qs=require(_0x65f6('0x6'));var logger=require('../../config/logger')(_0x65f6('0x7'));var config=require(_0x65f6('0x8'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x65f6('0x9')](config[_0x65f6('0xa')],{'host':_0x65f6('0xb'),'port':0x18eb});var socket=require(_0x65f6('0xc'))(new Redis(config[_0x65f6('0xa')]));require(_0x65f6('0xd'))['register'](socket);var htmlToText=require('html-to-text');var jayson=require(_0x65f6('0xe'));var client=jayson[_0x65f6('0xf')][_0x65f6('0x10')]({'port':0x232c});var client9002=jayson[_0x65f6('0xf')]['http']({'port':0x232a});var client9003=jayson[_0x65f6('0xf')]['http']({'port':0x232b});var client9001=jayson['client'][_0x65f6('0x10')]({'port':0x2329});function respondWithRpcPromise(_0x576875,_0x419819,_0x4862a5,_0x2f964a){return new BPromise(function(_0x186a6a,_0x2c4ee5){var _0x217570=_0x2f964a||client;return _0x217570[_0x65f6('0x11')](_0x576875,_0x4862a5)[_0x65f6('0x12')](function(_0x44144b){logger[_0x65f6('0x13')](_0x65f6('0x14'),_0x419819,_0x65f6('0x15'));logger['debug'](_0x65f6('0x16'),_0x419819,'request\x20sent',JSON['stringify'](_0x44144b));if(_0x44144b[_0x65f6('0x17')]){if(_0x44144b[_0x65f6('0x17')][_0x65f6('0x18')]===0x1f4){logger[_0x65f6('0x17')](_0x65f6('0x14'),_0x419819,_0x44144b[_0x65f6('0x17')][_0x65f6('0x19')]);return _0x2c4ee5(_0x44144b[_0x65f6('0x17')]['message']);}logger['error'](_0x65f6('0x14'),_0x419819,_0x44144b['error']['message']);return _0x186a6a(_0x44144b['error'][_0x65f6('0x19')]);}else{logger[_0x65f6('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x419819,_0x65f6('0x15'));_0x186a6a(_0x44144b[_0x65f6('0x1a')][_0x65f6('0x19')]);}})[_0x65f6('0x1b')](function(_0x219ab2){logger[_0x65f6('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x419819,_0x219ab2);_0x2c4ee5(_0x219ab2);});});}function respondWithStatusCode(_0x197a49,_0x4bb39e){_0x4bb39e=_0x4bb39e||0xcc;return function(_0x5b9e2a){if(_0x5b9e2a){return _0x197a49[_0x65f6('0x1c')](_0x4bb39e);}return _0x197a49[_0x65f6('0x1d')](_0x4bb39e)['end']();};}function respondWithResult(_0x1eeaaa,_0x471a33){_0x471a33=_0x471a33||0xc8;return function(_0x2317ce){if(_0x2317ce){return _0x1eeaaa[_0x65f6('0x1d')](_0x471a33)['json'](_0x2317ce);}};}function respondWithFilteredResult(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(_0x20a161){var _0x5963e0=typeof _0x59ea32['offset']==='undefined'&&typeof _0x59ea32[_0x65f6('0x1e')]===_0x65f6('0x1f');var _0x4b2292=_0x20a161[_0x65f6('0x20')];var _0x28f710=_0x5963e0?0x0:_0x59ea32['offset'];var _0x325cb4=_0x5963e0?_0x20a161[_0x65f6('0x20')]:_0x59ea32[_0x65f6('0x21')]+_0x59ea32['limit'];var _0x4ac04b;if(_0x325cb4>=_0x4b2292){_0x325cb4=_0x4b2292;_0x4ac04b=0xc8;}else{_0x4ac04b=0xce;}_0x9d7bb0['status'](_0x4ac04b);return _0x9d7bb0[_0x65f6('0x22')](_0x65f6('0x23'),_0x28f710+'-'+_0x325cb4+'/'+_0x4b2292)[_0x65f6('0x24')](_0x20a161);}return null;};}function saveUpdates(_0x408ccc){return function(_0x518cac){if(_0x518cac){return _0x518cac[_0x65f6('0x25')](_0x408ccc)[_0x65f6('0x12')](function(_0x4ace4c){return _0x4ace4c;});}return null;};}function removeEntity(_0x4ea23d){return function(_0x154cbd){if(_0x154cbd){return _0x154cbd[_0x65f6('0x26')]()['then'](function(){var _0x4e50c0=_0x154cbd[_0x65f6('0x27')]({'plain':!![]});var _0x1ce43c=_0x65f6('0x28');return db[_0x65f6('0x29')][_0x65f6('0x26')]({'where':{'type':_0x1ce43c,'resourceId':_0x4e50c0['id']}})[_0x65f6('0x12')](function(){return _0x154cbd;});})['then'](function(){_0x4ea23d[_0x65f6('0x1d')](0xcc)[_0x65f6('0x2a')]();});}};}function handleEntityNotFound(_0x46f03c){return function(_0x4bc037){if(!_0x4bc037){_0x46f03c[_0x65f6('0x1c')](0x194);}return _0x4bc037;};}function handleError(_0x2a7aa8,_0xbaed3c){_0xbaed3c=_0xbaed3c||0x1f4;return function(_0x45510a){logger[_0x65f6('0x17')](_0x45510a[_0x65f6('0x2b')]);if(_0x45510a['name']){delete _0x45510a[_0x65f6('0x2c')];}_0x2a7aa8[_0x65f6('0x1d')](_0xbaed3c)['send'](_0x45510a);};}exports[_0x65f6('0x2d')]=function(_0x5a740a,_0x2b403b){var _0x50494b={'include':[{'model':db['Pause'],'as':_0x65f6('0x2e')}]},_0x2b9fb6={},_0x24f7fd={'count':0x0,'rows':[]};var _0x13e41a=_[_0x65f6('0x2f')](db['ChatWebsite']['rawAttributes'],function(_0x30109d){return{'name':_0x30109d['fieldName'],'type':_0x30109d[_0x65f6('0x30')]['key']};});_0x2b9fb6[_0x65f6('0x31')]=_[_0x65f6('0x2f')](_0x13e41a,'name');_0x2b9fb6[_0x65f6('0x32')]=_['keys'](_0x5a740a['query']);_0x2b9fb6[_0x65f6('0x33')]=_[_0x65f6('0x34')](_0x2b9fb6[_0x65f6('0x31')],_0x2b9fb6[_0x65f6('0x32')]);_0x50494b[_0x65f6('0x35')]=_[_0x65f6('0x34')](_0x2b9fb6[_0x65f6('0x31')],qs[_0x65f6('0x36')](_0x5a740a['query'][_0x65f6('0x36')]));_0x50494b['attributes']=_0x50494b[_0x65f6('0x35')][_0x65f6('0x37')]?_0x50494b[_0x65f6('0x35')]:_0x2b9fb6[_0x65f6('0x31')];if(!_0x5a740a['query'][_0x65f6('0x38')](_0x65f6('0x39'))){_0x50494b[_0x65f6('0x1e')]=qs[_0x65f6('0x1e')](_0x5a740a[_0x65f6('0x32')][_0x65f6('0x1e')]);_0x50494b[_0x65f6('0x21')]=qs[_0x65f6('0x21')](_0x5a740a[_0x65f6('0x32')]['offset']);}_0x50494b[_0x65f6('0x3a')]=qs[_0x65f6('0x3b')](_0x5a740a[_0x65f6('0x32')][_0x65f6('0x3b')]);_0x50494b[_0x65f6('0x3c')]=qs[_0x65f6('0x33')](_[_0x65f6('0x3d')](_0x5a740a[_0x65f6('0x32')],_0x2b9fb6[_0x65f6('0x33')]),_0x13e41a);if(_0x5a740a[_0x65f6('0x32')][_0x65f6('0x3e')]){_0x50494b[_0x65f6('0x3c')]=_[_0x65f6('0x3f')](_0x50494b[_0x65f6('0x3c')],{'$or':_[_0x65f6('0x2f')](_0x13e41a,function(_0x2cb38d){if(_0x2cb38d['type']!==_0x65f6('0x40')){var _0x37cd36={};_0x37cd36[_0x2cb38d[_0x65f6('0x2c')]]={'$like':'%'+_0x5a740a[_0x65f6('0x32')]['filter']+'%'};return _0x37cd36;}})});}_0x50494b=_[_0x65f6('0x3f')]({},_0x50494b,_0x5a740a[_0x65f6('0x41')]);var _0x2b01eb={'where':_0x50494b['where']};return db[_0x65f6('0x42')][_0x65f6('0x20')](_0x2b01eb)[_0x65f6('0x12')](function(_0x2179e5){_0x24f7fd['count']=_0x2179e5;if(_0x5a740a[_0x65f6('0x32')]['includeAll']){_0x50494b[_0x65f6('0x43')]=[{'all':!![]}];}return db[_0x65f6('0x42')]['findAll'](_0x50494b);})[_0x65f6('0x12')](function(_0x5085db){_0x24f7fd[_0x65f6('0x44')]=_0x5085db;return _0x24f7fd;})[_0x65f6('0x12')](respondWithFilteredResult(_0x2b403b,_0x50494b))[_0x65f6('0x1b')](handleError(_0x2b403b,null));};exports[_0x65f6('0x45')]=function(_0x3ec18f,_0x3837b2){var _0x4d30c5={'raw':![],'where':{'id':_0x3ec18f[_0x65f6('0x46')]['id']},'include':[{'model':db[_0x65f6('0x47')],'as':_0x65f6('0x2e')}]},_0x51bf6c={};_0x51bf6c[_0x65f6('0x31')]=_[_0x65f6('0x48')](db[_0x65f6('0x42')][_0x65f6('0x49')]);_0x51bf6c[_0x65f6('0x32')]=_[_0x65f6('0x48')](_0x3ec18f['query']);_0x51bf6c[_0x65f6('0x33')]=_[_0x65f6('0x34')](_0x51bf6c[_0x65f6('0x31')],_0x51bf6c['query']);_0x4d30c5[_0x65f6('0x35')]=_[_0x65f6('0x34')](_0x51bf6c['model'],qs[_0x65f6('0x36')](_0x3ec18f[_0x65f6('0x32')]['fields']));_0x4d30c5[_0x65f6('0x35')]=_0x4d30c5['attributes'][_0x65f6('0x37')]?_0x4d30c5[_0x65f6('0x35')]:_0x51bf6c[_0x65f6('0x31')];if(_0x3ec18f['query'][_0x65f6('0x4a')]){_0x4d30c5[_0x65f6('0x43')]=[{'all':!![]}];}_0x4d30c5=_['merge']({},_0x4d30c5,_0x3ec18f[_0x65f6('0x41')]);return db[_0x65f6('0x42')]['find'](_0x4d30c5)[_0x65f6('0x12')](handleEntityNotFound(_0x3837b2,null))[_0x65f6('0x12')](respondWithResult(_0x3837b2,null))[_0x65f6('0x1b')](handleError(_0x3837b2,null));};exports[_0x65f6('0x4b')]=function(_0x234fa7,_0x2350ca){return db[_0x65f6('0x42')][_0x65f6('0x4b')](_0x234fa7['body'],{})['then'](function(_0x5ca62e){var _0x19f40c=_0x234fa7[_0x65f6('0x4c')][_0x65f6('0x27')]({'plain':!![]});if(!_0x19f40c)throw new Error(_0x65f6('0x4d'));if(_0x19f40c['role']===_0x65f6('0x4c')){var _0x2032b9=_0x5ca62e[_0x65f6('0x27')]({'plain':!![]});var _0x50f63a=_0x65f6('0x28');return db[_0x65f6('0x4e')][_0x65f6('0x4f')]({'where':{'name':_0x50f63a,'userProfileId':_0x19f40c['userProfileId']},'raw':!![]})['then'](function(_0x1d337d){if(_0x1d337d&&_0x1d337d[_0x65f6('0x50')]===0x0){return db[_0x65f6('0x29')][_0x65f6('0x4b')]({'name':_0x2032b9[_0x65f6('0x2c')],'resourceId':_0x2032b9['id'],'type':_0x1d337d[_0x65f6('0x2c')],'sectionId':_0x1d337d['id']},{})[_0x65f6('0x12')](function(){return _0x5ca62e;});}else{return _0x5ca62e;}})[_0x65f6('0x1b')](function(_0x2d8b5b){logger[_0x65f6('0x17')](_0x65f6('0x51'),_0x2d8b5b);throw _0x2d8b5b;});}return _0x5ca62e;})[_0x65f6('0x12')](respondWithResult(_0x2350ca,0xc9))[_0x65f6('0x1b')](handleError(_0x2350ca,null));};exports[_0x65f6('0x25')]=function(_0x5ba9c6,_0x47610a){if(_0x5ba9c6[_0x65f6('0x52')]['id']){delete _0x5ba9c6[_0x65f6('0x52')]['id'];}return db['ChatWebsite'][_0x65f6('0x4f')]({'where':{'id':_0x5ba9c6[_0x65f6('0x46')]['id']},'include':[{'model':db[_0x65f6('0x47')],'as':_0x65f6('0x2e')}]})['then'](handleEntityNotFound(_0x47610a,null))[_0x65f6('0x12')](saveUpdates(_0x5ba9c6[_0x65f6('0x52')],null))[_0x65f6('0x12')](respondWithResult(_0x47610a,null))[_0x65f6('0x1b')](handleError(_0x47610a,null));};exports['destroy']=function(_0x2923ff,_0x2fc20f){return db['ChatWebsite'][_0x65f6('0x4f')]({'where':{'id':_0x2923ff[_0x65f6('0x46')]['id']}})[_0x65f6('0x12')](handleEntityNotFound(_0x2fc20f,null))['then'](removeEntity(_0x2fc20f,null))[_0x65f6('0x1b')](handleError(_0x2fc20f,null));};exports[_0x65f6('0x53')]=function(_0x3974ef,_0x3c23e3){return db[_0x65f6('0x42')][_0x65f6('0x53')]()['then'](respondWithResult(_0x3c23e3,null))['catch'](handleError(_0x3c23e3,null));};exports['addDisposition']=function(_0x336a7d,_0x367d95){if(_0x336a7d[_0x65f6('0x52')]['id']){delete _0x336a7d[_0x65f6('0x52')]['id'];}return db[_0x65f6('0x42')][_0x65f6('0x4f')]({'where':{'id':_0x336a7d['params']['id']}})[_0x65f6('0x12')](handleEntityNotFound(_0x367d95,null))[_0x65f6('0x12')](function(_0x54b569){if(_0x54b569){_0x336a7d[_0x65f6('0x52')][_0x65f6('0x54')]=_0x54b569['id'];return db[_0x65f6('0x55')]['create'](_0x336a7d[_0x65f6('0x52')]);}})[_0x65f6('0x12')](respondWithResult(_0x367d95,null))['catch'](handleError(_0x367d95,null));};exports[_0x65f6('0x56')]=function(_0x3edc6b,_0x1301f5){var _0x417b44={'raw':![],'where':{}};var _0x3d55f7={};var _0x2226bf={'count':0x0,'rows':[]};return db[_0x65f6('0x42')]['findOne']({'where':{'id':_0x3edc6b['params']['id']}})[_0x65f6('0x12')](handleEntityNotFound(_0x1301f5,null))[_0x65f6('0x12')](function(_0x4a9524){if(_0x4a9524){_0x3d55f7[_0x65f6('0x31')]=_['keys'](db[_0x65f6('0x55')]['rawAttributes']);_0x3d55f7[_0x65f6('0x32')]=_[_0x65f6('0x48')](_0x3edc6b[_0x65f6('0x32')]);_0x3d55f7[_0x65f6('0x33')]=_[_0x65f6('0x34')](_0x3d55f7[_0x65f6('0x31')],_0x3d55f7[_0x65f6('0x32')]);_0x417b44[_0x65f6('0x35')]=_[_0x65f6('0x34')](_0x3d55f7['model'],qs['fields'](_0x3edc6b[_0x65f6('0x32')][_0x65f6('0x36')]));_0x417b44[_0x65f6('0x35')]=_0x417b44['attributes']['length']?_0x417b44[_0x65f6('0x35')]:_0x3d55f7[_0x65f6('0x31')];if(!_0x3edc6b[_0x65f6('0x32')][_0x65f6('0x38')](_0x65f6('0x39'))){_0x417b44[_0x65f6('0x1e')]=qs['limit'](_0x3edc6b['query'][_0x65f6('0x1e')]);_0x417b44[_0x65f6('0x21')]=qs['offset'](_0x3edc6b[_0x65f6('0x32')]['offset']);}_0x417b44[_0x65f6('0x3a')]=qs[_0x65f6('0x3b')](_0x3edc6b[_0x65f6('0x32')][_0x65f6('0x3b')]);_0x417b44['where']=qs[_0x65f6('0x33')](_[_0x65f6('0x3d')](_0x3edc6b[_0x65f6('0x32')],_0x3d55f7['filters']));_0x417b44['where'][_0x65f6('0x54')]=_0x4a9524['id'];if(_0x3edc6b['query'][_0x65f6('0x3e')]){_0x417b44[_0x65f6('0x3c')]=_[_0x65f6('0x3f')](_0x417b44[_0x65f6('0x3c')],{'$or':_['map'](_0x417b44['attributes'],function(_0x56f7f1){var _0x2e29b4={};_0x2e29b4[_0x56f7f1]={'$like':'%'+_0x3edc6b[_0x65f6('0x32')][_0x65f6('0x3e')]+'%'};return _0x2e29b4;})});}_0x417b44=_['merge']({},_0x417b44,_0x3edc6b[_0x65f6('0x41')]);return db[_0x65f6('0x55')][_0x65f6('0x20')]({'where':_0x417b44['where']})[_0x65f6('0x12')](function(_0x15809e){_0x2226bf['count']=_0x15809e;if(_0x3edc6b[_0x65f6('0x32')][_0x65f6('0x4a')]){_0x417b44['include']=[{'all':!![]}];}return db[_0x65f6('0x55')]['findAll'](_0x417b44);})[_0x65f6('0x12')](function(_0x55ea91){_0x2226bf[_0x65f6('0x44')]=_0x55ea91;return _0x2226bf;});}})[_0x65f6('0x12')](respondWithFilteredResult(_0x1301f5,_0x417b44))['catch'](handleError(_0x1301f5,null));};exports[_0x65f6('0x57')]=function(_0x442e25,_0x2a700b){return db[_0x65f6('0x42')][_0x65f6('0x4f')]({'where':{'id':_0x442e25[_0x65f6('0x46')]['id']}})[_0x65f6('0x12')](handleEntityNotFound(_0x2a700b,null))[_0x65f6('0x12')](function(_0x31dba0){if(_0x31dba0){return _0x31dba0[_0x65f6('0x57')](_0x442e25[_0x65f6('0x32')]['ids']);}})[_0x65f6('0x12')](respondWithStatusCode(_0x2a700b,null))[_0x65f6('0x1b')](handleError(_0x2a700b,null));};exports[_0x65f6('0x58')]=function(_0x219e42,_0x5694f9){if(_0x219e42[_0x65f6('0x52')]['id']){delete _0x219e42[_0x65f6('0x52')]['id'];}return db['ChatWebsite'][_0x65f6('0x4f')]({'where':{'id':_0x219e42['params']['id']}})[_0x65f6('0x12')](handleEntityNotFound(_0x5694f9,null))['then'](function(_0x31f6c1){if(_0x31f6c1){_0x219e42[_0x65f6('0x52')]['ChatWebsiteId']=_0x31f6c1['id'];return db['CannedAnswer'][_0x65f6('0x4b')](_0x219e42[_0x65f6('0x52')]);}})['then'](respondWithResult(_0x5694f9,null))[_0x65f6('0x1b')](handleError(_0x5694f9,null));};exports[_0x65f6('0x59')]=function(_0x73d359,_0x4edba0){var _0x1348ec={'raw':![],'where':{}};var _0x246510={};var _0x5889dc={'count':0x0,'rows':[]};return db[_0x65f6('0x42')]['findOne']({'where':{'id':_0x73d359[_0x65f6('0x46')]['id']}})['then'](handleEntityNotFound(_0x4edba0,null))['then'](function(_0x20687f){if(_0x20687f){_0x246510[_0x65f6('0x31')]=_[_0x65f6('0x48')](db[_0x65f6('0x5a')][_0x65f6('0x49')]);_0x246510[_0x65f6('0x32')]=_[_0x65f6('0x48')](_0x73d359[_0x65f6('0x32')]);_0x246510['filters']=_['intersection'](_0x246510[_0x65f6('0x31')],_0x246510['query']);_0x1348ec[_0x65f6('0x35')]=_[_0x65f6('0x34')](_0x246510[_0x65f6('0x31')],qs[_0x65f6('0x36')](_0x73d359[_0x65f6('0x32')]['fields']));_0x1348ec[_0x65f6('0x35')]=_0x1348ec[_0x65f6('0x35')][_0x65f6('0x37')]?_0x1348ec['attributes']:_0x246510[_0x65f6('0x31')];if(!_0x73d359[_0x65f6('0x32')][_0x65f6('0x38')](_0x65f6('0x39'))){_0x1348ec[_0x65f6('0x1e')]=qs[_0x65f6('0x1e')](_0x73d359['query']['limit']);_0x1348ec[_0x65f6('0x21')]=qs[_0x65f6('0x21')](_0x73d359[_0x65f6('0x32')][_0x65f6('0x21')]);}_0x1348ec['order']=qs['sort'](_0x73d359[_0x65f6('0x32')][_0x65f6('0x3b')]);_0x1348ec[_0x65f6('0x3c')]=qs[_0x65f6('0x33')](_[_0x65f6('0x3d')](_0x73d359[_0x65f6('0x32')],_0x246510['filters']));_0x1348ec['where']['ChatWebsiteId']=_0x20687f['id'];if(_0x73d359[_0x65f6('0x32')][_0x65f6('0x3e')]){_0x1348ec[_0x65f6('0x3c')]=_[_0x65f6('0x3f')](_0x1348ec['where'],{'$or':_['map'](_0x1348ec[_0x65f6('0x35')],function(_0x27e44b){var _0x56077a={};_0x56077a[_0x27e44b]={'$like':'%'+_0x73d359[_0x65f6('0x32')]['filter']+'%'};return _0x56077a;})});}_0x1348ec=_[_0x65f6('0x3f')]({},_0x1348ec,_0x73d359['options']);return db[_0x65f6('0x5a')][_0x65f6('0x20')]({'where':_0x1348ec['where']})[_0x65f6('0x12')](function(_0x330e18){_0x5889dc[_0x65f6('0x20')]=_0x330e18;if(_0x73d359[_0x65f6('0x32')][_0x65f6('0x4a')]){_0x1348ec[_0x65f6('0x43')]=[{'all':!![]}];}return db['CannedAnswer'][_0x65f6('0x5b')](_0x1348ec);})['then'](function(_0x24495c){_0x5889dc['rows']=_0x24495c;return _0x5889dc;});}})[_0x65f6('0x12')](respondWithFilteredResult(_0x4edba0,_0x1348ec))[_0x65f6('0x1b')](handleError(_0x4edba0,null));};exports[_0x65f6('0x5c')]=function(_0x41e59a,_0x535558){return db[_0x65f6('0x42')][_0x65f6('0x4f')]({'where':{'id':_0x41e59a[_0x65f6('0x46')]['id']}})['then'](handleEntityNotFound(_0x535558,null))['then'](function(_0xccd888){if(_0xccd888){return _0xccd888[_0x65f6('0x5c')](_0x41e59a['query'][_0x65f6('0x5d')]);}})[_0x65f6('0x12')](respondWithStatusCode(_0x535558,null))[_0x65f6('0x1b')](handleError(_0x535558,null));};exports['addLogo']=function(_0x2c8938,_0xf1e6a1){_0x2c8938['body'][_0x65f6('0x5e')]=_0x2c8938[_0x65f6('0x5f')][_0x65f6('0x60')];return db['ChatWebsite'][_0x65f6('0x4f')]({'where':{'id':_0x2c8938[_0x65f6('0x46')]['id']}})[_0x65f6('0x12')](handleEntityNotFound(_0xf1e6a1,null))['then'](saveUpdates(_0x2c8938[_0x65f6('0x52')],null))['then'](respondWithResult(_0xf1e6a1,null))[_0x65f6('0x1b')](handleError(_0xf1e6a1,null));};exports[_0x65f6('0x61')]=function(_0x31ec61,_0x22be6e){_0x31ec61[_0x65f6('0x52')][_0x65f6('0x62')]=_0x31ec61['file'][_0x65f6('0x60')];return db[_0x65f6('0x42')][_0x65f6('0x4f')]({'where':{'id':_0x31ec61[_0x65f6('0x46')]['id']}})[_0x65f6('0x12')](handleEntityNotFound(_0x22be6e,null))['then'](saveUpdates(_0x31ec61['body'],null))['then'](respondWithResult(_0x22be6e,null))[_0x65f6('0x1b')](handleError(_0x22be6e,null));};exports[_0x65f6('0x63')]=function(_0xcfc47a,_0x59b715){_0xcfc47a[_0x65f6('0x52')]['customerAvatar']=_0xcfc47a['file'][_0x65f6('0x60')];return db[_0x65f6('0x42')]['find']({'where':{'id':_0xcfc47a[_0x65f6('0x46')]['id']}})[_0x65f6('0x12')](handleEntityNotFound(_0x59b715,null))[_0x65f6('0x12')](saveUpdates(_0xcfc47a[_0x65f6('0x52')],null))[_0x65f6('0x12')](respondWithResult(_0x59b715,null))[_0x65f6('0x1b')](handleError(_0x59b715,null));};exports[_0x65f6('0x64')]=function(_0x3291ac,_0x477f29){_0x3291ac[_0x65f6('0x52')][_0x65f6('0x65')]=_0x3291ac[_0x65f6('0x5f')]['filename'];return db[_0x65f6('0x42')]['find']({'where':{'id':_0x3291ac['params']['id']}})[_0x65f6('0x12')](handleEntityNotFound(_0x477f29,null))[_0x65f6('0x12')](saveUpdates(_0x3291ac[_0x65f6('0x52')],null))[_0x65f6('0x12')](respondWithResult(_0x477f29,null))['catch'](handleError(_0x477f29,null));};exports[_0x65f6('0x66')]=function(_0x565b63,_0x490512){var _0x416ed4=path[_0x65f6('0x67')](config[_0x65f6('0x68')],_0x65f6('0x69'));var _0xd893ef={'where':{'id':_0x565b63[_0x65f6('0x46')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x5c8131=![];return require('../../config/license/util')[_0x65f6('0x6a')]()[_0x65f6('0x12')](function(_0x365044){if(_0x365044){_0x5c8131=_0x365044['custom'];}})[_0x65f6('0x12')](function(){return db['ChatWebsite']['find'](_0xd893ef);})[_0x65f6('0x12')](handleEntityNotFound(_0x490512,null))[_0x65f6('0x12')](function(_0x2dbed5){if(_0x2dbed5){if(!_[_0x65f6('0x6b')](_0x2dbed5[_0x65f6('0x5e')])){if(fs['existsSync'](path[_0x65f6('0x67')](config[_0x65f6('0x68')],_0x65f6('0x6c'),_0x2dbed5[_0x65f6('0x5e')]))&&_0x5c8131){_0x416ed4=path['join'](config[_0x65f6('0x68')],_0x65f6('0x6c'),_0x2dbed5[_0x65f6('0x5e')]);}}return _0x490512[_0x65f6('0x6d')](_0x416ed4);}})[_0x65f6('0x1b')](handleError(_0x490512,null));};exports[_0x65f6('0x6e')]=function(_0x2f9814,_0x8aab06){var _0x558410=path[_0x65f6('0x67')](config[_0x65f6('0x68')],_0x65f6('0x6f'));var _0x8adb47={'where':{'id':_0x2f9814[_0x65f6('0x46')]['id']},'attributes':['id',_0x65f6('0x62')],'raw':!![]};return db['ChatWebsite'][_0x65f6('0x4f')](_0x8adb47)[_0x65f6('0x12')](handleEntityNotFound(_0x8aab06,null))['then'](function(_0x34f1e6){if(_0x34f1e6){if(!_['isNil'](_0x34f1e6[_0x65f6('0x62')])){if(fs[_0x65f6('0x70')](path[_0x65f6('0x67')](config[_0x65f6('0x68')],_0x65f6('0x71'),_0x34f1e6['agentAvatar']))){_0x558410=path[_0x65f6('0x67')](config[_0x65f6('0x68')],_0x65f6('0x71'),_0x34f1e6[_0x65f6('0x62')]);}}return _0x8aab06[_0x65f6('0x6d')](_0x558410);}})['catch'](handleError(_0x8aab06,null));};exports['getCustomerAvatar']=function(_0x38006c,_0x22a9e7){var _0x2993ee=path[_0x65f6('0x67')](config['root'],'server/files/images/avatars/customer_avatar.png');var _0x534004={'where':{'id':_0x38006c[_0x65f6('0x46')]['id']},'attributes':['id',_0x65f6('0x72'),_0x65f6('0x73')],'raw':!![]};return db['ChatWebsite'][_0x65f6('0x4f')](_0x534004)[_0x65f6('0x12')](handleEntityNotFound(_0x22a9e7,null))[_0x65f6('0x12')](function(_0x18c6a8){if(_0x18c6a8){if(!_[_0x65f6('0x6b')](_0x18c6a8['customerAvatar'])){if(fs[_0x65f6('0x70')](path[_0x65f6('0x67')](config['root'],'server/files/images/avatars/',_0x18c6a8[_0x65f6('0x72')]))&&_0x18c6a8[_0x65f6('0x73')]){_0x2993ee=path[_0x65f6('0x67')](config[_0x65f6('0x68')],_0x65f6('0x71'),_0x18c6a8['customerAvatar']);}}return _0x22a9e7[_0x65f6('0x6d')](_0x2993ee);}})['catch'](handleError(_0x22a9e7,null));};exports[_0x65f6('0x74')]=function(_0x5d181a,_0x38fcc9){var _0x5cec52=path[_0x65f6('0x67')](config['root'],_0x65f6('0x75'));var _0x3b9aed={'where':{'id':_0x5d181a['params']['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x65f6('0x42')][_0x65f6('0x4f')](_0x3b9aed)[_0x65f6('0x12')](handleEntityNotFound(_0x38fcc9,null))[_0x65f6('0x12')](function(_0x861892){if(_0x861892){if(!_[_0x65f6('0x6b')](_0x861892[_0x65f6('0x65')])){if(fs[_0x65f6('0x70')](path[_0x65f6('0x67')](config[_0x65f6('0x68')],_0x65f6('0x71'),_0x861892[_0x65f6('0x65')]))){_0x5cec52=path[_0x65f6('0x67')](config[_0x65f6('0x68')],_0x65f6('0x71'),_0x861892[_0x65f6('0x65')]);}}return _0x38fcc9[_0x65f6('0x6d')](_0x5cec52);}})['catch'](handleError(_0x38fcc9,null));};exports[_0x65f6('0x76')]=function(_0x91d7bf,_0x11bdf3){var _0x16e246=require(_0x65f6('0x77'));var _0x1dbf36=new _0x16e246();var _0x849936=_0x1dbf36[_0x65f6('0x78')](_0x91d7bf[_0x65f6('0x79')]['user-agent'])[_0x65f6('0x7a')]();var _0x585e99={'body':_0x91d7bf[_0x65f6('0x52')],'channel':_0x65f6('0x7b')};var _0x5c2f2c=[];var _0x38db52=[];var _0x39dedf={};var _0x5c7462=![];return db[_0x65f6('0x7c')][_0x65f6('0x53')]()[_0x65f6('0x12')](function(_0x207831){if(!_0x207831){throw new db[(_0x65f6('0x7d'))][(_0x65f6('0x7e'))]('no\x20available\x20attributes');}_0x5c2f2c=_[_0x65f6('0x7f')](_[_0x65f6('0x48')](_0x207831),[_0x65f6('0x80'),_0x65f6('0x81')]);_0x38db52=_['difference'](_['keys'](_0x207831),['createdAt',_0x65f6('0x81'),_0x65f6('0x82'),_0x65f6('0x83')]);if(_0x91d7bf[_0x65f6('0x52')]['id']){delete _0x91d7bf[_0x65f6('0x52')]['id'];}if(_['isNil'](_0x91d7bf['body'][_0x65f6('0x84')])){throw new db[(_0x65f6('0x7d'))][(_0x65f6('0x7e'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x91d7bf[_0x65f6('0x52')]['body'])||_0x91d7bf[_0x65f6('0x52')][_0x65f6('0x52')]===''){throw new db[(_0x65f6('0x7d'))][(_0x65f6('0x7e'))](_0x65f6('0x85'));}if(_[_0x65f6('0x6b')](_0x91d7bf[_0x65f6('0x52')][_0x65f6('0x86')])){throw new db[(_0x65f6('0x7d'))]['ValidationError'](_0x65f6('0x87')+_0x38db52);}if(!_[_0x65f6('0x88')](_0x38db52,_0x91d7bf['body'][_0x65f6('0x86')])){throw new db['Sequelize'][(_0x65f6('0x7e'))](_0x65f6('0x89')+_0x38db52);}_0x39dedf[_0x91d7bf[_0x65f6('0x52')]['mapKey']]=_0x91d7bf[_0x65f6('0x52')]['from'];})['then'](function(){return db[_0x65f6('0x42')][_0x65f6('0x4f')]({'where':{'id':_0x91d7bf['params']['id']},'include':[{'model':db[_0x65f6('0x8a')],'as':'List','include':[{'model':db[_0x65f6('0x7c')],'as':_0x65f6('0x8b'),'where':_0x39dedf,'limit':0x1,'order':[[_0x65f6('0x81'),_0x65f6('0x8c')]]}]},{'model':db[_0x65f6('0x8d')],'as':_0x65f6('0x8e')}]});})[_0x65f6('0x12')](handleEntityNotFound(_0x11bdf3,null))[_0x65f6('0x12')](function(_0x5ed6ff){if(_0x5ed6ff&&_0x5ed6ff[_0x65f6('0x8f')]){_0x585e99[_0x65f6('0x90')]=_0x5ed6ff;_0x585e99[_0x65f6('0x91')]=_0x5ed6ff[_0x65f6('0x8e')];_0x585e99[_0x65f6('0x92')]=_0x5ed6ff['List'];_0x585e99[_0x65f6('0x91')]=_['orderBy'](_0x585e99[_0x65f6('0x91')],['priority'],[_0x65f6('0x93')]);if(_0x585e99[_0x65f6('0x90')][_0x65f6('0x8e')]){delete _0x585e99[_0x65f6('0x90')][_0x65f6('0x8e')];}if(_0x585e99[_0x65f6('0x90')][_0x65f6('0x8f')]&&_0x585e99[_0x65f6('0x90')][_0x65f6('0x8f')][_0x65f6('0x8b')][_0x65f6('0x37')]){return _0x585e99[_0x65f6('0x90')][_0x65f6('0x8f')][_0x65f6('0x8b')][0x0];}var _0x37fa08=_[_0x65f6('0x9')](_0x91d7bf[_0x65f6('0x52')],{'firstName':_0x91d7bf['body'][_0x65f6('0x84')],'ListId':_0x5ed6ff['ListId']});_0x37fa08[_0x91d7bf[_0x65f6('0x52')][_0x65f6('0x86')]]=_0x91d7bf[_0x65f6('0x52')][_0x65f6('0x84')];return db[_0x65f6('0x7c')][_0x65f6('0x4b')](_0x37fa08,{'fields':_0x5c2f2c,'raw':!![]});}})['then'](handleEntityNotFound(_0x11bdf3,null))[_0x65f6('0x12')](function(_0x1ac0bd){_0x585e99[_0x65f6('0x94')]=_0x1ac0bd;var _0x359734=_0x91d7bf[_0x65f6('0x52')][_0x65f6('0x95')];if(_0x91d7bf[_0x65f6('0x79')][_0x65f6('0x96')]){_0x359734=_0x91d7bf[_0x65f6('0x79')][_0x65f6('0x96')];}else if(_0x91d7bf[_0x65f6('0x79')]['x-forwarded-for']){_0x359734=_['first'](_0x91d7bf[_0x65f6('0x79')][_0x65f6('0x97')][_0x65f6('0x98')](','));}if(_0x1ac0bd){var _0x179fed={'ContactId':_0x1ac0bd['id'],'ChatWebsiteId':_0x91d7bf[_0x65f6('0x46')]['id'],'from':(_0x1ac0bd[_0x65f6('0x99')]||'')+'\x20'+(_0x1ac0bd[_0x65f6('0x9a')]||''),'customerIp':_0x359734,'customerPort':_0x91d7bf['headers'][_0x65f6('0x9b')]?_0x91d7bf[_0x65f6('0x79')][_0x65f6('0x9b')]:null,'referer':_0x91d7bf[_0x65f6('0x52')][_0x65f6('0x9c')],'browserName':_0x849936[_0x65f6('0x9d')][_0x65f6('0x2c')]&&_0x849936[_0x65f6('0x9d')][_0x65f6('0x9e')]?util[_0x65f6('0x9f')](_0x65f6('0xa0'),_0x849936[_0x65f6('0x9d')][_0x65f6('0x2c')],_0x849936['browser']['version']):'unknown','browserVersion':_0x849936[_0x65f6('0x9d')][_0x65f6('0x9e')]||_0x65f6('0xa1'),'osName':util['format'](_0x65f6('0xa0'),_0x849936['os'][_0x65f6('0x2c')],_0x849936['os'][_0x65f6('0x9e')]),'osVersion':_0x849936['os']['version'],'deviceModel':_0x849936[_0x65f6('0xa2')][_0x65f6('0x31')]&&_0x849936['device'][_0x65f6('0xa3')]?util[_0x65f6('0x9f')](_0x65f6('0xa4'),_0x849936['device'][_0x65f6('0x31')],_0x849936[_0x65f6('0xa2')][_0x65f6('0xa3')],_0x849936[_0x65f6('0xa2')][_0x65f6('0x30')]):null,'deviceVendor':_0x849936[_0x65f6('0xa2')][_0x65f6('0xa3')],'deviceType':_0x849936[_0x65f6('0xa2')][_0x65f6('0x30')],'formData':JSON[_0x65f6('0xa5')](_0x91d7bf['body'])};var _0x43c89e={'ChatWebsiteId':_0x91d7bf[_0x65f6('0x46')]['id'],'closed':![]};if(_0x91d7bf[_0x65f6('0x52')]['threadId']){_0x43c89e['threadId']=_0x91d7bf[_0x65f6('0x52')]['threadId'];return db[_0x65f6('0xa6')][_0x65f6('0x4f')]({'where':_0x43c89e})[_0x65f6('0x12')](function(_0xbf4abe){if(_0xbf4abe){return[_0xbf4abe,![]];}_0x179fed[_0x65f6('0xa7')]=_0x91d7bf['body'][_0x65f6('0xa7')];_0x179fed[_0x65f6('0xa8')]=_0x91d7bf[_0x65f6('0x52')][_0x65f6('0xa8')];return db['ChatInteraction'][_0x65f6('0x4b')](_0x179fed)[_0x65f6('0x12')](function(_0x11d3fb){return[_0x11d3fb,!![]];});});}_0x43c89e[_0x65f6('0xa9')]=_0x1ac0bd['id'];if(_0x91d7bf[_0x65f6('0x52')][_0x65f6('0xaa')]&&_0x91d7bf[_0x65f6('0x52')][_0x65f6('0xaa')]['id']){_0x43c89e['id']=_0x91d7bf[_0x65f6('0x52')][_0x65f6('0xaa')]['id'];return db[_0x65f6('0xa6')][_0x65f6('0x4f')]({'where':_0x43c89e})[_0x65f6('0x12')](function(_0x31e87d){if(_0x31e87d){return[_0x31e87d,![]];}return db[_0x65f6('0xa6')]['create'](_0x179fed)[_0x65f6('0x12')](function(_0x1cca16){return[_0x1cca16,!![]];});});}return db['ChatInteraction']['create'](_0x179fed)[_0x65f6('0x12')](function(_0x7c1efc){return[_0x7c1efc,!![]];});}})[_0x65f6('0xab')](function(_0x2bcdec,_0x21b9ba){if(_0x2bcdec){_0x5c7462=_0x21b9ba;if(!_0x21b9ba){var _0x33e01f={'from':(_0x585e99[_0x65f6('0x94')]['firstName']||'')+'\x20'+(_0x585e99[_0x65f6('0x94')]['lastName']||'')};if(_0x91d7bf['body'][_0x65f6('0xa7')]&&_0x91d7bf[_0x65f6('0x52')][_0x65f6('0xac')]&&_0x91d7bf[_0x65f6('0x52')]['threadId']!=_0x91d7bf['body'][_0x65f6('0xac')]){_0x33e01f[_0x65f6('0xa7')]=_0x91d7bf['body']['messageId'];}return _0x2bcdec['update'](_0x33e01f);}else{return _0x2bcdec;}}})[_0x65f6('0x12')](function(_0x42dc3a){_0x585e99[_0x65f6('0xaa')]=_0x42dc3a[_0x65f6('0x27')]({'plain':!![]});_0x585e99[_0x65f6('0xaa')]['created']=_0x5c7462;if(_0x585e99['interaction'][_0x65f6('0xad')]){if(_0x585e99[_0x65f6('0x90')][_0x65f6('0xae')]){_0x585e99['applications']['push']({'id':0x0,'priority':_0x585e99[_0x65f6('0x91')][_0x65f6('0x37')]+0x1,'app':'close','appdata':_0x65f6('0xaf'),'interval':_0x65f6('0xb0')});}}return db['ChatMessage'][_0x65f6('0x4b')]({'body':_0x91d7bf['body'][_0x65f6('0x52')],'ChatWebsiteId':_0x91d7bf[_0x65f6('0x46')]['id'],'ChatInteractionId':_0x42dc3a['id'],'direction':'in','ContactId':_0x585e99[_0x65f6('0x94')]['id'],'AttachmentId':_0x91d7bf[_0x65f6('0x52')][_0x65f6('0xb1')]});})[_0x65f6('0x12')](function(_0x5ca33e){_0x585e99[_0x65f6('0x19')]=_0x5ca33e;if(_0x585e99[_0x65f6('0xaa')]['UserId']){return db[_0x65f6('0xb2')][_0x65f6('0x4f')]({'attributes':['id',_0x65f6('0x2c')],'where':{'id':_0x585e99['interaction']['UserId']}})[_0x65f6('0x12')](function(_0x2229ae){if(_0x2229ae){_0x585e99[_0x65f6('0x91')][_0x65f6('0xb3')]({'id':0x0,'priority':0x0,'app':_0x65f6('0xb4'),'appdata':_0x2229ae[_0x65f6('0x2c')]+','+(_0x585e99['account']['waitForTheAssignedAgent']||0xa),'interval':_0x65f6('0xb0')});_0x585e99[_0x65f6('0xb5')]=!![];}return respondWithRpcPromise(_0x65f6('0xb6'),_0x65f6('0xb7'),_0x585e99);});}return respondWithRpcPromise(_0x65f6('0xb6'),_0x65f6('0xb7'),_0x585e99);})[_0x65f6('0x12')](function(_0x4146df){respondWithRpcPromise(_0x65f6('0xb8'),_0x65f6('0xb8'),{'event':_0x65f6('0x76'),'message':_0x4146df},client9002);return _0x4146df;})[_0x65f6('0x12')](respondWithResult(_0x11bdf3,null))['catch'](handleError(_0x11bdf3,null));};exports[_0x65f6('0xb9')]=function(_0x3d2328,_0x21a8c9){var _0x101050,_0x3be8bc,_0x385d13;var _0xd00f2f=[];var _0x868a4f={};var _0x2820b3=_0x3d2328[_0x65f6('0xba')]||[];var _0x591fcd=[];var _0x4dfda4;return db[_0x65f6('0x7c')][_0x65f6('0x53')]()['then'](function(_0x1db7e4){if(!_0x1db7e4){throw new db[(_0x65f6('0x7d'))][(_0x65f6('0x7e'))]('no\x20available\x20attributes');}_0xd00f2f=_['difference'](_[_0x65f6('0x48')](_0x1db7e4),[_0x65f6('0x80'),_0x65f6('0x81'),_0x65f6('0x82'),_0x65f6('0x83')]);if(_0x3d2328[_0x65f6('0x52')]['id']){delete _0x3d2328[_0x65f6('0x52')]['id'];}if(_[_0x65f6('0x6b')](_0x3d2328[_0x65f6('0x52')][_0x65f6('0x84')])){throw _0x21a8c9[_0x65f6('0x1d')](0x1f4)[_0x65f6('0xbb')](new db[(_0x65f6('0x7d'))][(_0x65f6('0x7e'))](_0x65f6('0xbc')));}if(_[_0x65f6('0x6b')](_0x3d2328[_0x65f6('0x52')][_0x65f6('0x52')])||_0x3d2328['body'][_0x65f6('0x52')]===''){throw _0x21a8c9[_0x65f6('0x1d')](0x1f4)[_0x65f6('0xbb')](new db[(_0x65f6('0x7d'))]['ValidationError'](_0x65f6('0x85')));}if(_['isNil'](_0x3d2328[_0x65f6('0x52')][_0x65f6('0xbd')])){throw _0x21a8c9[_0x65f6('0x1d')](0x1f4)[_0x65f6('0xbb')](new db[(_0x65f6('0x7d'))]['ValidationError'](_0x65f6('0xbe')+_0xd00f2f));}if(!_['includes'](_0xd00f2f,_0x3d2328['body']['mapKeyOffline'])){throw _0x21a8c9[_0x65f6('0x1d')](0x1f4)['send'](new db[(_0x65f6('0x7d'))][(_0x65f6('0x7e'))](_0x65f6('0xbf')+_0xd00f2f));}_0x868a4f[_0x3d2328[_0x65f6('0x52')][_0x65f6('0xbd')]]=_0x3d2328[_0x65f6('0x52')][_0x65f6('0x84')];})[_0x65f6('0x12')](function(){return db['ChatWebsite']['find']({'where':{'id':_0x3d2328[_0x65f6('0x46')]['id']},'include':[{'model':db[_0x65f6('0x8a')],'as':'List'},{'model':db[_0x65f6('0xc0')],'as':'MailAccount'}]});})['then'](handleEntityNotFound(_0x21a8c9,null))[_0x65f6('0x12')](function(_0x74f19d){if(_0x74f19d&&_0x74f19d[_0x65f6('0x8f')]){_0x3be8bc=_0x74f19d;var _0x1050c7=_[_0x65f6('0x9')](_0x3d2328['body'],{'firstName':_0x3d2328[_0x65f6('0x52')]['from'],'phone':_0x3d2328[_0x65f6('0x52')]['from'],'ListId':_0x74f19d['ListId']});_0x1050c7[_0x3d2328[_0x65f6('0x52')][_0x65f6('0xbd')]]=_0x3d2328[_0x65f6('0x52')][_0x65f6('0x84')];return db[_0x65f6('0x7c')][_0x65f6('0xc1')]({'where':_0x868a4f,'defaults':_0x1050c7});}})[_0x65f6('0xab')](function(_0x2ff0f5){if(_0x2ff0f5){_0x385d13=_0x2ff0f5;var _0x504520=fs[_0x65f6('0xc2')](path['join'](config[_0x65f6('0x68')],_0x65f6('0xc3')),_0x65f6('0xc4'));var _0x588b38=ejs[_0x65f6('0xc5')](_0x504520,{'body':_[_0x65f6('0xc6')](_0x3d2328['body'][_0x65f6('0x52')]),'bodyTitle':_0x3be8bc[_0x65f6('0xc7')]});return db[_0x65f6('0xc8')][_0x65f6('0x4b')]({'body':_0x588b38,'plainBody':htmlToText[_0x65f6('0xc9')](_0x588b38),'ContactId':_0x2ff0f5['id'],'ChatWebsiteId':_0x3be8bc['id']});}})['then'](function(_0x428a19){_0x4dfda4=_0x428a19;if(_0x2820b3[_0x65f6('0x37')]){var _0x410442=_0x2820b3['map'](function(_0x4c1149){return{'name':_0x4c1149[_0x65f6('0xca')],'basename':_0x4c1149[_0x65f6('0x60')],'type':_0x4c1149[_0x65f6('0xcb')],'ChatOfflineMessageId':_0x428a19['id']};});_0x591fcd=_0x410442[_0x65f6('0x2f')](_0x3d1df9=>{var _0x5b4033={'filename':_0x3d1df9['name'],'path':path['join'](config[_0x65f6('0x68')],_0x65f6('0xcc'),'files','attachments','offline-chat',_0x3d1df9[_0x65f6('0xcd')])};return _0x5b4033;});if(!_0x3be8bc[_0x65f6('0xce')]){return db[_0x65f6('0xcf')][_0x65f6('0xd0')](function(_0x1be461){return db[_0x65f6('0xd1')][_0x65f6('0xd2')](_0x410442,{'transaction':_0x1be461});});}}})[_0x65f6('0x12')](function(){if(_0x4dfda4){_0x101050=_0x4dfda4;return db[_0x65f6('0xc0')][_0x65f6('0xd3')]({'where':{'active':!![]},'include':[{'model':db[_0x65f6('0xd4')],'as':_0x65f6('0xd5'),'raw':!![]}]});}})[_0x65f6('0x12')](function(_0x62136d){if(_0x62136d&&_0x62136d[_0x65f6('0xd5')]&&_0x3be8bc['forwardOffline']&&_0x3be8bc[_0x65f6('0xd6')]){var _0x1979c2={'tls':{'rejectUnauthorized':![]}};if(_0x62136d[_0x65f6('0xd5')][_0x65f6('0xd7')]){_0x1979c2[_0x65f6('0xd7')]=_0x62136d[_0x65f6('0xd5')]['service'];}else{_0x1979c2[_0x65f6('0xd8')]=_0x62136d[_0x65f6('0xd5')]['host'];_0x1979c2['port']=_0x62136d[_0x65f6('0xd5')]['port'];_0x1979c2['secure']=_0x62136d[_0x65f6('0xd5')][_0x65f6('0xd9')];}if(_0x62136d['Smtp'][_0x65f6('0xda')]){_0x1979c2[_0x65f6('0xdb')]={'user':_0x62136d['Smtp'][_0x65f6('0x4c')],'pass':_0x62136d[_0x65f6('0xd5')][_0x65f6('0xdc')]};}return respondWithRpcPromise(_0x65f6('0xdd'),_0x65f6('0xde'),{'account':_0x1979c2,'message':{'from':util[_0x65f6('0x9f')](_0x65f6('0xdf'),_0x62136d[_0x65f6('0x2c')],_0x62136d[_0x65f6('0xe0')]||_0x62136d['Smtp'][_0x65f6('0x4c')]),'to':_0x3be8bc[_0x65f6('0xd6')],'subject':_0x3be8bc[_0x65f6('0xe1')],'html':_0x101050[_0x65f6('0x52')],'attachments':_0x591fcd}},client9003)[_0x65f6('0x12')](function(){return _0x101050;})[_0x65f6('0x1b')](function(_0x4e4726){console[_0x65f6('0x17')](_0x4e4726);});}})['then'](function(){if(_0x3be8bc&&_0x3be8bc['openNewInteraction']&&_0x3be8bc['MailAccountId']){var _0x3f770a=[];if(_0x2820b3['length']){_0x3f770a=_0x2820b3[_0x65f6('0x2f')](function(_0x408f37){return{'name':_0x408f37[_0x65f6('0xca')],'basename':_0x408f37[_0x65f6('0x60')],'type':_0x408f37[_0x65f6('0xcb')],'ChatOfflineMessageId':_0x4dfda4['id']};});}var _0x355476;if(!_[_0x65f6('0x6b')](_0x3be8bc['subjectOffline'])){var _0x5db63d=_[_0x65f6('0x2f')](_0x3d2328[_0x65f6('0x52')],function(_0x11edd6){return _0x11edd6;});var _0x4bb32e=_[_0x65f6('0xe2')](_0x5db63d)[0x0];var _0x5d8c8e=_[_0x65f6('0xe3')](_0x4bb32e,function(_0x2b1dfc){return _0x2b1dfc;});_0x355476=_0x5d8c8e[0x1][_0x3be8bc[_0x65f6('0xe4')]];}var _0x4b920a={'from':_0x385d13[_0x65f6('0xe0')],'firstName':_0x385d13[_0x65f6('0x99')],'lastName':_0x385d13[_0x65f6('0x9a')],'mapKey':_0x65f6('0xe0'),'message':{'from':_0x385d13['email'],'to':_0x3be8bc['MailAccount'][_0x65f6('0xe0')],'cc':'','subject':_['isNil'](_0x355476)?_0x3be8bc[_0x65f6('0xe1')]:_0x355476,'messageId':'','sentAt':new Date(),'attach':_0x3f770a['length'],'attachments':_0x3f770a,'originChannel':_0x65f6('0xe5'),'ChatWebsiteId':_0x3be8bc['id'],'ChatOfflineMessageId':_0x101050['id'],'originTo':_0x3be8bc[_0x65f6('0xc0')][_0x65f6('0xe0')]},'body':_0x101050['body']};var _0x3225b6={'account':{'id':_0x3be8bc[_0x65f6('0xe6')]},'body':_0x4b920a,'log':_0x65f6('0xe7')};return respondWithRpcPromise(_0x65f6('0xe7'),_0x65f6('0xe8'),_0x3225b6,client9001)[_0x65f6('0x12')](function(){return _0x101050;})[_0x65f6('0x1b')](function(_0x4e40d4){console[_0x65f6('0x17')](_0x4e40d4);});}return;})[_0x65f6('0x12')](function(){if(_0x101050){return _0x101050;}})[_0x65f6('0x12')](respondWithResult(_0x21a8c9,null))[_0x65f6('0x1b')](function(_0x72ac02){console[_0x65f6('0x17')](_0x65f6('0x1b'),_0x72ac02);for(var _0xe52598 of _0x2820b3){var _0x1790e4=path['join'](config[_0x65f6('0x68')],'server',_0x65f6('0xba'),_0x65f6('0xe9'),_0x65f6('0xea'),_0xe52598[_0x65f6('0x60')]);fs_extra[_0x65f6('0xeb')](_0x1790e4)[_0x65f6('0x1b')](function(_0x4684ab){console[_0x65f6('0x17')](_0x65f6('0xec'),_0x1790e4,_0x4684ab);});}});};exports[_0x65f6('0xed')]=function(_0x148993,_0x38e6ff){return db[_0x65f6('0xa6')][_0x65f6('0x4f')]({'where':{'id':_0x148993[_0x65f6('0x46')]['id']}})[_0x65f6('0x12')](handleEntityNotFound(_0x38e6ff,null))[_0x65f6('0x12')](function(_0x560dbb){if(_0x560dbb){return _0x560dbb[_0x65f6('0xed')](_0x148993[_0x65f6('0x52')]['ids'],_[_0x65f6('0xee')](_0x148993[_0x65f6('0x52')],[_0x65f6('0x5d'),'id'])||{});}})[_0x65f6('0x12')](respondWithResult(_0x38e6ff,null))[_0x65f6('0x1b')](handleError(_0x38e6ff,null));};exports[_0x65f6('0xef')]=function(_0x4adb7a,_0x492c89){var _0x409127={'raw':![],'where':{}};var _0x2c0165={};var _0xd11998={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x65f6('0xd3')]({'where':{'id':_0x4adb7a['params']['id']}})[_0x65f6('0x12')](handleEntityNotFound(_0x492c89,null))[_0x65f6('0x12')](function(_0x1c8b2e){if(_0x1c8b2e){_0x2c0165[_0x65f6('0x31')]=_['keys'](db[_0x65f6('0xa6')]['rawAttributes']);_0x2c0165[_0x65f6('0x32')]=_[_0x65f6('0x48')](_0x4adb7a[_0x65f6('0x32')]);_0x2c0165['filters']=_[_0x65f6('0x34')](_0x2c0165['model'],_0x2c0165['query']);_0x409127[_0x65f6('0x35')]=_[_0x65f6('0x34')](_0x2c0165[_0x65f6('0x31')],qs[_0x65f6('0x36')](_0x4adb7a[_0x65f6('0x32')][_0x65f6('0x36')]));_0x409127[_0x65f6('0x35')]=_0x409127[_0x65f6('0x35')][_0x65f6('0x37')]?_0x409127[_0x65f6('0x35')]:_0x2c0165[_0x65f6('0x31')];if(!_0x4adb7a['query'][_0x65f6('0x38')]('nolimit')){_0x409127[_0x65f6('0x1e')]=qs[_0x65f6('0x1e')](_0x4adb7a['query'][_0x65f6('0x1e')]);_0x409127[_0x65f6('0x21')]=qs['offset'](_0x4adb7a['query'][_0x65f6('0x21')]);}_0x409127['order']=qs['sort'](_0x4adb7a[_0x65f6('0x32')][_0x65f6('0x3b')]);_0x409127[_0x65f6('0x3c')]=qs[_0x65f6('0x33')](_[_0x65f6('0x3d')](_0x4adb7a[_0x65f6('0x32')],_0x2c0165[_0x65f6('0x33')]));_0x409127[_0x65f6('0x3c')][_0x65f6('0x54')]=_0x1c8b2e['id'];if(_0x4adb7a['query'][_0x65f6('0x3e')]){_0x409127[_0x65f6('0x3c')]=_['merge'](_0x409127[_0x65f6('0x3c')],{'$or':_[_0x65f6('0x2f')](_0x409127[_0x65f6('0x35')],function(_0xcf934){var _0x73732f={};_0x73732f[_0xcf934]={'$like':'%'+_0x4adb7a[_0x65f6('0x32')]['filter']+'%'};return _0x73732f;})});}_0x409127=_['merge']({},_0x409127,_0x4adb7a[_0x65f6('0x41')]);return db[_0x65f6('0xa6')][_0x65f6('0x20')]({'where':_0x409127[_0x65f6('0x3c')]})[_0x65f6('0x12')](function(_0x4cee07){_0xd11998[_0x65f6('0x20')]=_0x4cee07;if(_0x4adb7a[_0x65f6('0x32')][_0x65f6('0x4a')]){_0x409127[_0x65f6('0x43')]=[{'model':db[_0x65f6('0x7c')],'as':_0x65f6('0xf0'),'required':![]},{'model':db[_0x65f6('0xb2')],'as':_0x65f6('0xf1'),'attributes':[_0x65f6('0x2c'),_0x65f6('0xf2'),_0x65f6('0xf3')],'required':![]},{'model':db['Tag'],'as':_0x65f6('0xf4'),'attributes':['id',_0x65f6('0x2c'),'color'],'where':_0x4adb7a['query'][_0x65f6('0xf5')]?{'id':_0x4adb7a[_0x65f6('0x32')][_0x65f6('0xf5')]}:undefined,'required':_0x4adb7a['query'][_0x65f6('0xf5')]?!![]:![]}];}return db[_0x65f6('0xa6')][_0x65f6('0x5b')](_0x409127);})[_0x65f6('0x12')](function(_0xf29979){_0xd11998[_0x65f6('0x44')]=_0xf29979;return _0xd11998;});}})[_0x65f6('0x12')](respondWithFilteredResult(_0x492c89,_0x409127))['catch'](handleError(_0x492c89,null));};function iftimePromise(_0xacdf06,_0x58f7a8){return respondWithRpcPromise(_0x65f6('0xf6'),_0x65f6('0xf7'),{'command':_0x58f7a8[_0x65f6('0xf8')]?util[_0x65f6('0x9f')](_0x65f6('0xf9'),_0xacdf06[_0x65f6('0xfa')],_0x58f7a8['timezone']):util[_0x65f6('0x9f')]('iftime\x20%s',_0xacdf06[_0x65f6('0xfa')])},client9002)['then'](function(_0x32829e){var _0x5258a4=_0x32829e&&_0x32829e[_0x65f6('0xfb')](_0x65f6('0xfc'))>=0x0?!![]:![];logger[_0x65f6('0x13')](_0x65f6('0xfd'),_0x58f7a8['id'],_0xacdf06['id'],_0xacdf06['interval'],_0x5258a4?_0x65f6('0xfe'):_0x65f6('0xff'),_0x58f7a8[_0x65f6('0xf8')]?_0x58f7a8[_0x65f6('0xf8')]:_0x65f6('0x100'));return _0x5258a4;})[_0x65f6('0x1b')](function(_0xd06566){logger[_0x65f6('0x17')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x58f7a8['id'],_0xacdf06['id'],_0xacdf06['interval'],util[_0x65f6('0x101')](_0xd06566,{'showHidden':![],'depth':null}),_0x58f7a8[_0x65f6('0xf8')]?_0x58f7a8[_0x65f6('0xf8')]:_0x65f6('0x100'));return![];});}exports['getSnippet']=function(_0x1a25ae,_0x1e1498){var _0x4c63f9=0x0;var _0x13f4a5=0x0;var _0x4315c1=![];var _0x141d13;var _0x575f14;return db[_0x65f6('0x42')][_0x65f6('0x4f')]({'where':{'id':_0x1a25ae['params']['id']},'include':[{'model':db['Interval'],'as':'Interval','include':[{'model':db[_0x65f6('0x102')],'as':_0x65f6('0x103'),'attributes':['id',_0x65f6('0xfa')],'raw':!![]}]}]})[_0x65f6('0x12')](handleEntityNotFound(_0x1e1498,null))[_0x65f6('0x12')](function(_0x39bea9){if(_0x39bea9){_0x141d13=_0x39bea9;return _0x39bea9[_0x65f6('0x104')]({'raw':!![]});}})[_0x65f6('0x12')](function(_0x270944){if(_0x141d13){if(_0x270944){_0x575f14=_0x270944;}}return require(_0x65f6('0x105'))[_0x65f6('0x6a')]();})[_0x65f6('0x12')](function(_0x2a0aab){if(_0x2a0aab){_0x13f4a5=_0x2a0aab[_0x65f6('0x106')];_0x4315c1=_0x2a0aab[_0x65f6('0x107')];}})[_0x65f6('0x12')](function(){return db[_0x65f6('0xa6')][_0x65f6('0x20')]({'where':{'closed':![]}});})['then'](function(_0x4345af){_0x4c63f9=_0x4345af;if(_0x13f4a5&&_0x4345af>_0x13f4a5){return db[_0x65f6('0x108')]['findOne']({'where':{'id':0x1}})['then'](function(_0x23709a){if(_0x23709a){_0x23709a[_0x65f6('0x109')](_0x65f6('0x10a'));}});}})[_0x65f6('0x12')](function(){if(_0x141d13['Interval']&&_0x141d13['Interval'][_0x65f6('0x103')]){var _0x5dc205=[];for(var _0xd2313b=0x0;_0xd2313b<_0x141d13[_0x65f6('0x102')]['Intervals']['length'];_0xd2313b++){var _0x408e74=_0x141d13[_0x65f6('0x102')][_0x65f6('0x103')][_0xd2313b][_0x65f6('0x27')]({'plain':!![]});_0x5dc205['push'](iftimePromise(_0x408e74,_0x141d13));}return BPromise[_0x65f6('0x10b')](_0x5dc205)['then'](function(_0x34542c){return _[_0x65f6('0x10c')](_0x34542c);});}else{return!![];}})[_0x65f6('0x12')](function(_0x2ab4ac){var _0x4bc08e=fs[_0x65f6('0xc2')](path['join'](config[_0x65f6('0x68')],'server/files/chat/iframe.ejs'),'utf8');var _0x38de54={'remote':_0x141d13['remote'],'query':querystring[_0x65f6('0xa5')](_[_0x65f6('0x3f')](_0x141d13[_0x65f6('0x27')]({'plain':!![]}),{'customerIp':_0x1a25ae[_0x65f6('0x79')][_0x65f6('0x97')]||_0x1a25ae[_0x65f6('0x79')][_0x65f6('0x10d')]||_0x1a25ae[_0x65f6('0x10e')][_0x65f6('0x10f')]||_0x1a25ae['ip'],'referer':_0x1a25ae['headers'][_0x65f6('0x9c')],'openedInteractions':_0x4c63f9,'maxInteractions':_0x13f4a5,'virtual':_0x4315c1[_0x65f6('0x106')],'online':_0x2ab4ac,'custom':_0x4315c1}))[_0x65f6('0x110')](/'/g,'\x5c\x27')};_0x1e1498[_0x65f6('0xbb')](ejs['render'](Mustache[_0x65f6('0xc5')](_0x4bc08e,_0x38de54),{'proactiveActions':_0x575f14,'alignment':_0x141d13[_0x65f6('0x111')],'verticalAlignment':_0x141d13['verticalAlignment'],'div_color':_0x141d13[_0x65f6('0x112')],'labelText':_0x141d13[_0x65f6('0x113')],'text_color':_0x141d13[_0x65f6('0x114')],'button_color':_0x141d13[_0x65f6('0x115')],'background_color':_0x141d13[_0x65f6('0x116')]}));})[_0x65f6('0x1b')](handleError(_0x1e1498,null));};exports[_0x65f6('0x117')]=function(_0x112db7,_0x313634){var _0x1779de=_0x112db7[_0x65f6('0x46')]['id'];var _0x4b1ec2=_0x112db7[_0x65f6('0x52')];var _0x533902=0xc8;var _0x3bee71=null;return db['sequelize'][_0x65f6('0xd0')]({'isolationLevel':db[_0x65f6('0xcf')][_0x65f6('0x118')]['ISOLATION_LEVELS'][_0x65f6('0x119')]},function(_0x34ec6b){return db['ChatWebsite'][_0x65f6('0xd3')]({'where':{'id':_0x1779de},'transaction':_0x34ec6b})[_0x65f6('0x12')](function(_0xff9e69){if(_0xff9e69){return db['ChatApplication']['destroy']({'where':{'ChatWebsiteId':_0x1779de},'transaction':_0x34ec6b})['then'](function(){var _0x4eec1f=_[_0x65f6('0x2f')](_0x4b1ec2,function(_0x14417a){_0x14417a[_0x65f6('0x54')]=_0x1779de;return _0x14417a;});return db[_0x65f6('0x8d')][_0x65f6('0xd2')](_0x4eec1f,{'transaction':_0x34ec6b});});}else{_0x533902=0x194;_0x3bee71=[];}});})[_0x65f6('0x12')](function(){if(_0x533902!==0x194){return db[_0x65f6('0x8d')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x1779de},'order':_0x65f6('0x11a')})[_0x65f6('0x12')](function(_0x212333){_0x3bee71=_0x212333;});}})[_0x65f6('0x1b')](function(_0x4dbf35){_0x533902=0x1f4;logger[_0x65f6('0x17')](_0x4dbf35['stack']);if(_0x4dbf35[_0x65f6('0x2c')]){delete _0x4dbf35[_0x65f6('0x2c')];}_0x3bee71=_0x4dbf35;})['finally'](function(){if(_0x3bee71===null){_0x313634['sendStatus'](_0x533902);}else{if(_0x533902===0x1f4){_0x313634[_0x65f6('0x1d')](_0x533902)[_0x65f6('0xbb')](_0x3bee71);}else{_0x313634['status'](_0x533902)['json'](_0x3bee71);}}});};exports[_0x65f6('0x11b')]=function(_0x41ee46,_0xa54e78){var _0x31a57d={};var _0x3177f6={};var _0x142593;var _0x2d8fcc;return db[_0x65f6('0x42')][_0x65f6('0xd3')]({'where':{'id':_0x41ee46[_0x65f6('0x46')]['id']}})[_0x65f6('0x12')](handleEntityNotFound(_0xa54e78,null))[_0x65f6('0x12')](function(_0x1556ab){if(_0x1556ab){_0x142593=_0x1556ab;_0x3177f6[_0x65f6('0x31')]=_[_0x65f6('0x48')](db[_0x65f6('0x8d')]['rawAttributes']);_0x3177f6['query']=_[_0x65f6('0x48')](_0x41ee46[_0x65f6('0x32')]);_0x3177f6[_0x65f6('0x33')]=_[_0x65f6('0x34')](_0x3177f6[_0x65f6('0x31')],_0x3177f6[_0x65f6('0x32')]);_0x31a57d[_0x65f6('0x35')]=_[_0x65f6('0x34')](_0x3177f6[_0x65f6('0x31')],qs[_0x65f6('0x36')](_0x41ee46['query'][_0x65f6('0x36')]));_0x31a57d['attributes']=_0x31a57d['attributes'][_0x65f6('0x37')]?_0x31a57d[_0x65f6('0x35')]:_0x3177f6[_0x65f6('0x31')];_0x31a57d[_0x65f6('0x3a')]=qs['sort'](_0x41ee46[_0x65f6('0x32')][_0x65f6('0x3b')]);_0x31a57d[_0x65f6('0x3c')]=qs[_0x65f6('0x33')](_[_0x65f6('0x3d')](_0x41ee46[_0x65f6('0x32')],_0x3177f6[_0x65f6('0x33')]));if(_0x41ee46[_0x65f6('0x32')][_0x65f6('0x3e')]){_0x31a57d[_0x65f6('0x3c')]=_['merge'](_0x31a57d['where'],{'$or':_[_0x65f6('0x2f')](_0x31a57d[_0x65f6('0x35')],function(_0x457fa8){var _0x15f247={};_0x15f247[_0x457fa8]={'$like':'%'+_0x41ee46[_0x65f6('0x32')][_0x65f6('0x3e')]+'%'};return _0x15f247;})});}_0x31a57d=_[_0x65f6('0x3f')]({},_0x31a57d,_0x41ee46[_0x65f6('0x41')]);return _0x142593['getApplications'](_0x31a57d);}})['then'](function(_0x1ebe7e){if(_0x1ebe7e){_0x2d8fcc=_0x1ebe7e[_0x65f6('0x37')];if(!_0x41ee46['query'][_0x65f6('0x38')](_0x65f6('0x39'))){_0x31a57d[_0x65f6('0x1e')]=qs[_0x65f6('0x1e')](_0x41ee46[_0x65f6('0x32')][_0x65f6('0x1e')]);_0x31a57d['offset']=qs[_0x65f6('0x21')](_0x41ee46[_0x65f6('0x32')]['offset']);}return _0x142593['getApplications'](_0x31a57d);}})[_0x65f6('0x12')](function(_0x3743eb){if(_0x3743eb){return _0x3743eb?{'count':_0x2d8fcc,'rows':_0x3743eb}:null;}})[_0x65f6('0x12')](respondWithResult(_0xa54e78,null))[_0x65f6('0x1b')](handleError(_0xa54e78,null));};exports[_0x65f6('0x11c')]=function(_0x3dd349,_0x4c7b0a){return db['chatProactiveAction'][_0x65f6('0x4f')]({'where':{'id':_0x3dd349[_0x65f6('0x46')]['id']}})[_0x65f6('0x12')](handleEntityNotFound(_0x4c7b0a,null))['then'](function(_0x25684b){if(_0x25684b){return _0x25684b[_0x65f6('0x11c')](_0x3dd349[_0x65f6('0x52')]['ids'],_[_0x65f6('0xee')](_0x3dd349[_0x65f6('0x52')],[_0x65f6('0x5d'),'id'])||{});}})['then'](respondWithResult(_0x4c7b0a,null))[_0x65f6('0x1b')](handleError(_0x4c7b0a,null));};exports[_0x65f6('0x104')]=function(_0x1ad645,_0x3b062b){var _0x2c1a02={};var _0x15bdd2={};var _0x20fbe4;var _0x4316bc;return db[_0x65f6('0x42')][_0x65f6('0xd3')]({'where':{'id':_0x1ad645['params']['id']}})[_0x65f6('0x12')](handleEntityNotFound(_0x3b062b,null))['then'](function(_0x2086ce){if(_0x2086ce){_0x20fbe4=_0x2086ce;_0x15bdd2['model']=_['keys'](db[_0x65f6('0x11d')][_0x65f6('0x49')]);_0x15bdd2['query']=_[_0x65f6('0x48')](_0x1ad645[_0x65f6('0x32')]);_0x15bdd2[_0x65f6('0x33')]=_[_0x65f6('0x34')](_0x15bdd2[_0x65f6('0x31')],_0x15bdd2['query']);_0x2c1a02['attributes']=_['intersection'](_0x15bdd2[_0x65f6('0x31')],qs['fields'](_0x1ad645[_0x65f6('0x32')][_0x65f6('0x36')]));_0x2c1a02[_0x65f6('0x35')]=_0x2c1a02[_0x65f6('0x35')][_0x65f6('0x37')]?_0x2c1a02[_0x65f6('0x35')]:_0x15bdd2[_0x65f6('0x31')];_0x2c1a02['order']=qs['sort'](_0x1ad645['query'][_0x65f6('0x3b')]);_0x2c1a02[_0x65f6('0x3c')]=qs[_0x65f6('0x33')](_[_0x65f6('0x3d')](_0x1ad645['query'],_0x15bdd2[_0x65f6('0x33')]));if(_0x1ad645['query']['filter']){_0x2c1a02[_0x65f6('0x3c')]=_[_0x65f6('0x3f')](_0x2c1a02['where'],{'$or':_[_0x65f6('0x2f')](_0x2c1a02[_0x65f6('0x35')],function(_0xb4e1c5){var _0x390553={};_0x390553[_0xb4e1c5]={'$like':'%'+_0x1ad645['query']['filter']+'%'};return _0x390553;})});}_0x2c1a02=_[_0x65f6('0x3f')]({},_0x2c1a02,_0x1ad645[_0x65f6('0x41')]);return _0x20fbe4['getProactiveActions'](_0x2c1a02);}})[_0x65f6('0x12')](function(_0x13ecb8){if(_0x13ecb8){_0x4316bc=_0x13ecb8[_0x65f6('0x37')];if(!_0x1ad645[_0x65f6('0x32')][_0x65f6('0x38')](_0x65f6('0x39'))){_0x2c1a02[_0x65f6('0x1e')]=qs[_0x65f6('0x1e')](_0x1ad645[_0x65f6('0x32')]['limit']);_0x2c1a02[_0x65f6('0x21')]=qs[_0x65f6('0x21')](_0x1ad645[_0x65f6('0x32')][_0x65f6('0x21')]);}return _0x20fbe4['getProactiveActions'](_0x2c1a02);}})['then'](function(_0x2c6cca){if(_0x2c6cca){return _0x2c6cca?{'count':_0x4316bc,'rows':_0x2c6cca}:null;}})['then'](respondWithResult(_0x3b062b,null))[_0x65f6('0x1b')](handleError(_0x3b062b,null));};exports[_0x65f6('0x11e')]=function(_0x3d46d4,_0xf51395){var _0x5b3abc=_0x3d46d4[_0x65f6('0x32')]['online']===_0x65f6('0x11f')?_0x65f6('0x120'):'onlineForm';return db[_0x65f6('0x42')][_0x65f6('0x4f')]({'attributes':['id',_0x5b3abc],'where':{'id':_0x3d46d4[_0x65f6('0x46')]['id']}})[_0x65f6('0x12')](handleEntityNotFound(_0xf51395,null))[_0x65f6('0x12')](function(_0x9c768){if(_0x9c768){var _0x5b2cc1=_0x9c768[_0x5b3abc];var _0x62830b=_0x5b2cc1&&_0x5b2cc1['items']?_0x5b2cc1[_0x65f6('0x121')]:[];_0xf51395['send']({'fromKey':_[_0x65f6('0x6b')](_0x5b2cc1[_0x65f6('0x122')])?undefined:_0x5b2cc1['fromKey'],'count':_0x62830b[_0x65f6('0x37')],'rows':_0x62830b});}})[_0x65f6('0x1b')](handleError(_0xf51395,null));};exports['getOfflineMessages']=function(_0x42ad46,_0x4dd517){var _0x2dcf79={'raw':![],'where':{}};var _0x333da7={};var _0x10c466={'count':0x0,'rows':[]};return db[_0x65f6('0x42')][_0x65f6('0xd3')]({'where':{'id':_0x42ad46[_0x65f6('0x46')]['id']}})[_0x65f6('0x12')](handleEntityNotFound(_0x4dd517,null))[_0x65f6('0x12')](function(_0x1c9d56){if(_0x1c9d56){_0x333da7[_0x65f6('0x31')]=_[_0x65f6('0x48')](db[_0x65f6('0xc8')][_0x65f6('0x49')]);_0x333da7[_0x65f6('0x32')]=_[_0x65f6('0x48')](_0x42ad46[_0x65f6('0x32')]);_0x333da7['filters']=_[_0x65f6('0x34')](_0x333da7[_0x65f6('0x31')],_0x333da7['query']);_0x2dcf79[_0x65f6('0x35')]=_[_0x65f6('0x34')](_0x333da7[_0x65f6('0x31')],qs[_0x65f6('0x36')](_0x42ad46[_0x65f6('0x32')][_0x65f6('0x36')]));_0x2dcf79[_0x65f6('0x35')]=_0x2dcf79[_0x65f6('0x35')][_0x65f6('0x37')]?_0x2dcf79[_0x65f6('0x35')]:_0x333da7['model'];if(!_0x42ad46['query'][_0x65f6('0x38')](_0x65f6('0x39'))){_0x2dcf79['limit']=qs[_0x65f6('0x1e')](_0x42ad46[_0x65f6('0x32')][_0x65f6('0x1e')]);_0x2dcf79[_0x65f6('0x21')]=qs[_0x65f6('0x21')](_0x42ad46['query']['offset']);}_0x2dcf79['order']=qs[_0x65f6('0x3b')](_0x42ad46[_0x65f6('0x32')][_0x65f6('0x3b')]);_0x2dcf79[_0x65f6('0x3c')]=qs[_0x65f6('0x33')](_['pick'](_0x42ad46[_0x65f6('0x32')],_0x333da7['filters']));_0x2dcf79[_0x65f6('0x3c')][_0x65f6('0x54')]=_0x1c9d56['id'];if(_0x42ad46[_0x65f6('0x32')]['filter']){_0x2dcf79[_0x65f6('0x3c')]=_['merge'](_0x2dcf79[_0x65f6('0x3c')],{'$or':_[_0x65f6('0x2f')](_0x2dcf79['attributes'],function(_0x230125){var _0xe75255={};_0xe75255[_0x230125]={'$like':'%'+_0x42ad46['query'][_0x65f6('0x3e')]+'%'};return _0xe75255;})});}_0x2dcf79=_[_0x65f6('0x3f')]({},_0x2dcf79,_0x42ad46[_0x65f6('0x41')]);return db[_0x65f6('0xc8')][_0x65f6('0x20')]({'where':_0x2dcf79['where']})[_0x65f6('0x12')](function(_0x4416b4){_0x10c466['count']=_0x4416b4;if(_0x42ad46[_0x65f6('0x32')][_0x65f6('0x4a')]){_0x2dcf79['include']=[{'all':!![]}];}else{_0x2dcf79['include']=[{'model':db[_0x65f6('0x7c')],'as':'Contact','required':![]},{'model':db[_0x65f6('0xd1')],'as':_0x65f6('0x123'),'required':![]}];}return db[_0x65f6('0xc8')][_0x65f6('0x5b')](_0x2dcf79);})[_0x65f6('0x12')](function(_0x2e36c8){_0x10c466[_0x65f6('0x44')]=_0x2e36c8;return _0x10c466;});}})[_0x65f6('0x12')](respondWithFilteredResult(_0x4dd517,_0x2dcf79))[_0x65f6('0x1b')](handleError(_0x4dd517,null));};exports[_0x65f6('0x124')]=function(_0x52556c,_0x4665ec){return db['ChatWebsite'][_0x65f6('0x4f')]({'where':{'id':_0x52556c[_0x65f6('0x46')]['id']}})[_0x65f6('0x12')](handleEntityNotFound(_0x4665ec,null))[_0x65f6('0x12')](function(_0x57c109){if(_0x57c109){return _0x57c109['addAgents'](_0x52556c[_0x65f6('0x52')][_0x65f6('0x5d')],_[_0x65f6('0xee')](_0x52556c[_0x65f6('0x52')],[_0x65f6('0x5d'),'id'])||{})[_0x65f6('0xab')](function(_0x5052d0){for(var _0x5dcfb7=0x0;_0x5dcfb7<_0x52556c[_0x65f6('0x52')]['ids'][_0x65f6('0x37')];_0x5dcfb7+=0x1){socket[_0x65f6('0x125')](_0x65f6('0x126'),{'UserId':Number(_0x52556c[_0x65f6('0x52')][_0x65f6('0x5d')][_0x5dcfb7]),'ChatWebsiteId':Number(_0x52556c['params']['id'])});}return _0x5052d0;});}})[_0x65f6('0x12')](respondWithResult(_0x4665ec,null))['catch'](handleError(_0x4665ec,null));};exports[_0x65f6('0x127')]=function(_0xab6058,_0x57d25c){return db[_0x65f6('0x42')][_0x65f6('0x4f')]({'where':{'id':_0xab6058[_0x65f6('0x46')]['id']}})[_0x65f6('0x12')](handleEntityNotFound(_0x57d25c,null))['then'](function(_0x402a5e){if(_0x402a5e){return _0x402a5e[_0x65f6('0x127')](_0xab6058[_0x65f6('0x32')]['ids'])[_0x65f6('0x12')](function(){if(_[_0x65f6('0x128')](_0xab6058[_0x65f6('0x32')][_0x65f6('0x5d')])){for(var _0x146686=0x0;_0x146686<_0xab6058[_0x65f6('0x32')][_0x65f6('0x5d')][_0x65f6('0x37')];_0x146686+=0x1){socket[_0x65f6('0x125')]('userChatWebsite:remove',{'UserId':Number(_0xab6058[_0x65f6('0x32')][_0x65f6('0x5d')][_0x146686]),'ChatWebsiteId':Number(_0xab6058[_0x65f6('0x46')]['id'])});}}else{socket[_0x65f6('0x125')](_0x65f6('0x129'),{'UserId':Number(_0xab6058[_0x65f6('0x32')][_0x65f6('0x5d')]),'ChatWebsiteId':Number(_0xab6058[_0x65f6('0x46')]['id'])});}});}})[_0x65f6('0x12')](respondWithStatusCode(_0x57d25c,null))[_0x65f6('0x1b')](handleError(_0x57d25c,null));};exports[_0x65f6('0x12a')]=function(_0x9d31a8,_0x56a917){var _0x5bc949={};var _0xcecebe={};var _0xbf5cba;var _0xfbd390;return db[_0x65f6('0x42')]['findOne']({'where':{'id':_0x9d31a8[_0x65f6('0x46')]['id']}})[_0x65f6('0x12')](handleEntityNotFound(_0x56a917,null))[_0x65f6('0x12')](function(_0x5bba5b){if(_0x5bba5b){_0xbf5cba=_0x5bba5b;_0xcecebe[_0x65f6('0x31')]=_[_0x65f6('0x48')](db[_0x65f6('0xb2')][_0x65f6('0x49')]);_0xcecebe[_0x65f6('0x32')]=_['keys'](_0x9d31a8['query']);_0xcecebe['filters']=_[_0x65f6('0x34')](_0xcecebe[_0x65f6('0x31')],_0xcecebe[_0x65f6('0x32')]);_0x5bc949[_0x65f6('0x35')]=_[_0x65f6('0x34')](_0xcecebe[_0x65f6('0x31')],qs[_0x65f6('0x36')](_0x9d31a8[_0x65f6('0x32')][_0x65f6('0x36')]));_0x5bc949['attributes']=_0x5bc949[_0x65f6('0x35')][_0x65f6('0x37')]?_0x5bc949['attributes']:_0xcecebe['model'];_0x5bc949[_0x65f6('0x3a')]=qs['sort'](_0x9d31a8[_0x65f6('0x32')][_0x65f6('0x3b')]);_0x5bc949[_0x65f6('0x3c')]=qs[_0x65f6('0x33')](_[_0x65f6('0x3d')](_0x9d31a8[_0x65f6('0x32')],_0xcecebe[_0x65f6('0x33')]));if(_0x9d31a8[_0x65f6('0x32')][_0x65f6('0x3e')]){_0x5bc949[_0x65f6('0x3c')]=_[_0x65f6('0x3f')](_0x5bc949[_0x65f6('0x3c')],{'$or':_[_0x65f6('0x2f')](_0x5bc949[_0x65f6('0x35')],function(_0x4e5800){var _0x35934d={};_0x35934d[_0x4e5800]={'$like':'%'+_0x9d31a8[_0x65f6('0x32')][_0x65f6('0x3e')]+'%'};return _0x35934d;})});}_0x5bc949=_[_0x65f6('0x3f')]({},_0x5bc949,_0x9d31a8[_0x65f6('0x41')]);return _0xbf5cba[_0x65f6('0x12a')](_0x5bc949);}})['then'](function(_0x309659){if(_0x309659){_0xfbd390=_0x309659['length'];if(!_0x9d31a8[_0x65f6('0x32')][_0x65f6('0x38')](_0x65f6('0x39'))){_0x5bc949[_0x65f6('0x1e')]=qs[_0x65f6('0x1e')](_0x9d31a8[_0x65f6('0x32')]['limit']);_0x5bc949[_0x65f6('0x21')]=qs[_0x65f6('0x21')](_0x9d31a8[_0x65f6('0x32')]['offset']);}return _0xbf5cba[_0x65f6('0x12a')](_0x5bc949);}})[_0x65f6('0x12')](function(_0x227065){if(_0x227065){return _0x227065?{'count':_0xfbd390,'rows':_0x227065}:null;}})['then'](respondWithResult(_0x56a917,null))[_0x65f6('0x1b')](handleError(_0x56a917,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 081e806..6bca881 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 _0xd7ce=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','remove','emit'];(function(_0x4a450a,_0x54d42f){var _0x28baf9=function(_0x5cb70a){while(--_0x5cb70a){_0x4a450a['push'](_0x4a450a['shift']());}};_0x28baf9(++_0x54d42f);}(_0xd7ce,0x16b));var _0xed7c=function(_0x5cc51f,_0x22c480){_0x5cc51f=_0x5cc51f-0x0;var _0x315a2f=_0xd7ce[_0x5cc51f];return _0x315a2f;};'use strict';var EventEmitter=require(_0xed7c('0x0'));var ChatWebsite=require(_0xed7c('0x1'))['db'][_0xed7c('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xed7c('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xed7c('0x4')};function emitEvent(_0x5e454c){return function(_0x4a6138,_0x587c5a,_0x17560f){ChatWebsiteEvents[_0xed7c('0x5')](_0x5e454c+':'+_0x4a6138['id'],_0x4a6138);ChatWebsiteEvents[_0xed7c('0x5')](_0x5e454c,_0x4a6138);_0x17560f(null);};}for(var e in events){if(events[_0xed7c('0x6')](e)){var event=events[e];ChatWebsite[_0xed7c('0x7')](e,emitEvent(event));}}module[_0xed7c('0x8')]=ChatWebsiteEvents; \ No newline at end of file +var _0x097c=['hook','events','../../mysqldb','ChatWebsite','save','update','remove','emit','hasOwnProperty'];(function(_0x86f975,_0x545c42){var _0x438e67=function(_0x576d3f){while(--_0x576d3f){_0x86f975['push'](_0x86f975['shift']());}};_0x438e67(++_0x545c42);}(_0x097c,0x1d5));var _0xc097=function(_0x5ef601,_0x3c626f){_0x5ef601=_0x5ef601-0x0;var _0x4adc2f=_0x097c[_0x5ef601];return _0x4adc2f;};'use strict';var EventEmitter=require(_0xc097('0x0'));var ChatWebsite=require(_0xc097('0x1'))['db'][_0xc097('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc097('0x3'),'afterUpdate':_0xc097('0x4'),'afterDestroy':_0xc097('0x5')};function emitEvent(_0x1b9efd){return function(_0x5aa3c1,_0x265284,_0x4ac03b){ChatWebsiteEvents[_0xc097('0x6')](_0x1b9efd+':'+_0x5aa3c1['id'],_0x5aa3c1);ChatWebsiteEvents[_0xc097('0x6')](_0x1b9efd,_0x5aa3c1);_0x4ac03b(null);};}for(var e in events){if(events[_0xc097('0x7')](e)){var event=events[e];ChatWebsite[_0xc097('0x8')](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 b72f6b3..cd4a3e1 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 _0xae04=['bluebird','request-promise','path','rimraf','./chatWebsite.attributes','define','ChatWebsite','chat_websites','lodash','../../config/logger','api','moment'];(function(_0x35c4ca,_0xb02844){var _0x40df5f=function(_0x15ad59){while(--_0x15ad59){_0x35c4ca['push'](_0x35c4ca['shift']());}};_0x40df5f(++_0xb02844);}(_0xae04,0x1dc));var _0x4ae0=function(_0x2f39cf,_0x3c59ec){_0x2f39cf=_0x2f39cf-0x0;var _0xd0ece8=_0xae04[_0x2f39cf];return _0xd0ece8;};'use strict';var _=require(_0x4ae0('0x0'));var util=require('util');var logger=require(_0x4ae0('0x1'))(_0x4ae0('0x2'));var moment=require(_0x4ae0('0x3'));var BPromise=require(_0x4ae0('0x4'));var rp=require(_0x4ae0('0x5'));var fs=require('fs');var path=require(_0x4ae0('0x6'));var rimraf=require(_0x4ae0('0x7'));var config=require('../../config/environment');var attributes=require(_0x4ae0('0x8'));module['exports']=function(_0x556c5d,_0x5930d5){return _0x556c5d[_0x4ae0('0x9')](_0x4ae0('0xa'),attributes,{'tableName':_0x4ae0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8311=['lodash','../../config/logger','api','bluebird','rimraf','exports','define','ChatWebsite'];(function(_0x202327,_0x2be8c2){var _0x5f0eb3=function(_0x892370){while(--_0x892370){_0x202327['push'](_0x202327['shift']());}};_0x5f0eb3(++_0x2be8c2);}(_0x8311,0x1e0));var _0x1831=function(_0x953b57,_0x11dd4e){_0x953b57=_0x953b57-0x0;var _0x258479=_0x8311[_0x953b57];return _0x258479;};'use strict';var _=require(_0x1831('0x0'));var util=require('util');var logger=require(_0x1831('0x1'))(_0x1831('0x2'));var moment=require('moment');var BPromise=require(_0x1831('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1831('0x4'));var config=require('../../config/environment');var attributes=require('./chatWebsite.attributes');module[_0x1831('0x5')]=function(_0x5ca161,_0x21f453){return _0x5ca161[_0x1831('0x6')](_0x1831('0x7'),attributes,{'tableName':'chat_websites','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 78e111e..86a9834 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 _0x45a8=['redis','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','http'];(function(_0x2ea69b,_0x34b143){var _0x229d90=function(_0x297059){while(--_0x297059){_0x2ea69b['push'](_0x2ea69b['shift']());}};_0x229d90(++_0x34b143);}(_0x45a8,0xca));var _0x845a=function(_0x3b2919,_0xe974ed){_0x3b2919=_0x3b2919-0x0;var _0x4a7dbf=_0x45a8[_0x3b2919];return _0x4a7dbf;};'use strict';var _=require(_0x845a('0x0'));var util=require(_0x845a('0x1'));var moment=require(_0x845a('0x2'));var BPromise=require(_0x845a('0x3'));var rs=require(_0x845a('0x4'));var fs=require('fs');var Redis=require(_0x845a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x845a('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x845a('0x7')]({'port':0x232a});config[_0x845a('0x8')]=_['defaults'](config[_0x845a('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatWebsite.socket')['register'](socket);function respondWithRpcPromise(_0x2b347d,_0x14a4d0,_0x18b06d){return new BPromise(function(_0x2131dc,_0x3b955b){return client[_0x845a('0x9')](_0x2b347d,_0x18b06d)[_0x845a('0xa')](function(_0xa3d9b7){logger['info'](_0x845a('0xb'),_0x14a4d0,_0x845a('0xc'));logger[_0x845a('0xd')](_0x845a('0xe'),_0x14a4d0,_0x845a('0xc'),JSON['stringify'](_0xa3d9b7));if(_0xa3d9b7[_0x845a('0xf')]){if(_0xa3d9b7['error'][_0x845a('0x10')]===0x1f4){logger[_0x845a('0xf')](_0x845a('0xb'),_0x14a4d0,_0xa3d9b7['error'][_0x845a('0x11')]);return _0x3b955b(_0xa3d9b7[_0x845a('0xf')]['message']);}logger[_0x845a('0xf')]('ChatWebsite,\x20%s,\x20%s',_0x14a4d0,_0xa3d9b7[_0x845a('0xf')][_0x845a('0x11')]);return _0x2131dc(_0xa3d9b7['error'][_0x845a('0x11')]);}else{logger[_0x845a('0x12')](_0x845a('0xb'),_0x14a4d0,_0x845a('0xc'));_0x2131dc(_0xa3d9b7[_0x845a('0x13')][_0x845a('0x11')]);}})[_0x845a('0x14')](function(_0x298c77){logger['error'](_0x845a('0xb'),_0x14a4d0,_0x298c77);_0x3b955b(_0x298c77);});});} \ No newline at end of file +var _0x5387=['catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','localhost','redis','register','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','code','error','message'];(function(_0x37e842,_0x298bd2){var _0x404f8d=function(_0x800292){while(--_0x800292){_0x37e842['push'](_0x37e842['shift']());}};_0x404f8d(++_0x298bd2);}(_0x5387,0x83));var _0x7538=function(_0x4b7bd9,_0x5b41cd){_0x4b7bd9=_0x4b7bd9-0x0;var _0x6b4f7f=_0x5387[_0x4b7bd9];return _0x6b4f7f;};'use strict';var _=require(_0x7538('0x0'));var util=require(_0x7538('0x1'));var moment=require(_0x7538('0x2'));var BPromise=require('bluebird');var rs=require(_0x7538('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7538('0x4'))['db'];var utils=require(_0x7538('0x5'));var logger=require(_0x7538('0x6'))(_0x7538('0x7'));var config=require(_0x7538('0x8'));var jayson=require(_0x7538('0x9'));var client=jayson[_0x7538('0xa')][_0x7538('0xb')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x7538('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7538('0xd')]));require('./chatWebsite.socket')[_0x7538('0xe')](socket);function respondWithRpcPromise(_0x4eee95,_0x46e04e,_0xb0df32){return new BPromise(function(_0x5d26ac,_0x178724){return client['request'](_0x4eee95,_0xb0df32)[_0x7538('0xf')](function(_0x42a4d2){logger[_0x7538('0x10')](_0x7538('0x11'),_0x46e04e,_0x7538('0x12'));logger[_0x7538('0x13')](_0x7538('0x14'),_0x46e04e,_0x7538('0x12'),JSON[_0x7538('0x15')](_0x42a4d2));if(_0x42a4d2['error']){if(_0x42a4d2['error'][_0x7538('0x16')]===0x1f4){logger[_0x7538('0x17')](_0x7538('0x11'),_0x46e04e,_0x42a4d2[_0x7538('0x17')][_0x7538('0x18')]);return _0x178724(_0x42a4d2[_0x7538('0x17')][_0x7538('0x18')]);}logger['error'](_0x7538('0x11'),_0x46e04e,_0x42a4d2['error'][_0x7538('0x18')]);return _0x5d26ac(_0x42a4d2[_0x7538('0x17')]['message']);}else{logger[_0x7538('0x10')](_0x7538('0x11'),_0x46e04e,_0x7538('0x12'));_0x5d26ac(_0x42a4d2['result'][_0x7538('0x18')]);}})[_0x7538('0x19')](function(_0x12d9df){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x46e04e,_0x12d9df);_0x178724(_0x12d9df);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index be6b04a..6d3127f 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 _0x00b4=['emit','register','length','chatWebsite:','./chatWebsite.events','save','remove','update'];(function(_0x42ebba,_0x4cbf87){var _0x3fd2af=function(_0x26d999){while(--_0x26d999){_0x42ebba['push'](_0x42ebba['shift']());}};_0x3fd2af(++_0x4cbf87);}(_0x00b4,0x11c));var _0x400b=function(_0x161d59,_0x11d2ec){_0x161d59=_0x161d59-0x0;var _0xd33fcd=_0x00b4[_0x161d59];return _0xd33fcd;};'use strict';var ChatWebsiteEvents=require(_0x400b('0x0'));var events=[_0x400b('0x1'),_0x400b('0x2'),_0x400b('0x3')];function createListener(_0x22cf2a,_0x1b9b10){return function(_0x2e33c4){_0x1b9b10[_0x400b('0x4')](_0x22cf2a,_0x2e33c4);};}function removeListener(_0x141a22,_0xcbca7f){return function(){ChatWebsiteEvents['removeListener'](_0x141a22,_0xcbca7f);};}exports[_0x400b('0x5')]=function(_0x487793){for(var _0x2682c0=0x0,_0x211f34=events[_0x400b('0x6')];_0x2682c0<_0x211f34;_0x2682c0++){var _0xb6be39=events[_0x2682c0];var _0x332ccc=createListener(_0x400b('0x7')+_0xb6be39,_0x487793);ChatWebsiteEvents['on'](_0xb6be39,_0x332ccc);}}; \ No newline at end of file +var _0xa08d=['./chatWebsite.events','save','remove','update','removeListener','register','length','chatWebsite:'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xa08d,0x98));var _0xda08=function(_0x50cf15,_0xd90257){_0x50cf15=_0x50cf15-0x0;var _0x1ce688=_0xa08d[_0x50cf15];return _0x1ce688;};'use strict';var ChatWebsiteEvents=require(_0xda08('0x0'));var events=[_0xda08('0x1'),_0xda08('0x2'),_0xda08('0x3')];function createListener(_0x45783a,_0x36fcb7){return function(_0x2044e){_0x36fcb7['emit'](_0x45783a,_0x2044e);};}function removeListener(_0x1333fd,_0x11596c){return function(){ChatWebsiteEvents[_0xda08('0x4')](_0x1333fd,_0x11596c);};}exports[_0xda08('0x5')]=function(_0x406015){for(var _0x53ec75=0x0,_0x422f21=events[_0xda08('0x6')];_0x53ec75<_0x422f21;_0x53ec75++){var _0x1c88f3=events[_0x53ec75];var _0x27fb41=createListener(_0xda08('0x7')+_0x1c88f3,_0x406015);ChatWebsiteEvents['on'](_0x1c88f3,_0x27fb41);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 53463fd..ebd7870 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 _0x020f=['addAvatar','%s-%s','/:id/customer_avatar','file','addCustomerAvatar','addSystemAvatar','/:id/notify','attachments','offline-chat','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','addAgents','put','update','destroy','delete','removeDispositions','/:id/canned_answers','removeAgents','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/logo','getLogo','/:id/avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','/:id/snippet','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','server/files/images/logos/','format','originalname','single','join','root','server/files/images/avatars/','now'];(function(_0x469ac7,_0x38e416){var _0x22f3b0=function(_0x1a1447){while(--_0x1a1447){_0x469ac7['push'](_0x469ac7['shift']());}};_0x22f3b0(++_0x38e416);}(_0x020f,0xf8));var _0xf020=function(_0x591c55,_0x45a0e2){_0x591c55=_0x591c55-0x0;var _0x118d45=_0x020f[_0x591c55];return _0x118d45;};'use strict';var multer=require(_0xf020('0x0'));var util=require(_0xf020('0x1'));var path=require('path');var timeout=require(_0xf020('0x2'));var express=require(_0xf020('0x3'));var router=express['Router']();var fs_extra=require(_0xf020('0x4'));var auth=require(_0xf020('0x5'));var interaction=require(_0xf020('0x6'));var config=require(_0xf020('0x7'));var controller=require(_0xf020('0x8'));router[_0xf020('0x9')]('/',auth[_0xf020('0xa')](),controller['index']);router['get'](_0xf020('0xb'),auth[_0xf020('0xa')](),controller[_0xf020('0xc')]);router[_0xf020('0x9')](_0xf020('0xd'),auth['isAuthenticated'](),controller[_0xf020('0xe')]);router[_0xf020('0x9')](_0xf020('0xf'),auth[_0xf020('0xa')](),controller[_0xf020('0x10')]);router[_0xf020('0x9')]('/:id/canned_answers',auth[_0xf020('0xa')](),controller[_0xf020('0x11')]);router[_0xf020('0x9')](_0xf020('0x12'),controller[_0xf020('0x13')]);router[_0xf020('0x9')](_0xf020('0x14'),controller['getAvatar']);router['get']('/:id/customer_avatar',controller[_0xf020('0x15')]);router['get'](_0xf020('0x16'),controller[_0xf020('0x17')]);router[_0xf020('0x9')](_0xf020('0x18'),auth['isAuthenticated'](),controller['getInteractions']);router[_0xf020('0x9')](_0xf020('0x19'),controller['getSnippet']);router[_0xf020('0x9')]('/:id/applications',auth[_0xf020('0xa')](),controller[_0xf020('0x1a')]);router[_0xf020('0x9')](_0xf020('0x1b'),auth[_0xf020('0xa')](),controller[_0xf020('0x1c')]);router[_0xf020('0x9')](_0xf020('0x1d'),controller[_0xf020('0x1e')]);router['get'](_0xf020('0x1f'),auth[_0xf020('0xa')](),controller[_0xf020('0x20')]);router[_0xf020('0x9')](_0xf020('0x21'),auth['isAuthenticated'](),controller[_0xf020('0x22')]);router[_0xf020('0x23')]('/',auth[_0xf020('0xa')](),controller[_0xf020('0x24')]);router['post']('/:id/dispositions',auth[_0xf020('0xa')](),controller[_0xf020('0x25')]);router[_0xf020('0x23')]('/:id/canned_answers',auth[_0xf020('0xa')](),controller[_0xf020('0x26')]);var upload=multer({'storage':multer[_0xf020('0x27')]({'destination':function(_0x2deba1,_0x5bd9fa,_0x12f5f3){_0x12f5f3(null,path['join'](config['root'],_0xf020('0x28')));},'filename':function(_0x2003f7,_0x303c28,_0x48a5f7){_0x48a5f7(null,util[_0xf020('0x29')]('%s-%s',Date['now'](),_0x303c28[_0xf020('0x2a')]));}})});router[_0xf020('0x23')](_0xf020('0x12'),upload[_0xf020('0x2b')]('file'),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x44104f,_0x1f87a0,_0x50199d){_0x50199d(null,path[_0xf020('0x2c')](config[_0xf020('0x2d')],_0xf020('0x2e')));},'filename':function(_0x2f6683,_0x506fab,_0x464fe8){_0x464fe8(null,util[_0xf020('0x29')]('%s-%s',Date[_0xf020('0x2f')](),_0x506fab[_0xf020('0x2a')]));}})});router[_0xf020('0x23')](_0xf020('0x14'),upload['single']('file'),controller[_0xf020('0x30')]);var upload=multer({'storage':multer[_0xf020('0x27')]({'destination':function(_0x365bd0,_0x4dda53,_0x480b14){_0x480b14(null,path['join'](config['root'],_0xf020('0x2e')));},'filename':function(_0x2ca704,_0x1807ed,_0x4b7dd1){_0x4b7dd1(null,util[_0xf020('0x29')](_0xf020('0x31'),Date[_0xf020('0x2f')](),_0x1807ed[_0xf020('0x2a')]));}})});router[_0xf020('0x23')](_0xf020('0x32'),upload[_0xf020('0x2b')](_0xf020('0x33')),controller[_0xf020('0x34')]);var upload=multer({'storage':multer[_0xf020('0x27')]({'destination':function(_0x1b7283,_0x1694ad,_0x17bf16){_0x17bf16(null,path[_0xf020('0x2c')](config['root'],_0xf020('0x2e')));},'filename':function(_0x476a2d,_0x3601e8,_0x3f50d2){_0x3f50d2(null,util[_0xf020('0x29')](_0xf020('0x31'),Date[_0xf020('0x2f')](),_0x3601e8['originalname']));}})});router[_0xf020('0x23')](_0xf020('0x16'),upload[_0xf020('0x2b')](_0xf020('0x33')),controller[_0xf020('0x35')]);router[_0xf020('0x23')](_0xf020('0x36'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0xf020('0x27')]({'destination':function(_0x404c29,_0x51f179,_0x5af0fc){const _0x2a7c89=path[_0xf020('0x2c')](config['root'],'server/files',_0xf020('0x37'),_0xf020('0x38'));fs_extra['ensureDir'](_0x2a7c89,function(){_0x5af0fc(null,_0x2a7c89);});},'filename':function(_0x236f37,_0x543ee2,_0x27c910){const _0x2ad216=_0x543ee2[_0xf020('0x2a')][_0xf020('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x4f6b30=path[_0xf020('0x3a')](_0x2ad216);const _0x5d6e9b=Date[_0xf020('0x2f')]()+'-'+_0x2ad216[_0xf020('0x39')](_0x4f6b30,'')+_0x4f6b30;_0x27c910(null,_0x5d6e9b);}})});router['post'](_0xf020('0x3b'),offlineUploadMulter[_0xf020('0x3c')](),controller[_0xf020('0x3d')]);router[_0xf020('0x23')](_0xf020('0x18'),auth[_0xf020('0xa')](),controller[_0xf020('0x3e')]);router[_0xf020('0x23')]('/:id/applications',auth[_0xf020('0xa')](),controller[_0xf020('0x3f')]);router[_0xf020('0x23')](_0xf020('0x1b'),auth[_0xf020('0xa')](),controller[_0xf020('0x40')]);router['post'](_0xf020('0x21'),auth['isAuthenticated'](),controller[_0xf020('0x41')]);router[_0xf020('0x42')]('/:id',auth[_0xf020('0xa')](),controller[_0xf020('0x43')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xf020('0x44')]);router[_0xf020('0x45')](_0xf020('0xf'),auth[_0xf020('0xa')](),controller[_0xf020('0x46')]);router[_0xf020('0x45')](_0xf020('0x47'),auth[_0xf020('0xa')](),controller['removeAnswers']);router[_0xf020('0x45')]('/:id/users',auth[_0xf020('0xa')](),controller[_0xf020('0x48')]);module[_0xf020('0x49')]=router; \ No newline at end of file +var _0x2b49=['./chatWebsite.controller','get','index','/describe','isAuthenticated','describe','/:id','getDispositions','/:id/canned_answers','getAvatar','getSystemAvatar','/:id/interactions','/:id/snippet','getSnippet','getApplications','getProactiveActions','/:id/fields','/:id/offline_messages','getOfflineMessages','getAgents','post','create','/:id/dispositions','addDisposition','addAnswer','join','root','%s-%s','now','/:id/logo','single','file','diskStorage','format','addAvatar','server/files/images/avatars/','originalname','/:id/customer_avatar','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','attachments','offline-chat','ensureDir','replace','any','offline','addInteraction','/:id/applications','addApplications','/:id/proactive_actions','addProactiveActions','/:id/users','put','update','removeDispositions','delete','removeAgents','exports','multer','util','path','express','../../components/auth/service'];(function(_0x35b7d4,_0x5a5c43){var _0x4e8cee=function(_0x66859c){while(--_0x66859c){_0x35b7d4['push'](_0x35b7d4['shift']());}};_0x4e8cee(++_0x5a5c43);}(_0x2b49,0x140));var _0x92b4=function(_0x5505b0,_0x1e74ad){_0x5505b0=_0x5505b0-0x0;var _0x3309a6=_0x2b49[_0x5505b0];return _0x3309a6;};'use strict';var multer=require(_0x92b4('0x0'));var util=require(_0x92b4('0x1'));var path=require(_0x92b4('0x2'));var timeout=require('connect-timeout');var express=require(_0x92b4('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x92b4('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x92b4('0x5'));router[_0x92b4('0x6')]('/',auth['isAuthenticated'](),controller[_0x92b4('0x7')]);router[_0x92b4('0x6')](_0x92b4('0x8'),auth[_0x92b4('0x9')](),controller[_0x92b4('0xa')]);router[_0x92b4('0x6')](_0x92b4('0xb'),auth[_0x92b4('0x9')](),controller['show']);router[_0x92b4('0x6')]('/:id/dispositions',auth[_0x92b4('0x9')](),controller[_0x92b4('0xc')]);router[_0x92b4('0x6')](_0x92b4('0xd'),auth[_0x92b4('0x9')](),controller['getAnswers']);router['get']('/:id/logo',controller['getLogo']);router[_0x92b4('0x6')]('/:id/avatar',controller[_0x92b4('0xe')]);router[_0x92b4('0x6')]('/:id/customer_avatar',controller['getCustomerAvatar']);router[_0x92b4('0x6')]('/:id/system_avatar',controller[_0x92b4('0xf')]);router[_0x92b4('0x6')](_0x92b4('0x10'),auth[_0x92b4('0x9')](),controller['getInteractions']);router[_0x92b4('0x6')](_0x92b4('0x11'),controller[_0x92b4('0x12')]);router[_0x92b4('0x6')]('/:id/applications',auth[_0x92b4('0x9')](),controller[_0x92b4('0x13')]);router[_0x92b4('0x6')]('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0x92b4('0x14')]);router[_0x92b4('0x6')](_0x92b4('0x15'),controller['getFields']);router[_0x92b4('0x6')](_0x92b4('0x16'),auth['isAuthenticated'](),controller[_0x92b4('0x17')]);router[_0x92b4('0x6')]('/:id/users',auth[_0x92b4('0x9')](),controller[_0x92b4('0x18')]);router[_0x92b4('0x19')]('/',auth['isAuthenticated'](),controller[_0x92b4('0x1a')]);router[_0x92b4('0x19')](_0x92b4('0x1b'),auth[_0x92b4('0x9')](),controller[_0x92b4('0x1c')]);router[_0x92b4('0x19')](_0x92b4('0xd'),auth[_0x92b4('0x9')](),controller[_0x92b4('0x1d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xef29c5,_0x4b5b33,_0x468a30){_0x468a30(null,path[_0x92b4('0x1e')](config[_0x92b4('0x1f')],'server/files/images/logos/'));},'filename':function(_0x36dfb2,_0x413d8d,_0x115eb5){_0x115eb5(null,util['format'](_0x92b4('0x20'),Date[_0x92b4('0x21')](),_0x413d8d['originalname']));}})});router[_0x92b4('0x19')](_0x92b4('0x22'),upload[_0x92b4('0x23')](_0x92b4('0x24')),controller['addLogo']);var upload=multer({'storage':multer[_0x92b4('0x25')]({'destination':function(_0x1005ba,_0x2cb143,_0x282369){_0x282369(null,path[_0x92b4('0x1e')](config[_0x92b4('0x1f')],'server/files/images/avatars/'));},'filename':function(_0x569d91,_0x829cbd,_0x3cd6e7){_0x3cd6e7(null,util[_0x92b4('0x26')](_0x92b4('0x20'),Date[_0x92b4('0x21')](),_0x829cbd['originalname']));}})});router[_0x92b4('0x19')]('/:id/avatar',upload[_0x92b4('0x23')]('file'),controller[_0x92b4('0x27')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x148c3b,_0x557752,_0x275ec1){_0x275ec1(null,path[_0x92b4('0x1e')](config[_0x92b4('0x1f')],_0x92b4('0x28')));},'filename':function(_0x4997d9,_0x437517,_0x33c0d0){_0x33c0d0(null,util[_0x92b4('0x26')]('%s-%s',Date[_0x92b4('0x21')](),_0x437517[_0x92b4('0x29')]));}})});router[_0x92b4('0x19')](_0x92b4('0x2a'),upload[_0x92b4('0x23')](_0x92b4('0x24')),controller[_0x92b4('0x2b')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x32bbf7,_0x335159,_0x3d72fe){_0x3d72fe(null,path[_0x92b4('0x1e')](config[_0x92b4('0x1f')],_0x92b4('0x28')));},'filename':function(_0x53df3c,_0x3ecbdc,_0x4e97c3){_0x4e97c3(null,util[_0x92b4('0x26')]('%s-%s',Date['now'](),_0x3ecbdc[_0x92b4('0x29')]));}})});router[_0x92b4('0x19')]('/:id/system_avatar',upload[_0x92b4('0x23')](_0x92b4('0x24')),controller[_0x92b4('0x2c')]);router[_0x92b4('0x19')](_0x92b4('0x2d'),controller[_0x92b4('0x2e')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x26e347,_0xeeb322,_0x5339c7){const _0xf913b0=path[_0x92b4('0x1e')](config[_0x92b4('0x1f')],'server/files',_0x92b4('0x2f'),_0x92b4('0x30'));fs_extra[_0x92b4('0x31')](_0xf913b0,function(){_0x5339c7(null,_0xf913b0);});},'filename':function(_0x1d2694,_0x39abb8,_0x201898){const _0x50c09b=_0x39abb8['originalname'][_0x92b4('0x32')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x534c4a=path['extname'](_0x50c09b);const _0x132cf2=Date[_0x92b4('0x21')]()+'-'+_0x50c09b[_0x92b4('0x32')](_0x534c4a,'')+_0x534c4a;_0x201898(null,_0x132cf2);}})});router['post']('/:id/offline',offlineUploadMulter[_0x92b4('0x33')](),controller[_0x92b4('0x34')]);router[_0x92b4('0x19')](_0x92b4('0x10'),auth[_0x92b4('0x9')](),controller[_0x92b4('0x35')]);router['post'](_0x92b4('0x36'),auth[_0x92b4('0x9')](),controller[_0x92b4('0x37')]);router['post'](_0x92b4('0x38'),auth[_0x92b4('0x9')](),controller[_0x92b4('0x39')]);router[_0x92b4('0x19')](_0x92b4('0x3a'),auth['isAuthenticated'](),controller['addAgents']);router[_0x92b4('0x3b')](_0x92b4('0xb'),auth[_0x92b4('0x9')](),controller[_0x92b4('0x3c')]);router['delete'](_0x92b4('0xb'),auth[_0x92b4('0x9')](),controller['destroy']);router['delete'](_0x92b4('0x1b'),auth[_0x92b4('0x9')](),controller[_0x92b4('0x3d')]);router[_0x92b4('0x3e')](_0x92b4('0xd'),auth['isAuthenticated'](),controller['removeAnswers']);router[_0x92b4('0x3e')](_0x92b4('0x3a'),auth[_0x92b4('0x9')](),controller[_0x92b4('0x3f')]);module[_0x92b4('0x40')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index 3de26b3..bba6c9a 100644 --- a/server/api/client-side-logs.js +++ b/server/api/client-side-logs.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x40e4=['exports','beaver-logger/server','express','../components/auth/service','app','get','client-side-logger','expressEndpoint','/client-logs','use'];(function(_0xc2dde6,_0x1cccc9){var _0x9fc29c=function(_0x54ba28){while(--_0x54ba28){_0xc2dde6['push'](_0xc2dde6['shift']());}};_0x9fc29c(++_0x1cccc9);}(_0x40e4,0x97));var _0x440e=function(_0xfdb740,_0x14c2da){_0xfdb740=_0xfdb740-0x0;var _0x4a837d=_0x40e4[_0xfdb740];return _0x4a837d;};var beaverLogger=require(_0x440e('0x0'));var express=require(_0x440e('0x1'));var auth=require(_0x440e('0x2'));var config=require('../config/environment');var router=express['Router']();var isProduction=config['env']==='production'||![];function clientSideLogs(_0x10a0b8,_0x791745,_0xd0adf4){var _0x59b844=_0x10a0b8[_0x440e('0x3')][_0x440e('0x4')](_0x440e('0x5'));if(!_0x59b844){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0x440e('0x6')]({'uri':_0x440e('0x7'),'logger':_0x59b844,'enableCors':!isProduction})(_0x10a0b8,_0x791745,_0xd0adf4);}router[_0x440e('0x8')](auth['isAuthenticated'](),clientSideLogs);module[_0x440e('0x9')]=router; \ No newline at end of file +var _0x3e13=['env','get','client-side-logger','expressEndpoint','/client-logs','use','isAuthenticated','exports','beaver-logger/server','express','../components/auth/service','../config/environment'];(function(_0x1c775f,_0x39bf76){var _0xcf5722=function(_0x3350a9){while(--_0x3350a9){_0x1c775f['push'](_0x1c775f['shift']());}};_0xcf5722(++_0x39bf76);}(_0x3e13,0x1a0));var _0x33e1=function(_0x28aea5,_0x3bb12e){_0x28aea5=_0x28aea5-0x0;var _0x6a55f9=_0x3e13[_0x28aea5];return _0x6a55f9;};var beaverLogger=require(_0x33e1('0x0'));var express=require(_0x33e1('0x1'));var auth=require(_0x33e1('0x2'));var config=require(_0x33e1('0x3'));var router=express['Router']();var isProduction=config[_0x33e1('0x4')]==='production'||![];function clientSideLogs(_0xa8b29d,_0x922afe,_0x28a93b){var _0x23ab35=_0xa8b29d['app'][_0x33e1('0x5')](_0x33e1('0x6'));if(!_0x23ab35){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0x33e1('0x7')]({'uri':_0x33e1('0x8'),'logger':_0x23ab35,'enableCors':!isProduction})(_0xa8b29d,_0x922afe,_0x28a93b);}router[_0x33e1('0x9')](auth[_0x33e1('0xa')](),clientSideLogs);module[_0x33e1('0xb')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 4adb302..0588c3e 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 _0x41f9=['Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20access_token','TEXT','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','AmazonAWS','Google','MicrosoftAzure','ENUM'];(function(_0x335ef9,_0x280744){var _0x51ec48=function(_0x204824){while(--_0x204824){_0x335ef9['push'](_0x335ef9['shift']());}};_0x51ec48(++_0x280744);}(_0x41f9,0xe3));var _0x941f=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x41f9[_0x199572];return _0x13cfa3;};'use strict';var Sequelize=require(_0x941f('0x0'));module[_0x941f('0x1')]={'name':{'type':Sequelize[_0x941f('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x941f('0x3'),_0x941f('0x4'),_0x941f('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x941f('0x6')](_0x941f('0x7'),_0x941f('0x8'))},'data1':{'type':Sequelize[_0x941f('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0x941f('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize['TEXT'],'comment':_0x941f('0x9')},'data6':{'type':Sequelize[_0x941f('0xa')],'comment':_0x941f('0xb')},'data7':{'type':Sequelize[_0x941f('0xa')],'comment':_0x941f('0xc')}}; \ No newline at end of file +var _0x9c53=['AmazonAWS','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM'];(function(_0x46f193,_0x4f65c9){var _0x50516d=function(_0x172558){while(--_0x172558){_0x46f193['push'](_0x46f193['shift']());}};_0x50516d(++_0x4f65c9);}(_0x9c53,0x13e));var _0x39c5=function(_0x5bdf55,_0x226b50){_0x5bdf55=_0x5bdf55-0x0;var _0x31acff=_0x9c53[_0x5bdf55];return _0x31acff;};'use strict';var Sequelize=require(_0x39c5('0x0'));module[_0x39c5('0x1')]={'name':{'type':Sequelize[_0x39c5('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x39c5('0x3')](_0x39c5('0x4'),'Google',_0x39c5('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x39c5('0x3')](_0x39c5('0x6'),_0x39c5('0x7'))},'data1':{'type':Sequelize[_0x39c5('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0x39c5('0x2')],'comment':_0x39c5('0x8')},'data3':{'type':Sequelize[_0x39c5('0x2')],'comment':_0x39c5('0x9')},'data4':{'type':Sequelize[_0x39c5('0x2')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0x39c5('0xa')],'comment':_0x39c5('0xb')},'data6':{'type':Sequelize[_0x39c5('0xa')],'comment':_0x39c5('0xc')},'data7':{'type':Sequelize[_0x39c5('0xa')],'comment':_0x39c5('0xd')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index daffa4f..a62fb1b 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 _0x3978=['findOne','user','oauth2MicrosoftCallback','get','Invalid\x20state\x20parameter','parse','from','state','base64','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','data5','access_token','data6','refresh_token','emit','microsoftAuthorization:success','microsoftAuthorization:error','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','end','status','offset','undefined','limit','count','set','json','then','destroy','error','name','index','CloudProvider','rawAttributes','key','map','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','service','MicrosoftAzure','decryptString','data3','params','find','catch','body','Service\x20parameter\x20not\x20specified','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','update','oauth2MicrosoftAuthorize'];(function(_0xe50651,_0x78b476){var _0xc8931c=function(_0x1c2902){while(--_0x1c2902){_0xe50651['push'](_0xe50651['shift']());}};_0xc8931c(++_0x78b476);}(_0x3978,0x6e));var _0x8397=function(_0x101f0d,_0x223697){_0x101f0d=_0x101f0d-0x0;var _0x59aade=_0x3978[_0x101f0d];return _0x59aade;};'use strict';var _=require('lodash');var Redis=require('ioredis');var qs=require(_0x8397('0x0'));var encryptor=require(_0x8397('0x1'));var config=require(_0x8397('0x2'));var logger=require(_0x8397('0x3'))(_0x8397('0x4'));var db=require(_0x8397('0x5'))['db'];var oauth=require('./cloudProvider.oauth');config[_0x8397('0x6')]=_[_0x8397('0x7')](config[_0x8397('0x6')],{'host':_0x8397('0x8'),'port':0x18eb});var socket=require(_0x8397('0x9'))(new Redis(config[_0x8397('0x6')]));var redis=new Redis(config[_0x8397('0x6')]);function respondWithStatusCode(_0xa2b089,_0x3ae5e4){_0x3ae5e4=_0x3ae5e4||0xcc;return function(_0x7ac31f){if(_0x7ac31f){return _0xa2b089[_0x8397('0xa')](_0x3ae5e4);}return _0xa2b089['status'](_0x3ae5e4)[_0x8397('0xb')]();};}function respondWithResult(_0x5ecc73,_0x36c13a){_0x36c13a=_0x36c13a||0xc8;return function(_0x32fae5){if(_0x32fae5){return _0x5ecc73[_0x8397('0xc')](_0x36c13a)['json'](_0x32fae5);}};}function respondWithFilteredResult(_0x36b24e,_0x2b93c7){return function(_0x343b1f){if(_0x343b1f){var _0x4272b9=typeof _0x2b93c7[_0x8397('0xd')]===_0x8397('0xe')&&typeof _0x2b93c7[_0x8397('0xf')]===_0x8397('0xe');var _0x509d74=_0x343b1f[_0x8397('0x10')];var _0x59f438=_0x4272b9?0x0:_0x2b93c7['offset'];var _0x44f56d=_0x4272b9?_0x343b1f[_0x8397('0x10')]:_0x2b93c7['offset']+_0x2b93c7[_0x8397('0xf')];var _0x5c5bc5;if(_0x44f56d>=_0x509d74){_0x44f56d=_0x509d74;_0x5c5bc5=0xc8;}else{_0x5c5bc5=0xce;}_0x36b24e[_0x8397('0xc')](_0x5c5bc5);return _0x36b24e[_0x8397('0x11')]('Content-Range',_0x59f438+'-'+_0x44f56d+'/'+_0x509d74)[_0x8397('0x12')](_0x343b1f);}return null;};}function saveUpdates(_0x6a9af7){return function(_0x2db637){if(_0x2db637){return _0x2db637['update'](_0x6a9af7)[_0x8397('0x13')](function(_0x25c5ef){return _0x25c5ef;});}return null;};}function removeEntity(_0x33d7b5){return function(_0x2c76ae){if(_0x2c76ae){return _0x2c76ae[_0x8397('0x14')]()[_0x8397('0x13')](function(){_0x33d7b5['status'](0xcc)[_0x8397('0xb')]();});}};}function handleEntityNotFound(_0x137fe0){return function(_0x1c01c1){if(!_0x1c01c1){_0x137fe0[_0x8397('0xa')](0x194);}return _0x1c01c1;};}function handleError(_0x6303f0,_0x25a193){_0x25a193=_0x25a193||0x1f4;return function(_0x5cccd1){logger[_0x8397('0x15')](_0x5cccd1['stack']);if(_0x5cccd1[_0x8397('0x16')]){delete _0x5cccd1['name'];}_0x6303f0[_0x8397('0xc')](_0x25a193)['send'](_0x5cccd1);};}function maskClientSecret(_0x1f5720){return _['padEnd'](_0x1f5720['slice'](0x0,0x3),0x14,'*');}exports[_0x8397('0x17')]=function(_0x3c4633,_0xb50b8c){var _0x257121={},_0xf43617={},_0x27b304={'count':0x0,'rows':[]};var _0xfba76c=_['map'](db[_0x8397('0x18')][_0x8397('0x19')],function(_0x52e9b5){return{'name':_0x52e9b5['fieldName'],'type':_0x52e9b5['type'][_0x8397('0x1a')]};});_0xf43617['model']=_[_0x8397('0x1b')](_0xfba76c,_0x8397('0x16'));_0xf43617['query']=_[_0x8397('0x1c')](_0x3c4633[_0x8397('0x1d')]);_0xf43617['filters']=_[_0x8397('0x1e')](_0xf43617[_0x8397('0x1f')],_0xf43617[_0x8397('0x1d')]);_0x257121[_0x8397('0x20')]=_[_0x8397('0x1e')](_0xf43617[_0x8397('0x1f')],qs[_0x8397('0x21')](_0x3c4633[_0x8397('0x1d')]['fields']));_0x257121['attributes']=_0x257121[_0x8397('0x20')][_0x8397('0x22')]?_0x257121[_0x8397('0x20')]:_0xf43617[_0x8397('0x1f')];if(!_0x3c4633[_0x8397('0x1d')][_0x8397('0x23')](_0x8397('0x24'))){_0x257121[_0x8397('0xf')]=qs['limit'](_0x3c4633[_0x8397('0x1d')]['limit']);_0x257121[_0x8397('0xd')]=qs['offset'](_0x3c4633[_0x8397('0x1d')]['offset']);}_0x257121[_0x8397('0x25')]=qs['sort'](_0x3c4633['query'][_0x8397('0x26')]);_0x257121[_0x8397('0x27')]=qs[_0x8397('0x28')](_[_0x8397('0x29')](_0x3c4633[_0x8397('0x1d')],_0xf43617[_0x8397('0x28')]),_0xfba76c);if(_0x3c4633[_0x8397('0x1d')][_0x8397('0x2a')]){_0x257121[_0x8397('0x27')]=_[_0x8397('0x2b')](_0x257121[_0x8397('0x27')],{'$or':_[_0x8397('0x1b')](_0xfba76c,function(_0x4d0cf9){if(_0x4d0cf9[_0x8397('0x2c')]!==_0x8397('0x2d')){var _0x527022={};_0x527022[_0x4d0cf9['name']]={'$like':'%'+_0x3c4633['query'][_0x8397('0x2a')]+'%'};return _0x527022;}})});}_0x257121=_[_0x8397('0x2b')]({},_0x257121,_0x3c4633[_0x8397('0x2e')]);var _0x3065af={'where':_0x257121[_0x8397('0x27')]};return db[_0x8397('0x18')][_0x8397('0x10')](_0x3065af)[_0x8397('0x13')](function(_0x32006a){_0x27b304[_0x8397('0x10')]=_0x32006a;if(_0x3c4633[_0x8397('0x1d')][_0x8397('0x2f')]){_0x257121[_0x8397('0x30')]=[{'all':!![]}];}return db[_0x8397('0x18')][_0x8397('0x31')](_0x257121);})[_0x8397('0x13')](function(_0x96439b){_0x27b304[_0x8397('0x32')]=_[_0x8397('0x1b')](_0x96439b,function(_0x260285){if(_0x260285[_0x8397('0x33')]===_0x8397('0x34')){var _0x1d5b57=encryptor[_0x8397('0x35')](_0x260285[_0x8397('0x36')]);_0x260285[_0x8397('0x36')]=maskClientSecret(_0x1d5b57);}return _0x260285;});return _0x27b304;})['then'](respondWithFilteredResult(_0xb50b8c,_0x257121))['catch'](handleError(_0xb50b8c,null));};exports['show']=function(_0x3b64d1,_0x2c65ee){var _0x180ece={'raw':!![],'where':{'id':_0x3b64d1[_0x8397('0x37')]['id']}},_0x4e637e={};_0x4e637e[_0x8397('0x1f')]=_[_0x8397('0x1c')](db['CloudProvider'][_0x8397('0x19')]);_0x4e637e[_0x8397('0x1d')]=_[_0x8397('0x1c')](_0x3b64d1[_0x8397('0x1d')]);_0x4e637e[_0x8397('0x28')]=_['intersection'](_0x4e637e['model'],_0x4e637e[_0x8397('0x1d')]);_0x180ece[_0x8397('0x20')]=_[_0x8397('0x1e')](_0x4e637e[_0x8397('0x1f')],qs[_0x8397('0x21')](_0x3b64d1[_0x8397('0x1d')][_0x8397('0x21')]));_0x180ece[_0x8397('0x20')]=_0x180ece[_0x8397('0x20')]['length']?_0x180ece['attributes']:_0x4e637e[_0x8397('0x1f')];if(_0x3b64d1['query'][_0x8397('0x2f')]){_0x180ece[_0x8397('0x30')]=[{'all':!![]}];}_0x180ece=_[_0x8397('0x2b')]({},_0x180ece,_0x3b64d1['options']);return db[_0x8397('0x18')][_0x8397('0x38')](_0x180ece)[_0x8397('0x13')](handleEntityNotFound(_0x2c65ee,null))[_0x8397('0x13')](function(_0x2a138c){if(_0x2a138c[_0x8397('0x33')]==='MicrosoftAzure'){var _0x1d0d26=encryptor['decryptString'](_0x2a138c[_0x8397('0x36')]);_0x2a138c[_0x8397('0x36')]=maskClientSecret(_0x1d0d26);}return _0x2a138c;})[_0x8397('0x13')](respondWithResult(_0x2c65ee,null))[_0x8397('0x39')](handleError(_0x2c65ee,null));};exports['create']=function(_0x13f63a,_0x57ba7c){if(!_0x13f63a[_0x8397('0x3a')][_0x8397('0x16')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x13f63a['body'][_0x8397('0x33')])throw new Error(_0x8397('0x3b'));var _0x1bc0c2=db[_0x8397('0x18')][_0x8397('0x19')][_0x8397('0x33')]['values'];if(!_0x1bc0c2[_0x8397('0x3c')](_0x13f63a['body']['service']))throw new Error(_0x8397('0x3d')+_0x1bc0c2[_0x8397('0x3e')](',\x20'));if(_0x13f63a['body']['service']===_0x8397('0x34')&&_0x13f63a['body'][_0x8397('0x36')]){_0x13f63a[_0x8397('0x3a')][_0x8397('0x36')]=encryptor[_0x8397('0x3f')](_0x13f63a[_0x8397('0x3a')]['data3']);}return db[_0x8397('0x18')]['create'](_0x13f63a['body'],{})[_0x8397('0x13')](respondWithResult(_0x57ba7c,0xc9))[_0x8397('0x39')](handleError(_0x57ba7c,null));};exports[_0x8397('0x40')]=function(_0x88ea75,_0x411cbb){if(_0x88ea75[_0x8397('0x3a')]['id']){delete _0x88ea75['body']['id'];}return db[_0x8397('0x18')][_0x8397('0x38')]({'where':{'id':_0x88ea75['params']['id']}})[_0x8397('0x13')](handleEntityNotFound(_0x411cbb,null))[_0x8397('0x13')](function(_0x569418){if(_0x569418['service']==='MicrosoftAzure'&&_0x88ea75['body'][_0x8397('0x36')]){_0x88ea75[_0x8397('0x3a')][_0x8397('0x36')]=encryptor[_0x8397('0x3f')](_0x88ea75[_0x8397('0x3a')]['data3']);}return _0x569418;})[_0x8397('0x13')](saveUpdates(_0x88ea75[_0x8397('0x3a')],null))['then'](respondWithResult(_0x411cbb,null))[_0x8397('0x39')](handleError(_0x411cbb,null));};exports[_0x8397('0x14')]=function(_0x163338,_0xef32a){return db[_0x8397('0x18')][_0x8397('0x38')]({'where':{'id':_0x163338['params']['id']}})[_0x8397('0x13')](handleEntityNotFound(_0xef32a,null))[_0x8397('0x13')](removeEntity(_0xef32a,null))[_0x8397('0x39')](handleError(_0xef32a,null));};exports[_0x8397('0x41')]=function(_0x39437b,_0x4a9b0d){return db['CloudProvider'][_0x8397('0x42')]({'where':{'id':_0x39437b[_0x8397('0x37')]['id']},'raw':!![]})[_0x8397('0x13')](function(_0x50c486){if(!_0x50c486)return _0x4a9b0d[_0x8397('0xa')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x50c486,_0x39437b[_0x8397('0x43')]['id'])};})['then'](respondWithResult(_0x4a9b0d,null))[_0x8397('0x39')](handleError(_0x4a9b0d,null));};exports[_0x8397('0x44')]=function(_0x21c0d3,_0x3ec255){var _0x219246=_0x21c0d3[_0x8397('0x3a')];var _0x35e66d;var _0x5c591a;if(_0x219246[_0x8397('0x15')])throw _0x219246;redis[_0x8397('0x45')](_0x219246['state'])[_0x8397('0x13')](function(_0x48467e){if(!_0x48467e)throw new Error(_0x8397('0x46'));_0x35e66d=JSON[_0x8397('0x47')](_0x48467e);var _0x12820a=Buffer[_0x8397('0x48')](_0x219246[_0x8397('0x49')],_0x8397('0x4a'))['toString']('ascii');_0x5c591a=JSON['parse'](_0x12820a);if(!oauth['isValidIdToken'](_0x219246[_0x8397('0x4b')],_0x35e66d[_0x8397('0x4c')]))throw new Error(_0x8397('0x4d'));redis[_0x8397('0x4e')](_0x219246[_0x8397('0x49')]);return oauth['getOauth2MicrosoftAccessToken'](_0x219246['code'],_0x35e66d);})[_0x8397('0x13')](function(_0x3cbf7f){_0x35e66d[_0x8397('0x4f')]=_0x3cbf7f[_0x8397('0x50')];_0x35e66d[_0x8397('0x51')]=_0x3cbf7f[_0x8397('0x52')];return db['CloudProvider']['update']({'data5':_0x35e66d['data5'],'data6':_0x35e66d[_0x8397('0x51')]},{'where':{'id':_0x35e66d['id']}});})['then'](function(){oauth['startRefreshInterval'](_0x35e66d);socket[_0x8397('0x53')](_0x8397('0x54'),{'id':_0x5c591a['id']});return;})[_0x8397('0x13')](respondWithStatusCode(_0x3ec255,null))[_0x8397('0x39')](function(_0x55b474){if(_0x5c591a){socket[_0x8397('0x53')](_0x8397('0x55'),{'id':_0x5c591a['id']});}if(!_0x35e66d){logger['error']('Invalid\x20authentication\x20state\x20parameter',_0x55b474);return _0x3ec255[_0x8397('0xc')](0x1f4)['send'](_0x55b474[_0x8397('0x56')]);}logger[_0x8397('0x15')](_0x8397('0x57'),_0x35e66d['id'],_0x55b474);});}; \ No newline at end of file +var _0x0bbf=['stack','send','padEnd','slice','map','rawAttributes','key','model','name','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','type','VIRTUAL','options','CloudProvider','includeAll','include','findAll','rows','service','decryptString','data3','catch','show','params','merge','find','MicrosoftAzure','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','update','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','from','toString','ascii','oauth2Claims','Unable\x20to\x20validate\x20id_token','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s','lodash','../../components/encryptor','../../config/environment','api','./cloudProvider.oauth','redis','localhost','socket.io-emitter','sendStatus','end','json','undefined','limit','offset','count','status','Content-Range','then','destroy','error'];(function(_0x4c8f42,_0x3ad051){var _0x138dc3=function(_0x348e07){while(--_0x348e07){_0x4c8f42['push'](_0x4c8f42['shift']());}};_0x138dc3(++_0x3ad051);}(_0x0bbf,0x15c));var _0xf0bb=function(_0xda3db0,_0x50779b){_0xda3db0=_0xda3db0-0x0;var _0x170e71=_0x0bbf[_0xda3db0];return _0x170e71;};'use strict';var _=require(_0xf0bb('0x0'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var encryptor=require(_0xf0bb('0x1'));var config=require(_0xf0bb('0x2'));var logger=require('../../config/logger')(_0xf0bb('0x3'));var db=require('../../mysqldb')['db'];var oauth=require(_0xf0bb('0x4'));config['redis']=_['defaults'](config[_0xf0bb('0x5')],{'host':_0xf0bb('0x6'),'port':0x18eb});var socket=require(_0xf0bb('0x7'))(new Redis(config['redis']));var redis=new Redis(config[_0xf0bb('0x5')]);function respondWithStatusCode(_0x423658,_0x5a60fc){_0x5a60fc=_0x5a60fc||0xcc;return function(_0x377c34){if(_0x377c34){return _0x423658[_0xf0bb('0x8')](_0x5a60fc);}return _0x423658['status'](_0x5a60fc)[_0xf0bb('0x9')]();};}function respondWithResult(_0x288d4b,_0x44ff8a){_0x44ff8a=_0x44ff8a||0xc8;return function(_0x4994bb){if(_0x4994bb){return _0x288d4b['status'](_0x44ff8a)[_0xf0bb('0xa')](_0x4994bb);}};}function respondWithFilteredResult(_0xf4c8cb,_0x3ce625){return function(_0x16bfde){if(_0x16bfde){var _0x19d16c=typeof _0x3ce625['offset']===_0xf0bb('0xb')&&typeof _0x3ce625[_0xf0bb('0xc')]===_0xf0bb('0xb');var _0x30fa09=_0x16bfde['count'];var _0xbdc440=_0x19d16c?0x0:_0x3ce625[_0xf0bb('0xd')];var _0x4283e5=_0x19d16c?_0x16bfde[_0xf0bb('0xe')]:_0x3ce625[_0xf0bb('0xd')]+_0x3ce625[_0xf0bb('0xc')];var _0x5e295e;if(_0x4283e5>=_0x30fa09){_0x4283e5=_0x30fa09;_0x5e295e=0xc8;}else{_0x5e295e=0xce;}_0xf4c8cb[_0xf0bb('0xf')](_0x5e295e);return _0xf4c8cb['set'](_0xf0bb('0x10'),_0xbdc440+'-'+_0x4283e5+'/'+_0x30fa09)[_0xf0bb('0xa')](_0x16bfde);}return null;};}function saveUpdates(_0x967be3){return function(_0x3e7878){if(_0x3e7878){return _0x3e7878['update'](_0x967be3)[_0xf0bb('0x11')](function(_0x4ce0d7){return _0x4ce0d7;});}return null;};}function removeEntity(_0x433d8a){return function(_0x4362d){if(_0x4362d){return _0x4362d[_0xf0bb('0x12')]()[_0xf0bb('0x11')](function(){_0x433d8a[_0xf0bb('0xf')](0xcc)[_0xf0bb('0x9')]();});}};}function handleEntityNotFound(_0x134c71){return function(_0x131a63){if(!_0x131a63){_0x134c71[_0xf0bb('0x8')](0x194);}return _0x131a63;};}function handleError(_0x171506,_0x5e51c2){_0x5e51c2=_0x5e51c2||0x1f4;return function(_0x20ac0f){logger[_0xf0bb('0x13')](_0x20ac0f[_0xf0bb('0x14')]);if(_0x20ac0f['name']){delete _0x20ac0f['name'];}_0x171506[_0xf0bb('0xf')](_0x5e51c2)[_0xf0bb('0x15')](_0x20ac0f);};}function maskClientSecret(_0x2c436c){return _[_0xf0bb('0x16')](_0x2c436c[_0xf0bb('0x17')](0x0,0x3),0x14,'*');}exports['index']=function(_0x2436c1,_0x3c0365){var _0x574373={},_0x58a58b={},_0x4fe17b={'count':0x0,'rows':[]};var _0x97df3e=_[_0xf0bb('0x18')](db['CloudProvider'][_0xf0bb('0x19')],function(_0x4b0935){return{'name':_0x4b0935['fieldName'],'type':_0x4b0935['type'][_0xf0bb('0x1a')]};});_0x58a58b[_0xf0bb('0x1b')]=_[_0xf0bb('0x18')](_0x97df3e,_0xf0bb('0x1c'));_0x58a58b['query']=_[_0xf0bb('0x1d')](_0x2436c1[_0xf0bb('0x1e')]);_0x58a58b[_0xf0bb('0x1f')]=_[_0xf0bb('0x20')](_0x58a58b[_0xf0bb('0x1b')],_0x58a58b[_0xf0bb('0x1e')]);_0x574373[_0xf0bb('0x21')]=_[_0xf0bb('0x20')](_0x58a58b[_0xf0bb('0x1b')],qs['fields'](_0x2436c1[_0xf0bb('0x1e')][_0xf0bb('0x22')]));_0x574373[_0xf0bb('0x21')]=_0x574373[_0xf0bb('0x21')][_0xf0bb('0x23')]?_0x574373['attributes']:_0x58a58b['model'];if(!_0x2436c1['query'][_0xf0bb('0x24')](_0xf0bb('0x25'))){_0x574373[_0xf0bb('0xc')]=qs[_0xf0bb('0xc')](_0x2436c1['query']['limit']);_0x574373['offset']=qs[_0xf0bb('0xd')](_0x2436c1['query'][_0xf0bb('0xd')]);}_0x574373[_0xf0bb('0x26')]=qs['sort'](_0x2436c1[_0xf0bb('0x1e')]['sort']);_0x574373[_0xf0bb('0x27')]=qs[_0xf0bb('0x1f')](_['pick'](_0x2436c1[_0xf0bb('0x1e')],_0x58a58b['filters']),_0x97df3e);if(_0x2436c1[_0xf0bb('0x1e')][_0xf0bb('0x28')]){_0x574373[_0xf0bb('0x27')]=_['merge'](_0x574373['where'],{'$or':_[_0xf0bb('0x18')](_0x97df3e,function(_0x5d2c71){if(_0x5d2c71[_0xf0bb('0x29')]!==_0xf0bb('0x2a')){var _0x2d36ad={};_0x2d36ad[_0x5d2c71['name']]={'$like':'%'+_0x2436c1[_0xf0bb('0x1e')][_0xf0bb('0x28')]+'%'};return _0x2d36ad;}})});}_0x574373=_['merge']({},_0x574373,_0x2436c1[_0xf0bb('0x2b')]);var _0x360d94={'where':_0x574373[_0xf0bb('0x27')]};return db[_0xf0bb('0x2c')][_0xf0bb('0xe')](_0x360d94)[_0xf0bb('0x11')](function(_0x1d24d6){_0x4fe17b[_0xf0bb('0xe')]=_0x1d24d6;if(_0x2436c1[_0xf0bb('0x1e')][_0xf0bb('0x2d')]){_0x574373[_0xf0bb('0x2e')]=[{'all':!![]}];}return db['CloudProvider'][_0xf0bb('0x2f')](_0x574373);})['then'](function(_0x41f7f9){_0x4fe17b[_0xf0bb('0x30')]=_[_0xf0bb('0x18')](_0x41f7f9,function(_0x286220){if(_0x286220[_0xf0bb('0x31')]==='MicrosoftAzure'){var _0xf14ebd=encryptor[_0xf0bb('0x32')](_0x286220[_0xf0bb('0x33')]);_0x286220[_0xf0bb('0x33')]=maskClientSecret(_0xf14ebd);}return _0x286220;});return _0x4fe17b;})[_0xf0bb('0x11')](respondWithFilteredResult(_0x3c0365,_0x574373))[_0xf0bb('0x34')](handleError(_0x3c0365,null));};exports[_0xf0bb('0x35')]=function(_0x340577,_0x256aaf){var _0x109b00={'raw':!![],'where':{'id':_0x340577[_0xf0bb('0x36')]['id']}},_0x828e6b={};_0x828e6b[_0xf0bb('0x1b')]=_[_0xf0bb('0x1d')](db[_0xf0bb('0x2c')][_0xf0bb('0x19')]);_0x828e6b[_0xf0bb('0x1e')]=_[_0xf0bb('0x1d')](_0x340577[_0xf0bb('0x1e')]);_0x828e6b[_0xf0bb('0x1f')]=_['intersection'](_0x828e6b[_0xf0bb('0x1b')],_0x828e6b[_0xf0bb('0x1e')]);_0x109b00[_0xf0bb('0x21')]=_[_0xf0bb('0x20')](_0x828e6b['model'],qs[_0xf0bb('0x22')](_0x340577[_0xf0bb('0x1e')]['fields']));_0x109b00[_0xf0bb('0x21')]=_0x109b00[_0xf0bb('0x21')][_0xf0bb('0x23')]?_0x109b00['attributes']:_0x828e6b[_0xf0bb('0x1b')];if(_0x340577['query'][_0xf0bb('0x2d')]){_0x109b00['include']=[{'all':!![]}];}_0x109b00=_[_0xf0bb('0x37')]({},_0x109b00,_0x340577['options']);return db[_0xf0bb('0x2c')][_0xf0bb('0x38')](_0x109b00)[_0xf0bb('0x11')](handleEntityNotFound(_0x256aaf,null))[_0xf0bb('0x11')](function(_0x45fa93){if(_0x45fa93['service']===_0xf0bb('0x39')){var _0x3eecea=encryptor[_0xf0bb('0x32')](_0x45fa93[_0xf0bb('0x33')]);_0x45fa93[_0xf0bb('0x33')]=maskClientSecret(_0x3eecea);}return _0x45fa93;})[_0xf0bb('0x11')](respondWithResult(_0x256aaf,null))[_0xf0bb('0x34')](handleError(_0x256aaf,null));};exports[_0xf0bb('0x3a')]=function(_0x836058,_0x44a475){if(!_0x836058[_0xf0bb('0x3b')][_0xf0bb('0x1c')])throw new Error(_0xf0bb('0x3c'));if(!_0x836058[_0xf0bb('0x3b')][_0xf0bb('0x31')])throw new Error(_0xf0bb('0x3d'));var _0x2559ed=db['CloudProvider'][_0xf0bb('0x19')][_0xf0bb('0x31')]['values'];if(!_0x2559ed['includes'](_0x836058[_0xf0bb('0x3b')][_0xf0bb('0x31')]))throw new Error(_0xf0bb('0x3e')+_0x2559ed[_0xf0bb('0x3f')](',\x20'));if(_0x836058[_0xf0bb('0x3b')][_0xf0bb('0x31')]===_0xf0bb('0x39')&&_0x836058[_0xf0bb('0x3b')][_0xf0bb('0x33')]){_0x836058[_0xf0bb('0x3b')][_0xf0bb('0x33')]=encryptor[_0xf0bb('0x40')](_0x836058[_0xf0bb('0x3b')]['data3']);}return db['CloudProvider']['create'](_0x836058[_0xf0bb('0x3b')],{})['then'](respondWithResult(_0x44a475,0xc9))[_0xf0bb('0x34')](handleError(_0x44a475,null));};exports[_0xf0bb('0x41')]=function(_0x3378a9,_0x1a17d4){if(_0x3378a9[_0xf0bb('0x3b')]['id']){delete _0x3378a9[_0xf0bb('0x3b')]['id'];}return db[_0xf0bb('0x2c')][_0xf0bb('0x38')]({'where':{'id':_0x3378a9[_0xf0bb('0x36')]['id']}})['then'](handleEntityNotFound(_0x1a17d4,null))[_0xf0bb('0x11')](function(_0x56db69){if(_0x56db69['service']===_0xf0bb('0x39')&&_0x3378a9[_0xf0bb('0x3b')][_0xf0bb('0x33')]){_0x3378a9[_0xf0bb('0x3b')][_0xf0bb('0x33')]=encryptor[_0xf0bb('0x40')](_0x3378a9[_0xf0bb('0x3b')][_0xf0bb('0x33')]);}return _0x56db69;})['then'](saveUpdates(_0x3378a9['body'],null))[_0xf0bb('0x11')](respondWithResult(_0x1a17d4,null))[_0xf0bb('0x34')](handleError(_0x1a17d4,null));};exports[_0xf0bb('0x12')]=function(_0xecb927,_0x37c869){return db[_0xf0bb('0x2c')][_0xf0bb('0x38')]({'where':{'id':_0xecb927[_0xf0bb('0x36')]['id']}})['then'](handleEntityNotFound(_0x37c869,null))['then'](removeEntity(_0x37c869,null))['catch'](handleError(_0x37c869,null));};exports[_0xf0bb('0x42')]=function(_0xea6269,_0x3a7e7c){return db[_0xf0bb('0x2c')][_0xf0bb('0x43')]({'where':{'id':_0xea6269[_0xf0bb('0x36')]['id']},'raw':!![]})['then'](function(_0x390b28){if(!_0x390b28)return _0x3a7e7c[_0xf0bb('0x8')](0x194);return{'url':oauth[_0xf0bb('0x44')](_0x390b28,_0xea6269[_0xf0bb('0x45')]['id'])};})['then'](respondWithResult(_0x3a7e7c,null))[_0xf0bb('0x34')](handleError(_0x3a7e7c,null));};exports[_0xf0bb('0x46')]=function(_0x2f2957,_0x460d9e){var _0x453617=_0x2f2957[_0xf0bb('0x3b')];var _0x481c1c;var _0x2044b1;if(_0x453617[_0xf0bb('0x13')])throw _0x453617;redis[_0xf0bb('0x47')](_0x453617[_0xf0bb('0x48')])[_0xf0bb('0x11')](function(_0x2fe01e){if(!_0x2fe01e)throw new Error(_0xf0bb('0x49'));_0x481c1c=JSON[_0xf0bb('0x4a')](_0x2fe01e);var _0x547838=Buffer[_0xf0bb('0x4b')](_0x453617['state'],'base64')[_0xf0bb('0x4c')](_0xf0bb('0x4d'));_0x2044b1=JSON[_0xf0bb('0x4a')](_0x547838);if(!oauth['isValidIdToken'](_0x453617['id_token'],_0x481c1c[_0xf0bb('0x4e')]))throw new Error(_0xf0bb('0x4f'));redis['del'](_0x453617[_0xf0bb('0x48')]);return oauth['getOauth2MicrosoftAccessToken'](_0x453617[_0xf0bb('0x50')],_0x481c1c);})[_0xf0bb('0x11')](function(_0x4bb411){_0x481c1c[_0xf0bb('0x51')]=_0x4bb411[_0xf0bb('0x52')];_0x481c1c[_0xf0bb('0x53')]=_0x4bb411[_0xf0bb('0x54')];return db[_0xf0bb('0x2c')]['update']({'data5':_0x481c1c[_0xf0bb('0x51')],'data6':_0x481c1c[_0xf0bb('0x53')]},{'where':{'id':_0x481c1c['id']}});})[_0xf0bb('0x11')](function(){oauth[_0xf0bb('0x55')](_0x481c1c);socket[_0xf0bb('0x56')](_0xf0bb('0x57'),{'id':_0x2044b1['id']});return;})['then'](respondWithStatusCode(_0x460d9e,null))['catch'](function(_0x4e5a2a){if(_0x2044b1){socket[_0xf0bb('0x56')](_0xf0bb('0x58'),{'id':_0x2044b1['id']});}if(!_0x481c1c){logger[_0xf0bb('0x13')](_0xf0bb('0x59'),_0x4e5a2a);return _0x460d9e[_0xf0bb('0xf')](0x1f4)[_0xf0bb('0x15')](_0x4e5a2a[_0xf0bb('0x5a')]);}logger[_0xf0bb('0x13')](_0xf0bb('0x5b'),_0x481c1c['id'],_0x4e5a2a);});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index f25f580..7b5e21f 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 _0x7314=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','CloudProvider','lodash','util'];(function(_0x8da7e1,_0x57cd87){var _0x5b670c=function(_0x5cbe9e){while(--_0x5cbe9e){_0x8da7e1['push'](_0x8da7e1['shift']());}};_0x5b670c(++_0x57cd87);}(_0x7314,0x1b6));var _0x4731=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7314[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x4731('0x0'));var util=require(_0x4731('0x1'));var logger=require(_0x4731('0x2'))(_0x4731('0x3'));var moment=require('moment');var BPromise=require(_0x4731('0x4'));var rp=require(_0x4731('0x5'));var fs=require('fs');var path=require(_0x4731('0x6'));var rimraf=require(_0x4731('0x7'));var config=require(_0x4731('0x8'));var attributes=require(_0x4731('0x9'));module['exports']=function(_0x5aa514,_0x114c3a){return _0x5aa514['define'](_0x4731('0xa'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeff5=['path','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','api','moment'];(function(_0x32529e,_0x3bc08b){var _0x2d2d8c=function(_0x3c5eef){while(--_0x3c5eef){_0x32529e['push'](_0x32529e['shift']());}};_0x2d2d8c(++_0x3bc08b);}(_0xeff5,0xa2));var _0x5eff=function(_0x1be11b,_0x236e70){_0x1be11b=_0x1be11b-0x0;var _0x224847=_0xeff5[_0x1be11b];return _0x224847;};'use strict';var _=require(_0x5eff('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5eff('0x1'));var moment=require(_0x5eff('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5eff('0x3'));var rimraf=require(_0x5eff('0x4'));var config=require(_0x5eff('0x5'));var attributes=require(_0x5eff('0x6'));module[_0x5eff('0x7')]=function(_0x2a5187,_0x463c49){return _0x2a5187[_0x5eff('0x8')](_0x5eff('0x9'),attributes,{'tableName':_0x5eff('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js index 345f06e..dae7818 100644 --- a/server/api/cloudProvider/cloudProvider.oauth.js +++ b/server/api/cloudProvider/cloudProvider.oauth.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['stringify','toString','randomBytes','data1','response_type','redirect_uri','data4','form_post','scope','state','nonce','prompt','key','value','oauth2Claims','oauth2/','decode','issuer','aud','audience','isAfter','unix','exp','data3','findOne','refresh_token','data6','decryptString','POST','then','data5','update','catch','intervals','CloudProvider','findAll','inspect','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart','exports','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','Dynamics365','push','/.default','join','Outlook365','data7','replace','{TENANT_ID}','data2','code','id_token','from'];(function(_0x386c3e,_0x44a375){var _0x4b8e13=function(_0x583c8f){while(--_0x583c8f){_0x386c3e['push'](_0x386c3e['shift']());}};_0x4b8e13(++_0x44a375);}(_0x5f2f,0x73));var _0xf5f2=function(_0x383f7f,_0x11b7c2){_0x383f7f=_0x383f7f-0x0;var _0x4e2f71=_0x5f2f[_0x383f7f];return _0x4e2f71;};'use strict';var _=require(_0xf5f2('0x0'));var crypto=require(_0xf5f2('0x1'));var jwt=require(_0xf5f2('0x2'));var moment=require(_0xf5f2('0x3'));var Redis=require(_0xf5f2('0x4'));var rp=require(_0xf5f2('0x5'));var util=require(_0xf5f2('0x6'));var encryptor=require(_0xf5f2('0x7'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0xf5f2('0x8'));var schedule=require(_0xf5f2('0x9'));var db=require(_0xf5f2('0xa'))['db'];config[_0xf5f2('0xb')]=_[_0xf5f2('0xc')](config[_0xf5f2('0xb')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0xf5f2('0xb')]);var MICROSOFT_AUTH_URL=_0xf5f2('0xd');var AZURE_AUTH_SCOPES={'Outlook365':[_0xf5f2('0xe'),'profile',_0xf5f2('0xf'),_0xf5f2('0x10'),_0xf5f2('0x11'),'https://outlook.office.com/POP.AccessAsUser.All',_0xf5f2('0x12')],'Dynamics365':['openid','offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0xf5f2('0x13');var MICROSOFT_TOKEN_ENDPOINT=_0xf5f2('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x4b78cd){var _0x336f6b=_[_0xf5f2('0x15')](AZURE_AUTH_SCOPES[_0x4b78cd[_0xf5f2('0x16')]]);if(_0x4b78cd[_0xf5f2('0x16')]===_0xf5f2('0x17'))_0x336f6b[_0xf5f2('0x18')](_0x4b78cd['data7']+_0xf5f2('0x19'));return _0x336f6b[_0xf5f2('0x1a')]('\x20');}function getAccessTokenScope(_0x269909){if(_0x269909[_0xf5f2('0x16')]===_0xf5f2('0x1b'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x269909[_0xf5f2('0x16')]===_0xf5f2('0x17'))return _0x269909[_0xf5f2('0x1c')]+_0xf5f2('0x19');}function generateMicrosoftAuthorizationUrl(_0x23e23a,_0x3a9dbb){var _0xdb61b3=MICROSOFT_AUTH_URL[_0xf5f2('0x1d')](_0xf5f2('0x1e'),_0x23e23a[_0xf5f2('0x1f')]);var _0x20fccd=[_0xf5f2('0x20'),_0xf5f2('0x21')];var _0x3ee69=Buffer[_0xf5f2('0x22')](JSON[_0xf5f2('0x23')]({'id':_0x3a9dbb}))[_0xf5f2('0x24')]('base64');var _0x34706d=crypto[_0xf5f2('0x25')](0x10)['toString']('hex');var _0x2d2805=getAuthorizationScopes(_0x23e23a);var _0x388e6c=[{'key':'client_id','value':_0x23e23a[_0xf5f2('0x26')]},{'key':_0xf5f2('0x27'),'value':encodeURIComponent(_0x20fccd[_0xf5f2('0x1a')]('\x20'))},{'key':_0xf5f2('0x28'),'value':_0x23e23a[_0xf5f2('0x29')]},{'key':'response_mode','value':_0xf5f2('0x2a')},{'key':_0xf5f2('0x2b'),'value':encodeURIComponent(_0x2d2805)},{'key':_0xf5f2('0x2c'),'value':_0x3ee69},{'key':_0xf5f2('0x2d'),'value':_0x34706d},{'key':_0xf5f2('0x2e'),'value':'login'}];var _0x529f07=_0xdb61b3+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xf5f2('0x15')](_0x388e6c,function(_0x3f79d5){return _0x3f79d5[_0xf5f2('0x2f')]+'='+_0x3f79d5[_0xf5f2('0x30')];})[_0xf5f2('0x1a')]('&');_0x23e23a[_0xf5f2('0x31')]={'issuer':_0xdb61b3[_0xf5f2('0x1d')](_0xf5f2('0x32'),''),'audience':_0x23e23a[_0xf5f2('0x26')],'state':_0x3ee69,'nonce':_0x34706d};redis['set'](_0x3ee69,JSON[_0xf5f2('0x23')](_0x23e23a));return _0x529f07;}function isValidIdToken(_0x102449,_0x375ca8){try{var _0x31bfcb=jwt[_0xf5f2('0x33')](_0x102449,{'complete':!![]});var _0x477604=_0x31bfcb['payload'];if(_0x477604['iss']!==_0x375ca8[_0xf5f2('0x34')])return![];if(_0x477604[_0xf5f2('0x35')]!==_0x375ca8[_0xf5f2('0x36')])return![];if(_0x477604['nonce']!==_0x375ca8['nonce'])return![];if(moment()[_0xf5f2('0x37')](moment[_0xf5f2('0x38')](_0x477604[_0xf5f2('0x39')])))return![];return!![];}catch(_0x153924){throw _0x153924;}}function refreshOauth2MicrosoftAccessToken(_0x1b381e){return Promise['resolve']()['then'](function(){if(_0x1b381e[_0xf5f2('0x3a')])return _0x1b381e;return db['CloudProvider'][_0xf5f2('0x3b')]({'where':{'id':_0x1b381e['id']},'raw':!![]});})['then'](function(_0x45b643){var _0x31087c={'grant_type':_0xf5f2('0x3c'),'refresh_token':_0x45b643[_0xf5f2('0x3d')],'scope':getAccessTokenScope(_0x45b643),'redirect_uri':_0x45b643[_0xf5f2('0x29')],'client_id':_0x45b643[_0xf5f2('0x26')],'client_secret':encryptor[_0xf5f2('0x3e')](_0x45b643[_0xf5f2('0x3a')])};var _0x5ca917={'method':_0xf5f2('0x3f'),'uri':MICROSOFT_AUTH_URL[_0xf5f2('0x1d')](_0xf5f2('0x1e'),_0x45b643[_0xf5f2('0x1f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x31087c,'json':!![]};return rp(_0x5ca917);})[_0xf5f2('0x40')](function(_0x27c0e7){_0x1b381e[_0xf5f2('0x41')]=_0x27c0e7['access_token'];_0x1b381e[_0xf5f2('0x3d')]=_0x27c0e7[_0xf5f2('0x3c')];return db['CloudProvider'][_0xf5f2('0x42')]({'data5':_0x1b381e['data5'],'data6':_0x1b381e[_0xf5f2('0x3d')]},{'where':{'id':_0x1b381e['id']}});})[_0xf5f2('0x40')](function(){return _0x1b381e;})[_0xf5f2('0x43')](function(_0x2e3cca){logger['error']('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s',_0x1b381e['id'],_0x2e3cca);});}function getOauth2MicrosoftAccessToken(_0x41088b,_0x46ad4a){var _0x20eb74={'grant_type':'authorization_code','code':_0x41088b,'scope':getAccessTokenScope(_0x46ad4a),'redirect_uri':_0x46ad4a[_0xf5f2('0x29')],'client_id':_0x46ad4a['data1'],'client_secret':encryptor[_0xf5f2('0x3e')](_0x46ad4a['data3'])};var _0x46f464={'method':_0xf5f2('0x3f'),'uri':MICROSOFT_AUTH_URL['replace'](_0xf5f2('0x1e'),_0x46ad4a[_0xf5f2('0x1f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x20eb74,'json':!![]};return rp(_0x46f464);}function startRefreshInterval(_0x5a4441){var _0x35f738=schedule['intervals'];if(_0x35f738[_0x5a4441['id']])clearInterval(_0x35f738[_0x5a4441['id']]);_0x35f738[_0x5a4441['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x5a4441['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xf5f2('0x44')]=_0x35f738;}function startAllRefreshIntervals(){return db[_0xf5f2('0x45')][_0xf5f2('0x46')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xf5f2('0x40')](function(_0x2c7f65){var _0xe62b57=_0x2c7f65[_0xf5f2('0x15')](function(_0x4c0ac7){return refreshOauth2MicrosoftAccessToken(_0x4c0ac7)[_0xf5f2('0x40')](function(_0x3b4ea6){startRefreshInterval(_0x3b4ea6);});});return Promise['all'](_0xe62b57);})[_0xf5f2('0x43')](function(_0x3f3895){var _0x71b0e7=_0x3f3895?util[_0xf5f2('0x47')](_0x3f3895,{'showHidden':![],'depth':null}):'';logger[_0xf5f2('0x48')](_0xf5f2('0x49'),_0x71b0e7);});}module[_0xf5f2('0x4a')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0x1261=['toString','randomBytes','data1','response_type','redirect_uri','response_mode','form_post','state','key','value','oauth2Claims','replace','set','stringify','decode','payload','iss','aud','nonce','isAfter','exp','then','data3','CloudProvider','refresh_token','data6','data4','POST','data5','access_token','update','error','decryptString','intervals','bind','findAll','all','catch','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart','exports','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','/token','map','type','Dynamics365','push','data7','/.default','join','Outlook365','{TENANT_ID}','data2','id_token'];(function(_0x431bd2,_0x1cdba3){var _0x3c4804=function(_0x5a80ef){while(--_0x5a80ef){_0x431bd2['push'](_0x431bd2['shift']());}};_0x3c4804(++_0x1cdba3);}(_0x1261,0x144));var _0x1126=function(_0x5eaa8a,_0x396d27){_0x5eaa8a=_0x5eaa8a-0x0;var _0x558bc8=_0x1261[_0x5eaa8a];return _0x558bc8;};'use strict';var _=require('lodash');var crypto=require(_0x1126('0x0'));var jwt=require(_0x1126('0x1'));var moment=require(_0x1126('0x2'));var Redis=require(_0x1126('0x3'));var rp=require(_0x1126('0x4'));var util=require(_0x1126('0x5'));var encryptor=require(_0x1126('0x6'));var config=require(_0x1126('0x7'));var logger=require(_0x1126('0x8'))(_0x1126('0x9'));var schedule=require('../../config/schedule/cloud-provider');var db=require('../../mysqldb')['db'];config[_0x1126('0xa')]=_[_0x1126('0xb')](config['redis'],{'host':_0x1126('0xc'),'port':0x18eb});var redis=new Redis(config[_0x1126('0xa')]);var MICROSOFT_AUTH_URL=_0x1126('0xd');var AZURE_AUTH_SCOPES={'Outlook365':[_0x1126('0xe'),_0x1126('0xf'),'email',_0x1126('0x10'),_0x1126('0x11'),_0x1126('0x12'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0x1126('0xe'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0x1126('0x13');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x561b93){var _0x15e89b=_[_0x1126('0x14')](AZURE_AUTH_SCOPES[_0x561b93[_0x1126('0x15')]]);if(_0x561b93[_0x1126('0x15')]===_0x1126('0x16'))_0x15e89b[_0x1126('0x17')](_0x561b93[_0x1126('0x18')]+_0x1126('0x19'));return _0x15e89b[_0x1126('0x1a')]('\x20');}function getAccessTokenScope(_0x53a8f0){if(_0x53a8f0['type']===_0x1126('0x1b'))return _0x1126('0x11');if(_0x53a8f0[_0x1126('0x15')]==='Dynamics365')return _0x53a8f0[_0x1126('0x18')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x35fe9f,_0x42f379){var _0x257b5f=MICROSOFT_AUTH_URL['replace'](_0x1126('0x1c'),_0x35fe9f[_0x1126('0x1d')]);var _0x4a7b49=['code',_0x1126('0x1e')];var _0x2b2487=Buffer['from'](JSON['stringify']({'id':_0x42f379}))[_0x1126('0x1f')]('base64');var _0x22ed37=crypto[_0x1126('0x20')](0x10)[_0x1126('0x1f')]('hex');var _0x2a08ba=getAuthorizationScopes(_0x35fe9f);var _0x49d209=[{'key':'client_id','value':_0x35fe9f[_0x1126('0x21')]},{'key':_0x1126('0x22'),'value':encodeURIComponent(_0x4a7b49[_0x1126('0x1a')]('\x20'))},{'key':_0x1126('0x23'),'value':_0x35fe9f['data4']},{'key':_0x1126('0x24'),'value':_0x1126('0x25')},{'key':'scope','value':encodeURIComponent(_0x2a08ba)},{'key':_0x1126('0x26'),'value':_0x2b2487},{'key':'nonce','value':_0x22ed37},{'key':'prompt','value':'login'}];var _0x2199d9=_0x257b5f+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x1126('0x14')](_0x49d209,function(_0x329914){return _0x329914[_0x1126('0x27')]+'='+_0x329914[_0x1126('0x28')];})[_0x1126('0x1a')]('&');_0x35fe9f[_0x1126('0x29')]={'issuer':_0x257b5f[_0x1126('0x2a')]('oauth2/',''),'audience':_0x35fe9f[_0x1126('0x21')],'state':_0x2b2487,'nonce':_0x22ed37};redis[_0x1126('0x2b')](_0x2b2487,JSON[_0x1126('0x2c')](_0x35fe9f));return _0x2199d9;}function isValidIdToken(_0x5ddf63,_0x541bc9){try{var _0xeb7d89=jwt[_0x1126('0x2d')](_0x5ddf63,{'complete':!![]});var _0x55e195=_0xeb7d89[_0x1126('0x2e')];if(_0x55e195[_0x1126('0x2f')]!==_0x541bc9['issuer'])return![];if(_0x55e195[_0x1126('0x30')]!==_0x541bc9['audience'])return![];if(_0x55e195[_0x1126('0x31')]!==_0x541bc9['nonce'])return![];if(moment()[_0x1126('0x32')](moment['unix'](_0x55e195[_0x1126('0x33')])))return![];return!![];}catch(_0x5f2611){throw _0x5f2611;}}function refreshOauth2MicrosoftAccessToken(_0x5252e0){return Promise['resolve']()[_0x1126('0x34')](function(){if(_0x5252e0[_0x1126('0x35')])return _0x5252e0;return db[_0x1126('0x36')]['findOne']({'where':{'id':_0x5252e0['id']},'raw':!![]});})[_0x1126('0x34')](function(_0x226afb){var _0x56f7f8={'grant_type':_0x1126('0x37'),'refresh_token':_0x226afb[_0x1126('0x38')],'scope':getAccessTokenScope(_0x226afb),'redirect_uri':_0x226afb[_0x1126('0x39')],'client_id':_0x226afb[_0x1126('0x21')],'client_secret':encryptor['decryptString'](_0x226afb['data3'])};var _0x2a7edc={'method':_0x1126('0x3a'),'uri':MICROSOFT_AUTH_URL[_0x1126('0x2a')](_0x1126('0x1c'),_0x226afb['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x56f7f8,'json':!![]};return rp(_0x2a7edc);})[_0x1126('0x34')](function(_0x6f4312){_0x5252e0[_0x1126('0x3b')]=_0x6f4312[_0x1126('0x3c')];_0x5252e0[_0x1126('0x38')]=_0x6f4312['refresh_token'];return db[_0x1126('0x36')][_0x1126('0x3d')]({'data5':_0x5252e0[_0x1126('0x3b')],'data6':_0x5252e0[_0x1126('0x38')]},{'where':{'id':_0x5252e0['id']}});})['then'](function(){return _0x5252e0;})['catch'](function(_0x22827a){logger[_0x1126('0x3e')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s',_0x5252e0['id'],_0x22827a);});}function getOauth2MicrosoftAccessToken(_0xde37cf,_0xf3c21b){var _0x11b0f6={'grant_type':'authorization_code','code':_0xde37cf,'scope':getAccessTokenScope(_0xf3c21b),'redirect_uri':_0xf3c21b['data4'],'client_id':_0xf3c21b[_0x1126('0x21')],'client_secret':encryptor[_0x1126('0x3f')](_0xf3c21b[_0x1126('0x35')])};var _0x156554={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x1126('0x2a')]('{TENANT_ID}',_0xf3c21b[_0x1126('0x1d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x11b0f6,'json':!![]};return rp(_0x156554);}function startRefreshInterval(_0x20e43a){var _0xfa96e0=schedule[_0x1126('0x40')];if(_0xfa96e0[_0x20e43a['id']])clearInterval(_0xfa96e0[_0x20e43a['id']]);_0xfa96e0[_0x20e43a['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x1126('0x41')](this,{'id':_0x20e43a['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0xfa96e0;}function startAllRefreshIntervals(){return db[_0x1126('0x36')][_0x1126('0x42')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x1126('0x34')](function(_0x397e3b){var _0x3469a2=_0x397e3b[_0x1126('0x14')](function(_0x3052f9){return refreshOauth2MicrosoftAccessToken(_0x3052f9)['then'](function(_0x1c8d8a){startRefreshInterval(_0x1c8d8a);});});return Promise[_0x1126('0x43')](_0x3469a2);})[_0x1126('0x44')](function(_0xf3a0bd){var _0xcf0483=_0xf3a0bd?util['inspect'](_0xf3a0bd,{'showHidden':![],'depth':null}):'';logger['error'](_0x1126('0x45'),_0xcf0483);});}module[_0x1126('0x46')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index 655da12..4333791 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 _0x6edc=['code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x24348e,_0x360eb9){var _0x41a5b1=function(_0x3ee79b){while(--_0x3ee79b){_0x24348e['push'](_0x24348e['shift']());}};_0x41a5b1(++_0x360eb9);}(_0x6edc,0x138));var _0xc6ed=function(_0x2957d6,_0x363bbb){_0x2957d6=_0x2957d6-0x0;var _0x379052=_0x6edc[_0x2957d6];return _0x379052;};'use strict';var _=require(_0xc6ed('0x0'));var util=require(_0xc6ed('0x1'));var moment=require(_0xc6ed('0x2'));var BPromise=require(_0xc6ed('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc6ed('0x4'))['db'];var utils=require(_0xc6ed('0x5'));var logger=require(_0xc6ed('0x6'))(_0xc6ed('0x7'));var config=require('../../config/environment');var jayson=require(_0xc6ed('0x8'));var client=jayson[_0xc6ed('0x9')][_0xc6ed('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x548a14,_0x274b0d,_0x5a077d){return new BPromise(function(_0xd46c3f,_0x13fed0){return client[_0xc6ed('0xb')](_0x548a14,_0x5a077d)[_0xc6ed('0xc')](function(_0x496e6a){logger[_0xc6ed('0xd')](_0xc6ed('0xe'),_0x274b0d,_0xc6ed('0xf'));logger['debug']('CloudProvider,\x20%s,\x20%s,\x20%s',_0x274b0d,_0xc6ed('0xf'),JSON[_0xc6ed('0x10')](_0x496e6a));if(_0x496e6a[_0xc6ed('0x11')]){if(_0x496e6a[_0xc6ed('0x11')][_0xc6ed('0x12')]===0x1f4){logger['error'](_0xc6ed('0xe'),_0x274b0d,_0x496e6a['error'][_0xc6ed('0x13')]);return _0x13fed0(_0x496e6a['error'][_0xc6ed('0x13')]);}logger[_0xc6ed('0x11')](_0xc6ed('0xe'),_0x274b0d,_0x496e6a['error'][_0xc6ed('0x13')]);return _0xd46c3f(_0x496e6a[_0xc6ed('0x11')][_0xc6ed('0x13')]);}else{logger['info'](_0xc6ed('0xe'),_0x274b0d,'request\x20sent');_0xd46c3f(_0x496e6a[_0xc6ed('0x14')][_0xc6ed('0x13')]);}})[_0xc6ed('0x15')](function(_0x5346fe){logger[_0xc6ed('0x11')](_0xc6ed('0xe'),_0x274b0d,_0x5346fe);_0x13fed0(_0x5346fe);});});} \ No newline at end of file +var _0xb2f3=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','CloudProvider,\x20%s,\x20%s'];(function(_0x1df1bf,_0x5b3830){var _0x7100e8=function(_0x4b8156){while(--_0x4b8156){_0x1df1bf['push'](_0x1df1bf['shift']());}};_0x7100e8(++_0x5b3830);}(_0xb2f3,0xfd));var _0x3b2f=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0xb2f3[_0x49b207];return _0x2dc8fa;};'use strict';var _=require(_0x3b2f('0x0'));var util=require(_0x3b2f('0x1'));var moment=require(_0x3b2f('0x2'));var BPromise=require(_0x3b2f('0x3'));var rs=require(_0x3b2f('0x4'));var fs=require('fs');var Redis=require(_0x3b2f('0x5'));var db=require(_0x3b2f('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3b2f('0x7'))(_0x3b2f('0x8'));var config=require(_0x3b2f('0x9'));var jayson=require(_0x3b2f('0xa'));var client=jayson[_0x3b2f('0xb')][_0x3b2f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x26719d,_0x4b3632,_0x200ca4){return new BPromise(function(_0x56e425,_0x266ed2){return client[_0x3b2f('0xd')](_0x26719d,_0x200ca4)[_0x3b2f('0xe')](function(_0x25134f){logger['info']('CloudProvider,\x20%s,\x20%s',_0x4b3632,_0x3b2f('0xf'));logger[_0x3b2f('0x10')](_0x3b2f('0x11'),_0x4b3632,_0x3b2f('0xf'),JSON[_0x3b2f('0x12')](_0x25134f));if(_0x25134f[_0x3b2f('0x13')]){if(_0x25134f[_0x3b2f('0x13')][_0x3b2f('0x14')]===0x1f4){logger[_0x3b2f('0x13')](_0x3b2f('0x15'),_0x4b3632,_0x25134f[_0x3b2f('0x13')][_0x3b2f('0x16')]);return _0x266ed2(_0x25134f[_0x3b2f('0x13')][_0x3b2f('0x16')]);}logger[_0x3b2f('0x13')]('CloudProvider,\x20%s,\x20%s',_0x4b3632,_0x25134f[_0x3b2f('0x13')]['message']);return _0x56e425(_0x25134f[_0x3b2f('0x13')][_0x3b2f('0x16')]);}else{logger['info'](_0x3b2f('0x15'),_0x4b3632,'request\x20sent');_0x56e425(_0x25134f[_0x3b2f('0x17')][_0x3b2f('0x16')]);}})[_0x3b2f('0x18')](function(_0xd2b1e9){logger['error']('CloudProvider,\x20%s,\x20%s',_0x4b3632,_0xd2b1e9);_0x266ed2(_0xd2b1e9);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index befffbb..0374c8a 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 _0x1261=['/:id','show','create','put','update','delete','/:id/oauth2/microsoft/authorize/','post','exports','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index'];(function(_0x489c95,_0x53159c){var _0x10e7a7=function(_0xcb4342){while(--_0xcb4342){_0x489c95['push'](_0x489c95['shift']());}};_0x10e7a7(++_0x53159c);}(_0x1261,0x144));var _0x1126=function(_0x21eb3c,_0x7ce88b){_0x21eb3c=_0x21eb3c-0x0;var _0x4bd2aa=_0x1261[_0x21eb3c];return _0x4bd2aa;};'use strict';var express=require('express');var router=express[_0x1126('0x0')]();var auth=require(_0x1126('0x1'));var controller=require(_0x1126('0x2'));router[_0x1126('0x3')]('/',auth[_0x1126('0x4')](),controller[_0x1126('0x5')]);router[_0x1126('0x3')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller[_0x1126('0x7')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1126('0x8')]);router[_0x1126('0x9')]('/:id',auth[_0x1126('0x4')](),controller[_0x1126('0xa')]);router[_0x1126('0xb')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller['destroy']);router[_0x1126('0x3')](_0x1126('0xc'),auth[_0x1126('0x4')](),controller['oauth2MicrosoftAuthorize']);router[_0x1126('0xd')]('/oauth2/microsoft/callback',controller['oauth2MicrosoftCallback']);module[_0x1126('0xe')]=router; \ No newline at end of file +var _0xadb5=['put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','Router','./cloudProvider.controller','get','isAuthenticated','/:id','post','create'];(function(_0x202d62,_0x479658){var _0x2b5c4c=function(_0x1a9f38){while(--_0x1a9f38){_0x202d62['push'](_0x202d62['shift']());}};_0x2b5c4c(++_0x479658);}(_0xadb5,0xad));var _0x5adb=function(_0x3e4073,_0x40e40e){_0x3e4073=_0x3e4073-0x0;var _0x35bc32=_0xadb5[_0x3e4073];return _0x35bc32;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['index']);router[_0x5adb('0x2')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller['show']);router[_0x5adb('0x5')]('/',auth[_0x5adb('0x3')](),controller[_0x5adb('0x6')]);router[_0x5adb('0x7')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0x8')]);router[_0x5adb('0x9')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0xa')]);router[_0x5adb('0x2')](_0x5adb('0xb'),auth[_0x5adb('0x3')](),controller['oauth2MicrosoftAuthorize']);router['post'](_0x5adb('0xc'),controller[_0x5adb('0xd')]);module[_0x5adb('0xe')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 69744f9..4f0e359 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 _0xb33f=['exports','name','STRING','sequelize'];(function(_0x4bc0de,_0x1089b5){var _0x5db9c3=function(_0x408a55){while(--_0x408a55){_0x4bc0de['push'](_0x4bc0de['shift']());}};_0x5db9c3(++_0x1089b5);}(_0xb33f,0x1cf));var _0xfb33=function(_0x17ff2b,_0x3eb0ca){_0x17ff2b=_0x17ff2b-0x0;var _0x315754=_0xb33f[_0x17ff2b];return _0x315754;};'use strict';var Sequelize=require(_0xfb33('0x0'));module[_0xfb33('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xfb33('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0xfb33('0x3')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xfb33('0x3')]},'postalCode':{'type':Sequelize[_0xfb33('0x3')]},'city':{'type':Sequelize[_0xfb33('0x3')]},'country':{'type':Sequelize[_0xfb33('0x3')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xfb33('0x3')]},'sStreet':{'type':Sequelize[_0xfb33('0x3')]},'sPostalCode':{'type':Sequelize[_0xfb33('0x3')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0xfb33('0x3')]},'description':{'type':Sequelize[_0xfb33('0x3')]}}; \ No newline at end of file +var _0x4740=['name','sequelize','exports','STRING'];(function(_0x85ab59,_0x57a06a){var _0x30e227=function(_0x3059aa){while(--_0x3059aa){_0x85ab59['push'](_0x85ab59['shift']());}};_0x30e227(++_0x57a06a);}(_0x4740,0x1b5));var _0x0474=function(_0x3d593e,_0x492981){_0x3d593e=_0x3d593e-0x0;var _0xc519c7=_0x4740[_0x3d593e];return _0xc519c7;};'use strict';var Sequelize=require(_0x0474('0x0'));module[_0x0474('0x1')]={'name':{'type':Sequelize[_0x0474('0x2')],'unique':_0x0474('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x0474('0x2')]},'phone':{'type':Sequelize[_0x0474('0x2')]},'fax':{'type':Sequelize[_0x0474('0x2')]},'type':{'type':Sequelize[_0x0474('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x0474('0x2')]},'city':{'type':Sequelize[_0x0474('0x2')]},'country':{'type':Sequelize[_0x0474('0x2')]},'email':{'type':Sequelize[_0x0474('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x0474('0x2')]},'sStreet':{'type':Sequelize[_0x0474('0x2')]},'sPostalCode':{'type':Sequelize[_0x0474('0x2')]},'sCity':{'type':Sequelize[_0x0474('0x2')]},'sCountry':{'type':Sequelize[_0x0474('0x2')]},'description':{'type':Sequelize[_0x0474('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 8db1420..8bebb28 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 _0x93db=['name','send','CmCompany','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','map','merge','includeAll','include','findAll','rows','catch','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addContacts','omit','ids','findOne','CmContact','order','pick','getContacts','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','Companies','end','error','stack'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x93db,0xd5));var _0xb93d=function(_0x1ed15d,_0xdfa8bc){_0x1ed15d=_0x1ed15d-0x0;var _0x39d7e4=_0x93db[_0x1ed15d];return _0x39d7e4;};'use strict';var emlformat=require(_0xb93d('0x0'));var rimraf=require(_0xb93d('0x1'));var zipdir=require(_0xb93d('0x2'));var jsonpatch=require(_0xb93d('0x3'));var rp=require(_0xb93d('0x4'));var moment=require(_0xb93d('0x5'));var BPromise=require(_0xb93d('0x6'));var Mustache=require(_0xb93d('0x7'));var util=require(_0xb93d('0x8'));var path=require(_0xb93d('0x9'));var sox=require(_0xb93d('0xa'));var csv=require(_0xb93d('0xb'));var ejs=require(_0xb93d('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb93d('0xd'));var squel=require('squel');var crypto=require(_0xb93d('0xe'));var jsforce=require(_0xb93d('0xf'));var deskjs=require(_0xb93d('0x10'));var toCsv=require(_0xb93d('0xb'));var querystring=require(_0xb93d('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb93d('0x12'));var as=require(_0xb93d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb93d('0x14'))(_0xb93d('0x15'));var utils=require('../../config/utils');var config=require(_0xb93d('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xb93d('0x17'))['db'];function respondWithStatusCode(_0x449a47,_0x515daa){_0x515daa=_0x515daa||0xcc;return function(_0x3b63d8){if(_0x3b63d8){return _0x449a47[_0xb93d('0x18')](_0x515daa);}return _0x449a47[_0xb93d('0x19')](_0x515daa)['end']();};}function respondWithResult(_0x590b6a,_0x25e9c4){_0x25e9c4=_0x25e9c4||0xc8;return function(_0x5a838c){if(_0x5a838c){return _0x590b6a['status'](_0x25e9c4)['json'](_0x5a838c);}};}function respondWithFilteredResult(_0x3b053c,_0x2f27cb){return function(_0xdc6e57){if(_0xdc6e57){var _0x502d32=typeof _0x2f27cb[_0xb93d('0x1a')]===_0xb93d('0x1b')&&typeof _0x2f27cb[_0xb93d('0x1c')]===_0xb93d('0x1b');var _0x28428a=_0xdc6e57[_0xb93d('0x1d')];var _0x16c148=_0x502d32?0x0:_0x2f27cb[_0xb93d('0x1a')];var _0x431ff7=_0x502d32?_0xdc6e57['count']:_0x2f27cb[_0xb93d('0x1a')]+_0x2f27cb['limit'];var _0xcc4654;if(_0x431ff7>=_0x28428a){_0x431ff7=_0x28428a;_0xcc4654=0xc8;}else{_0xcc4654=0xce;}_0x3b053c[_0xb93d('0x19')](_0xcc4654);return _0x3b053c[_0xb93d('0x1e')](_0xb93d('0x1f'),_0x16c148+'-'+_0x431ff7+'/'+_0x28428a)['json'](_0xdc6e57);}return null;};}function patchUpdates(_0x19e309){return function(_0x7285bb){try{jsonpatch[_0xb93d('0x20')](_0x7285bb,_0x19e309,!![]);}catch(_0x1283ee){return BPromise['reject'](_0x1283ee);}return _0x7285bb[_0xb93d('0x21')]();};}function saveUpdates(_0x44b5c0,_0x34522a){return function(_0x3eaf81){if(_0x3eaf81){return _0x3eaf81[_0xb93d('0x22')](_0x44b5c0)[_0xb93d('0x23')](function(_0x4a0be1){return _0x4a0be1;});}return null;};}function removeEntity(_0x5e1199,_0x548c31){return function(_0x5dd27a){if(_0x5dd27a){return _0x5dd27a[_0xb93d('0x24')]()['then'](function(){var _0x12ec52=_0x5dd27a[_0xb93d('0x25')]({'plain':!![]});var _0x313895=_0xb93d('0x26');return db['UserProfileResource'][_0xb93d('0x24')]({'where':{'type':_0x313895,'resourceId':_0x12ec52['id']}})[_0xb93d('0x23')](function(){return _0x5dd27a;});})['then'](function(){_0x5e1199[_0xb93d('0x19')](0xcc)[_0xb93d('0x27')]();});}};}function handleEntityNotFound(_0x2304f0,_0x138e8e){return function(_0x2416ea){if(!_0x2416ea){_0x2304f0[_0xb93d('0x18')](0x194);}return _0x2416ea;};}function handleError(_0x334a4a,_0x4f178a){_0x4f178a=_0x4f178a||0x1f4;return function(_0x344081){logger[_0xb93d('0x28')](_0x344081[_0xb93d('0x29')]);if(_0x344081[_0xb93d('0x2a')]){delete _0x344081[_0xb93d('0x2a')];}_0x334a4a[_0xb93d('0x19')](_0x4f178a)[_0xb93d('0x2b')](_0x344081);};}exports['index']=function(_0x122f08,_0x55a9e3){var _0x54d456={},_0x5c5e41={},_0x4749b7={'count':0x0,'rows':[]};return db[_0xb93d('0x2c')]['describe']()[_0xb93d('0x23')](function(_0x1cf260){_0x5c5e41[_0xb93d('0x2d')]=_[_0xb93d('0x2e')](_0x1cf260);_0x5c5e41['query']=_[_0xb93d('0x2e')](_0x122f08['query']);_0x5c5e41[_0xb93d('0x2f')]=_['intersection'](_0x5c5e41[_0xb93d('0x2d')],_0x5c5e41[_0xb93d('0x30')]);_0x54d456[_0xb93d('0x31')]=_[_0xb93d('0x32')](_0x5c5e41[_0xb93d('0x2d')],qs[_0xb93d('0x33')](_0x122f08[_0xb93d('0x30')]['fields']));_0x54d456[_0xb93d('0x31')]=_0x54d456['attributes'][_0xb93d('0x34')]?_0x54d456['attributes']:_0x5c5e41[_0xb93d('0x2d')];if(!_0x122f08[_0xb93d('0x30')][_0xb93d('0x35')](_0xb93d('0x36'))){_0x54d456['limit']=qs[_0xb93d('0x1c')](_0x122f08[_0xb93d('0x30')]['limit']);_0x54d456[_0xb93d('0x1a')]=qs[_0xb93d('0x1a')](_0x122f08['query'][_0xb93d('0x1a')]);}_0x54d456['order']=qs['sort'](_0x122f08[_0xb93d('0x30')][_0xb93d('0x37')]);_0x54d456[_0xb93d('0x38')]=qs[_0xb93d('0x2f')](_['pick'](_0x122f08[_0xb93d('0x30')],_0x5c5e41[_0xb93d('0x2f')]),_0x1cf260);if(_0x122f08[_0xb93d('0x30')][_0xb93d('0x39')]){_0x54d456[_0xb93d('0x38')]=_['merge'](_0x54d456[_0xb93d('0x38')],{'$or':_[_0xb93d('0x3a')](_0x54d456['attributes'],function(_0x13f4ff){var _0x4e2819={};_0x4e2819[_0x13f4ff]={'$like':'%'+_0x122f08[_0xb93d('0x30')]['filter']+'%'};return _0x4e2819;})});}_0x54d456=_[_0xb93d('0x3b')]({},_0x54d456,_0x122f08['options']);var _0x463771={'where':_0x54d456[_0xb93d('0x38')]};return db[_0xb93d('0x2c')]['count'](_0x463771)[_0xb93d('0x23')](function(_0x1d8c31){_0x4749b7[_0xb93d('0x1d')]=_0x1d8c31;if(_0x122f08['query'][_0xb93d('0x3c')]){_0x54d456[_0xb93d('0x3d')]=[{'all':!![]}];}return db[_0xb93d('0x2c')][_0xb93d('0x3e')](_0x54d456);})[_0xb93d('0x23')](function(_0x215da1){_0x4749b7[_0xb93d('0x3f')]=_0x215da1;return _0x4749b7;})[_0xb93d('0x23')](respondWithFilteredResult(_0x55a9e3,_0x54d456))[_0xb93d('0x40')](handleError(_0x55a9e3,null));})[_0xb93d('0x40')](handleError(_0x55a9e3,null));};exports['show']=function(_0xece3c2,_0x4e4bed){var _0xdc2adc={'raw':![],'where':{'id':_0xece3c2['params']['id']}},_0x199844={};_0x199844[_0xb93d('0x2d')]=_[_0xb93d('0x2e')](db[_0xb93d('0x2c')][_0xb93d('0x41')]);_0x199844[_0xb93d('0x30')]=_[_0xb93d('0x2e')](_0xece3c2[_0xb93d('0x30')]);_0x199844['filters']=_[_0xb93d('0x32')](_0x199844[_0xb93d('0x2d')],_0x199844[_0xb93d('0x30')]);_0xdc2adc[_0xb93d('0x31')]=_[_0xb93d('0x32')](_0x199844[_0xb93d('0x2d')],qs[_0xb93d('0x33')](_0xece3c2['query'][_0xb93d('0x33')]));_0xdc2adc['attributes']=_0xdc2adc[_0xb93d('0x31')][_0xb93d('0x34')]?_0xdc2adc['attributes']:_0x199844[_0xb93d('0x2d')];if(_0xece3c2[_0xb93d('0x30')][_0xb93d('0x3c')]){_0xdc2adc['include']=[{'all':!![]}];}_0xdc2adc=_[_0xb93d('0x3b')]({},_0xdc2adc,_0xece3c2['options']);return db[_0xb93d('0x2c')][_0xb93d('0x42')](_0xdc2adc)[_0xb93d('0x23')](handleEntityNotFound(_0x4e4bed,null))[_0xb93d('0x23')](respondWithResult(_0x4e4bed,null))['catch'](handleError(_0x4e4bed,null));};exports['create']=function(_0x12dc64,_0x50165a){return db[_0xb93d('0x2c')][_0xb93d('0x43')](_0x12dc64[_0xb93d('0x44')],{})[_0xb93d('0x23')](function(_0x5b2aa1){var _0x27ab0e=_0x12dc64['user'][_0xb93d('0x25')]({'plain':!![]});if(!_0x27ab0e)throw new Error(_0xb93d('0x45'));if(_0x27ab0e['role']==='user'){var _0x4ccccd=_0x5b2aa1['get']({'plain':!![]});var _0x308082=_0xb93d('0x26');return db[_0xb93d('0x46')][_0xb93d('0x42')]({'where':{'name':_0x308082,'userProfileId':_0x27ab0e[_0xb93d('0x47')]},'raw':!![]})[_0xb93d('0x23')](function(_0x5d9a4a){if(_0x5d9a4a&&_0x5d9a4a[_0xb93d('0x48')]===0x0){return db[_0xb93d('0x49')][_0xb93d('0x43')]({'name':_0x4ccccd[_0xb93d('0x2a')],'resourceId':_0x4ccccd['id'],'type':_0x5d9a4a[_0xb93d('0x2a')],'sectionId':_0x5d9a4a['id']},{})[_0xb93d('0x23')](function(){return _0x5b2aa1;});}else{return _0x5b2aa1;}})['catch'](function(_0x533736){logger[_0xb93d('0x28')](_0xb93d('0x4a'),_0x533736);throw _0x533736;});}return _0x5b2aa1;})[_0xb93d('0x23')](respondWithResult(_0x50165a,0xc9))[_0xb93d('0x40')](handleError(_0x50165a,null));};exports[_0xb93d('0x22')]=function(_0x4211c3,_0x1fbe94){if(_0x4211c3[_0xb93d('0x44')]['id']){delete _0x4211c3[_0xb93d('0x44')]['id'];}return db['CmCompany'][_0xb93d('0x42')]({'where':{'id':_0x4211c3[_0xb93d('0x4b')]['id']}})[_0xb93d('0x23')](handleEntityNotFound(_0x1fbe94,null))[_0xb93d('0x23')](saveUpdates(_0x4211c3['body'],null))[_0xb93d('0x23')](respondWithResult(_0x1fbe94,null))[_0xb93d('0x40')](handleError(_0x1fbe94,null));};exports[_0xb93d('0x24')]=function(_0x2f9852,_0x3bfbdf){return db[_0xb93d('0x2c')]['find']({'where':{'id':_0x2f9852[_0xb93d('0x4b')]['id']}})[_0xb93d('0x23')](handleEntityNotFound(_0x3bfbdf,null))[_0xb93d('0x23')](removeEntity(_0x3bfbdf,null))[_0xb93d('0x40')](handleError(_0x3bfbdf,null));};exports[_0xb93d('0x4c')]=function(_0x383cc2,_0xab1d5c){return db['CmCompany'][_0xb93d('0x4c')]()['then'](respondWithResult(_0xab1d5c,null))['catch'](handleError(_0xab1d5c,null));};exports[_0xb93d('0x4d')]=function(_0x12004e,_0x310b85,_0x14be66){return db['CmContact']['find']({'where':{'id':_0x12004e[_0xb93d('0x4b')]['id']}})[_0xb93d('0x23')](handleEntityNotFound(_0x310b85,null))[_0xb93d('0x23')](function(_0x2d4f9b){if(_0x2d4f9b){return _0x2d4f9b[_0xb93d('0x4d')](_0x12004e['body']['ids'],_[_0xb93d('0x4e')](_0x12004e[_0xb93d('0x44')],[_0xb93d('0x4f'),'id'])||{});}})[_0xb93d('0x23')](respondWithResult(_0x310b85,null))[_0xb93d('0x40')](handleError(_0x310b85,null));};exports['getContacts']=function(_0x4cdff0,_0x127eb7,_0x5cb8d3){var _0x3a3811={};var _0x55e408={};var _0x59812a;var _0x35c7cb;return db['CmCompany'][_0xb93d('0x50')]({'where':{'id':_0x4cdff0[_0xb93d('0x4b')]['id']}})[_0xb93d('0x23')](handleEntityNotFound(_0x127eb7,null))['then'](function(_0x60a0b5){if(_0x60a0b5){_0x59812a=_0x60a0b5;_0x55e408[_0xb93d('0x2d')]=_[_0xb93d('0x2e')](db[_0xb93d('0x51')][_0xb93d('0x41')]);_0x55e408[_0xb93d('0x30')]=_[_0xb93d('0x2e')](_0x4cdff0['query']);_0x55e408[_0xb93d('0x2f')]=_[_0xb93d('0x32')](_0x55e408[_0xb93d('0x2d')],_0x55e408[_0xb93d('0x30')]);_0x3a3811['attributes']=_[_0xb93d('0x32')](_0x55e408[_0xb93d('0x2d')],qs['fields'](_0x4cdff0[_0xb93d('0x30')][_0xb93d('0x33')]));_0x3a3811['attributes']=_0x3a3811['attributes'][_0xb93d('0x34')]?_0x3a3811['attributes']:_0x55e408[_0xb93d('0x2d')];_0x3a3811[_0xb93d('0x52')]=qs[_0xb93d('0x37')](_0x4cdff0[_0xb93d('0x30')][_0xb93d('0x37')]);_0x3a3811[_0xb93d('0x38')]=qs['filters'](_[_0xb93d('0x53')](_0x4cdff0[_0xb93d('0x30')],_0x55e408[_0xb93d('0x2f')]));if(_0x4cdff0[_0xb93d('0x30')][_0xb93d('0x39')]){_0x3a3811['where']=_[_0xb93d('0x3b')](_0x3a3811[_0xb93d('0x38')],{'$or':_[_0xb93d('0x3a')](_0x3a3811[_0xb93d('0x31')],function(_0x3377dd){var _0x32d2ae={};_0x32d2ae[_0x3377dd]={'$like':'%'+_0x4cdff0[_0xb93d('0x30')][_0xb93d('0x39')]+'%'};return _0x32d2ae;})});}_0x3a3811=_['merge']({},_0x3a3811,_0x4cdff0['options']);return _0x59812a[_0xb93d('0x54')](_0x3a3811);}})[_0xb93d('0x23')](function(_0x966659){if(_0x966659){_0x35c7cb=_0x966659[_0xb93d('0x34')];if(!_0x4cdff0[_0xb93d('0x30')][_0xb93d('0x35')](_0xb93d('0x36'))){_0x3a3811['limit']=qs[_0xb93d('0x1c')](_0x4cdff0[_0xb93d('0x30')][_0xb93d('0x1c')]);_0x3a3811[_0xb93d('0x1a')]=qs['offset'](_0x4cdff0[_0xb93d('0x30')]['offset']);}return _0x59812a[_0xb93d('0x54')](_0x3a3811);}})['then'](function(_0x287a6a){if(_0x287a6a){return _0x287a6a?{'count':_0x35c7cb,'rows':_0x287a6a}:null;}})[_0xb93d('0x23')](respondWithResult(_0x127eb7,null))[_0xb93d('0x40')](handleError(_0x127eb7,null));}; \ No newline at end of file +var _0x155d=['ejs','fs-extra','lodash','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','undefined','limit','offset','count','set','Content-Range','json','reject','update','then','destroy','get','Companies','UserProfileResource','sendStatus','error','stack','name','send','index','CmCompany','describe','model','keys','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','map','options','includeAll','include','catch','show','params','rawAttributes','length','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmContact','omit','filter','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x375ff0,_0x536ea9){var _0x18cacd=function(_0x4250e5){while(--_0x4250e5){_0x375ff0['push'](_0x375ff0['shift']());}};_0x18cacd(++_0x536ea9);}(_0x155d,0x98));var _0xd155=function(_0x2b5513,_0x3fe5cd){_0x2b5513=_0x2b5513-0x0;var _0x578fd2=_0x155d[_0x2b5513];return _0x578fd2;};'use strict';var emlformat=require(_0xd155('0x0'));var rimraf=require(_0xd155('0x1'));var zipdir=require(_0xd155('0x2'));var jsonpatch=require(_0xd155('0x3'));var rp=require(_0xd155('0x4'));var moment=require(_0xd155('0x5'));var BPromise=require(_0xd155('0x6'));var Mustache=require(_0xd155('0x7'));var util=require(_0xd155('0x8'));var path=require(_0xd155('0x9'));var sox=require(_0xd155('0xa'));var csv=require(_0xd155('0xb'));var ejs=require(_0xd155('0xc'));var fs=require('fs');var fs_extra=require(_0xd155('0xd'));var _=require(_0xd155('0xe'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd155('0xb'));var querystring=require('querystring');var Papa=require(_0xd155('0xf'));var Redis=require(_0xd155('0x10'));var authService=require(_0xd155('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xd155('0x12'));var hardwareService=require(_0xd155('0x13'));var logger=require(_0xd155('0x14'))(_0xd155('0x15'));var utils=require(_0xd155('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xd155('0x17'));var db=require(_0xd155('0x18'))['db'];function respondWithStatusCode(_0x5d0c00,_0x5eb898){_0x5eb898=_0x5eb898||0xcc;return function(_0x3ad086){if(_0x3ad086){return _0x5d0c00['sendStatus'](_0x5eb898);}return _0x5d0c00[_0xd155('0x19')](_0x5eb898)['end']();};}function respondWithResult(_0xc1a22,_0x2eb0d0){_0x2eb0d0=_0x2eb0d0||0xc8;return function(_0x15850f){if(_0x15850f){return _0xc1a22['status'](_0x2eb0d0)['json'](_0x15850f);}};}function respondWithFilteredResult(_0xf0897a,_0x176803){return function(_0x213fe1){if(_0x213fe1){var _0x18ebaa=typeof _0x176803['offset']===_0xd155('0x1a')&&typeof _0x176803[_0xd155('0x1b')]==='undefined';var _0x3a5d14=_0x213fe1['count'];var _0x3dddd0=_0x18ebaa?0x0:_0x176803[_0xd155('0x1c')];var _0x1b90cc=_0x18ebaa?_0x213fe1[_0xd155('0x1d')]:_0x176803[_0xd155('0x1c')]+_0x176803[_0xd155('0x1b')];var _0x49baa9;if(_0x1b90cc>=_0x3a5d14){_0x1b90cc=_0x3a5d14;_0x49baa9=0xc8;}else{_0x49baa9=0xce;}_0xf0897a['status'](_0x49baa9);return _0xf0897a[_0xd155('0x1e')](_0xd155('0x1f'),_0x3dddd0+'-'+_0x1b90cc+'/'+_0x3a5d14)[_0xd155('0x20')](_0x213fe1);}return null;};}function patchUpdates(_0x25d803){return function(_0x1da1a1){try{jsonpatch['apply'](_0x1da1a1,_0x25d803,!![]);}catch(_0x1ba74c){return BPromise[_0xd155('0x21')](_0x1ba74c);}return _0x1da1a1['save']();};}function saveUpdates(_0x15f61b,_0x57ddaa){return function(_0x24844b){if(_0x24844b){return _0x24844b[_0xd155('0x22')](_0x15f61b)[_0xd155('0x23')](function(_0x467c48){return _0x467c48;});}return null;};}function removeEntity(_0x5cdcd,_0x2455db){return function(_0x59b592){if(_0x59b592){return _0x59b592[_0xd155('0x24')]()['then'](function(){var _0x2c6a2d=_0x59b592[_0xd155('0x25')]({'plain':!![]});var _0x58b16d=_0xd155('0x26');return db[_0xd155('0x27')][_0xd155('0x24')]({'where':{'type':_0x58b16d,'resourceId':_0x2c6a2d['id']}})['then'](function(){return _0x59b592;});})[_0xd155('0x23')](function(){_0x5cdcd['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e81b1,_0x34ecbd){return function(_0xa3ede6){if(!_0xa3ede6){_0x1e81b1[_0xd155('0x28')](0x194);}return _0xa3ede6;};}function handleError(_0x39f722,_0x3508fc){_0x3508fc=_0x3508fc||0x1f4;return function(_0x1551d7){logger[_0xd155('0x29')](_0x1551d7[_0xd155('0x2a')]);if(_0x1551d7['name']){delete _0x1551d7[_0xd155('0x2b')];}_0x39f722[_0xd155('0x19')](_0x3508fc)[_0xd155('0x2c')](_0x1551d7);};}exports[_0xd155('0x2d')]=function(_0x274cc0,_0xc45dc4){var _0x100709={},_0x12d8a6={},_0x345567={'count':0x0,'rows':[]};return db[_0xd155('0x2e')][_0xd155('0x2f')]()['then'](function(_0x33c8ff){_0x12d8a6[_0xd155('0x30')]=_[_0xd155('0x31')](_0x33c8ff);_0x12d8a6[_0xd155('0x32')]=_[_0xd155('0x31')](_0x274cc0['query']);_0x12d8a6['filters']=_[_0xd155('0x33')](_0x12d8a6['model'],_0x12d8a6[_0xd155('0x32')]);_0x100709['attributes']=_[_0xd155('0x33')](_0x12d8a6[_0xd155('0x30')],qs[_0xd155('0x34')](_0x274cc0[_0xd155('0x32')][_0xd155('0x34')]));_0x100709[_0xd155('0x35')]=_0x100709[_0xd155('0x35')]['length']?_0x100709[_0xd155('0x35')]:_0x12d8a6['model'];if(!_0x274cc0[_0xd155('0x32')][_0xd155('0x36')](_0xd155('0x37'))){_0x100709[_0xd155('0x1b')]=qs[_0xd155('0x1b')](_0x274cc0[_0xd155('0x32')][_0xd155('0x1b')]);_0x100709[_0xd155('0x1c')]=qs[_0xd155('0x1c')](_0x274cc0['query'][_0xd155('0x1c')]);}_0x100709[_0xd155('0x38')]=qs[_0xd155('0x39')](_0x274cc0[_0xd155('0x32')][_0xd155('0x39')]);_0x100709['where']=qs[_0xd155('0x3a')](_[_0xd155('0x3b')](_0x274cc0[_0xd155('0x32')],_0x12d8a6[_0xd155('0x3a')]),_0x33c8ff);if(_0x274cc0[_0xd155('0x32')]['filter']){_0x100709[_0xd155('0x3c')]=_[_0xd155('0x3d')](_0x100709[_0xd155('0x3c')],{'$or':_[_0xd155('0x3e')](_0x100709[_0xd155('0x35')],function(_0xe30578){var _0x880d8f={};_0x880d8f[_0xe30578]={'$like':'%'+_0x274cc0[_0xd155('0x32')]['filter']+'%'};return _0x880d8f;})});}_0x100709=_['merge']({},_0x100709,_0x274cc0[_0xd155('0x3f')]);var _0x456337={'where':_0x100709[_0xd155('0x3c')]};return db[_0xd155('0x2e')][_0xd155('0x1d')](_0x456337)[_0xd155('0x23')](function(_0x1051ab){_0x345567['count']=_0x1051ab;if(_0x274cc0[_0xd155('0x32')][_0xd155('0x40')]){_0x100709[_0xd155('0x41')]=[{'all':!![]}];}return db[_0xd155('0x2e')]['findAll'](_0x100709);})['then'](function(_0x2460c7){_0x345567['rows']=_0x2460c7;return _0x345567;})[_0xd155('0x23')](respondWithFilteredResult(_0xc45dc4,_0x100709))[_0xd155('0x42')](handleError(_0xc45dc4,null));})['catch'](handleError(_0xc45dc4,null));};exports[_0xd155('0x43')]=function(_0x1c08f9,_0x828da3){var _0x44ac05={'raw':![],'where':{'id':_0x1c08f9[_0xd155('0x44')]['id']}},_0x287e78={};_0x287e78['model']=_[_0xd155('0x31')](db['CmCompany'][_0xd155('0x45')]);_0x287e78[_0xd155('0x32')]=_[_0xd155('0x31')](_0x1c08f9['query']);_0x287e78[_0xd155('0x3a')]=_[_0xd155('0x33')](_0x287e78[_0xd155('0x30')],_0x287e78[_0xd155('0x32')]);_0x44ac05[_0xd155('0x35')]=_[_0xd155('0x33')](_0x287e78[_0xd155('0x30')],qs[_0xd155('0x34')](_0x1c08f9[_0xd155('0x32')][_0xd155('0x34')]));_0x44ac05[_0xd155('0x35')]=_0x44ac05['attributes'][_0xd155('0x46')]?_0x44ac05['attributes']:_0x287e78[_0xd155('0x30')];if(_0x1c08f9['query'][_0xd155('0x40')]){_0x44ac05['include']=[{'all':!![]}];}_0x44ac05=_['merge']({},_0x44ac05,_0x1c08f9[_0xd155('0x3f')]);return db[_0xd155('0x2e')][_0xd155('0x47')](_0x44ac05)[_0xd155('0x23')](handleEntityNotFound(_0x828da3,null))[_0xd155('0x23')](respondWithResult(_0x828da3,null))[_0xd155('0x42')](handleError(_0x828da3,null));};exports['create']=function(_0x634956,_0x20b32e){return db[_0xd155('0x2e')]['create'](_0x634956[_0xd155('0x48')],{})['then'](function(_0x7c9d07){var _0x6d44eb=_0x634956[_0xd155('0x49')]['get']({'plain':!![]});if(!_0x6d44eb)throw new Error(_0xd155('0x4a'));if(_0x6d44eb[_0xd155('0x4b')]===_0xd155('0x49')){var _0x4e7983=_0x7c9d07[_0xd155('0x25')]({'plain':!![]});var _0x1f762b='Companies';return db[_0xd155('0x4c')][_0xd155('0x47')]({'where':{'name':_0x1f762b,'userProfileId':_0x6d44eb['userProfileId']},'raw':!![]})[_0xd155('0x23')](function(_0xcf7801){if(_0xcf7801&&_0xcf7801['autoAssociation']===0x0){return db[_0xd155('0x27')][_0xd155('0x4d')]({'name':_0x4e7983[_0xd155('0x2b')],'resourceId':_0x4e7983['id'],'type':_0xcf7801[_0xd155('0x2b')],'sectionId':_0xcf7801['id']},{})[_0xd155('0x23')](function(){return _0x7c9d07;});}else{return _0x7c9d07;}})[_0xd155('0x42')](function(_0x1deb6e){logger[_0xd155('0x29')](_0xd155('0x4e'),_0x1deb6e);throw _0x1deb6e;});}return _0x7c9d07;})[_0xd155('0x23')](respondWithResult(_0x20b32e,0xc9))[_0xd155('0x42')](handleError(_0x20b32e,null));};exports['update']=function(_0x4cee01,_0x25a881){if(_0x4cee01[_0xd155('0x48')]['id']){delete _0x4cee01['body']['id'];}return db[_0xd155('0x2e')][_0xd155('0x47')]({'where':{'id':_0x4cee01[_0xd155('0x44')]['id']}})[_0xd155('0x23')](handleEntityNotFound(_0x25a881,null))[_0xd155('0x23')](saveUpdates(_0x4cee01[_0xd155('0x48')],null))[_0xd155('0x23')](respondWithResult(_0x25a881,null))[_0xd155('0x42')](handleError(_0x25a881,null));};exports['destroy']=function(_0x572db8,_0x23247e){return db[_0xd155('0x2e')][_0xd155('0x47')]({'where':{'id':_0x572db8[_0xd155('0x44')]['id']}})[_0xd155('0x23')](handleEntityNotFound(_0x23247e,null))['then'](removeEntity(_0x23247e,null))[_0xd155('0x42')](handleError(_0x23247e,null));};exports[_0xd155('0x2f')]=function(_0x43bbea,_0xdefcdf){return db[_0xd155('0x2e')][_0xd155('0x2f')]()[_0xd155('0x23')](respondWithResult(_0xdefcdf,null))[_0xd155('0x42')](handleError(_0xdefcdf,null));};exports['addContacts']=function(_0x5da505,_0x187b05,_0x706a4b){return db[_0xd155('0x4f')][_0xd155('0x47')]({'where':{'id':_0x5da505[_0xd155('0x44')]['id']}})[_0xd155('0x23')](handleEntityNotFound(_0x187b05,null))['then'](function(_0x27c133){if(_0x27c133){return _0x27c133['addContacts'](_0x5da505['body']['ids'],_[_0xd155('0x50')](_0x5da505[_0xd155('0x48')],['ids','id'])||{});}})[_0xd155('0x23')](respondWithResult(_0x187b05,null))[_0xd155('0x42')](handleError(_0x187b05,null));};exports['getContacts']=function(_0xcba774,_0x4fa19a,_0x400bb0){var _0x4988e9={};var _0x37a72a={};var _0x25e7cc;var _0x448ae7;return db[_0xd155('0x2e')]['findOne']({'where':{'id':_0xcba774[_0xd155('0x44')]['id']}})[_0xd155('0x23')](handleEntityNotFound(_0x4fa19a,null))[_0xd155('0x23')](function(_0x1a53e4){if(_0x1a53e4){_0x25e7cc=_0x1a53e4;_0x37a72a[_0xd155('0x30')]=_[_0xd155('0x31')](db[_0xd155('0x4f')]['rawAttributes']);_0x37a72a[_0xd155('0x32')]=_['keys'](_0xcba774[_0xd155('0x32')]);_0x37a72a[_0xd155('0x3a')]=_['intersection'](_0x37a72a['model'],_0x37a72a['query']);_0x4988e9[_0xd155('0x35')]=_['intersection'](_0x37a72a['model'],qs[_0xd155('0x34')](_0xcba774[_0xd155('0x32')][_0xd155('0x34')]));_0x4988e9[_0xd155('0x35')]=_0x4988e9[_0xd155('0x35')][_0xd155('0x46')]?_0x4988e9[_0xd155('0x35')]:_0x37a72a[_0xd155('0x30')];_0x4988e9['order']=qs['sort'](_0xcba774['query'][_0xd155('0x39')]);_0x4988e9[_0xd155('0x3c')]=qs[_0xd155('0x3a')](_[_0xd155('0x3b')](_0xcba774[_0xd155('0x32')],_0x37a72a['filters']));if(_0xcba774[_0xd155('0x32')]['filter']){_0x4988e9[_0xd155('0x3c')]=_[_0xd155('0x3d')](_0x4988e9[_0xd155('0x3c')],{'$or':_[_0xd155('0x3e')](_0x4988e9[_0xd155('0x35')],function(_0x5f0dd1){var _0x1eaeb0={};_0x1eaeb0[_0x5f0dd1]={'$like':'%'+_0xcba774[_0xd155('0x32')][_0xd155('0x51')]+'%'};return _0x1eaeb0;})});}_0x4988e9=_[_0xd155('0x3d')]({},_0x4988e9,_0xcba774[_0xd155('0x3f')]);return _0x25e7cc['getContacts'](_0x4988e9);}})['then'](function(_0x1d571a){if(_0x1d571a){_0x448ae7=_0x1d571a[_0xd155('0x46')];if(!_0xcba774[_0xd155('0x32')][_0xd155('0x36')]('nolimit')){_0x4988e9[_0xd155('0x1b')]=qs[_0xd155('0x1b')](_0xcba774[_0xd155('0x32')]['limit']);_0x4988e9[_0xd155('0x1c')]=qs[_0xd155('0x1c')](_0xcba774[_0xd155('0x32')][_0xd155('0x1c')]);}return _0x25e7cc['getContacts'](_0x4988e9);}})[_0xd155('0x23')](function(_0x10e1c8){if(_0x10e1c8){return _0x10e1c8?{'count':_0x448ae7,'rows':_0x10e1c8}:null;}})[_0xd155('0x23')](respondWithResult(_0x4fa19a,null))[_0xd155('0x42')](handleError(_0x4fa19a,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 278cb99..2e4f6b1 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 _0x0f97=['bluebird','request-promise','path','../../config/environment','./cmCompany.attributes','define','CmCompany','cm_companies','lodash','util','api','moment'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x0f97,0x164));var _0x70f9=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x0f97[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x70f9('0x0'));var util=require(_0x70f9('0x1'));var logger=require('../../config/logger')(_0x70f9('0x2'));var moment=require(_0x70f9('0x3'));var BPromise=require(_0x70f9('0x4'));var rp=require(_0x70f9('0x5'));var fs=require('fs');var path=require(_0x70f9('0x6'));var rimraf=require('rimraf');var config=require(_0x70f9('0x7'));var attributes=require(_0x70f9('0x8'));module['exports']=function(_0x3c98d1,_0x144366){return _0x3c98d1[_0x70f9('0x9')](_0x70f9('0xa'),attributes,{'tableName':_0x70f9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1a11=['bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','define','CmCompany','cm_companies','lodash','../../config/logger','api'];(function(_0x1ae6f8,_0x1526ad){var _0x49f3db=function(_0x4bc9e1){while(--_0x4bc9e1){_0x1ae6f8['push'](_0x1ae6f8['shift']());}};_0x49f3db(++_0x1526ad);}(_0x1a11,0x99));var _0x11a1=function(_0xae0da9,_0x1cbd8f){_0xae0da9=_0xae0da9-0x0;var _0x1b0b3c=_0x1a11[_0xae0da9];return _0x1b0b3c;};'use strict';var _=require(_0x11a1('0x0'));var util=require('util');var logger=require(_0x11a1('0x1'))(_0x11a1('0x2'));var moment=require('moment');var BPromise=require(_0x11a1('0x3'));var rp=require(_0x11a1('0x4'));var fs=require('fs');var path=require(_0x11a1('0x5'));var rimraf=require(_0x11a1('0x6'));var config=require(_0x11a1('0x7'));var attributes=require(_0x11a1('0x8'));module['exports']=function(_0xa9781d,_0x5655a6){return _0xa9781d[_0x11a1('0x9')](_0x11a1('0xa'),attributes,{'tableName':_0x11a1('0xb'),'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 bd24b73..a96abe5 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 _0xa3a5=['error','code','CmCompany,\x20%s,\x20%s','message','result','catch','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x11309c,_0xe18a74){var _0x3fea9c=function(_0xeb11c3){while(--_0xeb11c3){_0x11309c['push'](_0x11309c['shift']());}};_0x3fea9c(++_0xe18a74);}(_0xa3a5,0x126));var _0x5a3a=function(_0x53dcbd,_0x1250b4){_0x53dcbd=_0x53dcbd-0x0;var _0x484902=_0xa3a5[_0x53dcbd];return _0x484902;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5a3a('0x0'));var fs=require('fs');var Redis=require(_0x5a3a('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x5a3a('0x2'));var logger=require('../../config/logger')('rpc');var config=require(_0x5a3a('0x3'));var jayson=require(_0x5a3a('0x4'));var client=jayson[_0x5a3a('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f1117,_0x7804ba,_0x38122e){return new BPromise(function(_0x59dd9a,_0xbe2975){return client['request'](_0x1f1117,_0x38122e)[_0x5a3a('0x6')](function(_0x4673a5){logger[_0x5a3a('0x7')]('CmCompany,\x20%s,\x20%s',_0x7804ba,_0x5a3a('0x8'));logger[_0x5a3a('0x9')](_0x5a3a('0xa'),_0x7804ba,'request\x20sent',JSON[_0x5a3a('0xb')](_0x4673a5));if(_0x4673a5[_0x5a3a('0xc')]){if(_0x4673a5[_0x5a3a('0xc')][_0x5a3a('0xd')]===0x1f4){logger[_0x5a3a('0xc')](_0x5a3a('0xe'),_0x7804ba,_0x4673a5[_0x5a3a('0xc')][_0x5a3a('0xf')]);return _0xbe2975(_0x4673a5[_0x5a3a('0xc')]['message']);}logger['error'](_0x5a3a('0xe'),_0x7804ba,_0x4673a5[_0x5a3a('0xc')][_0x5a3a('0xf')]);return _0x59dd9a(_0x4673a5[_0x5a3a('0xc')][_0x5a3a('0xf')]);}else{logger[_0x5a3a('0x7')](_0x5a3a('0xe'),_0x7804ba,'request\x20sent');_0x59dd9a(_0x4673a5[_0x5a3a('0x10')][_0x5a3a('0xf')]);}})[_0x5a3a('0x11')](function(_0xd56772){logger[_0x5a3a('0xc')](_0x5a3a('0xe'),_0x7804ba,_0xd56772);_0xbe2975(_0xd56772);});});} \ No newline at end of file +var _0x9e3c=['client','http','request','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','jayson/promise'];(function(_0x21fdfd,_0x56409b){var _0x47c238=function(_0x9812ff){while(--_0x9812ff){_0x21fdfd['push'](_0x21fdfd['shift']());}};_0x47c238(++_0x56409b);}(_0x9e3c,0x14d));var _0xc9e3=function(_0x59d48a,_0x3a79f6){_0x59d48a=_0x59d48a-0x0;var _0x3572ab=_0x9e3c[_0x59d48a];return _0x3572ab;};'use strict';var _=require(_0xc9e3('0x0'));var util=require('util');var moment=require(_0xc9e3('0x1'));var BPromise=require(_0xc9e3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc9e3('0x3'))['db'];var utils=require(_0xc9e3('0x4'));var logger=require(_0xc9e3('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc9e3('0x6'));var client=jayson[_0xc9e3('0x7')][_0xc9e3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xddba98,_0x18a37a,_0x480585){return new BPromise(function(_0x36ab8a,_0x241ef1){return client[_0xc9e3('0x9')](_0xddba98,_0x480585)['then'](function(_0x4597f9){logger['info'](_0xc9e3('0xa'),_0x18a37a,'request\x20sent');logger[_0xc9e3('0xb')](_0xc9e3('0xc'),_0x18a37a,_0xc9e3('0xd'),JSON[_0xc9e3('0xe')](_0x4597f9));if(_0x4597f9[_0xc9e3('0xf')]){if(_0x4597f9['error'][_0xc9e3('0x10')]===0x1f4){logger[_0xc9e3('0xf')](_0xc9e3('0xa'),_0x18a37a,_0x4597f9[_0xc9e3('0xf')][_0xc9e3('0x11')]);return _0x241ef1(_0x4597f9[_0xc9e3('0xf')][_0xc9e3('0x11')]);}logger['error'](_0xc9e3('0xa'),_0x18a37a,_0x4597f9[_0xc9e3('0xf')][_0xc9e3('0x11')]);return _0x36ab8a(_0x4597f9['error'][_0xc9e3('0x11')]);}else{logger[_0xc9e3('0x12')]('CmCompany,\x20%s,\x20%s',_0x18a37a,_0xc9e3('0xd'));_0x36ab8a(_0x4597f9[_0xc9e3('0x13')][_0xc9e3('0x11')]);}})['catch'](function(_0x36e0ce){logger[_0xc9e3('0xf')](_0xc9e3('0xa'),_0x18a37a,_0x36e0ce);_0x241ef1(_0x36e0ce);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 4bf9f8f..e8647bf 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 _0x93c2=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','describe','/:id','show','/:id/contacts','post','create','put','update','delete','destroy'];(function(_0x259556,_0x488aca){var _0x5009de=function(_0x280287){while(--_0x280287){_0x259556['push'](_0x259556['shift']());}};_0x5009de(++_0x488aca);}(_0x93c2,0x15a));var _0x293c=function(_0x1ba2b7,_0x10a4d3){_0x1ba2b7=_0x1ba2b7-0x0;var _0x13d403=_0x93c2[_0x1ba2b7];return _0x13d403;};'use strict';var multer=require('multer');var util=require(_0x293c('0x0'));var path=require(_0x293c('0x1'));var timeout=require(_0x293c('0x2'));var express=require(_0x293c('0x3'));var router=express[_0x293c('0x4')]();var fs_extra=require(_0x293c('0x5'));var auth=require(_0x293c('0x6'));var interaction=require(_0x293c('0x7'));var config=require(_0x293c('0x8'));var controller=require(_0x293c('0x9'));router[_0x293c('0xa')]('/',auth[_0x293c('0xb')](),controller['index']);router[_0x293c('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x293c('0xc')]);router[_0x293c('0xa')](_0x293c('0xd'),auth[_0x293c('0xb')](),controller[_0x293c('0xe')]);router['get'](_0x293c('0xf'),auth[_0x293c('0xb')](),controller['getContacts']);router[_0x293c('0x10')]('/',auth['isAuthenticated'](),controller[_0x293c('0x11')]);router[_0x293c('0x10')](_0x293c('0xf'),auth[_0x293c('0xb')](),controller['addContacts']);router[_0x293c('0x12')](_0x293c('0xd'),auth[_0x293c('0xb')](),controller[_0x293c('0x13')]);router[_0x293c('0x14')]('/:id',auth[_0x293c('0xb')](),controller[_0x293c('0x15')]);module[_0x293c('0x16')]=router; \ No newline at end of file +var _0xf971=['put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/contacts','getContacts','create','post'];(function(_0x54df94,_0x53fcca){var _0xfafbfd=function(_0x52a0eb){while(--_0x52a0eb){_0x54df94['push'](_0x54df94['shift']());}};_0xfafbfd(++_0x53fcca);}(_0xf971,0x7c));var _0x1f97=function(_0x2b7a87,_0x552c05){_0x2b7a87=_0x2b7a87-0x0;var _0x29446f=_0xf971[_0x2b7a87];return _0x29446f;};'use strict';var multer=require(_0x1f97('0x0'));var util=require(_0x1f97('0x1'));var path=require(_0x1f97('0x2'));var timeout=require(_0x1f97('0x3'));var express=require(_0x1f97('0x4'));var router=express[_0x1f97('0x5')]();var fs_extra=require(_0x1f97('0x6'));var auth=require(_0x1f97('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x1f97('0x8'));var controller=require(_0x1f97('0x9'));router[_0x1f97('0xa')]('/',auth[_0x1f97('0xb')](),controller['index']);router[_0x1f97('0xa')](_0x1f97('0xc'),auth[_0x1f97('0xb')](),controller[_0x1f97('0xd')]);router[_0x1f97('0xa')](_0x1f97('0xe'),auth[_0x1f97('0xb')](),controller[_0x1f97('0xf')]);router[_0x1f97('0xa')](_0x1f97('0x10'),auth[_0x1f97('0xb')](),controller[_0x1f97('0x11')]);router['post']('/',auth[_0x1f97('0xb')](),controller[_0x1f97('0x12')]);router[_0x1f97('0x13')](_0x1f97('0x10'),auth[_0x1f97('0xb')](),controller['addContacts']);router[_0x1f97('0x14')](_0x1f97('0xe'),auth['isAuthenticated'](),controller[_0x1f97('0x15')]);router['delete'](_0x1f97('0xe'),auth[_0x1f97('0xb')](),controller[_0x1f97('0x16')]);module[_0x1f97('0x17')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 276f695..3bc6561 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 _0x2032=['sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','NOW'];(function(_0x38537f,_0x252124){var _0x141e23=function(_0x2809b5){while(--_0x2809b5){_0x38537f['push'](_0x38537f['shift']());}};_0x141e23(++_0x252124);}(_0x2032,0xd9));var _0x2203=function(_0x4e3c92,_0x353fa4){_0x4e3c92=_0x4e3c92-0x0;var _0x455d28=_0x2032[_0x4e3c92];return _0x455d28;};'use strict';var _=require('lodash');var Sequelize=require(_0x2203('0x0'));module[_0x2203('0x1')]={'firstName':{'type':Sequelize[_0x2203('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x2203('0x2')]},'postalCode':{'type':Sequelize[_0x2203('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x2203('0x2')]},'dateOfBirth':{'type':Sequelize[_0x2203('0x2')]},'description':{'type':Sequelize[_0x2203('0x3')]},'phone':{'type':Sequelize[_0x2203('0x2')]},'mobile':{'type':Sequelize[_0x2203('0x2')]},'fax':{'type':Sequelize[_0x2203('0x2')]},'email':{'type':Sequelize[_0x2203('0x2')]},'url':{'type':Sequelize[_0x2203('0x2')]},'facebook':{'type':Sequelize[_0x2203('0x2')]},'fb_data':{'type':Sequelize[_0x2203('0x2')]},'twitter':{'type':Sequelize[_0x2203('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x2203('0x2')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x2203('0x2')]},'telegram':{'type':Sequelize[_0x2203('0x2')]},'UserId':{'type':Sequelize[_0x2203('0x4')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x2203('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x2203('0x6')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0x2203('0x4')]}}; \ No newline at end of file +var _0x2032=['sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','NOW'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0x2032,0xd9));var _0x2203=function(_0xeaa812,_0x5417de){_0xeaa812=_0xeaa812-0x0;var _0x5bc621=_0x2032[_0xeaa812];return _0x5bc621;};'use strict';var _=require('lodash');var Sequelize=require(_0x2203('0x0'));module[_0x2203('0x1')]={'firstName':{'type':Sequelize[_0x2203('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x2203('0x2')]},'postalCode':{'type':Sequelize[_0x2203('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x2203('0x2')]},'dateOfBirth':{'type':Sequelize[_0x2203('0x2')]},'description':{'type':Sequelize[_0x2203('0x3')]},'phone':{'type':Sequelize[_0x2203('0x2')]},'mobile':{'type':Sequelize[_0x2203('0x2')]},'fax':{'type':Sequelize[_0x2203('0x2')]},'email':{'type':Sequelize[_0x2203('0x2')]},'url':{'type':Sequelize[_0x2203('0x2')]},'facebook':{'type':Sequelize[_0x2203('0x2')]},'fb_data':{'type':Sequelize[_0x2203('0x2')]},'twitter':{'type':Sequelize[_0x2203('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x2203('0x2')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x2203('0x2')]},'telegram':{'type':Sequelize[_0x2203('0x2')]},'UserId':{'type':Sequelize[_0x2203('0x4')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x2203('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x2203('0x6')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0x2203('0x4')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 6de0674..03a2556 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 _0x5855=['pid','exit','error\x20child\x20process','getJourney','chat','openchannel','fax','whatsapp','voice','-createdAt','channel','includes','toLowerCase','Invalid\x20channel','parse','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','destination','starttime','endtime','duration','note','userDisposition','userThirdDisposition','UserId','fullname','createdAt','findAndCountAll','startCase','Website','Account','closed','closedAt','disposition','secondDisposition','key','Owner','customerIp','customerPort','deviceModel','ratingMessage','ratingType','mail','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','slice','moment','bluebird','util','path','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','socket.io-emitter','./cmContact.socket','register','status','json','offset','undefined','count','limit','then','end','error','stack','name','send','index','CmContact','describe','keys','length','startsWith','findOne','cf_','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','field','tools_tags','from','cm_contacts','left_join','cm_user_has_contacts','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','where','c.deletedAt\x20IS\x20NULL','expr','search','sqlOperator','Tag','forEach','union','uc.UserId\x20=\x20?','value','fieldType','datetime','castTo','DATE','buildExpression','start','filter','isNil','Contact','push','isEmpty','ListId','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','isArray','replace','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','group','QueryTypes','SELECT','clone','DESC','having','t.id\x20IN\x20?','resolve','user','role','agent','some','conditions','User','getLists','c.ListId\x20IS\x20NULL','map','sequelize','keyBy','merge','c.id','c.firstName','c.lastName','c.phone','c.mobile','c.email','c.ListId','c.createdAt','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','toString','Tags','rows','find','params','catch','columnName','findAll','displayName','alias','custom','values','body','get','mergeWith','tags','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','destroy','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','update','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','ReportAgentPreview','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','dialTimezone','utcOffset','timezones','each','duplicates','$or','findOrCreate','color','$and','CmCustomField','omit','format','pickBy','cf_%d','table','setFields','id\x20=\x20?','toParam','text','phone','getTags','rawAttributes','pick','options','setTags','ContactId','includeAll','include','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getJscriptySessions','uploadCsv','binding_keys','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','root','server/files/tmp','file','0777','child_process','fork','CompanyId','File\x20uploaded\x20correctly!','upload','meta','import','No\x20ListId\x20specified','binding','../../components/import/cm/csv2','stringify','message'];(function(_0x2c3a8f,_0x374e56){var _0x189412=function(_0x560055){while(--_0x560055){_0x2c3a8f['push'](_0x2c3a8f['shift']());}};_0x189412(++_0x374e56);}(_0x5855,0x151));var _0x5585=function(_0x56e711,_0x5917c8){_0x56e711=_0x56e711-0x0;var _0x1cf38f=_0x5855[_0x56e711];return _0x1cf38f;};'use strict';var moment=require(_0x5585('0x0'));var BPromise=require(_0x5585('0x1'));var util=require(_0x5585('0x2'));var path=require(_0x5585('0x3'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var Papa=require(_0x5585('0x4'));var Redis=require(_0x5585('0x5'));var qs=require(_0x5585('0x6'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0x5585('0x7'))(_0x5585('0x8'));var config=require('../../config/environment');var shared=require(_0x5585('0x9'));var db=require(_0x5585('0xa'))['db'];config[_0x5585('0xb')]=_['defaults'](config[_0x5585('0xb')],{'host':_0x5585('0xc'),'port':0x18eb});var socket=require(_0x5585('0xd'))(new Redis(config[_0x5585('0xb')]));require(_0x5585('0xe'))[_0x5585('0xf')](socket);function respondWithResult(_0x559d97,_0x3f130e){_0x3f130e=_0x3f130e||0xc8;return function(_0x3de2d9){if(_0x3de2d9){return _0x559d97[_0x5585('0x10')](_0x3f130e)[_0x5585('0x11')](_0x3de2d9);}};}function respondWithFilteredResult(_0x21e001,_0x263250){return function(_0x11c462){if(_0x11c462){var _0x326d64=typeof _0x263250[_0x5585('0x12')]===_0x5585('0x13')&&typeof _0x263250['limit']==='undefined';var _0x4c15b1=_0x11c462[_0x5585('0x14')];var _0x45517c=_0x326d64?0x0:_0x263250['offset'];var _0x2b60a9=_0x326d64?_0x11c462[_0x5585('0x14')]:_0x263250[_0x5585('0x12')]+_0x263250[_0x5585('0x15')];var _0x105a7d;if(_0x2b60a9>=_0x4c15b1){_0x2b60a9=_0x4c15b1;_0x105a7d=0xc8;}else{_0x105a7d=0xce;}_0x21e001[_0x5585('0x10')](_0x105a7d);return _0x21e001['set']('Content-Range',_0x45517c+'-'+_0x2b60a9+'/'+_0x4c15b1)[_0x5585('0x11')](_0x11c462);}return null;};}function saveUpdates(_0x4c778a){return function(_0x4c84a4){if(_0x4c84a4){return _0x4c84a4['update'](_0x4c778a)[_0x5585('0x16')](function(_0x310efe){return _0x310efe;});}return null;};}function removeEntity(_0x88fb85){return function(_0x49744c){if(_0x49744c){return _0x49744c['destroy']()[_0x5585('0x16')](function(){_0x88fb85[_0x5585('0x10')](0xcc)[_0x5585('0x17')]();});}};}function handleEntityNotFound(_0x20e501){return function(_0xff21bc){if(!_0xff21bc){_0x20e501['sendStatus'](0x194);}return _0xff21bc;};}function handleError(_0x2fcf90,_0x5f614f){_0x5f614f=_0x5f614f||0x1f4;return function(_0x34e9db){logger[_0x5585('0x18')](_0x34e9db[_0x5585('0x19')]);if(_0x34e9db['name']){delete _0x34e9db[_0x5585('0x1a')];}_0x2fcf90[_0x5585('0x10')](_0x5f614f)[_0x5585('0x1b')](_0x34e9db);};}exports[_0x5585('0x1c')]=function(_0x34b5e7,_0x3e9a70){var _0x5f1685={},_0x1bc378={},_0xec6964={'count':0x0,'rows':[]};return db[_0x5585('0x1d')][_0x5585('0x1e')]()[_0x5585('0x16')](function(_0x37aaf6){var _0x3d43f6=[];for(var _0x2ea739=0x0;_0x2ea7390x1){_0x478617['or'](_0x5585('0x55'),qs['getFullTextValue'](_0x5f3802),null);}else{if(qs[_0x5585('0x56')](_0x5f3802)){_0x478617['or'](_0x5585('0x57'),_0x5f3802+'%');_0x478617['or'](_0x5585('0x58'),_0x5f3802+'%');_0x478617['or'](_0x5585('0x59'),_0x5f3802+'%');_0x478617['or'](_0x5585('0x5a'),_0x5f3802+'%');}else if(qs[_0x5585('0x5b')](_0x5f3802)){_0x478617['or'](_0x5585('0x5c'),_0x5f3802+'%');}else{_0x478617['or']('c.firstName\x20LIKE\x20?','%'+_0x5f3802+'%');_0x478617['or']('c.lastName\x20LIKE\x20?','%'+_0x5f3802+'%');_0x478617['or'](_0x5585('0x5c'),'%'+_0x5f3802+'%');}}}}_0x2c738c[_0x5585('0x37')](_0x478617);_0x2c738c[_0x5585('0x5d')]('c.id');var _0x1b0174={'type':db['Sequelize'][_0x5585('0x5e')][_0x5585('0x5f')],'raw':!![]};var _0x26c2ab=_0x2c738c[_0x5585('0x60')]()['field']('c.id');if(_0x5f1685[_0x5585('0x2d')]){_0x5f1685[_0x5585('0x2d')]['forEach'](function(_0x3ccd3f){_0x2c738c[_0x5585('0x2d')]('c.'+_0x3ccd3f[0x0],_0x3ccd3f[0x1]===_0x5585('0x61')?![]:!![]);});}if(!_[_0x5585('0x4b')](_0x5b5b80)){_0x2c738c[_0x5585('0x62')](_0x2f5b61);_0x26c2ab[_0x5585('0x37')](_0x5585('0x63'),_0x5b5b80);}BPromise[_0x5585('0x64')]()['then'](function(){if(!_0x2ad015)return;if(_0x34b5e7[_0x5585('0x65')][_0x5585('0x66')]!==_0x5585('0x67'))return;if(!_[_0x5585('0x68')](_0x2ad015[_0x5585('0x69')],[_0x5585('0x2f'),_0x5585('0x6a')])){return _0x34b5e7[_0x5585('0x65')][_0x5585('0x6b')]({'attributes':['id'],'raw':!![]})[_0x5585('0x16')](function(_0x218c82){if(_[_0x5585('0x4b')](_0x218c82)){_0x26c2ab[_0x5585('0x37')](_0x5585('0x6c'));_0x2c738c[_0x5585('0x37')](_0x5585('0x6c'));}else{_0x26c2ab['where']('c.ListId\x20IN\x20?',_[_0x5585('0x6d')](_0x218c82,'id'));_0x2c738c['where']('c.ListId\x20IN\x20?',_[_0x5585('0x6d')](_0x218c82,'id'));}});}})[_0x5585('0x16')](function(){if(_0x34b5e7['user']['role']===_0x5585('0x67')&&!_0x2ad015&&!_0x34b5e7[_0x5585('0x26')]['ListId'])return[];return db[_0x5585('0x6e')][_0x5585('0x26')](_0x26c2ab['toString'](),_0x1b0174);})[_0x5585('0x16')](function(_0x58583f){_0xec6964[_0x5585('0x14')]=_0x58583f[_0x5585('0x20')];if(_0xec6964['count']===0x0)return[];return db[_0x5585('0x6e')][_0x5585('0x26')](_0x5682b4['toString'](),_0x1b0174)[_0x5585('0x16')](function(_0x570d26){_0x486845=_[_0x5585('0x6f')](_0x570d26,'id');_0x1b0174=_[_0x5585('0x70')](_0x1b0174,{'model':db['CmContact'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x34b5e7[_0x5585('0x26')][_0x5585('0x2a')]){_0x5f1685[_0x5585('0x29')][_0x5585('0x3d')](function(_0x421c33){_0x2c738c[_0x5585('0x2f')]('c.'+_0x421c33);});}else{_0x2c738c[_0x5585('0x2f')](_0x5585('0x71'));_0x2c738c[_0x5585('0x2f')](_0x5585('0x72'));_0x2c738c[_0x5585('0x2f')](_0x5585('0x73'));_0x2c738c['field'](_0x5585('0x74'));_0x2c738c[_0x5585('0x2f')](_0x5585('0x75'));_0x2c738c[_0x5585('0x2f')]('c.fax');_0x2c738c['field'](_0x5585('0x76'));_0x2c738c[_0x5585('0x2f')](_0x5585('0x77'));_0x2c738c['field'](_0x5585('0x78'));_0x2c738c[_0x5585('0x2f')](_0x5585('0x79'));_0x2c738c['field'](_0x5585('0x7a'));_0x2c738c['field'](_0x5585('0x7b'),_0x5585('0x7c'));}if(_0x5f1685[_0x5585('0x15')])_0x2c738c[_0x5585('0x15')](_0x5f1685['limit']);if(_0x5f1685[_0x5585('0x12')])_0x2c738c[_0x5585('0x12')](_0x5f1685[_0x5585('0x12')]);return db[_0x5585('0x6e')][_0x5585('0x26')](_0x2c738c[_0x5585('0x7d')](),_0x1b0174);});})[_0x5585('0x16')](function(_0x316291){_0x316291['forEach'](function(_0x4362f1){if(_0x4362f1[_0x5585('0x7c')]){_0x4362f1[_0x5585('0x7e')]=[];_0x4362f1[_0x5585('0x7c')][_0x5585('0x54')](',')[_0x5585('0x3d')](function(_0x96675f){_0x4362f1[_0x5585('0x7e')][_0x5585('0x4a')](_0x486845[_0x96675f]);});}delete _0x4362f1[_0x5585('0x7c')];});_0xec6964[_0x5585('0x7f')]=_0x316291;return _0xec6964;})[_0x5585('0x16')](respondWithFilteredResult(_0x3e9a70,_0x5f1685));})['catch'](handleError(_0x3e9a70,null));};exports['destroy']=function(_0x5bf5b8,_0x36eae8){return db[_0x5585('0x1d')][_0x5585('0x80')]({'where':{'id':_0x5bf5b8[_0x5585('0x81')]['id']}})[_0x5585('0x16')](handleEntityNotFound(_0x36eae8,null))[_0x5585('0x16')](removeEntity(_0x36eae8,null))[_0x5585('0x82')](handleError(_0x36eae8,null));};exports[_0x5585('0x1e')]=function(_0x41f197,_0xec86fd){return db[_0x5585('0x1d')][_0x5585('0x1e')]()[_0x5585('0x16')](function(_0x5137e5){delete _0x5137e5['tags'];for(var _0x26d09a=0x0;_0x26d09a=_0x55061c){_0x4bae3d=_0x55061c;_0x44370a=0xc8;}else{_0x44370a=0xce;}_0x5a6c3a[_0xb546('0x14')](_0x44370a);return _0x5a6c3a[_0xb546('0x15')](_0xb546('0x16'),_0x45abc6+'-'+_0x4bae3d+'/'+_0x55061c)[_0xb546('0x17')](_0x1a7610);}return null;};}function saveUpdates(_0x18bd14){return function(_0x54dacc){if(_0x54dacc){return _0x54dacc[_0xb546('0x18')](_0x18bd14)[_0xb546('0x19')](function(_0x31241d){return _0x31241d;});}return null;};}function removeEntity(_0xc8a273){return function(_0xa730c){if(_0xa730c){return _0xa730c[_0xb546('0x1a')]()[_0xb546('0x19')](function(){_0xc8a273[_0xb546('0x14')](0xcc)[_0xb546('0x1b')]();});}};}function handleEntityNotFound(_0x2fa4a7){return function(_0x2ad5c9){if(!_0x2ad5c9){_0x2fa4a7[_0xb546('0x1c')](0x194);}return _0x2ad5c9;};}function handleError(_0x1a1019,_0x53697d){_0x53697d=_0x53697d||0x1f4;return function(_0x4a9321){logger[_0xb546('0x1d')](_0x4a9321[_0xb546('0x1e')]);if(_0x4a9321[_0xb546('0x1f')]){delete _0x4a9321[_0xb546('0x1f')];}_0x1a1019[_0xb546('0x14')](_0x53697d)[_0xb546('0x20')](_0x4a9321);};}exports[_0xb546('0x21')]=function(_0x405a84,_0x1d6f1a){var _0x45ce12={},_0x39551f={},_0xa693e1={'count':0x0,'rows':[]};return db[_0xb546('0x22')][_0xb546('0x23')]()[_0xb546('0x19')](function(_0x30c6c0){var _0x2e1183=[];for(var _0x1c9761=0x0;_0x1c97610x1){_0x3135fc['or'](_0xb546('0x64'),qs['getFullTextValue'](_0x48649e),null);}else{if(qs[_0xb546('0x65')](_0x48649e)){_0x3135fc['or']('c.id\x20LIKE\x20?',_0x48649e+'%');_0x3135fc['or']('c.phone\x20LIKE\x20?',_0x48649e+'%');_0x3135fc['or'](_0xb546('0x66'),_0x48649e+'%');_0x3135fc['or'](_0xb546('0x67'),_0x48649e+'%');}else if(qs[_0xb546('0x68')](_0x48649e)){_0x3135fc['or']('c.email\x20LIKE\x20?',_0x48649e+'%');}else{_0x3135fc['or'](_0xb546('0x69'),'%'+_0x48649e+'%');_0x3135fc['or'](_0xb546('0x6a'),'%'+_0x48649e+'%');_0x3135fc['or'](_0xb546('0x6b'),'%'+_0x48649e+'%');}}}}_0x1fc3a0[_0xb546('0x36')](_0x3135fc);_0x1fc3a0[_0xb546('0x6c')](_0xb546('0x6d'));var _0xd92b30={'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]};var _0x5d74c9=_0x1fc3a0[_0xb546('0x6e')]()[_0xb546('0x39')](_0xb546('0x6d'));if(_0x45ce12[_0xb546('0x34')]){_0x45ce12[_0xb546('0x34')][_0xb546('0x4e')](function(_0x22bd0e){_0x1fc3a0[_0xb546('0x34')]('c.'+_0x22bd0e[0x0],_0x22bd0e[0x1]===_0xb546('0x6f')?![]:!![]);});}if(!_['isEmpty'](_0x149e94)){_0x1fc3a0[_0xb546('0x70')](_0x2a0dfd);_0x5d74c9[_0xb546('0x36')](_0xb546('0x71'),_0x149e94);}BPromise[_0xb546('0x72')]()[_0xb546('0x19')](function(){if(!_0x31b37c)return;if(_0x405a84[_0xb546('0x73')]['role']!==_0xb546('0x74'))return;if(!_['some'](_0x31b37c['conditions'],[_0xb546('0x39'),_0xb546('0x51')])){return _0x405a84[_0xb546('0x73')][_0xb546('0x75')]({'attributes':['id'],'raw':!![]})[_0xb546('0x19')](function(_0x506567){if(_['isEmpty'](_0x506567)){_0x5d74c9[_0xb546('0x36')]('c.ListId\x20IS\x20NULL');_0x1fc3a0['where'](_0xb546('0x76'));}else{_0x5d74c9['where'](_0xb546('0x5e'),_['map'](_0x506567,'id'));_0x1fc3a0[_0xb546('0x36')](_0xb546('0x5e'),_[_0xb546('0x4d')](_0x506567,'id'));}});}})['then'](function(){if(_0x405a84[_0xb546('0x73')][_0xb546('0x77')]===_0xb546('0x74')&&!_0x31b37c&&!_0x405a84[_0xb546('0x2e')][_0xb546('0x5d')])return[];return db['sequelize']['query'](_0x5d74c9[_0xb546('0x78')](),_0xd92b30);})['then'](function(_0x2667dd){_0xa693e1[_0xb546('0x11')]=_0x2667dd[_0xb546('0x25')];if(_0xa693e1['count']===0x0)return[];return db['sequelize'][_0xb546('0x2e')](_0x396c99[_0xb546('0x78')](),_0xd92b30)[_0xb546('0x19')](function(_0x2baf32){_0x1bed81=_[_0xb546('0x79')](_0x2baf32,'id');_0xd92b30=_['merge'](_0xd92b30,{'model':db[_0xb546('0x22')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x405a84[_0xb546('0x2e')][_0xb546('0x31')]){_0x45ce12['attributes']['forEach'](function(_0x220d45){_0x1fc3a0[_0xb546('0x39')]('c.'+_0x220d45);});}else{_0x1fc3a0['field'](_0xb546('0x6d'));_0x1fc3a0['field'](_0xb546('0x7a'));_0x1fc3a0[_0xb546('0x39')](_0xb546('0x7b'));_0x1fc3a0[_0xb546('0x39')](_0xb546('0x7c'));_0x1fc3a0[_0xb546('0x39')]('c.mobile');_0x1fc3a0[_0xb546('0x39')](_0xb546('0x7d'));_0x1fc3a0['field']('c.email');_0x1fc3a0[_0xb546('0x39')](_0xb546('0x7e'));_0x1fc3a0[_0xb546('0x39')](_0xb546('0x7f'));_0x1fc3a0[_0xb546('0x39')](_0xb546('0x80'));_0x1fc3a0[_0xb546('0x39')](_0xb546('0x81'));_0x1fc3a0[_0xb546('0x39')](_0xb546('0x82'),_0xb546('0x83'));}if(_0x45ce12['limit'])_0x1fc3a0[_0xb546('0x13')](_0x45ce12[_0xb546('0x13')]);if(_0x45ce12[_0xb546('0x12')])_0x1fc3a0[_0xb546('0x12')](_0x45ce12[_0xb546('0x12')]);return db['sequelize'][_0xb546('0x2e')](_0x1fc3a0[_0xb546('0x78')](),_0xd92b30);});})[_0xb546('0x19')](function(_0x2c09a0){_0x2c09a0[_0xb546('0x4e')](function(_0x1d8323){if(_0x1d8323['TagIds']){_0x1d8323[_0xb546('0x84')]=[];_0x1d8323[_0xb546('0x83')][_0xb546('0x4c')](',')[_0xb546('0x4e')](function(_0x550355){_0x1d8323[_0xb546('0x84')]['push'](_0x1bed81[_0x550355]);});}delete _0x1d8323[_0xb546('0x83')];});_0xa693e1[_0xb546('0x85')]=_0x2c09a0;return _0xa693e1;})['then'](respondWithFilteredResult(_0x1d6f1a,_0x45ce12));})[_0xb546('0x86')](handleError(_0x1d6f1a,null));};exports['destroy']=function(_0x5f51f1,_0x2490d9){return db['CmContact'][_0xb546('0x49')]({'where':{'id':_0x5f51f1[_0xb546('0x87')]['id']}})[_0xb546('0x19')](handleEntityNotFound(_0x2490d9,null))[_0xb546('0x19')](removeEntity(_0x2490d9,null))['catch'](handleError(_0x2490d9,null));};exports[_0xb546('0x23')]=function(_0x18f247,_0x2f6013){return db[_0xb546('0x22')][_0xb546('0x23')]()[_0xb546('0x19')](function(_0x7a9951){delete _0x7a9951[_0xb546('0x88')];for(var _0x2746fe=0x0;_0x2746fe{}\s\\|]/g,'-');_0x455097(null,util[_0x6b09('0x22')](_0x6b09('0x23'),path[_0x6b09('0x24')](_0x3d0370['originalname'],path[_0x6b09('0x25')](_0x3d0370[_0x6b09('0x21')])),Date[_0x6b09('0x26')](),path[_0x6b09('0x25')](_0x3d0370[_0x6b09('0x21')])));}})});router['post'](_0x6b09('0x27'),upload['single'](_0x6b09('0x28')),controller[_0x6b09('0x29')]);var upload=multer({'storage':multer[_0x6b09('0x2a')]({'destination':function(_0x3f9a32,_0x12b9f4,_0x409870){_0x409870(null,path['join'](config['root'],_0x6b09('0x20')));},'filename':function(_0x36fb6f,_0x2ce4b7,_0x237c7d){_0x2ce4b7['originalname']=_0x2ce4b7['originalname'][_0x6b09('0x2b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x237c7d(null,util['format'](_0x6b09('0x23'),path[_0x6b09('0x24')](_0x2ce4b7[_0x6b09('0x21')],path[_0x6b09('0x25')](_0x2ce4b7[_0x6b09('0x21')])),Date[_0x6b09('0x26')](),path[_0x6b09('0x25')](_0x2ce4b7[_0x6b09('0x21')])));}})});router[_0x6b09('0x19')](_0x6b09('0x2c'),upload[_0x6b09('0x2d')](_0x6b09('0x28')),controller[_0x6b09('0x2e')]);router[_0x6b09('0x19')](_0x6b09('0x2f'),auth[_0x6b09('0x8')](),controller[_0x6b09('0x30')]);router[_0x6b09('0x31')](_0x6b09('0xc'),auth['isAuthenticated'](),controller[_0x6b09('0x32')]);router['delete'](_0x6b09('0xc'),auth[_0x6b09('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x4594=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','isAuthenticated','index','/describe','/:id','/:id/tags','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperFinals','/:id/jscripty_sessions','/:id/journey','getJourney','post','/merge','merge','create','/create_many','bulkCreate','join','root','server/files/tmp','originalname','replace','%s-%s%s','basename','now','extname','uploadCsv','diskStorage','/upload','single','file','/upload/:id','import','update','delete'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x4594,0xc5));var _0x4459=function(_0x49dd96,_0x23b811){_0x49dd96=_0x49dd96-0x0;var _0x21228e=_0x4594[_0x49dd96];return _0x21228e;};'use strict';var multer=require(_0x4459('0x0'));var util=require(_0x4459('0x1'));var path=require('path');var timeout=require(_0x4459('0x2'));var express=require(_0x4459('0x3'));var router=express[_0x4459('0x4')]();var fs_extra=require(_0x4459('0x5'));var auth=require(_0x4459('0x6'));var interaction=require(_0x4459('0x7'));var config=require(_0x4459('0x8'));var controller=require(_0x4459('0x9'));router[_0x4459('0xa')]('/',auth[_0x4459('0xb')](),controller[_0x4459('0xc')]);router[_0x4459('0xa')](_0x4459('0xd'),auth[_0x4459('0xb')](),controller['describe']);router[_0x4459('0xa')](_0x4459('0xe'),auth[_0x4459('0xb')](),controller['show']);router['get'](_0x4459('0xf'),auth['isAuthenticated'](),controller[_0x4459('0x10')]);router[_0x4459('0xa')](_0x4459('0x11'),auth['isAuthenticated'](),controller[_0x4459('0x12')]);router[_0x4459('0xa')](_0x4459('0x13'),auth[_0x4459('0xb')](),controller['getHopperHistories']);router[_0x4459('0xa')]('/:id/hopper_finals',auth['isAuthenticated'](),controller[_0x4459('0x14')]);router[_0x4459('0xa')](_0x4459('0x15'),auth[_0x4459('0xb')](),controller['getJscriptySessions']);router[_0x4459('0xa')](_0x4459('0x16'),auth[_0x4459('0xb')](),controller[_0x4459('0x17')]);router[_0x4459('0x18')](_0x4459('0x19'),auth['isAuthenticated'](),controller[_0x4459('0x1a')]);router[_0x4459('0x18')]('/',auth[_0x4459('0xb')](),controller[_0x4459('0x1b')]);router[_0x4459('0x18')](_0x4459('0x1c'),auth[_0x4459('0xb')](),controller[_0x4459('0x1d')]);router[_0x4459('0x18')]('/:id/tags',auth[_0x4459('0xb')](),controller['setTags']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x461361,_0x134ee7,_0x521fe4){_0x521fe4(null,path[_0x4459('0x1e')](config[_0x4459('0x1f')],_0x4459('0x20')));},'filename':function(_0x44c752,_0x4048e5,_0x2a45b4){_0x4048e5[_0x4459('0x21')]=_0x4048e5[_0x4459('0x21')][_0x4459('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2a45b4(null,util['format'](_0x4459('0x23'),path[_0x4459('0x24')](_0x4048e5[_0x4459('0x21')],path['extname'](_0x4048e5[_0x4459('0x21')])),Date[_0x4459('0x25')](),path[_0x4459('0x26')](_0x4048e5['originalname'])));}})});router[_0x4459('0x18')]('/csv',upload['single']('file'),controller[_0x4459('0x27')]);var upload=multer({'storage':multer[_0x4459('0x28')]({'destination':function(_0x230533,_0x5a67bc,_0x18aadc){_0x18aadc(null,path['join'](config[_0x4459('0x1f')],_0x4459('0x20')));},'filename':function(_0x3061e2,_0x39ba05,_0x48c845){_0x39ba05[_0x4459('0x21')]=_0x39ba05[_0x4459('0x21')][_0x4459('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x48c845(null,util['format'](_0x4459('0x23'),path[_0x4459('0x24')](_0x39ba05['originalname'],path[_0x4459('0x26')](_0x39ba05[_0x4459('0x21')])),Date['now'](),path[_0x4459('0x26')](_0x39ba05[_0x4459('0x21')])));}})});router[_0x4459('0x18')](_0x4459('0x29'),upload[_0x4459('0x2a')](_0x4459('0x2b')),controller['upload']);router[_0x4459('0x18')](_0x4459('0x2c'),auth[_0x4459('0xb')](),controller[_0x4459('0x2d')]);router['put'](_0x4459('0xe'),auth[_0x4459('0xb')](),controller[_0x4459('0x2e')]);router[_0x4459('0x2f')](_0x4459('0xe'),auth[_0x4459('0xb')](),controller['destroy']);module[_0x4459('0x30')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 252bd04..7181466 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 _0x9cda=['exports','VIRTUAL','getDataValue','alias','name','STRING','TEXT','long','type','select','values','isArray','setDataValue','stringify','BOOLEAN','ENUM','voice','sequelize','lodash'];(function(_0xb1a861,_0x3d5de1){var _0x10ed93=function(_0x744869){while(--_0x744869){_0xb1a861['push'](_0xb1a861['shift']());}};_0x10ed93(++_0x3d5de1);}(_0x9cda,0xbc));var _0xa9cd=function(_0x5b6aca,_0x4cba88){_0x5b6aca=_0x5b6aca-0x0;var _0x59c26d=_0x9cda[_0x5b6aca];return _0x59c26d;};'use strict';var Sequelize=require(_0xa9cd('0x0'));var _=require(_0xa9cd('0x1'));module[_0xa9cd('0x2')]={'name':{'type':Sequelize[_0xa9cd('0x3')],'get':function(_0x5bdc69){return this[_0xa9cd('0x4')](_0xa9cd('0x5'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x6a2317){this['setDataValue'](_0xa9cd('0x5'),_0x6a2317?_0x6a2317:this['getDataValue'](_0xa9cd('0x6')));}},'type':{'type':Sequelize[_0xa9cd('0x7')],'allowNull':![]},'values':{'type':Sequelize[_0xa9cd('0x8')](_0xa9cd('0x9')),'get':function(){if(this['getDataValue'](_0xa9cd('0xa'))===_0xa9cd('0xb')){return JSON['parse'](this[_0xa9cd('0x4')](_0xa9cd('0xc')));}else{return this[_0xa9cd('0x4')](_0xa9cd('0xc'));}},'set':function(_0x3565e1){if(Array[_0xa9cd('0xd')](_0x3565e1)){this[_0xa9cd('0xe')](_0xa9cd('0xc'),JSON[_0xa9cd('0xf')](_0x3565e1));}else{this[_0xa9cd('0xe')](_0xa9cd('0xc'),_0x3565e1);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xa9cd('0x10')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xa9cd('0x11')](_0xa9cd('0x12'))}}; \ No newline at end of file +var _0x08fd=['lodash','exports','VIRTUAL','getDataValue','alias','setDataValue','TEXT','type','select','parse','values','stringify','BOOLEAN','ENUM','sequelize'];(function(_0x4f140e,_0x574bee){var _0x357343=function(_0x489ebc){while(--_0x489ebc){_0x4f140e['push'](_0x4f140e['shift']());}};_0x357343(++_0x574bee);}(_0x08fd,0x11c));var _0xd08f=function(_0x4c4101,_0x55ee5d){_0x4c4101=_0x4c4101-0x0;var _0x455c81=_0x08fd[_0x4c4101];return _0x455c81;};'use strict';var Sequelize=require(_0xd08f('0x0'));var _=require(_0xd08f('0x1'));module[_0xd08f('0x2')]={'name':{'type':Sequelize[_0xd08f('0x3')],'get':function(_0x133a92){return this[_0xd08f('0x4')](_0xd08f('0x5'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x4ab7c1){this[_0xd08f('0x6')](_0xd08f('0x5'),_0x4ab7c1?_0x4ab7c1:this['getDataValue']('name'));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0xd08f('0x7')]('long'),'get':function(){if(this['getDataValue'](_0xd08f('0x8'))===_0xd08f('0x9')){return JSON[_0xd08f('0xa')](this[_0xd08f('0x4')](_0xd08f('0xb')));}else{return this['getDataValue'](_0xd08f('0xb'));}},'set':function(_0x39a4d1){if(Array['isArray'](_0x39a4d1)){this['setDataValue'](_0xd08f('0xb'),JSON[_0xd08f('0xc')](_0x39a4d1));}else{this['setDataValue']('values',_0x39a4d1);}}},'required':{'type':Sequelize[_0xd08f('0xd')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xd08f('0xd')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xd08f('0xe')]('voice')}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index b7878e6..9c01835 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 _0x26a1=['params','body','find','create','sequelize','transaction','Sequelize','text','number','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','lodash','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','limit','undefined','count','reject','save','update','then','destroy','end','error','stack','name','send','map','CmCustomField','rawAttributes','fieldName','type','model','differenceBy','query','keys','filters','intersection','fields','attributes','length','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x26a1,0x10a));var _0x126a=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x26a1[_0x55f8b4];return _0x2475f9;};'use strict';var emlformat=require(_0x126a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x126a('0x1'));var jsonpatch=require(_0x126a('0x2'));var rp=require(_0x126a('0x3'));var moment=require(_0x126a('0x4'));var BPromise=require(_0x126a('0x5'));var Mustache=require('mustache');var util=require(_0x126a('0x6'));var path=require(_0x126a('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x126a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x126a('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x126a('0xa'));var deskjs=require(_0x126a('0xb'));var toCsv=require(_0x126a('0xc'));var querystring=require('querystring');var Papa=require(_0x126a('0xd'));var Redis=require(_0x126a('0xe'));var authService=require(_0x126a('0xf'));var qs=require(_0x126a('0x10'));var as=require(_0x126a('0x11'));var hardwareService=require(_0x126a('0x12'));var logger=require(_0x126a('0x13'))(_0x126a('0x14'));var utils=require(_0x126a('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x126a('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x506c6a,_0x395ac9){_0x395ac9=_0x395ac9||0xcc;return function(_0x354b7f){if(_0x354b7f){return _0x506c6a[_0x126a('0x17')](_0x395ac9);}return _0x506c6a['status'](_0x395ac9)['end']();};}function respondWithResult(_0x22673e,_0x25b172){_0x25b172=_0x25b172||0xc8;return function(_0x30bc92){if(_0x30bc92){return _0x22673e[_0x126a('0x18')](_0x25b172)[_0x126a('0x19')](_0x30bc92);}};}function respondWithFilteredResult(_0x3b7438,_0x28d9c2){return function(_0x51e621){if(_0x51e621){var _0x20e1d2=typeof _0x28d9c2[_0x126a('0x1a')]==='undefined'&&typeof _0x28d9c2[_0x126a('0x1b')]===_0x126a('0x1c');var _0x5d19e4=_0x51e621['count'];var _0x229668=_0x20e1d2?0x0:_0x28d9c2[_0x126a('0x1a')];var _0x5180bd=_0x20e1d2?_0x51e621[_0x126a('0x1d')]:_0x28d9c2[_0x126a('0x1a')]+_0x28d9c2[_0x126a('0x1b')];var _0x3831a7;if(_0x5180bd>=_0x5d19e4){_0x5180bd=_0x5d19e4;_0x3831a7=0xc8;}else{_0x3831a7=0xce;}_0x3b7438[_0x126a('0x18')](_0x3831a7);return _0x3b7438['set']('Content-Range',_0x229668+'-'+_0x5180bd+'/'+_0x5d19e4)['json'](_0x51e621);}return null;};}function patchUpdates(_0x47b225){return function(_0x20f695){try{jsonpatch['apply'](_0x20f695,_0x47b225,!![]);}catch(_0x530098){return BPromise[_0x126a('0x1e')](_0x530098);}return _0x20f695[_0x126a('0x1f')]();};}function saveUpdates(_0x32921c,_0x23deb0){return function(_0x4cdc6a){if(_0x4cdc6a){return _0x4cdc6a[_0x126a('0x20')](_0x32921c)[_0x126a('0x21')](function(_0x8b6a0d){return _0x8b6a0d;});}return null;};}function removeEntity(_0x31ea14,_0x3e18cc){return function(_0xef9d1e){if(_0xef9d1e){return _0xef9d1e[_0x126a('0x22')]()[_0x126a('0x21')](function(){_0x31ea14['status'](0xcc)[_0x126a('0x23')]();});}};}function handleEntityNotFound(_0x33f8a9,_0x1f1676){return function(_0x40899f){if(!_0x40899f){_0x33f8a9['sendStatus'](0x194);}return _0x40899f;};}function handleError(_0x7982b,_0x39b38e){_0x39b38e=_0x39b38e||0x1f4;return function(_0x2f8737){logger[_0x126a('0x24')](_0x2f8737[_0x126a('0x25')]);if(_0x2f8737['name']){delete _0x2f8737[_0x126a('0x26')];}_0x7982b[_0x126a('0x18')](_0x39b38e)[_0x126a('0x27')](_0x2f8737);};}exports['index']=function(_0x5d4dd9,_0x5a8ebd){var _0x4edb74={},_0x49f974={},_0x50deef={'count':0x0,'rows':[]};var _0x1831b5=_[_0x126a('0x28')](db[_0x126a('0x29')][_0x126a('0x2a')],function(_0xadeb82){return{'name':_0xadeb82[_0x126a('0x2b')],'type':_0xadeb82[_0x126a('0x2c')]['key']};});_0x49f974[_0x126a('0x2d')]=_[_0x126a('0x2e')](_[_0x126a('0x28')](_0x1831b5,_0x126a('0x26')),[_0x126a('0x26')]);_0x49f974[_0x126a('0x2f')]=_[_0x126a('0x30')](_0x5d4dd9[_0x126a('0x2f')]);_0x49f974[_0x126a('0x31')]=_[_0x126a('0x32')](_0x49f974[_0x126a('0x2d')],_0x49f974[_0x126a('0x2f')]);_0x4edb74['attributes']=_[_0x126a('0x32')](_0x49f974[_0x126a('0x2d')],qs['fields'](_0x5d4dd9[_0x126a('0x2f')][_0x126a('0x33')]));_0x4edb74[_0x126a('0x34')]=_0x4edb74['attributes'][_0x126a('0x35')]?_0x4edb74[_0x126a('0x34')]:_0x49f974[_0x126a('0x2d')];if(!_0x5d4dd9['query']['hasOwnProperty']('nolimit')){_0x4edb74[_0x126a('0x1b')]=qs['limit'](_0x5d4dd9[_0x126a('0x2f')]['limit']);_0x4edb74[_0x126a('0x1a')]=qs[_0x126a('0x1a')](_0x5d4dd9['query'][_0x126a('0x1a')]);}_0x4edb74[_0x126a('0x36')]=qs[_0x126a('0x37')](_0x5d4dd9[_0x126a('0x2f')][_0x126a('0x37')]);_0x4edb74[_0x126a('0x38')]=qs[_0x126a('0x31')](_[_0x126a('0x39')](_0x5d4dd9['query'],_0x49f974[_0x126a('0x31')]),_0x1831b5);if(_0x5d4dd9[_0x126a('0x2f')]['filter']){_0x4edb74[_0x126a('0x38')]=_[_0x126a('0x3a')](_0x4edb74[_0x126a('0x38')],{'$or':_['map'](_0x1831b5,function(_0x2b978d){if(_0x2b978d[_0x126a('0x2c')]!==_0x126a('0x3b')){var _0x2d106d={};_0x2d106d[_0x2b978d[_0x126a('0x26')]]={'$like':'%'+_0x5d4dd9[_0x126a('0x2f')]['filter']+'%'};return _0x2d106d;}})});}_0x4edb74=_[_0x126a('0x3a')]({},_0x4edb74,_0x5d4dd9[_0x126a('0x3c')]);var _0xdb8ed8={'where':_0x4edb74['where']};return db[_0x126a('0x29')][_0x126a('0x1d')](_0xdb8ed8)[_0x126a('0x21')](function(_0x46c943){_0x50deef[_0x126a('0x1d')]=_0x46c943;if(_0x5d4dd9['query'][_0x126a('0x3d')]){_0x4edb74[_0x126a('0x3e')]=[{'all':!![]}];}return db[_0x126a('0x29')][_0x126a('0x3f')](_0x4edb74);})[_0x126a('0x21')](function(_0x574ed7){_0x50deef[_0x126a('0x40')]=_0x574ed7;return _0x50deef;})[_0x126a('0x21')](respondWithFilteredResult(_0x5a8ebd,_0x4edb74))[_0x126a('0x41')](handleError(_0x5a8ebd,null));};exports['show']=function(_0x365933,_0x13433f){var _0x13d1fb={'raw':!![],'where':{'id':_0x365933[_0x126a('0x42')]['id']}},_0x56589d={};_0x56589d[_0x126a('0x2d')]=_[_0x126a('0x30')](db['CmCustomField'][_0x126a('0x2a')]);_0x56589d[_0x126a('0x2f')]=_[_0x126a('0x30')](_0x365933[_0x126a('0x2f')]);_0x56589d['filters']=_[_0x126a('0x32')](_0x56589d[_0x126a('0x2d')],_0x56589d[_0x126a('0x2f')]);_0x13d1fb[_0x126a('0x34')]=_[_0x126a('0x32')](_0x56589d[_0x126a('0x2d')],qs[_0x126a('0x33')](_0x365933[_0x126a('0x2f')][_0x126a('0x33')]));_0x13d1fb[_0x126a('0x34')]=_0x13d1fb[_0x126a('0x34')][_0x126a('0x35')]?_0x13d1fb[_0x126a('0x34')]:_0x56589d['model'];if(_0x365933[_0x126a('0x2f')][_0x126a('0x3d')]){_0x13d1fb[_0x126a('0x3e')]=[{'all':!![]}];}_0x13d1fb=_[_0x126a('0x3a')]({},_0x13d1fb,_0x365933[_0x126a('0x3c')]);return db[_0x126a('0x29')]['find'](_0x13d1fb)['then'](handleEntityNotFound(_0x13433f,null))[_0x126a('0x21')](respondWithResult(_0x13433f,null))[_0x126a('0x41')](handleError(_0x13433f,null));};exports[_0x126a('0x20')]=function(_0xd442ac,_0xd655f0){if(_0xd442ac[_0x126a('0x43')]['id']){delete _0xd442ac['body']['id'];}return db[_0x126a('0x29')][_0x126a('0x44')]({'where':{'id':_0xd442ac['params']['id']}})['then'](handleEntityNotFound(_0xd655f0,null))[_0x126a('0x21')](saveUpdates(_0xd442ac[_0x126a('0x43')],null))[_0x126a('0x21')](respondWithResult(_0xd655f0,null))[_0x126a('0x41')](handleError(_0xd655f0,null));};exports['destroy']=function(_0x323621,_0x2ef492){return db['CmCustomField'][_0x126a('0x44')]({'where':{'id':_0x323621[_0x126a('0x42')]['id']}})['then'](handleEntityNotFound(_0x2ef492,null))[_0x126a('0x21')](removeEntity(_0x2ef492,null))[_0x126a('0x41')](handleError(_0x2ef492,null));};exports[_0x126a('0x45')]=function(_0x8e612,_0x2ab04a){var _0x4a2c66;return db[_0x126a('0x46')][_0x126a('0x47')](function(_0x1ff2cf){return db[_0x126a('0x29')][_0x126a('0x45')](_0x8e612[_0x126a('0x43')],{'transaction':_0x1ff2cf})[_0x126a('0x21')](function(_0x2ae372){_0x4a2c66=_0x2ae372;var _0x5269d6={'type':db[_0x126a('0x48')]['TEXT'],'transaction':_0x1ff2cf};switch(_0x8e612[_0x126a('0x43')]['type']){case _0x126a('0x49'):_0x5269d6[_0x126a('0x2c')]=db['Sequelize']['TEXT'];break;case _0x126a('0x4a'):_0x5269d6[_0x126a('0x2c')]=db['Sequelize']['INTEGER'];break;case _0x126a('0x4b'):_0x5269d6['type']=db['Sequelize'][_0x126a('0x4c')];_0x5269d6[_0x126a('0x4d')]=![];break;default:}return db['sequelize'][_0x126a('0x4e')][_0x126a('0x4f')](_0x126a('0x50'),util[_0x126a('0x51')](_0x126a('0x52'),_0x4a2c66['id']),_0x5269d6);})[_0x126a('0x21')](function(){return _0x4a2c66;});})[_0x126a('0x21')](respondWithResult(_0x2ab04a,0xc9))[_0x126a('0x41')](handleError(_0x2ab04a,null));}; \ No newline at end of file +var _0xb6c0=['cm_contacts','format','cf_%d','eml-format','rimraf','zip-dir','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','stack','name','send','index','map','CmCustomField','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','keys','find','body','sequelize','create','Sequelize','TEXT','number','INTEGER','switch','BOOLEAN','defaultValue','addColumn'];(function(_0x4b1032,_0x36952e){var _0x5a1d55=function(_0x282e9b){while(--_0x282e9b){_0x4b1032['push'](_0x4b1032['shift']());}};_0x5a1d55(++_0x36952e);}(_0xb6c0,0x1a7));var _0x0b6c=function(_0x5b3ea1,_0xe89350){_0x5b3ea1=_0x5b3ea1-0x0;var _0x47b9d5=_0xb6c0[_0x5b3ea1];return _0x47b9d5;};'use strict';var emlformat=require(_0x0b6c('0x0'));var rimraf=require(_0x0b6c('0x1'));var zipdir=require(_0x0b6c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0b6c('0x3'));var Mustache=require(_0x0b6c('0x4'));var util=require('util');var path=require(_0x0b6c('0x5'));var sox=require(_0x0b6c('0x6'));var csv=require(_0x0b6c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0b6c('0x8'));var _=require(_0x0b6c('0x9'));var squel=require('squel');var crypto=require(_0x0b6c('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0b6c('0x7'));var querystring=require('querystring');var Papa=require(_0x0b6c('0xb'));var Redis=require(_0x0b6c('0xc'));var authService=require(_0x0b6c('0xd'));var qs=require(_0x0b6c('0xe'));var as=require(_0x0b6c('0xf'));var hardwareService=require(_0x0b6c('0x10'));var logger=require(_0x0b6c('0x11'))(_0x0b6c('0x12'));var utils=require(_0x0b6c('0x13'));var config=require(_0x0b6c('0x14'));var licenseUtil=require(_0x0b6c('0x15'));var db=require(_0x0b6c('0x16'))['db'];function respondWithStatusCode(_0x2671fb,_0x290952){_0x290952=_0x290952||0xcc;return function(_0x45c438){if(_0x45c438){return _0x2671fb[_0x0b6c('0x17')](_0x290952);}return _0x2671fb[_0x0b6c('0x18')](_0x290952)[_0x0b6c('0x19')]();};}function respondWithResult(_0x4fbef9,_0x13eb39){_0x13eb39=_0x13eb39||0xc8;return function(_0x20cb68){if(_0x20cb68){return _0x4fbef9[_0x0b6c('0x18')](_0x13eb39)[_0x0b6c('0x1a')](_0x20cb68);}};}function respondWithFilteredResult(_0x2a289f,_0x56c94b){return function(_0xfdaa52){if(_0xfdaa52){var _0x19d761=typeof _0x56c94b[_0x0b6c('0x1b')]===_0x0b6c('0x1c')&&typeof _0x56c94b['limit']===_0x0b6c('0x1c');var _0x5532b2=_0xfdaa52['count'];var _0x37f8de=_0x19d761?0x0:_0x56c94b[_0x0b6c('0x1b')];var _0x2b066c=_0x19d761?_0xfdaa52[_0x0b6c('0x1d')]:_0x56c94b[_0x0b6c('0x1b')]+_0x56c94b[_0x0b6c('0x1e')];var _0x51c304;if(_0x2b066c>=_0x5532b2){_0x2b066c=_0x5532b2;_0x51c304=0xc8;}else{_0x51c304=0xce;}_0x2a289f[_0x0b6c('0x18')](_0x51c304);return _0x2a289f[_0x0b6c('0x1f')]('Content-Range',_0x37f8de+'-'+_0x2b066c+'/'+_0x5532b2)['json'](_0xfdaa52);}return null;};}function patchUpdates(_0x1478a8){return function(_0x48fe54){try{jsonpatch[_0x0b6c('0x20')](_0x48fe54,_0x1478a8,!![]);}catch(_0x574329){return BPromise[_0x0b6c('0x21')](_0x574329);}return _0x48fe54[_0x0b6c('0x22')]();};}function saveUpdates(_0x4bc626,_0x206eda){return function(_0x6fcc3f){if(_0x6fcc3f){return _0x6fcc3f[_0x0b6c('0x23')](_0x4bc626)[_0x0b6c('0x24')](function(_0x1dc2df){return _0x1dc2df;});}return null;};}function removeEntity(_0x4482bd,_0x3083c3){return function(_0x2e282e){if(_0x2e282e){return _0x2e282e[_0x0b6c('0x25')]()['then'](function(){_0x4482bd[_0x0b6c('0x18')](0xcc)[_0x0b6c('0x19')]();});}};}function handleEntityNotFound(_0x206efa,_0x5a685e){return function(_0x5ea2cc){if(!_0x5ea2cc){_0x206efa[_0x0b6c('0x17')](0x194);}return _0x5ea2cc;};}function handleError(_0x55029c,_0xfbd37b){_0xfbd37b=_0xfbd37b||0x1f4;return function(_0x15695e){logger['error'](_0x15695e[_0x0b6c('0x26')]);if(_0x15695e[_0x0b6c('0x27')]){delete _0x15695e[_0x0b6c('0x27')];}_0x55029c[_0x0b6c('0x18')](_0xfbd37b)[_0x0b6c('0x28')](_0x15695e);};}exports[_0x0b6c('0x29')]=function(_0x29467e,_0x124260){var _0xfe481a={},_0x1071fb={},_0x5e88fe={'count':0x0,'rows':[]};var _0x1d4ef2=_[_0x0b6c('0x2a')](db[_0x0b6c('0x2b')][_0x0b6c('0x2c')],function(_0x29a9c5){return{'name':_0x29a9c5[_0x0b6c('0x2d')],'type':_0x29a9c5[_0x0b6c('0x2e')]['key']};});_0x1071fb[_0x0b6c('0x2f')]=_['differenceBy'](_[_0x0b6c('0x2a')](_0x1d4ef2,_0x0b6c('0x27')),[_0x0b6c('0x27')]);_0x1071fb[_0x0b6c('0x30')]=_['keys'](_0x29467e[_0x0b6c('0x30')]);_0x1071fb['filters']=_[_0x0b6c('0x31')](_0x1071fb[_0x0b6c('0x2f')],_0x1071fb[_0x0b6c('0x30')]);_0xfe481a[_0x0b6c('0x32')]=_[_0x0b6c('0x31')](_0x1071fb[_0x0b6c('0x2f')],qs[_0x0b6c('0x33')](_0x29467e[_0x0b6c('0x30')][_0x0b6c('0x33')]));_0xfe481a[_0x0b6c('0x32')]=_0xfe481a[_0x0b6c('0x32')][_0x0b6c('0x34')]?_0xfe481a['attributes']:_0x1071fb['model'];if(!_0x29467e[_0x0b6c('0x30')][_0x0b6c('0x35')](_0x0b6c('0x36'))){_0xfe481a['limit']=qs['limit'](_0x29467e[_0x0b6c('0x30')]['limit']);_0xfe481a['offset']=qs['offset'](_0x29467e[_0x0b6c('0x30')]['offset']);}_0xfe481a[_0x0b6c('0x37')]=qs[_0x0b6c('0x38')](_0x29467e[_0x0b6c('0x30')][_0x0b6c('0x38')]);_0xfe481a['where']=qs[_0x0b6c('0x39')](_['pick'](_0x29467e[_0x0b6c('0x30')],_0x1071fb[_0x0b6c('0x39')]),_0x1d4ef2);if(_0x29467e[_0x0b6c('0x30')][_0x0b6c('0x3a')]){_0xfe481a[_0x0b6c('0x3b')]=_[_0x0b6c('0x3c')](_0xfe481a[_0x0b6c('0x3b')],{'$or':_[_0x0b6c('0x2a')](_0x1d4ef2,function(_0x3e1413){if(_0x3e1413[_0x0b6c('0x2e')]!==_0x0b6c('0x3d')){var _0x16955b={};_0x16955b[_0x3e1413['name']]={'$like':'%'+_0x29467e[_0x0b6c('0x30')][_0x0b6c('0x3a')]+'%'};return _0x16955b;}})});}_0xfe481a=_[_0x0b6c('0x3c')]({},_0xfe481a,_0x29467e[_0x0b6c('0x3e')]);var _0x5a23c9={'where':_0xfe481a[_0x0b6c('0x3b')]};return db['CmCustomField'][_0x0b6c('0x1d')](_0x5a23c9)[_0x0b6c('0x24')](function(_0x3bf2c1){_0x5e88fe[_0x0b6c('0x1d')]=_0x3bf2c1;if(_0x29467e[_0x0b6c('0x30')][_0x0b6c('0x3f')]){_0xfe481a[_0x0b6c('0x40')]=[{'all':!![]}];}return db[_0x0b6c('0x2b')][_0x0b6c('0x41')](_0xfe481a);})[_0x0b6c('0x24')](function(_0x37e208){_0x5e88fe['rows']=_0x37e208;return _0x5e88fe;})[_0x0b6c('0x24')](respondWithFilteredResult(_0x124260,_0xfe481a))[_0x0b6c('0x42')](handleError(_0x124260,null));};exports['show']=function(_0x51e6bd,_0x137116){var _0x109735={'raw':!![],'where':{'id':_0x51e6bd[_0x0b6c('0x43')]['id']}},_0x261716={};_0x261716['model']=_[_0x0b6c('0x44')](db[_0x0b6c('0x2b')][_0x0b6c('0x2c')]);_0x261716[_0x0b6c('0x30')]=_['keys'](_0x51e6bd[_0x0b6c('0x30')]);_0x261716['filters']=_[_0x0b6c('0x31')](_0x261716[_0x0b6c('0x2f')],_0x261716[_0x0b6c('0x30')]);_0x109735['attributes']=_['intersection'](_0x261716[_0x0b6c('0x2f')],qs[_0x0b6c('0x33')](_0x51e6bd['query'][_0x0b6c('0x33')]));_0x109735[_0x0b6c('0x32')]=_0x109735[_0x0b6c('0x32')]['length']?_0x109735[_0x0b6c('0x32')]:_0x261716[_0x0b6c('0x2f')];if(_0x51e6bd[_0x0b6c('0x30')][_0x0b6c('0x3f')]){_0x109735[_0x0b6c('0x40')]=[{'all':!![]}];}_0x109735=_['merge']({},_0x109735,_0x51e6bd[_0x0b6c('0x3e')]);return db[_0x0b6c('0x2b')][_0x0b6c('0x45')](_0x109735)[_0x0b6c('0x24')](handleEntityNotFound(_0x137116,null))[_0x0b6c('0x24')](respondWithResult(_0x137116,null))[_0x0b6c('0x42')](handleError(_0x137116,null));};exports[_0x0b6c('0x23')]=function(_0x4a2498,_0x191862){if(_0x4a2498['body']['id']){delete _0x4a2498[_0x0b6c('0x46')]['id'];}return db['CmCustomField'][_0x0b6c('0x45')]({'where':{'id':_0x4a2498[_0x0b6c('0x43')]['id']}})[_0x0b6c('0x24')](handleEntityNotFound(_0x191862,null))[_0x0b6c('0x24')](saveUpdates(_0x4a2498['body'],null))[_0x0b6c('0x24')](respondWithResult(_0x191862,null))[_0x0b6c('0x42')](handleError(_0x191862,null));};exports[_0x0b6c('0x25')]=function(_0x196721,_0x2f6702){return db[_0x0b6c('0x2b')]['find']({'where':{'id':_0x196721['params']['id']}})['then'](handleEntityNotFound(_0x2f6702,null))[_0x0b6c('0x24')](removeEntity(_0x2f6702,null))[_0x0b6c('0x42')](handleError(_0x2f6702,null));};exports['create']=function(_0x392048,_0x19f03e){var _0x18ce18;return db[_0x0b6c('0x47')]['transaction'](function(_0x17f6bb){return db[_0x0b6c('0x2b')][_0x0b6c('0x48')](_0x392048[_0x0b6c('0x46')],{'transaction':_0x17f6bb})[_0x0b6c('0x24')](function(_0x530153){_0x18ce18=_0x530153;var _0x261a20={'type':db[_0x0b6c('0x49')][_0x0b6c('0x4a')],'transaction':_0x17f6bb};switch(_0x392048[_0x0b6c('0x46')][_0x0b6c('0x2e')]){case'text':_0x261a20[_0x0b6c('0x2e')]=db[_0x0b6c('0x49')]['TEXT'];break;case _0x0b6c('0x4b'):_0x261a20[_0x0b6c('0x2e')]=db[_0x0b6c('0x49')][_0x0b6c('0x4c')];break;case _0x0b6c('0x4d'):_0x261a20['type']=db['Sequelize'][_0x0b6c('0x4e')];_0x261a20[_0x0b6c('0x4f')]=![];break;default:}return db[_0x0b6c('0x47')]['queryInterface'][_0x0b6c('0x50')](_0x0b6c('0x51'),util[_0x0b6c('0x52')](_0x0b6c('0x53'),_0x18ce18['id']),_0x261a20);})[_0x0b6c('0x24')](function(){return _0x18ce18;});})[_0x0b6c('0x24')](respondWithResult(_0x19f03e,0xc9))['catch'](handleError(_0x19f03e,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 577d46a..d8604a1 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 _0x7cb7=['../../config/logger','api','moment','exports','define','CmCustomField','cm_custom_fields','lodash','util'];(function(_0x96602e,_0x3d75d4){var _0x5c004d=function(_0x1432ba){while(--_0x1432ba){_0x96602e['push'](_0x96602e['shift']());}};_0x5c004d(++_0x3d75d4);}(_0x7cb7,0xfa));var _0x77cb=function(_0x185a9f,_0x5d995a){_0x185a9f=_0x185a9f-0x0;var _0x4536e8=_0x7cb7[_0x185a9f];return _0x4536e8;};'use strict';var _=require(_0x77cb('0x0'));var util=require(_0x77cb('0x1'));var logger=require(_0x77cb('0x2'))(_0x77cb('0x3'));var moment=require(_0x77cb('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('../../config/environment');var attributes=require('./cmCustomField.attributes');module[_0x77cb('0x5')]=function(_0x5f221a,_0x1f9988){return _0x5f221a[_0x77cb('0x6')](_0x77cb('0x7'),attributes,{'tableName':_0x77cb('0x8'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc5f7=['./cmCustomField.attributes','define','CmCustomField','cm_custom_fields','util','../../config/logger','moment','path','rimraf','../../config/environment'];(function(_0x2a314e,_0x1a91a2){var _0x2394fc=function(_0x371733){while(--_0x371733){_0x2a314e['push'](_0x2a314e['shift']());}};_0x2394fc(++_0x1a91a2);}(_0xc5f7,0xc2));var _0x7c5f=function(_0x463b25,_0x256214){_0x463b25=_0x463b25-0x0;var _0x503656=_0xc5f7[_0x463b25];return _0x503656;};'use strict';var _=require('lodash');var util=require(_0x7c5f('0x0'));var logger=require(_0x7c5f('0x1'))('api');var moment=require(_0x7c5f('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7c5f('0x3'));var rimraf=require(_0x7c5f('0x4'));var config=require(_0x7c5f('0x5'));var attributes=require(_0x7c5f('0x6'));module['exports']=function(_0x537cbb,_0x181e00){return _0x537cbb[_0x7c5f('0x7')](_0x7c5f('0x8'),attributes,{'tableName':_0x7c5f('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index 93dc6c4..a78c0ac 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 _0x83fe=['lodash','util','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','CmCustomField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x12baed,_0x45a719){var _0x630772=function(_0x449242){while(--_0x449242){_0x12baed['push'](_0x12baed['shift']());}};_0x630772(++_0x45a719);}(_0x83fe,0x1b8));var _0xe83f=function(_0x3d641a,_0x213a8b){_0x3d641a=_0x3d641a-0x0;var _0xa071a9=_0x83fe[_0x3d641a];return _0xa071a9;};'use strict';var _=require(_0xe83f('0x0'));var util=require(_0xe83f('0x1'));var moment=require('moment');var BPromise=require(_0xe83f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe83f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe83f('0x4'));var logger=require('../../config/logger')(_0xe83f('0x5'));var config=require(_0xe83f('0x6'));var jayson=require(_0xe83f('0x7'));var client=jayson[_0xe83f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x675479,_0xc4ff2,_0x4a1637){return new BPromise(function(_0x13b737,_0xf0db72){return client[_0xe83f('0x9')](_0x675479,_0x4a1637)[_0xe83f('0xa')](function(_0x59a9f8){logger[_0xe83f('0xb')](_0xe83f('0xc'),_0xc4ff2,_0xe83f('0xd'));logger['debug'](_0xe83f('0xe'),_0xc4ff2,_0xe83f('0xd'),JSON['stringify'](_0x59a9f8));if(_0x59a9f8[_0xe83f('0xf')]){if(_0x59a9f8[_0xe83f('0xf')][_0xe83f('0x10')]===0x1f4){logger[_0xe83f('0xf')]('CmCustomField,\x20%s,\x20%s',_0xc4ff2,_0x59a9f8[_0xe83f('0xf')]['message']);return _0xf0db72(_0x59a9f8[_0xe83f('0xf')]['message']);}logger[_0xe83f('0xf')](_0xe83f('0xc'),_0xc4ff2,_0x59a9f8[_0xe83f('0xf')][_0xe83f('0x11')]);return _0x13b737(_0x59a9f8[_0xe83f('0xf')][_0xe83f('0x11')]);}else{logger[_0xe83f('0xb')](_0xe83f('0xc'),_0xc4ff2,_0xe83f('0xd'));_0x13b737(_0x59a9f8[_0xe83f('0x12')][_0xe83f('0x11')]);}})[_0xe83f('0x13')](function(_0x4bd53d){logger[_0xe83f('0xf')](_0xe83f('0xc'),_0xc4ff2,_0x4bd53d);_0xf0db72(_0x4bd53d);});});} \ No newline at end of file +var _0xf63b=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','then','info','CmCustomField,\x20%s,\x20%s','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf63b,0x71));var _0xbf63=function(_0x1e3b9f,_0x279c19){_0x1e3b9f=_0x1e3b9f-0x0;var _0x574bf0=_0xf63b[_0x1e3b9f];return _0x574bf0;};'use strict';var _=require(_0xbf63('0x0'));var util=require(_0xbf63('0x1'));var moment=require(_0xbf63('0x2'));var BPromise=require(_0xbf63('0x3'));var rs=require(_0xbf63('0x4'));var fs=require('fs');var Redis=require(_0xbf63('0x5'));var db=require(_0xbf63('0x6'))['db'];var utils=require(_0xbf63('0x7'));var logger=require(_0xbf63('0x8'))('rpc');var config=require(_0xbf63('0x9'));var jayson=require(_0xbf63('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x325227,_0x2a7066,_0x2c7a01){return new BPromise(function(_0x6f66b0,_0x3ce7cd){return client['request'](_0x325227,_0x2c7a01)[_0xbf63('0xb')](function(_0x17e554){logger[_0xbf63('0xc')](_0xbf63('0xd'),_0x2a7066,'request\x20sent');logger[_0xbf63('0xe')](_0xbf63('0xf'),_0x2a7066,'request\x20sent',JSON[_0xbf63('0x10')](_0x17e554));if(_0x17e554[_0xbf63('0x11')]){if(_0x17e554['error'][_0xbf63('0x12')]===0x1f4){logger[_0xbf63('0x11')](_0xbf63('0xd'),_0x2a7066,_0x17e554[_0xbf63('0x11')][_0xbf63('0x13')]);return _0x3ce7cd(_0x17e554['error'][_0xbf63('0x13')]);}logger['error']('CmCustomField,\x20%s,\x20%s',_0x2a7066,_0x17e554[_0xbf63('0x11')]['message']);return _0x6f66b0(_0x17e554[_0xbf63('0x11')]['message']);}else{logger[_0xbf63('0xc')](_0xbf63('0xd'),_0x2a7066,_0xbf63('0x14'));_0x6f66b0(_0x17e554[_0xbf63('0x15')][_0xbf63('0x13')]);}})[_0xbf63('0x16')](function(_0x589858){logger[_0xbf63('0x11')](_0xbf63('0xd'),_0x2a7066,_0x589858);_0x3ce7cd(_0x589858);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index ee890a5..8836021 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 _0x7dfd=['isAuthenticated','index','/:id','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get'];(function(_0xe339d0,_0x20b0ef){var _0x5385a1=function(_0x11bd3a){while(--_0x11bd3a){_0xe339d0['push'](_0xe339d0['shift']());}};_0x5385a1(++_0x20b0ef);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd7df('0x0'));var util=require(_0xd7df('0x1'));var path=require(_0xd7df('0x2'));var timeout=require(_0xd7df('0x3'));var express=require(_0xd7df('0x4'));var router=express[_0xd7df('0x5')]();var fs_extra=require(_0xd7df('0x6'));var auth=require(_0xd7df('0x7'));var interaction=require(_0xd7df('0x8'));var config=require(_0xd7df('0x9'));var controller=require(_0xd7df('0xa'));router[_0xd7df('0xb')]('/',auth[_0xd7df('0xc')](),controller[_0xd7df('0xd')]);router[_0xd7df('0xb')](_0xd7df('0xe'),auth[_0xd7df('0xc')](),controller['show']);router[_0xd7df('0xf')]('/',auth[_0xd7df('0xc')](),controller[_0xd7df('0x10')]);router[_0xd7df('0x11')]('/:id',auth[_0xd7df('0xc')](),controller['update']);router[_0xd7df('0x12')]('/:id',auth[_0xd7df('0xc')](),controller[_0xd7df('0x13')]);module[_0xd7df('0x14')]=router; \ No newline at end of file +var _0xb39f=['get','/:id','post','update','delete','exports','multer','util','path','connect-timeout','../../components/auth/service','../../config/environment','./cmCustomField.controller','isAuthenticated','index'];(function(_0x564821,_0x4d037e){var _0x2b604d=function(_0x26fabf){while(--_0x26fabf){_0x564821['push'](_0x564821['shift']());}};_0x2b604d(++_0x4d037e);}(_0xb39f,0x1e6));var _0xfb39=function(_0x148086,_0x3e9975){_0x148086=_0x148086-0x0;var _0x113ecf=_0xb39f[_0x148086];return _0x113ecf;};'use strict';var multer=require(_0xfb39('0x0'));var util=require(_0xfb39('0x1'));var path=require(_0xfb39('0x2'));var timeout=require(_0xfb39('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xfb39('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xfb39('0x5'));var controller=require(_0xfb39('0x6'));router['get']('/',auth[_0xfb39('0x7')](),controller[_0xfb39('0x8')]);router[_0xfb39('0x9')](_0xfb39('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xfb39('0xb')]('/',auth[_0xfb39('0x7')](),controller['create']);router['put']('/:id',auth[_0xfb39('0x7')](),controller[_0xfb39('0xc')]);router[_0xfb39('0xd')](_0xfb39('0xa'),auth[_0xfb39('0x7')](),controller['destroy']);module[_0xfb39('0xe')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 5742600..b3a783e 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 _0x5c3c=['DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','BOOLEAN','contactListQueue','moment','sequelize','exports','STRING'];(function(_0x3e68ac,_0x2e0cb2){var _0x313b72=function(_0x39da08){while(--_0x39da08){_0x3e68ac['push'](_0x3e68ac['shift']());}};_0x313b72(++_0x2e0cb2);}(_0x5c3c,0x132));var _0xc5c3=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x5c3c[_0xf50820];return _0x2a9b10;};'use strict';var moment=require(_0xc5c3('0x0'));var Sequelize=require(_0xc5c3('0x1'));module[_0xc5c3('0x2')]={'phone':{'type':Sequelize[_0xc5c3('0x3')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xc5c3('0x4')],'defaultValue':moment()[_0xc5c3('0x5')](_0xc5c3('0x6'))},'countbusyretry':{'type':Sequelize[_0xc5c3('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xc5c3('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xc5c3('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xc5c3('0x8')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xc5c3('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xc5c3('0x4')]},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xc5c3('0x7')],'unique':_0xc5c3('0x9')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0xc5c3('0x9')},'UserId':{'type':Sequelize[_0xc5c3('0x7')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xc5c3('0x9')},'CampaignId':{'type':Sequelize[_0xc5c3('0x7')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xc5c3('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xc5c3('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xc5c3('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xc5c3('0x3')]},'recallmeNotifiedDate':{'type':Sequelize[_0xc5c3('0x4')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0x7916=['exports','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','moment'];(function(_0x664f79,_0x57c1f5){var _0x5a2192=function(_0x6d899e){while(--_0x6d899e){_0x664f79['push'](_0x664f79['shift']());}};_0x5a2192(++_0x57c1f5);}(_0x7916,0x128));var _0x6791=function(_0x478489,_0x3cdf57){_0x478489=_0x478489-0x0;var _0x544211=_0x7916[_0x478489];return _0x544211;};'use strict';var moment=require(_0x6791('0x0'));var Sequelize=require('sequelize');module[_0x6791('0x1')]={'phone':{'type':Sequelize[_0x6791('0x2')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x6791('0x3')],'defaultValue':moment()[_0x6791('0x4')](_0x6791('0x5'))},'countbusyretry':{'type':Sequelize[_0x6791('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x6791('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x6791('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x6791('0x3')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x6791('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x6791('0x6')],'unique':'contactListQueue'},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x6791('0x8')},'UserId':{'type':Sequelize[_0x6791('0x6')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x6791('0x8')},'CampaignId':{'type':Sequelize[_0x6791('0x6')]},'countnosuchnumberretry':{'type':Sequelize[_0x6791('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x6791('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x6791('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x6791('0x6')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x6791('0x2')]},'recallmeNotifiedDate':{'type':Sequelize[_0x6791('0x3')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 939f011..bc48223 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 _0x0cae=['deletedat','format','YYYY-MM-DD\x20HH:mm:ss','phone','queue','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','end','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','sequelize','transaction','dialPreviewAutoRecallMe','value','direction','prev','hopperIds','ASC','scheduledAt','DESC','literal','isEmpty','COALESCE(CmHopper.UserId,\x200)\x20DESC','scheduledat','recallme','UPDATE','Contact','CmCompany','Company','CmList','List','dialActive','getPreviewRecall','findOne','getOpenContacts','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','sendStatus','timezones','utcOffset','getTimezone','moment','../../components/parsers/qs','api','../../config/environment','../../mysqldb','status','json','offset','limit','undefined','count','set','Content-Range','update','then','error','stack','name','send','index','map','CmHopper','model','query','keys','filters','concat','$or','$gt','$ne','$not','$between','$in','$like','$iLike','$notILike','$overlap','$contains','$any','attributes','fields','length','order','sort','where','filter','merge','type','options','includeAll','findAll','rows','show','params','include','find','catch','create','body','describe','destroy','CampaignId','VoiceQueue','Campaign','VoiceQueueId','omit','dataValues','createdAt','updatedAt','state','statedesc','campaign','membername','user','UserId'];(function(_0x2d0d97,_0x2d9560){var _0xfb96e9=function(_0x52a340){while(--_0x52a340){_0x2d0d97['push'](_0x2d0d97['shift']());}};_0xfb96e9(++_0x2d9560);}(_0x0cae,0x1ad));var _0xe0ca=function(_0x314afb,_0x328688){_0x314afb=_0x314afb-0x0;var _0x1e5988=_0x0cae[_0x314afb];return _0x1e5988;};'use strict';var moment=require(_0xe0ca('0x0'));var _=require('lodash');var qs=require(_0xe0ca('0x1'));var logger=require('../../config/logger')(_0xe0ca('0x2'));var shared=require(_0xe0ca('0x3'));var db=require(_0xe0ca('0x4'))['db'];function respondWithResult(_0x262d86,_0x18fda8){_0x18fda8=_0x18fda8||0xc8;return function(_0x4b9a7a){if(_0x4b9a7a){return _0x262d86[_0xe0ca('0x5')](_0x18fda8)[_0xe0ca('0x6')](_0x4b9a7a);}};}function respondWithFilteredResult(_0x2fe8bb,_0x5d7ba9){return function(_0x545712){if(_0x545712){var _0x399111=typeof _0x5d7ba9[_0xe0ca('0x7')]==='undefined'&&typeof _0x5d7ba9[_0xe0ca('0x8')]===_0xe0ca('0x9');var _0x2032f5=_0x545712[_0xe0ca('0xa')];var _0x1cb875=_0x399111?0x0:_0x5d7ba9[_0xe0ca('0x7')];var _0x3b3db3=_0x399111?_0x545712[_0xe0ca('0xa')]:_0x5d7ba9[_0xe0ca('0x7')]+_0x5d7ba9[_0xe0ca('0x8')];var _0x3df0d5;if(_0x3b3db3>=_0x2032f5){_0x3b3db3=_0x2032f5;_0x3df0d5=0xc8;}else{_0x3df0d5=0xce;}_0x2fe8bb[_0xe0ca('0x5')](_0x3df0d5);return _0x2fe8bb[_0xe0ca('0xb')](_0xe0ca('0xc'),_0x1cb875+'-'+_0x3b3db3+'/'+_0x2032f5)['json'](_0x545712);}return null;};}function saveUpdates(_0x573791,_0x412ad3){return function(_0xdbce33){if(_0xdbce33){return _0xdbce33[_0xe0ca('0xd')](_0x573791)[_0xe0ca('0xe')](function(_0x264188){return _0x264188;});}return null;};}function handleEntityNotFound(_0x19d8b4,_0x233a9b){return function(_0x3d9c1c){if(!_0x3d9c1c){_0x19d8b4['sendStatus'](0x194);}return _0x3d9c1c;};}function handleError(_0x1f4695,_0xb0aa5b){_0xb0aa5b=_0xb0aa5b||0x1f4;return function(_0x22f571){logger[_0xe0ca('0xf')](_0x22f571[_0xe0ca('0x10')]);if(_0x22f571[_0xe0ca('0x11')]){delete _0x22f571[_0xe0ca('0x11')];}_0x1f4695[_0xe0ca('0x5')](_0xb0aa5b)[_0xe0ca('0x12')](_0x22f571);};}exports[_0xe0ca('0x13')]=function(_0x3040f2,_0x4d9ccc){var _0x3565d8={},_0x4f4973={},_0xc2934b={'count':0x0,'rows':[]};var _0x241871=_[_0xe0ca('0x14')](db[_0xe0ca('0x15')]['rawAttributes'],function(_0x26a539){return{'name':_0x26a539['fieldName'],'type':_0x26a539['type']['key']};});_0x4f4973[_0xe0ca('0x16')]=_[_0xe0ca('0x14')](_0x241871,_0xe0ca('0x11'));_0x4f4973[_0xe0ca('0x17')]=_[_0xe0ca('0x18')](_0x3040f2['query']);_0x4f4973[_0xe0ca('0x19')]=_['intersection'](_0x4f4973[_0xe0ca('0x16')],_0x4f4973[_0xe0ca('0x17')]);_0x4f4973[_0xe0ca('0x19')]=_[_0xe0ca('0x1a')](_0x4f4973[_0xe0ca('0x19')],['$and',_0xe0ca('0x1b'),_0xe0ca('0x1c'),'$gte','$lt','$lte',_0xe0ca('0x1d'),'$eq',_0xe0ca('0x1e'),_0xe0ca('0x1f'),'$notBetween',_0xe0ca('0x20'),'$notIn',_0xe0ca('0x21'),'$notLike',_0xe0ca('0x22'),_0xe0ca('0x23'),_0xe0ca('0x21'),_0xe0ca('0x24'),_0xe0ca('0x25'),'$contained',_0xe0ca('0x26')]);_0x3565d8[_0xe0ca('0x27')]=_['intersection'](_0x4f4973[_0xe0ca('0x16')],qs['fields'](_0x3040f2[_0xe0ca('0x17')][_0xe0ca('0x28')]));_0x3565d8[_0xe0ca('0x27')]=_0x3565d8[_0xe0ca('0x27')][_0xe0ca('0x29')]?_0x3565d8[_0xe0ca('0x27')]:_0x4f4973[_0xe0ca('0x16')];if(!_0x3040f2['query']['hasOwnProperty']('nolimit')){_0x3565d8[_0xe0ca('0x8')]=qs[_0xe0ca('0x8')](_0x3040f2[_0xe0ca('0x17')][_0xe0ca('0x8')]);_0x3565d8[_0xe0ca('0x7')]=qs['offset'](_0x3040f2['query'][_0xe0ca('0x7')]);}_0x3565d8[_0xe0ca('0x2a')]=qs[_0xe0ca('0x2b')](_0x3040f2[_0xe0ca('0x17')][_0xe0ca('0x2b')]);_0x3565d8[_0xe0ca('0x2c')]=qs['filters'](_['pick'](_0x3040f2['query'],_0x4f4973[_0xe0ca('0x19')]),_0x241871);if(_0x3040f2[_0xe0ca('0x17')][_0xe0ca('0x2d')]){_0x3565d8[_0xe0ca('0x2c')]=_[_0xe0ca('0x2e')](_0x3565d8[_0xe0ca('0x2c')],{'$or':_[_0xe0ca('0x14')](_0x241871,function(_0x256a9d){if(_0x256a9d[_0xe0ca('0x2f')]!=='VIRTUAL'){var _0x213315={};_0x213315[_0x256a9d['name']]={'$like':'%'+_0x3040f2[_0xe0ca('0x17')]['filter']+'%'};return _0x213315;}})});}_0x3565d8=_[_0xe0ca('0x2e')]({},_0x3565d8,_0x3040f2[_0xe0ca('0x30')]);var _0x31e80e={'where':_0x3565d8[_0xe0ca('0x2c')]};return db[_0xe0ca('0x15')]['count'](_0x31e80e)['then'](function(_0x2d2e7b){_0xc2934b[_0xe0ca('0xa')]=_0x2d2e7b;if(_0x3040f2['query'][_0xe0ca('0x31')]){_0x3565d8['include']=[{'all':!![]}];}return db[_0xe0ca('0x15')][_0xe0ca('0x32')](_0x3565d8);})[_0xe0ca('0xe')](function(_0x2531d0){_0xc2934b[_0xe0ca('0x33')]=_0x2531d0;return _0xc2934b;})[_0xe0ca('0xe')](respondWithFilteredResult(_0x4d9ccc,_0x3565d8))['catch'](handleError(_0x4d9ccc,null));};exports[_0xe0ca('0x34')]=function(_0x356363,_0x8af324){var _0x100b8a={'raw':!![],'where':{'id':_0x356363[_0xe0ca('0x35')]['id']}},_0x78888e={};_0x78888e[_0xe0ca('0x16')]=_[_0xe0ca('0x18')](db['CmHopper']['rawAttributes']);_0x78888e[_0xe0ca('0x17')]=_[_0xe0ca('0x18')](_0x356363['query']);_0x78888e[_0xe0ca('0x19')]=_['intersection'](_0x78888e['model'],_0x78888e[_0xe0ca('0x17')]);_0x100b8a['attributes']=_['intersection'](_0x78888e[_0xe0ca('0x16')],qs[_0xe0ca('0x28')](_0x356363['query'][_0xe0ca('0x28')]));_0x100b8a[_0xe0ca('0x27')]=_0x100b8a[_0xe0ca('0x27')]['length']?_0x100b8a[_0xe0ca('0x27')]:_0x78888e[_0xe0ca('0x16')];if(_0x356363[_0xe0ca('0x17')][_0xe0ca('0x31')]){_0x100b8a[_0xe0ca('0x36')]=[{'all':!![]}];}_0x100b8a=_[_0xe0ca('0x2e')]({},_0x100b8a,_0x356363[_0xe0ca('0x30')]);return db[_0xe0ca('0x15')][_0xe0ca('0x37')](_0x100b8a)[_0xe0ca('0xe')](handleEntityNotFound(_0x8af324,null))[_0xe0ca('0xe')](respondWithResult(_0x8af324,null))[_0xe0ca('0x38')](handleError(_0x8af324,null));};exports[_0xe0ca('0x39')]=function(_0x8b5786,_0x404c14){return db[_0xe0ca('0x15')][_0xe0ca('0x39')](_0x8b5786[_0xe0ca('0x3a')],{})[_0xe0ca('0xe')](respondWithResult(_0x404c14,0xc9))[_0xe0ca('0x38')](handleError(_0x404c14,null));};exports[_0xe0ca('0xd')]=function(_0x1561df,_0x5c27be){if(_0x1561df[_0xe0ca('0x3a')]['id']){delete _0x1561df[_0xe0ca('0x3a')]['id'];}return db[_0xe0ca('0x15')][_0xe0ca('0x37')]({'where':{'id':_0x1561df[_0xe0ca('0x35')]['id']}})[_0xe0ca('0xe')](handleEntityNotFound(_0x5c27be,null))['then'](saveUpdates(_0x1561df[_0xe0ca('0x3a')],null))['then'](respondWithResult(_0x5c27be,null))[_0xe0ca('0x38')](handleError(_0x5c27be,null));};exports[_0xe0ca('0x3b')]=function(_0xf09a5f,_0x2471b2){return db['CmHopper'][_0xe0ca('0x3b')]()[_0xe0ca('0xe')](respondWithResult(_0x2471b2,null))[_0xe0ca('0x38')](handleError(_0x2471b2,null));};exports[_0xe0ca('0x3c')]=function(_0x48ed5d,_0x52fe5c){var _0x10c76e;return db[_0xe0ca('0x15')]['find']({'where':{'id':_0x48ed5d[_0xe0ca('0x35')]['id']}})[_0xe0ca('0xe')](handleEntityNotFound(_0x52fe5c,null))[_0xe0ca('0xe')](function(_0x5447fa){if(_0x5447fa){return _0x5447fa[_0xe0ca('0x3c')]()[_0xe0ca('0xe')](function(_0x334fe5){return _0x334fe5;});}})[_0xe0ca('0xe')](function(_0x1fb85e){_0x10c76e=_0x1fb85e;if(_0x1fb85e){if(_0x1fb85e['VoiceQueueId']||_0x1fb85e[_0xe0ca('0x3d')]){return db[_0x1fb85e['VoiceQueueId']?_0xe0ca('0x3e'):_0xe0ca('0x3f')][_0xe0ca('0x37')]({'where':{'id':_0x1fb85e[_0xe0ca('0x40')]?_0x1fb85e[_0xe0ca('0x40')]:_0x1fb85e[_0xe0ca('0x3d')]},'attributes':['id','name'],'raw':!![]});}}})[_0xe0ca('0xe')](function(_0x4ff111){var _0xbfd8fa={};if(_0x4ff111){_[_0xe0ca('0x2e')](_0xbfd8fa,_[_0xe0ca('0x41')](_0x10c76e[_0xe0ca('0x42')],[_0xe0ca('0x43'),_0xe0ca('0x44'),'id']));_0xbfd8fa[_0xe0ca('0x45')]=0x15;_0xbfd8fa[_0xe0ca('0x46')]='deleted';_0xbfd8fa[_0xe0ca('0x47')]=_0x4ff111[_0xe0ca('0x11')];_0xbfd8fa[_0xe0ca('0x48')]=_0x48ed5d[_0xe0ca('0x49')][_0xe0ca('0x11')];_0xbfd8fa[_0xe0ca('0x4a')]=_0x48ed5d[_0xe0ca('0x49')]['id'];_0xbfd8fa['deleted']=!![];_0xbfd8fa[_0xe0ca('0x4b')]=moment()[_0xe0ca('0x4c')](_0xe0ca('0x4d'));_0xbfd8fa['calleridnum']=_0x10c76e[_0xe0ca('0x4e')];_0xbfd8fa['campaigntype']=_0x10c76e[_0xe0ca('0x40')]?_0xe0ca('0x4f'):_0xe0ca('0x50');return db[_0xe0ca('0x51')][_0xe0ca('0x37')]({'where':{'id':_0xbfd8fa[_0xe0ca('0x52')]},'attributes':[_0xe0ca('0x53'),_0xe0ca('0x54')]})[_0xe0ca('0xe')](function(_0x5b13ae){if(!_['isNil'](_0x52fe5c)&&!_[_0xe0ca('0x55')](_0x5b13ae[_0xe0ca('0x53')])){_0xbfd8fa['calleridname']=_0x5b13ae[_0xe0ca('0x53')];if(!_['isNil'](_0x5b13ae[_0xe0ca('0x54')])){_0xbfd8fa[_0xe0ca('0x56')]+='\x20'+_0x5b13ae[_0xe0ca('0x54')];}}})[_0xe0ca('0x57')](function(){return db[_0xe0ca('0x58')][_0xe0ca('0x39')](_0xbfd8fa);});}})[_0xe0ca('0xe')](function(){return _0x52fe5c[_0xe0ca('0x5')](0xcc)[_0xe0ca('0x59')]();})['catch'](handleError(_0x52fe5c,null));};exports[_0xe0ca('0x5a')]=function(_0x555ea3,_0x49a03e){var _0x23b362=[];return db['CmContact'][_0xe0ca('0x3b')]()[_0xe0ca('0xe')](function(_0xd1fc29){_0x23b362=_[_0xe0ca('0x18')](_0xd1fc29);return _0x555ea3[_0xe0ca('0x49')][_0xe0ca('0x5b')]({'where':{'type':_0xe0ca('0x5c'),'dialActive':!![],'dialMethod':_0xe0ca('0x5d')},'attributes':['id',_0xe0ca('0x5e'),'dialPreviewAutoRecallMe'],'raw':!![]});})[_0xe0ca('0xe')](function(_0x5d00d0){if(_0x5d00d0&&_0x5d00d0[_0xe0ca('0x29')]){return db[_0xe0ca('0x5f')][_0xe0ca('0x60')](function(_0x2ba241){var _0x57bcd5={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0xe0ca('0x4d'))},'VoiceQueueId':{'$in':_[_0xe0ca('0x14')](_0x5d00d0,'id')},'$or':[{'UserId':null},{'UserId':_0x555ea3[_0xe0ca('0x49')]['id']}]};var _0x2b3b4e={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x5d00d0)['filter']([_0xe0ca('0x61'),0x0])[_0xe0ca('0x14')]('id')[_0xe0ca('0x62')]()},'$or':[{'UserId':null},{'UserId':_0x555ea3[_0xe0ca('0x49')]['id']}]};var _0x395f19={'$or':[_0x57bcd5,_0x2b3b4e]};var _0x399a09=[];if(_0x555ea3[_0xe0ca('0x3a')]['direction']&&_0x555ea3[_0xe0ca('0x3a')][_0xe0ca('0x63')]===_0xe0ca('0x64')){if(!_['isEmpty'](_0x555ea3[_0xe0ca('0x3a')]['hopperIds'])){_0x395f19['id']={'$in':_0x555ea3[_0xe0ca('0x3a')][_0xe0ca('0x65')]};}_0x399a09=[['priority',_0xe0ca('0x66')],[_0xe0ca('0x67'),_0x5d00d0[0x0][_0xe0ca('0x5e')]===_0xe0ca('0x66')?_0xe0ca('0x68'):_0xe0ca('0x66')],db[_0xe0ca('0x5f')][_0xe0ca('0x69')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0xe0ca('0x68')]];}else{if(!_[_0xe0ca('0x6a')](_0x555ea3['body']['hopperIds'])){_0x395f19['id']={'$notIn':_0x555ea3[_0xe0ca('0x3a')][_0xe0ca('0x65')]};}_0x399a09=[['priority',_0xe0ca('0x68')],['scheduledAt',_0x5d00d0[0x0][_0xe0ca('0x5e')]],db[_0xe0ca('0x5f')][_0xe0ca('0x69')](_0xe0ca('0x6b')),['id','ASC']];}return db['CmHopper']['findOne']({'attributes':['id',_0xe0ca('0x6c'),_0xe0ca('0x6d')],'where':_0x395f19,'order':_0x399a09,'transaction':_0x2ba241,'lock':_0x2ba241['LOCK'][_0xe0ca('0x6e')],'include':[{'model':db[_0xe0ca('0x51')],'as':_0xe0ca('0x6f'),'attributes':_0x23b362,'include':[{'model':db[_0xe0ca('0x70')],'as':_0xe0ca('0x71'),'attributes':['id',_0xe0ca('0x11')]}]},{'model':db[_0xe0ca('0x72')],'as':_0xe0ca('0x73'),'attributes':['id',_0xe0ca('0x11')]},{'model':db[_0xe0ca('0x3e')],'as':'Queue','attributes':['id',_0xe0ca('0x11'),_0xe0ca('0x74')]}]})[_0xe0ca('0xe')](function(_0x1e18f5){if(_0x1e18f5){return _0x1e18f5[_0xe0ca('0xd')]({'UserId':_0x555ea3[_0xe0ca('0x49')]['id']},{'transaction':_0x2ba241});}});});}})[_0xe0ca('0xe')](handleEntityNotFound(_0x49a03e,null))[_0xe0ca('0xe')](respondWithResult(_0x49a03e,null))[_0xe0ca('0x38')](handleError(_0x49a03e,null));};exports[_0xe0ca('0x75')]=function(_0x1b4bbf,_0x22a67a,_0x57ece9){var _0x14239b=[];var _0x81340=_0x1b4bbf[_0xe0ca('0x35')]['id'];var _0x1b088c=_0x1b4bbf['user']['id'];return db[_0xe0ca('0x51')]['describe']()[_0xe0ca('0xe')](function(_0x141828){_0x14239b=_[_0xe0ca('0x18')](_0x141828);return db[_0xe0ca('0x5f')][_0xe0ca('0x60')](function(_0x28b38f){const _0x4e161b={'id':_0x81340};return db[_0xe0ca('0x15')][_0xe0ca('0x76')]({'attributes':['id','scheduledat',_0xe0ca('0x6d')],'where':_0x4e161b,'transaction':_0x28b38f,'lock':_0x28b38f['LOCK']['UPDATE'],'include':[{'model':db[_0xe0ca('0x51')],'as':_0xe0ca('0x6f'),'attributes':_0x14239b,'include':[{'model':db[_0xe0ca('0x70')],'as':_0xe0ca('0x71'),'attributes':['id',_0xe0ca('0x11')]}]},{'model':db[_0xe0ca('0x72')],'as':_0xe0ca('0x73'),'attributes':['id','name']},{'model':db[_0xe0ca('0x3e')],'as':'Queue','attributes':['id','name',_0xe0ca('0x74')]}]})[_0xe0ca('0xe')](function(_0x6c8a18){if(_0x6c8a18){return _0x6c8a18[_0xe0ca('0xd')]({'UserId':_0x1b088c},{'transaction':_0x28b38f});}});});})[_0xe0ca('0xe')](handleEntityNotFound(_0x22a67a,null))[_0xe0ca('0xe')](respondWithResult(_0x22a67a,null))[_0xe0ca('0x38')](handleError(_0x22a67a,null));};exports[_0xe0ca('0x77')]=function(_0x3bf714,_0x42d244){return _0x3bf714[_0xe0ca('0x49')][_0xe0ca('0x5b')]({'where':{'type':_0xe0ca('0x5c'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})[_0xe0ca('0xe')](function(_0x460863){if(_0x460863&&_0x460863[_0xe0ca('0x29')]){return db[_0xe0ca('0x15')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xe0ca('0x4c')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0xe0ca('0x14')](_0x460863,'id')},'$or':[{'UserId':null},{'UserId':_0x3bf714['user']['id']}]}});}return 0x0;})[_0xe0ca('0xe')](function(_0x99a38a){if(!_[_0xe0ca('0x55')](_0x99a38a)&&_['isNumber'](_0x99a38a)){return _0x42d244['status'](0xc8)['json']({'contacts':_0x99a38a});}else{logger[_0xe0ca('0xf')](_0xe0ca('0x78'),'getOpenContacts',0x194,_0xe0ca('0x79'));_0x42d244[_0xe0ca('0x7a')](0x194);}})[_0xe0ca('0x38')](handleError(_0x42d244,null));};exports['getTimezones']=function(_0x2e128c,_0x13b60a){var _0xe428=shared[_0xe0ca('0x7b')];var _0x2f0c76=[];_['map'](_0xe428,function(_0x31fee8){_0x2f0c76['push']({'id':_0x31fee8[_0xe0ca('0x11')],'name':_0x31fee8[_0xe0ca('0x11')],'utcOffset':_0x31fee8[_0xe0ca('0x7c')]});});return _0x13b60a['status'](0xc8)[_0xe0ca('0x6')]({'tz':_0x2f0c76});};exports[_0xe0ca('0x7d')]=function(_0x195b00,_0x291712){var _0x298d68=shared[_0xe0ca('0x7b')];var _0x4d3c9c={};if(!_[_0xe0ca('0x55')](_0x298d68[_0x195b00[_0xe0ca('0x3a')]['id']]))_0x4d3c9c=_0x298d68[_0x195b00[_0xe0ca('0x3a')]['id']];return _0x291712[_0xe0ca('0x5')](0xc8)[_0xe0ca('0x6')](_0x4d3c9c);}; \ No newline at end of file +var _0x5f59=['calleridname','lastName','finally','CmHopperFinal','end','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','value','direction','prev','hopperIds','priority','ASC','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','COALESCE(CmHopper.UserId,\x200)\x20DESC','scheduledat','recallme','UPDATE','Contact','List','Queue','dialActive','getPreviewRecall','findOne','LOCK','CmCompany','Company','CmList','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','utcOffset','getTimezone','timezones','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','status','offset','undefined','count','set','Content-Range','json','then','sendStatus','error','name','send','index','map','CmHopper','rawAttributes','fieldName','key','model','query','keys','filters','concat','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$like','$iLike','$overlap','$contains','$contained','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','type','VIRTUAL','filter','includeAll','findAll','rows','catch','show','create','body','update','find','params','describe','destroy','CampaignId','VoiceQueueId','VoiceQueue','Campaign','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','campaign','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','phone','campaigntype','queue','ivr','CmContact','firstName','isNil'];(function(_0x59c8ce,_0x25297){var _0x5b41c0=function(_0x306f96){while(--_0x306f96){_0x59c8ce['push'](_0x59c8ce['shift']());}};_0x5b41c0(++_0x25297);}(_0x5f59,0x143));var _0x95f5=function(_0x12fe13,_0x544d09){_0x12fe13=_0x12fe13-0x0;var _0x50eb40=_0x5f59[_0x12fe13];return _0x50eb40;};'use strict';var moment=require('moment');var _=require(_0x95f5('0x0'));var qs=require(_0x95f5('0x1'));var logger=require(_0x95f5('0x2'))(_0x95f5('0x3'));var shared=require(_0x95f5('0x4'));var db=require('../../mysqldb')['db'];function respondWithResult(_0x49e3fb,_0x49d79b){_0x49d79b=_0x49d79b||0xc8;return function(_0xe4e526){if(_0xe4e526){return _0x49e3fb[_0x95f5('0x5')](_0x49d79b)['json'](_0xe4e526);}};}function respondWithFilteredResult(_0x262d63,_0x317b14){return function(_0x317edd){if(_0x317edd){var _0x24b9d4=typeof _0x317b14[_0x95f5('0x6')]===_0x95f5('0x7')&&typeof _0x317b14['limit']===_0x95f5('0x7');var _0x30c386=_0x317edd[_0x95f5('0x8')];var _0x697d0a=_0x24b9d4?0x0:_0x317b14[_0x95f5('0x6')];var _0x389ea9=_0x24b9d4?_0x317edd[_0x95f5('0x8')]:_0x317b14[_0x95f5('0x6')]+_0x317b14['limit'];var _0x4b29c4;if(_0x389ea9>=_0x30c386){_0x389ea9=_0x30c386;_0x4b29c4=0xc8;}else{_0x4b29c4=0xce;}_0x262d63[_0x95f5('0x5')](_0x4b29c4);return _0x262d63[_0x95f5('0x9')](_0x95f5('0xa'),_0x697d0a+'-'+_0x389ea9+'/'+_0x30c386)[_0x95f5('0xb')](_0x317edd);}return null;};}function saveUpdates(_0x42491e,_0x4b829b){return function(_0x474bda){if(_0x474bda){return _0x474bda['update'](_0x42491e)[_0x95f5('0xc')](function(_0x237446){return _0x237446;});}return null;};}function handleEntityNotFound(_0x5da952,_0x3b47c6){return function(_0x3ec3fb){if(!_0x3ec3fb){_0x5da952[_0x95f5('0xd')](0x194);}return _0x3ec3fb;};}function handleError(_0x534f61,_0x55b88f){_0x55b88f=_0x55b88f||0x1f4;return function(_0x5d835b){logger[_0x95f5('0xe')](_0x5d835b['stack']);if(_0x5d835b[_0x95f5('0xf')]){delete _0x5d835b[_0x95f5('0xf')];}_0x534f61[_0x95f5('0x5')](_0x55b88f)[_0x95f5('0x10')](_0x5d835b);};}exports[_0x95f5('0x11')]=function(_0x4ab532,_0x22db62){var _0x2280ea={},_0x1ba340={},_0x13b5ed={'count':0x0,'rows':[]};var _0x3433d8=_[_0x95f5('0x12')](db[_0x95f5('0x13')][_0x95f5('0x14')],function(_0x41aaab){return{'name':_0x41aaab[_0x95f5('0x15')],'type':_0x41aaab['type'][_0x95f5('0x16')]};});_0x1ba340[_0x95f5('0x17')]=_[_0x95f5('0x12')](_0x3433d8,_0x95f5('0xf'));_0x1ba340[_0x95f5('0x18')]=_[_0x95f5('0x19')](_0x4ab532[_0x95f5('0x18')]);_0x1ba340[_0x95f5('0x1a')]=_['intersection'](_0x1ba340[_0x95f5('0x17')],_0x1ba340[_0x95f5('0x18')]);_0x1ba340[_0x95f5('0x1a')]=_[_0x95f5('0x1b')](_0x1ba340[_0x95f5('0x1a')],[_0x95f5('0x1c'),_0x95f5('0x1d'),_0x95f5('0x1e'),_0x95f5('0x1f'),_0x95f5('0x20'),_0x95f5('0x21'),_0x95f5('0x22'),_0x95f5('0x23'),_0x95f5('0x24'),_0x95f5('0x25'),_0x95f5('0x26'),_0x95f5('0x27'),_0x95f5('0x28'),_0x95f5('0x29'),'$notLike',_0x95f5('0x2a'),'$notILike',_0x95f5('0x29'),_0x95f5('0x2b'),_0x95f5('0x2c'),_0x95f5('0x2d'),'$any']);_0x2280ea[_0x95f5('0x2e')]=_[_0x95f5('0x2f')](_0x1ba340[_0x95f5('0x17')],qs[_0x95f5('0x30')](_0x4ab532[_0x95f5('0x18')]['fields']));_0x2280ea[_0x95f5('0x2e')]=_0x2280ea[_0x95f5('0x2e')][_0x95f5('0x31')]?_0x2280ea[_0x95f5('0x2e')]:_0x1ba340[_0x95f5('0x17')];if(!_0x4ab532[_0x95f5('0x18')][_0x95f5('0x32')](_0x95f5('0x33'))){_0x2280ea[_0x95f5('0x34')]=qs[_0x95f5('0x34')](_0x4ab532[_0x95f5('0x18')][_0x95f5('0x34')]);_0x2280ea[_0x95f5('0x6')]=qs[_0x95f5('0x6')](_0x4ab532['query'][_0x95f5('0x6')]);}_0x2280ea[_0x95f5('0x35')]=qs[_0x95f5('0x36')](_0x4ab532[_0x95f5('0x18')][_0x95f5('0x36')]);_0x2280ea[_0x95f5('0x37')]=qs[_0x95f5('0x1a')](_[_0x95f5('0x38')](_0x4ab532[_0x95f5('0x18')],_0x1ba340[_0x95f5('0x1a')]),_0x3433d8);if(_0x4ab532['query']['filter']){_0x2280ea[_0x95f5('0x37')]=_[_0x95f5('0x39')](_0x2280ea[_0x95f5('0x37')],{'$or':_[_0x95f5('0x12')](_0x3433d8,function(_0x33eb35){if(_0x33eb35[_0x95f5('0x3a')]!==_0x95f5('0x3b')){var _0x57f38c={};_0x57f38c[_0x33eb35[_0x95f5('0xf')]]={'$like':'%'+_0x4ab532['query'][_0x95f5('0x3c')]+'%'};return _0x57f38c;}})});}_0x2280ea=_['merge']({},_0x2280ea,_0x4ab532['options']);var _0x127728={'where':_0x2280ea[_0x95f5('0x37')]};return db[_0x95f5('0x13')]['count'](_0x127728)[_0x95f5('0xc')](function(_0x325290){_0x13b5ed[_0x95f5('0x8')]=_0x325290;if(_0x4ab532['query'][_0x95f5('0x3d')]){_0x2280ea['include']=[{'all':!![]}];}return db[_0x95f5('0x13')][_0x95f5('0x3e')](_0x2280ea);})[_0x95f5('0xc')](function(_0x268a3c){_0x13b5ed[_0x95f5('0x3f')]=_0x268a3c;return _0x13b5ed;})[_0x95f5('0xc')](respondWithFilteredResult(_0x22db62,_0x2280ea))[_0x95f5('0x40')](handleError(_0x22db62,null));};exports[_0x95f5('0x41')]=function(_0xe6c7bc,_0x4f1286){var _0x540801={'raw':!![],'where':{'id':_0xe6c7bc['params']['id']}},_0x1cec85={};_0x1cec85[_0x95f5('0x17')]=_['keys'](db[_0x95f5('0x13')][_0x95f5('0x14')]);_0x1cec85[_0x95f5('0x18')]=_[_0x95f5('0x19')](_0xe6c7bc[_0x95f5('0x18')]);_0x1cec85[_0x95f5('0x1a')]=_['intersection'](_0x1cec85[_0x95f5('0x17')],_0x1cec85[_0x95f5('0x18')]);_0x540801[_0x95f5('0x2e')]=_[_0x95f5('0x2f')](_0x1cec85[_0x95f5('0x17')],qs[_0x95f5('0x30')](_0xe6c7bc[_0x95f5('0x18')][_0x95f5('0x30')]));_0x540801['attributes']=_0x540801[_0x95f5('0x2e')][_0x95f5('0x31')]?_0x540801['attributes']:_0x1cec85[_0x95f5('0x17')];if(_0xe6c7bc[_0x95f5('0x18')]['includeAll']){_0x540801['include']=[{'all':!![]}];}_0x540801=_['merge']({},_0x540801,_0xe6c7bc['options']);return db[_0x95f5('0x13')]['find'](_0x540801)[_0x95f5('0xc')](handleEntityNotFound(_0x4f1286,null))[_0x95f5('0xc')](respondWithResult(_0x4f1286,null))[_0x95f5('0x40')](handleError(_0x4f1286,null));};exports[_0x95f5('0x42')]=function(_0x353c28,_0x32d521){return db[_0x95f5('0x13')][_0x95f5('0x42')](_0x353c28[_0x95f5('0x43')],{})[_0x95f5('0xc')](respondWithResult(_0x32d521,0xc9))[_0x95f5('0x40')](handleError(_0x32d521,null));};exports[_0x95f5('0x44')]=function(_0x110672,_0x526005){if(_0x110672[_0x95f5('0x43')]['id']){delete _0x110672['body']['id'];}return db[_0x95f5('0x13')][_0x95f5('0x45')]({'where':{'id':_0x110672[_0x95f5('0x46')]['id']}})['then'](handleEntityNotFound(_0x526005,null))[_0x95f5('0xc')](saveUpdates(_0x110672['body'],null))[_0x95f5('0xc')](respondWithResult(_0x526005,null))['catch'](handleError(_0x526005,null));};exports[_0x95f5('0x47')]=function(_0x2c34d0,_0x4ad21a){return db[_0x95f5('0x13')][_0x95f5('0x47')]()[_0x95f5('0xc')](respondWithResult(_0x4ad21a,null))[_0x95f5('0x40')](handleError(_0x4ad21a,null));};exports[_0x95f5('0x48')]=function(_0x5e22c0,_0x2f66f5){var _0x371823;return db['CmHopper'][_0x95f5('0x45')]({'where':{'id':_0x5e22c0[_0x95f5('0x46')]['id']}})[_0x95f5('0xc')](handleEntityNotFound(_0x2f66f5,null))['then'](function(_0x43f10f){if(_0x43f10f){return _0x43f10f[_0x95f5('0x48')]()['then'](function(_0x33e803){return _0x33e803;});}})[_0x95f5('0xc')](function(_0x23212e){_0x371823=_0x23212e;if(_0x23212e){if(_0x23212e['VoiceQueueId']||_0x23212e[_0x95f5('0x49')]){return db[_0x23212e[_0x95f5('0x4a')]?_0x95f5('0x4b'):_0x95f5('0x4c')][_0x95f5('0x45')]({'where':{'id':_0x23212e[_0x95f5('0x4a')]?_0x23212e['VoiceQueueId']:_0x23212e['CampaignId']},'attributes':['id',_0x95f5('0xf')],'raw':!![]});}}})[_0x95f5('0xc')](function(_0x376eef){var _0x2e9121={};if(_0x376eef){_[_0x95f5('0x39')](_0x2e9121,_[_0x95f5('0x4d')](_0x371823[_0x95f5('0x4e')],[_0x95f5('0x4f'),_0x95f5('0x50'),'id']));_0x2e9121[_0x95f5('0x51')]=0x15;_0x2e9121[_0x95f5('0x52')]=_0x95f5('0x53');_0x2e9121[_0x95f5('0x54')]=_0x376eef['name'];_0x2e9121['membername']=_0x5e22c0[_0x95f5('0x55')][_0x95f5('0xf')];_0x2e9121[_0x95f5('0x56')]=_0x5e22c0[_0x95f5('0x55')]['id'];_0x2e9121[_0x95f5('0x53')]=!![];_0x2e9121[_0x95f5('0x57')]=moment()[_0x95f5('0x58')](_0x95f5('0x59'));_0x2e9121['calleridnum']=_0x371823[_0x95f5('0x5a')];_0x2e9121[_0x95f5('0x5b')]=_0x371823['VoiceQueueId']?_0x95f5('0x5c'):_0x95f5('0x5d');return db[_0x95f5('0x5e')]['find']({'where':{'id':_0x2e9121['ContactId']},'attributes':[_0x95f5('0x5f'),'lastName']})[_0x95f5('0xc')](function(_0x54e7a2){if(!_[_0x95f5('0x60')](_0x2f66f5)&&!_['isNil'](_0x54e7a2[_0x95f5('0x5f')])){_0x2e9121[_0x95f5('0x61')]=_0x54e7a2[_0x95f5('0x5f')];if(!_[_0x95f5('0x60')](_0x54e7a2[_0x95f5('0x62')])){_0x2e9121['calleridname']+='\x20'+_0x54e7a2[_0x95f5('0x62')];}}})[_0x95f5('0x63')](function(){return db[_0x95f5('0x64')]['create'](_0x2e9121);});}})[_0x95f5('0xc')](function(){return _0x2f66f5[_0x95f5('0x5')](0xcc)[_0x95f5('0x65')]();})[_0x95f5('0x40')](handleError(_0x2f66f5,null));};exports[_0x95f5('0x66')]=function(_0x463211,_0x201ffa){var _0x47ab83=[];return db['CmContact'][_0x95f5('0x47')]()[_0x95f5('0xc')](function(_0x139a5a){_0x47ab83=_[_0x95f5('0x19')](_0x139a5a);return _0x463211[_0x95f5('0x55')][_0x95f5('0x67')]({'where':{'type':_0x95f5('0x68'),'dialActive':!![],'dialMethod':_0x95f5('0x69')},'attributes':['id',_0x95f5('0x6a'),_0x95f5('0x6b')],'raw':!![]});})['then'](function(_0x3f79fd){if(_0x3f79fd&&_0x3f79fd[_0x95f5('0x31')]){return db[_0x95f5('0x6c')][_0x95f5('0x6d')](function(_0x5eb311){var _0x4e96ca={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x95f5('0x59'))},'VoiceQueueId':{'$in':_[_0x95f5('0x12')](_0x3f79fd,'id')},'$or':[{'UserId':null},{'UserId':_0x463211[_0x95f5('0x55')]['id']}]};var _0x4018bb={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x3f79fd)[_0x95f5('0x3c')](['dialPreviewAutoRecallMe',0x0])['map']('id')[_0x95f5('0x6e')]()},'$or':[{'UserId':null},{'UserId':_0x463211['user']['id']}]};var _0x165c3b={'$or':[_0x4e96ca,_0x4018bb]};var _0x445aaf=[];if(_0x463211[_0x95f5('0x43')][_0x95f5('0x6f')]&&_0x463211[_0x95f5('0x43')][_0x95f5('0x6f')]===_0x95f5('0x70')){if(!_['isEmpty'](_0x463211['body']['hopperIds'])){_0x165c3b['id']={'$in':_0x463211[_0x95f5('0x43')][_0x95f5('0x71')]};}_0x445aaf=[[_0x95f5('0x72'),'ASC'],['scheduledAt',_0x3f79fd[0x0][_0x95f5('0x6a')]===_0x95f5('0x73')?_0x95f5('0x74'):_0x95f5('0x73')],db[_0x95f5('0x6c')][_0x95f5('0x75')](_0x95f5('0x76')),['id',_0x95f5('0x74')]];}else{if(!_['isEmpty'](_0x463211[_0x95f5('0x43')][_0x95f5('0x71')])){_0x165c3b['id']={'$notIn':_0x463211[_0x95f5('0x43')]['hopperIds']};}_0x445aaf=[['priority',_0x95f5('0x74')],['scheduledAt',_0x3f79fd[0x0][_0x95f5('0x6a')]],db[_0x95f5('0x6c')][_0x95f5('0x75')](_0x95f5('0x77')),['id',_0x95f5('0x73')]];}return db[_0x95f5('0x13')]['findOne']({'attributes':['id',_0x95f5('0x78'),_0x95f5('0x79')],'where':_0x165c3b,'order':_0x445aaf,'transaction':_0x5eb311,'lock':_0x5eb311['LOCK'][_0x95f5('0x7a')],'include':[{'model':db[_0x95f5('0x5e')],'as':_0x95f5('0x7b'),'attributes':_0x47ab83,'include':[{'model':db['CmCompany'],'as':'Company','attributes':['id',_0x95f5('0xf')]}]},{'model':db['CmList'],'as':_0x95f5('0x7c'),'attributes':['id','name']},{'model':db[_0x95f5('0x4b')],'as':_0x95f5('0x7d'),'attributes':['id',_0x95f5('0xf'),_0x95f5('0x7e')]}]})['then'](function(_0x542388){if(_0x542388){return _0x542388[_0x95f5('0x44')]({'UserId':_0x463211[_0x95f5('0x55')]['id']},{'transaction':_0x5eb311});}});});}})[_0x95f5('0xc')](handleEntityNotFound(_0x201ffa,null))['then'](respondWithResult(_0x201ffa,null))[_0x95f5('0x40')](handleError(_0x201ffa,null));};exports[_0x95f5('0x7f')]=function(_0x54ec64,_0x5ad0a6,_0x1f5fd3){var _0x4e5aec=[];var _0x49ea43=_0x54ec64[_0x95f5('0x46')]['id'];var _0x5cb381=_0x54ec64[_0x95f5('0x55')]['id'];return db['CmContact'][_0x95f5('0x47')]()[_0x95f5('0xc')](function(_0x2f484d){_0x4e5aec=_[_0x95f5('0x19')](_0x2f484d);return db[_0x95f5('0x6c')][_0x95f5('0x6d')](function(_0x28148b){const _0x46c594={'id':_0x49ea43};return db[_0x95f5('0x13')][_0x95f5('0x80')]({'attributes':['id',_0x95f5('0x78'),_0x95f5('0x79')],'where':_0x46c594,'transaction':_0x28148b,'lock':_0x28148b[_0x95f5('0x81')][_0x95f5('0x7a')],'include':[{'model':db[_0x95f5('0x5e')],'as':'Contact','attributes':_0x4e5aec,'include':[{'model':db[_0x95f5('0x82')],'as':_0x95f5('0x83'),'attributes':['id',_0x95f5('0xf')]}]},{'model':db[_0x95f5('0x84')],'as':_0x95f5('0x7c'),'attributes':['id',_0x95f5('0xf')]},{'model':db[_0x95f5('0x4b')],'as':'Queue','attributes':['id',_0x95f5('0xf'),_0x95f5('0x7e')]}]})[_0x95f5('0xc')](function(_0x56a828){if(_0x56a828){return _0x56a828[_0x95f5('0x44')]({'UserId':_0x5cb381},{'transaction':_0x28148b});}});});})[_0x95f5('0xc')](handleEntityNotFound(_0x5ad0a6,null))[_0x95f5('0xc')](respondWithResult(_0x5ad0a6,null))['catch'](handleError(_0x5ad0a6,null));};exports['getOpenContacts']=function(_0x3a180f,_0x5c68e8){return _0x3a180f[_0x95f5('0x55')][_0x95f5('0x67')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x95f5('0x69')},'attributes':['id'],'raw':!![]})[_0x95f5('0xc')](function(_0x2ba2a4){if(_0x2ba2a4&&_0x2ba2a4[_0x95f5('0x31')]){return db[_0x95f5('0x13')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x95f5('0x58')](_0x95f5('0x59'))},'VoiceQueueId':{'$in':_[_0x95f5('0x12')](_0x2ba2a4,'id')},'$or':[{'UserId':null},{'UserId':_0x3a180f[_0x95f5('0x55')]['id']}]}});}return 0x0;})['then'](function(_0x29c0b2){if(!_[_0x95f5('0x60')](_0x29c0b2)&&_[_0x95f5('0x85')](_0x29c0b2)){return _0x5c68e8[_0x95f5('0x5')](0xc8)[_0x95f5('0xb')]({'contacts':_0x29c0b2});}else{logger[_0x95f5('0xe')](_0x95f5('0x86'),'getOpenContacts',0x194,_0x95f5('0x87'));_0x5c68e8[_0x95f5('0xd')](0x194);}})[_0x95f5('0x40')](handleError(_0x5c68e8,null));};exports[_0x95f5('0x88')]=function(_0xc3fdd7,_0x4ca946){var _0x1491cc=shared['timezones'];var _0x458b47=[];_[_0x95f5('0x12')](_0x1491cc,function(_0x516b53){_0x458b47['push']({'id':_0x516b53['name'],'name':_0x516b53[_0x95f5('0xf')],'utcOffset':_0x516b53[_0x95f5('0x89')]});});return _0x4ca946[_0x95f5('0x5')](0xc8)['json']({'tz':_0x458b47});};exports[_0x95f5('0x8a')]=function(_0x4ea4e8,_0x2bba7e){var _0x1463ee=shared[_0x95f5('0x8b')];var _0x46807f={};if(!_['isNil'](_0x1463ee[_0x4ea4e8[_0x95f5('0x43')]['id']]))_0x46807f=_0x1463ee[_0x4ea4e8[_0x95f5('0x43')]['id']];return _0x2bba7e[_0x95f5('0x5')](0xc8)[_0x95f5('0xb')](_0x46807f);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index c125b49..ba4ae07 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 _0x5fab=['./cmHopper.attributes','exports','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x274864,_0x145f4c){var _0x503594=function(_0x2d978f){while(--_0x2d978f){_0x274864['push'](_0x274864['shift']());}};_0x503594(++_0x145f4c);}(_0x5fab,0x177));var _0xb5fa=function(_0x2dd976,_0x1b5dc4){_0x2dd976=_0x2dd976-0x0;var _0x2265fd=_0x5fab[_0x2dd976];return _0x2265fd;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var logger=require('../../config/logger')(_0xb5fa('0x2'));var moment=require(_0xb5fa('0x3'));var BPromise=require(_0xb5fa('0x4'));var rp=require(_0xb5fa('0x5'));var fs=require('fs');var path=require(_0xb5fa('0x6'));var rimraf=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var attributes=require(_0xb5fa('0x9'));module[_0xb5fa('0xa')]=function(_0x44df89,_0x4a0249){return _0x44df89['define'](_0xb5fa('0xb'),attributes,{'tableName':_0xb5fa('0xc'),'paranoid':![],'indexes':[{'name':_0xb5fa('0xd'),'fields':['scheduledat']},{'name':_0xb5fa('0xe'),'fields':[_0xb5fa('0xe')]},{'name':_0xb5fa('0xf'),'fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file +var _0xbd51=['./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','../../config/logger','api','moment','bluebird'];(function(_0x58175c,_0x2d9373){var _0x55b88f=function(_0x13ed84){while(--_0x13ed84){_0x58175c['push'](_0x58175c['shift']());}};_0x55b88f(++_0x2d9373);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x398f80,_0x18ee8e){_0x398f80=_0x398f80-0x0;var _0x52cb7a=_0xbd51[_0x398f80];return _0x52cb7a;};'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 diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 3027ed8..640040a 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 _0x58e6=['push','update','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer','sequelize','transaction','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','COUNT','literal','`scheduledat`\x20>=\x20','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','contactsRescheduled','CountReScheduled','GetContactRecallMe','UPDATE','GetCmHopperPreview','Contact','GetContactByPhone','findOne','phone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','NOW()\x20+\x20INTERVAL\x20','User','CmList','List','log','NOW()','lodash','util','../../config/logger','jayson/promise','client','http','then','info','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','CmHopper,\x20%s,\x20%s','message','catch','GetCmHopper','CmHopper','findAll','options','raw','where','include','map','model','attributes','ShowCmHopper','find','CreateCmHopper','create','body','UpdateCmHopper','limit','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','order','LOCK','keys','Agent','name','voicePause','length','UserId'];(function(_0x4ae34b,_0x51e416){var _0x5dc785=function(_0x1e0b6d){while(--_0x1e0b6d){_0x4ae34b['push'](_0x4ae34b['shift']());}};_0x5dc785(++_0x51e416);}(_0x58e6,0x1c2));var _0x658e=function(_0x58338c,_0x358ca6){_0x58338c=_0x58338c-0x0;var _0x544b97=_0x58e6[_0x58338c];return _0x544b97;};'use strict';var _=require(_0x658e('0x0'));var util=require(_0x658e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var db=require('../../mysqldb')['db'];var logger=require(_0x658e('0x2'))('rpc');var jayson=require(_0x658e('0x3'));var client=jayson[_0x658e('0x4')][_0x658e('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x187e6a,_0x465134,_0x2add44){return new BPromise(function(_0x3251b8,_0x4ea631){return client['request'](_0x187e6a,_0x2add44)[_0x658e('0x6')](function(_0xa73acf){logger[_0x658e('0x7')]('CmHopper,\x20%s,\x20%s',_0x465134,_0x658e('0x8'));logger[_0x658e('0x9')](_0x658e('0xa'),_0x465134,_0x658e('0x8'),JSON[_0x658e('0xb')](_0xa73acf));if(_0xa73acf[_0x658e('0xc')]){if(_0xa73acf['error']['code']===0x1f4){logger[_0x658e('0xc')](_0x658e('0xd'),_0x465134,_0xa73acf[_0x658e('0xc')][_0x658e('0xe')]);return _0x4ea631(_0xa73acf[_0x658e('0xc')][_0x658e('0xe')]);}logger[_0x658e('0xc')]('CmHopper,\x20%s,\x20%s',_0x465134,_0xa73acf[_0x658e('0xc')][_0x658e('0xe')]);return _0x3251b8(_0xa73acf[_0x658e('0xc')][_0x658e('0xe')]);}else{logger['info'](_0x658e('0xd'),_0x465134,_0x658e('0x8'));_0x3251b8(_0xa73acf['result']['message']);}})[_0x658e('0xf')](function(_0x17c487){logger[_0x658e('0xc')]('CmHopper,\x20%s,\x20%s',_0x465134,_0x17c487);_0x4ea631(_0x17c487);});});}exports[_0x658e('0x10')]=function(_0x4f9ccd){var _0x1c5c4e=this;return new Promise(function(_0x1f1edc,_0x22deed){return db[_0x658e('0x11')][_0x658e('0x12')]({'raw':_0x4f9ccd[_0x658e('0x13')]?_0x4f9ccd['options'][_0x658e('0x14')]===undefined?!![]:![]:!![],'where':_0x4f9ccd[_0x658e('0x13')]?_0x4f9ccd[_0x658e('0x13')][_0x658e('0x15')]||null:null,'attributes':_0x4f9ccd[_0x658e('0x13')]?_0x4f9ccd['options']['attributes']||null:null,'limit':_0x4f9ccd[_0x658e('0x13')]?_0x4f9ccd[_0x658e('0x13')]['limit']||null:null,'include':_0x4f9ccd[_0x658e('0x13')]?_0x4f9ccd[_0x658e('0x13')][_0x658e('0x16')]?_[_0x658e('0x17')](_0x4f9ccd['options'][_0x658e('0x16')],function(_0x142e58){return{'model':db[_0x142e58[_0x658e('0x18')]],'as':_0x142e58['as'],'attributes':_0x142e58[_0x658e('0x19')],'include':_0x142e58[_0x658e('0x16')]?_[_0x658e('0x17')](_0x142e58[_0x658e('0x16')],function(_0x1a5fa6){return{'model':db[_0x1a5fa6[_0x658e('0x18')]],'as':_0x1a5fa6['as'],'attributes':_0x1a5fa6[_0x658e('0x19')],'include':_0x1a5fa6[_0x658e('0x16')]?_['map'](_0x1a5fa6[_0x658e('0x16')],function(_0x478705){return{'model':db[_0x478705['model']],'as':_0x478705['as'],'attributes':_0x478705[_0x658e('0x19')]};}):[]};}):[]};}):[]:[]})[_0x658e('0x6')](function(_0x410642){logger[_0x658e('0x7')](_0x658e('0x10'),_0x4f9ccd);logger[_0x658e('0x9')](_0x658e('0x10'),_0x4f9ccd,JSON['stringify'](_0x410642));_0x1f1edc(_0x410642);})['catch'](function(_0x2eb63d){logger[_0x658e('0xc')](_0x658e('0x10'),_0x2eb63d['message'],_0x4f9ccd);_0x22deed(_0x1c5c4e[_0x658e('0xc')](0x1f4,_0x2eb63d[_0x658e('0xe')]));});});};exports[_0x658e('0x1a')]=function(_0x4edddd){var _0x48fc5a=this;return new Promise(function(_0x131420,_0x4ee4c0){return db[_0x658e('0x11')][_0x658e('0x1b')]({'raw':_0x4edddd[_0x658e('0x13')]?_0x4edddd[_0x658e('0x13')][_0x658e('0x14')]===undefined?!![]:![]:!![],'where':_0x4edddd[_0x658e('0x13')]?_0x4edddd[_0x658e('0x13')]['where']||null:null,'attributes':_0x4edddd[_0x658e('0x13')]?_0x4edddd['options'][_0x658e('0x19')]||null:null,'include':_0x4edddd[_0x658e('0x13')]?_0x4edddd['options'][_0x658e('0x16')]?_[_0x658e('0x17')](_0x4edddd[_0x658e('0x13')][_0x658e('0x16')],function(_0x5f3c71){return{'model':db[_0x5f3c71['model']],'as':_0x5f3c71['as'],'attributes':_0x5f3c71[_0x658e('0x19')],'include':_0x5f3c71[_0x658e('0x16')]?_['map'](_0x5f3c71['include'],function(_0xd847b2){return{'model':db[_0xd847b2['model']],'as':_0xd847b2['as'],'attributes':_0xd847b2[_0x658e('0x19')],'include':_0xd847b2[_0x658e('0x16')]?_[_0x658e('0x17')](_0xd847b2['include'],function(_0x4cfcc7){return{'model':db[_0x4cfcc7[_0x658e('0x18')]],'as':_0x4cfcc7['as'],'attributes':_0x4cfcc7['attributes']};}):[]};}):[]};}):[]:[]})[_0x658e('0x6')](function(_0x3a25fc){logger[_0x658e('0x7')](_0x658e('0x1a'),_0x4edddd);logger[_0x658e('0x9')](_0x658e('0x1a'),_0x4edddd,JSON[_0x658e('0xb')](_0x3a25fc));_0x131420(_0x3a25fc);})[_0x658e('0xf')](function(_0x5ce007){logger['error'](_0x658e('0x1a'),_0x5ce007[_0x658e('0xe')],_0x4edddd);_0x4ee4c0(_0x48fc5a['error'](0x1f4,_0x5ce007[_0x658e('0xe')]));});});};exports[_0x658e('0x1c')]=function(_0x137079){var _0x588cc5=this;return new Promise(function(_0x3bf0d3,_0x5d9a89){return db[_0x658e('0x11')][_0x658e('0x1d')](_0x137079[_0x658e('0x1e')],{'raw':_0x137079[_0x658e('0x13')]?_0x137079[_0x658e('0x13')][_0x658e('0x14')]===undefined?!![]:![]:!![]})[_0x658e('0x6')](function(_0x51f7f5){logger[_0x658e('0x7')]('CreateCmHopper',_0x137079);logger['debug'](_0x658e('0x1c'),_0x137079,JSON[_0x658e('0xb')](_0x51f7f5));_0x3bf0d3(_0x51f7f5);})[_0x658e('0xf')](function(_0x18da49){logger[_0x658e('0xc')](_0x658e('0x1c'),_0x18da49[_0x658e('0xe')],_0x137079);_0x5d9a89(_0x588cc5[_0x658e('0xc')](0x1f4,_0x18da49['message']));});});};exports[_0x658e('0x1f')]=function(_0xce3ca9){var _0x563b95=this;return new Promise(function(_0x329acc,_0xb2dfbb){return db[_0x658e('0x11')]['update'](_0xce3ca9[_0x658e('0x1e')],{'raw':_0xce3ca9[_0x658e('0x13')]?_0xce3ca9[_0x658e('0x13')][_0x658e('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xce3ca9[_0x658e('0x13')]?_0xce3ca9[_0x658e('0x13')]['where']||null:null,'attributes':_0xce3ca9['options']?_0xce3ca9['options']['attributes']||null:null,'limit':_0xce3ca9[_0x658e('0x13')]?_0xce3ca9[_0x658e('0x13')][_0x658e('0x20')]||null:null})[_0x658e('0x6')](function(_0x2fb4a5){logger['info'](_0x658e('0x1f'),_0xce3ca9);logger[_0x658e('0x7')](_0x658e('0x21'),JSON['stringify'](_0xce3ca9[_0x658e('0x13')][_0x658e('0x15')]),_0xce3ca9[_0x658e('0x1e')][_0x658e('0x22')]);logger[_0x658e('0x9')](_0x658e('0x1f'),_0xce3ca9,JSON[_0x658e('0xb')](_0x2fb4a5));_0x329acc(_0x2fb4a5);})[_0x658e('0xf')](function(_0x57ddde){logger[_0x658e('0xc')](_0x658e('0x1f'),_0x57ddde['message'],_0xce3ca9);_0xb2dfbb(_0x563b95[_0x658e('0xc')](0x1f4,_0x57ddde['message']));});});};exports[_0x658e('0x23')]=function(_0x418d19){var _0x54a164=this;return new Promise(function(_0x43821c,_0x5423aa){return db[_0x658e('0x11')][_0x658e('0x24')]({'where':_0x418d19['options']?_0x418d19['options'][_0x658e('0x15')]||null:null})[_0x658e('0x6')](function(_0x365b3a){logger[_0x658e('0x7')]('DestroyCmHopper',_0x418d19);logger[_0x658e('0x9')](_0x658e('0x23'),_0x418d19,JSON['stringify'](_0x365b3a));_0x43821c(_0x365b3a);})['catch'](function(_0x49ac13){logger[_0x658e('0xc')](_0x658e('0x23'),_0x49ac13['message'],_0x418d19);_0x5423aa(_0x54a164[_0x658e('0xc')](0x1f4,_0x49ac13[_0x658e('0xe')]));});});};exports[_0x658e('0x25')]=function(_0x34b1c4){var _0x4e82db=this;return new Promise(function(_0x226b90,_0x29d119){return db[_0x658e('0x26')][_0x658e('0x27')]()[_0x658e('0x6')](function(_0x46f76e){return db['sequelize']['transaction'](function(_0x4f7fdc){return db['CmHopper']['findAll']({'where':_0x34b1c4['options']?_0x34b1c4[_0x658e('0x13')][_0x658e('0x15')]||null:null,'attributes':_0x34b1c4[_0x658e('0x13')]?_0x34b1c4['options'][_0x658e('0x19')]||null:null,'limit':_0x34b1c4[_0x658e('0x13')]?_0x34b1c4[_0x658e('0x13')][_0x658e('0x20')]||null:null,'order':_0x34b1c4[_0x658e('0x13')]?_0x34b1c4[_0x658e('0x13')][_0x658e('0x28')]||null:null,'transaction':_0x4f7fdc,'lock':_0x4f7fdc[_0x658e('0x29')]['UPDATE'],'include':[{'model':db[_0x658e('0x26')],'as':'Contact','attributes':_[_0x658e('0x2a')](_0x46f76e)},{'model':db['User'],'as':_0x658e('0x2b'),'attributes':['id',_0x658e('0x2c'),_0x658e('0x2d')]}]})[_0x658e('0x6')](function(_0x141b95){var _0x304bb5=[];var _0x26d0c6=[];for(var _0x100cba=0x0;_0x100cba<_0x141b95[_0x658e('0x2e')];_0x100cba+=0x1){var _0x22d50f=_0x141b95[_0x100cba][_0x658e('0x2f')];if(_0x22d50f===null){_0x304bb5[_0x658e('0x30')](_0x141b95[_0x100cba]['update'](_0x34b1c4['body'],{'transaction':_0x4f7fdc}));}else if(!_0x26d0c6['includes'](_0x22d50f)){_0x26d0c6[_0x658e('0x30')](_0x22d50f);_0x304bb5[_0x658e('0x30')](_0x141b95[_0x100cba][_0x658e('0x31')](_0x34b1c4[_0x658e('0x1e')],{'transaction':_0x4f7fdc}));}}return BPromise[_0x658e('0x32')](_0x304bb5);});})[_0x658e('0x6')](function(_0xd4c4e2){logger[_0x658e('0x7')](_0x658e('0x25'),_0x34b1c4);if(_0xd4c4e2[_0x658e('0x2e')]>0x0){logger[_0x658e('0x7')](_0x658e('0x33'),_0xd4c4e2[0x0][_0x658e('0x34')]['id'],_0xd4c4e2[0x0][_0x658e('0x34')][_0x658e('0x35')],_0xd4c4e2[0x0][_0x658e('0x34')]['active']);}logger[_0x658e('0x9')]('GetContactDialer',_0x34b1c4,JSON[_0x658e('0xb')](_0xd4c4e2));_0x226b90(_0xd4c4e2);})[_0x658e('0xf')](function(_0x166038){logger[_0x658e('0xc')](_0x658e('0x25'),_0x166038[_0x658e('0xe')],_0x34b1c4);_0x29d119(_0x4e82db[_0x658e('0xc')](0x1f4,_0x166038[_0x658e('0xe')]));});});});};exports[_0x658e('0x36')]=function(_0x384502){var _0x33f783=this;return new Promise(function(_0xf7b83e,_0x7bc5c7){return db[_0x658e('0x37')][_0x658e('0x38')](function(_0x1a7dc4){return db[_0x658e('0x39')]['create'](_0x384502[_0x658e('0x1e')],{'raw':_0x384502[_0x658e('0x13')]?_0x384502['options'][_0x658e('0x14')]===undefined?!![]:![]:!![],'transaction':_0x1a7dc4})[_0x658e('0x6')](function(){logger[_0x658e('0x7')](_0x658e('0x3a'),JSON['stringify'](_0x384502[_0x658e('0x13')][_0x658e('0x15')]),_0x384502[_0x658e('0x13')]['where']['active']);return db[_0x658e('0x11')][_0x658e('0x24')]({'where':_0x384502[_0x658e('0x13')]?_0x384502['options'][_0x658e('0x15')]||null:null,'transaction':_0x1a7dc4});});})[_0x658e('0x6')](function(_0x1d4031){logger[_0x658e('0x7')](_0x658e('0x36'),_0x384502);logger[_0x658e('0x9')](_0x658e('0x36'),_0x384502,JSON[_0x658e('0xb')](_0x1d4031));_0xf7b83e(_0x1d4031);})[_0x658e('0xf')](function(_0x56fce9){logger[_0x658e('0xc')](_0x658e('0x36'),_0x56fce9['message'],_0x384502);_0x7bc5c7(_0x33f783[_0x658e('0xc')](0x1f4,_0x56fce9['message']));});});};exports['CountReScheduled']=function(_0x35026c){var _0x9503e0=this;return new Promise(function(_0x4e4b88,_0x59806e){return db['CmHopper'][_0x658e('0x12')]({'raw':_0x35026c[_0x658e('0x13')]?_0x35026c[_0x658e('0x13')][_0x658e('0x14')]===undefined?!![]:![]:!![],'where':_0x35026c[_0x658e('0x13')]?_0x35026c[_0x658e('0x13')][_0x658e('0x15')]||null:null,'attributes':[[db[_0x658e('0x37')]['fn'](_0x658e('0x3b'),db['sequelize']['fn']('IF',db[_0x658e('0x37')][_0x658e('0x3c')](_0x658e('0x3d')+util['format'](_0x658e('0x3e'),moment()['format'](_0x658e('0x3f')))+'\x20,\x201,\x20null'))),_0x658e('0x40')]]})[_0x658e('0x6')](function(_0x2596a4){logger[_0x658e('0x7')](_0x658e('0x41'),_0x35026c);logger[_0x658e('0x9')](_0x658e('0x41'),_0x35026c,JSON['stringify'](_0x2596a4));_0x4e4b88(_0x2596a4);})['catch'](function(_0x498c78){logger[_0x658e('0xc')](_0x658e('0x41'),_0x498c78[_0x658e('0xe')],_0x35026c);_0x59806e(_0x9503e0['error'](0x1f4,_0x498c78[_0x658e('0xe')]));});});};exports[_0x658e('0x42')]=function(_0x267a0e){var _0x45f500=this;return new Promise(function(_0x5e6d14,_0x3621ef){return db['CmContact'][_0x658e('0x27')]()['then'](function(_0x4cc0be){return db[_0x658e('0x37')][_0x658e('0x38')](function(_0x3d39d5){return db['CmHopper'][_0x658e('0x12')]({'where':_0x267a0e['options']?_0x267a0e['options'][_0x658e('0x15')]||null:null,'attributes':_0x267a0e[_0x658e('0x13')]?_0x267a0e[_0x658e('0x13')]['attributes']||null:null,'limit':0x1,'order':_0x267a0e['options']?_0x267a0e['options']['order']||null:null,'group':db[_0x658e('0x11')][_0x658e('0x2f')],'transaction':_0x3d39d5,'lock':_0x3d39d5[_0x658e('0x29')][_0x658e('0x43')],'include':_0x267a0e[_0x658e('0x13')]?_0x267a0e['options'][_0x658e('0x16')]?_['map'](_0x267a0e['options'][_0x658e('0x16')],function(_0x34c89e){return{'model':db[_0x34c89e[_0x658e('0x18')]],'as':_0x34c89e['as'],'attributes':_0x34c89e[_0x658e('0x19')],'include':_0x34c89e[_0x658e('0x16')]?_[_0x658e('0x17')](_0x34c89e['include'],function(_0x25b2ac){return{'model':db[_0x25b2ac[_0x658e('0x18')]],'as':_0x25b2ac['as'],'attributes':_0x25b2ac[_0x658e('0x19')],'include':_0x25b2ac[_0x658e('0x16')]?_[_0x658e('0x17')](_0x25b2ac[_0x658e('0x16')],function(_0x564560){return{'model':db[_0x564560['model']],'as':_0x564560['as'],'attributes':_0x564560[_0x658e('0x19')]};}):[]};}):[]};}):[]:[]})[_0x658e('0x6')](function(_0x19dd6c){var _0x541a5e=[];for(var _0x16369d=0x0;_0x16369d<_0x19dd6c['length'];_0x16369d+=0x1){_0x541a5e[_0x658e('0x30')](_0x19dd6c[_0x16369d]['update'](_0x267a0e[_0x658e('0x1e')],{'transaction':_0x3d39d5}));}return BPromise[_0x658e('0x32')](_0x541a5e);});})[_0x658e('0x6')](function(_0x3011e1){logger[_0x658e('0x7')](_0x658e('0x42'),_0x267a0e);logger[_0x658e('0x9')](_0x658e('0x42'),_0x267a0e,JSON['stringify'](_0x3011e1));_0x5e6d14(_0x3011e1);})[_0x658e('0xf')](function(_0x4c6a02){logger[_0x658e('0xc')]('GetContactRecallMe',_0x4c6a02[_0x658e('0xe')],_0x267a0e);_0x3621ef(_0x45f500[_0x658e('0xc')](0x1f4,_0x4c6a02[_0x658e('0xe')]));});});});};exports[_0x658e('0x44')]=function(_0x43f583){var _0x1db9a3=this;return new Promise(function(_0x3e9ecf,_0x1228fb){db[_0x658e('0x26')][_0x658e('0x27')]()[_0x658e('0x6')](function(_0x108120){return db[_0x658e('0x11')][_0x658e('0x12')]({'raw':_0x43f583[_0x658e('0x13')]?_0x43f583[_0x658e('0x13')]['raw']===undefined?!![]:![]:!![],'where':_0x43f583[_0x658e('0x13')]?_0x43f583[_0x658e('0x13')][_0x658e('0x15')]||null:null,'attributes':_0x43f583['options']?_0x43f583['options'][_0x658e('0x19')]||null:null,'limit':_0x43f583[_0x658e('0x13')]?_0x43f583['options'][_0x658e('0x20')]||null:null,'include':_0x43f583[_0x658e('0x13')]?_0x43f583[_0x658e('0x13')][_0x658e('0x16')]?_[_0x658e('0x17')](_0x43f583[_0x658e('0x13')][_0x658e('0x16')],function(_0x1145a1){return{'model':db[_0x1145a1['model']],'as':_0x1145a1['as'],'attributes':_0x1145a1['as']===_0x658e('0x45')?_[_0x658e('0x2a')](_0x108120):_0x1145a1[_0x658e('0x19')],'include':_0x1145a1['include']?_[_0x658e('0x17')](_0x1145a1[_0x658e('0x16')],function(_0x5ee312){return{'model':db[_0x5ee312[_0x658e('0x18')]],'as':_0x5ee312['as'],'attributes':_0x5ee312[_0x658e('0x19')],'include':_0x5ee312[_0x658e('0x16')]?_[_0x658e('0x17')](_0x5ee312[_0x658e('0x16')],function(_0x4a1616){return{'model':db[_0x4a1616[_0x658e('0x18')]],'as':_0x4a1616['as'],'attributes':_0x4a1616[_0x658e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x17084b){logger[_0x658e('0x7')]('GetCmHopper',_0x43f583);logger[_0x658e('0x9')](_0x658e('0x10'),_0x43f583,JSON['stringify'](_0x17084b));_0x3e9ecf(_0x17084b);})[_0x658e('0xf')](function(_0x31e41c){logger[_0x658e('0xc')](_0x658e('0x10'),_0x31e41c[_0x658e('0xe')],_0x43f583);_0x1228fb(_0x1db9a3[_0x658e('0xc')](0x1f4,_0x31e41c[_0x658e('0xe')]));});});});};exports[_0x658e('0x46')]=function(_0x1b9365){var _0x4819e9=this;return new Promise(function(_0x545408,_0x288052){return db[_0x658e('0x26')][_0x658e('0x47')]({'raw':!![],'where':{'phone':_0x1b9365[_0x658e('0x13')][_0x658e('0x15')][_0x658e('0x48')]},'attributes':['id','dialTimezone'],'order':[['id',_0x658e('0x49')]]})['then'](function(_0x29c7c4){logger[_0x658e('0x7')]('getContactByPhone',_0x1b9365);logger['debug']('getContactByPhone',_0x1b9365,JSON[_0x658e('0xb')](_0x29c7c4));_0x545408(_0x29c7c4);})['catch'](function(_0x439373){logger[_0x658e('0xc')](_0x658e('0x4a'),_0x439373['message'],_0x1b9365);_0x288052(_0x4819e9[_0x658e('0xc')](0x1f4,_0x439373[_0x658e('0xe')]));});});};exports[_0x658e('0x4b')]=function(_0x3ae9b8){var _0x4849a0=this;return new Promise(function(_0x578a86,_0x1bae9c){return db[_0x658e('0x37')][_0x658e('0x38')](function(_0x2706b1){return db[_0x658e('0x11')][_0x658e('0x31')]({'active':![]},{'where':{},'transaction':_0x2706b1})['then'](function(_0x2bc216){logger[_0x658e('0x7')](_0x658e('0x4b'),_0x3ae9b8);logger[_0x658e('0x9')](_0x658e('0x4b'),_0x3ae9b8,JSON[_0x658e('0xb')](_0x2bc216));_0x578a86(_0x2bc216);})[_0x658e('0xf')](function(_0x56dd6b){logger[_0x658e('0xc')](_0x658e('0x4b'),_0x56dd6b[_0x658e('0xe')],_0x3ae9b8);_0x1bae9c(_0x4849a0[_0x658e('0xc')](0x1f4,_0x56dd6b[_0x658e('0xe')]));});});});};exports[_0x658e('0x4c')]=function(_0x5d2c34){var _0x3ec1f9=this;var _0x427519=_0x5d2c34[_0x658e('0x1e')][_0x658e('0x15')]['voiceQueueId'];var _0x21a266=_0x5d2c34[_0x658e('0x1e')][_0x658e('0x15')]['interval'];return new Promise(function(_0x15a1bd,_0x242533){return db['CmHopper']['findAll']({'logging':!![],'where':{'voiceQueueId':_0x427519,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x658e('0x37')][_0x658e('0x3c')](_0x658e('0x4d')+_0x21a266+'\x20MINUTE'),'$gt':db['sequelize'][_0x658e('0x3c')]('NOW()')}}},'include':[{'model':db[_0x658e('0x26')],'as':_0x658e('0x45')},{'model':db[_0x658e('0x4e')],'as':_0x658e('0x2b'),'attributes':['id',_0x658e('0x2c'),'voicePause']},{'model':db[_0x658e('0x4f')],'as':_0x658e('0x50')}]})['then'](function(_0x28212e){console[_0x658e('0x51')](_0x28212e);return db['sequelize']['transaction'](function(_0x845485){return BPromise['all'](_0x28212e[_0x658e('0x17')](function(_0x4c8552){_0x4c8552[_0x658e('0x31')]({'recallmeNotifiedDate':db['sequelize'][_0x658e('0x3c')](_0x658e('0x52'))},{'transaction':_0x845485,'logging':!![]});}))['then'](function(_0x1ae2ea){console['log'](_0x1ae2ea);_0x15a1bd(_0x28212e);})[_0x658e('0xf')](function(_0x1066db){logger[_0x658e('0xc')](_0x658e('0x4c'),_0x1066db[_0x658e('0xe')],_0x5d2c34);_0x242533(_0x3ec1f9[_0x658e('0xc')](0x1f4,_0x1066db[_0x658e('0xe')]));});})[_0x658e('0xf')](function(_0x2c0ac2){logger['error'](_0x658e('0x4c'),_0x2c0ac2[_0x658e('0xe')],_0x5d2c34);_0x242533(_0x3ec1f9[_0x658e('0xc')](0x1f4,_0x2c0ac2['message']));});});});}; \ No newline at end of file +var _0xee8f=['then','debug','ShowCmHopper','find','raw','where','CreateCmHopper','create','UpdateCmHopper','update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','body','active','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','transaction','findAll','order','UPDATE','Contact','keys','User','Agent','name','voicePause','length','UserId','push','includes','all','dataValues','ContactId','MoveContactManagedDialer','sequelize','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','GetCmHopperPreview','GetContactByPhone','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','interval','\x20MINUTE','NOW()','CmList','List','log','util','bluebird','../../mysqldb','../../config/logger','rpc','request','info','CmHopper,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetCmHopper','CmHopper','options','attributes','limit','include','map','model'];(function(_0x4ecfdb,_0x47a150){var _0x274ffc=function(_0x1e59b9){while(--_0x1e59b9){_0x4ecfdb['push'](_0x4ecfdb['shift']());}};_0x274ffc(++_0x47a150);}(_0xee8f,0x1ed));var _0xfee8=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xee8f[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var util=require(_0xfee8('0x0'));var moment=require('moment');var BPromise=require(_0xfee8('0x1'));var db=require(_0xfee8('0x2'))['db'];var logger=require(_0xfee8('0x3'))(_0xfee8('0x4'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1652fc,_0x32ac18,_0x42dfba){return new BPromise(function(_0x5b393e,_0x1edd18){return client[_0xfee8('0x5')](_0x1652fc,_0x42dfba)['then'](function(_0x4e5440){logger[_0xfee8('0x6')](_0xfee8('0x7'),_0x32ac18,_0xfee8('0x8'));logger['debug']('CmHopper,\x20%s,\x20%s,\x20%s',_0x32ac18,_0xfee8('0x8'),JSON[_0xfee8('0x9')](_0x4e5440));if(_0x4e5440[_0xfee8('0xa')]){if(_0x4e5440[_0xfee8('0xa')][_0xfee8('0xb')]===0x1f4){logger[_0xfee8('0xa')](_0xfee8('0x7'),_0x32ac18,_0x4e5440[_0xfee8('0xa')]['message']);return _0x1edd18(_0x4e5440['error']['message']);}logger[_0xfee8('0xa')](_0xfee8('0x7'),_0x32ac18,_0x4e5440[_0xfee8('0xa')]['message']);return _0x5b393e(_0x4e5440['error'][_0xfee8('0xc')]);}else{logger[_0xfee8('0x6')](_0xfee8('0x7'),_0x32ac18,_0xfee8('0x8'));_0x5b393e(_0x4e5440[_0xfee8('0xd')][_0xfee8('0xc')]);}})[_0xfee8('0xe')](function(_0xc8de11){logger[_0xfee8('0xa')](_0xfee8('0x7'),_0x32ac18,_0xc8de11);_0x1edd18(_0xc8de11);});});}exports[_0xfee8('0xf')]=function(_0x373327){var _0x4d36d3=this;return new Promise(function(_0x4cca60,_0x24ddb8){return db[_0xfee8('0x10')]['findAll']({'raw':_0x373327[_0xfee8('0x11')]?_0x373327[_0xfee8('0x11')]['raw']===undefined?!![]:![]:!![],'where':_0x373327[_0xfee8('0x11')]?_0x373327['options']['where']||null:null,'attributes':_0x373327[_0xfee8('0x11')]?_0x373327[_0xfee8('0x11')][_0xfee8('0x12')]||null:null,'limit':_0x373327[_0xfee8('0x11')]?_0x373327['options'][_0xfee8('0x13')]||null:null,'include':_0x373327[_0xfee8('0x11')]?_0x373327[_0xfee8('0x11')][_0xfee8('0x14')]?_[_0xfee8('0x15')](_0x373327[_0xfee8('0x11')][_0xfee8('0x14')],function(_0x4f3e62){return{'model':db[_0x4f3e62[_0xfee8('0x16')]],'as':_0x4f3e62['as'],'attributes':_0x4f3e62['attributes'],'include':_0x4f3e62[_0xfee8('0x14')]?_['map'](_0x4f3e62[_0xfee8('0x14')],function(_0x5df4c2){return{'model':db[_0x5df4c2[_0xfee8('0x16')]],'as':_0x5df4c2['as'],'attributes':_0x5df4c2[_0xfee8('0x12')],'include':_0x5df4c2['include']?_[_0xfee8('0x15')](_0x5df4c2[_0xfee8('0x14')],function(_0x57aca6){return{'model':db[_0x57aca6[_0xfee8('0x16')]],'as':_0x57aca6['as'],'attributes':_0x57aca6[_0xfee8('0x12')]};}):[]};}):[]};}):[]:[]})[_0xfee8('0x17')](function(_0x343458){logger[_0xfee8('0x6')]('GetCmHopper',_0x373327);logger[_0xfee8('0x18')](_0xfee8('0xf'),_0x373327,JSON[_0xfee8('0x9')](_0x343458));_0x4cca60(_0x343458);})[_0xfee8('0xe')](function(_0x254304){logger[_0xfee8('0xa')](_0xfee8('0xf'),_0x254304[_0xfee8('0xc')],_0x373327);_0x24ddb8(_0x4d36d3[_0xfee8('0xa')](0x1f4,_0x254304[_0xfee8('0xc')]));});});};exports[_0xfee8('0x19')]=function(_0x3d5656){var _0x4997a0=this;return new Promise(function(_0x1e3b8f,_0x38c28b){return db['CmHopper'][_0xfee8('0x1a')]({'raw':_0x3d5656['options']?_0x3d5656['options'][_0xfee8('0x1b')]===undefined?!![]:![]:!![],'where':_0x3d5656[_0xfee8('0x11')]?_0x3d5656[_0xfee8('0x11')][_0xfee8('0x1c')]||null:null,'attributes':_0x3d5656[_0xfee8('0x11')]?_0x3d5656[_0xfee8('0x11')]['attributes']||null:null,'include':_0x3d5656[_0xfee8('0x11')]?_0x3d5656[_0xfee8('0x11')][_0xfee8('0x14')]?_[_0xfee8('0x15')](_0x3d5656['options']['include'],function(_0x2b8bbe){return{'model':db[_0x2b8bbe[_0xfee8('0x16')]],'as':_0x2b8bbe['as'],'attributes':_0x2b8bbe[_0xfee8('0x12')],'include':_0x2b8bbe[_0xfee8('0x14')]?_[_0xfee8('0x15')](_0x2b8bbe[_0xfee8('0x14')],function(_0x3ecbe){return{'model':db[_0x3ecbe[_0xfee8('0x16')]],'as':_0x3ecbe['as'],'attributes':_0x3ecbe[_0xfee8('0x12')],'include':_0x3ecbe[_0xfee8('0x14')]?_['map'](_0x3ecbe[_0xfee8('0x14')],function(_0x531026){return{'model':db[_0x531026['model']],'as':_0x531026['as'],'attributes':_0x531026['attributes']};}):[]};}):[]};}):[]:[]})[_0xfee8('0x17')](function(_0x371bf2){logger[_0xfee8('0x6')](_0xfee8('0x19'),_0x3d5656);logger['debug'](_0xfee8('0x19'),_0x3d5656,JSON[_0xfee8('0x9')](_0x371bf2));_0x1e3b8f(_0x371bf2);})[_0xfee8('0xe')](function(_0x47370d){logger[_0xfee8('0xa')](_0xfee8('0x19'),_0x47370d[_0xfee8('0xc')],_0x3d5656);_0x38c28b(_0x4997a0['error'](0x1f4,_0x47370d[_0xfee8('0xc')]));});});};exports[_0xfee8('0x1d')]=function(_0x372e23){var _0xed413e=this;return new Promise(function(_0x36eaca,_0x1b2531){return db[_0xfee8('0x10')][_0xfee8('0x1e')](_0x372e23['body'],{'raw':_0x372e23['options']?_0x372e23[_0xfee8('0x11')][_0xfee8('0x1b')]===undefined?!![]:![]:!![]})[_0xfee8('0x17')](function(_0x4097d1){logger[_0xfee8('0x6')](_0xfee8('0x1d'),_0x372e23);logger[_0xfee8('0x18')]('CreateCmHopper',_0x372e23,JSON['stringify'](_0x4097d1));_0x36eaca(_0x4097d1);})[_0xfee8('0xe')](function(_0x1ef108){logger[_0xfee8('0xa')](_0xfee8('0x1d'),_0x1ef108[_0xfee8('0xc')],_0x372e23);_0x1b2531(_0xed413e['error'](0x1f4,_0x1ef108['message']));});});};exports[_0xfee8('0x1f')]=function(_0x31c6b3){var _0x63aca7=this;return new Promise(function(_0x16be93,_0x2653bc){return db[_0xfee8('0x10')][_0xfee8('0x20')](_0x31c6b3['body'],{'raw':_0x31c6b3[_0xfee8('0x11')]?_0x31c6b3['options'][_0xfee8('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x31c6b3[_0xfee8('0x11')]?_0x31c6b3[_0xfee8('0x11')][_0xfee8('0x1c')]||null:null,'attributes':_0x31c6b3[_0xfee8('0x11')]?_0x31c6b3[_0xfee8('0x11')][_0xfee8('0x12')]||null:null,'limit':_0x31c6b3['options']?_0x31c6b3[_0xfee8('0x11')]['limit']||null:null})[_0xfee8('0x17')](function(_0x50a7cb){logger[_0xfee8('0x6')](_0xfee8('0x1f'),_0x31c6b3);logger[_0xfee8('0x6')](_0xfee8('0x21'),JSON['stringify'](_0x31c6b3[_0xfee8('0x11')][_0xfee8('0x1c')]),_0x31c6b3[_0xfee8('0x22')][_0xfee8('0x23')]);logger[_0xfee8('0x18')]('UpdateCmHopper',_0x31c6b3,JSON[_0xfee8('0x9')](_0x50a7cb));_0x16be93(_0x50a7cb);})['catch'](function(_0x371543){logger['error'](_0xfee8('0x1f'),_0x371543[_0xfee8('0xc')],_0x31c6b3);_0x2653bc(_0x63aca7[_0xfee8('0xa')](0x1f4,_0x371543[_0xfee8('0xc')]));});});};exports[_0xfee8('0x24')]=function(_0x203db5){var _0x3c5f03=this;return new Promise(function(_0x38e1c8,_0x37bec7){return db[_0xfee8('0x10')][_0xfee8('0x25')]({'where':_0x203db5[_0xfee8('0x11')]?_0x203db5[_0xfee8('0x11')][_0xfee8('0x1c')]||null:null})[_0xfee8('0x17')](function(_0x464c8f){logger[_0xfee8('0x6')](_0xfee8('0x24'),_0x203db5);logger['debug'](_0xfee8('0x24'),_0x203db5,JSON[_0xfee8('0x9')](_0x464c8f));_0x38e1c8(_0x464c8f);})['catch'](function(_0x395011){logger[_0xfee8('0xa')](_0xfee8('0x24'),_0x395011[_0xfee8('0xc')],_0x203db5);_0x37bec7(_0x3c5f03[_0xfee8('0xa')](0x1f4,_0x395011[_0xfee8('0xc')]));});});};exports[_0xfee8('0x26')]=function(_0x175cfa){var _0x3d5cc5=this;return new Promise(function(_0x1159a1,_0xa10241){return db[_0xfee8('0x27')][_0xfee8('0x28')]()['then'](function(_0x14ea4e){return db['sequelize'][_0xfee8('0x29')](function(_0x185b55){return db[_0xfee8('0x10')][_0xfee8('0x2a')]({'where':_0x175cfa[_0xfee8('0x11')]?_0x175cfa['options'][_0xfee8('0x1c')]||null:null,'attributes':_0x175cfa[_0xfee8('0x11')]?_0x175cfa['options'][_0xfee8('0x12')]||null:null,'limit':_0x175cfa['options']?_0x175cfa[_0xfee8('0x11')][_0xfee8('0x13')]||null:null,'order':_0x175cfa[_0xfee8('0x11')]?_0x175cfa[_0xfee8('0x11')][_0xfee8('0x2b')]||null:null,'transaction':_0x185b55,'lock':_0x185b55['LOCK'][_0xfee8('0x2c')],'include':[{'model':db[_0xfee8('0x27')],'as':_0xfee8('0x2d'),'attributes':_[_0xfee8('0x2e')](_0x14ea4e)},{'model':db[_0xfee8('0x2f')],'as':_0xfee8('0x30'),'attributes':['id',_0xfee8('0x31'),_0xfee8('0x32')]}]})[_0xfee8('0x17')](function(_0x3ea8be){var _0x165ef7=[];var _0x349cd5=[];for(var _0x3c5743=0x0;_0x3c5743<_0x3ea8be[_0xfee8('0x33')];_0x3c5743+=0x1){var _0x5dc4d7=_0x3ea8be[_0x3c5743][_0xfee8('0x34')];if(_0x5dc4d7===null){_0x165ef7[_0xfee8('0x35')](_0x3ea8be[_0x3c5743][_0xfee8('0x20')](_0x175cfa[_0xfee8('0x22')],{'transaction':_0x185b55}));}else if(!_0x349cd5[_0xfee8('0x36')](_0x5dc4d7)){_0x349cd5[_0xfee8('0x35')](_0x5dc4d7);_0x165ef7['push'](_0x3ea8be[_0x3c5743][_0xfee8('0x20')](_0x175cfa[_0xfee8('0x22')],{'transaction':_0x185b55}));}}return BPromise[_0xfee8('0x37')](_0x165ef7);});})[_0xfee8('0x17')](function(_0x5b70e8){logger[_0xfee8('0x6')](_0xfee8('0x26'),_0x175cfa);if(_0x5b70e8[_0xfee8('0x33')]>0x0){logger[_0xfee8('0x6')]('GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]',_0x5b70e8[0x0][_0xfee8('0x38')]['id'],_0x5b70e8[0x0][_0xfee8('0x38')][_0xfee8('0x39')],_0x5b70e8[0x0][_0xfee8('0x38')][_0xfee8('0x23')]);}logger[_0xfee8('0x18')]('GetContactDialer',_0x175cfa,JSON[_0xfee8('0x9')](_0x5b70e8));_0x1159a1(_0x5b70e8);})['catch'](function(_0x3acec7){logger[_0xfee8('0xa')](_0xfee8('0x26'),_0x3acec7[_0xfee8('0xc')],_0x175cfa);_0xa10241(_0x3d5cc5[_0xfee8('0xa')](0x1f4,_0x3acec7[_0xfee8('0xc')]));});});});};exports[_0xfee8('0x3a')]=function(_0x966425){var _0x10893d=this;return new Promise(function(_0x3138d0,_0x21038e){return db[_0xfee8('0x3b')]['transaction'](function(_0x2898d8){return db[_0xfee8('0x3c')][_0xfee8('0x1e')](_0x966425['body'],{'raw':_0x966425[_0xfee8('0x11')]?_0x966425[_0xfee8('0x11')][_0xfee8('0x1b')]===undefined?!![]:![]:!![],'transaction':_0x2898d8})[_0xfee8('0x17')](function(){logger[_0xfee8('0x6')](_0xfee8('0x3d'),JSON['stringify'](_0x966425[_0xfee8('0x11')][_0xfee8('0x1c')]),_0x966425[_0xfee8('0x11')][_0xfee8('0x1c')]['active']);return db[_0xfee8('0x10')]['destroy']({'where':_0x966425['options']?_0x966425['options']['where']||null:null,'transaction':_0x2898d8});});})[_0xfee8('0x17')](function(_0x7e01ea){logger[_0xfee8('0x6')](_0xfee8('0x3a'),_0x966425);logger[_0xfee8('0x18')]('MoveContactManagedDialer',_0x966425,JSON['stringify'](_0x7e01ea));_0x3138d0(_0x7e01ea);})['catch'](function(_0x14f15c){logger[_0xfee8('0xa')](_0xfee8('0x3a'),_0x14f15c[_0xfee8('0xc')],_0x966425);_0x21038e(_0x10893d[_0xfee8('0xa')](0x1f4,_0x14f15c['message']));});});};exports[_0xfee8('0x3e')]=function(_0x368743){var _0x3dbcbc=this;return new Promise(function(_0x3ff608,_0x33fcdc){return db['CmHopper']['findAll']({'raw':_0x368743['options']?_0x368743[_0xfee8('0x11')][_0xfee8('0x1b')]===undefined?!![]:![]:!![],'where':_0x368743[_0xfee8('0x11')]?_0x368743[_0xfee8('0x11')][_0xfee8('0x1c')]||null:null,'attributes':[[db[_0xfee8('0x3b')]['fn'](_0xfee8('0x3f'),db[_0xfee8('0x3b')]['fn']('IF',db['sequelize'][_0xfee8('0x40')](_0xfee8('0x41')+util[_0xfee8('0x42')](_0xfee8('0x43'),moment()[_0xfee8('0x42')](_0xfee8('0x44')))+_0xfee8('0x45')))),_0xfee8('0x46')]]})[_0xfee8('0x17')](function(_0x3e370c){logger[_0xfee8('0x6')](_0xfee8('0x3e'),_0x368743);logger['debug'](_0xfee8('0x3e'),_0x368743,JSON[_0xfee8('0x9')](_0x3e370c));_0x3ff608(_0x3e370c);})[_0xfee8('0xe')](function(_0x449e30){logger['error'](_0xfee8('0x3e'),_0x449e30[_0xfee8('0xc')],_0x368743);_0x33fcdc(_0x3dbcbc[_0xfee8('0xa')](0x1f4,_0x449e30[_0xfee8('0xc')]));});});};exports[_0xfee8('0x47')]=function(_0x49c9ac){var _0x35307f=this;return new Promise(function(_0x244df6,_0x3d5cb4){return db[_0xfee8('0x27')][_0xfee8('0x28')]()[_0xfee8('0x17')](function(_0x17cb1b){return db[_0xfee8('0x3b')]['transaction'](function(_0x394355){return db[_0xfee8('0x10')][_0xfee8('0x2a')]({'where':_0x49c9ac['options']?_0x49c9ac[_0xfee8('0x11')][_0xfee8('0x1c')]||null:null,'attributes':_0x49c9ac['options']?_0x49c9ac[_0xfee8('0x11')][_0xfee8('0x12')]||null:null,'limit':0x1,'order':_0x49c9ac[_0xfee8('0x11')]?_0x49c9ac[_0xfee8('0x11')][_0xfee8('0x2b')]||null:null,'group':db[_0xfee8('0x10')]['UserId'],'transaction':_0x394355,'lock':_0x394355['LOCK']['UPDATE'],'include':_0x49c9ac[_0xfee8('0x11')]?_0x49c9ac[_0xfee8('0x11')][_0xfee8('0x14')]?_[_0xfee8('0x15')](_0x49c9ac['options'][_0xfee8('0x14')],function(_0x35776f){return{'model':db[_0x35776f[_0xfee8('0x16')]],'as':_0x35776f['as'],'attributes':_0x35776f['attributes'],'include':_0x35776f[_0xfee8('0x14')]?_[_0xfee8('0x15')](_0x35776f[_0xfee8('0x14')],function(_0x28dc93){return{'model':db[_0x28dc93['model']],'as':_0x28dc93['as'],'attributes':_0x28dc93[_0xfee8('0x12')],'include':_0x28dc93['include']?_[_0xfee8('0x15')](_0x28dc93[_0xfee8('0x14')],function(_0x235f13){return{'model':db[_0x235f13[_0xfee8('0x16')]],'as':_0x235f13['as'],'attributes':_0x235f13[_0xfee8('0x12')]};}):[]};}):[]};}):[]:[]})[_0xfee8('0x17')](function(_0x209c4b){var _0x1a0090=[];for(var _0x45a6da=0x0;_0x45a6da<_0x209c4b['length'];_0x45a6da+=0x1){_0x1a0090['push'](_0x209c4b[_0x45a6da]['update'](_0x49c9ac[_0xfee8('0x22')],{'transaction':_0x394355}));}return BPromise['all'](_0x1a0090);});})[_0xfee8('0x17')](function(_0x35dbaf){logger[_0xfee8('0x6')](_0xfee8('0x47'),_0x49c9ac);logger[_0xfee8('0x18')](_0xfee8('0x47'),_0x49c9ac,JSON['stringify'](_0x35dbaf));_0x244df6(_0x35dbaf);})[_0xfee8('0xe')](function(_0x3124ab){logger['error'](_0xfee8('0x47'),_0x3124ab[_0xfee8('0xc')],_0x49c9ac);_0x3d5cb4(_0x35307f[_0xfee8('0xa')](0x1f4,_0x3124ab['message']));});});});};exports[_0xfee8('0x48')]=function(_0x1b5094){var _0x12d626=this;return new Promise(function(_0x5b6067,_0x40d762){db[_0xfee8('0x27')][_0xfee8('0x28')]()['then'](function(_0xd3639c){return db[_0xfee8('0x10')][_0xfee8('0x2a')]({'raw':_0x1b5094[_0xfee8('0x11')]?_0x1b5094[_0xfee8('0x11')]['raw']===undefined?!![]:![]:!![],'where':_0x1b5094[_0xfee8('0x11')]?_0x1b5094['options'][_0xfee8('0x1c')]||null:null,'attributes':_0x1b5094[_0xfee8('0x11')]?_0x1b5094[_0xfee8('0x11')][_0xfee8('0x12')]||null:null,'limit':_0x1b5094[_0xfee8('0x11')]?_0x1b5094[_0xfee8('0x11')][_0xfee8('0x13')]||null:null,'include':_0x1b5094[_0xfee8('0x11')]?_0x1b5094[_0xfee8('0x11')][_0xfee8('0x14')]?_[_0xfee8('0x15')](_0x1b5094[_0xfee8('0x11')][_0xfee8('0x14')],function(_0x42d71a){return{'model':db[_0x42d71a['model']],'as':_0x42d71a['as'],'attributes':_0x42d71a['as']===_0xfee8('0x2d')?_[_0xfee8('0x2e')](_0xd3639c):_0x42d71a[_0xfee8('0x12')],'include':_0x42d71a[_0xfee8('0x14')]?_['map'](_0x42d71a[_0xfee8('0x14')],function(_0x28f171){return{'model':db[_0x28f171[_0xfee8('0x16')]],'as':_0x28f171['as'],'attributes':_0x28f171[_0xfee8('0x12')],'include':_0x28f171[_0xfee8('0x14')]?_[_0xfee8('0x15')](_0x28f171[_0xfee8('0x14')],function(_0x38981d){return{'model':db[_0x38981d['model']],'as':_0x38981d['as'],'attributes':_0x38981d['attributes']};}):[]};}):[]};}):[]:[]})[_0xfee8('0x17')](function(_0x22719a){logger[_0xfee8('0x6')](_0xfee8('0xf'),_0x1b5094);logger[_0xfee8('0x18')]('GetCmHopper',_0x1b5094,JSON[_0xfee8('0x9')](_0x22719a));_0x5b6067(_0x22719a);})['catch'](function(_0x46a214){logger[_0xfee8('0xa')]('GetCmHopper',_0x46a214[_0xfee8('0xc')],_0x1b5094);_0x40d762(_0x12d626[_0xfee8('0xa')](0x1f4,_0x46a214[_0xfee8('0xc')]));});});});};exports[_0xfee8('0x49')]=function(_0x26371c){var _0x4c2cbb=this;return new Promise(function(_0x236851,_0x85022d){return db[_0xfee8('0x27')]['findOne']({'raw':!![],'where':{'phone':_0x26371c[_0xfee8('0x11')][_0xfee8('0x1c')][_0xfee8('0x4a')]},'attributes':['id',_0xfee8('0x4b')],'order':[['id',_0xfee8('0x4c')]]})[_0xfee8('0x17')](function(_0x508bd4){logger[_0xfee8('0x6')](_0xfee8('0x4d'),_0x26371c);logger['debug'](_0xfee8('0x4d'),_0x26371c,JSON[_0xfee8('0x9')](_0x508bd4));_0x236851(_0x508bd4);})[_0xfee8('0xe')](function(_0x134cdd){logger[_0xfee8('0xa')](_0xfee8('0x4d'),_0x134cdd[_0xfee8('0xc')],_0x26371c);_0x85022d(_0x4c2cbb['error'](0x1f4,_0x134cdd['message']));});});};exports[_0xfee8('0x4e')]=function(_0x19e292){var _0x78b82e=this;return new Promise(function(_0x3eba4c,_0xa03c4d){return db[_0xfee8('0x3b')][_0xfee8('0x29')](function(_0x52883f){return db['CmHopper'][_0xfee8('0x20')]({'active':![]},{'where':{},'transaction':_0x52883f})[_0xfee8('0x17')](function(_0x11b1c2){logger[_0xfee8('0x6')]('ResetActiveCalls',_0x19e292);logger[_0xfee8('0x18')]('ResetActiveCalls',_0x19e292,JSON[_0xfee8('0x9')](_0x11b1c2));_0x3eba4c(_0x11b1c2);})['catch'](function(_0x57e2ac){logger['error'](_0xfee8('0x4e'),_0x57e2ac['message'],_0x19e292);_0xa03c4d(_0x78b82e[_0xfee8('0xa')](0x1f4,_0x57e2ac[_0xfee8('0xc')]));});});});};exports[_0xfee8('0x4f')]=function(_0x2440cd){var _0x485f32=this;var _0x3b61bc=_0x2440cd[_0xfee8('0x22')][_0xfee8('0x1c')]['voiceQueueId'];var _0x1c98f2=_0x2440cd[_0xfee8('0x22')]['where'][_0xfee8('0x50')];return new Promise(function(_0xe1cc7a,_0x45845f){return db[_0xfee8('0x10')][_0xfee8('0x2a')]({'logging':!![],'where':{'voiceQueueId':_0x3b61bc,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0xfee8('0x3b')]['literal']('NOW()\x20+\x20INTERVAL\x20'+_0x1c98f2+_0xfee8('0x51')),'$gt':db['sequelize']['literal'](_0xfee8('0x52'))}}},'include':[{'model':db['CmContact'],'as':'Contact'},{'model':db[_0xfee8('0x2f')],'as':_0xfee8('0x30'),'attributes':['id',_0xfee8('0x31'),_0xfee8('0x32')]},{'model':db[_0xfee8('0x53')],'as':_0xfee8('0x54')}]})[_0xfee8('0x17')](function(_0x1528d0){console['log'](_0x1528d0);return db[_0xfee8('0x3b')][_0xfee8('0x29')](function(_0x1e87d6){return BPromise[_0xfee8('0x37')](_0x1528d0['map'](function(_0x4f4150){_0x4f4150[_0xfee8('0x20')]({'recallmeNotifiedDate':db[_0xfee8('0x3b')][_0xfee8('0x40')](_0xfee8('0x52'))},{'transaction':_0x1e87d6,'logging':!![]});}))[_0xfee8('0x17')](function(_0x1d9b47){console[_0xfee8('0x55')](_0x1d9b47);_0xe1cc7a(_0x1528d0);})[_0xfee8('0xe')](function(_0x4775f2){logger[_0xfee8('0xa')](_0xfee8('0x4f'),_0x4775f2[_0xfee8('0xc')],_0x2440cd);_0x45845f(_0x485f32[_0xfee8('0xa')](0x1f4,_0x4775f2[_0xfee8('0xc')]));});})[_0xfee8('0xe')](function(_0x47f14a){logger[_0xfee8('0xa')](_0xfee8('0x4f'),_0x47f14a[_0xfee8('0xc')],_0x2440cd);_0x45845f(_0x485f32[_0xfee8('0xa')](0x1f4,_0x47f14a[_0xfee8('0xc')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 9bb031c..d8eddd0 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 _0x4878=['show','/:id/previewrecall','getPreviewRecall','create','/preview','getPreview','getTimezone','update','delete','destroy','Router','../../components/auth/service','./cmHopper.controller','isAuthenticated','index','get','/describe','describe','/opencontacts','/timezones','getTimezones','/:id'];(function(_0x478481,_0x52705e){var _0x2e1674=function(_0x4f909e){while(--_0x4f909e){_0x478481['push'](_0x478481['shift']());}};_0x2e1674(++_0x52705e);}(_0x4878,0xa4));var _0x8487=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x4878[_0x17d9e3];return _0x14192d;};'use strict';var express=require('express');var router=express[_0x8487('0x0')]();var auth=require(_0x8487('0x1'));var controller=require(_0x8487('0x2'));router['get']('/',auth[_0x8487('0x3')](),controller[_0x8487('0x4')]);router[_0x8487('0x5')](_0x8487('0x6'),auth[_0x8487('0x3')](),controller[_0x8487('0x7')]);router[_0x8487('0x5')](_0x8487('0x8'),auth['isAuthenticated'](),controller['getOpenContacts']);router[_0x8487('0x5')](_0x8487('0x9'),auth[_0x8487('0x3')](),controller[_0x8487('0xa')]);router[_0x8487('0x5')](_0x8487('0xb'),auth[_0x8487('0x3')](),controller[_0x8487('0xc')]);router[_0x8487('0x5')](_0x8487('0xd'),auth[_0x8487('0x3')](),controller[_0x8487('0xe')]);router['post']('/',auth[_0x8487('0x3')](),controller[_0x8487('0xf')]);router['post'](_0x8487('0x10'),auth[_0x8487('0x3')](),controller[_0x8487('0x11')]);router['post']('/timezone',auth[_0x8487('0x3')](),controller[_0x8487('0x12')]);router['put'](_0x8487('0xb'),auth[_0x8487('0x3')](),controller[_0x8487('0x13')]);router[_0x8487('0x14')](_0x8487('0xb'),auth[_0x8487('0x3')](),controller[_0x8487('0x15')]);module['exports']=router; \ No newline at end of file +var _0x406c=['update','delete','exports','express','Router','../../components/auth/service','./cmHopper.controller','index','get','/describe','describe','isAuthenticated','/timezones','/:id','show','/:id/previewrecall','getPreviewRecall','post','create','/preview','getTimezone','put'];(function(_0x1e34ab,_0x2b70a0){var _0x701051=function(_0x23e830){while(--_0x23e830){_0x1e34ab['push'](_0x1e34ab['shift']());}};_0x701051(++_0x2b70a0);}(_0x406c,0x163));var _0xc406=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x406c[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0xc406('0x0'));var router=express[_0xc406('0x1')]();var auth=require(_0xc406('0x2'));var controller=require(_0xc406('0x3'));router['get']('/',auth['isAuthenticated'](),controller[_0xc406('0x4')]);router[_0xc406('0x5')](_0xc406('0x6'),auth['isAuthenticated'](),controller[_0xc406('0x7')]);router[_0xc406('0x5')]('/opencontacts',auth[_0xc406('0x8')](),controller['getOpenContacts']);router['get'](_0xc406('0x9'),auth['isAuthenticated'](),controller['getTimezones']);router['get'](_0xc406('0xa'),auth[_0xc406('0x8')](),controller[_0xc406('0xb')]);router[_0xc406('0x5')](_0xc406('0xc'),auth[_0xc406('0x8')](),controller[_0xc406('0xd')]);router[_0xc406('0xe')]('/',auth[_0xc406('0x8')](),controller[_0xc406('0xf')]);router[_0xc406('0xe')](_0xc406('0x10'),auth[_0xc406('0x8')](),controller['getPreview']);router[_0xc406('0xe')]('/timezone',auth[_0xc406('0x8')](),controller[_0xc406('0x11')]);router[_0xc406('0x12')](_0xc406('0xa'),auth[_0xc406('0x8')](),controller[_0xc406('0x13')]);router[_0xc406('0x14')](_0xc406('0xa'),auth[_0xc406('0x8')](),controller['destroy']);module[_0xc406('0x15')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 58a474a..98786c0 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 _0xed08=['STRING','INTEGER','contactListQueue','sequelize','exports'];(function(_0xf913b3,_0x23f46a){var _0x288876=function(_0x5d35fb){while(--_0x5d35fb){_0xf913b3['push'](_0xf913b3['shift']());}};_0x288876(++_0x23f46a);}(_0xed08,0x67));var _0x8ed0=function(_0x442fc6,_0x1e9553){_0x442fc6=_0x442fc6-0x0;var _0x4185a8=_0xed08[_0x442fc6];return _0x4185a8;};'use strict';var moment=require('moment');var Sequelize=require(_0x8ed0('0x0'));module[_0x8ed0('0x1')]={'phone':{'type':Sequelize[_0x8ed0('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x8ed0('0x3')],'unique':_0x8ed0('0x4')},'ListId':{'type':Sequelize[_0x8ed0('0x3')],'unique':_0x8ed0('0x4')},'VoiceQueueId':{'type':Sequelize[_0x8ed0('0x3')],'unique':_0x8ed0('0x4')}}; \ No newline at end of file +var _0x75d2=['INTEGER','contactListQueue','moment','sequelize','exports','STRING'];(function(_0x87bd7d,_0x2e7a6b){var _0x1c10c4=function(_0x3da0f3){while(--_0x3da0f3){_0x87bd7d['push'](_0x87bd7d['shift']());}};_0x1c10c4(++_0x2e7a6b);}(_0x75d2,0x152));var _0x275d=function(_0x359bbe,_0x5b7fcc){_0x359bbe=_0x359bbe-0x0;var _0x1b3353=_0x75d2[_0x359bbe];return _0x1b3353;};'use strict';var moment=require(_0x275d('0x0'));var Sequelize=require(_0x275d('0x1'));module[_0x275d('0x2')]={'phone':{'type':Sequelize[_0x275d('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x275d('0x4')],'unique':_0x275d('0x5')},'ListId':{'type':Sequelize[_0x275d('0x4')],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize[_0x275d('0x4')],'unique':'contactListQueue'}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index c80e829..521d53f 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 _0x1a4a=['query','filters','intersection','attributes','fields','length','limit','where','pick','filter','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','includeAll','merge','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','CmHopperBlack','rawAttributes','type','key','model'];(function(_0x5c5abc,_0x5ae71a){var _0x3de931=function(_0x5792b2){while(--_0x5792b2){_0x5c5abc['push'](_0x5c5abc['shift']());}};_0x3de931(++_0x5ae71a);}(_0x1a4a,0xae));var _0xa1a4=function(_0x2532a5,_0x34a44a){_0x2532a5=_0x2532a5-0x0;var _0x451e10=_0x1a4a[_0x2532a5];return _0x451e10;};'use strict';var emlformat=require(_0xa1a4('0x0'));var rimraf=require(_0xa1a4('0x1'));var zipdir=require(_0xa1a4('0x2'));var jsonpatch=require(_0xa1a4('0x3'));var rp=require(_0xa1a4('0x4'));var moment=require(_0xa1a4('0x5'));var BPromise=require(_0xa1a4('0x6'));var Mustache=require(_0xa1a4('0x7'));var util=require(_0xa1a4('0x8'));var path=require(_0xa1a4('0x9'));var sox=require(_0xa1a4('0xa'));var csv=require(_0xa1a4('0xb'));var ejs=require(_0xa1a4('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa1a4('0xd'));var squel=require(_0xa1a4('0xe'));var crypto=require(_0xa1a4('0xf'));var jsforce=require(_0xa1a4('0x10'));var deskjs=require(_0xa1a4('0x11'));var toCsv=require(_0xa1a4('0xb'));var querystring=require(_0xa1a4('0x12'));var Papa=require(_0xa1a4('0x13'));var Redis=require(_0xa1a4('0x14'));var authService=require(_0xa1a4('0x15'));var qs=require(_0xa1a4('0x16'));var as=require(_0xa1a4('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xa1a4('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xa1a4('0x19'))['db'];function respondWithStatusCode(_0xe359f4,_0xea77f){_0xea77f=_0xea77f||0xcc;return function(_0x17f768){if(_0x17f768){return _0xe359f4[_0xa1a4('0x1a')](_0xea77f);}return _0xe359f4[_0xa1a4('0x1b')](_0xea77f)[_0xa1a4('0x1c')]();};}function respondWithResult(_0x2751fc,_0x130174){_0x130174=_0x130174||0xc8;return function(_0x16c14d){if(_0x16c14d){return _0x2751fc[_0xa1a4('0x1b')](_0x130174)[_0xa1a4('0x1d')](_0x16c14d);}};}function respondWithFilteredResult(_0x3e8c06,_0x5ad88){return function(_0x162f41){if(_0x162f41){var _0x42d6c4=typeof _0x5ad88[_0xa1a4('0x1e')]===_0xa1a4('0x1f')&&typeof _0x5ad88['limit']===_0xa1a4('0x1f');var _0x251554=_0x162f41[_0xa1a4('0x20')];var _0x19ba43=_0x42d6c4?0x0:_0x5ad88[_0xa1a4('0x1e')];var _0x1b7a0c=_0x42d6c4?_0x162f41[_0xa1a4('0x20')]:_0x5ad88[_0xa1a4('0x1e')]+_0x5ad88['limit'];var _0x53a87f;if(_0x1b7a0c>=_0x251554){_0x1b7a0c=_0x251554;_0x53a87f=0xc8;}else{_0x53a87f=0xce;}_0x3e8c06[_0xa1a4('0x1b')](_0x53a87f);return _0x3e8c06['set'](_0xa1a4('0x21'),_0x19ba43+'-'+_0x1b7a0c+'/'+_0x251554)['json'](_0x162f41);}return null;};}function patchUpdates(_0x5cf5c1){return function(_0x5eef6f){try{jsonpatch[_0xa1a4('0x22')](_0x5eef6f,_0x5cf5c1,!![]);}catch(_0x5235a9){return BPromise[_0xa1a4('0x23')](_0x5235a9);}return _0x5eef6f[_0xa1a4('0x24')]();};}function saveUpdates(_0x36f281,_0x21e64f){return function(_0x4c50ea){if(_0x4c50ea){return _0x4c50ea[_0xa1a4('0x25')](_0x36f281)[_0xa1a4('0x26')](function(_0x2b160e){return _0x2b160e;});}return null;};}function removeEntity(_0x599091,_0x3c2dfc){return function(_0x76b288){if(_0x76b288){return _0x76b288[_0xa1a4('0x27')]()[_0xa1a4('0x26')](function(){_0x599091['status'](0xcc)[_0xa1a4('0x1c')]();});}};}function handleEntityNotFound(_0x454576,_0x53435d){return function(_0x1d55d4){if(!_0x1d55d4){_0x454576[_0xa1a4('0x1a')](0x194);}return _0x1d55d4;};}function handleError(_0x2a6e16,_0x53e5d9){_0x53e5d9=_0x53e5d9||0x1f4;return function(_0x2fd66f){logger[_0xa1a4('0x28')](_0x2fd66f[_0xa1a4('0x29')]);if(_0x2fd66f[_0xa1a4('0x2a')]){delete _0x2fd66f[_0xa1a4('0x2a')];}_0x2a6e16[_0xa1a4('0x1b')](_0x53e5d9)[_0xa1a4('0x2b')](_0x2fd66f);};}exports[_0xa1a4('0x2c')]=function(_0x17b179,_0x22d8e7){var _0x5432fb={},_0x34765d={},_0x525810={'count':0x0,'rows':[]};var _0x14c8b0=_[_0xa1a4('0x2d')](db[_0xa1a4('0x2e')][_0xa1a4('0x2f')],function(_0x5869e7){return{'name':_0x5869e7['fieldName'],'type':_0x5869e7[_0xa1a4('0x30')][_0xa1a4('0x31')]};});_0x34765d[_0xa1a4('0x32')]=_['map'](_0x14c8b0,_0xa1a4('0x2a'));_0x34765d[_0xa1a4('0x33')]=_['keys'](_0x17b179[_0xa1a4('0x33')]);_0x34765d[_0xa1a4('0x34')]=_[_0xa1a4('0x35')](_0x34765d[_0xa1a4('0x32')],_0x34765d[_0xa1a4('0x33')]);_0x5432fb[_0xa1a4('0x36')]=_[_0xa1a4('0x35')](_0x34765d['model'],qs[_0xa1a4('0x37')](_0x17b179[_0xa1a4('0x33')][_0xa1a4('0x37')]));_0x5432fb['attributes']=_0x5432fb[_0xa1a4('0x36')][_0xa1a4('0x38')]?_0x5432fb[_0xa1a4('0x36')]:_0x34765d['model'];if(!_0x17b179[_0xa1a4('0x33')]['hasOwnProperty']('nolimit')){_0x5432fb[_0xa1a4('0x39')]=qs[_0xa1a4('0x39')](_0x17b179['query'][_0xa1a4('0x39')]);_0x5432fb[_0xa1a4('0x1e')]=qs[_0xa1a4('0x1e')](_0x17b179[_0xa1a4('0x33')]['offset']);}_0x5432fb['order']=qs['sort'](_0x17b179[_0xa1a4('0x33')]['sort']);_0x5432fb[_0xa1a4('0x3a')]=qs[_0xa1a4('0x34')](_[_0xa1a4('0x3b')](_0x17b179[_0xa1a4('0x33')],_0x34765d[_0xa1a4('0x34')]),_0x14c8b0);if(_0x17b179[_0xa1a4('0x33')][_0xa1a4('0x3c')]){_0x5432fb[_0xa1a4('0x3a')]=_['merge'](_0x5432fb[_0xa1a4('0x3a')],{'$or':_[_0xa1a4('0x2d')](_0x14c8b0,function(_0x3e551a){if(_0x3e551a['type']!==_0xa1a4('0x3d')){var _0xed30db={};_0xed30db[_0x3e551a['name']]={'$like':'%'+_0x17b179[_0xa1a4('0x33')]['filter']+'%'};return _0xed30db;}})});}_0x5432fb=_['merge']({},_0x5432fb,_0x17b179[_0xa1a4('0x3e')]);var _0x3dc047={'where':_0x5432fb[_0xa1a4('0x3a')]};return db[_0xa1a4('0x2e')][_0xa1a4('0x20')](_0x3dc047)['then'](function(_0x201861){_0x525810[_0xa1a4('0x20')]=_0x201861;if(_0x17b179[_0xa1a4('0x33')]['includeAll']){_0x5432fb[_0xa1a4('0x3f')]=[{'all':!![]}];}return db[_0xa1a4('0x2e')][_0xa1a4('0x40')](_0x5432fb);})['then'](function(_0x24ab66){_0x525810[_0xa1a4('0x41')]=_0x24ab66;return _0x525810;})['then'](respondWithFilteredResult(_0x22d8e7,_0x5432fb))[_0xa1a4('0x42')](handleError(_0x22d8e7,null));};exports[_0xa1a4('0x43')]=function(_0x5eecfd,_0xbbe207){var _0x49bbf5={'raw':!![],'where':{'id':_0x5eecfd[_0xa1a4('0x44')]['id']}},_0x34691b={};_0x34691b[_0xa1a4('0x32')]=_[_0xa1a4('0x45')](db['CmHopperBlack'][_0xa1a4('0x2f')]);_0x34691b[_0xa1a4('0x33')]=_[_0xa1a4('0x45')](_0x5eecfd['query']);_0x34691b[_0xa1a4('0x34')]=_['intersection'](_0x34691b[_0xa1a4('0x32')],_0x34691b['query']);_0x49bbf5['attributes']=_['intersection'](_0x34691b['model'],qs[_0xa1a4('0x37')](_0x5eecfd['query']['fields']));_0x49bbf5[_0xa1a4('0x36')]=_0x49bbf5[_0xa1a4('0x36')][_0xa1a4('0x38')]?_0x49bbf5['attributes']:_0x34691b[_0xa1a4('0x32')];if(_0x5eecfd[_0xa1a4('0x33')][_0xa1a4('0x46')]){_0x49bbf5['include']=[{'all':!![]}];}_0x49bbf5=_[_0xa1a4('0x47')]({},_0x49bbf5,_0x5eecfd[_0xa1a4('0x3e')]);return db[_0xa1a4('0x2e')][_0xa1a4('0x48')](_0x49bbf5)['then'](handleEntityNotFound(_0xbbe207,null))[_0xa1a4('0x26')](respondWithResult(_0xbbe207,null))[_0xa1a4('0x42')](handleError(_0xbbe207,null));};exports[_0xa1a4('0x25')]=function(_0x5cfd7b,_0x551074){if(_0x5cfd7b['body']['id']){delete _0x5cfd7b['body']['id'];}return db[_0xa1a4('0x2e')][_0xa1a4('0x48')]({'where':{'id':_0x5cfd7b[_0xa1a4('0x44')]['id']}})['then'](handleEntityNotFound(_0x551074,null))[_0xa1a4('0x26')](saveUpdates(_0x5cfd7b[_0xa1a4('0x49')],null))[_0xa1a4('0x26')](respondWithResult(_0x551074,null))[_0xa1a4('0x42')](handleError(_0x551074,null));};exports[_0xa1a4('0x27')]=function(_0x382d37,_0x1b99dc){return db[_0xa1a4('0x2e')][_0xa1a4('0x48')]({'where':{'id':_0x382d37[_0xa1a4('0x44')]['id']}})[_0xa1a4('0x26')](handleEntityNotFound(_0x1b99dc,null))[_0xa1a4('0x26')](removeEntity(_0x1b99dc,null))['catch'](handleError(_0x1b99dc,null));};exports[_0xa1a4('0x4a')]=function(_0x150cfb,_0x1b2b9b){return db[_0xa1a4('0x2e')]['describe']()['then'](respondWithResult(_0x1b2b9b,null))[_0xa1a4('0x42')](handleError(_0x1b2b9b,null));}; \ No newline at end of file +var _0x9f99=['papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','map','CmHopperBlack','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring'];(function(_0x4dde18,_0x427cb8){var _0xc43139=function(_0x50d4dd){while(--_0x50d4dd){_0x4dde18['push'](_0x4dde18['shift']());}};_0xc43139(++_0x427cb8);}(_0x9f99,0xd3));var _0x99f9=function(_0x21c68b,_0x7e935f){_0x21c68b=_0x21c68b-0x0;var _0x1ee46b=_0x9f99[_0x21c68b];return _0x1ee46b;};'use strict';var emlformat=require(_0x99f9('0x0'));var rimraf=require(_0x99f9('0x1'));var zipdir=require(_0x99f9('0x2'));var jsonpatch=require(_0x99f9('0x3'));var rp=require(_0x99f9('0x4'));var moment=require(_0x99f9('0x5'));var BPromise=require(_0x99f9('0x6'));var Mustache=require(_0x99f9('0x7'));var util=require(_0x99f9('0x8'));var path=require(_0x99f9('0x9'));var sox=require('sox');var csv=require(_0x99f9('0xa'));var ejs=require(_0x99f9('0xb'));var fs=require('fs');var fs_extra=require(_0x99f9('0xc'));var _=require(_0x99f9('0xd'));var squel=require('squel');var crypto=require(_0x99f9('0xe'));var jsforce=require(_0x99f9('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x99f9('0xa'));var querystring=require(_0x99f9('0x10'));var Papa=require(_0x99f9('0x11'));var Redis=require('ioredis');var authService=require(_0x99f9('0x12'));var qs=require(_0x99f9('0x13'));var as=require(_0x99f9('0x14'));var hardwareService=require(_0x99f9('0x15'));var logger=require(_0x99f9('0x16'))('api');var utils=require(_0x99f9('0x17'));var config=require(_0x99f9('0x18'));var licenseUtil=require(_0x99f9('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4933e7,_0x1d0234){_0x1d0234=_0x1d0234||0xcc;return function(_0x5e3065){if(_0x5e3065){return _0x4933e7[_0x99f9('0x1a')](_0x1d0234);}return _0x4933e7[_0x99f9('0x1b')](_0x1d0234)[_0x99f9('0x1c')]();};}function respondWithResult(_0x2f13cd,_0x326a33){_0x326a33=_0x326a33||0xc8;return function(_0x375d26){if(_0x375d26){return _0x2f13cd[_0x99f9('0x1b')](_0x326a33)[_0x99f9('0x1d')](_0x375d26);}};}function respondWithFilteredResult(_0x25f00d,_0x47220f){return function(_0x45ca10){if(_0x45ca10){var _0x1a1b56=typeof _0x47220f[_0x99f9('0x1e')]==='undefined'&&typeof _0x47220f['limit']===_0x99f9('0x1f');var _0x1324d2=_0x45ca10[_0x99f9('0x20')];var _0x376b3a=_0x1a1b56?0x0:_0x47220f['offset'];var _0x4e069f=_0x1a1b56?_0x45ca10[_0x99f9('0x20')]:_0x47220f[_0x99f9('0x1e')]+_0x47220f['limit'];var _0x52f981;if(_0x4e069f>=_0x1324d2){_0x4e069f=_0x1324d2;_0x52f981=0xc8;}else{_0x52f981=0xce;}_0x25f00d['status'](_0x52f981);return _0x25f00d[_0x99f9('0x21')](_0x99f9('0x22'),_0x376b3a+'-'+_0x4e069f+'/'+_0x1324d2)[_0x99f9('0x1d')](_0x45ca10);}return null;};}function patchUpdates(_0x593ae4){return function(_0x36812c){try{jsonpatch[_0x99f9('0x23')](_0x36812c,_0x593ae4,!![]);}catch(_0x4238e5){return BPromise[_0x99f9('0x24')](_0x4238e5);}return _0x36812c[_0x99f9('0x25')]();};}function saveUpdates(_0x275e85,_0x2f4306){return function(_0x5a52f8){if(_0x5a52f8){return _0x5a52f8[_0x99f9('0x26')](_0x275e85)[_0x99f9('0x27')](function(_0x9db83e){return _0x9db83e;});}return null;};}function removeEntity(_0x347343,_0x4d398f){return function(_0x28ab86){if(_0x28ab86){return _0x28ab86[_0x99f9('0x28')]()[_0x99f9('0x27')](function(){_0x347343[_0x99f9('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f0326,_0x36439b){return function(_0x5ef2ba){if(!_0x5ef2ba){_0x1f0326[_0x99f9('0x1a')](0x194);}return _0x5ef2ba;};}function handleError(_0x4c9956,_0x4f5f25){_0x4f5f25=_0x4f5f25||0x1f4;return function(_0xd1d144){logger['error'](_0xd1d144[_0x99f9('0x29')]);if(_0xd1d144[_0x99f9('0x2a')]){delete _0xd1d144[_0x99f9('0x2a')];}_0x4c9956[_0x99f9('0x1b')](_0x4f5f25)[_0x99f9('0x2b')](_0xd1d144);};}exports['index']=function(_0xc91065,_0x38b64e){var _0x30b99c={},_0x8241ae={},_0x1e0359={'count':0x0,'rows':[]};var _0x2b8a3d=_[_0x99f9('0x2c')](db[_0x99f9('0x2d')][_0x99f9('0x2e')],function(_0x5028fd){return{'name':_0x5028fd[_0x99f9('0x2f')],'type':_0x5028fd[_0x99f9('0x30')][_0x99f9('0x31')]};});_0x8241ae['model']=_['map'](_0x2b8a3d,_0x99f9('0x2a'));_0x8241ae['query']=_[_0x99f9('0x32')](_0xc91065[_0x99f9('0x33')]);_0x8241ae[_0x99f9('0x34')]=_[_0x99f9('0x35')](_0x8241ae[_0x99f9('0x36')],_0x8241ae['query']);_0x30b99c[_0x99f9('0x37')]=_[_0x99f9('0x35')](_0x8241ae[_0x99f9('0x36')],qs[_0x99f9('0x38')](_0xc91065[_0x99f9('0x33')][_0x99f9('0x38')]));_0x30b99c[_0x99f9('0x37')]=_0x30b99c[_0x99f9('0x37')][_0x99f9('0x39')]?_0x30b99c[_0x99f9('0x37')]:_0x8241ae[_0x99f9('0x36')];if(!_0xc91065['query'][_0x99f9('0x3a')](_0x99f9('0x3b'))){_0x30b99c[_0x99f9('0x3c')]=qs[_0x99f9('0x3c')](_0xc91065['query'][_0x99f9('0x3c')]);_0x30b99c['offset']=qs['offset'](_0xc91065[_0x99f9('0x33')][_0x99f9('0x1e')]);}_0x30b99c['order']=qs[_0x99f9('0x3d')](_0xc91065[_0x99f9('0x33')][_0x99f9('0x3d')]);_0x30b99c[_0x99f9('0x3e')]=qs[_0x99f9('0x34')](_[_0x99f9('0x3f')](_0xc91065[_0x99f9('0x33')],_0x8241ae['filters']),_0x2b8a3d);if(_0xc91065[_0x99f9('0x33')][_0x99f9('0x40')]){_0x30b99c['where']=_[_0x99f9('0x41')](_0x30b99c['where'],{'$or':_[_0x99f9('0x2c')](_0x2b8a3d,function(_0x41596d){if(_0x41596d['type']!=='VIRTUAL'){var _0x5923ae={};_0x5923ae[_0x41596d['name']]={'$like':'%'+_0xc91065['query'][_0x99f9('0x40')]+'%'};return _0x5923ae;}})});}_0x30b99c=_[_0x99f9('0x41')]({},_0x30b99c,_0xc91065[_0x99f9('0x42')]);var _0x4097a4={'where':_0x30b99c[_0x99f9('0x3e')]};return db[_0x99f9('0x2d')][_0x99f9('0x20')](_0x4097a4)[_0x99f9('0x27')](function(_0x19c76c){_0x1e0359[_0x99f9('0x20')]=_0x19c76c;if(_0xc91065[_0x99f9('0x33')][_0x99f9('0x43')]){_0x30b99c[_0x99f9('0x44')]=[{'all':!![]}];}return db[_0x99f9('0x2d')][_0x99f9('0x45')](_0x30b99c);})[_0x99f9('0x27')](function(_0x93fb66){_0x1e0359[_0x99f9('0x46')]=_0x93fb66;return _0x1e0359;})[_0x99f9('0x27')](respondWithFilteredResult(_0x38b64e,_0x30b99c))[_0x99f9('0x47')](handleError(_0x38b64e,null));};exports['show']=function(_0xc392,_0x1beba6){var _0xd2b116={'raw':!![],'where':{'id':_0xc392[_0x99f9('0x48')]['id']}},_0x5dd0ae={};_0x5dd0ae['model']=_[_0x99f9('0x32')](db['CmHopperBlack'][_0x99f9('0x2e')]);_0x5dd0ae['query']=_['keys'](_0xc392[_0x99f9('0x33')]);_0x5dd0ae[_0x99f9('0x34')]=_['intersection'](_0x5dd0ae[_0x99f9('0x36')],_0x5dd0ae['query']);_0xd2b116[_0x99f9('0x37')]=_[_0x99f9('0x35')](_0x5dd0ae['model'],qs[_0x99f9('0x38')](_0xc392[_0x99f9('0x33')][_0x99f9('0x38')]));_0xd2b116[_0x99f9('0x37')]=_0xd2b116[_0x99f9('0x37')][_0x99f9('0x39')]?_0xd2b116[_0x99f9('0x37')]:_0x5dd0ae[_0x99f9('0x36')];if(_0xc392[_0x99f9('0x33')][_0x99f9('0x43')]){_0xd2b116[_0x99f9('0x44')]=[{'all':!![]}];}_0xd2b116=_[_0x99f9('0x41')]({},_0xd2b116,_0xc392['options']);return db[_0x99f9('0x2d')]['find'](_0xd2b116)[_0x99f9('0x27')](handleEntityNotFound(_0x1beba6,null))[_0x99f9('0x27')](respondWithResult(_0x1beba6,null))[_0x99f9('0x47')](handleError(_0x1beba6,null));};exports[_0x99f9('0x26')]=function(_0xc004d5,_0x194aaa){if(_0xc004d5[_0x99f9('0x49')]['id']){delete _0xc004d5[_0x99f9('0x49')]['id'];}return db[_0x99f9('0x2d')][_0x99f9('0x4a')]({'where':{'id':_0xc004d5[_0x99f9('0x48')]['id']}})[_0x99f9('0x27')](handleEntityNotFound(_0x194aaa,null))[_0x99f9('0x27')](saveUpdates(_0xc004d5['body'],null))['then'](respondWithResult(_0x194aaa,null))[_0x99f9('0x47')](handleError(_0x194aaa,null));};exports[_0x99f9('0x28')]=function(_0x1575aa,_0x268853){return db['CmHopperBlack']['find']({'where':{'id':_0x1575aa[_0x99f9('0x48')]['id']}})[_0x99f9('0x27')](handleEntityNotFound(_0x268853,null))['then'](removeEntity(_0x268853,null))[_0x99f9('0x47')](handleError(_0x268853,null));};exports[_0x99f9('0x4b')]=function(_0x106b0c,_0x471433){return db[_0x99f9('0x2d')]['describe']()[_0x99f9('0x27')](respondWithResult(_0x471433,null))[_0x99f9('0x47')](handleError(_0x471433,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 3439f59..c867e03 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 _0x0eab=['CmHopperBlack','cm_hopper_black','lodash','../../config/logger','api','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define'];(function(_0x28127e,_0x28a8d6){var _0x3a36ee=function(_0x58d46f){while(--_0x58d46f){_0x28127e['push'](_0x28127e['shift']());}};_0x3a36ee(++_0x28a8d6);}(_0x0eab,0x1af));var _0xb0ea=function(_0xf7f1ab,_0x65b6cb){_0xf7f1ab=_0xf7f1ab-0x0;var _0x391bf0=_0x0eab[_0xf7f1ab];return _0x391bf0;};'use strict';var _=require(_0xb0ea('0x0'));var util=require('util');var logger=require(_0xb0ea('0x1'))(_0xb0ea('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb0ea('0x3'));var rimraf=require(_0xb0ea('0x4'));var config=require(_0xb0ea('0x5'));var attributes=require(_0xb0ea('0x6'));module[_0xb0ea('0x7')]=function(_0x11ed12,_0x4e758f){return _0x11ed12[_0xb0ea('0x8')](_0xb0ea('0x9'),attributes,{'tableName':_0xb0ea('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x694d=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./cmHopperBlack.attributes','define','CmHopperBlack','cm_hopper_black'];(function(_0x1846b8,_0x5e9fd2){var _0x5d29ea=function(_0x26ffc3){while(--_0x26ffc3){_0x1846b8['push'](_0x1846b8['shift']());}};_0x5d29ea(++_0x5e9fd2);}(_0x694d,0xc0));var _0xd694=function(_0x171486,_0x31349b){_0x171486=_0x171486-0x0;var _0x28e3d2=_0x694d[_0x171486];return _0x28e3d2;};'use strict';var _=require(_0xd694('0x0'));var util=require(_0xd694('0x1'));var logger=require(_0xd694('0x2'))(_0xd694('0x3'));var moment=require(_0xd694('0x4'));var BPromise=require(_0xd694('0x5'));var rp=require(_0xd694('0x6'));var fs=require('fs');var path=require(_0xd694('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd694('0x8'));module['exports']=function(_0x5725d0,_0x59ee63){return _0x5725d0[_0xd694('0x9')](_0xd694('0xa'),attributes,{'tableName':_0xd694('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index e2501f7..165a195 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 _0xd4db=['CmHopperBlack','findAll','options','raw','where','attributes','limit','include','map','model','UpdateCmHopperBlack','update','DestroyCmHopperBlack','destroy','lodash','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetCmHopperBlack'];(function(_0x2a2df3,_0x30084e){var _0x3f9eb8=function(_0x3efd2e){while(--_0x3efd2e){_0x2a2df3['push'](_0x2a2df3['shift']());}};_0x3f9eb8(++_0x30084e);}(_0xd4db,0x1e2));var _0xbd4d=function(_0x59113d,_0x5ba181){_0x59113d=_0x59113d-0x0;var _0x5bde53=_0xd4db[_0x59113d];return _0x5bde53;};'use strict';var _=require(_0xbd4d('0x0'));var util=require('util');var moment=require(_0xbd4d('0x1'));var BPromise=require(_0xbd4d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbd4d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbd4d('0x4'));var logger=require('../../config/logger')(_0xbd4d('0x5'));var config=require(_0xbd4d('0x6'));var jayson=require(_0xbd4d('0x7'));var client=jayson[_0xbd4d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c089e,_0x1d15dc,_0x2ba7bf){return new BPromise(function(_0x48c55f,_0x5693c6){return client[_0xbd4d('0x9')](_0x5c089e,_0x2ba7bf)[_0xbd4d('0xa')](function(_0x22b3a0){logger[_0xbd4d('0xb')](_0xbd4d('0xc'),_0x1d15dc,_0xbd4d('0xd'));logger[_0xbd4d('0xe')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x1d15dc,_0xbd4d('0xd'),JSON[_0xbd4d('0xf')](_0x22b3a0));if(_0x22b3a0[_0xbd4d('0x10')]){if(_0x22b3a0[_0xbd4d('0x10')][_0xbd4d('0x11')]===0x1f4){logger[_0xbd4d('0x10')](_0xbd4d('0xc'),_0x1d15dc,_0x22b3a0[_0xbd4d('0x10')][_0xbd4d('0x12')]);return _0x5693c6(_0x22b3a0[_0xbd4d('0x10')][_0xbd4d('0x12')]);}logger['error'](_0xbd4d('0xc'),_0x1d15dc,_0x22b3a0[_0xbd4d('0x10')][_0xbd4d('0x12')]);return _0x48c55f(_0x22b3a0[_0xbd4d('0x10')][_0xbd4d('0x12')]);}else{logger[_0xbd4d('0xb')](_0xbd4d('0xc'),_0x1d15dc,_0xbd4d('0xd'));_0x48c55f(_0x22b3a0[_0xbd4d('0x13')][_0xbd4d('0x12')]);}})[_0xbd4d('0x14')](function(_0x2c645f){logger[_0xbd4d('0x10')](_0xbd4d('0xc'),_0x1d15dc,_0x2c645f);_0x5693c6(_0x2c645f);});});}exports[_0xbd4d('0x15')]=function(_0x15eff4){var _0x38c22b=this;return new Promise(function(_0x1e0c71,_0x15758b){return db[_0xbd4d('0x16')][_0xbd4d('0x17')]({'raw':_0x15eff4[_0xbd4d('0x18')]?_0x15eff4[_0xbd4d('0x18')][_0xbd4d('0x19')]===undefined?!![]:![]:!![],'where':_0x15eff4['options']?_0x15eff4['options'][_0xbd4d('0x1a')]||null:null,'attributes':_0x15eff4[_0xbd4d('0x18')]?_0x15eff4[_0xbd4d('0x18')][_0xbd4d('0x1b')]||null:null,'limit':_0x15eff4[_0xbd4d('0x18')]?_0x15eff4['options'][_0xbd4d('0x1c')]||null:null,'include':_0x15eff4['options']?_0x15eff4['options'][_0xbd4d('0x1d')]?_[_0xbd4d('0x1e')](_0x15eff4[_0xbd4d('0x18')][_0xbd4d('0x1d')],function(_0x28a7c3){return{'model':db[_0x28a7c3[_0xbd4d('0x1f')]],'as':_0x28a7c3['as'],'attributes':_0x28a7c3[_0xbd4d('0x1b')],'include':_0x28a7c3[_0xbd4d('0x1d')]?_[_0xbd4d('0x1e')](_0x28a7c3[_0xbd4d('0x1d')],function(_0x241993){return{'model':db[_0x241993['model']],'as':_0x241993['as'],'attributes':_0x241993[_0xbd4d('0x1b')],'include':_0x241993['include']?_[_0xbd4d('0x1e')](_0x241993[_0xbd4d('0x1d')],function(_0x12b93c){return{'model':db[_0x12b93c[_0xbd4d('0x1f')]],'as':_0x12b93c['as'],'attributes':_0x12b93c[_0xbd4d('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xbd4d('0xa')](function(_0x4ad3ad){logger[_0xbd4d('0xb')]('GetCmHopperBlack',_0x15eff4);logger[_0xbd4d('0xe')]('GetCmHopperBlack',_0x15eff4,JSON[_0xbd4d('0xf')](_0x4ad3ad));_0x1e0c71(_0x4ad3ad);})[_0xbd4d('0x14')](function(_0x426fc9){logger['error'](_0xbd4d('0x15'),_0x426fc9[_0xbd4d('0x12')],_0x15eff4);_0x15758b(_0x38c22b['error'](0x1f4,_0x426fc9[_0xbd4d('0x12')]));});});};exports[_0xbd4d('0x20')]=function(_0x463681){var _0x17c831=this;return new Promise(function(_0xa35b6c,_0x2ce6f5){return db[_0xbd4d('0x16')][_0xbd4d('0x21')](_0x463681['body'],{'raw':_0x463681[_0xbd4d('0x18')]?_0x463681[_0xbd4d('0x18')][_0xbd4d('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x463681[_0xbd4d('0x18')]?_0x463681[_0xbd4d('0x18')][_0xbd4d('0x1a')]||null:null,'attributes':_0x463681[_0xbd4d('0x18')]?_0x463681['options'][_0xbd4d('0x1b')]||null:null,'limit':_0x463681[_0xbd4d('0x18')]?_0x463681['options'][_0xbd4d('0x1c')]||null:null})['then'](function(_0x287460){logger[_0xbd4d('0xb')](_0xbd4d('0x20'),_0x463681);logger[_0xbd4d('0xe')](_0xbd4d('0x20'),_0x463681,JSON[_0xbd4d('0xf')](_0x287460));_0xa35b6c(_0x287460);})[_0xbd4d('0x14')](function(_0x273b18){logger[_0xbd4d('0x10')](_0xbd4d('0x20'),_0x273b18[_0xbd4d('0x12')],_0x463681);_0x2ce6f5(_0x17c831[_0xbd4d('0x10')](0x1f4,_0x273b18[_0xbd4d('0x12')]));});});};exports[_0xbd4d('0x22')]=function(_0x4a04cb){var _0x4706e6=this;return new Promise(function(_0x442e73,_0x132c0e){return db[_0xbd4d('0x16')][_0xbd4d('0x23')]({'where':_0x4a04cb[_0xbd4d('0x18')]?_0x4a04cb[_0xbd4d('0x18')]['where']||null:null})[_0xbd4d('0xa')](function(_0x2384e5){logger[_0xbd4d('0xb')]('DestroyCmHopperBlack',_0x4a04cb);logger[_0xbd4d('0xe')](_0xbd4d('0x22'),_0x4a04cb,JSON['stringify'](_0x2384e5));_0x442e73(_0x2384e5);})['catch'](function(_0x269abd){logger[_0xbd4d('0x10')]('DestroyCmHopperBlack',_0x269abd[_0xbd4d('0x12')],_0x4a04cb);_0x132c0e(_0x4706e6[_0xbd4d('0x10')](0x1f4,_0x269abd['message']));});});}; \ No newline at end of file +var _0xbabf=['client','http','then','info','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopperBlack,\x20%s,\x20%s','message','result','GetCmHopperBlack','options','raw','attributes','include','map','model','catch','UpdateCmHopperBlack','CmHopperBlack','update','body','where','limit','DestroyCmHopperBlack','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xbc2fe9,_0x44d03c){var _0x2d98b4=function(_0x1b13a1){while(--_0x1b13a1){_0xbc2fe9['push'](_0xbc2fe9['shift']());}};_0x2d98b4(++_0x44d03c);}(_0xbabf,0x91));var _0xfbab=function(_0x1abb09,_0x18ee91){_0x1abb09=_0x1abb09-0x0;var _0xea1c07=_0xbabf[_0x1abb09];return _0xea1c07;};'use strict';var _=require(_0xfbab('0x0'));var util=require(_0xfbab('0x1'));var moment=require(_0xfbab('0x2'));var BPromise=require(_0xfbab('0x3'));var rs=require(_0xfbab('0x4'));var fs=require('fs');var Redis=require(_0xfbab('0x5'));var db=require(_0xfbab('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xfbab('0x7'))(_0xfbab('0x8'));var config=require(_0xfbab('0x9'));var jayson=require(_0xfbab('0xa'));var client=jayson[_0xfbab('0xb')][_0xfbab('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4db8ee,_0x2e943,_0x396888){return new BPromise(function(_0x396e42,_0x202fb2){return client['request'](_0x4db8ee,_0x396888)[_0xfbab('0xd')](function(_0x3d3829){logger[_0xfbab('0xe')]('CmHopperBlack,\x20%s,\x20%s',_0x2e943,_0xfbab('0xf'));logger[_0xfbab('0x10')](_0xfbab('0x11'),_0x2e943,_0xfbab('0xf'),JSON[_0xfbab('0x12')](_0x3d3829));if(_0x3d3829['error']){if(_0x3d3829[_0xfbab('0x13')][_0xfbab('0x14')]===0x1f4){logger[_0xfbab('0x13')](_0xfbab('0x15'),_0x2e943,_0x3d3829[_0xfbab('0x13')][_0xfbab('0x16')]);return _0x202fb2(_0x3d3829[_0xfbab('0x13')][_0xfbab('0x16')]);}logger[_0xfbab('0x13')](_0xfbab('0x15'),_0x2e943,_0x3d3829[_0xfbab('0x13')][_0xfbab('0x16')]);return _0x396e42(_0x3d3829[_0xfbab('0x13')][_0xfbab('0x16')]);}else{logger['info'](_0xfbab('0x15'),_0x2e943,_0xfbab('0xf'));_0x396e42(_0x3d3829[_0xfbab('0x17')][_0xfbab('0x16')]);}})['catch'](function(_0xd132c3){logger['error'](_0xfbab('0x15'),_0x2e943,_0xd132c3);_0x202fb2(_0xd132c3);});});}exports[_0xfbab('0x18')]=function(_0x29b19d){var _0x35cf96=this;return new Promise(function(_0x3d99d5,_0x56c8b2){return db['CmHopperBlack']['findAll']({'raw':_0x29b19d[_0xfbab('0x19')]?_0x29b19d['options'][_0xfbab('0x1a')]===undefined?!![]:![]:!![],'where':_0x29b19d[_0xfbab('0x19')]?_0x29b19d[_0xfbab('0x19')]['where']||null:null,'attributes':_0x29b19d[_0xfbab('0x19')]?_0x29b19d[_0xfbab('0x19')][_0xfbab('0x1b')]||null:null,'limit':_0x29b19d[_0xfbab('0x19')]?_0x29b19d[_0xfbab('0x19')]['limit']||null:null,'include':_0x29b19d[_0xfbab('0x19')]?_0x29b19d[_0xfbab('0x19')][_0xfbab('0x1c')]?_['map'](_0x29b19d['options'][_0xfbab('0x1c')],function(_0x27130d){return{'model':db[_0x27130d['model']],'as':_0x27130d['as'],'attributes':_0x27130d[_0xfbab('0x1b')],'include':_0x27130d[_0xfbab('0x1c')]?_[_0xfbab('0x1d')](_0x27130d['include'],function(_0x131e1f){return{'model':db[_0x131e1f[_0xfbab('0x1e')]],'as':_0x131e1f['as'],'attributes':_0x131e1f[_0xfbab('0x1b')],'include':_0x131e1f[_0xfbab('0x1c')]?_[_0xfbab('0x1d')](_0x131e1f[_0xfbab('0x1c')],function(_0x153543){return{'model':db[_0x153543[_0xfbab('0x1e')]],'as':_0x153543['as'],'attributes':_0x153543[_0xfbab('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1a2f1e){logger[_0xfbab('0xe')]('GetCmHopperBlack',_0x29b19d);logger[_0xfbab('0x10')]('GetCmHopperBlack',_0x29b19d,JSON[_0xfbab('0x12')](_0x1a2f1e));_0x3d99d5(_0x1a2f1e);})[_0xfbab('0x1f')](function(_0x593578){logger[_0xfbab('0x13')](_0xfbab('0x18'),_0x593578[_0xfbab('0x16')],_0x29b19d);_0x56c8b2(_0x35cf96[_0xfbab('0x13')](0x1f4,_0x593578[_0xfbab('0x16')]));});});};exports[_0xfbab('0x20')]=function(_0x270130){var _0x5fe9bc=this;return new Promise(function(_0x1036f7,_0xfa181){return db[_0xfbab('0x21')][_0xfbab('0x22')](_0x270130[_0xfbab('0x23')],{'raw':_0x270130[_0xfbab('0x19')]?_0x270130[_0xfbab('0x19')][_0xfbab('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x270130[_0xfbab('0x19')]?_0x270130[_0xfbab('0x19')][_0xfbab('0x24')]||null:null,'attributes':_0x270130['options']?_0x270130['options'][_0xfbab('0x1b')]||null:null,'limit':_0x270130[_0xfbab('0x19')]?_0x270130[_0xfbab('0x19')][_0xfbab('0x25')]||null:null})[_0xfbab('0xd')](function(_0x58139b){logger['info'](_0xfbab('0x20'),_0x270130);logger[_0xfbab('0x10')](_0xfbab('0x20'),_0x270130,JSON[_0xfbab('0x12')](_0x58139b));_0x1036f7(_0x58139b);})[_0xfbab('0x1f')](function(_0x37d35f){logger[_0xfbab('0x13')](_0xfbab('0x20'),_0x37d35f[_0xfbab('0x16')],_0x270130);_0xfa181(_0x5fe9bc[_0xfbab('0x13')](0x1f4,_0x37d35f[_0xfbab('0x16')]));});});};exports[_0xfbab('0x26')]=function(_0x236435){var _0x7a55c2=this;return new Promise(function(_0x5c062c,_0x33bd54){return db[_0xfbab('0x21')]['destroy']({'where':_0x236435[_0xfbab('0x19')]?_0x236435['options'][_0xfbab('0x24')]||null:null})[_0xfbab('0xd')](function(_0x54927c){logger[_0xfbab('0xe')](_0xfbab('0x26'),_0x236435);logger[_0xfbab('0x10')](_0xfbab('0x26'),_0x236435,JSON['stringify'](_0x54927c));_0x5c062c(_0x54927c);})[_0xfbab('0x1f')](function(_0x211f3b){logger[_0xfbab('0x13')](_0xfbab('0x26'),_0x211f3b[_0xfbab('0x16')],_0x236435);_0x33bd54(_0x7a55c2['error'](0x1f4,_0x211f3b[_0xfbab('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index c7e9366..b2d36a9 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 _0x7a54=['./cmHopperBlack.controller','get','index','/describe','isAuthenticated','put','/:id','update','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5dbdb8,_0x200701){var _0x40ba7e=function(_0x391def){while(--_0x391def){_0x5dbdb8['push'](_0x5dbdb8['shift']());}};_0x40ba7e(++_0x200701);}(_0x7a54,0x106));var _0x47a5=function(_0x12d686,_0x11f2ad){_0x12d686=_0x12d686-0x0;var _0x30fc61=_0x7a54[_0x12d686];return _0x30fc61;};'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['describe']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x47a5('0xd')](_0x47a5('0xe'),auth['isAuthenticated'](),controller[_0x47a5('0xf')]);router['delete']('/:id',auth[_0x47a5('0xc')](),controller[_0x47a5('0x10')]);module[_0x47a5('0x11')]=router; \ No newline at end of file +var _0x0adf=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','isAuthenticated','get','/describe','describe','/:id','put','update','delete','multer','util'];(function(_0x2f36b2,_0x8b9cf9){var _0x10439e=function(_0x5973c0){while(--_0x5973c0){_0x2f36b2['push'](_0x2f36b2['shift']());}};_0x10439e(++_0x8b9cf9);}(_0x0adf,0x1d2));var _0xf0ad=function(_0x1b250e,_0x5622a8){_0x1b250e=_0x1b250e-0x0;var _0x169153=_0x0adf[_0x1b250e];return _0x169153;};'use strict';var multer=require(_0xf0ad('0x0'));var util=require(_0xf0ad('0x1'));var path=require(_0xf0ad('0x2'));var timeout=require('connect-timeout');var express=require(_0xf0ad('0x3'));var router=express[_0xf0ad('0x4')]();var fs_extra=require(_0xf0ad('0x5'));var auth=require(_0xf0ad('0x6'));var interaction=require(_0xf0ad('0x7'));var config=require(_0xf0ad('0x8'));var controller=require(_0xf0ad('0x9'));router['get']('/',auth[_0xf0ad('0xa')](),controller['index']);router[_0xf0ad('0xb')](_0xf0ad('0xc'),auth[_0xf0ad('0xa')](),controller[_0xf0ad('0xd')]);router[_0xf0ad('0xb')](_0xf0ad('0xe'),auth[_0xf0ad('0xa')](),controller['show']);router[_0xf0ad('0xf')]('/:id',auth[_0xf0ad('0xa')](),controller[_0xf0ad('0x10')]);router[_0xf0ad('0x11')](_0xf0ad('0xe'),auth[_0xf0ad('0xa')](),controller['destroy']);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 7c5ac49..7104660 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 _0x3f2b=['moment','exports','INTEGER','STRING','DATE','endtime','setDataValue','followuptime','diff','seconds','BOOLEAN','sequelize'];(function(_0x140bd5,_0x332b8e){var _0x59d5e2=function(_0x3f48bc){while(--_0x3f48bc){_0x140bd5['push'](_0x140bd5['shift']());}};_0x59d5e2(++_0x332b8e);}(_0x3f2b,0x1a3));var _0xb3f2=function(_0x24d827,_0x4f6755){_0x24d827=_0x24d827-0x0;var _0x5d45b2=_0x3f2b[_0x24d827];return _0x5d45b2;};'use strict';var Sequelize=require(_0xb3f2('0x0'));var moment=require(_0xb3f2('0x1'));module[_0xb3f2('0x2')]={'state':{'type':Sequelize[_0xb3f2('0x3')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xb3f2('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xb3f2('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xb3f2('0x4')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xb3f2('0x4')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xb3f2('0x4')]},'starttime':{'type':Sequelize[_0xb3f2('0x5')]},'responsetime':{'type':Sequelize[_0xb3f2('0x5')]},'answertime':{'type':Sequelize[_0xb3f2('0x5')]},'droptime':{'type':Sequelize[_0xb3f2('0x5')]},'endtime':{'type':Sequelize[_0xb3f2('0x5')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xb3f2('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xb3f2('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xb3f2('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xb3f2('0x4')]},'campaign':{'type':Sequelize[_0xb3f2('0x4')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0xb3f2('0x4')]},'disposition':{'type':Sequelize[_0xb3f2('0x4')]},'secondDisposition':{'type':Sequelize[_0xb3f2('0x4')]},'thirdDisposition':{'type':Sequelize[_0xb3f2('0x4')]},'dispositionat':{'type':Sequelize[_0xb3f2('0x5')],'set':function(_0x8e0e5f){var _0x364990=this['getDataValue'](_0xb3f2('0x6'));if(_0x364990&&_0x8e0e5f){this[_0xb3f2('0x7')](_0xb3f2('0x8'),moment(_0x8e0e5f)[_0xb3f2('0x9')](moment(_0x364990),_0xb3f2('0xa')));}return this[_0xb3f2('0x7')]('dispositionat',_0x8e0e5f);}},'amd':{'type':Sequelize[_0xb3f2('0xb')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xb3f2('0xb')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xb3f2('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xb3f2('0x5')]},'callback':{'type':Sequelize[_0xb3f2('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xb3f2('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xb3f2('0x5')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0xb3f2('0x5')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xb3f2('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0xb3f2('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xb3f2('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xb3f2('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xbcb5=['exports','STRING','DATE','INTEGER','getDataValue','setDataValue','diff','seconds','BOOLEAN','sequelize'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xbcb5,0x1c1));var _0x5bcb=function(_0x9c8efa,_0x11eb3d){_0x9c8efa=_0x9c8efa-0x0;var _0xaaabdb=_0xbcb5[_0x9c8efa];return _0xaaabdb;};'use strict';var Sequelize=require(_0x5bcb('0x0'));var moment=require('moment');module[_0x5bcb('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x5bcb('0x2')]},'scheduledat':{'type':Sequelize[_0x5bcb('0x3')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x5bcb('0x4')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x5bcb('0x4')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x5bcb('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x5bcb('0x2')]},'originatecalleridname':{'type':Sequelize[_0x5bcb('0x2')]},'calleridnum':{'type':Sequelize[_0x5bcb('0x2')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x5bcb('0x3')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x5bcb('0x3')]},'droptime':{'type':Sequelize[_0x5bcb('0x3')]},'endtime':{'type':Sequelize[_0x5bcb('0x3')]},'ringtime':{'type':Sequelize[_0x5bcb('0x4')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x5bcb('0x4')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x5bcb('0x4')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x5bcb('0x2')]},'campaign':{'type':Sequelize[_0x5bcb('0x2')]},'campaigntype':{'type':Sequelize[_0x5bcb('0x2')]},'membername':{'type':Sequelize[_0x5bcb('0x2')]},'reason':{'type':Sequelize[_0x5bcb('0x2')]},'disposition':{'type':Sequelize[_0x5bcb('0x2')]},'secondDisposition':{'type':Sequelize[_0x5bcb('0x2')]},'thirdDisposition':{'type':Sequelize[_0x5bcb('0x2')]},'dispositionat':{'type':Sequelize[_0x5bcb('0x3')],'set':function(_0x38936b){var _0x5d899d=this[_0x5bcb('0x5')]('endtime');if(_0x5d899d&&_0x38936b){this[_0x5bcb('0x6')]('followuptime',moment(_0x38936b)[_0x5bcb('0x7')](moment(_0x5d899d),_0x5bcb('0x8')));}return this[_0x5bcb('0x6')]('dispositionat',_0x38936b);}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x5bcb('0x9')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x5bcb('0x9')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x5bcb('0x9')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x5bcb('0x3')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x5bcb('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x5bcb('0x3')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0x5bcb('0x3')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0x5bcb('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x5bcb('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x5bcb('0x4')],'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 dfc3efe..0973da7 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 _0x33af=['end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','order','sort','where','merge','VIRTUAL','filter','includeAll','findAll','rows','catch','show','params','length','include','describe','body','uniqueid','find','countContactsQueueCampaignHopperFinal','COUNT','sequelize','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','busyContacts','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','noAnswerContacts','`state`\x20=\x208,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','answeringMachine','moveContactsQueueCampaignHopperFinal','cm_hopper','phone','scheduledAt','ContactId','ListId','VoiceQueueId','select','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(VoiceQueueId)','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','group','moveContactsIvrCampaignHopperFinal','insert','fromQuery','CampaignId','ANY_VALUE(ListId)','CampaignId\x20=\x20?','checkContactHopper','CmHopper','findOne','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x13e398,_0x52695d){var _0x5bfe4b=function(_0x531e49){while(--_0x531e49){_0x13e398['push'](_0x13e398['shift']());}};_0x5bfe4b(++_0x52695d);}(_0x33af,0xec));var _0xf33a=function(_0x2aefff,_0x26a24b){_0x2aefff=_0x2aefff-0x0;var _0x4e4534=_0x33af[_0x2aefff];return _0x4e4534;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf33a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf33a('0x1'));var rp=require(_0xf33a('0x2'));var moment=require(_0xf33a('0x3'));var BPromise=require(_0xf33a('0x4'));var Mustache=require(_0xf33a('0x5'));var util=require(_0xf33a('0x6'));var path=require('path');var sox=require(_0xf33a('0x7'));var csv=require(_0xf33a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf33a('0x9'));var _=require(_0xf33a('0xa'));var squel=require(_0xf33a('0xb'));var crypto=require(_0xf33a('0xc'));var jsforce=require(_0xf33a('0xd'));var deskjs=require(_0xf33a('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf33a('0xf'));var Papa=require(_0xf33a('0x10'));var Redis=require(_0xf33a('0x11'));var authService=require(_0xf33a('0x12'));var qs=require(_0xf33a('0x13'));var as=require(_0xf33a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf33a('0x15'));var utils=require(_0xf33a('0x16'));var config=require(_0xf33a('0x17'));var licenseUtil=require(_0xf33a('0x18'));var db=require(_0xf33a('0x19'))['db'];function respondWithStatusCode(_0x5959c9,_0x9f87bc){_0x9f87bc=_0x9f87bc||0xcc;return function(_0x21b80e){if(_0x21b80e){return _0x5959c9['sendStatus'](_0x9f87bc);}return _0x5959c9['status'](_0x9f87bc)[_0xf33a('0x1a')]();};}function respondWithResult(_0x1b3bf0,_0x17043){_0x17043=_0x17043||0xc8;return function(_0x153bda){if(_0x153bda){return _0x1b3bf0[_0xf33a('0x1b')](_0x17043)[_0xf33a('0x1c')](_0x153bda);}};}function respondWithFilteredResult(_0x45e311,_0x1f2b1b){return function(_0x507cb9){if(_0x507cb9){var _0x441f59=typeof _0x1f2b1b['offset']===_0xf33a('0x1d')&&typeof _0x1f2b1b[_0xf33a('0x1e')]==='undefined';var _0x37e76c=_0x507cb9[_0xf33a('0x1f')];var _0x524109=_0x441f59?0x0:_0x1f2b1b[_0xf33a('0x20')];var _0x23d9e2=_0x441f59?_0x507cb9[_0xf33a('0x1f')]:_0x1f2b1b[_0xf33a('0x20')]+_0x1f2b1b['limit'];var _0x11efa0;if(_0x23d9e2>=_0x37e76c){_0x23d9e2=_0x37e76c;_0x11efa0=0xc8;}else{_0x11efa0=0xce;}_0x45e311[_0xf33a('0x1b')](_0x11efa0);return _0x45e311[_0xf33a('0x21')](_0xf33a('0x22'),_0x524109+'-'+_0x23d9e2+'/'+_0x37e76c)[_0xf33a('0x1c')](_0x507cb9);}return null;};}function patchUpdates(_0x6cdf7b){return function(_0x19986f){try{jsonpatch[_0xf33a('0x23')](_0x19986f,_0x6cdf7b,!![]);}catch(_0x19055e){return BPromise[_0xf33a('0x24')](_0x19055e);}return _0x19986f['save']();};}function saveUpdates(_0x3854b4,_0x272e60){return function(_0x1bf9bc){if(_0x1bf9bc){return _0x1bf9bc[_0xf33a('0x25')](_0x3854b4)[_0xf33a('0x26')](function(_0x51d3fd){return _0x51d3fd;});}return null;};}function removeEntity(_0x44654c,_0x5882ba){return function(_0x492986){if(_0x492986){return _0x492986[_0xf33a('0x27')]()[_0xf33a('0x26')](function(){_0x44654c[_0xf33a('0x1b')](0xcc)[_0xf33a('0x1a')]();});}};}function handleEntityNotFound(_0x4b9801,_0x57cb1d){return function(_0x393005){if(!_0x393005){_0x4b9801['sendStatus'](0x194);}return _0x393005;};}function handleError(_0x4af24a,_0x16ef31){_0x16ef31=_0x16ef31||0x1f4;return function(_0x5f0a53){logger['error'](_0x5f0a53[_0xf33a('0x28')]);if(_0x5f0a53['name']){delete _0x5f0a53[_0xf33a('0x29')];}_0x4af24a['status'](_0x16ef31)[_0xf33a('0x2a')](_0x5f0a53);};}exports[_0xf33a('0x2b')]=function(_0x469741,_0x729fca){var _0x4552c9={},_0x3068a9={},_0x1d19ee={'count':0x0,'rows':[]};var _0x1246ff=_[_0xf33a('0x2c')](db[_0xf33a('0x2d')][_0xf33a('0x2e')],function(_0x8f8ddc){return{'name':_0x8f8ddc[_0xf33a('0x2f')],'type':_0x8f8ddc[_0xf33a('0x30')][_0xf33a('0x31')]};});_0x3068a9['model']=_[_0xf33a('0x2c')](_0x1246ff,_0xf33a('0x29'));_0x3068a9[_0xf33a('0x32')]=_[_0xf33a('0x33')](_0x469741['query']);_0x3068a9[_0xf33a('0x34')]=_[_0xf33a('0x35')](_0x3068a9[_0xf33a('0x36')],_0x3068a9[_0xf33a('0x32')]);_0x4552c9[_0xf33a('0x37')]=_[_0xf33a('0x35')](_0x3068a9['model'],qs[_0xf33a('0x38')](_0x469741[_0xf33a('0x32')][_0xf33a('0x38')]));_0x4552c9[_0xf33a('0x37')]=_0x4552c9[_0xf33a('0x37')]['length']?_0x4552c9['attributes']:_0x3068a9[_0xf33a('0x36')];if(!_0x469741['query']['hasOwnProperty']('nolimit')){_0x4552c9[_0xf33a('0x1e')]=qs[_0xf33a('0x1e')](_0x469741['query'][_0xf33a('0x1e')]);_0x4552c9['offset']=qs[_0xf33a('0x20')](_0x469741[_0xf33a('0x32')][_0xf33a('0x20')]);}_0x4552c9[_0xf33a('0x39')]=qs[_0xf33a('0x3a')](_0x469741[_0xf33a('0x32')]['sort']);_0x4552c9[_0xf33a('0x3b')]=qs[_0xf33a('0x34')](_['pick'](_0x469741[_0xf33a('0x32')],_0x3068a9[_0xf33a('0x34')]),_0x1246ff);if(_0x469741[_0xf33a('0x32')]['filter']){_0x4552c9[_0xf33a('0x3b')]=_[_0xf33a('0x3c')](_0x4552c9[_0xf33a('0x3b')],{'$or':_[_0xf33a('0x2c')](_0x1246ff,function(_0x3ec562){if(_0x3ec562[_0xf33a('0x30')]!==_0xf33a('0x3d')){var _0x128baf={};_0x128baf[_0x3ec562[_0xf33a('0x29')]]={'$like':'%'+_0x469741['query'][_0xf33a('0x3e')]+'%'};return _0x128baf;}})});}_0x4552c9=_[_0xf33a('0x3c')]({},_0x4552c9,_0x469741['options']);var _0x1e8800={'where':_0x4552c9['where']};return db['CmHopperFinal'][_0xf33a('0x1f')](_0x1e8800)[_0xf33a('0x26')](function(_0x4dada1){_0x1d19ee[_0xf33a('0x1f')]=_0x4dada1;if(_0x469741[_0xf33a('0x32')][_0xf33a('0x3f')]){_0x4552c9['include']=[{'all':!![]}];}return db[_0xf33a('0x2d')][_0xf33a('0x40')](_0x4552c9);})['then'](function(_0x1e9748){_0x1d19ee[_0xf33a('0x41')]=_0x1e9748;return _0x1d19ee;})[_0xf33a('0x26')](respondWithFilteredResult(_0x729fca,_0x4552c9))[_0xf33a('0x42')](handleError(_0x729fca,null));};exports[_0xf33a('0x43')]=function(_0x5044f9,_0x45ae15){var _0x1722e5={'raw':!![],'where':{'id':_0x5044f9[_0xf33a('0x44')]['id']}},_0x2325eb={};_0x2325eb[_0xf33a('0x36')]=_['keys'](db[_0xf33a('0x2d')][_0xf33a('0x2e')]);_0x2325eb[_0xf33a('0x32')]=_['keys'](_0x5044f9[_0xf33a('0x32')]);_0x2325eb[_0xf33a('0x34')]=_[_0xf33a('0x35')](_0x2325eb[_0xf33a('0x36')],_0x2325eb[_0xf33a('0x32')]);_0x1722e5[_0xf33a('0x37')]=_['intersection'](_0x2325eb[_0xf33a('0x36')],qs[_0xf33a('0x38')](_0x5044f9[_0xf33a('0x32')][_0xf33a('0x38')]));_0x1722e5[_0xf33a('0x37')]=_0x1722e5['attributes'][_0xf33a('0x45')]?_0x1722e5[_0xf33a('0x37')]:_0x2325eb[_0xf33a('0x36')];if(_0x5044f9['query'][_0xf33a('0x3f')]){_0x1722e5[_0xf33a('0x46')]=[{'all':!![]}];}_0x1722e5=_['merge']({},_0x1722e5,_0x5044f9['options']);return db[_0xf33a('0x2d')]['find'](_0x1722e5)[_0xf33a('0x26')](handleEntityNotFound(_0x45ae15,null))[_0xf33a('0x26')](respondWithResult(_0x45ae15,null))[_0xf33a('0x42')](handleError(_0x45ae15,null));};exports[_0xf33a('0x47')]=function(_0xecc82f,_0x1a98f9){return db[_0xf33a('0x2d')][_0xf33a('0x47')]()[_0xf33a('0x26')](respondWithResult(_0x1a98f9,null))[_0xf33a('0x42')](handleError(_0x1a98f9,null));};exports[_0xf33a('0x25')]=function(_0x4107b1,_0x190a2b){if(_0x4107b1[_0xf33a('0x48')][_0xf33a('0x49')]){delete _0x4107b1[_0xf33a('0x48')][_0xf33a('0x49')];}return db[_0xf33a('0x2d')][_0xf33a('0x4a')]({'where':{'uniqueid':_0x4107b1[_0xf33a('0x44')]['id']}})[_0xf33a('0x26')](handleEntityNotFound(_0x190a2b,null))[_0xf33a('0x26')](saveUpdates(_0x4107b1[_0xf33a('0x48')],null))[_0xf33a('0x26')](respondWithResult(_0x190a2b,null))[_0xf33a('0x42')](handleError(_0x190a2b,null));};exports[_0xf33a('0x4b')]=function(_0x3bab07,_0x1f7d8c,_0x57815c){return db['CmHopperFinal'][_0xf33a('0x40')]({'raw':![],'where':{'VoiceQueueId':_0x3bab07[_0xf33a('0x44')]['id']},'attributes':[[db['sequelize']['fn'](_0xf33a('0x4c'),db[_0xf33a('0x4d')]['fn']('IF',db[_0xf33a('0x4d')]['literal'](_0xf33a('0x4e')))),_0xf33a('0x4f')],[db[_0xf33a('0x4d')]['fn']('COUNT',db[_0xf33a('0x4d')]['fn']('IF',db['sequelize'][_0xf33a('0x50')](_0xf33a('0x51')))),'noAnswerContacts'],[db['sequelize']['fn'](_0xf33a('0x4c'),db[_0xf33a('0x4d')]['fn']('IF',db[_0xf33a('0x4d')]['literal'](_0xf33a('0x52')))),_0xf33a('0x53')],[db[_0xf33a('0x4d')]['fn'](_0xf33a('0x4c'),db[_0xf33a('0x4d')]['fn']('IF',db[_0xf33a('0x4d')][_0xf33a('0x50')]('`state`\x20=\x208,\x201,\x20null'))),_0xf33a('0x54')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xf33a('0x4d')][_0xf33a('0x50')](_0xf33a('0x55')))),'dropContacts'],[db[_0xf33a('0x4d')]['fn'](_0xf33a('0x4c'),db[_0xf33a('0x4d')]['fn']('IF',db[_0xf33a('0x4d')][_0xf33a('0x50')]('`state`\x20=\x2011\x20,\x201,\x20null'))),'abandonedContacts'],[db['sequelize']['fn'](_0xf33a('0x4c'),db['sequelize']['fn']('IF',db[_0xf33a('0x4d')][_0xf33a('0x50')](_0xf33a('0x56')))),_0xf33a('0x57')],[db[_0xf33a('0x4d')]['fn'](_0xf33a('0x4c'),db['sequelize']['fn']('IF',db[_0xf33a('0x4d')][_0xf33a('0x50')](_0xf33a('0x58')))),'answeringMachine']]})[_0xf33a('0x26')](handleEntityNotFound(_0x1f7d8c,null))[_0xf33a('0x26')](respondWithResult(_0x1f7d8c,null))[_0xf33a('0x42')](handleError(_0x1f7d8c,null));};exports[_0xf33a('0x59')]=function(_0x2f1fef,_0x129229,_0x473484){return db[_0xf33a('0x2d')][_0xf33a('0x40')]({'raw':![],'where':{'CampaignId':_0x2f1fef[_0xf33a('0x44')]['id']},'attributes':[[db[_0xf33a('0x4d')]['fn'](_0xf33a('0x4c'),db[_0xf33a('0x4d')]['fn']('IF',db[_0xf33a('0x4d')]['literal']('`state`\x20=\x200,\x201,\x20null'))),_0xf33a('0x4f')],[db[_0xf33a('0x4d')]['fn'](_0xf33a('0x4c'),db[_0xf33a('0x4d')]['fn']('IF',db[_0xf33a('0x4d')][_0xf33a('0x50')](_0xf33a('0x51')))),_0xf33a('0x5a')],[db[_0xf33a('0x4d')]['fn'](_0xf33a('0x4c'),db[_0xf33a('0x4d')]['fn']('IF',db['sequelize'][_0xf33a('0x50')](_0xf33a('0x52')))),_0xf33a('0x53')],[db[_0xf33a('0x4d')]['fn'](_0xf33a('0x4c'),db[_0xf33a('0x4d')]['fn']('IF',db[_0xf33a('0x4d')][_0xf33a('0x50')](_0xf33a('0x5b')))),'congestionContacts'],[db[_0xf33a('0x4d')]['fn'](_0xf33a('0x4c'),db['sequelize']['fn']('IF',db[_0xf33a('0x4d')][_0xf33a('0x50')](_0xf33a('0x55')))),_0xf33a('0x5c')],[db[_0xf33a('0x4d')]['fn'](_0xf33a('0x4c'),db['sequelize']['fn']('IF',db[_0xf33a('0x4d')][_0xf33a('0x50')](_0xf33a('0x5d')))),_0xf33a('0x5e')],[db[_0xf33a('0x4d')]['fn'](_0xf33a('0x4c'),db[_0xf33a('0x4d')]['fn']('IF',db['sequelize'][_0xf33a('0x50')](_0xf33a('0x56')))),'reCallContacts'],[db['sequelize']['fn']('COUNT',db[_0xf33a('0x4d')]['fn']('IF',db[_0xf33a('0x4d')][_0xf33a('0x50')](_0xf33a('0x58')))),_0xf33a('0x5f')]]})[_0xf33a('0x26')](handleEntityNotFound(_0x129229,null))[_0xf33a('0x26')](respondWithResult(_0x129229,null))[_0xf33a('0x42')](handleError(_0x129229,null));};exports[_0xf33a('0x60')]=function(_0x3bebca,_0x40bb02,_0x10a271){return db['VoiceQueue'][_0xf33a('0x4a')]({'where':{'id':_0x3bebca['params']['id']}})['then'](handleEntityNotFound(_0x40bb02,null))[_0xf33a('0x26')](function(_0x25cc49){var _0x132764;if(_0x25cc49){_0x132764=squel['insert']()['into'](_0xf33a('0x61'))['fromQuery']([_0xf33a('0x62'),_0xf33a('0x63'),_0xf33a('0x64'),_0xf33a('0x65'),_0xf33a('0x66'),'createdAt','updatedAt'],squel[_0xf33a('0x67')]()[_0xf33a('0x68')](_0xf33a('0x69'),_0xf33a('0x62'))['field'](_0xf33a('0x6a'),_0xf33a('0x63'))['field'](_0xf33a('0x6b'),_0xf33a('0x64'))[_0xf33a('0x68')]('ANY_VALUE(ListId)',_0xf33a('0x65'))[_0xf33a('0x68')](_0xf33a('0x6c'),_0xf33a('0x66'))['field'](_0xf33a('0x6a'),_0xf33a('0x6d'))[_0xf33a('0x68')]('NOW()',_0xf33a('0x6e'))[_0xf33a('0x6f')](_0xf33a('0x70'))[_0xf33a('0x3b')](_0xf33a('0x71'),_0x3bebca[_0xf33a('0x44')]['id'][_0xf33a('0x72')]())[_0xf33a('0x3b')](_0xf33a('0x73'),_0x3bebca[_0xf33a('0x48')][_0xf33a('0x74')][_0xf33a('0x72')]())[_0xf33a('0x3b')](_0xf33a('0x75'))[_0xf33a('0x3b')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xf33a('0x67')]()[_0xf33a('0x68')](_0xf33a('0x62'))[_0xf33a('0x6f')](_0xf33a('0x61'))[_0xf33a('0x3b')](_0xf33a('0x71'),_0x3bebca[_0xf33a('0x44')]['id'][_0xf33a('0x72')]()))[_0xf33a('0x3b')](_0xf33a('0x76'),squel[_0xf33a('0x67')]()[_0xf33a('0x68')](_0xf33a('0x77'))['from'](_0xf33a('0x70'))[_0xf33a('0x3b')](_0xf33a('0x71'),_0x3bebca[_0xf33a('0x44')]['id']['toString']())[_0xf33a('0x3b')](_0xf33a('0x78')))[_0xf33a('0x79')](_0xf33a('0x64')))[_0xf33a('0x72')]();return db[_0xf33a('0x4d')][_0xf33a('0x32')](_0x132764);}return[];})[_0xf33a('0x26')](respondWithResult(_0x40bb02,null))['catch'](handleError(_0x40bb02,null));};exports[_0xf33a('0x7a')]=function(_0x1dfb59,_0x9c0b99,_0x17b2fa){return db['Campaign']['find']({'where':{'id':_0x1dfb59[_0xf33a('0x44')]['id']}})['then'](handleEntityNotFound(_0x9c0b99,null))[_0xf33a('0x26')](function(_0x1595b7){var _0x3d8dbe;if(_0x1595b7){_0x3d8dbe=squel[_0xf33a('0x7b')]()['into']('cm_hopper')[_0xf33a('0x7c')](['phone',_0xf33a('0x63'),_0xf33a('0x64'),_0xf33a('0x65'),_0xf33a('0x7d'),_0xf33a('0x6d'),_0xf33a('0x6e')],squel[_0xf33a('0x67')]()[_0xf33a('0x68')](_0xf33a('0x69'),_0xf33a('0x62'))[_0xf33a('0x68')](_0xf33a('0x6a'),_0xf33a('0x63'))[_0xf33a('0x68')](_0xf33a('0x6b'),_0xf33a('0x64'))['field'](_0xf33a('0x7e'),'ListId')[_0xf33a('0x68')]('ANY_VALUE(CampaignId)','CampaignId')['field'](_0xf33a('0x6a'),_0xf33a('0x6d'))['field'](_0xf33a('0x6a'),_0xf33a('0x6e'))[_0xf33a('0x6f')](_0xf33a('0x70'))[_0xf33a('0x3b')](_0xf33a('0x7f'),_0x1dfb59['params']['id'][_0xf33a('0x72')]())[_0xf33a('0x3b')]('state\x20=\x20?',_0x1dfb59[_0xf33a('0x48')][_0xf33a('0x74')][_0xf33a('0x72')]())['where'](_0xf33a('0x75'))[_0xf33a('0x3b')](_0xf33a('0x76'),squel[_0xf33a('0x67')]()[_0xf33a('0x68')]('phone')[_0xf33a('0x6f')](_0xf33a('0x61'))[_0xf33a('0x3b')](_0xf33a('0x7f'),_0x1dfb59[_0xf33a('0x44')]['id']['toString']()))[_0xf33a('0x3b')](_0xf33a('0x76'),squel[_0xf33a('0x67')]()[_0xf33a('0x68')](_0xf33a('0x77'))['from'](_0xf33a('0x70'))['where']('CampaignId\x20=\x20?',_0x1dfb59[_0xf33a('0x44')]['id']['toString']())[_0xf33a('0x3b')](_0xf33a('0x78')))['group'](_0xf33a('0x64')))[_0xf33a('0x72')]();return db[_0xf33a('0x4d')][_0xf33a('0x32')](_0x3d8dbe);}return[];})[_0xf33a('0x26')](respondWithResult(_0x9c0b99,null))[_0xf33a('0x42')](handleError(_0x9c0b99,null));};exports[_0xf33a('0x80')]=function(_0x4abd84,_0x1205d1,_0x1d83a0){return db[_0xf33a('0x81')][_0xf33a('0x82')]({'where':{'VoiceQueueId':_0x4abd84['body'][_0xf33a('0x66')],'CampaignId':_0x4abd84['body'][_0xf33a('0x7d')],'ContactId':_0x4abd84[_0xf33a('0x48')][_0xf33a('0x64')]}})[_0xf33a('0x26')](handleEntityNotFound(_0x1205d1,null))[_0xf33a('0x26')](function(_0x49c40a){if(_0x49c40a){return _0x49c40a;}return null;})[_0xf33a('0x26')](respondWithResult(_0x1205d1,null))[_0xf33a('0x42')](handleError(_0x1205d1,null));}; \ No newline at end of file +var _0x2542=['Content-Range','apply','update','then','error','stack','name','index','map','CmHopperFinal','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','describe','body','uniqueid','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','noSuchContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','abandonedContacts','VoiceQueue','into','fromQuery','phone','ListId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','scheduledAt','ContactId','ANY_VALUE(ListId)','NOW()','from','cm_hopper_final','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','toString','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','select','calleridnum','group','moveContactsIvrCampaignHopperFinal','Campaign','CampaignId','ANY_VALUE(ContactId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','cm_hopper','state\x20=\x204','checkContactHopper','CmHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set'];(function(_0x45dced,_0x2bad6f){var _0x3d4af6=function(_0x4f1061){while(--_0x4f1061){_0x45dced['push'](_0x45dced['shift']());}};_0x3d4af6(++_0x2bad6f);}(_0x2542,0x169));var _0x2254=function(_0x2b8fa1,_0xbd6afc){_0x2b8fa1=_0x2b8fa1-0x0;var _0x4657fb=_0x2542[_0x2b8fa1];return _0x4657fb;};'use strict';var emlformat=require(_0x2254('0x0'));var rimraf=require(_0x2254('0x1'));var zipdir=require(_0x2254('0x2'));var jsonpatch=require(_0x2254('0x3'));var rp=require('request-promise');var moment=require(_0x2254('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2254('0x5'));var util=require(_0x2254('0x6'));var path=require(_0x2254('0x7'));var sox=require(_0x2254('0x8'));var csv=require(_0x2254('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2254('0xa'));var _=require(_0x2254('0xb'));var squel=require(_0x2254('0xc'));var crypto=require(_0x2254('0xd'));var jsforce=require(_0x2254('0xe'));var deskjs=require(_0x2254('0xf'));var toCsv=require(_0x2254('0x9'));var querystring=require(_0x2254('0x10'));var Papa=require(_0x2254('0x11'));var Redis=require(_0x2254('0x12'));var authService=require(_0x2254('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x2254('0x14'));var hardwareService=require(_0x2254('0x15'));var logger=require(_0x2254('0x16'))(_0x2254('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2254('0x18'));var db=require(_0x2254('0x19'))['db'];function respondWithStatusCode(_0x116b70,_0xdcb670){_0xdcb670=_0xdcb670||0xcc;return function(_0x3c326b){if(_0x3c326b){return _0x116b70[_0x2254('0x1a')](_0xdcb670);}return _0x116b70['status'](_0xdcb670)[_0x2254('0x1b')]();};}function respondWithResult(_0x7c7ab0,_0x504749){_0x504749=_0x504749||0xc8;return function(_0x2f4de){if(_0x2f4de){return _0x7c7ab0[_0x2254('0x1c')](_0x504749)[_0x2254('0x1d')](_0x2f4de);}};}function respondWithFilteredResult(_0x145272,_0x26285a){return function(_0xbc5548){if(_0xbc5548){var _0x50f137=typeof _0x26285a[_0x2254('0x1e')]==='undefined'&&typeof _0x26285a[_0x2254('0x1f')]===_0x2254('0x20');var _0x170ffa=_0xbc5548[_0x2254('0x21')];var _0x1ae11e=_0x50f137?0x0:_0x26285a[_0x2254('0x1e')];var _0x497724=_0x50f137?_0xbc5548['count']:_0x26285a['offset']+_0x26285a[_0x2254('0x1f')];var _0x3a79f8;if(_0x497724>=_0x170ffa){_0x497724=_0x170ffa;_0x3a79f8=0xc8;}else{_0x3a79f8=0xce;}_0x145272[_0x2254('0x1c')](_0x3a79f8);return _0x145272[_0x2254('0x22')](_0x2254('0x23'),_0x1ae11e+'-'+_0x497724+'/'+_0x170ffa)[_0x2254('0x1d')](_0xbc5548);}return null;};}function patchUpdates(_0x487f72){return function(_0x28381e){try{jsonpatch[_0x2254('0x24')](_0x28381e,_0x487f72,!![]);}catch(_0x906cde){return BPromise['reject'](_0x906cde);}return _0x28381e['save']();};}function saveUpdates(_0x5bd982,_0x1e8a98){return function(_0x559af4){if(_0x559af4){return _0x559af4[_0x2254('0x25')](_0x5bd982)['then'](function(_0x5713e4){return _0x5713e4;});}return null;};}function removeEntity(_0x4d8faf,_0x540020){return function(_0x5e5edb){if(_0x5e5edb){return _0x5e5edb['destroy']()[_0x2254('0x26')](function(){_0x4d8faf[_0x2254('0x1c')](0xcc)[_0x2254('0x1b')]();});}};}function handleEntityNotFound(_0x265467,_0x13522d){return function(_0x1349c9){if(!_0x1349c9){_0x265467['sendStatus'](0x194);}return _0x1349c9;};}function handleError(_0x4a8274,_0x1ada42){_0x1ada42=_0x1ada42||0x1f4;return function(_0x4f6877){logger[_0x2254('0x27')](_0x4f6877[_0x2254('0x28')]);if(_0x4f6877[_0x2254('0x29')]){delete _0x4f6877[_0x2254('0x29')];}_0x4a8274[_0x2254('0x1c')](_0x1ada42)['send'](_0x4f6877);};}exports[_0x2254('0x2a')]=function(_0x2a789b,_0x21285d){var _0x37af8b={},_0x13366a={},_0x377c41={'count':0x0,'rows':[]};var _0x3214a7=_[_0x2254('0x2b')](db[_0x2254('0x2c')][_0x2254('0x2d')],function(_0x21c641){return{'name':_0x21c641[_0x2254('0x2e')],'type':_0x21c641[_0x2254('0x2f')][_0x2254('0x30')]};});_0x13366a[_0x2254('0x31')]=_[_0x2254('0x2b')](_0x3214a7,_0x2254('0x29'));_0x13366a[_0x2254('0x32')]=_[_0x2254('0x33')](_0x2a789b['query']);_0x13366a[_0x2254('0x34')]=_[_0x2254('0x35')](_0x13366a[_0x2254('0x31')],_0x13366a[_0x2254('0x32')]);_0x37af8b[_0x2254('0x36')]=_[_0x2254('0x35')](_0x13366a[_0x2254('0x31')],qs[_0x2254('0x37')](_0x2a789b[_0x2254('0x32')]['fields']));_0x37af8b[_0x2254('0x36')]=_0x37af8b[_0x2254('0x36')]['length']?_0x37af8b[_0x2254('0x36')]:_0x13366a[_0x2254('0x31')];if(!_0x2a789b[_0x2254('0x32')][_0x2254('0x38')]('nolimit')){_0x37af8b['limit']=qs[_0x2254('0x1f')](_0x2a789b['query'][_0x2254('0x1f')]);_0x37af8b[_0x2254('0x1e')]=qs[_0x2254('0x1e')](_0x2a789b[_0x2254('0x32')][_0x2254('0x1e')]);}_0x37af8b[_0x2254('0x39')]=qs[_0x2254('0x3a')](_0x2a789b['query'][_0x2254('0x3a')]);_0x37af8b[_0x2254('0x3b')]=qs[_0x2254('0x34')](_[_0x2254('0x3c')](_0x2a789b[_0x2254('0x32')],_0x13366a[_0x2254('0x34')]),_0x3214a7);if(_0x2a789b[_0x2254('0x32')][_0x2254('0x3d')]){_0x37af8b[_0x2254('0x3b')]=_[_0x2254('0x3e')](_0x37af8b['where'],{'$or':_[_0x2254('0x2b')](_0x3214a7,function(_0xde3e4a){if(_0xde3e4a[_0x2254('0x2f')]!==_0x2254('0x3f')){var _0x4c7cc3={};_0x4c7cc3[_0xde3e4a[_0x2254('0x29')]]={'$like':'%'+_0x2a789b[_0x2254('0x32')][_0x2254('0x3d')]+'%'};return _0x4c7cc3;}})});}_0x37af8b=_[_0x2254('0x3e')]({},_0x37af8b,_0x2a789b[_0x2254('0x40')]);var _0x2602db={'where':_0x37af8b[_0x2254('0x3b')]};return db[_0x2254('0x2c')]['count'](_0x2602db)[_0x2254('0x26')](function(_0x5c15d7){_0x377c41[_0x2254('0x21')]=_0x5c15d7;if(_0x2a789b[_0x2254('0x32')][_0x2254('0x41')]){_0x37af8b[_0x2254('0x42')]=[{'all':!![]}];}return db[_0x2254('0x2c')][_0x2254('0x43')](_0x37af8b);})[_0x2254('0x26')](function(_0x568ec9){_0x377c41[_0x2254('0x44')]=_0x568ec9;return _0x377c41;})[_0x2254('0x26')](respondWithFilteredResult(_0x21285d,_0x37af8b))[_0x2254('0x45')](handleError(_0x21285d,null));};exports[_0x2254('0x46')]=function(_0x40d4da,_0x57cda2){var _0x22bb98={'raw':!![],'where':{'id':_0x40d4da[_0x2254('0x47')]['id']}},_0x1dec43={};_0x1dec43[_0x2254('0x31')]=_[_0x2254('0x33')](db['CmHopperFinal'][_0x2254('0x2d')]);_0x1dec43['query']=_[_0x2254('0x33')](_0x40d4da[_0x2254('0x32')]);_0x1dec43[_0x2254('0x34')]=_[_0x2254('0x35')](_0x1dec43[_0x2254('0x31')],_0x1dec43[_0x2254('0x32')]);_0x22bb98[_0x2254('0x36')]=_[_0x2254('0x35')](_0x1dec43[_0x2254('0x31')],qs[_0x2254('0x37')](_0x40d4da[_0x2254('0x32')][_0x2254('0x37')]));_0x22bb98[_0x2254('0x36')]=_0x22bb98['attributes'][_0x2254('0x48')]?_0x22bb98[_0x2254('0x36')]:_0x1dec43[_0x2254('0x31')];if(_0x40d4da['query'][_0x2254('0x41')]){_0x22bb98[_0x2254('0x42')]=[{'all':!![]}];}_0x22bb98=_[_0x2254('0x3e')]({},_0x22bb98,_0x40d4da[_0x2254('0x40')]);return db[_0x2254('0x2c')][_0x2254('0x49')](_0x22bb98)[_0x2254('0x26')](handleEntityNotFound(_0x57cda2,null))[_0x2254('0x26')](respondWithResult(_0x57cda2,null))[_0x2254('0x45')](handleError(_0x57cda2,null));};exports['describe']=function(_0x239ba0,_0x405eb2){return db[_0x2254('0x2c')][_0x2254('0x4a')]()[_0x2254('0x26')](respondWithResult(_0x405eb2,null))[_0x2254('0x45')](handleError(_0x405eb2,null));};exports[_0x2254('0x25')]=function(_0x438922,_0x3ac691){if(_0x438922[_0x2254('0x4b')]['uniqueid']){delete _0x438922[_0x2254('0x4b')][_0x2254('0x4c')];}return db['CmHopperFinal'][_0x2254('0x49')]({'where':{'uniqueid':_0x438922[_0x2254('0x47')]['id']}})[_0x2254('0x26')](handleEntityNotFound(_0x3ac691,null))[_0x2254('0x26')](saveUpdates(_0x438922['body'],null))[_0x2254('0x26')](respondWithResult(_0x3ac691,null))[_0x2254('0x45')](handleError(_0x3ac691,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x26d01a,_0x3f0670,_0x23014b){return db[_0x2254('0x2c')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0x26d01a[_0x2254('0x47')]['id']},'attributes':[[db[_0x2254('0x4d')]['fn'](_0x2254('0x4e'),db['sequelize']['fn']('IF',db['sequelize'][_0x2254('0x4f')](_0x2254('0x50')))),'noSuchContacts'],[db[_0x2254('0x4d')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x2254('0x4d')][_0x2254('0x4f')](_0x2254('0x51')))),_0x2254('0x52')],[db[_0x2254('0x4d')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x2254('0x4d')]['literal'](_0x2254('0x53')))),_0x2254('0x54')],[db[_0x2254('0x4d')]['fn'](_0x2254('0x4e'),db['sequelize']['fn']('IF',db[_0x2254('0x4d')][_0x2254('0x4f')]('`state`\x20=\x208,\x201,\x20null'))),'congestionContacts'],[db[_0x2254('0x4d')]['fn']('COUNT',db[_0x2254('0x4d')]['fn']('IF',db[_0x2254('0x4d')][_0x2254('0x4f')](_0x2254('0x55')))),_0x2254('0x56')],[db['sequelize']['fn']('COUNT',db[_0x2254('0x4d')]['fn']('IF',db['sequelize'][_0x2254('0x4f')]('`state`\x20=\x2011\x20,\x201,\x20null'))),'abandonedContacts'],[db['sequelize']['fn'](_0x2254('0x4e'),db[_0x2254('0x4d')]['fn']('IF',db[_0x2254('0x4d')][_0x2254('0x4f')](_0x2254('0x57')))),_0x2254('0x58')],[db[_0x2254('0x4d')]['fn'](_0x2254('0x4e'),db[_0x2254('0x4d')]['fn']('IF',db[_0x2254('0x4d')][_0x2254('0x4f')](_0x2254('0x59')))),_0x2254('0x5a')]]})[_0x2254('0x26')](handleEntityNotFound(_0x3f0670,null))[_0x2254('0x26')](respondWithResult(_0x3f0670,null))[_0x2254('0x45')](handleError(_0x3f0670,null));};exports[_0x2254('0x5b')]=function(_0x399ba2,_0x179cf1,_0x5b8909){return db[_0x2254('0x2c')][_0x2254('0x43')]({'raw':![],'where':{'CampaignId':_0x399ba2[_0x2254('0x47')]['id']},'attributes':[[db[_0x2254('0x4d')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x2254('0x4d')][_0x2254('0x4f')](_0x2254('0x50')))),_0x2254('0x5c')],[db[_0x2254('0x4d')]['fn']('COUNT',db[_0x2254('0x4d')]['fn']('IF',db[_0x2254('0x4d')][_0x2254('0x4f')]('`state`\x20=\x203,\x201,\x20null'))),'noAnswerContacts'],[db[_0x2254('0x4d')]['fn']('COUNT',db[_0x2254('0x4d')]['fn']('IF',db[_0x2254('0x4d')]['literal'](_0x2254('0x53')))),_0x2254('0x54')],[db['sequelize']['fn'](_0x2254('0x4e'),db[_0x2254('0x4d')]['fn']('IF',db['sequelize']['literal'](_0x2254('0x5d')))),_0x2254('0x5e')],[db['sequelize']['fn']('COUNT',db[_0x2254('0x4d')]['fn']('IF',db['sequelize'][_0x2254('0x4f')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x2254('0x56')],[db[_0x2254('0x4d')]['fn'](_0x2254('0x4e'),db[_0x2254('0x4d')]['fn']('IF',db['sequelize'][_0x2254('0x4f')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x2254('0x5f')],[db[_0x2254('0x4d')]['fn']('COUNT',db[_0x2254('0x4d')]['fn']('IF',db[_0x2254('0x4d')]['literal'](_0x2254('0x57')))),_0x2254('0x58')],[db[_0x2254('0x4d')]['fn'](_0x2254('0x4e'),db['sequelize']['fn']('IF',db[_0x2254('0x4d')][_0x2254('0x4f')]('`state`\x20=\x2019,\x201,\x20null'))),_0x2254('0x5a')]]})[_0x2254('0x26')](handleEntityNotFound(_0x179cf1,null))['then'](respondWithResult(_0x179cf1,null))[_0x2254('0x45')](handleError(_0x179cf1,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x7075b1,_0x516595,_0x3cbd35){return db[_0x2254('0x60')]['find']({'where':{'id':_0x7075b1[_0x2254('0x47')]['id']}})['then'](handleEntityNotFound(_0x516595,null))[_0x2254('0x26')](function(_0x3e6070){var _0x38294d;if(_0x3e6070){_0x38294d=squel['insert']()[_0x2254('0x61')]('cm_hopper')[_0x2254('0x62')]([_0x2254('0x63'),'scheduledAt','ContactId',_0x2254('0x64'),_0x2254('0x65'),_0x2254('0x66'),_0x2254('0x67')],squel['select']()[_0x2254('0x68')](_0x2254('0x69'),_0x2254('0x63'))[_0x2254('0x68')]('NOW()',_0x2254('0x6a'))[_0x2254('0x68')]('ANY_VALUE(ContactId)',_0x2254('0x6b'))['field'](_0x2254('0x6c'),'ListId')['field']('ANY_VALUE(VoiceQueueId)',_0x2254('0x65'))['field'](_0x2254('0x6d'),_0x2254('0x66'))['field'](_0x2254('0x6d'),_0x2254('0x67'))[_0x2254('0x6e')](_0x2254('0x6f'))[_0x2254('0x3b')](_0x2254('0x70'),_0x7075b1['params']['id']['toString']())[_0x2254('0x3b')](_0x2254('0x71'),_0x7075b1[_0x2254('0x4b')][_0x2254('0x72')][_0x2254('0x73')]())[_0x2254('0x3b')](_0x2254('0x74'))[_0x2254('0x3b')](_0x2254('0x75'),squel[_0x2254('0x76')]()['field'](_0x2254('0x63'))[_0x2254('0x6e')]('cm_hopper')[_0x2254('0x3b')]('VoiceQueueId\x20=\x20?',_0x7075b1[_0x2254('0x47')]['id'][_0x2254('0x73')]()))['where'](_0x2254('0x75'),squel['select']()[_0x2254('0x68')](_0x2254('0x77'))[_0x2254('0x6e')](_0x2254('0x6f'))['where'](_0x2254('0x70'),_0x7075b1[_0x2254('0x47')]['id'][_0x2254('0x73')]())[_0x2254('0x3b')]('state\x20=\x204'))[_0x2254('0x78')](_0x2254('0x6b')))['toString']();return db[_0x2254('0x4d')][_0x2254('0x32')](_0x38294d);}return[];})['then'](respondWithResult(_0x516595,null))['catch'](handleError(_0x516595,null));};exports[_0x2254('0x79')]=function(_0x2f3650,_0x1a3fd9,_0x3058d9){return db[_0x2254('0x7a')][_0x2254('0x49')]({'where':{'id':_0x2f3650[_0x2254('0x47')]['id']}})[_0x2254('0x26')](handleEntityNotFound(_0x1a3fd9,null))[_0x2254('0x26')](function(_0x5df20f){var _0x10c44;if(_0x5df20f){_0x10c44=squel['insert']()[_0x2254('0x61')]('cm_hopper')[_0x2254('0x62')]([_0x2254('0x63'),_0x2254('0x6a'),'ContactId',_0x2254('0x64'),_0x2254('0x7b'),_0x2254('0x66'),_0x2254('0x67')],squel[_0x2254('0x76')]()[_0x2254('0x68')](_0x2254('0x69'),_0x2254('0x63'))[_0x2254('0x68')](_0x2254('0x6d'),_0x2254('0x6a'))[_0x2254('0x68')](_0x2254('0x7c'),'ContactId')[_0x2254('0x68')]('ANY_VALUE(ListId)',_0x2254('0x64'))[_0x2254('0x68')](_0x2254('0x7d'),_0x2254('0x7b'))[_0x2254('0x68')](_0x2254('0x6d'),_0x2254('0x66'))['field'](_0x2254('0x6d'),'updatedAt')[_0x2254('0x6e')]('cm_hopper_final')[_0x2254('0x3b')](_0x2254('0x7e'),_0x2f3650[_0x2254('0x47')]['id']['toString']())[_0x2254('0x3b')](_0x2254('0x71'),_0x2f3650[_0x2254('0x4b')][_0x2254('0x72')][_0x2254('0x73')]())[_0x2254('0x3b')](_0x2254('0x74'))[_0x2254('0x3b')]('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()[_0x2254('0x68')]('phone')[_0x2254('0x6e')](_0x2254('0x7f'))[_0x2254('0x3b')](_0x2254('0x7e'),_0x2f3650[_0x2254('0x47')]['id'][_0x2254('0x73')]()))[_0x2254('0x3b')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x2254('0x76')]()[_0x2254('0x68')](_0x2254('0x77'))['from'](_0x2254('0x6f'))[_0x2254('0x3b')](_0x2254('0x7e'),_0x2f3650[_0x2254('0x47')]['id'][_0x2254('0x73')]())[_0x2254('0x3b')](_0x2254('0x80')))[_0x2254('0x78')](_0x2254('0x6b')))['toString']();return db[_0x2254('0x4d')][_0x2254('0x32')](_0x10c44);}return[];})['then'](respondWithResult(_0x1a3fd9,null))['catch'](handleError(_0x1a3fd9,null));};exports[_0x2254('0x81')]=function(_0x54339e,_0x226c19,_0x10645f){return db[_0x2254('0x82')][_0x2254('0x83')]({'where':{'VoiceQueueId':_0x54339e[_0x2254('0x4b')][_0x2254('0x65')],'CampaignId':_0x54339e[_0x2254('0x4b')][_0x2254('0x7b')],'ContactId':_0x54339e['body']['ContactId']}})[_0x2254('0x26')](handleEntityNotFound(_0x226c19,null))[_0x2254('0x26')](function(_0x1e8617){if(_0x1e8617){return _0x1e8617;}return null;})[_0x2254('0x26')](respondWithResult(_0x226c19,null))[_0x2254('0x45')](handleError(_0x226c19,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index ad8b1c4..ee3c849 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 _0x23ed=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','define','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','api'];(function(_0x2c4973,_0x3184cd){var _0x37189c=function(_0x1cf1d9){while(--_0x1cf1d9){_0x2c4973['push'](_0x2c4973['shift']());}};_0x37189c(++_0x3184cd);}(_0x23ed,0x6c));var _0xd23e=function(_0x45996b,_0x145516){_0x45996b=_0x45996b-0x0;var _0x2defda=_0x23ed[_0x45996b];return _0x2defda;};'use strict';var _=require(_0xd23e('0x0'));var util=require(_0xd23e('0x1'));var logger=require(_0xd23e('0x2'))(_0xd23e('0x3'));var moment=require(_0xd23e('0x4'));var BPromise=require(_0xd23e('0x5'));var rp=require(_0xd23e('0x6'));var fs=require('fs');var path=require(_0xd23e('0x7'));var rimraf=require(_0xd23e('0x8'));var config=require(_0xd23e('0x9'));var attributes=require(_0xd23e('0xa'));module[_0xd23e('0xb')]=function(_0x3f0126,_0x42da8b){return _0x3f0126[_0xd23e('0xc')]('CmHopperFinal',attributes,{'tableName':_0xd23e('0xd'),'paranoid':![],'indexes':[{'name':_0xd23e('0xe'),'fields':[_0xd23e('0xe')]},{'name':_0xd23e('0xf'),'fields':[_0xd23e('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd9cd=['calleridnum','uniqueid','lodash','util','../../config/logger','bluebird','rimraf','../../config/environment','./cmHopperFinal.attributes','define','CmHopperFinal'];(function(_0x3ae08a,_0x133dc5){var _0x38c1c6=function(_0x2811cd){while(--_0x2811cd){_0x3ae08a['push'](_0x3ae08a['shift']());}};_0x38c1c6(++_0x133dc5);}(_0xd9cd,0x16d));var _0xdd9c=function(_0x50af79,_0x26774e){_0x50af79=_0x50af79-0x0;var _0xebf22a=_0xd9cd[_0x50af79];return _0xebf22a;};'use strict';var _=require(_0xdd9c('0x0'));var util=require(_0xdd9c('0x1'));var logger=require(_0xdd9c('0x2'))('api');var moment=require('moment');var BPromise=require(_0xdd9c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xdd9c('0x4'));var config=require(_0xdd9c('0x5'));var attributes=require(_0xdd9c('0x6'));module['exports']=function(_0xbd76f4,_0x5155d7){return _0xbd76f4[_0xdd9c('0x7')](_0xdd9c('0x8'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0xdd9c('0x9')]},{'name':_0xdd9c('0xa'),'fields':[_0xdd9c('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 3705c35..f50d090 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x427038,_0x2f4733){var _0x4e96ed=function(_0x561a7f){while(--_0x561a7f){_0x427038['push'](_0x427038['shift']());}};_0x4e96ed(++_0x2f4733);}(_0x7a54,0x106));var _0x47a5=function(_0x1db59b,_0x457cb2){_0x1db59b=_0x1db59b-0x0;var _0x54044d=_0x7a54[_0x1db59b];return _0x54044d;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x287bb3,_0x9534c2){var _0x3d7ee3=function(_0x99d94){while(--_0x99d94){_0x287bb3['push'](_0x287bb3['shift']());}};_0x3d7ee3(++_0x9534c2);}(_0xb10b,0x12a));var _0xbb10=function(_0x5bda3b,_0x41160f){_0x5bda3b=_0x5bda3b-0x0;var _0x431bb9=_0xb10b[_0x5bda3b];return _0x431bb9;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index f73d413..901bf39 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 _0x347d=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','./cmHopperFinal.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','/voice/queue/moveContacts/:id','post','/voice/campaign/moveContacts/:id','/checkContactHopper','checkContactHopper','put','update','exports','multer','util','path'];(function(_0x4bf1c5,_0x17f0a4){var _0x3975c3=function(_0x40d02c){while(--_0x40d02c){_0x4bf1c5['push'](_0x4bf1c5['shift']());}};_0x3975c3(++_0x17f0a4);}(_0x347d,0x177));var _0xd347=function(_0x1e3db9,_0x10f2e1){_0x1e3db9=_0x1e3db9-0x0;var _0x2a28e6=_0x347d[_0x1e3db9];return _0x2a28e6;};'use strict';var multer=require(_0xd347('0x0'));var util=require(_0xd347('0x1'));var path=require(_0xd347('0x2'));var timeout=require(_0xd347('0x3'));var express=require(_0xd347('0x4'));var router=express[_0xd347('0x5')]();var fs_extra=require(_0xd347('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xd347('0x7'));var config=require('../../config/environment');var controller=require(_0xd347('0x8'));router[_0xd347('0x9')]('/',auth[_0xd347('0xa')](),controller[_0xd347('0xb')]);router[_0xd347('0x9')](_0xd347('0xc'),auth['isAuthenticated'](),controller[_0xd347('0xd')]);router[_0xd347('0x9')](_0xd347('0xe'),auth['isAuthenticated'](),controller[_0xd347('0xf')]);router[_0xd347('0x9')](_0xd347('0x10'),auth['isAuthenticated'](),controller[_0xd347('0x11')]);router[_0xd347('0x9')](_0xd347('0x12'),auth[_0xd347('0xa')](),controller['countContactsIvrCampaignHopperFinal']);router['post'](_0xd347('0x13'),auth[_0xd347('0xa')](),controller['moveContactsQueueCampaignHopperFinal']);router[_0xd347('0x14')](_0xd347('0x15'),auth['isAuthenticated'](),controller['moveContactsIvrCampaignHopperFinal']);router[_0xd347('0x14')](_0xd347('0x16'),auth[_0xd347('0xa')](),controller[_0xd347('0x17')]);router[_0xd347('0x18')](_0xd347('0xe'),auth[_0xd347('0xa')](),controller[_0xd347('0x19')]);module[_0xd347('0x1a')]=router; \ No newline at end of file +var _0xd0ce=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','post','/voice/campaign/moveContacts/:id','/checkContactHopper','put','exports'];(function(_0x504df1,_0x289598){var _0x1063b5=function(_0x627abd){while(--_0x627abd){_0x504df1['push'](_0x504df1['shift']());}};_0x1063b5(++_0x289598);}(_0xd0ce,0x105));var _0xed0c=function(_0x333767,_0x3e6f9c){_0x333767=_0x333767-0x0;var _0x51661b=_0xd0ce[_0x333767];return _0x51661b;};'use strict';var multer=require(_0xed0c('0x0'));var util=require(_0xed0c('0x1'));var path=require(_0xed0c('0x2'));var timeout=require(_0xed0c('0x3'));var express=require(_0xed0c('0x4'));var router=express[_0xed0c('0x5')]();var fs_extra=require(_0xed0c('0x6'));var auth=require(_0xed0c('0x7'));var interaction=require(_0xed0c('0x8'));var config=require(_0xed0c('0x9'));var controller=require(_0xed0c('0xa'));router[_0xed0c('0xb')]('/',auth['isAuthenticated'](),controller[_0xed0c('0xc')]);router[_0xed0c('0xb')](_0xed0c('0xd'),auth[_0xed0c('0xe')](),controller[_0xed0c('0xf')]);router[_0xed0c('0xb')](_0xed0c('0x10'),auth[_0xed0c('0xe')](),controller[_0xed0c('0x11')]);router[_0xed0c('0xb')](_0xed0c('0x12'),auth['isAuthenticated'](),controller[_0xed0c('0x13')]);router[_0xed0c('0xb')](_0xed0c('0x14'),auth[_0xed0c('0xe')](),controller[_0xed0c('0x15')]);router['post'](_0xed0c('0x16'),auth[_0xed0c('0xe')](),controller[_0xed0c('0x17')]);router[_0xed0c('0x18')](_0xed0c('0x19'),auth['isAuthenticated'](),controller['moveContactsIvrCampaignHopperFinal']);router[_0xed0c('0x18')](_0xed0c('0x1a'),auth[_0xed0c('0xe')](),controller['checkContactHopper']);router[_0xed0c('0x1b')](_0xed0c('0x10'),auth[_0xed0c('0xe')](),controller['update']);module[_0xed0c('0x1c')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 03791f5..82084c0 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 _0x911d=['sequelize','exports','INTEGER','DATE','STRING','BOOLEAN'];(function(_0x348ae5,_0x3dddf9){var _0x2e6abf=function(_0x2c4e27){while(--_0x2c4e27){_0x348ae5['push'](_0x348ae5['shift']());}};_0x2e6abf(++_0x3dddf9);}(_0x911d,0xea));var _0xd911=function(_0x503679,_0x1d99bf){_0x503679=_0x503679-0x0;var _0x2c6c2b=_0x911d[_0x503679];return _0x2c6c2b;};'use strict';var Sequelize=require(_0xd911('0x0'));module[_0xd911('0x1')]={'state':{'type':Sequelize[_0xd911('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xd911('0x3')]},'countbusyretry':{'type':Sequelize[_0xd911('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xd911('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xd911('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xd911('0x4')]},'originatecalleridnum':{'type':Sequelize[_0xd911('0x4')]},'originatecalleridname':{'type':Sequelize[_0xd911('0x4')]},'calleridnum':{'type':Sequelize[_0xd911('0x4')]},'calleridname':{'type':Sequelize[_0xd911('0x4')]},'starttime':{'type':Sequelize[_0xd911('0x3')]},'responsetime':{'type':Sequelize[_0xd911('0x3')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0xd911('0x3')]},'endtime':{'type':Sequelize[_0xd911('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xd911('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xd911('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xd911('0x4')]},'campaign':{'type':Sequelize[_0xd911('0x4')]},'campaigntype':{'type':Sequelize[_0xd911('0x4')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0xd911('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0xd911('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0xd911('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0xd911('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xd911('0x3')]},'edited':{'type':Sequelize[_0xd911('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xd911('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xd911('0x4')]}}; \ No newline at end of file +var _0x5946=['DATE','INTEGER','BOOLEAN','exports','STRING'];(function(_0x39b553,_0x2773e3){var _0x110338=function(_0x509627){while(--_0x509627){_0x39b553['push'](_0x39b553['shift']());}};_0x110338(++_0x2773e3);}(_0x5946,0x8f));var _0x6594=function(_0x52a857,_0xc99fa1){_0x52a857=_0x52a857-0x0;var _0x4e2aae=_0x5946[_0x52a857];return _0x4e2aae;};'use strict';var Sequelize=require('sequelize');module[_0x6594('0x0')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x6594('0x1')]},'scheduledat':{'type':Sequelize[_0x6594('0x2')]},'countbusyretry':{'type':Sequelize[_0x6594('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x6594('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x6594('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x6594('0x1')]},'originatecalleridname':{'type':Sequelize[_0x6594('0x1')]},'calleridnum':{'type':Sequelize[_0x6594('0x1')]},'calleridname':{'type':Sequelize[_0x6594('0x1')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x6594('0x2')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x6594('0x2')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x6594('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x6594('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x6594('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x6594('0x1')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x6594('0x1')]},'membername':{'type':Sequelize[_0x6594('0x1')]},'reason':{'type':Sequelize[_0x6594('0x1')]},'amd':{'type':Sequelize[_0x6594('0x4')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x6594('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x6594('0x2')]},'edited':{'type':Sequelize[_0x6594('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x6594('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x6594('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x6594('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x6594('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x6594('0x3')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x6594('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 837182f..35ab54c 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 _0xa273=['order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','params','length','options','find','catch','create','body','describe','uniqueid','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','limit','apply','reject','save','update','then','destroy','error','name','send','index','map','CmHopperHistory','rawAttributes','type','query','keys','filters','model','intersection','fields','attributes','hasOwnProperty','nolimit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa273,0x137));var _0x3a27=function(_0x3f4cbd,_0x1757bd){_0x3f4cbd=_0x3f4cbd-0x0;var _0x418022=_0xa273[_0x3f4cbd];return _0x418022;};'use strict';var emlformat=require(_0x3a27('0x0'));var rimraf=require(_0x3a27('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3a27('0x2'));var rp=require('request-promise');var moment=require(_0x3a27('0x3'));var BPromise=require(_0x3a27('0x4'));var Mustache=require(_0x3a27('0x5'));var util=require(_0x3a27('0x6'));var path=require(_0x3a27('0x7'));var sox=require('sox');var csv=require(_0x3a27('0x8'));var ejs=require(_0x3a27('0x9'));var fs=require('fs');var fs_extra=require(_0x3a27('0xa'));var _=require(_0x3a27('0xb'));var squel=require(_0x3a27('0xc'));var crypto=require(_0x3a27('0xd'));var jsforce=require(_0x3a27('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3a27('0x8'));var querystring=require(_0x3a27('0xf'));var Papa=require('papaparse');var Redis=require(_0x3a27('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3a27('0x11'));var as=require(_0x3a27('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3a27('0x13'))('api');var utils=require(_0x3a27('0x14'));var config=require(_0x3a27('0x15'));var licenseUtil=require(_0x3a27('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d2075,_0x2e05c6){_0x2e05c6=_0x2e05c6||0xcc;return function(_0x29b244){if(_0x29b244){return _0x3d2075[_0x3a27('0x17')](_0x2e05c6);}return _0x3d2075[_0x3a27('0x18')](_0x2e05c6)[_0x3a27('0x19')]();};}function respondWithResult(_0x5b370e,_0x5d5b9c){_0x5d5b9c=_0x5d5b9c||0xc8;return function(_0x928275){if(_0x928275){return _0x5b370e[_0x3a27('0x18')](_0x5d5b9c)[_0x3a27('0x1a')](_0x928275);}};}function respondWithFilteredResult(_0x1c24b5,_0x4b6fb3){return function(_0x774c2b){if(_0x774c2b){var _0x30c9b5=typeof _0x4b6fb3['offset']===_0x3a27('0x1b')&&typeof _0x4b6fb3['limit']===_0x3a27('0x1b');var _0x1840df=_0x774c2b[_0x3a27('0x1c')];var _0x1f3809=_0x30c9b5?0x0:_0x4b6fb3[_0x3a27('0x1d')];var _0x17ec59=_0x30c9b5?_0x774c2b[_0x3a27('0x1c')]:_0x4b6fb3[_0x3a27('0x1d')]+_0x4b6fb3[_0x3a27('0x1e')];var _0xbdb2ea;if(_0x17ec59>=_0x1840df){_0x17ec59=_0x1840df;_0xbdb2ea=0xc8;}else{_0xbdb2ea=0xce;}_0x1c24b5[_0x3a27('0x18')](_0xbdb2ea);return _0x1c24b5['set']('Content-Range',_0x1f3809+'-'+_0x17ec59+'/'+_0x1840df)[_0x3a27('0x1a')](_0x774c2b);}return null;};}function patchUpdates(_0x30466c){return function(_0x57f49e){try{jsonpatch[_0x3a27('0x1f')](_0x57f49e,_0x30466c,!![]);}catch(_0x47161e){return BPromise[_0x3a27('0x20')](_0x47161e);}return _0x57f49e[_0x3a27('0x21')]();};}function saveUpdates(_0x1670dd,_0x7c44d3){return function(_0x219c8f){if(_0x219c8f){return _0x219c8f[_0x3a27('0x22')](_0x1670dd)[_0x3a27('0x23')](function(_0x349f67){return _0x349f67;});}return null;};}function removeEntity(_0x587cc6,_0x11688f){return function(_0x1eb462){if(_0x1eb462){return _0x1eb462[_0x3a27('0x24')]()['then'](function(){_0x587cc6[_0x3a27('0x18')](0xcc)[_0x3a27('0x19')]();});}};}function handleEntityNotFound(_0x3a681e,_0x2d4bf4){return function(_0x40e9b2){if(!_0x40e9b2){_0x3a681e[_0x3a27('0x17')](0x194);}return _0x40e9b2;};}function handleError(_0x616b87,_0x42efcb){_0x42efcb=_0x42efcb||0x1f4;return function(_0x179e1f){logger[_0x3a27('0x25')](_0x179e1f['stack']);if(_0x179e1f[_0x3a27('0x26')]){delete _0x179e1f['name'];}_0x616b87[_0x3a27('0x18')](_0x42efcb)[_0x3a27('0x27')](_0x179e1f);};}exports[_0x3a27('0x28')]=function(_0x37e68b,_0x2e9a2f){var _0x541c14={},_0x598b67={},_0x99da42={'count':0x0,'rows':[]};var _0xfe07fb=_[_0x3a27('0x29')](db[_0x3a27('0x2a')][_0x3a27('0x2b')],function(_0x15ccae){return{'name':_0x15ccae['fieldName'],'type':_0x15ccae[_0x3a27('0x2c')]['key']};});_0x598b67['model']=_['map'](_0xfe07fb,_0x3a27('0x26'));_0x598b67[_0x3a27('0x2d')]=_[_0x3a27('0x2e')](_0x37e68b[_0x3a27('0x2d')]);_0x598b67[_0x3a27('0x2f')]=_['intersection'](_0x598b67[_0x3a27('0x30')],_0x598b67[_0x3a27('0x2d')]);_0x541c14['attributes']=_[_0x3a27('0x31')](_0x598b67[_0x3a27('0x30')],qs[_0x3a27('0x32')](_0x37e68b[_0x3a27('0x2d')]['fields']));_0x541c14[_0x3a27('0x33')]=_0x541c14['attributes']['length']?_0x541c14[_0x3a27('0x33')]:_0x598b67[_0x3a27('0x30')];if(!_0x37e68b[_0x3a27('0x2d')][_0x3a27('0x34')](_0x3a27('0x35'))){_0x541c14['limit']=qs[_0x3a27('0x1e')](_0x37e68b[_0x3a27('0x2d')][_0x3a27('0x1e')]);_0x541c14[_0x3a27('0x1d')]=qs['offset'](_0x37e68b[_0x3a27('0x2d')][_0x3a27('0x1d')]);}_0x541c14[_0x3a27('0x36')]=qs[_0x3a27('0x37')](_0x37e68b[_0x3a27('0x2d')][_0x3a27('0x37')]);_0x541c14[_0x3a27('0x38')]=qs['filters'](_[_0x3a27('0x39')](_0x37e68b[_0x3a27('0x2d')],_0x598b67[_0x3a27('0x2f')]),_0xfe07fb);if(_0x37e68b['query'][_0x3a27('0x3a')]){_0x541c14[_0x3a27('0x38')]=_['merge'](_0x541c14[_0x3a27('0x38')],{'$or':_['map'](_0xfe07fb,function(_0x427157){if(_0x427157[_0x3a27('0x2c')]!=='VIRTUAL'){var _0xcbd6e={};_0xcbd6e[_0x427157[_0x3a27('0x26')]]={'$like':'%'+_0x37e68b['query'][_0x3a27('0x3a')]+'%'};return _0xcbd6e;}})});}_0x541c14=_[_0x3a27('0x3b')]({},_0x541c14,_0x37e68b['options']);var _0xe8bd71={'where':_0x541c14['where']};return db['CmHopperHistory'][_0x3a27('0x1c')](_0xe8bd71)[_0x3a27('0x23')](function(_0x3ca5fb){_0x99da42[_0x3a27('0x1c')]=_0x3ca5fb;if(_0x37e68b[_0x3a27('0x2d')][_0x3a27('0x3c')]){_0x541c14[_0x3a27('0x3d')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x3a27('0x3e')](_0x541c14);})[_0x3a27('0x23')](function(_0x561638){_0x99da42[_0x3a27('0x3f')]=_0x561638;return _0x99da42;})[_0x3a27('0x23')](respondWithFilteredResult(_0x2e9a2f,_0x541c14))['catch'](handleError(_0x2e9a2f,null));};exports['show']=function(_0x2ab313,_0x100720){var _0x5ecd76={'raw':!![],'where':{'id':_0x2ab313[_0x3a27('0x40')]['id']}},_0x86bbc0={};_0x86bbc0[_0x3a27('0x30')]=_[_0x3a27('0x2e')](db[_0x3a27('0x2a')][_0x3a27('0x2b')]);_0x86bbc0[_0x3a27('0x2d')]=_['keys'](_0x2ab313[_0x3a27('0x2d')]);_0x86bbc0[_0x3a27('0x2f')]=_['intersection'](_0x86bbc0[_0x3a27('0x30')],_0x86bbc0[_0x3a27('0x2d')]);_0x5ecd76[_0x3a27('0x33')]=_['intersection'](_0x86bbc0[_0x3a27('0x30')],qs[_0x3a27('0x32')](_0x2ab313[_0x3a27('0x2d')][_0x3a27('0x32')]));_0x5ecd76[_0x3a27('0x33')]=_0x5ecd76['attributes'][_0x3a27('0x41')]?_0x5ecd76[_0x3a27('0x33')]:_0x86bbc0[_0x3a27('0x30')];if(_0x2ab313['query'][_0x3a27('0x3c')]){_0x5ecd76[_0x3a27('0x3d')]=[{'all':!![]}];}_0x5ecd76=_[_0x3a27('0x3b')]({},_0x5ecd76,_0x2ab313[_0x3a27('0x42')]);return db[_0x3a27('0x2a')][_0x3a27('0x43')](_0x5ecd76)[_0x3a27('0x23')](handleEntityNotFound(_0x100720,null))[_0x3a27('0x23')](respondWithResult(_0x100720,null))[_0x3a27('0x44')](handleError(_0x100720,null));};exports[_0x3a27('0x45')]=function(_0x3f440e,_0x3ec5e2){return db[_0x3a27('0x2a')]['create'](_0x3f440e[_0x3a27('0x46')],{})[_0x3a27('0x23')](respondWithResult(_0x3ec5e2,0xc9))['catch'](handleError(_0x3ec5e2,null));};exports[_0x3a27('0x47')]=function(_0x5e0846,_0x26852c){return db['CmHopperHistory']['describe']()[_0x3a27('0x23')](respondWithResult(_0x26852c,null))[_0x3a27('0x44')](handleError(_0x26852c,null));};exports['update']=function(_0x4a0781,_0x37a5ab){if(_0x4a0781[_0x3a27('0x46')][_0x3a27('0x48')]){delete _0x4a0781[_0x3a27('0x46')][_0x3a27('0x48')];}return db[_0x3a27('0x2a')][_0x3a27('0x43')]({'where':{'uniqueid':_0x4a0781[_0x3a27('0x40')]['id']}})[_0x3a27('0x23')](handleEntityNotFound(_0x37a5ab,null))[_0x3a27('0x23')](saveUpdates(_0x4a0781['body'],null))[_0x3a27('0x23')](respondWithResult(_0x37a5ab,null))['catch'](handleError(_0x37a5ab,null));}; \ No newline at end of file +var _0x9525=['catch','params','length','includeAll','find','create','body','describe','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','status','offset','limit','undefined','count','set','json','apply','reject','update','then','destroy','sendStatus','error','stack','name','index','CmHopperHistory','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','type','VIRTUAL','filter','options','findAll','rows'];(function(_0x251fa4,_0x3d5860){var _0x453047=function(_0x337a6f){while(--_0x337a6f){_0x251fa4['push'](_0x251fa4['shift']());}};_0x453047(++_0x3d5860);}(_0x9525,0x1c5));var _0x5952=function(_0xf84cd,_0x163460){_0xf84cd=_0xf84cd-0x0;var _0x3a5090=_0x9525[_0xf84cd];return _0x3a5090;};'use strict';var emlformat=require(_0x5952('0x0'));var rimraf=require(_0x5952('0x1'));var zipdir=require(_0x5952('0x2'));var jsonpatch=require(_0x5952('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5952('0x4'));var Mustache=require(_0x5952('0x5'));var util=require(_0x5952('0x6'));var path=require(_0x5952('0x7'));var sox=require(_0x5952('0x8'));var csv=require(_0x5952('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5952('0xa'));var _=require(_0x5952('0xb'));var squel=require(_0x5952('0xc'));var crypto=require(_0x5952('0xd'));var jsforce=require(_0x5952('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5952('0x9'));var querystring=require('querystring');var Papa=require(_0x5952('0xf'));var Redis=require(_0x5952('0x10'));var authService=require(_0x5952('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5952('0x12'));var logger=require(_0x5952('0x13'))('api');var utils=require(_0x5952('0x14'));var config=require(_0x5952('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x5952('0x16'))['db'];function respondWithStatusCode(_0x9dad54,_0x2ac173){_0x2ac173=_0x2ac173||0xcc;return function(_0x43d8be){if(_0x43d8be){return _0x9dad54['sendStatus'](_0x2ac173);}return _0x9dad54['status'](_0x2ac173)[_0x5952('0x17')]();};}function respondWithResult(_0x19c2ec,_0x1e3368){_0x1e3368=_0x1e3368||0xc8;return function(_0x41793f){if(_0x41793f){return _0x19c2ec[_0x5952('0x18')](_0x1e3368)['json'](_0x41793f);}};}function respondWithFilteredResult(_0x414c1e,_0x6b77e8){return function(_0x3f939c){if(_0x3f939c){var _0x1e30b8=typeof _0x6b77e8[_0x5952('0x19')]==='undefined'&&typeof _0x6b77e8[_0x5952('0x1a')]===_0x5952('0x1b');var _0x50e562=_0x3f939c[_0x5952('0x1c')];var _0x5ca820=_0x1e30b8?0x0:_0x6b77e8['offset'];var _0x1658b8=_0x1e30b8?_0x3f939c[_0x5952('0x1c')]:_0x6b77e8[_0x5952('0x19')]+_0x6b77e8[_0x5952('0x1a')];var _0x1b476f;if(_0x1658b8>=_0x50e562){_0x1658b8=_0x50e562;_0x1b476f=0xc8;}else{_0x1b476f=0xce;}_0x414c1e[_0x5952('0x18')](_0x1b476f);return _0x414c1e[_0x5952('0x1d')]('Content-Range',_0x5ca820+'-'+_0x1658b8+'/'+_0x50e562)[_0x5952('0x1e')](_0x3f939c);}return null;};}function patchUpdates(_0x48133d){return function(_0x42c269){try{jsonpatch[_0x5952('0x1f')](_0x42c269,_0x48133d,!![]);}catch(_0x3b2c0c){return BPromise[_0x5952('0x20')](_0x3b2c0c);}return _0x42c269['save']();};}function saveUpdates(_0xb9096d,_0x412a2d){return function(_0x5c7d4e){if(_0x5c7d4e){return _0x5c7d4e[_0x5952('0x21')](_0xb9096d)[_0x5952('0x22')](function(_0x99406c){return _0x99406c;});}return null;};}function removeEntity(_0x50543c,_0x4bcd32){return function(_0x147833){if(_0x147833){return _0x147833[_0x5952('0x23')]()[_0x5952('0x22')](function(){_0x50543c[_0x5952('0x18')](0xcc)[_0x5952('0x17')]();});}};}function handleEntityNotFound(_0x4459a1,_0x4e2243){return function(_0x176af8){if(!_0x176af8){_0x4459a1[_0x5952('0x24')](0x194);}return _0x176af8;};}function handleError(_0x1b8fec,_0xc572c){_0xc572c=_0xc572c||0x1f4;return function(_0x1265f3){logger[_0x5952('0x25')](_0x1265f3[_0x5952('0x26')]);if(_0x1265f3[_0x5952('0x27')]){delete _0x1265f3[_0x5952('0x27')];}_0x1b8fec[_0x5952('0x18')](_0xc572c)['send'](_0x1265f3);};}exports[_0x5952('0x28')]=function(_0x5594df,_0x138237){var _0x5ceee9={},_0x837cce={},_0x2f7290={'count':0x0,'rows':[]};var _0x4e099d=_['map'](db[_0x5952('0x29')][_0x5952('0x2a')],function(_0x32d811){return{'name':_0x32d811['fieldName'],'type':_0x32d811['type'][_0x5952('0x2b')]};});_0x837cce[_0x5952('0x2c')]=_['map'](_0x4e099d,_0x5952('0x27'));_0x837cce[_0x5952('0x2d')]=_[_0x5952('0x2e')](_0x5594df[_0x5952('0x2d')]);_0x837cce[_0x5952('0x2f')]=_[_0x5952('0x30')](_0x837cce[_0x5952('0x2c')],_0x837cce[_0x5952('0x2d')]);_0x5ceee9['attributes']=_[_0x5952('0x30')](_0x837cce[_0x5952('0x2c')],qs[_0x5952('0x31')](_0x5594df['query'][_0x5952('0x31')]));_0x5ceee9['attributes']=_0x5ceee9[_0x5952('0x32')]['length']?_0x5ceee9['attributes']:_0x837cce[_0x5952('0x2c')];if(!_0x5594df[_0x5952('0x2d')][_0x5952('0x33')](_0x5952('0x34'))){_0x5ceee9[_0x5952('0x1a')]=qs[_0x5952('0x1a')](_0x5594df[_0x5952('0x2d')]['limit']);_0x5ceee9['offset']=qs[_0x5952('0x19')](_0x5594df[_0x5952('0x2d')][_0x5952('0x19')]);}_0x5ceee9[_0x5952('0x35')]=qs[_0x5952('0x36')](_0x5594df[_0x5952('0x2d')][_0x5952('0x36')]);_0x5ceee9[_0x5952('0x37')]=qs['filters'](_[_0x5952('0x38')](_0x5594df['query'],_0x837cce['filters']),_0x4e099d);if(_0x5594df[_0x5952('0x2d')]['filter']){_0x5ceee9[_0x5952('0x37')]=_[_0x5952('0x39')](_0x5ceee9[_0x5952('0x37')],{'$or':_[_0x5952('0x3a')](_0x4e099d,function(_0x346f22){if(_0x346f22[_0x5952('0x3b')]!==_0x5952('0x3c')){var _0x3c2066={};_0x3c2066[_0x346f22[_0x5952('0x27')]]={'$like':'%'+_0x5594df['query'][_0x5952('0x3d')]+'%'};return _0x3c2066;}})});}_0x5ceee9=_['merge']({},_0x5ceee9,_0x5594df[_0x5952('0x3e')]);var _0x3ef8f1={'where':_0x5ceee9[_0x5952('0x37')]};return db[_0x5952('0x29')][_0x5952('0x1c')](_0x3ef8f1)[_0x5952('0x22')](function(_0x218324){_0x2f7290[_0x5952('0x1c')]=_0x218324;if(_0x5594df[_0x5952('0x2d')]['includeAll']){_0x5ceee9['include']=[{'all':!![]}];}return db[_0x5952('0x29')][_0x5952('0x3f')](_0x5ceee9);})[_0x5952('0x22')](function(_0x3b631f){_0x2f7290[_0x5952('0x40')]=_0x3b631f;return _0x2f7290;})['then'](respondWithFilteredResult(_0x138237,_0x5ceee9))[_0x5952('0x41')](handleError(_0x138237,null));};exports['show']=function(_0x8fe995,_0x453461){var _0x588a55={'raw':!![],'where':{'id':_0x8fe995[_0x5952('0x42')]['id']}},_0x1d8383={};_0x1d8383['model']=_['keys'](db[_0x5952('0x29')][_0x5952('0x2a')]);_0x1d8383[_0x5952('0x2d')]=_[_0x5952('0x2e')](_0x8fe995[_0x5952('0x2d')]);_0x1d8383[_0x5952('0x2f')]=_[_0x5952('0x30')](_0x1d8383['model'],_0x1d8383['query']);_0x588a55[_0x5952('0x32')]=_[_0x5952('0x30')](_0x1d8383[_0x5952('0x2c')],qs[_0x5952('0x31')](_0x8fe995[_0x5952('0x2d')][_0x5952('0x31')]));_0x588a55[_0x5952('0x32')]=_0x588a55['attributes'][_0x5952('0x43')]?_0x588a55[_0x5952('0x32')]:_0x1d8383['model'];if(_0x8fe995['query'][_0x5952('0x44')]){_0x588a55['include']=[{'all':!![]}];}_0x588a55=_[_0x5952('0x39')]({},_0x588a55,_0x8fe995[_0x5952('0x3e')]);return db[_0x5952('0x29')][_0x5952('0x45')](_0x588a55)[_0x5952('0x22')](handleEntityNotFound(_0x453461,null))[_0x5952('0x22')](respondWithResult(_0x453461,null))[_0x5952('0x41')](handleError(_0x453461,null));};exports[_0x5952('0x46')]=function(_0x17a2e5,_0x1799e6){return db[_0x5952('0x29')][_0x5952('0x46')](_0x17a2e5[_0x5952('0x47')],{})[_0x5952('0x22')](respondWithResult(_0x1799e6,0xc9))[_0x5952('0x41')](handleError(_0x1799e6,null));};exports[_0x5952('0x48')]=function(_0x2b7754,_0x1f2f88){return db['CmHopperHistory'][_0x5952('0x48')]()['then'](respondWithResult(_0x1f2f88,null))[_0x5952('0x41')](handleError(_0x1f2f88,null));};exports['update']=function(_0x44e084,_0x16e442){if(_0x44e084[_0x5952('0x47')][_0x5952('0x49')]){delete _0x44e084['body'][_0x5952('0x49')];}return db[_0x5952('0x29')]['find']({'where':{'uniqueid':_0x44e084[_0x5952('0x42')]['id']}})[_0x5952('0x22')](handleEntityNotFound(_0x16e442,null))['then'](saveUpdates(_0x44e084[_0x5952('0x47')],null))[_0x5952('0x22')](respondWithResult(_0x16e442,null))[_0x5952('0x41')](handleError(_0x16e442,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 80de75e..49f82dc 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 _0x1d63=['moment','request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','define','CmHopperHistory','endtime','lodash','util','../../config/logger','api'];(function(_0x54d52,_0x2473ba){var _0x968345=function(_0x3fcd06){while(--_0x3fcd06){_0x54d52['push'](_0x54d52['shift']());}};_0x968345(++_0x2473ba);}(_0x1d63,0xa4));var _0x31d6=function(_0x1cd183,_0xcd1d44){_0x1cd183=_0x1cd183-0x0;var _0x19f585=_0x1d63[_0x1cd183];return _0x19f585;};'use strict';var _=require(_0x31d6('0x0'));var util=require(_0x31d6('0x1'));var logger=require(_0x31d6('0x2'))(_0x31d6('0x3'));var moment=require(_0x31d6('0x4'));var BPromise=require('bluebird');var rp=require(_0x31d6('0x5'));var fs=require('fs');var path=require(_0x31d6('0x6'));var rimraf=require(_0x31d6('0x7'));var config=require(_0x31d6('0x8'));var attributes=require(_0x31d6('0x9'));module[_0x31d6('0xa')]=function(_0x45b5ab,_0x510a88){return _0x45b5ab[_0x31d6('0xb')](_0x31d6('0xc'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0x31d6('0xd'),'fields':[_0x31d6('0xd')]},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x8506=['endtime','uniqueid','util','api','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x5f23ae,_0x527bda){var _0x237776=function(_0x4ae7c2){while(--_0x4ae7c2){_0x5f23ae['push'](_0x5f23ae['shift']());}};_0x237776(++_0x527bda);}(_0x8506,0xe8));var _0x6850=function(_0x3a2c65,_0x450714){_0x3a2c65=_0x3a2c65-0x0;var _0x1c3466=_0x8506[_0x3a2c65];return _0x1c3466;};'use strict';var _=require('lodash');var util=require(_0x6850('0x0'));var logger=require('../../config/logger')(_0x6850('0x1'));var moment=require('moment');var BPromise=require(_0x6850('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6850('0x3'));var rimraf=require(_0x6850('0x4'));var config=require(_0x6850('0x5'));var attributes=require('./cmHopperHistory.attributes');module[_0x6850('0x6')]=function(_0x372f0b,_0x232459){return _0x372f0b[_0x6850('0x7')]('CmHopperHistory',attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':'endtime','fields':[_0x6850('0x8')]},{'name':_0x6850('0x9'),'fields':[_0x6850('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 17c0d8f..f1c3434 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 _0x3bc8=['rpc','../../config/environment','http','then','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','AvgHandleTime','sequelize','COUNT','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','findAll','where','campaign','name','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','col','util','moment','bluebird','ioredis','../../config/logger'];(function(_0x3b510b,_0x227e17){var _0x1428e0=function(_0x902791){while(--_0x902791){_0x3b510b['push'](_0x3b510b['shift']());}};_0x1428e0(++_0x227e17);}(_0x3bc8,0x1f3));var _0x83bc=function(_0x4b90b3,_0x164fb2){_0x4b90b3=_0x4b90b3-0x0;var _0x45472e=_0x3bc8[_0x4b90b3];return _0x45472e;};'use strict';var _=require('lodash');var util=require(_0x83bc('0x0'));var moment=require(_0x83bc('0x1'));var BPromise=require(_0x83bc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x83bc('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x83bc('0x4'))(_0x83bc('0x5'));var config=require(_0x83bc('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x83bc('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x571287,_0x2672d6,_0x4e952c){return new BPromise(function(_0x2793b6,_0x4a1bfe){return client['request'](_0x571287,_0x4e952c)[_0x83bc('0x8')](function(_0x465f13){logger['info'](_0x83bc('0x9'),_0x2672d6,_0x83bc('0xa'));logger[_0x83bc('0xb')](_0x83bc('0xc'),_0x2672d6,'request\x20sent',JSON[_0x83bc('0xd')](_0x465f13));if(_0x465f13[_0x83bc('0xe')]){if(_0x465f13['error'][_0x83bc('0xf')]===0x1f4){logger[_0x83bc('0xe')](_0x83bc('0x9'),_0x2672d6,_0x465f13[_0x83bc('0xe')][_0x83bc('0x10')]);return _0x4a1bfe(_0x465f13[_0x83bc('0xe')][_0x83bc('0x10')]);}logger['error'](_0x83bc('0x9'),_0x2672d6,_0x465f13[_0x83bc('0xe')][_0x83bc('0x10')]);return _0x2793b6(_0x465f13[_0x83bc('0xe')][_0x83bc('0x10')]);}else{logger[_0x83bc('0x11')](_0x83bc('0x9'),_0x2672d6,_0x83bc('0xa'));_0x2793b6(_0x465f13[_0x83bc('0x12')]['message']);}})[_0x83bc('0x13')](function(_0x252dc0){logger[_0x83bc('0xe')](_0x83bc('0x9'),_0x2672d6,_0x252dc0);_0x4a1bfe(_0x252dc0);});});}exports[_0x83bc('0x14')]=function(_0x1b9955){var _0xec1d21=this;return new Promise(function(_0x3eb1c0,_0x3e2760){return db[_0x83bc('0x15')][_0x83bc('0x16')](_0x1b9955[_0x83bc('0x17')],{'raw':_0x1b9955['options']?_0x1b9955[_0x83bc('0x18')][_0x83bc('0x19')]===undefined?!![]:![]:!![]})[_0x83bc('0x8')](function(_0x4b8813){logger[_0x83bc('0x11')](_0x83bc('0x14'),_0x1b9955);logger[_0x83bc('0xb')](_0x83bc('0x14'),_0x1b9955,JSON[_0x83bc('0xd')](_0x4b8813));_0x3eb1c0(_0x4b8813);})[_0x83bc('0x13')](function(_0x4f3409){logger['error']('CreateCmHopperHistory',_0x4f3409[_0x83bc('0x10')],_0x1b9955);_0x3e2760(_0xec1d21[_0x83bc('0xe')](0x1f4,_0x4f3409[_0x83bc('0x10')]));});});};exports[_0x83bc('0x1a')]=function(_0x32b308){var _0x5d8b59=this;return new Promise(function(_0x3cf002,_0x5ea9f2){return db[_0x83bc('0x15')]['findAll']({'raw':_0x32b308[_0x83bc('0x18')]?_0x32b308['options'][_0x83bc('0x19')]===undefined?!![]:![]:!![],'where':_0x32b308[_0x83bc('0x18')]?_0x32b308[_0x83bc('0x18')]['where']||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0x83bc('0x1b')]['col']('id')),'predictiveIntervalTotalCalls'],[db[_0x83bc('0x1b')]['fn'](_0x83bc('0x1c'),db[_0x83bc('0x1b')]['fn']('IF',db['sequelize'][_0x83bc('0x1d')](_0x83bc('0x1e')))),_0x83bc('0x1f')],[db['sequelize']['fn'](_0x83bc('0x1c'),db[_0x83bc('0x1b')]['fn']('IF',db[_0x83bc('0x1b')]['literal'](_0x83bc('0x20')))),_0x83bc('0x21')],[db[_0x83bc('0x1b')]['fn']('COUNT',db[_0x83bc('0x1b')]['fn']('IF',db['sequelize'][_0x83bc('0x1d')](_0x83bc('0x22')))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0x83bc('0x1b')]['fn']('AVG',db[_0x83bc('0x1b')]['fn']('IF',db[_0x83bc('0x1b')][_0x83bc('0x1d')](_0x83bc('0x23')))),_0x83bc('0x24')],[db[_0x83bc('0x1b')]['fn'](_0x83bc('0x25'),db[_0x83bc('0x1b')]['fn']('IF',db['sequelize'][_0x83bc('0x1d')](_0x83bc('0x26')))),_0x83bc('0x27')]]})['then'](function(_0x1931d9){logger[_0x83bc('0x11')]('AvgHandleTime',_0x32b308);logger['debug'](_0x83bc('0x1a'),_0x32b308,JSON['stringify'](_0x1931d9));_0x3cf002(_0x1931d9);})[_0x83bc('0x13')](function(_0x4c2eb4){logger[_0x83bc('0xe')]('AvgHandleTime',_0x4c2eb4[_0x83bc('0x10')],_0x32b308);_0x5ea9f2(_0x5d8b59[_0x83bc('0xe')](0x1f4,_0x4c2eb4[_0x83bc('0x10')]));});});};exports[_0x83bc('0x28')]=function(_0x9729f1){var _0x3463cd=this;return new Promise(function(_0x4fefe5,_0x55bb2a){return db[_0x83bc('0x15')][_0x83bc('0x29')]({'raw':_0x9729f1[_0x83bc('0x18')]?_0x9729f1[_0x83bc('0x18')][_0x83bc('0x19')]===undefined?!![]:![]:!![],'where':_0x9729f1[_0x83bc('0x18')]?_0x9729f1[_0x83bc('0x18')][_0x83bc('0x2a')]||null:null,'attributes':[[_0x83bc('0x2b'),_0x83bc('0x2c')],[db[_0x83bc('0x1b')]['fn']('COUNT',db[_0x83bc('0x1b')]['fn']('IF',db[_0x83bc('0x1b')][_0x83bc('0x1d')]('`state`\x20=\x200,\x201,\x20null'))),_0x83bc('0x2d')],[db[_0x83bc('0x1b')]['fn']('COUNT',db[_0x83bc('0x1b')]['fn']('IF',db['sequelize'][_0x83bc('0x1d')](_0x83bc('0x2e')))),_0x83bc('0x2f')],[db[_0x83bc('0x1b')]['fn']('COUNT',db[_0x83bc('0x1b')]['fn']('IF',db[_0x83bc('0x1b')][_0x83bc('0x1d')](_0x83bc('0x1e')))),_0x83bc('0x30')],[db[_0x83bc('0x1b')]['fn'](_0x83bc('0x1c'),db[_0x83bc('0x1b')]['fn']('IF',db[_0x83bc('0x1b')][_0x83bc('0x1d')]('`state`\x20=\x205,\x201,\x20null'))),_0x83bc('0x31')],[db['sequelize']['fn'](_0x83bc('0x1c'),db[_0x83bc('0x1b')]['fn']('IF',db[_0x83bc('0x1b')][_0x83bc('0x1d')]('`state`\x20=\x208,\x201,\x20null'))),'outboundCongestionCallsDay'],[db[_0x83bc('0x1b')]['fn'](_0x83bc('0x1c'),db[_0x83bc('0x1b')]['fn']('IF',db[_0x83bc('0x1b')][_0x83bc('0x1d')](_0x83bc('0x32')))),_0x83bc('0x33')],[db[_0x83bc('0x1b')]['fn'](_0x83bc('0x1c'),db[_0x83bc('0x1b')]['fn']('IF',db['sequelize'][_0x83bc('0x1d')](_0x83bc('0x34')))),'outboundDropCallsDayCallersExit'],[db[_0x83bc('0x1b')]['fn']('COUNT',db[_0x83bc('0x1b')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2012,\x201,\x20null'))),_0x83bc('0x35')],[db['sequelize']['fn'](_0x83bc('0x1c'),db[_0x83bc('0x1b')]['fn']('IF',db['sequelize'][_0x83bc('0x1d')](_0x83bc('0x36')))),_0x83bc('0x37')],[db[_0x83bc('0x1b')]['fn'](_0x83bc('0x1c'),db['sequelize']['fn']('IF',db[_0x83bc('0x1b')][_0x83bc('0x1d')]('`state`\x20=\x2014,\x201,\x20null'))),_0x83bc('0x38')],[db[_0x83bc('0x1b')]['fn'](_0x83bc('0x1c'),db['sequelize']['fn']('IF',db[_0x83bc('0x1b')][_0x83bc('0x1d')](_0x83bc('0x39')))),_0x83bc('0x3a')],[db[_0x83bc('0x1b')]['fn'](_0x83bc('0x1c'),db[_0x83bc('0x1b')]['fn']('IF',db[_0x83bc('0x1b')][_0x83bc('0x1d')]('`state`\x20=\x2016,\x201,\x20null'))),'outboundAnswerAgiCallsDay'],[db[_0x83bc('0x1b')]['fn'](_0x83bc('0x1c'),db[_0x83bc('0x1b')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2020,\x201,\x20null'))),_0x83bc('0x3a')],[db[_0x83bc('0x1b')]['fn'](_0x83bc('0x1c'),db[_0x83bc('0x1b')]['fn']('IF',db['sequelize'][_0x83bc('0x1d')](_0x83bc('0x3b')))),_0x83bc('0x3c')]],'group':[_0x83bc('0x2b')]})['then'](function(_0x10763e){logger['info']('GetVoiceQueueHopperHistory',_0x9729f1);logger[_0x83bc('0xb')](_0x83bc('0x28'),_0x9729f1,JSON['stringify'](_0x10763e));_0x4fefe5(_0x10763e);})['catch'](function(_0x5c2d24){logger[_0x83bc('0xe')](_0x83bc('0x28'),_0x5c2d24[_0x83bc('0x10')],_0x9729f1);_0x55bb2a(_0x3463cd[_0x83bc('0xe')](0x1f4,_0x5c2d24['message']));});});};exports[_0x83bc('0x3d')]=function(_0x1dee77){var _0x5a8364=this;return new Promise(function(_0x545751,_0x2dc9eb){return db[_0x83bc('0x15')][_0x83bc('0x29')]({'raw':_0x1dee77['options']?_0x1dee77[_0x83bc('0x18')][_0x83bc('0x19')]===undefined?!![]:![]:!![],'where':_0x1dee77[_0x83bc('0x18')]?_0x1dee77[_0x83bc('0x18')][_0x83bc('0x2a')]||null:null,'attributes':[[_0x83bc('0x2b'),_0x83bc('0x2c')],[db['sequelize']['fn'](_0x83bc('0x1c'),db[_0x83bc('0x1b')][_0x83bc('0x3e')]('id')),'ivrTotalCallsDays'],[db[_0x83bc('0x1b')]['fn']('COUNT',db[_0x83bc('0x1b')]['fn']('IF',db[_0x83bc('0x1b')][_0x83bc('0x1d')](_0x83bc('0x1e')))),'ivrAnswerCallsDay']],'group':[_0x83bc('0x2b')]})[_0x83bc('0x8')](function(_0x406a16){logger[_0x83bc('0x11')](_0x83bc('0x3d'),_0x1dee77);logger[_0x83bc('0xb')](_0x83bc('0x3d'),_0x1dee77,JSON['stringify'](_0x406a16));_0x545751(_0x406a16);})[_0x83bc('0x13')](function(_0x5dc04c){logger[_0x83bc('0xe')]('GetCampaignHopperHistory',_0x5dc04c[_0x83bc('0x10')],_0x1dee77);_0x2dc9eb(_0x5a8364['error'](0x1f4,_0x5dc04c[_0x83bc('0x10')]));});});}; \ No newline at end of file +var _0x122a=['body','options','raw','debug','AvgHandleTime','sequelize','col','predictiveIntervalTotalCalls','COUNT','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','findAll','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','where','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CmHopperHistory,\x20%s,\x20%s','request\x20sent','catch','CreateCmHopperHistory','CmHopperHistory','create'];(function(_0x59bd64,_0x237f2b){var _0x378c0e=function(_0x24e2be){while(--_0x24e2be){_0x59bd64['push'](_0x59bd64['shift']());}};_0x378c0e(++_0x237f2b);}(_0x122a,0xba));var _0xa122=function(_0x1d5af1,_0x1063ae){_0x1d5af1=_0x1d5af1-0x0;var _0x1453d6=_0x122a[_0x1d5af1];return _0x1453d6;};'use strict';var _=require(_0xa122('0x0'));var util=require(_0xa122('0x1'));var moment=require(_0xa122('0x2'));var BPromise=require(_0xa122('0x3'));var rs=require(_0xa122('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa122('0x5'));var logger=require('../../config/logger')(_0xa122('0x6'));var config=require(_0xa122('0x7'));var jayson=require(_0xa122('0x8'));var client=jayson[_0xa122('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x576d57,_0x5157f6,_0x23e139){return new BPromise(function(_0x190f74,_0x4d180f){return client[_0xa122('0xa')](_0x576d57,_0x23e139)[_0xa122('0xb')](function(_0x2046c4){logger[_0xa122('0xc')]('CmHopperHistory,\x20%s,\x20%s',_0x5157f6,'request\x20sent');logger['debug'](_0xa122('0xd'),_0x5157f6,'request\x20sent',JSON[_0xa122('0xe')](_0x2046c4));if(_0x2046c4[_0xa122('0xf')]){if(_0x2046c4['error'][_0xa122('0x10')]===0x1f4){logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x5157f6,_0x2046c4[_0xa122('0xf')][_0xa122('0x11')]);return _0x4d180f(_0x2046c4['error'][_0xa122('0x11')]);}logger[_0xa122('0xf')](_0xa122('0x12'),_0x5157f6,_0x2046c4['error'][_0xa122('0x11')]);return _0x190f74(_0x2046c4[_0xa122('0xf')][_0xa122('0x11')]);}else{logger[_0xa122('0xc')](_0xa122('0x12'),_0x5157f6,_0xa122('0x13'));_0x190f74(_0x2046c4['result'][_0xa122('0x11')]);}})[_0xa122('0x14')](function(_0xf1b733){logger[_0xa122('0xf')](_0xa122('0x12'),_0x5157f6,_0xf1b733);_0x4d180f(_0xf1b733);});});}exports[_0xa122('0x15')]=function(_0x1d6c40){var _0x25d093=this;return new Promise(function(_0x2f0e75,_0x5096cb){return db[_0xa122('0x16')][_0xa122('0x17')](_0x1d6c40[_0xa122('0x18')],{'raw':_0x1d6c40[_0xa122('0x19')]?_0x1d6c40[_0xa122('0x19')][_0xa122('0x1a')]===undefined?!![]:![]:!![]})[_0xa122('0xb')](function(_0x26ac5c){logger[_0xa122('0xc')]('CreateCmHopperHistory',_0x1d6c40);logger[_0xa122('0x1b')](_0xa122('0x15'),_0x1d6c40,JSON[_0xa122('0xe')](_0x26ac5c));_0x2f0e75(_0x26ac5c);})[_0xa122('0x14')](function(_0x303914){logger[_0xa122('0xf')]('CreateCmHopperHistory',_0x303914[_0xa122('0x11')],_0x1d6c40);_0x5096cb(_0x25d093[_0xa122('0xf')](0x1f4,_0x303914[_0xa122('0x11')]));});});};exports[_0xa122('0x1c')]=function(_0x15742e){var _0x43ce34=this;return new Promise(function(_0x577aae,_0x32df80){return db[_0xa122('0x16')]['findAll']({'raw':_0x15742e[_0xa122('0x19')]?_0x15742e[_0xa122('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x15742e[_0xa122('0x19')]?_0x15742e['options']['where']||null:null,'attributes':[[db[_0xa122('0x1d')]['fn']('COUNT',db[_0xa122('0x1d')][_0xa122('0x1e')]('id')),_0xa122('0x1f')],[db[_0xa122('0x1d')]['fn'](_0xa122('0x20'),db[_0xa122('0x1d')]['fn']('IF',db['sequelize'][_0xa122('0x21')](_0xa122('0x22')))),_0xa122('0x23')],[db['sequelize']['fn']('COUNT',db[_0xa122('0x1d')]['fn']('IF',db[_0xa122('0x1d')][_0xa122('0x21')](_0xa122('0x24')))),'predictiveIntervalDroppedCallsTimeout'],[db['sequelize']['fn'](_0xa122('0x20'),db[_0xa122('0x1d')]['fn']('IF',db['sequelize'][_0xa122('0x21')](_0xa122('0x25')))),_0xa122('0x26')],[db[_0xa122('0x1d')]['fn'](_0xa122('0x27'),db[_0xa122('0x1d')]['fn']('IF',db['sequelize'][_0xa122('0x21')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0xa122('0x28')],[db['sequelize']['fn'](_0xa122('0x27'),db[_0xa122('0x1d')]['fn']('IF',db[_0xa122('0x1d')][_0xa122('0x21')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0xa122('0x29')]]})['then'](function(_0x3792e0){logger[_0xa122('0xc')](_0xa122('0x1c'),_0x15742e);logger['debug']('AvgHandleTime',_0x15742e,JSON[_0xa122('0xe')](_0x3792e0));_0x577aae(_0x3792e0);})[_0xa122('0x14')](function(_0x211ed8){logger[_0xa122('0xf')](_0xa122('0x1c'),_0x211ed8[_0xa122('0x11')],_0x15742e);_0x32df80(_0x43ce34['error'](0x1f4,_0x211ed8[_0xa122('0x11')]));});});};exports[_0xa122('0x2a')]=function(_0x4e44a4){var _0x56be91=this;return new Promise(function(_0x3cd490,_0x1b96d6){return db[_0xa122('0x16')][_0xa122('0x2b')]({'raw':_0x4e44a4['options']?_0x4e44a4[_0xa122('0x19')][_0xa122('0x1a')]===undefined?!![]:![]:!![],'where':_0x4e44a4['options']?_0x4e44a4[_0xa122('0x19')]['where']||null:null,'attributes':[[_0xa122('0x2c'),_0xa122('0x2d')],[db[_0xa122('0x1d')]['fn'](_0xa122('0x20'),db[_0xa122('0x1d')]['fn']('IF',db[_0xa122('0x1d')][_0xa122('0x21')](_0xa122('0x2e')))),_0xa122('0x2f')],[db['sequelize']['fn'](_0xa122('0x20'),db['sequelize']['fn']('IF',db[_0xa122('0x1d')][_0xa122('0x21')](_0xa122('0x30')))),'outboundNoAnswerCallsDay'],[db[_0xa122('0x1d')]['fn'](_0xa122('0x20'),db[_0xa122('0x1d')]['fn']('IF',db['sequelize']['literal'](_0xa122('0x22')))),_0xa122('0x31')],[db[_0xa122('0x1d')]['fn'](_0xa122('0x20'),db[_0xa122('0x1d')]['fn']('IF',db['sequelize'][_0xa122('0x21')](_0xa122('0x32')))),_0xa122('0x33')],[db[_0xa122('0x1d')]['fn'](_0xa122('0x20'),db[_0xa122('0x1d')]['fn']('IF',db[_0xa122('0x1d')][_0xa122('0x21')]('`state`\x20=\x208,\x201,\x20null'))),_0xa122('0x34')],[db[_0xa122('0x1d')]['fn'](_0xa122('0x20'),db['sequelize']['fn']('IF',db[_0xa122('0x1d')][_0xa122('0x21')](_0xa122('0x35')))),_0xa122('0x36')],[db[_0xa122('0x1d')]['fn'](_0xa122('0x20'),db[_0xa122('0x1d')]['fn']('IF',db['sequelize'][_0xa122('0x21')](_0xa122('0x37')))),'outboundDropCallsDayCallersExit'],[db['sequelize']['fn'](_0xa122('0x20'),db['sequelize']['fn']('IF',db[_0xa122('0x1d')][_0xa122('0x21')](_0xa122('0x38')))),_0xa122('0x39')],[db['sequelize']['fn']('COUNT',db[_0xa122('0x1d')]['fn']('IF',db[_0xa122('0x1d')]['literal']('`state`\x20=\x2013,\x201,\x20null'))),_0xa122('0x3a')],[db[_0xa122('0x1d')]['fn'](_0xa122('0x20'),db[_0xa122('0x1d')]['fn']('IF',db[_0xa122('0x1d')]['literal'](_0xa122('0x3b')))),_0xa122('0x3c')],[db[_0xa122('0x1d')]['fn']('COUNT',db[_0xa122('0x1d')]['fn']('IF',db[_0xa122('0x1d')][_0xa122('0x21')]('`state`\x20=\x2018,\x201,\x20null'))),_0xa122('0x3d')],[db[_0xa122('0x1d')]['fn'](_0xa122('0x20'),db[_0xa122('0x1d')]['fn']('IF',db['sequelize'][_0xa122('0x21')]('`state`\x20=\x2016,\x201,\x20null'))),_0xa122('0x3e')],[db[_0xa122('0x1d')]['fn'](_0xa122('0x20'),db[_0xa122('0x1d')]['fn']('IF',db[_0xa122('0x1d')][_0xa122('0x21')](_0xa122('0x3f')))),_0xa122('0x3d')],[db[_0xa122('0x1d')]['fn'](_0xa122('0x20'),db[_0xa122('0x1d')]['fn']('IF',db[_0xa122('0x1d')][_0xa122('0x21')](_0xa122('0x40')))),_0xa122('0x41')]],'group':[_0xa122('0x2c')]})[_0xa122('0xb')](function(_0x178be2){logger[_0xa122('0xc')](_0xa122('0x2a'),_0x4e44a4);logger[_0xa122('0x1b')](_0xa122('0x2a'),_0x4e44a4,JSON['stringify'](_0x178be2));_0x3cd490(_0x178be2);})['catch'](function(_0x1b4a43){logger[_0xa122('0xf')](_0xa122('0x2a'),_0x1b4a43[_0xa122('0x11')],_0x4e44a4);_0x1b96d6(_0x56be91[_0xa122('0xf')](0x1f4,_0x1b4a43['message']));});});};exports[_0xa122('0x42')]=function(_0x5ce72e){var _0x2dee8f=this;return new Promise(function(_0x344423,_0x234515){return db[_0xa122('0x16')][_0xa122('0x2b')]({'raw':_0x5ce72e[_0xa122('0x19')]?_0x5ce72e[_0xa122('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x5ce72e[_0xa122('0x19')]?_0x5ce72e[_0xa122('0x19')][_0xa122('0x43')]||null:null,'attributes':[[_0xa122('0x2c'),_0xa122('0x2d')],[db[_0xa122('0x1d')]['fn'](_0xa122('0x20'),db[_0xa122('0x1d')][_0xa122('0x1e')]('id')),_0xa122('0x44')],[db[_0xa122('0x1d')]['fn'](_0xa122('0x20'),db[_0xa122('0x1d')]['fn']('IF',db['sequelize'][_0xa122('0x21')](_0xa122('0x22')))),_0xa122('0x45')]],'group':[_0xa122('0x2c')]})[_0xa122('0xb')](function(_0x59fcdc){logger[_0xa122('0xc')](_0xa122('0x42'),_0x5ce72e);logger[_0xa122('0x1b')](_0xa122('0x42'),_0x5ce72e,JSON[_0xa122('0xe')](_0x59fcdc));_0x344423(_0x59fcdc);})['catch'](function(_0x3310a8){logger[_0xa122('0xf')](_0xa122('0x42'),_0x3310a8[_0xa122('0x11')],_0x5ce72e);_0x234515(_0x2dee8f['error'](0x1f4,_0x3310a8[_0xa122('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 11366b7..43bdedd 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 _0x51bf=['./cmHopperHistory.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','update','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5f1e1c,_0x329fc6){var _0x5981f5=function(_0x2f1db5){while(--_0x2f1db5){_0x5f1e1c['push'](_0x5f1e1c['shift']());}};_0x5981f5(++_0x329fc6);}(_0x51bf,0x1b1));var _0xf51b=function(_0x1788cc,_0x8ed663){_0x1788cc=_0x1788cc-0x0;var _0x865d6d=_0x51bf[_0x1788cc];return _0x865d6d;};'use strict';var multer=require(_0xf51b('0x0'));var util=require('util');var path=require(_0xf51b('0x1'));var timeout=require(_0xf51b('0x2'));var express=require(_0xf51b('0x3'));var router=express[_0xf51b('0x4')]();var fs_extra=require(_0xf51b('0x5'));var auth=require(_0xf51b('0x6'));var interaction=require(_0xf51b('0x7'));var config=require('../../config/environment');var controller=require(_0xf51b('0x8'));router['get']('/',auth[_0xf51b('0x9')](),controller[_0xf51b('0xa')]);router[_0xf51b('0xb')](_0xf51b('0xc'),auth['isAuthenticated'](),controller[_0xf51b('0xd')]);router[_0xf51b('0xb')](_0xf51b('0xe'),auth[_0xf51b('0x9')](),controller[_0xf51b('0xf')]);router[_0xf51b('0x10')]('/',auth[_0xf51b('0x9')](),controller[_0xf51b('0x11')]);router[_0xf51b('0x12')](_0xf51b('0xe'),auth[_0xf51b('0x9')](),controller[_0xf51b('0x13')]);module[_0xf51b('0x14')]=router; \ No newline at end of file +var _0xa6eb=['multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./cmHopperHistory.controller','isAuthenticated','index','get','/describe','describe','/:id','show','create','put','update'];(function(_0x5eaa0b,_0x433b2f){var _0x28b295=function(_0x5e4f6d){while(--_0x5e4f6d){_0x5eaa0b['push'](_0x5eaa0b['shift']());}};_0x28b295(++_0x433b2f);}(_0xa6eb,0xbe));var _0xba6e=function(_0x432bfa,_0x1dbda3){_0x432bfa=_0x432bfa-0x0;var _0x5a249d=_0xa6eb[_0x432bfa];return _0x5a249d;};'use strict';var multer=require(_0xba6e('0x0'));var util=require(_0xba6e('0x1'));var path=require(_0xba6e('0x2'));var timeout=require(_0xba6e('0x3'));var express=require(_0xba6e('0x4'));var router=express['Router']();var fs_extra=require(_0xba6e('0x5'));var auth=require(_0xba6e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xba6e('0x7'));var controller=require(_0xba6e('0x8'));router['get']('/',auth[_0xba6e('0x9')](),controller[_0xba6e('0xa')]);router[_0xba6e('0xb')](_0xba6e('0xc'),auth[_0xba6e('0x9')](),controller[_0xba6e('0xd')]);router['get'](_0xba6e('0xe'),auth['isAuthenticated'](),controller[_0xba6e('0xf')]);router['post']('/',auth[_0xba6e('0x9')](),controller[_0xba6e('0x10')]);router[_0xba6e('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xba6e('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 9f3f334..62d6587 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 _0x165d=['STRING','name','sequelize','exports'];(function(_0x5c3ae9,_0x450f9a){var _0x3f5950=function(_0x594c1f){while(--_0x594c1f){_0x5c3ae9['push'](_0x5c3ae9['shift']());}};_0x3f5950(++_0x450f9a);}(_0x165d,0x14a));var _0xd165=function(_0x496b38,_0x62925c){_0x496b38=_0x496b38-0x0;var _0x3183c2=_0x165d[_0x496b38];return _0x3183c2;};'use strict';var Sequelize=require(_0xd165('0x0'));module[_0xd165('0x1')]={'name':{'type':Sequelize[_0xd165('0x2')],'unique':_0xd165('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xd165('0x2')]},'dialPrefix':{'type':Sequelize[_0xd165('0x2')]}}; \ No newline at end of file +var _0x1d25=['STRING','name','sequelize','exports'];(function(_0x20aca7,_0x5ac19f){var _0x4022dc=function(_0x36689c){while(--_0x36689c){_0x20aca7['push'](_0x20aca7['shift']());}};_0x4022dc(++_0x5ac19f);}(_0x1d25,0xba));var _0x51d2=function(_0x164af1,_0x3cf772){_0x164af1=_0x164af1-0x0;var _0x5d81a2=_0x1d25[_0x164af1];return _0x5d81a2;};'use strict';var Sequelize=require(_0x51d2('0x0'));module[_0x51d2('0x1')]={'name':{'type':Sequelize[_0x51d2('0x2')],'unique':_0x51d2('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x51d2('0x2')]},'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 91e22fe..52ba4c7 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 _0x7380=['format','cf_%d','raw','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','addCustomField','Sequelize','TEXT','text','number','INTEGER','switch','defaultValue','sequelize','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','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/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./cmList.socket','register','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','get','UserProfileResource','sendStatus','stack','name','index','CmList','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Lists','UserProfileSection','userProfileId','autoAssociation','error','body','describe','addDisposition','findOne','nolimit','order','ListId','Disposition','removeDispositions','ids','addContacts','CmContact','isArray','tags','join','push','each','omit','success','dataValues','errors','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat'];(function(_0x45f9a4,_0x40ecbd){var _0x47c24c=function(_0x1ff989){while(--_0x1ff989){_0x45f9a4['push'](_0x45f9a4['shift']());}};_0x47c24c(++_0x40ecbd);}(_0x7380,0xbc));var _0x0738=function(_0x234ae1,_0x42bdd6){_0x234ae1=_0x234ae1-0x0;var _0x227ba0=_0x7380[_0x234ae1];return _0x227ba0;};'use strict';var emlformat=require(_0x0738('0x0'));var rimraf=require(_0x0738('0x1'));var zipdir=require(_0x0738('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0738('0x3'));var moment=require(_0x0738('0x4'));var BPromise=require(_0x0738('0x5'));var Mustache=require(_0x0738('0x6'));var util=require(_0x0738('0x7'));var path=require(_0x0738('0x8'));var sox=require(_0x0738('0x9'));var csv=require(_0x0738('0xa'));var ejs=require(_0x0738('0xb'));var fs=require('fs');var fs_extra=require(_0x0738('0xc'));var _=require(_0x0738('0xd'));var squel=require(_0x0738('0xe'));var crypto=require(_0x0738('0xf'));var jsforce=require(_0x0738('0x10'));var deskjs=require(_0x0738('0x11'));var toCsv=require(_0x0738('0xa'));var querystring=require(_0x0738('0x12'));var Papa=require(_0x0738('0x13'));var Redis=require(_0x0738('0x14'));var authService=require(_0x0738('0x15'));var qs=require(_0x0738('0x16'));var as=require(_0x0738('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0738('0x18'))(_0x0738('0x19'));var utils=require(_0x0738('0x1a'));var config=require(_0x0738('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x0738('0x1c'))['db'];config[_0x0738('0x1d')]=_['defaults'](config[_0x0738('0x1d')],{'host':'localhost','port':0x18eb});var socket=require(_0x0738('0x1e'))(new Redis(config[_0x0738('0x1d')]));require(_0x0738('0x1f'))[_0x0738('0x20')](socket);function respondWithStatusCode(_0x4976f6,_0x55fb85){_0x55fb85=_0x55fb85||0xcc;return function(_0x2c79a1){if(_0x2c79a1){return _0x4976f6['sendStatus'](_0x55fb85);}return _0x4976f6[_0x0738('0x21')](_0x55fb85)[_0x0738('0x22')]();};}function respondWithResult(_0x54026e,_0x18662f){_0x18662f=_0x18662f||0xc8;return function(_0x2fda76){if(_0x2fda76){return _0x54026e['status'](_0x18662f)[_0x0738('0x23')](_0x2fda76);}};}function respondWithFilteredResult(_0x59b738,_0x235290){return function(_0x161f82){if(_0x161f82){var _0x240937=typeof _0x235290[_0x0738('0x24')]===_0x0738('0x25')&&typeof _0x235290[_0x0738('0x26')]===_0x0738('0x25');var _0x2ffe76=_0x161f82['count'];var _0x4dfa34=_0x240937?0x0:_0x235290[_0x0738('0x24')];var _0x90f4=_0x240937?_0x161f82[_0x0738('0x27')]:_0x235290['offset']+_0x235290['limit'];var _0x42debf;if(_0x90f4>=_0x2ffe76){_0x90f4=_0x2ffe76;_0x42debf=0xc8;}else{_0x42debf=0xce;}_0x59b738[_0x0738('0x21')](_0x42debf);return _0x59b738['set'](_0x0738('0x28'),_0x4dfa34+'-'+_0x90f4+'/'+_0x2ffe76)['json'](_0x161f82);}return null;};}function patchUpdates(_0x5655e0){return function(_0x111b83){try{jsonpatch[_0x0738('0x29')](_0x111b83,_0x5655e0,!![]);}catch(_0x254388){return BPromise[_0x0738('0x2a')](_0x254388);}return _0x111b83[_0x0738('0x2b')]();};}function saveUpdates(_0x4552de,_0x148a64){return function(_0x58df77){if(_0x58df77){return _0x58df77[_0x0738('0x2c')](_0x4552de)['then'](function(_0x4260d3){return _0x4260d3;});}return null;};}function removeEntity(_0x861086,_0x328f2f){return function(_0x16516f){if(_0x16516f){return _0x16516f[_0x0738('0x2d')]()[_0x0738('0x2e')](function(){var _0x52ae7e=_0x16516f[_0x0738('0x2f')]({'plain':!![]});var _0x23b87d='Lists';return db[_0x0738('0x30')][_0x0738('0x2d')]({'where':{'type':_0x23b87d,'resourceId':_0x52ae7e['id']}})[_0x0738('0x2e')](function(){return _0x16516f;});})['then'](function(){_0x861086[_0x0738('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x7722be,_0x54b2bf){return function(_0x5dcbbd){if(!_0x5dcbbd){_0x7722be[_0x0738('0x31')](0x194);}return _0x5dcbbd;};}function handleError(_0x44b58d,_0x596714){_0x596714=_0x596714||0x1f4;return function(_0x29e06e){logger['error'](_0x29e06e[_0x0738('0x32')]);if(_0x29e06e[_0x0738('0x33')]){delete _0x29e06e[_0x0738('0x33')];}_0x44b58d[_0x0738('0x21')](_0x596714)['send'](_0x29e06e);};}exports[_0x0738('0x34')]=function(_0x3b92c1,_0x1a5c87){var _0x48ca1d={},_0x454299={},_0x365eb0={'count':0x0,'rows':[]};var _0x336f93=_['map'](db[_0x0738('0x35')][_0x0738('0x36')],function(_0x32c725){return{'name':_0x32c725[_0x0738('0x37')],'type':_0x32c725[_0x0738('0x38')][_0x0738('0x39')]};});_0x454299[_0x0738('0x3a')]=_[_0x0738('0x3b')](_0x336f93,_0x0738('0x33'));_0x454299['query']=_[_0x0738('0x3c')](_0x3b92c1[_0x0738('0x3d')]);_0x454299[_0x0738('0x3e')]=_[_0x0738('0x3f')](_0x454299[_0x0738('0x3a')],_0x454299[_0x0738('0x3d')]);_0x48ca1d[_0x0738('0x40')]=_['intersection'](_0x454299[_0x0738('0x3a')],qs[_0x0738('0x41')](_0x3b92c1[_0x0738('0x3d')][_0x0738('0x41')]));_0x48ca1d['attributes']=_0x48ca1d['attributes'][_0x0738('0x42')]?_0x48ca1d[_0x0738('0x40')]:_0x454299[_0x0738('0x3a')];if(!_0x3b92c1[_0x0738('0x3d')][_0x0738('0x43')]('nolimit')){_0x48ca1d[_0x0738('0x26')]=qs[_0x0738('0x26')](_0x3b92c1['query']['limit']);_0x48ca1d['offset']=qs['offset'](_0x3b92c1[_0x0738('0x3d')][_0x0738('0x24')]);}_0x48ca1d['order']=qs[_0x0738('0x44')](_0x3b92c1['query'][_0x0738('0x44')]);_0x48ca1d[_0x0738('0x45')]=qs[_0x0738('0x3e')](_[_0x0738('0x46')](_0x3b92c1['query'],_0x454299[_0x0738('0x3e')]),_0x336f93);if(_0x3b92c1['query']['filter']){_0x48ca1d[_0x0738('0x45')]=_[_0x0738('0x47')](_0x48ca1d[_0x0738('0x45')],{'$or':_[_0x0738('0x3b')](_0x336f93,function(_0x5251dc){if(_0x5251dc[_0x0738('0x38')]!==_0x0738('0x48')){var _0x48bdac={};_0x48bdac[_0x5251dc[_0x0738('0x33')]]={'$like':'%'+_0x3b92c1[_0x0738('0x3d')][_0x0738('0x49')]+'%'};return _0x48bdac;}})});}_0x48ca1d=_[_0x0738('0x47')]({},_0x48ca1d,_0x3b92c1[_0x0738('0x4a')]);var _0x6252f3={'where':_0x48ca1d['where']};return db['CmList'][_0x0738('0x27')](_0x6252f3)[_0x0738('0x2e')](function(_0x5c3d17){_0x365eb0['count']=_0x5c3d17;if(_0x3b92c1[_0x0738('0x3d')][_0x0738('0x4b')]){_0x48ca1d[_0x0738('0x4c')]=[{'all':!![]}];}return db[_0x0738('0x35')][_0x0738('0x4d')](_0x48ca1d);})[_0x0738('0x2e')](function(_0x1cf159){_0x365eb0[_0x0738('0x4e')]=_0x1cf159;return _0x365eb0;})['then'](respondWithFilteredResult(_0x1a5c87,_0x48ca1d))['catch'](handleError(_0x1a5c87,null));};exports['show']=function(_0x4bb10a,_0x5efd94){var _0x13551d={'raw':![],'where':{'id':_0x4bb10a[_0x0738('0x4f')]['id']}},_0xf5a652={};_0xf5a652[_0x0738('0x3a')]=_[_0x0738('0x3c')](db[_0x0738('0x35')]['rawAttributes']);_0xf5a652['query']=_[_0x0738('0x3c')](_0x4bb10a[_0x0738('0x3d')]);_0xf5a652[_0x0738('0x3e')]=_[_0x0738('0x3f')](_0xf5a652['model'],_0xf5a652[_0x0738('0x3d')]);_0x13551d[_0x0738('0x40')]=_[_0x0738('0x3f')](_0xf5a652['model'],qs[_0x0738('0x41')](_0x4bb10a[_0x0738('0x3d')]['fields']));_0x13551d['attributes']=_0x13551d[_0x0738('0x40')]['length']?_0x13551d[_0x0738('0x40')]:_0xf5a652['model'];if(_0x4bb10a[_0x0738('0x3d')][_0x0738('0x4b')]){_0x13551d[_0x0738('0x4c')]=[{'all':!![]}];}_0x13551d=_['merge']({},_0x13551d,_0x4bb10a[_0x0738('0x4a')]);return db['CmList'][_0x0738('0x50')](_0x13551d)[_0x0738('0x2e')](handleEntityNotFound(_0x5efd94,null))[_0x0738('0x2e')](respondWithResult(_0x5efd94,null))[_0x0738('0x51')](handleError(_0x5efd94,null));};exports[_0x0738('0x52')]=function(_0x15a635,_0x4d6da3){return db[_0x0738('0x35')][_0x0738('0x52')](_0x15a635['body'],{})['then'](function(_0x8e4fa4){var _0x476878=_0x15a635[_0x0738('0x53')][_0x0738('0x2f')]({'plain':!![]});if(!_0x476878)throw new Error(_0x0738('0x54'));if(_0x476878['role']===_0x0738('0x53')){var _0x5c676f=_0x8e4fa4[_0x0738('0x2f')]({'plain':!![]});var _0x6257f4=_0x0738('0x55');return db[_0x0738('0x56')][_0x0738('0x50')]({'where':{'name':_0x6257f4,'userProfileId':_0x476878[_0x0738('0x57')]},'raw':!![]})[_0x0738('0x2e')](function(_0x1134f6){if(_0x1134f6&&_0x1134f6[_0x0738('0x58')]===0x0){return db['UserProfileResource']['create']({'name':_0x5c676f[_0x0738('0x33')],'resourceId':_0x5c676f['id'],'type':_0x1134f6['name'],'sectionId':_0x1134f6['id']},{})[_0x0738('0x2e')](function(){return _0x8e4fa4;});}else{return _0x8e4fa4;}})[_0x0738('0x51')](function(_0x38cabe){logger[_0x0738('0x59')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x38cabe);throw _0x38cabe;});}return _0x8e4fa4;})['then'](respondWithResult(_0x4d6da3,0xc9))[_0x0738('0x51')](handleError(_0x4d6da3,null));};exports['update']=function(_0x57e840,_0x27ae9b){if(_0x57e840[_0x0738('0x5a')]['id']){delete _0x57e840['body']['id'];}return db[_0x0738('0x35')][_0x0738('0x50')]({'where':{'id':_0x57e840['params']['id']}})[_0x0738('0x2e')](handleEntityNotFound(_0x27ae9b,null))['then'](saveUpdates(_0x57e840['body'],null))['then'](respondWithResult(_0x27ae9b,null))[_0x0738('0x51')](handleError(_0x27ae9b,null));};exports[_0x0738('0x2d')]=function(_0x2265db,_0x3220c6){return db[_0x0738('0x35')][_0x0738('0x50')]({'where':{'id':_0x2265db[_0x0738('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3220c6,null))['then'](removeEntity(_0x3220c6,null))[_0x0738('0x51')](handleError(_0x3220c6,null));};exports[_0x0738('0x5b')]=function(_0x4f89c1,_0x1a0009){return db[_0x0738('0x35')][_0x0738('0x5b')]()['then'](respondWithResult(_0x1a0009,null))['catch'](handleError(_0x1a0009,null));};exports[_0x0738('0x5c')]=function(_0x4e8143,_0xd198d,_0x15691a){if(_0x4e8143[_0x0738('0x5a')]['id']){delete _0x4e8143[_0x0738('0x5a')]['id'];}return db[_0x0738('0x35')]['find']({'where':{'id':_0x4e8143[_0x0738('0x4f')]['id']}})['then'](handleEntityNotFound(_0xd198d,null))[_0x0738('0x2e')](function(_0x283f19){if(_0x283f19){_0x4e8143[_0x0738('0x5a')]['ListId']=_0x283f19['id'];return db['Disposition'][_0x0738('0x52')](_0x4e8143['body']);}})['then'](respondWithResult(_0xd198d,null))[_0x0738('0x51')](handleError(_0xd198d,null));};exports['getDispositions']=function(_0x548ce8,_0x214de8,_0x2a1906){var _0x33a2fa={'raw':![],'where':{}};var _0x5c7125={};var _0xfa31ff={'count':0x0,'rows':[]};return db[_0x0738('0x35')][_0x0738('0x5d')]({'where':{'id':_0x548ce8[_0x0738('0x4f')]['id']}})['then'](handleEntityNotFound(_0x214de8,null))['then'](function(_0x5ec88f){if(_0x5ec88f){_0x5c7125[_0x0738('0x3a')]=_[_0x0738('0x3c')](db['Disposition'][_0x0738('0x36')]);_0x5c7125[_0x0738('0x3d')]=_[_0x0738('0x3c')](_0x548ce8[_0x0738('0x3d')]);_0x5c7125[_0x0738('0x3e')]=_['intersection'](_0x5c7125[_0x0738('0x3a')],_0x5c7125[_0x0738('0x3d')]);_0x33a2fa[_0x0738('0x40')]=_[_0x0738('0x3f')](_0x5c7125[_0x0738('0x3a')],qs[_0x0738('0x41')](_0x548ce8[_0x0738('0x3d')][_0x0738('0x41')]));_0x33a2fa[_0x0738('0x40')]=_0x33a2fa[_0x0738('0x40')][_0x0738('0x42')]?_0x33a2fa[_0x0738('0x40')]:_0x5c7125[_0x0738('0x3a')];if(!_0x548ce8[_0x0738('0x3d')]['hasOwnProperty'](_0x0738('0x5e'))){_0x33a2fa['limit']=qs['limit'](_0x548ce8[_0x0738('0x3d')][_0x0738('0x26')]);_0x33a2fa[_0x0738('0x24')]=qs[_0x0738('0x24')](_0x548ce8[_0x0738('0x3d')][_0x0738('0x24')]);}_0x33a2fa[_0x0738('0x5f')]=qs[_0x0738('0x44')](_0x548ce8[_0x0738('0x3d')]['sort']);_0x33a2fa[_0x0738('0x45')]=qs[_0x0738('0x3e')](_[_0x0738('0x46')](_0x548ce8[_0x0738('0x3d')],_0x5c7125[_0x0738('0x3e')]));_0x33a2fa[_0x0738('0x45')][_0x0738('0x60')]=_0x5ec88f['id'];if(_0x548ce8[_0x0738('0x3d')]['filter']){_0x33a2fa['where']=_[_0x0738('0x47')](_0x33a2fa['where'],{'$or':_['map'](_0x33a2fa[_0x0738('0x40')],function(_0x272b9f){var _0x223909={};_0x223909[_0x272b9f]={'$like':'%'+_0x548ce8['query'][_0x0738('0x49')]+'%'};return _0x223909;})});}_0x33a2fa=_[_0x0738('0x47')]({},_0x33a2fa,_0x548ce8[_0x0738('0x4a')]);return db['Disposition'][_0x0738('0x27')]({'where':_0x33a2fa[_0x0738('0x45')]})['then'](function(_0x1be8c2){_0xfa31ff[_0x0738('0x27')]=_0x1be8c2;if(_0x548ce8[_0x0738('0x3d')][_0x0738('0x4b')]){_0x33a2fa[_0x0738('0x4c')]=[{'all':!![]}];}return db[_0x0738('0x61')][_0x0738('0x4d')](_0x33a2fa);})[_0x0738('0x2e')](function(_0x4ca99f){_0xfa31ff[_0x0738('0x4e')]=_0x4ca99f;return _0xfa31ff;});}})['then'](respondWithFilteredResult(_0x214de8,_0x33a2fa))[_0x0738('0x51')](handleError(_0x214de8,null));};exports[_0x0738('0x62')]=function(_0x1f9b6c,_0x712526,_0x177c27){return db[_0x0738('0x35')][_0x0738('0x50')]({'where':{'id':_0x1f9b6c[_0x0738('0x4f')]['id']}})[_0x0738('0x2e')](handleEntityNotFound(_0x712526,null))[_0x0738('0x2e')](function(_0x46342d){if(_0x46342d){return _0x46342d['removeDispositions'](_0x1f9b6c[_0x0738('0x3d')][_0x0738('0x63')]);}})[_0x0738('0x2e')](respondWithStatusCode(_0x712526,null))[_0x0738('0x51')](handleError(_0x712526,null));};exports[_0x0738('0x64')]=function(_0x37efb1,_0x4fa80a,_0x137e6f){return db[_0x0738('0x35')]['find']({'where':{'id':_0x37efb1[_0x0738('0x4f')]['id']}})[_0x0738('0x2e')](handleEntityNotFound(_0x4fa80a,null))[_0x0738('0x2e')](function(_0x30cc93){if(_0x30cc93){var _0x3831b2=[];var _0x58e282={'success':[],'errors':[]};return db[_0x0738('0x65')][_0x0738('0x5b')]()[_0x0738('0x2e')](function(_0x2b43c3){if(_0x37efb1[_0x0738('0x5a')]['tags']&&_[_0x0738('0x66')](_0x37efb1[_0x0738('0x5a')]['tags'])){if(_0x37efb1[_0x0738('0x5a')]['tags'][_0x0738('0x42')]){_0x37efb1[_0x0738('0x5a')][_0x0738('0x67')]=_0x37efb1[_0x0738('0x5a')]['tags'][_0x0738('0x68')](';')+';';}else{_0x37efb1[_0x0738('0x5a')][_0x0738('0x67')]=null;}}else{_0x37efb1[_0x0738('0x5a')][_0x0738('0x67')]=null;}if(_0x37efb1[_0x0738('0x5a')]&&_[_0x0738('0x66')](_0x37efb1[_0x0738('0x5a')])){for(var _0x2f78ff=0x0;_0x2f78ff<_0x37efb1[_0x0738('0x5a')][_0x0738('0x42')];_0x2f78ff+=0x1){_0x37efb1[_0x0738('0x5a')][_0x2f78ff][_0x0738('0x60')]=_0x37efb1[_0x0738('0x4f')]['id'];_0x3831b2[_0x0738('0x69')](_0x37efb1[_0x0738('0x5a')][_0x2f78ff]);}return BPromise[_0x0738('0x6a')](_0x3831b2,function(_0x1d1cd3){return db['CmContact'][_0x0738('0x52')](_[_0x0738('0x6b')](_0x1d1cd3,[_0x0738('0x63'),'id'])||{},{'fields':_[_0x0738('0x3c')](_0x2b43c3),'raw':!![]})['then'](function(_0x3a3f27){_0x58e282[_0x0738('0x6c')][_0x0738('0x69')](_0x3a3f27[_0x0738('0x6d')]);})[_0x0738('0x51')](function(_0xdf3799){_0x58e282[_0x0738('0x6e')][_0x0738('0x69')]({'data':_0x1d1cd3,'error':_0xdf3799['message']});});})[_0x0738('0x2e')](function(_0x2b3861){return _0x58e282;})[_0x0738('0x51')](function(_0x2a939f){return _0x2a939f;});}else{_0x4fa80a[_0x0738('0x21')](0x190)[_0x0738('0x23')]({'message':_0x0738('0x6f')});}});}})['then'](respondWithResult(_0x4fa80a,null))[_0x0738('0x51')](handleError(_0x4fa80a,null));};exports[_0x0738('0x70')]=function(_0x465cda,_0x4f9ef7,_0x29b7f9){var _0x38330f;return db[_0x0738('0x35')][_0x0738('0x50')]({'where':{'id':_0x465cda[_0x0738('0x4f')]['id']},'include':[{'model':db[_0x0738('0x71')],'as':_0x0738('0x72')}]})[_0x0738('0x2e')](handleEntityNotFound(_0x4f9ef7,null))[_0x0738('0x2e')](function(_0x1f578a){if(_0x1f578a){_0x38330f=_0x1f578a;return db['CmContact'][_0x0738('0x36')];}})['then'](function(_0x45fc6d){if(_0x45fc6d){var _0x2ddacf={};var _0x58c393={};_0x58c393['model']=_[_0x0738('0x73')](_[_0x0738('0x3c')](_0x45fc6d),_[_0x0738('0x3b')](_0x38330f[_0x0738('0x72')],function(_0x43075e){return util[_0x0738('0x74')](_0x0738('0x75'),_0x43075e['id']);}));_0x58c393[_0x0738('0x3d')]=_[_0x0738('0x3c')](_0x465cda[_0x0738('0x3d')]);_0x58c393[_0x0738('0x3e')]=_['intersection'](_0x58c393[_0x0738('0x3a')],_0x58c393[_0x0738('0x3d')]);_0x2ddacf['attributes']=_[_0x0738('0x3f')](_0x58c393[_0x0738('0x3a')],qs[_0x0738('0x41')](_0x465cda[_0x0738('0x3d')][_0x0738('0x41')]));_0x2ddacf[_0x0738('0x40')]=_0x2ddacf[_0x0738('0x40')][_0x0738('0x42')]?_0x2ddacf[_0x0738('0x40')]:_0x58c393[_0x0738('0x3a')];if(!_0x465cda[_0x0738('0x3d')]['hasOwnProperty'](_0x0738('0x5e'))){_0x2ddacf[_0x0738('0x26')]=qs[_0x0738('0x26')](_0x465cda[_0x0738('0x3d')][_0x0738('0x26')]);_0x2ddacf[_0x0738('0x24')]=qs[_0x0738('0x24')](_0x465cda['query'][_0x0738('0x24')]);}_0x2ddacf[_0x0738('0x5f')]=qs['sort'](_0x465cda[_0x0738('0x3d')][_0x0738('0x44')]);_0x2ddacf['where']=qs[_0x0738('0x3e')](_['pick'](_0x465cda['query'],_0x58c393[_0x0738('0x3e')]));_0x2ddacf[_0x0738('0x76')]=!![];if(_0x465cda[_0x0738('0x3d')][_0x0738('0x49')]){_0x2ddacf[_0x0738('0x45')]=_[_0x0738('0x47')](_0x2ddacf[_0x0738('0x45')],{'$or':_[_0x0738('0x3b')](_0x2ddacf[_0x0738('0x40')],function(_0x32792f){var _0xdaf4cf={};_0xdaf4cf[_0x32792f]={'$like':'%'+_0x465cda[_0x0738('0x3d')][_0x0738('0x49')]+'%'};return _0xdaf4cf;})});}_0x2ddacf=_[_0x0738('0x47')]({},_0x2ddacf,_0x465cda[_0x0738('0x4a')]);return _0x38330f[_0x0738('0x70')](_0x2ddacf);}})[_0x0738('0x2e')](respondWithResult(_0x4f9ef7,null))['catch'](handleError(_0x4f9ef7,null));};exports['getContactsCsv']=function(_0x3c9def,_0x1f4af8,_0x203efe){var _0x3b7127;return db[_0x0738('0x35')][_0x0738('0x50')]({'where':{'id':_0x3c9def[_0x0738('0x4f')]['id']},'include':[{'model':db['CmCustomField'],'as':'CustomFields'}]})['then'](handleEntityNotFound(_0x1f4af8,null))[_0x0738('0x2e')](function(_0x2ea299){if(_0x2ea299){_0x3b7127=_0x2ea299;return db[_0x0738('0x65')]['rawAttributes'];}})[_0x0738('0x2e')](function(_0x495895){if(_0x495895){var _0x504a0c={};var _0x5a1def={};_0x5a1def['model']=_[_0x0738('0x73')](_[_0x0738('0x3c')](_0x495895),_[_0x0738('0x3b')](_0x3b7127[_0x0738('0x72')],function(_0x59b5e3){return util[_0x0738('0x74')](_0x0738('0x75'),_0x59b5e3['id']);}));_0x5a1def[_0x0738('0x3d')]=_[_0x0738('0x3c')](_0x3c9def['query']);_0x5a1def[_0x0738('0x3e')]=_[_0x0738('0x3f')](_0x5a1def['model'],_0x5a1def[_0x0738('0x3d')]);_0x504a0c[_0x0738('0x40')]=_['intersection'](_0x5a1def[_0x0738('0x3a')],qs[_0x0738('0x41')](_0x3c9def[_0x0738('0x3d')][_0x0738('0x41')]));_0x504a0c[_0x0738('0x40')]=_0x504a0c[_0x0738('0x40')]['length']?_0x504a0c['attributes']:_0x5a1def[_0x0738('0x3a')];if(!_0x3c9def[_0x0738('0x3d')][_0x0738('0x43')](_0x0738('0x5e'))){_0x504a0c[_0x0738('0x26')]=qs['limit'](_0x3c9def[_0x0738('0x3d')][_0x0738('0x26')]);_0x504a0c[_0x0738('0x24')]=qs[_0x0738('0x24')](_0x3c9def[_0x0738('0x3d')][_0x0738('0x24')]);}_0x504a0c[_0x0738('0x5f')]=qs[_0x0738('0x44')](_0x3c9def[_0x0738('0x3d')][_0x0738('0x44')]);_0x504a0c['where']=qs[_0x0738('0x3e')](_[_0x0738('0x46')](_0x3c9def['query'],_0x5a1def['filters']));_0x504a0c[_0x0738('0x76')]=!![];if(_0x3c9def['query']['filter']){_0x504a0c[_0x0738('0x45')]=_['merge'](_0x504a0c[_0x0738('0x45')],{'$or':_[_0x0738('0x3b')](_0x504a0c['attributes'],function(_0x267589){var _0x47f72a={};_0x47f72a[_0x267589]={'$like':'%'+_0x3c9def[_0x0738('0x3d')]['filter']+'%'};return _0x47f72a;})});}_0x504a0c=_['merge']({},_0x504a0c,_0x3c9def[_0x0738('0x4a')]);return _0x3b7127[_0x0738('0x70')](_0x504a0c);}})[_0x0738('0x2e')](function(_0x286b9d){if(!_[_0x0738('0x77')](_0x286b9d)){var _0x49ca84=toCsv(_0x286b9d);var _0x2dc392=Date[_0x0738('0x78')]();fs[_0x0738('0x79')](util[_0x0738('0x74')](_0x0738('0x7a'),_0x3b7127['id'],_0x2dc392),_0x49ca84);_0x1f4af8[_0x0738('0x7b')]('Content-disposition',_0x0738('0x7c')+util['format'](_0x0738('0x7d'),_0x3b7127['id'],_0x2dc392));_0x1f4af8[_0x0738('0x7b')](_0x0738('0x7e'),_0x0738('0x7f'));return _0x1f4af8[_0x0738('0x80')](util[_0x0738('0x74')](_0x0738('0x7a'),_0x3b7127['id'],_0x2dc392));}else{return _0x1f4af8['sendStatus'](0xcc);}})['catch'](handleError(_0x1f4af8,null));};exports[_0x0738('0x81')]=function(_0x3eb10c,_0x52c0ab,_0x5ea9b4){var _0x457d95;delete _0x3eb10c[_0x0738('0x5a')]['id'];return db[_0x0738('0x35')][_0x0738('0x5d')]({'where':{'id':_0x3eb10c[_0x0738('0x4f')]['id']}})[_0x0738('0x2e')](handleEntityNotFound(_0x52c0ab,null))[_0x0738('0x2e')](function(_0x5923c1){if(_0x5923c1){return db['sequelize']['transaction'](function(_0x156a1f){return db['CmCustomField'][_0x0738('0x52')](_0x3eb10c[_0x0738('0x5a')],{'transaction':_0x156a1f})['then'](function(_0x31de8e){_0x457d95=_0x31de8e;return _0x5923c1['addCustomFields'](_0x31de8e,{'transaction':_0x156a1f});})[_0x0738('0x2e')](function(){var _0x3e4aa0={'type':db[_0x0738('0x82')][_0x0738('0x83')],'transaction':_0x156a1f};switch(_0x3eb10c[_0x0738('0x5a')][_0x0738('0x38')]){case _0x0738('0x84'):_0x3e4aa0[_0x0738('0x38')]=db[_0x0738('0x82')][_0x0738('0x83')];break;case _0x0738('0x85'):_0x3e4aa0[_0x0738('0x38')]=db['Sequelize'][_0x0738('0x86')];break;case _0x0738('0x87'):_0x3e4aa0[_0x0738('0x38')]=db[_0x0738('0x82')]['BOOLEAN'];_0x3e4aa0[_0x0738('0x88')]=![];break;default:}return db[_0x0738('0x89')][_0x0738('0x8a')][_0x0738('0x8b')](_0x0738('0x8c'),util[_0x0738('0x74')](_0x0738('0x8d'),_0x457d95['id']),_0x3e4aa0);})['then'](function(){return _0x457d95;});});}})['then'](respondWithResult(_0x52c0ab,null))[_0x0738('0x51')](handleError(_0x52c0ab,null));};exports[_0x0738('0x8e')]=function(_0xa95a8,_0x15cedc,_0x572fdd){var _0x135193={};var _0x23d297={};var _0x5c0b37;var _0x33dbb9;return db['CmList'][_0x0738('0x5d')]({'where':{'id':_0xa95a8[_0x0738('0x4f')]['id']}})['then'](handleEntityNotFound(_0x15cedc,null))[_0x0738('0x2e')](function(_0x379256){if(_0x379256){_0x5c0b37=_0x379256;_0x23d297[_0x0738('0x3a')]=_[_0x0738('0x3c')](db[_0x0738('0x71')][_0x0738('0x36')]);_0x23d297[_0x0738('0x3d')]=_[_0x0738('0x3c')](_0xa95a8[_0x0738('0x3d')]);_0x23d297[_0x0738('0x3e')]=_[_0x0738('0x3f')](_0x23d297[_0x0738('0x3a')],_0x23d297[_0x0738('0x3d')]);_0x135193[_0x0738('0x40')]=_[_0x0738('0x3f')](_0x23d297[_0x0738('0x3a')],qs[_0x0738('0x41')](_0xa95a8[_0x0738('0x3d')]['fields']));_0x135193[_0x0738('0x40')]=_0x135193[_0x0738('0x40')]['length']?_0x135193['attributes']:_0x23d297[_0x0738('0x3a')];_0x135193[_0x0738('0x5f')]=qs[_0x0738('0x44')](_0xa95a8[_0x0738('0x3d')]['sort']);_0x135193[_0x0738('0x45')]=qs[_0x0738('0x3e')](_[_0x0738('0x46')](_0xa95a8[_0x0738('0x3d')],_0x23d297[_0x0738('0x3e')]));_0x135193[_0x0738('0x45')]=_[_0x0738('0x47')](_0x135193[_0x0738('0x45')],{'$or':[{'ListId':_0x379256['id']},{'ListId':null}]});if(_0xa95a8[_0x0738('0x3d')][_0x0738('0x49')]){_0x135193[_0x0738('0x45')]=_[_0x0738('0x47')](_0x135193[_0x0738('0x45')],{'$or':_[_0x0738('0x3b')](_0x135193[_0x0738('0x40')],function(_0x1cc4f7){var _0x42a88b={};_0x42a88b[_0x1cc4f7]={'$like':'%'+_0xa95a8['query'][_0x0738('0x49')]+'%'};return _0x42a88b;})});}_0x135193=_[_0x0738('0x47')]({},_0x135193,_0xa95a8[_0x0738('0x4a')]);return db[_0x0738('0x71')][_0x0738('0x8f')](_0x135193);}})[_0x0738('0x2e')](respondWithResult(_0x15cedc,null))[_0x0738('0x51')](handleError(_0x15cedc,null));};exports[_0x0738('0x90')]=function(_0x21a26c,_0x43b728,_0xf38672){return db[_0x0738('0x35')]['find']({'where':{'id':_0x21a26c['params']['id']}})[_0x0738('0x2e')](handleEntityNotFound(_0x43b728,null))[_0x0738('0x2e')](function(_0x3c6e50){if(_0x3c6e50){return _0x3c6e50[_0x0738('0x90')](_0x21a26c[_0x0738('0x5a')][_0x0738('0x63')],_[_0x0738('0x6b')](_0x21a26c['body'],[_0x0738('0x63'),'id'])||{})[_0x0738('0x91')](function(_0x5a782c){for(var _0x5d0b9b=0x0;_0x5d0b9b<_0x21a26c[_0x0738('0x5a')]['ids'][_0x0738('0x42')];_0x5d0b9b+=0x1){socket[_0x0738('0x92')](_0x0738('0x93'),{'UserId':Number(_0x21a26c[_0x0738('0x5a')][_0x0738('0x63')][_0x5d0b9b]),'CmListId':Number(_0x21a26c[_0x0738('0x4f')]['id'])});}return _0x5a782c;});}})['then'](respondWithResult(_0x43b728,null))['catch'](handleError(_0x43b728,null));};exports[_0x0738('0x94')]=function(_0xceebdb,_0x56aa5c,_0x1ab4f0){return db[_0x0738('0x35')][_0x0738('0x50')]({'where':{'id':_0xceebdb[_0x0738('0x4f')]['id']}})[_0x0738('0x2e')](handleEntityNotFound(_0x56aa5c,null))[_0x0738('0x2e')](function(_0x7b53c6){if(_0x7b53c6){return _0x7b53c6['removeAgents'](_0xceebdb[_0x0738('0x3d')][_0x0738('0x63')])['then'](function(){if(_[_0x0738('0x66')](_0xceebdb['query']['ids'])){for(var _0x781e10=0x0;_0x781e10<_0xceebdb[_0x0738('0x3d')][_0x0738('0x63')][_0x0738('0x42')];_0x781e10+=0x1){socket['emit'](_0x0738('0x95'),{'UserId':Number(_0xceebdb[_0x0738('0x3d')]['ids'][_0x781e10]),'CmListId':Number(_0xceebdb['params']['id'])});}}else{socket[_0x0738('0x92')](_0x0738('0x95'),{'UserId':Number(_0xceebdb[_0x0738('0x3d')]['ids']),'CmListId':Number(_0xceebdb[_0x0738('0x4f')]['id'])});}});}})[_0x0738('0x2e')](respondWithStatusCode(_0x56aa5c,null))[_0x0738('0x51')](handleError(_0x56aa5c,null));};exports[_0x0738('0x96')]=function(_0x359bbf,_0x4d0068,_0x284157){var _0x8ae08b={};var _0x5be26b={};var _0x5aeef5;var _0x44f694;return db[_0x0738('0x35')][_0x0738('0x5d')]({'where':{'id':_0x359bbf[_0x0738('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4d0068,null))[_0x0738('0x2e')](function(_0x2366bb){if(_0x2366bb){_0x5aeef5=_0x2366bb;_0x5be26b[_0x0738('0x3a')]=_['keys'](db[_0x0738('0x97')][_0x0738('0x36')]);_0x5be26b[_0x0738('0x3d')]=_[_0x0738('0x3c')](_0x359bbf['query']);_0x5be26b[_0x0738('0x3e')]=_['intersection'](_0x5be26b[_0x0738('0x3a')],_0x5be26b['query']);_0x8ae08b[_0x0738('0x40')]=_['intersection'](_0x5be26b[_0x0738('0x3a')],qs['fields'](_0x359bbf[_0x0738('0x3d')][_0x0738('0x41')]));_0x8ae08b[_0x0738('0x40')]=_0x8ae08b[_0x0738('0x40')]['length']?_0x8ae08b[_0x0738('0x40')]:_0x5be26b[_0x0738('0x3a')];_0x8ae08b[_0x0738('0x5f')]=qs[_0x0738('0x44')](_0x359bbf['query'][_0x0738('0x44')]);_0x8ae08b['where']=qs[_0x0738('0x3e')](_[_0x0738('0x46')](_0x359bbf[_0x0738('0x3d')],_0x5be26b['filters']));if(_0x359bbf[_0x0738('0x3d')][_0x0738('0x49')]){_0x8ae08b[_0x0738('0x45')]=_[_0x0738('0x47')](_0x8ae08b[_0x0738('0x45')],{'$or':_[_0x0738('0x3b')](_0x8ae08b[_0x0738('0x40')],function(_0x349428){var _0x46345a={};_0x46345a[_0x349428]={'$like':'%'+_0x359bbf[_0x0738('0x3d')][_0x0738('0x49')]+'%'};return _0x46345a;})});}_0x8ae08b=_[_0x0738('0x47')]({},_0x8ae08b,_0x359bbf[_0x0738('0x4a')]);return _0x5aeef5[_0x0738('0x96')](_0x8ae08b);}})[_0x0738('0x2e')](function(_0x5e8c92){if(_0x5e8c92){_0x44f694=_0x5e8c92[_0x0738('0x42')];if(!_0x359bbf['query']['hasOwnProperty'](_0x0738('0x5e'))){_0x8ae08b[_0x0738('0x26')]=qs[_0x0738('0x26')](_0x359bbf[_0x0738('0x3d')][_0x0738('0x26')]);_0x8ae08b[_0x0738('0x24')]=qs[_0x0738('0x24')](_0x359bbf[_0x0738('0x3d')][_0x0738('0x24')]);}return _0x5aeef5[_0x0738('0x96')](_0x8ae08b);}})[_0x0738('0x2e')](function(_0x56437f){if(_0x56437f){return _0x56437f?{'count':_0x44f694,'rows':_0x56437f}:null;}})[_0x0738('0x2e')](respondWithResult(_0x4d0068,null))['catch'](handleError(_0x4d0068,null));}; \ No newline at end of file +var _0x64d2=['length','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','attachment;\x20filename=','Content-type','text/csv','download','addCustomField','findOne','sequelize','transaction','Sequelize','text','BOOLEAN','queryInterface','cm_contacts','cf_%s','getCustomFields','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','./cmList.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','Lists','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','CmList','find','create','body','user','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','ListId','Disposition','getDispositions','ids','addContacts','CmContact','describe','isArray','tags','join','push','each','success','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','cf_%d','format'];(function(_0x5754c1,_0x564a97){var _0x242cef=function(_0x36bee1){while(--_0x36bee1){_0x5754c1['push'](_0x5754c1['shift']());}};_0x242cef(++_0x564a97);}(_0x64d2,0x1c9));var _0x264d=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x64d2[_0x2bf141];return _0x48277b;};'use strict';var emlformat=require(_0x264d('0x0'));var rimraf=require(_0x264d('0x1'));var zipdir=require(_0x264d('0x2'));var jsonpatch=require(_0x264d('0x3'));var rp=require(_0x264d('0x4'));var moment=require(_0x264d('0x5'));var BPromise=require(_0x264d('0x6'));var Mustache=require('mustache');var util=require(_0x264d('0x7'));var path=require(_0x264d('0x8'));var sox=require(_0x264d('0x9'));var csv=require(_0x264d('0xa'));var ejs=require(_0x264d('0xb'));var fs=require('fs');var fs_extra=require(_0x264d('0xc'));var _=require(_0x264d('0xd'));var squel=require(_0x264d('0xe'));var crypto=require(_0x264d('0xf'));var jsforce=require(_0x264d('0x10'));var deskjs=require(_0x264d('0x11'));var toCsv=require(_0x264d('0xa'));var querystring=require(_0x264d('0x12'));var Papa=require(_0x264d('0x13'));var Redis=require(_0x264d('0x14'));var authService=require(_0x264d('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x264d('0x16'));var hardwareService=require(_0x264d('0x17'));var logger=require(_0x264d('0x18'))(_0x264d('0x19'));var utils=require('../../config/utils');var config=require(_0x264d('0x1a'));var licenseUtil=require(_0x264d('0x1b'));var db=require(_0x264d('0x1c'))['db'];config['redis']=_[_0x264d('0x1d')](config[_0x264d('0x1e')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x264d('0x1e')]));require(_0x264d('0x1f'))[_0x264d('0x20')](socket);function respondWithStatusCode(_0x63b687,_0x924ab2){_0x924ab2=_0x924ab2||0xcc;return function(_0x5caf33){if(_0x5caf33){return _0x63b687[_0x264d('0x21')](_0x924ab2);}return _0x63b687[_0x264d('0x22')](_0x924ab2)[_0x264d('0x23')]();};}function respondWithResult(_0x3d0ad6,_0x3308ca){_0x3308ca=_0x3308ca||0xc8;return function(_0x4209e2){if(_0x4209e2){return _0x3d0ad6['status'](_0x3308ca)[_0x264d('0x24')](_0x4209e2);}};}function respondWithFilteredResult(_0x5691ad,_0x60a25e){return function(_0x28978a){if(_0x28978a){var _0x51519e=typeof _0x60a25e[_0x264d('0x25')]===_0x264d('0x26')&&typeof _0x60a25e[_0x264d('0x27')]===_0x264d('0x26');var _0x22bf6d=_0x28978a['count'];var _0x4ee3b1=_0x51519e?0x0:_0x60a25e[_0x264d('0x25')];var _0x39e9c9=_0x51519e?_0x28978a[_0x264d('0x28')]:_0x60a25e[_0x264d('0x25')]+_0x60a25e[_0x264d('0x27')];var _0x295638;if(_0x39e9c9>=_0x22bf6d){_0x39e9c9=_0x22bf6d;_0x295638=0xc8;}else{_0x295638=0xce;}_0x5691ad[_0x264d('0x22')](_0x295638);return _0x5691ad[_0x264d('0x29')](_0x264d('0x2a'),_0x4ee3b1+'-'+_0x39e9c9+'/'+_0x22bf6d)[_0x264d('0x24')](_0x28978a);}return null;};}function patchUpdates(_0x37b4d2){return function(_0x17f2a2){try{jsonpatch[_0x264d('0x2b')](_0x17f2a2,_0x37b4d2,!![]);}catch(_0x2bf0be){return BPromise[_0x264d('0x2c')](_0x2bf0be);}return _0x17f2a2['save']();};}function saveUpdates(_0x3a1489,_0x29c35e){return function(_0x2b0c92){if(_0x2b0c92){return _0x2b0c92[_0x264d('0x2d')](_0x3a1489)[_0x264d('0x2e')](function(_0x2f2fc3){return _0x2f2fc3;});}return null;};}function removeEntity(_0x6fd7fd,_0x22f0e5){return function(_0xd24ece){if(_0xd24ece){return _0xd24ece['destroy']()[_0x264d('0x2e')](function(){var _0x2c3c00=_0xd24ece['get']({'plain':!![]});var _0x1cacaf=_0x264d('0x2f');return db[_0x264d('0x30')]['destroy']({'where':{'type':_0x1cacaf,'resourceId':_0x2c3c00['id']}})[_0x264d('0x2e')](function(){return _0xd24ece;});})['then'](function(){_0x6fd7fd[_0x264d('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1768e2,_0xd3fdd3){return function(_0x1176c8){if(!_0x1176c8){_0x1768e2['sendStatus'](0x194);}return _0x1176c8;};}function handleError(_0x2b616b,_0x2c2007){_0x2c2007=_0x2c2007||0x1f4;return function(_0x3381ef){logger[_0x264d('0x31')](_0x3381ef[_0x264d('0x32')]);if(_0x3381ef[_0x264d('0x33')]){delete _0x3381ef[_0x264d('0x33')];}_0x2b616b[_0x264d('0x22')](_0x2c2007)[_0x264d('0x34')](_0x3381ef);};}exports[_0x264d('0x35')]=function(_0x5dca96,_0x51cb44){var _0x49bb3d={},_0xf36707={},_0x63ccb5={'count':0x0,'rows':[]};var _0x5c88ea=_[_0x264d('0x36')](db['CmList'][_0x264d('0x37')],function(_0xdde289){return{'name':_0xdde289[_0x264d('0x38')],'type':_0xdde289[_0x264d('0x39')]['key']};});_0xf36707[_0x264d('0x3a')]=_[_0x264d('0x36')](_0x5c88ea,_0x264d('0x33'));_0xf36707[_0x264d('0x3b')]=_[_0x264d('0x3c')](_0x5dca96[_0x264d('0x3b')]);_0xf36707[_0x264d('0x3d')]=_[_0x264d('0x3e')](_0xf36707[_0x264d('0x3a')],_0xf36707[_0x264d('0x3b')]);_0x49bb3d[_0x264d('0x3f')]=_['intersection'](_0xf36707[_0x264d('0x3a')],qs[_0x264d('0x40')](_0x5dca96[_0x264d('0x3b')][_0x264d('0x40')]));_0x49bb3d[_0x264d('0x3f')]=_0x49bb3d['attributes']['length']?_0x49bb3d[_0x264d('0x3f')]:_0xf36707[_0x264d('0x3a')];if(!_0x5dca96['query'][_0x264d('0x41')](_0x264d('0x42'))){_0x49bb3d[_0x264d('0x27')]=qs[_0x264d('0x27')](_0x5dca96[_0x264d('0x3b')]['limit']);_0x49bb3d['offset']=qs['offset'](_0x5dca96[_0x264d('0x3b')][_0x264d('0x25')]);}_0x49bb3d[_0x264d('0x43')]=qs[_0x264d('0x44')](_0x5dca96[_0x264d('0x3b')][_0x264d('0x44')]);_0x49bb3d[_0x264d('0x45')]=qs[_0x264d('0x3d')](_[_0x264d('0x46')](_0x5dca96[_0x264d('0x3b')],_0xf36707['filters']),_0x5c88ea);if(_0x5dca96[_0x264d('0x3b')][_0x264d('0x47')]){_0x49bb3d[_0x264d('0x45')]=_['merge'](_0x49bb3d[_0x264d('0x45')],{'$or':_[_0x264d('0x36')](_0x5c88ea,function(_0x5bf959){if(_0x5bf959[_0x264d('0x39')]!==_0x264d('0x48')){var _0x53bed2={};_0x53bed2[_0x5bf959[_0x264d('0x33')]]={'$like':'%'+_0x5dca96['query'][_0x264d('0x47')]+'%'};return _0x53bed2;}})});}_0x49bb3d=_[_0x264d('0x49')]({},_0x49bb3d,_0x5dca96[_0x264d('0x4a')]);var _0x27ad17={'where':_0x49bb3d[_0x264d('0x45')]};return db['CmList'][_0x264d('0x28')](_0x27ad17)['then'](function(_0x565ff4){_0x63ccb5[_0x264d('0x28')]=_0x565ff4;if(_0x5dca96[_0x264d('0x3b')][_0x264d('0x4b')]){_0x49bb3d[_0x264d('0x4c')]=[{'all':!![]}];}return db['CmList'][_0x264d('0x4d')](_0x49bb3d);})[_0x264d('0x2e')](function(_0x13a449){_0x63ccb5[_0x264d('0x4e')]=_0x13a449;return _0x63ccb5;})[_0x264d('0x2e')](respondWithFilteredResult(_0x51cb44,_0x49bb3d))[_0x264d('0x4f')](handleError(_0x51cb44,null));};exports[_0x264d('0x50')]=function(_0x29739e,_0x2d78e8){var _0xfc6142={'raw':![],'where':{'id':_0x29739e[_0x264d('0x51')]['id']}},_0x9ebd0c={};_0x9ebd0c[_0x264d('0x3a')]=_[_0x264d('0x3c')](db[_0x264d('0x52')][_0x264d('0x37')]);_0x9ebd0c[_0x264d('0x3b')]=_[_0x264d('0x3c')](_0x29739e[_0x264d('0x3b')]);_0x9ebd0c[_0x264d('0x3d')]=_[_0x264d('0x3e')](_0x9ebd0c[_0x264d('0x3a')],_0x9ebd0c[_0x264d('0x3b')]);_0xfc6142[_0x264d('0x3f')]=_[_0x264d('0x3e')](_0x9ebd0c[_0x264d('0x3a')],qs[_0x264d('0x40')](_0x29739e[_0x264d('0x3b')][_0x264d('0x40')]));_0xfc6142[_0x264d('0x3f')]=_0xfc6142[_0x264d('0x3f')]['length']?_0xfc6142[_0x264d('0x3f')]:_0x9ebd0c[_0x264d('0x3a')];if(_0x29739e[_0x264d('0x3b')][_0x264d('0x4b')]){_0xfc6142[_0x264d('0x4c')]=[{'all':!![]}];}_0xfc6142=_[_0x264d('0x49')]({},_0xfc6142,_0x29739e[_0x264d('0x4a')]);return db[_0x264d('0x52')][_0x264d('0x53')](_0xfc6142)[_0x264d('0x2e')](handleEntityNotFound(_0x2d78e8,null))[_0x264d('0x2e')](respondWithResult(_0x2d78e8,null))[_0x264d('0x4f')](handleError(_0x2d78e8,null));};exports[_0x264d('0x54')]=function(_0x1c9c95,_0x5bad68){return db[_0x264d('0x52')]['create'](_0x1c9c95[_0x264d('0x55')],{})[_0x264d('0x2e')](function(_0x2a0e88){var _0x14a0df=_0x1c9c95[_0x264d('0x56')][_0x264d('0x57')]({'plain':!![]});if(!_0x14a0df)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x14a0df['role']===_0x264d('0x56')){var _0x31b616=_0x2a0e88[_0x264d('0x57')]({'plain':!![]});var _0x39e7a1=_0x264d('0x2f');return db[_0x264d('0x58')][_0x264d('0x53')]({'where':{'name':_0x39e7a1,'userProfileId':_0x14a0df[_0x264d('0x59')]},'raw':!![]})[_0x264d('0x2e')](function(_0x40e0cb){if(_0x40e0cb&&_0x40e0cb[_0x264d('0x5a')]===0x0){return db['UserProfileResource'][_0x264d('0x54')]({'name':_0x31b616[_0x264d('0x33')],'resourceId':_0x31b616['id'],'type':_0x40e0cb[_0x264d('0x33')],'sectionId':_0x40e0cb['id']},{})[_0x264d('0x2e')](function(){return _0x2a0e88;});}else{return _0x2a0e88;}})[_0x264d('0x4f')](function(_0x5aa66a){logger[_0x264d('0x31')](_0x264d('0x5b'),_0x5aa66a);throw _0x5aa66a;});}return _0x2a0e88;})[_0x264d('0x2e')](respondWithResult(_0x5bad68,0xc9))[_0x264d('0x4f')](handleError(_0x5bad68,null));};exports[_0x264d('0x2d')]=function(_0x52fd52,_0x136833){if(_0x52fd52[_0x264d('0x55')]['id']){delete _0x52fd52[_0x264d('0x55')]['id'];}return db[_0x264d('0x52')][_0x264d('0x53')]({'where':{'id':_0x52fd52[_0x264d('0x51')]['id']}})[_0x264d('0x2e')](handleEntityNotFound(_0x136833,null))[_0x264d('0x2e')](saveUpdates(_0x52fd52['body'],null))[_0x264d('0x2e')](respondWithResult(_0x136833,null))[_0x264d('0x4f')](handleError(_0x136833,null));};exports[_0x264d('0x5c')]=function(_0x543ffe,_0x27de38){return db[_0x264d('0x52')]['find']({'where':{'id':_0x543ffe[_0x264d('0x51')]['id']}})[_0x264d('0x2e')](handleEntityNotFound(_0x27de38,null))[_0x264d('0x2e')](removeEntity(_0x27de38,null))[_0x264d('0x4f')](handleError(_0x27de38,null));};exports['describe']=function(_0x2a6f41,_0x5b7a37){return db[_0x264d('0x52')]['describe']()[_0x264d('0x2e')](respondWithResult(_0x5b7a37,null))[_0x264d('0x4f')](handleError(_0x5b7a37,null));};exports['addDisposition']=function(_0x324e16,_0x42261f,_0x3205b5){if(_0x324e16[_0x264d('0x55')]['id']){delete _0x324e16[_0x264d('0x55')]['id'];}return db['CmList'][_0x264d('0x53')]({'where':{'id':_0x324e16[_0x264d('0x51')]['id']}})[_0x264d('0x2e')](handleEntityNotFound(_0x42261f,null))['then'](function(_0x271c78){if(_0x271c78){_0x324e16['body'][_0x264d('0x5d')]=_0x271c78['id'];return db[_0x264d('0x5e')][_0x264d('0x54')](_0x324e16['body']);}})[_0x264d('0x2e')](respondWithResult(_0x42261f,null))[_0x264d('0x4f')](handleError(_0x42261f,null));};exports[_0x264d('0x5f')]=function(_0x164892,_0x2b347f,_0x3d8a62){var _0x49aa52={'raw':![],'where':{}};var _0x17887f={};var _0x3dad6e={'count':0x0,'rows':[]};return db[_0x264d('0x52')]['findOne']({'where':{'id':_0x164892[_0x264d('0x51')]['id']}})[_0x264d('0x2e')](handleEntityNotFound(_0x2b347f,null))[_0x264d('0x2e')](function(_0x125d7e){if(_0x125d7e){_0x17887f[_0x264d('0x3a')]=_[_0x264d('0x3c')](db['Disposition'][_0x264d('0x37')]);_0x17887f[_0x264d('0x3b')]=_[_0x264d('0x3c')](_0x164892[_0x264d('0x3b')]);_0x17887f[_0x264d('0x3d')]=_[_0x264d('0x3e')](_0x17887f[_0x264d('0x3a')],_0x17887f[_0x264d('0x3b')]);_0x49aa52['attributes']=_[_0x264d('0x3e')](_0x17887f['model'],qs['fields'](_0x164892[_0x264d('0x3b')][_0x264d('0x40')]));_0x49aa52[_0x264d('0x3f')]=_0x49aa52[_0x264d('0x3f')]['length']?_0x49aa52[_0x264d('0x3f')]:_0x17887f[_0x264d('0x3a')];if(!_0x164892[_0x264d('0x3b')][_0x264d('0x41')](_0x264d('0x42'))){_0x49aa52[_0x264d('0x27')]=qs['limit'](_0x164892['query'][_0x264d('0x27')]);_0x49aa52[_0x264d('0x25')]=qs[_0x264d('0x25')](_0x164892[_0x264d('0x3b')][_0x264d('0x25')]);}_0x49aa52['order']=qs['sort'](_0x164892[_0x264d('0x3b')][_0x264d('0x44')]);_0x49aa52[_0x264d('0x45')]=qs[_0x264d('0x3d')](_[_0x264d('0x46')](_0x164892[_0x264d('0x3b')],_0x17887f['filters']));_0x49aa52[_0x264d('0x45')][_0x264d('0x5d')]=_0x125d7e['id'];if(_0x164892[_0x264d('0x3b')]['filter']){_0x49aa52[_0x264d('0x45')]=_['merge'](_0x49aa52['where'],{'$or':_['map'](_0x49aa52[_0x264d('0x3f')],function(_0x37e6f9){var _0x2db953={};_0x2db953[_0x37e6f9]={'$like':'%'+_0x164892[_0x264d('0x3b')][_0x264d('0x47')]+'%'};return _0x2db953;})});}_0x49aa52=_[_0x264d('0x49')]({},_0x49aa52,_0x164892[_0x264d('0x4a')]);return db[_0x264d('0x5e')]['count']({'where':_0x49aa52[_0x264d('0x45')]})[_0x264d('0x2e')](function(_0x4991a2){_0x3dad6e['count']=_0x4991a2;if(_0x164892[_0x264d('0x3b')][_0x264d('0x4b')]){_0x49aa52[_0x264d('0x4c')]=[{'all':!![]}];}return db[_0x264d('0x5e')][_0x264d('0x4d')](_0x49aa52);})[_0x264d('0x2e')](function(_0xb247dc){_0x3dad6e[_0x264d('0x4e')]=_0xb247dc;return _0x3dad6e;});}})['then'](respondWithFilteredResult(_0x2b347f,_0x49aa52))['catch'](handleError(_0x2b347f,null));};exports['removeDispositions']=function(_0x5e230e,_0x158539,_0x4597ab){return db['CmList']['find']({'where':{'id':_0x5e230e[_0x264d('0x51')]['id']}})[_0x264d('0x2e')](handleEntityNotFound(_0x158539,null))[_0x264d('0x2e')](function(_0x11804b){if(_0x11804b){return _0x11804b['removeDispositions'](_0x5e230e[_0x264d('0x3b')][_0x264d('0x60')]);}})[_0x264d('0x2e')](respondWithStatusCode(_0x158539,null))[_0x264d('0x4f')](handleError(_0x158539,null));};exports[_0x264d('0x61')]=function(_0x55be9a,_0x4e5440,_0x52735f){return db[_0x264d('0x52')][_0x264d('0x53')]({'where':{'id':_0x55be9a[_0x264d('0x51')]['id']}})[_0x264d('0x2e')](handleEntityNotFound(_0x4e5440,null))[_0x264d('0x2e')](function(_0x455da2){if(_0x455da2){var _0x583ef9=[];var _0x57e72c={'success':[],'errors':[]};return db[_0x264d('0x62')][_0x264d('0x63')]()[_0x264d('0x2e')](function(_0x42a9d4){if(_0x55be9a[_0x264d('0x55')]['tags']&&_[_0x264d('0x64')](_0x55be9a[_0x264d('0x55')]['tags'])){if(_0x55be9a['body'][_0x264d('0x65')]['length']){_0x55be9a[_0x264d('0x55')][_0x264d('0x65')]=_0x55be9a[_0x264d('0x55')][_0x264d('0x65')][_0x264d('0x66')](';')+';';}else{_0x55be9a['body'][_0x264d('0x65')]=null;}}else{_0x55be9a['body'][_0x264d('0x65')]=null;}if(_0x55be9a[_0x264d('0x55')]&&_['isArray'](_0x55be9a[_0x264d('0x55')])){for(var _0x59c51e=0x0;_0x59c51e<_0x55be9a[_0x264d('0x55')]['length'];_0x59c51e+=0x1){_0x55be9a[_0x264d('0x55')][_0x59c51e]['ListId']=_0x55be9a['params']['id'];_0x583ef9[_0x264d('0x67')](_0x55be9a[_0x264d('0x55')][_0x59c51e]);}return BPromise[_0x264d('0x68')](_0x583ef9,function(_0x24f25c){return db[_0x264d('0x62')][_0x264d('0x54')](_['omit'](_0x24f25c,['ids','id'])||{},{'fields':_[_0x264d('0x3c')](_0x42a9d4),'raw':!![]})['then'](function(_0x3e74f6){_0x57e72c[_0x264d('0x69')]['push'](_0x3e74f6['dataValues']);})[_0x264d('0x4f')](function(_0x649b7d){_0x57e72c[_0x264d('0x6a')][_0x264d('0x67')]({'data':_0x24f25c,'error':_0x649b7d[_0x264d('0x6b')]});});})[_0x264d('0x2e')](function(_0x2e2e47){return _0x57e72c;})[_0x264d('0x4f')](function(_0x151d98){return _0x151d98;});}else{_0x4e5440[_0x264d('0x22')](0x190)[_0x264d('0x24')]({'message':_0x264d('0x6c')});}});}})[_0x264d('0x2e')](respondWithResult(_0x4e5440,null))[_0x264d('0x4f')](handleError(_0x4e5440,null));};exports[_0x264d('0x6d')]=function(_0xef2b79,_0x45d32b,_0x528e7d){var _0x157070;return db[_0x264d('0x52')][_0x264d('0x53')]({'where':{'id':_0xef2b79[_0x264d('0x51')]['id']},'include':[{'model':db[_0x264d('0x6e')],'as':_0x264d('0x6f')}]})[_0x264d('0x2e')](handleEntityNotFound(_0x45d32b,null))['then'](function(_0x406b6a){if(_0x406b6a){_0x157070=_0x406b6a;return db['CmContact'][_0x264d('0x37')];}})[_0x264d('0x2e')](function(_0x4bc694){if(_0x4bc694){var _0x1be934={};var _0xda0f93={};_0xda0f93[_0x264d('0x3a')]=_[_0x264d('0x70')](_['keys'](_0x4bc694),_['map'](_0x157070[_0x264d('0x6f')],function(_0xa68056){return util['format'](_0x264d('0x71'),_0xa68056['id']);}));_0xda0f93['query']=_[_0x264d('0x3c')](_0xef2b79[_0x264d('0x3b')]);_0xda0f93[_0x264d('0x3d')]=_[_0x264d('0x3e')](_0xda0f93[_0x264d('0x3a')],_0xda0f93[_0x264d('0x3b')]);_0x1be934['attributes']=_[_0x264d('0x3e')](_0xda0f93[_0x264d('0x3a')],qs['fields'](_0xef2b79[_0x264d('0x3b')]['fields']));_0x1be934[_0x264d('0x3f')]=_0x1be934[_0x264d('0x3f')]['length']?_0x1be934[_0x264d('0x3f')]:_0xda0f93[_0x264d('0x3a')];if(!_0xef2b79[_0x264d('0x3b')][_0x264d('0x41')](_0x264d('0x42'))){_0x1be934['limit']=qs[_0x264d('0x27')](_0xef2b79[_0x264d('0x3b')]['limit']);_0x1be934['offset']=qs[_0x264d('0x25')](_0xef2b79[_0x264d('0x3b')]['offset']);}_0x1be934[_0x264d('0x43')]=qs[_0x264d('0x44')](_0xef2b79['query'][_0x264d('0x44')]);_0x1be934[_0x264d('0x45')]=qs[_0x264d('0x3d')](_[_0x264d('0x46')](_0xef2b79['query'],_0xda0f93[_0x264d('0x3d')]));_0x1be934['raw']=!![];if(_0xef2b79[_0x264d('0x3b')]['filter']){_0x1be934[_0x264d('0x45')]=_[_0x264d('0x49')](_0x1be934[_0x264d('0x45')],{'$or':_[_0x264d('0x36')](_0x1be934['attributes'],function(_0x57b205){var _0x273f57={};_0x273f57[_0x57b205]={'$like':'%'+_0xef2b79[_0x264d('0x3b')]['filter']+'%'};return _0x273f57;})});}_0x1be934=_[_0x264d('0x49')]({},_0x1be934,_0xef2b79[_0x264d('0x4a')]);return _0x157070[_0x264d('0x6d')](_0x1be934);}})['then'](respondWithResult(_0x45d32b,null))[_0x264d('0x4f')](handleError(_0x45d32b,null));};exports['getContactsCsv']=function(_0xd8568a,_0x4cccbe,_0x3e133a){var _0x580230;return db[_0x264d('0x52')][_0x264d('0x53')]({'where':{'id':_0xd8568a['params']['id']},'include':[{'model':db['CmCustomField'],'as':'CustomFields'}]})[_0x264d('0x2e')](handleEntityNotFound(_0x4cccbe,null))['then'](function(_0x110ab6){if(_0x110ab6){_0x580230=_0x110ab6;return db['CmContact'][_0x264d('0x37')];}})[_0x264d('0x2e')](function(_0x232078){if(_0x232078){var _0x3ecce2={};var _0x3bef94={};_0x3bef94[_0x264d('0x3a')]=_[_0x264d('0x70')](_[_0x264d('0x3c')](_0x232078),_['map'](_0x580230[_0x264d('0x6f')],function(_0x447410){return util[_0x264d('0x72')](_0x264d('0x71'),_0x447410['id']);}));_0x3bef94[_0x264d('0x3b')]=_[_0x264d('0x3c')](_0xd8568a['query']);_0x3bef94[_0x264d('0x3d')]=_[_0x264d('0x3e')](_0x3bef94['model'],_0x3bef94[_0x264d('0x3b')]);_0x3ecce2[_0x264d('0x3f')]=_[_0x264d('0x3e')](_0x3bef94['model'],qs[_0x264d('0x40')](_0xd8568a[_0x264d('0x3b')][_0x264d('0x40')]));_0x3ecce2[_0x264d('0x3f')]=_0x3ecce2[_0x264d('0x3f')][_0x264d('0x73')]?_0x3ecce2[_0x264d('0x3f')]:_0x3bef94[_0x264d('0x3a')];if(!_0xd8568a[_0x264d('0x3b')][_0x264d('0x41')](_0x264d('0x42'))){_0x3ecce2[_0x264d('0x27')]=qs[_0x264d('0x27')](_0xd8568a[_0x264d('0x3b')][_0x264d('0x27')]);_0x3ecce2['offset']=qs[_0x264d('0x25')](_0xd8568a[_0x264d('0x3b')][_0x264d('0x25')]);}_0x3ecce2[_0x264d('0x43')]=qs['sort'](_0xd8568a[_0x264d('0x3b')][_0x264d('0x44')]);_0x3ecce2[_0x264d('0x45')]=qs[_0x264d('0x3d')](_[_0x264d('0x46')](_0xd8568a[_0x264d('0x3b')],_0x3bef94['filters']));_0x3ecce2['raw']=!![];if(_0xd8568a[_0x264d('0x3b')][_0x264d('0x47')]){_0x3ecce2[_0x264d('0x45')]=_[_0x264d('0x49')](_0x3ecce2[_0x264d('0x45')],{'$or':_[_0x264d('0x36')](_0x3ecce2['attributes'],function(_0x1e9d33){var _0x11973d={};_0x11973d[_0x1e9d33]={'$like':'%'+_0xd8568a['query'][_0x264d('0x47')]+'%'};return _0x11973d;})});}_0x3ecce2=_['merge']({},_0x3ecce2,_0xd8568a['options']);return _0x580230[_0x264d('0x6d')](_0x3ecce2);}})[_0x264d('0x2e')](function(_0x5bfa10){if(!_['isEmpty'](_0x5bfa10)){var _0x2b174b=toCsv(_0x5bfa10);var _0x5c15d5=Date[_0x264d('0x74')]();fs[_0x264d('0x75')](util[_0x264d('0x72')](_0x264d('0x76'),_0x580230['id'],_0x5c15d5),_0x2b174b);_0x4cccbe[_0x264d('0x77')]('Content-disposition',_0x264d('0x78')+util[_0x264d('0x72')]('list_%d_%s.csv',_0x580230['id'],_0x5c15d5));_0x4cccbe[_0x264d('0x77')](_0x264d('0x79'),_0x264d('0x7a'));return _0x4cccbe[_0x264d('0x7b')](util['format']('/tmp/list_%d_%s.csv',_0x580230['id'],_0x5c15d5));}else{return _0x4cccbe['sendStatus'](0xcc);}})[_0x264d('0x4f')](handleError(_0x4cccbe,null));};exports[_0x264d('0x7c')]=function(_0x4d2fc6,_0x22b61f,_0x569bde){var _0x14cfc5;delete _0x4d2fc6[_0x264d('0x55')]['id'];return db[_0x264d('0x52')][_0x264d('0x7d')]({'where':{'id':_0x4d2fc6['params']['id']}})[_0x264d('0x2e')](handleEntityNotFound(_0x22b61f,null))['then'](function(_0x1600ce){if(_0x1600ce){return db[_0x264d('0x7e')][_0x264d('0x7f')](function(_0x5c0736){return db[_0x264d('0x6e')][_0x264d('0x54')](_0x4d2fc6[_0x264d('0x55')],{'transaction':_0x5c0736})['then'](function(_0x80b290){_0x14cfc5=_0x80b290;return _0x1600ce['addCustomFields'](_0x80b290,{'transaction':_0x5c0736});})['then'](function(){var _0x1cb862={'type':db[_0x264d('0x80')]['TEXT'],'transaction':_0x5c0736};switch(_0x4d2fc6['body'][_0x264d('0x39')]){case _0x264d('0x81'):_0x1cb862['type']=db['Sequelize']['TEXT'];break;case'number':_0x1cb862[_0x264d('0x39')]=db['Sequelize']['INTEGER'];break;case'switch':_0x1cb862[_0x264d('0x39')]=db[_0x264d('0x80')][_0x264d('0x82')];_0x1cb862['defaultValue']=![];break;default:}return db[_0x264d('0x7e')][_0x264d('0x83')]['addColumn'](_0x264d('0x84'),util[_0x264d('0x72')](_0x264d('0x85'),_0x14cfc5['id']),_0x1cb862);})[_0x264d('0x2e')](function(){return _0x14cfc5;});});}})[_0x264d('0x2e')](respondWithResult(_0x22b61f,null))[_0x264d('0x4f')](handleError(_0x22b61f,null));};exports[_0x264d('0x86')]=function(_0x5a8f46,_0x4b7e8e,_0x2d3743){var _0x3f0dfb={};var _0x3c3b34={};var _0x34281a;var _0x1924bd;return db[_0x264d('0x52')]['findOne']({'where':{'id':_0x5a8f46[_0x264d('0x51')]['id']}})[_0x264d('0x2e')](handleEntityNotFound(_0x4b7e8e,null))[_0x264d('0x2e')](function(_0x213d38){if(_0x213d38){_0x34281a=_0x213d38;_0x3c3b34[_0x264d('0x3a')]=_['keys'](db[_0x264d('0x6e')][_0x264d('0x37')]);_0x3c3b34['query']=_[_0x264d('0x3c')](_0x5a8f46[_0x264d('0x3b')]);_0x3c3b34['filters']=_[_0x264d('0x3e')](_0x3c3b34['model'],_0x3c3b34[_0x264d('0x3b')]);_0x3f0dfb[_0x264d('0x3f')]=_[_0x264d('0x3e')](_0x3c3b34[_0x264d('0x3a')],qs[_0x264d('0x40')](_0x5a8f46['query']['fields']));_0x3f0dfb[_0x264d('0x3f')]=_0x3f0dfb[_0x264d('0x3f')]['length']?_0x3f0dfb[_0x264d('0x3f')]:_0x3c3b34['model'];_0x3f0dfb[_0x264d('0x43')]=qs[_0x264d('0x44')](_0x5a8f46['query']['sort']);_0x3f0dfb[_0x264d('0x45')]=qs['filters'](_['pick'](_0x5a8f46['query'],_0x3c3b34[_0x264d('0x3d')]));_0x3f0dfb[_0x264d('0x45')]=_[_0x264d('0x49')](_0x3f0dfb[_0x264d('0x45')],{'$or':[{'ListId':_0x213d38['id']},{'ListId':null}]});if(_0x5a8f46[_0x264d('0x3b')]['filter']){_0x3f0dfb[_0x264d('0x45')]=_[_0x264d('0x49')](_0x3f0dfb[_0x264d('0x45')],{'$or':_[_0x264d('0x36')](_0x3f0dfb[_0x264d('0x3f')],function(_0x2a38fe){var _0x567d39={};_0x567d39[_0x2a38fe]={'$like':'%'+_0x5a8f46[_0x264d('0x3b')][_0x264d('0x47')]+'%'};return _0x567d39;})});}_0x3f0dfb=_[_0x264d('0x49')]({},_0x3f0dfb,_0x5a8f46['options']);return db[_0x264d('0x6e')]['findAndCountAll'](_0x3f0dfb);}})['then'](respondWithResult(_0x4b7e8e,null))['catch'](handleError(_0x4b7e8e,null));};exports[_0x264d('0x87')]=function(_0x4027c4,_0x3da7a2,_0x4c4002){return db[_0x264d('0x52')]['find']({'where':{'id':_0x4027c4[_0x264d('0x51')]['id']}})[_0x264d('0x2e')](handleEntityNotFound(_0x3da7a2,null))['then'](function(_0xd4f72d){if(_0xd4f72d){return _0xd4f72d['addAgents'](_0x4027c4[_0x264d('0x55')]['ids'],_['omit'](_0x4027c4['body'],[_0x264d('0x60'),'id'])||{})[_0x264d('0x88')](function(_0x44ba2e){for(var _0x38f63a=0x0;_0x38f63a<_0x4027c4[_0x264d('0x55')][_0x264d('0x60')]['length'];_0x38f63a+=0x1){socket[_0x264d('0x89')](_0x264d('0x8a'),{'UserId':Number(_0x4027c4[_0x264d('0x55')][_0x264d('0x60')][_0x38f63a]),'CmListId':Number(_0x4027c4['params']['id'])});}return _0x44ba2e;});}})[_0x264d('0x2e')](respondWithResult(_0x3da7a2,null))['catch'](handleError(_0x3da7a2,null));};exports[_0x264d('0x8b')]=function(_0x549739,_0x33e4c4,_0x4ff764){return db['CmList'][_0x264d('0x53')]({'where':{'id':_0x549739[_0x264d('0x51')]['id']}})[_0x264d('0x2e')](handleEntityNotFound(_0x33e4c4,null))[_0x264d('0x2e')](function(_0x296750){if(_0x296750){return _0x296750[_0x264d('0x8b')](_0x549739[_0x264d('0x3b')][_0x264d('0x60')])[_0x264d('0x2e')](function(){if(_[_0x264d('0x64')](_0x549739[_0x264d('0x3b')][_0x264d('0x60')])){for(var _0x474ecc=0x0;_0x474ecc<_0x549739[_0x264d('0x3b')]['ids'][_0x264d('0x73')];_0x474ecc+=0x1){socket[_0x264d('0x89')]('userCmList:remove',{'UserId':Number(_0x549739['query'][_0x264d('0x60')][_0x474ecc]),'CmListId':Number(_0x549739[_0x264d('0x51')]['id'])});}}else{socket[_0x264d('0x89')](_0x264d('0x8c'),{'UserId':Number(_0x549739[_0x264d('0x3b')]['ids']),'CmListId':Number(_0x549739[_0x264d('0x51')]['id'])});}});}})[_0x264d('0x2e')](respondWithStatusCode(_0x33e4c4,null))['catch'](handleError(_0x33e4c4,null));};exports[_0x264d('0x8d')]=function(_0x335ce8,_0x4c9e0b,_0x2c104f){var _0xa41183={};var _0x1609be={};var _0x745587;var _0x2dc8fe;return db[_0x264d('0x52')]['findOne']({'where':{'id':_0x335ce8['params']['id']}})[_0x264d('0x2e')](handleEntityNotFound(_0x4c9e0b,null))['then'](function(_0x426331){if(_0x426331){_0x745587=_0x426331;_0x1609be[_0x264d('0x3a')]=_[_0x264d('0x3c')](db[_0x264d('0x8e')][_0x264d('0x37')]);_0x1609be['query']=_[_0x264d('0x3c')](_0x335ce8[_0x264d('0x3b')]);_0x1609be[_0x264d('0x3d')]=_[_0x264d('0x3e')](_0x1609be[_0x264d('0x3a')],_0x1609be[_0x264d('0x3b')]);_0xa41183[_0x264d('0x3f')]=_[_0x264d('0x3e')](_0x1609be[_0x264d('0x3a')],qs['fields'](_0x335ce8[_0x264d('0x3b')]['fields']));_0xa41183[_0x264d('0x3f')]=_0xa41183[_0x264d('0x3f')][_0x264d('0x73')]?_0xa41183[_0x264d('0x3f')]:_0x1609be[_0x264d('0x3a')];_0xa41183[_0x264d('0x43')]=qs[_0x264d('0x44')](_0x335ce8['query']['sort']);_0xa41183[_0x264d('0x45')]=qs[_0x264d('0x3d')](_['pick'](_0x335ce8[_0x264d('0x3b')],_0x1609be[_0x264d('0x3d')]));if(_0x335ce8['query'][_0x264d('0x47')]){_0xa41183[_0x264d('0x45')]=_[_0x264d('0x49')](_0xa41183['where'],{'$or':_[_0x264d('0x36')](_0xa41183[_0x264d('0x3f')],function(_0x22b461){var _0x4e898a={};_0x4e898a[_0x22b461]={'$like':'%'+_0x335ce8[_0x264d('0x3b')][_0x264d('0x47')]+'%'};return _0x4e898a;})});}_0xa41183=_[_0x264d('0x49')]({},_0xa41183,_0x335ce8[_0x264d('0x4a')]);return _0x745587[_0x264d('0x8d')](_0xa41183);}})[_0x264d('0x2e')](function(_0x54f92d){if(_0x54f92d){_0x2dc8fe=_0x54f92d[_0x264d('0x73')];if(!_0x335ce8[_0x264d('0x3b')][_0x264d('0x41')](_0x264d('0x42'))){_0xa41183[_0x264d('0x27')]=qs[_0x264d('0x27')](_0x335ce8[_0x264d('0x3b')][_0x264d('0x27')]);_0xa41183[_0x264d('0x25')]=qs['offset'](_0x335ce8[_0x264d('0x3b')][_0x264d('0x25')]);}return _0x745587[_0x264d('0x8d')](_0xa41183);}})[_0x264d('0x2e')](function(_0x51afb3){if(_0x51afb3){return _0x51afb3?{'count':_0x2dc8fe,'rows':_0x51afb3}:null;}})['then'](respondWithResult(_0x4c9e0b,null))['catch'](handleError(_0x4c9e0b,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 27f3244..1f54e85 100644 --- a/server/api/cmList/cmList.events.js +++ b/server/api/cmList/cmList.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e74=['hasOwnProperty','exports','events','CmList','setMaxListeners','save','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3e74,0x175));var _0x43e7=function(_0x261edf,_0x19c783){_0x261edf=_0x261edf-0x0;var _0x2f25a2=_0x3e74[_0x261edf];return _0x2f25a2;};'use strict';var EventEmitter=require(_0x43e7('0x0'));var CmList=require('../../mysqldb')['db'][_0x43e7('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x43e7('0x2')](0x0);var events={'afterCreate':_0x43e7('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xc58479){return function(_0x4f9bbe,_0x128b0f,_0xe838b4){CmListEvents[_0x43e7('0x4')](_0xc58479+':'+_0x4f9bbe['id'],_0x4f9bbe);CmListEvents[_0x43e7('0x4')](_0xc58479,_0x4f9bbe);_0xe838b4(null);};}for(var e in events){if(events[_0x43e7('0x5')](e)){var event=events[e];CmList['hook'](e,emitEvent(event));}}module[_0x43e7('0x6')]=CmListEvents; \ No newline at end of file +var _0x55ca=['events','../../mysqldb','update','remove','emit','hasOwnProperty','hook'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x55ca,0x126));var _0xa55c=function(_0x371b64,_0x67b4bb){_0x371b64=_0x371b64-0x0;var _0x3cf3b1=_0x55ca[_0x371b64];return _0x3cf3b1;};'use strict';var EventEmitter=require(_0xa55c('0x0'));var CmList=require(_0xa55c('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa55c('0x2'),'afterDestroy':_0xa55c('0x3')};function emitEvent(_0x5dc716){return function(_0x3b478a,_0x2db02a,_0xcb02e3){CmListEvents[_0xa55c('0x4')](_0x5dc716+':'+_0x3b478a['id'],_0x3b478a);CmListEvents[_0xa55c('0x4')](_0x5dc716,_0x3b478a);_0xcb02e3(null);};}for(var e in events){if(events[_0xa55c('0x5')](e)){var event=events[e];CmList[_0xa55c('0x6')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index fad114c..94eb6cd 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 _0xd64b=['define','CmList','cm_lists','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x328b9b,_0x13082a){var _0x3a2d51=function(_0x63002b){while(--_0x63002b){_0x328b9b['push'](_0x328b9b['shift']());}};_0x3a2d51(++_0x13082a);}(_0xd64b,0xc1));var _0xbd64=function(_0x33dea9,_0x1ff0fd){_0x33dea9=_0x33dea9-0x0;var _0x531efa=_0xd64b[_0x33dea9];return _0x531efa;};'use strict';var _=require(_0xbd64('0x0'));var util=require('util');var logger=require(_0xbd64('0x1'))('api');var moment=require(_0xbd64('0x2'));var BPromise=require(_0xbd64('0x3'));var rp=require(_0xbd64('0x4'));var fs=require('fs');var path=require(_0xbd64('0x5'));var rimraf=require(_0xbd64('0x6'));var config=require('../../config/environment');var attributes=require('./cmList.attributes');module['exports']=function(_0x51e87d,_0x58e9e7){return _0x51e87d[_0xbd64('0x7')](_0xbd64('0x8'),attributes,{'tableName':_0xbd64('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe5b5=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists','lodash'];(function(_0x49b83c,_0x5d32c6){var _0x160e93=function(_0x3d348c){while(--_0x3d348c){_0x49b83c['push'](_0x49b83c['shift']());}};_0x160e93(++_0x5d32c6);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x4629ed,_0x59ef85){_0x4629ed=_0x4629ed-0x0;var _0x52ca04=_0xe5b5[_0x4629ed];return _0x52ca04;};'use strict';var _=require(_0x5e5b('0x0'));var util=require(_0x5e5b('0x1'));var logger=require(_0x5e5b('0x2'))(_0x5e5b('0x3'));var moment=require(_0x5e5b('0x4'));var BPromise=require(_0x5e5b('0x5'));var rp=require(_0x5e5b('0x6'));var fs=require('fs');var path=require(_0x5e5b('0x7'));var rimraf=require(_0x5e5b('0x8'));var config=require(_0x5e5b('0x9'));var attributes=require(_0x5e5b('0xa'));module[_0x5e5b('0xb')]=function(_0xf1fbe2,_0x11e0e0){return _0xf1fbe2[_0x5e5b('0xc')](_0x5e5b('0xd'),attributes,{'tableName':_0x5e5b('0xe'),'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 c0007a9..ca68612 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 _0xe37b=['../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x35147e,_0x15b598){var _0x243826=function(_0x3687b2){while(--_0x3687b2){_0x35147e['push'](_0x35147e['shift']());}};_0x243826(++_0x15b598);}(_0xe37b,0x1bc));var _0xbe37=function(_0x40168a,_0x37798a){_0x40168a=_0x40168a-0x0;var _0x46a9cc=_0xe37b[_0x40168a];return _0x46a9cc;};'use strict';var _=require(_0xbe37('0x0'));var util=require('util');var moment=require(_0xbe37('0x1'));var BPromise=require(_0xbe37('0x2'));var rs=require(_0xbe37('0x3'));var fs=require('fs');var Redis=require(_0xbe37('0x4'));var db=require(_0xbe37('0x5'))['db'];var utils=require(_0xbe37('0x6'));var logger=require(_0xbe37('0x7'))(_0xbe37('0x8'));var config=require('../../config/environment');var jayson=require(_0xbe37('0x9'));var client=jayson[_0xbe37('0xa')]['http']({'port':0x232a});config[_0xbe37('0xb')]=_[_0xbe37('0xc')](config[_0xbe37('0xb')],{'host':_0xbe37('0xd'),'port':0x18eb});var socket=require(_0xbe37('0xe'))(new Redis(config['redis']));require(_0xbe37('0xf'))[_0xbe37('0x10')](socket);function respondWithRpcPromise(_0x406370,_0x1de5fc,_0x25dd35){return new BPromise(function(_0x2a6af1,_0xa18490){return client[_0xbe37('0x11')](_0x406370,_0x25dd35)[_0xbe37('0x12')](function(_0x4268ef){logger[_0xbe37('0x13')](_0xbe37('0x14'),_0x1de5fc,_0xbe37('0x15'));logger[_0xbe37('0x16')](_0xbe37('0x17'),_0x1de5fc,'request\x20sent',JSON[_0xbe37('0x18')](_0x4268ef));if(_0x4268ef[_0xbe37('0x19')]){if(_0x4268ef['error'][_0xbe37('0x1a')]===0x1f4){logger[_0xbe37('0x19')](_0xbe37('0x14'),_0x1de5fc,_0x4268ef['error'][_0xbe37('0x1b')]);return _0xa18490(_0x4268ef['error'][_0xbe37('0x1b')]);}logger[_0xbe37('0x19')]('CmList,\x20%s,\x20%s',_0x1de5fc,_0x4268ef['error']['message']);return _0x2a6af1(_0x4268ef[_0xbe37('0x19')][_0xbe37('0x1b')]);}else{logger[_0xbe37('0x13')](_0xbe37('0x14'),_0x1de5fc,'request\x20sent');_0x2a6af1(_0x4268ef[_0xbe37('0x1c')]['message']);}})[_0xbe37('0x1d')](function(_0x55f324){logger[_0xbe37('0x19')](_0xbe37('0x14'),_0x1de5fc,_0x55f324);_0xa18490(_0x55f324);});});} \ No newline at end of file +var _0x07d9=['register','request','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./cmList.socket'];(function(_0x2077c2,_0x275ab5){var _0x312f9f=function(_0x331435){while(--_0x331435){_0x2077c2['push'](_0x2077c2['shift']());}};_0x312f9f(++_0x275ab5);}(_0x07d9,0x174));var _0x907d=function(_0x57156d,_0x2f9fed){_0x57156d=_0x57156d-0x0;var _0x2e2bab=_0x07d9[_0x57156d];return _0x2e2bab;};'use strict';var _=require('lodash');var util=require(_0x907d('0x0'));var moment=require(_0x907d('0x1'));var BPromise=require(_0x907d('0x2'));var rs=require(_0x907d('0x3'));var fs=require('fs');var Redis=require(_0x907d('0x4'));var db=require(_0x907d('0x5'))['db'];var utils=require(_0x907d('0x6'));var logger=require(_0x907d('0x7'))(_0x907d('0x8'));var config=require(_0x907d('0x9'));var jayson=require(_0x907d('0xa'));var client=jayson[_0x907d('0xb')][_0x907d('0xc')]({'port':0x232a});config[_0x907d('0xd')]=_[_0x907d('0xe')](config['redis'],{'host':_0x907d('0xf'),'port':0x18eb});var socket=require(_0x907d('0x10'))(new Redis(config[_0x907d('0xd')]));require(_0x907d('0x11'))[_0x907d('0x12')](socket);function respondWithRpcPromise(_0x4fb2c7,_0x1bda3a,_0x385abe){return new BPromise(function(_0x33643a,_0x146935){return client[_0x907d('0x13')](_0x4fb2c7,_0x385abe)['then'](function(_0x3cd13a){logger['info'](_0x907d('0x14'),_0x1bda3a,_0x907d('0x15'));logger[_0x907d('0x16')](_0x907d('0x17'),_0x1bda3a,'request\x20sent',JSON[_0x907d('0x18')](_0x3cd13a));if(_0x3cd13a['error']){if(_0x3cd13a[_0x907d('0x19')][_0x907d('0x1a')]===0x1f4){logger[_0x907d('0x19')]('CmList,\x20%s,\x20%s',_0x1bda3a,_0x3cd13a[_0x907d('0x19')][_0x907d('0x1b')]);return _0x146935(_0x3cd13a[_0x907d('0x19')][_0x907d('0x1b')]);}logger[_0x907d('0x19')](_0x907d('0x14'),_0x1bda3a,_0x3cd13a[_0x907d('0x19')][_0x907d('0x1b')]);return _0x33643a(_0x3cd13a['error'][_0x907d('0x1b')]);}else{logger[_0x907d('0x1c')](_0x907d('0x14'),_0x1bda3a,_0x907d('0x15'));_0x33643a(_0x3cd13a['result'][_0x907d('0x1b')]);}})[_0x907d('0x1d')](function(_0x5c55f9){logger['error'](_0x907d('0x14'),_0x1bda3a,_0x5c55f9);_0x146935(_0x5c55f9);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 1e99b78..1ab0fe2 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 _0x586c=['save','remove','update','emit','length','./cmList.events'];(function(_0x2e6594,_0x5455d3){var _0x22835e=function(_0x28436c){while(--_0x28436c){_0x2e6594['push'](_0x2e6594['shift']());}};_0x22835e(++_0x5455d3);}(_0x586c,0x18b));var _0xc586=function(_0x4314d7,_0x355218){_0x4314d7=_0x4314d7-0x0;var _0x5c599b=_0x586c[_0x4314d7];return _0x5c599b;};'use strict';var CmListEvents=require(_0xc586('0x0'));var events=[_0xc586('0x1'),_0xc586('0x2'),_0xc586('0x3')];function createListener(_0x4e3e34,_0x214d36){return function(_0x303689){_0x214d36[_0xc586('0x4')](_0x4e3e34,_0x303689);};}function removeListener(_0xf33443,_0x1eaf09){return function(){CmListEvents['removeListener'](_0xf33443,_0x1eaf09);};}exports['register']=function(_0x1cffb2){for(var _0x400727=0x0,_0x496f4e=events[_0xc586('0x5')];_0x400727<_0x496f4e;_0x400727++){var _0x156832=events[_0x400727];var _0x37a170=createListener('cmList:'+_0x156832,_0x1cffb2);CmListEvents['on'](_0x156832,_0x37a170);}}; \ No newline at end of file +var _0x8331=['emit','removeListener','register','length','./cmList.events','remove'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x8331,0x196));var _0x1833=function(_0x34df4a,_0x209d10){_0x34df4a=_0x34df4a-0x0;var _0x145c69=_0x8331[_0x34df4a];return _0x145c69;};'use strict';var CmListEvents=require(_0x1833('0x0'));var events=['save',_0x1833('0x1'),'update'];function createListener(_0x5d156a,_0x35c5cd){return function(_0x8c019d){_0x35c5cd[_0x1833('0x2')](_0x5d156a,_0x8c019d);};}function removeListener(_0x225910,_0x579a0d){return function(){CmListEvents[_0x1833('0x3')](_0x225910,_0x579a0d);};}exports[_0x1833('0x4')]=function(_0x3c202c){for(var _0x1796aa=0x0,_0x429e14=events[_0x1833('0x5')];_0x1796aa<_0x429e14;_0x1796aa++){var _0x8c21f7=events[_0x1796aa];var _0x510c8f=createListener('cmList:'+_0x8c21f7,_0x3c202c);CmListEvents['on'](_0x8c21f7,_0x510c8f);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 524f57b..0383197 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 _0x5178=['update','delete','destroy','removeDispositions','removeAgents','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','/:id/fields','getCustomFields','getAgents','post','create','addDisposition','addCustomField','/:id/users','put'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x5178,0x171));var _0x8517=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x5178[_0x3b380d];return _0x54502b;};'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('./cmList.controller');router[_0x8517('0x7')]('/',auth['isAuthenticated'](),controller[_0x8517('0x8')]);router[_0x8517('0x7')](_0x8517('0x9'),auth[_0x8517('0xa')](),controller[_0x8517('0xb')]);router['get'](_0x8517('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x8517('0x7')](_0x8517('0xd'),auth['isAuthenticated'](),controller[_0x8517('0xe')]);router[_0x8517('0x7')](_0x8517('0xf'),auth[_0x8517('0xa')](),controller[_0x8517('0x10')]);router[_0x8517('0x7')](_0x8517('0x11'),auth[_0x8517('0xa')](),controller['getContactsCsv']);router[_0x8517('0x7')](_0x8517('0x12'),auth[_0x8517('0xa')](),controller[_0x8517('0x13')]);router[_0x8517('0x7')]('/:id/users',auth[_0x8517('0xa')](),controller[_0x8517('0x14')]);router[_0x8517('0x15')]('/',auth[_0x8517('0xa')](),controller[_0x8517('0x16')]);router[_0x8517('0x15')](_0x8517('0xd'),auth[_0x8517('0xa')](),controller[_0x8517('0x17')]);router[_0x8517('0x15')](_0x8517('0xf'),auth[_0x8517('0xa')](),controller['addContacts']);router[_0x8517('0x15')](_0x8517('0x12'),auth[_0x8517('0xa')](),controller[_0x8517('0x18')]);router[_0x8517('0x15')](_0x8517('0x19'),auth[_0x8517('0xa')](),controller['addAgents']);router[_0x8517('0x1a')]('/:id',auth['isAuthenticated'](),controller[_0x8517('0x1b')]);router[_0x8517('0x1c')](_0x8517('0xc'),auth[_0x8517('0xa')](),controller[_0x8517('0x1d')]);router[_0x8517('0x1c')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x8517('0x1e')]);router[_0x8517('0x1c')](_0x8517('0x19'),auth[_0x8517('0xa')](),controller[_0x8517('0x1f')]);module[_0x8517('0x20')]=router; \ No newline at end of file +var _0x0bcb=['getContacts','/:id/contacts/csv','/:id/fields','getCustomFields','getAgents','post','addDisposition','/:id/contacts','addContacts','/:id/users','addAgents','put','update','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmList.controller','get','index','describe','/:id','isAuthenticated','show','/:id/dispositions','getDispositions'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0bcb,0x12f));var _0xb0bc=function(_0x21d3ee,_0x56cf09){_0x21d3ee=_0x21d3ee-0x0;var _0x2f1738=_0x0bcb[_0x21d3ee];return _0x2f1738;};'use strict';var multer=require(_0xb0bc('0x0'));var util=require(_0xb0bc('0x1'));var path=require(_0xb0bc('0x2'));var timeout=require(_0xb0bc('0x3'));var express=require('express');var router=express[_0xb0bc('0x4')]();var fs_extra=require(_0xb0bc('0x5'));var auth=require(_0xb0bc('0x6'));var interaction=require(_0xb0bc('0x7'));var config=require('../../config/environment');var controller=require(_0xb0bc('0x8'));router[_0xb0bc('0x9')]('/',auth['isAuthenticated'](),controller[_0xb0bc('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xb0bc('0xb')]);router[_0xb0bc('0x9')](_0xb0bc('0xc'),auth[_0xb0bc('0xd')](),controller[_0xb0bc('0xe')]);router[_0xb0bc('0x9')](_0xb0bc('0xf'),auth[_0xb0bc('0xd')](),controller[_0xb0bc('0x10')]);router[_0xb0bc('0x9')]('/:id/contacts',auth['isAuthenticated'](),controller[_0xb0bc('0x11')]);router[_0xb0bc('0x9')](_0xb0bc('0x12'),auth[_0xb0bc('0xd')](),controller['getContactsCsv']);router[_0xb0bc('0x9')](_0xb0bc('0x13'),auth[_0xb0bc('0xd')](),controller[_0xb0bc('0x14')]);router[_0xb0bc('0x9')]('/:id/users',auth['isAuthenticated'](),controller[_0xb0bc('0x15')]);router['post']('/',auth[_0xb0bc('0xd')](),controller['create']);router[_0xb0bc('0x16')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xb0bc('0x17')]);router['post'](_0xb0bc('0x18'),auth[_0xb0bc('0xd')](),controller[_0xb0bc('0x19')]);router[_0xb0bc('0x16')](_0xb0bc('0x13'),auth['isAuthenticated'](),controller['addCustomField']);router[_0xb0bc('0x16')](_0xb0bc('0x1a'),auth[_0xb0bc('0xd')](),controller[_0xb0bc('0x1b')]);router[_0xb0bc('0x1c')](_0xb0bc('0xc'),auth[_0xb0bc('0xd')](),controller[_0xb0bc('0x1d')]);router['delete'](_0xb0bc('0xc'),auth[_0xb0bc('0xd')](),controller['destroy']);router['delete'](_0xb0bc('0xf'),auth['isAuthenticated'](),controller['removeDispositions']);router['delete'](_0xb0bc('0x1a'),auth[_0xb0bc('0xd')](),controller[_0xb0bc('0x1e')]);module[_0xb0bc('0x1f')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index c2a6f93..41bede7 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 _0x6efa=['field','STRING','exports','VIRTUAL','getDataValue'];(function(_0x580140,_0x21d7f7){var _0x3257bc=function(_0x1d44d5){while(--_0x1d44d5){_0x580140['push'](_0x580140['shift']());}};_0x3257bc(++_0x21d7f7);}(_0x6efa,0x192));var _0xa6ef=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0x6efa[_0x2e4e19];return _0x9ba20b;};'use strict';var Sequelize=require('sequelize');module[_0xa6ef('0x0')]={'name':{'type':Sequelize[_0xa6ef('0x1')],'get':function(_0x1683c1){return this[_0xa6ef('0x2')](_0xa6ef('0x3'));}},'field':{'type':Sequelize[_0xa6ef('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0xa6ef('0x4')],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x277c=['exports','VIRTUAL','getDataValue','STRING','sequelize'];(function(_0x28b26b,_0x5c1e79){var _0x29fb92=function(_0x446a44){while(--_0x446a44){_0x28b26b['push'](_0x28b26b['shift']());}};_0x29fb92(++_0x5c1e79);}(_0x277c,0x17b));var _0xc277=function(_0x3de495,_0x24de5f){_0x3de495=_0x3de495-0x0;var _0x4a0840=_0x277c[_0x3de495];return _0x4a0840;};'use strict';var Sequelize=require(_0xc277('0x0'));module[_0xc277('0x1')]={'name':{'type':Sequelize[_0xc277('0x2')],'get':function(_0x4b3940){return this[_0xc277('0x3')]('field');}},'field':{'type':Sequelize[_0xc277('0x4')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xc277('0x4')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index cd3e803..792e560 100644 --- a/server/api/condition/condition.controller.js +++ b/server/api/condition/condition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x17ccac,_0x1c475c){var _0x5cae93=function(_0x2b13d1){while(--_0x2b13d1){_0x17ccac['push'](_0x17ccac['shift']());}};_0x5cae93(++_0x1c475c);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file +var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x405368,_0x24ba1d){var _0x4c90b9=function(_0x174798){while(--_0x174798){_0x405368['push'](_0x405368['shift']());}};_0x4c90b9(++_0x24ba1d);}(_0x7a54,0x106));var _0x47a5=function(_0x36c665,_0x216f9c){_0x36c665=_0x36c665-0x0;var _0xf80a66=_0x7a54[_0x36c665];return _0xf80a66;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 8e4a89c..709bbad 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 _0x9b87=['define','Condition','tools_conditions','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./condition.attributes'];(function(_0x42b395,_0x31f665){var _0x4b072e=function(_0x274771){while(--_0x274771){_0x42b395['push'](_0x42b395['shift']());}};_0x4b072e(++_0x31f665);}(_0x9b87,0x1c6));var _0x79b8=function(_0x2c279f,_0x43c94c){_0x2c279f=_0x2c279f-0x0;var _0x4532d8=_0x9b87[_0x2c279f];return _0x4532d8;};'use strict';var _=require('lodash');var util=require(_0x79b8('0x0'));var logger=require(_0x79b8('0x1'))('api');var moment=require(_0x79b8('0x2'));var BPromise=require(_0x79b8('0x3'));var rp=require(_0x79b8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x79b8('0x5'));var config=require(_0x79b8('0x6'));var attributes=require(_0x79b8('0x7'));module['exports']=function(_0x5eec9c,_0x2d14e7){return _0x5eec9c[_0x79b8('0x8')](_0x79b8('0x9'),attributes,{'tableName':_0x79b8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1a79=['../../config/logger','api','moment','path','../../config/environment','./condition.attributes','exports','define','Condition','lodash'];(function(_0x1e1fa7,_0x3b2b89){var _0x10b981=function(_0x571c1f){while(--_0x571c1f){_0x1e1fa7['push'](_0x1e1fa7['shift']());}};_0x10b981(++_0x3b2b89);}(_0x1a79,0x6d));var _0x91a7=function(_0x526f9c,_0x165d2a){_0x526f9c=_0x526f9c-0x0;var _0x3441e1=_0x1a79[_0x526f9c];return _0x3441e1;};'use strict';var _=require(_0x91a7('0x0'));var util=require('util');var logger=require(_0x91a7('0x1'))(_0x91a7('0x2'));var moment=require(_0x91a7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x91a7('0x4'));var rimraf=require('rimraf');var config=require(_0x91a7('0x5'));var attributes=require(_0x91a7('0x6'));module[_0x91a7('0x7')]=function(_0x179b6a,_0x2ac244){return _0x179b6a[_0x91a7('0x8')](_0x91a7('0x9'),attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index 9e999c8..83a35eb 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 _0xa1f8=['message','catch','util','moment','randomstring','ioredis','../../config/logger','rpc','client','http','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','error','code'];(function(_0x582f72,_0x886d8){var _0x4cd5fe=function(_0x4ac1c7){while(--_0x4ac1c7){_0x582f72['push'](_0x582f72['shift']());}};_0x4cd5fe(++_0x886d8);}(_0xa1f8,0x110));var _0x8a1f=function(_0x237557,_0x5a14e6){_0x237557=_0x237557-0x0;var _0x5bec0a=_0xa1f8[_0x237557];return _0x5bec0a;};'use strict';var _=require('lodash');var util=require(_0x8a1f('0x0'));var moment=require(_0x8a1f('0x1'));var BPromise=require('bluebird');var rs=require(_0x8a1f('0x2'));var fs=require('fs');var Redis=require(_0x8a1f('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8a1f('0x4'))(_0x8a1f('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8a1f('0x6')][_0x8a1f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x598e91,_0x5f2eb1,_0x3229fb){return new BPromise(function(_0x42e9b2,_0x289557){return client[_0x8a1f('0x8')](_0x598e91,_0x3229fb)[_0x8a1f('0x9')](function(_0x561016){logger[_0x8a1f('0xa')](_0x8a1f('0xb'),_0x5f2eb1,_0x8a1f('0xc'));logger[_0x8a1f('0xd')]('Condition,\x20%s,\x20%s,\x20%s',_0x5f2eb1,_0x8a1f('0xc'),JSON['stringify'](_0x561016));if(_0x561016[_0x8a1f('0xe')]){if(_0x561016[_0x8a1f('0xe')][_0x8a1f('0xf')]===0x1f4){logger[_0x8a1f('0xe')](_0x8a1f('0xb'),_0x5f2eb1,_0x561016[_0x8a1f('0xe')][_0x8a1f('0x10')]);return _0x289557(_0x561016[_0x8a1f('0xe')][_0x8a1f('0x10')]);}logger[_0x8a1f('0xe')](_0x8a1f('0xb'),_0x5f2eb1,_0x561016['error'][_0x8a1f('0x10')]);return _0x42e9b2(_0x561016[_0x8a1f('0xe')][_0x8a1f('0x10')]);}else{logger[_0x8a1f('0xa')](_0x8a1f('0xb'),_0x5f2eb1,_0x8a1f('0xc'));_0x42e9b2(_0x561016['result']['message']);}})[_0x8a1f('0x11')](function(_0xa356e8){logger[_0x8a1f('0xe')]('Condition,\x20%s,\x20%s',_0x5f2eb1,_0xa356e8);_0x289557(_0xa356e8);});});} \ No newline at end of file +var _0x2bf6=['then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request'];(function(_0x539c06,_0x3184f2){var _0x1e0f23=function(_0x57557e){while(--_0x57557e){_0x539c06['push'](_0x539c06['shift']());}};_0x1e0f23(++_0x3184f2);}(_0x2bf6,0x198));var _0x62bf=function(_0x1f7cf0,_0xd3402e){_0x1f7cf0=_0x1f7cf0-0x0;var _0x1ee49e=_0x2bf6[_0x1f7cf0];return _0x1ee49e;};'use strict';var _=require(_0x62bf('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x62bf('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x62bf('0x2'));var db=require(_0x62bf('0x3'))['db'];var utils=require(_0x62bf('0x4'));var logger=require(_0x62bf('0x5'))(_0x62bf('0x6'));var config=require(_0x62bf('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x62bf('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2145c1,_0x3be4e2,_0x4c269d){return new BPromise(function(_0x226991,_0x1a8300){return client[_0x62bf('0x9')](_0x2145c1,_0x4c269d)[_0x62bf('0xa')](function(_0x2f1b84){logger[_0x62bf('0xb')](_0x62bf('0xc'),_0x3be4e2,_0x62bf('0xd'));logger[_0x62bf('0xe')](_0x62bf('0xf'),_0x3be4e2,_0x62bf('0xd'),JSON[_0x62bf('0x10')](_0x2f1b84));if(_0x2f1b84[_0x62bf('0x11')]){if(_0x2f1b84[_0x62bf('0x11')][_0x62bf('0x12')]===0x1f4){logger[_0x62bf('0x11')](_0x62bf('0xc'),_0x3be4e2,_0x2f1b84[_0x62bf('0x11')][_0x62bf('0x13')]);return _0x1a8300(_0x2f1b84[_0x62bf('0x11')]['message']);}logger[_0x62bf('0x11')](_0x62bf('0xc'),_0x3be4e2,_0x2f1b84[_0x62bf('0x11')][_0x62bf('0x13')]);return _0x226991(_0x2f1b84[_0x62bf('0x11')]['message']);}else{logger[_0x62bf('0xb')]('Condition,\x20%s,\x20%s',_0x3be4e2,_0x62bf('0xd'));_0x226991(_0x2f1b84[_0x62bf('0x14')][_0x62bf('0x13')]);}})[_0x62bf('0x15')](function(_0x1ae761){logger[_0x62bf('0x11')](_0x62bf('0xc'),_0x3be4e2,_0x1ae761);_0x1a8300(_0x1ae761);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 2935a33..68c53ee 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 _0x1cc7=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','./condition.controller','put','/:id','isAuthenticated','update'];(function(_0x47c75a,_0x447086){var _0x1e6f62=function(_0x1a2907){while(--_0x1a2907){_0x47c75a['push'](_0x47c75a['shift']());}};_0x1e6f62(++_0x447086);}(_0x1cc7,0x1d0));var _0x71cc=function(_0x15798a,_0x5317ab){_0x15798a=_0x15798a-0x0;var _0xaa737a=_0x1cc7[_0x15798a];return _0xaa737a;};'use strict';var multer=require(_0x71cc('0x0'));var util=require(_0x71cc('0x1'));var path=require(_0x71cc('0x2'));var timeout=require(_0x71cc('0x3'));var express=require(_0x71cc('0x4'));var router=express[_0x71cc('0x5')]();var fs_extra=require(_0x71cc('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x71cc('0x7'));router[_0x71cc('0x8')](_0x71cc('0x9'),auth[_0x71cc('0xa')](),controller[_0x71cc('0xb')]);router['delete'](_0x71cc('0x9'),auth[_0x71cc('0xa')](),controller[_0x71cc('0xc')]);module[_0x71cc('0xd')]=router; \ No newline at end of file +var _0xc359=['util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','put','/:id','isAuthenticated','destroy','exports'];(function(_0x87b0ff,_0x314389){var _0x3bc0b2=function(_0x41682b){while(--_0x41682b){_0x87b0ff['push'](_0x87b0ff['shift']());}};_0x3bc0b2(++_0x314389);}(_0xc359,0x1d9));var _0x9c35=function(_0x50148e,_0x4c99c7){_0x50148e=_0x50148e-0x0;var _0x446e9d=_0xc359[_0x50148e];return _0x446e9d;};'use strict';var multer=require('multer');var util=require(_0x9c35('0x0'));var path=require('path');var timeout=require(_0x9c35('0x1'));var express=require(_0x9c35('0x2'));var router=express[_0x9c35('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9c35('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9c35('0x5'));var controller=require('./condition.controller');router[_0x9c35('0x6')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x9c35('0x7'),auth[_0x9c35('0x8')](),controller[_0x9c35('0x9')]);module[_0x9c35('0xa')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 786d669..124a29c 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(_0x2ed418,_0x3692c7){var _0x13e0c1=function(_0x43e746){while(--_0x43e746){_0x2ed418['push'](_0x2ed418['shift']());}};_0x13e0c1(++_0x3692c7);}(_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 _0x757a=['exports','STRING'];(function(_0x3676ac,_0x5f1b8c){var _0x4b2900=function(_0x51fba6){while(--_0x51fba6){_0x3676ac['push'](_0x3676ac['shift']());}};_0x4b2900(++_0x5f1b8c);}(_0x757a,0xde));var _0xa757=function(_0x51a7fd,_0x99a513){_0x51a7fd=_0x51a7fd-0x0;var _0x14d23f=_0x757a[_0x51a7fd];return _0x14d23f;};'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 diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index a1c9277..f6df0d8 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 _0x2c8c=['limit','set','Content-Range','apply','save','then','destroy','get','CustomDashboards','UserProfileResource','sendStatus','error','stack','send','index','map','Dashboard','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','name','options','includeAll','include','findAll','rows','catch','show','length','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','omit','createdAt','body','updatedAt','update','attrUrl','attrs','https://','custom','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrChatWebsites','multibar-chart','attrSerie1','attrSerie3','attrWhatsappAccounts','web-report','attrReport','reportType','attrRefresh','stringify','addItem','findOne','DashboardItem','getItems','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','crypto','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','defaults','localhost','socket.io-emitter','redis','register','end','status','json','undefined','count','offset'];(function(_0x33f5ed,_0x3c69b0){var _0x34cf07=function(_0x32e720){while(--_0x32e720){_0x33f5ed['push'](_0x33f5ed['shift']());}};_0x34cf07(++_0x3c69b0);}(_0x2c8c,0x1e8));var _0xc2c8=function(_0x4aaa5f,_0x11333c){_0x4aaa5f=_0x4aaa5f-0x0;var _0x1a3ffa=_0x2c8c[_0x4aaa5f];return _0x1a3ffa;};'use strict';var emlformat=require(_0xc2c8('0x0'));var rimraf=require(_0xc2c8('0x1'));var zipdir=require(_0xc2c8('0x2'));var jsonpatch=require(_0xc2c8('0x3'));var rp=require(_0xc2c8('0x4'));var moment=require('moment');var BPromise=require(_0xc2c8('0x5'));var Mustache=require(_0xc2c8('0x6'));var util=require(_0xc2c8('0x7'));var path=require(_0xc2c8('0x8'));var sox=require('sox');var csv=require(_0xc2c8('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc2c8('0xa'));var _=require(_0xc2c8('0xb'));var squel=require('squel');var crypto=require(_0xc2c8('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc2c8('0xd'));var toCsv=require(_0xc2c8('0x9'));var querystring=require('querystring');var Papa=require(_0xc2c8('0xe'));var Redis=require('ioredis');var authService=require(_0xc2c8('0xf'));var qs=require(_0xc2c8('0x10'));var as=require(_0xc2c8('0x11'));var hardwareService=require(_0xc2c8('0x12'));var logger=require(_0xc2c8('0x13'))(_0xc2c8('0x14'));var utils=require(_0xc2c8('0x15'));var config=require(_0xc2c8('0x16'));var licenseUtil=require(_0xc2c8('0x17'));var db=require(_0xc2c8('0x18'))['db'];config['redis']=_[_0xc2c8('0x19')](config['redis'],{'host':_0xc2c8('0x1a'),'port':0x18eb});var socket=require(_0xc2c8('0x1b'))(new Redis(config[_0xc2c8('0x1c')]));require('./dashboard.socket')[_0xc2c8('0x1d')](socket);function respondWithStatusCode(_0x1ef59c,_0x4148b8){_0x4148b8=_0x4148b8||0xcc;return function(_0x31c014){if(_0x31c014){return _0x1ef59c['sendStatus'](_0x4148b8);}return _0x1ef59c['status'](_0x4148b8)[_0xc2c8('0x1e')]();};}function respondWithResult(_0x406aa6,_0x574998){_0x574998=_0x574998||0xc8;return function(_0x4a6b68){if(_0x4a6b68){return _0x406aa6[_0xc2c8('0x1f')](_0x574998)[_0xc2c8('0x20')](_0x4a6b68);}};}function respondWithFilteredResult(_0x161159,_0x5f1930){return function(_0x45a865){if(_0x45a865){var _0x330972=typeof _0x5f1930['offset']===_0xc2c8('0x21')&&typeof _0x5f1930['limit']===_0xc2c8('0x21');var _0x3badbb=_0x45a865[_0xc2c8('0x22')];var _0x54d639=_0x330972?0x0:_0x5f1930['offset'];var _0x25bf0d=_0x330972?_0x45a865[_0xc2c8('0x22')]:_0x5f1930[_0xc2c8('0x23')]+_0x5f1930[_0xc2c8('0x24')];var _0x51f3e1;if(_0x25bf0d>=_0x3badbb){_0x25bf0d=_0x3badbb;_0x51f3e1=0xc8;}else{_0x51f3e1=0xce;}_0x161159[_0xc2c8('0x1f')](_0x51f3e1);return _0x161159[_0xc2c8('0x25')](_0xc2c8('0x26'),_0x54d639+'-'+_0x25bf0d+'/'+_0x3badbb)[_0xc2c8('0x20')](_0x45a865);}return null;};}function patchUpdates(_0x2952ea){return function(_0x3447c2){try{jsonpatch[_0xc2c8('0x27')](_0x3447c2,_0x2952ea,!![]);}catch(_0x416b9b){return BPromise['reject'](_0x416b9b);}return _0x3447c2[_0xc2c8('0x28')]();};}function saveUpdates(_0xe82a7d,_0x42ac2f){return function(_0x57e2f7){if(_0x57e2f7){return _0x57e2f7['update'](_0xe82a7d)[_0xc2c8('0x29')](function(_0x138633){return _0x138633;});}return null;};}function removeEntity(_0x13c5d6,_0x18caf3){return function(_0x34d6ea){if(_0x34d6ea){return _0x34d6ea[_0xc2c8('0x2a')]()['then'](function(){var _0xf67bca=_0x34d6ea[_0xc2c8('0x2b')]({'plain':!![]});var _0x358899=_0xc2c8('0x2c');return db[_0xc2c8('0x2d')]['destroy']({'where':{'type':_0x358899,'resourceId':_0xf67bca['id']}})[_0xc2c8('0x29')](function(){return _0x34d6ea;});})['then'](function(){_0x13c5d6[_0xc2c8('0x1f')](0xcc)[_0xc2c8('0x1e')]();});}};}function handleEntityNotFound(_0x54f80d,_0x13484f){return function(_0x2cce78){if(!_0x2cce78){_0x54f80d[_0xc2c8('0x2e')](0x194);}return _0x2cce78;};}function handleError(_0x284b60,_0x4925aa){_0x4925aa=_0x4925aa||0x1f4;return function(_0x1ff650){logger[_0xc2c8('0x2f')](_0x1ff650[_0xc2c8('0x30')]);if(_0x1ff650['name']){delete _0x1ff650['name'];}_0x284b60['status'](_0x4925aa)[_0xc2c8('0x31')](_0x1ff650);};}exports[_0xc2c8('0x32')]=function(_0x1c291b,_0x136a9a){var _0x2dcd2f={},_0x115a80={},_0x45a2c6={'count':0x0,'rows':[]};var _0x4149fa=_[_0xc2c8('0x33')](db[_0xc2c8('0x34')][_0xc2c8('0x35')],function(_0x16bd99){return{'name':_0x16bd99[_0xc2c8('0x36')],'type':_0x16bd99[_0xc2c8('0x37')][_0xc2c8('0x38')]};});_0x115a80['model']=_[_0xc2c8('0x33')](_0x4149fa,'name');_0x115a80[_0xc2c8('0x39')]=_[_0xc2c8('0x3a')](_0x1c291b[_0xc2c8('0x39')]);_0x115a80[_0xc2c8('0x3b')]=_[_0xc2c8('0x3c')](_0x115a80[_0xc2c8('0x3d')],_0x115a80['query']);_0x2dcd2f['attributes']=_[_0xc2c8('0x3c')](_0x115a80[_0xc2c8('0x3d')],qs[_0xc2c8('0x3e')](_0x1c291b[_0xc2c8('0x39')][_0xc2c8('0x3e')]));_0x2dcd2f[_0xc2c8('0x3f')]=_0x2dcd2f['attributes']['length']?_0x2dcd2f[_0xc2c8('0x3f')]:_0x115a80[_0xc2c8('0x3d')];if(!_0x1c291b[_0xc2c8('0x39')][_0xc2c8('0x40')]('nolimit')){_0x2dcd2f[_0xc2c8('0x24')]=qs['limit'](_0x1c291b[_0xc2c8('0x39')][_0xc2c8('0x24')]);_0x2dcd2f['offset']=qs[_0xc2c8('0x23')](_0x1c291b[_0xc2c8('0x39')]['offset']);}_0x2dcd2f[_0xc2c8('0x41')]=qs['sort'](_0x1c291b[_0xc2c8('0x39')][_0xc2c8('0x42')]);_0x2dcd2f[_0xc2c8('0x43')]=qs['filters'](_[_0xc2c8('0x44')](_0x1c291b[_0xc2c8('0x39')],_0x115a80[_0xc2c8('0x3b')]),_0x4149fa);if(_0x1c291b[_0xc2c8('0x39')][_0xc2c8('0x45')]){_0x2dcd2f[_0xc2c8('0x43')]=_[_0xc2c8('0x46')](_0x2dcd2f[_0xc2c8('0x43')],{'$or':_[_0xc2c8('0x33')](_0x4149fa,function(_0x35eecf){if(_0x35eecf[_0xc2c8('0x37')]!==_0xc2c8('0x47')){var _0x3532c5={};_0x3532c5[_0x35eecf[_0xc2c8('0x48')]]={'$like':'%'+_0x1c291b[_0xc2c8('0x39')]['filter']+'%'};return _0x3532c5;}})});}_0x2dcd2f=_[_0xc2c8('0x46')]({},_0x2dcd2f,_0x1c291b[_0xc2c8('0x49')]);var _0x3023aa={'where':_0x2dcd2f[_0xc2c8('0x43')]};return db[_0xc2c8('0x34')][_0xc2c8('0x22')](_0x3023aa)[_0xc2c8('0x29')](function(_0x25e6f7){_0x45a2c6[_0xc2c8('0x22')]=_0x25e6f7;if(_0x1c291b[_0xc2c8('0x39')][_0xc2c8('0x4a')]){_0x2dcd2f[_0xc2c8('0x4b')]=[{'all':!![]}];}return db[_0xc2c8('0x34')][_0xc2c8('0x4c')](_0x2dcd2f);})['then'](function(_0xfe800b){_0x45a2c6[_0xc2c8('0x4d')]=_0xfe800b;return _0x45a2c6;})['then'](respondWithFilteredResult(_0x136a9a,_0x2dcd2f))[_0xc2c8('0x4e')](handleError(_0x136a9a,null));};exports[_0xc2c8('0x4f')]=function(_0x4daaff,_0x2e6310){var _0x17a8b6={'raw':![],'where':{'id':_0x4daaff['params']['id']}},_0x2d0a92={};_0x2d0a92[_0xc2c8('0x3d')]=_[_0xc2c8('0x3a')](db[_0xc2c8('0x34')][_0xc2c8('0x35')]);_0x2d0a92[_0xc2c8('0x39')]=_['keys'](_0x4daaff['query']);_0x2d0a92[_0xc2c8('0x3b')]=_['intersection'](_0x2d0a92['model'],_0x2d0a92['query']);_0x17a8b6[_0xc2c8('0x3f')]=_['intersection'](_0x2d0a92[_0xc2c8('0x3d')],qs['fields'](_0x4daaff[_0xc2c8('0x39')][_0xc2c8('0x3e')]));_0x17a8b6[_0xc2c8('0x3f')]=_0x17a8b6[_0xc2c8('0x3f')][_0xc2c8('0x50')]?_0x17a8b6[_0xc2c8('0x3f')]:_0x2d0a92['model'];if(_0x4daaff['query'][_0xc2c8('0x4a')]){_0x17a8b6[_0xc2c8('0x4b')]=[{'all':!![]}];}_0x17a8b6=_['merge']({},_0x17a8b6,_0x4daaff['options']);return db[_0xc2c8('0x34')]['find'](_0x17a8b6)[_0xc2c8('0x29')](handleEntityNotFound(_0x2e6310,null))['then'](respondWithResult(_0x2e6310,null))[_0xc2c8('0x4e')](handleError(_0x2e6310,null));};exports[_0xc2c8('0x51')]=function(_0x53ce18,_0xf939f0){return db['Dashboard'][_0xc2c8('0x51')](_0x53ce18['body'],{})[_0xc2c8('0x29')](function(_0x362a29){var _0x3df216=_0x53ce18[_0xc2c8('0x52')]['get']({'plain':!![]});if(!_0x3df216)throw new Error(_0xc2c8('0x53'));if(_0x3df216[_0xc2c8('0x54')]===_0xc2c8('0x52')){var _0x1f9e9e=_0x362a29[_0xc2c8('0x2b')]({'plain':!![]});var _0x511da0=_0xc2c8('0x2c');return db[_0xc2c8('0x55')][_0xc2c8('0x56')]({'where':{'name':_0x511da0,'userProfileId':_0x3df216['userProfileId']},'raw':!![]})[_0xc2c8('0x29')](function(_0x31a323){if(_0x31a323&&_0x31a323[_0xc2c8('0x57')]===0x0){return db[_0xc2c8('0x2d')][_0xc2c8('0x51')]({'name':_0x1f9e9e['name'],'resourceId':_0x1f9e9e['id'],'type':_0x31a323[_0xc2c8('0x48')],'sectionId':_0x31a323['id']},{})[_0xc2c8('0x29')](function(){return _0x362a29;});}else{return _0x362a29;}})[_0xc2c8('0x4e')](function(_0x52de24){logger[_0xc2c8('0x2f')](_0xc2c8('0x58'),_0x52de24);throw _0x52de24;});}return _0x362a29;})[_0xc2c8('0x29')](respondWithResult(_0xf939f0,0xc9))[_0xc2c8('0x4e')](handleError(_0xf939f0,null));};exports['clone']=function(_0x5740cb,_0x42e751){var _0x4f6fc0={'where':{'id':_0x5740cb[_0xc2c8('0x59')]['id']}},_0x47898e={};_0x47898e[_0xc2c8('0x3d')]=_['keys'](db['Dashboard']['rawAttributes']);_0x4f6fc0['attributes']=_[_0xc2c8('0x3c')](_0x47898e[_0xc2c8('0x3d')],qs[_0xc2c8('0x3e')](_0x5740cb['query']['fields']));_0x4f6fc0[_0xc2c8('0x3f')]=_0x4f6fc0[_0xc2c8('0x3f')][_0xc2c8('0x50')]?_0x4f6fc0[_0xc2c8('0x3f')]:_0x47898e[_0xc2c8('0x3d')];if(_0x5740cb[_0xc2c8('0x39')][_0xc2c8('0x4a')]){_0x4f6fc0[_0xc2c8('0x4b')]=[{'all':!![]}];}_0x4f6fc0=_['merge']({},_0x4f6fc0,_0x5740cb[_0xc2c8('0x49')]);return db[_0xc2c8('0x34')][_0xc2c8('0x56')](_0x4f6fc0)[_0xc2c8('0x29')](handleEntityNotFound(_0x42e751,null))[_0xc2c8('0x29')](function(_0x38cdb0){if(_0x38cdb0){var _0x14f219=_0x38cdb0[_0xc2c8('0x2b')]({'plain':!![]});_0x14f219=qs[_0xc2c8('0x5a')](_0x14f219,['id',_0xc2c8('0x5b'),'updatedAt']);_0x5740cb['body']=_[_0xc2c8('0x5a')](_0x5740cb[_0xc2c8('0x5c')],['id',_0xc2c8('0x5b'),_0xc2c8('0x5d')]);return db['Dashboard'][_0xc2c8('0x51')](_[_0xc2c8('0x46')](_0x14f219,_0x5740cb[_0xc2c8('0x5c')]),{'include':_0x5740cb[_0xc2c8('0x39')][_0xc2c8('0x4a')]?[{'all':!![]}]:undefined})[_0xc2c8('0x29')](function(_0x36d335){var _0x4f4383=_0x5740cb[_0xc2c8('0x52')][_0xc2c8('0x2b')]({'plain':!![]});if(!_0x4f4383)throw new Error(_0xc2c8('0x53'));if(_0x4f4383['role']===_0xc2c8('0x52')){var _0x1995f2=_0x36d335[_0xc2c8('0x2b')]({'plain':!![]});var _0xf90aec=_0xc2c8('0x2c');return db[_0xc2c8('0x55')][_0xc2c8('0x56')]({'where':{'name':_0xf90aec,'userProfileId':_0x4f4383['userProfileId']},'raw':!![]})[_0xc2c8('0x29')](function(_0x55f929){if(_0x55f929&&_0x55f929[_0xc2c8('0x57')]===0x0){return db[_0xc2c8('0x2d')][_0xc2c8('0x51')]({'name':_0x1995f2[_0xc2c8('0x48')],'resourceId':_0x1995f2['id'],'type':_0x55f929['name'],'sectionId':_0x55f929['id']},{})[_0xc2c8('0x29')](function(){return _0x36d335;});}else{return _0x36d335;}})[_0xc2c8('0x4e')](function(_0x4c0b3e){logger[_0xc2c8('0x2f')](_0xc2c8('0x58'),_0x4c0b3e);throw _0x4c0b3e;});}return _0x36d335;});}})[_0xc2c8('0x29')](respondWithResult(_0x42e751,0xc9))[_0xc2c8('0x4e')](handleError(_0x42e751,null));};exports[_0xc2c8('0x5e')]=function(_0x4a0430,_0x239702){if(_0x4a0430[_0xc2c8('0x5c')]['id']){delete _0x4a0430['body']['id'];}return db['Dashboard']['find']({'where':{'id':_0x4a0430[_0xc2c8('0x59')]['id']}})[_0xc2c8('0x29')](handleEntityNotFound(_0x239702,null))[_0xc2c8('0x29')](saveUpdates(_0x4a0430[_0xc2c8('0x5c')],null))[_0xc2c8('0x29')](respondWithResult(_0x239702,null))[_0xc2c8('0x4e')](handleError(_0x239702,null));};exports['destroy']=function(_0xa726b7,_0x5a1083){return db['Dashboard'][_0xc2c8('0x56')]({'where':{'id':_0xa726b7[_0xc2c8('0x59')]['id']}})['then'](handleEntityNotFound(_0x5a1083,null))[_0xc2c8('0x29')](removeEntity(_0x5a1083,null))['catch'](handleError(_0x5a1083,null));};function widgetAttributes(_0x474951){try{switch(_0x474951['type']){case'iframe':return[{'name':_0xc2c8('0x5f'),'value':_0x474951[_0xc2c8('0x5f')]||(_0x474951[_0xc2c8('0x60')]&&_0x474951['attrs'][0x0]?_0x474951['attrs'][0x0]['value']:undefined)||_0xc2c8('0x61')}];case _0xc2c8('0x62'):return[{'name':_0xc2c8('0x63'),'value':_0x474951[_0xc2c8('0x63')]||(_0x474951[_0xc2c8('0x60')]&&_0x474951[_0xc2c8('0x60')][0x0]?_0x474951[_0xc2c8('0x60')][0x0][_0xc2c8('0x64')]:undefined)||''}];case _0xc2c8('0x65'):return[{'name':'attrHourFormat','value':_0x474951[_0xc2c8('0x66')]||(_0x474951[_0xc2c8('0x60')]&&_0x474951[_0xc2c8('0x60')][0x0]?_0x474951[_0xc2c8('0x60')][0x0]['value']:undefined)||_0xc2c8('0x67')},{'name':_0xc2c8('0x68'),'value':_0x474951['attrTimezone']||(_0x474951[_0xc2c8('0x60')]&&_0x474951[_0xc2c8('0x60')][0x1]?_0x474951[_0xc2c8('0x60')][0x1][_0xc2c8('0x64')]:undefined)||'0.00'},{'name':'attrFontSize','value':_0x474951[_0xc2c8('0x69')]||(_0x474951[_0xc2c8('0x60')]&&_0x474951[_0xc2c8('0x60')][0x2]?_0x474951['attrs'][0x2][_0xc2c8('0x64')]:undefined)||0xc}];case _0xc2c8('0x6a'):return[{'name':_0xc2c8('0x6b'),'value':_0x474951[_0xc2c8('0x6b')]||(_0x474951[_0xc2c8('0x60')]&&_0x474951[_0xc2c8('0x60')][0x0]?_0x474951[_0xc2c8('0x60')][0x0]['value']:undefined)||_0xc2c8('0x6c')},{'name':_0xc2c8('0x6d'),'value':_0x474951[_0xc2c8('0x6d')]||(_0x474951[_0xc2c8('0x60')]&&_0x474951[_0xc2c8('0x60')][0x1]?_0x474951[_0xc2c8('0x60')][0x1]['value']:undefined)||[]},{'name':_0xc2c8('0x69'),'value':_0x474951['attrFontSize']||(_0x474951[_0xc2c8('0x60')]&&_0x474951[_0xc2c8('0x60')][0x2]?_0x474951[_0xc2c8('0x60')][0x2][_0xc2c8('0x64')]:undefined)||0x14},{'name':_0xc2c8('0x6e'),'value':_0x474951[_0xc2c8('0x6e')]||(_0x474951[_0xc2c8('0x60')]&&_0x474951['attrs'][0x3]?_0x474951[_0xc2c8('0x60')][0x3]['value']:undefined)||_0xc2c8('0x6f')},{'name':_0xc2c8('0x70'),'value':_0x474951['attrEmailAccounts']||(_0x474951[_0xc2c8('0x60')]&&_0x474951[_0xc2c8('0x60')][0x4]?_0x474951[_0xc2c8('0x60')][0x4]['value']:undefined)||''},{'name':_0xc2c8('0x71'),'value':_0x474951[_0xc2c8('0x71')]||(_0x474951[_0xc2c8('0x60')]&&_0x474951[_0xc2c8('0x60')][0x5]?_0x474951[_0xc2c8('0x60')][0x5][_0xc2c8('0x64')]:undefined)||''},{'name':_0xc2c8('0x72'),'value':_0x474951[_0xc2c8('0x72')]||(_0x474951[_0xc2c8('0x60')]&&_0x474951['attrs'][0x6]?_0x474951[_0xc2c8('0x60')][0x6][_0xc2c8('0x64')]:undefined)||''},{'name':_0xc2c8('0x73'),'value':_0x474951[_0xc2c8('0x73')]||(_0x474951[_0xc2c8('0x60')]&&_0x474951[_0xc2c8('0x60')][0x7]?_0x474951[_0xc2c8('0x60')][0x7][_0xc2c8('0x64')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x474951['attrWhatsappAccounts']||(_0x474951['attrs']&&_0x474951['attrs'][0x8]?_0x474951[_0xc2c8('0x60')][0x8]['value']:undefined)||''},{'name':_0xc2c8('0x74'),'value':_0x474951['attrChatWebsites']||(_0x474951[_0xc2c8('0x60')]&&_0x474951[_0xc2c8('0x60')][0x9]?_0x474951[_0xc2c8('0x60')][0x9]['value']:undefined)||''}];case _0xc2c8('0x75'):case'pie-chart':return[{'name':'attrSerie1','value':_0x474951[_0xc2c8('0x76')]||(_0x474951[_0xc2c8('0x60')]&&_0x474951[_0xc2c8('0x60')][0x0]?_0x474951['attrs'][0x0][_0xc2c8('0x64')]:undefined)||_0xc2c8('0x6c')},{'name':'attrSerie2','value':_0x474951['attrSerie2']||(_0x474951[_0xc2c8('0x60')]&&_0x474951[_0xc2c8('0x60')][0x1]?_0x474951['attrs'][0x1][_0xc2c8('0x64')]:undefined)||null},{'name':_0xc2c8('0x77'),'value':_0x474951['attrSerie3']||(_0x474951[_0xc2c8('0x60')]&&_0x474951[_0xc2c8('0x60')][0x2]?_0x474951[_0xc2c8('0x60')][0x2][_0xc2c8('0x64')]:undefined)||null},{'name':_0xc2c8('0x6d'),'value':_0x474951[_0xc2c8('0x6d')]||(_0x474951[_0xc2c8('0x60')]&&_0x474951[_0xc2c8('0x60')][0x3]?_0x474951[_0xc2c8('0x60')][0x3]['value']:undefined)||[]},{'name':'attrChannel','value':_0x474951[_0xc2c8('0x6e')]||(_0x474951['attrs']&&_0x474951[_0xc2c8('0x60')][0x4]?_0x474951[_0xc2c8('0x60')][0x4][_0xc2c8('0x64')]:undefined)||_0xc2c8('0x6f')},{'name':_0xc2c8('0x70'),'value':_0x474951[_0xc2c8('0x70')]||(_0x474951[_0xc2c8('0x60')]&&_0x474951['attrs'][0x5]?_0x474951[_0xc2c8('0x60')][0x5][_0xc2c8('0x64')]:undefined)||''},{'name':_0xc2c8('0x71'),'value':_0x474951['attrFaxAccounts']||(_0x474951[_0xc2c8('0x60')]&&_0x474951[_0xc2c8('0x60')][0x6]?_0x474951[_0xc2c8('0x60')][0x6]['value']:undefined)||''},{'name':_0xc2c8('0x72'),'value':_0x474951[_0xc2c8('0x72')]||(_0x474951['attrs']&&_0x474951[_0xc2c8('0x60')][0x7]?_0x474951['attrs'][0x7][_0xc2c8('0x64')]:undefined)||''},{'name':_0xc2c8('0x73'),'value':_0x474951[_0xc2c8('0x73')]||(_0x474951['attrs']&&_0x474951[_0xc2c8('0x60')][0x8]?_0x474951[_0xc2c8('0x60')][0x8][_0xc2c8('0x64')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x474951[_0xc2c8('0x78')]||(_0x474951['attrs']&&_0x474951['attrs'][0x9]?_0x474951[_0xc2c8('0x60')][0x9][_0xc2c8('0x64')]:undefined)||''},{'name':_0xc2c8('0x74'),'value':_0x474951[_0xc2c8('0x74')]||(_0x474951[_0xc2c8('0x60')]&&_0x474951[_0xc2c8('0x60')][0xa]?_0x474951[_0xc2c8('0x60')][0xa][_0xc2c8('0x64')]:undefined)||''}];case _0xc2c8('0x79'):return[{'name':_0xc2c8('0x7a'),'type':_0x474951[_0xc2c8('0x7b')]||(_0x474951[_0xc2c8('0x60')]&&_0x474951[_0xc2c8('0x60')][0x0]?_0x474951[_0xc2c8('0x60')][0x0][_0xc2c8('0x37')]:undefined)||null,'value':_0x474951[_0xc2c8('0x7a')]||(_0x474951[_0xc2c8('0x60')]&&_0x474951[_0xc2c8('0x60')][0x0]?_0x474951[_0xc2c8('0x60')][0x0]['value']:undefined)||null},{'name':_0xc2c8('0x7c'),'value':_0x474951[_0xc2c8('0x7c')]||(_0x474951[_0xc2c8('0x60')]&&_0x474951[_0xc2c8('0x60')][0x1]?_0x474951[_0xc2c8('0x60')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x4790d3){logger[_0xc2c8('0x2f')]('widgetAttributes:\x20%s',JSON[_0xc2c8('0x7d')](_0x4790d3));return[];}}exports[_0xc2c8('0x7e')]=function(_0x551838,_0x3540ee,_0x39855f){if(_0x551838[_0xc2c8('0x5c')]['id']){delete _0x551838[_0xc2c8('0x5c')]['id'];}return db[_0xc2c8('0x34')][_0xc2c8('0x56')]({'where':{'id':_0x551838[_0xc2c8('0x59')]['id']}})[_0xc2c8('0x29')](handleEntityNotFound(_0x3540ee,null))[_0xc2c8('0x29')](function(_0x51a8f3){if(_0x51a8f3){_0x551838[_0xc2c8('0x5c')]['DashboardId']=_0x51a8f3['id'];_0x551838[_0xc2c8('0x5c')][_0xc2c8('0x60')]=widgetAttributes(_0x551838[_0xc2c8('0x5c')]);return db['DashboardItem'][_0xc2c8('0x51')](_0x551838[_0xc2c8('0x5c')]);}})[_0xc2c8('0x29')](respondWithResult(_0x3540ee,null))[_0xc2c8('0x4e')](handleError(_0x3540ee,null));};exports['getItems']=function(_0x6ef228,_0x40cd07,_0x27ead2){var _0x33c2f5={};var _0x3ae64d={};var _0x22a6e5;var _0x1728a1;return db[_0xc2c8('0x34')][_0xc2c8('0x7f')]({'where':{'id':_0x6ef228[_0xc2c8('0x59')]['id']}})[_0xc2c8('0x29')](handleEntityNotFound(_0x40cd07,null))['then'](function(_0x3cc7a6){if(_0x3cc7a6){_0x22a6e5=_0x3cc7a6;_0x3ae64d[_0xc2c8('0x3d')]=_[_0xc2c8('0x3a')](db[_0xc2c8('0x80')][_0xc2c8('0x35')]);_0x3ae64d[_0xc2c8('0x39')]=_[_0xc2c8('0x3a')](_0x6ef228['query']);_0x3ae64d[_0xc2c8('0x3b')]=_[_0xc2c8('0x3c')](_0x3ae64d['model'],_0x3ae64d[_0xc2c8('0x39')]);_0x33c2f5[_0xc2c8('0x3f')]=_['intersection'](_0x3ae64d[_0xc2c8('0x3d')],qs['fields'](_0x6ef228['query'][_0xc2c8('0x3e')]));_0x33c2f5[_0xc2c8('0x3f')]=_0x33c2f5[_0xc2c8('0x3f')]['length']?_0x33c2f5[_0xc2c8('0x3f')]:_0x3ae64d['model'];_0x33c2f5['order']=qs[_0xc2c8('0x42')](_0x6ef228[_0xc2c8('0x39')]['sort']);_0x33c2f5[_0xc2c8('0x43')]=qs[_0xc2c8('0x3b')](_['pick'](_0x6ef228['query'],_0x3ae64d[_0xc2c8('0x3b')]));if(_0x6ef228['query'][_0xc2c8('0x45')]){_0x33c2f5[_0xc2c8('0x43')]=_['merge'](_0x33c2f5['where'],{'$or':_['map'](_0x33c2f5['attributes'],function(_0xfa9db9){var _0x1d162f={};_0x1d162f[_0xfa9db9]={'$like':'%'+_0x6ef228[_0xc2c8('0x39')][_0xc2c8('0x45')]+'%'};return _0x1d162f;})});}_0x33c2f5=_[_0xc2c8('0x46')]({},_0x33c2f5,_0x6ef228['options']);return _0x22a6e5[_0xc2c8('0x81')](_0x33c2f5);}})['then'](function(_0x4089a4){if(_0x4089a4){_0x1728a1=_0x4089a4['length'];if(!_0x6ef228[_0xc2c8('0x39')]['hasOwnProperty'](_0xc2c8('0x82'))){_0x33c2f5[_0xc2c8('0x24')]=qs['limit'](_0x6ef228['query'][_0xc2c8('0x24')]);_0x33c2f5[_0xc2c8('0x23')]=qs[_0xc2c8('0x23')](_0x6ef228[_0xc2c8('0x39')][_0xc2c8('0x23')]);}return _0x22a6e5[_0xc2c8('0x81')](_0x33c2f5);}})[_0xc2c8('0x29')](function(_0x1f2a52){if(_0x1f2a52){return _0x1f2a52?{'count':_0x1728a1,'rows':_0x1f2a52}:null;}})[_0xc2c8('0x29')](respondWithResult(_0x40cd07,null))['catch'](handleError(_0x40cd07,null));}; \ No newline at end of file +var _0xe010=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','CustomDashboards','UserProfileResource','destroy','name','send','map','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','Dashboard','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','length','createdAt','updatedAt','autoAssociation','error','attrUrl','attrs','value','https://','custom','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','reportType','attrRefresh','stringify','DashboardId','DashboardItem','getItems','order','eml-format'];(function(_0xb715dc,_0x5c039e){var _0x8521e9=function(_0x238a0f){while(--_0x238a0f){_0xb715dc['push'](_0xb715dc['shift']());}};_0x8521e9(++_0x5c039e);}(_0xe010,0xff));var _0x0e01=function(_0x218b71,_0xba3f56){_0x218b71=_0x218b71-0x0;var _0x30f95a=_0xe010[_0x218b71];return _0x30f95a;};'use strict';var emlformat=require(_0x0e01('0x0'));var rimraf=require(_0x0e01('0x1'));var zipdir=require(_0x0e01('0x2'));var jsonpatch=require(_0x0e01('0x3'));var rp=require(_0x0e01('0x4'));var moment=require(_0x0e01('0x5'));var BPromise=require(_0x0e01('0x6'));var Mustache=require(_0x0e01('0x7'));var util=require(_0x0e01('0x8'));var path=require('path');var sox=require(_0x0e01('0x9'));var csv=require(_0x0e01('0xa'));var ejs=require(_0x0e01('0xb'));var fs=require('fs');var fs_extra=require(_0x0e01('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x0e01('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x0e01('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0e01('0xf'));var Papa=require(_0x0e01('0x10'));var Redis=require(_0x0e01('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0e01('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0e01('0x13'));var utils=require(_0x0e01('0x14'));var config=require(_0x0e01('0x15'));var licenseUtil=require(_0x0e01('0x16'));var db=require(_0x0e01('0x17'))['db'];config[_0x0e01('0x18')]=_[_0x0e01('0x19')](config[_0x0e01('0x18')],{'host':_0x0e01('0x1a'),'port':0x18eb});var socket=require(_0x0e01('0x1b'))(new Redis(config[_0x0e01('0x18')]));require(_0x0e01('0x1c'))[_0x0e01('0x1d')](socket);function respondWithStatusCode(_0x40d678,_0x2ec18f){_0x2ec18f=_0x2ec18f||0xcc;return function(_0x1b7a2b){if(_0x1b7a2b){return _0x40d678[_0x0e01('0x1e')](_0x2ec18f);}return _0x40d678[_0x0e01('0x1f')](_0x2ec18f)[_0x0e01('0x20')]();};}function respondWithResult(_0x453dbc,_0x33749e){_0x33749e=_0x33749e||0xc8;return function(_0xb3b4c6){if(_0xb3b4c6){return _0x453dbc[_0x0e01('0x1f')](_0x33749e)['json'](_0xb3b4c6);}};}function respondWithFilteredResult(_0x3dc7ca,_0x5b788e){return function(_0x31c3bc){if(_0x31c3bc){var _0x556d09=typeof _0x5b788e[_0x0e01('0x21')]===_0x0e01('0x22')&&typeof _0x5b788e[_0x0e01('0x23')]==='undefined';var _0x300324=_0x31c3bc[_0x0e01('0x24')];var _0x6d6e6b=_0x556d09?0x0:_0x5b788e['offset'];var _0x345b61=_0x556d09?_0x31c3bc['count']:_0x5b788e[_0x0e01('0x21')]+_0x5b788e[_0x0e01('0x23')];var _0x47e7f2;if(_0x345b61>=_0x300324){_0x345b61=_0x300324;_0x47e7f2=0xc8;}else{_0x47e7f2=0xce;}_0x3dc7ca['status'](_0x47e7f2);return _0x3dc7ca[_0x0e01('0x25')](_0x0e01('0x26'),_0x6d6e6b+'-'+_0x345b61+'/'+_0x300324)['json'](_0x31c3bc);}return null;};}function patchUpdates(_0x4fe45d){return function(_0x388c6e){try{jsonpatch[_0x0e01('0x27')](_0x388c6e,_0x4fe45d,!![]);}catch(_0x58a57f){return BPromise[_0x0e01('0x28')](_0x58a57f);}return _0x388c6e[_0x0e01('0x29')]();};}function saveUpdates(_0xb0c292,_0x160ec6){return function(_0x22ce76){if(_0x22ce76){return _0x22ce76[_0x0e01('0x2a')](_0xb0c292)[_0x0e01('0x2b')](function(_0x4314a9){return _0x4314a9;});}return null;};}function removeEntity(_0x4bf897,_0x73e723){return function(_0x2db13e){if(_0x2db13e){return _0x2db13e['destroy']()[_0x0e01('0x2b')](function(){var _0x4f1894=_0x2db13e[_0x0e01('0x2c')]({'plain':!![]});var _0x4e9b31=_0x0e01('0x2d');return db[_0x0e01('0x2e')][_0x0e01('0x2f')]({'where':{'type':_0x4e9b31,'resourceId':_0x4f1894['id']}})[_0x0e01('0x2b')](function(){return _0x2db13e;});})['then'](function(){_0x4bf897[_0x0e01('0x1f')](0xcc)[_0x0e01('0x20')]();});}};}function handleEntityNotFound(_0x5e54f2,_0x3b3115){return function(_0x1fdbdb){if(!_0x1fdbdb){_0x5e54f2['sendStatus'](0x194);}return _0x1fdbdb;};}function handleError(_0x28b417,_0x2765be){_0x2765be=_0x2765be||0x1f4;return function(_0x19f304){logger['error'](_0x19f304['stack']);if(_0x19f304[_0x0e01('0x30')]){delete _0x19f304['name'];}_0x28b417['status'](_0x2765be)[_0x0e01('0x31')](_0x19f304);};}exports['index']=function(_0x25072e,_0x3edf95){var _0x54fa30={},_0x40e59a={},_0x2b865e={'count':0x0,'rows':[]};var _0x1c7bba=_[_0x0e01('0x32')](db['Dashboard']['rawAttributes'],function(_0x5e80ac){return{'name':_0x5e80ac[_0x0e01('0x33')],'type':_0x5e80ac[_0x0e01('0x34')][_0x0e01('0x35')]};});_0x40e59a[_0x0e01('0x36')]=_['map'](_0x1c7bba,_0x0e01('0x30'));_0x40e59a[_0x0e01('0x37')]=_[_0x0e01('0x38')](_0x25072e[_0x0e01('0x37')]);_0x40e59a[_0x0e01('0x39')]=_['intersection'](_0x40e59a[_0x0e01('0x36')],_0x40e59a[_0x0e01('0x37')]);_0x54fa30[_0x0e01('0x3a')]=_[_0x0e01('0x3b')](_0x40e59a[_0x0e01('0x36')],qs['fields'](_0x25072e[_0x0e01('0x37')][_0x0e01('0x3c')]));_0x54fa30[_0x0e01('0x3a')]=_0x54fa30[_0x0e01('0x3a')]['length']?_0x54fa30[_0x0e01('0x3a')]:_0x40e59a[_0x0e01('0x36')];if(!_0x25072e['query'][_0x0e01('0x3d')](_0x0e01('0x3e'))){_0x54fa30['limit']=qs[_0x0e01('0x23')](_0x25072e[_0x0e01('0x37')][_0x0e01('0x23')]);_0x54fa30['offset']=qs[_0x0e01('0x21')](_0x25072e['query'][_0x0e01('0x21')]);}_0x54fa30['order']=qs['sort'](_0x25072e[_0x0e01('0x37')][_0x0e01('0x3f')]);_0x54fa30[_0x0e01('0x40')]=qs[_0x0e01('0x39')](_[_0x0e01('0x41')](_0x25072e[_0x0e01('0x37')],_0x40e59a['filters']),_0x1c7bba);if(_0x25072e[_0x0e01('0x37')][_0x0e01('0x42')]){_0x54fa30['where']=_['merge'](_0x54fa30[_0x0e01('0x40')],{'$or':_[_0x0e01('0x32')](_0x1c7bba,function(_0x41be3d){if(_0x41be3d[_0x0e01('0x34')]!==_0x0e01('0x43')){var _0x2b1675={};_0x2b1675[_0x41be3d[_0x0e01('0x30')]]={'$like':'%'+_0x25072e['query']['filter']+'%'};return _0x2b1675;}})});}_0x54fa30=_[_0x0e01('0x44')]({},_0x54fa30,_0x25072e[_0x0e01('0x45')]);var _0x16953a={'where':_0x54fa30['where']};return db[_0x0e01('0x46')][_0x0e01('0x24')](_0x16953a)[_0x0e01('0x2b')](function(_0x5e7f81){_0x2b865e[_0x0e01('0x24')]=_0x5e7f81;if(_0x25072e['query'][_0x0e01('0x47')]){_0x54fa30[_0x0e01('0x48')]=[{'all':!![]}];}return db['Dashboard'][_0x0e01('0x49')](_0x54fa30);})[_0x0e01('0x2b')](function(_0x5c0859){_0x2b865e[_0x0e01('0x4a')]=_0x5c0859;return _0x2b865e;})['then'](respondWithFilteredResult(_0x3edf95,_0x54fa30))[_0x0e01('0x4b')](handleError(_0x3edf95,null));};exports[_0x0e01('0x4c')]=function(_0x1b74f3,_0x34e7ab){var _0x420c72={'raw':![],'where':{'id':_0x1b74f3[_0x0e01('0x4d')]['id']}},_0x1a0b2f={};_0x1a0b2f[_0x0e01('0x36')]=_[_0x0e01('0x38')](db[_0x0e01('0x46')][_0x0e01('0x4e')]);_0x1a0b2f[_0x0e01('0x37')]=_[_0x0e01('0x38')](_0x1b74f3['query']);_0x1a0b2f[_0x0e01('0x39')]=_[_0x0e01('0x3b')](_0x1a0b2f[_0x0e01('0x36')],_0x1a0b2f[_0x0e01('0x37')]);_0x420c72[_0x0e01('0x3a')]=_[_0x0e01('0x3b')](_0x1a0b2f[_0x0e01('0x36')],qs[_0x0e01('0x3c')](_0x1b74f3[_0x0e01('0x37')][_0x0e01('0x3c')]));_0x420c72[_0x0e01('0x3a')]=_0x420c72[_0x0e01('0x3a')]['length']?_0x420c72['attributes']:_0x1a0b2f[_0x0e01('0x36')];if(_0x1b74f3[_0x0e01('0x37')]['includeAll']){_0x420c72['include']=[{'all':!![]}];}_0x420c72=_['merge']({},_0x420c72,_0x1b74f3[_0x0e01('0x45')]);return db[_0x0e01('0x46')][_0x0e01('0x4f')](_0x420c72)[_0x0e01('0x2b')](handleEntityNotFound(_0x34e7ab,null))[_0x0e01('0x2b')](respondWithResult(_0x34e7ab,null))[_0x0e01('0x4b')](handleError(_0x34e7ab,null));};exports[_0x0e01('0x50')]=function(_0x35755e,_0x4f43b7){return db[_0x0e01('0x46')][_0x0e01('0x50')](_0x35755e[_0x0e01('0x51')],{})['then'](function(_0x3f48ca){var _0x2628f0=_0x35755e[_0x0e01('0x52')][_0x0e01('0x2c')]({'plain':!![]});if(!_0x2628f0)throw new Error(_0x0e01('0x53'));if(_0x2628f0[_0x0e01('0x54')]===_0x0e01('0x52')){var _0x5dba7c=_0x3f48ca[_0x0e01('0x2c')]({'plain':!![]});var _0x4e6766='CustomDashboards';return db[_0x0e01('0x55')][_0x0e01('0x4f')]({'where':{'name':_0x4e6766,'userProfileId':_0x2628f0[_0x0e01('0x56')]},'raw':!![]})[_0x0e01('0x2b')](function(_0x46a24b){if(_0x46a24b&&_0x46a24b['autoAssociation']===0x0){return db[_0x0e01('0x2e')][_0x0e01('0x50')]({'name':_0x5dba7c[_0x0e01('0x30')],'resourceId':_0x5dba7c['id'],'type':_0x46a24b[_0x0e01('0x30')],'sectionId':_0x46a24b['id']},{})[_0x0e01('0x2b')](function(){return _0x3f48ca;});}else{return _0x3f48ca;}})['catch'](function(_0x14f184){logger['error'](_0x0e01('0x57'),_0x14f184);throw _0x14f184;});}return _0x3f48ca;})[_0x0e01('0x2b')](respondWithResult(_0x4f43b7,0xc9))[_0x0e01('0x4b')](handleError(_0x4f43b7,null));};exports[_0x0e01('0x58')]=function(_0x48fa73,_0x47c06b){var _0x36b5c6={'where':{'id':_0x48fa73['params']['id']}},_0x3f7772={};_0x3f7772['model']=_[_0x0e01('0x38')](db[_0x0e01('0x46')][_0x0e01('0x4e')]);_0x36b5c6[_0x0e01('0x3a')]=_[_0x0e01('0x3b')](_0x3f7772['model'],qs[_0x0e01('0x3c')](_0x48fa73['query'][_0x0e01('0x3c')]));_0x36b5c6[_0x0e01('0x3a')]=_0x36b5c6[_0x0e01('0x3a')][_0x0e01('0x59')]?_0x36b5c6[_0x0e01('0x3a')]:_0x3f7772[_0x0e01('0x36')];if(_0x48fa73['query'][_0x0e01('0x47')]){_0x36b5c6[_0x0e01('0x48')]=[{'all':!![]}];}_0x36b5c6=_[_0x0e01('0x44')]({},_0x36b5c6,_0x48fa73['options']);return db['Dashboard']['find'](_0x36b5c6)[_0x0e01('0x2b')](handleEntityNotFound(_0x47c06b,null))['then'](function(_0x3fee2f){if(_0x3fee2f){var _0x245f1b=_0x3fee2f[_0x0e01('0x2c')]({'plain':!![]});_0x245f1b=qs['omit'](_0x245f1b,['id',_0x0e01('0x5a'),_0x0e01('0x5b')]);_0x48fa73[_0x0e01('0x51')]=_['omit'](_0x48fa73['body'],['id',_0x0e01('0x5a'),'updatedAt']);return db[_0x0e01('0x46')]['create'](_[_0x0e01('0x44')](_0x245f1b,_0x48fa73['body']),{'include':_0x48fa73['query'][_0x0e01('0x47')]?[{'all':!![]}]:undefined})[_0x0e01('0x2b')](function(_0x2cef7e){var _0x399fc8=_0x48fa73[_0x0e01('0x52')]['get']({'plain':!![]});if(!_0x399fc8)throw new Error(_0x0e01('0x53'));if(_0x399fc8[_0x0e01('0x54')]==='user'){var _0x341383=_0x2cef7e[_0x0e01('0x2c')]({'plain':!![]});var _0x518991=_0x0e01('0x2d');return db[_0x0e01('0x55')][_0x0e01('0x4f')]({'where':{'name':_0x518991,'userProfileId':_0x399fc8[_0x0e01('0x56')]},'raw':!![]})[_0x0e01('0x2b')](function(_0x5b242b){if(_0x5b242b&&_0x5b242b[_0x0e01('0x5c')]===0x0){return db[_0x0e01('0x2e')][_0x0e01('0x50')]({'name':_0x341383[_0x0e01('0x30')],'resourceId':_0x341383['id'],'type':_0x5b242b[_0x0e01('0x30')],'sectionId':_0x5b242b['id']},{})[_0x0e01('0x2b')](function(){return _0x2cef7e;});}else{return _0x2cef7e;}})['catch'](function(_0x5f1aa8){logger[_0x0e01('0x5d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5f1aa8);throw _0x5f1aa8;});}return _0x2cef7e;});}})[_0x0e01('0x2b')](respondWithResult(_0x47c06b,0xc9))[_0x0e01('0x4b')](handleError(_0x47c06b,null));};exports['update']=function(_0x4664d2,_0x440684){if(_0x4664d2[_0x0e01('0x51')]['id']){delete _0x4664d2[_0x0e01('0x51')]['id'];}return db[_0x0e01('0x46')][_0x0e01('0x4f')]({'where':{'id':_0x4664d2[_0x0e01('0x4d')]['id']}})[_0x0e01('0x2b')](handleEntityNotFound(_0x440684,null))[_0x0e01('0x2b')](saveUpdates(_0x4664d2[_0x0e01('0x51')],null))[_0x0e01('0x2b')](respondWithResult(_0x440684,null))[_0x0e01('0x4b')](handleError(_0x440684,null));};exports[_0x0e01('0x2f')]=function(_0x283f84,_0x4a58b4){return db[_0x0e01('0x46')]['find']({'where':{'id':_0x283f84['params']['id']}})['then'](handleEntityNotFound(_0x4a58b4,null))[_0x0e01('0x2b')](removeEntity(_0x4a58b4,null))[_0x0e01('0x4b')](handleError(_0x4a58b4,null));};function widgetAttributes(_0xebf4e3){try{switch(_0xebf4e3[_0x0e01('0x34')]){case'iframe':return[{'name':_0x0e01('0x5e'),'value':_0xebf4e3[_0x0e01('0x5e')]||(_0xebf4e3[_0x0e01('0x5f')]&&_0xebf4e3[_0x0e01('0x5f')][0x0]?_0xebf4e3[_0x0e01('0x5f')][0x0][_0x0e01('0x60')]:undefined)||_0x0e01('0x61')}];case _0x0e01('0x62'):return[{'name':'attrPath','value':_0xebf4e3['attrPath']||(_0xebf4e3['attrs']&&_0xebf4e3[_0x0e01('0x5f')][0x0]?_0xebf4e3[_0x0e01('0x5f')][0x0][_0x0e01('0x60')]:undefined)||''}];case'clock':return[{'name':_0x0e01('0x63'),'value':_0xebf4e3['attrHourFormat']||(_0xebf4e3[_0x0e01('0x5f')]&&_0xebf4e3[_0x0e01('0x5f')][0x0]?_0xebf4e3[_0x0e01('0x5f')][0x0]['value']:undefined)||_0x0e01('0x64')},{'name':_0x0e01('0x65'),'value':_0xebf4e3[_0x0e01('0x65')]||(_0xebf4e3['attrs']&&_0xebf4e3[_0x0e01('0x5f')][0x1]?_0xebf4e3[_0x0e01('0x5f')][0x1]['value']:undefined)||_0x0e01('0x66')},{'name':'attrFontSize','value':_0xebf4e3[_0x0e01('0x67')]||(_0xebf4e3[_0x0e01('0x5f')]&&_0xebf4e3['attrs'][0x2]?_0xebf4e3[_0x0e01('0x5f')][0x2]['value']:undefined)||0xc}];case'counter':return[{'name':'attrMetric','value':_0xebf4e3[_0x0e01('0x68')]||(_0xebf4e3['attrs']&&_0xebf4e3[_0x0e01('0x5f')][0x0]?_0xebf4e3['attrs'][0x0][_0x0e01('0x60')]:undefined)||_0x0e01('0x69')},{'name':_0x0e01('0x6a'),'value':_0xebf4e3['attrVoiceQueues']||(_0xebf4e3[_0x0e01('0x5f')]&&_0xebf4e3[_0x0e01('0x5f')][0x1]?_0xebf4e3[_0x0e01('0x5f')][0x1][_0x0e01('0x60')]:undefined)||[]},{'name':_0x0e01('0x67'),'value':_0xebf4e3[_0x0e01('0x67')]||(_0xebf4e3['attrs']&&_0xebf4e3[_0x0e01('0x5f')][0x2]?_0xebf4e3[_0x0e01('0x5f')][0x2][_0x0e01('0x60')]:undefined)||0x14},{'name':_0x0e01('0x6b'),'value':_0xebf4e3[_0x0e01('0x6b')]||(_0xebf4e3[_0x0e01('0x5f')]&&_0xebf4e3[_0x0e01('0x5f')][0x3]?_0xebf4e3[_0x0e01('0x5f')][0x3][_0x0e01('0x60')]:undefined)||_0x0e01('0x6c')},{'name':_0x0e01('0x6d'),'value':_0xebf4e3[_0x0e01('0x6d')]||(_0xebf4e3[_0x0e01('0x5f')]&&_0xebf4e3[_0x0e01('0x5f')][0x4]?_0xebf4e3[_0x0e01('0x5f')][0x4][_0x0e01('0x60')]:undefined)||''},{'name':_0x0e01('0x6e'),'value':_0xebf4e3['attrFaxAccounts']||(_0xebf4e3[_0x0e01('0x5f')]&&_0xebf4e3['attrs'][0x5]?_0xebf4e3[_0x0e01('0x5f')][0x5][_0x0e01('0x60')]:undefined)||''},{'name':_0x0e01('0x6f'),'value':_0xebf4e3[_0x0e01('0x6f')]||(_0xebf4e3[_0x0e01('0x5f')]&&_0xebf4e3[_0x0e01('0x5f')][0x6]?_0xebf4e3[_0x0e01('0x5f')][0x6][_0x0e01('0x60')]:undefined)||''},{'name':_0x0e01('0x70'),'value':_0xebf4e3[_0x0e01('0x70')]||(_0xebf4e3['attrs']&&_0xebf4e3['attrs'][0x7]?_0xebf4e3['attrs'][0x7][_0x0e01('0x60')]:undefined)||''},{'name':_0x0e01('0x71'),'value':_0xebf4e3[_0x0e01('0x71')]||(_0xebf4e3[_0x0e01('0x5f')]&&_0xebf4e3[_0x0e01('0x5f')][0x8]?_0xebf4e3[_0x0e01('0x5f')][0x8][_0x0e01('0x60')]:undefined)||''},{'name':_0x0e01('0x72'),'value':_0xebf4e3[_0x0e01('0x72')]||(_0xebf4e3[_0x0e01('0x5f')]&&_0xebf4e3[_0x0e01('0x5f')][0x9]?_0xebf4e3[_0x0e01('0x5f')][0x9][_0x0e01('0x60')]:undefined)||''}];case _0x0e01('0x73'):case _0x0e01('0x74'):return[{'name':_0x0e01('0x75'),'value':_0xebf4e3[_0x0e01('0x75')]||(_0xebf4e3[_0x0e01('0x5f')]&&_0xebf4e3[_0x0e01('0x5f')][0x0]?_0xebf4e3[_0x0e01('0x5f')][0x0][_0x0e01('0x60')]:undefined)||_0x0e01('0x69')},{'name':_0x0e01('0x76'),'value':_0xebf4e3[_0x0e01('0x76')]||(_0xebf4e3[_0x0e01('0x5f')]&&_0xebf4e3['attrs'][0x1]?_0xebf4e3[_0x0e01('0x5f')][0x1][_0x0e01('0x60')]:undefined)||null},{'name':_0x0e01('0x77'),'value':_0xebf4e3[_0x0e01('0x77')]||(_0xebf4e3[_0x0e01('0x5f')]&&_0xebf4e3[_0x0e01('0x5f')][0x2]?_0xebf4e3[_0x0e01('0x5f')][0x2][_0x0e01('0x60')]:undefined)||null},{'name':'attrVoiceQueues','value':_0xebf4e3[_0x0e01('0x6a')]||(_0xebf4e3[_0x0e01('0x5f')]&&_0xebf4e3[_0x0e01('0x5f')][0x3]?_0xebf4e3[_0x0e01('0x5f')][0x3][_0x0e01('0x60')]:undefined)||[]},{'name':_0x0e01('0x6b'),'value':_0xebf4e3[_0x0e01('0x6b')]||(_0xebf4e3['attrs']&&_0xebf4e3[_0x0e01('0x5f')][0x4]?_0xebf4e3['attrs'][0x4]['value']:undefined)||_0x0e01('0x6c')},{'name':_0x0e01('0x6d'),'value':_0xebf4e3[_0x0e01('0x6d')]||(_0xebf4e3[_0x0e01('0x5f')]&&_0xebf4e3[_0x0e01('0x5f')][0x5]?_0xebf4e3['attrs'][0x5][_0x0e01('0x60')]:undefined)||''},{'name':_0x0e01('0x6e'),'value':_0xebf4e3[_0x0e01('0x6e')]||(_0xebf4e3[_0x0e01('0x5f')]&&_0xebf4e3['attrs'][0x6]?_0xebf4e3[_0x0e01('0x5f')][0x6]['value']:undefined)||''},{'name':_0x0e01('0x6f'),'value':_0xebf4e3['attrSmsAccounts']||(_0xebf4e3[_0x0e01('0x5f')]&&_0xebf4e3[_0x0e01('0x5f')][0x7]?_0xebf4e3[_0x0e01('0x5f')][0x7][_0x0e01('0x60')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0xebf4e3[_0x0e01('0x70')]||(_0xebf4e3[_0x0e01('0x5f')]&&_0xebf4e3[_0x0e01('0x5f')][0x8]?_0xebf4e3[_0x0e01('0x5f')][0x8]['value']:undefined)||''},{'name':_0x0e01('0x71'),'value':_0xebf4e3['attrWhatsappAccounts']||(_0xebf4e3[_0x0e01('0x5f')]&&_0xebf4e3[_0x0e01('0x5f')][0x9]?_0xebf4e3['attrs'][0x9][_0x0e01('0x60')]:undefined)||''},{'name':_0x0e01('0x72'),'value':_0xebf4e3['attrChatWebsites']||(_0xebf4e3['attrs']&&_0xebf4e3['attrs'][0xa]?_0xebf4e3['attrs'][0xa][_0x0e01('0x60')]:undefined)||''}];case _0x0e01('0x78'):return[{'name':'attrReport','type':_0xebf4e3[_0x0e01('0x79')]||(_0xebf4e3[_0x0e01('0x5f')]&&_0xebf4e3[_0x0e01('0x5f')][0x0]?_0xebf4e3['attrs'][0x0][_0x0e01('0x34')]:undefined)||null,'value':_0xebf4e3['attrReport']||(_0xebf4e3[_0x0e01('0x5f')]&&_0xebf4e3[_0x0e01('0x5f')][0x0]?_0xebf4e3[_0x0e01('0x5f')][0x0][_0x0e01('0x60')]:undefined)||null},{'name':_0x0e01('0x7a'),'value':_0xebf4e3['attrRefresh']||(_0xebf4e3[_0x0e01('0x5f')]&&_0xebf4e3['attrs'][0x1]?_0xebf4e3[_0x0e01('0x5f')][0x1][_0x0e01('0x60')]:undefined)||0x0}];default:return[];}}catch(_0x23466f){logger[_0x0e01('0x5d')]('widgetAttributes:\x20%s',JSON[_0x0e01('0x7b')](_0x23466f));return[];}}exports['addItem']=function(_0x361efa,_0x3d7a62,_0x32a382){if(_0x361efa[_0x0e01('0x51')]['id']){delete _0x361efa['body']['id'];}return db[_0x0e01('0x46')][_0x0e01('0x4f')]({'where':{'id':_0x361efa[_0x0e01('0x4d')]['id']}})[_0x0e01('0x2b')](handleEntityNotFound(_0x3d7a62,null))['then'](function(_0xdce58){if(_0xdce58){_0x361efa[_0x0e01('0x51')][_0x0e01('0x7c')]=_0xdce58['id'];_0x361efa[_0x0e01('0x51')][_0x0e01('0x5f')]=widgetAttributes(_0x361efa[_0x0e01('0x51')]);return db[_0x0e01('0x7d')][_0x0e01('0x50')](_0x361efa[_0x0e01('0x51')]);}})[_0x0e01('0x2b')](respondWithResult(_0x3d7a62,null))[_0x0e01('0x4b')](handleError(_0x3d7a62,null));};exports[_0x0e01('0x7e')]=function(_0x14842b,_0x299b0f,_0x2a317b){var _0x297416={};var _0xd7c742={};var _0x20e0c7;var _0x4f2645;return db['Dashboard']['findOne']({'where':{'id':_0x14842b['params']['id']}})[_0x0e01('0x2b')](handleEntityNotFound(_0x299b0f,null))[_0x0e01('0x2b')](function(_0x342bd4){if(_0x342bd4){_0x20e0c7=_0x342bd4;_0xd7c742[_0x0e01('0x36')]=_[_0x0e01('0x38')](db[_0x0e01('0x7d')][_0x0e01('0x4e')]);_0xd7c742[_0x0e01('0x37')]=_[_0x0e01('0x38')](_0x14842b[_0x0e01('0x37')]);_0xd7c742[_0x0e01('0x39')]=_['intersection'](_0xd7c742[_0x0e01('0x36')],_0xd7c742[_0x0e01('0x37')]);_0x297416[_0x0e01('0x3a')]=_[_0x0e01('0x3b')](_0xd7c742[_0x0e01('0x36')],qs[_0x0e01('0x3c')](_0x14842b['query'][_0x0e01('0x3c')]));_0x297416['attributes']=_0x297416[_0x0e01('0x3a')]['length']?_0x297416[_0x0e01('0x3a')]:_0xd7c742[_0x0e01('0x36')];_0x297416[_0x0e01('0x7f')]=qs[_0x0e01('0x3f')](_0x14842b[_0x0e01('0x37')]['sort']);_0x297416[_0x0e01('0x40')]=qs[_0x0e01('0x39')](_[_0x0e01('0x41')](_0x14842b[_0x0e01('0x37')],_0xd7c742[_0x0e01('0x39')]));if(_0x14842b[_0x0e01('0x37')][_0x0e01('0x42')]){_0x297416[_0x0e01('0x40')]=_['merge'](_0x297416[_0x0e01('0x40')],{'$or':_[_0x0e01('0x32')](_0x297416[_0x0e01('0x3a')],function(_0x45d46a){var _0x8a056c={};_0x8a056c[_0x45d46a]={'$like':'%'+_0x14842b[_0x0e01('0x37')][_0x0e01('0x42')]+'%'};return _0x8a056c;})});}_0x297416=_[_0x0e01('0x44')]({},_0x297416,_0x14842b['options']);return _0x20e0c7[_0x0e01('0x7e')](_0x297416);}})[_0x0e01('0x2b')](function(_0x37946a){if(_0x37946a){_0x4f2645=_0x37946a[_0x0e01('0x59')];if(!_0x14842b['query'][_0x0e01('0x3d')](_0x0e01('0x3e'))){_0x297416[_0x0e01('0x23')]=qs[_0x0e01('0x23')](_0x14842b[_0x0e01('0x37')]['limit']);_0x297416[_0x0e01('0x21')]=qs[_0x0e01('0x21')](_0x14842b[_0x0e01('0x37')][_0x0e01('0x21')]);}return _0x20e0c7['getItems'](_0x297416);}})[_0x0e01('0x2b')](function(_0x20d1b9){if(_0x20d1b9){return _0x20d1b9?{'count':_0x4f2645,'rows':_0x20d1b9}:null;}})['then'](respondWithResult(_0x299b0f,null))[_0x0e01('0x4b')](handleError(_0x299b0f,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index f08b854..7d5c614 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 _0x6385=['update','emit','hook','events','setMaxListeners','save'];(function(_0x22183e,_0x3c249b){var _0x440d4d=function(_0x141356){while(--_0x141356){_0x22183e['push'](_0x22183e['shift']());}};_0x440d4d(++_0x3c249b);}(_0x6385,0xf9));var _0x5638=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x6385[_0x2e4aa2];return _0x5e6092;};'use strict';var EventEmitter=require(_0x5638('0x0'));var Dashboard=require('../../mysqldb')['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x5638('0x1')](0x0);var events={'afterCreate':_0x5638('0x2'),'afterUpdate':_0x5638('0x3'),'afterDestroy':'remove'};function emitEvent(_0x96a5d8){return function(_0x10a1d2,_0x206d27,_0xf7c4a6){DashboardEvents['emit'](_0x96a5d8+':'+_0x10a1d2['id'],_0x10a1d2);DashboardEvents[_0x5638('0x4')](_0x96a5d8,_0x10a1d2);_0xf7c4a6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0x5638('0x5')](e,emitEvent(event));}}module['exports']=DashboardEvents; \ No newline at end of file +var _0x1261=['update','remove','hasOwnProperty','hook','../../mysqldb','Dashboard','setMaxListeners','save'];(function(_0xbb5ed6,_0x5f2644){var _0x3604f5=function(_0x532d98){while(--_0x532d98){_0xbb5ed6['push'](_0xbb5ed6['shift']());}};_0x3604f5(++_0x5f2644);}(_0x1261,0x144));var _0x1126=function(_0x401b3e,_0xed8de5){_0x401b3e=_0x401b3e-0x0;var _0x4f290f=_0x1261[_0x401b3e];return _0x4f290f;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0x1126('0x0'))['db'][_0x1126('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x1126('0x2')](0x0);var events={'afterCreate':_0x1126('0x3'),'afterUpdate':_0x1126('0x4'),'afterDestroy':_0x1126('0x5')};function emitEvent(_0x3cc93f){return function(_0x4245ca,_0x21a480,_0x75a851){DashboardEvents['emit'](_0x3cc93f+':'+_0x4245ca['id'],_0x4245ca);DashboardEvents['emit'](_0x3cc93f,_0x4245ca);_0x75a851(null);};}for(var e in events){if(events[_0x1126('0x6')](e)){var event=events[e];Dashboard[_0x1126('0x7')](e,emitEvent(event));}}module['exports']=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 08b6afd..1b72740 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 _0xbffb=['api','bluebird','path','rimraf','../../config/environment','./dashboard.attributes','exports','define','Dashboard','dashboards','lodash','util','../../config/logger'];(function(_0x38b9c2,_0x47604f){var _0x26fa7f=function(_0x353c9a){while(--_0x353c9a){_0x38b9c2['push'](_0x38b9c2['shift']());}};_0x26fa7f(++_0x47604f);}(_0xbffb,0x1b7));var _0xbbff=function(_0x53c7d4,_0x51997b){_0x53c7d4=_0x53c7d4-0x0;var _0x2a5b5a=_0xbffb[_0x53c7d4];return _0x2a5b5a;};'use strict';var _=require(_0xbbff('0x0'));var util=require(_0xbbff('0x1'));var logger=require(_0xbbff('0x2'))(_0xbbff('0x3'));var moment=require('moment');var BPromise=require(_0xbbff('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbbff('0x5'));var rimraf=require(_0xbbff('0x6'));var config=require(_0xbbff('0x7'));var attributes=require(_0xbbff('0x8'));module[_0xbbff('0x9')]=function(_0x4e62f2,_0x2e3262){return _0x4e62f2[_0xbbff('0xa')](_0xbbff('0xb'),attributes,{'tableName':_0xbbff('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9d29=['path','rimraf','exports','define','Dashboard','dashboards','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9d29,0xf8));var _0x99d2=function(_0x2135a8,_0x2d5706){_0x2135a8=_0x2135a8-0x0;var _0x3dd593=_0x9d29[_0x2135a8];return _0x3dd593;};'use strict';var _=require(_0x99d2('0x0'));var util=require('util');var logger=require(_0x99d2('0x1'))(_0x99d2('0x2'));var moment=require('moment');var BPromise=require(_0x99d2('0x3'));var rp=require(_0x99d2('0x4'));var fs=require('fs');var path=require(_0x99d2('0x5'));var rimraf=require(_0x99d2('0x6'));var config=require('../../config/environment');var attributes=require('./dashboard.attributes');module[_0x99d2('0x7')]=function(_0x5de53c,_0x2e0845){return _0x5de53c[_0x99d2('0x8')](_0x99d2('0x9'),attributes,{'tableName':_0x99d2('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 ceedde4..49cbe93 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 _0xfe77=['message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','socket.io-emitter','register','request','then','info','Dashboard,\x20%s,\x20%s','debug','Dashboard,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x2229c5,_0x33404c){var _0x547c61=function(_0x4751f8){while(--_0x4751f8){_0x2229c5['push'](_0x2229c5['shift']());}};_0x547c61(++_0x33404c);}(_0xfe77,0x73));var _0x7fe7=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xfe77[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7fe7('0x0'));var util=require(_0x7fe7('0x1'));var moment=require('moment');var BPromise=require(_0x7fe7('0x2'));var rs=require(_0x7fe7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7fe7('0x4'))['db'];var utils=require(_0x7fe7('0x5'));var logger=require(_0x7fe7('0x6'))(_0x7fe7('0x7'));var config=require('../../config/environment');var jayson=require(_0x7fe7('0x8'));var client=jayson[_0x7fe7('0x9')][_0x7fe7('0xa')]({'port':0x232a});config['redis']=_[_0x7fe7('0xb')](config[_0x7fe7('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x7fe7('0xd'))(new Redis(config[_0x7fe7('0xc')]));require('./dashboard.socket')[_0x7fe7('0xe')](socket);function respondWithRpcPromise(_0x248049,_0x124856,_0x1d105a){return new BPromise(function(_0x1fe7d5,_0x5d6b8d){return client[_0x7fe7('0xf')](_0x248049,_0x1d105a)[_0x7fe7('0x10')](function(_0x1e3439){logger[_0x7fe7('0x11')](_0x7fe7('0x12'),_0x124856,'request\x20sent');logger[_0x7fe7('0x13')](_0x7fe7('0x14'),_0x124856,_0x7fe7('0x15'),JSON[_0x7fe7('0x16')](_0x1e3439));if(_0x1e3439[_0x7fe7('0x17')]){if(_0x1e3439[_0x7fe7('0x17')][_0x7fe7('0x18')]===0x1f4){logger[_0x7fe7('0x17')](_0x7fe7('0x12'),_0x124856,_0x1e3439[_0x7fe7('0x17')]['message']);return _0x5d6b8d(_0x1e3439[_0x7fe7('0x17')][_0x7fe7('0x19')]);}logger[_0x7fe7('0x17')]('Dashboard,\x20%s,\x20%s',_0x124856,_0x1e3439[_0x7fe7('0x17')][_0x7fe7('0x19')]);return _0x1fe7d5(_0x1e3439['error'][_0x7fe7('0x19')]);}else{logger[_0x7fe7('0x11')](_0x7fe7('0x12'),_0x124856,'request\x20sent');_0x1fe7d5(_0x1e3439[_0x7fe7('0x1a')][_0x7fe7('0x19')]);}})[_0x7fe7('0x1b')](function(_0x32b588){logger[_0x7fe7('0x17')](_0x7fe7('0x12'),_0x124856,_0x32b588);_0x5d6b8d(_0x32b588);});});} \ No newline at end of file +var _0x83df=['request','then','Dashboard,\x20%s,\x20%s','request\x20sent','Dashboard,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register'];(function(_0x4b92f0,_0x5255d3){var _0x1626a3=function(_0x3bf2a4){while(--_0x3bf2a4){_0x4b92f0['push'](_0x4b92f0['shift']());}};_0x1626a3(++_0x5255d3);}(_0x83df,0x169));var _0xf83d=function(_0x409d51,_0x1f0de6){_0x409d51=_0x409d51-0x0;var _0x13eb4b=_0x83df[_0x409d51];return _0x13eb4b;};'use strict';var _=require(_0xf83d('0x0'));var util=require(_0xf83d('0x1'));var moment=require(_0xf83d('0x2'));var BPromise=require(_0xf83d('0x3'));var rs=require(_0xf83d('0x4'));var fs=require('fs');var Redis=require(_0xf83d('0x5'));var db=require(_0xf83d('0x6'))['db'];var utils=require(_0xf83d('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xf83d('0x8'));var client=jayson[_0xf83d('0x9')][_0xf83d('0xa')]({'port':0x232a});config[_0xf83d('0xb')]=_[_0xf83d('0xc')](config[_0xf83d('0xb')],{'host':_0xf83d('0xd'),'port':0x18eb});var socket=require(_0xf83d('0xe'))(new Redis(config[_0xf83d('0xb')]));require(_0xf83d('0xf'))[_0xf83d('0x10')](socket);function respondWithRpcPromise(_0x489d12,_0x209cf7,_0x283d3b){return new BPromise(function(_0x47ffdd,_0x532e59){return client[_0xf83d('0x11')](_0x489d12,_0x283d3b)[_0xf83d('0x12')](function(_0x5ab9b8){logger['info'](_0xf83d('0x13'),_0x209cf7,_0xf83d('0x14'));logger['debug'](_0xf83d('0x15'),_0x209cf7,_0xf83d('0x14'),JSON['stringify'](_0x5ab9b8));if(_0x5ab9b8[_0xf83d('0x16')]){if(_0x5ab9b8['error']['code']===0x1f4){logger['error'](_0xf83d('0x13'),_0x209cf7,_0x5ab9b8['error'][_0xf83d('0x17')]);return _0x532e59(_0x5ab9b8[_0xf83d('0x16')]['message']);}logger[_0xf83d('0x16')]('Dashboard,\x20%s,\x20%s',_0x209cf7,_0x5ab9b8['error'][_0xf83d('0x17')]);return _0x47ffdd(_0x5ab9b8[_0xf83d('0x16')]['message']);}else{logger[_0xf83d('0x18')](_0xf83d('0x13'),_0x209cf7,'request\x20sent');_0x47ffdd(_0x5ab9b8[_0xf83d('0x19')][_0xf83d('0x17')]);}})[_0xf83d('0x1a')](function(_0x270708){logger[_0xf83d('0x16')](_0xf83d('0x13'),_0x209cf7,_0x270708);_0x532e59(_0x270708);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index ae069bf..0d649d0 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 _0xe8b7=['dashboard:','./dashboard.events','save','remove','update','emit','removeListener','register','length'];(function(_0x448bab,_0x25517b){var _0x5dc534=function(_0x2196ba){while(--_0x2196ba){_0x448bab['push'](_0x448bab['shift']());}};_0x5dc534(++_0x25517b);}(_0xe8b7,0xb5));var _0x7e8b=function(_0x39b370,_0xa3b0e5){_0x39b370=_0x39b370-0x0;var _0x1678a7=_0xe8b7[_0x39b370];return _0x1678a7;};'use strict';var DashboardEvents=require(_0x7e8b('0x0'));var events=[_0x7e8b('0x1'),_0x7e8b('0x2'),_0x7e8b('0x3')];function createListener(_0x491c82,_0x4b5b73){return function(_0x5ddef9){_0x4b5b73[_0x7e8b('0x4')](_0x491c82,_0x5ddef9);};}function removeListener(_0x551272,_0x4c52a0){return function(){DashboardEvents[_0x7e8b('0x5')](_0x551272,_0x4c52a0);};}exports[_0x7e8b('0x6')]=function(_0x105906){for(var _0x4c30d7=0x0,_0x43efed=events[_0x7e8b('0x7')];_0x4c30d7<_0x43efed;_0x4c30d7++){var _0x4d772e=events[_0x4c30d7];var _0x402531=createListener(_0x7e8b('0x8')+_0x4d772e,_0x105906);DashboardEvents['on'](_0x4d772e,_0x402531);}}; \ No newline at end of file +var _0x9100=['update','emit','removeListener','register','length','dashboard:','./dashboard.events','save','remove'];(function(_0x4e2308,_0x16ae02){var _0x1daf9c=function(_0x109e61){while(--_0x109e61){_0x4e2308['push'](_0x4e2308['shift']());}};_0x1daf9c(++_0x16ae02);}(_0x9100,0x84));var _0x0910=function(_0x13ce59,_0x1b842c){_0x13ce59=_0x13ce59-0x0;var _0x49c759=_0x9100[_0x13ce59];return _0x49c759;};'use strict';var DashboardEvents=require(_0x0910('0x0'));var events=[_0x0910('0x1'),_0x0910('0x2'),_0x0910('0x3')];function createListener(_0x4def7c,_0x2ae3bd){return function(_0x5012ef){_0x2ae3bd[_0x0910('0x4')](_0x4def7c,_0x5012ef);};}function removeListener(_0x37ae00,_0x3d4566){return function(){DashboardEvents[_0x0910('0x5')](_0x37ae00,_0x3d4566);};}exports[_0x0910('0x6')]=function(_0xc22233){for(var _0x143349=0x0,_0x3b1ee0=events[_0x0910('0x7')];_0x143349<_0x3b1ee0;_0x143349++){var _0x5a4425=events[_0x143349];var _0x4c12a4=createListener(_0x0910('0x8')+_0x5a4425,_0xc22233);DashboardEvents['on'](_0x5a4425,_0x4c12a4);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index a468dae..1628df6 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 _0x8816=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','show','post','create','/:id/clone','clone','/:id/items','addItem','put','/:id','multer','util','path'];(function(_0x494223,_0x2c1f71){var _0xdaf98=function(_0x1f790e){while(--_0x1f790e){_0x494223['push'](_0x494223['shift']());}};_0xdaf98(++_0x2c1f71);}(_0x8816,0x90));var _0x6881=function(_0x1bf2c2,_0x6f3632){_0x1bf2c2=_0x1bf2c2-0x0;var _0x384ef3=_0x8816[_0x1bf2c2];return _0x384ef3;};'use strict';var multer=require(_0x6881('0x0'));var util=require(_0x6881('0x1'));var path=require(_0x6881('0x2'));var timeout=require('connect-timeout');var express=require(_0x6881('0x3'));var router=express[_0x6881('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6881('0x5'));var interaction=require(_0x6881('0x6'));var config=require(_0x6881('0x7'));var controller=require(_0x6881('0x8'));router[_0x6881('0x9')]('/',auth[_0x6881('0xa')](),controller[_0x6881('0xb')]);router[_0x6881('0x9')]('/:id',auth[_0x6881('0xa')](),controller[_0x6881('0xc')]);router[_0x6881('0x9')]('/:id/items',auth['isAuthenticated'](),controller['getItems']);router[_0x6881('0xd')]('/',auth['isAuthenticated'](),controller[_0x6881('0xe')]);router[_0x6881('0xd')](_0x6881('0xf'),auth[_0x6881('0xa')](),controller[_0x6881('0x10')]);router[_0x6881('0xd')](_0x6881('0x11'),auth['isAuthenticated'](),controller[_0x6881('0x12')]);router[_0x6881('0x13')](_0x6881('0x14'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x6881('0x14'),auth[_0x6881('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xfbe4=['put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./dashboard.controller','isAuthenticated','index','get','/:id','show','/:id/items','getItems','post','create','/:id/clone','clone','addItem'];(function(_0x16202a,_0x3aa1fb){var _0x230d11=function(_0x10130b){while(--_0x10130b){_0x16202a['push'](_0x16202a['shift']());}};_0x230d11(++_0x3aa1fb);}(_0xfbe4,0xf3));var _0x4fbe=function(_0x12d4aa,_0xf9ad5){_0x12d4aa=_0x12d4aa-0x0;var _0x1d4b5d=_0xfbe4[_0x12d4aa];return _0x1d4b5d;};'use strict';var multer=require(_0x4fbe('0x0'));var util=require(_0x4fbe('0x1'));var path=require(_0x4fbe('0x2'));var timeout=require(_0x4fbe('0x3'));var express=require(_0x4fbe('0x4'));var router=express[_0x4fbe('0x5')]();var fs_extra=require(_0x4fbe('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4fbe('0x7'));var controller=require(_0x4fbe('0x8'));router['get']('/',auth[_0x4fbe('0x9')](),controller[_0x4fbe('0xa')]);router[_0x4fbe('0xb')](_0x4fbe('0xc'),auth[_0x4fbe('0x9')](),controller[_0x4fbe('0xd')]);router[_0x4fbe('0xb')](_0x4fbe('0xe'),auth[_0x4fbe('0x9')](),controller[_0x4fbe('0xf')]);router[_0x4fbe('0x10')]('/',auth[_0x4fbe('0x9')](),controller[_0x4fbe('0x11')]);router[_0x4fbe('0x10')](_0x4fbe('0x12'),auth[_0x4fbe('0x9')](),controller[_0x4fbe('0x13')]);router['post'](_0x4fbe('0xe'),auth[_0x4fbe('0x9')](),controller[_0x4fbe('0x14')]);router[_0x4fbe('0x15')](_0x4fbe('0xc'),auth['isAuthenticated'](),controller[_0x4fbe('0x16')]);router[_0x4fbe('0x17')](_0x4fbe('0xc'),auth[_0x4fbe('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index b8f654a..8b73eb3 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 _0x71ab=['setDataValue','stringify','INTEGER','#2196f3','squel','exports','STRING','TEXT','long','parse','getDataValue','attrs'];(function(_0x318256,_0xa773f3){var _0xb1e352=function(_0x4bb14e){while(--_0x4bb14e){_0x318256['push'](_0x318256['shift']());}};_0xb1e352(++_0xa773f3);}(_0x71ab,0x64));var _0xb71a=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x71ab[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require('sequelize');var squel=require(_0xb71a('0x0'));var _=require('lodash');module[_0xb71a('0x1')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb71a('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xb71a('0x3')](_0xb71a('0x4')),'get':function(){try{return JSON[_0xb71a('0x5')](this[_0xb71a('0x6')](_0xb71a('0x7')));}catch(_0x2192e8){return[];}},'set':function(_0x38d931){try{this[_0xb71a('0x8')](_0xb71a('0x7'),JSON[_0xb71a('0x9')](_0x38d931));}catch(_0x2a4c86){this[_0xb71a('0x8')](_0xb71a('0x7'),JSON[_0xb71a('0x9')]([]));}}},'sizeX':{'type':Sequelize[_0xb71a('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xb71a('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xb71a('0xa')]},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize[_0xb71a('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xb71a('0x2')],'allowNull':![],'defaultValue':_0xb71a('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xb71a('0x2')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file +var _0xc4aa=['getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3','sequelize','squel','lodash','exports','STRING'];(function(_0x144114,_0x5f0b0d){var _0x2d84f5=function(_0x2a71c8){while(--_0x2a71c8){_0x144114['push'](_0x144114['shift']());}};_0x2d84f5(++_0x5f0b0d);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0xc4aa[_0x3511d3];return _0x5d6321;};'use strict';var Sequelize=require(_0xac4a('0x0'));var squel=require(_0xac4a('0x1'));var _=require(_0xac4a('0x2'));module[_0xac4a('0x3')]={'title':{'type':Sequelize[_0xac4a('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0xac4a('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT']('long'),'get':function(){try{return JSON['parse'](this[_0xac4a('0x5')](_0xac4a('0x6')));}catch(_0x730a38){return[];}},'set':function(_0x215f39){try{this[_0xac4a('0x7')](_0xac4a('0x6'),JSON[_0xac4a('0x8')](_0x215f39));}catch(_0x10525b){this['setDataValue']('attrs',JSON[_0xac4a('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0xac4a('0x9')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xac4a('0x9')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0xac4a('0x9')]},'background':{'type':Sequelize[_0xac4a('0x4')],'allowNull':![],'defaultValue':_0xac4a('0xa'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xac4a('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize[_0xac4a('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 f2e4726..aba4e47 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 _0x0024=['./dashboardItem.socket','register','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','save','update','destroy','then','error','stack','name','show','params','model','keys','DashboardItem','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','options','catch','find','iframe','attrUrl','value','attrPath','attrs','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrOpenchannelAccounts','attrChatWebsites','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrSmsAccounts','attrWhatsappAccounts','web-report','attrReport','reportType','type','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','rimraf','fast-json-patch','moment','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter'];(function(_0x339912,_0x43c859){var _0x35e346=function(_0x111e8d){while(--_0x111e8d){_0x339912['push'](_0x339912['shift']());}};_0x35e346(++_0x43c859);}(_0x0024,0xa8));var _0x4002=function(_0x114bdb,_0x5cd54f){_0x114bdb=_0x114bdb-0x0;var _0x38b98e=_0x0024[_0x114bdb];return _0x38b98e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4002('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4002('0x1'));var rp=require('request-promise');var moment=require(_0x4002('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4002('0x3'));var path=require(_0x4002('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4002('0x5'));var fs=require('fs');var fs_extra=require(_0x4002('0x6'));var _=require(_0x4002('0x7'));var squel=require(_0x4002('0x8'));var crypto=require('crypto');var jsforce=require(_0x4002('0x9'));var deskjs=require(_0x4002('0xa'));var toCsv=require(_0x4002('0xb'));var querystring=require(_0x4002('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4002('0xd'));var qs=require(_0x4002('0xe'));var as=require(_0x4002('0xf'));var hardwareService=require(_0x4002('0x10'));var logger=require(_0x4002('0x11'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4002('0x12'));var db=require(_0x4002('0x13'))['db'];config[_0x4002('0x14')]=_[_0x4002('0x15')](config['redis'],{'host':_0x4002('0x16'),'port':0x18eb});var socket=require(_0x4002('0x17'))(new Redis(config[_0x4002('0x14')]));require(_0x4002('0x18'))[_0x4002('0x19')](socket);function respondWithStatusCode(_0x50a1a8,_0x77b4c0){_0x77b4c0=_0x77b4c0||0xcc;return function(_0x4fe0b5){if(_0x4fe0b5){return _0x50a1a8[_0x4002('0x1a')](_0x77b4c0);}return _0x50a1a8[_0x4002('0x1b')](_0x77b4c0)[_0x4002('0x1c')]();};}function respondWithResult(_0x5813ff,_0x43a7e1){_0x43a7e1=_0x43a7e1||0xc8;return function(_0x5c4a33){if(_0x5c4a33){return _0x5813ff['status'](_0x43a7e1)[_0x4002('0x1d')](_0x5c4a33);}};}function respondWithFilteredResult(_0x3facc1,_0x4c0071){return function(_0x1b3401){if(_0x1b3401){var _0x4d5754=typeof _0x4c0071['offset']==='undefined'&&typeof _0x4c0071[_0x4002('0x1e')]===_0x4002('0x1f');var _0x283708=_0x1b3401[_0x4002('0x20')];var _0x514dfe=_0x4d5754?0x0:_0x4c0071[_0x4002('0x21')];var _0x1a5364=_0x4d5754?_0x1b3401[_0x4002('0x20')]:_0x4c0071['offset']+_0x4c0071[_0x4002('0x1e')];var _0x51b709;if(_0x1a5364>=_0x283708){_0x1a5364=_0x283708;_0x51b709=0xc8;}else{_0x51b709=0xce;}_0x3facc1[_0x4002('0x1b')](_0x51b709);return _0x3facc1[_0x4002('0x22')](_0x4002('0x23'),_0x514dfe+'-'+_0x1a5364+'/'+_0x283708)['json'](_0x1b3401);}return null;};}function patchUpdates(_0x52add8){return function(_0x447851){try{jsonpatch[_0x4002('0x24')](_0x447851,_0x52add8,!![]);}catch(_0x254b67){return BPromise['reject'](_0x254b67);}return _0x447851[_0x4002('0x25')]();};}function saveUpdates(_0x27732c,_0x18b000){return function(_0x23e917){if(_0x23e917){return _0x23e917[_0x4002('0x26')](_0x27732c)['then'](function(_0x3396d8){return _0x3396d8;});}return null;};}function removeEntity(_0x1dfb81,_0x385c35){return function(_0x425b3f){if(_0x425b3f){return _0x425b3f[_0x4002('0x27')]()[_0x4002('0x28')](function(){_0x1dfb81['status'](0xcc)[_0x4002('0x1c')]();});}};}function handleEntityNotFound(_0x2d148e,_0x49e273){return function(_0xf5ae88){if(!_0xf5ae88){_0x2d148e[_0x4002('0x1a')](0x194);}return _0xf5ae88;};}function handleError(_0x569154,_0xa7b46a){_0xa7b46a=_0xa7b46a||0x1f4;return function(_0x278907){logger[_0x4002('0x29')](_0x278907[_0x4002('0x2a')]);if(_0x278907[_0x4002('0x2b')]){delete _0x278907[_0x4002('0x2b')];}_0x569154[_0x4002('0x1b')](_0xa7b46a)['send'](_0x278907);};}exports[_0x4002('0x2c')]=function(_0x162173,_0x237704){var _0x598048={'raw':![],'where':{'id':_0x162173[_0x4002('0x2d')]['id']}},_0x52f488={};_0x52f488[_0x4002('0x2e')]=_[_0x4002('0x2f')](db[_0x4002('0x30')][_0x4002('0x31')]);_0x52f488[_0x4002('0x32')]=_[_0x4002('0x2f')](_0x162173[_0x4002('0x32')]);_0x52f488[_0x4002('0x33')]=_[_0x4002('0x34')](_0x52f488['model'],_0x52f488[_0x4002('0x32')]);_0x598048[_0x4002('0x35')]=_[_0x4002('0x34')](_0x52f488['model'],qs[_0x4002('0x36')](_0x162173[_0x4002('0x32')][_0x4002('0x36')]));_0x598048['attributes']=_0x598048[_0x4002('0x35')][_0x4002('0x37')]?_0x598048[_0x4002('0x35')]:_0x52f488[_0x4002('0x2e')];if(_0x162173[_0x4002('0x32')][_0x4002('0x38')]){_0x598048[_0x4002('0x39')]=[{'all':!![]}];}_0x598048=_['merge']({},_0x598048,_0x162173[_0x4002('0x3a')]);return db[_0x4002('0x30')]['find'](_0x598048)['then'](handleEntityNotFound(_0x237704,null))[_0x4002('0x28')](respondWithResult(_0x237704,null))[_0x4002('0x3b')](handleError(_0x237704,null));};exports[_0x4002('0x27')]=function(_0x5e412,_0x94ecc3){return db[_0x4002('0x30')][_0x4002('0x3c')]({'where':{'id':_0x5e412[_0x4002('0x2d')]['id']}})['then'](handleEntityNotFound(_0x94ecc3,null))[_0x4002('0x28')](removeEntity(_0x94ecc3,null))[_0x4002('0x3b')](handleError(_0x94ecc3,null));};function widgetAttributes(_0x3c1330){try{switch(_0x3c1330['type']){case _0x4002('0x3d'):return[{'name':'attrUrl','value':_0x3c1330[_0x4002('0x3e')]||(_0x3c1330['attrs']&&_0x3c1330['attrs'][0x0]?_0x3c1330['attrs'][0x0][_0x4002('0x3f')]:undefined)||'https://'}];case'custom':return[{'name':'attrPath','value':_0x3c1330[_0x4002('0x40')]||(_0x3c1330[_0x4002('0x41')]&&_0x3c1330[_0x4002('0x41')][0x0]?_0x3c1330['attrs'][0x0][_0x4002('0x3f')]:undefined)||''}];case _0x4002('0x42'):return[{'name':_0x4002('0x43'),'value':_0x3c1330[_0x4002('0x43')]||(_0x3c1330[_0x4002('0x41')]&&_0x3c1330[_0x4002('0x41')][0x0]?_0x3c1330['attrs'][0x0][_0x4002('0x3f')]:undefined)||_0x4002('0x44')},{'name':_0x4002('0x45'),'value':_0x3c1330[_0x4002('0x45')]||(_0x3c1330[_0x4002('0x41')]&&_0x3c1330['attrs'][0x1]?_0x3c1330[_0x4002('0x41')][0x1]['value']:undefined)||_0x4002('0x46')},{'name':_0x4002('0x47'),'value':_0x3c1330['attrFontSize']||(_0x3c1330['attrs']&&_0x3c1330[_0x4002('0x41')][0x2]?_0x3c1330[_0x4002('0x41')][0x2]['value']:undefined)||0xc}];case'counter':return[{'name':_0x4002('0x48'),'value':_0x3c1330[_0x4002('0x48')]||(_0x3c1330['attrs']&&_0x3c1330[_0x4002('0x41')][0x0]?_0x3c1330[_0x4002('0x41')][0x0][_0x4002('0x3f')]:undefined)||_0x4002('0x49')},{'name':_0x4002('0x4a'),'value':_0x3c1330[_0x4002('0x4a')]||(_0x3c1330[_0x4002('0x41')]&&_0x3c1330[_0x4002('0x41')][0x1]?_0x3c1330['attrs'][0x1]['value']:undefined)||[]},{'name':'attrFontSize','value':_0x3c1330[_0x4002('0x47')]||(_0x3c1330['attrs']&&_0x3c1330[_0x4002('0x41')][0x2]?_0x3c1330['attrs'][0x2][_0x4002('0x3f')]:undefined)||0x14},{'name':_0x4002('0x4b'),'value':_0x3c1330[_0x4002('0x4b')]||(_0x3c1330['attrs']&&_0x3c1330[_0x4002('0x41')][0x3]?_0x3c1330['attrs'][0x3]['value']:undefined)||_0x4002('0x4c')},{'name':_0x4002('0x4d'),'value':_0x3c1330[_0x4002('0x4d')]||(_0x3c1330[_0x4002('0x41')]&&_0x3c1330['attrs'][0x4]?_0x3c1330['attrs'][0x4][_0x4002('0x3f')]:undefined)||''},{'name':_0x4002('0x4e'),'value':_0x3c1330[_0x4002('0x4e')]||(_0x3c1330['attrs']&&_0x3c1330[_0x4002('0x41')][0x5]?_0x3c1330['attrs'][0x5][_0x4002('0x3f')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x3c1330['attrSmsAccounts']||(_0x3c1330[_0x4002('0x41')]&&_0x3c1330[_0x4002('0x41')][0x6]?_0x3c1330['attrs'][0x6][_0x4002('0x3f')]:undefined)||''},{'name':_0x4002('0x4f'),'value':_0x3c1330[_0x4002('0x4f')]||(_0x3c1330[_0x4002('0x41')]&&_0x3c1330['attrs'][0x7]?_0x3c1330['attrs'][0x7][_0x4002('0x3f')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x3c1330['attrWhatsappAccounts']||(_0x3c1330['attrs']&&_0x3c1330[_0x4002('0x41')][0x8]?_0x3c1330[_0x4002('0x41')][0x8]['value']:undefined)||''},{'name':_0x4002('0x50'),'value':_0x3c1330[_0x4002('0x50')]||(_0x3c1330[_0x4002('0x41')]&&_0x3c1330[_0x4002('0x41')][0x9]?_0x3c1330[_0x4002('0x41')][0x9][_0x4002('0x3f')]:undefined)||''}];case'multibar-chart':case _0x4002('0x51'):return[{'name':_0x4002('0x52'),'value':_0x3c1330['attrSerie1']||(_0x3c1330[_0x4002('0x41')]&&_0x3c1330[_0x4002('0x41')][0x0]?_0x3c1330['attrs'][0x0][_0x4002('0x3f')]:undefined)||_0x4002('0x49')},{'name':_0x4002('0x53'),'value':_0x3c1330[_0x4002('0x53')]||(_0x3c1330['attrs']&&_0x3c1330[_0x4002('0x41')][0x1]?_0x3c1330[_0x4002('0x41')][0x1][_0x4002('0x3f')]:undefined)||null},{'name':_0x4002('0x54'),'value':_0x3c1330[_0x4002('0x54')]||(_0x3c1330[_0x4002('0x41')]&&_0x3c1330[_0x4002('0x41')][0x2]?_0x3c1330[_0x4002('0x41')][0x2][_0x4002('0x3f')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x3c1330[_0x4002('0x4a')]||(_0x3c1330['attrs']&&_0x3c1330['attrs'][0x3]?_0x3c1330[_0x4002('0x41')][0x3]['value']:undefined)||[]},{'name':_0x4002('0x4b'),'value':_0x3c1330[_0x4002('0x4b')]||(_0x3c1330[_0x4002('0x41')]&&_0x3c1330[_0x4002('0x41')][0x4]?_0x3c1330[_0x4002('0x41')][0x4][_0x4002('0x3f')]:undefined)||_0x4002('0x4c')},{'name':_0x4002('0x4d'),'value':_0x3c1330[_0x4002('0x4d')]||(_0x3c1330[_0x4002('0x41')]&&_0x3c1330[_0x4002('0x41')][0x5]?_0x3c1330[_0x4002('0x41')][0x5][_0x4002('0x3f')]:undefined)||''},{'name':_0x4002('0x4e'),'value':_0x3c1330[_0x4002('0x4e')]||(_0x3c1330[_0x4002('0x41')]&&_0x3c1330[_0x4002('0x41')][0x6]?_0x3c1330[_0x4002('0x41')][0x6][_0x4002('0x3f')]:undefined)||''},{'name':_0x4002('0x55'),'value':_0x3c1330[_0x4002('0x55')]||(_0x3c1330[_0x4002('0x41')]&&_0x3c1330[_0x4002('0x41')][0x7]?_0x3c1330[_0x4002('0x41')][0x7][_0x4002('0x3f')]:undefined)||''},{'name':_0x4002('0x4f'),'value':_0x3c1330[_0x4002('0x4f')]||(_0x3c1330[_0x4002('0x41')]&&_0x3c1330[_0x4002('0x41')][0x8]?_0x3c1330[_0x4002('0x41')][0x8][_0x4002('0x3f')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x3c1330[_0x4002('0x56')]||(_0x3c1330[_0x4002('0x41')]&&_0x3c1330['attrs'][0x9]?_0x3c1330[_0x4002('0x41')][0x9]['value']:undefined)||''},{'name':'attrChatWebsites','value':_0x3c1330[_0x4002('0x50')]||(_0x3c1330[_0x4002('0x41')]&&_0x3c1330[_0x4002('0x41')][0xa]?_0x3c1330['attrs'][0xa]['value']:undefined)||''}];case _0x4002('0x57'):return[{'name':_0x4002('0x58'),'type':_0x3c1330[_0x4002('0x59')]||(_0x3c1330['attrs']&&_0x3c1330['attrs'][0x0]?_0x3c1330[_0x4002('0x41')][0x0][_0x4002('0x5a')]:undefined)||null,'value':_0x3c1330['attrReport']||(_0x3c1330[_0x4002('0x41')]&&_0x3c1330[_0x4002('0x41')][0x0]?_0x3c1330[_0x4002('0x41')][0x0]['value']:undefined)||null},{'name':_0x4002('0x5b'),'value':_0x3c1330[_0x4002('0x5b')]||(_0x3c1330[_0x4002('0x41')]&&_0x3c1330['attrs'][0x1]?_0x3c1330[_0x4002('0x41')][0x1][_0x4002('0x3f')]:undefined)||0x0}];default:return[];}}catch(_0x51a951){logger[_0x4002('0x29')](_0x4002('0x5c'),JSON[_0x4002('0x5d')](_0x51a951));return[];}}exports[_0x4002('0x5e')]=function(_0x5d1c12,_0x57922d){if(_0x5d1c12[_0x4002('0x5f')]){_0x5d1c12['body'][_0x4002('0x41')]=widgetAttributes(_0x5d1c12[_0x4002('0x5f')]);}return db[_0x4002('0x30')][_0x4002('0x5e')](_0x5d1c12['body'],{})[_0x4002('0x28')](respondWithResult(_0x57922d,0xc9))['catch'](handleError(_0x57922d,null));};exports[_0x4002('0x26')]=function(_0x4f596d,_0x2c0af7){if(_0x4f596d['body']['id']){delete _0x4f596d[_0x4002('0x5f')]['id'];}_0x4f596d['body'][_0x4002('0x41')]=widgetAttributes(_0x4f596d[_0x4002('0x5f')]);return db[_0x4002('0x30')][_0x4002('0x3c')]({'where':{'id':_0x4f596d[_0x4002('0x2d')]['id']}})['then'](handleEntityNotFound(_0x2c0af7,null))[_0x4002('0x28')](saveUpdates(_0x4f596d['body'],null))[_0x4002('0x28')](respondWithResult(_0x2c0af7,null))[_0x4002('0x3b')](handleError(_0x2c0af7,null));}; \ No newline at end of file +var _0xed5c=['attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','multibar-chart','attrSerie1','attrSerie2','attrSerie3','attrVoiceQueues','attrChannel','attrChatWebsites','web-report','attrReport','reportType','attrRefresh','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','json','offset','limit','undefined','set','Content-Range','apply','reject','save','update','then','end','error','name','params','model','DashboardItem','query','keys','intersection','attributes','fields','length','include','merge','catch','destroy','find','type','iframe','attrUrl'];(function(_0x270aca,_0x399721){var _0x440bae=function(_0x2e74ab){while(--_0x2e74ab){_0x270aca['push'](_0x270aca['shift']());}};_0x440bae(++_0x399721);}(_0xed5c,0x81));var _0xced5=function(_0x451791,_0xa72858){_0x451791=_0x451791-0x0;var _0x2997a4=_0xed5c[_0x451791];return _0x2997a4;};'use strict';var emlformat=require(_0xced5('0x0'));var rimraf=require(_0xced5('0x1'));var zipdir=require(_0xced5('0x2'));var jsonpatch=require(_0xced5('0x3'));var rp=require(_0xced5('0x4'));var moment=require(_0xced5('0x5'));var BPromise=require(_0xced5('0x6'));var Mustache=require(_0xced5('0x7'));var util=require(_0xced5('0x8'));var path=require(_0xced5('0x9'));var sox=require('sox');var csv=require(_0xced5('0xa'));var ejs=require(_0xced5('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xced5('0xc'));var crypto=require(_0xced5('0xd'));var jsforce=require(_0xced5('0xe'));var deskjs=require(_0xced5('0xf'));var toCsv=require(_0xced5('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xced5('0x10'));var authService=require(_0xced5('0x11'));var qs=require(_0xced5('0x12'));var as=require(_0xced5('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xced5('0x14'))('api');var utils=require(_0xced5('0x15'));var config=require(_0xced5('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xced5('0x17'))['db'];config['redis']=_[_0xced5('0x18')](config[_0xced5('0x19')],{'host':_0xced5('0x1a'),'port':0x18eb});var socket=require(_0xced5('0x1b'))(new Redis(config[_0xced5('0x19')]));require(_0xced5('0x1c'))[_0xced5('0x1d')](socket);function respondWithStatusCode(_0x4bee02,_0x4b2533){_0x4b2533=_0x4b2533||0xcc;return function(_0x23ca09){if(_0x23ca09){return _0x4bee02[_0xced5('0x1e')](_0x4b2533);}return _0x4bee02[_0xced5('0x1f')](_0x4b2533)['end']();};}function respondWithResult(_0x4fa2a3,_0x456843){_0x456843=_0x456843||0xc8;return function(_0x1c8c90){if(_0x1c8c90){return _0x4fa2a3[_0xced5('0x1f')](_0x456843)[_0xced5('0x20')](_0x1c8c90);}};}function respondWithFilteredResult(_0x17e4eb,_0x13928f){return function(_0x54c5a4){if(_0x54c5a4){var _0x29a3ba=typeof _0x13928f[_0xced5('0x21')]==='undefined'&&typeof _0x13928f[_0xced5('0x22')]===_0xced5('0x23');var _0x14e3ec=_0x54c5a4['count'];var _0x127eb4=_0x29a3ba?0x0:_0x13928f[_0xced5('0x21')];var _0x2a5aca=_0x29a3ba?_0x54c5a4['count']:_0x13928f[_0xced5('0x21')]+_0x13928f[_0xced5('0x22')];var _0xf84ec;if(_0x2a5aca>=_0x14e3ec){_0x2a5aca=_0x14e3ec;_0xf84ec=0xc8;}else{_0xf84ec=0xce;}_0x17e4eb[_0xced5('0x1f')](_0xf84ec);return _0x17e4eb[_0xced5('0x24')](_0xced5('0x25'),_0x127eb4+'-'+_0x2a5aca+'/'+_0x14e3ec)['json'](_0x54c5a4);}return null;};}function patchUpdates(_0x1ba520){return function(_0x4a56a4){try{jsonpatch[_0xced5('0x26')](_0x4a56a4,_0x1ba520,!![]);}catch(_0x5b11c5){return BPromise[_0xced5('0x27')](_0x5b11c5);}return _0x4a56a4[_0xced5('0x28')]();};}function saveUpdates(_0x1c18e0,_0x45766f){return function(_0xe536f8){if(_0xe536f8){return _0xe536f8[_0xced5('0x29')](_0x1c18e0)[_0xced5('0x2a')](function(_0x2f092b){return _0x2f092b;});}return null;};}function removeEntity(_0x548cbb,_0x92ac47){return function(_0x4de26f){if(_0x4de26f){return _0x4de26f['destroy']()[_0xced5('0x2a')](function(){_0x548cbb[_0xced5('0x1f')](0xcc)[_0xced5('0x2b')]();});}};}function handleEntityNotFound(_0x2e4774,_0xb13ed6){return function(_0x26790a){if(!_0x26790a){_0x2e4774[_0xced5('0x1e')](0x194);}return _0x26790a;};}function handleError(_0x13575a,_0x239b32){_0x239b32=_0x239b32||0x1f4;return function(_0x364a15){logger[_0xced5('0x2c')](_0x364a15['stack']);if(_0x364a15[_0xced5('0x2d')]){delete _0x364a15[_0xced5('0x2d')];}_0x13575a['status'](_0x239b32)['send'](_0x364a15);};}exports['show']=function(_0x551325,_0x45f839){var _0x2f7cd4={'raw':![],'where':{'id':_0x551325[_0xced5('0x2e')]['id']}},_0x9d2fee={};_0x9d2fee[_0xced5('0x2f')]=_['keys'](db[_0xced5('0x30')]['rawAttributes']);_0x9d2fee[_0xced5('0x31')]=_[_0xced5('0x32')](_0x551325['query']);_0x9d2fee['filters']=_[_0xced5('0x33')](_0x9d2fee['model'],_0x9d2fee[_0xced5('0x31')]);_0x2f7cd4[_0xced5('0x34')]=_[_0xced5('0x33')](_0x9d2fee[_0xced5('0x2f')],qs[_0xced5('0x35')](_0x551325[_0xced5('0x31')][_0xced5('0x35')]));_0x2f7cd4['attributes']=_0x2f7cd4[_0xced5('0x34')][_0xced5('0x36')]?_0x2f7cd4['attributes']:_0x9d2fee[_0xced5('0x2f')];if(_0x551325[_0xced5('0x31')]['includeAll']){_0x2f7cd4[_0xced5('0x37')]=[{'all':!![]}];}_0x2f7cd4=_[_0xced5('0x38')]({},_0x2f7cd4,_0x551325['options']);return db[_0xced5('0x30')]['find'](_0x2f7cd4)[_0xced5('0x2a')](handleEntityNotFound(_0x45f839,null))['then'](respondWithResult(_0x45f839,null))[_0xced5('0x39')](handleError(_0x45f839,null));};exports[_0xced5('0x3a')]=function(_0x5b12fb,_0x5ba805){return db[_0xced5('0x30')][_0xced5('0x3b')]({'where':{'id':_0x5b12fb['params']['id']}})[_0xced5('0x2a')](handleEntityNotFound(_0x5ba805,null))[_0xced5('0x2a')](removeEntity(_0x5ba805,null))['catch'](handleError(_0x5ba805,null));};function widgetAttributes(_0x43c1d8){try{switch(_0x43c1d8[_0xced5('0x3c')]){case _0xced5('0x3d'):return[{'name':'attrUrl','value':_0x43c1d8[_0xced5('0x3e')]||(_0x43c1d8[_0xced5('0x3f')]&&_0x43c1d8[_0xced5('0x3f')][0x0]?_0x43c1d8['attrs'][0x0][_0xced5('0x40')]:undefined)||_0xced5('0x41')}];case _0xced5('0x42'):return[{'name':'attrPath','value':_0x43c1d8[_0xced5('0x43')]||(_0x43c1d8['attrs']&&_0x43c1d8[_0xced5('0x3f')][0x0]?_0x43c1d8[_0xced5('0x3f')][0x0][_0xced5('0x40')]:undefined)||''}];case _0xced5('0x44'):return[{'name':_0xced5('0x45'),'value':_0x43c1d8[_0xced5('0x45')]||(_0x43c1d8[_0xced5('0x3f')]&&_0x43c1d8['attrs'][0x0]?_0x43c1d8[_0xced5('0x3f')][0x0][_0xced5('0x40')]:undefined)||_0xced5('0x46')},{'name':'attrTimezone','value':_0x43c1d8[_0xced5('0x47')]||(_0x43c1d8['attrs']&&_0x43c1d8[_0xced5('0x3f')][0x1]?_0x43c1d8[_0xced5('0x3f')][0x1][_0xced5('0x40')]:undefined)||_0xced5('0x48')},{'name':_0xced5('0x49'),'value':_0x43c1d8[_0xced5('0x49')]||(_0x43c1d8[_0xced5('0x3f')]&&_0x43c1d8['attrs'][0x2]?_0x43c1d8[_0xced5('0x3f')][0x2]['value']:undefined)||0xc}];case _0xced5('0x4a'):return[{'name':_0xced5('0x4b'),'value':_0x43c1d8['attrMetric']||(_0x43c1d8[_0xced5('0x3f')]&&_0x43c1d8[_0xced5('0x3f')][0x0]?_0x43c1d8[_0xced5('0x3f')][0x0][_0xced5('0x40')]:undefined)||_0xced5('0x4c')},{'name':'attrVoiceQueues','value':_0x43c1d8['attrVoiceQueues']||(_0x43c1d8[_0xced5('0x3f')]&&_0x43c1d8['attrs'][0x1]?_0x43c1d8[_0xced5('0x3f')][0x1][_0xced5('0x40')]:undefined)||[]},{'name':_0xced5('0x49'),'value':_0x43c1d8[_0xced5('0x49')]||(_0x43c1d8[_0xced5('0x3f')]&&_0x43c1d8[_0xced5('0x3f')][0x2]?_0x43c1d8[_0xced5('0x3f')][0x2][_0xced5('0x40')]:undefined)||0x14},{'name':'attrChannel','value':_0x43c1d8['attrChannel']||(_0x43c1d8[_0xced5('0x3f')]&&_0x43c1d8[_0xced5('0x3f')][0x3]?_0x43c1d8[_0xced5('0x3f')][0x3][_0xced5('0x40')]:undefined)||_0xced5('0x4d')},{'name':_0xced5('0x4e'),'value':_0x43c1d8[_0xced5('0x4e')]||(_0x43c1d8[_0xced5('0x3f')]&&_0x43c1d8[_0xced5('0x3f')][0x4]?_0x43c1d8[_0xced5('0x3f')][0x4][_0xced5('0x40')]:undefined)||''},{'name':_0xced5('0x4f'),'value':_0x43c1d8['attrFaxAccounts']||(_0x43c1d8[_0xced5('0x3f')]&&_0x43c1d8[_0xced5('0x3f')][0x5]?_0x43c1d8[_0xced5('0x3f')][0x5][_0xced5('0x40')]:undefined)||''},{'name':_0xced5('0x50'),'value':_0x43c1d8[_0xced5('0x50')]||(_0x43c1d8['attrs']&&_0x43c1d8[_0xced5('0x3f')][0x6]?_0x43c1d8[_0xced5('0x3f')][0x6][_0xced5('0x40')]:undefined)||''},{'name':_0xced5('0x51'),'value':_0x43c1d8[_0xced5('0x51')]||(_0x43c1d8[_0xced5('0x3f')]&&_0x43c1d8[_0xced5('0x3f')][0x7]?_0x43c1d8[_0xced5('0x3f')][0x7]['value']:undefined)||''},{'name':_0xced5('0x52'),'value':_0x43c1d8[_0xced5('0x52')]||(_0x43c1d8[_0xced5('0x3f')]&&_0x43c1d8[_0xced5('0x3f')][0x8]?_0x43c1d8[_0xced5('0x3f')][0x8][_0xced5('0x40')]:undefined)||''},{'name':'attrChatWebsites','value':_0x43c1d8['attrChatWebsites']||(_0x43c1d8[_0xced5('0x3f')]&&_0x43c1d8['attrs'][0x9]?_0x43c1d8[_0xced5('0x3f')][0x9]['value']:undefined)||''}];case _0xced5('0x53'):case'pie-chart':return[{'name':_0xced5('0x54'),'value':_0x43c1d8[_0xced5('0x54')]||(_0x43c1d8[_0xced5('0x3f')]&&_0x43c1d8[_0xced5('0x3f')][0x0]?_0x43c1d8[_0xced5('0x3f')][0x0][_0xced5('0x40')]:undefined)||_0xced5('0x4c')},{'name':_0xced5('0x55'),'value':_0x43c1d8['attrSerie2']||(_0x43c1d8[_0xced5('0x3f')]&&_0x43c1d8['attrs'][0x1]?_0x43c1d8[_0xced5('0x3f')][0x1][_0xced5('0x40')]:undefined)||null},{'name':'attrSerie3','value':_0x43c1d8[_0xced5('0x56')]||(_0x43c1d8['attrs']&&_0x43c1d8[_0xced5('0x3f')][0x2]?_0x43c1d8[_0xced5('0x3f')][0x2][_0xced5('0x40')]:undefined)||null},{'name':_0xced5('0x57'),'value':_0x43c1d8['attrVoiceQueues']||(_0x43c1d8[_0xced5('0x3f')]&&_0x43c1d8[_0xced5('0x3f')][0x3]?_0x43c1d8[_0xced5('0x3f')][0x3][_0xced5('0x40')]:undefined)||[]},{'name':_0xced5('0x58'),'value':_0x43c1d8['attrChannel']||(_0x43c1d8[_0xced5('0x3f')]&&_0x43c1d8[_0xced5('0x3f')][0x4]?_0x43c1d8[_0xced5('0x3f')][0x4][_0xced5('0x40')]:undefined)||_0xced5('0x4d')},{'name':_0xced5('0x4e'),'value':_0x43c1d8[_0xced5('0x4e')]||(_0x43c1d8[_0xced5('0x3f')]&&_0x43c1d8[_0xced5('0x3f')][0x5]?_0x43c1d8[_0xced5('0x3f')][0x5][_0xced5('0x40')]:undefined)||''},{'name':_0xced5('0x4f'),'value':_0x43c1d8[_0xced5('0x4f')]||(_0x43c1d8[_0xced5('0x3f')]&&_0x43c1d8[_0xced5('0x3f')][0x6]?_0x43c1d8[_0xced5('0x3f')][0x6][_0xced5('0x40')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x43c1d8[_0xced5('0x50')]||(_0x43c1d8[_0xced5('0x3f')]&&_0x43c1d8[_0xced5('0x3f')][0x7]?_0x43c1d8[_0xced5('0x3f')][0x7][_0xced5('0x40')]:undefined)||''},{'name':_0xced5('0x51'),'value':_0x43c1d8['attrOpenchannelAccounts']||(_0x43c1d8[_0xced5('0x3f')]&&_0x43c1d8['attrs'][0x8]?_0x43c1d8[_0xced5('0x3f')][0x8][_0xced5('0x40')]:undefined)||''},{'name':_0xced5('0x52'),'value':_0x43c1d8[_0xced5('0x52')]||(_0x43c1d8[_0xced5('0x3f')]&&_0x43c1d8[_0xced5('0x3f')][0x9]?_0x43c1d8['attrs'][0x9][_0xced5('0x40')]:undefined)||''},{'name':_0xced5('0x59'),'value':_0x43c1d8['attrChatWebsites']||(_0x43c1d8[_0xced5('0x3f')]&&_0x43c1d8['attrs'][0xa]?_0x43c1d8['attrs'][0xa][_0xced5('0x40')]:undefined)||''}];case _0xced5('0x5a'):return[{'name':_0xced5('0x5b'),'type':_0x43c1d8[_0xced5('0x5c')]||(_0x43c1d8['attrs']&&_0x43c1d8[_0xced5('0x3f')][0x0]?_0x43c1d8[_0xced5('0x3f')][0x0][_0xced5('0x3c')]:undefined)||null,'value':_0x43c1d8['attrReport']||(_0x43c1d8[_0xced5('0x3f')]&&_0x43c1d8[_0xced5('0x3f')][0x0]?_0x43c1d8['attrs'][0x0]['value']:undefined)||null},{'name':_0xced5('0x5d'),'value':_0x43c1d8[_0xced5('0x5d')]||(_0x43c1d8['attrs']&&_0x43c1d8['attrs'][0x1]?_0x43c1d8[_0xced5('0x3f')][0x1][_0xced5('0x40')]:undefined)||0x0}];default:return[];}}catch(_0x3fe1ee){logger['error']('widgetAttributes:\x20%s',JSON['stringify'](_0x3fe1ee));return[];}}exports[_0xced5('0x5e')]=function(_0x599327,_0x3a89b2){if(_0x599327[_0xced5('0x5f')]){_0x599327[_0xced5('0x5f')][_0xced5('0x3f')]=widgetAttributes(_0x599327[_0xced5('0x5f')]);}return db['DashboardItem'][_0xced5('0x5e')](_0x599327[_0xced5('0x5f')],{})[_0xced5('0x2a')](respondWithResult(_0x3a89b2,0xc9))['catch'](handleError(_0x3a89b2,null));};exports['update']=function(_0x11f8b3,_0x4dde63){if(_0x11f8b3['body']['id']){delete _0x11f8b3[_0xced5('0x5f')]['id'];}_0x11f8b3['body'][_0xced5('0x3f')]=widgetAttributes(_0x11f8b3['body']);return db[_0xced5('0x30')][_0xced5('0x3b')]({'where':{'id':_0x11f8b3[_0xced5('0x2e')]['id']}})[_0xced5('0x2a')](handleEntityNotFound(_0x4dde63,null))[_0xced5('0x2a')](saveUpdates(_0x11f8b3['body'],null))[_0xced5('0x2a')](respondWithResult(_0x4dde63,null))[_0xced5('0x39')](handleError(_0x4dde63,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index a001d23..63040ba 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 _0x9d6d=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','DashboardItem','setMaxListeners','save','update'];(function(_0x3e57ef,_0x388fab){var _0x5ade66=function(_0xcbbd3){while(--_0xcbbd3){_0x3e57ef['push'](_0x3e57ef['shift']());}};_0x5ade66(++_0x388fab);}(_0x9d6d,0xc2));var _0xd9d6=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x9d6d[_0x5b561d];return _0x431060;};'use strict';var EventEmitter=require(_0xd9d6('0x0'));var DashboardItem=require(_0xd9d6('0x1'))['db'][_0xd9d6('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xd9d6('0x3')](0x0);var events={'afterCreate':_0xd9d6('0x4'),'afterUpdate':_0xd9d6('0x5'),'afterDestroy':_0xd9d6('0x6')};function emitEvent(_0x3d80ae){return function(_0x5ed21b,_0x3e9b33,_0x4aab3e){DashboardItemEvents[_0xd9d6('0x7')](_0x3d80ae+':'+_0x5ed21b['id'],_0x5ed21b);DashboardItemEvents['emit'](_0x3d80ae,_0x5ed21b);_0x4aab3e(null);};}for(var e in events){if(events[_0xd9d6('0x8')](e)){var event=events[e];DashboardItem[_0xd9d6('0x9')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file +var _0x681d=['hook','exports','events','../../mysqldb','DashboardItem','save','update','remove','emit','hasOwnProperty'];(function(_0x33c7f2,_0x3baf8c){var _0x34cdf1=function(_0x87917c){while(--_0x87917c){_0x33c7f2['push'](_0x33c7f2['shift']());}};_0x34cdf1(++_0x3baf8c);}(_0x681d,0x138));var _0xd681=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0x681d[_0x11ce46];return _0x368a1e;};'use strict';var EventEmitter=require(_0xd681('0x0'));var DashboardItem=require(_0xd681('0x1'))['db'][_0xd681('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd681('0x3'),'afterUpdate':_0xd681('0x4'),'afterDestroy':_0xd681('0x5')};function emitEvent(_0x278e23){return function(_0x239c6d,_0x549db4,_0x5265b3){DashboardItemEvents[_0xd681('0x6')](_0x278e23+':'+_0x239c6d['id'],_0x239c6d);DashboardItemEvents['emit'](_0x278e23,_0x239c6d);_0x5265b3(null);};}for(var e in events){if(events[_0xd681('0x7')](e)){var event=events[e];DashboardItem[_0xd681('0x8')](e,emitEvent(event));}}module[_0xd681('0x9')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index fd9ebd2..0dbf751 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 _0x31ee=['./dashboardItem.attributes','exports','define','dashboard_items','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment'];(function(_0x5a13cd,_0x3e956d){var _0x42fc30=function(_0x4587e2){while(--_0x4587e2){_0x5a13cd['push'](_0x5a13cd['shift']());}};_0x42fc30(++_0x3e956d);}(_0x31ee,0xf4));var _0xe31e=function(_0x27831b,_0xad5a4c){_0x27831b=_0x27831b-0x0;var _0x9dc835=_0x31ee[_0x27831b];return _0x9dc835;};'use strict';var _=require(_0xe31e('0x0'));var util=require(_0xe31e('0x1'));var logger=require(_0xe31e('0x2'))(_0xe31e('0x3'));var moment=require(_0xe31e('0x4'));var BPromise=require('bluebird');var rp=require(_0xe31e('0x5'));var fs=require('fs');var path=require(_0xe31e('0x6'));var rimraf=require('rimraf');var config=require(_0xe31e('0x7'));var attributes=require(_0xe31e('0x8'));module[_0xe31e('0x9')]=function(_0x1483aa,_0x10de21){return _0x1483aa[_0xe31e('0xa')]('DashboardItem',attributes,{'tableName':_0xe31e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4a0c=['lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./dashboardItem.attributes','exports','define','dashboard_items'];(function(_0x434903,_0x2bae84){var _0x31021e=function(_0x176a5f){while(--_0x176a5f){_0x434903['push'](_0x434903['shift']());}};_0x31021e(++_0x2bae84);}(_0x4a0c,0xe4));var _0xc4a0=function(_0x358ad8,_0x1d3212){_0x358ad8=_0x358ad8-0x0;var _0x3b7a4d=_0x4a0c[_0x358ad8];return _0x3b7a4d;};'use strict';var _=require(_0xc4a0('0x0'));var util=require(_0xc4a0('0x1'));var logger=require(_0xc4a0('0x2'))(_0xc4a0('0x3'));var moment=require('moment');var BPromise=require(_0xc4a0('0x4'));var rp=require(_0xc4a0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc4a0('0x6'));var config=require(_0xc4a0('0x7'));var attributes=require(_0xc4a0('0x8'));module[_0xc4a0('0x9')]=function(_0x485095,_0xf20733){return _0x485095[_0xc4a0('0xa')]('DashboardItem',attributes,{'tableName':_0xc4a0('0xb'),'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 bef6d16..a0c328f 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 _0x5bee=['info','DashboardItem,\x20%s,\x20%s','request\x20sent','DashboardItem,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then'];(function(_0x4dead7,_0x30fdd5){var _0x254d4f=function(_0x343749){while(--_0x343749){_0x4dead7['push'](_0x4dead7['shift']());}};_0x254d4f(++_0x30fdd5);}(_0x5bee,0x165));var _0xe5be=function(_0x53b0ec,_0x125d81){_0x53b0ec=_0x53b0ec-0x0;var _0x1f7ff4=_0x5bee[_0x53b0ec];return _0x1f7ff4;};'use strict';var _=require(_0xe5be('0x0'));var util=require(_0xe5be('0x1'));var moment=require(_0xe5be('0x2'));var BPromise=require(_0xe5be('0x3'));var rs=require(_0xe5be('0x4'));var fs=require('fs');var Redis=require(_0xe5be('0x5'));var db=require(_0xe5be('0x6'))['db'];var utils=require(_0xe5be('0x7'));var logger=require(_0xe5be('0x8'))(_0xe5be('0x9'));var config=require(_0xe5be('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xe5be('0xb')][_0xe5be('0xc')]({'port':0x232a});config[_0xe5be('0xd')]=_[_0xe5be('0xe')](config['redis'],{'host':_0xe5be('0xf'),'port':0x18eb});var socket=require(_0xe5be('0x10'))(new Redis(config[_0xe5be('0xd')]));require('./dashboardItem.socket')[_0xe5be('0x11')](socket);function respondWithRpcPromise(_0x47bc4c,_0x2ae9e4,_0xc5f0cc){return new BPromise(function(_0x1bc6ac,_0x405768){return client[_0xe5be('0x12')](_0x47bc4c,_0xc5f0cc)[_0xe5be('0x13')](function(_0x5e77be){logger[_0xe5be('0x14')](_0xe5be('0x15'),_0x2ae9e4,_0xe5be('0x16'));logger['debug'](_0xe5be('0x17'),_0x2ae9e4,_0xe5be('0x16'),JSON['stringify'](_0x5e77be));if(_0x5e77be['error']){if(_0x5e77be[_0xe5be('0x18')][_0xe5be('0x19')]===0x1f4){logger[_0xe5be('0x18')]('DashboardItem,\x20%s,\x20%s',_0x2ae9e4,_0x5e77be['error']['message']);return _0x405768(_0x5e77be[_0xe5be('0x18')][_0xe5be('0x1a')]);}logger['error'](_0xe5be('0x15'),_0x2ae9e4,_0x5e77be[_0xe5be('0x18')][_0xe5be('0x1a')]);return _0x1bc6ac(_0x5e77be['error'][_0xe5be('0x1a')]);}else{logger[_0xe5be('0x14')]('DashboardItem,\x20%s,\x20%s',_0x2ae9e4,'request\x20sent');_0x1bc6ac(_0x5e77be[_0xe5be('0x1b')][_0xe5be('0x1a')]);}})[_0xe5be('0x1c')](function(_0x3aaba7){logger[_0xe5be('0x18')](_0xe5be('0x15'),_0x2ae9e4,_0x3aaba7);_0x405768(_0x3aaba7);});});} \ No newline at end of file +var _0x9645=['info','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','DashboardItem,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','redis','defaults','socket.io-emitter','./dashboardItem.socket','register','request','then'];(function(_0x451353,_0x19710b){var _0x102315=function(_0x51204c){while(--_0x51204c){_0x451353['push'](_0x451353['shift']());}};_0x102315(++_0x19710b);}(_0x9645,0x141));var _0x5964=function(_0x401676,_0x3f1436){_0x401676=_0x401676-0x0;var _0x4f13fe=_0x9645[_0x401676];return _0x4f13fe;};'use strict';var _=require(_0x5964('0x0'));var util=require(_0x5964('0x1'));var moment=require(_0x5964('0x2'));var BPromise=require(_0x5964('0x3'));var rs=require(_0x5964('0x4'));var fs=require('fs');var Redis=require(_0x5964('0x5'));var db=require(_0x5964('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5964('0x7'));var config=require(_0x5964('0x8'));var jayson=require(_0x5964('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x5964('0xa')]=_[_0x5964('0xb')](config[_0x5964('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x5964('0xc'))(new Redis(config[_0x5964('0xa')]));require(_0x5964('0xd'))[_0x5964('0xe')](socket);function respondWithRpcPromise(_0x22481d,_0x12ecb0,_0x173347){return new BPromise(function(_0x1493ab,_0x106764){return client[_0x5964('0xf')](_0x22481d,_0x173347)[_0x5964('0x10')](function(_0x50cf7d){logger[_0x5964('0x11')]('DashboardItem,\x20%s,\x20%s',_0x12ecb0,_0x5964('0x12'));logger[_0x5964('0x13')](_0x5964('0x14'),_0x12ecb0,_0x5964('0x12'),JSON[_0x5964('0x15')](_0x50cf7d));if(_0x50cf7d[_0x5964('0x16')]){if(_0x50cf7d[_0x5964('0x16')][_0x5964('0x17')]===0x1f4){logger['error'](_0x5964('0x18'),_0x12ecb0,_0x50cf7d[_0x5964('0x16')][_0x5964('0x19')]);return _0x106764(_0x50cf7d['error'][_0x5964('0x19')]);}logger[_0x5964('0x16')](_0x5964('0x18'),_0x12ecb0,_0x50cf7d[_0x5964('0x16')]['message']);return _0x1493ab(_0x50cf7d[_0x5964('0x16')][_0x5964('0x19')]);}else{logger[_0x5964('0x11')](_0x5964('0x18'),_0x12ecb0,_0x5964('0x12'));_0x1493ab(_0x50cf7d['result'][_0x5964('0x19')]);}})['catch'](function(_0xc6b212){logger['error'](_0x5964('0x18'),_0x12ecb0,_0xc6b212);_0x106764(_0xc6b212);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 49c89a1..3fcca09 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 _0x4ae4=['save','remove','update','emit','removeListener','register','length','dashboardItem:'];(function(_0x4dc7b9,_0x319d5a){var _0x3ab114=function(_0x51a9df){while(--_0x51a9df){_0x4dc7b9['push'](_0x4dc7b9['shift']());}};_0x3ab114(++_0x319d5a);}(_0x4ae4,0x1c0));var _0x44ae=function(_0x140479,_0x2bb4b4){_0x140479=_0x140479-0x0;var _0x1def3c=_0x4ae4[_0x140479];return _0x1def3c;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0x44ae('0x0'),_0x44ae('0x1'),_0x44ae('0x2')];function createListener(_0x1b9598,_0x2e8387){return function(_0x46e0ae){_0x2e8387[_0x44ae('0x3')](_0x1b9598,_0x46e0ae);};}function removeListener(_0x141199,_0x3402ab){return function(){DashboardItemEvents[_0x44ae('0x4')](_0x141199,_0x3402ab);};}exports[_0x44ae('0x5')]=function(_0x28f06e){for(var _0x4caa7e=0x0,_0x4a43f7=events[_0x44ae('0x6')];_0x4caa7e<_0x4a43f7;_0x4caa7e++){var _0x71e3b2=events[_0x4caa7e];var _0x5cc0d3=createListener(_0x44ae('0x7')+_0x71e3b2,_0x28f06e);DashboardItemEvents['on'](_0x71e3b2,_0x5cc0d3);}}; \ No newline at end of file +var _0x8e81=['remove','emit','removeListener','register','length','dashboardItem:','./dashboardItem.events'];(function(_0x41b0a8,_0x1b05cc){var _0x3a83d4=function(_0x3d1011){while(--_0x3d1011){_0x41b0a8['push'](_0x41b0a8['shift']());}};_0x3a83d4(++_0x1b05cc);}(_0x8e81,0x109));var _0x18e8=function(_0x290716,_0x3aa16a){_0x290716=_0x290716-0x0;var _0x200b47=_0x8e81[_0x290716];return _0x200b47;};'use strict';var DashboardItemEvents=require(_0x18e8('0x0'));var events=['save',_0x18e8('0x1'),'update'];function createListener(_0xcb6bae,_0x118b52){return function(_0x1ed5fd){_0x118b52[_0x18e8('0x2')](_0xcb6bae,_0x1ed5fd);};}function removeListener(_0x144d37,_0x55a271){return function(){DashboardItemEvents[_0x18e8('0x3')](_0x144d37,_0x55a271);};}exports[_0x18e8('0x4')]=function(_0x25640c){for(var _0x297a88=0x0,_0x57f4a3=events[_0x18e8('0x5')];_0x297a88<_0x57f4a3;_0x297a88++){var _0x16029b=events[_0x297a88];var _0x18128f=createListener(_0x18e8('0x6')+_0x16029b,_0x25640c);DashboardItemEvents['on'](_0x16029b,_0x18128f);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 5354186..c6dbe29 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 _0xf9a5=['../../components/interaction/service','../../config/environment','./dashboardItem.controller','isAuthenticated','post','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x5cb58e,_0x58e675){var _0x5c703e=function(_0x1c2cd4){while(--_0x1c2cd4){_0x5cb58e['push'](_0x5cb58e['shift']());}};_0x5c703e(++_0x58e675);}(_0xf9a5,0x170));var _0x5f9a=function(_0x5685f7,_0x53e368){_0x5685f7=_0x5685f7-0x0;var _0x446dab=_0xf9a5[_0x5685f7];return _0x446dab;};'use strict';var multer=require(_0x5f9a('0x0'));var util=require(_0x5f9a('0x1'));var path=require(_0x5f9a('0x2'));var timeout=require(_0x5f9a('0x3'));var express=require(_0x5f9a('0x4'));var router=express['Router']();var fs_extra=require(_0x5f9a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5f9a('0x6'));var config=require(_0x5f9a('0x7'));var controller=require(_0x5f9a('0x8'));router['get']('/:id',auth[_0x5f9a('0x9')](),controller['show']);router[_0x5f9a('0xa')]('/',auth[_0x5f9a('0x9')](),controller['create']);router[_0x5f9a('0xb')](_0x5f9a('0xc'),auth[_0x5f9a('0x9')](),controller[_0x5f9a('0xd')]);router[_0x5f9a('0xe')]('/:id',auth[_0x5f9a('0x9')](),controller[_0x5f9a('0xf')]);module[_0x5f9a('0x10')]=router; \ No newline at end of file +var _0xcd66=['create','put','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./dashboardItem.controller','get','/:id','show','isAuthenticated'];(function(_0x431ced,_0xa25cc9){var _0xfa5ded=function(_0x3d5f40){while(--_0x3d5f40){_0x431ced['push'](_0x431ced['shift']());}};_0xfa5ded(++_0xa25cc9);}(_0xcd66,0x1e0));var _0x6cd6=function(_0x2bb4e6,_0x487536){_0x2bb4e6=_0x2bb4e6-0x0;var _0x1eabf0=_0xcd66[_0x2bb4e6];return _0x1eabf0;};'use strict';var multer=require(_0x6cd6('0x0'));var util=require(_0x6cd6('0x1'));var path=require(_0x6cd6('0x2'));var timeout=require(_0x6cd6('0x3'));var express=require('express');var router=express[_0x6cd6('0x4')]();var fs_extra=require(_0x6cd6('0x5'));var auth=require(_0x6cd6('0x6'));var interaction=require(_0x6cd6('0x7'));var config=require('../../config/environment');var controller=require(_0x6cd6('0x8'));router[_0x6cd6('0x9')](_0x6cd6('0xa'),auth['isAuthenticated'](),controller[_0x6cd6('0xb')]);router['post']('/',auth[_0x6cd6('0xc')](),controller[_0x6cd6('0xd')]);router[_0x6cd6('0xe')](_0x6cd6('0xa'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x6cd6('0xc')](),controller[_0x6cd6('0xf')]);module[_0x6cd6('0x10')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 9ab4453..ed52322 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 _0xa7ef=['STRING','ENUM','first','second','sequelize','exports'];(function(_0x54f353,_0x478ad0){var _0x1efc86=function(_0x1956b7){while(--_0x1956b7){_0x54f353['push'](_0x54f353['shift']());}};_0x1efc86(++_0x478ad0);}(_0xa7ef,0x14e));var _0xfa7e=function(_0x4839d8,_0x4803cb){_0x4839d8=_0x4839d8-0x0;var _0x144326=_0xa7ef[_0x4839d8];return _0x144326;};'use strict';var Sequelize=require(_0xfa7e('0x0'));module[_0xfa7e('0x1')]={'name':{'type':Sequelize[_0xfa7e('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0xfa7e('0x3')](_0xfa7e('0x4'),_0xfa7e('0x5'),'third'),'allowNull':![],'defaultValue':_0xfa7e('0x4')},'description':{'type':Sequelize[_0xfa7e('0x2')]}}; \ No newline at end of file +var _0x051f=['first','third','exports','STRING','ENUM'];(function(_0x2fc988,_0x38cee6){var _0x3626b9=function(_0x2d9445){while(--_0x2d9445){_0x2fc988['push'](_0x2fc988['shift']());}};_0x3626b9(++_0x38cee6);}(_0x051f,0x138));var _0xf051=function(_0x5875ee,_0x1265f4){_0x5875ee=_0x5875ee-0x0;var _0x3e1462=_0x051f[_0x5875ee];return _0x3e1462;};'use strict';var Sequelize=require('sequelize');module[_0xf051('0x0')]={'name':{'type':Sequelize[_0xf051('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0xf051('0x2')](_0xf051('0x3'),'second',_0xf051('0x4')),'allowNull':![],'defaultValue':_0xf051('0x3')},'description':{'type':Sequelize[_0xf051('0x1')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index a6d826f..b1ae846 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 _0x9de8=['../../mysqldb','status','json','offset','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','Dispositions','UserProfileResource','then','end','sendStatus','error','stack','name','send','index','Disposition','rawAttributes','type','key','model','map','query','keys','intersection','attributes','fields','length','order','filters','filter','where','VIRTUAL','merge','options','include','findAll','catch','show','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x3e0fd6,_0x47ef6f){var _0x1b4744=function(_0x5723bd){while(--_0x5723bd){_0x3e0fd6['push'](_0x3e0fd6['shift']());}};_0x1b4744(++_0x47ef6f);}(_0x9de8,0x88));var _0x89de=function(_0x207417,_0x3f96a2){_0x207417=_0x207417-0x0;var _0x1c7975=_0x9de8[_0x207417];return _0x1c7975;};'use strict';var emlformat=require(_0x89de('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x89de('0x1'));var jsonpatch=require(_0x89de('0x2'));var rp=require('request-promise');var moment=require(_0x89de('0x3'));var BPromise=require(_0x89de('0x4'));var Mustache=require(_0x89de('0x5'));var util=require(_0x89de('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x89de('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x89de('0x8'));var crypto=require('crypto');var jsforce=require(_0x89de('0x9'));var deskjs=require(_0x89de('0xa'));var toCsv=require(_0x89de('0x7'));var querystring=require(_0x89de('0xb'));var Papa=require('papaparse');var Redis=require(_0x89de('0xc'));var authService=require(_0x89de('0xd'));var qs=require(_0x89de('0xe'));var as=require(_0x89de('0xf'));var hardwareService=require(_0x89de('0x10'));var logger=require(_0x89de('0x11'))(_0x89de('0x12'));var utils=require(_0x89de('0x13'));var config=require(_0x89de('0x14'));var licenseUtil=require(_0x89de('0x15'));var db=require(_0x89de('0x16'))['db'];function respondWithStatusCode(_0x24a3bf,_0x3261f9){_0x3261f9=_0x3261f9||0xcc;return function(_0x3d02fc){if(_0x3d02fc){return _0x24a3bf['sendStatus'](_0x3261f9);}return _0x24a3bf[_0x89de('0x17')](_0x3261f9)['end']();};}function respondWithResult(_0x3b7ad7,_0x58979f){_0x58979f=_0x58979f||0xc8;return function(_0x186e72){if(_0x186e72){return _0x3b7ad7[_0x89de('0x17')](_0x58979f)[_0x89de('0x18')](_0x186e72);}};}function respondWithFilteredResult(_0x2a607f,_0x17b9e1){return function(_0x32f245){if(_0x32f245){var _0x2ccade=typeof _0x17b9e1[_0x89de('0x19')]==='undefined'&&typeof _0x17b9e1[_0x89de('0x1a')]==='undefined';var _0xe73bb8=_0x32f245[_0x89de('0x1b')];var _0x5c4700=_0x2ccade?0x0:_0x17b9e1['offset'];var _0x4980c2=_0x2ccade?_0x32f245['count']:_0x17b9e1[_0x89de('0x19')]+_0x17b9e1[_0x89de('0x1a')];var _0x498670;if(_0x4980c2>=_0xe73bb8){_0x4980c2=_0xe73bb8;_0x498670=0xc8;}else{_0x498670=0xce;}_0x2a607f[_0x89de('0x17')](_0x498670);return _0x2a607f[_0x89de('0x1c')](_0x89de('0x1d'),_0x5c4700+'-'+_0x4980c2+'/'+_0xe73bb8)[_0x89de('0x18')](_0x32f245);}return null;};}function patchUpdates(_0x4724c2){return function(_0x577536){try{jsonpatch[_0x89de('0x1e')](_0x577536,_0x4724c2,!![]);}catch(_0x5a54b1){return BPromise[_0x89de('0x1f')](_0x5a54b1);}return _0x577536[_0x89de('0x20')]();};}function saveUpdates(_0x2c7594,_0x2dba2e){return function(_0x280322){if(_0x280322){return _0x280322[_0x89de('0x21')](_0x2c7594)['then'](function(_0x3342c3){return _0x3342c3;});}return null;};}function removeEntity(_0x2b50c1,_0x1361a0){return function(_0x4bfbd5){if(_0x4bfbd5){return _0x4bfbd5[_0x89de('0x22')]()['then'](function(){var _0x2a96d0=_0x4bfbd5[_0x89de('0x23')]({'plain':!![]});var _0x1c0adc=_0x89de('0x24');return db[_0x89de('0x25')][_0x89de('0x22')]({'where':{'type':_0x1c0adc,'resourceId':_0x2a96d0['id']}})[_0x89de('0x26')](function(){return _0x4bfbd5;});})[_0x89de('0x26')](function(){_0x2b50c1[_0x89de('0x17')](0xcc)[_0x89de('0x27')]();});}};}function handleEntityNotFound(_0xb68947,_0x1abba7){return function(_0xa5563c){if(!_0xa5563c){_0xb68947[_0x89de('0x28')](0x194);}return _0xa5563c;};}function handleError(_0x38efe7,_0x218ec7){_0x218ec7=_0x218ec7||0x1f4;return function(_0xa18ea6){logger[_0x89de('0x29')](_0xa18ea6[_0x89de('0x2a')]);if(_0xa18ea6['name']){delete _0xa18ea6[_0x89de('0x2b')];}_0x38efe7['status'](_0x218ec7)[_0x89de('0x2c')](_0xa18ea6);};}exports[_0x89de('0x2d')]=function(_0xcbd7bc,_0x4e8c45){var _0x45cb1e={},_0x3eec88={},_0x5753c2={'count':0x0,'rows':[]};var _0x2ac2fb=_['map'](db[_0x89de('0x2e')][_0x89de('0x2f')],function(_0x4445ff){return{'name':_0x4445ff['fieldName'],'type':_0x4445ff[_0x89de('0x30')][_0x89de('0x31')]};});_0x3eec88[_0x89de('0x32')]=_[_0x89de('0x33')](_0x2ac2fb,_0x89de('0x2b'));_0x3eec88[_0x89de('0x34')]=_[_0x89de('0x35')](_0xcbd7bc[_0x89de('0x34')]);_0x3eec88['filters']=_[_0x89de('0x36')](_0x3eec88[_0x89de('0x32')],_0x3eec88['query']);_0x45cb1e[_0x89de('0x37')]=_[_0x89de('0x36')](_0x3eec88['model'],qs[_0x89de('0x38')](_0xcbd7bc[_0x89de('0x34')][_0x89de('0x38')]));_0x45cb1e[_0x89de('0x37')]=_0x45cb1e[_0x89de('0x37')][_0x89de('0x39')]?_0x45cb1e[_0x89de('0x37')]:_0x3eec88[_0x89de('0x32')];if(!_0xcbd7bc[_0x89de('0x34')]['hasOwnProperty']('nolimit')){_0x45cb1e['limit']=qs[_0x89de('0x1a')](_0xcbd7bc[_0x89de('0x34')][_0x89de('0x1a')]);_0x45cb1e[_0x89de('0x19')]=qs[_0x89de('0x19')](_0xcbd7bc[_0x89de('0x34')][_0x89de('0x19')]);}_0x45cb1e[_0x89de('0x3a')]=qs['sort'](_0xcbd7bc['query']['sort']);_0x45cb1e['where']=qs[_0x89de('0x3b')](_['pick'](_0xcbd7bc['query'],_0x3eec88[_0x89de('0x3b')]),_0x2ac2fb);if(_0xcbd7bc[_0x89de('0x34')][_0x89de('0x3c')]){_0x45cb1e[_0x89de('0x3d')]=_['merge'](_0x45cb1e['where'],{'$or':_['map'](_0x2ac2fb,function(_0x26cafa){if(_0x26cafa[_0x89de('0x30')]!==_0x89de('0x3e')){var _0xa8572={};_0xa8572[_0x26cafa['name']]={'$like':'%'+_0xcbd7bc[_0x89de('0x34')][_0x89de('0x3c')]+'%'};return _0xa8572;}})});}_0x45cb1e=_[_0x89de('0x3f')]({},_0x45cb1e,_0xcbd7bc[_0x89de('0x40')]);var _0x40cc2f={'where':_0x45cb1e['where']};return db[_0x89de('0x2e')][_0x89de('0x1b')](_0x40cc2f)['then'](function(_0x4eb062){_0x5753c2[_0x89de('0x1b')]=_0x4eb062;if(_0xcbd7bc[_0x89de('0x34')]['includeAll']){_0x45cb1e[_0x89de('0x41')]=[{'all':!![]}];}return db[_0x89de('0x2e')][_0x89de('0x42')](_0x45cb1e);})['then'](function(_0x36476c){_0x5753c2['rows']=_0x36476c;return _0x5753c2;})['then'](respondWithFilteredResult(_0x4e8c45,_0x45cb1e))[_0x89de('0x43')](handleError(_0x4e8c45,null));};exports[_0x89de('0x44')]=function(_0x50d9e5,_0x53ab6c){var _0x2d2778={'raw':!![],'where':{'id':_0x50d9e5['params']['id']}},_0x411627={};_0x411627[_0x89de('0x32')]=_[_0x89de('0x35')](db['Disposition'][_0x89de('0x2f')]);_0x411627[_0x89de('0x34')]=_[_0x89de('0x35')](_0x50d9e5[_0x89de('0x34')]);_0x411627[_0x89de('0x3b')]=_[_0x89de('0x36')](_0x411627[_0x89de('0x32')],_0x411627[_0x89de('0x34')]);_0x2d2778['attributes']=_[_0x89de('0x36')](_0x411627[_0x89de('0x32')],qs[_0x89de('0x38')](_0x50d9e5[_0x89de('0x34')][_0x89de('0x38')]));_0x2d2778[_0x89de('0x37')]=_0x2d2778['attributes'][_0x89de('0x39')]?_0x2d2778['attributes']:_0x411627[_0x89de('0x32')];if(_0x50d9e5[_0x89de('0x34')][_0x89de('0x45')]){_0x2d2778['include']=[{'all':!![]}];}_0x2d2778=_[_0x89de('0x3f')]({},_0x2d2778,_0x50d9e5[_0x89de('0x40')]);return db['Disposition'][_0x89de('0x46')](_0x2d2778)['then'](handleEntityNotFound(_0x53ab6c,null))[_0x89de('0x26')](respondWithResult(_0x53ab6c,null))[_0x89de('0x43')](handleError(_0x53ab6c,null));};exports[_0x89de('0x47')]=function(_0x1d6b32,_0x9476c1){return db[_0x89de('0x2e')][_0x89de('0x47')](_0x1d6b32[_0x89de('0x48')],{})[_0x89de('0x26')](function(_0x492a54){var _0x49f84f=_0x1d6b32[_0x89de('0x49')][_0x89de('0x23')]({'plain':!![]});if(!_0x49f84f)throw new Error(_0x89de('0x4a'));if(_0x49f84f[_0x89de('0x4b')]==='user'){var _0x390571=_0x492a54[_0x89de('0x23')]({'plain':!![]});var _0x40096a='Dispositions';return db['UserProfileSection']['find']({'where':{'name':_0x40096a,'userProfileId':_0x49f84f['userProfileId']},'raw':!![]})['then'](function(_0x388058){if(_0x388058&&_0x388058[_0x89de('0x4c')]===0x0){return db[_0x89de('0x25')][_0x89de('0x47')]({'name':_0x390571[_0x89de('0x2b')],'resourceId':_0x390571['id'],'type':_0x388058[_0x89de('0x2b')],'sectionId':_0x388058['id']},{})[_0x89de('0x26')](function(){return _0x492a54;});}else{return _0x492a54;}})[_0x89de('0x43')](function(_0x5a9f84){logger[_0x89de('0x29')](_0x89de('0x4d'),_0x5a9f84);throw _0x5a9f84;});}return _0x492a54;})[_0x89de('0x26')](respondWithResult(_0x9476c1,0xc9))[_0x89de('0x43')](handleError(_0x9476c1,null));};exports[_0x89de('0x21')]=function(_0x2a96c4,_0xed7cc9){if(_0x2a96c4[_0x89de('0x48')]['id']){delete _0x2a96c4[_0x89de('0x48')]['id'];}return db[_0x89de('0x2e')][_0x89de('0x46')]({'where':{'id':_0x2a96c4[_0x89de('0x4e')]['id']}})[_0x89de('0x26')](handleEntityNotFound(_0xed7cc9,null))[_0x89de('0x26')](saveUpdates(_0x2a96c4[_0x89de('0x48')],null))['then'](respondWithResult(_0xed7cc9,null))[_0x89de('0x43')](handleError(_0xed7cc9,null));};exports[_0x89de('0x22')]=function(_0x75c1e8,_0x203661){return db[_0x89de('0x2e')][_0x89de('0x46')]({'where':{'id':_0x75c1e8[_0x89de('0x4e')]['id']}})[_0x89de('0x26')](handleEntityNotFound(_0x203661,null))['then'](removeEntity(_0x203661,null))['catch'](handleError(_0x203661,null));}; \ No newline at end of file +var _0xd1f6=['model','name','query','keys','filters','intersection','attributes','nolimit','order','sort','where','pick','filter','merge','type','options','Disposition','include','findAll','rows','catch','show','fields','length','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Dispositions','error','send','index','map','rawAttributes','fieldName','key'];(function(_0x26e7bf,_0x2abe41){var _0x471bab=function(_0x9eabf9){while(--_0x9eabf9){_0x26e7bf['push'](_0x26e7bf['shift']());}};_0x471bab(++_0x2abe41);}(_0xd1f6,0x121));var _0x6d1f=function(_0x54b24a,_0x3286f8){_0x54b24a=_0x54b24a-0x0;var _0x35fb3b=_0xd1f6[_0x54b24a];return _0x35fb3b;};'use strict';var emlformat=require(_0x6d1f('0x0'));var rimraf=require(_0x6d1f('0x1'));var zipdir=require(_0x6d1f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6d1f('0x3'));var moment=require(_0x6d1f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6d1f('0x5'));var util=require(_0x6d1f('0x6'));var path=require(_0x6d1f('0x7'));var sox=require(_0x6d1f('0x8'));var csv=require(_0x6d1f('0x9'));var ejs=require(_0x6d1f('0xa'));var fs=require('fs');var fs_extra=require(_0x6d1f('0xb'));var _=require(_0x6d1f('0xc'));var squel=require(_0x6d1f('0xd'));var crypto=require(_0x6d1f('0xe'));var jsforce=require(_0x6d1f('0xf'));var deskjs=require(_0x6d1f('0x10'));var toCsv=require(_0x6d1f('0x9'));var querystring=require(_0x6d1f('0x11'));var Papa=require(_0x6d1f('0x12'));var Redis=require(_0x6d1f('0x13'));var authService=require(_0x6d1f('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6d1f('0x15'))(_0x6d1f('0x16'));var utils=require(_0x6d1f('0x17'));var config=require(_0x6d1f('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x6d1f('0x19'))['db'];function respondWithStatusCode(_0x3171c7,_0x566dee){_0x566dee=_0x566dee||0xcc;return function(_0x1263f8){if(_0x1263f8){return _0x3171c7[_0x6d1f('0x1a')](_0x566dee);}return _0x3171c7[_0x6d1f('0x1b')](_0x566dee)[_0x6d1f('0x1c')]();};}function respondWithResult(_0x3cfcdc,_0x53ff1b){_0x53ff1b=_0x53ff1b||0xc8;return function(_0x5df680){if(_0x5df680){return _0x3cfcdc[_0x6d1f('0x1b')](_0x53ff1b)[_0x6d1f('0x1d')](_0x5df680);}};}function respondWithFilteredResult(_0xc19231,_0x583c13){return function(_0x189ae1){if(_0x189ae1){var _0x1d46ee=typeof _0x583c13['offset']==='undefined'&&typeof _0x583c13[_0x6d1f('0x1e')]===_0x6d1f('0x1f');var _0x2a597e=_0x189ae1['count'];var _0x40af6e=_0x1d46ee?0x0:_0x583c13['offset'];var _0x3fd004=_0x1d46ee?_0x189ae1[_0x6d1f('0x20')]:_0x583c13[_0x6d1f('0x21')]+_0x583c13['limit'];var _0x140372;if(_0x3fd004>=_0x2a597e){_0x3fd004=_0x2a597e;_0x140372=0xc8;}else{_0x140372=0xce;}_0xc19231[_0x6d1f('0x1b')](_0x140372);return _0xc19231[_0x6d1f('0x22')](_0x6d1f('0x23'),_0x40af6e+'-'+_0x3fd004+'/'+_0x2a597e)['json'](_0x189ae1);}return null;};}function patchUpdates(_0x42fa41){return function(_0x4c27f2){try{jsonpatch[_0x6d1f('0x24')](_0x4c27f2,_0x42fa41,!![]);}catch(_0x38d95b){return BPromise[_0x6d1f('0x25')](_0x38d95b);}return _0x4c27f2[_0x6d1f('0x26')]();};}function saveUpdates(_0x357b63,_0x60965a){return function(_0x1dc3c9){if(_0x1dc3c9){return _0x1dc3c9[_0x6d1f('0x27')](_0x357b63)[_0x6d1f('0x28')](function(_0x2b3dde){return _0x2b3dde;});}return null;};}function removeEntity(_0x49d042,_0x45e77c){return function(_0x3ff660){if(_0x3ff660){return _0x3ff660[_0x6d1f('0x29')]()['then'](function(){var _0x32b451=_0x3ff660[_0x6d1f('0x2a')]({'plain':!![]});var _0xef7476=_0x6d1f('0x2b');return db['UserProfileResource'][_0x6d1f('0x29')]({'where':{'type':_0xef7476,'resourceId':_0x32b451['id']}})[_0x6d1f('0x28')](function(){return _0x3ff660;});})[_0x6d1f('0x28')](function(){_0x49d042[_0x6d1f('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47da86,_0x39d126){return function(_0x1fb480){if(!_0x1fb480){_0x47da86[_0x6d1f('0x1a')](0x194);}return _0x1fb480;};}function handleError(_0x4d8240,_0x8bca1e){_0x8bca1e=_0x8bca1e||0x1f4;return function(_0x5c12c0){logger[_0x6d1f('0x2c')](_0x5c12c0['stack']);if(_0x5c12c0['name']){delete _0x5c12c0['name'];}_0x4d8240[_0x6d1f('0x1b')](_0x8bca1e)[_0x6d1f('0x2d')](_0x5c12c0);};}exports[_0x6d1f('0x2e')]=function(_0x3a923a,_0x543c2d){var _0x23288a={},_0x1f3876={},_0x303013={'count':0x0,'rows':[]};var _0x1cbcdc=_[_0x6d1f('0x2f')](db['Disposition'][_0x6d1f('0x30')],function(_0x55041d){return{'name':_0x55041d[_0x6d1f('0x31')],'type':_0x55041d['type'][_0x6d1f('0x32')]};});_0x1f3876[_0x6d1f('0x33')]=_['map'](_0x1cbcdc,_0x6d1f('0x34'));_0x1f3876[_0x6d1f('0x35')]=_[_0x6d1f('0x36')](_0x3a923a[_0x6d1f('0x35')]);_0x1f3876[_0x6d1f('0x37')]=_['intersection'](_0x1f3876['model'],_0x1f3876[_0x6d1f('0x35')]);_0x23288a['attributes']=_[_0x6d1f('0x38')](_0x1f3876[_0x6d1f('0x33')],qs['fields'](_0x3a923a['query']['fields']));_0x23288a[_0x6d1f('0x39')]=_0x23288a[_0x6d1f('0x39')]['length']?_0x23288a['attributes']:_0x1f3876[_0x6d1f('0x33')];if(!_0x3a923a[_0x6d1f('0x35')]['hasOwnProperty'](_0x6d1f('0x3a'))){_0x23288a[_0x6d1f('0x1e')]=qs[_0x6d1f('0x1e')](_0x3a923a[_0x6d1f('0x35')][_0x6d1f('0x1e')]);_0x23288a[_0x6d1f('0x21')]=qs[_0x6d1f('0x21')](_0x3a923a[_0x6d1f('0x35')][_0x6d1f('0x21')]);}_0x23288a[_0x6d1f('0x3b')]=qs[_0x6d1f('0x3c')](_0x3a923a[_0x6d1f('0x35')][_0x6d1f('0x3c')]);_0x23288a[_0x6d1f('0x3d')]=qs['filters'](_[_0x6d1f('0x3e')](_0x3a923a['query'],_0x1f3876[_0x6d1f('0x37')]),_0x1cbcdc);if(_0x3a923a[_0x6d1f('0x35')][_0x6d1f('0x3f')]){_0x23288a[_0x6d1f('0x3d')]=_[_0x6d1f('0x40')](_0x23288a['where'],{'$or':_[_0x6d1f('0x2f')](_0x1cbcdc,function(_0x4684d6){if(_0x4684d6[_0x6d1f('0x41')]!=='VIRTUAL'){var _0x4e5553={};_0x4e5553[_0x4684d6[_0x6d1f('0x34')]]={'$like':'%'+_0x3a923a[_0x6d1f('0x35')][_0x6d1f('0x3f')]+'%'};return _0x4e5553;}})});}_0x23288a=_['merge']({},_0x23288a,_0x3a923a[_0x6d1f('0x42')]);var _0x19b250={'where':_0x23288a[_0x6d1f('0x3d')]};return db[_0x6d1f('0x43')][_0x6d1f('0x20')](_0x19b250)[_0x6d1f('0x28')](function(_0x4444b2){_0x303013[_0x6d1f('0x20')]=_0x4444b2;if(_0x3a923a[_0x6d1f('0x35')]['includeAll']){_0x23288a[_0x6d1f('0x44')]=[{'all':!![]}];}return db[_0x6d1f('0x43')][_0x6d1f('0x45')](_0x23288a);})['then'](function(_0x256ffd){_0x303013[_0x6d1f('0x46')]=_0x256ffd;return _0x303013;})[_0x6d1f('0x28')](respondWithFilteredResult(_0x543c2d,_0x23288a))[_0x6d1f('0x47')](handleError(_0x543c2d,null));};exports[_0x6d1f('0x48')]=function(_0x348ee5,_0x3b1eee){var _0x1e6ba1={'raw':!![],'where':{'id':_0x348ee5['params']['id']}},_0x337e78={};_0x337e78[_0x6d1f('0x33')]=_[_0x6d1f('0x36')](db[_0x6d1f('0x43')]['rawAttributes']);_0x337e78[_0x6d1f('0x35')]=_[_0x6d1f('0x36')](_0x348ee5[_0x6d1f('0x35')]);_0x337e78[_0x6d1f('0x37')]=_[_0x6d1f('0x38')](_0x337e78[_0x6d1f('0x33')],_0x337e78['query']);_0x1e6ba1[_0x6d1f('0x39')]=_[_0x6d1f('0x38')](_0x337e78[_0x6d1f('0x33')],qs[_0x6d1f('0x49')](_0x348ee5[_0x6d1f('0x35')][_0x6d1f('0x49')]));_0x1e6ba1[_0x6d1f('0x39')]=_0x1e6ba1[_0x6d1f('0x39')][_0x6d1f('0x4a')]?_0x1e6ba1['attributes']:_0x337e78[_0x6d1f('0x33')];if(_0x348ee5[_0x6d1f('0x35')]['includeAll']){_0x1e6ba1[_0x6d1f('0x44')]=[{'all':!![]}];}_0x1e6ba1=_[_0x6d1f('0x40')]({},_0x1e6ba1,_0x348ee5['options']);return db['Disposition'][_0x6d1f('0x4b')](_0x1e6ba1)['then'](handleEntityNotFound(_0x3b1eee,null))['then'](respondWithResult(_0x3b1eee,null))[_0x6d1f('0x47')](handleError(_0x3b1eee,null));};exports[_0x6d1f('0x4c')]=function(_0x1205ac,_0x510a9c){return db[_0x6d1f('0x43')]['create'](_0x1205ac['body'],{})[_0x6d1f('0x28')](function(_0x31f96d){var _0x55699e=_0x1205ac['user']['get']({'plain':!![]});if(!_0x55699e)throw new Error(_0x6d1f('0x4d'));if(_0x55699e['role']===_0x6d1f('0x4e')){var _0x3d327d=_0x31f96d[_0x6d1f('0x2a')]({'plain':!![]});var _0x3bb469=_0x6d1f('0x2b');return db['UserProfileSection'][_0x6d1f('0x4b')]({'where':{'name':_0x3bb469,'userProfileId':_0x55699e[_0x6d1f('0x4f')]},'raw':!![]})['then'](function(_0x2286ee){if(_0x2286ee&&_0x2286ee[_0x6d1f('0x50')]===0x0){return db[_0x6d1f('0x51')][_0x6d1f('0x4c')]({'name':_0x3d327d[_0x6d1f('0x34')],'resourceId':_0x3d327d['id'],'type':_0x2286ee[_0x6d1f('0x34')],'sectionId':_0x2286ee['id']},{})['then'](function(){return _0x31f96d;});}else{return _0x31f96d;}})[_0x6d1f('0x47')](function(_0x2adbe6){logger[_0x6d1f('0x2c')](_0x6d1f('0x52'),_0x2adbe6);throw _0x2adbe6;});}return _0x31f96d;})[_0x6d1f('0x28')](respondWithResult(_0x510a9c,0xc9))[_0x6d1f('0x47')](handleError(_0x510a9c,null));};exports['update']=function(_0x229d0f,_0x470e63){if(_0x229d0f[_0x6d1f('0x53')]['id']){delete _0x229d0f[_0x6d1f('0x53')]['id'];}return db[_0x6d1f('0x43')][_0x6d1f('0x4b')]({'where':{'id':_0x229d0f[_0x6d1f('0x54')]['id']}})[_0x6d1f('0x28')](handleEntityNotFound(_0x470e63,null))['then'](saveUpdates(_0x229d0f[_0x6d1f('0x53')],null))[_0x6d1f('0x28')](respondWithResult(_0x470e63,null))['catch'](handleError(_0x470e63,null));};exports[_0x6d1f('0x29')]=function(_0x4d1c9e,_0x3cf76f){return db['Disposition'][_0x6d1f('0x4b')]({'where':{'id':_0x4d1c9e[_0x6d1f('0x54')]['id']}})[_0x6d1f('0x28')](handleEntityNotFound(_0x3cf76f,null))[_0x6d1f('0x28')](removeEntity(_0x3cf76f,null))['catch'](handleError(_0x3cf76f,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 56c0199..496686f 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 _0x63f3=['name','ListId','name_chat','MailAccountId','name_sms','name_fax','name_openchannel','OpenchannelAccountId','name_whatsapp','lodash','../../config/logger','api','moment','request-promise','rimraf','./disposition.attributes','exports','define','Disposition','name_voice'];(function(_0x2499af,_0xcd4a1){var _0x442775=function(_0x318603){while(--_0x318603){_0x2499af['push'](_0x2499af['shift']());}};_0x442775(++_0xcd4a1);}(_0x63f3,0x199));var _0x363f=function(_0x264545,_0x214037){_0x264545=_0x264545-0x0;var _0x114d10=_0x63f3[_0x264545];return _0x114d10;};'use strict';var _=require(_0x363f('0x0'));var util=require('util');var logger=require(_0x363f('0x1'))(_0x363f('0x2'));var moment=require(_0x363f('0x3'));var BPromise=require('bluebird');var rp=require(_0x363f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x363f('0x5'));var config=require('../../config/environment');var attributes=require(_0x363f('0x6'));module[_0x363f('0x7')]=function(_0x2fc9ea,_0x358c0e){return _0x2fc9ea[_0x363f('0x8')](_0x363f('0x9'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0x363f('0xa'),'fields':[_0x363f('0xb'),_0x363f('0xc')]},{'unique':!![],'name':_0x363f('0xd'),'fields':[_0x363f('0xb'),'ChatWebsiteId']},{'unique':!![],'name':'name_mail','fields':[_0x363f('0xb'),_0x363f('0xe')]},{'unique':!![],'name':_0x363f('0xf'),'fields':[_0x363f('0xb'),'SmsAccountId']},{'unique':!![],'name':_0x363f('0x10'),'fields':[_0x363f('0xb'),'FaxAccountId']},{'unique':!![],'name':_0x363f('0x11'),'fields':['name',_0x363f('0x12')]},{'unique':!![],'name':_0x363f('0x13'),'fields':['name','WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x863e=['Disposition','tools_dispositions','name_voice','ListId','name_chat','name','name_mail','SmsAccountId','OpenchannelAccountId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./disposition.attributes','exports','define'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x863e,0x1ab));var _0xe863=function(_0x44147a,_0x1d75af){_0x44147a=_0x44147a-0x0;var _0x114783=_0x863e[_0x44147a];return _0x114783;};'use strict';var _=require(_0xe863('0x0'));var util=require(_0xe863('0x1'));var logger=require(_0xe863('0x2'))(_0xe863('0x3'));var moment=require(_0xe863('0x4'));var BPromise=require(_0xe863('0x5'));var rp=require(_0xe863('0x6'));var fs=require('fs');var path=require(_0xe863('0x7'));var rimraf=require(_0xe863('0x8'));var config=require(_0xe863('0x9'));var attributes=require(_0xe863('0xa'));module[_0xe863('0xb')]=function(_0x50d3f5,_0x3ff1fc){return _0x50d3f5[_0xe863('0xc')](_0xe863('0xd'),attributes,{'tableName':_0xe863('0xe'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xe863('0xf'),'fields':['name',_0xe863('0x10')]},{'unique':!![],'name':_0xe863('0x11'),'fields':[_0xe863('0x12'),'ChatWebsiteId']},{'unique':!![],'name':_0xe863('0x13'),'fields':[_0xe863('0x12'),'MailAccountId']},{'unique':!![],'name':'name_sms','fields':[_0xe863('0x12'),_0xe863('0x14')]},{'unique':!![],'name':'name_fax','fields':[_0xe863('0x12'),'FaxAccountId']},{'unique':!![],'name':'name_openchannel','fields':[_0xe863('0x12'),_0xe863('0x15')]},{'unique':!![],'name':'name_whatsapp','fields':['name','WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 3c42202..a6591e7 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(_0x29a9cb,_0x443012){var _0x317f12=function(_0x119c51){while(--_0x119c51){_0x29a9cb['push'](_0x29a9cb['shift']());}};_0x317f12(++_0x443012);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'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(_0x3e3227,_0x425ea2){var _0xd4bd35=function(_0x1300e5){while(--_0x1300e5){_0x3e3227['push'](_0x3e3227['shift']());}};_0xd4bd35(++_0x425ea2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index 3f1d60f..61f5278 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 _0x6fe5=['put','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./disposition.controller','isAuthenticated','index','/:id','show','post','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6fe5,0x1c2));var _0x56fe=function(_0x102062,_0x48ed6d){_0x102062=_0x102062-0x0;var _0x3a22db=_0x6fe5[_0x102062];return _0x3a22db;};'use strict';var multer=require('multer');var util=require(_0x56fe('0x0'));var path=require(_0x56fe('0x1'));var timeout=require(_0x56fe('0x2'));var express=require(_0x56fe('0x3'));var router=express[_0x56fe('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x56fe('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x56fe('0x6'));var controller=require(_0x56fe('0x7'));router['get']('/',auth[_0x56fe('0x8')](),controller[_0x56fe('0x9')]);router['get'](_0x56fe('0xa'),auth['isAuthenticated'](),controller[_0x56fe('0xb')]);router[_0x56fe('0xc')]('/',auth[_0x56fe('0x8')](),controller[_0x56fe('0xd')]);router[_0x56fe('0xe')](_0x56fe('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x56fe('0xa'),auth[_0x56fe('0x8')](),controller['destroy']);module[_0x56fe('0xf')]=router; \ No newline at end of file +var _0x8ab5=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','/:id','show','post'];(function(_0x30ec23,_0x146fee){var _0x4a85cd=function(_0x6cd481){while(--_0x6cd481){_0x30ec23['push'](_0x30ec23['shift']());}};_0x4a85cd(++_0x146fee);}(_0x8ab5,0x1e9));var _0x58ab=function(_0x2cbb0d,_0x5ee1af){_0x2cbb0d=_0x2cbb0d-0x0;var _0x180f60=_0x8ab5[_0x2cbb0d];return _0x180f60;};'use strict';var multer=require(_0x58ab('0x0'));var util=require(_0x58ab('0x1'));var path=require(_0x58ab('0x2'));var timeout=require(_0x58ab('0x3'));var express=require(_0x58ab('0x4'));var router=express[_0x58ab('0x5')]();var fs_extra=require(_0x58ab('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x58ab('0x7'));var config=require(_0x58ab('0x8'));var controller=require(_0x58ab('0x9'));router[_0x58ab('0xa')]('/',auth[_0x58ab('0xb')](),controller['index']);router[_0x58ab('0xa')](_0x58ab('0xc'),auth[_0x58ab('0xb')](),controller[_0x58ab('0xd')]);router[_0x58ab('0xe')]('/',auth[_0x58ab('0xb')](),controller[_0x58ab('0xf')]);router[_0x58ab('0x10')]('/:id',auth[_0x58ab('0xb')](),controller[_0x58ab('0x11')]);router[_0x58ab('0x12')](_0x58ab('0xc'),auth[_0x58ab('0xb')](),controller[_0x58ab('0x13')]);module[_0x58ab('0x14')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index b8c00c6..5cc5f28 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 _0x152e=['12000','14400','v17,v27,v29','INTEGER','SIP','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDisposition','sequelize','exports','STRING','xCALLY\x20Motion\x20Fax','localstationid','ENUM','4800','7200','9600'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0x152e,0x199));var _0xe152=function(_0x88fab1,_0x1accff){_0x88fab1=_0x88fab1-0x0;var _0x20c571=_0x152e[_0x88fab1];return _0x20c571;};'use strict';var Sequelize=require(_0xe152('0x0'));module[_0xe152('0x1')]={'name':{'type':Sequelize[_0xe152('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0xe152('0x3')},'localstationid':{'type':Sequelize['STRING'],'unique':_0xe152('0x4')},'minrate':{'type':Sequelize[_0xe152('0x5')]('2400',_0xe152('0x6'),_0xe152('0x7'),_0xe152('0x8'),_0xe152('0x9'),_0xe152('0xa')),'defaultValue':_0xe152('0x6')},'maxrate':{'type':Sequelize[_0xe152('0x5')]('2400',_0xe152('0x6'),_0xe152('0x7'),_0xe152('0x8'),'12000',_0xe152('0xa')),'defaultValue':'14400'},'modem':{'type':Sequelize[_0xe152('0x2')],'defaultValue':_0xe152('0xb')},'gateway':{'type':Sequelize[_0xe152('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xe152('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xe152('0x5')](_0xe152('0xd'),'IAX',_0xe152('0xe'),_0xe152('0xf')),'defaultValue':_0xe152('0xd')},'key':{'type':Sequelize[_0xe152('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xe152('0x10')],'defaultValue':function(){return _0xe152('0x11');}},'notificationSound':{'type':Sequelize[_0xe152('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xe152('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xe152('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xe152('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe152('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xe152('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe152('0xc')],'allowNull':!![],'defaultValue':null,'comment':_0xe152('0x13')},'mandatoryDisposition':{'type':Sequelize[_0xe152('0x12')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2ce2db){if(!_0x2ce2db)this[_0xe152('0x14')]('mandatoryDispositionPauseId',null);this[_0xe152('0x14')](_0xe152('0x15'),_0x2ce2db);}}}; \ No newline at end of file +var _0x48e1=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','localstationid','2400','4800','7200','9600','14400','12000','INTEGER','SIP','DADHI','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN'];(function(_0x2a67fe,_0x295c09){var _0x57e726=function(_0x280573){while(--_0x280573){_0x2a67fe['push'](_0x2a67fe['shift']());}};_0x57e726(++_0x295c09);}(_0x48e1,0xeb));var _0x148e=function(_0x269c28,_0x344e21){_0x269c28=_0x269c28-0x0;var _0x13738=_0x48e1[_0x269c28];return _0x13738;};'use strict';var Sequelize=require(_0x148e('0x0'));module[_0x148e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x148e('0x2')]},'ecm':{'type':Sequelize[_0x148e('0x3')](_0x148e('0x4'),'no'),'defaultValue':_0x148e('0x4')},'headerinfo':{'type':Sequelize[_0x148e('0x2')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0x148e('0x2')],'unique':_0x148e('0x5')},'minrate':{'type':Sequelize[_0x148e('0x3')](_0x148e('0x6'),_0x148e('0x7'),_0x148e('0x8'),_0x148e('0x9'),'12000',_0x148e('0xa')),'defaultValue':'4800'},'maxrate':{'type':Sequelize['ENUM'](_0x148e('0x6'),_0x148e('0x7'),'7200','9600',_0x148e('0xb'),_0x148e('0xa')),'defaultValue':_0x148e('0xa')},'modem':{'type':Sequelize[_0x148e('0x2')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0x148e('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x148e('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x148e('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x148e('0x3')](_0x148e('0xd'),'IAX',_0x148e('0xe'),'KHOMP'),'defaultValue':_0x148e('0xd')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x148e('0xf')],'defaultValue':function(){return _0x148e('0x10');}},'notificationSound':{'type':Sequelize[_0x148e('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x148e('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x148e('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x148e('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x148e('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x148e('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x148e('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x148e('0xc')],'allowNull':!![],'defaultValue':null,'comment':_0x148e('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x148e('0x11')],'defaultValue':![],'comment':_0x148e('0x13'),'set':function(_0x1d7b5f){if(!_0x1d7b5f)this[_0x148e('0x14')](_0x148e('0x15'),null);this[_0x148e('0x14')](_0x148e('0x16'),_0x1d7b5f);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 9eb92c4..cc1d41e 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 _0x1d80=['$gte','split','CmList','Contacts','DESC','attachments','join','root','basename','CheckAfterSend','isNil','from','format','\x22%s\x22\x20<%s>','fax','List','CmContact','ListId','List\x20not\x20found','create','out','filename','Messages','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','destroy','UserProfileResource','then','stack','name','send','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','merge','type','VIRTUAL','filter','options','findAll','show','keys','includeAll','include','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','FaxAccounts','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addDisposition','params','FaxAccountId','Disposition','getDispositions','findOne','nolimit','rows','removeDispositions','ids','addAnswer','pick','CannedAnswer','removeAnswers','FaxInteraction','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','transaction','FaxApplication','priority','finally','getApplications','context','from-voip-provider','exten','localstationid','app','system','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','Set','headerinfo','maxrate','modem','t38timeout','FAXOPT(','Wait','sequelize','VoiceExtension','updateAccountApplications','bulkCreate','tech','createdAt','updatedAt','TrunkId','findById','getMessages','FaxMessage'];(function(_0x3ebee4,_0x47fb7e){var _0x1eb05e=function(_0xd1fcd7){while(--_0xd1fcd7){_0x3ebee4['push'](_0x3ebee4['shift']());}};_0x1eb05e(++_0x47fb7e);}(_0x1d80,0xe8));var _0x01d8=function(_0x2949e1,_0x51987d){_0x2949e1=_0x2949e1-0x0;var _0x25eb3e=_0x1d80[_0x2949e1];return _0x25eb3e;};'use strict';var emlformat=require(_0x01d8('0x0'));var rimraf=require(_0x01d8('0x1'));var zipdir=require(_0x01d8('0x2'));var jsonpatch=require(_0x01d8('0x3'));var rp=require('request-promise');var moment=require(_0x01d8('0x4'));var BPromise=require(_0x01d8('0x5'));var Mustache=require('mustache');var util=require(_0x01d8('0x6'));var path=require(_0x01d8('0x7'));var sox=require('sox');var csv=require(_0x01d8('0x8'));var ejs=require(_0x01d8('0x9'));var fs=require('fs');var fs_extra=require(_0x01d8('0xa'));var _=require('lodash');var squel=require(_0x01d8('0xb'));var crypto=require('crypto');var jsforce=require(_0x01d8('0xc'));var deskjs=require(_0x01d8('0xd'));var toCsv=require('to-csv');var querystring=require(_0x01d8('0xe'));var Papa=require(_0x01d8('0xf'));var Redis=require(_0x01d8('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x01d8('0x11'));var hardwareService=require(_0x01d8('0x12'));var logger=require(_0x01d8('0x13'))(_0x01d8('0x14'));var utils=require(_0x01d8('0x15'));var config=require(_0x01d8('0x16'));var licenseUtil=require(_0x01d8('0x17'));var db=require(_0x01d8('0x18'))['db'];config[_0x01d8('0x19')]=_[_0x01d8('0x1a')](config[_0x01d8('0x19')],{'host':_0x01d8('0x1b'),'port':0x18eb});var socket=require(_0x01d8('0x1c'))(new Redis(config['redis']));require(_0x01d8('0x1d'))[_0x01d8('0x1e')](socket);var jayson=require(_0x01d8('0x1f'));var client=jayson[_0x01d8('0x20')][_0x01d8('0x21')]({'port':0x232c});var client9002=jayson[_0x01d8('0x20')][_0x01d8('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x43e658,_0x12d135,_0x255371,_0x153ace){return new BPromise(function(_0x33a814,_0x42de54){var _0x3586d0=_0x153ace||client;return _0x3586d0['request'](_0x43e658,_0x255371)['then'](function(_0xc1b056){logger[_0x01d8('0x22')](_0x01d8('0x23'),_0x12d135,_0x01d8('0x24'));logger[_0x01d8('0x25')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x12d135,_0x01d8('0x24'),JSON[_0x01d8('0x26')](_0xc1b056));if(_0xc1b056[_0x01d8('0x27')]){if(_0xc1b056[_0x01d8('0x27')]['code']===0x1f4){logger[_0x01d8('0x27')](_0x01d8('0x23'),_0x12d135,_0xc1b056['error'][_0x01d8('0x28')]);return _0x42de54(_0xc1b056[_0x01d8('0x27')]['message']);}logger[_0x01d8('0x27')](_0x01d8('0x23'),_0x12d135,_0xc1b056[_0x01d8('0x27')][_0x01d8('0x28')]);return _0x33a814(_0xc1b056['error'][_0x01d8('0x28')]);}else{logger[_0x01d8('0x22')](_0x01d8('0x23'),_0x12d135,'request\x20sent');_0x33a814(_0xc1b056[_0x01d8('0x29')]['message']);}})[_0x01d8('0x2a')](function(_0x2b9900){logger[_0x01d8('0x27')]('FaxAccount,\x20%s,\x20%s',_0x12d135,_0x2b9900);_0x42de54(_0x2b9900);});});}function respondWithStatusCode(_0x21431b,_0x2ab078){_0x2ab078=_0x2ab078||0xcc;return function(_0x3067a1){if(_0x3067a1){return _0x21431b[_0x01d8('0x2b')](_0x2ab078);}return _0x21431b[_0x01d8('0x2c')](_0x2ab078)[_0x01d8('0x2d')]();};}function respondWithResult(_0x57a228,_0x593b04){_0x593b04=_0x593b04||0xc8;return function(_0x36317b){if(_0x36317b){return _0x57a228[_0x01d8('0x2c')](_0x593b04)[_0x01d8('0x2e')](_0x36317b);}};}function respondWithFilteredResult(_0x48bb5f,_0x2d8a14){return function(_0x20717d){if(_0x20717d){var _0x140728=typeof _0x2d8a14[_0x01d8('0x2f')]===_0x01d8('0x30')&&typeof _0x2d8a14[_0x01d8('0x31')]===_0x01d8('0x30');var _0x555d78=_0x20717d[_0x01d8('0x32')];var _0x4e91c9=_0x140728?0x0:_0x2d8a14['offset'];var _0x37c856=_0x140728?_0x20717d[_0x01d8('0x32')]:_0x2d8a14['offset']+_0x2d8a14[_0x01d8('0x31')];var _0x33eef3;if(_0x37c856>=_0x555d78){_0x37c856=_0x555d78;_0x33eef3=0xc8;}else{_0x33eef3=0xce;}_0x48bb5f['status'](_0x33eef3);return _0x48bb5f[_0x01d8('0x33')](_0x01d8('0x34'),_0x4e91c9+'-'+_0x37c856+'/'+_0x555d78)['json'](_0x20717d);}return null;};}function patchUpdates(_0x30fdfd){return function(_0x50522a){try{jsonpatch[_0x01d8('0x35')](_0x50522a,_0x30fdfd,!![]);}catch(_0x434f43){return BPromise['reject'](_0x434f43);}return _0x50522a[_0x01d8('0x36')]();};}function saveUpdates(_0x36fd34,_0x3d403f){return function(_0x1f618a){if(_0x1f618a){return _0x1f618a['update'](_0x36fd34)['then'](function(_0x24b971){return _0x24b971;});}return null;};}function removeEntity(_0x586dfd,_0x387429){return function(_0x4c0119){if(_0x4c0119){return _0x4c0119[_0x01d8('0x37')]()['then'](function(){var _0x2d946a=_0x4c0119['get']({'plain':!![]});var _0x27865e='FaxAccounts';return db[_0x01d8('0x38')][_0x01d8('0x37')]({'where':{'type':_0x27865e,'resourceId':_0x2d946a['id']}})['then'](function(){return _0x4c0119;});})[_0x01d8('0x39')](function(){_0x586dfd[_0x01d8('0x2c')](0xcc)[_0x01d8('0x2d')]();});}};}function handleEntityNotFound(_0x5e5173,_0x16097c){return function(_0x369809){if(!_0x369809){_0x5e5173[_0x01d8('0x2b')](0x194);}return _0x369809;};}function handleError(_0x38dd8e,_0x56f0aa){_0x56f0aa=_0x56f0aa||0x1f4;return function(_0x39bca8){logger[_0x01d8('0x27')](_0x39bca8[_0x01d8('0x3a')]);if(_0x39bca8['name']){delete _0x39bca8[_0x01d8('0x3b')];}_0x38dd8e['status'](_0x56f0aa)[_0x01d8('0x3c')](_0x39bca8);};}exports[_0x01d8('0x3d')]=function(_0x3c3784,_0x2f0308){var _0x428204={'include':[{'model':db[_0x01d8('0x3e')],'as':_0x01d8('0x3f')}]},_0x5a82c7={},_0x450b31={'count':0x0,'rows':[]};var _0x557a83=_[_0x01d8('0x40')](db[_0x01d8('0x41')][_0x01d8('0x42')],function(_0x723d2a){return{'name':_0x723d2a['fieldName'],'type':_0x723d2a['type'][_0x01d8('0x43')]};});_0x5a82c7[_0x01d8('0x44')]=_[_0x01d8('0x40')](_0x557a83,_0x01d8('0x3b'));_0x5a82c7[_0x01d8('0x45')]=_['keys'](_0x3c3784[_0x01d8('0x45')]);_0x5a82c7[_0x01d8('0x46')]=_['intersection'](_0x5a82c7[_0x01d8('0x44')],_0x5a82c7[_0x01d8('0x45')]);_0x428204[_0x01d8('0x47')]=_[_0x01d8('0x48')](_0x5a82c7[_0x01d8('0x44')],qs[_0x01d8('0x49')](_0x3c3784[_0x01d8('0x45')][_0x01d8('0x49')]));_0x428204[_0x01d8('0x47')]=_0x428204['attributes'][_0x01d8('0x4a')]?_0x428204[_0x01d8('0x47')]:_0x5a82c7[_0x01d8('0x44')];if(!_0x3c3784['query'][_0x01d8('0x4b')]('nolimit')){_0x428204['limit']=qs['limit'](_0x3c3784['query'][_0x01d8('0x31')]);_0x428204['offset']=qs[_0x01d8('0x2f')](_0x3c3784[_0x01d8('0x45')][_0x01d8('0x2f')]);}_0x428204[_0x01d8('0x4c')]=qs['sort'](_0x3c3784[_0x01d8('0x45')][_0x01d8('0x4d')]);_0x428204[_0x01d8('0x4e')]=qs[_0x01d8('0x46')](_['pick'](_0x3c3784[_0x01d8('0x45')],_0x5a82c7[_0x01d8('0x46')]),_0x557a83);if(_0x3c3784[_0x01d8('0x45')]['filter']){_0x428204[_0x01d8('0x4e')]=_[_0x01d8('0x4f')](_0x428204[_0x01d8('0x4e')],{'$or':_[_0x01d8('0x40')](_0x557a83,function(_0x1bb020){if(_0x1bb020[_0x01d8('0x50')]!==_0x01d8('0x51')){var _0x39868a={};_0x39868a[_0x1bb020['name']]={'$like':'%'+_0x3c3784[_0x01d8('0x45')][_0x01d8('0x52')]+'%'};return _0x39868a;}})});}_0x428204=_[_0x01d8('0x4f')]({},_0x428204,_0x3c3784[_0x01d8('0x53')]);var _0x4c8df7={'where':_0x428204[_0x01d8('0x4e')]};return db[_0x01d8('0x41')]['count'](_0x4c8df7)[_0x01d8('0x39')](function(_0x53068c){_0x450b31['count']=_0x53068c;if(_0x3c3784[_0x01d8('0x45')]['includeAll']){_0x428204['include']=[{'all':!![]}];}return db['FaxAccount'][_0x01d8('0x54')](_0x428204);})['then'](function(_0x4be82c){_0x450b31['rows']=_0x4be82c;return _0x450b31;})[_0x01d8('0x39')](respondWithFilteredResult(_0x2f0308,_0x428204))[_0x01d8('0x2a')](handleError(_0x2f0308,null));};exports[_0x01d8('0x55')]=function(_0xbe760e,_0x349b71){var _0x3b04c4={'raw':![],'where':{'id':_0xbe760e['params']['id']},'include':[{'model':db[_0x01d8('0x3e')],'as':_0x01d8('0x3f')}]},_0x2e2e07={};_0x2e2e07[_0x01d8('0x44')]=_[_0x01d8('0x56')](db[_0x01d8('0x41')][_0x01d8('0x42')]);_0x2e2e07[_0x01d8('0x45')]=_['keys'](_0xbe760e[_0x01d8('0x45')]);_0x2e2e07[_0x01d8('0x46')]=_[_0x01d8('0x48')](_0x2e2e07[_0x01d8('0x44')],_0x2e2e07['query']);_0x3b04c4['attributes']=_['intersection'](_0x2e2e07['model'],qs[_0x01d8('0x49')](_0xbe760e[_0x01d8('0x45')][_0x01d8('0x49')]));_0x3b04c4[_0x01d8('0x47')]=_0x3b04c4[_0x01d8('0x47')][_0x01d8('0x4a')]?_0x3b04c4[_0x01d8('0x47')]:_0x2e2e07[_0x01d8('0x44')];if(_0xbe760e[_0x01d8('0x45')][_0x01d8('0x57')]){_0x3b04c4[_0x01d8('0x58')]=[{'all':!![]}];}_0x3b04c4=_[_0x01d8('0x4f')]({},_0x3b04c4,_0xbe760e[_0x01d8('0x53')]);return db[_0x01d8('0x41')][_0x01d8('0x59')](_0x3b04c4)[_0x01d8('0x39')](handleEntityNotFound(_0x349b71,null))[_0x01d8('0x39')](respondWithResult(_0x349b71,null))['catch'](handleError(_0x349b71,null));};exports['create']=function(_0x4fa2f4,_0x1f512e){return db[_0x01d8('0x41')]['create'](_0x4fa2f4[_0x01d8('0x5a')],{})[_0x01d8('0x39')](function(_0x16c7b1){var _0x37f9a9=_0x4fa2f4[_0x01d8('0x5b')]['get']({'plain':!![]});if(!_0x37f9a9)throw new Error(_0x01d8('0x5c'));if(_0x37f9a9[_0x01d8('0x5d')]===_0x01d8('0x5b')){var _0xa63499=_0x16c7b1['get']({'plain':!![]});var _0x30951d=_0x01d8('0x5e');return db[_0x01d8('0x5f')][_0x01d8('0x59')]({'where':{'name':_0x30951d,'userProfileId':_0x37f9a9['userProfileId']},'raw':!![]})[_0x01d8('0x39')](function(_0x1b243f){if(_0x1b243f&&_0x1b243f[_0x01d8('0x60')]===0x0){return db['UserProfileResource']['create']({'name':_0xa63499[_0x01d8('0x3b')],'resourceId':_0xa63499['id'],'type':_0x1b243f[_0x01d8('0x3b')],'sectionId':_0x1b243f['id']},{})[_0x01d8('0x39')](function(){return _0x16c7b1;});}else{return _0x16c7b1;}})[_0x01d8('0x2a')](function(_0x1db132){logger['error'](_0x01d8('0x61'),_0x1db132);throw _0x1db132;});}return _0x16c7b1;})[_0x01d8('0x39')](respondWithResult(_0x1f512e,0xc9))[_0x01d8('0x2a')](handleError(_0x1f512e,null));};exports[_0x01d8('0x62')]=function(_0x4e8811,_0x1b3bca){if(_0x4e8811[_0x01d8('0x5a')]['id']){delete _0x4e8811[_0x01d8('0x5a')]['id'];}return db[_0x01d8('0x41')]['find']({'where':{'id':_0x4e8811['params']['id']},'include':[{'model':db[_0x01d8('0x3e')],'as':_0x01d8('0x3f')}]})[_0x01d8('0x39')](handleEntityNotFound(_0x1b3bca,null))[_0x01d8('0x39')](saveUpdates(_0x4e8811['body'],null))[_0x01d8('0x39')](respondWithResult(_0x1b3bca,null))['catch'](handleError(_0x1b3bca,null));};exports[_0x01d8('0x37')]=function(_0x477e53,_0x35812a){return db[_0x01d8('0x41')][_0x01d8('0x59')]({'where':{'id':_0x477e53['params']['id']}})[_0x01d8('0x39')](handleEntityNotFound(_0x35812a,null))[_0x01d8('0x39')](removeEntity(_0x35812a,null))[_0x01d8('0x2a')](handleError(_0x35812a,null));};exports['describe']=function(_0x4059c0,_0x374cdb){return db['FaxAccount']['describe']()[_0x01d8('0x39')](respondWithResult(_0x374cdb,null))[_0x01d8('0x2a')](handleError(_0x374cdb,null));};exports[_0x01d8('0x63')]=function(_0xc64b5,_0x12dce4,_0x459da9){if(_0xc64b5[_0x01d8('0x5a')]['id']){delete _0xc64b5[_0x01d8('0x5a')]['id'];}return db['FaxAccount']['find']({'where':{'id':_0xc64b5[_0x01d8('0x64')]['id']}})[_0x01d8('0x39')](handleEntityNotFound(_0x12dce4,null))[_0x01d8('0x39')](function(_0x3275b6){if(_0x3275b6){_0xc64b5[_0x01d8('0x5a')][_0x01d8('0x65')]=_0x3275b6['id'];return db[_0x01d8('0x66')]['create'](_0xc64b5[_0x01d8('0x5a')]);}})[_0x01d8('0x39')](respondWithResult(_0x12dce4,null))[_0x01d8('0x2a')](handleError(_0x12dce4,null));};exports[_0x01d8('0x67')]=function(_0x36c338,_0x1be7ef,_0x1464a3){var _0x5f1357={'raw':![],'where':{}};var _0x317d42={};var _0xa2416={'count':0x0,'rows':[]};return db[_0x01d8('0x41')][_0x01d8('0x68')]({'where':{'id':_0x36c338[_0x01d8('0x64')]['id']}})[_0x01d8('0x39')](handleEntityNotFound(_0x1be7ef,null))['then'](function(_0x128eae){if(_0x128eae){_0x317d42[_0x01d8('0x44')]=_[_0x01d8('0x56')](db['Disposition']['rawAttributes']);_0x317d42[_0x01d8('0x45')]=_[_0x01d8('0x56')](_0x36c338[_0x01d8('0x45')]);_0x317d42['filters']=_['intersection'](_0x317d42[_0x01d8('0x44')],_0x317d42[_0x01d8('0x45')]);_0x5f1357[_0x01d8('0x47')]=_[_0x01d8('0x48')](_0x317d42['model'],qs[_0x01d8('0x49')](_0x36c338['query'][_0x01d8('0x49')]));_0x5f1357[_0x01d8('0x47')]=_0x5f1357[_0x01d8('0x47')][_0x01d8('0x4a')]?_0x5f1357['attributes']:_0x317d42[_0x01d8('0x44')];if(!_0x36c338[_0x01d8('0x45')][_0x01d8('0x4b')](_0x01d8('0x69'))){_0x5f1357[_0x01d8('0x31')]=qs[_0x01d8('0x31')](_0x36c338[_0x01d8('0x45')]['limit']);_0x5f1357['offset']=qs[_0x01d8('0x2f')](_0x36c338[_0x01d8('0x45')][_0x01d8('0x2f')]);}_0x5f1357[_0x01d8('0x4c')]=qs[_0x01d8('0x4d')](_0x36c338['query']['sort']);_0x5f1357[_0x01d8('0x4e')]=qs[_0x01d8('0x46')](_['pick'](_0x36c338['query'],_0x317d42[_0x01d8('0x46')]));_0x5f1357[_0x01d8('0x4e')][_0x01d8('0x65')]=_0x128eae['id'];if(_0x36c338[_0x01d8('0x45')][_0x01d8('0x52')]){_0x5f1357[_0x01d8('0x4e')]=_[_0x01d8('0x4f')](_0x5f1357[_0x01d8('0x4e')],{'$or':_[_0x01d8('0x40')](_0x5f1357['attributes'],function(_0x25d8ed){var _0x1ced71={};_0x1ced71[_0x25d8ed]={'$like':'%'+_0x36c338[_0x01d8('0x45')]['filter']+'%'};return _0x1ced71;})});}_0x5f1357=_['merge']({},_0x5f1357,_0x36c338[_0x01d8('0x53')]);return db[_0x01d8('0x66')]['count']({'where':_0x5f1357['where']})['then'](function(_0xe7c81){_0xa2416[_0x01d8('0x32')]=_0xe7c81;if(_0x36c338[_0x01d8('0x45')]['includeAll']){_0x5f1357[_0x01d8('0x58')]=[{'all':!![]}];}return db['Disposition'][_0x01d8('0x54')](_0x5f1357);})['then'](function(_0x39c4ae){_0xa2416[_0x01d8('0x6a')]=_0x39c4ae;return _0xa2416;});}})[_0x01d8('0x39')](respondWithFilteredResult(_0x1be7ef,_0x5f1357))[_0x01d8('0x2a')](handleError(_0x1be7ef,null));};exports[_0x01d8('0x6b')]=function(_0x5e77ed,_0x3b93ed,_0x2febd3){return db['FaxAccount'][_0x01d8('0x59')]({'where':{'id':_0x5e77ed[_0x01d8('0x64')]['id']}})['then'](handleEntityNotFound(_0x3b93ed,null))[_0x01d8('0x39')](function(_0x2fa30f){if(_0x2fa30f){return _0x2fa30f[_0x01d8('0x6b')](_0x5e77ed[_0x01d8('0x45')][_0x01d8('0x6c')]);}})['then'](respondWithStatusCode(_0x3b93ed,null))['catch'](handleError(_0x3b93ed,null));};exports[_0x01d8('0x6d')]=function(_0xca252e,_0x36bd43,_0x2f0553){if(_0xca252e[_0x01d8('0x5a')]['id']){delete _0xca252e[_0x01d8('0x5a')]['id'];}return db['FaxAccount'][_0x01d8('0x59')]({'where':{'id':_0xca252e[_0x01d8('0x64')]['id']}})[_0x01d8('0x39')](handleEntityNotFound(_0x36bd43,null))['then'](function(_0x1ce99f){if(_0x1ce99f){_0xca252e[_0x01d8('0x5a')][_0x01d8('0x65')]=_0x1ce99f['id'];return db['CannedAnswer']['create'](_0xca252e[_0x01d8('0x5a')]);}})['then'](respondWithResult(_0x36bd43,null))[_0x01d8('0x2a')](handleError(_0x36bd43,null));};exports['getAnswers']=function(_0x52c140,_0x4a589c,_0x30e972){var _0x16117a={'raw':![],'where':{}};var _0x2dd283={};var _0xe3abfe={'count':0x0,'rows':[]};return db[_0x01d8('0x41')][_0x01d8('0x68')]({'where':{'id':_0x52c140['params']['id']}})[_0x01d8('0x39')](handleEntityNotFound(_0x4a589c,null))[_0x01d8('0x39')](function(_0x584acf){if(_0x584acf){_0x2dd283[_0x01d8('0x44')]=_[_0x01d8('0x56')](db['CannedAnswer']['rawAttributes']);_0x2dd283[_0x01d8('0x45')]=_['keys'](_0x52c140[_0x01d8('0x45')]);_0x2dd283[_0x01d8('0x46')]=_[_0x01d8('0x48')](_0x2dd283['model'],_0x2dd283[_0x01d8('0x45')]);_0x16117a[_0x01d8('0x47')]=_['intersection'](_0x2dd283[_0x01d8('0x44')],qs[_0x01d8('0x49')](_0x52c140[_0x01d8('0x45')][_0x01d8('0x49')]));_0x16117a[_0x01d8('0x47')]=_0x16117a[_0x01d8('0x47')][_0x01d8('0x4a')]?_0x16117a[_0x01d8('0x47')]:_0x2dd283[_0x01d8('0x44')];if(!_0x52c140[_0x01d8('0x45')][_0x01d8('0x4b')](_0x01d8('0x69'))){_0x16117a['limit']=qs[_0x01d8('0x31')](_0x52c140[_0x01d8('0x45')][_0x01d8('0x31')]);_0x16117a[_0x01d8('0x2f')]=qs['offset'](_0x52c140[_0x01d8('0x45')][_0x01d8('0x2f')]);}_0x16117a[_0x01d8('0x4c')]=qs[_0x01d8('0x4d')](_0x52c140[_0x01d8('0x45')][_0x01d8('0x4d')]);_0x16117a[_0x01d8('0x4e')]=qs[_0x01d8('0x46')](_[_0x01d8('0x6e')](_0x52c140['query'],_0x2dd283['filters']));_0x16117a[_0x01d8('0x4e')][_0x01d8('0x65')]=_0x584acf['id'];if(_0x52c140[_0x01d8('0x45')][_0x01d8('0x52')]){_0x16117a[_0x01d8('0x4e')]=_[_0x01d8('0x4f')](_0x16117a['where'],{'$or':_[_0x01d8('0x40')](_0x16117a[_0x01d8('0x47')],function(_0x5cc5f5){var _0x3f2fd1={};_0x3f2fd1[_0x5cc5f5]={'$like':'%'+_0x52c140[_0x01d8('0x45')][_0x01d8('0x52')]+'%'};return _0x3f2fd1;})});}_0x16117a=_[_0x01d8('0x4f')]({},_0x16117a,_0x52c140[_0x01d8('0x53')]);return db[_0x01d8('0x6f')][_0x01d8('0x32')]({'where':_0x16117a[_0x01d8('0x4e')]})[_0x01d8('0x39')](function(_0x41b668){_0xe3abfe[_0x01d8('0x32')]=_0x41b668;if(_0x52c140['query'][_0x01d8('0x57')]){_0x16117a[_0x01d8('0x58')]=[{'all':!![]}];}return db[_0x01d8('0x6f')][_0x01d8('0x54')](_0x16117a);})[_0x01d8('0x39')](function(_0x1bbcac){_0xe3abfe['rows']=_0x1bbcac;return _0xe3abfe;});}})[_0x01d8('0x39')](respondWithFilteredResult(_0x4a589c,_0x16117a))[_0x01d8('0x2a')](handleError(_0x4a589c,null));};exports[_0x01d8('0x70')]=function(_0x577824,_0x23a777,_0x71a0c4){return db[_0x01d8('0x41')][_0x01d8('0x59')]({'where':{'id':_0x577824[_0x01d8('0x64')]['id']}})['then'](handleEntityNotFound(_0x23a777,null))[_0x01d8('0x39')](function(_0x7854f5){if(_0x7854f5){return _0x7854f5[_0x01d8('0x70')](_0x577824[_0x01d8('0x45')][_0x01d8('0x6c')]);}})['then'](respondWithStatusCode(_0x23a777,null))[_0x01d8('0x2a')](handleError(_0x23a777,null));};exports['addInteraction']=function(_0x9090b3,_0x3e7981,_0x56477c){return db[_0x01d8('0x71')][_0x01d8('0x59')]({'where':{'id':_0x9090b3[_0x01d8('0x64')]['id']}})[_0x01d8('0x39')](handleEntityNotFound(_0x3e7981,null))[_0x01d8('0x39')](function(_0x5b5922){if(_0x5b5922){return _0x5b5922[_0x01d8('0x72')](_0x9090b3['body'][_0x01d8('0x6c')],_[_0x01d8('0x73')](_0x9090b3['body'],[_0x01d8('0x6c'),'id'])||{});}})[_0x01d8('0x39')](respondWithResult(_0x3e7981,null))['catch'](handleError(_0x3e7981,null));};exports[_0x01d8('0x74')]=function(_0x11e501,_0x4161f3,_0x16d218){var _0x59e788={'raw':![],'where':{}};var _0x8012f9={};var _0x1bdf74={'count':0x0,'rows':[]};return db['FaxAccount'][_0x01d8('0x68')]({'where':{'id':_0x11e501[_0x01d8('0x64')]['id']}})[_0x01d8('0x39')](handleEntityNotFound(_0x4161f3,null))[_0x01d8('0x39')](function(_0x51a620){if(_0x51a620){_0x8012f9[_0x01d8('0x44')]=_['keys'](db[_0x01d8('0x71')][_0x01d8('0x42')]);_0x8012f9[_0x01d8('0x45')]=_['keys'](_0x11e501[_0x01d8('0x45')]);_0x8012f9[_0x01d8('0x46')]=_[_0x01d8('0x48')](_0x8012f9[_0x01d8('0x44')],_0x8012f9[_0x01d8('0x45')]);_0x59e788[_0x01d8('0x47')]=_[_0x01d8('0x48')](_0x8012f9['model'],qs[_0x01d8('0x49')](_0x11e501[_0x01d8('0x45')][_0x01d8('0x49')]));_0x59e788[_0x01d8('0x47')]=_0x59e788[_0x01d8('0x47')][_0x01d8('0x4a')]?_0x59e788[_0x01d8('0x47')]:_0x8012f9['model'];if(!_0x11e501[_0x01d8('0x45')][_0x01d8('0x4b')](_0x01d8('0x69'))){_0x59e788[_0x01d8('0x31')]=qs[_0x01d8('0x31')](_0x11e501[_0x01d8('0x45')][_0x01d8('0x31')]);_0x59e788[_0x01d8('0x2f')]=qs[_0x01d8('0x2f')](_0x11e501[_0x01d8('0x45')]['offset']);}_0x59e788[_0x01d8('0x4c')]=qs[_0x01d8('0x4d')](_0x11e501[_0x01d8('0x45')][_0x01d8('0x4d')]);_0x59e788[_0x01d8('0x4e')]=qs[_0x01d8('0x46')](_[_0x01d8('0x6e')](_0x11e501[_0x01d8('0x45')],_0x8012f9[_0x01d8('0x46')]));_0x59e788[_0x01d8('0x4e')]['FaxAccountId']=_0x51a620['id'];if(_0x11e501[_0x01d8('0x45')]['filter']){_0x59e788[_0x01d8('0x4e')]=_[_0x01d8('0x4f')](_0x59e788[_0x01d8('0x4e')],{'$or':_[_0x01d8('0x40')](_0x59e788[_0x01d8('0x47')],function(_0x5531bc){var _0x1a76d5={};_0x1a76d5[_0x5531bc]={'$like':'%'+_0x11e501[_0x01d8('0x45')][_0x01d8('0x52')]+'%'};return _0x1a76d5;})});}_0x59e788=_[_0x01d8('0x4f')]({},_0x59e788,_0x11e501[_0x01d8('0x53')]);return db[_0x01d8('0x71')][_0x01d8('0x32')]({'where':_0x59e788[_0x01d8('0x4e')]})[_0x01d8('0x39')](function(_0x4f5494){_0x1bdf74[_0x01d8('0x32')]=_0x4f5494;if(_0x11e501[_0x01d8('0x45')][_0x01d8('0x57')]){_0x59e788[_0x01d8('0x58')]=[{'model':db['CmContact'],'as':_0x01d8('0x75'),'required':![]},{'model':db['User'],'as':_0x01d8('0x76'),'attributes':[_0x01d8('0x3b'),_0x01d8('0x77'),_0x01d8('0x78')],'required':![]},{'model':db[_0x01d8('0x79')],'as':_0x01d8('0x7a'),'attributes':['id',_0x01d8('0x3b'),_0x01d8('0x7b')],'where':_0x11e501[_0x01d8('0x45')]['tag']?{'id':_0x11e501[_0x01d8('0x45')][_0x01d8('0x7c')]}:undefined,'required':_0x11e501[_0x01d8('0x45')][_0x01d8('0x7c')]?!![]:![]}];}return db['FaxInteraction'][_0x01d8('0x54')](_0x59e788);})[_0x01d8('0x39')](function(_0xd02134){_0x1bdf74['rows']=_0xd02134;return _0x1bdf74;});}})[_0x01d8('0x39')](respondWithFilteredResult(_0x4161f3,_0x59e788))[_0x01d8('0x2a')](handleError(_0x4161f3,null));};exports[_0x01d8('0x7d')]=function(_0xcda7e4,_0xff9089){var _0x1485ad=_0xcda7e4['params']['id'];var _0x5ac4ff=_0xcda7e4[_0x01d8('0x5a')];var _0x50b987=0xc8;var _0x334d17=null;return db['sequelize'][_0x01d8('0x7e')]({'isolationLevel':db['sequelize']['Transaction']['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x446ea2){return db[_0x01d8('0x41')][_0x01d8('0x68')]({'where':{'id':_0x1485ad},'transaction':_0x446ea2})[_0x01d8('0x39')](function(_0x36b5ac){if(_0x36b5ac){return db[_0x01d8('0x7f')][_0x01d8('0x37')]({'where':{'FaxAccountId':_0x1485ad},'transaction':_0x446ea2})[_0x01d8('0x39')](function(){var _0x5d811a=_[_0x01d8('0x40')](_0x5ac4ff,function(_0x15d7be){_0x15d7be[_0x01d8('0x65')]=_0x1485ad;return _0x15d7be;});return db['FaxApplication']['bulkCreate'](_0x5d811a,{'transaction':_0x446ea2});});}else{_0x50b987=0x194;_0x334d17=[];}});})[_0x01d8('0x39')](function(){if(_0x50b987!==0x194){return db['FaxApplication']['findAndCountAll']({'where':{'FaxAccountId':_0x1485ad},'order':_0x01d8('0x80')})[_0x01d8('0x39')](function(_0x4f2ecc){_0x334d17=_0x4f2ecc;});}})[_0x01d8('0x2a')](function(_0x55981a){_0x50b987=0x1f4;logger[_0x01d8('0x27')](_0x55981a['stack']);if(_0x55981a[_0x01d8('0x3b')]){delete _0x55981a[_0x01d8('0x3b')];}_0x334d17=_0x55981a;})[_0x01d8('0x81')](function(){if(_0x334d17===null){_0xff9089['sendStatus'](_0x50b987);}else{if(_0x50b987===0x1f4){_0xff9089[_0x01d8('0x2c')](_0x50b987)[_0x01d8('0x3c')](_0x334d17);}else{_0xff9089[_0x01d8('0x2c')](_0x50b987)[_0x01d8('0x2e')](_0x334d17);}}});};exports['getApplications']=function(_0x306fb1,_0x33b8d3,_0x4f408b){var _0x1b8e14={};var _0x22318b={};var _0x24013d;var _0x2f9295;return db[_0x01d8('0x41')][_0x01d8('0x68')]({'where':{'id':_0x306fb1[_0x01d8('0x64')]['id']}})['then'](handleEntityNotFound(_0x33b8d3,null))[_0x01d8('0x39')](function(_0x2bd6f7){if(_0x2bd6f7){_0x24013d=_0x2bd6f7;_0x22318b['model']=_[_0x01d8('0x56')](db[_0x01d8('0x7f')][_0x01d8('0x42')]);_0x22318b[_0x01d8('0x45')]=_[_0x01d8('0x56')](_0x306fb1[_0x01d8('0x45')]);_0x22318b[_0x01d8('0x46')]=_[_0x01d8('0x48')](_0x22318b[_0x01d8('0x44')],_0x22318b['query']);_0x1b8e14[_0x01d8('0x47')]=_[_0x01d8('0x48')](_0x22318b['model'],qs[_0x01d8('0x49')](_0x306fb1[_0x01d8('0x45')][_0x01d8('0x49')]));_0x1b8e14[_0x01d8('0x47')]=_0x1b8e14[_0x01d8('0x47')][_0x01d8('0x4a')]?_0x1b8e14[_0x01d8('0x47')]:_0x22318b['model'];_0x1b8e14[_0x01d8('0x4c')]=qs[_0x01d8('0x4d')](_0x306fb1[_0x01d8('0x45')][_0x01d8('0x4d')]);_0x1b8e14[_0x01d8('0x4e')]=qs[_0x01d8('0x46')](_['pick'](_0x306fb1[_0x01d8('0x45')],_0x22318b[_0x01d8('0x46')]));if(_0x306fb1['query'][_0x01d8('0x52')]){_0x1b8e14[_0x01d8('0x4e')]=_[_0x01d8('0x4f')](_0x1b8e14[_0x01d8('0x4e')],{'$or':_[_0x01d8('0x40')](_0x1b8e14[_0x01d8('0x47')],function(_0x184ca6){var _0x4ba473={};_0x4ba473[_0x184ca6]={'$like':'%'+_0x306fb1[_0x01d8('0x45')]['filter']+'%'};return _0x4ba473;})});}_0x1b8e14=_[_0x01d8('0x4f')]({},_0x1b8e14,_0x306fb1['options']);return _0x24013d[_0x01d8('0x82')](_0x1b8e14);}})[_0x01d8('0x39')](function(_0x1fec73){if(_0x1fec73){_0x2f9295=_0x1fec73['length'];if(!_0x306fb1[_0x01d8('0x45')][_0x01d8('0x4b')](_0x01d8('0x69'))){_0x1b8e14['limit']=qs['limit'](_0x306fb1[_0x01d8('0x45')][_0x01d8('0x31')]);_0x1b8e14[_0x01d8('0x2f')]=qs[_0x01d8('0x2f')](_0x306fb1[_0x01d8('0x45')]['offset']);}return _0x24013d[_0x01d8('0x82')](_0x1b8e14);}})[_0x01d8('0x39')](function(_0xf807a7){if(_0xf807a7){return _0xf807a7?{'count':_0x2f9295,'rows':_0xf807a7}:null;}})[_0x01d8('0x39')](respondWithResult(_0x33b8d3,null))['catch'](handleError(_0x33b8d3,null));};function Extension(_0x25a616,_0x538a0d,_0x55911b,_0x2325ff){this[_0x01d8('0x83')]=_0x01d8('0x84');this[_0x01d8('0x85')]=_0x25a616[_0x01d8('0x86')];this[_0x01d8('0x87')]=_0x2325ff;this[_0x01d8('0x50')]=_0x01d8('0x88');this['description']=_0x01d8('0x89');this['FaxAccountId']=_0x25a616['id'];this[_0x01d8('0x80')]=_0x538a0d;this[_0x01d8('0x8a')]=_0x55911b;}function createExtensionsReciveFax(_0x586259){var _0x62b66b=0x1;var _0x5f3fd2=[];_0x5f3fd2[_0x01d8('0x8b')](new Extension(_0x586259,_0x62b66b,'',_0x01d8('0x8c')));_0x62b66b+=0x1;_0x5f3fd2['push'](new Extension(_0x586259,_0x62b66b,_0x01d8('0x8d'),_0x01d8('0x8e')));_0x62b66b+=0x1;for(var _0x1dc8b3 in _0x586259){if(_0x586259[_0x01d8('0x4b')](_0x1dc8b3)&&(_0x1dc8b3==='ecm'||_0x1dc8b3===_0x01d8('0x86')||_0x1dc8b3==='gateway'||_0x1dc8b3==='faxdetect'||_0x1dc8b3===_0x01d8('0x8f')||_0x1dc8b3===_0x01d8('0x90')||_0x1dc8b3==='minrate'||_0x1dc8b3===_0x01d8('0x91')||_0x1dc8b3===_0x01d8('0x92'))){_0x5f3fd2[_0x01d8('0x8b')](new Extension(_0x586259,_0x62b66b,_0x01d8('0x93')+_0x1dc8b3+')='+_0x586259[_0x1dc8b3],'Set'));_0x62b66b+=0x1;}}_0x5f3fd2[_0x01d8('0x8b')](new Extension(_0x586259,_0x62b66b,'6',_0x01d8('0x94')));_0x62b66b+=0x1;_0x5f3fd2[_0x01d8('0x8b')](new Extension(_0x586259,_0x62b66b,'/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'));_0x62b66b=0x0;return _0x5f3fd2;}exports['addAccountApplications']=function(_0x35d7f6,_0x3b88d0,_0x33bf6e){var _0x830074;return db[_0x01d8('0x95')][_0x01d8('0x7e')](function(_0x39ba44){return db[_0x01d8('0x41')]['create'](_0x35d7f6[_0x01d8('0x5a')],{'transaction':_0x39ba44})['then'](function(_0x355902){_0x830074=_0x355902['get']({'plain':!![]});return db[_0x01d8('0x96')]['bulkCreate'](createExtensionsReciveFax(_0x830074),{'transaction':_0x39ba44});});})['then'](function(){return _0x830074;})[_0x01d8('0x39')](respondWithResult(_0x3b88d0,null))[_0x01d8('0x2a')](handleError(_0x3b88d0,null));};exports[_0x01d8('0x97')]=function(_0xd1fcb7,_0x2a4ae3,_0x1a7607){var _0x46e821;return db[_0x01d8('0x95')]['transaction'](function(_0x214dbf){return db['FaxAccount']['update'](_0xd1fcb7[_0x01d8('0x5a')],{'where':{'id':_0xd1fcb7[_0x01d8('0x5a')]['id']},'transaction':_0x214dbf})[_0x01d8('0x39')](function(_0x59d1c3){return db[_0x01d8('0x96')]['destroy']({'where':{'FaxAccountId':_0xd1fcb7[_0x01d8('0x5a')]['id']},'transaction':_0x214dbf})['then'](function(_0x2db002){return db[_0x01d8('0x96')][_0x01d8('0x98')](createExtensionsReciveFax(_[_0x01d8('0x73')](_0xd1fcb7[_0x01d8('0x5a')],[_0x01d8('0x99'),_0x01d8('0x43'),_0x01d8('0x9a'),_0x01d8('0x9b'),_0x01d8('0x9c'),'ListId'])),{'transaction':_0x214dbf});});});})[_0x01d8('0x39')](function(){return db['FaxAccount'][_0x01d8('0x9d')](_0xd1fcb7[_0x01d8('0x5a')]['id']);})['then'](respondWithResult(_0x2a4ae3,null))[_0x01d8('0x2a')](handleError(_0x2a4ae3,null));};exports[_0x01d8('0x9e')]=function(_0x45831b,_0x3b8caf,_0x1d3692){var _0x1f123a={'raw':!![],'where':{}};var _0x38cb59={};var _0x5c9dff={'count':0x0,'rows':[]};return db[_0x01d8('0x41')][_0x01d8('0x68')]({'where':{'id':_0x45831b[_0x01d8('0x64')]['id']}})[_0x01d8('0x39')](handleEntityNotFound(_0x3b8caf,null))[_0x01d8('0x39')](function(_0x510b1e){if(_0x510b1e){_0x38cb59[_0x01d8('0x44')]=_[_0x01d8('0x56')](db[_0x01d8('0x9f')][_0x01d8('0x42')]);_0x38cb59[_0x01d8('0x45')]=_['keys'](_0x45831b[_0x01d8('0x45')]);_0x38cb59[_0x01d8('0x46')]=_[_0x01d8('0x48')](_0x38cb59[_0x01d8('0x44')],_0x38cb59[_0x01d8('0x45')]);_0x1f123a[_0x01d8('0x47')]=_[_0x01d8('0x48')](_0x38cb59[_0x01d8('0x44')],qs['fields'](_0x45831b[_0x01d8('0x45')][_0x01d8('0x49')]));_0x1f123a[_0x01d8('0x47')]=_0x1f123a[_0x01d8('0x47')]['length']?_0x1f123a['attributes']:_0x38cb59[_0x01d8('0x44')];if(!_0x45831b[_0x01d8('0x45')][_0x01d8('0x4b')]('nolimit')){_0x1f123a[_0x01d8('0x31')]=qs[_0x01d8('0x31')](_0x45831b[_0x01d8('0x45')][_0x01d8('0x31')]);_0x1f123a['offset']=qs[_0x01d8('0x2f')](_0x45831b['query'][_0x01d8('0x2f')]);}_0x1f123a['order']=qs[_0x01d8('0x4d')](_0x45831b['query'][_0x01d8('0x4d')]);_0x1f123a[_0x01d8('0x4e')]=qs['filters'](_[_0x01d8('0x6e')](_0x45831b[_0x01d8('0x45')],_0x38cb59['filters']));_0x1f123a['where'][_0x01d8('0x65')]=_0x510b1e['id'];if(_0x45831b[_0x01d8('0x45')][_0x01d8('0x52')]){_0x1f123a['where']=_['merge'](_0x1f123a[_0x01d8('0x4e')],{'$or':_[_0x01d8('0x40')](_0x1f123a['attributes'],function(_0x1f4704){var _0x5c28df={};_0x5c28df[_0x1f4704]={'$like':'%'+_0x45831b['query'][_0x01d8('0x52')]+'%'};return _0x5c28df;})});}if(_0x45831b['query'][_0x01d8('0xa0')]){var _0x5e0a47=_0x45831b[_0x01d8('0x45')][_0x01d8('0xa0')][_0x01d8('0xa1')](',');var _0x1cd2f2={};_0x1cd2f2[_0x5e0a47[0x0]]={'$gte':moment(_0x5e0a47[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x1f123a['where']=_[_0x01d8('0x4f')](_0x1f123a[_0x01d8('0x4e')],_0x1cd2f2);}_0x1f123a=_[_0x01d8('0x4f')]({},_0x1f123a,_0x45831b[_0x01d8('0x53')]);return db[_0x01d8('0x9f')][_0x01d8('0x32')]({'where':_0x1f123a['where']})[_0x01d8('0x39')](function(_0x3fd6d9){_0x5c9dff[_0x01d8('0x32')]=_0x3fd6d9;if(_0x45831b[_0x01d8('0x45')][_0x01d8('0x57')]){_0x1f123a['include']=[{'all':!![]}];}return db['FaxMessage'][_0x01d8('0x54')](_0x1f123a);})[_0x01d8('0x39')](function(_0x26f92b){_0x5c9dff['rows']=_0x26f92b;return _0x5c9dff;});}})[_0x01d8('0x39')](respondWithFilteredResult(_0x3b8caf,_0x1f123a))[_0x01d8('0x2a')](handleError(_0x3b8caf,null));};exports[_0x01d8('0x3c')]=function(_0x4568a8,_0x4fa68a,_0x20b880){var _0x2a0a90,_0x14e8a1={},_0x2dd960;if(_0x4568a8[_0x01d8('0x5a')]['to']){_0x2dd960=_0x4568a8['body']['to'][0x0];}return db['FaxAccount'][_0x01d8('0x59')]({'where':{'id':_0x4568a8[_0x01d8('0x64')]['id']},'include':[{'model':db[_0x01d8('0xa2')],'as':'List','include':[{'model':db['CmContact'],'as':_0x01d8('0xa3'),'where':{'fax':_0x2dd960},'limit':0x1,'order':[['updatedAt',_0x01d8('0xa4')]]}]}]})[_0x01d8('0x39')](handleEntityNotFound(_0x4fa68a,null))['then'](function(_0x142033){_0x2a0a90=_0x142033;if(_0x4568a8[_0x01d8('0x5a')]['attachments']&&_0x4568a8[_0x01d8('0x5a')][_0x01d8('0xa5')][_0x01d8('0x4a')]){for(var _0x451472=0x0;_0x451472<_0x4568a8[_0x01d8('0x5a')][_0x01d8('0xa5')][_0x01d8('0x4a')];_0x451472+=0x1){_0x4568a8[_0x01d8('0x5a')]['attachments'][_0x451472]={'filename':_0x4568a8[_0x01d8('0x5a')][_0x01d8('0xa5')][_0x451472][_0x01d8('0x3b')],'id':_0x4568a8[_0x01d8('0x5a')][_0x01d8('0xa5')][_0x451472]['id'],'path':path[_0x01d8('0xa6')](config[_0x01d8('0xa7')],'server/files/attachments',_0x4568a8['body']['attachments'][_0x451472][_0x01d8('0xa8')])};}}return respondWithRpcPromise(_0x01d8('0xa9'),'CheckAfterSend',{'FaxAccountId':_[_0x01d8('0xaa')](_0x4568a8['params']['id'])?undefined:_0x4568a8['params']['id'],'path':_[_0x01d8('0xaa')](_0x4568a8[_0x01d8('0x5a')][_0x01d8('0xa5')][0x0]['path'])?undefined:_0x4568a8[_0x01d8('0x5a')][_0x01d8('0xa5')][0x0][_0x01d8('0x7')],'fax':_[_0x01d8('0xaa')](_0x4568a8[_0x01d8('0x5a')]['to'][0x0])?undefined:_0x4568a8[_0x01d8('0x5a')]['to'][0x0]},client9002);})['then'](function(){if(_0x2a0a90){if(_['isNil'](_0x4568a8[_0x01d8('0x5a')][_0x01d8('0xab')])){_0x4568a8[_0x01d8('0x5a')]['from']=util[_0x01d8('0xac')](_0x01d8('0xad'),_0x2a0a90['name'],_0x2a0a90[_0x01d8('0xae')]);}if(_0x2a0a90[_0x01d8('0xaf')]){if(_0x2a0a90[_0x01d8('0xaf')]['Contacts']['length']){return _0x2a0a90[_0x01d8('0xaf')][_0x01d8('0xa3')][0x0];}else{return db[_0x01d8('0xb0')]['create'](_[_0x01d8('0x1a')](_0x4568a8[_0x01d8('0x5a')],{'firstName':_0x4568a8[_0x01d8('0x5a')]['to'][0x0],'phone':_0x4568a8['body']['to'][0x0],'fax':_0x4568a8[_0x01d8('0x5a')]['to'][0x0],'ListId':_0x2a0a90[_0x01d8('0xb1')]}));}}else{throw new Error(_0x01d8('0xb2'));}}else{throw new Error('Send\x20Fax\x20failed');}})[_0x01d8('0x39')](function(_0x10a966){if(_0x10a966){return db[_0x01d8('0x71')][_0x01d8('0x59')]({'where':{'ContactId':_0x10a966['id'],'closed':![],'FaxAccountId':_0x2a0a90['id']}})[_0x01d8('0x39')](function(_0x4e7126){if(_0x4e7126){return[_0x4e7126,![]];}return db[_0x01d8('0x71')][_0x01d8('0xb3')]({'UserId':_0x4568a8[_0x01d8('0x5b')]['id'],'ContactId':_0x10a966['id'],'FaxAccountId':_0x2a0a90['id'],'fax':_0x4568a8[_0x01d8('0x5a')]['to'][0x0],'firstMsgDirection':_0x01d8('0xb4'),'Messages':[_[_0x01d8('0x4f')](_0x4568a8['body'],{'read':![],'body':_0x4568a8[_0x01d8('0x5a')][_0x01d8('0xa5')][0x0][_0x01d8('0xb5')],'FaxAccountId':_0x2a0a90['id'],'UserId':_0x4568a8[_0x01d8('0x5b')]['id'],'ContactId':_0x10a966['id'],'AttachmentId':_0x4568a8[_0x01d8('0x5a')][_0x01d8('0xa5')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0x01d8('0xb6')}]})[_0x01d8('0x39')](function(_0x4af6e2){return[_0x4af6e2,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x01d8('0xb7')](function(_0x7bcd51,_0xa46279){if(_0xa46279){return _0x7bcd51;}return db[_0x01d8('0x9f')]['create']({'direction':_0x01d8('0xb4'),'read':![],'body':_0x4568a8[_0x01d8('0x5a')][_0x01d8('0xa5')][0x0][_0x01d8('0xb5')],'FaxAccountId':_0x2a0a90['id'],'FaxInteractionId':_0x7bcd51['id'],'UserId':_0x4568a8['user']['id'],'ContactId':_0x7bcd51[_0x01d8('0xb8')],'AttachmentId':_0x4568a8['body'][_0x01d8('0xa5')][0x0]['id']})['then'](function(_0x22a3c2){_0x7bcd51[_0x01d8('0xb9')][_0x01d8('0xb6')]=[];_0x7bcd51[_0x01d8('0xb9')][_0x01d8('0xb6')][_0x01d8('0x8b')](_0x22a3c2[_0x01d8('0xb9')]);return _0x7bcd51;});})[_0x01d8('0x39')](function(_0x5a8f68){respondWithRpcPromise(_0x01d8('0xba'),_0x01d8('0xba'),{'FaxAccountId':_[_0x01d8('0xaa')](_0x4568a8['params']['id'])?undefined:_0x4568a8[_0x01d8('0x64')]['id'],'path':_[_0x01d8('0xaa')](_0x4568a8[_0x01d8('0x5a')][_0x01d8('0xa5')][0x0][_0x01d8('0x7')])?undefined:_0x4568a8[_0x01d8('0x5a')][_0x01d8('0xa5')][0x0][_0x01d8('0x7')],'fax':_['isNil'](_0x4568a8[_0x01d8('0x5a')]['to'][0x0])?undefined:_0x4568a8[_0x01d8('0x5a')]['to'][0x0],'AttachmentId':_0x4568a8['body'][_0x01d8('0xa5')][0x0]['id']},client9002)[_0x01d8('0x39')](function(_0x553b70){logger[_0x01d8('0x22')](_0x01d8('0xbb'),_0x553b70);})['catch'](function(_0x1642c5){logger[_0x01d8('0x22')](_0x01d8('0xbb'),_0x1642c5);});return _0x5a8f68;})['then'](respondWithResult(_0x4fa68a,null))['catch'](handleError(_0x4fa68a,null));};exports[_0x01d8('0xbc')]=function(_0x109be3,_0x524ccd,_0x1364aa){return db[_0x01d8('0x41')]['find']({'where':{'id':_0x109be3['params']['id']}})[_0x01d8('0x39')](handleEntityNotFound(_0x524ccd,null))[_0x01d8('0x39')](function(_0x536ff7){if(_0x536ff7){return _0x536ff7[_0x01d8('0xbc')](_0x109be3['body']['ids'],_['omit'](_0x109be3[_0x01d8('0x5a')],[_0x01d8('0x6c'),'id'])||{})[_0x01d8('0xb7')](function(_0x46ffb3){for(var _0x3a26aa=0x0;_0x3a26aa<_0x109be3[_0x01d8('0x5a')]['ids'][_0x01d8('0x4a')];_0x3a26aa+=0x1){socket['emit'](_0x01d8('0xbd'),{'UserId':Number(_0x109be3[_0x01d8('0x5a')][_0x01d8('0x6c')][_0x3a26aa]),'FaxAccountId':Number(_0x109be3[_0x01d8('0x64')]['id'])});}return _0x46ffb3;});}})[_0x01d8('0x39')](respondWithResult(_0x524ccd,null))['catch'](handleError(_0x524ccd,null));};exports[_0x01d8('0xbe')]=function(_0x5ad3f7,_0x3422ad,_0x33dba8){return db[_0x01d8('0x41')][_0x01d8('0x59')]({'where':{'id':_0x5ad3f7['params']['id']}})[_0x01d8('0x39')](handleEntityNotFound(_0x3422ad,null))['then'](function(_0x432aaf){if(_0x432aaf){return _0x432aaf['removeAgents'](_0x5ad3f7[_0x01d8('0x45')][_0x01d8('0x6c')])[_0x01d8('0x39')](function(){if(_[_0x01d8('0xbf')](_0x5ad3f7[_0x01d8('0x45')][_0x01d8('0x6c')])){for(var _0x4ec0aa=0x0;_0x4ec0aa<_0x5ad3f7[_0x01d8('0x45')]['ids']['length'];_0x4ec0aa+=0x1){socket[_0x01d8('0xc0')]('userFaxAccount:remove',{'UserId':Number(_0x5ad3f7['query'][_0x01d8('0x6c')][_0x4ec0aa]),'FaxAccountId':Number(_0x5ad3f7['params']['id'])});}}else{socket[_0x01d8('0xc0')](_0x01d8('0xc1'),{'UserId':Number(_0x5ad3f7[_0x01d8('0x45')][_0x01d8('0x6c')]),'FaxAccountId':Number(_0x5ad3f7[_0x01d8('0x64')]['id'])});}});}})[_0x01d8('0x39')](respondWithStatusCode(_0x3422ad,null))['catch'](handleError(_0x3422ad,null));};exports[_0x01d8('0xc2')]=function(_0x4c3157,_0x22e67f,_0x5ed5ea){var _0x4f847a={};var _0x2d216d={};var _0x341048;var _0x4c101c;return db[_0x01d8('0x41')][_0x01d8('0x68')]({'where':{'id':_0x4c3157[_0x01d8('0x64')]['id']}})[_0x01d8('0x39')](handleEntityNotFound(_0x22e67f,null))[_0x01d8('0x39')](function(_0x5ad0a8){if(_0x5ad0a8){_0x341048=_0x5ad0a8;_0x2d216d[_0x01d8('0x44')]=_[_0x01d8('0x56')](db[_0x01d8('0xc3')][_0x01d8('0x42')]);_0x2d216d[_0x01d8('0x45')]=_['keys'](_0x4c3157[_0x01d8('0x45')]);_0x2d216d[_0x01d8('0x46')]=_[_0x01d8('0x48')](_0x2d216d['model'],_0x2d216d['query']);_0x4f847a[_0x01d8('0x47')]=_[_0x01d8('0x48')](_0x2d216d[_0x01d8('0x44')],qs[_0x01d8('0x49')](_0x4c3157[_0x01d8('0x45')][_0x01d8('0x49')]));_0x4f847a[_0x01d8('0x47')]=_0x4f847a['attributes'][_0x01d8('0x4a')]?_0x4f847a[_0x01d8('0x47')]:_0x2d216d['model'];_0x4f847a[_0x01d8('0x4c')]=qs[_0x01d8('0x4d')](_0x4c3157[_0x01d8('0x45')][_0x01d8('0x4d')]);_0x4f847a['where']=qs[_0x01d8('0x46')](_[_0x01d8('0x6e')](_0x4c3157[_0x01d8('0x45')],_0x2d216d[_0x01d8('0x46')]));if(_0x4c3157[_0x01d8('0x45')]['filter']){_0x4f847a[_0x01d8('0x4e')]=_[_0x01d8('0x4f')](_0x4f847a['where'],{'$or':_[_0x01d8('0x40')](_0x4f847a[_0x01d8('0x47')],function(_0xb2b8ae){var _0x4b340d={};_0x4b340d[_0xb2b8ae]={'$like':'%'+_0x4c3157[_0x01d8('0x45')][_0x01d8('0x52')]+'%'};return _0x4b340d;})});}_0x4f847a=_[_0x01d8('0x4f')]({},_0x4f847a,_0x4c3157['options']);return _0x341048[_0x01d8('0xc2')](_0x4f847a);}})[_0x01d8('0x39')](function(_0x37806d){if(_0x37806d){_0x4c101c=_0x37806d[_0x01d8('0x4a')];if(!_0x4c3157['query']['hasOwnProperty'](_0x01d8('0x69'))){_0x4f847a['limit']=qs[_0x01d8('0x31')](_0x4c3157[_0x01d8('0x45')][_0x01d8('0x31')]);_0x4f847a[_0x01d8('0x2f')]=qs[_0x01d8('0x2f')](_0x4c3157[_0x01d8('0x45')]['offset']);}return _0x341048[_0x01d8('0xc2')](_0x4f847a);}})[_0x01d8('0x39')](function(_0x566b05){if(_0x566b05){return _0x566b05?{'count':_0x4c101c,'rows':_0x566b05}:null;}})[_0x01d8('0x39')](respondWithResult(_0x22e67f,null))[_0x01d8('0x2a')](handleError(_0x22e67f,null));}; \ No newline at end of file +var _0x002b=['getInteractions','FaxInteraction','CmContact','Contact','Owner','fullname','internal','color','tag','transaction','sequelize','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','priority','stack','finally','getApplications','localstationid','app','type','system','description','appdata','push','CDR(type)=inbound-fax','Set','ecm','gateway','headerinfo','modem','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','updateAccountApplications','tech','ListId','findById','getMessages','FaxMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','List','Contacts','updatedAt','DESC','attachments','join','server/files/attachments','basename','CheckAfterSend','isNil','path','from','fax','Send\x20Fax\x20failed','user','filename','spread','ContactId','Messages','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','removeAgents','isArray','userFaxAccount:remove','getAgents','User','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','FaxAccounts','UserProfileResource','end','name','send','index','map','rawAttributes','fieldName','key','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','FaxAccount','findAll','show','params','mandatoryDispositionPause','keys','options','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','FaxAccountId','Disposition','getDispositions','findOne','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','order','removeAnswers','addInteraction','omit'];(function(_0x394b3b,_0xa13ef1){var _0x5c9eb1=function(_0x2ffa8d){while(--_0x2ffa8d){_0x394b3b['push'](_0x394b3b['shift']());}};_0x5c9eb1(++_0xa13ef1);}(_0x002b,0x10b));var _0xb002=function(_0x228a4a,_0x23d65e){_0x228a4a=_0x228a4a-0x0;var _0x3d3937=_0x002b[_0x228a4a];return _0x3d3937;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb002('0x0'));var jsonpatch=require(_0xb002('0x1'));var rp=require(_0xb002('0x2'));var moment=require(_0xb002('0x3'));var BPromise=require(_0xb002('0x4'));var Mustache=require('mustache');var util=require(_0xb002('0x5'));var path=require('path');var sox=require(_0xb002('0x6'));var csv=require(_0xb002('0x7'));var ejs=require(_0xb002('0x8'));var fs=require('fs');var fs_extra=require(_0xb002('0x9'));var _=require(_0xb002('0xa'));var squel=require('squel');var crypto=require(_0xb002('0xb'));var jsforce=require(_0xb002('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xb002('0x7'));var querystring=require(_0xb002('0xd'));var Papa=require(_0xb002('0xe'));var Redis=require(_0xb002('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb002('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0xb002('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xb002('0x12'));var db=require(_0xb002('0x13'))['db'];config['redis']=_[_0xb002('0x14')](config[_0xb002('0x15')],{'host':_0xb002('0x16'),'port':0x18eb});var socket=require(_0xb002('0x17'))(new Redis(config[_0xb002('0x15')]));require('./faxAccount.socket')[_0xb002('0x18')](socket);var jayson=require(_0xb002('0x19'));var client=jayson[_0xb002('0x1a')][_0xb002('0x1b')]({'port':0x232c});var client9002=jayson[_0xb002('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ad824,_0x2b4df6,_0x206094,_0x399bd1){return new BPromise(function(_0x53f2da,_0x5102ed){var _0x53c259=_0x399bd1||client;return _0x53c259[_0xb002('0x1c')](_0x4ad824,_0x206094)[_0xb002('0x1d')](function(_0x4e9ea3){logger[_0xb002('0x1e')](_0xb002('0x1f'),_0x2b4df6,_0xb002('0x20'));logger['debug'](_0xb002('0x21'),_0x2b4df6,_0xb002('0x20'),JSON[_0xb002('0x22')](_0x4e9ea3));if(_0x4e9ea3[_0xb002('0x23')]){if(_0x4e9ea3[_0xb002('0x23')]['code']===0x1f4){logger['error'](_0xb002('0x1f'),_0x2b4df6,_0x4e9ea3[_0xb002('0x23')][_0xb002('0x24')]);return _0x5102ed(_0x4e9ea3[_0xb002('0x23')][_0xb002('0x24')]);}logger[_0xb002('0x23')]('FaxAccount,\x20%s,\x20%s',_0x2b4df6,_0x4e9ea3['error'][_0xb002('0x24')]);return _0x53f2da(_0x4e9ea3[_0xb002('0x23')]['message']);}else{logger[_0xb002('0x1e')](_0xb002('0x1f'),_0x2b4df6,'request\x20sent');_0x53f2da(_0x4e9ea3[_0xb002('0x25')]['message']);}})[_0xb002('0x26')](function(_0x229aba){logger[_0xb002('0x23')]('FaxAccount,\x20%s,\x20%s',_0x2b4df6,_0x229aba);_0x5102ed(_0x229aba);});});}function respondWithStatusCode(_0x476257,_0x4ebdd2){_0x4ebdd2=_0x4ebdd2||0xcc;return function(_0x57a1eb){if(_0x57a1eb){return _0x476257[_0xb002('0x27')](_0x4ebdd2);}return _0x476257[_0xb002('0x28')](_0x4ebdd2)['end']();};}function respondWithResult(_0x4b3dfa,_0x2d9da5){_0x2d9da5=_0x2d9da5||0xc8;return function(_0x224e53){if(_0x224e53){return _0x4b3dfa['status'](_0x2d9da5)[_0xb002('0x29')](_0x224e53);}};}function respondWithFilteredResult(_0x1fc580,_0x57338d){return function(_0x7a2794){if(_0x7a2794){var _0x6a0aa6=typeof _0x57338d['offset']===_0xb002('0x2a')&&typeof _0x57338d[_0xb002('0x2b')]===_0xb002('0x2a');var _0x554995=_0x7a2794[_0xb002('0x2c')];var _0x25652b=_0x6a0aa6?0x0:_0x57338d[_0xb002('0x2d')];var _0x5ec32d=_0x6a0aa6?_0x7a2794['count']:_0x57338d[_0xb002('0x2d')]+_0x57338d[_0xb002('0x2b')];var _0x34663b;if(_0x5ec32d>=_0x554995){_0x5ec32d=_0x554995;_0x34663b=0xc8;}else{_0x34663b=0xce;}_0x1fc580[_0xb002('0x28')](_0x34663b);return _0x1fc580[_0xb002('0x2e')](_0xb002('0x2f'),_0x25652b+'-'+_0x5ec32d+'/'+_0x554995)[_0xb002('0x29')](_0x7a2794);}return null;};}function patchUpdates(_0xcec0a5){return function(_0x1b3454){try{jsonpatch[_0xb002('0x30')](_0x1b3454,_0xcec0a5,!![]);}catch(_0x12ccd5){return BPromise[_0xb002('0x31')](_0x12ccd5);}return _0x1b3454[_0xb002('0x32')]();};}function saveUpdates(_0x53a1a8,_0x409949){return function(_0x9f6c83){if(_0x9f6c83){return _0x9f6c83[_0xb002('0x33')](_0x53a1a8)[_0xb002('0x1d')](function(_0x46bca5){return _0x46bca5;});}return null;};}function removeEntity(_0x2f02f6,_0x104b12){return function(_0x189308){if(_0x189308){return _0x189308[_0xb002('0x34')]()[_0xb002('0x1d')](function(){var _0xff2157=_0x189308['get']({'plain':!![]});var _0x3e4a13=_0xb002('0x35');return db[_0xb002('0x36')][_0xb002('0x34')]({'where':{'type':_0x3e4a13,'resourceId':_0xff2157['id']}})[_0xb002('0x1d')](function(){return _0x189308;});})[_0xb002('0x1d')](function(){_0x2f02f6[_0xb002('0x28')](0xcc)[_0xb002('0x37')]();});}};}function handleEntityNotFound(_0x278de6,_0x110045){return function(_0x517bd0){if(!_0x517bd0){_0x278de6[_0xb002('0x27')](0x194);}return _0x517bd0;};}function handleError(_0x29d973,_0x2e0b1a){_0x2e0b1a=_0x2e0b1a||0x1f4;return function(_0x37d004){logger[_0xb002('0x23')](_0x37d004['stack']);if(_0x37d004[_0xb002('0x38')]){delete _0x37d004[_0xb002('0x38')];}_0x29d973['status'](_0x2e0b1a)[_0xb002('0x39')](_0x37d004);};}exports[_0xb002('0x3a')]=function(_0x10ef95,_0x169c63){var _0x167cdc={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x573437={},_0x3a15d3={'count':0x0,'rows':[]};var _0x37d9e5=_[_0xb002('0x3b')](db['FaxAccount'][_0xb002('0x3c')],function(_0x5b2896){return{'name':_0x5b2896[_0xb002('0x3d')],'type':_0x5b2896['type'][_0xb002('0x3e')]};});_0x573437[_0xb002('0x3f')]=_[_0xb002('0x3b')](_0x37d9e5,'name');_0x573437[_0xb002('0x40')]=_['keys'](_0x10ef95[_0xb002('0x40')]);_0x573437['filters']=_['intersection'](_0x573437[_0xb002('0x3f')],_0x573437[_0xb002('0x40')]);_0x167cdc[_0xb002('0x41')]=_[_0xb002('0x42')](_0x573437['model'],qs[_0xb002('0x43')](_0x10ef95[_0xb002('0x40')][_0xb002('0x43')]));_0x167cdc[_0xb002('0x41')]=_0x167cdc['attributes'][_0xb002('0x44')]?_0x167cdc[_0xb002('0x41')]:_0x573437[_0xb002('0x3f')];if(!_0x10ef95[_0xb002('0x40')][_0xb002('0x45')](_0xb002('0x46'))){_0x167cdc['limit']=qs[_0xb002('0x2b')](_0x10ef95['query'][_0xb002('0x2b')]);_0x167cdc[_0xb002('0x2d')]=qs[_0xb002('0x2d')](_0x10ef95[_0xb002('0x40')][_0xb002('0x2d')]);}_0x167cdc['order']=qs['sort'](_0x10ef95[_0xb002('0x40')][_0xb002('0x47')]);_0x167cdc[_0xb002('0x48')]=qs[_0xb002('0x49')](_[_0xb002('0x4a')](_0x10ef95[_0xb002('0x40')],_0x573437[_0xb002('0x49')]),_0x37d9e5);if(_0x10ef95[_0xb002('0x40')][_0xb002('0x4b')]){_0x167cdc[_0xb002('0x48')]=_[_0xb002('0x4c')](_0x167cdc[_0xb002('0x48')],{'$or':_[_0xb002('0x3b')](_0x37d9e5,function(_0x58b0d7){if(_0x58b0d7['type']!==_0xb002('0x4d')){var _0x251661={};_0x251661[_0x58b0d7[_0xb002('0x38')]]={'$like':'%'+_0x10ef95[_0xb002('0x40')][_0xb002('0x4b')]+'%'};return _0x251661;}})});}_0x167cdc=_[_0xb002('0x4c')]({},_0x167cdc,_0x10ef95['options']);var _0x239720={'where':_0x167cdc['where']};return db['FaxAccount'][_0xb002('0x2c')](_0x239720)['then'](function(_0x1cafed){_0x3a15d3[_0xb002('0x2c')]=_0x1cafed;if(_0x10ef95[_0xb002('0x40')][_0xb002('0x4e')]){_0x167cdc[_0xb002('0x4f')]=[{'all':!![]}];}return db[_0xb002('0x50')][_0xb002('0x51')](_0x167cdc);})['then'](function(_0x4c8e31){_0x3a15d3['rows']=_0x4c8e31;return _0x3a15d3;})[_0xb002('0x1d')](respondWithFilteredResult(_0x169c63,_0x167cdc))[_0xb002('0x26')](handleError(_0x169c63,null));};exports[_0xb002('0x52')]=function(_0x47e8d0,_0x29b1d5){var _0x190082={'raw':![],'where':{'id':_0x47e8d0[_0xb002('0x53')]['id']},'include':[{'model':db['Pause'],'as':_0xb002('0x54')}]},_0x3b989c={};_0x3b989c[_0xb002('0x3f')]=_[_0xb002('0x55')](db[_0xb002('0x50')][_0xb002('0x3c')]);_0x3b989c['query']=_[_0xb002('0x55')](_0x47e8d0['query']);_0x3b989c['filters']=_[_0xb002('0x42')](_0x3b989c[_0xb002('0x3f')],_0x3b989c['query']);_0x190082['attributes']=_['intersection'](_0x3b989c['model'],qs[_0xb002('0x43')](_0x47e8d0['query'][_0xb002('0x43')]));_0x190082['attributes']=_0x190082[_0xb002('0x41')][_0xb002('0x44')]?_0x190082['attributes']:_0x3b989c[_0xb002('0x3f')];if(_0x47e8d0[_0xb002('0x40')][_0xb002('0x4e')]){_0x190082[_0xb002('0x4f')]=[{'all':!![]}];}_0x190082=_[_0xb002('0x4c')]({},_0x190082,_0x47e8d0[_0xb002('0x56')]);return db[_0xb002('0x50')][_0xb002('0x57')](_0x190082)['then'](handleEntityNotFound(_0x29b1d5,null))[_0xb002('0x1d')](respondWithResult(_0x29b1d5,null))[_0xb002('0x26')](handleError(_0x29b1d5,null));};exports[_0xb002('0x58')]=function(_0x296318,_0x289187){return db['FaxAccount'][_0xb002('0x58')](_0x296318['body'],{})[_0xb002('0x1d')](function(_0xa1f15){var _0x24b9e1=_0x296318['user'][_0xb002('0x59')]({'plain':!![]});if(!_0x24b9e1)throw new Error(_0xb002('0x5a'));if(_0x24b9e1[_0xb002('0x5b')]==='user'){var _0x46b1c8=_0xa1f15[_0xb002('0x59')]({'plain':!![]});var _0x405a8f=_0xb002('0x35');return db[_0xb002('0x5c')][_0xb002('0x57')]({'where':{'name':_0x405a8f,'userProfileId':_0x24b9e1[_0xb002('0x5d')]},'raw':!![]})[_0xb002('0x1d')](function(_0x49d972){if(_0x49d972&&_0x49d972['autoAssociation']===0x0){return db[_0xb002('0x36')]['create']({'name':_0x46b1c8[_0xb002('0x38')],'resourceId':_0x46b1c8['id'],'type':_0x49d972[_0xb002('0x38')],'sectionId':_0x49d972['id']},{})[_0xb002('0x1d')](function(){return _0xa1f15;});}else{return _0xa1f15;}})[_0xb002('0x26')](function(_0x4869c4){logger[_0xb002('0x23')](_0xb002('0x5e'),_0x4869c4);throw _0x4869c4;});}return _0xa1f15;})['then'](respondWithResult(_0x289187,0xc9))[_0xb002('0x26')](handleError(_0x289187,null));};exports[_0xb002('0x33')]=function(_0x4f562b,_0x1e7b86){if(_0x4f562b['body']['id']){delete _0x4f562b[_0xb002('0x5f')]['id'];}return db[_0xb002('0x50')]['find']({'where':{'id':_0x4f562b[_0xb002('0x53')]['id']},'include':[{'model':db['Pause'],'as':_0xb002('0x54')}]})[_0xb002('0x1d')](handleEntityNotFound(_0x1e7b86,null))[_0xb002('0x1d')](saveUpdates(_0x4f562b['body'],null))[_0xb002('0x1d')](respondWithResult(_0x1e7b86,null))['catch'](handleError(_0x1e7b86,null));};exports['destroy']=function(_0x1c7fcf,_0x3003f6){return db[_0xb002('0x50')][_0xb002('0x57')]({'where':{'id':_0x1c7fcf[_0xb002('0x53')]['id']}})[_0xb002('0x1d')](handleEntityNotFound(_0x3003f6,null))[_0xb002('0x1d')](removeEntity(_0x3003f6,null))['catch'](handleError(_0x3003f6,null));};exports[_0xb002('0x60')]=function(_0x35e59a,_0x44beb2){return db[_0xb002('0x50')]['describe']()[_0xb002('0x1d')](respondWithResult(_0x44beb2,null))['catch'](handleError(_0x44beb2,null));};exports['addDisposition']=function(_0x36cce3,_0x3ca82a,_0x4d9bc9){if(_0x36cce3[_0xb002('0x5f')]['id']){delete _0x36cce3[_0xb002('0x5f')]['id'];}return db[_0xb002('0x50')]['find']({'where':{'id':_0x36cce3['params']['id']}})[_0xb002('0x1d')](handleEntityNotFound(_0x3ca82a,null))[_0xb002('0x1d')](function(_0x13aea7){if(_0x13aea7){_0x36cce3[_0xb002('0x5f')][_0xb002('0x61')]=_0x13aea7['id'];return db[_0xb002('0x62')]['create'](_0x36cce3[_0xb002('0x5f')]);}})[_0xb002('0x1d')](respondWithResult(_0x3ca82a,null))[_0xb002('0x26')](handleError(_0x3ca82a,null));};exports[_0xb002('0x63')]=function(_0x1ade5b,_0x30df2b,_0x492109){var _0x1adc9b={'raw':![],'where':{}};var _0x5c598a={};var _0x3096da={'count':0x0,'rows':[]};return db[_0xb002('0x50')][_0xb002('0x64')]({'where':{'id':_0x1ade5b['params']['id']}})['then'](handleEntityNotFound(_0x30df2b,null))[_0xb002('0x1d')](function(_0x4a4b31){if(_0x4a4b31){_0x5c598a[_0xb002('0x3f')]=_[_0xb002('0x55')](db[_0xb002('0x62')][_0xb002('0x3c')]);_0x5c598a['query']=_[_0xb002('0x55')](_0x1ade5b[_0xb002('0x40')]);_0x5c598a[_0xb002('0x49')]=_['intersection'](_0x5c598a[_0xb002('0x3f')],_0x5c598a[_0xb002('0x40')]);_0x1adc9b['attributes']=_[_0xb002('0x42')](_0x5c598a[_0xb002('0x3f')],qs['fields'](_0x1ade5b[_0xb002('0x40')][_0xb002('0x43')]));_0x1adc9b[_0xb002('0x41')]=_0x1adc9b[_0xb002('0x41')][_0xb002('0x44')]?_0x1adc9b['attributes']:_0x5c598a[_0xb002('0x3f')];if(!_0x1ade5b[_0xb002('0x40')][_0xb002('0x45')](_0xb002('0x46'))){_0x1adc9b['limit']=qs[_0xb002('0x2b')](_0x1ade5b[_0xb002('0x40')][_0xb002('0x2b')]);_0x1adc9b[_0xb002('0x2d')]=qs[_0xb002('0x2d')](_0x1ade5b[_0xb002('0x40')][_0xb002('0x2d')]);}_0x1adc9b['order']=qs[_0xb002('0x47')](_0x1ade5b[_0xb002('0x40')][_0xb002('0x47')]);_0x1adc9b[_0xb002('0x48')]=qs[_0xb002('0x49')](_[_0xb002('0x4a')](_0x1ade5b[_0xb002('0x40')],_0x5c598a[_0xb002('0x49')]));_0x1adc9b[_0xb002('0x48')][_0xb002('0x61')]=_0x4a4b31['id'];if(_0x1ade5b[_0xb002('0x40')][_0xb002('0x4b')]){_0x1adc9b['where']=_['merge'](_0x1adc9b[_0xb002('0x48')],{'$or':_[_0xb002('0x3b')](_0x1adc9b[_0xb002('0x41')],function(_0x3d7f18){var _0x165538={};_0x165538[_0x3d7f18]={'$like':'%'+_0x1ade5b['query'][_0xb002('0x4b')]+'%'};return _0x165538;})});}_0x1adc9b=_[_0xb002('0x4c')]({},_0x1adc9b,_0x1ade5b[_0xb002('0x56')]);return db['Disposition'][_0xb002('0x2c')]({'where':_0x1adc9b[_0xb002('0x48')]})['then'](function(_0x56f4cc){_0x3096da[_0xb002('0x2c')]=_0x56f4cc;if(_0x1ade5b[_0xb002('0x40')][_0xb002('0x4e')]){_0x1adc9b[_0xb002('0x4f')]=[{'all':!![]}];}return db['Disposition'][_0xb002('0x51')](_0x1adc9b);})['then'](function(_0xcd6feb){_0x3096da[_0xb002('0x65')]=_0xcd6feb;return _0x3096da;});}})[_0xb002('0x1d')](respondWithFilteredResult(_0x30df2b,_0x1adc9b))[_0xb002('0x26')](handleError(_0x30df2b,null));};exports[_0xb002('0x66')]=function(_0x433eac,_0x50e8f4,_0x578b9d){return db[_0xb002('0x50')]['find']({'where':{'id':_0x433eac[_0xb002('0x53')]['id']}})[_0xb002('0x1d')](handleEntityNotFound(_0x50e8f4,null))[_0xb002('0x1d')](function(_0x1afe99){if(_0x1afe99){return _0x1afe99[_0xb002('0x66')](_0x433eac[_0xb002('0x40')][_0xb002('0x67')]);}})['then'](respondWithStatusCode(_0x50e8f4,null))['catch'](handleError(_0x50e8f4,null));};exports[_0xb002('0x68')]=function(_0x2463d4,_0x15fc90,_0x552ad8){if(_0x2463d4[_0xb002('0x5f')]['id']){delete _0x2463d4[_0xb002('0x5f')]['id'];}return db[_0xb002('0x50')][_0xb002('0x57')]({'where':{'id':_0x2463d4[_0xb002('0x53')]['id']}})['then'](handleEntityNotFound(_0x15fc90,null))[_0xb002('0x1d')](function(_0x295d83){if(_0x295d83){_0x2463d4[_0xb002('0x5f')]['FaxAccountId']=_0x295d83['id'];return db[_0xb002('0x69')]['create'](_0x2463d4[_0xb002('0x5f')]);}})[_0xb002('0x1d')](respondWithResult(_0x15fc90,null))['catch'](handleError(_0x15fc90,null));};exports[_0xb002('0x6a')]=function(_0x32edb0,_0x4e0e7f,_0x28e3a3){var _0x4d6820={'raw':![],'where':{}};var _0x2a037d={};var _0x497e68={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x32edb0[_0xb002('0x53')]['id']}})['then'](handleEntityNotFound(_0x4e0e7f,null))['then'](function(_0x3f6873){if(_0x3f6873){_0x2a037d[_0xb002('0x3f')]=_['keys'](db[_0xb002('0x69')]['rawAttributes']);_0x2a037d[_0xb002('0x40')]=_[_0xb002('0x55')](_0x32edb0['query']);_0x2a037d[_0xb002('0x49')]=_[_0xb002('0x42')](_0x2a037d[_0xb002('0x3f')],_0x2a037d[_0xb002('0x40')]);_0x4d6820[_0xb002('0x41')]=_[_0xb002('0x42')](_0x2a037d[_0xb002('0x3f')],qs['fields'](_0x32edb0[_0xb002('0x40')][_0xb002('0x43')]));_0x4d6820[_0xb002('0x41')]=_0x4d6820[_0xb002('0x41')][_0xb002('0x44')]?_0x4d6820['attributes']:_0x2a037d['model'];if(!_0x32edb0[_0xb002('0x40')][_0xb002('0x45')]('nolimit')){_0x4d6820[_0xb002('0x2b')]=qs[_0xb002('0x2b')](_0x32edb0[_0xb002('0x40')][_0xb002('0x2b')]);_0x4d6820[_0xb002('0x2d')]=qs[_0xb002('0x2d')](_0x32edb0[_0xb002('0x40')][_0xb002('0x2d')]);}_0x4d6820[_0xb002('0x6b')]=qs[_0xb002('0x47')](_0x32edb0[_0xb002('0x40')][_0xb002('0x47')]);_0x4d6820[_0xb002('0x48')]=qs['filters'](_[_0xb002('0x4a')](_0x32edb0[_0xb002('0x40')],_0x2a037d[_0xb002('0x49')]));_0x4d6820[_0xb002('0x48')][_0xb002('0x61')]=_0x3f6873['id'];if(_0x32edb0[_0xb002('0x40')][_0xb002('0x4b')]){_0x4d6820[_0xb002('0x48')]=_[_0xb002('0x4c')](_0x4d6820[_0xb002('0x48')],{'$or':_[_0xb002('0x3b')](_0x4d6820[_0xb002('0x41')],function(_0x13087e){var _0x164f23={};_0x164f23[_0x13087e]={'$like':'%'+_0x32edb0[_0xb002('0x40')][_0xb002('0x4b')]+'%'};return _0x164f23;})});}_0x4d6820=_['merge']({},_0x4d6820,_0x32edb0[_0xb002('0x56')]);return db[_0xb002('0x69')][_0xb002('0x2c')]({'where':_0x4d6820[_0xb002('0x48')]})[_0xb002('0x1d')](function(_0x4184cf){_0x497e68[_0xb002('0x2c')]=_0x4184cf;if(_0x32edb0[_0xb002('0x40')][_0xb002('0x4e')]){_0x4d6820['include']=[{'all':!![]}];}return db[_0xb002('0x69')]['findAll'](_0x4d6820);})['then'](function(_0x4624aa){_0x497e68['rows']=_0x4624aa;return _0x497e68;});}})[_0xb002('0x1d')](respondWithFilteredResult(_0x4e0e7f,_0x4d6820))['catch'](handleError(_0x4e0e7f,null));};exports[_0xb002('0x6c')]=function(_0xd8ab28,_0x26f58c,_0x566c6e){return db[_0xb002('0x50')][_0xb002('0x57')]({'where':{'id':_0xd8ab28['params']['id']}})[_0xb002('0x1d')](handleEntityNotFound(_0x26f58c,null))['then'](function(_0x4020f2){if(_0x4020f2){return _0x4020f2[_0xb002('0x6c')](_0xd8ab28[_0xb002('0x40')][_0xb002('0x67')]);}})[_0xb002('0x1d')](respondWithStatusCode(_0x26f58c,null))['catch'](handleError(_0x26f58c,null));};exports[_0xb002('0x6d')]=function(_0x36b8a8,_0x1e8f2e,_0x1b91da){return db['FaxInteraction']['find']({'where':{'id':_0x36b8a8[_0xb002('0x53')]['id']}})[_0xb002('0x1d')](handleEntityNotFound(_0x1e8f2e,null))[_0xb002('0x1d')](function(_0x3df923){if(_0x3df923){return _0x3df923[_0xb002('0x6d')](_0x36b8a8[_0xb002('0x5f')][_0xb002('0x67')],_[_0xb002('0x6e')](_0x36b8a8[_0xb002('0x5f')],['ids','id'])||{});}})[_0xb002('0x1d')](respondWithResult(_0x1e8f2e,null))[_0xb002('0x26')](handleError(_0x1e8f2e,null));};exports[_0xb002('0x6f')]=function(_0x116597,_0x45d879,_0x509bf2){var _0x535d88={'raw':![],'where':{}};var _0x2cc77a={};var _0x3c4622={'count':0x0,'rows':[]};return db[_0xb002('0x50')][_0xb002('0x64')]({'where':{'id':_0x116597['params']['id']}})[_0xb002('0x1d')](handleEntityNotFound(_0x45d879,null))[_0xb002('0x1d')](function(_0x361805){if(_0x361805){_0x2cc77a[_0xb002('0x3f')]=_[_0xb002('0x55')](db['FaxInteraction'][_0xb002('0x3c')]);_0x2cc77a[_0xb002('0x40')]=_[_0xb002('0x55')](_0x116597['query']);_0x2cc77a[_0xb002('0x49')]=_['intersection'](_0x2cc77a['model'],_0x2cc77a['query']);_0x535d88[_0xb002('0x41')]=_['intersection'](_0x2cc77a[_0xb002('0x3f')],qs['fields'](_0x116597['query'][_0xb002('0x43')]));_0x535d88['attributes']=_0x535d88[_0xb002('0x41')][_0xb002('0x44')]?_0x535d88['attributes']:_0x2cc77a[_0xb002('0x3f')];if(!_0x116597[_0xb002('0x40')]['hasOwnProperty'](_0xb002('0x46'))){_0x535d88[_0xb002('0x2b')]=qs[_0xb002('0x2b')](_0x116597[_0xb002('0x40')][_0xb002('0x2b')]);_0x535d88['offset']=qs[_0xb002('0x2d')](_0x116597[_0xb002('0x40')]['offset']);}_0x535d88[_0xb002('0x6b')]=qs['sort'](_0x116597[_0xb002('0x40')]['sort']);_0x535d88[_0xb002('0x48')]=qs[_0xb002('0x49')](_[_0xb002('0x4a')](_0x116597[_0xb002('0x40')],_0x2cc77a[_0xb002('0x49')]));_0x535d88[_0xb002('0x48')][_0xb002('0x61')]=_0x361805['id'];if(_0x116597[_0xb002('0x40')][_0xb002('0x4b')]){_0x535d88[_0xb002('0x48')]=_[_0xb002('0x4c')](_0x535d88['where'],{'$or':_['map'](_0x535d88[_0xb002('0x41')],function(_0x6fdd9c){var _0x552df6={};_0x552df6[_0x6fdd9c]={'$like':'%'+_0x116597[_0xb002('0x40')][_0xb002('0x4b')]+'%'};return _0x552df6;})});}_0x535d88=_[_0xb002('0x4c')]({},_0x535d88,_0x116597[_0xb002('0x56')]);return db[_0xb002('0x70')][_0xb002('0x2c')]({'where':_0x535d88['where']})[_0xb002('0x1d')](function(_0x3d78b9){_0x3c4622[_0xb002('0x2c')]=_0x3d78b9;if(_0x116597['query']['includeAll']){_0x535d88[_0xb002('0x4f')]=[{'model':db[_0xb002('0x71')],'as':_0xb002('0x72'),'required':![]},{'model':db['User'],'as':_0xb002('0x73'),'attributes':['name',_0xb002('0x74'),_0xb002('0x75')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0xb002('0x38'),_0xb002('0x76')],'where':_0x116597[_0xb002('0x40')][_0xb002('0x77')]?{'id':_0x116597['query']['tag']}:undefined,'required':_0x116597[_0xb002('0x40')]['tag']?!![]:![]}];}return db['FaxInteraction'][_0xb002('0x51')](_0x535d88);})[_0xb002('0x1d')](function(_0x1b285c){_0x3c4622[_0xb002('0x65')]=_0x1b285c;return _0x3c4622;});}})[_0xb002('0x1d')](respondWithFilteredResult(_0x45d879,_0x535d88))['catch'](handleError(_0x45d879,null));};exports['addApplications']=function(_0x36e147,_0x1e5221){var _0x23b402=_0x36e147['params']['id'];var _0x59cc2a=_0x36e147[_0xb002('0x5f')];var _0x509d8d=0xc8;var _0x2d7c81=null;return db['sequelize'][_0xb002('0x78')]({'isolationLevel':db[_0xb002('0x79')]['Transaction'][_0xb002('0x7a')][_0xb002('0x7b')]},function(_0x464cc2){return db[_0xb002('0x50')][_0xb002('0x64')]({'where':{'id':_0x23b402},'transaction':_0x464cc2})[_0xb002('0x1d')](function(_0x3b15b9){if(_0x3b15b9){return db['FaxApplication'][_0xb002('0x34')]({'where':{'FaxAccountId':_0x23b402},'transaction':_0x464cc2})[_0xb002('0x1d')](function(){var _0x33cf3f=_[_0xb002('0x3b')](_0x59cc2a,function(_0x37767f){_0x37767f[_0xb002('0x61')]=_0x23b402;return _0x37767f;});return db[_0xb002('0x7c')][_0xb002('0x7d')](_0x33cf3f,{'transaction':_0x464cc2});});}else{_0x509d8d=0x194;_0x2d7c81=[];}});})[_0xb002('0x1d')](function(){if(_0x509d8d!==0x194){return db[_0xb002('0x7c')][_0xb002('0x7e')]({'where':{'FaxAccountId':_0x23b402},'order':_0xb002('0x7f')})[_0xb002('0x1d')](function(_0x288e6e){_0x2d7c81=_0x288e6e;});}})[_0xb002('0x26')](function(_0x5bda64){_0x509d8d=0x1f4;logger[_0xb002('0x23')](_0x5bda64[_0xb002('0x80')]);if(_0x5bda64[_0xb002('0x38')]){delete _0x5bda64[_0xb002('0x38')];}_0x2d7c81=_0x5bda64;})[_0xb002('0x81')](function(){if(_0x2d7c81===null){_0x1e5221[_0xb002('0x27')](_0x509d8d);}else{if(_0x509d8d===0x1f4){_0x1e5221[_0xb002('0x28')](_0x509d8d)[_0xb002('0x39')](_0x2d7c81);}else{_0x1e5221[_0xb002('0x28')](_0x509d8d)['json'](_0x2d7c81);}}});};exports[_0xb002('0x82')]=function(_0x230d24,_0x262eba,_0x6ad78){var _0x5129f7={};var _0x1104af={};var _0x2827b8;var _0x2c5007;return db[_0xb002('0x50')][_0xb002('0x64')]({'where':{'id':_0x230d24[_0xb002('0x53')]['id']}})[_0xb002('0x1d')](handleEntityNotFound(_0x262eba,null))['then'](function(_0x1712d5){if(_0x1712d5){_0x2827b8=_0x1712d5;_0x1104af[_0xb002('0x3f')]=_[_0xb002('0x55')](db['FaxApplication'][_0xb002('0x3c')]);_0x1104af[_0xb002('0x40')]=_[_0xb002('0x55')](_0x230d24[_0xb002('0x40')]);_0x1104af[_0xb002('0x49')]=_[_0xb002('0x42')](_0x1104af[_0xb002('0x3f')],_0x1104af['query']);_0x5129f7['attributes']=_[_0xb002('0x42')](_0x1104af[_0xb002('0x3f')],qs[_0xb002('0x43')](_0x230d24[_0xb002('0x40')]['fields']));_0x5129f7[_0xb002('0x41')]=_0x5129f7[_0xb002('0x41')][_0xb002('0x44')]?_0x5129f7['attributes']:_0x1104af[_0xb002('0x3f')];_0x5129f7[_0xb002('0x6b')]=qs['sort'](_0x230d24[_0xb002('0x40')][_0xb002('0x47')]);_0x5129f7['where']=qs[_0xb002('0x49')](_['pick'](_0x230d24[_0xb002('0x40')],_0x1104af[_0xb002('0x49')]));if(_0x230d24[_0xb002('0x40')][_0xb002('0x4b')]){_0x5129f7[_0xb002('0x48')]=_[_0xb002('0x4c')](_0x5129f7[_0xb002('0x48')],{'$or':_[_0xb002('0x3b')](_0x5129f7[_0xb002('0x41')],function(_0x389814){var _0x445a01={};_0x445a01[_0x389814]={'$like':'%'+_0x230d24[_0xb002('0x40')]['filter']+'%'};return _0x445a01;})});}_0x5129f7=_[_0xb002('0x4c')]({},_0x5129f7,_0x230d24[_0xb002('0x56')]);return _0x2827b8[_0xb002('0x82')](_0x5129f7);}})[_0xb002('0x1d')](function(_0x4bdda3){if(_0x4bdda3){_0x2c5007=_0x4bdda3['length'];if(!_0x230d24[_0xb002('0x40')][_0xb002('0x45')](_0xb002('0x46'))){_0x5129f7[_0xb002('0x2b')]=qs[_0xb002('0x2b')](_0x230d24[_0xb002('0x40')][_0xb002('0x2b')]);_0x5129f7[_0xb002('0x2d')]=qs[_0xb002('0x2d')](_0x230d24['query'][_0xb002('0x2d')]);}return _0x2827b8[_0xb002('0x82')](_0x5129f7);}})[_0xb002('0x1d')](function(_0x1cf5c1){if(_0x1cf5c1){return _0x1cf5c1?{'count':_0x2c5007,'rows':_0x1cf5c1}:null;}})[_0xb002('0x1d')](respondWithResult(_0x262eba,null))[_0xb002('0x26')](handleError(_0x262eba,null));};function Extension(_0x5b505d,_0x3f1616,_0x306271,_0x11e0b8){this['context']='from-voip-provider';this['exten']=_0x5b505d[_0xb002('0x83')];this[_0xb002('0x84')]=_0x11e0b8;this[_0xb002('0x85')]=_0xb002('0x86');this[_0xb002('0x87')]='Fax\x20Extension';this[_0xb002('0x61')]=_0x5b505d['id'];this[_0xb002('0x7f')]=_0x3f1616;this[_0xb002('0x88')]=_0x306271;}function createExtensionsReciveFax(_0x4a0518){var _0x565303=0x1;var _0x44e100=[];_0x44e100[_0xb002('0x89')](new Extension(_0x4a0518,_0x565303,'','Answer'));_0x565303+=0x1;_0x44e100['push'](new Extension(_0x4a0518,_0x565303,_0xb002('0x8a'),_0xb002('0x8b')));_0x565303+=0x1;for(var _0x13b574 in _0x4a0518){if(_0x4a0518[_0xb002('0x45')](_0x13b574)&&(_0x13b574===_0xb002('0x8c')||_0x13b574===_0xb002('0x83')||_0x13b574===_0xb002('0x8d')||_0x13b574==='faxdetect'||_0x13b574===_0xb002('0x8e')||_0x13b574==='maxrate'||_0x13b574==='minrate'||_0x13b574===_0xb002('0x8f')||_0x13b574===_0xb002('0x90'))){_0x44e100['push'](new Extension(_0x4a0518,_0x565303,_0xb002('0x91')+_0x13b574+')='+_0x4a0518[_0x13b574],_0xb002('0x8b')));_0x565303+=0x1;}}_0x44e100['push'](new Extension(_0x4a0518,_0x565303,'6',_0xb002('0x92')));_0x565303+=0x1;_0x44e100[_0xb002('0x89')](new Extension(_0x4a0518,_0x565303,_0xb002('0x93'),_0xb002('0x94')));_0x565303=0x0;return _0x44e100;}exports[_0xb002('0x95')]=function(_0x1f397d,_0x3d4be9,_0x4bc76d){var _0x68f211;return db[_0xb002('0x79')][_0xb002('0x78')](function(_0x48fa52){return db[_0xb002('0x50')]['create'](_0x1f397d[_0xb002('0x5f')],{'transaction':_0x48fa52})[_0xb002('0x1d')](function(_0x11b93c){_0x68f211=_0x11b93c['get']({'plain':!![]});return db[_0xb002('0x96')][_0xb002('0x7d')](createExtensionsReciveFax(_0x68f211),{'transaction':_0x48fa52});});})['then'](function(){return _0x68f211;})[_0xb002('0x1d')](respondWithResult(_0x3d4be9,null))['catch'](handleError(_0x3d4be9,null));};exports[_0xb002('0x97')]=function(_0x95a5a6,_0x3ab205,_0x32b055){var _0x264910;return db[_0xb002('0x79')][_0xb002('0x78')](function(_0x39b950){return db['FaxAccount'][_0xb002('0x33')](_0x95a5a6['body'],{'where':{'id':_0x95a5a6[_0xb002('0x5f')]['id']},'transaction':_0x39b950})[_0xb002('0x1d')](function(_0x5afbe7){return db[_0xb002('0x96')][_0xb002('0x34')]({'where':{'FaxAccountId':_0x95a5a6['body']['id']},'transaction':_0x39b950})[_0xb002('0x1d')](function(_0x1c1382){return db['VoiceExtension']['bulkCreate'](createExtensionsReciveFax(_[_0xb002('0x6e')](_0x95a5a6[_0xb002('0x5f')],[_0xb002('0x98'),_0xb002('0x3e'),'createdAt','updatedAt','TrunkId',_0xb002('0x99')])),{'transaction':_0x39b950});});});})[_0xb002('0x1d')](function(){return db['FaxAccount'][_0xb002('0x9a')](_0x95a5a6[_0xb002('0x5f')]['id']);})[_0xb002('0x1d')](respondWithResult(_0x3ab205,null))[_0xb002('0x26')](handleError(_0x3ab205,null));};exports[_0xb002('0x9b')]=function(_0x22ee85,_0x28d680,_0x506887){var _0x3ac576={'raw':!![],'where':{}};var _0x2a6b6e={};var _0x451ec8={'count':0x0,'rows':[]};return db[_0xb002('0x50')][_0xb002('0x64')]({'where':{'id':_0x22ee85[_0xb002('0x53')]['id']}})[_0xb002('0x1d')](handleEntityNotFound(_0x28d680,null))['then'](function(_0x38fbf3){if(_0x38fbf3){_0x2a6b6e[_0xb002('0x3f')]=_[_0xb002('0x55')](db[_0xb002('0x9c')][_0xb002('0x3c')]);_0x2a6b6e[_0xb002('0x40')]=_[_0xb002('0x55')](_0x22ee85[_0xb002('0x40')]);_0x2a6b6e[_0xb002('0x49')]=_['intersection'](_0x2a6b6e[_0xb002('0x3f')],_0x2a6b6e[_0xb002('0x40')]);_0x3ac576[_0xb002('0x41')]=_['intersection'](_0x2a6b6e[_0xb002('0x3f')],qs['fields'](_0x22ee85['query'][_0xb002('0x43')]));_0x3ac576[_0xb002('0x41')]=_0x3ac576[_0xb002('0x41')][_0xb002('0x44')]?_0x3ac576[_0xb002('0x41')]:_0x2a6b6e[_0xb002('0x3f')];if(!_0x22ee85[_0xb002('0x40')][_0xb002('0x45')](_0xb002('0x46'))){_0x3ac576[_0xb002('0x2b')]=qs[_0xb002('0x2b')](_0x22ee85['query']['limit']);_0x3ac576[_0xb002('0x2d')]=qs[_0xb002('0x2d')](_0x22ee85[_0xb002('0x40')][_0xb002('0x2d')]);}_0x3ac576['order']=qs[_0xb002('0x47')](_0x22ee85[_0xb002('0x40')]['sort']);_0x3ac576[_0xb002('0x48')]=qs[_0xb002('0x49')](_[_0xb002('0x4a')](_0x22ee85['query'],_0x2a6b6e[_0xb002('0x49')]));_0x3ac576[_0xb002('0x48')]['FaxAccountId']=_0x38fbf3['id'];if(_0x22ee85[_0xb002('0x40')][_0xb002('0x4b')]){_0x3ac576['where']=_['merge'](_0x3ac576[_0xb002('0x48')],{'$or':_[_0xb002('0x3b')](_0x3ac576[_0xb002('0x41')],function(_0x239f87){var _0x114298={};_0x114298[_0x239f87]={'$like':'%'+_0x22ee85[_0xb002('0x40')][_0xb002('0x4b')]+'%'};return _0x114298;})});}if(_0x22ee85[_0xb002('0x40')][_0xb002('0x9d')]){var _0x3c74c1=_0x22ee85[_0xb002('0x40')][_0xb002('0x9d')][_0xb002('0x9e')](',');var _0x512c47={};_0x512c47[_0x3c74c1[0x0]]={'$gte':moment(_0x3c74c1[0x1])['format'](_0xb002('0x9f'))};_0x3ac576[_0xb002('0x48')]=_['merge'](_0x3ac576[_0xb002('0x48')],_0x512c47);}_0x3ac576=_[_0xb002('0x4c')]({},_0x3ac576,_0x22ee85[_0xb002('0x56')]);return db[_0xb002('0x9c')]['count']({'where':_0x3ac576[_0xb002('0x48')]})['then'](function(_0x4c7a83){_0x451ec8[_0xb002('0x2c')]=_0x4c7a83;if(_0x22ee85[_0xb002('0x40')]['includeAll']){_0x3ac576['include']=[{'all':!![]}];}return db[_0xb002('0x9c')][_0xb002('0x51')](_0x3ac576);})[_0xb002('0x1d')](function(_0x4175cd){_0x451ec8['rows']=_0x4175cd;return _0x451ec8;});}})[_0xb002('0x1d')](respondWithFilteredResult(_0x28d680,_0x3ac576))[_0xb002('0x26')](handleError(_0x28d680,null));};exports[_0xb002('0x39')]=function(_0x5b5c86,_0x2039ab,_0x158c80){var _0x4ad0b3,_0x3786f7={},_0x1f823b;if(_0x5b5c86[_0xb002('0x5f')]['to']){_0x1f823b=_0x5b5c86[_0xb002('0x5f')]['to'][0x0];}return db[_0xb002('0x50')][_0xb002('0x57')]({'where':{'id':_0x5b5c86[_0xb002('0x53')]['id']},'include':[{'model':db['CmList'],'as':_0xb002('0xa0'),'include':[{'model':db[_0xb002('0x71')],'as':_0xb002('0xa1'),'where':{'fax':_0x1f823b},'limit':0x1,'order':[[_0xb002('0xa2'),_0xb002('0xa3')]]}]}]})[_0xb002('0x1d')](handleEntityNotFound(_0x2039ab,null))['then'](function(_0x52c206){_0x4ad0b3=_0x52c206;if(_0x5b5c86[_0xb002('0x5f')][_0xb002('0xa4')]&&_0x5b5c86['body']['attachments']['length']){for(var _0x3a3f85=0x0;_0x3a3f85<_0x5b5c86[_0xb002('0x5f')]['attachments']['length'];_0x3a3f85+=0x1){_0x5b5c86['body'][_0xb002('0xa4')][_0x3a3f85]={'filename':_0x5b5c86[_0xb002('0x5f')][_0xb002('0xa4')][_0x3a3f85][_0xb002('0x38')],'id':_0x5b5c86['body']['attachments'][_0x3a3f85]['id'],'path':path[_0xb002('0xa5')](config['root'],_0xb002('0xa6'),_0x5b5c86['body'][_0xb002('0xa4')][_0x3a3f85][_0xb002('0xa7')])};}}return respondWithRpcPromise(_0xb002('0xa8'),_0xb002('0xa8'),{'FaxAccountId':_[_0xb002('0xa9')](_0x5b5c86[_0xb002('0x53')]['id'])?undefined:_0x5b5c86[_0xb002('0x53')]['id'],'path':_[_0xb002('0xa9')](_0x5b5c86[_0xb002('0x5f')][_0xb002('0xa4')][0x0]['path'])?undefined:_0x5b5c86[_0xb002('0x5f')]['attachments'][0x0][_0xb002('0xaa')],'fax':_[_0xb002('0xa9')](_0x5b5c86[_0xb002('0x5f')]['to'][0x0])?undefined:_0x5b5c86[_0xb002('0x5f')]['to'][0x0]},client9002);})['then'](function(){if(_0x4ad0b3){if(_[_0xb002('0xa9')](_0x5b5c86[_0xb002('0x5f')]['from'])){_0x5b5c86['body'][_0xb002('0xab')]=util['format']('\x22%s\x22\x20<%s>',_0x4ad0b3[_0xb002('0x38')],_0x4ad0b3[_0xb002('0xac')]);}if(_0x4ad0b3[_0xb002('0xa0')]){if(_0x4ad0b3[_0xb002('0xa0')]['Contacts'][_0xb002('0x44')]){return _0x4ad0b3[_0xb002('0xa0')][_0xb002('0xa1')][0x0];}else{return db[_0xb002('0x71')]['create'](_['defaults'](_0x5b5c86[_0xb002('0x5f')],{'firstName':_0x5b5c86['body']['to'][0x0],'phone':_0x5b5c86[_0xb002('0x5f')]['to'][0x0],'fax':_0x5b5c86[_0xb002('0x5f')]['to'][0x0],'ListId':_0x4ad0b3[_0xb002('0x99')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0xb002('0xad'));}})['then'](function(_0x3246ac){if(_0x3246ac){return db[_0xb002('0x70')]['find']({'where':{'ContactId':_0x3246ac['id'],'closed':![],'FaxAccountId':_0x4ad0b3['id']}})[_0xb002('0x1d')](function(_0x23a0ed){if(_0x23a0ed){return[_0x23a0ed,![]];}return db['FaxInteraction'][_0xb002('0x58')]({'UserId':_0x5b5c86[_0xb002('0xae')]['id'],'ContactId':_0x3246ac['id'],'FaxAccountId':_0x4ad0b3['id'],'fax':_0x5b5c86[_0xb002('0x5f')]['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0xb002('0x4c')](_0x5b5c86[_0xb002('0x5f')],{'read':![],'body':_0x5b5c86['body'][_0xb002('0xa4')][0x0][_0xb002('0xaf')],'FaxAccountId':_0x4ad0b3['id'],'UserId':_0x5b5c86['user']['id'],'ContactId':_0x3246ac['id'],'AttachmentId':_0x5b5c86['body'][_0xb002('0xa4')][0x0]['id']})]},{'include':[{'model':db[_0xb002('0x9c')],'as':'Messages'}]})[_0xb002('0x1d')](function(_0x4af3ad){return[_0x4af3ad,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xb002('0xb0')](function(_0x2124c2,_0x5bbebf){if(_0x5bbebf){return _0x2124c2;}return db['FaxMessage']['create']({'direction':'out','read':![],'body':_0x5b5c86['body'][_0xb002('0xa4')][0x0]['filename'],'FaxAccountId':_0x4ad0b3['id'],'FaxInteractionId':_0x2124c2['id'],'UserId':_0x5b5c86[_0xb002('0xae')]['id'],'ContactId':_0x2124c2[_0xb002('0xb1')],'AttachmentId':_0x5b5c86[_0xb002('0x5f')]['attachments'][0x0]['id']})[_0xb002('0x1d')](function(_0x334dce){_0x2124c2['dataValues'][_0xb002('0xb2')]=[];_0x2124c2[_0xb002('0xb3')]['Messages'][_0xb002('0x89')](_0x334dce['dataValues']);return _0x2124c2;});})[_0xb002('0x1d')](function(_0x5d1a60){respondWithRpcPromise(_0xb002('0xb4'),_0xb002('0xb4'),{'FaxAccountId':_['isNil'](_0x5b5c86[_0xb002('0x53')]['id'])?undefined:_0x5b5c86[_0xb002('0x53')]['id'],'path':_[_0xb002('0xa9')](_0x5b5c86[_0xb002('0x5f')][_0xb002('0xa4')][0x0][_0xb002('0xaa')])?undefined:_0x5b5c86[_0xb002('0x5f')]['attachments'][0x0][_0xb002('0xaa')],'fax':_[_0xb002('0xa9')](_0x5b5c86[_0xb002('0x5f')]['to'][0x0])?undefined:_0x5b5c86[_0xb002('0x5f')]['to'][0x0],'AttachmentId':_0x5b5c86[_0xb002('0x5f')][_0xb002('0xa4')][0x0]['id']},client9002)[_0xb002('0x1d')](function(_0x301105){logger[_0xb002('0x1e')](_0xb002('0xb5'),_0x301105);})['catch'](function(_0x3b26f4){logger[_0xb002('0x1e')](_0xb002('0xb5'),_0x3b26f4);});return _0x5d1a60;})[_0xb002('0x1d')](respondWithResult(_0x2039ab,null))[_0xb002('0x26')](handleError(_0x2039ab,null));};exports[_0xb002('0xb6')]=function(_0x6848bc,_0x5943cf,_0x2f2833){return db[_0xb002('0x50')][_0xb002('0x57')]({'where':{'id':_0x6848bc['params']['id']}})['then'](handleEntityNotFound(_0x5943cf,null))['then'](function(_0x1f15db){if(_0x1f15db){return _0x1f15db[_0xb002('0xb6')](_0x6848bc[_0xb002('0x5f')]['ids'],_[_0xb002('0x6e')](_0x6848bc[_0xb002('0x5f')],[_0xb002('0x67'),'id'])||{})['spread'](function(_0x5dbc27){for(var _0x30f7e8=0x0;_0x30f7e8<_0x6848bc[_0xb002('0x5f')][_0xb002('0x67')][_0xb002('0x44')];_0x30f7e8+=0x1){socket[_0xb002('0xb7')]('userFaxAccount:save',{'UserId':Number(_0x6848bc[_0xb002('0x5f')][_0xb002('0x67')][_0x30f7e8]),'FaxAccountId':Number(_0x6848bc[_0xb002('0x53')]['id'])});}return _0x5dbc27;});}})[_0xb002('0x1d')](respondWithResult(_0x5943cf,null))['catch'](handleError(_0x5943cf,null));};exports[_0xb002('0xb8')]=function(_0xdafd0d,_0x1819c9,_0x2558e3){return db[_0xb002('0x50')][_0xb002('0x57')]({'where':{'id':_0xdafd0d[_0xb002('0x53')]['id']}})[_0xb002('0x1d')](handleEntityNotFound(_0x1819c9,null))['then'](function(_0x18cb3f){if(_0x18cb3f){return _0x18cb3f[_0xb002('0xb8')](_0xdafd0d[_0xb002('0x40')][_0xb002('0x67')])[_0xb002('0x1d')](function(){if(_[_0xb002('0xb9')](_0xdafd0d[_0xb002('0x40')][_0xb002('0x67')])){for(var _0x19fb99=0x0;_0x19fb99<_0xdafd0d[_0xb002('0x40')][_0xb002('0x67')]['length'];_0x19fb99+=0x1){socket[_0xb002('0xb7')](_0xb002('0xba'),{'UserId':Number(_0xdafd0d[_0xb002('0x40')]['ids'][_0x19fb99]),'FaxAccountId':Number(_0xdafd0d[_0xb002('0x53')]['id'])});}}else{socket[_0xb002('0xb7')]('userFaxAccount:remove',{'UserId':Number(_0xdafd0d['query'][_0xb002('0x67')]),'FaxAccountId':Number(_0xdafd0d[_0xb002('0x53')]['id'])});}});}})[_0xb002('0x1d')](respondWithStatusCode(_0x1819c9,null))[_0xb002('0x26')](handleError(_0x1819c9,null));};exports[_0xb002('0xbb')]=function(_0x33e546,_0x4a0a8b,_0x1f87a7){var _0x17e9ce={};var _0x573e0d={};var _0x2e6252;var _0x566ad2;return db[_0xb002('0x50')][_0xb002('0x64')]({'where':{'id':_0x33e546[_0xb002('0x53')]['id']}})[_0xb002('0x1d')](handleEntityNotFound(_0x4a0a8b,null))[_0xb002('0x1d')](function(_0x2a8d58){if(_0x2a8d58){_0x2e6252=_0x2a8d58;_0x573e0d[_0xb002('0x3f')]=_[_0xb002('0x55')](db[_0xb002('0xbc')]['rawAttributes']);_0x573e0d[_0xb002('0x40')]=_[_0xb002('0x55')](_0x33e546[_0xb002('0x40')]);_0x573e0d[_0xb002('0x49')]=_['intersection'](_0x573e0d['model'],_0x573e0d[_0xb002('0x40')]);_0x17e9ce['attributes']=_[_0xb002('0x42')](_0x573e0d[_0xb002('0x3f')],qs[_0xb002('0x43')](_0x33e546[_0xb002('0x40')]['fields']));_0x17e9ce['attributes']=_0x17e9ce[_0xb002('0x41')][_0xb002('0x44')]?_0x17e9ce[_0xb002('0x41')]:_0x573e0d[_0xb002('0x3f')];_0x17e9ce['order']=qs[_0xb002('0x47')](_0x33e546[_0xb002('0x40')][_0xb002('0x47')]);_0x17e9ce[_0xb002('0x48')]=qs[_0xb002('0x49')](_['pick'](_0x33e546[_0xb002('0x40')],_0x573e0d[_0xb002('0x49')]));if(_0x33e546[_0xb002('0x40')][_0xb002('0x4b')]){_0x17e9ce[_0xb002('0x48')]=_[_0xb002('0x4c')](_0x17e9ce[_0xb002('0x48')],{'$or':_[_0xb002('0x3b')](_0x17e9ce[_0xb002('0x41')],function(_0x289760){var _0x512ad2={};_0x512ad2[_0x289760]={'$like':'%'+_0x33e546[_0xb002('0x40')][_0xb002('0x4b')]+'%'};return _0x512ad2;})});}_0x17e9ce=_[_0xb002('0x4c')]({},_0x17e9ce,_0x33e546[_0xb002('0x56')]);return _0x2e6252['getAgents'](_0x17e9ce);}})[_0xb002('0x1d')](function(_0x15aaff){if(_0x15aaff){_0x566ad2=_0x15aaff[_0xb002('0x44')];if(!_0x33e546[_0xb002('0x40')][_0xb002('0x45')](_0xb002('0x46'))){_0x17e9ce[_0xb002('0x2b')]=qs['limit'](_0x33e546[_0xb002('0x40')]['limit']);_0x17e9ce[_0xb002('0x2d')]=qs['offset'](_0x33e546['query'][_0xb002('0x2d')]);}return _0x2e6252[_0xb002('0xbb')](_0x17e9ce);}})['then'](function(_0x3dee0c){if(_0x3dee0c){return _0x3dee0c?{'count':_0x566ad2,'rows':_0x3dee0c}:null;}})[_0xb002('0x1d')](respondWithResult(_0x4a0a8b,null))[_0xb002('0x26')](handleError(_0x4a0a8b,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 32b9ba4..237dfc9 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 _0xc25d=['remove','emit','hook','exports','../../mysqldb','FaxAccount','setMaxListeners','save'];(function(_0xc37c8,_0x182df1){var _0x77188f=function(_0xfbdddc){while(--_0xfbdddc){_0xc37c8['push'](_0xc37c8['shift']());}};_0x77188f(++_0x182df1);}(_0xc25d,0xe4));var _0xdc25=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xc25d[_0x4e1d03];return _0x362d4b;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0xdc25('0x0'))['db'][_0xdc25('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xdc25('0x2')](0x0);var events={'afterCreate':_0xdc25('0x3'),'afterUpdate':'update','afterDestroy':_0xdc25('0x4')};function emitEvent(_0x31d59b){return function(_0x33d3ef,_0x325434,_0x54af61){FaxAccountEvents['emit'](_0x31d59b+':'+_0x33d3ef['id'],_0x33d3ef);FaxAccountEvents[_0xdc25('0x5')](_0x31d59b,_0x33d3ef);_0x54af61(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0xdc25('0x6')](e,emitEvent(event));}}module[_0xdc25('0x7')]=FaxAccountEvents; \ No newline at end of file +var _0x4abf=['events','../../mysqldb','FaxAccount','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x36de10,_0xfe25e8){var _0x58100f=function(_0x1fee3f){while(--_0x1fee3f){_0x36de10['push'](_0x36de10['shift']());}};_0x58100f(++_0xfe25e8);}(_0x4abf,0x8c));var _0xf4ab=function(_0x24df15,_0x22cb23){_0x24df15=_0x24df15-0x0;var _0x260f07=_0x4abf[_0x24df15];return _0x260f07;};'use strict';var EventEmitter=require(_0xf4ab('0x0'));var FaxAccount=require(_0xf4ab('0x1'))['db'][_0xf4ab('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xf4ab('0x3')](0x0);var events={'afterCreate':_0xf4ab('0x4'),'afterUpdate':'update','afterDestroy':_0xf4ab('0x5')};function emitEvent(_0x306d1a){return function(_0x2a3bee,_0xc10d2f,_0x4d724e){FaxAccountEvents['emit'](_0x306d1a+':'+_0x2a3bee['id'],_0x2a3bee);FaxAccountEvents[_0xf4ab('0x6')](_0x306d1a,_0x2a3bee);_0x4d724e(null);};}for(var e in events){if(events[_0xf4ab('0x7')](e)){var event=events[e];FaxAccount[_0xf4ab('0x8')](e,emitEvent(event));}}module[_0xf4ab('0x9')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 2cf4cd0..6916c89 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 _0x98f1=['util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount','lodash'];(function(_0x3ffbea,_0x183053){var _0x411daf=function(_0x1184cb){while(--_0x1184cb){_0x3ffbea['push'](_0x3ffbea['shift']());}};_0x411daf(++_0x183053);}(_0x98f1,0xd7));var _0x198f=function(_0xb692d1,_0x1245d7){_0xb692d1=_0xb692d1-0x0;var _0x462754=_0x98f1[_0xb692d1];return _0x462754;};'use strict';var _=require(_0x198f('0x0'));var util=require(_0x198f('0x1'));var logger=require(_0x198f('0x2'))(_0x198f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x198f('0x4'));var fs=require('fs');var path=require(_0x198f('0x5'));var rimraf=require(_0x198f('0x6'));var config=require(_0x198f('0x7'));var attributes=require(_0x198f('0x8'));module[_0x198f('0x9')]=function(_0x2c5c61,_0xd22620){return _0x2c5c61[_0x198f('0xa')](_0x198f('0xb'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe5ca=['define','FaxAccount','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x33a6bd,_0x564362){var _0x339aff=function(_0xfa38d1){while(--_0xfa38d1){_0x33a6bd['push'](_0x33a6bd['shift']());}};_0x339aff(++_0x564362);}(_0xe5ca,0x142));var _0xae5c=function(_0xa388a2,_0x40bde6){_0xa388a2=_0xa388a2-0x0;var _0x7ce7f6=_0xe5ca[_0xa388a2];return _0x7ce7f6;};'use strict';var _=require(_0xae5c('0x0'));var util=require('util');var logger=require(_0xae5c('0x1'))('api');var moment=require(_0xae5c('0x2'));var BPromise=require(_0xae5c('0x3'));var rp=require(_0xae5c('0x4'));var fs=require('fs');var path=require(_0xae5c('0x5'));var rimraf=require(_0xae5c('0x6'));var config=require(_0xae5c('0x7'));var attributes=require('./faxAccount.attributes');module['exports']=function(_0x4a4397,_0x216807){return _0x4a4397[_0xae5c('0x8')](_0xae5c('0x9'),attributes,{'tableName':'fax_accounts','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 3e224a2..76a4620 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 _0x53dd=['keys','createdAt','updatedAt','CompanyId','ListId','isNil','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','FaxAccount','find','account','CmList','Contacts','DESC','FaxApplication','Applications','List','get','applications','list','orderBy','length','create','contact','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','close','unmanaged','*,*,*,*','created','FaxMessage','ContactId','AttachmentId','interaction','UserId','User','name','unshift','agent','waitForTheAssignedAgent','startRouting','Start','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./faxAccount.socket','register','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','options','raw','attributes','limit','include','map','model','then','GetFaxAccount','debug','NotifyFaxAccount','body','fax','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference'];(function(_0x3aa0b1,_0x372e9d){var _0x30ec46=function(_0x4a0e41){while(--_0x4a0e41){_0x3aa0b1['push'](_0x3aa0b1['shift']());}};_0x30ec46(++_0x372e9d);}(_0x53dd,0x197));var _0xd53d=function(_0xe28e32,_0xa4a1fe){_0xe28e32=_0xe28e32-0x0;var _0x387bf1=_0x53dd[_0xe28e32];return _0x387bf1;};'use strict';var _=require(_0xd53d('0x0'));var util=require('util');var moment=require(_0xd53d('0x1'));var BPromise=require(_0xd53d('0x2'));var rs=require(_0xd53d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd53d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd53d('0x5'))('rpc');var config=require(_0xd53d('0x6'));var jayson=require(_0xd53d('0x7'));var client=jayson[_0xd53d('0x8')][_0xd53d('0x9')]({'port':0x232c});config[_0xd53d('0xa')]=_[_0xd53d('0xb')](config[_0xd53d('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xd53d('0xc'))(new Redis(config[_0xd53d('0xa')]));require(_0xd53d('0xd'))[_0xd53d('0xe')](socket);function respondWithRpcPromise(_0x69c361,_0x4e4540,_0x4784f6){return new BPromise(function(_0x3b427c,_0x9ad208){return client['request'](_0x69c361,_0x4784f6)['then'](function(_0x3a2b3a){logger[_0xd53d('0xf')](_0xd53d('0x10'),_0x4e4540,_0xd53d('0x11'));logger['debug'](_0xd53d('0x12'),_0x4e4540,_0xd53d('0x11'),JSON[_0xd53d('0x13')](_0x3a2b3a));if(_0x3a2b3a[_0xd53d('0x14')]){if(_0x3a2b3a[_0xd53d('0x14')][_0xd53d('0x15')]===0x1f4){logger['error'](_0xd53d('0x10'),_0x4e4540,_0x3a2b3a[_0xd53d('0x14')][_0xd53d('0x16')]);return _0x9ad208(_0x3a2b3a[_0xd53d('0x14')]['message']);}logger[_0xd53d('0x14')]('FaxAccount,\x20%s,\x20%s',_0x4e4540,_0x3a2b3a[_0xd53d('0x14')][_0xd53d('0x16')]);return _0x3b427c(_0x3a2b3a[_0xd53d('0x14')][_0xd53d('0x16')]);}else{logger['info']('FaxAccount,\x20%s,\x20%s',_0x4e4540,_0xd53d('0x11'));_0x3b427c(_0x3a2b3a[_0xd53d('0x17')][_0xd53d('0x16')]);}})[_0xd53d('0x18')](function(_0x4e3d5d){logger['error'](_0xd53d('0x10'),_0x4e4540,_0x4e3d5d);_0x9ad208(_0x4e3d5d);});});}exports['GetFaxAccount']=function(_0x280c4f){var _0xcb004a=this;return new Promise(function(_0x1ffa22,_0x156d0b){return db['FaxAccount']['findAll']({'raw':_0x280c4f[_0xd53d('0x19')]?_0x280c4f[_0xd53d('0x19')][_0xd53d('0x1a')]===undefined?!![]:![]:!![],'where':_0x280c4f[_0xd53d('0x19')]?_0x280c4f['options']['where']||null:null,'attributes':_0x280c4f[_0xd53d('0x19')]?_0x280c4f['options'][_0xd53d('0x1b')]||null:null,'limit':_0x280c4f[_0xd53d('0x19')]?_0x280c4f[_0xd53d('0x19')][_0xd53d('0x1c')]||null:null,'include':_0x280c4f[_0xd53d('0x19')]?_0x280c4f[_0xd53d('0x19')][_0xd53d('0x1d')]?_[_0xd53d('0x1e')](_0x280c4f[_0xd53d('0x19')][_0xd53d('0x1d')],function(_0x52eb8b){return{'model':db[_0x52eb8b[_0xd53d('0x1f')]],'as':_0x52eb8b['as'],'attributes':_0x52eb8b[_0xd53d('0x1b')],'include':_0x52eb8b['include']?_['map'](_0x52eb8b[_0xd53d('0x1d')],function(_0x2696e8){return{'model':db[_0x2696e8['model']],'as':_0x2696e8['as'],'attributes':_0x2696e8[_0xd53d('0x1b')],'include':_0x2696e8[_0xd53d('0x1d')]?_[_0xd53d('0x1e')](_0x2696e8[_0xd53d('0x1d')],function(_0x144744){return{'model':db[_0x144744['model']],'as':_0x144744['as'],'attributes':_0x144744[_0xd53d('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd53d('0x20')](function(_0x4ad0e6){logger[_0xd53d('0xf')](_0xd53d('0x21'),_0x280c4f);logger[_0xd53d('0x22')](_0xd53d('0x21'),_0x280c4f,JSON['stringify'](_0x4ad0e6));_0x1ffa22(_0x4ad0e6);})['catch'](function(_0x9f7891){logger[_0xd53d('0x14')]('GetFaxAccount',_0x9f7891[_0xd53d('0x16')],_0x280c4f);_0x156d0b(_0xcb004a[_0xd53d('0x14')](0x1f4,_0x9f7891[_0xd53d('0x16')]));});});};exports[_0xd53d('0x23')]=function(_0xdf2a59,_0x395b84,_0x2ee139){var _0x1b425=this;return new Promise(function(_0x1f4b14,_0x219384){var _0x300781={'body':_0xdf2a59[_0xd53d('0x24')],'channel':_0xd53d('0x25')};var _0x5ad6a8=[];var _0x4f8f7c=[];var _0x4595d6={};return db[_0xd53d('0x26')]['describe']()[_0xd53d('0x20')](function(_0x5a0016){if(!_0x5a0016){throw new db[(_0xd53d('0x27'))][(_0xd53d('0x28'))](_0xd53d('0x29'));}_0x5ad6a8=_[_0xd53d('0x2a')](_[_0xd53d('0x2b')](_0x5a0016),[_0xd53d('0x2c'),_0xd53d('0x2d')]);_0x4f8f7c=_[_0xd53d('0x2a')](_['keys'](_0x5a0016),[_0xd53d('0x2c'),_0xd53d('0x2d'),_0xd53d('0x2e'),_0xd53d('0x2f')]);if(_0xdf2a59[_0xd53d('0x24')]['id']){delete _0xdf2a59['body']['id'];}if(_[_0xd53d('0x30')](_0xdf2a59[_0xd53d('0x24')]['from'])){throw new db[(_0xd53d('0x27'))][(_0xd53d('0x28'))]('from\x20is\x20mandatory');}if(_[_0xd53d('0x30')](_0xdf2a59[_0xd53d('0x24')][_0xd53d('0x24')])||_0xdf2a59[_0xd53d('0x24')][_0xd53d('0x24')]===''){throw new db[(_0xd53d('0x27'))][(_0xd53d('0x28'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xd53d('0x30')](_0xdf2a59[_0xd53d('0x24')]['mapKey'])){throw new db['Sequelize'][(_0xd53d('0x28'))](_0xd53d('0x31')+_0x4f8f7c);}if(!_['includes'](_0x4f8f7c,_0xdf2a59[_0xd53d('0x24')][_0xd53d('0x32')])){throw new db[(_0xd53d('0x27'))]['ValidationError'](_0xd53d('0x33')+_0x4f8f7c);}_0x4595d6[_0xdf2a59[_0xd53d('0x24')]['mapKey']]=_0xdf2a59[_0xd53d('0x24')][_0xd53d('0x34')];})['then'](function(){return db[_0xd53d('0x35')][_0xd53d('0x36')]({'where':{'id':_0xdf2a59[_0xd53d('0x37')]['id']},'include':[{'model':db[_0xd53d('0x38')],'as':'List','include':[{'model':db['CmContact'],'as':_0xd53d('0x39'),'where':_0x4595d6,'limit':0x1,'order':[[_0xd53d('0x2d'),_0xd53d('0x3a')]]}]},{'model':db[_0xd53d('0x3b')],'as':_0xd53d('0x3c')}]});})[_0xd53d('0x20')](function(_0x43b169){if(_0x43b169&&_0x43b169[_0xd53d('0x3d')]){var _0x1cace8=_0x43b169[_0xd53d('0x3e')]({'plain':!![]});_0x300781[_0xd53d('0x37')]=_0x1cace8;_0x300781[_0xd53d('0x3f')]=_0x1cace8[_0xd53d('0x3c')];_0x300781[_0xd53d('0x40')]=_0x1cace8[_0xd53d('0x3d')];_0x300781[_0xd53d('0x3f')]=_[_0xd53d('0x41')](_0x300781[_0xd53d('0x3f')],['priority'],['asc']);if(_0x300781[_0xd53d('0x37')][_0xd53d('0x3c')]){delete _0x300781['account'][_0xd53d('0x3c')];}if(_0x300781[_0xd53d('0x37')][_0xd53d('0x3d')]&&_0x300781['account'][_0xd53d('0x3d')][_0xd53d('0x39')][_0xd53d('0x42')]){return _0x300781[_0xd53d('0x37')][_0xd53d('0x3d')]['Contacts'][0x0];}var _0x2da2c2=_[_0xd53d('0xb')](_0xdf2a59[_0xd53d('0x24')],{'firstName':_0xdf2a59[_0xd53d('0x24')]['from'],'ListId':_0x1cace8['ListId']});_0x2da2c2[_0xdf2a59[_0xd53d('0x24')]['mapKey']]=_0xdf2a59['body']['from'];return db[_0xd53d('0x26')][_0xd53d('0x43')](_0x2da2c2,{'fields':_0x5ad6a8,'raw':!![]});}})[_0xd53d('0x20')](function(_0x3c46a0){_0x300781[_0xd53d('0x44')]=_0x3c46a0;if(_0x3c46a0){var _0x42a9c4={'ContactId':_0x3c46a0['id'],'FaxAccountId':_0xdf2a59['account']['id'],'fax':_0x3c46a0['fax']};return db[_0xd53d('0x45')][_0xd53d('0x36')]({'where':{'ContactId':_0x3c46a0['id'],'closed':![],'FaxAccountId':_0xdf2a59[_0xd53d('0x37')]['id']}})[_0xd53d('0x20')](function(_0x2d255d){if(_0x2d255d){return[_0x2d255d,![]];}return db[_0xd53d('0x45')][_0xd53d('0x43')](_0x42a9c4)['then'](function(_0x13a429){return[_0x13a429,!![]];});});}else{throw new Error(_0xd53d('0x46'));}})[_0xd53d('0x47')](function(_0x849347,_0x46882b){var _0x444fd6=_0x849347['get']({'plain':!![]});if(_0x46882b){if(_0x300781[_0xd53d('0x37')][_0xd53d('0x48')]){_0x300781[_0xd53d('0x3f')][_0xd53d('0x49')]({'id':0x0,'priority':_0x300781[_0xd53d('0x3f')]['length']+0x1,'app':_0xd53d('0x4a'),'appdata':_0xd53d('0x4b'),'interval':_0xd53d('0x4c')});}_0x444fd6[_0xd53d('0x4d')]=!![];}else{_0x444fd6[_0xd53d('0x4d')]=![];}_0x300781['interaction']=_0x444fd6;return db[_0xd53d('0x4e')][_0xd53d('0x43')]({'body':_0xdf2a59['body'][_0xd53d('0x24')],'FaxAccountId':_0xdf2a59[_0xd53d('0x37')]['id'],'FaxInteractionId':_0x849347['id'],'direction':'in','ContactId':_0x849347[_0xd53d('0x4f')],'AttachmentId':_0xdf2a59[_0xd53d('0x24')][_0xd53d('0x50')]});})['then'](function(_0x2481e3){_0x300781['message']=_0x2481e3;if(_0x300781[_0xd53d('0x51')][_0xd53d('0x52')]){return db[_0xd53d('0x53')][_0xd53d('0x36')]({'attributes':['id',_0xd53d('0x54')],'where':{'id':_0x300781['interaction']['UserId']}})[_0xd53d('0x20')](function(_0x45cd9c){if(_0x45cd9c){_0x300781['applications'][_0xd53d('0x55')]({'id':0x0,'priority':0x0,'app':_0xd53d('0x56'),'appdata':_0x45cd9c[_0xd53d('0x54')]+','+(_0x300781[_0xd53d('0x37')][_0xd53d('0x57')]||0xa),'interval':_0xd53d('0x4c')});}return respondWithRpcPromise('Start',_0xd53d('0x58'),_0x300781);});}return respondWithRpcPromise(_0xd53d('0x59'),_0xd53d('0x58'),_0x300781);})[_0xd53d('0x20')](function(_0x21f7e8){_0x1f4b14(_0x21f7e8);})[_0xd53d('0x18')](function(_0x36a7e7){_0x219384(_0x1b425[_0xd53d('0x14')](0x1f4,_0x36a7e7[_0xd53d('0x16')]));});});}; \ No newline at end of file +var _0x6f31=['redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','attributes','limit','include','map','model','info','NotifyFaxAccount','fax','describe','Sequelize','ValidationError','keys','createdAt','updatedAt','CompanyId','body','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','CmContact','Contacts','DESC','FaxApplication','Applications','get','list','applications','orderBy','priority','asc','account','ListId','create','contact','FaxInteraction','find','Contact\x20not\x20found','length','close','unmanaged','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','User','name','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0x6f31,0x1c7));var _0x16f3=function(_0x4463ae,_0x319402){_0x4463ae=_0x4463ae-0x0;var _0x4f003c=_0x6f31[_0x4463ae];return _0x4f003c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x16f3('0x0'));var BPromise=require(_0x16f3('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x16f3('0x2'));var db=require(_0x16f3('0x3'))['db'];var utils=require(_0x16f3('0x4'));var logger=require(_0x16f3('0x5'))(_0x16f3('0x6'));var config=require('../../config/environment');var jayson=require(_0x16f3('0x7'));var client=jayson[_0x16f3('0x8')][_0x16f3('0x9')]({'port':0x232c});config[_0x16f3('0xa')]=_[_0x16f3('0xb')](config['redis'],{'host':_0x16f3('0xc'),'port':0x18eb});var socket=require(_0x16f3('0xd'))(new Redis(config[_0x16f3('0xa')]));require(_0x16f3('0xe'))[_0x16f3('0xf')](socket);function respondWithRpcPromise(_0x49691e,_0x1e4abf,_0x21f95d){return new BPromise(function(_0x3c4495,_0x418197){return client[_0x16f3('0x10')](_0x49691e,_0x21f95d)[_0x16f3('0x11')](function(_0x4d9f27){logger['info']('FaxAccount,\x20%s,\x20%s',_0x1e4abf,_0x16f3('0x12'));logger[_0x16f3('0x13')](_0x16f3('0x14'),_0x1e4abf,_0x16f3('0x12'),JSON[_0x16f3('0x15')](_0x4d9f27));if(_0x4d9f27[_0x16f3('0x16')]){if(_0x4d9f27[_0x16f3('0x16')][_0x16f3('0x17')]===0x1f4){logger['error'](_0x16f3('0x18'),_0x1e4abf,_0x4d9f27[_0x16f3('0x16')]['message']);return _0x418197(_0x4d9f27[_0x16f3('0x16')][_0x16f3('0x19')]);}logger[_0x16f3('0x16')](_0x16f3('0x18'),_0x1e4abf,_0x4d9f27[_0x16f3('0x16')][_0x16f3('0x19')]);return _0x3c4495(_0x4d9f27['error'][_0x16f3('0x19')]);}else{logger['info']('FaxAccount,\x20%s,\x20%s',_0x1e4abf,'request\x20sent');_0x3c4495(_0x4d9f27[_0x16f3('0x1a')][_0x16f3('0x19')]);}})[_0x16f3('0x1b')](function(_0x1a2b96){logger[_0x16f3('0x16')]('FaxAccount,\x20%s,\x20%s',_0x1e4abf,_0x1a2b96);_0x418197(_0x1a2b96);});});}exports[_0x16f3('0x1c')]=function(_0x2d7f73){var _0x29cbbd=this;return new Promise(function(_0x271404,_0x400b6a){return db[_0x16f3('0x1d')][_0x16f3('0x1e')]({'raw':_0x2d7f73[_0x16f3('0x1f')]?_0x2d7f73[_0x16f3('0x1f')][_0x16f3('0x20')]===undefined?!![]:![]:!![],'where':_0x2d7f73[_0x16f3('0x1f')]?_0x2d7f73[_0x16f3('0x1f')]['where']||null:null,'attributes':_0x2d7f73[_0x16f3('0x1f')]?_0x2d7f73[_0x16f3('0x1f')][_0x16f3('0x21')]||null:null,'limit':_0x2d7f73['options']?_0x2d7f73[_0x16f3('0x1f')][_0x16f3('0x22')]||null:null,'include':_0x2d7f73[_0x16f3('0x1f')]?_0x2d7f73[_0x16f3('0x1f')][_0x16f3('0x23')]?_[_0x16f3('0x24')](_0x2d7f73['options'][_0x16f3('0x23')],function(_0x299427){return{'model':db[_0x299427[_0x16f3('0x25')]],'as':_0x299427['as'],'attributes':_0x299427['attributes'],'include':_0x299427[_0x16f3('0x23')]?_['map'](_0x299427['include'],function(_0x57d680){return{'model':db[_0x57d680[_0x16f3('0x25')]],'as':_0x57d680['as'],'attributes':_0x57d680[_0x16f3('0x21')],'include':_0x57d680[_0x16f3('0x23')]?_[_0x16f3('0x24')](_0x57d680[_0x16f3('0x23')],function(_0x3d6ac1){return{'model':db[_0x3d6ac1['model']],'as':_0x3d6ac1['as'],'attributes':_0x3d6ac1[_0x16f3('0x21')]};}):[]};}):[]};}):[]:[]})[_0x16f3('0x11')](function(_0x2238df){logger[_0x16f3('0x26')](_0x16f3('0x1c'),_0x2d7f73);logger[_0x16f3('0x13')](_0x16f3('0x1c'),_0x2d7f73,JSON['stringify'](_0x2238df));_0x271404(_0x2238df);})['catch'](function(_0xbfd98c){logger[_0x16f3('0x16')](_0x16f3('0x1c'),_0xbfd98c[_0x16f3('0x19')],_0x2d7f73);_0x400b6a(_0x29cbbd[_0x16f3('0x16')](0x1f4,_0xbfd98c[_0x16f3('0x19')]));});});};exports[_0x16f3('0x27')]=function(_0x1db793,_0x1fda16,_0x1e5cb5){var _0x3beea6=this;return new Promise(function(_0x4e00c9,_0x165d91){var _0x2e9060={'body':_0x1db793['body'],'channel':_0x16f3('0x28')};var _0x26db99=[];var _0x447104=[];var _0x826db2={};return db['CmContact'][_0x16f3('0x29')]()[_0x16f3('0x11')](function(_0x560497){if(!_0x560497){throw new db[(_0x16f3('0x2a'))][(_0x16f3('0x2b'))]('no\x20available\x20attributes');}_0x26db99=_['difference'](_[_0x16f3('0x2c')](_0x560497),[_0x16f3('0x2d'),_0x16f3('0x2e')]);_0x447104=_['difference'](_[_0x16f3('0x2c')](_0x560497),[_0x16f3('0x2d'),_0x16f3('0x2e'),_0x16f3('0x2f'),'ListId']);if(_0x1db793[_0x16f3('0x30')]['id']){delete _0x1db793['body']['id'];}if(_['isNil'](_0x1db793[_0x16f3('0x30')][_0x16f3('0x31')])){throw new db[(_0x16f3('0x2a'))]['ValidationError'](_0x16f3('0x32'));}if(_[_0x16f3('0x33')](_0x1db793['body'][_0x16f3('0x30')])||_0x1db793['body'][_0x16f3('0x30')]===''){throw new db[(_0x16f3('0x2a'))]['ValidationError'](_0x16f3('0x34'));}if(_[_0x16f3('0x33')](_0x1db793[_0x16f3('0x30')][_0x16f3('0x35')])){throw new db[(_0x16f3('0x2a'))][(_0x16f3('0x2b'))](_0x16f3('0x36')+_0x447104);}if(!_[_0x16f3('0x37')](_0x447104,_0x1db793['body'][_0x16f3('0x35')])){throw new db[(_0x16f3('0x2a'))]['ValidationError'](_0x16f3('0x38')+_0x447104);}_0x826db2[_0x1db793['body'][_0x16f3('0x35')]]=_0x1db793['body'][_0x16f3('0x31')];})[_0x16f3('0x11')](function(){return db['FaxAccount']['find']({'where':{'id':_0x1db793['account']['id']},'include':[{'model':db[_0x16f3('0x39')],'as':_0x16f3('0x3a'),'include':[{'model':db[_0x16f3('0x3b')],'as':_0x16f3('0x3c'),'where':_0x826db2,'limit':0x1,'order':[[_0x16f3('0x2e'),_0x16f3('0x3d')]]}]},{'model':db[_0x16f3('0x3e')],'as':_0x16f3('0x3f')}]});})[_0x16f3('0x11')](function(_0x36fb91){if(_0x36fb91&&_0x36fb91[_0x16f3('0x3a')]){var _0x4aa1e3=_0x36fb91[_0x16f3('0x40')]({'plain':!![]});_0x2e9060['account']=_0x4aa1e3;_0x2e9060['applications']=_0x4aa1e3[_0x16f3('0x3f')];_0x2e9060[_0x16f3('0x41')]=_0x4aa1e3[_0x16f3('0x3a')];_0x2e9060[_0x16f3('0x42')]=_[_0x16f3('0x43')](_0x2e9060[_0x16f3('0x42')],[_0x16f3('0x44')],[_0x16f3('0x45')]);if(_0x2e9060[_0x16f3('0x46')][_0x16f3('0x3f')]){delete _0x2e9060[_0x16f3('0x46')]['Applications'];}if(_0x2e9060[_0x16f3('0x46')]['List']&&_0x2e9060['account'][_0x16f3('0x3a')][_0x16f3('0x3c')]['length']){return _0x2e9060[_0x16f3('0x46')]['List'][_0x16f3('0x3c')][0x0];}var _0x5675e1=_[_0x16f3('0xb')](_0x1db793['body'],{'firstName':_0x1db793[_0x16f3('0x30')][_0x16f3('0x31')],'ListId':_0x4aa1e3[_0x16f3('0x47')]});_0x5675e1[_0x1db793['body'][_0x16f3('0x35')]]=_0x1db793[_0x16f3('0x30')]['from'];return db[_0x16f3('0x3b')][_0x16f3('0x48')](_0x5675e1,{'fields':_0x26db99,'raw':!![]});}})[_0x16f3('0x11')](function(_0x263065){_0x2e9060[_0x16f3('0x49')]=_0x263065;if(_0x263065){var _0x336d42={'ContactId':_0x263065['id'],'FaxAccountId':_0x1db793[_0x16f3('0x46')]['id'],'fax':_0x263065['fax']};return db[_0x16f3('0x4a')][_0x16f3('0x4b')]({'where':{'ContactId':_0x263065['id'],'closed':![],'FaxAccountId':_0x1db793[_0x16f3('0x46')]['id']}})[_0x16f3('0x11')](function(_0x461e41){if(_0x461e41){return[_0x461e41,![]];}return db[_0x16f3('0x4a')][_0x16f3('0x48')](_0x336d42)[_0x16f3('0x11')](function(_0x1c7293){return[_0x1c7293,!![]];});});}else{throw new Error(_0x16f3('0x4c'));}})['spread'](function(_0x459b7f,_0x241c79){var _0x590d7d=_0x459b7f[_0x16f3('0x40')]({'plain':!![]});if(_0x241c79){if(_0x2e9060['account']['autoclose']){_0x2e9060[_0x16f3('0x42')]['push']({'id':0x0,'priority':_0x2e9060[_0x16f3('0x42')][_0x16f3('0x4d')]+0x1,'app':_0x16f3('0x4e'),'appdata':_0x16f3('0x4f'),'interval':'*,*,*,*'});}_0x590d7d[_0x16f3('0x50')]=!![];}else{_0x590d7d['created']=![];}_0x2e9060[_0x16f3('0x51')]=_0x590d7d;return db[_0x16f3('0x52')][_0x16f3('0x48')]({'body':_0x1db793[_0x16f3('0x30')][_0x16f3('0x30')],'FaxAccountId':_0x1db793['account']['id'],'FaxInteractionId':_0x459b7f['id'],'direction':'in','ContactId':_0x459b7f[_0x16f3('0x53')],'AttachmentId':_0x1db793[_0x16f3('0x30')][_0x16f3('0x54')]});})[_0x16f3('0x11')](function(_0x20799c){_0x2e9060[_0x16f3('0x19')]=_0x20799c;if(_0x2e9060[_0x16f3('0x51')][_0x16f3('0x55')]){return db[_0x16f3('0x56')][_0x16f3('0x4b')]({'attributes':['id',_0x16f3('0x57')],'where':{'id':_0x2e9060[_0x16f3('0x51')][_0x16f3('0x55')]}})['then'](function(_0x186e66){if(_0x186e66){_0x2e9060[_0x16f3('0x42')]['unshift']({'id':0x0,'priority':0x0,'app':_0x16f3('0x58'),'appdata':_0x186e66[_0x16f3('0x57')]+','+(_0x2e9060[_0x16f3('0x46')][_0x16f3('0x59')]||0xa),'interval':_0x16f3('0x5a')});}return respondWithRpcPromise(_0x16f3('0x5b'),'startRouting',_0x2e9060);});}return respondWithRpcPromise(_0x16f3('0x5b'),_0x16f3('0x5c'),_0x2e9060);})[_0x16f3('0x11')](function(_0x574661){_0x4e00c9(_0x574661);})['catch'](function(_0x5be4f7){_0x165d91(_0x3beea6[_0x16f3('0x16')](0x1f4,_0x5be4f7[_0x16f3('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 84663ab..a857b11 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 _0xf3c6=['save','update','removeListener','register','length','faxAccount:','./faxAccount.events'];(function(_0x2f1872,_0x9b3dc3){var _0x392b2d=function(_0x19dffa){while(--_0x19dffa){_0x2f1872['push'](_0x2f1872['shift']());}};_0x392b2d(++_0x9b3dc3);}(_0xf3c6,0x125));var _0x6f3c=function(_0x41810d,_0x548e26){_0x41810d=_0x41810d-0x0;var _0x34cf94=_0xf3c6[_0x41810d];return _0x34cf94;};'use strict';var FaxAccountEvents=require(_0x6f3c('0x0'));var events=[_0x6f3c('0x1'),'remove',_0x6f3c('0x2')];function createListener(_0xc09ddd,_0x436815){return function(_0x481537){_0x436815['emit'](_0xc09ddd,_0x481537);};}function removeListener(_0x3355ed,_0x51bd73){return function(){FaxAccountEvents[_0x6f3c('0x3')](_0x3355ed,_0x51bd73);};}exports[_0x6f3c('0x4')]=function(_0x5d5a6d){for(var _0x2d2ba9=0x0,_0x5590bd=events[_0x6f3c('0x5')];_0x2d2ba9<_0x5590bd;_0x2d2ba9++){var _0x1467a8=events[_0x2d2ba9];var _0x21b653=createListener(_0x6f3c('0x6')+_0x1467a8,_0x5d5a6d);FaxAccountEvents['on'](_0x1467a8,_0x21b653);}}; \ No newline at end of file +var _0x8843=['./faxAccount.events','save','update','emit','removeListener'];(function(_0x5f4be5,_0x38d912){var _0x4634bb=function(_0x1e5acc){while(--_0x1e5acc){_0x5f4be5['push'](_0x5f4be5['shift']());}};_0x4634bb(++_0x38d912);}(_0x8843,0x8c));var _0x3884=function(_0x2b9b7f,_0x4d47df){_0x2b9b7f=_0x2b9b7f-0x0;var _0x4ed19a=_0x8843[_0x2b9b7f];return _0x4ed19a;};'use strict';var FaxAccountEvents=require(_0x3884('0x0'));var events=[_0x3884('0x1'),'remove',_0x3884('0x2')];function createListener(_0x590914,_0x2369f2){return function(_0x2ade5b){_0x2369f2[_0x3884('0x3')](_0x590914,_0x2ade5b);};}function removeListener(_0xc492fb,_0x484f61){return function(){FaxAccountEvents[_0x3884('0x4')](_0xc492fb,_0x484f61);};}exports['register']=function(_0x8270a9){for(var _0x15ecdd=0x0,_0x12b0e3=events['length'];_0x15ecdd<_0x12b0e3;_0x15ecdd++){var _0x27bcdf=events[_0x15ecdd];var _0x5ac387=createListener('faxAccount:'+_0x27bcdf,_0x8270a9);FaxAccountEvents['on'](_0x27bcdf,_0x5ac387);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 1c87722..5847ece 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(_0xa5e664,_0x4ddb13){var _0x25088e=function(_0x57515a){while(--_0x57515a){_0xa5e664['push'](_0xa5e664['shift']());}};_0x25088e(++_0x4ddb13);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));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(_0x2a077c,_0x1a62b1){var _0x2e338f=function(_0xda1dbc){while(--_0xda1dbc){_0x2a077c['push'](_0x2a077c['shift']());}};_0x2e338f(++_0x1a62b1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'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 573e12c..a7efcea 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 _0x2f76=['exports','INTEGER','noop','TEXT','STRING','*,*,*,*'];(function(_0x5f3de3,_0x40f0f5){var _0x287e0d=function(_0x3189dc){while(--_0x3189dc){_0x5f3de3['push'](_0x5f3de3['shift']());}};_0x287e0d(++_0x40f0f5);}(_0x2f76,0x1aa));var _0x62f7=function(_0xcde94c,_0x5c06d0){_0xcde94c=_0xcde94c-0x0;var _0x6ac41a=_0x2f76[_0xcde94c];return _0x6ac41a;};'use strict';var Sequelize=require('sequelize');module[_0x62f7('0x0')]={'priority':{'type':Sequelize[_0x62f7('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x62f7('0x2')},'appdata':{'type':Sequelize[_0x62f7('0x3')]()},'description':{'type':Sequelize[_0x62f7('0x4')]},'interval':{'type':Sequelize[_0x62f7('0x4')],'defaultValue':_0x62f7('0x5')}}; \ No newline at end of file +var _0x7bef=['TEXT','exports','INTEGER','STRING'];(function(_0x253f4f,_0x4fab78){var _0x4ba01b=function(_0xb9067c){while(--_0xb9067c){_0x253f4f['push'](_0x253f4f['shift']());}};_0x4ba01b(++_0x4fab78);}(_0x7bef,0x1c1));var _0xf7be=function(_0x1bff41,_0x386880){_0x1bff41=_0x1bff41-0x0;var _0x4db66b=_0x7bef[_0x1bff41];return _0x4db66b;};'use strict';var Sequelize=require('sequelize');module[_0xf7be('0x0')]={'priority':{'type':Sequelize[_0xf7be('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xf7be('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xf7be('0x3')]()},'description':{'type':Sequelize[_0xf7be('0x2')]},'interval':{'type':Sequelize[_0xf7be('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index de2353f..2d6ed4d 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 _0x8de0=['key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','destroy','then','error','stack','name','send','FaxApplication','rawAttributes','fieldName','type'];(function(_0x2b45b5,_0x474458){var _0x1d9c06=function(_0x9a3264){while(--_0x9a3264){_0x2b45b5['push'](_0x2b45b5['shift']());}};_0x1d9c06(++_0x474458);}(_0x8de0,0x1e9));var _0x08de=function(_0x1f66bc,_0x2744e5){_0x1f66bc=_0x1f66bc-0x0;var _0x50b266=_0x8de0[_0x1f66bc];return _0x50b266;};'use strict';var emlformat=require(_0x08de('0x0'));var rimraf=require(_0x08de('0x1'));var zipdir=require(_0x08de('0x2'));var jsonpatch=require(_0x08de('0x3'));var rp=require(_0x08de('0x4'));var moment=require(_0x08de('0x5'));var BPromise=require(_0x08de('0x6'));var Mustache=require(_0x08de('0x7'));var util=require(_0x08de('0x8'));var path=require(_0x08de('0x9'));var sox=require(_0x08de('0xa'));var csv=require(_0x08de('0xb'));var ejs=require(_0x08de('0xc'));var fs=require('fs');var fs_extra=require(_0x08de('0xd'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x08de('0xe'));var jsforce=require(_0x08de('0xf'));var deskjs=require(_0x08de('0x10'));var toCsv=require(_0x08de('0xb'));var querystring=require(_0x08de('0x11'));var Papa=require(_0x08de('0x12'));var Redis=require(_0x08de('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x08de('0x14'));var hardwareService=require(_0x08de('0x15'));var logger=require(_0x08de('0x16'))(_0x08de('0x17'));var utils=require(_0x08de('0x18'));var config=require(_0x08de('0x19'));var licenseUtil=require(_0x08de('0x1a'));var db=require(_0x08de('0x1b'))['db'];function respondWithStatusCode(_0x41e26d,_0x4e107a){_0x4e107a=_0x4e107a||0xcc;return function(_0x52107b){if(_0x52107b){return _0x41e26d[_0x08de('0x1c')](_0x4e107a);}return _0x41e26d[_0x08de('0x1d')](_0x4e107a)[_0x08de('0x1e')]();};}function respondWithResult(_0x1fa945,_0x3aa1fe){_0x3aa1fe=_0x3aa1fe||0xc8;return function(_0x222092){if(_0x222092){return _0x1fa945['status'](_0x3aa1fe)[_0x08de('0x1f')](_0x222092);}};}function respondWithFilteredResult(_0x202668,_0x174561){return function(_0xfc0ec9){if(_0xfc0ec9){var _0x4b98d4=typeof _0x174561[_0x08de('0x20')]===_0x08de('0x21')&&typeof _0x174561[_0x08de('0x22')]===_0x08de('0x21');var _0x1f291a=_0xfc0ec9[_0x08de('0x23')];var _0x3b91aa=_0x4b98d4?0x0:_0x174561['offset'];var _0x497ace=_0x4b98d4?_0xfc0ec9['count']:_0x174561[_0x08de('0x20')]+_0x174561[_0x08de('0x22')];var _0x5a8abc;if(_0x497ace>=_0x1f291a){_0x497ace=_0x1f291a;_0x5a8abc=0xc8;}else{_0x5a8abc=0xce;}_0x202668['status'](_0x5a8abc);return _0x202668[_0x08de('0x24')](_0x08de('0x25'),_0x3b91aa+'-'+_0x497ace+'/'+_0x1f291a)[_0x08de('0x1f')](_0xfc0ec9);}return null;};}function patchUpdates(_0x10144e){return function(_0x1c7278){try{jsonpatch[_0x08de('0x26')](_0x1c7278,_0x10144e,!![]);}catch(_0x4ab215){return BPromise['reject'](_0x4ab215);}return _0x1c7278[_0x08de('0x27')]();};}function saveUpdates(_0x2b6568,_0x2550a7){return function(_0x23a4f1){if(_0x23a4f1){return _0x23a4f1['update'](_0x2b6568)['then'](function(_0x35e0c7){return _0x35e0c7;});}return null;};}function removeEntity(_0xb2b326,_0x17e9b4){return function(_0x45186f){if(_0x45186f){return _0x45186f[_0x08de('0x28')]()[_0x08de('0x29')](function(){_0xb2b326[_0x08de('0x1d')](0xcc)[_0x08de('0x1e')]();});}};}function handleEntityNotFound(_0x330dba,_0x510ce4){return function(_0x55506f){if(!_0x55506f){_0x330dba[_0x08de('0x1c')](0x194);}return _0x55506f;};}function handleError(_0xd6de9c,_0x4eee6a){_0x4eee6a=_0x4eee6a||0x1f4;return function(_0x6128b2){logger[_0x08de('0x2a')](_0x6128b2[_0x08de('0x2b')]);if(_0x6128b2[_0x08de('0x2c')]){delete _0x6128b2[_0x08de('0x2c')];}_0xd6de9c['status'](_0x4eee6a)[_0x08de('0x2d')](_0x6128b2);};}exports['index']=function(_0x19e692,_0x73858f){var _0x47465b={},_0x122bb9={},_0x3b20ad={'count':0x0,'rows':[]};var _0x4c7df7=_['map'](db[_0x08de('0x2e')][_0x08de('0x2f')],function(_0x8af46f){return{'name':_0x8af46f[_0x08de('0x30')],'type':_0x8af46f[_0x08de('0x31')][_0x08de('0x32')]};});_0x122bb9[_0x08de('0x33')]=_[_0x08de('0x34')](_0x4c7df7,_0x08de('0x2c'));_0x122bb9[_0x08de('0x35')]=_['keys'](_0x19e692['query']);_0x122bb9[_0x08de('0x36')]=_[_0x08de('0x37')](_0x122bb9['model'],_0x122bb9[_0x08de('0x35')]);_0x47465b['attributes']=_[_0x08de('0x37')](_0x122bb9[_0x08de('0x33')],qs[_0x08de('0x38')](_0x19e692[_0x08de('0x35')][_0x08de('0x38')]));_0x47465b[_0x08de('0x39')]=_0x47465b[_0x08de('0x39')][_0x08de('0x3a')]?_0x47465b['attributes']:_0x122bb9[_0x08de('0x33')];if(!_0x19e692[_0x08de('0x35')][_0x08de('0x3b')](_0x08de('0x3c'))){_0x47465b['limit']=qs[_0x08de('0x22')](_0x19e692['query'][_0x08de('0x22')]);_0x47465b[_0x08de('0x20')]=qs['offset'](_0x19e692[_0x08de('0x35')][_0x08de('0x20')]);}_0x47465b[_0x08de('0x3d')]=qs[_0x08de('0x3e')](_0x19e692['query'][_0x08de('0x3e')]);_0x47465b[_0x08de('0x3f')]=qs[_0x08de('0x36')](_[_0x08de('0x40')](_0x19e692['query'],_0x122bb9[_0x08de('0x36')]),_0x4c7df7);if(_0x19e692[_0x08de('0x35')][_0x08de('0x41')]){_0x47465b['where']=_[_0x08de('0x42')](_0x47465b[_0x08de('0x3f')],{'$or':_[_0x08de('0x34')](_0x4c7df7,function(_0x47dfdd){if(_0x47dfdd[_0x08de('0x31')]!==_0x08de('0x43')){var _0x5d7618={};_0x5d7618[_0x47dfdd[_0x08de('0x2c')]]={'$like':'%'+_0x19e692[_0x08de('0x35')][_0x08de('0x41')]+'%'};return _0x5d7618;}})});}_0x47465b=_[_0x08de('0x42')]({},_0x47465b,_0x19e692[_0x08de('0x44')]);var _0x1bde91={'where':_0x47465b[_0x08de('0x3f')]};return db[_0x08de('0x2e')][_0x08de('0x23')](_0x1bde91)[_0x08de('0x29')](function(_0xd2dcdb){_0x3b20ad['count']=_0xd2dcdb;if(_0x19e692[_0x08de('0x35')][_0x08de('0x45')]){_0x47465b[_0x08de('0x46')]=[{'all':!![]}];}return db[_0x08de('0x2e')][_0x08de('0x47')](_0x47465b);})['then'](function(_0x57b856){_0x3b20ad['rows']=_0x57b856;return _0x3b20ad;})[_0x08de('0x29')](respondWithFilteredResult(_0x73858f,_0x47465b))[_0x08de('0x48')](handleError(_0x73858f,null));};exports['show']=function(_0x41d579,_0x223303){var _0x244bde={'raw':!![],'where':{'id':_0x41d579[_0x08de('0x49')]['id']}},_0x242046={};_0x242046[_0x08de('0x33')]=_['keys'](db[_0x08de('0x2e')][_0x08de('0x2f')]);_0x242046[_0x08de('0x35')]=_['keys'](_0x41d579[_0x08de('0x35')]);_0x242046[_0x08de('0x36')]=_[_0x08de('0x37')](_0x242046[_0x08de('0x33')],_0x242046[_0x08de('0x35')]);_0x244bde[_0x08de('0x39')]=_['intersection'](_0x242046[_0x08de('0x33')],qs['fields'](_0x41d579[_0x08de('0x35')]['fields']));_0x244bde[_0x08de('0x39')]=_0x244bde[_0x08de('0x39')][_0x08de('0x3a')]?_0x244bde['attributes']:_0x242046[_0x08de('0x33')];if(_0x41d579['query'][_0x08de('0x45')]){_0x244bde[_0x08de('0x46')]=[{'all':!![]}];}_0x244bde=_[_0x08de('0x42')]({},_0x244bde,_0x41d579['options']);return db[_0x08de('0x2e')]['find'](_0x244bde)[_0x08de('0x29')](handleEntityNotFound(_0x223303,null))[_0x08de('0x29')](respondWithResult(_0x223303,null))['catch'](handleError(_0x223303,null));};exports[_0x08de('0x4a')]=function(_0x3accce,_0x2c8e03){return db['FaxApplication'][_0x08de('0x4a')](_0x3accce[_0x08de('0x4b')],{})[_0x08de('0x29')](respondWithResult(_0x2c8e03,0xc9))[_0x08de('0x48')](handleError(_0x2c8e03,null));};exports['update']=function(_0x209a7b,_0x56ee4a){if(_0x209a7b['body']['id']){delete _0x209a7b[_0x08de('0x4b')]['id'];}return db['FaxApplication'][_0x08de('0x4c')]({'where':{'id':_0x209a7b[_0x08de('0x49')]['id']}})[_0x08de('0x29')](handleEntityNotFound(_0x56ee4a,null))[_0x08de('0x29')](saveUpdates(_0x209a7b[_0x08de('0x4b')],null))[_0x08de('0x29')](respondWithResult(_0x56ee4a,null))[_0x08de('0x48')](handleError(_0x56ee4a,null));};exports[_0x08de('0x28')]=function(_0x3c819e,_0x5b6ca4){return db[_0x08de('0x2e')][_0x08de('0x4c')]({'where':{'id':_0x3c819e[_0x08de('0x49')]['id']}})[_0x08de('0x29')](handleEntityNotFound(_0x5b6ca4,null))[_0x08de('0x29')](removeEntity(_0x5b6ca4,null))[_0x08de('0x48')](handleError(_0x5b6ca4,null));}; \ No newline at end of file +var _0x9cd1=['nolimit','order','sort','where','pick','filter','map','merge','options','includeAll','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','FaxApplication','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x1b6d49,_0x4f4d35){var _0xaeb1ec=function(_0x6b3bfd){while(--_0x6b3bfd){_0x1b6d49['push'](_0x1b6d49['shift']());}};_0xaeb1ec(++_0x4f4d35);}(_0x9cd1,0x17f));var _0x19cd=function(_0x4e5c8a,_0x43273b){_0x4e5c8a=_0x4e5c8a-0x0;var _0x561469=_0x9cd1[_0x4e5c8a];return _0x561469;};'use strict';var emlformat=require(_0x19cd('0x0'));var rimraf=require(_0x19cd('0x1'));var zipdir=require(_0x19cd('0x2'));var jsonpatch=require(_0x19cd('0x3'));var rp=require(_0x19cd('0x4'));var moment=require(_0x19cd('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x19cd('0x6'));var path=require(_0x19cd('0x7'));var sox=require(_0x19cd('0x8'));var csv=require('to-csv');var ejs=require(_0x19cd('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x19cd('0xa'));var squel=require(_0x19cd('0xb'));var crypto=require('crypto');var jsforce=require(_0x19cd('0xc'));var deskjs=require(_0x19cd('0xd'));var toCsv=require(_0x19cd('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x19cd('0xf'));var as=require(_0x19cd('0x10'));var hardwareService=require(_0x19cd('0x11'));var logger=require(_0x19cd('0x12'))(_0x19cd('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x19cd('0x14'));var db=require(_0x19cd('0x15'))['db'];function respondWithStatusCode(_0x2e2dc8,_0x168dfb){_0x168dfb=_0x168dfb||0xcc;return function(_0x243bd1){if(_0x243bd1){return _0x2e2dc8['sendStatus'](_0x168dfb);}return _0x2e2dc8[_0x19cd('0x16')](_0x168dfb)[_0x19cd('0x17')]();};}function respondWithResult(_0x3ec1d6,_0x380176){_0x380176=_0x380176||0xc8;return function(_0x578808){if(_0x578808){return _0x3ec1d6['status'](_0x380176)[_0x19cd('0x18')](_0x578808);}};}function respondWithFilteredResult(_0x597677,_0x196c35){return function(_0xab54d7){if(_0xab54d7){var _0x370809=typeof _0x196c35[_0x19cd('0x19')]===_0x19cd('0x1a')&&typeof _0x196c35['limit']===_0x19cd('0x1a');var _0x1ffdca=_0xab54d7[_0x19cd('0x1b')];var _0x110bb3=_0x370809?0x0:_0x196c35[_0x19cd('0x19')];var _0xd5bc2d=_0x370809?_0xab54d7['count']:_0x196c35[_0x19cd('0x19')]+_0x196c35[_0x19cd('0x1c')];var _0x2c186e;if(_0xd5bc2d>=_0x1ffdca){_0xd5bc2d=_0x1ffdca;_0x2c186e=0xc8;}else{_0x2c186e=0xce;}_0x597677[_0x19cd('0x16')](_0x2c186e);return _0x597677[_0x19cd('0x1d')](_0x19cd('0x1e'),_0x110bb3+'-'+_0xd5bc2d+'/'+_0x1ffdca)[_0x19cd('0x18')](_0xab54d7);}return null;};}function patchUpdates(_0x32cf6b){return function(_0x4d15af){try{jsonpatch[_0x19cd('0x1f')](_0x4d15af,_0x32cf6b,!![]);}catch(_0x2b5d1a){return BPromise[_0x19cd('0x20')](_0x2b5d1a);}return _0x4d15af[_0x19cd('0x21')]();};}function saveUpdates(_0x2bd5e7,_0x546903){return function(_0x1ea760){if(_0x1ea760){return _0x1ea760[_0x19cd('0x22')](_0x2bd5e7)[_0x19cd('0x23')](function(_0x1fe143){return _0x1fe143;});}return null;};}function removeEntity(_0x563878,_0x2d7ad1){return function(_0x2e7757){if(_0x2e7757){return _0x2e7757[_0x19cd('0x24')]()[_0x19cd('0x23')](function(){_0x563878[_0x19cd('0x16')](0xcc)[_0x19cd('0x17')]();});}};}function handleEntityNotFound(_0xfce74b,_0x33b7d8){return function(_0x5efb13){if(!_0x5efb13){_0xfce74b[_0x19cd('0x25')](0x194);}return _0x5efb13;};}function handleError(_0x1ca76d,_0x3fb92d){_0x3fb92d=_0x3fb92d||0x1f4;return function(_0x178b81){logger[_0x19cd('0x26')](_0x178b81[_0x19cd('0x27')]);if(_0x178b81[_0x19cd('0x28')]){delete _0x178b81[_0x19cd('0x28')];}_0x1ca76d['status'](_0x3fb92d)['send'](_0x178b81);};}exports[_0x19cd('0x29')]=function(_0x52b845,_0x4f287f){var _0x367bc8={},_0x3cf8c4={},_0x1b8cec={'count':0x0,'rows':[]};var _0x4baef0=_['map'](db[_0x19cd('0x2a')]['rawAttributes'],function(_0x738f22){return{'name':_0x738f22[_0x19cd('0x2b')],'type':_0x738f22[_0x19cd('0x2c')][_0x19cd('0x2d')]};});_0x3cf8c4[_0x19cd('0x2e')]=_['map'](_0x4baef0,_0x19cd('0x28'));_0x3cf8c4[_0x19cd('0x2f')]=_[_0x19cd('0x30')](_0x52b845['query']);_0x3cf8c4[_0x19cd('0x31')]=_[_0x19cd('0x32')](_0x3cf8c4[_0x19cd('0x2e')],_0x3cf8c4[_0x19cd('0x2f')]);_0x367bc8[_0x19cd('0x33')]=_[_0x19cd('0x32')](_0x3cf8c4['model'],qs[_0x19cd('0x34')](_0x52b845[_0x19cd('0x2f')][_0x19cd('0x34')]));_0x367bc8['attributes']=_0x367bc8[_0x19cd('0x33')][_0x19cd('0x35')]?_0x367bc8[_0x19cd('0x33')]:_0x3cf8c4['model'];if(!_0x52b845[_0x19cd('0x2f')][_0x19cd('0x36')](_0x19cd('0x37'))){_0x367bc8[_0x19cd('0x1c')]=qs['limit'](_0x52b845[_0x19cd('0x2f')][_0x19cd('0x1c')]);_0x367bc8[_0x19cd('0x19')]=qs[_0x19cd('0x19')](_0x52b845['query'][_0x19cd('0x19')]);}_0x367bc8[_0x19cd('0x38')]=qs['sort'](_0x52b845[_0x19cd('0x2f')][_0x19cd('0x39')]);_0x367bc8[_0x19cd('0x3a')]=qs[_0x19cd('0x31')](_[_0x19cd('0x3b')](_0x52b845[_0x19cd('0x2f')],_0x3cf8c4['filters']),_0x4baef0);if(_0x52b845[_0x19cd('0x2f')][_0x19cd('0x3c')]){_0x367bc8[_0x19cd('0x3a')]=_['merge'](_0x367bc8['where'],{'$or':_[_0x19cd('0x3d')](_0x4baef0,function(_0x205d9e){if(_0x205d9e[_0x19cd('0x2c')]!=='VIRTUAL'){var _0x34bc17={};_0x34bc17[_0x205d9e[_0x19cd('0x28')]]={'$like':'%'+_0x52b845[_0x19cd('0x2f')]['filter']+'%'};return _0x34bc17;}})});}_0x367bc8=_[_0x19cd('0x3e')]({},_0x367bc8,_0x52b845[_0x19cd('0x3f')]);var _0x482440={'where':_0x367bc8['where']};return db[_0x19cd('0x2a')][_0x19cd('0x1b')](_0x482440)[_0x19cd('0x23')](function(_0x5942d4){_0x1b8cec[_0x19cd('0x1b')]=_0x5942d4;if(_0x52b845['query'][_0x19cd('0x40')]){_0x367bc8['include']=[{'all':!![]}];}return db['FaxApplication'][_0x19cd('0x41')](_0x367bc8);})['then'](function(_0x117af6){_0x1b8cec[_0x19cd('0x42')]=_0x117af6;return _0x1b8cec;})[_0x19cd('0x23')](respondWithFilteredResult(_0x4f287f,_0x367bc8))[_0x19cd('0x43')](handleError(_0x4f287f,null));};exports[_0x19cd('0x44')]=function(_0xbfc923,_0x17fb91){var _0x27aa09={'raw':!![],'where':{'id':_0xbfc923[_0x19cd('0x45')]['id']}},_0x478d94={};_0x478d94[_0x19cd('0x2e')]=_[_0x19cd('0x30')](db[_0x19cd('0x2a')]['rawAttributes']);_0x478d94[_0x19cd('0x2f')]=_[_0x19cd('0x30')](_0xbfc923[_0x19cd('0x2f')]);_0x478d94['filters']=_[_0x19cd('0x32')](_0x478d94[_0x19cd('0x2e')],_0x478d94[_0x19cd('0x2f')]);_0x27aa09[_0x19cd('0x33')]=_['intersection'](_0x478d94[_0x19cd('0x2e')],qs[_0x19cd('0x34')](_0xbfc923[_0x19cd('0x2f')][_0x19cd('0x34')]));_0x27aa09[_0x19cd('0x33')]=_0x27aa09[_0x19cd('0x33')][_0x19cd('0x35')]?_0x27aa09['attributes']:_0x478d94[_0x19cd('0x2e')];if(_0xbfc923[_0x19cd('0x2f')][_0x19cd('0x40')]){_0x27aa09['include']=[{'all':!![]}];}_0x27aa09=_['merge']({},_0x27aa09,_0xbfc923[_0x19cd('0x3f')]);return db['FaxApplication'][_0x19cd('0x46')](_0x27aa09)[_0x19cd('0x23')](handleEntityNotFound(_0x17fb91,null))[_0x19cd('0x23')](respondWithResult(_0x17fb91,null))[_0x19cd('0x43')](handleError(_0x17fb91,null));};exports['create']=function(_0x4ddf25,_0x22ffe4){return db[_0x19cd('0x2a')][_0x19cd('0x47')](_0x4ddf25[_0x19cd('0x48')],{})['then'](respondWithResult(_0x22ffe4,0xc9))[_0x19cd('0x43')](handleError(_0x22ffe4,null));};exports[_0x19cd('0x22')]=function(_0x55f41d,_0x417def){if(_0x55f41d[_0x19cd('0x48')]['id']){delete _0x55f41d[_0x19cd('0x48')]['id'];}return db[_0x19cd('0x2a')][_0x19cd('0x46')]({'where':{'id':_0x55f41d[_0x19cd('0x45')]['id']}})[_0x19cd('0x23')](handleEntityNotFound(_0x417def,null))[_0x19cd('0x23')](saveUpdates(_0x55f41d[_0x19cd('0x48')],null))[_0x19cd('0x23')](respondWithResult(_0x417def,null))['catch'](handleError(_0x417def,null));};exports[_0x19cd('0x24')]=function(_0x2a8b2e,_0xf1239){return db['FaxApplication'][_0x19cd('0x46')]({'where':{'id':_0x2a8b2e[_0x19cd('0x45')]['id']}})[_0x19cd('0x23')](handleEntityNotFound(_0xf1239,null))[_0x19cd('0x23')](removeEntity(_0xf1239,null))['catch'](handleError(_0xf1239,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index a11832a..2653ed8 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 _0x0d72=['lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./faxApplication.attributes','exports','define','FaxApplication','fax_applications','utf8mb4_unicode_ci'];(function(_0x2366c8,_0x3cbc5){var _0x1688b9=function(_0x719ce2){while(--_0x719ce2){_0x2366c8['push'](_0x2366c8['shift']());}};_0x1688b9(++_0x3cbc5);}(_0x0d72,0x11e));var _0x20d7=function(_0x5b6ba6,_0x521220){_0x5b6ba6=_0x5b6ba6-0x0;var _0x3ecff6=_0x0d72[_0x5b6ba6];return _0x3ecff6;};'use strict';var _=require(_0x20d7('0x0'));var util=require('util');var logger=require(_0x20d7('0x1'))(_0x20d7('0x2'));var moment=require(_0x20d7('0x3'));var BPromise=require('bluebird');var rp=require(_0x20d7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x20d7('0x5'));var config=require(_0x20d7('0x6'));var attributes=require(_0x20d7('0x7'));module[_0x20d7('0x8')]=function(_0x380c5a,_0x3851cc){return _0x380c5a[_0x20d7('0x9')](_0x20d7('0xa'),attributes,{'tableName':_0x20d7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x20d7('0xc')});}; \ No newline at end of file +var _0xd2ed=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./faxApplication.attributes','FaxApplication','utf8mb4_unicode_ci'];(function(_0x443ec0,_0x186140){var _0x227249=function(_0xf48696){while(--_0xf48696){_0x443ec0['push'](_0x443ec0['shift']());}};_0x227249(++_0x186140);}(_0xd2ed,0xfa));var _0xdd2e=function(_0x20d73e,_0x39f9ec){_0x20d73e=_0x20d73e-0x0;var _0x52e84b=_0xd2ed[_0x20d73e];return _0x52e84b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xdd2e('0x0'))(_0xdd2e('0x1'));var moment=require(_0xdd2e('0x2'));var BPromise=require(_0xdd2e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdd2e('0x4'));var rimraf=require(_0xdd2e('0x5'));var config=require(_0xdd2e('0x6'));var attributes=require(_0xdd2e('0x7'));module['exports']=function(_0x37630e,_0x42016f){return _0x37630e['define'](_0xdd2e('0x8'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xdd2e('0x9')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 9d97660..a24d410 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 _0x257b=['../../config/utils','../../config/logger','rpc','client','http','info','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxApplication,\x20%s,\x20%s','message','result','catch','update','body','options','raw','attributes','limit','then','UpdateFaxApplication','moment','bluebird','randomstring','ioredis'];(function(_0x59625f,_0x3b2c76){var _0x498e1e=function(_0x85bb84){while(--_0x85bb84){_0x59625f['push'](_0x59625f['shift']());}};_0x498e1e(++_0x3b2c76);}(_0x257b,0xf8));var _0xb257=function(_0x4989d0,_0x46492b){_0x4989d0=_0x4989d0-0x0;var _0x2dddfa=_0x257b[_0x4989d0];return _0x2dddfa;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb257('0x0'));var BPromise=require(_0xb257('0x1'));var rs=require(_0xb257('0x2'));var fs=require('fs');var Redis=require(_0xb257('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb257('0x4'));var logger=require(_0xb257('0x5'))(_0xb257('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb257('0x7')][_0xb257('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x7496e3,_0x11b048,_0x533fe5){return new BPromise(function(_0x196f9a,_0x29b2fc){return client['request'](_0x7496e3,_0x533fe5)['then'](function(_0x1211a4){logger[_0xb257('0x9')]('FaxApplication,\x20%s,\x20%s',_0x11b048,_0xb257('0xa'));logger[_0xb257('0xb')](_0xb257('0xc'),_0x11b048,_0xb257('0xa'),JSON[_0xb257('0xd')](_0x1211a4));if(_0x1211a4[_0xb257('0xe')]){if(_0x1211a4['error'][_0xb257('0xf')]===0x1f4){logger[_0xb257('0xe')](_0xb257('0x10'),_0x11b048,_0x1211a4['error']['message']);return _0x29b2fc(_0x1211a4[_0xb257('0xe')][_0xb257('0x11')]);}logger['error'](_0xb257('0x10'),_0x11b048,_0x1211a4['error'][_0xb257('0x11')]);return _0x196f9a(_0x1211a4[_0xb257('0xe')][_0xb257('0x11')]);}else{logger[_0xb257('0x9')](_0xb257('0x10'),_0x11b048,'request\x20sent');_0x196f9a(_0x1211a4[_0xb257('0x12')][_0xb257('0x11')]);}})[_0xb257('0x13')](function(_0x489433){logger['error']('FaxApplication,\x20%s,\x20%s',_0x11b048,_0x489433);_0x29b2fc(_0x489433);});});}exports['UpdateFaxApplication']=function(_0xfae58d){var _0x23a030=this;return new Promise(function(_0x4a3b0c,_0x128dab){return db['FaxApplication'][_0xb257('0x14')](_0xfae58d[_0xb257('0x15')],{'raw':_0xfae58d['options']?_0xfae58d[_0xb257('0x16')][_0xb257('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xfae58d[_0xb257('0x16')]?_0xfae58d['options']['where']||null:null,'attributes':_0xfae58d[_0xb257('0x16')]?_0xfae58d[_0xb257('0x16')][_0xb257('0x18')]||null:null,'limit':_0xfae58d[_0xb257('0x16')]?_0xfae58d[_0xb257('0x16')][_0xb257('0x19')]||null:null})[_0xb257('0x1a')](function(_0x4025d3){logger[_0xb257('0x9')](_0xb257('0x1b'),_0xfae58d);logger[_0xb257('0xb')](_0xb257('0x1b'),_0xfae58d,JSON[_0xb257('0xd')](_0x4025d3));_0x4a3b0c(_0x4025d3);})[_0xb257('0x13')](function(_0x5299ec){logger[_0xb257('0xe')](_0xb257('0x1b'),_0x5299ec['message'],_0xfae58d);_0x128dab(_0x23a030[_0xb257('0xe')](0x1f4,_0x5299ec['message']));});});}; \ No newline at end of file +var _0x7442=['body','options','raw','where','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','error','message','UpdateFaxApplication'];(function(_0x2758cc,_0x1a798f){var _0x31f219=function(_0x262c8e){while(--_0x262c8e){_0x2758cc['push'](_0x2758cc['shift']());}};_0x31f219(++_0x1a798f);}(_0x7442,0x1a4));var _0x2744=function(_0x26aa07,_0x55175f){_0x26aa07=_0x26aa07-0x0;var _0x3683e9=_0x7442[_0x26aa07];return _0x3683e9;};'use strict';var _=require('lodash');var util=require(_0x2744('0x0'));var moment=require(_0x2744('0x1'));var BPromise=require(_0x2744('0x2'));var rs=require(_0x2744('0x3'));var fs=require('fs');var Redis=require(_0x2744('0x4'));var db=require(_0x2744('0x5'))['db'];var utils=require(_0x2744('0x6'));var logger=require(_0x2744('0x7'))(_0x2744('0x8'));var config=require(_0x2744('0x9'));var jayson=require(_0x2744('0xa'));var client=jayson['client'][_0x2744('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x39a1d1,_0x5f254d,_0x3cf6bb){return new BPromise(function(_0x272ff5,_0x3213e5){return client[_0x2744('0xc')](_0x39a1d1,_0x3cf6bb)[_0x2744('0xd')](function(_0x36410d){logger[_0x2744('0xe')](_0x2744('0xf'),_0x5f254d,_0x2744('0x10'));logger[_0x2744('0x11')](_0x2744('0x12'),_0x5f254d,_0x2744('0x10'),JSON['stringify'](_0x36410d));if(_0x36410d[_0x2744('0x13')]){if(_0x36410d[_0x2744('0x13')]['code']===0x1f4){logger[_0x2744('0x13')](_0x2744('0xf'),_0x5f254d,_0x36410d[_0x2744('0x13')][_0x2744('0x14')]);return _0x3213e5(_0x36410d[_0x2744('0x13')][_0x2744('0x14')]);}logger['error'](_0x2744('0xf'),_0x5f254d,_0x36410d['error'][_0x2744('0x14')]);return _0x272ff5(_0x36410d['error'][_0x2744('0x14')]);}else{logger[_0x2744('0xe')](_0x2744('0xf'),_0x5f254d,'request\x20sent');_0x272ff5(_0x36410d['result'][_0x2744('0x14')]);}})['catch'](function(_0x5ce266){logger[_0x2744('0x13')](_0x2744('0xf'),_0x5f254d,_0x5ce266);_0x3213e5(_0x5ce266);});});}exports[_0x2744('0x15')]=function(_0x131699){var _0x2b049d=this;return new Promise(function(_0x5923b0,_0x3ddcc1){return db['FaxApplication']['update'](_0x131699[_0x2744('0x16')],{'raw':_0x131699[_0x2744('0x17')]?_0x131699[_0x2744('0x17')][_0x2744('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x131699[_0x2744('0x17')]?_0x131699[_0x2744('0x17')][_0x2744('0x19')]||null:null,'attributes':_0x131699[_0x2744('0x17')]?_0x131699['options']['attributes']||null:null,'limit':_0x131699[_0x2744('0x17')]?_0x131699[_0x2744('0x17')]['limit']||null:null})[_0x2744('0xd')](function(_0x5c3ccf){logger[_0x2744('0xe')](_0x2744('0x15'),_0x131699);logger[_0x2744('0x11')](_0x2744('0x15'),_0x131699,JSON['stringify'](_0x5c3ccf));_0x5923b0(_0x5c3ccf);})['catch'](function(_0x522080){logger[_0x2744('0x13')](_0x2744('0x15'),_0x522080['message'],_0x131699);_0x3ddcc1(_0x2b049d[_0x2744('0x13')](0x1f4,_0x522080['message']));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 957172c..8819c62 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 _0xefda=['post','create','update','delete','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','index','/:id','isAuthenticated'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xefda,0x96));var _0xaefd=function(_0x4566a8,_0x1302ed){_0x4566a8=_0x4566a8-0x0;var _0x343e02=_0xefda[_0x4566a8];return _0x343e02;};'use strict';var multer=require(_0xaefd('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xaefd('0x1'));var express=require(_0xaefd('0x2'));var router=express['Router']();var fs_extra=require(_0xaefd('0x3'));var auth=require(_0xaefd('0x4'));var interaction=require(_0xaefd('0x5'));var config=require(_0xaefd('0x6'));var controller=require(_0xaefd('0x7'));router[_0xaefd('0x8')]('/',auth['isAuthenticated'](),controller[_0xaefd('0x9')]);router[_0xaefd('0x8')](_0xaefd('0xa'),auth[_0xaefd('0xb')](),controller['show']);router[_0xaefd('0xc')]('/',auth[_0xaefd('0xb')](),controller[_0xaefd('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xaefd('0xe')]);router[_0xaefd('0xf')](_0xaefd('0xa'),auth[_0xaefd('0xb')](),controller[_0xaefd('0x10')]);module[_0xaefd('0x11')]=router; \ No newline at end of file +var _0xdd4f=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','create','put','delete','destroy','exports','multer','express'];(function(_0x569b16,_0xee32e0){var _0x97e84b=function(_0x2c9d9e){while(--_0x2c9d9e){_0x569b16['push'](_0x569b16['shift']());}};_0x97e84b(++_0xee32e0);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0xd1d5bd,_0x19031d){_0xd1d5bd=_0xd1d5bd-0x0;var _0x1b864f=_0xdd4f[_0xd1d5bd];return _0x1b864f;};'use strict';var multer=require(_0xfdd4('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xfdd4('0x1'));var router=express[_0xfdd4('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xfdd4('0x3'));var interaction=require(_0xfdd4('0x4'));var config=require(_0xfdd4('0x5'));var controller=require('./faxApplication.controller');router[_0xfdd4('0x6')]('/',auth[_0xfdd4('0x7')](),controller[_0xfdd4('0x8')]);router[_0xfdd4('0x6')](_0xfdd4('0x9'),auth['isAuthenticated'](),controller[_0xfdd4('0xa')]);router['post']('/',auth[_0xfdd4('0x7')](),controller[_0xfdd4('0xb')]);router[_0xfdd4('0xc')]('/:id',auth[_0xfdd4('0x7')](),controller['update']);router[_0xfdd4('0xd')](_0xfdd4('0x9'),auth[_0xfdd4('0x7')](),controller[_0xfdd4('0xe')]);module[_0xfdd4('0xf')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 62556ad..944d567 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 _0x26c9=['out','sequelize','BOOLEAN','DATE','STRING','ENUM'];(function(_0x370b3f,_0x48437a){var _0x2031c4=function(_0x136c2e){while(--_0x136c2e){_0x370b3f['push'](_0x370b3f['shift']());}};_0x2031c4(++_0x48437a);}(_0x26c9,0x199));var _0x926c=function(_0x1e0f48,_0x50829e){_0x1e0f48=_0x1e0f48-0x0;var _0x5dd59e=_0x26c9[_0x1e0f48];return _0x5dd59e;};'use strict';var Sequelize=require(_0x926c('0x0'));module['exports']={'closed':{'type':Sequelize[_0x926c('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x926c('0x2')]},'disposition':{'type':Sequelize[_0x926c('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x926c('0x3')]},'note':{'type':Sequelize[_0x926c('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0x926c('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x926c('0x4')]('in',_0x926c('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x926c('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x926c('0x4')]('in',_0x926c('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x4892=['ENUM','out','sequelize','exports','DATE','STRING'];(function(_0x49478c,_0x354b6b){var _0x47fff5=function(_0x3a2097){while(--_0x3a2097){_0x49478c['push'](_0x49478c['shift']());}};_0x47fff5(++_0x354b6b);}(_0x4892,0x1ee));var _0x2489=function(_0x3de8a4,_0x289a5c){_0x3de8a4=_0x3de8a4-0x0;var _0x4635cf=_0x4892[_0x3de8a4];return _0x4635cf;};'use strict';var Sequelize=require(_0x2489('0x0'));module[_0x2489('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x2489('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x2489('0x3')]},'note':{'type':Sequelize[_0x2489('0x3')]},'read1stAt':{'type':Sequelize[_0x2489('0x2')]},'fax':{'type':Sequelize[_0x2489('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x2489('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x2489('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x2489('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index 29cf1c7..2ae9df4 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 _0xf4e2=['defaults','socket.io-emitter','./faxInteraction.socket','register','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','error','name','send','Users','map','TagIds','Tags','split','forEach','catch','talking','answered','total','closed','UserId','waiting','unmanaged','index','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','user_has_fax_interactions','users','u.id\x20=\x20ui.UserId','fax_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','start','some','compact','FaxAccountId','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','contactName','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','agent','user','getFaxAccounts','isEmpty','i.FaxAccountId\x20IS\x20NULL','i.FaxAccountId\x20IN\x20?','role','sequelize','toString','keyBy','merge','FaxInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','groupBy','FaxInteractionId','push','all','rows','params','includeAll','include','options','create','body','destroy','describe','addMessage','ids','omit','getMessages','findOne','FaxMessage','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','emit','faxInteractionTags:save','removeTags','download','unix','root','server','tmp','join','attachments','transcript-%d-%s.zip','Attachment','Messages','mkdirSync','pipe','basename','log','err','unlinkSync','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis'];(function(_0x33d98e,_0x5b154d){var _0xb296=function(_0x125496){while(--_0x125496){_0x33d98e['push'](_0x33d98e['shift']());}};_0xb296(++_0x5b154d);}(_0xf4e2,0x1a7));var _0x2f4e=function(_0x3ee55a,_0x19aeea){_0x3ee55a=_0x3ee55a-0x0;var _0x581800=_0xf4e2[_0x3ee55a];return _0x581800;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2f4e('0x0'));var rp=require(_0x2f4e('0x1'));var moment=require(_0x2f4e('0x2'));var BPromise=require(_0x2f4e('0x3'));var Mustache=require(_0x2f4e('0x4'));var util=require(_0x2f4e('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x2f4e('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2f4e('0x7'));var _=require('lodash');var squel=require(_0x2f4e('0x8'));var crypto=require(_0x2f4e('0x9'));var jsforce=require(_0x2f4e('0xa'));var deskjs=require(_0x2f4e('0xb'));var toCsv=require(_0x2f4e('0x6'));var querystring=require(_0x2f4e('0xc'));var Papa=require(_0x2f4e('0xd'));var Redis=require('ioredis');var authService=require(_0x2f4e('0xe'));var qs=require(_0x2f4e('0xf'));var as=require(_0x2f4e('0x10'));var hardwareService=require(_0x2f4e('0x11'));var logger=require(_0x2f4e('0x12'))(_0x2f4e('0x13'));var utils=require(_0x2f4e('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x2f4e('0x15'));var db=require('../../mysqldb')['db'];config[_0x2f4e('0x16')]=_[_0x2f4e('0x17')](config[_0x2f4e('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x2f4e('0x18'))(new Redis(config['redis']));require(_0x2f4e('0x19'))[_0x2f4e('0x1a')](socket);function respondWithStatusCode(_0x57890e,_0x5bb13a){_0x5bb13a=_0x5bb13a||0xcc;return function(_0x52e25b){if(_0x52e25b){return _0x57890e[_0x2f4e('0x1b')](_0x5bb13a);}return _0x57890e['status'](_0x5bb13a)[_0x2f4e('0x1c')]();};}function respondWithResult(_0x54770c,_0x439715){_0x439715=_0x439715||0xc8;return function(_0x125b99){if(_0x125b99){return _0x54770c[_0x2f4e('0x1d')](_0x439715)[_0x2f4e('0x1e')](_0x125b99);}};}function respondWithFilteredResult(_0x47a4ca,_0x127d19){return function(_0xf99bb7){if(_0xf99bb7){var _0x185ed5=typeof _0x127d19[_0x2f4e('0x1f')]==='undefined'&&typeof _0x127d19[_0x2f4e('0x20')]===_0x2f4e('0x21');var _0x447d0a=_0xf99bb7[_0x2f4e('0x22')];var _0x34a53c=_0x185ed5?0x0:_0x127d19[_0x2f4e('0x1f')];var _0x51d3ad=_0x185ed5?_0xf99bb7[_0x2f4e('0x22')]:_0x127d19['offset']+_0x127d19[_0x2f4e('0x20')];var _0x12a7d5;if(_0x51d3ad>=_0x447d0a){_0x51d3ad=_0x447d0a;_0x12a7d5=0xc8;}else{_0x12a7d5=0xce;}_0x47a4ca['status'](_0x12a7d5);return _0x47a4ca[_0x2f4e('0x23')](_0x2f4e('0x24'),_0x34a53c+'-'+_0x51d3ad+'/'+_0x447d0a)[_0x2f4e('0x1e')](_0xf99bb7);}return null;};}function patchUpdates(_0x27ceeb){return function(_0x5bd77f){try{jsonpatch['apply'](_0x5bd77f,_0x27ceeb,!![]);}catch(_0x8647cb){return BPromise[_0x2f4e('0x25')](_0x8647cb);}return _0x5bd77f[_0x2f4e('0x26')]();};}function saveUpdates(_0x64adc2,_0x337d65){return function(_0x3c2435){if(_0x3c2435){return _0x3c2435[_0x2f4e('0x27')](_0x64adc2)[_0x2f4e('0x28')](function(_0x320dc2){return _0x320dc2;});}return null;};}function removeEntity(_0x22baa0,_0x72f43e){return function(_0x48e0dc){if(_0x48e0dc){return _0x48e0dc['destroy']()['then'](function(){_0x22baa0[_0x2f4e('0x1d')](0xcc)[_0x2f4e('0x1c')]();});}};}function handleEntityNotFound(_0x537594,_0x302b49){return function(_0x2e2534){if(!_0x2e2534){_0x537594['sendStatus'](0x194);}return _0x2e2534;};}function handleError(_0x229ca7,_0x33a5b9){_0x33a5b9=_0x33a5b9||0x1f4;return function(_0x4f2b3f){logger[_0x2f4e('0x29')](_0x4f2b3f['stack']);if(_0x4f2b3f[_0x2f4e('0x2a')]){delete _0x4f2b3f[_0x2f4e('0x2a')];}_0x229ca7['status'](_0x33a5b9)[_0x2f4e('0x2b')](_0x4f2b3f);};}function getInteractionUsers(_0xc968d7,_0x8eae34){return new BPromise(function(_0x3319ac,_0x907501){try{if(_0x8eae34[_0xc968d7['id']]){_0xc968d7[_0x2f4e('0x2c')]=_[_0x2f4e('0x2d')](_0x8eae34[_0xc968d7['id']],function(_0x26d80f){return{'id':_0x26d80f['id'],'fullname':_0x26d80f['fullname']};});}}catch(_0x1ec960){_0x907501(_0x1ec960);}_0x3319ac(_0xc968d7);});}function getInteractionTags(_0x58f1db,_0x2fe52e){return new BPromise(function(_0x374352,_0x23106c){try{if(_0x58f1db[_0x2f4e('0x2e')]){_0x58f1db[_0x2f4e('0x2f')]=[];_0x58f1db[_0x2f4e('0x2e')][_0x2f4e('0x30')](',')[_0x2f4e('0x31')](function(_0x427f5a){_0x58f1db[_0x2f4e('0x2f')]['push'](_0x2fe52e[_0x427f5a]);});}delete _0x58f1db[_0x2f4e('0x2e')];}catch(_0x5532c5){_0x23106c(_0x5532c5);}_0x374352(_0x58f1db);});}function updateFaxInteraction(_0x5d2787,_0x5d3542,_0x49a96c){return new BPromise(function(_0x33e096,_0x2cab82){return getInteractionUsers(_0x5d2787,_0x49a96c)[_0x2f4e('0x28')](function(_0x55dbaa){return getInteractionTags(_0x55dbaa,_0x5d3542);})[_0x2f4e('0x28')](function(_0x2a2a2c){return getStateInteraction(_0x2a2a2c);})['then'](function(_0x7956f3){_0x33e096(_0x7956f3);})[_0x2f4e('0x32')](function(_0x507227){_0x2cab82(_0x507227);});});}function getStateInteraction(_0x44ed71){return new BPromise(function(_0xbd1b44){_0x44ed71['waiting']=0x0;_0x44ed71[_0x2f4e('0x33')]=0x0;_0x44ed71[_0x2f4e('0x34')]=0x0;_0x44ed71['unmanaged']=0x0;_0x44ed71[_0x2f4e('0x35')]=0x0;if(!_0x44ed71[_0x2f4e('0x36')]&&!_0x44ed71[_0x2f4e('0x37')]){_0x44ed71[_0x2f4e('0x38')]+=0x1;}if(!_0x44ed71['closed']&&_0x44ed71[_0x2f4e('0x37')]){_0x44ed71['talking']+=0x1;if(_0x44ed71['waiting']){_0x44ed71[_0x2f4e('0x38')]-=0x1;}}if(_0x44ed71[_0x2f4e('0x36')]&&_0x44ed71['UserId']){_0x44ed71[_0x2f4e('0x34')]+=0x1;if(_0x44ed71[_0x2f4e('0x33')]){_0x44ed71['talking']-=0x1;}}if(_0x44ed71[_0x2f4e('0x36')]&&!_0x44ed71['UserId']){_0x44ed71[_0x2f4e('0x39')]+=0x1;if(_0x44ed71['waiting']){_0x44ed71[_0x2f4e('0x38')]-=0x1;}}_0x44ed71[_0x2f4e('0x35')]+=0x1;_0xbd1b44(_0x44ed71);});}exports[_0x2f4e('0x3a')]=function(_0x28228d,_0x1ba3ba){var _0x22bf20={},_0x15f692={},_0x4ef109={'count':0x0,'rows':[]};var _0x41fb6d=_[_0x2f4e('0x2d')](db['FaxInteraction'][_0x2f4e('0x3b')],function(_0x1a0c54){return{'name':_0x1a0c54['fieldName'],'type':_0x1a0c54['type'][_0x2f4e('0x3c')]};});_0x15f692[_0x2f4e('0x3d')]=_['map'](_0x41fb6d,'name');_0x15f692[_0x2f4e('0x3e')]=_[_0x2f4e('0x3f')](_0x28228d[_0x2f4e('0x3e')]);_0x15f692[_0x2f4e('0x40')]=_[_0x2f4e('0x41')](_0x15f692[_0x2f4e('0x3d')],_0x15f692['query']);_0x22bf20[_0x2f4e('0x42')]=_['intersection'](_0x15f692[_0x2f4e('0x3d')],qs[_0x2f4e('0x43')](_0x28228d[_0x2f4e('0x3e')][_0x2f4e('0x43')]));_0x22bf20[_0x2f4e('0x42')]=_0x22bf20[_0x2f4e('0x42')][_0x2f4e('0x44')]?_0x22bf20[_0x2f4e('0x42')]:_0x15f692[_0x2f4e('0x3d')];if(!_0x28228d[_0x2f4e('0x3e')][_0x2f4e('0x45')](_0x2f4e('0x46'))){_0x22bf20[_0x2f4e('0x20')]=qs[_0x2f4e('0x20')](_0x28228d[_0x2f4e('0x3e')]['limit']);_0x22bf20[_0x2f4e('0x1f')]=qs[_0x2f4e('0x1f')](_0x28228d['query'][_0x2f4e('0x1f')]);}_0x22bf20[_0x2f4e('0x47')]=qs[_0x2f4e('0x48')](_0x28228d[_0x2f4e('0x3e')][_0x2f4e('0x48')]);_0x22bf20[_0x2f4e('0x49')]=qs[_0x2f4e('0x40')](_[_0x2f4e('0x4a')](_0x28228d[_0x2f4e('0x3e')],_0x15f692['filters']),_0x41fb6d);var _0x45697d=[];var _0x2084f5=squel[_0x2f4e('0x4b')]()[_0x2f4e('0x4c')]('id')[_0x2f4e('0x4c')]('name')[_0x2f4e('0x4c')](_0x2f4e('0x4d'))[_0x2f4e('0x4e')](_0x2f4e('0x4f'));var _0x16b017=squel['select']()[_0x2f4e('0x4c')]('u.id')[_0x2f4e('0x4c')]('u.fullname')[_0x2f4e('0x4c')]('ui.FaxInteractionId')[_0x2f4e('0x4e')](_0x2f4e('0x50'),'ui')['left_join'](_0x2f4e('0x51'),'u',_0x2f4e('0x52'));var _0x859cf0=squel[_0x2f4e('0x4b')]()[_0x2f4e('0x4e')](_0x2f4e('0x53'),'i')[_0x2f4e('0x54')](_0x2f4e('0x55'),'c',_0x2f4e('0x56'))[_0x2f4e('0x54')](_0x2f4e('0x51'),'o',_0x2f4e('0x57'))[_0x2f4e('0x54')](_0x2f4e('0x58'),'a',_0x2f4e('0x59'))[_0x2f4e('0x54')](_0x2f4e('0x5a'),'me',_0x2f4e('0x5b'))[_0x2f4e('0x54')](_0x2f4e('0x5c'),'it',_0x2f4e('0x5d'))[_0x2f4e('0x54')](_0x2f4e('0x4f'),'t','t.id\x20=\x20it.TagId');var _0x2e2bc6=squel[_0x2f4e('0x5e')]();var _0x5a32e9=[];var _0x41fd11=squel['expr']();var _0x43bb07;if(_0x28228d['query'][_0x2f4e('0x5f')]){_0x43bb07=as[_0x2f4e('0x60')](_0x28228d[_0x2f4e('0x3e')][_0x2f4e('0x5f')]);var _0x1f3d64=_0x43bb07[_0x2f4e('0x61')];for(var _0x5488fc=0x0;_0x5488fc<_0x43bb07[_0x2f4e('0x62')][_0x2f4e('0x44')];_0x5488fc++){var _0x324e1a=_0x43bb07[_0x2f4e('0x62')][_0x5488fc];var _0x13004a='i';var _0x4465e6=_[_0x2f4e('0x63')](_0x41fb6d,[_0x2f4e('0x2a'),_0x324e1a[_0x2f4e('0x4c')]]);if(!_0x4465e6){switch(_0x324e1a[_0x2f4e('0x4c')]){case _0x2f4e('0x64'):if(_0x324e1a['value']==0x1){_0x859cf0[_0x2f4e('0x65')]('`'+_0x324e1a['field']+_0x2f4e('0x66'));}else{_0x859cf0['having']('`'+_0x324e1a[_0x2f4e('0x4c')]+_0x2f4e('0x67'));}break;case _0x2f4e('0x68'):if(_0x324e1a[_0x2f4e('0x69')]===_0x2f4e('0x6a')){if(_0x324e1a[_0x2f4e('0x6b')][_0x2f4e('0x30')]('\x20')[_0x2f4e('0x44')]>0x1){_0x2e2bc6[_0x1f3d64](_0x2f4e('0x6c'),qs[_0x2f4e('0x6d')](_0x324e1a[_0x2f4e('0x6b')]),null);}else{var _0xa930e9='%'+_0x324e1a[_0x2f4e('0x6b')]+'%';_0x2e2bc6[_0x1f3d64](_0x2f4e('0x6e'),_0xa930e9,_0xa930e9,_0xa930e9);}}else{_0x4465e6=_[_0x2f4e('0x63')](_0x41fb6d,['name',_0x2f4e('0x6f')]);_0x324e1a[_0x2f4e('0x4c')]='ContactId';_0xd17be6=as[_0x2f4e('0x70')](_0x13004a,_0x4465e6[_0x2f4e('0x71')],_0x324e1a);_0x2e2bc6[_0x1f3d64](_0xd17be6[_0x2f4e('0x72')],_0xd17be6['value']['start'],_0xd17be6[_0x2f4e('0x6b')][_0x2f4e('0x1c')]);}break;case _0x2f4e('0x73'):var _0x4deb48=_0x324e1a[_0x2f4e('0x6b')][_0x2f4e('0x30')](',')[_0x2f4e('0x2d')](function(_0x405660){return Number(_0x405660);});_0x4deb48[_0x2f4e('0x31')](function(_0x338fb5){_0x41fd11['or'](_0x2f4e('0x74'),'%,'+_0x338fb5+',%');});_0x5a32e9=_['union'](_0x5a32e9,_0x4deb48);break;case _0x2f4e('0x75'):if(_0x324e1a[_0x2f4e('0x69')]===_0x2f4e('0x6a')){_0x2e2bc6[_0x1f3d64](_0x2f4e('0x76'),'%'+_0x324e1a[_0x2f4e('0x6b')]+'%',null);}else{_0x4465e6=_[_0x2f4e('0x63')](_0x41fb6d,[_0x2f4e('0x2a'),_0x2f4e('0x37')]);_0x324e1a[_0x2f4e('0x4c')]=_0x2f4e('0x37');_0xd17be6=as[_0x2f4e('0x70')](_0x13004a,_0x4465e6[_0x2f4e('0x71')],_0x324e1a);_0x2e2bc6[_0x1f3d64](_0xd17be6[_0x2f4e('0x72')],_0xd17be6[_0x2f4e('0x6b')][_0x2f4e('0x77')],_0xd17be6[_0x2f4e('0x6b')][_0x2f4e('0x1c')]);}break;case'body':_0xd17be6=as['buildExpression']('me',null,_0x324e1a);_0x2e2bc6[_0x1f3d64](_0xd17be6[_0x2f4e('0x72')],_0xd17be6[_0x2f4e('0x6b')][_0x2f4e('0x77')],_0xd17be6[_0x2f4e('0x6b')]['end']);break;}}else{var _0xd17be6=as['buildExpression'](_0x13004a,_0x4465e6[_0x2f4e('0x71')],_0x324e1a);_0x2e2bc6[_0x1f3d64](_0xd17be6[_0x2f4e('0x72')],_0xd17be6[_0x2f4e('0x6b')][_0x2f4e('0x77')],_0xd17be6[_0x2f4e('0x6b')][_0x2f4e('0x1c')]);}}}else{var _0x549e8b=_(_0x28228d[_0x2f4e('0x3e')])[_0x2f4e('0x3f')]()['map'](function(_0x5a13a4){return _[_0x2f4e('0x78')](_0x41fb6d,[_0x2f4e('0x2a'),_0x5a13a4])?_0x5a13a4:undefined;})[_0x2f4e('0x79')]()['value']();if(!_['isEmpty'](_0x549e8b)){_0x549e8b[_0x2f4e('0x31')](function(_0x25d482){if(_0x25d482===_0x2f4e('0x7a')){_0x859cf0[_0x2f4e('0x49')]('i.FaxAccountId\x20IN\x20?',[]['concat'](_0x28228d[_0x2f4e('0x3e')][_0x25d482]));}else if(_0x25d482===_0x2f4e('0x7b')){var _0x53fabd=JSON[_0x2f4e('0x7c')](_0x28228d[_0x2f4e('0x3e')][_0x25d482])[_0x2f4e('0x7d')];var _0x2e2d50=JSON[_0x2f4e('0x7c')](_0x28228d[_0x2f4e('0x3e')][_0x25d482])[_0x2f4e('0x7e')];_0x859cf0[_0x2f4e('0x49')](_0x2f4e('0x7f'),_0x53fabd,_0x2e2d50);}else{if(_0x28228d['query'][_0x25d482]===_0x2f4e('0x80')){_0x859cf0[_0x2f4e('0x49')]('i.'+_0x25d482+'\x20IS\x20NULL');}else{_0x859cf0[_0x2f4e('0x49')]('i.'+_0x25d482+_0x2f4e('0x81'),_0x28228d['query'][_0x25d482]);}}});}if(_0x28228d[_0x2f4e('0x3e')][_0x2f4e('0x82')]){if(_0x28228d['query'][_0x2f4e('0x82')]==0x1){_0x859cf0['having']('`unreadMessages`\x20=\x200');}else{_0x859cf0[_0x2f4e('0x65')]('`unreadMessages`\x20>\x200');}}if(_0x28228d[_0x2f4e('0x3e')][_0x2f4e('0x83')]){_0x5a32e9=_[_0x2f4e('0x84')](_0x28228d['query']['tag'])?_0x28228d[_0x2f4e('0x3e')][_0x2f4e('0x83')]:new Array(_0x28228d[_0x2f4e('0x3e')][_0x2f4e('0x83')]);_0x5a32e9[_0x2f4e('0x31')](function(_0x28b3c0){_0x41fd11['or'](_0x2f4e('0x74'),'%,'+_0x28b3c0+',%');});}if(_0x28228d[_0x2f4e('0x3e')][_0x2f4e('0x85')]){var _0x29035c=_0x28228d['query'][_0x2f4e('0x85')][_0x2f4e('0x86')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x2f4e('0x87')](_0x29035c)){_0x2e2bc6['or'](_0x2f4e('0x88'),_0x29035c+'%')['or'](_0x2f4e('0x89'),_0x29035c+'%');}_0x2e2bc6['or'](_0x2f4e('0x8a'),_0x29035c+'%');}}_0x859cf0[_0x2f4e('0x49')](_0x2e2bc6);_0x859cf0[_0x2f4e('0x8b')](_0x2f4e('0x8c'));var _0x33daaf={'type':db[_0x2f4e('0x8d')][_0x2f4e('0x8e')][_0x2f4e('0x8f')],'raw':!![]};var _0x4c125a=_0x859cf0[_0x2f4e('0x90')]();_0x4c125a[_0x2f4e('0x4c')](_0x2f4e('0x8c'));_0x4c125a[_0x2f4e('0x4c')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x2f4e('0x64'));if(_0x22bf20[_0x2f4e('0x47')]){_0x22bf20[_0x2f4e('0x47')]['forEach'](function(_0x75dd68){var _0x25ff87=_0x75dd68[0x0]===_0x2f4e('0x91')?_0x75dd68[0x0]:'i.'+_0x75dd68[0x0];_0x859cf0[_0x2f4e('0x47')](_0x25ff87,_0x75dd68[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x5a32e9)){_0x859cf0[_0x2f4e('0x65')](_0x41fd11);_0x4c125a[_0x2f4e('0x49')](_0x2f4e('0x92'),_0x5a32e9);}BPromise[_0x2f4e('0x93')]()[_0x2f4e('0x28')](function(){if(!_0x43bb07){if(_0x28228d[_0x2f4e('0x3e')]['FaxAccountId'])return;_0x4c125a['where'](_0x2f4e('0x94'));_0x859cf0['where'](_0x2f4e('0x94'));return;}if(_0x28228d['user']['role']!==_0x2f4e('0x95'))return;return _0x28228d[_0x2f4e('0x96')][_0x2f4e('0x97')]({'attributes':['id'],'raw':!![]})['then'](function(_0x3a342d){if(_[_0x2f4e('0x98')](_0x3a342d)){_0x4c125a[_0x2f4e('0x49')](_0x2f4e('0x99'));_0x859cf0['where']('i.FaxAccountId\x20IS\x20NULL');}else{_0x4c125a['where']('i.FaxAccountId\x20IN\x20?',_['map'](_0x3a342d,'id'));_0x859cf0[_0x2f4e('0x49')](_0x2f4e('0x9a'),_[_0x2f4e('0x2d')](_0x3a342d,'id'));}});})[_0x2f4e('0x28')](function(){if(_0x28228d[_0x2f4e('0x96')][_0x2f4e('0x9b')]===_0x2f4e('0x95')&&!_0x43bb07&&!_0x28228d[_0x2f4e('0x3e')][_0x2f4e('0x7a')])return[];return db[_0x2f4e('0x9c')][_0x2f4e('0x3e')](_0x4c125a['toString'](),_0x33daaf);})[_0x2f4e('0x28')](function(_0x5e453e){_0x4ef109[_0x2f4e('0x22')]=_0x5e453e['length'];if(_0x4ef109[_0x2f4e('0x22')]===0x0)return[];return db[_0x2f4e('0x9c')][_0x2f4e('0x3e')](_0x2084f5[_0x2f4e('0x9d')](),_0x33daaf)['then'](function(_0xf44d62){_0x45697d=_[_0x2f4e('0x9e')](_0xf44d62,'id');_0x33daaf=_[_0x2f4e('0x9f')](_0x33daaf,{'model':db[_0x2f4e('0xa0')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x28228d[_0x2f4e('0x3e')][_0x2f4e('0x43')]){_0x22bf20[_0x2f4e('0x42')][_0x2f4e('0x31')](function(_0x9f102a){_0x859cf0[_0x2f4e('0x4c')]('i.'+_0x9f102a);});}else{_0x859cf0[_0x2f4e('0x4c')](_0x2f4e('0xa1'),_0x2f4e('0x64'));_0x859cf0[_0x2f4e('0x4c')]('a.key',_0x2f4e('0xa2'));_0x859cf0['field'](_0x2f4e('0xa3'),_0x2f4e('0xa4'));_0x859cf0['field'](_0x2f4e('0xa5'),_0x2f4e('0x91'));_0x859cf0[_0x2f4e('0x4c')](_0x2f4e('0xa6'));_0x859cf0[_0x2f4e('0x4c')]('c.firstName',_0x2f4e('0xa7'));_0x859cf0['field'](_0x2f4e('0xa8'),_0x2f4e('0xa9'));_0x859cf0[_0x2f4e('0x4c')](_0x2f4e('0xaa'),_0x2f4e('0xab'));_0x859cf0[_0x2f4e('0x4c')]('c.phone','Contact.phone');_0x859cf0[_0x2f4e('0x4c')](_0x2f4e('0xac'),_0x2f4e('0xad'));_0x859cf0[_0x2f4e('0x4c')](_0x2f4e('0xae'),_0x2f4e('0xaf'));_0x859cf0['field'](_0x2f4e('0xb0'),_0x2f4e('0xb1'));_0x859cf0[_0x2f4e('0x4c')](_0x2f4e('0xb2'),'Owner.internal');_0x859cf0[_0x2f4e('0x4c')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x22bf20[_0x2f4e('0x20')])_0x859cf0[_0x2f4e('0x20')](_0x22bf20[_0x2f4e('0x20')]);if(_0x22bf20[_0x2f4e('0x1f')])_0x859cf0[_0x2f4e('0x1f')](_0x22bf20[_0x2f4e('0x1f')]);return db[_0x2f4e('0x9c')]['query'](_0x859cf0[_0x2f4e('0x9d')](),_0x33daaf);})['then'](function(_0x532798){if(_0x532798[_0x2f4e('0x44')]>0x0)_0x16b017[_0x2f4e('0x49')]('ui.FaxInteractionId\x20IN\x20?',_[_0x2f4e('0x2d')](_0x532798,'id'));return db[_0x2f4e('0x9c')][_0x2f4e('0x3e')](_0x16b017[_0x2f4e('0x9d')](),_0x33daaf)[_0x2f4e('0x28')](function(_0x357723){var _0x171d20=_[_0x2f4e('0xb3')](_0x357723,_0x2f4e('0xb4'));var _0xc965d2=[];_0x532798[_0x2f4e('0x31')](function(_0x325c82){_0xc965d2[_0x2f4e('0xb5')](updateFaxInteraction(_0x325c82,_0x45697d,_0x171d20));});return BPromise[_0x2f4e('0xb6')](_0xc965d2);});});})[_0x2f4e('0x28')](function(_0x2f019b){_0x4ef109[_0x2f4e('0xb7')]=_0x2f019b;return _0x4ef109;})['then'](respondWithFilteredResult(_0x1ba3ba,_0x22bf20))[_0x2f4e('0x32')](handleError(_0x1ba3ba,null));};exports['show']=function(_0x15b8fa,_0x28e41b){var _0x791b0f={'raw':![],'where':{'id':_0x15b8fa[_0x2f4e('0xb8')]['id']}},_0x5ccc8d={};_0x5ccc8d[_0x2f4e('0x3d')]=_[_0x2f4e('0x3f')](db['FaxInteraction'][_0x2f4e('0x3b')]);_0x5ccc8d[_0x2f4e('0x3e')]=_['keys'](_0x15b8fa[_0x2f4e('0x3e')]);_0x5ccc8d[_0x2f4e('0x40')]=_[_0x2f4e('0x41')](_0x5ccc8d['model'],_0x5ccc8d[_0x2f4e('0x3e')]);_0x791b0f[_0x2f4e('0x42')]=_[_0x2f4e('0x41')](_0x5ccc8d[_0x2f4e('0x3d')],qs['fields'](_0x15b8fa[_0x2f4e('0x3e')][_0x2f4e('0x43')]));_0x791b0f[_0x2f4e('0x42')]=_0x791b0f[_0x2f4e('0x42')][_0x2f4e('0x44')]?_0x791b0f[_0x2f4e('0x42')]:_0x5ccc8d[_0x2f4e('0x3d')];if(_0x15b8fa['query'][_0x2f4e('0xb9')]){_0x791b0f[_0x2f4e('0xba')]=[{'all':!![]}];}_0x791b0f=_[_0x2f4e('0x9f')]({},_0x791b0f,_0x15b8fa[_0x2f4e('0xbb')]);return db[_0x2f4e('0xa0')][_0x2f4e('0x63')](_0x791b0f)[_0x2f4e('0x28')](handleEntityNotFound(_0x28e41b,null))[_0x2f4e('0x28')](respondWithResult(_0x28e41b,null))[_0x2f4e('0x32')](handleError(_0x28e41b,null));};exports[_0x2f4e('0xbc')]=function(_0x24923f,_0x5c3759){return db['FaxInteraction'][_0x2f4e('0xbc')](_0x24923f[_0x2f4e('0xbd')],{})[_0x2f4e('0x28')](respondWithResult(_0x5c3759,0xc9))[_0x2f4e('0x32')](handleError(_0x5c3759,null));};exports[_0x2f4e('0x27')]=function(_0x5f4607,_0x4b08ed){if(_0x5f4607[_0x2f4e('0xbd')]['id']){delete _0x5f4607[_0x2f4e('0xbd')]['id'];}return db[_0x2f4e('0xa0')][_0x2f4e('0x63')]({'where':{'id':_0x5f4607[_0x2f4e('0xb8')]['id']}})['then'](handleEntityNotFound(_0x4b08ed,null))[_0x2f4e('0x28')](saveUpdates(_0x5f4607[_0x2f4e('0xbd')],null))[_0x2f4e('0x28')](respondWithResult(_0x4b08ed,null))[_0x2f4e('0x32')](handleError(_0x4b08ed,null));};exports[_0x2f4e('0xbe')]=function(_0x76b304,_0x5b47cf){return db[_0x2f4e('0xa0')]['find']({'where':{'id':_0x76b304[_0x2f4e('0xb8')]['id']}})[_0x2f4e('0x28')](handleEntityNotFound(_0x5b47cf,null))[_0x2f4e('0x28')](removeEntity(_0x5b47cf,null))[_0x2f4e('0x32')](handleError(_0x5b47cf,null));};exports[_0x2f4e('0xbf')]=function(_0x3f9f09,_0x3236ea){return db['FaxInteraction'][_0x2f4e('0xbf')]()[_0x2f4e('0x28')](respondWithResult(_0x3236ea,null))['catch'](handleError(_0x3236ea,null));};exports[_0x2f4e('0xc0')]=function(_0x2187a8,_0x311509,_0x4d15ee){return db['FaxMessage']['find']({'where':{'id':_0x2187a8['params']['id']}})[_0x2f4e('0x28')](handleEntityNotFound(_0x311509,null))['then'](function(_0x9521a0){if(_0x9521a0){return _0x9521a0['addMessage'](_0x2187a8['body'][_0x2f4e('0xc1')],_[_0x2f4e('0xc2')](_0x2187a8[_0x2f4e('0xbd')],['ids','id'])||{});}})[_0x2f4e('0x28')](respondWithResult(_0x311509,null))[_0x2f4e('0x32')](handleError(_0x311509,null));};exports[_0x2f4e('0xc3')]=function(_0x5e394a,_0x5505ae,_0xb9bd69){var _0x257824={'raw':![],'where':{}};var _0x224d51={};var _0x2c57e2={'count':0x0,'rows':[]};return db[_0x2f4e('0xa0')][_0x2f4e('0xc4')]({'where':{'id':_0x5e394a[_0x2f4e('0xb8')]['id']}})['then'](handleEntityNotFound(_0x5505ae,null))[_0x2f4e('0x28')](function(_0x270c73){if(_0x270c73){_0x224d51[_0x2f4e('0x3d')]=_['keys'](db[_0x2f4e('0xc5')]['rawAttributes']);_0x224d51[_0x2f4e('0x3e')]=_['keys'](_0x5e394a[_0x2f4e('0x3e')]);_0x224d51['filters']=_[_0x2f4e('0x41')](_0x224d51['model'],_0x224d51[_0x2f4e('0x3e')]);_0x257824[_0x2f4e('0x42')]=_['intersection'](_0x224d51['model'],qs[_0x2f4e('0x43')](_0x5e394a[_0x2f4e('0x3e')]['fields']));_0x257824[_0x2f4e('0x42')]=_0x257824[_0x2f4e('0x42')]['length']?_0x257824[_0x2f4e('0x42')]:_0x224d51[_0x2f4e('0x3d')];if(!_0x5e394a[_0x2f4e('0x3e')]['hasOwnProperty']('nolimit')){_0x257824[_0x2f4e('0x20')]=qs[_0x2f4e('0x20')](_0x5e394a[_0x2f4e('0x3e')][_0x2f4e('0x20')]);_0x257824[_0x2f4e('0x1f')]=qs[_0x2f4e('0x1f')](_0x5e394a['query'][_0x2f4e('0x1f')]);}_0x257824[_0x2f4e('0x47')]=qs[_0x2f4e('0x48')](_0x5e394a[_0x2f4e('0x3e')][_0x2f4e('0x48')]);_0x257824[_0x2f4e('0x49')]=qs['filters'](_[_0x2f4e('0x4a')](_0x5e394a[_0x2f4e('0x3e')],_0x224d51[_0x2f4e('0x40')]));_0x257824[_0x2f4e('0x49')][_0x2f4e('0xb4')]=_0x270c73['id'];if(_0x5e394a[_0x2f4e('0x3e')]['filter']){_0x257824[_0x2f4e('0x49')]=_[_0x2f4e('0x9f')](_0x257824[_0x2f4e('0x49')],{'$or':_[_0x2f4e('0x2d')](_0x257824['attributes'],function(_0x453770){var _0x386f49={};_0x386f49[_0x453770]={'$like':'%'+_0x5e394a['query'][_0x2f4e('0x85')]+'%'};return _0x386f49;})});}if(_0x5e394a['query'][_0x2f4e('0x7d')]){var _0x12ee58=_0x5e394a[_0x2f4e('0x3e')][_0x2f4e('0x7d')][_0x2f4e('0x30')](',');var _0x388b1a={};_0x388b1a[_0x12ee58[0x0]]={'$gte':moment(_0x12ee58[0x1])[_0x2f4e('0xc6')](_0x2f4e('0xc7'))};_0x257824[_0x2f4e('0x49')]=_['merge'](_0x257824[_0x2f4e('0x49')],_0x388b1a);}_0x257824=_[_0x2f4e('0x9f')]({},_0x257824,_0x5e394a['options']);return db[_0x2f4e('0xc5')]['count']({'where':_0x257824[_0x2f4e('0x49')]})['then'](function(_0x518162){_0x2c57e2[_0x2f4e('0x22')]=_0x518162;if(_0x5e394a[_0x2f4e('0x3e')][_0x2f4e('0xb9')]){_0x257824[_0x2f4e('0xba')]=[{'all':!![]}];}return db['FaxMessage'][_0x2f4e('0xc8')](_0x257824);})[_0x2f4e('0x28')](function(_0x2f0abd){_0x2c57e2[_0x2f4e('0xb7')]=_0x2f0abd;return _0x2c57e2;});}})[_0x2f4e('0x28')](respondWithFilteredResult(_0x5505ae,_0x257824))[_0x2f4e('0x32')](handleError(_0x5505ae,null));};exports[_0x2f4e('0xc9')]=function(_0xd353c3,_0x4c8fed,_0x55d9fb){return db[_0x2f4e('0xa0')][_0x2f4e('0x63')]({'where':{'id':_0xd353c3['params']['id']}})[_0x2f4e('0x28')](handleEntityNotFound(_0x4c8fed,null))[_0x2f4e('0x28')](function(_0x491384){if(_0x491384){return _0x491384[_0x2f4e('0xca')](_0xd353c3['body'][_0x2f4e('0xc1')],_[_0x2f4e('0xc2')](_0xd353c3[_0x2f4e('0xbd')],[_0x2f4e('0xc1'),'id'])||{})[_0x2f4e('0xcb')](function(){return db[_0x2f4e('0x73')][_0x2f4e('0xc8')]({'attributes':['id',_0x2f4e('0x2a'),_0x2f4e('0x4d')],'where':{'id':_0xd353c3[_0x2f4e('0xbd')][_0x2f4e('0xc1')]}});})[_0x2f4e('0x28')](function(_0x2e9156){socket[_0x2f4e('0xcc')](_0x2f4e('0xcd'),{'id':Number(_0xd353c3[_0x2f4e('0xb8')]['id']),'tags':_0x2e9156||[]});return{'id':Number(_0xd353c3['params']['id']),'tags':_0x2e9156||[]};});}})[_0x2f4e('0x28')](respondWithResult(_0x4c8fed,null))['catch'](handleError(_0x4c8fed,null));};exports[_0x2f4e('0xce')]=function(_0x5a63e3,_0x2956cd,_0x183f27){return db['FaxInteraction'][_0x2f4e('0x63')]({'where':{'id':_0x5a63e3[_0x2f4e('0xb8')]['id']}})[_0x2f4e('0x28')](handleEntityNotFound(_0x2956cd,null))[_0x2f4e('0x28')](function(_0x304269){if(_0x304269){return _0x304269[_0x2f4e('0xce')](_0x5a63e3[_0x2f4e('0x3e')][_0x2f4e('0xc1')]);}})['then'](respondWithStatusCode(_0x2956cd,null))[_0x2f4e('0x32')](handleError(_0x2956cd,null));};exports[_0x2f4e('0xcf')]=function(_0x2e87b8,_0x209d19){var _0x122356=moment()[_0x2f4e('0xd0')]()[_0x2f4e('0x9d')]();var _0x32f56c=path['join'](config[_0x2f4e('0xd1')],_0x2f4e('0xd2'),'files',_0x2f4e('0xd3'));var _0x505389=path[_0x2f4e('0xd4')](config['root'],_0x2f4e('0xd2'),'files',_0x2f4e('0xd5'));var _0x58c730=path['join'](_0x32f56c,_0x122356);var _0x53779a=util[_0x2f4e('0xc6')](_0x2f4e('0xd6'),_0x2e87b8[_0x2f4e('0xb8')]['id'],_0x122356);var _0x42fe0c=path[_0x2f4e('0xd4')](_0x32f56c,_0x53779a);var _0x3066e9=[];_0x3066e9[_0x2f4e('0xb5')]({'model':db[_0x2f4e('0xd7')],'as':_0x2f4e('0xd7'),'raw':!![]});var _0x74b617=[{'model':db[_0x2f4e('0xc5')],'as':_0x2f4e('0xd8'),'attributes':['id',_0x2f4e('0xbd'),_0x2f4e('0x7b')],'include':_0x3066e9}];return db[_0x2f4e('0xa0')][_0x2f4e('0x63')]({'where':{'id':_0x2e87b8[_0x2f4e('0xb8')]['id']},'include':_0x74b617})['then'](handleEntityNotFound(_0x209d19,null))[_0x2f4e('0x28')](function(_0x8de00){if(_0x8de00&&_0x8de00[_0x2f4e('0xd8')]){var _0x41d33b=_0x8de00['get']({'plain':!![]});fs[_0x2f4e('0xd9')](_0x58c730);for(var _0x560f1e=0x0;_0x560f1e<_0x41d33b[_0x2f4e('0xd8')][_0x2f4e('0x44')];_0x560f1e++){var _0xca7e2c=_0x41d33b[_0x2f4e('0xd8')][_0x560f1e][_0x2f4e('0xd7')];if(_0xca7e2c){var _0x6ab51f=path[_0x2f4e('0xd4')](_0x505389,_0xca7e2c['basename']);if(fs['existsSync'](_0x6ab51f)){fs['createReadStream'](_0x6ab51f)[_0x2f4e('0xda')](fs['createWriteStream'](path['join'](_0x58c730,_0xca7e2c[_0x2f4e('0xdb')])));}}}return BPromise[_0x2f4e('0x93')]()[_0x2f4e('0x28')](function(){return new BPromise(function(_0x3d71f6,_0x2fbf88){zipdir(_0x58c730,{'saveTo':_0x42fe0c},function(_0x5b9929,_0x232bd9){if(_0x5b9929)return _0x2fbf88(_0x5b9929);return _0x3d71f6(_0x232bd9);});})[_0x2f4e('0x28')](function(){return new BPromise(function(_0x115c14,_0x407b93){rimraf(_0x58c730,function(_0x18bea4){if(_0x18bea4)_0x407b93(_0x18bea4);return _0x115c14();});});})[_0x2f4e('0x28')](function(){return _0x209d19[_0x2f4e('0xcf')](_0x42fe0c,_0x53779a,function(_0x538cc2){if(_0x538cc2){console[_0x2f4e('0xdc')](_0x2f4e('0xdd'),_0x538cc2);}else{fs[_0x2f4e('0xde')](_0x42fe0c);}});});});}else{return _0x209d19[_0x2f4e('0x1b')](0xc8);}})[_0x2f4e('0x32')](handleError(_0x209d19,null));}; \ No newline at end of file +var _0x031d=['order','sort','where','pick','select','field','color','from','tools_tags','u.fullname','left_join','u.id\x20=\x20ui.UserId','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','find','body','some','compact','FaxAccountId','createdAt','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.FaxAccountId\x20IS\x20NULL','i.FaxAccountId\x20IN\x20?','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','contactName','i.*','c.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','FaxInteractionId','all','rows','show','params','include','options','create','describe','addMessage','FaxMessage','ids','omit','findOne','nolimit','$gte','format','includeAll','addTags','setTags','faxInteractionTags:save','removeTags','download','unix','root','server','join','files','transcript-%d-%s.zip','Attachment','Messages','get','mkdirSync','basename','existsSync','createReadStream','createWriteStream','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','Users','map','TagIds','split','forEach','push','catch','waiting','talking','answered','unmanaged','closed','UserId','total','index','FaxInteraction','rawAttributes','type','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty'];(function(_0xc8a02c,_0x4809d3){var _0x3d89da=function(_0x5903d8){while(--_0x5903d8){_0xc8a02c['push'](_0xc8a02c['shift']());}};_0x3d89da(++_0x4809d3);}(_0x031d,0x16e));var _0xd031=function(_0x21f3bf,_0xfb0f59){_0x21f3bf=_0x21f3bf-0x0;var _0x249d08=_0x031d[_0x21f3bf];return _0x249d08;};'use strict';var emlformat=require(_0xd031('0x0'));var rimraf=require(_0xd031('0x1'));var zipdir=require(_0xd031('0x2'));var jsonpatch=require(_0xd031('0x3'));var rp=require('request-promise');var moment=require(_0xd031('0x4'));var BPromise=require(_0xd031('0x5'));var Mustache=require(_0xd031('0x6'));var util=require(_0xd031('0x7'));var path=require(_0xd031('0x8'));var sox=require(_0xd031('0x9'));var csv=require('to-csv');var ejs=require(_0xd031('0xa'));var fs=require('fs');var fs_extra=require(_0xd031('0xb'));var _=require(_0xd031('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd031('0xd'));var Redis=require(_0xd031('0xe'));var authService=require(_0xd031('0xf'));var qs=require(_0xd031('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd031('0x11'));var logger=require(_0xd031('0x12'))(_0xd031('0x13'));var utils=require(_0xd031('0x14'));var config=require(_0xd031('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xd031('0x16'))['db'];config[_0xd031('0x17')]=_[_0xd031('0x18')](config[_0xd031('0x17')],{'host':_0xd031('0x19'),'port':0x18eb});var socket=require(_0xd031('0x1a'))(new Redis(config['redis']));require('./faxInteraction.socket')['register'](socket);function respondWithStatusCode(_0x2d3c72,_0x48f9f9){_0x48f9f9=_0x48f9f9||0xcc;return function(_0x2d3707){if(_0x2d3707){return _0x2d3c72[_0xd031('0x1b')](_0x48f9f9);}return _0x2d3c72[_0xd031('0x1c')](_0x48f9f9)['end']();};}function respondWithResult(_0x51b1a2,_0x2f9de2){_0x2f9de2=_0x2f9de2||0xc8;return function(_0x44b01a){if(_0x44b01a){return _0x51b1a2[_0xd031('0x1c')](_0x2f9de2)[_0xd031('0x1d')](_0x44b01a);}};}function respondWithFilteredResult(_0x3fd5e5,_0x6b6f4b){return function(_0x5e74a9){if(_0x5e74a9){var _0x28239f=typeof _0x6b6f4b[_0xd031('0x1e')]==='undefined'&&typeof _0x6b6f4b['limit']===_0xd031('0x1f');var _0x1ef5ab=_0x5e74a9['count'];var _0x26e74b=_0x28239f?0x0:_0x6b6f4b['offset'];var _0x29f395=_0x28239f?_0x5e74a9[_0xd031('0x20')]:_0x6b6f4b['offset']+_0x6b6f4b[_0xd031('0x21')];var _0x3bf862;if(_0x29f395>=_0x1ef5ab){_0x29f395=_0x1ef5ab;_0x3bf862=0xc8;}else{_0x3bf862=0xce;}_0x3fd5e5[_0xd031('0x1c')](_0x3bf862);return _0x3fd5e5['set'](_0xd031('0x22'),_0x26e74b+'-'+_0x29f395+'/'+_0x1ef5ab)[_0xd031('0x1d')](_0x5e74a9);}return null;};}function patchUpdates(_0x2a11f5){return function(_0x12788c){try{jsonpatch[_0xd031('0x23')](_0x12788c,_0x2a11f5,!![]);}catch(_0x5d8459){return BPromise[_0xd031('0x24')](_0x5d8459);}return _0x12788c[_0xd031('0x25')]();};}function saveUpdates(_0x4140f6,_0x540ba6){return function(_0x11d59a){if(_0x11d59a){return _0x11d59a[_0xd031('0x26')](_0x4140f6)[_0xd031('0x27')](function(_0x262c9f){return _0x262c9f;});}return null;};}function removeEntity(_0x4a246c,_0x2678d4){return function(_0x512233){if(_0x512233){return _0x512233[_0xd031('0x28')]()['then'](function(){_0x4a246c['status'](0xcc)[_0xd031('0x29')]();});}};}function handleEntityNotFound(_0x868945,_0x90fa25){return function(_0x278182){if(!_0x278182){_0x868945[_0xd031('0x1b')](0x194);}return _0x278182;};}function handleError(_0x48f2cf,_0x19ed1b){_0x19ed1b=_0x19ed1b||0x1f4;return function(_0x188c2b){logger['error'](_0x188c2b[_0xd031('0x2a')]);if(_0x188c2b[_0xd031('0x2b')]){delete _0x188c2b[_0xd031('0x2b')];}_0x48f2cf[_0xd031('0x1c')](_0x19ed1b)[_0xd031('0x2c')](_0x188c2b);};}function getInteractionUsers(_0x47f161,_0x5b674b){return new BPromise(function(_0x472753,_0x5ac11f){try{if(_0x5b674b[_0x47f161['id']]){_0x47f161[_0xd031('0x2d')]=_[_0xd031('0x2e')](_0x5b674b[_0x47f161['id']],function(_0x250d5c){return{'id':_0x250d5c['id'],'fullname':_0x250d5c['fullname']};});}}catch(_0xb22df5){_0x5ac11f(_0xb22df5);}_0x472753(_0x47f161);});}function getInteractionTags(_0x10041c,_0x5a1c4a){return new BPromise(function(_0x251e64,_0xba4e8){try{if(_0x10041c[_0xd031('0x2f')]){_0x10041c['Tags']=[];_0x10041c[_0xd031('0x2f')][_0xd031('0x30')](',')[_0xd031('0x31')](function(_0x24af26){_0x10041c['Tags'][_0xd031('0x32')](_0x5a1c4a[_0x24af26]);});}delete _0x10041c[_0xd031('0x2f')];}catch(_0x9757d){_0xba4e8(_0x9757d);}_0x251e64(_0x10041c);});}function updateFaxInteraction(_0x56d0ff,_0x4da6dd,_0x1f2616){return new BPromise(function(_0x2bb26f,_0x32ad42){return getInteractionUsers(_0x56d0ff,_0x1f2616)[_0xd031('0x27')](function(_0x1e6345){return getInteractionTags(_0x1e6345,_0x4da6dd);})[_0xd031('0x27')](function(_0x3a0d7f){return getStateInteraction(_0x3a0d7f);})[_0xd031('0x27')](function(_0xc42b0c){_0x2bb26f(_0xc42b0c);})[_0xd031('0x33')](function(_0x33fc40){_0x32ad42(_0x33fc40);});});}function getStateInteraction(_0x962fbf){return new BPromise(function(_0x13c703){_0x962fbf[_0xd031('0x34')]=0x0;_0x962fbf[_0xd031('0x35')]=0x0;_0x962fbf[_0xd031('0x36')]=0x0;_0x962fbf[_0xd031('0x37')]=0x0;_0x962fbf['total']=0x0;if(!_0x962fbf[_0xd031('0x38')]&&!_0x962fbf[_0xd031('0x39')]){_0x962fbf[_0xd031('0x34')]+=0x1;}if(!_0x962fbf['closed']&&_0x962fbf[_0xd031('0x39')]){_0x962fbf[_0xd031('0x35')]+=0x1;if(_0x962fbf[_0xd031('0x34')]){_0x962fbf[_0xd031('0x34')]-=0x1;}}if(_0x962fbf[_0xd031('0x38')]&&_0x962fbf['UserId']){_0x962fbf['answered']+=0x1;if(_0x962fbf[_0xd031('0x35')]){_0x962fbf[_0xd031('0x35')]-=0x1;}}if(_0x962fbf[_0xd031('0x38')]&&!_0x962fbf[_0xd031('0x39')]){_0x962fbf[_0xd031('0x37')]+=0x1;if(_0x962fbf[_0xd031('0x34')]){_0x962fbf[_0xd031('0x34')]-=0x1;}}_0x962fbf[_0xd031('0x3a')]+=0x1;_0x13c703(_0x962fbf);});}exports[_0xd031('0x3b')]=function(_0x45e3d8,_0x44c2be){var _0x459e26={},_0x577083={},_0x496b15={'count':0x0,'rows':[]};var _0x515e18=_[_0xd031('0x2e')](db[_0xd031('0x3c')][_0xd031('0x3d')],function(_0x49f564){return{'name':_0x49f564['fieldName'],'type':_0x49f564[_0xd031('0x3e')]['key']};});_0x577083['model']=_[_0xd031('0x2e')](_0x515e18,_0xd031('0x2b'));_0x577083['query']=_[_0xd031('0x3f')](_0x45e3d8[_0xd031('0x40')]);_0x577083[_0xd031('0x41')]=_[_0xd031('0x42')](_0x577083[_0xd031('0x43')],_0x577083[_0xd031('0x40')]);_0x459e26[_0xd031('0x44')]=_['intersection'](_0x577083[_0xd031('0x43')],qs[_0xd031('0x45')](_0x45e3d8[_0xd031('0x40')]['fields']));_0x459e26['attributes']=_0x459e26['attributes'][_0xd031('0x46')]?_0x459e26[_0xd031('0x44')]:_0x577083[_0xd031('0x43')];if(!_0x45e3d8[_0xd031('0x40')][_0xd031('0x47')]('nolimit')){_0x459e26[_0xd031('0x21')]=qs[_0xd031('0x21')](_0x45e3d8[_0xd031('0x40')][_0xd031('0x21')]);_0x459e26[_0xd031('0x1e')]=qs['offset'](_0x45e3d8['query'][_0xd031('0x1e')]);}_0x459e26[_0xd031('0x48')]=qs[_0xd031('0x49')](_0x45e3d8['query'][_0xd031('0x49')]);_0x459e26[_0xd031('0x4a')]=qs[_0xd031('0x41')](_[_0xd031('0x4b')](_0x45e3d8[_0xd031('0x40')],_0x577083[_0xd031('0x41')]),_0x515e18);var _0x345514=[];var _0x598196=squel[_0xd031('0x4c')]()[_0xd031('0x4d')]('id')[_0xd031('0x4d')](_0xd031('0x2b'))[_0xd031('0x4d')](_0xd031('0x4e'))[_0xd031('0x4f')](_0xd031('0x50'));var _0x17f901=squel['select']()[_0xd031('0x4d')]('u.id')[_0xd031('0x4d')](_0xd031('0x51'))[_0xd031('0x4d')]('ui.FaxInteractionId')[_0xd031('0x4f')]('user_has_fax_interactions','ui')[_0xd031('0x52')]('users','u',_0xd031('0x53'));var _0x4b86b9=squel[_0xd031('0x4c')]()[_0xd031('0x4f')](_0xd031('0x54'),'i')[_0xd031('0x52')](_0xd031('0x55'),'c',_0xd031('0x56'))[_0xd031('0x52')](_0xd031('0x57'),'o',_0xd031('0x58'))[_0xd031('0x52')](_0xd031('0x59'),'a',_0xd031('0x5a'))[_0xd031('0x52')](_0xd031('0x5b'),'me',_0xd031('0x5c'))[_0xd031('0x52')](_0xd031('0x5d'),'it','it.FaxInteractionId\x20=\x20i.id')[_0xd031('0x52')](_0xd031('0x50'),'t',_0xd031('0x5e'));var _0x37e7c4=squel['expr']();var _0x11488a=[];var _0x1dc654=squel[_0xd031('0x5f')]();var _0x9dc7b5;if(_0x45e3d8[_0xd031('0x40')][_0xd031('0x60')]){_0x9dc7b5=as[_0xd031('0x61')](_0x45e3d8[_0xd031('0x40')][_0xd031('0x60')]);var _0x80c920=_0x9dc7b5[_0xd031('0x62')];for(var _0xf0557e=0x0;_0xf0557e<_0x9dc7b5[_0xd031('0x63')][_0xd031('0x46')];_0xf0557e++){var _0x2b09ca=_0x9dc7b5[_0xd031('0x63')][_0xf0557e];var _0x20e08c='i';var _0x387da0=_['find'](_0x515e18,[_0xd031('0x2b'),_0x2b09ca[_0xd031('0x4d')]]);if(!_0x387da0){switch(_0x2b09ca[_0xd031('0x4d')]){case _0xd031('0x64'):if(_0x2b09ca['value']==0x1){_0x4b86b9[_0xd031('0x65')]('`'+_0x2b09ca[_0xd031('0x4d')]+_0xd031('0x66'));}else{_0x4b86b9[_0xd031('0x65')]('`'+_0x2b09ca['field']+_0xd031('0x67'));}break;case _0xd031('0x68'):if(_0x2b09ca[_0xd031('0x69')]===_0xd031('0x6a')){if(_0x2b09ca[_0xd031('0x6b')][_0xd031('0x30')]('\x20')[_0xd031('0x46')]>0x1){_0x37e7c4[_0x80c920](_0xd031('0x6c'),qs[_0xd031('0x6d')](_0x2b09ca[_0xd031('0x6b')]),null);}else{var _0x2fc1ab='%'+_0x2b09ca['value']+'%';_0x37e7c4[_0x80c920](_0xd031('0x6e'),_0x2fc1ab,_0x2fc1ab,_0x2fc1ab);}}else{_0x387da0=_['find'](_0x515e18,[_0xd031('0x2b'),_0xd031('0x6f')]);_0x2b09ca[_0xd031('0x4d')]=_0xd031('0x6f');_0x3b2d07=as[_0xd031('0x70')](_0x20e08c,_0x387da0['type'],_0x2b09ca);_0x37e7c4[_0x80c920](_0x3b2d07[_0xd031('0x71')],_0x3b2d07[_0xd031('0x6b')][_0xd031('0x72')],_0x3b2d07[_0xd031('0x6b')][_0xd031('0x29')]);}break;case _0xd031('0x73'):var _0x36cda5=_0x2b09ca['value'][_0xd031('0x30')](',')[_0xd031('0x2e')](function(_0x2f0e98){return Number(_0x2f0e98);});_0x36cda5[_0xd031('0x31')](function(_0x1e9dca){_0x1dc654['or'](_0xd031('0x74'),'%,'+_0x1e9dca+',%');});_0x11488a=_[_0xd031('0x75')](_0x11488a,_0x36cda5);break;case _0xd031('0x76'):if(_0x2b09ca[_0xd031('0x69')]===_0xd031('0x6a')){_0x37e7c4[_0x80c920](_0xd031('0x77'),'%'+_0x2b09ca[_0xd031('0x6b')]+'%',null);}else{_0x387da0=_[_0xd031('0x78')](_0x515e18,['name',_0xd031('0x39')]);_0x2b09ca[_0xd031('0x4d')]=_0xd031('0x39');_0x3b2d07=as[_0xd031('0x70')](_0x20e08c,_0x387da0['type'],_0x2b09ca);_0x37e7c4[_0x80c920](_0x3b2d07[_0xd031('0x71')],_0x3b2d07['value']['start'],_0x3b2d07[_0xd031('0x6b')][_0xd031('0x29')]);}break;case _0xd031('0x79'):_0x3b2d07=as[_0xd031('0x70')]('me',null,_0x2b09ca);_0x37e7c4[_0x80c920](_0x3b2d07[_0xd031('0x71')],_0x3b2d07['value'][_0xd031('0x72')],_0x3b2d07[_0xd031('0x6b')]['end']);break;}}else{var _0x3b2d07=as['buildExpression'](_0x20e08c,_0x387da0[_0xd031('0x3e')],_0x2b09ca);_0x37e7c4[_0x80c920](_0x3b2d07['text'],_0x3b2d07[_0xd031('0x6b')][_0xd031('0x72')],_0x3b2d07[_0xd031('0x6b')][_0xd031('0x29')]);}}}else{var _0x5423e1=_(_0x45e3d8[_0xd031('0x40')])[_0xd031('0x3f')]()['map'](function(_0x4b21a8){return _[_0xd031('0x7a')](_0x515e18,['name',_0x4b21a8])?_0x4b21a8:undefined;})[_0xd031('0x7b')]()[_0xd031('0x6b')]();if(!_['isEmpty'](_0x5423e1)){_0x5423e1[_0xd031('0x31')](function(_0xbdc355){if(_0xbdc355===_0xd031('0x7c')){_0x4b86b9[_0xd031('0x4a')]('i.FaxAccountId\x20IN\x20?',[]['concat'](_0x45e3d8[_0xd031('0x40')][_0xbdc355]));}else if(_0xbdc355===_0xd031('0x7d')){var _0x168297=JSON['parse'](_0x45e3d8['query'][_0xbdc355])['$gte'];var _0x2113fd=JSON['parse'](_0x45e3d8[_0xd031('0x40')][_0xbdc355])[_0xd031('0x7e')];_0x4b86b9['where'](_0xd031('0x7f'),_0x168297,_0x2113fd);}else{if(_0x45e3d8[_0xd031('0x40')][_0xbdc355]===_0xd031('0x80')){_0x4b86b9[_0xd031('0x4a')]('i.'+_0xbdc355+_0xd031('0x81'));}else{_0x4b86b9[_0xd031('0x4a')]('i.'+_0xbdc355+_0xd031('0x82'),_0x45e3d8['query'][_0xbdc355]);}}});}if(_0x45e3d8['query'][_0xd031('0x83')]){if(_0x45e3d8[_0xd031('0x40')][_0xd031('0x83')]==0x1){_0x4b86b9[_0xd031('0x65')](_0xd031('0x84'));}else{_0x4b86b9[_0xd031('0x65')](_0xd031('0x85'));}}if(_0x45e3d8[_0xd031('0x40')]['tag']){_0x11488a=_[_0xd031('0x86')](_0x45e3d8[_0xd031('0x40')][_0xd031('0x87')])?_0x45e3d8[_0xd031('0x40')]['tag']:new Array(_0x45e3d8[_0xd031('0x40')][_0xd031('0x87')]);_0x11488a[_0xd031('0x31')](function(_0x5b89ea){_0x1dc654['or'](_0xd031('0x74'),'%,'+_0x5b89ea+',%');});}if(_0x45e3d8[_0xd031('0x40')][_0xd031('0x88')]){var _0x52465a=_0x45e3d8[_0xd031('0x40')]['filter']['replace']('\x5c','\x5c\x5c')[_0xd031('0x89')](/'/g,'\x27\x27');if(qs[_0xd031('0x8a')](_0x52465a)){_0x37e7c4['or'](_0xd031('0x8b'),_0x52465a+'%')['or']('i.fax\x20LIKE\x20?',_0x52465a+'%');}_0x37e7c4['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x52465a+'%');}}_0x4b86b9[_0xd031('0x4a')](_0x37e7c4);_0x4b86b9[_0xd031('0x8c')](_0xd031('0x8d'));var _0x478675={'type':db[_0xd031('0x8e')][_0xd031('0x8f')][_0xd031('0x90')],'raw':!![]};var _0x2b29f9=_0x4b86b9['clone']();_0x2b29f9['field'](_0xd031('0x8d'));_0x2b29f9[_0xd031('0x4d')](_0xd031('0x91'),'unreadMessages');if(_0x459e26[_0xd031('0x48')]){_0x459e26[_0xd031('0x48')][_0xd031('0x31')](function(_0x54d99b){var _0x519533=_0x54d99b[0x0]==='contactName'?_0x54d99b[0x0]:'i.'+_0x54d99b[0x0];_0x4b86b9['order'](_0x519533,_0x54d99b[0x1]===_0xd031('0x92')?![]:!![]);});}if(!_[_0xd031('0x93')](_0x11488a)){_0x4b86b9[_0xd031('0x65')](_0x1dc654);_0x2b29f9[_0xd031('0x4a')](_0xd031('0x94'),_0x11488a);}BPromise[_0xd031('0x95')]()['then'](function(){if(!_0x9dc7b5){if(_0x45e3d8[_0xd031('0x40')]['FaxAccountId'])return;_0x2b29f9[_0xd031('0x4a')](_0xd031('0x96'));_0x4b86b9['where'](_0xd031('0x96'));return;}if(_0x45e3d8[_0xd031('0x97')][_0xd031('0x98')]!==_0xd031('0x99'))return;return _0x45e3d8[_0xd031('0x97')]['getFaxAccounts']({'attributes':['id'],'raw':!![]})[_0xd031('0x27')](function(_0x8e22f5){if(_['isEmpty'](_0x8e22f5)){_0x2b29f9['where'](_0xd031('0x9a'));_0x4b86b9[_0xd031('0x4a')](_0xd031('0x9a'));}else{_0x2b29f9[_0xd031('0x4a')](_0xd031('0x9b'),_[_0xd031('0x2e')](_0x8e22f5,'id'));_0x4b86b9['where'](_0xd031('0x9b'),_['map'](_0x8e22f5,'id'));}});})[_0xd031('0x27')](function(){if(_0x45e3d8[_0xd031('0x97')][_0xd031('0x98')]==='agent'&&!_0x9dc7b5&&!_0x45e3d8[_0xd031('0x40')]['FaxAccountId'])return[];return db[_0xd031('0x9c')][_0xd031('0x40')](_0x2b29f9[_0xd031('0x9d')](),_0x478675);})['then'](function(_0x514e52){_0x496b15[_0xd031('0x20')]=_0x514e52[_0xd031('0x46')];if(_0x496b15[_0xd031('0x20')]===0x0)return[];return db[_0xd031('0x9c')][_0xd031('0x40')](_0x598196[_0xd031('0x9d')](),_0x478675)[_0xd031('0x27')](function(_0x440a4c){_0x345514=_[_0xd031('0x9e')](_0x440a4c,'id');_0x478675=_[_0xd031('0x9f')](_0x478675,{'model':db[_0xd031('0x3c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x45e3d8[_0xd031('0x40')]['fields']){_0x459e26[_0xd031('0x44')]['forEach'](function(_0x5cccb8){_0x4b86b9[_0xd031('0x4d')]('i.'+_0x5cccb8);});}else{_0x4b86b9[_0xd031('0x4d')](_0xd031('0x91'),_0xd031('0x64'));_0x4b86b9[_0xd031('0x4d')](_0xd031('0xa0'),_0xd031('0xa1'));_0x4b86b9[_0xd031('0x4d')](_0xd031('0xa2'),_0xd031('0xa3'));_0x4b86b9[_0xd031('0x4d')]('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0xd031('0xa4'));_0x4b86b9[_0xd031('0x4d')](_0xd031('0xa5'));_0x4b86b9[_0xd031('0x4d')](_0xd031('0xa6'),'Contact.firstName');_0x4b86b9['field']('c.lastName',_0xd031('0xa7'));_0x4b86b9[_0xd031('0x4d')](_0xd031('0xa8'),_0xd031('0xa9'));_0x4b86b9[_0xd031('0x4d')](_0xd031('0xaa'),_0xd031('0xab'));_0x4b86b9['field']('c.mobile',_0xd031('0xac'));_0x4b86b9[_0xd031('0x4d')](_0xd031('0xad'),'Contact.fax');_0x4b86b9['field'](_0xd031('0xae'),_0xd031('0xaf'));_0x4b86b9[_0xd031('0x4d')]('o.internal',_0xd031('0xb0'));_0x4b86b9[_0xd031('0x4d')](_0xd031('0xb1'),_0xd031('0x2f'));}if(_0x459e26[_0xd031('0x21')])_0x4b86b9[_0xd031('0x21')](_0x459e26['limit']);if(_0x459e26[_0xd031('0x1e')])_0x4b86b9[_0xd031('0x1e')](_0x459e26[_0xd031('0x1e')]);return db[_0xd031('0x9c')][_0xd031('0x40')](_0x4b86b9[_0xd031('0x9d')](),_0x478675);})[_0xd031('0x27')](function(_0x31507f){if(_0x31507f['length']>0x0)_0x17f901[_0xd031('0x4a')]('ui.FaxInteractionId\x20IN\x20?',_['map'](_0x31507f,'id'));return db[_0xd031('0x9c')][_0xd031('0x40')](_0x17f901[_0xd031('0x9d')](),_0x478675)[_0xd031('0x27')](function(_0x1e35c4){var _0x303df2=_[_0xd031('0xb2')](_0x1e35c4,_0xd031('0xb3'));var _0x1619a2=[];_0x31507f[_0xd031('0x31')](function(_0x52ecbc){_0x1619a2[_0xd031('0x32')](updateFaxInteraction(_0x52ecbc,_0x345514,_0x303df2));});return BPromise[_0xd031('0xb4')](_0x1619a2);});});})[_0xd031('0x27')](function(_0x5e8266){_0x496b15[_0xd031('0xb5')]=_0x5e8266;return _0x496b15;})[_0xd031('0x27')](respondWithFilteredResult(_0x44c2be,_0x459e26))[_0xd031('0x33')](handleError(_0x44c2be,null));};exports[_0xd031('0xb6')]=function(_0x123bf6,_0x501f53){var _0x55831c={'raw':![],'where':{'id':_0x123bf6[_0xd031('0xb7')]['id']}},_0xe28944={};_0xe28944[_0xd031('0x43')]=_['keys'](db[_0xd031('0x3c')][_0xd031('0x3d')]);_0xe28944[_0xd031('0x40')]=_[_0xd031('0x3f')](_0x123bf6[_0xd031('0x40')]);_0xe28944[_0xd031('0x41')]=_[_0xd031('0x42')](_0xe28944[_0xd031('0x43')],_0xe28944[_0xd031('0x40')]);_0x55831c[_0xd031('0x44')]=_[_0xd031('0x42')](_0xe28944[_0xd031('0x43')],qs[_0xd031('0x45')](_0x123bf6[_0xd031('0x40')]['fields']));_0x55831c[_0xd031('0x44')]=_0x55831c[_0xd031('0x44')][_0xd031('0x46')]?_0x55831c[_0xd031('0x44')]:_0xe28944[_0xd031('0x43')];if(_0x123bf6['query']['includeAll']){_0x55831c[_0xd031('0xb8')]=[{'all':!![]}];}_0x55831c=_[_0xd031('0x9f')]({},_0x55831c,_0x123bf6[_0xd031('0xb9')]);return db[_0xd031('0x3c')]['find'](_0x55831c)[_0xd031('0x27')](handleEntityNotFound(_0x501f53,null))[_0xd031('0x27')](respondWithResult(_0x501f53,null))[_0xd031('0x33')](handleError(_0x501f53,null));};exports[_0xd031('0xba')]=function(_0x1f56c5,_0x45f0de){return db[_0xd031('0x3c')][_0xd031('0xba')](_0x1f56c5[_0xd031('0x79')],{})[_0xd031('0x27')](respondWithResult(_0x45f0de,0xc9))[_0xd031('0x33')](handleError(_0x45f0de,null));};exports[_0xd031('0x26')]=function(_0x87cfe0,_0xe8554){if(_0x87cfe0[_0xd031('0x79')]['id']){delete _0x87cfe0['body']['id'];}return db['FaxInteraction']['find']({'where':{'id':_0x87cfe0[_0xd031('0xb7')]['id']}})[_0xd031('0x27')](handleEntityNotFound(_0xe8554,null))[_0xd031('0x27')](saveUpdates(_0x87cfe0[_0xd031('0x79')],null))[_0xd031('0x27')](respondWithResult(_0xe8554,null))[_0xd031('0x33')](handleError(_0xe8554,null));};exports[_0xd031('0x28')]=function(_0x1b28b3,_0x3bf78c){return db[_0xd031('0x3c')]['find']({'where':{'id':_0x1b28b3[_0xd031('0xb7')]['id']}})[_0xd031('0x27')](handleEntityNotFound(_0x3bf78c,null))['then'](removeEntity(_0x3bf78c,null))['catch'](handleError(_0x3bf78c,null));};exports['describe']=function(_0x19f6a9,_0x382ab9){return db[_0xd031('0x3c')][_0xd031('0xbb')]()[_0xd031('0x27')](respondWithResult(_0x382ab9,null))[_0xd031('0x33')](handleError(_0x382ab9,null));};exports[_0xd031('0xbc')]=function(_0x1bef1f,_0x5b0cc9,_0x57b6eb){return db[_0xd031('0xbd')]['find']({'where':{'id':_0x1bef1f['params']['id']}})[_0xd031('0x27')](handleEntityNotFound(_0x5b0cc9,null))[_0xd031('0x27')](function(_0x317c04){if(_0x317c04){return _0x317c04[_0xd031('0xbc')](_0x1bef1f[_0xd031('0x79')][_0xd031('0xbe')],_[_0xd031('0xbf')](_0x1bef1f[_0xd031('0x79')],[_0xd031('0xbe'),'id'])||{});}})['then'](respondWithResult(_0x5b0cc9,null))[_0xd031('0x33')](handleError(_0x5b0cc9,null));};exports['getMessages']=function(_0x4fbfe3,_0xf71805,_0x5e4650){var _0x14710f={'raw':![],'where':{}};var _0x3e5e3a={};var _0x4c985a={'count':0x0,'rows':[]};return db[_0xd031('0x3c')][_0xd031('0xc0')]({'where':{'id':_0x4fbfe3[_0xd031('0xb7')]['id']}})[_0xd031('0x27')](handleEntityNotFound(_0xf71805,null))[_0xd031('0x27')](function(_0x26d202){if(_0x26d202){_0x3e5e3a[_0xd031('0x43')]=_[_0xd031('0x3f')](db[_0xd031('0xbd')]['rawAttributes']);_0x3e5e3a['query']=_[_0xd031('0x3f')](_0x4fbfe3[_0xd031('0x40')]);_0x3e5e3a[_0xd031('0x41')]=_[_0xd031('0x42')](_0x3e5e3a[_0xd031('0x43')],_0x3e5e3a[_0xd031('0x40')]);_0x14710f[_0xd031('0x44')]=_[_0xd031('0x42')](_0x3e5e3a[_0xd031('0x43')],qs[_0xd031('0x45')](_0x4fbfe3[_0xd031('0x40')]['fields']));_0x14710f[_0xd031('0x44')]=_0x14710f[_0xd031('0x44')]['length']?_0x14710f[_0xd031('0x44')]:_0x3e5e3a[_0xd031('0x43')];if(!_0x4fbfe3[_0xd031('0x40')][_0xd031('0x47')](_0xd031('0xc1'))){_0x14710f['limit']=qs[_0xd031('0x21')](_0x4fbfe3[_0xd031('0x40')][_0xd031('0x21')]);_0x14710f[_0xd031('0x1e')]=qs['offset'](_0x4fbfe3[_0xd031('0x40')][_0xd031('0x1e')]);}_0x14710f[_0xd031('0x48')]=qs[_0xd031('0x49')](_0x4fbfe3['query'][_0xd031('0x49')]);_0x14710f[_0xd031('0x4a')]=qs[_0xd031('0x41')](_[_0xd031('0x4b')](_0x4fbfe3[_0xd031('0x40')],_0x3e5e3a[_0xd031('0x41')]));_0x14710f[_0xd031('0x4a')][_0xd031('0xb3')]=_0x26d202['id'];if(_0x4fbfe3[_0xd031('0x40')][_0xd031('0x88')]){_0x14710f[_0xd031('0x4a')]=_[_0xd031('0x9f')](_0x14710f[_0xd031('0x4a')],{'$or':_['map'](_0x14710f[_0xd031('0x44')],function(_0x1fd858){var _0x1f4e75={};_0x1f4e75[_0x1fd858]={'$like':'%'+_0x4fbfe3[_0xd031('0x40')]['filter']+'%'};return _0x1f4e75;})});}if(_0x4fbfe3[_0xd031('0x40')][_0xd031('0xc2')]){var _0x4c7f14=_0x4fbfe3[_0xd031('0x40')]['$gte']['split'](',');var _0x5c40f0={};_0x5c40f0[_0x4c7f14[0x0]]={'$gte':moment(_0x4c7f14[0x1])[_0xd031('0xc3')]('YYYY-MM-DD\x20HH:mm:ss')};_0x14710f[_0xd031('0x4a')]=_[_0xd031('0x9f')](_0x14710f[_0xd031('0x4a')],_0x5c40f0);}_0x14710f=_[_0xd031('0x9f')]({},_0x14710f,_0x4fbfe3[_0xd031('0xb9')]);return db[_0xd031('0xbd')][_0xd031('0x20')]({'where':_0x14710f[_0xd031('0x4a')]})['then'](function(_0x1ea1e1){_0x4c985a[_0xd031('0x20')]=_0x1ea1e1;if(_0x4fbfe3[_0xd031('0x40')][_0xd031('0xc4')]){_0x14710f['include']=[{'all':!![]}];}return db[_0xd031('0xbd')]['findAll'](_0x14710f);})[_0xd031('0x27')](function(_0x156cab){_0x4c985a[_0xd031('0xb5')]=_0x156cab;return _0x4c985a;});}})[_0xd031('0x27')](respondWithFilteredResult(_0xf71805,_0x14710f))[_0xd031('0x33')](handleError(_0xf71805,null));};exports[_0xd031('0xc5')]=function(_0x438fd6,_0x7bb803,_0x4e774b){return db[_0xd031('0x3c')][_0xd031('0x78')]({'where':{'id':_0x438fd6['params']['id']}})[_0xd031('0x27')](handleEntityNotFound(_0x7bb803,null))[_0xd031('0x27')](function(_0x1c4348){if(_0x1c4348){return _0x1c4348[_0xd031('0xc6')](_0x438fd6[_0xd031('0x79')][_0xd031('0xbe')],_[_0xd031('0xbf')](_0x438fd6[_0xd031('0x79')],['ids','id'])||{})['spread'](function(){return db['Tag']['findAll']({'attributes':['id',_0xd031('0x2b'),_0xd031('0x4e')],'where':{'id':_0x438fd6[_0xd031('0x79')][_0xd031('0xbe')]}});})[_0xd031('0x27')](function(_0x12fe95){socket['emit'](_0xd031('0xc7'),{'id':Number(_0x438fd6[_0xd031('0xb7')]['id']),'tags':_0x12fe95||[]});return{'id':Number(_0x438fd6[_0xd031('0xb7')]['id']),'tags':_0x12fe95||[]};});}})[_0xd031('0x27')](respondWithResult(_0x7bb803,null))['catch'](handleError(_0x7bb803,null));};exports[_0xd031('0xc8')]=function(_0x10fcb6,_0x3b4553,_0x153d47){return db[_0xd031('0x3c')][_0xd031('0x78')]({'where':{'id':_0x10fcb6[_0xd031('0xb7')]['id']}})[_0xd031('0x27')](handleEntityNotFound(_0x3b4553,null))[_0xd031('0x27')](function(_0x533da2){if(_0x533da2){return _0x533da2['removeTags'](_0x10fcb6[_0xd031('0x40')][_0xd031('0xbe')]);}})['then'](respondWithStatusCode(_0x3b4553,null))[_0xd031('0x33')](handleError(_0x3b4553,null));};exports[_0xd031('0xc9')]=function(_0x24c258,_0x6e1372){var _0x3b3c6e=moment()[_0xd031('0xca')]()[_0xd031('0x9d')]();var _0x37dbcb=path['join'](config[_0xd031('0xcb')],_0xd031('0xcc'),'files','tmp');var _0x3229ad=path[_0xd031('0xcd')](config['root'],_0xd031('0xcc'),_0xd031('0xce'),'attachments');var _0x340591=path[_0xd031('0xcd')](_0x37dbcb,_0x3b3c6e);var _0x9fe990=util[_0xd031('0xc3')](_0xd031('0xcf'),_0x24c258[_0xd031('0xb7')]['id'],_0x3b3c6e);var _0x24aeb4=path[_0xd031('0xcd')](_0x37dbcb,_0x9fe990);var _0x371917=[];_0x371917[_0xd031('0x32')]({'model':db[_0xd031('0xd0')],'as':'Attachment','raw':!![]});var _0x5e530c=[{'model':db[_0xd031('0xbd')],'as':_0xd031('0xd1'),'attributes':['id',_0xd031('0x79'),_0xd031('0x7d')],'include':_0x371917}];return db[_0xd031('0x3c')][_0xd031('0x78')]({'where':{'id':_0x24c258[_0xd031('0xb7')]['id']},'include':_0x5e530c})[_0xd031('0x27')](handleEntityNotFound(_0x6e1372,null))[_0xd031('0x27')](function(_0x4c2267){if(_0x4c2267&&_0x4c2267[_0xd031('0xd1')]){var _0xc19bd6=_0x4c2267[_0xd031('0xd2')]({'plain':!![]});fs[_0xd031('0xd3')](_0x340591);for(var _0x450b64=0x0;_0x450b64<_0xc19bd6['Messages']['length'];_0x450b64++){var _0x408aec=_0xc19bd6['Messages'][_0x450b64][_0xd031('0xd0')];if(_0x408aec){var _0x40c02e=path[_0xd031('0xcd')](_0x3229ad,_0x408aec[_0xd031('0xd4')]);if(fs[_0xd031('0xd5')](_0x40c02e)){fs[_0xd031('0xd6')](_0x40c02e)['pipe'](fs[_0xd031('0xd7')](path[_0xd031('0xcd')](_0x340591,_0x408aec[_0xd031('0xd4')])));}}}return BPromise[_0xd031('0x95')]()[_0xd031('0x27')](function(){return new BPromise(function(_0x5773e0,_0x48e5e3){zipdir(_0x340591,{'saveTo':_0x24aeb4},function(_0x1453dc,_0x2f3405){if(_0x1453dc)return _0x48e5e3(_0x1453dc);return _0x5773e0(_0x2f3405);});})[_0xd031('0x27')](function(){return new BPromise(function(_0x311e19,_0x58f79f){rimraf(_0x340591,function(_0x4f5133){if(_0x4f5133)_0x58f79f(_0x4f5133);return _0x311e19();});});})[_0xd031('0x27')](function(){return _0x6e1372[_0xd031('0xc9')](_0x24aeb4,_0x9fe990,function(_0x41f6f9){if(_0x41f6f9){console[_0xd031('0xd8')](_0xd031('0xd9'),_0x41f6f9);}else{fs[_0xd031('0xda')](_0x24aeb4);}});});});}else{return _0x6e1372['sendStatus'](0xc8);}})[_0xd031('0x33')](handleError(_0x6e1372,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index c887349..b4091e3 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 _0xddb4=['FaxInteraction','FaxMessage','save','update','remove','map','findAll','setDataValue','unreadMessages','emit','hook','exports'];(function(_0x200561,_0x39a526){var _0x587ab4=function(_0x5d30da){while(--_0x5d30da){_0x200561['push'](_0x200561['shift']());}};_0x587ab4(++_0x39a526);}(_0xddb4,0x108));var _0x4ddb=function(_0x4695e2,_0x3d5f15){_0x4695e2=_0x4695e2-0x0;var _0x160563=_0xddb4[_0x4695e2];return _0x160563;};'use strict';var EventEmitter=require('events');var FaxInteraction=require('../../mysqldb')['db'][_0x4ddb('0x0')];var FaxMessage=require('../../mysqldb')['db'][_0x4ddb('0x1')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4ddb('0x2'),'afterUpdate':_0x4ddb('0x3'),'afterDestroy':_0x4ddb('0x4')};function emitEvent(_0x2d18bf){return function(_0x73b602,_0x450246,_0x4cf92a){_0x73b602['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x5ec968){_0x73b602['setDataValue']('Users',_0x5ec968[_0x4ddb('0x5')](function(_0x45355e){return{'id':_0x45355e['id']};}));return FaxMessage[_0x4ddb('0x6')]({'where':{'FaxInteractionId':_0x73b602['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x34b0a4){_0x73b602[_0x4ddb('0x7')](_0x4ddb('0x8'),_0x34b0a4['length']);FaxInteractionEvents[_0x4ddb('0x9')](_0x2d18bf+':'+_0x73b602['id'],_0x73b602);FaxInteractionEvents[_0x4ddb('0x9')](_0x2d18bf,_0x73b602);_0x4cf92a(null);})['catch'](_0x4cf92a(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0x4ddb('0xa')](e,emitEvent(event));}}module[_0x4ddb('0xb')]=FaxInteractionEvents; \ No newline at end of file +var _0xb954=['hasOwnProperty','events','FaxInteraction','../../mysqldb','FaxMessage','save','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit'];(function(_0x261616,_0x5836a1){var _0x439b18=function(_0x4478f3){while(--_0x4478f3){_0x261616['push'](_0x261616['shift']());}};_0x439b18(++_0x5836a1);}(_0xb954,0x91));var _0x4b95=function(_0x3cebff,_0x20b43d){_0x3cebff=_0x3cebff-0x0;var _0x6e5423=_0xb954[_0x3cebff];return _0x6e5423;};'use strict';var EventEmitter=require(_0x4b95('0x0'));var FaxInteraction=require('../../mysqldb')['db'][_0x4b95('0x1')];var FaxMessage=require(_0x4b95('0x2'))['db'][_0x4b95('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4b95('0x4'),'afterUpdate':'update','afterDestroy':_0x4b95('0x5')};function emitEvent(_0x3438bf){return function(_0x462ee9,_0x3a48ee,_0x449869){_0x462ee9[_0x4b95('0x6')]({'attributes':['id'],'raw':!![]})[_0x4b95('0x7')](function(_0x4ad36f){_0x462ee9[_0x4b95('0x8')](_0x4b95('0x9'),_0x4ad36f[_0x4b95('0xa')](function(_0x35423c){return{'id':_0x35423c['id']};}));return FaxMessage[_0x4b95('0xb')]({'where':{'FaxInteractionId':_0x462ee9['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4b95('0x7')](function(_0x5e4080){_0x462ee9[_0x4b95('0x8')](_0x4b95('0xc'),_0x5e4080[_0x4b95('0xd')]);FaxInteractionEvents[_0x4b95('0xe')](_0x3438bf+':'+_0x462ee9['id'],_0x462ee9);FaxInteractionEvents[_0x4b95('0xe')](_0x3438bf,_0x462ee9);_0x449869(null);})['catch'](_0x449869(null));};}for(var e in events){if(events[_0x4b95('0xf')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 2ad3734..b69b5a5 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 _0x9d6f=['../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./faxInteraction.attributes','define','fax_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util'];(function(_0x4f1a69,_0x88be26){var _0x269f35=function(_0x128ac8){while(--_0x128ac8){_0x4f1a69['push'](_0x4f1a69['shift']());}};_0x269f35(++_0x88be26);}(_0x9d6f,0x12e));var _0xf9d6=function(_0x3242de,_0x31a176){_0x3242de=_0x3242de-0x0;var _0x15aa8f=_0x9d6f[_0x3242de];return _0x15aa8f;};'use strict';var _=require(_0xf9d6('0x0'));var util=require(_0xf9d6('0x1'));var logger=require(_0xf9d6('0x2'))('api');var moment=require(_0xf9d6('0x3'));var BPromise=require(_0xf9d6('0x4'));var rp=require(_0xf9d6('0x5'));var fs=require('fs');var path=require(_0xf9d6('0x6'));var rimraf=require('rimraf');var config=require(_0xf9d6('0x7'));var attributes=require(_0xf9d6('0x8'));module['exports']=function(_0x8e12c,_0x2008c3){return _0x8e12c[_0xf9d6('0x9')]('FaxInteraction',attributes,{'tableName':_0xf9d6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x543220,_0x329397,_0x4ca0d9){if(_0x543220[_0xf9d6('0xb')](_0xf9d6('0xc'))){_0x543220[_0xf9d6('0xd')]=moment()[_0xf9d6('0xe')](_0xf9d6('0xf'));}_0x4ca0d9(null,_0x543220);}}});}; \ No newline at end of file +var _0xa98b=['changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions'];(function(_0x31a939,_0x21b627){var _0x59704f=function(_0x21fd4d){while(--_0x21fd4d){_0x31a939['push'](_0x31a939['shift']());}};_0x59704f(++_0x21b627);}(_0xa98b,0x158));var _0xba98=function(_0x14e62e,_0x6f3d4a){_0x14e62e=_0x14e62e-0x0;var _0x8a248=_0xa98b[_0x14e62e];return _0x8a248;};'use strict';var _=require(_0xba98('0x0'));var util=require('util');var logger=require(_0xba98('0x1'))(_0xba98('0x2'));var moment=require(_0xba98('0x3'));var BPromise=require(_0xba98('0x4'));var rp=require(_0xba98('0x5'));var fs=require('fs');var path=require(_0xba98('0x6'));var rimraf=require(_0xba98('0x7'));var config=require('../../config/environment');var attributes=require(_0xba98('0x8'));module[_0xba98('0x9')]=function(_0x3f5553,_0x3357ed){return _0x3f5553[_0xba98('0xa')](_0xba98('0xb'),attributes,{'tableName':_0xba98('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x32f1fe,_0x2d6fb8,_0xebb729){if(_0x32f1fe[_0xba98('0xd')](_0xba98('0xe'))){_0x32f1fe['closedAt']=moment()[_0xba98('0xf')](_0xba98('0x10'));}_0xebb729(null,_0x32f1fe);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index cd6f1e3..43d89bd 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 _0xbffa=['socket.io-emitter','./faxInteraction.socket','register','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateFaxInteraction','FaxInteraction','body','options','raw','where','attributes','limit','catch','AddTagsToFaxInteraction','find','addTags','omit','ids','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x15e055,_0x4d13d7){var _0x4959e4=function(_0x1be37c){while(--_0x1be37c){_0x15e055['push'](_0x15e055['shift']());}};_0x4959e4(++_0x4d13d7);}(_0xbffa,0x186));var _0xabff=function(_0x4fe601,_0x2d9f72){_0x4fe601=_0x4fe601-0x0;var _0x2b7333=_0xbffa[_0x4fe601];return _0x2b7333;};'use strict';var _=require(_0xabff('0x0'));var util=require(_0xabff('0x1'));var moment=require('moment');var BPromise=require(_0xabff('0x2'));var rs=require(_0xabff('0x3'));var fs=require('fs');var Redis=require(_0xabff('0x4'));var db=require(_0xabff('0x5'))['db'];var utils=require(_0xabff('0x6'));var logger=require(_0xabff('0x7'))('rpc');var config=require(_0xabff('0x8'));var jayson=require(_0xabff('0x9'));var client=jayson[_0xabff('0xa')][_0xabff('0xb')]({'port':0x232a});config[_0xabff('0xc')]=_[_0xabff('0xd')](config[_0xabff('0xc')],{'host':_0xabff('0xe'),'port':0x18eb});var socket=require(_0xabff('0xf'))(new Redis(config[_0xabff('0xc')]));require(_0xabff('0x10'))[_0xabff('0x11')](socket);function respondWithRpcPromise(_0x367605,_0x43617b,_0x564e7b){return new BPromise(function(_0xe0f854,_0x4803bb){return client['request'](_0x367605,_0x564e7b)[_0xabff('0x12')](function(_0x70e57b){logger[_0xabff('0x13')](_0xabff('0x14'),_0x43617b,_0xabff('0x15'));logger[_0xabff('0x16')](_0xabff('0x17'),_0x43617b,_0xabff('0x15'),JSON[_0xabff('0x18')](_0x70e57b));if(_0x70e57b[_0xabff('0x19')]){if(_0x70e57b[_0xabff('0x19')][_0xabff('0x1a')]===0x1f4){logger[_0xabff('0x19')](_0xabff('0x14'),_0x43617b,_0x70e57b[_0xabff('0x19')][_0xabff('0x1b')]);return _0x4803bb(_0x70e57b[_0xabff('0x19')][_0xabff('0x1b')]);}logger['error'](_0xabff('0x14'),_0x43617b,_0x70e57b['error'][_0xabff('0x1b')]);return _0xe0f854(_0x70e57b[_0xabff('0x19')][_0xabff('0x1b')]);}else{logger['info'](_0xabff('0x14'),_0x43617b,_0xabff('0x15'));_0xe0f854(_0x70e57b[_0xabff('0x1c')][_0xabff('0x1b')]);}})['catch'](function(_0x4927e1){logger['error'](_0xabff('0x14'),_0x43617b,_0x4927e1);_0x4803bb(_0x4927e1);});});}exports[_0xabff('0x1d')]=function(_0x4598ea){var _0x33cfb1=this;return new Promise(function(_0x29af1a,_0x37a08b){return db[_0xabff('0x1e')]['update'](_0x4598ea[_0xabff('0x1f')],{'raw':_0x4598ea['options']?_0x4598ea[_0xabff('0x20')][_0xabff('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4598ea[_0xabff('0x20')]?_0x4598ea[_0xabff('0x20')][_0xabff('0x22')]||null:null,'attributes':_0x4598ea['options']?_0x4598ea[_0xabff('0x20')][_0xabff('0x23')]||null:null,'limit':_0x4598ea[_0xabff('0x20')]?_0x4598ea[_0xabff('0x20')][_0xabff('0x24')]||null:null})['then'](function(_0x4f61fc){logger[_0xabff('0x13')](_0xabff('0x1d'),_0x4598ea);logger[_0xabff('0x16')]('UpdateFaxInteraction',_0x4598ea,JSON[_0xabff('0x18')](_0x4f61fc));_0x29af1a(_0x4f61fc);})[_0xabff('0x25')](function(_0x21198f){logger[_0xabff('0x19')](_0xabff('0x1d'),_0x21198f['message'],_0x4598ea);_0x37a08b(_0x33cfb1[_0xabff('0x19')](0x1f4,_0x21198f[_0xabff('0x1b')]));});});};exports[_0xabff('0x26')]=function(_0x55fa44){return new Promise(function(_0x42ccf7,_0x4da880){return db[_0xabff('0x1e')][_0xabff('0x27')]({'where':_0x55fa44[_0xabff('0x20')]?_0x55fa44['options'][_0xabff('0x22')]||null:null})[_0xabff('0x12')](function(_0x5e00d6){if(_0x5e00d6){return _0x5e00d6[_0xabff('0x28')](_0x55fa44['body']['ids'],_[_0xabff('0x29')](_0x55fa44[_0xabff('0x1f')],[_0xabff('0x2a'),'id'])||{});}})[_0xabff('0x2b')](function(_0x268148){logger[_0xabff('0x13')](_0xabff('0x2c'),_0x55fa44);logger[_0xabff('0x16')](_0xabff('0x2c'),_0x55fa44,JSON[_0xabff('0x18')](_0x268148));_0x42ccf7(_0x268148);})[_0xabff('0x25')](function(_0x304002){logger[_0xabff('0x19')]('AddTags',_0x304002[_0xabff('0x1b')],_0x55fa44);_0x4da880(_this[_0xabff('0x19')](0x1f4,_0x304002[_0xabff('0x1b')]));});});}; \ No newline at end of file +var _0x67b6=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','./faxInteraction.socket','request','then','FaxInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','FaxInteraction','update','body','options','limit','UpdateFaxInteraction','AddTagsToFaxInteraction','find','where','addTags','ids','omit','debug','AddTags','lodash'];(function(_0x36eb0b,_0x627157){var _0x23b67d=function(_0x11302f){while(--_0x11302f){_0x36eb0b['push'](_0x36eb0b['shift']());}};_0x23b67d(++_0x627157);}(_0x67b6,0xf5));var _0x667b=function(_0xd61337,_0x24720d){_0xd61337=_0xd61337-0x0;var _0x4bf71a=_0x67b6[_0xd61337];return _0x4bf71a;};'use strict';var _=require(_0x667b('0x0'));var util=require('util');var moment=require(_0x667b('0x1'));var BPromise=require(_0x667b('0x2'));var rs=require(_0x667b('0x3'));var fs=require('fs');var Redis=require(_0x667b('0x4'));var db=require(_0x667b('0x5'))['db'];var utils=require(_0x667b('0x6'));var logger=require(_0x667b('0x7'))(_0x667b('0x8'));var config=require(_0x667b('0x9'));var jayson=require(_0x667b('0xa'));var client=jayson['client'][_0x667b('0xb')]({'port':0x232a});config['redis']=_[_0x667b('0xc')](config[_0x667b('0xd')],{'host':_0x667b('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x667b('0xf'))['register'](socket);function respondWithRpcPromise(_0xab5e32,_0x895a32,_0x33718b){return new BPromise(function(_0x2e5624,_0x164210){return client[_0x667b('0x10')](_0xab5e32,_0x33718b)[_0x667b('0x11')](function(_0xf4905b){logger['info'](_0x667b('0x12'),_0x895a32,_0x667b('0x13'));logger['debug']('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x895a32,_0x667b('0x13'),JSON[_0x667b('0x14')](_0xf4905b));if(_0xf4905b[_0x667b('0x15')]){if(_0xf4905b[_0x667b('0x15')][_0x667b('0x16')]===0x1f4){logger['error'](_0x667b('0x12'),_0x895a32,_0xf4905b['error'][_0x667b('0x17')]);return _0x164210(_0xf4905b[_0x667b('0x15')][_0x667b('0x17')]);}logger['error'](_0x667b('0x12'),_0x895a32,_0xf4905b['error'][_0x667b('0x17')]);return _0x2e5624(_0xf4905b[_0x667b('0x15')][_0x667b('0x17')]);}else{logger[_0x667b('0x18')]('FaxInteraction,\x20%s,\x20%s',_0x895a32,'request\x20sent');_0x2e5624(_0xf4905b[_0x667b('0x19')][_0x667b('0x17')]);}})[_0x667b('0x1a')](function(_0x4ab29c){logger[_0x667b('0x15')](_0x667b('0x12'),_0x895a32,_0x4ab29c);_0x164210(_0x4ab29c);});});}exports['UpdateFaxInteraction']=function(_0x151541){var _0x3acb51=this;return new Promise(function(_0x16e481,_0x12f08d){return db[_0x667b('0x1b')][_0x667b('0x1c')](_0x151541[_0x667b('0x1d')],{'raw':_0x151541['options']?_0x151541[_0x667b('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x151541[_0x667b('0x1e')]?_0x151541['options']['where']||null:null,'attributes':_0x151541[_0x667b('0x1e')]?_0x151541[_0x667b('0x1e')]['attributes']||null:null,'limit':_0x151541[_0x667b('0x1e')]?_0x151541[_0x667b('0x1e')][_0x667b('0x1f')]||null:null})[_0x667b('0x11')](function(_0x4849f1){logger[_0x667b('0x18')](_0x667b('0x20'),_0x151541);logger['debug'](_0x667b('0x20'),_0x151541,JSON[_0x667b('0x14')](_0x4849f1));_0x16e481(_0x4849f1);})[_0x667b('0x1a')](function(_0x4700e4){logger['error']('UpdateFaxInteraction',_0x4700e4[_0x667b('0x17')],_0x151541);_0x12f08d(_0x3acb51[_0x667b('0x15')](0x1f4,_0x4700e4['message']));});});};exports[_0x667b('0x21')]=function(_0xc68de3){return new Promise(function(_0x1403d8,_0x5be461){return db[_0x667b('0x1b')][_0x667b('0x22')]({'where':_0xc68de3[_0x667b('0x1e')]?_0xc68de3[_0x667b('0x1e')][_0x667b('0x23')]||null:null})[_0x667b('0x11')](function(_0x31ea74){if(_0x31ea74){return _0x31ea74[_0x667b('0x24')](_0xc68de3['body'][_0x667b('0x25')],_[_0x667b('0x26')](_0xc68de3['body'],['ids','id'])||{});}})['spread'](function(_0x178ce8){logger[_0x667b('0x18')]('AddTags',_0xc68de3);logger[_0x667b('0x27')]('AddTags',_0xc68de3,JSON['stringify'](_0x178ce8));_0x1403d8(_0x178ce8);})['catch'](function(_0x3b2724){logger[_0x667b('0x15')](_0x667b('0x28'),_0x3b2724[_0x667b('0x17')],_0xc68de3);_0x5be461(_this[_0x667b('0x15')](0x1f4,_0x3b2724[_0x667b('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 1eec369..5225df6 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 _0x2ba0=['./faxInteraction.events','update','register','length'];(function(_0x35e25c,_0x301f23){var _0x5266c6=function(_0x2d4330){while(--_0x2d4330){_0x35e25c['push'](_0x35e25c['shift']());}};_0x5266c6(++_0x301f23);}(_0x2ba0,0x138));var _0x02ba=function(_0x2e4309,_0x2d0290){_0x2e4309=_0x2e4309-0x0;var _0x8c3f43=_0x2ba0[_0x2e4309];return _0x8c3f43;};'use strict';var FaxInteractionEvents=require(_0x02ba('0x0'));var events=['save','remove',_0x02ba('0x1')];function createListener(_0x47c53b,_0x12f7f6){return function(_0x431926){_0x12f7f6['emit'](_0x47c53b,_0x431926);};}function removeListener(_0x194011,_0x59709c){return function(){FaxInteractionEvents['removeListener'](_0x194011,_0x59709c);};}exports[_0x02ba('0x2')]=function(_0x5b1726){for(var _0x1a8f82=0x0,_0x480532=events[_0x02ba('0x3')];_0x1a8f82<_0x480532;_0x1a8f82++){var _0x299f4c=events[_0x1a8f82];var _0x1eccf3=createListener('faxInteraction:'+_0x299f4c,_0x5b1726);FaxInteractionEvents['on'](_0x299f4c,_0x1eccf3);}}; \ No newline at end of file +var _0x7f99=['remove','update','emit','length','faxInteraction:','./faxInteraction.events'];(function(_0x44e1fb,_0x153e6c){var _0x4b57fb=function(_0x298f0c){while(--_0x298f0c){_0x44e1fb['push'](_0x44e1fb['shift']());}};_0x4b57fb(++_0x153e6c);}(_0x7f99,0x1c1));var _0x97f9=function(_0x90ba39,_0x2200a8){_0x90ba39=_0x90ba39-0x0;var _0x575f98=_0x7f99[_0x90ba39];return _0x575f98;};'use strict';var FaxInteractionEvents=require(_0x97f9('0x0'));var events=['save',_0x97f9('0x1'),_0x97f9('0x2')];function createListener(_0x3cb22e,_0x24ab4a){return function(_0x434d0a){_0x24ab4a[_0x97f9('0x3')](_0x3cb22e,_0x434d0a);};}function removeListener(_0x18b331,_0x4c74f4){return function(){FaxInteractionEvents['removeListener'](_0x18b331,_0x4c74f4);};}exports['register']=function(_0x59931c){for(var _0x63df6c=0x0,_0x4e5e10=events[_0x97f9('0x4')];_0x63df6c<_0x4e5e10;_0x63df6c++){var _0x2d2403=events[_0x63df6c];var _0x42607c=createListener(_0x97f9('0x5')+_0x2d2403,_0x59931c);FaxInteractionEvents['on'](_0x2d2403,_0x42607c);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 505a024..e580b27 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 _0xad71=['update','delete','faxinteraction:destroy','destroy','removeTags','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','index','isAuthenticated','describe','show','/:id/messages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','fax','addTags','/:id','faxinteraction:update'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xad71,0x185));var _0x1ad7=function(_0x1a156d,_0x3009f3){_0x1a156d=_0x1a156d-0x0;var _0x1c1969=_0xad71[_0x1a156d];return _0x1c1969;};'use strict';var multer=require(_0x1ad7('0x0'));var util=require(_0x1ad7('0x1'));var path=require(_0x1ad7('0x2'));var timeout=require(_0x1ad7('0x3'));var express=require(_0x1ad7('0x4'));var router=express['Router']();var fs_extra=require(_0x1ad7('0x5'));var auth=require(_0x1ad7('0x6'));var interaction=require(_0x1ad7('0x7'));var config=require(_0x1ad7('0x8'));var controller=require(_0x1ad7('0x9'));router[_0x1ad7('0xa')]('/',auth['isAuthenticated'](),controller[_0x1ad7('0xb')]);router[_0x1ad7('0xa')]('/describe',auth[_0x1ad7('0xc')](),controller[_0x1ad7('0xd')]);router[_0x1ad7('0xa')]('/:id',auth[_0x1ad7('0xc')](),controller[_0x1ad7('0xe')]);router[_0x1ad7('0xa')](_0x1ad7('0xf'),auth[_0x1ad7('0xc')](),controller['getMessages']);router[_0x1ad7('0xa')](_0x1ad7('0x10'),auth[_0x1ad7('0xc')](),controller[_0x1ad7('0x11')]);router[_0x1ad7('0x12')]('/',auth[_0x1ad7('0xc')](),controller[_0x1ad7('0x13')]);router['post']('/:id/messages',auth[_0x1ad7('0xc')](),controller[_0x1ad7('0x14')]);router[_0x1ad7('0x12')](_0x1ad7('0x15'),auth[_0x1ad7('0xc')](),interaction[_0x1ad7('0x16')](_0x1ad7('0x17'),'faxinteraction:addtags'),controller[_0x1ad7('0x18')]);router['put'](_0x1ad7('0x19'),auth['isAuthenticated'](),interaction['tracked'](_0x1ad7('0x17'),_0x1ad7('0x1a')),controller[_0x1ad7('0x1b')]);router[_0x1ad7('0x1c')](_0x1ad7('0x19'),auth[_0x1ad7('0xc')](),interaction['tracked'](_0x1ad7('0x17'),_0x1ad7('0x1d')),controller[_0x1ad7('0x1e')]);router[_0x1ad7('0x1c')](_0x1ad7('0x15'),auth[_0x1ad7('0xc')](),controller[_0x1ad7('0x1f')]);module['exports']=router; \ No newline at end of file +var _0x7588=['faxinteraction:addtags','addTags','put','/:id','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','removeTags','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','fax'];(function(_0x2f28e1,_0x316662){var _0x13e922=function(_0x3051c6){while(--_0x3051c6){_0x2f28e1['push'](_0x2f28e1['shift']());}};_0x13e922(++_0x316662);}(_0x7588,0x97));var _0x8758=function(_0x18ff91,_0x29f80a){_0x18ff91=_0x18ff91-0x0;var _0x453605=_0x7588[_0x18ff91];return _0x453605;};'use strict';var multer=require(_0x8758('0x0'));var util=require(_0x8758('0x1'));var path=require(_0x8758('0x2'));var timeout=require('connect-timeout');var express=require(_0x8758('0x3'));var router=express[_0x8758('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8758('0x5'));var interaction=require(_0x8758('0x6'));var config=require('../../config/environment');var controller=require(_0x8758('0x7'));router[_0x8758('0x8')]('/',auth[_0x8758('0x9')](),controller[_0x8758('0xa')]);router[_0x8758('0x8')](_0x8758('0xb'),auth['isAuthenticated'](),controller[_0x8758('0xc')]);router['get']('/:id',auth[_0x8758('0x9')](),controller[_0x8758('0xd')]);router[_0x8758('0x8')](_0x8758('0xe'),auth[_0x8758('0x9')](),controller[_0x8758('0xf')]);router[_0x8758('0x8')](_0x8758('0x10'),auth[_0x8758('0x9')](),controller[_0x8758('0x11')]);router[_0x8758('0x12')]('/',auth['isAuthenticated'](),controller[_0x8758('0x13')]);router[_0x8758('0x12')](_0x8758('0xe'),auth[_0x8758('0x9')](),controller[_0x8758('0x14')]);router['post'](_0x8758('0x15'),auth[_0x8758('0x9')](),interaction[_0x8758('0x16')](_0x8758('0x17'),_0x8758('0x18')),controller[_0x8758('0x19')]);router[_0x8758('0x1a')](_0x8758('0x1b'),auth[_0x8758('0x9')](),interaction[_0x8758('0x16')]('fax',_0x8758('0x1c')),controller[_0x8758('0x1d')]);router[_0x8758('0x1e')](_0x8758('0x1b'),auth['isAuthenticated'](),interaction[_0x8758('0x16')]('fax',_0x8758('0x1f')),controller[_0x8758('0x20')]);router['delete'](_0x8758('0x15'),auth[_0x8758('0x9')](),controller[_0x8758('0x21')]);module[_0x8758('0x22')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 8bf6fe5..8cb56eb 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 _0xd382=['TEXT','medium','BOOLEAN','ENUM','out','DATE','sequelize','exports'];(function(_0x290c29,_0xe54d31){var _0x4e4548=function(_0x2de16f){while(--_0x2de16f){_0x290c29['push'](_0x290c29['shift']());}};_0x4e4548(++_0xe54d31);}(_0xd382,0x1b6));var _0x2d38=function(_0x8b0068,_0x311e26){_0x8b0068=_0x8b0068-0x0;var _0x6169d6=_0xd382[_0x8b0068];return _0x6169d6;};'use strict';var Sequelize=require(_0x2d38('0x0'));module[_0x2d38('0x1')]={'body':{'type':Sequelize[_0x2d38('0x2')](_0x2d38('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x2d38('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x2d38('0x5')]('in',_0x2d38('0x6')),'defaultValue':_0x2d38('0x6'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x2d38('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x2d38('0x7')]}}; \ No newline at end of file +var _0xd0bb=['exports','TEXT','BOOLEAN','out','DATE','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0xa90718,_0x2fd952){_0xa90718=_0xa90718-0x0;var _0x56ed79=_0xd0bb[_0xa90718];return _0x56ed79;};'use strict';var Sequelize=require(_0xbd0b('0x0'));module[_0xbd0b('0x1')]={'body':{'type':Sequelize[_0xbd0b('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xbd0b('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xbd0b('0x4')),'defaultValue':_0xbd0b('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0xbd0b('0x5')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index a4e0bc3..3b5eb7e 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 _0xf3a7=['type','VIRTUAL','includeAll','include','findAll','rows','show','params','merge','options','find','body','describe','fax','readAt','format','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','stringify','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','SELECT','contact','User','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','fax-interactions','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize','Sequelize','email','internal','rejectmessage','create','CmContact','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','files','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','redis','defaults','socket.io-emitter','./faxMessage.socket','register','jayson/promise','http','request','then','info','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','end','limit','undefined','count','offset','status','apply','reject','save','update','destroy','name','send','index','FaxMessage','rawAttributes','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter'];(function(_0x53b93b,_0x1bfab1){var _0x485761=function(_0x41592e){while(--_0x41592e){_0x53b93b['push'](_0x53b93b['shift']());}};_0x485761(++_0x1bfab1);}(_0xf3a7,0xd1));var _0x7f3a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf3a7[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x7f3a('0x0'));var rimraf=require(_0x7f3a('0x1'));var zipdir=require(_0x7f3a('0x2'));var jsonpatch=require(_0x7f3a('0x3'));var rp=require(_0x7f3a('0x4'));var moment=require(_0x7f3a('0x5'));var BPromise=require(_0x7f3a('0x6'));var Mustache=require(_0x7f3a('0x7'));var util=require('util');var path=require(_0x7f3a('0x8'));var sox=require('sox');var csv=require(_0x7f3a('0x9'));var ejs=require(_0x7f3a('0xa'));var fs=require('fs');var fs_extra=require(_0x7f3a('0xb'));var _=require('lodash');var squel=require(_0x7f3a('0xc'));var crypto=require(_0x7f3a('0xd'));var jsforce=require(_0x7f3a('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7f3a('0xf'));var Papa=require(_0x7f3a('0x10'));var Redis=require(_0x7f3a('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7f3a('0x12'));var hardwareService=require(_0x7f3a('0x13'));var logger=require(_0x7f3a('0x14'))('api');var utils=require(_0x7f3a('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x7f3a('0x16'));var db=require('../../mysqldb')['db'];config[_0x7f3a('0x17')]=_[_0x7f3a('0x18')](config[_0x7f3a('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x7f3a('0x19'))(new Redis(config[_0x7f3a('0x17')]));require(_0x7f3a('0x1a'))[_0x7f3a('0x1b')](socket);var jayson=require(_0x7f3a('0x1c'));var client=jayson['client'][_0x7f3a('0x1d')]({'port':0x232c});var client9002=jayson['client'][_0x7f3a('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x2968e2,_0x36b532,_0x5294f8,_0x521eac){return new BPromise(function(_0x47b46f,_0x1ee2f3){var _0x3b1fa6=_0x521eac||client;return _0x3b1fa6[_0x7f3a('0x1e')](_0x2968e2,_0x5294f8)[_0x7f3a('0x1f')](function(_0x28ff4e){logger[_0x7f3a('0x20')](_0x7f3a('0x21'),_0x36b532,'request\x20sent');logger[_0x7f3a('0x22')](_0x7f3a('0x23'),_0x36b532,_0x7f3a('0x24'),JSON['stringify'](_0x28ff4e));if(_0x28ff4e[_0x7f3a('0x25')]){if(_0x28ff4e[_0x7f3a('0x25')][_0x7f3a('0x26')]===0x1f4){logger[_0x7f3a('0x25')](_0x7f3a('0x21'),_0x36b532,_0x28ff4e[_0x7f3a('0x25')][_0x7f3a('0x27')]);return _0x1ee2f3(_0x28ff4e[_0x7f3a('0x25')][_0x7f3a('0x27')]);}logger[_0x7f3a('0x25')]('FaxMessage,\x20%s,\x20%s',_0x36b532,_0x28ff4e[_0x7f3a('0x25')][_0x7f3a('0x27')]);return _0x47b46f(_0x28ff4e['error'][_0x7f3a('0x27')]);}else{logger[_0x7f3a('0x20')]('FaxMessage,\x20%s,\x20%s',_0x36b532,_0x7f3a('0x24'));_0x47b46f(_0x28ff4e[_0x7f3a('0x28')][_0x7f3a('0x27')]);}})[_0x7f3a('0x29')](function(_0x43a124){logger[_0x7f3a('0x25')](_0x7f3a('0x21'),_0x36b532,_0x43a124);_0x1ee2f3(_0x43a124);});});}function respondWithStatusCode(_0x241a49,_0x2ab147){_0x2ab147=_0x2ab147||0xcc;return function(_0x123f24){if(_0x123f24){return _0x241a49[_0x7f3a('0x2a')](_0x2ab147);}return _0x241a49['status'](_0x2ab147)[_0x7f3a('0x2b')]();};}function respondWithResult(_0x7d5fbc,_0x114e54){_0x114e54=_0x114e54||0xc8;return function(_0x2663ea){if(_0x2663ea){return _0x7d5fbc['status'](_0x114e54)['json'](_0x2663ea);}};}function respondWithFilteredResult(_0x5e0ccf,_0x55fcbe){return function(_0x3eabb5){if(_0x3eabb5){var _0x931283=typeof _0x55fcbe['offset']==='undefined'&&typeof _0x55fcbe[_0x7f3a('0x2c')]===_0x7f3a('0x2d');var _0xf47051=_0x3eabb5[_0x7f3a('0x2e')];var _0xfd7b5f=_0x931283?0x0:_0x55fcbe[_0x7f3a('0x2f')];var _0x198ccd=_0x931283?_0x3eabb5[_0x7f3a('0x2e')]:_0x55fcbe[_0x7f3a('0x2f')]+_0x55fcbe[_0x7f3a('0x2c')];var _0x10dee4;if(_0x198ccd>=_0xf47051){_0x198ccd=_0xf47051;_0x10dee4=0xc8;}else{_0x10dee4=0xce;}_0x5e0ccf[_0x7f3a('0x30')](_0x10dee4);return _0x5e0ccf['set']('Content-Range',_0xfd7b5f+'-'+_0x198ccd+'/'+_0xf47051)['json'](_0x3eabb5);}return null;};}function patchUpdates(_0x5008cf){return function(_0x2a75b8){try{jsonpatch[_0x7f3a('0x31')](_0x2a75b8,_0x5008cf,!![]);}catch(_0x30fff7){return BPromise[_0x7f3a('0x32')](_0x30fff7);}return _0x2a75b8[_0x7f3a('0x33')]();};}function saveUpdates(_0x4776da,_0x3bd32a){return function(_0x22ff8e){if(_0x22ff8e){return _0x22ff8e[_0x7f3a('0x34')](_0x4776da)[_0x7f3a('0x1f')](function(_0x2d1c06){return _0x2d1c06;});}return null;};}function removeEntity(_0x3c0ee3,_0x23fdc7){return function(_0x1e1088){if(_0x1e1088){return _0x1e1088[_0x7f3a('0x35')]()[_0x7f3a('0x1f')](function(){_0x3c0ee3[_0x7f3a('0x30')](0xcc)[_0x7f3a('0x2b')]();});}};}function handleEntityNotFound(_0x201fe3,_0x17a199){return function(_0x1f3538){if(!_0x1f3538){_0x201fe3[_0x7f3a('0x2a')](0x194);}return _0x1f3538;};}function handleError(_0x46aa7c,_0x17b71f){_0x17b71f=_0x17b71f||0x1f4;return function(_0x18ade1){logger['error'](_0x18ade1['stack']);if(_0x18ade1[_0x7f3a('0x36')]){delete _0x18ade1['name'];}_0x46aa7c['status'](_0x17b71f)[_0x7f3a('0x37')](_0x18ade1);};}exports[_0x7f3a('0x38')]=function(_0x5513bf,_0x47c1b8){var _0x3ecc9d={},_0x31676b={},_0x2b2562={'count':0x0,'rows':[]};var _0x4a49cb=_['map'](db[_0x7f3a('0x39')][_0x7f3a('0x3a')],function(_0x10f89c){return{'name':_0x10f89c['fieldName'],'type':_0x10f89c['type']['key']};});_0x31676b[_0x7f3a('0x3b')]=_[_0x7f3a('0x3c')](_0x4a49cb,_0x7f3a('0x36'));_0x31676b[_0x7f3a('0x3d')]=_[_0x7f3a('0x3e')](_0x5513bf[_0x7f3a('0x3d')]);_0x31676b[_0x7f3a('0x3f')]=_[_0x7f3a('0x40')](_0x31676b[_0x7f3a('0x3b')],_0x31676b[_0x7f3a('0x3d')]);_0x3ecc9d[_0x7f3a('0x41')]=_[_0x7f3a('0x40')](_0x31676b[_0x7f3a('0x3b')],qs[_0x7f3a('0x42')](_0x5513bf[_0x7f3a('0x3d')]['fields']));_0x3ecc9d['attributes']=_0x3ecc9d[_0x7f3a('0x41')][_0x7f3a('0x43')]?_0x3ecc9d[_0x7f3a('0x41')]:_0x31676b[_0x7f3a('0x3b')];if(!_0x5513bf['query'][_0x7f3a('0x44')](_0x7f3a('0x45'))){_0x3ecc9d[_0x7f3a('0x2c')]=qs[_0x7f3a('0x2c')](_0x5513bf['query'][_0x7f3a('0x2c')]);_0x3ecc9d[_0x7f3a('0x2f')]=qs[_0x7f3a('0x2f')](_0x5513bf[_0x7f3a('0x3d')][_0x7f3a('0x2f')]);}_0x3ecc9d[_0x7f3a('0x46')]=qs[_0x7f3a('0x47')](_0x5513bf['query'][_0x7f3a('0x47')]);_0x3ecc9d[_0x7f3a('0x48')]=qs[_0x7f3a('0x3f')](_[_0x7f3a('0x49')](_0x5513bf[_0x7f3a('0x3d')],_0x31676b[_0x7f3a('0x3f')]),_0x4a49cb);if(_0x5513bf[_0x7f3a('0x3d')][_0x7f3a('0x4a')]){_0x3ecc9d[_0x7f3a('0x48')]=_['merge'](_0x3ecc9d[_0x7f3a('0x48')],{'$or':_[_0x7f3a('0x3c')](_0x4a49cb,function(_0x326b86){if(_0x326b86[_0x7f3a('0x4b')]!==_0x7f3a('0x4c')){var _0x13a9e1={};_0x13a9e1[_0x326b86[_0x7f3a('0x36')]]={'$like':'%'+_0x5513bf['query']['filter']+'%'};return _0x13a9e1;}})});}_0x3ecc9d=_['merge']({},_0x3ecc9d,_0x5513bf['options']);var _0x340eaa={'where':_0x3ecc9d['where']};return db[_0x7f3a('0x39')][_0x7f3a('0x2e')](_0x340eaa)[_0x7f3a('0x1f')](function(_0x30ff44){_0x2b2562[_0x7f3a('0x2e')]=_0x30ff44;if(_0x5513bf[_0x7f3a('0x3d')][_0x7f3a('0x4d')]){_0x3ecc9d[_0x7f3a('0x4e')]=[{'all':!![]}];}return db[_0x7f3a('0x39')][_0x7f3a('0x4f')](_0x3ecc9d);})[_0x7f3a('0x1f')](function(_0x4f49fb){_0x2b2562[_0x7f3a('0x50')]=_0x4f49fb;return _0x2b2562;})[_0x7f3a('0x1f')](respondWithFilteredResult(_0x47c1b8,_0x3ecc9d))['catch'](handleError(_0x47c1b8,null));};exports[_0x7f3a('0x51')]=function(_0x5d646d,_0x16a81d){var _0x5f30c0={'raw':!![],'where':{'id':_0x5d646d[_0x7f3a('0x52')]['id']}},_0x503524={};_0x503524['model']=_[_0x7f3a('0x3e')](db['FaxMessage'][_0x7f3a('0x3a')]);_0x503524['query']=_['keys'](_0x5d646d['query']);_0x503524['filters']=_['intersection'](_0x503524[_0x7f3a('0x3b')],_0x503524[_0x7f3a('0x3d')]);_0x5f30c0[_0x7f3a('0x41')]=_[_0x7f3a('0x40')](_0x503524['model'],qs[_0x7f3a('0x42')](_0x5d646d[_0x7f3a('0x3d')][_0x7f3a('0x42')]));_0x5f30c0[_0x7f3a('0x41')]=_0x5f30c0[_0x7f3a('0x41')][_0x7f3a('0x43')]?_0x5f30c0['attributes']:_0x503524['model'];if(_0x5d646d[_0x7f3a('0x3d')][_0x7f3a('0x4d')]){_0x5f30c0['include']=[{'all':!![]}];}_0x5f30c0=_[_0x7f3a('0x53')]({},_0x5f30c0,_0x5d646d[_0x7f3a('0x54')]);return db['FaxMessage'][_0x7f3a('0x55')](_0x5f30c0)[_0x7f3a('0x1f')](handleEntityNotFound(_0x16a81d,null))[_0x7f3a('0x1f')](respondWithResult(_0x16a81d,null))['catch'](handleError(_0x16a81d,null));};exports[_0x7f3a('0x34')]=function(_0x3243a8,_0x52e438){if(_0x3243a8[_0x7f3a('0x56')]['id']){delete _0x3243a8[_0x7f3a('0x56')]['id'];}return db[_0x7f3a('0x39')]['find']({'where':{'id':_0x3243a8[_0x7f3a('0x52')]['id']}})[_0x7f3a('0x1f')](handleEntityNotFound(_0x52e438,null))[_0x7f3a('0x1f')](saveUpdates(_0x3243a8['body'],null))['then'](respondWithResult(_0x52e438,null))['catch'](handleError(_0x52e438,null));};exports[_0x7f3a('0x35')]=function(_0x1f7ed4,_0x47bc14){return db[_0x7f3a('0x39')]['find']({'where':{'id':_0x1f7ed4[_0x7f3a('0x52')]['id']}})[_0x7f3a('0x1f')](handleEntityNotFound(_0x47bc14,null))[_0x7f3a('0x1f')](removeEntity(_0x47bc14,null))[_0x7f3a('0x29')](handleError(_0x47bc14,null));};exports[_0x7f3a('0x57')]=function(_0x2b6f50,_0x52d744){return db[_0x7f3a('0x39')][_0x7f3a('0x57')]()['then'](respondWithResult(_0x52d744,null))[_0x7f3a('0x29')](handleError(_0x52d744,null));};var interaction_log=require(_0x7f3a('0x14'))('fax-interactions');exports['accept']=function(_0x378a67,_0x2c1388,_0xf07743){var _0x2e2446={'agent':{},'channel':_0x7f3a('0x58')};if(_0x378a67[_0x7f3a('0x56')]['id']){delete _0x378a67[_0x7f3a('0x56')]['id'];}_0x378a67[_0x7f3a('0x56')]['read']=!![];_0x378a67['body'][_0x7f3a('0x59')]=moment()[_0x7f3a('0x5a')](_0x7f3a('0x5b'));_0x378a67[_0x7f3a('0x56')][_0x7f3a('0x5c')]=_0x378a67[_0x7f3a('0x56')][_0x7f3a('0x5c')]||_0x378a67[_0x7f3a('0x5d')]['id'];_0x2e2446[_0x7f3a('0x5e')]['id']=_0x378a67[_0x7f3a('0x56')][_0x7f3a('0x5c')];return db[_0x7f3a('0x39')]['find']({'where':{'id':_0x378a67[_0x7f3a('0x52')]['id'],'UserId':null}})[_0x7f3a('0x1f')](handleEntityNotFound(_0x2c1388,null))[_0x7f3a('0x1f')](saveUpdates(_0x378a67[_0x7f3a('0x56')],null))['then'](function(_0x3b254a){if(_0x3b254a){_0x2e2446[_0x7f3a('0x27')]=_0x3b254a[_0x7f3a('0x5f')]({'plain':!![]});return db[_0x7f3a('0x60')]['find']({'where':{'id':_0x3b254a[_0x7f3a('0x61')]}});}return null;})[_0x7f3a('0x1f')](handleEntityNotFound(_0x2c1388,null))[_0x7f3a('0x1f')](function(_0x17d079){if(_0x17d079){return _0x17d079['update']({'UserId':_0x378a67[_0x7f3a('0x56')][_0x7f3a('0x5c')],'read1stAt':_[_0x7f3a('0x62')](_0x17d079[_0x7f3a('0x63')])?moment()[_0x7f3a('0x5a')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x7f3a('0x1f')](function(_0x35780d){if(_0x35780d){_0x2e2446[_0x7f3a('0x64')]=_0x35780d[_0x7f3a('0x5f')]({'plain':!![]});interaction_log['info'](_0x7f3a('0x65'),_0x378a67['user']['id'],_0x378a67[_0x7f3a('0x5d')][_0x7f3a('0x36')],_0x378a67[_0x7f3a('0x5d')][_0x7f3a('0x66')],_0x2e2446[_0x7f3a('0x64')]['id'],_0x378a67[_0x7f3a('0x56')]?JSON[_0x7f3a('0x67')](_0x378a67[_0x7f3a('0x56')]):_0x7f3a('0x68'));return respondWithRpcPromise('AcceptMessage',_0x7f3a('0x69'),_0x2e2446);}return null;})[_0x7f3a('0x1f')](function(_0x11110b){var _0x1169d2=_0x7f3a('0x6a')+_0x11110b[_0x7f3a('0x27')][_0x7f3a('0x6b')];return db['sequelize']['query'](_0x1169d2,{'type':db['Sequelize'][_0x7f3a('0x6c')][_0x7f3a('0x6d')],'raw':!![]})[_0x7f3a('0x1f')](function(_0x481805){return _0x481805;});})[_0x7f3a('0x1f')](function(_0x4381b4){if(_0x4381b4){_0x2e2446['message'][_0x7f3a('0x6e')]=_0x4381b4[0x0];if(!_0x378a67[_0x7f3a('0x56')][_0x7f3a('0x5c')])return;return db[_0x7f3a('0x6f')][_0x7f3a('0x55')]({'where':{'id':_0x378a67[_0x7f3a('0x56')][_0x7f3a('0x5c')],'role':_0x7f3a('0x5e')},'attributes':['id',_0x7f3a('0x36'),'fullname','email','internal'],'raw':!![]});}return null;})[_0x7f3a('0x1f')](function(_0x2c1106){if(!_0x2c1106)return null;_0x2e2446[_0x7f3a('0x27')][_0x7f3a('0x5e')]=_0x2c1106;return _0x2e2446;})[_0x7f3a('0x1f')](function(_0x796c5f){if(_0x796c5f){if(_0x378a67[_0x7f3a('0x56')]['manual']){_0x2e2446[_0x7f3a('0x27')][_0x7f3a('0x70')]=util[_0x7f3a('0x5a')](_0x7f3a('0x71'),_0x378a67[_0x7f3a('0x5d')]['name']);_0x2e2446[_0x7f3a('0x27')][_0x7f3a('0x72')]=_0x2e2446[_0x7f3a('0x72')];_0x2e2446['message'][_0x7f3a('0x73')]=_0x2e2446['channel'];_0x2e2446[_0x7f3a('0x27')][_0x7f3a('0x74')]=_0x7f3a('0x75');return respondWithRpcPromise(_0x7f3a('0x76'),_0x7f3a('0x76'),{'event':_0x7f3a('0x77'),'message':_0x2e2446['message']},client9002)[_0x7f3a('0x1f')](function(){return _0x2e2446;});}return _0x2e2446;}return null;})[_0x7f3a('0x1f')](respondWithResult(_0x2c1388,null))[_0x7f3a('0x29')](handleError(_0x2c1388,null));};var interaction_log=require('../../config/logger')(_0x7f3a('0x78'));exports[_0x7f3a('0x32')]=function(_0x2d8091,_0x26d9cf,_0x2816d0){var _0x2e5fc6={'agent':{},'channel':_0x7f3a('0x58')};if(_0x2d8091[_0x7f3a('0x56')]['id']){delete _0x2d8091['body']['id'];}_0x2d8091['body']['UserId']=_0x2d8091['body'][_0x7f3a('0x5c')]||_0x2d8091[_0x7f3a('0x5d')]['id'];_0x2e5fc6[_0x7f3a('0x5e')]['id']=_0x2d8091['body']['UserId'];return db[_0x7f3a('0x39')][_0x7f3a('0x55')]({'where':{'id':_0x2d8091['params']['id'],'UserId':null}})[_0x7f3a('0x1f')](handleEntityNotFound(_0x26d9cf,null))[_0x7f3a('0x1f')](function(_0x1b70af){if(_0x1b70af){_0x2e5fc6[_0x7f3a('0x27')]=_0x1b70af['get']({'plain':!![]});return db[_0x7f3a('0x60')][_0x7f3a('0x55')]({'where':{'id':_0x1b70af['FaxInteractionId']}});}return null;})[_0x7f3a('0x1f')](handleEntityNotFound(_0x26d9cf,null))[_0x7f3a('0x1f')](function(_0xa9761b){if(_0xa9761b){_0x2e5fc6[_0x7f3a('0x64')]=_0xa9761b[_0x7f3a('0x5f')]({'plain':!![]});interaction_log['info'](_0x7f3a('0x79'),_0x2d8091[_0x7f3a('0x5d')]['id'],_0x2d8091[_0x7f3a('0x5d')][_0x7f3a('0x36')],_0x2d8091[_0x7f3a('0x5d')]['role'],_0x2e5fc6['interaction']['id'],_0x2d8091[_0x7f3a('0x56')]?JSON[_0x7f3a('0x67')](_0x2d8091[_0x7f3a('0x56')]):_0x7f3a('0x68'));return respondWithRpcPromise(_0x7f3a('0x7a'),_0x7f3a('0x7b'),_0x2e5fc6);}return null;})[_0x7f3a('0x1f')](function(_0x3f90e6){var _0x393a65=_0x7f3a('0x6a')+_0x3f90e6[_0x7f3a('0x27')][_0x7f3a('0x6b')];return db[_0x7f3a('0x7c')][_0x7f3a('0x3d')](_0x393a65,{'type':db[_0x7f3a('0x7d')][_0x7f3a('0x6c')][_0x7f3a('0x6d')],'raw':!![]})[_0x7f3a('0x1f')](function(_0x254f73){return _0x254f73;});})[_0x7f3a('0x1f')](function(_0x47c186){if(_0x47c186){_0x2e5fc6[_0x7f3a('0x27')]['contact']=_0x47c186[0x0];if(!_0x2d8091[_0x7f3a('0x56')]['UserId'])return;return db[_0x7f3a('0x6f')][_0x7f3a('0x55')]({'where':{'id':_0x2d8091[_0x7f3a('0x56')][_0x7f3a('0x5c')],'role':'agent'},'attributes':['id',_0x7f3a('0x36'),'fullname',_0x7f3a('0x7e'),_0x7f3a('0x7f')],'raw':!![]});}return null;})[_0x7f3a('0x1f')](function(_0x516f5f){if(!_0x516f5f)return null;_0x2e5fc6['message'][_0x7f3a('0x5e')]=_0x516f5f;return _0x2e5fc6;})[_0x7f3a('0x1f')](function(_0x51203f){if(_0x51203f){_0x51203f[_0x7f3a('0x27')][_0x7f3a('0x70')]=util[_0x7f3a('0x5a')](_0x7f3a('0x71'),_0x2d8091[_0x7f3a('0x5d')][_0x7f3a('0x36')]);_0x51203f[_0x7f3a('0x27')][_0x7f3a('0x72')]=_0x2e5fc6[_0x7f3a('0x72')];_0x51203f['message'][_0x7f3a('0x73')]=_0x2e5fc6[_0x7f3a('0x72')];_0x51203f['message']['event']=_0x7f3a('0x32');respondWithRpcPromise(_0x7f3a('0x76'),_0x7f3a('0x76'),{'event':_0x7f3a('0x80'),'message':_0x51203f[_0x7f3a('0x27')]},client9002);return _0x2e5fc6;}return null;})[_0x7f3a('0x1f')](respondWithResult(_0x26d9cf,null))['catch'](handleError(_0x26d9cf,null));};exports[_0x7f3a('0x81')]=function(_0xd62bc6,_0x1e64ad){var _0x44dfcb;return db['FaxMessage'][_0x7f3a('0x81')](_0xd62bc6['body'],{})[_0x7f3a('0x1f')](function(_0x2b9ac6){_0x44dfcb=_0x2b9ac6;return db[_0x7f3a('0x82')][_0x7f3a('0x83')]({'where':{'id':_0x44dfcb['ContactId']}});})[_0x7f3a('0x1f')](function(_0x446119){if(_[_0x7f3a('0x62')](_0x446119)){return;}else{_0x44dfcb[_0x7f3a('0x58')]=_0x446119[_0x7f3a('0x58')];return db[_0x7f3a('0x84')][_0x7f3a('0x83')]({'where':{'id':_0x44dfcb[_0x7f3a('0x85')]}});}})['then'](function(_0x2dfeb6){return respondWithRpcPromise(_0x7f3a('0x86'),'SendFax',{'FaxAccountId':_[_0x7f3a('0x62')](_0xd62bc6['body'])?undefined:_0xd62bc6[_0x7f3a('0x56')][_0x7f3a('0x87')],'path':_[_0x7f3a('0x62')](_0x2dfeb6)?undefined:util[_0x7f3a('0x5a')](_0x7f3a('0x88'),_0x2dfeb6[_0x7f3a('0x89')]),'fax':_[_0x7f3a('0x62')](_0x44dfcb['fax'])?undefined:_0x44dfcb[_0x7f3a('0x58')],'AttachmentId':_0x44dfcb[_0x7f3a('0x85')]},client9002);})['then'](respondWithResult(_0x1e64ad,0xc9))['catch'](handleError(_0x1e64ad,null));};exports[_0x7f3a('0x8a')]=function(_0x51b41a,_0x494741){var _0x1c4ba8=path[_0x7f3a('0x8b')](config[_0x7f3a('0x8c')],'server',_0x7f3a('0x8d'),'attachments');return db[_0x7f3a('0x39')]['find']({'where':{'id':_0x51b41a[_0x7f3a('0x52')]['id']},'include':[{'model':db['Attachment'],'as':_0x7f3a('0x84')}]})[_0x7f3a('0x1f')](handleEntityNotFound(_0x494741,null))['then'](function(_0x2e64f1){if(_0x2e64f1){return _0x494741[_0x7f3a('0x8a')](path[_0x7f3a('0x8b')](_0x1c4ba8,_0x2e64f1[_0x7f3a('0x84')][_0x7f3a('0x89')]));}})[_0x7f3a('0x29')](handleError(_0x494741,null));}; \ No newline at end of file +var _0xd2fe=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','catch','show','params','includeAll','update','body','find','destroy','describe','../../config/logger','fax-interactions','accept','read','readAt','format','UserId','user','agent','get','FaxInteraction','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','User','fullname','email','internal','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','FaxInteractionId','info','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','contact','interface','reject','create','CmContact','findOne','fax','AttachmentId','SendFax','isNil','/var/opt/motion2/server/files/attachments/%s','root','server','files','Attachment','basename','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','api','../../config/environment','../../mysqldb','redis','localhost','./faxMessage.socket','register','jayson/promise','client','http','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','name','send','FaxMessage','rawAttributes','fieldName','type','key','model','map','query','keys','filters'];(function(_0x434f0f,_0x322f70){var _0x1b444b=function(_0x185b05){while(--_0x185b05){_0x434f0f['push'](_0x434f0f['shift']());}};_0x1b444b(++_0x322f70);}(_0xd2fe,0xe2));var _0xed2f=function(_0x32a28a,_0xf2e800){_0x32a28a=_0x32a28a-0x0;var _0x40c032=_0xd2fe[_0x32a28a];return _0x40c032;};'use strict';var emlformat=require(_0xed2f('0x0'));var rimraf=require(_0xed2f('0x1'));var zipdir=require(_0xed2f('0x2'));var jsonpatch=require(_0xed2f('0x3'));var rp=require(_0xed2f('0x4'));var moment=require(_0xed2f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xed2f('0x6'));var util=require(_0xed2f('0x7'));var path=require(_0xed2f('0x8'));var sox=require(_0xed2f('0x9'));var csv=require(_0xed2f('0xa'));var ejs=require(_0xed2f('0xb'));var fs=require('fs');var fs_extra=require(_0xed2f('0xc'));var _=require(_0xed2f('0xd'));var squel=require(_0xed2f('0xe'));var crypto=require('crypto');var jsforce=require(_0xed2f('0xf'));var deskjs=require(_0xed2f('0x10'));var toCsv=require(_0xed2f('0xa'));var querystring=require('querystring');var Papa=require(_0xed2f('0x11'));var Redis=require(_0xed2f('0x12'));var authService=require(_0xed2f('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xed2f('0x14'));var utils=require('../../config/utils');var config=require(_0xed2f('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xed2f('0x16'))['db'];config[_0xed2f('0x17')]=_['defaults'](config[_0xed2f('0x17')],{'host':_0xed2f('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xed2f('0x17')]));require(_0xed2f('0x19'))[_0xed2f('0x1a')](socket);var jayson=require(_0xed2f('0x1b'));var client=jayson[_0xed2f('0x1c')][_0xed2f('0x1d')]({'port':0x232c});var client9002=jayson['client'][_0xed2f('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x3fec2b,_0x1294f2,_0x1b9a90,_0x3e1d20){return new BPromise(function(_0x2dc6c3,_0x2e4c51){var _0xc01385=_0x3e1d20||client;return _0xc01385[_0xed2f('0x1e')](_0x3fec2b,_0x1b9a90)[_0xed2f('0x1f')](function(_0x49dac5){logger['info'](_0xed2f('0x20'),_0x1294f2,_0xed2f('0x21'));logger[_0xed2f('0x22')](_0xed2f('0x23'),_0x1294f2,_0xed2f('0x21'),JSON['stringify'](_0x49dac5));if(_0x49dac5['error']){if(_0x49dac5[_0xed2f('0x24')][_0xed2f('0x25')]===0x1f4){logger[_0xed2f('0x24')](_0xed2f('0x20'),_0x1294f2,_0x49dac5[_0xed2f('0x24')]['message']);return _0x2e4c51(_0x49dac5[_0xed2f('0x24')][_0xed2f('0x26')]);}logger['error'](_0xed2f('0x20'),_0x1294f2,_0x49dac5[_0xed2f('0x24')]['message']);return _0x2dc6c3(_0x49dac5[_0xed2f('0x24')][_0xed2f('0x26')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x1294f2,'request\x20sent');_0x2dc6c3(_0x49dac5[_0xed2f('0x27')][_0xed2f('0x26')]);}})['catch'](function(_0x598842){logger['error']('FaxMessage,\x20%s,\x20%s',_0x1294f2,_0x598842);_0x2e4c51(_0x598842);});});}function respondWithStatusCode(_0x1ef6a9,_0x4f09e2){_0x4f09e2=_0x4f09e2||0xcc;return function(_0x5102a3){if(_0x5102a3){return _0x1ef6a9[_0xed2f('0x28')](_0x4f09e2);}return _0x1ef6a9[_0xed2f('0x29')](_0x4f09e2)[_0xed2f('0x2a')]();};}function respondWithResult(_0x5d2e89,_0x244ab4){_0x244ab4=_0x244ab4||0xc8;return function(_0x1b3446){if(_0x1b3446){return _0x5d2e89[_0xed2f('0x29')](_0x244ab4)['json'](_0x1b3446);}};}function respondWithFilteredResult(_0x145531,_0x556244){return function(_0x498bcf){if(_0x498bcf){var _0x4e3fc3=typeof _0x556244[_0xed2f('0x2b')]===_0xed2f('0x2c')&&typeof _0x556244[_0xed2f('0x2d')]===_0xed2f('0x2c');var _0x2570a5=_0x498bcf[_0xed2f('0x2e')];var _0x57b3f8=_0x4e3fc3?0x0:_0x556244[_0xed2f('0x2b')];var _0x4b3c16=_0x4e3fc3?_0x498bcf[_0xed2f('0x2e')]:_0x556244[_0xed2f('0x2b')]+_0x556244['limit'];var _0xd6673e;if(_0x4b3c16>=_0x2570a5){_0x4b3c16=_0x2570a5;_0xd6673e=0xc8;}else{_0xd6673e=0xce;}_0x145531[_0xed2f('0x29')](_0xd6673e);return _0x145531[_0xed2f('0x2f')](_0xed2f('0x30'),_0x57b3f8+'-'+_0x4b3c16+'/'+_0x2570a5)[_0xed2f('0x31')](_0x498bcf);}return null;};}function patchUpdates(_0x8c2a1d){return function(_0x5d91ad){try{jsonpatch[_0xed2f('0x32')](_0x5d91ad,_0x8c2a1d,!![]);}catch(_0x35e8d1){return BPromise['reject'](_0x35e8d1);}return _0x5d91ad[_0xed2f('0x33')]();};}function saveUpdates(_0x398217,_0x1448c6){return function(_0x576205){if(_0x576205){return _0x576205['update'](_0x398217)[_0xed2f('0x1f')](function(_0x5334ed){return _0x5334ed;});}return null;};}function removeEntity(_0x12c888,_0x54109c){return function(_0x76af48){if(_0x76af48){return _0x76af48['destroy']()[_0xed2f('0x1f')](function(){_0x12c888[_0xed2f('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3274e6,_0x4f85be){return function(_0x3cff19){if(!_0x3cff19){_0x3274e6[_0xed2f('0x28')](0x194);}return _0x3cff19;};}function handleError(_0x1ac55d,_0x53d398){_0x53d398=_0x53d398||0x1f4;return function(_0x51a9f4){logger[_0xed2f('0x24')](_0x51a9f4['stack']);if(_0x51a9f4[_0xed2f('0x34')]){delete _0x51a9f4['name'];}_0x1ac55d[_0xed2f('0x29')](_0x53d398)[_0xed2f('0x35')](_0x51a9f4);};}exports['index']=function(_0x337d63,_0x1fbce8){var _0x3739bf={},_0x22d859={},_0x958674={'count':0x0,'rows':[]};var _0x1e4788=_['map'](db[_0xed2f('0x36')][_0xed2f('0x37')],function(_0x1a943d){return{'name':_0x1a943d[_0xed2f('0x38')],'type':_0x1a943d[_0xed2f('0x39')][_0xed2f('0x3a')]};});_0x22d859[_0xed2f('0x3b')]=_[_0xed2f('0x3c')](_0x1e4788,_0xed2f('0x34'));_0x22d859[_0xed2f('0x3d')]=_[_0xed2f('0x3e')](_0x337d63['query']);_0x22d859[_0xed2f('0x3f')]=_[_0xed2f('0x40')](_0x22d859['model'],_0x22d859[_0xed2f('0x3d')]);_0x3739bf[_0xed2f('0x41')]=_['intersection'](_0x22d859[_0xed2f('0x3b')],qs[_0xed2f('0x42')](_0x337d63[_0xed2f('0x3d')][_0xed2f('0x42')]));_0x3739bf[_0xed2f('0x41')]=_0x3739bf['attributes'][_0xed2f('0x43')]?_0x3739bf[_0xed2f('0x41')]:_0x22d859[_0xed2f('0x3b')];if(!_0x337d63['query'][_0xed2f('0x44')](_0xed2f('0x45'))){_0x3739bf[_0xed2f('0x2d')]=qs[_0xed2f('0x2d')](_0x337d63[_0xed2f('0x3d')]['limit']);_0x3739bf[_0xed2f('0x2b')]=qs['offset'](_0x337d63[_0xed2f('0x3d')]['offset']);}_0x3739bf[_0xed2f('0x46')]=qs[_0xed2f('0x47')](_0x337d63[_0xed2f('0x3d')]['sort']);_0x3739bf[_0xed2f('0x48')]=qs[_0xed2f('0x3f')](_[_0xed2f('0x49')](_0x337d63[_0xed2f('0x3d')],_0x22d859[_0xed2f('0x3f')]),_0x1e4788);if(_0x337d63[_0xed2f('0x3d')][_0xed2f('0x4a')]){_0x3739bf[_0xed2f('0x48')]=_[_0xed2f('0x4b')](_0x3739bf[_0xed2f('0x48')],{'$or':_[_0xed2f('0x3c')](_0x1e4788,function(_0x3c5790){if(_0x3c5790['type']!==_0xed2f('0x4c')){var _0x474c50={};_0x474c50[_0x3c5790[_0xed2f('0x34')]]={'$like':'%'+_0x337d63[_0xed2f('0x3d')][_0xed2f('0x4a')]+'%'};return _0x474c50;}})});}_0x3739bf=_[_0xed2f('0x4b')]({},_0x3739bf,_0x337d63[_0xed2f('0x4d')]);var _0x29e415={'where':_0x3739bf['where']};return db[_0xed2f('0x36')][_0xed2f('0x2e')](_0x29e415)[_0xed2f('0x1f')](function(_0x485a70){_0x958674[_0xed2f('0x2e')]=_0x485a70;if(_0x337d63['query']['includeAll']){_0x3739bf[_0xed2f('0x4e')]=[{'all':!![]}];}return db[_0xed2f('0x36')]['findAll'](_0x3739bf);})[_0xed2f('0x1f')](function(_0x156ca3){_0x958674[_0xed2f('0x4f')]=_0x156ca3;return _0x958674;})[_0xed2f('0x1f')](respondWithFilteredResult(_0x1fbce8,_0x3739bf))[_0xed2f('0x50')](handleError(_0x1fbce8,null));};exports[_0xed2f('0x51')]=function(_0x50083e,_0x2451cd){var _0x580364={'raw':!![],'where':{'id':_0x50083e[_0xed2f('0x52')]['id']}},_0x49766b={};_0x49766b[_0xed2f('0x3b')]=_[_0xed2f('0x3e')](db[_0xed2f('0x36')][_0xed2f('0x37')]);_0x49766b[_0xed2f('0x3d')]=_['keys'](_0x50083e[_0xed2f('0x3d')]);_0x49766b[_0xed2f('0x3f')]=_['intersection'](_0x49766b[_0xed2f('0x3b')],_0x49766b[_0xed2f('0x3d')]);_0x580364['attributes']=_[_0xed2f('0x40')](_0x49766b[_0xed2f('0x3b')],qs[_0xed2f('0x42')](_0x50083e[_0xed2f('0x3d')][_0xed2f('0x42')]));_0x580364[_0xed2f('0x41')]=_0x580364[_0xed2f('0x41')][_0xed2f('0x43')]?_0x580364[_0xed2f('0x41')]:_0x49766b[_0xed2f('0x3b')];if(_0x50083e[_0xed2f('0x3d')][_0xed2f('0x53')]){_0x580364[_0xed2f('0x4e')]=[{'all':!![]}];}_0x580364=_[_0xed2f('0x4b')]({},_0x580364,_0x50083e[_0xed2f('0x4d')]);return db['FaxMessage']['find'](_0x580364)[_0xed2f('0x1f')](handleEntityNotFound(_0x2451cd,null))[_0xed2f('0x1f')](respondWithResult(_0x2451cd,null))[_0xed2f('0x50')](handleError(_0x2451cd,null));};exports[_0xed2f('0x54')]=function(_0x1eab6a,_0x7329fd){if(_0x1eab6a[_0xed2f('0x55')]['id']){delete _0x1eab6a['body']['id'];}return db[_0xed2f('0x36')][_0xed2f('0x56')]({'where':{'id':_0x1eab6a['params']['id']}})[_0xed2f('0x1f')](handleEntityNotFound(_0x7329fd,null))[_0xed2f('0x1f')](saveUpdates(_0x1eab6a[_0xed2f('0x55')],null))[_0xed2f('0x1f')](respondWithResult(_0x7329fd,null))['catch'](handleError(_0x7329fd,null));};exports[_0xed2f('0x57')]=function(_0xf0d30f,_0xf508fa){return db[_0xed2f('0x36')][_0xed2f('0x56')]({'where':{'id':_0xf0d30f['params']['id']}})[_0xed2f('0x1f')](handleEntityNotFound(_0xf508fa,null))[_0xed2f('0x1f')](removeEntity(_0xf508fa,null))[_0xed2f('0x50')](handleError(_0xf508fa,null));};exports[_0xed2f('0x58')]=function(_0x404a5c,_0x24b8b4){return db[_0xed2f('0x36')][_0xed2f('0x58')]()[_0xed2f('0x1f')](respondWithResult(_0x24b8b4,null))[_0xed2f('0x50')](handleError(_0x24b8b4,null));};var interaction_log=require(_0xed2f('0x59'))(_0xed2f('0x5a'));exports[_0xed2f('0x5b')]=function(_0x23ddda,_0x35d9b7,_0x104b63){var _0x4ab4c2={'agent':{},'channel':'fax'};if(_0x23ddda[_0xed2f('0x55')]['id']){delete _0x23ddda['body']['id'];}_0x23ddda['body'][_0xed2f('0x5c')]=!![];_0x23ddda['body'][_0xed2f('0x5d')]=moment()[_0xed2f('0x5e')]('YYYY-MM-DD\x20HH:mm:ss');_0x23ddda['body'][_0xed2f('0x5f')]=_0x23ddda[_0xed2f('0x55')][_0xed2f('0x5f')]||_0x23ddda[_0xed2f('0x60')]['id'];_0x4ab4c2[_0xed2f('0x61')]['id']=_0x23ddda[_0xed2f('0x55')]['UserId'];return db[_0xed2f('0x36')][_0xed2f('0x56')]({'where':{'id':_0x23ddda['params']['id'],'UserId':null}})[_0xed2f('0x1f')](handleEntityNotFound(_0x35d9b7,null))[_0xed2f('0x1f')](saveUpdates(_0x23ddda[_0xed2f('0x55')],null))[_0xed2f('0x1f')](function(_0xa3579c){if(_0xa3579c){_0x4ab4c2['message']=_0xa3579c[_0xed2f('0x62')]({'plain':!![]});return db[_0xed2f('0x63')][_0xed2f('0x56')]({'where':{'id':_0xa3579c['FaxInteractionId']}});}return null;})[_0xed2f('0x1f')](handleEntityNotFound(_0x35d9b7,null))[_0xed2f('0x1f')](function(_0x241d7c){if(_0x241d7c){return _0x241d7c[_0xed2f('0x54')]({'UserId':_0x23ddda[_0xed2f('0x55')][_0xed2f('0x5f')],'read1stAt':_['isNil'](_0x241d7c[_0xed2f('0x64')])?moment()[_0xed2f('0x5e')](_0xed2f('0x65')):undefined});}return null;})[_0xed2f('0x1f')](function(_0x698e45){if(_0x698e45){_0x4ab4c2[_0xed2f('0x66')]=_0x698e45[_0xed2f('0x62')]({'plain':!![]});interaction_log['info'](_0xed2f('0x67'),_0x23ddda[_0xed2f('0x60')]['id'],_0x23ddda[_0xed2f('0x60')][_0xed2f('0x34')],_0x23ddda[_0xed2f('0x60')][_0xed2f('0x68')],_0x4ab4c2[_0xed2f('0x66')]['id'],_0x23ddda['body']?JSON[_0xed2f('0x69')](_0x23ddda[_0xed2f('0x55')]):_0xed2f('0x6a'));return respondWithRpcPromise('AcceptMessage',_0xed2f('0x6b'),_0x4ab4c2);}return null;})['then'](function(_0x4e8f0c){var _0x1acca7=_0xed2f('0x6c')+_0x4e8f0c[_0xed2f('0x26')][_0xed2f('0x6d')];return db[_0xed2f('0x6e')]['query'](_0x1acca7,{'type':db['Sequelize'][_0xed2f('0x6f')][_0xed2f('0x70')],'raw':!![]})[_0xed2f('0x1f')](function(_0x4ab8e2){return _0x4ab8e2;});})['then'](function(_0x3c8d0c){if(_0x3c8d0c){_0x4ab4c2[_0xed2f('0x26')]['contact']=_0x3c8d0c[0x0];if(!_0x23ddda[_0xed2f('0x55')][_0xed2f('0x5f')])return;return db[_0xed2f('0x71')][_0xed2f('0x56')]({'where':{'id':_0x23ddda[_0xed2f('0x55')][_0xed2f('0x5f')],'role':'agent'},'attributes':['id',_0xed2f('0x34'),_0xed2f('0x72'),_0xed2f('0x73'),_0xed2f('0x74')],'raw':!![]});}return null;})[_0xed2f('0x1f')](function(_0x1562ff){if(!_0x1562ff)return null;_0x4ab4c2[_0xed2f('0x26')]['agent']=_0x1562ff;return _0x4ab4c2;})[_0xed2f('0x1f')](function(_0x4ae66c){if(_0x4ae66c){if(_0x23ddda[_0xed2f('0x55')]['manual']){_0x4ab4c2[_0xed2f('0x26')]['interface']=util[_0xed2f('0x5e')](_0xed2f('0x75'),_0x23ddda[_0xed2f('0x60')][_0xed2f('0x34')]);_0x4ab4c2[_0xed2f('0x26')][_0xed2f('0x76')]=_0x4ab4c2[_0xed2f('0x76')];_0x4ab4c2['message'][_0xed2f('0x77')]=_0x4ab4c2[_0xed2f('0x76')];_0x4ab4c2[_0xed2f('0x26')][_0xed2f('0x78')]=_0xed2f('0x5b');return respondWithRpcPromise('EventManager',_0xed2f('0x79'),{'event':_0xed2f('0x7a'),'message':_0x4ab4c2[_0xed2f('0x26')]},client9002)[_0xed2f('0x1f')](function(){return _0x4ab4c2;});}return _0x4ab4c2;}return null;})[_0xed2f('0x1f')](respondWithResult(_0x35d9b7,null))['catch'](handleError(_0x35d9b7,null));};var interaction_log=require(_0xed2f('0x59'))(_0xed2f('0x5a'));exports['reject']=function(_0xc261de,_0x31f10b,_0x13be06){var _0x2a40d5={'agent':{},'channel':'fax'};if(_0xc261de[_0xed2f('0x55')]['id']){delete _0xc261de[_0xed2f('0x55')]['id'];}_0xc261de[_0xed2f('0x55')]['UserId']=_0xc261de[_0xed2f('0x55')][_0xed2f('0x5f')]||_0xc261de['user']['id'];_0x2a40d5['agent']['id']=_0xc261de['body'][_0xed2f('0x5f')];return db[_0xed2f('0x36')][_0xed2f('0x56')]({'where':{'id':_0xc261de[_0xed2f('0x52')]['id'],'UserId':null}})[_0xed2f('0x1f')](handleEntityNotFound(_0x31f10b,null))[_0xed2f('0x1f')](function(_0x18e665){if(_0x18e665){_0x2a40d5[_0xed2f('0x26')]=_0x18e665[_0xed2f('0x62')]({'plain':!![]});return db[_0xed2f('0x63')][_0xed2f('0x56')]({'where':{'id':_0x18e665[_0xed2f('0x7b')]}});}return null;})[_0xed2f('0x1f')](handleEntityNotFound(_0x31f10b,null))[_0xed2f('0x1f')](function(_0x355234){if(_0x355234){_0x2a40d5[_0xed2f('0x66')]=_0x355234['get']({'plain':!![]});interaction_log[_0xed2f('0x7c')](_0xed2f('0x7d'),_0xc261de[_0xed2f('0x60')]['id'],_0xc261de[_0xed2f('0x60')][_0xed2f('0x34')],_0xc261de[_0xed2f('0x60')][_0xed2f('0x68')],_0x2a40d5[_0xed2f('0x66')]['id'],_0xc261de[_0xed2f('0x55')]?JSON[_0xed2f('0x69')](_0xc261de[_0xed2f('0x55')]):_0xed2f('0x6a'));return respondWithRpcPromise(_0xed2f('0x7e'),_0xed2f('0x7f'),_0x2a40d5);}return null;})[_0xed2f('0x1f')](function(_0x313568){var _0xf005e4=_0xed2f('0x6c')+_0x313568['message'][_0xed2f('0x6d')];return db[_0xed2f('0x6e')]['query'](_0xf005e4,{'type':db[_0xed2f('0x80')][_0xed2f('0x6f')][_0xed2f('0x70')],'raw':!![]})[_0xed2f('0x1f')](function(_0x59105e){return _0x59105e;});})[_0xed2f('0x1f')](function(_0x3950ca){if(_0x3950ca){_0x2a40d5[_0xed2f('0x26')][_0xed2f('0x81')]=_0x3950ca[0x0];if(!_0xc261de[_0xed2f('0x55')][_0xed2f('0x5f')])return;return db[_0xed2f('0x71')]['find']({'where':{'id':_0xc261de[_0xed2f('0x55')][_0xed2f('0x5f')],'role':_0xed2f('0x61')},'attributes':['id',_0xed2f('0x34'),'fullname',_0xed2f('0x73'),_0xed2f('0x74')],'raw':!![]});}return null;})[_0xed2f('0x1f')](function(_0x5d1bf3){if(!_0x5d1bf3)return null;_0x2a40d5[_0xed2f('0x26')]['agent']=_0x5d1bf3;return _0x2a40d5;})[_0xed2f('0x1f')](function(_0x356ae6){if(_0x356ae6){_0x356ae6[_0xed2f('0x26')][_0xed2f('0x82')]=util[_0xed2f('0x5e')](_0xed2f('0x75'),_0xc261de[_0xed2f('0x60')][_0xed2f('0x34')]);_0x356ae6[_0xed2f('0x26')][_0xed2f('0x76')]=_0x2a40d5['channel'];_0x356ae6[_0xed2f('0x26')][_0xed2f('0x77')]=_0x2a40d5[_0xed2f('0x76')];_0x356ae6[_0xed2f('0x26')][_0xed2f('0x78')]=_0xed2f('0x83');respondWithRpcPromise(_0xed2f('0x79'),'EventManager',{'event':'rejectmessage','message':_0x356ae6[_0xed2f('0x26')]},client9002);return _0x2a40d5;}return null;})[_0xed2f('0x1f')](respondWithResult(_0x31f10b,null))[_0xed2f('0x50')](handleError(_0x31f10b,null));};exports[_0xed2f('0x84')]=function(_0x4e61e0,_0x33ef91){var _0x51ade7;return db['FaxMessage'][_0xed2f('0x84')](_0x4e61e0['body'],{})[_0xed2f('0x1f')](function(_0x258de2){_0x51ade7=_0x258de2;return db[_0xed2f('0x85')][_0xed2f('0x86')]({'where':{'id':_0x51ade7['ContactId']}});})[_0xed2f('0x1f')](function(_0x4abe05){if(_['isNil'](_0x4abe05)){return;}else{_0x51ade7[_0xed2f('0x87')]=_0x4abe05[_0xed2f('0x87')];return db['Attachment'][_0xed2f('0x86')]({'where':{'id':_0x51ade7[_0xed2f('0x88')]}});}})[_0xed2f('0x1f')](function(_0x55557d){return respondWithRpcPromise(_0xed2f('0x89'),'SendFax',{'FaxAccountId':_['isNil'](_0x4e61e0[_0xed2f('0x55')])?undefined:_0x4e61e0[_0xed2f('0x55')]['FaxAccountId'],'path':_[_0xed2f('0x8a')](_0x55557d)?undefined:util[_0xed2f('0x5e')](_0xed2f('0x8b'),_0x55557d['basename']),'fax':_['isNil'](_0x51ade7[_0xed2f('0x87')])?undefined:_0x51ade7[_0xed2f('0x87')],'AttachmentId':_0x51ade7[_0xed2f('0x88')]},client9002);})[_0xed2f('0x1f')](respondWithResult(_0x33ef91,0xc9))[_0xed2f('0x50')](handleError(_0x33ef91,null));};exports['download']=function(_0x265003,_0x319678){var _0x12d63f=path['join'](config[_0xed2f('0x8c')],_0xed2f('0x8d'),_0xed2f('0x8e'),'attachments');return db['FaxMessage'][_0xed2f('0x56')]({'where':{'id':_0x265003[_0xed2f('0x52')]['id']},'include':[{'model':db[_0xed2f('0x8f')],'as':_0xed2f('0x8f')}]})[_0xed2f('0x1f')](handleEntityNotFound(_0x319678,null))['then'](function(_0xecfb40){if(_0xecfb40){return _0x319678['download'](path['join'](_0x12d63f,_0xecfb40[_0xed2f('0x8f')][_0xed2f('0x90')]));}})[_0xed2f('0x50')](handleError(_0x319678,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 5ab08d3..705e412 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 _0xdbb9=['save','remove','emit','exports','../../mysqldb','FaxMessage','setMaxListeners'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdbb9,0xf9));var _0x9dbb=function(_0x556313,_0x5590af){_0x556313=_0x556313-0x0;var _0x25854a=_0xdbb9[_0x556313];return _0x25854a;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0x9dbb('0x0'))['db'][_0x9dbb('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x9dbb('0x2')](0x0);var events={'afterCreate':_0x9dbb('0x3'),'afterUpdate':'update','afterDestroy':_0x9dbb('0x4')};function emitEvent(_0x3a95f2){return function(_0x19ebd7,_0x3b4460,_0xb960a5){FaxMessageEvents[_0x9dbb('0x5')](_0x3a95f2+':'+_0x19ebd7['id'],_0x19ebd7);FaxMessageEvents['emit'](_0x3a95f2,_0x19ebd7);_0xb960a5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0x9dbb('0x6')]=FaxMessageEvents; \ No newline at end of file +var _0x5502=['setMaxListeners','save','update','remove','emit','hook','events','../../mysqldb','FaxMessage'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5502,0x69));var _0x2550=function(_0x587fb5,_0x59cb3b){_0x587fb5=_0x587fb5-0x0;var _0x551105=_0x5502[_0x587fb5];return _0x551105;};'use strict';var EventEmitter=require(_0x2550('0x0'));var FaxMessage=require(_0x2550('0x1'))['db'][_0x2550('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x2550('0x3')](0x0);var events={'afterCreate':_0x2550('0x4'),'afterUpdate':_0x2550('0x5'),'afterDestroy':_0x2550('0x6')};function emitEvent(_0x2a80f8){return function(_0x18739d,_0x30a166,_0x2dbee8){FaxMessageEvents[_0x2550('0x7')](_0x2a80f8+':'+_0x18739d['id'],_0x18739d);FaxMessageEvents[_0x2550('0x7')](_0x2a80f8,_0x18739d);_0x2dbee8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0x2550('0x8')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index d6f1823..4e15e58 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 _0xbe3f=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./faxMessage.attributes','define','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','FaxInteraction','FaxInteractionId','then','update','createdAt','catch','error'];(function(_0x104a84,_0x285970){var _0x4973ff=function(_0x5064e7){while(--_0x5064e7){_0x104a84['push'](_0x104a84['shift']());}};_0x4973ff(++_0x285970);}(_0xbe3f,0x195));var _0xfbe3=function(_0x4ef351,_0x10eb1f){_0x4ef351=_0x4ef351-0x0;var _0x4dcb59=_0xbe3f[_0x4ef351];return _0x4dcb59;};'use strict';var _=require(_0xfbe3('0x0'));var util=require(_0xfbe3('0x1'));var logger=require(_0xfbe3('0x2'))('api');var moment=require(_0xfbe3('0x3'));var BPromise=require(_0xfbe3('0x4'));var rp=require(_0xfbe3('0x5'));var fs=require('fs');var path=require(_0xfbe3('0x6'));var rimraf=require('rimraf');var config=require(_0xfbe3('0x7'));var attributes=require(_0xfbe3('0x8'));module['exports']=function(_0x3a48bf,_0x43e836){return _0x3a48bf[_0xfbe3('0x9')](_0xfbe3('0xa'),attributes,{'tableName':_0xfbe3('0xb'),'paranoid':![],'indexes':[{'name':_0xfbe3('0xc'),'fields':[_0xfbe3('0xd')],'type':_0xfbe3('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x18ca31,_0x3ed044,_0x33cab2){var _0x3bd4df=_0x3a48bf[_0xfbe3('0xf')];var _0x52d6af=_0x18ca31[_0xfbe3('0x10')]({'plain':!![]});if(_0x52d6af[_0xfbe3('0x11')][_0xfbe3('0x12')]()==='in'||_0x52d6af['direction']['toLowerCase']()==='out'&&!_0x52d6af[_0xfbe3('0x13')]&&!_[_0xfbe3('0x14')](_0x52d6af[_0xfbe3('0x15')])){_0x3bd4df[_0xfbe3('0x16')]['findOne']({'where':{'id':_0x52d6af[_0xfbe3('0x17')]}})[_0xfbe3('0x18')](function(_0x466a31){if(_0x466a31){_0x466a31[_0xfbe3('0x19')]({'lastMsgAt':_0x52d6af[_0xfbe3('0x1a')],'lastMsgDirection':_0x52d6af['direction'][_0xfbe3('0x12')]()});}})[_0xfbe3('0x1b')](function(_0x4e8cff){console[_0xfbe3('0x1c')](_0x4e8cff);});}_0x33cab2();}},'charset':_0xfbe3('0x1d'),'collate':_0xfbe3('0x1e')});}; \ No newline at end of file +var _0xa31a=['request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','fti_fax_messages','FULLTEXT','toLowerCase','direction','UserId','FaxInteraction','FaxInteractionId','catch','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird'];(function(_0x2173a2,_0x503d26){var _0x1df543=function(_0x357db8){while(--_0x357db8){_0x2173a2['push'](_0x2173a2['shift']());}};_0x1df543(++_0x503d26);}(_0xa31a,0x133));var _0xaa31=function(_0x531d80,_0x530508){_0x531d80=_0x531d80-0x0;var _0x222b7d=_0xa31a[_0x531d80];return _0x222b7d;};'use strict';var _=require(_0xaa31('0x0'));var util=require('util');var logger=require(_0xaa31('0x1'))(_0xaa31('0x2'));var moment=require(_0xaa31('0x3'));var BPromise=require(_0xaa31('0x4'));var rp=require(_0xaa31('0x5'));var fs=require('fs');var path=require(_0xaa31('0x6'));var rimraf=require(_0xaa31('0x7'));var config=require(_0xaa31('0x8'));var attributes=require(_0xaa31('0x9'));module[_0xaa31('0xa')]=function(_0x32542b,_0x11013b){return _0x32542b[_0xaa31('0xb')](_0xaa31('0xc'),attributes,{'tableName':_0xaa31('0xd'),'paranoid':![],'indexes':[{'name':_0xaa31('0xe'),'fields':['body'],'type':_0xaa31('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4e87da,_0x40f4c0,_0x1fa040){var _0x41d5e5=_0x32542b['models'];var _0x3dadf6=_0x4e87da['get']({'plain':!![]});if(_0x3dadf6['direction'][_0xaa31('0x10')]()==='in'||_0x3dadf6[_0xaa31('0x11')][_0xaa31('0x10')]()==='out'&&!_0x3dadf6['secret']&&!_['isNil'](_0x3dadf6[_0xaa31('0x12')])){_0x41d5e5[_0xaa31('0x13')]['findOne']({'where':{'id':_0x3dadf6[_0xaa31('0x14')]}})['then'](function(_0x13760b){if(_0x13760b){_0x13760b['update']({'lastMsgAt':_0x3dadf6['createdAt'],'lastMsgDirection':_0x3dadf6[_0xaa31('0x11')][_0xaa31('0x10')]()});}})[_0xaa31('0x15')](function(_0x4907f1){console['error'](_0x4907f1);});}_0x1fa040();}},'charset':_0xaa31('0x16'),'collate':_0xaa31('0x17')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 04b17c2..d7325c5 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 _0x5636=['error','code','message','result','CreateFaxMessage','FaxMessage','body','options','then','UpdateFaxMessage','update','where','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x8014d8,_0x134a36){var _0x581b7b=function(_0x45c7ce){while(--_0x45c7ce){_0x8014d8['push'](_0x8014d8['shift']());}};_0x581b7b(++_0x134a36);}(_0x5636,0x102));var _0x6563=function(_0x47511a,_0x16d40a){_0x47511a=_0x47511a-0x0;var _0x5bbc4b=_0x5636[_0x47511a];return _0x5bbc4b;};'use strict';var _=require(_0x6563('0x0'));var util=require(_0x6563('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6563('0x2'));var db=require(_0x6563('0x3'))['db'];var utils=require(_0x6563('0x4'));var logger=require('../../config/logger')(_0x6563('0x5'));var config=require(_0x6563('0x6'));var jayson=require(_0x6563('0x7'));var client=jayson[_0x6563('0x8')][_0x6563('0x9')]({'port':0x232a});config[_0x6563('0xa')]=_[_0x6563('0xb')](config[_0x6563('0xa')],{'host':_0x6563('0xc'),'port':0x18eb});var socket=require(_0x6563('0xd'))(new Redis(config[_0x6563('0xa')]));require(_0x6563('0xe'))[_0x6563('0xf')](socket);function respondWithRpcPromise(_0x516d1a,_0x51fdc2,_0x2946f3){return new BPromise(function(_0x129fa3,_0x490a56){return client['request'](_0x516d1a,_0x2946f3)['then'](function(_0x1ef002){logger[_0x6563('0x10')](_0x6563('0x11'),_0x51fdc2,_0x6563('0x12'));logger[_0x6563('0x13')](_0x6563('0x14'),_0x51fdc2,_0x6563('0x12'),JSON[_0x6563('0x15')](_0x1ef002));if(_0x1ef002[_0x6563('0x16')]){if(_0x1ef002['error'][_0x6563('0x17')]===0x1f4){logger['error'](_0x6563('0x11'),_0x51fdc2,_0x1ef002[_0x6563('0x16')][_0x6563('0x18')]);return _0x490a56(_0x1ef002[_0x6563('0x16')]['message']);}logger[_0x6563('0x16')](_0x6563('0x11'),_0x51fdc2,_0x1ef002[_0x6563('0x16')][_0x6563('0x18')]);return _0x129fa3(_0x1ef002['error'][_0x6563('0x18')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x51fdc2,'request\x20sent');_0x129fa3(_0x1ef002[_0x6563('0x19')]['message']);}})['catch'](function(_0x27651b){logger[_0x6563('0x16')](_0x6563('0x11'),_0x51fdc2,_0x27651b);_0x490a56(_0x27651b);});});}exports[_0x6563('0x1a')]=function(_0xf8b544){var _0x10811d=this;return new Promise(function(_0x37ba3,_0x93a45){return db[_0x6563('0x1b')]['create'](_0xf8b544[_0x6563('0x1c')],{'raw':_0xf8b544[_0x6563('0x1d')]?_0xf8b544[_0x6563('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x6563('0x1e')](function(_0x5c37bb){logger[_0x6563('0x10')](_0x6563('0x1a'),_0xf8b544);logger['debug']('CreateFaxMessage',_0xf8b544,JSON[_0x6563('0x15')](_0x5c37bb));_0x37ba3(_0x5c37bb);})['catch'](function(_0x1097d0){logger[_0x6563('0x16')](_0x6563('0x1a'),_0x1097d0['message'],_0xf8b544);_0x93a45(_0x10811d[_0x6563('0x16')](0x1f4,_0x1097d0['message']));});});};exports[_0x6563('0x1f')]=function(_0x1590e6){var _0x5e5aeb=this;return new Promise(function(_0x365b16,_0x28252d){return db['FaxMessage'][_0x6563('0x20')](_0x1590e6['body'],{'raw':_0x1590e6[_0x6563('0x1d')]?_0x1590e6['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1590e6[_0x6563('0x1d')]?_0x1590e6[_0x6563('0x1d')][_0x6563('0x21')]||null:null,'attributes':_0x1590e6[_0x6563('0x1d')]?_0x1590e6[_0x6563('0x1d')]['attributes']||null:null,'limit':_0x1590e6[_0x6563('0x1d')]?_0x1590e6['options']['limit']||null:null})[_0x6563('0x1e')](function(_0x35af37){logger[_0x6563('0x10')](_0x6563('0x1f'),_0x1590e6);logger[_0x6563('0x13')](_0x6563('0x1f'),_0x1590e6,JSON[_0x6563('0x15')](_0x35af37));_0x365b16(_0x35af37);})[_0x6563('0x22')](function(_0x101b24){logger[_0x6563('0x16')]('UpdateFaxMessage',_0x101b24[_0x6563('0x18')],_0x1590e6);_0x28252d(_0x5e5aeb[_0x6563('0x16')](0x1f4,_0x101b24[_0x6563('0x18')]));});});}; \ No newline at end of file +var _0x5c12=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./faxMessage.socket','register','request','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','FaxMessage,\x20%s,\x20%s','message','catch','CreateFaxMessage','FaxMessage','create','body','options','then','stringify','UpdateFaxMessage','raw','attributes','limit','util','moment','randomstring','ioredis'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x5c12,0x188));var _0x25c1=function(_0x322bef,_0x4890d4){_0x322bef=_0x322bef-0x0;var _0x229e60=_0x5c12[_0x322bef];return _0x229e60;};'use strict';var _=require('lodash');var util=require(_0x25c1('0x0'));var moment=require(_0x25c1('0x1'));var BPromise=require('bluebird');var rs=require(_0x25c1('0x2'));var fs=require('fs');var Redis=require(_0x25c1('0x3'));var db=require(_0x25c1('0x4'))['db'];var utils=require(_0x25c1('0x5'));var logger=require(_0x25c1('0x6'))(_0x25c1('0x7'));var config=require(_0x25c1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x25c1('0x9')][_0x25c1('0xa')]({'port':0x232a});config[_0x25c1('0xb')]=_['defaults'](config['redis'],{'host':_0x25c1('0xc'),'port':0x18eb});var socket=require(_0x25c1('0xd'))(new Redis(config[_0x25c1('0xb')]));require(_0x25c1('0xe'))[_0x25c1('0xf')](socket);function respondWithRpcPromise(_0x588f30,_0x3e062e,_0x41c89d){return new BPromise(function(_0x11a223,_0x81f0f4){return client[_0x25c1('0x10')](_0x588f30,_0x41c89d)['then'](function(_0x196e2f){logger[_0x25c1('0x11')]('FaxMessage,\x20%s,\x20%s',_0x3e062e,_0x25c1('0x12'));logger[_0x25c1('0x13')](_0x25c1('0x14'),_0x3e062e,_0x25c1('0x12'),JSON['stringify'](_0x196e2f));if(_0x196e2f['error']){if(_0x196e2f['error']['code']===0x1f4){logger[_0x25c1('0x15')](_0x25c1('0x16'),_0x3e062e,_0x196e2f[_0x25c1('0x15')][_0x25c1('0x17')]);return _0x81f0f4(_0x196e2f[_0x25c1('0x15')]['message']);}logger[_0x25c1('0x15')]('FaxMessage,\x20%s,\x20%s',_0x3e062e,_0x196e2f['error']['message']);return _0x11a223(_0x196e2f[_0x25c1('0x15')][_0x25c1('0x17')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x3e062e,_0x25c1('0x12'));_0x11a223(_0x196e2f['result'][_0x25c1('0x17')]);}})[_0x25c1('0x18')](function(_0x5c3c5d){logger['error']('FaxMessage,\x20%s,\x20%s',_0x3e062e,_0x5c3c5d);_0x81f0f4(_0x5c3c5d);});});}exports[_0x25c1('0x19')]=function(_0x3d3149){var _0x22a36e=this;return new Promise(function(_0x1bf95d,_0x481c12){return db[_0x25c1('0x1a')][_0x25c1('0x1b')](_0x3d3149[_0x25c1('0x1c')],{'raw':_0x3d3149[_0x25c1('0x1d')]?_0x3d3149['options']['raw']===undefined?!![]:![]:!![]})[_0x25c1('0x1e')](function(_0xac3335){logger[_0x25c1('0x11')](_0x25c1('0x19'),_0x3d3149);logger[_0x25c1('0x13')](_0x25c1('0x19'),_0x3d3149,JSON[_0x25c1('0x1f')](_0xac3335));_0x1bf95d(_0xac3335);})[_0x25c1('0x18')](function(_0x14ffd9){logger[_0x25c1('0x15')](_0x25c1('0x19'),_0x14ffd9[_0x25c1('0x17')],_0x3d3149);_0x481c12(_0x22a36e[_0x25c1('0x15')](0x1f4,_0x14ffd9['message']));});});};exports[_0x25c1('0x20')]=function(_0x20dbb9){var _0x1b1c96=this;return new Promise(function(_0x1fb59f,_0x21fdb8){return db[_0x25c1('0x1a')]['update'](_0x20dbb9[_0x25c1('0x1c')],{'raw':_0x20dbb9[_0x25c1('0x1d')]?_0x20dbb9[_0x25c1('0x1d')][_0x25c1('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20dbb9[_0x25c1('0x1d')]?_0x20dbb9[_0x25c1('0x1d')]['where']||null:null,'attributes':_0x20dbb9[_0x25c1('0x1d')]?_0x20dbb9['options'][_0x25c1('0x22')]||null:null,'limit':_0x20dbb9[_0x25c1('0x1d')]?_0x20dbb9[_0x25c1('0x1d')][_0x25c1('0x23')]||null:null})[_0x25c1('0x1e')](function(_0x21069c){logger[_0x25c1('0x11')](_0x25c1('0x20'),_0x20dbb9);logger[_0x25c1('0x13')]('UpdateFaxMessage',_0x20dbb9,JSON[_0x25c1('0x1f')](_0x21069c));_0x1fb59f(_0x21069c);})['catch'](function(_0x492715){logger[_0x25c1('0x15')](_0x25c1('0x20'),_0x492715['message'],_0x20dbb9);_0x21fdb8(_0x1b1c96[_0x25c1('0x15')](0x1f4,_0x492715['message']));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 73d1d47..41c8835 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 _0xc44a=['./faxMessage.events','save','remove','update','emit','removeListener','register','length','faxMessage:'];(function(_0x35eace,_0x152807){var _0x491a33=function(_0x22b90a){while(--_0x22b90a){_0x35eace['push'](_0x35eace['shift']());}};_0x491a33(++_0x152807);}(_0xc44a,0x129));var _0xac44=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xc44a[_0x297fd3];return _0x2af381;};'use strict';var FaxMessageEvents=require(_0xac44('0x0'));var events=[_0xac44('0x1'),_0xac44('0x2'),_0xac44('0x3')];function createListener(_0x316a79,_0x42ee13){return function(_0xdcbabf){_0x42ee13[_0xac44('0x4')](_0x316a79,_0xdcbabf);};}function removeListener(_0x26224e,_0x2b12e6){return function(){FaxMessageEvents[_0xac44('0x5')](_0x26224e,_0x2b12e6);};}exports[_0xac44('0x6')]=function(_0x47f594){for(var _0x512345=0x0,_0x378613=events[_0xac44('0x7')];_0x512345<_0x378613;_0x512345++){var _0x239d0f=events[_0x512345];var _0xeb6dd6=createListener(_0xac44('0x8')+_0x239d0f,_0x47f594);FaxMessageEvents['on'](_0x239d0f,_0xeb6dd6);}}; \ No newline at end of file +var _0xae82=['update','emit','register','length','faxMessage:','./faxMessage.events','save','remove'];(function(_0x44789d,_0x46bb8b){var _0x3e9342=function(_0x257eff){while(--_0x257eff){_0x44789d['push'](_0x44789d['shift']());}};_0x3e9342(++_0x46bb8b);}(_0xae82,0x75));var _0x2ae8=function(_0x4b02bb,_0x47a154){_0x4b02bb=_0x4b02bb-0x0;var _0x5c04b4=_0xae82[_0x4b02bb];return _0x5c04b4;};'use strict';var FaxMessageEvents=require(_0x2ae8('0x0'));var events=[_0x2ae8('0x1'),_0x2ae8('0x2'),_0x2ae8('0x3')];function createListener(_0x5bda53,_0xf408f0){return function(_0x2f2b49){_0xf408f0[_0x2ae8('0x4')](_0x5bda53,_0x2f2b49);};}function removeListener(_0x3ad9b3,_0x2f4d6a){return function(){FaxMessageEvents['removeListener'](_0x3ad9b3,_0x2f4d6a);};}exports[_0x2ae8('0x5')]=function(_0x34ad96){for(var _0x1104e5=0x0,_0x3a81c4=events[_0x2ae8('0x6')];_0x1104e5<_0x3a81c4;_0x1104e5++){var _0x4c65d4=events[_0x1104e5];var _0x17b2a1=createListener(_0x2ae8('0x7')+_0x4c65d4,_0x34ad96);FaxMessageEvents['on'](_0x4c65d4,_0x17b2a1);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 41f6cd6..64558b8 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 _0xb332=['exports','multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','download','post','tracked','fax','faxmessage:create','create','put','/:id/accept','reject','delete','destroy'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0xb332,0xd9));var _0x2b33=function(_0x32729c,_0xf5afd8){_0x32729c=_0x32729c-0x0;var _0x482cfd=_0xb332[_0x32729c];return _0x482cfd;};'use strict';var multer=require(_0x2b33('0x0'));var util=require('util');var path=require(_0x2b33('0x1'));var timeout=require(_0x2b33('0x2'));var express=require('express');var router=express[_0x2b33('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x2b33('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2b33('0x5'));var controller=require('./faxMessage.controller');router[_0x2b33('0x6')]('/',auth[_0x2b33('0x7')](),controller[_0x2b33('0x8')]);router[_0x2b33('0x6')]('/describe',auth['isAuthenticated'](),controller[_0x2b33('0x9')]);router['get'](_0x2b33('0xa'),auth[_0x2b33('0x7')](),controller[_0x2b33('0xb')]);router[_0x2b33('0x6')]('/:id/download',auth[_0x2b33('0x7')](),controller[_0x2b33('0xc')]);router[_0x2b33('0xd')]('/',auth[_0x2b33('0x7')](),interaction[_0x2b33('0xe')](_0x2b33('0xf'),_0x2b33('0x10')),controller[_0x2b33('0x11')]);router[_0x2b33('0x12')](_0x2b33('0xa'),auth[_0x2b33('0x7')](),controller['update']);router[_0x2b33('0x12')](_0x2b33('0x13'),auth[_0x2b33('0x7')](),controller['accept']);router[_0x2b33('0x12')]('/:id/reject',auth[_0x2b33('0x7')](),controller[_0x2b33('0x14')]);router[_0x2b33('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x2b33('0x16')]);module[_0x2b33('0x17')]=router; \ No newline at end of file +var _0x8ce3=['show','/:id/download','download','post','tracked','fax','faxmessage:create','create','put','update','/:id/accept','/:id/reject','reject','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','isAuthenticated','index','/describe','describe','/:id'];(function(_0x450bf9,_0x1895de){var _0x268350=function(_0xebafa7){while(--_0xebafa7){_0x450bf9['push'](_0x450bf9['shift']());}};_0x268350(++_0x1895de);}(_0x8ce3,0xc3));var _0x38ce=function(_0xb24a3e,_0x4a3594){_0xb24a3e=_0xb24a3e-0x0;var _0x4038d7=_0x8ce3[_0xb24a3e];return _0x4038d7;};'use strict';var multer=require(_0x38ce('0x0'));var util=require(_0x38ce('0x1'));var path=require('path');var timeout=require(_0x38ce('0x2'));var express=require(_0x38ce('0x3'));var router=express[_0x38ce('0x4')]();var fs_extra=require(_0x38ce('0x5'));var auth=require(_0x38ce('0x6'));var interaction=require(_0x38ce('0x7'));var config=require(_0x38ce('0x8'));var controller=require(_0x38ce('0x9'));router['get']('/',auth[_0x38ce('0xa')](),controller[_0x38ce('0xb')]);router['get'](_0x38ce('0xc'),auth[_0x38ce('0xa')](),controller[_0x38ce('0xd')]);router['get'](_0x38ce('0xe'),auth['isAuthenticated'](),controller[_0x38ce('0xf')]);router['get'](_0x38ce('0x10'),auth[_0x38ce('0xa')](),controller[_0x38ce('0x11')]);router[_0x38ce('0x12')]('/',auth[_0x38ce('0xa')](),interaction[_0x38ce('0x13')](_0x38ce('0x14'),_0x38ce('0x15')),controller[_0x38ce('0x16')]);router[_0x38ce('0x17')](_0x38ce('0xe'),auth[_0x38ce('0xa')](),controller[_0x38ce('0x18')]);router[_0x38ce('0x17')](_0x38ce('0x19'),auth[_0x38ce('0xa')](),controller['accept']);router['put'](_0x38ce('0x1a'),auth[_0x38ce('0xa')](),controller[_0x38ce('0x1b')]);router['delete'](_0x38ce('0xe'),auth['isAuthenticated'](),controller[_0x38ce('0x1c')]);module[_0x38ce('0x1d')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index ee3059c..6aec3e1 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 _0xa342=['name','ENUM','INTEGER','exports','STRING'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa342,0x99));var _0x2a34=function(_0x486615,_0x4c0f28){_0x486615=_0x486615-0x0;var _0x29f93f=_0xa342[_0x486615];return _0x29f93f;};'use strict';var Sequelize=require('sequelize');module[_0x2a34('0x0')]={'name':{'type':Sequelize[_0x2a34('0x1')],'unique':_0x2a34('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2a34('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2a34('0x3')]('rrmemory','beepall','roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x2a34('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd2b0=['STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x26f3f7,_0xb2b541){var _0x29633c=function(_0x584b60){while(--_0x584b60){_0x26f3f7['push'](_0x26f3f7['shift']());}};_0x29633c(++_0xb2b541);}(_0xd2b0,0x13b));var _0x0d2b=function(_0x5d8018,_0x588592){_0x5d8018=_0x5d8018-0x0;var _0x151ac4=_0xd2b0[_0x5d8018];return _0x151ac4;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x0d2b('0x0')],'unique':_0x0d2b('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x0d2b('0x0')]},'timeout':{'type':Sequelize[_0x0d2b('0x2')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0d2b('0x3')](_0x0d2b('0x4'),_0x0d2b('0x5'),_0x0d2b('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x0d2b('0x2')],'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 2d42508..d69f177 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 _0x6f73=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','json','undefined','count','offset','limit','Content-Range','save','update','destroy','then','get','FaxQueues','end','stack','name','send','map','FaxQueue','rawAttributes','fieldName','type','key','model','keys','filters','query','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','merge','includeAll','findAll','rows','show','params','include','options','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','length','FaxQueueId','UserFaxQueue','findAndCountAll','UserId','agent','faxPause','updatedAt','format','%s/%s','createdAt','getTeams','nolimit','ids','Team','User','online','voicePause','interface','addTeams','each','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','Agents','select','field','tq.TeamId','from','team_has_fax_queues','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','SELECT','every','TeamId','all','value','isEmpty','removeAgents','addAgents','spread','isArray','userFaxQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x6f73,0x7b));var _0x36f7=function(_0x21e09f,_0x409c8a){_0x21e09f=_0x21e09f-0x0;var _0x20687a=_0x6f73[_0x21e09f];return _0x20687a;};'use strict';var emlformat=require(_0x36f7('0x0'));var rimraf=require(_0x36f7('0x1'));var zipdir=require(_0x36f7('0x2'));var jsonpatch=require(_0x36f7('0x3'));var rp=require(_0x36f7('0x4'));var moment=require('moment');var BPromise=require(_0x36f7('0x5'));var Mustache=require(_0x36f7('0x6'));var util=require(_0x36f7('0x7'));var path=require(_0x36f7('0x8'));var sox=require(_0x36f7('0x9'));var csv=require(_0x36f7('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x36f7('0xb'));var _=require(_0x36f7('0xc'));var squel=require(_0x36f7('0xd'));var crypto=require(_0x36f7('0xe'));var jsforce=require(_0x36f7('0xf'));var deskjs=require(_0x36f7('0x10'));var toCsv=require(_0x36f7('0xa'));var querystring=require(_0x36f7('0x11'));var Papa=require(_0x36f7('0x12'));var Redis=require(_0x36f7('0x13'));var authService=require(_0x36f7('0x14'));var qs=require(_0x36f7('0x15'));var as=require(_0x36f7('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x36f7('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x36f7('0x18'));var licenseUtil=require(_0x36f7('0x19'));var db=require(_0x36f7('0x1a'))['db'];config[_0x36f7('0x1b')]=_['defaults'](config['redis'],{'host':_0x36f7('0x1c'),'port':0x18eb});var socket=require(_0x36f7('0x1d'))(new Redis(config['redis']));require('./faxQueue.socket')[_0x36f7('0x1e')](socket);function respondWithStatusCode(_0x30a538,_0x5a823b){_0x5a823b=_0x5a823b||0xcc;return function(_0x50afa4){if(_0x50afa4){return _0x30a538[_0x36f7('0x1f')](_0x5a823b);}return _0x30a538['status'](_0x5a823b)['end']();};}function respondWithResult(_0x49d277,_0xd88eb2){_0xd88eb2=_0xd88eb2||0xc8;return function(_0x2a1651){if(_0x2a1651){return _0x49d277[_0x36f7('0x20')](_0xd88eb2)[_0x36f7('0x21')](_0x2a1651);}};}function respondWithFilteredResult(_0x55ee13,_0x28205a){return function(_0x4479a3){if(_0x4479a3){var _0x5ae357=typeof _0x28205a['offset']===_0x36f7('0x22')&&typeof _0x28205a['limit']===_0x36f7('0x22');var _0x4bb3be=_0x4479a3[_0x36f7('0x23')];var _0x4db519=_0x5ae357?0x0:_0x28205a[_0x36f7('0x24')];var _0x1f9a82=_0x5ae357?_0x4479a3['count']:_0x28205a[_0x36f7('0x24')]+_0x28205a[_0x36f7('0x25')];var _0x3fbf96;if(_0x1f9a82>=_0x4bb3be){_0x1f9a82=_0x4bb3be;_0x3fbf96=0xc8;}else{_0x3fbf96=0xce;}_0x55ee13[_0x36f7('0x20')](_0x3fbf96);return _0x55ee13['set'](_0x36f7('0x26'),_0x4db519+'-'+_0x1f9a82+'/'+_0x4bb3be)[_0x36f7('0x21')](_0x4479a3);}return null;};}function patchUpdates(_0x3e2ff6){return function(_0x559ec9){try{jsonpatch['apply'](_0x559ec9,_0x3e2ff6,!![]);}catch(_0xa6a7e){return BPromise['reject'](_0xa6a7e);}return _0x559ec9[_0x36f7('0x27')]();};}function saveUpdates(_0x12e517,_0x3808f4){return function(_0x530f1f){if(_0x530f1f){return _0x530f1f[_0x36f7('0x28')](_0x12e517)['then'](function(_0x1d9e07){return _0x1d9e07;});}return null;};}function removeEntity(_0x1198cc,_0x2583d5){return function(_0x42ac73){if(_0x42ac73){return _0x42ac73[_0x36f7('0x29')]()[_0x36f7('0x2a')](function(){var _0x426d6c=_0x42ac73[_0x36f7('0x2b')]({'plain':!![]});var _0x56a49d=_0x36f7('0x2c');return db['UserProfileResource'][_0x36f7('0x29')]({'where':{'type':_0x56a49d,'resourceId':_0x426d6c['id']}})[_0x36f7('0x2a')](function(){return _0x42ac73;});})[_0x36f7('0x2a')](function(){_0x1198cc[_0x36f7('0x20')](0xcc)[_0x36f7('0x2d')]();});}};}function handleEntityNotFound(_0x4509f5,_0x228df3){return function(_0x51774a){if(!_0x51774a){_0x4509f5[_0x36f7('0x1f')](0x194);}return _0x51774a;};}function handleError(_0x5eca88,_0x3f8a9e){_0x3f8a9e=_0x3f8a9e||0x1f4;return function(_0x249282){logger['error'](_0x249282[_0x36f7('0x2e')]);if(_0x249282[_0x36f7('0x2f')]){delete _0x249282[_0x36f7('0x2f')];}_0x5eca88[_0x36f7('0x20')](_0x3f8a9e)[_0x36f7('0x30')](_0x249282);};}exports['index']=function(_0x4ec051,_0x3a1bad){var _0x352467={},_0x209e23={},_0x2c5b9d={'count':0x0,'rows':[]};var _0x4b89e5=_[_0x36f7('0x31')](db[_0x36f7('0x32')][_0x36f7('0x33')],function(_0x5e18db){return{'name':_0x5e18db[_0x36f7('0x34')],'type':_0x5e18db[_0x36f7('0x35')][_0x36f7('0x36')]};});_0x209e23[_0x36f7('0x37')]=_[_0x36f7('0x31')](_0x4b89e5,_0x36f7('0x2f'));_0x209e23['query']=_[_0x36f7('0x38')](_0x4ec051['query']);_0x209e23[_0x36f7('0x39')]=_['intersection'](_0x209e23[_0x36f7('0x37')],_0x209e23[_0x36f7('0x3a')]);_0x352467[_0x36f7('0x3b')]=_[_0x36f7('0x3c')](_0x209e23['model'],qs['fields'](_0x4ec051[_0x36f7('0x3a')][_0x36f7('0x3d')]));_0x352467['attributes']=_0x352467[_0x36f7('0x3b')]['length']?_0x352467[_0x36f7('0x3b')]:_0x209e23[_0x36f7('0x37')];if(!_0x4ec051[_0x36f7('0x3a')][_0x36f7('0x3e')]('nolimit')){_0x352467[_0x36f7('0x25')]=qs['limit'](_0x4ec051['query']['limit']);_0x352467[_0x36f7('0x24')]=qs[_0x36f7('0x24')](_0x4ec051['query'][_0x36f7('0x24')]);}_0x352467[_0x36f7('0x3f')]=qs['sort'](_0x4ec051['query'][_0x36f7('0x40')]);_0x352467[_0x36f7('0x41')]=qs[_0x36f7('0x39')](_[_0x36f7('0x42')](_0x4ec051[_0x36f7('0x3a')],_0x209e23[_0x36f7('0x39')]),_0x4b89e5);if(_0x4ec051[_0x36f7('0x3a')]['filter']){_0x352467['where']=_['merge'](_0x352467[_0x36f7('0x41')],{'$or':_[_0x36f7('0x31')](_0x4b89e5,function(_0x1fb5b2){if(_0x1fb5b2[_0x36f7('0x35')]!==_0x36f7('0x43')){var _0x1255d={};_0x1255d[_0x1fb5b2[_0x36f7('0x2f')]]={'$like':'%'+_0x4ec051[_0x36f7('0x3a')][_0x36f7('0x44')]+'%'};return _0x1255d;}})});}_0x352467=_[_0x36f7('0x45')]({},_0x352467,_0x4ec051['options']);var _0x3d15c8={'where':_0x352467[_0x36f7('0x41')]};return db[_0x36f7('0x32')]['count'](_0x3d15c8)[_0x36f7('0x2a')](function(_0x59eec1){_0x2c5b9d[_0x36f7('0x23')]=_0x59eec1;if(_0x4ec051['query'][_0x36f7('0x46')]){_0x352467['include']=[{'all':!![]}];}return db[_0x36f7('0x32')][_0x36f7('0x47')](_0x352467);})['then'](function(_0x4c9288){_0x2c5b9d[_0x36f7('0x48')]=_0x4c9288;return _0x2c5b9d;})[_0x36f7('0x2a')](respondWithFilteredResult(_0x3a1bad,_0x352467))['catch'](handleError(_0x3a1bad,null));};exports[_0x36f7('0x49')]=function(_0x17e895,_0x413353){var _0x5c032e={'raw':!![],'where':{'id':_0x17e895[_0x36f7('0x4a')]['id']}},_0x39f24b={};_0x39f24b[_0x36f7('0x37')]=_[_0x36f7('0x38')](db[_0x36f7('0x32')][_0x36f7('0x33')]);_0x39f24b[_0x36f7('0x3a')]=_[_0x36f7('0x38')](_0x17e895['query']);_0x39f24b[_0x36f7('0x39')]=_[_0x36f7('0x3c')](_0x39f24b[_0x36f7('0x37')],_0x39f24b['query']);_0x5c032e['attributes']=_[_0x36f7('0x3c')](_0x39f24b[_0x36f7('0x37')],qs[_0x36f7('0x3d')](_0x17e895[_0x36f7('0x3a')][_0x36f7('0x3d')]));_0x5c032e['attributes']=_0x5c032e[_0x36f7('0x3b')]['length']?_0x5c032e[_0x36f7('0x3b')]:_0x39f24b[_0x36f7('0x37')];if(_0x17e895['query']['includeAll']){_0x5c032e[_0x36f7('0x4b')]=[{'all':!![]}];}_0x5c032e=_[_0x36f7('0x45')]({},_0x5c032e,_0x17e895[_0x36f7('0x4c')]);return db[_0x36f7('0x32')]['find'](_0x5c032e)[_0x36f7('0x2a')](handleEntityNotFound(_0x413353,null))['then'](respondWithResult(_0x413353,null))[_0x36f7('0x4d')](handleError(_0x413353,null));};exports[_0x36f7('0x4e')]=function(_0x41c101,_0x299746){return db[_0x36f7('0x32')][_0x36f7('0x4e')](_0x41c101['body'],{})[_0x36f7('0x2a')](function(_0x442b3d){var _0x539dfb=_0x41c101[_0x36f7('0x4f')]['get']({'plain':!![]});if(!_0x539dfb)throw new Error(_0x36f7('0x50'));if(_0x539dfb[_0x36f7('0x51')]===_0x36f7('0x4f')){var _0x1a8d6c=_0x442b3d[_0x36f7('0x2b')]({'plain':!![]});var _0x36e05d='FaxQueues';return db[_0x36f7('0x52')][_0x36f7('0x53')]({'where':{'name':_0x36e05d,'userProfileId':_0x539dfb['userProfileId']},'raw':!![]})[_0x36f7('0x2a')](function(_0x2ddcd4){if(_0x2ddcd4&&_0x2ddcd4[_0x36f7('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x1a8d6c[_0x36f7('0x2f')],'resourceId':_0x1a8d6c['id'],'type':_0x2ddcd4['name'],'sectionId':_0x2ddcd4['id']},{})[_0x36f7('0x2a')](function(){return _0x442b3d;});}else{return _0x442b3d;}})['catch'](function(_0x4cf43a){logger[_0x36f7('0x55')](_0x36f7('0x56'),_0x4cf43a);throw _0x4cf43a;});}return _0x442b3d;})['then'](respondWithResult(_0x299746,0xc9))[_0x36f7('0x4d')](handleError(_0x299746,null));};exports[_0x36f7('0x28')]=function(_0x44791d,_0x1eba9a){if(_0x44791d[_0x36f7('0x57')]['id']){delete _0x44791d[_0x36f7('0x57')]['id'];}return db[_0x36f7('0x32')][_0x36f7('0x53')]({'where':{'id':_0x44791d['params']['id']}})[_0x36f7('0x2a')](handleEntityNotFound(_0x1eba9a,null))['then'](saveUpdates(_0x44791d['body'],null))[_0x36f7('0x2a')](respondWithResult(_0x1eba9a,null))['catch'](handleError(_0x1eba9a,null));};exports['destroy']=function(_0x3e4598,_0x512c2e){return db['FaxQueue']['find']({'where':{'id':_0x3e4598[_0x36f7('0x4a')]['id']}})[_0x36f7('0x2a')](handleEntityNotFound(_0x512c2e,null))[_0x36f7('0x2a')](removeEntity(_0x512c2e,null))[_0x36f7('0x4d')](handleError(_0x512c2e,null));};exports[_0x36f7('0x58')]=function(_0x1520d7,_0x4e04e8){return db[_0x36f7('0x32')][_0x36f7('0x58')]()[_0x36f7('0x2a')](respondWithResult(_0x4e04e8,null))[_0x36f7('0x4d')](handleError(_0x4e04e8,null));};exports[_0x36f7('0x59')]=function(_0x451928,_0x347fab,_0x1436a5){var _0x427ac0={'raw':!![],'where':{}},_0xdb79e6={},_0xa256bd;return db[_0x36f7('0x32')][_0x36f7('0x5a')]({'where':{'id':_0x451928['params']['id']}})[_0x36f7('0x2a')](handleEntityNotFound(_0x347fab,null))[_0x36f7('0x2a')](function(_0x1d7986){if(_0x1d7986){_0xa256bd=_0x1d7986['get']({'plain':!![]});_0xdb79e6[_0x36f7('0x37')]=_[_0x36f7('0x38')](db['UserFaxQueue'][_0x36f7('0x33')]);_0xdb79e6[_0x36f7('0x3a')]=_[_0x36f7('0x38')](_0x451928['query']);_0xdb79e6[_0x36f7('0x39')]=_[_0x36f7('0x3c')](_0xdb79e6[_0x36f7('0x37')],_0xdb79e6[_0x36f7('0x3a')]);_0x427ac0[_0x36f7('0x3b')]=_[_0x36f7('0x3c')](_0xdb79e6[_0x36f7('0x37')],qs[_0x36f7('0x3d')](_0x451928[_0x36f7('0x3a')][_0x36f7('0x3d')]));_0x427ac0[_0x36f7('0x3b')]=_0x427ac0[_0x36f7('0x3b')][_0x36f7('0x5b')]?_0x427ac0[_0x36f7('0x3b')]:_0xdb79e6['model'];if(!_0x451928[_0x36f7('0x3a')][_0x36f7('0x3e')]('nolimit')){_0x427ac0[_0x36f7('0x25')]=qs[_0x36f7('0x25')](_0x451928['query'][_0x36f7('0x25')]);_0x427ac0[_0x36f7('0x24')]=qs[_0x36f7('0x24')](_0x451928[_0x36f7('0x3a')][_0x36f7('0x24')]);}_0x427ac0[_0x36f7('0x3f')]=qs[_0x36f7('0x40')](_0x451928[_0x36f7('0x3a')][_0x36f7('0x40')]);_0x427ac0[_0x36f7('0x41')]=qs[_0x36f7('0x39')](_[_0x36f7('0x42')](_0x451928[_0x36f7('0x3a')],_0xdb79e6['filters']));_0x427ac0[_0x36f7('0x41')][_0x36f7('0x5c')]=_0x1d7986['id'];if(_0x451928[_0x36f7('0x3a')]['filter']){_0x427ac0[_0x36f7('0x41')]=_[_0x36f7('0x45')](_0x427ac0[_0x36f7('0x41')],{'$or':_['map'](_0x427ac0[_0x36f7('0x3b')],function(_0x540c15){var _0x515488={};_0x515488[_0x540c15]={'$like':'%'+_0x451928['query'][_0x36f7('0x44')]+'%'};return _0x515488;})});}_0x427ac0=_[_0x36f7('0x45')]({},_0x427ac0,_0x451928['options']);return db[_0x36f7('0x5d')][_0x36f7('0x47')](_0x427ac0);}})[_0x36f7('0x2a')](function(_0x31c4e1){if(_0x31c4e1){return db['User'][_0x36f7('0x5e')]({'where':{'id':_[_0x36f7('0x31')](_0x31c4e1,_0x36f7('0x5f')),'role':_0x36f7('0x60')},'attributes':['id','name',_0x36f7('0x61'),_0x36f7('0x62'),'createdAt']});}})[_0x36f7('0x2a')](function(_0x2beb60){if(_0x2beb60){return{'count':_0x2beb60['count'],'rows':_[_0x36f7('0x31')](_0x2beb60[_0x36f7('0x48')],function(_0x1ded50){return{'membername':_0x1ded50[_0x36f7('0x2f')],'UserId':_0x1ded50['id'],'queue_name':_0xa256bd[_0x36f7('0x2f')],'FaxQueueId':_0xa256bd['id'],'interface':util[_0x36f7('0x63')](_0x36f7('0x64'),'SIP',_0x1ded50[_0x36f7('0x2f')]),'penalty':0x0,'paused':_0x1ded50[_0x36f7('0x61')],'createdAt':_0x1ded50[_0x36f7('0x65')],'updatedAt':_0x1ded50[_0x36f7('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x36f7('0x2a')](respondWithFilteredResult(_0x347fab,_0x427ac0))[_0x36f7('0x4d')](handleError(_0x347fab,null));};exports[_0x36f7('0x66')]=function(_0x439ea1,_0x52fef5,_0xab2a08){var _0x436f8a={};var _0xed0c35={};var _0x554fdc;var _0x4debb0;return db[_0x36f7('0x32')][_0x36f7('0x5a')]({'where':{'id':_0x439ea1[_0x36f7('0x4a')]['id']}})[_0x36f7('0x2a')](handleEntityNotFound(_0x52fef5,null))[_0x36f7('0x2a')](function(_0xa73c38){if(_0xa73c38){_0x554fdc=_0xa73c38;_0xed0c35[_0x36f7('0x37')]=_['keys'](db['Team'][_0x36f7('0x33')]);_0xed0c35['query']=_[_0x36f7('0x38')](_0x439ea1[_0x36f7('0x3a')]);_0xed0c35[_0x36f7('0x39')]=_[_0x36f7('0x3c')](_0xed0c35[_0x36f7('0x37')],_0xed0c35[_0x36f7('0x3a')]);_0x436f8a[_0x36f7('0x3b')]=_[_0x36f7('0x3c')](_0xed0c35['model'],qs[_0x36f7('0x3d')](_0x439ea1['query'][_0x36f7('0x3d')]));_0x436f8a[_0x36f7('0x3b')]=_0x436f8a[_0x36f7('0x3b')][_0x36f7('0x5b')]?_0x436f8a[_0x36f7('0x3b')]:_0xed0c35[_0x36f7('0x37')];_0x436f8a['order']=qs[_0x36f7('0x40')](_0x439ea1[_0x36f7('0x3a')][_0x36f7('0x40')]);_0x436f8a[_0x36f7('0x41')]=qs[_0x36f7('0x39')](_[_0x36f7('0x42')](_0x439ea1[_0x36f7('0x3a')],_0xed0c35[_0x36f7('0x39')]));if(_0x439ea1['query']['filter']){_0x436f8a[_0x36f7('0x41')]=_['merge'](_0x436f8a[_0x36f7('0x41')],{'$or':_[_0x36f7('0x31')](_0x436f8a[_0x36f7('0x3b')],function(_0xfee980){var _0x565fc1={};_0x565fc1[_0xfee980]={'$like':'%'+_0x439ea1['query'][_0x36f7('0x44')]+'%'};return _0x565fc1;})});}_0x436f8a=_['merge']({},_0x436f8a,_0x439ea1['options']);return _0x554fdc[_0x36f7('0x66')](_0x436f8a);}})[_0x36f7('0x2a')](function(_0x57d511){if(_0x57d511){_0x4debb0=_0x57d511[_0x36f7('0x5b')];if(!_0x439ea1[_0x36f7('0x3a')][_0x36f7('0x3e')](_0x36f7('0x67'))){_0x436f8a[_0x36f7('0x25')]=qs[_0x36f7('0x25')](_0x439ea1['query'][_0x36f7('0x25')]);_0x436f8a[_0x36f7('0x24')]=qs['offset'](_0x439ea1[_0x36f7('0x3a')][_0x36f7('0x24')]);}return _0x554fdc['getTeams'](_0x436f8a);}})[_0x36f7('0x2a')](function(_0x59a151){if(_0x59a151){return _0x59a151?{'count':_0x4debb0,'rows':_0x59a151}:null;}})[_0x36f7('0x2a')](respondWithResult(_0x52fef5,null))[_0x36f7('0x4d')](handleError(_0x52fef5,null));};exports['addTeams']=function(_0x1ec03f,_0x13650a,_0x5aca29){var _0x3f19d7=_0x1ec03f[_0x36f7('0x57')][_0x36f7('0x68')];return db[_0x36f7('0x69')]['findAll']({'where':{'id':_0x3f19d7},'attributes':['id'],'include':[{'model':db[_0x36f7('0x6a')],'as':'Agents','attributes':['id','name',_0x36f7('0x6b'),_0x36f7('0x6c'),_0x36f7('0x6d')],'raw':!![]}]})[_0x36f7('0x2a')](function(_0x3089b6){if(_0x3089b6){var _0x15feeb=_['flatMap'](_0x3089b6,function(_0x4e0ff0){var _0x20202f=_0x4e0ff0[_0x36f7('0x2b')]({'plain':!![]});return _0x20202f['Agents'];});return db['FaxQueue'][_0x36f7('0x53')]({'where':{'id':_0x1ec03f[_0x36f7('0x4a')]['id']}})[_0x36f7('0x2a')](function(_0x47aa74){return db['sequelize']['transaction'](function(_0x361261){return _0x47aa74[_0x36f7('0x6e')](_0x3f19d7,{'transaction':_0x361261})['then'](function(){return BPromise[_0x36f7('0x6f')](_0x15feeb,function(_0xfbc9f8){return db[_0x36f7('0x5d')][_0x36f7('0x70')]({'where':{'UserId':_0xfbc9f8['id'],'FaxQueueId':_0x1ec03f[_0x36f7('0x4a')]['id']},'transaction':_0x361261});});})[_0x36f7('0x2a')](function(){_0x15feeb[_0x36f7('0x71')](function(_0x498d1d){socket[_0x36f7('0x72')](_0x36f7('0x73'),{'UserId':_0x498d1d['id'],'FaxQueueId':_0x47aa74['id']});});});});});}})[_0x36f7('0x2a')](respondWithStatusCode(_0x13650a,null))[_0x36f7('0x4d')](handleError(_0x13650a,null));};exports[_0x36f7('0x74')]=function(_0x132073,_0x4f5ba1,_0x1d5ba1){return db[_0x36f7('0x69')][_0x36f7('0x47')]({'where':{'id':_0x132073[_0x36f7('0x3a')][_0x36f7('0x68')]},'attributes':['id'],'include':[{'model':db[_0x36f7('0x6a')],'as':_0x36f7('0x75'),'attributes':['id'],'raw':!![]}]})[_0x36f7('0x2a')](handleEntityNotFound(_0x4f5ba1,null))[_0x36f7('0x2a')](function(_0x44c3e5){var _0x2a5299=_[_0x36f7('0x31')](_0x44c3e5,'id');var _0x31c5ae=[];var _0x4d38a4=[];var _0x447920=squel[_0x36f7('0x76')]();_0x447920[_0x36f7('0x77')](_0x36f7('0x78'))[_0x36f7('0x79')](_0x36f7('0x7a'),'tq')['join']('user_has_teams','ut',_0x36f7('0x7b'))[_0x36f7('0x41')](_0x36f7('0x7c'),_0x132073[_0x36f7('0x4a')]['id']);for(var _0x571b27=0x0;_0x571b27<_0x44c3e5[_0x36f7('0x5b')];_0x571b27+=0x1){let _0x5a6328=_0x44c3e5[_0x571b27];for(var _0x262c0e=0x0;_0x262c0e<_0x5a6328[_0x36f7('0x75')][_0x36f7('0x5b')];_0x262c0e+=0x1){let _0x584442=_0x5a6328['Agents'][_0x262c0e];var _0x314952=_0x447920[_0x36f7('0x7d')]();_0x314952['where'](_0x36f7('0x7e'),_0x584442['id']);_0x4d38a4[_0x36f7('0x7f')](db[_0x36f7('0x80')][_0x36f7('0x3a')](_0x314952[_0x36f7('0x81')](),{'type':db[_0x36f7('0x80')]['QueryTypes'][_0x36f7('0x82')]})[_0x36f7('0x2a')](function(_0xa68294){if(_0xa68294[_0x36f7('0x5b')]===0x1){return _0x584442['id'];}else{var _0x4fb65d=_[_0x36f7('0x83')](_[_0x36f7('0x31')](_0xa68294,_0x36f7('0x84')),function(_0x4fc318){return _['includes'](_0x2a5299,_0x4fc318);});if(_0x4fb65d){return _0x584442['id'];}}}));}}return BPromise[_0x36f7('0x85')](_0x4d38a4)[_0x36f7('0x2a')](function(_0xa7ef51){_0x31c5ae=_(_0x31c5ae)['union'](_0xa7ef51)['compact']()[_0x36f7('0x86')]();return db[_0x36f7('0x32')][_0x36f7('0x53')]({'where':{'id':_0x132073['params']['id']}})['then'](function(_0x44ac8c){return db[_0x36f7('0x80')]['transaction'](function(_0xae9dce){return _0x44ac8c[_0x36f7('0x74')](_0x132073['query'][_0x36f7('0x68')],{'transaction':_0xae9dce})[_0x36f7('0x2a')](function(){if(!_[_0x36f7('0x87')](_0x31c5ae)){return _0x44ac8c[_0x36f7('0x88')](_0x31c5ae,{'transaction':_0xae9dce});}})[_0x36f7('0x2a')](function(){_0x31c5ae['forEach'](function(_0x184c9f){socket[_0x36f7('0x72')]('userFaxQueue:remove',{'UserId':_0x184c9f,'FaxQueueId':_0x44ac8c['id']});});});});});});})[_0x36f7('0x2a')](respondWithStatusCode(_0x4f5ba1,null))[_0x36f7('0x4d')](handleError(_0x4f5ba1,null));};exports[_0x36f7('0x89')]=function(_0x347220,_0x41cbd3,_0x5518ae){return db[_0x36f7('0x32')]['find']({'where':{'id':_0x347220[_0x36f7('0x4a')]['id']}})[_0x36f7('0x2a')](handleEntityNotFound(_0x41cbd3,null))['then'](function(_0x30ee68){if(_0x30ee68){return _0x30ee68['addAgents'](_0x347220[_0x36f7('0x57')][_0x36f7('0x68')],_['omit'](_0x347220[_0x36f7('0x57')],[_0x36f7('0x68'),'id'])||{})[_0x36f7('0x8a')](function(_0x1a499f){for(var _0x31a1f1=0x0;_0x31a1f1<_0x347220['body'][_0x36f7('0x68')]['length'];_0x31a1f1+=0x1){socket['emit'](_0x36f7('0x73'),{'UserId':Number(_0x347220[_0x36f7('0x57')]['ids'][_0x31a1f1]),'FaxQueueId':Number(_0x347220['params']['id'])});}return _0x1a499f;});}})[_0x36f7('0x2a')](respondWithResult(_0x41cbd3,null))[_0x36f7('0x4d')](handleError(_0x41cbd3,null));};exports[_0x36f7('0x88')]=function(_0x45c91c,_0x21c722,_0x242bae){return db[_0x36f7('0x32')]['find']({'where':{'id':_0x45c91c[_0x36f7('0x4a')]['id']}})[_0x36f7('0x2a')](handleEntityNotFound(_0x21c722,null))[_0x36f7('0x2a')](function(_0x3d4ae2){if(_0x3d4ae2){return _0x3d4ae2[_0x36f7('0x88')](_0x45c91c[_0x36f7('0x3a')][_0x36f7('0x68')])[_0x36f7('0x2a')](function(){if(_[_0x36f7('0x8b')](_0x45c91c[_0x36f7('0x3a')][_0x36f7('0x68')])){for(var _0x46b040=0x0;_0x46b040<_0x45c91c[_0x36f7('0x3a')][_0x36f7('0x68')][_0x36f7('0x5b')];_0x46b040+=0x1){socket[_0x36f7('0x72')](_0x36f7('0x8c'),{'UserId':Number(_0x45c91c[_0x36f7('0x3a')][_0x36f7('0x68')][_0x46b040]),'FaxQueueId':Number(_0x45c91c[_0x36f7('0x4a')]['id'])});}}else{socket['emit'](_0x36f7('0x8c'),{'UserId':Number(_0x45c91c[_0x36f7('0x3a')][_0x36f7('0x68')]),'FaxQueueId':Number(_0x45c91c[_0x36f7('0x4a')]['id'])});}});}})['then'](respondWithStatusCode(_0x21c722,null))['catch'](handleError(_0x21c722,null));};exports['getAgents']=function(_0xdab19b,_0x2166e2,_0x232f50){var _0x580aa6={};var _0x5872f4={};var _0xc29aff;var _0x29ccba;return db[_0x36f7('0x32')][_0x36f7('0x5a')]({'where':{'id':_0xdab19b['params']['id']}})[_0x36f7('0x2a')](handleEntityNotFound(_0x2166e2,null))['then'](function(_0x2d2c49){if(_0x2d2c49){_0xc29aff=_0x2d2c49;_0x5872f4[_0x36f7('0x37')]=_[_0x36f7('0x38')](db[_0x36f7('0x6a')][_0x36f7('0x33')]);_0x5872f4[_0x36f7('0x3a')]=_[_0x36f7('0x38')](_0xdab19b['query']);_0x5872f4[_0x36f7('0x39')]=_[_0x36f7('0x3c')](_0x5872f4['model'],_0x5872f4['query']);_0x580aa6[_0x36f7('0x3b')]=_[_0x36f7('0x3c')](_0x5872f4[_0x36f7('0x37')],qs[_0x36f7('0x3d')](_0xdab19b[_0x36f7('0x3a')]['fields']));_0x580aa6[_0x36f7('0x3b')]=_0x580aa6['attributes'][_0x36f7('0x5b')]?_0x580aa6[_0x36f7('0x3b')]:_0x5872f4[_0x36f7('0x37')];_0x580aa6[_0x36f7('0x3f')]=qs[_0x36f7('0x40')](_0xdab19b['query']['sort']);_0x580aa6[_0x36f7('0x41')]=qs[_0x36f7('0x39')](_['pick'](_0xdab19b[_0x36f7('0x3a')],_0x5872f4['filters']));if(_0xdab19b[_0x36f7('0x3a')][_0x36f7('0x44')]){_0x580aa6[_0x36f7('0x41')]=_['merge'](_0x580aa6['where'],{'$or':_['map'](_0x580aa6[_0x36f7('0x3b')],function(_0x1a0849){var _0x51698b={};_0x51698b[_0x1a0849]={'$like':'%'+_0xdab19b['query'][_0x36f7('0x44')]+'%'};return _0x51698b;})});}_0x580aa6=_[_0x36f7('0x45')]({},_0x580aa6,_0xdab19b[_0x36f7('0x4c')]);return _0xc29aff[_0x36f7('0x8d')](_0x580aa6);}})[_0x36f7('0x2a')](function(_0x38cb91){if(_0x38cb91){_0x29ccba=_0x38cb91[_0x36f7('0x5b')];if(!_0xdab19b[_0x36f7('0x3a')][_0x36f7('0x3e')](_0x36f7('0x67'))){_0x580aa6[_0x36f7('0x25')]=qs[_0x36f7('0x25')](_0xdab19b[_0x36f7('0x3a')][_0x36f7('0x25')]);_0x580aa6[_0x36f7('0x24')]=qs['offset'](_0xdab19b[_0x36f7('0x3a')][_0x36f7('0x24')]);}return _0xc29aff[_0x36f7('0x8d')](_0x580aa6);}})[_0x36f7('0x2a')](function(_0x571530){if(_0x571530){return _0x571530?{'count':_0x29ccba,'rows':_0x571530}:null;}})[_0x36f7('0x2a')](respondWithResult(_0x2166e2,null))[_0x36f7('0x4d')](handleError(_0x2166e2,null));}; \ No newline at end of file +var _0x2248=['count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','FaxQueue','rawAttributes','type','key','query','intersection','model','attributes','fields','length','nolimit','order','where','filters','filter','merge','options','include','findAll','catch','show','params','keys','includeAll','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','FaxQueues','UserProfileSection','find','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserFaxQueue','hasOwnProperty','sort','pick','FaxQueueId','User','findAndCountAll','UserId','agent','updatedAt','createdAt','format','SIP','faxPause','getTeams','ids','Team','Agents','online','voicePause','interface','flatMap','transaction','addTeams','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','select','team_has_fax_queues','join','user_has_teams','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','SELECT','TeamId','includes','all','union','compact','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','isArray','getAgents','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x4420b0,_0x518ff3){var _0xe117a1=function(_0x3f1d25){while(--_0x3f1d25){_0x4420b0['push'](_0x4420b0['shift']());}};_0xe117a1(++_0x518ff3);}(_0x2248,0xf5));var _0x8224=function(_0x659c09,_0x464d40){_0x659c09=_0x659c09-0x0;var _0x2b2f69=_0x2248[_0x659c09];return _0x2b2f69;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8224('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8224('0x1'));var moment=require(_0x8224('0x2'));var BPromise=require(_0x8224('0x3'));var Mustache=require(_0x8224('0x4'));var util=require(_0x8224('0x5'));var path=require(_0x8224('0x6'));var sox=require(_0x8224('0x7'));var csv=require(_0x8224('0x8'));var ejs=require(_0x8224('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8224('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8224('0xb'));var toCsv=require(_0x8224('0x8'));var querystring=require(_0x8224('0xc'));var Papa=require(_0x8224('0xd'));var Redis=require(_0x8224('0xe'));var authService=require(_0x8224('0xf'));var qs=require(_0x8224('0x10'));var as=require(_0x8224('0x11'));var hardwareService=require(_0x8224('0x12'));var logger=require(_0x8224('0x13'))(_0x8224('0x14'));var utils=require(_0x8224('0x15'));var config=require(_0x8224('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x8224('0x17'))['db'];config['redis']=_['defaults'](config[_0x8224('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x8224('0x19'))(new Redis(config[_0x8224('0x18')]));require(_0x8224('0x1a'))[_0x8224('0x1b')](socket);function respondWithStatusCode(_0x2c3398,_0x1d0792){_0x1d0792=_0x1d0792||0xcc;return function(_0x1aae7b){if(_0x1aae7b){return _0x2c3398[_0x8224('0x1c')](_0x1d0792);}return _0x2c3398[_0x8224('0x1d')](_0x1d0792)[_0x8224('0x1e')]();};}function respondWithResult(_0x15f0fc,_0x40905a){_0x40905a=_0x40905a||0xc8;return function(_0x43780d){if(_0x43780d){return _0x15f0fc[_0x8224('0x1d')](_0x40905a)[_0x8224('0x1f')](_0x43780d);}};}function respondWithFilteredResult(_0x24824e,_0x184a95){return function(_0x49057d){if(_0x49057d){var _0x3c46cf=typeof _0x184a95[_0x8224('0x20')]===_0x8224('0x21')&&typeof _0x184a95[_0x8224('0x22')]==='undefined';var _0x496731=_0x49057d[_0x8224('0x23')];var _0x557058=_0x3c46cf?0x0:_0x184a95[_0x8224('0x20')];var _0x10f3f3=_0x3c46cf?_0x49057d['count']:_0x184a95[_0x8224('0x20')]+_0x184a95[_0x8224('0x22')];var _0x27cb72;if(_0x10f3f3>=_0x496731){_0x10f3f3=_0x496731;_0x27cb72=0xc8;}else{_0x27cb72=0xce;}_0x24824e[_0x8224('0x1d')](_0x27cb72);return _0x24824e[_0x8224('0x24')](_0x8224('0x25'),_0x557058+'-'+_0x10f3f3+'/'+_0x496731)[_0x8224('0x1f')](_0x49057d);}return null;};}function patchUpdates(_0x1903aa){return function(_0x2e7b40){try{jsonpatch[_0x8224('0x26')](_0x2e7b40,_0x1903aa,!![]);}catch(_0x2e70b6){return BPromise[_0x8224('0x27')](_0x2e70b6);}return _0x2e7b40[_0x8224('0x28')]();};}function saveUpdates(_0x1cbcfa,_0x25f780){return function(_0x221067){if(_0x221067){return _0x221067[_0x8224('0x29')](_0x1cbcfa)[_0x8224('0x2a')](function(_0x34ec07){return _0x34ec07;});}return null;};}function removeEntity(_0x563352,_0x2f666e){return function(_0x2708f2){if(_0x2708f2){return _0x2708f2[_0x8224('0x2b')]()['then'](function(){var _0x332e84=_0x2708f2['get']({'plain':!![]});var _0x1b874c='FaxQueues';return db['UserProfileResource'][_0x8224('0x2b')]({'where':{'type':_0x1b874c,'resourceId':_0x332e84['id']}})['then'](function(){return _0x2708f2;});})['then'](function(){_0x563352[_0x8224('0x1d')](0xcc)[_0x8224('0x1e')]();});}};}function handleEntityNotFound(_0x41fd5c,_0x1a7696){return function(_0xf50b65){if(!_0xf50b65){_0x41fd5c['sendStatus'](0x194);}return _0xf50b65;};}function handleError(_0x51926a,_0x76a2bf){_0x76a2bf=_0x76a2bf||0x1f4;return function(_0x650e79){logger[_0x8224('0x2c')](_0x650e79[_0x8224('0x2d')]);if(_0x650e79[_0x8224('0x2e')]){delete _0x650e79[_0x8224('0x2e')];}_0x51926a[_0x8224('0x1d')](_0x76a2bf)[_0x8224('0x2f')](_0x650e79);};}exports[_0x8224('0x30')]=function(_0x1be038,_0x107ec6){var _0x524b15={},_0x33e36a={},_0x3d2a9e={'count':0x0,'rows':[]};var _0x2e5cca=_[_0x8224('0x31')](db[_0x8224('0x32')][_0x8224('0x33')],function(_0x4fe18a){return{'name':_0x4fe18a['fieldName'],'type':_0x4fe18a[_0x8224('0x34')][_0x8224('0x35')]};});_0x33e36a['model']=_['map'](_0x2e5cca,_0x8224('0x2e'));_0x33e36a[_0x8224('0x36')]=_['keys'](_0x1be038[_0x8224('0x36')]);_0x33e36a['filters']=_[_0x8224('0x37')](_0x33e36a[_0x8224('0x38')],_0x33e36a[_0x8224('0x36')]);_0x524b15[_0x8224('0x39')]=_['intersection'](_0x33e36a[_0x8224('0x38')],qs[_0x8224('0x3a')](_0x1be038[_0x8224('0x36')]['fields']));_0x524b15['attributes']=_0x524b15[_0x8224('0x39')][_0x8224('0x3b')]?_0x524b15[_0x8224('0x39')]:_0x33e36a[_0x8224('0x38')];if(!_0x1be038['query']['hasOwnProperty'](_0x8224('0x3c'))){_0x524b15[_0x8224('0x22')]=qs['limit'](_0x1be038[_0x8224('0x36')][_0x8224('0x22')]);_0x524b15[_0x8224('0x20')]=qs[_0x8224('0x20')](_0x1be038[_0x8224('0x36')][_0x8224('0x20')]);}_0x524b15[_0x8224('0x3d')]=qs['sort'](_0x1be038['query']['sort']);_0x524b15[_0x8224('0x3e')]=qs[_0x8224('0x3f')](_['pick'](_0x1be038[_0x8224('0x36')],_0x33e36a['filters']),_0x2e5cca);if(_0x1be038[_0x8224('0x36')][_0x8224('0x40')]){_0x524b15[_0x8224('0x3e')]=_[_0x8224('0x41')](_0x524b15[_0x8224('0x3e')],{'$or':_['map'](_0x2e5cca,function(_0x20b478){if(_0x20b478[_0x8224('0x34')]!=='VIRTUAL'){var _0x1b0992={};_0x1b0992[_0x20b478['name']]={'$like':'%'+_0x1be038[_0x8224('0x36')][_0x8224('0x40')]+'%'};return _0x1b0992;}})});}_0x524b15=_[_0x8224('0x41')]({},_0x524b15,_0x1be038[_0x8224('0x42')]);var _0x3c2560={'where':_0x524b15[_0x8224('0x3e')]};return db[_0x8224('0x32')][_0x8224('0x23')](_0x3c2560)[_0x8224('0x2a')](function(_0x61e83b){_0x3d2a9e[_0x8224('0x23')]=_0x61e83b;if(_0x1be038[_0x8224('0x36')]['includeAll']){_0x524b15[_0x8224('0x43')]=[{'all':!![]}];}return db['FaxQueue'][_0x8224('0x44')](_0x524b15);})['then'](function(_0x51aad1){_0x3d2a9e['rows']=_0x51aad1;return _0x3d2a9e;})[_0x8224('0x2a')](respondWithFilteredResult(_0x107ec6,_0x524b15))[_0x8224('0x45')](handleError(_0x107ec6,null));};exports[_0x8224('0x46')]=function(_0x342f09,_0x3fc501){var _0x5171a9={'raw':!![],'where':{'id':_0x342f09[_0x8224('0x47')]['id']}},_0x51dcca={};_0x51dcca[_0x8224('0x38')]=_['keys'](db[_0x8224('0x32')][_0x8224('0x33')]);_0x51dcca[_0x8224('0x36')]=_[_0x8224('0x48')](_0x342f09[_0x8224('0x36')]);_0x51dcca[_0x8224('0x3f')]=_[_0x8224('0x37')](_0x51dcca['model'],_0x51dcca[_0x8224('0x36')]);_0x5171a9[_0x8224('0x39')]=_['intersection'](_0x51dcca['model'],qs[_0x8224('0x3a')](_0x342f09[_0x8224('0x36')][_0x8224('0x3a')]));_0x5171a9[_0x8224('0x39')]=_0x5171a9['attributes'][_0x8224('0x3b')]?_0x5171a9['attributes']:_0x51dcca['model'];if(_0x342f09[_0x8224('0x36')][_0x8224('0x49')]){_0x5171a9['include']=[{'all':!![]}];}_0x5171a9=_[_0x8224('0x41')]({},_0x5171a9,_0x342f09[_0x8224('0x42')]);return db[_0x8224('0x32')]['find'](_0x5171a9)[_0x8224('0x2a')](handleEntityNotFound(_0x3fc501,null))[_0x8224('0x2a')](respondWithResult(_0x3fc501,null))[_0x8224('0x45')](handleError(_0x3fc501,null));};exports[_0x8224('0x4a')]=function(_0x914286,_0x5a4e56){return db['FaxQueue'][_0x8224('0x4a')](_0x914286['body'],{})['then'](function(_0x503876){var _0x24c976=_0x914286[_0x8224('0x4b')][_0x8224('0x4c')]({'plain':!![]});if(!_0x24c976)throw new Error(_0x8224('0x4d'));if(_0x24c976[_0x8224('0x4e')]===_0x8224('0x4b')){var _0x5907a4=_0x503876[_0x8224('0x4c')]({'plain':!![]});var _0x111a44=_0x8224('0x4f');return db[_0x8224('0x50')][_0x8224('0x51')]({'where':{'name':_0x111a44,'userProfileId':_0x24c976['userProfileId']},'raw':!![]})[_0x8224('0x2a')](function(_0xeee0cc){if(_0xeee0cc&&_0xeee0cc['autoAssociation']===0x0){return db[_0x8224('0x52')][_0x8224('0x4a')]({'name':_0x5907a4['name'],'resourceId':_0x5907a4['id'],'type':_0xeee0cc[_0x8224('0x2e')],'sectionId':_0xeee0cc['id']},{})['then'](function(){return _0x503876;});}else{return _0x503876;}})[_0x8224('0x45')](function(_0x2e2d7f){logger[_0x8224('0x2c')](_0x8224('0x53'),_0x2e2d7f);throw _0x2e2d7f;});}return _0x503876;})[_0x8224('0x2a')](respondWithResult(_0x5a4e56,0xc9))['catch'](handleError(_0x5a4e56,null));};exports['update']=function(_0x1cc9e8,_0x392014){if(_0x1cc9e8[_0x8224('0x54')]['id']){delete _0x1cc9e8[_0x8224('0x54')]['id'];}return db[_0x8224('0x32')][_0x8224('0x51')]({'where':{'id':_0x1cc9e8[_0x8224('0x47')]['id']}})[_0x8224('0x2a')](handleEntityNotFound(_0x392014,null))['then'](saveUpdates(_0x1cc9e8[_0x8224('0x54')],null))[_0x8224('0x2a')](respondWithResult(_0x392014,null))['catch'](handleError(_0x392014,null));};exports[_0x8224('0x2b')]=function(_0x419b9a,_0x2d648a){return db[_0x8224('0x32')]['find']({'where':{'id':_0x419b9a['params']['id']}})[_0x8224('0x2a')](handleEntityNotFound(_0x2d648a,null))[_0x8224('0x2a')](removeEntity(_0x2d648a,null))[_0x8224('0x45')](handleError(_0x2d648a,null));};exports[_0x8224('0x55')]=function(_0x3eba0a,_0x4c9b4a){return db[_0x8224('0x32')][_0x8224('0x55')]()['then'](respondWithResult(_0x4c9b4a,null))[_0x8224('0x45')](handleError(_0x4c9b4a,null));};exports[_0x8224('0x56')]=function(_0x4fb36f,_0x121034,_0x36ff7a){var _0x32ae5d={'raw':!![],'where':{}},_0x27b4a5={},_0x514930;return db['FaxQueue'][_0x8224('0x57')]({'where':{'id':_0x4fb36f[_0x8224('0x47')]['id']}})[_0x8224('0x2a')](handleEntityNotFound(_0x121034,null))['then'](function(_0x1e7c06){if(_0x1e7c06){_0x514930=_0x1e7c06[_0x8224('0x4c')]({'plain':!![]});_0x27b4a5['model']=_[_0x8224('0x48')](db[_0x8224('0x58')]['rawAttributes']);_0x27b4a5['query']=_['keys'](_0x4fb36f['query']);_0x27b4a5[_0x8224('0x3f')]=_[_0x8224('0x37')](_0x27b4a5[_0x8224('0x38')],_0x27b4a5[_0x8224('0x36')]);_0x32ae5d['attributes']=_['intersection'](_0x27b4a5[_0x8224('0x38')],qs['fields'](_0x4fb36f[_0x8224('0x36')][_0x8224('0x3a')]));_0x32ae5d[_0x8224('0x39')]=_0x32ae5d[_0x8224('0x39')][_0x8224('0x3b')]?_0x32ae5d[_0x8224('0x39')]:_0x27b4a5['model'];if(!_0x4fb36f[_0x8224('0x36')][_0x8224('0x59')]('nolimit')){_0x32ae5d['limit']=qs[_0x8224('0x22')](_0x4fb36f['query'][_0x8224('0x22')]);_0x32ae5d[_0x8224('0x20')]=qs[_0x8224('0x20')](_0x4fb36f['query'][_0x8224('0x20')]);}_0x32ae5d['order']=qs[_0x8224('0x5a')](_0x4fb36f[_0x8224('0x36')][_0x8224('0x5a')]);_0x32ae5d['where']=qs['filters'](_[_0x8224('0x5b')](_0x4fb36f[_0x8224('0x36')],_0x27b4a5['filters']));_0x32ae5d[_0x8224('0x3e')][_0x8224('0x5c')]=_0x1e7c06['id'];if(_0x4fb36f[_0x8224('0x36')][_0x8224('0x40')]){_0x32ae5d[_0x8224('0x3e')]=_['merge'](_0x32ae5d[_0x8224('0x3e')],{'$or':_[_0x8224('0x31')](_0x32ae5d[_0x8224('0x39')],function(_0x326f9a){var _0x1ab51d={};_0x1ab51d[_0x326f9a]={'$like':'%'+_0x4fb36f['query'][_0x8224('0x40')]+'%'};return _0x1ab51d;})});}_0x32ae5d=_[_0x8224('0x41')]({},_0x32ae5d,_0x4fb36f['options']);return db[_0x8224('0x58')][_0x8224('0x44')](_0x32ae5d);}})[_0x8224('0x2a')](function(_0x5876a3){if(_0x5876a3){return db[_0x8224('0x5d')][_0x8224('0x5e')]({'where':{'id':_[_0x8224('0x31')](_0x5876a3,_0x8224('0x5f')),'role':_0x8224('0x60')},'attributes':['id',_0x8224('0x2e'),'faxPause',_0x8224('0x61'),_0x8224('0x62')]});}})[_0x8224('0x2a')](function(_0x1d74be){if(_0x1d74be){return{'count':_0x1d74be[_0x8224('0x23')],'rows':_['map'](_0x1d74be['rows'],function(_0x18a454){return{'membername':_0x18a454['name'],'UserId':_0x18a454['id'],'queue_name':_0x514930[_0x8224('0x2e')],'FaxQueueId':_0x514930['id'],'interface':util[_0x8224('0x63')]('%s/%s',_0x8224('0x64'),_0x18a454[_0x8224('0x2e')]),'penalty':0x0,'paused':_0x18a454[_0x8224('0x65')],'createdAt':_0x18a454[_0x8224('0x62')],'updatedAt':_0x18a454[_0x8224('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x121034,_0x32ae5d))[_0x8224('0x45')](handleError(_0x121034,null));};exports[_0x8224('0x66')]=function(_0x374f25,_0x18a69f,_0x26a260){var _0x4d92af={};var _0xf77408={};var _0x25726a;var _0x379600;return db['FaxQueue']['findOne']({'where':{'id':_0x374f25[_0x8224('0x47')]['id']}})[_0x8224('0x2a')](handleEntityNotFound(_0x18a69f,null))[_0x8224('0x2a')](function(_0x4fa89f){if(_0x4fa89f){_0x25726a=_0x4fa89f;_0xf77408[_0x8224('0x38')]=_[_0x8224('0x48')](db['Team'][_0x8224('0x33')]);_0xf77408[_0x8224('0x36')]=_[_0x8224('0x48')](_0x374f25['query']);_0xf77408[_0x8224('0x3f')]=_['intersection'](_0xf77408[_0x8224('0x38')],_0xf77408[_0x8224('0x36')]);_0x4d92af['attributes']=_['intersection'](_0xf77408[_0x8224('0x38')],qs[_0x8224('0x3a')](_0x374f25[_0x8224('0x36')]['fields']));_0x4d92af[_0x8224('0x39')]=_0x4d92af[_0x8224('0x39')]['length']?_0x4d92af['attributes']:_0xf77408[_0x8224('0x38')];_0x4d92af[_0x8224('0x3d')]=qs[_0x8224('0x5a')](_0x374f25[_0x8224('0x36')][_0x8224('0x5a')]);_0x4d92af[_0x8224('0x3e')]=qs[_0x8224('0x3f')](_['pick'](_0x374f25[_0x8224('0x36')],_0xf77408[_0x8224('0x3f')]));if(_0x374f25[_0x8224('0x36')][_0x8224('0x40')]){_0x4d92af[_0x8224('0x3e')]=_[_0x8224('0x41')](_0x4d92af[_0x8224('0x3e')],{'$or':_[_0x8224('0x31')](_0x4d92af['attributes'],function(_0x5ddfe3){var _0x1a9338={};_0x1a9338[_0x5ddfe3]={'$like':'%'+_0x374f25[_0x8224('0x36')]['filter']+'%'};return _0x1a9338;})});}_0x4d92af=_[_0x8224('0x41')]({},_0x4d92af,_0x374f25['options']);return _0x25726a[_0x8224('0x66')](_0x4d92af);}})[_0x8224('0x2a')](function(_0x13c8a4){if(_0x13c8a4){_0x379600=_0x13c8a4[_0x8224('0x3b')];if(!_0x374f25[_0x8224('0x36')][_0x8224('0x59')](_0x8224('0x3c'))){_0x4d92af[_0x8224('0x22')]=qs[_0x8224('0x22')](_0x374f25[_0x8224('0x36')][_0x8224('0x22')]);_0x4d92af[_0x8224('0x20')]=qs[_0x8224('0x20')](_0x374f25['query'][_0x8224('0x20')]);}return _0x25726a[_0x8224('0x66')](_0x4d92af);}})[_0x8224('0x2a')](function(_0xafaa39){if(_0xafaa39){return _0xafaa39?{'count':_0x379600,'rows':_0xafaa39}:null;}})[_0x8224('0x2a')](respondWithResult(_0x18a69f,null))[_0x8224('0x45')](handleError(_0x18a69f,null));};exports['addTeams']=function(_0xd162ef,_0x1f2fc1,_0x333dc7){var _0x2a4f97=_0xd162ef[_0x8224('0x54')][_0x8224('0x67')];return db[_0x8224('0x68')][_0x8224('0x44')]({'where':{'id':_0x2a4f97},'attributes':['id'],'include':[{'model':db[_0x8224('0x5d')],'as':_0x8224('0x69'),'attributes':['id',_0x8224('0x2e'),_0x8224('0x6a'),_0x8224('0x6b'),_0x8224('0x6c')],'raw':!![]}]})['then'](function(_0x3bb2c5){if(_0x3bb2c5){var _0x4647f6=_[_0x8224('0x6d')](_0x3bb2c5,function(_0x563a07){var _0x459e79=_0x563a07[_0x8224('0x4c')]({'plain':!![]});return _0x459e79[_0x8224('0x69')];});return db['FaxQueue'][_0x8224('0x51')]({'where':{'id':_0xd162ef[_0x8224('0x47')]['id']}})[_0x8224('0x2a')](function(_0xa66110){return db['sequelize'][_0x8224('0x6e')](function(_0x54a752){return _0xa66110[_0x8224('0x6f')](_0x2a4f97,{'transaction':_0x54a752})[_0x8224('0x2a')](function(){return BPromise['each'](_0x4647f6,function(_0x1c4424){return db[_0x8224('0x58')][_0x8224('0x70')]({'where':{'UserId':_0x1c4424['id'],'FaxQueueId':_0xd162ef[_0x8224('0x47')]['id']},'transaction':_0x54a752});});})['then'](function(){_0x4647f6[_0x8224('0x71')](function(_0x1eb8c1){socket[_0x8224('0x72')](_0x8224('0x73'),{'UserId':_0x1eb8c1['id'],'FaxQueueId':_0xa66110['id']});});});});});}})[_0x8224('0x2a')](respondWithStatusCode(_0x1f2fc1,null))[_0x8224('0x45')](handleError(_0x1f2fc1,null));};exports[_0x8224('0x74')]=function(_0x3d1d5f,_0xe9bce5,_0xf69904){return db[_0x8224('0x68')][_0x8224('0x44')]({'where':{'id':_0x3d1d5f[_0x8224('0x36')][_0x8224('0x67')]},'attributes':['id'],'include':[{'model':db[_0x8224('0x5d')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x8224('0x2a')](handleEntityNotFound(_0xe9bce5,null))[_0x8224('0x2a')](function(_0x59c2b6){var _0x309315=_[_0x8224('0x31')](_0x59c2b6,'id');var _0x1bca8b=[];var _0x237f52=[];var _0x4431c4=squel[_0x8224('0x75')]();_0x4431c4['field']('tq.TeamId')['from'](_0x8224('0x76'),'tq')[_0x8224('0x77')](_0x8224('0x78'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x8224('0x3e')](_0x8224('0x79'),_0x3d1d5f[_0x8224('0x47')]['id']);for(var _0x4524ee=0x0;_0x4524ee<_0x59c2b6[_0x8224('0x3b')];_0x4524ee+=0x1){let _0x2e5dc1=_0x59c2b6[_0x4524ee];for(var _0x2326bc=0x0;_0x2326bc<_0x2e5dc1[_0x8224('0x69')][_0x8224('0x3b')];_0x2326bc+=0x1){let _0x17a4bc=_0x2e5dc1[_0x8224('0x69')][_0x2326bc];var _0x43948e=_0x4431c4[_0x8224('0x7a')]();_0x43948e[_0x8224('0x3e')](_0x8224('0x7b'),_0x17a4bc['id']);_0x237f52[_0x8224('0x7c')](db[_0x8224('0x7d')]['query'](_0x43948e[_0x8224('0x7e')](),{'type':db[_0x8224('0x7d')]['QueryTypes'][_0x8224('0x7f')]})[_0x8224('0x2a')](function(_0x41c023){if(_0x41c023[_0x8224('0x3b')]===0x1){return _0x17a4bc['id'];}else{var _0x215f17=_['every'](_[_0x8224('0x31')](_0x41c023,_0x8224('0x80')),function(_0x23b5b4){return _[_0x8224('0x81')](_0x309315,_0x23b5b4);});if(_0x215f17){return _0x17a4bc['id'];}}}));}}return BPromise[_0x8224('0x82')](_0x237f52)[_0x8224('0x2a')](function(_0x34dbc3){_0x1bca8b=_(_0x1bca8b)[_0x8224('0x83')](_0x34dbc3)[_0x8224('0x84')]()['value']();return db[_0x8224('0x32')][_0x8224('0x51')]({'where':{'id':_0x3d1d5f['params']['id']}})['then'](function(_0x36f30c){return db[_0x8224('0x7d')][_0x8224('0x6e')](function(_0xf5cdae){return _0x36f30c['removeTeams'](_0x3d1d5f['query'][_0x8224('0x67')],{'transaction':_0xf5cdae})['then'](function(){if(!_[_0x8224('0x85')](_0x1bca8b)){return _0x36f30c[_0x8224('0x86')](_0x1bca8b,{'transaction':_0xf5cdae});}})[_0x8224('0x2a')](function(){_0x1bca8b['forEach'](function(_0xbf85d7){socket['emit'](_0x8224('0x87'),{'UserId':_0xbf85d7,'FaxQueueId':_0x36f30c['id']});});});});});});})[_0x8224('0x2a')](respondWithStatusCode(_0xe9bce5,null))[_0x8224('0x45')](handleError(_0xe9bce5,null));};exports[_0x8224('0x88')]=function(_0x38b6f6,_0x2e3f21,_0x5a8d01){return db[_0x8224('0x32')][_0x8224('0x51')]({'where':{'id':_0x38b6f6[_0x8224('0x47')]['id']}})[_0x8224('0x2a')](handleEntityNotFound(_0x2e3f21,null))['then'](function(_0x1de88e){if(_0x1de88e){return _0x1de88e[_0x8224('0x88')](_0x38b6f6[_0x8224('0x54')][_0x8224('0x67')],_[_0x8224('0x89')](_0x38b6f6['body'],['ids','id'])||{})['spread'](function(_0x29783e){for(var _0x2832ad=0x0;_0x2832ad<_0x38b6f6[_0x8224('0x54')][_0x8224('0x67')][_0x8224('0x3b')];_0x2832ad+=0x1){socket['emit'](_0x8224('0x73'),{'UserId':Number(_0x38b6f6['body'][_0x8224('0x67')][_0x2832ad]),'FaxQueueId':Number(_0x38b6f6[_0x8224('0x47')]['id'])});}return _0x29783e;});}})['then'](respondWithResult(_0x2e3f21,null))['catch'](handleError(_0x2e3f21,null));};exports[_0x8224('0x86')]=function(_0x252267,_0x20bdca,_0x4c64a6){return db[_0x8224('0x32')]['find']({'where':{'id':_0x252267['params']['id']}})['then'](handleEntityNotFound(_0x20bdca,null))['then'](function(_0x410106){if(_0x410106){return _0x410106[_0x8224('0x86')](_0x252267[_0x8224('0x36')][_0x8224('0x67')])[_0x8224('0x2a')](function(){if(_[_0x8224('0x8a')](_0x252267[_0x8224('0x36')]['ids'])){for(var _0x9161de=0x0;_0x9161de<_0x252267['query']['ids'][_0x8224('0x3b')];_0x9161de+=0x1){socket[_0x8224('0x72')]('userFaxQueue:remove',{'UserId':Number(_0x252267[_0x8224('0x36')][_0x8224('0x67')][_0x9161de]),'FaxQueueId':Number(_0x252267[_0x8224('0x47')]['id'])});}}else{socket['emit'](_0x8224('0x87'),{'UserId':Number(_0x252267[_0x8224('0x36')][_0x8224('0x67')]),'FaxQueueId':Number(_0x252267['params']['id'])});}});}})[_0x8224('0x2a')](respondWithStatusCode(_0x20bdca,null))[_0x8224('0x45')](handleError(_0x20bdca,null));};exports[_0x8224('0x8b')]=function(_0x6187b9,_0x560619,_0x51c8f3){var _0x32353a={};var _0x702641={};var _0x70fcaf;var _0x415f43;return db[_0x8224('0x32')][_0x8224('0x57')]({'where':{'id':_0x6187b9[_0x8224('0x47')]['id']}})[_0x8224('0x2a')](handleEntityNotFound(_0x560619,null))[_0x8224('0x2a')](function(_0x5c1fa8){if(_0x5c1fa8){_0x70fcaf=_0x5c1fa8;_0x702641['model']=_['keys'](db[_0x8224('0x5d')][_0x8224('0x33')]);_0x702641[_0x8224('0x36')]=_[_0x8224('0x48')](_0x6187b9[_0x8224('0x36')]);_0x702641[_0x8224('0x3f')]=_[_0x8224('0x37')](_0x702641['model'],_0x702641[_0x8224('0x36')]);_0x32353a['attributes']=_[_0x8224('0x37')](_0x702641['model'],qs['fields'](_0x6187b9['query'][_0x8224('0x3a')]));_0x32353a[_0x8224('0x39')]=_0x32353a['attributes']['length']?_0x32353a[_0x8224('0x39')]:_0x702641[_0x8224('0x38')];_0x32353a[_0x8224('0x3d')]=qs[_0x8224('0x5a')](_0x6187b9[_0x8224('0x36')][_0x8224('0x5a')]);_0x32353a['where']=qs[_0x8224('0x3f')](_['pick'](_0x6187b9[_0x8224('0x36')],_0x702641[_0x8224('0x3f')]));if(_0x6187b9['query']['filter']){_0x32353a[_0x8224('0x3e')]=_['merge'](_0x32353a[_0x8224('0x3e')],{'$or':_[_0x8224('0x31')](_0x32353a[_0x8224('0x39')],function(_0x56b845){var _0x32b132={};_0x32b132[_0x56b845]={'$like':'%'+_0x6187b9['query'][_0x8224('0x40')]+'%'};return _0x32b132;})});}_0x32353a=_['merge']({},_0x32353a,_0x6187b9[_0x8224('0x42')]);return _0x70fcaf['getAgents'](_0x32353a);}})[_0x8224('0x2a')](function(_0x3bec3d){if(_0x3bec3d){_0x415f43=_0x3bec3d[_0x8224('0x3b')];if(!_0x6187b9[_0x8224('0x36')][_0x8224('0x59')]('nolimit')){_0x32353a[_0x8224('0x22')]=qs[_0x8224('0x22')](_0x6187b9[_0x8224('0x36')]['limit']);_0x32353a[_0x8224('0x20')]=qs['offset'](_0x6187b9[_0x8224('0x36')]['offset']);}return _0x70fcaf['getAgents'](_0x32353a);}})[_0x8224('0x2a')](function(_0x4a737e){if(_0x4a737e){return _0x4a737e?{'count':_0x415f43,'rows':_0x4a737e}:null;}})[_0x8224('0x2a')](respondWithResult(_0x560619,null))['catch'](handleError(_0x560619,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index c36ea4a..28cc1bc 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 _0x445e=['exports','../../mysqldb','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x445e,0x1e1));var _0xe445=function(_0x1d086b,_0x46c897){_0x1d086b=_0x1d086b-0x0;var _0x5f4bee=_0x445e[_0x1d086b];return _0x5f4bee;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0xe445('0x0'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe445('0x1'),'afterUpdate':_0xe445('0x2'),'afterDestroy':_0xe445('0x3')};function emitEvent(_0x51d085){return function(_0x2dbec4,_0x42e0d6,_0x12d7ee){FaxQueueEvents[_0xe445('0x4')](_0x51d085+':'+_0x2dbec4['id'],_0x2dbec4);FaxQueueEvents['emit'](_0x51d085,_0x2dbec4);_0x12d7ee(null);};}for(var e in events){if(events[_0xe445('0x5')](e)){var event=events[e];FaxQueue[_0xe445('0x6')](e,emitEvent(event));}}module[_0xe445('0x7')]=FaxQueueEvents; \ No newline at end of file +var _0xfd28=['hook','exports','events','../../mysqldb','FaxQueue','setMaxListeners','update','remove','hasOwnProperty'];(function(_0x3bd9ff,_0x3bcfc0){var _0x42835b=function(_0x278965){while(--_0x278965){_0x3bd9ff['push'](_0x3bd9ff['shift']());}};_0x42835b(++_0x3bcfc0);}(_0xfd28,0x197));var _0x8fd2=function(_0x4c05da,_0x414720){_0x4c05da=_0x4c05da-0x0;var _0x1614db=_0xfd28[_0x4c05da];return _0x1614db;};'use strict';var EventEmitter=require(_0x8fd2('0x0'));var FaxQueue=require(_0x8fd2('0x1'))['db'][_0x8fd2('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x8fd2('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8fd2('0x4'),'afterDestroy':_0x8fd2('0x5')};function emitEvent(_0x453b78){return function(_0x2935cb,_0x24d9d0,_0xb597b9){FaxQueueEvents['emit'](_0x453b78+':'+_0x2935cb['id'],_0x2935cb);FaxQueueEvents['emit'](_0x453b78,_0x2935cb);_0xb597b9(null);};}for(var e in events){if(events[_0x8fd2('0x6')](e)){var event=events[e];FaxQueue[_0x8fd2('0x7')](e,emitEvent(event));}}module[_0x8fd2('0x8')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 84faafc..4328a78 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 _0x2068=['fax_queues','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','exports','define','FaxQueue'];(function(_0x17e674,_0x3c8f35){var _0x2bb0a9=function(_0x1d8286){while(--_0x1d8286){_0x17e674['push'](_0x17e674['shift']());}};_0x2bb0a9(++_0x3c8f35);}(_0x2068,0x1a5));var _0x8206=function(_0x55a787,_0x1466a3){_0x55a787=_0x55a787-0x0;var _0x5d90a0=_0x2068[_0x55a787];return _0x5d90a0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8206('0x0'))(_0x8206('0x1'));var moment=require(_0x8206('0x2'));var BPromise=require(_0x8206('0x3'));var rp=require(_0x8206('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8206('0x5'));var attributes=require('./faxQueue.attributes');module[_0x8206('0x6')]=function(_0x436f68,_0x2b28c1){return _0x436f68[_0x8206('0x7')](_0x8206('0x8'),attributes,{'tableName':_0x8206('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6a47=['define','FaxQueue','fax_queues','lodash','../../config/logger','api','bluebird','request-promise','path','./faxQueue.attributes','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6a47,0x18f));var _0x76a4=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x6a47[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x76a4('0x0'));var util=require('util');var logger=require(_0x76a4('0x1'))(_0x76a4('0x2'));var moment=require('moment');var BPromise=require(_0x76a4('0x3'));var rp=require(_0x76a4('0x4'));var fs=require('fs');var path=require(_0x76a4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x76a4('0x6'));module[_0x76a4('0x7')]=function(_0x252b48,_0x253973){return _0x252b48[_0x76a4('0x8')](_0x76a4('0x9'),attributes,{'tableName':_0x76a4('0xa'),'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 7b86d48..f2aec93 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 _0x1c4e=['debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetFaxQueue','options','raw','limit','include','map','model','attributes','FaxQueue','find','ShowFaxQueue','lodash','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent'];(function(_0xad4203,_0x5c5fc5){var _0x455ee1=function(_0x44fd8d){while(--_0x44fd8d){_0xad4203['push'](_0xad4203['shift']());}};_0x455ee1(++_0x5c5fc5);}(_0x1c4e,0x1f3));var _0xe1c4=function(_0x5dac37,_0x430287){_0x5dac37=_0x5dac37-0x0;var _0x4cb576=_0x1c4e[_0x5dac37];return _0x4cb576;};'use strict';var _=require(_0xe1c4('0x0'));var util=require('util');var moment=require(_0xe1c4('0x1'));var BPromise=require(_0xe1c4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe1c4('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe1c4('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xe1c4('0x5'));var jayson=require(_0xe1c4('0x6'));var client=jayson['client'][_0xe1c4('0x7')]({'port':0x232a});config['redis']=_[_0xe1c4('0x8')](config[_0xe1c4('0x9')],{'host':_0xe1c4('0xa'),'port':0x18eb});var socket=require(_0xe1c4('0xb'))(new Redis(config[_0xe1c4('0x9')]));require(_0xe1c4('0xc'))[_0xe1c4('0xd')](socket);function respondWithRpcPromise(_0x27e340,_0x3f935e,_0x2db7fa){return new BPromise(function(_0x140d24,_0x3edf46){return client[_0xe1c4('0xe')](_0x27e340,_0x2db7fa)[_0xe1c4('0xf')](function(_0x4f419f){logger[_0xe1c4('0x10')](_0xe1c4('0x11'),_0x3f935e,_0xe1c4('0x12'));logger[_0xe1c4('0x13')](_0xe1c4('0x14'),_0x3f935e,_0xe1c4('0x12'),JSON[_0xe1c4('0x15')](_0x4f419f));if(_0x4f419f[_0xe1c4('0x16')]){if(_0x4f419f[_0xe1c4('0x16')]['code']===0x1f4){logger['error'](_0xe1c4('0x11'),_0x3f935e,_0x4f419f[_0xe1c4('0x16')][_0xe1c4('0x17')]);return _0x3edf46(_0x4f419f[_0xe1c4('0x16')][_0xe1c4('0x17')]);}logger[_0xe1c4('0x16')](_0xe1c4('0x11'),_0x3f935e,_0x4f419f[_0xe1c4('0x16')][_0xe1c4('0x17')]);return _0x140d24(_0x4f419f[_0xe1c4('0x16')][_0xe1c4('0x17')]);}else{logger[_0xe1c4('0x10')](_0xe1c4('0x11'),_0x3f935e,_0xe1c4('0x12'));_0x140d24(_0x4f419f[_0xe1c4('0x18')]['message']);}})[_0xe1c4('0x19')](function(_0x4f9954){logger[_0xe1c4('0x16')](_0xe1c4('0x11'),_0x3f935e,_0x4f9954);_0x3edf46(_0x4f9954);});});}exports[_0xe1c4('0x1a')]=function(_0x41d5d7){var _0x22a6c0=this;return new Promise(function(_0x3e19e4,_0x8307ce){return db['FaxQueue']['findAll']({'raw':_0x41d5d7['options']?_0x41d5d7[_0xe1c4('0x1b')][_0xe1c4('0x1c')]===undefined?!![]:![]:!![],'where':_0x41d5d7[_0xe1c4('0x1b')]?_0x41d5d7[_0xe1c4('0x1b')]['where']||null:null,'attributes':_0x41d5d7[_0xe1c4('0x1b')]?_0x41d5d7[_0xe1c4('0x1b')]['attributes']||null:null,'limit':_0x41d5d7[_0xe1c4('0x1b')]?_0x41d5d7[_0xe1c4('0x1b')][_0xe1c4('0x1d')]||null:null,'include':_0x41d5d7[_0xe1c4('0x1b')]?_0x41d5d7[_0xe1c4('0x1b')][_0xe1c4('0x1e')]?_[_0xe1c4('0x1f')](_0x41d5d7[_0xe1c4('0x1b')][_0xe1c4('0x1e')],function(_0xb2387e){return{'model':db[_0xb2387e[_0xe1c4('0x20')]],'as':_0xb2387e['as'],'attributes':_0xb2387e[_0xe1c4('0x21')],'include':_0xb2387e[_0xe1c4('0x1e')]?_['map'](_0xb2387e['include'],function(_0x3ae3a0){return{'model':db[_0x3ae3a0[_0xe1c4('0x20')]],'as':_0x3ae3a0['as'],'attributes':_0x3ae3a0[_0xe1c4('0x21')],'include':_0x3ae3a0[_0xe1c4('0x1e')]?_[_0xe1c4('0x1f')](_0x3ae3a0[_0xe1c4('0x1e')],function(_0x47a202){return{'model':db[_0x47a202[_0xe1c4('0x20')]],'as':_0x47a202['as'],'attributes':_0x47a202['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4c80fd){logger['info'](_0xe1c4('0x1a'),_0x41d5d7);logger['debug'](_0xe1c4('0x1a'),_0x41d5d7,JSON[_0xe1c4('0x15')](_0x4c80fd));_0x3e19e4(_0x4c80fd);})[_0xe1c4('0x19')](function(_0x5ec7b1){logger[_0xe1c4('0x16')]('GetFaxQueue',_0x5ec7b1['message'],_0x41d5d7);_0x8307ce(_0x22a6c0[_0xe1c4('0x16')](0x1f4,_0x5ec7b1[_0xe1c4('0x17')]));});});};exports['ShowFaxQueue']=function(_0x2b0af6){var _0x2a01d8=this;return new Promise(function(_0x38dee2,_0x2c03e5){return db[_0xe1c4('0x22')][_0xe1c4('0x23')]({'raw':_0x2b0af6[_0xe1c4('0x1b')]?_0x2b0af6['options'][_0xe1c4('0x1c')]===undefined?!![]:![]:!![],'where':_0x2b0af6['options']?_0x2b0af6[_0xe1c4('0x1b')]['where']||null:null,'attributes':_0x2b0af6[_0xe1c4('0x1b')]?_0x2b0af6['options'][_0xe1c4('0x21')]||null:null,'include':_0x2b0af6[_0xe1c4('0x1b')]?_0x2b0af6[_0xe1c4('0x1b')][_0xe1c4('0x1e')]?_[_0xe1c4('0x1f')](_0x2b0af6['options']['include'],function(_0x4cfa74){return{'model':db[_0x4cfa74['model']],'as':_0x4cfa74['as'],'attributes':_0x4cfa74[_0xe1c4('0x21')],'include':_0x4cfa74[_0xe1c4('0x1e')]?_['map'](_0x4cfa74[_0xe1c4('0x1e')],function(_0x19e468){return{'model':db[_0x19e468[_0xe1c4('0x20')]],'as':_0x19e468['as'],'attributes':_0x19e468[_0xe1c4('0x21')],'include':_0x19e468[_0xe1c4('0x1e')]?_[_0xe1c4('0x1f')](_0x19e468[_0xe1c4('0x1e')],function(_0x3ca4c7){return{'model':db[_0x3ca4c7['model']],'as':_0x3ca4c7['as'],'attributes':_0x3ca4c7[_0xe1c4('0x21')]};}):[]};}):[]};}):[]:[]})[_0xe1c4('0xf')](function(_0x55be42){logger['info']('ShowFaxQueue',_0x2b0af6);logger['debug'](_0xe1c4('0x24'),_0x2b0af6,JSON[_0xe1c4('0x15')](_0x55be42));_0x38dee2(_0x55be42);})[_0xe1c4('0x19')](function(_0x257997){logger[_0xe1c4('0x16')](_0xe1c4('0x24'),_0x257997['message'],_0x2b0af6);_0x2c03e5(_0x2a01d8[_0xe1c4('0x16')](0x1f4,_0x257997[_0xe1c4('0x17')]));});});}; \ No newline at end of file +var _0x78d4=['attributes','limit','include','map','model','stringify','ShowFaxQueue','raw','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetFaxQueue','options','where'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0x78d4,0x119));var _0x478d=function(_0x70f689,_0x11f57b){_0x70f689=_0x70f689-0x0;var _0x426446=_0x78d4[_0x70f689];return _0x426446;};'use strict';var _=require(_0x478d('0x0'));var util=require(_0x478d('0x1'));var moment=require('moment');var BPromise=require(_0x478d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x478d('0x3'));var db=require(_0x478d('0x4'))['db'];var utils=require(_0x478d('0x5'));var logger=require('../../config/logger')(_0x478d('0x6'));var config=require(_0x478d('0x7'));var jayson=require(_0x478d('0x8'));var client=jayson[_0x478d('0x9')][_0x478d('0xa')]({'port':0x232a});config[_0x478d('0xb')]=_[_0x478d('0xc')](config[_0x478d('0xb')],{'host':_0x478d('0xd'),'port':0x18eb});var socket=require(_0x478d('0xe'))(new Redis(config[_0x478d('0xb')]));require(_0x478d('0xf'))[_0x478d('0x10')](socket);function respondWithRpcPromise(_0x50eeff,_0x40154,_0x5d961f){return new BPromise(function(_0x50b77a,_0x2afc58){return client[_0x478d('0x11')](_0x50eeff,_0x5d961f)[_0x478d('0x12')](function(_0x81a67d){logger[_0x478d('0x13')](_0x478d('0x14'),_0x40154,_0x478d('0x15'));logger[_0x478d('0x16')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x40154,_0x478d('0x15'),JSON['stringify'](_0x81a67d));if(_0x81a67d[_0x478d('0x17')]){if(_0x81a67d[_0x478d('0x17')][_0x478d('0x18')]===0x1f4){logger[_0x478d('0x17')](_0x478d('0x14'),_0x40154,_0x81a67d[_0x478d('0x17')][_0x478d('0x19')]);return _0x2afc58(_0x81a67d[_0x478d('0x17')][_0x478d('0x19')]);}logger[_0x478d('0x17')](_0x478d('0x14'),_0x40154,_0x81a67d[_0x478d('0x17')][_0x478d('0x19')]);return _0x50b77a(_0x81a67d['error'][_0x478d('0x19')]);}else{logger['info']('FaxQueue,\x20%s,\x20%s',_0x40154,'request\x20sent');_0x50b77a(_0x81a67d[_0x478d('0x1a')][_0x478d('0x19')]);}})[_0x478d('0x1b')](function(_0x59d20c){logger[_0x478d('0x17')]('FaxQueue,\x20%s,\x20%s',_0x40154,_0x59d20c);_0x2afc58(_0x59d20c);});});}exports[_0x478d('0x1c')]=function(_0x3e92c1){var _0x12d917=this;return new Promise(function(_0xf3aa68,_0x17f54c){return db['FaxQueue']['findAll']({'raw':_0x3e92c1['options']?_0x3e92c1[_0x478d('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x3e92c1[_0x478d('0x1d')]?_0x3e92c1[_0x478d('0x1d')][_0x478d('0x1e')]||null:null,'attributes':_0x3e92c1[_0x478d('0x1d')]?_0x3e92c1['options'][_0x478d('0x1f')]||null:null,'limit':_0x3e92c1[_0x478d('0x1d')]?_0x3e92c1[_0x478d('0x1d')][_0x478d('0x20')]||null:null,'include':_0x3e92c1['options']?_0x3e92c1[_0x478d('0x1d')][_0x478d('0x21')]?_[_0x478d('0x22')](_0x3e92c1[_0x478d('0x1d')][_0x478d('0x21')],function(_0x4bcfe5){return{'model':db[_0x4bcfe5[_0x478d('0x23')]],'as':_0x4bcfe5['as'],'attributes':_0x4bcfe5[_0x478d('0x1f')],'include':_0x4bcfe5[_0x478d('0x21')]?_[_0x478d('0x22')](_0x4bcfe5[_0x478d('0x21')],function(_0x2366c0){return{'model':db[_0x2366c0[_0x478d('0x23')]],'as':_0x2366c0['as'],'attributes':_0x2366c0[_0x478d('0x1f')],'include':_0x2366c0['include']?_[_0x478d('0x22')](_0x2366c0[_0x478d('0x21')],function(_0x4ad849){return{'model':db[_0x4ad849[_0x478d('0x23')]],'as':_0x4ad849['as'],'attributes':_0x4ad849['attributes']};}):[]};}):[]};}):[]:[]})[_0x478d('0x12')](function(_0x1c1e6b){logger[_0x478d('0x13')](_0x478d('0x1c'),_0x3e92c1);logger[_0x478d('0x16')](_0x478d('0x1c'),_0x3e92c1,JSON[_0x478d('0x24')](_0x1c1e6b));_0xf3aa68(_0x1c1e6b);})['catch'](function(_0x3031e8){logger[_0x478d('0x17')]('GetFaxQueue',_0x3031e8[_0x478d('0x19')],_0x3e92c1);_0x17f54c(_0x12d917[_0x478d('0x17')](0x1f4,_0x3031e8['message']));});});};exports[_0x478d('0x25')]=function(_0x357d1c){var _0x56e317=this;return new Promise(function(_0x5675ba,_0x4b645d){return db['FaxQueue']['find']({'raw':_0x357d1c['options']?_0x357d1c['options'][_0x478d('0x26')]===undefined?!![]:![]:!![],'where':_0x357d1c[_0x478d('0x1d')]?_0x357d1c['options']['where']||null:null,'attributes':_0x357d1c[_0x478d('0x1d')]?_0x357d1c[_0x478d('0x1d')][_0x478d('0x1f')]||null:null,'include':_0x357d1c['options']?_0x357d1c[_0x478d('0x1d')]['include']?_['map'](_0x357d1c[_0x478d('0x1d')][_0x478d('0x21')],function(_0x55a831){return{'model':db[_0x55a831[_0x478d('0x23')]],'as':_0x55a831['as'],'attributes':_0x55a831[_0x478d('0x1f')],'include':_0x55a831[_0x478d('0x21')]?_[_0x478d('0x22')](_0x55a831['include'],function(_0x23928d){return{'model':db[_0x23928d[_0x478d('0x23')]],'as':_0x23928d['as'],'attributes':_0x23928d[_0x478d('0x1f')],'include':_0x23928d['include']?_[_0x478d('0x22')](_0x23928d[_0x478d('0x21')],function(_0xa47ebb){return{'model':db[_0xa47ebb[_0x478d('0x23')]],'as':_0xa47ebb['as'],'attributes':_0xa47ebb[_0x478d('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x859df8){logger[_0x478d('0x13')](_0x478d('0x25'),_0x357d1c);logger[_0x478d('0x16')]('ShowFaxQueue',_0x357d1c,JSON['stringify'](_0x859df8));_0x5675ba(_0x859df8);})[_0x478d('0x1b')](function(_0xf642bb){logger[_0x478d('0x17')](_0x478d('0x25'),_0xf642bb[_0x478d('0x19')],_0x357d1c);_0x4b645d(_0x56e317[_0x478d('0x17')](0x1f4,_0xf642bb[_0x478d('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 21a6c5d..ac5e0f4 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 _0x7fcf=['length','faxQueue:','./faxQueue.events','save','update','emit','register'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x7fcf,0x128));var _0xf7fc=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x7fcf[_0x543084];return _0x306a57;};'use strict';var FaxQueueEvents=require(_0xf7fc('0x0'));var events=[_0xf7fc('0x1'),'remove',_0xf7fc('0x2')];function createListener(_0x2f23a7,_0x51f612){return function(_0x4a9be3){_0x51f612[_0xf7fc('0x3')](_0x2f23a7,_0x4a9be3);};}function removeListener(_0xa754e7,_0x5d294a){return function(){FaxQueueEvents['removeListener'](_0xa754e7,_0x5d294a);};}exports[_0xf7fc('0x4')]=function(_0x2f6173){for(var _0x4c75b2=0x0,_0x4ffe98=events[_0xf7fc('0x5')];_0x4c75b2<_0x4ffe98;_0x4c75b2++){var _0x41533d=events[_0x4c75b2];var _0x283e9b=createListener(_0xf7fc('0x6')+_0x41533d,_0x2f6173);FaxQueueEvents['on'](_0x41533d,_0x283e9b);}}; \ No newline at end of file +var _0x99e0=['faxQueue:','./faxQueue.events','save','remove','update','emit','removeListener','register','length'];(function(_0x3a6efd,_0x2a5102){var _0x487b9a=function(_0x104f89){while(--_0x104f89){_0x3a6efd['push'](_0x3a6efd['shift']());}};_0x487b9a(++_0x2a5102);}(_0x99e0,0xd0));var _0x099e=function(_0xd3d516,_0x5a48ab){_0xd3d516=_0xd3d516-0x0;var _0x5e588c=_0x99e0[_0xd3d516];return _0x5e588c;};'use strict';var FaxQueueEvents=require(_0x099e('0x0'));var events=[_0x099e('0x1'),_0x099e('0x2'),_0x099e('0x3')];function createListener(_0x1fa4e0,_0x58d66e){return function(_0x3c6b94){_0x58d66e[_0x099e('0x4')](_0x1fa4e0,_0x3c6b94);};}function removeListener(_0x482b1a,_0x2a6181){return function(){FaxQueueEvents[_0x099e('0x5')](_0x482b1a,_0x2a6181);};}exports[_0x099e('0x6')]=function(_0x5667cf){for(var _0x311c17=0x0,_0x438b19=events[_0x099e('0x7')];_0x311c17<_0x438b19;_0x311c17++){var _0x5a3c52=events[_0x311c17];var _0x2f8ff1=createListener(_0x099e('0x8')+_0x5a3c52,_0x5667cf);FaxQueueEvents['on'](_0x5a3c52,_0x2f8ff1);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 24f5bde..674f3e8 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 _0x741c=['getMembers','/:id/teams','getTeams','post','create','addTeams','addAgents','put','destroy','delete','removeTeams','/:id/users','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./faxQueue.controller','get','isAuthenticated','index','/describe','/:id','show'];(function(_0x213f49,_0x7eacb7){var _0x124559=function(_0x21b027){while(--_0x21b027){_0x213f49['push'](_0x213f49['shift']());}};_0x124559(++_0x7eacb7);}(_0x741c,0x196));var _0xc741=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x741c[_0x40a045];return _0x1a687c;};'use strict';var multer=require(_0xc741('0x0'));var util=require(_0xc741('0x1'));var path=require(_0xc741('0x2'));var timeout=require(_0xc741('0x3'));var express=require(_0xc741('0x4'));var router=express[_0xc741('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc741('0x6'));var config=require('../../config/environment');var controller=require(_0xc741('0x7'));router[_0xc741('0x8')]('/',auth[_0xc741('0x9')](),controller[_0xc741('0xa')]);router[_0xc741('0x8')](_0xc741('0xb'),auth[_0xc741('0x9')](),controller['describe']);router[_0xc741('0x8')](_0xc741('0xc'),auth['isAuthenticated'](),controller[_0xc741('0xd')]);router['get']('/:id/members',auth[_0xc741('0x9')](),controller[_0xc741('0xe')]);router[_0xc741('0x8')](_0xc741('0xf'),auth[_0xc741('0x9')](),controller[_0xc741('0x10')]);router[_0xc741('0x8')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0xc741('0x11')]('/',auth[_0xc741('0x9')](),controller[_0xc741('0x12')]);router[_0xc741('0x11')](_0xc741('0xf'),auth['isAuthenticated'](),controller[_0xc741('0x13')]);router[_0xc741('0x11')]('/:id/users',auth[_0xc741('0x9')](),controller[_0xc741('0x14')]);router[_0xc741('0x15')](_0xc741('0xc'),auth[_0xc741('0x9')](),controller['update']);router['delete'](_0xc741('0xc'),auth['isAuthenticated'](),controller[_0xc741('0x16')]);router[_0xc741('0x17')]('/:id/teams',auth['isAuthenticated'](),controller[_0xc741('0x18')]);router[_0xc741('0x17')](_0xc741('0x19'),auth['isAuthenticated'](),controller[_0xc741('0x1a')]);module[_0xc741('0x1b')]=router; \ No newline at end of file +var _0x3a6d=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','describe','/:id','show','/:id/members','/:id/teams','getTeams','post','create','addTeams','/:id/users','addAgents','update','delete','removeTeams','exports','multer'];(function(_0x14431c,_0x58aace){var _0x308992=function(_0x335caa){while(--_0x335caa){_0x14431c['push'](_0x14431c['shift']());}};_0x308992(++_0x58aace);}(_0x3a6d,0x143));var _0xd3a6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3a6d[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xd3a6('0x0'));var util=require(_0xd3a6('0x1'));var path=require('path');var timeout=require(_0xd3a6('0x2'));var express=require(_0xd3a6('0x3'));var router=express[_0xd3a6('0x4')]();var fs_extra=require(_0xd3a6('0x5'));var auth=require(_0xd3a6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd3a6('0x7'));var controller=require(_0xd3a6('0x8'));router[_0xd3a6('0x9')]('/',auth[_0xd3a6('0xa')](),controller[_0xd3a6('0xb')]);router[_0xd3a6('0x9')]('/describe',auth[_0xd3a6('0xa')](),controller[_0xd3a6('0xc')]);router[_0xd3a6('0x9')](_0xd3a6('0xd'),auth[_0xd3a6('0xa')](),controller[_0xd3a6('0xe')]);router[_0xd3a6('0x9')](_0xd3a6('0xf'),auth[_0xd3a6('0xa')](),controller['getMembers']);router[_0xd3a6('0x9')](_0xd3a6('0x10'),auth[_0xd3a6('0xa')](),controller[_0xd3a6('0x11')]);router[_0xd3a6('0x9')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0xd3a6('0x12')]('/',auth[_0xd3a6('0xa')](),controller[_0xd3a6('0x13')]);router[_0xd3a6('0x12')](_0xd3a6('0x10'),auth[_0xd3a6('0xa')](),controller[_0xd3a6('0x14')]);router['post'](_0xd3a6('0x15'),auth[_0xd3a6('0xa')](),controller[_0xd3a6('0x16')]);router['put'](_0xd3a6('0xd'),auth[_0xd3a6('0xa')](),controller[_0xd3a6('0x17')]);router['delete'](_0xd3a6('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0xd3a6('0x18')](_0xd3a6('0x10'),auth[_0xd3a6('0xa')](),controller[_0xd3a6('0x19')]);router[_0xd3a6('0x18')](_0xd3a6('0x15'),auth[_0xd3a6('0xa')](),controller['removeAgents']);module[_0xd3a6('0x1a')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 2ce8c03..f83ba61 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 _0x5da0=['STRING','DATE','moment','exports'];(function(_0x3ebcde,_0x55cc41){var _0x278c97=function(_0x371127){while(--_0x371127){_0x3ebcde['push'](_0x3ebcde['shift']());}};_0x278c97(++_0x55cc41);}(_0x5da0,0x1be));var _0x05da=function(_0x5e371a,_0x41ec81){_0x5e371a=_0x5e371a-0x0;var _0x14f313=_0x5da0[_0x5e371a];return _0x14f313;};'use strict';var moment=require(_0x05da('0x0'));var Sequelize=require('sequelize');module[_0x05da('0x1')]={'uniqueid':{'type':Sequelize[_0x05da('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x05da('0x3')]},'acceptAt':{'type':Sequelize[_0x05da('0x3')]},'exitAt':{'type':Sequelize[_0x05da('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x424f=['exports','STRING','DATE','moment','sequelize'];(function(_0x154c7b,_0x16bc37){var _0x588efe=function(_0x238208){while(--_0x238208){_0x154c7b['push'](_0x154c7b['shift']());}};_0x588efe(++_0x16bc37);}(_0x424f,0x94));var _0xf424=function(_0x43ff84,_0x5c9110){_0x43ff84=_0x43ff84-0x0;var _0x3d786c=_0x424f[_0x43ff84];return _0x3d786c;};'use strict';var moment=require(_0xf424('0x0'));var Sequelize=require(_0xf424('0x1'));module[_0xf424('0x2')]={'uniqueid':{'type':Sequelize[_0xf424('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xf424('0x3')]},'joinAt':{'type':Sequelize[_0xf424('0x4')]},'leaveAt':{'type':Sequelize[_0xf424('0x4')]},'acceptAt':{'type':Sequelize[_0xf424('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 5656fb3..96ab506 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 _0x4156=['where','filters','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','update','then','stack','name','map','FaxQueueReport','rawAttributes','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort'];(function(_0x12acd3,_0x4a3f86){var _0x3e234a=function(_0x14eac1){while(--_0x14eac1){_0x12acd3['push'](_0x12acd3['shift']());}};_0x3e234a(++_0x4a3f86);}(_0x4156,0xf1));var _0x6415=function(_0x5e00c1,_0x12b7e5){_0x5e00c1=_0x5e00c1-0x0;var _0xba5f38=_0x4156[_0x5e00c1];return _0xba5f38;};'use strict';var emlformat=require(_0x6415('0x0'));var rimraf=require(_0x6415('0x1'));var zipdir=require(_0x6415('0x2'));var jsonpatch=require(_0x6415('0x3'));var rp=require(_0x6415('0x4'));var moment=require('moment');var BPromise=require(_0x6415('0x5'));var Mustache=require(_0x6415('0x6'));var util=require(_0x6415('0x7'));var path=require(_0x6415('0x8'));var sox=require(_0x6415('0x9'));var csv=require(_0x6415('0xa'));var ejs=require(_0x6415('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6415('0xc'));var squel=require('squel');var crypto=require(_0x6415('0xd'));var jsforce=require(_0x6415('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6415('0xa'));var querystring=require(_0x6415('0xf'));var Papa=require(_0x6415('0x10'));var Redis=require(_0x6415('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x6415('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6415('0x13'))(_0x6415('0x14'));var utils=require(_0x6415('0x15'));var config=require(_0x6415('0x16'));var licenseUtil=require(_0x6415('0x17'));var db=require(_0x6415('0x18'))['db'];function respondWithStatusCode(_0x455f44,_0x596b97){_0x596b97=_0x596b97||0xcc;return function(_0x5b3493){if(_0x5b3493){return _0x455f44[_0x6415('0x19')](_0x596b97);}return _0x455f44[_0x6415('0x1a')](_0x596b97)[_0x6415('0x1b')]();};}function respondWithResult(_0xf75bec,_0x21ae74){_0x21ae74=_0x21ae74||0xc8;return function(_0x5b2a26){if(_0x5b2a26){return _0xf75bec['status'](_0x21ae74)[_0x6415('0x1c')](_0x5b2a26);}};}function respondWithFilteredResult(_0x780643,_0x48017d){return function(_0x1d540c){if(_0x1d540c){var _0x41f9b0=typeof _0x48017d['offset']==='undefined'&&typeof _0x48017d[_0x6415('0x1d')]===_0x6415('0x1e');var _0x3f739d=_0x1d540c[_0x6415('0x1f')];var _0x2ef73b=_0x41f9b0?0x0:_0x48017d[_0x6415('0x20')];var _0x2c74c6=_0x41f9b0?_0x1d540c[_0x6415('0x1f')]:_0x48017d[_0x6415('0x20')]+_0x48017d['limit'];var _0x551985;if(_0x2c74c6>=_0x3f739d){_0x2c74c6=_0x3f739d;_0x551985=0xc8;}else{_0x551985=0xce;}_0x780643['status'](_0x551985);return _0x780643[_0x6415('0x21')](_0x6415('0x22'),_0x2ef73b+'-'+_0x2c74c6+'/'+_0x3f739d)[_0x6415('0x1c')](_0x1d540c);}return null;};}function patchUpdates(_0x1e58f2){return function(_0x551632){try{jsonpatch[_0x6415('0x23')](_0x551632,_0x1e58f2,!![]);}catch(_0x3f4400){return BPromise[_0x6415('0x24')](_0x3f4400);}return _0x551632['save']();};}function saveUpdates(_0x287ac9,_0x266f97){return function(_0x7c567f){if(_0x7c567f){return _0x7c567f[_0x6415('0x25')](_0x287ac9)[_0x6415('0x26')](function(_0x3e33d3){return _0x3e33d3;});}return null;};}function removeEntity(_0x339c50,_0x41c266){return function(_0x1496c1){if(_0x1496c1){return _0x1496c1['destroy']()[_0x6415('0x26')](function(){_0x339c50[_0x6415('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x15be31,_0x2b202c){return function(_0x2a936f){if(!_0x2a936f){_0x15be31[_0x6415('0x19')](0x194);}return _0x2a936f;};}function handleError(_0x31dabc,_0x5b5f39){_0x5b5f39=_0x5b5f39||0x1f4;return function(_0x30d857){logger['error'](_0x30d857[_0x6415('0x27')]);if(_0x30d857[_0x6415('0x28')]){delete _0x30d857[_0x6415('0x28')];}_0x31dabc['status'](_0x5b5f39)['send'](_0x30d857);};}exports['index']=function(_0x61e827,_0x31f717){var _0x581bc7={},_0x5bf08d={},_0xf3e415={'count':0x0,'rows':[]};var _0x4426ed=_[_0x6415('0x29')](db[_0x6415('0x2a')][_0x6415('0x2b')],function(_0x2ba17d){return{'name':_0x2ba17d['fieldName'],'type':_0x2ba17d[_0x6415('0x2c')][_0x6415('0x2d')]};});_0x5bf08d[_0x6415('0x2e')]=_[_0x6415('0x29')](_0x4426ed,'name');_0x5bf08d['query']=_['keys'](_0x61e827[_0x6415('0x2f')]);_0x5bf08d['filters']=_[_0x6415('0x30')](_0x5bf08d['model'],_0x5bf08d[_0x6415('0x2f')]);_0x581bc7[_0x6415('0x31')]=_[_0x6415('0x30')](_0x5bf08d[_0x6415('0x2e')],qs['fields'](_0x61e827['query'][_0x6415('0x32')]));_0x581bc7[_0x6415('0x31')]=_0x581bc7[_0x6415('0x31')][_0x6415('0x33')]?_0x581bc7[_0x6415('0x31')]:_0x5bf08d[_0x6415('0x2e')];if(!_0x61e827['query'][_0x6415('0x34')]('nolimit')){_0x581bc7['limit']=qs['limit'](_0x61e827['query'][_0x6415('0x1d')]);_0x581bc7[_0x6415('0x20')]=qs[_0x6415('0x20')](_0x61e827['query'][_0x6415('0x20')]);}_0x581bc7[_0x6415('0x35')]=qs['sort'](_0x61e827[_0x6415('0x2f')][_0x6415('0x36')]);_0x581bc7[_0x6415('0x37')]=qs[_0x6415('0x38')](_[_0x6415('0x39')](_0x61e827['query'],_0x5bf08d[_0x6415('0x38')]),_0x4426ed);if(_0x61e827['query'][_0x6415('0x3a')]){_0x581bc7[_0x6415('0x37')]=_['merge'](_0x581bc7[_0x6415('0x37')],{'$or':_[_0x6415('0x29')](_0x4426ed,function(_0x51b0f1){if(_0x51b0f1['type']!==_0x6415('0x3b')){var _0x47ff72={};_0x47ff72[_0x51b0f1[_0x6415('0x28')]]={'$like':'%'+_0x61e827['query'][_0x6415('0x3a')]+'%'};return _0x47ff72;}})});}_0x581bc7=_[_0x6415('0x3c')]({},_0x581bc7,_0x61e827['options']);var _0x3dddfb={'where':_0x581bc7['where']};return db[_0x6415('0x2a')][_0x6415('0x1f')](_0x3dddfb)[_0x6415('0x26')](function(_0x3bad43){_0xf3e415[_0x6415('0x1f')]=_0x3bad43;if(_0x61e827[_0x6415('0x2f')][_0x6415('0x3d')]){_0x581bc7[_0x6415('0x3e')]=[{'all':!![]}];}return db[_0x6415('0x2a')][_0x6415('0x3f')](_0x581bc7);})[_0x6415('0x26')](function(_0x35b203){_0xf3e415[_0x6415('0x40')]=_0x35b203;return _0xf3e415;})[_0x6415('0x26')](respondWithFilteredResult(_0x31f717,_0x581bc7))[_0x6415('0x41')](handleError(_0x31f717,null));};exports[_0x6415('0x42')]=function(_0x53e600,_0x368e52){var _0x747baa={'raw':!![],'where':{'id':_0x53e600[_0x6415('0x43')]['id']}},_0x581573={};_0x581573['model']=_[_0x6415('0x44')](db[_0x6415('0x2a')]['rawAttributes']);_0x581573[_0x6415('0x2f')]=_[_0x6415('0x44')](_0x53e600[_0x6415('0x2f')]);_0x581573[_0x6415('0x38')]=_['intersection'](_0x581573['model'],_0x581573[_0x6415('0x2f')]);_0x747baa['attributes']=_[_0x6415('0x30')](_0x581573['model'],qs[_0x6415('0x32')](_0x53e600[_0x6415('0x2f')][_0x6415('0x32')]));_0x747baa[_0x6415('0x31')]=_0x747baa[_0x6415('0x31')][_0x6415('0x33')]?_0x747baa[_0x6415('0x31')]:_0x581573['model'];if(_0x53e600[_0x6415('0x2f')][_0x6415('0x3d')]){_0x747baa['include']=[{'all':!![]}];}_0x747baa=_[_0x6415('0x3c')]({},_0x747baa,_0x53e600['options']);return db[_0x6415('0x2a')][_0x6415('0x45')](_0x747baa)[_0x6415('0x26')](handleEntityNotFound(_0x368e52,null))[_0x6415('0x26')](respondWithResult(_0x368e52,null))[_0x6415('0x41')](handleError(_0x368e52,null));};exports['create']=function(_0x3894d8,_0x4d9708){return db[_0x6415('0x2a')][_0x6415('0x46')](_0x3894d8[_0x6415('0x47')],{})[_0x6415('0x26')](respondWithResult(_0x4d9708,0xc9))['catch'](handleError(_0x4d9708,null));};exports[_0x6415('0x25')]=function(_0x518643,_0x4130c5){if(_0x518643[_0x6415('0x47')]['id']){delete _0x518643['body']['id'];}return db[_0x6415('0x2a')][_0x6415('0x45')]({'where':{'id':_0x518643[_0x6415('0x43')]['id']}})['then'](handleEntityNotFound(_0x4130c5,null))[_0x6415('0x26')](saveUpdates(_0x518643[_0x6415('0x47')],null))[_0x6415('0x26')](respondWithResult(_0x4130c5,null))[_0x6415('0x41')](handleError(_0x4130c5,null));};exports[_0x6415('0x48')]=function(_0x14b1e1,_0x5957ae){return db[_0x6415('0x2a')]['find']({'where':{'id':_0x14b1e1[_0x6415('0x43')]['id']}})[_0x6415('0x26')](handleEntityNotFound(_0x5957ae,null))[_0x6415('0x26')](removeEntity(_0x5957ae,null))[_0x6415('0x41')](handleError(_0x5957ae,null));};exports[_0x6415('0x49')]=function(_0x48f4fa,_0xdd3293){return db[_0x6415('0x2a')][_0x6415('0x49')]()[_0x6415('0x26')](respondWithResult(_0xdd3293,null))[_0x6415('0x41')](handleError(_0xdd3293,null));}; \ No newline at end of file +var _0x9bb4=['fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','update','then','error','stack','name','send','index','FaxQueueReport','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','catch','params','keys','length','create','body','find','describe','eml-format','rimraf','zip-dir'];(function(_0x212404,_0x2daf22){var _0x69dfec=function(_0x2729ff){while(--_0x2729ff){_0x212404['push'](_0x212404['shift']());}};_0x69dfec(++_0x2daf22);}(_0x9bb4,0xd5));var _0x49bb=function(_0x172d12,_0x59b0c7){_0x172d12=_0x172d12-0x0;var _0x37bd49=_0x9bb4[_0x172d12];return _0x37bd49;};'use strict';var emlformat=require(_0x49bb('0x0'));var rimraf=require(_0x49bb('0x1'));var zipdir=require(_0x49bb('0x2'));var jsonpatch=require(_0x49bb('0x3'));var rp=require(_0x49bb('0x4'));var moment=require(_0x49bb('0x5'));var BPromise=require(_0x49bb('0x6'));var Mustache=require(_0x49bb('0x7'));var util=require(_0x49bb('0x8'));var path=require('path');var sox=require(_0x49bb('0x9'));var csv=require(_0x49bb('0xa'));var ejs=require(_0x49bb('0xb'));var fs=require('fs');var fs_extra=require(_0x49bb('0xc'));var _=require('lodash');var squel=require(_0x49bb('0xd'));var crypto=require(_0x49bb('0xe'));var jsforce=require(_0x49bb('0xf'));var deskjs=require(_0x49bb('0x10'));var toCsv=require(_0x49bb('0xa'));var querystring=require('querystring');var Papa=require(_0x49bb('0x11'));var Redis=require('ioredis');var authService=require(_0x49bb('0x12'));var qs=require(_0x49bb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x49bb('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x49bb('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x49bb('0x16'));var db=require(_0x49bb('0x17'))['db'];function respondWithStatusCode(_0xfab080,_0x3b85fc){_0x3b85fc=_0x3b85fc||0xcc;return function(_0x1ff6d1){if(_0x1ff6d1){return _0xfab080[_0x49bb('0x18')](_0x3b85fc);}return _0xfab080[_0x49bb('0x19')](_0x3b85fc)[_0x49bb('0x1a')]();};}function respondWithResult(_0x3beb36,_0x59472f){_0x59472f=_0x59472f||0xc8;return function(_0x13c850){if(_0x13c850){return _0x3beb36['status'](_0x59472f)[_0x49bb('0x1b')](_0x13c850);}};}function respondWithFilteredResult(_0x1f7573,_0x1f0210){return function(_0x230f20){if(_0x230f20){var _0x145d52=typeof _0x1f0210[_0x49bb('0x1c')]===_0x49bb('0x1d')&&typeof _0x1f0210[_0x49bb('0x1e')]==='undefined';var _0x2d76be=_0x230f20[_0x49bb('0x1f')];var _0x5b45c0=_0x145d52?0x0:_0x1f0210[_0x49bb('0x1c')];var _0x3d41f2=_0x145d52?_0x230f20['count']:_0x1f0210[_0x49bb('0x1c')]+_0x1f0210[_0x49bb('0x1e')];var _0x4af5e0;if(_0x3d41f2>=_0x2d76be){_0x3d41f2=_0x2d76be;_0x4af5e0=0xc8;}else{_0x4af5e0=0xce;}_0x1f7573[_0x49bb('0x19')](_0x4af5e0);return _0x1f7573[_0x49bb('0x20')]('Content-Range',_0x5b45c0+'-'+_0x3d41f2+'/'+_0x2d76be)[_0x49bb('0x1b')](_0x230f20);}return null;};}function patchUpdates(_0x5387ed){return function(_0x1728e9){try{jsonpatch['apply'](_0x1728e9,_0x5387ed,!![]);}catch(_0x47918a){return BPromise[_0x49bb('0x21')](_0x47918a);}return _0x1728e9['save']();};}function saveUpdates(_0x5b18f0,_0x16b8fa){return function(_0x1ade8b){if(_0x1ade8b){return _0x1ade8b[_0x49bb('0x22')](_0x5b18f0)[_0x49bb('0x23')](function(_0x4f2764){return _0x4f2764;});}return null;};}function removeEntity(_0x490c3e,_0x5cacdb){return function(_0x4eae24){if(_0x4eae24){return _0x4eae24['destroy']()[_0x49bb('0x23')](function(){_0x490c3e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x6dac61,_0x42fd72){return function(_0x341bd9){if(!_0x341bd9){_0x6dac61[_0x49bb('0x18')](0x194);}return _0x341bd9;};}function handleError(_0xa64ee6,_0x59225e){_0x59225e=_0x59225e||0x1f4;return function(_0x323be7){logger[_0x49bb('0x24')](_0x323be7[_0x49bb('0x25')]);if(_0x323be7[_0x49bb('0x26')]){delete _0x323be7['name'];}_0xa64ee6[_0x49bb('0x19')](_0x59225e)[_0x49bb('0x27')](_0x323be7);};}exports[_0x49bb('0x28')]=function(_0x47540c,_0x51cc97){var _0x1f0c73={},_0x3207e9={},_0x3ab8a8={'count':0x0,'rows':[]};var _0x3a6ed8=_['map'](db[_0x49bb('0x29')][_0x49bb('0x2a')],function(_0x5cd7c2){return{'name':_0x5cd7c2[_0x49bb('0x2b')],'type':_0x5cd7c2['type'][_0x49bb('0x2c')]};});_0x3207e9[_0x49bb('0x2d')]=_['map'](_0x3a6ed8,_0x49bb('0x26'));_0x3207e9[_0x49bb('0x2e')]=_['keys'](_0x47540c[_0x49bb('0x2e')]);_0x3207e9[_0x49bb('0x2f')]=_[_0x49bb('0x30')](_0x3207e9[_0x49bb('0x2d')],_0x3207e9[_0x49bb('0x2e')]);_0x1f0c73[_0x49bb('0x31')]=_[_0x49bb('0x30')](_0x3207e9[_0x49bb('0x2d')],qs['fields'](_0x47540c[_0x49bb('0x2e')][_0x49bb('0x32')]));_0x1f0c73[_0x49bb('0x31')]=_0x1f0c73[_0x49bb('0x31')]['length']?_0x1f0c73[_0x49bb('0x31')]:_0x3207e9['model'];if(!_0x47540c[_0x49bb('0x2e')]['hasOwnProperty'](_0x49bb('0x33'))){_0x1f0c73['limit']=qs[_0x49bb('0x1e')](_0x47540c[_0x49bb('0x2e')]['limit']);_0x1f0c73['offset']=qs['offset'](_0x47540c['query']['offset']);}_0x1f0c73[_0x49bb('0x34')]=qs[_0x49bb('0x35')](_0x47540c[_0x49bb('0x2e')][_0x49bb('0x35')]);_0x1f0c73[_0x49bb('0x36')]=qs[_0x49bb('0x2f')](_[_0x49bb('0x37')](_0x47540c['query'],_0x3207e9['filters']),_0x3a6ed8);if(_0x47540c[_0x49bb('0x2e')][_0x49bb('0x38')]){_0x1f0c73['where']=_[_0x49bb('0x39')](_0x1f0c73[_0x49bb('0x36')],{'$or':_['map'](_0x3a6ed8,function(_0x4b937b){if(_0x4b937b[_0x49bb('0x3a')]!=='VIRTUAL'){var _0xc070fa={};_0xc070fa[_0x4b937b[_0x49bb('0x26')]]={'$like':'%'+_0x47540c[_0x49bb('0x2e')][_0x49bb('0x38')]+'%'};return _0xc070fa;}})});}_0x1f0c73=_[_0x49bb('0x39')]({},_0x1f0c73,_0x47540c[_0x49bb('0x3b')]);var _0x4084a2={'where':_0x1f0c73[_0x49bb('0x36')]};return db[_0x49bb('0x29')][_0x49bb('0x1f')](_0x4084a2)[_0x49bb('0x23')](function(_0x18bf2e){_0x3ab8a8[_0x49bb('0x1f')]=_0x18bf2e;if(_0x47540c[_0x49bb('0x2e')][_0x49bb('0x3c')]){_0x1f0c73[_0x49bb('0x3d')]=[{'all':!![]}];}return db[_0x49bb('0x29')][_0x49bb('0x3e')](_0x1f0c73);})[_0x49bb('0x23')](function(_0x41b969){_0x3ab8a8[_0x49bb('0x3f')]=_0x41b969;return _0x3ab8a8;})[_0x49bb('0x23')](respondWithFilteredResult(_0x51cc97,_0x1f0c73))[_0x49bb('0x40')](handleError(_0x51cc97,null));};exports['show']=function(_0x4754ff,_0x48db08){var _0x1cd6cc={'raw':!![],'where':{'id':_0x4754ff[_0x49bb('0x41')]['id']}},_0x1eac94={};_0x1eac94[_0x49bb('0x2d')]=_[_0x49bb('0x42')](db['FaxQueueReport'][_0x49bb('0x2a')]);_0x1eac94[_0x49bb('0x2e')]=_[_0x49bb('0x42')](_0x4754ff[_0x49bb('0x2e')]);_0x1eac94[_0x49bb('0x2f')]=_['intersection'](_0x1eac94[_0x49bb('0x2d')],_0x1eac94[_0x49bb('0x2e')]);_0x1cd6cc[_0x49bb('0x31')]=_[_0x49bb('0x30')](_0x1eac94['model'],qs['fields'](_0x4754ff[_0x49bb('0x2e')][_0x49bb('0x32')]));_0x1cd6cc[_0x49bb('0x31')]=_0x1cd6cc[_0x49bb('0x31')][_0x49bb('0x43')]?_0x1cd6cc[_0x49bb('0x31')]:_0x1eac94['model'];if(_0x4754ff[_0x49bb('0x2e')]['includeAll']){_0x1cd6cc[_0x49bb('0x3d')]=[{'all':!![]}];}_0x1cd6cc=_[_0x49bb('0x39')]({},_0x1cd6cc,_0x4754ff['options']);return db['FaxQueueReport']['find'](_0x1cd6cc)['then'](handleEntityNotFound(_0x48db08,null))[_0x49bb('0x23')](respondWithResult(_0x48db08,null))[_0x49bb('0x40')](handleError(_0x48db08,null));};exports[_0x49bb('0x44')]=function(_0x3691f0,_0x4bda54){return db['FaxQueueReport'][_0x49bb('0x44')](_0x3691f0[_0x49bb('0x45')],{})[_0x49bb('0x23')](respondWithResult(_0x4bda54,0xc9))[_0x49bb('0x40')](handleError(_0x4bda54,null));};exports['update']=function(_0x3b0f01,_0x382bc4){if(_0x3b0f01['body']['id']){delete _0x3b0f01[_0x49bb('0x45')]['id'];}return db[_0x49bb('0x29')][_0x49bb('0x46')]({'where':{'id':_0x3b0f01[_0x49bb('0x41')]['id']}})[_0x49bb('0x23')](handleEntityNotFound(_0x382bc4,null))['then'](saveUpdates(_0x3b0f01[_0x49bb('0x45')],null))[_0x49bb('0x23')](respondWithResult(_0x382bc4,null))[_0x49bb('0x40')](handleError(_0x382bc4,null));};exports['destroy']=function(_0x266abf,_0x359dfd){return db[_0x49bb('0x29')][_0x49bb('0x46')]({'where':{'id':_0x266abf[_0x49bb('0x41')]['id']}})['then'](handleEntityNotFound(_0x359dfd,null))[_0x49bb('0x23')](removeEntity(_0x359dfd,null))[_0x49bb('0x40')](handleError(_0x359dfd,null));};exports[_0x49bb('0x47')]=function(_0x1fdfca,_0x412f3b){return db[_0x49bb('0x29')][_0x49bb('0x47')]()[_0x49bb('0x23')](respondWithResult(_0x412f3b,null))[_0x49bb('0x40')](handleError(_0x412f3b,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index eb4a24e..1dd9ea2 100644 --- a/server/api/faxQueueReport/faxQueueReport.model.js +++ b/server/api/faxQueueReport/faxQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['report_fax_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport'];(function(_0x5a50a1,_0x48ff99){var _0x3a947c=function(_0x4a003d){while(--_0x4a003d){_0x5a50a1['push'](_0x5a50a1['shift']());}};_0x3a947c(++_0x48ff99);}(_0x7a54,0x106));var _0x47a5=function(_0x58d1bd,_0x34727d){_0x58d1bd=_0x58d1bd-0x0;var _0x4adf62=_0x7a54[_0x58d1bd];return _0x4adf62;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x47a5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4975=['path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport','report_fax_queue','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x240808,_0x4ace55){var _0x1c2e5b=function(_0x2e0cd1){while(--_0x2e0cd1){_0x240808['push'](_0x240808['shift']());}};_0x1c2e5b(++_0x4ace55);}(_0x4975,0x86));var _0x5497=function(_0x5920cb,_0x571faf){_0x5920cb=_0x5920cb-0x0;var _0x1f45f5=_0x4975[_0x5920cb];return _0x1f45f5;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var logger=require(_0x5497('0x1'))(_0x5497('0x2'));var moment=require(_0x5497('0x3'));var BPromise=require(_0x5497('0x4'));var rp=require(_0x5497('0x5'));var fs=require('fs');var path=require(_0x5497('0x6'));var rimraf=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var attributes=require(_0x5497('0x9'));module[_0x5497('0xa')]=function(_0x539a27,_0x37e48d){return _0x539a27['define'](_0x5497('0xb'),attributes,{'tableName':_0x5497('0xc'),'paranoid':![],'indexes':[{'name':_0x5497('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 545305b..d10ff93 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 _0x2f74=['CreateFaxQueueReport','FaxQueueReport','body','options','raw','UpdateFaxQueueReport','update','attributes','limit','debug','lodash','moment','bluebird','randomstring','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x1fcaf1,_0x21c3c2){var _0x55f464=function(_0x348eb3){while(--_0x348eb3){_0x1fcaf1['push'](_0x1fcaf1['shift']());}};_0x55f464(++_0x21c3c2);}(_0x2f74,0x15f));var _0x42f7=function(_0x644560,_0x1783aa){_0x644560=_0x644560-0x0;var _0x41b76b=_0x2f74[_0x644560];return _0x41b76b;};'use strict';var _=require(_0x42f7('0x0'));var util=require('util');var moment=require(_0x42f7('0x1'));var BPromise=require(_0x42f7('0x2'));var rs=require(_0x42f7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x42f7('0x4'));var config=require(_0x42f7('0x5'));var jayson=require(_0x42f7('0x6'));var client=jayson[_0x42f7('0x7')][_0x42f7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5a599b,_0x8831be,_0x1c7bef){return new BPromise(function(_0x4e1b54,_0x1a1434){return client[_0x42f7('0x9')](_0x5a599b,_0x1c7bef)[_0x42f7('0xa')](function(_0x5e8fa7){logger[_0x42f7('0xb')](_0x42f7('0xc'),_0x8831be,_0x42f7('0xd'));logger['debug'](_0x42f7('0xe'),_0x8831be,_0x42f7('0xd'),JSON[_0x42f7('0xf')](_0x5e8fa7));if(_0x5e8fa7[_0x42f7('0x10')]){if(_0x5e8fa7['error'][_0x42f7('0x11')]===0x1f4){logger['error'](_0x42f7('0xc'),_0x8831be,_0x5e8fa7[_0x42f7('0x10')][_0x42f7('0x12')]);return _0x1a1434(_0x5e8fa7['error']['message']);}logger[_0x42f7('0x10')](_0x42f7('0xc'),_0x8831be,_0x5e8fa7[_0x42f7('0x10')][_0x42f7('0x12')]);return _0x4e1b54(_0x5e8fa7[_0x42f7('0x10')][_0x42f7('0x12')]);}else{logger[_0x42f7('0xb')](_0x42f7('0xc'),_0x8831be,_0x42f7('0xd'));_0x4e1b54(_0x5e8fa7[_0x42f7('0x13')]['message']);}})[_0x42f7('0x14')](function(_0x45d3a8){logger[_0x42f7('0x10')](_0x42f7('0xc'),_0x8831be,_0x45d3a8);_0x1a1434(_0x45d3a8);});});}exports[_0x42f7('0x15')]=function(_0x3e8a26){var _0x322371=this;return new Promise(function(_0x1cf3e8,_0x1114ff){return db[_0x42f7('0x16')]['create'](_0x3e8a26[_0x42f7('0x17')],{'raw':_0x3e8a26[_0x42f7('0x18')]?_0x3e8a26[_0x42f7('0x18')][_0x42f7('0x19')]===undefined?!![]:![]:!![]})[_0x42f7('0xa')](function(_0x1c9641){logger[_0x42f7('0xb')](_0x42f7('0x15'),_0x3e8a26);logger['debug'](_0x42f7('0x15'),_0x3e8a26,JSON['stringify'](_0x1c9641));_0x1cf3e8(_0x1c9641);})[_0x42f7('0x14')](function(_0xd2b7dc){logger['error']('CreateFaxQueueReport',_0xd2b7dc[_0x42f7('0x12')],_0x3e8a26);_0x1114ff(_0x322371[_0x42f7('0x10')](0x1f4,_0xd2b7dc[_0x42f7('0x12')]));});});};exports[_0x42f7('0x1a')]=function(_0x96944e){var _0x314854=this;return new Promise(function(_0x38673b,_0x446bb8){return db[_0x42f7('0x16')][_0x42f7('0x1b')](_0x96944e[_0x42f7('0x17')],{'raw':_0x96944e['options']?_0x96944e[_0x42f7('0x18')][_0x42f7('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x96944e[_0x42f7('0x18')]?_0x96944e[_0x42f7('0x18')]['where']||null:null,'attributes':_0x96944e[_0x42f7('0x18')]?_0x96944e['options'][_0x42f7('0x1c')]||null:null,'limit':_0x96944e['options']?_0x96944e[_0x42f7('0x18')][_0x42f7('0x1d')]||null:null})[_0x42f7('0xa')](function(_0x1449c3){logger[_0x42f7('0xb')](_0x42f7('0x1a'),_0x96944e);logger[_0x42f7('0x1e')](_0x42f7('0x1a'),_0x96944e,JSON['stringify'](_0x1449c3));_0x38673b(_0x1449c3);})['catch'](function(_0x50a0d3){logger[_0x42f7('0x10')]('UpdateFaxQueueReport',_0x50a0d3[_0x42f7('0x12')],_0x96944e);_0x446bb8(_0x314854['error'](0x1f4,_0x50a0d3[_0x42f7('0x12')]));});});}; \ No newline at end of file +var _0x7cc9=['debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','create','body','options','raw','then','CreateFaxQueueReport','stringify','UpdateFaxQueueReport','FaxQueueReport','update','where','attributes','limit','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent'];(function(_0x47cc74,_0x4598df){var _0xdfe813=function(_0x291ca6){while(--_0x291ca6){_0x47cc74['push'](_0x47cc74['shift']());}};_0xdfe813(++_0x4598df);}(_0x7cc9,0x98));var _0x97cc=function(_0xcf88b4,_0xac682f){_0xcf88b4=_0xcf88b4-0x0;var _0x42984c=_0x7cc9[_0xcf88b4];return _0x42984c;};'use strict';var _=require('lodash');var util=require(_0x97cc('0x0'));var moment=require('moment');var BPromise=require(_0x97cc('0x1'));var rs=require(_0x97cc('0x2'));var fs=require('fs');var Redis=require(_0x97cc('0x3'));var db=require(_0x97cc('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x97cc('0x5'));var jayson=require(_0x97cc('0x6'));var client=jayson[_0x97cc('0x7')][_0x97cc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d334a,_0x599230,_0x56132f){return new BPromise(function(_0x3cb103,_0x21747f){return client[_0x97cc('0x9')](_0x1d334a,_0x56132f)['then'](function(_0x132ed8){logger[_0x97cc('0xa')](_0x97cc('0xb'),_0x599230,_0x97cc('0xc'));logger[_0x97cc('0xd')](_0x97cc('0xe'),_0x599230,_0x97cc('0xc'),JSON['stringify'](_0x132ed8));if(_0x132ed8[_0x97cc('0xf')]){if(_0x132ed8['error'][_0x97cc('0x10')]===0x1f4){logger[_0x97cc('0xf')](_0x97cc('0xb'),_0x599230,_0x132ed8[_0x97cc('0xf')][_0x97cc('0x11')]);return _0x21747f(_0x132ed8[_0x97cc('0xf')][_0x97cc('0x11')]);}logger[_0x97cc('0xf')]('FaxQueueReport,\x20%s,\x20%s',_0x599230,_0x132ed8[_0x97cc('0xf')][_0x97cc('0x11')]);return _0x3cb103(_0x132ed8[_0x97cc('0xf')][_0x97cc('0x11')]);}else{logger['info']('FaxQueueReport,\x20%s,\x20%s',_0x599230,_0x97cc('0xc'));_0x3cb103(_0x132ed8[_0x97cc('0x12')][_0x97cc('0x11')]);}})['catch'](function(_0xfa1715){logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x599230,_0xfa1715);_0x21747f(_0xfa1715);});});}exports['CreateFaxQueueReport']=function(_0x147093){var _0x3dece1=this;return new Promise(function(_0x1b71ff,_0x24a000){return db['FaxQueueReport'][_0x97cc('0x13')](_0x147093[_0x97cc('0x14')],{'raw':_0x147093['options']?_0x147093[_0x97cc('0x15')][_0x97cc('0x16')]===undefined?!![]:![]:!![]})[_0x97cc('0x17')](function(_0x4e71b5){logger['info'](_0x97cc('0x18'),_0x147093);logger['debug']('CreateFaxQueueReport',_0x147093,JSON[_0x97cc('0x19')](_0x4e71b5));_0x1b71ff(_0x4e71b5);})['catch'](function(_0x114112){logger[_0x97cc('0xf')](_0x97cc('0x18'),_0x114112[_0x97cc('0x11')],_0x147093);_0x24a000(_0x3dece1[_0x97cc('0xf')](0x1f4,_0x114112[_0x97cc('0x11')]));});});};exports[_0x97cc('0x1a')]=function(_0x14cab0){var _0x3c7abb=this;return new Promise(function(_0x8343d5,_0x49a776){return db[_0x97cc('0x1b')][_0x97cc('0x1c')](_0x14cab0[_0x97cc('0x14')],{'raw':_0x14cab0[_0x97cc('0x15')]?_0x14cab0['options'][_0x97cc('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14cab0[_0x97cc('0x15')]?_0x14cab0[_0x97cc('0x15')][_0x97cc('0x1d')]||null:null,'attributes':_0x14cab0['options']?_0x14cab0['options'][_0x97cc('0x1e')]||null:null,'limit':_0x14cab0[_0x97cc('0x15')]?_0x14cab0[_0x97cc('0x15')][_0x97cc('0x1f')]||null:null})[_0x97cc('0x17')](function(_0x58506d){logger[_0x97cc('0xa')]('UpdateFaxQueueReport',_0x14cab0);logger[_0x97cc('0xd')](_0x97cc('0x1a'),_0x14cab0,JSON[_0x97cc('0x19')](_0x58506d));_0x8343d5(_0x58506d);})[_0x97cc('0x20')](function(_0x29c4a9){logger['error']('UpdateFaxQueueReport',_0x29c4a9[_0x97cc('0x11')],_0x14cab0);_0x49a776(_0x3c7abb['error'](0x1f4,_0x29c4a9[_0x97cc('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 0c26418..5e37c69 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 _0x6bac=['post','create','put','update','delete','/:id','destroy','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','/describe','describe','show'];(function(_0x3afbdf,_0x9e463b){var _0x5b6861=function(_0x31d287){while(--_0x31d287){_0x3afbdf['push'](_0x3afbdf['shift']());}};_0x5b6861(++_0x9e463b);}(_0x6bac,0x11f));var _0xc6ba=function(_0xec5b05,_0x11c334){_0xec5b05=_0xec5b05-0x0;var _0x3144af=_0x6bac[_0xec5b05];return _0x3144af;};'use strict';var multer=require(_0xc6ba('0x0'));var util=require(_0xc6ba('0x1'));var path=require(_0xc6ba('0x2'));var timeout=require('connect-timeout');var express=require(_0xc6ba('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc6ba('0x4'));var interaction=require(_0xc6ba('0x5'));var config=require(_0xc6ba('0x6'));var controller=require(_0xc6ba('0x7'));router[_0xc6ba('0x8')]('/',auth[_0xc6ba('0x9')](),controller['index']);router[_0xc6ba('0x8')](_0xc6ba('0xa'),auth[_0xc6ba('0x9')](),controller[_0xc6ba('0xb')]);router['get']('/:id',auth[_0xc6ba('0x9')](),controller[_0xc6ba('0xc')]);router[_0xc6ba('0xd')]('/',auth[_0xc6ba('0x9')](),controller[_0xc6ba('0xe')]);router[_0xc6ba('0xf')]('/:id',auth[_0xc6ba('0x9')](),controller[_0xc6ba('0x10')]);router[_0xc6ba('0x11')](_0xc6ba('0x12'),auth[_0xc6ba('0x9')](),controller[_0xc6ba('0x13')]);module['exports']=router; \ No newline at end of file +var _0x7e81=['put','delete','destroy','exports','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','/:id','show','post','create'];(function(_0x4f4978,_0x35acc9){var _0x583485=function(_0x4c739a){while(--_0x4c739a){_0x4f4978['push'](_0x4f4978['shift']());}};_0x583485(++_0x35acc9);}(_0x7e81,0x1be));var _0x17e8=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0x7e81[_0x4d8ed9];return _0x1e2140;};'use strict';var multer=require('multer');var util=require(_0x17e8('0x0'));var path=require(_0x17e8('0x1'));var timeout=require(_0x17e8('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x17e8('0x3'));var interaction=require(_0x17e8('0x4'));var config=require(_0x17e8('0x5'));var controller=require('./faxQueueReport.controller');router['get']('/',auth[_0x17e8('0x6')](),controller['index']);router[_0x17e8('0x7')](_0x17e8('0x8'),auth[_0x17e8('0x6')](),controller['describe']);router['get'](_0x17e8('0x9'),auth['isAuthenticated'](),controller[_0x17e8('0xa')]);router[_0x17e8('0xb')]('/',auth[_0x17e8('0x6')](),controller[_0x17e8('0xc')]);router[_0x17e8('0xd')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x17e8('0xe')](_0x17e8('0x9'),auth[_0x17e8('0x6')](),controller[_0x17e8('0xf')]);module[_0x17e8('0x10')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index bb2c37d..ed7844c 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 _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x3d974b,_0x120487){var _0x5c9c13=function(_0x2aa3eb){while(--_0x2aa3eb){_0x3d974b['push'](_0x3d974b['shift']());}};_0x5c9c13(++_0x120487);}(_0x70e0,0x17b));var _0x070e=function(_0x2aa0f2,_0x37228d){_0x2aa0f2=_0x2aa0f2-0x0;var _0xc55c93=_0x70e0[_0x2aa0f2];return _0xc55c93;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}}; \ No newline at end of file +var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x2f5718,_0x530809){var _0x134df0=function(_0x32123a){while(--_0x32123a){_0x2f5718['push'](_0x2f5718['shift']());}};_0x134df0(++_0x530809);}(_0x70e0,0x17b));var _0x070e=function(_0x6023ce,_0x1c89d2){_0x6023ce=_0x6023ce-0x0;var _0x4c8411=_0x70e0[_0x6023ce];return _0x4c8411;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index c7633d8..7caa02b 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 _0xa710=['reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','fieldName','key','query','keys','intersection','model','attributes','fields','nolimit','order','sort','filters','filter','where','merge','type','VIRTUAL','options','include','FaxTransferReport','findAll','rows','catch','show','rawAttributes','length','includeAll','find','create','body','params','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','undefined','limit','count','status','set','Content-Range','apply'];(function(_0x541a67,_0x50728d){var _0x45da2a=function(_0x158929){while(--_0x158929){_0x541a67['push'](_0x541a67['shift']());}};_0x45da2a(++_0x50728d);}(_0xa710,0x7a));var _0x0a71=function(_0x34b855,_0x28b4cf){_0x34b855=_0x34b855-0x0;var _0x351c0e=_0xa710[_0x34b855];return _0x351c0e;};'use strict';var emlformat=require(_0x0a71('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0a71('0x1'));var rp=require(_0x0a71('0x2'));var moment=require(_0x0a71('0x3'));var BPromise=require(_0x0a71('0x4'));var Mustache=require(_0x0a71('0x5'));var util=require(_0x0a71('0x6'));var path=require(_0x0a71('0x7'));var sox=require(_0x0a71('0x8'));var csv=require(_0x0a71('0x9'));var ejs=require(_0x0a71('0xa'));var fs=require('fs');var fs_extra=require(_0x0a71('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x0a71('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x0a71('0xd'));var toCsv=require('to-csv');var querystring=require(_0x0a71('0xe'));var Papa=require('papaparse');var Redis=require(_0x0a71('0xf'));var authService=require(_0x0a71('0x10'));var qs=require(_0x0a71('0x11'));var as=require(_0x0a71('0x12'));var hardwareService=require(_0x0a71('0x13'));var logger=require(_0x0a71('0x14'))(_0x0a71('0x15'));var utils=require(_0x0a71('0x16'));var config=require(_0x0a71('0x17'));var licenseUtil=require(_0x0a71('0x18'));var db=require(_0x0a71('0x19'))['db'];function respondWithStatusCode(_0x3ffdf8,_0x5d1a1e){_0x5d1a1e=_0x5d1a1e||0xcc;return function(_0x2a9822){if(_0x2a9822){return _0x3ffdf8['sendStatus'](_0x5d1a1e);}return _0x3ffdf8['status'](_0x5d1a1e)[_0x0a71('0x1a')]();};}function respondWithResult(_0x5f2120,_0x2a2226){_0x2a2226=_0x2a2226||0xc8;return function(_0x1f63bb){if(_0x1f63bb){return _0x5f2120['status'](_0x2a2226)[_0x0a71('0x1b')](_0x1f63bb);}};}function respondWithFilteredResult(_0x277540,_0x12014b){return function(_0x326fe2){if(_0x326fe2){var _0xd11d63=typeof _0x12014b[_0x0a71('0x1c')]===_0x0a71('0x1d')&&typeof _0x12014b[_0x0a71('0x1e')]==='undefined';var _0x515b4f=_0x326fe2['count'];var _0x82ac1d=_0xd11d63?0x0:_0x12014b[_0x0a71('0x1c')];var _0x53bda8=_0xd11d63?_0x326fe2[_0x0a71('0x1f')]:_0x12014b[_0x0a71('0x1c')]+_0x12014b[_0x0a71('0x1e')];var _0x4d3fd6;if(_0x53bda8>=_0x515b4f){_0x53bda8=_0x515b4f;_0x4d3fd6=0xc8;}else{_0x4d3fd6=0xce;}_0x277540[_0x0a71('0x20')](_0x4d3fd6);return _0x277540[_0x0a71('0x21')](_0x0a71('0x22'),_0x82ac1d+'-'+_0x53bda8+'/'+_0x515b4f)[_0x0a71('0x1b')](_0x326fe2);}return null;};}function patchUpdates(_0x3d4e96){return function(_0x224fa6){try{jsonpatch[_0x0a71('0x23')](_0x224fa6,_0x3d4e96,!![]);}catch(_0x2267b3){return BPromise[_0x0a71('0x24')](_0x2267b3);}return _0x224fa6[_0x0a71('0x25')]();};}function saveUpdates(_0x127a7b,_0x547fae){return function(_0x2b4fed){if(_0x2b4fed){return _0x2b4fed[_0x0a71('0x26')](_0x127a7b)[_0x0a71('0x27')](function(_0xde46cd){return _0xde46cd;});}return null;};}function removeEntity(_0x4c6af2,_0x3c299b){return function(_0x1eccf4){if(_0x1eccf4){return _0x1eccf4[_0x0a71('0x28')]()['then'](function(){_0x4c6af2[_0x0a71('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x79fb68,_0xe75ab8){return function(_0x428e80){if(!_0x428e80){_0x79fb68[_0x0a71('0x29')](0x194);}return _0x428e80;};}function handleError(_0x24d59a,_0x35c58c){_0x35c58c=_0x35c58c||0x1f4;return function(_0x3bc0c2){logger['error'](_0x3bc0c2[_0x0a71('0x2a')]);if(_0x3bc0c2['name']){delete _0x3bc0c2[_0x0a71('0x2b')];}_0x24d59a['status'](_0x35c58c)[_0x0a71('0x2c')](_0x3bc0c2);};}exports[_0x0a71('0x2d')]=function(_0x40a52c,_0x5cb643){var _0x398c47={},_0x352dde={},_0x48d726={'count':0x0,'rows':[]};var _0x51611b=_[_0x0a71('0x2e')](db['FaxTransferReport']['rawAttributes'],function(_0x1c4dea){return{'name':_0x1c4dea[_0x0a71('0x2f')],'type':_0x1c4dea['type'][_0x0a71('0x30')]};});_0x352dde['model']=_[_0x0a71('0x2e')](_0x51611b,'name');_0x352dde[_0x0a71('0x31')]=_[_0x0a71('0x32')](_0x40a52c[_0x0a71('0x31')]);_0x352dde['filters']=_[_0x0a71('0x33')](_0x352dde[_0x0a71('0x34')],_0x352dde[_0x0a71('0x31')]);_0x398c47[_0x0a71('0x35')]=_[_0x0a71('0x33')](_0x352dde['model'],qs['fields'](_0x40a52c[_0x0a71('0x31')][_0x0a71('0x36')]));_0x398c47[_0x0a71('0x35')]=_0x398c47['attributes']['length']?_0x398c47['attributes']:_0x352dde[_0x0a71('0x34')];if(!_0x40a52c[_0x0a71('0x31')]['hasOwnProperty'](_0x0a71('0x37'))){_0x398c47[_0x0a71('0x1e')]=qs[_0x0a71('0x1e')](_0x40a52c[_0x0a71('0x31')]['limit']);_0x398c47[_0x0a71('0x1c')]=qs[_0x0a71('0x1c')](_0x40a52c[_0x0a71('0x31')][_0x0a71('0x1c')]);}_0x398c47[_0x0a71('0x38')]=qs[_0x0a71('0x39')](_0x40a52c[_0x0a71('0x31')][_0x0a71('0x39')]);_0x398c47['where']=qs['filters'](_['pick'](_0x40a52c[_0x0a71('0x31')],_0x352dde[_0x0a71('0x3a')]),_0x51611b);if(_0x40a52c[_0x0a71('0x31')][_0x0a71('0x3b')]){_0x398c47[_0x0a71('0x3c')]=_[_0x0a71('0x3d')](_0x398c47['where'],{'$or':_[_0x0a71('0x2e')](_0x51611b,function(_0x39a4cc){if(_0x39a4cc[_0x0a71('0x3e')]!==_0x0a71('0x3f')){var _0x5402c4={};_0x5402c4[_0x39a4cc[_0x0a71('0x2b')]]={'$like':'%'+_0x40a52c['query'][_0x0a71('0x3b')]+'%'};return _0x5402c4;}})});}_0x398c47=_['merge']({},_0x398c47,_0x40a52c[_0x0a71('0x40')]);var _0x1fede5={'where':_0x398c47[_0x0a71('0x3c')]};return db['FaxTransferReport'][_0x0a71('0x1f')](_0x1fede5)[_0x0a71('0x27')](function(_0x721833){_0x48d726[_0x0a71('0x1f')]=_0x721833;if(_0x40a52c[_0x0a71('0x31')]['includeAll']){_0x398c47[_0x0a71('0x41')]=[{'all':!![]}];}return db[_0x0a71('0x42')][_0x0a71('0x43')](_0x398c47);})['then'](function(_0x588f79){_0x48d726[_0x0a71('0x44')]=_0x588f79;return _0x48d726;})[_0x0a71('0x27')](respondWithFilteredResult(_0x5cb643,_0x398c47))[_0x0a71('0x45')](handleError(_0x5cb643,null));};exports[_0x0a71('0x46')]=function(_0x5620e6,_0x2f46d9){var _0x4c1dc9={'raw':!![],'where':{'id':_0x5620e6['params']['id']}},_0x514c31={};_0x514c31[_0x0a71('0x34')]=_[_0x0a71('0x32')](db['FaxTransferReport'][_0x0a71('0x47')]);_0x514c31['query']=_[_0x0a71('0x32')](_0x5620e6[_0x0a71('0x31')]);_0x514c31[_0x0a71('0x3a')]=_[_0x0a71('0x33')](_0x514c31[_0x0a71('0x34')],_0x514c31[_0x0a71('0x31')]);_0x4c1dc9[_0x0a71('0x35')]=_[_0x0a71('0x33')](_0x514c31['model'],qs[_0x0a71('0x36')](_0x5620e6[_0x0a71('0x31')]['fields']));_0x4c1dc9[_0x0a71('0x35')]=_0x4c1dc9[_0x0a71('0x35')][_0x0a71('0x48')]?_0x4c1dc9[_0x0a71('0x35')]:_0x514c31[_0x0a71('0x34')];if(_0x5620e6['query'][_0x0a71('0x49')]){_0x4c1dc9['include']=[{'all':!![]}];}_0x4c1dc9=_[_0x0a71('0x3d')]({},_0x4c1dc9,_0x5620e6[_0x0a71('0x40')]);return db['FaxTransferReport'][_0x0a71('0x4a')](_0x4c1dc9)[_0x0a71('0x27')](handleEntityNotFound(_0x2f46d9,null))[_0x0a71('0x27')](respondWithResult(_0x2f46d9,null))[_0x0a71('0x45')](handleError(_0x2f46d9,null));};exports[_0x0a71('0x4b')]=function(_0x34d9c8,_0x32629c){return db['FaxTransferReport']['create'](_0x34d9c8[_0x0a71('0x4c')],{})[_0x0a71('0x27')](respondWithResult(_0x32629c,0xc9))['catch'](handleError(_0x32629c,null));};exports[_0x0a71('0x26')]=function(_0x42c5d0,_0x1cb98a){if(_0x42c5d0[_0x0a71('0x4c')]['id']){delete _0x42c5d0[_0x0a71('0x4c')]['id'];}return db['FaxTransferReport'][_0x0a71('0x4a')]({'where':{'id':_0x42c5d0[_0x0a71('0x4d')]['id']}})[_0x0a71('0x27')](handleEntityNotFound(_0x1cb98a,null))['then'](saveUpdates(_0x42c5d0['body'],null))[_0x0a71('0x27')](respondWithResult(_0x1cb98a,null))[_0x0a71('0x45')](handleError(_0x1cb98a,null));};exports['destroy']=function(_0x3e25d0,_0x327d09){return db[_0x0a71('0x42')]['find']({'where':{'id':_0x3e25d0['params']['id']}})[_0x0a71('0x27')](handleEntityNotFound(_0x327d09,null))[_0x0a71('0x27')](removeEntity(_0x327d09,null))[_0x0a71('0x45')](handleError(_0x327d09,null));};exports[_0x0a71('0x4e')]=function(_0x22f43b,_0x49e840){return db[_0x0a71('0x42')]['describe']()['then'](respondWithResult(_0x49e840,null))[_0x0a71('0x45')](handleError(_0x49e840,null));}; \ No newline at end of file +var _0x83ec=['rawAttributes','fieldName','type','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','FaxTransferReport','includeAll','include','findAll','show','params','find','catch','create','update','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','sendStatus','error','name','send','index','map'];(function(_0x3c43e7,_0x2ae397){var _0xd4b3f0=function(_0x583fff){while(--_0x583fff){_0x3c43e7['push'](_0x3c43e7['shift']());}};_0xd4b3f0(++_0x2ae397);}(_0x83ec,0x157));var _0xc83e=function(_0x334798,_0x467ca4){_0x334798=_0x334798-0x0;var _0x254ea0=_0x83ec[_0x334798];return _0x254ea0;};'use strict';var emlformat=require(_0xc83e('0x0'));var rimraf=require(_0xc83e('0x1'));var zipdir=require(_0xc83e('0x2'));var jsonpatch=require(_0xc83e('0x3'));var rp=require(_0xc83e('0x4'));var moment=require(_0xc83e('0x5'));var BPromise=require(_0xc83e('0x6'));var Mustache=require(_0xc83e('0x7'));var util=require(_0xc83e('0x8'));var path=require(_0xc83e('0x9'));var sox=require('sox');var csv=require(_0xc83e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc83e('0xb'));var _=require(_0xc83e('0xc'));var squel=require(_0xc83e('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc83e('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc83e('0xf'));var Redis=require(_0xc83e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xc83e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc83e('0x12'))(_0xc83e('0x13'));var utils=require(_0xc83e('0x14'));var config=require(_0xc83e('0x15'));var licenseUtil=require(_0xc83e('0x16'));var db=require(_0xc83e('0x17'))['db'];function respondWithStatusCode(_0x217d6b,_0x3d3d4b){_0x3d3d4b=_0x3d3d4b||0xcc;return function(_0x26a429){if(_0x26a429){return _0x217d6b['sendStatus'](_0x3d3d4b);}return _0x217d6b[_0xc83e('0x18')](_0x3d3d4b)[_0xc83e('0x19')]();};}function respondWithResult(_0x293af5,_0x2bd2b4){_0x2bd2b4=_0x2bd2b4||0xc8;return function(_0xec5d5e){if(_0xec5d5e){return _0x293af5[_0xc83e('0x18')](_0x2bd2b4)[_0xc83e('0x1a')](_0xec5d5e);}};}function respondWithFilteredResult(_0x408eb2,_0x5d8258){return function(_0x4f2293){if(_0x4f2293){var _0x5b5ec4=typeof _0x5d8258[_0xc83e('0x1b')]===_0xc83e('0x1c')&&typeof _0x5d8258[_0xc83e('0x1d')]==='undefined';var _0x5c044b=_0x4f2293['count'];var _0xe22df7=_0x5b5ec4?0x0:_0x5d8258[_0xc83e('0x1b')];var _0x4ce9c7=_0x5b5ec4?_0x4f2293[_0xc83e('0x1e')]:_0x5d8258[_0xc83e('0x1b')]+_0x5d8258['limit'];var _0x5d89ac;if(_0x4ce9c7>=_0x5c044b){_0x4ce9c7=_0x5c044b;_0x5d89ac=0xc8;}else{_0x5d89ac=0xce;}_0x408eb2['status'](_0x5d89ac);return _0x408eb2[_0xc83e('0x1f')]('Content-Range',_0xe22df7+'-'+_0x4ce9c7+'/'+_0x5c044b)[_0xc83e('0x1a')](_0x4f2293);}return null;};}function patchUpdates(_0x92fb7d){return function(_0x4c455b){try{jsonpatch[_0xc83e('0x20')](_0x4c455b,_0x92fb7d,!![]);}catch(_0x138000){return BPromise[_0xc83e('0x21')](_0x138000);}return _0x4c455b[_0xc83e('0x22')]();};}function saveUpdates(_0x1f29bd,_0x59e7bc){return function(_0x19c52c){if(_0x19c52c){return _0x19c52c['update'](_0x1f29bd)['then'](function(_0x2257c3){return _0x2257c3;});}return null;};}function removeEntity(_0x2e9d1b,_0x54a161){return function(_0x1924c9){if(_0x1924c9){return _0x1924c9['destroy']()[_0xc83e('0x23')](function(){_0x2e9d1b['status'](0xcc)[_0xc83e('0x19')]();});}};}function handleEntityNotFound(_0x40ae4b,_0x42996e){return function(_0x3a65d6){if(!_0x3a65d6){_0x40ae4b[_0xc83e('0x24')](0x194);}return _0x3a65d6;};}function handleError(_0x218df4,_0x279fd8){_0x279fd8=_0x279fd8||0x1f4;return function(_0x3958fc){logger[_0xc83e('0x25')](_0x3958fc['stack']);if(_0x3958fc['name']){delete _0x3958fc[_0xc83e('0x26')];}_0x218df4[_0xc83e('0x18')](_0x279fd8)[_0xc83e('0x27')](_0x3958fc);};}exports[_0xc83e('0x28')]=function(_0xfcf43f,_0x5c6e42){var _0x4a7363={},_0x5b8de5={},_0x1d3cda={'count':0x0,'rows':[]};var _0x4c2432=_[_0xc83e('0x29')](db['FaxTransferReport'][_0xc83e('0x2a')],function(_0x41d1fd){return{'name':_0x41d1fd[_0xc83e('0x2b')],'type':_0x41d1fd[_0xc83e('0x2c')][_0xc83e('0x2d')]};});_0x5b8de5[_0xc83e('0x2e')]=_[_0xc83e('0x29')](_0x4c2432,'name');_0x5b8de5['query']=_[_0xc83e('0x2f')](_0xfcf43f['query']);_0x5b8de5['filters']=_[_0xc83e('0x30')](_0x5b8de5[_0xc83e('0x2e')],_0x5b8de5[_0xc83e('0x31')]);_0x4a7363[_0xc83e('0x32')]=_[_0xc83e('0x30')](_0x5b8de5[_0xc83e('0x2e')],qs[_0xc83e('0x33')](_0xfcf43f['query']['fields']));_0x4a7363[_0xc83e('0x32')]=_0x4a7363[_0xc83e('0x32')][_0xc83e('0x34')]?_0x4a7363[_0xc83e('0x32')]:_0x5b8de5[_0xc83e('0x2e')];if(!_0xfcf43f[_0xc83e('0x31')][_0xc83e('0x35')](_0xc83e('0x36'))){_0x4a7363[_0xc83e('0x1d')]=qs['limit'](_0xfcf43f['query']['limit']);_0x4a7363[_0xc83e('0x1b')]=qs[_0xc83e('0x1b')](_0xfcf43f[_0xc83e('0x31')][_0xc83e('0x1b')]);}_0x4a7363[_0xc83e('0x37')]=qs[_0xc83e('0x38')](_0xfcf43f['query'][_0xc83e('0x38')]);_0x4a7363['where']=qs[_0xc83e('0x39')](_[_0xc83e('0x3a')](_0xfcf43f[_0xc83e('0x31')],_0x5b8de5[_0xc83e('0x39')]),_0x4c2432);if(_0xfcf43f[_0xc83e('0x31')][_0xc83e('0x3b')]){_0x4a7363[_0xc83e('0x3c')]=_[_0xc83e('0x3d')](_0x4a7363['where'],{'$or':_[_0xc83e('0x29')](_0x4c2432,function(_0x321661){if(_0x321661[_0xc83e('0x2c')]!==_0xc83e('0x3e')){var _0x55638c={};_0x55638c[_0x321661[_0xc83e('0x26')]]={'$like':'%'+_0xfcf43f[_0xc83e('0x31')][_0xc83e('0x3b')]+'%'};return _0x55638c;}})});}_0x4a7363=_[_0xc83e('0x3d')]({},_0x4a7363,_0xfcf43f[_0xc83e('0x3f')]);var _0x38ec90={'where':_0x4a7363[_0xc83e('0x3c')]};return db[_0xc83e('0x40')][_0xc83e('0x1e')](_0x38ec90)[_0xc83e('0x23')](function(_0x3c1251){_0x1d3cda['count']=_0x3c1251;if(_0xfcf43f[_0xc83e('0x31')][_0xc83e('0x41')]){_0x4a7363[_0xc83e('0x42')]=[{'all':!![]}];}return db[_0xc83e('0x40')][_0xc83e('0x43')](_0x4a7363);})[_0xc83e('0x23')](function(_0x231a53){_0x1d3cda['rows']=_0x231a53;return _0x1d3cda;})[_0xc83e('0x23')](respondWithFilteredResult(_0x5c6e42,_0x4a7363))['catch'](handleError(_0x5c6e42,null));};exports[_0xc83e('0x44')]=function(_0x48ada3,_0x2aa4ef){var _0x4136d1={'raw':!![],'where':{'id':_0x48ada3[_0xc83e('0x45')]['id']}},_0x464661={};_0x464661[_0xc83e('0x2e')]=_[_0xc83e('0x2f')](db['FaxTransferReport'][_0xc83e('0x2a')]);_0x464661[_0xc83e('0x31')]=_['keys'](_0x48ada3[_0xc83e('0x31')]);_0x464661[_0xc83e('0x39')]=_[_0xc83e('0x30')](_0x464661[_0xc83e('0x2e')],_0x464661['query']);_0x4136d1[_0xc83e('0x32')]=_['intersection'](_0x464661[_0xc83e('0x2e')],qs[_0xc83e('0x33')](_0x48ada3[_0xc83e('0x31')]['fields']));_0x4136d1[_0xc83e('0x32')]=_0x4136d1[_0xc83e('0x32')][_0xc83e('0x34')]?_0x4136d1[_0xc83e('0x32')]:_0x464661[_0xc83e('0x2e')];if(_0x48ada3[_0xc83e('0x31')][_0xc83e('0x41')]){_0x4136d1[_0xc83e('0x42')]=[{'all':!![]}];}_0x4136d1=_[_0xc83e('0x3d')]({},_0x4136d1,_0x48ada3[_0xc83e('0x3f')]);return db[_0xc83e('0x40')][_0xc83e('0x46')](_0x4136d1)[_0xc83e('0x23')](handleEntityNotFound(_0x2aa4ef,null))[_0xc83e('0x23')](respondWithResult(_0x2aa4ef,null))[_0xc83e('0x47')](handleError(_0x2aa4ef,null));};exports[_0xc83e('0x48')]=function(_0x249815,_0x3581c3){return db[_0xc83e('0x40')][_0xc83e('0x48')](_0x249815['body'],{})[_0xc83e('0x23')](respondWithResult(_0x3581c3,0xc9))[_0xc83e('0x47')](handleError(_0x3581c3,null));};exports[_0xc83e('0x49')]=function(_0x6cf2de,_0x7d99b6){if(_0x6cf2de[_0xc83e('0x4a')]['id']){delete _0x6cf2de[_0xc83e('0x4a')]['id'];}return db['FaxTransferReport'][_0xc83e('0x46')]({'where':{'id':_0x6cf2de['params']['id']}})[_0xc83e('0x23')](handleEntityNotFound(_0x7d99b6,null))[_0xc83e('0x23')](saveUpdates(_0x6cf2de[_0xc83e('0x4a')],null))[_0xc83e('0x23')](respondWithResult(_0x7d99b6,null))[_0xc83e('0x47')](handleError(_0x7d99b6,null));};exports[_0xc83e('0x4b')]=function(_0x3a9516,_0x2e7c72){return db[_0xc83e('0x40')]['find']({'where':{'id':_0x3a9516[_0xc83e('0x45')]['id']}})[_0xc83e('0x23')](handleEntityNotFound(_0x2e7c72,null))[_0xc83e('0x23')](removeEntity(_0x2e7c72,null))['catch'](handleError(_0x2e7c72,null));};exports[_0xc83e('0x4c')]=function(_0x3282d6,_0x205dfc){return db['FaxTransferReport'][_0xc83e('0x4c')]()['then'](respondWithResult(_0x205dfc,null))[_0xc83e('0x47')](handleError(_0x205dfc,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index c8b7483..b2d5ed2 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 _0x117c=['../../config/logger','moment','bluebird','request-promise','rimraf','./faxTransferReport.attributes','exports','FaxTransferReport','report_fax_transfer','uniqueid','lodash'];(function(_0x2d357c,_0x58bd29){var _0x1a3480=function(_0x4d8264){while(--_0x4d8264){_0x2d357c['push'](_0x2d357c['shift']());}};_0x1a3480(++_0x58bd29);}(_0x117c,0x11d));var _0xc117=function(_0x39868e,_0x4b6da9){_0x39868e=_0x39868e-0x0;var _0x4eadec=_0x117c[_0x39868e];return _0x4eadec;};'use strict';var _=require(_0xc117('0x0'));var util=require('util');var logger=require(_0xc117('0x1'))('api');var moment=require(_0xc117('0x2'));var BPromise=require(_0xc117('0x3'));var rp=require(_0xc117('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc117('0x5'));var config=require('../../config/environment');var attributes=require(_0xc117('0x6'));module[_0xc117('0x7')]=function(_0x5e7641,_0x1212a7){return _0x5e7641['define'](_0xc117('0x8'),attributes,{'tableName':_0xc117('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xc117('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xda16=['uniqueid','lodash','util','../../config/logger','api','path','rimraf','../../config/environment','exports','define','report_fax_transfer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xda16,0x1cf));var _0x6da1=function(_0x50f392,_0x1d8441){_0x50f392=_0x50f392-0x0;var _0x5926f2=_0xda16[_0x50f392];return _0x5926f2;};'use strict';var _=require(_0x6da1('0x0'));var util=require(_0x6da1('0x1'));var logger=require(_0x6da1('0x2'))(_0x6da1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6da1('0x4'));var rimraf=require(_0x6da1('0x5'));var config=require(_0x6da1('0x6'));var attributes=require('./faxTransferReport.attributes');module[_0x6da1('0x7')]=function(_0xf0ed70,_0x41561a){return _0xf0ed70[_0x6da1('0x8')]('FaxTransferReport',attributes,{'tableName':_0x6da1('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x6da1('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 69162b2..39715af 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 _0x4a0f=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x18f7e5,_0x547ea5){var _0x84094e=function(_0x338f10){while(--_0x338f10){_0x18f7e5['push'](_0x18f7e5['shift']());}};_0x84094e(++_0x547ea5);}(_0x4a0f,0x111));var _0xf4a0=function(_0x4301e8,_0x2db3c6){_0x4301e8=_0x4301e8-0x0;var _0x1b8df2=_0x4a0f[_0x4301e8];return _0x1b8df2;};'use strict';var _=require(_0xf4a0('0x0'));var util=require(_0xf4a0('0x1'));var moment=require(_0xf4a0('0x2'));var BPromise=require(_0xf4a0('0x3'));var rs=require(_0xf4a0('0x4'));var fs=require('fs');var Redis=require(_0xf4a0('0x5'));var db=require(_0xf4a0('0x6'))['db'];var utils=require(_0xf4a0('0x7'));var logger=require(_0xf4a0('0x8'))(_0xf4a0('0x9'));var config=require(_0xf4a0('0xa'));var jayson=require(_0xf4a0('0xb'));var client=jayson['client'][_0xf4a0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4a69aa,_0x4f224d,_0x8a1ad6){return new BPromise(function(_0x4ca5c8,_0x4303ce){return client[_0xf4a0('0xd')](_0x4a69aa,_0x8a1ad6)['then'](function(_0x3994d0){logger[_0xf4a0('0xe')](_0xf4a0('0xf'),_0x4f224d,_0xf4a0('0x10'));logger['debug'](_0xf4a0('0x11'),_0x4f224d,_0xf4a0('0x10'),JSON[_0xf4a0('0x12')](_0x3994d0));if(_0x3994d0[_0xf4a0('0x13')]){if(_0x3994d0[_0xf4a0('0x13')][_0xf4a0('0x14')]===0x1f4){logger['error'](_0xf4a0('0xf'),_0x4f224d,_0x3994d0['error'][_0xf4a0('0x15')]);return _0x4303ce(_0x3994d0[_0xf4a0('0x13')]['message']);}logger[_0xf4a0('0x13')](_0xf4a0('0xf'),_0x4f224d,_0x3994d0[_0xf4a0('0x13')][_0xf4a0('0x15')]);return _0x4ca5c8(_0x3994d0['error'][_0xf4a0('0x15')]);}else{logger[_0xf4a0('0xe')](_0xf4a0('0xf'),_0x4f224d,_0xf4a0('0x10'));_0x4ca5c8(_0x3994d0['result']['message']);}})[_0xf4a0('0x16')](function(_0x3774c1){logger[_0xf4a0('0x13')]('FaxTransferReport,\x20%s,\x20%s',_0x4f224d,_0x3774c1);_0x4303ce(_0x3774c1);});});} \ No newline at end of file +var _0xd5f5=['randomstring','../../mysqldb','../../config/utils','rpc','client','http','request','then','info','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FaxTransferReport,\x20%s,\x20%s','result','lodash','util','moment','bluebird'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0xd5f5,0x6a));var _0x5d5f=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xd5f5[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x5d5f('0x0'));var util=require(_0x5d5f('0x1'));var moment=require(_0x5d5f('0x2'));var BPromise=require(_0x5d5f('0x3'));var rs=require(_0x5d5f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5d5f('0x5'))['db'];var utils=require(_0x5d5f('0x6'));var logger=require('../../config/logger')(_0x5d5f('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5d5f('0x8')][_0x5d5f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a556c,_0x93eef7,_0x204952){return new BPromise(function(_0x6cfbe4,_0x4233c7){return client[_0x5d5f('0xa')](_0x4a556c,_0x204952)[_0x5d5f('0xb')](function(_0x1b11c1){logger[_0x5d5f('0xc')]('FaxTransferReport,\x20%s,\x20%s',_0x93eef7,_0x5d5f('0xd'));logger[_0x5d5f('0xe')](_0x5d5f('0xf'),_0x93eef7,_0x5d5f('0xd'),JSON[_0x5d5f('0x10')](_0x1b11c1));if(_0x1b11c1['error']){if(_0x1b11c1[_0x5d5f('0x11')][_0x5d5f('0x12')]===0x1f4){logger[_0x5d5f('0x11')]('FaxTransferReport,\x20%s,\x20%s',_0x93eef7,_0x1b11c1[_0x5d5f('0x11')]['message']);return _0x4233c7(_0x1b11c1[_0x5d5f('0x11')]['message']);}logger[_0x5d5f('0x11')]('FaxTransferReport,\x20%s,\x20%s',_0x93eef7,_0x1b11c1[_0x5d5f('0x11')]['message']);return _0x6cfbe4(_0x1b11c1[_0x5d5f('0x11')][_0x5d5f('0x13')]);}else{logger[_0x5d5f('0xc')](_0x5d5f('0x14'),_0x93eef7,_0x5d5f('0xd'));_0x6cfbe4(_0x1b11c1[_0x5d5f('0x15')][_0x5d5f('0x13')]);}})['catch'](function(_0x593904){logger[_0x5d5f('0x11')](_0x5d5f('0x14'),_0x93eef7,_0x593904);_0x4233c7(_0x593904);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index f1532b6..df28af7 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 _0x15b0=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','create','put','update','delete','destroy','exports','multer'];(function(_0x5e3a45,_0x45f0c5){var _0x13419f=function(_0x5ac996){while(--_0x5ac996){_0x5e3a45['push'](_0x5e3a45['shift']());}};_0x13419f(++_0x45f0c5);}(_0x15b0,0x131));var _0x015b=function(_0x1e73fc,_0x533750){_0x1e73fc=_0x1e73fc-0x0;var _0xeceac4=_0x15b0[_0x1e73fc];return _0xeceac4;};'use strict';var multer=require(_0x015b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x015b('0x1'));var express=require(_0x015b('0x2'));var router=express[_0x015b('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x015b('0x4'));var config=require(_0x015b('0x5'));var controller=require('./faxTransferReport.controller');router[_0x015b('0x6')]('/',auth[_0x015b('0x7')](),controller[_0x015b('0x8')]);router[_0x015b('0x6')](_0x015b('0x9'),auth[_0x015b('0x7')](),controller[_0x015b('0xa')]);router[_0x015b('0x6')](_0x015b('0xb'),auth[_0x015b('0x7')](),controller['show']);router['post']('/',auth[_0x015b('0x7')](),controller[_0x015b('0xc')]);router[_0x015b('0xd')]('/:id',auth[_0x015b('0x7')](),controller[_0x015b('0xe')]);router[_0x015b('0xf')](_0x015b('0xb'),auth[_0x015b('0x7')](),controller[_0x015b('0x10')]);module[_0x015b('0x11')]=router; \ No newline at end of file +var _0x031f=['multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','put','update','destroy','exports'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x031f,0x168));var _0xf031=function(_0x52d17b,_0x24a7dd){_0x52d17b=_0x52d17b-0x0;var _0x57767e=_0x031f[_0x52d17b];return _0x57767e;};'use strict';var multer=require(_0xf031('0x0'));var util=require('util');var path=require(_0xf031('0x1'));var timeout=require(_0xf031('0x2'));var express=require(_0xf031('0x3'));var router=express[_0xf031('0x4')]();var fs_extra=require(_0xf031('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf031('0x6'));var config=require(_0xf031('0x7'));var controller=require(_0xf031('0x8'));router[_0xf031('0x9')]('/',auth[_0xf031('0xa')](),controller[_0xf031('0xb')]);router[_0xf031('0x9')](_0xf031('0xc'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xf031('0xd'),auth['isAuthenticated'](),controller[_0xf031('0xe')]);router[_0xf031('0xf')]('/',auth[_0xf031('0xa')](),controller['create']);router[_0xf031('0x10')]('/:id',auth[_0xf031('0xa')](),controller[_0xf031('0x11')]);router['delete'](_0xf031('0xd'),auth[_0xf031('0xa')](),controller[_0xf031('0x12')]);module[_0xf031('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 72dd508..2e9c43e 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 _0xc113=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskAccount.controller','get','index','/:id','show','getConfigurations','isAuthenticated','getFields','post','create','/:id/configurations','addConfiguration','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x43a6cd,_0x1abe8f){var _0x1395b2=function(_0x20645a){while(--_0x20645a){_0x43a6cd['push'](_0x43a6cd['shift']());}};_0x1395b2(++_0x1abe8f);}(_0xc113,0x1ab));var _0x3c11=function(_0x3005f1,_0x247258){_0x3005f1=_0x3005f1-0x0;var _0x2d292b=_0xc113[_0x3005f1];return _0x2d292b;};'use strict';var multer=require(_0x3c11('0x0'));var util=require(_0x3c11('0x1'));var path=require(_0x3c11('0x2'));var timeout=require(_0x3c11('0x3'));var express=require(_0x3c11('0x4'));var router=express[_0x3c11('0x5')]();var fs_extra=require(_0x3c11('0x6'));var auth=require(_0x3c11('0x7'));var interaction=require(_0x3c11('0x8'));var config=require('../../config/environment');var controller=require(_0x3c11('0x9'));router[_0x3c11('0xa')]('/',auth['isAuthenticated'](),controller[_0x3c11('0xb')]);router[_0x3c11('0xa')](_0x3c11('0xc'),auth['isAuthenticated'](),controller[_0x3c11('0xd')]);router['get']('/:id/configurations',auth['isAuthenticated'](),controller[_0x3c11('0xe')]);router[_0x3c11('0xa')]('/:id/fields',auth[_0x3c11('0xf')](),controller[_0x3c11('0x10')]);router[_0x3c11('0x11')]('/',auth['isAuthenticated'](),controller[_0x3c11('0x12')]);router[_0x3c11('0x11')](_0x3c11('0x13'),auth[_0x3c11('0xf')](),controller[_0x3c11('0x14')]);router['put'](_0x3c11('0xc'),auth[_0x3c11('0xf')](),controller['update']);router[_0x3c11('0x15')](_0x3c11('0xc'),auth[_0x3c11('0xf')](),controller[_0x3c11('0x16')]);module[_0x3c11('0x17')]=router; \ No newline at end of file +var _0x4969=['/:id/configurations','/:id/fields','getFields','create','post','/:id','update','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','isAuthenticated','show','get'];(function(_0x650a19,_0x3d1ab9){var _0x5e8e61=function(_0x24158c){while(--_0x24158c){_0x650a19['push'](_0x650a19['shift']());}};_0x5e8e61(++_0x3d1ab9);}(_0x4969,0x1ec));var _0x9496=function(_0x368e09,_0x2c1517){_0x368e09=_0x368e09-0x0;var _0x14b7df=_0x4969[_0x368e09];return _0x14b7df;};'use strict';var multer=require('multer');var util=require(_0x9496('0x0'));var path=require(_0x9496('0x1'));var timeout=require(_0x9496('0x2'));var express=require('express');var router=express[_0x9496('0x3')]();var fs_extra=require(_0x9496('0x4'));var auth=require(_0x9496('0x5'));var interaction=require(_0x9496('0x6'));var config=require(_0x9496('0x7'));var controller=require('./intDeskAccount.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x9496('0x8')]);router['get']('/:id',auth[_0x9496('0x9')](),controller[_0x9496('0xa')]);router[_0x9496('0xb')](_0x9496('0xc'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x9496('0xb')](_0x9496('0xd'),auth[_0x9496('0x9')](),controller[_0x9496('0xe')]);router['post']('/',auth[_0x9496('0x9')](),controller[_0x9496('0xf')]);router[_0x9496('0x10')](_0x9496('0xc'),auth[_0x9496('0x9')](),controller['addConfiguration']);router['put'](_0x9496('0x11'),auth['isAuthenticated'](),controller[_0x9496('0x12')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x9496('0x13')]);module[_0x9496('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index d3f40f6..3ef098e 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 _0xf892=['sequelize','STRING','ENUM','basic','integrationTab','newTab'];(function(_0x4dce97,_0x1b9719){var _0x417143=function(_0x1a5472){while(--_0x1a5472){_0x4dce97['push'](_0x4dce97['shift']());}};_0x417143(++_0x1b9719);}(_0xf892,0x9c));var _0x2f89=function(_0x1ae139,_0x529c60){_0x1ae139=_0x1ae139-0x0;var _0x5e0de7=_0xf892[_0x1ae139];return _0x5e0de7;};'use strict';var Sequelize=require(_0x2f89('0x0'));module['exports']={'name':{'type':Sequelize[_0x2f89('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x2f89('0x1')]},'remoteUri':{'type':Sequelize[_0x2f89('0x1')]},'authType':{'type':Sequelize[_0x2f89('0x2')](_0x2f89('0x3')),'defaultValue':_0x2f89('0x3')},'password':{'type':Sequelize[_0x2f89('0x1')]},'consumerKey':{'type':Sequelize[_0x2f89('0x1')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x2f89('0x1')]},'tokenSecret':{'type':Sequelize[_0x2f89('0x1')]},'serverUrl':{'type':Sequelize[_0x2f89('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x2f89('0x2')](_0x2f89('0x4'),_0x2f89('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x4534=['STRING','ENUM','basic','integrationTab'];(function(_0x274adb,_0x26a3bd){var _0x26c309=function(_0x48b74e){while(--_0x48b74e){_0x274adb['push'](_0x274adb['shift']());}};_0x26c309(++_0x26a3bd);}(_0x4534,0xc0));var _0x4453=function(_0x3f14b0,_0x4c8149){_0x3f14b0=_0x3f14b0-0x0;var _0x42fe8b=_0x4534[_0x3f14b0];return _0x42fe8b;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4453('0x0')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x4453('0x0')]},'remoteUri':{'type':Sequelize[_0x4453('0x0')]},'authType':{'type':Sequelize[_0x4453('0x1')]('basic'),'defaultValue':_0x4453('0x2')},'password':{'type':Sequelize[_0x4453('0x0')]},'consumerKey':{'type':Sequelize[_0x4453('0x0')]},'consumerSecret':{'type':Sequelize[_0x4453('0x0')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0x4453('0x0')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x4453('0x1')](_0x4453('0x3'),'newTab'),'defaultValue':_0x4453('0x3')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index e428bc1..1d03c06 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 _0x5f10=['rows','catch','show','params','filters','includeAll','include','find','create','update','body','getConfigurations','DeskConfiguration','order','addConfiguration','findOne','Subjects','getDescriptions','channel','DeskField','priority','authType','username','password','consumerKey','consumerSecret','tokenSecret','remoteUri','substring','lastIndexOf','GET','format','%s/custom_fields','basic','headers','Authorization','Basic\x20%s','%s:%s','toString','base64','concat','entries','active','label','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','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','map','DeskAccount','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','options','findAll'];(function(_0x47d7fb,_0x381133){var _0x1afe19=function(_0x139ab7){while(--_0x139ab7){_0x47d7fb['push'](_0x47d7fb['shift']());}};_0x1afe19(++_0x381133);}(_0x5f10,0x18b));var _0x05f1=function(_0x303875,_0x29fc7f){_0x303875=_0x303875-0x0;var _0x507814=_0x5f10[_0x303875];return _0x507814;};'use strict';var emlformat=require(_0x05f1('0x0'));var rimraf=require(_0x05f1('0x1'));var zipdir=require(_0x05f1('0x2'));var jsonpatch=require(_0x05f1('0x3'));var rp=require(_0x05f1('0x4'));var moment=require('moment');var BPromise=require(_0x05f1('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x05f1('0x6'));var sox=require(_0x05f1('0x7'));var csv=require(_0x05f1('0x8'));var ejs=require(_0x05f1('0x9'));var fs=require('fs');var fs_extra=require(_0x05f1('0xa'));var _=require(_0x05f1('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x05f1('0xc'));var toCsv=require('to-csv');var querystring=require(_0x05f1('0xd'));var Papa=require(_0x05f1('0xe'));var Redis=require(_0x05f1('0xf'));var authService=require(_0x05f1('0x10'));var qs=require(_0x05f1('0x11'));var as=require(_0x05f1('0x12'));var hardwareService=require(_0x05f1('0x13'));var logger=require(_0x05f1('0x14'))(_0x05f1('0x15'));var utils=require(_0x05f1('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x05f1('0x17'));var db=require(_0x05f1('0x18'))['db'];var integrations=require(_0x05f1('0x19'));function respondWithStatusCode(_0x484d06,_0x2c7f2c){_0x2c7f2c=_0x2c7f2c||0xcc;return function(_0x3a3d72){if(_0x3a3d72){return _0x484d06[_0x05f1('0x1a')](_0x2c7f2c);}return _0x484d06[_0x05f1('0x1b')](_0x2c7f2c)[_0x05f1('0x1c')]();};}function respondWithResult(_0x3d60ce,_0xc2fc18){_0xc2fc18=_0xc2fc18||0xc8;return function(_0x310104){if(_0x310104){return _0x3d60ce[_0x05f1('0x1b')](_0xc2fc18)[_0x05f1('0x1d')](_0x310104);}};}function respondWithFilteredResult(_0x4b3f74,_0x408b7b){return function(_0x1b11c2){if(_0x1b11c2){var _0x247dd5=typeof _0x408b7b['offset']===_0x05f1('0x1e')&&typeof _0x408b7b['limit']===_0x05f1('0x1e');var _0x5b996a=_0x1b11c2[_0x05f1('0x1f')];var _0x30645a=_0x247dd5?0x0:_0x408b7b[_0x05f1('0x20')];var _0x426998=_0x247dd5?_0x1b11c2[_0x05f1('0x1f')]:_0x408b7b['offset']+_0x408b7b[_0x05f1('0x21')];var _0x2ded14;if(_0x426998>=_0x5b996a){_0x426998=_0x5b996a;_0x2ded14=0xc8;}else{_0x2ded14=0xce;}_0x4b3f74['status'](_0x2ded14);return _0x4b3f74[_0x05f1('0x22')](_0x05f1('0x23'),_0x30645a+'-'+_0x426998+'/'+_0x5b996a)[_0x05f1('0x1d')](_0x1b11c2);}return null;};}function patchUpdates(_0x215f92){return function(_0x4d57a7){try{jsonpatch[_0x05f1('0x24')](_0x4d57a7,_0x215f92,!![]);}catch(_0x3c6ac2){return BPromise[_0x05f1('0x25')](_0x3c6ac2);}return _0x4d57a7[_0x05f1('0x26')]();};}function saveUpdates(_0x114631,_0x19f9e6){return function(_0x427d89){if(_0x427d89){return _0x427d89['update'](_0x114631)[_0x05f1('0x27')](function(_0x1a6ab3){return _0x1a6ab3;});}return null;};}function removeEntity(_0x171bb5,_0x4fb840){return function(_0x4d5900){if(_0x4d5900){return _0x4d5900[_0x05f1('0x28')]()[_0x05f1('0x27')](function(){_0x171bb5[_0x05f1('0x1b')](0xcc)[_0x05f1('0x1c')]();});}};}function handleEntityNotFound(_0x9def9c,_0x55c208){return function(_0x57770e){if(!_0x57770e){_0x9def9c[_0x05f1('0x1a')](0x194);}return _0x57770e;};}function handleError(_0x53d9ca,_0x1ac238){_0x1ac238=_0x1ac238||0x1f4;return function(_0x15a22f){logger[_0x05f1('0x29')](_0x15a22f[_0x05f1('0x2a')]);if(_0x15a22f['name']){delete _0x15a22f[_0x05f1('0x2b')];}_0x53d9ca['status'](_0x1ac238)[_0x05f1('0x2c')](_0x15a22f);};}exports['index']=function(_0x2afe18,_0x563ac3){var _0x1f02e3={},_0xb48da2={},_0xd2d491={'count':0x0,'rows':[]};var _0x3f9551=_[_0x05f1('0x2d')](db[_0x05f1('0x2e')]['rawAttributes'],function(_0x3b1e49){return{'name':_0x3b1e49['fieldName'],'type':_0x3b1e49['type'][_0x05f1('0x2f')]};});_0xb48da2[_0x05f1('0x30')]=_[_0x05f1('0x2d')](_0x3f9551,_0x05f1('0x2b'));_0xb48da2[_0x05f1('0x31')]=_[_0x05f1('0x32')](_0x2afe18[_0x05f1('0x31')]);_0xb48da2['filters']=_[_0x05f1('0x33')](_0xb48da2[_0x05f1('0x30')],_0xb48da2['query']);_0x1f02e3[_0x05f1('0x34')]=_[_0x05f1('0x33')](_0xb48da2[_0x05f1('0x30')],qs[_0x05f1('0x35')](_0x2afe18[_0x05f1('0x31')][_0x05f1('0x35')]));_0x1f02e3[_0x05f1('0x34')]=_0x1f02e3[_0x05f1('0x34')][_0x05f1('0x36')]?_0x1f02e3[_0x05f1('0x34')]:_0xb48da2[_0x05f1('0x30')];if(!_0x2afe18[_0x05f1('0x31')][_0x05f1('0x37')](_0x05f1('0x38'))){_0x1f02e3['limit']=qs['limit'](_0x2afe18[_0x05f1('0x31')][_0x05f1('0x21')]);_0x1f02e3[_0x05f1('0x20')]=qs[_0x05f1('0x20')](_0x2afe18['query'][_0x05f1('0x20')]);}_0x1f02e3['order']=qs['sort'](_0x2afe18[_0x05f1('0x31')][_0x05f1('0x39')]);_0x1f02e3[_0x05f1('0x3a')]=qs['filters'](_[_0x05f1('0x3b')](_0x2afe18[_0x05f1('0x31')],_0xb48da2['filters']),_0x3f9551);if(_0x2afe18[_0x05f1('0x31')][_0x05f1('0x3c')]){_0x1f02e3['where']=_[_0x05f1('0x3d')](_0x1f02e3[_0x05f1('0x3a')],{'$or':_['map'](_0x3f9551,function(_0x29a0f3){if(_0x29a0f3[_0x05f1('0x3e')]!=='VIRTUAL'){var _0x3124ce={};_0x3124ce[_0x29a0f3[_0x05f1('0x2b')]]={'$like':'%'+_0x2afe18[_0x05f1('0x31')][_0x05f1('0x3c')]+'%'};return _0x3124ce;}})});}_0x1f02e3=_['merge']({},_0x1f02e3,_0x2afe18[_0x05f1('0x3f')]);var _0x42a60b={'where':_0x1f02e3[_0x05f1('0x3a')]};return db[_0x05f1('0x2e')][_0x05f1('0x1f')](_0x42a60b)[_0x05f1('0x27')](function(_0x53b205){_0xd2d491[_0x05f1('0x1f')]=_0x53b205;if(_0x2afe18[_0x05f1('0x31')]['includeAll']){_0x1f02e3['include']=[{'all':!![]}];}return db[_0x05f1('0x2e')][_0x05f1('0x40')](_0x1f02e3);})[_0x05f1('0x27')](function(_0x1fdb10){_0xd2d491[_0x05f1('0x41')]=_0x1fdb10;return _0xd2d491;})[_0x05f1('0x27')](respondWithFilteredResult(_0x563ac3,_0x1f02e3))[_0x05f1('0x42')](handleError(_0x563ac3,null));};exports[_0x05f1('0x43')]=function(_0x4c0bf6,_0x5a1c34){var _0x587d14={'raw':![],'where':{'id':_0x4c0bf6[_0x05f1('0x44')]['id']}},_0x298127={};_0x298127[_0x05f1('0x30')]=_[_0x05f1('0x32')](db[_0x05f1('0x2e')]['rawAttributes']);_0x298127[_0x05f1('0x31')]=_[_0x05f1('0x32')](_0x4c0bf6[_0x05f1('0x31')]);_0x298127[_0x05f1('0x45')]=_[_0x05f1('0x33')](_0x298127['model'],_0x298127['query']);_0x587d14['attributes']=_[_0x05f1('0x33')](_0x298127[_0x05f1('0x30')],qs[_0x05f1('0x35')](_0x4c0bf6['query']['fields']));_0x587d14[_0x05f1('0x34')]=_0x587d14['attributes'][_0x05f1('0x36')]?_0x587d14[_0x05f1('0x34')]:_0x298127[_0x05f1('0x30')];if(_0x4c0bf6['query'][_0x05f1('0x46')]){_0x587d14[_0x05f1('0x47')]=[{'all':!![]}];}_0x587d14=_[_0x05f1('0x3d')]({},_0x587d14,_0x4c0bf6[_0x05f1('0x3f')]);return db[_0x05f1('0x2e')][_0x05f1('0x48')](_0x587d14)[_0x05f1('0x27')](handleEntityNotFound(_0x5a1c34,null))[_0x05f1('0x27')](respondWithResult(_0x5a1c34,null))[_0x05f1('0x42')](handleError(_0x5a1c34,null));};exports[_0x05f1('0x49')]=function(_0x1469a8,_0x2a1077){return db[_0x05f1('0x2e')][_0x05f1('0x49')](_0x1469a8['body'],{})['then'](respondWithResult(_0x2a1077,0xc9))[_0x05f1('0x42')](handleError(_0x2a1077,null));};exports[_0x05f1('0x4a')]=function(_0x421ce7,_0x38338b){if(_0x421ce7[_0x05f1('0x4b')]['id']){delete _0x421ce7[_0x05f1('0x4b')]['id'];}return db['DeskAccount'][_0x05f1('0x48')]({'where':{'id':_0x421ce7[_0x05f1('0x44')]['id']}})[_0x05f1('0x27')](handleEntityNotFound(_0x38338b,null))['then'](saveUpdates(_0x421ce7[_0x05f1('0x4b')],null))[_0x05f1('0x27')](respondWithResult(_0x38338b,null))['catch'](handleError(_0x38338b,null));};exports[_0x05f1('0x28')]=function(_0x5a13f5,_0x5c50e8){return db[_0x05f1('0x2e')][_0x05f1('0x48')]({'where':{'id':_0x5a13f5[_0x05f1('0x44')]['id']}})['then'](handleEntityNotFound(_0x5c50e8,null))[_0x05f1('0x27')](removeEntity(_0x5c50e8,null))[_0x05f1('0x42')](handleError(_0x5c50e8,null));};exports[_0x05f1('0x4c')]=function(_0x31531c,_0x4beecc,_0xb5e804){var _0x11f6f8={};var _0x4f343d={};var _0x29b4b9;var _0x44e994;return db['DeskAccount']['findOne']({'where':{'id':_0x31531c['params']['id']}})[_0x05f1('0x27')](handleEntityNotFound(_0x4beecc,null))['then'](function(_0x264cd7){if(_0x264cd7){_0x29b4b9=_0x264cd7;_0x4f343d['model']=_[_0x05f1('0x32')](db[_0x05f1('0x4d')]['rawAttributes']);_0x4f343d[_0x05f1('0x31')]=_['keys'](_0x31531c[_0x05f1('0x31')]);_0x4f343d[_0x05f1('0x45')]=_[_0x05f1('0x33')](_0x4f343d[_0x05f1('0x30')],_0x4f343d['query']);_0x11f6f8[_0x05f1('0x34')]=_['intersection'](_0x4f343d['model'],qs['fields'](_0x31531c['query'][_0x05f1('0x35')]));_0x11f6f8['attributes']=_0x11f6f8[_0x05f1('0x34')][_0x05f1('0x36')]?_0x11f6f8[_0x05f1('0x34')]:_0x4f343d[_0x05f1('0x30')];_0x11f6f8[_0x05f1('0x4e')]=qs['sort'](_0x31531c['query'][_0x05f1('0x39')]);_0x11f6f8[_0x05f1('0x3a')]=qs[_0x05f1('0x45')](_['pick'](_0x31531c['query'],_0x4f343d[_0x05f1('0x45')]));if(_0x31531c[_0x05f1('0x31')]['filter']){_0x11f6f8[_0x05f1('0x3a')]=_['merge'](_0x11f6f8[_0x05f1('0x3a')],{'$or':_['map'](_0x11f6f8['attributes'],function(_0x2e3e6d){var _0x1086e0={};_0x1086e0[_0x2e3e6d]={'$like':'%'+_0x31531c[_0x05f1('0x31')][_0x05f1('0x3c')]+'%'};return _0x1086e0;})});}_0x11f6f8=_['merge']({},_0x11f6f8,_0x31531c[_0x05f1('0x3f')]);return _0x29b4b9['getConfigurations'](_0x11f6f8);}})['then'](function(_0x3a8b92){if(_0x3a8b92){_0x44e994=_0x3a8b92[_0x05f1('0x36')];if(!_0x31531c[_0x05f1('0x31')][_0x05f1('0x37')](_0x05f1('0x38'))){_0x11f6f8[_0x05f1('0x21')]=qs[_0x05f1('0x21')](_0x31531c['query']['limit']);_0x11f6f8[_0x05f1('0x20')]=qs[_0x05f1('0x20')](_0x31531c[_0x05f1('0x31')][_0x05f1('0x20')]);}return _0x29b4b9[_0x05f1('0x4c')](_0x11f6f8);}})['then'](function(_0x36e98a){if(_0x36e98a){return _0x36e98a?{'count':_0x44e994,'rows':_0x36e98a}:null;}})[_0x05f1('0x27')](respondWithResult(_0x4beecc,null))[_0x05f1('0x42')](handleError(_0x4beecc,null));};exports[_0x05f1('0x4f')]=function(_0x2bbd3f,_0x7fecf4,_0x2c68e1){if(_0x2bbd3f['body']['id']){delete _0x2bbd3f[_0x05f1('0x4b')]['id'];}return db[_0x05f1('0x2e')][_0x05f1('0x50')]({'where':{'id':_0x2bbd3f[_0x05f1('0x44')]['id']}})[_0x05f1('0x27')](handleEntityNotFound(_0x7fecf4,null))[_0x05f1('0x27')](function(_0x19c4cd){if(_0x19c4cd){_0x2bbd3f['body']['AccountId']=_0x19c4cd['id'];_0x2bbd3f[_0x05f1('0x4b')][_0x05f1('0x51')]=integrations['getSubjects'](_0x2bbd3f[_0x05f1('0x4b')]['channel'],_0x2bbd3f[_0x05f1('0x4b')][_0x05f1('0x3e')]);_0x2bbd3f['body']['Descriptions']=integrations[_0x05f1('0x52')](_0x2bbd3f[_0x05f1('0x4b')][_0x05f1('0x53')],_0x2bbd3f[_0x05f1('0x4b')][_0x05f1('0x3e')]);return db[_0x05f1('0x4d')]['create'](_0x2bbd3f[_0x05f1('0x4b')],{'include':[{'model':db[_0x05f1('0x54')],'as':_0x05f1('0x51')},{'model':db['DeskField'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x7fecf4,null))['catch'](handleError(_0x7fecf4,null));};exports['getFields']=function(_0x744447,_0x556e08,_0x118ff1){var _0xe14e95=[{'name':_0x05f1('0x55'),'label':_0x05f1('0x55'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x5e8c06='';return db['DeskAccount'][_0x05f1('0x50')]({'where':{'id':_0x744447['params']['id']},'attributes':['id','remoteUri',_0x05f1('0x56'),_0x05f1('0x57'),_0x05f1('0x58'),_0x05f1('0x59'),_0x05f1('0x5a'),'token',_0x05f1('0x5b')]})[_0x05f1('0x27')](handleEntityNotFound(_0x556e08,null))[_0x05f1('0x27')](function(_0x3bb75f){if(_0x3bb75f){_0x5e8c06=_0x3bb75f[_0x05f1('0x5c')];var _0x4abe7f=_0x5e8c06['slice'](-0x1);if(_0x4abe7f==='/'){_0x5e8c06=_0x5e8c06[_0x05f1('0x5d')](0x0,_0x5e8c06[_0x05f1('0x5e')](_0x4abe7f));}var _0x1b7d42={'method':_0x05f1('0x5f'),'uri':util[_0x05f1('0x60')](_0x05f1('0x61'),_0x5e8c06),'headers':{'Content-Type':'application/json','Accept':'application/json'},'json':!![]};if(_0x3bb75f[_0x05f1('0x56')]===_0x05f1('0x62')){_0x1b7d42[_0x05f1('0x63')][_0x05f1('0x64')]=util[_0x05f1('0x60')](_0x05f1('0x65'),new Buffer(util[_0x05f1('0x60')](_0x05f1('0x66'),_0x3bb75f[_0x05f1('0x57')],_0x3bb75f[_0x05f1('0x58')]))[_0x05f1('0x67')](_0x05f1('0x68')));}return rp(_0x1b7d42)[_0x05f1('0x27')](function(_0x48f81a){return _0xe14e95[_0x05f1('0x69')](_['map'](_0x48f81a['_embedded'][_0x05f1('0x6a')],function(_0xb6e9a0){return{'id':_0xb6e9a0[_0x05f1('0x2b')],'name':_0xb6e9a0['name'],'type':_0xb6e9a0['type'],'active':_0xb6e9a0[_0x05f1('0x6b')],'label':_0xb6e9a0[_0x05f1('0x6c')],'custom':!![]};}));});}})[_0x05f1('0x27')](function(_0x134768){return{'count':_0x134768[_0x05f1('0x36')],'rows':_0x134768};})[_0x05f1('0x27')](respondWithResult(_0x556e08,null))[_0x05f1('0x42')](function(_0x13fd85){var _0x4a5b07=_0x744447['query'][_0x05f1('0x6d')]?0x1f4:_0x13fd85[_0x05f1('0x6e')]||0x1f4;logger['error'](_0x05f1('0x6f'),_0x05f1('0x70'),_0x4a5b07,JSON[_0x05f1('0x71')](_0x13fd85));delete _0x13fd85['name'];if(_0x4a5b07===0x191){_0x4a5b07=0x190;}_0x556e08[_0x05f1('0x1b')](_0x4a5b07)[_0x05f1('0x2c')](_0x744447[_0x05f1('0x31')]['test']?{'message':_0x05f1('0x72'),'statusCode':_0x13fd85[_0x05f1('0x6e')]}:_0x13fd85);});}; \ No newline at end of file +var _0xcd02=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','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','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','update','then','destroy','error','name','index','map','DeskAccount','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','count','include','findAll','catch','show','params','includeAll','find','create','body','getConfigurations','pick','merge','options','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','DeskConfiguration','DeskField','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','token','tokenSecret','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','headers','Basic\x20%s','%s:%s','base64','concat','_embedded','entries','active','label','test','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials'];(function(_0x15a633,_0x308b5a){var _0x36d2f7=function(_0x2eb4e4){while(--_0x2eb4e4){_0x15a633['push'](_0x15a633['shift']());}};_0x36d2f7(++_0x308b5a);}(_0xcd02,0x71));var _0x2cd0=function(_0x50c492,_0x5c1e67){_0x50c492=_0x50c492-0x0;var _0x3505a8=_0xcd02[_0x50c492];return _0x3505a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2cd0('0x0'));var zipdir=require(_0x2cd0('0x1'));var jsonpatch=require(_0x2cd0('0x2'));var rp=require(_0x2cd0('0x3'));var moment=require(_0x2cd0('0x4'));var BPromise=require(_0x2cd0('0x5'));var Mustache=require(_0x2cd0('0x6'));var util=require('util');var path=require(_0x2cd0('0x7'));var sox=require(_0x2cd0('0x8'));var csv=require(_0x2cd0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2cd0('0xa'));var _=require(_0x2cd0('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2cd0('0x9'));var querystring=require(_0x2cd0('0xc'));var Papa=require(_0x2cd0('0xd'));var Redis=require('ioredis');var authService=require(_0x2cd0('0xe'));var qs=require(_0x2cd0('0xf'));var as=require(_0x2cd0('0x10'));var hardwareService=require(_0x2cd0('0x11'));var logger=require(_0x2cd0('0x12'))(_0x2cd0('0x13'));var utils=require(_0x2cd0('0x14'));var config=require(_0x2cd0('0x15'));var licenseUtil=require(_0x2cd0('0x16'));var db=require(_0x2cd0('0x17'))['db'];var integrations=require(_0x2cd0('0x18'));function respondWithStatusCode(_0x18ac41,_0x1b5fd3){_0x1b5fd3=_0x1b5fd3||0xcc;return function(_0x2d6a76){if(_0x2d6a76){return _0x18ac41[_0x2cd0('0x19')](_0x1b5fd3);}return _0x18ac41[_0x2cd0('0x1a')](_0x1b5fd3)[_0x2cd0('0x1b')]();};}function respondWithResult(_0x2b5cc4,_0x44062e){_0x44062e=_0x44062e||0xc8;return function(_0x3b6e1d){if(_0x3b6e1d){return _0x2b5cc4[_0x2cd0('0x1a')](_0x44062e)[_0x2cd0('0x1c')](_0x3b6e1d);}};}function respondWithFilteredResult(_0x4ef16e,_0x171174){return function(_0x353476){if(_0x353476){var _0x55be2e=typeof _0x171174[_0x2cd0('0x1d')]===_0x2cd0('0x1e')&&typeof _0x171174[_0x2cd0('0x1f')]===_0x2cd0('0x1e');var _0x105537=_0x353476['count'];var _0x1d50b4=_0x55be2e?0x0:_0x171174['offset'];var _0x5bc340=_0x55be2e?_0x353476['count']:_0x171174[_0x2cd0('0x1d')]+_0x171174[_0x2cd0('0x1f')];var _0x438683;if(_0x5bc340>=_0x105537){_0x5bc340=_0x105537;_0x438683=0xc8;}else{_0x438683=0xce;}_0x4ef16e[_0x2cd0('0x1a')](_0x438683);return _0x4ef16e[_0x2cd0('0x20')](_0x2cd0('0x21'),_0x1d50b4+'-'+_0x5bc340+'/'+_0x105537)['json'](_0x353476);}return null;};}function patchUpdates(_0x593cde){return function(_0x31fd5a){try{jsonpatch['apply'](_0x31fd5a,_0x593cde,!![]);}catch(_0x3a1b78){return BPromise['reject'](_0x3a1b78);}return _0x31fd5a['save']();};}function saveUpdates(_0x518823,_0x4a5d66){return function(_0x200b32){if(_0x200b32){return _0x200b32[_0x2cd0('0x22')](_0x518823)[_0x2cd0('0x23')](function(_0x2d5049){return _0x2d5049;});}return null;};}function removeEntity(_0x440377,_0x512728){return function(_0x2a86e4){if(_0x2a86e4){return _0x2a86e4[_0x2cd0('0x24')]()[_0x2cd0('0x23')](function(){_0x440377[_0x2cd0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a8d01,_0x3b1b1e){return function(_0x41a29b){if(!_0x41a29b){_0x4a8d01[_0x2cd0('0x19')](0x194);}return _0x41a29b;};}function handleError(_0x2aecac,_0x49076a){_0x49076a=_0x49076a||0x1f4;return function(_0x218bee){logger[_0x2cd0('0x25')](_0x218bee['stack']);if(_0x218bee[_0x2cd0('0x26')]){delete _0x218bee[_0x2cd0('0x26')];}_0x2aecac[_0x2cd0('0x1a')](_0x49076a)['send'](_0x218bee);};}exports[_0x2cd0('0x27')]=function(_0x286d63,_0x1d889b){var _0x3d8a13={},_0x4c6f27={},_0x3a36dd={'count':0x0,'rows':[]};var _0x5c3cb2=_[_0x2cd0('0x28')](db[_0x2cd0('0x29')][_0x2cd0('0x2a')],function(_0x4e507e){return{'name':_0x4e507e[_0x2cd0('0x2b')],'type':_0x4e507e[_0x2cd0('0x2c')][_0x2cd0('0x2d')]};});_0x4c6f27[_0x2cd0('0x2e')]=_['map'](_0x5c3cb2,_0x2cd0('0x26'));_0x4c6f27['query']=_[_0x2cd0('0x2f')](_0x286d63['query']);_0x4c6f27[_0x2cd0('0x30')]=_[_0x2cd0('0x31')](_0x4c6f27[_0x2cd0('0x2e')],_0x4c6f27[_0x2cd0('0x32')]);_0x3d8a13[_0x2cd0('0x33')]=_['intersection'](_0x4c6f27[_0x2cd0('0x2e')],qs[_0x2cd0('0x34')](_0x286d63[_0x2cd0('0x32')][_0x2cd0('0x34')]));_0x3d8a13[_0x2cd0('0x33')]=_0x3d8a13[_0x2cd0('0x33')][_0x2cd0('0x35')]?_0x3d8a13['attributes']:_0x4c6f27[_0x2cd0('0x2e')];if(!_0x286d63['query'][_0x2cd0('0x36')](_0x2cd0('0x37'))){_0x3d8a13[_0x2cd0('0x1f')]=qs[_0x2cd0('0x1f')](_0x286d63[_0x2cd0('0x32')]['limit']);_0x3d8a13[_0x2cd0('0x1d')]=qs[_0x2cd0('0x1d')](_0x286d63['query'][_0x2cd0('0x1d')]);}_0x3d8a13[_0x2cd0('0x38')]=qs[_0x2cd0('0x39')](_0x286d63['query'][_0x2cd0('0x39')]);_0x3d8a13[_0x2cd0('0x3a')]=qs['filters'](_['pick'](_0x286d63['query'],_0x4c6f27[_0x2cd0('0x30')]),_0x5c3cb2);if(_0x286d63[_0x2cd0('0x32')][_0x2cd0('0x3b')]){_0x3d8a13[_0x2cd0('0x3a')]=_['merge'](_0x3d8a13['where'],{'$or':_[_0x2cd0('0x28')](_0x5c3cb2,function(_0x1aa1d1){if(_0x1aa1d1['type']!=='VIRTUAL'){var _0x5d1625={};_0x5d1625[_0x1aa1d1['name']]={'$like':'%'+_0x286d63[_0x2cd0('0x32')]['filter']+'%'};return _0x5d1625;}})});}_0x3d8a13=_['merge']({},_0x3d8a13,_0x286d63['options']);var _0x336980={'where':_0x3d8a13['where']};return db[_0x2cd0('0x29')][_0x2cd0('0x3c')](_0x336980)[_0x2cd0('0x23')](function(_0x2908c8){_0x3a36dd['count']=_0x2908c8;if(_0x286d63[_0x2cd0('0x32')]['includeAll']){_0x3d8a13[_0x2cd0('0x3d')]=[{'all':!![]}];}return db['DeskAccount'][_0x2cd0('0x3e')](_0x3d8a13);})[_0x2cd0('0x23')](function(_0x1f79fe){_0x3a36dd['rows']=_0x1f79fe;return _0x3a36dd;})['then'](respondWithFilteredResult(_0x1d889b,_0x3d8a13))[_0x2cd0('0x3f')](handleError(_0x1d889b,null));};exports[_0x2cd0('0x40')]=function(_0x33469c,_0x58ef4c){var _0xa662bb={'raw':![],'where':{'id':_0x33469c[_0x2cd0('0x41')]['id']}},_0x256276={};_0x256276['model']=_[_0x2cd0('0x2f')](db['DeskAccount'][_0x2cd0('0x2a')]);_0x256276[_0x2cd0('0x32')]=_[_0x2cd0('0x2f')](_0x33469c[_0x2cd0('0x32')]);_0x256276[_0x2cd0('0x30')]=_['intersection'](_0x256276[_0x2cd0('0x2e')],_0x256276[_0x2cd0('0x32')]);_0xa662bb[_0x2cd0('0x33')]=_[_0x2cd0('0x31')](_0x256276[_0x2cd0('0x2e')],qs['fields'](_0x33469c[_0x2cd0('0x32')][_0x2cd0('0x34')]));_0xa662bb[_0x2cd0('0x33')]=_0xa662bb[_0x2cd0('0x33')][_0x2cd0('0x35')]?_0xa662bb[_0x2cd0('0x33')]:_0x256276[_0x2cd0('0x2e')];if(_0x33469c[_0x2cd0('0x32')][_0x2cd0('0x42')]){_0xa662bb['include']=[{'all':!![]}];}_0xa662bb=_['merge']({},_0xa662bb,_0x33469c['options']);return db[_0x2cd0('0x29')][_0x2cd0('0x43')](_0xa662bb)[_0x2cd0('0x23')](handleEntityNotFound(_0x58ef4c,null))[_0x2cd0('0x23')](respondWithResult(_0x58ef4c,null))[_0x2cd0('0x3f')](handleError(_0x58ef4c,null));};exports[_0x2cd0('0x44')]=function(_0x20f4f8,_0x327c50){return db[_0x2cd0('0x29')][_0x2cd0('0x44')](_0x20f4f8[_0x2cd0('0x45')],{})[_0x2cd0('0x23')](respondWithResult(_0x327c50,0xc9))[_0x2cd0('0x3f')](handleError(_0x327c50,null));};exports['update']=function(_0x3541e1,_0x5ab28e){if(_0x3541e1[_0x2cd0('0x45')]['id']){delete _0x3541e1['body']['id'];}return db[_0x2cd0('0x29')][_0x2cd0('0x43')]({'where':{'id':_0x3541e1['params']['id']}})[_0x2cd0('0x23')](handleEntityNotFound(_0x5ab28e,null))[_0x2cd0('0x23')](saveUpdates(_0x3541e1[_0x2cd0('0x45')],null))['then'](respondWithResult(_0x5ab28e,null))[_0x2cd0('0x3f')](handleError(_0x5ab28e,null));};exports[_0x2cd0('0x24')]=function(_0x24f90f,_0x32eba5){return db[_0x2cd0('0x29')]['find']({'where':{'id':_0x24f90f[_0x2cd0('0x41')]['id']}})[_0x2cd0('0x23')](handleEntityNotFound(_0x32eba5,null))['then'](removeEntity(_0x32eba5,null))[_0x2cd0('0x3f')](handleError(_0x32eba5,null));};exports[_0x2cd0('0x46')]=function(_0x4a3d5a,_0x3a2292,_0x92d4af){var _0x262a51={};var _0x20e5b4={};var _0x6f8eaa;var _0x3a8f47;return db[_0x2cd0('0x29')]['findOne']({'where':{'id':_0x4a3d5a['params']['id']}})['then'](handleEntityNotFound(_0x3a2292,null))[_0x2cd0('0x23')](function(_0x556cbf){if(_0x556cbf){_0x6f8eaa=_0x556cbf;_0x20e5b4[_0x2cd0('0x2e')]=_[_0x2cd0('0x2f')](db['DeskConfiguration']['rawAttributes']);_0x20e5b4['query']=_[_0x2cd0('0x2f')](_0x4a3d5a['query']);_0x20e5b4[_0x2cd0('0x30')]=_[_0x2cd0('0x31')](_0x20e5b4[_0x2cd0('0x2e')],_0x20e5b4['query']);_0x262a51['attributes']=_[_0x2cd0('0x31')](_0x20e5b4['model'],qs['fields'](_0x4a3d5a[_0x2cd0('0x32')][_0x2cd0('0x34')]));_0x262a51[_0x2cd0('0x33')]=_0x262a51[_0x2cd0('0x33')][_0x2cd0('0x35')]?_0x262a51[_0x2cd0('0x33')]:_0x20e5b4[_0x2cd0('0x2e')];_0x262a51['order']=qs[_0x2cd0('0x39')](_0x4a3d5a[_0x2cd0('0x32')][_0x2cd0('0x39')]);_0x262a51[_0x2cd0('0x3a')]=qs['filters'](_[_0x2cd0('0x47')](_0x4a3d5a[_0x2cd0('0x32')],_0x20e5b4[_0x2cd0('0x30')]));if(_0x4a3d5a[_0x2cd0('0x32')][_0x2cd0('0x3b')]){_0x262a51[_0x2cd0('0x3a')]=_[_0x2cd0('0x48')](_0x262a51[_0x2cd0('0x3a')],{'$or':_[_0x2cd0('0x28')](_0x262a51[_0x2cd0('0x33')],function(_0x1beb92){var _0x7d85ed={};_0x7d85ed[_0x1beb92]={'$like':'%'+_0x4a3d5a[_0x2cd0('0x32')][_0x2cd0('0x3b')]+'%'};return _0x7d85ed;})});}_0x262a51=_[_0x2cd0('0x48')]({},_0x262a51,_0x4a3d5a[_0x2cd0('0x49')]);return _0x6f8eaa[_0x2cd0('0x46')](_0x262a51);}})[_0x2cd0('0x23')](function(_0xcfb6d8){if(_0xcfb6d8){_0x3a8f47=_0xcfb6d8['length'];if(!_0x4a3d5a[_0x2cd0('0x32')][_0x2cd0('0x36')](_0x2cd0('0x37'))){_0x262a51[_0x2cd0('0x1f')]=qs[_0x2cd0('0x1f')](_0x4a3d5a[_0x2cd0('0x32')][_0x2cd0('0x1f')]);_0x262a51[_0x2cd0('0x1d')]=qs[_0x2cd0('0x1d')](_0x4a3d5a[_0x2cd0('0x32')][_0x2cd0('0x1d')]);}return _0x6f8eaa[_0x2cd0('0x46')](_0x262a51);}})[_0x2cd0('0x23')](function(_0x48633a){if(_0x48633a){return _0x48633a?{'count':_0x3a8f47,'rows':_0x48633a}:null;}})[_0x2cd0('0x23')](respondWithResult(_0x3a2292,null))[_0x2cd0('0x3f')](handleError(_0x3a2292,null));};exports[_0x2cd0('0x4a')]=function(_0x3b108a,_0x24a7b5,_0x136154){if(_0x3b108a['body']['id']){delete _0x3b108a[_0x2cd0('0x45')]['id'];}return db['DeskAccount'][_0x2cd0('0x4b')]({'where':{'id':_0x3b108a['params']['id']}})[_0x2cd0('0x23')](handleEntityNotFound(_0x24a7b5,null))[_0x2cd0('0x23')](function(_0x2f7023){if(_0x2f7023){_0x3b108a['body'][_0x2cd0('0x4c')]=_0x2f7023['id'];_0x3b108a[_0x2cd0('0x45')][_0x2cd0('0x4d')]=integrations[_0x2cd0('0x4e')](_0x3b108a[_0x2cd0('0x45')][_0x2cd0('0x4f')],_0x3b108a[_0x2cd0('0x45')][_0x2cd0('0x2c')]);_0x3b108a[_0x2cd0('0x45')][_0x2cd0('0x50')]=integrations['getDescriptions'](_0x3b108a[_0x2cd0('0x45')]['channel'],_0x3b108a[_0x2cd0('0x45')]['type']);return db[_0x2cd0('0x51')]['create'](_0x3b108a['body'],{'include':[{'model':db[_0x2cd0('0x52')],'as':_0x2cd0('0x4d')},{'model':db[_0x2cd0('0x52')],'as':_0x2cd0('0x50')}]});}return null;})[_0x2cd0('0x23')](respondWithResult(_0x24a7b5,null))[_0x2cd0('0x3f')](handleError(_0x24a7b5,null));};exports['getFields']=function(_0xb2d79a,_0x5713b5,_0x3a4d42){var _0xda39e1=[{'name':'priority','label':_0x2cd0('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 _0x2a337a='';return db['DeskAccount']['findOne']({'where':{'id':_0xb2d79a[_0x2cd0('0x41')]['id']},'attributes':['id',_0x2cd0('0x54'),_0x2cd0('0x55'),_0x2cd0('0x56'),_0x2cd0('0x57'),_0x2cd0('0x58'),_0x2cd0('0x59'),_0x2cd0('0x5a'),_0x2cd0('0x5b')]})[_0x2cd0('0x23')](handleEntityNotFound(_0x5713b5,null))[_0x2cd0('0x23')](function(_0x3b9646){if(_0x3b9646){_0x2a337a=_0x3b9646[_0x2cd0('0x54')];var _0x198101=_0x2a337a[_0x2cd0('0x5c')](-0x1);if(_0x198101==='/'){_0x2a337a=_0x2a337a[_0x2cd0('0x5d')](0x0,_0x2a337a[_0x2cd0('0x5e')](_0x198101));}var _0x51d68d={'method':_0x2cd0('0x5f'),'uri':util[_0x2cd0('0x60')](_0x2cd0('0x61'),_0x2a337a),'headers':{'Content-Type':'application/json','Accept':_0x2cd0('0x62')},'json':!![]};if(_0x3b9646['authType']===_0x2cd0('0x63')){_0x51d68d[_0x2cd0('0x64')]['Authorization']=util['format'](_0x2cd0('0x65'),new Buffer(util[_0x2cd0('0x60')](_0x2cd0('0x66'),_0x3b9646[_0x2cd0('0x56')],_0x3b9646[_0x2cd0('0x57')]))['toString'](_0x2cd0('0x67')));}return rp(_0x51d68d)[_0x2cd0('0x23')](function(_0x153f60){return _0xda39e1[_0x2cd0('0x68')](_[_0x2cd0('0x28')](_0x153f60[_0x2cd0('0x69')][_0x2cd0('0x6a')],function(_0x1b960a){return{'id':_0x1b960a[_0x2cd0('0x26')],'name':_0x1b960a[_0x2cd0('0x26')],'type':_0x1b960a['type'],'active':_0x1b960a[_0x2cd0('0x6b')],'label':_0x1b960a[_0x2cd0('0x6c')],'custom':!![]};}));});}})[_0x2cd0('0x23')](function(_0x49dc13){return{'count':_0x49dc13[_0x2cd0('0x35')],'rows':_0x49dc13};})['then'](respondWithResult(_0x5713b5,null))[_0x2cd0('0x3f')](function(_0x398fa1){var _0x9013c7=_0xb2d79a[_0x2cd0('0x32')][_0x2cd0('0x6d')]?0x1f4:_0x398fa1['statusCode']||0x1f4;logger[_0x2cd0('0x25')](_0x2cd0('0x6e'),_0x2cd0('0x6f'),_0x9013c7,JSON['stringify'](_0x398fa1));delete _0x398fa1['name'];if(_0x9013c7===0x191){_0x9013c7=0x190;}_0x5713b5[_0x2cd0('0x1a')](_0x9013c7)['send'](_0xb2d79a[_0x2cd0('0x32')][_0x2cd0('0x6d')]?{'message':_0x2cd0('0x70'),'statusCode':_0x398fa1['statusCode']}:_0x398fa1);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 7cceb3e..25d1cbb 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 _0xb48e=['define','DeskAccount','moment','bluebird','request-promise','rimraf','../../config/environment','./intDeskAccount.attributes','exports'];(function(_0x51da0d,_0xcb16e3){var _0x44f479=function(_0x2fdf1b){while(--_0x2fdf1b){_0x51da0d['push'](_0x51da0d['shift']());}};_0x44f479(++_0xcb16e3);}(_0xb48e,0x9b));var _0xeb48=function(_0x53cb64,_0x2ddeff){_0x53cb64=_0x53cb64-0x0;var _0x5a161a=_0xb48e[_0x53cb64];return _0x5a161a;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xeb48('0x0'));var BPromise=require(_0xeb48('0x1'));var rp=require(_0xeb48('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xeb48('0x3'));var config=require(_0xeb48('0x4'));var attributes=require(_0xeb48('0x5'));var integrations=require('../../components/integrations/configuration');module[_0xeb48('0x6')]=function(_0x2d990f,_0x20bd22){return _0x2d990f[_0xeb48('0x7')](_0xeb48('0x8'),attributes,{'tableName':'int_desk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8e91=['api','moment','bluebird','request-promise','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts','lodash','../../config/logger'];(function(_0x2b10b5,_0x5c1f2e){var _0x545669=function(_0x4208be){while(--_0x4208be){_0x2b10b5['push'](_0x2b10b5['shift']());}};_0x545669(++_0x5c1f2e);}(_0x8e91,0x1c6));var _0x18e9=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0x8e91[_0x5a3cf0];return _0x5a64ee;};'use strict';var _=require(_0x18e9('0x0'));var util=require('util');var logger=require(_0x18e9('0x1'))(_0x18e9('0x2'));var moment=require(_0x18e9('0x3'));var BPromise=require(_0x18e9('0x4'));var rp=require(_0x18e9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x18e9('0x6'));var integrations=require(_0x18e9('0x7'));module[_0x18e9('0x8')]=function(_0x1abfe1,_0x460aff){return _0x1abfe1[_0x18e9('0x9')](_0x18e9('0xa'),attributes,{'tableName':_0x18e9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index 38a2058..290c50d 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 _0xe407=['attributes','limit','include','map','model','GetDeskAccount','catch','ShowDeskAccount','find','stringify','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','debug','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','DeskAccount,\x20%s,\x20%s','message','result','DeskAccount','findAll','options','raw','where'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0xe407,0x1a2));var _0x7e40=function(_0x516206,_0x463e33){_0x516206=_0x516206-0x0;var _0x36eb7b=_0xe407[_0x516206];return _0x36eb7b;};'use strict';var _=require(_0x7e40('0x0'));var util=require('util');var moment=require(_0x7e40('0x1'));var BPromise=require(_0x7e40('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7e40('0x3'))['db'];var utils=require(_0x7e40('0x4'));var logger=require(_0x7e40('0x5'))(_0x7e40('0x6'));var config=require(_0x7e40('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7e40('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x39bde6,_0x4b055e,_0x493101){return new BPromise(function(_0x25982c,_0x1fdf62){return client['request'](_0x39bde6,_0x493101)[_0x7e40('0x9')](function(_0x3bd945){logger[_0x7e40('0xa')]('DeskAccount,\x20%s,\x20%s',_0x4b055e,'request\x20sent');logger[_0x7e40('0xb')](_0x7e40('0xc'),_0x4b055e,_0x7e40('0xd'),JSON['stringify'](_0x3bd945));if(_0x3bd945[_0x7e40('0xe')]){if(_0x3bd945[_0x7e40('0xe')][_0x7e40('0xf')]===0x1f4){logger[_0x7e40('0xe')](_0x7e40('0x10'),_0x4b055e,_0x3bd945[_0x7e40('0xe')]['message']);return _0x1fdf62(_0x3bd945[_0x7e40('0xe')][_0x7e40('0x11')]);}logger[_0x7e40('0xe')](_0x7e40('0x10'),_0x4b055e,_0x3bd945[_0x7e40('0xe')][_0x7e40('0x11')]);return _0x25982c(_0x3bd945[_0x7e40('0xe')][_0x7e40('0x11')]);}else{logger[_0x7e40('0xa')]('DeskAccount,\x20%s,\x20%s',_0x4b055e,_0x7e40('0xd'));_0x25982c(_0x3bd945[_0x7e40('0x12')][_0x7e40('0x11')]);}})['catch'](function(_0x38edbf){logger[_0x7e40('0xe')]('DeskAccount,\x20%s,\x20%s',_0x4b055e,_0x38edbf);_0x1fdf62(_0x38edbf);});});}exports['GetDeskAccount']=function(_0x39c174){var _0x414e90=this;return new Promise(function(_0x412d1a,_0x350dba){return db[_0x7e40('0x13')][_0x7e40('0x14')]({'raw':_0x39c174['options']?_0x39c174[_0x7e40('0x15')][_0x7e40('0x16')]===undefined?!![]:![]:!![],'where':_0x39c174[_0x7e40('0x15')]?_0x39c174[_0x7e40('0x15')][_0x7e40('0x17')]||null:null,'attributes':_0x39c174['options']?_0x39c174[_0x7e40('0x15')][_0x7e40('0x18')]||null:null,'limit':_0x39c174[_0x7e40('0x15')]?_0x39c174[_0x7e40('0x15')][_0x7e40('0x19')]||null:null,'include':_0x39c174['options']?_0x39c174[_0x7e40('0x15')][_0x7e40('0x1a')]?_[_0x7e40('0x1b')](_0x39c174[_0x7e40('0x15')][_0x7e40('0x1a')],function(_0x2b824e){return{'model':db[_0x2b824e[_0x7e40('0x1c')]],'as':_0x2b824e['as'],'attributes':_0x2b824e['attributes'],'include':_0x2b824e[_0x7e40('0x1a')]?_['map'](_0x2b824e['include'],function(_0x51abdb){return{'model':db[_0x51abdb[_0x7e40('0x1c')]],'as':_0x51abdb['as'],'attributes':_0x51abdb['attributes'],'include':_0x51abdb[_0x7e40('0x1a')]?_[_0x7e40('0x1b')](_0x51abdb[_0x7e40('0x1a')],function(_0x49444e){return{'model':db[_0x49444e[_0x7e40('0x1c')]],'as':_0x49444e['as'],'attributes':_0x49444e[_0x7e40('0x18')]};}):[]};}):[]};}):[]:[]})[_0x7e40('0x9')](function(_0x544b41){logger[_0x7e40('0xa')](_0x7e40('0x1d'),_0x39c174);logger['debug']('GetDeskAccount',_0x39c174,JSON['stringify'](_0x544b41));_0x412d1a(_0x544b41);})[_0x7e40('0x1e')](function(_0x34ffd8){logger[_0x7e40('0xe')]('GetDeskAccount',_0x34ffd8[_0x7e40('0x11')],_0x39c174);_0x350dba(_0x414e90[_0x7e40('0xe')](0x1f4,_0x34ffd8[_0x7e40('0x11')]));});});};exports[_0x7e40('0x1f')]=function(_0x187f9e){var _0x1fb77b=this;return new Promise(function(_0x1937a0,_0xca67b1){return db[_0x7e40('0x13')][_0x7e40('0x20')]({'raw':_0x187f9e[_0x7e40('0x15')]?_0x187f9e['options'][_0x7e40('0x16')]===undefined?!![]:![]:!![],'where':_0x187f9e[_0x7e40('0x15')]?_0x187f9e[_0x7e40('0x15')][_0x7e40('0x17')]||null:null,'attributes':_0x187f9e[_0x7e40('0x15')]?_0x187f9e['options']['attributes']||null:null,'include':_0x187f9e[_0x7e40('0x15')]?_0x187f9e['options'][_0x7e40('0x1a')]?_['map'](_0x187f9e[_0x7e40('0x15')][_0x7e40('0x1a')],function(_0x368834){return{'model':db[_0x368834['model']],'as':_0x368834['as'],'attributes':_0x368834[_0x7e40('0x18')],'include':_0x368834[_0x7e40('0x1a')]?_[_0x7e40('0x1b')](_0x368834[_0x7e40('0x1a')],function(_0x53c3a0){return{'model':db[_0x53c3a0[_0x7e40('0x1c')]],'as':_0x53c3a0['as'],'attributes':_0x53c3a0[_0x7e40('0x18')],'include':_0x53c3a0['include']?_[_0x7e40('0x1b')](_0x53c3a0[_0x7e40('0x1a')],function(_0x3a396e){return{'model':db[_0x3a396e['model']],'as':_0x3a396e['as'],'attributes':_0x3a396e[_0x7e40('0x18')]};}):[]};}):[]};}):[]:[]})[_0x7e40('0x9')](function(_0x295fa1){logger[_0x7e40('0xa')](_0x7e40('0x1f'),_0x187f9e);logger[_0x7e40('0xb')](_0x7e40('0x1f'),_0x187f9e,JSON[_0x7e40('0x21')](_0x295fa1));_0x1937a0(_0x295fa1);})[_0x7e40('0x1e')](function(_0x527ffc){logger[_0x7e40('0xe')]('ShowDeskAccount',_0x527ffc[_0x7e40('0x11')],_0x187f9e);_0xca67b1(_0x1fb77b[_0x7e40('0xe')](0x1f4,_0x527ffc[_0x7e40('0x11')]));});});}; \ No newline at end of file +var _0x890e=['error','message','info','result','catch','GetDeskAccount','DeskAccount','options','raw','where','attributes','limit','include','model','map','ShowDeskAccount','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x35f4f6,_0x29131d){var _0x516d9f=function(_0x281f97){while(--_0x281f97){_0x35f4f6['push'](_0x35f4f6['shift']());}};_0x516d9f(++_0x29131d);}(_0x890e,0x79));var _0xe890=function(_0x3d3cea,_0xdd34a5){_0x3d3cea=_0x3d3cea-0x0;var _0x55d895=_0x890e[_0x3d3cea];return _0x55d895;};'use strict';var _=require('lodash');var util=require(_0xe890('0x0'));var moment=require(_0xe890('0x1'));var BPromise=require(_0xe890('0x2'));var rs=require(_0xe890('0x3'));var fs=require('fs');var Redis=require(_0xe890('0x4'));var db=require(_0xe890('0x5'))['db'];var utils=require(_0xe890('0x6'));var logger=require(_0xe890('0x7'))(_0xe890('0x8'));var config=require('../../config/environment');var jayson=require(_0xe890('0x9'));var client=jayson[_0xe890('0xa')][_0xe890('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x386345,_0x18f146,_0x4ac727){return new BPromise(function(_0x350540,_0x706d71){return client[_0xe890('0xc')](_0x386345,_0x4ac727)[_0xe890('0xd')](function(_0x6342c7){logger['info'](_0xe890('0xe'),_0x18f146,_0xe890('0xf'));logger[_0xe890('0x10')](_0xe890('0x11'),_0x18f146,_0xe890('0xf'),JSON[_0xe890('0x12')](_0x6342c7));if(_0x6342c7['error']){if(_0x6342c7[_0xe890('0x13')]['code']===0x1f4){logger[_0xe890('0x13')]('DeskAccount,\x20%s,\x20%s',_0x18f146,_0x6342c7[_0xe890('0x13')][_0xe890('0x14')]);return _0x706d71(_0x6342c7[_0xe890('0x13')]['message']);}logger[_0xe890('0x13')]('DeskAccount,\x20%s,\x20%s',_0x18f146,_0x6342c7[_0xe890('0x13')][_0xe890('0x14')]);return _0x350540(_0x6342c7[_0xe890('0x13')]['message']);}else{logger[_0xe890('0x15')](_0xe890('0xe'),_0x18f146,_0xe890('0xf'));_0x350540(_0x6342c7[_0xe890('0x16')][_0xe890('0x14')]);}})[_0xe890('0x17')](function(_0x286ec3){logger[_0xe890('0x13')](_0xe890('0xe'),_0x18f146,_0x286ec3);_0x706d71(_0x286ec3);});});}exports[_0xe890('0x18')]=function(_0x31d531){var _0x45ad50=this;return new Promise(function(_0x439b94,_0x529e3e){return db[_0xe890('0x19')]['findAll']({'raw':_0x31d531[_0xe890('0x1a')]?_0x31d531[_0xe890('0x1a')][_0xe890('0x1b')]===undefined?!![]:![]:!![],'where':_0x31d531[_0xe890('0x1a')]?_0x31d531['options'][_0xe890('0x1c')]||null:null,'attributes':_0x31d531[_0xe890('0x1a')]?_0x31d531[_0xe890('0x1a')][_0xe890('0x1d')]||null:null,'limit':_0x31d531['options']?_0x31d531[_0xe890('0x1a')][_0xe890('0x1e')]||null:null,'include':_0x31d531['options']?_0x31d531[_0xe890('0x1a')][_0xe890('0x1f')]?_['map'](_0x31d531[_0xe890('0x1a')][_0xe890('0x1f')],function(_0x3c7f15){return{'model':db[_0x3c7f15[_0xe890('0x20')]],'as':_0x3c7f15['as'],'attributes':_0x3c7f15['attributes'],'include':_0x3c7f15[_0xe890('0x1f')]?_[_0xe890('0x21')](_0x3c7f15[_0xe890('0x1f')],function(_0x1fee85){return{'model':db[_0x1fee85[_0xe890('0x20')]],'as':_0x1fee85['as'],'attributes':_0x1fee85[_0xe890('0x1d')],'include':_0x1fee85[_0xe890('0x1f')]?_[_0xe890('0x21')](_0x1fee85[_0xe890('0x1f')],function(_0x180626){return{'model':db[_0x180626[_0xe890('0x20')]],'as':_0x180626['as'],'attributes':_0x180626[_0xe890('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xe890('0xd')](function(_0x3af3c3){logger[_0xe890('0x15')](_0xe890('0x18'),_0x31d531);logger['debug']('GetDeskAccount',_0x31d531,JSON['stringify'](_0x3af3c3));_0x439b94(_0x3af3c3);})[_0xe890('0x17')](function(_0x448efa){logger[_0xe890('0x13')]('GetDeskAccount',_0x448efa['message'],_0x31d531);_0x529e3e(_0x45ad50[_0xe890('0x13')](0x1f4,_0x448efa[_0xe890('0x14')]));});});};exports[_0xe890('0x22')]=function(_0x2f3748){var _0x275ecf=this;return new Promise(function(_0x2acf98,_0x1753e9){return db['DeskAccount']['find']({'raw':_0x2f3748[_0xe890('0x1a')]?_0x2f3748['options']['raw']===undefined?!![]:![]:!![],'where':_0x2f3748['options']?_0x2f3748[_0xe890('0x1a')][_0xe890('0x1c')]||null:null,'attributes':_0x2f3748[_0xe890('0x1a')]?_0x2f3748[_0xe890('0x1a')][_0xe890('0x1d')]||null:null,'include':_0x2f3748[_0xe890('0x1a')]?_0x2f3748[_0xe890('0x1a')][_0xe890('0x1f')]?_['map'](_0x2f3748['options'][_0xe890('0x1f')],function(_0x35c665){return{'model':db[_0x35c665[_0xe890('0x20')]],'as':_0x35c665['as'],'attributes':_0x35c665[_0xe890('0x1d')],'include':_0x35c665[_0xe890('0x1f')]?_['map'](_0x35c665[_0xe890('0x1f')],function(_0x3860e1){return{'model':db[_0x3860e1[_0xe890('0x20')]],'as':_0x3860e1['as'],'attributes':_0x3860e1[_0xe890('0x1d')],'include':_0x3860e1[_0xe890('0x1f')]?_['map'](_0x3860e1['include'],function(_0x30f105){return{'model':db[_0x30f105[_0xe890('0x20')]],'as':_0x30f105['as'],'attributes':_0x30f105['attributes']};}):[]};}):[]};}):[]:[]})[_0xe890('0xd')](function(_0x5907f7){logger[_0xe890('0x15')](_0xe890('0x22'),_0x2f3748);logger[_0xe890('0x10')](_0xe890('0x22'),_0x2f3748,JSON[_0xe890('0x12')](_0x5907f7));_0x2acf98(_0x5907f7);})[_0xe890('0x17')](function(_0x3dbb63){logger[_0xe890('0x13')]('ShowDeskAccount',_0x3dbb63[_0xe890('0x14')],_0x2f3748);_0x1753e9(_0x275ecf['error'](0x1f4,_0x3dbb63[_0xe890('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index a401c8e..62ffe0a 100644 --- a/server/api/intDeskConfiguration/index.js +++ b/server/api/intDeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55ca=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','setTags','put','/:id','update','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service'];(function(_0x1406ae,_0x292395){var _0x23a076=function(_0x5e147a){while(--_0x5e147a){_0x1406ae['push'](_0x1406ae['shift']());}};_0x23a076(++_0x292395);}(_0x55ca,0x126));var _0xa55c=function(_0x101d5b,_0x40cfd){_0x101d5b=_0x101d5b-0x0;var _0x382a50=_0x55ca[_0x101d5b];return _0x382a50;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['getFields']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getTags']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/tags',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router['delete'](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x15')]);module[_0xa55c('0x16')]=router; \ No newline at end of file +var _0x9c44=['destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intDeskConfiguration.controller','isAuthenticated','index','get','/:id','/:id/fields','getFields','getSubjects','/:id/descriptions','/:id/tags','post','setTags','put','update'];(function(_0x334262,_0x116dd4){var _0x5ef780=function(_0x319125){while(--_0x319125){_0x334262['push'](_0x334262['shift']());}};_0x5ef780(++_0x116dd4);}(_0x9c44,0x178));var _0x49c4=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x9c44[_0x1694f5];return _0x5b4321;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['show']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['get']('/:id/subjects',auth[_0x49c4('0x7')](),controller[_0x49c4('0xd')]);router['get'](_0x49c4('0xe'),auth[_0x49c4('0x7')](),controller['getDescriptions']);router['get'](_0x49c4('0xf'),auth[_0x49c4('0x7')](),controller['getTags']);router[_0x49c4('0x10')]('/',auth[_0x49c4('0x7')](),controller['create']);router[_0x49c4('0x10')](_0x49c4('0xf'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x11')]);router[_0x49c4('0x12')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x13')]);router['delete'](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);module[_0x49c4('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 4fc0eb0..0001305 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 _0xb611=['sequelize','exports','STRING'];(function(_0x5339b1,_0x4f7ba8){var _0x34a8be=function(_0x130f87){while(--_0x130f87){_0x5339b1['push'](_0x5339b1['shift']());}};_0x34a8be(++_0x4f7ba8);}(_0xb611,0x192));var _0x1b61=function(_0x3b81eb,_0x175f32){_0x3b81eb=_0x3b81eb-0x0;var _0x149491=_0xb611[_0x3b81eb];return _0x149491;};'use strict';var Sequelize=require(_0x1b61('0x0'));module[_0x1b61('0x1')]={'name':{'type':Sequelize[_0x1b61('0x2')]},'description':{'type':Sequelize[_0x1b61('0x2')]}}; \ No newline at end of file +var _0x2154=['STRING','sequelize'];(function(_0xafdaf4,_0x5bd4d1){var _0x1e70a8=function(_0x33bd10){while(--_0x33bd10){_0xafdaf4['push'](_0xafdaf4['shift']());}};_0x1e70a8(++_0x5bd4d1);}(_0x2154,0x9b));var _0x4215=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0x2154[_0x1c8c28];return _0x1f59b4;};'use strict';var Sequelize=require(_0x4215('0x0'));module['exports']={'name':{'type':Sequelize[_0x4215('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 2831147..35f5072 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 _0x9e24=['merge','include','show','params','includeAll','options','find','create','body','catch','findOne','DeskField','order','getFields','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','apply','save','update','then','destroy','error','stack','name','index','map','DeskConfiguration','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter'];(function(_0x18e0d1,_0xbca4cb){var _0x58db41=function(_0x5ccffd){while(--_0x5ccffd){_0x18e0d1['push'](_0x18e0d1['shift']());}};_0x58db41(++_0xbca4cb);}(_0x9e24,0xb8));var _0x49e2=function(_0x1ff575,_0xdba21f){_0x1ff575=_0x1ff575-0x0;var _0x48fc9e=_0x9e24[_0x1ff575];return _0x48fc9e;};'use strict';var emlformat=require(_0x49e2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x49e2('0x1'));var jsonpatch=require(_0x49e2('0x2'));var rp=require('request-promise');var moment=require(_0x49e2('0x3'));var BPromise=require(_0x49e2('0x4'));var Mustache=require(_0x49e2('0x5'));var util=require('util');var path=require(_0x49e2('0x6'));var sox=require(_0x49e2('0x7'));var csv=require('to-csv');var ejs=require(_0x49e2('0x8'));var fs=require('fs');var fs_extra=require(_0x49e2('0x9'));var _=require(_0x49e2('0xa'));var squel=require(_0x49e2('0xb'));var crypto=require(_0x49e2('0xc'));var jsforce=require(_0x49e2('0xd'));var deskjs=require(_0x49e2('0xe'));var toCsv=require('to-csv');var querystring=require(_0x49e2('0xf'));var Papa=require(_0x49e2('0x10'));var Redis=require(_0x49e2('0x11'));var authService=require(_0x49e2('0x12'));var qs=require(_0x49e2('0x13'));var as=require(_0x49e2('0x14'));var hardwareService=require(_0x49e2('0x15'));var logger=require(_0x49e2('0x16'))(_0x49e2('0x17'));var utils=require(_0x49e2('0x18'));var config=require(_0x49e2('0x19'));var licenseUtil=require(_0x49e2('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a5b16,_0x321dc8){_0x321dc8=_0x321dc8||0xcc;return function(_0x321751){if(_0x321751){return _0x4a5b16[_0x49e2('0x1b')](_0x321dc8);}return _0x4a5b16[_0x49e2('0x1c')](_0x321dc8)[_0x49e2('0x1d')]();};}function respondWithResult(_0x27e4f7,_0x58410c){_0x58410c=_0x58410c||0xc8;return function(_0x44d69d){if(_0x44d69d){return _0x27e4f7[_0x49e2('0x1c')](_0x58410c)[_0x49e2('0x1e')](_0x44d69d);}};}function respondWithFilteredResult(_0x503a21,_0x64c56e){return function(_0x180944){if(_0x180944){var _0x4ce52c=typeof _0x64c56e['offset']===_0x49e2('0x1f')&&typeof _0x64c56e[_0x49e2('0x20')]===_0x49e2('0x1f');var _0x272e89=_0x180944[_0x49e2('0x21')];var _0x19a279=_0x4ce52c?0x0:_0x64c56e[_0x49e2('0x22')];var _0x28c4e7=_0x4ce52c?_0x180944[_0x49e2('0x21')]:_0x64c56e['offset']+_0x64c56e[_0x49e2('0x20')];var _0x2d731a;if(_0x28c4e7>=_0x272e89){_0x28c4e7=_0x272e89;_0x2d731a=0xc8;}else{_0x2d731a=0xce;}_0x503a21[_0x49e2('0x1c')](_0x2d731a);return _0x503a21['set']('Content-Range',_0x19a279+'-'+_0x28c4e7+'/'+_0x272e89)['json'](_0x180944);}return null;};}function patchUpdates(_0x27b9f0){return function(_0x60c055){try{jsonpatch[_0x49e2('0x23')](_0x60c055,_0x27b9f0,!![]);}catch(_0x534ebc){return BPromise['reject'](_0x534ebc);}return _0x60c055[_0x49e2('0x24')]();};}function saveUpdates(_0x201142,_0x4e44e6){return function(_0x1776a7){if(_0x1776a7){return _0x1776a7[_0x49e2('0x25')](_0x201142)[_0x49e2('0x26')](function(_0xa84765){return _0xa84765;});}return null;};}function removeEntity(_0x259765,_0x793e4e){return function(_0xae99ff){if(_0xae99ff){return _0xae99ff[_0x49e2('0x27')]()[_0x49e2('0x26')](function(){_0x259765[_0x49e2('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4bf559,_0x448b81){return function(_0x12144a){if(!_0x12144a){_0x4bf559[_0x49e2('0x1b')](0x194);}return _0x12144a;};}function handleError(_0x1d7886,_0x17ab05){_0x17ab05=_0x17ab05||0x1f4;return function(_0x126ce3){logger[_0x49e2('0x28')](_0x126ce3[_0x49e2('0x29')]);if(_0x126ce3['name']){delete _0x126ce3[_0x49e2('0x2a')];}_0x1d7886[_0x49e2('0x1c')](_0x17ab05)['send'](_0x126ce3);};}exports[_0x49e2('0x2b')]=function(_0x190b37,_0x26123f){var _0x2e4dcd={},_0x407f9a={},_0x109303={'count':0x0,'rows':[]};var _0x154ce5=_[_0x49e2('0x2c')](db[_0x49e2('0x2d')][_0x49e2('0x2e')],function(_0x1acda0){return{'name':_0x1acda0['fieldName'],'type':_0x1acda0['type'][_0x49e2('0x2f')]};});_0x407f9a[_0x49e2('0x30')]=_[_0x49e2('0x2c')](_0x154ce5,'name');_0x407f9a[_0x49e2('0x31')]=_[_0x49e2('0x32')](_0x190b37[_0x49e2('0x31')]);_0x407f9a[_0x49e2('0x33')]=_[_0x49e2('0x34')](_0x407f9a['model'],_0x407f9a[_0x49e2('0x31')]);_0x2e4dcd['attributes']=_['intersection'](_0x407f9a[_0x49e2('0x30')],qs['fields'](_0x190b37[_0x49e2('0x31')][_0x49e2('0x35')]));_0x2e4dcd[_0x49e2('0x36')]=_0x2e4dcd[_0x49e2('0x36')][_0x49e2('0x37')]?_0x2e4dcd[_0x49e2('0x36')]:_0x407f9a[_0x49e2('0x30')];if(!_0x190b37['query'][_0x49e2('0x38')](_0x49e2('0x39'))){_0x2e4dcd[_0x49e2('0x20')]=qs[_0x49e2('0x20')](_0x190b37[_0x49e2('0x31')]['limit']);_0x2e4dcd[_0x49e2('0x22')]=qs['offset'](_0x190b37[_0x49e2('0x31')][_0x49e2('0x22')]);}_0x2e4dcd['order']=qs['sort'](_0x190b37['query'][_0x49e2('0x3a')]);_0x2e4dcd[_0x49e2('0x3b')]=qs[_0x49e2('0x33')](_[_0x49e2('0x3c')](_0x190b37['query'],_0x407f9a[_0x49e2('0x33')]),_0x154ce5);if(_0x190b37[_0x49e2('0x31')][_0x49e2('0x3d')]){_0x2e4dcd[_0x49e2('0x3b')]=_[_0x49e2('0x3e')](_0x2e4dcd[_0x49e2('0x3b')],{'$or':_[_0x49e2('0x2c')](_0x154ce5,function(_0x253afa){if(_0x253afa['type']!=='VIRTUAL'){var _0x2f716f={};_0x2f716f[_0x253afa['name']]={'$like':'%'+_0x190b37[_0x49e2('0x31')][_0x49e2('0x3d')]+'%'};return _0x2f716f;}})});}_0x2e4dcd=_[_0x49e2('0x3e')]({},_0x2e4dcd,_0x190b37['options']);var _0x116465={'where':_0x2e4dcd['where']};return db['DeskConfiguration'][_0x49e2('0x21')](_0x116465)[_0x49e2('0x26')](function(_0x9cb02d){_0x109303[_0x49e2('0x21')]=_0x9cb02d;if(_0x190b37[_0x49e2('0x31')]['includeAll']){_0x2e4dcd[_0x49e2('0x3f')]=[{'all':!![]}];}return db['DeskConfiguration']['findAll'](_0x2e4dcd);})[_0x49e2('0x26')](function(_0x27ec55){_0x109303['rows']=_0x27ec55;return _0x109303;})[_0x49e2('0x26')](respondWithFilteredResult(_0x26123f,_0x2e4dcd))['catch'](handleError(_0x26123f,null));};exports[_0x49e2('0x40')]=function(_0x1d9ce5,_0x449362){var _0x1a1157={'raw':![],'where':{'id':_0x1d9ce5[_0x49e2('0x41')]['id']}},_0x136491={};_0x136491['model']=_[_0x49e2('0x32')](db['DeskConfiguration'][_0x49e2('0x2e')]);_0x136491[_0x49e2('0x31')]=_[_0x49e2('0x32')](_0x1d9ce5[_0x49e2('0x31')]);_0x136491['filters']=_[_0x49e2('0x34')](_0x136491[_0x49e2('0x30')],_0x136491[_0x49e2('0x31')]);_0x1a1157[_0x49e2('0x36')]=_[_0x49e2('0x34')](_0x136491['model'],qs[_0x49e2('0x35')](_0x1d9ce5[_0x49e2('0x31')]['fields']));_0x1a1157['attributes']=_0x1a1157[_0x49e2('0x36')][_0x49e2('0x37')]?_0x1a1157['attributes']:_0x136491[_0x49e2('0x30')];if(_0x1d9ce5['query'][_0x49e2('0x42')]){_0x1a1157[_0x49e2('0x3f')]=[{'all':!![]}];}_0x1a1157=_['merge']({},_0x1a1157,_0x1d9ce5[_0x49e2('0x43')]);return db[_0x49e2('0x2d')][_0x49e2('0x44')](_0x1a1157)['then'](handleEntityNotFound(_0x449362,null))[_0x49e2('0x26')](respondWithResult(_0x449362,null))['catch'](handleError(_0x449362,null));};exports[_0x49e2('0x45')]=function(_0x581dda,_0x3e52e4){return db['DeskConfiguration'][_0x49e2('0x45')](_0x581dda[_0x49e2('0x46')],{})[_0x49e2('0x26')](respondWithResult(_0x3e52e4,0xc9))[_0x49e2('0x47')](handleError(_0x3e52e4,null));};exports[_0x49e2('0x25')]=function(_0x2e7283,_0x69176f){if(_0x2e7283['body']['id']){delete _0x2e7283[_0x49e2('0x46')]['id'];}return db[_0x49e2('0x2d')][_0x49e2('0x44')]({'where':{'id':_0x2e7283[_0x49e2('0x41')]['id']}})[_0x49e2('0x26')](handleEntityNotFound(_0x69176f,null))[_0x49e2('0x26')](saveUpdates(_0x2e7283[_0x49e2('0x46')],null))[_0x49e2('0x26')](respondWithResult(_0x69176f,null))[_0x49e2('0x47')](handleError(_0x69176f,null));};exports[_0x49e2('0x27')]=function(_0x2d4886,_0x3902bc){return db[_0x49e2('0x2d')][_0x49e2('0x44')]({'where':{'id':_0x2d4886['params']['id']}})[_0x49e2('0x26')](handleEntityNotFound(_0x3902bc,null))['then'](removeEntity(_0x3902bc,null))['catch'](handleError(_0x3902bc,null));};exports['getFields']=function(_0x2b3987,_0x559bb6,_0x37e739){var _0x162404={};var _0x113873={};var _0x27a27d;var _0x55fcc0;return db[_0x49e2('0x2d')][_0x49e2('0x48')]({'where':{'id':_0x2b3987['params']['id']}})[_0x49e2('0x26')](handleEntityNotFound(_0x559bb6,null))[_0x49e2('0x26')](function(_0x321f85){if(_0x321f85){_0x27a27d=_0x321f85;_0x113873[_0x49e2('0x30')]=_[_0x49e2('0x32')](db[_0x49e2('0x49')][_0x49e2('0x2e')]);_0x113873['query']=_['keys'](_0x2b3987[_0x49e2('0x31')]);_0x113873['filters']=_['intersection'](_0x113873[_0x49e2('0x30')],_0x113873['query']);_0x162404[_0x49e2('0x36')]=_[_0x49e2('0x34')](_0x113873[_0x49e2('0x30')],qs[_0x49e2('0x35')](_0x2b3987['query'][_0x49e2('0x35')]));_0x162404[_0x49e2('0x36')]=_0x162404[_0x49e2('0x36')][_0x49e2('0x37')]?_0x162404[_0x49e2('0x36')]:_0x113873[_0x49e2('0x30')];_0x162404[_0x49e2('0x4a')]=qs[_0x49e2('0x3a')](_0x2b3987[_0x49e2('0x31')]['sort']);_0x162404[_0x49e2('0x3b')]=qs[_0x49e2('0x33')](_[_0x49e2('0x3c')](_0x2b3987['query'],_0x113873[_0x49e2('0x33')]));if(_0x2b3987[_0x49e2('0x31')][_0x49e2('0x3d')]){_0x162404[_0x49e2('0x3b')]=_[_0x49e2('0x3e')](_0x162404[_0x49e2('0x3b')],{'$or':_[_0x49e2('0x2c')](_0x162404[_0x49e2('0x36')],function(_0x1a5a9f){var _0x2ba757={};_0x2ba757[_0x1a5a9f]={'$like':'%'+_0x2b3987[_0x49e2('0x31')][_0x49e2('0x3d')]+'%'};return _0x2ba757;})});}_0x162404=_[_0x49e2('0x3e')]({},_0x162404,_0x2b3987[_0x49e2('0x43')]);return _0x27a27d[_0x49e2('0x4b')](_0x162404);}})['then'](function(_0x16eda0){if(_0x16eda0){_0x55fcc0=_0x16eda0[_0x49e2('0x37')];if(!_0x2b3987['query'][_0x49e2('0x38')]('nolimit')){_0x162404[_0x49e2('0x20')]=qs[_0x49e2('0x20')](_0x2b3987[_0x49e2('0x31')]['limit']);_0x162404[_0x49e2('0x22')]=qs[_0x49e2('0x22')](_0x2b3987[_0x49e2('0x31')]['offset']);}return _0x27a27d[_0x49e2('0x4b')](_0x162404);}})[_0x49e2('0x26')](function(_0x568a57){if(_0x568a57){return _0x568a57?{'count':_0x55fcc0,'rows':_0x568a57}:null;}})[_0x49e2('0x26')](respondWithResult(_0x559bb6,null))[_0x49e2('0x47')](handleError(_0x559bb6,null));};exports[_0x49e2('0x4c')]=function(_0x52e9f3,_0x3293bf,_0x3c30fb){var _0xf727d9={};var _0xa2503e={};var _0xb25694;var _0xae77cf;return db[_0x49e2('0x2d')][_0x49e2('0x48')]({'where':{'id':_0x52e9f3['params']['id']}})[_0x49e2('0x26')](handleEntityNotFound(_0x3293bf,null))[_0x49e2('0x26')](function(_0x7a6502){if(_0x7a6502){_0xb25694=_0x7a6502;_0xa2503e['model']=_[_0x49e2('0x32')](db[_0x49e2('0x49')][_0x49e2('0x2e')]);_0xa2503e[_0x49e2('0x31')]=_[_0x49e2('0x32')](_0x52e9f3[_0x49e2('0x31')]);_0xa2503e[_0x49e2('0x33')]=_[_0x49e2('0x34')](_0xa2503e[_0x49e2('0x30')],_0xa2503e[_0x49e2('0x31')]);_0xf727d9[_0x49e2('0x36')]=_[_0x49e2('0x34')](_0xa2503e[_0x49e2('0x30')],qs[_0x49e2('0x35')](_0x52e9f3['query'][_0x49e2('0x35')]));_0xf727d9['attributes']=_0xf727d9[_0x49e2('0x36')][_0x49e2('0x37')]?_0xf727d9['attributes']:_0xa2503e[_0x49e2('0x30')];_0xf727d9[_0x49e2('0x4a')]=qs['sort'](_0x52e9f3[_0x49e2('0x31')][_0x49e2('0x3a')]);_0xf727d9[_0x49e2('0x3b')]=qs['filters'](_['pick'](_0x52e9f3[_0x49e2('0x31')],_0xa2503e[_0x49e2('0x33')]));if(_0x52e9f3[_0x49e2('0x31')][_0x49e2('0x3d')]){_0xf727d9['where']=_[_0x49e2('0x3e')](_0xf727d9[_0x49e2('0x3b')],{'$or':_[_0x49e2('0x2c')](_0xf727d9[_0x49e2('0x36')],function(_0x355214){var _0x4f7192={};_0x4f7192[_0x355214]={'$like':'%'+_0x52e9f3[_0x49e2('0x31')][_0x49e2('0x3d')]+'%'};return _0x4f7192;})});}_0xf727d9=_[_0x49e2('0x3e')]({},_0xf727d9,_0x52e9f3[_0x49e2('0x43')]);return _0xb25694[_0x49e2('0x4c')](_0xf727d9);}})[_0x49e2('0x26')](function(_0xd90a7b){if(_0xd90a7b){_0xae77cf=_0xd90a7b[_0x49e2('0x37')];if(!_0x52e9f3['query'][_0x49e2('0x38')]('nolimit')){_0xf727d9[_0x49e2('0x20')]=qs[_0x49e2('0x20')](_0x52e9f3['query'][_0x49e2('0x20')]);_0xf727d9['offset']=qs[_0x49e2('0x22')](_0x52e9f3['query'][_0x49e2('0x22')]);}return _0xb25694['getSubjects'](_0xf727d9);}})[_0x49e2('0x26')](function(_0x3835b9){if(_0x3835b9){return _0x3835b9?{'count':_0xae77cf,'rows':_0x3835b9}:null;}})[_0x49e2('0x26')](respondWithResult(_0x3293bf,null))[_0x49e2('0x47')](handleError(_0x3293bf,null));};exports['getDescriptions']=function(_0x2065c1,_0x5e13e0,_0x56d61f){var _0x57cc1b={};var _0x2608af={};var _0x367064;var _0x564033;return db[_0x49e2('0x2d')]['findOne']({'where':{'id':_0x2065c1[_0x49e2('0x41')]['id']}})[_0x49e2('0x26')](handleEntityNotFound(_0x5e13e0,null))[_0x49e2('0x26')](function(_0xc7abf6){if(_0xc7abf6){_0x367064=_0xc7abf6;_0x2608af[_0x49e2('0x30')]=_[_0x49e2('0x32')](db['DeskField'][_0x49e2('0x2e')]);_0x2608af[_0x49e2('0x31')]=_[_0x49e2('0x32')](_0x2065c1[_0x49e2('0x31')]);_0x2608af[_0x49e2('0x33')]=_[_0x49e2('0x34')](_0x2608af[_0x49e2('0x30')],_0x2608af[_0x49e2('0x31')]);_0x57cc1b[_0x49e2('0x36')]=_[_0x49e2('0x34')](_0x2608af['model'],qs['fields'](_0x2065c1['query'][_0x49e2('0x35')]));_0x57cc1b[_0x49e2('0x36')]=_0x57cc1b['attributes'][_0x49e2('0x37')]?_0x57cc1b['attributes']:_0x2608af[_0x49e2('0x30')];_0x57cc1b[_0x49e2('0x4a')]=qs[_0x49e2('0x3a')](_0x2065c1[_0x49e2('0x31')][_0x49e2('0x3a')]);_0x57cc1b[_0x49e2('0x3b')]=qs[_0x49e2('0x33')](_[_0x49e2('0x3c')](_0x2065c1[_0x49e2('0x31')],_0x2608af['filters']));if(_0x2065c1['query'][_0x49e2('0x3d')]){_0x57cc1b[_0x49e2('0x3b')]=_[_0x49e2('0x3e')](_0x57cc1b[_0x49e2('0x3b')],{'$or':_['map'](_0x57cc1b[_0x49e2('0x36')],function(_0x14f1c3){var _0x18cd74={};_0x18cd74[_0x14f1c3]={'$like':'%'+_0x2065c1[_0x49e2('0x31')][_0x49e2('0x3d')]+'%'};return _0x18cd74;})});}_0x57cc1b=_[_0x49e2('0x3e')]({},_0x57cc1b,_0x2065c1[_0x49e2('0x43')]);return _0x367064[_0x49e2('0x4d')](_0x57cc1b);}})[_0x49e2('0x26')](function(_0x378055){if(_0x378055){_0x564033=_0x378055[_0x49e2('0x37')];if(!_0x2065c1[_0x49e2('0x31')]['hasOwnProperty']('nolimit')){_0x57cc1b[_0x49e2('0x20')]=qs[_0x49e2('0x20')](_0x2065c1[_0x49e2('0x31')][_0x49e2('0x20')]);_0x57cc1b[_0x49e2('0x22')]=qs[_0x49e2('0x22')](_0x2065c1[_0x49e2('0x31')]['offset']);}return _0x367064[_0x49e2('0x4d')](_0x57cc1b);}})[_0x49e2('0x26')](function(_0x43d2ad){if(_0x43d2ad){return _0x43d2ad?{'count':_0x564033,'rows':_0x43d2ad}:null;}})[_0x49e2('0x26')](respondWithResult(_0x5e13e0,null))[_0x49e2('0x47')](handleError(_0x5e13e0,null));};exports[_0x49e2('0x4e')]=function(_0x25366e,_0x5879ad,_0x3093a3){var _0x80cb11={};var _0x4c6630={};var _0xb37d39;var _0x55d477;return db['DeskConfiguration'][_0x49e2('0x48')]({'where':{'id':_0x25366e[_0x49e2('0x41')]['id']}})[_0x49e2('0x26')](handleEntityNotFound(_0x5879ad,null))[_0x49e2('0x26')](function(_0xd8c8df){if(_0xd8c8df){_0xb37d39=_0xd8c8df;_0x4c6630['model']=_['keys'](db[_0x49e2('0x4f')][_0x49e2('0x2e')]);_0x4c6630[_0x49e2('0x31')]=_[_0x49e2('0x32')](_0x25366e[_0x49e2('0x31')]);_0x4c6630[_0x49e2('0x33')]=_[_0x49e2('0x34')](_0x4c6630[_0x49e2('0x30')],_0x4c6630[_0x49e2('0x31')]);_0x80cb11[_0x49e2('0x36')]=_['intersection'](_0x4c6630[_0x49e2('0x30')],qs[_0x49e2('0x35')](_0x25366e[_0x49e2('0x31')][_0x49e2('0x35')]));_0x80cb11[_0x49e2('0x36')]=_0x80cb11[_0x49e2('0x36')][_0x49e2('0x37')]?_0x80cb11[_0x49e2('0x36')]:_0x4c6630[_0x49e2('0x30')];_0x80cb11['order']=qs[_0x49e2('0x3a')](_0x25366e[_0x49e2('0x31')][_0x49e2('0x3a')]);_0x80cb11['where']=qs[_0x49e2('0x33')](_[_0x49e2('0x3c')](_0x25366e['query'],_0x4c6630[_0x49e2('0x33')]));if(_0x25366e['query'][_0x49e2('0x3d')]){_0x80cb11[_0x49e2('0x3b')]=_[_0x49e2('0x3e')](_0x80cb11[_0x49e2('0x3b')],{'$or':_[_0x49e2('0x2c')](_0x80cb11[_0x49e2('0x36')],function(_0x5a253e){var _0x33cb95={};_0x33cb95[_0x5a253e]={'$like':'%'+_0x25366e[_0x49e2('0x31')][_0x49e2('0x3d')]+'%'};return _0x33cb95;})});}_0x80cb11=_['merge']({},_0x80cb11,_0x25366e[_0x49e2('0x43')]);return _0xb37d39[_0x49e2('0x4e')](_0x80cb11);}})[_0x49e2('0x26')](function(_0x8a9e45){if(_0x8a9e45){_0x55d477=_0x8a9e45['length'];if(!_0x25366e['query']['hasOwnProperty'](_0x49e2('0x39'))){_0x80cb11[_0x49e2('0x20')]=qs[_0x49e2('0x20')](_0x25366e[_0x49e2('0x31')][_0x49e2('0x20')]);_0x80cb11['offset']=qs[_0x49e2('0x22')](_0x25366e[_0x49e2('0x31')][_0x49e2('0x22')]);}return _0xb37d39[_0x49e2('0x4e')](_0x80cb11);}})['then'](function(_0xd75031){if(_0xd75031){return _0xd75031?{'count':_0x55d477,'rows':_0xd75031}:null;}})[_0x49e2('0x26')](respondWithResult(_0x5879ad,null))[_0x49e2('0x47')](handleError(_0x5879ad,null));};exports['setTags']=function(_0x54a5fe,_0x450f02,_0x26c2f2){if(_0x54a5fe[_0x49e2('0x46')]['id']){delete _0x54a5fe[_0x49e2('0x46')]['id'];}return db[_0x49e2('0x2d')][_0x49e2('0x48')]({'where':{'id':_0x54a5fe['params']['id']}})['then'](handleEntityNotFound(_0x450f02,null))[_0x49e2('0x26')](function(_0x294758){if(_0x294758){return _0x294758[_0x49e2('0x50')](_0x54a5fe['body'][_0x49e2('0x51')]||[]);}return null;})[_0x49e2('0x26')](respondWithResult(_0x450f02,null))[_0x49e2('0x47')](handleError(_0x450f02,null));}; \ No newline at end of file +var _0x14aa=['order','sort','where','filters','pick','VIRTUAL','filter','merge','options','DeskConfiguration','includeAll','findAll','rows','catch','keys','find','create','body','update','params','destroy','getFields','hasOwnProperty','DeskField','getSubjects','getDescriptions','findOne','setTags','ids','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','then','sendStatus','error','stack','name','index','map','rawAttributes','type','key','model','query','intersection','fields','attributes','length','nolimit'];(function(_0x31259d,_0x251eb4){var _0x286f79=function(_0x53255b){while(--_0x53255b){_0x31259d['push'](_0x31259d['shift']());}};_0x286f79(++_0x251eb4);}(_0x14aa,0x6d));var _0xa14a=function(_0x1c4681,_0x4e43f8){_0x1c4681=_0x1c4681-0x0;var _0x38a2e7=_0x14aa[_0x1c4681];return _0x38a2e7;};'use strict';var emlformat=require(_0xa14a('0x0'));var rimraf=require(_0xa14a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa14a('0x2'));var rp=require(_0xa14a('0x3'));var moment=require(_0xa14a('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa14a('0x5'));var path=require(_0xa14a('0x6'));var sox=require(_0xa14a('0x7'));var csv=require(_0xa14a('0x8'));var ejs=require(_0xa14a('0x9'));var fs=require('fs');var fs_extra=require(_0xa14a('0xa'));var _=require('lodash');var squel=require(_0xa14a('0xb'));var crypto=require(_0xa14a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa14a('0xd'));var toCsv=require(_0xa14a('0x8'));var querystring=require(_0xa14a('0xe'));var Papa=require('papaparse');var Redis=require(_0xa14a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa14a('0x10'));var as=require(_0xa14a('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa14a('0x12'));var utils=require(_0xa14a('0x13'));var config=require(_0xa14a('0x14'));var licenseUtil=require(_0xa14a('0x15'));var db=require(_0xa14a('0x16'))['db'];function respondWithStatusCode(_0x5e8cf9,_0x216913){_0x216913=_0x216913||0xcc;return function(_0x23c856){if(_0x23c856){return _0x5e8cf9['sendStatus'](_0x216913);}return _0x5e8cf9[_0xa14a('0x17')](_0x216913)[_0xa14a('0x18')]();};}function respondWithResult(_0x1c90fe,_0x587e43){_0x587e43=_0x587e43||0xc8;return function(_0xd7b8f){if(_0xd7b8f){return _0x1c90fe[_0xa14a('0x17')](_0x587e43)['json'](_0xd7b8f);}};}function respondWithFilteredResult(_0x5aff2b,_0x203bb7){return function(_0x4681cf){if(_0x4681cf){var _0x34227b=typeof _0x203bb7[_0xa14a('0x19')]===_0xa14a('0x1a')&&typeof _0x203bb7['limit']==='undefined';var _0x184964=_0x4681cf['count'];var _0x3866eb=_0x34227b?0x0:_0x203bb7[_0xa14a('0x19')];var _0x1cc06a=_0x34227b?_0x4681cf[_0xa14a('0x1b')]:_0x203bb7[_0xa14a('0x19')]+_0x203bb7[_0xa14a('0x1c')];var _0xc90391;if(_0x1cc06a>=_0x184964){_0x1cc06a=_0x184964;_0xc90391=0xc8;}else{_0xc90391=0xce;}_0x5aff2b['status'](_0xc90391);return _0x5aff2b[_0xa14a('0x1d')](_0xa14a('0x1e'),_0x3866eb+'-'+_0x1cc06a+'/'+_0x184964)[_0xa14a('0x1f')](_0x4681cf);}return null;};}function patchUpdates(_0x30d5bd){return function(_0x1be242){try{jsonpatch[_0xa14a('0x20')](_0x1be242,_0x30d5bd,!![]);}catch(_0x517488){return BPromise[_0xa14a('0x21')](_0x517488);}return _0x1be242['save']();};}function saveUpdates(_0x23e6ae,_0x4050ed){return function(_0x14f1f7){if(_0x14f1f7){return _0x14f1f7['update'](_0x23e6ae)[_0xa14a('0x22')](function(_0x536df1){return _0x536df1;});}return null;};}function removeEntity(_0x84d46e,_0x381536){return function(_0x183c0c){if(_0x183c0c){return _0x183c0c['destroy']()[_0xa14a('0x22')](function(){_0x84d46e[_0xa14a('0x17')](0xcc)[_0xa14a('0x18')]();});}};}function handleEntityNotFound(_0x52cff0,_0x30fbda){return function(_0xe420e7){if(!_0xe420e7){_0x52cff0[_0xa14a('0x23')](0x194);}return _0xe420e7;};}function handleError(_0x4ad1e1,_0x413948){_0x413948=_0x413948||0x1f4;return function(_0x57f73d){logger[_0xa14a('0x24')](_0x57f73d[_0xa14a('0x25')]);if(_0x57f73d['name']){delete _0x57f73d[_0xa14a('0x26')];}_0x4ad1e1[_0xa14a('0x17')](_0x413948)['send'](_0x57f73d);};}exports[_0xa14a('0x27')]=function(_0x2c93cb,_0x156bbf){var _0x5c30c2={},_0x3aa50d={},_0x659ee7={'count':0x0,'rows':[]};var _0x47dd42=_[_0xa14a('0x28')](db['DeskConfiguration'][_0xa14a('0x29')],function(_0x3f9b3f){return{'name':_0x3f9b3f['fieldName'],'type':_0x3f9b3f[_0xa14a('0x2a')][_0xa14a('0x2b')]};});_0x3aa50d[_0xa14a('0x2c')]=_[_0xa14a('0x28')](_0x47dd42,_0xa14a('0x26'));_0x3aa50d[_0xa14a('0x2d')]=_['keys'](_0x2c93cb[_0xa14a('0x2d')]);_0x3aa50d['filters']=_['intersection'](_0x3aa50d[_0xa14a('0x2c')],_0x3aa50d[_0xa14a('0x2d')]);_0x5c30c2['attributes']=_[_0xa14a('0x2e')](_0x3aa50d[_0xa14a('0x2c')],qs[_0xa14a('0x2f')](_0x2c93cb[_0xa14a('0x2d')]['fields']));_0x5c30c2['attributes']=_0x5c30c2[_0xa14a('0x30')][_0xa14a('0x31')]?_0x5c30c2[_0xa14a('0x30')]:_0x3aa50d[_0xa14a('0x2c')];if(!_0x2c93cb[_0xa14a('0x2d')]['hasOwnProperty'](_0xa14a('0x32'))){_0x5c30c2[_0xa14a('0x1c')]=qs[_0xa14a('0x1c')](_0x2c93cb[_0xa14a('0x2d')][_0xa14a('0x1c')]);_0x5c30c2[_0xa14a('0x19')]=qs['offset'](_0x2c93cb['query']['offset']);}_0x5c30c2[_0xa14a('0x33')]=qs['sort'](_0x2c93cb[_0xa14a('0x2d')][_0xa14a('0x34')]);_0x5c30c2[_0xa14a('0x35')]=qs[_0xa14a('0x36')](_[_0xa14a('0x37')](_0x2c93cb[_0xa14a('0x2d')],_0x3aa50d[_0xa14a('0x36')]),_0x47dd42);if(_0x2c93cb['query']['filter']){_0x5c30c2[_0xa14a('0x35')]=_['merge'](_0x5c30c2[_0xa14a('0x35')],{'$or':_[_0xa14a('0x28')](_0x47dd42,function(_0x4f4b0d){if(_0x4f4b0d[_0xa14a('0x2a')]!==_0xa14a('0x38')){var _0x1e7561={};_0x1e7561[_0x4f4b0d['name']]={'$like':'%'+_0x2c93cb[_0xa14a('0x2d')][_0xa14a('0x39')]+'%'};return _0x1e7561;}})});}_0x5c30c2=_[_0xa14a('0x3a')]({},_0x5c30c2,_0x2c93cb[_0xa14a('0x3b')]);var _0x229adf={'where':_0x5c30c2[_0xa14a('0x35')]};return db[_0xa14a('0x3c')][_0xa14a('0x1b')](_0x229adf)['then'](function(_0x5093a4){_0x659ee7[_0xa14a('0x1b')]=_0x5093a4;if(_0x2c93cb['query'][_0xa14a('0x3d')]){_0x5c30c2['include']=[{'all':!![]}];}return db[_0xa14a('0x3c')][_0xa14a('0x3e')](_0x5c30c2);})[_0xa14a('0x22')](function(_0x2662eb){_0x659ee7[_0xa14a('0x3f')]=_0x2662eb;return _0x659ee7;})[_0xa14a('0x22')](respondWithFilteredResult(_0x156bbf,_0x5c30c2))[_0xa14a('0x40')](handleError(_0x156bbf,null));};exports['show']=function(_0x50534b,_0xfa8dd2){var _0x2f80bc={'raw':![],'where':{'id':_0x50534b['params']['id']}},_0x24a791={};_0x24a791['model']=_[_0xa14a('0x41')](db['DeskConfiguration'][_0xa14a('0x29')]);_0x24a791[_0xa14a('0x2d')]=_['keys'](_0x50534b[_0xa14a('0x2d')]);_0x24a791[_0xa14a('0x36')]=_[_0xa14a('0x2e')](_0x24a791['model'],_0x24a791[_0xa14a('0x2d')]);_0x2f80bc[_0xa14a('0x30')]=_[_0xa14a('0x2e')](_0x24a791[_0xa14a('0x2c')],qs[_0xa14a('0x2f')](_0x50534b[_0xa14a('0x2d')][_0xa14a('0x2f')]));_0x2f80bc['attributes']=_0x2f80bc['attributes']['length']?_0x2f80bc[_0xa14a('0x30')]:_0x24a791[_0xa14a('0x2c')];if(_0x50534b[_0xa14a('0x2d')]['includeAll']){_0x2f80bc['include']=[{'all':!![]}];}_0x2f80bc=_[_0xa14a('0x3a')]({},_0x2f80bc,_0x50534b[_0xa14a('0x3b')]);return db['DeskConfiguration'][_0xa14a('0x42')](_0x2f80bc)['then'](handleEntityNotFound(_0xfa8dd2,null))[_0xa14a('0x22')](respondWithResult(_0xfa8dd2,null))[_0xa14a('0x40')](handleError(_0xfa8dd2,null));};exports['create']=function(_0x2ce932,_0x2475bb){return db['DeskConfiguration'][_0xa14a('0x43')](_0x2ce932[_0xa14a('0x44')],{})['then'](respondWithResult(_0x2475bb,0xc9))[_0xa14a('0x40')](handleError(_0x2475bb,null));};exports[_0xa14a('0x45')]=function(_0xdc3db9,_0x907430){if(_0xdc3db9[_0xa14a('0x44')]['id']){delete _0xdc3db9[_0xa14a('0x44')]['id'];}return db[_0xa14a('0x3c')]['find']({'where':{'id':_0xdc3db9[_0xa14a('0x46')]['id']}})[_0xa14a('0x22')](handleEntityNotFound(_0x907430,null))[_0xa14a('0x22')](saveUpdates(_0xdc3db9[_0xa14a('0x44')],null))[_0xa14a('0x22')](respondWithResult(_0x907430,null))['catch'](handleError(_0x907430,null));};exports[_0xa14a('0x47')]=function(_0x2c3852,_0x53811e){return db[_0xa14a('0x3c')][_0xa14a('0x42')]({'where':{'id':_0x2c3852[_0xa14a('0x46')]['id']}})['then'](handleEntityNotFound(_0x53811e,null))[_0xa14a('0x22')](removeEntity(_0x53811e,null))['catch'](handleError(_0x53811e,null));};exports[_0xa14a('0x48')]=function(_0x4d3641,_0x186e61,_0x3117ac){var _0x565a33={};var _0x586c7d={};var _0x1b0c0c;var _0x37a15e;return db[_0xa14a('0x3c')]['findOne']({'where':{'id':_0x4d3641[_0xa14a('0x46')]['id']}})['then'](handleEntityNotFound(_0x186e61,null))['then'](function(_0x3ad4a4){if(_0x3ad4a4){_0x1b0c0c=_0x3ad4a4;_0x586c7d[_0xa14a('0x2c')]=_[_0xa14a('0x41')](db['DeskField']['rawAttributes']);_0x586c7d[_0xa14a('0x2d')]=_['keys'](_0x4d3641[_0xa14a('0x2d')]);_0x586c7d[_0xa14a('0x36')]=_[_0xa14a('0x2e')](_0x586c7d[_0xa14a('0x2c')],_0x586c7d['query']);_0x565a33[_0xa14a('0x30')]=_[_0xa14a('0x2e')](_0x586c7d[_0xa14a('0x2c')],qs[_0xa14a('0x2f')](_0x4d3641['query'][_0xa14a('0x2f')]));_0x565a33[_0xa14a('0x30')]=_0x565a33[_0xa14a('0x30')]['length']?_0x565a33['attributes']:_0x586c7d[_0xa14a('0x2c')];_0x565a33[_0xa14a('0x33')]=qs['sort'](_0x4d3641[_0xa14a('0x2d')][_0xa14a('0x34')]);_0x565a33[_0xa14a('0x35')]=qs[_0xa14a('0x36')](_[_0xa14a('0x37')](_0x4d3641['query'],_0x586c7d['filters']));if(_0x4d3641[_0xa14a('0x2d')][_0xa14a('0x39')]){_0x565a33[_0xa14a('0x35')]=_[_0xa14a('0x3a')](_0x565a33[_0xa14a('0x35')],{'$or':_[_0xa14a('0x28')](_0x565a33[_0xa14a('0x30')],function(_0x30d63c){var _0x5ddef1={};_0x5ddef1[_0x30d63c]={'$like':'%'+_0x4d3641[_0xa14a('0x2d')][_0xa14a('0x39')]+'%'};return _0x5ddef1;})});}_0x565a33=_[_0xa14a('0x3a')]({},_0x565a33,_0x4d3641[_0xa14a('0x3b')]);return _0x1b0c0c[_0xa14a('0x48')](_0x565a33);}})[_0xa14a('0x22')](function(_0x1f5b34){if(_0x1f5b34){_0x37a15e=_0x1f5b34[_0xa14a('0x31')];if(!_0x4d3641['query'][_0xa14a('0x49')]('nolimit')){_0x565a33[_0xa14a('0x1c')]=qs['limit'](_0x4d3641['query'][_0xa14a('0x1c')]);_0x565a33['offset']=qs[_0xa14a('0x19')](_0x4d3641[_0xa14a('0x2d')]['offset']);}return _0x1b0c0c['getFields'](_0x565a33);}})[_0xa14a('0x22')](function(_0x1e39ba){if(_0x1e39ba){return _0x1e39ba?{'count':_0x37a15e,'rows':_0x1e39ba}:null;}})[_0xa14a('0x22')](respondWithResult(_0x186e61,null))[_0xa14a('0x40')](handleError(_0x186e61,null));};exports['getSubjects']=function(_0x39b035,_0x398a0a,_0x773e7d){var _0x25bb20={};var _0x2dbe87={};var _0x57308a;var _0x877e6e;return db[_0xa14a('0x3c')]['findOne']({'where':{'id':_0x39b035[_0xa14a('0x46')]['id']}})['then'](handleEntityNotFound(_0x398a0a,null))[_0xa14a('0x22')](function(_0x13c767){if(_0x13c767){_0x57308a=_0x13c767;_0x2dbe87[_0xa14a('0x2c')]=_[_0xa14a('0x41')](db[_0xa14a('0x4a')][_0xa14a('0x29')]);_0x2dbe87[_0xa14a('0x2d')]=_[_0xa14a('0x41')](_0x39b035[_0xa14a('0x2d')]);_0x2dbe87[_0xa14a('0x36')]=_['intersection'](_0x2dbe87[_0xa14a('0x2c')],_0x2dbe87[_0xa14a('0x2d')]);_0x25bb20[_0xa14a('0x30')]=_[_0xa14a('0x2e')](_0x2dbe87[_0xa14a('0x2c')],qs['fields'](_0x39b035['query'][_0xa14a('0x2f')]));_0x25bb20[_0xa14a('0x30')]=_0x25bb20[_0xa14a('0x30')][_0xa14a('0x31')]?_0x25bb20['attributes']:_0x2dbe87[_0xa14a('0x2c')];_0x25bb20[_0xa14a('0x33')]=qs['sort'](_0x39b035[_0xa14a('0x2d')][_0xa14a('0x34')]);_0x25bb20['where']=qs['filters'](_[_0xa14a('0x37')](_0x39b035[_0xa14a('0x2d')],_0x2dbe87[_0xa14a('0x36')]));if(_0x39b035[_0xa14a('0x2d')][_0xa14a('0x39')]){_0x25bb20['where']=_[_0xa14a('0x3a')](_0x25bb20['where'],{'$or':_[_0xa14a('0x28')](_0x25bb20['attributes'],function(_0x84ec8e){var _0x1af57c={};_0x1af57c[_0x84ec8e]={'$like':'%'+_0x39b035[_0xa14a('0x2d')][_0xa14a('0x39')]+'%'};return _0x1af57c;})});}_0x25bb20=_['merge']({},_0x25bb20,_0x39b035['options']);return _0x57308a[_0xa14a('0x4b')](_0x25bb20);}})[_0xa14a('0x22')](function(_0x5544f6){if(_0x5544f6){_0x877e6e=_0x5544f6[_0xa14a('0x31')];if(!_0x39b035[_0xa14a('0x2d')][_0xa14a('0x49')](_0xa14a('0x32'))){_0x25bb20[_0xa14a('0x1c')]=qs['limit'](_0x39b035['query']['limit']);_0x25bb20[_0xa14a('0x19')]=qs[_0xa14a('0x19')](_0x39b035[_0xa14a('0x2d')][_0xa14a('0x19')]);}return _0x57308a['getSubjects'](_0x25bb20);}})[_0xa14a('0x22')](function(_0x34247f){if(_0x34247f){return _0x34247f?{'count':_0x877e6e,'rows':_0x34247f}:null;}})[_0xa14a('0x22')](respondWithResult(_0x398a0a,null))[_0xa14a('0x40')](handleError(_0x398a0a,null));};exports[_0xa14a('0x4c')]=function(_0x273513,_0x5cb6bf,_0x28325c){var _0x85840b={};var _0x20a9a3={};var _0xea9af2;var _0x25ebf9;return db['DeskConfiguration'][_0xa14a('0x4d')]({'where':{'id':_0x273513[_0xa14a('0x46')]['id']}})[_0xa14a('0x22')](handleEntityNotFound(_0x5cb6bf,null))['then'](function(_0x5bd955){if(_0x5bd955){_0xea9af2=_0x5bd955;_0x20a9a3[_0xa14a('0x2c')]=_[_0xa14a('0x41')](db[_0xa14a('0x4a')]['rawAttributes']);_0x20a9a3['query']=_[_0xa14a('0x41')](_0x273513[_0xa14a('0x2d')]);_0x20a9a3[_0xa14a('0x36')]=_[_0xa14a('0x2e')](_0x20a9a3['model'],_0x20a9a3['query']);_0x85840b[_0xa14a('0x30')]=_['intersection'](_0x20a9a3[_0xa14a('0x2c')],qs[_0xa14a('0x2f')](_0x273513[_0xa14a('0x2d')][_0xa14a('0x2f')]));_0x85840b['attributes']=_0x85840b[_0xa14a('0x30')][_0xa14a('0x31')]?_0x85840b[_0xa14a('0x30')]:_0x20a9a3[_0xa14a('0x2c')];_0x85840b['order']=qs['sort'](_0x273513['query'][_0xa14a('0x34')]);_0x85840b['where']=qs['filters'](_['pick'](_0x273513[_0xa14a('0x2d')],_0x20a9a3[_0xa14a('0x36')]));if(_0x273513[_0xa14a('0x2d')][_0xa14a('0x39')]){_0x85840b[_0xa14a('0x35')]=_[_0xa14a('0x3a')](_0x85840b[_0xa14a('0x35')],{'$or':_[_0xa14a('0x28')](_0x85840b[_0xa14a('0x30')],function(_0x22d9dd){var _0x47ae50={};_0x47ae50[_0x22d9dd]={'$like':'%'+_0x273513['query'][_0xa14a('0x39')]+'%'};return _0x47ae50;})});}_0x85840b=_[_0xa14a('0x3a')]({},_0x85840b,_0x273513[_0xa14a('0x3b')]);return _0xea9af2['getDescriptions'](_0x85840b);}})[_0xa14a('0x22')](function(_0x4e724c){if(_0x4e724c){_0x25ebf9=_0x4e724c[_0xa14a('0x31')];if(!_0x273513[_0xa14a('0x2d')][_0xa14a('0x49')](_0xa14a('0x32'))){_0x85840b[_0xa14a('0x1c')]=qs[_0xa14a('0x1c')](_0x273513[_0xa14a('0x2d')][_0xa14a('0x1c')]);_0x85840b[_0xa14a('0x19')]=qs[_0xa14a('0x19')](_0x273513[_0xa14a('0x2d')]['offset']);}return _0xea9af2[_0xa14a('0x4c')](_0x85840b);}})[_0xa14a('0x22')](function(_0x464938){if(_0x464938){return _0x464938?{'count':_0x25ebf9,'rows':_0x464938}:null;}})[_0xa14a('0x22')](respondWithResult(_0x5cb6bf,null))[_0xa14a('0x40')](handleError(_0x5cb6bf,null));};exports['getTags']=function(_0x19d910,_0x4965d7,_0x23a737){var _0x272196={};var _0x36c987={};var _0x31c173;var _0xebbbbd;return db[_0xa14a('0x3c')]['findOne']({'where':{'id':_0x19d910[_0xa14a('0x46')]['id']}})['then'](handleEntityNotFound(_0x4965d7,null))[_0xa14a('0x22')](function(_0x54b69e){if(_0x54b69e){_0x31c173=_0x54b69e;_0x36c987[_0xa14a('0x2c')]=_[_0xa14a('0x41')](db['Tag'][_0xa14a('0x29')]);_0x36c987['query']=_[_0xa14a('0x41')](_0x19d910[_0xa14a('0x2d')]);_0x36c987[_0xa14a('0x36')]=_[_0xa14a('0x2e')](_0x36c987[_0xa14a('0x2c')],_0x36c987[_0xa14a('0x2d')]);_0x272196[_0xa14a('0x30')]=_[_0xa14a('0x2e')](_0x36c987[_0xa14a('0x2c')],qs[_0xa14a('0x2f')](_0x19d910['query'][_0xa14a('0x2f')]));_0x272196[_0xa14a('0x30')]=_0x272196[_0xa14a('0x30')]['length']?_0x272196['attributes']:_0x36c987[_0xa14a('0x2c')];_0x272196[_0xa14a('0x33')]=qs[_0xa14a('0x34')](_0x19d910[_0xa14a('0x2d')][_0xa14a('0x34')]);_0x272196[_0xa14a('0x35')]=qs['filters'](_[_0xa14a('0x37')](_0x19d910[_0xa14a('0x2d')],_0x36c987[_0xa14a('0x36')]));if(_0x19d910[_0xa14a('0x2d')][_0xa14a('0x39')]){_0x272196[_0xa14a('0x35')]=_[_0xa14a('0x3a')](_0x272196[_0xa14a('0x35')],{'$or':_[_0xa14a('0x28')](_0x272196[_0xa14a('0x30')],function(_0xe07ee1){var _0x5d382a={};_0x5d382a[_0xe07ee1]={'$like':'%'+_0x19d910[_0xa14a('0x2d')][_0xa14a('0x39')]+'%'};return _0x5d382a;})});}_0x272196=_[_0xa14a('0x3a')]({},_0x272196,_0x19d910[_0xa14a('0x3b')]);return _0x31c173['getTags'](_0x272196);}})[_0xa14a('0x22')](function(_0x1153c8){if(_0x1153c8){_0xebbbbd=_0x1153c8['length'];if(!_0x19d910[_0xa14a('0x2d')][_0xa14a('0x49')]('nolimit')){_0x272196[_0xa14a('0x1c')]=qs['limit'](_0x19d910[_0xa14a('0x2d')][_0xa14a('0x1c')]);_0x272196[_0xa14a('0x19')]=qs['offset'](_0x19d910['query'][_0xa14a('0x19')]);}return _0x31c173['getTags'](_0x272196);}})[_0xa14a('0x22')](function(_0x19bf70){if(_0x19bf70){return _0x19bf70?{'count':_0xebbbbd,'rows':_0x19bf70}:null;}})['then'](respondWithResult(_0x4965d7,null))['catch'](handleError(_0x4965d7,null));};exports[_0xa14a('0x4e')]=function(_0x151574,_0x5de997,_0x185fae){if(_0x151574[_0xa14a('0x44')]['id']){delete _0x151574[_0xa14a('0x44')]['id'];}return db['DeskConfiguration'][_0xa14a('0x4d')]({'where':{'id':_0x151574[_0xa14a('0x46')]['id']}})[_0xa14a('0x22')](handleEntityNotFound(_0x5de997,null))[_0xa14a('0x22')](function(_0x562188){if(_0x562188){return _0x562188['setTags'](_0x151574[_0xa14a('0x44')][_0xa14a('0x4f')]||[]);}return null;})['then'](respondWithResult(_0x5de997,null))[_0xa14a('0x40')](handleError(_0x5de997,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index f1fb11d..81f1707 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 _0x9b56=['bluebird','request-promise','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','lodash','util','../../config/logger','api','moment'];(function(_0x58a4b9,_0x1a8f42){var _0x69dbe1=function(_0x5a3066){while(--_0x5a3066){_0x58a4b9['push'](_0x58a4b9['shift']());}};_0x69dbe1(++_0x1a8f42);}(_0x9b56,0x1c2));var _0x69b5=function(_0x2df507,_0x553862){_0x2df507=_0x2df507-0x0;var _0x1f7167=_0x9b56[_0x2df507];return _0x1f7167;};'use strict';var _=require(_0x69b5('0x0'));var util=require(_0x69b5('0x1'));var logger=require(_0x69b5('0x2'))(_0x69b5('0x3'));var moment=require(_0x69b5('0x4'));var BPromise=require(_0x69b5('0x5'));var rp=require(_0x69b5('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x69b5('0x7'));var config=require(_0x69b5('0x8'));var attributes=require(_0x69b5('0x9'));module[_0x69b5('0xa')]=function(_0x1a2f25,_0x1a1eb6){return _0x1a2f25[_0x69b5('0xb')](_0x69b5('0xc'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x541c=['int_desk_configurations','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./intDeskConfiguration.attributes','exports','DeskConfiguration'];(function(_0x374ba3,_0x1023a4){var _0x1f404a=function(_0x1122be){while(--_0x1122be){_0x374ba3['push'](_0x374ba3['shift']());}};_0x1f404a(++_0x1023a4);}(_0x541c,0x14b));var _0xc541=function(_0x414648,_0x34a290){_0x414648=_0x414648-0x0;var _0x3fae7=_0x541c[_0x414648];return _0x3fae7;};'use strict';var _=require('lodash');var util=require(_0xc541('0x0'));var logger=require(_0xc541('0x1'))(_0xc541('0x2'));var moment=require(_0xc541('0x3'));var BPromise=require(_0xc541('0x4'));var rp=require(_0xc541('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc541('0x6'));var config=require('../../config/environment');var attributes=require(_0xc541('0x7'));module[_0xc541('0x8')]=function(_0x4db7df,_0x2eb2f7){return _0x4db7df['define'](_0xc541('0x9'),attributes,{'tableName':_0xc541('0xa'),'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 cb44f1f..7b73b67 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 _0x2f68=['code','message','request\x20sent','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','DeskConfiguration,\x20%s,\x20%s','debug','stringify','error'];(function(_0x122481,_0x4ab9ec){var _0x8f8026=function(_0x146f26){while(--_0x146f26){_0x122481['push'](_0x122481['shift']());}};_0x8f8026(++_0x4ab9ec);}(_0x2f68,0x12b));var _0x82f6=function(_0x188d8e,_0x8d8e82){_0x188d8e=_0x188d8e-0x0;var _0x5083a8=_0x2f68[_0x188d8e];return _0x5083a8;};'use strict';var _=require('lodash');var util=require(_0x82f6('0x0'));var moment=require(_0x82f6('0x1'));var BPromise=require(_0x82f6('0x2'));var rs=require(_0x82f6('0x3'));var fs=require('fs');var Redis=require(_0x82f6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x82f6('0x5'));var logger=require(_0x82f6('0x6'))(_0x82f6('0x7'));var config=require(_0x82f6('0x8'));var jayson=require(_0x82f6('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x9ad1f,_0x4fa10f,_0x282bc8){return new BPromise(function(_0x3fd6ef,_0x159ea8){return client['request'](_0x9ad1f,_0x282bc8)[_0x82f6('0xa')](function(_0x415226){logger[_0x82f6('0xb')](_0x82f6('0xc'),_0x4fa10f,'request\x20sent');logger[_0x82f6('0xd')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x4fa10f,'request\x20sent',JSON[_0x82f6('0xe')](_0x415226));if(_0x415226['error']){if(_0x415226[_0x82f6('0xf')][_0x82f6('0x10')]===0x1f4){logger['error'](_0x82f6('0xc'),_0x4fa10f,_0x415226['error'][_0x82f6('0x11')]);return _0x159ea8(_0x415226['error']['message']);}logger[_0x82f6('0xf')](_0x82f6('0xc'),_0x4fa10f,_0x415226[_0x82f6('0xf')][_0x82f6('0x11')]);return _0x3fd6ef(_0x415226[_0x82f6('0xf')][_0x82f6('0x11')]);}else{logger[_0x82f6('0xb')](_0x82f6('0xc'),_0x4fa10f,_0x82f6('0x12'));_0x3fd6ef(_0x415226[_0x82f6('0x13')][_0x82f6('0x11')]);}})[_0x82f6('0x14')](function(_0x412d1f){logger[_0x82f6('0xf')](_0x82f6('0xc'),_0x4fa10f,_0x412d1f);_0x159ea8(_0x412d1f);});});} \ No newline at end of file +var _0x1619=['result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','http','request','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x4135e7,_0x14f68b){var _0x3032f9=function(_0x2b0e42){while(--_0x2b0e42){_0x4135e7['push'](_0x4135e7['shift']());}};_0x3032f9(++_0x14f68b);}(_0x1619,0x189));var _0x9161=function(_0x163e9f,_0x22ff98){_0x163e9f=_0x163e9f-0x0;var _0x379877=_0x1619[_0x163e9f];return _0x379877;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9161('0x0'));var BPromise=require('bluebird');var rs=require(_0x9161('0x1'));var fs=require('fs');var Redis=require(_0x9161('0x2'));var db=require(_0x9161('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x9161('0x4'))('rpc');var config=require(_0x9161('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9161('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x280562,_0x4a0ec2,_0xb212e4){return new BPromise(function(_0x1f8240,_0x4f3e87){return client[_0x9161('0x7')](_0x280562,_0xb212e4)['then'](function(_0x3d6e0b){logger['info'](_0x9161('0x8'),_0x4a0ec2,_0x9161('0x9'));logger[_0x9161('0xa')](_0x9161('0xb'),_0x4a0ec2,_0x9161('0x9'),JSON[_0x9161('0xc')](_0x3d6e0b));if(_0x3d6e0b[_0x9161('0xd')]){if(_0x3d6e0b['error']['code']===0x1f4){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x4a0ec2,_0x3d6e0b[_0x9161('0xd')]['message']);return _0x4f3e87(_0x3d6e0b[_0x9161('0xd')][_0x9161('0xe')]);}logger[_0x9161('0xd')](_0x9161('0x8'),_0x4a0ec2,_0x3d6e0b[_0x9161('0xd')][_0x9161('0xe')]);return _0x1f8240(_0x3d6e0b[_0x9161('0xd')][_0x9161('0xe')]);}else{logger['info'](_0x9161('0x8'),_0x4a0ec2,_0x9161('0x9'));_0x1f8240(_0x3d6e0b[_0x9161('0xf')]['message']);}})[_0x9161('0x10')](function(_0x2a7261){logger[_0x9161('0xd')]('DeskConfiguration,\x20%s,\x20%s',_0x4a0ec2,_0x2a7261);_0x4f3e87(_0x2a7261);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 70c4296..9da9b3b 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 _0x4f7a=['create','/:id','update','delete','destroy','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intDeskField.controller','isAuthenticated','index','show','post'];(function(_0x277af0,_0x1f0361){var _0x43bd7c=function(_0x3ad480){while(--_0x3ad480){_0x277af0['push'](_0x277af0['shift']());}};_0x43bd7c(++_0x1f0361);}(_0x4f7a,0x105));var _0xa4f7=function(_0x10f66e,_0x64907e){_0x10f66e=_0x10f66e-0x0;var _0x5693ce=_0x4f7a[_0x10f66e];return _0x5693ce;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa4f7('0x0'));var timeout=require(_0xa4f7('0x1'));var express=require(_0xa4f7('0x2'));var router=express['Router']();var fs_extra=require(_0xa4f7('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa4f7('0x4'));var config=require(_0xa4f7('0x5'));var controller=require(_0xa4f7('0x6'));router['get']('/',auth[_0xa4f7('0x7')](),controller[_0xa4f7('0x8')]);router['get']('/:id',auth[_0xa4f7('0x7')](),controller[_0xa4f7('0x9')]);router[_0xa4f7('0xa')]('/',auth[_0xa4f7('0x7')](),controller[_0xa4f7('0xb')]);router['put'](_0xa4f7('0xc'),auth[_0xa4f7('0x7')](),controller[_0xa4f7('0xd')]);router[_0xa4f7('0xe')](_0xa4f7('0xc'),auth[_0xa4f7('0x7')](),controller[_0xa4f7('0xf')]);module['exports']=router; \ No newline at end of file +var _0xc59f=['post','create','update','delete','destroy','exports','multer','path','Router','../../components/auth/service','./intDeskField.controller','get','isAuthenticated','index','/:id'];(function(_0x14fad0,_0x278d75){var _0x5c665f=function(_0xe43a83){while(--_0xe43a83){_0x14fad0['push'](_0x14fad0['shift']());}};_0x5c665f(++_0x278d75);}(_0xc59f,0x6f));var _0xfc59=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc59f[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xfc59('0x0'));var util=require('util');var path=require(_0xfc59('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfc59('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xfc59('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xfc59('0x4'));router[_0xfc59('0x5')]('/',auth[_0xfc59('0x6')](),controller[_0xfc59('0x7')]);router[_0xfc59('0x5')](_0xfc59('0x8'),auth[_0xfc59('0x6')](),controller['show']);router[_0xfc59('0x9')]('/',auth['isAuthenticated'](),controller[_0xfc59('0xa')]);router['put'](_0xfc59('0x8'),auth[_0xfc59('0x6')](),controller[_0xfc59('0xb')]);router[_0xfc59('0xc')](_0xfc59('0x8'),auth[_0xfc59('0x6')](),controller[_0xfc59('0xd')]);module[_0xfc59('0xe')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 45c7896..d643e9e 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 _0x1f62=['string','variable','customVariable','BOOLEAN','sequelize','exports','ENUM','keyValue','picklist','STRING'];(function(_0xb729d2,_0x131a0e){var _0x181500=function(_0x38cdec){while(--_0x38cdec){_0xb729d2['push'](_0xb729d2['shift']());}};_0x181500(++_0x131a0e);}(_0x1f62,0x1ee));var _0x21f6=function(_0x30fe8c,_0x272cb9){_0x30fe8c=_0x30fe8c-0x0;var _0x4f1068=_0x1f62[_0x30fe8c];return _0x4f1068;};'use strict';var Sequelize=require(_0x21f6('0x0'));module[_0x21f6('0x1')]={'type':{'type':Sequelize[_0x21f6('0x2')]('string','variable','customVariable',_0x21f6('0x3'),_0x21f6('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x21f6('0x5')]},'key':{'type':Sequelize[_0x21f6('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x21f6('0x6'),_0x21f6('0x7'),_0x21f6('0x8'))},'keyContent':{'type':Sequelize[_0x21f6('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x21f6('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x21f6('0x5')]}}; \ No newline at end of file +var _0xe2cf=['ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN','sequelize','exports'];(function(_0x46ac77,_0x4620e1){var _0x320a1b=function(_0x272467){while(--_0x272467){_0x46ac77['push'](_0x46ac77['shift']());}};_0x320a1b(++_0x4620e1);}(_0xe2cf,0x181));var _0xfe2c=function(_0x2fdce0,_0x496242){_0x2fdce0=_0x2fdce0-0x0;var _0x36f07e=_0xe2cf[_0x2fdce0];return _0x36f07e;};'use strict';var Sequelize=require(_0xfe2c('0x0'));module[_0xfe2c('0x1')]={'type':{'type':Sequelize[_0xfe2c('0x2')](_0xfe2c('0x3'),_0xfe2c('0x4'),_0xfe2c('0x5'),_0xfe2c('0x6'),'picklist'),'defaultValue':_0xfe2c('0x3')},'content':{'type':Sequelize[_0xfe2c('0x7')]},'key':{'type':Sequelize[_0xfe2c('0x7')]},'keyType':{'type':Sequelize[_0xfe2c('0x2')]('string',_0xfe2c('0x4'),_0xfe2c('0x5'))},'keyContent':{'type':Sequelize[_0xfe2c('0x7')]},'idField':{'type':Sequelize[_0xfe2c('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xfe2c('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index fd78fe7..80f065f 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 _0x9206=['util','path','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','DeskField','fieldName','key','model','map','keys','intersection','query','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','filter','merge','type','VIRTUAL','options','findAll','catch','show','params','length','includeAll','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x511bd1,_0x223e5b){var _0x4c48ec=function(_0x31814e){while(--_0x31814e){_0x511bd1['push'](_0x511bd1['shift']());}};_0x4c48ec(++_0x223e5b);}(_0x9206,0x176));var _0x6920=function(_0x1343fb,_0x162991){_0x1343fb=_0x1343fb-0x0;var _0xf6d216=_0x9206[_0x1343fb];return _0xf6d216;};'use strict';var emlformat=require(_0x6920('0x0'));var rimraf=require(_0x6920('0x1'));var zipdir=require(_0x6920('0x2'));var jsonpatch=require(_0x6920('0x3'));var rp=require(_0x6920('0x4'));var moment=require(_0x6920('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6920('0x6'));var path=require(_0x6920('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6920('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6920('0x9'));var squel=require(_0x6920('0xa'));var crypto=require(_0x6920('0xb'));var jsforce=require(_0x6920('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6920('0xd'));var Papa=require(_0x6920('0xe'));var Redis=require(_0x6920('0xf'));var authService=require(_0x6920('0x10'));var qs=require(_0x6920('0x11'));var as=require(_0x6920('0x12'));var hardwareService=require(_0x6920('0x13'));var logger=require(_0x6920('0x14'))(_0x6920('0x15'));var utils=require(_0x6920('0x16'));var config=require(_0x6920('0x17'));var licenseUtil=require(_0x6920('0x18'));var db=require(_0x6920('0x19'))['db'];function respondWithStatusCode(_0x5ad438,_0x4f8430){_0x4f8430=_0x4f8430||0xcc;return function(_0x31730c){if(_0x31730c){return _0x5ad438[_0x6920('0x1a')](_0x4f8430);}return _0x5ad438['status'](_0x4f8430)[_0x6920('0x1b')]();};}function respondWithResult(_0xfa2823,_0x18140a){_0x18140a=_0x18140a||0xc8;return function(_0x2c3a35){if(_0x2c3a35){return _0xfa2823[_0x6920('0x1c')](_0x18140a)['json'](_0x2c3a35);}};}function respondWithFilteredResult(_0x338e5f,_0x20cdfb){return function(_0x15d8af){if(_0x15d8af){var _0xa64034=typeof _0x20cdfb[_0x6920('0x1d')]===_0x6920('0x1e')&&typeof _0x20cdfb[_0x6920('0x1f')]===_0x6920('0x1e');var _0x11ce91=_0x15d8af[_0x6920('0x20')];var _0x462500=_0xa64034?0x0:_0x20cdfb[_0x6920('0x1d')];var _0xc6e86b=_0xa64034?_0x15d8af[_0x6920('0x20')]:_0x20cdfb[_0x6920('0x1d')]+_0x20cdfb['limit'];var _0x3a0c0c;if(_0xc6e86b>=_0x11ce91){_0xc6e86b=_0x11ce91;_0x3a0c0c=0xc8;}else{_0x3a0c0c=0xce;}_0x338e5f[_0x6920('0x1c')](_0x3a0c0c);return _0x338e5f[_0x6920('0x21')](_0x6920('0x22'),_0x462500+'-'+_0xc6e86b+'/'+_0x11ce91)[_0x6920('0x23')](_0x15d8af);}return null;};}function patchUpdates(_0x16cb96){return function(_0x2cce0b){try{jsonpatch[_0x6920('0x24')](_0x2cce0b,_0x16cb96,!![]);}catch(_0xaf93ba){return BPromise[_0x6920('0x25')](_0xaf93ba);}return _0x2cce0b[_0x6920('0x26')]();};}function saveUpdates(_0x39013e,_0x1df372){return function(_0x2dd788){if(_0x2dd788){return _0x2dd788[_0x6920('0x27')](_0x39013e)[_0x6920('0x28')](function(_0x1ae686){return _0x1ae686;});}return null;};}function removeEntity(_0x3a6e48,_0xa8f55){return function(_0x258986){if(_0x258986){return _0x258986['destroy']()[_0x6920('0x28')](function(){_0x3a6e48['status'](0xcc)[_0x6920('0x1b')]();});}};}function handleEntityNotFound(_0x4dd08b,_0x72316a){return function(_0x32a6ae){if(!_0x32a6ae){_0x4dd08b[_0x6920('0x1a')](0x194);}return _0x32a6ae;};}function handleError(_0xd069c,_0x5868e1){_0x5868e1=_0x5868e1||0x1f4;return function(_0x1cab00){logger[_0x6920('0x29')](_0x1cab00[_0x6920('0x2a')]);if(_0x1cab00[_0x6920('0x2b')]){delete _0x1cab00[_0x6920('0x2b')];}_0xd069c[_0x6920('0x1c')](_0x5868e1)[_0x6920('0x2c')](_0x1cab00);};}exports[_0x6920('0x2d')]=function(_0x400894,_0x2f5ce8){var _0x6860c7={},_0x2b2cd9={},_0x548fbc={'count':0x0,'rows':[]};var _0x182f1b=_['map'](db[_0x6920('0x2e')]['rawAttributes'],function(_0x31aa90){return{'name':_0x31aa90[_0x6920('0x2f')],'type':_0x31aa90['type'][_0x6920('0x30')]};});_0x2b2cd9[_0x6920('0x31')]=_[_0x6920('0x32')](_0x182f1b,'name');_0x2b2cd9['query']=_[_0x6920('0x33')](_0x400894['query']);_0x2b2cd9['filters']=_[_0x6920('0x34')](_0x2b2cd9[_0x6920('0x31')],_0x2b2cd9[_0x6920('0x35')]);_0x6860c7[_0x6920('0x36')]=_[_0x6920('0x34')](_0x2b2cd9[_0x6920('0x31')],qs[_0x6920('0x37')](_0x400894['query'][_0x6920('0x37')]));_0x6860c7['attributes']=_0x6860c7[_0x6920('0x36')]['length']?_0x6860c7['attributes']:_0x2b2cd9[_0x6920('0x31')];if(!_0x400894[_0x6920('0x35')][_0x6920('0x38')](_0x6920('0x39'))){_0x6860c7[_0x6920('0x1f')]=qs[_0x6920('0x1f')](_0x400894[_0x6920('0x35')][_0x6920('0x1f')]);_0x6860c7[_0x6920('0x1d')]=qs[_0x6920('0x1d')](_0x400894[_0x6920('0x35')][_0x6920('0x1d')]);}_0x6860c7['order']=qs[_0x6920('0x3a')](_0x400894['query'][_0x6920('0x3a')]);_0x6860c7[_0x6920('0x3b')]=qs[_0x6920('0x3c')](_['pick'](_0x400894[_0x6920('0x35')],_0x2b2cd9[_0x6920('0x3c')]),_0x182f1b);if(_0x400894[_0x6920('0x35')][_0x6920('0x3d')]){_0x6860c7['where']=_[_0x6920('0x3e')](_0x6860c7[_0x6920('0x3b')],{'$or':_['map'](_0x182f1b,function(_0x49be52){if(_0x49be52[_0x6920('0x3f')]!==_0x6920('0x40')){var _0x56ca8f={};_0x56ca8f[_0x49be52[_0x6920('0x2b')]]={'$like':'%'+_0x400894[_0x6920('0x35')]['filter']+'%'};return _0x56ca8f;}})});}_0x6860c7=_['merge']({},_0x6860c7,_0x400894[_0x6920('0x41')]);var _0x1f0c5f={'where':_0x6860c7[_0x6920('0x3b')]};return db[_0x6920('0x2e')][_0x6920('0x20')](_0x1f0c5f)['then'](function(_0x58f0e8){_0x548fbc['count']=_0x58f0e8;if(_0x400894[_0x6920('0x35')]['includeAll']){_0x6860c7['include']=[{'all':!![]}];}return db[_0x6920('0x2e')][_0x6920('0x42')](_0x6860c7);})['then'](function(_0x3aad11){_0x548fbc['rows']=_0x3aad11;return _0x548fbc;})[_0x6920('0x28')](respondWithFilteredResult(_0x2f5ce8,_0x6860c7))[_0x6920('0x43')](handleError(_0x2f5ce8,null));};exports[_0x6920('0x44')]=function(_0x1b3ebb,_0x3a994d){var _0x55d7b5={'raw':!![],'where':{'id':_0x1b3ebb[_0x6920('0x45')]['id']}},_0x4dfa0c={};_0x4dfa0c['model']=_['keys'](db['DeskField']['rawAttributes']);_0x4dfa0c[_0x6920('0x35')]=_[_0x6920('0x33')](_0x1b3ebb[_0x6920('0x35')]);_0x4dfa0c['filters']=_[_0x6920('0x34')](_0x4dfa0c[_0x6920('0x31')],_0x4dfa0c[_0x6920('0x35')]);_0x55d7b5[_0x6920('0x36')]=_[_0x6920('0x34')](_0x4dfa0c[_0x6920('0x31')],qs['fields'](_0x1b3ebb[_0x6920('0x35')][_0x6920('0x37')]));_0x55d7b5[_0x6920('0x36')]=_0x55d7b5[_0x6920('0x36')][_0x6920('0x46')]?_0x55d7b5[_0x6920('0x36')]:_0x4dfa0c[_0x6920('0x31')];if(_0x1b3ebb[_0x6920('0x35')][_0x6920('0x47')]){_0x55d7b5[_0x6920('0x48')]=[{'all':!![]}];}_0x55d7b5=_[_0x6920('0x3e')]({},_0x55d7b5,_0x1b3ebb[_0x6920('0x41')]);return db['DeskField'][_0x6920('0x49')](_0x55d7b5)[_0x6920('0x28')](handleEntityNotFound(_0x3a994d,null))['then'](respondWithResult(_0x3a994d,null))['catch'](handleError(_0x3a994d,null));};exports[_0x6920('0x4a')]=function(_0x3c231e,_0x20fab4){return db[_0x6920('0x2e')][_0x6920('0x4a')](_0x3c231e['body'],{})[_0x6920('0x28')](respondWithResult(_0x20fab4,0xc9))[_0x6920('0x43')](handleError(_0x20fab4,null));};exports[_0x6920('0x27')]=function(_0x51b12d,_0x4d1c79){if(_0x51b12d[_0x6920('0x4b')]['id']){delete _0x51b12d[_0x6920('0x4b')]['id'];}return db[_0x6920('0x2e')][_0x6920('0x49')]({'where':{'id':_0x51b12d['params']['id']}})[_0x6920('0x28')](handleEntityNotFound(_0x4d1c79,null))[_0x6920('0x28')](saveUpdates(_0x51b12d[_0x6920('0x4b')],null))[_0x6920('0x28')](respondWithResult(_0x4d1c79,null))[_0x6920('0x43')](handleError(_0x4d1c79,null));};exports['destroy']=function(_0x1c0dd9,_0x3fe81d){return db[_0x6920('0x2e')][_0x6920('0x49')]({'where':{'id':_0x1c0dd9[_0x6920('0x45')]['id']}})[_0x6920('0x28')](handleEntityNotFound(_0x3fe81d,null))[_0x6920('0x28')](removeEntity(_0x3fe81d,null))[_0x6920('0x43')](handleError(_0x3fe81d,null));}; \ No newline at end of file +var _0xe742=['papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','DeskField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','find','create','body','zip-dir','fast-json-patch','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring'];(function(_0x400cd3,_0x3993a1){var _0x16327f=function(_0x37293a){while(--_0x37293a){_0x400cd3['push'](_0x400cd3['shift']());}};_0x16327f(++_0x3993a1);}(_0xe742,0x14d));var _0x2e74=function(_0x8fd9a4,_0x56b1d1){_0x8fd9a4=_0x8fd9a4-0x0;var _0x4b1320=_0xe742[_0x8fd9a4];return _0x4b1320;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2e74('0x0'));var jsonpatch=require(_0x2e74('0x1'));var rp=require('request-promise');var moment=require(_0x2e74('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x2e74('0x3'));var util=require('util');var path=require('path');var sox=require(_0x2e74('0x4'));var csv=require(_0x2e74('0x5'));var ejs=require(_0x2e74('0x6'));var fs=require('fs');var fs_extra=require(_0x2e74('0x7'));var _=require(_0x2e74('0x8'));var squel=require(_0x2e74('0x9'));var crypto=require('crypto');var jsforce=require(_0x2e74('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x2e74('0x5'));var querystring=require(_0x2e74('0xb'));var Papa=require(_0x2e74('0xc'));var Redis=require(_0x2e74('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2e74('0xe'));var logger=require(_0x2e74('0xf'))(_0x2e74('0x10'));var utils=require(_0x2e74('0x11'));var config=require(_0x2e74('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x56f662,_0x152004){_0x152004=_0x152004||0xcc;return function(_0x31e57f){if(_0x31e57f){return _0x56f662[_0x2e74('0x13')](_0x152004);}return _0x56f662[_0x2e74('0x14')](_0x152004)[_0x2e74('0x15')]();};}function respondWithResult(_0x5927ad,_0xfd043f){_0xfd043f=_0xfd043f||0xc8;return function(_0x5db4b8){if(_0x5db4b8){return _0x5927ad['status'](_0xfd043f)['json'](_0x5db4b8);}};}function respondWithFilteredResult(_0x5e619f,_0x2334df){return function(_0x10d0ef){if(_0x10d0ef){var _0xe37538=typeof _0x2334df[_0x2e74('0x16')]===_0x2e74('0x17')&&typeof _0x2334df[_0x2e74('0x18')]==='undefined';var _0xcd771e=_0x10d0ef[_0x2e74('0x19')];var _0x80775b=_0xe37538?0x0:_0x2334df[_0x2e74('0x16')];var _0x154ef8=_0xe37538?_0x10d0ef[_0x2e74('0x19')]:_0x2334df['offset']+_0x2334df['limit'];var _0x5570d2;if(_0x154ef8>=_0xcd771e){_0x154ef8=_0xcd771e;_0x5570d2=0xc8;}else{_0x5570d2=0xce;}_0x5e619f[_0x2e74('0x14')](_0x5570d2);return _0x5e619f['set'](_0x2e74('0x1a'),_0x80775b+'-'+_0x154ef8+'/'+_0xcd771e)['json'](_0x10d0ef);}return null;};}function patchUpdates(_0x11079c){return function(_0x420604){try{jsonpatch[_0x2e74('0x1b')](_0x420604,_0x11079c,!![]);}catch(_0x26bf85){return BPromise[_0x2e74('0x1c')](_0x26bf85);}return _0x420604[_0x2e74('0x1d')]();};}function saveUpdates(_0x7aab69,_0x216841){return function(_0x4b2565){if(_0x4b2565){return _0x4b2565[_0x2e74('0x1e')](_0x7aab69)[_0x2e74('0x1f')](function(_0x3e6339){return _0x3e6339;});}return null;};}function removeEntity(_0x59c88b,_0x35e547){return function(_0x5c8554){if(_0x5c8554){return _0x5c8554[_0x2e74('0x20')]()[_0x2e74('0x1f')](function(){_0x59c88b[_0x2e74('0x14')](0xcc)[_0x2e74('0x15')]();});}};}function handleEntityNotFound(_0x3db17a,_0x1b8b56){return function(_0x44d79b){if(!_0x44d79b){_0x3db17a[_0x2e74('0x13')](0x194);}return _0x44d79b;};}function handleError(_0x4cfb14,_0x10b4b6){_0x10b4b6=_0x10b4b6||0x1f4;return function(_0xe08fe2){logger[_0x2e74('0x21')](_0xe08fe2[_0x2e74('0x22')]);if(_0xe08fe2[_0x2e74('0x23')]){delete _0xe08fe2[_0x2e74('0x23')];}_0x4cfb14['status'](_0x10b4b6)[_0x2e74('0x24')](_0xe08fe2);};}exports[_0x2e74('0x25')]=function(_0x159a88,_0x210ab4){var _0x3b6ff2={},_0x2d3f49={},_0x2fa236={'count':0x0,'rows':[]};var _0x40f5b3=_[_0x2e74('0x26')](db[_0x2e74('0x27')][_0x2e74('0x28')],function(_0x326198){return{'name':_0x326198[_0x2e74('0x29')],'type':_0x326198[_0x2e74('0x2a')][_0x2e74('0x2b')]};});_0x2d3f49['model']=_[_0x2e74('0x26')](_0x40f5b3,_0x2e74('0x23'));_0x2d3f49[_0x2e74('0x2c')]=_[_0x2e74('0x2d')](_0x159a88[_0x2e74('0x2c')]);_0x2d3f49[_0x2e74('0x2e')]=_[_0x2e74('0x2f')](_0x2d3f49[_0x2e74('0x30')],_0x2d3f49[_0x2e74('0x2c')]);_0x3b6ff2['attributes']=_[_0x2e74('0x2f')](_0x2d3f49[_0x2e74('0x30')],qs[_0x2e74('0x31')](_0x159a88[_0x2e74('0x2c')][_0x2e74('0x31')]));_0x3b6ff2['attributes']=_0x3b6ff2[_0x2e74('0x32')][_0x2e74('0x33')]?_0x3b6ff2[_0x2e74('0x32')]:_0x2d3f49['model'];if(!_0x159a88[_0x2e74('0x2c')][_0x2e74('0x34')](_0x2e74('0x35'))){_0x3b6ff2[_0x2e74('0x18')]=qs[_0x2e74('0x18')](_0x159a88[_0x2e74('0x2c')]['limit']);_0x3b6ff2[_0x2e74('0x16')]=qs['offset'](_0x159a88[_0x2e74('0x2c')]['offset']);}_0x3b6ff2['order']=qs['sort'](_0x159a88['query'][_0x2e74('0x36')]);_0x3b6ff2[_0x2e74('0x37')]=qs[_0x2e74('0x2e')](_['pick'](_0x159a88[_0x2e74('0x2c')],_0x2d3f49[_0x2e74('0x2e')]),_0x40f5b3);if(_0x159a88[_0x2e74('0x2c')][_0x2e74('0x38')]){_0x3b6ff2[_0x2e74('0x37')]=_[_0x2e74('0x39')](_0x3b6ff2[_0x2e74('0x37')],{'$or':_[_0x2e74('0x26')](_0x40f5b3,function(_0x49e915){if(_0x49e915[_0x2e74('0x2a')]!==_0x2e74('0x3a')){var _0x2b9d96={};_0x2b9d96[_0x49e915[_0x2e74('0x23')]]={'$like':'%'+_0x159a88['query'][_0x2e74('0x38')]+'%'};return _0x2b9d96;}})});}_0x3b6ff2=_[_0x2e74('0x39')]({},_0x3b6ff2,_0x159a88['options']);var _0x35968c={'where':_0x3b6ff2[_0x2e74('0x37')]};return db['DeskField']['count'](_0x35968c)['then'](function(_0x1bae1e){_0x2fa236[_0x2e74('0x19')]=_0x1bae1e;if(_0x159a88[_0x2e74('0x2c')][_0x2e74('0x3b')]){_0x3b6ff2[_0x2e74('0x3c')]=[{'all':!![]}];}return db[_0x2e74('0x27')][_0x2e74('0x3d')](_0x3b6ff2);})[_0x2e74('0x1f')](function(_0x53a5b9){_0x2fa236[_0x2e74('0x3e')]=_0x53a5b9;return _0x2fa236;})[_0x2e74('0x1f')](respondWithFilteredResult(_0x210ab4,_0x3b6ff2))[_0x2e74('0x3f')](handleError(_0x210ab4,null));};exports[_0x2e74('0x40')]=function(_0x446468,_0x436677){var _0x14873b={'raw':!![],'where':{'id':_0x446468[_0x2e74('0x41')]['id']}},_0x32499f={};_0x32499f[_0x2e74('0x30')]=_[_0x2e74('0x2d')](db['DeskField']['rawAttributes']);_0x32499f[_0x2e74('0x2c')]=_[_0x2e74('0x2d')](_0x446468['query']);_0x32499f[_0x2e74('0x2e')]=_['intersection'](_0x32499f[_0x2e74('0x30')],_0x32499f[_0x2e74('0x2c')]);_0x14873b['attributes']=_[_0x2e74('0x2f')](_0x32499f[_0x2e74('0x30')],qs[_0x2e74('0x31')](_0x446468[_0x2e74('0x2c')][_0x2e74('0x31')]));_0x14873b[_0x2e74('0x32')]=_0x14873b[_0x2e74('0x32')]['length']?_0x14873b[_0x2e74('0x32')]:_0x32499f[_0x2e74('0x30')];if(_0x446468[_0x2e74('0x2c')]['includeAll']){_0x14873b[_0x2e74('0x3c')]=[{'all':!![]}];}_0x14873b=_[_0x2e74('0x39')]({},_0x14873b,_0x446468['options']);return db[_0x2e74('0x27')][_0x2e74('0x42')](_0x14873b)[_0x2e74('0x1f')](handleEntityNotFound(_0x436677,null))['then'](respondWithResult(_0x436677,null))[_0x2e74('0x3f')](handleError(_0x436677,null));};exports[_0x2e74('0x43')]=function(_0x190aaf,_0x2b6a5d){return db[_0x2e74('0x27')]['create'](_0x190aaf['body'],{})[_0x2e74('0x1f')](respondWithResult(_0x2b6a5d,0xc9))[_0x2e74('0x3f')](handleError(_0x2b6a5d,null));};exports[_0x2e74('0x1e')]=function(_0x50d7f7,_0x405b20){if(_0x50d7f7[_0x2e74('0x44')]['id']){delete _0x50d7f7['body']['id'];}return db[_0x2e74('0x27')][_0x2e74('0x42')]({'where':{'id':_0x50d7f7['params']['id']}})[_0x2e74('0x1f')](handleEntityNotFound(_0x405b20,null))[_0x2e74('0x1f')](saveUpdates(_0x50d7f7[_0x2e74('0x44')],null))['then'](respondWithResult(_0x405b20,null))['catch'](handleError(_0x405b20,null));};exports[_0x2e74('0x20')]=function(_0x4ca81a,_0x541c71){return db[_0x2e74('0x27')][_0x2e74('0x42')]({'where':{'id':_0x4ca81a[_0x2e74('0x41')]['id']}})[_0x2e74('0x1f')](handleEntityNotFound(_0x541c71,null))[_0x2e74('0x1f')](removeEntity(_0x541c71,null))['catch'](handleError(_0x541c71,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 57de8e0..a694658 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 _0xb1b0=['idField','FieldId','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','define','DeskField','int_desk_fields','desk_unique_index'];(function(_0x385eee,_0x270cca){var _0x41fd49=function(_0x6bb501){while(--_0x6bb501){_0x385eee['push'](_0x385eee['shift']());}};_0x41fd49(++_0x270cca);}(_0xb1b0,0xa7));var _0x0b1b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb1b0[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x0b1b('0x0'));var util=require('util');var logger=require(_0x0b1b('0x1'))('api');var moment=require(_0x0b1b('0x2'));var BPromise=require(_0x0b1b('0x3'));var rp=require(_0x0b1b('0x4'));var fs=require('fs');var path=require(_0x0b1b('0x5'));var rimraf=require(_0x0b1b('0x6'));var config=require(_0x0b1b('0x7'));var attributes=require(_0x0b1b('0x8'));module['exports']=function(_0x5515c0,_0xd590c2){return _0x5515c0[_0x0b1b('0x9')](_0x0b1b('0xa'),attributes,{'tableName':_0x0b1b('0xb'),'paranoid':![],'indexes':[{'name':_0x0b1b('0xc'),'fields':[_0x0b1b('0xd'),_0x0b1b('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5102=['path','../../config/environment','define','int_desk_fields','desk_unique_index','idField','../../config/logger','moment','request-promise'];(function(_0x55a648,_0x4d2dd5){var _0x3c00fd=function(_0x1a2706){while(--_0x1a2706){_0x55a648['push'](_0x55a648['shift']());}};_0x3c00fd(++_0x4d2dd5);}(_0x5102,0x126));var _0x2510=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x5102[_0x4fde08];return _0x12e725;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2510('0x0'))('api');var moment=require(_0x2510('0x1'));var BPromise=require('bluebird');var rp=require(_0x2510('0x2'));var fs=require('fs');var path=require(_0x2510('0x3'));var rimraf=require('rimraf');var config=require(_0x2510('0x4'));var attributes=require('./intDeskField.attributes');module['exports']=function(_0x2a8938,_0x14518b){return _0x2a8938[_0x2510('0x5')]('DeskField',attributes,{'tableName':_0x2510('0x6'),'paranoid':![],'indexes':[{'name':_0x2510('0x7'),'fields':[_0x2510('0x8'),'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 20c3d17..a199e12 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 _0x291c=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskField,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','lodash','util','moment','bluebird','ioredis','../../config/utils'];(function(_0x45c0da,_0x4f9492){var _0x51efff=function(_0x53b3b2){while(--_0x53b3b2){_0x45c0da['push'](_0x45c0da['shift']());}};_0x51efff(++_0x4f9492);}(_0x291c,0x144));var _0xc291=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x291c[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0xc291('0x0'));var util=require(_0xc291('0x1'));var moment=require(_0xc291('0x2'));var BPromise=require(_0xc291('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc291('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc291('0x5'));var logger=require(_0xc291('0x6'))(_0xc291('0x7'));var config=require(_0xc291('0x8'));var jayson=require(_0xc291('0x9'));var client=jayson[_0xc291('0xa')][_0xc291('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x8bd2f2,_0x4c5e84,_0x542478){return new BPromise(function(_0x1682a4,_0x4b9314){return client[_0xc291('0xc')](_0x8bd2f2,_0x542478)[_0xc291('0xd')](function(_0x368b6c){logger[_0xc291('0xe')](_0xc291('0xf'),_0x4c5e84,'request\x20sent');logger[_0xc291('0x10')]('DeskField,\x20%s,\x20%s,\x20%s',_0x4c5e84,_0xc291('0x11'),JSON[_0xc291('0x12')](_0x368b6c));if(_0x368b6c[_0xc291('0x13')]){if(_0x368b6c['error']['code']===0x1f4){logger[_0xc291('0x13')]('DeskField,\x20%s,\x20%s',_0x4c5e84,_0x368b6c[_0xc291('0x13')][_0xc291('0x14')]);return _0x4b9314(_0x368b6c[_0xc291('0x13')]['message']);}logger[_0xc291('0x13')](_0xc291('0xf'),_0x4c5e84,_0x368b6c['error'][_0xc291('0x14')]);return _0x1682a4(_0x368b6c[_0xc291('0x13')][_0xc291('0x14')]);}else{logger[_0xc291('0xe')]('DeskField,\x20%s,\x20%s',_0x4c5e84,_0xc291('0x11'));_0x1682a4(_0x368b6c[_0xc291('0x15')][_0xc291('0x14')]);}})['catch'](function(_0x1e5947){logger[_0xc291('0x13')](_0xc291('0xf'),_0x4c5e84,_0x1e5947);_0x4b9314(_0x1e5947);});});} \ No newline at end of file +var _0x51af=['DeskField,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info'];(function(_0x17cd6b,_0x413d0b){var _0x2d29f0=function(_0x16f682){while(--_0x16f682){_0x17cd6b['push'](_0x17cd6b['shift']());}};_0x2d29f0(++_0x413d0b);}(_0x51af,0x92));var _0xf51a=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x51af[_0x1928c9];return _0x51b5fb;};'use strict';var _=require(_0xf51a('0x0'));var util=require(_0xf51a('0x1'));var moment=require(_0xf51a('0x2'));var BPromise=require(_0xf51a('0x3'));var rs=require(_0xf51a('0x4'));var fs=require('fs');var Redis=require(_0xf51a('0x5'));var db=require(_0xf51a('0x6'))['db'];var utils=require(_0xf51a('0x7'));var logger=require(_0xf51a('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf51a('0x9'));var client=jayson[_0xf51a('0xa')][_0xf51a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5daa9f,_0x1b0a15,_0xa736f2){return new BPromise(function(_0x4b13af,_0x1b5fb9){return client[_0xf51a('0xc')](_0x5daa9f,_0xa736f2)[_0xf51a('0xd')](function(_0x2de074){logger[_0xf51a('0xe')](_0xf51a('0xf'),_0x1b0a15,_0xf51a('0x10'));logger['debug']('DeskField,\x20%s,\x20%s,\x20%s',_0x1b0a15,'request\x20sent',JSON[_0xf51a('0x11')](_0x2de074));if(_0x2de074[_0xf51a('0x12')]){if(_0x2de074[_0xf51a('0x12')][_0xf51a('0x13')]===0x1f4){logger['error']('DeskField,\x20%s,\x20%s',_0x1b0a15,_0x2de074[_0xf51a('0x12')][_0xf51a('0x14')]);return _0x1b5fb9(_0x2de074[_0xf51a('0x12')][_0xf51a('0x14')]);}logger[_0xf51a('0x12')](_0xf51a('0xf'),_0x1b0a15,_0x2de074[_0xf51a('0x12')][_0xf51a('0x14')]);return _0x4b13af(_0x2de074['error'][_0xf51a('0x14')]);}else{logger[_0xf51a('0xe')](_0xf51a('0xf'),_0x1b0a15,_0xf51a('0x10'));_0x4b13af(_0x2de074[_0xf51a('0x15')]['message']);}})[_0xf51a('0x16')](function(_0xd25ed7){logger[_0xf51a('0x12')](_0xf51a('0xf'),_0x1b0a15,_0xd25ed7);_0x1b5fb9(_0xd25ed7);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 38d9fb8..8384161 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 _0x88cd=['addConfiguration','put','/:id','exports','util','express','Router','fs-extra','../../config/environment','./intDynamics365Account.controller','isAuthenticated','get','/:id/configurations','getConfigurations','post','create'];(function(_0x2f5d75,_0x297b02){var _0x10d62b=function(_0x1771e3){while(--_0x1771e3){_0x2f5d75['push'](_0x2f5d75['shift']());}};_0x10d62b(++_0x297b02);}(_0x88cd,0xd4));var _0xd88c=function(_0x536f07,_0x5cebb2){_0x536f07=_0x536f07-0x0;var _0x6ff79f=_0x88cd[_0x536f07];return _0x6ff79f;};'use strict';var multer=require('multer');var util=require(_0xd88c('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd88c('0x1'));var router=express[_0xd88c('0x2')]();var fs_extra=require(_0xd88c('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd88c('0x4'));var controller=require(_0xd88c('0x5'));router['get']('/',auth[_0xd88c('0x6')](),controller['index']);router[_0xd88c('0x7')]('/:id',auth[_0xd88c('0x6')](),controller['show']);router[_0xd88c('0x7')](_0xd88c('0x8'),auth[_0xd88c('0x6')](),controller[_0xd88c('0x9')]);router[_0xd88c('0x7')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0xd88c('0xa')]('/',auth[_0xd88c('0x6')](),controller[_0xd88c('0xb')]);router['post']('/:id/configurations',auth[_0xd88c('0x6')](),controller[_0xd88c('0xc')]);router[_0xd88c('0xd')](_0xd88c('0xe'),auth[_0xd88c('0x6')](),controller['update']);router['delete'](_0xd88c('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0xd88c('0xf')]=router; \ No newline at end of file +var _0x642b=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','/:id','show','/:id/configurations','isAuthenticated','getConfigurations','/:id/fields','getFields','post','create','put','update','delete','exports','util','path','connect-timeout','express','Router'];(function(_0xb8cb15,_0x229184){var _0x289718=function(_0x630fec){while(--_0x630fec){_0xb8cb15['push'](_0xb8cb15['shift']());}};_0x289718(++_0x229184);}(_0x642b,0x16b));var _0xb642=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x642b[_0x167cc1];return _0x10bc4b;};'use strict';var multer=require('multer');var util=require(_0xb642('0x0'));var path=require(_0xb642('0x1'));var timeout=require(_0xb642('0x2'));var express=require(_0xb642('0x3'));var router=express[_0xb642('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb642('0x5'));var interaction=require(_0xb642('0x6'));var config=require(_0xb642('0x7'));var controller=require(_0xb642('0x8'));router[_0xb642('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb642('0x9')](_0xb642('0xa'),auth['isAuthenticated'](),controller[_0xb642('0xb')]);router[_0xb642('0x9')](_0xb642('0xc'),auth[_0xb642('0xd')](),controller[_0xb642('0xe')]);router[_0xb642('0x9')](_0xb642('0xf'),auth[_0xb642('0xd')](),controller[_0xb642('0x10')]);router[_0xb642('0x11')]('/',auth['isAuthenticated'](),controller[_0xb642('0x12')]);router['post'](_0xb642('0xc'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0xb642('0x13')](_0xb642('0xa'),auth[_0xb642('0xd')](),controller[_0xb642('0x14')]);router[_0xb642('0x15')](_0xb642('0xa'),auth[_0xb642('0xd')](),controller['destroy']);module[_0xb642('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index dd1b170..7d2144b 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 _0xf2b0=['exports','STRING','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf2b0,0x155));var _0x0f2b=function(_0x3d7c68,_0x40a266){_0x3d7c68=_0x3d7c68-0x0;var _0x53e025=_0xf2b0[_0x3d7c68];return _0x53e025;};'use strict';var Sequelize=require(_0x0f2b('0x0'));module[_0x0f2b('0x1')]={'name':{'type':Sequelize[_0x0f2b('0x2')]},'username':{'type':Sequelize[_0x0f2b('0x2')]},'password':{'type':Sequelize[_0x0f2b('0x2')]},'remoteUri':{'type':Sequelize[_0x0f2b('0x2')]},'tenantId':{'type':Sequelize[_0x0f2b('0x2')]},'clientId':{'type':Sequelize[_0x0f2b('0x2')]},'clientSecret':{'type':Sequelize[_0x0f2b('0x2')]},'serverUrl':{'type':Sequelize[_0x0f2b('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x0f2b('0x2')]}}; \ No newline at end of file +var _0x8378=['STRING'];(function(_0x3608c8,_0x17081a){var _0x3d1362=function(_0x40f2d2){while(--_0x40f2d2){_0x3608c8['push'](_0x3608c8['shift']());}};_0x3d1362(++_0x17081a);}(_0x8378,0x17e));var _0x8837=function(_0x1f1f75,_0x4a9588){_0x1f1f75=_0x1f1f75-0x0;var _0x3d3924=_0x8378[_0x1f1f75];return _0x3d3924;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8837('0x0')]},'username':{'type':Sequelize[_0x8837('0x0')]},'password':{'type':Sequelize[_0x8837('0x0')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x8837('0x0')]},'serverUrl':{'type':Sequelize[_0x8837('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x8837('0x0')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index f98d17d..3efe36d 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 _0x4fde=[')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','undefined','count','offset','limit','set','Content-Range','json','reject','then','sendStatus','error','stack','name','send','index','Dynamics365Account','rawAttributes','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','find','create','body','update','params','destroy','getConfigurations','findOne','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','Dynamics365Configuration','Dynamics365Field','getFields','ticketType','incident','Incident','PhoneCall','title','description','customerid','ownerid','caseorigincode','subject','phonenumber','directioncode','phonecall_activity_parties','accountidyominame','actualserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','customeridname','entitlementidname','escalatedon','exchangerate','firstresponsebykpiidname','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','modifiedbyexternalpartyname','modifiedbyname','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','transactioncurrencyidname','utcconversiontimezonecode','versionnumber','username','password','remoteUri','tenantId','clientId','clientSecret','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','/oauth2/token','access_token','GET','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','all','isNil','StringAttributeMetadata','DoubleAttributeMetadata','IntegerAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','test','statusCode','Wrong\x20credentials',')/Attributes(','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','UserLocalizedLabel','Label','DisplayName'];(function(_0xce5ec0,_0x5bc0db){var _0x9971a3=function(_0x56e7ec){while(--_0x56e7ec){_0xce5ec0['push'](_0xce5ec0['shift']());}};_0x9971a3(++_0x5bc0db);}(_0x4fde,0x19f));var _0xe4fd=function(_0x26d6d9,_0x431cb8){_0x26d6d9=_0x26d6d9-0x0;var _0x1b4875=_0x4fde[_0x26d6d9];return _0x1b4875;};'use strict';var emlformat=require(_0xe4fd('0x0'));var rimraf=require(_0xe4fd('0x1'));var zipdir=require(_0xe4fd('0x2'));var jsonpatch=require(_0xe4fd('0x3'));var rp=require('request-promise');var moment=require(_0xe4fd('0x4'));var BPromise=require(_0xe4fd('0x5'));var Mustache=require('mustache');var util=require(_0xe4fd('0x6'));var path=require(_0xe4fd('0x7'));var sox=require(_0xe4fd('0x8'));var csv=require(_0xe4fd('0x9'));var ejs=require(_0xe4fd('0xa'));var fs=require('fs');var fs_extra=require(_0xe4fd('0xb'));var _=require(_0xe4fd('0xc'));var squel=require(_0xe4fd('0xd'));var crypto=require(_0xe4fd('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xe4fd('0xf'));var toCsv=require('to-csv');var querystring=require(_0xe4fd('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe4fd('0x11'));var qs=require(_0xe4fd('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe4fd('0x13'))(_0xe4fd('0x14'));var utils=require(_0xe4fd('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xe4fd('0x16'));var db=require(_0xe4fd('0x17'))['db'];var integrations=require(_0xe4fd('0x18'));function respondWithStatusCode(_0xcedd85,_0x2faa76){_0x2faa76=_0x2faa76||0xcc;return function(_0x2df77c){if(_0x2df77c){return _0xcedd85['sendStatus'](_0x2faa76);}return _0xcedd85[_0xe4fd('0x19')](_0x2faa76)[_0xe4fd('0x1a')]();};}function respondWithResult(_0x5499c6,_0x5c88de){_0x5c88de=_0x5c88de||0xc8;return function(_0x2ae150){if(_0x2ae150){return _0x5499c6[_0xe4fd('0x19')](_0x5c88de)['json'](_0x2ae150);}};}function respondWithFilteredResult(_0x5578e1,_0x2bf08c){return function(_0x431150){if(_0x431150){var _0x23de5e=typeof _0x2bf08c['offset']===_0xe4fd('0x1b')&&typeof _0x2bf08c['limit']==='undefined';var _0x2c3bfc=_0x431150[_0xe4fd('0x1c')];var _0x326cc7=_0x23de5e?0x0:_0x2bf08c[_0xe4fd('0x1d')];var _0x1eb295=_0x23de5e?_0x431150['count']:_0x2bf08c[_0xe4fd('0x1d')]+_0x2bf08c[_0xe4fd('0x1e')];var _0x9f3663;if(_0x1eb295>=_0x2c3bfc){_0x1eb295=_0x2c3bfc;_0x9f3663=0xc8;}else{_0x9f3663=0xce;}_0x5578e1[_0xe4fd('0x19')](_0x9f3663);return _0x5578e1[_0xe4fd('0x1f')](_0xe4fd('0x20'),_0x326cc7+'-'+_0x1eb295+'/'+_0x2c3bfc)[_0xe4fd('0x21')](_0x431150);}return null;};}function patchUpdates(_0x30d545){return function(_0x43d3a4){try{jsonpatch['apply'](_0x43d3a4,_0x30d545,!![]);}catch(_0x2532bb){return BPromise[_0xe4fd('0x22')](_0x2532bb);}return _0x43d3a4['save']();};}function saveUpdates(_0x49aa8c,_0x5741dc){return function(_0x29c2d7){if(_0x29c2d7){return _0x29c2d7['update'](_0x49aa8c)[_0xe4fd('0x23')](function(_0x5941b5){return _0x5941b5;});}return null;};}function removeEntity(_0x261259,_0x394878){return function(_0xd4a22c){if(_0xd4a22c){return _0xd4a22c['destroy']()[_0xe4fd('0x23')](function(){_0x261259[_0xe4fd('0x19')](0xcc)[_0xe4fd('0x1a')]();});}};}function handleEntityNotFound(_0x40a748,_0x18901c){return function(_0x4bfdf7){if(!_0x4bfdf7){_0x40a748[_0xe4fd('0x24')](0x194);}return _0x4bfdf7;};}function handleError(_0x196fe8,_0xef9721){_0xef9721=_0xef9721||0x1f4;return function(_0x38f206){logger[_0xe4fd('0x25')](_0x38f206[_0xe4fd('0x26')]);if(_0x38f206[_0xe4fd('0x27')]){delete _0x38f206[_0xe4fd('0x27')];}_0x196fe8[_0xe4fd('0x19')](_0xef9721)[_0xe4fd('0x28')](_0x38f206);};}exports[_0xe4fd('0x29')]=function(_0x144c45,_0x92eed0){var _0x1507e8={},_0xf96ab0={},_0x22a304={'count':0x0,'rows':[]};var _0x392eba=_['map'](db[_0xe4fd('0x2a')][_0xe4fd('0x2b')],function(_0x8dcc87){return{'name':_0x8dcc87['fieldName'],'type':_0x8dcc87[_0xe4fd('0x2c')][_0xe4fd('0x2d')]};});_0xf96ab0[_0xe4fd('0x2e')]=_[_0xe4fd('0x2f')](_0x392eba,_0xe4fd('0x27'));_0xf96ab0['query']=_[_0xe4fd('0x30')](_0x144c45[_0xe4fd('0x31')]);_0xf96ab0[_0xe4fd('0x32')]=_[_0xe4fd('0x33')](_0xf96ab0[_0xe4fd('0x2e')],_0xf96ab0[_0xe4fd('0x31')]);_0x1507e8[_0xe4fd('0x34')]=_[_0xe4fd('0x33')](_0xf96ab0[_0xe4fd('0x2e')],qs[_0xe4fd('0x35')](_0x144c45[_0xe4fd('0x31')][_0xe4fd('0x35')]));_0x1507e8[_0xe4fd('0x34')]=_0x1507e8[_0xe4fd('0x34')][_0xe4fd('0x36')]?_0x1507e8[_0xe4fd('0x34')]:_0xf96ab0[_0xe4fd('0x2e')];if(!_0x144c45[_0xe4fd('0x31')][_0xe4fd('0x37')](_0xe4fd('0x38'))){_0x1507e8[_0xe4fd('0x1e')]=qs[_0xe4fd('0x1e')](_0x144c45[_0xe4fd('0x31')][_0xe4fd('0x1e')]);_0x1507e8[_0xe4fd('0x1d')]=qs['offset'](_0x144c45['query'][_0xe4fd('0x1d')]);}_0x1507e8[_0xe4fd('0x39')]=qs[_0xe4fd('0x3a')](_0x144c45[_0xe4fd('0x31')]['sort']);_0x1507e8[_0xe4fd('0x3b')]=qs[_0xe4fd('0x32')](_[_0xe4fd('0x3c')](_0x144c45[_0xe4fd('0x31')],_0xf96ab0[_0xe4fd('0x32')]),_0x392eba);if(_0x144c45[_0xe4fd('0x31')][_0xe4fd('0x3d')]){_0x1507e8[_0xe4fd('0x3b')]=_[_0xe4fd('0x3e')](_0x1507e8['where'],{'$or':_[_0xe4fd('0x2f')](_0x392eba,function(_0x583716){if(_0x583716[_0xe4fd('0x2c')]!==_0xe4fd('0x3f')){var _0x36d748={};_0x36d748[_0x583716[_0xe4fd('0x27')]]={'$like':'%'+_0x144c45[_0xe4fd('0x31')]['filter']+'%'};return _0x36d748;}})});}_0x1507e8=_[_0xe4fd('0x3e')]({},_0x1507e8,_0x144c45[_0xe4fd('0x40')]);var _0x598c6a={'where':_0x1507e8[_0xe4fd('0x3b')]};return db[_0xe4fd('0x2a')][_0xe4fd('0x1c')](_0x598c6a)['then'](function(_0x2b8859){_0x22a304[_0xe4fd('0x1c')]=_0x2b8859;if(_0x144c45[_0xe4fd('0x31')]['includeAll']){_0x1507e8[_0xe4fd('0x41')]=[{'all':!![]}];}return db[_0xe4fd('0x2a')][_0xe4fd('0x42')](_0x1507e8);})[_0xe4fd('0x23')](function(_0x596915){_0x22a304[_0xe4fd('0x43')]=_0x596915;return _0x22a304;})[_0xe4fd('0x23')](respondWithFilteredResult(_0x92eed0,_0x1507e8))[_0xe4fd('0x44')](handleError(_0x92eed0,null));};exports[_0xe4fd('0x45')]=function(_0x4ecf6d,_0x4f7a59){var _0x1601d5={'raw':![],'where':{'id':_0x4ecf6d['params']['id']}},_0x465b22={};_0x465b22[_0xe4fd('0x2e')]=_[_0xe4fd('0x30')](db[_0xe4fd('0x2a')][_0xe4fd('0x2b')]);_0x465b22[_0xe4fd('0x31')]=_[_0xe4fd('0x30')](_0x4ecf6d['query']);_0x465b22['filters']=_['intersection'](_0x465b22[_0xe4fd('0x2e')],_0x465b22[_0xe4fd('0x31')]);_0x1601d5[_0xe4fd('0x34')]=_[_0xe4fd('0x33')](_0x465b22[_0xe4fd('0x2e')],qs[_0xe4fd('0x35')](_0x4ecf6d[_0xe4fd('0x31')][_0xe4fd('0x35')]));_0x1601d5[_0xe4fd('0x34')]=_0x1601d5[_0xe4fd('0x34')][_0xe4fd('0x36')]?_0x1601d5[_0xe4fd('0x34')]:_0x465b22[_0xe4fd('0x2e')];if(_0x4ecf6d[_0xe4fd('0x31')]['includeAll']){_0x1601d5[_0xe4fd('0x41')]=[{'all':!![]}];}_0x1601d5=_[_0xe4fd('0x3e')]({},_0x1601d5,_0x4ecf6d[_0xe4fd('0x40')]);return db['Dynamics365Account'][_0xe4fd('0x46')](_0x1601d5)['then'](handleEntityNotFound(_0x4f7a59,null))['then'](respondWithResult(_0x4f7a59,null))[_0xe4fd('0x44')](handleError(_0x4f7a59,null));};exports[_0xe4fd('0x47')]=function(_0x312114,_0x1c88d4){return db[_0xe4fd('0x2a')][_0xe4fd('0x47')](_0x312114[_0xe4fd('0x48')],{})['then'](respondWithResult(_0x1c88d4,0xc9))[_0xe4fd('0x44')](handleError(_0x1c88d4,null));};exports[_0xe4fd('0x49')]=function(_0x16bd52,_0x42d006){if(_0x16bd52[_0xe4fd('0x48')]['id']){delete _0x16bd52[_0xe4fd('0x48')]['id'];}return db[_0xe4fd('0x2a')][_0xe4fd('0x46')]({'where':{'id':_0x16bd52[_0xe4fd('0x4a')]['id']}})[_0xe4fd('0x23')](handleEntityNotFound(_0x42d006,null))[_0xe4fd('0x23')](saveUpdates(_0x16bd52[_0xe4fd('0x48')],null))[_0xe4fd('0x23')](respondWithResult(_0x42d006,null))[_0xe4fd('0x44')](handleError(_0x42d006,null));};exports[_0xe4fd('0x4b')]=function(_0x4d93c0,_0x1c3644){return db[_0xe4fd('0x2a')][_0xe4fd('0x46')]({'where':{'id':_0x4d93c0[_0xe4fd('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1c3644,null))['then'](removeEntity(_0x1c3644,null))[_0xe4fd('0x44')](handleError(_0x1c3644,null));};exports[_0xe4fd('0x4c')]=function(_0x37240a,_0x48ef90,_0x4232be){var _0x20c37f={};var _0x4cbc10={};var _0xa1d3e0;var _0x21e444;return db[_0xe4fd('0x2a')][_0xe4fd('0x4d')]({'where':{'id':_0x37240a[_0xe4fd('0x4a')]['id']}})[_0xe4fd('0x23')](handleEntityNotFound(_0x48ef90,null))[_0xe4fd('0x23')](function(_0x24f9c6){if(_0x24f9c6){_0xa1d3e0=_0x24f9c6;_0x4cbc10[_0xe4fd('0x2e')]=_['keys'](db['Dynamics365Configuration']['rawAttributes']);_0x4cbc10[_0xe4fd('0x31')]=_[_0xe4fd('0x30')](_0x37240a['query']);_0x4cbc10[_0xe4fd('0x32')]=_[_0xe4fd('0x33')](_0x4cbc10[_0xe4fd('0x2e')],_0x4cbc10[_0xe4fd('0x31')]);_0x20c37f['attributes']=_['intersection'](_0x4cbc10['model'],qs['fields'](_0x37240a[_0xe4fd('0x31')][_0xe4fd('0x35')]));_0x20c37f[_0xe4fd('0x34')]=_0x20c37f[_0xe4fd('0x34')][_0xe4fd('0x36')]?_0x20c37f['attributes']:_0x4cbc10[_0xe4fd('0x2e')];_0x20c37f['order']=qs['sort'](_0x37240a[_0xe4fd('0x31')][_0xe4fd('0x3a')]);_0x20c37f[_0xe4fd('0x3b')]=qs['filters'](_[_0xe4fd('0x3c')](_0x37240a[_0xe4fd('0x31')],_0x4cbc10['filters']));if(_0x37240a[_0xe4fd('0x31')][_0xe4fd('0x3d')]){_0x20c37f[_0xe4fd('0x3b')]=_[_0xe4fd('0x3e')](_0x20c37f[_0xe4fd('0x3b')],{'$or':_['map'](_0x20c37f['attributes'],function(_0x35af9d){var _0x313027={};_0x313027[_0x35af9d]={'$like':'%'+_0x37240a[_0xe4fd('0x31')][_0xe4fd('0x3d')]+'%'};return _0x313027;})});}_0x20c37f=_[_0xe4fd('0x3e')]({},_0x20c37f,_0x37240a['options']);return _0xa1d3e0[_0xe4fd('0x4c')](_0x20c37f);}})[_0xe4fd('0x23')](function(_0x263c07){if(_0x263c07){_0x21e444=_0x263c07[_0xe4fd('0x36')];if(!_0x37240a[_0xe4fd('0x31')][_0xe4fd('0x37')](_0xe4fd('0x38'))){_0x20c37f['limit']=qs[_0xe4fd('0x1e')](_0x37240a[_0xe4fd('0x31')][_0xe4fd('0x1e')]);_0x20c37f[_0xe4fd('0x1d')]=qs[_0xe4fd('0x1d')](_0x37240a['query'][_0xe4fd('0x1d')]);}return _0xa1d3e0[_0xe4fd('0x4c')](_0x20c37f);}})[_0xe4fd('0x23')](function(_0x1bd083){if(_0x1bd083){return _0x1bd083?{'count':_0x21e444,'rows':_0x1bd083}:null;}})[_0xe4fd('0x23')](respondWithResult(_0x48ef90,null))[_0xe4fd('0x44')](handleError(_0x48ef90,null));};exports[_0xe4fd('0x4e')]=function(_0x3c9844,_0x3aa002,_0xdefeeb){if(_0x3c9844[_0xe4fd('0x48')]['id']){delete _0x3c9844[_0xe4fd('0x48')]['id'];}return db[_0xe4fd('0x2a')][_0xe4fd('0x4d')]({'where':{'id':_0x3c9844['params']['id']}})[_0xe4fd('0x23')](handleEntityNotFound(_0x3aa002,null))['then'](function(_0x17d19a){if(_0x17d19a){_0x3c9844[_0xe4fd('0x48')][_0xe4fd('0x4f')]=_0x17d19a['id'];_0x3c9844[_0xe4fd('0x48')][_0xe4fd('0x50')]=integrations['getSubjects'](_0x3c9844['body'][_0xe4fd('0x51')],_0x3c9844[_0xe4fd('0x48')][_0xe4fd('0x2c')]);_0x3c9844[_0xe4fd('0x48')][_0xe4fd('0x52')]=integrations[_0xe4fd('0x53')](_0x3c9844[_0xe4fd('0x48')][_0xe4fd('0x51')],_0x3c9844[_0xe4fd('0x48')]['type']);return db[_0xe4fd('0x54')][_0xe4fd('0x47')](_0x3c9844[_0xe4fd('0x48')],{'include':[{'model':db[_0xe4fd('0x55')],'as':_0xe4fd('0x50')},{'model':db['Dynamics365Field'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x3aa002,null))[_0xe4fd('0x44')](handleError(_0x3aa002,null));};exports[_0xe4fd('0x56')]=function(_0x3de7c3,_0x39ed9c,_0xf15367){var _0x53376a=_0x3de7c3[_0xe4fd('0x31')][_0xe4fd('0x57')];var _0x355826=_0x53376a===_0xe4fd('0x58')?_0xe4fd('0x59'):_0xe4fd('0x5a');var _0x490bf3='';var _0x53bb60='';var _0x39ae8c='';var _0x57ccea='';var _0x4ab898='';var _0x426dc6='';var _0x66da94='';var _0x349e75='';var _0x5b6326=[_0xe4fd('0x5b'),_0xe4fd('0x5c'),_0xe4fd('0x5d'),_0xe4fd('0x5e'),_0xe4fd('0x5f'),_0xe4fd('0x60'),_0xe4fd('0x61'),'regardingobjectid',_0xe4fd('0x62'),_0xe4fd('0x63')];var _0x1de85e=['accountidname',_0xe4fd('0x64'),_0xe4fd('0x65'),'billedserviceunits',_0xe4fd('0x66'),_0xe4fd('0x67'),_0xe4fd('0x68'),_0xe4fd('0x69'),_0xe4fd('0x6a'),_0xe4fd('0x6b'),_0xe4fd('0x6c'),_0xe4fd('0x6d'),_0xe4fd('0x6e'),_0xe4fd('0x6f'),'createdonbehalfbyyominame',_0xe4fd('0x70'),'customeridtype','customeridyominame','emailaddress',_0xe4fd('0x71'),'entityimage_timestamp','entityimage_url',_0xe4fd('0x72'),_0xe4fd('0x73'),_0xe4fd('0x74'),'followupby',_0xe4fd('0x75'),_0xe4fd('0x76'),_0xe4fd('0x77'),_0xe4fd('0x78'),'masteridname',_0xe4fd('0x79'),'modifiedbyexternalpartyyominame',_0xe4fd('0x7a'),'modifiedbyyominame',_0xe4fd('0x7b'),_0xe4fd('0x7c'),_0xe4fd('0x7d'),_0xe4fd('0x7e'),_0xe4fd('0x7f'),_0xe4fd('0x80'),'onholdtime','overriddencreatedon',_0xe4fd('0x81'),_0xe4fd('0x82'),_0xe4fd('0x83'),_0xe4fd('0x84'),_0xe4fd('0x85'),_0xe4fd('0x86'),_0xe4fd('0x87'),_0xe4fd('0x88'),_0xe4fd('0x89'),_0xe4fd('0x8a'),_0xe4fd('0x8b'),_0xe4fd('0x8c'),_0xe4fd('0x8d'),_0xe4fd('0x8e'),_0xe4fd('0x8f'),_0xe4fd('0x90'),_0xe4fd('0x91'),_0xe4fd('0x92'),_0xe4fd('0x93'),_0xe4fd('0x94'),_0xe4fd('0x95'),_0xe4fd('0x96'),'timezoneruleversionnumber',_0xe4fd('0x97'),'traversedpath',_0xe4fd('0x98'),_0xe4fd('0x99')];var _0x247dcc=_0x5b6326['concat'](_0x1de85e);return db[_0xe4fd('0x2a')]['findOne']({'where':{'id':_0x3de7c3[_0xe4fd('0x4a')]['id']},'attributes':['id',_0xe4fd('0x9a'),_0xe4fd('0x9b'),_0xe4fd('0x9c'),_0xe4fd('0x9d'),_0xe4fd('0x9e'),_0xe4fd('0x9f')]})[_0xe4fd('0x23')](handleEntityNotFound(_0x39ed9c,null))[_0xe4fd('0x23')](function(_0x50ca9e){if(_0x50ca9e){_0x349e75=_0x50ca9e[_0xe4fd('0x9c')];var _0x17c83b=_0x349e75[_0xe4fd('0xa0')](-0x1);if(_0x17c83b==='/'){_0x349e75=_0x349e75[_0xe4fd('0xa1')](0x0,_0x349e75[_0xe4fd('0xa2')](_0x17c83b));}_0x66da94=util[_0xe4fd('0xa3')](_0xe4fd('0xa4'),_0x349e75);var _0x1f271d={'method':'POST','uri':'https://login.microsoftonline.com/'+_0x50ca9e[_0xe4fd('0x9d')]+_0xe4fd('0xa5'),'form':{'client_id':_0x50ca9e['clientId'],'resource':_0x349e75,'username':_0x50ca9e[_0xe4fd('0x9a')],'password':_0x50ca9e[_0xe4fd('0x9b')],'grant_type':_0xe4fd('0x9b'),'client_secret':_0x50ca9e[_0xe4fd('0x9f')]},'json':!![]};return rp(_0x1f271d);}})[_0xe4fd('0x23')](function(_0x249ca9){_0x426dc6=_0x249ca9[_0xe4fd('0xa6')];var _0x17cac3={'method':_0xe4fd('0xa7'),'uri':encodeURI(_0x66da94+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x355826+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x426dc6,'If-None-Match':null,'OData-Version':_0xe4fd('0xa8')},'json':!![]};return rp(_0x17cac3);})['then'](function(_0x1fa990){var _0xafc0f4=_0x1fa990[_0xe4fd('0xa9')][0x0];var _0x2f3ff6=_0xafc0f4[_0xe4fd('0xaa')];var _0x2f557e={'method':_0xe4fd('0xa7'),'uri':_0x66da94+_0xe4fd('0xab')+_0x2f3ff6+_0xe4fd('0xac'),'headers':{'Authorization':'Bearer\x20'+_0x426dc6,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x2f557e);})[_0xe4fd('0x23')](function(_0x48f7c8){_0x490bf3=_0x48f7c8;_0x53bb60=_0x490bf3[_0xe4fd('0xad')];_0x53bb60=_[_0xe4fd('0xae')](_0x53bb60,function(_0x52e68c){return!_0x247dcc[_0xe4fd('0xaf')](_0x52e68c[_0xe4fd('0xb0')]);});var _0x1169e6=[];var _0x57450d=[];_0x53bb60[_0xe4fd('0xb1')](function(_0x37ea7a){if(_0x37ea7a[_0xe4fd('0xb2')]){var _0x315da6=_0x37ea7a[_0xe4fd('0xb2')][_0xe4fd('0xa1')](_0x37ea7a[_0xe4fd('0xb2')][_0xe4fd('0xa2')]('.')+0x1);if(_0x315da6===_0xe4fd('0xb3')){_0x1169e6[_0xe4fd('0xb4')](getSelectList(_0x66da94,_0x53376a,_0x57450d,_0x490bf3[_0xe4fd('0xaa')],_0x37ea7a['MetadataId'],_0x426dc6));}}});return Promise[_0xe4fd('0xb5')](_0x1169e6);})['then'](function(_0x3b6f71){_0x39ae8c=_0x3b6f71[0x0];var _0x104c7a=[];var _0x50fa56=[];_0x53bb60[_0xe4fd('0xb1')](function(_0x3afadc){if(!_[_0xe4fd('0xb6')](_0x3afadc[_0xe4fd('0xb2')])){var _0x4c78a7=_0x3afadc[_0xe4fd('0xb2')][_0xe4fd('0xa1')](_0x3afadc[_0xe4fd('0xb2')][_0xe4fd('0xa2')]('.')+0x1);if(_0x4c78a7==='BooleanAttributeMetadata'){_0x104c7a['push'](getBooleanList(_0x66da94,_0x53376a,_0x50fa56,_0x490bf3['MetadataId'],_0x3afadc[_0xe4fd('0xaa')],_0x426dc6));}}});return Promise[_0xe4fd('0xb5')](_0x104c7a);})[_0xe4fd('0x23')](function(_0x1a6bad){_0x57ccea=_0x1a6bad[0x0];var _0x6d0f2c=[];var _0x20907c=[];_0x53bb60[_0xe4fd('0xb1')](function(_0x428197){if(_0x428197[_0xe4fd('0xb2')]){var _0x38d139=_0x428197[_0xe4fd('0xb2')][_0xe4fd('0xa1')](_0x428197['@odata.type'][_0xe4fd('0xa2')]('.')+0x1);if(_0x38d139===_0xe4fd('0xb7')||_0x38d139===_0xe4fd('0xb8')||_0x38d139==='BigIntAttributeMetadata'||_0x38d139===_0xe4fd('0xb9')||_0x38d139==='MemoAttributeMetadata'||_0x38d139===_0xe4fd('0xba')||_0x38d139===_0xe4fd('0xbb')||_0x38d139===_0xe4fd('0xbc')||_0x38d139==='StateAttributeMetadata'||_0x38d139===_0xe4fd('0xbd')){_0x6d0f2c[_0xe4fd('0xb4')](getInputList(_0x66da94,_0x53376a,_0x38d139,_0x20907c,_0x490bf3[_0xe4fd('0xaa')],_0x428197[_0xe4fd('0xaa')],_0x426dc6));}}});return Promise[_0xe4fd('0xb5')](_0x6d0f2c);})[_0xe4fd('0x23')](function(_0x455aa8){_0x4ab898=_0x455aa8[0x0];var _0x4eaff1=_0x39ae8c['concat'](_0x57ccea)['concat'](_0x4ab898);var _0x33c221={'count':_0x4eaff1[_0xe4fd('0x36')],'rows':_0x4eaff1};return _0x33c221;})[_0xe4fd('0x23')](respondWithResult(_0x39ed9c,null))[_0xe4fd('0x44')](function(_0x551e77){var _0x36d73e=_0x3de7c3[_0xe4fd('0x31')][_0xe4fd('0xbe')]?0x1f4:_0x551e77[_0xe4fd('0xbf')]||0x1f4;logger['error'](_0x551e77[_0xe4fd('0x26')]);delete _0x551e77[_0xe4fd('0x27')];if(_0x36d73e===0x191){_0x36d73e=0x190;}_0x39ed9c[_0xe4fd('0x19')](_0x36d73e)['send'](_0x3de7c3['query'][_0xe4fd('0xbe')]?{'message':_0xe4fd('0xc0'),'statusCode':_0x551e77[_0xe4fd('0xbf')]}:_0x551e77);});};function getSelectList(_0xab091b,_0xe90dc0,_0x4e4c07,_0x4708e7,_0x58d0d3,_0x36daf7){var _0x39286c={'method':_0xe4fd('0xa7'),'uri':_0xab091b+_0xe4fd('0xab')+_0x4708e7+_0xe4fd('0xc1')+_0x58d0d3+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0xe4fd('0xc2'),'headers':{'Authorization':'Bearer\x20'+_0x36daf7,'If-None-Match':null,'OData-Version':_0xe4fd('0xa8')},'json':!![]};return rp(_0x39286c)[_0xe4fd('0x23')](function(_0x134971){var _0x2693fa=[];var _0x1f5197=_0x134971[_0xe4fd('0xc3')][_0xe4fd('0xc4')];_0x1f5197[_0xe4fd('0xb1')](function(_0x328abc){_0x2693fa[_0xe4fd('0xb4')]({'name':_0x328abc['Label'][_0xe4fd('0xc5')][_0xe4fd('0xc6')],'value':String(_0x328abc['Value'])});});var _0x48d959={'id':_0xe90dc0+'_'+_0x134971[_0xe4fd('0xb0')],'name':_0x134971[_0xe4fd('0xc7')][_0xe4fd('0xc5')][_0xe4fd('0xc6')],'custom':![],'options':_0x2693fa};_0x4e4c07['push'](_0x48d959);return _0x4e4c07;});}function getBooleanList(_0x23a8ac,_0xbcf22e,_0x5063a8,_0x40b11f,_0x30039c,_0x19c66d){var _0x14850e={'method':'GET','uri':_0x23a8ac+_0xe4fd('0xab')+_0x40b11f+_0xe4fd('0xc1')+_0x30039c+_0xe4fd('0xc8'),'headers':{'Authorization':'Bearer\x20'+_0x19c66d,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x14850e)[_0xe4fd('0x23')](function(_0x53f2c2){var _0x3060dd=[];_0x3060dd[_0xe4fd('0xb4')]({'name':_0x53f2c2[_0xe4fd('0xc3')][_0xe4fd('0xc9')][_0xe4fd('0xc6')][_0xe4fd('0xc5')][_0xe4fd('0xc6')],'value':'true'},{'name':_0x53f2c2[_0xe4fd('0xc3')]['FalseOption'][_0xe4fd('0xc6')][_0xe4fd('0xc5')][_0xe4fd('0xc6')],'value':_0xe4fd('0xca')});var _0x5b4e1a={'id':_0xbcf22e+'_'+_0x53f2c2[_0xe4fd('0xb0')],'name':_0x53f2c2[_0xe4fd('0xc7')][_0xe4fd('0xc5')][_0xe4fd('0xc6')],'custom':![],'options':_0x3060dd};_0x5063a8[_0xe4fd('0xb4')](_0x5b4e1a);return _0x5063a8;});}function getInputList(_0x5687b3,_0x1faf5f,_0x1599a6,_0x461568,_0x407d4f,_0x1179a6,_0x149805){var _0x48efde={'method':_0xe4fd('0xa7'),'uri':_0x5687b3+'EntityDefinitions('+_0x407d4f+')/Attributes('+_0x1179a6+_0xe4fd('0xcb')+_0x1599a6+_0xe4fd('0xcc'),'headers':{'Authorization':'Bearer\x20'+_0x149805,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x48efde)['then'](function(_0x2d6e48){var _0x296f38={'id':_0x1faf5f+'_'+_0x2d6e48[_0xe4fd('0xb0')],'name':_0x2d6e48[_0xe4fd('0xc7')][_0xe4fd('0xc5')]?_0x2d6e48[_0xe4fd('0xc7')][_0xe4fd('0xc5')]['Label']:_0x2d6e48[_0xe4fd('0xb0')],'custom':![],'options':[]};_0x461568[_0xe4fd('0xb4')](_0x296f38);return _0x461568;});} \ No newline at end of file +var _0x2cc1=['includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','all','isNil','StringAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','test','Wrong\x20credentials','statusCode',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','OptionSet','Options','Label','UserLocalizedLabel',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','true','false','DisplayName',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','then','sendStatus','error','stack','name','send','index','map','Dynamics365Account','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','rows','catch','show','include','find','create','body','update','destroy','params','findOne','Dynamics365Configuration','getConfigurations','AccountId','Subjects','channel','getDescriptions','Dynamics365Field','Descriptions','getFields','ticketType','incident','Incident','PhoneCall','title','description','customerid','ownerid','caseorigincode','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidyominame','billedserviceunits','contractdetailidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','escalatedon','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyname','modifiedbyyominame','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','prioritycodename','productidname','productserialnumber','responseby','responsiblecontactidname','responsiblecontactidyominame','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','ticketnumber','timezoneruleversionnumber','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','tenantId','clientId','clientSecret','slice','substring','lastIndexOf','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','MetadataId','EntityDefinitions(','4.0','Attributes','remove'];(function(_0x43f0e6,_0x35fbdd){var _0x10e027=function(_0x2eaa51){while(--_0x2eaa51){_0x43f0e6['push'](_0x43f0e6['shift']());}};_0x10e027(++_0x35fbdd);}(_0x2cc1,0x1bd));var _0x12cc=function(_0xf9bcaf,_0x3c9230){_0xf9bcaf=_0xf9bcaf-0x0;var _0x1dff25=_0x2cc1[_0xf9bcaf];return _0x1dff25;};'use strict';var emlformat=require(_0x12cc('0x0'));var rimraf=require(_0x12cc('0x1'));var zipdir=require(_0x12cc('0x2'));var jsonpatch=require(_0x12cc('0x3'));var rp=require(_0x12cc('0x4'));var moment=require(_0x12cc('0x5'));var BPromise=require(_0x12cc('0x6'));var Mustache=require(_0x12cc('0x7'));var util=require('util');var path=require('path');var sox=require(_0x12cc('0x8'));var csv=require(_0x12cc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x12cc('0xa'));var squel=require(_0x12cc('0xb'));var crypto=require(_0x12cc('0xc'));var jsforce=require(_0x12cc('0xd'));var deskjs=require(_0x12cc('0xe'));var toCsv=require(_0x12cc('0x9'));var querystring=require(_0x12cc('0xf'));var Papa=require(_0x12cc('0x10'));var Redis=require(_0x12cc('0x11'));var authService=require(_0x12cc('0x12'));var qs=require(_0x12cc('0x13'));var as=require(_0x12cc('0x14'));var hardwareService=require(_0x12cc('0x15'));var logger=require('../../config/logger')(_0x12cc('0x16'));var utils=require('../../config/utils');var config=require(_0x12cc('0x17'));var licenseUtil=require(_0x12cc('0x18'));var db=require(_0x12cc('0x19'))['db'];var integrations=require(_0x12cc('0x1a'));function respondWithStatusCode(_0x29a902,_0x7bf7fc){_0x7bf7fc=_0x7bf7fc||0xcc;return function(_0x5f3fb6){if(_0x5f3fb6){return _0x29a902['sendStatus'](_0x7bf7fc);}return _0x29a902[_0x12cc('0x1b')](_0x7bf7fc)['end']();};}function respondWithResult(_0xbe9117,_0x57f008){_0x57f008=_0x57f008||0xc8;return function(_0x3451b5){if(_0x3451b5){return _0xbe9117[_0x12cc('0x1b')](_0x57f008)[_0x12cc('0x1c')](_0x3451b5);}};}function respondWithFilteredResult(_0xc0a469,_0x10e22a){return function(_0x33753a){if(_0x33753a){var _0x511857=typeof _0x10e22a[_0x12cc('0x1d')]===_0x12cc('0x1e')&&typeof _0x10e22a['limit']===_0x12cc('0x1e');var _0x28134a=_0x33753a[_0x12cc('0x1f')];var _0x33db40=_0x511857?0x0:_0x10e22a[_0x12cc('0x1d')];var _0xe6f84=_0x511857?_0x33753a[_0x12cc('0x1f')]:_0x10e22a[_0x12cc('0x1d')]+_0x10e22a[_0x12cc('0x20')];var _0x50e077;if(_0xe6f84>=_0x28134a){_0xe6f84=_0x28134a;_0x50e077=0xc8;}else{_0x50e077=0xce;}_0xc0a469['status'](_0x50e077);return _0xc0a469['set'](_0x12cc('0x21'),_0x33db40+'-'+_0xe6f84+'/'+_0x28134a)[_0x12cc('0x1c')](_0x33753a);}return null;};}function patchUpdates(_0x2973d4){return function(_0x4180f1){try{jsonpatch[_0x12cc('0x22')](_0x4180f1,_0x2973d4,!![]);}catch(_0xd92481){return BPromise[_0x12cc('0x23')](_0xd92481);}return _0x4180f1[_0x12cc('0x24')]();};}function saveUpdates(_0x2837bf,_0x5c1fdf){return function(_0x3358a2){if(_0x3358a2){return _0x3358a2['update'](_0x2837bf)[_0x12cc('0x25')](function(_0x1a5f8e){return _0x1a5f8e;});}return null;};}function removeEntity(_0x4814b8,_0x2f5aab){return function(_0x797a61){if(_0x797a61){return _0x797a61['destroy']()['then'](function(){_0x4814b8[_0x12cc('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3769b2,_0x11d4bc){return function(_0x1fb084){if(!_0x1fb084){_0x3769b2[_0x12cc('0x26')](0x194);}return _0x1fb084;};}function handleError(_0x448b5a,_0x281da6){_0x281da6=_0x281da6||0x1f4;return function(_0x30439d){logger[_0x12cc('0x27')](_0x30439d[_0x12cc('0x28')]);if(_0x30439d[_0x12cc('0x29')]){delete _0x30439d[_0x12cc('0x29')];}_0x448b5a[_0x12cc('0x1b')](_0x281da6)[_0x12cc('0x2a')](_0x30439d);};}exports[_0x12cc('0x2b')]=function(_0x214f24,_0x1c8bca){var _0x5cb159={},_0x38413b={},_0xfbb4f2={'count':0x0,'rows':[]};var _0x781b72=_[_0x12cc('0x2c')](db[_0x12cc('0x2d')][_0x12cc('0x2e')],function(_0x363041){return{'name':_0x363041['fieldName'],'type':_0x363041[_0x12cc('0x2f')][_0x12cc('0x30')]};});_0x38413b[_0x12cc('0x31')]=_[_0x12cc('0x2c')](_0x781b72,_0x12cc('0x29'));_0x38413b['query']=_[_0x12cc('0x32')](_0x214f24[_0x12cc('0x33')]);_0x38413b[_0x12cc('0x34')]=_[_0x12cc('0x35')](_0x38413b[_0x12cc('0x31')],_0x38413b[_0x12cc('0x33')]);_0x5cb159[_0x12cc('0x36')]=_[_0x12cc('0x35')](_0x38413b[_0x12cc('0x31')],qs[_0x12cc('0x37')](_0x214f24[_0x12cc('0x33')][_0x12cc('0x37')]));_0x5cb159[_0x12cc('0x36')]=_0x5cb159[_0x12cc('0x36')][_0x12cc('0x38')]?_0x5cb159['attributes']:_0x38413b[_0x12cc('0x31')];if(!_0x214f24[_0x12cc('0x33')][_0x12cc('0x39')](_0x12cc('0x3a'))){_0x5cb159[_0x12cc('0x20')]=qs[_0x12cc('0x20')](_0x214f24['query'][_0x12cc('0x20')]);_0x5cb159[_0x12cc('0x1d')]=qs[_0x12cc('0x1d')](_0x214f24['query'][_0x12cc('0x1d')]);}_0x5cb159[_0x12cc('0x3b')]=qs[_0x12cc('0x3c')](_0x214f24[_0x12cc('0x33')][_0x12cc('0x3c')]);_0x5cb159['where']=qs[_0x12cc('0x34')](_[_0x12cc('0x3d')](_0x214f24[_0x12cc('0x33')],_0x38413b[_0x12cc('0x34')]),_0x781b72);if(_0x214f24[_0x12cc('0x33')][_0x12cc('0x3e')]){_0x5cb159[_0x12cc('0x3f')]=_[_0x12cc('0x40')](_0x5cb159[_0x12cc('0x3f')],{'$or':_[_0x12cc('0x2c')](_0x781b72,function(_0x2ece53){if(_0x2ece53['type']!==_0x12cc('0x41')){var _0x39f443={};_0x39f443[_0x2ece53[_0x12cc('0x29')]]={'$like':'%'+_0x214f24[_0x12cc('0x33')][_0x12cc('0x3e')]+'%'};return _0x39f443;}})});}_0x5cb159=_['merge']({},_0x5cb159,_0x214f24[_0x12cc('0x42')]);var _0x5adae7={'where':_0x5cb159[_0x12cc('0x3f')]};return db[_0x12cc('0x2d')][_0x12cc('0x1f')](_0x5adae7)[_0x12cc('0x25')](function(_0x1463fd){_0xfbb4f2[_0x12cc('0x1f')]=_0x1463fd;if(_0x214f24[_0x12cc('0x33')][_0x12cc('0x43')]){_0x5cb159['include']=[{'all':!![]}];}return db['Dynamics365Account']['findAll'](_0x5cb159);})['then'](function(_0x3c856d){_0xfbb4f2[_0x12cc('0x44')]=_0x3c856d;return _0xfbb4f2;})[_0x12cc('0x25')](respondWithFilteredResult(_0x1c8bca,_0x5cb159))[_0x12cc('0x45')](handleError(_0x1c8bca,null));};exports[_0x12cc('0x46')]=function(_0x426926,_0xdae983){var _0x33dfe1={'raw':![],'where':{'id':_0x426926['params']['id']}},_0xf38a14={};_0xf38a14[_0x12cc('0x31')]=_[_0x12cc('0x32')](db[_0x12cc('0x2d')][_0x12cc('0x2e')]);_0xf38a14['query']=_['keys'](_0x426926[_0x12cc('0x33')]);_0xf38a14[_0x12cc('0x34')]=_[_0x12cc('0x35')](_0xf38a14[_0x12cc('0x31')],_0xf38a14[_0x12cc('0x33')]);_0x33dfe1[_0x12cc('0x36')]=_[_0x12cc('0x35')](_0xf38a14[_0x12cc('0x31')],qs[_0x12cc('0x37')](_0x426926['query'][_0x12cc('0x37')]));_0x33dfe1[_0x12cc('0x36')]=_0x33dfe1['attributes'][_0x12cc('0x38')]?_0x33dfe1['attributes']:_0xf38a14[_0x12cc('0x31')];if(_0x426926[_0x12cc('0x33')]['includeAll']){_0x33dfe1[_0x12cc('0x47')]=[{'all':!![]}];}_0x33dfe1=_['merge']({},_0x33dfe1,_0x426926[_0x12cc('0x42')]);return db['Dynamics365Account'][_0x12cc('0x48')](_0x33dfe1)['then'](handleEntityNotFound(_0xdae983,null))[_0x12cc('0x25')](respondWithResult(_0xdae983,null))[_0x12cc('0x45')](handleError(_0xdae983,null));};exports['create']=function(_0x43d0f1,_0x8e888d){return db[_0x12cc('0x2d')][_0x12cc('0x49')](_0x43d0f1[_0x12cc('0x4a')],{})[_0x12cc('0x25')](respondWithResult(_0x8e888d,0xc9))[_0x12cc('0x45')](handleError(_0x8e888d,null));};exports[_0x12cc('0x4b')]=function(_0x37baac,_0x2b3462){if(_0x37baac['body']['id']){delete _0x37baac[_0x12cc('0x4a')]['id'];}return db['Dynamics365Account'][_0x12cc('0x48')]({'where':{'id':_0x37baac['params']['id']}})[_0x12cc('0x25')](handleEntityNotFound(_0x2b3462,null))[_0x12cc('0x25')](saveUpdates(_0x37baac[_0x12cc('0x4a')],null))[_0x12cc('0x25')](respondWithResult(_0x2b3462,null))[_0x12cc('0x45')](handleError(_0x2b3462,null));};exports[_0x12cc('0x4c')]=function(_0x10b73d,_0xe7868d){return db[_0x12cc('0x2d')][_0x12cc('0x48')]({'where':{'id':_0x10b73d[_0x12cc('0x4d')]['id']}})[_0x12cc('0x25')](handleEntityNotFound(_0xe7868d,null))[_0x12cc('0x25')](removeEntity(_0xe7868d,null))[_0x12cc('0x45')](handleError(_0xe7868d,null));};exports['getConfigurations']=function(_0x4a1404,_0x31273b,_0x41eb51){var _0x489e8b={};var _0x3bd84a={};var _0x31290e;var _0x2a9239;return db[_0x12cc('0x2d')][_0x12cc('0x4e')]({'where':{'id':_0x4a1404[_0x12cc('0x4d')]['id']}})[_0x12cc('0x25')](handleEntityNotFound(_0x31273b,null))[_0x12cc('0x25')](function(_0x1e778b){if(_0x1e778b){_0x31290e=_0x1e778b;_0x3bd84a[_0x12cc('0x31')]=_[_0x12cc('0x32')](db[_0x12cc('0x4f')][_0x12cc('0x2e')]);_0x3bd84a[_0x12cc('0x33')]=_[_0x12cc('0x32')](_0x4a1404[_0x12cc('0x33')]);_0x3bd84a[_0x12cc('0x34')]=_[_0x12cc('0x35')](_0x3bd84a['model'],_0x3bd84a[_0x12cc('0x33')]);_0x489e8b[_0x12cc('0x36')]=_[_0x12cc('0x35')](_0x3bd84a[_0x12cc('0x31')],qs[_0x12cc('0x37')](_0x4a1404[_0x12cc('0x33')][_0x12cc('0x37')]));_0x489e8b[_0x12cc('0x36')]=_0x489e8b[_0x12cc('0x36')][_0x12cc('0x38')]?_0x489e8b[_0x12cc('0x36')]:_0x3bd84a['model'];_0x489e8b['order']=qs['sort'](_0x4a1404[_0x12cc('0x33')][_0x12cc('0x3c')]);_0x489e8b[_0x12cc('0x3f')]=qs['filters'](_[_0x12cc('0x3d')](_0x4a1404[_0x12cc('0x33')],_0x3bd84a['filters']));if(_0x4a1404['query'][_0x12cc('0x3e')]){_0x489e8b[_0x12cc('0x3f')]=_[_0x12cc('0x40')](_0x489e8b[_0x12cc('0x3f')],{'$or':_['map'](_0x489e8b['attributes'],function(_0x4cc69a){var _0x515897={};_0x515897[_0x4cc69a]={'$like':'%'+_0x4a1404[_0x12cc('0x33')][_0x12cc('0x3e')]+'%'};return _0x515897;})});}_0x489e8b=_[_0x12cc('0x40')]({},_0x489e8b,_0x4a1404[_0x12cc('0x42')]);return _0x31290e[_0x12cc('0x50')](_0x489e8b);}})[_0x12cc('0x25')](function(_0x3ad7d2){if(_0x3ad7d2){_0x2a9239=_0x3ad7d2[_0x12cc('0x38')];if(!_0x4a1404[_0x12cc('0x33')]['hasOwnProperty'](_0x12cc('0x3a'))){_0x489e8b[_0x12cc('0x20')]=qs['limit'](_0x4a1404[_0x12cc('0x33')][_0x12cc('0x20')]);_0x489e8b[_0x12cc('0x1d')]=qs[_0x12cc('0x1d')](_0x4a1404['query']['offset']);}return _0x31290e[_0x12cc('0x50')](_0x489e8b);}})[_0x12cc('0x25')](function(_0x3ebc79){if(_0x3ebc79){return _0x3ebc79?{'count':_0x2a9239,'rows':_0x3ebc79}:null;}})[_0x12cc('0x25')](respondWithResult(_0x31273b,null))['catch'](handleError(_0x31273b,null));};exports['addConfiguration']=function(_0x5b4466,_0x5a3d5a,_0x1ab2a2){if(_0x5b4466[_0x12cc('0x4a')]['id']){delete _0x5b4466['body']['id'];}return db[_0x12cc('0x2d')][_0x12cc('0x4e')]({'where':{'id':_0x5b4466[_0x12cc('0x4d')]['id']}})[_0x12cc('0x25')](handleEntityNotFound(_0x5a3d5a,null))['then'](function(_0x3ad014){if(_0x3ad014){_0x5b4466['body'][_0x12cc('0x51')]=_0x3ad014['id'];_0x5b4466[_0x12cc('0x4a')][_0x12cc('0x52')]=integrations['getSubjects'](_0x5b4466['body'][_0x12cc('0x53')],_0x5b4466['body'][_0x12cc('0x2f')]);_0x5b4466[_0x12cc('0x4a')]['Descriptions']=integrations[_0x12cc('0x54')](_0x5b4466[_0x12cc('0x4a')][_0x12cc('0x53')],_0x5b4466['body'][_0x12cc('0x2f')]);return db[_0x12cc('0x4f')]['create'](_0x5b4466[_0x12cc('0x4a')],{'include':[{'model':db[_0x12cc('0x55')],'as':_0x12cc('0x52')},{'model':db[_0x12cc('0x55')],'as':_0x12cc('0x56')}]});}return null;})[_0x12cc('0x25')](respondWithResult(_0x5a3d5a,null))[_0x12cc('0x45')](handleError(_0x5a3d5a,null));};exports[_0x12cc('0x57')]=function(_0x26cadd,_0x1ee804,_0x52e7c1){var _0x414966=_0x26cadd[_0x12cc('0x33')][_0x12cc('0x58')];var _0x46b442=_0x414966===_0x12cc('0x59')?_0x12cc('0x5a'):_0x12cc('0x5b');var _0x301fb8='';var _0x54a876='';var _0x390ef9='';var _0x2c4402='';var _0x4a806d='';var _0x21d846='';var _0x279a7e='';var _0x415689='';var _0x55740b=[_0x12cc('0x5c'),_0x12cc('0x5d'),_0x12cc('0x5e'),_0x12cc('0x5f'),_0x12cc('0x60'),'subject',_0x12cc('0x61'),_0x12cc('0x62'),_0x12cc('0x63'),_0x12cc('0x64')];var _0x525d39=['accountidname',_0x12cc('0x65'),'actualserviceunits',_0x12cc('0x66'),'contactidname','contactidyominame',_0x12cc('0x67'),'contractidname',_0x12cc('0x68'),_0x12cc('0x69'),_0x12cc('0x6a'),_0x12cc('0x6b'),_0x12cc('0x6c'),_0x12cc('0x6d'),_0x12cc('0x6e'),_0x12cc('0x6f'),_0x12cc('0x70'),_0x12cc('0x71'),_0x12cc('0x72'),_0x12cc('0x73'),_0x12cc('0x74'),'entityimage_url',_0x12cc('0x75'),'exchangerate',_0x12cc('0x76'),_0x12cc('0x77'),_0x12cc('0x78'),_0x12cc('0x79'),'kbarticleidname',_0x12cc('0x7a'),_0x12cc('0x7b'),_0x12cc('0x7c'),'modifiedbyexternalpartyyominame',_0x12cc('0x7d'),_0x12cc('0x7e'),'modifiedon',_0x12cc('0x7f'),_0x12cc('0x80'),'msdyn_incidenttypename',_0x12cc('0x81'),_0x12cc('0x82'),_0x12cc('0x83'),_0x12cc('0x84'),_0x12cc('0x85'),_0x12cc('0x86'),_0x12cc('0x87'),_0x12cc('0x88'),_0x12cc('0x89'),'primarycontactidyominame',_0x12cc('0x8a'),_0x12cc('0x8b'),_0x12cc('0x8c'),'resolveby','resolvebykpiidname',_0x12cc('0x8d'),_0x12cc('0x8e'),_0x12cc('0x8f'),'sentimentvalue',_0x12cc('0x90'),_0x12cc('0x91'),_0x12cc('0x92'),_0x12cc('0x93'),_0x12cc('0x94'),'subjectidname',_0x12cc('0x95'),_0x12cc('0x96'),'transactioncurrencyidname',_0x12cc('0x97'),_0x12cc('0x98'),_0x12cc('0x99')];var _0x43e2bb=_0x55740b[_0x12cc('0x9a')](_0x525d39);return db[_0x12cc('0x2d')]['findOne']({'where':{'id':_0x26cadd[_0x12cc('0x4d')]['id']},'attributes':['id',_0x12cc('0x9b'),_0x12cc('0x9c'),_0x12cc('0x9d'),_0x12cc('0x9e'),_0x12cc('0x9f'),_0x12cc('0xa0')]})['then'](handleEntityNotFound(_0x1ee804,null))[_0x12cc('0x25')](function(_0x58c2a0){if(_0x58c2a0){_0x415689=_0x58c2a0[_0x12cc('0x9d')];var _0x348f4d=_0x415689[_0x12cc('0xa1')](-0x1);if(_0x348f4d==='/'){_0x415689=_0x415689[_0x12cc('0xa2')](0x0,_0x415689[_0x12cc('0xa3')](_0x348f4d));}_0x279a7e=util['format'](_0x12cc('0xa4'),_0x415689);var _0x37aef8={'method':_0x12cc('0xa5'),'uri':_0x12cc('0xa6')+_0x58c2a0[_0x12cc('0x9e')]+'/oauth2/token','form':{'client_id':_0x58c2a0[_0x12cc('0x9f')],'resource':_0x415689,'username':_0x58c2a0[_0x12cc('0x9b')],'password':_0x58c2a0[_0x12cc('0x9c')],'grant_type':_0x12cc('0x9c'),'client_secret':_0x58c2a0[_0x12cc('0xa0')]},'json':!![]};return rp(_0x37aef8);}})[_0x12cc('0x25')](function(_0x7d716){_0x21d846=_0x7d716[_0x12cc('0xa7')];var _0x261982={'method':_0x12cc('0xa8'),'uri':encodeURI(_0x279a7e+_0x12cc('0xa9')+_0x46b442+'\x27'),'headers':{'Authorization':_0x12cc('0xaa')+_0x21d846,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x261982);})[_0x12cc('0x25')](function(_0x3c92b6){var _0x5ac74d=_0x3c92b6['value'][0x0];var _0x37d2e6=_0x5ac74d[_0x12cc('0xab')];var _0x424063={'method':_0x12cc('0xa8'),'uri':_0x279a7e+_0x12cc('0xac')+_0x37d2e6+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0x12cc('0xaa')+_0x21d846,'If-None-Match':null,'OData-Version':_0x12cc('0xad')},'json':!![]};return rp(_0x424063);})[_0x12cc('0x25')](function(_0x45f550){_0x301fb8=_0x45f550;_0x54a876=_0x301fb8[_0x12cc('0xae')];_0x54a876=_[_0x12cc('0xaf')](_0x54a876,function(_0x34ecfd){return!_0x43e2bb[_0x12cc('0xb0')](_0x34ecfd[_0x12cc('0xb1')]);});var _0x13c146=[];var _0x33b1d3=[];_0x54a876[_0x12cc('0xb2')](function(_0x30d0ae){if(_0x30d0ae['@odata.type']){var _0x47a9a4=_0x30d0ae[_0x12cc('0xb3')][_0x12cc('0xa2')](_0x30d0ae[_0x12cc('0xb3')][_0x12cc('0xa3')]('.')+0x1);if(_0x47a9a4===_0x12cc('0xb4')){_0x13c146[_0x12cc('0xb5')](getSelectList(_0x279a7e,_0x414966,_0x33b1d3,_0x301fb8[_0x12cc('0xab')],_0x30d0ae['MetadataId'],_0x21d846));}}});return Promise[_0x12cc('0xb6')](_0x13c146);})[_0x12cc('0x25')](function(_0x4ef197){_0x390ef9=_0x4ef197[0x0];var _0x5032f1=[];var _0x343a15=[];_0x54a876['forEach'](function(_0x297bb4){if(!_[_0x12cc('0xb7')](_0x297bb4['@odata.type'])){var _0x629251=_0x297bb4[_0x12cc('0xb3')][_0x12cc('0xa2')](_0x297bb4['@odata.type'][_0x12cc('0xa3')]('.')+0x1);if(_0x629251==='BooleanAttributeMetadata'){_0x5032f1[_0x12cc('0xb5')](getBooleanList(_0x279a7e,_0x414966,_0x343a15,_0x301fb8[_0x12cc('0xab')],_0x297bb4[_0x12cc('0xab')],_0x21d846));}}});return Promise[_0x12cc('0xb6')](_0x5032f1);})[_0x12cc('0x25')](function(_0x2a2e62){_0x2c4402=_0x2a2e62[0x0];var _0x23dbb6=[];var _0x595d93=[];_0x54a876[_0x12cc('0xb2')](function(_0x3889d7){if(_0x3889d7[_0x12cc('0xb3')]){var _0xc9578f=_0x3889d7[_0x12cc('0xb3')]['substring'](_0x3889d7['@odata.type']['lastIndexOf']('.')+0x1);if(_0xc9578f===_0x12cc('0xb8')||_0xc9578f==='DoubleAttributeMetadata'||_0xc9578f===_0x12cc('0xb9')||_0xc9578f===_0x12cc('0xba')||_0xc9578f===_0x12cc('0xbb')||_0xc9578f===_0x12cc('0xbc')||_0xc9578f===_0x12cc('0xbd')||_0xc9578f===_0x12cc('0xbe')||_0xc9578f==='StateAttributeMetadata'||_0xc9578f===_0x12cc('0xbf')){_0x23dbb6[_0x12cc('0xb5')](getInputList(_0x279a7e,_0x414966,_0xc9578f,_0x595d93,_0x301fb8[_0x12cc('0xab')],_0x3889d7[_0x12cc('0xab')],_0x21d846));}}});return Promise[_0x12cc('0xb6')](_0x23dbb6);})[_0x12cc('0x25')](function(_0x47a930){_0x4a806d=_0x47a930[0x0];var _0x22dfc4=_0x390ef9['concat'](_0x2c4402)[_0x12cc('0x9a')](_0x4a806d);var _0x53fbb4={'count':_0x22dfc4[_0x12cc('0x38')],'rows':_0x22dfc4};return _0x53fbb4;})[_0x12cc('0x25')](respondWithResult(_0x1ee804,null))[_0x12cc('0x45')](function(_0x4cb1bd){var _0x398615=_0x26cadd[_0x12cc('0x33')][_0x12cc('0xc0')]?0x1f4:_0x4cb1bd['statusCode']||0x1f4;logger[_0x12cc('0x27')](_0x4cb1bd[_0x12cc('0x28')]);delete _0x4cb1bd['name'];if(_0x398615===0x191){_0x398615=0x190;}_0x1ee804['status'](_0x398615)[_0x12cc('0x2a')](_0x26cadd['query'][_0x12cc('0xc0')]?{'message':_0x12cc('0xc1'),'statusCode':_0x4cb1bd[_0x12cc('0xc2')]}:_0x4cb1bd);});};function getSelectList(_0x5db988,_0x504ba9,_0x11c95e,_0x38ca99,_0x2acda4,_0x4b3a6){var _0x581477={'method':'GET','uri':_0x5db988+'EntityDefinitions('+_0x38ca99+_0x12cc('0xc3')+_0x2acda4+_0x12cc('0xc4')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0x12cc('0xaa')+_0x4b3a6,'If-None-Match':null,'OData-Version':_0x12cc('0xad')},'json':!![]};return rp(_0x581477)['then'](function(_0x553418){var _0x598480=[];var _0x1dc017=_0x553418[_0x12cc('0xc5')][_0x12cc('0xc6')];_0x1dc017[_0x12cc('0xb2')](function(_0x3f12a0){_0x598480[_0x12cc('0xb5')]({'name':_0x3f12a0['Label']['UserLocalizedLabel'][_0x12cc('0xc7')],'value':String(_0x3f12a0['Value'])});});var _0x491940={'id':_0x504ba9+'_'+_0x553418[_0x12cc('0xb1')],'name':_0x553418['DisplayName'][_0x12cc('0xc8')][_0x12cc('0xc7')],'custom':![],'options':_0x598480};_0x11c95e[_0x12cc('0xb5')](_0x491940);return _0x11c95e;});}function getBooleanList(_0x38d01c,_0x87fa74,_0x13f787,_0x4a896a,_0x20de27,_0x476ed4){var _0x18bf14={'method':_0x12cc('0xa8'),'uri':_0x38d01c+_0x12cc('0xac')+_0x4a896a+')/Attributes('+_0x20de27+_0x12cc('0xc9'),'headers':{'Authorization':'Bearer\x20'+_0x476ed4,'If-None-Match':null,'OData-Version':_0x12cc('0xad')},'json':!![]};return rp(_0x18bf14)[_0x12cc('0x25')](function(_0x32ee32){var _0x23278b=[];_0x23278b['push']({'name':_0x32ee32[_0x12cc('0xc5')]['TrueOption'][_0x12cc('0xc7')][_0x12cc('0xc8')]['Label'],'value':_0x12cc('0xca')},{'name':_0x32ee32['OptionSet']['FalseOption']['Label'][_0x12cc('0xc8')][_0x12cc('0xc7')],'value':_0x12cc('0xcb')});var _0x5a04f8={'id':_0x87fa74+'_'+_0x32ee32['LogicalName'],'name':_0x32ee32[_0x12cc('0xcc')][_0x12cc('0xc8')][_0x12cc('0xc7')],'custom':![],'options':_0x23278b};_0x13f787[_0x12cc('0xb5')](_0x5a04f8);return _0x13f787;});}function getInputList(_0x55d70c,_0x10def6,_0x5de1c6,_0x42810e,_0x178187,_0x4f433d,_0x461cde){var _0x31bd35={'method':_0x12cc('0xa8'),'uri':_0x55d70c+_0x12cc('0xac')+_0x178187+')/Attributes('+_0x4f433d+_0x12cc('0xcd')+_0x5de1c6+_0x12cc('0xce'),'headers':{'Authorization':_0x12cc('0xaa')+_0x461cde,'If-None-Match':null,'OData-Version':_0x12cc('0xad')},'json':!![]};return rp(_0x31bd35)[_0x12cc('0x25')](function(_0x135d9f){var _0x5f45db={'id':_0x10def6+'_'+_0x135d9f[_0x12cc('0xb1')],'name':_0x135d9f[_0x12cc('0xcc')][_0x12cc('0xc8')]?_0x135d9f[_0x12cc('0xcc')][_0x12cc('0xc8')][_0x12cc('0xc7')]:_0x135d9f[_0x12cc('0xb1')],'custom':![],'options':[]};_0x42810e[_0x12cc('0xb5')](_0x5f45db);return _0x42810e;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index f0a473a..6f41164 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 _0xd8b0=['exports','Dynamics365Account','int_dynamics365_accounts','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x51faa8,_0x5555dd){var _0x18c49f=function(_0x560a16){while(--_0x560a16){_0x51faa8['push'](_0x51faa8['shift']());}};_0x18c49f(++_0x5555dd);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'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('./intDynamics365Account.attributes');var integrations=require('../../components/integrations/configuration');module[_0x0d8b('0x7')]=function(_0x227c63,_0x39f43a){return _0x227c63['define'](_0x0d8b('0x8'),attributes,{'tableName':_0x0d8b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcb91=['rimraf','./intDynamics365Account.attributes','../../components/integrations/configuration','Dynamics365Account','int_dynamics365_accounts','../../config/logger','api','moment','bluebird','path'];(function(_0x1f6e99,_0x5343b5){var _0xb93428=function(_0xd9e7c9){while(--_0xd9e7c9){_0x1f6e99['push'](_0x1f6e99['shift']());}};_0xb93428(++_0x5343b5);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5e2152,_0x172f3d){_0x5e2152=_0x5e2152-0x0;var _0x5ddcf6=_0xcb91[_0x5e2152];return _0x5ddcf6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));var integrations=require(_0x1cb9('0x7'));module['exports']=function(_0x226b69,_0x3f7deb){return _0x226b69['define'](_0x1cb9('0x8'),attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index d246c54..56373d3 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 _0xcb2a=['model','map','then','GetDynamics365Account','ShowDynamics365Account','find','lodash','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','request','info','Dynamics365Account,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','Dynamics365Account','findAll','options','raw','where','attributes','limit','include'];(function(_0x1c85a7,_0x56f1d9){var _0x2b9b29=function(_0x4001cb){while(--_0x4001cb){_0x1c85a7['push'](_0x1c85a7['shift']());}};_0x2b9b29(++_0x56f1d9);}(_0xcb2a,0xc0));var _0xacb2=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xcb2a[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0xacb2('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xacb2('0x1'));var fs=require('fs');var Redis=require(_0xacb2('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xacb2('0x3'));var logger=require('../../config/logger')(_0xacb2('0x4'));var config=require(_0xacb2('0x5'));var jayson=require(_0xacb2('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x165ea0,_0x29cf62,_0x6c5f8){return new BPromise(function(_0x261636,_0x387d4d){return client[_0xacb2('0x7')](_0x165ea0,_0x6c5f8)['then'](function(_0x29ec50){logger[_0xacb2('0x8')](_0xacb2('0x9'),_0x29cf62,'request\x20sent');logger[_0xacb2('0xa')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x29cf62,_0xacb2('0xb'),JSON[_0xacb2('0xc')](_0x29ec50));if(_0x29ec50[_0xacb2('0xd')]){if(_0x29ec50[_0xacb2('0xd')]['code']===0x1f4){logger[_0xacb2('0xd')](_0xacb2('0x9'),_0x29cf62,_0x29ec50['error']['message']);return _0x387d4d(_0x29ec50[_0xacb2('0xd')][_0xacb2('0xe')]);}logger[_0xacb2('0xd')](_0xacb2('0x9'),_0x29cf62,_0x29ec50[_0xacb2('0xd')][_0xacb2('0xe')]);return _0x261636(_0x29ec50[_0xacb2('0xd')][_0xacb2('0xe')]);}else{logger[_0xacb2('0x8')](_0xacb2('0x9'),_0x29cf62,_0xacb2('0xb'));_0x261636(_0x29ec50[_0xacb2('0xf')]['message']);}})[_0xacb2('0x10')](function(_0x5e119c){logger[_0xacb2('0xd')](_0xacb2('0x9'),_0x29cf62,_0x5e119c);_0x387d4d(_0x5e119c);});});}exports['GetDynamics365Account']=function(_0x1598ca){var _0x3f49bd=this;return new Promise(function(_0x38599d,_0x4a83ee){return db[_0xacb2('0x11')][_0xacb2('0x12')]({'raw':_0x1598ca[_0xacb2('0x13')]?_0x1598ca[_0xacb2('0x13')][_0xacb2('0x14')]===undefined?!![]:![]:!![],'where':_0x1598ca[_0xacb2('0x13')]?_0x1598ca[_0xacb2('0x13')][_0xacb2('0x15')]||null:null,'attributes':_0x1598ca[_0xacb2('0x13')]?_0x1598ca[_0xacb2('0x13')][_0xacb2('0x16')]||null:null,'limit':_0x1598ca[_0xacb2('0x13')]?_0x1598ca[_0xacb2('0x13')][_0xacb2('0x17')]||null:null,'include':_0x1598ca['options']?_0x1598ca[_0xacb2('0x13')]['include']?_['map'](_0x1598ca[_0xacb2('0x13')][_0xacb2('0x18')],function(_0x1b1601){return{'model':db[_0x1b1601[_0xacb2('0x19')]],'as':_0x1b1601['as'],'attributes':_0x1b1601['attributes'],'include':_0x1b1601['include']?_['map'](_0x1b1601[_0xacb2('0x18')],function(_0x3e0ef7){return{'model':db[_0x3e0ef7[_0xacb2('0x19')]],'as':_0x3e0ef7['as'],'attributes':_0x3e0ef7[_0xacb2('0x16')],'include':_0x3e0ef7[_0xacb2('0x18')]?_[_0xacb2('0x1a')](_0x3e0ef7['include'],function(_0x2f211b){return{'model':db[_0x2f211b[_0xacb2('0x19')]],'as':_0x2f211b['as'],'attributes':_0x2f211b['attributes']};}):[]};}):[]};}):[]:[]})[_0xacb2('0x1b')](function(_0x1bedca){logger['info'](_0xacb2('0x1c'),_0x1598ca);logger[_0xacb2('0xa')](_0xacb2('0x1c'),_0x1598ca,JSON[_0xacb2('0xc')](_0x1bedca));_0x38599d(_0x1bedca);})[_0xacb2('0x10')](function(_0x5db68f){logger[_0xacb2('0xd')](_0xacb2('0x1c'),_0x5db68f[_0xacb2('0xe')],_0x1598ca);_0x4a83ee(_0x3f49bd[_0xacb2('0xd')](0x1f4,_0x5db68f[_0xacb2('0xe')]));});});};exports[_0xacb2('0x1d')]=function(_0x551872){var _0x25d44b=this;return new Promise(function(_0x1f5097,_0x490533){return db['Dynamics365Account'][_0xacb2('0x1e')]({'raw':_0x551872[_0xacb2('0x13')]?_0x551872['options'][_0xacb2('0x14')]===undefined?!![]:![]:!![],'where':_0x551872[_0xacb2('0x13')]?_0x551872['options'][_0xacb2('0x15')]||null:null,'attributes':_0x551872['options']?_0x551872[_0xacb2('0x13')]['attributes']||null:null,'include':_0x551872[_0xacb2('0x13')]?_0x551872[_0xacb2('0x13')][_0xacb2('0x18')]?_['map'](_0x551872[_0xacb2('0x13')]['include'],function(_0x23072b){return{'model':db[_0x23072b[_0xacb2('0x19')]],'as':_0x23072b['as'],'attributes':_0x23072b[_0xacb2('0x16')],'include':_0x23072b[_0xacb2('0x18')]?_[_0xacb2('0x1a')](_0x23072b[_0xacb2('0x18')],function(_0x1853f0){return{'model':db[_0x1853f0[_0xacb2('0x19')]],'as':_0x1853f0['as'],'attributes':_0x1853f0[_0xacb2('0x16')],'include':_0x1853f0[_0xacb2('0x18')]?_[_0xacb2('0x1a')](_0x1853f0[_0xacb2('0x18')],function(_0x1ea1a4){return{'model':db[_0x1ea1a4[_0xacb2('0x19')]],'as':_0x1ea1a4['as'],'attributes':_0x1ea1a4[_0xacb2('0x16')]};}):[]};}):[]};}):[]:[]})[_0xacb2('0x1b')](function(_0x4e598e){logger[_0xacb2('0x8')]('ShowDynamics365Account',_0x551872);logger[_0xacb2('0xa')](_0xacb2('0x1d'),_0x551872,JSON['stringify'](_0x4e598e));_0x1f5097(_0x4e598e);})['catch'](function(_0x26abc1){logger[_0xacb2('0xd')](_0xacb2('0x1d'),_0x26abc1[_0xacb2('0xe')],_0x551872);_0x490533(_0x25d44b[_0xacb2('0xd')](0x1f4,_0x26abc1[_0xacb2('0xe')]));});});}; \ No newline at end of file +var _0xe3a3=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Account,\x20%s,\x20%s','message','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','limit','include','model','attributes','map','debug','ShowDynamics365Account','lodash','util'];(function(_0x2da357,_0x1f9b2f){var _0x138fdd=function(_0xe3077d){while(--_0xe3077d){_0x2da357['push'](_0x2da357['shift']());}};_0x138fdd(++_0x1f9b2f);}(_0xe3a3,0x195));var _0x3e3a=function(_0xfc954,_0x5e68fd){_0xfc954=_0xfc954-0x0;var _0x1871d0=_0xe3a3[_0xfc954];return _0x1871d0;};'use strict';var _=require(_0x3e3a('0x0'));var util=require(_0x3e3a('0x1'));var moment=require(_0x3e3a('0x2'));var BPromise=require(_0x3e3a('0x3'));var rs=require(_0x3e3a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3e3a('0x5'))['db'];var utils=require(_0x3e3a('0x6'));var logger=require(_0x3e3a('0x7'))(_0x3e3a('0x8'));var config=require(_0x3e3a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3e3a('0xa')][_0x3e3a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x40c352,_0x12a987,_0x21cd8c){return new BPromise(function(_0x3b7251,_0x47cdcf){return client[_0x3e3a('0xc')](_0x40c352,_0x21cd8c)[_0x3e3a('0xd')](function(_0x48634e){logger[_0x3e3a('0xe')]('Dynamics365Account,\x20%s,\x20%s',_0x12a987,_0x3e3a('0xf'));logger['debug'](_0x3e3a('0x10'),_0x12a987,_0x3e3a('0xf'),JSON[_0x3e3a('0x11')](_0x48634e));if(_0x48634e[_0x3e3a('0x12')]){if(_0x48634e[_0x3e3a('0x12')][_0x3e3a('0x13')]===0x1f4){logger[_0x3e3a('0x12')](_0x3e3a('0x14'),_0x12a987,_0x48634e[_0x3e3a('0x12')][_0x3e3a('0x15')]);return _0x47cdcf(_0x48634e[_0x3e3a('0x12')][_0x3e3a('0x15')]);}logger[_0x3e3a('0x12')](_0x3e3a('0x14'),_0x12a987,_0x48634e['error'][_0x3e3a('0x15')]);return _0x3b7251(_0x48634e['error'][_0x3e3a('0x15')]);}else{logger[_0x3e3a('0xe')]('Dynamics365Account,\x20%s,\x20%s',_0x12a987,_0x3e3a('0xf'));_0x3b7251(_0x48634e[_0x3e3a('0x16')][_0x3e3a('0x15')]);}})[_0x3e3a('0x17')](function(_0x21417e){logger[_0x3e3a('0x12')](_0x3e3a('0x14'),_0x12a987,_0x21417e);_0x47cdcf(_0x21417e);});});}exports[_0x3e3a('0x18')]=function(_0x79f58a){var _0x260616=this;return new Promise(function(_0x4facd0,_0x191810){return db[_0x3e3a('0x19')][_0x3e3a('0x1a')]({'raw':_0x79f58a[_0x3e3a('0x1b')]?_0x79f58a['options'][_0x3e3a('0x1c')]===undefined?!![]:![]:!![],'where':_0x79f58a[_0x3e3a('0x1b')]?_0x79f58a[_0x3e3a('0x1b')][_0x3e3a('0x1d')]||null:null,'attributes':_0x79f58a[_0x3e3a('0x1b')]?_0x79f58a[_0x3e3a('0x1b')]['attributes']||null:null,'limit':_0x79f58a['options']?_0x79f58a[_0x3e3a('0x1b')][_0x3e3a('0x1e')]||null:null,'include':_0x79f58a['options']?_0x79f58a['options'][_0x3e3a('0x1f')]?_['map'](_0x79f58a[_0x3e3a('0x1b')][_0x3e3a('0x1f')],function(_0x4fd526){return{'model':db[_0x4fd526[_0x3e3a('0x20')]],'as':_0x4fd526['as'],'attributes':_0x4fd526[_0x3e3a('0x21')],'include':_0x4fd526['include']?_[_0x3e3a('0x22')](_0x4fd526['include'],function(_0x37108d){return{'model':db[_0x37108d[_0x3e3a('0x20')]],'as':_0x37108d['as'],'attributes':_0x37108d['attributes'],'include':_0x37108d['include']?_[_0x3e3a('0x22')](_0x37108d['include'],function(_0x70d7b){return{'model':db[_0x70d7b[_0x3e3a('0x20')]],'as':_0x70d7b['as'],'attributes':_0x70d7b[_0x3e3a('0x21')]};}):[]};}):[]};}):[]:[]})[_0x3e3a('0xd')](function(_0x3dd07c){logger[_0x3e3a('0xe')]('GetDynamics365Account',_0x79f58a);logger[_0x3e3a('0x23')](_0x3e3a('0x18'),_0x79f58a,JSON[_0x3e3a('0x11')](_0x3dd07c));_0x4facd0(_0x3dd07c);})[_0x3e3a('0x17')](function(_0x129b84){logger[_0x3e3a('0x12')]('GetDynamics365Account',_0x129b84[_0x3e3a('0x15')],_0x79f58a);_0x191810(_0x260616[_0x3e3a('0x12')](0x1f4,_0x129b84[_0x3e3a('0x15')]));});});};exports[_0x3e3a('0x24')]=function(_0x5dea9f){var _0x3e1308=this;return new Promise(function(_0x2d107f,_0x487d79){return db['Dynamics365Account']['find']({'raw':_0x5dea9f['options']?_0x5dea9f[_0x3e3a('0x1b')][_0x3e3a('0x1c')]===undefined?!![]:![]:!![],'where':_0x5dea9f['options']?_0x5dea9f['options'][_0x3e3a('0x1d')]||null:null,'attributes':_0x5dea9f[_0x3e3a('0x1b')]?_0x5dea9f[_0x3e3a('0x1b')][_0x3e3a('0x21')]||null:null,'include':_0x5dea9f[_0x3e3a('0x1b')]?_0x5dea9f[_0x3e3a('0x1b')][_0x3e3a('0x1f')]?_[_0x3e3a('0x22')](_0x5dea9f[_0x3e3a('0x1b')][_0x3e3a('0x1f')],function(_0x568f03){return{'model':db[_0x568f03[_0x3e3a('0x20')]],'as':_0x568f03['as'],'attributes':_0x568f03[_0x3e3a('0x21')],'include':_0x568f03[_0x3e3a('0x1f')]?_[_0x3e3a('0x22')](_0x568f03[_0x3e3a('0x1f')],function(_0x14daf9){return{'model':db[_0x14daf9[_0x3e3a('0x20')]],'as':_0x14daf9['as'],'attributes':_0x14daf9[_0x3e3a('0x21')],'include':_0x14daf9['include']?_[_0x3e3a('0x22')](_0x14daf9[_0x3e3a('0x1f')],function(_0x494498){return{'model':db[_0x494498['model']],'as':_0x494498['as'],'attributes':_0x494498[_0x3e3a('0x21')]};}):[]};}):[]};}):[]:[]})[_0x3e3a('0xd')](function(_0x149699){logger['info'](_0x3e3a('0x24'),_0x5dea9f);logger[_0x3e3a('0x23')]('ShowDynamics365Account',_0x5dea9f,JSON['stringify'](_0x149699));_0x2d107f(_0x149699);})[_0x3e3a('0x17')](function(_0x4f8052){logger[_0x3e3a('0x12')]('ShowDynamics365Account',_0x4f8052[_0x3e3a('0x15')],_0x5dea9f);_0x487d79(_0x3e1308['error'](0x1f4,_0x4f8052[_0x3e3a('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index be22ddf..7511447 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 _0x24ba=['index','/:id','isAuthenticated','show','get','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','update','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intDynamics365Configuration.controller'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x24ba,0xa1));var _0xa24b=function(_0x4e8190,_0x1e485f){_0x4e8190=_0x4e8190-0x0;var _0x11b432=_0x24ba[_0x4e8190];return _0x11b432;};'use strict';var multer=require(_0xa24b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa24b('0x1'));var express=require(_0xa24b('0x2'));var router=express[_0xa24b('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xa24b('0x4'));var interaction=require(_0xa24b('0x5'));var config=require('../../config/environment');var controller=require(_0xa24b('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xa24b('0x7')]);router['get'](_0xa24b('0x8'),auth[_0xa24b('0x9')](),controller[_0xa24b('0xa')]);router[_0xa24b('0xb')](_0xa24b('0xc'),auth[_0xa24b('0x9')](),controller[_0xa24b('0xd')]);router[_0xa24b('0xb')](_0xa24b('0xe'),auth['isAuthenticated'](),controller[_0xa24b('0xf')]);router['get'](_0xa24b('0x10'),auth[_0xa24b('0x9')](),controller[_0xa24b('0x11')]);router[_0xa24b('0x12')]('/',auth[_0xa24b('0x9')](),controller[_0xa24b('0x13')]);router['put']('/:id',auth[_0xa24b('0x9')](),controller[_0xa24b('0x14')]);router[_0xa24b('0x15')](_0xa24b('0x8'),auth[_0xa24b('0x9')](),controller[_0xa24b('0x16')]);module[_0xa24b('0x17')]=router; \ No newline at end of file +var _0xdcfc=['./intDynamics365Configuration.controller','get','index','isAuthenticated','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','put','/:id','update','destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1f4e10,_0x1db2a1){var _0x4c9c4d=function(_0x2b21af){while(--_0x2b21af){_0x1f4e10['push'](_0x1f4e10['shift']());}};_0x4c9c4d(++_0x1db2a1);}(_0xdcfc,0x1c8));var _0xcdcf=function(_0x439450,_0x1682bc){_0x439450=_0x439450-0x0;var _0x570d49=_0xdcfc[_0x439450];return _0x570d49;};'use strict';var multer=require(_0xcdcf('0x0'));var util=require(_0xcdcf('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xcdcf('0x2')]();var fs_extra=require(_0xcdcf('0x3'));var auth=require(_0xcdcf('0x4'));var interaction=require(_0xcdcf('0x5'));var config=require('../../config/environment');var controller=require(_0xcdcf('0x6'));router[_0xcdcf('0x7')]('/',auth['isAuthenticated'](),controller[_0xcdcf('0x8')]);router['get']('/:id',auth[_0xcdcf('0x9')](),controller[_0xcdcf('0xa')]);router['get'](_0xcdcf('0xb'),auth[_0xcdcf('0x9')](),controller[_0xcdcf('0xc')]);router[_0xcdcf('0x7')]('/:id/subjects',auth[_0xcdcf('0x9')](),controller[_0xcdcf('0xd')]);router[_0xcdcf('0x7')](_0xcdcf('0xe'),auth[_0xcdcf('0x9')](),controller[_0xcdcf('0xf')]);router[_0xcdcf('0x10')]('/',auth[_0xcdcf('0x9')](),controller['create']);router[_0xcdcf('0x11')](_0xcdcf('0x12'),auth['isAuthenticated'](),controller[_0xcdcf('0x13')]);router['delete'](_0xcdcf('0x12'),auth[_0xcdcf('0x9')](),controller[_0xcdcf('0x14')]);module[_0xcdcf('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 1b7041b..24edd8d 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 _0x9c38=['ENUM','incident','phonecall','contact','nothing','sequelize','exports','STRING'];(function(_0x3af528,_0x2beded){var _0x4cf2f7=function(_0x2f4ce4){while(--_0x2f4ce4){_0x3af528['push'](_0x3af528['shift']());}};_0x4cf2f7(++_0x2beded);}(_0x9c38,0xe5));var _0x89c3=function(_0x48391d,_0x1be86f){_0x48391d=_0x48391d-0x0;var _0x19419e=_0x9c38[_0x48391d];return _0x19419e;};'use strict';var Sequelize=require(_0x89c3('0x0'));module[_0x89c3('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x89c3('0x2')]},'ticketType':{'type':Sequelize[_0x89c3('0x3')](_0x89c3('0x4'),_0x89c3('0x5')),'defaultValue':_0x89c3('0x4')},'moduleCreate':{'type':Sequelize[_0x89c3('0x3')](_0x89c3('0x6'),_0x89c3('0x7')),'defaultValue':'contact','allowNull':![]}}; \ No newline at end of file +var _0xea07=['sequelize','STRING','ENUM','incident','phonecall','contact'];(function(_0x3408f9,_0x4ef165){var _0x13b6b2=function(_0x5ad13f){while(--_0x5ad13f){_0x3408f9['push'](_0x3408f9['shift']());}};_0x13b6b2(++_0x4ef165);}(_0xea07,0xa8));var _0x7ea0=function(_0x40dc11,_0x57f86a){_0x40dc11=_0x40dc11-0x0;var _0x2e1b2a=_0xea07[_0x40dc11];return _0x2e1b2a;};'use strict';var Sequelize=require(_0x7ea0('0x0'));module['exports']={'name':{'type':Sequelize[_0x7ea0('0x1')]},'description':{'type':Sequelize[_0x7ea0('0x1')]},'ticketType':{'type':Sequelize[_0x7ea0('0x2')](_0x7ea0('0x3'),_0x7ea0('0x4')),'defaultValue':_0x7ea0('0x3')},'moduleCreate':{'type':Sequelize['ENUM'](_0x7ea0('0x5'),'nothing'),'defaultValue':_0x7ea0('0x5'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 9903046..0b8be77 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 _0x20b0=['where','merge','type','VIRTUAL','includeAll','include','findAll','keys','rawAttributes','length','options','catch','create','body','find','params','findOne','Dynamics365Field','intersection','getFields','nolimit','getSubjects','getDescriptions','eml-format','rimraf','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map','Dynamics365Configuration','fieldName','key','model','query','attributes','fields','hasOwnProperty','order','sort','filters','pick','filter'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x20b0,0x1e5));var _0x020b=function(_0x236341,_0x16f0de){_0x236341=_0x236341-0x0;var _0x52aa96=_0x20b0[_0x236341];return _0x52aa96;};'use strict';var emlformat=require(_0x020b('0x0'));var rimraf=require(_0x020b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x020b('0x2'));var moment=require(_0x020b('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x020b('0x4'));var path=require(_0x020b('0x5'));var sox=require(_0x020b('0x6'));var csv=require(_0x020b('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x020b('0x8'));var _=require(_0x020b('0x9'));var squel=require('squel');var crypto=require(_0x020b('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x020b('0xb'));var toCsv=require(_0x020b('0x7'));var querystring=require(_0x020b('0xc'));var Papa=require(_0x020b('0xd'));var Redis=require(_0x020b('0xe'));var authService=require(_0x020b('0xf'));var qs=require(_0x020b('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x020b('0x11'))(_0x020b('0x12'));var utils=require(_0x020b('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x020b('0x14'))['db'];function respondWithStatusCode(_0x5a559d,_0x4bb932){_0x4bb932=_0x4bb932||0xcc;return function(_0x164813){if(_0x164813){return _0x5a559d[_0x020b('0x15')](_0x4bb932);}return _0x5a559d[_0x020b('0x16')](_0x4bb932)[_0x020b('0x17')]();};}function respondWithResult(_0x47bd18,_0x1caffc){_0x1caffc=_0x1caffc||0xc8;return function(_0x1e13da){if(_0x1e13da){return _0x47bd18[_0x020b('0x16')](_0x1caffc)[_0x020b('0x18')](_0x1e13da);}};}function respondWithFilteredResult(_0x352285,_0x11641e){return function(_0xefc155){if(_0xefc155){var _0x365c82=typeof _0x11641e[_0x020b('0x19')]===_0x020b('0x1a')&&typeof _0x11641e[_0x020b('0x1b')]===_0x020b('0x1a');var _0x173798=_0xefc155['count'];var _0x5153d0=_0x365c82?0x0:_0x11641e[_0x020b('0x19')];var _0x288460=_0x365c82?_0xefc155[_0x020b('0x1c')]:_0x11641e[_0x020b('0x19')]+_0x11641e['limit'];var _0x5ecaac;if(_0x288460>=_0x173798){_0x288460=_0x173798;_0x5ecaac=0xc8;}else{_0x5ecaac=0xce;}_0x352285[_0x020b('0x16')](_0x5ecaac);return _0x352285[_0x020b('0x1d')](_0x020b('0x1e'),_0x5153d0+'-'+_0x288460+'/'+_0x173798)[_0x020b('0x18')](_0xefc155);}return null;};}function patchUpdates(_0x228ca0){return function(_0x29e7d0){try{jsonpatch['apply'](_0x29e7d0,_0x228ca0,!![]);}catch(_0x2ef3c3){return BPromise[_0x020b('0x1f')](_0x2ef3c3);}return _0x29e7d0['save']();};}function saveUpdates(_0xea755c,_0x3aad32){return function(_0x33a23c){if(_0x33a23c){return _0x33a23c[_0x020b('0x20')](_0xea755c)[_0x020b('0x21')](function(_0x2796e3){return _0x2796e3;});}return null;};}function removeEntity(_0x39f0c5,_0x473329){return function(_0x151068){if(_0x151068){return _0x151068[_0x020b('0x22')]()['then'](function(){_0x39f0c5['status'](0xcc)[_0x020b('0x17')]();});}};}function handleEntityNotFound(_0x461e8f,_0x2a0148){return function(_0x481f75){if(!_0x481f75){_0x461e8f[_0x020b('0x15')](0x194);}return _0x481f75;};}function handleError(_0x5cf46b,_0x17dd53){_0x17dd53=_0x17dd53||0x1f4;return function(_0x4ddeac){logger[_0x020b('0x23')](_0x4ddeac[_0x020b('0x24')]);if(_0x4ddeac[_0x020b('0x25')]){delete _0x4ddeac['name'];}_0x5cf46b[_0x020b('0x16')](_0x17dd53)[_0x020b('0x26')](_0x4ddeac);};}exports[_0x020b('0x27')]=function(_0x591c02,_0x5bb19f){var _0x4736e1={},_0x4f2f1f={},_0x266bf5={'count':0x0,'rows':[]};var _0x44d015=_[_0x020b('0x28')](db[_0x020b('0x29')]['rawAttributes'],function(_0x425b09){return{'name':_0x425b09[_0x020b('0x2a')],'type':_0x425b09['type'][_0x020b('0x2b')]};});_0x4f2f1f[_0x020b('0x2c')]=_[_0x020b('0x28')](_0x44d015,_0x020b('0x25'));_0x4f2f1f['query']=_['keys'](_0x591c02[_0x020b('0x2d')]);_0x4f2f1f['filters']=_['intersection'](_0x4f2f1f['model'],_0x4f2f1f[_0x020b('0x2d')]);_0x4736e1[_0x020b('0x2e')]=_['intersection'](_0x4f2f1f[_0x020b('0x2c')],qs[_0x020b('0x2f')](_0x591c02[_0x020b('0x2d')]['fields']));_0x4736e1[_0x020b('0x2e')]=_0x4736e1[_0x020b('0x2e')]['length']?_0x4736e1[_0x020b('0x2e')]:_0x4f2f1f[_0x020b('0x2c')];if(!_0x591c02[_0x020b('0x2d')][_0x020b('0x30')]('nolimit')){_0x4736e1[_0x020b('0x1b')]=qs[_0x020b('0x1b')](_0x591c02[_0x020b('0x2d')][_0x020b('0x1b')]);_0x4736e1['offset']=qs[_0x020b('0x19')](_0x591c02[_0x020b('0x2d')][_0x020b('0x19')]);}_0x4736e1[_0x020b('0x31')]=qs[_0x020b('0x32')](_0x591c02[_0x020b('0x2d')][_0x020b('0x32')]);_0x4736e1['where']=qs[_0x020b('0x33')](_[_0x020b('0x34')](_0x591c02['query'],_0x4f2f1f['filters']),_0x44d015);if(_0x591c02[_0x020b('0x2d')][_0x020b('0x35')]){_0x4736e1[_0x020b('0x36')]=_[_0x020b('0x37')](_0x4736e1[_0x020b('0x36')],{'$or':_['map'](_0x44d015,function(_0x3aa3d5){if(_0x3aa3d5[_0x020b('0x38')]!==_0x020b('0x39')){var _0x1c8129={};_0x1c8129[_0x3aa3d5['name']]={'$like':'%'+_0x591c02['query'][_0x020b('0x35')]+'%'};return _0x1c8129;}})});}_0x4736e1=_['merge']({},_0x4736e1,_0x591c02['options']);var _0x9dfa84={'where':_0x4736e1[_0x020b('0x36')]};return db[_0x020b('0x29')][_0x020b('0x1c')](_0x9dfa84)[_0x020b('0x21')](function(_0x5b38c1){_0x266bf5[_0x020b('0x1c')]=_0x5b38c1;if(_0x591c02['query'][_0x020b('0x3a')]){_0x4736e1[_0x020b('0x3b')]=[{'all':!![]}];}return db[_0x020b('0x29')][_0x020b('0x3c')](_0x4736e1);})[_0x020b('0x21')](function(_0x58ac47){_0x266bf5['rows']=_0x58ac47;return _0x266bf5;})[_0x020b('0x21')](respondWithFilteredResult(_0x5bb19f,_0x4736e1))['catch'](handleError(_0x5bb19f,null));};exports['show']=function(_0x36c810,_0x3e88a8){var _0x403b5a={'raw':![],'where':{'id':_0x36c810['params']['id']}},_0x1acebb={};_0x1acebb[_0x020b('0x2c')]=_[_0x020b('0x3d')](db[_0x020b('0x29')][_0x020b('0x3e')]);_0x1acebb[_0x020b('0x2d')]=_[_0x020b('0x3d')](_0x36c810['query']);_0x1acebb['filters']=_['intersection'](_0x1acebb['model'],_0x1acebb[_0x020b('0x2d')]);_0x403b5a[_0x020b('0x2e')]=_['intersection'](_0x1acebb[_0x020b('0x2c')],qs[_0x020b('0x2f')](_0x36c810['query'][_0x020b('0x2f')]));_0x403b5a[_0x020b('0x2e')]=_0x403b5a[_0x020b('0x2e')][_0x020b('0x3f')]?_0x403b5a['attributes']:_0x1acebb[_0x020b('0x2c')];if(_0x36c810[_0x020b('0x2d')]['includeAll']){_0x403b5a[_0x020b('0x3b')]=[{'all':!![]}];}_0x403b5a=_[_0x020b('0x37')]({},_0x403b5a,_0x36c810[_0x020b('0x40')]);return db[_0x020b('0x29')]['find'](_0x403b5a)[_0x020b('0x21')](handleEntityNotFound(_0x3e88a8,null))[_0x020b('0x21')](respondWithResult(_0x3e88a8,null))[_0x020b('0x41')](handleError(_0x3e88a8,null));};exports[_0x020b('0x42')]=function(_0x27f1d2,_0x4bb6f9){return db[_0x020b('0x29')][_0x020b('0x42')](_0x27f1d2[_0x020b('0x43')],{})['then'](respondWithResult(_0x4bb6f9,0xc9))[_0x020b('0x41')](handleError(_0x4bb6f9,null));};exports[_0x020b('0x20')]=function(_0x343487,_0x308e6f){if(_0x343487[_0x020b('0x43')]['id']){delete _0x343487[_0x020b('0x43')]['id'];}return db[_0x020b('0x29')][_0x020b('0x44')]({'where':{'id':_0x343487['params']['id']}})['then'](handleEntityNotFound(_0x308e6f,null))[_0x020b('0x21')](saveUpdates(_0x343487[_0x020b('0x43')],null))[_0x020b('0x21')](respondWithResult(_0x308e6f,null))[_0x020b('0x41')](handleError(_0x308e6f,null));};exports[_0x020b('0x22')]=function(_0x3e2dfb,_0x460376){return db[_0x020b('0x29')]['find']({'where':{'id':_0x3e2dfb[_0x020b('0x45')]['id']}})[_0x020b('0x21')](handleEntityNotFound(_0x460376,null))[_0x020b('0x21')](removeEntity(_0x460376,null))['catch'](handleError(_0x460376,null));};exports['getFields']=function(_0x36ae89,_0x48c08a,_0x58ffdc){var _0x28d3a6={};var _0x25ed74={};var _0x3932a9;var _0x3002c1;return db['Dynamics365Configuration'][_0x020b('0x46')]({'where':{'id':_0x36ae89['params']['id']}})['then'](handleEntityNotFound(_0x48c08a,null))['then'](function(_0x5128e0){if(_0x5128e0){_0x3932a9=_0x5128e0;_0x25ed74[_0x020b('0x2c')]=_[_0x020b('0x3d')](db[_0x020b('0x47')][_0x020b('0x3e')]);_0x25ed74[_0x020b('0x2d')]=_[_0x020b('0x3d')](_0x36ae89[_0x020b('0x2d')]);_0x25ed74[_0x020b('0x33')]=_[_0x020b('0x48')](_0x25ed74[_0x020b('0x2c')],_0x25ed74[_0x020b('0x2d')]);_0x28d3a6['attributes']=_[_0x020b('0x48')](_0x25ed74['model'],qs['fields'](_0x36ae89[_0x020b('0x2d')]['fields']));_0x28d3a6[_0x020b('0x2e')]=_0x28d3a6[_0x020b('0x2e')]['length']?_0x28d3a6[_0x020b('0x2e')]:_0x25ed74['model'];_0x28d3a6[_0x020b('0x31')]=qs['sort'](_0x36ae89['query'][_0x020b('0x32')]);_0x28d3a6[_0x020b('0x36')]=qs[_0x020b('0x33')](_['pick'](_0x36ae89[_0x020b('0x2d')],_0x25ed74[_0x020b('0x33')]));if(_0x36ae89['query'][_0x020b('0x35')]){_0x28d3a6[_0x020b('0x36')]=_['merge'](_0x28d3a6['where'],{'$or':_[_0x020b('0x28')](_0x28d3a6[_0x020b('0x2e')],function(_0x10ff61){var _0x36fbc6={};_0x36fbc6[_0x10ff61]={'$like':'%'+_0x36ae89[_0x020b('0x2d')][_0x020b('0x35')]+'%'};return _0x36fbc6;})});}_0x28d3a6=_[_0x020b('0x37')]({},_0x28d3a6,_0x36ae89[_0x020b('0x40')]);return _0x3932a9[_0x020b('0x49')](_0x28d3a6);}})['then'](function(_0x56892a){if(_0x56892a){_0x3002c1=_0x56892a['length'];if(!_0x36ae89['query'][_0x020b('0x30')](_0x020b('0x4a'))){_0x28d3a6['limit']=qs[_0x020b('0x1b')](_0x36ae89['query'][_0x020b('0x1b')]);_0x28d3a6[_0x020b('0x19')]=qs[_0x020b('0x19')](_0x36ae89[_0x020b('0x2d')][_0x020b('0x19')]);}return _0x3932a9[_0x020b('0x49')](_0x28d3a6);}})[_0x020b('0x21')](function(_0x65152a){if(_0x65152a){return _0x65152a?{'count':_0x3002c1,'rows':_0x65152a}:null;}})['then'](respondWithResult(_0x48c08a,null))[_0x020b('0x41')](handleError(_0x48c08a,null));};exports[_0x020b('0x4b')]=function(_0x2be3,_0x4ef8d2,_0x500418){var _0x5bc94c={};var _0x1cf434={};var _0x58a326;var _0x469e41;return db[_0x020b('0x29')][_0x020b('0x46')]({'where':{'id':_0x2be3['params']['id']}})[_0x020b('0x21')](handleEntityNotFound(_0x4ef8d2,null))[_0x020b('0x21')](function(_0x54cbf2){if(_0x54cbf2){_0x58a326=_0x54cbf2;_0x1cf434[_0x020b('0x2c')]=_['keys'](db['Dynamics365Field'][_0x020b('0x3e')]);_0x1cf434[_0x020b('0x2d')]=_[_0x020b('0x3d')](_0x2be3[_0x020b('0x2d')]);_0x1cf434['filters']=_[_0x020b('0x48')](_0x1cf434[_0x020b('0x2c')],_0x1cf434[_0x020b('0x2d')]);_0x5bc94c[_0x020b('0x2e')]=_[_0x020b('0x48')](_0x1cf434[_0x020b('0x2c')],qs[_0x020b('0x2f')](_0x2be3['query'][_0x020b('0x2f')]));_0x5bc94c[_0x020b('0x2e')]=_0x5bc94c[_0x020b('0x2e')][_0x020b('0x3f')]?_0x5bc94c['attributes']:_0x1cf434[_0x020b('0x2c')];_0x5bc94c[_0x020b('0x31')]=qs[_0x020b('0x32')](_0x2be3[_0x020b('0x2d')]['sort']);_0x5bc94c[_0x020b('0x36')]=qs[_0x020b('0x33')](_[_0x020b('0x34')](_0x2be3[_0x020b('0x2d')],_0x1cf434[_0x020b('0x33')]));if(_0x2be3[_0x020b('0x2d')]['filter']){_0x5bc94c[_0x020b('0x36')]=_['merge'](_0x5bc94c[_0x020b('0x36')],{'$or':_[_0x020b('0x28')](_0x5bc94c[_0x020b('0x2e')],function(_0x36b470){var _0x5bcd93={};_0x5bcd93[_0x36b470]={'$like':'%'+_0x2be3[_0x020b('0x2d')]['filter']+'%'};return _0x5bcd93;})});}_0x5bc94c=_[_0x020b('0x37')]({},_0x5bc94c,_0x2be3['options']);return _0x58a326[_0x020b('0x4b')](_0x5bc94c);}})[_0x020b('0x21')](function(_0x69d813){if(_0x69d813){_0x469e41=_0x69d813[_0x020b('0x3f')];if(!_0x2be3[_0x020b('0x2d')][_0x020b('0x30')](_0x020b('0x4a'))){_0x5bc94c[_0x020b('0x1b')]=qs[_0x020b('0x1b')](_0x2be3[_0x020b('0x2d')][_0x020b('0x1b')]);_0x5bc94c[_0x020b('0x19')]=qs[_0x020b('0x19')](_0x2be3[_0x020b('0x2d')][_0x020b('0x19')]);}return _0x58a326['getSubjects'](_0x5bc94c);}})[_0x020b('0x21')](function(_0x1a37db){if(_0x1a37db){return _0x1a37db?{'count':_0x469e41,'rows':_0x1a37db}:null;}})[_0x020b('0x21')](respondWithResult(_0x4ef8d2,null))[_0x020b('0x41')](handleError(_0x4ef8d2,null));};exports['getDescriptions']=function(_0x113d2d,_0x219aa7,_0x480a9d){var _0x25527d={};var _0x381f9d={};var _0x3900d4;var _0x3191a1;return db[_0x020b('0x29')][_0x020b('0x46')]({'where':{'id':_0x113d2d[_0x020b('0x45')]['id']}})['then'](handleEntityNotFound(_0x219aa7,null))[_0x020b('0x21')](function(_0xb5f6e){if(_0xb5f6e){_0x3900d4=_0xb5f6e;_0x381f9d[_0x020b('0x2c')]=_[_0x020b('0x3d')](db[_0x020b('0x47')][_0x020b('0x3e')]);_0x381f9d[_0x020b('0x2d')]=_[_0x020b('0x3d')](_0x113d2d[_0x020b('0x2d')]);_0x381f9d['filters']=_['intersection'](_0x381f9d['model'],_0x381f9d[_0x020b('0x2d')]);_0x25527d[_0x020b('0x2e')]=_[_0x020b('0x48')](_0x381f9d[_0x020b('0x2c')],qs[_0x020b('0x2f')](_0x113d2d[_0x020b('0x2d')][_0x020b('0x2f')]));_0x25527d[_0x020b('0x2e')]=_0x25527d[_0x020b('0x2e')][_0x020b('0x3f')]?_0x25527d['attributes']:_0x381f9d[_0x020b('0x2c')];_0x25527d[_0x020b('0x31')]=qs[_0x020b('0x32')](_0x113d2d[_0x020b('0x2d')][_0x020b('0x32')]);_0x25527d['where']=qs[_0x020b('0x33')](_[_0x020b('0x34')](_0x113d2d[_0x020b('0x2d')],_0x381f9d[_0x020b('0x33')]));if(_0x113d2d['query'][_0x020b('0x35')]){_0x25527d[_0x020b('0x36')]=_['merge'](_0x25527d['where'],{'$or':_[_0x020b('0x28')](_0x25527d['attributes'],function(_0x5d4fe3){var _0x533c10={};_0x533c10[_0x5d4fe3]={'$like':'%'+_0x113d2d[_0x020b('0x2d')][_0x020b('0x35')]+'%'};return _0x533c10;})});}_0x25527d=_[_0x020b('0x37')]({},_0x25527d,_0x113d2d['options']);return _0x3900d4[_0x020b('0x4c')](_0x25527d);}})[_0x020b('0x21')](function(_0x1a1d9b){if(_0x1a1d9b){_0x3191a1=_0x1a1d9b[_0x020b('0x3f')];if(!_0x113d2d['query']['hasOwnProperty'](_0x020b('0x4a'))){_0x25527d[_0x020b('0x1b')]=qs[_0x020b('0x1b')](_0x113d2d[_0x020b('0x2d')][_0x020b('0x1b')]);_0x25527d[_0x020b('0x19')]=qs[_0x020b('0x19')](_0x113d2d[_0x020b('0x2d')][_0x020b('0x19')]);}return _0x3900d4[_0x020b('0x4c')](_0x25527d);}})['then'](function(_0x1b9663){if(_0x1b9663){return _0x1b9663?{'count':_0x3191a1,'rows':_0x1b9663}:null;}})[_0x020b('0x21')](respondWithResult(_0x219aa7,null))['catch'](handleError(_0x219aa7,null));}; \ No newline at end of file +var _0x72ad=['undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','Dynamics365Configuration','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','create','body','find','getFields','Dynamics365Field','nolimit','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','limit'];(function(_0x35e92e,_0x21581b){var _0x1205a8=function(_0x4325d8){while(--_0x4325d8){_0x35e92e['push'](_0x35e92e['shift']());}};_0x1205a8(++_0x21581b);}(_0x72ad,0x87));var _0xd72a=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x72ad[_0x5b561d];return _0x431060;};'use strict';var emlformat=require(_0xd72a('0x0'));var rimraf=require(_0xd72a('0x1'));var zipdir=require(_0xd72a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd72a('0x3'));var moment=require(_0xd72a('0x4'));var BPromise=require(_0xd72a('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd72a('0x6'));var sox=require(_0xd72a('0x7'));var csv=require(_0xd72a('0x8'));var ejs=require(_0xd72a('0x9'));var fs=require('fs');var fs_extra=require(_0xd72a('0xa'));var _=require(_0xd72a('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd72a('0xc'));var deskjs=require(_0xd72a('0xd'));var toCsv=require(_0xd72a('0x8'));var querystring=require(_0xd72a('0xe'));var Papa=require(_0xd72a('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd72a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd72a('0x11'));var logger=require(_0xd72a('0x12'))(_0xd72a('0x13'));var utils=require(_0xd72a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xd72a('0x15'));var db=require(_0xd72a('0x16'))['db'];function respondWithStatusCode(_0x5b9152,_0xde7ce2){_0xde7ce2=_0xde7ce2||0xcc;return function(_0xbed4ac){if(_0xbed4ac){return _0x5b9152['sendStatus'](_0xde7ce2);}return _0x5b9152[_0xd72a('0x17')](_0xde7ce2)[_0xd72a('0x18')]();};}function respondWithResult(_0x13a399,_0x50d0b2){_0x50d0b2=_0x50d0b2||0xc8;return function(_0x554e35){if(_0x554e35){return _0x13a399[_0xd72a('0x17')](_0x50d0b2)['json'](_0x554e35);}};}function respondWithFilteredResult(_0x45f119,_0x469411){return function(_0x9da2b6){if(_0x9da2b6){var _0x453082=typeof _0x469411[_0xd72a('0x19')]==='undefined'&&typeof _0x469411[_0xd72a('0x1a')]===_0xd72a('0x1b');var _0x102b37=_0x9da2b6[_0xd72a('0x1c')];var _0x5ecb85=_0x453082?0x0:_0x469411[_0xd72a('0x19')];var _0x39b563=_0x453082?_0x9da2b6[_0xd72a('0x1c')]:_0x469411[_0xd72a('0x19')]+_0x469411[_0xd72a('0x1a')];var _0x18c1d4;if(_0x39b563>=_0x102b37){_0x39b563=_0x102b37;_0x18c1d4=0xc8;}else{_0x18c1d4=0xce;}_0x45f119[_0xd72a('0x17')](_0x18c1d4);return _0x45f119[_0xd72a('0x1d')](_0xd72a('0x1e'),_0x5ecb85+'-'+_0x39b563+'/'+_0x102b37)[_0xd72a('0x1f')](_0x9da2b6);}return null;};}function patchUpdates(_0x1c76f2){return function(_0x40b568){try{jsonpatch[_0xd72a('0x20')](_0x40b568,_0x1c76f2,!![]);}catch(_0x2987d2){return BPromise[_0xd72a('0x21')](_0x2987d2);}return _0x40b568[_0xd72a('0x22')]();};}function saveUpdates(_0x3a3d4f,_0x445d52){return function(_0x138198){if(_0x138198){return _0x138198[_0xd72a('0x23')](_0x3a3d4f)[_0xd72a('0x24')](function(_0x8617c1){return _0x8617c1;});}return null;};}function removeEntity(_0x51dfa3,_0x5a0904){return function(_0x362b50){if(_0x362b50){return _0x362b50[_0xd72a('0x25')]()['then'](function(){_0x51dfa3['status'](0xcc)[_0xd72a('0x18')]();});}};}function handleEntityNotFound(_0x18be43,_0x502ee3){return function(_0x2e2f3a){if(!_0x2e2f3a){_0x18be43['sendStatus'](0x194);}return _0x2e2f3a;};}function handleError(_0x2c7c36,_0x3aca0a){_0x3aca0a=_0x3aca0a||0x1f4;return function(_0x433b4f){logger[_0xd72a('0x26')](_0x433b4f[_0xd72a('0x27')]);if(_0x433b4f[_0xd72a('0x28')]){delete _0x433b4f['name'];}_0x2c7c36[_0xd72a('0x17')](_0x3aca0a)[_0xd72a('0x29')](_0x433b4f);};}exports[_0xd72a('0x2a')]=function(_0x24d39e,_0x2d5823){var _0x288a58={},_0x4d21b6={},_0x286d1e={'count':0x0,'rows':[]};var _0x2356d1=_[_0xd72a('0x2b')](db[_0xd72a('0x2c')]['rawAttributes'],function(_0x47d4ff){return{'name':_0x47d4ff[_0xd72a('0x2d')],'type':_0x47d4ff[_0xd72a('0x2e')]['key']};});_0x4d21b6[_0xd72a('0x2f')]=_['map'](_0x2356d1,_0xd72a('0x28'));_0x4d21b6[_0xd72a('0x30')]=_[_0xd72a('0x31')](_0x24d39e[_0xd72a('0x30')]);_0x4d21b6[_0xd72a('0x32')]=_[_0xd72a('0x33')](_0x4d21b6[_0xd72a('0x2f')],_0x4d21b6[_0xd72a('0x30')]);_0x288a58[_0xd72a('0x34')]=_[_0xd72a('0x33')](_0x4d21b6[_0xd72a('0x2f')],qs[_0xd72a('0x35')](_0x24d39e['query'][_0xd72a('0x35')]));_0x288a58[_0xd72a('0x34')]=_0x288a58['attributes'][_0xd72a('0x36')]?_0x288a58['attributes']:_0x4d21b6[_0xd72a('0x2f')];if(!_0x24d39e['query'][_0xd72a('0x37')]('nolimit')){_0x288a58[_0xd72a('0x1a')]=qs[_0xd72a('0x1a')](_0x24d39e[_0xd72a('0x30')]['limit']);_0x288a58[_0xd72a('0x19')]=qs[_0xd72a('0x19')](_0x24d39e[_0xd72a('0x30')][_0xd72a('0x19')]);}_0x288a58[_0xd72a('0x38')]=qs['sort'](_0x24d39e['query'][_0xd72a('0x39')]);_0x288a58[_0xd72a('0x3a')]=qs[_0xd72a('0x32')](_[_0xd72a('0x3b')](_0x24d39e['query'],_0x4d21b6[_0xd72a('0x32')]),_0x2356d1);if(_0x24d39e[_0xd72a('0x30')][_0xd72a('0x3c')]){_0x288a58['where']=_[_0xd72a('0x3d')](_0x288a58[_0xd72a('0x3a')],{'$or':_[_0xd72a('0x2b')](_0x2356d1,function(_0x445640){if(_0x445640[_0xd72a('0x2e')]!==_0xd72a('0x3e')){var _0x3e03e5={};_0x3e03e5[_0x445640[_0xd72a('0x28')]]={'$like':'%'+_0x24d39e[_0xd72a('0x30')][_0xd72a('0x3c')]+'%'};return _0x3e03e5;}})});}_0x288a58=_[_0xd72a('0x3d')]({},_0x288a58,_0x24d39e[_0xd72a('0x3f')]);var _0x33f843={'where':_0x288a58[_0xd72a('0x3a')]};return db[_0xd72a('0x2c')]['count'](_0x33f843)['then'](function(_0x16bfcd){_0x286d1e['count']=_0x16bfcd;if(_0x24d39e[_0xd72a('0x30')]['includeAll']){_0x288a58[_0xd72a('0x40')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0xd72a('0x41')](_0x288a58);})[_0xd72a('0x24')](function(_0x192ae1){_0x286d1e[_0xd72a('0x42')]=_0x192ae1;return _0x286d1e;})[_0xd72a('0x24')](respondWithFilteredResult(_0x2d5823,_0x288a58))[_0xd72a('0x43')](handleError(_0x2d5823,null));};exports[_0xd72a('0x44')]=function(_0x366971,_0x49cc52){var _0x1de959={'raw':![],'where':{'id':_0x366971[_0xd72a('0x45')]['id']}},_0x24a161={};_0x24a161[_0xd72a('0x2f')]=_[_0xd72a('0x31')](db[_0xd72a('0x2c')][_0xd72a('0x46')]);_0x24a161[_0xd72a('0x30')]=_[_0xd72a('0x31')](_0x366971['query']);_0x24a161[_0xd72a('0x32')]=_[_0xd72a('0x33')](_0x24a161['model'],_0x24a161[_0xd72a('0x30')]);_0x1de959[_0xd72a('0x34')]=_[_0xd72a('0x33')](_0x24a161[_0xd72a('0x2f')],qs[_0xd72a('0x35')](_0x366971['query']['fields']));_0x1de959[_0xd72a('0x34')]=_0x1de959[_0xd72a('0x34')][_0xd72a('0x36')]?_0x1de959[_0xd72a('0x34')]:_0x24a161[_0xd72a('0x2f')];if(_0x366971['query'][_0xd72a('0x47')]){_0x1de959[_0xd72a('0x40')]=[{'all':!![]}];}_0x1de959=_['merge']({},_0x1de959,_0x366971[_0xd72a('0x3f')]);return db[_0xd72a('0x2c')]['find'](_0x1de959)[_0xd72a('0x24')](handleEntityNotFound(_0x49cc52,null))[_0xd72a('0x24')](respondWithResult(_0x49cc52,null))[_0xd72a('0x43')](handleError(_0x49cc52,null));};exports['create']=function(_0x2aa7a2,_0x1fe6b){return db[_0xd72a('0x2c')][_0xd72a('0x48')](_0x2aa7a2[_0xd72a('0x49')],{})['then'](respondWithResult(_0x1fe6b,0xc9))[_0xd72a('0x43')](handleError(_0x1fe6b,null));};exports['update']=function(_0x4ae556,_0x567ff4){if(_0x4ae556[_0xd72a('0x49')]['id']){delete _0x4ae556[_0xd72a('0x49')]['id'];}return db['Dynamics365Configuration'][_0xd72a('0x4a')]({'where':{'id':_0x4ae556[_0xd72a('0x45')]['id']}})['then'](handleEntityNotFound(_0x567ff4,null))[_0xd72a('0x24')](saveUpdates(_0x4ae556[_0xd72a('0x49')],null))[_0xd72a('0x24')](respondWithResult(_0x567ff4,null))[_0xd72a('0x43')](handleError(_0x567ff4,null));};exports[_0xd72a('0x25')]=function(_0x1d2c4e,_0x55a0d4){return db[_0xd72a('0x2c')][_0xd72a('0x4a')]({'where':{'id':_0x1d2c4e['params']['id']}})[_0xd72a('0x24')](handleEntityNotFound(_0x55a0d4,null))[_0xd72a('0x24')](removeEntity(_0x55a0d4,null))[_0xd72a('0x43')](handleError(_0x55a0d4,null));};exports[_0xd72a('0x4b')]=function(_0x19540a,_0x5449df,_0x1d27a3){var _0x562d76={};var _0x2b4228={};var _0xef4042;var _0x1a7d75;return db[_0xd72a('0x2c')]['findOne']({'where':{'id':_0x19540a[_0xd72a('0x45')]['id']}})[_0xd72a('0x24')](handleEntityNotFound(_0x5449df,null))[_0xd72a('0x24')](function(_0x3c0d82){if(_0x3c0d82){_0xef4042=_0x3c0d82;_0x2b4228[_0xd72a('0x2f')]=_[_0xd72a('0x31')](db[_0xd72a('0x4c')]['rawAttributes']);_0x2b4228[_0xd72a('0x30')]=_[_0xd72a('0x31')](_0x19540a['query']);_0x2b4228[_0xd72a('0x32')]=_[_0xd72a('0x33')](_0x2b4228[_0xd72a('0x2f')],_0x2b4228[_0xd72a('0x30')]);_0x562d76['attributes']=_[_0xd72a('0x33')](_0x2b4228[_0xd72a('0x2f')],qs['fields'](_0x19540a[_0xd72a('0x30')]['fields']));_0x562d76[_0xd72a('0x34')]=_0x562d76[_0xd72a('0x34')]['length']?_0x562d76[_0xd72a('0x34')]:_0x2b4228[_0xd72a('0x2f')];_0x562d76[_0xd72a('0x38')]=qs[_0xd72a('0x39')](_0x19540a['query'][_0xd72a('0x39')]);_0x562d76[_0xd72a('0x3a')]=qs[_0xd72a('0x32')](_['pick'](_0x19540a[_0xd72a('0x30')],_0x2b4228['filters']));if(_0x19540a[_0xd72a('0x30')]['filter']){_0x562d76['where']=_[_0xd72a('0x3d')](_0x562d76[_0xd72a('0x3a')],{'$or':_[_0xd72a('0x2b')](_0x562d76['attributes'],function(_0x4c2a02){var _0x51305a={};_0x51305a[_0x4c2a02]={'$like':'%'+_0x19540a[_0xd72a('0x30')][_0xd72a('0x3c')]+'%'};return _0x51305a;})});}_0x562d76=_['merge']({},_0x562d76,_0x19540a[_0xd72a('0x3f')]);return _0xef4042[_0xd72a('0x4b')](_0x562d76);}})[_0xd72a('0x24')](function(_0x2da212){if(_0x2da212){_0x1a7d75=_0x2da212[_0xd72a('0x36')];if(!_0x19540a['query'][_0xd72a('0x37')](_0xd72a('0x4d'))){_0x562d76['limit']=qs[_0xd72a('0x1a')](_0x19540a[_0xd72a('0x30')]['limit']);_0x562d76[_0xd72a('0x19')]=qs[_0xd72a('0x19')](_0x19540a[_0xd72a('0x30')][_0xd72a('0x19')]);}return _0xef4042[_0xd72a('0x4b')](_0x562d76);}})[_0xd72a('0x24')](function(_0xfc640b){if(_0xfc640b){return _0xfc640b?{'count':_0x1a7d75,'rows':_0xfc640b}:null;}})[_0xd72a('0x24')](respondWithResult(_0x5449df,null))['catch'](handleError(_0x5449df,null));};exports[_0xd72a('0x4e')]=function(_0x3af6c8,_0x55eabd,_0x1dec19){var _0x433ccd={};var _0x5eb4e0={};var _0x39f55f;var _0x22335b;return db[_0xd72a('0x2c')][_0xd72a('0x4f')]({'where':{'id':_0x3af6c8['params']['id']}})[_0xd72a('0x24')](handleEntityNotFound(_0x55eabd,null))[_0xd72a('0x24')](function(_0x3ec285){if(_0x3ec285){_0x39f55f=_0x3ec285;_0x5eb4e0[_0xd72a('0x2f')]=_['keys'](db['Dynamics365Field'][_0xd72a('0x46')]);_0x5eb4e0[_0xd72a('0x30')]=_[_0xd72a('0x31')](_0x3af6c8[_0xd72a('0x30')]);_0x5eb4e0[_0xd72a('0x32')]=_['intersection'](_0x5eb4e0['model'],_0x5eb4e0['query']);_0x433ccd[_0xd72a('0x34')]=_[_0xd72a('0x33')](_0x5eb4e0['model'],qs[_0xd72a('0x35')](_0x3af6c8[_0xd72a('0x30')][_0xd72a('0x35')]));_0x433ccd[_0xd72a('0x34')]=_0x433ccd['attributes'][_0xd72a('0x36')]?_0x433ccd[_0xd72a('0x34')]:_0x5eb4e0[_0xd72a('0x2f')];_0x433ccd['order']=qs[_0xd72a('0x39')](_0x3af6c8[_0xd72a('0x30')]['sort']);_0x433ccd[_0xd72a('0x3a')]=qs[_0xd72a('0x32')](_['pick'](_0x3af6c8[_0xd72a('0x30')],_0x5eb4e0[_0xd72a('0x32')]));if(_0x3af6c8['query'][_0xd72a('0x3c')]){_0x433ccd[_0xd72a('0x3a')]=_[_0xd72a('0x3d')](_0x433ccd['where'],{'$or':_[_0xd72a('0x2b')](_0x433ccd[_0xd72a('0x34')],function(_0x16c0ce){var _0x219033={};_0x219033[_0x16c0ce]={'$like':'%'+_0x3af6c8[_0xd72a('0x30')]['filter']+'%'};return _0x219033;})});}_0x433ccd=_[_0xd72a('0x3d')]({},_0x433ccd,_0x3af6c8['options']);return _0x39f55f[_0xd72a('0x4e')](_0x433ccd);}})[_0xd72a('0x24')](function(_0x1f86f8){if(_0x1f86f8){_0x22335b=_0x1f86f8[_0xd72a('0x36')];if(!_0x3af6c8[_0xd72a('0x30')][_0xd72a('0x37')](_0xd72a('0x4d'))){_0x433ccd[_0xd72a('0x1a')]=qs[_0xd72a('0x1a')](_0x3af6c8[_0xd72a('0x30')][_0xd72a('0x1a')]);_0x433ccd[_0xd72a('0x19')]=qs[_0xd72a('0x19')](_0x3af6c8[_0xd72a('0x30')]['offset']);}return _0x39f55f[_0xd72a('0x4e')](_0x433ccd);}})['then'](function(_0x172e9f){if(_0x172e9f){return _0x172e9f?{'count':_0x22335b,'rows':_0x172e9f}:null;}})[_0xd72a('0x24')](respondWithResult(_0x55eabd,null))[_0xd72a('0x43')](handleError(_0x55eabd,null));};exports[_0xd72a('0x50')]=function(_0x54624b,_0x36d44d,_0x3fa5f2){var _0x212c7c={};var _0x22bcf8={};var _0xbca06c;var _0x416682;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x54624b[_0xd72a('0x45')]['id']}})[_0xd72a('0x24')](handleEntityNotFound(_0x36d44d,null))[_0xd72a('0x24')](function(_0x5fdc0d){if(_0x5fdc0d){_0xbca06c=_0x5fdc0d;_0x22bcf8[_0xd72a('0x2f')]=_['keys'](db[_0xd72a('0x4c')]['rawAttributes']);_0x22bcf8['query']=_[_0xd72a('0x31')](_0x54624b[_0xd72a('0x30')]);_0x22bcf8[_0xd72a('0x32')]=_['intersection'](_0x22bcf8['model'],_0x22bcf8[_0xd72a('0x30')]);_0x212c7c[_0xd72a('0x34')]=_[_0xd72a('0x33')](_0x22bcf8[_0xd72a('0x2f')],qs['fields'](_0x54624b['query']['fields']));_0x212c7c[_0xd72a('0x34')]=_0x212c7c[_0xd72a('0x34')][_0xd72a('0x36')]?_0x212c7c[_0xd72a('0x34')]:_0x22bcf8[_0xd72a('0x2f')];_0x212c7c['order']=qs['sort'](_0x54624b[_0xd72a('0x30')]['sort']);_0x212c7c[_0xd72a('0x3a')]=qs[_0xd72a('0x32')](_[_0xd72a('0x3b')](_0x54624b[_0xd72a('0x30')],_0x22bcf8[_0xd72a('0x32')]));if(_0x54624b[_0xd72a('0x30')][_0xd72a('0x3c')]){_0x212c7c[_0xd72a('0x3a')]=_[_0xd72a('0x3d')](_0x212c7c[_0xd72a('0x3a')],{'$or':_[_0xd72a('0x2b')](_0x212c7c[_0xd72a('0x34')],function(_0x17fae7){var _0x1aacc1={};_0x1aacc1[_0x17fae7]={'$like':'%'+_0x54624b[_0xd72a('0x30')][_0xd72a('0x3c')]+'%'};return _0x1aacc1;})});}_0x212c7c=_['merge']({},_0x212c7c,_0x54624b[_0xd72a('0x3f')]);return _0xbca06c[_0xd72a('0x50')](_0x212c7c);}})[_0xd72a('0x24')](function(_0x21f73e){if(_0x21f73e){_0x416682=_0x21f73e[_0xd72a('0x36')];if(!_0x54624b[_0xd72a('0x30')][_0xd72a('0x37')](_0xd72a('0x4d'))){_0x212c7c[_0xd72a('0x1a')]=qs[_0xd72a('0x1a')](_0x54624b[_0xd72a('0x30')]['limit']);_0x212c7c[_0xd72a('0x19')]=qs[_0xd72a('0x19')](_0x54624b[_0xd72a('0x30')][_0xd72a('0x19')]);}return _0xbca06c[_0xd72a('0x50')](_0x212c7c);}})[_0xd72a('0x24')](function(_0x2daac0){if(_0x2daac0){return _0x2daac0?{'count':_0x416682,'rows':_0x2daac0}:null;}})['then'](respondWithResult(_0x36d44d,null))['catch'](handleError(_0x36d44d,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index d85ba10..1d60e05 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 _0x9bde=['request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','util','api','bluebird'];(function(_0x4e3252,_0x5888f8){var _0x41589f=function(_0x5aabf9){while(--_0x5aabf9){_0x4e3252['push'](_0x4e3252['shift']());}};_0x41589f(++_0x5888f8);}(_0x9bde,0xe1));var _0xe9bd=function(_0x1cb02c,_0x3f4bd0){_0x1cb02c=_0x1cb02c-0x0;var _0x397c4c=_0x9bde[_0x1cb02c];return _0x397c4c;};'use strict';var _=require('lodash');var util=require(_0xe9bd('0x0'));var logger=require('../../config/logger')(_0xe9bd('0x1'));var moment=require('moment');var BPromise=require(_0xe9bd('0x2'));var rp=require(_0xe9bd('0x3'));var fs=require('fs');var path=require(_0xe9bd('0x4'));var rimraf=require(_0xe9bd('0x5'));var config=require(_0xe9bd('0x6'));var attributes=require(_0xe9bd('0x7'));module[_0xe9bd('0x8')]=function(_0x4fd7b8,_0x4763e9){return _0x4fd7b8[_0xe9bd('0x9')](_0xe9bd('0xa'),attributes,{'tableName':_0xe9bd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9c44=['request-promise','path','./intDynamics365Configuration.attributes','define','Dynamics365Configuration','int_dynamics365_configurations','../../config/logger','api','moment','bluebird'];(function(_0x4dc199,_0x20d7eb){var _0x23145d=function(_0x5337c8){while(--_0x5337c8){_0x4dc199['push'](_0x4dc199['shift']());}};_0x23145d(++_0x20d7eb);}(_0x9c44,0x178));var _0x49c4=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x9c44[_0x565c49];return _0x20ca34;};'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 diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index 95b877e..c90df7b 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 _0xa520=['debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Configuration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','request\x20sent'];(function(_0x231a47,_0x46a963){var _0x48d7c9=function(_0x1e69b1){while(--_0x1e69b1){_0x231a47['push'](_0x231a47['shift']());}};_0x48d7c9(++_0x46a963);}(_0xa520,0xe1));var _0x0a52=function(_0x5c2d51,_0x400d19){_0x5c2d51=_0x5c2d51-0x0;var _0x10f8ab=_0xa520[_0x5c2d51];return _0x10f8ab;};'use strict';var _=require(_0x0a52('0x0'));var util=require(_0x0a52('0x1'));var moment=require(_0x0a52('0x2'));var BPromise=require(_0x0a52('0x3'));var rs=require(_0x0a52('0x4'));var fs=require('fs');var Redis=require(_0x0a52('0x5'));var db=require(_0x0a52('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0a52('0x7'))('rpc');var config=require(_0x0a52('0x8'));var jayson=require(_0x0a52('0x9'));var client=jayson[_0x0a52('0xa')][_0x0a52('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3bc972,_0x8b9a55,_0x3e0764){return new BPromise(function(_0x24ae33,_0x2f909e){return client['request'](_0x3bc972,_0x3e0764)[_0x0a52('0xc')](function(_0x5b485f){logger[_0x0a52('0xd')]('Dynamics365Configuration,\x20%s,\x20%s',_0x8b9a55,_0x0a52('0xe'));logger[_0x0a52('0xf')](_0x0a52('0x10'),_0x8b9a55,_0x0a52('0xe'),JSON[_0x0a52('0x11')](_0x5b485f));if(_0x5b485f['error']){if(_0x5b485f[_0x0a52('0x12')][_0x0a52('0x13')]===0x1f4){logger[_0x0a52('0x12')](_0x0a52('0x14'),_0x8b9a55,_0x5b485f[_0x0a52('0x12')]['message']);return _0x2f909e(_0x5b485f[_0x0a52('0x12')][_0x0a52('0x15')]);}logger[_0x0a52('0x12')](_0x0a52('0x14'),_0x8b9a55,_0x5b485f['error'][_0x0a52('0x15')]);return _0x24ae33(_0x5b485f[_0x0a52('0x12')][_0x0a52('0x15')]);}else{logger[_0x0a52('0xd')]('Dynamics365Configuration,\x20%s,\x20%s',_0x8b9a55,_0x0a52('0xe'));_0x24ae33(_0x5b485f[_0x0a52('0x16')]['message']);}})[_0x0a52('0x17')](function(_0x16142){logger[_0x0a52('0x12')](_0x0a52('0x14'),_0x8b9a55,_0x16142);_0x2f909e(_0x16142);});});} \ No newline at end of file +var _0x5b29=['Dynamics365Configuration,\x20%s,\x20%s','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5b29,0x197));var _0x95b2=function(_0x1acfce,_0x479485){_0x1acfce=_0x1acfce-0x0;var _0x344687=_0x5b29[_0x1acfce];return _0x344687;};'use strict';var _=require('lodash');var util=require(_0x95b2('0x0'));var moment=require(_0x95b2('0x1'));var BPromise=require(_0x95b2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x95b2('0x3'));var db=require(_0x95b2('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x95b2('0x5'))(_0x95b2('0x6'));var config=require(_0x95b2('0x7'));var jayson=require(_0x95b2('0x8'));var client=jayson[_0x95b2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe42c7b,_0x4eece1,_0x4cafb7){return new BPromise(function(_0x58994f,_0xb54e8a){return client[_0x95b2('0xa')](_0xe42c7b,_0x4cafb7)[_0x95b2('0xb')](function(_0x58a0ec){logger[_0x95b2('0xc')](_0x95b2('0xd'),_0x4eece1,'request\x20sent');logger[_0x95b2('0xe')](_0x95b2('0xf'),_0x4eece1,_0x95b2('0x10'),JSON['stringify'](_0x58a0ec));if(_0x58a0ec[_0x95b2('0x11')]){if(_0x58a0ec[_0x95b2('0x11')][_0x95b2('0x12')]===0x1f4){logger['error'](_0x95b2('0xd'),_0x4eece1,_0x58a0ec[_0x95b2('0x11')][_0x95b2('0x13')]);return _0xb54e8a(_0x58a0ec[_0x95b2('0x11')]['message']);}logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x4eece1,_0x58a0ec[_0x95b2('0x11')][_0x95b2('0x13')]);return _0x58994f(_0x58a0ec[_0x95b2('0x11')][_0x95b2('0x13')]);}else{logger[_0x95b2('0xc')]('Dynamics365Configuration,\x20%s,\x20%s',_0x4eece1,_0x95b2('0x10'));_0x58994f(_0x58a0ec['result']['message']);}})['catch'](function(_0x20fe9b){logger[_0x95b2('0x11')]('Dynamics365Configuration,\x20%s,\x20%s',_0x4eece1,_0x20fe9b);_0xb54e8a(_0x20fe9b);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index ac25ee9..e4b6da0 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 _0x66eb=['post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','show'];(function(_0x6dd5c,_0x4bfc19){var _0x5a87fa=function(_0x3b068b){while(--_0x3b068b){_0x6dd5c['push'](_0x6dd5c['shift']());}};_0x5a87fa(++_0x4bfc19);}(_0x66eb,0x1d5));var _0xb66e=function(_0x156a0d,_0x3946ce){_0x156a0d=_0x156a0d-0x0;var _0x98a9ba=_0x66eb[_0x156a0d];return _0x98a9ba;};'use strict';var multer=require(_0xb66e('0x0'));var util=require(_0xb66e('0x1'));var path=require(_0xb66e('0x2'));var timeout=require('connect-timeout');var express=require(_0xb66e('0x3'));var router=express[_0xb66e('0x4')]();var fs_extra=require(_0xb66e('0x5'));var auth=require(_0xb66e('0x6'));var interaction=require(_0xb66e('0x7'));var config=require(_0xb66e('0x8'));var controller=require(_0xb66e('0x9'));router[_0xb66e('0xa')]('/',auth[_0xb66e('0xb')](),controller[_0xb66e('0xc')]);router[_0xb66e('0xa')](_0xb66e('0xd'),auth[_0xb66e('0xb')](),controller[_0xb66e('0xe')]);router[_0xb66e('0xf')]('/',auth['isAuthenticated'](),controller[_0xb66e('0x10')]);router[_0xb66e('0x11')](_0xb66e('0xd'),auth['isAuthenticated'](),controller[_0xb66e('0x12')]);router[_0xb66e('0x13')](_0xb66e('0xd'),auth['isAuthenticated'](),controller[_0xb66e('0x14')]);module[_0xb66e('0x15')]=router; \ No newline at end of file +var _0x845d=['express','fs-extra','../../components/auth/service','../../config/environment','./intDynamics365Field.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x4a8ce2,_0x4cd94e){var _0x38c265=function(_0x1fb277){while(--_0x1fb277){_0x4a8ce2['push'](_0x4a8ce2['shift']());}};_0x38c265(++_0x4cd94e);}(_0x845d,0x18b));var _0xd845=function(_0x2b6242,_0x25be3a){_0x2b6242=_0x2b6242-0x0;var _0x5825bf=_0x845d[_0x2b6242];return _0x5825bf;};'use strict';var multer=require(_0xd845('0x0'));var util=require(_0xd845('0x1'));var path=require(_0xd845('0x2'));var timeout=require(_0xd845('0x3'));var express=require(_0xd845('0x4'));var router=express['Router']();var fs_extra=require(_0xd845('0x5'));var auth=require(_0xd845('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd845('0x7'));var controller=require(_0xd845('0x8'));router[_0xd845('0x9')]('/',auth['isAuthenticated'](),controller[_0xd845('0xa')]);router[_0xd845('0x9')](_0xd845('0xb'),auth[_0xd845('0xc')](),controller[_0xd845('0xd')]);router[_0xd845('0xe')]('/',auth[_0xd845('0xc')](),controller[_0xd845('0xf')]);router[_0xd845('0x10')](_0xd845('0xb'),auth[_0xd845('0xc')](),controller[_0xd845('0x11')]);router[_0xd845('0x12')](_0xd845('0xb'),auth[_0xd845('0xc')](),controller[_0xd845('0x13')]);module[_0xd845('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 80169c0..fb8771d 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 _0x3356=['keyValue','picklist','STRING','BOOLEAN','sequelize','exports','string','variable','customVariable'];(function(_0x3e18fd,_0x42ade7){var _0x3639a2=function(_0x4347ed){while(--_0x4347ed){_0x3e18fd['push'](_0x3e18fd['shift']());}};_0x3639a2(++_0x42ade7);}(_0x3356,0x1bd));var _0x6335=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x3356[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require(_0x6335('0x0'));module[_0x6335('0x1')]={'type':{'type':Sequelize['ENUM'](_0x6335('0x2'),_0x6335('0x3'),_0x6335('0x4'),_0x6335('0x5'),_0x6335('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x6335('0x7')]},'key':{'type':Sequelize[_0x6335('0x7')]},'keyType':{'type':Sequelize['ENUM']('string','variable','customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x6335('0x7')]},'nameField':{'type':Sequelize[_0x6335('0x7')]},'customField':{'type':Sequelize[_0x6335('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6335('0x7')]}}; \ No newline at end of file +var _0x4774=['keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0xc3f43c,_0x4b0f79){var _0xaa4a23=function(_0x2f2dde){while(--_0x2f2dde){_0xc3f43c['push'](_0xc3f43c['shift']());}};_0xaa4a23(++_0x4b0f79);}(_0x4774,0x14e));var _0x4477=function(_0x4c0312,_0x1c1efa){_0x4c0312=_0x4c0312-0x0;var _0x21d823=_0x4774[_0x4c0312];return _0x21d823;};'use strict';var Sequelize=require(_0x4477('0x0'));module[_0x4477('0x1')]={'type':{'type':Sequelize[_0x4477('0x2')](_0x4477('0x3'),_0x4477('0x4'),_0x4477('0x5'),_0x4477('0x6'),_0x4477('0x7')),'defaultValue':_0x4477('0x3')},'content':{'type':Sequelize[_0x4477('0x8')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x4477('0x2')](_0x4477('0x3'),'variable',_0x4477('0x5'))},'keyContent':{'type':Sequelize[_0x4477('0x8')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x4477('0x8')]},'customField':{'type':Sequelize[_0x4477('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4477('0x8')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index a6aefce..00dc323 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 _0xa1de=['map','Dynamics365Field','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','then','catch','show','find','create','body','params','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','error','stack','name','index'];(function(_0x1c08c7,_0x29e9d1){var _0x2045e2=function(_0x8b7369){while(--_0x8b7369){_0x1c08c7['push'](_0x1c08c7['shift']());}};_0x2045e2(++_0x29e9d1);}(_0xa1de,0x109));var _0xea1d=function(_0x4a4d8f,_0x13aae4){_0x4a4d8f=_0x4a4d8f-0x0;var _0xf1b3d5=_0xa1de[_0x4a4d8f];return _0xf1b3d5;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xea1d('0x0'));var jsonpatch=require(_0xea1d('0x1'));var rp=require(_0xea1d('0x2'));var moment=require(_0xea1d('0x3'));var BPromise=require(_0xea1d('0x4'));var Mustache=require('mustache');var util=require(_0xea1d('0x5'));var path=require(_0xea1d('0x6'));var sox=require(_0xea1d('0x7'));var csv=require('to-csv');var ejs=require(_0xea1d('0x8'));var fs=require('fs');var fs_extra=require(_0xea1d('0x9'));var _=require(_0xea1d('0xa'));var squel=require(_0xea1d('0xb'));var crypto=require(_0xea1d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xea1d('0xd'));var toCsv=require(_0xea1d('0xe'));var querystring=require(_0xea1d('0xf'));var Papa=require(_0xea1d('0x10'));var Redis=require(_0xea1d('0x11'));var authService=require(_0xea1d('0x12'));var qs=require(_0xea1d('0x13'));var as=require(_0xea1d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xea1d('0x15'))(_0xea1d('0x16'));var utils=require(_0xea1d('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xea1d('0x18'));var db=require(_0xea1d('0x19'))['db'];function respondWithStatusCode(_0x1e0b59,_0x3967da){_0x3967da=_0x3967da||0xcc;return function(_0x479b2b){if(_0x479b2b){return _0x1e0b59[_0xea1d('0x1a')](_0x3967da);}return _0x1e0b59[_0xea1d('0x1b')](_0x3967da)[_0xea1d('0x1c')]();};}function respondWithResult(_0x697b65,_0xe3494b){_0xe3494b=_0xe3494b||0xc8;return function(_0x10aa19){if(_0x10aa19){return _0x697b65[_0xea1d('0x1b')](_0xe3494b)[_0xea1d('0x1d')](_0x10aa19);}};}function respondWithFilteredResult(_0xeb8bf,_0x1c840f){return function(_0x138798){if(_0x138798){var _0x24c9e4=typeof _0x1c840f['offset']==='undefined'&&typeof _0x1c840f['limit']==='undefined';var _0x127d5d=_0x138798[_0xea1d('0x1e')];var _0x3cac29=_0x24c9e4?0x0:_0x1c840f[_0xea1d('0x1f')];var _0x26c77d=_0x24c9e4?_0x138798['count']:_0x1c840f[_0xea1d('0x1f')]+_0x1c840f[_0xea1d('0x20')];var _0x1cb180;if(_0x26c77d>=_0x127d5d){_0x26c77d=_0x127d5d;_0x1cb180=0xc8;}else{_0x1cb180=0xce;}_0xeb8bf['status'](_0x1cb180);return _0xeb8bf[_0xea1d('0x21')](_0xea1d('0x22'),_0x3cac29+'-'+_0x26c77d+'/'+_0x127d5d)[_0xea1d('0x1d')](_0x138798);}return null;};}function patchUpdates(_0x1ba98d){return function(_0x1f8325){try{jsonpatch[_0xea1d('0x23')](_0x1f8325,_0x1ba98d,!![]);}catch(_0x3fb4b3){return BPromise[_0xea1d('0x24')](_0x3fb4b3);}return _0x1f8325[_0xea1d('0x25')]();};}function saveUpdates(_0xd08c1f,_0x52df24){return function(_0x21018f){if(_0x21018f){return _0x21018f['update'](_0xd08c1f)['then'](function(_0x5981e0){return _0x5981e0;});}return null;};}function removeEntity(_0x245141,_0x1d30d9){return function(_0xd33dba){if(_0xd33dba){return _0xd33dba[_0xea1d('0x26')]()['then'](function(){_0x245141[_0xea1d('0x1b')](0xcc)[_0xea1d('0x1c')]();});}};}function handleEntityNotFound(_0x2c59e9,_0x539685){return function(_0x1e0982){if(!_0x1e0982){_0x2c59e9[_0xea1d('0x1a')](0x194);}return _0x1e0982;};}function handleError(_0x176256,_0x5f5588){_0x5f5588=_0x5f5588||0x1f4;return function(_0x1035da){logger[_0xea1d('0x27')](_0x1035da[_0xea1d('0x28')]);if(_0x1035da[_0xea1d('0x29')]){delete _0x1035da[_0xea1d('0x29')];}_0x176256[_0xea1d('0x1b')](_0x5f5588)['send'](_0x1035da);};}exports[_0xea1d('0x2a')]=function(_0x550082,_0xaafdd0){var _0xf1232c={},_0x19f47b={},_0x170ba5={'count':0x0,'rows':[]};var _0x171384=_[_0xea1d('0x2b')](db[_0xea1d('0x2c')][_0xea1d('0x2d')],function(_0x4ca636){return{'name':_0x4ca636[_0xea1d('0x2e')],'type':_0x4ca636['type'][_0xea1d('0x2f')]};});_0x19f47b[_0xea1d('0x30')]=_[_0xea1d('0x2b')](_0x171384,_0xea1d('0x29'));_0x19f47b[_0xea1d('0x31')]=_[_0xea1d('0x32')](_0x550082[_0xea1d('0x31')]);_0x19f47b[_0xea1d('0x33')]=_[_0xea1d('0x34')](_0x19f47b[_0xea1d('0x30')],_0x19f47b[_0xea1d('0x31')]);_0xf1232c['attributes']=_['intersection'](_0x19f47b[_0xea1d('0x30')],qs['fields'](_0x550082[_0xea1d('0x31')][_0xea1d('0x35')]));_0xf1232c[_0xea1d('0x36')]=_0xf1232c[_0xea1d('0x36')][_0xea1d('0x37')]?_0xf1232c['attributes']:_0x19f47b[_0xea1d('0x30')];if(!_0x550082[_0xea1d('0x31')][_0xea1d('0x38')]('nolimit')){_0xf1232c[_0xea1d('0x20')]=qs[_0xea1d('0x20')](_0x550082[_0xea1d('0x31')][_0xea1d('0x20')]);_0xf1232c[_0xea1d('0x1f')]=qs['offset'](_0x550082[_0xea1d('0x31')]['offset']);}_0xf1232c[_0xea1d('0x39')]=qs[_0xea1d('0x3a')](_0x550082['query']['sort']);_0xf1232c['where']=qs[_0xea1d('0x33')](_[_0xea1d('0x3b')](_0x550082[_0xea1d('0x31')],_0x19f47b[_0xea1d('0x33')]),_0x171384);if(_0x550082[_0xea1d('0x31')][_0xea1d('0x3c')]){_0xf1232c[_0xea1d('0x3d')]=_[_0xea1d('0x3e')](_0xf1232c[_0xea1d('0x3d')],{'$or':_[_0xea1d('0x2b')](_0x171384,function(_0x24c62a){if(_0x24c62a[_0xea1d('0x3f')]!==_0xea1d('0x40')){var _0xb689a2={};_0xb689a2[_0x24c62a[_0xea1d('0x29')]]={'$like':'%'+_0x550082['query']['filter']+'%'};return _0xb689a2;}})});}_0xf1232c=_[_0xea1d('0x3e')]({},_0xf1232c,_0x550082[_0xea1d('0x41')]);var _0x54c9f5={'where':_0xf1232c['where']};return db[_0xea1d('0x2c')][_0xea1d('0x1e')](_0x54c9f5)['then'](function(_0x3b861e){_0x170ba5[_0xea1d('0x1e')]=_0x3b861e;if(_0x550082[_0xea1d('0x31')][_0xea1d('0x42')]){_0xf1232c[_0xea1d('0x43')]=[{'all':!![]}];}return db[_0xea1d('0x2c')][_0xea1d('0x44')](_0xf1232c);})['then'](function(_0x31b05f){_0x170ba5[_0xea1d('0x45')]=_0x31b05f;return _0x170ba5;})[_0xea1d('0x46')](respondWithFilteredResult(_0xaafdd0,_0xf1232c))[_0xea1d('0x47')](handleError(_0xaafdd0,null));};exports[_0xea1d('0x48')]=function(_0x1c9aad,_0x38f79f){var _0x259db1={'raw':!![],'where':{'id':_0x1c9aad['params']['id']}},_0x2a5ee5={};_0x2a5ee5[_0xea1d('0x30')]=_['keys'](db['Dynamics365Field'][_0xea1d('0x2d')]);_0x2a5ee5['query']=_[_0xea1d('0x32')](_0x1c9aad['query']);_0x2a5ee5['filters']=_['intersection'](_0x2a5ee5[_0xea1d('0x30')],_0x2a5ee5[_0xea1d('0x31')]);_0x259db1[_0xea1d('0x36')]=_[_0xea1d('0x34')](_0x2a5ee5[_0xea1d('0x30')],qs[_0xea1d('0x35')](_0x1c9aad[_0xea1d('0x31')][_0xea1d('0x35')]));_0x259db1[_0xea1d('0x36')]=_0x259db1[_0xea1d('0x36')][_0xea1d('0x37')]?_0x259db1[_0xea1d('0x36')]:_0x2a5ee5[_0xea1d('0x30')];if(_0x1c9aad[_0xea1d('0x31')][_0xea1d('0x42')]){_0x259db1[_0xea1d('0x43')]=[{'all':!![]}];}_0x259db1=_['merge']({},_0x259db1,_0x1c9aad['options']);return db[_0xea1d('0x2c')][_0xea1d('0x49')](_0x259db1)[_0xea1d('0x46')](handleEntityNotFound(_0x38f79f,null))['then'](respondWithResult(_0x38f79f,null))[_0xea1d('0x47')](handleError(_0x38f79f,null));};exports[_0xea1d('0x4a')]=function(_0x3367e0,_0x53b083){return db[_0xea1d('0x2c')]['create'](_0x3367e0[_0xea1d('0x4b')],{})[_0xea1d('0x46')](respondWithResult(_0x53b083,0xc9))[_0xea1d('0x47')](handleError(_0x53b083,null));};exports['update']=function(_0x3b8ff6,_0x3df312){if(_0x3b8ff6[_0xea1d('0x4b')]['id']){delete _0x3b8ff6[_0xea1d('0x4b')]['id'];}return db['Dynamics365Field']['find']({'where':{'id':_0x3b8ff6[_0xea1d('0x4c')]['id']}})[_0xea1d('0x46')](handleEntityNotFound(_0x3df312,null))['then'](saveUpdates(_0x3b8ff6[_0xea1d('0x4b')],null))[_0xea1d('0x46')](respondWithResult(_0x3df312,null))[_0xea1d('0x47')](handleError(_0x3df312,null));};exports[_0xea1d('0x26')]=function(_0x18b3f0,_0x8d6bcb){return db[_0xea1d('0x2c')][_0xea1d('0x49')]({'where':{'id':_0x18b3f0[_0xea1d('0x4c')]['id']}})[_0xea1d('0x46')](handleEntityNotFound(_0x8d6bcb,null))[_0xea1d('0x46')](removeEntity(_0x8d6bcb,null))[_0xea1d('0x47')](handleError(_0x8d6bcb,null));}; \ No newline at end of file +var _0x11b2=['to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','offset','count','Content-Range','apply','save','update','then','error','name','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','includeAll','Dynamics365Field','findAll','rows','catch','show','params','keys','fields','include','find','create','body','destroy','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox'];(function(_0x434138,_0x74656){var _0x40ebdd=function(_0x2b8c41){while(--_0x2b8c41){_0x434138['push'](_0x434138['shift']());}};_0x40ebdd(++_0x74656);}(_0x11b2,0x151));var _0x211b=function(_0x139a37,_0x48530f){_0x139a37=_0x139a37-0x0;var _0x1aaaef=_0x11b2[_0x139a37];return _0x1aaaef;};'use strict';var emlformat=require(_0x211b('0x0'));var rimraf=require(_0x211b('0x1'));var zipdir=require(_0x211b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x211b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x211b('0x4'));var util=require(_0x211b('0x5'));var path=require(_0x211b('0x6'));var sox=require(_0x211b('0x7'));var csv=require(_0x211b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x211b('0x9'));var _=require(_0x211b('0xa'));var squel=require(_0x211b('0xb'));var crypto=require('crypto');var jsforce=require(_0x211b('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x211b('0x8'));var querystring=require(_0x211b('0xd'));var Papa=require(_0x211b('0xe'));var Redis=require(_0x211b('0xf'));var authService=require(_0x211b('0x10'));var qs=require(_0x211b('0x11'));var as=require(_0x211b('0x12'));var hardwareService=require(_0x211b('0x13'));var logger=require(_0x211b('0x14'))(_0x211b('0x15'));var utils=require(_0x211b('0x16'));var config=require(_0x211b('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x53b111,_0x49e1f9){_0x49e1f9=_0x49e1f9||0xcc;return function(_0x5a2be7){if(_0x5a2be7){return _0x53b111[_0x211b('0x18')](_0x49e1f9);}return _0x53b111[_0x211b('0x19')](_0x49e1f9)[_0x211b('0x1a')]();};}function respondWithResult(_0x354a5d,_0x1d960f){_0x1d960f=_0x1d960f||0xc8;return function(_0x24def1){if(_0x24def1){return _0x354a5d[_0x211b('0x19')](_0x1d960f)[_0x211b('0x1b')](_0x24def1);}};}function respondWithFilteredResult(_0x452911,_0x5a8fda){return function(_0x1e8bc6){if(_0x1e8bc6){var _0x3c9ecc=typeof _0x5a8fda['offset']===_0x211b('0x1c')&&typeof _0x5a8fda[_0x211b('0x1d')]===_0x211b('0x1c');var _0x337420=_0x1e8bc6['count'];var _0x3ba5ff=_0x3c9ecc?0x0:_0x5a8fda[_0x211b('0x1e')];var _0x3485fb=_0x3c9ecc?_0x1e8bc6[_0x211b('0x1f')]:_0x5a8fda[_0x211b('0x1e')]+_0x5a8fda['limit'];var _0x50306d;if(_0x3485fb>=_0x337420){_0x3485fb=_0x337420;_0x50306d=0xc8;}else{_0x50306d=0xce;}_0x452911[_0x211b('0x19')](_0x50306d);return _0x452911['set'](_0x211b('0x20'),_0x3ba5ff+'-'+_0x3485fb+'/'+_0x337420)[_0x211b('0x1b')](_0x1e8bc6);}return null;};}function patchUpdates(_0x3e31c1){return function(_0x1c6ff9){try{jsonpatch[_0x211b('0x21')](_0x1c6ff9,_0x3e31c1,!![]);}catch(_0x330c7f){return BPromise['reject'](_0x330c7f);}return _0x1c6ff9[_0x211b('0x22')]();};}function saveUpdates(_0x68ed40,_0x46a056){return function(_0x384531){if(_0x384531){return _0x384531[_0x211b('0x23')](_0x68ed40)[_0x211b('0x24')](function(_0x3ff22b){return _0x3ff22b;});}return null;};}function removeEntity(_0x509dd3,_0x1bfc7d){return function(_0x5a33ed){if(_0x5a33ed){return _0x5a33ed['destroy']()[_0x211b('0x24')](function(){_0x509dd3[_0x211b('0x19')](0xcc)[_0x211b('0x1a')]();});}};}function handleEntityNotFound(_0x31f585,_0x43c78f){return function(_0x3de0f8){if(!_0x3de0f8){_0x31f585['sendStatus'](0x194);}return _0x3de0f8;};}function handleError(_0x621142,_0x128216){_0x128216=_0x128216||0x1f4;return function(_0x35e7c9){logger[_0x211b('0x25')](_0x35e7c9['stack']);if(_0x35e7c9[_0x211b('0x26')]){delete _0x35e7c9[_0x211b('0x26')];}_0x621142[_0x211b('0x19')](_0x128216)['send'](_0x35e7c9);};}exports['index']=function(_0x50c5bb,_0x5d5151){var _0x13a386={},_0x2faffa={},_0x3f77fc={'count':0x0,'rows':[]};var _0xdfc742=_[_0x211b('0x27')](db['Dynamics365Field'][_0x211b('0x28')],function(_0x2a810b){return{'name':_0x2a810b[_0x211b('0x29')],'type':_0x2a810b[_0x211b('0x2a')]['key']};});_0x2faffa[_0x211b('0x2b')]=_[_0x211b('0x27')](_0xdfc742,_0x211b('0x26'));_0x2faffa['query']=_['keys'](_0x50c5bb[_0x211b('0x2c')]);_0x2faffa[_0x211b('0x2d')]=_[_0x211b('0x2e')](_0x2faffa[_0x211b('0x2b')],_0x2faffa[_0x211b('0x2c')]);_0x13a386[_0x211b('0x2f')]=_['intersection'](_0x2faffa[_0x211b('0x2b')],qs['fields'](_0x50c5bb['query']['fields']));_0x13a386[_0x211b('0x2f')]=_0x13a386[_0x211b('0x2f')]['length']?_0x13a386[_0x211b('0x2f')]:_0x2faffa[_0x211b('0x2b')];if(!_0x50c5bb['query'][_0x211b('0x30')]('nolimit')){_0x13a386[_0x211b('0x1d')]=qs['limit'](_0x50c5bb[_0x211b('0x2c')]['limit']);_0x13a386['offset']=qs[_0x211b('0x1e')](_0x50c5bb['query'][_0x211b('0x1e')]);}_0x13a386[_0x211b('0x31')]=qs[_0x211b('0x32')](_0x50c5bb[_0x211b('0x2c')]['sort']);_0x13a386[_0x211b('0x33')]=qs[_0x211b('0x2d')](_[_0x211b('0x34')](_0x50c5bb[_0x211b('0x2c')],_0x2faffa[_0x211b('0x2d')]),_0xdfc742);if(_0x50c5bb[_0x211b('0x2c')][_0x211b('0x35')]){_0x13a386[_0x211b('0x33')]=_[_0x211b('0x36')](_0x13a386[_0x211b('0x33')],{'$or':_[_0x211b('0x27')](_0xdfc742,function(_0x6c4745){if(_0x6c4745[_0x211b('0x2a')]!=='VIRTUAL'){var _0x1a49ae={};_0x1a49ae[_0x6c4745[_0x211b('0x26')]]={'$like':'%'+_0x50c5bb[_0x211b('0x2c')][_0x211b('0x35')]+'%'};return _0x1a49ae;}})});}_0x13a386=_[_0x211b('0x36')]({},_0x13a386,_0x50c5bb['options']);var _0x2c7f94={'where':_0x13a386[_0x211b('0x33')]};return db['Dynamics365Field'][_0x211b('0x1f')](_0x2c7f94)['then'](function(_0x25718e){_0x3f77fc['count']=_0x25718e;if(_0x50c5bb[_0x211b('0x2c')][_0x211b('0x37')]){_0x13a386['include']=[{'all':!![]}];}return db[_0x211b('0x38')][_0x211b('0x39')](_0x13a386);})[_0x211b('0x24')](function(_0x4b3bbb){_0x3f77fc[_0x211b('0x3a')]=_0x4b3bbb;return _0x3f77fc;})['then'](respondWithFilteredResult(_0x5d5151,_0x13a386))[_0x211b('0x3b')](handleError(_0x5d5151,null));};exports[_0x211b('0x3c')]=function(_0x3786f1,_0x5088b1){var _0x5278ec={'raw':!![],'where':{'id':_0x3786f1[_0x211b('0x3d')]['id']}},_0x39bf03={};_0x39bf03[_0x211b('0x2b')]=_[_0x211b('0x3e')](db[_0x211b('0x38')][_0x211b('0x28')]);_0x39bf03['query']=_[_0x211b('0x3e')](_0x3786f1[_0x211b('0x2c')]);_0x39bf03['filters']=_['intersection'](_0x39bf03[_0x211b('0x2b')],_0x39bf03[_0x211b('0x2c')]);_0x5278ec[_0x211b('0x2f')]=_['intersection'](_0x39bf03['model'],qs['fields'](_0x3786f1['query'][_0x211b('0x3f')]));_0x5278ec[_0x211b('0x2f')]=_0x5278ec['attributes']['length']?_0x5278ec['attributes']:_0x39bf03['model'];if(_0x3786f1[_0x211b('0x2c')][_0x211b('0x37')]){_0x5278ec[_0x211b('0x40')]=[{'all':!![]}];}_0x5278ec=_[_0x211b('0x36')]({},_0x5278ec,_0x3786f1['options']);return db[_0x211b('0x38')][_0x211b('0x41')](_0x5278ec)[_0x211b('0x24')](handleEntityNotFound(_0x5088b1,null))['then'](respondWithResult(_0x5088b1,null))[_0x211b('0x3b')](handleError(_0x5088b1,null));};exports[_0x211b('0x42')]=function(_0x528296,_0x3962da){return db[_0x211b('0x38')][_0x211b('0x42')](_0x528296[_0x211b('0x43')],{})[_0x211b('0x24')](respondWithResult(_0x3962da,0xc9))[_0x211b('0x3b')](handleError(_0x3962da,null));};exports[_0x211b('0x23')]=function(_0x1ffab0,_0x5ff5fd){if(_0x1ffab0[_0x211b('0x43')]['id']){delete _0x1ffab0[_0x211b('0x43')]['id'];}return db[_0x211b('0x38')][_0x211b('0x41')]({'where':{'id':_0x1ffab0[_0x211b('0x3d')]['id']}})[_0x211b('0x24')](handleEntityNotFound(_0x5ff5fd,null))[_0x211b('0x24')](saveUpdates(_0x1ffab0['body'],null))[_0x211b('0x24')](respondWithResult(_0x5ff5fd,null))[_0x211b('0x3b')](handleError(_0x5ff5fd,null));};exports[_0x211b('0x44')]=function(_0x415c9e,_0x5d604e){return db['Dynamics365Field']['find']({'where':{'id':_0x415c9e[_0x211b('0x3d')]['id']}})[_0x211b('0x24')](handleEntityNotFound(_0x5d604e,null))[_0x211b('0x24')](removeEntity(_0x5d604e,null))['catch'](handleError(_0x5d604e,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index c82371c..a3ba2d7 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 _0x5d35=['request-promise','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash','util','moment'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x5d35,0xf4));var _0x55d3=function(_0x2146e5,_0x45b9f4){_0x2146e5=_0x2146e5-0x0;var _0x4c2734=_0x5d35[_0x2146e5];return _0x4c2734;};'use strict';var _=require(_0x55d3('0x0'));var util=require(_0x55d3('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x55d3('0x2'));var BPromise=require('bluebird');var rp=require(_0x55d3('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x55d3('0x4'));var config=require(_0x55d3('0x5'));var attributes=require(_0x55d3('0x6'));module[_0x55d3('0x7')]=function(_0x1478a8,_0x5d688c){return _0x1478a8['define'](_0x55d3('0x8'),attributes,{'tableName':_0x55d3('0x9'),'paranoid':![],'indexes':[{'name':_0x55d3('0xa'),'fields':[_0x55d3('0xb'),_0x55d3('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0163=['request-promise','./intDynamics365Field.attributes','exports','define','Dynamics365Field','dynamics365_unique_index','idField','FieldId','api','moment'];(function(_0x3878a9,_0x5e4d83){var _0x5eed2f=function(_0x51168c){while(--_0x51168c){_0x3878a9['push'](_0x3878a9['shift']());}};_0x5eed2f(++_0x5e4d83);}(_0x0163,0xf8));var _0x3016=function(_0x46870c,_0x5c668d){_0x46870c=_0x46870c-0x0;var _0x5ec0c4=_0x0163[_0x46870c];return _0x5ec0c4;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x3016('0x0'));var moment=require(_0x3016('0x1'));var BPromise=require('bluebird');var rp=require(_0x3016('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3016('0x3'));module[_0x3016('0x4')]=function(_0x273f3b,_0x323dd3){return _0x273f3b[_0x3016('0x5')](_0x3016('0x6'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0x3016('0x7'),'fields':[_0x3016('0x8'),_0x3016('0x9')],'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 8994231..3bb4ca0 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 _0xd022=['code','message','catch','util','bluebird','randomstring','../../config/utils','../../config/environment','jayson/promise','client','request','Dynamics365Field,\x20%s,\x20%s','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x3f02d3,_0x4e3def){var _0x129fbb=function(_0x3101e8){while(--_0x3101e8){_0x3f02d3['push'](_0x3f02d3['shift']());}};_0x129fbb(++_0x4e3def);}(_0xd022,0x146));var _0x2d02=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xd022[_0x68c979];return _0x4f0001;};'use strict';var _=require('lodash');var util=require(_0x2d02('0x0'));var moment=require('moment');var BPromise=require(_0x2d02('0x1'));var rs=require(_0x2d02('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2d02('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x2d02('0x4'));var jayson=require(_0x2d02('0x5'));var client=jayson[_0x2d02('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5e9d96,_0x3ff879,_0x361717){return new BPromise(function(_0x3545cc,_0x231f30){return client[_0x2d02('0x7')](_0x5e9d96,_0x361717)['then'](function(_0x133314){logger['info'](_0x2d02('0x8'),_0x3ff879,'request\x20sent');logger[_0x2d02('0x9')](_0x2d02('0xa'),_0x3ff879,_0x2d02('0xb'),JSON[_0x2d02('0xc')](_0x133314));if(_0x133314[_0x2d02('0xd')]){if(_0x133314[_0x2d02('0xd')][_0x2d02('0xe')]===0x1f4){logger[_0x2d02('0xd')](_0x2d02('0x8'),_0x3ff879,_0x133314[_0x2d02('0xd')][_0x2d02('0xf')]);return _0x231f30(_0x133314[_0x2d02('0xd')][_0x2d02('0xf')]);}logger['error'](_0x2d02('0x8'),_0x3ff879,_0x133314['error'][_0x2d02('0xf')]);return _0x3545cc(_0x133314['error'][_0x2d02('0xf')]);}else{logger['info'](_0x2d02('0x8'),_0x3ff879,_0x2d02('0xb'));_0x3545cc(_0x133314['result'][_0x2d02('0xf')]);}})[_0x2d02('0x10')](function(_0x257797){logger[_0x2d02('0xd')]('Dynamics365Field,\x20%s,\x20%s',_0x3ff879,_0x257797);_0x231f30(_0x257797);});});} \ No newline at end of file +var _0xdc8b=['http','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/environment'];(function(_0x479e92,_0x5bb028){var _0x38465e=function(_0xefde3c){while(--_0xefde3c){_0x479e92['push'](_0x479e92['shift']());}};_0x38465e(++_0x5bb028);}(_0xdc8b,0x1b2));var _0xbdc8=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xdc8b[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0xbdc8('0x0'));var moment=require(_0xbdc8('0x1'));var BPromise=require(_0xbdc8('0x2'));var rs=require(_0xbdc8('0x3'));var fs=require('fs');var Redis=require(_0xbdc8('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xbdc8('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbdc8('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x22ab95,_0x163ed3,_0x142983){return new BPromise(function(_0x2dffb7,_0x29a9da){return client[_0xbdc8('0x7')](_0x22ab95,_0x142983)[_0xbdc8('0x8')](function(_0x20e8b3){logger[_0xbdc8('0x9')](_0xbdc8('0xa'),_0x163ed3,_0xbdc8('0xb'));logger[_0xbdc8('0xc')](_0xbdc8('0xd'),_0x163ed3,'request\x20sent',JSON[_0xbdc8('0xe')](_0x20e8b3));if(_0x20e8b3[_0xbdc8('0xf')]){if(_0x20e8b3[_0xbdc8('0xf')][_0xbdc8('0x10')]===0x1f4){logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x163ed3,_0x20e8b3[_0xbdc8('0xf')][_0xbdc8('0x11')]);return _0x29a9da(_0x20e8b3[_0xbdc8('0xf')][_0xbdc8('0x11')]);}logger[_0xbdc8('0xf')](_0xbdc8('0xa'),_0x163ed3,_0x20e8b3['error'][_0xbdc8('0x11')]);return _0x2dffb7(_0x20e8b3[_0xbdc8('0xf')][_0xbdc8('0x11')]);}else{logger[_0xbdc8('0x9')](_0xbdc8('0xa'),_0x163ed3,_0xbdc8('0xb'));_0x2dffb7(_0x20e8b3[_0xbdc8('0x12')][_0xbdc8('0x11')]);}})[_0xbdc8('0x13')](function(_0x4f54c7){logger[_0xbdc8('0xf')](_0xbdc8('0xa'),_0x163ed3,_0x4f54c7);_0x29a9da(_0x4f54c7);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 1fc74eb..3b57dea 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 _0x6904=['./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x70d002,_0x1afd25){var _0xd4fe2a=function(_0x1613af){while(--_0x1613af){_0x70d002['push'](_0x70d002['shift']());}};_0xd4fe2a(++_0x1afd25);}(_0x6904,0x191));var _0x4690=function(_0x1cbcf1,_0x3f9fd9){_0x1cbcf1=_0x1cbcf1-0x0;var _0x3a06f0=_0x6904[_0x1cbcf1];return _0x3a06f0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4690('0x0'));var timeout=require(_0x4690('0x1'));var express=require(_0x4690('0x2'));var router=express[_0x4690('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4690('0x4'));var interaction=require(_0x4690('0x5'));var config=require(_0x4690('0x6'));var controller=require(_0x4690('0x7'));router[_0x4690('0x8')]('/',auth[_0x4690('0x9')](),controller[_0x4690('0xa')]);router[_0x4690('0x8')](_0x4690('0xb'),auth[_0x4690('0x9')](),controller[_0x4690('0xc')]);router[_0x4690('0x8')](_0x4690('0xd'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x4690('0x8')](_0x4690('0xe'),auth[_0x4690('0x9')](),controller[_0x4690('0xf')]);router[_0x4690('0x10')]('/',auth['isAuthenticated'](),controller[_0x4690('0x11')]);router[_0x4690('0x10')](_0x4690('0xd'),auth[_0x4690('0x9')](),controller[_0x4690('0x12')]);router[_0x4690('0x13')]('/:id',auth[_0x4690('0x9')](),controller[_0x4690('0x14')]);router[_0x4690('0x15')](_0x4690('0xb'),auth[_0x4690('0x9')](),controller[_0x4690('0x16')]);module[_0x4690('0x17')]=router; \ No newline at end of file +var _0x96bc=['/:id','get','/:id/configurations','getFields','post','create','addConfiguration','put','update','destroy','exports','multer','util','express','fs-extra','../../config/environment','./intFreshdeskAccount.controller','isAuthenticated','index'];(function(_0x2cbeca,_0x57a08d){var _0x1482c8=function(_0x102050){while(--_0x102050){_0x2cbeca['push'](_0x2cbeca['shift']());}};_0x1482c8(++_0x57a08d);}(_0x96bc,0xc9));var _0xc96b=function(_0x32ec72,_0x4f6648){_0x32ec72=_0x32ec72-0x0;var _0x35bff9=_0x96bc[_0x32ec72];return _0x35bff9;};'use strict';var multer=require(_0xc96b('0x0'));var util=require(_0xc96b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc96b('0x2'));var router=express['Router']();var fs_extra=require(_0xc96b('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc96b('0x4'));var controller=require(_0xc96b('0x5'));router['get']('/',auth[_0xc96b('0x6')](),controller[_0xc96b('0x7')]);router['get'](_0xc96b('0x8'),auth[_0xc96b('0x6')](),controller['show']);router[_0xc96b('0x9')](_0xc96b('0xa'),auth[_0xc96b('0x6')](),controller['getConfigurations']);router[_0xc96b('0x9')]('/:id/fields',auth['isAuthenticated'](),controller[_0xc96b('0xb')]);router[_0xc96b('0xc')]('/',auth[_0xc96b('0x6')](),controller[_0xc96b('0xd')]);router[_0xc96b('0xc')](_0xc96b('0xa'),auth[_0xc96b('0x6')](),controller[_0xc96b('0xe')]);router[_0xc96b('0xf')]('/:id',auth[_0xc96b('0x6')](),controller[_0xc96b('0x10')]);router['delete'](_0xc96b('0x8'),auth[_0xc96b('0x6')](),controller[_0xc96b('0x11')]);module[_0xc96b('0x12')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index e869094..ae25a8b 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 _0x77d4=['exports','STRING','username'];(function(_0x3fe440,_0x18d0cb){var _0x30cf95=function(_0x1f7af5){while(--_0x1f7af5){_0x3fe440['push'](_0x3fe440['shift']());}};_0x30cf95(++_0x18d0cb);}(_0x77d4,0x108));var _0x477d=function(_0x251429,_0x55f265){_0x251429=_0x251429-0x0;var _0x2d5d69=_0x77d4[_0x251429];return _0x2d5d69;};'use strict';var Sequelize=require('sequelize');module[_0x477d('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x477d('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x477d('0x2')},'apiKey':{'type':Sequelize[_0x477d('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x477d('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xffd6=['exports','STRING','username','sequelize'];(function(_0x3dc283,_0x29a667){var _0x5702ae=function(_0x1f4ad9){while(--_0x1f4ad9){_0x3dc283['push'](_0x3dc283['shift']());}};_0x5702ae(++_0x29a667);}(_0xffd6,0x97));var _0x6ffd=function(_0x1e4150,_0x55b02a){_0x1e4150=_0x1e4150-0x0;var _0x1ce3ee=_0xffd6[_0x1e4150];return _0x1ce3ee;};'use strict';var Sequelize=require(_0x6ffd('0x0'));module[_0x6ffd('0x1')]={'name':{'type':Sequelize[_0x6ffd('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x6ffd('0x3')},'apiKey':{'type':Sequelize[_0x6ffd('0x2')]},'remoteUri':{'type':Sequelize[_0x6ffd('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x6ffd('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index ed3688a..f234535 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 _0xfc73=['requester','subject','description','priority','group','source','ticket_type','company','remove','includes','custom_dropdown','label','default','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','sendStatus','error','stack','name','index','FreshdeskAccount','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','VIRTUAL','filter','options','then','includeAll','include','findAll','catch','show','params','merge','find','create','body','destroy','getConfigurations','findOne','order','nolimit','AccountId','Subjects','getSubjects','channel','Descriptions','FreshdeskConfiguration','FreshdeskField','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X'];(function(_0x3b2116,_0x287d1b){var _0x5ed69a=function(_0x15ba92){while(--_0x15ba92){_0x3b2116['push'](_0x3b2116['shift']());}};_0x5ed69a(++_0x287d1b);}(_0xfc73,0x8d));var _0x3fc7=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0xfc73[_0x819464];return _0x49dcc0;};'use strict';var emlformat=require(_0x3fc7('0x0'));var rimraf=require(_0x3fc7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3fc7('0x2'));var rp=require(_0x3fc7('0x3'));var moment=require(_0x3fc7('0x4'));var BPromise=require(_0x3fc7('0x5'));var Mustache=require(_0x3fc7('0x6'));var util=require(_0x3fc7('0x7'));var path=require(_0x3fc7('0x8'));var sox=require(_0x3fc7('0x9'));var csv=require(_0x3fc7('0xa'));var ejs=require(_0x3fc7('0xb'));var fs=require('fs');var fs_extra=require(_0x3fc7('0xc'));var _=require(_0x3fc7('0xd'));var squel=require('squel');var crypto=require(_0x3fc7('0xe'));var jsforce=require(_0x3fc7('0xf'));var deskjs=require(_0x3fc7('0x10'));var toCsv=require(_0x3fc7('0xa'));var querystring=require(_0x3fc7('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3fc7('0x12'));var qs=require(_0x3fc7('0x13'));var as=require(_0x3fc7('0x14'));var hardwareService=require(_0x3fc7('0x15'));var logger=require(_0x3fc7('0x16'))(_0x3fc7('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3fc7('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0x3fc7('0x19'));function respondWithStatusCode(_0x16daa1,_0x1e5358){_0x1e5358=_0x1e5358||0xcc;return function(_0x309fa3){if(_0x309fa3){return _0x16daa1['sendStatus'](_0x1e5358);}return _0x16daa1[_0x3fc7('0x1a')](_0x1e5358)[_0x3fc7('0x1b')]();};}function respondWithResult(_0x3a3573,_0x34db32){_0x34db32=_0x34db32||0xc8;return function(_0x2bb4c4){if(_0x2bb4c4){return _0x3a3573[_0x3fc7('0x1a')](_0x34db32)[_0x3fc7('0x1c')](_0x2bb4c4);}};}function respondWithFilteredResult(_0x24267f,_0x105047){return function(_0x1c1f91){if(_0x1c1f91){var _0x31577b=typeof _0x105047[_0x3fc7('0x1d')]===_0x3fc7('0x1e')&&typeof _0x105047[_0x3fc7('0x1f')]===_0x3fc7('0x1e');var _0x16e3c8=_0x1c1f91[_0x3fc7('0x20')];var _0x2583d4=_0x31577b?0x0:_0x105047[_0x3fc7('0x1d')];var _0x502490=_0x31577b?_0x1c1f91['count']:_0x105047[_0x3fc7('0x1d')]+_0x105047['limit'];var _0x4e4997;if(_0x502490>=_0x16e3c8){_0x502490=_0x16e3c8;_0x4e4997=0xc8;}else{_0x4e4997=0xce;}_0x24267f[_0x3fc7('0x1a')](_0x4e4997);return _0x24267f[_0x3fc7('0x21')](_0x3fc7('0x22'),_0x2583d4+'-'+_0x502490+'/'+_0x16e3c8)['json'](_0x1c1f91);}return null;};}function patchUpdates(_0x4fa736){return function(_0x3d5b53){try{jsonpatch[_0x3fc7('0x23')](_0x3d5b53,_0x4fa736,!![]);}catch(_0x302bc5){return BPromise[_0x3fc7('0x24')](_0x302bc5);}return _0x3d5b53[_0x3fc7('0x25')]();};}function saveUpdates(_0x483018,_0x536336){return function(_0x151257){if(_0x151257){return _0x151257[_0x3fc7('0x26')](_0x483018)['then'](function(_0x5590c4){return _0x5590c4;});}return null;};}function removeEntity(_0x4956bf,_0x456ddc){return function(_0x1cfd17){if(_0x1cfd17){return _0x1cfd17['destroy']()['then'](function(){_0x4956bf[_0x3fc7('0x1a')](0xcc)[_0x3fc7('0x1b')]();});}};}function handleEntityNotFound(_0x789c3,_0x31459f){return function(_0x297dd1){if(!_0x297dd1){_0x789c3[_0x3fc7('0x27')](0x194);}return _0x297dd1;};}function handleError(_0x2311c6,_0x7a7cff){_0x7a7cff=_0x7a7cff||0x1f4;return function(_0x13bcf9){logger[_0x3fc7('0x28')](_0x13bcf9[_0x3fc7('0x29')]);if(_0x13bcf9[_0x3fc7('0x2a')]){delete _0x13bcf9[_0x3fc7('0x2a')];}_0x2311c6[_0x3fc7('0x1a')](_0x7a7cff)['send'](_0x13bcf9);};}exports[_0x3fc7('0x2b')]=function(_0xe6297a,_0x4dcfef){var _0x36b6c1={},_0x3ea756={},_0x1defee={'count':0x0,'rows':[]};var _0x268784=_['map'](db[_0x3fc7('0x2c')][_0x3fc7('0x2d')],function(_0x3c89e0){return{'name':_0x3c89e0[_0x3fc7('0x2e')],'type':_0x3c89e0[_0x3fc7('0x2f')][_0x3fc7('0x30')]};});_0x3ea756[_0x3fc7('0x31')]=_[_0x3fc7('0x32')](_0x268784,'name');_0x3ea756[_0x3fc7('0x33')]=_[_0x3fc7('0x34')](_0xe6297a[_0x3fc7('0x33')]);_0x3ea756['filters']=_[_0x3fc7('0x35')](_0x3ea756[_0x3fc7('0x31')],_0x3ea756[_0x3fc7('0x33')]);_0x36b6c1[_0x3fc7('0x36')]=_[_0x3fc7('0x35')](_0x3ea756[_0x3fc7('0x31')],qs['fields'](_0xe6297a['query'][_0x3fc7('0x37')]));_0x36b6c1[_0x3fc7('0x36')]=_0x36b6c1[_0x3fc7('0x36')][_0x3fc7('0x38')]?_0x36b6c1['attributes']:_0x3ea756[_0x3fc7('0x31')];if(!_0xe6297a[_0x3fc7('0x33')][_0x3fc7('0x39')]('nolimit')){_0x36b6c1[_0x3fc7('0x1f')]=qs[_0x3fc7('0x1f')](_0xe6297a[_0x3fc7('0x33')]['limit']);_0x36b6c1['offset']=qs[_0x3fc7('0x1d')](_0xe6297a['query'][_0x3fc7('0x1d')]);}_0x36b6c1['order']=qs[_0x3fc7('0x3a')](_0xe6297a['query'][_0x3fc7('0x3a')]);_0x36b6c1[_0x3fc7('0x3b')]=qs[_0x3fc7('0x3c')](_[_0x3fc7('0x3d')](_0xe6297a[_0x3fc7('0x33')],_0x3ea756['filters']),_0x268784);if(_0xe6297a['query']['filter']){_0x36b6c1['where']=_['merge'](_0x36b6c1[_0x3fc7('0x3b')],{'$or':_[_0x3fc7('0x32')](_0x268784,function(_0x498b7c){if(_0x498b7c[_0x3fc7('0x2f')]!==_0x3fc7('0x3e')){var _0x2c6942={};_0x2c6942[_0x498b7c['name']]={'$like':'%'+_0xe6297a['query'][_0x3fc7('0x3f')]+'%'};return _0x2c6942;}})});}_0x36b6c1=_['merge']({},_0x36b6c1,_0xe6297a[_0x3fc7('0x40')]);var _0x29c65a={'where':_0x36b6c1[_0x3fc7('0x3b')]};return db[_0x3fc7('0x2c')][_0x3fc7('0x20')](_0x29c65a)[_0x3fc7('0x41')](function(_0x463562){_0x1defee['count']=_0x463562;if(_0xe6297a[_0x3fc7('0x33')][_0x3fc7('0x42')]){_0x36b6c1[_0x3fc7('0x43')]=[{'all':!![]}];}return db[_0x3fc7('0x2c')][_0x3fc7('0x44')](_0x36b6c1);})['then'](function(_0x23fa78){_0x1defee['rows']=_0x23fa78;return _0x1defee;})[_0x3fc7('0x41')](respondWithFilteredResult(_0x4dcfef,_0x36b6c1))[_0x3fc7('0x45')](handleError(_0x4dcfef,null));};exports[_0x3fc7('0x46')]=function(_0x46c367,_0x5d93fa){var _0x218f48={'raw':![],'where':{'id':_0x46c367[_0x3fc7('0x47')]['id']}},_0x5991ae={};_0x5991ae[_0x3fc7('0x31')]=_['keys'](db[_0x3fc7('0x2c')][_0x3fc7('0x2d')]);_0x5991ae['query']=_['keys'](_0x46c367['query']);_0x5991ae[_0x3fc7('0x3c')]=_[_0x3fc7('0x35')](_0x5991ae[_0x3fc7('0x31')],_0x5991ae[_0x3fc7('0x33')]);_0x218f48[_0x3fc7('0x36')]=_[_0x3fc7('0x35')](_0x5991ae[_0x3fc7('0x31')],qs[_0x3fc7('0x37')](_0x46c367[_0x3fc7('0x33')][_0x3fc7('0x37')]));_0x218f48[_0x3fc7('0x36')]=_0x218f48[_0x3fc7('0x36')]['length']?_0x218f48[_0x3fc7('0x36')]:_0x5991ae[_0x3fc7('0x31')];if(_0x46c367[_0x3fc7('0x33')][_0x3fc7('0x42')]){_0x218f48[_0x3fc7('0x43')]=[{'all':!![]}];}_0x218f48=_[_0x3fc7('0x48')]({},_0x218f48,_0x46c367[_0x3fc7('0x40')]);return db['FreshdeskAccount'][_0x3fc7('0x49')](_0x218f48)['then'](handleEntityNotFound(_0x5d93fa,null))[_0x3fc7('0x41')](respondWithResult(_0x5d93fa,null))[_0x3fc7('0x45')](handleError(_0x5d93fa,null));};exports[_0x3fc7('0x4a')]=function(_0x2379c9,_0x36f17e){return db[_0x3fc7('0x2c')][_0x3fc7('0x4a')](_0x2379c9[_0x3fc7('0x4b')],{})['then'](respondWithResult(_0x36f17e,0xc9))[_0x3fc7('0x45')](handleError(_0x36f17e,null));};exports[_0x3fc7('0x26')]=function(_0x1a813c,_0x5ae3c7){if(_0x1a813c[_0x3fc7('0x4b')]['id']){delete _0x1a813c['body']['id'];}return db[_0x3fc7('0x2c')][_0x3fc7('0x49')]({'where':{'id':_0x1a813c[_0x3fc7('0x47')]['id']}})[_0x3fc7('0x41')](handleEntityNotFound(_0x5ae3c7,null))['then'](saveUpdates(_0x1a813c[_0x3fc7('0x4b')],null))[_0x3fc7('0x41')](respondWithResult(_0x5ae3c7,null))['catch'](handleError(_0x5ae3c7,null));};exports[_0x3fc7('0x4c')]=function(_0x3f5167,_0x5234e4){return db['FreshdeskAccount']['find']({'where':{'id':_0x3f5167['params']['id']}})['then'](handleEntityNotFound(_0x5234e4,null))[_0x3fc7('0x41')](removeEntity(_0x5234e4,null))[_0x3fc7('0x45')](handleError(_0x5234e4,null));};exports[_0x3fc7('0x4d')]=function(_0x588ec2,_0x2045d9,_0x142782){var _0x3e0ccb={};var _0x54dc15={};var _0x3a5c51;var _0x12b93b;return db[_0x3fc7('0x2c')][_0x3fc7('0x4e')]({'where':{'id':_0x588ec2[_0x3fc7('0x47')]['id']}})[_0x3fc7('0x41')](handleEntityNotFound(_0x2045d9,null))['then'](function(_0x4fe18a){if(_0x4fe18a){_0x3a5c51=_0x4fe18a;_0x54dc15[_0x3fc7('0x31')]=_[_0x3fc7('0x34')](db['FreshdeskConfiguration'][_0x3fc7('0x2d')]);_0x54dc15[_0x3fc7('0x33')]=_['keys'](_0x588ec2['query']);_0x54dc15[_0x3fc7('0x3c')]=_[_0x3fc7('0x35')](_0x54dc15[_0x3fc7('0x31')],_0x54dc15['query']);_0x3e0ccb[_0x3fc7('0x36')]=_[_0x3fc7('0x35')](_0x54dc15[_0x3fc7('0x31')],qs[_0x3fc7('0x37')](_0x588ec2[_0x3fc7('0x33')][_0x3fc7('0x37')]));_0x3e0ccb[_0x3fc7('0x36')]=_0x3e0ccb[_0x3fc7('0x36')][_0x3fc7('0x38')]?_0x3e0ccb['attributes']:_0x54dc15['model'];_0x3e0ccb[_0x3fc7('0x4f')]=qs[_0x3fc7('0x3a')](_0x588ec2[_0x3fc7('0x33')][_0x3fc7('0x3a')]);_0x3e0ccb[_0x3fc7('0x3b')]=qs[_0x3fc7('0x3c')](_['pick'](_0x588ec2['query'],_0x54dc15['filters']));if(_0x588ec2['query'][_0x3fc7('0x3f')]){_0x3e0ccb[_0x3fc7('0x3b')]=_[_0x3fc7('0x48')](_0x3e0ccb[_0x3fc7('0x3b')],{'$or':_[_0x3fc7('0x32')](_0x3e0ccb[_0x3fc7('0x36')],function(_0x58bb00){var _0x4e11bd={};_0x4e11bd[_0x58bb00]={'$like':'%'+_0x588ec2[_0x3fc7('0x33')][_0x3fc7('0x3f')]+'%'};return _0x4e11bd;})});}_0x3e0ccb=_['merge']({},_0x3e0ccb,_0x588ec2[_0x3fc7('0x40')]);return _0x3a5c51[_0x3fc7('0x4d')](_0x3e0ccb);}})[_0x3fc7('0x41')](function(_0x57653d){if(_0x57653d){_0x12b93b=_0x57653d[_0x3fc7('0x38')];if(!_0x588ec2[_0x3fc7('0x33')][_0x3fc7('0x39')](_0x3fc7('0x50'))){_0x3e0ccb[_0x3fc7('0x1f')]=qs[_0x3fc7('0x1f')](_0x588ec2[_0x3fc7('0x33')]['limit']);_0x3e0ccb[_0x3fc7('0x1d')]=qs[_0x3fc7('0x1d')](_0x588ec2[_0x3fc7('0x33')][_0x3fc7('0x1d')]);}return _0x3a5c51['getConfigurations'](_0x3e0ccb);}})['then'](function(_0x3bb8f6){if(_0x3bb8f6){return _0x3bb8f6?{'count':_0x12b93b,'rows':_0x3bb8f6}:null;}})[_0x3fc7('0x41')](respondWithResult(_0x2045d9,null))['catch'](handleError(_0x2045d9,null));};exports['addConfiguration']=function(_0x5953e9,_0x429fe8,_0x353728){if(_0x5953e9[_0x3fc7('0x4b')]['id']){delete _0x5953e9['body']['id'];}return db[_0x3fc7('0x2c')]['findOne']({'where':{'id':_0x5953e9[_0x3fc7('0x47')]['id']}})[_0x3fc7('0x41')](handleEntityNotFound(_0x429fe8,null))[_0x3fc7('0x41')](function(_0x3b6933){if(_0x3b6933){_0x5953e9[_0x3fc7('0x4b')][_0x3fc7('0x51')]=_0x3b6933['id'];_0x5953e9['body'][_0x3fc7('0x52')]=integrations[_0x3fc7('0x53')](_0x5953e9[_0x3fc7('0x4b')][_0x3fc7('0x54')],_0x5953e9[_0x3fc7('0x4b')][_0x3fc7('0x2f')]);_0x5953e9['body'][_0x3fc7('0x55')]=integrations['getDescriptions'](_0x5953e9[_0x3fc7('0x4b')][_0x3fc7('0x54')],_0x5953e9[_0x3fc7('0x4b')]['type']);return db[_0x3fc7('0x56')][_0x3fc7('0x4a')](_0x5953e9[_0x3fc7('0x4b')],{'include':[{'model':db[_0x3fc7('0x57')],'as':'Subjects'},{'model':db[_0x3fc7('0x57')],'as':'Descriptions'}]});}return null;})[_0x3fc7('0x41')](respondWithResult(_0x429fe8,null))['catch'](handleError(_0x429fe8,null));};exports[_0x3fc7('0x58')]=function(_0x2c4486,_0x228bff,_0x1b0eaa){var _0x5e4fb2='';return db[_0x3fc7('0x2c')][_0x3fc7('0x4e')]({'where':{'id':_0x2c4486[_0x3fc7('0x47')]['id']},'attributes':['id',_0x3fc7('0x59'),_0x3fc7('0x5a')]})[_0x3fc7('0x41')](handleEntityNotFound(_0x228bff,null))[_0x3fc7('0x41')](function(_0x422406){if(_0x422406){_0x5e4fb2=_0x422406[_0x3fc7('0x59')];var _0x48cee0=_0x5e4fb2[_0x3fc7('0x5b')](-0x1);if(_0x48cee0==='/'){_0x5e4fb2=_0x5e4fb2[_0x3fc7('0x5c')](0x0,_0x5e4fb2[_0x3fc7('0x5d')](_0x48cee0));}return rp({'method':'GET','uri':util[_0x3fc7('0x5e')](_0x3fc7('0x5f'),_0x5e4fb2,_0x3fc7('0x60')),'headers':{'Authorization':util[_0x3fc7('0x5e')](_0x3fc7('0x61'),new Buffer(util[_0x3fc7('0x5e')](_0x3fc7('0x62'),_0x422406[_0x3fc7('0x5a')]))['toString']('base64'))},'json':!![]});}})['then'](function(_0x29fc88){if(_0x29fc88){var _0x2b6bce=[_0x3fc7('0x63'),_0x3fc7('0x64'),'agent',_0x3fc7('0x65'),_0x3fc7('0x1a'),_0x3fc7('0x66'),_0x3fc7('0x67'),_0x3fc7('0x68'),_0x3fc7('0x69'),_0x3fc7('0x67'),_0x3fc7('0x6a')];_[_0x3fc7('0x6b')](_0x29fc88,function(_0x3fb497){return _0x2b6bce[_0x3fc7('0x6c')](_0x3fb497[_0x3fc7('0x2a')])||!_0x3fb497['default']&&_0x3fb497[_0x3fc7('0x2f')]!=='custom_text'&&_0x3fb497['type']!==_0x3fc7('0x6d');});return{'count':_0x29fc88[_0x3fc7('0x38')],'rows':_['map'](_0x29fc88,function(_0x46b109){return{'id':_0x46b109['name'],'name':_0x46b109[_0x3fc7('0x6e')],'custom':!_0x46b109[_0x3fc7('0x6f')],'options':_0x46b109[_0x3fc7('0x70')]?_[_0x3fc7('0x32')](_0x46b109[_0x3fc7('0x70')],function(_0x44cf7f){return{'name':_[_0x3fc7('0x71')](_0x44cf7f),'value':_0x44cf7f};}):[]};})};}})[_0x3fc7('0x41')](respondWithResult(_0x228bff,null))['catch'](function(_0x2f5e9f){var _0x26b1ca=_0x2c4486[_0x3fc7('0x33')][_0x3fc7('0x72')]?0x1f4:_0x2f5e9f[_0x3fc7('0x73')]||0x1f4;logger[_0x3fc7('0x28')](_0x3fc7('0x74'),_0x3fc7('0x58'),_0x26b1ca,JSON[_0x3fc7('0x75')](_0x2f5e9f));delete _0x2f5e9f[_0x3fc7('0x2a')];if(_0x26b1ca===0x191){_0x26b1ca=0x190;}_0x228bff[_0x3fc7('0x1a')](_0x26b1ca)[_0x3fc7('0x76')](_0x2c4486[_0x3fc7('0x33')][_0x3fc7('0x72')]?{'message':_0x3fc7('0x77'),'statusCode':_0x2f5e9f[_0x3fc7('0x73')]}:_0x2f5e9f);});}; \ No newline at end of file +var _0x8aa7=['intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','filter','merge','options','includeAll','findAll','catch','show','keys','length','find','body','params','getConfigurations','findOne','rawAttributes','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','create','FreshdeskField','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','toString','base64','requester','subject','description','group','ticket_type','company','includes','default','custom_dropdown','label','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','end','status','offset','undefined','count','limit','set','json','apply','reject','then','destroy','error','name','send','index','FreshdeskAccount','fieldName','type','key','model','map','query'];(function(_0x4c3607,_0x1088bf){var _0x130440=function(_0x843e43){while(--_0x843e43){_0x4c3607['push'](_0x4c3607['shift']());}};_0x130440(++_0x1088bf);}(_0x8aa7,0xb6));var _0x78aa=function(_0x485b5a,_0x2b289b){_0x485b5a=_0x485b5a-0x0;var _0xd2b34d=_0x8aa7[_0x485b5a];return _0xd2b34d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x78aa('0x0'));var zipdir=require(_0x78aa('0x1'));var jsonpatch=require(_0x78aa('0x2'));var rp=require(_0x78aa('0x3'));var moment=require(_0x78aa('0x4'));var BPromise=require(_0x78aa('0x5'));var Mustache=require(_0x78aa('0x6'));var util=require('util');var path=require(_0x78aa('0x7'));var sox=require(_0x78aa('0x8'));var csv=require(_0x78aa('0x9'));var ejs=require(_0x78aa('0xa'));var fs=require('fs');var fs_extra=require(_0x78aa('0xb'));var _=require(_0x78aa('0xc'));var squel=require(_0x78aa('0xd'));var crypto=require(_0x78aa('0xe'));var jsforce=require(_0x78aa('0xf'));var deskjs=require(_0x78aa('0x10'));var toCsv=require(_0x78aa('0x9'));var querystring=require(_0x78aa('0x11'));var Papa=require(_0x78aa('0x12'));var Redis=require(_0x78aa('0x13'));var authService=require(_0x78aa('0x14'));var qs=require(_0x78aa('0x15'));var as=require(_0x78aa('0x16'));var hardwareService=require(_0x78aa('0x17'));var logger=require(_0x78aa('0x18'))('api');var utils=require('../../config/utils');var config=require(_0x78aa('0x19'));var licenseUtil=require(_0x78aa('0x1a'));var db=require('../../mysqldb')['db'];var integrations=require(_0x78aa('0x1b'));function respondWithStatusCode(_0x41b378,_0x1ef828){_0x1ef828=_0x1ef828||0xcc;return function(_0x33773a){if(_0x33773a){return _0x41b378[_0x78aa('0x1c')](_0x1ef828);}return _0x41b378['status'](_0x1ef828)[_0x78aa('0x1d')]();};}function respondWithResult(_0x431a26,_0x28d235){_0x28d235=_0x28d235||0xc8;return function(_0x2b0f8d){if(_0x2b0f8d){return _0x431a26[_0x78aa('0x1e')](_0x28d235)['json'](_0x2b0f8d);}};}function respondWithFilteredResult(_0x43aa6b,_0x1cbf5f){return function(_0x23dbb4){if(_0x23dbb4){var _0xa70322=typeof _0x1cbf5f[_0x78aa('0x1f')]===_0x78aa('0x20')&&typeof _0x1cbf5f['limit']==='undefined';var _0xded973=_0x23dbb4[_0x78aa('0x21')];var _0xc316d9=_0xa70322?0x0:_0x1cbf5f[_0x78aa('0x1f')];var _0x9879bf=_0xa70322?_0x23dbb4[_0x78aa('0x21')]:_0x1cbf5f[_0x78aa('0x1f')]+_0x1cbf5f[_0x78aa('0x22')];var _0x3f8d7d;if(_0x9879bf>=_0xded973){_0x9879bf=_0xded973;_0x3f8d7d=0xc8;}else{_0x3f8d7d=0xce;}_0x43aa6b[_0x78aa('0x1e')](_0x3f8d7d);return _0x43aa6b[_0x78aa('0x23')]('Content-Range',_0xc316d9+'-'+_0x9879bf+'/'+_0xded973)[_0x78aa('0x24')](_0x23dbb4);}return null;};}function patchUpdates(_0x4728d8){return function(_0x48c1d3){try{jsonpatch[_0x78aa('0x25')](_0x48c1d3,_0x4728d8,!![]);}catch(_0x4082a9){return BPromise[_0x78aa('0x26')](_0x4082a9);}return _0x48c1d3['save']();};}function saveUpdates(_0x5a9dbf,_0x157d43){return function(_0x109c88){if(_0x109c88){return _0x109c88['update'](_0x5a9dbf)[_0x78aa('0x27')](function(_0xb94f8f){return _0xb94f8f;});}return null;};}function removeEntity(_0x22a98c,_0x3b17b8){return function(_0x4beba8){if(_0x4beba8){return _0x4beba8[_0x78aa('0x28')]()[_0x78aa('0x27')](function(){_0x22a98c[_0x78aa('0x1e')](0xcc)[_0x78aa('0x1d')]();});}};}function handleEntityNotFound(_0x45b012,_0x262cc7){return function(_0x45a391){if(!_0x45a391){_0x45b012[_0x78aa('0x1c')](0x194);}return _0x45a391;};}function handleError(_0x595611,_0x339805){_0x339805=_0x339805||0x1f4;return function(_0x55d622){logger[_0x78aa('0x29')](_0x55d622['stack']);if(_0x55d622[_0x78aa('0x2a')]){delete _0x55d622[_0x78aa('0x2a')];}_0x595611[_0x78aa('0x1e')](_0x339805)[_0x78aa('0x2b')](_0x55d622);};}exports[_0x78aa('0x2c')]=function(_0x5683c8,_0x2d8b5e){var _0x434bc4={},_0x4dc0a6={},_0x156170={'count':0x0,'rows':[]};var _0x4d6616=_['map'](db[_0x78aa('0x2d')]['rawAttributes'],function(_0x4ba289){return{'name':_0x4ba289[_0x78aa('0x2e')],'type':_0x4ba289[_0x78aa('0x2f')][_0x78aa('0x30')]};});_0x4dc0a6[_0x78aa('0x31')]=_[_0x78aa('0x32')](_0x4d6616,_0x78aa('0x2a'));_0x4dc0a6[_0x78aa('0x33')]=_['keys'](_0x5683c8['query']);_0x4dc0a6['filters']=_[_0x78aa('0x34')](_0x4dc0a6[_0x78aa('0x31')],_0x4dc0a6[_0x78aa('0x33')]);_0x434bc4[_0x78aa('0x35')]=_['intersection'](_0x4dc0a6[_0x78aa('0x31')],qs[_0x78aa('0x36')](_0x5683c8[_0x78aa('0x33')]['fields']));_0x434bc4['attributes']=_0x434bc4['attributes']['length']?_0x434bc4[_0x78aa('0x35')]:_0x4dc0a6[_0x78aa('0x31')];if(!_0x5683c8[_0x78aa('0x33')][_0x78aa('0x37')](_0x78aa('0x38'))){_0x434bc4[_0x78aa('0x22')]=qs[_0x78aa('0x22')](_0x5683c8[_0x78aa('0x33')][_0x78aa('0x22')]);_0x434bc4['offset']=qs[_0x78aa('0x1f')](_0x5683c8['query'][_0x78aa('0x1f')]);}_0x434bc4[_0x78aa('0x39')]=qs[_0x78aa('0x3a')](_0x5683c8[_0x78aa('0x33')][_0x78aa('0x3a')]);_0x434bc4[_0x78aa('0x3b')]=qs[_0x78aa('0x3c')](_[_0x78aa('0x3d')](_0x5683c8['query'],_0x4dc0a6[_0x78aa('0x3c')]),_0x4d6616);if(_0x5683c8[_0x78aa('0x33')]['filter']){_0x434bc4[_0x78aa('0x3b')]=_['merge'](_0x434bc4[_0x78aa('0x3b')],{'$or':_[_0x78aa('0x32')](_0x4d6616,function(_0x3ab402){if(_0x3ab402[_0x78aa('0x2f')]!==_0x78aa('0x3e')){var _0x100cf3={};_0x100cf3[_0x3ab402[_0x78aa('0x2a')]]={'$like':'%'+_0x5683c8[_0x78aa('0x33')][_0x78aa('0x3f')]+'%'};return _0x100cf3;}})});}_0x434bc4=_[_0x78aa('0x40')]({},_0x434bc4,_0x5683c8[_0x78aa('0x41')]);var _0x19f4a0={'where':_0x434bc4[_0x78aa('0x3b')]};return db[_0x78aa('0x2d')]['count'](_0x19f4a0)['then'](function(_0x6d7615){_0x156170['count']=_0x6d7615;if(_0x5683c8[_0x78aa('0x33')][_0x78aa('0x42')]){_0x434bc4['include']=[{'all':!![]}];}return db[_0x78aa('0x2d')][_0x78aa('0x43')](_0x434bc4);})['then'](function(_0x951e86){_0x156170['rows']=_0x951e86;return _0x156170;})['then'](respondWithFilteredResult(_0x2d8b5e,_0x434bc4))[_0x78aa('0x44')](handleError(_0x2d8b5e,null));};exports[_0x78aa('0x45')]=function(_0x854921,_0x461d56){var _0x59d035={'raw':![],'where':{'id':_0x854921['params']['id']}},_0x680aac={};_0x680aac[_0x78aa('0x31')]=_[_0x78aa('0x46')](db['FreshdeskAccount']['rawAttributes']);_0x680aac[_0x78aa('0x33')]=_['keys'](_0x854921['query']);_0x680aac[_0x78aa('0x3c')]=_[_0x78aa('0x34')](_0x680aac['model'],_0x680aac[_0x78aa('0x33')]);_0x59d035[_0x78aa('0x35')]=_[_0x78aa('0x34')](_0x680aac[_0x78aa('0x31')],qs[_0x78aa('0x36')](_0x854921[_0x78aa('0x33')][_0x78aa('0x36')]));_0x59d035[_0x78aa('0x35')]=_0x59d035[_0x78aa('0x35')][_0x78aa('0x47')]?_0x59d035[_0x78aa('0x35')]:_0x680aac[_0x78aa('0x31')];if(_0x854921[_0x78aa('0x33')]['includeAll']){_0x59d035['include']=[{'all':!![]}];}_0x59d035=_[_0x78aa('0x40')]({},_0x59d035,_0x854921[_0x78aa('0x41')]);return db['FreshdeskAccount'][_0x78aa('0x48')](_0x59d035)['then'](handleEntityNotFound(_0x461d56,null))[_0x78aa('0x27')](respondWithResult(_0x461d56,null))[_0x78aa('0x44')](handleError(_0x461d56,null));};exports['create']=function(_0x5b29a3,_0x1f4b75){return db[_0x78aa('0x2d')]['create'](_0x5b29a3['body'],{})[_0x78aa('0x27')](respondWithResult(_0x1f4b75,0xc9))[_0x78aa('0x44')](handleError(_0x1f4b75,null));};exports['update']=function(_0x1ddc12,_0x40b244){if(_0x1ddc12[_0x78aa('0x49')]['id']){delete _0x1ddc12[_0x78aa('0x49')]['id'];}return db[_0x78aa('0x2d')]['find']({'where':{'id':_0x1ddc12[_0x78aa('0x4a')]['id']}})[_0x78aa('0x27')](handleEntityNotFound(_0x40b244,null))[_0x78aa('0x27')](saveUpdates(_0x1ddc12[_0x78aa('0x49')],null))[_0x78aa('0x27')](respondWithResult(_0x40b244,null))[_0x78aa('0x44')](handleError(_0x40b244,null));};exports['destroy']=function(_0x465d21,_0x178554){return db[_0x78aa('0x2d')]['find']({'where':{'id':_0x465d21[_0x78aa('0x4a')]['id']}})['then'](handleEntityNotFound(_0x178554,null))['then'](removeEntity(_0x178554,null))[_0x78aa('0x44')](handleError(_0x178554,null));};exports[_0x78aa('0x4b')]=function(_0x24f647,_0x4e5fd5,_0x3ba940){var _0x41442b={};var _0x2e96f9={};var _0x56caf8;var _0x383d71;return db[_0x78aa('0x2d')][_0x78aa('0x4c')]({'where':{'id':_0x24f647[_0x78aa('0x4a')]['id']}})[_0x78aa('0x27')](handleEntityNotFound(_0x4e5fd5,null))['then'](function(_0xb272dd){if(_0xb272dd){_0x56caf8=_0xb272dd;_0x2e96f9[_0x78aa('0x31')]=_[_0x78aa('0x46')](db['FreshdeskConfiguration'][_0x78aa('0x4d')]);_0x2e96f9[_0x78aa('0x33')]=_[_0x78aa('0x46')](_0x24f647['query']);_0x2e96f9[_0x78aa('0x3c')]=_['intersection'](_0x2e96f9[_0x78aa('0x31')],_0x2e96f9[_0x78aa('0x33')]);_0x41442b[_0x78aa('0x35')]=_['intersection'](_0x2e96f9[_0x78aa('0x31')],qs[_0x78aa('0x36')](_0x24f647[_0x78aa('0x33')][_0x78aa('0x36')]));_0x41442b['attributes']=_0x41442b[_0x78aa('0x35')]['length']?_0x41442b['attributes']:_0x2e96f9['model'];_0x41442b['order']=qs['sort'](_0x24f647[_0x78aa('0x33')][_0x78aa('0x3a')]);_0x41442b['where']=qs[_0x78aa('0x3c')](_[_0x78aa('0x3d')](_0x24f647[_0x78aa('0x33')],_0x2e96f9[_0x78aa('0x3c')]));if(_0x24f647['query'][_0x78aa('0x3f')]){_0x41442b[_0x78aa('0x3b')]=_['merge'](_0x41442b['where'],{'$or':_['map'](_0x41442b['attributes'],function(_0x42fa3e){var _0x389681={};_0x389681[_0x42fa3e]={'$like':'%'+_0x24f647[_0x78aa('0x33')]['filter']+'%'};return _0x389681;})});}_0x41442b=_[_0x78aa('0x40')]({},_0x41442b,_0x24f647['options']);return _0x56caf8[_0x78aa('0x4b')](_0x41442b);}})[_0x78aa('0x27')](function(_0x236624){if(_0x236624){_0x383d71=_0x236624[_0x78aa('0x47')];if(!_0x24f647[_0x78aa('0x33')][_0x78aa('0x37')](_0x78aa('0x38'))){_0x41442b[_0x78aa('0x22')]=qs['limit'](_0x24f647[_0x78aa('0x33')]['limit']);_0x41442b[_0x78aa('0x1f')]=qs[_0x78aa('0x1f')](_0x24f647[_0x78aa('0x33')][_0x78aa('0x1f')]);}return _0x56caf8[_0x78aa('0x4b')](_0x41442b);}})['then'](function(_0x3db9c1){if(_0x3db9c1){return _0x3db9c1?{'count':_0x383d71,'rows':_0x3db9c1}:null;}})[_0x78aa('0x27')](respondWithResult(_0x4e5fd5,null))[_0x78aa('0x44')](handleError(_0x4e5fd5,null));};exports[_0x78aa('0x4e')]=function(_0x1cc67d,_0x42b037,_0x40a7ca){if(_0x1cc67d['body']['id']){delete _0x1cc67d[_0x78aa('0x49')]['id'];}return db['FreshdeskAccount'][_0x78aa('0x4c')]({'where':{'id':_0x1cc67d[_0x78aa('0x4a')]['id']}})[_0x78aa('0x27')](handleEntityNotFound(_0x42b037,null))[_0x78aa('0x27')](function(_0x533a17){if(_0x533a17){_0x1cc67d[_0x78aa('0x49')][_0x78aa('0x4f')]=_0x533a17['id'];_0x1cc67d[_0x78aa('0x49')][_0x78aa('0x50')]=integrations[_0x78aa('0x51')](_0x1cc67d[_0x78aa('0x49')][_0x78aa('0x52')],_0x1cc67d['body'][_0x78aa('0x2f')]);_0x1cc67d[_0x78aa('0x49')][_0x78aa('0x53')]=integrations[_0x78aa('0x54')](_0x1cc67d[_0x78aa('0x49')]['channel'],_0x1cc67d[_0x78aa('0x49')]['type']);return db['FreshdeskConfiguration'][_0x78aa('0x55')](_0x1cc67d[_0x78aa('0x49')],{'include':[{'model':db[_0x78aa('0x56')],'as':'Subjects'},{'model':db['FreshdeskField'],'as':_0x78aa('0x53')}]});}return null;})[_0x78aa('0x27')](respondWithResult(_0x42b037,null))['catch'](handleError(_0x42b037,null));};exports[_0x78aa('0x57')]=function(_0x261d10,_0x5704b5,_0x4bbb87){var _0x2b5195='';return db[_0x78aa('0x2d')][_0x78aa('0x4c')]({'where':{'id':_0x261d10['params']['id']},'attributes':['id',_0x78aa('0x58'),_0x78aa('0x59')]})[_0x78aa('0x27')](handleEntityNotFound(_0x5704b5,null))[_0x78aa('0x27')](function(_0x3acb6a){if(_0x3acb6a){_0x2b5195=_0x3acb6a[_0x78aa('0x58')];var _0x324dc9=_0x2b5195[_0x78aa('0x5a')](-0x1);if(_0x324dc9==='/'){_0x2b5195=_0x2b5195[_0x78aa('0x5b')](0x0,_0x2b5195[_0x78aa('0x5c')](_0x324dc9));}return rp({'method':_0x78aa('0x5d'),'uri':util[_0x78aa('0x5e')](_0x78aa('0x5f'),_0x2b5195,_0x78aa('0x60')),'headers':{'Authorization':util[_0x78aa('0x5e')](_0x78aa('0x61'),new Buffer(util[_0x78aa('0x5e')]('%s:X',_0x3acb6a[_0x78aa('0x59')]))[_0x78aa('0x62')](_0x78aa('0x63')))},'json':!![]});}})[_0x78aa('0x27')](function(_0xdc2743){if(_0xdc2743){var _0x260bb2=[_0x78aa('0x64'),_0x78aa('0x65'),'agent',_0x78aa('0x66'),_0x78aa('0x1e'),'priority',_0x78aa('0x67'),'source',_0x78aa('0x68'),_0x78aa('0x67'),_0x78aa('0x69')];_['remove'](_0xdc2743,function(_0x47a18b){return _0x260bb2[_0x78aa('0x6a')](_0x47a18b['name'])||!_0x47a18b[_0x78aa('0x6b')]&&_0x47a18b[_0x78aa('0x2f')]!=='custom_text'&&_0x47a18b['type']!==_0x78aa('0x6c');});return{'count':_0xdc2743[_0x78aa('0x47')],'rows':_[_0x78aa('0x32')](_0xdc2743,function(_0x55a782){return{'id':_0x55a782['name'],'name':_0x55a782[_0x78aa('0x6d')],'custom':!_0x55a782[_0x78aa('0x6b')],'options':_0x55a782[_0x78aa('0x6e')]?_[_0x78aa('0x32')](_0x55a782[_0x78aa('0x6e')],function(_0x514ab8){return{'name':_[_0x78aa('0x6f')](_0x514ab8),'value':_0x514ab8};}):[]};})};}})['then'](respondWithResult(_0x5704b5,null))['catch'](function(_0x458345){var _0x34a120=_0x261d10[_0x78aa('0x33')][_0x78aa('0x70')]?0x1f4:_0x458345[_0x78aa('0x71')]||0x1f4;logger[_0x78aa('0x29')](_0x78aa('0x72'),_0x78aa('0x57'),_0x34a120,JSON[_0x78aa('0x73')](_0x458345));delete _0x458345[_0x78aa('0x2a')];if(_0x34a120===0x191){_0x34a120=0x190;}_0x5704b5[_0x78aa('0x1e')](_0x34a120)[_0x78aa('0x2b')](_0x261d10[_0x78aa('0x33')][_0x78aa('0x70')]?{'message':_0x78aa('0x74'),'statusCode':_0x458345[_0x78aa('0x71')]}:_0x458345);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index a5db2f3..eff6bbe 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 _0x916c=['int_freshdesk_accounts','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0xba78e1,_0x452ddb){var _0x4a7b98=function(_0x72a5ef){while(--_0x72a5ef){_0xba78e1['push'](_0xba78e1['shift']());}};_0x4a7b98(++_0x452ddb);}(_0x916c,0x109));var _0xc916=function(_0x2ac5f8,_0x4c3a9f){_0x2ac5f8=_0x2ac5f8-0x0;var _0x3b8229=_0x916c[_0x2ac5f8];return _0x3b8229;};'use strict';var _=require(_0xc916('0x0'));var util=require(_0xc916('0x1'));var logger=require(_0xc916('0x2'))(_0xc916('0x3'));var moment=require(_0xc916('0x4'));var BPromise=require('bluebird');var rp=require(_0xc916('0x5'));var fs=require('fs');var path=require(_0xc916('0x6'));var rimraf=require(_0xc916('0x7'));var config=require(_0xc916('0x8'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xc916('0x9')]=function(_0x50cb82,_0x3fe8cf){return _0x50cb82[_0xc916('0xa')]('FreshdeskAccount',attributes,{'tableName':_0xc916('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x06c7=['int_freshdesk_accounts','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount'];(function(_0x473cb5,_0x31d974){var _0x4386aa=function(_0x3f674b){while(--_0x3f674b){_0x473cb5['push'](_0x473cb5['shift']());}};_0x4386aa(++_0x31d974);}(_0x06c7,0x143));var _0x706c=function(_0x49a53f,_0x91432a){_0x49a53f=_0x49a53f-0x0;var _0xc233fa=_0x06c7[_0x49a53f];return _0xc233fa;};'use strict';var _=require(_0x706c('0x0'));var util=require(_0x706c('0x1'));var logger=require('../../config/logger')(_0x706c('0x2'));var moment=require('moment');var BPromise=require(_0x706c('0x3'));var rp=require(_0x706c('0x4'));var fs=require('fs');var path=require(_0x706c('0x5'));var rimraf=require(_0x706c('0x6'));var config=require(_0x706c('0x7'));var attributes=require(_0x706c('0x8'));var integrations=require(_0x706c('0x9'));module[_0x706c('0xa')]=function(_0x434664,_0x36545e){return _0x434664[_0x706c('0xb')](_0x706c('0xc'),attributes,{'tableName':_0x706c('0xd'),'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 d44aaf1..692272e 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 _0x8767=['error','code','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','raw','options','attributes','limit','include','model','map','info','stringify','ShowFreshdeskAccount','find','where','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x8767,0x134));var _0x7876=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8767[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x7876('0x0'));var moment=require(_0x7876('0x1'));var BPromise=require(_0x7876('0x2'));var rs=require(_0x7876('0x3'));var fs=require('fs');var Redis=require(_0x7876('0x4'));var db=require(_0x7876('0x5'))['db'];var utils=require(_0x7876('0x6'));var logger=require(_0x7876('0x7'))(_0x7876('0x8'));var config=require(_0x7876('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7876('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x484227,_0x43e86f,_0x167524){return new BPromise(function(_0x11fdd1,_0x19e7d3){return client['request'](_0x484227,_0x167524)[_0x7876('0xb')](function(_0x50136a){logger['info'](_0x7876('0xc'),_0x43e86f,_0x7876('0xd'));logger[_0x7876('0xe')](_0x7876('0xf'),_0x43e86f,_0x7876('0xd'),JSON['stringify'](_0x50136a));if(_0x50136a[_0x7876('0x10')]){if(_0x50136a[_0x7876('0x10')][_0x7876('0x11')]===0x1f4){logger[_0x7876('0x10')](_0x7876('0xc'),_0x43e86f,_0x50136a[_0x7876('0x10')][_0x7876('0x12')]);return _0x19e7d3(_0x50136a[_0x7876('0x10')][_0x7876('0x12')]);}logger[_0x7876('0x10')](_0x7876('0xc'),_0x43e86f,_0x50136a[_0x7876('0x10')]['message']);return _0x11fdd1(_0x50136a[_0x7876('0x10')][_0x7876('0x12')]);}else{logger['info'](_0x7876('0xc'),_0x43e86f,'request\x20sent');_0x11fdd1(_0x50136a[_0x7876('0x13')][_0x7876('0x12')]);}})[_0x7876('0x14')](function(_0x4c825d){logger[_0x7876('0x10')](_0x7876('0xc'),_0x43e86f,_0x4c825d);_0x19e7d3(_0x4c825d);});});}exports[_0x7876('0x15')]=function(_0x18a301){var _0x594503=this;return new Promise(function(_0xaf8a14,_0x8c969e){return db[_0x7876('0x16')][_0x7876('0x17')]({'raw':_0x18a301['options']?_0x18a301['options'][_0x7876('0x18')]===undefined?!![]:![]:!![],'where':_0x18a301['options']?_0x18a301[_0x7876('0x19')]['where']||null:null,'attributes':_0x18a301[_0x7876('0x19')]?_0x18a301[_0x7876('0x19')][_0x7876('0x1a')]||null:null,'limit':_0x18a301['options']?_0x18a301[_0x7876('0x19')][_0x7876('0x1b')]||null:null,'include':_0x18a301[_0x7876('0x19')]?_0x18a301['options'][_0x7876('0x1c')]?_['map'](_0x18a301[_0x7876('0x19')][_0x7876('0x1c')],function(_0x140f5e){return{'model':db[_0x140f5e[_0x7876('0x1d')]],'as':_0x140f5e['as'],'attributes':_0x140f5e[_0x7876('0x1a')],'include':_0x140f5e[_0x7876('0x1c')]?_[_0x7876('0x1e')](_0x140f5e['include'],function(_0x30bfed){return{'model':db[_0x30bfed[_0x7876('0x1d')]],'as':_0x30bfed['as'],'attributes':_0x30bfed[_0x7876('0x1a')],'include':_0x30bfed[_0x7876('0x1c')]?_[_0x7876('0x1e')](_0x30bfed['include'],function(_0x35ce2b){return{'model':db[_0x35ce2b[_0x7876('0x1d')]],'as':_0x35ce2b['as'],'attributes':_0x35ce2b[_0x7876('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x7876('0xb')](function(_0x3a6646){logger[_0x7876('0x1f')](_0x7876('0x15'),_0x18a301);logger[_0x7876('0xe')](_0x7876('0x15'),_0x18a301,JSON[_0x7876('0x20')](_0x3a6646));_0xaf8a14(_0x3a6646);})[_0x7876('0x14')](function(_0x346799){logger[_0x7876('0x10')](_0x7876('0x15'),_0x346799[_0x7876('0x12')],_0x18a301);_0x8c969e(_0x594503[_0x7876('0x10')](0x1f4,_0x346799[_0x7876('0x12')]));});});};exports[_0x7876('0x21')]=function(_0x3aceab){var _0x307cb2=this;return new Promise(function(_0x49648a,_0x3c614a){return db[_0x7876('0x16')][_0x7876('0x22')]({'raw':_0x3aceab[_0x7876('0x19')]?_0x3aceab['options'][_0x7876('0x18')]===undefined?!![]:![]:!![],'where':_0x3aceab[_0x7876('0x19')]?_0x3aceab[_0x7876('0x19')][_0x7876('0x23')]||null:null,'attributes':_0x3aceab[_0x7876('0x19')]?_0x3aceab['options'][_0x7876('0x1a')]||null:null,'include':_0x3aceab[_0x7876('0x19')]?_0x3aceab[_0x7876('0x19')][_0x7876('0x1c')]?_[_0x7876('0x1e')](_0x3aceab[_0x7876('0x19')][_0x7876('0x1c')],function(_0x4f5ab6){return{'model':db[_0x4f5ab6[_0x7876('0x1d')]],'as':_0x4f5ab6['as'],'attributes':_0x4f5ab6[_0x7876('0x1a')],'include':_0x4f5ab6['include']?_[_0x7876('0x1e')](_0x4f5ab6[_0x7876('0x1c')],function(_0x5d301f){return{'model':db[_0x5d301f[_0x7876('0x1d')]],'as':_0x5d301f['as'],'attributes':_0x5d301f[_0x7876('0x1a')],'include':_0x5d301f[_0x7876('0x1c')]?_[_0x7876('0x1e')](_0x5d301f[_0x7876('0x1c')],function(_0x3e382b){return{'model':db[_0x3e382b['model']],'as':_0x3e382b['as'],'attributes':_0x3e382b['attributes']};}):[]};}):[]};}):[]:[]})[_0x7876('0xb')](function(_0x326cc9){logger[_0x7876('0x1f')](_0x7876('0x21'),_0x3aceab);logger[_0x7876('0xe')](_0x7876('0x21'),_0x3aceab,JSON[_0x7876('0x20')](_0x326cc9));_0x49648a(_0x326cc9);})[_0x7876('0x14')](function(_0x2ca9fe){logger['error'](_0x7876('0x21'),_0x2ca9fe['message'],_0x3aceab);_0x3c614a(_0x307cb2[_0x7876('0x10')](0x1f4,_0x2ca9fe[_0x7876('0x12')]));});});}; \ No newline at end of file +var _0x386f=['util','randomstring','ioredis','../../config/logger','rpc','jayson/promise','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetFreshdeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','debug','FreshdeskAccount','find','ShowFreshdeskAccount'];(function(_0x21aa5b,_0x2c808f){var _0x2ca4c8=function(_0x5819e5){while(--_0x5819e5){_0x21aa5b['push'](_0x21aa5b['shift']());}};_0x2ca4c8(++_0x2c808f);}(_0x386f,0x1b2));var _0xf386=function(_0x43afaf,_0x5bd718){_0x43afaf=_0x43afaf-0x0;var _0x579146=_0x386f[_0x43afaf];return _0x579146;};'use strict';var _=require('lodash');var util=require(_0xf386('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf386('0x1'));var fs=require('fs');var Redis=require(_0xf386('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf386('0x3'))(_0xf386('0x4'));var config=require('../../config/environment');var jayson=require(_0xf386('0x5'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x40ee0e,_0x234dc5,_0x373006){return new BPromise(function(_0x22236c,_0x132fd9){return client[_0xf386('0x6')](_0x40ee0e,_0x373006)[_0xf386('0x7')](function(_0x1e94f2){logger[_0xf386('0x8')](_0xf386('0x9'),_0x234dc5,_0xf386('0xa'));logger['debug']('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x234dc5,_0xf386('0xa'),JSON[_0xf386('0xb')](_0x1e94f2));if(_0x1e94f2['error']){if(_0x1e94f2[_0xf386('0xc')][_0xf386('0xd')]===0x1f4){logger['error'](_0xf386('0x9'),_0x234dc5,_0x1e94f2[_0xf386('0xc')]['message']);return _0x132fd9(_0x1e94f2[_0xf386('0xc')]['message']);}logger['error'](_0xf386('0x9'),_0x234dc5,_0x1e94f2[_0xf386('0xc')]['message']);return _0x22236c(_0x1e94f2[_0xf386('0xc')][_0xf386('0xe')]);}else{logger[_0xf386('0x8')](_0xf386('0x9'),_0x234dc5,_0xf386('0xa'));_0x22236c(_0x1e94f2[_0xf386('0xf')][_0xf386('0xe')]);}})[_0xf386('0x10')](function(_0x2aa333){logger[_0xf386('0xc')]('FreshdeskAccount,\x20%s,\x20%s',_0x234dc5,_0x2aa333);_0x132fd9(_0x2aa333);});});}exports[_0xf386('0x11')]=function(_0x3ed81f){var _0x10a893=this;return new Promise(function(_0x3950cf,_0x223f46){return db['FreshdeskAccount'][_0xf386('0x12')]({'raw':_0x3ed81f[_0xf386('0x13')]?_0x3ed81f[_0xf386('0x13')][_0xf386('0x14')]===undefined?!![]:![]:!![],'where':_0x3ed81f[_0xf386('0x13')]?_0x3ed81f[_0xf386('0x13')][_0xf386('0x15')]||null:null,'attributes':_0x3ed81f[_0xf386('0x13')]?_0x3ed81f[_0xf386('0x13')][_0xf386('0x16')]||null:null,'limit':_0x3ed81f[_0xf386('0x13')]?_0x3ed81f[_0xf386('0x13')][_0xf386('0x17')]||null:null,'include':_0x3ed81f[_0xf386('0x13')]?_0x3ed81f[_0xf386('0x13')][_0xf386('0x18')]?_['map'](_0x3ed81f[_0xf386('0x13')][_0xf386('0x18')],function(_0x57cc22){return{'model':db[_0x57cc22['model']],'as':_0x57cc22['as'],'attributes':_0x57cc22[_0xf386('0x16')],'include':_0x57cc22[_0xf386('0x18')]?_[_0xf386('0x19')](_0x57cc22['include'],function(_0x4c7472){return{'model':db[_0x4c7472[_0xf386('0x1a')]],'as':_0x4c7472['as'],'attributes':_0x4c7472[_0xf386('0x16')],'include':_0x4c7472[_0xf386('0x18')]?_[_0xf386('0x19')](_0x4c7472[_0xf386('0x18')],function(_0x1a1a90){return{'model':db[_0x1a1a90[_0xf386('0x1a')]],'as':_0x1a1a90['as'],'attributes':_0x1a1a90['attributes']};}):[]};}):[]};}):[]:[]})[_0xf386('0x7')](function(_0x5c3890){logger[_0xf386('0x8')]('GetFreshdeskAccount',_0x3ed81f);logger[_0xf386('0x1b')]('GetFreshdeskAccount',_0x3ed81f,JSON[_0xf386('0xb')](_0x5c3890));_0x3950cf(_0x5c3890);})[_0xf386('0x10')](function(_0x150393){logger[_0xf386('0xc')](_0xf386('0x11'),_0x150393[_0xf386('0xe')],_0x3ed81f);_0x223f46(_0x10a893['error'](0x1f4,_0x150393['message']));});});};exports['ShowFreshdeskAccount']=function(_0x339447){var _0xc45c46=this;return new Promise(function(_0x2d9491,_0x33b3ee){return db[_0xf386('0x1c')][_0xf386('0x1d')]({'raw':_0x339447['options']?_0x339447[_0xf386('0x13')][_0xf386('0x14')]===undefined?!![]:![]:!![],'where':_0x339447['options']?_0x339447['options']['where']||null:null,'attributes':_0x339447[_0xf386('0x13')]?_0x339447[_0xf386('0x13')]['attributes']||null:null,'include':_0x339447['options']?_0x339447[_0xf386('0x13')][_0xf386('0x18')]?_['map'](_0x339447[_0xf386('0x13')][_0xf386('0x18')],function(_0xb79a5f){return{'model':db[_0xb79a5f[_0xf386('0x1a')]],'as':_0xb79a5f['as'],'attributes':_0xb79a5f['attributes'],'include':_0xb79a5f[_0xf386('0x18')]?_[_0xf386('0x19')](_0xb79a5f[_0xf386('0x18')],function(_0x177407){return{'model':db[_0x177407['model']],'as':_0x177407['as'],'attributes':_0x177407[_0xf386('0x16')],'include':_0x177407[_0xf386('0x18')]?_['map'](_0x177407[_0xf386('0x18')],function(_0x5926d7){return{'model':db[_0x5926d7[_0xf386('0x1a')]],'as':_0x5926d7['as'],'attributes':_0x5926d7[_0xf386('0x16')]};}):[]};}):[]};}):[]:[]})[_0xf386('0x7')](function(_0x447d7c){logger[_0xf386('0x8')](_0xf386('0x1e'),_0x339447);logger[_0xf386('0x1b')]('ShowFreshdeskAccount',_0x339447,JSON[_0xf386('0xb')](_0x447d7c));_0x2d9491(_0x447d7c);})[_0xf386('0x10')](function(_0x10f4f1){logger[_0xf386('0xc')](_0xf386('0x1e'),_0x10f4f1[_0xf386('0xe')],_0x339447);_0x33b3ee(_0xc45c46[_0xf386('0xc')](0x1f4,_0x10f4f1['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 0b45f77..2134309 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 _0xda6f=['delete','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','post','/:id/tags','setTags','put','update'];(function(_0x791857,_0x1792be){var _0x377b2a=function(_0x38e7bf){while(--_0x38e7bf){_0x791857['push'](_0x791857['shift']());}};_0x377b2a(++_0x1792be);}(_0xda6f,0x1ef));var _0xfda6=function(_0x29c565,_0x1cc9cd){_0x29c565=_0x29c565-0x0;var _0x1bdf36=_0xda6f[_0x29c565];return _0x1bdf36;};'use strict';var multer=require(_0xfda6('0x0'));var util=require(_0xfda6('0x1'));var path=require(_0xfda6('0x2'));var timeout=require(_0xfda6('0x3'));var express=require(_0xfda6('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xfda6('0x5'));var config=require(_0xfda6('0x6'));var controller=require(_0xfda6('0x7'));router[_0xfda6('0x8')]('/',auth[_0xfda6('0x9')](),controller[_0xfda6('0xa')]);router[_0xfda6('0x8')](_0xfda6('0xb'),auth[_0xfda6('0x9')](),controller[_0xfda6('0xc')]);router[_0xfda6('0x8')](_0xfda6('0xd'),auth[_0xfda6('0x9')](),controller[_0xfda6('0xe')]);router[_0xfda6('0x8')](_0xfda6('0xf'),auth['isAuthenticated'](),controller[_0xfda6('0x10')]);router[_0xfda6('0x8')](_0xfda6('0x11'),auth['isAuthenticated'](),controller[_0xfda6('0x12')]);router['get']('/:id/tags',auth[_0xfda6('0x9')](),controller['getTags']);router['post']('/',auth['isAuthenticated'](),controller[_0xfda6('0x13')]);router[_0xfda6('0x14')](_0xfda6('0x15'),auth[_0xfda6('0x9')](),controller[_0xfda6('0x16')]);router[_0xfda6('0x17')]('/:id',auth[_0xfda6('0x9')](),controller[_0xfda6('0x18')]);router[_0xfda6('0x19')](_0xfda6('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xc57e=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','show','getFields','getSubjects','getDescriptions','getTags','post','create','setTags','update','delete','/:id','destroy','exports','multer','path','connect-timeout'];(function(_0xf0220,_0x9ea7ea){var _0x32602d=function(_0x140dd3){while(--_0x140dd3){_0xf0220['push'](_0xf0220['shift']());}};_0x32602d(++_0x9ea7ea);}(_0xc57e,0x129));var _0xec57=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xc57e[_0x17d9e3];return _0x14192d;};'use strict';var multer=require(_0xec57('0x0'));var util=require('util');var path=require(_0xec57('0x1'));var timeout=require(_0xec57('0x2'));var express=require(_0xec57('0x3'));var router=express[_0xec57('0x4')]();var fs_extra=require(_0xec57('0x5'));var auth=require(_0xec57('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xec57('0x7'));var controller=require(_0xec57('0x8'));router[_0xec57('0x9')]('/',auth[_0xec57('0xa')](),controller[_0xec57('0xb')]);router[_0xec57('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xec57('0xc')]);router[_0xec57('0x9')]('/:id/fields',auth[_0xec57('0xa')](),controller[_0xec57('0xd')]);router[_0xec57('0x9')]('/:id/subjects',auth[_0xec57('0xa')](),controller[_0xec57('0xe')]);router['get']('/:id/descriptions',auth[_0xec57('0xa')](),controller[_0xec57('0xf')]);router[_0xec57('0x9')]('/:id/tags',auth[_0xec57('0xa')](),controller[_0xec57('0x10')]);router[_0xec57('0x11')]('/',auth['isAuthenticated'](),controller[_0xec57('0x12')]);router[_0xec57('0x11')]('/:id/tags',auth['isAuthenticated'](),controller[_0xec57('0x13')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xec57('0x14')]);router[_0xec57('0x15')](_0xec57('0x16'),auth[_0xec57('0xa')](),controller[_0xec57('0x17')]);module[_0xec57('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 7367176..3845147 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 _0x670b=['exports','STRING','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x670b,0x1e8));var _0xb670=function(_0x4c074d,_0x27d130){_0x4c074d=_0x4c074d-0x0;var _0x23a6d2=_0x670b[_0x4c074d];return _0x23a6d2;};'use strict';var Sequelize=require(_0xb670('0x0'));module[_0xb670('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb670('0x2')]}}; \ No newline at end of file +var _0xe689=['exports','STRING'];(function(_0x2c0dc0,_0x19900d){var _0x4c0990=function(_0x530791){while(--_0x530791){_0x2c0dc0['push'](_0x2c0dc0['shift']());}};_0x4c0990(++_0x19900d);}(_0xe689,0x90));var _0x9e68=function(_0x43c74e,_0x438a2d){_0x43c74e=_0x43c74e-0x0;var _0x270270=_0xe689[_0x43c74e];return _0x270270;};'use strict';var Sequelize=require('sequelize');module[_0x9e68('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9e68('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index d457eda..9d2c24f 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 _0x2148=['setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','update','then','destroy','name','send','index','FreshdeskConfiguration','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','getFields','findOne','keys','FreshdeskField','pick','nolimit','order','getSubjects','getDescriptions','Tag','getTags'];(function(_0xe3e0af,_0x4564ed){var _0x4828e9=function(_0x55c7a7){while(--_0x55c7a7){_0xe3e0af['push'](_0xe3e0af['shift']());}};_0x4828e9(++_0x4564ed);}(_0x2148,0x162));var _0x8214=function(_0x3d78d7,_0x44acea){_0x3d78d7=_0x3d78d7-0x0;var _0x4b6784=_0x2148[_0x3d78d7];return _0x4b6784;};'use strict';var emlformat=require(_0x8214('0x0'));var rimraf=require(_0x8214('0x1'));var zipdir=require(_0x8214('0x2'));var jsonpatch=require(_0x8214('0x3'));var rp=require(_0x8214('0x4'));var moment=require(_0x8214('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8214('0x6'));var util=require(_0x8214('0x7'));var path=require(_0x8214('0x8'));var sox=require(_0x8214('0x9'));var csv=require('to-csv');var ejs=require(_0x8214('0xa'));var fs=require('fs');var fs_extra=require(_0x8214('0xb'));var _=require(_0x8214('0xc'));var squel=require(_0x8214('0xd'));var crypto=require(_0x8214('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x8214('0xf'));var toCsv=require(_0x8214('0x10'));var querystring=require(_0x8214('0x11'));var Papa=require(_0x8214('0x12'));var Redis=require(_0x8214('0x13'));var authService=require(_0x8214('0x14'));var qs=require(_0x8214('0x15'));var as=require(_0x8214('0x16'));var hardwareService=require(_0x8214('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0x8214('0x18'));var config=require(_0x8214('0x19'));var licenseUtil=require(_0x8214('0x1a'));var db=require(_0x8214('0x1b'))['db'];function respondWithStatusCode(_0x57cad0,_0x217a43){_0x217a43=_0x217a43||0xcc;return function(_0x3ab9df){if(_0x3ab9df){return _0x57cad0[_0x8214('0x1c')](_0x217a43);}return _0x57cad0[_0x8214('0x1d')](_0x217a43)[_0x8214('0x1e')]();};}function respondWithResult(_0x273c56,_0x5670cf){_0x5670cf=_0x5670cf||0xc8;return function(_0x39159f){if(_0x39159f){return _0x273c56[_0x8214('0x1d')](_0x5670cf)[_0x8214('0x1f')](_0x39159f);}};}function respondWithFilteredResult(_0x408ef2,_0x326fda){return function(_0xa4bc57){if(_0xa4bc57){var _0x35c1d6=typeof _0x326fda['offset']===_0x8214('0x20')&&typeof _0x326fda[_0x8214('0x21')]===_0x8214('0x20');var _0x3efb4b=_0xa4bc57[_0x8214('0x22')];var _0xb7c189=_0x35c1d6?0x0:_0x326fda[_0x8214('0x23')];var _0x5ce90d=_0x35c1d6?_0xa4bc57[_0x8214('0x22')]:_0x326fda[_0x8214('0x23')]+_0x326fda[_0x8214('0x21')];var _0x50b18e;if(_0x5ce90d>=_0x3efb4b){_0x5ce90d=_0x3efb4b;_0x50b18e=0xc8;}else{_0x50b18e=0xce;}_0x408ef2[_0x8214('0x1d')](_0x50b18e);return _0x408ef2[_0x8214('0x24')](_0x8214('0x25'),_0xb7c189+'-'+_0x5ce90d+'/'+_0x3efb4b)[_0x8214('0x1f')](_0xa4bc57);}return null;};}function patchUpdates(_0x1d3293){return function(_0x458f0d){try{jsonpatch['apply'](_0x458f0d,_0x1d3293,!![]);}catch(_0x39c88f){return BPromise[_0x8214('0x26')](_0x39c88f);}return _0x458f0d['save']();};}function saveUpdates(_0x540fc3,_0x29805d){return function(_0x1e2fc0){if(_0x1e2fc0){return _0x1e2fc0[_0x8214('0x27')](_0x540fc3)[_0x8214('0x28')](function(_0x44186e){return _0x44186e;});}return null;};}function removeEntity(_0x2f7c8b,_0x21c5db){return function(_0x15310f){if(_0x15310f){return _0x15310f[_0x8214('0x29')]()[_0x8214('0x28')](function(){_0x2f7c8b[_0x8214('0x1d')](0xcc)[_0x8214('0x1e')]();});}};}function handleEntityNotFound(_0x228dc7,_0x28d8fb){return function(_0x2acd31){if(!_0x2acd31){_0x228dc7[_0x8214('0x1c')](0x194);}return _0x2acd31;};}function handleError(_0x50cf93,_0x5e847a){_0x5e847a=_0x5e847a||0x1f4;return function(_0x33f7b0){logger['error'](_0x33f7b0['stack']);if(_0x33f7b0['name']){delete _0x33f7b0[_0x8214('0x2a')];}_0x50cf93[_0x8214('0x1d')](_0x5e847a)[_0x8214('0x2b')](_0x33f7b0);};}exports[_0x8214('0x2c')]=function(_0x3100a4,_0x1231fd){var _0x4ed886={},_0x4a9743={},_0x2f408d={'count':0x0,'rows':[]};var _0x510c5d=_['map'](db[_0x8214('0x2d')][_0x8214('0x2e')],function(_0x4e282b){return{'name':_0x4e282b[_0x8214('0x2f')],'type':_0x4e282b[_0x8214('0x30')][_0x8214('0x31')]};});_0x4a9743[_0x8214('0x32')]=_[_0x8214('0x33')](_0x510c5d,'name');_0x4a9743[_0x8214('0x34')]=_['keys'](_0x3100a4[_0x8214('0x34')]);_0x4a9743[_0x8214('0x35')]=_[_0x8214('0x36')](_0x4a9743['model'],_0x4a9743[_0x8214('0x34')]);_0x4ed886['attributes']=_['intersection'](_0x4a9743[_0x8214('0x32')],qs['fields'](_0x3100a4[_0x8214('0x34')][_0x8214('0x37')]));_0x4ed886[_0x8214('0x38')]=_0x4ed886[_0x8214('0x38')][_0x8214('0x39')]?_0x4ed886[_0x8214('0x38')]:_0x4a9743[_0x8214('0x32')];if(!_0x3100a4[_0x8214('0x34')][_0x8214('0x3a')]('nolimit')){_0x4ed886[_0x8214('0x21')]=qs[_0x8214('0x21')](_0x3100a4[_0x8214('0x34')][_0x8214('0x21')]);_0x4ed886[_0x8214('0x23')]=qs[_0x8214('0x23')](_0x3100a4['query'][_0x8214('0x23')]);}_0x4ed886['order']=qs[_0x8214('0x3b')](_0x3100a4[_0x8214('0x34')]['sort']);_0x4ed886['where']=qs[_0x8214('0x35')](_['pick'](_0x3100a4[_0x8214('0x34')],_0x4a9743[_0x8214('0x35')]),_0x510c5d);if(_0x3100a4[_0x8214('0x34')][_0x8214('0x3c')]){_0x4ed886[_0x8214('0x3d')]=_['merge'](_0x4ed886[_0x8214('0x3d')],{'$or':_[_0x8214('0x33')](_0x510c5d,function(_0x4569ca){if(_0x4569ca['type']!==_0x8214('0x3e')){var _0x3f7e2e={};_0x3f7e2e[_0x4569ca[_0x8214('0x2a')]]={'$like':'%'+_0x3100a4[_0x8214('0x34')][_0x8214('0x3c')]+'%'};return _0x3f7e2e;}})});}_0x4ed886=_[_0x8214('0x3f')]({},_0x4ed886,_0x3100a4[_0x8214('0x40')]);var _0x562f0e={'where':_0x4ed886[_0x8214('0x3d')]};return db['FreshdeskConfiguration']['count'](_0x562f0e)[_0x8214('0x28')](function(_0x39f26b){_0x2f408d[_0x8214('0x22')]=_0x39f26b;if(_0x3100a4[_0x8214('0x34')][_0x8214('0x41')]){_0x4ed886[_0x8214('0x42')]=[{'all':!![]}];}return db[_0x8214('0x2d')][_0x8214('0x43')](_0x4ed886);})[_0x8214('0x28')](function(_0x18f05f){_0x2f408d[_0x8214('0x44')]=_0x18f05f;return _0x2f408d;})[_0x8214('0x28')](respondWithFilteredResult(_0x1231fd,_0x4ed886))[_0x8214('0x45')](handleError(_0x1231fd,null));};exports[_0x8214('0x46')]=function(_0x2b829f,_0x3f1011){var _0x4228cb={'raw':![],'where':{'id':_0x2b829f[_0x8214('0x47')]['id']}},_0x19ca9b={};_0x19ca9b['model']=_['keys'](db[_0x8214('0x2d')]['rawAttributes']);_0x19ca9b[_0x8214('0x34')]=_['keys'](_0x2b829f[_0x8214('0x34')]);_0x19ca9b[_0x8214('0x35')]=_[_0x8214('0x36')](_0x19ca9b[_0x8214('0x32')],_0x19ca9b[_0x8214('0x34')]);_0x4228cb[_0x8214('0x38')]=_[_0x8214('0x36')](_0x19ca9b[_0x8214('0x32')],qs[_0x8214('0x37')](_0x2b829f[_0x8214('0x34')][_0x8214('0x37')]));_0x4228cb[_0x8214('0x38')]=_0x4228cb[_0x8214('0x38')]['length']?_0x4228cb[_0x8214('0x38')]:_0x19ca9b[_0x8214('0x32')];if(_0x2b829f[_0x8214('0x34')][_0x8214('0x41')]){_0x4228cb[_0x8214('0x42')]=[{'all':!![]}];}_0x4228cb=_['merge']({},_0x4228cb,_0x2b829f[_0x8214('0x40')]);return db[_0x8214('0x2d')]['find'](_0x4228cb)[_0x8214('0x28')](handleEntityNotFound(_0x3f1011,null))[_0x8214('0x28')](respondWithResult(_0x3f1011,null))[_0x8214('0x45')](handleError(_0x3f1011,null));};exports[_0x8214('0x48')]=function(_0x3a04b0,_0x15c46c){return db['FreshdeskConfiguration'][_0x8214('0x48')](_0x3a04b0[_0x8214('0x49')],{})[_0x8214('0x28')](respondWithResult(_0x15c46c,0xc9))[_0x8214('0x45')](handleError(_0x15c46c,null));};exports[_0x8214('0x27')]=function(_0x107356,_0x5115ab){if(_0x107356[_0x8214('0x49')]['id']){delete _0x107356[_0x8214('0x49')]['id'];}return db[_0x8214('0x2d')][_0x8214('0x4a')]({'where':{'id':_0x107356[_0x8214('0x47')]['id']}})['then'](handleEntityNotFound(_0x5115ab,null))[_0x8214('0x28')](saveUpdates(_0x107356[_0x8214('0x49')],null))[_0x8214('0x28')](respondWithResult(_0x5115ab,null))['catch'](handleError(_0x5115ab,null));};exports['destroy']=function(_0x4595ea,_0x2858ce){return db['FreshdeskConfiguration']['find']({'where':{'id':_0x4595ea[_0x8214('0x47')]['id']}})[_0x8214('0x28')](handleEntityNotFound(_0x2858ce,null))[_0x8214('0x28')](removeEntity(_0x2858ce,null))[_0x8214('0x45')](handleError(_0x2858ce,null));};exports[_0x8214('0x4b')]=function(_0x240e38,_0x460f38,_0x52ea20){var _0x2fc213={};var _0x12c276={};var _0x3c195e;var _0x2fa4fd;return db[_0x8214('0x2d')][_0x8214('0x4c')]({'where':{'id':_0x240e38['params']['id']}})[_0x8214('0x28')](handleEntityNotFound(_0x460f38,null))[_0x8214('0x28')](function(_0x33038c){if(_0x33038c){_0x3c195e=_0x33038c;_0x12c276[_0x8214('0x32')]=_[_0x8214('0x4d')](db[_0x8214('0x4e')][_0x8214('0x2e')]);_0x12c276['query']=_['keys'](_0x240e38[_0x8214('0x34')]);_0x12c276['filters']=_[_0x8214('0x36')](_0x12c276[_0x8214('0x32')],_0x12c276[_0x8214('0x34')]);_0x2fc213[_0x8214('0x38')]=_[_0x8214('0x36')](_0x12c276['model'],qs['fields'](_0x240e38[_0x8214('0x34')][_0x8214('0x37')]));_0x2fc213[_0x8214('0x38')]=_0x2fc213[_0x8214('0x38')][_0x8214('0x39')]?_0x2fc213[_0x8214('0x38')]:_0x12c276[_0x8214('0x32')];_0x2fc213['order']=qs[_0x8214('0x3b')](_0x240e38[_0x8214('0x34')]['sort']);_0x2fc213[_0x8214('0x3d')]=qs['filters'](_[_0x8214('0x4f')](_0x240e38[_0x8214('0x34')],_0x12c276[_0x8214('0x35')]));if(_0x240e38[_0x8214('0x34')][_0x8214('0x3c')]){_0x2fc213['where']=_[_0x8214('0x3f')](_0x2fc213[_0x8214('0x3d')],{'$or':_[_0x8214('0x33')](_0x2fc213[_0x8214('0x38')],function(_0x332e87){var _0x1bad78={};_0x1bad78[_0x332e87]={'$like':'%'+_0x240e38['query'][_0x8214('0x3c')]+'%'};return _0x1bad78;})});}_0x2fc213=_['merge']({},_0x2fc213,_0x240e38[_0x8214('0x40')]);return _0x3c195e[_0x8214('0x4b')](_0x2fc213);}})[_0x8214('0x28')](function(_0x539128){if(_0x539128){_0x2fa4fd=_0x539128['length'];if(!_0x240e38['query']['hasOwnProperty'](_0x8214('0x50'))){_0x2fc213[_0x8214('0x21')]=qs[_0x8214('0x21')](_0x240e38[_0x8214('0x34')]['limit']);_0x2fc213[_0x8214('0x23')]=qs['offset'](_0x240e38[_0x8214('0x34')][_0x8214('0x23')]);}return _0x3c195e[_0x8214('0x4b')](_0x2fc213);}})[_0x8214('0x28')](function(_0x4a0125){if(_0x4a0125){return _0x4a0125?{'count':_0x2fa4fd,'rows':_0x4a0125}:null;}})[_0x8214('0x28')](respondWithResult(_0x460f38,null))['catch'](handleError(_0x460f38,null));};exports['getSubjects']=function(_0x56449e,_0xff4831,_0x2d0688){var _0x666866={};var _0x2e2ba4={};var _0x342bf6;var _0x10becc;return db['FreshdeskConfiguration'][_0x8214('0x4c')]({'where':{'id':_0x56449e[_0x8214('0x47')]['id']}})['then'](handleEntityNotFound(_0xff4831,null))[_0x8214('0x28')](function(_0x2c89e7){if(_0x2c89e7){_0x342bf6=_0x2c89e7;_0x2e2ba4['model']=_[_0x8214('0x4d')](db[_0x8214('0x4e')]['rawAttributes']);_0x2e2ba4['query']=_['keys'](_0x56449e[_0x8214('0x34')]);_0x2e2ba4[_0x8214('0x35')]=_[_0x8214('0x36')](_0x2e2ba4[_0x8214('0x32')],_0x2e2ba4[_0x8214('0x34')]);_0x666866[_0x8214('0x38')]=_[_0x8214('0x36')](_0x2e2ba4['model'],qs[_0x8214('0x37')](_0x56449e[_0x8214('0x34')]['fields']));_0x666866[_0x8214('0x38')]=_0x666866[_0x8214('0x38')][_0x8214('0x39')]?_0x666866[_0x8214('0x38')]:_0x2e2ba4[_0x8214('0x32')];_0x666866[_0x8214('0x51')]=qs[_0x8214('0x3b')](_0x56449e[_0x8214('0x34')][_0x8214('0x3b')]);_0x666866[_0x8214('0x3d')]=qs[_0x8214('0x35')](_[_0x8214('0x4f')](_0x56449e[_0x8214('0x34')],_0x2e2ba4[_0x8214('0x35')]));if(_0x56449e['query'][_0x8214('0x3c')]){_0x666866[_0x8214('0x3d')]=_[_0x8214('0x3f')](_0x666866['where'],{'$or':_[_0x8214('0x33')](_0x666866['attributes'],function(_0x5a5363){var _0x3caf38={};_0x3caf38[_0x5a5363]={'$like':'%'+_0x56449e[_0x8214('0x34')][_0x8214('0x3c')]+'%'};return _0x3caf38;})});}_0x666866=_[_0x8214('0x3f')]({},_0x666866,_0x56449e[_0x8214('0x40')]);return _0x342bf6[_0x8214('0x52')](_0x666866);}})[_0x8214('0x28')](function(_0x5524d7){if(_0x5524d7){_0x10becc=_0x5524d7['length'];if(!_0x56449e['query']['hasOwnProperty'](_0x8214('0x50'))){_0x666866[_0x8214('0x21')]=qs[_0x8214('0x21')](_0x56449e['query'][_0x8214('0x21')]);_0x666866[_0x8214('0x23')]=qs[_0x8214('0x23')](_0x56449e['query'][_0x8214('0x23')]);}return _0x342bf6[_0x8214('0x52')](_0x666866);}})[_0x8214('0x28')](function(_0x22e291){if(_0x22e291){return _0x22e291?{'count':_0x10becc,'rows':_0x22e291}:null;}})[_0x8214('0x28')](respondWithResult(_0xff4831,null))['catch'](handleError(_0xff4831,null));};exports['getDescriptions']=function(_0x58c541,_0x1db282,_0xc550af){var _0x573dc1={};var _0x548407={};var _0x2290df;var _0x5e6280;return db[_0x8214('0x2d')][_0x8214('0x4c')]({'where':{'id':_0x58c541[_0x8214('0x47')]['id']}})[_0x8214('0x28')](handleEntityNotFound(_0x1db282,null))[_0x8214('0x28')](function(_0x5c3f87){if(_0x5c3f87){_0x2290df=_0x5c3f87;_0x548407[_0x8214('0x32')]=_['keys'](db[_0x8214('0x4e')][_0x8214('0x2e')]);_0x548407['query']=_[_0x8214('0x4d')](_0x58c541[_0x8214('0x34')]);_0x548407['filters']=_['intersection'](_0x548407[_0x8214('0x32')],_0x548407[_0x8214('0x34')]);_0x573dc1[_0x8214('0x38')]=_[_0x8214('0x36')](_0x548407['model'],qs[_0x8214('0x37')](_0x58c541[_0x8214('0x34')]['fields']));_0x573dc1[_0x8214('0x38')]=_0x573dc1[_0x8214('0x38')]['length']?_0x573dc1[_0x8214('0x38')]:_0x548407[_0x8214('0x32')];_0x573dc1[_0x8214('0x51')]=qs[_0x8214('0x3b')](_0x58c541[_0x8214('0x34')]['sort']);_0x573dc1[_0x8214('0x3d')]=qs['filters'](_['pick'](_0x58c541[_0x8214('0x34')],_0x548407['filters']));if(_0x58c541[_0x8214('0x34')]['filter']){_0x573dc1['where']=_['merge'](_0x573dc1[_0x8214('0x3d')],{'$or':_[_0x8214('0x33')](_0x573dc1[_0x8214('0x38')],function(_0x5ef47d){var _0x27c34a={};_0x27c34a[_0x5ef47d]={'$like':'%'+_0x58c541[_0x8214('0x34')][_0x8214('0x3c')]+'%'};return _0x27c34a;})});}_0x573dc1=_[_0x8214('0x3f')]({},_0x573dc1,_0x58c541[_0x8214('0x40')]);return _0x2290df['getDescriptions'](_0x573dc1);}})[_0x8214('0x28')](function(_0x5e2f6a){if(_0x5e2f6a){_0x5e6280=_0x5e2f6a[_0x8214('0x39')];if(!_0x58c541[_0x8214('0x34')][_0x8214('0x3a')](_0x8214('0x50'))){_0x573dc1[_0x8214('0x21')]=qs[_0x8214('0x21')](_0x58c541[_0x8214('0x34')]['limit']);_0x573dc1['offset']=qs[_0x8214('0x23')](_0x58c541[_0x8214('0x34')][_0x8214('0x23')]);}return _0x2290df[_0x8214('0x53')](_0x573dc1);}})[_0x8214('0x28')](function(_0x589e4b){if(_0x589e4b){return _0x589e4b?{'count':_0x5e6280,'rows':_0x589e4b}:null;}})[_0x8214('0x28')](respondWithResult(_0x1db282,null))['catch'](handleError(_0x1db282,null));};exports['getTags']=function(_0x4fea30,_0x4e0875,_0x5387d3){var _0x1b23ae={};var _0x1fe63c={};var _0x1606d8;var _0x4eac29;return db['FreshdeskConfiguration'][_0x8214('0x4c')]({'where':{'id':_0x4fea30[_0x8214('0x47')]['id']}})[_0x8214('0x28')](handleEntityNotFound(_0x4e0875,null))[_0x8214('0x28')](function(_0xa735cd){if(_0xa735cd){_0x1606d8=_0xa735cd;_0x1fe63c[_0x8214('0x32')]=_[_0x8214('0x4d')](db[_0x8214('0x54')][_0x8214('0x2e')]);_0x1fe63c['query']=_['keys'](_0x4fea30['query']);_0x1fe63c[_0x8214('0x35')]=_[_0x8214('0x36')](_0x1fe63c['model'],_0x1fe63c['query']);_0x1b23ae[_0x8214('0x38')]=_[_0x8214('0x36')](_0x1fe63c[_0x8214('0x32')],qs[_0x8214('0x37')](_0x4fea30['query']['fields']));_0x1b23ae[_0x8214('0x38')]=_0x1b23ae[_0x8214('0x38')][_0x8214('0x39')]?_0x1b23ae[_0x8214('0x38')]:_0x1fe63c['model'];_0x1b23ae[_0x8214('0x51')]=qs[_0x8214('0x3b')](_0x4fea30[_0x8214('0x34')][_0x8214('0x3b')]);_0x1b23ae['where']=qs[_0x8214('0x35')](_[_0x8214('0x4f')](_0x4fea30[_0x8214('0x34')],_0x1fe63c[_0x8214('0x35')]));if(_0x4fea30[_0x8214('0x34')][_0x8214('0x3c')]){_0x1b23ae['where']=_[_0x8214('0x3f')](_0x1b23ae[_0x8214('0x3d')],{'$or':_['map'](_0x1b23ae[_0x8214('0x38')],function(_0x4dc77c){var _0x1338dc={};_0x1338dc[_0x4dc77c]={'$like':'%'+_0x4fea30['query'][_0x8214('0x3c')]+'%'};return _0x1338dc;})});}_0x1b23ae=_[_0x8214('0x3f')]({},_0x1b23ae,_0x4fea30['options']);return _0x1606d8['getTags'](_0x1b23ae);}})[_0x8214('0x28')](function(_0x41a793){if(_0x41a793){_0x4eac29=_0x41a793['length'];if(!_0x4fea30['query'][_0x8214('0x3a')](_0x8214('0x50'))){_0x1b23ae[_0x8214('0x21')]=qs[_0x8214('0x21')](_0x4fea30[_0x8214('0x34')][_0x8214('0x21')]);_0x1b23ae[_0x8214('0x23')]=qs[_0x8214('0x23')](_0x4fea30[_0x8214('0x34')][_0x8214('0x23')]);}return _0x1606d8[_0x8214('0x55')](_0x1b23ae);}})[_0x8214('0x28')](function(_0x218de6){if(_0x218de6){return _0x218de6?{'count':_0x4eac29,'rows':_0x218de6}:null;}})[_0x8214('0x28')](respondWithResult(_0x4e0875,null))[_0x8214('0x45')](handleError(_0x4e0875,null));};exports[_0x8214('0x56')]=function(_0x27be18,_0x548215,_0x38ac82){if(_0x27be18['body']['id']){delete _0x27be18[_0x8214('0x49')]['id'];}return db[_0x8214('0x2d')]['findOne']({'where':{'id':_0x27be18[_0x8214('0x47')]['id']}})[_0x8214('0x28')](handleEntityNotFound(_0x548215,null))[_0x8214('0x28')](function(_0xb15733){if(_0xb15733){return _0xb15733[_0x8214('0x56')](_0x27be18['body'][_0x8214('0x57')]||[]);}return null;})[_0x8214('0x28')](respondWithResult(_0x548215,null))[_0x8214('0x45')](handleError(_0x548215,null));}; \ No newline at end of file +var _0xd6a7=['mustache','path','sox','to-csv','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','end','status','undefined','limit','count','offset','Content-Range','json','apply','reject','save','update','then','destroy','name','send','index','map','type','model','query','intersection','fields','attributes','length','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','options','FreshdeskConfiguration','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','getFields','FreshdeskField','rawAttributes','order','findOne','getSubjects','getDescriptions','hasOwnProperty','Tag','getTags','setTags','ids','fast-json-patch','request-promise','moment','bluebird'];(function(_0xa5e6d1,_0x2cfbfd){var _0x200401=function(_0x5959dc){while(--_0x5959dc){_0xa5e6d1['push'](_0xa5e6d1['shift']());}};_0x200401(++_0x2cfbfd);}(_0xd6a7,0x18c));var _0x7d6a=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xd6a7[_0x3ab51d];return _0x29a04e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7d6a('0x0'));var rp=require(_0x7d6a('0x1'));var moment=require(_0x7d6a('0x2'));var BPromise=require(_0x7d6a('0x3'));var Mustache=require(_0x7d6a('0x4'));var util=require('util');var path=require(_0x7d6a('0x5'));var sox=require(_0x7d6a('0x6'));var csv=require(_0x7d6a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7d6a('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x7d6a('0x9'));var jsforce=require(_0x7d6a('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x7d6a('0x7'));var querystring=require(_0x7d6a('0xb'));var Papa=require(_0x7d6a('0xc'));var Redis=require(_0x7d6a('0xd'));var authService=require(_0x7d6a('0xe'));var qs=require(_0x7d6a('0xf'));var as=require(_0x7d6a('0x10'));var hardwareService=require(_0x7d6a('0x11'));var logger=require(_0x7d6a('0x12'))(_0x7d6a('0x13'));var utils=require(_0x7d6a('0x14'));var config=require(_0x7d6a('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xca56cd,_0x578e80){_0x578e80=_0x578e80||0xcc;return function(_0x4d4f36){if(_0x4d4f36){return _0xca56cd['sendStatus'](_0x578e80);}return _0xca56cd['status'](_0x578e80)[_0x7d6a('0x16')]();};}function respondWithResult(_0x23d331,_0x3790f7){_0x3790f7=_0x3790f7||0xc8;return function(_0x533108){if(_0x533108){return _0x23d331[_0x7d6a('0x17')](_0x3790f7)['json'](_0x533108);}};}function respondWithFilteredResult(_0x4928fd,_0x58d266){return function(_0x3f06c4){if(_0x3f06c4){var _0x3423c5=typeof _0x58d266['offset']===_0x7d6a('0x18')&&typeof _0x58d266[_0x7d6a('0x19')]===_0x7d6a('0x18');var _0x5b0990=_0x3f06c4[_0x7d6a('0x1a')];var _0x1888e5=_0x3423c5?0x0:_0x58d266[_0x7d6a('0x1b')];var _0x4e5a5f=_0x3423c5?_0x3f06c4['count']:_0x58d266[_0x7d6a('0x1b')]+_0x58d266[_0x7d6a('0x19')];var _0xd218c0;if(_0x4e5a5f>=_0x5b0990){_0x4e5a5f=_0x5b0990;_0xd218c0=0xc8;}else{_0xd218c0=0xce;}_0x4928fd[_0x7d6a('0x17')](_0xd218c0);return _0x4928fd['set'](_0x7d6a('0x1c'),_0x1888e5+'-'+_0x4e5a5f+'/'+_0x5b0990)[_0x7d6a('0x1d')](_0x3f06c4);}return null;};}function patchUpdates(_0x5ee49c){return function(_0x34e355){try{jsonpatch[_0x7d6a('0x1e')](_0x34e355,_0x5ee49c,!![]);}catch(_0x373a9d){return BPromise[_0x7d6a('0x1f')](_0x373a9d);}return _0x34e355[_0x7d6a('0x20')]();};}function saveUpdates(_0x44588c,_0x597de1){return function(_0x535ad0){if(_0x535ad0){return _0x535ad0[_0x7d6a('0x21')](_0x44588c)[_0x7d6a('0x22')](function(_0x3cdf37){return _0x3cdf37;});}return null;};}function removeEntity(_0x3a6771,_0x3c71f9){return function(_0x1bebe5){if(_0x1bebe5){return _0x1bebe5[_0x7d6a('0x23')]()[_0x7d6a('0x22')](function(){_0x3a6771['status'](0xcc)[_0x7d6a('0x16')]();});}};}function handleEntityNotFound(_0x3cc7e5,_0x2875f0){return function(_0x52748d){if(!_0x52748d){_0x3cc7e5['sendStatus'](0x194);}return _0x52748d;};}function handleError(_0x5b61f8,_0x4ad93b){_0x4ad93b=_0x4ad93b||0x1f4;return function(_0x5286b8){logger['error'](_0x5286b8['stack']);if(_0x5286b8[_0x7d6a('0x24')]){delete _0x5286b8[_0x7d6a('0x24')];}_0x5b61f8[_0x7d6a('0x17')](_0x4ad93b)[_0x7d6a('0x25')](_0x5286b8);};}exports[_0x7d6a('0x26')]=function(_0x41420f,_0x4c1d77){var _0x10626a={},_0x1b7532={},_0x5b4e74={'count':0x0,'rows':[]};var _0x4be50d=_[_0x7d6a('0x27')](db['FreshdeskConfiguration']['rawAttributes'],function(_0x151fe9){return{'name':_0x151fe9['fieldName'],'type':_0x151fe9[_0x7d6a('0x28')]['key']};});_0x1b7532[_0x7d6a('0x29')]=_[_0x7d6a('0x27')](_0x4be50d,'name');_0x1b7532[_0x7d6a('0x2a')]=_['keys'](_0x41420f[_0x7d6a('0x2a')]);_0x1b7532['filters']=_[_0x7d6a('0x2b')](_0x1b7532[_0x7d6a('0x29')],_0x1b7532[_0x7d6a('0x2a')]);_0x10626a['attributes']=_[_0x7d6a('0x2b')](_0x1b7532[_0x7d6a('0x29')],qs[_0x7d6a('0x2c')](_0x41420f[_0x7d6a('0x2a')]['fields']));_0x10626a['attributes']=_0x10626a[_0x7d6a('0x2d')][_0x7d6a('0x2e')]?_0x10626a[_0x7d6a('0x2d')]:_0x1b7532[_0x7d6a('0x29')];if(!_0x41420f['query']['hasOwnProperty'](_0x7d6a('0x2f'))){_0x10626a[_0x7d6a('0x19')]=qs[_0x7d6a('0x19')](_0x41420f[_0x7d6a('0x2a')][_0x7d6a('0x19')]);_0x10626a[_0x7d6a('0x1b')]=qs[_0x7d6a('0x1b')](_0x41420f[_0x7d6a('0x2a')][_0x7d6a('0x1b')]);}_0x10626a['order']=qs[_0x7d6a('0x30')](_0x41420f[_0x7d6a('0x2a')][_0x7d6a('0x30')]);_0x10626a['where']=qs[_0x7d6a('0x31')](_[_0x7d6a('0x32')](_0x41420f[_0x7d6a('0x2a')],_0x1b7532[_0x7d6a('0x31')]),_0x4be50d);if(_0x41420f[_0x7d6a('0x2a')][_0x7d6a('0x33')]){_0x10626a[_0x7d6a('0x34')]=_[_0x7d6a('0x35')](_0x10626a['where'],{'$or':_['map'](_0x4be50d,function(_0x54e909){if(_0x54e909[_0x7d6a('0x28')]!==_0x7d6a('0x36')){var _0x33f3e5={};_0x33f3e5[_0x54e909[_0x7d6a('0x24')]]={'$like':'%'+_0x41420f[_0x7d6a('0x2a')][_0x7d6a('0x33')]+'%'};return _0x33f3e5;}})});}_0x10626a=_['merge']({},_0x10626a,_0x41420f[_0x7d6a('0x37')]);var _0x44bb30={'where':_0x10626a['where']};return db[_0x7d6a('0x38')][_0x7d6a('0x1a')](_0x44bb30)[_0x7d6a('0x22')](function(_0x4cab21){_0x5b4e74[_0x7d6a('0x1a')]=_0x4cab21;if(_0x41420f[_0x7d6a('0x2a')]['includeAll']){_0x10626a[_0x7d6a('0x39')]=[{'all':!![]}];}return db[_0x7d6a('0x38')][_0x7d6a('0x3a')](_0x10626a);})[_0x7d6a('0x22')](function(_0x1b53fe){_0x5b4e74[_0x7d6a('0x3b')]=_0x1b53fe;return _0x5b4e74;})[_0x7d6a('0x22')](respondWithFilteredResult(_0x4c1d77,_0x10626a))[_0x7d6a('0x3c')](handleError(_0x4c1d77,null));};exports[_0x7d6a('0x3d')]=function(_0x176a96,_0x331510){var _0xbb304={'raw':![],'where':{'id':_0x176a96[_0x7d6a('0x3e')]['id']}},_0x3d3fff={};_0x3d3fff[_0x7d6a('0x29')]=_[_0x7d6a('0x3f')](db[_0x7d6a('0x38')]['rawAttributes']);_0x3d3fff[_0x7d6a('0x2a')]=_[_0x7d6a('0x3f')](_0x176a96[_0x7d6a('0x2a')]);_0x3d3fff[_0x7d6a('0x31')]=_[_0x7d6a('0x2b')](_0x3d3fff[_0x7d6a('0x29')],_0x3d3fff['query']);_0xbb304[_0x7d6a('0x2d')]=_[_0x7d6a('0x2b')](_0x3d3fff[_0x7d6a('0x29')],qs[_0x7d6a('0x2c')](_0x176a96[_0x7d6a('0x2a')][_0x7d6a('0x2c')]));_0xbb304['attributes']=_0xbb304[_0x7d6a('0x2d')]['length']?_0xbb304[_0x7d6a('0x2d')]:_0x3d3fff[_0x7d6a('0x29')];if(_0x176a96['query'][_0x7d6a('0x40')]){_0xbb304[_0x7d6a('0x39')]=[{'all':!![]}];}_0xbb304=_[_0x7d6a('0x35')]({},_0xbb304,_0x176a96[_0x7d6a('0x37')]);return db[_0x7d6a('0x38')][_0x7d6a('0x41')](_0xbb304)[_0x7d6a('0x22')](handleEntityNotFound(_0x331510,null))[_0x7d6a('0x22')](respondWithResult(_0x331510,null))['catch'](handleError(_0x331510,null));};exports[_0x7d6a('0x42')]=function(_0xf35c90,_0x470639){return db['FreshdeskConfiguration'][_0x7d6a('0x42')](_0xf35c90['body'],{})['then'](respondWithResult(_0x470639,0xc9))['catch'](handleError(_0x470639,null));};exports['update']=function(_0x2af009,_0x5b2519){if(_0x2af009[_0x7d6a('0x43')]['id']){delete _0x2af009[_0x7d6a('0x43')]['id'];}return db['FreshdeskConfiguration'][_0x7d6a('0x41')]({'where':{'id':_0x2af009[_0x7d6a('0x3e')]['id']}})['then'](handleEntityNotFound(_0x5b2519,null))[_0x7d6a('0x22')](saveUpdates(_0x2af009[_0x7d6a('0x43')],null))['then'](respondWithResult(_0x5b2519,null))[_0x7d6a('0x3c')](handleError(_0x5b2519,null));};exports[_0x7d6a('0x23')]=function(_0x25a260,_0x269459){return db[_0x7d6a('0x38')][_0x7d6a('0x41')]({'where':{'id':_0x25a260[_0x7d6a('0x3e')]['id']}})[_0x7d6a('0x22')](handleEntityNotFound(_0x269459,null))[_0x7d6a('0x22')](removeEntity(_0x269459,null))['catch'](handleError(_0x269459,null));};exports[_0x7d6a('0x44')]=function(_0x59cbaf,_0x21cd4c,_0x43ad68){var _0x2150ea={};var _0x14f7c1={};var _0x934fb3;var _0x4ae73c;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x59cbaf[_0x7d6a('0x3e')]['id']}})[_0x7d6a('0x22')](handleEntityNotFound(_0x21cd4c,null))[_0x7d6a('0x22')](function(_0x528cbe){if(_0x528cbe){_0x934fb3=_0x528cbe;_0x14f7c1[_0x7d6a('0x29')]=_['keys'](db[_0x7d6a('0x45')][_0x7d6a('0x46')]);_0x14f7c1[_0x7d6a('0x2a')]=_['keys'](_0x59cbaf[_0x7d6a('0x2a')]);_0x14f7c1[_0x7d6a('0x31')]=_[_0x7d6a('0x2b')](_0x14f7c1['model'],_0x14f7c1[_0x7d6a('0x2a')]);_0x2150ea[_0x7d6a('0x2d')]=_['intersection'](_0x14f7c1[_0x7d6a('0x29')],qs[_0x7d6a('0x2c')](_0x59cbaf['query'][_0x7d6a('0x2c')]));_0x2150ea[_0x7d6a('0x2d')]=_0x2150ea[_0x7d6a('0x2d')][_0x7d6a('0x2e')]?_0x2150ea[_0x7d6a('0x2d')]:_0x14f7c1[_0x7d6a('0x29')];_0x2150ea[_0x7d6a('0x47')]=qs[_0x7d6a('0x30')](_0x59cbaf[_0x7d6a('0x2a')][_0x7d6a('0x30')]);_0x2150ea[_0x7d6a('0x34')]=qs[_0x7d6a('0x31')](_['pick'](_0x59cbaf[_0x7d6a('0x2a')],_0x14f7c1[_0x7d6a('0x31')]));if(_0x59cbaf[_0x7d6a('0x2a')][_0x7d6a('0x33')]){_0x2150ea['where']=_['merge'](_0x2150ea[_0x7d6a('0x34')],{'$or':_[_0x7d6a('0x27')](_0x2150ea[_0x7d6a('0x2d')],function(_0x19ef33){var _0x4b61df={};_0x4b61df[_0x19ef33]={'$like':'%'+_0x59cbaf[_0x7d6a('0x2a')]['filter']+'%'};return _0x4b61df;})});}_0x2150ea=_[_0x7d6a('0x35')]({},_0x2150ea,_0x59cbaf[_0x7d6a('0x37')]);return _0x934fb3[_0x7d6a('0x44')](_0x2150ea);}})[_0x7d6a('0x22')](function(_0x48b122){if(_0x48b122){_0x4ae73c=_0x48b122['length'];if(!_0x59cbaf[_0x7d6a('0x2a')]['hasOwnProperty']('nolimit')){_0x2150ea['limit']=qs[_0x7d6a('0x19')](_0x59cbaf['query'][_0x7d6a('0x19')]);_0x2150ea[_0x7d6a('0x1b')]=qs[_0x7d6a('0x1b')](_0x59cbaf[_0x7d6a('0x2a')][_0x7d6a('0x1b')]);}return _0x934fb3[_0x7d6a('0x44')](_0x2150ea);}})[_0x7d6a('0x22')](function(_0x1b86fb){if(_0x1b86fb){return _0x1b86fb?{'count':_0x4ae73c,'rows':_0x1b86fb}:null;}})[_0x7d6a('0x22')](respondWithResult(_0x21cd4c,null))[_0x7d6a('0x3c')](handleError(_0x21cd4c,null));};exports['getSubjects']=function(_0x5d5c63,_0x54e73d,_0x419b85){var _0x2b51ef={};var _0x487e1c={};var _0x4fa324;var _0x22a1be;return db[_0x7d6a('0x38')][_0x7d6a('0x48')]({'where':{'id':_0x5d5c63[_0x7d6a('0x3e')]['id']}})[_0x7d6a('0x22')](handleEntityNotFound(_0x54e73d,null))[_0x7d6a('0x22')](function(_0x21e426){if(_0x21e426){_0x4fa324=_0x21e426;_0x487e1c[_0x7d6a('0x29')]=_[_0x7d6a('0x3f')](db[_0x7d6a('0x45')][_0x7d6a('0x46')]);_0x487e1c[_0x7d6a('0x2a')]=_[_0x7d6a('0x3f')](_0x5d5c63[_0x7d6a('0x2a')]);_0x487e1c['filters']=_['intersection'](_0x487e1c[_0x7d6a('0x29')],_0x487e1c[_0x7d6a('0x2a')]);_0x2b51ef['attributes']=_[_0x7d6a('0x2b')](_0x487e1c[_0x7d6a('0x29')],qs[_0x7d6a('0x2c')](_0x5d5c63[_0x7d6a('0x2a')]['fields']));_0x2b51ef[_0x7d6a('0x2d')]=_0x2b51ef[_0x7d6a('0x2d')][_0x7d6a('0x2e')]?_0x2b51ef[_0x7d6a('0x2d')]:_0x487e1c['model'];_0x2b51ef['order']=qs[_0x7d6a('0x30')](_0x5d5c63[_0x7d6a('0x2a')][_0x7d6a('0x30')]);_0x2b51ef['where']=qs['filters'](_[_0x7d6a('0x32')](_0x5d5c63[_0x7d6a('0x2a')],_0x487e1c['filters']));if(_0x5d5c63[_0x7d6a('0x2a')][_0x7d6a('0x33')]){_0x2b51ef[_0x7d6a('0x34')]=_['merge'](_0x2b51ef[_0x7d6a('0x34')],{'$or':_[_0x7d6a('0x27')](_0x2b51ef['attributes'],function(_0x59068e){var _0x49795d={};_0x49795d[_0x59068e]={'$like':'%'+_0x5d5c63[_0x7d6a('0x2a')][_0x7d6a('0x33')]+'%'};return _0x49795d;})});}_0x2b51ef=_['merge']({},_0x2b51ef,_0x5d5c63['options']);return _0x4fa324[_0x7d6a('0x49')](_0x2b51ef);}})[_0x7d6a('0x22')](function(_0x150208){if(_0x150208){_0x22a1be=_0x150208[_0x7d6a('0x2e')];if(!_0x5d5c63[_0x7d6a('0x2a')]['hasOwnProperty']('nolimit')){_0x2b51ef[_0x7d6a('0x19')]=qs[_0x7d6a('0x19')](_0x5d5c63[_0x7d6a('0x2a')][_0x7d6a('0x19')]);_0x2b51ef[_0x7d6a('0x1b')]=qs[_0x7d6a('0x1b')](_0x5d5c63[_0x7d6a('0x2a')]['offset']);}return _0x4fa324[_0x7d6a('0x49')](_0x2b51ef);}})[_0x7d6a('0x22')](function(_0x55b93d){if(_0x55b93d){return _0x55b93d?{'count':_0x22a1be,'rows':_0x55b93d}:null;}})[_0x7d6a('0x22')](respondWithResult(_0x54e73d,null))['catch'](handleError(_0x54e73d,null));};exports[_0x7d6a('0x4a')]=function(_0x25a7c8,_0x5a8160,_0x5ded6f){var _0x372660={};var _0x41e44a={};var _0x3588ab;var _0x51f3cc;return db[_0x7d6a('0x38')][_0x7d6a('0x48')]({'where':{'id':_0x25a7c8[_0x7d6a('0x3e')]['id']}})['then'](handleEntityNotFound(_0x5a8160,null))['then'](function(_0x5b10e2){if(_0x5b10e2){_0x3588ab=_0x5b10e2;_0x41e44a[_0x7d6a('0x29')]=_[_0x7d6a('0x3f')](db[_0x7d6a('0x45')][_0x7d6a('0x46')]);_0x41e44a[_0x7d6a('0x2a')]=_['keys'](_0x25a7c8[_0x7d6a('0x2a')]);_0x41e44a[_0x7d6a('0x31')]=_[_0x7d6a('0x2b')](_0x41e44a[_0x7d6a('0x29')],_0x41e44a[_0x7d6a('0x2a')]);_0x372660[_0x7d6a('0x2d')]=_[_0x7d6a('0x2b')](_0x41e44a['model'],qs[_0x7d6a('0x2c')](_0x25a7c8[_0x7d6a('0x2a')][_0x7d6a('0x2c')]));_0x372660[_0x7d6a('0x2d')]=_0x372660[_0x7d6a('0x2d')][_0x7d6a('0x2e')]?_0x372660[_0x7d6a('0x2d')]:_0x41e44a['model'];_0x372660[_0x7d6a('0x47')]=qs[_0x7d6a('0x30')](_0x25a7c8[_0x7d6a('0x2a')]['sort']);_0x372660[_0x7d6a('0x34')]=qs[_0x7d6a('0x31')](_[_0x7d6a('0x32')](_0x25a7c8[_0x7d6a('0x2a')],_0x41e44a[_0x7d6a('0x31')]));if(_0x25a7c8['query']['filter']){_0x372660[_0x7d6a('0x34')]=_['merge'](_0x372660[_0x7d6a('0x34')],{'$or':_[_0x7d6a('0x27')](_0x372660['attributes'],function(_0x4b11de){var _0xae49d0={};_0xae49d0[_0x4b11de]={'$like':'%'+_0x25a7c8['query']['filter']+'%'};return _0xae49d0;})});}_0x372660=_[_0x7d6a('0x35')]({},_0x372660,_0x25a7c8[_0x7d6a('0x37')]);return _0x3588ab['getDescriptions'](_0x372660);}})['then'](function(_0x28b9e1){if(_0x28b9e1){_0x51f3cc=_0x28b9e1[_0x7d6a('0x2e')];if(!_0x25a7c8[_0x7d6a('0x2a')][_0x7d6a('0x4b')](_0x7d6a('0x2f'))){_0x372660['limit']=qs[_0x7d6a('0x19')](_0x25a7c8[_0x7d6a('0x2a')][_0x7d6a('0x19')]);_0x372660[_0x7d6a('0x1b')]=qs[_0x7d6a('0x1b')](_0x25a7c8[_0x7d6a('0x2a')]['offset']);}return _0x3588ab[_0x7d6a('0x4a')](_0x372660);}})[_0x7d6a('0x22')](function(_0x54ef1c){if(_0x54ef1c){return _0x54ef1c?{'count':_0x51f3cc,'rows':_0x54ef1c}:null;}})[_0x7d6a('0x22')](respondWithResult(_0x5a8160,null))[_0x7d6a('0x3c')](handleError(_0x5a8160,null));};exports['getTags']=function(_0x57041e,_0x4a182d,_0x318b91){var _0x510c1d={};var _0x3b6b6a={};var _0x3c633f;var _0xd99321;return db[_0x7d6a('0x38')][_0x7d6a('0x48')]({'where':{'id':_0x57041e[_0x7d6a('0x3e')]['id']}})['then'](handleEntityNotFound(_0x4a182d,null))['then'](function(_0x4b0f1b){if(_0x4b0f1b){_0x3c633f=_0x4b0f1b;_0x3b6b6a[_0x7d6a('0x29')]=_[_0x7d6a('0x3f')](db[_0x7d6a('0x4c')][_0x7d6a('0x46')]);_0x3b6b6a[_0x7d6a('0x2a')]=_['keys'](_0x57041e[_0x7d6a('0x2a')]);_0x3b6b6a[_0x7d6a('0x31')]=_[_0x7d6a('0x2b')](_0x3b6b6a[_0x7d6a('0x29')],_0x3b6b6a['query']);_0x510c1d[_0x7d6a('0x2d')]=_[_0x7d6a('0x2b')](_0x3b6b6a[_0x7d6a('0x29')],qs['fields'](_0x57041e[_0x7d6a('0x2a')][_0x7d6a('0x2c')]));_0x510c1d[_0x7d6a('0x2d')]=_0x510c1d[_0x7d6a('0x2d')][_0x7d6a('0x2e')]?_0x510c1d[_0x7d6a('0x2d')]:_0x3b6b6a[_0x7d6a('0x29')];_0x510c1d[_0x7d6a('0x47')]=qs[_0x7d6a('0x30')](_0x57041e[_0x7d6a('0x2a')][_0x7d6a('0x30')]);_0x510c1d[_0x7d6a('0x34')]=qs[_0x7d6a('0x31')](_[_0x7d6a('0x32')](_0x57041e[_0x7d6a('0x2a')],_0x3b6b6a[_0x7d6a('0x31')]));if(_0x57041e[_0x7d6a('0x2a')][_0x7d6a('0x33')]){_0x510c1d[_0x7d6a('0x34')]=_[_0x7d6a('0x35')](_0x510c1d[_0x7d6a('0x34')],{'$or':_[_0x7d6a('0x27')](_0x510c1d[_0x7d6a('0x2d')],function(_0x501d36){var _0x330f74={};_0x330f74[_0x501d36]={'$like':'%'+_0x57041e[_0x7d6a('0x2a')][_0x7d6a('0x33')]+'%'};return _0x330f74;})});}_0x510c1d=_[_0x7d6a('0x35')]({},_0x510c1d,_0x57041e[_0x7d6a('0x37')]);return _0x3c633f[_0x7d6a('0x4d')](_0x510c1d);}})[_0x7d6a('0x22')](function(_0x287a39){if(_0x287a39){_0xd99321=_0x287a39[_0x7d6a('0x2e')];if(!_0x57041e[_0x7d6a('0x2a')][_0x7d6a('0x4b')](_0x7d6a('0x2f'))){_0x510c1d['limit']=qs[_0x7d6a('0x19')](_0x57041e[_0x7d6a('0x2a')][_0x7d6a('0x19')]);_0x510c1d[_0x7d6a('0x1b')]=qs['offset'](_0x57041e[_0x7d6a('0x2a')][_0x7d6a('0x1b')]);}return _0x3c633f['getTags'](_0x510c1d);}})['then'](function(_0x2f24dc){if(_0x2f24dc){return _0x2f24dc?{'count':_0xd99321,'rows':_0x2f24dc}:null;}})[_0x7d6a('0x22')](respondWithResult(_0x4a182d,null))[_0x7d6a('0x3c')](handleError(_0x4a182d,null));};exports[_0x7d6a('0x4e')]=function(_0x3796a5,_0xc3bc4,_0x31eb74){if(_0x3796a5[_0x7d6a('0x43')]['id']){delete _0x3796a5[_0x7d6a('0x43')]['id'];}return db[_0x7d6a('0x38')][_0x7d6a('0x48')]({'where':{'id':_0x3796a5[_0x7d6a('0x3e')]['id']}})[_0x7d6a('0x22')](handleEntityNotFound(_0xc3bc4,null))[_0x7d6a('0x22')](function(_0x2e8823){if(_0x2e8823){return _0x2e8823['setTags'](_0x3796a5[_0x7d6a('0x43')][_0x7d6a('0x4f')]||[]);}return null;})[_0x7d6a('0x22')](respondWithResult(_0xc3bc4,null))['catch'](handleError(_0xc3bc4,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index f942734..3e3a134 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 _0x5203=['bluebird','request-promise','rimraf','./intFreshdeskConfiguration.attributes','exports','define','int_freshdesk_configurations','lodash','util','../../config/logger','api'];(function(_0x2cde0a,_0x1f9695){var _0x260610=function(_0x179089){while(--_0x179089){_0x2cde0a['push'](_0x2cde0a['shift']());}};_0x260610(++_0x1f9695);}(_0x5203,0x1bf));var _0x3520=function(_0xca1c04,_0x3fc3ef){_0xca1c04=_0xca1c04-0x0;var _0x3e1c1d=_0x5203[_0xca1c04];return _0x3e1c1d;};'use strict';var _=require(_0x3520('0x0'));var util=require(_0x3520('0x1'));var logger=require(_0x3520('0x2'))(_0x3520('0x3'));var moment=require('moment');var BPromise=require(_0x3520('0x4'));var rp=require(_0x3520('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3520('0x6'));var config=require('../../config/environment');var attributes=require(_0x3520('0x7'));module[_0x3520('0x8')]=function(_0x5e7762,_0x3504db){return _0x5e7762[_0x3520('0x9')]('FreshdeskConfiguration',attributes,{'tableName':_0x3520('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6159=['./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','lodash','../../config/logger','api','request-promise','rimraf'];(function(_0x19ec4f,_0x3aeceb){var _0x1ff0e5=function(_0xb7d9bc){while(--_0xb7d9bc){_0x19ec4f['push'](_0x19ec4f['shift']());}};_0x1ff0e5(++_0x3aeceb);}(_0x6159,0x1b4));var _0x9615=function(_0x203eee,_0x3ccb7e){_0x203eee=_0x203eee-0x0;var _0x43d204=_0x6159[_0x203eee];return _0x43d204;};'use strict';var _=require(_0x9615('0x0'));var util=require('util');var logger=require(_0x9615('0x1'))(_0x9615('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9615('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9615('0x4'));var config=require('../../config/environment');var attributes=require(_0x9615('0x5'));module[_0x9615('0x6')]=function(_0x1a97db,_0x970d14){return _0x1a97db[_0x9615('0x7')](_0x9615('0x8'),attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index a3c7326..d9b0f6f 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 _0xf0a9=['FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x5d80de,_0x2cf15d){var _0x1c7556=function(_0x5bd806){while(--_0x5bd806){_0x5d80de['push'](_0x5d80de['shift']());}};_0x1c7556(++_0x2cf15d);}(_0xf0a9,0x12f));var _0x9f0a=function(_0x58a5a7,_0x14737c){_0x58a5a7=_0x58a5a7-0x0;var _0x192e57=_0xf0a9[_0x58a5a7];return _0x192e57;};'use strict';var _=require(_0x9f0a('0x0'));var util=require(_0x9f0a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9f0a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9f0a('0x3'))['db'];var utils=require(_0x9f0a('0x4'));var logger=require(_0x9f0a('0x5'))(_0x9f0a('0x6'));var config=require(_0x9f0a('0x7'));var jayson=require(_0x9f0a('0x8'));var client=jayson['client'][_0x9f0a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x439b3a,_0x5e33b7,_0x9af5aa){return new BPromise(function(_0x2fce4f,_0x158259){return client[_0x9f0a('0xa')](_0x439b3a,_0x9af5aa)[_0x9f0a('0xb')](function(_0x5f3a19){logger['info'](_0x9f0a('0xc'),_0x5e33b7,_0x9f0a('0xd'));logger[_0x9f0a('0xe')](_0x9f0a('0xf'),_0x5e33b7,_0x9f0a('0xd'),JSON['stringify'](_0x5f3a19));if(_0x5f3a19[_0x9f0a('0x10')]){if(_0x5f3a19[_0x9f0a('0x10')][_0x9f0a('0x11')]===0x1f4){logger[_0x9f0a('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x5e33b7,_0x5f3a19[_0x9f0a('0x10')][_0x9f0a('0x12')]);return _0x158259(_0x5f3a19[_0x9f0a('0x10')]['message']);}logger[_0x9f0a('0x10')](_0x9f0a('0xc'),_0x5e33b7,_0x5f3a19[_0x9f0a('0x10')]['message']);return _0x2fce4f(_0x5f3a19[_0x9f0a('0x10')][_0x9f0a('0x12')]);}else{logger[_0x9f0a('0x13')](_0x9f0a('0xc'),_0x5e33b7,_0x9f0a('0xd'));_0x2fce4f(_0x5f3a19['result']['message']);}})[_0x9f0a('0x14')](function(_0x3404ec){logger[_0x9f0a('0x10')](_0x9f0a('0xc'),_0x5e33b7,_0x3404ec);_0x158259(_0x3404ec);});});} \ No newline at end of file +var _0x2d50=['http','request','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client'];(function(_0x204ba9,_0x316a49){var _0x2b344c=function(_0x5bb243){while(--_0x5bb243){_0x204ba9['push'](_0x204ba9['shift']());}};_0x2b344c(++_0x316a49);}(_0x2d50,0x175));var _0x02d5=function(_0x50a19c,_0x4e761d){_0x50a19c=_0x50a19c-0x0;var _0x241e5a=_0x2d50[_0x50a19c];return _0x241e5a;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x02d5('0x0'));var rs=require(_0x02d5('0x1'));var fs=require('fs');var Redis=require(_0x02d5('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x02d5('0x3'));var logger=require('../../config/logger')(_0x02d5('0x4'));var config=require(_0x02d5('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x02d5('0x6')][_0x02d5('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xe80c4,_0x4d434e,_0x4ed133){return new BPromise(function(_0x11ae4c,_0x21fc7d){return client[_0x02d5('0x8')](_0xe80c4,_0x4ed133)['then'](function(_0x21453b){logger[_0x02d5('0x9')](_0x02d5('0xa'),_0x4d434e,_0x02d5('0xb'));logger[_0x02d5('0xc')](_0x02d5('0xd'),_0x4d434e,_0x02d5('0xb'),JSON['stringify'](_0x21453b));if(_0x21453b[_0x02d5('0xe')]){if(_0x21453b[_0x02d5('0xe')][_0x02d5('0xf')]===0x1f4){logger[_0x02d5('0xe')](_0x02d5('0xa'),_0x4d434e,_0x21453b[_0x02d5('0xe')]['message']);return _0x21fc7d(_0x21453b[_0x02d5('0xe')][_0x02d5('0x10')]);}logger[_0x02d5('0xe')](_0x02d5('0xa'),_0x4d434e,_0x21453b[_0x02d5('0xe')][_0x02d5('0x10')]);return _0x11ae4c(_0x21453b[_0x02d5('0xe')][_0x02d5('0x10')]);}else{logger[_0x02d5('0x9')](_0x02d5('0xa'),_0x4d434e,_0x02d5('0xb'));_0x11ae4c(_0x21453b[_0x02d5('0x11')][_0x02d5('0x10')]);}})[_0x02d5('0x12')](function(_0x45be9d){logger[_0x02d5('0xe')](_0x02d5('0xa'),_0x4d434e,_0x45be9d);_0x21fc7d(_0x45be9d);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 1b282d9..fc40471 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 _0x60a7=['connect-timeout','express','../../components/auth/service','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','show','post','create','put','multer','util','path'];(function(_0x4cbbf2,_0x238937){var _0x4ddecd=function(_0x4a7350){while(--_0x4a7350){_0x4cbbf2['push'](_0x4cbbf2['shift']());}};_0x4ddecd(++_0x238937);}(_0x60a7,0x1b0));var _0x760a=function(_0x3e272d,_0x57ed80){_0x3e272d=_0x3e272d-0x0;var _0x34ad38=_0x60a7[_0x3e272d];return _0x34ad38;};'use strict';var multer=require(_0x760a('0x0'));var util=require(_0x760a('0x1'));var path=require(_0x760a('0x2'));var timeout=require(_0x760a('0x3'));var express=require(_0x760a('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x760a('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x760a('0x6'));router[_0x760a('0x7')]('/',auth[_0x760a('0x8')](),controller[_0x760a('0x9')]);router[_0x760a('0x7')](_0x760a('0xa'),auth[_0x760a('0x8')](),controller[_0x760a('0xb')]);router[_0x760a('0xc')]('/',auth[_0x760a('0x8')](),controller[_0x760a('0xd')]);router[_0x760a('0xe')](_0x760a('0xa'),auth[_0x760a('0x8')](),controller['update']);router['delete'](_0x760a('0xa'),auth[_0x760a('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xca08=['isAuthenticated','index','get','/:id','show','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./intFreshdeskField.controller'];(function(_0x5b43e1,_0x321e9e){var _0x477523=function(_0x5e152c){while(--_0x5e152c){_0x5b43e1['push'](_0x5b43e1['shift']());}};_0x477523(++_0x321e9e);}(_0xca08,0x1cd));var _0x8ca0=function(_0xd7f799,_0x749051){_0xd7f799=_0xd7f799-0x0;var _0x587c44=_0xca08[_0xd7f799];return _0x587c44;};'use strict';var multer=require('multer');var util=require(_0x8ca0('0x0'));var path=require(_0x8ca0('0x1'));var timeout=require(_0x8ca0('0x2'));var express=require('express');var router=express[_0x8ca0('0x3')]();var fs_extra=require(_0x8ca0('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8ca0('0x5'));var config=require('../../config/environment');var controller=require(_0x8ca0('0x6'));router['get']('/',auth[_0x8ca0('0x7')](),controller[_0x8ca0('0x8')]);router[_0x8ca0('0x9')](_0x8ca0('0xa'),auth['isAuthenticated'](),controller[_0x8ca0('0xb')]);router['post']('/',auth[_0x8ca0('0x7')](),controller[_0x8ca0('0xc')]);router[_0x8ca0('0xd')]('/:id',auth[_0x8ca0('0x7')](),controller[_0x8ca0('0xe')]);router[_0x8ca0('0xf')](_0x8ca0('0xa'),auth[_0x8ca0('0x7')](),controller[_0x8ca0('0x10')]);module[_0x8ca0('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 728d8b4..e375e54 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 _0xad12=['STRING','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x94f205,_0x519e2e){var _0x2755d7=function(_0x4e1a44){while(--_0x4e1a44){_0x94f205['push'](_0x94f205['shift']());}};_0x2755d7(++_0x519e2e);}(_0xad12,0x119));var _0x2ad1=function(_0x2c47b6,_0x550f52){_0x2c47b6=_0x2c47b6-0x0;var _0x40a5e3=_0xad12[_0x2c47b6];return _0x40a5e3;};'use strict';var Sequelize=require('sequelize');module[_0x2ad1('0x0')]={'type':{'type':Sequelize[_0x2ad1('0x1')](_0x2ad1('0x2'),_0x2ad1('0x3'),_0x2ad1('0x4'),_0x2ad1('0x5'),'picklist'),'defaultValue':_0x2ad1('0x2')},'content':{'type':Sequelize[_0x2ad1('0x6')]},'key':{'type':Sequelize[_0x2ad1('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x2ad1('0x2'),_0x2ad1('0x3'),_0x2ad1('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x2ad1('0x6')]},'nameField':{'type':Sequelize[_0x2ad1('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2ad1('0x6')]}}; \ No newline at end of file +var _0xb7f6=['BOOLEAN','exports','ENUM','string','customVariable','keyValue','STRING','variable'];(function(_0x1c5037,_0x52e4d0){var _0x1e6ead=function(_0x24ed26){while(--_0x24ed26){_0x1c5037['push'](_0x1c5037['shift']());}};_0x1e6ead(++_0x52e4d0);}(_0xb7f6,0x189));var _0x6b7f=function(_0x5f89bf,_0x53ded0){_0x5f89bf=_0x5f89bf-0x0;var _0x2ee34f=_0xb7f6[_0x5f89bf];return _0x2ee34f;};'use strict';var Sequelize=require('sequelize');module[_0x6b7f('0x0')]={'type':{'type':Sequelize[_0x6b7f('0x1')](_0x6b7f('0x2'),'variable',_0x6b7f('0x3'),_0x6b7f('0x4'),'picklist'),'defaultValue':_0x6b7f('0x2')},'content':{'type':Sequelize[_0x6b7f('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x6b7f('0x1')](_0x6b7f('0x2'),_0x6b7f('0x6'),_0x6b7f('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x6b7f('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x6b7f('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6b7f('0x5')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 9909bdc..aa1377f 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 _0x7d98=['pick','filter','merge','where','include','FreshdeskField','findAll','rows','show','rawAttributes','create','body','catch','find','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','reject','save','update','then','destroy','error','name','send','fieldName','key','map','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x1151fa,_0x2784a7){var _0x49da2b=function(_0x2d33ca){while(--_0x2d33ca){_0x1151fa['push'](_0x1151fa['shift']());}};_0x49da2b(++_0x2784a7);}(_0x7d98,0xe7));var _0x87d9=function(_0x4179e2,_0xf2dbb){_0x4179e2=_0x4179e2-0x0;var _0x24cb50=_0x7d98[_0x4179e2];return _0x24cb50;};'use strict';var emlformat=require(_0x87d9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x87d9('0x1'));var jsonpatch=require(_0x87d9('0x2'));var rp=require(_0x87d9('0x3'));var moment=require(_0x87d9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x87d9('0x5'));var util=require(_0x87d9('0x6'));var path=require('path');var sox=require(_0x87d9('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x87d9('0x8'));var squel=require(_0x87d9('0x9'));var crypto=require(_0x87d9('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x87d9('0xb'));var toCsv=require(_0x87d9('0xc'));var querystring=require(_0x87d9('0xd'));var Papa=require('papaparse');var Redis=require(_0x87d9('0xe'));var authService=require(_0x87d9('0xf'));var qs=require(_0x87d9('0x10'));var as=require(_0x87d9('0x11'));var hardwareService=require(_0x87d9('0x12'));var logger=require(_0x87d9('0x13'))(_0x87d9('0x14'));var utils=require(_0x87d9('0x15'));var config=require(_0x87d9('0x16'));var licenseUtil=require(_0x87d9('0x17'));var db=require(_0x87d9('0x18'))['db'];function respondWithStatusCode(_0x22f32d,_0x38f33e){_0x38f33e=_0x38f33e||0xcc;return function(_0x22758){if(_0x22758){return _0x22f32d[_0x87d9('0x19')](_0x38f33e);}return _0x22f32d[_0x87d9('0x1a')](_0x38f33e)[_0x87d9('0x1b')]();};}function respondWithResult(_0x185401,_0x380836){_0x380836=_0x380836||0xc8;return function(_0x27d61d){if(_0x27d61d){return _0x185401['status'](_0x380836)['json'](_0x27d61d);}};}function respondWithFilteredResult(_0x9e9e53,_0xaa910c){return function(_0x3231e7){if(_0x3231e7){var _0x501d32=typeof _0xaa910c['offset']===_0x87d9('0x1c')&&typeof _0xaa910c[_0x87d9('0x1d')]===_0x87d9('0x1c');var _0x23ae47=_0x3231e7[_0x87d9('0x1e')];var _0xebc1eb=_0x501d32?0x0:_0xaa910c[_0x87d9('0x1f')];var _0x1f33a3=_0x501d32?_0x3231e7[_0x87d9('0x1e')]:_0xaa910c[_0x87d9('0x1f')]+_0xaa910c[_0x87d9('0x1d')];var _0x5d6da1;if(_0x1f33a3>=_0x23ae47){_0x1f33a3=_0x23ae47;_0x5d6da1=0xc8;}else{_0x5d6da1=0xce;}_0x9e9e53[_0x87d9('0x1a')](_0x5d6da1);return _0x9e9e53['set'](_0x87d9('0x20'),_0xebc1eb+'-'+_0x1f33a3+'/'+_0x23ae47)[_0x87d9('0x21')](_0x3231e7);}return null;};}function patchUpdates(_0x334d31){return function(_0x57bef6){try{jsonpatch['apply'](_0x57bef6,_0x334d31,!![]);}catch(_0x545241){return BPromise[_0x87d9('0x22')](_0x545241);}return _0x57bef6[_0x87d9('0x23')]();};}function saveUpdates(_0x28aaaa,_0x6ab839){return function(_0xc82b02){if(_0xc82b02){return _0xc82b02[_0x87d9('0x24')](_0x28aaaa)[_0x87d9('0x25')](function(_0x3b24e7){return _0x3b24e7;});}return null;};}function removeEntity(_0x1c550c,_0x4c0f7a){return function(_0x31e1b2){if(_0x31e1b2){return _0x31e1b2[_0x87d9('0x26')]()[_0x87d9('0x25')](function(){_0x1c550c[_0x87d9('0x1a')](0xcc)[_0x87d9('0x1b')]();});}};}function handleEntityNotFound(_0x340462,_0x3641c8){return function(_0x32b83f){if(!_0x32b83f){_0x340462['sendStatus'](0x194);}return _0x32b83f;};}function handleError(_0x8b1ab7,_0x600404){_0x600404=_0x600404||0x1f4;return function(_0x2f63fa){logger[_0x87d9('0x27')](_0x2f63fa['stack']);if(_0x2f63fa[_0x87d9('0x28')]){delete _0x2f63fa[_0x87d9('0x28')];}_0x8b1ab7[_0x87d9('0x1a')](_0x600404)[_0x87d9('0x29')](_0x2f63fa);};}exports['index']=function(_0x21916a,_0x3c0283){var _0x501c5={},_0x5e1b55={},_0x1d04a9={'count':0x0,'rows':[]};var _0x22a401=_['map'](db['FreshdeskField']['rawAttributes'],function(_0x31122b){return{'name':_0x31122b[_0x87d9('0x2a')],'type':_0x31122b['type'][_0x87d9('0x2b')]};});_0x5e1b55['model']=_[_0x87d9('0x2c')](_0x22a401,'name');_0x5e1b55[_0x87d9('0x2d')]=_[_0x87d9('0x2e')](_0x21916a['query']);_0x5e1b55[_0x87d9('0x2f')]=_['intersection'](_0x5e1b55[_0x87d9('0x30')],_0x5e1b55[_0x87d9('0x2d')]);_0x501c5[_0x87d9('0x31')]=_[_0x87d9('0x32')](_0x5e1b55[_0x87d9('0x30')],qs[_0x87d9('0x33')](_0x21916a['query'][_0x87d9('0x33')]));_0x501c5[_0x87d9('0x31')]=_0x501c5[_0x87d9('0x31')][_0x87d9('0x34')]?_0x501c5[_0x87d9('0x31')]:_0x5e1b55[_0x87d9('0x30')];if(!_0x21916a[_0x87d9('0x2d')][_0x87d9('0x35')](_0x87d9('0x36'))){_0x501c5['limit']=qs[_0x87d9('0x1d')](_0x21916a[_0x87d9('0x2d')][_0x87d9('0x1d')]);_0x501c5[_0x87d9('0x1f')]=qs[_0x87d9('0x1f')](_0x21916a['query'][_0x87d9('0x1f')]);}_0x501c5[_0x87d9('0x37')]=qs[_0x87d9('0x38')](_0x21916a['query'][_0x87d9('0x38')]);_0x501c5['where']=qs[_0x87d9('0x2f')](_[_0x87d9('0x39')](_0x21916a[_0x87d9('0x2d')],_0x5e1b55[_0x87d9('0x2f')]),_0x22a401);if(_0x21916a['query'][_0x87d9('0x3a')]){_0x501c5['where']=_[_0x87d9('0x3b')](_0x501c5[_0x87d9('0x3c')],{'$or':_[_0x87d9('0x2c')](_0x22a401,function(_0x1af8eb){if(_0x1af8eb['type']!=='VIRTUAL'){var _0x2063de={};_0x2063de[_0x1af8eb['name']]={'$like':'%'+_0x21916a[_0x87d9('0x2d')]['filter']+'%'};return _0x2063de;}})});}_0x501c5=_[_0x87d9('0x3b')]({},_0x501c5,_0x21916a['options']);var _0xdf56e8={'where':_0x501c5[_0x87d9('0x3c')]};return db['FreshdeskField'][_0x87d9('0x1e')](_0xdf56e8)['then'](function(_0x4bc1ba){_0x1d04a9['count']=_0x4bc1ba;if(_0x21916a[_0x87d9('0x2d')]['includeAll']){_0x501c5[_0x87d9('0x3d')]=[{'all':!![]}];}return db[_0x87d9('0x3e')][_0x87d9('0x3f')](_0x501c5);})['then'](function(_0x915f05){_0x1d04a9[_0x87d9('0x40')]=_0x915f05;return _0x1d04a9;})[_0x87d9('0x25')](respondWithFilteredResult(_0x3c0283,_0x501c5))['catch'](handleError(_0x3c0283,null));};exports[_0x87d9('0x41')]=function(_0x58ec85,_0x5c2db5){var _0x59338e={'raw':!![],'where':{'id':_0x58ec85['params']['id']}},_0x39e807={};_0x39e807['model']=_[_0x87d9('0x2e')](db[_0x87d9('0x3e')][_0x87d9('0x42')]);_0x39e807[_0x87d9('0x2d')]=_[_0x87d9('0x2e')](_0x58ec85['query']);_0x39e807[_0x87d9('0x2f')]=_[_0x87d9('0x32')](_0x39e807['model'],_0x39e807['query']);_0x59338e[_0x87d9('0x31')]=_[_0x87d9('0x32')](_0x39e807[_0x87d9('0x30')],qs[_0x87d9('0x33')](_0x58ec85[_0x87d9('0x2d')][_0x87d9('0x33')]));_0x59338e[_0x87d9('0x31')]=_0x59338e[_0x87d9('0x31')]['length']?_0x59338e[_0x87d9('0x31')]:_0x39e807[_0x87d9('0x30')];if(_0x58ec85['query']['includeAll']){_0x59338e[_0x87d9('0x3d')]=[{'all':!![]}];}_0x59338e=_[_0x87d9('0x3b')]({},_0x59338e,_0x58ec85['options']);return db[_0x87d9('0x3e')]['find'](_0x59338e)['then'](handleEntityNotFound(_0x5c2db5,null))['then'](respondWithResult(_0x5c2db5,null))['catch'](handleError(_0x5c2db5,null));};exports[_0x87d9('0x43')]=function(_0x101446,_0x533a74){return db[_0x87d9('0x3e')][_0x87d9('0x43')](_0x101446[_0x87d9('0x44')],{})['then'](respondWithResult(_0x533a74,0xc9))[_0x87d9('0x45')](handleError(_0x533a74,null));};exports[_0x87d9('0x24')]=function(_0x2d4766,_0x384273){if(_0x2d4766[_0x87d9('0x44')]['id']){delete _0x2d4766[_0x87d9('0x44')]['id'];}return db['FreshdeskField'][_0x87d9('0x46')]({'where':{'id':_0x2d4766['params']['id']}})['then'](handleEntityNotFound(_0x384273,null))[_0x87d9('0x25')](saveUpdates(_0x2d4766[_0x87d9('0x44')],null))[_0x87d9('0x25')](respondWithResult(_0x384273,null))[_0x87d9('0x45')](handleError(_0x384273,null));};exports[_0x87d9('0x26')]=function(_0x4fdfa9,_0x4558f5){return db[_0x87d9('0x3e')][_0x87d9('0x46')]({'where':{'id':_0x4fdfa9[_0x87d9('0x47')]['id']}})['then'](handleEntityNotFound(_0x4558f5,null))[_0x87d9('0x25')](removeEntity(_0x4558f5,null))[_0x87d9('0x45')](handleError(_0x4558f5,null));}; \ No newline at end of file +var _0x574d=['reject','save','update','then','destroy','error','name','send','map','FreshdeskField','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','filter','findAll','catch','show','params','includeAll','include','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply'];(function(_0x390c54,_0x153f28){var _0x503fdc=function(_0xc46425){while(--_0xc46425){_0x390c54['push'](_0x390c54['shift']());}};_0x503fdc(++_0x153f28);}(_0x574d,0xc0));var _0xd574=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0x574d[_0x342baa];return _0x1208f3;};'use strict';var emlformat=require(_0xd574('0x0'));var rimraf=require(_0xd574('0x1'));var zipdir=require(_0xd574('0x2'));var jsonpatch=require(_0xd574('0x3'));var rp=require(_0xd574('0x4'));var moment=require(_0xd574('0x5'));var BPromise=require(_0xd574('0x6'));var Mustache=require('mustache');var util=require(_0xd574('0x7'));var path=require(_0xd574('0x8'));var sox=require(_0xd574('0x9'));var csv=require(_0xd574('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd574('0xb'));var _=require(_0xd574('0xc'));var squel=require(_0xd574('0xd'));var crypto=require(_0xd574('0xe'));var jsforce=require(_0xd574('0xf'));var deskjs=require(_0xd574('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd574('0x11'));var Redis=require(_0xd574('0x12'));var authService=require(_0xd574('0x13'));var qs=require(_0xd574('0x14'));var as=require(_0xd574('0x15'));var hardwareService=require(_0xd574('0x16'));var logger=require(_0xd574('0x17'))('api');var utils=require(_0xd574('0x18'));var config=require(_0xd574('0x19'));var licenseUtil=require(_0xd574('0x1a'));var db=require(_0xd574('0x1b'))['db'];function respondWithStatusCode(_0x1ddedb,_0x6c93de){_0x6c93de=_0x6c93de||0xcc;return function(_0x8dd760){if(_0x8dd760){return _0x1ddedb[_0xd574('0x1c')](_0x6c93de);}return _0x1ddedb[_0xd574('0x1d')](_0x6c93de)[_0xd574('0x1e')]();};}function respondWithResult(_0x43e251,_0x2cc660){_0x2cc660=_0x2cc660||0xc8;return function(_0x564b36){if(_0x564b36){return _0x43e251[_0xd574('0x1d')](_0x2cc660)[_0xd574('0x1f')](_0x564b36);}};}function respondWithFilteredResult(_0x2d66be,_0x1537f4){return function(_0x46fb4c){if(_0x46fb4c){var _0x341463=typeof _0x1537f4[_0xd574('0x20')]===_0xd574('0x21')&&typeof _0x1537f4['limit']==='undefined';var _0x1486c7=_0x46fb4c[_0xd574('0x22')];var _0x2ac01d=_0x341463?0x0:_0x1537f4['offset'];var _0x58a74b=_0x341463?_0x46fb4c[_0xd574('0x22')]:_0x1537f4[_0xd574('0x20')]+_0x1537f4[_0xd574('0x23')];var _0x46e331;if(_0x58a74b>=_0x1486c7){_0x58a74b=_0x1486c7;_0x46e331=0xc8;}else{_0x46e331=0xce;}_0x2d66be[_0xd574('0x1d')](_0x46e331);return _0x2d66be[_0xd574('0x24')](_0xd574('0x25'),_0x2ac01d+'-'+_0x58a74b+'/'+_0x1486c7)[_0xd574('0x1f')](_0x46fb4c);}return null;};}function patchUpdates(_0xefe45f){return function(_0x9f980d){try{jsonpatch[_0xd574('0x26')](_0x9f980d,_0xefe45f,!![]);}catch(_0x587f62){return BPromise[_0xd574('0x27')](_0x587f62);}return _0x9f980d[_0xd574('0x28')]();};}function saveUpdates(_0x481564,_0x39c39d){return function(_0x5e5b9f){if(_0x5e5b9f){return _0x5e5b9f[_0xd574('0x29')](_0x481564)[_0xd574('0x2a')](function(_0x199756){return _0x199756;});}return null;};}function removeEntity(_0x3f85cf,_0x1aec00){return function(_0x72d2b8){if(_0x72d2b8){return _0x72d2b8[_0xd574('0x2b')]()[_0xd574('0x2a')](function(){_0x3f85cf[_0xd574('0x1d')](0xcc)[_0xd574('0x1e')]();});}};}function handleEntityNotFound(_0x1fbd81,_0x44ddae){return function(_0x3e0501){if(!_0x3e0501){_0x1fbd81[_0xd574('0x1c')](0x194);}return _0x3e0501;};}function handleError(_0x5f1456,_0x441f13){_0x441f13=_0x441f13||0x1f4;return function(_0x53142f){logger[_0xd574('0x2c')](_0x53142f['stack']);if(_0x53142f['name']){delete _0x53142f[_0xd574('0x2d')];}_0x5f1456[_0xd574('0x1d')](_0x441f13)[_0xd574('0x2e')](_0x53142f);};}exports['index']=function(_0x2a8e86,_0x30e49e){var _0x8eefda={},_0x9761f5={},_0x508eaa={'count':0x0,'rows':[]};var _0x5298d7=_[_0xd574('0x2f')](db[_0xd574('0x30')][_0xd574('0x31')],function(_0x23a495){return{'name':_0x23a495[_0xd574('0x32')],'type':_0x23a495[_0xd574('0x33')]['key']};});_0x9761f5['model']=_[_0xd574('0x2f')](_0x5298d7,_0xd574('0x2d'));_0x9761f5[_0xd574('0x34')]=_[_0xd574('0x35')](_0x2a8e86[_0xd574('0x34')]);_0x9761f5[_0xd574('0x36')]=_[_0xd574('0x37')](_0x9761f5[_0xd574('0x38')],_0x9761f5['query']);_0x8eefda['attributes']=_[_0xd574('0x37')](_0x9761f5[_0xd574('0x38')],qs[_0xd574('0x39')](_0x2a8e86[_0xd574('0x34')][_0xd574('0x39')]));_0x8eefda['attributes']=_0x8eefda[_0xd574('0x3a')][_0xd574('0x3b')]?_0x8eefda[_0xd574('0x3a')]:_0x9761f5[_0xd574('0x38')];if(!_0x2a8e86[_0xd574('0x34')][_0xd574('0x3c')](_0xd574('0x3d'))){_0x8eefda['limit']=qs[_0xd574('0x23')](_0x2a8e86['query'][_0xd574('0x23')]);_0x8eefda[_0xd574('0x20')]=qs[_0xd574('0x20')](_0x2a8e86[_0xd574('0x34')][_0xd574('0x20')]);}_0x8eefda[_0xd574('0x3e')]=qs[_0xd574('0x3f')](_0x2a8e86[_0xd574('0x34')][_0xd574('0x3f')]);_0x8eefda[_0xd574('0x40')]=qs[_0xd574('0x36')](_['pick'](_0x2a8e86[_0xd574('0x34')],_0x9761f5[_0xd574('0x36')]),_0x5298d7);if(_0x2a8e86[_0xd574('0x34')]['filter']){_0x8eefda[_0xd574('0x40')]=_[_0xd574('0x41')](_0x8eefda[_0xd574('0x40')],{'$or':_[_0xd574('0x2f')](_0x5298d7,function(_0x15d429){if(_0x15d429[_0xd574('0x33')]!=='VIRTUAL'){var _0x1dbeb9={};_0x1dbeb9[_0x15d429[_0xd574('0x2d')]]={'$like':'%'+_0x2a8e86[_0xd574('0x34')][_0xd574('0x42')]+'%'};return _0x1dbeb9;}})});}_0x8eefda=_[_0xd574('0x41')]({},_0x8eefda,_0x2a8e86['options']);var _0x3f79c4={'where':_0x8eefda[_0xd574('0x40')]};return db[_0xd574('0x30')]['count'](_0x3f79c4)['then'](function(_0x4a0e67){_0x508eaa[_0xd574('0x22')]=_0x4a0e67;if(_0x2a8e86['query']['includeAll']){_0x8eefda['include']=[{'all':!![]}];}return db[_0xd574('0x30')][_0xd574('0x43')](_0x8eefda);})[_0xd574('0x2a')](function(_0x20b570){_0x508eaa['rows']=_0x20b570;return _0x508eaa;})[_0xd574('0x2a')](respondWithFilteredResult(_0x30e49e,_0x8eefda))[_0xd574('0x44')](handleError(_0x30e49e,null));};exports[_0xd574('0x45')]=function(_0x411ecb,_0x4a580c){var _0x1bf7c5={'raw':!![],'where':{'id':_0x411ecb[_0xd574('0x46')]['id']}},_0x4caf06={};_0x4caf06[_0xd574('0x38')]=_[_0xd574('0x35')](db[_0xd574('0x30')][_0xd574('0x31')]);_0x4caf06[_0xd574('0x34')]=_[_0xd574('0x35')](_0x411ecb[_0xd574('0x34')]);_0x4caf06[_0xd574('0x36')]=_[_0xd574('0x37')](_0x4caf06[_0xd574('0x38')],_0x4caf06[_0xd574('0x34')]);_0x1bf7c5[_0xd574('0x3a')]=_['intersection'](_0x4caf06[_0xd574('0x38')],qs['fields'](_0x411ecb['query'][_0xd574('0x39')]));_0x1bf7c5[_0xd574('0x3a')]=_0x1bf7c5['attributes'][_0xd574('0x3b')]?_0x1bf7c5[_0xd574('0x3a')]:_0x4caf06[_0xd574('0x38')];if(_0x411ecb['query'][_0xd574('0x47')]){_0x1bf7c5[_0xd574('0x48')]=[{'all':!![]}];}_0x1bf7c5=_[_0xd574('0x41')]({},_0x1bf7c5,_0x411ecb[_0xd574('0x49')]);return db[_0xd574('0x30')][_0xd574('0x4a')](_0x1bf7c5)['then'](handleEntityNotFound(_0x4a580c,null))[_0xd574('0x2a')](respondWithResult(_0x4a580c,null))[_0xd574('0x44')](handleError(_0x4a580c,null));};exports[_0xd574('0x4b')]=function(_0x8c305c,_0x14d08b){return db[_0xd574('0x30')][_0xd574('0x4b')](_0x8c305c[_0xd574('0x4c')],{})[_0xd574('0x2a')](respondWithResult(_0x14d08b,0xc9))[_0xd574('0x44')](handleError(_0x14d08b,null));};exports[_0xd574('0x29')]=function(_0x3aa4e6,_0x1cad77){if(_0x3aa4e6[_0xd574('0x4c')]['id']){delete _0x3aa4e6[_0xd574('0x4c')]['id'];}return db[_0xd574('0x30')]['find']({'where':{'id':_0x3aa4e6[_0xd574('0x46')]['id']}})[_0xd574('0x2a')](handleEntityNotFound(_0x1cad77,null))['then'](saveUpdates(_0x3aa4e6[_0xd574('0x4c')],null))[_0xd574('0x2a')](respondWithResult(_0x1cad77,null))[_0xd574('0x44')](handleError(_0x1cad77,null));};exports[_0xd574('0x2b')]=function(_0x2fcf85,_0x1426fb){return db[_0xd574('0x30')][_0xd574('0x4a')]({'where':{'id':_0x2fcf85[_0xd574('0x46')]['id']}})[_0xd574('0x2a')](handleEntityNotFound(_0x1426fb,null))['then'](removeEntity(_0x1426fb,null))[_0xd574('0x44')](handleError(_0x1426fb,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 2cbb610..20d8e02 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 _0x1974=['moment','bluebird','path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','FieldId','../../config/logger'];(function(_0x225b4e,_0x179ee4){var _0x24237a=function(_0x4ac970){while(--_0x4ac970){_0x225b4e['push'](_0x225b4e['shift']());}};_0x24237a(++_0x179ee4);}(_0x1974,0x1d3));var _0x4197=function(_0x1aa3a6,_0xe1c058){_0x1aa3a6=_0x1aa3a6-0x0;var _0x126d84=_0x1974[_0x1aa3a6];return _0x126d84;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4197('0x0'))('api');var moment=require(_0x4197('0x1'));var BPromise=require(_0x4197('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4197('0x3'));var rimraf=require(_0x4197('0x4'));var config=require(_0x4197('0x5'));var attributes=require(_0x4197('0x6'));module[_0x4197('0x7')]=function(_0x43687d,_0x1b0404){return _0x43687d[_0x4197('0x8')](_0x4197('0x9'),attributes,{'tableName':_0x4197('0xa'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':['idField',_0x4197('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xaf43=['bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','FieldId','util','../../config/logger','api','moment'];(function(_0x3c7d23,_0x52a07c){var _0x551579=function(_0xd601c){while(--_0xd601c){_0x3c7d23['push'](_0x3c7d23['shift']());}};_0x551579(++_0x52a07c);}(_0xaf43,0x182));var _0x3af4=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xaf43[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var util=require(_0x3af4('0x0'));var logger=require(_0x3af4('0x1'))(_0x3af4('0x2'));var moment=require(_0x3af4('0x3'));var BPromise=require(_0x3af4('0x4'));var rp=require(_0x3af4('0x5'));var fs=require('fs');var path=require(_0x3af4('0x6'));var rimraf=require(_0x3af4('0x7'));var config=require(_0x3af4('0x8'));var attributes=require(_0x3af4('0x9'));module[_0x3af4('0xa')]=function(_0x47d8da,_0x199ee7){return _0x47d8da[_0x3af4('0xb')](_0x3af4('0xc'),attributes,{'tableName':_0x3af4('0xd'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':['idField',_0x3af4('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js index e8261ce..dfc55eb 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 _0xf8cf=['message','info','result','catch','util','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskField,\x20%s,\x20%s'];(function(_0x494aa6,_0x403818){var _0x4b1be6=function(_0x36ed7c){while(--_0x36ed7c){_0x494aa6['push'](_0x494aa6['shift']());}};_0x4b1be6(++_0x403818);}(_0xf8cf,0x17e));var _0xff8c=function(_0xbb24cf,_0x5042df){_0xbb24cf=_0xbb24cf-0x0;var _0x3187c0=_0xf8cf[_0xbb24cf];return _0x3187c0;};'use strict';var _=require('lodash');var util=require(_0xff8c('0x0'));var moment=require('moment');var BPromise=require(_0xff8c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xff8c('0x2'));var logger=require(_0xff8c('0x3'))(_0xff8c('0x4'));var config=require(_0xff8c('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xff8c('0x6')][_0xff8c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1d4585,_0x5217be,_0x1e74ef){return new BPromise(function(_0x58e13b,_0x24cb63){return client[_0xff8c('0x8')](_0x1d4585,_0x1e74ef)[_0xff8c('0x9')](function(_0x5b8b30){logger['info']('FreshdeskField,\x20%s,\x20%s',_0x5217be,_0xff8c('0xa'));logger[_0xff8c('0xb')](_0xff8c('0xc'),_0x5217be,_0xff8c('0xa'),JSON[_0xff8c('0xd')](_0x5b8b30));if(_0x5b8b30['error']){if(_0x5b8b30[_0xff8c('0xe')][_0xff8c('0xf')]===0x1f4){logger['error'](_0xff8c('0x10'),_0x5217be,_0x5b8b30['error'][_0xff8c('0x11')]);return _0x24cb63(_0x5b8b30[_0xff8c('0xe')][_0xff8c('0x11')]);}logger[_0xff8c('0xe')](_0xff8c('0x10'),_0x5217be,_0x5b8b30[_0xff8c('0xe')][_0xff8c('0x11')]);return _0x58e13b(_0x5b8b30[_0xff8c('0xe')][_0xff8c('0x11')]);}else{logger[_0xff8c('0x12')]('FreshdeskField,\x20%s,\x20%s',_0x5217be,'request\x20sent');_0x58e13b(_0x5b8b30[_0xff8c('0x13')][_0xff8c('0x11')]);}})[_0xff8c('0x14')](function(_0x2e92bc){logger['error'](_0xff8c('0x10'),_0x5217be,_0x2e92bc);_0x24cb63(_0x2e92bc);});});} \ No newline at end of file +var _0xd3c1=['error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2c7f80,_0x5da68e){var _0x413d06=function(_0x1aef9a){while(--_0x1aef9a){_0x2c7f80['push'](_0x2c7f80['shift']());}};_0x413d06(++_0x5da68e);}(_0xd3c1,0x6d));var _0x1d3c=function(_0x3e231b,_0x126ff3){_0x3e231b=_0x3e231b-0x0;var _0x867a46=_0xd3c1[_0x3e231b];return _0x867a46;};'use strict';var _=require(_0x1d3c('0x0'));var util=require(_0x1d3c('0x1'));var moment=require('moment');var BPromise=require(_0x1d3c('0x2'));var rs=require(_0x1d3c('0x3'));var fs=require('fs');var Redis=require(_0x1d3c('0x4'));var db=require(_0x1d3c('0x5'))['db'];var utils=require(_0x1d3c('0x6'));var logger=require(_0x1d3c('0x7'))(_0x1d3c('0x8'));var config=require(_0x1d3c('0x9'));var jayson=require(_0x1d3c('0xa'));var client=jayson[_0x1d3c('0xb')][_0x1d3c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36eea2,_0x3437e,_0x287b38){return new BPromise(function(_0x4afa89,_0xf5c25c){return client[_0x1d3c('0xd')](_0x36eea2,_0x287b38)[_0x1d3c('0xe')](function(_0x38207d){logger[_0x1d3c('0xf')](_0x1d3c('0x10'),_0x3437e,_0x1d3c('0x11'));logger[_0x1d3c('0x12')](_0x1d3c('0x13'),_0x3437e,_0x1d3c('0x11'),JSON[_0x1d3c('0x14')](_0x38207d));if(_0x38207d[_0x1d3c('0x15')]){if(_0x38207d['error'][_0x1d3c('0x16')]===0x1f4){logger['error']('FreshdeskField,\x20%s,\x20%s',_0x3437e,_0x38207d[_0x1d3c('0x15')][_0x1d3c('0x17')]);return _0xf5c25c(_0x38207d[_0x1d3c('0x15')][_0x1d3c('0x17')]);}logger['error'](_0x1d3c('0x10'),_0x3437e,_0x38207d[_0x1d3c('0x15')][_0x1d3c('0x17')]);return _0x4afa89(_0x38207d[_0x1d3c('0x15')]['message']);}else{logger['info'](_0x1d3c('0x10'),_0x3437e,'request\x20sent');_0x4afa89(_0x38207d[_0x1d3c('0x18')][_0x1d3c('0x17')]);}})[_0x1d3c('0x19')](function(_0x15e0db){logger[_0x1d3c('0x15')]('FreshdeskField,\x20%s,\x20%s',_0x3437e,_0x15e0db);_0xf5c25c(_0x15e0db);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index ed191f5..03843c3 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 _0x6b20=['destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','addConfiguration','put','update','delete'];(function(_0x545fe3,_0x3b191f){var _0x480702=function(_0x21c970){while(--_0x21c970){_0x545fe3['push'](_0x545fe3['shift']());}};_0x480702(++_0x3b191f);}(_0x6b20,0xd1));var _0x06b2=function(_0x40a32d,_0x1a8012){_0x40a32d=_0x40a32d-0x0;var _0x39d2e6=_0x6b20[_0x40a32d];return _0x39d2e6;};'use strict';var multer=require(_0x06b2('0x0'));var util=require(_0x06b2('0x1'));var path=require('path');var timeout=require(_0x06b2('0x2'));var express=require('express');var router=express[_0x06b2('0x3')]();var fs_extra=require(_0x06b2('0x4'));var auth=require(_0x06b2('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x06b2('0x6'));var controller=require(_0x06b2('0x7'));router[_0x06b2('0x8')]('/',auth[_0x06b2('0x9')](),controller[_0x06b2('0xa')]);router[_0x06b2('0x8')](_0x06b2('0xb'),auth['isAuthenticated'](),controller[_0x06b2('0xc')]);router[_0x06b2('0x8')](_0x06b2('0xd'),auth['isAuthenticated'](),controller[_0x06b2('0xe')]);router['get'](_0x06b2('0xf'),auth['isAuthenticated'](),controller['getFields']);router[_0x06b2('0x10')]('/',auth[_0x06b2('0x9')](),controller['create']);router[_0x06b2('0x10')](_0x06b2('0xd'),auth[_0x06b2('0x9')](),controller[_0x06b2('0x11')]);router[_0x06b2('0x12')](_0x06b2('0xb'),auth[_0x06b2('0x9')](),controller[_0x06b2('0x13')]);router[_0x06b2('0x14')](_0x06b2('0xb'),auth[_0x06b2('0x9')](),controller[_0x06b2('0x15')]);module[_0x06b2('0x16')]=router; \ No newline at end of file +var _0x2e54=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','delete','destroy','exports','multer','connect-timeout','express'];(function(_0x5f58e3,_0x5539a9){var _0x29d8f2=function(_0x31c222){while(--_0x31c222){_0x5f58e3['push'](_0x5f58e3['shift']());}};_0x29d8f2(++_0x5539a9);}(_0x2e54,0x1dd));var _0x42e5=function(_0x3f353d,_0x1c30be){_0x3f353d=_0x3f353d-0x0;var _0x307f49=_0x2e54[_0x3f353d];return _0x307f49;};'use strict';var multer=require(_0x42e5('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x42e5('0x1'));var express=require(_0x42e5('0x2'));var router=express[_0x42e5('0x3')]();var fs_extra=require(_0x42e5('0x4'));var auth=require(_0x42e5('0x5'));var interaction=require(_0x42e5('0x6'));var config=require(_0x42e5('0x7'));var controller=require('./intFreshsalesAccount.controller');router[_0x42e5('0x8')]('/',auth[_0x42e5('0x9')](),controller[_0x42e5('0xa')]);router['get'](_0x42e5('0xb'),auth['isAuthenticated'](),controller[_0x42e5('0xc')]);router['get'](_0x42e5('0xd'),auth[_0x42e5('0x9')](),controller[_0x42e5('0xe')]);router[_0x42e5('0x8')](_0x42e5('0xf'),auth[_0x42e5('0x9')](),controller[_0x42e5('0x10')]);router[_0x42e5('0x11')]('/',auth[_0x42e5('0x9')](),controller['create']);router[_0x42e5('0x11')](_0x42e5('0xd'),auth['isAuthenticated'](),controller[_0x42e5('0x12')]);router[_0x42e5('0x13')](_0x42e5('0xb'),auth[_0x42e5('0x9')](),controller[_0x42e5('0x14')]);router[_0x42e5('0x15')](_0x42e5('0xb'),auth[_0x42e5('0x9')](),controller[_0x42e5('0x16')]);module[_0x42e5('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 0560805..16892a7 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 _0xf2e3=['STRING','username','remoteUri','sequelize'];(function(_0x19d24c,_0x62bc50){var _0x2fae8d=function(_0x419856){while(--_0x419856){_0x19d24c['push'](_0x19d24c['shift']());}};_0x2fae8d(++_0x62bc50);}(_0xf2e3,0x9b));var _0x3f2e=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xf2e3[_0x4a53d];return _0x27410e;};'use strict';var Sequelize=require(_0x3f2e('0x0'));module['exports']={'name':{'type':Sequelize[_0x3f2e('0x1')]},'description':{'type':Sequelize[_0x3f2e('0x1')]},'username':{'type':Sequelize[_0x3f2e('0x1')],'unique':_0x3f2e('0x2')},'apiKey':{'type':Sequelize[_0x3f2e('0x1')]},'remoteUri':{'type':Sequelize[_0x3f2e('0x1')],'unique':_0x3f2e('0x3')},'serverUrl':{'type':Sequelize[_0x3f2e('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x3a6d=['exports','STRING','username','sequelize'];(function(_0x406586,_0x405e97){var _0x453bf3=function(_0x396770){while(--_0x396770){_0x406586['push'](_0x406586['shift']());}};_0x453bf3(++_0x405e97);}(_0x3a6d,0x143));var _0xd3a6=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x3a6d[_0x51020b];return _0x371e47;};'use strict';var Sequelize=require(_0xd3a6('0x0'));module[_0xd3a6('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd3a6('0x2')]},'username':{'type':Sequelize[_0xd3a6('0x2')],'unique':_0xd3a6('0x3')},'apiKey':{'type':Sequelize[_0xd3a6('0x2')]},'remoteUri':{'type':Sequelize[_0xd3a6('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xd3a6('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index ec548d3..1ce416b 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 _0xd302=['update','body','destroy','getConfigurations','findOne','FreshsalesConfiguration','order','nolimit','AccountId','getSubjects','channel','Descriptions','getDescriptions','Subjects','FreshsalesField','getFields','username','apiKey','remoteUri','slice','substring','lastIndexOf','GET','format','%s%s','/api/selector/owners','Token\x20token=','users','Requested\x20Resource\x20not\x20Found','statusCode','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','save','then','end','error','name','send','index','map','FreshsalesAccount','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','find','create'];(function(_0x24fa83,_0x4df1a8){var _0x520fd3=function(_0x7c12f1){while(--_0x7c12f1){_0x24fa83['push'](_0x24fa83['shift']());}};_0x520fd3(++_0x4df1a8);}(_0xd302,0x86));var _0x2d30=function(_0x201508,_0x41dc66){_0x201508=_0x201508-0x0;var _0x121f89=_0xd302[_0x201508];return _0x121f89;};'use strict';var emlformat=require(_0x2d30('0x0'));var rimraf=require(_0x2d30('0x1'));var zipdir=require(_0x2d30('0x2'));var jsonpatch=require(_0x2d30('0x3'));var rp=require(_0x2d30('0x4'));var moment=require(_0x2d30('0x5'));var BPromise=require(_0x2d30('0x6'));var Mustache=require(_0x2d30('0x7'));var util=require('util');var path=require('path');var sox=require(_0x2d30('0x8'));var csv=require('to-csv');var ejs=require(_0x2d30('0x9'));var fs=require('fs');var fs_extra=require(_0x2d30('0xa'));var _=require(_0x2d30('0xb'));var squel=require(_0x2d30('0xc'));var crypto=require(_0x2d30('0xd'));var jsforce=require(_0x2d30('0xe'));var deskjs=require(_0x2d30('0xf'));var toCsv=require(_0x2d30('0x10'));var querystring=require(_0x2d30('0x11'));var Papa=require(_0x2d30('0x12'));var Redis=require(_0x2d30('0x13'));var authService=require(_0x2d30('0x14'));var qs=require(_0x2d30('0x15'));var as=require(_0x2d30('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x2d30('0x17'));var config=require(_0x2d30('0x18'));var licenseUtil=require(_0x2d30('0x19'));var db=require(_0x2d30('0x1a'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x409375,_0x5a463b){_0x5a463b=_0x5a463b||0xcc;return function(_0x18daeb){if(_0x18daeb){return _0x409375[_0x2d30('0x1b')](_0x5a463b);}return _0x409375[_0x2d30('0x1c')](_0x5a463b)['end']();};}function respondWithResult(_0x4e20cc,_0x2378f3){_0x2378f3=_0x2378f3||0xc8;return function(_0x1db79f){if(_0x1db79f){return _0x4e20cc['status'](_0x2378f3)[_0x2d30('0x1d')](_0x1db79f);}};}function respondWithFilteredResult(_0x5da9c1,_0x5e7bbd){return function(_0x30583b){if(_0x30583b){var _0x31949e=typeof _0x5e7bbd[_0x2d30('0x1e')]===_0x2d30('0x1f')&&typeof _0x5e7bbd[_0x2d30('0x20')]===_0x2d30('0x1f');var _0x24467d=_0x30583b[_0x2d30('0x21')];var _0xeeac69=_0x31949e?0x0:_0x5e7bbd[_0x2d30('0x1e')];var _0x432273=_0x31949e?_0x30583b['count']:_0x5e7bbd['offset']+_0x5e7bbd['limit'];var _0x47e27a;if(_0x432273>=_0x24467d){_0x432273=_0x24467d;_0x47e27a=0xc8;}else{_0x47e27a=0xce;}_0x5da9c1[_0x2d30('0x1c')](_0x47e27a);return _0x5da9c1['set']('Content-Range',_0xeeac69+'-'+_0x432273+'/'+_0x24467d)[_0x2d30('0x1d')](_0x30583b);}return null;};}function patchUpdates(_0x45e7bc){return function(_0x5921aa){try{jsonpatch['apply'](_0x5921aa,_0x45e7bc,!![]);}catch(_0x3f66af){return BPromise['reject'](_0x3f66af);}return _0x5921aa[_0x2d30('0x22')]();};}function saveUpdates(_0xb54862,_0x3ce753){return function(_0x51f103){if(_0x51f103){return _0x51f103['update'](_0xb54862)[_0x2d30('0x23')](function(_0x17bcd5){return _0x17bcd5;});}return null;};}function removeEntity(_0x48c847,_0x1e61c7){return function(_0x1b269f){if(_0x1b269f){return _0x1b269f['destroy']()['then'](function(){_0x48c847[_0x2d30('0x1c')](0xcc)[_0x2d30('0x24')]();});}};}function handleEntityNotFound(_0x5e7103,_0x54caf3){return function(_0x2f8a3b){if(!_0x2f8a3b){_0x5e7103[_0x2d30('0x1b')](0x194);}return _0x2f8a3b;};}function handleError(_0x3725d1,_0x3cb765){_0x3cb765=_0x3cb765||0x1f4;return function(_0x519134){logger[_0x2d30('0x25')](_0x519134['stack']);if(_0x519134[_0x2d30('0x26')]){delete _0x519134[_0x2d30('0x26')];}_0x3725d1[_0x2d30('0x1c')](_0x3cb765)[_0x2d30('0x27')](_0x519134);};}exports[_0x2d30('0x28')]=function(_0x467da0,_0x4af477){var _0x10c58c={},_0x420d2f={},_0x571433={'count':0x0,'rows':[]};var _0x215205=_[_0x2d30('0x29')](db[_0x2d30('0x2a')][_0x2d30('0x2b')],function(_0x139945){return{'name':_0x139945[_0x2d30('0x2c')],'type':_0x139945[_0x2d30('0x2d')][_0x2d30('0x2e')]};});_0x420d2f[_0x2d30('0x2f')]=_['map'](_0x215205,'name');_0x420d2f[_0x2d30('0x30')]=_[_0x2d30('0x31')](_0x467da0[_0x2d30('0x30')]);_0x420d2f['filters']=_['intersection'](_0x420d2f[_0x2d30('0x2f')],_0x420d2f[_0x2d30('0x30')]);_0x10c58c[_0x2d30('0x32')]=_[_0x2d30('0x33')](_0x420d2f[_0x2d30('0x2f')],qs['fields'](_0x467da0[_0x2d30('0x30')][_0x2d30('0x34')]));_0x10c58c[_0x2d30('0x32')]=_0x10c58c[_0x2d30('0x32')][_0x2d30('0x35')]?_0x10c58c[_0x2d30('0x32')]:_0x420d2f['model'];if(!_0x467da0[_0x2d30('0x30')][_0x2d30('0x36')]('nolimit')){_0x10c58c[_0x2d30('0x20')]=qs[_0x2d30('0x20')](_0x467da0[_0x2d30('0x30')][_0x2d30('0x20')]);_0x10c58c[_0x2d30('0x1e')]=qs[_0x2d30('0x1e')](_0x467da0['query'][_0x2d30('0x1e')]);}_0x10c58c['order']=qs['sort'](_0x467da0[_0x2d30('0x30')][_0x2d30('0x37')]);_0x10c58c[_0x2d30('0x38')]=qs[_0x2d30('0x39')](_[_0x2d30('0x3a')](_0x467da0[_0x2d30('0x30')],_0x420d2f[_0x2d30('0x39')]),_0x215205);if(_0x467da0[_0x2d30('0x30')][_0x2d30('0x3b')]){_0x10c58c['where']=_[_0x2d30('0x3c')](_0x10c58c[_0x2d30('0x38')],{'$or':_[_0x2d30('0x29')](_0x215205,function(_0x52075a){if(_0x52075a[_0x2d30('0x2d')]!=='VIRTUAL'){var _0x1bd90f={};_0x1bd90f[_0x52075a[_0x2d30('0x26')]]={'$like':'%'+_0x467da0[_0x2d30('0x30')][_0x2d30('0x3b')]+'%'};return _0x1bd90f;}})});}_0x10c58c=_['merge']({},_0x10c58c,_0x467da0[_0x2d30('0x3d')]);var _0x4cd764={'where':_0x10c58c['where']};return db[_0x2d30('0x2a')][_0x2d30('0x21')](_0x4cd764)[_0x2d30('0x23')](function(_0x39e711){_0x571433[_0x2d30('0x21')]=_0x39e711;if(_0x467da0['query'][_0x2d30('0x3e')]){_0x10c58c[_0x2d30('0x3f')]=[{'all':!![]}];}return db[_0x2d30('0x2a')][_0x2d30('0x40')](_0x10c58c);})[_0x2d30('0x23')](function(_0x3d43a6){_0x571433[_0x2d30('0x41')]=_0x3d43a6;return _0x571433;})[_0x2d30('0x23')](respondWithFilteredResult(_0x4af477,_0x10c58c))[_0x2d30('0x42')](handleError(_0x4af477,null));};exports['show']=function(_0x1bbd3d,_0x179dba){var _0x3b7342={'raw':![],'where':{'id':_0x1bbd3d[_0x2d30('0x43')]['id']}},_0x5dfa66={};_0x5dfa66[_0x2d30('0x2f')]=_[_0x2d30('0x31')](db[_0x2d30('0x2a')][_0x2d30('0x2b')]);_0x5dfa66[_0x2d30('0x30')]=_[_0x2d30('0x31')](_0x1bbd3d[_0x2d30('0x30')]);_0x5dfa66[_0x2d30('0x39')]=_[_0x2d30('0x33')](_0x5dfa66[_0x2d30('0x2f')],_0x5dfa66[_0x2d30('0x30')]);_0x3b7342[_0x2d30('0x32')]=_[_0x2d30('0x33')](_0x5dfa66[_0x2d30('0x2f')],qs[_0x2d30('0x34')](_0x1bbd3d[_0x2d30('0x30')][_0x2d30('0x34')]));_0x3b7342[_0x2d30('0x32')]=_0x3b7342[_0x2d30('0x32')][_0x2d30('0x35')]?_0x3b7342[_0x2d30('0x32')]:_0x5dfa66[_0x2d30('0x2f')];if(_0x1bbd3d[_0x2d30('0x30')][_0x2d30('0x3e')]){_0x3b7342[_0x2d30('0x3f')]=[{'all':!![]}];}_0x3b7342=_[_0x2d30('0x3c')]({},_0x3b7342,_0x1bbd3d[_0x2d30('0x3d')]);return db[_0x2d30('0x2a')][_0x2d30('0x44')](_0x3b7342)[_0x2d30('0x23')](handleEntityNotFound(_0x179dba,null))['then'](respondWithResult(_0x179dba,null))['catch'](handleError(_0x179dba,null));};exports[_0x2d30('0x45')]=function(_0x3f153b,_0x481ec3){return db[_0x2d30('0x2a')][_0x2d30('0x45')](_0x3f153b['body'],{})[_0x2d30('0x23')](respondWithResult(_0x481ec3,0xc9))[_0x2d30('0x42')](handleError(_0x481ec3,null));};exports[_0x2d30('0x46')]=function(_0x20985f,_0x41c57d){if(_0x20985f[_0x2d30('0x47')]['id']){delete _0x20985f[_0x2d30('0x47')]['id'];}return db['FreshsalesAccount'][_0x2d30('0x44')]({'where':{'id':_0x20985f['params']['id']}})['then'](handleEntityNotFound(_0x41c57d,null))[_0x2d30('0x23')](saveUpdates(_0x20985f[_0x2d30('0x47')],null))[_0x2d30('0x23')](respondWithResult(_0x41c57d,null))['catch'](handleError(_0x41c57d,null));};exports[_0x2d30('0x48')]=function(_0x1f7b9a,_0x466dc2){return db['FreshsalesAccount']['find']({'where':{'id':_0x1f7b9a['params']['id']}})[_0x2d30('0x23')](handleEntityNotFound(_0x466dc2,null))[_0x2d30('0x23')](removeEntity(_0x466dc2,null))[_0x2d30('0x42')](handleError(_0x466dc2,null));};exports[_0x2d30('0x49')]=function(_0xfa819,_0x95ca7b,_0x4d684e){var _0x47c27b={};var _0x241bcf={};var _0x269b8e;var _0x3234c3;return db[_0x2d30('0x2a')][_0x2d30('0x4a')]({'where':{'id':_0xfa819['params']['id']}})[_0x2d30('0x23')](handleEntityNotFound(_0x95ca7b,null))['then'](function(_0x4dac90){if(_0x4dac90){_0x269b8e=_0x4dac90;_0x241bcf['model']=_[_0x2d30('0x31')](db[_0x2d30('0x4b')][_0x2d30('0x2b')]);_0x241bcf[_0x2d30('0x30')]=_[_0x2d30('0x31')](_0xfa819[_0x2d30('0x30')]);_0x241bcf[_0x2d30('0x39')]=_['intersection'](_0x241bcf['model'],_0x241bcf['query']);_0x47c27b[_0x2d30('0x32')]=_['intersection'](_0x241bcf[_0x2d30('0x2f')],qs['fields'](_0xfa819[_0x2d30('0x30')][_0x2d30('0x34')]));_0x47c27b[_0x2d30('0x32')]=_0x47c27b['attributes'][_0x2d30('0x35')]?_0x47c27b['attributes']:_0x241bcf[_0x2d30('0x2f')];_0x47c27b[_0x2d30('0x4c')]=qs[_0x2d30('0x37')](_0xfa819[_0x2d30('0x30')][_0x2d30('0x37')]);_0x47c27b['where']=qs[_0x2d30('0x39')](_['pick'](_0xfa819['query'],_0x241bcf[_0x2d30('0x39')]));if(_0xfa819[_0x2d30('0x30')]['filter']){_0x47c27b['where']=_[_0x2d30('0x3c')](_0x47c27b[_0x2d30('0x38')],{'$or':_[_0x2d30('0x29')](_0x47c27b['attributes'],function(_0x325a33){var _0x738b3d={};_0x738b3d[_0x325a33]={'$like':'%'+_0xfa819['query'][_0x2d30('0x3b')]+'%'};return _0x738b3d;})});}_0x47c27b=_[_0x2d30('0x3c')]({},_0x47c27b,_0xfa819['options']);return _0x269b8e[_0x2d30('0x49')](_0x47c27b);}})[_0x2d30('0x23')](function(_0x2c9a21){if(_0x2c9a21){_0x3234c3=_0x2c9a21[_0x2d30('0x35')];if(!_0xfa819[_0x2d30('0x30')][_0x2d30('0x36')](_0x2d30('0x4d'))){_0x47c27b[_0x2d30('0x20')]=qs[_0x2d30('0x20')](_0xfa819[_0x2d30('0x30')]['limit']);_0x47c27b[_0x2d30('0x1e')]=qs[_0x2d30('0x1e')](_0xfa819[_0x2d30('0x30')][_0x2d30('0x1e')]);}return _0x269b8e[_0x2d30('0x49')](_0x47c27b);}})[_0x2d30('0x23')](function(_0x38e457){if(_0x38e457){return _0x38e457?{'count':_0x3234c3,'rows':_0x38e457}:null;}})[_0x2d30('0x23')](respondWithResult(_0x95ca7b,null))[_0x2d30('0x42')](handleError(_0x95ca7b,null));};exports['addConfiguration']=function(_0x44cef5,_0x44caae,_0x1b7022){if(_0x44cef5['body']['id']){delete _0x44cef5[_0x2d30('0x47')]['id'];}return db[_0x2d30('0x2a')]['findOne']({'where':{'id':_0x44cef5[_0x2d30('0x43')]['id']}})[_0x2d30('0x23')](handleEntityNotFound(_0x44caae,null))[_0x2d30('0x23')](function(_0x45344b){if(_0x45344b){_0x44cef5[_0x2d30('0x47')][_0x2d30('0x4e')]=_0x45344b['id'];_0x44cef5['body']['Subjects']=integrations[_0x2d30('0x4f')](_0x44cef5[_0x2d30('0x47')][_0x2d30('0x50')],_0x44cef5[_0x2d30('0x47')][_0x2d30('0x2d')]);_0x44cef5['body'][_0x2d30('0x51')]=integrations[_0x2d30('0x52')](_0x44cef5[_0x2d30('0x47')][_0x2d30('0x50')],_0x44cef5['body'][_0x2d30('0x2d')]);return db[_0x2d30('0x4b')][_0x2d30('0x45')](_0x44cef5[_0x2d30('0x47')],{'include':[{'model':db['FreshsalesField'],'as':_0x2d30('0x53')},{'model':db[_0x2d30('0x54')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x44caae,null))[_0x2d30('0x42')](handleError(_0x44caae,null));};exports[_0x2d30('0x55')]=function(_0x2cc5f1,_0x7db0c3,_0x5e0753){var _0x57edf6='';var _0x53b70a='';return db[_0x2d30('0x2a')]['findOne']({'where':{'id':_0x2cc5f1[_0x2d30('0x43')]['id']},'attributes':['id',_0x2d30('0x56'),'remoteUri',_0x2d30('0x57')]})[_0x2d30('0x23')](handleEntityNotFound(_0x7db0c3,null))[_0x2d30('0x23')](function(_0x3bbab5){if(_0x3bbab5){_0x53b70a=_0x3bbab5[_0x2d30('0x56')];_0x57edf6=_0x3bbab5['remoteUri'];var _0x4caba6=_0x3bbab5[_0x2d30('0x58')][_0x2d30('0x59')](-0x1);if(_0x4caba6==='/'){_0x57edf6=_0x57edf6[_0x2d30('0x5a')](0x0,_0x57edf6[_0x2d30('0x5b')](_0x4caba6));}return rp({'method':_0x2d30('0x5c'),'uri':util[_0x2d30('0x5d')](_0x2d30('0x5e'),_0x57edf6,_0x2d30('0x5f')),'headers':{'Authorization':_0x2d30('0x60')+_0x3bbab5[_0x2d30('0x57')]},'json':!![]});}})['then'](function(_0x86c622){if(_0x86c622){var _0xf415f0=_0x86c622[_0x2d30('0x61')];var _0x1e1ae0=![];var _0x5ad416=null;for(_0x5ad416=0x0;_0x5ad416<_0xf415f0['length'];_0x5ad416++){if(_0xf415f0[_0x5ad416]['email']===_0x53b70a){_0x1e1ae0=!![];}}if(_0x1e1ae0){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x2d30('0x62')});}}})[_0x2d30('0x23')](respondWithResult(_0x7db0c3,null))[_0x2d30('0x42')](function(_0x4a7076){var _0x1822b7=_0x2cc5f1[_0x2d30('0x30')]['test']?0x1f4:_0x4a7076[_0x2d30('0x63')]||0x1f4;logger[_0x2d30('0x25')]('getFields,\x20%s,\x20%s,\x20%s',_0x2d30('0x55'),_0x1822b7,JSON[_0x2d30('0x64')](_0x4a7076));delete _0x4a7076[_0x2d30('0x26')];if(_0x1822b7===0x191){_0x1822b7=0x190;}_0x7db0c3[_0x2d30('0x1c')](_0x1822b7)[_0x2d30('0x27')](_0x2cc5f1['query']['test']?{'message':_0x2d30('0x65'),'statusCode':_0x4a7076[_0x2d30('0x63')]}:_0x4a7076);});}; \ No newline at end of file +var _0x6c27=['eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','status','json','offset','limit','count','Content-Range','reject','save','update','destroy','then','sendStatus','error','name','send','index','rawAttributes','type','key','model','map','query','keys','intersection','attributes','fields','order','sort','filters','filter','merge','where','VIRTUAL','options','FreshsalesAccount','includeAll','rows','show','length','find','catch','create','body','params','getConfigurations','FreshsalesConfiguration','pick','hasOwnProperty','nolimit','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','getFields','username','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s%s','/api/selector/owners','users','email','test','statusCode','getFields,\x20%s,\x20%s,\x20%s'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x6c27,0x1f4));var _0x76c2=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x6c27[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0x76c2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x76c2('0x1'));var jsonpatch=require(_0x76c2('0x2'));var rp=require('request-promise');var moment=require(_0x76c2('0x3'));var BPromise=require(_0x76c2('0x4'));var Mustache=require(_0x76c2('0x5'));var util=require(_0x76c2('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x76c2('0x7'));var ejs=require(_0x76c2('0x8'));var fs=require('fs');var fs_extra=require(_0x76c2('0x9'));var _=require('lodash');var squel=require(_0x76c2('0xa'));var crypto=require(_0x76c2('0xb'));var jsforce=require(_0x76c2('0xc'));var deskjs=require(_0x76c2('0xd'));var toCsv=require(_0x76c2('0x7'));var querystring=require(_0x76c2('0xe'));var Papa=require('papaparse');var Redis=require(_0x76c2('0xf'));var authService=require(_0x76c2('0x10'));var qs=require(_0x76c2('0x11'));var as=require(_0x76c2('0x12'));var hardwareService=require(_0x76c2('0x13'));var logger=require(_0x76c2('0x14'))(_0x76c2('0x15'));var utils=require(_0x76c2('0x16'));var config=require(_0x76c2('0x17'));var licenseUtil=require(_0x76c2('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0x76c2('0x19'));function respondWithStatusCode(_0xf44498,_0x2bc6d1){_0x2bc6d1=_0x2bc6d1||0xcc;return function(_0x521ae1){if(_0x521ae1){return _0xf44498['sendStatus'](_0x2bc6d1);}return _0xf44498['status'](_0x2bc6d1)['end']();};}function respondWithResult(_0x44e206,_0x1369af){_0x1369af=_0x1369af||0xc8;return function(_0x32b269){if(_0x32b269){return _0x44e206[_0x76c2('0x1a')](_0x1369af)[_0x76c2('0x1b')](_0x32b269);}};}function respondWithFilteredResult(_0x476da7,_0x45723e){return function(_0x86a92f){if(_0x86a92f){var _0x6fa368=typeof _0x45723e[_0x76c2('0x1c')]==='undefined'&&typeof _0x45723e[_0x76c2('0x1d')]==='undefined';var _0x3b0095=_0x86a92f[_0x76c2('0x1e')];var _0x207c49=_0x6fa368?0x0:_0x45723e[_0x76c2('0x1c')];var _0x509e6c=_0x6fa368?_0x86a92f[_0x76c2('0x1e')]:_0x45723e[_0x76c2('0x1c')]+_0x45723e[_0x76c2('0x1d')];var _0x50596d;if(_0x509e6c>=_0x3b0095){_0x509e6c=_0x3b0095;_0x50596d=0xc8;}else{_0x50596d=0xce;}_0x476da7[_0x76c2('0x1a')](_0x50596d);return _0x476da7['set'](_0x76c2('0x1f'),_0x207c49+'-'+_0x509e6c+'/'+_0x3b0095)[_0x76c2('0x1b')](_0x86a92f);}return null;};}function patchUpdates(_0x3dccfb){return function(_0xfbd7c5){try{jsonpatch['apply'](_0xfbd7c5,_0x3dccfb,!![]);}catch(_0x3ef1da){return BPromise[_0x76c2('0x20')](_0x3ef1da);}return _0xfbd7c5[_0x76c2('0x21')]();};}function saveUpdates(_0x2c82a7,_0x48e32a){return function(_0x1a116b){if(_0x1a116b){return _0x1a116b[_0x76c2('0x22')](_0x2c82a7)['then'](function(_0x3ecfde){return _0x3ecfde;});}return null;};}function removeEntity(_0x56d8ed,_0x459ec6){return function(_0x39610e){if(_0x39610e){return _0x39610e[_0x76c2('0x23')]()[_0x76c2('0x24')](function(){_0x56d8ed[_0x76c2('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x150d0b,_0x2f3972){return function(_0x2807ee){if(!_0x2807ee){_0x150d0b[_0x76c2('0x25')](0x194);}return _0x2807ee;};}function handleError(_0x551783,_0x204305){_0x204305=_0x204305||0x1f4;return function(_0x2edff6){logger[_0x76c2('0x26')](_0x2edff6['stack']);if(_0x2edff6[_0x76c2('0x27')]){delete _0x2edff6[_0x76c2('0x27')];}_0x551783[_0x76c2('0x1a')](_0x204305)[_0x76c2('0x28')](_0x2edff6);};}exports[_0x76c2('0x29')]=function(_0x138ead,_0x3a501a){var _0x1122a4={},_0x55504a={},_0x3e56b6={'count':0x0,'rows':[]};var _0x3b637b=_['map'](db['FreshsalesAccount'][_0x76c2('0x2a')],function(_0x55b8a2){return{'name':_0x55b8a2['fieldName'],'type':_0x55b8a2[_0x76c2('0x2b')][_0x76c2('0x2c')]};});_0x55504a[_0x76c2('0x2d')]=_[_0x76c2('0x2e')](_0x3b637b,'name');_0x55504a[_0x76c2('0x2f')]=_[_0x76c2('0x30')](_0x138ead[_0x76c2('0x2f')]);_0x55504a['filters']=_[_0x76c2('0x31')](_0x55504a[_0x76c2('0x2d')],_0x55504a[_0x76c2('0x2f')]);_0x1122a4[_0x76c2('0x32')]=_[_0x76c2('0x31')](_0x55504a['model'],qs[_0x76c2('0x33')](_0x138ead[_0x76c2('0x2f')]['fields']));_0x1122a4[_0x76c2('0x32')]=_0x1122a4[_0x76c2('0x32')]['length']?_0x1122a4[_0x76c2('0x32')]:_0x55504a[_0x76c2('0x2d')];if(!_0x138ead[_0x76c2('0x2f')]['hasOwnProperty']('nolimit')){_0x1122a4[_0x76c2('0x1d')]=qs[_0x76c2('0x1d')](_0x138ead[_0x76c2('0x2f')][_0x76c2('0x1d')]);_0x1122a4[_0x76c2('0x1c')]=qs['offset'](_0x138ead[_0x76c2('0x2f')]['offset']);}_0x1122a4[_0x76c2('0x34')]=qs[_0x76c2('0x35')](_0x138ead[_0x76c2('0x2f')][_0x76c2('0x35')]);_0x1122a4['where']=qs['filters'](_['pick'](_0x138ead['query'],_0x55504a[_0x76c2('0x36')]),_0x3b637b);if(_0x138ead[_0x76c2('0x2f')][_0x76c2('0x37')]){_0x1122a4['where']=_[_0x76c2('0x38')](_0x1122a4[_0x76c2('0x39')],{'$or':_[_0x76c2('0x2e')](_0x3b637b,function(_0x5b1cdf){if(_0x5b1cdf[_0x76c2('0x2b')]!==_0x76c2('0x3a')){var _0x457ab5={};_0x457ab5[_0x5b1cdf[_0x76c2('0x27')]]={'$like':'%'+_0x138ead[_0x76c2('0x2f')][_0x76c2('0x37')]+'%'};return _0x457ab5;}})});}_0x1122a4=_['merge']({},_0x1122a4,_0x138ead[_0x76c2('0x3b')]);var _0x111130={'where':_0x1122a4[_0x76c2('0x39')]};return db[_0x76c2('0x3c')][_0x76c2('0x1e')](_0x111130)[_0x76c2('0x24')](function(_0x3fd568){_0x3e56b6[_0x76c2('0x1e')]=_0x3fd568;if(_0x138ead['query'][_0x76c2('0x3d')]){_0x1122a4['include']=[{'all':!![]}];}return db[_0x76c2('0x3c')]['findAll'](_0x1122a4);})[_0x76c2('0x24')](function(_0x301a74){_0x3e56b6[_0x76c2('0x3e')]=_0x301a74;return _0x3e56b6;})[_0x76c2('0x24')](respondWithFilteredResult(_0x3a501a,_0x1122a4))['catch'](handleError(_0x3a501a,null));};exports[_0x76c2('0x3f')]=function(_0x361bca,_0x5548d5){var _0x105b43={'raw':![],'where':{'id':_0x361bca['params']['id']}},_0x59fc7f={};_0x59fc7f[_0x76c2('0x2d')]=_[_0x76c2('0x30')](db['FreshsalesAccount'][_0x76c2('0x2a')]);_0x59fc7f['query']=_[_0x76c2('0x30')](_0x361bca[_0x76c2('0x2f')]);_0x59fc7f[_0x76c2('0x36')]=_[_0x76c2('0x31')](_0x59fc7f[_0x76c2('0x2d')],_0x59fc7f[_0x76c2('0x2f')]);_0x105b43[_0x76c2('0x32')]=_[_0x76c2('0x31')](_0x59fc7f['model'],qs[_0x76c2('0x33')](_0x361bca[_0x76c2('0x2f')][_0x76c2('0x33')]));_0x105b43['attributes']=_0x105b43[_0x76c2('0x32')][_0x76c2('0x40')]?_0x105b43[_0x76c2('0x32')]:_0x59fc7f[_0x76c2('0x2d')];if(_0x361bca[_0x76c2('0x2f')]['includeAll']){_0x105b43['include']=[{'all':!![]}];}_0x105b43=_[_0x76c2('0x38')]({},_0x105b43,_0x361bca[_0x76c2('0x3b')]);return db[_0x76c2('0x3c')][_0x76c2('0x41')](_0x105b43)[_0x76c2('0x24')](handleEntityNotFound(_0x5548d5,null))[_0x76c2('0x24')](respondWithResult(_0x5548d5,null))[_0x76c2('0x42')](handleError(_0x5548d5,null));};exports[_0x76c2('0x43')]=function(_0x2294c1,_0x444077){return db[_0x76c2('0x3c')]['create'](_0x2294c1['body'],{})[_0x76c2('0x24')](respondWithResult(_0x444077,0xc9))[_0x76c2('0x42')](handleError(_0x444077,null));};exports[_0x76c2('0x22')]=function(_0x56c884,_0xe293){if(_0x56c884[_0x76c2('0x44')]['id']){delete _0x56c884[_0x76c2('0x44')]['id'];}return db[_0x76c2('0x3c')][_0x76c2('0x41')]({'where':{'id':_0x56c884[_0x76c2('0x45')]['id']}})[_0x76c2('0x24')](handleEntityNotFound(_0xe293,null))[_0x76c2('0x24')](saveUpdates(_0x56c884[_0x76c2('0x44')],null))['then'](respondWithResult(_0xe293,null))[_0x76c2('0x42')](handleError(_0xe293,null));};exports[_0x76c2('0x23')]=function(_0x365e4f,_0x38322d){return db[_0x76c2('0x3c')][_0x76c2('0x41')]({'where':{'id':_0x365e4f[_0x76c2('0x45')]['id']}})[_0x76c2('0x24')](handleEntityNotFound(_0x38322d,null))['then'](removeEntity(_0x38322d,null))[_0x76c2('0x42')](handleError(_0x38322d,null));};exports[_0x76c2('0x46')]=function(_0x1efbfe,_0x530065,_0x5ba0f7){var _0x24b831={};var _0x350d2b={};var _0x55c226;var _0x34d2c9;return db[_0x76c2('0x3c')]['findOne']({'where':{'id':_0x1efbfe[_0x76c2('0x45')]['id']}})['then'](handleEntityNotFound(_0x530065,null))[_0x76c2('0x24')](function(_0x4cfee6){if(_0x4cfee6){_0x55c226=_0x4cfee6;_0x350d2b[_0x76c2('0x2d')]=_['keys'](db[_0x76c2('0x47')][_0x76c2('0x2a')]);_0x350d2b['query']=_[_0x76c2('0x30')](_0x1efbfe['query']);_0x350d2b['filters']=_[_0x76c2('0x31')](_0x350d2b[_0x76c2('0x2d')],_0x350d2b[_0x76c2('0x2f')]);_0x24b831['attributes']=_['intersection'](_0x350d2b[_0x76c2('0x2d')],qs[_0x76c2('0x33')](_0x1efbfe[_0x76c2('0x2f')][_0x76c2('0x33')]));_0x24b831[_0x76c2('0x32')]=_0x24b831[_0x76c2('0x32')]['length']?_0x24b831['attributes']:_0x350d2b[_0x76c2('0x2d')];_0x24b831[_0x76c2('0x34')]=qs['sort'](_0x1efbfe['query'][_0x76c2('0x35')]);_0x24b831[_0x76c2('0x39')]=qs[_0x76c2('0x36')](_[_0x76c2('0x48')](_0x1efbfe['query'],_0x350d2b[_0x76c2('0x36')]));if(_0x1efbfe[_0x76c2('0x2f')][_0x76c2('0x37')]){_0x24b831[_0x76c2('0x39')]=_[_0x76c2('0x38')](_0x24b831['where'],{'$or':_['map'](_0x24b831[_0x76c2('0x32')],function(_0x59eb5f){var _0x18fb74={};_0x18fb74[_0x59eb5f]={'$like':'%'+_0x1efbfe[_0x76c2('0x2f')][_0x76c2('0x37')]+'%'};return _0x18fb74;})});}_0x24b831=_['merge']({},_0x24b831,_0x1efbfe[_0x76c2('0x3b')]);return _0x55c226[_0x76c2('0x46')](_0x24b831);}})['then'](function(_0x1ae4e2){if(_0x1ae4e2){_0x34d2c9=_0x1ae4e2[_0x76c2('0x40')];if(!_0x1efbfe[_0x76c2('0x2f')][_0x76c2('0x49')](_0x76c2('0x4a'))){_0x24b831[_0x76c2('0x1d')]=qs[_0x76c2('0x1d')](_0x1efbfe[_0x76c2('0x2f')][_0x76c2('0x1d')]);_0x24b831[_0x76c2('0x1c')]=qs[_0x76c2('0x1c')](_0x1efbfe[_0x76c2('0x2f')][_0x76c2('0x1c')]);}return _0x55c226[_0x76c2('0x46')](_0x24b831);}})[_0x76c2('0x24')](function(_0x4a7132){if(_0x4a7132){return _0x4a7132?{'count':_0x34d2c9,'rows':_0x4a7132}:null;}})['then'](respondWithResult(_0x530065,null))[_0x76c2('0x42')](handleError(_0x530065,null));};exports[_0x76c2('0x4b')]=function(_0xce024f,_0x1757b7,_0x2c8b74){if(_0xce024f[_0x76c2('0x44')]['id']){delete _0xce024f['body']['id'];}return db['FreshsalesAccount'][_0x76c2('0x4c')]({'where':{'id':_0xce024f[_0x76c2('0x45')]['id']}})[_0x76c2('0x24')](handleEntityNotFound(_0x1757b7,null))[_0x76c2('0x24')](function(_0x5bb2d8){if(_0x5bb2d8){_0xce024f['body'][_0x76c2('0x4d')]=_0x5bb2d8['id'];_0xce024f['body'][_0x76c2('0x4e')]=integrations[_0x76c2('0x4f')](_0xce024f[_0x76c2('0x44')][_0x76c2('0x50')],_0xce024f[_0x76c2('0x44')][_0x76c2('0x2b')]);_0xce024f[_0x76c2('0x44')][_0x76c2('0x51')]=integrations[_0x76c2('0x52')](_0xce024f[_0x76c2('0x44')]['channel'],_0xce024f['body'][_0x76c2('0x2b')]);return db[_0x76c2('0x47')][_0x76c2('0x43')](_0xce024f[_0x76c2('0x44')],{'include':[{'model':db[_0x76c2('0x53')],'as':_0x76c2('0x4e')},{'model':db[_0x76c2('0x53')],'as':_0x76c2('0x51')}]});}return null;})['then'](respondWithResult(_0x1757b7,null))[_0x76c2('0x42')](handleError(_0x1757b7,null));};exports[_0x76c2('0x54')]=function(_0x1cd793,_0x12da98,_0x46750a){var _0x5a525b='';var _0xf067bb='';return db[_0x76c2('0x3c')][_0x76c2('0x4c')]({'where':{'id':_0x1cd793[_0x76c2('0x45')]['id']},'attributes':['id',_0x76c2('0x55'),_0x76c2('0x56'),_0x76c2('0x57')]})[_0x76c2('0x24')](handleEntityNotFound(_0x12da98,null))[_0x76c2('0x24')](function(_0x40025b){if(_0x40025b){_0xf067bb=_0x40025b[_0x76c2('0x55')];_0x5a525b=_0x40025b['remoteUri'];var _0x43ead9=_0x40025b[_0x76c2('0x56')][_0x76c2('0x58')](-0x1);if(_0x43ead9==='/'){_0x5a525b=_0x5a525b[_0x76c2('0x59')](0x0,_0x5a525b[_0x76c2('0x5a')](_0x43ead9));}return rp({'method':_0x76c2('0x5b'),'uri':util[_0x76c2('0x5c')](_0x76c2('0x5d'),_0x5a525b,_0x76c2('0x5e')),'headers':{'Authorization':'Token\x20token='+_0x40025b[_0x76c2('0x57')]},'json':!![]});}})['then'](function(_0x3cca43){if(_0x3cca43){var _0x36db29=_0x3cca43[_0x76c2('0x5f')];var _0x42767b=![];var _0x51ebf6=null;for(_0x51ebf6=0x0;_0x51ebf6<_0x36db29[_0x76c2('0x40')];_0x51ebf6++){if(_0x36db29[_0x51ebf6][_0x76c2('0x60')]===_0xf067bb){_0x42767b=!![];}}if(_0x42767b){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})['then'](respondWithResult(_0x12da98,null))[_0x76c2('0x42')](function(_0x49606f){var _0x346a86=_0x1cd793[_0x76c2('0x2f')][_0x76c2('0x61')]?0x1f4:_0x49606f[_0x76c2('0x62')]||0x1f4;logger[_0x76c2('0x26')](_0x76c2('0x63'),_0x76c2('0x54'),_0x346a86,JSON['stringify'](_0x49606f));delete _0x49606f[_0x76c2('0x27')];if(_0x346a86===0x191){_0x346a86=0x190;}_0x12da98[_0x76c2('0x1a')](_0x346a86)['send'](_0x1cd793[_0x76c2('0x2f')][_0x76c2('0x61')]?{'message':'Wrong\x20credentials','statusCode':_0x49606f[_0x76c2('0x62')]}:_0x49606f);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 5ed564d..690b164 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 _0x7bd0=['path','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','int_freshsales_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xbf8ec1,_0x9169c8){var _0xc84567=function(_0x509094){while(--_0x509094){_0xbf8ec1['push'](_0xbf8ec1['shift']());}};_0xc84567(++_0x9169c8);}(_0x7bd0,0x111));var _0x07bd=function(_0x565fed,_0xb85768){_0x565fed=_0x565fed-0x0;var _0x3e018f=_0x7bd0[_0x565fed];return _0x3e018f;};'use strict';var _=require(_0x07bd('0x0'));var util=require(_0x07bd('0x1'));var logger=require(_0x07bd('0x2'))(_0x07bd('0x3'));var moment=require(_0x07bd('0x4'));var BPromise=require(_0x07bd('0x5'));var rp=require(_0x07bd('0x6'));var fs=require('fs');var path=require(_0x07bd('0x7'));var rimraf=require('rimraf');var config=require(_0x07bd('0x8'));var attributes=require(_0x07bd('0x9'));var integrations=require(_0x07bd('0xa'));module[_0x07bd('0xb')]=function(_0x3e8349,_0x422a22){return _0x3e8349[_0x07bd('0xc')]('FreshsalesAccount',attributes,{'tableName':_0x07bd('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcaf2=['./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','lodash','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x57ee1d,_0x54111b){var _0x12a933=function(_0x5c9d92){while(--_0x5c9d92){_0x57ee1d['push'](_0x57ee1d['shift']());}};_0x12a933(++_0x54111b);}(_0xcaf2,0x8a));var _0x2caf=function(_0x133296,_0xe8ff9a){_0x133296=_0x133296-0x0;var _0x193517=_0xcaf2[_0x133296];return _0x193517;};'use strict';var _=require(_0x2caf('0x0'));var util=require('util');var logger=require(_0x2caf('0x1'))(_0x2caf('0x2'));var moment=require('moment');var BPromise=require(_0x2caf('0x3'));var rp=require(_0x2caf('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2caf('0x5'));var config=require('../../config/environment');var attributes=require(_0x2caf('0x6'));var integrations=require(_0x2caf('0x7'));module[_0x2caf('0x8')]=function(_0x599ce7,_0xc44e4e){return _0x599ce7[_0x2caf('0x9')](_0x2caf('0xa'),attributes,{'tableName':_0x2caf('0xb'),'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 5501b63..49a953a 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 _0x77e6=['result','catch','FreshsalesAccount','findAll','options','where','attributes','limit','include','model','map','GetFreshsalesAccount','ShowFreshsalesAccount','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshsalesAccount,\x20%s,\x20%s','message'];(function(_0x22f67d,_0x319ca6){var _0x188842=function(_0x36c14a){while(--_0x36c14a){_0x22f67d['push'](_0x22f67d['shift']());}};_0x188842(++_0x319ca6);}(_0x77e6,0x1a6));var _0x677e=function(_0x5eedc2,_0xcb147f){_0x5eedc2=_0x5eedc2-0x0;var _0x50ec6a=_0x77e6[_0x5eedc2];return _0x50ec6a;};'use strict';var _=require(_0x677e('0x0'));var util=require(_0x677e('0x1'));var moment=require(_0x677e('0x2'));var BPromise=require(_0x677e('0x3'));var rs=require(_0x677e('0x4'));var fs=require('fs');var Redis=require(_0x677e('0x5'));var db=require(_0x677e('0x6'))['db'];var utils=require(_0x677e('0x7'));var logger=require('../../config/logger')(_0x677e('0x8'));var config=require(_0x677e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x677e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x40d314,_0x4d1a57,_0x5a5dd3){return new BPromise(function(_0x2eb40c,_0x4c519f){return client[_0x677e('0xb')](_0x40d314,_0x5a5dd3)[_0x677e('0xc')](function(_0x552931){logger[_0x677e('0xd')]('FreshsalesAccount,\x20%s,\x20%s',_0x4d1a57,_0x677e('0xe'));logger[_0x677e('0xf')](_0x677e('0x10'),_0x4d1a57,_0x677e('0xe'),JSON[_0x677e('0x11')](_0x552931));if(_0x552931[_0x677e('0x12')]){if(_0x552931[_0x677e('0x12')][_0x677e('0x13')]===0x1f4){logger[_0x677e('0x12')](_0x677e('0x14'),_0x4d1a57,_0x552931[_0x677e('0x12')][_0x677e('0x15')]);return _0x4c519f(_0x552931[_0x677e('0x12')][_0x677e('0x15')]);}logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x4d1a57,_0x552931['error'][_0x677e('0x15')]);return _0x2eb40c(_0x552931[_0x677e('0x12')][_0x677e('0x15')]);}else{logger[_0x677e('0xd')](_0x677e('0x14'),_0x4d1a57,_0x677e('0xe'));_0x2eb40c(_0x552931[_0x677e('0x16')][_0x677e('0x15')]);}})[_0x677e('0x17')](function(_0x32d306){logger[_0x677e('0x12')](_0x677e('0x14'),_0x4d1a57,_0x32d306);_0x4c519f(_0x32d306);});});}exports['GetFreshsalesAccount']=function(_0x1c5124){var _0x2ef2bf=this;return new Promise(function(_0x385b06,_0x221b6d){return db[_0x677e('0x18')][_0x677e('0x19')]({'raw':_0x1c5124['options']?_0x1c5124[_0x677e('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x1c5124[_0x677e('0x1a')]?_0x1c5124[_0x677e('0x1a')][_0x677e('0x1b')]||null:null,'attributes':_0x1c5124['options']?_0x1c5124[_0x677e('0x1a')][_0x677e('0x1c')]||null:null,'limit':_0x1c5124[_0x677e('0x1a')]?_0x1c5124[_0x677e('0x1a')][_0x677e('0x1d')]||null:null,'include':_0x1c5124[_0x677e('0x1a')]?_0x1c5124[_0x677e('0x1a')]['include']?_['map'](_0x1c5124['options'][_0x677e('0x1e')],function(_0x154fce){return{'model':db[_0x154fce[_0x677e('0x1f')]],'as':_0x154fce['as'],'attributes':_0x154fce[_0x677e('0x1c')],'include':_0x154fce[_0x677e('0x1e')]?_[_0x677e('0x20')](_0x154fce[_0x677e('0x1e')],function(_0x42f2b8){return{'model':db[_0x42f2b8[_0x677e('0x1f')]],'as':_0x42f2b8['as'],'attributes':_0x42f2b8[_0x677e('0x1c')],'include':_0x42f2b8['include']?_['map'](_0x42f2b8[_0x677e('0x1e')],function(_0x184f68){return{'model':db[_0x184f68['model']],'as':_0x184f68['as'],'attributes':_0x184f68[_0x677e('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x677e('0xc')](function(_0xf6b3ad){logger[_0x677e('0xd')](_0x677e('0x21'),_0x1c5124);logger[_0x677e('0xf')]('GetFreshsalesAccount',_0x1c5124,JSON[_0x677e('0x11')](_0xf6b3ad));_0x385b06(_0xf6b3ad);})[_0x677e('0x17')](function(_0xeca8e2){logger[_0x677e('0x12')](_0x677e('0x21'),_0xeca8e2[_0x677e('0x15')],_0x1c5124);_0x221b6d(_0x2ef2bf[_0x677e('0x12')](0x1f4,_0xeca8e2[_0x677e('0x15')]));});});};exports[_0x677e('0x22')]=function(_0x4c5113){var _0x22ccfb=this;return new Promise(function(_0x3cac19,_0x2fb815){return db[_0x677e('0x18')][_0x677e('0x23')]({'raw':_0x4c5113[_0x677e('0x1a')]?_0x4c5113[_0x677e('0x1a')][_0x677e('0x24')]===undefined?!![]:![]:!![],'where':_0x4c5113[_0x677e('0x1a')]?_0x4c5113[_0x677e('0x1a')]['where']||null:null,'attributes':_0x4c5113[_0x677e('0x1a')]?_0x4c5113[_0x677e('0x1a')][_0x677e('0x1c')]||null:null,'include':_0x4c5113[_0x677e('0x1a')]?_0x4c5113[_0x677e('0x1a')][_0x677e('0x1e')]?_['map'](_0x4c5113[_0x677e('0x1a')][_0x677e('0x1e')],function(_0x2d0bc0){return{'model':db[_0x2d0bc0['model']],'as':_0x2d0bc0['as'],'attributes':_0x2d0bc0[_0x677e('0x1c')],'include':_0x2d0bc0[_0x677e('0x1e')]?_[_0x677e('0x20')](_0x2d0bc0[_0x677e('0x1e')],function(_0x35c945){return{'model':db[_0x35c945['model']],'as':_0x35c945['as'],'attributes':_0x35c945[_0x677e('0x1c')],'include':_0x35c945[_0x677e('0x1e')]?_[_0x677e('0x20')](_0x35c945[_0x677e('0x1e')],function(_0x548b22){return{'model':db[_0x548b22[_0x677e('0x1f')]],'as':_0x548b22['as'],'attributes':_0x548b22[_0x677e('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x677e('0xc')](function(_0x576443){logger['info'](_0x677e('0x22'),_0x4c5113);logger[_0x677e('0xf')]('ShowFreshsalesAccount',_0x4c5113,JSON[_0x677e('0x11')](_0x576443));_0x3cac19(_0x576443);})[_0x677e('0x17')](function(_0x497dca){logger['error'](_0x677e('0x22'),_0x497dca[_0x677e('0x15')],_0x4c5113);_0x2fb815(_0x22ccfb['error'](0x1f4,_0x497dca['message']));});});}; \ No newline at end of file +var _0x9582=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','FreshsalesAccount,\x20%s,\x20%s','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','FreshsalesAccount','options','raw','limit','include','map','model','attributes','then','GetFreshsalesAccount','ShowFreshsalesAccount','find'];(function(_0x22884f,_0x485804){var _0x23e986=function(_0x3958b5){while(--_0x3958b5){_0x22884f['push'](_0x22884f['shift']());}};_0x23e986(++_0x485804);}(_0x9582,0x95));var _0x2958=function(_0x39b0ed,_0x2cd948){_0x39b0ed=_0x39b0ed-0x0;var _0x3be75f=_0x9582[_0x39b0ed];return _0x3be75f;};'use strict';var _=require(_0x2958('0x0'));var util=require(_0x2958('0x1'));var moment=require(_0x2958('0x2'));var BPromise=require(_0x2958('0x3'));var rs=require(_0x2958('0x4'));var fs=require('fs');var Redis=require(_0x2958('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2958('0x6'));var logger=require(_0x2958('0x7'))(_0x2958('0x8'));var config=require(_0x2958('0x9'));var jayson=require(_0x2958('0xa'));var client=jayson[_0x2958('0xb')][_0x2958('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x309525,_0xa385ec,_0x2e571b){return new BPromise(function(_0x56ca85,_0x5ec1b3){return client[_0x2958('0xd')](_0x309525,_0x2e571b)['then'](function(_0x10db1e){logger['info'](_0x2958('0xe'),_0xa385ec,'request\x20sent');logger[_0x2958('0xf')](_0x2958('0x10'),_0xa385ec,_0x2958('0x11'),JSON[_0x2958('0x12')](_0x10db1e));if(_0x10db1e[_0x2958('0x13')]){if(_0x10db1e['error'][_0x2958('0x14')]===0x1f4){logger[_0x2958('0x13')](_0x2958('0xe'),_0xa385ec,_0x10db1e[_0x2958('0x13')][_0x2958('0x15')]);return _0x5ec1b3(_0x10db1e[_0x2958('0x13')][_0x2958('0x15')]);}logger[_0x2958('0x13')]('FreshsalesAccount,\x20%s,\x20%s',_0xa385ec,_0x10db1e[_0x2958('0x13')][_0x2958('0x15')]);return _0x56ca85(_0x10db1e['error']['message']);}else{logger[_0x2958('0x16')](_0x2958('0xe'),_0xa385ec,'request\x20sent');_0x56ca85(_0x10db1e[_0x2958('0x17')]['message']);}})['catch'](function(_0x429d42){logger[_0x2958('0x13')]('FreshsalesAccount,\x20%s,\x20%s',_0xa385ec,_0x429d42);_0x5ec1b3(_0x429d42);});});}exports['GetFreshsalesAccount']=function(_0x28a92c){var _0x160949=this;return new Promise(function(_0x310d07,_0x42bb99){return db[_0x2958('0x18')]['findAll']({'raw':_0x28a92c[_0x2958('0x19')]?_0x28a92c[_0x2958('0x19')][_0x2958('0x1a')]===undefined?!![]:![]:!![],'where':_0x28a92c['options']?_0x28a92c[_0x2958('0x19')]['where']||null:null,'attributes':_0x28a92c[_0x2958('0x19')]?_0x28a92c['options']['attributes']||null:null,'limit':_0x28a92c[_0x2958('0x19')]?_0x28a92c[_0x2958('0x19')][_0x2958('0x1b')]||null:null,'include':_0x28a92c[_0x2958('0x19')]?_0x28a92c[_0x2958('0x19')][_0x2958('0x1c')]?_[_0x2958('0x1d')](_0x28a92c[_0x2958('0x19')][_0x2958('0x1c')],function(_0x2aa514){return{'model':db[_0x2aa514[_0x2958('0x1e')]],'as':_0x2aa514['as'],'attributes':_0x2aa514[_0x2958('0x1f')],'include':_0x2aa514[_0x2958('0x1c')]?_[_0x2958('0x1d')](_0x2aa514[_0x2958('0x1c')],function(_0x4f811a){return{'model':db[_0x4f811a['model']],'as':_0x4f811a['as'],'attributes':_0x4f811a[_0x2958('0x1f')],'include':_0x4f811a[_0x2958('0x1c')]?_[_0x2958('0x1d')](_0x4f811a[_0x2958('0x1c')],function(_0x52bd32){return{'model':db[_0x52bd32[_0x2958('0x1e')]],'as':_0x52bd32['as'],'attributes':_0x52bd32['attributes']};}):[]};}):[]};}):[]:[]})[_0x2958('0x20')](function(_0x40adce){logger[_0x2958('0x16')](_0x2958('0x21'),_0x28a92c);logger[_0x2958('0xf')](_0x2958('0x21'),_0x28a92c,JSON[_0x2958('0x12')](_0x40adce));_0x310d07(_0x40adce);})['catch'](function(_0x21b919){logger['error']('GetFreshsalesAccount',_0x21b919[_0x2958('0x15')],_0x28a92c);_0x42bb99(_0x160949[_0x2958('0x13')](0x1f4,_0x21b919[_0x2958('0x15')]));});});};exports[_0x2958('0x22')]=function(_0x584179){var _0x2d9472=this;return new Promise(function(_0x222b83,_0x2c73e9){return db['FreshsalesAccount'][_0x2958('0x23')]({'raw':_0x584179[_0x2958('0x19')]?_0x584179['options'][_0x2958('0x1a')]===undefined?!![]:![]:!![],'where':_0x584179['options']?_0x584179[_0x2958('0x19')]['where']||null:null,'attributes':_0x584179[_0x2958('0x19')]?_0x584179['options'][_0x2958('0x1f')]||null:null,'include':_0x584179[_0x2958('0x19')]?_0x584179[_0x2958('0x19')][_0x2958('0x1c')]?_[_0x2958('0x1d')](_0x584179[_0x2958('0x19')][_0x2958('0x1c')],function(_0x58f9b4){return{'model':db[_0x58f9b4[_0x2958('0x1e')]],'as':_0x58f9b4['as'],'attributes':_0x58f9b4['attributes'],'include':_0x58f9b4[_0x2958('0x1c')]?_['map'](_0x58f9b4[_0x2958('0x1c')],function(_0x517f55){return{'model':db[_0x517f55[_0x2958('0x1e')]],'as':_0x517f55['as'],'attributes':_0x517f55[_0x2958('0x1f')],'include':_0x517f55[_0x2958('0x1c')]?_[_0x2958('0x1d')](_0x517f55[_0x2958('0x1c')],function(_0x24aca5){return{'model':db[_0x24aca5[_0x2958('0x1e')]],'as':_0x24aca5['as'],'attributes':_0x24aca5[_0x2958('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x2958('0x20')](function(_0xc4a303){logger[_0x2958('0x16')](_0x2958('0x22'),_0x584179);logger[_0x2958('0xf')]('ShowFreshsalesAccount',_0x584179,JSON[_0x2958('0x12')](_0xc4a303));_0x222b83(_0xc4a303);})[_0x2958('0x24')](function(_0x281817){logger[_0x2958('0x13')]('ShowFreshsalesAccount',_0x281817[_0x2958('0x15')],_0x584179);_0x2c73e9(_0x2d9472[_0x2958('0x13')](0x1f4,_0x281817[_0x2958('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index cf3fbe4..2fd85ed 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 _0xf870=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','post','create','/:id','update','delete','destroy','exports','multer'];(function(_0x19caab,_0x1e1296){var _0x1f730c=function(_0x120541){while(--_0x120541){_0x19caab['push'](_0x19caab['shift']());}};_0x1f730c(++_0x1e1296);}(_0xf870,0x1da));var _0x0f87=function(_0x344fe8,_0xbc6928){_0x344fe8=_0x344fe8-0x0;var _0x5bfc11=_0xf870[_0x344fe8];return _0x5bfc11;};'use strict';var multer=require(_0x0f87('0x0'));var util=require(_0x0f87('0x1'));var path=require(_0x0f87('0x2'));var timeout=require(_0x0f87('0x3'));var express=require(_0x0f87('0x4'));var router=express[_0x0f87('0x5')]();var fs_extra=require(_0x0f87('0x6'));var auth=require(_0x0f87('0x7'));var interaction=require(_0x0f87('0x8'));var config=require(_0x0f87('0x9'));var controller=require('./intFreshsalesConfiguration.controller');router[_0x0f87('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x0f87('0xa')]('/:id',auth[_0x0f87('0xb')](),controller[_0x0f87('0xc')]);router[_0x0f87('0xa')](_0x0f87('0xd'),auth[_0x0f87('0xb')](),controller[_0x0f87('0xe')]);router[_0x0f87('0xa')](_0x0f87('0xf'),auth[_0x0f87('0xb')](),controller[_0x0f87('0x10')]);router['get'](_0x0f87('0x11'),auth[_0x0f87('0xb')](),controller['getFields']);router[_0x0f87('0x12')]('/',auth[_0x0f87('0xb')](),controller[_0x0f87('0x13')]);router['put'](_0x0f87('0x14'),auth[_0x0f87('0xb')](),controller[_0x0f87('0x15')]);router[_0x0f87('0x16')](_0x0f87('0x14'),auth[_0x0f87('0xb')](),controller[_0x0f87('0x17')]);module[_0x0f87('0x18')]=router; \ No newline at end of file +var _0x0cb4=['delete','exports','Router','fs-extra','./intFreshsalesConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/descriptions','/:id/fields','getFields','post','create','put','update'];(function(_0x4b4d88,_0x4240de){var _0x47f369=function(_0x464c3e){while(--_0x464c3e){_0x4b4d88['push'](_0x4b4d88['shift']());}};_0x47f369(++_0x4240de);}(_0x0cb4,0x79));var _0x40cb=function(_0x438879,_0x137d0e){_0x438879=_0x438879-0x0;var _0xc653cb=_0x0cb4[_0x438879];return _0xc653cb;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x40cb('0x0')]();var fs_extra=require(_0x40cb('0x1'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x40cb('0x2'));router[_0x40cb('0x3')]('/',auth['isAuthenticated'](),controller[_0x40cb('0x4')]);router[_0x40cb('0x3')](_0x40cb('0x5'),auth[_0x40cb('0x6')](),controller[_0x40cb('0x7')]);router[_0x40cb('0x3')]('/:id/subjects',auth[_0x40cb('0x6')](),controller['getSubjects']);router['get'](_0x40cb('0x8'),auth[_0x40cb('0x6')](),controller['getDescriptions']);router[_0x40cb('0x3')](_0x40cb('0x9'),auth['isAuthenticated'](),controller[_0x40cb('0xa')]);router[_0x40cb('0xb')]('/',auth[_0x40cb('0x6')](),controller[_0x40cb('0xc')]);router[_0x40cb('0xd')](_0x40cb('0x5'),auth['isAuthenticated'](),controller[_0x40cb('0xe')]);router[_0x40cb('0xf')](_0x40cb('0x5'),auth[_0x40cb('0x6')](),controller['destroy']);module[_0x40cb('0x10')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index b0cbcd4..a331af4 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 _0x1252=['sequelize','STRING'];(function(_0x53e6a8,_0x5839ab){var _0x2b6dcc=function(_0x2b4215){while(--_0x2b4215){_0x53e6a8['push'](_0x53e6a8['shift']());}};_0x2b6dcc(++_0x5839ab);}(_0x1252,0x1c0));var _0x2125=function(_0x1a45fd,_0x16dc45){_0x1a45fd=_0x1a45fd-0x0;var _0x380f2a=_0x1252[_0x1a45fd];return _0x380f2a;};'use strict';var Sequelize=require(_0x2125('0x0'));module['exports']={'name':{'type':Sequelize[_0x2125('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc1fd=['STRING','sequelize','exports'];(function(_0x1c9c24,_0x2a517b){var _0x349c69=function(_0x259ff7){while(--_0x259ff7){_0x1c9c24['push'](_0x1c9c24['shift']());}};_0x349c69(++_0x2a517b);}(_0xc1fd,0xe2));var _0xdc1f=function(_0x5cb511,_0x4824ed){_0x5cb511=_0x5cb511-0x0;var _0x3cb4d4=_0xc1fd[_0x5cb511];return _0x3cb4d4;};'use strict';var Sequelize=require(_0xdc1f('0x0'));module[_0xdc1f('0x1')]={'name':{'type':Sequelize[_0xdc1f('0x2')]},'description':{'type':Sequelize[_0xdc1f('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 6c564e5..13b701a 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 _0xad16=['save','update','then','destroy','end','error','stack','name','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','fields','attributes','length','model','hasOwnProperty','order','sort','filter','where','VIRTUAL','merge','options','FreshsalesConfiguration','rows','catch','show','params','includeAll','include','create','body','find','getSubjects','FreshsalesField','pick','nolimit','getDescriptions','findOne','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject'];(function(_0x181e74,_0x2b5f59){var _0x17cd3e=function(_0x515d04){while(--_0x515d04){_0x181e74['push'](_0x181e74['shift']());}};_0x17cd3e(++_0x2b5f59);}(_0xad16,0xcf));var _0x6ad1=function(_0x3e853c,_0x64d7b1){_0x3e853c=_0x3e853c-0x0;var _0xf71546=_0xad16[_0x3e853c];return _0xf71546;};'use strict';var emlformat=require(_0x6ad1('0x0'));var rimraf=require(_0x6ad1('0x1'));var zipdir=require(_0x6ad1('0x2'));var jsonpatch=require(_0x6ad1('0x3'));var rp=require(_0x6ad1('0x4'));var moment=require('moment');var BPromise=require(_0x6ad1('0x5'));var Mustache=require('mustache');var util=require(_0x6ad1('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x6ad1('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6ad1('0x8'));var squel=require(_0x6ad1('0x9'));var crypto=require(_0x6ad1('0xa'));var jsforce=require(_0x6ad1('0xb'));var deskjs=require(_0x6ad1('0xc'));var toCsv=require(_0x6ad1('0x7'));var querystring=require(_0x6ad1('0xd'));var Papa=require('papaparse');var Redis=require(_0x6ad1('0xe'));var authService=require(_0x6ad1('0xf'));var qs=require(_0x6ad1('0x10'));var as=require(_0x6ad1('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6ad1('0x12'))('api');var utils=require(_0x6ad1('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x6ad1('0x14'));var db=require(_0x6ad1('0x15'))['db'];function respondWithStatusCode(_0x2f7666,_0x5d50a3){_0x5d50a3=_0x5d50a3||0xcc;return function(_0x6da4c2){if(_0x6da4c2){return _0x2f7666[_0x6ad1('0x16')](_0x5d50a3);}return _0x2f7666[_0x6ad1('0x17')](_0x5d50a3)['end']();};}function respondWithResult(_0x5169b7,_0x1b04b9){_0x1b04b9=_0x1b04b9||0xc8;return function(_0x34114a){if(_0x34114a){return _0x5169b7[_0x6ad1('0x17')](_0x1b04b9)[_0x6ad1('0x18')](_0x34114a);}};}function respondWithFilteredResult(_0x1d84c7,_0x4d4aca){return function(_0x1ba716){if(_0x1ba716){var _0x6dd848=typeof _0x4d4aca[_0x6ad1('0x19')]===_0x6ad1('0x1a')&&typeof _0x4d4aca[_0x6ad1('0x1b')]===_0x6ad1('0x1a');var _0x591031=_0x1ba716['count'];var _0x5721bc=_0x6dd848?0x0:_0x4d4aca['offset'];var _0xfb3dd8=_0x6dd848?_0x1ba716[_0x6ad1('0x1c')]:_0x4d4aca['offset']+_0x4d4aca[_0x6ad1('0x1b')];var _0x4342ce;if(_0xfb3dd8>=_0x591031){_0xfb3dd8=_0x591031;_0x4342ce=0xc8;}else{_0x4342ce=0xce;}_0x1d84c7['status'](_0x4342ce);return _0x1d84c7[_0x6ad1('0x1d')](_0x6ad1('0x1e'),_0x5721bc+'-'+_0xfb3dd8+'/'+_0x591031)['json'](_0x1ba716);}return null;};}function patchUpdates(_0x2f22e3){return function(_0x182d41){try{jsonpatch[_0x6ad1('0x1f')](_0x182d41,_0x2f22e3,!![]);}catch(_0x833dbd){return BPromise[_0x6ad1('0x20')](_0x833dbd);}return _0x182d41[_0x6ad1('0x21')]();};}function saveUpdates(_0x598f42,_0x191be4){return function(_0x5ddfc3){if(_0x5ddfc3){return _0x5ddfc3[_0x6ad1('0x22')](_0x598f42)[_0x6ad1('0x23')](function(_0x461843){return _0x461843;});}return null;};}function removeEntity(_0xe81785,_0x4a4166){return function(_0x58b15d){if(_0x58b15d){return _0x58b15d[_0x6ad1('0x24')]()['then'](function(){_0xe81785[_0x6ad1('0x17')](0xcc)[_0x6ad1('0x25')]();});}};}function handleEntityNotFound(_0x38863a,_0x4084dc){return function(_0x35b649){if(!_0x35b649){_0x38863a[_0x6ad1('0x16')](0x194);}return _0x35b649;};}function handleError(_0x4af396,_0x468a8f){_0x468a8f=_0x468a8f||0x1f4;return function(_0x38ccb4){logger[_0x6ad1('0x26')](_0x38ccb4[_0x6ad1('0x27')]);if(_0x38ccb4[_0x6ad1('0x28')]){delete _0x38ccb4[_0x6ad1('0x28')];}_0x4af396[_0x6ad1('0x17')](_0x468a8f)['send'](_0x38ccb4);};}exports[_0x6ad1('0x29')]=function(_0x1449f1,_0x4e8cd8){var _0x1ba048={},_0x41ac52={},_0x12f555={'count':0x0,'rows':[]};var _0x58d499=_[_0x6ad1('0x2a')](db['FreshsalesConfiguration'][_0x6ad1('0x2b')],function(_0x1e2115){return{'name':_0x1e2115[_0x6ad1('0x2c')],'type':_0x1e2115[_0x6ad1('0x2d')][_0x6ad1('0x2e')]};});_0x41ac52['model']=_['map'](_0x58d499,_0x6ad1('0x28'));_0x41ac52[_0x6ad1('0x2f')]=_[_0x6ad1('0x30')](_0x1449f1['query']);_0x41ac52[_0x6ad1('0x31')]=_[_0x6ad1('0x32')](_0x41ac52['model'],_0x41ac52[_0x6ad1('0x2f')]);_0x1ba048['attributes']=_[_0x6ad1('0x32')](_0x41ac52['model'],qs[_0x6ad1('0x33')](_0x1449f1[_0x6ad1('0x2f')][_0x6ad1('0x33')]));_0x1ba048[_0x6ad1('0x34')]=_0x1ba048[_0x6ad1('0x34')][_0x6ad1('0x35')]?_0x1ba048[_0x6ad1('0x34')]:_0x41ac52[_0x6ad1('0x36')];if(!_0x1449f1['query'][_0x6ad1('0x37')]('nolimit')){_0x1ba048[_0x6ad1('0x1b')]=qs['limit'](_0x1449f1[_0x6ad1('0x2f')][_0x6ad1('0x1b')]);_0x1ba048[_0x6ad1('0x19')]=qs[_0x6ad1('0x19')](_0x1449f1[_0x6ad1('0x2f')]['offset']);}_0x1ba048[_0x6ad1('0x38')]=qs[_0x6ad1('0x39')](_0x1449f1[_0x6ad1('0x2f')][_0x6ad1('0x39')]);_0x1ba048['where']=qs[_0x6ad1('0x31')](_['pick'](_0x1449f1[_0x6ad1('0x2f')],_0x41ac52[_0x6ad1('0x31')]),_0x58d499);if(_0x1449f1[_0x6ad1('0x2f')][_0x6ad1('0x3a')]){_0x1ba048['where']=_['merge'](_0x1ba048[_0x6ad1('0x3b')],{'$or':_[_0x6ad1('0x2a')](_0x58d499,function(_0x25d4ef){if(_0x25d4ef[_0x6ad1('0x2d')]!==_0x6ad1('0x3c')){var _0x352842={};_0x352842[_0x25d4ef[_0x6ad1('0x28')]]={'$like':'%'+_0x1449f1[_0x6ad1('0x2f')][_0x6ad1('0x3a')]+'%'};return _0x352842;}})});}_0x1ba048=_[_0x6ad1('0x3d')]({},_0x1ba048,_0x1449f1[_0x6ad1('0x3e')]);var _0x3899d9={'where':_0x1ba048[_0x6ad1('0x3b')]};return db[_0x6ad1('0x3f')][_0x6ad1('0x1c')](_0x3899d9)[_0x6ad1('0x23')](function(_0xcf9d59){_0x12f555[_0x6ad1('0x1c')]=_0xcf9d59;if(_0x1449f1['query']['includeAll']){_0x1ba048['include']=[{'all':!![]}];}return db['FreshsalesConfiguration']['findAll'](_0x1ba048);})[_0x6ad1('0x23')](function(_0x3b24b3){_0x12f555[_0x6ad1('0x40')]=_0x3b24b3;return _0x12f555;})['then'](respondWithFilteredResult(_0x4e8cd8,_0x1ba048))[_0x6ad1('0x41')](handleError(_0x4e8cd8,null));};exports[_0x6ad1('0x42')]=function(_0x78c44d,_0x56717f){var _0xaa736e={'raw':![],'where':{'id':_0x78c44d[_0x6ad1('0x43')]['id']}},_0x43b222={};_0x43b222['model']=_[_0x6ad1('0x30')](db[_0x6ad1('0x3f')][_0x6ad1('0x2b')]);_0x43b222['query']=_[_0x6ad1('0x30')](_0x78c44d['query']);_0x43b222['filters']=_[_0x6ad1('0x32')](_0x43b222['model'],_0x43b222[_0x6ad1('0x2f')]);_0xaa736e[_0x6ad1('0x34')]=_[_0x6ad1('0x32')](_0x43b222[_0x6ad1('0x36')],qs[_0x6ad1('0x33')](_0x78c44d[_0x6ad1('0x2f')][_0x6ad1('0x33')]));_0xaa736e[_0x6ad1('0x34')]=_0xaa736e[_0x6ad1('0x34')][_0x6ad1('0x35')]?_0xaa736e[_0x6ad1('0x34')]:_0x43b222[_0x6ad1('0x36')];if(_0x78c44d[_0x6ad1('0x2f')][_0x6ad1('0x44')]){_0xaa736e[_0x6ad1('0x45')]=[{'all':!![]}];}_0xaa736e=_[_0x6ad1('0x3d')]({},_0xaa736e,_0x78c44d[_0x6ad1('0x3e')]);return db[_0x6ad1('0x3f')]['find'](_0xaa736e)[_0x6ad1('0x23')](handleEntityNotFound(_0x56717f,null))['then'](respondWithResult(_0x56717f,null))[_0x6ad1('0x41')](handleError(_0x56717f,null));};exports[_0x6ad1('0x46')]=function(_0x29d8ee,_0x335093){return db[_0x6ad1('0x3f')][_0x6ad1('0x46')](_0x29d8ee['body'],{})[_0x6ad1('0x23')](respondWithResult(_0x335093,0xc9))[_0x6ad1('0x41')](handleError(_0x335093,null));};exports['update']=function(_0x23d501,_0x8d6b25){if(_0x23d501[_0x6ad1('0x47')]['id']){delete _0x23d501[_0x6ad1('0x47')]['id'];}return db[_0x6ad1('0x3f')]['find']({'where':{'id':_0x23d501[_0x6ad1('0x43')]['id']}})['then'](handleEntityNotFound(_0x8d6b25,null))['then'](saveUpdates(_0x23d501[_0x6ad1('0x47')],null))[_0x6ad1('0x23')](respondWithResult(_0x8d6b25,null))[_0x6ad1('0x41')](handleError(_0x8d6b25,null));};exports[_0x6ad1('0x24')]=function(_0x10cab2,_0x2084e0){return db[_0x6ad1('0x3f')][_0x6ad1('0x48')]({'where':{'id':_0x10cab2['params']['id']}})[_0x6ad1('0x23')](handleEntityNotFound(_0x2084e0,null))[_0x6ad1('0x23')](removeEntity(_0x2084e0,null))[_0x6ad1('0x41')](handleError(_0x2084e0,null));};exports[_0x6ad1('0x49')]=function(_0x1c708f,_0x411503,_0x415337){var _0x2c3aa0={};var _0x57d843={};var _0x24951a;var _0x395083;return db[_0x6ad1('0x3f')]['findOne']({'where':{'id':_0x1c708f['params']['id']}})[_0x6ad1('0x23')](handleEntityNotFound(_0x411503,null))[_0x6ad1('0x23')](function(_0x302f4f){if(_0x302f4f){_0x24951a=_0x302f4f;_0x57d843[_0x6ad1('0x36')]=_['keys'](db[_0x6ad1('0x4a')][_0x6ad1('0x2b')]);_0x57d843[_0x6ad1('0x2f')]=_[_0x6ad1('0x30')](_0x1c708f[_0x6ad1('0x2f')]);_0x57d843[_0x6ad1('0x31')]=_['intersection'](_0x57d843['model'],_0x57d843['query']);_0x2c3aa0['attributes']=_[_0x6ad1('0x32')](_0x57d843[_0x6ad1('0x36')],qs[_0x6ad1('0x33')](_0x1c708f[_0x6ad1('0x2f')]['fields']));_0x2c3aa0[_0x6ad1('0x34')]=_0x2c3aa0[_0x6ad1('0x34')]['length']?_0x2c3aa0[_0x6ad1('0x34')]:_0x57d843['model'];_0x2c3aa0[_0x6ad1('0x38')]=qs[_0x6ad1('0x39')](_0x1c708f['query']['sort']);_0x2c3aa0[_0x6ad1('0x3b')]=qs['filters'](_[_0x6ad1('0x4b')](_0x1c708f[_0x6ad1('0x2f')],_0x57d843[_0x6ad1('0x31')]));if(_0x1c708f['query'][_0x6ad1('0x3a')]){_0x2c3aa0['where']=_[_0x6ad1('0x3d')](_0x2c3aa0['where'],{'$or':_[_0x6ad1('0x2a')](_0x2c3aa0[_0x6ad1('0x34')],function(_0x2c8653){var _0x3a7c09={};_0x3a7c09[_0x2c8653]={'$like':'%'+_0x1c708f[_0x6ad1('0x2f')][_0x6ad1('0x3a')]+'%'};return _0x3a7c09;})});}_0x2c3aa0=_[_0x6ad1('0x3d')]({},_0x2c3aa0,_0x1c708f[_0x6ad1('0x3e')]);return _0x24951a[_0x6ad1('0x49')](_0x2c3aa0);}})[_0x6ad1('0x23')](function(_0x2e79a6){if(_0x2e79a6){_0x395083=_0x2e79a6[_0x6ad1('0x35')];if(!_0x1c708f[_0x6ad1('0x2f')]['hasOwnProperty'](_0x6ad1('0x4c'))){_0x2c3aa0[_0x6ad1('0x1b')]=qs[_0x6ad1('0x1b')](_0x1c708f['query'][_0x6ad1('0x1b')]);_0x2c3aa0[_0x6ad1('0x19')]=qs['offset'](_0x1c708f[_0x6ad1('0x2f')][_0x6ad1('0x19')]);}return _0x24951a[_0x6ad1('0x49')](_0x2c3aa0);}})['then'](function(_0x2f74d8){if(_0x2f74d8){return _0x2f74d8?{'count':_0x395083,'rows':_0x2f74d8}:null;}})[_0x6ad1('0x23')](respondWithResult(_0x411503,null))['catch'](handleError(_0x411503,null));};exports[_0x6ad1('0x4d')]=function(_0x1b0d3e,_0x58fb71,_0x363023){var _0x3b73d6={};var _0x41426d={};var _0x551ee4;var _0x21d42f;return db[_0x6ad1('0x3f')][_0x6ad1('0x4e')]({'where':{'id':_0x1b0d3e[_0x6ad1('0x43')]['id']}})[_0x6ad1('0x23')](handleEntityNotFound(_0x58fb71,null))[_0x6ad1('0x23')](function(_0x160135){if(_0x160135){_0x551ee4=_0x160135;_0x41426d['model']=_[_0x6ad1('0x30')](db[_0x6ad1('0x4a')][_0x6ad1('0x2b')]);_0x41426d['query']=_[_0x6ad1('0x30')](_0x1b0d3e[_0x6ad1('0x2f')]);_0x41426d['filters']=_[_0x6ad1('0x32')](_0x41426d[_0x6ad1('0x36')],_0x41426d[_0x6ad1('0x2f')]);_0x3b73d6[_0x6ad1('0x34')]=_['intersection'](_0x41426d[_0x6ad1('0x36')],qs[_0x6ad1('0x33')](_0x1b0d3e[_0x6ad1('0x2f')][_0x6ad1('0x33')]));_0x3b73d6[_0x6ad1('0x34')]=_0x3b73d6[_0x6ad1('0x34')][_0x6ad1('0x35')]?_0x3b73d6[_0x6ad1('0x34')]:_0x41426d[_0x6ad1('0x36')];_0x3b73d6[_0x6ad1('0x38')]=qs[_0x6ad1('0x39')](_0x1b0d3e[_0x6ad1('0x2f')][_0x6ad1('0x39')]);_0x3b73d6[_0x6ad1('0x3b')]=qs[_0x6ad1('0x31')](_[_0x6ad1('0x4b')](_0x1b0d3e[_0x6ad1('0x2f')],_0x41426d[_0x6ad1('0x31')]));if(_0x1b0d3e[_0x6ad1('0x2f')][_0x6ad1('0x3a')]){_0x3b73d6[_0x6ad1('0x3b')]=_[_0x6ad1('0x3d')](_0x3b73d6[_0x6ad1('0x3b')],{'$or':_[_0x6ad1('0x2a')](_0x3b73d6[_0x6ad1('0x34')],function(_0x2cfcad){var _0x562283={};_0x562283[_0x2cfcad]={'$like':'%'+_0x1b0d3e[_0x6ad1('0x2f')][_0x6ad1('0x3a')]+'%'};return _0x562283;})});}_0x3b73d6=_[_0x6ad1('0x3d')]({},_0x3b73d6,_0x1b0d3e[_0x6ad1('0x3e')]);return _0x551ee4[_0x6ad1('0x4d')](_0x3b73d6);}})[_0x6ad1('0x23')](function(_0x54c374){if(_0x54c374){_0x21d42f=_0x54c374[_0x6ad1('0x35')];if(!_0x1b0d3e[_0x6ad1('0x2f')][_0x6ad1('0x37')](_0x6ad1('0x4c'))){_0x3b73d6[_0x6ad1('0x1b')]=qs[_0x6ad1('0x1b')](_0x1b0d3e[_0x6ad1('0x2f')][_0x6ad1('0x1b')]);_0x3b73d6[_0x6ad1('0x19')]=qs[_0x6ad1('0x19')](_0x1b0d3e[_0x6ad1('0x2f')][_0x6ad1('0x19')]);}return _0x551ee4['getDescriptions'](_0x3b73d6);}})[_0x6ad1('0x23')](function(_0x283f0c){if(_0x283f0c){return _0x283f0c?{'count':_0x21d42f,'rows':_0x283f0c}:null;}})[_0x6ad1('0x23')](respondWithResult(_0x58fb71,null))['catch'](handleError(_0x58fb71,null));};exports['getFields']=function(_0x196b1c,_0x796d33,_0x424f39){var _0x43078a={};var _0x588c0e={};var _0x261818;var _0x3d0562;return db[_0x6ad1('0x3f')]['findOne']({'where':{'id':_0x196b1c['params']['id']}})[_0x6ad1('0x23')](handleEntityNotFound(_0x796d33,null))[_0x6ad1('0x23')](function(_0x340aa2){if(_0x340aa2){_0x261818=_0x340aa2;_0x588c0e[_0x6ad1('0x36')]=_[_0x6ad1('0x30')](db[_0x6ad1('0x4a')]['rawAttributes']);_0x588c0e[_0x6ad1('0x2f')]=_[_0x6ad1('0x30')](_0x196b1c[_0x6ad1('0x2f')]);_0x588c0e['filters']=_[_0x6ad1('0x32')](_0x588c0e[_0x6ad1('0x36')],_0x588c0e[_0x6ad1('0x2f')]);_0x43078a[_0x6ad1('0x34')]=_['intersection'](_0x588c0e['model'],qs['fields'](_0x196b1c[_0x6ad1('0x2f')]['fields']));_0x43078a[_0x6ad1('0x34')]=_0x43078a[_0x6ad1('0x34')][_0x6ad1('0x35')]?_0x43078a[_0x6ad1('0x34')]:_0x588c0e[_0x6ad1('0x36')];_0x43078a[_0x6ad1('0x38')]=qs[_0x6ad1('0x39')](_0x196b1c[_0x6ad1('0x2f')][_0x6ad1('0x39')]);_0x43078a[_0x6ad1('0x3b')]=qs['filters'](_['pick'](_0x196b1c[_0x6ad1('0x2f')],_0x588c0e[_0x6ad1('0x31')]));if(_0x196b1c[_0x6ad1('0x2f')]['filter']){_0x43078a[_0x6ad1('0x3b')]=_['merge'](_0x43078a[_0x6ad1('0x3b')],{'$or':_['map'](_0x43078a[_0x6ad1('0x34')],function(_0xee4f9f){var _0x5d75e5={};_0x5d75e5[_0xee4f9f]={'$like':'%'+_0x196b1c[_0x6ad1('0x2f')][_0x6ad1('0x3a')]+'%'};return _0x5d75e5;})});}_0x43078a=_[_0x6ad1('0x3d')]({},_0x43078a,_0x196b1c[_0x6ad1('0x3e')]);return _0x261818['getFields'](_0x43078a);}})[_0x6ad1('0x23')](function(_0x5ac0d1){if(_0x5ac0d1){_0x3d0562=_0x5ac0d1['length'];if(!_0x196b1c[_0x6ad1('0x2f')][_0x6ad1('0x37')](_0x6ad1('0x4c'))){_0x43078a[_0x6ad1('0x1b')]=qs[_0x6ad1('0x1b')](_0x196b1c[_0x6ad1('0x2f')][_0x6ad1('0x1b')]);_0x43078a[_0x6ad1('0x19')]=qs[_0x6ad1('0x19')](_0x196b1c[_0x6ad1('0x2f')][_0x6ad1('0x19')]);}return _0x261818[_0x6ad1('0x4f')](_0x43078a);}})[_0x6ad1('0x23')](function(_0x452cc4){if(_0x452cc4){return _0x452cc4?{'count':_0x3d0562,'rows':_0x452cc4}:null;}})[_0x6ad1('0x23')](respondWithResult(_0x796d33,null))[_0x6ad1('0x41')](handleError(_0x796d33,null));}; \ No newline at end of file +var _0x33c9=['findAll','rows','catch','show','params','keys','create','body','find','findOne','order','getSubjects','nolimit','getDescriptions','FreshsalesField','pick','getFields','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','apply','save','update','then','destroy','error','stack','name','index','map','FreshsalesConfiguration','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','options','includeAll','include'];(function(_0xf3c10d,_0x524a9c){var _0x361e7e=function(_0x371c76){while(--_0x371c76){_0xf3c10d['push'](_0xf3c10d['shift']());}};_0x361e7e(++_0x524a9c);}(_0x33c9,0x104));var _0x933c=function(_0x312011,_0x26f15c){_0x312011=_0x312011-0x0;var _0x5b99db=_0x33c9[_0x312011];return _0x5b99db;};'use strict';var emlformat=require(_0x933c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x933c('0x1'));var jsonpatch=require(_0x933c('0x2'));var rp=require(_0x933c('0x3'));var moment=require(_0x933c('0x4'));var BPromise=require(_0x933c('0x5'));var Mustache=require(_0x933c('0x6'));var util=require(_0x933c('0x7'));var path=require('path');var sox=require(_0x933c('0x8'));var csv=require(_0x933c('0x9'));var ejs=require(_0x933c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x933c('0xb'));var squel=require(_0x933c('0xc'));var crypto=require(_0x933c('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x933c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x933c('0xf'));var Papa=require(_0x933c('0x10'));var Redis=require(_0x933c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x933c('0x12'));var as=require(_0x933c('0x13'));var hardwareService=require(_0x933c('0x14'));var logger=require(_0x933c('0x15'))('api');var utils=require(_0x933c('0x16'));var config=require(_0x933c('0x17'));var licenseUtil=require(_0x933c('0x18'));var db=require(_0x933c('0x19'))['db'];function respondWithStatusCode(_0x141e30,_0x5735be){_0x5735be=_0x5735be||0xcc;return function(_0x1f36be){if(_0x1f36be){return _0x141e30[_0x933c('0x1a')](_0x5735be);}return _0x141e30['status'](_0x5735be)[_0x933c('0x1b')]();};}function respondWithResult(_0x1db4f4,_0x42f95f){_0x42f95f=_0x42f95f||0xc8;return function(_0x18a565){if(_0x18a565){return _0x1db4f4[_0x933c('0x1c')](_0x42f95f)[_0x933c('0x1d')](_0x18a565);}};}function respondWithFilteredResult(_0x57cb72,_0x4a7da6){return function(_0x48ee6e){if(_0x48ee6e){var _0x3a1e08=typeof _0x4a7da6[_0x933c('0x1e')]===_0x933c('0x1f')&&typeof _0x4a7da6['limit']==='undefined';var _0x19cd1c=_0x48ee6e['count'];var _0x573289=_0x3a1e08?0x0:_0x4a7da6['offset'];var _0x222199=_0x3a1e08?_0x48ee6e[_0x933c('0x20')]:_0x4a7da6[_0x933c('0x1e')]+_0x4a7da6[_0x933c('0x21')];var _0x38a943;if(_0x222199>=_0x19cd1c){_0x222199=_0x19cd1c;_0x38a943=0xc8;}else{_0x38a943=0xce;}_0x57cb72[_0x933c('0x1c')](_0x38a943);return _0x57cb72[_0x933c('0x22')]('Content-Range',_0x573289+'-'+_0x222199+'/'+_0x19cd1c)[_0x933c('0x1d')](_0x48ee6e);}return null;};}function patchUpdates(_0x32b8ba){return function(_0x53b31b){try{jsonpatch[_0x933c('0x23')](_0x53b31b,_0x32b8ba,!![]);}catch(_0x42a54){return BPromise['reject'](_0x42a54);}return _0x53b31b[_0x933c('0x24')]();};}function saveUpdates(_0x2fc4ff,_0x4458c5){return function(_0x534367){if(_0x534367){return _0x534367[_0x933c('0x25')](_0x2fc4ff)[_0x933c('0x26')](function(_0x399b7b){return _0x399b7b;});}return null;};}function removeEntity(_0x6c3985,_0x557140){return function(_0x3e77b9){if(_0x3e77b9){return _0x3e77b9[_0x933c('0x27')]()[_0x933c('0x26')](function(){_0x6c3985[_0x933c('0x1c')](0xcc)[_0x933c('0x1b')]();});}};}function handleEntityNotFound(_0x3381d6,_0x55270d){return function(_0x122836){if(!_0x122836){_0x3381d6['sendStatus'](0x194);}return _0x122836;};}function handleError(_0x5b4b4b,_0x2b5ea8){_0x2b5ea8=_0x2b5ea8||0x1f4;return function(_0x41600b){logger[_0x933c('0x28')](_0x41600b[_0x933c('0x29')]);if(_0x41600b[_0x933c('0x2a')]){delete _0x41600b[_0x933c('0x2a')];}_0x5b4b4b['status'](_0x2b5ea8)['send'](_0x41600b);};}exports[_0x933c('0x2b')]=function(_0x980bf4,_0x3be491){var _0x43d4f2={},_0x3e4d3d={},_0x258396={'count':0x0,'rows':[]};var _0xf5ebef=_[_0x933c('0x2c')](db[_0x933c('0x2d')][_0x933c('0x2e')],function(_0x1d7bdd){return{'name':_0x1d7bdd['fieldName'],'type':_0x1d7bdd[_0x933c('0x2f')][_0x933c('0x30')]};});_0x3e4d3d[_0x933c('0x31')]=_['map'](_0xf5ebef,_0x933c('0x2a'));_0x3e4d3d[_0x933c('0x32')]=_['keys'](_0x980bf4[_0x933c('0x32')]);_0x3e4d3d[_0x933c('0x33')]=_[_0x933c('0x34')](_0x3e4d3d[_0x933c('0x31')],_0x3e4d3d[_0x933c('0x32')]);_0x43d4f2[_0x933c('0x35')]=_[_0x933c('0x34')](_0x3e4d3d[_0x933c('0x31')],qs[_0x933c('0x36')](_0x980bf4[_0x933c('0x32')]['fields']));_0x43d4f2[_0x933c('0x35')]=_0x43d4f2[_0x933c('0x35')][_0x933c('0x37')]?_0x43d4f2[_0x933c('0x35')]:_0x3e4d3d[_0x933c('0x31')];if(!_0x980bf4[_0x933c('0x32')][_0x933c('0x38')]('nolimit')){_0x43d4f2[_0x933c('0x21')]=qs['limit'](_0x980bf4[_0x933c('0x32')]['limit']);_0x43d4f2[_0x933c('0x1e')]=qs[_0x933c('0x1e')](_0x980bf4['query'][_0x933c('0x1e')]);}_0x43d4f2['order']=qs[_0x933c('0x39')](_0x980bf4[_0x933c('0x32')][_0x933c('0x39')]);_0x43d4f2[_0x933c('0x3a')]=qs[_0x933c('0x33')](_['pick'](_0x980bf4[_0x933c('0x32')],_0x3e4d3d[_0x933c('0x33')]),_0xf5ebef);if(_0x980bf4['query'][_0x933c('0x3b')]){_0x43d4f2[_0x933c('0x3a')]=_['merge'](_0x43d4f2[_0x933c('0x3a')],{'$or':_[_0x933c('0x2c')](_0xf5ebef,function(_0x62ccff){if(_0x62ccff['type']!=='VIRTUAL'){var _0xd6a245={};_0xd6a245[_0x62ccff[_0x933c('0x2a')]]={'$like':'%'+_0x980bf4[_0x933c('0x32')][_0x933c('0x3b')]+'%'};return _0xd6a245;}})});}_0x43d4f2=_[_0x933c('0x3c')]({},_0x43d4f2,_0x980bf4[_0x933c('0x3d')]);var _0x4754b4={'where':_0x43d4f2['where']};return db[_0x933c('0x2d')][_0x933c('0x20')](_0x4754b4)[_0x933c('0x26')](function(_0x420e6c){_0x258396[_0x933c('0x20')]=_0x420e6c;if(_0x980bf4[_0x933c('0x32')][_0x933c('0x3e')]){_0x43d4f2[_0x933c('0x3f')]=[{'all':!![]}];}return db[_0x933c('0x2d')][_0x933c('0x40')](_0x43d4f2);})[_0x933c('0x26')](function(_0xe0824c){_0x258396[_0x933c('0x41')]=_0xe0824c;return _0x258396;})['then'](respondWithFilteredResult(_0x3be491,_0x43d4f2))[_0x933c('0x42')](handleError(_0x3be491,null));};exports[_0x933c('0x43')]=function(_0x2ccede,_0x363eaa){var _0x326b21={'raw':![],'where':{'id':_0x2ccede[_0x933c('0x44')]['id']}},_0x29eebe={};_0x29eebe[_0x933c('0x31')]=_[_0x933c('0x45')](db['FreshsalesConfiguration'][_0x933c('0x2e')]);_0x29eebe[_0x933c('0x32')]=_['keys'](_0x2ccede[_0x933c('0x32')]);_0x29eebe[_0x933c('0x33')]=_[_0x933c('0x34')](_0x29eebe['model'],_0x29eebe[_0x933c('0x32')]);_0x326b21[_0x933c('0x35')]=_[_0x933c('0x34')](_0x29eebe[_0x933c('0x31')],qs['fields'](_0x2ccede[_0x933c('0x32')][_0x933c('0x36')]));_0x326b21['attributes']=_0x326b21[_0x933c('0x35')][_0x933c('0x37')]?_0x326b21[_0x933c('0x35')]:_0x29eebe[_0x933c('0x31')];if(_0x2ccede[_0x933c('0x32')][_0x933c('0x3e')]){_0x326b21[_0x933c('0x3f')]=[{'all':!![]}];}_0x326b21=_[_0x933c('0x3c')]({},_0x326b21,_0x2ccede[_0x933c('0x3d')]);return db['FreshsalesConfiguration']['find'](_0x326b21)[_0x933c('0x26')](handleEntityNotFound(_0x363eaa,null))[_0x933c('0x26')](respondWithResult(_0x363eaa,null))[_0x933c('0x42')](handleError(_0x363eaa,null));};exports[_0x933c('0x46')]=function(_0xe7071b,_0x371948){return db[_0x933c('0x2d')][_0x933c('0x46')](_0xe7071b[_0x933c('0x47')],{})[_0x933c('0x26')](respondWithResult(_0x371948,0xc9))['catch'](handleError(_0x371948,null));};exports[_0x933c('0x25')]=function(_0x96f50c,_0x4a340e){if(_0x96f50c[_0x933c('0x47')]['id']){delete _0x96f50c['body']['id'];}return db['FreshsalesConfiguration'][_0x933c('0x48')]({'where':{'id':_0x96f50c['params']['id']}})[_0x933c('0x26')](handleEntityNotFound(_0x4a340e,null))[_0x933c('0x26')](saveUpdates(_0x96f50c[_0x933c('0x47')],null))[_0x933c('0x26')](respondWithResult(_0x4a340e,null))[_0x933c('0x42')](handleError(_0x4a340e,null));};exports['destroy']=function(_0xd1595f,_0x2bcba6){return db[_0x933c('0x2d')][_0x933c('0x48')]({'where':{'id':_0xd1595f['params']['id']}})[_0x933c('0x26')](handleEntityNotFound(_0x2bcba6,null))[_0x933c('0x26')](removeEntity(_0x2bcba6,null))[_0x933c('0x42')](handleError(_0x2bcba6,null));};exports['getSubjects']=function(_0x4d33fd,_0x3c9ae0,_0x31cc18){var _0xdaee7b={};var _0x2ec23f={};var _0x314e55;var _0x217632;return db[_0x933c('0x2d')][_0x933c('0x49')]({'where':{'id':_0x4d33fd[_0x933c('0x44')]['id']}})[_0x933c('0x26')](handleEntityNotFound(_0x3c9ae0,null))[_0x933c('0x26')](function(_0x2f8b1d){if(_0x2f8b1d){_0x314e55=_0x2f8b1d;_0x2ec23f['model']=_['keys'](db['FreshsalesField']['rawAttributes']);_0x2ec23f[_0x933c('0x32')]=_[_0x933c('0x45')](_0x4d33fd['query']);_0x2ec23f['filters']=_[_0x933c('0x34')](_0x2ec23f['model'],_0x2ec23f[_0x933c('0x32')]);_0xdaee7b[_0x933c('0x35')]=_[_0x933c('0x34')](_0x2ec23f[_0x933c('0x31')],qs[_0x933c('0x36')](_0x4d33fd[_0x933c('0x32')][_0x933c('0x36')]));_0xdaee7b[_0x933c('0x35')]=_0xdaee7b['attributes'][_0x933c('0x37')]?_0xdaee7b[_0x933c('0x35')]:_0x2ec23f['model'];_0xdaee7b[_0x933c('0x4a')]=qs[_0x933c('0x39')](_0x4d33fd['query'][_0x933c('0x39')]);_0xdaee7b['where']=qs[_0x933c('0x33')](_['pick'](_0x4d33fd[_0x933c('0x32')],_0x2ec23f[_0x933c('0x33')]));if(_0x4d33fd['query'][_0x933c('0x3b')]){_0xdaee7b[_0x933c('0x3a')]=_[_0x933c('0x3c')](_0xdaee7b['where'],{'$or':_[_0x933c('0x2c')](_0xdaee7b[_0x933c('0x35')],function(_0x19aef8){var _0x28eace={};_0x28eace[_0x19aef8]={'$like':'%'+_0x4d33fd['query']['filter']+'%'};return _0x28eace;})});}_0xdaee7b=_[_0x933c('0x3c')]({},_0xdaee7b,_0x4d33fd[_0x933c('0x3d')]);return _0x314e55[_0x933c('0x4b')](_0xdaee7b);}})[_0x933c('0x26')](function(_0x2cef58){if(_0x2cef58){_0x217632=_0x2cef58[_0x933c('0x37')];if(!_0x4d33fd['query'][_0x933c('0x38')](_0x933c('0x4c'))){_0xdaee7b[_0x933c('0x21')]=qs[_0x933c('0x21')](_0x4d33fd[_0x933c('0x32')][_0x933c('0x21')]);_0xdaee7b[_0x933c('0x1e')]=qs[_0x933c('0x1e')](_0x4d33fd[_0x933c('0x32')][_0x933c('0x1e')]);}return _0x314e55['getSubjects'](_0xdaee7b);}})['then'](function(_0x480de1){if(_0x480de1){return _0x480de1?{'count':_0x217632,'rows':_0x480de1}:null;}})[_0x933c('0x26')](respondWithResult(_0x3c9ae0,null))[_0x933c('0x42')](handleError(_0x3c9ae0,null));};exports[_0x933c('0x4d')]=function(_0x57fff3,_0x55e2f6,_0x4754cd){var _0x5a3995={};var _0x3d53ed={};var _0x4b0a68;var _0x58df52;return db['FreshsalesConfiguration']['findOne']({'where':{'id':_0x57fff3[_0x933c('0x44')]['id']}})[_0x933c('0x26')](handleEntityNotFound(_0x55e2f6,null))[_0x933c('0x26')](function(_0x3fe228){if(_0x3fe228){_0x4b0a68=_0x3fe228;_0x3d53ed[_0x933c('0x31')]=_['keys'](db[_0x933c('0x4e')][_0x933c('0x2e')]);_0x3d53ed[_0x933c('0x32')]=_[_0x933c('0x45')](_0x57fff3[_0x933c('0x32')]);_0x3d53ed[_0x933c('0x33')]=_[_0x933c('0x34')](_0x3d53ed[_0x933c('0x31')],_0x3d53ed[_0x933c('0x32')]);_0x5a3995[_0x933c('0x35')]=_[_0x933c('0x34')](_0x3d53ed[_0x933c('0x31')],qs[_0x933c('0x36')](_0x57fff3[_0x933c('0x32')][_0x933c('0x36')]));_0x5a3995[_0x933c('0x35')]=_0x5a3995[_0x933c('0x35')][_0x933c('0x37')]?_0x5a3995[_0x933c('0x35')]:_0x3d53ed['model'];_0x5a3995[_0x933c('0x4a')]=qs['sort'](_0x57fff3['query']['sort']);_0x5a3995[_0x933c('0x3a')]=qs['filters'](_[_0x933c('0x4f')](_0x57fff3[_0x933c('0x32')],_0x3d53ed[_0x933c('0x33')]));if(_0x57fff3[_0x933c('0x32')][_0x933c('0x3b')]){_0x5a3995['where']=_['merge'](_0x5a3995[_0x933c('0x3a')],{'$or':_['map'](_0x5a3995[_0x933c('0x35')],function(_0x4e7d64){var _0x3af4ef={};_0x3af4ef[_0x4e7d64]={'$like':'%'+_0x57fff3[_0x933c('0x32')][_0x933c('0x3b')]+'%'};return _0x3af4ef;})});}_0x5a3995=_[_0x933c('0x3c')]({},_0x5a3995,_0x57fff3['options']);return _0x4b0a68[_0x933c('0x4d')](_0x5a3995);}})[_0x933c('0x26')](function(_0x3dd1a4){if(_0x3dd1a4){_0x58df52=_0x3dd1a4['length'];if(!_0x57fff3[_0x933c('0x32')][_0x933c('0x38')](_0x933c('0x4c'))){_0x5a3995[_0x933c('0x21')]=qs[_0x933c('0x21')](_0x57fff3[_0x933c('0x32')][_0x933c('0x21')]);_0x5a3995[_0x933c('0x1e')]=qs[_0x933c('0x1e')](_0x57fff3['query'][_0x933c('0x1e')]);}return _0x4b0a68[_0x933c('0x4d')](_0x5a3995);}})[_0x933c('0x26')](function(_0x4f9feb){if(_0x4f9feb){return _0x4f9feb?{'count':_0x58df52,'rows':_0x4f9feb}:null;}})['then'](respondWithResult(_0x55e2f6,null))[_0x933c('0x42')](handleError(_0x55e2f6,null));};exports['getFields']=function(_0x280b68,_0x233642,_0x586087){var _0x4827f7={};var _0x83bc97={};var _0x34db5;var _0x301230;return db[_0x933c('0x2d')][_0x933c('0x49')]({'where':{'id':_0x280b68[_0x933c('0x44')]['id']}})[_0x933c('0x26')](handleEntityNotFound(_0x233642,null))['then'](function(_0x28e5d2){if(_0x28e5d2){_0x34db5=_0x28e5d2;_0x83bc97[_0x933c('0x31')]=_[_0x933c('0x45')](db[_0x933c('0x4e')][_0x933c('0x2e')]);_0x83bc97[_0x933c('0x32')]=_[_0x933c('0x45')](_0x280b68['query']);_0x83bc97[_0x933c('0x33')]=_[_0x933c('0x34')](_0x83bc97[_0x933c('0x31')],_0x83bc97[_0x933c('0x32')]);_0x4827f7[_0x933c('0x35')]=_[_0x933c('0x34')](_0x83bc97['model'],qs[_0x933c('0x36')](_0x280b68[_0x933c('0x32')][_0x933c('0x36')]));_0x4827f7[_0x933c('0x35')]=_0x4827f7[_0x933c('0x35')]['length']?_0x4827f7[_0x933c('0x35')]:_0x83bc97[_0x933c('0x31')];_0x4827f7[_0x933c('0x4a')]=qs[_0x933c('0x39')](_0x280b68[_0x933c('0x32')][_0x933c('0x39')]);_0x4827f7[_0x933c('0x3a')]=qs[_0x933c('0x33')](_[_0x933c('0x4f')](_0x280b68[_0x933c('0x32')],_0x83bc97[_0x933c('0x33')]));if(_0x280b68[_0x933c('0x32')]['filter']){_0x4827f7[_0x933c('0x3a')]=_[_0x933c('0x3c')](_0x4827f7[_0x933c('0x3a')],{'$or':_[_0x933c('0x2c')](_0x4827f7['attributes'],function(_0xfb9c7e){var _0x497289={};_0x497289[_0xfb9c7e]={'$like':'%'+_0x280b68[_0x933c('0x32')][_0x933c('0x3b')]+'%'};return _0x497289;})});}_0x4827f7=_[_0x933c('0x3c')]({},_0x4827f7,_0x280b68[_0x933c('0x3d')]);return _0x34db5[_0x933c('0x50')](_0x4827f7);}})['then'](function(_0x3f47ef){if(_0x3f47ef){_0x301230=_0x3f47ef[_0x933c('0x37')];if(!_0x280b68[_0x933c('0x32')][_0x933c('0x38')](_0x933c('0x4c'))){_0x4827f7[_0x933c('0x21')]=qs[_0x933c('0x21')](_0x280b68[_0x933c('0x32')]['limit']);_0x4827f7['offset']=qs[_0x933c('0x1e')](_0x280b68['query'][_0x933c('0x1e')]);}return _0x34db5['getFields'](_0x4827f7);}})[_0x933c('0x26')](function(_0x28f1f1){if(_0x28f1f1){return _0x28f1f1?{'count':_0x301230,'rows':_0x28f1f1}:null;}})[_0x933c('0x26')](respondWithResult(_0x233642,null))['catch'](handleError(_0x233642,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 8f4c017..6f1dc60 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 _0xfbee=['FreshsalesConfiguration','int_freshsales_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intFreshsalesConfiguration.attributes','exports'];(function(_0xf51c06,_0x388e5b){var _0x1d5420=function(_0x5e077b){while(--_0x5e077b){_0xf51c06['push'](_0xf51c06['shift']());}};_0x1d5420(++_0x388e5b);}(_0xfbee,0x16e));var _0xefbe=function(_0x3825f5,_0xf7f8b0){_0x3825f5=_0x3825f5-0x0;var _0x185be9=_0xfbee[_0x3825f5];return _0x185be9;};'use strict';var _=require(_0xefbe('0x0'));var util=require(_0xefbe('0x1'));var logger=require(_0xefbe('0x2'))(_0xefbe('0x3'));var moment=require(_0xefbe('0x4'));var BPromise=require(_0xefbe('0x5'));var rp=require(_0xefbe('0x6'));var fs=require('fs');var path=require(_0xefbe('0x7'));var rimraf=require(_0xefbe('0x8'));var config=require('../../config/environment');var attributes=require(_0xefbe('0x9'));module[_0xefbe('0xa')]=function(_0x4e3412,_0x5d1d0a){return _0x4e3412['define'](_0xefbe('0xb'),attributes,{'tableName':_0xefbe('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf87f=['path','rimraf','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','int_freshsales_configurations','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x42caf9,_0x9408f1){var _0x29b26e=function(_0x4daf0f){while(--_0x4daf0f){_0x42caf9['push'](_0x42caf9['shift']());}};_0x29b26e(++_0x9408f1);}(_0xf87f,0x157));var _0xff87=function(_0x45d174,_0x47c6bb){_0x45d174=_0x45d174-0x0;var _0x3a0128=_0xf87f[_0x45d174];return _0x3a0128;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xff87('0x0'))(_0xff87('0x1'));var moment=require(_0xff87('0x2'));var BPromise=require(_0xff87('0x3'));var rp=require(_0xff87('0x4'));var fs=require('fs');var path=require(_0xff87('0x5'));var rimraf=require(_0xff87('0x6'));var config=require('../../config/environment');var attributes=require(_0xff87('0x7'));module[_0xff87('0x8')]=function(_0x5613d2,_0x3a844){return _0x5613d2[_0xff87('0x9')](_0xff87('0xa'),attributes,{'tableName':_0xff87('0xb'),'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 8b5dd95..1ef4057 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 _0xd14c=['rpc','../../config/environment','jayson/promise','request','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5ad5f0,_0x484b49){var _0x2d8865=function(_0x1575ed){while(--_0x1575ed){_0x5ad5f0['push'](_0x5ad5f0['shift']());}};_0x2d8865(++_0x484b49);}(_0xd14c,0x1db));var _0xcd14=function(_0x5d0fcf,_0xa23aa1){_0x5d0fcf=_0x5d0fcf-0x0;var _0x40c760=_0xd14c[_0x5d0fcf];return _0x40c760;};'use strict';var _=require(_0xcd14('0x0'));var util=require(_0xcd14('0x1'));var moment=require(_0xcd14('0x2'));var BPromise=require(_0xcd14('0x3'));var rs=require(_0xcd14('0x4'));var fs=require('fs');var Redis=require(_0xcd14('0x5'));var db=require(_0xcd14('0x6'))['db'];var utils=require(_0xcd14('0x7'));var logger=require(_0xcd14('0x8'))(_0xcd14('0x9'));var config=require(_0xcd14('0xa'));var jayson=require(_0xcd14('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x46319c,_0x70da5c,_0x5839bb){return new BPromise(function(_0xcd3ab6,_0x301196){return client[_0xcd14('0xc')](_0x46319c,_0x5839bb)['then'](function(_0x4db9a5){logger['info'](_0xcd14('0xd'),_0x70da5c,_0xcd14('0xe'));logger[_0xcd14('0xf')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x70da5c,'request\x20sent',JSON[_0xcd14('0x10')](_0x4db9a5));if(_0x4db9a5[_0xcd14('0x11')]){if(_0x4db9a5['error'][_0xcd14('0x12')]===0x1f4){logger[_0xcd14('0x11')](_0xcd14('0xd'),_0x70da5c,_0x4db9a5[_0xcd14('0x11')][_0xcd14('0x13')]);return _0x301196(_0x4db9a5[_0xcd14('0x11')][_0xcd14('0x13')]);}logger['error'](_0xcd14('0xd'),_0x70da5c,_0x4db9a5[_0xcd14('0x11')][_0xcd14('0x13')]);return _0xcd3ab6(_0x4db9a5[_0xcd14('0x11')][_0xcd14('0x13')]);}else{logger[_0xcd14('0x14')](_0xcd14('0xd'),_0x70da5c,_0xcd14('0xe'));_0xcd3ab6(_0x4db9a5[_0xcd14('0x15')][_0xcd14('0x13')]);}})['catch'](function(_0x2b972d){logger[_0xcd14('0x11')](_0xcd14('0xd'),_0x70da5c,_0x2b972d);_0x301196(_0x2b972d);});});} \ No newline at end of file +var _0x2950=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x114fb8,_0x135c70){var _0x1901c7=function(_0x31b3a3){while(--_0x31b3a3){_0x114fb8['push'](_0x114fb8['shift']());}};_0x1901c7(++_0x135c70);}(_0x2950,0x132));var _0x0295=function(_0x568ed1,_0x4b6ee4){_0x568ed1=_0x568ed1-0x0;var _0x562c02=_0x2950[_0x568ed1];return _0x562c02;};'use strict';var _=require(_0x0295('0x0'));var util=require(_0x0295('0x1'));var moment=require(_0x0295('0x2'));var BPromise=require(_0x0295('0x3'));var rs=require(_0x0295('0x4'));var fs=require('fs');var Redis=require(_0x0295('0x5'));var db=require(_0x0295('0x6'))['db'];var utils=require(_0x0295('0x7'));var logger=require(_0x0295('0x8'))(_0x0295('0x9'));var config=require('../../config/environment');var jayson=require(_0x0295('0xa'));var client=jayson[_0x0295('0xb')][_0x0295('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x559bc6,_0x3b07f4,_0x4a3436){return new BPromise(function(_0xf2eae4,_0x1731ca){return client[_0x0295('0xd')](_0x559bc6,_0x4a3436)[_0x0295('0xe')](function(_0x5ef715){logger[_0x0295('0xf')](_0x0295('0x10'),_0x3b07f4,'request\x20sent');logger[_0x0295('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x3b07f4,_0x0295('0x12'),JSON[_0x0295('0x13')](_0x5ef715));if(_0x5ef715[_0x0295('0x14')]){if(_0x5ef715[_0x0295('0x14')][_0x0295('0x15')]===0x1f4){logger[_0x0295('0x14')](_0x0295('0x10'),_0x3b07f4,_0x5ef715[_0x0295('0x14')][_0x0295('0x16')]);return _0x1731ca(_0x5ef715['error'][_0x0295('0x16')]);}logger[_0x0295('0x14')](_0x0295('0x10'),_0x3b07f4,_0x5ef715[_0x0295('0x14')][_0x0295('0x16')]);return _0xf2eae4(_0x5ef715[_0x0295('0x14')]['message']);}else{logger[_0x0295('0xf')](_0x0295('0x10'),_0x3b07f4,'request\x20sent');_0xf2eae4(_0x5ef715['result'][_0x0295('0x16')]);}})[_0x0295('0x17')](function(_0x1edefa){logger[_0x0295('0x14')](_0x0295('0x10'),_0x3b07f4,_0x1edefa);_0x1731ca(_0x1edefa);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 3d16904..edb7dd6 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 _0xbe02=['update','delete','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','/:id','show','post','put'];(function(_0x254a62,_0x44b04f){var _0x4f2f6a=function(_0x2cb4f){while(--_0x2cb4f){_0x254a62['push'](_0x254a62['shift']());}};_0x4f2f6a(++_0x44b04f);}(_0xbe02,0x124));var _0x2be0=function(_0x315063,_0x3d9206){_0x315063=_0x315063-0x0;var _0x4105bd=_0xbe02[_0x315063];return _0x4105bd;};'use strict';var multer=require('multer');var util=require(_0x2be0('0x0'));var path=require(_0x2be0('0x1'));var timeout=require(_0x2be0('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x2be0('0x3'));var auth=require(_0x2be0('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2be0('0x5'));var controller=require(_0x2be0('0x6'));router[_0x2be0('0x7')]('/',auth[_0x2be0('0x8')](),controller[_0x2be0('0x9')]);router[_0x2be0('0x7')](_0x2be0('0xa'),auth['isAuthenticated'](),controller[_0x2be0('0xb')]);router[_0x2be0('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2be0('0xd')]('/:id',auth[_0x2be0('0x8')](),controller[_0x2be0('0xe')]);router[_0x2be0('0xf')](_0x2be0('0xa'),auth[_0x2be0('0x8')](),controller['destroy']);module[_0x2be0('0x10')]=router; \ No newline at end of file +var _0x66fa=['create','update','delete','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','/:id','show'];(function(_0xe32949,_0xcf2cf2){var _0x3e2943=function(_0x2f309c){while(--_0x2f309c){_0xe32949['push'](_0xe32949['shift']());}};_0x3e2943(++_0xcf2cf2);}(_0x66fa,0x168));var _0xa66f=function(_0x494469,_0x1b74ba){_0x494469=_0x494469-0x0;var _0x3cbdd2=_0x66fa[_0x494469];return _0x3cbdd2;};'use strict';var multer=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var path=require(_0xa66f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa66f('0x3')]();var fs_extra=require(_0xa66f('0x4'));var auth=require(_0xa66f('0x5'));var interaction=require(_0xa66f('0x6'));var config=require(_0xa66f('0x7'));var controller=require(_0xa66f('0x8'));router[_0xa66f('0x9')]('/',auth[_0xa66f('0xa')](),controller[_0xa66f('0xb')]);router[_0xa66f('0x9')](_0xa66f('0xc'),auth['isAuthenticated'](),controller[_0xa66f('0xd')]);router['post']('/',auth[_0xa66f('0xa')](),controller[_0xa66f('0xe')]);router['put'](_0xa66f('0xc'),auth[_0xa66f('0xa')](),controller[_0xa66f('0xf')]);router[_0xa66f('0x10')](_0xa66f('0xc'),auth[_0xa66f('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 24c38c9..ae4a6f0 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 _0xf3a9=['BOOLEAN','sequelize','exports','string','variable','keyValue','picklist','STRING','ENUM','customVariable'];(function(_0xadffc4,_0xb45497){var _0x1d63df=function(_0x1a5343){while(--_0x1a5343){_0xadffc4['push'](_0xadffc4['shift']());}};_0x1d63df(++_0xb45497);}(_0xf3a9,0xb5));var _0x9f3a=function(_0x4ef009,_0x19ade1){_0x4ef009=_0x4ef009-0x0;var _0x3c74b4=_0xf3a9[_0x4ef009];return _0x3c74b4;};'use strict';var Sequelize=require(_0x9f3a('0x0'));module[_0x9f3a('0x1')]={'type':{'type':Sequelize['ENUM'](_0x9f3a('0x2'),_0x9f3a('0x3'),'customVariable',_0x9f3a('0x4'),_0x9f3a('0x5')),'defaultValue':_0x9f3a('0x2')},'content':{'type':Sequelize[_0x9f3a('0x6')]},'key':{'type':Sequelize[_0x9f3a('0x6')]},'keyType':{'type':Sequelize[_0x9f3a('0x7')]('string',_0x9f3a('0x3'),_0x9f3a('0x8'))},'keyContent':{'type':Sequelize[_0x9f3a('0x6')]},'idField':{'type':Sequelize[_0x9f3a('0x6')]},'nameField':{'type':Sequelize[_0x9f3a('0x6')]},'customField':{'type':Sequelize[_0x9f3a('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9f3a('0x6')]}}; \ No newline at end of file +var _0x2a95=['sequelize','variable','customVariable','keyValue','string','STRING','BOOLEAN'];(function(_0x4a82ac,_0x1fb931){var _0x58ee97=function(_0xc7050a){while(--_0xc7050a){_0x4a82ac['push'](_0x4a82ac['shift']());}};_0x58ee97(++_0x1fb931);}(_0x2a95,0xd2));var _0x52a9=function(_0x437ad6,_0x23080f){_0x437ad6=_0x437ad6-0x0;var _0x5bc517=_0x2a95[_0x437ad6];return _0x5bc517;};'use strict';var Sequelize=require(_0x52a9('0x0'));module['exports']={'type':{'type':Sequelize['ENUM']('string',_0x52a9('0x1'),_0x52a9('0x2'),_0x52a9('0x3'),'picklist'),'defaultValue':_0x52a9('0x4')},'content':{'type':Sequelize[_0x52a9('0x5')]},'key':{'type':Sequelize[_0x52a9('0x5')]},'keyType':{'type':Sequelize['ENUM']('string',_0x52a9('0x1'),_0x52a9('0x2'))},'keyContent':{'type':Sequelize[_0x52a9('0x5')]},'idField':{'type':Sequelize[_0x52a9('0x5')]},'nameField':{'type':Sequelize[_0x52a9('0x5')]},'customField':{'type':Sequelize[_0x52a9('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x52a9('0x5')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 5bac04d..16bfdd6 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 _0x6158=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','end','error','name','send','map','FreshsalesField','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','include','findAll','rows','catch','show','includeAll','find','create','body','update','params','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis'];(function(_0x52c9f2,_0x202a11){var _0x535949=function(_0x2d77e2){while(--_0x2d77e2){_0x52c9f2['push'](_0x52c9f2['shift']());}};_0x535949(++_0x202a11);}(_0x6158,0x110));var _0x8615=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6158[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8615('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8615('0x1'));var rp=require(_0x8615('0x2'));var moment=require(_0x8615('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8615('0x4'));var path=require(_0x8615('0x5'));var sox=require(_0x8615('0x6'));var csv=require(_0x8615('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8615('0x8'));var _=require(_0x8615('0x9'));var squel=require(_0x8615('0xa'));var crypto=require(_0x8615('0xb'));var jsforce=require(_0x8615('0xc'));var deskjs=require(_0x8615('0xd'));var toCsv=require('to-csv');var querystring=require(_0x8615('0xe'));var Papa=require('papaparse');var Redis=require(_0x8615('0xf'));var authService=require(_0x8615('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8615('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8615('0x12'))('api');var utils=require(_0x8615('0x13'));var config=require(_0x8615('0x14'));var licenseUtil=require(_0x8615('0x15'));var db=require(_0x8615('0x16'))['db'];function respondWithStatusCode(_0x250493,_0xd40ff2){_0xd40ff2=_0xd40ff2||0xcc;return function(_0x43c92a){if(_0x43c92a){return _0x250493[_0x8615('0x17')](_0xd40ff2);}return _0x250493[_0x8615('0x18')](_0xd40ff2)['end']();};}function respondWithResult(_0x287405,_0xfd2e9e){_0xfd2e9e=_0xfd2e9e||0xc8;return function(_0x268035){if(_0x268035){return _0x287405[_0x8615('0x18')](_0xfd2e9e)[_0x8615('0x19')](_0x268035);}};}function respondWithFilteredResult(_0x5d5bf8,_0x2777c2){return function(_0x36a9c5){if(_0x36a9c5){var _0x34f8e7=typeof _0x2777c2[_0x8615('0x1a')]===_0x8615('0x1b')&&typeof _0x2777c2[_0x8615('0x1c')]===_0x8615('0x1b');var _0x863c60=_0x36a9c5[_0x8615('0x1d')];var _0x1abe43=_0x34f8e7?0x0:_0x2777c2[_0x8615('0x1a')];var _0xf25b9b=_0x34f8e7?_0x36a9c5[_0x8615('0x1d')]:_0x2777c2[_0x8615('0x1a')]+_0x2777c2[_0x8615('0x1c')];var _0x14c9fc;if(_0xf25b9b>=_0x863c60){_0xf25b9b=_0x863c60;_0x14c9fc=0xc8;}else{_0x14c9fc=0xce;}_0x5d5bf8[_0x8615('0x18')](_0x14c9fc);return _0x5d5bf8[_0x8615('0x1e')]('Content-Range',_0x1abe43+'-'+_0xf25b9b+'/'+_0x863c60)[_0x8615('0x19')](_0x36a9c5);}return null;};}function patchUpdates(_0x2612b1){return function(_0x3e4e6c){try{jsonpatch[_0x8615('0x1f')](_0x3e4e6c,_0x2612b1,!![]);}catch(_0x55d07f){return BPromise[_0x8615('0x20')](_0x55d07f);}return _0x3e4e6c[_0x8615('0x21')]();};}function saveUpdates(_0x2654da,_0x59d6c1){return function(_0x4d1db9){if(_0x4d1db9){return _0x4d1db9['update'](_0x2654da)[_0x8615('0x22')](function(_0x27295b){return _0x27295b;});}return null;};}function removeEntity(_0x4e45ec,_0x1c0fc6){return function(_0x105bb3){if(_0x105bb3){return _0x105bb3[_0x8615('0x23')]()[_0x8615('0x22')](function(){_0x4e45ec['status'](0xcc)[_0x8615('0x24')]();});}};}function handleEntityNotFound(_0x4d1811,_0x49f165){return function(_0x4e2ae8){if(!_0x4e2ae8){_0x4d1811[_0x8615('0x17')](0x194);}return _0x4e2ae8;};}function handleError(_0x2c7af5,_0x394b46){_0x394b46=_0x394b46||0x1f4;return function(_0x317464){logger[_0x8615('0x25')](_0x317464['stack']);if(_0x317464[_0x8615('0x26')]){delete _0x317464[_0x8615('0x26')];}_0x2c7af5['status'](_0x394b46)[_0x8615('0x27')](_0x317464);};}exports['index']=function(_0x310ab7,_0x5034c3){var _0x325ee6={},_0x1a6377={},_0x93844f={'count':0x0,'rows':[]};var _0x28c94b=_[_0x8615('0x28')](db[_0x8615('0x29')][_0x8615('0x2a')],function(_0x3ef5f6){return{'name':_0x3ef5f6[_0x8615('0x2b')],'type':_0x3ef5f6[_0x8615('0x2c')][_0x8615('0x2d')]};});_0x1a6377[_0x8615('0x2e')]=_[_0x8615('0x28')](_0x28c94b,_0x8615('0x26'));_0x1a6377['query']=_[_0x8615('0x2f')](_0x310ab7[_0x8615('0x30')]);_0x1a6377[_0x8615('0x31')]=_[_0x8615('0x32')](_0x1a6377['model'],_0x1a6377[_0x8615('0x30')]);_0x325ee6[_0x8615('0x33')]=_[_0x8615('0x32')](_0x1a6377['model'],qs[_0x8615('0x34')](_0x310ab7['query']['fields']));_0x325ee6[_0x8615('0x33')]=_0x325ee6['attributes'][_0x8615('0x35')]?_0x325ee6[_0x8615('0x33')]:_0x1a6377[_0x8615('0x2e')];if(!_0x310ab7[_0x8615('0x30')][_0x8615('0x36')](_0x8615('0x37'))){_0x325ee6[_0x8615('0x1c')]=qs[_0x8615('0x1c')](_0x310ab7['query'][_0x8615('0x1c')]);_0x325ee6[_0x8615('0x1a')]=qs[_0x8615('0x1a')](_0x310ab7[_0x8615('0x30')][_0x8615('0x1a')]);}_0x325ee6['order']=qs[_0x8615('0x38')](_0x310ab7[_0x8615('0x30')][_0x8615('0x38')]);_0x325ee6[_0x8615('0x39')]=qs['filters'](_[_0x8615('0x3a')](_0x310ab7[_0x8615('0x30')],_0x1a6377[_0x8615('0x31')]),_0x28c94b);if(_0x310ab7[_0x8615('0x30')][_0x8615('0x3b')]){_0x325ee6[_0x8615('0x39')]=_[_0x8615('0x3c')](_0x325ee6['where'],{'$or':_['map'](_0x28c94b,function(_0x1b6729){if(_0x1b6729['type']!=='VIRTUAL'){var _0x4e3897={};_0x4e3897[_0x1b6729[_0x8615('0x26')]]={'$like':'%'+_0x310ab7[_0x8615('0x30')][_0x8615('0x3b')]+'%'};return _0x4e3897;}})});}_0x325ee6=_['merge']({},_0x325ee6,_0x310ab7['options']);var _0x40a4d7={'where':_0x325ee6[_0x8615('0x39')]};return db[_0x8615('0x29')][_0x8615('0x1d')](_0x40a4d7)['then'](function(_0x43ae39){_0x93844f[_0x8615('0x1d')]=_0x43ae39;if(_0x310ab7[_0x8615('0x30')]['includeAll']){_0x325ee6[_0x8615('0x3d')]=[{'all':!![]}];}return db[_0x8615('0x29')][_0x8615('0x3e')](_0x325ee6);})[_0x8615('0x22')](function(_0x446c12){_0x93844f[_0x8615('0x3f')]=_0x446c12;return _0x93844f;})['then'](respondWithFilteredResult(_0x5034c3,_0x325ee6))[_0x8615('0x40')](handleError(_0x5034c3,null));};exports[_0x8615('0x41')]=function(_0x1ff92e,_0x42cee9){var _0xdf102c={'raw':!![],'where':{'id':_0x1ff92e['params']['id']}},_0x321685={};_0x321685[_0x8615('0x2e')]=_[_0x8615('0x2f')](db['FreshsalesField'][_0x8615('0x2a')]);_0x321685[_0x8615('0x30')]=_[_0x8615('0x2f')](_0x1ff92e['query']);_0x321685[_0x8615('0x31')]=_[_0x8615('0x32')](_0x321685['model'],_0x321685['query']);_0xdf102c[_0x8615('0x33')]=_[_0x8615('0x32')](_0x321685[_0x8615('0x2e')],qs[_0x8615('0x34')](_0x1ff92e['query']['fields']));_0xdf102c['attributes']=_0xdf102c[_0x8615('0x33')][_0x8615('0x35')]?_0xdf102c[_0x8615('0x33')]:_0x321685[_0x8615('0x2e')];if(_0x1ff92e['query'][_0x8615('0x42')]){_0xdf102c['include']=[{'all':!![]}];}_0xdf102c=_[_0x8615('0x3c')]({},_0xdf102c,_0x1ff92e['options']);return db[_0x8615('0x29')][_0x8615('0x43')](_0xdf102c)[_0x8615('0x22')](handleEntityNotFound(_0x42cee9,null))[_0x8615('0x22')](respondWithResult(_0x42cee9,null))[_0x8615('0x40')](handleError(_0x42cee9,null));};exports[_0x8615('0x44')]=function(_0x4ec9f0,_0x5c4e6c){return db['FreshsalesField']['create'](_0x4ec9f0[_0x8615('0x45')],{})[_0x8615('0x22')](respondWithResult(_0x5c4e6c,0xc9))['catch'](handleError(_0x5c4e6c,null));};exports[_0x8615('0x46')]=function(_0x166fbc,_0x1047e5){if(_0x166fbc[_0x8615('0x45')]['id']){delete _0x166fbc[_0x8615('0x45')]['id'];}return db[_0x8615('0x29')][_0x8615('0x43')]({'where':{'id':_0x166fbc[_0x8615('0x47')]['id']}})[_0x8615('0x22')](handleEntityNotFound(_0x1047e5,null))[_0x8615('0x22')](saveUpdates(_0x166fbc[_0x8615('0x45')],null))[_0x8615('0x22')](respondWithResult(_0x1047e5,null))[_0x8615('0x40')](handleError(_0x1047e5,null));};exports[_0x8615('0x23')]=function(_0x1fb10a,_0x5befde){return db[_0x8615('0x29')][_0x8615('0x43')]({'where':{'id':_0x1fb10a['params']['id']}})[_0x8615('0x22')](handleEntityNotFound(_0x5befde,null))[_0x8615('0x22')](removeEntity(_0x5befde,null))[_0x8615('0x40')](handleError(_0x5befde,null));}; \ No newline at end of file +var _0xba04=['fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/license/util','sendStatus','status','end','offset','limit','undefined','count','set','apply','save','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','FreshsalesField','findAll','catch','show','params','intersection','find','create','body','update','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x8fc7b4,_0x4c1827){var _0x2431cf=function(_0xd3c5a3){while(--_0xd3c5a3){_0x8fc7b4['push'](_0x8fc7b4['shift']());}};_0x2431cf(++_0x4c1827);}(_0xba04,0x1a6));var _0x4ba0=function(_0x42b7ef,_0x5678fe){_0x42b7ef=_0x42b7ef-0x0;var _0x3d8845=_0xba04[_0x42b7ef];return _0x3d8845;};'use strict';var emlformat=require(_0x4ba0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4ba0('0x1'));var jsonpatch=require(_0x4ba0('0x2'));var rp=require(_0x4ba0('0x3'));var moment=require(_0x4ba0('0x4'));var BPromise=require(_0x4ba0('0x5'));var Mustache=require(_0x4ba0('0x6'));var util=require(_0x4ba0('0x7'));var path=require(_0x4ba0('0x8'));var sox=require(_0x4ba0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4ba0('0xa'));var _=require(_0x4ba0('0xb'));var squel=require(_0x4ba0('0xc'));var crypto=require(_0x4ba0('0xd'));var jsforce=require(_0x4ba0('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4ba0('0xf'));var querystring=require(_0x4ba0('0x10'));var Papa=require(_0x4ba0('0x11'));var Redis=require(_0x4ba0('0x12'));var authService=require(_0x4ba0('0x13'));var qs=require(_0x4ba0('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4ba0('0x15'))(_0x4ba0('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4ba0('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1344ed,_0x57fdec){_0x57fdec=_0x57fdec||0xcc;return function(_0x1cdfde){if(_0x1cdfde){return _0x1344ed[_0x4ba0('0x18')](_0x57fdec);}return _0x1344ed[_0x4ba0('0x19')](_0x57fdec)[_0x4ba0('0x1a')]();};}function respondWithResult(_0x22f68f,_0x33b193){_0x33b193=_0x33b193||0xc8;return function(_0xf28130){if(_0xf28130){return _0x22f68f['status'](_0x33b193)['json'](_0xf28130);}};}function respondWithFilteredResult(_0x479b86,_0x100827){return function(_0x2d61b8){if(_0x2d61b8){var _0x43be84=typeof _0x100827[_0x4ba0('0x1b')]==='undefined'&&typeof _0x100827[_0x4ba0('0x1c')]===_0x4ba0('0x1d');var _0x3c5155=_0x2d61b8[_0x4ba0('0x1e')];var _0x2fbe81=_0x43be84?0x0:_0x100827[_0x4ba0('0x1b')];var _0x3e71c1=_0x43be84?_0x2d61b8[_0x4ba0('0x1e')]:_0x100827[_0x4ba0('0x1b')]+_0x100827[_0x4ba0('0x1c')];var _0x58a2f5;if(_0x3e71c1>=_0x3c5155){_0x3e71c1=_0x3c5155;_0x58a2f5=0xc8;}else{_0x58a2f5=0xce;}_0x479b86[_0x4ba0('0x19')](_0x58a2f5);return _0x479b86[_0x4ba0('0x1f')]('Content-Range',_0x2fbe81+'-'+_0x3e71c1+'/'+_0x3c5155)['json'](_0x2d61b8);}return null;};}function patchUpdates(_0x1561fb){return function(_0x28b3ef){try{jsonpatch[_0x4ba0('0x20')](_0x28b3ef,_0x1561fb,!![]);}catch(_0x8ecb90){return BPromise['reject'](_0x8ecb90);}return _0x28b3ef[_0x4ba0('0x21')]();};}function saveUpdates(_0x4b7dba,_0xaac2a2){return function(_0x3089da){if(_0x3089da){return _0x3089da['update'](_0x4b7dba)[_0x4ba0('0x22')](function(_0x8e4ca8){return _0x8e4ca8;});}return null;};}function removeEntity(_0x50096d,_0x41b15b){return function(_0x5e7ea2){if(_0x5e7ea2){return _0x5e7ea2[_0x4ba0('0x23')]()[_0x4ba0('0x22')](function(){_0x50096d[_0x4ba0('0x19')](0xcc)[_0x4ba0('0x1a')]();});}};}function handleEntityNotFound(_0x5e74e8,_0x21b466){return function(_0x29f913){if(!_0x29f913){_0x5e74e8[_0x4ba0('0x18')](0x194);}return _0x29f913;};}function handleError(_0x21bfba,_0x35d4d3){_0x35d4d3=_0x35d4d3||0x1f4;return function(_0x222f87){logger[_0x4ba0('0x24')](_0x222f87['stack']);if(_0x222f87[_0x4ba0('0x25')]){delete _0x222f87['name'];}_0x21bfba['status'](_0x35d4d3)[_0x4ba0('0x26')](_0x222f87);};}exports[_0x4ba0('0x27')]=function(_0xddbc61,_0x43ab85){var _0x4888ff={},_0x1906fc={},_0x127159={'count':0x0,'rows':[]};var _0x314d48=_[_0x4ba0('0x28')](db['FreshsalesField'][_0x4ba0('0x29')],function(_0x20c058){return{'name':_0x20c058[_0x4ba0('0x2a')],'type':_0x20c058[_0x4ba0('0x2b')]['key']};});_0x1906fc[_0x4ba0('0x2c')]=_[_0x4ba0('0x28')](_0x314d48,_0x4ba0('0x25'));_0x1906fc['query']=_[_0x4ba0('0x2d')](_0xddbc61[_0x4ba0('0x2e')]);_0x1906fc[_0x4ba0('0x2f')]=_['intersection'](_0x1906fc[_0x4ba0('0x2c')],_0x1906fc[_0x4ba0('0x2e')]);_0x4888ff[_0x4ba0('0x30')]=_['intersection'](_0x1906fc[_0x4ba0('0x2c')],qs['fields'](_0xddbc61[_0x4ba0('0x2e')][_0x4ba0('0x31')]));_0x4888ff[_0x4ba0('0x30')]=_0x4888ff['attributes'][_0x4ba0('0x32')]?_0x4888ff[_0x4ba0('0x30')]:_0x1906fc['model'];if(!_0xddbc61[_0x4ba0('0x2e')][_0x4ba0('0x33')](_0x4ba0('0x34'))){_0x4888ff[_0x4ba0('0x1c')]=qs[_0x4ba0('0x1c')](_0xddbc61['query'][_0x4ba0('0x1c')]);_0x4888ff['offset']=qs[_0x4ba0('0x1b')](_0xddbc61[_0x4ba0('0x2e')]['offset']);}_0x4888ff[_0x4ba0('0x35')]=qs[_0x4ba0('0x36')](_0xddbc61['query']['sort']);_0x4888ff[_0x4ba0('0x37')]=qs[_0x4ba0('0x2f')](_['pick'](_0xddbc61[_0x4ba0('0x2e')],_0x1906fc['filters']),_0x314d48);if(_0xddbc61[_0x4ba0('0x2e')][_0x4ba0('0x38')]){_0x4888ff['where']=_[_0x4ba0('0x39')](_0x4888ff[_0x4ba0('0x37')],{'$or':_['map'](_0x314d48,function(_0x32148d){if(_0x32148d[_0x4ba0('0x2b')]!==_0x4ba0('0x3a')){var _0x55f7b1={};_0x55f7b1[_0x32148d['name']]={'$like':'%'+_0xddbc61[_0x4ba0('0x2e')][_0x4ba0('0x38')]+'%'};return _0x55f7b1;}})});}_0x4888ff=_[_0x4ba0('0x39')]({},_0x4888ff,_0xddbc61[_0x4ba0('0x3b')]);var _0x56e612={'where':_0x4888ff[_0x4ba0('0x37')]};return db['FreshsalesField'][_0x4ba0('0x1e')](_0x56e612)['then'](function(_0x3ecf95){_0x127159['count']=_0x3ecf95;if(_0xddbc61['query'][_0x4ba0('0x3c')]){_0x4888ff[_0x4ba0('0x3d')]=[{'all':!![]}];}return db[_0x4ba0('0x3e')][_0x4ba0('0x3f')](_0x4888ff);})[_0x4ba0('0x22')](function(_0xa54fc){_0x127159['rows']=_0xa54fc;return _0x127159;})[_0x4ba0('0x22')](respondWithFilteredResult(_0x43ab85,_0x4888ff))[_0x4ba0('0x40')](handleError(_0x43ab85,null));};exports[_0x4ba0('0x41')]=function(_0x5e4991,_0x29dbec){var _0x12d56c={'raw':!![],'where':{'id':_0x5e4991[_0x4ba0('0x42')]['id']}},_0x1ea12d={};_0x1ea12d[_0x4ba0('0x2c')]=_[_0x4ba0('0x2d')](db[_0x4ba0('0x3e')][_0x4ba0('0x29')]);_0x1ea12d[_0x4ba0('0x2e')]=_['keys'](_0x5e4991[_0x4ba0('0x2e')]);_0x1ea12d[_0x4ba0('0x2f')]=_[_0x4ba0('0x43')](_0x1ea12d[_0x4ba0('0x2c')],_0x1ea12d[_0x4ba0('0x2e')]);_0x12d56c[_0x4ba0('0x30')]=_['intersection'](_0x1ea12d[_0x4ba0('0x2c')],qs[_0x4ba0('0x31')](_0x5e4991[_0x4ba0('0x2e')]['fields']));_0x12d56c[_0x4ba0('0x30')]=_0x12d56c['attributes'][_0x4ba0('0x32')]?_0x12d56c[_0x4ba0('0x30')]:_0x1ea12d['model'];if(_0x5e4991[_0x4ba0('0x2e')][_0x4ba0('0x3c')]){_0x12d56c['include']=[{'all':!![]}];}_0x12d56c=_[_0x4ba0('0x39')]({},_0x12d56c,_0x5e4991[_0x4ba0('0x3b')]);return db[_0x4ba0('0x3e')][_0x4ba0('0x44')](_0x12d56c)[_0x4ba0('0x22')](handleEntityNotFound(_0x29dbec,null))[_0x4ba0('0x22')](respondWithResult(_0x29dbec,null))['catch'](handleError(_0x29dbec,null));};exports[_0x4ba0('0x45')]=function(_0x12f738,_0x5e389c){return db[_0x4ba0('0x3e')]['create'](_0x12f738[_0x4ba0('0x46')],{})['then'](respondWithResult(_0x5e389c,0xc9))[_0x4ba0('0x40')](handleError(_0x5e389c,null));};exports[_0x4ba0('0x47')]=function(_0x3f46df,_0x1e031b){if(_0x3f46df[_0x4ba0('0x46')]['id']){delete _0x3f46df['body']['id'];}return db['FreshsalesField']['find']({'where':{'id':_0x3f46df[_0x4ba0('0x42')]['id']}})[_0x4ba0('0x22')](handleEntityNotFound(_0x1e031b,null))[_0x4ba0('0x22')](saveUpdates(_0x3f46df[_0x4ba0('0x46')],null))['then'](respondWithResult(_0x1e031b,null))['catch'](handleError(_0x1e031b,null));};exports['destroy']=function(_0x4b8e0f,_0x4c2784){return db[_0x4ba0('0x3e')][_0x4ba0('0x44')]({'where':{'id':_0x4b8e0f[_0x4ba0('0x42')]['id']}})['then'](handleEntityNotFound(_0x4c2784,null))[_0x4ba0('0x22')](removeEntity(_0x4c2784,null))[_0x4ba0('0x40')](handleError(_0x4c2784,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index faa709b..2de7cbe 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.model.js +++ b/server/api/intFreshsalesField/intFreshsalesField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2cf5=['../../config/environment','./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash','util','api','bluebird','request-promise'];(function(_0x5aaf93,_0x5c0001){var _0x17d307=function(_0x21d77a){while(--_0x21d77a){_0x5aaf93['push'](_0x5aaf93['shift']());}};_0x17d307(++_0x5c0001);}(_0x2cf5,0x19f));var _0x52cf=function(_0x43120a,_0x283299){_0x43120a=_0x43120a-0x0;var _0x2f5ef1=_0x2cf5[_0x43120a];return _0x2f5ef1;};'use strict';var _=require(_0x52cf('0x0'));var util=require(_0x52cf('0x1'));var logger=require('../../config/logger')(_0x52cf('0x2'));var moment=require('moment');var BPromise=require(_0x52cf('0x3'));var rp=require(_0x52cf('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x52cf('0x5'));var attributes=require(_0x52cf('0x6'));module[_0x52cf('0x7')]=function(_0x1001bd,_0x31185d){return _0x1001bd[_0x52cf('0x8')](_0x52cf('0x9'),attributes,{'tableName':_0x52cf('0xa'),'paranoid':![],'indexes':[{'name':_0x52cf('0xb'),'fields':[_0x52cf('0xc'),_0x52cf('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9a2a=['idField','FieldId','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index'];(function(_0x2aba58,_0x27cf7a){var _0x33f3fb=function(_0x48f1ff){while(--_0x48f1ff){_0x2aba58['push'](_0x2aba58['shift']());}};_0x33f3fb(++_0x27cf7a);}(_0x9a2a,0xa7));var _0xa9a2=function(_0x5993de,_0x1e902f){_0x5993de=_0x5993de-0x0;var _0x481faf=_0x9a2a[_0x5993de];return _0x481faf;};'use strict';var _=require(_0xa9a2('0x0'));var util=require(_0xa9a2('0x1'));var logger=require(_0xa9a2('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa9a2('0x3'));var fs=require('fs');var path=require(_0xa9a2('0x4'));var rimraf=require(_0xa9a2('0x5'));var config=require(_0xa9a2('0x6'));var attributes=require(_0xa9a2('0x7'));module[_0xa9a2('0x8')]=function(_0x4d5f04,_0x5c5e56){return _0x4d5f04[_0xa9a2('0x9')](_0xa9a2('0xa'),attributes,{'tableName':_0xa9a2('0xb'),'paranoid':![],'indexes':[{'name':_0xa9a2('0xc'),'fields':[_0xa9a2('0xd'),_0xa9a2('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 b501f71..6d9cf77 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 _0x7c09=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','then','info','FreshsalesField,\x20%s,\x20%s','FreshsalesField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment'];(function(_0x547890,_0x593741){var _0x2c8daa=function(_0x1b100d){while(--_0x1b100d){_0x547890['push'](_0x547890['shift']());}};_0x2c8daa(++_0x593741);}(_0x7c09,0x102));var _0x97c0=function(_0xa2ed73,_0x4fc43d){_0xa2ed73=_0xa2ed73-0x0;var _0x3fbc8f=_0x7c09[_0xa2ed73];return _0x3fbc8f;};'use strict';var _=require('lodash');var util=require(_0x97c0('0x0'));var moment=require(_0x97c0('0x1'));var BPromise=require('bluebird');var rs=require(_0x97c0('0x2'));var fs=require('fs');var Redis=require(_0x97c0('0x3'));var db=require(_0x97c0('0x4'))['db'];var utils=require(_0x97c0('0x5'));var logger=require(_0x97c0('0x6'))(_0x97c0('0x7'));var config=require(_0x97c0('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x46fdd9,_0x42c6c7,_0x2c19fa){return new BPromise(function(_0x109bc8,_0x293785){return client['request'](_0x46fdd9,_0x2c19fa)[_0x97c0('0x9')](function(_0x4ac5f1){logger[_0x97c0('0xa')](_0x97c0('0xb'),_0x42c6c7,'request\x20sent');logger['debug'](_0x97c0('0xc'),_0x42c6c7,_0x97c0('0xd'),JSON[_0x97c0('0xe')](_0x4ac5f1));if(_0x4ac5f1[_0x97c0('0xf')]){if(_0x4ac5f1[_0x97c0('0xf')][_0x97c0('0x10')]===0x1f4){logger[_0x97c0('0xf')](_0x97c0('0xb'),_0x42c6c7,_0x4ac5f1[_0x97c0('0xf')][_0x97c0('0x11')]);return _0x293785(_0x4ac5f1[_0x97c0('0xf')][_0x97c0('0x11')]);}logger[_0x97c0('0xf')]('FreshsalesField,\x20%s,\x20%s',_0x42c6c7,_0x4ac5f1[_0x97c0('0xf')][_0x97c0('0x11')]);return _0x109bc8(_0x4ac5f1[_0x97c0('0xf')]['message']);}else{logger[_0x97c0('0xa')](_0x97c0('0xb'),_0x42c6c7,_0x97c0('0xd'));_0x109bc8(_0x4ac5f1[_0x97c0('0x12')][_0x97c0('0x11')]);}})[_0x97c0('0x13')](function(_0x49c0d9){logger[_0x97c0('0xf')](_0x97c0('0xb'),_0x42c6c7,_0x49c0d9);_0x293785(_0x49c0d9);});});} \ No newline at end of file +var _0x6d38=['request','then','FreshsalesField,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x4fd994,_0x9790ba){var _0x1d5c13=function(_0x20a3ba){while(--_0x20a3ba){_0x4fd994['push'](_0x4fd994['shift']());}};_0x1d5c13(++_0x9790ba);}(_0x6d38,0x1ef));var _0x86d3=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x6d38[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require('lodash');var util=require(_0x86d3('0x0'));var moment=require(_0x86d3('0x1'));var BPromise=require(_0x86d3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x86d3('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x86d3('0x4'))(_0x86d3('0x5'));var config=require(_0x86d3('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x86d3('0x7')][_0x86d3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x33d4aa,_0x2eaa15,_0x47e654){return new BPromise(function(_0x552b07,_0x2aea31){return client[_0x86d3('0x9')](_0x33d4aa,_0x47e654)[_0x86d3('0xa')](function(_0x499640){logger['info'](_0x86d3('0xb'),_0x2eaa15,_0x86d3('0xc'));logger['debug']('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x2eaa15,_0x86d3('0xc'),JSON[_0x86d3('0xd')](_0x499640));if(_0x499640['error']){if(_0x499640[_0x86d3('0xe')]['code']===0x1f4){logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);return _0x2aea31(_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);}logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x499640['error'][_0x86d3('0xf')]);return _0x552b07(_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);}else{logger[_0x86d3('0x10')](_0x86d3('0xb'),_0x2eaa15,_0x86d3('0xc'));_0x552b07(_0x499640[_0x86d3('0x11')][_0x86d3('0xf')]);}})['catch'](function(_0x2d5ba9){logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x2d5ba9);_0x2aea31(_0x2d5ba9);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 33d95f9..10dd612 100644 --- a/server/api/intSalesforceAccount/index.js +++ b/server/api/intSalesforceAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x4615e7,_0x421e92){var _0x509d99=function(_0xc08171){while(--_0xc08171){_0x4615e7['push'](_0x4615e7['shift']());}};_0x509d99(++_0x421e92);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x4a46e6,_0xc2f690){var _0x5aff93=function(_0x2031d7){while(--_0x2031d7){_0x4a46e6['push'](_0x4a46e6['shift']());}};_0x5aff93(++_0xc2f690);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index cf87e38..10cd963 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 _0xfe39=['ENUM','integrationTab','newTab','sequelize','exports','STRING'];(function(_0x66cb,_0x128463){var _0x5a603a=function(_0x35d50f){while(--_0x35d50f){_0x66cb['push'](_0x66cb['shift']());}};_0x5a603a(++_0x128463);}(_0xfe39,0x1b3));var _0x9fe3=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xfe39[_0x46698a];return _0x356db0;};'use strict';var Sequelize=require(_0x9fe3('0x0'));module[_0x9fe3('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9fe3('0x2')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'remoteUri':{'type':Sequelize[_0x9fe3('0x2')]},'password':{'type':Sequelize[_0x9fe3('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0x9fe3('0x2')]},'serverUrl':{'type':Sequelize[_0x9fe3('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9fe3('0x3')](_0x9fe3('0x4'),_0x9fe3('0x5')),'defaultValue':_0x9fe3('0x4')}}; \ No newline at end of file +var _0x0b36=['STRING','ENUM','integrationTab','sequelize','exports'];(function(_0xc2701a,_0xcd4e10){var _0x44f1b3=function(_0xb25686){while(--_0xb25686){_0xc2701a['push'](_0xc2701a['shift']());}};_0x44f1b3(++_0xcd4e10);}(_0x0b36,0x10c));var _0x60b3=function(_0x58464f,_0x4918f7){_0x58464f=_0x58464f-0x0;var _0x1d56e=_0x0b36[_0x58464f];return _0x1d56e;};'use strict';var Sequelize=require(_0x60b3('0x0'));module[_0x60b3('0x1')]={'name':{'type':Sequelize[_0x60b3('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':'username'},'remoteUri':{'type':Sequelize[_0x60b3('0x2')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x60b3('0x2')]},'clientSecret':{'type':Sequelize[_0x60b3('0x2')]},'securityToken':{'type':Sequelize[_0x60b3('0x2')]},'serverUrl':{'type':Sequelize[_0x60b3('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x60b3('0x3')](_0x60b3('0x4'),'newTab'),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index d23e644..99ec365 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 _0xfd8a=['bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','fieldName','type','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','SalesforceAccount','findAll','rows','catch','params','rawAttributes','fields','options','find','create','body','getConfigurations','findOne','SalesforceConfiguration','order','addConfiguration','getSubjects','channel','Descriptions','getDescriptions','Subjects','SalesforceField','getFields','Task','remoteUri','clientId','clientSecret','username','password','securityToken','slice','substring','login','concat','ticketType','describe','OwnerId','IsReminderSet','IsRecurrence','Subject','Description','string','int','boolean','email','phone','remove','custom','label','value','True','true','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment'];(function(_0x2b28bb,_0x2b1ca7){var _0x1b4b59=function(_0x51b5de){while(--_0x51b5de){_0x2b28bb['push'](_0x2b28bb['shift']());}};_0x1b4b59(++_0x2b1ca7);}(_0xfd8a,0x16c));var _0xafd8=function(_0x3bfdde,_0x306be4){_0x3bfdde=_0x3bfdde-0x0;var _0x3f752a=_0xfd8a[_0x3bfdde];return _0x3f752a;};'use strict';var emlformat=require(_0xafd8('0x0'));var rimraf=require(_0xafd8('0x1'));var zipdir=require(_0xafd8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xafd8('0x3'));var moment=require(_0xafd8('0x4'));var BPromise=require(_0xafd8('0x5'));var Mustache=require(_0xafd8('0x6'));var util=require(_0xafd8('0x7'));var path=require(_0xafd8('0x8'));var sox=require('sox');var csv=require(_0xafd8('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xafd8('0xa'));var _=require(_0xafd8('0xb'));var squel=require(_0xafd8('0xc'));var crypto=require(_0xafd8('0xd'));var jsforce=require(_0xafd8('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xafd8('0xf'));var Papa=require(_0xafd8('0x10'));var Redis=require(_0xafd8('0x11'));var authService=require(_0xafd8('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xafd8('0x13'));var hardwareService=require(_0xafd8('0x14'));var logger=require('../../config/logger')(_0xafd8('0x15'));var utils=require(_0xafd8('0x16'));var config=require(_0xafd8('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xafd8('0x18'))['db'];var integrations=require(_0xafd8('0x19'));function respondWithStatusCode(_0x2aed17,_0x1e1a7d){_0x1e1a7d=_0x1e1a7d||0xcc;return function(_0x24082f){if(_0x24082f){return _0x2aed17[_0xafd8('0x1a')](_0x1e1a7d);}return _0x2aed17[_0xafd8('0x1b')](_0x1e1a7d)[_0xafd8('0x1c')]();};}function respondWithResult(_0x72121a,_0xa5aecb){_0xa5aecb=_0xa5aecb||0xc8;return function(_0x2ad626){if(_0x2ad626){return _0x72121a['status'](_0xa5aecb)['json'](_0x2ad626);}};}function respondWithFilteredResult(_0x2ef23e,_0x50469b){return function(_0x16ac9e){if(_0x16ac9e){var _0x23fb3f=typeof _0x50469b['offset']===_0xafd8('0x1d')&&typeof _0x50469b[_0xafd8('0x1e')]===_0xafd8('0x1d');var _0x111a96=_0x16ac9e[_0xafd8('0x1f')];var _0x100ee8=_0x23fb3f?0x0:_0x50469b[_0xafd8('0x20')];var _0x2bc4e1=_0x23fb3f?_0x16ac9e[_0xafd8('0x1f')]:_0x50469b[_0xafd8('0x20')]+_0x50469b[_0xafd8('0x1e')];var _0x19303c;if(_0x2bc4e1>=_0x111a96){_0x2bc4e1=_0x111a96;_0x19303c=0xc8;}else{_0x19303c=0xce;}_0x2ef23e[_0xafd8('0x1b')](_0x19303c);return _0x2ef23e[_0xafd8('0x21')](_0xafd8('0x22'),_0x100ee8+'-'+_0x2bc4e1+'/'+_0x111a96)[_0xafd8('0x23')](_0x16ac9e);}return null;};}function patchUpdates(_0x49e93f){return function(_0x4176c9){try{jsonpatch[_0xafd8('0x24')](_0x4176c9,_0x49e93f,!![]);}catch(_0x936035){return BPromise[_0xafd8('0x25')](_0x936035);}return _0x4176c9[_0xafd8('0x26')]();};}function saveUpdates(_0x403261,_0x580691){return function(_0x2901eb){if(_0x2901eb){return _0x2901eb[_0xafd8('0x27')](_0x403261)[_0xafd8('0x28')](function(_0x43d8c0){return _0x43d8c0;});}return null;};}function removeEntity(_0xa659f8,_0x4c907a){return function(_0x4dd640){if(_0x4dd640){return _0x4dd640[_0xafd8('0x29')]()[_0xafd8('0x28')](function(){_0xa659f8[_0xafd8('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31bb79,_0x4b31e3){return function(_0x353cdc){if(!_0x353cdc){_0x31bb79[_0xafd8('0x1a')](0x194);}return _0x353cdc;};}function handleError(_0x102efe,_0x3db0c1){_0x3db0c1=_0x3db0c1||0x1f4;return function(_0x5069b1){logger[_0xafd8('0x2a')](_0x5069b1[_0xafd8('0x2b')]);if(_0x5069b1[_0xafd8('0x2c')]){delete _0x5069b1[_0xafd8('0x2c')];}_0x102efe[_0xafd8('0x1b')](_0x3db0c1)['send'](_0x5069b1);};}exports['index']=function(_0x1e6de1,_0x190011){var _0xb3f6c6={},_0x3cb292={},_0x5a0c06={'count':0x0,'rows':[]};var _0xd223eb=_['map'](db['SalesforceAccount']['rawAttributes'],function(_0x26c9b7){return{'name':_0x26c9b7[_0xafd8('0x2d')],'type':_0x26c9b7[_0xafd8('0x2e')]['key']};});_0x3cb292['model']=_['map'](_0xd223eb,_0xafd8('0x2c'));_0x3cb292[_0xafd8('0x2f')]=_[_0xafd8('0x30')](_0x1e6de1[_0xafd8('0x2f')]);_0x3cb292[_0xafd8('0x31')]=_[_0xafd8('0x32')](_0x3cb292[_0xafd8('0x33')],_0x3cb292[_0xafd8('0x2f')]);_0xb3f6c6[_0xafd8('0x34')]=_['intersection'](_0x3cb292[_0xafd8('0x33')],qs['fields'](_0x1e6de1[_0xafd8('0x2f')]['fields']));_0xb3f6c6[_0xafd8('0x34')]=_0xb3f6c6[_0xafd8('0x34')][_0xafd8('0x35')]?_0xb3f6c6[_0xafd8('0x34')]:_0x3cb292[_0xafd8('0x33')];if(!_0x1e6de1['query'][_0xafd8('0x36')](_0xafd8('0x37'))){_0xb3f6c6[_0xafd8('0x1e')]=qs[_0xafd8('0x1e')](_0x1e6de1[_0xafd8('0x2f')][_0xafd8('0x1e')]);_0xb3f6c6[_0xafd8('0x20')]=qs[_0xafd8('0x20')](_0x1e6de1[_0xafd8('0x2f')][_0xafd8('0x20')]);}_0xb3f6c6['order']=qs['sort'](_0x1e6de1[_0xafd8('0x2f')][_0xafd8('0x38')]);_0xb3f6c6[_0xafd8('0x39')]=qs[_0xafd8('0x31')](_[_0xafd8('0x3a')](_0x1e6de1['query'],_0x3cb292[_0xafd8('0x31')]),_0xd223eb);if(_0x1e6de1[_0xafd8('0x2f')]['filter']){_0xb3f6c6[_0xafd8('0x39')]=_[_0xafd8('0x3b')](_0xb3f6c6[_0xafd8('0x39')],{'$or':_['map'](_0xd223eb,function(_0x466b6f){if(_0x466b6f['type']!==_0xafd8('0x3c')){var _0x34ce84={};_0x34ce84[_0x466b6f[_0xafd8('0x2c')]]={'$like':'%'+_0x1e6de1[_0xafd8('0x2f')][_0xafd8('0x3d')]+'%'};return _0x34ce84;}})});}_0xb3f6c6=_[_0xafd8('0x3b')]({},_0xb3f6c6,_0x1e6de1['options']);var _0x242df5={'where':_0xb3f6c6[_0xafd8('0x39')]};return db['SalesforceAccount'][_0xafd8('0x1f')](_0x242df5)['then'](function(_0x44aa81){_0x5a0c06[_0xafd8('0x1f')]=_0x44aa81;if(_0x1e6de1[_0xafd8('0x2f')][_0xafd8('0x3e')]){_0xb3f6c6[_0xafd8('0x3f')]=[{'all':!![]}];}return db[_0xafd8('0x40')][_0xafd8('0x41')](_0xb3f6c6);})[_0xafd8('0x28')](function(_0xbb7495){_0x5a0c06[_0xafd8('0x42')]=_0xbb7495;return _0x5a0c06;})[_0xafd8('0x28')](respondWithFilteredResult(_0x190011,_0xb3f6c6))[_0xafd8('0x43')](handleError(_0x190011,null));};exports['show']=function(_0x342ba1,_0x5a8c24){var _0x54a552={'raw':![],'where':{'id':_0x342ba1[_0xafd8('0x44')]['id']}},_0x19b648={};_0x19b648[_0xafd8('0x33')]=_[_0xafd8('0x30')](db['SalesforceAccount'][_0xafd8('0x45')]);_0x19b648[_0xafd8('0x2f')]=_['keys'](_0x342ba1[_0xafd8('0x2f')]);_0x19b648['filters']=_['intersection'](_0x19b648[_0xafd8('0x33')],_0x19b648[_0xafd8('0x2f')]);_0x54a552['attributes']=_[_0xafd8('0x32')](_0x19b648[_0xafd8('0x33')],qs[_0xafd8('0x46')](_0x342ba1['query'][_0xafd8('0x46')]));_0x54a552[_0xafd8('0x34')]=_0x54a552[_0xafd8('0x34')]['length']?_0x54a552[_0xafd8('0x34')]:_0x19b648[_0xafd8('0x33')];if(_0x342ba1[_0xafd8('0x2f')][_0xafd8('0x3e')]){_0x54a552['include']=[{'all':!![]}];}_0x54a552=_[_0xafd8('0x3b')]({},_0x54a552,_0x342ba1[_0xafd8('0x47')]);return db[_0xafd8('0x40')][_0xafd8('0x48')](_0x54a552)['then'](handleEntityNotFound(_0x5a8c24,null))[_0xafd8('0x28')](respondWithResult(_0x5a8c24,null))[_0xafd8('0x43')](handleError(_0x5a8c24,null));};exports[_0xafd8('0x49')]=function(_0x2ae3f6,_0x3c7423){return db[_0xafd8('0x40')]['create'](_0x2ae3f6[_0xafd8('0x4a')],{})[_0xafd8('0x28')](respondWithResult(_0x3c7423,0xc9))[_0xafd8('0x43')](handleError(_0x3c7423,null));};exports['update']=function(_0x1f95bb,_0x1b54d0){if(_0x1f95bb[_0xafd8('0x4a')]['id']){delete _0x1f95bb[_0xafd8('0x4a')]['id'];}return db[_0xafd8('0x40')]['find']({'where':{'id':_0x1f95bb[_0xafd8('0x44')]['id']}})[_0xafd8('0x28')](handleEntityNotFound(_0x1b54d0,null))[_0xafd8('0x28')](saveUpdates(_0x1f95bb[_0xafd8('0x4a')],null))[_0xafd8('0x28')](respondWithResult(_0x1b54d0,null))['catch'](handleError(_0x1b54d0,null));};exports[_0xafd8('0x29')]=function(_0x4a37bb,_0x46ab9c){return db['SalesforceAccount']['find']({'where':{'id':_0x4a37bb['params']['id']}})['then'](handleEntityNotFound(_0x46ab9c,null))[_0xafd8('0x28')](removeEntity(_0x46ab9c,null))['catch'](handleError(_0x46ab9c,null));};exports[_0xafd8('0x4b')]=function(_0x4f308f,_0xbef779,_0x49f8ae){var _0x409324={};var _0x5532f3={};var _0x178efe;var _0x40bc17;return db[_0xafd8('0x40')][_0xafd8('0x4c')]({'where':{'id':_0x4f308f['params']['id']}})[_0xafd8('0x28')](handleEntityNotFound(_0xbef779,null))[_0xafd8('0x28')](function(_0x119d5b){if(_0x119d5b){_0x178efe=_0x119d5b;_0x5532f3['model']=_[_0xafd8('0x30')](db[_0xafd8('0x4d')][_0xafd8('0x45')]);_0x5532f3[_0xafd8('0x2f')]=_[_0xafd8('0x30')](_0x4f308f[_0xafd8('0x2f')]);_0x5532f3['filters']=_[_0xafd8('0x32')](_0x5532f3[_0xafd8('0x33')],_0x5532f3[_0xafd8('0x2f')]);_0x409324[_0xafd8('0x34')]=_['intersection'](_0x5532f3[_0xafd8('0x33')],qs['fields'](_0x4f308f[_0xafd8('0x2f')]['fields']));_0x409324['attributes']=_0x409324['attributes'][_0xafd8('0x35')]?_0x409324[_0xafd8('0x34')]:_0x5532f3[_0xafd8('0x33')];_0x409324[_0xafd8('0x4e')]=qs[_0xafd8('0x38')](_0x4f308f[_0xafd8('0x2f')][_0xafd8('0x38')]);_0x409324[_0xafd8('0x39')]=qs[_0xafd8('0x31')](_[_0xafd8('0x3a')](_0x4f308f[_0xafd8('0x2f')],_0x5532f3[_0xafd8('0x31')]));if(_0x4f308f['query'][_0xafd8('0x3d')]){_0x409324[_0xafd8('0x39')]=_[_0xafd8('0x3b')](_0x409324['where'],{'$or':_['map'](_0x409324[_0xafd8('0x34')],function(_0x439d5a){var _0x5a2200={};_0x5a2200[_0x439d5a]={'$like':'%'+_0x4f308f['query'][_0xafd8('0x3d')]+'%'};return _0x5a2200;})});}_0x409324=_[_0xafd8('0x3b')]({},_0x409324,_0x4f308f[_0xafd8('0x47')]);return _0x178efe[_0xafd8('0x4b')](_0x409324);}})[_0xafd8('0x28')](function(_0x3a3211){if(_0x3a3211){_0x40bc17=_0x3a3211[_0xafd8('0x35')];if(!_0x4f308f[_0xafd8('0x2f')]['hasOwnProperty'](_0xafd8('0x37'))){_0x409324[_0xafd8('0x1e')]=qs[_0xafd8('0x1e')](_0x4f308f[_0xafd8('0x2f')][_0xafd8('0x1e')]);_0x409324[_0xafd8('0x20')]=qs[_0xafd8('0x20')](_0x4f308f['query'][_0xafd8('0x20')]);}return _0x178efe[_0xafd8('0x4b')](_0x409324);}})[_0xafd8('0x28')](function(_0x5081b5){if(_0x5081b5){return _0x5081b5?{'count':_0x40bc17,'rows':_0x5081b5}:null;}})[_0xafd8('0x28')](respondWithResult(_0xbef779,null))['catch'](handleError(_0xbef779,null));};exports[_0xafd8('0x4f')]=function(_0x2339ff,_0x2a11c0,_0x7564){if(_0x2339ff[_0xafd8('0x4a')]['id']){delete _0x2339ff['body']['id'];}return db[_0xafd8('0x40')][_0xafd8('0x4c')]({'where':{'id':_0x2339ff[_0xafd8('0x44')]['id']}})[_0xafd8('0x28')](handleEntityNotFound(_0x2a11c0,null))['then'](function(_0x4b5653){if(_0x4b5653){_0x2339ff[_0xafd8('0x4a')]['AccountId']=_0x4b5653['id'];_0x2339ff['body']['Subjects']=integrations[_0xafd8('0x50')](_0x2339ff[_0xafd8('0x4a')][_0xafd8('0x51')],_0x2339ff[_0xafd8('0x4a')][_0xafd8('0x2e')]);_0x2339ff[_0xafd8('0x4a')][_0xafd8('0x52')]=integrations[_0xafd8('0x53')](_0x2339ff[_0xafd8('0x4a')][_0xafd8('0x51')],_0x2339ff['body'][_0xafd8('0x2e')]);return db[_0xafd8('0x4d')][_0xafd8('0x49')](_0x2339ff[_0xafd8('0x4a')],{'include':[{'model':db['SalesforceField'],'as':_0xafd8('0x54')},{'model':db[_0xafd8('0x55')],'as':_0xafd8('0x52')}]});}return null;})[_0xafd8('0x28')](respondWithResult(_0x2a11c0,null))[_0xafd8('0x43')](handleError(_0x2a11c0,null));};exports[_0xafd8('0x56')]=function(_0x12907d,_0x5ccabb,_0x3669b0){var _0x1bf1b7;var _0x1d03d3='';var _0x5a449b=_0xafd8('0x57');return db[_0xafd8('0x40')][_0xafd8('0x4c')]({'where':{'id':_0x12907d['params']['id']},'attributes':['id',_0xafd8('0x58'),_0xafd8('0x59'),_0xafd8('0x5a'),_0xafd8('0x5b'),_0xafd8('0x5c'),_0xafd8('0x5d')]})['then'](handleEntityNotFound(_0x5ccabb,null))['then'](function(_0xfe0e72){if(_0xfe0e72){_0x1d03d3=_0xfe0e72['remoteUri'];var _0x42de50=_0x1d03d3[_0xafd8('0x5e')](-0x1);if(_0x42de50==='/'){_0x1d03d3=_0x1d03d3[_0xafd8('0x5f')](0x0,_0x1d03d3['lastIndexOf'](_0x42de50));}_0x1bf1b7=new jsforce['Connection']({'oauth2':{'loginUrl':_0x1d03d3,'clientId':_0xfe0e72[_0xafd8('0x59')],'clientSecret':_0xfe0e72[_0xafd8('0x5a')]}});return _0x1bf1b7[_0xafd8('0x60')](_0xfe0e72[_0xafd8('0x5b')],_0xfe0e72[_0xafd8('0x5c')][_0xafd8('0x61')](_0xfe0e72['securityToken']));}})[_0xafd8('0x28')](function(_0x40f483){if(_0x40f483){if(!_['isNil'](_0x12907d[_0xafd8('0x2f')][_0xafd8('0x62')])){_0x5a449b=_0x12907d[_0xafd8('0x2f')][_0xafd8('0x62')];}return _0x1bf1b7['sobject'](_0x5a449b)[_0xafd8('0x63')]();}})[_0xafd8('0x28')](function(_0x37eacc){var _0x2b5893=[_0xafd8('0x64'),'ActivityDate',_0xafd8('0x65'),_0xafd8('0x66'),_0xafd8('0x67'),_0xafd8('0x68')];var _0xb7c4ce=[_0xafd8('0x69'),_0xafd8('0x6a'),'picklist',_0xafd8('0x6b'),_0xafd8('0x6c'),'textarea',_0xafd8('0x6d')];if(_0x37eacc){_[_0xafd8('0x6e')](_0x37eacc[_0xafd8('0x46')],function(_0x16e7a8){return _0x2b5893['includes'](_0x16e7a8[_0xafd8('0x2c')])||!_0xb7c4ce['includes'](_0x16e7a8[_0xafd8('0x2e')]);});return{'count':_0x37eacc[_0xafd8('0x46')][_0xafd8('0x35')],'rows':_['map'](_0x37eacc[_0xafd8('0x46')],function(_0x49cfb5){return{'id':_0x49cfb5[_0xafd8('0x2c')],'name':_0x49cfb5['label'],'custom':_0x49cfb5[_0xafd8('0x6f')],'options':_0x49cfb5['picklistValues'][_0xafd8('0x35')]>0x0?_['map'](_0x49cfb5['picklistValues'],function(_0x46c508){return{'name':_0x46c508[_0xafd8('0x70')],'value':_0x46c508[_0xafd8('0x71')]};}):_0x49cfb5[_0xafd8('0x2e')]==_0xafd8('0x6b')?[{'name':_0xafd8('0x72'),'value':_0xafd8('0x73')},{'name':'False','value':_0xafd8('0x74')}]:[]};})};}})[_0xafd8('0x28')](respondWithResult(_0x5ccabb,null))[_0xafd8('0x43')](function(_0x3697a4){var _0x43fde9=_0x12907d['query'][_0xafd8('0x75')]?0x1f4:_0x3697a4[_0xafd8('0x76')]||0x1f4;logger[_0xafd8('0x2a')](_0xafd8('0x77'),_0xafd8('0x56'),_0x43fde9,JSON[_0xafd8('0x78')](_0x3697a4));delete _0x3697a4[_0xafd8('0x2c')];if(_0x43fde9===0x191){_0x43fde9=0x190;}_0x5ccabb[_0xafd8('0x1b')](_0x43fde9)[_0xafd8('0x79')](_0x12907d['query'][_0xafd8('0x75')]?{'message':_0xafd8('0x7a'),'statusCode':_0x3697a4[_0xafd8('0x76')]}:_0x3697a4);});}; \ No newline at end of file +var _0xd435=['squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','SalesforceAccount','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','catch','show','rawAttributes','include','find','create','body','params','findOne','SalesforceConfiguration','getConfigurations','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','SalesforceField','getFields','remoteUri','clientSecret','username','password','securityToken','slice','lastIndexOf','Connection','clientId','login','concat','ticketType','sobject','describe','OwnerId','IsReminderSet','Subject','Description','string','int','picklist','email','textarea','includes','custom','picklistValues','label','value','boolean','true','False','false','test','statusCode','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','ejs','fs-extra','lodash'];(function(_0x1e0a72,_0x375d8e){var _0x1018e4=function(_0x1e6784){while(--_0x1e6784){_0x1e0a72['push'](_0x1e0a72['shift']());}};_0x1018e4(++_0x375d8e);}(_0xd435,0x1d2));var _0x5d43=function(_0x4924ba,_0x464c76){_0x4924ba=_0x4924ba-0x0;var _0x319a7e=_0xd435[_0x4924ba];return _0x319a7e;};'use strict';var emlformat=require(_0x5d43('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5d43('0x1'));var jsonpatch=require(_0x5d43('0x2'));var rp=require(_0x5d43('0x3'));var moment=require('moment');var BPromise=require(_0x5d43('0x4'));var Mustache=require('mustache');var util=require(_0x5d43('0x5'));var path=require('path');var sox=require(_0x5d43('0x6'));var csv=require('to-csv');var ejs=require(_0x5d43('0x7'));var fs=require('fs');var fs_extra=require(_0x5d43('0x8'));var _=require(_0x5d43('0x9'));var squel=require(_0x5d43('0xa'));var crypto=require(_0x5d43('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x5d43('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5d43('0xd'));var Papa=require(_0x5d43('0xe'));var Redis=require(_0x5d43('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x5d43('0x10'));var as=require(_0x5d43('0x11'));var hardwareService=require(_0x5d43('0x12'));var logger=require(_0x5d43('0x13'))('api');var utils=require(_0x5d43('0x14'));var config=require(_0x5d43('0x15'));var licenseUtil=require(_0x5d43('0x16'));var db=require(_0x5d43('0x17'))['db'];var integrations=require(_0x5d43('0x18'));function respondWithStatusCode(_0xf78460,_0x34ed74){_0x34ed74=_0x34ed74||0xcc;return function(_0x49202e){if(_0x49202e){return _0xf78460[_0x5d43('0x19')](_0x34ed74);}return _0xf78460[_0x5d43('0x1a')](_0x34ed74)['end']();};}function respondWithResult(_0x2bbab3,_0x5d7f20){_0x5d7f20=_0x5d7f20||0xc8;return function(_0x507eac){if(_0x507eac){return _0x2bbab3[_0x5d43('0x1a')](_0x5d7f20)[_0x5d43('0x1b')](_0x507eac);}};}function respondWithFilteredResult(_0x78614a,_0x1d86cc){return function(_0x43d168){if(_0x43d168){var _0x113772=typeof _0x1d86cc[_0x5d43('0x1c')]===_0x5d43('0x1d')&&typeof _0x1d86cc[_0x5d43('0x1e')]===_0x5d43('0x1d');var _0x483350=_0x43d168['count'];var _0x3c696a=_0x113772?0x0:_0x1d86cc['offset'];var _0xcadb99=_0x113772?_0x43d168[_0x5d43('0x1f')]:_0x1d86cc[_0x5d43('0x1c')]+_0x1d86cc['limit'];var _0x1d3121;if(_0xcadb99>=_0x483350){_0xcadb99=_0x483350;_0x1d3121=0xc8;}else{_0x1d3121=0xce;}_0x78614a[_0x5d43('0x1a')](_0x1d3121);return _0x78614a['set'](_0x5d43('0x20'),_0x3c696a+'-'+_0xcadb99+'/'+_0x483350)[_0x5d43('0x1b')](_0x43d168);}return null;};}function patchUpdates(_0x3227fc){return function(_0x4aba23){try{jsonpatch['apply'](_0x4aba23,_0x3227fc,!![]);}catch(_0x14b10b){return BPromise[_0x5d43('0x21')](_0x14b10b);}return _0x4aba23[_0x5d43('0x22')]();};}function saveUpdates(_0x4af391,_0xc829cc){return function(_0xca5bf6){if(_0xca5bf6){return _0xca5bf6[_0x5d43('0x23')](_0x4af391)[_0x5d43('0x24')](function(_0x44035b){return _0x44035b;});}return null;};}function removeEntity(_0x2c0962,_0x1662fc){return function(_0x8dc601){if(_0x8dc601){return _0x8dc601[_0x5d43('0x25')]()[_0x5d43('0x24')](function(){_0x2c0962[_0x5d43('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c30bd,_0xf42808){return function(_0xebda6d){if(!_0xebda6d){_0x2c30bd[_0x5d43('0x19')](0x194);}return _0xebda6d;};}function handleError(_0x153722,_0x20f5e6){_0x20f5e6=_0x20f5e6||0x1f4;return function(_0x550720){logger[_0x5d43('0x26')](_0x550720[_0x5d43('0x27')]);if(_0x550720[_0x5d43('0x28')]){delete _0x550720[_0x5d43('0x28')];}_0x153722[_0x5d43('0x1a')](_0x20f5e6)[_0x5d43('0x29')](_0x550720);};}exports[_0x5d43('0x2a')]=function(_0x29f6b6,_0x282ff3){var _0x30a381={},_0x14f95={},_0x3d1c29={'count':0x0,'rows':[]};var _0x58260b=_[_0x5d43('0x2b')](db[_0x5d43('0x2c')]['rawAttributes'],function(_0x2a3776){return{'name':_0x2a3776['fieldName'],'type':_0x2a3776[_0x5d43('0x2d')]['key']};});_0x14f95[_0x5d43('0x2e')]=_[_0x5d43('0x2b')](_0x58260b,_0x5d43('0x28'));_0x14f95[_0x5d43('0x2f')]=_[_0x5d43('0x30')](_0x29f6b6[_0x5d43('0x2f')]);_0x14f95[_0x5d43('0x31')]=_[_0x5d43('0x32')](_0x14f95[_0x5d43('0x2e')],_0x14f95[_0x5d43('0x2f')]);_0x30a381['attributes']=_[_0x5d43('0x32')](_0x14f95[_0x5d43('0x2e')],qs[_0x5d43('0x33')](_0x29f6b6[_0x5d43('0x2f')][_0x5d43('0x33')]));_0x30a381[_0x5d43('0x34')]=_0x30a381[_0x5d43('0x34')][_0x5d43('0x35')]?_0x30a381[_0x5d43('0x34')]:_0x14f95['model'];if(!_0x29f6b6[_0x5d43('0x2f')][_0x5d43('0x36')](_0x5d43('0x37'))){_0x30a381[_0x5d43('0x1e')]=qs['limit'](_0x29f6b6[_0x5d43('0x2f')][_0x5d43('0x1e')]);_0x30a381[_0x5d43('0x1c')]=qs[_0x5d43('0x1c')](_0x29f6b6[_0x5d43('0x2f')][_0x5d43('0x1c')]);}_0x30a381[_0x5d43('0x38')]=qs[_0x5d43('0x39')](_0x29f6b6[_0x5d43('0x2f')][_0x5d43('0x39')]);_0x30a381[_0x5d43('0x3a')]=qs[_0x5d43('0x31')](_[_0x5d43('0x3b')](_0x29f6b6[_0x5d43('0x2f')],_0x14f95['filters']),_0x58260b);if(_0x29f6b6['query'][_0x5d43('0x3c')]){_0x30a381[_0x5d43('0x3a')]=_[_0x5d43('0x3d')](_0x30a381[_0x5d43('0x3a')],{'$or':_['map'](_0x58260b,function(_0x1d877e){if(_0x1d877e[_0x5d43('0x2d')]!==_0x5d43('0x3e')){var _0x1d4e8b={};_0x1d4e8b[_0x1d877e['name']]={'$like':'%'+_0x29f6b6['query'][_0x5d43('0x3c')]+'%'};return _0x1d4e8b;}})});}_0x30a381=_[_0x5d43('0x3d')]({},_0x30a381,_0x29f6b6[_0x5d43('0x3f')]);var _0x232802={'where':_0x30a381[_0x5d43('0x3a')]};return db[_0x5d43('0x2c')]['count'](_0x232802)[_0x5d43('0x24')](function(_0x1bed03){_0x3d1c29[_0x5d43('0x1f')]=_0x1bed03;if(_0x29f6b6[_0x5d43('0x2f')][_0x5d43('0x40')]){_0x30a381['include']=[{'all':!![]}];}return db['SalesforceAccount']['findAll'](_0x30a381);})[_0x5d43('0x24')](function(_0x1889cf){_0x3d1c29['rows']=_0x1889cf;return _0x3d1c29;})[_0x5d43('0x24')](respondWithFilteredResult(_0x282ff3,_0x30a381))[_0x5d43('0x41')](handleError(_0x282ff3,null));};exports[_0x5d43('0x42')]=function(_0x958106,_0x297188){var _0x7b06a0={'raw':![],'where':{'id':_0x958106['params']['id']}},_0x24a127={};_0x24a127[_0x5d43('0x2e')]=_[_0x5d43('0x30')](db[_0x5d43('0x2c')][_0x5d43('0x43')]);_0x24a127['query']=_[_0x5d43('0x30')](_0x958106[_0x5d43('0x2f')]);_0x24a127[_0x5d43('0x31')]=_['intersection'](_0x24a127[_0x5d43('0x2e')],_0x24a127['query']);_0x7b06a0[_0x5d43('0x34')]=_['intersection'](_0x24a127[_0x5d43('0x2e')],qs[_0x5d43('0x33')](_0x958106[_0x5d43('0x2f')][_0x5d43('0x33')]));_0x7b06a0[_0x5d43('0x34')]=_0x7b06a0[_0x5d43('0x34')][_0x5d43('0x35')]?_0x7b06a0['attributes']:_0x24a127[_0x5d43('0x2e')];if(_0x958106[_0x5d43('0x2f')][_0x5d43('0x40')]){_0x7b06a0[_0x5d43('0x44')]=[{'all':!![]}];}_0x7b06a0=_[_0x5d43('0x3d')]({},_0x7b06a0,_0x958106[_0x5d43('0x3f')]);return db[_0x5d43('0x2c')][_0x5d43('0x45')](_0x7b06a0)['then'](handleEntityNotFound(_0x297188,null))[_0x5d43('0x24')](respondWithResult(_0x297188,null))[_0x5d43('0x41')](handleError(_0x297188,null));};exports[_0x5d43('0x46')]=function(_0x16ea49,_0x4fc5c6){return db[_0x5d43('0x2c')][_0x5d43('0x46')](_0x16ea49[_0x5d43('0x47')],{})['then'](respondWithResult(_0x4fc5c6,0xc9))['catch'](handleError(_0x4fc5c6,null));};exports['update']=function(_0x571fff,_0x56aed7){if(_0x571fff[_0x5d43('0x47')]['id']){delete _0x571fff[_0x5d43('0x47')]['id'];}return db[_0x5d43('0x2c')]['find']({'where':{'id':_0x571fff[_0x5d43('0x48')]['id']}})[_0x5d43('0x24')](handleEntityNotFound(_0x56aed7,null))[_0x5d43('0x24')](saveUpdates(_0x571fff[_0x5d43('0x47')],null))['then'](respondWithResult(_0x56aed7,null))['catch'](handleError(_0x56aed7,null));};exports[_0x5d43('0x25')]=function(_0x79387c,_0x11fef4){return db[_0x5d43('0x2c')][_0x5d43('0x45')]({'where':{'id':_0x79387c[_0x5d43('0x48')]['id']}})[_0x5d43('0x24')](handleEntityNotFound(_0x11fef4,null))[_0x5d43('0x24')](removeEntity(_0x11fef4,null))[_0x5d43('0x41')](handleError(_0x11fef4,null));};exports['getConfigurations']=function(_0x27b145,_0x271bd7,_0xd1e6df){var _0x340226={};var _0xbb7062={};var _0x2d10c2;var _0x12e2ef;return db[_0x5d43('0x2c')][_0x5d43('0x49')]({'where':{'id':_0x27b145['params']['id']}})['then'](handleEntityNotFound(_0x271bd7,null))[_0x5d43('0x24')](function(_0x47d56f){if(_0x47d56f){_0x2d10c2=_0x47d56f;_0xbb7062[_0x5d43('0x2e')]=_[_0x5d43('0x30')](db[_0x5d43('0x4a')][_0x5d43('0x43')]);_0xbb7062[_0x5d43('0x2f')]=_[_0x5d43('0x30')](_0x27b145[_0x5d43('0x2f')]);_0xbb7062[_0x5d43('0x31')]=_[_0x5d43('0x32')](_0xbb7062[_0x5d43('0x2e')],_0xbb7062['query']);_0x340226['attributes']=_[_0x5d43('0x32')](_0xbb7062[_0x5d43('0x2e')],qs[_0x5d43('0x33')](_0x27b145[_0x5d43('0x2f')][_0x5d43('0x33')]));_0x340226[_0x5d43('0x34')]=_0x340226[_0x5d43('0x34')]['length']?_0x340226['attributes']:_0xbb7062[_0x5d43('0x2e')];_0x340226[_0x5d43('0x38')]=qs[_0x5d43('0x39')](_0x27b145['query'][_0x5d43('0x39')]);_0x340226['where']=qs[_0x5d43('0x31')](_['pick'](_0x27b145[_0x5d43('0x2f')],_0xbb7062[_0x5d43('0x31')]));if(_0x27b145[_0x5d43('0x2f')][_0x5d43('0x3c')]){_0x340226['where']=_[_0x5d43('0x3d')](_0x340226[_0x5d43('0x3a')],{'$or':_[_0x5d43('0x2b')](_0x340226['attributes'],function(_0xd25f9d){var _0x26795b={};_0x26795b[_0xd25f9d]={'$like':'%'+_0x27b145['query'][_0x5d43('0x3c')]+'%'};return _0x26795b;})});}_0x340226=_['merge']({},_0x340226,_0x27b145['options']);return _0x2d10c2['getConfigurations'](_0x340226);}})[_0x5d43('0x24')](function(_0x5af887){if(_0x5af887){_0x12e2ef=_0x5af887[_0x5d43('0x35')];if(!_0x27b145['query'][_0x5d43('0x36')](_0x5d43('0x37'))){_0x340226[_0x5d43('0x1e')]=qs[_0x5d43('0x1e')](_0x27b145[_0x5d43('0x2f')]['limit']);_0x340226[_0x5d43('0x1c')]=qs['offset'](_0x27b145[_0x5d43('0x2f')][_0x5d43('0x1c')]);}return _0x2d10c2[_0x5d43('0x4b')](_0x340226);}})['then'](function(_0x34f849){if(_0x34f849){return _0x34f849?{'count':_0x12e2ef,'rows':_0x34f849}:null;}})[_0x5d43('0x24')](respondWithResult(_0x271bd7,null))['catch'](handleError(_0x271bd7,null));};exports['addConfiguration']=function(_0x26d078,_0x94d0ff,_0x27e8eb){if(_0x26d078['body']['id']){delete _0x26d078[_0x5d43('0x47')]['id'];}return db[_0x5d43('0x2c')]['findOne']({'where':{'id':_0x26d078['params']['id']}})[_0x5d43('0x24')](handleEntityNotFound(_0x94d0ff,null))[_0x5d43('0x24')](function(_0xab40d2){if(_0xab40d2){_0x26d078[_0x5d43('0x47')][_0x5d43('0x4c')]=_0xab40d2['id'];_0x26d078[_0x5d43('0x47')][_0x5d43('0x4d')]=integrations[_0x5d43('0x4e')](_0x26d078['body']['channel'],_0x26d078[_0x5d43('0x47')][_0x5d43('0x2d')]);_0x26d078['body'][_0x5d43('0x4f')]=integrations[_0x5d43('0x50')](_0x26d078[_0x5d43('0x47')][_0x5d43('0x51')],_0x26d078[_0x5d43('0x47')]['type']);return db[_0x5d43('0x4a')][_0x5d43('0x46')](_0x26d078[_0x5d43('0x47')],{'include':[{'model':db[_0x5d43('0x52')],'as':'Subjects'},{'model':db[_0x5d43('0x52')],'as':_0x5d43('0x4f')}]});}return null;})['then'](respondWithResult(_0x94d0ff,null))[_0x5d43('0x41')](handleError(_0x94d0ff,null));};exports[_0x5d43('0x53')]=function(_0x271def,_0x4b6f5c,_0x2e4d3d){var _0x37a473;var _0x11310d='';var _0x64978a='Task';return db[_0x5d43('0x2c')][_0x5d43('0x49')]({'where':{'id':_0x271def[_0x5d43('0x48')]['id']},'attributes':['id',_0x5d43('0x54'),'clientId',_0x5d43('0x55'),_0x5d43('0x56'),_0x5d43('0x57'),_0x5d43('0x58')]})['then'](handleEntityNotFound(_0x4b6f5c,null))[_0x5d43('0x24')](function(_0x39d91b){if(_0x39d91b){_0x11310d=_0x39d91b['remoteUri'];var _0x5cd005=_0x11310d[_0x5d43('0x59')](-0x1);if(_0x5cd005==='/'){_0x11310d=_0x11310d['substring'](0x0,_0x11310d[_0x5d43('0x5a')](_0x5cd005));}_0x37a473=new jsforce[(_0x5d43('0x5b'))]({'oauth2':{'loginUrl':_0x11310d,'clientId':_0x39d91b[_0x5d43('0x5c')],'clientSecret':_0x39d91b['clientSecret']}});return _0x37a473[_0x5d43('0x5d')](_0x39d91b[_0x5d43('0x56')],_0x39d91b[_0x5d43('0x57')][_0x5d43('0x5e')](_0x39d91b[_0x5d43('0x58')]));}})[_0x5d43('0x24')](function(_0xc3196a){if(_0xc3196a){if(!_['isNil'](_0x271def[_0x5d43('0x2f')]['ticketType'])){_0x64978a=_0x271def['query'][_0x5d43('0x5f')];}return _0x37a473[_0x5d43('0x60')](_0x64978a)[_0x5d43('0x61')]();}})['then'](function(_0x5f1e7e){var _0x1f4216=[_0x5d43('0x62'),'ActivityDate',_0x5d43('0x63'),'IsRecurrence',_0x5d43('0x64'),_0x5d43('0x65')];var _0x8badfc=[_0x5d43('0x66'),_0x5d43('0x67'),_0x5d43('0x68'),'boolean',_0x5d43('0x69'),_0x5d43('0x6a'),'phone'];if(_0x5f1e7e){_['remove'](_0x5f1e7e['fields'],function(_0x108f38){return _0x1f4216[_0x5d43('0x6b')](_0x108f38['name'])||!_0x8badfc['includes'](_0x108f38['type']);});return{'count':_0x5f1e7e[_0x5d43('0x33')][_0x5d43('0x35')],'rows':_['map'](_0x5f1e7e[_0x5d43('0x33')],function(_0x38a0a2){return{'id':_0x38a0a2[_0x5d43('0x28')],'name':_0x38a0a2['label'],'custom':_0x38a0a2[_0x5d43('0x6c')],'options':_0x38a0a2[_0x5d43('0x6d')][_0x5d43('0x35')]>0x0?_[_0x5d43('0x2b')](_0x38a0a2[_0x5d43('0x6d')],function(_0x4057bd){return{'name':_0x4057bd[_0x5d43('0x6e')],'value':_0x4057bd[_0x5d43('0x6f')]};}):_0x38a0a2[_0x5d43('0x2d')]==_0x5d43('0x70')?[{'name':'True','value':_0x5d43('0x71')},{'name':_0x5d43('0x72'),'value':_0x5d43('0x73')}]:[]};})};}})[_0x5d43('0x24')](respondWithResult(_0x4b6f5c,null))['catch'](function(_0x3f851f){var _0xfe6196=_0x271def[_0x5d43('0x2f')][_0x5d43('0x74')]?0x1f4:_0x3f851f[_0x5d43('0x75')]||0x1f4;logger[_0x5d43('0x26')]('getFields,\x20%s,\x20%s,\x20%s',_0x5d43('0x53'),_0xfe6196,JSON['stringify'](_0x3f851f));delete _0x3f851f[_0x5d43('0x28')];if(_0xfe6196===0x191){_0xfe6196=0x190;}_0x4b6f5c['status'](_0xfe6196)[_0x5d43('0x29')](_0x271def['query'][_0x5d43('0x74')]?{'message':_0x5d43('0x76'),'statusCode':_0x3f851f[_0x5d43('0x75')]}:_0x3f851f);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index b3ef1d4..106bb3a 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 _0x2e14=['rimraf','../../config/environment','./intSalesforceAccount.attributes','exports','define','int_salesforce_accounts','lodash','util','api','bluebird','request-promise','path'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x2e14,0xae));var _0x42e1=function(_0x4e0157,_0x147213){_0x4e0157=_0x4e0157-0x0;var _0x13a010=_0x2e14[_0x4e0157];return _0x13a010;};'use strict';var _=require(_0x42e1('0x0'));var util=require(_0x42e1('0x1'));var logger=require('../../config/logger')(_0x42e1('0x2'));var moment=require('moment');var BPromise=require(_0x42e1('0x3'));var rp=require(_0x42e1('0x4'));var fs=require('fs');var path=require(_0x42e1('0x5'));var rimraf=require(_0x42e1('0x6'));var config=require(_0x42e1('0x7'));var attributes=require(_0x42e1('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x42e1('0x9')]=function(_0x42815d,_0x38ffe0){return _0x42815d[_0x42e1('0xa')]('SalesforceAccount',attributes,{'tableName':_0x42e1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd89d=['../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','int_salesforce_accounts','util','api','bluebird','request-promise'];(function(_0x6767c9,_0x515aa2){var _0x56a8f2=function(_0x8344f6){while(--_0x8344f6){_0x6767c9['push'](_0x6767c9['shift']());}};_0x56a8f2(++_0x515aa2);}(_0xd89d,0x96));var _0xdd89=function(_0x3eaa34,_0x4f6f82){_0x3eaa34=_0x3eaa34-0x0;var _0x143cc9=_0xd89d[_0x3eaa34];return _0x143cc9;};'use strict';var _=require('lodash');var util=require(_0xdd89('0x0'));var logger=require('../../config/logger')(_0xdd89('0x1'));var moment=require('moment');var BPromise=require(_0xdd89('0x2'));var rp=require(_0xdd89('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xdd89('0x4'));var attributes=require(_0xdd89('0x5'));var integrations=require(_0xdd89('0x6'));module[_0xdd89('0x7')]=function(_0x50edec,_0x2ae3a0){return _0x50edec[_0xdd89('0x8')](_0xdd89('0x9'),attributes,{'tableName':_0xdd89('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 6ba021d..d4e6941 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 _0xa1f8=['SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','code','error','message','result','GetSalesforceAccount','options','raw','where','limit','model','attributes','include','map','then','stringify','ShowSalesforceAccount','find','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x523615,_0x210b6f){var _0x427d0f=function(_0x52b3d7){while(--_0x52b3d7){_0x523615['push'](_0x523615['shift']());}};_0x427d0f(++_0x210b6f);}(_0xa1f8,0x7f));var _0x8a1f=function(_0x3ed909,_0x3b9d4e){_0x3ed909=_0x3ed909-0x0;var _0x45dacb=_0xa1f8[_0x3ed909];return _0x45dacb;};'use strict';var _=require(_0x8a1f('0x0'));var util=require('util');var moment=require(_0x8a1f('0x1'));var BPromise=require('bluebird');var rs=require(_0x8a1f('0x2'));var fs=require('fs');var Redis=require(_0x8a1f('0x3'));var db=require(_0x8a1f('0x4'))['db'];var utils=require(_0x8a1f('0x5'));var logger=require('../../config/logger')(_0x8a1f('0x6'));var config=require(_0x8a1f('0x7'));var jayson=require(_0x8a1f('0x8'));var client=jayson[_0x8a1f('0x9')][_0x8a1f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x402404,_0x46d2d6,_0x75625b){return new BPromise(function(_0x15cfbc,_0x2c8c1c){return client[_0x8a1f('0xb')](_0x402404,_0x75625b)['then'](function(_0x1cce2a){logger[_0x8a1f('0xc')](_0x8a1f('0xd'),_0x46d2d6,_0x8a1f('0xe'));logger[_0x8a1f('0xf')](_0x8a1f('0x10'),_0x46d2d6,_0x8a1f('0xe'),JSON['stringify'](_0x1cce2a));if(_0x1cce2a['error']){if(_0x1cce2a['error'][_0x8a1f('0x11')]===0x1f4){logger[_0x8a1f('0x12')](_0x8a1f('0xd'),_0x46d2d6,_0x1cce2a[_0x8a1f('0x12')][_0x8a1f('0x13')]);return _0x2c8c1c(_0x1cce2a[_0x8a1f('0x12')][_0x8a1f('0x13')]);}logger[_0x8a1f('0x12')](_0x8a1f('0xd'),_0x46d2d6,_0x1cce2a[_0x8a1f('0x12')][_0x8a1f('0x13')]);return _0x15cfbc(_0x1cce2a[_0x8a1f('0x12')][_0x8a1f('0x13')]);}else{logger['info']('SalesforceAccount,\x20%s,\x20%s',_0x46d2d6,_0x8a1f('0xe'));_0x15cfbc(_0x1cce2a[_0x8a1f('0x14')]['message']);}})['catch'](function(_0x23846a){logger[_0x8a1f('0x12')](_0x8a1f('0xd'),_0x46d2d6,_0x23846a);_0x2c8c1c(_0x23846a);});});}exports[_0x8a1f('0x15')]=function(_0x396587){var _0x747aab=this;return new Promise(function(_0x119b91,_0x32c78d){return db['SalesforceAccount']['findAll']({'raw':_0x396587[_0x8a1f('0x16')]?_0x396587['options'][_0x8a1f('0x17')]===undefined?!![]:![]:!![],'where':_0x396587[_0x8a1f('0x16')]?_0x396587[_0x8a1f('0x16')][_0x8a1f('0x18')]||null:null,'attributes':_0x396587[_0x8a1f('0x16')]?_0x396587[_0x8a1f('0x16')]['attributes']||null:null,'limit':_0x396587[_0x8a1f('0x16')]?_0x396587[_0x8a1f('0x16')][_0x8a1f('0x19')]||null:null,'include':_0x396587[_0x8a1f('0x16')]?_0x396587[_0x8a1f('0x16')]['include']?_['map'](_0x396587['options']['include'],function(_0x8a8c7){return{'model':db[_0x8a8c7[_0x8a1f('0x1a')]],'as':_0x8a8c7['as'],'attributes':_0x8a8c7[_0x8a1f('0x1b')],'include':_0x8a8c7[_0x8a1f('0x1c')]?_[_0x8a1f('0x1d')](_0x8a8c7[_0x8a1f('0x1c')],function(_0x359430){return{'model':db[_0x359430[_0x8a1f('0x1a')]],'as':_0x359430['as'],'attributes':_0x359430['attributes'],'include':_0x359430['include']?_[_0x8a1f('0x1d')](_0x359430[_0x8a1f('0x1c')],function(_0x50f324){return{'model':db[_0x50f324[_0x8a1f('0x1a')]],'as':_0x50f324['as'],'attributes':_0x50f324['attributes']};}):[]};}):[]};}):[]:[]})[_0x8a1f('0x1e')](function(_0x57c1ba){logger[_0x8a1f('0xc')](_0x8a1f('0x15'),_0x396587);logger['debug'](_0x8a1f('0x15'),_0x396587,JSON[_0x8a1f('0x1f')](_0x57c1ba));_0x119b91(_0x57c1ba);})['catch'](function(_0x18fe5d){logger['error'](_0x8a1f('0x15'),_0x18fe5d[_0x8a1f('0x13')],_0x396587);_0x32c78d(_0x747aab[_0x8a1f('0x12')](0x1f4,_0x18fe5d[_0x8a1f('0x13')]));});});};exports[_0x8a1f('0x20')]=function(_0xb3cb68){var _0x361f1e=this;return new Promise(function(_0x52ecda,_0x238e83){return db['SalesforceAccount'][_0x8a1f('0x21')]({'raw':_0xb3cb68[_0x8a1f('0x16')]?_0xb3cb68['options'][_0x8a1f('0x17')]===undefined?!![]:![]:!![],'where':_0xb3cb68[_0x8a1f('0x16')]?_0xb3cb68[_0x8a1f('0x16')][_0x8a1f('0x18')]||null:null,'attributes':_0xb3cb68[_0x8a1f('0x16')]?_0xb3cb68['options'][_0x8a1f('0x1b')]||null:null,'include':_0xb3cb68[_0x8a1f('0x16')]?_0xb3cb68[_0x8a1f('0x16')][_0x8a1f('0x1c')]?_[_0x8a1f('0x1d')](_0xb3cb68[_0x8a1f('0x16')][_0x8a1f('0x1c')],function(_0x27b36c){return{'model':db[_0x27b36c['model']],'as':_0x27b36c['as'],'attributes':_0x27b36c[_0x8a1f('0x1b')],'include':_0x27b36c[_0x8a1f('0x1c')]?_[_0x8a1f('0x1d')](_0x27b36c[_0x8a1f('0x1c')],function(_0x290206){return{'model':db[_0x290206['model']],'as':_0x290206['as'],'attributes':_0x290206[_0x8a1f('0x1b')],'include':_0x290206[_0x8a1f('0x1c')]?_[_0x8a1f('0x1d')](_0x290206['include'],function(_0x24728f){return{'model':db[_0x24728f['model']],'as':_0x24728f['as'],'attributes':_0x24728f[_0x8a1f('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x39c4e1){logger[_0x8a1f('0xc')](_0x8a1f('0x20'),_0xb3cb68);logger['debug'](_0x8a1f('0x20'),_0xb3cb68,JSON['stringify'](_0x39c4e1));_0x52ecda(_0x39c4e1);})[_0x8a1f('0x22')](function(_0x53ade5){logger['error'](_0x8a1f('0x20'),_0x53ade5[_0x8a1f('0x13')],_0xb3cb68);_0x238e83(_0x361f1e[_0x8a1f('0x12')](0x1f4,_0x53ade5[_0x8a1f('0x13')]));});});}; \ No newline at end of file +var _0xd798=['SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceAccount,\x20%s,\x20%s','message','result','GetSalesforceAccount','options','raw','limit','include','map','attributes','model','ShowSalesforceAccount','SalesforceAccount','find','where','catch','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug'];(function(_0x3e5cd5,_0x58272b){var _0x1b8d19=function(_0x3e216b){while(--_0x3e216b){_0x3e5cd5['push'](_0x3e5cd5['shift']());}};_0x1b8d19(++_0x58272b);}(_0xd798,0x77));var _0x8d79=function(_0x520c92,_0x3c5346){_0x520c92=_0x520c92-0x0;var _0x55a052=_0xd798[_0x520c92];return _0x55a052;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x8d79('0x0'));var rs=require(_0x8d79('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8d79('0x2'));var logger=require(_0x8d79('0x3'))(_0x8d79('0x4'));var config=require('../../config/environment');var jayson=require(_0x8d79('0x5'));var client=jayson[_0x8d79('0x6')][_0x8d79('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1cc9bb,_0x12f353,_0x2d3738){return new BPromise(function(_0x767442,_0x2848f7){return client[_0x8d79('0x8')](_0x1cc9bb,_0x2d3738)[_0x8d79('0x9')](function(_0x1f571e){logger[_0x8d79('0xa')]('SalesforceAccount,\x20%s,\x20%s',_0x12f353,_0x8d79('0xb'));logger[_0x8d79('0xc')](_0x8d79('0xd'),_0x12f353,_0x8d79('0xb'),JSON[_0x8d79('0xe')](_0x1f571e));if(_0x1f571e[_0x8d79('0xf')]){if(_0x1f571e[_0x8d79('0xf')][_0x8d79('0x10')]===0x1f4){logger[_0x8d79('0xf')](_0x8d79('0x11'),_0x12f353,_0x1f571e['error'][_0x8d79('0x12')]);return _0x2848f7(_0x1f571e[_0x8d79('0xf')][_0x8d79('0x12')]);}logger[_0x8d79('0xf')](_0x8d79('0x11'),_0x12f353,_0x1f571e['error']['message']);return _0x767442(_0x1f571e[_0x8d79('0xf')][_0x8d79('0x12')]);}else{logger['info']('SalesforceAccount,\x20%s,\x20%s',_0x12f353,_0x8d79('0xb'));_0x767442(_0x1f571e[_0x8d79('0x13')][_0x8d79('0x12')]);}})['catch'](function(_0x10885f){logger['error'](_0x8d79('0x11'),_0x12f353,_0x10885f);_0x2848f7(_0x10885f);});});}exports[_0x8d79('0x14')]=function(_0x32484e){var _0x30c411=this;return new Promise(function(_0x1bf0a0,_0x58b010){return db['SalesforceAccount']['findAll']({'raw':_0x32484e[_0x8d79('0x15')]?_0x32484e[_0x8d79('0x15')][_0x8d79('0x16')]===undefined?!![]:![]:!![],'where':_0x32484e['options']?_0x32484e['options']['where']||null:null,'attributes':_0x32484e[_0x8d79('0x15')]?_0x32484e['options']['attributes']||null:null,'limit':_0x32484e[_0x8d79('0x15')]?_0x32484e['options'][_0x8d79('0x17')]||null:null,'include':_0x32484e[_0x8d79('0x15')]?_0x32484e['options'][_0x8d79('0x18')]?_[_0x8d79('0x19')](_0x32484e[_0x8d79('0x15')][_0x8d79('0x18')],function(_0x3c1cd1){return{'model':db[_0x3c1cd1['model']],'as':_0x3c1cd1['as'],'attributes':_0x3c1cd1[_0x8d79('0x1a')],'include':_0x3c1cd1['include']?_[_0x8d79('0x19')](_0x3c1cd1['include'],function(_0x56ced4){return{'model':db[_0x56ced4[_0x8d79('0x1b')]],'as':_0x56ced4['as'],'attributes':_0x56ced4[_0x8d79('0x1a')],'include':_0x56ced4[_0x8d79('0x18')]?_[_0x8d79('0x19')](_0x56ced4[_0x8d79('0x18')],function(_0x87fb0f){return{'model':db[_0x87fb0f['model']],'as':_0x87fb0f['as'],'attributes':_0x87fb0f[_0x8d79('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8d79('0x9')](function(_0x2430e5){logger[_0x8d79('0xa')](_0x8d79('0x14'),_0x32484e);logger[_0x8d79('0xc')](_0x8d79('0x14'),_0x32484e,JSON[_0x8d79('0xe')](_0x2430e5));_0x1bf0a0(_0x2430e5);})['catch'](function(_0x59107e){logger['error'](_0x8d79('0x14'),_0x59107e['message'],_0x32484e);_0x58b010(_0x30c411[_0x8d79('0xf')](0x1f4,_0x59107e['message']));});});};exports[_0x8d79('0x1c')]=function(_0x18e148){var _0x3728e3=this;return new Promise(function(_0x52a6cd,_0x18f64b){return db[_0x8d79('0x1d')][_0x8d79('0x1e')]({'raw':_0x18e148[_0x8d79('0x15')]?_0x18e148['options']['raw']===undefined?!![]:![]:!![],'where':_0x18e148[_0x8d79('0x15')]?_0x18e148[_0x8d79('0x15')][_0x8d79('0x1f')]||null:null,'attributes':_0x18e148[_0x8d79('0x15')]?_0x18e148[_0x8d79('0x15')][_0x8d79('0x1a')]||null:null,'include':_0x18e148['options']?_0x18e148[_0x8d79('0x15')][_0x8d79('0x18')]?_[_0x8d79('0x19')](_0x18e148[_0x8d79('0x15')][_0x8d79('0x18')],function(_0x195dbd){return{'model':db[_0x195dbd[_0x8d79('0x1b')]],'as':_0x195dbd['as'],'attributes':_0x195dbd[_0x8d79('0x1a')],'include':_0x195dbd['include']?_[_0x8d79('0x19')](_0x195dbd[_0x8d79('0x18')],function(_0x442847){return{'model':db[_0x442847[_0x8d79('0x1b')]],'as':_0x442847['as'],'attributes':_0x442847[_0x8d79('0x1a')],'include':_0x442847['include']?_[_0x8d79('0x19')](_0x442847['include'],function(_0x22fee4){return{'model':db[_0x22fee4[_0x8d79('0x1b')]],'as':_0x22fee4['as'],'attributes':_0x22fee4[_0x8d79('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8d79('0x9')](function(_0x1fd2aa){logger['info'](_0x8d79('0x1c'),_0x18e148);logger['debug']('ShowSalesforceAccount',_0x18e148,JSON[_0x8d79('0xe')](_0x1fd2aa));_0x52a6cd(_0x1fd2aa);})[_0x8d79('0x20')](function(_0x684ab7){logger['error'](_0x8d79('0x1c'),_0x684ab7['message'],_0x18e148);_0x18f64b(_0x3728e3[_0x8d79('0xf')](0x1f4,_0x684ab7[_0x8d79('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index bab4622..797209a 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 _0x5f2f=['Router','fs-extra','../../components/auth/service','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','create','put','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x2fc1f0,_0x49f1ac){var _0x4074d9=function(_0x3ebcf3){while(--_0x3ebcf3){_0x2fc1f0['push'](_0x2fc1f0['shift']());}};_0x4074d9(++_0x49f1ac);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5a5379,_0x58dee3){_0x5a5379=_0x5a5379-0x0;var _0x419fcc=_0x5f2f[_0x5a5379];return _0x419fcc;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x9')](_0xf5f2('0x10'),auth['isAuthenticated'](),controller[_0xf5f2('0x11')]);router['get']('/:id/descriptions',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x12')]);router['post']('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x13')]);router[_0xf5f2('0x14')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x15')]);router['delete'](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x16')]);module[_0xf5f2('0x17')]=router; \ No newline at end of file +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(_0x4c2236,_0x1ad81d){var _0x1f74f6=function(_0x230e74){while(--_0x230e74){_0x4c2236['push'](_0x4c2236['shift']());}};_0x1f74f6(++_0x1ad81d);}(_0x7a54,0x106));var _0x47a5=function(_0x1d88ea,_0x474bc8){_0x1d88ea=_0x1d88ea-0x0;var _0x40b945=_0x7a54[_0x1d88ea];return _0x40b945;};'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 diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 621e1fd..c8104c3 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 _0x12f1=['account_contact_lead','account','lead','STRING','sequelize','ENUM','Task','Case','contact_lead','contact'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x12f1,0x14e));var _0x112f=function(_0x5c2f7e,_0x428fe0){_0x5c2f7e=_0x5c2f7e-0x0;var _0x4cc408=_0x12f1[_0x5c2f7e];return _0x4cc408;};'use strict';var Sequelize=require(_0x112f('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x112f('0x1')](_0x112f('0x2'),_0x112f('0x3')),'defaultValue':_0x112f('0x2')},'moduleSearch':{'type':Sequelize[_0x112f('0x1')](_0x112f('0x4'),_0x112f('0x5'),'lead',_0x112f('0x6'),_0x112f('0x7')),'defaultValue':_0x112f('0x4')},'moduleCreate':{'type':Sequelize[_0x112f('0x1')]('nothing',_0x112f('0x5'),_0x112f('0x8'),_0x112f('0x7')),'defaultValue':_0x112f('0x8')},'leadId':{'type':Sequelize[_0x112f('0x9')]},'additionalSearchAccount':{'type':Sequelize[_0x112f('0x9')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3173=['contact','account_contact_lead','account','nothing','lead','STRING','sequelize','ENUM','Case','Task','contact_lead'];(function(_0x35efd7,_0x5a97e6){var _0x3d9b5d=function(_0x45fa98){while(--_0x45fa98){_0x35efd7['push'](_0x35efd7['shift']());}};_0x3d9b5d(++_0x5a97e6);}(_0x3173,0x13a));var _0x3317=function(_0x1ff000,_0xad53ed){_0x1ff000=_0x1ff000-0x0;var _0x4da9f5=_0x3173[_0x1ff000];return _0x4da9f5;};'use strict';var Sequelize=require(_0x3317('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x3317('0x1')]('Task',_0x3317('0x2')),'defaultValue':_0x3317('0x3')},'moduleSearch':{'type':Sequelize[_0x3317('0x1')](_0x3317('0x4'),_0x3317('0x5'),'lead',_0x3317('0x6'),_0x3317('0x7')),'defaultValue':_0x3317('0x4')},'moduleCreate':{'type':Sequelize[_0x3317('0x1')](_0x3317('0x8'),_0x3317('0x5'),'lead','account'),'defaultValue':_0x3317('0x9')},'leadId':{'type':Sequelize[_0x3317('0xa')]},'additionalSearchAccount':{'type':Sequelize[_0x3317('0xa')]},'additionalSearchContact':{'type':Sequelize[_0x3317('0xa')]},'additionalSearchLead':{'type':Sequelize[_0x3317('0xa')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 002a5fb..78536c3 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 _0xee5c=['destroy','sendStatus','error','stack','name','send','index','map','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','filters','pick','where','merge','options','SalesforceConfiguration','includeAll','include','findAll','rows','show','params','rawAttributes','catch','create','body','getFields','findOne','SalesforceField','filter','hasOwnProperty','getSubjects','order','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0xee5c,0xcd));var _0xcee5=function(_0x4c3ffe,_0x457374){_0x4c3ffe=_0x4c3ffe-0x0;var _0x28d3eb=_0xee5c[_0x4c3ffe];return _0x28d3eb;};'use strict';var emlformat=require(_0xcee5('0x0'));var rimraf=require(_0xcee5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcee5('0x2'));var rp=require(_0xcee5('0x3'));var moment=require('moment');var BPromise=require(_0xcee5('0x4'));var Mustache=require(_0xcee5('0x5'));var util=require(_0xcee5('0x6'));var path=require(_0xcee5('0x7'));var sox=require(_0xcee5('0x8'));var csv=require(_0xcee5('0x9'));var ejs=require(_0xcee5('0xa'));var fs=require('fs');var fs_extra=require(_0xcee5('0xb'));var _=require('lodash');var squel=require(_0xcee5('0xc'));var crypto=require('crypto');var jsforce=require(_0xcee5('0xd'));var deskjs=require(_0xcee5('0xe'));var toCsv=require(_0xcee5('0x9'));var querystring=require('querystring');var Papa=require(_0xcee5('0xf'));var Redis=require(_0xcee5('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xcee5('0x11'));var as=require(_0xcee5('0x12'));var hardwareService=require(_0xcee5('0x13'));var logger=require(_0xcee5('0x14'))(_0xcee5('0x15'));var utils=require(_0xcee5('0x16'));var config=require(_0xcee5('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xcee5('0x18'))['db'];function respondWithStatusCode(_0x4baf3c,_0xaf9da5){_0xaf9da5=_0xaf9da5||0xcc;return function(_0x1e6384){if(_0x1e6384){return _0x4baf3c['sendStatus'](_0xaf9da5);}return _0x4baf3c[_0xcee5('0x19')](_0xaf9da5)[_0xcee5('0x1a')]();};}function respondWithResult(_0x227a5a,_0x21c41c){_0x21c41c=_0x21c41c||0xc8;return function(_0x1b3877){if(_0x1b3877){return _0x227a5a[_0xcee5('0x19')](_0x21c41c)[_0xcee5('0x1b')](_0x1b3877);}};}function respondWithFilteredResult(_0x4f1777,_0x85e7aa){return function(_0x440df1){if(_0x440df1){var _0x39f159=typeof _0x85e7aa['offset']===_0xcee5('0x1c')&&typeof _0x85e7aa[_0xcee5('0x1d')]===_0xcee5('0x1c');var _0x442071=_0x440df1[_0xcee5('0x1e')];var _0x1c21d6=_0x39f159?0x0:_0x85e7aa['offset'];var _0x37285c=_0x39f159?_0x440df1[_0xcee5('0x1e')]:_0x85e7aa[_0xcee5('0x1f')]+_0x85e7aa[_0xcee5('0x1d')];var _0x5453d0;if(_0x37285c>=_0x442071){_0x37285c=_0x442071;_0x5453d0=0xc8;}else{_0x5453d0=0xce;}_0x4f1777[_0xcee5('0x19')](_0x5453d0);return _0x4f1777[_0xcee5('0x20')](_0xcee5('0x21'),_0x1c21d6+'-'+_0x37285c+'/'+_0x442071)[_0xcee5('0x1b')](_0x440df1);}return null;};}function patchUpdates(_0x5dd5de){return function(_0x97a01){try{jsonpatch[_0xcee5('0x22')](_0x97a01,_0x5dd5de,!![]);}catch(_0x47bd20){return BPromise['reject'](_0x47bd20);}return _0x97a01[_0xcee5('0x23')]();};}function saveUpdates(_0x19287a,_0x21b3c5){return function(_0xa138dc){if(_0xa138dc){return _0xa138dc[_0xcee5('0x24')](_0x19287a)[_0xcee5('0x25')](function(_0x24953b){return _0x24953b;});}return null;};}function removeEntity(_0x13ad26,_0x27ea1c){return function(_0x547fab){if(_0x547fab){return _0x547fab[_0xcee5('0x26')]()[_0xcee5('0x25')](function(){_0x13ad26[_0xcee5('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3625c3,_0x13c51a){return function(_0x4353b6){if(!_0x4353b6){_0x3625c3[_0xcee5('0x27')](0x194);}return _0x4353b6;};}function handleError(_0x19f694,_0x1909ab){_0x1909ab=_0x1909ab||0x1f4;return function(_0x31c944){logger[_0xcee5('0x28')](_0x31c944[_0xcee5('0x29')]);if(_0x31c944[_0xcee5('0x2a')]){delete _0x31c944[_0xcee5('0x2a')];}_0x19f694[_0xcee5('0x19')](_0x1909ab)[_0xcee5('0x2b')](_0x31c944);};}exports[_0xcee5('0x2c')]=function(_0x58b236,_0x303897){var _0x2e35d3={},_0x373378={},_0x1bcc2a={'count':0x0,'rows':[]};var _0x506390=_[_0xcee5('0x2d')](db['SalesforceConfiguration']['rawAttributes'],function(_0x14b9d5){return{'name':_0x14b9d5['fieldName'],'type':_0x14b9d5[_0xcee5('0x2e')][_0xcee5('0x2f')]};});_0x373378[_0xcee5('0x30')]=_[_0xcee5('0x2d')](_0x506390,'name');_0x373378[_0xcee5('0x31')]=_[_0xcee5('0x32')](_0x58b236['query']);_0x373378['filters']=_[_0xcee5('0x33')](_0x373378[_0xcee5('0x30')],_0x373378[_0xcee5('0x31')]);_0x2e35d3[_0xcee5('0x34')]=_[_0xcee5('0x33')](_0x373378[_0xcee5('0x30')],qs[_0xcee5('0x35')](_0x58b236['query']['fields']));_0x2e35d3[_0xcee5('0x34')]=_0x2e35d3['attributes'][_0xcee5('0x36')]?_0x2e35d3[_0xcee5('0x34')]:_0x373378[_0xcee5('0x30')];if(!_0x58b236['query']['hasOwnProperty'](_0xcee5('0x37'))){_0x2e35d3[_0xcee5('0x1d')]=qs[_0xcee5('0x1d')](_0x58b236['query'][_0xcee5('0x1d')]);_0x2e35d3['offset']=qs['offset'](_0x58b236[_0xcee5('0x31')][_0xcee5('0x1f')]);}_0x2e35d3['order']=qs[_0xcee5('0x38')](_0x58b236['query'][_0xcee5('0x38')]);_0x2e35d3['where']=qs[_0xcee5('0x39')](_[_0xcee5('0x3a')](_0x58b236[_0xcee5('0x31')],_0x373378[_0xcee5('0x39')]),_0x506390);if(_0x58b236[_0xcee5('0x31')]['filter']){_0x2e35d3['where']=_['merge'](_0x2e35d3[_0xcee5('0x3b')],{'$or':_[_0xcee5('0x2d')](_0x506390,function(_0x41fe72){if(_0x41fe72[_0xcee5('0x2e')]!=='VIRTUAL'){var _0x4a7d29={};_0x4a7d29[_0x41fe72['name']]={'$like':'%'+_0x58b236['query']['filter']+'%'};return _0x4a7d29;}})});}_0x2e35d3=_[_0xcee5('0x3c')]({},_0x2e35d3,_0x58b236[_0xcee5('0x3d')]);var _0x9271a5={'where':_0x2e35d3[_0xcee5('0x3b')]};return db[_0xcee5('0x3e')][_0xcee5('0x1e')](_0x9271a5)[_0xcee5('0x25')](function(_0x261593){_0x1bcc2a[_0xcee5('0x1e')]=_0x261593;if(_0x58b236[_0xcee5('0x31')][_0xcee5('0x3f')]){_0x2e35d3[_0xcee5('0x40')]=[{'all':!![]}];}return db[_0xcee5('0x3e')][_0xcee5('0x41')](_0x2e35d3);})[_0xcee5('0x25')](function(_0x5e1ed9){_0x1bcc2a[_0xcee5('0x42')]=_0x5e1ed9;return _0x1bcc2a;})[_0xcee5('0x25')](respondWithFilteredResult(_0x303897,_0x2e35d3))['catch'](handleError(_0x303897,null));};exports[_0xcee5('0x43')]=function(_0xc35baf,_0x3f42d6){var _0x3468af={'raw':![],'where':{'id':_0xc35baf[_0xcee5('0x44')]['id']}},_0x17f633={};_0x17f633['model']=_[_0xcee5('0x32')](db['SalesforceConfiguration'][_0xcee5('0x45')]);_0x17f633[_0xcee5('0x31')]=_[_0xcee5('0x32')](_0xc35baf[_0xcee5('0x31')]);_0x17f633[_0xcee5('0x39')]=_[_0xcee5('0x33')](_0x17f633[_0xcee5('0x30')],_0x17f633['query']);_0x3468af[_0xcee5('0x34')]=_[_0xcee5('0x33')](_0x17f633[_0xcee5('0x30')],qs[_0xcee5('0x35')](_0xc35baf[_0xcee5('0x31')][_0xcee5('0x35')]));_0x3468af[_0xcee5('0x34')]=_0x3468af[_0xcee5('0x34')][_0xcee5('0x36')]?_0x3468af[_0xcee5('0x34')]:_0x17f633[_0xcee5('0x30')];if(_0xc35baf[_0xcee5('0x31')][_0xcee5('0x3f')]){_0x3468af['include']=[{'all':!![]}];}_0x3468af=_[_0xcee5('0x3c')]({},_0x3468af,_0xc35baf[_0xcee5('0x3d')]);return db[_0xcee5('0x3e')]['find'](_0x3468af)[_0xcee5('0x25')](handleEntityNotFound(_0x3f42d6,null))[_0xcee5('0x25')](respondWithResult(_0x3f42d6,null))[_0xcee5('0x46')](handleError(_0x3f42d6,null));};exports[_0xcee5('0x47')]=function(_0x345a61,_0xf96545){return db[_0xcee5('0x3e')][_0xcee5('0x47')](_0x345a61[_0xcee5('0x48')],{})[_0xcee5('0x25')](respondWithResult(_0xf96545,0xc9))[_0xcee5('0x46')](handleError(_0xf96545,null));};exports[_0xcee5('0x24')]=function(_0x2cd757,_0x333e63){if(_0x2cd757[_0xcee5('0x48')]['id']){delete _0x2cd757['body']['id'];}return db[_0xcee5('0x3e')]['find']({'where':{'id':_0x2cd757[_0xcee5('0x44')]['id']}})[_0xcee5('0x25')](handleEntityNotFound(_0x333e63,null))[_0xcee5('0x25')](saveUpdates(_0x2cd757['body'],null))[_0xcee5('0x25')](respondWithResult(_0x333e63,null))[_0xcee5('0x46')](handleError(_0x333e63,null));};exports['destroy']=function(_0xf23cf6,_0x418a60){return db[_0xcee5('0x3e')]['find']({'where':{'id':_0xf23cf6[_0xcee5('0x44')]['id']}})[_0xcee5('0x25')](handleEntityNotFound(_0x418a60,null))['then'](removeEntity(_0x418a60,null))[_0xcee5('0x46')](handleError(_0x418a60,null));};exports[_0xcee5('0x49')]=function(_0x16d02d,_0x27798c,_0x38d0fa){var _0x2224a2={};var _0x16c5bd={};var _0x1fde85;var _0x587881;return db[_0xcee5('0x3e')][_0xcee5('0x4a')]({'where':{'id':_0x16d02d[_0xcee5('0x44')]['id']}})[_0xcee5('0x25')](handleEntityNotFound(_0x27798c,null))[_0xcee5('0x25')](function(_0x41feb6){if(_0x41feb6){_0x1fde85=_0x41feb6;_0x16c5bd['model']=_[_0xcee5('0x32')](db[_0xcee5('0x4b')][_0xcee5('0x45')]);_0x16c5bd[_0xcee5('0x31')]=_[_0xcee5('0x32')](_0x16d02d[_0xcee5('0x31')]);_0x16c5bd['filters']=_[_0xcee5('0x33')](_0x16c5bd['model'],_0x16c5bd[_0xcee5('0x31')]);_0x2224a2['attributes']=_['intersection'](_0x16c5bd[_0xcee5('0x30')],qs[_0xcee5('0x35')](_0x16d02d[_0xcee5('0x31')]['fields']));_0x2224a2[_0xcee5('0x34')]=_0x2224a2['attributes'][_0xcee5('0x36')]?_0x2224a2[_0xcee5('0x34')]:_0x16c5bd[_0xcee5('0x30')];_0x2224a2['order']=qs[_0xcee5('0x38')](_0x16d02d['query'][_0xcee5('0x38')]);_0x2224a2['where']=qs[_0xcee5('0x39')](_[_0xcee5('0x3a')](_0x16d02d[_0xcee5('0x31')],_0x16c5bd['filters']));if(_0x16d02d[_0xcee5('0x31')][_0xcee5('0x4c')]){_0x2224a2['where']=_[_0xcee5('0x3c')](_0x2224a2[_0xcee5('0x3b')],{'$or':_['map'](_0x2224a2[_0xcee5('0x34')],function(_0x1b6612){var _0x909b80={};_0x909b80[_0x1b6612]={'$like':'%'+_0x16d02d[_0xcee5('0x31')][_0xcee5('0x4c')]+'%'};return _0x909b80;})});}_0x2224a2=_[_0xcee5('0x3c')]({},_0x2224a2,_0x16d02d[_0xcee5('0x3d')]);return _0x1fde85[_0xcee5('0x49')](_0x2224a2);}})[_0xcee5('0x25')](function(_0x11e6f4){if(_0x11e6f4){_0x587881=_0x11e6f4['length'];if(!_0x16d02d['query'][_0xcee5('0x4d')](_0xcee5('0x37'))){_0x2224a2[_0xcee5('0x1d')]=qs['limit'](_0x16d02d[_0xcee5('0x31')][_0xcee5('0x1d')]);_0x2224a2[_0xcee5('0x1f')]=qs[_0xcee5('0x1f')](_0x16d02d[_0xcee5('0x31')][_0xcee5('0x1f')]);}return _0x1fde85[_0xcee5('0x49')](_0x2224a2);}})['then'](function(_0x36683d){if(_0x36683d){return _0x36683d?{'count':_0x587881,'rows':_0x36683d}:null;}})[_0xcee5('0x25')](respondWithResult(_0x27798c,null))[_0xcee5('0x46')](handleError(_0x27798c,null));};exports[_0xcee5('0x4e')]=function(_0x1d7041,_0x143b09,_0x16bd61){var _0x5b3085={};var _0x12ea53={};var _0x114a82;var _0x40ab30;return db[_0xcee5('0x3e')]['findOne']({'where':{'id':_0x1d7041[_0xcee5('0x44')]['id']}})[_0xcee5('0x25')](handleEntityNotFound(_0x143b09,null))[_0xcee5('0x25')](function(_0x3077ea){if(_0x3077ea){_0x114a82=_0x3077ea;_0x12ea53[_0xcee5('0x30')]=_[_0xcee5('0x32')](db['SalesforceField'][_0xcee5('0x45')]);_0x12ea53[_0xcee5('0x31')]=_[_0xcee5('0x32')](_0x1d7041[_0xcee5('0x31')]);_0x12ea53[_0xcee5('0x39')]=_[_0xcee5('0x33')](_0x12ea53[_0xcee5('0x30')],_0x12ea53[_0xcee5('0x31')]);_0x5b3085[_0xcee5('0x34')]=_[_0xcee5('0x33')](_0x12ea53[_0xcee5('0x30')],qs[_0xcee5('0x35')](_0x1d7041[_0xcee5('0x31')][_0xcee5('0x35')]));_0x5b3085['attributes']=_0x5b3085[_0xcee5('0x34')][_0xcee5('0x36')]?_0x5b3085['attributes']:_0x12ea53[_0xcee5('0x30')];_0x5b3085[_0xcee5('0x4f')]=qs['sort'](_0x1d7041[_0xcee5('0x31')]['sort']);_0x5b3085[_0xcee5('0x3b')]=qs[_0xcee5('0x39')](_[_0xcee5('0x3a')](_0x1d7041[_0xcee5('0x31')],_0x12ea53[_0xcee5('0x39')]));if(_0x1d7041[_0xcee5('0x31')][_0xcee5('0x4c')]){_0x5b3085[_0xcee5('0x3b')]=_[_0xcee5('0x3c')](_0x5b3085[_0xcee5('0x3b')],{'$or':_[_0xcee5('0x2d')](_0x5b3085[_0xcee5('0x34')],function(_0xa1b862){var _0x1de110={};_0x1de110[_0xa1b862]={'$like':'%'+_0x1d7041[_0xcee5('0x31')][_0xcee5('0x4c')]+'%'};return _0x1de110;})});}_0x5b3085=_['merge']({},_0x5b3085,_0x1d7041[_0xcee5('0x3d')]);return _0x114a82['getSubjects'](_0x5b3085);}})[_0xcee5('0x25')](function(_0x4df678){if(_0x4df678){_0x40ab30=_0x4df678[_0xcee5('0x36')];if(!_0x1d7041[_0xcee5('0x31')][_0xcee5('0x4d')](_0xcee5('0x37'))){_0x5b3085['limit']=qs[_0xcee5('0x1d')](_0x1d7041[_0xcee5('0x31')][_0xcee5('0x1d')]);_0x5b3085['offset']=qs['offset'](_0x1d7041['query'][_0xcee5('0x1f')]);}return _0x114a82[_0xcee5('0x4e')](_0x5b3085);}})[_0xcee5('0x25')](function(_0x1c8a24){if(_0x1c8a24){return _0x1c8a24?{'count':_0x40ab30,'rows':_0x1c8a24}:null;}})['then'](respondWithResult(_0x143b09,null))[_0xcee5('0x46')](handleError(_0x143b09,null));};exports[_0xcee5('0x50')]=function(_0x5d8d73,_0x5a725b,_0x3dab93){var _0x5818ea={};var _0x4239cd={};var _0x216d98;var _0x4485fc;return db[_0xcee5('0x3e')][_0xcee5('0x4a')]({'where':{'id':_0x5d8d73['params']['id']}})[_0xcee5('0x25')](handleEntityNotFound(_0x5a725b,null))[_0xcee5('0x25')](function(_0x154872){if(_0x154872){_0x216d98=_0x154872;_0x4239cd['model']=_[_0xcee5('0x32')](db[_0xcee5('0x4b')][_0xcee5('0x45')]);_0x4239cd[_0xcee5('0x31')]=_[_0xcee5('0x32')](_0x5d8d73[_0xcee5('0x31')]);_0x4239cd[_0xcee5('0x39')]=_[_0xcee5('0x33')](_0x4239cd['model'],_0x4239cd[_0xcee5('0x31')]);_0x5818ea[_0xcee5('0x34')]=_[_0xcee5('0x33')](_0x4239cd[_0xcee5('0x30')],qs[_0xcee5('0x35')](_0x5d8d73[_0xcee5('0x31')][_0xcee5('0x35')]));_0x5818ea['attributes']=_0x5818ea['attributes'][_0xcee5('0x36')]?_0x5818ea['attributes']:_0x4239cd['model'];_0x5818ea[_0xcee5('0x4f')]=qs['sort'](_0x5d8d73[_0xcee5('0x31')]['sort']);_0x5818ea[_0xcee5('0x3b')]=qs['filters'](_[_0xcee5('0x3a')](_0x5d8d73['query'],_0x4239cd[_0xcee5('0x39')]));if(_0x5d8d73['query'][_0xcee5('0x4c')]){_0x5818ea['where']=_[_0xcee5('0x3c')](_0x5818ea['where'],{'$or':_['map'](_0x5818ea['attributes'],function(_0x4ea7de){var _0x54f24a={};_0x54f24a[_0x4ea7de]={'$like':'%'+_0x5d8d73[_0xcee5('0x31')][_0xcee5('0x4c')]+'%'};return _0x54f24a;})});}_0x5818ea=_[_0xcee5('0x3c')]({},_0x5818ea,_0x5d8d73['options']);return _0x216d98[_0xcee5('0x50')](_0x5818ea);}})[_0xcee5('0x25')](function(_0x327e3b){if(_0x327e3b){_0x4485fc=_0x327e3b['length'];if(!_0x5d8d73['query'][_0xcee5('0x4d')]('nolimit')){_0x5818ea[_0xcee5('0x1d')]=qs[_0xcee5('0x1d')](_0x5d8d73[_0xcee5('0x31')][_0xcee5('0x1d')]);_0x5818ea['offset']=qs[_0xcee5('0x1f')](_0x5d8d73[_0xcee5('0x31')]['offset']);}return _0x216d98[_0xcee5('0x50')](_0x5818ea);}})[_0xcee5('0x25')](function(_0x384245){if(_0x384245){return _0x384245?{'count':_0x4485fc,'rows':_0x384245}:null;}})[_0xcee5('0x25')](respondWithResult(_0x5a725b,null))[_0xcee5('0x46')](handleError(_0x5a725b,null));}; \ No newline at end of file +var _0xb0bf=['find','catch','create','body','getFields','findOne','SalesforceField','getSubjects','nolimit','getDescriptions','rimraf','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','json','apply','save','update','destroy','then','stack','name','SalesforceConfiguration','fieldName','type','key','map','keys','query','filters','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','rawAttributes','intersection'];(function(_0x5daa9,_0x531d51){var _0xb62b12=function(_0x4a3526){while(--_0x4a3526){_0x5daa9['push'](_0x5daa9['shift']());}};_0xb62b12(++_0x531d51);}(_0xb0bf,0xf4));var _0xfb0b=function(_0x183cc7,_0x67e5bf){_0x183cc7=_0x183cc7-0x0;var _0x2f8eb7=_0xb0bf[_0x183cc7];return _0x2f8eb7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfb0b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfb0b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xfb0b('0x2'));var util=require(_0xfb0b('0x3'));var path=require(_0xfb0b('0x4'));var sox=require(_0xfb0b('0x5'));var csv=require(_0xfb0b('0x6'));var ejs=require(_0xfb0b('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfb0b('0x8'));var squel=require(_0xfb0b('0x9'));var crypto=require(_0xfb0b('0xa'));var jsforce=require(_0xfb0b('0xb'));var deskjs=require(_0xfb0b('0xc'));var toCsv=require('to-csv');var querystring=require(_0xfb0b('0xd'));var Papa=require(_0xfb0b('0xe'));var Redis=require(_0xfb0b('0xf'));var authService=require(_0xfb0b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xfb0b('0x11'));var hardwareService=require(_0xfb0b('0x12'));var logger=require(_0xfb0b('0x13'))(_0xfb0b('0x14'));var utils=require(_0xfb0b('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xfb0b('0x16'))['db'];function respondWithStatusCode(_0x68ffaf,_0x252d73){_0x252d73=_0x252d73||0xcc;return function(_0x534117){if(_0x534117){return _0x68ffaf[_0xfb0b('0x17')](_0x252d73);}return _0x68ffaf['status'](_0x252d73)[_0xfb0b('0x18')]();};}function respondWithResult(_0x5920e9,_0x5c99ba){_0x5c99ba=_0x5c99ba||0xc8;return function(_0xcbf2e0){if(_0xcbf2e0){return _0x5920e9['status'](_0x5c99ba)['json'](_0xcbf2e0);}};}function respondWithFilteredResult(_0x340119,_0x1988ae){return function(_0x20faf1){if(_0x20faf1){var _0x3384da=typeof _0x1988ae[_0xfb0b('0x19')]===_0xfb0b('0x1a')&&typeof _0x1988ae[_0xfb0b('0x1b')]===_0xfb0b('0x1a');var _0x2c489b=_0x20faf1[_0xfb0b('0x1c')];var _0x885e58=_0x3384da?0x0:_0x1988ae['offset'];var _0x47de1d=_0x3384da?_0x20faf1['count']:_0x1988ae['offset']+_0x1988ae[_0xfb0b('0x1b')];var _0xb6612a;if(_0x47de1d>=_0x2c489b){_0x47de1d=_0x2c489b;_0xb6612a=0xc8;}else{_0xb6612a=0xce;}_0x340119[_0xfb0b('0x1d')](_0xb6612a);return _0x340119[_0xfb0b('0x1e')](_0xfb0b('0x1f'),_0x885e58+'-'+_0x47de1d+'/'+_0x2c489b)[_0xfb0b('0x20')](_0x20faf1);}return null;};}function patchUpdates(_0x3dabb8){return function(_0x241441){try{jsonpatch[_0xfb0b('0x21')](_0x241441,_0x3dabb8,!![]);}catch(_0xbc3f51){return BPromise['reject'](_0xbc3f51);}return _0x241441[_0xfb0b('0x22')]();};}function saveUpdates(_0x5bab38,_0x37f7be){return function(_0x3fee84){if(_0x3fee84){return _0x3fee84[_0xfb0b('0x23')](_0x5bab38)['then'](function(_0x3c9cc6){return _0x3c9cc6;});}return null;};}function removeEntity(_0x43d230,_0x5401a4){return function(_0x12715c){if(_0x12715c){return _0x12715c[_0xfb0b('0x24')]()[_0xfb0b('0x25')](function(){_0x43d230[_0xfb0b('0x1d')](0xcc)[_0xfb0b('0x18')]();});}};}function handleEntityNotFound(_0x3c770e,_0x154267){return function(_0x38a654){if(!_0x38a654){_0x3c770e['sendStatus'](0x194);}return _0x38a654;};}function handleError(_0x49e4ea,_0x4d3dee){_0x4d3dee=_0x4d3dee||0x1f4;return function(_0x6e227a){logger['error'](_0x6e227a[_0xfb0b('0x26')]);if(_0x6e227a['name']){delete _0x6e227a[_0xfb0b('0x27')];}_0x49e4ea['status'](_0x4d3dee)['send'](_0x6e227a);};}exports['index']=function(_0x2c882c,_0x2a1901){var _0x5c24ef={},_0x5c6f39={},_0x43e4c2={'count':0x0,'rows':[]};var _0x57ff1b=_['map'](db[_0xfb0b('0x28')]['rawAttributes'],function(_0x2b6bdf){return{'name':_0x2b6bdf[_0xfb0b('0x29')],'type':_0x2b6bdf[_0xfb0b('0x2a')][_0xfb0b('0x2b')]};});_0x5c6f39['model']=_[_0xfb0b('0x2c')](_0x57ff1b,_0xfb0b('0x27'));_0x5c6f39['query']=_[_0xfb0b('0x2d')](_0x2c882c[_0xfb0b('0x2e')]);_0x5c6f39[_0xfb0b('0x2f')]=_['intersection'](_0x5c6f39[_0xfb0b('0x30')],_0x5c6f39[_0xfb0b('0x2e')]);_0x5c24ef[_0xfb0b('0x31')]=_['intersection'](_0x5c6f39['model'],qs[_0xfb0b('0x32')](_0x2c882c[_0xfb0b('0x2e')][_0xfb0b('0x32')]));_0x5c24ef[_0xfb0b('0x31')]=_0x5c24ef['attributes'][_0xfb0b('0x33')]?_0x5c24ef['attributes']:_0x5c6f39[_0xfb0b('0x30')];if(!_0x2c882c['query'][_0xfb0b('0x34')]('nolimit')){_0x5c24ef[_0xfb0b('0x1b')]=qs[_0xfb0b('0x1b')](_0x2c882c[_0xfb0b('0x2e')][_0xfb0b('0x1b')]);_0x5c24ef[_0xfb0b('0x19')]=qs[_0xfb0b('0x19')](_0x2c882c[_0xfb0b('0x2e')][_0xfb0b('0x19')]);}_0x5c24ef[_0xfb0b('0x35')]=qs[_0xfb0b('0x36')](_0x2c882c[_0xfb0b('0x2e')][_0xfb0b('0x36')]);_0x5c24ef[_0xfb0b('0x37')]=qs[_0xfb0b('0x2f')](_[_0xfb0b('0x38')](_0x2c882c[_0xfb0b('0x2e')],_0x5c6f39[_0xfb0b('0x2f')]),_0x57ff1b);if(_0x2c882c[_0xfb0b('0x2e')]['filter']){_0x5c24ef[_0xfb0b('0x37')]=_[_0xfb0b('0x39')](_0x5c24ef['where'],{'$or':_['map'](_0x57ff1b,function(_0x3477a4){if(_0x3477a4[_0xfb0b('0x2a')]!==_0xfb0b('0x3a')){var _0x124444={};_0x124444[_0x3477a4[_0xfb0b('0x27')]]={'$like':'%'+_0x2c882c[_0xfb0b('0x2e')][_0xfb0b('0x3b')]+'%'};return _0x124444;}})});}_0x5c24ef=_[_0xfb0b('0x39')]({},_0x5c24ef,_0x2c882c[_0xfb0b('0x3c')]);var _0xa698dc={'where':_0x5c24ef[_0xfb0b('0x37')]};return db[_0xfb0b('0x28')]['count'](_0xa698dc)[_0xfb0b('0x25')](function(_0x395b0f){_0x43e4c2['count']=_0x395b0f;if(_0x2c882c['query'][_0xfb0b('0x3d')]){_0x5c24ef[_0xfb0b('0x3e')]=[{'all':!![]}];}return db[_0xfb0b('0x28')][_0xfb0b('0x3f')](_0x5c24ef);})['then'](function(_0x12cf75){_0x43e4c2[_0xfb0b('0x40')]=_0x12cf75;return _0x43e4c2;})[_0xfb0b('0x25')](respondWithFilteredResult(_0x2a1901,_0x5c24ef))['catch'](handleError(_0x2a1901,null));};exports['show']=function(_0x31faf9,_0x198b2a){var _0x4fc2d2={'raw':![],'where':{'id':_0x31faf9[_0xfb0b('0x41')]['id']}},_0xd36ec0={};_0xd36ec0[_0xfb0b('0x30')]=_[_0xfb0b('0x2d')](db[_0xfb0b('0x28')][_0xfb0b('0x42')]);_0xd36ec0[_0xfb0b('0x2e')]=_[_0xfb0b('0x2d')](_0x31faf9[_0xfb0b('0x2e')]);_0xd36ec0['filters']=_[_0xfb0b('0x43')](_0xd36ec0['model'],_0xd36ec0[_0xfb0b('0x2e')]);_0x4fc2d2['attributes']=_['intersection'](_0xd36ec0[_0xfb0b('0x30')],qs[_0xfb0b('0x32')](_0x31faf9['query'][_0xfb0b('0x32')]));_0x4fc2d2[_0xfb0b('0x31')]=_0x4fc2d2['attributes'][_0xfb0b('0x33')]?_0x4fc2d2[_0xfb0b('0x31')]:_0xd36ec0[_0xfb0b('0x30')];if(_0x31faf9[_0xfb0b('0x2e')][_0xfb0b('0x3d')]){_0x4fc2d2[_0xfb0b('0x3e')]=[{'all':!![]}];}_0x4fc2d2=_[_0xfb0b('0x39')]({},_0x4fc2d2,_0x31faf9[_0xfb0b('0x3c')]);return db[_0xfb0b('0x28')][_0xfb0b('0x44')](_0x4fc2d2)[_0xfb0b('0x25')](handleEntityNotFound(_0x198b2a,null))[_0xfb0b('0x25')](respondWithResult(_0x198b2a,null))[_0xfb0b('0x45')](handleError(_0x198b2a,null));};exports[_0xfb0b('0x46')]=function(_0x3cb780,_0x211105){return db[_0xfb0b('0x28')][_0xfb0b('0x46')](_0x3cb780[_0xfb0b('0x47')],{})[_0xfb0b('0x25')](respondWithResult(_0x211105,0xc9))[_0xfb0b('0x45')](handleError(_0x211105,null));};exports[_0xfb0b('0x23')]=function(_0x5a960d,_0x28579a){if(_0x5a960d['body']['id']){delete _0x5a960d[_0xfb0b('0x47')]['id'];}return db[_0xfb0b('0x28')][_0xfb0b('0x44')]({'where':{'id':_0x5a960d[_0xfb0b('0x41')]['id']}})[_0xfb0b('0x25')](handleEntityNotFound(_0x28579a,null))[_0xfb0b('0x25')](saveUpdates(_0x5a960d[_0xfb0b('0x47')],null))[_0xfb0b('0x25')](respondWithResult(_0x28579a,null))['catch'](handleError(_0x28579a,null));};exports[_0xfb0b('0x24')]=function(_0x3fb6e0,_0x160c40){return db[_0xfb0b('0x28')]['find']({'where':{'id':_0x3fb6e0[_0xfb0b('0x41')]['id']}})[_0xfb0b('0x25')](handleEntityNotFound(_0x160c40,null))[_0xfb0b('0x25')](removeEntity(_0x160c40,null))[_0xfb0b('0x45')](handleError(_0x160c40,null));};exports[_0xfb0b('0x48')]=function(_0x215cf2,_0x46edad,_0x402cae){var _0x4f3c4f={};var _0x3bd53f={};var _0x3a0bfe;var _0x21775c;return db['SalesforceConfiguration'][_0xfb0b('0x49')]({'where':{'id':_0x215cf2[_0xfb0b('0x41')]['id']}})[_0xfb0b('0x25')](handleEntityNotFound(_0x46edad,null))['then'](function(_0x1b3026){if(_0x1b3026){_0x3a0bfe=_0x1b3026;_0x3bd53f[_0xfb0b('0x30')]=_[_0xfb0b('0x2d')](db[_0xfb0b('0x4a')][_0xfb0b('0x42')]);_0x3bd53f[_0xfb0b('0x2e')]=_[_0xfb0b('0x2d')](_0x215cf2[_0xfb0b('0x2e')]);_0x3bd53f[_0xfb0b('0x2f')]=_[_0xfb0b('0x43')](_0x3bd53f['model'],_0x3bd53f[_0xfb0b('0x2e')]);_0x4f3c4f['attributes']=_[_0xfb0b('0x43')](_0x3bd53f[_0xfb0b('0x30')],qs[_0xfb0b('0x32')](_0x215cf2['query']['fields']));_0x4f3c4f[_0xfb0b('0x31')]=_0x4f3c4f[_0xfb0b('0x31')]['length']?_0x4f3c4f[_0xfb0b('0x31')]:_0x3bd53f[_0xfb0b('0x30')];_0x4f3c4f[_0xfb0b('0x35')]=qs[_0xfb0b('0x36')](_0x215cf2['query'][_0xfb0b('0x36')]);_0x4f3c4f[_0xfb0b('0x37')]=qs[_0xfb0b('0x2f')](_[_0xfb0b('0x38')](_0x215cf2[_0xfb0b('0x2e')],_0x3bd53f[_0xfb0b('0x2f')]));if(_0x215cf2[_0xfb0b('0x2e')][_0xfb0b('0x3b')]){_0x4f3c4f[_0xfb0b('0x37')]=_[_0xfb0b('0x39')](_0x4f3c4f[_0xfb0b('0x37')],{'$or':_[_0xfb0b('0x2c')](_0x4f3c4f[_0xfb0b('0x31')],function(_0xb950c7){var _0x99ccd0={};_0x99ccd0[_0xb950c7]={'$like':'%'+_0x215cf2['query'][_0xfb0b('0x3b')]+'%'};return _0x99ccd0;})});}_0x4f3c4f=_[_0xfb0b('0x39')]({},_0x4f3c4f,_0x215cf2[_0xfb0b('0x3c')]);return _0x3a0bfe[_0xfb0b('0x48')](_0x4f3c4f);}})['then'](function(_0x22c760){if(_0x22c760){_0x21775c=_0x22c760[_0xfb0b('0x33')];if(!_0x215cf2[_0xfb0b('0x2e')][_0xfb0b('0x34')]('nolimit')){_0x4f3c4f['limit']=qs['limit'](_0x215cf2[_0xfb0b('0x2e')]['limit']);_0x4f3c4f['offset']=qs[_0xfb0b('0x19')](_0x215cf2[_0xfb0b('0x2e')][_0xfb0b('0x19')]);}return _0x3a0bfe[_0xfb0b('0x48')](_0x4f3c4f);}})[_0xfb0b('0x25')](function(_0x1eafac){if(_0x1eafac){return _0x1eafac?{'count':_0x21775c,'rows':_0x1eafac}:null;}})[_0xfb0b('0x25')](respondWithResult(_0x46edad,null))[_0xfb0b('0x45')](handleError(_0x46edad,null));};exports[_0xfb0b('0x4b')]=function(_0x168dca,_0x53814c,_0x2e6969){var _0x3a967a={};var _0x47b6ba={};var _0xd4281;var _0x51929e;return db[_0xfb0b('0x28')]['findOne']({'where':{'id':_0x168dca[_0xfb0b('0x41')]['id']}})[_0xfb0b('0x25')](handleEntityNotFound(_0x53814c,null))[_0xfb0b('0x25')](function(_0x114e1b){if(_0x114e1b){_0xd4281=_0x114e1b;_0x47b6ba[_0xfb0b('0x30')]=_[_0xfb0b('0x2d')](db[_0xfb0b('0x4a')][_0xfb0b('0x42')]);_0x47b6ba[_0xfb0b('0x2e')]=_[_0xfb0b('0x2d')](_0x168dca['query']);_0x47b6ba['filters']=_[_0xfb0b('0x43')](_0x47b6ba[_0xfb0b('0x30')],_0x47b6ba['query']);_0x3a967a['attributes']=_[_0xfb0b('0x43')](_0x47b6ba[_0xfb0b('0x30')],qs[_0xfb0b('0x32')](_0x168dca[_0xfb0b('0x2e')][_0xfb0b('0x32')]));_0x3a967a[_0xfb0b('0x31')]=_0x3a967a[_0xfb0b('0x31')][_0xfb0b('0x33')]?_0x3a967a[_0xfb0b('0x31')]:_0x47b6ba['model'];_0x3a967a[_0xfb0b('0x35')]=qs[_0xfb0b('0x36')](_0x168dca[_0xfb0b('0x2e')][_0xfb0b('0x36')]);_0x3a967a[_0xfb0b('0x37')]=qs[_0xfb0b('0x2f')](_[_0xfb0b('0x38')](_0x168dca[_0xfb0b('0x2e')],_0x47b6ba['filters']));if(_0x168dca['query'][_0xfb0b('0x3b')]){_0x3a967a[_0xfb0b('0x37')]=_['merge'](_0x3a967a[_0xfb0b('0x37')],{'$or':_[_0xfb0b('0x2c')](_0x3a967a[_0xfb0b('0x31')],function(_0x3a1396){var _0x3f547d={};_0x3f547d[_0x3a1396]={'$like':'%'+_0x168dca[_0xfb0b('0x2e')][_0xfb0b('0x3b')]+'%'};return _0x3f547d;})});}_0x3a967a=_[_0xfb0b('0x39')]({},_0x3a967a,_0x168dca[_0xfb0b('0x3c')]);return _0xd4281['getSubjects'](_0x3a967a);}})[_0xfb0b('0x25')](function(_0x2d83e8){if(_0x2d83e8){_0x51929e=_0x2d83e8[_0xfb0b('0x33')];if(!_0x168dca[_0xfb0b('0x2e')][_0xfb0b('0x34')]('nolimit')){_0x3a967a[_0xfb0b('0x1b')]=qs[_0xfb0b('0x1b')](_0x168dca[_0xfb0b('0x2e')][_0xfb0b('0x1b')]);_0x3a967a[_0xfb0b('0x19')]=qs[_0xfb0b('0x19')](_0x168dca[_0xfb0b('0x2e')][_0xfb0b('0x19')]);}return _0xd4281[_0xfb0b('0x4b')](_0x3a967a);}})[_0xfb0b('0x25')](function(_0x2aaecf){if(_0x2aaecf){return _0x2aaecf?{'count':_0x51929e,'rows':_0x2aaecf}:null;}})[_0xfb0b('0x25')](respondWithResult(_0x53814c,null))[_0xfb0b('0x45')](handleError(_0x53814c,null));};exports['getDescriptions']=function(_0x25a120,_0x32ab4d,_0x29cd47){var _0x181020={};var _0x3c8edd={};var _0x306a8f;var _0x5ea3bb;return db['SalesforceConfiguration'][_0xfb0b('0x49')]({'where':{'id':_0x25a120['params']['id']}})[_0xfb0b('0x25')](handleEntityNotFound(_0x32ab4d,null))[_0xfb0b('0x25')](function(_0x3faf0b){if(_0x3faf0b){_0x306a8f=_0x3faf0b;_0x3c8edd[_0xfb0b('0x30')]=_[_0xfb0b('0x2d')](db['SalesforceField'][_0xfb0b('0x42')]);_0x3c8edd[_0xfb0b('0x2e')]=_['keys'](_0x25a120[_0xfb0b('0x2e')]);_0x3c8edd[_0xfb0b('0x2f')]=_[_0xfb0b('0x43')](_0x3c8edd[_0xfb0b('0x30')],_0x3c8edd[_0xfb0b('0x2e')]);_0x181020[_0xfb0b('0x31')]=_[_0xfb0b('0x43')](_0x3c8edd[_0xfb0b('0x30')],qs[_0xfb0b('0x32')](_0x25a120[_0xfb0b('0x2e')][_0xfb0b('0x32')]));_0x181020[_0xfb0b('0x31')]=_0x181020[_0xfb0b('0x31')][_0xfb0b('0x33')]?_0x181020[_0xfb0b('0x31')]:_0x3c8edd[_0xfb0b('0x30')];_0x181020[_0xfb0b('0x35')]=qs[_0xfb0b('0x36')](_0x25a120[_0xfb0b('0x2e')]['sort']);_0x181020[_0xfb0b('0x37')]=qs['filters'](_[_0xfb0b('0x38')](_0x25a120['query'],_0x3c8edd['filters']));if(_0x25a120[_0xfb0b('0x2e')][_0xfb0b('0x3b')]){_0x181020[_0xfb0b('0x37')]=_['merge'](_0x181020[_0xfb0b('0x37')],{'$or':_['map'](_0x181020['attributes'],function(_0x59de3d){var _0xf5a8ae={};_0xf5a8ae[_0x59de3d]={'$like':'%'+_0x25a120[_0xfb0b('0x2e')]['filter']+'%'};return _0xf5a8ae;})});}_0x181020=_[_0xfb0b('0x39')]({},_0x181020,_0x25a120['options']);return _0x306a8f['getDescriptions'](_0x181020);}})[_0xfb0b('0x25')](function(_0x290afe){if(_0x290afe){_0x5ea3bb=_0x290afe['length'];if(!_0x25a120['query'][_0xfb0b('0x34')](_0xfb0b('0x4c'))){_0x181020[_0xfb0b('0x1b')]=qs[_0xfb0b('0x1b')](_0x25a120['query'][_0xfb0b('0x1b')]);_0x181020[_0xfb0b('0x19')]=qs[_0xfb0b('0x19')](_0x25a120[_0xfb0b('0x2e')]['offset']);}return _0x306a8f[_0xfb0b('0x4d')](_0x181020);}})[_0xfb0b('0x25')](function(_0xe2339b){if(_0xe2339b){return _0xe2339b?{'count':_0x5ea3bb,'rows':_0xe2339b}:null;}})[_0xfb0b('0x25')](respondWithResult(_0x32ab4d,null))[_0xfb0b('0x45')](handleError(_0x32ab4d,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 3840bc8..b1dd1fd 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 _0xb14f=['int_salesforce_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','SalesforceConfiguration'];(function(_0x50b1ae,_0x236097){var _0x27adce=function(_0x5cd9f){while(--_0x5cd9f){_0x50b1ae['push'](_0x50b1ae['shift']());}};_0x27adce(++_0x236097);}(_0xb14f,0x199));var _0xfb14=function(_0x373cc0,_0x5eb823){_0x373cc0=_0x373cc0-0x0;var _0x1bd33e=_0xb14f[_0x373cc0];return _0x1bd33e;};'use strict';var _=require(_0xfb14('0x0'));var util=require(_0xfb14('0x1'));var logger=require(_0xfb14('0x2'))(_0xfb14('0x3'));var moment=require('moment');var BPromise=require(_0xfb14('0x4'));var rp=require(_0xfb14('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfb14('0x6'));var config=require(_0xfb14('0x7'));var attributes=require(_0xfb14('0x8'));module[_0xfb14('0x9')]=function(_0x38ce52,_0x245b4c){return _0x38ce52['define'](_0xfb14('0xa'),attributes,{'tableName':_0xfb14('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x96d5=['moment','bluebird','request-promise','path','../../config/environment','./intSalesforceConfiguration.attributes','define','SalesforceConfiguration','int_salesforce_configurations','../../config/logger','api'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x96d5,0x11c));var _0x596d=function(_0x4f0f9b,_0x4e963e){_0x4f0f9b=_0x4f0f9b-0x0;var _0x970f94=_0x96d5[_0x4f0f9b];return _0x970f94;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x596d('0x0'))(_0x596d('0x1'));var moment=require(_0x596d('0x2'));var BPromise=require(_0x596d('0x3'));var rp=require(_0x596d('0x4'));var fs=require('fs');var path=require(_0x596d('0x5'));var rimraf=require('rimraf');var config=require(_0x596d('0x6'));var attributes=require(_0x596d('0x7'));module['exports']=function(_0xb91001,_0x493409){return _0xb91001[_0x596d('0x8')](_0x596d('0x9'),attributes,{'tableName':_0x596d('0xa'),'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 61008f4..72064c8 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 _0xdc6a=['http','request','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3e9fab,_0x190588){var _0x1c5069=function(_0x273eb3){while(--_0x273eb3){_0x3e9fab['push'](_0x3e9fab['shift']());}};_0x1c5069(++_0x190588);}(_0xdc6a,0x121));var _0xadc6=function(_0x58a59d,_0x213d69){_0x58a59d=_0x58a59d-0x0;var _0x1d7df2=_0xdc6a[_0x58a59d];return _0x1d7df2;};'use strict';var _=require(_0xadc6('0x0'));var util=require(_0xadc6('0x1'));var moment=require(_0xadc6('0x2'));var BPromise=require('bluebird');var rs=require(_0xadc6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xadc6('0x4'))['db'];var utils=require(_0xadc6('0x5'));var logger=require(_0xadc6('0x6'))(_0xadc6('0x7'));var config=require(_0xadc6('0x8'));var jayson=require(_0xadc6('0x9'));var client=jayson['client'][_0xadc6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2ef896,_0xcc00b7,_0xa57a06){return new BPromise(function(_0x1edb17,_0x51b4af){return client[_0xadc6('0xb')](_0x2ef896,_0xa57a06)['then'](function(_0x322dbc){logger[_0xadc6('0xc')](_0xadc6('0xd'),_0xcc00b7,_0xadc6('0xe'));logger[_0xadc6('0xf')](_0xadc6('0x10'),_0xcc00b7,_0xadc6('0xe'),JSON[_0xadc6('0x11')](_0x322dbc));if(_0x322dbc[_0xadc6('0x12')]){if(_0x322dbc['error'][_0xadc6('0x13')]===0x1f4){logger[_0xadc6('0x12')]('SalesforceConfiguration,\x20%s,\x20%s',_0xcc00b7,_0x322dbc[_0xadc6('0x12')][_0xadc6('0x14')]);return _0x51b4af(_0x322dbc[_0xadc6('0x12')][_0xadc6('0x14')]);}logger[_0xadc6('0x12')]('SalesforceConfiguration,\x20%s,\x20%s',_0xcc00b7,_0x322dbc[_0xadc6('0x12')][_0xadc6('0x14')]);return _0x1edb17(_0x322dbc[_0xadc6('0x12')]['message']);}else{logger[_0xadc6('0xc')]('SalesforceConfiguration,\x20%s,\x20%s',_0xcc00b7,_0xadc6('0xe'));_0x1edb17(_0x322dbc[_0xadc6('0x15')][_0xadc6('0x14')]);}})[_0xadc6('0x16')](function(_0x56ef53){logger['error'](_0xadc6('0xd'),_0xcc00b7,_0x56ef53);_0x51b4af(_0x56ef53);});});} \ No newline at end of file +var _0x63b8=['then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x5e1f4b,_0x50b208){var _0x5ce7b4=function(_0x53d04f){while(--_0x53d04f){_0x5e1f4b['push'](_0x5e1f4b['shift']());}};_0x5ce7b4(++_0x50b208);}(_0x63b8,0xbe));var _0x863b=function(_0x1fffcc,_0xb258ec){_0x1fffcc=_0x1fffcc-0x0;var _0xa83ea3=_0x63b8[_0x1fffcc];return _0xa83ea3;};'use strict';var _=require(_0x863b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x863b('0x1'));var rs=require(_0x863b('0x2'));var fs=require('fs');var Redis=require(_0x863b('0x3'));var db=require(_0x863b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x863b('0x5'))('rpc');var config=require(_0x863b('0x6'));var jayson=require(_0x863b('0x7'));var client=jayson[_0x863b('0x8')][_0x863b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x80cd0d,_0x4423cc,_0x3ece61){return new BPromise(function(_0x4588af,_0x5b9928){return client['request'](_0x80cd0d,_0x3ece61)[_0x863b('0xa')](function(_0x83a6c0){logger[_0x863b('0xb')](_0x863b('0xc'),_0x4423cc,_0x863b('0xd'));logger['debug'](_0x863b('0xe'),_0x4423cc,_0x863b('0xd'),JSON[_0x863b('0xf')](_0x83a6c0));if(_0x83a6c0[_0x863b('0x10')]){if(_0x83a6c0[_0x863b('0x10')][_0x863b('0x11')]===0x1f4){logger[_0x863b('0x10')](_0x863b('0xc'),_0x4423cc,_0x83a6c0[_0x863b('0x10')][_0x863b('0x12')]);return _0x5b9928(_0x83a6c0[_0x863b('0x10')]['message']);}logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x4423cc,_0x83a6c0[_0x863b('0x10')]['message']);return _0x4588af(_0x83a6c0[_0x863b('0x10')][_0x863b('0x12')]);}else{logger['info'](_0x863b('0xc'),_0x4423cc,_0x863b('0xd'));_0x4588af(_0x83a6c0[_0x863b('0x13')][_0x863b('0x12')]);}})['catch'](function(_0x32cecc){logger[_0x863b('0x10')](_0x863b('0xc'),_0x4423cc,_0x32cecc);_0x5b9928(_0x32cecc);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 5043540..e4d2cd3 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 _0x6a39=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','./intSalesforceField.controller','isAuthenticated','index','/:id','post','create'];(function(_0x4df91d,_0x1f64e8){var _0x2dd4f5=function(_0x12f50e){while(--_0x12f50e){_0x4df91d['push'](_0x4df91d['shift']());}};_0x2dd4f5(++_0x1f64e8);}(_0x6a39,0x94));var _0x96a3=function(_0x49677a,_0x197e86){_0x49677a=_0x49677a-0x0;var _0x115408=_0x6a39[_0x49677a];return _0x115408;};'use strict';var multer=require(_0x96a3('0x0'));var util=require(_0x96a3('0x1'));var path=require(_0x96a3('0x2'));var timeout=require(_0x96a3('0x3'));var express=require(_0x96a3('0x4'));var router=express[_0x96a3('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x96a3('0x6'));router['get']('/',auth[_0x96a3('0x7')](),controller[_0x96a3('0x8')]);router['get'](_0x96a3('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x96a3('0xa')]('/',auth['isAuthenticated'](),controller[_0x96a3('0xb')]);router['put']('/:id',auth[_0x96a3('0x7')](),controller[_0x96a3('0xc')]);router[_0x96a3('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x96a3('0xe')]);module[_0x96a3('0xf')]=router; \ No newline at end of file +var _0x90ca=['create','put','update','delete','destroy','exports','multer','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','post','isAuthenticated'];(function(_0x51c819,_0xd812db){var _0x15c5d2=function(_0x2977f0){while(--_0x2977f0){_0x51c819['push'](_0x51c819['shift']());}};_0x15c5d2(++_0xd812db);}(_0x90ca,0x1c0));var _0xa90c=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x90ca[_0x13ea00];return _0x1f7347;};'use strict';var multer=require(_0xa90c('0x0'));var util=require(_0xa90c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa90c('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa90c('0x3'));var interaction=require(_0xa90c('0x4'));var config=require(_0xa90c('0x5'));var controller=require('./intSalesforceField.controller');router[_0xa90c('0x6')]('/',auth['isAuthenticated'](),controller[_0xa90c('0x7')]);router[_0xa90c('0x6')](_0xa90c('0x8'),auth['isAuthenticated'](),controller['show']);router[_0xa90c('0x9')]('/',auth[_0xa90c('0xa')](),controller[_0xa90c('0xb')]);router[_0xa90c('0xc')](_0xa90c('0x8'),auth[_0xa90c('0xa')](),controller[_0xa90c('0xd')]);router[_0xa90c('0xe')](_0xa90c('0x8'),auth[_0xa90c('0xa')](),controller[_0xa90c('0xf')]);module[_0xa90c('0x10')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index e9bb167..59f04b3 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 _0x2c41=['keyValue','picklist','STRING','exports','ENUM','string','variable','customVariable'];(function(_0x1368fa,_0x48ea18){var _0x2debec=function(_0x1f5748){while(--_0x1f5748){_0x1368fa['push'](_0x1368fa['shift']());}};_0x2debec(++_0x48ea18);}(_0x2c41,0x173));var _0x12c4=function(_0x5a2299,_0x3e2922){_0x5a2299=_0x5a2299-0x0;var _0xedff0f=_0x2c41[_0x5a2299];return _0xedff0f;};'use strict';var Sequelize=require('sequelize');module[_0x12c4('0x0')]={'type':{'type':Sequelize[_0x12c4('0x1')](_0x12c4('0x2'),_0x12c4('0x3'),_0x12c4('0x4'),_0x12c4('0x5'),_0x12c4('0x6')),'defaultValue':_0x12c4('0x2')},'content':{'type':Sequelize[_0x12c4('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x12c4('0x2'),_0x12c4('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x12c4('0x7')]},'idField':{'type':Sequelize[_0x12c4('0x7')]},'variableName':{'type':Sequelize[_0x12c4('0x7')]}}; \ No newline at end of file +var _0xff74=['string','customVariable','exports','ENUM','variable','keyValue','picklist','STRING'];(function(_0x4d3fbe,_0x5b212c){var _0x5948d2=function(_0x3cedcb){while(--_0x3cedcb){_0x4d3fbe['push'](_0x4d3fbe['shift']());}};_0x5948d2(++_0x5b212c);}(_0xff74,0xe2));var _0x4ff7=function(_0x4362d5,_0x1c20a6){_0x4362d5=_0x4362d5-0x0;var _0x5daade=_0xff74[_0x4362d5];return _0x5daade;};'use strict';var Sequelize=require('sequelize');module[_0x4ff7('0x0')]={'type':{'type':Sequelize[_0x4ff7('0x1')]('string',_0x4ff7('0x2'),'customVariable',_0x4ff7('0x3'),_0x4ff7('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x4ff7('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x4ff7('0x1')](_0x4ff7('0x6'),'variable',_0x4ff7('0x7'))},'keyContent':{'type':Sequelize[_0x4ff7('0x5')]},'idField':{'type':Sequelize[_0x4ff7('0x5')]},'variableName':{'type':Sequelize[_0x4ff7('0x5')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 82613df..73270f3 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 _0x46b6=['fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','reject','save','update','then','stack','name','send','map','SalesforceField','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','catch','create','body','find','eml-format','rimraf','zip-dir'];(function(_0x370e07,_0x346ba0){var _0x2fff66=function(_0x2df14c){while(--_0x2df14c){_0x370e07['push'](_0x370e07['shift']());}};_0x2fff66(++_0x346ba0);}(_0x46b6,0xde));var _0x646b=function(_0xfc726c,_0xd8960f){_0xfc726c=_0xfc726c-0x0;var _0x1ee812=_0x46b6[_0xfc726c];return _0x1ee812;};'use strict';var emlformat=require(_0x646b('0x0'));var rimraf=require(_0x646b('0x1'));var zipdir=require(_0x646b('0x2'));var jsonpatch=require(_0x646b('0x3'));var rp=require(_0x646b('0x4'));var moment=require(_0x646b('0x5'));var BPromise=require(_0x646b('0x6'));var Mustache=require('mustache');var util=require(_0x646b('0x7'));var path=require(_0x646b('0x8'));var sox=require('sox');var csv=require(_0x646b('0x9'));var ejs=require(_0x646b('0xa'));var fs=require('fs');var fs_extra=require(_0x646b('0xb'));var _=require('lodash');var squel=require(_0x646b('0xc'));var crypto=require(_0x646b('0xd'));var jsforce=require(_0x646b('0xe'));var deskjs=require(_0x646b('0xf'));var toCsv=require('to-csv');var querystring=require(_0x646b('0x10'));var Papa=require('papaparse');var Redis=require(_0x646b('0x11'));var authService=require(_0x646b('0x12'));var qs=require(_0x646b('0x13'));var as=require(_0x646b('0x14'));var hardwareService=require(_0x646b('0x15'));var logger=require(_0x646b('0x16'))(_0x646b('0x17'));var utils=require(_0x646b('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa6af80,_0x34fb19){_0x34fb19=_0x34fb19||0xcc;return function(_0x19409b){if(_0x19409b){return _0xa6af80[_0x646b('0x19')](_0x34fb19);}return _0xa6af80['status'](_0x34fb19)[_0x646b('0x1a')]();};}function respondWithResult(_0x1b7547,_0x5c6558){_0x5c6558=_0x5c6558||0xc8;return function(_0x4f4615){if(_0x4f4615){return _0x1b7547[_0x646b('0x1b')](_0x5c6558)[_0x646b('0x1c')](_0x4f4615);}};}function respondWithFilteredResult(_0x2e78e6,_0x21f7e4){return function(_0x26b316){if(_0x26b316){var _0x33bcdb=typeof _0x21f7e4[_0x646b('0x1d')]===_0x646b('0x1e')&&typeof _0x21f7e4[_0x646b('0x1f')]==='undefined';var _0x19b9cd=_0x26b316['count'];var _0x3d9b78=_0x33bcdb?0x0:_0x21f7e4[_0x646b('0x1d')];var _0x4b0d0c=_0x33bcdb?_0x26b316['count']:_0x21f7e4[_0x646b('0x1d')]+_0x21f7e4[_0x646b('0x1f')];var _0x97982;if(_0x4b0d0c>=_0x19b9cd){_0x4b0d0c=_0x19b9cd;_0x97982=0xc8;}else{_0x97982=0xce;}_0x2e78e6['status'](_0x97982);return _0x2e78e6[_0x646b('0x20')](_0x646b('0x21'),_0x3d9b78+'-'+_0x4b0d0c+'/'+_0x19b9cd)[_0x646b('0x1c')](_0x26b316);}return null;};}function patchUpdates(_0x29bbd0){return function(_0x1c65d6){try{jsonpatch['apply'](_0x1c65d6,_0x29bbd0,!![]);}catch(_0x15cb6d){return BPromise[_0x646b('0x22')](_0x15cb6d);}return _0x1c65d6[_0x646b('0x23')]();};}function saveUpdates(_0x49c164,_0x36cb35){return function(_0x4554bd){if(_0x4554bd){return _0x4554bd[_0x646b('0x24')](_0x49c164)['then'](function(_0xe90a58){return _0xe90a58;});}return null;};}function removeEntity(_0x127b25,_0x666f51){return function(_0x33e316){if(_0x33e316){return _0x33e316['destroy']()[_0x646b('0x25')](function(){_0x127b25[_0x646b('0x1b')](0xcc)[_0x646b('0x1a')]();});}};}function handleEntityNotFound(_0x1be9e5,_0xadcc0){return function(_0x2f080c){if(!_0x2f080c){_0x1be9e5[_0x646b('0x19')](0x194);}return _0x2f080c;};}function handleError(_0x542aba,_0x14a31c){_0x14a31c=_0x14a31c||0x1f4;return function(_0xf0cc4e){logger['error'](_0xf0cc4e[_0x646b('0x26')]);if(_0xf0cc4e[_0x646b('0x27')]){delete _0xf0cc4e['name'];}_0x542aba['status'](_0x14a31c)[_0x646b('0x28')](_0xf0cc4e);};}exports['index']=function(_0x281b24,_0x207a9e){var _0x19cbc4={},_0x5e9696={},_0x14f8dd={'count':0x0,'rows':[]};var _0x5ee6df=_[_0x646b('0x29')](db[_0x646b('0x2a')][_0x646b('0x2b')],function(_0x26aa63){return{'name':_0x26aa63[_0x646b('0x2c')],'type':_0x26aa63[_0x646b('0x2d')][_0x646b('0x2e')]};});_0x5e9696['model']=_['map'](_0x5ee6df,_0x646b('0x27'));_0x5e9696['query']=_[_0x646b('0x2f')](_0x281b24[_0x646b('0x30')]);_0x5e9696[_0x646b('0x31')]=_[_0x646b('0x32')](_0x5e9696[_0x646b('0x33')],_0x5e9696[_0x646b('0x30')]);_0x19cbc4[_0x646b('0x34')]=_[_0x646b('0x32')](_0x5e9696[_0x646b('0x33')],qs['fields'](_0x281b24[_0x646b('0x30')][_0x646b('0x35')]));_0x19cbc4[_0x646b('0x34')]=_0x19cbc4[_0x646b('0x34')]['length']?_0x19cbc4[_0x646b('0x34')]:_0x5e9696[_0x646b('0x33')];if(!_0x281b24[_0x646b('0x30')][_0x646b('0x36')](_0x646b('0x37'))){_0x19cbc4[_0x646b('0x1f')]=qs['limit'](_0x281b24[_0x646b('0x30')][_0x646b('0x1f')]);_0x19cbc4[_0x646b('0x1d')]=qs[_0x646b('0x1d')](_0x281b24['query'][_0x646b('0x1d')]);}_0x19cbc4[_0x646b('0x38')]=qs[_0x646b('0x39')](_0x281b24['query'][_0x646b('0x39')]);_0x19cbc4['where']=qs['filters'](_[_0x646b('0x3a')](_0x281b24[_0x646b('0x30')],_0x5e9696[_0x646b('0x31')]),_0x5ee6df);if(_0x281b24['query'][_0x646b('0x3b')]){_0x19cbc4[_0x646b('0x3c')]=_[_0x646b('0x3d')](_0x19cbc4['where'],{'$or':_['map'](_0x5ee6df,function(_0x114ed9){if(_0x114ed9[_0x646b('0x2d')]!==_0x646b('0x3e')){var _0x24a06c={};_0x24a06c[_0x114ed9[_0x646b('0x27')]]={'$like':'%'+_0x281b24[_0x646b('0x30')][_0x646b('0x3b')]+'%'};return _0x24a06c;}})});}_0x19cbc4=_['merge']({},_0x19cbc4,_0x281b24[_0x646b('0x3f')]);var _0x4e503a={'where':_0x19cbc4[_0x646b('0x3c')]};return db[_0x646b('0x2a')]['count'](_0x4e503a)[_0x646b('0x25')](function(_0x480841){_0x14f8dd['count']=_0x480841;if(_0x281b24[_0x646b('0x30')][_0x646b('0x40')]){_0x19cbc4[_0x646b('0x41')]=[{'all':!![]}];}return db[_0x646b('0x2a')][_0x646b('0x42')](_0x19cbc4);})['then'](function(_0x3d7e61){_0x14f8dd[_0x646b('0x43')]=_0x3d7e61;return _0x14f8dd;})[_0x646b('0x25')](respondWithFilteredResult(_0x207a9e,_0x19cbc4))['catch'](handleError(_0x207a9e,null));};exports[_0x646b('0x44')]=function(_0x112950,_0x24221b){var _0xf3b36e={'raw':!![],'where':{'id':_0x112950[_0x646b('0x45')]['id']}},_0x47bcae={};_0x47bcae['model']=_[_0x646b('0x2f')](db['SalesforceField']['rawAttributes']);_0x47bcae[_0x646b('0x30')]=_[_0x646b('0x2f')](_0x112950[_0x646b('0x30')]);_0x47bcae[_0x646b('0x31')]=_[_0x646b('0x32')](_0x47bcae['model'],_0x47bcae[_0x646b('0x30')]);_0xf3b36e[_0x646b('0x34')]=_[_0x646b('0x32')](_0x47bcae[_0x646b('0x33')],qs[_0x646b('0x35')](_0x112950[_0x646b('0x30')][_0x646b('0x35')]));_0xf3b36e[_0x646b('0x34')]=_0xf3b36e['attributes'][_0x646b('0x46')]?_0xf3b36e[_0x646b('0x34')]:_0x47bcae[_0x646b('0x33')];if(_0x112950[_0x646b('0x30')][_0x646b('0x40')]){_0xf3b36e[_0x646b('0x41')]=[{'all':!![]}];}_0xf3b36e=_[_0x646b('0x3d')]({},_0xf3b36e,_0x112950[_0x646b('0x3f')]);return db[_0x646b('0x2a')]['find'](_0xf3b36e)['then'](handleEntityNotFound(_0x24221b,null))[_0x646b('0x25')](respondWithResult(_0x24221b,null))[_0x646b('0x47')](handleError(_0x24221b,null));};exports['create']=function(_0x1babc6,_0x20271f){return db['SalesforceField'][_0x646b('0x48')](_0x1babc6[_0x646b('0x49')],{})['then'](respondWithResult(_0x20271f,0xc9))[_0x646b('0x47')](handleError(_0x20271f,null));};exports[_0x646b('0x24')]=function(_0xb68c5e,_0x1df8fc){if(_0xb68c5e['body']['id']){delete _0xb68c5e[_0x646b('0x49')]['id'];}return db[_0x646b('0x2a')][_0x646b('0x4a')]({'where':{'id':_0xb68c5e[_0x646b('0x45')]['id']}})[_0x646b('0x25')](handleEntityNotFound(_0x1df8fc,null))[_0x646b('0x25')](saveUpdates(_0xb68c5e[_0x646b('0x49')],null))[_0x646b('0x25')](respondWithResult(_0x1df8fc,null))[_0x646b('0x47')](handleError(_0x1df8fc,null));};exports['destroy']=function(_0x5217cb,_0x54d8f9){return db[_0x646b('0x2a')]['find']({'where':{'id':_0x5217cb['params']['id']}})[_0x646b('0x25')](handleEntityNotFound(_0x54d8f9,null))[_0x646b('0x25')](removeEntity(_0x54d8f9,null))['catch'](handleError(_0x54d8f9,null));}; \ No newline at end of file +var _0x8877=['../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','undefined','limit','count','set','save','then','destroy','error','name','send','index','map','SalesforceField','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','include','findAll','rows','show','params','length','includeAll','create','body','catch','find','eml-format','rimraf','zip-dir','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x445bf7,_0x222420){var _0x1a70e3=function(_0x11d24d){while(--_0x11d24d){_0x445bf7['push'](_0x445bf7['shift']());}};_0x1a70e3(++_0x222420);}(_0x8877,0x105));var _0x7887=function(_0xbe05c8,_0x26be13){_0xbe05c8=_0xbe05c8-0x0;var _0xbd60ca=_0x8877[_0xbe05c8];return _0xbd60ca;};'use strict';var emlformat=require(_0x7887('0x0'));var rimraf=require(_0x7887('0x1'));var zipdir=require(_0x7887('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7887('0x3'));var moment=require('moment');var BPromise=require(_0x7887('0x4'));var Mustache=require('mustache');var util=require(_0x7887('0x5'));var path=require('path');var sox=require(_0x7887('0x6'));var csv=require(_0x7887('0x7'));var ejs=require(_0x7887('0x8'));var fs=require('fs');var fs_extra=require(_0x7887('0x9'));var _=require(_0x7887('0xa'));var squel=require('squel');var crypto=require(_0x7887('0xb'));var jsforce=require(_0x7887('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7887('0xd'));var Papa=require(_0x7887('0xe'));var Redis=require('ioredis');var authService=require(_0x7887('0xf'));var qs=require(_0x7887('0x10'));var as=require(_0x7887('0x11'));var hardwareService=require(_0x7887('0x12'));var logger=require(_0x7887('0x13'))(_0x7887('0x14'));var utils=require(_0x7887('0x15'));var config=require(_0x7887('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x59481f,_0x4ae1de){_0x4ae1de=_0x4ae1de||0xcc;return function(_0x2855de){if(_0x2855de){return _0x59481f[_0x7887('0x17')](_0x4ae1de);}return _0x59481f['status'](_0x4ae1de)[_0x7887('0x18')]();};}function respondWithResult(_0x2ac558,_0x1134ac){_0x1134ac=_0x1134ac||0xc8;return function(_0x4668fc){if(_0x4668fc){return _0x2ac558[_0x7887('0x19')](_0x1134ac)[_0x7887('0x1a')](_0x4668fc);}};}function respondWithFilteredResult(_0x546e95,_0x1300f2){return function(_0x3d274e){if(_0x3d274e){var _0x236181=typeof _0x1300f2[_0x7887('0x1b')]===_0x7887('0x1c')&&typeof _0x1300f2[_0x7887('0x1d')]===_0x7887('0x1c');var _0x483a89=_0x3d274e[_0x7887('0x1e')];var _0x34f63c=_0x236181?0x0:_0x1300f2[_0x7887('0x1b')];var _0x16dc35=_0x236181?_0x3d274e[_0x7887('0x1e')]:_0x1300f2[_0x7887('0x1b')]+_0x1300f2[_0x7887('0x1d')];var _0x4a6c67;if(_0x16dc35>=_0x483a89){_0x16dc35=_0x483a89;_0x4a6c67=0xc8;}else{_0x4a6c67=0xce;}_0x546e95['status'](_0x4a6c67);return _0x546e95[_0x7887('0x1f')]('Content-Range',_0x34f63c+'-'+_0x16dc35+'/'+_0x483a89)[_0x7887('0x1a')](_0x3d274e);}return null;};}function patchUpdates(_0x1ab4f4){return function(_0x5ac4f2){try{jsonpatch['apply'](_0x5ac4f2,_0x1ab4f4,!![]);}catch(_0x3e71d4){return BPromise['reject'](_0x3e71d4);}return _0x5ac4f2[_0x7887('0x20')]();};}function saveUpdates(_0x9e1f42,_0x5cbd3e){return function(_0x5e6302){if(_0x5e6302){return _0x5e6302['update'](_0x9e1f42)[_0x7887('0x21')](function(_0x37d46c){return _0x37d46c;});}return null;};}function removeEntity(_0x5e3ae4,_0x42f67c){return function(_0x4aca35){if(_0x4aca35){return _0x4aca35[_0x7887('0x22')]()['then'](function(){_0x5e3ae4[_0x7887('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40c304,_0x4fc716){return function(_0x5a3a64){if(!_0x5a3a64){_0x40c304['sendStatus'](0x194);}return _0x5a3a64;};}function handleError(_0x25eeeb,_0x222ba4){_0x222ba4=_0x222ba4||0x1f4;return function(_0x431a9c){logger[_0x7887('0x23')](_0x431a9c['stack']);if(_0x431a9c[_0x7887('0x24')]){delete _0x431a9c[_0x7887('0x24')];}_0x25eeeb[_0x7887('0x19')](_0x222ba4)[_0x7887('0x25')](_0x431a9c);};}exports[_0x7887('0x26')]=function(_0x4c067f,_0x4ebc9b){var _0x522212={},_0x1db9e2={},_0x3cb03a={'count':0x0,'rows':[]};var _0x3a3290=_[_0x7887('0x27')](db[_0x7887('0x28')][_0x7887('0x29')],function(_0x140b8b){return{'name':_0x140b8b[_0x7887('0x2a')],'type':_0x140b8b[_0x7887('0x2b')]['key']};});_0x1db9e2['model']=_[_0x7887('0x27')](_0x3a3290,_0x7887('0x24'));_0x1db9e2[_0x7887('0x2c')]=_[_0x7887('0x2d')](_0x4c067f[_0x7887('0x2c')]);_0x1db9e2[_0x7887('0x2e')]=_[_0x7887('0x2f')](_0x1db9e2[_0x7887('0x30')],_0x1db9e2[_0x7887('0x2c')]);_0x522212[_0x7887('0x31')]=_[_0x7887('0x2f')](_0x1db9e2[_0x7887('0x30')],qs[_0x7887('0x32')](_0x4c067f[_0x7887('0x2c')]['fields']));_0x522212[_0x7887('0x31')]=_0x522212['attributes']['length']?_0x522212[_0x7887('0x31')]:_0x1db9e2[_0x7887('0x30')];if(!_0x4c067f[_0x7887('0x2c')][_0x7887('0x33')](_0x7887('0x34'))){_0x522212[_0x7887('0x1d')]=qs[_0x7887('0x1d')](_0x4c067f[_0x7887('0x2c')]['limit']);_0x522212[_0x7887('0x1b')]=qs['offset'](_0x4c067f[_0x7887('0x2c')][_0x7887('0x1b')]);}_0x522212['order']=qs[_0x7887('0x35')](_0x4c067f['query'][_0x7887('0x35')]);_0x522212[_0x7887('0x36')]=qs[_0x7887('0x2e')](_[_0x7887('0x37')](_0x4c067f[_0x7887('0x2c')],_0x1db9e2['filters']),_0x3a3290);if(_0x4c067f['query'][_0x7887('0x38')]){_0x522212['where']=_[_0x7887('0x39')](_0x522212['where'],{'$or':_['map'](_0x3a3290,function(_0x2b3164){if(_0x2b3164['type']!=='VIRTUAL'){var _0x39f581={};_0x39f581[_0x2b3164['name']]={'$like':'%'+_0x4c067f[_0x7887('0x2c')][_0x7887('0x38')]+'%'};return _0x39f581;}})});}_0x522212=_[_0x7887('0x39')]({},_0x522212,_0x4c067f[_0x7887('0x3a')]);var _0x45c5a9={'where':_0x522212[_0x7887('0x36')]};return db['SalesforceField']['count'](_0x45c5a9)[_0x7887('0x21')](function(_0x59cd94){_0x3cb03a['count']=_0x59cd94;if(_0x4c067f[_0x7887('0x2c')]['includeAll']){_0x522212[_0x7887('0x3b')]=[{'all':!![]}];}return db['SalesforceField'][_0x7887('0x3c')](_0x522212);})[_0x7887('0x21')](function(_0x38bc2a){_0x3cb03a[_0x7887('0x3d')]=_0x38bc2a;return _0x3cb03a;})['then'](respondWithFilteredResult(_0x4ebc9b,_0x522212))['catch'](handleError(_0x4ebc9b,null));};exports[_0x7887('0x3e')]=function(_0x25fc10,_0xf3b96c){var _0x48128b={'raw':!![],'where':{'id':_0x25fc10[_0x7887('0x3f')]['id']}},_0x4d5767={};_0x4d5767[_0x7887('0x30')]=_['keys'](db[_0x7887('0x28')][_0x7887('0x29')]);_0x4d5767['query']=_[_0x7887('0x2d')](_0x25fc10[_0x7887('0x2c')]);_0x4d5767['filters']=_[_0x7887('0x2f')](_0x4d5767['model'],_0x4d5767[_0x7887('0x2c')]);_0x48128b[_0x7887('0x31')]=_['intersection'](_0x4d5767[_0x7887('0x30')],qs[_0x7887('0x32')](_0x25fc10[_0x7887('0x2c')][_0x7887('0x32')]));_0x48128b[_0x7887('0x31')]=_0x48128b[_0x7887('0x31')][_0x7887('0x40')]?_0x48128b[_0x7887('0x31')]:_0x4d5767[_0x7887('0x30')];if(_0x25fc10[_0x7887('0x2c')][_0x7887('0x41')]){_0x48128b['include']=[{'all':!![]}];}_0x48128b=_[_0x7887('0x39')]({},_0x48128b,_0x25fc10['options']);return db[_0x7887('0x28')]['find'](_0x48128b)[_0x7887('0x21')](handleEntityNotFound(_0xf3b96c,null))['then'](respondWithResult(_0xf3b96c,null))['catch'](handleError(_0xf3b96c,null));};exports[_0x7887('0x42')]=function(_0x8c3e26,_0x5247a5){return db['SalesforceField'][_0x7887('0x42')](_0x8c3e26[_0x7887('0x43')],{})[_0x7887('0x21')](respondWithResult(_0x5247a5,0xc9))[_0x7887('0x44')](handleError(_0x5247a5,null));};exports['update']=function(_0x4730ac,_0x3ec398){if(_0x4730ac['body']['id']){delete _0x4730ac[_0x7887('0x43')]['id'];}return db[_0x7887('0x28')][_0x7887('0x45')]({'where':{'id':_0x4730ac['params']['id']}})[_0x7887('0x21')](handleEntityNotFound(_0x3ec398,null))[_0x7887('0x21')](saveUpdates(_0x4730ac['body'],null))[_0x7887('0x21')](respondWithResult(_0x3ec398,null))['catch'](handleError(_0x3ec398,null));};exports[_0x7887('0x22')]=function(_0x317c28,_0x36fc02){return db['SalesforceField'][_0x7887('0x45')]({'where':{'id':_0x317c28[_0x7887('0x3f')]['id']}})[_0x7887('0x21')](handleEntityNotFound(_0x36fc02,null))[_0x7887('0x21')](removeEntity(_0x36fc02,null))[_0x7887('0x44')](handleError(_0x36fc02,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index e255d0e..9b6c3ac 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 _0x5cef=['bluebird','path','rimraf','../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5cef,0x1e8));var _0xf5ce=function(_0x5d8fe1,_0xf8dad1){_0x5d8fe1=_0x5d8fe1-0x0;var _0x1c7c6c=_0x5cef[_0x5d8fe1];return _0x1c7c6c;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xf5ce('0x0'));var moment=require(_0xf5ce('0x1'));var BPromise=require(_0xf5ce('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf5ce('0x3'));var rimraf=require(_0xf5ce('0x4'));var config=require(_0xf5ce('0x5'));var attributes=require(_0xf5ce('0x6'));module[_0xf5ce('0x7')]=function(_0x58696f,_0x37e2d8){return _0x58696f[_0xf5ce('0x8')](_0xf5ce('0x9'),attributes,{'tableName':_0xf5ce('0xa'),'paranoid':![],'indexes':[{'name':_0xf5ce('0xb'),'fields':[_0xf5ce('0xc'),_0xf5ce('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3dfe=['../../config/logger','api','path','rimraf','../../config/environment','exports','define','SalesforceField','salesforce_unique_index','idField','FieldId','util'];(function(_0x29aca7,_0x21c650){var _0x1db0a0=function(_0x45b5ea){while(--_0x45b5ea){_0x29aca7['push'](_0x29aca7['shift']());}};_0x1db0a0(++_0x21c650);}(_0x3dfe,0x1a3));var _0xe3df=function(_0xd45f26,_0x3c18cb){_0xd45f26=_0xd45f26-0x0;var _0x5b3c9c=_0x3dfe[_0xd45f26];return _0x5b3c9c;};'use strict';var _=require('lodash');var util=require(_0xe3df('0x0'));var logger=require(_0xe3df('0x1'))(_0xe3df('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe3df('0x3'));var rimraf=require(_0xe3df('0x4'));var config=require(_0xe3df('0x5'));var attributes=require('./intSalesforceField.attributes');module[_0xe3df('0x6')]=function(_0x5da4cd,_0x5bb111){return _0x5da4cd[_0xe3df('0x7')](_0xe3df('0x8'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0xe3df('0x9'),'fields':[_0xe3df('0xa'),_0xe3df('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index 01b618f..e50c7a6 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 _0x7330=['../../mysqldb','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x45c981,_0x2ad2d4){var _0x4f62c8=function(_0x55209b){while(--_0x55209b){_0x45c981['push'](_0x45c981['shift']());}};_0x4f62c8(++_0x2ad2d4);}(_0x7330,0x94));var _0x0733=function(_0x2d8029,_0x16a1e8){_0x2d8029=_0x2d8029-0x0;var _0x3fb34d=_0x7330[_0x2d8029];return _0x3fb34d;};'use strict';var _=require(_0x0733('0x0'));var util=require(_0x0733('0x1'));var moment=require(_0x0733('0x2'));var BPromise=require(_0x0733('0x3'));var rs=require(_0x0733('0x4'));var fs=require('fs');var Redis=require(_0x0733('0x5'));var db=require(_0x0733('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0733('0x7'))(_0x0733('0x8'));var config=require(_0x0733('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0733('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5bb36e,_0x472316,_0x40776c){return new BPromise(function(_0x2b17de,_0x212a4b){return client['request'](_0x5bb36e,_0x40776c)[_0x0733('0xb')](function(_0x459790){logger[_0x0733('0xc')]('SalesforceField,\x20%s,\x20%s',_0x472316,_0x0733('0xd'));logger['debug'](_0x0733('0xe'),_0x472316,_0x0733('0xd'),JSON[_0x0733('0xf')](_0x459790));if(_0x459790[_0x0733('0x10')]){if(_0x459790[_0x0733('0x10')][_0x0733('0x11')]===0x1f4){logger[_0x0733('0x10')](_0x0733('0x12'),_0x472316,_0x459790[_0x0733('0x10')][_0x0733('0x13')]);return _0x212a4b(_0x459790[_0x0733('0x10')][_0x0733('0x13')]);}logger[_0x0733('0x10')](_0x0733('0x12'),_0x472316,_0x459790[_0x0733('0x10')][_0x0733('0x13')]);return _0x2b17de(_0x459790['error'][_0x0733('0x13')]);}else{logger['info'](_0x0733('0x12'),_0x472316,_0x0733('0xd'));_0x2b17de(_0x459790[_0x0733('0x14')][_0x0733('0x13')]);}})[_0x0733('0x15')](function(_0x201eb5){logger[_0x0733('0x10')]('SalesforceField,\x20%s,\x20%s',_0x472316,_0x201eb5);_0x212a4b(_0x201eb5);});});} \ No newline at end of file +var _0xd46e=['../../config/environment','client','http','request','info','SalesforceField,\x20%s,\x20%s','debug','SalesforceField,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x2767ce,_0x3b796e){var _0x466194=function(_0x12ed21){while(--_0x12ed21){_0x2767ce['push'](_0x2767ce['shift']());}};_0x466194(++_0x3b796e);}(_0xd46e,0x133));var _0xed46=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0xd46e[_0x17b6e3];return _0x3906f3;};'use strict';var _=require('lodash');var util=require(_0xed46('0x0'));var moment=require(_0xed46('0x1'));var BPromise=require(_0xed46('0x2'));var rs=require(_0xed46('0x3'));var fs=require('fs');var Redis=require(_0xed46('0x4'));var db=require(_0xed46('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xed46('0x6'))(_0xed46('0x7'));var config=require(_0xed46('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xed46('0x9')][_0xed46('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x453f12,_0x582cd2,_0x444e47){return new BPromise(function(_0x15dad3,_0x4741bb){return client[_0xed46('0xb')](_0x453f12,_0x444e47)['then'](function(_0x1cecd9){logger[_0xed46('0xc')](_0xed46('0xd'),_0x582cd2,'request\x20sent');logger[_0xed46('0xe')](_0xed46('0xf'),_0x582cd2,'request\x20sent',JSON['stringify'](_0x1cecd9));if(_0x1cecd9['error']){if(_0x1cecd9[_0xed46('0x10')][_0xed46('0x11')]===0x1f4){logger[_0xed46('0x10')](_0xed46('0xd'),_0x582cd2,_0x1cecd9[_0xed46('0x10')][_0xed46('0x12')]);return _0x4741bb(_0x1cecd9[_0xed46('0x10')][_0xed46('0x12')]);}logger[_0xed46('0x10')]('SalesforceField,\x20%s,\x20%s',_0x582cd2,_0x1cecd9[_0xed46('0x10')][_0xed46('0x12')]);return _0x15dad3(_0x1cecd9[_0xed46('0x10')]['message']);}else{logger[_0xed46('0xc')](_0xed46('0xd'),_0x582cd2,_0xed46('0x13'));_0x15dad3(_0x1cecd9['result'][_0xed46('0x12')]);}})[_0xed46('0x14')](function(_0x3d5159){logger[_0xed46('0x10')](_0xed46('0xd'),_0x582cd2,_0x3d5159);_0x4741bb(_0x3d5159);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 866bc75..337eb1f 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 _0x684d=['get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x684d,0xcf));var _0xd684=function(_0x53ad71,_0x39b873){_0x53ad71=_0x53ad71-0x0;var _0x4babcd=_0x684d[_0x53ad71];return _0x4babcd;};'use strict';var multer=require(_0xd684('0x0'));var util=require(_0xd684('0x1'));var path=require('path');var timeout=require(_0xd684('0x2'));var express=require(_0xd684('0x3'));var router=express['Router']();var fs_extra=require(_0xd684('0x4'));var auth=require(_0xd684('0x5'));var interaction=require(_0xd684('0x6'));var config=require(_0xd684('0x7'));var controller=require(_0xd684('0x8'));router[_0xd684('0x9')]('/',auth[_0xd684('0xa')](),controller[_0xd684('0xb')]);router[_0xd684('0x9')](_0xd684('0xc'),auth['isAuthenticated'](),controller['show']);router['get'](_0xd684('0xd'),auth[_0xd684('0xa')](),controller[_0xd684('0xe')]);router[_0xd684('0x9')](_0xd684('0xf'),auth[_0xd684('0xa')](),controller[_0xd684('0x10')]);router[_0xd684('0x11')]('/',auth[_0xd684('0xa')](),controller['create']);router[_0xd684('0x11')](_0xd684('0xd'),auth[_0xd684('0xa')](),controller[_0xd684('0x12')]);router[_0xd684('0x13')](_0xd684('0xc'),auth[_0xd684('0xa')](),controller[_0xd684('0x14')]);router[_0xd684('0x15')](_0xd684('0xc'),auth[_0xd684('0xa')](),controller[_0xd684('0x16')]);module[_0xd684('0x17')]=router; \ No newline at end of file +var _0x24b3=['exports','multer','util','path','express','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','update','delete','destroy'];(function(_0x257896,_0x8de612){var _0x1ff242=function(_0x8ea06a){while(--_0x8ea06a){_0x257896['push'](_0x257896['shift']());}};_0x1ff242(++_0x8de612);}(_0x24b3,0xd3));var _0x324b=function(_0x3645b8,_0x3bfdd7){_0x3645b8=_0x3645b8-0x0;var _0x4c78df=_0x24b3[_0x3645b8];return _0x4c78df;};'use strict';var multer=require(_0x324b('0x0'));var util=require(_0x324b('0x1'));var path=require(_0x324b('0x2'));var timeout=require('connect-timeout');var express=require(_0x324b('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x324b('0x4'));var config=require(_0x324b('0x5'));var controller=require('./intServicenowAccount.controller');router[_0x324b('0x6')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x324b('0x7'),auth[_0x324b('0x8')](),controller[_0x324b('0x9')]);router['get']('/:id/configurations',auth['isAuthenticated'](),controller[_0x324b('0xa')]);router['get'](_0x324b('0xb'),auth[_0x324b('0x8')](),controller[_0x324b('0xc')]);router[_0x324b('0xd')]('/',auth[_0x324b('0x8')](),controller[_0x324b('0xe')]);router[_0x324b('0xd')](_0x324b('0xf'),auth[_0x324b('0x8')](),controller[_0x324b('0x10')]);router['put'](_0x324b('0x7'),auth[_0x324b('0x8')](),controller[_0x324b('0x11')]);router[_0x324b('0x12')](_0x324b('0x7'),auth[_0x324b('0x8')](),controller[_0x324b('0x13')]);module[_0x324b('0x14')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 4ea1ee5..484e0e3 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 _0x74af=['username','remoteUri','sequelize','exports','STRING'];(function(_0x347453,_0x3286d8){var _0x522b6d=function(_0xef1bf5){while(--_0xef1bf5){_0x347453['push'](_0x347453['shift']());}};_0x522b6d(++_0x3286d8);}(_0x74af,0x12e));var _0xf74a=function(_0x1dd184,_0x5d37d7){_0x1dd184=_0x1dd184-0x0;var _0x3619a7=_0x74af[_0x1dd184];return _0x3619a7;};'use strict';var Sequelize=require(_0xf74a('0x0'));module[_0xf74a('0x1')]={'name':{'type':Sequelize[_0xf74a('0x2')]},'description':{'type':Sequelize[_0xf74a('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0xf74a('0x3')},'password':{'type':Sequelize[_0xf74a('0x2')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xf74a('0x2')],'unique':_0xf74a('0x4')},'serverUrl':{'type':Sequelize[_0xf74a('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x7ef0=['sequelize','exports','STRING','username','remoteUri'];(function(_0x104cb0,_0x5e169d){var _0x417d51=function(_0x567e7f){while(--_0x567e7f){_0x104cb0['push'](_0x104cb0['shift']());}};_0x417d51(++_0x5e169d);}(_0x7ef0,0x1c2));var _0x07ef=function(_0x5530a9,_0x48e4c2){_0x5530a9=_0x5530a9-0x0;var _0x1c69f4=_0x7ef0[_0x5530a9];return _0x1c69f4;};'use strict';var Sequelize=require(_0x07ef('0x0'));module[_0x07ef('0x1')]={'name':{'type':Sequelize[_0x07ef('0x2')]},'description':{'type':Sequelize[_0x07ef('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x07ef('0x3')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x07ef('0x2')],'unique':_0x07ef('0x4')},'serverUrl':{'type':Sequelize[_0x07ef('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 e6b2cc4..d71da50 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 _0x2eb4=['approval','comments_and_work_notes','reopen_count','sys_tags','correlation_id','location','username','password','email','serverUrl','remoteUri','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','push','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','label','concat','test','error','send','statusCode','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','eml-format','zip-dir','request-promise','moment','mustache','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','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','undefined','count','offset','limit','set','json','apply','reject','save','destroy','then','stack','name','map','ServicenowAccount','rawAttributes','type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','includeAll','include','findAll','rows','show','params','keys','options','catch','create','update','body','find','getConfigurations','findOne','ServicenowConfiguration','addConfiguration','AccountId','getSubjects','channel','getDescriptions','ServicenowField','Subjects','getFields','hold_reason','knowledge','notify','incident_state','severity','category','parent','made_sla','caused_by','upon_reject','approval_history','number','resolved_by','opened_by','user_input','sys_created_on','sys_domain','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','active','work_notes_list','business_service','priority','sys_domain_path','rfc','opened_at','group_list','work_end','reopened_time','resolved_at','subcategory','work_notes','close_code','correlation_display','delivery_task','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','urgency','reassignment_count','activity_due','assigned_to','sla_due'];(function(_0x20a50a,_0x5a8224){var _0x14b9f7=function(_0x288d78){while(--_0x288d78){_0x20a50a['push'](_0x20a50a['shift']());}};_0x14b9f7(++_0x5a8224);}(_0x2eb4,0xdc));var _0x42eb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2eb4[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x42eb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x42eb('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x42eb('0x2'));var moment=require(_0x42eb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x42eb('0x4'));var util=require(_0x42eb('0x5'));var path=require(_0x42eb('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x42eb('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x42eb('0x8'));var squel=require(_0x42eb('0x9'));var crypto=require('crypto');var jsforce=require(_0x42eb('0xa'));var deskjs=require(_0x42eb('0xb'));var toCsv=require(_0x42eb('0xc'));var querystring=require(_0x42eb('0xd'));var Papa=require(_0x42eb('0xe'));var Redis=require(_0x42eb('0xf'));var authService=require(_0x42eb('0x10'));var qs=require(_0x42eb('0x11'));var as=require(_0x42eb('0x12'));var hardwareService=require(_0x42eb('0x13'));var logger=require(_0x42eb('0x14'))('api');var utils=require(_0x42eb('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x42eb('0x16'));var db=require(_0x42eb('0x17'))['db'];var integrations=require(_0x42eb('0x18'));function respondWithStatusCode(_0x7ab5c4,_0x47c5e7){_0x47c5e7=_0x47c5e7||0xcc;return function(_0x49015c){if(_0x49015c){return _0x7ab5c4['sendStatus'](_0x47c5e7);}return _0x7ab5c4[_0x42eb('0x19')](_0x47c5e7)[_0x42eb('0x1a')]();};}function respondWithResult(_0x3ffae5,_0x4a03ff){_0x4a03ff=_0x4a03ff||0xc8;return function(_0x497d13){if(_0x497d13){return _0x3ffae5[_0x42eb('0x19')](_0x4a03ff)['json'](_0x497d13);}};}function respondWithFilteredResult(_0x33c99d,_0x4b75bc){return function(_0x39e4f0){if(_0x39e4f0){var _0x2b425c=typeof _0x4b75bc['offset']===_0x42eb('0x1b')&&typeof _0x4b75bc['limit']===_0x42eb('0x1b');var _0x1c67d2=_0x39e4f0[_0x42eb('0x1c')];var _0x4e3cd5=_0x2b425c?0x0:_0x4b75bc[_0x42eb('0x1d')];var _0xb96240=_0x2b425c?_0x39e4f0['count']:_0x4b75bc[_0x42eb('0x1d')]+_0x4b75bc[_0x42eb('0x1e')];var _0x383d7c;if(_0xb96240>=_0x1c67d2){_0xb96240=_0x1c67d2;_0x383d7c=0xc8;}else{_0x383d7c=0xce;}_0x33c99d[_0x42eb('0x19')](_0x383d7c);return _0x33c99d[_0x42eb('0x1f')]('Content-Range',_0x4e3cd5+'-'+_0xb96240+'/'+_0x1c67d2)[_0x42eb('0x20')](_0x39e4f0);}return null;};}function patchUpdates(_0x45318d){return function(_0x442dfd){try{jsonpatch[_0x42eb('0x21')](_0x442dfd,_0x45318d,!![]);}catch(_0x1166f2){return BPromise[_0x42eb('0x22')](_0x1166f2);}return _0x442dfd[_0x42eb('0x23')]();};}function saveUpdates(_0x1be724,_0x3a4374){return function(_0x380cd9){if(_0x380cd9){return _0x380cd9['update'](_0x1be724)['then'](function(_0x3e7ed7){return _0x3e7ed7;});}return null;};}function removeEntity(_0x13eb03,_0x2d22e9){return function(_0x17fee5){if(_0x17fee5){return _0x17fee5[_0x42eb('0x24')]()[_0x42eb('0x25')](function(){_0x13eb03[_0x42eb('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51fc47,_0x491ea0){return function(_0x3b4ee5){if(!_0x3b4ee5){_0x51fc47['sendStatus'](0x194);}return _0x3b4ee5;};}function handleError(_0x3d4dad,_0x566851){_0x566851=_0x566851||0x1f4;return function(_0x5e6e71){logger['error'](_0x5e6e71[_0x42eb('0x26')]);if(_0x5e6e71[_0x42eb('0x27')]){delete _0x5e6e71[_0x42eb('0x27')];}_0x3d4dad[_0x42eb('0x19')](_0x566851)['send'](_0x5e6e71);};}exports['index']=function(_0xd4e981,_0x17813e){var _0x59b40b={},_0x573e24={},_0x3f9c84={'count':0x0,'rows':[]};var _0x408b41=_[_0x42eb('0x28')](db[_0x42eb('0x29')][_0x42eb('0x2a')],function(_0x5bea01){return{'name':_0x5bea01['fieldName'],'type':_0x5bea01[_0x42eb('0x2b')][_0x42eb('0x2c')]};});_0x573e24['model']=_[_0x42eb('0x28')](_0x408b41,'name');_0x573e24[_0x42eb('0x2d')]=_['keys'](_0xd4e981[_0x42eb('0x2d')]);_0x573e24['filters']=_[_0x42eb('0x2e')](_0x573e24[_0x42eb('0x2f')],_0x573e24[_0x42eb('0x2d')]);_0x59b40b[_0x42eb('0x30')]=_[_0x42eb('0x2e')](_0x573e24['model'],qs[_0x42eb('0x31')](_0xd4e981[_0x42eb('0x2d')][_0x42eb('0x31')]));_0x59b40b[_0x42eb('0x30')]=_0x59b40b[_0x42eb('0x30')][_0x42eb('0x32')]?_0x59b40b[_0x42eb('0x30')]:_0x573e24[_0x42eb('0x2f')];if(!_0xd4e981[_0x42eb('0x2d')][_0x42eb('0x33')](_0x42eb('0x34'))){_0x59b40b[_0x42eb('0x1e')]=qs[_0x42eb('0x1e')](_0xd4e981[_0x42eb('0x2d')][_0x42eb('0x1e')]);_0x59b40b[_0x42eb('0x1d')]=qs['offset'](_0xd4e981['query'][_0x42eb('0x1d')]);}_0x59b40b[_0x42eb('0x35')]=qs['sort'](_0xd4e981[_0x42eb('0x2d')][_0x42eb('0x36')]);_0x59b40b['where']=qs[_0x42eb('0x37')](_[_0x42eb('0x38')](_0xd4e981[_0x42eb('0x2d')],_0x573e24['filters']),_0x408b41);if(_0xd4e981[_0x42eb('0x2d')][_0x42eb('0x39')]){_0x59b40b[_0x42eb('0x3a')]=_[_0x42eb('0x3b')](_0x59b40b[_0x42eb('0x3a')],{'$or':_['map'](_0x408b41,function(_0x4b95a5){if(_0x4b95a5[_0x42eb('0x2b')]!=='VIRTUAL'){var _0x53f1af={};_0x53f1af[_0x4b95a5[_0x42eb('0x27')]]={'$like':'%'+_0xd4e981[_0x42eb('0x2d')]['filter']+'%'};return _0x53f1af;}})});}_0x59b40b=_[_0x42eb('0x3b')]({},_0x59b40b,_0xd4e981['options']);var _0x5dc8ca={'where':_0x59b40b[_0x42eb('0x3a')]};return db[_0x42eb('0x29')][_0x42eb('0x1c')](_0x5dc8ca)[_0x42eb('0x25')](function(_0x3e2008){_0x3f9c84[_0x42eb('0x1c')]=_0x3e2008;if(_0xd4e981['query'][_0x42eb('0x3c')]){_0x59b40b[_0x42eb('0x3d')]=[{'all':!![]}];}return db[_0x42eb('0x29')][_0x42eb('0x3e')](_0x59b40b);})['then'](function(_0x5e1176){_0x3f9c84[_0x42eb('0x3f')]=_0x5e1176;return _0x3f9c84;})['then'](respondWithFilteredResult(_0x17813e,_0x59b40b))['catch'](handleError(_0x17813e,null));};exports[_0x42eb('0x40')]=function(_0xabf5ed,_0x206cb1){var _0x507208={'raw':![],'where':{'id':_0xabf5ed[_0x42eb('0x41')]['id']}},_0x287a91={};_0x287a91[_0x42eb('0x2f')]=_[_0x42eb('0x42')](db[_0x42eb('0x29')][_0x42eb('0x2a')]);_0x287a91[_0x42eb('0x2d')]=_[_0x42eb('0x42')](_0xabf5ed[_0x42eb('0x2d')]);_0x287a91[_0x42eb('0x37')]=_[_0x42eb('0x2e')](_0x287a91[_0x42eb('0x2f')],_0x287a91['query']);_0x507208[_0x42eb('0x30')]=_[_0x42eb('0x2e')](_0x287a91[_0x42eb('0x2f')],qs[_0x42eb('0x31')](_0xabf5ed[_0x42eb('0x2d')][_0x42eb('0x31')]));_0x507208[_0x42eb('0x30')]=_0x507208['attributes']['length']?_0x507208[_0x42eb('0x30')]:_0x287a91[_0x42eb('0x2f')];if(_0xabf5ed[_0x42eb('0x2d')][_0x42eb('0x3c')]){_0x507208[_0x42eb('0x3d')]=[{'all':!![]}];}_0x507208=_['merge']({},_0x507208,_0xabf5ed[_0x42eb('0x43')]);return db[_0x42eb('0x29')]['find'](_0x507208)[_0x42eb('0x25')](handleEntityNotFound(_0x206cb1,null))[_0x42eb('0x25')](respondWithResult(_0x206cb1,null))[_0x42eb('0x44')](handleError(_0x206cb1,null));};exports[_0x42eb('0x45')]=function(_0x45d05d,_0x4e5af9){return db['ServicenowAccount']['create'](_0x45d05d['body'],{})['then'](respondWithResult(_0x4e5af9,0xc9))['catch'](handleError(_0x4e5af9,null));};exports[_0x42eb('0x46')]=function(_0x31eac9,_0x15665e){if(_0x31eac9[_0x42eb('0x47')]['id']){delete _0x31eac9[_0x42eb('0x47')]['id'];}return db[_0x42eb('0x29')]['find']({'where':{'id':_0x31eac9[_0x42eb('0x41')]['id']}})[_0x42eb('0x25')](handleEntityNotFound(_0x15665e,null))['then'](saveUpdates(_0x31eac9[_0x42eb('0x47')],null))['then'](respondWithResult(_0x15665e,null))[_0x42eb('0x44')](handleError(_0x15665e,null));};exports[_0x42eb('0x24')]=function(_0xcaf811,_0x18db95){return db[_0x42eb('0x29')][_0x42eb('0x48')]({'where':{'id':_0xcaf811[_0x42eb('0x41')]['id']}})[_0x42eb('0x25')](handleEntityNotFound(_0x18db95,null))[_0x42eb('0x25')](removeEntity(_0x18db95,null))['catch'](handleError(_0x18db95,null));};exports[_0x42eb('0x49')]=function(_0x50fb2a,_0x368bd5,_0x472e5b){var _0x642d39={};var _0x201f9b={};var _0x344895;var _0x283b6e;return db['ServicenowAccount'][_0x42eb('0x4a')]({'where':{'id':_0x50fb2a[_0x42eb('0x41')]['id']}})[_0x42eb('0x25')](handleEntityNotFound(_0x368bd5,null))[_0x42eb('0x25')](function(_0x5c590b){if(_0x5c590b){_0x344895=_0x5c590b;_0x201f9b[_0x42eb('0x2f')]=_['keys'](db[_0x42eb('0x4b')]['rawAttributes']);_0x201f9b[_0x42eb('0x2d')]=_[_0x42eb('0x42')](_0x50fb2a[_0x42eb('0x2d')]);_0x201f9b[_0x42eb('0x37')]=_[_0x42eb('0x2e')](_0x201f9b[_0x42eb('0x2f')],_0x201f9b[_0x42eb('0x2d')]);_0x642d39[_0x42eb('0x30')]=_['intersection'](_0x201f9b[_0x42eb('0x2f')],qs[_0x42eb('0x31')](_0x50fb2a[_0x42eb('0x2d')][_0x42eb('0x31')]));_0x642d39[_0x42eb('0x30')]=_0x642d39['attributes'][_0x42eb('0x32')]?_0x642d39['attributes']:_0x201f9b[_0x42eb('0x2f')];_0x642d39['order']=qs[_0x42eb('0x36')](_0x50fb2a[_0x42eb('0x2d')][_0x42eb('0x36')]);_0x642d39[_0x42eb('0x3a')]=qs[_0x42eb('0x37')](_[_0x42eb('0x38')](_0x50fb2a[_0x42eb('0x2d')],_0x201f9b['filters']));if(_0x50fb2a['query']['filter']){_0x642d39[_0x42eb('0x3a')]=_[_0x42eb('0x3b')](_0x642d39['where'],{'$or':_['map'](_0x642d39[_0x42eb('0x30')],function(_0x5f105f){var _0x12bdba={};_0x12bdba[_0x5f105f]={'$like':'%'+_0x50fb2a[_0x42eb('0x2d')][_0x42eb('0x39')]+'%'};return _0x12bdba;})});}_0x642d39=_['merge']({},_0x642d39,_0x50fb2a[_0x42eb('0x43')]);return _0x344895[_0x42eb('0x49')](_0x642d39);}})[_0x42eb('0x25')](function(_0x56b93b){if(_0x56b93b){_0x283b6e=_0x56b93b[_0x42eb('0x32')];if(!_0x50fb2a[_0x42eb('0x2d')][_0x42eb('0x33')](_0x42eb('0x34'))){_0x642d39[_0x42eb('0x1e')]=qs['limit'](_0x50fb2a[_0x42eb('0x2d')][_0x42eb('0x1e')]);_0x642d39['offset']=qs[_0x42eb('0x1d')](_0x50fb2a[_0x42eb('0x2d')][_0x42eb('0x1d')]);}return _0x344895[_0x42eb('0x49')](_0x642d39);}})[_0x42eb('0x25')](function(_0x371f99){if(_0x371f99){return _0x371f99?{'count':_0x283b6e,'rows':_0x371f99}:null;}})[_0x42eb('0x25')](respondWithResult(_0x368bd5,null))[_0x42eb('0x44')](handleError(_0x368bd5,null));};exports[_0x42eb('0x4c')]=function(_0x1abab5,_0x392de3,_0x70b910){if(_0x1abab5[_0x42eb('0x47')]['id']){delete _0x1abab5['body']['id'];}return db[_0x42eb('0x29')][_0x42eb('0x4a')]({'where':{'id':_0x1abab5[_0x42eb('0x41')]['id']}})[_0x42eb('0x25')](handleEntityNotFound(_0x392de3,null))[_0x42eb('0x25')](function(_0x311c9c){if(_0x311c9c){_0x1abab5['body'][_0x42eb('0x4d')]=_0x311c9c['id'];_0x1abab5[_0x42eb('0x47')]['Subjects']=integrations[_0x42eb('0x4e')](_0x1abab5[_0x42eb('0x47')][_0x42eb('0x4f')],_0x1abab5['body'][_0x42eb('0x2b')]);_0x1abab5[_0x42eb('0x47')]['Descriptions']=integrations[_0x42eb('0x50')](_0x1abab5[_0x42eb('0x47')]['channel'],_0x1abab5[_0x42eb('0x47')][_0x42eb('0x2b')]);return db[_0x42eb('0x4b')][_0x42eb('0x45')](_0x1abab5[_0x42eb('0x47')],{'include':[{'model':db[_0x42eb('0x51')],'as':_0x42eb('0x52')},{'model':db[_0x42eb('0x51')],'as':'Descriptions'}]});}return null;})[_0x42eb('0x25')](respondWithResult(_0x392de3,null))[_0x42eb('0x44')](handleError(_0x392de3,null));};exports[_0x42eb('0x53')]=function(_0x8cf9af,_0x572293,_0x2c5083){var _0x466026=['made_sla',_0x42eb('0x54'),_0x42eb('0x55'),'subcategory','close_code',_0x42eb('0x56'),_0x42eb('0x57'),_0x42eb('0x58'),_0x42eb('0x59')];var _0x521e6a=[_0x42eb('0x5a'),_0x42eb('0x5b'),_0x42eb('0x5c'),'watch_list',_0x42eb('0x5d'),'sys_updated_on','child_incidents',_0x42eb('0x54'),_0x42eb('0x5e'),_0x42eb('0x5f'),_0x42eb('0x60'),'sys_updated_by',_0x42eb('0x61'),_0x42eb('0x62'),_0x42eb('0x63'),_0x42eb('0x64'),'state',_0x42eb('0x65'),_0x42eb('0x55'),_0x42eb('0x35'),_0x42eb('0x66'),_0x42eb('0x67'),_0x42eb('0x68'),_0x42eb('0x69'),'impact',_0x42eb('0x6a'),_0x42eb('0x6b'),_0x42eb('0x6c'),_0x42eb('0x6d'),_0x42eb('0x6e'),_0x42eb('0x6f'),'time_worked','expected_start',_0x42eb('0x70'),'business_duration',_0x42eb('0x71'),_0x42eb('0x72'),_0x42eb('0x73'),_0x42eb('0x74'),'caller_id','approval_set',_0x42eb('0x75'),_0x42eb('0x76'),'short_description',_0x42eb('0x77'),_0x42eb('0x78'),_0x42eb('0x79'),'work_start','assignment_group','business_stc',_0x42eb('0x7a'),_0x42eb('0x7b'),_0x42eb('0x7c'),_0x42eb('0x56'),_0x42eb('0x7d'),_0x42eb('0x7e'),_0x42eb('0x7f'),_0x42eb('0x80'),_0x42eb('0x81'),_0x42eb('0x82'),_0x42eb('0x83'),_0x42eb('0x84'),'incident_state',_0x42eb('0x85'),'problem_id','company',_0x42eb('0x86'),_0x42eb('0x87'),_0x42eb('0x88'),_0x42eb('0x58'),'comments',_0x42eb('0x89'),_0x42eb('0x8a'),_0x42eb('0x8b'),'due_date','sys_mod_count',_0x42eb('0x8c'),_0x42eb('0x8d'),'escalation','upon_approval',_0x42eb('0x8e'),_0x42eb('0x8f'),_0x42eb('0x59')];var _0x360d30='';var _0x339539='';var _0x523fb7=[];var _0x2d7245='';var _0x46ef73='';var _0x34be1a=[];var _0x256564='';var _0xf7253c='';var _0x310a55={};var _0x303728='';return db[_0x42eb('0x29')][_0x42eb('0x4a')]({'where':{'id':_0x8cf9af[_0x42eb('0x41')]['id']},'attributes':['id',_0x42eb('0x90'),_0x42eb('0x91'),_0x42eb('0x92'),'remoteUri',_0x42eb('0x93')]})[_0x42eb('0x25')](handleEntityNotFound(_0x572293,null))[_0x42eb('0x25')](function(_0x30c20c){if(_0x30c20c){_0x303728=_0x30c20c[_0x42eb('0x94')];var _0x4c06d6=_0x303728['slice'](-0x1);if(_0x4c06d6==='/'){_0x303728=_0x303728[_0x42eb('0x95')](0x0,_0x303728[_0x42eb('0x96')](_0x4c06d6));}_0xf7253c=util[_0x42eb('0x97')](_0x42eb('0x98'),_0x303728);_0x256564=util[_0x42eb('0x97')]('%s/api/now/table/',_0x303728);_0x310a55={'user':_0x30c20c[_0x42eb('0x90')],'pass':_0x30c20c[_0x42eb('0x91')]};var _0x371060={'method':_0x42eb('0x99'),'uri':_0xf7253c+_0x42eb('0x9a'),'auth':_0x310a55,'json':!![]};return rp(_0x371060);}})[_0x42eb('0x25')](function(_0x23b39e){if(_0x23b39e[_0x42eb('0x9b')][_0x42eb('0x32')]>0x0){_0x360d30=_0x23b39e[_0x42eb('0x9b')];}console[_0x42eb('0x9c')](_0x42eb('0x9d'),_0x360d30);_0x34be1a=[];_0x339539=Object[_0x42eb('0x9e')]([],_0x360d30);_[_0x42eb('0x9f')](_0x339539,function(_0x510ec6){return!_0x466026[_0x42eb('0xa0')](_0x510ec6[_0x42eb('0x27')]);});_0x339539[_0x42eb('0xa1')](function(_0x42a15e){var _0x197436=createFieldObject(_0x256564,_0x310a55,_0x42a15e[_0x42eb('0xa2')],_0x42a15e[_0x42eb('0x27')],_0x42a15e['label'],![]);_0x34be1a[_0x42eb('0xa3')](_0x197436);});return Promise[_0x42eb('0xa4')](_0x34be1a);})[_0x42eb('0x25')](function(_0x4b075a){_0x523fb7=_0x4b075a;_0x2d7245=Object['assign']([],_0x360d30);console[_0x42eb('0x9c')](_0x42eb('0xa5'),_0x360d30);_[_0x42eb('0x9f')](_0x2d7245,function(_0x57e6d7){return _0x521e6a[_0x42eb('0xa0')](_0x57e6d7['name']);});console['log'](_0x42eb('0xa6'),_0x2d7245);_0x34be1a=[];_0x2d7245[_0x42eb('0xa1')](function(_0x50f4b3){var _0x1bd97d=createFieldObject(_0x256564,_0x310a55,_0x50f4b3[_0x42eb('0xa2')],_0x50f4b3[_0x42eb('0x27')],_0x50f4b3[_0x42eb('0xa7')],!![]);_0x34be1a[_0x42eb('0xa3')](_0x1bd97d);});return Promise[_0x42eb('0xa4')](_0x34be1a);})['then'](function(_0x3a60c6){_0x46ef73=_0x3a60c6;var _0x2bf558=_0x523fb7[_0x42eb('0xa8')](_0x46ef73);return{'count':_0x2bf558[_0x42eb('0x32')],'rows':_0x2bf558};})[_0x42eb('0x25')](respondWithResult(_0x572293,null))[_0x42eb('0x44')](function(_0x5011e6){console['log']('ServiceNow\x20error:\x20'+_0x5011e6);var _0x2cab75=_0x8cf9af[_0x42eb('0x2d')][_0x42eb('0xa9')]?0x1f4:_0x5011e6['statusCode']||0x1f4;logger[_0x42eb('0xaa')](_0x5011e6[_0x42eb('0x26')]);delete _0x5011e6[_0x42eb('0x27')];if(_0x2cab75===0x191){_0x2cab75=0x190;}_0x572293['status'](_0x2cab75)[_0x42eb('0xab')](_0x8cf9af['query'][_0x42eb('0xa9')]?{'message':'Wrong\x20credentials','statusCode':_0x5011e6[_0x42eb('0xac')]}:_0x5011e6);});};function createFieldObject(_0x4a28b1,_0x43ab6a,_0x5a7674,_0x4f5939,_0x19042f,_0x2852c2){return new Promise(function(_0x419e7b,_0x351460){var _0x4ca070={'id':_0x4f5939,'name':_0x19042f,'custom':_0x2852c2};if(_0x5a7674===_0x42eb('0xad')){_0x4ca070[_0x42eb('0x43')]=[{'name':_0x42eb('0xae'),'value':_0x42eb('0xaf')},{'name':_0x42eb('0xb0'),'value':_0x42eb('0xb1')}];_0x419e7b(_0x4ca070);}else{var _0x481505={'method':'GET','uri':_0x4a28b1+_0x42eb('0xb2')+_0x4f5939,'auth':_0x43ab6a,'json':!![]};return rp(_0x481505)[_0x42eb('0x25')](function(_0x441d5a){var _0x126a95=[];if(_0x441d5a[_0x42eb('0x9b')][_0x42eb('0x32')]>0x0){_0x441d5a['result'][_0x42eb('0xa1')](function(_0x130231){if(_0x130231['inactive']==='false'){var _0x3576b7={'name':_0x130231['label'],'value':_0x130231['value']};_0x126a95['push'](_0x3576b7);}});}_0x4ca070['options']=_0x126a95;if(_0x4ca070[_0x42eb('0x43')]['length']>0x0){_0x419e7b(_0x4ca070);}else{if(_0x2852c2==![]){_0x419e7b();}else{_0x419e7b(_0x4ca070);}}});}});} \ No newline at end of file +var _0x9182=['../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','error','stack','name','send','rawAttributes','fieldName','key','model','map','keys','query','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','filter','merge','type','options','includeAll','findAll','catch','params','length','find','create','body','getConfigurations','ServicenowAccount','findOne','ServicenowConfiguration','hasOwnProperty','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','ServicenowField','getFields','hold_reason','subcategory','notify','incident_state','severity','category','parent','caused_by','watch_list','upon_reject','number','resolved_by','sys_updated_by','opened_by','sys_created_on','sys_domain','state','sys_created_by','knowledge','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','time_worked','expected_start','opened_at','business_duration','reopened_time','resolved_at','approval_set','short_description','close_code','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','closed_by','parent_incident','sys_id','contact_type','reopened_by','problem_id','company','reassignment_count','assigned_to','sla_due','due_date','reopen_count','sys_tags','escalation','correlation_id','location','username','password','email','remoteUri','serverUrl','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','result','log','incident\x20table\x20objects','includes','forEach','label','push','all','assign','TCL:\x20_object','remove','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','internalType','test','statusCode','boolean','True','true','false','GET','sys_choice?sysparm_query=name=incident^element=','inactive','value','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x3e89b6,_0x224dbb){var _0x2ad8f6=function(_0x107e71){while(--_0x107e71){_0x3e89b6['push'](_0x3e89b6['shift']());}};_0x2ad8f6(++_0x224dbb);}(_0x9182,0x1f3));var _0x2918=function(_0x1636a9,_0x5bba5b){_0x1636a9=_0x1636a9-0x0;var _0x53e9f9=_0x9182[_0x1636a9];return _0x53e9f9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2918('0x0'));var rp=require(_0x2918('0x1'));var moment=require(_0x2918('0x2'));var BPromise=require(_0x2918('0x3'));var Mustache=require(_0x2918('0x4'));var util=require(_0x2918('0x5'));var path=require(_0x2918('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2918('0x7'));var _=require(_0x2918('0x8'));var squel=require(_0x2918('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2918('0xa'));var toCsv=require(_0x2918('0xb'));var querystring=require(_0x2918('0xc'));var Papa=require(_0x2918('0xd'));var Redis=require(_0x2918('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2918('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2918('0x10'));var utils=require(_0x2918('0x11'));var config=require(_0x2918('0x12'));var licenseUtil=require(_0x2918('0x13'));var db=require(_0x2918('0x14'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x166e33,_0x2002ff){_0x2002ff=_0x2002ff||0xcc;return function(_0x284f87){if(_0x284f87){return _0x166e33[_0x2918('0x15')](_0x2002ff);}return _0x166e33[_0x2918('0x16')](_0x2002ff)[_0x2918('0x17')]();};}function respondWithResult(_0x29ae44,_0x396cc2){_0x396cc2=_0x396cc2||0xc8;return function(_0xabeaa8){if(_0xabeaa8){return _0x29ae44['status'](_0x396cc2)[_0x2918('0x18')](_0xabeaa8);}};}function respondWithFilteredResult(_0x329f16,_0x130d34){return function(_0x439542){if(_0x439542){var _0x34a4fd=typeof _0x130d34[_0x2918('0x19')]===_0x2918('0x1a')&&typeof _0x130d34[_0x2918('0x1b')]===_0x2918('0x1a');var _0x3ce53b=_0x439542[_0x2918('0x1c')];var _0x17c05f=_0x34a4fd?0x0:_0x130d34['offset'];var _0x30cdff=_0x34a4fd?_0x439542[_0x2918('0x1c')]:_0x130d34[_0x2918('0x19')]+_0x130d34[_0x2918('0x1b')];var _0x480af2;if(_0x30cdff>=_0x3ce53b){_0x30cdff=_0x3ce53b;_0x480af2=0xc8;}else{_0x480af2=0xce;}_0x329f16[_0x2918('0x16')](_0x480af2);return _0x329f16[_0x2918('0x1d')](_0x2918('0x1e'),_0x17c05f+'-'+_0x30cdff+'/'+_0x3ce53b)[_0x2918('0x18')](_0x439542);}return null;};}function patchUpdates(_0x51d996){return function(_0x38bf35){try{jsonpatch[_0x2918('0x1f')](_0x38bf35,_0x51d996,!![]);}catch(_0x539eff){return BPromise['reject'](_0x539eff);}return _0x38bf35['save']();};}function saveUpdates(_0x5236e6,_0x59aca0){return function(_0x5d41f8){if(_0x5d41f8){return _0x5d41f8[_0x2918('0x20')](_0x5236e6)[_0x2918('0x21')](function(_0x3f8c24){return _0x3f8c24;});}return null;};}function removeEntity(_0x38f204,_0x456e1d){return function(_0x41f183){if(_0x41f183){return _0x41f183[_0x2918('0x22')]()['then'](function(){_0x38f204[_0x2918('0x16')](0xcc)[_0x2918('0x17')]();});}};}function handleEntityNotFound(_0x19c55b,_0x578f23){return function(_0x5e5621){if(!_0x5e5621){_0x19c55b[_0x2918('0x15')](0x194);}return _0x5e5621;};}function handleError(_0x478ef2,_0x1cad65){_0x1cad65=_0x1cad65||0x1f4;return function(_0x5c8f31){logger[_0x2918('0x23')](_0x5c8f31[_0x2918('0x24')]);if(_0x5c8f31['name']){delete _0x5c8f31[_0x2918('0x25')];}_0x478ef2['status'](_0x1cad65)[_0x2918('0x26')](_0x5c8f31);};}exports['index']=function(_0x2fe3cb,_0x47de05){var _0x22e6d8={},_0x47335a={},_0x43ead5={'count':0x0,'rows':[]};var _0x4e77fc=_['map'](db['ServicenowAccount'][_0x2918('0x27')],function(_0x228e6c){return{'name':_0x228e6c[_0x2918('0x28')],'type':_0x228e6c['type'][_0x2918('0x29')]};});_0x47335a[_0x2918('0x2a')]=_[_0x2918('0x2b')](_0x4e77fc,'name');_0x47335a['query']=_[_0x2918('0x2c')](_0x2fe3cb[_0x2918('0x2d')]);_0x47335a['filters']=_[_0x2918('0x2e')](_0x47335a['model'],_0x47335a[_0x2918('0x2d')]);_0x22e6d8[_0x2918('0x2f')]=_[_0x2918('0x2e')](_0x47335a['model'],qs[_0x2918('0x30')](_0x2fe3cb[_0x2918('0x2d')]['fields']));_0x22e6d8['attributes']=_0x22e6d8[_0x2918('0x2f')]['length']?_0x22e6d8[_0x2918('0x2f')]:_0x47335a[_0x2918('0x2a')];if(!_0x2fe3cb['query']['hasOwnProperty'](_0x2918('0x31'))){_0x22e6d8['limit']=qs[_0x2918('0x1b')](_0x2fe3cb[_0x2918('0x2d')]['limit']);_0x22e6d8[_0x2918('0x19')]=qs[_0x2918('0x19')](_0x2fe3cb[_0x2918('0x2d')][_0x2918('0x19')]);}_0x22e6d8[_0x2918('0x32')]=qs[_0x2918('0x33')](_0x2fe3cb[_0x2918('0x2d')]['sort']);_0x22e6d8[_0x2918('0x34')]=qs[_0x2918('0x35')](_[_0x2918('0x36')](_0x2fe3cb[_0x2918('0x2d')],_0x47335a[_0x2918('0x35')]),_0x4e77fc);if(_0x2fe3cb[_0x2918('0x2d')][_0x2918('0x37')]){_0x22e6d8['where']=_[_0x2918('0x38')](_0x22e6d8[_0x2918('0x34')],{'$or':_['map'](_0x4e77fc,function(_0x278e64){if(_0x278e64[_0x2918('0x39')]!=='VIRTUAL'){var _0x346780={};_0x346780[_0x278e64[_0x2918('0x25')]]={'$like':'%'+_0x2fe3cb[_0x2918('0x2d')][_0x2918('0x37')]+'%'};return _0x346780;}})});}_0x22e6d8=_[_0x2918('0x38')]({},_0x22e6d8,_0x2fe3cb[_0x2918('0x3a')]);var _0x5b241f={'where':_0x22e6d8['where']};return db['ServicenowAccount'][_0x2918('0x1c')](_0x5b241f)[_0x2918('0x21')](function(_0x1afb98){_0x43ead5['count']=_0x1afb98;if(_0x2fe3cb['query'][_0x2918('0x3b')]){_0x22e6d8['include']=[{'all':!![]}];}return db['ServicenowAccount'][_0x2918('0x3c')](_0x22e6d8);})['then'](function(_0x2e97de){_0x43ead5['rows']=_0x2e97de;return _0x43ead5;})[_0x2918('0x21')](respondWithFilteredResult(_0x47de05,_0x22e6d8))[_0x2918('0x3d')](handleError(_0x47de05,null));};exports['show']=function(_0x3949c9,_0x1eb83c){var _0x2ab2d1={'raw':![],'where':{'id':_0x3949c9[_0x2918('0x3e')]['id']}},_0x2b84e1={};_0x2b84e1[_0x2918('0x2a')]=_[_0x2918('0x2c')](db['ServicenowAccount'][_0x2918('0x27')]);_0x2b84e1[_0x2918('0x2d')]=_[_0x2918('0x2c')](_0x3949c9[_0x2918('0x2d')]);_0x2b84e1['filters']=_[_0x2918('0x2e')](_0x2b84e1[_0x2918('0x2a')],_0x2b84e1[_0x2918('0x2d')]);_0x2ab2d1[_0x2918('0x2f')]=_['intersection'](_0x2b84e1['model'],qs[_0x2918('0x30')](_0x3949c9[_0x2918('0x2d')][_0x2918('0x30')]));_0x2ab2d1[_0x2918('0x2f')]=_0x2ab2d1[_0x2918('0x2f')][_0x2918('0x3f')]?_0x2ab2d1[_0x2918('0x2f')]:_0x2b84e1[_0x2918('0x2a')];if(_0x3949c9['query'][_0x2918('0x3b')]){_0x2ab2d1['include']=[{'all':!![]}];}_0x2ab2d1=_[_0x2918('0x38')]({},_0x2ab2d1,_0x3949c9['options']);return db['ServicenowAccount'][_0x2918('0x40')](_0x2ab2d1)['then'](handleEntityNotFound(_0x1eb83c,null))[_0x2918('0x21')](respondWithResult(_0x1eb83c,null))['catch'](handleError(_0x1eb83c,null));};exports[_0x2918('0x41')]=function(_0x2fa032,_0x2591de){return db['ServicenowAccount'][_0x2918('0x41')](_0x2fa032[_0x2918('0x42')],{})[_0x2918('0x21')](respondWithResult(_0x2591de,0xc9))[_0x2918('0x3d')](handleError(_0x2591de,null));};exports[_0x2918('0x20')]=function(_0x3c7177,_0x391ed1){if(_0x3c7177[_0x2918('0x42')]['id']){delete _0x3c7177[_0x2918('0x42')]['id'];}return db['ServicenowAccount'][_0x2918('0x40')]({'where':{'id':_0x3c7177[_0x2918('0x3e')]['id']}})[_0x2918('0x21')](handleEntityNotFound(_0x391ed1,null))[_0x2918('0x21')](saveUpdates(_0x3c7177[_0x2918('0x42')],null))[_0x2918('0x21')](respondWithResult(_0x391ed1,null))[_0x2918('0x3d')](handleError(_0x391ed1,null));};exports[_0x2918('0x22')]=function(_0x3e3bb6,_0x4e3845){return db['ServicenowAccount'][_0x2918('0x40')]({'where':{'id':_0x3e3bb6['params']['id']}})[_0x2918('0x21')](handleEntityNotFound(_0x4e3845,null))[_0x2918('0x21')](removeEntity(_0x4e3845,null))[_0x2918('0x3d')](handleError(_0x4e3845,null));};exports[_0x2918('0x43')]=function(_0x14039e,_0x44cdda,_0x57bef5){var _0x4d0785={};var _0x285132={};var _0x2d13ef;var _0x519cae;return db[_0x2918('0x44')][_0x2918('0x45')]({'where':{'id':_0x14039e['params']['id']}})[_0x2918('0x21')](handleEntityNotFound(_0x44cdda,null))['then'](function(_0x544df1){if(_0x544df1){_0x2d13ef=_0x544df1;_0x285132[_0x2918('0x2a')]=_[_0x2918('0x2c')](db[_0x2918('0x46')][_0x2918('0x27')]);_0x285132['query']=_[_0x2918('0x2c')](_0x14039e[_0x2918('0x2d')]);_0x285132[_0x2918('0x35')]=_['intersection'](_0x285132[_0x2918('0x2a')],_0x285132['query']);_0x4d0785['attributes']=_[_0x2918('0x2e')](_0x285132[_0x2918('0x2a')],qs[_0x2918('0x30')](_0x14039e[_0x2918('0x2d')]['fields']));_0x4d0785[_0x2918('0x2f')]=_0x4d0785['attributes'][_0x2918('0x3f')]?_0x4d0785[_0x2918('0x2f')]:_0x285132[_0x2918('0x2a')];_0x4d0785[_0x2918('0x32')]=qs[_0x2918('0x33')](_0x14039e[_0x2918('0x2d')][_0x2918('0x33')]);_0x4d0785[_0x2918('0x34')]=qs[_0x2918('0x35')](_[_0x2918('0x36')](_0x14039e[_0x2918('0x2d')],_0x285132[_0x2918('0x35')]));if(_0x14039e['query'][_0x2918('0x37')]){_0x4d0785[_0x2918('0x34')]=_[_0x2918('0x38')](_0x4d0785[_0x2918('0x34')],{'$or':_['map'](_0x4d0785[_0x2918('0x2f')],function(_0x3015e0){var _0x1e6357={};_0x1e6357[_0x3015e0]={'$like':'%'+_0x14039e[_0x2918('0x2d')]['filter']+'%'};return _0x1e6357;})});}_0x4d0785=_['merge']({},_0x4d0785,_0x14039e[_0x2918('0x3a')]);return _0x2d13ef[_0x2918('0x43')](_0x4d0785);}})[_0x2918('0x21')](function(_0x2446d3){if(_0x2446d3){_0x519cae=_0x2446d3['length'];if(!_0x14039e[_0x2918('0x2d')][_0x2918('0x47')](_0x2918('0x31'))){_0x4d0785[_0x2918('0x1b')]=qs[_0x2918('0x1b')](_0x14039e[_0x2918('0x2d')][_0x2918('0x1b')]);_0x4d0785[_0x2918('0x19')]=qs[_0x2918('0x19')](_0x14039e[_0x2918('0x2d')][_0x2918('0x19')]);}return _0x2d13ef['getConfigurations'](_0x4d0785);}})[_0x2918('0x21')](function(_0x22736e){if(_0x22736e){return _0x22736e?{'count':_0x519cae,'rows':_0x22736e}:null;}})[_0x2918('0x21')](respondWithResult(_0x44cdda,null))[_0x2918('0x3d')](handleError(_0x44cdda,null));};exports['addConfiguration']=function(_0x2643d0,_0xcad5e6,_0x14a7cc){if(_0x2643d0[_0x2918('0x42')]['id']){delete _0x2643d0[_0x2918('0x42')]['id'];}return db['ServicenowAccount']['findOne']({'where':{'id':_0x2643d0['params']['id']}})[_0x2918('0x21')](handleEntityNotFound(_0xcad5e6,null))['then'](function(_0x4817c7){if(_0x4817c7){_0x2643d0[_0x2918('0x42')][_0x2918('0x48')]=_0x4817c7['id'];_0x2643d0[_0x2918('0x42')][_0x2918('0x49')]=integrations[_0x2918('0x4a')](_0x2643d0[_0x2918('0x42')]['channel'],_0x2643d0['body']['type']);_0x2643d0['body'][_0x2918('0x4b')]=integrations[_0x2918('0x4c')](_0x2643d0[_0x2918('0x42')][_0x2918('0x4d')],_0x2643d0[_0x2918('0x42')][_0x2918('0x39')]);return db[_0x2918('0x46')][_0x2918('0x41')](_0x2643d0[_0x2918('0x42')],{'include':[{'model':db[_0x2918('0x4e')],'as':_0x2918('0x49')},{'model':db[_0x2918('0x4e')],'as':_0x2918('0x4b')}]});}return null;})[_0x2918('0x21')](respondWithResult(_0xcad5e6,null))[_0x2918('0x3d')](handleError(_0xcad5e6,null));};exports[_0x2918('0x4f')]=function(_0x223613,_0xcb18bb,_0x2bd6cf){var _0x4cddf5=['made_sla',_0x2918('0x50'),'knowledge',_0x2918('0x51'),'close_code',_0x2918('0x52'),_0x2918('0x53'),_0x2918('0x54'),_0x2918('0x55')];var _0x228d2a=[_0x2918('0x56'),'made_sla',_0x2918('0x57'),_0x2918('0x58'),_0x2918('0x59'),'sys_updated_on','child_incidents',_0x2918('0x50'),'approval_history',_0x2918('0x5a'),_0x2918('0x5b'),_0x2918('0x5c'),_0x2918('0x5d'),'user_input',_0x2918('0x5e'),_0x2918('0x5f'),_0x2918('0x60'),_0x2918('0x61'),_0x2918('0x62'),_0x2918('0x32'),_0x2918('0x63'),_0x2918('0x64'),_0x2918('0x65'),_0x2918('0x66'),_0x2918('0x67'),_0x2918('0x68'),'work_notes_list','business_service','priority','sys_domain_path','rfc',_0x2918('0x69'),_0x2918('0x6a'),_0x2918('0x6b'),_0x2918('0x6c'),'group_list','work_end',_0x2918('0x6d'),_0x2918('0x6e'),'caller_id',_0x2918('0x6f'),_0x2918('0x51'),'work_notes',_0x2918('0x70'),_0x2918('0x71'),_0x2918('0x72'),_0x2918('0x73'),_0x2918('0x74'),_0x2918('0x75'),_0x2918('0x76'),_0x2918('0x77'),_0x2918('0x78'),_0x2918('0x79'),'notify',_0x2918('0x7a'),_0x2918('0x7b'),_0x2918('0x7c'),'follow_up',_0x2918('0x7d'),_0x2918('0x7e'),_0x2918('0x7f'),_0x2918('0x80'),'incident_state','urgency',_0x2918('0x81'),_0x2918('0x82'),_0x2918('0x83'),'activity_due',_0x2918('0x84'),_0x2918('0x54'),'comments',_0x2918('0x85'),'approval','comments_and_work_notes',_0x2918('0x86'),'sys_mod_count',_0x2918('0x87'),_0x2918('0x88'),_0x2918('0x89'),'upon_approval',_0x2918('0x8a'),_0x2918('0x8b'),_0x2918('0x55')];var _0x3a080d='';var _0x1829ce='';var _0x52b3dd=[];var _0x4d14fd='';var _0x279490='';var _0x372fca=[];var _0x186965='';var _0x245009='';var _0x54285b={};var _0x49a60a='';return db[_0x2918('0x44')][_0x2918('0x45')]({'where':{'id':_0x223613[_0x2918('0x3e')]['id']},'attributes':['id',_0x2918('0x8c'),_0x2918('0x8d'),_0x2918('0x8e'),_0x2918('0x8f'),_0x2918('0x90')]})[_0x2918('0x21')](handleEntityNotFound(_0xcb18bb,null))[_0x2918('0x21')](function(_0xe0cc9b){if(_0xe0cc9b){_0x49a60a=_0xe0cc9b['remoteUri'];var _0x5a4cb4=_0x49a60a['slice'](-0x1);if(_0x5a4cb4==='/'){_0x49a60a=_0x49a60a[_0x2918('0x91')](0x0,_0x49a60a[_0x2918('0x92')](_0x5a4cb4));}_0x245009=util[_0x2918('0x93')](_0x2918('0x94'),_0x49a60a);_0x186965=util[_0x2918('0x93')](_0x2918('0x95'),_0x49a60a);_0x54285b={'user':_0xe0cc9b[_0x2918('0x8c')],'pass':_0xe0cc9b[_0x2918('0x8d')]};var _0x160d69={'method':'GET','uri':_0x245009+'incident?sysparm_display_value=all','auth':_0x54285b,'json':!![]};return rp(_0x160d69);}})[_0x2918('0x21')](function(_0x24f270){if(_0x24f270[_0x2918('0x96')]['length']>0x0){_0x3a080d=_0x24f270[_0x2918('0x96')];}console[_0x2918('0x97')](_0x2918('0x98'),_0x3a080d);_0x372fca=[];_0x1829ce=Object['assign']([],_0x3a080d);_['remove'](_0x1829ce,function(_0x23e8b8){return!_0x4cddf5[_0x2918('0x99')](_0x23e8b8['name']);});_0x1829ce[_0x2918('0x9a')](function(_0x769510){var _0x3ad03c=createFieldObject(_0x186965,_0x54285b,_0x769510['internalType'],_0x769510['name'],_0x769510[_0x2918('0x9b')],![]);_0x372fca[_0x2918('0x9c')](_0x3ad03c);});return Promise[_0x2918('0x9d')](_0x372fca);})[_0x2918('0x21')](function(_0x27657b){_0x52b3dd=_0x27657b;_0x4d14fd=Object[_0x2918('0x9e')]([],_0x3a080d);console[_0x2918('0x97')](_0x2918('0x9f'),_0x3a080d);_[_0x2918('0xa0')](_0x4d14fd,function(_0xe8dcb8){return _0x228d2a[_0x2918('0x99')](_0xe8dcb8[_0x2918('0x25')]);});console[_0x2918('0x97')](_0x2918('0xa1'),_0x4d14fd);_0x372fca=[];_0x4d14fd[_0x2918('0x9a')](function(_0x45b902){var _0x39a67d=createFieldObject(_0x186965,_0x54285b,_0x45b902[_0x2918('0xa2')],_0x45b902[_0x2918('0x25')],_0x45b902['label'],!![]);_0x372fca[_0x2918('0x9c')](_0x39a67d);});return Promise[_0x2918('0x9d')](_0x372fca);})[_0x2918('0x21')](function(_0x7578bd){_0x279490=_0x7578bd;var _0x61c2b8=_0x52b3dd['concat'](_0x279490);return{'count':_0x61c2b8[_0x2918('0x3f')],'rows':_0x61c2b8};})[_0x2918('0x21')](respondWithResult(_0xcb18bb,null))[_0x2918('0x3d')](function(_0x5c7ebe){console[_0x2918('0x97')]('ServiceNow\x20error:\x20'+_0x5c7ebe);var _0x5af636=_0x223613[_0x2918('0x2d')][_0x2918('0xa3')]?0x1f4:_0x5c7ebe[_0x2918('0xa4')]||0x1f4;logger['error'](_0x5c7ebe['stack']);delete _0x5c7ebe[_0x2918('0x25')];if(_0x5af636===0x191){_0x5af636=0x190;}_0xcb18bb[_0x2918('0x16')](_0x5af636)[_0x2918('0x26')](_0x223613[_0x2918('0x2d')][_0x2918('0xa3')]?{'message':'Wrong\x20credentials','statusCode':_0x5c7ebe[_0x2918('0xa4')]}:_0x5c7ebe);});};function createFieldObject(_0x5233a8,_0x3c71bf,_0x3ac038,_0x302d4d,_0x5e0096,_0x3caf84){return new Promise(function(_0x60aeda,_0x4aeb8e){var _0x557849={'id':_0x302d4d,'name':_0x5e0096,'custom':_0x3caf84};if(_0x3ac038===_0x2918('0xa5')){_0x557849[_0x2918('0x3a')]=[{'name':_0x2918('0xa6'),'value':_0x2918('0xa7')},{'name':'False','value':_0x2918('0xa8')}];_0x60aeda(_0x557849);}else{var _0x4f86d0={'method':_0x2918('0xa9'),'uri':_0x5233a8+_0x2918('0xaa')+_0x302d4d,'auth':_0x3c71bf,'json':!![]};return rp(_0x4f86d0)[_0x2918('0x21')](function(_0x3a45e7){var _0x522aee=[];if(_0x3a45e7['result'][_0x2918('0x3f')]>0x0){_0x3a45e7[_0x2918('0x96')]['forEach'](function(_0xb0071f){if(_0xb0071f[_0x2918('0xab')]===_0x2918('0xa8')){var _0x27ce38={'name':_0xb0071f[_0x2918('0x9b')],'value':_0xb0071f[_0x2918('0xac')]};_0x522aee[_0x2918('0x9c')](_0x27ce38);}});}_0x557849['options']=_0x522aee;if(_0x557849[_0x2918('0x3a')][_0x2918('0x3f')]>0x0){_0x60aeda(_0x557849);}else{if(_0x3caf84==![]){_0x60aeda();}else{_0x60aeda(_0x557849);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 629a0f9..8e55ff1 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 _0x7dfd=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount'];(function(_0x27de44,_0x27864c){var _0x23d632=function(_0x171997){while(--_0x171997){_0x27de44['push'](_0x27de44['shift']());}};_0x23d632(++_0x27864c);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd7df('0x0'));var util=require(_0xd7df('0x1'));var logger=require(_0xd7df('0x2'))(_0xd7df('0x3'));var moment=require(_0xd7df('0x4'));var BPromise=require(_0xd7df('0x5'));var rp=require(_0xd7df('0x6'));var fs=require('fs');var path=require(_0xd7df('0x7'));var rimraf=require(_0xd7df('0x8'));var config=require(_0xd7df('0x9'));var attributes=require(_0xd7df('0xa'));var integrations=require(_0xd7df('0xb'));module[_0xd7df('0xc')]=function(_0x39ce98,_0x354ea7){return _0x39ce98[_0xd7df('0xd')](_0xd7df('0xe'),attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5d17=['lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','define','ServicenowAccount','int_servicenow_accounts'];(function(_0x3fcf5d,_0x24a42c){var _0x45f703=function(_0x216484){while(--_0x216484){_0x3fcf5d['push'](_0x3fcf5d['shift']());}};_0x45f703(++_0x24a42c);}(_0x5d17,0x114));var _0x75d1=function(_0x235f95,_0x2bf647){_0x235f95=_0x235f95-0x0;var _0x2348cb=_0x5d17[_0x235f95];return _0x2348cb;};'use strict';var _=require(_0x75d1('0x0'));var util=require(_0x75d1('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x75d1('0x2'));var BPromise=require(_0x75d1('0x3'));var rp=require(_0x75d1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x75d1('0x5'));var config=require(_0x75d1('0x6'));var attributes=require(_0x75d1('0x7'));var integrations=require(_0x75d1('0x8'));module['exports']=function(_0x458681,_0x116a51){return _0x458681[_0x75d1('0x9')](_0x75d1('0xa'),attributes,{'tableName':_0x75d1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index 42120e1..18de950 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 _0xa7cd=['attributes','then','ShowServicenowAccount','find','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','where','limit','map','include','model'];(function(_0x368fb9,_0x1a9895){var _0x4892fb=function(_0x28d735){while(--_0x28d735){_0x368fb9['push'](_0x368fb9['shift']());}};_0x4892fb(++_0x1a9895);}(_0xa7cd,0x12c));var _0xda7c=function(_0x33d270,_0x212bcf){_0x33d270=_0x33d270-0x0;var _0xee3770=_0xa7cd[_0x33d270];return _0xee3770;};'use strict';var _=require(_0xda7c('0x0'));var util=require(_0xda7c('0x1'));var moment=require(_0xda7c('0x2'));var BPromise=require(_0xda7c('0x3'));var rs=require(_0xda7c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xda7c('0x5'));var logger=require(_0xda7c('0x6'))(_0xda7c('0x7'));var config=require(_0xda7c('0x8'));var jayson=require(_0xda7c('0x9'));var client=jayson[_0xda7c('0xa')][_0xda7c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x318b39,_0x8d3b35,_0x547590){return new BPromise(function(_0x407f24,_0x326d6a){return client[_0xda7c('0xc')](_0x318b39,_0x547590)['then'](function(_0x3417bd){logger[_0xda7c('0xd')](_0xda7c('0xe'),_0x8d3b35,_0xda7c('0xf'));logger[_0xda7c('0x10')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x8d3b35,_0xda7c('0xf'),JSON[_0xda7c('0x11')](_0x3417bd));if(_0x3417bd[_0xda7c('0x12')]){if(_0x3417bd[_0xda7c('0x12')][_0xda7c('0x13')]===0x1f4){logger[_0xda7c('0x12')]('ServicenowAccount,\x20%s,\x20%s',_0x8d3b35,_0x3417bd['error'][_0xda7c('0x14')]);return _0x326d6a(_0x3417bd['error'][_0xda7c('0x14')]);}logger[_0xda7c('0x12')](_0xda7c('0xe'),_0x8d3b35,_0x3417bd[_0xda7c('0x12')][_0xda7c('0x14')]);return _0x407f24(_0x3417bd[_0xda7c('0x12')][_0xda7c('0x14')]);}else{logger[_0xda7c('0xd')]('ServicenowAccount,\x20%s,\x20%s',_0x8d3b35,_0xda7c('0xf'));_0x407f24(_0x3417bd[_0xda7c('0x15')][_0xda7c('0x14')]);}})[_0xda7c('0x16')](function(_0x5b54b7){logger['error'](_0xda7c('0xe'),_0x8d3b35,_0x5b54b7);_0x326d6a(_0x5b54b7);});});}exports[_0xda7c('0x17')]=function(_0x56aa75){var _0x1739fb=this;return new Promise(function(_0x4a01be,_0x53a6f1){return db[_0xda7c('0x18')][_0xda7c('0x19')]({'raw':_0x56aa75[_0xda7c('0x1a')]?_0x56aa75[_0xda7c('0x1a')][_0xda7c('0x1b')]===undefined?!![]:![]:!![],'where':_0x56aa75[_0xda7c('0x1a')]?_0x56aa75[_0xda7c('0x1a')][_0xda7c('0x1c')]||null:null,'attributes':_0x56aa75[_0xda7c('0x1a')]?_0x56aa75[_0xda7c('0x1a')]['attributes']||null:null,'limit':_0x56aa75[_0xda7c('0x1a')]?_0x56aa75[_0xda7c('0x1a')][_0xda7c('0x1d')]||null:null,'include':_0x56aa75[_0xda7c('0x1a')]?_0x56aa75[_0xda7c('0x1a')]['include']?_[_0xda7c('0x1e')](_0x56aa75[_0xda7c('0x1a')][_0xda7c('0x1f')],function(_0x560b3a){return{'model':db[_0x560b3a[_0xda7c('0x20')]],'as':_0x560b3a['as'],'attributes':_0x560b3a[_0xda7c('0x21')],'include':_0x560b3a[_0xda7c('0x1f')]?_[_0xda7c('0x1e')](_0x560b3a[_0xda7c('0x1f')],function(_0x27e749){return{'model':db[_0x27e749[_0xda7c('0x20')]],'as':_0x27e749['as'],'attributes':_0x27e749[_0xda7c('0x21')],'include':_0x27e749[_0xda7c('0x1f')]?_[_0xda7c('0x1e')](_0x27e749[_0xda7c('0x1f')],function(_0x4a33ba){return{'model':db[_0x4a33ba[_0xda7c('0x20')]],'as':_0x4a33ba['as'],'attributes':_0x4a33ba[_0xda7c('0x21')]};}):[]};}):[]};}):[]:[]})[_0xda7c('0x22')](function(_0x565a97){logger['info'](_0xda7c('0x17'),_0x56aa75);logger[_0xda7c('0x10')](_0xda7c('0x17'),_0x56aa75,JSON[_0xda7c('0x11')](_0x565a97));_0x4a01be(_0x565a97);})[_0xda7c('0x16')](function(_0x209d95){logger[_0xda7c('0x12')]('GetServicenowAccount',_0x209d95['message'],_0x56aa75);_0x53a6f1(_0x1739fb[_0xda7c('0x12')](0x1f4,_0x209d95[_0xda7c('0x14')]));});});};exports[_0xda7c('0x23')]=function(_0x27c52c){var _0x4c43ce=this;return new Promise(function(_0x16873d,_0x53ac92){return db[_0xda7c('0x18')][_0xda7c('0x24')]({'raw':_0x27c52c[_0xda7c('0x1a')]?_0x27c52c[_0xda7c('0x1a')][_0xda7c('0x1b')]===undefined?!![]:![]:!![],'where':_0x27c52c[_0xda7c('0x1a')]?_0x27c52c[_0xda7c('0x1a')][_0xda7c('0x1c')]||null:null,'attributes':_0x27c52c[_0xda7c('0x1a')]?_0x27c52c[_0xda7c('0x1a')][_0xda7c('0x21')]||null:null,'include':_0x27c52c[_0xda7c('0x1a')]?_0x27c52c[_0xda7c('0x1a')][_0xda7c('0x1f')]?_[_0xda7c('0x1e')](_0x27c52c[_0xda7c('0x1a')]['include'],function(_0xaa3c85){return{'model':db[_0xaa3c85[_0xda7c('0x20')]],'as':_0xaa3c85['as'],'attributes':_0xaa3c85[_0xda7c('0x21')],'include':_0xaa3c85['include']?_['map'](_0xaa3c85[_0xda7c('0x1f')],function(_0x32184c){return{'model':db[_0x32184c[_0xda7c('0x20')]],'as':_0x32184c['as'],'attributes':_0x32184c['attributes'],'include':_0x32184c[_0xda7c('0x1f')]?_[_0xda7c('0x1e')](_0x32184c['include'],function(_0xc8e850){return{'model':db[_0xc8e850[_0xda7c('0x20')]],'as':_0xc8e850['as'],'attributes':_0xc8e850[_0xda7c('0x21')]};}):[]};}):[]};}):[]:[]})[_0xda7c('0x22')](function(_0x2e38f7){logger['info'](_0xda7c('0x23'),_0x27c52c);logger['debug'](_0xda7c('0x23'),_0x27c52c,JSON[_0xda7c('0x11')](_0x2e38f7));_0x16873d(_0x2e38f7);})['catch'](function(_0x22e46c){logger['error'](_0xda7c('0x23'),_0x22e46c[_0xda7c('0x14')],_0x27c52c);_0x53ac92(_0x4c43ce[_0xda7c('0x12')](0x1f4,_0x22e46c[_0xda7c('0x14')]));});});}; \ No newline at end of file +var _0xcbba=['options','attributes','limit','include','map','model','GetServicenowAccount','find','raw','where','ShowServicenowAccount','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ServicenowAccount'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0xcbba,0x18c));var _0xacbb=function(_0x4d17a7,_0x42e8ef){_0x4d17a7=_0x4d17a7-0x0;var _0x953e65=_0xcbba[_0x4d17a7];return _0x953e65;};'use strict';var _=require(_0xacbb('0x0'));var util=require('util');var moment=require(_0xacbb('0x1'));var BPromise=require(_0xacbb('0x2'));var rs=require(_0xacbb('0x3'));var fs=require('fs');var Redis=require(_0xacbb('0x4'));var db=require(_0xacbb('0x5'))['db'];var utils=require(_0xacbb('0x6'));var logger=require('../../config/logger')(_0xacbb('0x7'));var config=require('../../config/environment');var jayson=require(_0xacbb('0x8'));var client=jayson['client'][_0xacbb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x34c6b1,_0x4ac982,_0x2cf399){return new BPromise(function(_0x5b8018,_0x31c6ff){return client[_0xacbb('0xa')](_0x34c6b1,_0x2cf399)[_0xacbb('0xb')](function(_0x33139e){logger[_0xacbb('0xc')](_0xacbb('0xd'),_0x4ac982,_0xacbb('0xe'));logger[_0xacbb('0xf')](_0xacbb('0x10'),_0x4ac982,'request\x20sent',JSON[_0xacbb('0x11')](_0x33139e));if(_0x33139e[_0xacbb('0x12')]){if(_0x33139e[_0xacbb('0x12')][_0xacbb('0x13')]===0x1f4){logger[_0xacbb('0x12')]('ServicenowAccount,\x20%s,\x20%s',_0x4ac982,_0x33139e[_0xacbb('0x12')][_0xacbb('0x14')]);return _0x31c6ff(_0x33139e[_0xacbb('0x12')][_0xacbb('0x14')]);}logger[_0xacbb('0x12')](_0xacbb('0xd'),_0x4ac982,_0x33139e[_0xacbb('0x12')][_0xacbb('0x14')]);return _0x5b8018(_0x33139e['error'][_0xacbb('0x14')]);}else{logger[_0xacbb('0xc')](_0xacbb('0xd'),_0x4ac982,_0xacbb('0xe'));_0x5b8018(_0x33139e[_0xacbb('0x15')][_0xacbb('0x14')]);}})[_0xacbb('0x16')](function(_0x409d7a){logger[_0xacbb('0x12')](_0xacbb('0xd'),_0x4ac982,_0x409d7a);_0x31c6ff(_0x409d7a);});});}exports['GetServicenowAccount']=function(_0xcc7553){var _0x28fec0=this;return new Promise(function(_0x499de7,_0x593e46){return db[_0xacbb('0x17')]['findAll']({'raw':_0xcc7553[_0xacbb('0x18')]?_0xcc7553['options']['raw']===undefined?!![]:![]:!![],'where':_0xcc7553[_0xacbb('0x18')]?_0xcc7553[_0xacbb('0x18')]['where']||null:null,'attributes':_0xcc7553[_0xacbb('0x18')]?_0xcc7553['options'][_0xacbb('0x19')]||null:null,'limit':_0xcc7553[_0xacbb('0x18')]?_0xcc7553[_0xacbb('0x18')][_0xacbb('0x1a')]||null:null,'include':_0xcc7553[_0xacbb('0x18')]?_0xcc7553['options'][_0xacbb('0x1b')]?_[_0xacbb('0x1c')](_0xcc7553[_0xacbb('0x18')]['include'],function(_0x2d41c5){return{'model':db[_0x2d41c5[_0xacbb('0x1d')]],'as':_0x2d41c5['as'],'attributes':_0x2d41c5[_0xacbb('0x19')],'include':_0x2d41c5[_0xacbb('0x1b')]?_['map'](_0x2d41c5[_0xacbb('0x1b')],function(_0x388e2b){return{'model':db[_0x388e2b[_0xacbb('0x1d')]],'as':_0x388e2b['as'],'attributes':_0x388e2b[_0xacbb('0x19')],'include':_0x388e2b[_0xacbb('0x1b')]?_[_0xacbb('0x1c')](_0x388e2b[_0xacbb('0x1b')],function(_0x12c4d4){return{'model':db[_0x12c4d4[_0xacbb('0x1d')]],'as':_0x12c4d4['as'],'attributes':_0x12c4d4[_0xacbb('0x19')]};}):[]};}):[]};}):[]:[]})[_0xacbb('0xb')](function(_0x1c5e97){logger['info'](_0xacbb('0x1e'),_0xcc7553);logger['debug'](_0xacbb('0x1e'),_0xcc7553,JSON[_0xacbb('0x11')](_0x1c5e97));_0x499de7(_0x1c5e97);})[_0xacbb('0x16')](function(_0x422335){logger[_0xacbb('0x12')]('GetServicenowAccount',_0x422335[_0xacbb('0x14')],_0xcc7553);_0x593e46(_0x28fec0[_0xacbb('0x12')](0x1f4,_0x422335[_0xacbb('0x14')]));});});};exports['ShowServicenowAccount']=function(_0x115888){var _0x411abd=this;return new Promise(function(_0x4026d9,_0x4c962f){return db[_0xacbb('0x17')][_0xacbb('0x1f')]({'raw':_0x115888[_0xacbb('0x18')]?_0x115888[_0xacbb('0x18')][_0xacbb('0x20')]===undefined?!![]:![]:!![],'where':_0x115888[_0xacbb('0x18')]?_0x115888[_0xacbb('0x18')][_0xacbb('0x21')]||null:null,'attributes':_0x115888['options']?_0x115888['options'][_0xacbb('0x19')]||null:null,'include':_0x115888['options']?_0x115888[_0xacbb('0x18')][_0xacbb('0x1b')]?_[_0xacbb('0x1c')](_0x115888[_0xacbb('0x18')][_0xacbb('0x1b')],function(_0x2051e1){return{'model':db[_0x2051e1[_0xacbb('0x1d')]],'as':_0x2051e1['as'],'attributes':_0x2051e1[_0xacbb('0x19')],'include':_0x2051e1['include']?_[_0xacbb('0x1c')](_0x2051e1[_0xacbb('0x1b')],function(_0xf6bcb4){return{'model':db[_0xf6bcb4['model']],'as':_0xf6bcb4['as'],'attributes':_0xf6bcb4['attributes'],'include':_0xf6bcb4[_0xacbb('0x1b')]?_['map'](_0xf6bcb4[_0xacbb('0x1b')],function(_0x22b073){return{'model':db[_0x22b073['model']],'as':_0x22b073['as'],'attributes':_0x22b073[_0xacbb('0x19')]};}):[]};}):[]};}):[]:[]})[_0xacbb('0xb')](function(_0x2125bd){logger[_0xacbb('0xc')](_0xacbb('0x22'),_0x115888);logger['debug'](_0xacbb('0x22'),_0x115888,JSON[_0xacbb('0x11')](_0x2125bd));_0x4026d9(_0x2125bd);})[_0xacbb('0x16')](function(_0x420426){logger['error'](_0xacbb('0x22'),_0x420426[_0xacbb('0x14')],_0x115888);_0x4c962f(_0x411abd[_0xacbb('0x12')](0x1f4,_0x420426['message']));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 0caf773..f3c9133 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 _0x922d=['getFields','/:id/subjects','getSubjects','/:id/descriptions','put','delete','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x922d,0x1aa));var _0xd922=function(_0x22f303,_0x1d6034){_0x22f303=_0x22f303-0x0;var _0x295071=_0x922d[_0x22f303];return _0x295071;};'use strict';var multer=require(_0xd922('0x0'));var util=require(_0xd922('0x1'));var path=require(_0xd922('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd922('0x3')]();var fs_extra=require(_0xd922('0x4'));var auth=require(_0xd922('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd922('0x6'));var controller=require(_0xd922('0x7'));router[_0xd922('0x8')]('/',auth[_0xd922('0x9')](),controller[_0xd922('0xa')]);router[_0xd922('0x8')](_0xd922('0xb'),auth['isAuthenticated'](),controller[_0xd922('0xc')]);router[_0xd922('0x8')](_0xd922('0xd'),auth[_0xd922('0x9')](),controller[_0xd922('0xe')]);router[_0xd922('0x8')](_0xd922('0xf'),auth[_0xd922('0x9')](),controller[_0xd922('0x10')]);router[_0xd922('0x8')](_0xd922('0x11'),auth[_0xd922('0x9')](),controller['getDescriptions']);router['post']('/',auth[_0xd922('0x9')](),controller['create']);router[_0xd922('0x12')](_0xd922('0xb'),auth[_0xd922('0x9')](),controller['update']);router[_0xd922('0x13')](_0xd922('0xb'),auth[_0xd922('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xa381=['getSubjects','post','create','put','update','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects'];(function(_0x26d350,_0x28a857){var _0x2f9b67=function(_0x42df12){while(--_0x42df12){_0x26d350['push'](_0x26d350['shift']());}};_0x2f9b67(++_0x28a857);}(_0xa381,0xaf));var _0x1a38=function(_0x1f75a4,_0x220814){_0x1f75a4=_0x1f75a4-0x0;var _0x3e3309=_0xa381[_0x1f75a4];return _0x3e3309;};'use strict';var multer=require('multer');var util=require(_0x1a38('0x0'));var path=require(_0x1a38('0x1'));var timeout=require(_0x1a38('0x2'));var express=require(_0x1a38('0x3'));var router=express['Router']();var fs_extra=require(_0x1a38('0x4'));var auth=require(_0x1a38('0x5'));var interaction=require(_0x1a38('0x6'));var config=require(_0x1a38('0x7'));var controller=require(_0x1a38('0x8'));router[_0x1a38('0x9')]('/',auth[_0x1a38('0xa')](),controller[_0x1a38('0xb')]);router[_0x1a38('0x9')](_0x1a38('0xc'),auth[_0x1a38('0xa')](),controller[_0x1a38('0xd')]);router['get'](_0x1a38('0xe'),auth[_0x1a38('0xa')](),controller[_0x1a38('0xf')]);router[_0x1a38('0x9')](_0x1a38('0x10'),auth['isAuthenticated'](),controller[_0x1a38('0x11')]);router[_0x1a38('0x9')]('/:id/descriptions',auth[_0x1a38('0xa')](),controller['getDescriptions']);router[_0x1a38('0x12')]('/',auth[_0x1a38('0xa')](),controller[_0x1a38('0x13')]);router[_0x1a38('0x14')](_0x1a38('0xc'),auth[_0x1a38('0xa')](),controller[_0x1a38('0x15')]);router['delete']('/:id',auth[_0x1a38('0xa')](),controller[_0x1a38('0x16')]);module[_0x1a38('0x17')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index a62046f..76a68be 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 _0x027a=['exports','STRING','sequelize'];(function(_0x4b4300,_0x12fb10){var _0x2ed7e7=function(_0x23173e){while(--_0x23173e){_0x4b4300['push'](_0x4b4300['shift']());}};_0x2ed7e7(++_0x12fb10);}(_0x027a,0x95));var _0xa027=function(_0x3305fa,_0x2e51c5){_0x3305fa=_0x3305fa-0x0;var _0x28d5e8=_0x027a[_0x3305fa];return _0x28d5e8;};'use strict';var Sequelize=require(_0xa027('0x0'));module[_0xa027('0x1')]={'name':{'type':Sequelize[_0xa027('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2136=['exports','STRING'];(function(_0xc7ce24,_0x3177c6){var _0x162315=function(_0x393cc9){while(--_0x393cc9){_0xc7ce24['push'](_0xc7ce24['shift']());}};_0x162315(++_0x3177c6);}(_0x2136,0x64));var _0x6213=function(_0x248f6b,_0x401324){_0x248f6b=_0x248f6b-0x0;var _0x54b829=_0x2136[_0x248f6b];return _0x54b829;};'use strict';var Sequelize=require('sequelize');module[_0x6213('0x0')]={'name':{'type':Sequelize[_0x6213('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 34afdec..8e3ad27 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 _0x104f=['then','destroy','error','stack','name','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','rows','catch','includeAll','find','create','body','params','getFields','findOne','ServicenowField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','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','status','count','offset','limit','set','Content-Range','json','apply','reject','update'];(function(_0x205979,_0x584335){var _0x238519=function(_0x38b6a7){while(--_0x38b6a7){_0x205979['push'](_0x205979['shift']());}};_0x238519(++_0x584335);}(_0x104f,0x7c));var _0xf104=function(_0x4b966f,_0x16346f){_0x4b966f=_0x4b966f-0x0;var _0x5c5564=_0x104f[_0x4b966f];return _0x5c5564;};'use strict';var emlformat=require(_0xf104('0x0'));var rimraf=require(_0xf104('0x1'));var zipdir=require(_0xf104('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf104('0x3'));var moment=require(_0xf104('0x4'));var BPromise=require(_0xf104('0x5'));var Mustache=require(_0xf104('0x6'));var util=require('util');var path=require(_0xf104('0x7'));var sox=require(_0xf104('0x8'));var csv=require(_0xf104('0x9'));var ejs=require(_0xf104('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf104('0xb'));var squel=require(_0xf104('0xc'));var crypto=require(_0xf104('0xd'));var jsforce=require(_0xf104('0xe'));var deskjs=require(_0xf104('0xf'));var toCsv=require(_0xf104('0x9'));var querystring=require(_0xf104('0x10'));var Papa=require(_0xf104('0x11'));var Redis=require('ioredis');var authService=require(_0xf104('0x12'));var qs=require(_0xf104('0x13'));var as=require(_0xf104('0x14'));var hardwareService=require(_0xf104('0x15'));var logger=require(_0xf104('0x16'))(_0xf104('0x17'));var utils=require(_0xf104('0x18'));var config=require(_0xf104('0x19'));var licenseUtil=require(_0xf104('0x1a'));var db=require(_0xf104('0x1b'))['db'];function respondWithStatusCode(_0x319fb3,_0x19f5a4){_0x19f5a4=_0x19f5a4||0xcc;return function(_0x1657cc){if(_0x1657cc){return _0x319fb3[_0xf104('0x1c')](_0x19f5a4);}return _0x319fb3['status'](_0x19f5a4)[_0xf104('0x1d')]();};}function respondWithResult(_0x105bd9,_0x2e1b8b){_0x2e1b8b=_0x2e1b8b||0xc8;return function(_0xfa0b4a){if(_0xfa0b4a){return _0x105bd9[_0xf104('0x1e')](_0x2e1b8b)['json'](_0xfa0b4a);}};}function respondWithFilteredResult(_0x1bf167,_0x16f20b){return function(_0x23e004){if(_0x23e004){var _0x32d312=typeof _0x16f20b['offset']==='undefined'&&typeof _0x16f20b['limit']==='undefined';var _0x49d6aa=_0x23e004[_0xf104('0x1f')];var _0x303f10=_0x32d312?0x0:_0x16f20b[_0xf104('0x20')];var _0x595999=_0x32d312?_0x23e004['count']:_0x16f20b[_0xf104('0x20')]+_0x16f20b[_0xf104('0x21')];var _0x1f28db;if(_0x595999>=_0x49d6aa){_0x595999=_0x49d6aa;_0x1f28db=0xc8;}else{_0x1f28db=0xce;}_0x1bf167[_0xf104('0x1e')](_0x1f28db);return _0x1bf167[_0xf104('0x22')](_0xf104('0x23'),_0x303f10+'-'+_0x595999+'/'+_0x49d6aa)[_0xf104('0x24')](_0x23e004);}return null;};}function patchUpdates(_0x556b92){return function(_0x4114a8){try{jsonpatch[_0xf104('0x25')](_0x4114a8,_0x556b92,!![]);}catch(_0x47ca63){return BPromise[_0xf104('0x26')](_0x47ca63);}return _0x4114a8['save']();};}function saveUpdates(_0x205298,_0xdcb1c9){return function(_0x277697){if(_0x277697){return _0x277697[_0xf104('0x27')](_0x205298)[_0xf104('0x28')](function(_0x2654b4){return _0x2654b4;});}return null;};}function removeEntity(_0x2b87d3,_0x234d30){return function(_0x2ddea6){if(_0x2ddea6){return _0x2ddea6[_0xf104('0x29')]()[_0xf104('0x28')](function(){_0x2b87d3[_0xf104('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x8a6edc,_0x293998){return function(_0x4dd06a){if(!_0x4dd06a){_0x8a6edc['sendStatus'](0x194);}return _0x4dd06a;};}function handleError(_0x1b29c5,_0x4782d0){_0x4782d0=_0x4782d0||0x1f4;return function(_0x130f03){logger[_0xf104('0x2a')](_0x130f03[_0xf104('0x2b')]);if(_0x130f03[_0xf104('0x2c')]){delete _0x130f03['name'];}_0x1b29c5['status'](_0x4782d0)['send'](_0x130f03);};}exports['index']=function(_0x4e2b92,_0x1c4d69){var _0xffc3d1={},_0xa144f5={},_0xfbe999={'count':0x0,'rows':[]};var _0xa42f4c=_['map'](db[_0xf104('0x2d')][_0xf104('0x2e')],function(_0x419984){return{'name':_0x419984[_0xf104('0x2f')],'type':_0x419984[_0xf104('0x30')][_0xf104('0x31')]};});_0xa144f5[_0xf104('0x32')]=_[_0xf104('0x33')](_0xa42f4c,'name');_0xa144f5['query']=_[_0xf104('0x34')](_0x4e2b92[_0xf104('0x35')]);_0xa144f5['filters']=_[_0xf104('0x36')](_0xa144f5[_0xf104('0x32')],_0xa144f5[_0xf104('0x35')]);_0xffc3d1[_0xf104('0x37')]=_[_0xf104('0x36')](_0xa144f5[_0xf104('0x32')],qs[_0xf104('0x38')](_0x4e2b92[_0xf104('0x35')][_0xf104('0x38')]));_0xffc3d1[_0xf104('0x37')]=_0xffc3d1[_0xf104('0x37')][_0xf104('0x39')]?_0xffc3d1[_0xf104('0x37')]:_0xa144f5[_0xf104('0x32')];if(!_0x4e2b92[_0xf104('0x35')][_0xf104('0x3a')](_0xf104('0x3b'))){_0xffc3d1[_0xf104('0x21')]=qs[_0xf104('0x21')](_0x4e2b92[_0xf104('0x35')][_0xf104('0x21')]);_0xffc3d1['offset']=qs[_0xf104('0x20')](_0x4e2b92[_0xf104('0x35')][_0xf104('0x20')]);}_0xffc3d1[_0xf104('0x3c')]=qs[_0xf104('0x3d')](_0x4e2b92['query'][_0xf104('0x3d')]);_0xffc3d1[_0xf104('0x3e')]=qs[_0xf104('0x3f')](_[_0xf104('0x40')](_0x4e2b92[_0xf104('0x35')],_0xa144f5[_0xf104('0x3f')]),_0xa42f4c);if(_0x4e2b92[_0xf104('0x35')][_0xf104('0x41')]){_0xffc3d1[_0xf104('0x3e')]=_[_0xf104('0x42')](_0xffc3d1[_0xf104('0x3e')],{'$or':_[_0xf104('0x33')](_0xa42f4c,function(_0xc602d8){if(_0xc602d8['type']!==_0xf104('0x43')){var _0x3c065e={};_0x3c065e[_0xc602d8[_0xf104('0x2c')]]={'$like':'%'+_0x4e2b92['query'][_0xf104('0x41')]+'%'};return _0x3c065e;}})});}_0xffc3d1=_[_0xf104('0x42')]({},_0xffc3d1,_0x4e2b92[_0xf104('0x44')]);var _0x3395e4={'where':_0xffc3d1[_0xf104('0x3e')]};return db[_0xf104('0x2d')]['count'](_0x3395e4)[_0xf104('0x28')](function(_0x29eb8b){_0xfbe999[_0xf104('0x1f')]=_0x29eb8b;if(_0x4e2b92[_0xf104('0x35')]['includeAll']){_0xffc3d1[_0xf104('0x45')]=[{'all':!![]}];}return db['ServicenowConfiguration']['findAll'](_0xffc3d1);})[_0xf104('0x28')](function(_0x167c8b){_0xfbe999[_0xf104('0x46')]=_0x167c8b;return _0xfbe999;})[_0xf104('0x28')](respondWithFilteredResult(_0x1c4d69,_0xffc3d1))[_0xf104('0x47')](handleError(_0x1c4d69,null));};exports['show']=function(_0x6ca9cc,_0x1f815e){var _0xd27043={'raw':![],'where':{'id':_0x6ca9cc['params']['id']}},_0x5beb90={};_0x5beb90[_0xf104('0x32')]=_['keys'](db[_0xf104('0x2d')][_0xf104('0x2e')]);_0x5beb90[_0xf104('0x35')]=_[_0xf104('0x34')](_0x6ca9cc['query']);_0x5beb90[_0xf104('0x3f')]=_[_0xf104('0x36')](_0x5beb90['model'],_0x5beb90[_0xf104('0x35')]);_0xd27043[_0xf104('0x37')]=_[_0xf104('0x36')](_0x5beb90[_0xf104('0x32')],qs[_0xf104('0x38')](_0x6ca9cc[_0xf104('0x35')]['fields']));_0xd27043[_0xf104('0x37')]=_0xd27043['attributes'][_0xf104('0x39')]?_0xd27043['attributes']:_0x5beb90[_0xf104('0x32')];if(_0x6ca9cc['query'][_0xf104('0x48')]){_0xd27043[_0xf104('0x45')]=[{'all':!![]}];}_0xd27043=_[_0xf104('0x42')]({},_0xd27043,_0x6ca9cc[_0xf104('0x44')]);return db['ServicenowConfiguration'][_0xf104('0x49')](_0xd27043)[_0xf104('0x28')](handleEntityNotFound(_0x1f815e,null))[_0xf104('0x28')](respondWithResult(_0x1f815e,null))[_0xf104('0x47')](handleError(_0x1f815e,null));};exports[_0xf104('0x4a')]=function(_0x23dc39,_0x1eaaf7){return db[_0xf104('0x2d')][_0xf104('0x4a')](_0x23dc39[_0xf104('0x4b')],{})[_0xf104('0x28')](respondWithResult(_0x1eaaf7,0xc9))[_0xf104('0x47')](handleError(_0x1eaaf7,null));};exports[_0xf104('0x27')]=function(_0x16e1a7,_0x2f3c98){if(_0x16e1a7[_0xf104('0x4b')]['id']){delete _0x16e1a7[_0xf104('0x4b')]['id'];}return db[_0xf104('0x2d')][_0xf104('0x49')]({'where':{'id':_0x16e1a7[_0xf104('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2f3c98,null))[_0xf104('0x28')](saveUpdates(_0x16e1a7[_0xf104('0x4b')],null))[_0xf104('0x28')](respondWithResult(_0x2f3c98,null))['catch'](handleError(_0x2f3c98,null));};exports[_0xf104('0x29')]=function(_0x488eb6,_0x66748a){return db[_0xf104('0x2d')][_0xf104('0x49')]({'where':{'id':_0x488eb6[_0xf104('0x4c')]['id']}})[_0xf104('0x28')](handleEntityNotFound(_0x66748a,null))[_0xf104('0x28')](removeEntity(_0x66748a,null))[_0xf104('0x47')](handleError(_0x66748a,null));};exports[_0xf104('0x4d')]=function(_0xa742ff,_0x369f67,_0x99e7c){var _0x5bea88={};var _0x199741={};var _0x50e863;var _0x43d85c;return db[_0xf104('0x2d')][_0xf104('0x4e')]({'where':{'id':_0xa742ff[_0xf104('0x4c')]['id']}})[_0xf104('0x28')](handleEntityNotFound(_0x369f67,null))[_0xf104('0x28')](function(_0x4a8b3a){if(_0x4a8b3a){_0x50e863=_0x4a8b3a;_0x199741[_0xf104('0x32')]=_[_0xf104('0x34')](db[_0xf104('0x4f')]['rawAttributes']);_0x199741[_0xf104('0x35')]=_['keys'](_0xa742ff[_0xf104('0x35')]);_0x199741['filters']=_[_0xf104('0x36')](_0x199741[_0xf104('0x32')],_0x199741['query']);_0x5bea88[_0xf104('0x37')]=_['intersection'](_0x199741[_0xf104('0x32')],qs['fields'](_0xa742ff[_0xf104('0x35')][_0xf104('0x38')]));_0x5bea88[_0xf104('0x37')]=_0x5bea88[_0xf104('0x37')][_0xf104('0x39')]?_0x5bea88[_0xf104('0x37')]:_0x199741['model'];_0x5bea88[_0xf104('0x3c')]=qs['sort'](_0xa742ff[_0xf104('0x35')][_0xf104('0x3d')]);_0x5bea88[_0xf104('0x3e')]=qs['filters'](_[_0xf104('0x40')](_0xa742ff[_0xf104('0x35')],_0x199741[_0xf104('0x3f')]));if(_0xa742ff[_0xf104('0x35')][_0xf104('0x41')]){_0x5bea88[_0xf104('0x3e')]=_[_0xf104('0x42')](_0x5bea88[_0xf104('0x3e')],{'$or':_[_0xf104('0x33')](_0x5bea88[_0xf104('0x37')],function(_0x8a21d7){var _0x3040d2={};_0x3040d2[_0x8a21d7]={'$like':'%'+_0xa742ff[_0xf104('0x35')][_0xf104('0x41')]+'%'};return _0x3040d2;})});}_0x5bea88=_[_0xf104('0x42')]({},_0x5bea88,_0xa742ff[_0xf104('0x44')]);return _0x50e863[_0xf104('0x4d')](_0x5bea88);}})[_0xf104('0x28')](function(_0x40cf47){if(_0x40cf47){_0x43d85c=_0x40cf47[_0xf104('0x39')];if(!_0xa742ff[_0xf104('0x35')][_0xf104('0x3a')](_0xf104('0x3b'))){_0x5bea88[_0xf104('0x21')]=qs[_0xf104('0x21')](_0xa742ff[_0xf104('0x35')][_0xf104('0x21')]);_0x5bea88[_0xf104('0x20')]=qs['offset'](_0xa742ff[_0xf104('0x35')][_0xf104('0x20')]);}return _0x50e863[_0xf104('0x4d')](_0x5bea88);}})[_0xf104('0x28')](function(_0x5ae4af){if(_0x5ae4af){return _0x5ae4af?{'count':_0x43d85c,'rows':_0x5ae4af}:null;}})['then'](respondWithResult(_0x369f67,null))[_0xf104('0x47')](handleError(_0x369f67,null));};exports[_0xf104('0x50')]=function(_0x35e519,_0x1260cf,_0x2ca69c){var _0x5082c2={};var _0x4a1cb4={};var _0x31bb73;var _0x48de20;return db[_0xf104('0x2d')][_0xf104('0x4e')]({'where':{'id':_0x35e519[_0xf104('0x4c')]['id']}})[_0xf104('0x28')](handleEntityNotFound(_0x1260cf,null))[_0xf104('0x28')](function(_0x1a374f){if(_0x1a374f){_0x31bb73=_0x1a374f;_0x4a1cb4['model']=_[_0xf104('0x34')](db[_0xf104('0x4f')][_0xf104('0x2e')]);_0x4a1cb4[_0xf104('0x35')]=_[_0xf104('0x34')](_0x35e519[_0xf104('0x35')]);_0x4a1cb4[_0xf104('0x3f')]=_['intersection'](_0x4a1cb4[_0xf104('0x32')],_0x4a1cb4[_0xf104('0x35')]);_0x5082c2[_0xf104('0x37')]=_[_0xf104('0x36')](_0x4a1cb4[_0xf104('0x32')],qs['fields'](_0x35e519[_0xf104('0x35')][_0xf104('0x38')]));_0x5082c2['attributes']=_0x5082c2['attributes'][_0xf104('0x39')]?_0x5082c2[_0xf104('0x37')]:_0x4a1cb4['model'];_0x5082c2[_0xf104('0x3c')]=qs[_0xf104('0x3d')](_0x35e519[_0xf104('0x35')][_0xf104('0x3d')]);_0x5082c2[_0xf104('0x3e')]=qs[_0xf104('0x3f')](_[_0xf104('0x40')](_0x35e519[_0xf104('0x35')],_0x4a1cb4['filters']));if(_0x35e519[_0xf104('0x35')][_0xf104('0x41')]){_0x5082c2[_0xf104('0x3e')]=_[_0xf104('0x42')](_0x5082c2[_0xf104('0x3e')],{'$or':_[_0xf104('0x33')](_0x5082c2['attributes'],function(_0x156c50){var _0x1df2e7={};_0x1df2e7[_0x156c50]={'$like':'%'+_0x35e519[_0xf104('0x35')][_0xf104('0x41')]+'%'};return _0x1df2e7;})});}_0x5082c2=_[_0xf104('0x42')]({},_0x5082c2,_0x35e519[_0xf104('0x44')]);return _0x31bb73[_0xf104('0x50')](_0x5082c2);}})['then'](function(_0x39fc36){if(_0x39fc36){_0x48de20=_0x39fc36['length'];if(!_0x35e519[_0xf104('0x35')][_0xf104('0x3a')](_0xf104('0x3b'))){_0x5082c2[_0xf104('0x21')]=qs[_0xf104('0x21')](_0x35e519[_0xf104('0x35')][_0xf104('0x21')]);_0x5082c2[_0xf104('0x20')]=qs['offset'](_0x35e519[_0xf104('0x35')][_0xf104('0x20')]);}return _0x31bb73[_0xf104('0x50')](_0x5082c2);}})[_0xf104('0x28')](function(_0x937637){if(_0x937637){return _0x937637?{'count':_0x48de20,'rows':_0x937637}:null;}})[_0xf104('0x28')](respondWithResult(_0x1260cf,null))[_0xf104('0x47')](handleError(_0x1260cf,null));};exports[_0xf104('0x51')]=function(_0x21dded,_0x59dbae,_0x576c8e){var _0x3e5596={};var _0x11a729={};var _0x3847e1;var _0x23c29b;return db[_0xf104('0x2d')][_0xf104('0x4e')]({'where':{'id':_0x21dded['params']['id']}})[_0xf104('0x28')](handleEntityNotFound(_0x59dbae,null))[_0xf104('0x28')](function(_0x8fb09b){if(_0x8fb09b){_0x3847e1=_0x8fb09b;_0x11a729['model']=_[_0xf104('0x34')](db[_0xf104('0x4f')][_0xf104('0x2e')]);_0x11a729['query']=_[_0xf104('0x34')](_0x21dded[_0xf104('0x35')]);_0x11a729[_0xf104('0x3f')]=_[_0xf104('0x36')](_0x11a729[_0xf104('0x32')],_0x11a729['query']);_0x3e5596[_0xf104('0x37')]=_['intersection'](_0x11a729[_0xf104('0x32')],qs[_0xf104('0x38')](_0x21dded[_0xf104('0x35')]['fields']));_0x3e5596['attributes']=_0x3e5596[_0xf104('0x37')]['length']?_0x3e5596[_0xf104('0x37')]:_0x11a729[_0xf104('0x32')];_0x3e5596['order']=qs[_0xf104('0x3d')](_0x21dded[_0xf104('0x35')]['sort']);_0x3e5596[_0xf104('0x3e')]=qs[_0xf104('0x3f')](_[_0xf104('0x40')](_0x21dded[_0xf104('0x35')],_0x11a729['filters']));if(_0x21dded[_0xf104('0x35')][_0xf104('0x41')]){_0x3e5596[_0xf104('0x3e')]=_[_0xf104('0x42')](_0x3e5596[_0xf104('0x3e')],{'$or':_[_0xf104('0x33')](_0x3e5596[_0xf104('0x37')],function(_0x3475cb){var _0x424770={};_0x424770[_0x3475cb]={'$like':'%'+_0x21dded[_0xf104('0x35')]['filter']+'%'};return _0x424770;})});}_0x3e5596=_[_0xf104('0x42')]({},_0x3e5596,_0x21dded['options']);return _0x3847e1[_0xf104('0x51')](_0x3e5596);}})[_0xf104('0x28')](function(_0x5d6c34){if(_0x5d6c34){_0x23c29b=_0x5d6c34['length'];if(!_0x21dded[_0xf104('0x35')][_0xf104('0x3a')]('nolimit')){_0x3e5596['limit']=qs[_0xf104('0x21')](_0x21dded[_0xf104('0x35')][_0xf104('0x21')]);_0x3e5596[_0xf104('0x20')]=qs[_0xf104('0x20')](_0x21dded[_0xf104('0x35')][_0xf104('0x20')]);}return _0x3847e1[_0xf104('0x51')](_0x3e5596);}})[_0xf104('0x28')](function(_0x2a7fcb){if(_0x2a7fcb){return _0x2a7fcb?{'count':_0x23c29b,'rows':_0x2a7fcb}:null;}})['then'](respondWithResult(_0x59dbae,null))['catch'](handleError(_0x59dbae,null));}; \ No newline at end of file +var _0xeef5=['stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','merge','filter','options','ServicenowConfiguration','includeAll','findAll','rows','show','include','catch','create','body','find','params','getFields','sort','findOne','ServicenowField','getSubjects','getDescriptions','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','update','destroy','then'];(function(_0x13a200,_0x53b6ab){var _0x542a96=function(_0x46d95c){while(--_0x46d95c){_0x13a200['push'](_0x13a200['shift']());}};_0x542a96(++_0x53b6ab);}(_0xeef5,0x78));var _0x5eef=function(_0x1c37fd,_0x52da69){_0x1c37fd=_0x1c37fd-0x0;var _0xbc7a65=_0xeef5[_0x1c37fd];return _0xbc7a65;};'use strict';var emlformat=require(_0x5eef('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5eef('0x1'));var rp=require(_0x5eef('0x2'));var moment=require(_0x5eef('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5eef('0x4'));var util=require(_0x5eef('0x5'));var path=require(_0x5eef('0x6'));var sox=require(_0x5eef('0x7'));var csv=require(_0x5eef('0x8'));var ejs=require(_0x5eef('0x9'));var fs=require('fs');var fs_extra=require(_0x5eef('0xa'));var _=require(_0x5eef('0xb'));var squel=require(_0x5eef('0xc'));var crypto=require(_0x5eef('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5eef('0x8'));var querystring=require(_0x5eef('0xe'));var Papa=require('papaparse');var Redis=require(_0x5eef('0xf'));var authService=require(_0x5eef('0x10'));var qs=require(_0x5eef('0x11'));var as=require(_0x5eef('0x12'));var hardwareService=require(_0x5eef('0x13'));var logger=require(_0x5eef('0x14'))(_0x5eef('0x15'));var utils=require('../../config/utils');var config=require(_0x5eef('0x16'));var licenseUtil=require(_0x5eef('0x17'));var db=require(_0x5eef('0x18'))['db'];function respondWithStatusCode(_0x4d8d31,_0x5d797b){_0x5d797b=_0x5d797b||0xcc;return function(_0x661af6){if(_0x661af6){return _0x4d8d31[_0x5eef('0x19')](_0x5d797b);}return _0x4d8d31[_0x5eef('0x1a')](_0x5d797b)[_0x5eef('0x1b')]();};}function respondWithResult(_0x4fe949,_0x132570){_0x132570=_0x132570||0xc8;return function(_0x434d31){if(_0x434d31){return _0x4fe949['status'](_0x132570)[_0x5eef('0x1c')](_0x434d31);}};}function respondWithFilteredResult(_0x47c825,_0x525126){return function(_0x1d3670){if(_0x1d3670){var _0xb4cd56=typeof _0x525126[_0x5eef('0x1d')]===_0x5eef('0x1e')&&typeof _0x525126[_0x5eef('0x1f')]===_0x5eef('0x1e');var _0xcfe805=_0x1d3670[_0x5eef('0x20')];var _0x3f6b5f=_0xb4cd56?0x0:_0x525126[_0x5eef('0x1d')];var _0x5d6271=_0xb4cd56?_0x1d3670[_0x5eef('0x20')]:_0x525126[_0x5eef('0x1d')]+_0x525126[_0x5eef('0x1f')];var _0x221178;if(_0x5d6271>=_0xcfe805){_0x5d6271=_0xcfe805;_0x221178=0xc8;}else{_0x221178=0xce;}_0x47c825[_0x5eef('0x1a')](_0x221178);return _0x47c825['set']('Content-Range',_0x3f6b5f+'-'+_0x5d6271+'/'+_0xcfe805)[_0x5eef('0x1c')](_0x1d3670);}return null;};}function patchUpdates(_0x433c1b){return function(_0x3571e1){try{jsonpatch[_0x5eef('0x21')](_0x3571e1,_0x433c1b,!![]);}catch(_0x156a72){return BPromise[_0x5eef('0x22')](_0x156a72);}return _0x3571e1['save']();};}function saveUpdates(_0x1b4d1b,_0x118768){return function(_0x467dc7){if(_0x467dc7){return _0x467dc7[_0x5eef('0x23')](_0x1b4d1b)['then'](function(_0x495ccf){return _0x495ccf;});}return null;};}function removeEntity(_0x45d5d6,_0x16dfbc){return function(_0x2bb52d){if(_0x2bb52d){return _0x2bb52d[_0x5eef('0x24')]()[_0x5eef('0x25')](function(){_0x45d5d6['status'](0xcc)[_0x5eef('0x1b')]();});}};}function handleEntityNotFound(_0x7e530b,_0x50c3c7){return function(_0x499426){if(!_0x499426){_0x7e530b[_0x5eef('0x19')](0x194);}return _0x499426;};}function handleError(_0x3ab674,_0x17a2ae){_0x17a2ae=_0x17a2ae||0x1f4;return function(_0x26e8de){logger['error'](_0x26e8de[_0x5eef('0x26')]);if(_0x26e8de[_0x5eef('0x27')]){delete _0x26e8de[_0x5eef('0x27')];}_0x3ab674[_0x5eef('0x1a')](_0x17a2ae)['send'](_0x26e8de);};}exports[_0x5eef('0x28')]=function(_0x2c7408,_0x466cc2){var _0x21e980={},_0x15f8d0={},_0x271ae4={'count':0x0,'rows':[]};var _0x29189b=_[_0x5eef('0x29')](db['ServicenowConfiguration'][_0x5eef('0x2a')],function(_0x5abca8){return{'name':_0x5abca8[_0x5eef('0x2b')],'type':_0x5abca8[_0x5eef('0x2c')][_0x5eef('0x2d')]};});_0x15f8d0[_0x5eef('0x2e')]=_[_0x5eef('0x29')](_0x29189b,_0x5eef('0x27'));_0x15f8d0[_0x5eef('0x2f')]=_[_0x5eef('0x30')](_0x2c7408['query']);_0x15f8d0['filters']=_[_0x5eef('0x31')](_0x15f8d0['model'],_0x15f8d0[_0x5eef('0x2f')]);_0x21e980[_0x5eef('0x32')]=_[_0x5eef('0x31')](_0x15f8d0[_0x5eef('0x2e')],qs[_0x5eef('0x33')](_0x2c7408[_0x5eef('0x2f')][_0x5eef('0x33')]));_0x21e980[_0x5eef('0x32')]=_0x21e980[_0x5eef('0x32')][_0x5eef('0x34')]?_0x21e980['attributes']:_0x15f8d0[_0x5eef('0x2e')];if(!_0x2c7408[_0x5eef('0x2f')][_0x5eef('0x35')](_0x5eef('0x36'))){_0x21e980[_0x5eef('0x1f')]=qs[_0x5eef('0x1f')](_0x2c7408['query']['limit']);_0x21e980[_0x5eef('0x1d')]=qs['offset'](_0x2c7408['query']['offset']);}_0x21e980[_0x5eef('0x37')]=qs['sort'](_0x2c7408[_0x5eef('0x2f')]['sort']);_0x21e980[_0x5eef('0x38')]=qs[_0x5eef('0x39')](_[_0x5eef('0x3a')](_0x2c7408['query'],_0x15f8d0[_0x5eef('0x39')]),_0x29189b);if(_0x2c7408[_0x5eef('0x2f')]['filter']){_0x21e980[_0x5eef('0x38')]=_[_0x5eef('0x3b')](_0x21e980['where'],{'$or':_['map'](_0x29189b,function(_0x13bf10){if(_0x13bf10[_0x5eef('0x2c')]!=='VIRTUAL'){var _0x43af3b={};_0x43af3b[_0x13bf10[_0x5eef('0x27')]]={'$like':'%'+_0x2c7408['query'][_0x5eef('0x3c')]+'%'};return _0x43af3b;}})});}_0x21e980=_[_0x5eef('0x3b')]({},_0x21e980,_0x2c7408[_0x5eef('0x3d')]);var _0x3890e9={'where':_0x21e980[_0x5eef('0x38')]};return db[_0x5eef('0x3e')][_0x5eef('0x20')](_0x3890e9)['then'](function(_0x39c994){_0x271ae4[_0x5eef('0x20')]=_0x39c994;if(_0x2c7408['query'][_0x5eef('0x3f')]){_0x21e980['include']=[{'all':!![]}];}return db[_0x5eef('0x3e')][_0x5eef('0x40')](_0x21e980);})[_0x5eef('0x25')](function(_0x49b24a){_0x271ae4[_0x5eef('0x41')]=_0x49b24a;return _0x271ae4;})[_0x5eef('0x25')](respondWithFilteredResult(_0x466cc2,_0x21e980))['catch'](handleError(_0x466cc2,null));};exports[_0x5eef('0x42')]=function(_0x4ff8df,_0x2694d8){var _0x3b02d2={'raw':![],'where':{'id':_0x4ff8df['params']['id']}},_0x24a9db={};_0x24a9db[_0x5eef('0x2e')]=_['keys'](db['ServicenowConfiguration'][_0x5eef('0x2a')]);_0x24a9db[_0x5eef('0x2f')]=_['keys'](_0x4ff8df[_0x5eef('0x2f')]);_0x24a9db[_0x5eef('0x39')]=_[_0x5eef('0x31')](_0x24a9db['model'],_0x24a9db[_0x5eef('0x2f')]);_0x3b02d2[_0x5eef('0x32')]=_['intersection'](_0x24a9db[_0x5eef('0x2e')],qs[_0x5eef('0x33')](_0x4ff8df[_0x5eef('0x2f')][_0x5eef('0x33')]));_0x3b02d2[_0x5eef('0x32')]=_0x3b02d2[_0x5eef('0x32')][_0x5eef('0x34')]?_0x3b02d2[_0x5eef('0x32')]:_0x24a9db[_0x5eef('0x2e')];if(_0x4ff8df[_0x5eef('0x2f')][_0x5eef('0x3f')]){_0x3b02d2[_0x5eef('0x43')]=[{'all':!![]}];}_0x3b02d2=_[_0x5eef('0x3b')]({},_0x3b02d2,_0x4ff8df[_0x5eef('0x3d')]);return db[_0x5eef('0x3e')]['find'](_0x3b02d2)[_0x5eef('0x25')](handleEntityNotFound(_0x2694d8,null))[_0x5eef('0x25')](respondWithResult(_0x2694d8,null))[_0x5eef('0x44')](handleError(_0x2694d8,null));};exports[_0x5eef('0x45')]=function(_0x3798a1,_0xae4d94){return db[_0x5eef('0x3e')][_0x5eef('0x45')](_0x3798a1[_0x5eef('0x46')],{})[_0x5eef('0x25')](respondWithResult(_0xae4d94,0xc9))[_0x5eef('0x44')](handleError(_0xae4d94,null));};exports[_0x5eef('0x23')]=function(_0x1c4722,_0x52f89b){if(_0x1c4722[_0x5eef('0x46')]['id']){delete _0x1c4722['body']['id'];}return db[_0x5eef('0x3e')][_0x5eef('0x47')]({'where':{'id':_0x1c4722[_0x5eef('0x48')]['id']}})[_0x5eef('0x25')](handleEntityNotFound(_0x52f89b,null))[_0x5eef('0x25')](saveUpdates(_0x1c4722['body'],null))[_0x5eef('0x25')](respondWithResult(_0x52f89b,null))[_0x5eef('0x44')](handleError(_0x52f89b,null));};exports['destroy']=function(_0x432de4,_0x11251c){return db['ServicenowConfiguration']['find']({'where':{'id':_0x432de4[_0x5eef('0x48')]['id']}})[_0x5eef('0x25')](handleEntityNotFound(_0x11251c,null))[_0x5eef('0x25')](removeEntity(_0x11251c,null))[_0x5eef('0x44')](handleError(_0x11251c,null));};exports[_0x5eef('0x49')]=function(_0x49e4b9,_0x301bea,_0x28ff8a){var _0xbf1fd5={};var _0x2830bc={};var _0x3aeb8f;var _0x2056ce;return db[_0x5eef('0x3e')]['findOne']({'where':{'id':_0x49e4b9['params']['id']}})[_0x5eef('0x25')](handleEntityNotFound(_0x301bea,null))[_0x5eef('0x25')](function(_0xbd9c7a){if(_0xbd9c7a){_0x3aeb8f=_0xbd9c7a;_0x2830bc[_0x5eef('0x2e')]=_[_0x5eef('0x30')](db['ServicenowField'][_0x5eef('0x2a')]);_0x2830bc[_0x5eef('0x2f')]=_[_0x5eef('0x30')](_0x49e4b9['query']);_0x2830bc[_0x5eef('0x39')]=_['intersection'](_0x2830bc[_0x5eef('0x2e')],_0x2830bc['query']);_0xbf1fd5[_0x5eef('0x32')]=_[_0x5eef('0x31')](_0x2830bc[_0x5eef('0x2e')],qs[_0x5eef('0x33')](_0x49e4b9[_0x5eef('0x2f')][_0x5eef('0x33')]));_0xbf1fd5['attributes']=_0xbf1fd5[_0x5eef('0x32')][_0x5eef('0x34')]?_0xbf1fd5['attributes']:_0x2830bc[_0x5eef('0x2e')];_0xbf1fd5[_0x5eef('0x37')]=qs[_0x5eef('0x4a')](_0x49e4b9[_0x5eef('0x2f')]['sort']);_0xbf1fd5['where']=qs[_0x5eef('0x39')](_[_0x5eef('0x3a')](_0x49e4b9['query'],_0x2830bc[_0x5eef('0x39')]));if(_0x49e4b9['query'][_0x5eef('0x3c')]){_0xbf1fd5[_0x5eef('0x38')]=_[_0x5eef('0x3b')](_0xbf1fd5[_0x5eef('0x38')],{'$or':_[_0x5eef('0x29')](_0xbf1fd5[_0x5eef('0x32')],function(_0x48a673){var _0x35f32d={};_0x35f32d[_0x48a673]={'$like':'%'+_0x49e4b9[_0x5eef('0x2f')]['filter']+'%'};return _0x35f32d;})});}_0xbf1fd5=_[_0x5eef('0x3b')]({},_0xbf1fd5,_0x49e4b9[_0x5eef('0x3d')]);return _0x3aeb8f[_0x5eef('0x49')](_0xbf1fd5);}})[_0x5eef('0x25')](function(_0x245261){if(_0x245261){_0x2056ce=_0x245261[_0x5eef('0x34')];if(!_0x49e4b9['query'][_0x5eef('0x35')](_0x5eef('0x36'))){_0xbf1fd5[_0x5eef('0x1f')]=qs['limit'](_0x49e4b9[_0x5eef('0x2f')][_0x5eef('0x1f')]);_0xbf1fd5[_0x5eef('0x1d')]=qs[_0x5eef('0x1d')](_0x49e4b9['query'][_0x5eef('0x1d')]);}return _0x3aeb8f[_0x5eef('0x49')](_0xbf1fd5);}})[_0x5eef('0x25')](function(_0x28f8cd){if(_0x28f8cd){return _0x28f8cd?{'count':_0x2056ce,'rows':_0x28f8cd}:null;}})['then'](respondWithResult(_0x301bea,null))[_0x5eef('0x44')](handleError(_0x301bea,null));};exports['getSubjects']=function(_0x3e9932,_0x5ea3ac,_0x2f22d5){var _0x5d6704={};var _0x26d8d8={};var _0x48dbb1;var _0x484450;return db[_0x5eef('0x3e')][_0x5eef('0x4b')]({'where':{'id':_0x3e9932[_0x5eef('0x48')]['id']}})['then'](handleEntityNotFound(_0x5ea3ac,null))[_0x5eef('0x25')](function(_0x16dd7b){if(_0x16dd7b){_0x48dbb1=_0x16dd7b;_0x26d8d8[_0x5eef('0x2e')]=_[_0x5eef('0x30')](db[_0x5eef('0x4c')][_0x5eef('0x2a')]);_0x26d8d8[_0x5eef('0x2f')]=_[_0x5eef('0x30')](_0x3e9932[_0x5eef('0x2f')]);_0x26d8d8[_0x5eef('0x39')]=_['intersection'](_0x26d8d8[_0x5eef('0x2e')],_0x26d8d8[_0x5eef('0x2f')]);_0x5d6704[_0x5eef('0x32')]=_[_0x5eef('0x31')](_0x26d8d8[_0x5eef('0x2e')],qs[_0x5eef('0x33')](_0x3e9932['query']['fields']));_0x5d6704[_0x5eef('0x32')]=_0x5d6704[_0x5eef('0x32')]['length']?_0x5d6704[_0x5eef('0x32')]:_0x26d8d8['model'];_0x5d6704[_0x5eef('0x37')]=qs['sort'](_0x3e9932[_0x5eef('0x2f')][_0x5eef('0x4a')]);_0x5d6704['where']=qs[_0x5eef('0x39')](_['pick'](_0x3e9932['query'],_0x26d8d8[_0x5eef('0x39')]));if(_0x3e9932[_0x5eef('0x2f')][_0x5eef('0x3c')]){_0x5d6704['where']=_['merge'](_0x5d6704[_0x5eef('0x38')],{'$or':_[_0x5eef('0x29')](_0x5d6704[_0x5eef('0x32')],function(_0x58c743){var _0x2b2e94={};_0x2b2e94[_0x58c743]={'$like':'%'+_0x3e9932[_0x5eef('0x2f')]['filter']+'%'};return _0x2b2e94;})});}_0x5d6704=_[_0x5eef('0x3b')]({},_0x5d6704,_0x3e9932[_0x5eef('0x3d')]);return _0x48dbb1[_0x5eef('0x4d')](_0x5d6704);}})['then'](function(_0x523d00){if(_0x523d00){_0x484450=_0x523d00['length'];if(!_0x3e9932[_0x5eef('0x2f')][_0x5eef('0x35')](_0x5eef('0x36'))){_0x5d6704[_0x5eef('0x1f')]=qs[_0x5eef('0x1f')](_0x3e9932[_0x5eef('0x2f')][_0x5eef('0x1f')]);_0x5d6704[_0x5eef('0x1d')]=qs[_0x5eef('0x1d')](_0x3e9932[_0x5eef('0x2f')][_0x5eef('0x1d')]);}return _0x48dbb1['getSubjects'](_0x5d6704);}})['then'](function(_0xb508d8){if(_0xb508d8){return _0xb508d8?{'count':_0x484450,'rows':_0xb508d8}:null;}})[_0x5eef('0x25')](respondWithResult(_0x5ea3ac,null))[_0x5eef('0x44')](handleError(_0x5ea3ac,null));};exports[_0x5eef('0x4e')]=function(_0x26d3b7,_0x53ea58,_0x14d072){var _0x22685a={};var _0x5f03a5={};var _0x12b41f;var _0x53ddbd;return db[_0x5eef('0x3e')][_0x5eef('0x4b')]({'where':{'id':_0x26d3b7[_0x5eef('0x48')]['id']}})[_0x5eef('0x25')](handleEntityNotFound(_0x53ea58,null))[_0x5eef('0x25')](function(_0x17ef72){if(_0x17ef72){_0x12b41f=_0x17ef72;_0x5f03a5[_0x5eef('0x2e')]=_[_0x5eef('0x30')](db[_0x5eef('0x4c')][_0x5eef('0x2a')]);_0x5f03a5[_0x5eef('0x2f')]=_[_0x5eef('0x30')](_0x26d3b7[_0x5eef('0x2f')]);_0x5f03a5[_0x5eef('0x39')]=_[_0x5eef('0x31')](_0x5f03a5['model'],_0x5f03a5[_0x5eef('0x2f')]);_0x22685a[_0x5eef('0x32')]=_[_0x5eef('0x31')](_0x5f03a5['model'],qs[_0x5eef('0x33')](_0x26d3b7[_0x5eef('0x2f')][_0x5eef('0x33')]));_0x22685a[_0x5eef('0x32')]=_0x22685a['attributes']['length']?_0x22685a[_0x5eef('0x32')]:_0x5f03a5[_0x5eef('0x2e')];_0x22685a[_0x5eef('0x37')]=qs[_0x5eef('0x4a')](_0x26d3b7[_0x5eef('0x2f')][_0x5eef('0x4a')]);_0x22685a['where']=qs[_0x5eef('0x39')](_[_0x5eef('0x3a')](_0x26d3b7[_0x5eef('0x2f')],_0x5f03a5[_0x5eef('0x39')]));if(_0x26d3b7[_0x5eef('0x2f')][_0x5eef('0x3c')]){_0x22685a[_0x5eef('0x38')]=_[_0x5eef('0x3b')](_0x22685a[_0x5eef('0x38')],{'$or':_['map'](_0x22685a[_0x5eef('0x32')],function(_0x45a463){var _0x10803a={};_0x10803a[_0x45a463]={'$like':'%'+_0x26d3b7[_0x5eef('0x2f')]['filter']+'%'};return _0x10803a;})});}_0x22685a=_[_0x5eef('0x3b')]({},_0x22685a,_0x26d3b7[_0x5eef('0x3d')]);return _0x12b41f[_0x5eef('0x4e')](_0x22685a);}})[_0x5eef('0x25')](function(_0x3de759){if(_0x3de759){_0x53ddbd=_0x3de759[_0x5eef('0x34')];if(!_0x26d3b7[_0x5eef('0x2f')][_0x5eef('0x35')](_0x5eef('0x36'))){_0x22685a[_0x5eef('0x1f')]=qs[_0x5eef('0x1f')](_0x26d3b7[_0x5eef('0x2f')][_0x5eef('0x1f')]);_0x22685a['offset']=qs[_0x5eef('0x1d')](_0x26d3b7['query'][_0x5eef('0x1d')]);}return _0x12b41f[_0x5eef('0x4e')](_0x22685a);}})['then'](function(_0x322813){if(_0x322813){return _0x322813?{'count':_0x53ddbd,'rows':_0x322813}:null;}})[_0x5eef('0x25')](respondWithResult(_0x53ea58,null))['catch'](handleError(_0x53ea58,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 25e7828..ad3fcf5 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 _0x4e2e=['exports','define','ServicenowConfiguration','int_servicenow_configurations','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intServicenowConfiguration.attributes'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x4e2e,0x1f2));var _0xe4e2=function(_0x52e3b1,_0x19aad3){_0x52e3b1=_0x52e3b1-0x0;var _0x57afed=_0x4e2e[_0x52e3b1];return _0x57afed;};'use strict';var _=require('lodash');var util=require(_0xe4e2('0x0'));var logger=require(_0xe4e2('0x1'))(_0xe4e2('0x2'));var moment=require(_0xe4e2('0x3'));var BPromise=require(_0xe4e2('0x4'));var rp=require(_0xe4e2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe4e2('0x6'));var config=require(_0xe4e2('0x7'));var attributes=require(_0xe4e2('0x8'));module[_0xe4e2('0x9')]=function(_0x48e83d,_0x322295){return _0x48e83d[_0xe4e2('0xa')](_0xe4e2('0xb'),attributes,{'tableName':_0xe4e2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa664=['request-promise','../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','util','../../config/logger','api','moment'];(function(_0x3a388b,_0x2076ef){var _0x43356d=function(_0x5e5a37){while(--_0x5e5a37){_0x3a388b['push'](_0x3a388b['shift']());}};_0x43356d(++_0x2076ef);}(_0xa664,0x132));var _0x4a66=function(_0x53dd07,_0x39e5b3){_0x53dd07=_0x53dd07-0x0;var _0x2d6299=_0xa664[_0x53dd07];return _0x2d6299;};'use strict';var _=require('lodash');var util=require(_0x4a66('0x0'));var logger=require(_0x4a66('0x1'))(_0x4a66('0x2'));var moment=require(_0x4a66('0x3'));var BPromise=require('bluebird');var rp=require(_0x4a66('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4a66('0x5'));var attributes=require(_0x4a66('0x6'));module[_0x4a66('0x7')]=function(_0x2661f8,_0x3dd553){return _0x2661f8[_0x4a66('0x8')](_0x4a66('0x9'),attributes,{'tableName':'int_servicenow_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index 6caaa66..9bfa023 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 _0x3189=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x587039,_0xff8312){var _0x4e5be5=function(_0x1b9cd5){while(--_0x1b9cd5){_0x587039['push'](_0x587039['shift']());}};_0x4e5be5(++_0xff8312);}(_0x3189,0x19a));var _0x9318=function(_0x3269e6,_0xa447d6){_0x3269e6=_0x3269e6-0x0;var _0x4c9bb2=_0x3189[_0x3269e6];return _0x4c9bb2;};'use strict';var _=require(_0x9318('0x0'));var util=require('util');var moment=require(_0x9318('0x1'));var BPromise=require(_0x9318('0x2'));var rs=require(_0x9318('0x3'));var fs=require('fs');var Redis=require(_0x9318('0x4'));var db=require(_0x9318('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9318('0x6'))(_0x9318('0x7'));var config=require(_0x9318('0x8'));var jayson=require(_0x9318('0x9'));var client=jayson[_0x9318('0xa')][_0x9318('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54504c,_0x406c79,_0x47cc66){return new BPromise(function(_0x582fe9,_0x2deb10){return client[_0x9318('0xc')](_0x54504c,_0x47cc66)['then'](function(_0x2b883e){logger[_0x9318('0xd')](_0x9318('0xe'),_0x406c79,_0x9318('0xf'));logger[_0x9318('0x10')](_0x9318('0x11'),_0x406c79,_0x9318('0xf'),JSON[_0x9318('0x12')](_0x2b883e));if(_0x2b883e['error']){if(_0x2b883e[_0x9318('0x13')][_0x9318('0x14')]===0x1f4){logger[_0x9318('0x13')](_0x9318('0xe'),_0x406c79,_0x2b883e[_0x9318('0x13')][_0x9318('0x15')]);return _0x2deb10(_0x2b883e[_0x9318('0x13')]['message']);}logger['error'](_0x9318('0xe'),_0x406c79,_0x2b883e[_0x9318('0x13')][_0x9318('0x15')]);return _0x582fe9(_0x2b883e[_0x9318('0x13')][_0x9318('0x15')]);}else{logger[_0x9318('0xd')](_0x9318('0xe'),_0x406c79,_0x9318('0xf'));_0x582fe9(_0x2b883e[_0x9318('0x16')][_0x9318('0x15')]);}})[_0x9318('0x17')](function(_0x101b16){logger['error'](_0x9318('0xe'),_0x406c79,_0x101b16);_0x2deb10(_0x101b16);});});} \ No newline at end of file +var _0x9ed7=['ServicenowConfiguration,\x20%s,\x20%s','message','info','request\x20sent','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x9ed7,0x16d));var _0x79ed=function(_0x4a8bad,_0x4bfb2f){_0x4a8bad=_0x4a8bad-0x0;var _0x30cf32=_0x9ed7[_0x4a8bad];return _0x30cf32;};'use strict';var _=require(_0x79ed('0x0'));var util=require('util');var moment=require(_0x79ed('0x1'));var BPromise=require(_0x79ed('0x2'));var rs=require(_0x79ed('0x3'));var fs=require('fs');var Redis=require(_0x79ed('0x4'));var db=require(_0x79ed('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x79ed('0x6'))(_0x79ed('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x79ed('0x8')][_0x79ed('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x26fc5c,_0x362865,_0x1da9b3){return new BPromise(function(_0x59b4c5,_0xafacc6){return client[_0x79ed('0xa')](_0x26fc5c,_0x1da9b3)['then'](function(_0x394eb3){logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x362865,'request\x20sent');logger['debug'](_0x79ed('0xb'),_0x362865,'request\x20sent',JSON[_0x79ed('0xc')](_0x394eb3));if(_0x394eb3[_0x79ed('0xd')]){if(_0x394eb3[_0x79ed('0xd')][_0x79ed('0xe')]===0x1f4){logger[_0x79ed('0xd')](_0x79ed('0xf'),_0x362865,_0x394eb3[_0x79ed('0xd')]['message']);return _0xafacc6(_0x394eb3[_0x79ed('0xd')][_0x79ed('0x10')]);}logger[_0x79ed('0xd')](_0x79ed('0xf'),_0x362865,_0x394eb3['error'][_0x79ed('0x10')]);return _0x59b4c5(_0x394eb3[_0x79ed('0xd')][_0x79ed('0x10')]);}else{logger[_0x79ed('0x11')](_0x79ed('0xf'),_0x362865,_0x79ed('0x12'));_0x59b4c5(_0x394eb3[_0x79ed('0x13')]['message']);}})['catch'](function(_0x335e27){logger[_0x79ed('0xd')]('ServicenowConfiguration,\x20%s,\x20%s',_0x362865,_0x335e27);_0xafacc6(_0x335e27);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index f68af88..86353b1 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 _0x7e3b=['isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','index','/:id'];(function(_0x2283dc,_0x2fcfc5){var _0x16db90=function(_0x376c35){while(--_0x376c35){_0x2283dc['push'](_0x2283dc['shift']());}};_0x16db90(++_0x2fcfc5);}(_0x7e3b,0x95));var _0xb7e3=function(_0x858618,_0x1ad2ea){_0x858618=_0x858618-0x0;var _0x2b22a0=_0x7e3b[_0x858618];return _0x2b22a0;};'use strict';var multer=require(_0xb7e3('0x0'));var util=require(_0xb7e3('0x1'));var path=require('path');var timeout=require(_0xb7e3('0x2'));var express=require(_0xb7e3('0x3'));var router=express[_0xb7e3('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb7e3('0x5'));var interaction=require(_0xb7e3('0x6'));var config=require(_0xb7e3('0x7'));var controller=require(_0xb7e3('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xb7e3('0x9')]);router['get'](_0xb7e3('0xa'),auth[_0xb7e3('0xb')](),controller[_0xb7e3('0xc')]);router[_0xb7e3('0xd')]('/',auth['isAuthenticated'](),controller[_0xb7e3('0xe')]);router[_0xb7e3('0xf')]('/:id',auth[_0xb7e3('0xb')](),controller[_0xb7e3('0x10')]);router[_0xb7e3('0x11')](_0xb7e3('0xa'),auth[_0xb7e3('0xb')](),controller[_0xb7e3('0x12')]);module[_0xb7e3('0x13')]=router; \ No newline at end of file +var _0x2b97=['isAuthenticated','create','put','update','delete','destroy','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','index','/:id','show'];(function(_0x2abacb,_0x2887a0){var _0x1e0521=function(_0xddec60){while(--_0xddec60){_0x2abacb['push'](_0x2abacb['shift']());}};_0x1e0521(++_0x2887a0);}(_0x2b97,0x1ce));var _0x72b9=function(_0x4930e1,_0x19f9c5){_0x4930e1=_0x4930e1-0x0;var _0x4ebead=_0x2b97[_0x4930e1];return _0x4ebead;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x72b9('0x0'));var timeout=require(_0x72b9('0x1'));var express=require(_0x72b9('0x2'));var router=express[_0x72b9('0x3')]();var fs_extra=require(_0x72b9('0x4'));var auth=require(_0x72b9('0x5'));var interaction=require(_0x72b9('0x6'));var config=require(_0x72b9('0x7'));var controller=require(_0x72b9('0x8'));router[_0x72b9('0x9')]('/',auth['isAuthenticated'](),controller[_0x72b9('0xa')]);router[_0x72b9('0x9')](_0x72b9('0xb'),auth['isAuthenticated'](),controller[_0x72b9('0xc')]);router['post']('/',auth[_0x72b9('0xd')](),controller[_0x72b9('0xe')]);router[_0x72b9('0xf')]('/:id',auth[_0x72b9('0xd')](),controller[_0x72b9('0x10')]);router[_0x72b9('0x11')](_0x72b9('0xb'),auth[_0x72b9('0xd')](),controller[_0x72b9('0x12')]);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 5ab0e49..1360cbe 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 _0xc239=['BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','picklist','STRING'];(function(_0xe51596,_0x314d5b){var _0x22c705=function(_0x4c6f94){while(--_0x4c6f94){_0xe51596['push'](_0xe51596['shift']());}};_0x22c705(++_0x314d5b);}(_0xc239,0xeb));var _0x9c23=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xc239[_0x46e363];return _0x3fb059;};'use strict';var Sequelize=require(_0x9c23('0x0'));module[_0x9c23('0x1')]={'type':{'type':Sequelize[_0x9c23('0x2')](_0x9c23('0x3'),_0x9c23('0x4'),_0x9c23('0x5'),'keyValue',_0x9c23('0x6')),'defaultValue':_0x9c23('0x3')},'content':{'type':Sequelize[_0x9c23('0x7')]},'key':{'type':Sequelize[_0x9c23('0x7')]},'keyType':{'type':Sequelize[_0x9c23('0x2')](_0x9c23('0x3'),_0x9c23('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x9c23('0x7')]},'idField':{'type':Sequelize[_0x9c23('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x9c23('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9c23('0x7')]}}; \ No newline at end of file +var _0xdc7e=['picklist','STRING','string','sequelize','ENUM','customVariable','keyValue'];(function(_0x65bedd,_0x45b5d2){var _0x3b23ec=function(_0x528a08){while(--_0x528a08){_0x65bedd['push'](_0x65bedd['shift']());}};_0x3b23ec(++_0x45b5d2);}(_0xdc7e,0xb2));var _0xedc7=function(_0x5d52ac,_0x5000fa){_0x5d52ac=_0x5d52ac-0x0;var _0x31e432=_0xdc7e[_0x5d52ac];return _0x31e432;};'use strict';var Sequelize=require(_0xedc7('0x0'));module['exports']={'type':{'type':Sequelize[_0xedc7('0x1')]('string','variable',_0xedc7('0x2'),_0xedc7('0x3'),_0xedc7('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0xedc7('0x5')]},'key':{'type':Sequelize[_0xedc7('0x5')]},'keyType':{'type':Sequelize[_0xedc7('0x1')](_0xedc7('0x6'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0xedc7('0x5')]},'idField':{'type':Sequelize[_0xedc7('0x5')]},'nameField':{'type':Sequelize[_0xedc7('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xedc7('0x5')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 804b936..278e6ab 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 _0x326e=['reject','save','update','then','destroy','error','stack','name','send','index','map','ServicenowField','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','crypto','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','limit','undefined','count','offset','apply'];(function(_0x7ca028,_0x233586){var _0x2dd584=function(_0x284212){while(--_0x284212){_0x7ca028['push'](_0x7ca028['shift']());}};_0x2dd584(++_0x233586);}(_0x326e,0x14d));var _0xe326=function(_0xaec84,_0x411dc3){_0xaec84=_0xaec84-0x0;var _0xb2d31=_0x326e[_0xaec84];return _0xb2d31;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe326('0x0'));var zipdir=require(_0xe326('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe326('0x2'));var moment=require(_0xe326('0x3'));var BPromise=require(_0xe326('0x4'));var Mustache=require(_0xe326('0x5'));var util=require(_0xe326('0x6'));var path=require('path');var sox=require(_0xe326('0x7'));var csv=require('to-csv');var ejs=require(_0xe326('0x8'));var fs=require('fs');var fs_extra=require(_0xe326('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xe326('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xe326('0xb'));var toCsv=require(_0xe326('0xc'));var querystring=require(_0xe326('0xd'));var Papa=require(_0xe326('0xe'));var Redis=require(_0xe326('0xf'));var authService=require(_0xe326('0x10'));var qs=require(_0xe326('0x11'));var as=require(_0xe326('0x12'));var hardwareService=require(_0xe326('0x13'));var logger=require('../../config/logger')(_0xe326('0x14'));var utils=require(_0xe326('0x15'));var config=require(_0xe326('0x16'));var licenseUtil=require(_0xe326('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b7ed8,_0x524fb0){_0x524fb0=_0x524fb0||0xcc;return function(_0x501838){if(_0x501838){return _0x1b7ed8['sendStatus'](_0x524fb0);}return _0x1b7ed8[_0xe326('0x18')](_0x524fb0)[_0xe326('0x19')]();};}function respondWithResult(_0x5f472e,_0x22d5e5){_0x22d5e5=_0x22d5e5||0xc8;return function(_0xb8b0a6){if(_0xb8b0a6){return _0x5f472e[_0xe326('0x18')](_0x22d5e5)[_0xe326('0x1a')](_0xb8b0a6);}};}function respondWithFilteredResult(_0x4dc651,_0x2e73ac){return function(_0xe8d834){if(_0xe8d834){var _0x39ee35=typeof _0x2e73ac['offset']==='undefined'&&typeof _0x2e73ac[_0xe326('0x1b')]===_0xe326('0x1c');var _0x3c8957=_0xe8d834[_0xe326('0x1d')];var _0x3344af=_0x39ee35?0x0:_0x2e73ac[_0xe326('0x1e')];var _0x3b822b=_0x39ee35?_0xe8d834['count']:_0x2e73ac[_0xe326('0x1e')]+_0x2e73ac[_0xe326('0x1b')];var _0xb5f5a7;if(_0x3b822b>=_0x3c8957){_0x3b822b=_0x3c8957;_0xb5f5a7=0xc8;}else{_0xb5f5a7=0xce;}_0x4dc651['status'](_0xb5f5a7);return _0x4dc651['set']('Content-Range',_0x3344af+'-'+_0x3b822b+'/'+_0x3c8957)[_0xe326('0x1a')](_0xe8d834);}return null;};}function patchUpdates(_0x4b62a1){return function(_0x312c33){try{jsonpatch[_0xe326('0x1f')](_0x312c33,_0x4b62a1,!![]);}catch(_0x32ea30){return BPromise[_0xe326('0x20')](_0x32ea30);}return _0x312c33[_0xe326('0x21')]();};}function saveUpdates(_0x52fa62,_0x201f68){return function(_0x3de516){if(_0x3de516){return _0x3de516[_0xe326('0x22')](_0x52fa62)[_0xe326('0x23')](function(_0x4c8136){return _0x4c8136;});}return null;};}function removeEntity(_0x332776,_0x3cdf93){return function(_0x3dfb63){if(_0x3dfb63){return _0x3dfb63[_0xe326('0x24')]()[_0xe326('0x23')](function(){_0x332776['status'](0xcc)[_0xe326('0x19')]();});}};}function handleEntityNotFound(_0x1fbdbd,_0x15b745){return function(_0x5107c2){if(!_0x5107c2){_0x1fbdbd['sendStatus'](0x194);}return _0x5107c2;};}function handleError(_0x247e8a,_0x16520d){_0x16520d=_0x16520d||0x1f4;return function(_0xd80e1d){logger[_0xe326('0x25')](_0xd80e1d[_0xe326('0x26')]);if(_0xd80e1d[_0xe326('0x27')]){delete _0xd80e1d[_0xe326('0x27')];}_0x247e8a[_0xe326('0x18')](_0x16520d)[_0xe326('0x28')](_0xd80e1d);};}exports[_0xe326('0x29')]=function(_0x38f639,_0xa0e5fe){var _0x60264e={},_0x170a09={},_0x37cc7b={'count':0x0,'rows':[]};var _0x70f8ee=_[_0xe326('0x2a')](db[_0xe326('0x2b')][_0xe326('0x2c')],function(_0x591af0){return{'name':_0x591af0[_0xe326('0x2d')],'type':_0x591af0[_0xe326('0x2e')][_0xe326('0x2f')]};});_0x170a09['model']=_['map'](_0x70f8ee,_0xe326('0x27'));_0x170a09['query']=_[_0xe326('0x30')](_0x38f639[_0xe326('0x31')]);_0x170a09[_0xe326('0x32')]=_[_0xe326('0x33')](_0x170a09[_0xe326('0x34')],_0x170a09[_0xe326('0x31')]);_0x60264e[_0xe326('0x35')]=_[_0xe326('0x33')](_0x170a09[_0xe326('0x34')],qs[_0xe326('0x36')](_0x38f639[_0xe326('0x31')][_0xe326('0x36')]));_0x60264e['attributes']=_0x60264e['attributes']['length']?_0x60264e[_0xe326('0x35')]:_0x170a09[_0xe326('0x34')];if(!_0x38f639[_0xe326('0x31')]['hasOwnProperty']('nolimit')){_0x60264e['limit']=qs[_0xe326('0x1b')](_0x38f639[_0xe326('0x31')][_0xe326('0x1b')]);_0x60264e['offset']=qs[_0xe326('0x1e')](_0x38f639['query'][_0xe326('0x1e')]);}_0x60264e[_0xe326('0x37')]=qs['sort'](_0x38f639['query'][_0xe326('0x38')]);_0x60264e[_0xe326('0x39')]=qs[_0xe326('0x32')](_[_0xe326('0x3a')](_0x38f639[_0xe326('0x31')],_0x170a09[_0xe326('0x32')]),_0x70f8ee);if(_0x38f639['query'][_0xe326('0x3b')]){_0x60264e[_0xe326('0x39')]=_['merge'](_0x60264e[_0xe326('0x39')],{'$or':_['map'](_0x70f8ee,function(_0x3e818d){if(_0x3e818d['type']!=='VIRTUAL'){var _0x6caac6={};_0x6caac6[_0x3e818d[_0xe326('0x27')]]={'$like':'%'+_0x38f639[_0xe326('0x31')]['filter']+'%'};return _0x6caac6;}})});}_0x60264e=_[_0xe326('0x3c')]({},_0x60264e,_0x38f639[_0xe326('0x3d')]);var _0x17b026={'where':_0x60264e[_0xe326('0x39')]};return db[_0xe326('0x2b')]['count'](_0x17b026)[_0xe326('0x23')](function(_0x231c55){_0x37cc7b['count']=_0x231c55;if(_0x38f639['query'][_0xe326('0x3e')]){_0x60264e[_0xe326('0x3f')]=[{'all':!![]}];}return db['ServicenowField'][_0xe326('0x40')](_0x60264e);})[_0xe326('0x23')](function(_0x42377d){_0x37cc7b[_0xe326('0x41')]=_0x42377d;return _0x37cc7b;})[_0xe326('0x23')](respondWithFilteredResult(_0xa0e5fe,_0x60264e))[_0xe326('0x42')](handleError(_0xa0e5fe,null));};exports[_0xe326('0x43')]=function(_0x5b3e55,_0x379dcf){var _0xcc782c={'raw':!![],'where':{'id':_0x5b3e55[_0xe326('0x44')]['id']}},_0x5614dd={};_0x5614dd['model']=_['keys'](db['ServicenowField']['rawAttributes']);_0x5614dd[_0xe326('0x31')]=_[_0xe326('0x30')](_0x5b3e55[_0xe326('0x31')]);_0x5614dd[_0xe326('0x32')]=_['intersection'](_0x5614dd['model'],_0x5614dd[_0xe326('0x31')]);_0xcc782c[_0xe326('0x35')]=_['intersection'](_0x5614dd[_0xe326('0x34')],qs['fields'](_0x5b3e55[_0xe326('0x31')][_0xe326('0x36')]));_0xcc782c['attributes']=_0xcc782c['attributes'][_0xe326('0x45')]?_0xcc782c[_0xe326('0x35')]:_0x5614dd[_0xe326('0x34')];if(_0x5b3e55[_0xe326('0x31')][_0xe326('0x3e')]){_0xcc782c[_0xe326('0x3f')]=[{'all':!![]}];}_0xcc782c=_[_0xe326('0x3c')]({},_0xcc782c,_0x5b3e55[_0xe326('0x3d')]);return db[_0xe326('0x2b')][_0xe326('0x46')](_0xcc782c)[_0xe326('0x23')](handleEntityNotFound(_0x379dcf,null))['then'](respondWithResult(_0x379dcf,null))[_0xe326('0x42')](handleError(_0x379dcf,null));};exports[_0xe326('0x47')]=function(_0x20a83d,_0xa0f9f0){return db[_0xe326('0x2b')][_0xe326('0x47')](_0x20a83d[_0xe326('0x48')],{})[_0xe326('0x23')](respondWithResult(_0xa0f9f0,0xc9))[_0xe326('0x42')](handleError(_0xa0f9f0,null));};exports[_0xe326('0x22')]=function(_0x25c2ce,_0x3bf067){if(_0x25c2ce[_0xe326('0x48')]['id']){delete _0x25c2ce[_0xe326('0x48')]['id'];}return db[_0xe326('0x2b')][_0xe326('0x46')]({'where':{'id':_0x25c2ce[_0xe326('0x44')]['id']}})[_0xe326('0x23')](handleEntityNotFound(_0x3bf067,null))[_0xe326('0x23')](saveUpdates(_0x25c2ce[_0xe326('0x48')],null))[_0xe326('0x23')](respondWithResult(_0x3bf067,null))[_0xe326('0x42')](handleError(_0x3bf067,null));};exports[_0xe326('0x24')]=function(_0x44aa11,_0x9fd5cf){return db[_0xe326('0x2b')][_0xe326('0x46')]({'where':{'id':_0x44aa11[_0xe326('0x44')]['id']}})[_0xe326('0x23')](handleEntityNotFound(_0x9fd5cf,null))[_0xe326('0x23')](removeEntity(_0x9fd5cf,null))[_0xe326('0x42')](handleError(_0x9fd5cf,null));}; \ No newline at end of file +var _0x071d=['attributes','intersection','fields','length','nolimit','order','sort','filter','merge','where','VIRTUAL','findAll','rows','catch','rawAttributes','includeAll','include','find','create','body','update','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','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','sendStatus','end','status','offset','undefined','limit','count','set','reject','save','destroy','then','error','stack','name','send','index','map','ServicenowField','fieldName','type','model','keys','query','filters'];(function(_0xfb3606,_0x498aeb){var _0x3843ae=function(_0x547e9b){while(--_0x547e9b){_0xfb3606['push'](_0xfb3606['shift']());}};_0x3843ae(++_0x498aeb);}(_0x071d,0xf1));var _0xd071=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x071d[_0x36c5b0];return _0xf19333;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd071('0x0'));var zipdir=require(_0xd071('0x1'));var jsonpatch=require(_0xd071('0x2'));var rp=require(_0xd071('0x3'));var moment=require(_0xd071('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd071('0x5'));var path=require('path');var sox=require(_0xd071('0x6'));var csv=require(_0xd071('0x7'));var ejs=require(_0xd071('0x8'));var fs=require('fs');var fs_extra=require(_0xd071('0x9'));var _=require(_0xd071('0xa'));var squel=require(_0xd071('0xb'));var crypto=require(_0xd071('0xc'));var jsforce=require(_0xd071('0xd'));var deskjs=require(_0xd071('0xe'));var toCsv=require(_0xd071('0x7'));var querystring=require(_0xd071('0xf'));var Papa=require(_0xd071('0x10'));var Redis=require(_0xd071('0x11'));var authService=require(_0xd071('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd071('0x13'));var hardwareService=require(_0xd071('0x14'));var logger=require(_0xd071('0x15'))(_0xd071('0x16'));var utils=require(_0xd071('0x17'));var config=require(_0xd071('0x18'));var licenseUtil=require(_0xd071('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4009f8,_0x3007f6){_0x3007f6=_0x3007f6||0xcc;return function(_0x121164){if(_0x121164){return _0x4009f8[_0xd071('0x1a')](_0x3007f6);}return _0x4009f8['status'](_0x3007f6)[_0xd071('0x1b')]();};}function respondWithResult(_0x280d51,_0x255140){_0x255140=_0x255140||0xc8;return function(_0x1a6cb2){if(_0x1a6cb2){return _0x280d51[_0xd071('0x1c')](_0x255140)['json'](_0x1a6cb2);}};}function respondWithFilteredResult(_0x2f02e9,_0x5dd4e4){return function(_0x124e98){if(_0x124e98){var _0x538f71=typeof _0x5dd4e4[_0xd071('0x1d')]===_0xd071('0x1e')&&typeof _0x5dd4e4[_0xd071('0x1f')]==='undefined';var _0x5c02f7=_0x124e98[_0xd071('0x20')];var _0x37ab02=_0x538f71?0x0:_0x5dd4e4[_0xd071('0x1d')];var _0xdfdfe9=_0x538f71?_0x124e98['count']:_0x5dd4e4[_0xd071('0x1d')]+_0x5dd4e4[_0xd071('0x1f')];var _0x457c19;if(_0xdfdfe9>=_0x5c02f7){_0xdfdfe9=_0x5c02f7;_0x457c19=0xc8;}else{_0x457c19=0xce;}_0x2f02e9['status'](_0x457c19);return _0x2f02e9[_0xd071('0x21')]('Content-Range',_0x37ab02+'-'+_0xdfdfe9+'/'+_0x5c02f7)['json'](_0x124e98);}return null;};}function patchUpdates(_0x3ad4c9){return function(_0x2f6aaa){try{jsonpatch['apply'](_0x2f6aaa,_0x3ad4c9,!![]);}catch(_0x5f4405){return BPromise[_0xd071('0x22')](_0x5f4405);}return _0x2f6aaa[_0xd071('0x23')]();};}function saveUpdates(_0x4c463e,_0x3172fb){return function(_0x16494f){if(_0x16494f){return _0x16494f['update'](_0x4c463e)['then'](function(_0x3f2cce){return _0x3f2cce;});}return null;};}function removeEntity(_0x3e6f61,_0x5749c2){return function(_0x221d98){if(_0x221d98){return _0x221d98[_0xd071('0x24')]()[_0xd071('0x25')](function(){_0x3e6f61[_0xd071('0x1c')](0xcc)[_0xd071('0x1b')]();});}};}function handleEntityNotFound(_0x10e5ba,_0x429b69){return function(_0x53f916){if(!_0x53f916){_0x10e5ba[_0xd071('0x1a')](0x194);}return _0x53f916;};}function handleError(_0x30bfba,_0x328748){_0x328748=_0x328748||0x1f4;return function(_0x19b4b7){logger[_0xd071('0x26')](_0x19b4b7[_0xd071('0x27')]);if(_0x19b4b7[_0xd071('0x28')]){delete _0x19b4b7[_0xd071('0x28')];}_0x30bfba['status'](_0x328748)[_0xd071('0x29')](_0x19b4b7);};}exports[_0xd071('0x2a')]=function(_0x140e36,_0x207f8c){var _0x30793c={},_0x40dd63={},_0x39b5d1={'count':0x0,'rows':[]};var _0x1d1969=_[_0xd071('0x2b')](db[_0xd071('0x2c')]['rawAttributes'],function(_0x29759b){return{'name':_0x29759b[_0xd071('0x2d')],'type':_0x29759b[_0xd071('0x2e')]['key']};});_0x40dd63[_0xd071('0x2f')]=_[_0xd071('0x2b')](_0x1d1969,'name');_0x40dd63['query']=_[_0xd071('0x30')](_0x140e36[_0xd071('0x31')]);_0x40dd63[_0xd071('0x32')]=_['intersection'](_0x40dd63[_0xd071('0x2f')],_0x40dd63[_0xd071('0x31')]);_0x30793c[_0xd071('0x33')]=_[_0xd071('0x34')](_0x40dd63['model'],qs[_0xd071('0x35')](_0x140e36['query']['fields']));_0x30793c[_0xd071('0x33')]=_0x30793c[_0xd071('0x33')][_0xd071('0x36')]?_0x30793c[_0xd071('0x33')]:_0x40dd63[_0xd071('0x2f')];if(!_0x140e36['query']['hasOwnProperty'](_0xd071('0x37'))){_0x30793c[_0xd071('0x1f')]=qs['limit'](_0x140e36['query'][_0xd071('0x1f')]);_0x30793c[_0xd071('0x1d')]=qs[_0xd071('0x1d')](_0x140e36[_0xd071('0x31')]['offset']);}_0x30793c[_0xd071('0x38')]=qs[_0xd071('0x39')](_0x140e36[_0xd071('0x31')]['sort']);_0x30793c['where']=qs[_0xd071('0x32')](_['pick'](_0x140e36['query'],_0x40dd63[_0xd071('0x32')]),_0x1d1969);if(_0x140e36[_0xd071('0x31')][_0xd071('0x3a')]){_0x30793c['where']=_[_0xd071('0x3b')](_0x30793c[_0xd071('0x3c')],{'$or':_['map'](_0x1d1969,function(_0xef02cb){if(_0xef02cb[_0xd071('0x2e')]!==_0xd071('0x3d')){var _0x4ecee5={};_0x4ecee5[_0xef02cb['name']]={'$like':'%'+_0x140e36['query'][_0xd071('0x3a')]+'%'};return _0x4ecee5;}})});}_0x30793c=_['merge']({},_0x30793c,_0x140e36['options']);var _0x644356={'where':_0x30793c[_0xd071('0x3c')]};return db[_0xd071('0x2c')][_0xd071('0x20')](_0x644356)['then'](function(_0x20ade4){_0x39b5d1[_0xd071('0x20')]=_0x20ade4;if(_0x140e36[_0xd071('0x31')]['includeAll']){_0x30793c['include']=[{'all':!![]}];}return db[_0xd071('0x2c')][_0xd071('0x3e')](_0x30793c);})[_0xd071('0x25')](function(_0x5230cf){_0x39b5d1[_0xd071('0x3f')]=_0x5230cf;return _0x39b5d1;})[_0xd071('0x25')](respondWithFilteredResult(_0x207f8c,_0x30793c))[_0xd071('0x40')](handleError(_0x207f8c,null));};exports['show']=function(_0x39996f,_0x5452ed){var _0x2a27f8={'raw':!![],'where':{'id':_0x39996f['params']['id']}},_0x506bbd={};_0x506bbd['model']=_[_0xd071('0x30')](db[_0xd071('0x2c')][_0xd071('0x41')]);_0x506bbd[_0xd071('0x31')]=_[_0xd071('0x30')](_0x39996f[_0xd071('0x31')]);_0x506bbd[_0xd071('0x32')]=_[_0xd071('0x34')](_0x506bbd['model'],_0x506bbd[_0xd071('0x31')]);_0x2a27f8[_0xd071('0x33')]=_[_0xd071('0x34')](_0x506bbd[_0xd071('0x2f')],qs[_0xd071('0x35')](_0x39996f[_0xd071('0x31')]['fields']));_0x2a27f8['attributes']=_0x2a27f8[_0xd071('0x33')][_0xd071('0x36')]?_0x2a27f8['attributes']:_0x506bbd[_0xd071('0x2f')];if(_0x39996f[_0xd071('0x31')][_0xd071('0x42')]){_0x2a27f8[_0xd071('0x43')]=[{'all':!![]}];}_0x2a27f8=_[_0xd071('0x3b')]({},_0x2a27f8,_0x39996f['options']);return db['ServicenowField'][_0xd071('0x44')](_0x2a27f8)[_0xd071('0x25')](handleEntityNotFound(_0x5452ed,null))[_0xd071('0x25')](respondWithResult(_0x5452ed,null))[_0xd071('0x40')](handleError(_0x5452ed,null));};exports['create']=function(_0x472ac4,_0xe0e0fa){return db[_0xd071('0x2c')][_0xd071('0x45')](_0x472ac4[_0xd071('0x46')],{})[_0xd071('0x25')](respondWithResult(_0xe0e0fa,0xc9))['catch'](handleError(_0xe0e0fa,null));};exports[_0xd071('0x47')]=function(_0x2c52ad,_0x44386e){if(_0x2c52ad[_0xd071('0x46')]['id']){delete _0x2c52ad[_0xd071('0x46')]['id'];}return db[_0xd071('0x2c')]['find']({'where':{'id':_0x2c52ad[_0xd071('0x48')]['id']}})['then'](handleEntityNotFound(_0x44386e,null))[_0xd071('0x25')](saveUpdates(_0x2c52ad[_0xd071('0x46')],null))['then'](respondWithResult(_0x44386e,null))[_0xd071('0x40')](handleError(_0x44386e,null));};exports[_0xd071('0x24')]=function(_0x1e971b,_0x2c3c9e){return db[_0xd071('0x2c')][_0xd071('0x44')]({'where':{'id':_0x1e971b[_0xd071('0x48')]['id']}})[_0xd071('0x25')](handleEntityNotFound(_0x2c3c9e,null))['then'](removeEntity(_0x2c3c9e,null))['catch'](handleError(_0x2c3c9e,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 969d2f2..c121127 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 _0x18a6=['../../config/environment','./intServicenowField.attributes','exports','ServicenowField','servicenow_unique_index','FieldId','lodash','../../config/logger','api','moment','path','rimraf'];(function(_0x54f322,_0x24a660){var _0xb0a1d5=function(_0x523587){while(--_0x523587){_0x54f322['push'](_0x54f322['shift']());}};_0xb0a1d5(++_0x24a660);}(_0x18a6,0xba));var _0x618a=function(_0x2ea9b8,_0x5ee8af){_0x2ea9b8=_0x2ea9b8-0x0;var _0x425429=_0x18a6[_0x2ea9b8];return _0x425429;};'use strict';var _=require(_0x618a('0x0'));var util=require('util');var logger=require(_0x618a('0x1'))(_0x618a('0x2'));var moment=require(_0x618a('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x618a('0x4'));var rimraf=require(_0x618a('0x5'));var config=require(_0x618a('0x6'));var attributes=require(_0x618a('0x7'));module[_0x618a('0x8')]=function(_0x4fd983,_0x4aa9d6){return _0x4fd983['define'](_0x618a('0x9'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0x618a('0xa'),'fields':['idField',_0x618a('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa0e0=['int_servicenow_fields','servicenow_unique_index','idField','lodash','util','api','moment','bluebird','path','rimraf','exports','define','ServicenowField'];(function(_0x14af1f,_0x329663){var _0x18e654=function(_0x2f42b4){while(--_0x2f42b4){_0x14af1f['push'](_0x14af1f['shift']());}};_0x18e654(++_0x329663);}(_0xa0e0,0xc6));var _0x0a0e=function(_0xfa2824,_0x3190f){_0xfa2824=_0xfa2824-0x0;var _0x56ec71=_0xa0e0[_0xfa2824];return _0x56ec71;};'use strict';var _=require(_0x0a0e('0x0'));var util=require(_0x0a0e('0x1'));var logger=require('../../config/logger')(_0x0a0e('0x2'));var moment=require(_0x0a0e('0x3'));var BPromise=require(_0x0a0e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a0e('0x5'));var rimraf=require(_0x0a0e('0x6'));var config=require('../../config/environment');var attributes=require('./intServicenowField.attributes');module[_0x0a0e('0x7')]=function(_0x53db73,_0x5131a3){return _0x53db73[_0x0a0e('0x8')](_0x0a0e('0x9'),attributes,{'tableName':_0x0a0e('0xa'),'paranoid':![],'indexes':[{'name':_0x0a0e('0xb'),'fields':[_0x0a0e('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index d375c06..4aafa93 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 _0xbdb7=['request\x20sent','debug','ServicenowField,\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','ServicenowField,\x20%s,\x20%s'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x8a654b,_0x4be2f9){_0x8a654b=_0x8a654b-0x0;var _0x94bfbb=_0xbdb7[_0x8a654b];return _0x94bfbb;};'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 _0xac4a=['ServicenowField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then','info','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xac4a,0x13f));var _0xaac4=function(_0x199c63,_0x2858c3){_0x199c63=_0x199c63-0x0;var _0x10e1f8=_0xac4a[_0x199c63];return _0x10e1f8;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var moment=require(_0xaac4('0x2'));var BPromise=require(_0xaac4('0x3'));var rs=require(_0xaac4('0x4'));var fs=require('fs');var Redis=require(_0xaac4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaac4('0x6'))(_0xaac4('0x7'));var config=require(_0xaac4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaac4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cdfc5,_0x5870e8,_0x1e4283){return new BPromise(function(_0x27354c,_0x567295){return client['request'](_0x1cdfc5,_0x1e4283)[_0xaac4('0xa')](function(_0x50d114){logger[_0xaac4('0xb')]('ServicenowField,\x20%s,\x20%s',_0x5870e8,'request\x20sent');logger[_0xaac4('0xc')](_0xaac4('0xd'),_0x5870e8,_0xaac4('0xe'),JSON[_0xaac4('0xf')](_0x50d114));if(_0x50d114[_0xaac4('0x10')]){if(_0x50d114['error']['code']===0x1f4){logger[_0xaac4('0x10')](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')]['message']);return _0x567295(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}logger['error'](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);return _0x27354c(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}else{logger[_0xaac4('0xb')](_0xaac4('0x11'),_0x5870e8,_0xaac4('0xe'));_0x27354c(_0x50d114[_0xaac4('0x13')][_0xaac4('0x12')]);}})[_0xaac4('0x14')](function(_0x1766c2){logger[_0xaac4('0x10')]('ServicenowField,\x20%s,\x20%s',_0x5870e8,_0x1766c2);_0x567295(_0x1766c2);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 2a26c0c..3a69650 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(_0x5114dd,_0x5ac835){var _0x48f193=function(_0x169e85){while(--_0x169e85){_0x5114dd['push'](_0x5114dd['shift']());}};_0x48f193(++_0x5ac835);}(_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('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(_0x22ed24,_0x4e0760){var _0x99d680=function(_0x3fd035){while(--_0x3fd035){_0x22ed24['push'](_0x22ed24['shift']());}};_0x99d680(++_0x4e0760);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 3e17e00..ae8a4ea 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(_0xf65f98,_0x3e3383){var _0x58f81d=function(_0x12ea19){while(--_0x12ea19){_0xf65f98['push'](_0xf65f98['shift']());}};_0x58f81d(++_0x3e3383);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'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(_0x5eb17f,_0x387c88){var _0x44376e=function(_0x42016e){while(--_0x42016e){_0x5eb17f['push'](_0x5eb17f['shift']());}};_0x44376e(++_0x387c88);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'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 10bd621..318b9f1 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 _0x34eb=['value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','end','stack','name','send','index','map','type','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','SugarcrmAccount','findAll','rows','catch','params','rawAttributes','find','create','body','getConfigurations','findOne','SugarcrmConfiguration','order','pick','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','Subjects','SugarcrmField','assigned_user_id','created_by','description','date_start','duration_minutes','parent_id','parent_type','direction','username','password','remoteUri','slice','substring','lastIndexOf','format','/service/v4_1/rest.php','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','POST','%s%s','get_module_fields','Calls','values','module_fields','remove','includes','label','endsWith'];(function(_0x1df341,_0x19aa3c){var _0x210a6f=function(_0x353178){while(--_0x353178){_0x1df341['push'](_0x1df341['shift']());}};_0x210a6f(++_0x19aa3c);}(_0x34eb,0x180));var _0xb34e=function(_0x46f03f,_0x1430cf){_0x46f03f=_0x46f03f-0x0;var _0x4b7395=_0x34eb[_0x46f03f];return _0x4b7395;};'use strict';var emlformat=require(_0xb34e('0x0'));var rimraf=require(_0xb34e('0x1'));var zipdir=require(_0xb34e('0x2'));var jsonpatch=require(_0xb34e('0x3'));var rp=require('request-promise');var moment=require(_0xb34e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb34e('0x5'));var util=require(_0xb34e('0x6'));var path=require(_0xb34e('0x7'));var sox=require(_0xb34e('0x8'));var csv=require(_0xb34e('0x9'));var ejs=require(_0xb34e('0xa'));var fs=require('fs');var fs_extra=require(_0xb34e('0xb'));var _=require('lodash');var squel=require(_0xb34e('0xc'));var crypto=require(_0xb34e('0xd'));var jsforce=require(_0xb34e('0xe'));var deskjs=require(_0xb34e('0xf'));var toCsv=require(_0xb34e('0x9'));var querystring=require(_0xb34e('0x10'));var Papa=require(_0xb34e('0x11'));var Redis=require(_0xb34e('0x12'));var authService=require(_0xb34e('0x13'));var qs=require(_0xb34e('0x14'));var as=require(_0xb34e('0x15'));var hardwareService=require(_0xb34e('0x16'));var logger=require(_0xb34e('0x17'))('api');var utils=require(_0xb34e('0x18'));var config=require(_0xb34e('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xb34e('0x1a'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x321a36,_0x2d18eb){_0x2d18eb=_0x2d18eb||0xcc;return function(_0x414c5c){if(_0x414c5c){return _0x321a36[_0xb34e('0x1b')](_0x2d18eb);}return _0x321a36[_0xb34e('0x1c')](_0x2d18eb)['end']();};}function respondWithResult(_0x58b58c,_0x1b1753){_0x1b1753=_0x1b1753||0xc8;return function(_0x43eacd){if(_0x43eacd){return _0x58b58c[_0xb34e('0x1c')](_0x1b1753)['json'](_0x43eacd);}};}function respondWithFilteredResult(_0x412edd,_0x5dd172){return function(_0x81967c){if(_0x81967c){var _0x2ea1f9=typeof _0x5dd172[_0xb34e('0x1d')]===_0xb34e('0x1e')&&typeof _0x5dd172['limit']===_0xb34e('0x1e');var _0x48fad6=_0x81967c[_0xb34e('0x1f')];var _0x11a0c2=_0x2ea1f9?0x0:_0x5dd172[_0xb34e('0x1d')];var _0x2d88e4=_0x2ea1f9?_0x81967c[_0xb34e('0x1f')]:_0x5dd172[_0xb34e('0x1d')]+_0x5dd172[_0xb34e('0x20')];var _0x2d29d0;if(_0x2d88e4>=_0x48fad6){_0x2d88e4=_0x48fad6;_0x2d29d0=0xc8;}else{_0x2d29d0=0xce;}_0x412edd[_0xb34e('0x1c')](_0x2d29d0);return _0x412edd[_0xb34e('0x21')](_0xb34e('0x22'),_0x11a0c2+'-'+_0x2d88e4+'/'+_0x48fad6)[_0xb34e('0x23')](_0x81967c);}return null;};}function patchUpdates(_0x1ec468){return function(_0x39f889){try{jsonpatch[_0xb34e('0x24')](_0x39f889,_0x1ec468,!![]);}catch(_0x129915){return BPromise[_0xb34e('0x25')](_0x129915);}return _0x39f889[_0xb34e('0x26')]();};}function saveUpdates(_0x3db1d4,_0x264c0f){return function(_0x328e23){if(_0x328e23){return _0x328e23[_0xb34e('0x27')](_0x3db1d4)['then'](function(_0x101de2){return _0x101de2;});}return null;};}function removeEntity(_0x1151c1,_0x130579){return function(_0x3219c4){if(_0x3219c4){return _0x3219c4[_0xb34e('0x28')]()[_0xb34e('0x29')](function(){_0x1151c1[_0xb34e('0x1c')](0xcc)[_0xb34e('0x2a')]();});}};}function handleEntityNotFound(_0x47ce49,_0x1b14c0){return function(_0x5c390e){if(!_0x5c390e){_0x47ce49['sendStatus'](0x194);}return _0x5c390e;};}function handleError(_0x1aee4f,_0x2d2615){_0x2d2615=_0x2d2615||0x1f4;return function(_0xdb89dc){logger['error'](_0xdb89dc[_0xb34e('0x2b')]);if(_0xdb89dc[_0xb34e('0x2c')]){delete _0xdb89dc['name'];}_0x1aee4f['status'](_0x2d2615)[_0xb34e('0x2d')](_0xdb89dc);};}exports[_0xb34e('0x2e')]=function(_0x4bab89,_0x3776c8){var _0x14e87a={},_0x40a5db={},_0xbb4e0a={'count':0x0,'rows':[]};var _0x2a21d9=_[_0xb34e('0x2f')](db['SugarcrmAccount']['rawAttributes'],function(_0x4a2868){return{'name':_0x4a2868['fieldName'],'type':_0x4a2868[_0xb34e('0x30')]['key']};});_0x40a5db['model']=_[_0xb34e('0x2f')](_0x2a21d9,_0xb34e('0x2c'));_0x40a5db['query']=_[_0xb34e('0x31')](_0x4bab89[_0xb34e('0x32')]);_0x40a5db[_0xb34e('0x33')]=_['intersection'](_0x40a5db[_0xb34e('0x34')],_0x40a5db[_0xb34e('0x32')]);_0x14e87a[_0xb34e('0x35')]=_[_0xb34e('0x36')](_0x40a5db[_0xb34e('0x34')],qs[_0xb34e('0x37')](_0x4bab89[_0xb34e('0x32')][_0xb34e('0x37')]));_0x14e87a[_0xb34e('0x35')]=_0x14e87a[_0xb34e('0x35')][_0xb34e('0x38')]?_0x14e87a[_0xb34e('0x35')]:_0x40a5db[_0xb34e('0x34')];if(!_0x4bab89[_0xb34e('0x32')][_0xb34e('0x39')](_0xb34e('0x3a'))){_0x14e87a[_0xb34e('0x20')]=qs['limit'](_0x4bab89['query'][_0xb34e('0x20')]);_0x14e87a[_0xb34e('0x1d')]=qs[_0xb34e('0x1d')](_0x4bab89['query'][_0xb34e('0x1d')]);}_0x14e87a['order']=qs['sort'](_0x4bab89[_0xb34e('0x32')][_0xb34e('0x3b')]);_0x14e87a[_0xb34e('0x3c')]=qs[_0xb34e('0x33')](_['pick'](_0x4bab89[_0xb34e('0x32')],_0x40a5db[_0xb34e('0x33')]),_0x2a21d9);if(_0x4bab89[_0xb34e('0x32')][_0xb34e('0x3d')]){_0x14e87a[_0xb34e('0x3c')]=_[_0xb34e('0x3e')](_0x14e87a['where'],{'$or':_['map'](_0x2a21d9,function(_0x5526bb){if(_0x5526bb['type']!==_0xb34e('0x3f')){var _0x537c10={};_0x537c10[_0x5526bb[_0xb34e('0x2c')]]={'$like':'%'+_0x4bab89[_0xb34e('0x32')][_0xb34e('0x3d')]+'%'};return _0x537c10;}})});}_0x14e87a=_[_0xb34e('0x3e')]({},_0x14e87a,_0x4bab89[_0xb34e('0x40')]);var _0x3a752c={'where':_0x14e87a[_0xb34e('0x3c')]};return db[_0xb34e('0x41')][_0xb34e('0x1f')](_0x3a752c)['then'](function(_0x1db8d3){_0xbb4e0a[_0xb34e('0x1f')]=_0x1db8d3;if(_0x4bab89['query']['includeAll']){_0x14e87a['include']=[{'all':!![]}];}return db[_0xb34e('0x41')][_0xb34e('0x42')](_0x14e87a);})[_0xb34e('0x29')](function(_0x3cceac){_0xbb4e0a[_0xb34e('0x43')]=_0x3cceac;return _0xbb4e0a;})['then'](respondWithFilteredResult(_0x3776c8,_0x14e87a))[_0xb34e('0x44')](handleError(_0x3776c8,null));};exports['show']=function(_0x4a5a56,_0x569133){var _0xd1b24e={'raw':![],'where':{'id':_0x4a5a56[_0xb34e('0x45')]['id']}},_0x323ae0={};_0x323ae0[_0xb34e('0x34')]=_['keys'](db[_0xb34e('0x41')][_0xb34e('0x46')]);_0x323ae0[_0xb34e('0x32')]=_[_0xb34e('0x31')](_0x4a5a56[_0xb34e('0x32')]);_0x323ae0['filters']=_['intersection'](_0x323ae0[_0xb34e('0x34')],_0x323ae0[_0xb34e('0x32')]);_0xd1b24e['attributes']=_[_0xb34e('0x36')](_0x323ae0[_0xb34e('0x34')],qs[_0xb34e('0x37')](_0x4a5a56['query'][_0xb34e('0x37')]));_0xd1b24e[_0xb34e('0x35')]=_0xd1b24e[_0xb34e('0x35')][_0xb34e('0x38')]?_0xd1b24e[_0xb34e('0x35')]:_0x323ae0[_0xb34e('0x34')];if(_0x4a5a56['query']['includeAll']){_0xd1b24e['include']=[{'all':!![]}];}_0xd1b24e=_[_0xb34e('0x3e')]({},_0xd1b24e,_0x4a5a56[_0xb34e('0x40')]);return db[_0xb34e('0x41')][_0xb34e('0x47')](_0xd1b24e)[_0xb34e('0x29')](handleEntityNotFound(_0x569133,null))[_0xb34e('0x29')](respondWithResult(_0x569133,null))['catch'](handleError(_0x569133,null));};exports['create']=function(_0x523373,_0x4a575f){return db[_0xb34e('0x41')][_0xb34e('0x48')](_0x523373[_0xb34e('0x49')],{})[_0xb34e('0x29')](respondWithResult(_0x4a575f,0xc9))[_0xb34e('0x44')](handleError(_0x4a575f,null));};exports['update']=function(_0x11b787,_0x3d016b){if(_0x11b787[_0xb34e('0x49')]['id']){delete _0x11b787[_0xb34e('0x49')]['id'];}return db[_0xb34e('0x41')][_0xb34e('0x47')]({'where':{'id':_0x11b787[_0xb34e('0x45')]['id']}})['then'](handleEntityNotFound(_0x3d016b,null))['then'](saveUpdates(_0x11b787[_0xb34e('0x49')],null))[_0xb34e('0x29')](respondWithResult(_0x3d016b,null))['catch'](handleError(_0x3d016b,null));};exports[_0xb34e('0x28')]=function(_0x5a6dda,_0x3bab11){return db[_0xb34e('0x41')]['find']({'where':{'id':_0x5a6dda[_0xb34e('0x45')]['id']}})[_0xb34e('0x29')](handleEntityNotFound(_0x3bab11,null))[_0xb34e('0x29')](removeEntity(_0x3bab11,null))[_0xb34e('0x44')](handleError(_0x3bab11,null));};exports[_0xb34e('0x4a')]=function(_0x17d0ea,_0x5627c9,_0x5368ea){var _0x54c0da={};var _0x1ac29f={};var _0x50ef12;var _0x2549a4;return db[_0xb34e('0x41')][_0xb34e('0x4b')]({'where':{'id':_0x17d0ea['params']['id']}})['then'](handleEntityNotFound(_0x5627c9,null))[_0xb34e('0x29')](function(_0x161509){if(_0x161509){_0x50ef12=_0x161509;_0x1ac29f[_0xb34e('0x34')]=_[_0xb34e('0x31')](db[_0xb34e('0x4c')][_0xb34e('0x46')]);_0x1ac29f[_0xb34e('0x32')]=_[_0xb34e('0x31')](_0x17d0ea[_0xb34e('0x32')]);_0x1ac29f[_0xb34e('0x33')]=_[_0xb34e('0x36')](_0x1ac29f[_0xb34e('0x34')],_0x1ac29f[_0xb34e('0x32')]);_0x54c0da[_0xb34e('0x35')]=_[_0xb34e('0x36')](_0x1ac29f[_0xb34e('0x34')],qs[_0xb34e('0x37')](_0x17d0ea[_0xb34e('0x32')][_0xb34e('0x37')]));_0x54c0da[_0xb34e('0x35')]=_0x54c0da[_0xb34e('0x35')]['length']?_0x54c0da[_0xb34e('0x35')]:_0x1ac29f[_0xb34e('0x34')];_0x54c0da[_0xb34e('0x4d')]=qs[_0xb34e('0x3b')](_0x17d0ea[_0xb34e('0x32')][_0xb34e('0x3b')]);_0x54c0da['where']=qs[_0xb34e('0x33')](_[_0xb34e('0x4e')](_0x17d0ea[_0xb34e('0x32')],_0x1ac29f[_0xb34e('0x33')]));if(_0x17d0ea[_0xb34e('0x32')][_0xb34e('0x3d')]){_0x54c0da[_0xb34e('0x3c')]=_[_0xb34e('0x3e')](_0x54c0da[_0xb34e('0x3c')],{'$or':_['map'](_0x54c0da[_0xb34e('0x35')],function(_0x4d1c80){var _0x4a0853={};_0x4a0853[_0x4d1c80]={'$like':'%'+_0x17d0ea[_0xb34e('0x32')][_0xb34e('0x3d')]+'%'};return _0x4a0853;})});}_0x54c0da=_[_0xb34e('0x3e')]({},_0x54c0da,_0x17d0ea[_0xb34e('0x40')]);return _0x50ef12['getConfigurations'](_0x54c0da);}})[_0xb34e('0x29')](function(_0x2b4f2b){if(_0x2b4f2b){_0x2549a4=_0x2b4f2b[_0xb34e('0x38')];if(!_0x17d0ea['query'][_0xb34e('0x39')]('nolimit')){_0x54c0da[_0xb34e('0x20')]=qs['limit'](_0x17d0ea[_0xb34e('0x32')][_0xb34e('0x20')]);_0x54c0da[_0xb34e('0x1d')]=qs[_0xb34e('0x1d')](_0x17d0ea[_0xb34e('0x32')]['offset']);}return _0x50ef12[_0xb34e('0x4a')](_0x54c0da);}})[_0xb34e('0x29')](function(_0x118bbf){if(_0x118bbf){return _0x118bbf?{'count':_0x2549a4,'rows':_0x118bbf}:null;}})['then'](respondWithResult(_0x5627c9,null))['catch'](handleError(_0x5627c9,null));};exports[_0xb34e('0x4f')]=function(_0x1aaa08,_0x3bb1f4,_0x2d7acf){if(_0x1aaa08[_0xb34e('0x49')]['id']){delete _0x1aaa08[_0xb34e('0x49')]['id'];}return db[_0xb34e('0x41')][_0xb34e('0x4b')]({'where':{'id':_0x1aaa08['params']['id']}})[_0xb34e('0x29')](handleEntityNotFound(_0x3bb1f4,null))[_0xb34e('0x29')](function(_0x40cb43){if(_0x40cb43){_0x1aaa08[_0xb34e('0x49')][_0xb34e('0x50')]=_0x40cb43['id'];_0x1aaa08[_0xb34e('0x49')]['Subjects']=integrations[_0xb34e('0x51')](_0x1aaa08[_0xb34e('0x49')][_0xb34e('0x52')],_0x1aaa08[_0xb34e('0x49')]['type']);_0x1aaa08['body'][_0xb34e('0x53')]=integrations[_0xb34e('0x54')](_0x1aaa08['body'][_0xb34e('0x52')],_0x1aaa08[_0xb34e('0x49')]['type']);return db[_0xb34e('0x4c')][_0xb34e('0x48')](_0x1aaa08[_0xb34e('0x49')],{'include':[{'model':db['SugarcrmField'],'as':_0xb34e('0x55')},{'model':db[_0xb34e('0x56')],'as':_0xb34e('0x53')}]});}return null;})[_0xb34e('0x29')](respondWithResult(_0x3bb1f4,null))['catch'](handleError(_0x3bb1f4,null));};exports['getFields']=function(_0x5e6a2f,_0x5495e8,_0xf19872){var _0x323072='';var _0x35a2fe=['id',_0xb34e('0x2c'),_0xb34e('0x57'),_0xb34e('0x58'),_0xb34e('0x59'),_0xb34e('0x5a'),'duration_hours',_0xb34e('0x5b'),_0xb34e('0x5c'),_0xb34e('0x5d'),'parent_name',_0xb34e('0x5e')];return db[_0xb34e('0x41')][_0xb34e('0x4b')]({'where':{'id':_0x5e6a2f[_0xb34e('0x45')]['id']},'attributes':['id',_0xb34e('0x5f'),_0xb34e('0x60'),_0xb34e('0x61')]})['then'](handleEntityNotFound(_0x5495e8,null))[_0xb34e('0x29')](function(_0x253bfd){if(_0x253bfd){_0x323072=_0x253bfd[_0xb34e('0x61')];var _0x3ca9e7=_0x323072[_0xb34e('0x62')](-0x1);if(_0x3ca9e7==='/'){_0x323072=_0x323072[_0xb34e('0x63')](0x0,_0x323072[_0xb34e('0x64')](_0x3ca9e7));}return rp({'method':'POST','uri':util[_0xb34e('0x65')]('%s%s',_0x323072,_0xb34e('0x66')),'json':!![],'form':{'method':_0xb34e('0x67'),'input_type':_0xb34e('0x68'),'response_type':'JSON','rest_data':JSON[_0xb34e('0x69')]({'user_auth':{'user_name':_0x253bfd[_0xb34e('0x5f')],'password':_0x253bfd[_0xb34e('0x60')],'encryption':_0xb34e('0x6a')},'application':_0xb34e('0x6b')})}});}})[_0xb34e('0x29')](function(_0x446c17){if(_0x446c17&&_0x446c17[_0xb34e('0x2c')]!==_0xb34e('0x6c')&&_0x446c17[_0xb34e('0x2c')]!==_0xb34e('0x6d')){return rp({'method':_0xb34e('0x6e'),'uri':util[_0xb34e('0x65')](_0xb34e('0x6f'),_0x323072,_0xb34e('0x66')),'json':!![],'form':{'method':_0xb34e('0x70'),'input_type':'JSON','response_type':_0xb34e('0x68'),'rest_data':JSON[_0xb34e('0x69')]({'session':_0x446c17['id'],'module_name':_0xb34e('0x71')})}})['then'](function(_0x361b84){if(_0x361b84){var _0x39ace4=_[_0xb34e('0x72')](_0x361b84[_0xb34e('0x73')]);_[_0xb34e('0x74')](_0x39ace4,function(_0x20f395){return _0x35a2fe[_0xb34e('0x75')](_0x20f395['name']);});return{'count':_0x39ace4['length'],'rows':_[_0xb34e('0x2f')](_0x39ace4,function(_0x21002f){return{'id':_0x21002f[_0xb34e('0x2c')],'name':_0x21002f[_0xb34e('0x76')],'custom':_[_0xb34e('0x77')](_0x21002f[_0xb34e('0x2c')],'_c')?!![]:![],'options':_0x21002f[_0xb34e('0x40')]?_[_0xb34e('0x2f')](_[_0xb34e('0x72')](_0x21002f[_0xb34e('0x40')]),function(_0x22b3ae){return{'name':_0x22b3ae[_0xb34e('0x78')],'value':_0x22b3ae['name']};}):[]};})};}})[_0xb34e('0x29')](respondWithResult(_0x5495e8,null))['catch'](function(_0x17728d){var _0x37df75=_0x5e6a2f['query'][_0xb34e('0x79')]?0x1f4:_0x17728d[_0xb34e('0x7a')]||0x1f4;logger['error'](_0xb34e('0x7b'),_0xb34e('0x7c'),_0x37df75,JSON[_0xb34e('0x69')](_0x17728d));delete _0x17728d[_0xb34e('0x2c')];if(_0x37df75===0x191){_0x37df75=0x190;}_0x5495e8['status'](_0x37df75)['send'](_0x5e6a2f[_0xb34e('0x32')][_0xb34e('0x79')]?{'message':_0xb34e('0x7d'),'statusCode':_0x17728d[_0xb34e('0x7a')]}:_0x17728d);});}else{var _0x45cb4a=0x1f4;_0x5495e8[_0xb34e('0x1c')](_0x45cb4a)['send']({'message':_0xb34e('0x7d'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x2289=['query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','create','body','find','getConfigurations','findOne','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmConfiguration','SugarcrmField','getFields','created_by','description','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','username','password','remoteUri','substring','POST','%s%s','/service/v4_1/rest.php','login','JSON','stringify','PLAIN','Invalid\x20Login','Password\x20Expired','format','get_module_fields','Calls','values','module_fields','includes','endsWith','value','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','name','index','map','SugarcrmAccount','rawAttributes','fieldName','type','key','model'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x2289,0xc6));var _0x9228=function(_0x586106,_0x23eba5){_0x586106=_0x586106-0x0;var _0x6be57f=_0x2289[_0x586106];return _0x6be57f;};'use strict';var emlformat=require(_0x9228('0x0'));var rimraf=require(_0x9228('0x1'));var zipdir=require(_0x9228('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9228('0x3'));var moment=require(_0x9228('0x4'));var BPromise=require(_0x9228('0x5'));var Mustache=require('mustache');var util=require(_0x9228('0x6'));var path=require(_0x9228('0x7'));var sox=require(_0x9228('0x8'));var csv=require(_0x9228('0x9'));var ejs=require(_0x9228('0xa'));var fs=require('fs');var fs_extra=require(_0x9228('0xb'));var _=require('lodash');var squel=require(_0x9228('0xc'));var crypto=require('crypto');var jsforce=require(_0x9228('0xd'));var deskjs=require(_0x9228('0xe'));var toCsv=require(_0x9228('0x9'));var querystring=require(_0x9228('0xf'));var Papa=require('papaparse');var Redis=require(_0x9228('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9228('0x11'));var as=require(_0x9228('0x12'));var hardwareService=require(_0x9228('0x13'));var logger=require(_0x9228('0x14'))(_0x9228('0x15'));var utils=require(_0x9228('0x16'));var config=require(_0x9228('0x17'));var licenseUtil=require(_0x9228('0x18'));var db=require(_0x9228('0x19'))['db'];var integrations=require(_0x9228('0x1a'));function respondWithStatusCode(_0xb14097,_0x33c43b){_0x33c43b=_0x33c43b||0xcc;return function(_0x345b2f){if(_0x345b2f){return _0xb14097[_0x9228('0x1b')](_0x33c43b);}return _0xb14097[_0x9228('0x1c')](_0x33c43b)['end']();};}function respondWithResult(_0x23f0e5,_0x35458d){_0x35458d=_0x35458d||0xc8;return function(_0x48cb10){if(_0x48cb10){return _0x23f0e5[_0x9228('0x1c')](_0x35458d)[_0x9228('0x1d')](_0x48cb10);}};}function respondWithFilteredResult(_0x18e348,_0x5ef825){return function(_0x37709a){if(_0x37709a){var _0x479e57=typeof _0x5ef825[_0x9228('0x1e')]===_0x9228('0x1f')&&typeof _0x5ef825[_0x9228('0x20')]===_0x9228('0x1f');var _0x146254=_0x37709a[_0x9228('0x21')];var _0x58d7a0=_0x479e57?0x0:_0x5ef825[_0x9228('0x1e')];var _0x11ea8b=_0x479e57?_0x37709a[_0x9228('0x21')]:_0x5ef825[_0x9228('0x1e')]+_0x5ef825[_0x9228('0x20')];var _0x4340de;if(_0x11ea8b>=_0x146254){_0x11ea8b=_0x146254;_0x4340de=0xc8;}else{_0x4340de=0xce;}_0x18e348[_0x9228('0x1c')](_0x4340de);return _0x18e348[_0x9228('0x22')]('Content-Range',_0x58d7a0+'-'+_0x11ea8b+'/'+_0x146254)[_0x9228('0x1d')](_0x37709a);}return null;};}function patchUpdates(_0x449e2e){return function(_0x4b4f3c){try{jsonpatch[_0x9228('0x23')](_0x4b4f3c,_0x449e2e,!![]);}catch(_0x5b355e){return BPromise[_0x9228('0x24')](_0x5b355e);}return _0x4b4f3c[_0x9228('0x25')]();};}function saveUpdates(_0x2c103b,_0x3004bc){return function(_0x184ed2){if(_0x184ed2){return _0x184ed2[_0x9228('0x26')](_0x2c103b)[_0x9228('0x27')](function(_0x4eed2e){return _0x4eed2e;});}return null;};}function removeEntity(_0x14e654,_0x4b22c3){return function(_0x3cfb0d){if(_0x3cfb0d){return _0x3cfb0d[_0x9228('0x28')]()[_0x9228('0x27')](function(){_0x14e654[_0x9228('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f3535,_0x22dffb){return function(_0x5b4be7){if(!_0x5b4be7){_0x2f3535[_0x9228('0x1b')](0x194);}return _0x5b4be7;};}function handleError(_0x57bb35,_0x58b420){_0x58b420=_0x58b420||0x1f4;return function(_0x330dc4){logger['error'](_0x330dc4['stack']);if(_0x330dc4[_0x9228('0x29')]){delete _0x330dc4['name'];}_0x57bb35['status'](_0x58b420)['send'](_0x330dc4);};}exports[_0x9228('0x2a')]=function(_0x1017ca,_0x3c5b42){var _0x4b7eb4={},_0x2f6cbf={},_0x180831={'count':0x0,'rows':[]};var _0x484a38=_[_0x9228('0x2b')](db[_0x9228('0x2c')][_0x9228('0x2d')],function(_0x53b2c4){return{'name':_0x53b2c4[_0x9228('0x2e')],'type':_0x53b2c4[_0x9228('0x2f')][_0x9228('0x30')]};});_0x2f6cbf[_0x9228('0x31')]=_[_0x9228('0x2b')](_0x484a38,_0x9228('0x29'));_0x2f6cbf[_0x9228('0x32')]=_[_0x9228('0x33')](_0x1017ca['query']);_0x2f6cbf[_0x9228('0x34')]=_[_0x9228('0x35')](_0x2f6cbf[_0x9228('0x31')],_0x2f6cbf['query']);_0x4b7eb4['attributes']=_['intersection'](_0x2f6cbf[_0x9228('0x31')],qs[_0x9228('0x36')](_0x1017ca[_0x9228('0x32')][_0x9228('0x36')]));_0x4b7eb4[_0x9228('0x37')]=_0x4b7eb4[_0x9228('0x37')][_0x9228('0x38')]?_0x4b7eb4[_0x9228('0x37')]:_0x2f6cbf['model'];if(!_0x1017ca[_0x9228('0x32')][_0x9228('0x39')](_0x9228('0x3a'))){_0x4b7eb4[_0x9228('0x20')]=qs[_0x9228('0x20')](_0x1017ca[_0x9228('0x32')][_0x9228('0x20')]);_0x4b7eb4['offset']=qs['offset'](_0x1017ca[_0x9228('0x32')][_0x9228('0x1e')]);}_0x4b7eb4[_0x9228('0x3b')]=qs[_0x9228('0x3c')](_0x1017ca[_0x9228('0x32')]['sort']);_0x4b7eb4[_0x9228('0x3d')]=qs['filters'](_[_0x9228('0x3e')](_0x1017ca['query'],_0x2f6cbf[_0x9228('0x34')]),_0x484a38);if(_0x1017ca[_0x9228('0x32')][_0x9228('0x3f')]){_0x4b7eb4[_0x9228('0x3d')]=_[_0x9228('0x40')](_0x4b7eb4[_0x9228('0x3d')],{'$or':_[_0x9228('0x2b')](_0x484a38,function(_0xbbe1ab){if(_0xbbe1ab[_0x9228('0x2f')]!==_0x9228('0x41')){var _0xd25fb1={};_0xd25fb1[_0xbbe1ab[_0x9228('0x29')]]={'$like':'%'+_0x1017ca[_0x9228('0x32')][_0x9228('0x3f')]+'%'};return _0xd25fb1;}})});}_0x4b7eb4=_[_0x9228('0x40')]({},_0x4b7eb4,_0x1017ca[_0x9228('0x42')]);var _0x5d194e={'where':_0x4b7eb4[_0x9228('0x3d')]};return db[_0x9228('0x2c')][_0x9228('0x21')](_0x5d194e)[_0x9228('0x27')](function(_0xd5ad24){_0x180831[_0x9228('0x21')]=_0xd5ad24;if(_0x1017ca[_0x9228('0x32')]['includeAll']){_0x4b7eb4[_0x9228('0x43')]=[{'all':!![]}];}return db[_0x9228('0x2c')][_0x9228('0x44')](_0x4b7eb4);})[_0x9228('0x27')](function(_0xe8b6a3){_0x180831[_0x9228('0x45')]=_0xe8b6a3;return _0x180831;})[_0x9228('0x27')](respondWithFilteredResult(_0x3c5b42,_0x4b7eb4))[_0x9228('0x46')](handleError(_0x3c5b42,null));};exports[_0x9228('0x47')]=function(_0x3c5792,_0x19b1a9){var _0x564eb7={'raw':![],'where':{'id':_0x3c5792[_0x9228('0x48')]['id']}},_0x7fc81b={};_0x7fc81b[_0x9228('0x31')]=_['keys'](db[_0x9228('0x2c')][_0x9228('0x2d')]);_0x7fc81b[_0x9228('0x32')]=_[_0x9228('0x33')](_0x3c5792['query']);_0x7fc81b[_0x9228('0x34')]=_['intersection'](_0x7fc81b[_0x9228('0x31')],_0x7fc81b[_0x9228('0x32')]);_0x564eb7[_0x9228('0x37')]=_['intersection'](_0x7fc81b[_0x9228('0x31')],qs[_0x9228('0x36')](_0x3c5792[_0x9228('0x32')][_0x9228('0x36')]));_0x564eb7['attributes']=_0x564eb7['attributes'][_0x9228('0x38')]?_0x564eb7[_0x9228('0x37')]:_0x7fc81b['model'];if(_0x3c5792['query'][_0x9228('0x49')]){_0x564eb7[_0x9228('0x43')]=[{'all':!![]}];}_0x564eb7=_['merge']({},_0x564eb7,_0x3c5792[_0x9228('0x42')]);return db[_0x9228('0x2c')]['find'](_0x564eb7)[_0x9228('0x27')](handleEntityNotFound(_0x19b1a9,null))[_0x9228('0x27')](respondWithResult(_0x19b1a9,null))[_0x9228('0x46')](handleError(_0x19b1a9,null));};exports['create']=function(_0x4b21df,_0x306640){return db['SugarcrmAccount'][_0x9228('0x4a')](_0x4b21df[_0x9228('0x4b')],{})['then'](respondWithResult(_0x306640,0xc9))[_0x9228('0x46')](handleError(_0x306640,null));};exports[_0x9228('0x26')]=function(_0x2b7c58,_0xdada7a){if(_0x2b7c58[_0x9228('0x4b')]['id']){delete _0x2b7c58[_0x9228('0x4b')]['id'];}return db[_0x9228('0x2c')][_0x9228('0x4c')]({'where':{'id':_0x2b7c58[_0x9228('0x48')]['id']}})[_0x9228('0x27')](handleEntityNotFound(_0xdada7a,null))[_0x9228('0x27')](saveUpdates(_0x2b7c58[_0x9228('0x4b')],null))['then'](respondWithResult(_0xdada7a,null))[_0x9228('0x46')](handleError(_0xdada7a,null));};exports['destroy']=function(_0x2e53a0,_0x1dca17){return db[_0x9228('0x2c')][_0x9228('0x4c')]({'where':{'id':_0x2e53a0['params']['id']}})[_0x9228('0x27')](handleEntityNotFound(_0x1dca17,null))['then'](removeEntity(_0x1dca17,null))[_0x9228('0x46')](handleError(_0x1dca17,null));};exports[_0x9228('0x4d')]=function(_0x592325,_0x45f9c3,_0x2ca96b){var _0xc4931c={};var _0x371002={};var _0x2b57d4;var _0x5d9dc9;return db[_0x9228('0x2c')][_0x9228('0x4e')]({'where':{'id':_0x592325['params']['id']}})[_0x9228('0x27')](handleEntityNotFound(_0x45f9c3,null))['then'](function(_0x5e47bc){if(_0x5e47bc){_0x2b57d4=_0x5e47bc;_0x371002[_0x9228('0x31')]=_['keys'](db['SugarcrmConfiguration'][_0x9228('0x2d')]);_0x371002[_0x9228('0x32')]=_[_0x9228('0x33')](_0x592325[_0x9228('0x32')]);_0x371002[_0x9228('0x34')]=_['intersection'](_0x371002[_0x9228('0x31')],_0x371002['query']);_0xc4931c[_0x9228('0x37')]=_[_0x9228('0x35')](_0x371002[_0x9228('0x31')],qs[_0x9228('0x36')](_0x592325[_0x9228('0x32')][_0x9228('0x36')]));_0xc4931c['attributes']=_0xc4931c[_0x9228('0x37')][_0x9228('0x38')]?_0xc4931c[_0x9228('0x37')]:_0x371002[_0x9228('0x31')];_0xc4931c[_0x9228('0x3b')]=qs['sort'](_0x592325[_0x9228('0x32')][_0x9228('0x3c')]);_0xc4931c[_0x9228('0x3d')]=qs[_0x9228('0x34')](_['pick'](_0x592325[_0x9228('0x32')],_0x371002['filters']));if(_0x592325[_0x9228('0x32')]['filter']){_0xc4931c[_0x9228('0x3d')]=_[_0x9228('0x40')](_0xc4931c['where'],{'$or':_[_0x9228('0x2b')](_0xc4931c[_0x9228('0x37')],function(_0x95b7f4){var _0x4f3990={};_0x4f3990[_0x95b7f4]={'$like':'%'+_0x592325['query'][_0x9228('0x3f')]+'%'};return _0x4f3990;})});}_0xc4931c=_[_0x9228('0x40')]({},_0xc4931c,_0x592325['options']);return _0x2b57d4[_0x9228('0x4d')](_0xc4931c);}})[_0x9228('0x27')](function(_0x578589){if(_0x578589){_0x5d9dc9=_0x578589[_0x9228('0x38')];if(!_0x592325[_0x9228('0x32')][_0x9228('0x39')](_0x9228('0x3a'))){_0xc4931c['limit']=qs['limit'](_0x592325[_0x9228('0x32')]['limit']);_0xc4931c[_0x9228('0x1e')]=qs[_0x9228('0x1e')](_0x592325[_0x9228('0x32')]['offset']);}return _0x2b57d4['getConfigurations'](_0xc4931c);}})[_0x9228('0x27')](function(_0x1f89e9){if(_0x1f89e9){return _0x1f89e9?{'count':_0x5d9dc9,'rows':_0x1f89e9}:null;}})[_0x9228('0x27')](respondWithResult(_0x45f9c3,null))[_0x9228('0x46')](handleError(_0x45f9c3,null));};exports[_0x9228('0x4f')]=function(_0x4e402a,_0x121059,_0x14a9b5){if(_0x4e402a[_0x9228('0x4b')]['id']){delete _0x4e402a[_0x9228('0x4b')]['id'];}return db[_0x9228('0x2c')][_0x9228('0x4e')]({'where':{'id':_0x4e402a[_0x9228('0x48')]['id']}})['then'](handleEntityNotFound(_0x121059,null))[_0x9228('0x27')](function(_0x20d790){if(_0x20d790){_0x4e402a['body'][_0x9228('0x50')]=_0x20d790['id'];_0x4e402a[_0x9228('0x4b')][_0x9228('0x51')]=integrations[_0x9228('0x52')](_0x4e402a[_0x9228('0x4b')][_0x9228('0x53')],_0x4e402a[_0x9228('0x4b')][_0x9228('0x2f')]);_0x4e402a[_0x9228('0x4b')][_0x9228('0x54')]=integrations[_0x9228('0x55')](_0x4e402a[_0x9228('0x4b')][_0x9228('0x53')],_0x4e402a[_0x9228('0x4b')][_0x9228('0x2f')]);return db[_0x9228('0x56')][_0x9228('0x4a')](_0x4e402a[_0x9228('0x4b')],{'include':[{'model':db[_0x9228('0x57')],'as':_0x9228('0x51')},{'model':db[_0x9228('0x57')],'as':_0x9228('0x54')}]});}return null;})[_0x9228('0x27')](respondWithResult(_0x121059,null))[_0x9228('0x46')](handleError(_0x121059,null));};exports[_0x9228('0x58')]=function(_0xa254be,_0x2be53c,_0x28280f){var _0x4b8b43='';var _0x4c378b=['id',_0x9228('0x29'),'assigned_user_id',_0x9228('0x59'),_0x9228('0x5a'),_0x9228('0x5b'),_0x9228('0x5c'),_0x9228('0x5d'),_0x9228('0x5e'),_0x9228('0x5f'),_0x9228('0x60'),_0x9228('0x61')];return db['SugarcrmAccount'][_0x9228('0x4e')]({'where':{'id':_0xa254be['params']['id']},'attributes':['id',_0x9228('0x62'),_0x9228('0x63'),'remoteUri']})['then'](handleEntityNotFound(_0x2be53c,null))[_0x9228('0x27')](function(_0x3b2425){if(_0x3b2425){_0x4b8b43=_0x3b2425[_0x9228('0x64')];var _0x43d322=_0x4b8b43['slice'](-0x1);if(_0x43d322==='/'){_0x4b8b43=_0x4b8b43[_0x9228('0x65')](0x0,_0x4b8b43['lastIndexOf'](_0x43d322));}return rp({'method':_0x9228('0x66'),'uri':util['format'](_0x9228('0x67'),_0x4b8b43,_0x9228('0x68')),'json':!![],'form':{'method':_0x9228('0x69'),'input_type':_0x9228('0x6a'),'response_type':_0x9228('0x6a'),'rest_data':JSON[_0x9228('0x6b')]({'user_auth':{'user_name':_0x3b2425['username'],'password':_0x3b2425[_0x9228('0x63')],'encryption':_0x9228('0x6c')},'application':'xCALLY\x20Motion\x20Integration'})}});}})['then'](function(_0xde9040){if(_0xde9040&&_0xde9040[_0x9228('0x29')]!==_0x9228('0x6d')&&_0xde9040[_0x9228('0x29')]!==_0x9228('0x6e')){return rp({'method':_0x9228('0x66'),'uri':util[_0x9228('0x6f')](_0x9228('0x67'),_0x4b8b43,_0x9228('0x68')),'json':!![],'form':{'method':_0x9228('0x70'),'input_type':_0x9228('0x6a'),'response_type':_0x9228('0x6a'),'rest_data':JSON['stringify']({'session':_0xde9040['id'],'module_name':_0x9228('0x71')})}})[_0x9228('0x27')](function(_0x41e668){if(_0x41e668){var _0x20ad7d=_[_0x9228('0x72')](_0x41e668[_0x9228('0x73')]);_['remove'](_0x20ad7d,function(_0x387789){return _0x4c378b[_0x9228('0x74')](_0x387789[_0x9228('0x29')]);});return{'count':_0x20ad7d[_0x9228('0x38')],'rows':_[_0x9228('0x2b')](_0x20ad7d,function(_0x1ce982){return{'id':_0x1ce982[_0x9228('0x29')],'name':_0x1ce982['label'],'custom':_[_0x9228('0x75')](_0x1ce982['name'],'_c')?!![]:![],'options':_0x1ce982[_0x9228('0x42')]?_[_0x9228('0x2b')](_[_0x9228('0x72')](_0x1ce982['options']),function(_0x2d0cec){return{'name':_0x2d0cec[_0x9228('0x76')],'value':_0x2d0cec[_0x9228('0x29')]};}):[]};})};}})[_0x9228('0x27')](respondWithResult(_0x2be53c,null))[_0x9228('0x46')](function(_0x21d107){var _0x55eef5=_0xa254be[_0x9228('0x32')][_0x9228('0x77')]?0x1f4:_0x21d107[_0x9228('0x78')]||0x1f4;logger[_0x9228('0x79')](_0x9228('0x7a'),'getFields',_0x55eef5,JSON['stringify'](_0x21d107));delete _0x21d107['name'];if(_0x55eef5===0x191){_0x55eef5=0x190;}_0x2be53c[_0x9228('0x1c')](_0x55eef5)['send'](_0xa254be[_0x9228('0x32')]['test']?{'message':_0x9228('0x7b'),'statusCode':_0x21d107['statusCode']}:_0x21d107);});}else{var _0x386095=0x1f4;_0x2be53c[_0x9228('0x1c')](_0x386095)['send']({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js index fdda514..30b726b 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 _0xf759=['./intSugarcrmAccount.attributes','exports','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf759,0x154));var _0x9f75=function(_0x5391b,_0x455796){_0x5391b=_0x5391b-0x0;var _0x345cf8=_0xf759[_0x5391b];return _0x345cf8;};'use strict';var _=require(_0x9f75('0x0'));var util=require(_0x9f75('0x1'));var logger=require(_0x9f75('0x2'))(_0x9f75('0x3'));var moment=require(_0x9f75('0x4'));var BPromise=require(_0x9f75('0x5'));var rp=require(_0x9f75('0x6'));var fs=require('fs');var path=require(_0x9f75('0x7'));var rimraf=require(_0x9f75('0x8'));var config=require(_0x9f75('0x9'));var attributes=require(_0x9f75('0xa'));var integrations=require('../../components/integrations/configuration');module[_0x9f75('0xb')]=function(_0x58d750,_0x2b91b0){return _0x58d750['define'](_0x9f75('0xc'),attributes,{'tableName':_0x9f75('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x21ab=['../../config/environment','./intSugarcrmAccount.attributes','exports','SugarcrmAccount','util','api','moment','bluebird','path','rimraf'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x21ab,0x16c));var _0xb21a=function(_0x41ddf3,_0x4c5db7){_0x41ddf3=_0x41ddf3-0x0;var _0x2adac3=_0x21ab[_0x41ddf3];return _0x2adac3;};'use strict';var _=require('lodash');var util=require(_0xb21a('0x0'));var logger=require('../../config/logger')(_0xb21a('0x1'));var moment=require(_0xb21a('0x2'));var BPromise=require(_0xb21a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb21a('0x4'));var rimraf=require(_0xb21a('0x5'));var config=require(_0xb21a('0x6'));var attributes=require(_0xb21a('0x7'));var integrations=require('../../components/integrations/configuration');module[_0xb21a('0x8')]=function(_0xfb4318,_0x56c0f2){return _0xfb4318['define'](_0xb21a('0x9'),attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index 6cf9764..5eed93b 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 _0x3bbd=['../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','SugarcrmAccount,\x20%s,\x20%s','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','SugarcrmAccount','findAll','raw','options','where','attributes','limit','include','map','model','GetSugarcrmAccount','stringify','ShowSugarcrmAccount','lodash','util','bluebird','ioredis','../../mysqldb'];(function(_0x237868,_0x267e95){var _0x3bc4f6=function(_0x4bed0d){while(--_0x4bed0d){_0x237868['push'](_0x237868['shift']());}};_0x3bc4f6(++_0x267e95);}(_0x3bbd,0xe9));var _0xd3bb=function(_0x507677,_0x162078){_0x507677=_0x507677-0x0;var _0x490d4b=_0x3bbd[_0x507677];return _0x490d4b;};'use strict';var _=require(_0xd3bb('0x0'));var util=require(_0xd3bb('0x1'));var moment=require('moment');var BPromise=require(_0xd3bb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd3bb('0x3'));var db=require(_0xd3bb('0x4'))['db'];var utils=require(_0xd3bb('0x5'));var logger=require(_0xd3bb('0x6'))(_0xd3bb('0x7'));var config=require('../../config/environment');var jayson=require(_0xd3bb('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xafd1f3,_0x12c25f,_0x385038){return new BPromise(function(_0x349428,_0x4e1ab5){return client[_0xd3bb('0x9')](_0xafd1f3,_0x385038)[_0xd3bb('0xa')](function(_0x26c25c){logger[_0xd3bb('0xb')](_0xd3bb('0xc'),_0x12c25f,'request\x20sent');logger[_0xd3bb('0xd')](_0xd3bb('0xe'),_0x12c25f,_0xd3bb('0xf'),JSON['stringify'](_0x26c25c));if(_0x26c25c[_0xd3bb('0x10')]){if(_0x26c25c[_0xd3bb('0x10')][_0xd3bb('0x11')]===0x1f4){logger[_0xd3bb('0x10')](_0xd3bb('0xc'),_0x12c25f,_0x26c25c[_0xd3bb('0x10')][_0xd3bb('0x12')]);return _0x4e1ab5(_0x26c25c[_0xd3bb('0x10')][_0xd3bb('0x12')]);}logger[_0xd3bb('0x10')](_0xd3bb('0xc'),_0x12c25f,_0x26c25c['error']['message']);return _0x349428(_0x26c25c[_0xd3bb('0x10')][_0xd3bb('0x12')]);}else{logger[_0xd3bb('0xb')](_0xd3bb('0xc'),_0x12c25f,_0xd3bb('0xf'));_0x349428(_0x26c25c[_0xd3bb('0x13')][_0xd3bb('0x12')]);}})[_0xd3bb('0x14')](function(_0xee549f){logger[_0xd3bb('0x10')](_0xd3bb('0xc'),_0x12c25f,_0xee549f);_0x4e1ab5(_0xee549f);});});}exports['GetSugarcrmAccount']=function(_0x20109e){var _0x49240b=this;return new Promise(function(_0x559eca,_0x377473){return db[_0xd3bb('0x15')][_0xd3bb('0x16')]({'raw':_0x20109e['options']?_0x20109e['options'][_0xd3bb('0x17')]===undefined?!![]:![]:!![],'where':_0x20109e['options']?_0x20109e[_0xd3bb('0x18')][_0xd3bb('0x19')]||null:null,'attributes':_0x20109e[_0xd3bb('0x18')]?_0x20109e[_0xd3bb('0x18')][_0xd3bb('0x1a')]||null:null,'limit':_0x20109e['options']?_0x20109e['options'][_0xd3bb('0x1b')]||null:null,'include':_0x20109e[_0xd3bb('0x18')]?_0x20109e['options'][_0xd3bb('0x1c')]?_[_0xd3bb('0x1d')](_0x20109e['options'][_0xd3bb('0x1c')],function(_0x2a7b0b){return{'model':db[_0x2a7b0b[_0xd3bb('0x1e')]],'as':_0x2a7b0b['as'],'attributes':_0x2a7b0b[_0xd3bb('0x1a')],'include':_0x2a7b0b[_0xd3bb('0x1c')]?_[_0xd3bb('0x1d')](_0x2a7b0b[_0xd3bb('0x1c')],function(_0x111a3d){return{'model':db[_0x111a3d[_0xd3bb('0x1e')]],'as':_0x111a3d['as'],'attributes':_0x111a3d[_0xd3bb('0x1a')],'include':_0x111a3d['include']?_[_0xd3bb('0x1d')](_0x111a3d[_0xd3bb('0x1c')],function(_0x3f91df){return{'model':db[_0x3f91df['model']],'as':_0x3f91df['as'],'attributes':_0x3f91df['attributes']};}):[]};}):[]};}):[]:[]})[_0xd3bb('0xa')](function(_0x19d00d){logger[_0xd3bb('0xb')](_0xd3bb('0x1f'),_0x20109e);logger[_0xd3bb('0xd')](_0xd3bb('0x1f'),_0x20109e,JSON[_0xd3bb('0x20')](_0x19d00d));_0x559eca(_0x19d00d);})[_0xd3bb('0x14')](function(_0x3476f6){logger['error'](_0xd3bb('0x1f'),_0x3476f6[_0xd3bb('0x12')],_0x20109e);_0x377473(_0x49240b['error'](0x1f4,_0x3476f6['message']));});});};exports[_0xd3bb('0x21')]=function(_0x24d1d8){var _0x55269b=this;return new Promise(function(_0x343862,_0xc31217){return db['SugarcrmAccount']['find']({'raw':_0x24d1d8[_0xd3bb('0x18')]?_0x24d1d8[_0xd3bb('0x18')][_0xd3bb('0x17')]===undefined?!![]:![]:!![],'where':_0x24d1d8[_0xd3bb('0x18')]?_0x24d1d8['options'][_0xd3bb('0x19')]||null:null,'attributes':_0x24d1d8[_0xd3bb('0x18')]?_0x24d1d8[_0xd3bb('0x18')]['attributes']||null:null,'include':_0x24d1d8[_0xd3bb('0x18')]?_0x24d1d8['options']['include']?_[_0xd3bb('0x1d')](_0x24d1d8[_0xd3bb('0x18')][_0xd3bb('0x1c')],function(_0x366631){return{'model':db[_0x366631[_0xd3bb('0x1e')]],'as':_0x366631['as'],'attributes':_0x366631[_0xd3bb('0x1a')],'include':_0x366631['include']?_[_0xd3bb('0x1d')](_0x366631['include'],function(_0x14280f){return{'model':db[_0x14280f[_0xd3bb('0x1e')]],'as':_0x14280f['as'],'attributes':_0x14280f[_0xd3bb('0x1a')],'include':_0x14280f[_0xd3bb('0x1c')]?_['map'](_0x14280f[_0xd3bb('0x1c')],function(_0x46ead0){return{'model':db[_0x46ead0[_0xd3bb('0x1e')]],'as':_0x46ead0['as'],'attributes':_0x46ead0[_0xd3bb('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xd3bb('0xa')](function(_0x368369){logger[_0xd3bb('0xb')]('ShowSugarcrmAccount',_0x24d1d8);logger['debug'](_0xd3bb('0x21'),_0x24d1d8,JSON[_0xd3bb('0x20')](_0x368369));_0x343862(_0x368369);})[_0xd3bb('0x14')](function(_0x5bd1ec){logger['error'](_0xd3bb('0x21'),_0x5bd1ec[_0xd3bb('0x12')],_0x24d1d8);_0xc31217(_0x55269b[_0xd3bb('0x10')](0x1f4,_0x5bd1ec['message']));});});}; \ No newline at end of file +var _0x18cc=['error','code','message','result','catch','GetSugarcrmAccount','findAll','options','raw','where','attributes','limit','include','map','model','debug','ShowSugarcrmAccount','SugarcrmAccount','stringify','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','SugarcrmAccount,\x20%s,\x20%s,\x20%s'];(function(_0x4e1d03,_0x786f3a){var _0x362d4b=function(_0x1924d2){while(--_0x1924d2){_0x4e1d03['push'](_0x4e1d03['shift']());}};_0x362d4b(++_0x786f3a);}(_0x18cc,0xeb));var _0xc18c=function(_0x34e81b,_0x2b96bd){_0x34e81b=_0x34e81b-0x0;var _0x5e22ea=_0x18cc[_0x34e81b];return _0x5e22ea;};'use strict';var _=require(_0xc18c('0x0'));var util=require(_0xc18c('0x1'));var moment=require(_0xc18c('0x2'));var BPromise=require(_0xc18c('0x3'));var rs=require(_0xc18c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc18c('0x5'))(_0xc18c('0x6'));var config=require(_0xc18c('0x7'));var jayson=require(_0xc18c('0x8'));var client=jayson[_0xc18c('0x9')][_0xc18c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x253104,_0x1bd6e8,_0x70c369){return new BPromise(function(_0x48a825,_0x29ea8a){return client[_0xc18c('0xb')](_0x253104,_0x70c369)[_0xc18c('0xc')](function(_0x400b05){logger[_0xc18c('0xd')](_0xc18c('0xe'),_0x1bd6e8,_0xc18c('0xf'));logger['debug'](_0xc18c('0x10'),_0x1bd6e8,_0xc18c('0xf'),JSON['stringify'](_0x400b05));if(_0x400b05[_0xc18c('0x11')]){if(_0x400b05[_0xc18c('0x11')][_0xc18c('0x12')]===0x1f4){logger['error'](_0xc18c('0xe'),_0x1bd6e8,_0x400b05[_0xc18c('0x11')][_0xc18c('0x13')]);return _0x29ea8a(_0x400b05['error'][_0xc18c('0x13')]);}logger[_0xc18c('0x11')](_0xc18c('0xe'),_0x1bd6e8,_0x400b05['error'][_0xc18c('0x13')]);return _0x48a825(_0x400b05[_0xc18c('0x11')]['message']);}else{logger[_0xc18c('0xd')]('SugarcrmAccount,\x20%s,\x20%s',_0x1bd6e8,_0xc18c('0xf'));_0x48a825(_0x400b05[_0xc18c('0x14')]['message']);}})[_0xc18c('0x15')](function(_0x4016a7){logger[_0xc18c('0x11')]('SugarcrmAccount,\x20%s,\x20%s',_0x1bd6e8,_0x4016a7);_0x29ea8a(_0x4016a7);});});}exports[_0xc18c('0x16')]=function(_0x37e412){var _0x1feb6e=this;return new Promise(function(_0x53787d,_0x44890d){return db['SugarcrmAccount'][_0xc18c('0x17')]({'raw':_0x37e412[_0xc18c('0x18')]?_0x37e412[_0xc18c('0x18')][_0xc18c('0x19')]===undefined?!![]:![]:!![],'where':_0x37e412[_0xc18c('0x18')]?_0x37e412[_0xc18c('0x18')][_0xc18c('0x1a')]||null:null,'attributes':_0x37e412[_0xc18c('0x18')]?_0x37e412[_0xc18c('0x18')][_0xc18c('0x1b')]||null:null,'limit':_0x37e412[_0xc18c('0x18')]?_0x37e412['options'][_0xc18c('0x1c')]||null:null,'include':_0x37e412[_0xc18c('0x18')]?_0x37e412[_0xc18c('0x18')][_0xc18c('0x1d')]?_[_0xc18c('0x1e')](_0x37e412[_0xc18c('0x18')]['include'],function(_0x4581b6){return{'model':db[_0x4581b6[_0xc18c('0x1f')]],'as':_0x4581b6['as'],'attributes':_0x4581b6['attributes'],'include':_0x4581b6[_0xc18c('0x1d')]?_[_0xc18c('0x1e')](_0x4581b6[_0xc18c('0x1d')],function(_0x443a9f){return{'model':db[_0x443a9f['model']],'as':_0x443a9f['as'],'attributes':_0x443a9f[_0xc18c('0x1b')],'include':_0x443a9f[_0xc18c('0x1d')]?_[_0xc18c('0x1e')](_0x443a9f[_0xc18c('0x1d')],function(_0x1c7178){return{'model':db[_0x1c7178[_0xc18c('0x1f')]],'as':_0x1c7178['as'],'attributes':_0x1c7178[_0xc18c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc18c('0xc')](function(_0x41ce5c){logger[_0xc18c('0xd')](_0xc18c('0x16'),_0x37e412);logger[_0xc18c('0x20')](_0xc18c('0x16'),_0x37e412,JSON['stringify'](_0x41ce5c));_0x53787d(_0x41ce5c);})[_0xc18c('0x15')](function(_0x4b5779){logger['error']('GetSugarcrmAccount',_0x4b5779[_0xc18c('0x13')],_0x37e412);_0x44890d(_0x1feb6e['error'](0x1f4,_0x4b5779[_0xc18c('0x13')]));});});};exports[_0xc18c('0x21')]=function(_0x1e64df){var _0x4b7bf0=this;return new Promise(function(_0x55130a,_0x3af844){return db[_0xc18c('0x22')]['find']({'raw':_0x1e64df[_0xc18c('0x18')]?_0x1e64df[_0xc18c('0x18')][_0xc18c('0x19')]===undefined?!![]:![]:!![],'where':_0x1e64df['options']?_0x1e64df[_0xc18c('0x18')]['where']||null:null,'attributes':_0x1e64df[_0xc18c('0x18')]?_0x1e64df[_0xc18c('0x18')]['attributes']||null:null,'include':_0x1e64df[_0xc18c('0x18')]?_0x1e64df[_0xc18c('0x18')][_0xc18c('0x1d')]?_[_0xc18c('0x1e')](_0x1e64df['options'][_0xc18c('0x1d')],function(_0xb4ebd4){return{'model':db[_0xb4ebd4[_0xc18c('0x1f')]],'as':_0xb4ebd4['as'],'attributes':_0xb4ebd4['attributes'],'include':_0xb4ebd4[_0xc18c('0x1d')]?_[_0xc18c('0x1e')](_0xb4ebd4[_0xc18c('0x1d')],function(_0x5ea37a){return{'model':db[_0x5ea37a[_0xc18c('0x1f')]],'as':_0x5ea37a['as'],'attributes':_0x5ea37a[_0xc18c('0x1b')],'include':_0x5ea37a['include']?_[_0xc18c('0x1e')](_0x5ea37a[_0xc18c('0x1d')],function(_0x3082f8){return{'model':db[_0x3082f8[_0xc18c('0x1f')]],'as':_0x3082f8['as'],'attributes':_0x3082f8[_0xc18c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc18c('0xc')](function(_0x1339d4){logger['info'](_0xc18c('0x21'),_0x1e64df);logger[_0xc18c('0x20')](_0xc18c('0x21'),_0x1e64df,JSON[_0xc18c('0x23')](_0x1339d4));_0x55130a(_0x1339d4);})['catch'](function(_0x229ef4){logger[_0xc18c('0x11')](_0xc18c('0x21'),_0x229ef4[_0xc18c('0x13')],_0x1e64df);_0x3af844(_0x4b7bf0[_0xc18c('0x11')](0x1f4,_0x229ef4[_0xc18c('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 27eac0b..6580f32 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 _0xd82d=['/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x2984d0,_0x1a7211){var _0x2885f2=function(_0x42f3da){while(--_0x42f3da){_0x2984d0['push'](_0x2984d0['shift']());}};_0x2885f2(++_0x1a7211);}(_0xd82d,0x1bb));var _0xdd82=function(_0x409c75,_0x20d415){_0x409c75=_0x409c75-0x0;var _0x44d5dd=_0xd82d[_0x409c75];return _0x44d5dd;};'use strict';var multer=require(_0xdd82('0x0'));var util=require('util');var path=require(_0xdd82('0x1'));var timeout=require(_0xdd82('0x2'));var express=require(_0xdd82('0x3'));var router=express['Router']();var fs_extra=require(_0xdd82('0x4'));var auth=require(_0xdd82('0x5'));var interaction=require(_0xdd82('0x6'));var config=require(_0xdd82('0x7'));var controller=require('./intSugarcrmConfiguration.controller');router[_0xdd82('0x8')]('/',auth[_0xdd82('0x9')](),controller[_0xdd82('0xa')]);router['get'](_0xdd82('0xb'),auth[_0xdd82('0x9')](),controller[_0xdd82('0xc')]);router[_0xdd82('0x8')](_0xdd82('0xd'),auth[_0xdd82('0x9')](),controller[_0xdd82('0xe')]);router[_0xdd82('0x8')](_0xdd82('0xf'),auth['isAuthenticated'](),controller[_0xdd82('0x10')]);router[_0xdd82('0x8')](_0xdd82('0x11'),auth[_0xdd82('0x9')](),controller[_0xdd82('0x12')]);router[_0xdd82('0x13')]('/',auth[_0xdd82('0x9')](),controller[_0xdd82('0x14')]);router[_0xdd82('0x15')](_0xdd82('0xb'),auth['isAuthenticated'](),controller[_0xdd82('0x16')]);router[_0xdd82('0x17')](_0xdd82('0xb'),auth[_0xdd82('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x418b=['update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','put'];(function(_0x41a4bb,_0x36b115){var _0x4d4239=function(_0x572b5c){while(--_0x572b5c){_0x41a4bb['push'](_0x41a4bb['shift']());}};_0x4d4239(++_0x36b115);}(_0x418b,0x1e5));var _0xb418=function(_0x5f5d85,_0xde12dd){_0x5f5d85=_0x5f5d85-0x0;var _0xf69d1f=_0x418b[_0x5f5d85];return _0xf69d1f;};'use strict';var multer=require(_0xb418('0x0'));var util=require(_0xb418('0x1'));var path=require(_0xb418('0x2'));var timeout=require(_0xb418('0x3'));var express=require(_0xb418('0x4'));var router=express[_0xb418('0x5')]();var fs_extra=require(_0xb418('0x6'));var auth=require(_0xb418('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xb418('0x8'));var controller=require(_0xb418('0x9'));router[_0xb418('0xa')]('/',auth[_0xb418('0xb')](),controller[_0xb418('0xc')]);router['get'](_0xb418('0xd'),auth[_0xb418('0xb')](),controller['show']);router[_0xb418('0xa')](_0xb418('0xe'),auth[_0xb418('0xb')](),controller[_0xb418('0xf')]);router[_0xb418('0xa')](_0xb418('0x10'),auth[_0xb418('0xb')](),controller['getSubjects']);router['get'](_0xb418('0x11'),auth[_0xb418('0xb')](),controller[_0xb418('0x12')]);router[_0xb418('0x13')]('/',auth[_0xb418('0xb')](),controller['create']);router[_0xb418('0x14')](_0xb418('0xd'),auth[_0xb418('0xb')](),controller[_0xb418('0x15')]);router[_0xb418('0x16')](_0xb418('0xd'),auth[_0xb418('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 12658f0..d8689f0 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 _0x4824=['STRING','exports'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x4824,0xdd));var _0x4482=function(_0xaa026b,_0x197301){_0xaa026b=_0xaa026b-0x0;var _0x17808c=_0x4824[_0xaa026b];return _0x17808c;};'use strict';var Sequelize=require('sequelize');module[_0x4482('0x0')]={'name':{'type':Sequelize[_0x4482('0x1')]},'description':{'type':Sequelize[_0x4482('0x1')]}}; \ No newline at end of file +var _0x6a9e=['STRING','sequelize'];(function(_0x47d457,_0x1e06d1){var _0x344422=function(_0x57d9c3){while(--_0x57d9c3){_0x47d457['push'](_0x47d457['shift']());}};_0x344422(++_0x1e06d1);}(_0x6a9e,0x93));var _0xe6a9=function(_0x185aea,_0x528bf3){_0x185aea=_0x185aea-0x0;var _0x7c0d71=_0x6a9e[_0x185aea];return _0x7c0d71;};'use strict';var Sequelize=require(_0xe6a9('0x0'));module['exports']={'name':{'type':Sequelize[_0xe6a9('0x1')]},'description':{'type':Sequelize[_0xe6a9('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index f0c0ef6..2ec20da 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 _0xec24=['sort','pick','filters','where','VIRTUAL','name','merge','options','SugarcrmConfiguration','includeAll','include','findAll','rows','params','rawAttributes','catch','create','body','find','findOne','filter','getFields','nolimit','getSubjects','SugarcrmField','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../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','Content-Range','apply','save','update','then','destroy','error','stack','send','index','map','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order'];(function(_0x2ad332,_0xa1fcee){var _0x567946=function(_0x29dab2){while(--_0x29dab2){_0x2ad332['push'](_0x2ad332['shift']());}};_0x567946(++_0xa1fcee);}(_0xec24,0x69));var _0x4ec2=function(_0x270020,_0x4e4f95){_0x270020=_0x270020-0x0;var _0x367a79=_0xec24[_0x270020];return _0x367a79;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4ec2('0x0'));var zipdir=require(_0x4ec2('0x1'));var jsonpatch=require(_0x4ec2('0x2'));var rp=require(_0x4ec2('0x3'));var moment=require('moment');var BPromise=require(_0x4ec2('0x4'));var Mustache=require(_0x4ec2('0x5'));var util=require('util');var path=require(_0x4ec2('0x6'));var sox=require(_0x4ec2('0x7'));var csv=require('to-csv');var ejs=require(_0x4ec2('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4ec2('0x9'));var squel=require(_0x4ec2('0xa'));var crypto=require(_0x4ec2('0xb'));var jsforce=require(_0x4ec2('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4ec2('0xd'));var Papa=require(_0x4ec2('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4ec2('0xf'));var as=require(_0x4ec2('0x10'));var hardwareService=require(_0x4ec2('0x11'));var logger=require(_0x4ec2('0x12'))(_0x4ec2('0x13'));var utils=require(_0x4ec2('0x14'));var config=require(_0x4ec2('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x4ec2('0x16'))['db'];function respondWithStatusCode(_0x1f653b,_0x4a336a){_0x4a336a=_0x4a336a||0xcc;return function(_0x3c6035){if(_0x3c6035){return _0x1f653b[_0x4ec2('0x17')](_0x4a336a);}return _0x1f653b[_0x4ec2('0x18')](_0x4a336a)[_0x4ec2('0x19')]();};}function respondWithResult(_0x2fbbcb,_0x1a9f84){_0x1a9f84=_0x1a9f84||0xc8;return function(_0x4a33fe){if(_0x4a33fe){return _0x2fbbcb['status'](_0x1a9f84)[_0x4ec2('0x1a')](_0x4a33fe);}};}function respondWithFilteredResult(_0x37b578,_0x252923){return function(_0x19bf4f){if(_0x19bf4f){var _0x1f2d33=typeof _0x252923[_0x4ec2('0x1b')]===_0x4ec2('0x1c')&&typeof _0x252923[_0x4ec2('0x1d')]==='undefined';var _0x27f9f8=_0x19bf4f[_0x4ec2('0x1e')];var _0xd54019=_0x1f2d33?0x0:_0x252923[_0x4ec2('0x1b')];var _0x1367da=_0x1f2d33?_0x19bf4f[_0x4ec2('0x1e')]:_0x252923[_0x4ec2('0x1b')]+_0x252923[_0x4ec2('0x1d')];var _0x77f955;if(_0x1367da>=_0x27f9f8){_0x1367da=_0x27f9f8;_0x77f955=0xc8;}else{_0x77f955=0xce;}_0x37b578[_0x4ec2('0x18')](_0x77f955);return _0x37b578['set'](_0x4ec2('0x1f'),_0xd54019+'-'+_0x1367da+'/'+_0x27f9f8)[_0x4ec2('0x1a')](_0x19bf4f);}return null;};}function patchUpdates(_0x450109){return function(_0x4264aa){try{jsonpatch[_0x4ec2('0x20')](_0x4264aa,_0x450109,!![]);}catch(_0x2c558e){return BPromise['reject'](_0x2c558e);}return _0x4264aa[_0x4ec2('0x21')]();};}function saveUpdates(_0x107540,_0x59cefe){return function(_0x1765df){if(_0x1765df){return _0x1765df[_0x4ec2('0x22')](_0x107540)[_0x4ec2('0x23')](function(_0x9961ce){return _0x9961ce;});}return null;};}function removeEntity(_0x44f512,_0x164c66){return function(_0x55e9e4){if(_0x55e9e4){return _0x55e9e4[_0x4ec2('0x24')]()[_0x4ec2('0x23')](function(){_0x44f512[_0x4ec2('0x18')](0xcc)[_0x4ec2('0x19')]();});}};}function handleEntityNotFound(_0x42c816,_0x280aab){return function(_0x50620d){if(!_0x50620d){_0x42c816[_0x4ec2('0x17')](0x194);}return _0x50620d;};}function handleError(_0x542e7,_0x5c0111){_0x5c0111=_0x5c0111||0x1f4;return function(_0x3be655){logger[_0x4ec2('0x25')](_0x3be655[_0x4ec2('0x26')]);if(_0x3be655['name']){delete _0x3be655['name'];}_0x542e7['status'](_0x5c0111)[_0x4ec2('0x27')](_0x3be655);};}exports[_0x4ec2('0x28')]=function(_0xb49ca4,_0x178b9b){var _0x10050e={},_0x4a8ed9={},_0x2ee8d3={'count':0x0,'rows':[]};var _0x3acb93=_[_0x4ec2('0x29')](db['SugarcrmConfiguration']['rawAttributes'],function(_0x2a4c0d){return{'name':_0x2a4c0d[_0x4ec2('0x2a')],'type':_0x2a4c0d[_0x4ec2('0x2b')]['key']};});_0x4a8ed9[_0x4ec2('0x2c')]=_[_0x4ec2('0x29')](_0x3acb93,'name');_0x4a8ed9[_0x4ec2('0x2d')]=_[_0x4ec2('0x2e')](_0xb49ca4['query']);_0x4a8ed9['filters']=_[_0x4ec2('0x2f')](_0x4a8ed9[_0x4ec2('0x2c')],_0x4a8ed9[_0x4ec2('0x2d')]);_0x10050e[_0x4ec2('0x30')]=_[_0x4ec2('0x2f')](_0x4a8ed9[_0x4ec2('0x2c')],qs[_0x4ec2('0x31')](_0xb49ca4['query']['fields']));_0x10050e[_0x4ec2('0x30')]=_0x10050e['attributes'][_0x4ec2('0x32')]?_0x10050e['attributes']:_0x4a8ed9[_0x4ec2('0x2c')];if(!_0xb49ca4[_0x4ec2('0x2d')][_0x4ec2('0x33')]('nolimit')){_0x10050e[_0x4ec2('0x1d')]=qs['limit'](_0xb49ca4[_0x4ec2('0x2d')][_0x4ec2('0x1d')]);_0x10050e[_0x4ec2('0x1b')]=qs[_0x4ec2('0x1b')](_0xb49ca4[_0x4ec2('0x2d')][_0x4ec2('0x1b')]);}_0x10050e[_0x4ec2('0x34')]=qs[_0x4ec2('0x35')](_0xb49ca4[_0x4ec2('0x2d')]['sort']);_0x10050e['where']=qs['filters'](_[_0x4ec2('0x36')](_0xb49ca4['query'],_0x4a8ed9[_0x4ec2('0x37')]),_0x3acb93);if(_0xb49ca4['query']['filter']){_0x10050e[_0x4ec2('0x38')]=_['merge'](_0x10050e[_0x4ec2('0x38')],{'$or':_['map'](_0x3acb93,function(_0x4d0c44){if(_0x4d0c44[_0x4ec2('0x2b')]!==_0x4ec2('0x39')){var _0x6e4e53={};_0x6e4e53[_0x4d0c44[_0x4ec2('0x3a')]]={'$like':'%'+_0xb49ca4[_0x4ec2('0x2d')]['filter']+'%'};return _0x6e4e53;}})});}_0x10050e=_[_0x4ec2('0x3b')]({},_0x10050e,_0xb49ca4[_0x4ec2('0x3c')]);var _0x3becc4={'where':_0x10050e[_0x4ec2('0x38')]};return db[_0x4ec2('0x3d')][_0x4ec2('0x1e')](_0x3becc4)[_0x4ec2('0x23')](function(_0x3ae823){_0x2ee8d3[_0x4ec2('0x1e')]=_0x3ae823;if(_0xb49ca4[_0x4ec2('0x2d')][_0x4ec2('0x3e')]){_0x10050e[_0x4ec2('0x3f')]=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0x4ec2('0x40')](_0x10050e);})[_0x4ec2('0x23')](function(_0x2e2be0){_0x2ee8d3[_0x4ec2('0x41')]=_0x2e2be0;return _0x2ee8d3;})[_0x4ec2('0x23')](respondWithFilteredResult(_0x178b9b,_0x10050e))['catch'](handleError(_0x178b9b,null));};exports['show']=function(_0x35dcb1,_0x176655){var _0x1d5418={'raw':![],'where':{'id':_0x35dcb1[_0x4ec2('0x42')]['id']}},_0xbd5b99={};_0xbd5b99['model']=_[_0x4ec2('0x2e')](db[_0x4ec2('0x3d')][_0x4ec2('0x43')]);_0xbd5b99[_0x4ec2('0x2d')]=_[_0x4ec2('0x2e')](_0x35dcb1[_0x4ec2('0x2d')]);_0xbd5b99[_0x4ec2('0x37')]=_[_0x4ec2('0x2f')](_0xbd5b99[_0x4ec2('0x2c')],_0xbd5b99['query']);_0x1d5418[_0x4ec2('0x30')]=_[_0x4ec2('0x2f')](_0xbd5b99[_0x4ec2('0x2c')],qs[_0x4ec2('0x31')](_0x35dcb1[_0x4ec2('0x2d')][_0x4ec2('0x31')]));_0x1d5418[_0x4ec2('0x30')]=_0x1d5418['attributes']['length']?_0x1d5418[_0x4ec2('0x30')]:_0xbd5b99[_0x4ec2('0x2c')];if(_0x35dcb1['query']['includeAll']){_0x1d5418['include']=[{'all':!![]}];}_0x1d5418=_['merge']({},_0x1d5418,_0x35dcb1[_0x4ec2('0x3c')]);return db[_0x4ec2('0x3d')]['find'](_0x1d5418)['then'](handleEntityNotFound(_0x176655,null))['then'](respondWithResult(_0x176655,null))[_0x4ec2('0x44')](handleError(_0x176655,null));};exports[_0x4ec2('0x45')]=function(_0x301bda,_0xf9abe7){return db[_0x4ec2('0x3d')][_0x4ec2('0x45')](_0x301bda[_0x4ec2('0x46')],{})[_0x4ec2('0x23')](respondWithResult(_0xf9abe7,0xc9))[_0x4ec2('0x44')](handleError(_0xf9abe7,null));};exports[_0x4ec2('0x22')]=function(_0x4552e7,_0x2f291a){if(_0x4552e7[_0x4ec2('0x46')]['id']){delete _0x4552e7[_0x4ec2('0x46')]['id'];}return db['SugarcrmConfiguration'][_0x4ec2('0x47')]({'where':{'id':_0x4552e7[_0x4ec2('0x42')]['id']}})[_0x4ec2('0x23')](handleEntityNotFound(_0x2f291a,null))[_0x4ec2('0x23')](saveUpdates(_0x4552e7[_0x4ec2('0x46')],null))['then'](respondWithResult(_0x2f291a,null))['catch'](handleError(_0x2f291a,null));};exports[_0x4ec2('0x24')]=function(_0x1c161c,_0x490cae){return db[_0x4ec2('0x3d')][_0x4ec2('0x47')]({'where':{'id':_0x1c161c[_0x4ec2('0x42')]['id']}})[_0x4ec2('0x23')](handleEntityNotFound(_0x490cae,null))[_0x4ec2('0x23')](removeEntity(_0x490cae,null))[_0x4ec2('0x44')](handleError(_0x490cae,null));};exports['getFields']=function(_0x3173a8,_0x579293,_0x22c9ee){var _0x2b4086={};var _0x2b27a0={};var _0x3879f2;var _0xb1680b;return db[_0x4ec2('0x3d')][_0x4ec2('0x48')]({'where':{'id':_0x3173a8[_0x4ec2('0x42')]['id']}})[_0x4ec2('0x23')](handleEntityNotFound(_0x579293,null))[_0x4ec2('0x23')](function(_0x243acc){if(_0x243acc){_0x3879f2=_0x243acc;_0x2b27a0[_0x4ec2('0x2c')]=_[_0x4ec2('0x2e')](db['SugarcrmField'][_0x4ec2('0x43')]);_0x2b27a0[_0x4ec2('0x2d')]=_[_0x4ec2('0x2e')](_0x3173a8[_0x4ec2('0x2d')]);_0x2b27a0[_0x4ec2('0x37')]=_[_0x4ec2('0x2f')](_0x2b27a0['model'],_0x2b27a0['query']);_0x2b4086[_0x4ec2('0x30')]=_[_0x4ec2('0x2f')](_0x2b27a0['model'],qs[_0x4ec2('0x31')](_0x3173a8['query'][_0x4ec2('0x31')]));_0x2b4086['attributes']=_0x2b4086['attributes'][_0x4ec2('0x32')]?_0x2b4086['attributes']:_0x2b27a0[_0x4ec2('0x2c')];_0x2b4086[_0x4ec2('0x34')]=qs[_0x4ec2('0x35')](_0x3173a8[_0x4ec2('0x2d')][_0x4ec2('0x35')]);_0x2b4086[_0x4ec2('0x38')]=qs[_0x4ec2('0x37')](_[_0x4ec2('0x36')](_0x3173a8[_0x4ec2('0x2d')],_0x2b27a0['filters']));if(_0x3173a8[_0x4ec2('0x2d')][_0x4ec2('0x49')]){_0x2b4086[_0x4ec2('0x38')]=_['merge'](_0x2b4086['where'],{'$or':_['map'](_0x2b4086[_0x4ec2('0x30')],function(_0x1cfed5){var _0x483cf6={};_0x483cf6[_0x1cfed5]={'$like':'%'+_0x3173a8[_0x4ec2('0x2d')]['filter']+'%'};return _0x483cf6;})});}_0x2b4086=_[_0x4ec2('0x3b')]({},_0x2b4086,_0x3173a8[_0x4ec2('0x3c')]);return _0x3879f2[_0x4ec2('0x4a')](_0x2b4086);}})[_0x4ec2('0x23')](function(_0xa316ec){if(_0xa316ec){_0xb1680b=_0xa316ec['length'];if(!_0x3173a8[_0x4ec2('0x2d')][_0x4ec2('0x33')](_0x4ec2('0x4b'))){_0x2b4086[_0x4ec2('0x1d')]=qs[_0x4ec2('0x1d')](_0x3173a8[_0x4ec2('0x2d')][_0x4ec2('0x1d')]);_0x2b4086[_0x4ec2('0x1b')]=qs[_0x4ec2('0x1b')](_0x3173a8[_0x4ec2('0x2d')]['offset']);}return _0x3879f2['getFields'](_0x2b4086);}})[_0x4ec2('0x23')](function(_0x5232ea){if(_0x5232ea){return _0x5232ea?{'count':_0xb1680b,'rows':_0x5232ea}:null;}})[_0x4ec2('0x23')](respondWithResult(_0x579293,null))['catch'](handleError(_0x579293,null));};exports[_0x4ec2('0x4c')]=function(_0x562c9f,_0x377fbc,_0x39f617){var _0x3e2178={};var _0x7485f2={};var _0x1b6939;var _0x469280;return db['SugarcrmConfiguration'][_0x4ec2('0x48')]({'where':{'id':_0x562c9f[_0x4ec2('0x42')]['id']}})[_0x4ec2('0x23')](handleEntityNotFound(_0x377fbc,null))[_0x4ec2('0x23')](function(_0x5d93b4){if(_0x5d93b4){_0x1b6939=_0x5d93b4;_0x7485f2[_0x4ec2('0x2c')]=_['keys'](db[_0x4ec2('0x4d')][_0x4ec2('0x43')]);_0x7485f2['query']=_[_0x4ec2('0x2e')](_0x562c9f[_0x4ec2('0x2d')]);_0x7485f2[_0x4ec2('0x37')]=_['intersection'](_0x7485f2[_0x4ec2('0x2c')],_0x7485f2['query']);_0x3e2178[_0x4ec2('0x30')]=_[_0x4ec2('0x2f')](_0x7485f2[_0x4ec2('0x2c')],qs[_0x4ec2('0x31')](_0x562c9f[_0x4ec2('0x2d')][_0x4ec2('0x31')]));_0x3e2178[_0x4ec2('0x30')]=_0x3e2178['attributes'][_0x4ec2('0x32')]?_0x3e2178['attributes']:_0x7485f2[_0x4ec2('0x2c')];_0x3e2178[_0x4ec2('0x34')]=qs[_0x4ec2('0x35')](_0x562c9f['query'][_0x4ec2('0x35')]);_0x3e2178[_0x4ec2('0x38')]=qs['filters'](_['pick'](_0x562c9f[_0x4ec2('0x2d')],_0x7485f2[_0x4ec2('0x37')]));if(_0x562c9f['query']['filter']){_0x3e2178[_0x4ec2('0x38')]=_['merge'](_0x3e2178[_0x4ec2('0x38')],{'$or':_[_0x4ec2('0x29')](_0x3e2178[_0x4ec2('0x30')],function(_0x2103a6){var _0x4cc6f1={};_0x4cc6f1[_0x2103a6]={'$like':'%'+_0x562c9f['query'][_0x4ec2('0x49')]+'%'};return _0x4cc6f1;})});}_0x3e2178=_['merge']({},_0x3e2178,_0x562c9f[_0x4ec2('0x3c')]);return _0x1b6939[_0x4ec2('0x4c')](_0x3e2178);}})['then'](function(_0x47548c){if(_0x47548c){_0x469280=_0x47548c[_0x4ec2('0x32')];if(!_0x562c9f[_0x4ec2('0x2d')]['hasOwnProperty']('nolimit')){_0x3e2178[_0x4ec2('0x1d')]=qs[_0x4ec2('0x1d')](_0x562c9f[_0x4ec2('0x2d')][_0x4ec2('0x1d')]);_0x3e2178[_0x4ec2('0x1b')]=qs['offset'](_0x562c9f['query'][_0x4ec2('0x1b')]);}return _0x1b6939[_0x4ec2('0x4c')](_0x3e2178);}})[_0x4ec2('0x23')](function(_0x167720){if(_0x167720){return _0x167720?{'count':_0x469280,'rows':_0x167720}:null;}})[_0x4ec2('0x23')](respondWithResult(_0x377fbc,null))[_0x4ec2('0x44')](handleError(_0x377fbc,null));};exports[_0x4ec2('0x4e')]=function(_0x1ce4fc,_0xfc7e87,_0x65d208){var _0x1f3b6a={};var _0x3e5e08={};var _0x5a1a7f;var _0x40ffe2;return db[_0x4ec2('0x3d')][_0x4ec2('0x48')]({'where':{'id':_0x1ce4fc[_0x4ec2('0x42')]['id']}})[_0x4ec2('0x23')](handleEntityNotFound(_0xfc7e87,null))[_0x4ec2('0x23')](function(_0x121e8a){if(_0x121e8a){_0x5a1a7f=_0x121e8a;_0x3e5e08[_0x4ec2('0x2c')]=_['keys'](db['SugarcrmField'][_0x4ec2('0x43')]);_0x3e5e08[_0x4ec2('0x2d')]=_[_0x4ec2('0x2e')](_0x1ce4fc['query']);_0x3e5e08[_0x4ec2('0x37')]=_[_0x4ec2('0x2f')](_0x3e5e08[_0x4ec2('0x2c')],_0x3e5e08['query']);_0x1f3b6a[_0x4ec2('0x30')]=_[_0x4ec2('0x2f')](_0x3e5e08[_0x4ec2('0x2c')],qs['fields'](_0x1ce4fc[_0x4ec2('0x2d')][_0x4ec2('0x31')]));_0x1f3b6a['attributes']=_0x1f3b6a['attributes'][_0x4ec2('0x32')]?_0x1f3b6a['attributes']:_0x3e5e08[_0x4ec2('0x2c')];_0x1f3b6a[_0x4ec2('0x34')]=qs[_0x4ec2('0x35')](_0x1ce4fc[_0x4ec2('0x2d')]['sort']);_0x1f3b6a[_0x4ec2('0x38')]=qs[_0x4ec2('0x37')](_[_0x4ec2('0x36')](_0x1ce4fc[_0x4ec2('0x2d')],_0x3e5e08[_0x4ec2('0x37')]));if(_0x1ce4fc[_0x4ec2('0x2d')]['filter']){_0x1f3b6a['where']=_[_0x4ec2('0x3b')](_0x1f3b6a['where'],{'$or':_[_0x4ec2('0x29')](_0x1f3b6a[_0x4ec2('0x30')],function(_0x23308a){var _0x4c4d9b={};_0x4c4d9b[_0x23308a]={'$like':'%'+_0x1ce4fc['query']['filter']+'%'};return _0x4c4d9b;})});}_0x1f3b6a=_[_0x4ec2('0x3b')]({},_0x1f3b6a,_0x1ce4fc[_0x4ec2('0x3c')]);return _0x5a1a7f[_0x4ec2('0x4e')](_0x1f3b6a);}})['then'](function(_0x5f4f63){if(_0x5f4f63){_0x40ffe2=_0x5f4f63[_0x4ec2('0x32')];if(!_0x1ce4fc[_0x4ec2('0x2d')][_0x4ec2('0x33')](_0x4ec2('0x4b'))){_0x1f3b6a[_0x4ec2('0x1d')]=qs[_0x4ec2('0x1d')](_0x1ce4fc[_0x4ec2('0x2d')][_0x4ec2('0x1d')]);_0x1f3b6a[_0x4ec2('0x1b')]=qs['offset'](_0x1ce4fc[_0x4ec2('0x2d')]['offset']);}return _0x5a1a7f[_0x4ec2('0x4e')](_0x1f3b6a);}})['then'](function(_0x349d17){if(_0x349d17){return _0x349d17?{'count':_0x40ffe2,'rows':_0x349d17}:null;}})[_0x4ec2('0x23')](respondWithResult(_0xfc7e87,null))[_0x4ec2('0x44')](handleError(_0xfc7e87,null));}; \ No newline at end of file +var _0xd927=['ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','stack','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','where','merge','VIRTUAL','name','options','SugarcrmConfiguration','includeAll','rows','show','params','rawAttributes','include','catch','create','body','find','getFields','findOne','SugarcrmField','sort','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv'];(function(_0x5d963a,_0x5399c9){var _0xf15391=function(_0x494c0d){while(--_0x494c0d){_0x5d963a['push'](_0x5d963a['shift']());}};_0xf15391(++_0x5399c9);}(_0xd927,0x137));var _0x7d92=function(_0x38c022,_0x40d9db){_0x38c022=_0x38c022-0x0;var _0x5ce323=_0xd927[_0x38c022];return _0x5ce323;};'use strict';var emlformat=require(_0x7d92('0x0'));var rimraf=require(_0x7d92('0x1'));var zipdir=require(_0x7d92('0x2'));var jsonpatch=require(_0x7d92('0x3'));var rp=require(_0x7d92('0x4'));var moment=require(_0x7d92('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x7d92('0x6'));var util=require('util');var path=require(_0x7d92('0x7'));var sox=require('sox');var csv=require(_0x7d92('0x8'));var ejs=require(_0x7d92('0x9'));var fs=require('fs');var fs_extra=require(_0x7d92('0xa'));var _=require('lodash');var squel=require(_0x7d92('0xb'));var crypto=require(_0x7d92('0xc'));var jsforce=require(_0x7d92('0xd'));var deskjs=require(_0x7d92('0xe'));var toCsv=require(_0x7d92('0x8'));var querystring=require(_0x7d92('0xf'));var Papa=require(_0x7d92('0x10'));var Redis=require(_0x7d92('0x11'));var authService=require(_0x7d92('0x12'));var qs=require(_0x7d92('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7d92('0x14'));var logger=require('../../config/logger')(_0x7d92('0x15'));var utils=require(_0x7d92('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x7d92('0x17'));var db=require(_0x7d92('0x18'))['db'];function respondWithStatusCode(_0x46c2f8,_0xadedb1){_0xadedb1=_0xadedb1||0xcc;return function(_0x5027f2){if(_0x5027f2){return _0x46c2f8['sendStatus'](_0xadedb1);}return _0x46c2f8['status'](_0xadedb1)[_0x7d92('0x19')]();};}function respondWithResult(_0x60cb2b,_0xea00b0){_0xea00b0=_0xea00b0||0xc8;return function(_0x20b524){if(_0x20b524){return _0x60cb2b[_0x7d92('0x1a')](_0xea00b0)['json'](_0x20b524);}};}function respondWithFilteredResult(_0x3b445c,_0x1db71b){return function(_0x477f73){if(_0x477f73){var _0x54e939=typeof _0x1db71b[_0x7d92('0x1b')]===_0x7d92('0x1c')&&typeof _0x1db71b[_0x7d92('0x1d')]==='undefined';var _0x4de3e6=_0x477f73[_0x7d92('0x1e')];var _0x411bb6=_0x54e939?0x0:_0x1db71b[_0x7d92('0x1b')];var _0xc9af78=_0x54e939?_0x477f73[_0x7d92('0x1e')]:_0x1db71b[_0x7d92('0x1b')]+_0x1db71b[_0x7d92('0x1d')];var _0x142d18;if(_0xc9af78>=_0x4de3e6){_0xc9af78=_0x4de3e6;_0x142d18=0xc8;}else{_0x142d18=0xce;}_0x3b445c[_0x7d92('0x1a')](_0x142d18);return _0x3b445c['set'](_0x7d92('0x1f'),_0x411bb6+'-'+_0xc9af78+'/'+_0x4de3e6)['json'](_0x477f73);}return null;};}function patchUpdates(_0x1a1cc9){return function(_0xfabb9e){try{jsonpatch[_0x7d92('0x20')](_0xfabb9e,_0x1a1cc9,!![]);}catch(_0x55dab2){return BPromise[_0x7d92('0x21')](_0x55dab2);}return _0xfabb9e[_0x7d92('0x22')]();};}function saveUpdates(_0xe081dc,_0x990deb){return function(_0x5e94f8){if(_0x5e94f8){return _0x5e94f8[_0x7d92('0x23')](_0xe081dc)[_0x7d92('0x24')](function(_0x2b5a49){return _0x2b5a49;});}return null;};}function removeEntity(_0x3ad273,_0xea6003){return function(_0x40f9fe){if(_0x40f9fe){return _0x40f9fe[_0x7d92('0x25')]()[_0x7d92('0x24')](function(){_0x3ad273[_0x7d92('0x1a')](0xcc)[_0x7d92('0x19')]();});}};}function handleEntityNotFound(_0x25de5a,_0x520d57){return function(_0x4af91e){if(!_0x4af91e){_0x25de5a['sendStatus'](0x194);}return _0x4af91e;};}function handleError(_0xc41638,_0x193980){_0x193980=_0x193980||0x1f4;return function(_0x10c034){logger['error'](_0x10c034[_0x7d92('0x26')]);if(_0x10c034['name']){delete _0x10c034['name'];}_0xc41638[_0x7d92('0x1a')](_0x193980)[_0x7d92('0x27')](_0x10c034);};}exports[_0x7d92('0x28')]=function(_0x5e61fa,_0x48d6ae){var _0x1556f6={},_0x214c0a={},_0x81287c={'count':0x0,'rows':[]};var _0x15ba68=_[_0x7d92('0x29')](db['SugarcrmConfiguration']['rawAttributes'],function(_0x589bea){return{'name':_0x589bea[_0x7d92('0x2a')],'type':_0x589bea[_0x7d92('0x2b')][_0x7d92('0x2c')]};});_0x214c0a[_0x7d92('0x2d')]=_[_0x7d92('0x29')](_0x15ba68,'name');_0x214c0a[_0x7d92('0x2e')]=_[_0x7d92('0x2f')](_0x5e61fa['query']);_0x214c0a[_0x7d92('0x30')]=_[_0x7d92('0x31')](_0x214c0a[_0x7d92('0x2d')],_0x214c0a[_0x7d92('0x2e')]);_0x1556f6[_0x7d92('0x32')]=_[_0x7d92('0x31')](_0x214c0a[_0x7d92('0x2d')],qs['fields'](_0x5e61fa['query'][_0x7d92('0x33')]));_0x1556f6[_0x7d92('0x32')]=_0x1556f6['attributes'][_0x7d92('0x34')]?_0x1556f6[_0x7d92('0x32')]:_0x214c0a['model'];if(!_0x5e61fa['query'][_0x7d92('0x35')](_0x7d92('0x36'))){_0x1556f6[_0x7d92('0x1d')]=qs[_0x7d92('0x1d')](_0x5e61fa['query'][_0x7d92('0x1d')]);_0x1556f6['offset']=qs[_0x7d92('0x1b')](_0x5e61fa[_0x7d92('0x2e')]['offset']);}_0x1556f6[_0x7d92('0x37')]=qs['sort'](_0x5e61fa[_0x7d92('0x2e')]['sort']);_0x1556f6['where']=qs[_0x7d92('0x30')](_[_0x7d92('0x38')](_0x5e61fa['query'],_0x214c0a[_0x7d92('0x30')]),_0x15ba68);if(_0x5e61fa['query'][_0x7d92('0x39')]){_0x1556f6[_0x7d92('0x3a')]=_[_0x7d92('0x3b')](_0x1556f6[_0x7d92('0x3a')],{'$or':_[_0x7d92('0x29')](_0x15ba68,function(_0x5058b6){if(_0x5058b6[_0x7d92('0x2b')]!==_0x7d92('0x3c')){var _0xc089a7={};_0xc089a7[_0x5058b6[_0x7d92('0x3d')]]={'$like':'%'+_0x5e61fa[_0x7d92('0x2e')][_0x7d92('0x39')]+'%'};return _0xc089a7;}})});}_0x1556f6=_[_0x7d92('0x3b')]({},_0x1556f6,_0x5e61fa[_0x7d92('0x3e')]);var _0x1fb337={'where':_0x1556f6[_0x7d92('0x3a')]};return db[_0x7d92('0x3f')][_0x7d92('0x1e')](_0x1fb337)['then'](function(_0x48a72e){_0x81287c[_0x7d92('0x1e')]=_0x48a72e;if(_0x5e61fa[_0x7d92('0x2e')][_0x7d92('0x40')]){_0x1556f6['include']=[{'all':!![]}];}return db[_0x7d92('0x3f')]['findAll'](_0x1556f6);})[_0x7d92('0x24')](function(_0x3cd498){_0x81287c[_0x7d92('0x41')]=_0x3cd498;return _0x81287c;})['then'](respondWithFilteredResult(_0x48d6ae,_0x1556f6))['catch'](handleError(_0x48d6ae,null));};exports[_0x7d92('0x42')]=function(_0x1cd518,_0x151a38){var _0x57e368={'raw':![],'where':{'id':_0x1cd518[_0x7d92('0x43')]['id']}},_0x2cd97e={};_0x2cd97e[_0x7d92('0x2d')]=_[_0x7d92('0x2f')](db[_0x7d92('0x3f')][_0x7d92('0x44')]);_0x2cd97e[_0x7d92('0x2e')]=_['keys'](_0x1cd518[_0x7d92('0x2e')]);_0x2cd97e['filters']=_[_0x7d92('0x31')](_0x2cd97e[_0x7d92('0x2d')],_0x2cd97e['query']);_0x57e368[_0x7d92('0x32')]=_[_0x7d92('0x31')](_0x2cd97e[_0x7d92('0x2d')],qs[_0x7d92('0x33')](_0x1cd518[_0x7d92('0x2e')][_0x7d92('0x33')]));_0x57e368['attributes']=_0x57e368['attributes'][_0x7d92('0x34')]?_0x57e368[_0x7d92('0x32')]:_0x2cd97e[_0x7d92('0x2d')];if(_0x1cd518[_0x7d92('0x2e')]['includeAll']){_0x57e368[_0x7d92('0x45')]=[{'all':!![]}];}_0x57e368=_['merge']({},_0x57e368,_0x1cd518[_0x7d92('0x3e')]);return db['SugarcrmConfiguration']['find'](_0x57e368)[_0x7d92('0x24')](handleEntityNotFound(_0x151a38,null))[_0x7d92('0x24')](respondWithResult(_0x151a38,null))[_0x7d92('0x46')](handleError(_0x151a38,null));};exports['create']=function(_0xe7d743,_0x5bebc6){return db[_0x7d92('0x3f')][_0x7d92('0x47')](_0xe7d743['body'],{})[_0x7d92('0x24')](respondWithResult(_0x5bebc6,0xc9))[_0x7d92('0x46')](handleError(_0x5bebc6,null));};exports[_0x7d92('0x23')]=function(_0xe4bd58,_0x114443){if(_0xe4bd58['body']['id']){delete _0xe4bd58[_0x7d92('0x48')]['id'];}return db[_0x7d92('0x3f')][_0x7d92('0x49')]({'where':{'id':_0xe4bd58['params']['id']}})['then'](handleEntityNotFound(_0x114443,null))['then'](saveUpdates(_0xe4bd58[_0x7d92('0x48')],null))['then'](respondWithResult(_0x114443,null))[_0x7d92('0x46')](handleError(_0x114443,null));};exports['destroy']=function(_0x49f3c4,_0x210e3a){return db[_0x7d92('0x3f')][_0x7d92('0x49')]({'where':{'id':_0x49f3c4['params']['id']}})[_0x7d92('0x24')](handleEntityNotFound(_0x210e3a,null))[_0x7d92('0x24')](removeEntity(_0x210e3a,null))[_0x7d92('0x46')](handleError(_0x210e3a,null));};exports[_0x7d92('0x4a')]=function(_0x1447cf,_0xed4cb1,_0x3c3156){var _0x227b94={};var _0x3b6c16={};var _0x508680;var _0x512fb3;return db[_0x7d92('0x3f')][_0x7d92('0x4b')]({'where':{'id':_0x1447cf[_0x7d92('0x43')]['id']}})[_0x7d92('0x24')](handleEntityNotFound(_0xed4cb1,null))[_0x7d92('0x24')](function(_0xe5d741){if(_0xe5d741){_0x508680=_0xe5d741;_0x3b6c16[_0x7d92('0x2d')]=_['keys'](db[_0x7d92('0x4c')][_0x7d92('0x44')]);_0x3b6c16[_0x7d92('0x2e')]=_[_0x7d92('0x2f')](_0x1447cf[_0x7d92('0x2e')]);_0x3b6c16[_0x7d92('0x30')]=_[_0x7d92('0x31')](_0x3b6c16[_0x7d92('0x2d')],_0x3b6c16['query']);_0x227b94[_0x7d92('0x32')]=_[_0x7d92('0x31')](_0x3b6c16['model'],qs[_0x7d92('0x33')](_0x1447cf[_0x7d92('0x2e')][_0x7d92('0x33')]));_0x227b94[_0x7d92('0x32')]=_0x227b94['attributes'][_0x7d92('0x34')]?_0x227b94[_0x7d92('0x32')]:_0x3b6c16[_0x7d92('0x2d')];_0x227b94[_0x7d92('0x37')]=qs[_0x7d92('0x4d')](_0x1447cf[_0x7d92('0x2e')]['sort']);_0x227b94['where']=qs[_0x7d92('0x30')](_[_0x7d92('0x38')](_0x1447cf[_0x7d92('0x2e')],_0x3b6c16[_0x7d92('0x30')]));if(_0x1447cf[_0x7d92('0x2e')][_0x7d92('0x39')]){_0x227b94['where']=_[_0x7d92('0x3b')](_0x227b94[_0x7d92('0x3a')],{'$or':_[_0x7d92('0x29')](_0x227b94['attributes'],function(_0x215afc){var _0x46fed9={};_0x46fed9[_0x215afc]={'$like':'%'+_0x1447cf[_0x7d92('0x2e')][_0x7d92('0x39')]+'%'};return _0x46fed9;})});}_0x227b94=_[_0x7d92('0x3b')]({},_0x227b94,_0x1447cf[_0x7d92('0x3e')]);return _0x508680[_0x7d92('0x4a')](_0x227b94);}})['then'](function(_0x514a29){if(_0x514a29){_0x512fb3=_0x514a29[_0x7d92('0x34')];if(!_0x1447cf[_0x7d92('0x2e')][_0x7d92('0x35')](_0x7d92('0x36'))){_0x227b94['limit']=qs[_0x7d92('0x1d')](_0x1447cf[_0x7d92('0x2e')][_0x7d92('0x1d')]);_0x227b94[_0x7d92('0x1b')]=qs['offset'](_0x1447cf[_0x7d92('0x2e')][_0x7d92('0x1b')]);}return _0x508680[_0x7d92('0x4a')](_0x227b94);}})[_0x7d92('0x24')](function(_0x510f5e){if(_0x510f5e){return _0x510f5e?{'count':_0x512fb3,'rows':_0x510f5e}:null;}})[_0x7d92('0x24')](respondWithResult(_0xed4cb1,null))[_0x7d92('0x46')](handleError(_0xed4cb1,null));};exports['getSubjects']=function(_0x3e338d,_0x3c8652,_0x3d7658){var _0x48d1e9={};var _0x6d4881={};var _0x1b267d;var _0x14b37d;return db[_0x7d92('0x3f')][_0x7d92('0x4b')]({'where':{'id':_0x3e338d['params']['id']}})[_0x7d92('0x24')](handleEntityNotFound(_0x3c8652,null))[_0x7d92('0x24')](function(_0x3d700b){if(_0x3d700b){_0x1b267d=_0x3d700b;_0x6d4881[_0x7d92('0x2d')]=_[_0x7d92('0x2f')](db['SugarcrmField'][_0x7d92('0x44')]);_0x6d4881[_0x7d92('0x2e')]=_[_0x7d92('0x2f')](_0x3e338d['query']);_0x6d4881[_0x7d92('0x30')]=_[_0x7d92('0x31')](_0x6d4881[_0x7d92('0x2d')],_0x6d4881[_0x7d92('0x2e')]);_0x48d1e9['attributes']=_[_0x7d92('0x31')](_0x6d4881['model'],qs[_0x7d92('0x33')](_0x3e338d[_0x7d92('0x2e')][_0x7d92('0x33')]));_0x48d1e9[_0x7d92('0x32')]=_0x48d1e9['attributes']['length']?_0x48d1e9[_0x7d92('0x32')]:_0x6d4881[_0x7d92('0x2d')];_0x48d1e9['order']=qs[_0x7d92('0x4d')](_0x3e338d['query'][_0x7d92('0x4d')]);_0x48d1e9['where']=qs['filters'](_[_0x7d92('0x38')](_0x3e338d[_0x7d92('0x2e')],_0x6d4881[_0x7d92('0x30')]));if(_0x3e338d[_0x7d92('0x2e')][_0x7d92('0x39')]){_0x48d1e9[_0x7d92('0x3a')]=_['merge'](_0x48d1e9['where'],{'$or':_['map'](_0x48d1e9[_0x7d92('0x32')],function(_0x2d99a2){var _0x3eeab7={};_0x3eeab7[_0x2d99a2]={'$like':'%'+_0x3e338d[_0x7d92('0x2e')][_0x7d92('0x39')]+'%'};return _0x3eeab7;})});}_0x48d1e9=_[_0x7d92('0x3b')]({},_0x48d1e9,_0x3e338d['options']);return _0x1b267d['getSubjects'](_0x48d1e9);}})[_0x7d92('0x24')](function(_0x2348e6){if(_0x2348e6){_0x14b37d=_0x2348e6[_0x7d92('0x34')];if(!_0x3e338d['query'][_0x7d92('0x35')](_0x7d92('0x36'))){_0x48d1e9[_0x7d92('0x1d')]=qs['limit'](_0x3e338d[_0x7d92('0x2e')]['limit']);_0x48d1e9['offset']=qs[_0x7d92('0x1b')](_0x3e338d[_0x7d92('0x2e')][_0x7d92('0x1b')]);}return _0x1b267d[_0x7d92('0x4e')](_0x48d1e9);}})[_0x7d92('0x24')](function(_0xd802e8){if(_0xd802e8){return _0xd802e8?{'count':_0x14b37d,'rows':_0xd802e8}:null;}})['then'](respondWithResult(_0x3c8652,null))[_0x7d92('0x46')](handleError(_0x3c8652,null));};exports['getDescriptions']=function(_0x2f5f7b,_0x222ca5,_0x1250e2){var _0xb2eae1={};var _0x568fea={};var _0x4cad0a;var _0x1d78cd;return db[_0x7d92('0x3f')]['findOne']({'where':{'id':_0x2f5f7b[_0x7d92('0x43')]['id']}})[_0x7d92('0x24')](handleEntityNotFound(_0x222ca5,null))[_0x7d92('0x24')](function(_0x5e8ca6){if(_0x5e8ca6){_0x4cad0a=_0x5e8ca6;_0x568fea[_0x7d92('0x2d')]=_[_0x7d92('0x2f')](db['SugarcrmField'][_0x7d92('0x44')]);_0x568fea[_0x7d92('0x2e')]=_[_0x7d92('0x2f')](_0x2f5f7b[_0x7d92('0x2e')]);_0x568fea[_0x7d92('0x30')]=_[_0x7d92('0x31')](_0x568fea[_0x7d92('0x2d')],_0x568fea['query']);_0xb2eae1[_0x7d92('0x32')]=_['intersection'](_0x568fea[_0x7d92('0x2d')],qs[_0x7d92('0x33')](_0x2f5f7b[_0x7d92('0x2e')]['fields']));_0xb2eae1[_0x7d92('0x32')]=_0xb2eae1[_0x7d92('0x32')][_0x7d92('0x34')]?_0xb2eae1['attributes']:_0x568fea[_0x7d92('0x2d')];_0xb2eae1[_0x7d92('0x37')]=qs[_0x7d92('0x4d')](_0x2f5f7b[_0x7d92('0x2e')][_0x7d92('0x4d')]);_0xb2eae1[_0x7d92('0x3a')]=qs[_0x7d92('0x30')](_[_0x7d92('0x38')](_0x2f5f7b['query'],_0x568fea[_0x7d92('0x30')]));if(_0x2f5f7b[_0x7d92('0x2e')][_0x7d92('0x39')]){_0xb2eae1[_0x7d92('0x3a')]=_[_0x7d92('0x3b')](_0xb2eae1[_0x7d92('0x3a')],{'$or':_[_0x7d92('0x29')](_0xb2eae1[_0x7d92('0x32')],function(_0x49e8da){var _0x13d9fd={};_0x13d9fd[_0x49e8da]={'$like':'%'+_0x2f5f7b[_0x7d92('0x2e')][_0x7d92('0x39')]+'%'};return _0x13d9fd;})});}_0xb2eae1=_[_0x7d92('0x3b')]({},_0xb2eae1,_0x2f5f7b[_0x7d92('0x3e')]);return _0x4cad0a[_0x7d92('0x4f')](_0xb2eae1);}})['then'](function(_0x5c869c){if(_0x5c869c){_0x1d78cd=_0x5c869c['length'];if(!_0x2f5f7b[_0x7d92('0x2e')][_0x7d92('0x35')]('nolimit')){_0xb2eae1['limit']=qs['limit'](_0x2f5f7b[_0x7d92('0x2e')]['limit']);_0xb2eae1['offset']=qs['offset'](_0x2f5f7b[_0x7d92('0x2e')][_0x7d92('0x1b')]);}return _0x4cad0a[_0x7d92('0x4f')](_0xb2eae1);}})[_0x7d92('0x24')](function(_0x1391f){if(_0x1391f){return _0x1391f?{'count':_0x1d78cd,'rows':_0x1391f}:null;}})[_0x7d92('0x24')](respondWithResult(_0x222ca5,null))[_0x7d92('0x46')](handleError(_0x222ca5,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index fd78364..866381a 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 _0x152b=['exports','define','lodash','util','../../config/logger','moment','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes'];(function(_0x25a851,_0x2849ba){var _0x24e658=function(_0x3e15a4){while(--_0x3e15a4){_0x25a851['push'](_0x25a851['shift']());}};_0x24e658(++_0x2849ba);}(_0x152b,0x92));var _0xb152=function(_0x25248b,_0x3c8491){_0x25248b=_0x25248b-0x0;var _0x509939=_0x152b[_0x25248b];return _0x509939;};'use strict';var _=require(_0xb152('0x0'));var util=require(_0xb152('0x1'));var logger=require(_0xb152('0x2'))('api');var moment=require(_0xb152('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb152('0x4'));var config=require(_0xb152('0x5'));var attributes=require(_0xb152('0x6'));module[_0xb152('0x7')]=function(_0x1bd8bf,_0x4598e5){return _0x1bd8bf[_0xb152('0x8')]('SugarcrmConfiguration',attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5a68=['lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','define','SugarcrmConfiguration'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0x5a68,0x19a));var _0x85a6=function(_0x35eb1d,_0x15d9e1){_0x35eb1d=_0x35eb1d-0x0;var _0x4ab272=_0x5a68[_0x35eb1d];return _0x4ab272;};'use strict';var _=require(_0x85a6('0x0'));var util=require(_0x85a6('0x1'));var logger=require(_0x85a6('0x2'))('api');var moment=require(_0x85a6('0x3'));var BPromise=require(_0x85a6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x85a6('0x5'));var rimraf=require(_0x85a6('0x6'));var config=require(_0x85a6('0x7'));var attributes=require('./intSugarcrmConfiguration.attributes');module['exports']=function(_0x5c01a5,_0xbd5d20){return _0x5c01a5[_0x85a6('0x8')](_0x85a6('0x9'),attributes,{'tableName':'int_sugarcrm_configurations','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 7d21c2c..72291e4 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 _0xadd1=['then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x5518b4,_0x504994){var _0x177744=function(_0x53aca2){while(--_0x53aca2){_0x5518b4['push'](_0x5518b4['shift']());}};_0x177744(++_0x504994);}(_0xadd1,0x16b));var _0x1add=function(_0x4ec189,_0x1a2f1c){_0x4ec189=_0x4ec189-0x0;var _0x2872e5=_0xadd1[_0x4ec189];return _0x2872e5;};'use strict';var _=require(_0x1add('0x0'));var util=require(_0x1add('0x1'));var moment=require(_0x1add('0x2'));var BPromise=require('bluebird');var rs=require(_0x1add('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1add('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1add('0x5'))(_0x1add('0x6'));var config=require(_0x1add('0x7'));var jayson=require(_0x1add('0x8'));var client=jayson[_0x1add('0x9')][_0x1add('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3074eb,_0x3644d1,_0x375574){return new BPromise(function(_0x51d6df,_0x43c659){return client['request'](_0x3074eb,_0x375574)[_0x1add('0xb')](function(_0x1a53eb){logger[_0x1add('0xc')](_0x1add('0xd'),_0x3644d1,_0x1add('0xe'));logger[_0x1add('0xf')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x3644d1,'request\x20sent',JSON[_0x1add('0x10')](_0x1a53eb));if(_0x1a53eb[_0x1add('0x11')]){if(_0x1a53eb[_0x1add('0x11')][_0x1add('0x12')]===0x1f4){logger[_0x1add('0x11')](_0x1add('0xd'),_0x3644d1,_0x1a53eb[_0x1add('0x11')][_0x1add('0x13')]);return _0x43c659(_0x1a53eb[_0x1add('0x11')][_0x1add('0x13')]);}logger[_0x1add('0x11')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x3644d1,_0x1a53eb['error'][_0x1add('0x13')]);return _0x51d6df(_0x1a53eb[_0x1add('0x11')]['message']);}else{logger['info']('SugarcrmConfiguration,\x20%s,\x20%s',_0x3644d1,_0x1add('0xe'));_0x51d6df(_0x1a53eb[_0x1add('0x14')][_0x1add('0x13')]);}})[_0x1add('0x15')](function(_0x5c375c){logger[_0x1add('0x11')](_0x1add('0xd'),_0x3644d1,_0x5c375c);_0x43c659(_0x5c375c);});});} \ No newline at end of file +var _0x9f4e=['../../config/logger','rpc','client','request','then','info','request\x20sent','debug','error','code','SugarcrmConfiguration,\x20%s,\x20%s','message','lodash','util','randomstring','../../config/utils'];(function(_0x374dd6,_0xadc0eb){var _0x1aadd0=function(_0x3b87be){while(--_0x3b87be){_0x374dd6['push'](_0x374dd6['shift']());}};_0x1aadd0(++_0xadc0eb);}(_0x9f4e,0x17c));var _0xe9f4=function(_0x46d87a,_0x5183db){_0x46d87a=_0x46d87a-0x0;var _0x115296=_0x9f4e[_0x46d87a];return _0x115296;};'use strict';var _=require(_0xe9f4('0x0'));var util=require(_0xe9f4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe9f4('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe9f4('0x3'));var logger=require(_0xe9f4('0x4'))(_0xe9f4('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe9f4('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a850a,_0x425c7f,_0x181ca4){return new BPromise(function(_0x40f5f,_0x978da1){return client[_0xe9f4('0x7')](_0x5a850a,_0x181ca4)[_0xe9f4('0x8')](function(_0x501969){logger[_0xe9f4('0x9')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x425c7f,_0xe9f4('0xa'));logger[_0xe9f4('0xb')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x425c7f,'request\x20sent',JSON['stringify'](_0x501969));if(_0x501969[_0xe9f4('0xc')]){if(_0x501969[_0xe9f4('0xc')][_0xe9f4('0xd')]===0x1f4){logger[_0xe9f4('0xc')](_0xe9f4('0xe'),_0x425c7f,_0x501969['error'][_0xe9f4('0xf')]);return _0x978da1(_0x501969[_0xe9f4('0xc')][_0xe9f4('0xf')]);}logger['error'](_0xe9f4('0xe'),_0x425c7f,_0x501969[_0xe9f4('0xc')]['message']);return _0x40f5f(_0x501969['error']['message']);}else{logger[_0xe9f4('0x9')](_0xe9f4('0xe'),_0x425c7f,_0xe9f4('0xa'));_0x40f5f(_0x501969['result'][_0xe9f4('0xf')]);}})['catch'](function(_0x539fb7){logger['error'](_0xe9f4('0xe'),_0x425c7f,_0x539fb7);_0x978da1(_0x539fb7);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index dfff6cc..957bf5f 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 _0x9233=['destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','/:id','show','post','create','delete'];(function(_0x107eda,_0x4dbe6e){var _0x5794f2=function(_0x558701){while(--_0x558701){_0x107eda['push'](_0x107eda['shift']());}};_0x5794f2(++_0x4dbe6e);}(_0x9233,0xf2));var _0x3923=function(_0x770f7,_0x3af003){_0x770f7=_0x770f7-0x0;var _0xe797c6=_0x9233[_0x770f7];return _0xe797c6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3923('0x0'));var timeout=require(_0x3923('0x1'));var express=require(_0x3923('0x2'));var router=express[_0x3923('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3923('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3923('0x5'));var controller=require(_0x3923('0x6'));router[_0x3923('0x7')]('/',auth[_0x3923('0x8')](),controller['index']);router['get'](_0x3923('0x9'),auth[_0x3923('0x8')](),controller[_0x3923('0xa')]);router[_0x3923('0xb')]('/',auth[_0x3923('0x8')](),controller[_0x3923('0xc')]);router['put'](_0x3923('0x9'),auth[_0x3923('0x8')](),controller['update']);router[_0x3923('0xd')](_0x3923('0x9'),auth[_0x3923('0x8')](),controller[_0x3923('0xe')]);module[_0x3923('0xf')]=router; \ No newline at end of file +var _0xa97d=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','put','update','delete','exports','multer','path','connect-timeout'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0xa97d,0xfd));var _0xda97=function(_0x3c42bc,_0x3ca03d){_0x3c42bc=_0x3c42bc-0x0;var _0x128473=_0xa97d[_0x3c42bc];return _0x128473;};'use strict';var multer=require(_0xda97('0x0'));var util=require('util');var path=require(_0xda97('0x1'));var timeout=require(_0xda97('0x2'));var express=require(_0xda97('0x3'));var router=express[_0xda97('0x4')]();var fs_extra=require(_0xda97('0x5'));var auth=require(_0xda97('0x6'));var interaction=require(_0xda97('0x7'));var config=require(_0xda97('0x8'));var controller=require('./intSugarcrmField.controller');router[_0xda97('0x9')]('/',auth[_0xda97('0xa')](),controller['index']);router[_0xda97('0x9')]('/:id',auth[_0xda97('0xa')](),controller[_0xda97('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xda97('0xc')]('/:id',auth[_0xda97('0xa')](),controller[_0xda97('0xd')]);router[_0xda97('0xe')]('/:id',auth[_0xda97('0xa')](),controller['destroy']);module[_0xda97('0xf')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 532c615..ccc60fc 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 _0x9023=['STRING','variable','BOOLEAN','exports','ENUM','string','customVariable','picklist'];(function(_0x58f6fd,_0x8e6c3d){var _0x44dce4=function(_0x451ea8){while(--_0x451ea8){_0x58f6fd['push'](_0x58f6fd['shift']());}};_0x44dce4(++_0x8e6c3d);}(_0x9023,0x103));var _0x3902=function(_0x285661,_0x2d7dad){_0x285661=_0x285661-0x0;var _0x5f4017=_0x9023[_0x285661];return _0x5f4017;};'use strict';var Sequelize=require('sequelize');module[_0x3902('0x0')]={'type':{'type':Sequelize[_0x3902('0x1')](_0x3902('0x2'),'variable',_0x3902('0x3'),'keyValue',_0x3902('0x4')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x3902('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x3902('0x2'),_0x3902('0x6'),_0x3902('0x3'))},'keyContent':{'type':Sequelize[_0x3902('0x5')]},'idField':{'type':Sequelize[_0x3902('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x3902('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3902('0x5')]}}; \ No newline at end of file +var _0xd766=['exports','ENUM','string','customVariable','keyValue','picklist','STRING','BOOLEAN'];(function(_0x1a0cb4,_0x38cef5){var _0x40b2aa=function(_0xdb0636){while(--_0xdb0636){_0x1a0cb4['push'](_0x1a0cb4['shift']());}};_0x40b2aa(++_0x38cef5);}(_0xd766,0x140));var _0x6d76=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xd766[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require('sequelize');module[_0x6d76('0x0')]={'type':{'type':Sequelize[_0x6d76('0x1')](_0x6d76('0x2'),'variable',_0x6d76('0x3'),_0x6d76('0x4'),_0x6d76('0x5')),'defaultValue':_0x6d76('0x2')},'content':{'type':Sequelize[_0x6d76('0x6')]},'key':{'type':Sequelize[_0x6d76('0x6')]},'keyType':{'type':Sequelize[_0x6d76('0x1')](_0x6d76('0x2'),'variable',_0x6d76('0x3'))},'keyContent':{'type':Sequelize[_0x6d76('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x6d76('0x6')]},'customField':{'type':Sequelize[_0x6d76('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index a5d9e29..56761a5 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 _0xb219=['then','sendStatus','error','name','send','index','map','SugarcrmField','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','rawAttributes','find','catch','create','body','params','rimraf','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','reject','save','update'];(function(_0x3c92b4,_0x48c955){var _0x5bf5a5=function(_0xdc34e7){while(--_0xdc34e7){_0x3c92b4['push'](_0x3c92b4['shift']());}};_0x5bf5a5(++_0x48c955);}(_0xb219,0x6b));var _0x9b21=function(_0x1c3c35,_0x5c49a6){_0x1c3c35=_0x1c3c35-0x0;var _0x1cd8b6=_0xb219[_0x1c3c35];return _0x1cd8b6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9b21('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9b21('0x1'));var moment=require(_0x9b21('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x9b21('0x3'));var util=require(_0x9b21('0x4'));var path=require(_0x9b21('0x5'));var sox=require('sox');var csv=require(_0x9b21('0x6'));var ejs=require(_0x9b21('0x7'));var fs=require('fs');var fs_extra=require(_0x9b21('0x8'));var _=require('lodash');var squel=require(_0x9b21('0x9'));var crypto=require(_0x9b21('0xa'));var jsforce=require(_0x9b21('0xb'));var deskjs=require(_0x9b21('0xc'));var toCsv=require('to-csv');var querystring=require(_0x9b21('0xd'));var Papa=require(_0x9b21('0xe'));var Redis=require(_0x9b21('0xf'));var authService=require(_0x9b21('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x9b21('0x11'));var hardwareService=require(_0x9b21('0x12'));var logger=require('../../config/logger')(_0x9b21('0x13'));var utils=require(_0x9b21('0x14'));var config=require(_0x9b21('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x9b21('0x16'))['db'];function respondWithStatusCode(_0x46817a,_0x3f8561){_0x3f8561=_0x3f8561||0xcc;return function(_0x490111){if(_0x490111){return _0x46817a['sendStatus'](_0x3f8561);}return _0x46817a[_0x9b21('0x17')](_0x3f8561)['end']();};}function respondWithResult(_0x4c3305,_0x4c9f90){_0x4c9f90=_0x4c9f90||0xc8;return function(_0x594c48){if(_0x594c48){return _0x4c3305['status'](_0x4c9f90)['json'](_0x594c48);}};}function respondWithFilteredResult(_0x1ff202,_0x46cc62){return function(_0x5ab156){if(_0x5ab156){var _0x337bbc=typeof _0x46cc62[_0x9b21('0x18')]===_0x9b21('0x19')&&typeof _0x46cc62[_0x9b21('0x1a')]===_0x9b21('0x19');var _0x284135=_0x5ab156['count'];var _0x2c9346=_0x337bbc?0x0:_0x46cc62[_0x9b21('0x18')];var _0x235c56=_0x337bbc?_0x5ab156[_0x9b21('0x1b')]:_0x46cc62['offset']+_0x46cc62[_0x9b21('0x1a')];var _0xe16673;if(_0x235c56>=_0x284135){_0x235c56=_0x284135;_0xe16673=0xc8;}else{_0xe16673=0xce;}_0x1ff202[_0x9b21('0x17')](_0xe16673);return _0x1ff202[_0x9b21('0x1c')](_0x9b21('0x1d'),_0x2c9346+'-'+_0x235c56+'/'+_0x284135)['json'](_0x5ab156);}return null;};}function patchUpdates(_0x5ea1c3){return function(_0x393c2f){try{jsonpatch['apply'](_0x393c2f,_0x5ea1c3,!![]);}catch(_0xd20807){return BPromise[_0x9b21('0x1e')](_0xd20807);}return _0x393c2f[_0x9b21('0x1f')]();};}function saveUpdates(_0x23ea5e,_0x465696){return function(_0x259934){if(_0x259934){return _0x259934[_0x9b21('0x20')](_0x23ea5e)[_0x9b21('0x21')](function(_0x580237){return _0x580237;});}return null;};}function removeEntity(_0x42b732,_0x4ddb46){return function(_0x5ecdf0){if(_0x5ecdf0){return _0x5ecdf0['destroy']()[_0x9b21('0x21')](function(){_0x42b732['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ca8c8,_0x3ef4ce){return function(_0x430ca0){if(!_0x430ca0){_0x2ca8c8[_0x9b21('0x22')](0x194);}return _0x430ca0;};}function handleError(_0x184dbd,_0xfde3ea){_0xfde3ea=_0xfde3ea||0x1f4;return function(_0x4aae69){logger[_0x9b21('0x23')](_0x4aae69['stack']);if(_0x4aae69[_0x9b21('0x24')]){delete _0x4aae69[_0x9b21('0x24')];}_0x184dbd[_0x9b21('0x17')](_0xfde3ea)[_0x9b21('0x25')](_0x4aae69);};}exports[_0x9b21('0x26')]=function(_0x2c8f0a,_0x4c3469){var _0xbd523={},_0x33b08c={},_0xb44363={'count':0x0,'rows':[]};var _0x8c5da=_[_0x9b21('0x27')](db[_0x9b21('0x28')]['rawAttributes'],function(_0x528212){return{'name':_0x528212[_0x9b21('0x29')],'type':_0x528212['type'][_0x9b21('0x2a')]};});_0x33b08c[_0x9b21('0x2b')]=_[_0x9b21('0x27')](_0x8c5da,'name');_0x33b08c['query']=_[_0x9b21('0x2c')](_0x2c8f0a[_0x9b21('0x2d')]);_0x33b08c[_0x9b21('0x2e')]=_[_0x9b21('0x2f')](_0x33b08c[_0x9b21('0x2b')],_0x33b08c[_0x9b21('0x2d')]);_0xbd523[_0x9b21('0x30')]=_['intersection'](_0x33b08c[_0x9b21('0x2b')],qs['fields'](_0x2c8f0a[_0x9b21('0x2d')][_0x9b21('0x31')]));_0xbd523[_0x9b21('0x30')]=_0xbd523['attributes'][_0x9b21('0x32')]?_0xbd523[_0x9b21('0x30')]:_0x33b08c[_0x9b21('0x2b')];if(!_0x2c8f0a[_0x9b21('0x2d')][_0x9b21('0x33')](_0x9b21('0x34'))){_0xbd523[_0x9b21('0x1a')]=qs['limit'](_0x2c8f0a[_0x9b21('0x2d')]['limit']);_0xbd523[_0x9b21('0x18')]=qs[_0x9b21('0x18')](_0x2c8f0a[_0x9b21('0x2d')][_0x9b21('0x18')]);}_0xbd523[_0x9b21('0x35')]=qs[_0x9b21('0x36')](_0x2c8f0a[_0x9b21('0x2d')]['sort']);_0xbd523[_0x9b21('0x37')]=qs[_0x9b21('0x2e')](_[_0x9b21('0x38')](_0x2c8f0a[_0x9b21('0x2d')],_0x33b08c[_0x9b21('0x2e')]),_0x8c5da);if(_0x2c8f0a[_0x9b21('0x2d')]['filter']){_0xbd523['where']=_[_0x9b21('0x39')](_0xbd523['where'],{'$or':_[_0x9b21('0x27')](_0x8c5da,function(_0x38b00a){if(_0x38b00a['type']!==_0x9b21('0x3a')){var _0x388081={};_0x388081[_0x38b00a[_0x9b21('0x24')]]={'$like':'%'+_0x2c8f0a[_0x9b21('0x2d')][_0x9b21('0x3b')]+'%'};return _0x388081;}})});}_0xbd523=_['merge']({},_0xbd523,_0x2c8f0a[_0x9b21('0x3c')]);var _0x8e3bf7={'where':_0xbd523['where']};return db[_0x9b21('0x28')]['count'](_0x8e3bf7)[_0x9b21('0x21')](function(_0x4a15e9){_0xb44363[_0x9b21('0x1b')]=_0x4a15e9;if(_0x2c8f0a[_0x9b21('0x2d')][_0x9b21('0x3d')]){_0xbd523[_0x9b21('0x3e')]=[{'all':!![]}];}return db[_0x9b21('0x28')]['findAll'](_0xbd523);})[_0x9b21('0x21')](function(_0x366bec){_0xb44363[_0x9b21('0x3f')]=_0x366bec;return _0xb44363;})['then'](respondWithFilteredResult(_0x4c3469,_0xbd523))['catch'](handleError(_0x4c3469,null));};exports['show']=function(_0x4c11fd,_0x4cc395){var _0x4b5023={'raw':!![],'where':{'id':_0x4c11fd['params']['id']}},_0x1e5088={};_0x1e5088['model']=_[_0x9b21('0x2c')](db['SugarcrmField'][_0x9b21('0x40')]);_0x1e5088['query']=_['keys'](_0x4c11fd[_0x9b21('0x2d')]);_0x1e5088[_0x9b21('0x2e')]=_[_0x9b21('0x2f')](_0x1e5088[_0x9b21('0x2b')],_0x1e5088[_0x9b21('0x2d')]);_0x4b5023[_0x9b21('0x30')]=_['intersection'](_0x1e5088['model'],qs[_0x9b21('0x31')](_0x4c11fd[_0x9b21('0x2d')][_0x9b21('0x31')]));_0x4b5023[_0x9b21('0x30')]=_0x4b5023[_0x9b21('0x30')][_0x9b21('0x32')]?_0x4b5023['attributes']:_0x1e5088[_0x9b21('0x2b')];if(_0x4c11fd[_0x9b21('0x2d')][_0x9b21('0x3d')]){_0x4b5023[_0x9b21('0x3e')]=[{'all':!![]}];}_0x4b5023=_[_0x9b21('0x39')]({},_0x4b5023,_0x4c11fd[_0x9b21('0x3c')]);return db[_0x9b21('0x28')][_0x9b21('0x41')](_0x4b5023)['then'](handleEntityNotFound(_0x4cc395,null))[_0x9b21('0x21')](respondWithResult(_0x4cc395,null))[_0x9b21('0x42')](handleError(_0x4cc395,null));};exports[_0x9b21('0x43')]=function(_0x19066f,_0x21a921){return db['SugarcrmField']['create'](_0x19066f[_0x9b21('0x44')],{})[_0x9b21('0x21')](respondWithResult(_0x21a921,0xc9))[_0x9b21('0x42')](handleError(_0x21a921,null));};exports[_0x9b21('0x20')]=function(_0x3eb088,_0x20ba8f){if(_0x3eb088[_0x9b21('0x44')]['id']){delete _0x3eb088[_0x9b21('0x44')]['id'];}return db[_0x9b21('0x28')][_0x9b21('0x41')]({'where':{'id':_0x3eb088['params']['id']}})[_0x9b21('0x21')](handleEntityNotFound(_0x20ba8f,null))['then'](saveUpdates(_0x3eb088[_0x9b21('0x44')],null))['then'](respondWithResult(_0x20ba8f,null))[_0x9b21('0x42')](handleError(_0x20ba8f,null));};exports['destroy']=function(_0x20b061,_0x282830){return db['SugarcrmField'][_0x9b21('0x41')]({'where':{'id':_0x20b061[_0x9b21('0x45')]['id']}})['then'](handleEntityNotFound(_0x282830,null))[_0x9b21('0x21')](removeEntity(_0x282830,null))['catch'](handleError(_0x282830,null));}; \ No newline at end of file +var _0x8112=['error','stack','name','send','index','map','fieldName','type','key','model','query','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','SugarcrmField','include','findAll','then','rows','catch','show','keys','length','find','create','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','end','sendStatus'];(function(_0x3a60b8,_0x47caab){var _0x4eb583=function(_0x2251b5){while(--_0x2251b5){_0x3a60b8['push'](_0x3a60b8['shift']());}};_0x4eb583(++_0x47caab);}(_0x8112,0x18e));var _0x2811=function(_0x2a6387,_0x4c5702){_0x2a6387=_0x2a6387-0x0;var _0xfc7c54=_0x8112[_0x2a6387];return _0xfc7c54;};'use strict';var emlformat=require(_0x2811('0x0'));var rimraf=require(_0x2811('0x1'));var zipdir=require(_0x2811('0x2'));var jsonpatch=require(_0x2811('0x3'));var rp=require(_0x2811('0x4'));var moment=require(_0x2811('0x5'));var BPromise=require(_0x2811('0x6'));var Mustache=require(_0x2811('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x2811('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2811('0x9'));var _=require(_0x2811('0xa'));var squel=require('squel');var crypto=require(_0x2811('0xb'));var jsforce=require(_0x2811('0xc'));var deskjs=require(_0x2811('0xd'));var toCsv=require(_0x2811('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2811('0xe'));var qs=require(_0x2811('0xf'));var as=require(_0x2811('0x10'));var hardwareService=require(_0x2811('0x11'));var logger=require(_0x2811('0x12'))(_0x2811('0x13'));var utils=require('../../config/utils');var config=require(_0x2811('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x2811('0x15'))['db'];function respondWithStatusCode(_0x3f18c5,_0x1c9ec5){_0x1c9ec5=_0x1c9ec5||0xcc;return function(_0x160ba7){if(_0x160ba7){return _0x3f18c5['sendStatus'](_0x1c9ec5);}return _0x3f18c5['status'](_0x1c9ec5)['end']();};}function respondWithResult(_0x11129f,_0x23f69a){_0x23f69a=_0x23f69a||0xc8;return function(_0x4137ae){if(_0x4137ae){return _0x11129f[_0x2811('0x16')](_0x23f69a)[_0x2811('0x17')](_0x4137ae);}};}function respondWithFilteredResult(_0xcb1721,_0x41b47a){return function(_0x104670){if(_0x104670){var _0x453498=typeof _0x41b47a[_0x2811('0x18')]===_0x2811('0x19')&&typeof _0x41b47a[_0x2811('0x1a')]===_0x2811('0x19');var _0x451315=_0x104670['count'];var _0x18da3b=_0x453498?0x0:_0x41b47a['offset'];var _0x5a691f=_0x453498?_0x104670[_0x2811('0x1b')]:_0x41b47a['offset']+_0x41b47a[_0x2811('0x1a')];var _0x20fb5d;if(_0x5a691f>=_0x451315){_0x5a691f=_0x451315;_0x20fb5d=0xc8;}else{_0x20fb5d=0xce;}_0xcb1721['status'](_0x20fb5d);return _0xcb1721[_0x2811('0x1c')](_0x2811('0x1d'),_0x18da3b+'-'+_0x5a691f+'/'+_0x451315)[_0x2811('0x17')](_0x104670);}return null;};}function patchUpdates(_0x5b14dc){return function(_0x18b20d){try{jsonpatch['apply'](_0x18b20d,_0x5b14dc,!![]);}catch(_0x160f94){return BPromise[_0x2811('0x1e')](_0x160f94);}return _0x18b20d['save']();};}function saveUpdates(_0x1c385e,_0x1d5887){return function(_0x401625){if(_0x401625){return _0x401625[_0x2811('0x1f')](_0x1c385e)['then'](function(_0x5ba482){return _0x5ba482;});}return null;};}function removeEntity(_0x2f6c56,_0x3be072){return function(_0x5a22a6){if(_0x5a22a6){return _0x5a22a6['destroy']()['then'](function(){_0x2f6c56[_0x2811('0x16')](0xcc)[_0x2811('0x20')]();});}};}function handleEntityNotFound(_0x41db4b,_0x1a746d){return function(_0x277fe0){if(!_0x277fe0){_0x41db4b[_0x2811('0x21')](0x194);}return _0x277fe0;};}function handleError(_0x34122f,_0x2276da){_0x2276da=_0x2276da||0x1f4;return function(_0x229bf3){logger[_0x2811('0x22')](_0x229bf3[_0x2811('0x23')]);if(_0x229bf3[_0x2811('0x24')]){delete _0x229bf3[_0x2811('0x24')];}_0x34122f['status'](_0x2276da)[_0x2811('0x25')](_0x229bf3);};}exports[_0x2811('0x26')]=function(_0xebc43f,_0x1e60f5){var _0x31c23b={},_0x139354={},_0x56deda={'count':0x0,'rows':[]};var _0x4881a6=_[_0x2811('0x27')](db['SugarcrmField']['rawAttributes'],function(_0x578a3b){return{'name':_0x578a3b[_0x2811('0x28')],'type':_0x578a3b[_0x2811('0x29')][_0x2811('0x2a')]};});_0x139354[_0x2811('0x2b')]=_[_0x2811('0x27')](_0x4881a6,_0x2811('0x24'));_0x139354[_0x2811('0x2c')]=_['keys'](_0xebc43f[_0x2811('0x2c')]);_0x139354[_0x2811('0x2d')]=_[_0x2811('0x2e')](_0x139354['model'],_0x139354['query']);_0x31c23b[_0x2811('0x2f')]=_[_0x2811('0x2e')](_0x139354[_0x2811('0x2b')],qs[_0x2811('0x30')](_0xebc43f[_0x2811('0x2c')][_0x2811('0x30')]));_0x31c23b['attributes']=_0x31c23b[_0x2811('0x2f')]['length']?_0x31c23b[_0x2811('0x2f')]:_0x139354[_0x2811('0x2b')];if(!_0xebc43f['query']['hasOwnProperty'](_0x2811('0x31'))){_0x31c23b[_0x2811('0x1a')]=qs[_0x2811('0x1a')](_0xebc43f['query'][_0x2811('0x1a')]);_0x31c23b['offset']=qs['offset'](_0xebc43f[_0x2811('0x2c')][_0x2811('0x18')]);}_0x31c23b[_0x2811('0x32')]=qs[_0x2811('0x33')](_0xebc43f[_0x2811('0x2c')][_0x2811('0x33')]);_0x31c23b['where']=qs['filters'](_[_0x2811('0x34')](_0xebc43f['query'],_0x139354[_0x2811('0x2d')]),_0x4881a6);if(_0xebc43f[_0x2811('0x2c')][_0x2811('0x35')]){_0x31c23b[_0x2811('0x36')]=_[_0x2811('0x37')](_0x31c23b[_0x2811('0x36')],{'$or':_[_0x2811('0x27')](_0x4881a6,function(_0x29e319){if(_0x29e319['type']!==_0x2811('0x38')){var _0x5e316f={};_0x5e316f[_0x29e319[_0x2811('0x24')]]={'$like':'%'+_0xebc43f[_0x2811('0x2c')]['filter']+'%'};return _0x5e316f;}})});}_0x31c23b=_[_0x2811('0x37')]({},_0x31c23b,_0xebc43f[_0x2811('0x39')]);var _0x41d50f={'where':_0x31c23b[_0x2811('0x36')]};return db[_0x2811('0x3a')][_0x2811('0x1b')](_0x41d50f)['then'](function(_0x34f372){_0x56deda[_0x2811('0x1b')]=_0x34f372;if(_0xebc43f['query']['includeAll']){_0x31c23b[_0x2811('0x3b')]=[{'all':!![]}];}return db[_0x2811('0x3a')][_0x2811('0x3c')](_0x31c23b);})[_0x2811('0x3d')](function(_0x435485){_0x56deda[_0x2811('0x3e')]=_0x435485;return _0x56deda;})['then'](respondWithFilteredResult(_0x1e60f5,_0x31c23b))[_0x2811('0x3f')](handleError(_0x1e60f5,null));};exports[_0x2811('0x40')]=function(_0x4b011a,_0x4c056b){var _0x474707={'raw':!![],'where':{'id':_0x4b011a['params']['id']}},_0x126043={};_0x126043[_0x2811('0x2b')]=_[_0x2811('0x41')](db[_0x2811('0x3a')]['rawAttributes']);_0x126043[_0x2811('0x2c')]=_[_0x2811('0x41')](_0x4b011a[_0x2811('0x2c')]);_0x126043['filters']=_[_0x2811('0x2e')](_0x126043[_0x2811('0x2b')],_0x126043[_0x2811('0x2c')]);_0x474707[_0x2811('0x2f')]=_[_0x2811('0x2e')](_0x126043[_0x2811('0x2b')],qs[_0x2811('0x30')](_0x4b011a[_0x2811('0x2c')][_0x2811('0x30')]));_0x474707[_0x2811('0x2f')]=_0x474707[_0x2811('0x2f')][_0x2811('0x42')]?_0x474707[_0x2811('0x2f')]:_0x126043[_0x2811('0x2b')];if(_0x4b011a[_0x2811('0x2c')]['includeAll']){_0x474707[_0x2811('0x3b')]=[{'all':!![]}];}_0x474707=_[_0x2811('0x37')]({},_0x474707,_0x4b011a[_0x2811('0x39')]);return db['SugarcrmField'][_0x2811('0x43')](_0x474707)[_0x2811('0x3d')](handleEntityNotFound(_0x4c056b,null))['then'](respondWithResult(_0x4c056b,null))[_0x2811('0x3f')](handleError(_0x4c056b,null));};exports[_0x2811('0x44')]=function(_0x234d1f,_0x38d43b){return db[_0x2811('0x3a')][_0x2811('0x44')](_0x234d1f['body'],{})[_0x2811('0x3d')](respondWithResult(_0x38d43b,0xc9))['catch'](handleError(_0x38d43b,null));};exports[_0x2811('0x1f')]=function(_0x11f3de,_0x1ab8dc){if(_0x11f3de[_0x2811('0x45')]['id']){delete _0x11f3de[_0x2811('0x45')]['id'];}return db[_0x2811('0x3a')]['find']({'where':{'id':_0x11f3de[_0x2811('0x46')]['id']}})[_0x2811('0x3d')](handleEntityNotFound(_0x1ab8dc,null))[_0x2811('0x3d')](saveUpdates(_0x11f3de[_0x2811('0x45')],null))[_0x2811('0x3d')](respondWithResult(_0x1ab8dc,null))[_0x2811('0x3f')](handleError(_0x1ab8dc,null));};exports[_0x2811('0x47')]=function(_0x57026a,_0x4c8dcc){return db['SugarcrmField'][_0x2811('0x43')]({'where':{'id':_0x57026a['params']['id']}})[_0x2811('0x3d')](handleEntityNotFound(_0x4c8dcc,null))[_0x2811('0x3d')](removeEntity(_0x4c8dcc,null))[_0x2811('0x3f')](handleError(_0x4c8dcc,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 8ed8ba1..791a633 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 _0x9625=['bluebird','request-promise','path','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','sugarcrm_unique_index','FieldId','lodash','util','api','moment'];(function(_0x40e334,_0x35dba4){var _0x13c50f=function(_0xd43a89){while(--_0xd43a89){_0x40e334['push'](_0x40e334['shift']());}};_0x13c50f(++_0x35dba4);}(_0x9625,0xa4));var _0x5962=function(_0x3c942c,_0x271ac3){_0x3c942c=_0x3c942c-0x0;var _0x4a3a05=_0x9625[_0x3c942c];return _0x4a3a05;};'use strict';var _=require(_0x5962('0x0'));var util=require(_0x5962('0x1'));var logger=require('../../config/logger')(_0x5962('0x2'));var moment=require(_0x5962('0x3'));var BPromise=require(_0x5962('0x4'));var rp=require(_0x5962('0x5'));var fs=require('fs');var path=require(_0x5962('0x6'));var rimraf=require('rimraf');var config=require(_0x5962('0x7'));var attributes=require(_0x5962('0x8'));module[_0x5962('0x9')]=function(_0x2fb733,_0x1c0dd3){return _0x2fb733[_0x5962('0xa')](_0x5962('0xb'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0x5962('0xc'),'fields':['idField',_0x5962('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc2b4=['exports','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','util','moment','request-promise','path','rimraf'];(function(_0x40c7e4,_0x1b77ff){var _0x201bda=function(_0x2e8b6c){while(--_0x2e8b6c){_0x40c7e4['push'](_0x40c7e4['shift']());}};_0x201bda(++_0x1b77ff);}(_0xc2b4,0x156));var _0x4c2b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc2b4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4c2b('0x0'));var util=require(_0x4c2b('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x4c2b('0x2'));var BPromise=require('bluebird');var rp=require(_0x4c2b('0x3'));var fs=require('fs');var path=require(_0x4c2b('0x4'));var rimraf=require(_0x4c2b('0x5'));var config=require('../../config/environment');var attributes=require('./intSugarcrmField.attributes');module[_0x4c2b('0x6')]=function(_0x43008a,_0x15c8fc){return _0x43008a['define'](_0x4c2b('0x7'),attributes,{'tableName':_0x4c2b('0x8'),'paranoid':![],'indexes':[{'name':_0x4c2b('0x9'),'fields':[_0x4c2b('0xa'),_0x4c2b('0xb')],'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 8c75538..4e750d9 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 _0xeea1=['request\x20sent','error','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','info','SugarcrmField,\x20%s,\x20%s','debug','SugarcrmField,\x20%s,\x20%s,\x20%s'];(function(_0x3248d9,_0x1a7c23){var _0x132816=function(_0x25eff0){while(--_0x25eff0){_0x3248d9['push'](_0x3248d9['shift']());}};_0x132816(++_0x1a7c23);}(_0xeea1,0x1b9));var _0x1eea=function(_0x376627,_0x7cd7af){_0x376627=_0x376627-0x0;var _0xd9f568=_0xeea1[_0x376627];return _0xd9f568;};'use strict';var _=require(_0x1eea('0x0'));var util=require(_0x1eea('0x1'));var moment=require(_0x1eea('0x2'));var BPromise=require(_0x1eea('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1eea('0x4'));var db=require(_0x1eea('0x5'))['db'];var utils=require(_0x1eea('0x6'));var logger=require(_0x1eea('0x7'))(_0x1eea('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1eea('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b2ee3,_0x275378,_0x2eb4eb){return new BPromise(function(_0x3f3bc9,_0x2bbb2e){return client[_0x1eea('0xa')](_0x5b2ee3,_0x2eb4eb)['then'](function(_0x472a3f){logger[_0x1eea('0xb')](_0x1eea('0xc'),_0x275378,'request\x20sent');logger[_0x1eea('0xd')](_0x1eea('0xe'),_0x275378,_0x1eea('0xf'),JSON['stringify'](_0x472a3f));if(_0x472a3f[_0x1eea('0x10')]){if(_0x472a3f[_0x1eea('0x10')]['code']===0x1f4){logger[_0x1eea('0x10')]('SugarcrmField,\x20%s,\x20%s',_0x275378,_0x472a3f[_0x1eea('0x10')][_0x1eea('0x11')]);return _0x2bbb2e(_0x472a3f[_0x1eea('0x10')]['message']);}logger[_0x1eea('0x10')](_0x1eea('0xc'),_0x275378,_0x472a3f[_0x1eea('0x10')]['message']);return _0x3f3bc9(_0x472a3f[_0x1eea('0x10')][_0x1eea('0x11')]);}else{logger[_0x1eea('0xb')]('SugarcrmField,\x20%s,\x20%s',_0x275378,_0x1eea('0xf'));_0x3f3bc9(_0x472a3f[_0x1eea('0x12')][_0x1eea('0x11')]);}})['catch'](function(_0x27a98d){logger[_0x1eea('0x10')](_0x1eea('0xc'),_0x275378,_0x27a98d);_0x2bbb2e(_0x27a98d);});});} \ No newline at end of file +var _0x2c64=['stringify','error','message','SugarcrmField,\x20%s,\x20%s','info','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug'];(function(_0x24a3a8,_0x3823f9){var _0x409083=function(_0x2408b0){while(--_0x2408b0){_0x24a3a8['push'](_0x24a3a8['shift']());}};_0x409083(++_0x3823f9);}(_0x2c64,0x116));var _0x42c6=function(_0x3718b7,_0x2da677){_0x3718b7=_0x3718b7-0x0;var _0xf8c91e=_0x2c64[_0x3718b7];return _0xf8c91e;};'use strict';var _=require(_0x42c6('0x0'));var util=require(_0x42c6('0x1'));var moment=require(_0x42c6('0x2'));var BPromise=require(_0x42c6('0x3'));var rs=require(_0x42c6('0x4'));var fs=require('fs');var Redis=require(_0x42c6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x42c6('0x6'));var logger=require(_0x42c6('0x7'))('rpc');var config=require(_0x42c6('0x8'));var jayson=require(_0x42c6('0x9'));var client=jayson[_0x42c6('0xa')][_0x42c6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xabb569,_0x2a1685,_0x23387c){return new BPromise(function(_0x4a46ff,_0x1ea866){return client[_0x42c6('0xc')](_0xabb569,_0x23387c)[_0x42c6('0xd')](function(_0xf4c6d7){logger['info']('SugarcrmField,\x20%s,\x20%s',_0x2a1685,_0x42c6('0xe'));logger[_0x42c6('0xf')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x2a1685,'request\x20sent',JSON[_0x42c6('0x10')](_0xf4c6d7));if(_0xf4c6d7['error']){if(_0xf4c6d7[_0x42c6('0x11')]['code']===0x1f4){logger[_0x42c6('0x11')]('SugarcrmField,\x20%s,\x20%s',_0x2a1685,_0xf4c6d7[_0x42c6('0x11')][_0x42c6('0x12')]);return _0x1ea866(_0xf4c6d7['error'][_0x42c6('0x12')]);}logger[_0x42c6('0x11')](_0x42c6('0x13'),_0x2a1685,_0xf4c6d7['error']['message']);return _0x4a46ff(_0xf4c6d7[_0x42c6('0x11')][_0x42c6('0x12')]);}else{logger[_0x42c6('0x14')](_0x42c6('0x13'),_0x2a1685,_0x42c6('0xe'));_0x4a46ff(_0xf4c6d7['result']['message']);}})['catch'](function(_0x367510){logger[_0x42c6('0x11')]('SugarcrmField,\x20%s,\x20%s',_0x2a1685,_0x367510);_0x1ea866(_0x367510);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index bd879da..49f901c 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 _0xd04b=['put','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration'];(function(_0x42e675,_0x4f24ef){var _0x1e18b9=function(_0x115a6a){while(--_0x115a6a){_0x42e675['push'](_0x42e675['shift']());}};_0x1e18b9(++_0x4f24ef);}(_0xd04b,0x145));var _0xbd04=function(_0x32604f,_0x4226fc){_0x32604f=_0x32604f-0x0;var _0x5aaa8d=_0xd04b[_0x32604f];return _0x5aaa8d;};'use strict';var multer=require(_0xbd04('0x0'));var util=require(_0xbd04('0x1'));var path=require(_0xbd04('0x2'));var timeout=require('connect-timeout');var express=require(_0xbd04('0x3'));var router=express['Router']();var fs_extra=require(_0xbd04('0x4'));var auth=require(_0xbd04('0x5'));var interaction=require(_0xbd04('0x6'));var config=require(_0xbd04('0x7'));var controller=require(_0xbd04('0x8'));router[_0xbd04('0x9')]('/',auth[_0xbd04('0xa')](),controller[_0xbd04('0xb')]);router[_0xbd04('0x9')](_0xbd04('0xc'),auth[_0xbd04('0xa')](),controller['show']);router[_0xbd04('0x9')](_0xbd04('0xd'),auth[_0xbd04('0xa')](),controller[_0xbd04('0xe')]);router[_0xbd04('0x9')](_0xbd04('0xf'),auth[_0xbd04('0xa')](),controller[_0xbd04('0x10')]);router['post']('/',auth[_0xbd04('0xa')](),controller[_0xbd04('0x11')]);router[_0xbd04('0x12')](_0xbd04('0xd'),auth['isAuthenticated'](),controller[_0xbd04('0x13')]);router[_0xbd04('0x14')](_0xbd04('0xc'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0xbd04('0xa')](),controller[_0xbd04('0x15')]);module[_0xbd04('0x16')]=router; \ No newline at end of file +var _0xd24d=['multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','create','post','addConfiguration','put','update','delete','destroy','exports'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0xd24d,0x168));var _0xdd24=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd24d[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xdd24('0x0'));var util=require(_0xdd24('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xdd24('0x2'));var router=express[_0xdd24('0x3')]();var fs_extra=require(_0xdd24('0x4'));var auth=require(_0xdd24('0x5'));var interaction=require(_0xdd24('0x6'));var config=require(_0xdd24('0x7'));var controller=require('./intVtigerAccount.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xdd24('0x8')]);router[_0xdd24('0x9')](_0xdd24('0xa'),auth[_0xdd24('0xb')](),controller[_0xdd24('0xc')]);router[_0xdd24('0x9')](_0xdd24('0xd'),auth['isAuthenticated'](),controller[_0xdd24('0xe')]);router[_0xdd24('0x9')](_0xdd24('0xf'),auth[_0xdd24('0xb')](),controller['getFields']);router['post']('/',auth[_0xdd24('0xb')](),controller[_0xdd24('0x10')]);router[_0xdd24('0x11')](_0xdd24('0xd'),auth['isAuthenticated'](),controller[_0xdd24('0x12')]);router[_0xdd24('0x13')]('/:id',auth[_0xdd24('0xb')](),controller[_0xdd24('0x14')]);router[_0xdd24('0x15')](_0xdd24('0xa'),auth['isAuthenticated'](),controller[_0xdd24('0x16')]);module[_0xdd24('0x17')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 1a00212..f698620 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 _0xcfd2=['sequelize','exports','STRING'];(function(_0x415e93,_0x32cc5a){var _0x409208=function(_0x101079){while(--_0x101079){_0x415e93['push'](_0x415e93['shift']());}};_0x409208(++_0x32cc5a);}(_0xcfd2,0xbd));var _0x2cfd=function(_0x4cdac1,_0x43e48a){_0x4cdac1=_0x4cdac1-0x0;var _0x3a9a56=_0xcfd2[_0x4cdac1];return _0x3a9a56;};'use strict';var Sequelize=require(_0x2cfd('0x0'));module[_0x2cfd('0x1')]={'name':{'type':Sequelize[_0x2cfd('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x2cfd('0x2')]},'username':{'type':Sequelize[_0x2cfd('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0x2cfd('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x2cfd('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x2cfd('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xfc48=['exports','STRING','HelpDesk','sequelize'];(function(_0x1e7aa6,_0x2b683c){var _0xd35160=function(_0x1a35e4){while(--_0x1a35e4){_0x1e7aa6['push'](_0x1e7aa6['shift']());}};_0xd35160(++_0x2b683c);}(_0xfc48,0x19f));var _0x8fc4=function(_0xf9f770,_0x4e8e57){_0xf9f770=_0xf9f770-0x0;var _0x25b7c3=_0xfc48[_0xf9f770];return _0x25b7c3;};'use strict';var Sequelize=require(_0x8fc4('0x0'));module[_0x8fc4('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8fc4('0x2')]},'username':{'type':Sequelize[_0x8fc4('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x8fc4('0x2')],'allowNull':![],'defaultValue':_0x8fc4('0x3')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x8fc4('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index ae0cf4e..f6aab67 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 _0xfbda=['map','VtigerAccount','fieldName','type','key','model','query','keys','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','filters','intersection','length','find','create','body','getConfigurations','findOne','VtigerConfiguration','rawAttributes','nolimit','addConfiguration','Subjects','getSubjects','Descriptions','channel','VtigerField','username','description','moduleName','remoteUri','serverUrl','accessKey','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','success','result','token','describe','reference','remove','includes','false','label','startsWith','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','end','status','undefined','limit','count','offset','set','Content-Range','json','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xfbda,0x1a2));var _0xafbd=function(_0x5c9307,_0x5b97e4){_0x5c9307=_0x5c9307-0x0;var _0x373e29=_0xfbda[_0x5c9307];return _0x373e29;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xafbd('0x0'));var zipdir=require(_0xafbd('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xafbd('0x2'));var moment=require(_0xafbd('0x3'));var BPromise=require(_0xafbd('0x4'));var Mustache=require(_0xafbd('0x5'));var util=require(_0xafbd('0x6'));var path=require('path');var sox=require(_0xafbd('0x7'));var csv=require('to-csv');var ejs=require(_0xafbd('0x8'));var fs=require('fs');var fs_extra=require(_0xafbd('0x9'));var _=require(_0xafbd('0xa'));var squel=require('squel');var crypto=require(_0xafbd('0xb'));var jsforce=require(_0xafbd('0xc'));var deskjs=require(_0xafbd('0xd'));var toCsv=require(_0xafbd('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xafbd('0xf'));var as=require(_0xafbd('0x10'));var hardwareService=require(_0xafbd('0x11'));var logger=require(_0xafbd('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xafbd('0x13'));var licenseUtil=require(_0xafbd('0x14'));var db=require(_0xafbd('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x2d2d4d,_0x428853){_0x428853=_0x428853||0xcc;return function(_0x475595){if(_0x475595){return _0x2d2d4d['sendStatus'](_0x428853);}return _0x2d2d4d['status'](_0x428853)[_0xafbd('0x16')]();};}function respondWithResult(_0x34f099,_0x20ff9b){_0x20ff9b=_0x20ff9b||0xc8;return function(_0x3136f0){if(_0x3136f0){return _0x34f099[_0xafbd('0x17')](_0x20ff9b)['json'](_0x3136f0);}};}function respondWithFilteredResult(_0x254977,_0x18ae28){return function(_0x1cc0e5){if(_0x1cc0e5){var _0x181b70=typeof _0x18ae28['offset']===_0xafbd('0x18')&&typeof _0x18ae28[_0xafbd('0x19')]==='undefined';var _0x3c637b=_0x1cc0e5[_0xafbd('0x1a')];var _0x5908ca=_0x181b70?0x0:_0x18ae28[_0xafbd('0x1b')];var _0x1cc4a3=_0x181b70?_0x1cc0e5[_0xafbd('0x1a')]:_0x18ae28['offset']+_0x18ae28['limit'];var _0x15376a;if(_0x1cc4a3>=_0x3c637b){_0x1cc4a3=_0x3c637b;_0x15376a=0xc8;}else{_0x15376a=0xce;}_0x254977[_0xafbd('0x17')](_0x15376a);return _0x254977[_0xafbd('0x1c')](_0xafbd('0x1d'),_0x5908ca+'-'+_0x1cc4a3+'/'+_0x3c637b)[_0xafbd('0x1e')](_0x1cc0e5);}return null;};}function patchUpdates(_0x59a712){return function(_0x329d06){try{jsonpatch['apply'](_0x329d06,_0x59a712,!![]);}catch(_0x292dfb){return BPromise[_0xafbd('0x1f')](_0x292dfb);}return _0x329d06[_0xafbd('0x20')]();};}function saveUpdates(_0xf20aca,_0x12ea89){return function(_0x373378){if(_0x373378){return _0x373378[_0xafbd('0x21')](_0xf20aca)[_0xafbd('0x22')](function(_0x3f8f8b){return _0x3f8f8b;});}return null;};}function removeEntity(_0x1ec662,_0x38198d){return function(_0x4ad052){if(_0x4ad052){return _0x4ad052[_0xafbd('0x23')]()['then'](function(){_0x1ec662[_0xafbd('0x17')](0xcc)[_0xafbd('0x16')]();});}};}function handleEntityNotFound(_0x2112a8,_0x289427){return function(_0xa82764){if(!_0xa82764){_0x2112a8[_0xafbd('0x24')](0x194);}return _0xa82764;};}function handleError(_0x21d63d,_0x5488ea){_0x5488ea=_0x5488ea||0x1f4;return function(_0x5b47d1){logger[_0xafbd('0x25')](_0x5b47d1[_0xafbd('0x26')]);if(_0x5b47d1[_0xafbd('0x27')]){delete _0x5b47d1[_0xafbd('0x27')];}_0x21d63d['status'](_0x5488ea)[_0xafbd('0x28')](_0x5b47d1);};}exports[_0xafbd('0x29')]=function(_0x4e7747,_0x1258ef){var _0x4a6107={},_0x37fb7b={},_0x16d034={'count':0x0,'rows':[]};var _0x21974f=_[_0xafbd('0x2a')](db[_0xafbd('0x2b')]['rawAttributes'],function(_0x37946e){return{'name':_0x37946e[_0xafbd('0x2c')],'type':_0x37946e[_0xafbd('0x2d')][_0xafbd('0x2e')]};});_0x37fb7b[_0xafbd('0x2f')]=_[_0xafbd('0x2a')](_0x21974f,_0xafbd('0x27'));_0x37fb7b[_0xafbd('0x30')]=_[_0xafbd('0x31')](_0x4e7747['query']);_0x37fb7b['filters']=_['intersection'](_0x37fb7b['model'],_0x37fb7b[_0xafbd('0x30')]);_0x4a6107[_0xafbd('0x32')]=_['intersection'](_0x37fb7b[_0xafbd('0x2f')],qs['fields'](_0x4e7747[_0xafbd('0x30')][_0xafbd('0x33')]));_0x4a6107['attributes']=_0x4a6107[_0xafbd('0x32')]['length']?_0x4a6107[_0xafbd('0x32')]:_0x37fb7b[_0xafbd('0x2f')];if(!_0x4e7747[_0xafbd('0x30')][_0xafbd('0x34')]('nolimit')){_0x4a6107[_0xafbd('0x19')]=qs[_0xafbd('0x19')](_0x4e7747['query'][_0xafbd('0x19')]);_0x4a6107[_0xafbd('0x1b')]=qs[_0xafbd('0x1b')](_0x4e7747[_0xafbd('0x30')][_0xafbd('0x1b')]);}_0x4a6107[_0xafbd('0x35')]=qs[_0xafbd('0x36')](_0x4e7747[_0xafbd('0x30')][_0xafbd('0x36')]);_0x4a6107[_0xafbd('0x37')]=qs['filters'](_[_0xafbd('0x38')](_0x4e7747[_0xafbd('0x30')],_0x37fb7b['filters']),_0x21974f);if(_0x4e7747[_0xafbd('0x30')][_0xafbd('0x39')]){_0x4a6107['where']=_[_0xafbd('0x3a')](_0x4a6107[_0xafbd('0x37')],{'$or':_[_0xafbd('0x2a')](_0x21974f,function(_0x6381b7){if(_0x6381b7[_0xafbd('0x2d')]!==_0xafbd('0x3b')){var _0x55dee8={};_0x55dee8[_0x6381b7[_0xafbd('0x27')]]={'$like':'%'+_0x4e7747[_0xafbd('0x30')][_0xafbd('0x39')]+'%'};return _0x55dee8;}})});}_0x4a6107=_[_0xafbd('0x3a')]({},_0x4a6107,_0x4e7747[_0xafbd('0x3c')]);var _0x5652c4={'where':_0x4a6107['where']};return db['VtigerAccount'][_0xafbd('0x1a')](_0x5652c4)[_0xafbd('0x22')](function(_0x283a23){_0x16d034[_0xafbd('0x1a')]=_0x283a23;if(_0x4e7747[_0xafbd('0x30')][_0xafbd('0x3d')]){_0x4a6107[_0xafbd('0x3e')]=[{'all':!![]}];}return db[_0xafbd('0x2b')][_0xafbd('0x3f')](_0x4a6107);})['then'](function(_0x5e9e26){_0x16d034[_0xafbd('0x40')]=_0x5e9e26;return _0x16d034;})[_0xafbd('0x22')](respondWithFilteredResult(_0x1258ef,_0x4a6107))[_0xafbd('0x41')](handleError(_0x1258ef,null));};exports['show']=function(_0x1294fc,_0x3b9031){var _0x4a3df3={'raw':![],'where':{'id':_0x1294fc[_0xafbd('0x42')]['id']}},_0x481605={};_0x481605[_0xafbd('0x2f')]=_[_0xafbd('0x31')](db['VtigerAccount']['rawAttributes']);_0x481605['query']=_[_0xafbd('0x31')](_0x1294fc['query']);_0x481605[_0xafbd('0x43')]=_[_0xafbd('0x44')](_0x481605[_0xafbd('0x2f')],_0x481605[_0xafbd('0x30')]);_0x4a3df3[_0xafbd('0x32')]=_['intersection'](_0x481605['model'],qs['fields'](_0x1294fc['query'][_0xafbd('0x33')]));_0x4a3df3['attributes']=_0x4a3df3[_0xafbd('0x32')][_0xafbd('0x45')]?_0x4a3df3[_0xafbd('0x32')]:_0x481605[_0xafbd('0x2f')];if(_0x1294fc[_0xafbd('0x30')][_0xafbd('0x3d')]){_0x4a3df3['include']=[{'all':!![]}];}_0x4a3df3=_[_0xafbd('0x3a')]({},_0x4a3df3,_0x1294fc[_0xafbd('0x3c')]);return db[_0xafbd('0x2b')][_0xafbd('0x46')](_0x4a3df3)[_0xafbd('0x22')](handleEntityNotFound(_0x3b9031,null))[_0xafbd('0x22')](respondWithResult(_0x3b9031,null))[_0xafbd('0x41')](handleError(_0x3b9031,null));};exports[_0xafbd('0x47')]=function(_0x11168c,_0x3c609b){return db[_0xafbd('0x2b')]['create'](_0x11168c['body'],{})['then'](respondWithResult(_0x3c609b,0xc9))['catch'](handleError(_0x3c609b,null));};exports[_0xafbd('0x21')]=function(_0x20f201,_0xded703){if(_0x20f201[_0xafbd('0x48')]['id']){delete _0x20f201[_0xafbd('0x48')]['id'];}return db['VtigerAccount'][_0xafbd('0x46')]({'where':{'id':_0x20f201['params']['id']}})[_0xafbd('0x22')](handleEntityNotFound(_0xded703,null))[_0xafbd('0x22')](saveUpdates(_0x20f201['body'],null))[_0xafbd('0x22')](respondWithResult(_0xded703,null))[_0xafbd('0x41')](handleError(_0xded703,null));};exports[_0xafbd('0x23')]=function(_0x4eda62,_0x366501){return db['VtigerAccount'][_0xafbd('0x46')]({'where':{'id':_0x4eda62[_0xafbd('0x42')]['id']}})[_0xafbd('0x22')](handleEntityNotFound(_0x366501,null))[_0xafbd('0x22')](removeEntity(_0x366501,null))['catch'](handleError(_0x366501,null));};exports[_0xafbd('0x49')]=function(_0x1c28e8,_0x40eeec,_0x1e627d){var _0xb2587c={};var _0x2e7743={};var _0x1b2da1;var _0x3a3efa;return db[_0xafbd('0x2b')][_0xafbd('0x4a')]({'where':{'id':_0x1c28e8[_0xafbd('0x42')]['id']}})['then'](handleEntityNotFound(_0x40eeec,null))['then'](function(_0x4e837b){if(_0x4e837b){_0x1b2da1=_0x4e837b;_0x2e7743['model']=_[_0xafbd('0x31')](db[_0xafbd('0x4b')][_0xafbd('0x4c')]);_0x2e7743[_0xafbd('0x30')]=_[_0xafbd('0x31')](_0x1c28e8[_0xafbd('0x30')]);_0x2e7743[_0xafbd('0x43')]=_['intersection'](_0x2e7743[_0xafbd('0x2f')],_0x2e7743[_0xafbd('0x30')]);_0xb2587c[_0xafbd('0x32')]=_[_0xafbd('0x44')](_0x2e7743['model'],qs['fields'](_0x1c28e8[_0xafbd('0x30')][_0xafbd('0x33')]));_0xb2587c[_0xafbd('0x32')]=_0xb2587c[_0xafbd('0x32')][_0xafbd('0x45')]?_0xb2587c[_0xafbd('0x32')]:_0x2e7743['model'];_0xb2587c[_0xafbd('0x35')]=qs[_0xafbd('0x36')](_0x1c28e8[_0xafbd('0x30')]['sort']);_0xb2587c[_0xafbd('0x37')]=qs['filters'](_[_0xafbd('0x38')](_0x1c28e8[_0xafbd('0x30')],_0x2e7743[_0xafbd('0x43')]));if(_0x1c28e8[_0xafbd('0x30')][_0xafbd('0x39')]){_0xb2587c[_0xafbd('0x37')]=_[_0xafbd('0x3a')](_0xb2587c[_0xafbd('0x37')],{'$or':_['map'](_0xb2587c['attributes'],function(_0x28cf1e){var _0x54acec={};_0x54acec[_0x28cf1e]={'$like':'%'+_0x1c28e8[_0xafbd('0x30')][_0xafbd('0x39')]+'%'};return _0x54acec;})});}_0xb2587c=_[_0xafbd('0x3a')]({},_0xb2587c,_0x1c28e8[_0xafbd('0x3c')]);return _0x1b2da1[_0xafbd('0x49')](_0xb2587c);}})[_0xafbd('0x22')](function(_0x21d35a){if(_0x21d35a){_0x3a3efa=_0x21d35a[_0xafbd('0x45')];if(!_0x1c28e8['query'][_0xafbd('0x34')](_0xafbd('0x4d'))){_0xb2587c[_0xafbd('0x19')]=qs[_0xafbd('0x19')](_0x1c28e8[_0xafbd('0x30')]['limit']);_0xb2587c[_0xafbd('0x1b')]=qs[_0xafbd('0x1b')](_0x1c28e8['query'][_0xafbd('0x1b')]);}return _0x1b2da1[_0xafbd('0x49')](_0xb2587c);}})[_0xafbd('0x22')](function(_0x1247ae){if(_0x1247ae){return _0x1247ae?{'count':_0x3a3efa,'rows':_0x1247ae}:null;}})[_0xafbd('0x22')](respondWithResult(_0x40eeec,null))['catch'](handleError(_0x40eeec,null));};exports[_0xafbd('0x4e')]=function(_0x4dd1d1,_0x496883,_0x471edf){if(_0x4dd1d1[_0xafbd('0x48')]['id']){delete _0x4dd1d1[_0xafbd('0x48')]['id'];}return db[_0xafbd('0x2b')]['findOne']({'where':{'id':_0x4dd1d1['params']['id']}})['then'](handleEntityNotFound(_0x496883,null))[_0xafbd('0x22')](function(_0x510fc8){if(_0x510fc8){_0x4dd1d1[_0xafbd('0x48')]['AccountId']=_0x510fc8['id'];_0x4dd1d1[_0xafbd('0x48')][_0xafbd('0x4f')]=integrations[_0xafbd('0x50')](_0x4dd1d1[_0xafbd('0x48')]['channel'],_0x4dd1d1[_0xafbd('0x48')][_0xafbd('0x2d')]);_0x4dd1d1[_0xafbd('0x48')][_0xafbd('0x51')]=integrations['getDescriptions'](_0x4dd1d1[_0xafbd('0x48')][_0xafbd('0x52')],_0x4dd1d1[_0xafbd('0x48')]['type']);return db['VtigerConfiguration'][_0xafbd('0x47')](_0x4dd1d1[_0xafbd('0x48')],{'include':[{'model':db[_0xafbd('0x53')],'as':'Subjects'},{'model':db[_0xafbd('0x53')],'as':_0xafbd('0x51')}]});}return null;})[_0xafbd('0x22')](respondWithResult(_0x496883,null))['catch'](handleError(_0x496883,null));};var md5=require('md5');exports['getFields']=function(_0x1ea2ae,_0xfc57a5,_0x2bc659){var _0x4f7bc1=null;var _0x3656d1=null;var _0x147ad6=null;var _0x2f6e76=null;var _0x13ab54='';return db[_0xafbd('0x2b')]['findOne']({'where':{'id':_0x1ea2ae[_0xafbd('0x42')]['id']},'attributes':['id','name',_0xafbd('0x54'),_0xafbd('0x55'),_0xafbd('0x56'),_0xafbd('0x57'),_0xafbd('0x58'),'accessKey']})[_0xafbd('0x22')](handleEntityNotFound(_0xfc57a5,null))[_0xafbd('0x22')](function(_0x41566f){if(_0x41566f){_0x4f7bc1=_0x41566f['username'];_0x3656d1=_0x41566f[_0xafbd('0x59')];_0x147ad6=_0x41566f['moduleName'];_0x13ab54=_0x41566f[_0xafbd('0x57')];var _0x5a1251=_0x13ab54['slice'](-0x1);if(_0x5a1251==='/'){_0x13ab54=_0x13ab54[_0xafbd('0x5a')](0x0,_0x13ab54[_0xafbd('0x5b')](_0x5a1251));}_0x2f6e76=util[_0xafbd('0x5c')](_0xafbd('0x5d'),_0x13ab54);var _0x1fac1b={'method':_0xafbd('0x5e'),'uri':_0x2f6e76,'qs':{'operation':_0xafbd('0x5f'),'username':_0x41566f[_0xafbd('0x54')]},'json':!![]};return rp(_0x1fac1b);}})[_0xafbd('0x22')](function(_0x53fc99){if(_0x53fc99[_0xafbd('0x60')]){var _0x225f75={'method':'POST','uri':_0x2f6e76,'form':{'operation':'login','username':_0x4f7bc1,'accessKey':md5(_0x53fc99[_0xafbd('0x61')][_0xafbd('0x62')]+_0x3656d1)},'json':!![]};return rp(_0x225f75);}})[_0xafbd('0x22')](function(_0x59a810){if(_0x59a810[_0xafbd('0x60')]){var _0x20bf00={'method':_0xafbd('0x5e'),'uri':_0x2f6e76,'qs':{'operation':_0xafbd('0x63'),'username':_0x4f7bc1,'sessionName':_0x59a810[_0xafbd('0x61')]['sessionName'],'elementType':_0x147ad6},'json':!![]};return rp(_0x20bf00);}})[_0xafbd('0x22')](function(_0x9e59ec){if(_0x9e59ec[_0xafbd('0x60')]){var _0x44850f=['autogenerated',_0xafbd('0x64'),'owner'];_[_0xafbd('0x65')](_0x9e59ec[_0xafbd('0x61')][_0xafbd('0x33')],function(_0x67f211){return _0x44850f[_0xafbd('0x66')](_0x67f211[_0xafbd('0x2d')][_0xafbd('0x27')]);});_['remove'](_0x9e59ec[_0xafbd('0x61')][_0xafbd('0x33')],function(_0x20bdb9){return _0x20bdb9['editable']===_0xafbd('0x67');});return{'count':_0x9e59ec[_0xafbd('0x61')][_0xafbd('0x33')][_0xafbd('0x45')],'rows':_[_0xafbd('0x2a')](_0x9e59ec['result'][_0xafbd('0x33')],function(_0x2976df){return{'id':_0x2976df[_0xafbd('0x27')],'name':_0x2976df[_0xafbd('0x68')],'custom':_[_0xafbd('0x69')](_0x2976df[_0xafbd('0x27')],'cf_')?!![]:![],'options':_0x2976df[_0xafbd('0x2d')]['name']==='picklist'&&_0x2976df[_0xafbd('0x2d')][_0xafbd('0x6a')]['length']>0x0?_[_0xafbd('0x2a')](_0x2976df[_0xafbd('0x2d')]['picklistValues'],function(_0x23199b){return{'name':_0x23199b[_0xafbd('0x68')],'value':_0x23199b[_0xafbd('0x6b')]};}):[]};})};}})[_0xafbd('0x22')](respondWithResult(_0xfc57a5,null))[_0xafbd('0x41')](function(_0x530bb2){console[_0xafbd('0x6c')](_0xafbd('0x6d')+_0x530bb2);var _0x58dc6a=_0x1ea2ae['query'][_0xafbd('0x6e')]?0x1f4:_0x530bb2[_0xafbd('0x6f')]||0x1f4;logger['error'](_0xafbd('0x70'),_0xafbd('0x71'),_0x58dc6a,JSON[_0xafbd('0x72')](_0x530bb2));delete _0x530bb2[_0xafbd('0x27')];if(_0x58dc6a===0x191){_0x58dc6a=0x190;}_0xfc57a5['status'](_0x58dc6a)[_0xafbd('0x28')](_0x1ea2ae['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x530bb2['statusCode']}:_0x530bb2);});}; \ No newline at end of file +var _0x5655=['querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','stack','name','send','index','VtigerAccount','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','create','body','update','find','params','getConfigurations','findOne','VtigerConfiguration','order','hasOwnProperty','AccountId','Subjects','getSubjects','Descriptions','VtigerField','md5','getFields','description','remoteUri','serverUrl','accessKey','slice','lastIndexOf','format','%s/webservice.php','GET','getchallenge','success','login','result','describe','sessionName','autogenerated','reference','owner','includes','remove','editable','false','label','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x3fe042,_0x1106f7){var _0x7d4a1f=function(_0x2df987){while(--_0x2df987){_0x3fe042['push'](_0x3fe042['shift']());}};_0x7d4a1f(++_0x1106f7);}(_0x5655,0x6a));var _0x5565=function(_0x27b4f7,_0x1f1715){_0x27b4f7=_0x27b4f7-0x0;var _0x2dcb22=_0x5655[_0x27b4f7];return _0x2dcb22;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5565('0x0'));var zipdir=require(_0x5565('0x1'));var jsonpatch=require(_0x5565('0x2'));var rp=require('request-promise');var moment=require(_0x5565('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5565('0x4'));var path=require(_0x5565('0x5'));var sox=require(_0x5565('0x6'));var csv=require(_0x5565('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5565('0x8'));var _=require(_0x5565('0x9'));var squel=require(_0x5565('0xa'));var crypto=require(_0x5565('0xb'));var jsforce=require(_0x5565('0xc'));var deskjs=require(_0x5565('0xd'));var toCsv=require('to-csv');var querystring=require(_0x5565('0xe'));var Papa=require(_0x5565('0xf'));var Redis=require(_0x5565('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5565('0x11'));var as=require(_0x5565('0x12'));var hardwareService=require(_0x5565('0x13'));var logger=require('../../config/logger')(_0x5565('0x14'));var utils=require(_0x5565('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x304fa7,_0x2a1313){_0x2a1313=_0x2a1313||0xcc;return function(_0x499d30){if(_0x499d30){return _0x304fa7[_0x5565('0x16')](_0x2a1313);}return _0x304fa7[_0x5565('0x17')](_0x2a1313)[_0x5565('0x18')]();};}function respondWithResult(_0x778717,_0x389376){_0x389376=_0x389376||0xc8;return function(_0x5b1f7f){if(_0x5b1f7f){return _0x778717[_0x5565('0x17')](_0x389376)[_0x5565('0x19')](_0x5b1f7f);}};}function respondWithFilteredResult(_0x5e01de,_0x2fcd28){return function(_0x4a0a18){if(_0x4a0a18){var _0x2adfa0=typeof _0x2fcd28[_0x5565('0x1a')]===_0x5565('0x1b')&&typeof _0x2fcd28[_0x5565('0x1c')]===_0x5565('0x1b');var _0x3c3b6f=_0x4a0a18['count'];var _0x16601c=_0x2adfa0?0x0:_0x2fcd28[_0x5565('0x1a')];var _0x16dde0=_0x2adfa0?_0x4a0a18[_0x5565('0x1d')]:_0x2fcd28[_0x5565('0x1a')]+_0x2fcd28[_0x5565('0x1c')];var _0x57c9e7;if(_0x16dde0>=_0x3c3b6f){_0x16dde0=_0x3c3b6f;_0x57c9e7=0xc8;}else{_0x57c9e7=0xce;}_0x5e01de[_0x5565('0x17')](_0x57c9e7);return _0x5e01de[_0x5565('0x1e')](_0x5565('0x1f'),_0x16601c+'-'+_0x16dde0+'/'+_0x3c3b6f)[_0x5565('0x19')](_0x4a0a18);}return null;};}function patchUpdates(_0x15fe5e){return function(_0x53b1d7){try{jsonpatch[_0x5565('0x20')](_0x53b1d7,_0x15fe5e,!![]);}catch(_0x445d10){return BPromise[_0x5565('0x21')](_0x445d10);}return _0x53b1d7[_0x5565('0x22')]();};}function saveUpdates(_0x33d861,_0x5aa4e4){return function(_0x338e6a){if(_0x338e6a){return _0x338e6a['update'](_0x33d861)['then'](function(_0x1db8b7){return _0x1db8b7;});}return null;};}function removeEntity(_0x1d2125,_0x403dca){return function(_0x24d3f0){if(_0x24d3f0){return _0x24d3f0[_0x5565('0x23')]()[_0x5565('0x24')](function(){_0x1d2125['status'](0xcc)[_0x5565('0x18')]();});}};}function handleEntityNotFound(_0x13836c,_0x2a0e7d){return function(_0x197696){if(!_0x197696){_0x13836c['sendStatus'](0x194);}return _0x197696;};}function handleError(_0x17eeef,_0x5f47d9){_0x5f47d9=_0x5f47d9||0x1f4;return function(_0x5231ba){logger['error'](_0x5231ba[_0x5565('0x25')]);if(_0x5231ba[_0x5565('0x26')]){delete _0x5231ba[_0x5565('0x26')];}_0x17eeef[_0x5565('0x17')](_0x5f47d9)[_0x5565('0x27')](_0x5231ba);};}exports[_0x5565('0x28')]=function(_0xe2d230,_0x332edc){var _0x5d599c={},_0x8947f6={},_0x3a3f8b={'count':0x0,'rows':[]};var _0x18de83=_['map'](db[_0x5565('0x29')]['rawAttributes'],function(_0x12b2fd){return{'name':_0x12b2fd[_0x5565('0x2a')],'type':_0x12b2fd[_0x5565('0x2b')][_0x5565('0x2c')]};});_0x8947f6[_0x5565('0x2d')]=_[_0x5565('0x2e')](_0x18de83,_0x5565('0x26'));_0x8947f6[_0x5565('0x2f')]=_[_0x5565('0x30')](_0xe2d230[_0x5565('0x2f')]);_0x8947f6[_0x5565('0x31')]=_[_0x5565('0x32')](_0x8947f6['model'],_0x8947f6[_0x5565('0x2f')]);_0x5d599c[_0x5565('0x33')]=_['intersection'](_0x8947f6[_0x5565('0x2d')],qs[_0x5565('0x34')](_0xe2d230['query'][_0x5565('0x34')]));_0x5d599c[_0x5565('0x33')]=_0x5d599c[_0x5565('0x33')][_0x5565('0x35')]?_0x5d599c[_0x5565('0x33')]:_0x8947f6[_0x5565('0x2d')];if(!_0xe2d230[_0x5565('0x2f')]['hasOwnProperty'](_0x5565('0x36'))){_0x5d599c[_0x5565('0x1c')]=qs[_0x5565('0x1c')](_0xe2d230[_0x5565('0x2f')][_0x5565('0x1c')]);_0x5d599c[_0x5565('0x1a')]=qs[_0x5565('0x1a')](_0xe2d230['query'][_0x5565('0x1a')]);}_0x5d599c['order']=qs[_0x5565('0x37')](_0xe2d230[_0x5565('0x2f')][_0x5565('0x37')]);_0x5d599c[_0x5565('0x38')]=qs['filters'](_[_0x5565('0x39')](_0xe2d230[_0x5565('0x2f')],_0x8947f6[_0x5565('0x31')]),_0x18de83);if(_0xe2d230[_0x5565('0x2f')][_0x5565('0x3a')]){_0x5d599c[_0x5565('0x38')]=_[_0x5565('0x3b')](_0x5d599c[_0x5565('0x38')],{'$or':_['map'](_0x18de83,function(_0x54f0f5){if(_0x54f0f5[_0x5565('0x2b')]!==_0x5565('0x3c')){var _0x2297c0={};_0x2297c0[_0x54f0f5[_0x5565('0x26')]]={'$like':'%'+_0xe2d230['query']['filter']+'%'};return _0x2297c0;}})});}_0x5d599c=_[_0x5565('0x3b')]({},_0x5d599c,_0xe2d230[_0x5565('0x3d')]);var _0x50a9ab={'where':_0x5d599c[_0x5565('0x38')]};return db['VtigerAccount']['count'](_0x50a9ab)[_0x5565('0x24')](function(_0x2a51a4){_0x3a3f8b[_0x5565('0x1d')]=_0x2a51a4;if(_0xe2d230[_0x5565('0x2f')][_0x5565('0x3e')]){_0x5d599c[_0x5565('0x3f')]=[{'all':!![]}];}return db[_0x5565('0x29')][_0x5565('0x40')](_0x5d599c);})['then'](function(_0x43dfa4){_0x3a3f8b[_0x5565('0x41')]=_0x43dfa4;return _0x3a3f8b;})['then'](respondWithFilteredResult(_0x332edc,_0x5d599c))[_0x5565('0x42')](handleError(_0x332edc,null));};exports[_0x5565('0x43')]=function(_0xbf1132,_0x371dbf){var _0x27cd91={'raw':![],'where':{'id':_0xbf1132['params']['id']}},_0x225c93={};_0x225c93[_0x5565('0x2d')]=_[_0x5565('0x30')](db[_0x5565('0x29')][_0x5565('0x44')]);_0x225c93[_0x5565('0x2f')]=_[_0x5565('0x30')](_0xbf1132['query']);_0x225c93['filters']=_[_0x5565('0x32')](_0x225c93[_0x5565('0x2d')],_0x225c93[_0x5565('0x2f')]);_0x27cd91[_0x5565('0x33')]=_['intersection'](_0x225c93[_0x5565('0x2d')],qs['fields'](_0xbf1132[_0x5565('0x2f')]['fields']));_0x27cd91['attributes']=_0x27cd91[_0x5565('0x33')][_0x5565('0x35')]?_0x27cd91[_0x5565('0x33')]:_0x225c93[_0x5565('0x2d')];if(_0xbf1132[_0x5565('0x2f')]['includeAll']){_0x27cd91[_0x5565('0x3f')]=[{'all':!![]}];}_0x27cd91=_[_0x5565('0x3b')]({},_0x27cd91,_0xbf1132[_0x5565('0x3d')]);return db['VtigerAccount']['find'](_0x27cd91)[_0x5565('0x24')](handleEntityNotFound(_0x371dbf,null))[_0x5565('0x24')](respondWithResult(_0x371dbf,null))[_0x5565('0x42')](handleError(_0x371dbf,null));};exports[_0x5565('0x45')]=function(_0xe32c9f,_0x51cf2c){return db['VtigerAccount'][_0x5565('0x45')](_0xe32c9f[_0x5565('0x46')],{})[_0x5565('0x24')](respondWithResult(_0x51cf2c,0xc9))[_0x5565('0x42')](handleError(_0x51cf2c,null));};exports[_0x5565('0x47')]=function(_0x140899,_0x31abf1){if(_0x140899[_0x5565('0x46')]['id']){delete _0x140899['body']['id'];}return db['VtigerAccount'][_0x5565('0x48')]({'where':{'id':_0x140899[_0x5565('0x49')]['id']}})[_0x5565('0x24')](handleEntityNotFound(_0x31abf1,null))[_0x5565('0x24')](saveUpdates(_0x140899['body'],null))['then'](respondWithResult(_0x31abf1,null))['catch'](handleError(_0x31abf1,null));};exports[_0x5565('0x23')]=function(_0x4a9859,_0x14e7b1){return db['VtigerAccount'][_0x5565('0x48')]({'where':{'id':_0x4a9859[_0x5565('0x49')]['id']}})[_0x5565('0x24')](handleEntityNotFound(_0x14e7b1,null))[_0x5565('0x24')](removeEntity(_0x14e7b1,null))[_0x5565('0x42')](handleError(_0x14e7b1,null));};exports[_0x5565('0x4a')]=function(_0x2e5619,_0x1f1f2c,_0x17f860){var _0x546478={};var _0x16873b={};var _0x68c14d;var _0x2eab8c;return db[_0x5565('0x29')][_0x5565('0x4b')]({'where':{'id':_0x2e5619[_0x5565('0x49')]['id']}})[_0x5565('0x24')](handleEntityNotFound(_0x1f1f2c,null))['then'](function(_0x11009d){if(_0x11009d){_0x68c14d=_0x11009d;_0x16873b['model']=_[_0x5565('0x30')](db[_0x5565('0x4c')][_0x5565('0x44')]);_0x16873b[_0x5565('0x2f')]=_[_0x5565('0x30')](_0x2e5619[_0x5565('0x2f')]);_0x16873b[_0x5565('0x31')]=_[_0x5565('0x32')](_0x16873b[_0x5565('0x2d')],_0x16873b['query']);_0x546478[_0x5565('0x33')]=_['intersection'](_0x16873b[_0x5565('0x2d')],qs[_0x5565('0x34')](_0x2e5619[_0x5565('0x2f')][_0x5565('0x34')]));_0x546478['attributes']=_0x546478['attributes']['length']?_0x546478[_0x5565('0x33')]:_0x16873b[_0x5565('0x2d')];_0x546478[_0x5565('0x4d')]=qs[_0x5565('0x37')](_0x2e5619[_0x5565('0x2f')][_0x5565('0x37')]);_0x546478[_0x5565('0x38')]=qs[_0x5565('0x31')](_[_0x5565('0x39')](_0x2e5619[_0x5565('0x2f')],_0x16873b[_0x5565('0x31')]));if(_0x2e5619[_0x5565('0x2f')][_0x5565('0x3a')]){_0x546478['where']=_[_0x5565('0x3b')](_0x546478['where'],{'$or':_['map'](_0x546478[_0x5565('0x33')],function(_0x1f2c82){var _0x38fc29={};_0x38fc29[_0x1f2c82]={'$like':'%'+_0x2e5619[_0x5565('0x2f')]['filter']+'%'};return _0x38fc29;})});}_0x546478=_['merge']({},_0x546478,_0x2e5619[_0x5565('0x3d')]);return _0x68c14d[_0x5565('0x4a')](_0x546478);}})[_0x5565('0x24')](function(_0x4c0296){if(_0x4c0296){_0x2eab8c=_0x4c0296[_0x5565('0x35')];if(!_0x2e5619[_0x5565('0x2f')][_0x5565('0x4e')](_0x5565('0x36'))){_0x546478[_0x5565('0x1c')]=qs[_0x5565('0x1c')](_0x2e5619[_0x5565('0x2f')][_0x5565('0x1c')]);_0x546478[_0x5565('0x1a')]=qs[_0x5565('0x1a')](_0x2e5619[_0x5565('0x2f')][_0x5565('0x1a')]);}return _0x68c14d[_0x5565('0x4a')](_0x546478);}})[_0x5565('0x24')](function(_0x10436b){if(_0x10436b){return _0x10436b?{'count':_0x2eab8c,'rows':_0x10436b}:null;}})[_0x5565('0x24')](respondWithResult(_0x1f1f2c,null))[_0x5565('0x42')](handleError(_0x1f1f2c,null));};exports['addConfiguration']=function(_0x1c3835,_0x59642c,_0x3baf61){if(_0x1c3835['body']['id']){delete _0x1c3835[_0x5565('0x46')]['id'];}return db[_0x5565('0x29')]['findOne']({'where':{'id':_0x1c3835[_0x5565('0x49')]['id']}})[_0x5565('0x24')](handleEntityNotFound(_0x59642c,null))[_0x5565('0x24')](function(_0x26ed7d){if(_0x26ed7d){_0x1c3835[_0x5565('0x46')][_0x5565('0x4f')]=_0x26ed7d['id'];_0x1c3835[_0x5565('0x46')][_0x5565('0x50')]=integrations[_0x5565('0x51')](_0x1c3835[_0x5565('0x46')]['channel'],_0x1c3835['body']['type']);_0x1c3835[_0x5565('0x46')][_0x5565('0x52')]=integrations['getDescriptions'](_0x1c3835[_0x5565('0x46')]['channel'],_0x1c3835['body']['type']);return db[_0x5565('0x4c')]['create'](_0x1c3835['body'],{'include':[{'model':db[_0x5565('0x53')],'as':'Subjects'},{'model':db[_0x5565('0x53')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x59642c,null))[_0x5565('0x42')](handleError(_0x59642c,null));};var md5=require(_0x5565('0x54'));exports[_0x5565('0x55')]=function(_0x21de19,_0xe74fb1,_0x3e5a44){var _0x5629d8=null;var _0x31515b=null;var _0x465b33=null;var _0x49fcf6=null;var _0x158844='';return db['VtigerAccount'][_0x5565('0x4b')]({'where':{'id':_0x21de19['params']['id']},'attributes':['id',_0x5565('0x26'),'username',_0x5565('0x56'),'moduleName',_0x5565('0x57'),_0x5565('0x58'),_0x5565('0x59')]})[_0x5565('0x24')](handleEntityNotFound(_0xe74fb1,null))[_0x5565('0x24')](function(_0x17e855){if(_0x17e855){_0x5629d8=_0x17e855['username'];_0x31515b=_0x17e855[_0x5565('0x59')];_0x465b33=_0x17e855['moduleName'];_0x158844=_0x17e855[_0x5565('0x57')];var _0x261784=_0x158844[_0x5565('0x5a')](-0x1);if(_0x261784==='/'){_0x158844=_0x158844['substring'](0x0,_0x158844[_0x5565('0x5b')](_0x261784));}_0x49fcf6=util[_0x5565('0x5c')](_0x5565('0x5d'),_0x158844);var _0x1b9e8c={'method':_0x5565('0x5e'),'uri':_0x49fcf6,'qs':{'operation':_0x5565('0x5f'),'username':_0x17e855['username']},'json':!![]};return rp(_0x1b9e8c);}})[_0x5565('0x24')](function(_0x329ac8){if(_0x329ac8[_0x5565('0x60')]){var _0x43db62={'method':'POST','uri':_0x49fcf6,'form':{'operation':_0x5565('0x61'),'username':_0x5629d8,'accessKey':md5(_0x329ac8[_0x5565('0x62')]['token']+_0x31515b)},'json':!![]};return rp(_0x43db62);}})[_0x5565('0x24')](function(_0x8314bb){if(_0x8314bb[_0x5565('0x60')]){var _0x5c55a6={'method':_0x5565('0x5e'),'uri':_0x49fcf6,'qs':{'operation':_0x5565('0x63'),'username':_0x5629d8,'sessionName':_0x8314bb[_0x5565('0x62')][_0x5565('0x64')],'elementType':_0x465b33},'json':!![]};return rp(_0x5c55a6);}})['then'](function(_0x29eaaf){if(_0x29eaaf['success']){var _0x64c421=[_0x5565('0x65'),_0x5565('0x66'),_0x5565('0x67')];_['remove'](_0x29eaaf[_0x5565('0x62')][_0x5565('0x34')],function(_0x3ea134){return _0x64c421[_0x5565('0x68')](_0x3ea134['type']['name']);});_[_0x5565('0x69')](_0x29eaaf[_0x5565('0x62')][_0x5565('0x34')],function(_0x573581){return _0x573581[_0x5565('0x6a')]===_0x5565('0x6b');});return{'count':_0x29eaaf[_0x5565('0x62')]['fields'][_0x5565('0x35')],'rows':_['map'](_0x29eaaf['result'][_0x5565('0x34')],function(_0x211002){return{'id':_0x211002['name'],'name':_0x211002[_0x5565('0x6c')],'custom':_['startsWith'](_0x211002[_0x5565('0x26')],_0x5565('0x6d'))?!![]:![],'options':_0x211002[_0x5565('0x2b')]['name']===_0x5565('0x6e')&&_0x211002[_0x5565('0x2b')][_0x5565('0x6f')][_0x5565('0x35')]>0x0?_[_0x5565('0x2e')](_0x211002[_0x5565('0x2b')][_0x5565('0x6f')],function(_0x1adfb2){return{'name':_0x1adfb2[_0x5565('0x6c')],'value':_0x1adfb2[_0x5565('0x70')]};}):[]};})};}})[_0x5565('0x24')](respondWithResult(_0xe74fb1,null))[_0x5565('0x42')](function(_0xef15a3){console[_0x5565('0x71')](_0x5565('0x72')+_0xef15a3);var _0x20151d=_0x21de19[_0x5565('0x2f')][_0x5565('0x73')]?0x1f4:_0xef15a3[_0x5565('0x74')]||0x1f4;logger[_0x5565('0x75')](_0x5565('0x76'),_0x5565('0x55'),_0x20151d,JSON[_0x5565('0x77')](_0xef15a3));delete _0xef15a3[_0x5565('0x26')];if(_0x20151d===0x191){_0x20151d=0x190;}_0xe74fb1[_0x5565('0x17')](_0x20151d)['send'](_0x21de19[_0x5565('0x2f')][_0x5565('0x73')]?{'message':'Wrong\x20credentials','statusCode':_0xef15a3['statusCode']}:_0xef15a3);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 4ebfdf1..90b7265 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 _0x4c0d=['exports','VtigerAccount','int_vtiger_accounts','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration'];(function(_0x48cc31,_0x5aa6e9){var _0x2f45e8=function(_0x3f91a6){while(--_0x3f91a6){_0x48cc31['push'](_0x48cc31['shift']());}};_0x2f45e8(++_0x5aa6e9);}(_0x4c0d,0x163));var _0xd4c0=function(_0x152b3d,_0x40cf84){_0x152b3d=_0x152b3d-0x0;var _0x45cca3=_0x4c0d[_0x152b3d];return _0x45cca3;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xd4c0('0x0'));var BPromise=require(_0xd4c0('0x1'));var rp=require(_0xd4c0('0x2'));var fs=require('fs');var path=require(_0xd4c0('0x3'));var rimraf=require(_0xd4c0('0x4'));var config=require(_0xd4c0('0x5'));var attributes=require(_0xd4c0('0x6'));var integrations=require(_0xd4c0('0x7'));module[_0xd4c0('0x8')]=function(_0xd6f96f,_0x18109e){return _0xd6f96f['define'](_0xd4c0('0x9'),attributes,{'tableName':_0xd4c0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3d3d=['path','rimraf','../../config/environment','exports','define','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x197171,_0x5acc59){var _0x1e23cc=function(_0x3ae9ab){while(--_0x3ae9ab){_0x197171['push'](_0x197171['shift']());}};_0x1e23cc(++_0x5acc59);}(_0x3d3d,0x19a));var _0xd3d3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3d3d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd3d3('0x0'));var util=require(_0xd3d3('0x1'));var logger=require(_0xd3d3('0x2'))(_0xd3d3('0x3'));var moment=require(_0xd3d3('0x4'));var BPromise=require(_0xd3d3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd3d3('0x6'));var rimraf=require(_0xd3d3('0x7'));var config=require(_0xd3d3('0x8'));var attributes=require('./intVtigerAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xd3d3('0x9')]=function(_0x4e7615,_0x382ec4){return _0x4e7615[_0xd3d3('0xa')](_0xd3d3('0xb'),attributes,{'tableName':_0xd3d3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index 7352ca0..0f117e5 100644 --- a/server/api/intVtigerAccount/intVtigerAccount.rpc.js +++ b/server/api/intVtigerAccount/intVtigerAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeb74=['attributes','model','stringify','ShowVtigerAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','VtigerAccount,\x20%s,\x20%s','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','limit','include','map'];(function(_0xec1289,_0x4fa82b){var _0x3e223c=function(_0x9752ec){while(--_0x9752ec){_0xec1289['push'](_0xec1289['shift']());}};_0x3e223c(++_0x4fa82b);}(_0xeb74,0xe3));var _0x4eb7=function(_0x21a4e6,_0x2f1746){_0x21a4e6=_0x21a4e6-0x0;var _0x372a15=_0xeb74[_0x21a4e6];return _0x372a15;};'use strict';var _=require(_0x4eb7('0x0'));var util=require(_0x4eb7('0x1'));var moment=require(_0x4eb7('0x2'));var BPromise=require(_0x4eb7('0x3'));var rs=require(_0x4eb7('0x4'));var fs=require('fs');var Redis=require(_0x4eb7('0x5'));var db=require(_0x4eb7('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4eb7('0x7'))(_0x4eb7('0x8'));var config=require(_0x4eb7('0x9'));var jayson=require(_0x4eb7('0xa'));var client=jayson[_0x4eb7('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3986cd,_0x54859c,_0xcac7c5){return new BPromise(function(_0x2cffe7,_0x588a1c){return client['request'](_0x3986cd,_0xcac7c5)[_0x4eb7('0xc')](function(_0x2f8296){logger['info'](_0x4eb7('0xd'),_0x54859c,'request\x20sent');logger[_0x4eb7('0xe')](_0x4eb7('0xf'),_0x54859c,_0x4eb7('0x10'),JSON['stringify'](_0x2f8296));if(_0x2f8296[_0x4eb7('0x11')]){if(_0x2f8296[_0x4eb7('0x11')][_0x4eb7('0x12')]===0x1f4){logger[_0x4eb7('0x11')](_0x4eb7('0xd'),_0x54859c,_0x2f8296[_0x4eb7('0x11')][_0x4eb7('0x13')]);return _0x588a1c(_0x2f8296['error']['message']);}logger['error'](_0x4eb7('0xd'),_0x54859c,_0x2f8296['error'][_0x4eb7('0x13')]);return _0x2cffe7(_0x2f8296[_0x4eb7('0x11')][_0x4eb7('0x13')]);}else{logger[_0x4eb7('0x14')](_0x4eb7('0xd'),_0x54859c,_0x4eb7('0x10'));_0x2cffe7(_0x2f8296[_0x4eb7('0x15')][_0x4eb7('0x13')]);}})[_0x4eb7('0x16')](function(_0x17377f){logger['error'](_0x4eb7('0xd'),_0x54859c,_0x17377f);_0x588a1c(_0x17377f);});});}exports[_0x4eb7('0x17')]=function(_0x3b6d41){var _0xf14478=this;return new Promise(function(_0x302e16,_0x44f1b9){return db[_0x4eb7('0x18')][_0x4eb7('0x19')]({'raw':_0x3b6d41['options']?_0x3b6d41[_0x4eb7('0x1a')][_0x4eb7('0x1b')]===undefined?!![]:![]:!![],'where':_0x3b6d41[_0x4eb7('0x1a')]?_0x3b6d41[_0x4eb7('0x1a')][_0x4eb7('0x1c')]||null:null,'attributes':_0x3b6d41[_0x4eb7('0x1a')]?_0x3b6d41[_0x4eb7('0x1a')]['attributes']||null:null,'limit':_0x3b6d41[_0x4eb7('0x1a')]?_0x3b6d41[_0x4eb7('0x1a')][_0x4eb7('0x1d')]||null:null,'include':_0x3b6d41[_0x4eb7('0x1a')]?_0x3b6d41[_0x4eb7('0x1a')][_0x4eb7('0x1e')]?_[_0x4eb7('0x1f')](_0x3b6d41[_0x4eb7('0x1a')][_0x4eb7('0x1e')],function(_0x13e871){return{'model':db[_0x13e871['model']],'as':_0x13e871['as'],'attributes':_0x13e871[_0x4eb7('0x20')],'include':_0x13e871[_0x4eb7('0x1e')]?_[_0x4eb7('0x1f')](_0x13e871[_0x4eb7('0x1e')],function(_0x3e0da2){return{'model':db[_0x3e0da2[_0x4eb7('0x21')]],'as':_0x3e0da2['as'],'attributes':_0x3e0da2[_0x4eb7('0x20')],'include':_0x3e0da2[_0x4eb7('0x1e')]?_[_0x4eb7('0x1f')](_0x3e0da2[_0x4eb7('0x1e')],function(_0xf83c11){return{'model':db[_0xf83c11[_0x4eb7('0x21')]],'as':_0xf83c11['as'],'attributes':_0xf83c11[_0x4eb7('0x20')]};}):[]};}):[]};}):[]:[]})[_0x4eb7('0xc')](function(_0x433794){logger[_0x4eb7('0x14')](_0x4eb7('0x17'),_0x3b6d41);logger[_0x4eb7('0xe')](_0x4eb7('0x17'),_0x3b6d41,JSON[_0x4eb7('0x22')](_0x433794));_0x302e16(_0x433794);})[_0x4eb7('0x16')](function(_0x17030a){logger[_0x4eb7('0x11')]('GetVtigerAccount',_0x17030a[_0x4eb7('0x13')],_0x3b6d41);_0x44f1b9(_0xf14478['error'](0x1f4,_0x17030a[_0x4eb7('0x13')]));});});};exports[_0x4eb7('0x23')]=function(_0xc5aa21){var _0x1fe298=this;return new Promise(function(_0x468195,_0x1cec8e){return db[_0x4eb7('0x18')][_0x4eb7('0x24')]({'raw':_0xc5aa21[_0x4eb7('0x1a')]?_0xc5aa21['options'][_0x4eb7('0x1b')]===undefined?!![]:![]:!![],'where':_0xc5aa21['options']?_0xc5aa21[_0x4eb7('0x1a')][_0x4eb7('0x1c')]||null:null,'attributes':_0xc5aa21['options']?_0xc5aa21['options'][_0x4eb7('0x20')]||null:null,'include':_0xc5aa21[_0x4eb7('0x1a')]?_0xc5aa21[_0x4eb7('0x1a')][_0x4eb7('0x1e')]?_['map'](_0xc5aa21[_0x4eb7('0x1a')][_0x4eb7('0x1e')],function(_0xcc9bb4){return{'model':db[_0xcc9bb4[_0x4eb7('0x21')]],'as':_0xcc9bb4['as'],'attributes':_0xcc9bb4[_0x4eb7('0x20')],'include':_0xcc9bb4['include']?_[_0x4eb7('0x1f')](_0xcc9bb4[_0x4eb7('0x1e')],function(_0x31cc6d){return{'model':db[_0x31cc6d['model']],'as':_0x31cc6d['as'],'attributes':_0x31cc6d[_0x4eb7('0x20')],'include':_0x31cc6d[_0x4eb7('0x1e')]?_[_0x4eb7('0x1f')](_0x31cc6d['include'],function(_0x70f2b2){return{'model':db[_0x70f2b2['model']],'as':_0x70f2b2['as'],'attributes':_0x70f2b2[_0x4eb7('0x20')]};}):[]};}):[]};}):[]:[]})[_0x4eb7('0xc')](function(_0x392fa3){logger[_0x4eb7('0x14')]('ShowVtigerAccount',_0xc5aa21);logger[_0x4eb7('0xe')](_0x4eb7('0x23'),_0xc5aa21,JSON[_0x4eb7('0x22')](_0x392fa3));_0x468195(_0x392fa3);})[_0x4eb7('0x16')](function(_0x4f0cce){logger['error']('ShowVtigerAccount',_0x4f0cce[_0x4eb7('0x13')],_0xc5aa21);_0x1cec8e(_0x1fe298[_0x4eb7('0x11')](0x1f4,_0x4f0cce[_0x4eb7('0x13')]));});});}; \ No newline at end of file +var _0xb574=['where','attributes','include','map','model','ShowVtigerAccount','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw'];(function(_0x125ff8,_0x41925f){var _0x2d9ef=function(_0x4ef34c){while(--_0x4ef34c){_0x125ff8['push'](_0x125ff8['shift']());}};_0x2d9ef(++_0x41925f);}(_0xb574,0x106));var _0x4b57=function(_0x41d501,_0x3d2e54){_0x41d501=_0x41d501-0x0;var _0x256c65=_0xb574[_0x41d501];return _0x256c65;};'use strict';var _=require(_0x4b57('0x0'));var util=require(_0x4b57('0x1'));var moment=require('moment');var BPromise=require(_0x4b57('0x2'));var rs=require(_0x4b57('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4b57('0x4'))['db'];var utils=require(_0x4b57('0x5'));var logger=require(_0x4b57('0x6'))(_0x4b57('0x7'));var config=require(_0x4b57('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4b57('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a4a0f,_0x585d86,_0x4b2d65){return new BPromise(function(_0x548ee8,_0x291e54){return client[_0x4b57('0xa')](_0x4a4a0f,_0x4b2d65)[_0x4b57('0xb')](function(_0x3b112d){logger[_0x4b57('0xc')](_0x4b57('0xd'),_0x585d86,_0x4b57('0xe'));logger[_0x4b57('0xf')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x585d86,_0x4b57('0xe'),JSON[_0x4b57('0x10')](_0x3b112d));if(_0x3b112d[_0x4b57('0x11')]){if(_0x3b112d['error']['code']===0x1f4){logger[_0x4b57('0x11')](_0x4b57('0xd'),_0x585d86,_0x3b112d[_0x4b57('0x11')][_0x4b57('0x12')]);return _0x291e54(_0x3b112d[_0x4b57('0x11')][_0x4b57('0x12')]);}logger[_0x4b57('0x11')](_0x4b57('0xd'),_0x585d86,_0x3b112d[_0x4b57('0x11')]['message']);return _0x548ee8(_0x3b112d['error'][_0x4b57('0x12')]);}else{logger[_0x4b57('0xc')](_0x4b57('0xd'),_0x585d86,'request\x20sent');_0x548ee8(_0x3b112d[_0x4b57('0x13')]['message']);}})[_0x4b57('0x14')](function(_0x42aff4){logger[_0x4b57('0x11')](_0x4b57('0xd'),_0x585d86,_0x42aff4);_0x291e54(_0x42aff4);});});}exports[_0x4b57('0x15')]=function(_0xfb71cc){var _0x4ede42=this;return new Promise(function(_0x1b35ff,_0x1a0b72){return db[_0x4b57('0x16')][_0x4b57('0x17')]({'raw':_0xfb71cc['options']?_0xfb71cc[_0x4b57('0x18')][_0x4b57('0x19')]===undefined?!![]:![]:!![],'where':_0xfb71cc[_0x4b57('0x18')]?_0xfb71cc[_0x4b57('0x18')][_0x4b57('0x1a')]||null:null,'attributes':_0xfb71cc[_0x4b57('0x18')]?_0xfb71cc['options'][_0x4b57('0x1b')]||null:null,'limit':_0xfb71cc[_0x4b57('0x18')]?_0xfb71cc[_0x4b57('0x18')]['limit']||null:null,'include':_0xfb71cc[_0x4b57('0x18')]?_0xfb71cc[_0x4b57('0x18')][_0x4b57('0x1c')]?_[_0x4b57('0x1d')](_0xfb71cc['options'][_0x4b57('0x1c')],function(_0x368c5f){return{'model':db[_0x368c5f['model']],'as':_0x368c5f['as'],'attributes':_0x368c5f[_0x4b57('0x1b')],'include':_0x368c5f[_0x4b57('0x1c')]?_[_0x4b57('0x1d')](_0x368c5f[_0x4b57('0x1c')],function(_0x540eff){return{'model':db[_0x540eff[_0x4b57('0x1e')]],'as':_0x540eff['as'],'attributes':_0x540eff['attributes'],'include':_0x540eff[_0x4b57('0x1c')]?_['map'](_0x540eff[_0x4b57('0x1c')],function(_0x2dc9d8){return{'model':db[_0x2dc9d8[_0x4b57('0x1e')]],'as':_0x2dc9d8['as'],'attributes':_0x2dc9d8[_0x4b57('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4b57('0xb')](function(_0x392e37){logger['info']('GetVtigerAccount',_0xfb71cc);logger[_0x4b57('0xf')]('GetVtigerAccount',_0xfb71cc,JSON[_0x4b57('0x10')](_0x392e37));_0x1b35ff(_0x392e37);})[_0x4b57('0x14')](function(_0x874cf7){logger[_0x4b57('0x11')](_0x4b57('0x15'),_0x874cf7[_0x4b57('0x12')],_0xfb71cc);_0x1a0b72(_0x4ede42['error'](0x1f4,_0x874cf7[_0x4b57('0x12')]));});});};exports[_0x4b57('0x1f')]=function(_0x68be27){var _0x3cd331=this;return new Promise(function(_0x4ccf89,_0xa91ba){return db[_0x4b57('0x16')]['find']({'raw':_0x68be27[_0x4b57('0x18')]?_0x68be27[_0x4b57('0x18')][_0x4b57('0x19')]===undefined?!![]:![]:!![],'where':_0x68be27[_0x4b57('0x18')]?_0x68be27['options']['where']||null:null,'attributes':_0x68be27['options']?_0x68be27[_0x4b57('0x18')][_0x4b57('0x1b')]||null:null,'include':_0x68be27[_0x4b57('0x18')]?_0x68be27[_0x4b57('0x18')][_0x4b57('0x1c')]?_['map'](_0x68be27[_0x4b57('0x18')][_0x4b57('0x1c')],function(_0x1fd3f7){return{'model':db[_0x1fd3f7['model']],'as':_0x1fd3f7['as'],'attributes':_0x1fd3f7[_0x4b57('0x1b')],'include':_0x1fd3f7[_0x4b57('0x1c')]?_[_0x4b57('0x1d')](_0x1fd3f7['include'],function(_0x28a0ee){return{'model':db[_0x28a0ee[_0x4b57('0x1e')]],'as':_0x28a0ee['as'],'attributes':_0x28a0ee['attributes'],'include':_0x28a0ee[_0x4b57('0x1c')]?_[_0x4b57('0x1d')](_0x28a0ee[_0x4b57('0x1c')],function(_0x91f32e){return{'model':db[_0x91f32e[_0x4b57('0x1e')]],'as':_0x91f32e['as'],'attributes':_0x91f32e[_0x4b57('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1f9f76){logger[_0x4b57('0xc')](_0x4b57('0x1f'),_0x68be27);logger[_0x4b57('0xf')](_0x4b57('0x1f'),_0x68be27,JSON[_0x4b57('0x10')](_0x1f9f76));_0x4ccf89(_0x1f9f76);})[_0x4b57('0x14')](function(_0x4c5b82){logger['error'](_0x4b57('0x1f'),_0x4c5b82[_0x4b57('0x12')],_0x68be27);_0xa91ba(_0x3cd331[_0x4b57('0x11')](0x1f4,_0x4c5b82['message']));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 771763a..730f749 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 _0x481d=['getSubjects','getDescriptions','post','put','/:id','update','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects'];(function(_0x1c4f98,_0x38f7b7){var _0xdaa292=function(_0x4afbf6){while(--_0x4afbf6){_0x1c4f98['push'](_0x1c4f98['shift']());}};_0xdaa292(++_0x38f7b7);}(_0x481d,0x104));var _0xd481=function(_0x337748,_0x402b05){_0x337748=_0x337748-0x0;var _0x3bb03f=_0x481d[_0x337748];return _0x3bb03f;};'use strict';var multer=require(_0xd481('0x0'));var util=require('util');var path=require(_0xd481('0x1'));var timeout=require('connect-timeout');var express=require(_0xd481('0x2'));var router=express[_0xd481('0x3')]();var fs_extra=require(_0xd481('0x4'));var auth=require(_0xd481('0x5'));var interaction=require(_0xd481('0x6'));var config=require(_0xd481('0x7'));var controller=require(_0xd481('0x8'));router[_0xd481('0x9')]('/',auth[_0xd481('0xa')](),controller[_0xd481('0xb')]);router[_0xd481('0x9')]('/:id',auth[_0xd481('0xa')](),controller[_0xd481('0xc')]);router[_0xd481('0x9')](_0xd481('0xd'),auth[_0xd481('0xa')](),controller[_0xd481('0xe')]);router[_0xd481('0x9')](_0xd481('0xf'),auth[_0xd481('0xa')](),controller[_0xd481('0x10')]);router[_0xd481('0x9')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0xd481('0x11')]);router[_0xd481('0x12')]('/',auth[_0xd481('0xa')](),controller['create']);router[_0xd481('0x13')](_0xd481('0x14'),auth['isAuthenticated'](),controller[_0xd481('0x15')]);router['delete'](_0xd481('0x14'),auth[_0xd481('0xa')](),controller['destroy']);module[_0xd481('0x16')]=router; \ No newline at end of file +var _0xde1b=['/:id/subjects','getSubjects','/:id/descriptions','post','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields'];(function(_0x32f05c,_0x273aef){var _0x4307ed=function(_0x1be4da){while(--_0x1be4da){_0x32f05c['push'](_0x32f05c['shift']());}};_0x4307ed(++_0x273aef);}(_0xde1b,0xed));var _0xbde1=function(_0x5d2921,_0x58096a){_0x5d2921=_0x5d2921-0x0;var _0x1e5805=_0xde1b[_0x5d2921];return _0x1e5805;};'use strict';var multer=require(_0xbde1('0x0'));var util=require(_0xbde1('0x1'));var path=require(_0xbde1('0x2'));var timeout=require('connect-timeout');var express=require(_0xbde1('0x3'));var router=express[_0xbde1('0x4')]();var fs_extra=require(_0xbde1('0x5'));var auth=require(_0xbde1('0x6'));var interaction=require(_0xbde1('0x7'));var config=require(_0xbde1('0x8'));var controller=require(_0xbde1('0x9'));router[_0xbde1('0xa')]('/',auth[_0xbde1('0xb')](),controller['index']);router[_0xbde1('0xa')](_0xbde1('0xc'),auth['isAuthenticated'](),controller[_0xbde1('0xd')]);router[_0xbde1('0xa')](_0xbde1('0xe'),auth[_0xbde1('0xb')](),controller[_0xbde1('0xf')]);router[_0xbde1('0xa')](_0xbde1('0x10'),auth[_0xbde1('0xb')](),controller[_0xbde1('0x11')]);router['get'](_0xbde1('0x12'),auth[_0xbde1('0xb')](),controller['getDescriptions']);router[_0xbde1('0x13')]('/',auth[_0xbde1('0xb')](),controller['create']);router['put']('/:id',auth[_0xbde1('0xb')](),controller[_0xbde1('0x14')]);router['delete'](_0xbde1('0xc'),auth[_0xbde1('0xb')](),controller[_0xbde1('0x15')]);module[_0xbde1('0x16')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index dd570ba..bb15c41 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 _0x0211=['exports','STRING','sequelize'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x0211,0x12b));var _0x1021=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x0211[_0x1a36a5];return _0x746243;};'use strict';var Sequelize=require(_0x1021('0x0'));module[_0x1021('0x1')]={'name':{'type':Sequelize[_0x1021('0x2')]},'description':{'type':Sequelize[_0x1021('0x2')]}}; \ No newline at end of file +var _0x2d8c=['STRING','sequelize','exports'];(function(_0xa8883,_0x1f107f){var _0x479426=function(_0x4e56b9){while(--_0x4e56b9){_0xa8883['push'](_0xa8883['shift']());}};_0x479426(++_0x1f107f);}(_0x2d8c,0x1b7));var _0xc2d8=function(_0x224f65,_0x4750bf){_0x224f65=_0x224f65-0x0;var _0x3f921c=_0x2d8c[_0x224f65];return _0x3f921c;};'use strict';var Sequelize=require(_0xc2d8('0x0'));module[_0xc2d8('0x1')]={'name':{'type':Sequelize[_0xc2d8('0x2')]},'description':{'type':Sequelize[_0xc2d8('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 248c364..d0fece6 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 _0x883e=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','end','stack','name','send','VtigerConfiguration','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','create','body','find','params','destroy','getFields','findOne','VtigerField','order','getSubjects','getDescriptions'];(function(_0x165f04,_0xc44a0b){var _0x40d6c9=function(_0x34cec2){while(--_0x34cec2){_0x165f04['push'](_0x165f04['shift']());}};_0x40d6c9(++_0xc44a0b);}(_0x883e,0xf9));var _0xe883=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x883e[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xe883('0x0'));var rimraf=require(_0xe883('0x1'));var zipdir=require(_0xe883('0x2'));var jsonpatch=require(_0xe883('0x3'));var rp=require(_0xe883('0x4'));var moment=require(_0xe883('0x5'));var BPromise=require(_0xe883('0x6'));var Mustache=require(_0xe883('0x7'));var util=require(_0xe883('0x8'));var path=require(_0xe883('0x9'));var sox=require(_0xe883('0xa'));var csv=require(_0xe883('0xb'));var ejs=require(_0xe883('0xc'));var fs=require('fs');var fs_extra=require(_0xe883('0xd'));var _=require(_0xe883('0xe'));var squel=require(_0xe883('0xf'));var crypto=require(_0xe883('0x10'));var jsforce=require(_0xe883('0x11'));var deskjs=require('desk.js');var toCsv=require(_0xe883('0xb'));var querystring=require(_0xe883('0x12'));var Papa=require(_0xe883('0x13'));var Redis=require(_0xe883('0x14'));var authService=require(_0xe883('0x15'));var qs=require(_0xe883('0x16'));var as=require(_0xe883('0x17'));var hardwareService=require(_0xe883('0x18'));var logger=require('../../config/logger')(_0xe883('0x19'));var utils=require(_0xe883('0x1a'));var config=require(_0xe883('0x1b'));var licenseUtil=require(_0xe883('0x1c'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d59ed,_0x1b1c0a){_0x1b1c0a=_0x1b1c0a||0xcc;return function(_0x2b3904){if(_0x2b3904){return _0x5d59ed['sendStatus'](_0x1b1c0a);}return _0x5d59ed[_0xe883('0x1d')](_0x1b1c0a)['end']();};}function respondWithResult(_0x403826,_0x2c2d25){_0x2c2d25=_0x2c2d25||0xc8;return function(_0x534880){if(_0x534880){return _0x403826[_0xe883('0x1d')](_0x2c2d25)[_0xe883('0x1e')](_0x534880);}};}function respondWithFilteredResult(_0x40cc3d,_0x1cd19d){return function(_0x545389){if(_0x545389){var _0x2c5753=typeof _0x1cd19d[_0xe883('0x1f')]===_0xe883('0x20')&&typeof _0x1cd19d[_0xe883('0x21')]===_0xe883('0x20');var _0x1e87d7=_0x545389[_0xe883('0x22')];var _0x3008b3=_0x2c5753?0x0:_0x1cd19d[_0xe883('0x1f')];var _0x46b56e=_0x2c5753?_0x545389['count']:_0x1cd19d['offset']+_0x1cd19d[_0xe883('0x21')];var _0x461e8b;if(_0x46b56e>=_0x1e87d7){_0x46b56e=_0x1e87d7;_0x461e8b=0xc8;}else{_0x461e8b=0xce;}_0x40cc3d[_0xe883('0x1d')](_0x461e8b);return _0x40cc3d[_0xe883('0x23')]('Content-Range',_0x3008b3+'-'+_0x46b56e+'/'+_0x1e87d7)['json'](_0x545389);}return null;};}function patchUpdates(_0x3a34fc){return function(_0x185d74){try{jsonpatch[_0xe883('0x24')](_0x185d74,_0x3a34fc,!![]);}catch(_0x36e77e){return BPromise[_0xe883('0x25')](_0x36e77e);}return _0x185d74[_0xe883('0x26')]();};}function saveUpdates(_0x42b02c,_0x5895ae){return function(_0x539cb5){if(_0x539cb5){return _0x539cb5[_0xe883('0x27')](_0x42b02c)[_0xe883('0x28')](function(_0x339986){return _0x339986;});}return null;};}function removeEntity(_0xbdce0c,_0x22c441){return function(_0x278bed){if(_0x278bed){return _0x278bed['destroy']()[_0xe883('0x28')](function(){_0xbdce0c[_0xe883('0x1d')](0xcc)[_0xe883('0x29')]();});}};}function handleEntityNotFound(_0x29ecb8,_0x1e9f8e){return function(_0x247e7c){if(!_0x247e7c){_0x29ecb8['sendStatus'](0x194);}return _0x247e7c;};}function handleError(_0x565753,_0x41a526){_0x41a526=_0x41a526||0x1f4;return function(_0x3fe22b){logger['error'](_0x3fe22b[_0xe883('0x2a')]);if(_0x3fe22b[_0xe883('0x2b')]){delete _0x3fe22b[_0xe883('0x2b')];}_0x565753[_0xe883('0x1d')](_0x41a526)[_0xe883('0x2c')](_0x3fe22b);};}exports['index']=function(_0x1e0213,_0xdbd4d6){var _0x51421e={},_0x3494b6={},_0x408d7e={'count':0x0,'rows':[]};var _0x545962=_['map'](db[_0xe883('0x2d')][_0xe883('0x2e')],function(_0x112e62){return{'name':_0x112e62[_0xe883('0x2f')],'type':_0x112e62['type'][_0xe883('0x30')]};});_0x3494b6[_0xe883('0x31')]=_[_0xe883('0x32')](_0x545962,_0xe883('0x2b'));_0x3494b6['query']=_[_0xe883('0x33')](_0x1e0213[_0xe883('0x34')]);_0x3494b6[_0xe883('0x35')]=_['intersection'](_0x3494b6[_0xe883('0x31')],_0x3494b6['query']);_0x51421e['attributes']=_[_0xe883('0x36')](_0x3494b6[_0xe883('0x31')],qs[_0xe883('0x37')](_0x1e0213[_0xe883('0x34')]['fields']));_0x51421e[_0xe883('0x38')]=_0x51421e[_0xe883('0x38')][_0xe883('0x39')]?_0x51421e['attributes']:_0x3494b6[_0xe883('0x31')];if(!_0x1e0213[_0xe883('0x34')][_0xe883('0x3a')](_0xe883('0x3b'))){_0x51421e['limit']=qs['limit'](_0x1e0213[_0xe883('0x34')][_0xe883('0x21')]);_0x51421e[_0xe883('0x1f')]=qs['offset'](_0x1e0213[_0xe883('0x34')][_0xe883('0x1f')]);}_0x51421e['order']=qs[_0xe883('0x3c')](_0x1e0213[_0xe883('0x34')][_0xe883('0x3c')]);_0x51421e['where']=qs['filters'](_[_0xe883('0x3d')](_0x1e0213['query'],_0x3494b6[_0xe883('0x35')]),_0x545962);if(_0x1e0213['query'][_0xe883('0x3e')]){_0x51421e[_0xe883('0x3f')]=_[_0xe883('0x40')](_0x51421e['where'],{'$or':_[_0xe883('0x32')](_0x545962,function(_0x578a90){if(_0x578a90[_0xe883('0x41')]!==_0xe883('0x42')){var _0x5aa557={};_0x5aa557[_0x578a90[_0xe883('0x2b')]]={'$like':'%'+_0x1e0213[_0xe883('0x34')][_0xe883('0x3e')]+'%'};return _0x5aa557;}})});}_0x51421e=_[_0xe883('0x40')]({},_0x51421e,_0x1e0213[_0xe883('0x43')]);var _0x4ebc4b={'where':_0x51421e[_0xe883('0x3f')]};return db[_0xe883('0x2d')][_0xe883('0x22')](_0x4ebc4b)['then'](function(_0x5c7837){_0x408d7e['count']=_0x5c7837;if(_0x1e0213[_0xe883('0x34')][_0xe883('0x44')]){_0x51421e[_0xe883('0x45')]=[{'all':!![]}];}return db[_0xe883('0x2d')][_0xe883('0x46')](_0x51421e);})[_0xe883('0x28')](function(_0x5aa846){_0x408d7e['rows']=_0x5aa846;return _0x408d7e;})[_0xe883('0x28')](respondWithFilteredResult(_0xdbd4d6,_0x51421e))[_0xe883('0x47')](handleError(_0xdbd4d6,null));};exports['show']=function(_0x12c278,_0x3a23a7){var _0x164e6a={'raw':![],'where':{'id':_0x12c278['params']['id']}},_0x3c47dc={};_0x3c47dc[_0xe883('0x31')]=_[_0xe883('0x33')](db[_0xe883('0x2d')][_0xe883('0x2e')]);_0x3c47dc['query']=_[_0xe883('0x33')](_0x12c278[_0xe883('0x34')]);_0x3c47dc['filters']=_[_0xe883('0x36')](_0x3c47dc['model'],_0x3c47dc[_0xe883('0x34')]);_0x164e6a['attributes']=_['intersection'](_0x3c47dc[_0xe883('0x31')],qs['fields'](_0x12c278[_0xe883('0x34')][_0xe883('0x37')]));_0x164e6a[_0xe883('0x38')]=_0x164e6a[_0xe883('0x38')][_0xe883('0x39')]?_0x164e6a['attributes']:_0x3c47dc['model'];if(_0x12c278['query']['includeAll']){_0x164e6a[_0xe883('0x45')]=[{'all':!![]}];}_0x164e6a=_[_0xe883('0x40')]({},_0x164e6a,_0x12c278[_0xe883('0x43')]);return db[_0xe883('0x2d')]['find'](_0x164e6a)['then'](handleEntityNotFound(_0x3a23a7,null))[_0xe883('0x28')](respondWithResult(_0x3a23a7,null))['catch'](handleError(_0x3a23a7,null));};exports[_0xe883('0x48')]=function(_0x212167,_0x1177ad){return db[_0xe883('0x2d')][_0xe883('0x48')](_0x212167[_0xe883('0x49')],{})[_0xe883('0x28')](respondWithResult(_0x1177ad,0xc9))[_0xe883('0x47')](handleError(_0x1177ad,null));};exports[_0xe883('0x27')]=function(_0x2d31ad,_0x296f33){if(_0x2d31ad[_0xe883('0x49')]['id']){delete _0x2d31ad[_0xe883('0x49')]['id'];}return db[_0xe883('0x2d')][_0xe883('0x4a')]({'where':{'id':_0x2d31ad[_0xe883('0x4b')]['id']}})[_0xe883('0x28')](handleEntityNotFound(_0x296f33,null))[_0xe883('0x28')](saveUpdates(_0x2d31ad[_0xe883('0x49')],null))[_0xe883('0x28')](respondWithResult(_0x296f33,null))[_0xe883('0x47')](handleError(_0x296f33,null));};exports[_0xe883('0x4c')]=function(_0x35f141,_0x4fceb5){return db[_0xe883('0x2d')][_0xe883('0x4a')]({'where':{'id':_0x35f141[_0xe883('0x4b')]['id']}})[_0xe883('0x28')](handleEntityNotFound(_0x4fceb5,null))['then'](removeEntity(_0x4fceb5,null))['catch'](handleError(_0x4fceb5,null));};exports[_0xe883('0x4d')]=function(_0x290bbf,_0x12512e,_0x1d96d2){var _0x428d81={};var _0x39b502={};var _0x2df918;var _0x34f08d;return db[_0xe883('0x2d')][_0xe883('0x4e')]({'where':{'id':_0x290bbf[_0xe883('0x4b')]['id']}})[_0xe883('0x28')](handleEntityNotFound(_0x12512e,null))[_0xe883('0x28')](function(_0x159b2e){if(_0x159b2e){_0x2df918=_0x159b2e;_0x39b502[_0xe883('0x31')]=_['keys'](db[_0xe883('0x4f')][_0xe883('0x2e')]);_0x39b502['query']=_['keys'](_0x290bbf[_0xe883('0x34')]);_0x39b502[_0xe883('0x35')]=_[_0xe883('0x36')](_0x39b502[_0xe883('0x31')],_0x39b502[_0xe883('0x34')]);_0x428d81['attributes']=_['intersection'](_0x39b502[_0xe883('0x31')],qs['fields'](_0x290bbf['query'][_0xe883('0x37')]));_0x428d81[_0xe883('0x38')]=_0x428d81['attributes'][_0xe883('0x39')]?_0x428d81[_0xe883('0x38')]:_0x39b502[_0xe883('0x31')];_0x428d81[_0xe883('0x50')]=qs[_0xe883('0x3c')](_0x290bbf['query'][_0xe883('0x3c')]);_0x428d81[_0xe883('0x3f')]=qs[_0xe883('0x35')](_[_0xe883('0x3d')](_0x290bbf[_0xe883('0x34')],_0x39b502[_0xe883('0x35')]));if(_0x290bbf['query'][_0xe883('0x3e')]){_0x428d81['where']=_[_0xe883('0x40')](_0x428d81[_0xe883('0x3f')],{'$or':_[_0xe883('0x32')](_0x428d81[_0xe883('0x38')],function(_0x1c7ad5){var _0x47e2e2={};_0x47e2e2[_0x1c7ad5]={'$like':'%'+_0x290bbf[_0xe883('0x34')][_0xe883('0x3e')]+'%'};return _0x47e2e2;})});}_0x428d81=_[_0xe883('0x40')]({},_0x428d81,_0x290bbf[_0xe883('0x43')]);return _0x2df918[_0xe883('0x4d')](_0x428d81);}})[_0xe883('0x28')](function(_0x5e76d8){if(_0x5e76d8){_0x34f08d=_0x5e76d8[_0xe883('0x39')];if(!_0x290bbf[_0xe883('0x34')][_0xe883('0x3a')](_0xe883('0x3b'))){_0x428d81[_0xe883('0x21')]=qs[_0xe883('0x21')](_0x290bbf[_0xe883('0x34')][_0xe883('0x21')]);_0x428d81['offset']=qs[_0xe883('0x1f')](_0x290bbf[_0xe883('0x34')][_0xe883('0x1f')]);}return _0x2df918[_0xe883('0x4d')](_0x428d81);}})['then'](function(_0x38b926){if(_0x38b926){return _0x38b926?{'count':_0x34f08d,'rows':_0x38b926}:null;}})[_0xe883('0x28')](respondWithResult(_0x12512e,null))[_0xe883('0x47')](handleError(_0x12512e,null));};exports[_0xe883('0x51')]=function(_0x36205b,_0x307b57,_0xbbab4b){var _0x3965a6={};var _0x343c80={};var _0x401420;var _0x296abd;return db[_0xe883('0x2d')][_0xe883('0x4e')]({'where':{'id':_0x36205b[_0xe883('0x4b')]['id']}})[_0xe883('0x28')](handleEntityNotFound(_0x307b57,null))[_0xe883('0x28')](function(_0xd69885){if(_0xd69885){_0x401420=_0xd69885;_0x343c80['model']=_[_0xe883('0x33')](db[_0xe883('0x4f')][_0xe883('0x2e')]);_0x343c80[_0xe883('0x34')]=_[_0xe883('0x33')](_0x36205b[_0xe883('0x34')]);_0x343c80[_0xe883('0x35')]=_[_0xe883('0x36')](_0x343c80[_0xe883('0x31')],_0x343c80[_0xe883('0x34')]);_0x3965a6[_0xe883('0x38')]=_[_0xe883('0x36')](_0x343c80[_0xe883('0x31')],qs[_0xe883('0x37')](_0x36205b[_0xe883('0x34')]['fields']));_0x3965a6[_0xe883('0x38')]=_0x3965a6[_0xe883('0x38')][_0xe883('0x39')]?_0x3965a6[_0xe883('0x38')]:_0x343c80[_0xe883('0x31')];_0x3965a6[_0xe883('0x50')]=qs[_0xe883('0x3c')](_0x36205b[_0xe883('0x34')][_0xe883('0x3c')]);_0x3965a6['where']=qs[_0xe883('0x35')](_[_0xe883('0x3d')](_0x36205b[_0xe883('0x34')],_0x343c80[_0xe883('0x35')]));if(_0x36205b[_0xe883('0x34')][_0xe883('0x3e')]){_0x3965a6['where']=_[_0xe883('0x40')](_0x3965a6['where'],{'$or':_[_0xe883('0x32')](_0x3965a6['attributes'],function(_0x46e01b){var _0x5a5930={};_0x5a5930[_0x46e01b]={'$like':'%'+_0x36205b[_0xe883('0x34')][_0xe883('0x3e')]+'%'};return _0x5a5930;})});}_0x3965a6=_[_0xe883('0x40')]({},_0x3965a6,_0x36205b[_0xe883('0x43')]);return _0x401420[_0xe883('0x51')](_0x3965a6);}})['then'](function(_0x416d18){if(_0x416d18){_0x296abd=_0x416d18[_0xe883('0x39')];if(!_0x36205b[_0xe883('0x34')][_0xe883('0x3a')](_0xe883('0x3b'))){_0x3965a6[_0xe883('0x21')]=qs['limit'](_0x36205b[_0xe883('0x34')]['limit']);_0x3965a6[_0xe883('0x1f')]=qs[_0xe883('0x1f')](_0x36205b[_0xe883('0x34')][_0xe883('0x1f')]);}return _0x401420[_0xe883('0x51')](_0x3965a6);}})[_0xe883('0x28')](function(_0x19ba11){if(_0x19ba11){return _0x19ba11?{'count':_0x296abd,'rows':_0x19ba11}:null;}})[_0xe883('0x28')](respondWithResult(_0x307b57,null))['catch'](handleError(_0x307b57,null));};exports['getDescriptions']=function(_0x560abf,_0x4f0b67,_0x4d5748){var _0x55c983={};var _0x1ae673={};var _0x4202dc;var _0x2e17bf;return db[_0xe883('0x2d')]['findOne']({'where':{'id':_0x560abf[_0xe883('0x4b')]['id']}})[_0xe883('0x28')](handleEntityNotFound(_0x4f0b67,null))['then'](function(_0x1d6273){if(_0x1d6273){_0x4202dc=_0x1d6273;_0x1ae673[_0xe883('0x31')]=_[_0xe883('0x33')](db[_0xe883('0x4f')][_0xe883('0x2e')]);_0x1ae673[_0xe883('0x34')]=_[_0xe883('0x33')](_0x560abf[_0xe883('0x34')]);_0x1ae673[_0xe883('0x35')]=_[_0xe883('0x36')](_0x1ae673[_0xe883('0x31')],_0x1ae673[_0xe883('0x34')]);_0x55c983['attributes']=_[_0xe883('0x36')](_0x1ae673[_0xe883('0x31')],qs['fields'](_0x560abf[_0xe883('0x34')][_0xe883('0x37')]));_0x55c983['attributes']=_0x55c983[_0xe883('0x38')][_0xe883('0x39')]?_0x55c983[_0xe883('0x38')]:_0x1ae673[_0xe883('0x31')];_0x55c983[_0xe883('0x50')]=qs[_0xe883('0x3c')](_0x560abf[_0xe883('0x34')][_0xe883('0x3c')]);_0x55c983['where']=qs[_0xe883('0x35')](_[_0xe883('0x3d')](_0x560abf[_0xe883('0x34')],_0x1ae673[_0xe883('0x35')]));if(_0x560abf[_0xe883('0x34')][_0xe883('0x3e')]){_0x55c983[_0xe883('0x3f')]=_[_0xe883('0x40')](_0x55c983[_0xe883('0x3f')],{'$or':_[_0xe883('0x32')](_0x55c983[_0xe883('0x38')],function(_0x3b123e){var _0x26c876={};_0x26c876[_0x3b123e]={'$like':'%'+_0x560abf[_0xe883('0x34')][_0xe883('0x3e')]+'%'};return _0x26c876;})});}_0x55c983=_[_0xe883('0x40')]({},_0x55c983,_0x560abf[_0xe883('0x43')]);return _0x4202dc[_0xe883('0x52')](_0x55c983);}})['then'](function(_0x5703f5){if(_0x5703f5){_0x2e17bf=_0x5703f5[_0xe883('0x39')];if(!_0x560abf['query']['hasOwnProperty'](_0xe883('0x3b'))){_0x55c983[_0xe883('0x21')]=qs['limit'](_0x560abf['query'][_0xe883('0x21')]);_0x55c983[_0xe883('0x1f')]=qs[_0xe883('0x1f')](_0x560abf[_0xe883('0x34')][_0xe883('0x1f')]);}return _0x4202dc['getDescriptions'](_0x55c983);}})[_0xe883('0x28')](function(_0x18a7f3){if(_0x18a7f3){return _0x18a7f3?{'count':_0x2e17bf,'rows':_0x18a7f3}:null;}})[_0xe883('0x28')](respondWithResult(_0x4f0b67,null))[_0xe883('0x47')](handleError(_0x4f0b67,null));}; \ No newline at end of file +var _0x08af=['catch','create','body','VtigerField','sort','getFields','findOne','getSubjects','getDescriptions','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','VtigerConfiguration','rawAttributes','key','query','keys','filters','model','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','show','params','intersection','find'];(function(_0x503564,_0x55867e){var _0x4be9fd=function(_0x41c543){while(--_0x41c543){_0x503564['push'](_0x503564['shift']());}};_0x4be9fd(++_0x55867e);}(_0x08af,0xff));var _0xf08a=function(_0x33ccaf,_0x192235){_0x33ccaf=_0x33ccaf-0x0;var _0x30abf6=_0x08af[_0x33ccaf];return _0x30abf6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf08a('0x0'));var zipdir=require(_0xf08a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf08a('0x2'));var moment=require(_0xf08a('0x3'));var BPromise=require(_0xf08a('0x4'));var Mustache=require(_0xf08a('0x5'));var util=require(_0xf08a('0x6'));var path=require(_0xf08a('0x7'));var sox=require('sox');var csv=require(_0xf08a('0x8'));var ejs=require(_0xf08a('0x9'));var fs=require('fs');var fs_extra=require(_0xf08a('0xa'));var _=require(_0xf08a('0xb'));var squel=require(_0xf08a('0xc'));var crypto=require('crypto');var jsforce=require(_0xf08a('0xd'));var deskjs=require(_0xf08a('0xe'));var toCsv=require(_0xf08a('0x8'));var querystring=require('querystring');var Papa=require(_0xf08a('0xf'));var Redis=require(_0xf08a('0x10'));var authService=require(_0xf08a('0x11'));var qs=require(_0xf08a('0x12'));var as=require(_0xf08a('0x13'));var hardwareService=require(_0xf08a('0x14'));var logger=require(_0xf08a('0x15'))(_0xf08a('0x16'));var utils=require(_0xf08a('0x17'));var config=require(_0xf08a('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xf08a('0x19'))['db'];function respondWithStatusCode(_0x35acf6,_0x5a5ade){_0x5a5ade=_0x5a5ade||0xcc;return function(_0x40b032){if(_0x40b032){return _0x35acf6['sendStatus'](_0x5a5ade);}return _0x35acf6['status'](_0x5a5ade)[_0xf08a('0x1a')]();};}function respondWithResult(_0x106005,_0x2c886b){_0x2c886b=_0x2c886b||0xc8;return function(_0x324e8b){if(_0x324e8b){return _0x106005[_0xf08a('0x1b')](_0x2c886b)[_0xf08a('0x1c')](_0x324e8b);}};}function respondWithFilteredResult(_0x51678f,_0x13d47f){return function(_0x2bef1d){if(_0x2bef1d){var _0x396678=typeof _0x13d47f[_0xf08a('0x1d')]==='undefined'&&typeof _0x13d47f['limit']===_0xf08a('0x1e');var _0x439b78=_0x2bef1d['count'];var _0x1c412b=_0x396678?0x0:_0x13d47f[_0xf08a('0x1d')];var _0x5b0c81=_0x396678?_0x2bef1d[_0xf08a('0x1f')]:_0x13d47f['offset']+_0x13d47f[_0xf08a('0x20')];var _0x4c075e;if(_0x5b0c81>=_0x439b78){_0x5b0c81=_0x439b78;_0x4c075e=0xc8;}else{_0x4c075e=0xce;}_0x51678f[_0xf08a('0x1b')](_0x4c075e);return _0x51678f[_0xf08a('0x21')]('Content-Range',_0x1c412b+'-'+_0x5b0c81+'/'+_0x439b78)[_0xf08a('0x1c')](_0x2bef1d);}return null;};}function patchUpdates(_0x4384a7){return function(_0x21017f){try{jsonpatch[_0xf08a('0x22')](_0x21017f,_0x4384a7,!![]);}catch(_0x528bfd){return BPromise[_0xf08a('0x23')](_0x528bfd);}return _0x21017f[_0xf08a('0x24')]();};}function saveUpdates(_0x34dbd0,_0xcb134){return function(_0x588c2b){if(_0x588c2b){return _0x588c2b[_0xf08a('0x25')](_0x34dbd0)[_0xf08a('0x26')](function(_0x4f1e0a){return _0x4f1e0a;});}return null;};}function removeEntity(_0x438a35,_0x31a8cf){return function(_0x571d56){if(_0x571d56){return _0x571d56[_0xf08a('0x27')]()[_0xf08a('0x26')](function(){_0x438a35[_0xf08a('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20fc3e,_0x20ec51){return function(_0x1adc15){if(!_0x1adc15){_0x20fc3e['sendStatus'](0x194);}return _0x1adc15;};}function handleError(_0x587d43,_0x3cac84){_0x3cac84=_0x3cac84||0x1f4;return function(_0x25f1d0){logger[_0xf08a('0x28')](_0x25f1d0[_0xf08a('0x29')]);if(_0x25f1d0['name']){delete _0x25f1d0[_0xf08a('0x2a')];}_0x587d43[_0xf08a('0x1b')](_0x3cac84)[_0xf08a('0x2b')](_0x25f1d0);};}exports[_0xf08a('0x2c')]=function(_0xe1ee2c,_0x25719c){var _0x432411={},_0xbbdb06={},_0x49273c={'count':0x0,'rows':[]};var _0x2eb75c=_[_0xf08a('0x2d')](db[_0xf08a('0x2e')][_0xf08a('0x2f')],function(_0x32d261){return{'name':_0x32d261['fieldName'],'type':_0x32d261['type'][_0xf08a('0x30')]};});_0xbbdb06['model']=_[_0xf08a('0x2d')](_0x2eb75c,'name');_0xbbdb06[_0xf08a('0x31')]=_[_0xf08a('0x32')](_0xe1ee2c[_0xf08a('0x31')]);_0xbbdb06[_0xf08a('0x33')]=_['intersection'](_0xbbdb06[_0xf08a('0x34')],_0xbbdb06[_0xf08a('0x31')]);_0x432411['attributes']=_['intersection'](_0xbbdb06[_0xf08a('0x34')],qs[_0xf08a('0x35')](_0xe1ee2c[_0xf08a('0x31')][_0xf08a('0x35')]));_0x432411['attributes']=_0x432411[_0xf08a('0x36')][_0xf08a('0x37')]?_0x432411[_0xf08a('0x36')]:_0xbbdb06[_0xf08a('0x34')];if(!_0xe1ee2c[_0xf08a('0x31')][_0xf08a('0x38')](_0xf08a('0x39'))){_0x432411['limit']=qs[_0xf08a('0x20')](_0xe1ee2c[_0xf08a('0x31')][_0xf08a('0x20')]);_0x432411[_0xf08a('0x1d')]=qs[_0xf08a('0x1d')](_0xe1ee2c['query'][_0xf08a('0x1d')]);}_0x432411[_0xf08a('0x3a')]=qs['sort'](_0xe1ee2c[_0xf08a('0x31')]['sort']);_0x432411[_0xf08a('0x3b')]=qs[_0xf08a('0x33')](_[_0xf08a('0x3c')](_0xe1ee2c[_0xf08a('0x31')],_0xbbdb06['filters']),_0x2eb75c);if(_0xe1ee2c[_0xf08a('0x31')][_0xf08a('0x3d')]){_0x432411[_0xf08a('0x3b')]=_[_0xf08a('0x3e')](_0x432411['where'],{'$or':_[_0xf08a('0x2d')](_0x2eb75c,function(_0xd28adc){if(_0xd28adc[_0xf08a('0x3f')]!==_0xf08a('0x40')){var _0x555aea={};_0x555aea[_0xd28adc[_0xf08a('0x2a')]]={'$like':'%'+_0xe1ee2c['query'][_0xf08a('0x3d')]+'%'};return _0x555aea;}})});}_0x432411=_[_0xf08a('0x3e')]({},_0x432411,_0xe1ee2c[_0xf08a('0x41')]);var _0xadaa={'where':_0x432411[_0xf08a('0x3b')]};return db[_0xf08a('0x2e')][_0xf08a('0x1f')](_0xadaa)[_0xf08a('0x26')](function(_0x5d6481){_0x49273c[_0xf08a('0x1f')]=_0x5d6481;if(_0xe1ee2c[_0xf08a('0x31')][_0xf08a('0x42')]){_0x432411[_0xf08a('0x43')]=[{'all':!![]}];}return db[_0xf08a('0x2e')][_0xf08a('0x44')](_0x432411);})[_0xf08a('0x26')](function(_0x26cb62){_0x49273c['rows']=_0x26cb62;return _0x49273c;})[_0xf08a('0x26')](respondWithFilteredResult(_0x25719c,_0x432411))['catch'](handleError(_0x25719c,null));};exports[_0xf08a('0x45')]=function(_0x5d3ce8,_0x5e59){var _0x27078a={'raw':![],'where':{'id':_0x5d3ce8[_0xf08a('0x46')]['id']}},_0x4cbae1={};_0x4cbae1[_0xf08a('0x34')]=_[_0xf08a('0x32')](db['VtigerConfiguration'][_0xf08a('0x2f')]);_0x4cbae1[_0xf08a('0x31')]=_[_0xf08a('0x32')](_0x5d3ce8[_0xf08a('0x31')]);_0x4cbae1[_0xf08a('0x33')]=_['intersection'](_0x4cbae1[_0xf08a('0x34')],_0x4cbae1['query']);_0x27078a[_0xf08a('0x36')]=_[_0xf08a('0x47')](_0x4cbae1[_0xf08a('0x34')],qs[_0xf08a('0x35')](_0x5d3ce8[_0xf08a('0x31')][_0xf08a('0x35')]));_0x27078a[_0xf08a('0x36')]=_0x27078a[_0xf08a('0x36')][_0xf08a('0x37')]?_0x27078a['attributes']:_0x4cbae1[_0xf08a('0x34')];if(_0x5d3ce8[_0xf08a('0x31')]['includeAll']){_0x27078a[_0xf08a('0x43')]=[{'all':!![]}];}_0x27078a=_[_0xf08a('0x3e')]({},_0x27078a,_0x5d3ce8[_0xf08a('0x41')]);return db[_0xf08a('0x2e')][_0xf08a('0x48')](_0x27078a)[_0xf08a('0x26')](handleEntityNotFound(_0x5e59,null))[_0xf08a('0x26')](respondWithResult(_0x5e59,null))[_0xf08a('0x49')](handleError(_0x5e59,null));};exports[_0xf08a('0x4a')]=function(_0x5b99b1,_0x463e82){return db['VtigerConfiguration']['create'](_0x5b99b1['body'],{})[_0xf08a('0x26')](respondWithResult(_0x463e82,0xc9))['catch'](handleError(_0x463e82,null));};exports['update']=function(_0x2649db,_0x48d015){if(_0x2649db[_0xf08a('0x4b')]['id']){delete _0x2649db['body']['id'];}return db[_0xf08a('0x2e')][_0xf08a('0x48')]({'where':{'id':_0x2649db['params']['id']}})[_0xf08a('0x26')](handleEntityNotFound(_0x48d015,null))['then'](saveUpdates(_0x2649db[_0xf08a('0x4b')],null))[_0xf08a('0x26')](respondWithResult(_0x48d015,null))[_0xf08a('0x49')](handleError(_0x48d015,null));};exports[_0xf08a('0x27')]=function(_0x635d7d,_0x570bf6){return db['VtigerConfiguration'][_0xf08a('0x48')]({'where':{'id':_0x635d7d[_0xf08a('0x46')]['id']}})[_0xf08a('0x26')](handleEntityNotFound(_0x570bf6,null))['then'](removeEntity(_0x570bf6,null))[_0xf08a('0x49')](handleError(_0x570bf6,null));};exports['getFields']=function(_0x3b9757,_0x25c7bb,_0x19a3b0){var _0x120f83={};var _0x144616={};var _0x218129;var _0x463a04;return db[_0xf08a('0x2e')]['findOne']({'where':{'id':_0x3b9757[_0xf08a('0x46')]['id']}})['then'](handleEntityNotFound(_0x25c7bb,null))[_0xf08a('0x26')](function(_0xe80b2f){if(_0xe80b2f){_0x218129=_0xe80b2f;_0x144616['model']=_[_0xf08a('0x32')](db[_0xf08a('0x4c')][_0xf08a('0x2f')]);_0x144616[_0xf08a('0x31')]=_[_0xf08a('0x32')](_0x3b9757['query']);_0x144616[_0xf08a('0x33')]=_[_0xf08a('0x47')](_0x144616[_0xf08a('0x34')],_0x144616[_0xf08a('0x31')]);_0x120f83[_0xf08a('0x36')]=_[_0xf08a('0x47')](_0x144616[_0xf08a('0x34')],qs['fields'](_0x3b9757[_0xf08a('0x31')]['fields']));_0x120f83[_0xf08a('0x36')]=_0x120f83[_0xf08a('0x36')][_0xf08a('0x37')]?_0x120f83[_0xf08a('0x36')]:_0x144616[_0xf08a('0x34')];_0x120f83[_0xf08a('0x3a')]=qs[_0xf08a('0x4d')](_0x3b9757[_0xf08a('0x31')]['sort']);_0x120f83['where']=qs[_0xf08a('0x33')](_['pick'](_0x3b9757[_0xf08a('0x31')],_0x144616[_0xf08a('0x33')]));if(_0x3b9757[_0xf08a('0x31')][_0xf08a('0x3d')]){_0x120f83[_0xf08a('0x3b')]=_[_0xf08a('0x3e')](_0x120f83[_0xf08a('0x3b')],{'$or':_[_0xf08a('0x2d')](_0x120f83[_0xf08a('0x36')],function(_0x215eec){var _0x4f3093={};_0x4f3093[_0x215eec]={'$like':'%'+_0x3b9757['query'][_0xf08a('0x3d')]+'%'};return _0x4f3093;})});}_0x120f83=_[_0xf08a('0x3e')]({},_0x120f83,_0x3b9757['options']);return _0x218129[_0xf08a('0x4e')](_0x120f83);}})[_0xf08a('0x26')](function(_0x46337a){if(_0x46337a){_0x463a04=_0x46337a[_0xf08a('0x37')];if(!_0x3b9757[_0xf08a('0x31')][_0xf08a('0x38')](_0xf08a('0x39'))){_0x120f83[_0xf08a('0x20')]=qs[_0xf08a('0x20')](_0x3b9757[_0xf08a('0x31')][_0xf08a('0x20')]);_0x120f83[_0xf08a('0x1d')]=qs[_0xf08a('0x1d')](_0x3b9757[_0xf08a('0x31')][_0xf08a('0x1d')]);}return _0x218129['getFields'](_0x120f83);}})['then'](function(_0x24448e){if(_0x24448e){return _0x24448e?{'count':_0x463a04,'rows':_0x24448e}:null;}})[_0xf08a('0x26')](respondWithResult(_0x25c7bb,null))['catch'](handleError(_0x25c7bb,null));};exports['getSubjects']=function(_0x4da3ab,_0x16704f,_0x573191){var _0x6cdf13={};var _0x3b4d0e={};var _0x541d57;var _0x768736;return db['VtigerConfiguration'][_0xf08a('0x4f')]({'where':{'id':_0x4da3ab[_0xf08a('0x46')]['id']}})[_0xf08a('0x26')](handleEntityNotFound(_0x16704f,null))[_0xf08a('0x26')](function(_0x1950fc){if(_0x1950fc){_0x541d57=_0x1950fc;_0x3b4d0e['model']=_[_0xf08a('0x32')](db['VtigerField'][_0xf08a('0x2f')]);_0x3b4d0e['query']=_['keys'](_0x4da3ab[_0xf08a('0x31')]);_0x3b4d0e[_0xf08a('0x33')]=_[_0xf08a('0x47')](_0x3b4d0e[_0xf08a('0x34')],_0x3b4d0e[_0xf08a('0x31')]);_0x6cdf13['attributes']=_['intersection'](_0x3b4d0e[_0xf08a('0x34')],qs[_0xf08a('0x35')](_0x4da3ab[_0xf08a('0x31')][_0xf08a('0x35')]));_0x6cdf13[_0xf08a('0x36')]=_0x6cdf13[_0xf08a('0x36')][_0xf08a('0x37')]?_0x6cdf13[_0xf08a('0x36')]:_0x3b4d0e['model'];_0x6cdf13['order']=qs[_0xf08a('0x4d')](_0x4da3ab[_0xf08a('0x31')][_0xf08a('0x4d')]);_0x6cdf13[_0xf08a('0x3b')]=qs['filters'](_['pick'](_0x4da3ab[_0xf08a('0x31')],_0x3b4d0e['filters']));if(_0x4da3ab[_0xf08a('0x31')][_0xf08a('0x3d')]){_0x6cdf13[_0xf08a('0x3b')]=_[_0xf08a('0x3e')](_0x6cdf13[_0xf08a('0x3b')],{'$or':_[_0xf08a('0x2d')](_0x6cdf13[_0xf08a('0x36')],function(_0x57c73e){var _0xbf9edb={};_0xbf9edb[_0x57c73e]={'$like':'%'+_0x4da3ab[_0xf08a('0x31')][_0xf08a('0x3d')]+'%'};return _0xbf9edb;})});}_0x6cdf13=_['merge']({},_0x6cdf13,_0x4da3ab[_0xf08a('0x41')]);return _0x541d57['getSubjects'](_0x6cdf13);}})[_0xf08a('0x26')](function(_0x3b3a59){if(_0x3b3a59){_0x768736=_0x3b3a59[_0xf08a('0x37')];if(!_0x4da3ab[_0xf08a('0x31')][_0xf08a('0x38')]('nolimit')){_0x6cdf13[_0xf08a('0x20')]=qs[_0xf08a('0x20')](_0x4da3ab[_0xf08a('0x31')][_0xf08a('0x20')]);_0x6cdf13[_0xf08a('0x1d')]=qs[_0xf08a('0x1d')](_0x4da3ab['query']['offset']);}return _0x541d57[_0xf08a('0x50')](_0x6cdf13);}})['then'](function(_0x445f4c){if(_0x445f4c){return _0x445f4c?{'count':_0x768736,'rows':_0x445f4c}:null;}})[_0xf08a('0x26')](respondWithResult(_0x16704f,null))[_0xf08a('0x49')](handleError(_0x16704f,null));};exports[_0xf08a('0x51')]=function(_0x6bc146,_0x1c362c,_0xb78938){var _0x4e39ed={};var _0x35c6ac={};var _0x54cb1b;var _0x518aca;return db[_0xf08a('0x2e')][_0xf08a('0x4f')]({'where':{'id':_0x6bc146[_0xf08a('0x46')]['id']}})[_0xf08a('0x26')](handleEntityNotFound(_0x1c362c,null))[_0xf08a('0x26')](function(_0x282b0b){if(_0x282b0b){_0x54cb1b=_0x282b0b;_0x35c6ac[_0xf08a('0x34')]=_[_0xf08a('0x32')](db['VtigerField'][_0xf08a('0x2f')]);_0x35c6ac[_0xf08a('0x31')]=_[_0xf08a('0x32')](_0x6bc146[_0xf08a('0x31')]);_0x35c6ac['filters']=_[_0xf08a('0x47')](_0x35c6ac[_0xf08a('0x34')],_0x35c6ac[_0xf08a('0x31')]);_0x4e39ed[_0xf08a('0x36')]=_[_0xf08a('0x47')](_0x35c6ac[_0xf08a('0x34')],qs[_0xf08a('0x35')](_0x6bc146[_0xf08a('0x31')][_0xf08a('0x35')]));_0x4e39ed[_0xf08a('0x36')]=_0x4e39ed[_0xf08a('0x36')][_0xf08a('0x37')]?_0x4e39ed[_0xf08a('0x36')]:_0x35c6ac[_0xf08a('0x34')];_0x4e39ed[_0xf08a('0x3a')]=qs[_0xf08a('0x4d')](_0x6bc146[_0xf08a('0x31')][_0xf08a('0x4d')]);_0x4e39ed[_0xf08a('0x3b')]=qs[_0xf08a('0x33')](_[_0xf08a('0x3c')](_0x6bc146[_0xf08a('0x31')],_0x35c6ac[_0xf08a('0x33')]));if(_0x6bc146[_0xf08a('0x31')][_0xf08a('0x3d')]){_0x4e39ed[_0xf08a('0x3b')]=_['merge'](_0x4e39ed[_0xf08a('0x3b')],{'$or':_[_0xf08a('0x2d')](_0x4e39ed['attributes'],function(_0x12d169){var _0x3d1fe1={};_0x3d1fe1[_0x12d169]={'$like':'%'+_0x6bc146[_0xf08a('0x31')][_0xf08a('0x3d')]+'%'};return _0x3d1fe1;})});}_0x4e39ed=_[_0xf08a('0x3e')]({},_0x4e39ed,_0x6bc146['options']);return _0x54cb1b['getDescriptions'](_0x4e39ed);}})[_0xf08a('0x26')](function(_0x44cee5){if(_0x44cee5){_0x518aca=_0x44cee5[_0xf08a('0x37')];if(!_0x6bc146[_0xf08a('0x31')][_0xf08a('0x38')](_0xf08a('0x39'))){_0x4e39ed[_0xf08a('0x20')]=qs['limit'](_0x6bc146[_0xf08a('0x31')][_0xf08a('0x20')]);_0x4e39ed[_0xf08a('0x1d')]=qs['offset'](_0x6bc146[_0xf08a('0x31')][_0xf08a('0x1d')]);}return _0x54cb1b['getDescriptions'](_0x4e39ed);}})['then'](function(_0x27e47d){if(_0x27e47d){return _0x27e47d?{'count':_0x518aca,'rows':_0x27e47d}:null;}})[_0xf08a('0x26')](respondWithResult(_0x1c362c,null))[_0xf08a('0x49')](handleError(_0x1c362c,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index e457d86..3e4f2c5 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 _0x03c2=['exports','define','VtigerConfiguration','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes'];(function(_0x2c2dff,_0x302e28){var _0x1177a4=function(_0x2fa930){while(--_0x2fa930){_0x2c2dff['push'](_0x2c2dff['shift']());}};_0x1177a4(++_0x302e28);}(_0x03c2,0x12f));var _0x203c=function(_0x19ac4a,_0x43798e){_0x19ac4a=_0x19ac4a-0x0;var _0xaa950=_0x03c2[_0x19ac4a];return _0xaa950;};'use strict';var _=require(_0x203c('0x0'));var util=require(_0x203c('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x203c('0x2'));var BPromise=require(_0x203c('0x3'));var rp=require(_0x203c('0x4'));var fs=require('fs');var path=require(_0x203c('0x5'));var rimraf=require(_0x203c('0x6'));var config=require(_0x203c('0x7'));var attributes=require(_0x203c('0x8'));module[_0x203c('0x9')]=function(_0x1dd36c,_0x456414){return _0x1dd36c[_0x203c('0xa')](_0x203c('0xb'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2148=['rimraf','exports','define','VtigerConfiguration','lodash','api','bluebird','path'];(function(_0x4f057a,_0x312d92){var _0x4cecf3=function(_0x4ae15b){while(--_0x4ae15b){_0x4f057a['push'](_0x4f057a['shift']());}};_0x4cecf3(++_0x312d92);}(_0x2148,0x94));var _0x8214=function(_0x1a37e3,_0x5db8f6){_0x1a37e3=_0x1a37e3-0x0;var _0x4db78a=_0x2148[_0x1a37e3];return _0x4db78a;};'use strict';var _=require(_0x8214('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8214('0x1'));var moment=require('moment');var BPromise=require(_0x8214('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8214('0x3'));var rimraf=require(_0x8214('0x4'));var config=require('../../config/environment');var attributes=require('./intVtigerConfiguration.attributes');module[_0x8214('0x5')]=function(_0x552a34,_0x1ca276){return _0x552a34[_0x8214('0x6')](_0x8214('0x7'),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 25658d4..fd0570e 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 _0xca63=['client','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x47a254,_0xca2335){var _0x4c4f1b=function(_0xd79f34){while(--_0xd79f34){_0x47a254['push'](_0x47a254['shift']());}};_0x4c4f1b(++_0xca2335);}(_0xca63,0x16d));var _0x3ca6=function(_0x47a4e4,_0x5d6925){_0x47a4e4=_0x47a4e4-0x0;var _0x3a561c=_0xca63[_0x47a4e4];return _0x3a561c;};'use strict';var _=require(_0x3ca6('0x0'));var util=require(_0x3ca6('0x1'));var moment=require('moment');var BPromise=require(_0x3ca6('0x2'));var rs=require(_0x3ca6('0x3'));var fs=require('fs');var Redis=require(_0x3ca6('0x4'));var db=require(_0x3ca6('0x5'))['db'];var utils=require(_0x3ca6('0x6'));var logger=require(_0x3ca6('0x7'))(_0x3ca6('0x8'));var config=require('../../config/environment');var jayson=require(_0x3ca6('0x9'));var client=jayson[_0x3ca6('0xa')][_0x3ca6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2c9351,_0x3ad13b,_0x4b9508){return new BPromise(function(_0x286a38,_0x49d699){return client[_0x3ca6('0xc')](_0x2c9351,_0x4b9508)[_0x3ca6('0xd')](function(_0x445c11){logger[_0x3ca6('0xe')](_0x3ca6('0xf'),_0x3ad13b,_0x3ca6('0x10'));logger[_0x3ca6('0x11')](_0x3ca6('0x12'),_0x3ad13b,_0x3ca6('0x10'),JSON[_0x3ca6('0x13')](_0x445c11));if(_0x445c11['error']){if(_0x445c11[_0x3ca6('0x14')][_0x3ca6('0x15')]===0x1f4){logger[_0x3ca6('0x14')](_0x3ca6('0xf'),_0x3ad13b,_0x445c11[_0x3ca6('0x14')]['message']);return _0x49d699(_0x445c11[_0x3ca6('0x14')][_0x3ca6('0x16')]);}logger[_0x3ca6('0x14')](_0x3ca6('0xf'),_0x3ad13b,_0x445c11[_0x3ca6('0x14')][_0x3ca6('0x16')]);return _0x286a38(_0x445c11['error'][_0x3ca6('0x16')]);}else{logger['info'](_0x3ca6('0xf'),_0x3ad13b,'request\x20sent');_0x286a38(_0x445c11[_0x3ca6('0x17')]['message']);}})[_0x3ca6('0x18')](function(_0x490c4d){logger[_0x3ca6('0x14')](_0x3ca6('0xf'),_0x3ad13b,_0x490c4d);_0x49d699(_0x490c4d);});});} \ No newline at end of file +var _0x2c55=['VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3764cd,_0x30bcbb){var _0x68527e=function(_0x51385d){while(--_0x51385d){_0x3764cd['push'](_0x3764cd['shift']());}};_0x68527e(++_0x30bcbb);}(_0x2c55,0x117));var _0x52c5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2c55[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x52c5('0x0'));var util=require(_0x52c5('0x1'));var moment=require(_0x52c5('0x2'));var BPromise=require('bluebird');var rs=require(_0x52c5('0x3'));var fs=require('fs');var Redis=require(_0x52c5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x52c5('0x5'));var logger=require(_0x52c5('0x6'))(_0x52c5('0x7'));var config=require('../../config/environment');var jayson=require(_0x52c5('0x8'));var client=jayson[_0x52c5('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3cb81a,_0x1433c7,_0x597429){return new BPromise(function(_0x5c99a4,_0xebd535){return client['request'](_0x3cb81a,_0x597429)[_0x52c5('0xa')](function(_0x210ea2){logger[_0x52c5('0xb')](_0x52c5('0xc'),_0x1433c7,_0x52c5('0xd'));logger[_0x52c5('0xe')](_0x52c5('0xf'),_0x1433c7,_0x52c5('0xd'),JSON[_0x52c5('0x10')](_0x210ea2));if(_0x210ea2[_0x52c5('0x11')]){if(_0x210ea2['error']['code']===0x1f4){logger[_0x52c5('0x11')](_0x52c5('0xc'),_0x1433c7,_0x210ea2[_0x52c5('0x11')][_0x52c5('0x12')]);return _0xebd535(_0x210ea2[_0x52c5('0x11')]['message']);}logger[_0x52c5('0x11')](_0x52c5('0xc'),_0x1433c7,_0x210ea2['error'][_0x52c5('0x12')]);return _0x5c99a4(_0x210ea2['error'][_0x52c5('0x12')]);}else{logger[_0x52c5('0xb')](_0x52c5('0xc'),_0x1433c7,_0x52c5('0xd'));_0x5c99a4(_0x210ea2[_0x52c5('0x13')][_0x52c5('0x12')]);}})[_0x52c5('0x14')](function(_0x4f3c0f){logger['error'](_0x52c5('0xc'),_0x1433c7,_0x4f3c0f);_0xebd535(_0x4f3c0f);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index f9089a8..a0698ca 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 _0x7fcd=['util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerField.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer'];(function(_0x3edaa7,_0x366c56){var _0x123cdb=function(_0xc7d3b4){while(--_0xc7d3b4){_0x3edaa7['push'](_0x3edaa7['shift']());}};_0x123cdb(++_0x366c56);}(_0x7fcd,0xaa));var _0xd7fc=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x7fcd[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0xd7fc('0x0'));var util=require(_0xd7fc('0x1'));var path=require(_0xd7fc('0x2'));var timeout=require('connect-timeout');var express=require(_0xd7fc('0x3'));var router=express['Router']();var fs_extra=require(_0xd7fc('0x4'));var auth=require(_0xd7fc('0x5'));var interaction=require(_0xd7fc('0x6'));var config=require('../../config/environment');var controller=require(_0xd7fc('0x7'));router[_0xd7fc('0x8')]('/',auth[_0xd7fc('0x9')](),controller['index']);router[_0xd7fc('0x8')](_0xd7fc('0xa'),auth[_0xd7fc('0x9')](),controller[_0xd7fc('0xb')]);router[_0xd7fc('0xc')]('/',auth[_0xd7fc('0x9')](),controller[_0xd7fc('0xd')]);router[_0xd7fc('0xe')](_0xd7fc('0xa'),auth['isAuthenticated'](),controller[_0xd7fc('0xf')]);router[_0xd7fc('0x10')](_0xd7fc('0xa'),auth[_0xd7fc('0x9')](),controller[_0xd7fc('0x11')]);module[_0xd7fc('0x12')]=router; \ No newline at end of file +var _0x5a85=['update','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x39aedf,_0x2f5df8){var _0x39356c=function(_0x1411c9){while(--_0x1411c9){_0x39aedf['push'](_0x39aedf['shift']());}};_0x39356c(++_0x2f5df8);}(_0x5a85,0x1b2));var _0x55a8=function(_0x2e3052,_0x21dc27){_0x2e3052=_0x2e3052-0x0;var _0x526d2b=_0x5a85[_0x2e3052];return _0x526d2b;};'use strict';var multer=require(_0x55a8('0x0'));var util=require(_0x55a8('0x1'));var path=require(_0x55a8('0x2'));var timeout=require(_0x55a8('0x3'));var express=require(_0x55a8('0x4'));var router=express['Router']();var fs_extra=require(_0x55a8('0x5'));var auth=require(_0x55a8('0x6'));var interaction=require(_0x55a8('0x7'));var config=require(_0x55a8('0x8'));var controller=require(_0x55a8('0x9'));router[_0x55a8('0xa')]('/',auth[_0x55a8('0xb')](),controller[_0x55a8('0xc')]);router[_0x55a8('0xa')](_0x55a8('0xd'),auth[_0x55a8('0xb')](),controller[_0x55a8('0xe')]);router[_0x55a8('0xf')]('/',auth[_0x55a8('0xb')](),controller['create']);router['put'](_0x55a8('0xd'),auth[_0x55a8('0xb')](),controller[_0x55a8('0x10')]);router['delete'](_0x55a8('0xd'),auth[_0x55a8('0xb')](),controller['destroy']);module[_0x55a8('0x11')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 2229b13..de98043 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 _0xd322=['ENUM','string','variable','picklist','STRING','customVariable'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd322,0xa2));var _0x2d32=function(_0x3fe7e5,_0x60fe0){_0x3fe7e5=_0x3fe7e5-0x0;var _0x3e34a6=_0xd322[_0x3fe7e5];return _0x3e34a6;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x2d32('0x0')](_0x2d32('0x1'),_0x2d32('0x2'),'customVariable','keyValue',_0x2d32('0x3')),'defaultValue':_0x2d32('0x1')},'content':{'type':Sequelize[_0x2d32('0x4')]},'key':{'type':Sequelize[_0x2d32('0x4')]},'keyType':{'type':Sequelize[_0x2d32('0x0')](_0x2d32('0x1'),_0x2d32('0x2'),_0x2d32('0x5'))},'keyContent':{'type':Sequelize[_0x2d32('0x4')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x2d32('0x4')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2d32('0x4')]}}; \ No newline at end of file +var _0x8f11=['customVariable','keyValue','STRING','ENUM','BOOLEAN','sequelize','exports','string','variable'];(function(_0x57f7ea,_0x54da6b){var _0x54a7e4=function(_0x2c9d4f){while(--_0x2c9d4f){_0x57f7ea['push'](_0x57f7ea['shift']());}};_0x54a7e4(++_0x54da6b);}(_0x8f11,0x7a));var _0x18f1=function(_0x148e5a,_0x186643){_0x148e5a=_0x148e5a-0x0;var _0x26d68e=_0x8f11[_0x148e5a];return _0x26d68e;};'use strict';var Sequelize=require(_0x18f1('0x0'));module[_0x18f1('0x1')]={'type':{'type':Sequelize['ENUM'](_0x18f1('0x2'),_0x18f1('0x3'),_0x18f1('0x4'),_0x18f1('0x5'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x18f1('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x18f1('0x7')]('string',_0x18f1('0x3'),_0x18f1('0x4'))},'keyContent':{'type':Sequelize[_0x18f1('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x18f1('0x6')]},'customField':{'type':Sequelize[_0x18f1('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x18f1('0x6')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 1997e85..cae45c1 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 _0xb2ec=['lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','VtigerField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','find','catch','create','body','params','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x2a0cbf,_0x36ce74){var _0x1b694b=function(_0x58df6f){while(--_0x58df6f){_0x2a0cbf['push'](_0x2a0cbf['shift']());}};_0x1b694b(++_0x36ce74);}(_0xb2ec,0x16d));var _0xcb2e=function(_0x1d64bf,_0x280c40){_0x1d64bf=_0x1d64bf-0x0;var _0x4f4c04=_0xb2ec[_0x1d64bf];return _0x4f4c04;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xcb2e('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xcb2e('0x1'));var BPromise=require(_0xcb2e('0x2'));var Mustache=require(_0xcb2e('0x3'));var util=require(_0xcb2e('0x4'));var path=require(_0xcb2e('0x5'));var sox=require(_0xcb2e('0x6'));var csv=require(_0xcb2e('0x7'));var ejs=require(_0xcb2e('0x8'));var fs=require('fs');var fs_extra=require(_0xcb2e('0x9'));var _=require(_0xcb2e('0xa'));var squel=require('squel');var crypto=require(_0xcb2e('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xcb2e('0xc'));var toCsv=require(_0xcb2e('0x7'));var querystring=require(_0xcb2e('0xd'));var Papa=require(_0xcb2e('0xe'));var Redis=require(_0xcb2e('0xf'));var authService=require(_0xcb2e('0x10'));var qs=require(_0xcb2e('0x11'));var as=require(_0xcb2e('0x12'));var hardwareService=require(_0xcb2e('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xcb2e('0x14'));var config=require(_0xcb2e('0x15'));var licenseUtil=require(_0xcb2e('0x16'));var db=require(_0xcb2e('0x17'))['db'];function respondWithStatusCode(_0x19c20d,_0x443e1e){_0x443e1e=_0x443e1e||0xcc;return function(_0x8cba44){if(_0x8cba44){return _0x19c20d[_0xcb2e('0x18')](_0x443e1e);}return _0x19c20d[_0xcb2e('0x19')](_0x443e1e)[_0xcb2e('0x1a')]();};}function respondWithResult(_0x5b8555,_0xf8bc76){_0xf8bc76=_0xf8bc76||0xc8;return function(_0x1a14a2){if(_0x1a14a2){return _0x5b8555[_0xcb2e('0x19')](_0xf8bc76)[_0xcb2e('0x1b')](_0x1a14a2);}};}function respondWithFilteredResult(_0x25870e,_0x5d834d){return function(_0x312340){if(_0x312340){var _0x3f592a=typeof _0x5d834d[_0xcb2e('0x1c')]===_0xcb2e('0x1d')&&typeof _0x5d834d['limit']===_0xcb2e('0x1d');var _0x243f4a=_0x312340[_0xcb2e('0x1e')];var _0x1254f8=_0x3f592a?0x0:_0x5d834d['offset'];var _0x3a2150=_0x3f592a?_0x312340[_0xcb2e('0x1e')]:_0x5d834d[_0xcb2e('0x1c')]+_0x5d834d['limit'];var _0x1ccf46;if(_0x3a2150>=_0x243f4a){_0x3a2150=_0x243f4a;_0x1ccf46=0xc8;}else{_0x1ccf46=0xce;}_0x25870e['status'](_0x1ccf46);return _0x25870e[_0xcb2e('0x1f')](_0xcb2e('0x20'),_0x1254f8+'-'+_0x3a2150+'/'+_0x243f4a)[_0xcb2e('0x1b')](_0x312340);}return null;};}function patchUpdates(_0x1c1aab){return function(_0x30b485){try{jsonpatch[_0xcb2e('0x21')](_0x30b485,_0x1c1aab,!![]);}catch(_0xb53a05){return BPromise[_0xcb2e('0x22')](_0xb53a05);}return _0x30b485[_0xcb2e('0x23')]();};}function saveUpdates(_0x386b37,_0x29574d){return function(_0x355a49){if(_0x355a49){return _0x355a49[_0xcb2e('0x24')](_0x386b37)[_0xcb2e('0x25')](function(_0x400855){return _0x400855;});}return null;};}function removeEntity(_0x199e09,_0x5bab62){return function(_0x8fd414){if(_0x8fd414){return _0x8fd414[_0xcb2e('0x26')]()[_0xcb2e('0x25')](function(){_0x199e09[_0xcb2e('0x19')](0xcc)[_0xcb2e('0x1a')]();});}};}function handleEntityNotFound(_0x59df8d,_0x5810bd){return function(_0x27ca7a){if(!_0x27ca7a){_0x59df8d['sendStatus'](0x194);}return _0x27ca7a;};}function handleError(_0x3829a9,_0x30dd7c){_0x30dd7c=_0x30dd7c||0x1f4;return function(_0x37ee71){logger['error'](_0x37ee71[_0xcb2e('0x27')]);if(_0x37ee71['name']){delete _0x37ee71[_0xcb2e('0x28')];}_0x3829a9['status'](_0x30dd7c)['send'](_0x37ee71);};}exports[_0xcb2e('0x29')]=function(_0x11003e,_0x4a703a){var _0x5e6ec1={},_0x5c5776={},_0x52f991={'count':0x0,'rows':[]};var _0x5b7aa3=_[_0xcb2e('0x2a')](db[_0xcb2e('0x2b')][_0xcb2e('0x2c')],function(_0x326c80){return{'name':_0x326c80[_0xcb2e('0x2d')],'type':_0x326c80[_0xcb2e('0x2e')][_0xcb2e('0x2f')]};});_0x5c5776[_0xcb2e('0x30')]=_['map'](_0x5b7aa3,'name');_0x5c5776[_0xcb2e('0x31')]=_[_0xcb2e('0x32')](_0x11003e[_0xcb2e('0x31')]);_0x5c5776[_0xcb2e('0x33')]=_[_0xcb2e('0x34')](_0x5c5776['model'],_0x5c5776[_0xcb2e('0x31')]);_0x5e6ec1[_0xcb2e('0x35')]=_['intersection'](_0x5c5776['model'],qs[_0xcb2e('0x36')](_0x11003e[_0xcb2e('0x31')][_0xcb2e('0x36')]));_0x5e6ec1[_0xcb2e('0x35')]=_0x5e6ec1[_0xcb2e('0x35')][_0xcb2e('0x37')]?_0x5e6ec1[_0xcb2e('0x35')]:_0x5c5776[_0xcb2e('0x30')];if(!_0x11003e[_0xcb2e('0x31')]['hasOwnProperty'](_0xcb2e('0x38'))){_0x5e6ec1['limit']=qs[_0xcb2e('0x39')](_0x11003e[_0xcb2e('0x31')]['limit']);_0x5e6ec1['offset']=qs[_0xcb2e('0x1c')](_0x11003e['query'][_0xcb2e('0x1c')]);}_0x5e6ec1['order']=qs[_0xcb2e('0x3a')](_0x11003e['query']['sort']);_0x5e6ec1[_0xcb2e('0x3b')]=qs[_0xcb2e('0x33')](_[_0xcb2e('0x3c')](_0x11003e['query'],_0x5c5776[_0xcb2e('0x33')]),_0x5b7aa3);if(_0x11003e['query'][_0xcb2e('0x3d')]){_0x5e6ec1[_0xcb2e('0x3b')]=_['merge'](_0x5e6ec1[_0xcb2e('0x3b')],{'$or':_[_0xcb2e('0x2a')](_0x5b7aa3,function(_0x401bd3){if(_0x401bd3[_0xcb2e('0x2e')]!==_0xcb2e('0x3e')){var _0x3ca042={};_0x3ca042[_0x401bd3['name']]={'$like':'%'+_0x11003e[_0xcb2e('0x31')][_0xcb2e('0x3d')]+'%'};return _0x3ca042;}})});}_0x5e6ec1=_[_0xcb2e('0x3f')]({},_0x5e6ec1,_0x11003e[_0xcb2e('0x40')]);var _0x26eda0={'where':_0x5e6ec1[_0xcb2e('0x3b')]};return db[_0xcb2e('0x2b')][_0xcb2e('0x1e')](_0x26eda0)[_0xcb2e('0x25')](function(_0x46d6e7){_0x52f991[_0xcb2e('0x1e')]=_0x46d6e7;if(_0x11003e[_0xcb2e('0x31')][_0xcb2e('0x41')]){_0x5e6ec1[_0xcb2e('0x42')]=[{'all':!![]}];}return db['VtigerField'][_0xcb2e('0x43')](_0x5e6ec1);})[_0xcb2e('0x25')](function(_0x266d68){_0x52f991[_0xcb2e('0x44')]=_0x266d68;return _0x52f991;})[_0xcb2e('0x25')](respondWithFilteredResult(_0x4a703a,_0x5e6ec1))['catch'](handleError(_0x4a703a,null));};exports[_0xcb2e('0x45')]=function(_0x4e0f11,_0x31c1ad){var _0x44459b={'raw':!![],'where':{'id':_0x4e0f11['params']['id']}},_0x23ba0e={};_0x23ba0e[_0xcb2e('0x30')]=_['keys'](db[_0xcb2e('0x2b')][_0xcb2e('0x2c')]);_0x23ba0e[_0xcb2e('0x31')]=_[_0xcb2e('0x32')](_0x4e0f11[_0xcb2e('0x31')]);_0x23ba0e['filters']=_[_0xcb2e('0x34')](_0x23ba0e[_0xcb2e('0x30')],_0x23ba0e[_0xcb2e('0x31')]);_0x44459b[_0xcb2e('0x35')]=_[_0xcb2e('0x34')](_0x23ba0e[_0xcb2e('0x30')],qs['fields'](_0x4e0f11[_0xcb2e('0x31')][_0xcb2e('0x36')]));_0x44459b[_0xcb2e('0x35')]=_0x44459b[_0xcb2e('0x35')][_0xcb2e('0x37')]?_0x44459b[_0xcb2e('0x35')]:_0x23ba0e[_0xcb2e('0x30')];if(_0x4e0f11['query'][_0xcb2e('0x41')]){_0x44459b[_0xcb2e('0x42')]=[{'all':!![]}];}_0x44459b=_[_0xcb2e('0x3f')]({},_0x44459b,_0x4e0f11[_0xcb2e('0x40')]);return db[_0xcb2e('0x2b')][_0xcb2e('0x46')](_0x44459b)[_0xcb2e('0x25')](handleEntityNotFound(_0x31c1ad,null))[_0xcb2e('0x25')](respondWithResult(_0x31c1ad,null))[_0xcb2e('0x47')](handleError(_0x31c1ad,null));};exports[_0xcb2e('0x48')]=function(_0xe2bbbd,_0x3b3d64){return db[_0xcb2e('0x2b')][_0xcb2e('0x48')](_0xe2bbbd[_0xcb2e('0x49')],{})['then'](respondWithResult(_0x3b3d64,0xc9))[_0xcb2e('0x47')](handleError(_0x3b3d64,null));};exports['update']=function(_0x84238c,_0xe541f1){if(_0x84238c[_0xcb2e('0x49')]['id']){delete _0x84238c['body']['id'];}return db[_0xcb2e('0x2b')][_0xcb2e('0x46')]({'where':{'id':_0x84238c[_0xcb2e('0x4a')]['id']}})[_0xcb2e('0x25')](handleEntityNotFound(_0xe541f1,null))['then'](saveUpdates(_0x84238c[_0xcb2e('0x49')],null))['then'](respondWithResult(_0xe541f1,null))['catch'](handleError(_0xe541f1,null));};exports[_0xcb2e('0x26')]=function(_0xf39e5a,_0x21adbb){return db['VtigerField'][_0xcb2e('0x46')]({'where':{'id':_0xf39e5a[_0xcb2e('0x4a')]['id']}})[_0xcb2e('0x25')](handleEntityNotFound(_0x21adbb,null))[_0xcb2e('0x25')](removeEntity(_0x21adbb,null))['catch'](handleError(_0x21adbb,null));}; \ No newline at end of file +var _0xf7d0=['ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','count','limit','set','Content-Range','apply','reject','update','destroy','then','error','name','send','map','VtigerField','rawAttributes','type','key','query','keys','filters','model','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','intersection','find','create','body','params','rimraf','request-promise','moment','bluebird','path'];(function(_0x150b46,_0x1b10fe){var _0x3e2aba=function(_0x4cd4fa){while(--_0x4cd4fa){_0x150b46['push'](_0x150b46['shift']());}};_0x3e2aba(++_0x1b10fe);}(_0xf7d0,0xff));var _0x0f7d=function(_0x36ed3c,_0x44a00a){_0x36ed3c=_0x36ed3c-0x0;var _0x52a2e0=_0xf7d0[_0x36ed3c];return _0x52a2e0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0f7d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0f7d('0x1'));var moment=require(_0x0f7d('0x2'));var BPromise=require(_0x0f7d('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x0f7d('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0f7d('0x5'));var fs=require('fs');var fs_extra=require(_0x0f7d('0x6'));var _=require('lodash');var squel=require(_0x0f7d('0x7'));var crypto=require(_0x0f7d('0x8'));var jsforce=require(_0x0f7d('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x0f7d('0xa'));var querystring=require(_0x0f7d('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0f7d('0xc'));var as=require(_0x0f7d('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0f7d('0xe'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0f7d('0xf'));var db=require(_0x0f7d('0x10'))['db'];function respondWithStatusCode(_0x8c6ed4,_0x23f99b){_0x23f99b=_0x23f99b||0xcc;return function(_0x5dc75d){if(_0x5dc75d){return _0x8c6ed4[_0x0f7d('0x11')](_0x23f99b);}return _0x8c6ed4[_0x0f7d('0x12')](_0x23f99b)[_0x0f7d('0x13')]();};}function respondWithResult(_0x5e4f2e,_0x117239){_0x117239=_0x117239||0xc8;return function(_0x240625){if(_0x240625){return _0x5e4f2e[_0x0f7d('0x12')](_0x117239)[_0x0f7d('0x14')](_0x240625);}};}function respondWithFilteredResult(_0x1d9b83,_0x2e2416){return function(_0xd33ddd){if(_0xd33ddd){var _0x45340c=typeof _0x2e2416[_0x0f7d('0x15')]==='undefined'&&typeof _0x2e2416['limit']==='undefined';var _0x261aa8=_0xd33ddd[_0x0f7d('0x16')];var _0x5c22d5=_0x45340c?0x0:_0x2e2416[_0x0f7d('0x15')];var _0x32170e=_0x45340c?_0xd33ddd[_0x0f7d('0x16')]:_0x2e2416[_0x0f7d('0x15')]+_0x2e2416[_0x0f7d('0x17')];var _0x1d3bc6;if(_0x32170e>=_0x261aa8){_0x32170e=_0x261aa8;_0x1d3bc6=0xc8;}else{_0x1d3bc6=0xce;}_0x1d9b83[_0x0f7d('0x12')](_0x1d3bc6);return _0x1d9b83[_0x0f7d('0x18')](_0x0f7d('0x19'),_0x5c22d5+'-'+_0x32170e+'/'+_0x261aa8)[_0x0f7d('0x14')](_0xd33ddd);}return null;};}function patchUpdates(_0x229d8d){return function(_0x4c712){try{jsonpatch[_0x0f7d('0x1a')](_0x4c712,_0x229d8d,!![]);}catch(_0x4936e1){return BPromise[_0x0f7d('0x1b')](_0x4936e1);}return _0x4c712['save']();};}function saveUpdates(_0x3cc9ca,_0x336082){return function(_0x4ca169){if(_0x4ca169){return _0x4ca169[_0x0f7d('0x1c')](_0x3cc9ca)['then'](function(_0x4f1bfa){return _0x4f1bfa;});}return null;};}function removeEntity(_0x2445a6,_0x489ca1){return function(_0x5b836e){if(_0x5b836e){return _0x5b836e[_0x0f7d('0x1d')]()[_0x0f7d('0x1e')](function(){_0x2445a6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5544ce,_0x18a60a){return function(_0x21c75f){if(!_0x21c75f){_0x5544ce[_0x0f7d('0x11')](0x194);}return _0x21c75f;};}function handleError(_0x17dbdf,_0x574789){_0x574789=_0x574789||0x1f4;return function(_0x20c022){logger[_0x0f7d('0x1f')](_0x20c022['stack']);if(_0x20c022[_0x0f7d('0x20')]){delete _0x20c022['name'];}_0x17dbdf[_0x0f7d('0x12')](_0x574789)[_0x0f7d('0x21')](_0x20c022);};}exports['index']=function(_0x26086c,_0x1c0c61){var _0xae03d3={},_0x2d2a88={},_0x277bb4={'count':0x0,'rows':[]};var _0x218da8=_[_0x0f7d('0x22')](db[_0x0f7d('0x23')][_0x0f7d('0x24')],function(_0x576cf6){return{'name':_0x576cf6['fieldName'],'type':_0x576cf6[_0x0f7d('0x25')][_0x0f7d('0x26')]};});_0x2d2a88['model']=_[_0x0f7d('0x22')](_0x218da8,_0x0f7d('0x20'));_0x2d2a88[_0x0f7d('0x27')]=_[_0x0f7d('0x28')](_0x26086c[_0x0f7d('0x27')]);_0x2d2a88[_0x0f7d('0x29')]=_['intersection'](_0x2d2a88[_0x0f7d('0x2a')],_0x2d2a88[_0x0f7d('0x27')]);_0xae03d3[_0x0f7d('0x2b')]=_['intersection'](_0x2d2a88[_0x0f7d('0x2a')],qs[_0x0f7d('0x2c')](_0x26086c[_0x0f7d('0x27')][_0x0f7d('0x2c')]));_0xae03d3['attributes']=_0xae03d3[_0x0f7d('0x2b')][_0x0f7d('0x2d')]?_0xae03d3[_0x0f7d('0x2b')]:_0x2d2a88[_0x0f7d('0x2a')];if(!_0x26086c[_0x0f7d('0x27')][_0x0f7d('0x2e')]('nolimit')){_0xae03d3[_0x0f7d('0x17')]=qs[_0x0f7d('0x17')](_0x26086c[_0x0f7d('0x27')][_0x0f7d('0x17')]);_0xae03d3[_0x0f7d('0x15')]=qs[_0x0f7d('0x15')](_0x26086c[_0x0f7d('0x27')]['offset']);}_0xae03d3['order']=qs[_0x0f7d('0x2f')](_0x26086c[_0x0f7d('0x27')][_0x0f7d('0x2f')]);_0xae03d3[_0x0f7d('0x30')]=qs[_0x0f7d('0x29')](_[_0x0f7d('0x31')](_0x26086c['query'],_0x2d2a88[_0x0f7d('0x29')]),_0x218da8);if(_0x26086c[_0x0f7d('0x27')]['filter']){_0xae03d3[_0x0f7d('0x30')]=_[_0x0f7d('0x32')](_0xae03d3[_0x0f7d('0x30')],{'$or':_[_0x0f7d('0x22')](_0x218da8,function(_0x8de251){if(_0x8de251[_0x0f7d('0x25')]!==_0x0f7d('0x33')){var _0x35f9b5={};_0x35f9b5[_0x8de251['name']]={'$like':'%'+_0x26086c[_0x0f7d('0x27')][_0x0f7d('0x34')]+'%'};return _0x35f9b5;}})});}_0xae03d3=_[_0x0f7d('0x32')]({},_0xae03d3,_0x26086c[_0x0f7d('0x35')]);var _0x4cce9a={'where':_0xae03d3[_0x0f7d('0x30')]};return db[_0x0f7d('0x23')]['count'](_0x4cce9a)[_0x0f7d('0x1e')](function(_0x2e5a27){_0x277bb4[_0x0f7d('0x16')]=_0x2e5a27;if(_0x26086c[_0x0f7d('0x27')][_0x0f7d('0x36')]){_0xae03d3[_0x0f7d('0x37')]=[{'all':!![]}];}return db[_0x0f7d('0x23')][_0x0f7d('0x38')](_0xae03d3);})[_0x0f7d('0x1e')](function(_0x2a62ec){_0x277bb4[_0x0f7d('0x39')]=_0x2a62ec;return _0x277bb4;})[_0x0f7d('0x1e')](respondWithFilteredResult(_0x1c0c61,_0xae03d3))[_0x0f7d('0x3a')](handleError(_0x1c0c61,null));};exports[_0x0f7d('0x3b')]=function(_0x2a7405,_0x42692a){var _0x4f56fa={'raw':!![],'where':{'id':_0x2a7405['params']['id']}},_0x4bf3a1={};_0x4bf3a1[_0x0f7d('0x2a')]=_[_0x0f7d('0x28')](db[_0x0f7d('0x23')][_0x0f7d('0x24')]);_0x4bf3a1['query']=_['keys'](_0x2a7405[_0x0f7d('0x27')]);_0x4bf3a1[_0x0f7d('0x29')]=_[_0x0f7d('0x3c')](_0x4bf3a1[_0x0f7d('0x2a')],_0x4bf3a1[_0x0f7d('0x27')]);_0x4f56fa[_0x0f7d('0x2b')]=_['intersection'](_0x4bf3a1[_0x0f7d('0x2a')],qs[_0x0f7d('0x2c')](_0x2a7405[_0x0f7d('0x27')][_0x0f7d('0x2c')]));_0x4f56fa['attributes']=_0x4f56fa[_0x0f7d('0x2b')][_0x0f7d('0x2d')]?_0x4f56fa[_0x0f7d('0x2b')]:_0x4bf3a1[_0x0f7d('0x2a')];if(_0x2a7405[_0x0f7d('0x27')]['includeAll']){_0x4f56fa[_0x0f7d('0x37')]=[{'all':!![]}];}_0x4f56fa=_['merge']({},_0x4f56fa,_0x2a7405[_0x0f7d('0x35')]);return db[_0x0f7d('0x23')][_0x0f7d('0x3d')](_0x4f56fa)[_0x0f7d('0x1e')](handleEntityNotFound(_0x42692a,null))['then'](respondWithResult(_0x42692a,null))['catch'](handleError(_0x42692a,null));};exports[_0x0f7d('0x3e')]=function(_0x594759,_0x34da53){return db[_0x0f7d('0x23')][_0x0f7d('0x3e')](_0x594759[_0x0f7d('0x3f')],{})[_0x0f7d('0x1e')](respondWithResult(_0x34da53,0xc9))['catch'](handleError(_0x34da53,null));};exports[_0x0f7d('0x1c')]=function(_0xce770a,_0x22fd9b){if(_0xce770a[_0x0f7d('0x3f')]['id']){delete _0xce770a[_0x0f7d('0x3f')]['id'];}return db['VtigerField'][_0x0f7d('0x3d')]({'where':{'id':_0xce770a[_0x0f7d('0x40')]['id']}})[_0x0f7d('0x1e')](handleEntityNotFound(_0x22fd9b,null))[_0x0f7d('0x1e')](saveUpdates(_0xce770a['body'],null))['then'](respondWithResult(_0x22fd9b,null))[_0x0f7d('0x3a')](handleError(_0x22fd9b,null));};exports['destroy']=function(_0x1188a0,_0x33015f){return db[_0x0f7d('0x23')][_0x0f7d('0x3d')]({'where':{'id':_0x1188a0['params']['id']}})[_0x0f7d('0x1e')](handleEntityNotFound(_0x33015f,null))['then'](removeEntity(_0x33015f,null))['catch'](handleError(_0x33015f,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 8872a8c..8180f08 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 _0x5a7e=['../../config/logger','api','moment','bluebird','request-promise','path','./intVtigerField.attributes','exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','lodash','util'];(function(_0x47e035,_0x352672){var _0x197946=function(_0x7e267e){while(--_0x7e267e){_0x47e035['push'](_0x47e035['shift']());}};_0x197946(++_0x352672);}(_0x5a7e,0x11b));var _0xe5a7=function(_0x1756c5,_0x52cd2a){_0x1756c5=_0x1756c5-0x0;var _0xa896f8=_0x5a7e[_0x1756c5];return _0xa896f8;};'use strict';var _=require(_0xe5a7('0x0'));var util=require(_0xe5a7('0x1'));var logger=require(_0xe5a7('0x2'))(_0xe5a7('0x3'));var moment=require(_0xe5a7('0x4'));var BPromise=require(_0xe5a7('0x5'));var rp=require(_0xe5a7('0x6'));var fs=require('fs');var path=require(_0xe5a7('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe5a7('0x8'));module[_0xe5a7('0x9')]=function(_0x1c82a3,_0x1723aa){return _0x1c82a3[_0xe5a7('0xa')](_0xe5a7('0xb'),attributes,{'tableName':_0xe5a7('0xc'),'paranoid':![],'indexes':[{'name':_0xe5a7('0xd'),'fields':[_0xe5a7('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf815=['request-promise','rimraf','../../config/environment','define','VtigerField','int_vtiger_fields','vtiger_unique_index','FieldId','lodash','../../config/logger','api','moment','bluebird'];(function(_0x5275b8,_0x51e5dd){var _0x568a9b=function(_0x583a71){while(--_0x583a71){_0x5275b8['push'](_0x5275b8['shift']());}};_0x568a9b(++_0x51e5dd);}(_0xf815,0xd8));var _0x5f81=function(_0x5eb009,_0x56d2f4){_0x5eb009=_0x5eb009-0x0;var _0x38b580=_0xf815[_0x5eb009];return _0x38b580;};'use strict';var _=require(_0x5f81('0x0'));var util=require('util');var logger=require(_0x5f81('0x1'))(_0x5f81('0x2'));var moment=require(_0x5f81('0x3'));var BPromise=require(_0x5f81('0x4'));var rp=require(_0x5f81('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5f81('0x6'));var config=require(_0x5f81('0x7'));var attributes=require('./intVtigerField.attributes');module['exports']=function(_0xe93587,_0xb50044){return _0xe93587[_0x5f81('0x8')](_0x5f81('0x9'),attributes,{'tableName':_0x5f81('0xa'),'paranoid':![],'indexes':[{'name':_0x5f81('0xb'),'fields':['idField',_0x5f81('0xc')],'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 59b9563..1f4b094 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 _0xe44e=['randomstring','ioredis','../../mysqldb','rpc','jayson/promise','http','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','lodash','util','moment','bluebird'];(function(_0x2b8577,_0x69da5f){var _0x1aa730=function(_0x1f6198){while(--_0x1f6198){_0x2b8577['push'](_0x2b8577['shift']());}};_0x1aa730(++_0x69da5f);}(_0xe44e,0xba));var _0xee44=function(_0x328693,_0x39513a){_0x328693=_0x328693-0x0;var _0x596e10=_0xe44e[_0x328693];return _0x596e10;};'use strict';var _=require(_0xee44('0x0'));var util=require(_0xee44('0x1'));var moment=require(_0xee44('0x2'));var BPromise=require(_0xee44('0x3'));var rs=require(_0xee44('0x4'));var fs=require('fs');var Redis=require(_0xee44('0x5'));var db=require(_0xee44('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xee44('0x7'));var config=require('../../config/environment');var jayson=require(_0xee44('0x8'));var client=jayson['client'][_0xee44('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x488067,_0x92b0ae,_0x49c88f){return new BPromise(function(_0x63def3,_0x4817d0){return client['request'](_0x488067,_0x49c88f)[_0xee44('0xa')](function(_0x2c22b1){logger[_0xee44('0xb')](_0xee44('0xc'),_0x92b0ae,_0xee44('0xd'));logger[_0xee44('0xe')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x92b0ae,_0xee44('0xd'),JSON[_0xee44('0xf')](_0x2c22b1));if(_0x2c22b1[_0xee44('0x10')]){if(_0x2c22b1[_0xee44('0x10')]['code']===0x1f4){logger[_0xee44('0x10')](_0xee44('0xc'),_0x92b0ae,_0x2c22b1[_0xee44('0x10')][_0xee44('0x11')]);return _0x4817d0(_0x2c22b1['error'][_0xee44('0x11')]);}logger[_0xee44('0x10')](_0xee44('0xc'),_0x92b0ae,_0x2c22b1['error'][_0xee44('0x11')]);return _0x63def3(_0x2c22b1['error'][_0xee44('0x11')]);}else{logger[_0xee44('0xb')](_0xee44('0xc'),_0x92b0ae,_0xee44('0xd'));_0x63def3(_0x2c22b1[_0xee44('0x12')][_0xee44('0x11')]);}})['catch'](function(_0x19df39){logger[_0xee44('0x10')](_0xee44('0xc'),_0x92b0ae,_0x19df39);_0x4817d0(_0x19df39);});});} \ No newline at end of file +var _0xf7fd=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','lodash','util','moment','bluebird'];(function(_0x41c723,_0x53233b){var _0x37963f=function(_0x168475){while(--_0x168475){_0x41c723['push'](_0x41c723['shift']());}};_0x37963f(++_0x53233b);}(_0xf7fd,0x14c));var _0xdf7f=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xf7fd[_0x43d11d];return _0x38cd08;};'use strict';var _=require(_0xdf7f('0x0'));var util=require(_0xdf7f('0x1'));var moment=require(_0xdf7f('0x2'));var BPromise=require(_0xdf7f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdf7f('0x4'));var db=require(_0xdf7f('0x5'))['db'];var utils=require(_0xdf7f('0x6'));var logger=require(_0xdf7f('0x7'))(_0xdf7f('0x8'));var config=require('../../config/environment');var jayson=require(_0xdf7f('0x9'));var client=jayson['client'][_0xdf7f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2db988,_0xaf8337,_0x65508d){return new BPromise(function(_0x1f331f,_0x3af678){return client[_0xdf7f('0xb')](_0x2db988,_0x65508d)[_0xdf7f('0xc')](function(_0x18a13f){logger[_0xdf7f('0xd')](_0xdf7f('0xe'),_0xaf8337,_0xdf7f('0xf'));logger[_0xdf7f('0x10')]('VtigerField,\x20%s,\x20%s,\x20%s',_0xaf8337,_0xdf7f('0xf'),JSON[_0xdf7f('0x11')](_0x18a13f));if(_0x18a13f[_0xdf7f('0x12')]){if(_0x18a13f[_0xdf7f('0x12')]['code']===0x1f4){logger[_0xdf7f('0x12')](_0xdf7f('0xe'),_0xaf8337,_0x18a13f[_0xdf7f('0x12')][_0xdf7f('0x13')]);return _0x3af678(_0x18a13f['error'][_0xdf7f('0x13')]);}logger[_0xdf7f('0x12')](_0xdf7f('0xe'),_0xaf8337,_0x18a13f['error']['message']);return _0x1f331f(_0x18a13f['error'][_0xdf7f('0x13')]);}else{logger[_0xdf7f('0xd')](_0xdf7f('0xe'),_0xaf8337,_0xdf7f('0xf'));_0x1f331f(_0x18a13f['result'][_0xdf7f('0x13')]);}})[_0xdf7f('0x14')](function(_0x16bfc8){logger['error'](_0xdf7f('0xe'),_0xaf8337,_0x16bfc8);_0x3af678(_0x16bfc8);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index e324145..a54de06 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 _0x6db0=['exports','util','path','connect-timeout','express','Router','../../components/auth/service','./intZendeskAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','create','post','addConfiguration','put','update','delete','destroy'];(function(_0x4e0e02,_0x2dd614){var _0x4c32f5=function(_0x215403){while(--_0x215403){_0x4e0e02['push'](_0x4e0e02['shift']());}};_0x4c32f5(++_0x2dd614);}(_0x6db0,0x6a));var _0x06db=function(_0x9798ab,_0x49faaa){_0x9798ab=_0x9798ab-0x0;var _0x1983fd=_0x6db0[_0x9798ab];return _0x1983fd;};'use strict';var multer=require('multer');var util=require(_0x06db('0x0'));var path=require(_0x06db('0x1'));var timeout=require(_0x06db('0x2'));var express=require(_0x06db('0x3'));var router=express[_0x06db('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x06db('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x06db('0x6'));router[_0x06db('0x7')]('/',auth[_0x06db('0x8')](),controller['index']);router[_0x06db('0x7')](_0x06db('0x9'),auth[_0x06db('0x8')](),controller[_0x06db('0xa')]);router[_0x06db('0x7')](_0x06db('0xb'),auth['isAuthenticated'](),controller[_0x06db('0xc')]);router[_0x06db('0x7')]('/:id/fields',auth[_0x06db('0x8')](),controller['getFields']);router['post']('/',auth['isAuthenticated'](),controller[_0x06db('0xd')]);router[_0x06db('0xe')]('/:id/configurations',auth[_0x06db('0x8')](),controller[_0x06db('0xf')]);router[_0x06db('0x10')](_0x06db('0x9'),auth['isAuthenticated'](),controller[_0x06db('0x11')]);router[_0x06db('0x12')](_0x06db('0x9'),auth[_0x06db('0x8')](),controller[_0x06db('0x13')]);module[_0x06db('0x14')]=router; \ No newline at end of file +var _0xd0e8=['create','/:id/configurations','addConfiguration','put','update','destroy','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intZendeskAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','post'];(function(_0x436b79,_0x50463e){var _0x5dc1b6=function(_0x259976){while(--_0x259976){_0x436b79['push'](_0x436b79['shift']());}};_0x5dc1b6(++_0x50463e);}(_0xd0e8,0xf6));var _0x8d0e=function(_0xe96dc4,_0x2241c3){_0xe96dc4=_0xe96dc4-0x0;var _0x3ff118=_0xd0e8[_0xe96dc4];return _0x3ff118;};'use strict';var multer=require(_0x8d0e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x8d0e('0x1'));var express=require(_0x8d0e('0x2'));var router=express[_0x8d0e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x8d0e('0x4'));var interaction=require(_0x8d0e('0x5'));var config=require('../../config/environment');var controller=require(_0x8d0e('0x6'));router[_0x8d0e('0x7')]('/',auth[_0x8d0e('0x8')](),controller[_0x8d0e('0x9')]);router['get'](_0x8d0e('0xa'),auth['isAuthenticated'](),controller[_0x8d0e('0xb')]);router[_0x8d0e('0x7')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x8d0e('0xc')]);router[_0x8d0e('0x7')]('/:id/fields',auth[_0x8d0e('0x8')](),controller['getFields']);router[_0x8d0e('0xd')]('/',auth[_0x8d0e('0x8')](),controller[_0x8d0e('0xe')]);router[_0x8d0e('0xd')](_0x8d0e('0xf'),auth['isAuthenticated'](),controller[_0x8d0e('0x10')]);router[_0x8d0e('0x11')](_0x8d0e('0xa'),auth[_0x8d0e('0x8')](),controller[_0x8d0e('0x12')]);router['delete']('/:id',auth[_0x8d0e('0x8')](),controller[_0x8d0e('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index a8b3cbc..d26a9ca 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 _0x444e=['newTab','sequelize','STRING','remoteUri','ENUM','password','token'];(function(_0x47de9a,_0x40cf23){var _0x4b9d6c=function(_0x507054){while(--_0x507054){_0x47de9a['push'](_0x47de9a['shift']());}};_0x4b9d6c(++_0x40cf23);}(_0x444e,0xe8));var _0xe444=function(_0x3bbabb,_0x5205e2){_0x3bbabb=_0x3bbabb-0x0;var _0x4e04d5=_0x444e[_0x3bbabb];return _0x4e04d5;};'use strict';var Sequelize=require(_0xe444('0x0'));module['exports']={'name':{'type':Sequelize[_0xe444('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xe444('0x1')],'unique':'username'},'password':{'type':Sequelize[_0xe444('0x1')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xe444('0x1')],'unique':_0xe444('0x2')},'authType':{'type':Sequelize[_0xe444('0x3')](_0xe444('0x4'),_0xe444('0x5')),'defaultValue':_0xe444('0x4')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xe444('0x3')]('integrationTab',_0xe444('0x6')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x8710=['ENUM','token','password','integrationTab','newTab','sequelize','exports','STRING','username'];(function(_0x452331,_0xfd39dd){var _0x3767eb=function(_0x143fbc){while(--_0x143fbc){_0x452331['push'](_0x452331['shift']());}};_0x3767eb(++_0xfd39dd);}(_0x8710,0x68));var _0x0871=function(_0x45fa94,_0x1ca258){_0x45fa94=_0x45fa94-0x0;var _0x264730=_0x8710[_0x45fa94];return _0x264730;};'use strict';var Sequelize=require(_0x0871('0x0'));module[_0x0871('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0871('0x2')]},'username':{'type':Sequelize[_0x0871('0x2')],'unique':_0x0871('0x3')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x0871('0x2')]},'remoteUri':{'type':Sequelize[_0x0871('0x2')],'unique':'remoteUri'},'authType':{'type':Sequelize[_0x0871('0x4')]('password',_0x0871('0x5')),'defaultValue':_0x0871('0x6')},'serverUrl':{'type':Sequelize[_0x0871('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x0871('0x4')](_0x0871('0x7'),_0x0871('0x8')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index a00983c..ede2f78 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 _0x4024=['token','authType','remoteUri','substring','lastIndexOf','format','ticket_fields','headers','Basic\x20%s','%s:%s','base64','%s/token:%s','toString','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','includes','position','system_field_options','custom_field_options','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','ejs','fs-extra','lodash','crypto','to-csv','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','stack','name','send','map','ZendeskAccount','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','includeAll','findAll','catch','params','keys','length','include','options','find','create','body','getConfigurations','findOne','ZendeskConfiguration','addConfiguration','Subjects','channel','getDescriptions','ZendeskField','getFields','username','password'];(function(_0x234a07,_0x1e46c9){var _0x51bb62=function(_0x1b93f7){while(--_0x1b93f7){_0x234a07['push'](_0x234a07['shift']());}};_0x51bb62(++_0x1e46c9);}(_0x4024,0x89));var _0x4402=function(_0x3a7e02,_0x3f5085){_0x3a7e02=_0x3a7e02-0x0;var _0x1956fc=_0x4024[_0x3a7e02];return _0x1956fc;};'use strict';var emlformat=require(_0x4402('0x0'));var rimraf=require(_0x4402('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4402('0x2'));var rp=require(_0x4402('0x3'));var moment=require('moment');var BPromise=require(_0x4402('0x4'));var Mustache=require('mustache');var util=require(_0x4402('0x5'));var path=require(_0x4402('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4402('0x7'));var fs=require('fs');var fs_extra=require(_0x4402('0x8'));var _=require(_0x4402('0x9'));var squel=require('squel');var crypto=require(_0x4402('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4402('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4402('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x4402('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4402('0xe'));var logger=require('../../config/logger')(_0x4402('0xf'));var utils=require(_0x4402('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x4402('0x11'));var db=require(_0x4402('0x12'))['db'];var integrations=require(_0x4402('0x13'));function respondWithStatusCode(_0x4c9032,_0x7e4475){_0x7e4475=_0x7e4475||0xcc;return function(_0x34d952){if(_0x34d952){return _0x4c9032[_0x4402('0x14')](_0x7e4475);}return _0x4c9032[_0x4402('0x15')](_0x7e4475)[_0x4402('0x16')]();};}function respondWithResult(_0x31710c,_0x18c7a8){_0x18c7a8=_0x18c7a8||0xc8;return function(_0x3c7dd2){if(_0x3c7dd2){return _0x31710c[_0x4402('0x15')](_0x18c7a8)[_0x4402('0x17')](_0x3c7dd2);}};}function respondWithFilteredResult(_0x375166,_0xc03f65){return function(_0x2a2ce8){if(_0x2a2ce8){var _0x19fe7b=typeof _0xc03f65[_0x4402('0x18')]===_0x4402('0x19')&&typeof _0xc03f65[_0x4402('0x1a')]===_0x4402('0x19');var _0x186c22=_0x2a2ce8[_0x4402('0x1b')];var _0x5b127f=_0x19fe7b?0x0:_0xc03f65['offset'];var _0x663ab7=_0x19fe7b?_0x2a2ce8[_0x4402('0x1b')]:_0xc03f65['offset']+_0xc03f65[_0x4402('0x1a')];var _0x192855;if(_0x663ab7>=_0x186c22){_0x663ab7=_0x186c22;_0x192855=0xc8;}else{_0x192855=0xce;}_0x375166['status'](_0x192855);return _0x375166[_0x4402('0x1c')]('Content-Range',_0x5b127f+'-'+_0x663ab7+'/'+_0x186c22)['json'](_0x2a2ce8);}return null;};}function patchUpdates(_0x1b9599){return function(_0x46a1ad){try{jsonpatch[_0x4402('0x1d')](_0x46a1ad,_0x1b9599,!![]);}catch(_0x49bc21){return BPromise[_0x4402('0x1e')](_0x49bc21);}return _0x46a1ad['save']();};}function saveUpdates(_0x47ab54,_0x6f1f72){return function(_0x275c70){if(_0x275c70){return _0x275c70[_0x4402('0x1f')](_0x47ab54)[_0x4402('0x20')](function(_0x258d10){return _0x258d10;});}return null;};}function removeEntity(_0x2e6fee,_0x289a3e){return function(_0x6b1fc5){if(_0x6b1fc5){return _0x6b1fc5[_0x4402('0x21')]()['then'](function(){_0x2e6fee[_0x4402('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3733cd,_0x5ab28d){return function(_0x29f56b){if(!_0x29f56b){_0x3733cd[_0x4402('0x14')](0x194);}return _0x29f56b;};}function handleError(_0x5a43d0,_0x15c19f){_0x15c19f=_0x15c19f||0x1f4;return function(_0x4e9cb5){logger['error'](_0x4e9cb5[_0x4402('0x22')]);if(_0x4e9cb5[_0x4402('0x23')]){delete _0x4e9cb5[_0x4402('0x23')];}_0x5a43d0[_0x4402('0x15')](_0x15c19f)[_0x4402('0x24')](_0x4e9cb5);};}exports['index']=function(_0x41de44,_0x52e625){var _0x71da2f={},_0x1e2340={},_0x42dd32={'count':0x0,'rows':[]};var _0x48d20d=_[_0x4402('0x25')](db[_0x4402('0x26')][_0x4402('0x27')],function(_0x3f4bcb){return{'name':_0x3f4bcb[_0x4402('0x28')],'type':_0x3f4bcb[_0x4402('0x29')][_0x4402('0x2a')]};});_0x1e2340[_0x4402('0x2b')]=_[_0x4402('0x25')](_0x48d20d,_0x4402('0x23'));_0x1e2340[_0x4402('0x2c')]=_['keys'](_0x41de44[_0x4402('0x2c')]);_0x1e2340['filters']=_[_0x4402('0x2d')](_0x1e2340['model'],_0x1e2340[_0x4402('0x2c')]);_0x71da2f[_0x4402('0x2e')]=_[_0x4402('0x2d')](_0x1e2340[_0x4402('0x2b')],qs[_0x4402('0x2f')](_0x41de44['query'][_0x4402('0x2f')]));_0x71da2f[_0x4402('0x2e')]=_0x71da2f[_0x4402('0x2e')]['length']?_0x71da2f[_0x4402('0x2e')]:_0x1e2340[_0x4402('0x2b')];if(!_0x41de44['query'][_0x4402('0x30')](_0x4402('0x31'))){_0x71da2f[_0x4402('0x1a')]=qs[_0x4402('0x1a')](_0x41de44[_0x4402('0x2c')][_0x4402('0x1a')]);_0x71da2f[_0x4402('0x18')]=qs[_0x4402('0x18')](_0x41de44[_0x4402('0x2c')]['offset']);}_0x71da2f[_0x4402('0x32')]=qs[_0x4402('0x33')](_0x41de44[_0x4402('0x2c')]['sort']);_0x71da2f[_0x4402('0x34')]=qs[_0x4402('0x35')](_['pick'](_0x41de44['query'],_0x1e2340[_0x4402('0x35')]),_0x48d20d);if(_0x41de44[_0x4402('0x2c')][_0x4402('0x36')]){_0x71da2f[_0x4402('0x34')]=_['merge'](_0x71da2f['where'],{'$or':_['map'](_0x48d20d,function(_0x3a5e62){if(_0x3a5e62[_0x4402('0x29')]!==_0x4402('0x37')){var _0x3fd8ce={};_0x3fd8ce[_0x3a5e62['name']]={'$like':'%'+_0x41de44[_0x4402('0x2c')][_0x4402('0x36')]+'%'};return _0x3fd8ce;}})});}_0x71da2f=_[_0x4402('0x38')]({},_0x71da2f,_0x41de44['options']);var _0x2b92b7={'where':_0x71da2f['where']};return db[_0x4402('0x26')][_0x4402('0x1b')](_0x2b92b7)['then'](function(_0x16ef2e){_0x42dd32['count']=_0x16ef2e;if(_0x41de44[_0x4402('0x2c')][_0x4402('0x39')]){_0x71da2f['include']=[{'all':!![]}];}return db[_0x4402('0x26')][_0x4402('0x3a')](_0x71da2f);})[_0x4402('0x20')](function(_0x23c43a){_0x42dd32['rows']=_0x23c43a;return _0x42dd32;})['then'](respondWithFilteredResult(_0x52e625,_0x71da2f))[_0x4402('0x3b')](handleError(_0x52e625,null));};exports['show']=function(_0x3a589b,_0x2a6d78){var _0xb9cf85={'raw':![],'where':{'id':_0x3a589b[_0x4402('0x3c')]['id']}},_0x2e2391={};_0x2e2391[_0x4402('0x2b')]=_[_0x4402('0x3d')](db[_0x4402('0x26')][_0x4402('0x27')]);_0x2e2391[_0x4402('0x2c')]=_['keys'](_0x3a589b[_0x4402('0x2c')]);_0x2e2391[_0x4402('0x35')]=_['intersection'](_0x2e2391[_0x4402('0x2b')],_0x2e2391[_0x4402('0x2c')]);_0xb9cf85['attributes']=_[_0x4402('0x2d')](_0x2e2391[_0x4402('0x2b')],qs[_0x4402('0x2f')](_0x3a589b[_0x4402('0x2c')][_0x4402('0x2f')]));_0xb9cf85['attributes']=_0xb9cf85[_0x4402('0x2e')][_0x4402('0x3e')]?_0xb9cf85[_0x4402('0x2e')]:_0x2e2391[_0x4402('0x2b')];if(_0x3a589b[_0x4402('0x2c')][_0x4402('0x39')]){_0xb9cf85[_0x4402('0x3f')]=[{'all':!![]}];}_0xb9cf85=_[_0x4402('0x38')]({},_0xb9cf85,_0x3a589b[_0x4402('0x40')]);return db[_0x4402('0x26')][_0x4402('0x41')](_0xb9cf85)['then'](handleEntityNotFound(_0x2a6d78,null))[_0x4402('0x20')](respondWithResult(_0x2a6d78,null))['catch'](handleError(_0x2a6d78,null));};exports[_0x4402('0x42')]=function(_0x34ce00,_0x54e67a){return db[_0x4402('0x26')][_0x4402('0x42')](_0x34ce00[_0x4402('0x43')],{})[_0x4402('0x20')](respondWithResult(_0x54e67a,0xc9))[_0x4402('0x3b')](handleError(_0x54e67a,null));};exports[_0x4402('0x1f')]=function(_0x5b094b,_0xd0c9a5){if(_0x5b094b[_0x4402('0x43')]['id']){delete _0x5b094b[_0x4402('0x43')]['id'];}return db[_0x4402('0x26')][_0x4402('0x41')]({'where':{'id':_0x5b094b[_0x4402('0x3c')]['id']}})[_0x4402('0x20')](handleEntityNotFound(_0xd0c9a5,null))[_0x4402('0x20')](saveUpdates(_0x5b094b[_0x4402('0x43')],null))['then'](respondWithResult(_0xd0c9a5,null))['catch'](handleError(_0xd0c9a5,null));};exports['destroy']=function(_0x4c2d2e,_0x257010){return db[_0x4402('0x26')][_0x4402('0x41')]({'where':{'id':_0x4c2d2e[_0x4402('0x3c')]['id']}})['then'](handleEntityNotFound(_0x257010,null))[_0x4402('0x20')](removeEntity(_0x257010,null))[_0x4402('0x3b')](handleError(_0x257010,null));};exports[_0x4402('0x44')]=function(_0x2a4ea7,_0x196b2f,_0x352898){var _0x12f1fa={};var _0x53d306={};var _0x325b20;var _0x2a8085;return db[_0x4402('0x26')][_0x4402('0x45')]({'where':{'id':_0x2a4ea7[_0x4402('0x3c')]['id']}})[_0x4402('0x20')](handleEntityNotFound(_0x196b2f,null))['then'](function(_0xe8a8e9){if(_0xe8a8e9){_0x325b20=_0xe8a8e9;_0x53d306[_0x4402('0x2b')]=_[_0x4402('0x3d')](db[_0x4402('0x46')][_0x4402('0x27')]);_0x53d306[_0x4402('0x2c')]=_[_0x4402('0x3d')](_0x2a4ea7['query']);_0x53d306['filters']=_[_0x4402('0x2d')](_0x53d306[_0x4402('0x2b')],_0x53d306[_0x4402('0x2c')]);_0x12f1fa['attributes']=_['intersection'](_0x53d306[_0x4402('0x2b')],qs[_0x4402('0x2f')](_0x2a4ea7[_0x4402('0x2c')][_0x4402('0x2f')]));_0x12f1fa[_0x4402('0x2e')]=_0x12f1fa[_0x4402('0x2e')][_0x4402('0x3e')]?_0x12f1fa[_0x4402('0x2e')]:_0x53d306[_0x4402('0x2b')];_0x12f1fa[_0x4402('0x32')]=qs[_0x4402('0x33')](_0x2a4ea7[_0x4402('0x2c')][_0x4402('0x33')]);_0x12f1fa['where']=qs[_0x4402('0x35')](_['pick'](_0x2a4ea7[_0x4402('0x2c')],_0x53d306['filters']));if(_0x2a4ea7[_0x4402('0x2c')][_0x4402('0x36')]){_0x12f1fa[_0x4402('0x34')]=_[_0x4402('0x38')](_0x12f1fa[_0x4402('0x34')],{'$or':_[_0x4402('0x25')](_0x12f1fa['attributes'],function(_0xe425d0){var _0x25c1fc={};_0x25c1fc[_0xe425d0]={'$like':'%'+_0x2a4ea7[_0x4402('0x2c')][_0x4402('0x36')]+'%'};return _0x25c1fc;})});}_0x12f1fa=_[_0x4402('0x38')]({},_0x12f1fa,_0x2a4ea7['options']);return _0x325b20[_0x4402('0x44')](_0x12f1fa);}})[_0x4402('0x20')](function(_0x474b04){if(_0x474b04){_0x2a8085=_0x474b04[_0x4402('0x3e')];if(!_0x2a4ea7[_0x4402('0x2c')][_0x4402('0x30')](_0x4402('0x31'))){_0x12f1fa[_0x4402('0x1a')]=qs['limit'](_0x2a4ea7[_0x4402('0x2c')][_0x4402('0x1a')]);_0x12f1fa['offset']=qs[_0x4402('0x18')](_0x2a4ea7[_0x4402('0x2c')]['offset']);}return _0x325b20['getConfigurations'](_0x12f1fa);}})[_0x4402('0x20')](function(_0x1746c6){if(_0x1746c6){return _0x1746c6?{'count':_0x2a8085,'rows':_0x1746c6}:null;}})[_0x4402('0x20')](respondWithResult(_0x196b2f,null))['catch'](handleError(_0x196b2f,null));};exports[_0x4402('0x47')]=function(_0x12f3ac,_0x30e49b,_0x55f261){if(_0x12f3ac[_0x4402('0x43')]['id']){delete _0x12f3ac[_0x4402('0x43')]['id'];}return db[_0x4402('0x26')]['findOne']({'where':{'id':_0x12f3ac[_0x4402('0x3c')]['id']}})[_0x4402('0x20')](handleEntityNotFound(_0x30e49b,null))['then'](function(_0x5cef56){if(_0x5cef56){_0x12f3ac[_0x4402('0x43')]['AccountId']=_0x5cef56['id'];_0x12f3ac[_0x4402('0x43')][_0x4402('0x48')]=integrations['getSubjects'](_0x12f3ac['body'][_0x4402('0x49')],_0x12f3ac[_0x4402('0x43')][_0x4402('0x29')]);_0x12f3ac[_0x4402('0x43')]['Descriptions']=integrations[_0x4402('0x4a')](_0x12f3ac[_0x4402('0x43')][_0x4402('0x49')],_0x12f3ac[_0x4402('0x43')][_0x4402('0x29')]);return db[_0x4402('0x46')][_0x4402('0x42')](_0x12f3ac['body'],{'include':[{'model':db[_0x4402('0x4b')],'as':_0x4402('0x48')},{'model':db['ZendeskField'],'as':'Descriptions'}]});}return null;})[_0x4402('0x20')](respondWithResult(_0x30e49b,null))['catch'](handleError(_0x30e49b,null));};exports[_0x4402('0x4c')]=function(_0x586689,_0xc2ac06,_0x10b89a){var _0x22260b='';return db[_0x4402('0x26')][_0x4402('0x45')]({'where':{'id':_0x586689[_0x4402('0x3c')]['id']},'attributes':['id',_0x4402('0x4d'),_0x4402('0x4e'),_0x4402('0x4f'),_0x4402('0x50'),_0x4402('0x51')]})[_0x4402('0x20')](handleEntityNotFound(_0xc2ac06,null))[_0x4402('0x20')](function(_0xcf5c20){if(_0xcf5c20){_0x22260b=_0xcf5c20[_0x4402('0x51')];var _0x1d6af2=_0x22260b['slice'](-0x1);if(_0x1d6af2==='/'){_0x22260b=_0x22260b[_0x4402('0x52')](0x0,_0x22260b[_0x4402('0x53')](_0x1d6af2));}var _0xccb64f={'method':'GET','uri':util[_0x4402('0x54')]('%s/%s',_0x22260b,_0x4402('0x55')),'json':!![]};switch(_0xcf5c20[_0x4402('0x50')]){case _0x4402('0x4e'):_0xccb64f[_0x4402('0x56')]={'Authorization':util['format'](_0x4402('0x57'),new Buffer(util['format'](_0x4402('0x58'),_0xcf5c20[_0x4402('0x4d')],_0xcf5c20[_0x4402('0x4e')]))['toString'](_0x4402('0x59')))};break;case'token':_0xccb64f[_0x4402('0x56')]={'Authorization':util[_0x4402('0x54')](_0x4402('0x57'),new Buffer(util[_0x4402('0x54')](_0x4402('0x5a'),_0xcf5c20[_0x4402('0x4d')],_0xcf5c20[_0x4402('0x4f')]))[_0x4402('0x5b')](_0x4402('0x59')))};break;default:throw new db['Sequelize'][(_0x4402('0x5c'))](_0x4402('0x5d'));}return rp(_0xccb64f);}})[_0x4402('0x20')](function(_0x221889){if(_0x221889){var _0x4734ef=[_0x4402('0x5e'),_0x4402('0x5f'),_0x4402('0x60'),_0x4402('0x61')];_['remove'](_0x221889[_0x4402('0x55')],function(_0x2a6dc1){return _0x4734ef[_0x4402('0x62')](_0x2a6dc1['type']);});return{'count':_0x221889[_0x4402('0x55')]['length'],'rows':_[_0x4402('0x25')](_0x221889['ticket_fields'],function(_0xc1d540){return{'id':_0xc1d540['id'],'name':_0xc1d540[_0x4402('0x63')]>0x7?_0xc1d540['title']:_0xc1d540[_0x4402('0x29')],'custom':_0xc1d540['position']>0x7?!![]:![],'options':_0xc1d540[_0x4402('0x64')]?_0xc1d540[_0x4402('0x64')]:_0xc1d540['custom_field_options']?_0xc1d540[_0x4402('0x65')]:[]};})};}})[_0x4402('0x20')](respondWithResult(_0xc2ac06,null))['catch'](function(_0x189259){var _0x13c47e=_0x586689['query'][_0x4402('0x66')]?0x1f4:_0x189259[_0x4402('0x67')]||0x1f4;logger[_0x4402('0x68')](_0x4402('0x69'),_0x4402('0x4c'),_0x13c47e,JSON[_0x4402('0x6a')](_0x189259));delete _0x189259[_0x4402('0x23')];if(_0x13c47e===0x191){_0x13c47e=0x190;}_0xc2ac06[_0x4402('0x15')](_0x13c47e)[_0x4402('0x24')](_0x586689[_0x4402('0x2c')][_0x4402('0x66')]?{'message':_0x4402('0x6b'),'statusCode':_0x189259[_0x4402('0x67')]}:_0x189259);});}; \ No newline at end of file +var _0x5ec6=['Sequelize','ValidationError','Unknown\x20authentication\x20type','description','remove','includes','title','position','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','bluebird','util','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','ZendeskAccount','rawAttributes','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','body','findOne','ZendeskConfiguration','length','getConfigurations','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','username','password','token','authType','remoteUri','slice','lastIndexOf','GET','format','%s/%s','ticket_fields','Basic\x20%s','%s:%s','toString','base64','headers'];(function(_0x65221d,_0x3e6106){var _0x2f252a=function(_0x463232){while(--_0x463232){_0x65221d['push'](_0x65221d['shift']());}};_0x2f252a(++_0x3e6106);}(_0x5ec6,0x7f));var _0x65ec=function(_0xf14b94,_0x3cdb03){_0xf14b94=_0xf14b94-0x0;var _0x9c5951=_0x5ec6[_0xf14b94];return _0x9c5951;};'use strict';var emlformat=require(_0x65ec('0x0'));var rimraf=require(_0x65ec('0x1'));var zipdir=require(_0x65ec('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x65ec('0x3'));var moment=require('moment');var BPromise=require(_0x65ec('0x4'));var Mustache=require('mustache');var util=require(_0x65ec('0x5'));var path=require('path');var sox=require(_0x65ec('0x6'));var csv=require('to-csv');var ejs=require(_0x65ec('0x7'));var fs=require('fs');var fs_extra=require(_0x65ec('0x8'));var _=require('lodash');var squel=require(_0x65ec('0x9'));var crypto=require(_0x65ec('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x65ec('0xb'));var toCsv=require(_0x65ec('0xc'));var querystring=require(_0x65ec('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65ec('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x65ec('0xf'));var hardwareService=require(_0x65ec('0x10'));var logger=require('../../config/logger')(_0x65ec('0x11'));var utils=require(_0x65ec('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x65ec('0x13'));var db=require(_0x65ec('0x14'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3e52c8,_0x2af7d6){_0x2af7d6=_0x2af7d6||0xcc;return function(_0x411a7b){if(_0x411a7b){return _0x3e52c8[_0x65ec('0x15')](_0x2af7d6);}return _0x3e52c8[_0x65ec('0x16')](_0x2af7d6)[_0x65ec('0x17')]();};}function respondWithResult(_0x344724,_0x3edbfd){_0x3edbfd=_0x3edbfd||0xc8;return function(_0x58c81f){if(_0x58c81f){return _0x344724[_0x65ec('0x16')](_0x3edbfd)[_0x65ec('0x18')](_0x58c81f);}};}function respondWithFilteredResult(_0x35d06b,_0x4bbe88){return function(_0x5a0442){if(_0x5a0442){var _0x25cdd4=typeof _0x4bbe88[_0x65ec('0x19')]===_0x65ec('0x1a')&&typeof _0x4bbe88['limit']===_0x65ec('0x1a');var _0x286eac=_0x5a0442[_0x65ec('0x1b')];var _0xb4ed90=_0x25cdd4?0x0:_0x4bbe88[_0x65ec('0x19')];var _0xd81ed3=_0x25cdd4?_0x5a0442[_0x65ec('0x1b')]:_0x4bbe88[_0x65ec('0x19')]+_0x4bbe88[_0x65ec('0x1c')];var _0x441ad0;if(_0xd81ed3>=_0x286eac){_0xd81ed3=_0x286eac;_0x441ad0=0xc8;}else{_0x441ad0=0xce;}_0x35d06b[_0x65ec('0x16')](_0x441ad0);return _0x35d06b[_0x65ec('0x1d')](_0x65ec('0x1e'),_0xb4ed90+'-'+_0xd81ed3+'/'+_0x286eac)[_0x65ec('0x18')](_0x5a0442);}return null;};}function patchUpdates(_0x3804a4){return function(_0x1d538c){try{jsonpatch[_0x65ec('0x1f')](_0x1d538c,_0x3804a4,!![]);}catch(_0x130d4e){return BPromise[_0x65ec('0x20')](_0x130d4e);}return _0x1d538c['save']();};}function saveUpdates(_0x170703,_0x297fba){return function(_0x89e640){if(_0x89e640){return _0x89e640[_0x65ec('0x21')](_0x170703)[_0x65ec('0x22')](function(_0x163e55){return _0x163e55;});}return null;};}function removeEntity(_0x47288d,_0x58239f){return function(_0xf1ff97){if(_0xf1ff97){return _0xf1ff97[_0x65ec('0x23')]()[_0x65ec('0x22')](function(){_0x47288d[_0x65ec('0x16')](0xcc)[_0x65ec('0x17')]();});}};}function handleEntityNotFound(_0x156793,_0x21426b){return function(_0xf5adc7){if(!_0xf5adc7){_0x156793[_0x65ec('0x15')](0x194);}return _0xf5adc7;};}function handleError(_0x4c846b,_0x10baef){_0x10baef=_0x10baef||0x1f4;return function(_0x30f0cf){logger[_0x65ec('0x24')](_0x30f0cf[_0x65ec('0x25')]);if(_0x30f0cf['name']){delete _0x30f0cf[_0x65ec('0x26')];}_0x4c846b['status'](_0x10baef)[_0x65ec('0x27')](_0x30f0cf);};}exports[_0x65ec('0x28')]=function(_0x1d0b5c,_0x30366c){var _0x14431d={},_0x46d4c1={},_0x46bf66={'count':0x0,'rows':[]};var _0x39410f=_[_0x65ec('0x29')](db[_0x65ec('0x2a')][_0x65ec('0x2b')],function(_0x4b435c){return{'name':_0x4b435c['fieldName'],'type':_0x4b435c[_0x65ec('0x2c')]['key']};});_0x46d4c1[_0x65ec('0x2d')]=_[_0x65ec('0x29')](_0x39410f,'name');_0x46d4c1[_0x65ec('0x2e')]=_[_0x65ec('0x2f')](_0x1d0b5c[_0x65ec('0x2e')]);_0x46d4c1[_0x65ec('0x30')]=_['intersection'](_0x46d4c1[_0x65ec('0x2d')],_0x46d4c1[_0x65ec('0x2e')]);_0x14431d[_0x65ec('0x31')]=_[_0x65ec('0x32')](_0x46d4c1[_0x65ec('0x2d')],qs[_0x65ec('0x33')](_0x1d0b5c[_0x65ec('0x2e')][_0x65ec('0x33')]));_0x14431d[_0x65ec('0x31')]=_0x14431d[_0x65ec('0x31')]['length']?_0x14431d[_0x65ec('0x31')]:_0x46d4c1[_0x65ec('0x2d')];if(!_0x1d0b5c['query'][_0x65ec('0x34')](_0x65ec('0x35'))){_0x14431d[_0x65ec('0x1c')]=qs[_0x65ec('0x1c')](_0x1d0b5c[_0x65ec('0x2e')][_0x65ec('0x1c')]);_0x14431d[_0x65ec('0x19')]=qs['offset'](_0x1d0b5c[_0x65ec('0x2e')][_0x65ec('0x19')]);}_0x14431d[_0x65ec('0x36')]=qs[_0x65ec('0x37')](_0x1d0b5c['query'][_0x65ec('0x37')]);_0x14431d[_0x65ec('0x38')]=qs[_0x65ec('0x30')](_[_0x65ec('0x39')](_0x1d0b5c['query'],_0x46d4c1['filters']),_0x39410f);if(_0x1d0b5c[_0x65ec('0x2e')]['filter']){_0x14431d[_0x65ec('0x38')]=_[_0x65ec('0x3a')](_0x14431d['where'],{'$or':_[_0x65ec('0x29')](_0x39410f,function(_0x1fbc2b){if(_0x1fbc2b[_0x65ec('0x2c')]!==_0x65ec('0x3b')){var _0x3cffbf={};_0x3cffbf[_0x1fbc2b[_0x65ec('0x26')]]={'$like':'%'+_0x1d0b5c[_0x65ec('0x2e')][_0x65ec('0x3c')]+'%'};return _0x3cffbf;}})});}_0x14431d=_[_0x65ec('0x3a')]({},_0x14431d,_0x1d0b5c[_0x65ec('0x3d')]);var _0x3561ef={'where':_0x14431d['where']};return db[_0x65ec('0x2a')]['count'](_0x3561ef)[_0x65ec('0x22')](function(_0x278d43){_0x46bf66[_0x65ec('0x1b')]=_0x278d43;if(_0x1d0b5c[_0x65ec('0x2e')][_0x65ec('0x3e')]){_0x14431d[_0x65ec('0x3f')]=[{'all':!![]}];}return db['ZendeskAccount'][_0x65ec('0x40')](_0x14431d);})['then'](function(_0x5d8d57){_0x46bf66[_0x65ec('0x41')]=_0x5d8d57;return _0x46bf66;})[_0x65ec('0x22')](respondWithFilteredResult(_0x30366c,_0x14431d))[_0x65ec('0x42')](handleError(_0x30366c,null));};exports[_0x65ec('0x43')]=function(_0x1d475e,_0x524235){var _0x4843ca={'raw':![],'where':{'id':_0x1d475e[_0x65ec('0x44')]['id']}},_0x1aef6d={};_0x1aef6d[_0x65ec('0x2d')]=_[_0x65ec('0x2f')](db[_0x65ec('0x2a')]['rawAttributes']);_0x1aef6d['query']=_[_0x65ec('0x2f')](_0x1d475e[_0x65ec('0x2e')]);_0x1aef6d[_0x65ec('0x30')]=_[_0x65ec('0x32')](_0x1aef6d[_0x65ec('0x2d')],_0x1aef6d[_0x65ec('0x2e')]);_0x4843ca[_0x65ec('0x31')]=_['intersection'](_0x1aef6d[_0x65ec('0x2d')],qs[_0x65ec('0x33')](_0x1d475e[_0x65ec('0x2e')]['fields']));_0x4843ca[_0x65ec('0x31')]=_0x4843ca[_0x65ec('0x31')]['length']?_0x4843ca[_0x65ec('0x31')]:_0x1aef6d[_0x65ec('0x2d')];if(_0x1d475e[_0x65ec('0x2e')][_0x65ec('0x3e')]){_0x4843ca[_0x65ec('0x3f')]=[{'all':!![]}];}_0x4843ca=_['merge']({},_0x4843ca,_0x1d475e[_0x65ec('0x3d')]);return db[_0x65ec('0x2a')][_0x65ec('0x45')](_0x4843ca)[_0x65ec('0x22')](handleEntityNotFound(_0x524235,null))['then'](respondWithResult(_0x524235,null))[_0x65ec('0x42')](handleError(_0x524235,null));};exports['create']=function(_0x1ed0f9,_0x169890){return db[_0x65ec('0x2a')]['create'](_0x1ed0f9['body'],{})[_0x65ec('0x22')](respondWithResult(_0x169890,0xc9))[_0x65ec('0x42')](handleError(_0x169890,null));};exports[_0x65ec('0x21')]=function(_0x2111af,_0x1b3732){if(_0x2111af[_0x65ec('0x46')]['id']){delete _0x2111af[_0x65ec('0x46')]['id'];}return db[_0x65ec('0x2a')][_0x65ec('0x45')]({'where':{'id':_0x2111af[_0x65ec('0x44')]['id']}})[_0x65ec('0x22')](handleEntityNotFound(_0x1b3732,null))[_0x65ec('0x22')](saveUpdates(_0x2111af[_0x65ec('0x46')],null))[_0x65ec('0x22')](respondWithResult(_0x1b3732,null))[_0x65ec('0x42')](handleError(_0x1b3732,null));};exports[_0x65ec('0x23')]=function(_0x22c28c,_0x5eb6d3){return db[_0x65ec('0x2a')][_0x65ec('0x45')]({'where':{'id':_0x22c28c['params']['id']}})[_0x65ec('0x22')](handleEntityNotFound(_0x5eb6d3,null))[_0x65ec('0x22')](removeEntity(_0x5eb6d3,null))[_0x65ec('0x42')](handleError(_0x5eb6d3,null));};exports['getConfigurations']=function(_0x3eee1e,_0x2b2756,_0x27843b){var _0x50f1c3={};var _0xabb4e3={};var _0x5e5e48;var _0x4c9905;return db[_0x65ec('0x2a')][_0x65ec('0x47')]({'where':{'id':_0x3eee1e[_0x65ec('0x44')]['id']}})['then'](handleEntityNotFound(_0x2b2756,null))[_0x65ec('0x22')](function(_0x28a686){if(_0x28a686){_0x5e5e48=_0x28a686;_0xabb4e3[_0x65ec('0x2d')]=_[_0x65ec('0x2f')](db[_0x65ec('0x48')][_0x65ec('0x2b')]);_0xabb4e3[_0x65ec('0x2e')]=_[_0x65ec('0x2f')](_0x3eee1e[_0x65ec('0x2e')]);_0xabb4e3['filters']=_['intersection'](_0xabb4e3[_0x65ec('0x2d')],_0xabb4e3['query']);_0x50f1c3[_0x65ec('0x31')]=_['intersection'](_0xabb4e3[_0x65ec('0x2d')],qs[_0x65ec('0x33')](_0x3eee1e[_0x65ec('0x2e')][_0x65ec('0x33')]));_0x50f1c3[_0x65ec('0x31')]=_0x50f1c3[_0x65ec('0x31')][_0x65ec('0x49')]?_0x50f1c3['attributes']:_0xabb4e3[_0x65ec('0x2d')];_0x50f1c3[_0x65ec('0x36')]=qs[_0x65ec('0x37')](_0x3eee1e[_0x65ec('0x2e')][_0x65ec('0x37')]);_0x50f1c3['where']=qs[_0x65ec('0x30')](_[_0x65ec('0x39')](_0x3eee1e[_0x65ec('0x2e')],_0xabb4e3[_0x65ec('0x30')]));if(_0x3eee1e[_0x65ec('0x2e')][_0x65ec('0x3c')]){_0x50f1c3[_0x65ec('0x38')]=_[_0x65ec('0x3a')](_0x50f1c3['where'],{'$or':_[_0x65ec('0x29')](_0x50f1c3[_0x65ec('0x31')],function(_0x12bb9b){var _0x233b9b={};_0x233b9b[_0x12bb9b]={'$like':'%'+_0x3eee1e[_0x65ec('0x2e')][_0x65ec('0x3c')]+'%'};return _0x233b9b;})});}_0x50f1c3=_[_0x65ec('0x3a')]({},_0x50f1c3,_0x3eee1e['options']);return _0x5e5e48['getConfigurations'](_0x50f1c3);}})[_0x65ec('0x22')](function(_0x56dd47){if(_0x56dd47){_0x4c9905=_0x56dd47[_0x65ec('0x49')];if(!_0x3eee1e[_0x65ec('0x2e')]['hasOwnProperty'](_0x65ec('0x35'))){_0x50f1c3[_0x65ec('0x1c')]=qs[_0x65ec('0x1c')](_0x3eee1e[_0x65ec('0x2e')][_0x65ec('0x1c')]);_0x50f1c3[_0x65ec('0x19')]=qs[_0x65ec('0x19')](_0x3eee1e['query']['offset']);}return _0x5e5e48[_0x65ec('0x4a')](_0x50f1c3);}})[_0x65ec('0x22')](function(_0xd14e5){if(_0xd14e5){return _0xd14e5?{'count':_0x4c9905,'rows':_0xd14e5}:null;}})['then'](respondWithResult(_0x2b2756,null))[_0x65ec('0x42')](handleError(_0x2b2756,null));};exports[_0x65ec('0x4b')]=function(_0x17059d,_0x3d761f,_0x21096d){if(_0x17059d[_0x65ec('0x46')]['id']){delete _0x17059d[_0x65ec('0x46')]['id'];}return db['ZendeskAccount'][_0x65ec('0x47')]({'where':{'id':_0x17059d[_0x65ec('0x44')]['id']}})[_0x65ec('0x22')](handleEntityNotFound(_0x3d761f,null))[_0x65ec('0x22')](function(_0x3da824){if(_0x3da824){_0x17059d[_0x65ec('0x46')][_0x65ec('0x4c')]=_0x3da824['id'];_0x17059d[_0x65ec('0x46')][_0x65ec('0x4d')]=integrations['getSubjects'](_0x17059d['body'][_0x65ec('0x4e')],_0x17059d['body']['type']);_0x17059d[_0x65ec('0x46')][_0x65ec('0x4f')]=integrations[_0x65ec('0x50')](_0x17059d['body']['channel'],_0x17059d[_0x65ec('0x46')]['type']);return db['ZendeskConfiguration']['create'](_0x17059d[_0x65ec('0x46')],{'include':[{'model':db['ZendeskField'],'as':_0x65ec('0x4d')},{'model':db[_0x65ec('0x51')],'as':_0x65ec('0x4f')}]});}return null;})['then'](respondWithResult(_0x3d761f,null))['catch'](handleError(_0x3d761f,null));};exports[_0x65ec('0x52')]=function(_0x54f1cb,_0x244d12,_0x1c2972){var _0xf78f6a='';return db[_0x65ec('0x2a')][_0x65ec('0x47')]({'where':{'id':_0x54f1cb[_0x65ec('0x44')]['id']},'attributes':['id',_0x65ec('0x53'),_0x65ec('0x54'),_0x65ec('0x55'),_0x65ec('0x56'),'remoteUri']})[_0x65ec('0x22')](handleEntityNotFound(_0x244d12,null))['then'](function(_0x46e454){if(_0x46e454){_0xf78f6a=_0x46e454[_0x65ec('0x57')];var _0x292f81=_0xf78f6a[_0x65ec('0x58')](-0x1);if(_0x292f81==='/'){_0xf78f6a=_0xf78f6a['substring'](0x0,_0xf78f6a[_0x65ec('0x59')](_0x292f81));}var _0x556c5e={'method':_0x65ec('0x5a'),'uri':util[_0x65ec('0x5b')](_0x65ec('0x5c'),_0xf78f6a,_0x65ec('0x5d')),'json':!![]};switch(_0x46e454['authType']){case'password':_0x556c5e['headers']={'Authorization':util[_0x65ec('0x5b')](_0x65ec('0x5e'),new Buffer(util[_0x65ec('0x5b')](_0x65ec('0x5f'),_0x46e454[_0x65ec('0x53')],_0x46e454[_0x65ec('0x54')]))[_0x65ec('0x60')](_0x65ec('0x61')))};break;case _0x65ec('0x55'):_0x556c5e[_0x65ec('0x62')]={'Authorization':util[_0x65ec('0x5b')](_0x65ec('0x5e'),new Buffer(util[_0x65ec('0x5b')]('%s/token:%s',_0x46e454[_0x65ec('0x53')],_0x46e454[_0x65ec('0x55')]))[_0x65ec('0x60')](_0x65ec('0x61')))};break;default:throw new db[(_0x65ec('0x63'))][(_0x65ec('0x64'))](_0x65ec('0x65'));}return rp(_0x556c5e);}})[_0x65ec('0x22')](function(_0x3b5640){if(_0x3b5640){var _0x26ac0e=['subject',_0x65ec('0x66'),'group','assignee'];_[_0x65ec('0x67')](_0x3b5640[_0x65ec('0x5d')],function(_0x272432){return _0x26ac0e[_0x65ec('0x68')](_0x272432[_0x65ec('0x2c')]);});return{'count':_0x3b5640[_0x65ec('0x5d')][_0x65ec('0x49')],'rows':_[_0x65ec('0x29')](_0x3b5640['ticket_fields'],function(_0x1f5fe7){return{'id':_0x1f5fe7['id'],'name':_0x1f5fe7['position']>0x7?_0x1f5fe7[_0x65ec('0x69')]:_0x1f5fe7[_0x65ec('0x2c')],'custom':_0x1f5fe7[_0x65ec('0x6a')]>0x7?!![]:![],'options':_0x1f5fe7['system_field_options']?_0x1f5fe7[_0x65ec('0x6b')]:_0x1f5fe7[_0x65ec('0x6c')]?_0x1f5fe7[_0x65ec('0x6c')]:[]};})};}})[_0x65ec('0x22')](respondWithResult(_0x244d12,null))[_0x65ec('0x42')](function(_0x77ebd2){var _0x1172f3=_0x54f1cb['query'][_0x65ec('0x6d')]?0x1f4:_0x77ebd2[_0x65ec('0x6e')]||0x1f4;logger[_0x65ec('0x24')](_0x65ec('0x6f'),'getFields',_0x1172f3,JSON['stringify'](_0x77ebd2));delete _0x77ebd2[_0x65ec('0x26')];if(_0x1172f3===0x191){_0x1172f3=0x190;}_0x244d12[_0x65ec('0x16')](_0x1172f3)[_0x65ec('0x27')](_0x54f1cb[_0x65ec('0x2e')][_0x65ec('0x6d')]?{'message':_0x65ec('0x70'),'statusCode':_0x77ebd2['statusCode']}:_0x77ebd2);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 297fc8f..5e552e5 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 _0x5675=['path','rimraf','../../components/integrations/configuration','exports','ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3d0c8a,_0x3cba74){var _0x63fdfa=function(_0x5aae77){while(--_0x5aae77){_0x3d0c8a['push'](_0x3d0c8a['shift']());}};_0x63fdfa(++_0x3cba74);}(_0x5675,0x7b));var _0x5567=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x5675[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x5567('0x0'));var util=require(_0x5567('0x1'));var logger=require(_0x5567('0x2'))(_0x5567('0x3'));var moment=require(_0x5567('0x4'));var BPromise=require(_0x5567('0x5'));var rp=require(_0x5567('0x6'));var fs=require('fs');var path=require(_0x5567('0x7'));var rimraf=require(_0x5567('0x8'));var config=require('../../config/environment');var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0x5567('0x9'));module[_0x5567('0xa')]=function(_0x336ee7,_0x4bf6fe){return _0x336ee7['define'](_0x5567('0xb'),attributes,{'tableName':_0x5567('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x301a=['int_zendesk_accounts','lodash','util','api','bluebird','request-promise','rimraf','../../config/environment','../../components/integrations/configuration','exports','ZendeskAccount'];(function(_0x13fad7,_0x5c2bbd){var _0x2cf1ca=function(_0xd33dae){while(--_0xd33dae){_0x13fad7['push'](_0x13fad7['shift']());}};_0x2cf1ca(++_0x5c2bbd);}(_0x301a,0x90));var _0xa301=function(_0x58d125,_0x55ed33){_0x58d125=_0x58d125-0x0;var _0x45e7e8=_0x301a[_0x58d125];return _0x45e7e8;};'use strict';var _=require(_0xa301('0x0'));var util=require(_0xa301('0x1'));var logger=require('../../config/logger')(_0xa301('0x2'));var moment=require('moment');var BPromise=require(_0xa301('0x3'));var rp=require(_0xa301('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa301('0x5'));var config=require(_0xa301('0x6'));var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0xa301('0x7'));module[_0xa301('0x8')]=function(_0x3d7767,_0x2dfdbb){return _0x3d7767['define'](_0xa301('0x9'),attributes,{'tableName':_0xa301('0xa'),'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 68a4031..d3194ca 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 _0xa94b=['message','result','catch','GetZendeskAccount','ZendeskAccount','findAll','raw','options','where','attributes','limit','include','map','model','stringify','ShowZendeskAccount','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x31880d,_0x4f0ff3){var _0x423823=function(_0x57cc92){while(--_0x57cc92){_0x31880d['push'](_0x31880d['shift']());}};_0x423823(++_0x4f0ff3);}(_0xa94b,0x130));var _0xba94=function(_0x339acf,_0x55bb46){_0x339acf=_0x339acf-0x0;var _0x5d66f4=_0xa94b[_0x339acf];return _0x5d66f4;};'use strict';var _=require(_0xba94('0x0'));var util=require(_0xba94('0x1'));var moment=require(_0xba94('0x2'));var BPromise=require(_0xba94('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xba94('0x4'));var db=require(_0xba94('0x5'))['db'];var utils=require(_0xba94('0x6'));var logger=require(_0xba94('0x7'))(_0xba94('0x8'));var config=require('../../config/environment');var jayson=require(_0xba94('0x9'));var client=jayson[_0xba94('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x53b114,_0x1e7b3c,_0x533cb8){return new BPromise(function(_0x544600,_0x57cb15){return client[_0xba94('0xb')](_0x53b114,_0x533cb8)[_0xba94('0xc')](function(_0x1263b4){logger[_0xba94('0xd')](_0xba94('0xe'),_0x1e7b3c,_0xba94('0xf'));logger[_0xba94('0x10')](_0xba94('0x11'),_0x1e7b3c,_0xba94('0xf'),JSON['stringify'](_0x1263b4));if(_0x1263b4[_0xba94('0x12')]){if(_0x1263b4['error'][_0xba94('0x13')]===0x1f4){logger[_0xba94('0x12')](_0xba94('0xe'),_0x1e7b3c,_0x1263b4['error'][_0xba94('0x14')]);return _0x57cb15(_0x1263b4[_0xba94('0x12')][_0xba94('0x14')]);}logger['error'](_0xba94('0xe'),_0x1e7b3c,_0x1263b4[_0xba94('0x12')][_0xba94('0x14')]);return _0x544600(_0x1263b4[_0xba94('0x12')][_0xba94('0x14')]);}else{logger[_0xba94('0xd')](_0xba94('0xe'),_0x1e7b3c,_0xba94('0xf'));_0x544600(_0x1263b4[_0xba94('0x15')][_0xba94('0x14')]);}})[_0xba94('0x16')](function(_0x243c36){logger[_0xba94('0x12')](_0xba94('0xe'),_0x1e7b3c,_0x243c36);_0x57cb15(_0x243c36);});});}exports[_0xba94('0x17')]=function(_0x2b047d){var _0x224321=this;return new Promise(function(_0x11830c,_0x128651){return db[_0xba94('0x18')][_0xba94('0x19')]({'raw':_0x2b047d['options']?_0x2b047d['options'][_0xba94('0x1a')]===undefined?!![]:![]:!![],'where':_0x2b047d[_0xba94('0x1b')]?_0x2b047d[_0xba94('0x1b')][_0xba94('0x1c')]||null:null,'attributes':_0x2b047d[_0xba94('0x1b')]?_0x2b047d[_0xba94('0x1b')][_0xba94('0x1d')]||null:null,'limit':_0x2b047d['options']?_0x2b047d[_0xba94('0x1b')][_0xba94('0x1e')]||null:null,'include':_0x2b047d[_0xba94('0x1b')]?_0x2b047d[_0xba94('0x1b')][_0xba94('0x1f')]?_[_0xba94('0x20')](_0x2b047d['options'][_0xba94('0x1f')],function(_0x46aa41){return{'model':db[_0x46aa41['model']],'as':_0x46aa41['as'],'attributes':_0x46aa41[_0xba94('0x1d')],'include':_0x46aa41['include']?_[_0xba94('0x20')](_0x46aa41[_0xba94('0x1f')],function(_0x193c46){return{'model':db[_0x193c46[_0xba94('0x21')]],'as':_0x193c46['as'],'attributes':_0x193c46[_0xba94('0x1d')],'include':_0x193c46['include']?_[_0xba94('0x20')](_0x193c46['include'],function(_0x10bc64){return{'model':db[_0x10bc64[_0xba94('0x21')]],'as':_0x10bc64['as'],'attributes':_0x10bc64[_0xba94('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3095ad){logger[_0xba94('0xd')](_0xba94('0x17'),_0x2b047d);logger[_0xba94('0x10')](_0xba94('0x17'),_0x2b047d,JSON[_0xba94('0x22')](_0x3095ad));_0x11830c(_0x3095ad);})[_0xba94('0x16')](function(_0x49cff3){logger[_0xba94('0x12')]('GetZendeskAccount',_0x49cff3[_0xba94('0x14')],_0x2b047d);_0x128651(_0x224321[_0xba94('0x12')](0x1f4,_0x49cff3[_0xba94('0x14')]));});});};exports[_0xba94('0x23')]=function(_0x563614){var _0x4562ea=this;return new Promise(function(_0x5deec2,_0x117258){return db['ZendeskAccount']['find']({'raw':_0x563614[_0xba94('0x1b')]?_0x563614[_0xba94('0x1b')][_0xba94('0x1a')]===undefined?!![]:![]:!![],'where':_0x563614[_0xba94('0x1b')]?_0x563614[_0xba94('0x1b')]['where']||null:null,'attributes':_0x563614[_0xba94('0x1b')]?_0x563614[_0xba94('0x1b')][_0xba94('0x1d')]||null:null,'include':_0x563614[_0xba94('0x1b')]?_0x563614[_0xba94('0x1b')][_0xba94('0x1f')]?_['map'](_0x563614[_0xba94('0x1b')][_0xba94('0x1f')],function(_0x5538c1){return{'model':db[_0x5538c1['model']],'as':_0x5538c1['as'],'attributes':_0x5538c1[_0xba94('0x1d')],'include':_0x5538c1[_0xba94('0x1f')]?_['map'](_0x5538c1[_0xba94('0x1f')],function(_0x2785fb){return{'model':db[_0x2785fb['model']],'as':_0x2785fb['as'],'attributes':_0x2785fb[_0xba94('0x1d')],'include':_0x2785fb['include']?_[_0xba94('0x20')](_0x2785fb[_0xba94('0x1f')],function(_0x2f8d61){return{'model':db[_0x2f8d61[_0xba94('0x21')]],'as':_0x2f8d61['as'],'attributes':_0x2f8d61[_0xba94('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xba94('0xc')](function(_0x5a94f6){logger['info'](_0xba94('0x23'),_0x563614);logger[_0xba94('0x10')](_0xba94('0x23'),_0x563614,JSON[_0xba94('0x22')](_0x5a94f6));_0x5deec2(_0x5a94f6);})['catch'](function(_0x3964e0){logger['error'](_0xba94('0x23'),_0x3964e0[_0xba94('0x14')],_0x563614);_0x117258(_0x4562ea[_0xba94('0x12')](0x1f4,_0x3964e0[_0xba94('0x14')]));});});}; \ No newline at end of file +var _0x89f8=['model','GetZendeskAccount','raw','ShowZendeskAccount','lodash','util','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ZendeskAccount','findAll','options','where','attributes','include','map'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x89f8,0x14e));var _0x889f=function(_0x1c4add,_0x1141ef){_0x1c4add=_0x1c4add-0x0;var _0x2b1cc1=_0x89f8[_0x1c4add];return _0x2b1cc1;};'use strict';var _=require(_0x889f('0x0'));var util=require(_0x889f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x889f('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x889f('0x3'))(_0x889f('0x4'));var config=require(_0x889f('0x5'));var jayson=require(_0x889f('0x6'));var client=jayson[_0x889f('0x7')][_0x889f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x53c0b9,_0x1742a5,_0x22e9f6){return new BPromise(function(_0x51e027,_0xd9b5c9){return client[_0x889f('0x9')](_0x53c0b9,_0x22e9f6)[_0x889f('0xa')](function(_0x341546){logger[_0x889f('0xb')](_0x889f('0xc'),_0x1742a5,_0x889f('0xd'));logger[_0x889f('0xe')](_0x889f('0xf'),_0x1742a5,'request\x20sent',JSON[_0x889f('0x10')](_0x341546));if(_0x341546[_0x889f('0x11')]){if(_0x341546[_0x889f('0x11')][_0x889f('0x12')]===0x1f4){logger[_0x889f('0x11')](_0x889f('0xc'),_0x1742a5,_0x341546[_0x889f('0x11')][_0x889f('0x13')]);return _0xd9b5c9(_0x341546[_0x889f('0x11')]['message']);}logger[_0x889f('0x11')](_0x889f('0xc'),_0x1742a5,_0x341546['error'][_0x889f('0x13')]);return _0x51e027(_0x341546['error']['message']);}else{logger[_0x889f('0xb')](_0x889f('0xc'),_0x1742a5,'request\x20sent');_0x51e027(_0x341546[_0x889f('0x14')][_0x889f('0x13')]);}})[_0x889f('0x15')](function(_0x3a0a46){logger[_0x889f('0x11')]('ZendeskAccount,\x20%s,\x20%s',_0x1742a5,_0x3a0a46);_0xd9b5c9(_0x3a0a46);});});}exports['GetZendeskAccount']=function(_0x55580d){var _0x5ef287=this;return new Promise(function(_0x54fdca,_0xe2acf9){return db[_0x889f('0x16')][_0x889f('0x17')]({'raw':_0x55580d[_0x889f('0x18')]?_0x55580d[_0x889f('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x55580d[_0x889f('0x18')]?_0x55580d[_0x889f('0x18')][_0x889f('0x19')]||null:null,'attributes':_0x55580d['options']?_0x55580d[_0x889f('0x18')][_0x889f('0x1a')]||null:null,'limit':_0x55580d[_0x889f('0x18')]?_0x55580d[_0x889f('0x18')]['limit']||null:null,'include':_0x55580d['options']?_0x55580d[_0x889f('0x18')][_0x889f('0x1b')]?_[_0x889f('0x1c')](_0x55580d[_0x889f('0x18')][_0x889f('0x1b')],function(_0x402795){return{'model':db[_0x402795[_0x889f('0x1d')]],'as':_0x402795['as'],'attributes':_0x402795[_0x889f('0x1a')],'include':_0x402795[_0x889f('0x1b')]?_[_0x889f('0x1c')](_0x402795[_0x889f('0x1b')],function(_0x6712b3){return{'model':db[_0x6712b3[_0x889f('0x1d')]],'as':_0x6712b3['as'],'attributes':_0x6712b3[_0x889f('0x1a')],'include':_0x6712b3[_0x889f('0x1b')]?_[_0x889f('0x1c')](_0x6712b3[_0x889f('0x1b')],function(_0x4e7f69){return{'model':db[_0x4e7f69['model']],'as':_0x4e7f69['as'],'attributes':_0x4e7f69['attributes']};}):[]};}):[]};}):[]:[]})[_0x889f('0xa')](function(_0x1b692b){logger[_0x889f('0xb')](_0x889f('0x1e'),_0x55580d);logger[_0x889f('0xe')](_0x889f('0x1e'),_0x55580d,JSON[_0x889f('0x10')](_0x1b692b));_0x54fdca(_0x1b692b);})[_0x889f('0x15')](function(_0x4112a8){logger[_0x889f('0x11')]('GetZendeskAccount',_0x4112a8[_0x889f('0x13')],_0x55580d);_0xe2acf9(_0x5ef287['error'](0x1f4,_0x4112a8['message']));});});};exports['ShowZendeskAccount']=function(_0xab04b3){var _0x51518d=this;return new Promise(function(_0x1c7f28,_0x5b1f1a){return db[_0x889f('0x16')]['find']({'raw':_0xab04b3['options']?_0xab04b3[_0x889f('0x18')][_0x889f('0x1f')]===undefined?!![]:![]:!![],'where':_0xab04b3[_0x889f('0x18')]?_0xab04b3['options'][_0x889f('0x19')]||null:null,'attributes':_0xab04b3['options']?_0xab04b3['options'][_0x889f('0x1a')]||null:null,'include':_0xab04b3['options']?_0xab04b3[_0x889f('0x18')][_0x889f('0x1b')]?_[_0x889f('0x1c')](_0xab04b3[_0x889f('0x18')][_0x889f('0x1b')],function(_0x25a51e){return{'model':db[_0x25a51e[_0x889f('0x1d')]],'as':_0x25a51e['as'],'attributes':_0x25a51e['attributes'],'include':_0x25a51e[_0x889f('0x1b')]?_['map'](_0x25a51e[_0x889f('0x1b')],function(_0x2c0be3){return{'model':db[_0x2c0be3[_0x889f('0x1d')]],'as':_0x2c0be3['as'],'attributes':_0x2c0be3['attributes'],'include':_0x2c0be3['include']?_[_0x889f('0x1c')](_0x2c0be3[_0x889f('0x1b')],function(_0x388273){return{'model':db[_0x388273[_0x889f('0x1d')]],'as':_0x388273['as'],'attributes':_0x388273[_0x889f('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x889f('0xa')](function(_0x20b132){logger['info']('ShowZendeskAccount',_0xab04b3);logger['debug'](_0x889f('0x20'),_0xab04b3,JSON[_0x889f('0x10')](_0x20b132));_0x1c7f28(_0x20b132);})['catch'](function(_0x5cdb54){logger[_0x889f('0x11')](_0x889f('0x20'),_0x5cdb54[_0x889f('0x13')],_0xab04b3);_0x5b1f1a(_0x51518d[_0x889f('0x11')](0x1f4,_0x5cdb54[_0x889f('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 420f3f3..8bfa32e 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 _0x4fc2=['get','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intZendeskConfiguration.controller','isAuthenticated','index','/:id','show'];(function(_0x238824,_0x2bba29){var _0x3101fa=function(_0x4c799d){while(--_0x4c799d){_0x238824['push'](_0x238824['shift']());}};_0x3101fa(++_0x2bba29);}(_0x4fc2,0x111));var _0x24fc=function(_0x5ba38a,_0x132834){_0x5ba38a=_0x5ba38a-0x0;var _0x28eebe=_0x4fc2[_0x5ba38a];return _0x28eebe;};'use strict';var multer=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var path=require(_0x24fc('0x2'));var timeout=require(_0x24fc('0x3'));var express=require('express');var router=express[_0x24fc('0x4')]();var fs_extra=require(_0x24fc('0x5'));var auth=require(_0x24fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x24fc('0x7'));var controller=require(_0x24fc('0x8'));router['get']('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xa')]);router['get'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xc')]);router[_0x24fc('0xd')](_0x24fc('0xe'),auth[_0x24fc('0x9')](),controller['getFields']);router[_0x24fc('0xd')](_0x24fc('0xf'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x10')]);router[_0x24fc('0xd')](_0x24fc('0x11'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x12')]);router['get'](_0x24fc('0x13'),auth[_0x24fc('0x9')](),controller['getTags']);router[_0x24fc('0x14')]('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0x15')]);router[_0x24fc('0x14')](_0x24fc('0x13'),auth[_0x24fc('0x9')](),controller['setTags']);router[_0x24fc('0x16')](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x17')]);router['delete'](_0x24fc('0xb'),auth['isAuthenticated'](),controller[_0x24fc('0x18')]);module[_0x24fc('0x19')]=router; \ No newline at end of file +var _0xbdb7=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskConfiguration.controller','index','get','show','getFields','/:id/subjects','isAuthenticated','getSubjects','/:id/descriptions','getTags','/:id/tags','update','delete','/:id'];(function(_0x48c2ae,_0x4cea90){var _0x8f7531=function(_0x126458){while(--_0x126458){_0x48c2ae['push'](_0x48c2ae['shift']());}};_0x8f7531(++_0x4cea90);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x3cfdfc,_0x1171e5){_0x3cfdfc=_0x3cfdfc-0x0;var _0x2863db=_0xbdb7[_0x3cfdfc];return _0x2863db;};'use strict';var multer=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var path=require(_0x7bdb('0x2'));var timeout=require(_0x7bdb('0x3'));var express=require(_0x7bdb('0x4'));var router=express[_0x7bdb('0x5')]();var fs_extra=require(_0x7bdb('0x6'));var auth=require(_0x7bdb('0x7'));var interaction=require(_0x7bdb('0x8'));var config=require('../../config/environment');var controller=require(_0x7bdb('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x7bdb('0xa')]);router[_0x7bdb('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x7bdb('0xc')]);router[_0x7bdb('0xb')]('/:id/fields',auth['isAuthenticated'](),controller[_0x7bdb('0xd')]);router[_0x7bdb('0xb')](_0x7bdb('0xe'),auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x10')]);router[_0x7bdb('0xb')](_0x7bdb('0x11'),auth[_0x7bdb('0xf')](),controller['getDescriptions']);router['get']('/:id/tags',auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x12')]);router['post']('/',auth[_0x7bdb('0xf')](),controller['create']);router['post'](_0x7bdb('0x13'),auth[_0x7bdb('0xf')](),controller['setTags']);router['put']('/:id',auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x14')]);router[_0x7bdb('0x15')](_0x7bdb('0x16'),auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x17')]);module[_0x7bdb('0x18')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 512adb7..6a6b909 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 _0x0ff8=['exports','STRING','sequelize'];(function(_0x3abc7f,_0x1aa149){var _0x2decb9=function(_0x4a9a17){while(--_0x4a9a17){_0x3abc7f['push'](_0x3abc7f['shift']());}};_0x2decb9(++_0x1aa149);}(_0x0ff8,0x173));var _0x80ff=function(_0x2c1873,_0x233885){_0x2c1873=_0x2c1873-0x0;var _0x10740a=_0x0ff8[_0x2c1873];return _0x10740a;};'use strict';var Sequelize=require(_0x80ff('0x0'));module[_0x80ff('0x1')]={'name':{'type':Sequelize[_0x80ff('0x2')]},'description':{'type':Sequelize[_0x80ff('0x2')]}}; \ No newline at end of file +var _0x4c04=['exports','STRING'];(function(_0x47e7dd,_0x51b041){var _0x38501f=function(_0x5ba66d){while(--_0x5ba66d){_0x47e7dd['push'](_0x47e7dd['shift']());}};_0x38501f(++_0x51b041);}(_0x4c04,0x6e));var _0x44c0=function(_0x539840,_0x30437b){_0x539840=_0x539840-0x0;var _0x1de8d5=_0x4c04[_0x539840];return _0x1de8d5;};'use strict';var Sequelize=require('sequelize');module[_0x44c0('0x0')]={'name':{'type':Sequelize[_0x44c0('0x1')]},'description':{'type':Sequelize[_0x44c0('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 4d08f27..8a55ec8 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 _0x3cc0=['reject','save','update','then','error','name','send','index','ZendeskConfiguration','rawAttributes','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','merge','includeAll','include','findAll','catch','show','params','options','find','create','body','destroy','getFields','findOne','ZendeskField','filter','getSubjects','getDescriptions','getTags','Tag','setTags','ids','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply'];(function(_0x53c0e8,_0xce2d6f){var _0x10efee=function(_0x2648e1){while(--_0x2648e1){_0x53c0e8['push'](_0x53c0e8['shift']());}};_0x10efee(++_0xce2d6f);}(_0x3cc0,0x182));var _0x03cc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3cc0[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x03cc('0x0'));var zipdir=require(_0x03cc('0x1'));var jsonpatch=require(_0x03cc('0x2'));var rp=require(_0x03cc('0x3'));var moment=require(_0x03cc('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x03cc('0x5'));var util=require('util');var path=require(_0x03cc('0x6'));var sox=require('sox');var csv=require(_0x03cc('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x03cc('0x8'));var _=require(_0x03cc('0x9'));var squel=require(_0x03cc('0xa'));var crypto=require(_0x03cc('0xb'));var jsforce=require(_0x03cc('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x03cc('0x7'));var querystring=require(_0x03cc('0xd'));var Papa=require('papaparse');var Redis=require(_0x03cc('0xe'));var authService=require(_0x03cc('0xf'));var qs=require(_0x03cc('0x10'));var as=require(_0x03cc('0x11'));var hardwareService=require(_0x03cc('0x12'));var logger=require('../../config/logger')(_0x03cc('0x13'));var utils=require(_0x03cc('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x03cc('0x15'));var db=require(_0x03cc('0x16'))['db'];function respondWithStatusCode(_0x4d8b40,_0x1950a3){_0x1950a3=_0x1950a3||0xcc;return function(_0x814e0e){if(_0x814e0e){return _0x4d8b40[_0x03cc('0x17')](_0x1950a3);}return _0x4d8b40['status'](_0x1950a3)[_0x03cc('0x18')]();};}function respondWithResult(_0x5613cb,_0x243dc0){_0x243dc0=_0x243dc0||0xc8;return function(_0x502b68){if(_0x502b68){return _0x5613cb[_0x03cc('0x19')](_0x243dc0)['json'](_0x502b68);}};}function respondWithFilteredResult(_0x4eef7b,_0x5bfb23){return function(_0xd2bbdc){if(_0xd2bbdc){var _0x5d6ce9=typeof _0x5bfb23[_0x03cc('0x1a')]===_0x03cc('0x1b')&&typeof _0x5bfb23[_0x03cc('0x1c')]===_0x03cc('0x1b');var _0x5e0752=_0xd2bbdc[_0x03cc('0x1d')];var _0x219217=_0x5d6ce9?0x0:_0x5bfb23[_0x03cc('0x1a')];var _0x2b4a86=_0x5d6ce9?_0xd2bbdc['count']:_0x5bfb23['offset']+_0x5bfb23[_0x03cc('0x1c')];var _0x1db31e;if(_0x2b4a86>=_0x5e0752){_0x2b4a86=_0x5e0752;_0x1db31e=0xc8;}else{_0x1db31e=0xce;}_0x4eef7b[_0x03cc('0x19')](_0x1db31e);return _0x4eef7b[_0x03cc('0x1e')](_0x03cc('0x1f'),_0x219217+'-'+_0x2b4a86+'/'+_0x5e0752)[_0x03cc('0x20')](_0xd2bbdc);}return null;};}function patchUpdates(_0x1680c2){return function(_0x1dd501){try{jsonpatch[_0x03cc('0x21')](_0x1dd501,_0x1680c2,!![]);}catch(_0x4e0a01){return BPromise[_0x03cc('0x22')](_0x4e0a01);}return _0x1dd501[_0x03cc('0x23')]();};}function saveUpdates(_0xbf545e,_0x3445b0){return function(_0x1f2f70){if(_0x1f2f70){return _0x1f2f70[_0x03cc('0x24')](_0xbf545e)[_0x03cc('0x25')](function(_0x1b4c9c){return _0x1b4c9c;});}return null;};}function removeEntity(_0x2de491,_0x30ba89){return function(_0x488260){if(_0x488260){return _0x488260['destroy']()[_0x03cc('0x25')](function(){_0x2de491[_0x03cc('0x19')](0xcc)[_0x03cc('0x18')]();});}};}function handleEntityNotFound(_0x3bdd60,_0x5780dc){return function(_0x2f5105){if(!_0x2f5105){_0x3bdd60['sendStatus'](0x194);}return _0x2f5105;};}function handleError(_0x33dc34,_0x5884ef){_0x5884ef=_0x5884ef||0x1f4;return function(_0x271ae9){logger[_0x03cc('0x26')](_0x271ae9['stack']);if(_0x271ae9[_0x03cc('0x27')]){delete _0x271ae9[_0x03cc('0x27')];}_0x33dc34[_0x03cc('0x19')](_0x5884ef)[_0x03cc('0x28')](_0x271ae9);};}exports[_0x03cc('0x29')]=function(_0x557a17,_0x4307fd){var _0x1408e8={},_0x1c0b00={},_0x5a48b5={'count':0x0,'rows':[]};var _0x1de0e5=_['map'](db[_0x03cc('0x2a')][_0x03cc('0x2b')],function(_0x440544){return{'name':_0x440544['fieldName'],'type':_0x440544[_0x03cc('0x2c')][_0x03cc('0x2d')]};});_0x1c0b00[_0x03cc('0x2e')]=_[_0x03cc('0x2f')](_0x1de0e5,_0x03cc('0x27'));_0x1c0b00[_0x03cc('0x30')]=_[_0x03cc('0x31')](_0x557a17[_0x03cc('0x30')]);_0x1c0b00[_0x03cc('0x32')]=_[_0x03cc('0x33')](_0x1c0b00['model'],_0x1c0b00[_0x03cc('0x30')]);_0x1408e8['attributes']=_[_0x03cc('0x33')](_0x1c0b00[_0x03cc('0x2e')],qs[_0x03cc('0x34')](_0x557a17[_0x03cc('0x30')]['fields']));_0x1408e8[_0x03cc('0x35')]=_0x1408e8[_0x03cc('0x35')][_0x03cc('0x36')]?_0x1408e8['attributes']:_0x1c0b00[_0x03cc('0x2e')];if(!_0x557a17[_0x03cc('0x30')][_0x03cc('0x37')](_0x03cc('0x38'))){_0x1408e8[_0x03cc('0x1c')]=qs[_0x03cc('0x1c')](_0x557a17[_0x03cc('0x30')][_0x03cc('0x1c')]);_0x1408e8[_0x03cc('0x1a')]=qs['offset'](_0x557a17[_0x03cc('0x30')][_0x03cc('0x1a')]);}_0x1408e8[_0x03cc('0x39')]=qs[_0x03cc('0x3a')](_0x557a17['query'][_0x03cc('0x3a')]);_0x1408e8[_0x03cc('0x3b')]=qs[_0x03cc('0x32')](_[_0x03cc('0x3c')](_0x557a17[_0x03cc('0x30')],_0x1c0b00[_0x03cc('0x32')]),_0x1de0e5);if(_0x557a17[_0x03cc('0x30')]['filter']){_0x1408e8[_0x03cc('0x3b')]=_['merge'](_0x1408e8[_0x03cc('0x3b')],{'$or':_[_0x03cc('0x2f')](_0x1de0e5,function(_0x5be486){if(_0x5be486[_0x03cc('0x2c')]!==_0x03cc('0x3d')){var _0x5eaf65={};_0x5eaf65[_0x5be486[_0x03cc('0x27')]]={'$like':'%'+_0x557a17['query']['filter']+'%'};return _0x5eaf65;}})});}_0x1408e8=_[_0x03cc('0x3e')]({},_0x1408e8,_0x557a17['options']);var _0xd36e95={'where':_0x1408e8[_0x03cc('0x3b')]};return db[_0x03cc('0x2a')]['count'](_0xd36e95)['then'](function(_0xae52e){_0x5a48b5[_0x03cc('0x1d')]=_0xae52e;if(_0x557a17[_0x03cc('0x30')][_0x03cc('0x3f')]){_0x1408e8[_0x03cc('0x40')]=[{'all':!![]}];}return db[_0x03cc('0x2a')][_0x03cc('0x41')](_0x1408e8);})[_0x03cc('0x25')](function(_0x5e9e35){_0x5a48b5['rows']=_0x5e9e35;return _0x5a48b5;})[_0x03cc('0x25')](respondWithFilteredResult(_0x4307fd,_0x1408e8))[_0x03cc('0x42')](handleError(_0x4307fd,null));};exports[_0x03cc('0x43')]=function(_0x2e6485,_0x554c4e){var _0x686fae={'raw':![],'where':{'id':_0x2e6485[_0x03cc('0x44')]['id']}},_0x124755={};_0x124755[_0x03cc('0x2e')]=_[_0x03cc('0x31')](db[_0x03cc('0x2a')]['rawAttributes']);_0x124755[_0x03cc('0x30')]=_[_0x03cc('0x31')](_0x2e6485[_0x03cc('0x30')]);_0x124755['filters']=_[_0x03cc('0x33')](_0x124755['model'],_0x124755[_0x03cc('0x30')]);_0x686fae['attributes']=_[_0x03cc('0x33')](_0x124755['model'],qs[_0x03cc('0x34')](_0x2e6485[_0x03cc('0x30')]['fields']));_0x686fae[_0x03cc('0x35')]=_0x686fae[_0x03cc('0x35')][_0x03cc('0x36')]?_0x686fae[_0x03cc('0x35')]:_0x124755['model'];if(_0x2e6485['query']['includeAll']){_0x686fae[_0x03cc('0x40')]=[{'all':!![]}];}_0x686fae=_[_0x03cc('0x3e')]({},_0x686fae,_0x2e6485[_0x03cc('0x45')]);return db[_0x03cc('0x2a')][_0x03cc('0x46')](_0x686fae)[_0x03cc('0x25')](handleEntityNotFound(_0x554c4e,null))[_0x03cc('0x25')](respondWithResult(_0x554c4e,null))[_0x03cc('0x42')](handleError(_0x554c4e,null));};exports['create']=function(_0x1a96e3,_0x40ad5f){return db[_0x03cc('0x2a')][_0x03cc('0x47')](_0x1a96e3['body'],{})['then'](respondWithResult(_0x40ad5f,0xc9))[_0x03cc('0x42')](handleError(_0x40ad5f,null));};exports[_0x03cc('0x24')]=function(_0x3c1c2b,_0x5b443e){if(_0x3c1c2b[_0x03cc('0x48')]['id']){delete _0x3c1c2b[_0x03cc('0x48')]['id'];}return db[_0x03cc('0x2a')][_0x03cc('0x46')]({'where':{'id':_0x3c1c2b[_0x03cc('0x44')]['id']}})[_0x03cc('0x25')](handleEntityNotFound(_0x5b443e,null))[_0x03cc('0x25')](saveUpdates(_0x3c1c2b[_0x03cc('0x48')],null))['then'](respondWithResult(_0x5b443e,null))[_0x03cc('0x42')](handleError(_0x5b443e,null));};exports[_0x03cc('0x49')]=function(_0x4090e3,_0x1e21e3){return db['ZendeskConfiguration'][_0x03cc('0x46')]({'where':{'id':_0x4090e3['params']['id']}})[_0x03cc('0x25')](handleEntityNotFound(_0x1e21e3,null))['then'](removeEntity(_0x1e21e3,null))[_0x03cc('0x42')](handleError(_0x1e21e3,null));};exports[_0x03cc('0x4a')]=function(_0x117a71,_0x485a94,_0x1c6357){var _0x238d09={};var _0x58bb76={};var _0x3a5a4c;var _0x927c99;return db[_0x03cc('0x2a')][_0x03cc('0x4b')]({'where':{'id':_0x117a71['params']['id']}})[_0x03cc('0x25')](handleEntityNotFound(_0x485a94,null))[_0x03cc('0x25')](function(_0x282250){if(_0x282250){_0x3a5a4c=_0x282250;_0x58bb76['model']=_[_0x03cc('0x31')](db[_0x03cc('0x4c')]['rawAttributes']);_0x58bb76[_0x03cc('0x30')]=_['keys'](_0x117a71[_0x03cc('0x30')]);_0x58bb76['filters']=_[_0x03cc('0x33')](_0x58bb76['model'],_0x58bb76[_0x03cc('0x30')]);_0x238d09[_0x03cc('0x35')]=_['intersection'](_0x58bb76[_0x03cc('0x2e')],qs[_0x03cc('0x34')](_0x117a71['query']['fields']));_0x238d09[_0x03cc('0x35')]=_0x238d09[_0x03cc('0x35')][_0x03cc('0x36')]?_0x238d09[_0x03cc('0x35')]:_0x58bb76[_0x03cc('0x2e')];_0x238d09['order']=qs[_0x03cc('0x3a')](_0x117a71['query'][_0x03cc('0x3a')]);_0x238d09[_0x03cc('0x3b')]=qs['filters'](_[_0x03cc('0x3c')](_0x117a71[_0x03cc('0x30')],_0x58bb76[_0x03cc('0x32')]));if(_0x117a71[_0x03cc('0x30')]['filter']){_0x238d09[_0x03cc('0x3b')]=_['merge'](_0x238d09[_0x03cc('0x3b')],{'$or':_[_0x03cc('0x2f')](_0x238d09[_0x03cc('0x35')],function(_0x2a80dd){var _0x295f04={};_0x295f04[_0x2a80dd]={'$like':'%'+_0x117a71[_0x03cc('0x30')][_0x03cc('0x4d')]+'%'};return _0x295f04;})});}_0x238d09=_[_0x03cc('0x3e')]({},_0x238d09,_0x117a71[_0x03cc('0x45')]);return _0x3a5a4c['getFields'](_0x238d09);}})[_0x03cc('0x25')](function(_0x38cb1a){if(_0x38cb1a){_0x927c99=_0x38cb1a['length'];if(!_0x117a71[_0x03cc('0x30')][_0x03cc('0x37')]('nolimit')){_0x238d09[_0x03cc('0x1c')]=qs[_0x03cc('0x1c')](_0x117a71[_0x03cc('0x30')][_0x03cc('0x1c')]);_0x238d09['offset']=qs[_0x03cc('0x1a')](_0x117a71[_0x03cc('0x30')][_0x03cc('0x1a')]);}return _0x3a5a4c[_0x03cc('0x4a')](_0x238d09);}})['then'](function(_0x1e4553){if(_0x1e4553){return _0x1e4553?{'count':_0x927c99,'rows':_0x1e4553}:null;}})[_0x03cc('0x25')](respondWithResult(_0x485a94,null))[_0x03cc('0x42')](handleError(_0x485a94,null));};exports[_0x03cc('0x4e')]=function(_0x11af88,_0x38a7df,_0x18678e){var _0x3a487e={};var _0x2b39cb={};var _0x1873ac;var _0x6d161d;return db[_0x03cc('0x2a')][_0x03cc('0x4b')]({'where':{'id':_0x11af88[_0x03cc('0x44')]['id']}})[_0x03cc('0x25')](handleEntityNotFound(_0x38a7df,null))[_0x03cc('0x25')](function(_0x480663){if(_0x480663){_0x1873ac=_0x480663;_0x2b39cb[_0x03cc('0x2e')]=_[_0x03cc('0x31')](db['ZendeskField'][_0x03cc('0x2b')]);_0x2b39cb[_0x03cc('0x30')]=_[_0x03cc('0x31')](_0x11af88[_0x03cc('0x30')]);_0x2b39cb[_0x03cc('0x32')]=_[_0x03cc('0x33')](_0x2b39cb['model'],_0x2b39cb[_0x03cc('0x30')]);_0x3a487e[_0x03cc('0x35')]=_[_0x03cc('0x33')](_0x2b39cb[_0x03cc('0x2e')],qs[_0x03cc('0x34')](_0x11af88['query'][_0x03cc('0x34')]));_0x3a487e['attributes']=_0x3a487e[_0x03cc('0x35')][_0x03cc('0x36')]?_0x3a487e[_0x03cc('0x35')]:_0x2b39cb[_0x03cc('0x2e')];_0x3a487e[_0x03cc('0x39')]=qs[_0x03cc('0x3a')](_0x11af88[_0x03cc('0x30')][_0x03cc('0x3a')]);_0x3a487e[_0x03cc('0x3b')]=qs[_0x03cc('0x32')](_[_0x03cc('0x3c')](_0x11af88[_0x03cc('0x30')],_0x2b39cb[_0x03cc('0x32')]));if(_0x11af88[_0x03cc('0x30')][_0x03cc('0x4d')]){_0x3a487e[_0x03cc('0x3b')]=_[_0x03cc('0x3e')](_0x3a487e[_0x03cc('0x3b')],{'$or':_[_0x03cc('0x2f')](_0x3a487e[_0x03cc('0x35')],function(_0x1473d4){var _0x1579ec={};_0x1579ec[_0x1473d4]={'$like':'%'+_0x11af88[_0x03cc('0x30')]['filter']+'%'};return _0x1579ec;})});}_0x3a487e=_[_0x03cc('0x3e')]({},_0x3a487e,_0x11af88[_0x03cc('0x45')]);return _0x1873ac[_0x03cc('0x4e')](_0x3a487e);}})[_0x03cc('0x25')](function(_0x1c68c2){if(_0x1c68c2){_0x6d161d=_0x1c68c2[_0x03cc('0x36')];if(!_0x11af88['query'][_0x03cc('0x37')](_0x03cc('0x38'))){_0x3a487e['limit']=qs[_0x03cc('0x1c')](_0x11af88[_0x03cc('0x30')][_0x03cc('0x1c')]);_0x3a487e[_0x03cc('0x1a')]=qs[_0x03cc('0x1a')](_0x11af88['query'][_0x03cc('0x1a')]);}return _0x1873ac['getSubjects'](_0x3a487e);}})[_0x03cc('0x25')](function(_0x36b76e){if(_0x36b76e){return _0x36b76e?{'count':_0x6d161d,'rows':_0x36b76e}:null;}})[_0x03cc('0x25')](respondWithResult(_0x38a7df,null))[_0x03cc('0x42')](handleError(_0x38a7df,null));};exports[_0x03cc('0x4f')]=function(_0x35a5b5,_0x30a063,_0x25f64b){var _0x5d864b={};var _0x321904={};var _0x23a584;var _0x324403;return db[_0x03cc('0x2a')]['findOne']({'where':{'id':_0x35a5b5['params']['id']}})['then'](handleEntityNotFound(_0x30a063,null))['then'](function(_0x49844d){if(_0x49844d){_0x23a584=_0x49844d;_0x321904[_0x03cc('0x2e')]=_[_0x03cc('0x31')](db[_0x03cc('0x4c')][_0x03cc('0x2b')]);_0x321904[_0x03cc('0x30')]=_[_0x03cc('0x31')](_0x35a5b5[_0x03cc('0x30')]);_0x321904[_0x03cc('0x32')]=_['intersection'](_0x321904[_0x03cc('0x2e')],_0x321904['query']);_0x5d864b['attributes']=_['intersection'](_0x321904[_0x03cc('0x2e')],qs[_0x03cc('0x34')](_0x35a5b5[_0x03cc('0x30')][_0x03cc('0x34')]));_0x5d864b[_0x03cc('0x35')]=_0x5d864b[_0x03cc('0x35')]['length']?_0x5d864b[_0x03cc('0x35')]:_0x321904[_0x03cc('0x2e')];_0x5d864b[_0x03cc('0x39')]=qs[_0x03cc('0x3a')](_0x35a5b5[_0x03cc('0x30')][_0x03cc('0x3a')]);_0x5d864b['where']=qs[_0x03cc('0x32')](_[_0x03cc('0x3c')](_0x35a5b5[_0x03cc('0x30')],_0x321904['filters']));if(_0x35a5b5['query'][_0x03cc('0x4d')]){_0x5d864b['where']=_[_0x03cc('0x3e')](_0x5d864b[_0x03cc('0x3b')],{'$or':_[_0x03cc('0x2f')](_0x5d864b[_0x03cc('0x35')],function(_0x5207ba){var _0x4ebf61={};_0x4ebf61[_0x5207ba]={'$like':'%'+_0x35a5b5[_0x03cc('0x30')][_0x03cc('0x4d')]+'%'};return _0x4ebf61;})});}_0x5d864b=_['merge']({},_0x5d864b,_0x35a5b5[_0x03cc('0x45')]);return _0x23a584[_0x03cc('0x4f')](_0x5d864b);}})[_0x03cc('0x25')](function(_0xa2cf0a){if(_0xa2cf0a){_0x324403=_0xa2cf0a[_0x03cc('0x36')];if(!_0x35a5b5[_0x03cc('0x30')]['hasOwnProperty'](_0x03cc('0x38'))){_0x5d864b[_0x03cc('0x1c')]=qs[_0x03cc('0x1c')](_0x35a5b5['query']['limit']);_0x5d864b[_0x03cc('0x1a')]=qs['offset'](_0x35a5b5['query'][_0x03cc('0x1a')]);}return _0x23a584[_0x03cc('0x4f')](_0x5d864b);}})[_0x03cc('0x25')](function(_0x4417e2){if(_0x4417e2){return _0x4417e2?{'count':_0x324403,'rows':_0x4417e2}:null;}})['then'](respondWithResult(_0x30a063,null))[_0x03cc('0x42')](handleError(_0x30a063,null));};exports[_0x03cc('0x50')]=function(_0x1e5754,_0x51cfe0,_0x260d93){var _0x157805={};var _0x5440be={};var _0x2fe54c;var _0x9f9d1c;return db[_0x03cc('0x2a')][_0x03cc('0x4b')]({'where':{'id':_0x1e5754[_0x03cc('0x44')]['id']}})[_0x03cc('0x25')](handleEntityNotFound(_0x51cfe0,null))[_0x03cc('0x25')](function(_0x597553){if(_0x597553){_0x2fe54c=_0x597553;_0x5440be[_0x03cc('0x2e')]=_[_0x03cc('0x31')](db[_0x03cc('0x51')][_0x03cc('0x2b')]);_0x5440be[_0x03cc('0x30')]=_['keys'](_0x1e5754[_0x03cc('0x30')]);_0x5440be[_0x03cc('0x32')]=_['intersection'](_0x5440be[_0x03cc('0x2e')],_0x5440be[_0x03cc('0x30')]);_0x157805[_0x03cc('0x35')]=_['intersection'](_0x5440be[_0x03cc('0x2e')],qs[_0x03cc('0x34')](_0x1e5754[_0x03cc('0x30')]['fields']));_0x157805['attributes']=_0x157805[_0x03cc('0x35')][_0x03cc('0x36')]?_0x157805[_0x03cc('0x35')]:_0x5440be[_0x03cc('0x2e')];_0x157805['order']=qs[_0x03cc('0x3a')](_0x1e5754[_0x03cc('0x30')]['sort']);_0x157805['where']=qs[_0x03cc('0x32')](_[_0x03cc('0x3c')](_0x1e5754[_0x03cc('0x30')],_0x5440be[_0x03cc('0x32')]));if(_0x1e5754[_0x03cc('0x30')][_0x03cc('0x4d')]){_0x157805['where']=_[_0x03cc('0x3e')](_0x157805[_0x03cc('0x3b')],{'$or':_[_0x03cc('0x2f')](_0x157805[_0x03cc('0x35')],function(_0x377fdd){var _0xf4a12e={};_0xf4a12e[_0x377fdd]={'$like':'%'+_0x1e5754[_0x03cc('0x30')][_0x03cc('0x4d')]+'%'};return _0xf4a12e;})});}_0x157805=_['merge']({},_0x157805,_0x1e5754['options']);return _0x2fe54c[_0x03cc('0x50')](_0x157805);}})[_0x03cc('0x25')](function(_0x2b5690){if(_0x2b5690){_0x9f9d1c=_0x2b5690['length'];if(!_0x1e5754['query'][_0x03cc('0x37')](_0x03cc('0x38'))){_0x157805[_0x03cc('0x1c')]=qs[_0x03cc('0x1c')](_0x1e5754[_0x03cc('0x30')][_0x03cc('0x1c')]);_0x157805[_0x03cc('0x1a')]=qs[_0x03cc('0x1a')](_0x1e5754[_0x03cc('0x30')][_0x03cc('0x1a')]);}return _0x2fe54c[_0x03cc('0x50')](_0x157805);}})[_0x03cc('0x25')](function(_0x1cdb13){if(_0x1cdb13){return _0x1cdb13?{'count':_0x9f9d1c,'rows':_0x1cdb13}:null;}})['then'](respondWithResult(_0x51cfe0,null))['catch'](handleError(_0x51cfe0,null));};exports[_0x03cc('0x52')]=function(_0x2180a2,_0x1bfd01,_0x383d99){if(_0x2180a2[_0x03cc('0x48')]['id']){delete _0x2180a2[_0x03cc('0x48')]['id'];}return db[_0x03cc('0x2a')]['findOne']({'where':{'id':_0x2180a2['params']['id']}})[_0x03cc('0x25')](handleEntityNotFound(_0x1bfd01,null))[_0x03cc('0x25')](function(_0x172b51){if(_0x172b51){return _0x172b51['setTags'](_0x2180a2['body'][_0x03cc('0x53')]||[]);}return null;})[_0x03cc('0x25')](respondWithResult(_0x1bfd01,null))[_0x03cc('0x42')](handleError(_0x1bfd01,null));}; \ No newline at end of file +var _0x130a=['limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','ZendeskConfiguration','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','getFields','ZendeskField','findOne','getSubjects','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count'];(function(_0x2df507,_0x553862){var _0x1f7167=function(_0x11319e){while(--_0x11319e){_0x2df507['push'](_0x2df507['shift']());}};_0x1f7167(++_0x553862);}(_0x130a,0xdf));var _0xa130=function(_0xf2662b,_0x4d8f41){_0xf2662b=_0xf2662b-0x0;var _0x257dc7=_0x130a[_0xf2662b];return _0x257dc7;};'use strict';var emlformat=require(_0xa130('0x0'));var rimraf=require(_0xa130('0x1'));var zipdir=require(_0xa130('0x2'));var jsonpatch=require(_0xa130('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa130('0x4'));var Mustache=require(_0xa130('0x5'));var util=require(_0xa130('0x6'));var path=require(_0xa130('0x7'));var sox=require('sox');var csv=require(_0xa130('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa130('0x9'));var _=require(_0xa130('0xa'));var squel=require(_0xa130('0xb'));var crypto=require(_0xa130('0xc'));var jsforce=require(_0xa130('0xd'));var deskjs=require(_0xa130('0xe'));var toCsv=require(_0xa130('0x8'));var querystring=require(_0xa130('0xf'));var Papa=require(_0xa130('0x10'));var Redis=require(_0xa130('0x11'));var authService=require(_0xa130('0x12'));var qs=require(_0xa130('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa130('0x14'))(_0xa130('0x15'));var utils=require('../../config/utils');var config=require(_0xa130('0x16'));var licenseUtil=require(_0xa130('0x17'));var db=require(_0xa130('0x18'))['db'];function respondWithStatusCode(_0x3d180c,_0x4f0c99){_0x4f0c99=_0x4f0c99||0xcc;return function(_0x46bf8b){if(_0x46bf8b){return _0x3d180c[_0xa130('0x19')](_0x4f0c99);}return _0x3d180c[_0xa130('0x1a')](_0x4f0c99)[_0xa130('0x1b')]();};}function respondWithResult(_0x307c4e,_0x25bdc1){_0x25bdc1=_0x25bdc1||0xc8;return function(_0x11d628){if(_0x11d628){return _0x307c4e[_0xa130('0x1a')](_0x25bdc1)[_0xa130('0x1c')](_0x11d628);}};}function respondWithFilteredResult(_0x2ab42b,_0x10c039){return function(_0x19a761){if(_0x19a761){var _0x101b21=typeof _0x10c039[_0xa130('0x1d')]===_0xa130('0x1e')&&typeof _0x10c039['limit']===_0xa130('0x1e');var _0x1dd6d9=_0x19a761[_0xa130('0x1f')];var _0x4350a4=_0x101b21?0x0:_0x10c039[_0xa130('0x1d')];var _0x11734b=_0x101b21?_0x19a761[_0xa130('0x1f')]:_0x10c039[_0xa130('0x1d')]+_0x10c039[_0xa130('0x20')];var _0x33daf1;if(_0x11734b>=_0x1dd6d9){_0x11734b=_0x1dd6d9;_0x33daf1=0xc8;}else{_0x33daf1=0xce;}_0x2ab42b['status'](_0x33daf1);return _0x2ab42b[_0xa130('0x21')](_0xa130('0x22'),_0x4350a4+'-'+_0x11734b+'/'+_0x1dd6d9)[_0xa130('0x1c')](_0x19a761);}return null;};}function patchUpdates(_0x7162e4){return function(_0x414aee){try{jsonpatch[_0xa130('0x23')](_0x414aee,_0x7162e4,!![]);}catch(_0xc77b7){return BPromise['reject'](_0xc77b7);}return _0x414aee[_0xa130('0x24')]();};}function saveUpdates(_0x4b5d3e,_0x5d5527){return function(_0x488ea5){if(_0x488ea5){return _0x488ea5[_0xa130('0x25')](_0x4b5d3e)[_0xa130('0x26')](function(_0x219f43){return _0x219f43;});}return null;};}function removeEntity(_0x506a5f,_0x383d58){return function(_0x514e75){if(_0x514e75){return _0x514e75[_0xa130('0x27')]()[_0xa130('0x26')](function(){_0x506a5f['status'](0xcc)[_0xa130('0x1b')]();});}};}function handleEntityNotFound(_0x358e05,_0x578f77){return function(_0x1b647b){if(!_0x1b647b){_0x358e05[_0xa130('0x19')](0x194);}return _0x1b647b;};}function handleError(_0x346f01,_0x4b19ae){_0x4b19ae=_0x4b19ae||0x1f4;return function(_0x1dee71){logger[_0xa130('0x28')](_0x1dee71[_0xa130('0x29')]);if(_0x1dee71[_0xa130('0x2a')]){delete _0x1dee71['name'];}_0x346f01[_0xa130('0x1a')](_0x4b19ae)[_0xa130('0x2b')](_0x1dee71);};}exports[_0xa130('0x2c')]=function(_0x573911,_0x4e02c4){var _0x357644={},_0x16669e={},_0x5f22e9={'count':0x0,'rows':[]};var _0x3f8b2c=_[_0xa130('0x2d')](db[_0xa130('0x2e')]['rawAttributes'],function(_0x13ea49){return{'name':_0x13ea49[_0xa130('0x2f')],'type':_0x13ea49[_0xa130('0x30')][_0xa130('0x31')]};});_0x16669e[_0xa130('0x32')]=_[_0xa130('0x2d')](_0x3f8b2c,_0xa130('0x2a'));_0x16669e[_0xa130('0x33')]=_[_0xa130('0x34')](_0x573911['query']);_0x16669e[_0xa130('0x35')]=_[_0xa130('0x36')](_0x16669e[_0xa130('0x32')],_0x16669e[_0xa130('0x33')]);_0x357644['attributes']=_[_0xa130('0x36')](_0x16669e[_0xa130('0x32')],qs[_0xa130('0x37')](_0x573911[_0xa130('0x33')][_0xa130('0x37')]));_0x357644[_0xa130('0x38')]=_0x357644[_0xa130('0x38')][_0xa130('0x39')]?_0x357644[_0xa130('0x38')]:_0x16669e[_0xa130('0x32')];if(!_0x573911[_0xa130('0x33')][_0xa130('0x3a')](_0xa130('0x3b'))){_0x357644['limit']=qs['limit'](_0x573911[_0xa130('0x33')][_0xa130('0x20')]);_0x357644['offset']=qs[_0xa130('0x1d')](_0x573911['query'][_0xa130('0x1d')]);}_0x357644[_0xa130('0x3c')]=qs[_0xa130('0x3d')](_0x573911[_0xa130('0x33')]['sort']);_0x357644[_0xa130('0x3e')]=qs['filters'](_[_0xa130('0x3f')](_0x573911['query'],_0x16669e[_0xa130('0x35')]),_0x3f8b2c);if(_0x573911['query'][_0xa130('0x40')]){_0x357644[_0xa130('0x3e')]=_['merge'](_0x357644[_0xa130('0x3e')],{'$or':_[_0xa130('0x2d')](_0x3f8b2c,function(_0xe740c4){if(_0xe740c4[_0xa130('0x30')]!=='VIRTUAL'){var _0x38c86f={};_0x38c86f[_0xe740c4[_0xa130('0x2a')]]={'$like':'%'+_0x573911['query'][_0xa130('0x40')]+'%'};return _0x38c86f;}})});}_0x357644=_[_0xa130('0x41')]({},_0x357644,_0x573911[_0xa130('0x42')]);var _0x18304b={'where':_0x357644[_0xa130('0x3e')]};return db['ZendeskConfiguration'][_0xa130('0x1f')](_0x18304b)[_0xa130('0x26')](function(_0x1012b4){_0x5f22e9[_0xa130('0x1f')]=_0x1012b4;if(_0x573911[_0xa130('0x33')][_0xa130('0x43')]){_0x357644[_0xa130('0x44')]=[{'all':!![]}];}return db[_0xa130('0x2e')][_0xa130('0x45')](_0x357644);})[_0xa130('0x26')](function(_0x2e0fe9){_0x5f22e9[_0xa130('0x46')]=_0x2e0fe9;return _0x5f22e9;})[_0xa130('0x26')](respondWithFilteredResult(_0x4e02c4,_0x357644))[_0xa130('0x47')](handleError(_0x4e02c4,null));};exports[_0xa130('0x48')]=function(_0x38c745,_0x5b5cbe){var _0x5bfc93={'raw':![],'where':{'id':_0x38c745[_0xa130('0x49')]['id']}},_0x4ee1e8={};_0x4ee1e8[_0xa130('0x32')]=_[_0xa130('0x34')](db[_0xa130('0x2e')][_0xa130('0x4a')]);_0x4ee1e8[_0xa130('0x33')]=_[_0xa130('0x34')](_0x38c745[_0xa130('0x33')]);_0x4ee1e8[_0xa130('0x35')]=_['intersection'](_0x4ee1e8[_0xa130('0x32')],_0x4ee1e8[_0xa130('0x33')]);_0x5bfc93[_0xa130('0x38')]=_['intersection'](_0x4ee1e8[_0xa130('0x32')],qs[_0xa130('0x37')](_0x38c745[_0xa130('0x33')]['fields']));_0x5bfc93[_0xa130('0x38')]=_0x5bfc93[_0xa130('0x38')][_0xa130('0x39')]?_0x5bfc93['attributes']:_0x4ee1e8[_0xa130('0x32')];if(_0x38c745[_0xa130('0x33')]['includeAll']){_0x5bfc93[_0xa130('0x44')]=[{'all':!![]}];}_0x5bfc93=_[_0xa130('0x41')]({},_0x5bfc93,_0x38c745[_0xa130('0x42')]);return db[_0xa130('0x2e')]['find'](_0x5bfc93)['then'](handleEntityNotFound(_0x5b5cbe,null))[_0xa130('0x26')](respondWithResult(_0x5b5cbe,null))[_0xa130('0x47')](handleError(_0x5b5cbe,null));};exports[_0xa130('0x4b')]=function(_0x2f5d8c,_0xafeced){return db[_0xa130('0x2e')]['create'](_0x2f5d8c[_0xa130('0x4c')],{})['then'](respondWithResult(_0xafeced,0xc9))[_0xa130('0x47')](handleError(_0xafeced,null));};exports[_0xa130('0x25')]=function(_0x22a1ae,_0x149055){if(_0x22a1ae[_0xa130('0x4c')]['id']){delete _0x22a1ae[_0xa130('0x4c')]['id'];}return db['ZendeskConfiguration'][_0xa130('0x4d')]({'where':{'id':_0x22a1ae[_0xa130('0x49')]['id']}})[_0xa130('0x26')](handleEntityNotFound(_0x149055,null))['then'](saveUpdates(_0x22a1ae['body'],null))[_0xa130('0x26')](respondWithResult(_0x149055,null))[_0xa130('0x47')](handleError(_0x149055,null));};exports['destroy']=function(_0x1167ae,_0x1f3a4a){return db[_0xa130('0x2e')][_0xa130('0x4d')]({'where':{'id':_0x1167ae[_0xa130('0x49')]['id']}})['then'](handleEntityNotFound(_0x1f3a4a,null))[_0xa130('0x26')](removeEntity(_0x1f3a4a,null))[_0xa130('0x47')](handleError(_0x1f3a4a,null));};exports[_0xa130('0x4e')]=function(_0x5557ff,_0x355c07,_0x1ad99d){var _0x2b63ca={};var _0x40b1fd={};var _0x46d3b0;var _0x8c4fb;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x5557ff[_0xa130('0x49')]['id']}})['then'](handleEntityNotFound(_0x355c07,null))[_0xa130('0x26')](function(_0x4005d6){if(_0x4005d6){_0x46d3b0=_0x4005d6;_0x40b1fd[_0xa130('0x32')]=_['keys'](db[_0xa130('0x4f')][_0xa130('0x4a')]);_0x40b1fd['query']=_[_0xa130('0x34')](_0x5557ff['query']);_0x40b1fd[_0xa130('0x35')]=_['intersection'](_0x40b1fd[_0xa130('0x32')],_0x40b1fd[_0xa130('0x33')]);_0x2b63ca[_0xa130('0x38')]=_[_0xa130('0x36')](_0x40b1fd['model'],qs[_0xa130('0x37')](_0x5557ff['query'][_0xa130('0x37')]));_0x2b63ca[_0xa130('0x38')]=_0x2b63ca['attributes'][_0xa130('0x39')]?_0x2b63ca[_0xa130('0x38')]:_0x40b1fd['model'];_0x2b63ca['order']=qs[_0xa130('0x3d')](_0x5557ff[_0xa130('0x33')]['sort']);_0x2b63ca[_0xa130('0x3e')]=qs[_0xa130('0x35')](_['pick'](_0x5557ff[_0xa130('0x33')],_0x40b1fd[_0xa130('0x35')]));if(_0x5557ff[_0xa130('0x33')][_0xa130('0x40')]){_0x2b63ca['where']=_[_0xa130('0x41')](_0x2b63ca[_0xa130('0x3e')],{'$or':_[_0xa130('0x2d')](_0x2b63ca[_0xa130('0x38')],function(_0x3df7e8){var _0x3e1ead={};_0x3e1ead[_0x3df7e8]={'$like':'%'+_0x5557ff['query']['filter']+'%'};return _0x3e1ead;})});}_0x2b63ca=_[_0xa130('0x41')]({},_0x2b63ca,_0x5557ff[_0xa130('0x42')]);return _0x46d3b0[_0xa130('0x4e')](_0x2b63ca);}})[_0xa130('0x26')](function(_0x380b15){if(_0x380b15){_0x8c4fb=_0x380b15[_0xa130('0x39')];if(!_0x5557ff['query'][_0xa130('0x3a')]('nolimit')){_0x2b63ca[_0xa130('0x20')]=qs[_0xa130('0x20')](_0x5557ff['query'][_0xa130('0x20')]);_0x2b63ca[_0xa130('0x1d')]=qs[_0xa130('0x1d')](_0x5557ff[_0xa130('0x33')]['offset']);}return _0x46d3b0['getFields'](_0x2b63ca);}})['then'](function(_0x9668f0){if(_0x9668f0){return _0x9668f0?{'count':_0x8c4fb,'rows':_0x9668f0}:null;}})['then'](respondWithResult(_0x355c07,null))[_0xa130('0x47')](handleError(_0x355c07,null));};exports['getSubjects']=function(_0x54d0b4,_0x123ec2,_0x219b0c){var _0x2d6feb={};var _0x349812={};var _0x1accf4;var _0x467691;return db['ZendeskConfiguration'][_0xa130('0x50')]({'where':{'id':_0x54d0b4['params']['id']}})[_0xa130('0x26')](handleEntityNotFound(_0x123ec2,null))['then'](function(_0x139d7f){if(_0x139d7f){_0x1accf4=_0x139d7f;_0x349812[_0xa130('0x32')]=_[_0xa130('0x34')](db[_0xa130('0x4f')][_0xa130('0x4a')]);_0x349812[_0xa130('0x33')]=_[_0xa130('0x34')](_0x54d0b4['query']);_0x349812['filters']=_[_0xa130('0x36')](_0x349812['model'],_0x349812[_0xa130('0x33')]);_0x2d6feb['attributes']=_[_0xa130('0x36')](_0x349812[_0xa130('0x32')],qs['fields'](_0x54d0b4[_0xa130('0x33')]['fields']));_0x2d6feb[_0xa130('0x38')]=_0x2d6feb['attributes'][_0xa130('0x39')]?_0x2d6feb[_0xa130('0x38')]:_0x349812[_0xa130('0x32')];_0x2d6feb[_0xa130('0x3c')]=qs[_0xa130('0x3d')](_0x54d0b4[_0xa130('0x33')][_0xa130('0x3d')]);_0x2d6feb[_0xa130('0x3e')]=qs[_0xa130('0x35')](_['pick'](_0x54d0b4[_0xa130('0x33')],_0x349812[_0xa130('0x35')]));if(_0x54d0b4[_0xa130('0x33')][_0xa130('0x40')]){_0x2d6feb[_0xa130('0x3e')]=_[_0xa130('0x41')](_0x2d6feb[_0xa130('0x3e')],{'$or':_['map'](_0x2d6feb[_0xa130('0x38')],function(_0xdb20c3){var _0x3fdfa5={};_0x3fdfa5[_0xdb20c3]={'$like':'%'+_0x54d0b4[_0xa130('0x33')][_0xa130('0x40')]+'%'};return _0x3fdfa5;})});}_0x2d6feb=_[_0xa130('0x41')]({},_0x2d6feb,_0x54d0b4[_0xa130('0x42')]);return _0x1accf4[_0xa130('0x51')](_0x2d6feb);}})[_0xa130('0x26')](function(_0x4911ed){if(_0x4911ed){_0x467691=_0x4911ed[_0xa130('0x39')];if(!_0x54d0b4[_0xa130('0x33')][_0xa130('0x3a')]('nolimit')){_0x2d6feb[_0xa130('0x20')]=qs[_0xa130('0x20')](_0x54d0b4[_0xa130('0x33')][_0xa130('0x20')]);_0x2d6feb['offset']=qs['offset'](_0x54d0b4['query'][_0xa130('0x1d')]);}return _0x1accf4[_0xa130('0x51')](_0x2d6feb);}})[_0xa130('0x26')](function(_0x3fad7d){if(_0x3fad7d){return _0x3fad7d?{'count':_0x467691,'rows':_0x3fad7d}:null;}})[_0xa130('0x26')](respondWithResult(_0x123ec2,null))['catch'](handleError(_0x123ec2,null));};exports['getDescriptions']=function(_0x5f028c,_0x35a1bb,_0x4bea59){var _0x344e77={};var _0x3fe154={};var _0xe7e0ed;var _0x519b64;return db[_0xa130('0x2e')][_0xa130('0x50')]({'where':{'id':_0x5f028c[_0xa130('0x49')]['id']}})[_0xa130('0x26')](handleEntityNotFound(_0x35a1bb,null))[_0xa130('0x26')](function(_0x5c6b6a){if(_0x5c6b6a){_0xe7e0ed=_0x5c6b6a;_0x3fe154['model']=_['keys'](db['ZendeskField']['rawAttributes']);_0x3fe154[_0xa130('0x33')]=_['keys'](_0x5f028c[_0xa130('0x33')]);_0x3fe154[_0xa130('0x35')]=_[_0xa130('0x36')](_0x3fe154[_0xa130('0x32')],_0x3fe154['query']);_0x344e77[_0xa130('0x38')]=_['intersection'](_0x3fe154[_0xa130('0x32')],qs['fields'](_0x5f028c[_0xa130('0x33')]['fields']));_0x344e77[_0xa130('0x38')]=_0x344e77['attributes']['length']?_0x344e77[_0xa130('0x38')]:_0x3fe154[_0xa130('0x32')];_0x344e77[_0xa130('0x3c')]=qs[_0xa130('0x3d')](_0x5f028c['query'][_0xa130('0x3d')]);_0x344e77[_0xa130('0x3e')]=qs['filters'](_[_0xa130('0x3f')](_0x5f028c['query'],_0x3fe154['filters']));if(_0x5f028c[_0xa130('0x33')][_0xa130('0x40')]){_0x344e77[_0xa130('0x3e')]=_[_0xa130('0x41')](_0x344e77[_0xa130('0x3e')],{'$or':_['map'](_0x344e77[_0xa130('0x38')],function(_0x48291b){var _0x312df4={};_0x312df4[_0x48291b]={'$like':'%'+_0x5f028c[_0xa130('0x33')]['filter']+'%'};return _0x312df4;})});}_0x344e77=_[_0xa130('0x41')]({},_0x344e77,_0x5f028c[_0xa130('0x42')]);return _0xe7e0ed['getDescriptions'](_0x344e77);}})['then'](function(_0x3fb378){if(_0x3fb378){_0x519b64=_0x3fb378[_0xa130('0x39')];if(!_0x5f028c[_0xa130('0x33')][_0xa130('0x3a')]('nolimit')){_0x344e77['limit']=qs[_0xa130('0x20')](_0x5f028c[_0xa130('0x33')][_0xa130('0x20')]);_0x344e77['offset']=qs[_0xa130('0x1d')](_0x5f028c[_0xa130('0x33')][_0xa130('0x1d')]);}return _0xe7e0ed['getDescriptions'](_0x344e77);}})['then'](function(_0x21cfa6){if(_0x21cfa6){return _0x21cfa6?{'count':_0x519b64,'rows':_0x21cfa6}:null;}})['then'](respondWithResult(_0x35a1bb,null))[_0xa130('0x47')](handleError(_0x35a1bb,null));};exports[_0xa130('0x52')]=function(_0x2ddb6f,_0x8ebed0,_0x1d8a7f){var _0x2de772={};var _0x12e2cf={};var _0x2202cb;var _0x3256db;return db[_0xa130('0x2e')][_0xa130('0x50')]({'where':{'id':_0x2ddb6f[_0xa130('0x49')]['id']}})['then'](handleEntityNotFound(_0x8ebed0,null))['then'](function(_0x374017){if(_0x374017){_0x2202cb=_0x374017;_0x12e2cf[_0xa130('0x32')]=_[_0xa130('0x34')](db['Tag'][_0xa130('0x4a')]);_0x12e2cf['query']=_[_0xa130('0x34')](_0x2ddb6f[_0xa130('0x33')]);_0x12e2cf['filters']=_['intersection'](_0x12e2cf[_0xa130('0x32')],_0x12e2cf['query']);_0x2de772[_0xa130('0x38')]=_[_0xa130('0x36')](_0x12e2cf[_0xa130('0x32')],qs[_0xa130('0x37')](_0x2ddb6f[_0xa130('0x33')]['fields']));_0x2de772[_0xa130('0x38')]=_0x2de772[_0xa130('0x38')][_0xa130('0x39')]?_0x2de772[_0xa130('0x38')]:_0x12e2cf[_0xa130('0x32')];_0x2de772[_0xa130('0x3c')]=qs['sort'](_0x2ddb6f[_0xa130('0x33')][_0xa130('0x3d')]);_0x2de772[_0xa130('0x3e')]=qs[_0xa130('0x35')](_['pick'](_0x2ddb6f['query'],_0x12e2cf[_0xa130('0x35')]));if(_0x2ddb6f['query'][_0xa130('0x40')]){_0x2de772['where']=_[_0xa130('0x41')](_0x2de772[_0xa130('0x3e')],{'$or':_[_0xa130('0x2d')](_0x2de772[_0xa130('0x38')],function(_0x4b69db){var _0x54ff3d={};_0x54ff3d[_0x4b69db]={'$like':'%'+_0x2ddb6f[_0xa130('0x33')][_0xa130('0x40')]+'%'};return _0x54ff3d;})});}_0x2de772=_['merge']({},_0x2de772,_0x2ddb6f[_0xa130('0x42')]);return _0x2202cb[_0xa130('0x52')](_0x2de772);}})[_0xa130('0x26')](function(_0x29efd2){if(_0x29efd2){_0x3256db=_0x29efd2[_0xa130('0x39')];if(!_0x2ddb6f['query'][_0xa130('0x3a')](_0xa130('0x3b'))){_0x2de772[_0xa130('0x20')]=qs[_0xa130('0x20')](_0x2ddb6f[_0xa130('0x33')][_0xa130('0x20')]);_0x2de772[_0xa130('0x1d')]=qs[_0xa130('0x1d')](_0x2ddb6f[_0xa130('0x33')]['offset']);}return _0x2202cb[_0xa130('0x52')](_0x2de772);}})[_0xa130('0x26')](function(_0x22764e){if(_0x22764e){return _0x22764e?{'count':_0x3256db,'rows':_0x22764e}:null;}})['then'](respondWithResult(_0x8ebed0,null))[_0xa130('0x47')](handleError(_0x8ebed0,null));};exports[_0xa130('0x53')]=function(_0x21fea2,_0x57d570,_0x3f6ee5){if(_0x21fea2[_0xa130('0x4c')]['id']){delete _0x21fea2['body']['id'];}return db['ZendeskConfiguration'][_0xa130('0x50')]({'where':{'id':_0x21fea2[_0xa130('0x49')]['id']}})[_0xa130('0x26')](handleEntityNotFound(_0x57d570,null))[_0xa130('0x26')](function(_0x1a01cd){if(_0x1a01cd){return _0x1a01cd[_0xa130('0x53')](_0x21fea2[_0xa130('0x4c')][_0xa130('0x54')]||[]);}return null;})['then'](respondWithResult(_0x57d570,null))[_0xa130('0x47')](handleError(_0x57d570,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index cd7f743..4ca1cc6 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 _0x4cf8=['../../config/environment','./intZendeskConfiguration.attributes','exports','define','int_zendesk_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x57ac0d,_0x103212){var _0x2a61da=function(_0x3bc30d){while(--_0x3bc30d){_0x57ac0d['push'](_0x57ac0d['shift']());}};_0x2a61da(++_0x103212);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x53ba51,_0x2f2321){_0x53ba51=_0x53ba51-0x0;var _0x2e776e=_0x4cf8[_0x53ba51];return _0x2e776e;};'use strict';var _=require(_0x84cf('0x0'));var util=require(_0x84cf('0x1'));var logger=require(_0x84cf('0x2'))(_0x84cf('0x3'));var moment=require(_0x84cf('0x4'));var BPromise=require(_0x84cf('0x5'));var rp=require(_0x84cf('0x6'));var fs=require('fs');var path=require(_0x84cf('0x7'));var rimraf=require(_0x84cf('0x8'));var config=require(_0x84cf('0x9'));var attributes=require(_0x84cf('0xa'));module[_0x84cf('0xb')]=function(_0x50ade2,_0x4af3f1){return _0x50ade2[_0x84cf('0xc')]('ZendeskConfiguration',attributes,{'tableName':_0x84cf('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1775=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','util'];(function(_0x452fc7,_0x366111){var _0x423da7=function(_0x273a06){while(--_0x273a06){_0x452fc7['push'](_0x452fc7['shift']());}};_0x423da7(++_0x366111);}(_0x1775,0x1db));var _0x5177=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1775[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x5177('0x0'));var logger=require(_0x5177('0x1'))(_0x5177('0x2'));var moment=require(_0x5177('0x3'));var BPromise=require(_0x5177('0x4'));var rp=require(_0x5177('0x5'));var fs=require('fs');var path=require(_0x5177('0x6'));var rimraf=require(_0x5177('0x7'));var config=require(_0x5177('0x8'));var attributes=require(_0x5177('0x9'));module[_0x5177('0xa')]=function(_0x2c5c42,_0x153c1a){return _0x2c5c42[_0x5177('0xb')](_0x5177('0xc'),attributes,{'tableName':_0x5177('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index e6d2a1e..45b7fa0 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 _0x03dc=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x19c30f,_0x5c7e41){var _0x458137=function(_0x1a3228){while(--_0x1a3228){_0x19c30f['push'](_0x19c30f['shift']());}};_0x458137(++_0x5c7e41);}(_0x03dc,0x151));var _0xc03d=function(_0x30de4c,_0x4e03a3){_0x30de4c=_0x30de4c-0x0;var _0x2a4423=_0x03dc[_0x30de4c];return _0x2a4423;};'use strict';var _=require(_0xc03d('0x0'));var util=require(_0xc03d('0x1'));var moment=require(_0xc03d('0x2'));var BPromise=require(_0xc03d('0x3'));var rs=require(_0xc03d('0x4'));var fs=require('fs');var Redis=require(_0xc03d('0x5'));var db=require(_0xc03d('0x6'))['db'];var utils=require(_0xc03d('0x7'));var logger=require(_0xc03d('0x8'))(_0xc03d('0x9'));var config=require(_0xc03d('0xa'));var jayson=require(_0xc03d('0xb'));var client=jayson[_0xc03d('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x49c14c,_0x2af446,_0xafb7b6){return new BPromise(function(_0x3201f7,_0x105f31){return client[_0xc03d('0xd')](_0x49c14c,_0xafb7b6)[_0xc03d('0xe')](function(_0x367ca9){logger[_0xc03d('0xf')](_0xc03d('0x10'),_0x2af446,_0xc03d('0x11'));logger['debug'](_0xc03d('0x12'),_0x2af446,'request\x20sent',JSON[_0xc03d('0x13')](_0x367ca9));if(_0x367ca9[_0xc03d('0x14')]){if(_0x367ca9[_0xc03d('0x14')][_0xc03d('0x15')]===0x1f4){logger[_0xc03d('0x14')](_0xc03d('0x10'),_0x2af446,_0x367ca9[_0xc03d('0x14')][_0xc03d('0x16')]);return _0x105f31(_0x367ca9[_0xc03d('0x14')][_0xc03d('0x16')]);}logger[_0xc03d('0x14')](_0xc03d('0x10'),_0x2af446,_0x367ca9[_0xc03d('0x14')][_0xc03d('0x16')]);return _0x3201f7(_0x367ca9[_0xc03d('0x14')][_0xc03d('0x16')]);}else{logger['info'](_0xc03d('0x10'),_0x2af446,'request\x20sent');_0x3201f7(_0x367ca9['result'][_0xc03d('0x16')]);}})[_0xc03d('0x17')](function(_0x53bdd9){logger[_0xc03d('0x14')](_0xc03d('0x10'),_0x2af446,_0x53bdd9);_0x105f31(_0x53bdd9);});});} \ No newline at end of file +var _0x4749=['client','request','then','ZendeskConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3a7634,_0x2db384){var _0x23bbe9=function(_0x226734){while(--_0x226734){_0x3a7634['push'](_0x3a7634['shift']());}};_0x23bbe9(++_0x2db384);}(_0x4749,0x14f));var _0x9474=function(_0x29b340,_0x17a70b){_0x29b340=_0x29b340-0x0;var _0xa9e26b=_0x4749[_0x29b340];return _0xa9e26b;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x9474('0x0'));var rs=require(_0x9474('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9474('0x2'));var logger=require(_0x9474('0x3'))(_0x9474('0x4'));var config=require(_0x9474('0x5'));var jayson=require(_0x9474('0x6'));var client=jayson[_0x9474('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a77db,_0x20a6fa,_0x5efc36){return new BPromise(function(_0x3b14ab,_0x249957){return client[_0x9474('0x8')](_0x3a77db,_0x5efc36)[_0x9474('0x9')](function(_0xc901c9){logger['info'](_0x9474('0xa'),_0x20a6fa,'request\x20sent');logger[_0x9474('0xb')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x20a6fa,_0x9474('0xc'),JSON[_0x9474('0xd')](_0xc901c9));if(_0xc901c9['error']){if(_0xc901c9[_0x9474('0xe')][_0x9474('0xf')]===0x1f4){logger[_0x9474('0xe')](_0x9474('0xa'),_0x20a6fa,_0xc901c9[_0x9474('0xe')][_0x9474('0x10')]);return _0x249957(_0xc901c9['error'][_0x9474('0x10')]);}logger[_0x9474('0xe')](_0x9474('0xa'),_0x20a6fa,_0xc901c9[_0x9474('0xe')][_0x9474('0x10')]);return _0x3b14ab(_0xc901c9[_0x9474('0xe')]['message']);}else{logger['info'](_0x9474('0xa'),_0x20a6fa,_0x9474('0xc'));_0x3b14ab(_0xc901c9[_0x9474('0x11')][_0x9474('0x10')]);}})[_0x9474('0x12')](function(_0x221013){logger[_0x9474('0xe')](_0x9474('0xa'),_0x20a6fa,_0x221013);_0x249957(_0x221013);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 421a8e2..7f40f90 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 _0xa8b3=['exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete'];(function(_0x2e44a7,_0x4a7483){var _0x4063a9=function(_0x556846){while(--_0x556846){_0x2e44a7['push'](_0x2e44a7['shift']());}};_0x4063a9(++_0x4a7483);}(_0xa8b3,0x1a3));var _0x3a8b=function(_0x4248e9,_0x19f4bc){_0x4248e9=_0x4248e9-0x0;var _0x4a26af=_0xa8b3[_0x4248e9];return _0x4a26af;};'use strict';var multer=require('multer');var util=require(_0x3a8b('0x0'));var path=require('path');var timeout=require(_0x3a8b('0x1'));var express=require(_0x3a8b('0x2'));var router=express['Router']();var fs_extra=require(_0x3a8b('0x3'));var auth=require(_0x3a8b('0x4'));var interaction=require(_0x3a8b('0x5'));var config=require(_0x3a8b('0x6'));var controller=require(_0x3a8b('0x7'));router[_0x3a8b('0x8')]('/',auth[_0x3a8b('0x9')](),controller[_0x3a8b('0xa')]);router[_0x3a8b('0x8')](_0x3a8b('0xb'),auth[_0x3a8b('0x9')](),controller[_0x3a8b('0xc')]);router[_0x3a8b('0xd')]('/',auth[_0x3a8b('0x9')](),controller[_0x3a8b('0xe')]);router[_0x3a8b('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x3a8b('0x10')]);router[_0x3a8b('0x11')](_0x3a8b('0xb'),auth[_0x3a8b('0x9')](),controller['destroy']);module[_0x3a8b('0x12')]=router; \ No newline at end of file +var _0x7439=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','post','create','put','/:id','update','destroy','multer','util','path'];(function(_0x4a6ae7,_0x592ced){var _0x2cff8f=function(_0x57678b){while(--_0x57678b){_0x4a6ae7['push'](_0x4a6ae7['shift']());}};_0x2cff8f(++_0x592ced);}(_0x7439,0x165));var _0x9743=function(_0x57f9e3,_0x5a331d){_0x57f9e3=_0x57f9e3-0x0;var _0x1a155f=_0x7439[_0x57f9e3];return _0x1a155f;};'use strict';var multer=require(_0x9743('0x0'));var util=require(_0x9743('0x1'));var path=require(_0x9743('0x2'));var timeout=require(_0x9743('0x3'));var express=require(_0x9743('0x4'));var router=express[_0x9743('0x5')]();var fs_extra=require(_0x9743('0x6'));var auth=require(_0x9743('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x9743('0x8'));var controller=require('./intZendeskField.controller');router['get']('/',auth[_0x9743('0x9')](),controller[_0x9743('0xa')]);router[_0x9743('0xb')]('/:id',auth[_0x9743('0x9')](),controller['show']);router[_0x9743('0xc')]('/',auth['isAuthenticated'](),controller[_0x9743('0xd')]);router[_0x9743('0xe')](_0x9743('0xf'),auth[_0x9743('0x9')](),controller[_0x9743('0x10')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x9743('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index cd55a28..b22bb4f 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 _0x2acc=['exports','ENUM','variable','keyValue','STRING','BOOLEAN','sequelize'];(function(_0x19f466,_0x91a82b){var _0x88eef5=function(_0x2163ba){while(--_0x2163ba){_0x19f466['push'](_0x19f466['shift']());}};_0x88eef5(++_0x91a82b);}(_0x2acc,0x133));var _0xc2ac=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2acc[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xc2ac('0x0'));module[_0xc2ac('0x1')]={'type':{'type':Sequelize[_0xc2ac('0x2')]('string',_0xc2ac('0x3'),'customVariable',_0xc2ac('0x4'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0xc2ac('0x5')]},'key':{'type':Sequelize[_0xc2ac('0x5')]},'keyType':{'type':Sequelize[_0xc2ac('0x2')]('string',_0xc2ac('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0xc2ac('0x5')]},'idField':{'type':Sequelize[_0xc2ac('0x5')]},'nameField':{'type':Sequelize[_0xc2ac('0x5')]},'customField':{'type':Sequelize[_0xc2ac('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc2ac('0x5')]}}; \ No newline at end of file +var _0xc896=['STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','picklist'];(function(_0xb6c612,_0x21b613){var _0x37d4be=function(_0x1cf047){while(--_0x1cf047){_0xb6c612['push'](_0xb6c612['shift']());}};_0x37d4be(++_0x21b613);}(_0xc896,0x1e8));var _0x6c89=function(_0x4d246a,_0x1219c9){_0x4d246a=_0x4d246a-0x0;var _0x4c7234=_0xc896[_0x4d246a];return _0x4c7234;};'use strict';var Sequelize=require(_0x6c89('0x0'));module[_0x6c89('0x1')]={'type':{'type':Sequelize[_0x6c89('0x2')](_0x6c89('0x3'),_0x6c89('0x4'),_0x6c89('0x5'),'keyValue',_0x6c89('0x6')),'defaultValue':_0x6c89('0x3')},'content':{'type':Sequelize[_0x6c89('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x6c89('0x2')](_0x6c89('0x3'),_0x6c89('0x4'),_0x6c89('0x5'))},'keyContent':{'type':Sequelize[_0x6c89('0x7')]},'idField':{'type':Sequelize[_0x6c89('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x6c89('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6c89('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 5945555..514fcb9 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 _0xb99d=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','error','name','index','map','ZendeskField','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','fields','length','model','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','update','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','querystring'];(function(_0x382b80,_0x4f503a){var _0x1296b=function(_0x448644){while(--_0x448644){_0x382b80['push'](_0x382b80['shift']());}};_0x1296b(++_0x4f503a);}(_0xb99d,0x87));var _0xdb99=function(_0xdd57f0,_0x2e23e1){_0xdd57f0=_0xdd57f0-0x0;var _0x4f4755=_0xb99d[_0xdd57f0];return _0x4f4755;};'use strict';var emlformat=require(_0xdb99('0x0'));var rimraf=require(_0xdb99('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdb99('0x2'));var rp=require(_0xdb99('0x3'));var moment=require(_0xdb99('0x4'));var BPromise=require(_0xdb99('0x5'));var Mustache=require(_0xdb99('0x6'));var util=require(_0xdb99('0x7'));var path=require(_0xdb99('0x8'));var sox=require(_0xdb99('0x9'));var csv=require(_0xdb99('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdb99('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xdb99('0xc'));var jsforce=require(_0xdb99('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xdb99('0xa'));var querystring=require(_0xdb99('0xe'));var Papa=require(_0xdb99('0xf'));var Redis=require(_0xdb99('0x10'));var authService=require(_0xdb99('0x11'));var qs=require(_0xdb99('0x12'));var as=require(_0xdb99('0x13'));var hardwareService=require(_0xdb99('0x14'));var logger=require(_0xdb99('0x15'))(_0xdb99('0x16'));var utils=require(_0xdb99('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xdb99('0x18'));var db=require(_0xdb99('0x19'))['db'];function respondWithStatusCode(_0x991bb9,_0x52fd81){_0x52fd81=_0x52fd81||0xcc;return function(_0x1c0932){if(_0x1c0932){return _0x991bb9[_0xdb99('0x1a')](_0x52fd81);}return _0x991bb9[_0xdb99('0x1b')](_0x52fd81)[_0xdb99('0x1c')]();};}function respondWithResult(_0x24352a,_0x3b3755){_0x3b3755=_0x3b3755||0xc8;return function(_0x4ae8d4){if(_0x4ae8d4){return _0x24352a['status'](_0x3b3755)[_0xdb99('0x1d')](_0x4ae8d4);}};}function respondWithFilteredResult(_0x2cdb06,_0x1db39c){return function(_0x5a061d){if(_0x5a061d){var _0x457575=typeof _0x1db39c[_0xdb99('0x1e')]===_0xdb99('0x1f')&&typeof _0x1db39c[_0xdb99('0x20')]===_0xdb99('0x1f');var _0x27442e=_0x5a061d[_0xdb99('0x21')];var _0xe8f984=_0x457575?0x0:_0x1db39c[_0xdb99('0x1e')];var _0x2722e5=_0x457575?_0x5a061d[_0xdb99('0x21')]:_0x1db39c[_0xdb99('0x1e')]+_0x1db39c[_0xdb99('0x20')];var _0x25d9a2;if(_0x2722e5>=_0x27442e){_0x2722e5=_0x27442e;_0x25d9a2=0xc8;}else{_0x25d9a2=0xce;}_0x2cdb06[_0xdb99('0x1b')](_0x25d9a2);return _0x2cdb06[_0xdb99('0x22')]('Content-Range',_0xe8f984+'-'+_0x2722e5+'/'+_0x27442e)['json'](_0x5a061d);}return null;};}function patchUpdates(_0x4383ac){return function(_0x5a554b){try{jsonpatch[_0xdb99('0x23')](_0x5a554b,_0x4383ac,!![]);}catch(_0x58804b){return BPromise[_0xdb99('0x24')](_0x58804b);}return _0x5a554b[_0xdb99('0x25')]();};}function saveUpdates(_0x5b9282,_0x517867){return function(_0x333654){if(_0x333654){return _0x333654['update'](_0x5b9282)[_0xdb99('0x26')](function(_0x1aad09){return _0x1aad09;});}return null;};}function removeEntity(_0x5e86f0,_0x51d828){return function(_0xa4020){if(_0xa4020){return _0xa4020['destroy']()[_0xdb99('0x26')](function(){_0x5e86f0[_0xdb99('0x1b')](0xcc)[_0xdb99('0x1c')]();});}};}function handleEntityNotFound(_0x4df099,_0x28d189){return function(_0x2bfa74){if(!_0x2bfa74){_0x4df099[_0xdb99('0x1a')](0x194);}return _0x2bfa74;};}function handleError(_0x23b40b,_0x287b95){_0x287b95=_0x287b95||0x1f4;return function(_0x17810b){logger[_0xdb99('0x27')](_0x17810b['stack']);if(_0x17810b[_0xdb99('0x28')]){delete _0x17810b[_0xdb99('0x28')];}_0x23b40b[_0xdb99('0x1b')](_0x287b95)['send'](_0x17810b);};}exports[_0xdb99('0x29')]=function(_0x56da68,_0x21ab3a){var _0x51e1cd={},_0xbfaf18={},_0x53c727={'count':0x0,'rows':[]};var _0x21bc17=_[_0xdb99('0x2a')](db[_0xdb99('0x2b')][_0xdb99('0x2c')],function(_0x644f72){return{'name':_0x644f72[_0xdb99('0x2d')],'type':_0x644f72[_0xdb99('0x2e')]['key']};});_0xbfaf18['model']=_[_0xdb99('0x2a')](_0x21bc17,_0xdb99('0x28'));_0xbfaf18[_0xdb99('0x2f')]=_[_0xdb99('0x30')](_0x56da68[_0xdb99('0x2f')]);_0xbfaf18[_0xdb99('0x31')]=_[_0xdb99('0x32')](_0xbfaf18['model'],_0xbfaf18[_0xdb99('0x2f')]);_0x51e1cd[_0xdb99('0x33')]=_[_0xdb99('0x32')](_0xbfaf18['model'],qs[_0xdb99('0x34')](_0x56da68[_0xdb99('0x2f')]['fields']));_0x51e1cd['attributes']=_0x51e1cd[_0xdb99('0x33')][_0xdb99('0x35')]?_0x51e1cd[_0xdb99('0x33')]:_0xbfaf18[_0xdb99('0x36')];if(!_0x56da68[_0xdb99('0x2f')]['hasOwnProperty'](_0xdb99('0x37'))){_0x51e1cd[_0xdb99('0x20')]=qs[_0xdb99('0x20')](_0x56da68[_0xdb99('0x2f')][_0xdb99('0x20')]);_0x51e1cd[_0xdb99('0x1e')]=qs[_0xdb99('0x1e')](_0x56da68['query'][_0xdb99('0x1e')]);}_0x51e1cd[_0xdb99('0x38')]=qs['sort'](_0x56da68[_0xdb99('0x2f')][_0xdb99('0x39')]);_0x51e1cd[_0xdb99('0x3a')]=qs[_0xdb99('0x31')](_[_0xdb99('0x3b')](_0x56da68['query'],_0xbfaf18[_0xdb99('0x31')]),_0x21bc17);if(_0x56da68['query']['filter']){_0x51e1cd[_0xdb99('0x3a')]=_[_0xdb99('0x3c')](_0x51e1cd[_0xdb99('0x3a')],{'$or':_[_0xdb99('0x2a')](_0x21bc17,function(_0x2b82bb){if(_0x2b82bb['type']!==_0xdb99('0x3d')){var _0x463091={};_0x463091[_0x2b82bb[_0xdb99('0x28')]]={'$like':'%'+_0x56da68[_0xdb99('0x2f')][_0xdb99('0x3e')]+'%'};return _0x463091;}})});}_0x51e1cd=_['merge']({},_0x51e1cd,_0x56da68['options']);var _0x1c4de1={'where':_0x51e1cd['where']};return db[_0xdb99('0x2b')][_0xdb99('0x21')](_0x1c4de1)[_0xdb99('0x26')](function(_0x536201){_0x53c727[_0xdb99('0x21')]=_0x536201;if(_0x56da68[_0xdb99('0x2f')][_0xdb99('0x3f')]){_0x51e1cd[_0xdb99('0x40')]=[{'all':!![]}];}return db[_0xdb99('0x2b')][_0xdb99('0x41')](_0x51e1cd);})[_0xdb99('0x26')](function(_0x1b0713){_0x53c727[_0xdb99('0x42')]=_0x1b0713;return _0x53c727;})[_0xdb99('0x26')](respondWithFilteredResult(_0x21ab3a,_0x51e1cd))[_0xdb99('0x43')](handleError(_0x21ab3a,null));};exports[_0xdb99('0x44')]=function(_0x551fd6,_0x548638){var _0x478f1f={'raw':!![],'where':{'id':_0x551fd6[_0xdb99('0x45')]['id']}},_0x307a56={};_0x307a56[_0xdb99('0x36')]=_['keys'](db[_0xdb99('0x2b')][_0xdb99('0x2c')]);_0x307a56['query']=_[_0xdb99('0x30')](_0x551fd6[_0xdb99('0x2f')]);_0x307a56[_0xdb99('0x31')]=_['intersection'](_0x307a56[_0xdb99('0x36')],_0x307a56[_0xdb99('0x2f')]);_0x478f1f[_0xdb99('0x33')]=_[_0xdb99('0x32')](_0x307a56[_0xdb99('0x36')],qs[_0xdb99('0x34')](_0x551fd6[_0xdb99('0x2f')][_0xdb99('0x34')]));_0x478f1f['attributes']=_0x478f1f[_0xdb99('0x33')][_0xdb99('0x35')]?_0x478f1f[_0xdb99('0x33')]:_0x307a56['model'];if(_0x551fd6[_0xdb99('0x2f')][_0xdb99('0x3f')]){_0x478f1f[_0xdb99('0x40')]=[{'all':!![]}];}_0x478f1f=_['merge']({},_0x478f1f,_0x551fd6[_0xdb99('0x46')]);return db['ZendeskField'][_0xdb99('0x47')](_0x478f1f)[_0xdb99('0x26')](handleEntityNotFound(_0x548638,null))[_0xdb99('0x26')](respondWithResult(_0x548638,null))['catch'](handleError(_0x548638,null));};exports['create']=function(_0x356987,_0x1ed62a){return db[_0xdb99('0x2b')][_0xdb99('0x48')](_0x356987[_0xdb99('0x49')],{})[_0xdb99('0x26')](respondWithResult(_0x1ed62a,0xc9))[_0xdb99('0x43')](handleError(_0x1ed62a,null));};exports[_0xdb99('0x4a')]=function(_0xb29917,_0x2f8baf){if(_0xb29917['body']['id']){delete _0xb29917[_0xdb99('0x49')]['id'];}return db['ZendeskField'][_0xdb99('0x47')]({'where':{'id':_0xb29917[_0xdb99('0x45')]['id']}})[_0xdb99('0x26')](handleEntityNotFound(_0x2f8baf,null))['then'](saveUpdates(_0xb29917['body'],null))['then'](respondWithResult(_0x2f8baf,null))[_0xdb99('0x43')](handleError(_0x2f8baf,null));};exports['destroy']=function(_0x4aa270,_0x53b2ab){return db[_0xdb99('0x2b')][_0xdb99('0x47')]({'where':{'id':_0x4aa270['params']['id']}})[_0xdb99('0x26')](handleEntityNotFound(_0x53b2ab,null))[_0xdb99('0x26')](removeEntity(_0x53b2ab,null))[_0xdb99('0x43')](handleError(_0x53b2ab,null));}; \ No newline at end of file +var _0x4d6e=['sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','end','error','stack','name','send','map','ZendeskField','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','includeAll','include','findAll','then','rows','catch','show','params','options','find','create','body','eml-format','rimraf','zip-dir','bluebird','mustache','util','path'];(function(_0xc66750,_0x45d5b6){var _0x597b2c=function(_0x2ae508){while(--_0x2ae508){_0xc66750['push'](_0xc66750['shift']());}};_0x597b2c(++_0x45d5b6);}(_0x4d6e,0x119));var _0xe4d6=function(_0x18e80c,_0x4077f7){_0x18e80c=_0x18e80c-0x0;var _0x183ba9=_0x4d6e[_0x18e80c];return _0x183ba9;};'use strict';var emlformat=require(_0xe4d6('0x0'));var rimraf=require(_0xe4d6('0x1'));var zipdir=require(_0xe4d6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe4d6('0x3'));var Mustache=require(_0xe4d6('0x4'));var util=require(_0xe4d6('0x5'));var path=require(_0xe4d6('0x6'));var sox=require(_0xe4d6('0x7'));var csv=require(_0xe4d6('0x8'));var ejs=require(_0xe4d6('0x9'));var fs=require('fs');var fs_extra=require(_0xe4d6('0xa'));var _=require(_0xe4d6('0xb'));var squel=require('squel');var crypto=require(_0xe4d6('0xc'));var jsforce=require(_0xe4d6('0xd'));var deskjs=require(_0xe4d6('0xe'));var toCsv=require('to-csv');var querystring=require(_0xe4d6('0xf'));var Papa=require('papaparse');var Redis=require(_0xe4d6('0x10'));var authService=require(_0xe4d6('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe4d6('0x12'));var logger=require(_0xe4d6('0x13'))('api');var utils=require(_0xe4d6('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xe4d6('0x15'));var db=require(_0xe4d6('0x16'))['db'];function respondWithStatusCode(_0x54f4c8,_0x47ab66){_0x47ab66=_0x47ab66||0xcc;return function(_0x1226e8){if(_0x1226e8){return _0x54f4c8[_0xe4d6('0x17')](_0x47ab66);}return _0x54f4c8['status'](_0x47ab66)['end']();};}function respondWithResult(_0x59e9c5,_0x430a0d){_0x430a0d=_0x430a0d||0xc8;return function(_0x1d2aef){if(_0x1d2aef){return _0x59e9c5[_0xe4d6('0x18')](_0x430a0d)[_0xe4d6('0x19')](_0x1d2aef);}};}function respondWithFilteredResult(_0x33f624,_0x2cbce4){return function(_0x183758){if(_0x183758){var _0x191dad=typeof _0x2cbce4[_0xe4d6('0x1a')]===_0xe4d6('0x1b')&&typeof _0x2cbce4[_0xe4d6('0x1c')]==='undefined';var _0x707ba1=_0x183758['count'];var _0x5980a1=_0x191dad?0x0:_0x2cbce4[_0xe4d6('0x1a')];var _0x24ca1e=_0x191dad?_0x183758[_0xe4d6('0x1d')]:_0x2cbce4[_0xe4d6('0x1a')]+_0x2cbce4[_0xe4d6('0x1c')];var _0x39f1b8;if(_0x24ca1e>=_0x707ba1){_0x24ca1e=_0x707ba1;_0x39f1b8=0xc8;}else{_0x39f1b8=0xce;}_0x33f624[_0xe4d6('0x18')](_0x39f1b8);return _0x33f624[_0xe4d6('0x1e')](_0xe4d6('0x1f'),_0x5980a1+'-'+_0x24ca1e+'/'+_0x707ba1)[_0xe4d6('0x19')](_0x183758);}return null;};}function patchUpdates(_0x29e80d){return function(_0x545453){try{jsonpatch[_0xe4d6('0x20')](_0x545453,_0x29e80d,!![]);}catch(_0x3cc3f1){return BPromise[_0xe4d6('0x21')](_0x3cc3f1);}return _0x545453[_0xe4d6('0x22')]();};}function saveUpdates(_0x402330,_0x4ec0fb){return function(_0x2c09fd){if(_0x2c09fd){return _0x2c09fd['update'](_0x402330)['then'](function(_0x50658d){return _0x50658d;});}return null;};}function removeEntity(_0xc8ce6,_0x84d4a){return function(_0x277b68){if(_0x277b68){return _0x277b68[_0xe4d6('0x23')]()['then'](function(){_0xc8ce6[_0xe4d6('0x18')](0xcc)[_0xe4d6('0x24')]();});}};}function handleEntityNotFound(_0x4c3dfc,_0x5885a0){return function(_0x1dd91e){if(!_0x1dd91e){_0x4c3dfc['sendStatus'](0x194);}return _0x1dd91e;};}function handleError(_0x37f70d,_0x58ac65){_0x58ac65=_0x58ac65||0x1f4;return function(_0x20bf07){logger[_0xe4d6('0x25')](_0x20bf07[_0xe4d6('0x26')]);if(_0x20bf07[_0xe4d6('0x27')]){delete _0x20bf07[_0xe4d6('0x27')];}_0x37f70d[_0xe4d6('0x18')](_0x58ac65)[_0xe4d6('0x28')](_0x20bf07);};}exports['index']=function(_0x42a1d9,_0x411003){var _0x213873={},_0x53f9de={},_0x87dec8={'count':0x0,'rows':[]};var _0x1fc507=_[_0xe4d6('0x29')](db[_0xe4d6('0x2a')][_0xe4d6('0x2b')],function(_0x2f521a){return{'name':_0x2f521a[_0xe4d6('0x2c')],'type':_0x2f521a[_0xe4d6('0x2d')]['key']};});_0x53f9de[_0xe4d6('0x2e')]=_[_0xe4d6('0x29')](_0x1fc507,_0xe4d6('0x27'));_0x53f9de[_0xe4d6('0x2f')]=_[_0xe4d6('0x30')](_0x42a1d9[_0xe4d6('0x2f')]);_0x53f9de[_0xe4d6('0x31')]=_[_0xe4d6('0x32')](_0x53f9de['model'],_0x53f9de[_0xe4d6('0x2f')]);_0x213873[_0xe4d6('0x33')]=_[_0xe4d6('0x32')](_0x53f9de[_0xe4d6('0x2e')],qs[_0xe4d6('0x34')](_0x42a1d9[_0xe4d6('0x2f')][_0xe4d6('0x34')]));_0x213873[_0xe4d6('0x33')]=_0x213873['attributes'][_0xe4d6('0x35')]?_0x213873[_0xe4d6('0x33')]:_0x53f9de[_0xe4d6('0x2e')];if(!_0x42a1d9['query']['hasOwnProperty'](_0xe4d6('0x36'))){_0x213873['limit']=qs[_0xe4d6('0x1c')](_0x42a1d9['query']['limit']);_0x213873[_0xe4d6('0x1a')]=qs[_0xe4d6('0x1a')](_0x42a1d9[_0xe4d6('0x2f')][_0xe4d6('0x1a')]);}_0x213873[_0xe4d6('0x37')]=qs[_0xe4d6('0x38')](_0x42a1d9[_0xe4d6('0x2f')]['sort']);_0x213873[_0xe4d6('0x39')]=qs[_0xe4d6('0x31')](_['pick'](_0x42a1d9[_0xe4d6('0x2f')],_0x53f9de[_0xe4d6('0x31')]),_0x1fc507);if(_0x42a1d9[_0xe4d6('0x2f')][_0xe4d6('0x3a')]){_0x213873[_0xe4d6('0x39')]=_[_0xe4d6('0x3b')](_0x213873[_0xe4d6('0x39')],{'$or':_[_0xe4d6('0x29')](_0x1fc507,function(_0x4329e2){if(_0x4329e2[_0xe4d6('0x2d')]!=='VIRTUAL'){var _0x1c7419={};_0x1c7419[_0x4329e2[_0xe4d6('0x27')]]={'$like':'%'+_0x42a1d9[_0xe4d6('0x2f')][_0xe4d6('0x3a')]+'%'};return _0x1c7419;}})});}_0x213873=_[_0xe4d6('0x3b')]({},_0x213873,_0x42a1d9['options']);var _0xf3e013={'where':_0x213873[_0xe4d6('0x39')]};return db[_0xe4d6('0x2a')][_0xe4d6('0x1d')](_0xf3e013)['then'](function(_0x2a118d){_0x87dec8[_0xe4d6('0x1d')]=_0x2a118d;if(_0x42a1d9[_0xe4d6('0x2f')][_0xe4d6('0x3c')]){_0x213873[_0xe4d6('0x3d')]=[{'all':!![]}];}return db['ZendeskField'][_0xe4d6('0x3e')](_0x213873);})[_0xe4d6('0x3f')](function(_0x597fea){_0x87dec8[_0xe4d6('0x40')]=_0x597fea;return _0x87dec8;})[_0xe4d6('0x3f')](respondWithFilteredResult(_0x411003,_0x213873))[_0xe4d6('0x41')](handleError(_0x411003,null));};exports[_0xe4d6('0x42')]=function(_0x7ff964,_0x807eb0){var _0x1e8476={'raw':!![],'where':{'id':_0x7ff964[_0xe4d6('0x43')]['id']}},_0x47c451={};_0x47c451[_0xe4d6('0x2e')]=_['keys'](db[_0xe4d6('0x2a')][_0xe4d6('0x2b')]);_0x47c451[_0xe4d6('0x2f')]=_['keys'](_0x7ff964['query']);_0x47c451[_0xe4d6('0x31')]=_[_0xe4d6('0x32')](_0x47c451[_0xe4d6('0x2e')],_0x47c451[_0xe4d6('0x2f')]);_0x1e8476[_0xe4d6('0x33')]=_[_0xe4d6('0x32')](_0x47c451['model'],qs[_0xe4d6('0x34')](_0x7ff964[_0xe4d6('0x2f')][_0xe4d6('0x34')]));_0x1e8476['attributes']=_0x1e8476[_0xe4d6('0x33')]['length']?_0x1e8476[_0xe4d6('0x33')]:_0x47c451[_0xe4d6('0x2e')];if(_0x7ff964[_0xe4d6('0x2f')]['includeAll']){_0x1e8476[_0xe4d6('0x3d')]=[{'all':!![]}];}_0x1e8476=_[_0xe4d6('0x3b')]({},_0x1e8476,_0x7ff964[_0xe4d6('0x44')]);return db[_0xe4d6('0x2a')][_0xe4d6('0x45')](_0x1e8476)[_0xe4d6('0x3f')](handleEntityNotFound(_0x807eb0,null))['then'](respondWithResult(_0x807eb0,null))[_0xe4d6('0x41')](handleError(_0x807eb0,null));};exports[_0xe4d6('0x46')]=function(_0x57071a,_0x53ce4b){return db[_0xe4d6('0x2a')]['create'](_0x57071a[_0xe4d6('0x47')],{})['then'](respondWithResult(_0x53ce4b,0xc9))[_0xe4d6('0x41')](handleError(_0x53ce4b,null));};exports['update']=function(_0x3c8e76,_0x1fdafc){if(_0x3c8e76[_0xe4d6('0x47')]['id']){delete _0x3c8e76['body']['id'];}return db[_0xe4d6('0x2a')][_0xe4d6('0x45')]({'where':{'id':_0x3c8e76[_0xe4d6('0x43')]['id']}})[_0xe4d6('0x3f')](handleEntityNotFound(_0x1fdafc,null))[_0xe4d6('0x3f')](saveUpdates(_0x3c8e76[_0xe4d6('0x47')],null))[_0xe4d6('0x3f')](respondWithResult(_0x1fdafc,null))['catch'](handleError(_0x1fdafc,null));};exports[_0xe4d6('0x23')]=function(_0x14cf23,_0x4a4d5a){return db[_0xe4d6('0x2a')]['find']({'where':{'id':_0x14cf23['params']['id']}})[_0xe4d6('0x3f')](handleEntityNotFound(_0x4a4d5a,null))[_0xe4d6('0x3f')](removeEntity(_0x4a4d5a,null))['catch'](handleError(_0x4a4d5a,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index a64797a..f10b392 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 _0x5815=['exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','FieldId','lodash','util','../../config/logger','api','request-promise','../../config/environment','./intZendeskField.attributes'];(function(_0x146b09,_0x345cd3){var _0x4e9e36=function(_0x1d9749){while(--_0x1d9749){_0x146b09['push'](_0x146b09['shift']());}};_0x4e9e36(++_0x345cd3);}(_0x5815,0x117));var _0x5581=function(_0x18c30b,_0x47dfcb){_0x18c30b=_0x18c30b-0x0;var _0x43de4f=_0x5815[_0x18c30b];return _0x43de4f;};'use strict';var _=require(_0x5581('0x0'));var util=require(_0x5581('0x1'));var logger=require(_0x5581('0x2'))(_0x5581('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5581('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5581('0x5'));var attributes=require(_0x5581('0x6'));module[_0x5581('0x7')]=function(_0x55654e,_0x2ed383){return _0x55654e[_0x5581('0x8')](_0x5581('0x9'),attributes,{'tableName':_0x5581('0xa'),'paranoid':![],'indexes':[{'name':_0x5581('0xb'),'fields':['idField',_0x5581('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7628=['rimraf','../../config/environment','./intZendeskField.attributes','define','int_zendesk_fields','zendesk_unique_index','idField','FieldId','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x20b467,_0x2c6a37){var _0x41cf3b=function(_0x564094){while(--_0x564094){_0x20b467['push'](_0x20b467['shift']());}};_0x41cf3b(++_0x2c6a37);}(_0x7628,0x94));var _0x8762=function(_0x50d976,_0xe0a9b8){_0x50d976=_0x50d976-0x0;var _0x59ecf0=_0x7628[_0x50d976];return _0x59ecf0;};'use strict';var _=require('lodash');var util=require(_0x8762('0x0'));var logger=require(_0x8762('0x1'))(_0x8762('0x2'));var moment=require('moment');var BPromise=require(_0x8762('0x3'));var rp=require(_0x8762('0x4'));var fs=require('fs');var path=require(_0x8762('0x5'));var rimraf=require(_0x8762('0x6'));var config=require(_0x8762('0x7'));var attributes=require(_0x8762('0x8'));module['exports']=function(_0x4b3731,_0x5ad570){return _0x4b3731[_0x8762('0x9')]('ZendeskField',attributes,{'tableName':_0x8762('0xa'),'paranoid':![],'indexes':[{'name':_0x8762('0xb'),'fields':[_0x8762('0xc'),_0x8762('0xd')],'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 ab32539..389762f 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 _0x7bee=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','ZendeskField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','moment'];(function(_0x586cb6,_0x2ac45e){var _0xddd6b0=function(_0x1882e1){while(--_0x1882e1){_0x586cb6['push'](_0x586cb6['shift']());}};_0xddd6b0(++_0x2ac45e);}(_0x7bee,0x107));var _0xe7be=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x7bee[_0x4b055c];return _0x4b62bb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7be('0x0'));var BPromise=require(_0xe7be('0x1'));var rs=require(_0xe7be('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe7be('0x3'))['db'];var utils=require(_0xe7be('0x4'));var logger=require(_0xe7be('0x5'))(_0xe7be('0x6'));var config=require(_0xe7be('0x7'));var jayson=require(_0xe7be('0x8'));var client=jayson[_0xe7be('0x9')][_0xe7be('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x433f06,_0x9511ba,_0x2a9075){return new BPromise(function(_0x5a04bb,_0x2f35a2){return client[_0xe7be('0xb')](_0x433f06,_0x2a9075)[_0xe7be('0xc')](function(_0x201183){logger[_0xe7be('0xd')](_0xe7be('0xe'),_0x9511ba,_0xe7be('0xf'));logger['debug'](_0xe7be('0x10'),_0x9511ba,_0xe7be('0xf'),JSON['stringify'](_0x201183));if(_0x201183[_0xe7be('0x11')]){if(_0x201183['error'][_0xe7be('0x12')]===0x1f4){logger[_0xe7be('0x11')](_0xe7be('0xe'),_0x9511ba,_0x201183[_0xe7be('0x11')][_0xe7be('0x13')]);return _0x2f35a2(_0x201183[_0xe7be('0x11')]['message']);}logger['error']('ZendeskField,\x20%s,\x20%s',_0x9511ba,_0x201183[_0xe7be('0x11')][_0xe7be('0x13')]);return _0x5a04bb(_0x201183[_0xe7be('0x11')]['message']);}else{logger[_0xe7be('0xd')](_0xe7be('0xe'),_0x9511ba,_0xe7be('0xf'));_0x5a04bb(_0x201183[_0xe7be('0x14')][_0xe7be('0x13')]);}})[_0xe7be('0x15')](function(_0x30a4b4){logger[_0xe7be('0x11')](_0xe7be('0xe'),_0x9511ba,_0x30a4b4);_0x2f35a2(_0x30a4b4);});});} \ No newline at end of file +var _0x1910=['stringify','code','ZendeskField,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s'];(function(_0x23f98a,_0x374f32){var _0x36e301=function(_0x4d1509){while(--_0x4d1509){_0x23f98a['push'](_0x23f98a['shift']());}};_0x36e301(++_0x374f32);}(_0x1910,0x197));var _0x0191=function(_0x38e9af,_0x41634e){_0x38e9af=_0x38e9af-0x0;var _0x2523fc=_0x1910[_0x38e9af];return _0x2523fc;};'use strict';var _=require(_0x0191('0x0'));var util=require(_0x0191('0x1'));var moment=require(_0x0191('0x2'));var BPromise=require(_0x0191('0x3'));var rs=require(_0x0191('0x4'));var fs=require('fs');var Redis=require(_0x0191('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0191('0x6'));var logger=require(_0x0191('0x7'))(_0x0191('0x8'));var config=require(_0x0191('0x9'));var jayson=require(_0x0191('0xa'));var client=jayson[_0x0191('0xb')][_0x0191('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x43a0b5,_0x34d03b,_0x545c82){return new BPromise(function(_0x8a5aad,_0x408ccc){return client['request'](_0x43a0b5,_0x545c82)[_0x0191('0xd')](function(_0x1e2ece){logger[_0x0191('0xe')]('ZendeskField,\x20%s,\x20%s',_0x34d03b,_0x0191('0xf'));logger[_0x0191('0x10')](_0x0191('0x11'),_0x34d03b,_0x0191('0xf'),JSON[_0x0191('0x12')](_0x1e2ece));if(_0x1e2ece['error']){if(_0x1e2ece['error'][_0x0191('0x13')]===0x1f4){logger['error'](_0x0191('0x14'),_0x34d03b,_0x1e2ece[_0x0191('0x15')][_0x0191('0x16')]);return _0x408ccc(_0x1e2ece[_0x0191('0x15')]['message']);}logger['error'](_0x0191('0x14'),_0x34d03b,_0x1e2ece[_0x0191('0x15')][_0x0191('0x16')]);return _0x8a5aad(_0x1e2ece['error'][_0x0191('0x16')]);}else{logger[_0x0191('0xe')](_0x0191('0x14'),_0x34d03b,_0x0191('0xf'));_0x8a5aad(_0x1e2ece[_0x0191('0x17')][_0x0191('0x16')]);}})[_0x0191('0x18')](function(_0x173987){logger['error'](_0x0191('0x14'),_0x34d03b,_0x173987);_0x408ccc(_0x173987);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 73d3ddd..21d5135 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 _0xbd80=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','isAuthenticated','index','get','show','/:id/configurations','getConfigurations','create','post','addConfiguration','/:id','update','delete','exports','multer','util'];(function(_0x39bf9d,_0x536f2b){var _0x1780e5=function(_0x1e2260){while(--_0x1e2260){_0x39bf9d['push'](_0x39bf9d['shift']());}};_0x1780e5(++_0x536f2b);}(_0xbd80,0x91));var _0x0bd8=function(_0x3c5049,_0x43e369){_0x3c5049=_0x3c5049-0x0;var _0x32c766=_0xbd80[_0x3c5049];return _0x32c766;};'use strict';var multer=require(_0x0bd8('0x0'));var util=require(_0x0bd8('0x1'));var path=require('path');var timeout=require(_0x0bd8('0x2'));var express=require(_0x0bd8('0x3'));var router=express[_0x0bd8('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0bd8('0x5'));var config=require(_0x0bd8('0x6'));var controller=require(_0x0bd8('0x7'));router['get']('/',auth[_0x0bd8('0x8')](),controller[_0x0bd8('0x9')]);router[_0x0bd8('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0bd8('0xb')]);router[_0x0bd8('0xa')](_0x0bd8('0xc'),auth[_0x0bd8('0x8')](),controller[_0x0bd8('0xd')]);router[_0x0bd8('0xa')]('/:id/fields',auth[_0x0bd8('0x8')](),controller['getFields']);router['post']('/',auth[_0x0bd8('0x8')](),controller[_0x0bd8('0xe')]);router[_0x0bd8('0xf')](_0x0bd8('0xc'),auth['isAuthenticated'](),controller[_0x0bd8('0x10')]);router['put'](_0x0bd8('0x11'),auth[_0x0bd8('0x8')](),controller[_0x0bd8('0x12')]);router[_0x0bd8('0x13')](_0x0bd8('0x11'),auth[_0x0bd8('0x8')](),controller['destroy']);module[_0x0bd8('0x14')]=router; \ No newline at end of file +var _0x55b9=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x45b462,_0x4f61d8){var _0x5db383=function(_0x5af47d){while(--_0x5af47d){_0x45b462['push'](_0x45b462['shift']());}};_0x5db383(++_0x4f61d8);}(_0x55b9,0x191));var _0x955b=function(_0x24b3f9,_0xf3f62a){_0x24b3f9=_0x24b3f9-0x0;var _0x567f8d=_0x55b9[_0x24b3f9];return _0x567f8d;};'use strict';var multer=require(_0x955b('0x0'));var util=require(_0x955b('0x1'));var path=require(_0x955b('0x2'));var timeout=require(_0x955b('0x3'));var express=require(_0x955b('0x4'));var router=express[_0x955b('0x5')]();var fs_extra=require(_0x955b('0x6'));var auth=require(_0x955b('0x7'));var interaction=require(_0x955b('0x8'));var config=require('../../config/environment');var controller=require('./intZohoAccount.controller');router[_0x955b('0x9')]('/',auth[_0x955b('0xa')](),controller['index']);router['get'](_0x955b('0xb'),auth['isAuthenticated'](),controller[_0x955b('0xc')]);router[_0x955b('0x9')](_0x955b('0xd'),auth[_0x955b('0xa')](),controller[_0x955b('0xe')]);router['get'](_0x955b('0xf'),auth['isAuthenticated'](),controller[_0x955b('0x10')]);router[_0x955b('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x955b('0x11')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x955b('0x12')]);router[_0x955b('0x13')]('/:id',auth[_0x955b('0xa')](),controller[_0x955b('0x14')]);router[_0x955b('0x15')](_0x955b('0xb'),auth[_0x955b('0xa')](),controller[_0x955b('0x16')]);module[_0x955b('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 0f0be2f..1fe4eaf 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 _0x2dae=['STRING','sequelize'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x2dae,0xc3));var _0xe2da=function(_0x5bfb78,_0x22e3ff){_0x5bfb78=_0x5bfb78-0x0;var _0x4efd00=_0x2dae[_0x5bfb78];return _0x4efd00;};'use strict';var Sequelize=require(_0xe2da('0x0'));module['exports']={'name':{'type':Sequelize[_0xe2da('0x1')]},'description':{'type':Sequelize[_0xe2da('0x1')]},'host':{'type':Sequelize[_0xe2da('0x1')]},'zone':{'type':Sequelize[_0xe2da('0x1')]},'clientId':{'type':Sequelize[_0xe2da('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xe2da('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0xe2da('0x1')]},'refreshToken':{'type':Sequelize[_0xe2da('0x1')]}}; \ No newline at end of file +var _0x0a9a=['STRING','exports'];(function(_0x51c527,_0x34f2fd){var _0x4f7ca5=function(_0x35cf25){while(--_0x35cf25){_0x51c527['push'](_0x51c527['shift']());}};_0x4f7ca5(++_0x34f2fd);}(_0x0a9a,0x183));var _0xa0a9=function(_0x22feca,_0x3dc531){_0x22feca=_0x22feca-0x0;var _0x2d13b3=_0x0a9a[_0x22feca];return _0x2d13b3;};'use strict';var Sequelize=require('sequelize');module[_0xa0a9('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa0a9('0x1')]},'host':{'type':Sequelize[_0xa0a9('0x1')]},'zone':{'type':Sequelize[_0xa0a9('0x1')]},'clientId':{'type':Sequelize[_0xa0a9('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xa0a9('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0xa0a9('0x1')]},'refreshToken':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 44025f6..e9035cb 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 _0x4e42=['lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Zoho-oauthtoken\x20','response','message','Owner','Subject','Call_Result','Call_Start_Time','remove','includes','api_name','display_label','custom_field','picklist','pick_list_values','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','apply','reject','save','update','then','error','stack','name','send','map','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','ZohoAccount','includeAll','include','catch','show','params','find','create','body','destroy','getConfigurations','findOne','ZohoConfiguration','addConfiguration','getSubjects','Descriptions','getDescriptions','channel','ZohoField','Subjects','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','POST','/oauth/v2/token','refreshToken','clientId','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','clientSecret','serverUrl','code','host','zoho.eu','com','slice','substring'];(function(_0x2d41aa,_0x7455e8){var _0x37b420=function(_0x5e1be4){while(--_0x5e1be4){_0x2d41aa['push'](_0x2d41aa['shift']());}};_0x37b420(++_0x7455e8);}(_0x4e42,0x19b));var _0x24e4=function(_0xe36654,_0x7b16a4){_0xe36654=_0xe36654-0x0;var _0x56eb2f=_0x4e42[_0xe36654];return _0x56eb2f;};'use strict';var emlformat=require(_0x24e4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x24e4('0x1'));var jsonpatch=require(_0x24e4('0x2'));var rp=require(_0x24e4('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x24e4('0x4'));var util=require(_0x24e4('0x5'));var path=require('path');var sox=require(_0x24e4('0x6'));var csv=require(_0x24e4('0x7'));var ejs=require(_0x24e4('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x24e4('0x9'));var squel=require(_0x24e4('0xa'));var crypto=require(_0x24e4('0xb'));var jsforce=require(_0x24e4('0xc'));var deskjs=require(_0x24e4('0xd'));var toCsv=require(_0x24e4('0x7'));var querystring=require(_0x24e4('0xe'));var Papa=require(_0x24e4('0xf'));var Redis=require('ioredis');var authService=require(_0x24e4('0x10'));var qs=require(_0x24e4('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x24e4('0x12'));var logger=require(_0x24e4('0x13'))(_0x24e4('0x14'));var utils=require(_0x24e4('0x15'));var config=require(_0x24e4('0x16'));var licenseUtil=require(_0x24e4('0x17'));var db=require(_0x24e4('0x18'))['db'];var integrations=require(_0x24e4('0x19'));function respondWithStatusCode(_0x2a2c5d,_0x35864c){_0x35864c=_0x35864c||0xcc;return function(_0x1452a2){if(_0x1452a2){return _0x2a2c5d[_0x24e4('0x1a')](_0x35864c);}return _0x2a2c5d[_0x24e4('0x1b')](_0x35864c)[_0x24e4('0x1c')]();};}function respondWithResult(_0x27c560,_0x23140e){_0x23140e=_0x23140e||0xc8;return function(_0x24be76){if(_0x24be76){return _0x27c560[_0x24e4('0x1b')](_0x23140e)[_0x24e4('0x1d')](_0x24be76);}};}function respondWithFilteredResult(_0x4e5ac6,_0x78d788){return function(_0x52de8c){if(_0x52de8c){var _0x2ea1db=typeof _0x78d788[_0x24e4('0x1e')]==='undefined'&&typeof _0x78d788[_0x24e4('0x1f')]===_0x24e4('0x20');var _0x166631=_0x52de8c[_0x24e4('0x21')];var _0x5a2352=_0x2ea1db?0x0:_0x78d788[_0x24e4('0x1e')];var _0x5e0856=_0x2ea1db?_0x52de8c['count']:_0x78d788[_0x24e4('0x1e')]+_0x78d788[_0x24e4('0x1f')];var _0x4c203e;if(_0x5e0856>=_0x166631){_0x5e0856=_0x166631;_0x4c203e=0xc8;}else{_0x4c203e=0xce;}_0x4e5ac6[_0x24e4('0x1b')](_0x4c203e);return _0x4e5ac6['set']('Content-Range',_0x5a2352+'-'+_0x5e0856+'/'+_0x166631)['json'](_0x52de8c);}return null;};}function patchUpdates(_0xe2bbb2){return function(_0x560d1e){try{jsonpatch[_0x24e4('0x22')](_0x560d1e,_0xe2bbb2,!![]);}catch(_0x4b1be2){return BPromise[_0x24e4('0x23')](_0x4b1be2);}return _0x560d1e[_0x24e4('0x24')]();};}function saveUpdates(_0x5b2b31,_0x2ce434){return function(_0x109ec5){if(_0x109ec5){return _0x109ec5[_0x24e4('0x25')](_0x5b2b31)['then'](function(_0x22c8b6){return _0x22c8b6;});}return null;};}function removeEntity(_0x4e131d,_0x562b3f){return function(_0x3dba5a){if(_0x3dba5a){return _0x3dba5a['destroy']()[_0x24e4('0x26')](function(){_0x4e131d[_0x24e4('0x1b')](0xcc)[_0x24e4('0x1c')]();});}};}function handleEntityNotFound(_0x43ffad,_0x27297e){return function(_0x7c6bdf){if(!_0x7c6bdf){_0x43ffad['sendStatus'](0x194);}return _0x7c6bdf;};}function handleError(_0x305432,_0x17a854){_0x17a854=_0x17a854||0x1f4;return function(_0x2c8371){logger[_0x24e4('0x27')](_0x2c8371[_0x24e4('0x28')]);if(_0x2c8371[_0x24e4('0x29')]){delete _0x2c8371[_0x24e4('0x29')];}_0x305432['status'](_0x17a854)[_0x24e4('0x2a')](_0x2c8371);};}exports['index']=function(_0x856bc2,_0x3980d7){var _0x41772a={},_0x1a92e2={},_0x3846c8={'count':0x0,'rows':[]};var _0x45ae77=_[_0x24e4('0x2b')](db['ZohoAccount'][_0x24e4('0x2c')],function(_0x5eae28){return{'name':_0x5eae28[_0x24e4('0x2d')],'type':_0x5eae28['type']['key']};});_0x1a92e2[_0x24e4('0x2e')]=_['map'](_0x45ae77,'name');_0x1a92e2['query']=_[_0x24e4('0x2f')](_0x856bc2[_0x24e4('0x30')]);_0x1a92e2[_0x24e4('0x31')]=_[_0x24e4('0x32')](_0x1a92e2[_0x24e4('0x2e')],_0x1a92e2[_0x24e4('0x30')]);_0x41772a[_0x24e4('0x33')]=_[_0x24e4('0x32')](_0x1a92e2[_0x24e4('0x2e')],qs[_0x24e4('0x34')](_0x856bc2['query'][_0x24e4('0x34')]));_0x41772a[_0x24e4('0x33')]=_0x41772a[_0x24e4('0x33')][_0x24e4('0x35')]?_0x41772a[_0x24e4('0x33')]:_0x1a92e2[_0x24e4('0x2e')];if(!_0x856bc2[_0x24e4('0x30')][_0x24e4('0x36')](_0x24e4('0x37'))){_0x41772a[_0x24e4('0x1f')]=qs[_0x24e4('0x1f')](_0x856bc2[_0x24e4('0x30')]['limit']);_0x41772a[_0x24e4('0x1e')]=qs['offset'](_0x856bc2[_0x24e4('0x30')][_0x24e4('0x1e')]);}_0x41772a[_0x24e4('0x38')]=qs[_0x24e4('0x39')](_0x856bc2[_0x24e4('0x30')][_0x24e4('0x39')]);_0x41772a[_0x24e4('0x3a')]=qs[_0x24e4('0x31')](_[_0x24e4('0x3b')](_0x856bc2[_0x24e4('0x30')],_0x1a92e2[_0x24e4('0x31')]),_0x45ae77);if(_0x856bc2['query'][_0x24e4('0x3c')]){_0x41772a[_0x24e4('0x3a')]=_[_0x24e4('0x3d')](_0x41772a[_0x24e4('0x3a')],{'$or':_[_0x24e4('0x2b')](_0x45ae77,function(_0x5a5bc4){if(_0x5a5bc4[_0x24e4('0x3e')]!=='VIRTUAL'){var _0x48abc6={};_0x48abc6[_0x5a5bc4[_0x24e4('0x29')]]={'$like':'%'+_0x856bc2[_0x24e4('0x30')]['filter']+'%'};return _0x48abc6;}})});}_0x41772a=_[_0x24e4('0x3d')]({},_0x41772a,_0x856bc2[_0x24e4('0x3f')]);var _0x4db772={'where':_0x41772a['where']};return db[_0x24e4('0x40')][_0x24e4('0x21')](_0x4db772)[_0x24e4('0x26')](function(_0x1eecdf){_0x3846c8['count']=_0x1eecdf;if(_0x856bc2['query'][_0x24e4('0x41')]){_0x41772a[_0x24e4('0x42')]=[{'all':!![]}];}return db[_0x24e4('0x40')]['findAll'](_0x41772a);})[_0x24e4('0x26')](function(_0x38ae3c){_0x3846c8['rows']=_0x38ae3c;return _0x3846c8;})[_0x24e4('0x26')](respondWithFilteredResult(_0x3980d7,_0x41772a))[_0x24e4('0x43')](handleError(_0x3980d7,null));};exports[_0x24e4('0x44')]=function(_0x181ae3,_0x568396){var _0x33b377={'raw':![],'where':{'id':_0x181ae3[_0x24e4('0x45')]['id']}},_0x27d5fb={};_0x27d5fb[_0x24e4('0x2e')]=_[_0x24e4('0x2f')](db[_0x24e4('0x40')][_0x24e4('0x2c')]);_0x27d5fb[_0x24e4('0x30')]=_['keys'](_0x181ae3[_0x24e4('0x30')]);_0x27d5fb[_0x24e4('0x31')]=_['intersection'](_0x27d5fb[_0x24e4('0x2e')],_0x27d5fb['query']);_0x33b377[_0x24e4('0x33')]=_['intersection'](_0x27d5fb['model'],qs['fields'](_0x181ae3[_0x24e4('0x30')][_0x24e4('0x34')]));_0x33b377[_0x24e4('0x33')]=_0x33b377[_0x24e4('0x33')][_0x24e4('0x35')]?_0x33b377['attributes']:_0x27d5fb[_0x24e4('0x2e')];if(_0x181ae3[_0x24e4('0x30')]['includeAll']){_0x33b377['include']=[{'all':!![]}];}_0x33b377=_[_0x24e4('0x3d')]({},_0x33b377,_0x181ae3[_0x24e4('0x3f')]);return db['ZohoAccount'][_0x24e4('0x46')](_0x33b377)[_0x24e4('0x26')](handleEntityNotFound(_0x568396,null))[_0x24e4('0x26')](respondWithResult(_0x568396,null))[_0x24e4('0x43')](handleError(_0x568396,null));};exports['create']=function(_0x117de7,_0x291fc0){return db[_0x24e4('0x40')][_0x24e4('0x47')](_0x117de7[_0x24e4('0x48')],{})[_0x24e4('0x26')](respondWithResult(_0x291fc0,0xc9))[_0x24e4('0x43')](handleError(_0x291fc0,null));};exports[_0x24e4('0x25')]=function(_0x2bc017,_0x4b9ec8){if(_0x2bc017[_0x24e4('0x48')]['id']){delete _0x2bc017[_0x24e4('0x48')]['id'];}return db[_0x24e4('0x40')]['find']({'where':{'id':_0x2bc017['params']['id']}})[_0x24e4('0x26')](handleEntityNotFound(_0x4b9ec8,null))['then'](saveUpdates(_0x2bc017[_0x24e4('0x48')],null))['then'](respondWithResult(_0x4b9ec8,null))['catch'](handleError(_0x4b9ec8,null));};exports[_0x24e4('0x49')]=function(_0x5a7539,_0x39fb4d){return db[_0x24e4('0x40')][_0x24e4('0x46')]({'where':{'id':_0x5a7539['params']['id']}})[_0x24e4('0x26')](handleEntityNotFound(_0x39fb4d,null))[_0x24e4('0x26')](removeEntity(_0x39fb4d,null))['catch'](handleError(_0x39fb4d,null));};exports[_0x24e4('0x4a')]=function(_0x2d8e0b,_0x10b179,_0x1f89dc){var _0x51c973={};var _0x34294a={};var _0x32e194;var _0x21ada8;return db[_0x24e4('0x40')][_0x24e4('0x4b')]({'where':{'id':_0x2d8e0b[_0x24e4('0x45')]['id']}})[_0x24e4('0x26')](handleEntityNotFound(_0x10b179,null))['then'](function(_0x5684c4){if(_0x5684c4){_0x32e194=_0x5684c4;_0x34294a[_0x24e4('0x2e')]=_['keys'](db[_0x24e4('0x4c')][_0x24e4('0x2c')]);_0x34294a[_0x24e4('0x30')]=_['keys'](_0x2d8e0b[_0x24e4('0x30')]);_0x34294a[_0x24e4('0x31')]=_[_0x24e4('0x32')](_0x34294a[_0x24e4('0x2e')],_0x34294a[_0x24e4('0x30')]);_0x51c973[_0x24e4('0x33')]=_[_0x24e4('0x32')](_0x34294a[_0x24e4('0x2e')],qs[_0x24e4('0x34')](_0x2d8e0b[_0x24e4('0x30')][_0x24e4('0x34')]));_0x51c973[_0x24e4('0x33')]=_0x51c973[_0x24e4('0x33')]['length']?_0x51c973[_0x24e4('0x33')]:_0x34294a[_0x24e4('0x2e')];_0x51c973[_0x24e4('0x38')]=qs[_0x24e4('0x39')](_0x2d8e0b[_0x24e4('0x30')][_0x24e4('0x39')]);_0x51c973['where']=qs[_0x24e4('0x31')](_[_0x24e4('0x3b')](_0x2d8e0b[_0x24e4('0x30')],_0x34294a['filters']));if(_0x2d8e0b[_0x24e4('0x30')][_0x24e4('0x3c')]){_0x51c973[_0x24e4('0x3a')]=_[_0x24e4('0x3d')](_0x51c973[_0x24e4('0x3a')],{'$or':_[_0x24e4('0x2b')](_0x51c973[_0x24e4('0x33')],function(_0x21295d){var _0x317ba7={};_0x317ba7[_0x21295d]={'$like':'%'+_0x2d8e0b['query'][_0x24e4('0x3c')]+'%'};return _0x317ba7;})});}_0x51c973=_['merge']({},_0x51c973,_0x2d8e0b[_0x24e4('0x3f')]);return _0x32e194[_0x24e4('0x4a')](_0x51c973);}})['then'](function(_0x47252f){if(_0x47252f){_0x21ada8=_0x47252f['length'];if(!_0x2d8e0b[_0x24e4('0x30')][_0x24e4('0x36')](_0x24e4('0x37'))){_0x51c973[_0x24e4('0x1f')]=qs[_0x24e4('0x1f')](_0x2d8e0b['query']['limit']);_0x51c973[_0x24e4('0x1e')]=qs[_0x24e4('0x1e')](_0x2d8e0b['query'][_0x24e4('0x1e')]);}return _0x32e194[_0x24e4('0x4a')](_0x51c973);}})['then'](function(_0x467106){if(_0x467106){return _0x467106?{'count':_0x21ada8,'rows':_0x467106}:null;}})[_0x24e4('0x26')](respondWithResult(_0x10b179,null))[_0x24e4('0x43')](handleError(_0x10b179,null));};exports[_0x24e4('0x4d')]=function(_0x35c05f,_0x5e0bbb,_0xf9d646){if(_0x35c05f[_0x24e4('0x48')]['id']){delete _0x35c05f[_0x24e4('0x48')]['id'];}return db[_0x24e4('0x40')]['findOne']({'where':{'id':_0x35c05f[_0x24e4('0x45')]['id']}})[_0x24e4('0x26')](handleEntityNotFound(_0x5e0bbb,null))[_0x24e4('0x26')](function(_0x2a88e2){if(_0x2a88e2){_0x35c05f['body']['AccountId']=_0x2a88e2['id'];_0x35c05f[_0x24e4('0x48')]['Subjects']=integrations[_0x24e4('0x4e')](_0x35c05f[_0x24e4('0x48')]['channel'],_0x35c05f[_0x24e4('0x48')][_0x24e4('0x3e')]);_0x35c05f['body'][_0x24e4('0x4f')]=integrations[_0x24e4('0x50')](_0x35c05f[_0x24e4('0x48')][_0x24e4('0x51')],_0x35c05f[_0x24e4('0x48')][_0x24e4('0x3e')]);return db[_0x24e4('0x4c')][_0x24e4('0x47')](_0x35c05f['body'],{'include':[{'model':db[_0x24e4('0x52')],'as':_0x24e4('0x53')},{'model':db[_0x24e4('0x52')],'as':'Descriptions'}]});}return null;})[_0x24e4('0x26')](respondWithResult(_0x5e0bbb,null))[_0x24e4('0x43')](handleError(_0x5e0bbb,null));};function getAccessToken(_0x4f03b1){return new Promise(function(_0x5d02cd,_0x3ae6c5){var _0x4ad44c;switch(_0x4f03b1[_0x24e4('0x54')]){case'US':_0x4ad44c=_0x24e4('0x55');break;case'AU':_0x4ad44c=_0x24e4('0x56');break;case'EU':_0x4ad44c=_0x24e4('0x57');break;case'IN':_0x4ad44c=_0x24e4('0x58');break;case'CN':_0x4ad44c='https://accounts.zoho.com.cn';break;default:_0x4ad44c=_0x24e4('0x57');break;}var _0x1d7acb={'method':_0x24e4('0x59'),'uri':_0x4ad44c+_0x24e4('0x5a'),'qs':{'refresh_token':_0x4f03b1[_0x24e4('0x5b')],'client_id':_0x4f03b1[_0x24e4('0x5c')],'client_secret':_0x4f03b1['clientSecret'],'grant_type':_0x24e4('0x5d')},'json':!![]};return rp(_0x1d7acb)[_0x24e4('0x26')](function(_0x190c4a){if(_0x190c4a[_0x24e4('0x5e')]){_0x5d02cd(_0x190c4a[_0x24e4('0x5e')]);}else{_0x3ae6c5(_0x24e4('0x5f'));}})[_0x24e4('0x43')](function(_0x132650){_0x3ae6c5(_0x132650);});});}exports[_0x24e4('0x60')]=function(_0x557ca0,_0xbc0036,_0x16be30){var _0x3fbfb7,_0x196162,_0x1ae0c0,_0x497608,_0x520857;return db[_0x24e4('0x40')][_0x24e4('0x4b')]({'where':{'id':_0x557ca0[_0x24e4('0x45')]['id']},'attributes':['id','host',_0x24e4('0x54'),_0x24e4('0x5c'),_0x24e4('0x61'),_0x24e4('0x62'),_0x24e4('0x63'),'refreshToken']})[_0x24e4('0x26')](handleEntityNotFound(_0xbc0036,null))[_0x24e4('0x26')](function(_0x55d955){_0x520857=_0x55d955;_0x3fbfb7=_0x520857[_0x24e4('0x64')];_0x196162=_0x3fbfb7===_0x24e4('0x65')?'eu':_0x24e4('0x66');_0x1ae0c0=_0x520857['serverUrl'];var _0x240852=_0x1ae0c0[_0x24e4('0x67')](-0x1);if(_0x240852==='/'||_0x240852==='\x5c'||_0x240852===':'){_0x1ae0c0=_0x1ae0c0[_0x24e4('0x68')](0x0,_0x1ae0c0[_0x24e4('0x69')](_0x240852));}if(!_0x520857[_0x24e4('0x5b')]){throw new Error(_0x24e4('0x6a'));}return getAccessToken(_0x520857);})['then'](function(_0x2d82e5){if(_0x2d82e5){return rp({'method':_0x24e4('0x6b'),'uri':util[_0x24e4('0x6c')](_0x24e4('0x6d'),_0x196162),'qs':{'module':'Calls'},'headers':{'Authorization':_0x24e4('0x6e')+_0x2d82e5},'json':!![]});}})[_0x24e4('0x26')](function(_0x3e8374){if(_0x3e8374){if(_0x3e8374[_0x24e4('0x6f')]&&_0x3e8374[_0x24e4('0x6f')][_0x24e4('0x27')]){throw new Error(_0x3e8374['response'][_0x24e4('0x27')][_0x24e4('0x70')]);}var _0x507bda=[];var _0x4d41ca=[];var _0x25af85=[_0x24e4('0x71'),_0x24e4('0x72'),'Description','WhoId','Call_Duration',_0x24e4('0x73'),_0x24e4('0x74'),'Call_Type'];_0x4d41ca=_[_0x24e4('0x75')](_0x3e8374[_0x24e4('0x34')],function(_0x6a5d08){return _0x25af85[_0x24e4('0x76')](_0x6a5d08[_0x24e4('0x77')]);});for(var _0x20af0f=0x0;_0x20af0f<_0x4d41ca[_0x24e4('0x35')];_0x20af0f++){if(_0x4d41ca[_0x20af0f]['system_mandatory']===![]){_0x507bda['push']({'id':_0x4d41ca[_0x20af0f]['id'],'name':_0x4d41ca[_0x20af0f][_0x24e4('0x78')],'custom':_0x4d41ca[_0x20af0f][_0x24e4('0x79')],'options':_0x4d41ca[_0x20af0f]['data_type']===_0x24e4('0x7a')&&_0x4d41ca[_0x20af0f][_0x24e4('0x7b')][_0x24e4('0x35')]>-0x1?_[_0x24e4('0x2b')](_0x4d41ca[_0x20af0f][_0x24e4('0x7b')],function(_0x2f5973){return{'name':_0x2f5973,'value':_0x2f5973};}):[]});}}return{'count':_0x507bda[_0x24e4('0x35')],'rows':_0x507bda};}else{return{'count':0x0,'rows':[]};}})[_0x24e4('0x26')](respondWithResult(_0xbc0036,null))['catch'](function(_0x3a7823){var _0x4f0d13=_0x557ca0[_0x24e4('0x30')][_0x24e4('0x7c')]?0x1f4:_0x3a7823['statusCode']||0x1f4;logger[_0x24e4('0x27')](_0x24e4('0x7d'),'getFields',_0x4f0d13,JSON[_0x24e4('0x7e')](_0x3a7823));delete _0x3a7823[_0x24e4('0x29')];if(_0x4f0d13===0x191){_0x4f0d13=0x190;}_0xbc0036['status'](_0x4f0d13)[_0x24e4('0x2a')](_0x557ca0[_0x24e4('0x30')][_0x24e4('0x7c')]?{'message':_0x24e4('0x7f'),'statusCode':_0x3a7823[_0x24e4('0x80')]}:_0x3a7823);});}; \ No newline at end of file +var _0xb226=['reject','save','update','then','sendStatus','error','stack','name','index','map','ZohoAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','count','includeAll','rows','show','params','include','create','body','find','catch','destroy','getConfigurations','findOne','ZohoConfiguration','pick','addConfiguration','Subjects','getSubjects','channel','type','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','POST','/oauth/v2/token','clientId','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','clientSecret','serverUrl','code','refreshToken','zoho.eu','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Owner','Subject','WhoId','Call_Duration','Call_Result','Call_Type','remove','api_name','system_mandatory','push','display_label','custom_field','data_type','pick_list_values','test','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','status','offset','undefined','limit','set','Content-Range','json','apply'];(function(_0x2d0d9f,_0x22c0d8){var _0x30243d=function(_0x29a92b){while(--_0x29a92b){_0x2d0d9f['push'](_0x2d0d9f['shift']());}};_0x30243d(++_0x22c0d8);}(_0xb226,0x177));var _0x6b22=function(_0x2f25ed,_0x3e0622){_0x2f25ed=_0x2f25ed-0x0;var _0x19c980=_0xb226[_0x2f25ed];return _0x19c980;};'use strict';var emlformat=require(_0x6b22('0x0'));var rimraf=require(_0x6b22('0x1'));var zipdir=require(_0x6b22('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6b22('0x3'));var BPromise=require(_0x6b22('0x4'));var Mustache=require(_0x6b22('0x5'));var util=require(_0x6b22('0x6'));var path=require(_0x6b22('0x7'));var sox=require('sox');var csv=require(_0x6b22('0x8'));var ejs=require(_0x6b22('0x9'));var fs=require('fs');var fs_extra=require(_0x6b22('0xa'));var _=require('lodash');var squel=require(_0x6b22('0xb'));var crypto=require(_0x6b22('0xc'));var jsforce=require(_0x6b22('0xd'));var deskjs=require(_0x6b22('0xe'));var toCsv=require(_0x6b22('0x8'));var querystring=require(_0x6b22('0xf'));var Papa=require(_0x6b22('0x10'));var Redis=require(_0x6b22('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6b22('0x12'));var hardwareService=require(_0x6b22('0x13'));var logger=require(_0x6b22('0x14'))(_0x6b22('0x15'));var utils=require(_0x6b22('0x16'));var config=require(_0x6b22('0x17'));var licenseUtil=require(_0x6b22('0x18'));var db=require(_0x6b22('0x19'))['db'];var integrations=require(_0x6b22('0x1a'));function respondWithStatusCode(_0xd62654,_0x11b446){_0x11b446=_0x11b446||0xcc;return function(_0x51fe0a){if(_0x51fe0a){return _0xd62654['sendStatus'](_0x11b446);}return _0xd62654['status'](_0x11b446)[_0x6b22('0x1b')]();};}function respondWithResult(_0x484178,_0x5b3c72){_0x5b3c72=_0x5b3c72||0xc8;return function(_0x3da628){if(_0x3da628){return _0x484178[_0x6b22('0x1c')](_0x5b3c72)['json'](_0x3da628);}};}function respondWithFilteredResult(_0x437e16,_0x53550f){return function(_0x40d0fb){if(_0x40d0fb){var _0x5db0f1=typeof _0x53550f[_0x6b22('0x1d')]===_0x6b22('0x1e')&&typeof _0x53550f[_0x6b22('0x1f')]===_0x6b22('0x1e');var _0x12bb33=_0x40d0fb['count'];var _0x1723bf=_0x5db0f1?0x0:_0x53550f[_0x6b22('0x1d')];var _0x3c2515=_0x5db0f1?_0x40d0fb['count']:_0x53550f[_0x6b22('0x1d')]+_0x53550f[_0x6b22('0x1f')];var _0x44001a;if(_0x3c2515>=_0x12bb33){_0x3c2515=_0x12bb33;_0x44001a=0xc8;}else{_0x44001a=0xce;}_0x437e16[_0x6b22('0x1c')](_0x44001a);return _0x437e16[_0x6b22('0x20')](_0x6b22('0x21'),_0x1723bf+'-'+_0x3c2515+'/'+_0x12bb33)[_0x6b22('0x22')](_0x40d0fb);}return null;};}function patchUpdates(_0x2c21dd){return function(_0x22b522){try{jsonpatch[_0x6b22('0x23')](_0x22b522,_0x2c21dd,!![]);}catch(_0x2bca82){return BPromise[_0x6b22('0x24')](_0x2bca82);}return _0x22b522[_0x6b22('0x25')]();};}function saveUpdates(_0x12d34c,_0x4a6d2a){return function(_0x488170){if(_0x488170){return _0x488170[_0x6b22('0x26')](_0x12d34c)[_0x6b22('0x27')](function(_0x2e7d37){return _0x2e7d37;});}return null;};}function removeEntity(_0x22bb31,_0x14a20d){return function(_0x355ed4){if(_0x355ed4){return _0x355ed4['destroy']()['then'](function(){_0x22bb31[_0x6b22('0x1c')](0xcc)[_0x6b22('0x1b')]();});}};}function handleEntityNotFound(_0x29e659,_0x54b296){return function(_0x374a1e){if(!_0x374a1e){_0x29e659[_0x6b22('0x28')](0x194);}return _0x374a1e;};}function handleError(_0x4d0fc5,_0x531be8){_0x531be8=_0x531be8||0x1f4;return function(_0x4aadf9){logger[_0x6b22('0x29')](_0x4aadf9[_0x6b22('0x2a')]);if(_0x4aadf9['name']){delete _0x4aadf9[_0x6b22('0x2b')];}_0x4d0fc5[_0x6b22('0x1c')](_0x531be8)['send'](_0x4aadf9);};}exports[_0x6b22('0x2c')]=function(_0x262a31,_0x17285b){var _0x390489={},_0x596d88={},_0x5730d7={'count':0x0,'rows':[]};var _0x42ede0=_[_0x6b22('0x2d')](db[_0x6b22('0x2e')][_0x6b22('0x2f')],function(_0x2c422f){return{'name':_0x2c422f[_0x6b22('0x30')],'type':_0x2c422f['type'][_0x6b22('0x31')]};});_0x596d88[_0x6b22('0x32')]=_[_0x6b22('0x2d')](_0x42ede0,'name');_0x596d88[_0x6b22('0x33')]=_[_0x6b22('0x34')](_0x262a31['query']);_0x596d88[_0x6b22('0x35')]=_[_0x6b22('0x36')](_0x596d88[_0x6b22('0x32')],_0x596d88[_0x6b22('0x33')]);_0x390489[_0x6b22('0x37')]=_[_0x6b22('0x36')](_0x596d88[_0x6b22('0x32')],qs[_0x6b22('0x38')](_0x262a31[_0x6b22('0x33')]['fields']));_0x390489[_0x6b22('0x37')]=_0x390489[_0x6b22('0x37')][_0x6b22('0x39')]?_0x390489[_0x6b22('0x37')]:_0x596d88[_0x6b22('0x32')];if(!_0x262a31[_0x6b22('0x33')][_0x6b22('0x3a')](_0x6b22('0x3b'))){_0x390489[_0x6b22('0x1f')]=qs[_0x6b22('0x1f')](_0x262a31[_0x6b22('0x33')][_0x6b22('0x1f')]);_0x390489[_0x6b22('0x1d')]=qs[_0x6b22('0x1d')](_0x262a31[_0x6b22('0x33')]['offset']);}_0x390489[_0x6b22('0x3c')]=qs['sort'](_0x262a31['query'][_0x6b22('0x3d')]);_0x390489['where']=qs[_0x6b22('0x35')](_['pick'](_0x262a31[_0x6b22('0x33')],_0x596d88[_0x6b22('0x35')]),_0x42ede0);if(_0x262a31[_0x6b22('0x33')][_0x6b22('0x3e')]){_0x390489[_0x6b22('0x3f')]=_[_0x6b22('0x40')](_0x390489[_0x6b22('0x3f')],{'$or':_['map'](_0x42ede0,function(_0x43f6c8){if(_0x43f6c8['type']!==_0x6b22('0x41')){var _0x2c766c={};_0x2c766c[_0x43f6c8[_0x6b22('0x2b')]]={'$like':'%'+_0x262a31[_0x6b22('0x33')][_0x6b22('0x3e')]+'%'};return _0x2c766c;}})});}_0x390489=_[_0x6b22('0x40')]({},_0x390489,_0x262a31[_0x6b22('0x42')]);var _0x338cfa={'where':_0x390489[_0x6b22('0x3f')]};return db[_0x6b22('0x2e')][_0x6b22('0x43')](_0x338cfa)[_0x6b22('0x27')](function(_0x20c578){_0x5730d7[_0x6b22('0x43')]=_0x20c578;if(_0x262a31[_0x6b22('0x33')][_0x6b22('0x44')]){_0x390489['include']=[{'all':!![]}];}return db[_0x6b22('0x2e')]['findAll'](_0x390489);})[_0x6b22('0x27')](function(_0xd70642){_0x5730d7[_0x6b22('0x45')]=_0xd70642;return _0x5730d7;})[_0x6b22('0x27')](respondWithFilteredResult(_0x17285b,_0x390489))['catch'](handleError(_0x17285b,null));};exports[_0x6b22('0x46')]=function(_0x27ad5f,_0x9385f8){var _0x586e17={'raw':![],'where':{'id':_0x27ad5f[_0x6b22('0x47')]['id']}},_0x1bc3ce={};_0x1bc3ce[_0x6b22('0x32')]=_['keys'](db[_0x6b22('0x2e')][_0x6b22('0x2f')]);_0x1bc3ce['query']=_[_0x6b22('0x34')](_0x27ad5f[_0x6b22('0x33')]);_0x1bc3ce[_0x6b22('0x35')]=_[_0x6b22('0x36')](_0x1bc3ce[_0x6b22('0x32')],_0x1bc3ce[_0x6b22('0x33')]);_0x586e17[_0x6b22('0x37')]=_['intersection'](_0x1bc3ce[_0x6b22('0x32')],qs['fields'](_0x27ad5f[_0x6b22('0x33')][_0x6b22('0x38')]));_0x586e17[_0x6b22('0x37')]=_0x586e17[_0x6b22('0x37')][_0x6b22('0x39')]?_0x586e17[_0x6b22('0x37')]:_0x1bc3ce[_0x6b22('0x32')];if(_0x27ad5f['query'][_0x6b22('0x44')]){_0x586e17[_0x6b22('0x48')]=[{'all':!![]}];}_0x586e17=_[_0x6b22('0x40')]({},_0x586e17,_0x27ad5f[_0x6b22('0x42')]);return db['ZohoAccount']['find'](_0x586e17)[_0x6b22('0x27')](handleEntityNotFound(_0x9385f8,null))[_0x6b22('0x27')](respondWithResult(_0x9385f8,null))['catch'](handleError(_0x9385f8,null));};exports['create']=function(_0x5bcd43,_0x4acfaa){return db[_0x6b22('0x2e')][_0x6b22('0x49')](_0x5bcd43[_0x6b22('0x4a')],{})[_0x6b22('0x27')](respondWithResult(_0x4acfaa,0xc9))['catch'](handleError(_0x4acfaa,null));};exports[_0x6b22('0x26')]=function(_0x351f85,_0x2f4e88){if(_0x351f85['body']['id']){delete _0x351f85[_0x6b22('0x4a')]['id'];}return db[_0x6b22('0x2e')][_0x6b22('0x4b')]({'where':{'id':_0x351f85[_0x6b22('0x47')]['id']}})['then'](handleEntityNotFound(_0x2f4e88,null))[_0x6b22('0x27')](saveUpdates(_0x351f85[_0x6b22('0x4a')],null))[_0x6b22('0x27')](respondWithResult(_0x2f4e88,null))[_0x6b22('0x4c')](handleError(_0x2f4e88,null));};exports[_0x6b22('0x4d')]=function(_0x3cdcda,_0x50a5a1){return db[_0x6b22('0x2e')][_0x6b22('0x4b')]({'where':{'id':_0x3cdcda[_0x6b22('0x47')]['id']}})[_0x6b22('0x27')](handleEntityNotFound(_0x50a5a1,null))[_0x6b22('0x27')](removeEntity(_0x50a5a1,null))[_0x6b22('0x4c')](handleError(_0x50a5a1,null));};exports[_0x6b22('0x4e')]=function(_0x1f5dc6,_0x5beb20,_0xe2e19b){var _0x2d7fd8={};var _0xe87c53={};var _0xbd41dc;var _0xc1a684;return db[_0x6b22('0x2e')][_0x6b22('0x4f')]({'where':{'id':_0x1f5dc6[_0x6b22('0x47')]['id']}})[_0x6b22('0x27')](handleEntityNotFound(_0x5beb20,null))[_0x6b22('0x27')](function(_0x2db6f0){if(_0x2db6f0){_0xbd41dc=_0x2db6f0;_0xe87c53['model']=_[_0x6b22('0x34')](db[_0x6b22('0x50')][_0x6b22('0x2f')]);_0xe87c53[_0x6b22('0x33')]=_[_0x6b22('0x34')](_0x1f5dc6[_0x6b22('0x33')]);_0xe87c53[_0x6b22('0x35')]=_['intersection'](_0xe87c53[_0x6b22('0x32')],_0xe87c53[_0x6b22('0x33')]);_0x2d7fd8[_0x6b22('0x37')]=_[_0x6b22('0x36')](_0xe87c53[_0x6b22('0x32')],qs[_0x6b22('0x38')](_0x1f5dc6[_0x6b22('0x33')]['fields']));_0x2d7fd8[_0x6b22('0x37')]=_0x2d7fd8['attributes'][_0x6b22('0x39')]?_0x2d7fd8['attributes']:_0xe87c53[_0x6b22('0x32')];_0x2d7fd8[_0x6b22('0x3c')]=qs[_0x6b22('0x3d')](_0x1f5dc6['query']['sort']);_0x2d7fd8['where']=qs[_0x6b22('0x35')](_[_0x6b22('0x51')](_0x1f5dc6[_0x6b22('0x33')],_0xe87c53[_0x6b22('0x35')]));if(_0x1f5dc6[_0x6b22('0x33')][_0x6b22('0x3e')]){_0x2d7fd8[_0x6b22('0x3f')]=_[_0x6b22('0x40')](_0x2d7fd8['where'],{'$or':_[_0x6b22('0x2d')](_0x2d7fd8['attributes'],function(_0x5992f5){var _0x1536de={};_0x1536de[_0x5992f5]={'$like':'%'+_0x1f5dc6[_0x6b22('0x33')][_0x6b22('0x3e')]+'%'};return _0x1536de;})});}_0x2d7fd8=_[_0x6b22('0x40')]({},_0x2d7fd8,_0x1f5dc6[_0x6b22('0x42')]);return _0xbd41dc[_0x6b22('0x4e')](_0x2d7fd8);}})[_0x6b22('0x27')](function(_0x5658f0){if(_0x5658f0){_0xc1a684=_0x5658f0[_0x6b22('0x39')];if(!_0x1f5dc6['query'][_0x6b22('0x3a')](_0x6b22('0x3b'))){_0x2d7fd8[_0x6b22('0x1f')]=qs['limit'](_0x1f5dc6['query'][_0x6b22('0x1f')]);_0x2d7fd8[_0x6b22('0x1d')]=qs[_0x6b22('0x1d')](_0x1f5dc6[_0x6b22('0x33')]['offset']);}return _0xbd41dc[_0x6b22('0x4e')](_0x2d7fd8);}})[_0x6b22('0x27')](function(_0x3aa130){if(_0x3aa130){return _0x3aa130?{'count':_0xc1a684,'rows':_0x3aa130}:null;}})[_0x6b22('0x27')](respondWithResult(_0x5beb20,null))[_0x6b22('0x4c')](handleError(_0x5beb20,null));};exports[_0x6b22('0x52')]=function(_0x52b963,_0x1491a4,_0x103fe6){if(_0x52b963[_0x6b22('0x4a')]['id']){delete _0x52b963['body']['id'];}return db[_0x6b22('0x2e')][_0x6b22('0x4f')]({'where':{'id':_0x52b963['params']['id']}})['then'](handleEntityNotFound(_0x1491a4,null))[_0x6b22('0x27')](function(_0x4f206d){if(_0x4f206d){_0x52b963[_0x6b22('0x4a')]['AccountId']=_0x4f206d['id'];_0x52b963[_0x6b22('0x4a')][_0x6b22('0x53')]=integrations[_0x6b22('0x54')](_0x52b963[_0x6b22('0x4a')][_0x6b22('0x55')],_0x52b963[_0x6b22('0x4a')][_0x6b22('0x56')]);_0x52b963[_0x6b22('0x4a')][_0x6b22('0x57')]=integrations[_0x6b22('0x58')](_0x52b963['body'][_0x6b22('0x55')],_0x52b963[_0x6b22('0x4a')][_0x6b22('0x56')]);return db[_0x6b22('0x50')]['create'](_0x52b963[_0x6b22('0x4a')],{'include':[{'model':db[_0x6b22('0x59')],'as':_0x6b22('0x53')},{'model':db[_0x6b22('0x59')],'as':_0x6b22('0x57')}]});}return null;})['then'](respondWithResult(_0x1491a4,null))[_0x6b22('0x4c')](handleError(_0x1491a4,null));};function getAccessToken(_0x409ac0){return new Promise(function(_0xc41408,_0x2ac25f){var _0x5e6e96;switch(_0x409ac0[_0x6b22('0x5a')]){case'US':_0x5e6e96=_0x6b22('0x5b');break;case'AU':_0x5e6e96=_0x6b22('0x5c');break;case'EU':_0x5e6e96='https://accounts.zoho.eu';break;case'IN':_0x5e6e96=_0x6b22('0x5d');break;case'CN':_0x5e6e96='https://accounts.zoho.com.cn';break;default:_0x5e6e96='https://accounts.zoho.eu';break;}var _0x545337={'method':_0x6b22('0x5e'),'uri':_0x5e6e96+_0x6b22('0x5f'),'qs':{'refresh_token':_0x409ac0['refreshToken'],'client_id':_0x409ac0[_0x6b22('0x60')],'client_secret':_0x409ac0['clientSecret'],'grant_type':_0x6b22('0x61')},'json':!![]};return rp(_0x545337)['then'](function(_0x2bbd03){if(_0x2bbd03[_0x6b22('0x62')]){_0xc41408(_0x2bbd03['access_token']);}else{_0x2ac25f(_0x6b22('0x63'));}})[_0x6b22('0x4c')](function(_0x38e3cd){_0x2ac25f(_0x38e3cd);});});}exports[_0x6b22('0x64')]=function(_0x1fb7ad,_0x5569bc,_0x3c3eb2){var _0x222d28,_0x276e7f,_0x304a85,_0x27e1d8,_0x16b758;return db['ZohoAccount']['findOne']({'where':{'id':_0x1fb7ad[_0x6b22('0x47')]['id']},'attributes':['id',_0x6b22('0x65'),_0x6b22('0x5a'),_0x6b22('0x60'),_0x6b22('0x66'),_0x6b22('0x67'),_0x6b22('0x68'),_0x6b22('0x69')]})[_0x6b22('0x27')](handleEntityNotFound(_0x5569bc,null))[_0x6b22('0x27')](function(_0x48f47e){_0x16b758=_0x48f47e;_0x222d28=_0x16b758[_0x6b22('0x65')];_0x276e7f=_0x222d28===_0x6b22('0x6a')?'eu':'com';_0x304a85=_0x16b758[_0x6b22('0x67')];var _0x564e01=_0x304a85[_0x6b22('0x6b')](-0x1);if(_0x564e01==='/'||_0x564e01==='\x5c'||_0x564e01===':'){_0x304a85=_0x304a85[_0x6b22('0x6c')](0x0,_0x304a85[_0x6b22('0x6d')](_0x564e01));}if(!_0x16b758[_0x6b22('0x69')]){throw new Error(_0x6b22('0x6e'));}return getAccessToken(_0x16b758);})[_0x6b22('0x27')](function(_0x570104){if(_0x570104){return rp({'method':_0x6b22('0x6f'),'uri':util['format'](_0x6b22('0x70'),_0x276e7f),'qs':{'module':_0x6b22('0x71')},'headers':{'Authorization':_0x6b22('0x72')+_0x570104},'json':!![]});}})[_0x6b22('0x27')](function(_0x4eae4a){if(_0x4eae4a){if(_0x4eae4a['response']&&_0x4eae4a[_0x6b22('0x73')][_0x6b22('0x29')]){throw new Error(_0x4eae4a[_0x6b22('0x73')][_0x6b22('0x29')][_0x6b22('0x74')]);}var _0x3f407e=[];var _0x157b24=[];var _0x5ef903=[_0x6b22('0x75'),_0x6b22('0x76'),'Description',_0x6b22('0x77'),_0x6b22('0x78'),_0x6b22('0x79'),'Call_Start_Time',_0x6b22('0x7a')];_0x157b24=_[_0x6b22('0x7b')](_0x4eae4a[_0x6b22('0x38')],function(_0x2afd0a){return _0x5ef903['includes'](_0x2afd0a[_0x6b22('0x7c')]);});for(var _0x54d076=0x0;_0x54d076<_0x157b24[_0x6b22('0x39')];_0x54d076++){if(_0x157b24[_0x54d076][_0x6b22('0x7d')]===![]){_0x3f407e[_0x6b22('0x7e')]({'id':_0x157b24[_0x54d076]['id'],'name':_0x157b24[_0x54d076][_0x6b22('0x7f')],'custom':_0x157b24[_0x54d076][_0x6b22('0x80')],'options':_0x157b24[_0x54d076][_0x6b22('0x81')]==='picklist'&&_0x157b24[_0x54d076][_0x6b22('0x82')]['length']>-0x1?_[_0x6b22('0x2d')](_0x157b24[_0x54d076]['pick_list_values'],function(_0x38d32b){return{'name':_0x38d32b,'value':_0x38d32b};}):[]});}}return{'count':_0x3f407e['length'],'rows':_0x3f407e};}else{return{'count':0x0,'rows':[]};}})[_0x6b22('0x27')](respondWithResult(_0x5569bc,null))['catch'](function(_0x4fc666){var _0xb1150c=_0x1fb7ad[_0x6b22('0x33')][_0x6b22('0x83')]?0x1f4:_0x4fc666['statusCode']||0x1f4;logger[_0x6b22('0x29')](_0x6b22('0x84'),_0x6b22('0x64'),_0xb1150c,JSON[_0x6b22('0x85')](_0x4fc666));delete _0x4fc666[_0x6b22('0x2b')];if(_0xb1150c===0x191){_0xb1150c=0x190;}_0x5569bc['status'](_0xb1150c)[_0x6b22('0x86')](_0x1fb7ad['query'][_0x6b22('0x83')]?{'message':_0x6b22('0x87'),'statusCode':_0x4fc666[_0x6b22('0x88')]}:_0x4fc666);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 00e7b29..cdf06eb 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 _0xdfcc=['host','serverUrl','slice','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','authorization_code','clientSecret','application/x-www-form-urlencoded','parse','refreshToken','info','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','error','format','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','name','inspect','substring','https://accounts.zoho.com.au','https://accounts.zoho.eu','then','refresh_token','catch','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','changed','zone','clientId','code'];(function(_0x248935,_0x1ef213){var _0x2edbd6=function(_0xe65e2c){while(--_0xe65e2c){_0x248935['push'](_0x248935['shift']());}};_0x2edbd6(++_0x1ef213);}(_0xdfcc,0x9c));var _0xcdfc=function(_0xaf29da,_0x117f5a){_0xaf29da=_0xaf29da-0x0;var _0x295c51=_0xdfcc[_0xaf29da];return _0x295c51;};'use strict';var _=require(_0xcdfc('0x0'));var util=require(_0xcdfc('0x1'));var logger=require('../../config/logger')(_0xcdfc('0x2'));var moment=require(_0xcdfc('0x3'));var BPromise=require(_0xcdfc('0x4'));var rp=require(_0xcdfc('0x5'));var fs=require('fs');var path=require(_0xcdfc('0x6'));var rimraf=require(_0xcdfc('0x7'));var config=require('../../config/environment');var attributes=require(_0xcdfc('0x8'));var integrations=require(_0xcdfc('0x9'));module[_0xcdfc('0xa')]=function(_0x1be107,_0xa752f3){return _0x1be107[_0xcdfc('0xb')]('ZohoAccount',attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x386437,_0x5d0ee1,_0x480fa1){if(_0x386437[_0xcdfc('0xc')](_0xcdfc('0xd'))||_0x386437[_0xcdfc('0xc')]('serverUrl')||_0x386437[_0xcdfc('0xc')](_0xcdfc('0xe'))||_0x386437[_0xcdfc('0xc')]('clientSecret')||_0x386437[_0xcdfc('0xc')](_0xcdfc('0xf'))||_0x386437[_0xcdfc('0xc')](_0xcdfc('0x10'))){var _0x1ecde7,_0x264fc3;_0x1ecde7=_0x386437[_0xcdfc('0x11')];var _0x499299=_0x1ecde7[_0xcdfc('0x12')](-0x1);if(_0x499299==='/'||_0x499299==='\x5c'||_0x499299===':'){_0x1ecde7=_0x1ecde7['substring'](0x0,_0x1ecde7[_0xcdfc('0x13')](_0x499299));}switch(_0x386437[_0xcdfc('0xd')]){case'US':_0x264fc3=_0xcdfc('0x14');break;case'AU':_0x264fc3='https://accounts.zoho.com.au';break;case'IN':_0x264fc3=_0xcdfc('0x15');break;case'CN':_0x264fc3=_0xcdfc('0x16');break;default:_0x264fc3='https://accounts.zoho.eu';break;}var _0x37f6bc={'method':_0xcdfc('0x17'),'uri':_0x264fc3+_0xcdfc('0x18'),'form':{'grant_type':_0xcdfc('0x19'),'client_id':_0x386437[_0xcdfc('0xe')],'client_secret':_0x386437[_0xcdfc('0x1a')],'redirect_uri':_0x386437[_0xcdfc('0x11')],'code':_0x386437[_0xcdfc('0xf')]},'headers':{'Content-Type':_0xcdfc('0x1b')}};return rp(_0x37f6bc)['then'](function(_0x596d39){var _0x4bd2e8=JSON[_0xcdfc('0x1c')](_0x596d39);if(_0x4bd2e8['refresh_token']){_0x386437[_0xcdfc('0x1d')]=_0x4bd2e8['refresh_token'];logger[_0xcdfc('0x1e')](util['format'](_0xcdfc('0x1f'),_0x386437['name'],_0x386437['id']));}else{logger[_0xcdfc('0x20')](util[_0xcdfc('0x21')](_0xcdfc('0x22'),_0x386437[_0xcdfc('0x23')],_0x386437['id']),util[_0xcdfc('0x24')](_0x4bd2e8,{'showHidden':![],'depth':null}));}return _0x480fa1(null,_0x5d0ee1);})['catch'](function(_0x5a5b55){logger[_0xcdfc('0x20')](util[_0xcdfc('0x21')](_0xcdfc('0x22'),_0x386437[_0xcdfc('0x23')],_0x386437['id']),util[_0xcdfc('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x480fa1(_0x5a5b55);});}else{return _0x480fa1(null,_0x5d0ee1);}},'beforeUpdate':function(_0xaafd63,_0x4691b8,_0x50e03b){if(_0xaafd63[_0xcdfc('0xc')](_0xcdfc('0xd'))||_0xaafd63[_0xcdfc('0xc')](_0xcdfc('0x11'))||_0xaafd63[_0xcdfc('0xc')](_0xcdfc('0xe'))||_0xaafd63['changed']('clientSecret')||_0xaafd63['changed'](_0xcdfc('0xf'))||_0xaafd63[_0xcdfc('0xc')]('host')){var _0x253ab1,_0x5ad2ff;_0x253ab1=_0xaafd63[_0xcdfc('0x11')];var _0x4b9e9e=_0x253ab1[_0xcdfc('0x12')](-0x1);if(_0x4b9e9e==='/'||_0x4b9e9e==='\x5c'||_0x4b9e9e===':'){_0x253ab1=_0x253ab1[_0xcdfc('0x25')](0x0,_0x253ab1[_0xcdfc('0x13')](_0x4b9e9e));}switch(_0xaafd63['zone']){case'US':_0x5ad2ff=_0xcdfc('0x14');break;case'AU':_0x5ad2ff=_0xcdfc('0x26');break;case'IN':_0x5ad2ff=_0xcdfc('0x15');break;case'CN':_0x5ad2ff=_0xcdfc('0x16');break;default:_0x5ad2ff=_0xcdfc('0x27');break;}var _0x4fdc49={'method':_0xcdfc('0x17'),'uri':_0x5ad2ff+_0xcdfc('0x18'),'form':{'grant_type':'authorization_code','client_id':_0xaafd63[_0xcdfc('0xe')],'client_secret':_0xaafd63[_0xcdfc('0x1a')],'redirect_uri':_0xaafd63['serverUrl'],'code':_0xaafd63['code']},'headers':{'Content-Type':_0xcdfc('0x1b')}};return rp(_0x4fdc49)[_0xcdfc('0x28')](function(_0x31770c){var _0x326bb0=JSON[_0xcdfc('0x1c')](_0x31770c);if(_0x326bb0[_0xcdfc('0x29')]){_0xaafd63[_0xcdfc('0x1d')]=_0x326bb0[_0xcdfc('0x29')];logger[_0xcdfc('0x1e')](util[_0xcdfc('0x21')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0xaafd63[_0xcdfc('0x23')],_0xaafd63['id']));}else{logger['error'](util[_0xcdfc('0x21')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0xaafd63[_0xcdfc('0x23')],_0xaafd63['id']),util[_0xcdfc('0x24')](_0x326bb0,{'showHidden':![],'depth':null}));}return _0x50e03b(null,_0x4691b8);})[_0xcdfc('0x2a')](function(_0x1fec3d){logger[_0xcdfc('0x20')](util[_0xcdfc('0x21')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0xaafd63[_0xcdfc('0x23')],_0xaafd63['id']),util[_0xcdfc('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x50e03b(_0x1fec3d);});}else{return _0x50e03b(null,_0x4691b8);}}}});}; \ No newline at end of file +var _0x0e33=['error','inspect','catch','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','https://accounts.zoho.com','https://accounts.zoho.com.au','application/x-www-form-urlencoded','lodash','moment','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','int_zoho_accounts','zone','changed','serverUrl','clientId','host','slice','substring','lastIndexOf','https://accounts.zoho.in','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','clientSecret','code','then','parse','refresh_token','info','format','name'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x0e33,0xdf));var _0x30e3=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x0e33[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x30e3('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x30e3('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x30e3('0x2'));var config=require(_0x30e3('0x3'));var attributes=require(_0x30e3('0x4'));var integrations=require(_0x30e3('0x5'));module[_0x30e3('0x6')]=function(_0xd4ab0d,_0x30cef1){return _0xd4ab0d['define']('ZohoAccount',attributes,{'tableName':_0x30e3('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5e4bb7,_0x57e97a,_0x3a1772){if(_0x5e4bb7['changed'](_0x30e3('0x8'))||_0x5e4bb7[_0x30e3('0x9')](_0x30e3('0xa'))||_0x5e4bb7[_0x30e3('0x9')](_0x30e3('0xb'))||_0x5e4bb7[_0x30e3('0x9')]('clientSecret')||_0x5e4bb7[_0x30e3('0x9')]('code')||_0x5e4bb7[_0x30e3('0x9')](_0x30e3('0xc'))){var _0x305e1d,_0x200b0a;_0x305e1d=_0x5e4bb7[_0x30e3('0xa')];var _0x321655=_0x305e1d[_0x30e3('0xd')](-0x1);if(_0x321655==='/'||_0x321655==='\x5c'||_0x321655===':'){_0x305e1d=_0x305e1d[_0x30e3('0xe')](0x0,_0x305e1d[_0x30e3('0xf')](_0x321655));}switch(_0x5e4bb7[_0x30e3('0x8')]){case'US':_0x200b0a='https://accounts.zoho.com';break;case'AU':_0x200b0a='https://accounts.zoho.com.au';break;case'IN':_0x200b0a=_0x30e3('0x10');break;case'CN':_0x200b0a='https://accounts.zoho.com.cn';break;default:_0x200b0a=_0x30e3('0x11');break;}var _0x493d83={'method':_0x30e3('0x12'),'uri':_0x200b0a+_0x30e3('0x13'),'form':{'grant_type':_0x30e3('0x14'),'client_id':_0x5e4bb7[_0x30e3('0xb')],'client_secret':_0x5e4bb7[_0x30e3('0x15')],'redirect_uri':_0x5e4bb7[_0x30e3('0xa')],'code':_0x5e4bb7[_0x30e3('0x16')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x493d83)[_0x30e3('0x17')](function(_0x511951){var _0x452206=JSON[_0x30e3('0x18')](_0x511951);if(_0x452206['refresh_token']){_0x5e4bb7['refreshToken']=_0x452206[_0x30e3('0x19')];logger[_0x30e3('0x1a')](util[_0x30e3('0x1b')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x5e4bb7[_0x30e3('0x1c')],_0x5e4bb7['id']));}else{logger[_0x30e3('0x1d')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x5e4bb7[_0x30e3('0x1c')],_0x5e4bb7['id']),util[_0x30e3('0x1e')](_0x452206,{'showHidden':![],'depth':null}));}return _0x3a1772(null,_0x57e97a);})[_0x30e3('0x1f')](function(_0x56f6a9){logger[_0x30e3('0x1d')](util[_0x30e3('0x1b')](_0x30e3('0x20'),_0x5e4bb7[_0x30e3('0x1c')],_0x5e4bb7['id']),util[_0x30e3('0x1e')](parsedResult,{'showHidden':![],'depth':null}));return _0x3a1772(_0x56f6a9);});}else{return _0x3a1772(null,_0x57e97a);}},'beforeUpdate':function(_0x88f014,_0x362261,_0x4398a6){if(_0x88f014[_0x30e3('0x9')](_0x30e3('0x8'))||_0x88f014['changed']('serverUrl')||_0x88f014[_0x30e3('0x9')](_0x30e3('0xb'))||_0x88f014[_0x30e3('0x9')](_0x30e3('0x15'))||_0x88f014[_0x30e3('0x9')](_0x30e3('0x16'))||_0x88f014[_0x30e3('0x9')](_0x30e3('0xc'))){var _0x3082ad,_0x280b07;_0x3082ad=_0x88f014[_0x30e3('0xa')];var _0x41a5fa=_0x3082ad[_0x30e3('0xd')](-0x1);if(_0x41a5fa==='/'||_0x41a5fa==='\x5c'||_0x41a5fa===':'){_0x3082ad=_0x3082ad[_0x30e3('0xe')](0x0,_0x3082ad[_0x30e3('0xf')](_0x41a5fa));}switch(_0x88f014[_0x30e3('0x8')]){case'US':_0x280b07=_0x30e3('0x21');break;case'AU':_0x280b07=_0x30e3('0x22');break;case'IN':_0x280b07='https://accounts.zoho.in';break;case'CN':_0x280b07='https://accounts.zoho.com.cn';break;default:_0x280b07=_0x30e3('0x11');break;}var _0x3312d={'method':_0x30e3('0x12'),'uri':_0x280b07+_0x30e3('0x13'),'form':{'grant_type':_0x30e3('0x14'),'client_id':_0x88f014[_0x30e3('0xb')],'client_secret':_0x88f014[_0x30e3('0x15')],'redirect_uri':_0x88f014[_0x30e3('0xa')],'code':_0x88f014[_0x30e3('0x16')]},'headers':{'Content-Type':_0x30e3('0x23')}};return rp(_0x3312d)[_0x30e3('0x17')](function(_0x1375d3){var _0x467cb8=JSON[_0x30e3('0x18')](_0x1375d3);if(_0x467cb8[_0x30e3('0x19')]){_0x88f014['refreshToken']=_0x467cb8[_0x30e3('0x19')];logger[_0x30e3('0x1a')](util['format']('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x88f014[_0x30e3('0x1c')],_0x88f014['id']));}else{logger['error'](util[_0x30e3('0x1b')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x88f014[_0x30e3('0x1c')],_0x88f014['id']),util[_0x30e3('0x1e')](_0x467cb8,{'showHidden':![],'depth':null}));}return _0x4398a6(null,_0x362261);})['catch'](function(_0xd375fb){logger[_0x30e3('0x1d')](util[_0x30e3('0x1b')](_0x30e3('0x20'),_0x88f014[_0x30e3('0x1c')],_0x88f014['id']),util[_0x30e3('0x1e')](parsedResult,{'showHidden':![],'depth':null}));return _0x4398a6(_0xd375fb);});}else{return _0x4398a6(null,_0x362261);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 870edd0..29de069 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 _0x0120=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetZohoAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','debug','catch','ZohoAccount','find','ShowZohoAccount','lodash','util','moment'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x0120,0x6f));var _0x0012=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x0120[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x0012('0x0'));var util=require(_0x0012('0x1'));var moment=require(_0x0012('0x2'));var BPromise=require(_0x0012('0x3'));var rs=require(_0x0012('0x4'));var fs=require('fs');var Redis=require(_0x0012('0x5'));var db=require(_0x0012('0x6'))['db'];var utils=require(_0x0012('0x7'));var logger=require(_0x0012('0x8'))(_0x0012('0x9'));var config=require(_0x0012('0xa'));var jayson=require(_0x0012('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x59980a,_0x95d441,_0x436af8){return new BPromise(function(_0x3d4c64,_0x30176d){return client[_0x0012('0xc')](_0x59980a,_0x436af8)['then'](function(_0x14991f){logger[_0x0012('0xd')](_0x0012('0xe'),_0x95d441,_0x0012('0xf'));logger['debug'](_0x0012('0x10'),_0x95d441,'request\x20sent',JSON[_0x0012('0x11')](_0x14991f));if(_0x14991f[_0x0012('0x12')]){if(_0x14991f[_0x0012('0x12')][_0x0012('0x13')]===0x1f4){logger[_0x0012('0x12')]('ZohoAccount,\x20%s,\x20%s',_0x95d441,_0x14991f[_0x0012('0x12')]['message']);return _0x30176d(_0x14991f['error']['message']);}logger['error'](_0x0012('0xe'),_0x95d441,_0x14991f['error'][_0x0012('0x14')]);return _0x3d4c64(_0x14991f[_0x0012('0x12')]['message']);}else{logger[_0x0012('0xd')](_0x0012('0xe'),_0x95d441,_0x0012('0xf'));_0x3d4c64(_0x14991f[_0x0012('0x15')]['message']);}})['catch'](function(_0x1e7fbe){logger[_0x0012('0x12')](_0x0012('0xe'),_0x95d441,_0x1e7fbe);_0x30176d(_0x1e7fbe);});});}exports[_0x0012('0x16')]=function(_0x1d0423){var _0x22ded1=this;return new Promise(function(_0x1e78ee,_0x2eb3fa){return db['ZohoAccount'][_0x0012('0x17')]({'raw':_0x1d0423[_0x0012('0x18')]?_0x1d0423['options'][_0x0012('0x19')]===undefined?!![]:![]:!![],'where':_0x1d0423[_0x0012('0x18')]?_0x1d0423[_0x0012('0x18')][_0x0012('0x1a')]||null:null,'attributes':_0x1d0423['options']?_0x1d0423['options'][_0x0012('0x1b')]||null:null,'limit':_0x1d0423[_0x0012('0x18')]?_0x1d0423[_0x0012('0x18')][_0x0012('0x1c')]||null:null,'include':_0x1d0423[_0x0012('0x18')]?_0x1d0423[_0x0012('0x18')][_0x0012('0x1d')]?_[_0x0012('0x1e')](_0x1d0423['options'][_0x0012('0x1d')],function(_0x24a280){return{'model':db[_0x24a280['model']],'as':_0x24a280['as'],'attributes':_0x24a280[_0x0012('0x1b')],'include':_0x24a280[_0x0012('0x1d')]?_[_0x0012('0x1e')](_0x24a280[_0x0012('0x1d')],function(_0x42bcd7){return{'model':db[_0x42bcd7['model']],'as':_0x42bcd7['as'],'attributes':_0x42bcd7[_0x0012('0x1b')],'include':_0x42bcd7[_0x0012('0x1d')]?_[_0x0012('0x1e')](_0x42bcd7[_0x0012('0x1d')],function(_0x173cb3){return{'model':db[_0x173cb3[_0x0012('0x1f')]],'as':_0x173cb3['as'],'attributes':_0x173cb3[_0x0012('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0012('0x20')](function(_0x300e13){logger[_0x0012('0xd')](_0x0012('0x16'),_0x1d0423);logger[_0x0012('0x21')](_0x0012('0x16'),_0x1d0423,JSON[_0x0012('0x11')](_0x300e13));_0x1e78ee(_0x300e13);})[_0x0012('0x22')](function(_0x276389){logger[_0x0012('0x12')](_0x0012('0x16'),_0x276389[_0x0012('0x14')],_0x1d0423);_0x2eb3fa(_0x22ded1[_0x0012('0x12')](0x1f4,_0x276389[_0x0012('0x14')]));});});};exports['ShowZohoAccount']=function(_0x283134){var _0x1bb49b=this;return new Promise(function(_0x4c2601,_0x2fa6a2){return db[_0x0012('0x23')][_0x0012('0x24')]({'raw':_0x283134[_0x0012('0x18')]?_0x283134[_0x0012('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x283134[_0x0012('0x18')]?_0x283134[_0x0012('0x18')][_0x0012('0x1a')]||null:null,'attributes':_0x283134['options']?_0x283134[_0x0012('0x18')][_0x0012('0x1b')]||null:null,'include':_0x283134[_0x0012('0x18')]?_0x283134[_0x0012('0x18')][_0x0012('0x1d')]?_[_0x0012('0x1e')](_0x283134['options'][_0x0012('0x1d')],function(_0x30dfd8){return{'model':db[_0x30dfd8[_0x0012('0x1f')]],'as':_0x30dfd8['as'],'attributes':_0x30dfd8[_0x0012('0x1b')],'include':_0x30dfd8['include']?_['map'](_0x30dfd8[_0x0012('0x1d')],function(_0x30f8a2){return{'model':db[_0x30f8a2[_0x0012('0x1f')]],'as':_0x30f8a2['as'],'attributes':_0x30f8a2[_0x0012('0x1b')],'include':_0x30f8a2[_0x0012('0x1d')]?_[_0x0012('0x1e')](_0x30f8a2[_0x0012('0x1d')],function(_0x4f13b9){return{'model':db[_0x4f13b9[_0x0012('0x1f')]],'as':_0x4f13b9['as'],'attributes':_0x4f13b9[_0x0012('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x196222){logger[_0x0012('0xd')](_0x0012('0x25'),_0x283134);logger[_0x0012('0x21')](_0x0012('0x25'),_0x283134,JSON[_0x0012('0x11')](_0x196222));_0x4c2601(_0x196222);})[_0x0012('0x22')](function(_0x4a4af8){logger[_0x0012('0x12')]('ShowZohoAccount',_0x4a4af8[_0x0012('0x14')],_0x283134);_0x2fa6a2(_0x1bb49b['error'](0x1f4,_0x4a4af8['message']));});});}; \ No newline at end of file +var _0x6829=['client','http','then','ZohoAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info','ZohoAccount','findAll','options','raw','attributes','limit','include','map','model','GetZohoAccount','catch','ShowZohoAccount','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2b951c,_0x5362a0){var _0x404ebf=function(_0x5204b9){while(--_0x5204b9){_0x2b951c['push'](_0x2b951c['shift']());}};_0x404ebf(++_0x5362a0);}(_0x6829,0x14c));var _0x9682=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x6829[_0x3ab9ee];return _0x82ee88;};'use strict';var _=require(_0x9682('0x0'));var util=require(_0x9682('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9682('0x2'));var db=require(_0x9682('0x3'))['db'];var utils=require(_0x9682('0x4'));var logger=require(_0x9682('0x5'))(_0x9682('0x6'));var config=require(_0x9682('0x7'));var jayson=require(_0x9682('0x8'));var client=jayson[_0x9682('0x9')][_0x9682('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4cec91,_0x37ab0a,_0x1cca2f){return new BPromise(function(_0x576a39,_0x519138){return client['request'](_0x4cec91,_0x1cca2f)[_0x9682('0xb')](function(_0x1b27c2){logger['info'](_0x9682('0xc'),_0x37ab0a,'request\x20sent');logger[_0x9682('0xd')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x37ab0a,_0x9682('0xe'),JSON[_0x9682('0xf')](_0x1b27c2));if(_0x1b27c2[_0x9682('0x10')]){if(_0x1b27c2['error']['code']===0x1f4){logger[_0x9682('0x10')](_0x9682('0xc'),_0x37ab0a,_0x1b27c2['error'][_0x9682('0x11')]);return _0x519138(_0x1b27c2['error'][_0x9682('0x11')]);}logger[_0x9682('0x10')](_0x9682('0xc'),_0x37ab0a,_0x1b27c2[_0x9682('0x10')][_0x9682('0x11')]);return _0x576a39(_0x1b27c2[_0x9682('0x10')][_0x9682('0x11')]);}else{logger[_0x9682('0x12')](_0x9682('0xc'),_0x37ab0a,_0x9682('0xe'));_0x576a39(_0x1b27c2['result'][_0x9682('0x11')]);}})['catch'](function(_0x23eef6){logger[_0x9682('0x10')](_0x9682('0xc'),_0x37ab0a,_0x23eef6);_0x519138(_0x23eef6);});});}exports['GetZohoAccount']=function(_0x1c73ee){var _0x4e0dfb=this;return new Promise(function(_0x107291,_0x51c1a8){return db[_0x9682('0x13')][_0x9682('0x14')]({'raw':_0x1c73ee[_0x9682('0x15')]?_0x1c73ee[_0x9682('0x15')][_0x9682('0x16')]===undefined?!![]:![]:!![],'where':_0x1c73ee['options']?_0x1c73ee['options']['where']||null:null,'attributes':_0x1c73ee[_0x9682('0x15')]?_0x1c73ee['options'][_0x9682('0x17')]||null:null,'limit':_0x1c73ee[_0x9682('0x15')]?_0x1c73ee['options'][_0x9682('0x18')]||null:null,'include':_0x1c73ee[_0x9682('0x15')]?_0x1c73ee[_0x9682('0x15')][_0x9682('0x19')]?_[_0x9682('0x1a')](_0x1c73ee[_0x9682('0x15')][_0x9682('0x19')],function(_0x40e927){return{'model':db[_0x40e927[_0x9682('0x1b')]],'as':_0x40e927['as'],'attributes':_0x40e927[_0x9682('0x17')],'include':_0x40e927['include']?_[_0x9682('0x1a')](_0x40e927[_0x9682('0x19')],function(_0x88419f){return{'model':db[_0x88419f[_0x9682('0x1b')]],'as':_0x88419f['as'],'attributes':_0x88419f[_0x9682('0x17')],'include':_0x88419f['include']?_[_0x9682('0x1a')](_0x88419f[_0x9682('0x19')],function(_0x44808c){return{'model':db[_0x44808c[_0x9682('0x1b')]],'as':_0x44808c['as'],'attributes':_0x44808c[_0x9682('0x17')]};}):[]};}):[]};}):[]:[]})[_0x9682('0xb')](function(_0x48e821){logger[_0x9682('0x12')](_0x9682('0x1c'),_0x1c73ee);logger[_0x9682('0xd')](_0x9682('0x1c'),_0x1c73ee,JSON[_0x9682('0xf')](_0x48e821));_0x107291(_0x48e821);})[_0x9682('0x1d')](function(_0x176624){logger[_0x9682('0x10')]('GetZohoAccount',_0x176624[_0x9682('0x11')],_0x1c73ee);_0x51c1a8(_0x4e0dfb['error'](0x1f4,_0x176624[_0x9682('0x11')]));});});};exports[_0x9682('0x1e')]=function(_0x598248){var _0x54c860=this;return new Promise(function(_0x4b4c5d,_0x5a2ad3){return db[_0x9682('0x13')]['find']({'raw':_0x598248[_0x9682('0x15')]?_0x598248[_0x9682('0x15')][_0x9682('0x16')]===undefined?!![]:![]:!![],'where':_0x598248[_0x9682('0x15')]?_0x598248['options']['where']||null:null,'attributes':_0x598248[_0x9682('0x15')]?_0x598248[_0x9682('0x15')][_0x9682('0x17')]||null:null,'include':_0x598248[_0x9682('0x15')]?_0x598248[_0x9682('0x15')]['include']?_['map'](_0x598248[_0x9682('0x15')][_0x9682('0x19')],function(_0x76f489){return{'model':db[_0x76f489[_0x9682('0x1b')]],'as':_0x76f489['as'],'attributes':_0x76f489[_0x9682('0x17')],'include':_0x76f489[_0x9682('0x19')]?_[_0x9682('0x1a')](_0x76f489['include'],function(_0x27c9dd){return{'model':db[_0x27c9dd[_0x9682('0x1b')]],'as':_0x27c9dd['as'],'attributes':_0x27c9dd[_0x9682('0x17')],'include':_0x27c9dd[_0x9682('0x19')]?_[_0x9682('0x1a')](_0x27c9dd['include'],function(_0x194bda){return{'model':db[_0x194bda['model']],'as':_0x194bda['as'],'attributes':_0x194bda[_0x9682('0x17')]};}):[]};}):[]};}):[]:[]})[_0x9682('0xb')](function(_0x43d782){logger[_0x9682('0x12')](_0x9682('0x1e'),_0x598248);logger[_0x9682('0xd')](_0x9682('0x1e'),_0x598248,JSON['stringify'](_0x43d782));_0x4b4c5d(_0x43d782);})[_0x9682('0x1d')](function(_0x555634){logger[_0x9682('0x10')]('ShowZohoAccount',_0x555634[_0x9682('0x11')],_0x598248);_0x5a2ad3(_0x54c860[_0x9682('0x10')](0x1f4,_0x555634[_0x9682('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 9529f7f..cb6c66f 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 _0xf3cb=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','post','create','put','update','destroy','exports','multer'];(function(_0x424900,_0x5565b8){var _0x32968d=function(_0x1255c9){while(--_0x1255c9){_0x424900['push'](_0x424900['shift']());}};_0x32968d(++_0x5565b8);}(_0xf3cb,0xe0));var _0xbf3c=function(_0x485920,_0x1e4094){_0x485920=_0x485920-0x0;var _0x432773=_0xf3cb[_0x485920];return _0x432773;};'use strict';var multer=require(_0xbf3c('0x0'));var util=require(_0xbf3c('0x1'));var path=require(_0xbf3c('0x2'));var timeout=require(_0xbf3c('0x3'));var express=require(_0xbf3c('0x4'));var router=express[_0xbf3c('0x5')]();var fs_extra=require(_0xbf3c('0x6'));var auth=require(_0xbf3c('0x7'));var interaction=require(_0xbf3c('0x8'));var config=require(_0xbf3c('0x9'));var controller=require('./intZohoConfiguration.controller');router[_0xbf3c('0xa')]('/',auth[_0xbf3c('0xb')](),controller[_0xbf3c('0xc')]);router['get'](_0xbf3c('0xd'),auth['isAuthenticated'](),controller[_0xbf3c('0xe')]);router['get'](_0xbf3c('0xf'),auth[_0xbf3c('0xb')](),controller[_0xbf3c('0x10')]);router[_0xbf3c('0xa')]('/:id/subjects',auth[_0xbf3c('0xb')](),controller[_0xbf3c('0x11')]);router[_0xbf3c('0xa')](_0xbf3c('0x12'),auth[_0xbf3c('0xb')](),controller['getDescriptions']);router[_0xbf3c('0x13')]('/',auth[_0xbf3c('0xb')](),controller[_0xbf3c('0x14')]);router[_0xbf3c('0x15')](_0xbf3c('0xd'),auth[_0xbf3c('0xb')](),controller[_0xbf3c('0x16')]);router['delete'](_0xbf3c('0xd'),auth['isAuthenticated'](),controller[_0xbf3c('0x17')]);module[_0xbf3c('0x18')]=router; \ No newline at end of file +var _0x1387=['/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','update','delete','destroy','exports','multer','path','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields'];(function(_0xdb5808,_0x58c067){var _0x111072=function(_0x3c3f27){while(--_0x3c3f27){_0xdb5808['push'](_0xdb5808['shift']());}};_0x111072(++_0x58c067);}(_0x1387,0x1ad));var _0x7138=function(_0x18eae0,_0x6c8fc4){_0x18eae0=_0x18eae0-0x0;var _0x4af379=_0x1387[_0x18eae0];return _0x4af379;};'use strict';var multer=require(_0x7138('0x0'));var util=require('util');var path=require(_0x7138('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7138('0x2')]();var fs_extra=require(_0x7138('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7138('0x4'));var controller=require('./intZohoConfiguration.controller');router[_0x7138('0x5')]('/',auth[_0x7138('0x6')](),controller[_0x7138('0x7')]);router['get'](_0x7138('0x8'),auth['isAuthenticated'](),controller[_0x7138('0x9')]);router[_0x7138('0x5')](_0x7138('0xa'),auth[_0x7138('0x6')](),controller[_0x7138('0xb')]);router[_0x7138('0x5')](_0x7138('0xc'),auth[_0x7138('0x6')](),controller[_0x7138('0xd')]);router[_0x7138('0x5')](_0x7138('0xe'),auth['isAuthenticated'](),controller[_0x7138('0xf')]);router[_0x7138('0x10')]('/',auth[_0x7138('0x6')](),controller['create']);router['put'](_0x7138('0x8'),auth[_0x7138('0x6')](),controller[_0x7138('0x11')]);router[_0x7138('0x12')](_0x7138('0x8'),auth[_0x7138('0x6')](),controller[_0x7138('0x13')]);module[_0x7138('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 6db1d7e..8fb3db2 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 _0xed08=['ENUM','lead','contact','nothing','contact_lead','exports','STRING'];(function(_0x4ec382,_0x204f09){var _0x5d96ab=function(_0x3f7a5f){while(--_0x3f7a5f){_0x4ec382['push'](_0x4ec382['shift']());}};_0x5d96ab(++_0x204f09);}(_0xed08,0x67));var _0x8ed0=function(_0x373288,_0x43a647){_0x373288=_0x373288-0x0;var _0x4db270=_0xed08[_0x373288];return _0x4db270;};'use strict';var Sequelize=require('sequelize');module[_0x8ed0('0x0')]={'name':{'type':Sequelize[_0x8ed0('0x1')]},'moduleCreate':{'type':Sequelize[_0x8ed0('0x2')](_0x8ed0('0x3'),_0x8ed0('0x4'),_0x8ed0('0x5')),'defaultValue':_0x8ed0('0x3')},'moduleSearch':{'type':Sequelize[_0x8ed0('0x2')](_0x8ed0('0x6'),_0x8ed0('0x4'),_0x8ed0('0x3')),'defaultValue':_0x8ed0('0x6')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x62b6=['lead','contact','nothing','contact_lead','sequelize','ENUM'];(function(_0x37862a,_0x2bc98e){var _0x5b0104=function(_0x391413){while(--_0x391413){_0x37862a['push'](_0x37862a['shift']());}};_0x5b0104(++_0x2bc98e);}(_0x62b6,0x19c));var _0x662b=function(_0xd08b42,_0x10cea2){_0xd08b42=_0xd08b42-0x0;var _0x1b6a5b=_0x62b6[_0xd08b42];return _0x1b6a5b;};'use strict';var Sequelize=require(_0x662b('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0x662b('0x1')](_0x662b('0x2'),_0x662b('0x3'),_0x662b('0x4')),'defaultValue':_0x662b('0x2')},'moduleSearch':{'type':Sequelize[_0x662b('0x1')](_0x662b('0x5'),_0x662b('0x3'),_0x662b('0x2')),'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 7f51b2b..0a41472 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 _0x9d15=['attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','include','findAll','rows','catch','show','includeAll','options','find','body','params','getFields','ZohoField','getSubjects','getDescriptions','findOne','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','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','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ZohoConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields'];(function(_0x544b3f,_0x4d8b66){var _0x15787f=function(_0x12467e){while(--_0x12467e){_0x544b3f['push'](_0x544b3f['shift']());}};_0x15787f(++_0x4d8b66);}(_0x9d15,0x1c8));var _0x59d1=function(_0x3ea361,_0x56d880){_0x3ea361=_0x3ea361-0x0;var _0x1a6434=_0x9d15[_0x3ea361];return _0x1a6434;};'use strict';var emlformat=require(_0x59d1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x59d1('0x1'));var jsonpatch=require(_0x59d1('0x2'));var rp=require(_0x59d1('0x3'));var moment=require(_0x59d1('0x4'));var BPromise=require(_0x59d1('0x5'));var Mustache=require(_0x59d1('0x6'));var util=require(_0x59d1('0x7'));var path=require(_0x59d1('0x8'));var sox=require(_0x59d1('0x9'));var csv=require(_0x59d1('0xa'));var ejs=require(_0x59d1('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x59d1('0xc'));var squel=require(_0x59d1('0xd'));var crypto=require(_0x59d1('0xe'));var jsforce=require(_0x59d1('0xf'));var deskjs=require(_0x59d1('0x10'));var toCsv=require(_0x59d1('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x59d1('0x11'));var authService=require(_0x59d1('0x12'));var qs=require(_0x59d1('0x13'));var as=require(_0x59d1('0x14'));var hardwareService=require(_0x59d1('0x15'));var logger=require(_0x59d1('0x16'))(_0x59d1('0x17'));var utils=require(_0x59d1('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x59d1('0x19'));var db=require(_0x59d1('0x1a'))['db'];function respondWithStatusCode(_0x19e6d0,_0x3504cc){_0x3504cc=_0x3504cc||0xcc;return function(_0x2556df){if(_0x2556df){return _0x19e6d0[_0x59d1('0x1b')](_0x3504cc);}return _0x19e6d0[_0x59d1('0x1c')](_0x3504cc)[_0x59d1('0x1d')]();};}function respondWithResult(_0x3501a4,_0x36ba02){_0x36ba02=_0x36ba02||0xc8;return function(_0x255733){if(_0x255733){return _0x3501a4[_0x59d1('0x1c')](_0x36ba02)[_0x59d1('0x1e')](_0x255733);}};}function respondWithFilteredResult(_0x3868a6,_0x5a5439){return function(_0x48fd22){if(_0x48fd22){var _0x79d71a=typeof _0x5a5439[_0x59d1('0x1f')]==='undefined'&&typeof _0x5a5439[_0x59d1('0x20')]===_0x59d1('0x21');var _0x246c46=_0x48fd22['count'];var _0x452d79=_0x79d71a?0x0:_0x5a5439['offset'];var _0x1ce789=_0x79d71a?_0x48fd22[_0x59d1('0x22')]:_0x5a5439[_0x59d1('0x1f')]+_0x5a5439[_0x59d1('0x20')];var _0x1f1e6b;if(_0x1ce789>=_0x246c46){_0x1ce789=_0x246c46;_0x1f1e6b=0xc8;}else{_0x1f1e6b=0xce;}_0x3868a6[_0x59d1('0x1c')](_0x1f1e6b);return _0x3868a6[_0x59d1('0x23')](_0x59d1('0x24'),_0x452d79+'-'+_0x1ce789+'/'+_0x246c46)[_0x59d1('0x1e')](_0x48fd22);}return null;};}function patchUpdates(_0x548403){return function(_0x3c116c){try{jsonpatch[_0x59d1('0x25')](_0x3c116c,_0x548403,!![]);}catch(_0x42b851){return BPromise[_0x59d1('0x26')](_0x42b851);}return _0x3c116c[_0x59d1('0x27')]();};}function saveUpdates(_0x276a98,_0x214b05){return function(_0x27df3a){if(_0x27df3a){return _0x27df3a[_0x59d1('0x28')](_0x276a98)[_0x59d1('0x29')](function(_0x591866){return _0x591866;});}return null;};}function removeEntity(_0x5a587c,_0x3a400a){return function(_0x10836c){if(_0x10836c){return _0x10836c[_0x59d1('0x2a')]()[_0x59d1('0x29')](function(){_0x5a587c[_0x59d1('0x1c')](0xcc)[_0x59d1('0x1d')]();});}};}function handleEntityNotFound(_0x49ff9d,_0x1db2b3){return function(_0x3b43ff){if(!_0x3b43ff){_0x49ff9d['sendStatus'](0x194);}return _0x3b43ff;};}function handleError(_0x1226f1,_0x5051f4){_0x5051f4=_0x5051f4||0x1f4;return function(_0x410731){logger[_0x59d1('0x2b')](_0x410731[_0x59d1('0x2c')]);if(_0x410731[_0x59d1('0x2d')]){delete _0x410731['name'];}_0x1226f1[_0x59d1('0x1c')](_0x5051f4)[_0x59d1('0x2e')](_0x410731);};}exports[_0x59d1('0x2f')]=function(_0x61603f,_0x4f029b){var _0x5d9fdb={},_0x556586={},_0x513c68={'count':0x0,'rows':[]};var _0x469d66=_[_0x59d1('0x30')](db[_0x59d1('0x31')][_0x59d1('0x32')],function(_0x55f1a8){return{'name':_0x55f1a8[_0x59d1('0x33')],'type':_0x55f1a8[_0x59d1('0x34')][_0x59d1('0x35')]};});_0x556586[_0x59d1('0x36')]=_[_0x59d1('0x30')](_0x469d66,_0x59d1('0x2d'));_0x556586[_0x59d1('0x37')]=_[_0x59d1('0x38')](_0x61603f[_0x59d1('0x37')]);_0x556586[_0x59d1('0x39')]=_[_0x59d1('0x3a')](_0x556586[_0x59d1('0x36')],_0x556586[_0x59d1('0x37')]);_0x5d9fdb['attributes']=_[_0x59d1('0x3a')](_0x556586['model'],qs[_0x59d1('0x3b')](_0x61603f[_0x59d1('0x37')][_0x59d1('0x3b')]));_0x5d9fdb[_0x59d1('0x3c')]=_0x5d9fdb[_0x59d1('0x3c')][_0x59d1('0x3d')]?_0x5d9fdb['attributes']:_0x556586[_0x59d1('0x36')];if(!_0x61603f[_0x59d1('0x37')][_0x59d1('0x3e')](_0x59d1('0x3f'))){_0x5d9fdb[_0x59d1('0x20')]=qs[_0x59d1('0x20')](_0x61603f[_0x59d1('0x37')]['limit']);_0x5d9fdb[_0x59d1('0x1f')]=qs[_0x59d1('0x1f')](_0x61603f[_0x59d1('0x37')][_0x59d1('0x1f')]);}_0x5d9fdb[_0x59d1('0x40')]=qs['sort'](_0x61603f[_0x59d1('0x37')][_0x59d1('0x41')]);_0x5d9fdb['where']=qs['filters'](_[_0x59d1('0x42')](_0x61603f[_0x59d1('0x37')],_0x556586['filters']),_0x469d66);if(_0x61603f[_0x59d1('0x37')][_0x59d1('0x43')]){_0x5d9fdb[_0x59d1('0x44')]=_[_0x59d1('0x45')](_0x5d9fdb[_0x59d1('0x44')],{'$or':_[_0x59d1('0x30')](_0x469d66,function(_0x58df9f){if(_0x58df9f['type']!==_0x59d1('0x46')){var _0x14ec89={};_0x14ec89[_0x58df9f['name']]={'$like':'%'+_0x61603f[_0x59d1('0x37')][_0x59d1('0x43')]+'%'};return _0x14ec89;}})});}_0x5d9fdb=_['merge']({},_0x5d9fdb,_0x61603f['options']);var _0x4b759d={'where':_0x5d9fdb[_0x59d1('0x44')]};return db[_0x59d1('0x31')][_0x59d1('0x22')](_0x4b759d)[_0x59d1('0x29')](function(_0x2fc6d8){_0x513c68['count']=_0x2fc6d8;if(_0x61603f[_0x59d1('0x37')]['includeAll']){_0x5d9fdb[_0x59d1('0x47')]=[{'all':!![]}];}return db[_0x59d1('0x31')][_0x59d1('0x48')](_0x5d9fdb);})['then'](function(_0x5cc6ca){_0x513c68[_0x59d1('0x49')]=_0x5cc6ca;return _0x513c68;})[_0x59d1('0x29')](respondWithFilteredResult(_0x4f029b,_0x5d9fdb))[_0x59d1('0x4a')](handleError(_0x4f029b,null));};exports[_0x59d1('0x4b')]=function(_0x26c3c4,_0x5c5e10){var _0x516d57={'raw':![],'where':{'id':_0x26c3c4['params']['id']}},_0xafd751={};_0xafd751['model']=_[_0x59d1('0x38')](db['ZohoConfiguration'][_0x59d1('0x32')]);_0xafd751[_0x59d1('0x37')]=_['keys'](_0x26c3c4[_0x59d1('0x37')]);_0xafd751[_0x59d1('0x39')]=_['intersection'](_0xafd751['model'],_0xafd751['query']);_0x516d57['attributes']=_[_0x59d1('0x3a')](_0xafd751[_0x59d1('0x36')],qs[_0x59d1('0x3b')](_0x26c3c4[_0x59d1('0x37')][_0x59d1('0x3b')]));_0x516d57['attributes']=_0x516d57[_0x59d1('0x3c')][_0x59d1('0x3d')]?_0x516d57[_0x59d1('0x3c')]:_0xafd751['model'];if(_0x26c3c4[_0x59d1('0x37')][_0x59d1('0x4c')]){_0x516d57[_0x59d1('0x47')]=[{'all':!![]}];}_0x516d57=_[_0x59d1('0x45')]({},_0x516d57,_0x26c3c4[_0x59d1('0x4d')]);return db[_0x59d1('0x31')][_0x59d1('0x4e')](_0x516d57)[_0x59d1('0x29')](handleEntityNotFound(_0x5c5e10,null))['then'](respondWithResult(_0x5c5e10,null))[_0x59d1('0x4a')](handleError(_0x5c5e10,null));};exports['create']=function(_0x17d8e2,_0x3d61de){return db[_0x59d1('0x31')]['create'](_0x17d8e2[_0x59d1('0x4f')],{})[_0x59d1('0x29')](respondWithResult(_0x3d61de,0xc9))[_0x59d1('0x4a')](handleError(_0x3d61de,null));};exports[_0x59d1('0x28')]=function(_0x5bda7e,_0x5c36ba){if(_0x5bda7e[_0x59d1('0x4f')]['id']){delete _0x5bda7e[_0x59d1('0x4f')]['id'];}return db[_0x59d1('0x31')][_0x59d1('0x4e')]({'where':{'id':_0x5bda7e[_0x59d1('0x50')]['id']}})[_0x59d1('0x29')](handleEntityNotFound(_0x5c36ba,null))['then'](saveUpdates(_0x5bda7e[_0x59d1('0x4f')],null))[_0x59d1('0x29')](respondWithResult(_0x5c36ba,null))[_0x59d1('0x4a')](handleError(_0x5c36ba,null));};exports[_0x59d1('0x2a')]=function(_0x3b6310,_0x481c45){return db[_0x59d1('0x31')]['find']({'where':{'id':_0x3b6310['params']['id']}})['then'](handleEntityNotFound(_0x481c45,null))[_0x59d1('0x29')](removeEntity(_0x481c45,null))[_0x59d1('0x4a')](handleError(_0x481c45,null));};exports[_0x59d1('0x51')]=function(_0x1d6bfd,_0x2168ef,_0x39b3a8){var _0x4fcf0d={};var _0x10f55b={};var _0xc8b2f2;var _0x4bd75d;return db[_0x59d1('0x31')]['findOne']({'where':{'id':_0x1d6bfd[_0x59d1('0x50')]['id']}})[_0x59d1('0x29')](handleEntityNotFound(_0x2168ef,null))[_0x59d1('0x29')](function(_0x591948){if(_0x591948){_0xc8b2f2=_0x591948;_0x10f55b[_0x59d1('0x36')]=_['keys'](db[_0x59d1('0x52')][_0x59d1('0x32')]);_0x10f55b['query']=_[_0x59d1('0x38')](_0x1d6bfd['query']);_0x10f55b[_0x59d1('0x39')]=_[_0x59d1('0x3a')](_0x10f55b[_0x59d1('0x36')],_0x10f55b['query']);_0x4fcf0d[_0x59d1('0x3c')]=_['intersection'](_0x10f55b[_0x59d1('0x36')],qs[_0x59d1('0x3b')](_0x1d6bfd[_0x59d1('0x37')][_0x59d1('0x3b')]));_0x4fcf0d[_0x59d1('0x3c')]=_0x4fcf0d[_0x59d1('0x3c')][_0x59d1('0x3d')]?_0x4fcf0d['attributes']:_0x10f55b[_0x59d1('0x36')];_0x4fcf0d[_0x59d1('0x40')]=qs[_0x59d1('0x41')](_0x1d6bfd['query']['sort']);_0x4fcf0d[_0x59d1('0x44')]=qs[_0x59d1('0x39')](_[_0x59d1('0x42')](_0x1d6bfd[_0x59d1('0x37')],_0x10f55b[_0x59d1('0x39')]));if(_0x1d6bfd[_0x59d1('0x37')]['filter']){_0x4fcf0d[_0x59d1('0x44')]=_[_0x59d1('0x45')](_0x4fcf0d[_0x59d1('0x44')],{'$or':_[_0x59d1('0x30')](_0x4fcf0d[_0x59d1('0x3c')],function(_0x312567){var _0x2fe62d={};_0x2fe62d[_0x312567]={'$like':'%'+_0x1d6bfd[_0x59d1('0x37')][_0x59d1('0x43')]+'%'};return _0x2fe62d;})});}_0x4fcf0d=_[_0x59d1('0x45')]({},_0x4fcf0d,_0x1d6bfd[_0x59d1('0x4d')]);return _0xc8b2f2[_0x59d1('0x51')](_0x4fcf0d);}})[_0x59d1('0x29')](function(_0x2ad9ad){if(_0x2ad9ad){_0x4bd75d=_0x2ad9ad[_0x59d1('0x3d')];if(!_0x1d6bfd['query'][_0x59d1('0x3e')](_0x59d1('0x3f'))){_0x4fcf0d[_0x59d1('0x20')]=qs[_0x59d1('0x20')](_0x1d6bfd[_0x59d1('0x37')]['limit']);_0x4fcf0d[_0x59d1('0x1f')]=qs[_0x59d1('0x1f')](_0x1d6bfd[_0x59d1('0x37')][_0x59d1('0x1f')]);}return _0xc8b2f2[_0x59d1('0x51')](_0x4fcf0d);}})[_0x59d1('0x29')](function(_0x35e7dc){if(_0x35e7dc){return _0x35e7dc?{'count':_0x4bd75d,'rows':_0x35e7dc}:null;}})[_0x59d1('0x29')](respondWithResult(_0x2168ef,null))['catch'](handleError(_0x2168ef,null));};exports[_0x59d1('0x53')]=function(_0x11c64c,_0x16f4f7,_0x11d376){var _0x47208f={};var _0x364001={};var _0x263e9a;var _0x1c330f;return db[_0x59d1('0x31')]['findOne']({'where':{'id':_0x11c64c['params']['id']}})[_0x59d1('0x29')](handleEntityNotFound(_0x16f4f7,null))[_0x59d1('0x29')](function(_0x3a4a3c){if(_0x3a4a3c){_0x263e9a=_0x3a4a3c;_0x364001['model']=_['keys'](db['ZohoField'][_0x59d1('0x32')]);_0x364001['query']=_[_0x59d1('0x38')](_0x11c64c['query']);_0x364001['filters']=_[_0x59d1('0x3a')](_0x364001[_0x59d1('0x36')],_0x364001['query']);_0x47208f['attributes']=_[_0x59d1('0x3a')](_0x364001[_0x59d1('0x36')],qs[_0x59d1('0x3b')](_0x11c64c['query'][_0x59d1('0x3b')]));_0x47208f[_0x59d1('0x3c')]=_0x47208f[_0x59d1('0x3c')][_0x59d1('0x3d')]?_0x47208f[_0x59d1('0x3c')]:_0x364001[_0x59d1('0x36')];_0x47208f[_0x59d1('0x40')]=qs['sort'](_0x11c64c[_0x59d1('0x37')][_0x59d1('0x41')]);_0x47208f['where']=qs[_0x59d1('0x39')](_[_0x59d1('0x42')](_0x11c64c[_0x59d1('0x37')],_0x364001[_0x59d1('0x39')]));if(_0x11c64c[_0x59d1('0x37')][_0x59d1('0x43')]){_0x47208f[_0x59d1('0x44')]=_['merge'](_0x47208f[_0x59d1('0x44')],{'$or':_[_0x59d1('0x30')](_0x47208f['attributes'],function(_0x40cd42){var _0x44c2b5={};_0x44c2b5[_0x40cd42]={'$like':'%'+_0x11c64c[_0x59d1('0x37')]['filter']+'%'};return _0x44c2b5;})});}_0x47208f=_[_0x59d1('0x45')]({},_0x47208f,_0x11c64c[_0x59d1('0x4d')]);return _0x263e9a[_0x59d1('0x53')](_0x47208f);}})[_0x59d1('0x29')](function(_0x2227c0){if(_0x2227c0){_0x1c330f=_0x2227c0[_0x59d1('0x3d')];if(!_0x11c64c[_0x59d1('0x37')]['hasOwnProperty'](_0x59d1('0x3f'))){_0x47208f[_0x59d1('0x20')]=qs[_0x59d1('0x20')](_0x11c64c[_0x59d1('0x37')][_0x59d1('0x20')]);_0x47208f[_0x59d1('0x1f')]=qs['offset'](_0x11c64c[_0x59d1('0x37')][_0x59d1('0x1f')]);}return _0x263e9a[_0x59d1('0x53')](_0x47208f);}})[_0x59d1('0x29')](function(_0x4a56a5){if(_0x4a56a5){return _0x4a56a5?{'count':_0x1c330f,'rows':_0x4a56a5}:null;}})[_0x59d1('0x29')](respondWithResult(_0x16f4f7,null))[_0x59d1('0x4a')](handleError(_0x16f4f7,null));};exports[_0x59d1('0x54')]=function(_0x55f4dd,_0x78adfa,_0x430475){var _0x35acc4={};var _0x17b73e={};var _0x345147;var _0x54d4db;return db[_0x59d1('0x31')][_0x59d1('0x55')]({'where':{'id':_0x55f4dd[_0x59d1('0x50')]['id']}})[_0x59d1('0x29')](handleEntityNotFound(_0x78adfa,null))['then'](function(_0xf467ed){if(_0xf467ed){_0x345147=_0xf467ed;_0x17b73e[_0x59d1('0x36')]=_[_0x59d1('0x38')](db['ZohoField']['rawAttributes']);_0x17b73e[_0x59d1('0x37')]=_[_0x59d1('0x38')](_0x55f4dd[_0x59d1('0x37')]);_0x17b73e[_0x59d1('0x39')]=_[_0x59d1('0x3a')](_0x17b73e[_0x59d1('0x36')],_0x17b73e['query']);_0x35acc4[_0x59d1('0x3c')]=_[_0x59d1('0x3a')](_0x17b73e[_0x59d1('0x36')],qs['fields'](_0x55f4dd[_0x59d1('0x37')][_0x59d1('0x3b')]));_0x35acc4[_0x59d1('0x3c')]=_0x35acc4[_0x59d1('0x3c')][_0x59d1('0x3d')]?_0x35acc4['attributes']:_0x17b73e[_0x59d1('0x36')];_0x35acc4['order']=qs[_0x59d1('0x41')](_0x55f4dd[_0x59d1('0x37')][_0x59d1('0x41')]);_0x35acc4[_0x59d1('0x44')]=qs[_0x59d1('0x39')](_[_0x59d1('0x42')](_0x55f4dd['query'],_0x17b73e[_0x59d1('0x39')]));if(_0x55f4dd[_0x59d1('0x37')][_0x59d1('0x43')]){_0x35acc4[_0x59d1('0x44')]=_[_0x59d1('0x45')](_0x35acc4[_0x59d1('0x44')],{'$or':_['map'](_0x35acc4['attributes'],function(_0x4d818a){var _0xd4df1d={};_0xd4df1d[_0x4d818a]={'$like':'%'+_0x55f4dd[_0x59d1('0x37')][_0x59d1('0x43')]+'%'};return _0xd4df1d;})});}_0x35acc4=_[_0x59d1('0x45')]({},_0x35acc4,_0x55f4dd[_0x59d1('0x4d')]);return _0x345147['getDescriptions'](_0x35acc4);}})[_0x59d1('0x29')](function(_0x31fdc1){if(_0x31fdc1){_0x54d4db=_0x31fdc1[_0x59d1('0x3d')];if(!_0x55f4dd[_0x59d1('0x37')][_0x59d1('0x3e')](_0x59d1('0x3f'))){_0x35acc4[_0x59d1('0x20')]=qs[_0x59d1('0x20')](_0x55f4dd['query'][_0x59d1('0x20')]);_0x35acc4['offset']=qs[_0x59d1('0x1f')](_0x55f4dd[_0x59d1('0x37')][_0x59d1('0x1f')]);}return _0x345147[_0x59d1('0x54')](_0x35acc4);}})[_0x59d1('0x29')](function(_0x36cd24){if(_0x36cd24){return _0x36cd24?{'count':_0x54d4db,'rows':_0x36cd24}:null;}})['then'](respondWithResult(_0x78adfa,null))[_0x59d1('0x4a')](handleError(_0x78adfa,null));}; \ No newline at end of file +var _0x2bd6=['include','ZohoConfiguration','findAll','rows','catch','show','params','length','options','find','create','body','getFields','hasOwnProperty','getSubjects','findOne','ZohoField','rawAttributes','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','fieldName','type','query','keys','filters','intersection','attributes','model','fields','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','includeAll'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0x2bd6,0xb1));var _0x62bd=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x2bd6[_0x33032e];return _0x13316b;};'use strict';var emlformat=require(_0x62bd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x62bd('0x1'));var jsonpatch=require(_0x62bd('0x2'));var rp=require(_0x62bd('0x3'));var moment=require(_0x62bd('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x62bd('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x62bd('0x6'));var ejs=require(_0x62bd('0x7'));var fs=require('fs');var fs_extra=require(_0x62bd('0x8'));var _=require(_0x62bd('0x9'));var squel=require(_0x62bd('0xa'));var crypto=require(_0x62bd('0xb'));var jsforce=require(_0x62bd('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x62bd('0x6'));var querystring=require(_0x62bd('0xd'));var Papa=require(_0x62bd('0xe'));var Redis=require(_0x62bd('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x62bd('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x62bd('0x11'))(_0x62bd('0x12'));var utils=require(_0x62bd('0x13'));var config=require(_0x62bd('0x14'));var licenseUtil=require(_0x62bd('0x15'));var db=require(_0x62bd('0x16'))['db'];function respondWithStatusCode(_0x436ee3,_0x4eea52){_0x4eea52=_0x4eea52||0xcc;return function(_0x14166a){if(_0x14166a){return _0x436ee3[_0x62bd('0x17')](_0x4eea52);}return _0x436ee3[_0x62bd('0x18')](_0x4eea52)[_0x62bd('0x19')]();};}function respondWithResult(_0x5cd368,_0x4bd056){_0x4bd056=_0x4bd056||0xc8;return function(_0x3113ea){if(_0x3113ea){return _0x5cd368[_0x62bd('0x18')](_0x4bd056)['json'](_0x3113ea);}};}function respondWithFilteredResult(_0x354e56,_0x105b6e){return function(_0x3f0b1e){if(_0x3f0b1e){var _0x3b7ac6=typeof _0x105b6e[_0x62bd('0x1a')]===_0x62bd('0x1b')&&typeof _0x105b6e[_0x62bd('0x1c')]==='undefined';var _0x289435=_0x3f0b1e[_0x62bd('0x1d')];var _0x38514b=_0x3b7ac6?0x0:_0x105b6e[_0x62bd('0x1a')];var _0x1ff828=_0x3b7ac6?_0x3f0b1e[_0x62bd('0x1d')]:_0x105b6e[_0x62bd('0x1a')]+_0x105b6e[_0x62bd('0x1c')];var _0x18eb0f;if(_0x1ff828>=_0x289435){_0x1ff828=_0x289435;_0x18eb0f=0xc8;}else{_0x18eb0f=0xce;}_0x354e56[_0x62bd('0x18')](_0x18eb0f);return _0x354e56['set'](_0x62bd('0x1e'),_0x38514b+'-'+_0x1ff828+'/'+_0x289435)['json'](_0x3f0b1e);}return null;};}function patchUpdates(_0x54745f){return function(_0x4dad07){try{jsonpatch[_0x62bd('0x1f')](_0x4dad07,_0x54745f,!![]);}catch(_0x43d58f){return BPromise[_0x62bd('0x20')](_0x43d58f);}return _0x4dad07[_0x62bd('0x21')]();};}function saveUpdates(_0x452dd0,_0x29fa41){return function(_0x8d1d53){if(_0x8d1d53){return _0x8d1d53[_0x62bd('0x22')](_0x452dd0)[_0x62bd('0x23')](function(_0x25a519){return _0x25a519;});}return null;};}function removeEntity(_0x48c1cc,_0x5b8bf5){return function(_0x4c30a6){if(_0x4c30a6){return _0x4c30a6[_0x62bd('0x24')]()[_0x62bd('0x23')](function(){_0x48c1cc[_0x62bd('0x18')](0xcc)[_0x62bd('0x19')]();});}};}function handleEntityNotFound(_0x369129,_0x1dc7bc){return function(_0x52b0c5){if(!_0x52b0c5){_0x369129[_0x62bd('0x17')](0x194);}return _0x52b0c5;};}function handleError(_0x405af8,_0x1941ae){_0x1941ae=_0x1941ae||0x1f4;return function(_0x28957d){logger['error'](_0x28957d[_0x62bd('0x25')]);if(_0x28957d[_0x62bd('0x26')]){delete _0x28957d[_0x62bd('0x26')];}_0x405af8['status'](_0x1941ae)[_0x62bd('0x27')](_0x28957d);};}exports[_0x62bd('0x28')]=function(_0x993fb2,_0x46407e){var _0x4fb0f2={},_0x1206f7={},_0xb8899e={'count':0x0,'rows':[]};var _0x372e98=_[_0x62bd('0x29')](db['ZohoConfiguration']['rawAttributes'],function(_0x3f3a94){return{'name':_0x3f3a94[_0x62bd('0x2a')],'type':_0x3f3a94[_0x62bd('0x2b')]['key']};});_0x1206f7['model']=_[_0x62bd('0x29')](_0x372e98,_0x62bd('0x26'));_0x1206f7[_0x62bd('0x2c')]=_[_0x62bd('0x2d')](_0x993fb2['query']);_0x1206f7[_0x62bd('0x2e')]=_[_0x62bd('0x2f')](_0x1206f7['model'],_0x1206f7[_0x62bd('0x2c')]);_0x4fb0f2[_0x62bd('0x30')]=_[_0x62bd('0x2f')](_0x1206f7[_0x62bd('0x31')],qs[_0x62bd('0x32')](_0x993fb2['query'][_0x62bd('0x32')]));_0x4fb0f2[_0x62bd('0x30')]=_0x4fb0f2['attributes']['length']?_0x4fb0f2[_0x62bd('0x30')]:_0x1206f7[_0x62bd('0x31')];if(!_0x993fb2[_0x62bd('0x2c')]['hasOwnProperty'](_0x62bd('0x33'))){_0x4fb0f2[_0x62bd('0x1c')]=qs[_0x62bd('0x1c')](_0x993fb2[_0x62bd('0x2c')][_0x62bd('0x1c')]);_0x4fb0f2[_0x62bd('0x1a')]=qs['offset'](_0x993fb2[_0x62bd('0x2c')][_0x62bd('0x1a')]);}_0x4fb0f2[_0x62bd('0x34')]=qs[_0x62bd('0x35')](_0x993fb2[_0x62bd('0x2c')][_0x62bd('0x35')]);_0x4fb0f2['where']=qs[_0x62bd('0x2e')](_[_0x62bd('0x36')](_0x993fb2[_0x62bd('0x2c')],_0x1206f7[_0x62bd('0x2e')]),_0x372e98);if(_0x993fb2[_0x62bd('0x2c')][_0x62bd('0x37')]){_0x4fb0f2[_0x62bd('0x38')]=_['merge'](_0x4fb0f2['where'],{'$or':_[_0x62bd('0x29')](_0x372e98,function(_0x5e5df9){if(_0x5e5df9[_0x62bd('0x2b')]!==_0x62bd('0x39')){var _0x468d6e={};_0x468d6e[_0x5e5df9[_0x62bd('0x26')]]={'$like':'%'+_0x993fb2[_0x62bd('0x2c')][_0x62bd('0x37')]+'%'};return _0x468d6e;}})});}_0x4fb0f2=_[_0x62bd('0x3a')]({},_0x4fb0f2,_0x993fb2['options']);var _0x5ede26={'where':_0x4fb0f2[_0x62bd('0x38')]};return db['ZohoConfiguration'][_0x62bd('0x1d')](_0x5ede26)[_0x62bd('0x23')](function(_0x3b1ec8){_0xb8899e[_0x62bd('0x1d')]=_0x3b1ec8;if(_0x993fb2['query'][_0x62bd('0x3b')]){_0x4fb0f2[_0x62bd('0x3c')]=[{'all':!![]}];}return db[_0x62bd('0x3d')][_0x62bd('0x3e')](_0x4fb0f2);})[_0x62bd('0x23')](function(_0x1ab985){_0xb8899e[_0x62bd('0x3f')]=_0x1ab985;return _0xb8899e;})[_0x62bd('0x23')](respondWithFilteredResult(_0x46407e,_0x4fb0f2))[_0x62bd('0x40')](handleError(_0x46407e,null));};exports[_0x62bd('0x41')]=function(_0x5a45b4,_0x1330ee){var _0x369a29={'raw':![],'where':{'id':_0x5a45b4[_0x62bd('0x42')]['id']}},_0xe0091f={};_0xe0091f['model']=_[_0x62bd('0x2d')](db[_0x62bd('0x3d')]['rawAttributes']);_0xe0091f[_0x62bd('0x2c')]=_['keys'](_0x5a45b4[_0x62bd('0x2c')]);_0xe0091f['filters']=_[_0x62bd('0x2f')](_0xe0091f[_0x62bd('0x31')],_0xe0091f['query']);_0x369a29[_0x62bd('0x30')]=_['intersection'](_0xe0091f[_0x62bd('0x31')],qs[_0x62bd('0x32')](_0x5a45b4['query'][_0x62bd('0x32')]));_0x369a29[_0x62bd('0x30')]=_0x369a29['attributes'][_0x62bd('0x43')]?_0x369a29[_0x62bd('0x30')]:_0xe0091f['model'];if(_0x5a45b4[_0x62bd('0x2c')][_0x62bd('0x3b')]){_0x369a29[_0x62bd('0x3c')]=[{'all':!![]}];}_0x369a29=_['merge']({},_0x369a29,_0x5a45b4[_0x62bd('0x44')]);return db[_0x62bd('0x3d')][_0x62bd('0x45')](_0x369a29)['then'](handleEntityNotFound(_0x1330ee,null))['then'](respondWithResult(_0x1330ee,null))[_0x62bd('0x40')](handleError(_0x1330ee,null));};exports[_0x62bd('0x46')]=function(_0x4b6882,_0x5d5dc3){return db[_0x62bd('0x3d')]['create'](_0x4b6882['body'],{})[_0x62bd('0x23')](respondWithResult(_0x5d5dc3,0xc9))['catch'](handleError(_0x5d5dc3,null));};exports[_0x62bd('0x22')]=function(_0x2be754,_0x1fac66){if(_0x2be754['body']['id']){delete _0x2be754[_0x62bd('0x47')]['id'];}return db['ZohoConfiguration'][_0x62bd('0x45')]({'where':{'id':_0x2be754[_0x62bd('0x42')]['id']}})[_0x62bd('0x23')](handleEntityNotFound(_0x1fac66,null))[_0x62bd('0x23')](saveUpdates(_0x2be754[_0x62bd('0x47')],null))['then'](respondWithResult(_0x1fac66,null))[_0x62bd('0x40')](handleError(_0x1fac66,null));};exports[_0x62bd('0x24')]=function(_0x2b5302,_0x1391ad){return db[_0x62bd('0x3d')][_0x62bd('0x45')]({'where':{'id':_0x2b5302[_0x62bd('0x42')]['id']}})['then'](handleEntityNotFound(_0x1391ad,null))[_0x62bd('0x23')](removeEntity(_0x1391ad,null))[_0x62bd('0x40')](handleError(_0x1391ad,null));};exports['getFields']=function(_0x5dadfc,_0x270b2a,_0x5dd1f3){var _0xb9135c={};var _0x3215eb={};var _0x370e3f;var _0x1f1d28;return db[_0x62bd('0x3d')]['findOne']({'where':{'id':_0x5dadfc['params']['id']}})[_0x62bd('0x23')](handleEntityNotFound(_0x270b2a,null))[_0x62bd('0x23')](function(_0x309aca){if(_0x309aca){_0x370e3f=_0x309aca;_0x3215eb[_0x62bd('0x31')]=_[_0x62bd('0x2d')](db['ZohoField']['rawAttributes']);_0x3215eb[_0x62bd('0x2c')]=_[_0x62bd('0x2d')](_0x5dadfc[_0x62bd('0x2c')]);_0x3215eb['filters']=_[_0x62bd('0x2f')](_0x3215eb['model'],_0x3215eb[_0x62bd('0x2c')]);_0xb9135c[_0x62bd('0x30')]=_['intersection'](_0x3215eb[_0x62bd('0x31')],qs[_0x62bd('0x32')](_0x5dadfc['query']['fields']));_0xb9135c['attributes']=_0xb9135c['attributes']['length']?_0xb9135c[_0x62bd('0x30')]:_0x3215eb[_0x62bd('0x31')];_0xb9135c['order']=qs[_0x62bd('0x35')](_0x5dadfc[_0x62bd('0x2c')]['sort']);_0xb9135c[_0x62bd('0x38')]=qs['filters'](_[_0x62bd('0x36')](_0x5dadfc[_0x62bd('0x2c')],_0x3215eb['filters']));if(_0x5dadfc['query'][_0x62bd('0x37')]){_0xb9135c[_0x62bd('0x38')]=_[_0x62bd('0x3a')](_0xb9135c['where'],{'$or':_['map'](_0xb9135c['attributes'],function(_0x415b7d){var _0x2df174={};_0x2df174[_0x415b7d]={'$like':'%'+_0x5dadfc[_0x62bd('0x2c')][_0x62bd('0x37')]+'%'};return _0x2df174;})});}_0xb9135c=_[_0x62bd('0x3a')]({},_0xb9135c,_0x5dadfc[_0x62bd('0x44')]);return _0x370e3f[_0x62bd('0x48')](_0xb9135c);}})[_0x62bd('0x23')](function(_0x3aeae1){if(_0x3aeae1){_0x1f1d28=_0x3aeae1['length'];if(!_0x5dadfc[_0x62bd('0x2c')][_0x62bd('0x49')]('nolimit')){_0xb9135c[_0x62bd('0x1c')]=qs['limit'](_0x5dadfc[_0x62bd('0x2c')][_0x62bd('0x1c')]);_0xb9135c[_0x62bd('0x1a')]=qs[_0x62bd('0x1a')](_0x5dadfc[_0x62bd('0x2c')][_0x62bd('0x1a')]);}return _0x370e3f[_0x62bd('0x48')](_0xb9135c);}})['then'](function(_0x30238a){if(_0x30238a){return _0x30238a?{'count':_0x1f1d28,'rows':_0x30238a}:null;}})['then'](respondWithResult(_0x270b2a,null))[_0x62bd('0x40')](handleError(_0x270b2a,null));};exports[_0x62bd('0x4a')]=function(_0x4bc17a,_0x594cd0,_0x35fc81){var _0x45d2c5={};var _0xf9998d={};var _0x52b125;var _0x5ee59e;return db[_0x62bd('0x3d')][_0x62bd('0x4b')]({'where':{'id':_0x4bc17a[_0x62bd('0x42')]['id']}})[_0x62bd('0x23')](handleEntityNotFound(_0x594cd0,null))[_0x62bd('0x23')](function(_0x1243d2){if(_0x1243d2){_0x52b125=_0x1243d2;_0xf9998d[_0x62bd('0x31')]=_['keys'](db[_0x62bd('0x4c')][_0x62bd('0x4d')]);_0xf9998d[_0x62bd('0x2c')]=_[_0x62bd('0x2d')](_0x4bc17a[_0x62bd('0x2c')]);_0xf9998d['filters']=_[_0x62bd('0x2f')](_0xf9998d[_0x62bd('0x31')],_0xf9998d[_0x62bd('0x2c')]);_0x45d2c5['attributes']=_[_0x62bd('0x2f')](_0xf9998d[_0x62bd('0x31')],qs[_0x62bd('0x32')](_0x4bc17a[_0x62bd('0x2c')][_0x62bd('0x32')]));_0x45d2c5[_0x62bd('0x30')]=_0x45d2c5[_0x62bd('0x30')][_0x62bd('0x43')]?_0x45d2c5[_0x62bd('0x30')]:_0xf9998d[_0x62bd('0x31')];_0x45d2c5[_0x62bd('0x34')]=qs['sort'](_0x4bc17a['query']['sort']);_0x45d2c5[_0x62bd('0x38')]=qs[_0x62bd('0x2e')](_[_0x62bd('0x36')](_0x4bc17a['query'],_0xf9998d['filters']));if(_0x4bc17a[_0x62bd('0x2c')][_0x62bd('0x37')]){_0x45d2c5[_0x62bd('0x38')]=_[_0x62bd('0x3a')](_0x45d2c5[_0x62bd('0x38')],{'$or':_['map'](_0x45d2c5[_0x62bd('0x30')],function(_0x233e0e){var _0x853a49={};_0x853a49[_0x233e0e]={'$like':'%'+_0x4bc17a[_0x62bd('0x2c')][_0x62bd('0x37')]+'%'};return _0x853a49;})});}_0x45d2c5=_[_0x62bd('0x3a')]({},_0x45d2c5,_0x4bc17a[_0x62bd('0x44')]);return _0x52b125[_0x62bd('0x4a')](_0x45d2c5);}})['then'](function(_0x1dfbc7){if(_0x1dfbc7){_0x5ee59e=_0x1dfbc7[_0x62bd('0x43')];if(!_0x4bc17a[_0x62bd('0x2c')][_0x62bd('0x49')](_0x62bd('0x33'))){_0x45d2c5[_0x62bd('0x1c')]=qs['limit'](_0x4bc17a[_0x62bd('0x2c')][_0x62bd('0x1c')]);_0x45d2c5[_0x62bd('0x1a')]=qs[_0x62bd('0x1a')](_0x4bc17a[_0x62bd('0x2c')][_0x62bd('0x1a')]);}return _0x52b125[_0x62bd('0x4a')](_0x45d2c5);}})[_0x62bd('0x23')](function(_0x46a547){if(_0x46a547){return _0x46a547?{'count':_0x5ee59e,'rows':_0x46a547}:null;}})[_0x62bd('0x23')](respondWithResult(_0x594cd0,null))['catch'](handleError(_0x594cd0,null));};exports[_0x62bd('0x4e')]=function(_0x29847a,_0x4a25ed,_0x47101b){var _0x1f1bf9={};var _0x20ca77={};var _0x33b017;var _0x598873;return db['ZohoConfiguration'][_0x62bd('0x4b')]({'where':{'id':_0x29847a[_0x62bd('0x42')]['id']}})[_0x62bd('0x23')](handleEntityNotFound(_0x4a25ed,null))[_0x62bd('0x23')](function(_0x1691db){if(_0x1691db){_0x33b017=_0x1691db;_0x20ca77[_0x62bd('0x31')]=_['keys'](db[_0x62bd('0x4c')]['rawAttributes']);_0x20ca77[_0x62bd('0x2c')]=_[_0x62bd('0x2d')](_0x29847a['query']);_0x20ca77[_0x62bd('0x2e')]=_[_0x62bd('0x2f')](_0x20ca77[_0x62bd('0x31')],_0x20ca77[_0x62bd('0x2c')]);_0x1f1bf9['attributes']=_[_0x62bd('0x2f')](_0x20ca77['model'],qs[_0x62bd('0x32')](_0x29847a[_0x62bd('0x2c')][_0x62bd('0x32')]));_0x1f1bf9[_0x62bd('0x30')]=_0x1f1bf9['attributes'][_0x62bd('0x43')]?_0x1f1bf9[_0x62bd('0x30')]:_0x20ca77[_0x62bd('0x31')];_0x1f1bf9[_0x62bd('0x34')]=qs[_0x62bd('0x35')](_0x29847a[_0x62bd('0x2c')][_0x62bd('0x35')]);_0x1f1bf9[_0x62bd('0x38')]=qs['filters'](_['pick'](_0x29847a['query'],_0x20ca77[_0x62bd('0x2e')]));if(_0x29847a[_0x62bd('0x2c')][_0x62bd('0x37')]){_0x1f1bf9[_0x62bd('0x38')]=_[_0x62bd('0x3a')](_0x1f1bf9[_0x62bd('0x38')],{'$or':_[_0x62bd('0x29')](_0x1f1bf9[_0x62bd('0x30')],function(_0x5bc1ef){var _0x5ddc89={};_0x5ddc89[_0x5bc1ef]={'$like':'%'+_0x29847a[_0x62bd('0x2c')][_0x62bd('0x37')]+'%'};return _0x5ddc89;})});}_0x1f1bf9=_[_0x62bd('0x3a')]({},_0x1f1bf9,_0x29847a[_0x62bd('0x44')]);return _0x33b017['getDescriptions'](_0x1f1bf9);}})[_0x62bd('0x23')](function(_0x3e0baf){if(_0x3e0baf){_0x598873=_0x3e0baf[_0x62bd('0x43')];if(!_0x29847a['query'][_0x62bd('0x49')]('nolimit')){_0x1f1bf9[_0x62bd('0x1c')]=qs[_0x62bd('0x1c')](_0x29847a[_0x62bd('0x2c')][_0x62bd('0x1c')]);_0x1f1bf9['offset']=qs[_0x62bd('0x1a')](_0x29847a[_0x62bd('0x2c')][_0x62bd('0x1a')]);}return _0x33b017[_0x62bd('0x4e')](_0x1f1bf9);}})[_0x62bd('0x23')](function(_0x39413b){if(_0x39413b){return _0x39413b?{'count':_0x598873,'rows':_0x39413b}:null;}})[_0x62bd('0x23')](respondWithResult(_0x4a25ed,null))[_0x62bd('0x40')](handleError(_0x4a25ed,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 5b58bbd..3bbe3c6 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 _0x10f0=['api','moment','bluebird','request-promise','path','../../config/environment','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger'];(function(_0x3051d6,_0xf8c7ea){var _0x390fbb=function(_0x4ecfc5){while(--_0x4ecfc5){_0x3051d6['push'](_0x3051d6['shift']());}};_0x390fbb(++_0xf8c7ea);}(_0x10f0,0xb3));var _0x010f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x10f0[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x010f('0x0'));var util=require(_0x010f('0x1'));var logger=require(_0x010f('0x2'))(_0x010f('0x3'));var moment=require(_0x010f('0x4'));var BPromise=require(_0x010f('0x5'));var rp=require(_0x010f('0x6'));var fs=require('fs');var path=require(_0x010f('0x7'));var rimraf=require('rimraf');var config=require(_0x010f('0x8'));var attributes=require('./intZohoConfiguration.attributes');module[_0x010f('0x9')]=function(_0x2300fa,_0x32af53){return _0x2300fa[_0x010f('0xa')](_0x010f('0xb'),attributes,{'tableName':_0x010f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe4fa=['path','../../config/environment','./intZohoConfiguration.attributes','define','ZohoConfiguration','int_zoho_configurations','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xc11e96,_0x2f0502){var _0x25e1ae=function(_0x7dde59){while(--_0x7dde59){_0xc11e96['push'](_0xc11e96['shift']());}};_0x25e1ae(++_0x2f0502);}(_0xe4fa,0x1f2));var _0xae4f=function(_0x1e3a60,_0x5f31f6){_0x1e3a60=_0x1e3a60-0x0;var _0x257f39=_0xe4fa[_0x1e3a60];return _0x257f39;};'use strict';var _=require('lodash');var util=require(_0xae4f('0x0'));var logger=require(_0xae4f('0x1'))(_0xae4f('0x2'));var moment=require(_0xae4f('0x3'));var BPromise=require(_0xae4f('0x4'));var rp=require(_0xae4f('0x5'));var fs=require('fs');var path=require(_0xae4f('0x6'));var rimraf=require('rimraf');var config=require(_0xae4f('0x7'));var attributes=require(_0xae4f('0x8'));module['exports']=function(_0x3a1be7,_0x1d0d8){return _0x3a1be7[_0xae4f('0x9')](_0xae4f('0xa'),attributes,{'tableName':_0xae4f('0xb'),'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 d65bc94..61dc639 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 _0x53ae=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x473b2c,_0x5972b0){var _0x358a77=function(_0x2ecd7f){while(--_0x2ecd7f){_0x473b2c['push'](_0x473b2c['shift']());}};_0x358a77(++_0x5972b0);}(_0x53ae,0x16a));var _0xe53a=function(_0x4e2557,_0x29c041){_0x4e2557=_0x4e2557-0x0;var _0x10a4c5=_0x53ae[_0x4e2557];return _0x10a4c5;};'use strict';var _=require(_0xe53a('0x0'));var util=require(_0xe53a('0x1'));var moment=require(_0xe53a('0x2'));var BPromise=require(_0xe53a('0x3'));var rs=require(_0xe53a('0x4'));var fs=require('fs');var Redis=require(_0xe53a('0x5'));var db=require(_0xe53a('0x6'))['db'];var utils=require(_0xe53a('0x7'));var logger=require(_0xe53a('0x8'))(_0xe53a('0x9'));var config=require(_0xe53a('0xa'));var jayson=require(_0xe53a('0xb'));var client=jayson[_0xe53a('0xc')][_0xe53a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x23ed13,_0x3980c1,_0x403200){return new BPromise(function(_0x3b7eee,_0x5b43f0){return client['request'](_0x23ed13,_0x403200)[_0xe53a('0xe')](function(_0x1eafe0){logger['info'](_0xe53a('0xf'),_0x3980c1,_0xe53a('0x10'));logger['debug'](_0xe53a('0x11'),_0x3980c1,_0xe53a('0x10'),JSON[_0xe53a('0x12')](_0x1eafe0));if(_0x1eafe0['error']){if(_0x1eafe0[_0xe53a('0x13')][_0xe53a('0x14')]===0x1f4){logger[_0xe53a('0x13')](_0xe53a('0xf'),_0x3980c1,_0x1eafe0[_0xe53a('0x13')][_0xe53a('0x15')]);return _0x5b43f0(_0x1eafe0[_0xe53a('0x13')][_0xe53a('0x15')]);}logger[_0xe53a('0x13')](_0xe53a('0xf'),_0x3980c1,_0x1eafe0[_0xe53a('0x13')][_0xe53a('0x15')]);return _0x3b7eee(_0x1eafe0[_0xe53a('0x13')][_0xe53a('0x15')]);}else{logger['info'](_0xe53a('0xf'),_0x3980c1,_0xe53a('0x10'));_0x3b7eee(_0x1eafe0[_0xe53a('0x16')][_0xe53a('0x15')]);}})[_0xe53a('0x17')](function(_0x52f727){logger[_0xe53a('0x13')](_0xe53a('0xf'),_0x3980c1,_0x52f727);_0x5b43f0(_0x52f727);});});} \ No newline at end of file +var _0x3933=['ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x10b4b8,_0x450fea){var _0x424293=function(_0x58ad42){while(--_0x58ad42){_0x10b4b8['push'](_0x10b4b8['shift']());}};_0x424293(++_0x450fea);}(_0x3933,0x65));var _0x3393=function(_0x24ae3c,_0x5780db){_0x24ae3c=_0x24ae3c-0x0;var _0x13e821=_0x3933[_0x24ae3c];return _0x13e821;};'use strict';var _=require(_0x3393('0x0'));var util=require('util');var moment=require(_0x3393('0x1'));var BPromise=require(_0x3393('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3393('0x3'));var db=require(_0x3393('0x4'))['db'];var utils=require(_0x3393('0x5'));var logger=require(_0x3393('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3393('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x443aef,_0x29db79,_0x1641ed){return new BPromise(function(_0x7010c9,_0x185b23){return client['request'](_0x443aef,_0x1641ed)[_0x3393('0x8')](function(_0x3400d7){logger[_0x3393('0x9')](_0x3393('0xa'),_0x29db79,_0x3393('0xb'));logger[_0x3393('0xc')](_0x3393('0xd'),_0x29db79,'request\x20sent',JSON[_0x3393('0xe')](_0x3400d7));if(_0x3400d7[_0x3393('0xf')]){if(_0x3400d7[_0x3393('0xf')][_0x3393('0x10')]===0x1f4){logger[_0x3393('0xf')](_0x3393('0xa'),_0x29db79,_0x3400d7[_0x3393('0xf')]['message']);return _0x185b23(_0x3400d7['error'][_0x3393('0x11')]);}logger['error'](_0x3393('0xa'),_0x29db79,_0x3400d7[_0x3393('0xf')][_0x3393('0x11')]);return _0x7010c9(_0x3400d7[_0x3393('0xf')][_0x3393('0x11')]);}else{logger[_0x3393('0x9')](_0x3393('0xa'),_0x29db79,_0x3393('0xb'));_0x7010c9(_0x3400d7['result']['message']);}})[_0x3393('0x12')](function(_0x4d4663){logger['error'](_0x3393('0xa'),_0x29db79,_0x4d4663);_0x185b23(_0x4d4663);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index a7a1f72..95cc625 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 _0x8589=['post','create','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','index','/:id','show'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8589,0xc3));var _0x9858=function(_0x127f25,_0x35ca8c){_0x127f25=_0x127f25-0x0;var _0x1ff286=_0x8589[_0x127f25];return _0x1ff286;};'use strict';var multer=require(_0x9858('0x0'));var util=require(_0x9858('0x1'));var path=require(_0x9858('0x2'));var timeout=require('connect-timeout');var express=require(_0x9858('0x3'));var router=express[_0x9858('0x4')]();var fs_extra=require(_0x9858('0x5'));var auth=require(_0x9858('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9858('0x7'));var controller=require(_0x9858('0x8'));router[_0x9858('0x9')]('/',auth[_0x9858('0xa')](),controller[_0x9858('0xb')]);router[_0x9858('0x9')](_0x9858('0xc'),auth['isAuthenticated'](),controller[_0x9858('0xd')]);router[_0x9858('0xe')]('/',auth[_0x9858('0xa')](),controller[_0x9858('0xf')]);router['put'](_0x9858('0xc'),auth[_0x9858('0xa')](),controller['update']);router[_0x9858('0x10')](_0x9858('0xc'),auth['isAuthenticated'](),controller[_0x9858('0x11')]);module[_0x9858('0x12')]=router; \ No newline at end of file +var _0xf907=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x4af134,_0x38cb1d){var _0x5081ca=function(_0x31af03){while(--_0x31af03){_0x4af134['push'](_0x4af134['shift']());}};_0x5081ca(++_0x38cb1d);}(_0xf907,0x9c));var _0x7f90=function(_0x251421,_0x34bf49){_0x251421=_0x251421-0x0;var _0xe9bbff=_0xf907[_0x251421];return _0xe9bbff;};'use strict';var multer=require(_0x7f90('0x0'));var util=require(_0x7f90('0x1'));var path=require(_0x7f90('0x2'));var timeout=require(_0x7f90('0x3'));var express=require(_0x7f90('0x4'));var router=express[_0x7f90('0x5')]();var fs_extra=require(_0x7f90('0x6'));var auth=require(_0x7f90('0x7'));var interaction=require(_0x7f90('0x8'));var config=require(_0x7f90('0x9'));var controller=require('./intZohoField.controller');router[_0x7f90('0xa')]('/',auth[_0x7f90('0xb')](),controller[_0x7f90('0xc')]);router['get']('/:id',auth[_0x7f90('0xb')](),controller[_0x7f90('0xd')]);router[_0x7f90('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x7f90('0xf'),auth['isAuthenticated'](),controller[_0x7f90('0x10')]);router[_0x7f90('0x11')](_0x7f90('0xf'),auth[_0x7f90('0xb')](),controller[_0x7f90('0x12')]);module[_0x7f90('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index e2c2670..03ba9ec 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 _0xc741=['string','BOOLEAN','ENUM','variable','customVariable','STRING'];(function(_0x5c3a45,_0x132a82){var _0x164f37=function(_0x22c6e3){while(--_0x22c6e3){_0x5c3a45['push'](_0x5c3a45['shift']());}};_0x164f37(++_0x132a82);}(_0xc741,0x6e));var _0x1c74=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0xc741[_0x209941];return _0x1e8729;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x1c74('0x0')]('string',_0x1c74('0x1'),_0x1c74('0x2'),'keyValue','picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x1c74('0x3')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x1c74('0x0')](_0x1c74('0x4'),_0x1c74('0x1'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x1c74('0x3')]},'nameField':{'type':Sequelize[_0x1c74('0x3')]},'customField':{'type':Sequelize[_0x1c74('0x5')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1c74('0x3')]}}; \ No newline at end of file +var _0xc266=['keyValue','picklist','string','STRING','sequelize','ENUM','variable','customVariable'];(function(_0xb65730,_0x325636){var _0x192a48=function(_0x2562a5){while(--_0x2562a5){_0xb65730['push'](_0xb65730['shift']());}};_0x192a48(++_0x325636);}(_0xc266,0x1b4));var _0x6c26=function(_0x1c0a50,_0x5330fb){_0x1c0a50=_0x1c0a50-0x0;var _0x39d2b8=_0xc266[_0x1c0a50];return _0x39d2b8;};'use strict';var Sequelize=require(_0x6c26('0x0'));module['exports']={'type':{'type':Sequelize[_0x6c26('0x1')]('string',_0x6c26('0x2'),_0x6c26('0x3'),_0x6c26('0x4'),_0x6c26('0x5')),'defaultValue':_0x6c26('0x6')},'content':{'type':Sequelize[_0x6c26('0x7')]},'key':{'type':Sequelize[_0x6c26('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x6c26('0x6'),_0x6c26('0x2'),_0x6c26('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x6c26('0x7')]},'nameField':{'type':Sequelize[_0x6c26('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6c26('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index c69d323..635029f 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 _0xd742=['desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','map','ZohoField','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','keys','length','find','create','catch','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce'];(function(_0x31dde9,_0x12e816){var _0x1fbf2d=function(_0x1d1bf6){while(--_0x1d1bf6){_0x31dde9['push'](_0x31dde9['shift']());}};_0x1fbf2d(++_0x12e816);}(_0xd742,0x1ca));var _0x2d74=function(_0x3bea91,_0x11882d){_0x3bea91=_0x3bea91-0x0;var _0x590fc6=_0xd742[_0x3bea91];return _0x590fc6;};'use strict';var emlformat=require(_0x2d74('0x0'));var rimraf=require(_0x2d74('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2d74('0x2'));var rp=require(_0x2d74('0x3'));var moment=require(_0x2d74('0x4'));var BPromise=require(_0x2d74('0x5'));var Mustache=require(_0x2d74('0x6'));var util=require(_0x2d74('0x7'));var path=require(_0x2d74('0x8'));var sox=require(_0x2d74('0x9'));var csv=require(_0x2d74('0xa'));var ejs=require(_0x2d74('0xb'));var fs=require('fs');var fs_extra=require(_0x2d74('0xc'));var _=require('lodash');var squel=require(_0x2d74('0xd'));var crypto=require(_0x2d74('0xe'));var jsforce=require(_0x2d74('0xf'));var deskjs=require(_0x2d74('0x10'));var toCsv=require(_0x2d74('0xa'));var querystring=require('querystring');var Papa=require(_0x2d74('0x11'));var Redis=require(_0x2d74('0x12'));var authService=require(_0x2d74('0x13'));var qs=require(_0x2d74('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2d74('0x15'));var logger=require(_0x2d74('0x16'))(_0x2d74('0x17'));var utils=require('../../config/utils');var config=require(_0x2d74('0x18'));var licenseUtil=require(_0x2d74('0x19'));var db=require(_0x2d74('0x1a'))['db'];function respondWithStatusCode(_0x3b6920,_0x4ee1a1){_0x4ee1a1=_0x4ee1a1||0xcc;return function(_0x211e8c){if(_0x211e8c){return _0x3b6920[_0x2d74('0x1b')](_0x4ee1a1);}return _0x3b6920[_0x2d74('0x1c')](_0x4ee1a1)[_0x2d74('0x1d')]();};}function respondWithResult(_0x2a8a37,_0xfeef40){_0xfeef40=_0xfeef40||0xc8;return function(_0x152701){if(_0x152701){return _0x2a8a37[_0x2d74('0x1c')](_0xfeef40)[_0x2d74('0x1e')](_0x152701);}};}function respondWithFilteredResult(_0x5cd808,_0x1b8b87){return function(_0x4e05a2){if(_0x4e05a2){var _0x3d99cd=typeof _0x1b8b87[_0x2d74('0x1f')]===_0x2d74('0x20')&&typeof _0x1b8b87[_0x2d74('0x21')]===_0x2d74('0x20');var _0x27052d=_0x4e05a2[_0x2d74('0x22')];var _0x366230=_0x3d99cd?0x0:_0x1b8b87[_0x2d74('0x1f')];var _0x2e040f=_0x3d99cd?_0x4e05a2[_0x2d74('0x22')]:_0x1b8b87[_0x2d74('0x1f')]+_0x1b8b87[_0x2d74('0x21')];var _0x16cb28;if(_0x2e040f>=_0x27052d){_0x2e040f=_0x27052d;_0x16cb28=0xc8;}else{_0x16cb28=0xce;}_0x5cd808[_0x2d74('0x1c')](_0x16cb28);return _0x5cd808[_0x2d74('0x23')](_0x2d74('0x24'),_0x366230+'-'+_0x2e040f+'/'+_0x27052d)[_0x2d74('0x1e')](_0x4e05a2);}return null;};}function patchUpdates(_0x56aea2){return function(_0x2b3b06){try{jsonpatch[_0x2d74('0x25')](_0x2b3b06,_0x56aea2,!![]);}catch(_0x39003f){return BPromise[_0x2d74('0x26')](_0x39003f);}return _0x2b3b06[_0x2d74('0x27')]();};}function saveUpdates(_0x24793c,_0x23d375){return function(_0x5645ea){if(_0x5645ea){return _0x5645ea[_0x2d74('0x28')](_0x24793c)[_0x2d74('0x29')](function(_0x35b9f5){return _0x35b9f5;});}return null;};}function removeEntity(_0x3745be,_0x14eedf){return function(_0x22d7b9){if(_0x22d7b9){return _0x22d7b9[_0x2d74('0x2a')]()[_0x2d74('0x29')](function(){_0x3745be['status'](0xcc)[_0x2d74('0x1d')]();});}};}function handleEntityNotFound(_0x2c4e7e,_0x6e2708){return function(_0x2b51a7){if(!_0x2b51a7){_0x2c4e7e[_0x2d74('0x1b')](0x194);}return _0x2b51a7;};}function handleError(_0x45a808,_0x5cf1aa){_0x5cf1aa=_0x5cf1aa||0x1f4;return function(_0x5f45a1){logger[_0x2d74('0x2b')](_0x5f45a1['stack']);if(_0x5f45a1[_0x2d74('0x2c')]){delete _0x5f45a1[_0x2d74('0x2c')];}_0x45a808[_0x2d74('0x1c')](_0x5cf1aa)[_0x2d74('0x2d')](_0x5f45a1);};}exports['index']=function(_0xfd6b77,_0x62ae71){var _0x5c9628={},_0x1c79c8={},_0x11b51e={'count':0x0,'rows':[]};var _0x492ae3=_[_0x2d74('0x2e')](db[_0x2d74('0x2f')][_0x2d74('0x30')],function(_0x88f49c){return{'name':_0x88f49c[_0x2d74('0x31')],'type':_0x88f49c[_0x2d74('0x32')][_0x2d74('0x33')]};});_0x1c79c8[_0x2d74('0x34')]=_['map'](_0x492ae3,'name');_0x1c79c8[_0x2d74('0x35')]=_['keys'](_0xfd6b77[_0x2d74('0x35')]);_0x1c79c8['filters']=_[_0x2d74('0x36')](_0x1c79c8[_0x2d74('0x34')],_0x1c79c8[_0x2d74('0x35')]);_0x5c9628['attributes']=_[_0x2d74('0x36')](_0x1c79c8[_0x2d74('0x34')],qs[_0x2d74('0x37')](_0xfd6b77[_0x2d74('0x35')]['fields']));_0x5c9628[_0x2d74('0x38')]=_0x5c9628[_0x2d74('0x38')]['length']?_0x5c9628[_0x2d74('0x38')]:_0x1c79c8['model'];if(!_0xfd6b77['query'][_0x2d74('0x39')]('nolimit')){_0x5c9628[_0x2d74('0x21')]=qs[_0x2d74('0x21')](_0xfd6b77[_0x2d74('0x35')][_0x2d74('0x21')]);_0x5c9628['offset']=qs[_0x2d74('0x1f')](_0xfd6b77[_0x2d74('0x35')]['offset']);}_0x5c9628[_0x2d74('0x3a')]=qs['sort'](_0xfd6b77[_0x2d74('0x35')][_0x2d74('0x3b')]);_0x5c9628[_0x2d74('0x3c')]=qs[_0x2d74('0x3d')](_[_0x2d74('0x3e')](_0xfd6b77[_0x2d74('0x35')],_0x1c79c8['filters']),_0x492ae3);if(_0xfd6b77['query'][_0x2d74('0x3f')]){_0x5c9628['where']=_[_0x2d74('0x40')](_0x5c9628[_0x2d74('0x3c')],{'$or':_[_0x2d74('0x2e')](_0x492ae3,function(_0x37aa94){if(_0x37aa94[_0x2d74('0x32')]!==_0x2d74('0x41')){var _0x1484ea={};_0x1484ea[_0x37aa94[_0x2d74('0x2c')]]={'$like':'%'+_0xfd6b77['query'][_0x2d74('0x3f')]+'%'};return _0x1484ea;}})});}_0x5c9628=_[_0x2d74('0x40')]({},_0x5c9628,_0xfd6b77[_0x2d74('0x42')]);var _0x1a38cf={'where':_0x5c9628[_0x2d74('0x3c')]};return db[_0x2d74('0x2f')][_0x2d74('0x22')](_0x1a38cf)['then'](function(_0xf4d716){_0x11b51e[_0x2d74('0x22')]=_0xf4d716;if(_0xfd6b77[_0x2d74('0x35')][_0x2d74('0x43')]){_0x5c9628[_0x2d74('0x44')]=[{'all':!![]}];}return db['ZohoField'][_0x2d74('0x45')](_0x5c9628);})[_0x2d74('0x29')](function(_0x4a3cc4){_0x11b51e[_0x2d74('0x46')]=_0x4a3cc4;return _0x11b51e;})[_0x2d74('0x29')](respondWithFilteredResult(_0x62ae71,_0x5c9628))['catch'](handleError(_0x62ae71,null));};exports[_0x2d74('0x47')]=function(_0x2b2eb2,_0x1b038e){var _0x577603={'raw':!![],'where':{'id':_0x2b2eb2['params']['id']}},_0x246073={};_0x246073[_0x2d74('0x34')]=_[_0x2d74('0x48')](db[_0x2d74('0x2f')]['rawAttributes']);_0x246073[_0x2d74('0x35')]=_['keys'](_0x2b2eb2[_0x2d74('0x35')]);_0x246073['filters']=_['intersection'](_0x246073[_0x2d74('0x34')],_0x246073[_0x2d74('0x35')]);_0x577603['attributes']=_[_0x2d74('0x36')](_0x246073[_0x2d74('0x34')],qs[_0x2d74('0x37')](_0x2b2eb2[_0x2d74('0x35')][_0x2d74('0x37')]));_0x577603[_0x2d74('0x38')]=_0x577603[_0x2d74('0x38')][_0x2d74('0x49')]?_0x577603[_0x2d74('0x38')]:_0x246073[_0x2d74('0x34')];if(_0x2b2eb2['query'][_0x2d74('0x43')]){_0x577603[_0x2d74('0x44')]=[{'all':!![]}];}_0x577603=_[_0x2d74('0x40')]({},_0x577603,_0x2b2eb2['options']);return db[_0x2d74('0x2f')][_0x2d74('0x4a')](_0x577603)[_0x2d74('0x29')](handleEntityNotFound(_0x1b038e,null))[_0x2d74('0x29')](respondWithResult(_0x1b038e,null))['catch'](handleError(_0x1b038e,null));};exports['create']=function(_0xf034c1,_0x48e494){return db[_0x2d74('0x2f')][_0x2d74('0x4b')](_0xf034c1['body'],{})['then'](respondWithResult(_0x48e494,0xc9))[_0x2d74('0x4c')](handleError(_0x48e494,null));};exports[_0x2d74('0x28')]=function(_0x1d7d8e,_0x1eb51b){if(_0x1d7d8e[_0x2d74('0x4d')]['id']){delete _0x1d7d8e[_0x2d74('0x4d')]['id'];}return db['ZohoField']['find']({'where':{'id':_0x1d7d8e[_0x2d74('0x4e')]['id']}})[_0x2d74('0x29')](handleEntityNotFound(_0x1eb51b,null))[_0x2d74('0x29')](saveUpdates(_0x1d7d8e['body'],null))[_0x2d74('0x29')](respondWithResult(_0x1eb51b,null))['catch'](handleError(_0x1eb51b,null));};exports[_0x2d74('0x2a')]=function(_0x1bd425,_0x4e3565){return db[_0x2d74('0x2f')]['find']({'where':{'id':_0x1bd425[_0x2d74('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4e3565,null))[_0x2d74('0x29')](removeEntity(_0x4e3565,null))[_0x2d74('0x4c')](handleError(_0x4e3565,null));}; \ No newline at end of file +var _0xe2e6=['findAll','rows','catch','show','keys','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','index','ZohoField','rawAttributes','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include'];(function(_0x4ed520,_0x21be63){var _0x4415a6=function(_0x14b151){while(--_0x14b151){_0x4ed520['push'](_0x4ed520['shift']());}};_0x4415a6(++_0x21be63);}(_0xe2e6,0x14d));var _0x6e2e=function(_0x1655bb,_0x5a82ae){_0x1655bb=_0x1655bb-0x0;var _0x5e2020=_0xe2e6[_0x1655bb];return _0x5e2020;};'use strict';var emlformat=require(_0x6e2e('0x0'));var rimraf=require(_0x6e2e('0x1'));var zipdir=require(_0x6e2e('0x2'));var jsonpatch=require(_0x6e2e('0x3'));var rp=require(_0x6e2e('0x4'));var moment=require(_0x6e2e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6e2e('0x6'));var util=require(_0x6e2e('0x7'));var path=require(_0x6e2e('0x8'));var sox=require(_0x6e2e('0x9'));var csv=require(_0x6e2e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6e2e('0xb'));var _=require(_0x6e2e('0xc'));var squel=require(_0x6e2e('0xd'));var crypto=require(_0x6e2e('0xe'));var jsforce=require(_0x6e2e('0xf'));var deskjs=require(_0x6e2e('0x10'));var toCsv=require(_0x6e2e('0xa'));var querystring=require(_0x6e2e('0x11'));var Papa=require(_0x6e2e('0x12'));var Redis=require(_0x6e2e('0x13'));var authService=require(_0x6e2e('0x14'));var qs=require(_0x6e2e('0x15'));var as=require(_0x6e2e('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6e2e('0x17'))(_0x6e2e('0x18'));var utils=require('../../config/utils');var config=require(_0x6e2e('0x19'));var licenseUtil=require(_0x6e2e('0x1a'));var db=require(_0x6e2e('0x1b'))['db'];function respondWithStatusCode(_0x503afd,_0x449c78){_0x449c78=_0x449c78||0xcc;return function(_0x100358){if(_0x100358){return _0x503afd[_0x6e2e('0x1c')](_0x449c78);}return _0x503afd['status'](_0x449c78)[_0x6e2e('0x1d')]();};}function respondWithResult(_0x488b71,_0x262e50){_0x262e50=_0x262e50||0xc8;return function(_0x2a6b46){if(_0x2a6b46){return _0x488b71[_0x6e2e('0x1e')](_0x262e50)['json'](_0x2a6b46);}};}function respondWithFilteredResult(_0x531c89,_0x39ed46){return function(_0x59cc69){if(_0x59cc69){var _0x118d97=typeof _0x39ed46['offset']===_0x6e2e('0x1f')&&typeof _0x39ed46['limit']===_0x6e2e('0x1f');var _0x3d7459=_0x59cc69[_0x6e2e('0x20')];var _0xe6f578=_0x118d97?0x0:_0x39ed46['offset'];var _0x18f69e=_0x118d97?_0x59cc69[_0x6e2e('0x20')]:_0x39ed46[_0x6e2e('0x21')]+_0x39ed46[_0x6e2e('0x22')];var _0x21307d;if(_0x18f69e>=_0x3d7459){_0x18f69e=_0x3d7459;_0x21307d=0xc8;}else{_0x21307d=0xce;}_0x531c89[_0x6e2e('0x1e')](_0x21307d);return _0x531c89[_0x6e2e('0x23')](_0x6e2e('0x24'),_0xe6f578+'-'+_0x18f69e+'/'+_0x3d7459)[_0x6e2e('0x25')](_0x59cc69);}return null;};}function patchUpdates(_0x1fcc19){return function(_0x32e95d){try{jsonpatch[_0x6e2e('0x26')](_0x32e95d,_0x1fcc19,!![]);}catch(_0x4eb521){return BPromise[_0x6e2e('0x27')](_0x4eb521);}return _0x32e95d[_0x6e2e('0x28')]();};}function saveUpdates(_0x388dc3,_0x3c4e41){return function(_0x38b990){if(_0x38b990){return _0x38b990[_0x6e2e('0x29')](_0x388dc3)[_0x6e2e('0x2a')](function(_0x434cf){return _0x434cf;});}return null;};}function removeEntity(_0x2f8582,_0x326d93){return function(_0x5cfccf){if(_0x5cfccf){return _0x5cfccf[_0x6e2e('0x2b')]()[_0x6e2e('0x2a')](function(){_0x2f8582[_0x6e2e('0x1e')](0xcc)[_0x6e2e('0x1d')]();});}};}function handleEntityNotFound(_0x5c4f1,_0x48ad26){return function(_0x4c3427){if(!_0x4c3427){_0x5c4f1[_0x6e2e('0x1c')](0x194);}return _0x4c3427;};}function handleError(_0x398a00,_0xb259ff){_0xb259ff=_0xb259ff||0x1f4;return function(_0x39696c){logger['error'](_0x39696c[_0x6e2e('0x2c')]);if(_0x39696c[_0x6e2e('0x2d')]){delete _0x39696c[_0x6e2e('0x2d')];}_0x398a00[_0x6e2e('0x1e')](_0xb259ff)[_0x6e2e('0x2e')](_0x39696c);};}exports[_0x6e2e('0x2f')]=function(_0x132098,_0x5d77af){var _0x120aec={},_0x5220d3={},_0x374291={'count':0x0,'rows':[]};var _0x4af826=_['map'](db[_0x6e2e('0x30')][_0x6e2e('0x31')],function(_0x264f1a){return{'name':_0x264f1a['fieldName'],'type':_0x264f1a['type'][_0x6e2e('0x32')]};});_0x5220d3[_0x6e2e('0x33')]=_[_0x6e2e('0x34')](_0x4af826,'name');_0x5220d3[_0x6e2e('0x35')]=_['keys'](_0x132098[_0x6e2e('0x35')]);_0x5220d3[_0x6e2e('0x36')]=_[_0x6e2e('0x37')](_0x5220d3[_0x6e2e('0x33')],_0x5220d3[_0x6e2e('0x35')]);_0x120aec[_0x6e2e('0x38')]=_[_0x6e2e('0x37')](_0x5220d3[_0x6e2e('0x33')],qs[_0x6e2e('0x39')](_0x132098[_0x6e2e('0x35')][_0x6e2e('0x39')]));_0x120aec['attributes']=_0x120aec[_0x6e2e('0x38')][_0x6e2e('0x3a')]?_0x120aec[_0x6e2e('0x38')]:_0x5220d3[_0x6e2e('0x33')];if(!_0x132098[_0x6e2e('0x35')][_0x6e2e('0x3b')](_0x6e2e('0x3c'))){_0x120aec[_0x6e2e('0x22')]=qs[_0x6e2e('0x22')](_0x132098[_0x6e2e('0x35')][_0x6e2e('0x22')]);_0x120aec[_0x6e2e('0x21')]=qs[_0x6e2e('0x21')](_0x132098['query']['offset']);}_0x120aec[_0x6e2e('0x3d')]=qs[_0x6e2e('0x3e')](_0x132098['query'][_0x6e2e('0x3e')]);_0x120aec[_0x6e2e('0x3f')]=qs[_0x6e2e('0x36')](_[_0x6e2e('0x40')](_0x132098[_0x6e2e('0x35')],_0x5220d3[_0x6e2e('0x36')]),_0x4af826);if(_0x132098[_0x6e2e('0x35')][_0x6e2e('0x41')]){_0x120aec[_0x6e2e('0x3f')]=_[_0x6e2e('0x42')](_0x120aec[_0x6e2e('0x3f')],{'$or':_[_0x6e2e('0x34')](_0x4af826,function(_0x5c5ef8){if(_0x5c5ef8[_0x6e2e('0x43')]!==_0x6e2e('0x44')){var _0x4cfe68={};_0x4cfe68[_0x5c5ef8[_0x6e2e('0x2d')]]={'$like':'%'+_0x132098[_0x6e2e('0x35')][_0x6e2e('0x41')]+'%'};return _0x4cfe68;}})});}_0x120aec=_[_0x6e2e('0x42')]({},_0x120aec,_0x132098[_0x6e2e('0x45')]);var _0x37f8dc={'where':_0x120aec[_0x6e2e('0x3f')]};return db[_0x6e2e('0x30')][_0x6e2e('0x20')](_0x37f8dc)['then'](function(_0x15fb24){_0x374291[_0x6e2e('0x20')]=_0x15fb24;if(_0x132098['query'][_0x6e2e('0x46')]){_0x120aec[_0x6e2e('0x47')]=[{'all':!![]}];}return db[_0x6e2e('0x30')][_0x6e2e('0x48')](_0x120aec);})[_0x6e2e('0x2a')](function(_0x35def5){_0x374291[_0x6e2e('0x49')]=_0x35def5;return _0x374291;})[_0x6e2e('0x2a')](respondWithFilteredResult(_0x5d77af,_0x120aec))[_0x6e2e('0x4a')](handleError(_0x5d77af,null));};exports[_0x6e2e('0x4b')]=function(_0x522dfb,_0x203a58){var _0x21eaf5={'raw':!![],'where':{'id':_0x522dfb['params']['id']}},_0xb6d92e={};_0xb6d92e['model']=_['keys'](db[_0x6e2e('0x30')]['rawAttributes']);_0xb6d92e['query']=_[_0x6e2e('0x4c')](_0x522dfb[_0x6e2e('0x35')]);_0xb6d92e['filters']=_[_0x6e2e('0x37')](_0xb6d92e['model'],_0xb6d92e['query']);_0x21eaf5[_0x6e2e('0x38')]=_['intersection'](_0xb6d92e[_0x6e2e('0x33')],qs[_0x6e2e('0x39')](_0x522dfb[_0x6e2e('0x35')][_0x6e2e('0x39')]));_0x21eaf5[_0x6e2e('0x38')]=_0x21eaf5[_0x6e2e('0x38')][_0x6e2e('0x3a')]?_0x21eaf5[_0x6e2e('0x38')]:_0xb6d92e['model'];if(_0x522dfb[_0x6e2e('0x35')][_0x6e2e('0x46')]){_0x21eaf5[_0x6e2e('0x47')]=[{'all':!![]}];}_0x21eaf5=_[_0x6e2e('0x42')]({},_0x21eaf5,_0x522dfb[_0x6e2e('0x45')]);return db[_0x6e2e('0x30')][_0x6e2e('0x4d')](_0x21eaf5)[_0x6e2e('0x2a')](handleEntityNotFound(_0x203a58,null))[_0x6e2e('0x2a')](respondWithResult(_0x203a58,null))['catch'](handleError(_0x203a58,null));};exports['create']=function(_0x148099,_0x8a9e56){return db['ZohoField'][_0x6e2e('0x4e')](_0x148099['body'],{})[_0x6e2e('0x2a')](respondWithResult(_0x8a9e56,0xc9))[_0x6e2e('0x4a')](handleError(_0x8a9e56,null));};exports['update']=function(_0x2a22e7,_0x1db653){if(_0x2a22e7['body']['id']){delete _0x2a22e7[_0x6e2e('0x4f')]['id'];}return db[_0x6e2e('0x30')][_0x6e2e('0x4d')]({'where':{'id':_0x2a22e7['params']['id']}})['then'](handleEntityNotFound(_0x1db653,null))['then'](saveUpdates(_0x2a22e7['body'],null))[_0x6e2e('0x2a')](respondWithResult(_0x1db653,null))[_0x6e2e('0x4a')](handleError(_0x1db653,null));};exports[_0x6e2e('0x2b')]=function(_0x32cb93,_0x15585a){return db[_0x6e2e('0x30')][_0x6e2e('0x4d')]({'where':{'id':_0x32cb93[_0x6e2e('0x50')]['id']}})[_0x6e2e('0x2a')](handleEntityNotFound(_0x15585a,null))[_0x6e2e('0x2a')](removeEntity(_0x15585a,null))[_0x6e2e('0x4a')](handleError(_0x15585a,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 0720784..205d2bb 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 _0xa46e=['path','../../config/environment','exports','define','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','util','api','moment','bluebird'];(function(_0x22b219,_0x3357b5){var _0x52084e=function(_0x3ebf5b){while(--_0x3ebf5b){_0x22b219['push'](_0x22b219['shift']());}};_0x52084e(++_0x3357b5);}(_0xa46e,0x8a));var _0xea46=function(_0x5948dd,_0x1f6ac8){_0x5948dd=_0x5948dd-0x0;var _0xb1f8be=_0xa46e[_0x5948dd];return _0xb1f8be;};'use strict';var _=require(_0xea46('0x0'));var util=require(_0xea46('0x1'));var logger=require('../../config/logger')(_0xea46('0x2'));var moment=require(_0xea46('0x3'));var BPromise=require(_0xea46('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xea46('0x5'));var rimraf=require('rimraf');var config=require(_0xea46('0x6'));var attributes=require('./intZohoField.attributes');module[_0xea46('0x7')]=function(_0x528404,_0x10bee5){return _0x528404[_0xea46('0x8')]('ZohoField',attributes,{'tableName':_0xea46('0x9'),'paranoid':![],'indexes':[{'name':_0xea46('0xa'),'fields':[_0xea46('0xb'),_0xea46('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4888=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intZohoField.attributes','exports','define','FieldId'];(function(_0x49c02c,_0x2bb86e){var _0x3d8922=function(_0x189527){while(--_0x189527){_0x49c02c['push'](_0x49c02c['shift']());}};_0x3d8922(++_0x2bb86e);}(_0x4888,0x198));var _0x8488=function(_0x565404,_0x846949){_0x565404=_0x565404-0x0;var _0x2b0bb3=_0x4888[_0x565404];return _0x2b0bb3;};'use strict';var _=require('lodash');var util=require(_0x8488('0x0'));var logger=require(_0x8488('0x1'))(_0x8488('0x2'));var moment=require(_0x8488('0x3'));var BPromise=require(_0x8488('0x4'));var rp=require(_0x8488('0x5'));var fs=require('fs');var path=require(_0x8488('0x6'));var rimraf=require('rimraf');var config=require(_0x8488('0x7'));var attributes=require(_0x8488('0x8'));module[_0x8488('0x9')]=function(_0x421292,_0x326887){return _0x421292[_0x8488('0xa')]('ZohoField',attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':['idField',_0x8488('0xb')],'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 599e9ef..bb8f779 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 _0x6e8e=['../../config/utils','rpc','jayson/promise','client','http','request','ZohoField,\x20%s,\x20%s','request\x20sent','ZohoField,\x20%s,\x20%s,\x20%s','error','message','info','result','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0xe57d07,_0x126542){var _0x189a99=function(_0x47ae0f){while(--_0x47ae0f){_0xe57d07['push'](_0xe57d07['shift']());}};_0x189a99(++_0x126542);}(_0x6e8e,0xde));var _0xe6e8=function(_0x3fc0d0,_0x55a39a){_0x3fc0d0=_0x3fc0d0-0x0;var _0x449a31=_0x6e8e[_0x3fc0d0];return _0x449a31;};'use strict';var _=require(_0xe6e8('0x0'));var util=require(_0xe6e8('0x1'));var moment=require(_0xe6e8('0x2'));var BPromise=require('bluebird');var rs=require(_0xe6e8('0x3'));var fs=require('fs');var Redis=require(_0xe6e8('0x4'));var db=require(_0xe6e8('0x5'))['db'];var utils=require(_0xe6e8('0x6'));var logger=require('../../config/logger')(_0xe6e8('0x7'));var config=require('../../config/environment');var jayson=require(_0xe6e8('0x8'));var client=jayson[_0xe6e8('0x9')][_0xe6e8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25b6c2,_0x598103,_0x10bb4e){return new BPromise(function(_0x426385,_0x16618d){return client[_0xe6e8('0xb')](_0x25b6c2,_0x10bb4e)['then'](function(_0x1738f0){logger['info'](_0xe6e8('0xc'),_0x598103,_0xe6e8('0xd'));logger['debug'](_0xe6e8('0xe'),_0x598103,'request\x20sent',JSON['stringify'](_0x1738f0));if(_0x1738f0[_0xe6e8('0xf')]){if(_0x1738f0[_0xe6e8('0xf')]['code']===0x1f4){logger['error'](_0xe6e8('0xc'),_0x598103,_0x1738f0[_0xe6e8('0xf')][_0xe6e8('0x10')]);return _0x16618d(_0x1738f0[_0xe6e8('0xf')][_0xe6e8('0x10')]);}logger['error']('ZohoField,\x20%s,\x20%s',_0x598103,_0x1738f0[_0xe6e8('0xf')][_0xe6e8('0x10')]);return _0x426385(_0x1738f0[_0xe6e8('0xf')][_0xe6e8('0x10')]);}else{logger[_0xe6e8('0x11')](_0xe6e8('0xc'),_0x598103,_0xe6e8('0xd'));_0x426385(_0x1738f0[_0xe6e8('0x12')][_0xe6e8('0x10')]);}})['catch'](function(_0x434388){logger['error'](_0xe6e8('0xc'),_0x598103,_0x434388);_0x16618d(_0x434388);});});} \ No newline at end of file +var _0x4873=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','error','message','catch','lodash','util','randomstring'];(function(_0x4b980d,_0x32fc6a){var _0x5c7974=function(_0x3b7af4){while(--_0x3b7af4){_0x4b980d['push'](_0x4b980d['shift']());}};_0x5c7974(++_0x32fc6a);}(_0x4873,0x89));var _0x3487=function(_0x4eec7e,_0x2b57e4){_0x4eec7e=_0x4eec7e-0x0;var _0x514785=_0x4873[_0x4eec7e];return _0x514785;};'use strict';var _=require(_0x3487('0x0'));var util=require(_0x3487('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3487('0x2'));var fs=require('fs');var Redis=require(_0x3487('0x3'));var db=require(_0x3487('0x4'))['db'];var utils=require(_0x3487('0x5'));var logger=require(_0x3487('0x6'))(_0x3487('0x7'));var config=require('../../config/environment');var jayson=require(_0x3487('0x8'));var client=jayson[_0x3487('0x9')][_0x3487('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36e070,_0x579710,_0x406037){return new BPromise(function(_0x4cbf8f,_0x212c1f){return client[_0x3487('0xb')](_0x36e070,_0x406037)[_0x3487('0xc')](function(_0x3fd84d){logger[_0x3487('0xd')](_0x3487('0xe'),_0x579710,_0x3487('0xf'));logger[_0x3487('0x10')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x579710,_0x3487('0xf'),JSON['stringify'](_0x3fd84d));if(_0x3fd84d[_0x3487('0x11')]){if(_0x3fd84d[_0x3487('0x11')]['code']===0x1f4){logger[_0x3487('0x11')](_0x3487('0xe'),_0x579710,_0x3fd84d['error'][_0x3487('0x12')]);return _0x212c1f(_0x3fd84d[_0x3487('0x11')][_0x3487('0x12')]);}logger[_0x3487('0x11')](_0x3487('0xe'),_0x579710,_0x3fd84d['error'][_0x3487('0x12')]);return _0x4cbf8f(_0x3fd84d[_0x3487('0x11')][_0x3487('0x12')]);}else{logger[_0x3487('0xd')](_0x3487('0xe'),_0x579710,_0x3487('0xf'));_0x4cbf8f(_0x3fd84d['result'][_0x3487('0x12')]);}})[_0x3487('0x13')](function(_0xc80a41){logger['error'](_0x3487('0xe'),_0x579710,_0xc80a41);_0x212c1f(_0xc80a41);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 5d68b60..d6b3193 100644 --- a/server/api/integration/index.js +++ b/server/api/integration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x3ec753,_0x2dea7a){var _0x3ab921=function(_0x1698fc){while(--_0x1698fc){_0x3ec753['push'](_0x3ec753['shift']());}};_0x3ab921(++_0x2dea7a);}(_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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x468e02,_0x2dc52e){var _0x44e314=function(_0xb6294c){while(--_0xb6294c){_0x468e02['push'](_0x468e02['shift']());}};_0x44e314(++_0x2dc52e);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x506d83,_0x1899e9){_0x506d83=_0x506d83-0x0;var _0x335e8b=_0xcb91[_0x506d83];return _0x335e8b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 781056e..4549f96 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 _0xa64a=['BOOLEAN','state','sequelize','STRING','unique_name_and_version','app.js','INTEGER'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0xa64a,0xc6));var _0xaa64=function(_0x4b352e,_0x1a5ebe){_0x4b352e=_0x4b352e-0x0;var _0x4b34a4=_0xa64a[_0x4b352e];return _0x4b34a4;};'use strict';var Sequelize=require(_0xaa64('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0xaa64('0x1')],'allowNull':![],'unique':_0xaa64('0x2')},'main':{'type':Sequelize[_0xaa64('0x1')],'defaultValue':_0xaa64('0x3')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0xaa64('0x1')]},'type':{'type':Sequelize[_0xaa64('0x1')]},'size':{'type':Sequelize[_0xaa64('0x4')]},'active':{'type':Sequelize[_0xaa64('0x5')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0xaa64('0x1')]},'state':{'type':Sequelize[_0xaa64('0x1')],'unique':_0xaa64('0x6')},'description':{'type':Sequelize[_0xaa64('0x1')]},'title':{'type':Sequelize[_0xaa64('0x1')]},'remoteUri':{'type':Sequelize[_0xaa64('0x1')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file +var _0xdc35=['unique_name_and_version','app.js','BOOLEAN','state','sequelize','STRING'];(function(_0x100d62,_0x5a36fe){var _0x3e61cd=function(_0x1b02ef){while(--_0x1b02ef){_0x100d62['push'](_0x100d62['shift']());}};_0x3e61cd(++_0x5a36fe);}(_0xdc35,0xd6));var _0x5dc3=function(_0x3ba7a9,_0x487aee){_0x3ba7a9=_0x3ba7a9-0x0;var _0x52fffd=_0xdc35[_0x3ba7a9];return _0x52fffd;};'use strict';var Sequelize=require(_0x5dc3('0x0'));module['exports']={'name':{'type':Sequelize[_0x5dc3('0x1')],'allowNull':![],'unique':_0x5dc3('0x2')},'version':{'type':Sequelize[_0x5dc3('0x1')],'allowNull':![],'unique':_0x5dc3('0x2')},'main':{'type':Sequelize['STRING'],'defaultValue':_0x5dc3('0x3')},'filename':{'type':Sequelize[_0x5dc3('0x1')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x5dc3('0x1')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0x5dc3('0x4')],'defaultValue':![]},'author':{'type':Sequelize[_0x5dc3('0x1')]},'logo':{'type':Sequelize[_0x5dc3('0x1')]},'state':{'type':Sequelize[_0x5dc3('0x1')],'unique':_0x5dc3('0x5')},'description':{'type':Sequelize[_0x5dc3('0x1')]},'title':{'type':Sequelize[_0x5dc3('0x1')]},'remoteUri':{'type':Sequelize[_0x5dc3('0x1')]},'link':{'type':Sequelize[_0x5dc3('0x1')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index ea9eb33..4e4fa1f 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 _0x5fab=['querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','end','sendStatus','name','send','index','map','Integration','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','includeAll','include','findAll','then','rows','show','params','intersection','fields','options','find','catch','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce'];(function(_0x348860,_0x4531f6){var _0x2fc2ad=function(_0x3b449f){while(--_0x3b449f){_0x348860['push'](_0x348860['shift']());}};_0x2fc2ad(++_0x4531f6);}(_0x5fab,0x177));var _0xb5fa=function(_0x17541e,_0x46df72){_0x17541e=_0x17541e-0x0;var _0x1c17eb=_0x5fab[_0x17541e];return _0x1c17eb;};'use strict';var emlformat=require(_0xb5fa('0x0'));var rimraf=require(_0xb5fa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb5fa('0x2'));var rp=require(_0xb5fa('0x3'));var moment=require(_0xb5fa('0x4'));var BPromise=require(_0xb5fa('0x5'));var Mustache=require(_0xb5fa('0x6'));var util=require(_0xb5fa('0x7'));var path=require(_0xb5fa('0x8'));var sox=require(_0xb5fa('0x9'));var csv=require(_0xb5fa('0xa'));var ejs=require(_0xb5fa('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb5fa('0xc'));var crypto=require(_0xb5fa('0xd'));var jsforce=require(_0xb5fa('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb5fa('0xa'));var querystring=require(_0xb5fa('0xf'));var Papa=require(_0xb5fa('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb5fa('0x11'));var as=require(_0xb5fa('0x12'));var hardwareService=require(_0xb5fa('0x13'));var logger=require(_0xb5fa('0x14'))(_0xb5fa('0x15'));var utils=require(_0xb5fa('0x16'));var config=require(_0xb5fa('0x17'));var licenseUtil=require(_0xb5fa('0x18'));var db=require(_0xb5fa('0x19'))['db'];function respondWithStatusCode(_0x4d3576,_0x2ad830){_0x2ad830=_0x2ad830||0xcc;return function(_0x3dad4d){if(_0x3dad4d){return _0x4d3576['sendStatus'](_0x2ad830);}return _0x4d3576[_0xb5fa('0x1a')](_0x2ad830)['end']();};}function respondWithResult(_0x265992,_0x3fc372){_0x3fc372=_0x3fc372||0xc8;return function(_0x40c914){if(_0x40c914){return _0x265992[_0xb5fa('0x1a')](_0x3fc372)[_0xb5fa('0x1b')](_0x40c914);}};}function respondWithFilteredResult(_0x5371cf,_0x567f31){return function(_0x38e964){if(_0x38e964){var _0x587043=typeof _0x567f31[_0xb5fa('0x1c')]===_0xb5fa('0x1d')&&typeof _0x567f31['limit']==='undefined';var _0x451a55=_0x38e964[_0xb5fa('0x1e')];var _0x32e9e5=_0x587043?0x0:_0x567f31[_0xb5fa('0x1c')];var _0x324ba5=_0x587043?_0x38e964[_0xb5fa('0x1e')]:_0x567f31[_0xb5fa('0x1c')]+_0x567f31[_0xb5fa('0x1f')];var _0xc14dc4;if(_0x324ba5>=_0x451a55){_0x324ba5=_0x451a55;_0xc14dc4=0xc8;}else{_0xc14dc4=0xce;}_0x5371cf[_0xb5fa('0x1a')](_0xc14dc4);return _0x5371cf[_0xb5fa('0x20')](_0xb5fa('0x21'),_0x32e9e5+'-'+_0x324ba5+'/'+_0x451a55)['json'](_0x38e964);}return null;};}function patchUpdates(_0x432bfa){return function(_0x519e20){try{jsonpatch[_0xb5fa('0x22')](_0x519e20,_0x432bfa,!![]);}catch(_0x4a6c04){return BPromise[_0xb5fa('0x23')](_0x4a6c04);}return _0x519e20[_0xb5fa('0x24')]();};}function saveUpdates(_0x4e05c0,_0x40dfdf){return function(_0x3a2ab9){if(_0x3a2ab9){return _0x3a2ab9[_0xb5fa('0x25')](_0x4e05c0)['then'](function(_0x32a85c){return _0x32a85c;});}return null;};}function removeEntity(_0xec108f,_0x444237){return function(_0x542348){if(_0x542348){return _0x542348[_0xb5fa('0x26')]()['then'](function(){_0xec108f[_0xb5fa('0x1a')](0xcc)[_0xb5fa('0x27')]();});}};}function handleEntityNotFound(_0x11053a,_0x543edf){return function(_0x2dbd22){if(!_0x2dbd22){_0x11053a[_0xb5fa('0x28')](0x194);}return _0x2dbd22;};}function handleError(_0x6a455c,_0x20d649){_0x20d649=_0x20d649||0x1f4;return function(_0x568870){logger['error'](_0x568870['stack']);if(_0x568870['name']){delete _0x568870[_0xb5fa('0x29')];}_0x6a455c[_0xb5fa('0x1a')](_0x20d649)[_0xb5fa('0x2a')](_0x568870);};}exports[_0xb5fa('0x2b')]=function(_0x534884,_0x3506a4){var _0x358549={},_0x353314={},_0x409af9={'count':0x0,'rows':[]};var _0x2a5690=_[_0xb5fa('0x2c')](db[_0xb5fa('0x2d')][_0xb5fa('0x2e')],function(_0x1f4380){return{'name':_0x1f4380[_0xb5fa('0x2f')],'type':_0x1f4380[_0xb5fa('0x30')][_0xb5fa('0x31')]};});_0x353314[_0xb5fa('0x32')]=_[_0xb5fa('0x2c')](_0x2a5690,_0xb5fa('0x29'));_0x353314[_0xb5fa('0x33')]=_[_0xb5fa('0x34')](_0x534884[_0xb5fa('0x33')]);_0x353314[_0xb5fa('0x35')]=_['intersection'](_0x353314[_0xb5fa('0x32')],_0x353314['query']);_0x358549['attributes']=_['intersection'](_0x353314[_0xb5fa('0x32')],qs['fields'](_0x534884[_0xb5fa('0x33')]['fields']));_0x358549['attributes']=_0x358549[_0xb5fa('0x36')][_0xb5fa('0x37')]?_0x358549['attributes']:_0x353314['model'];if(!_0x534884[_0xb5fa('0x33')][_0xb5fa('0x38')](_0xb5fa('0x39'))){_0x358549['limit']=qs[_0xb5fa('0x1f')](_0x534884[_0xb5fa('0x33')]['limit']);_0x358549[_0xb5fa('0x1c')]=qs[_0xb5fa('0x1c')](_0x534884[_0xb5fa('0x33')]['offset']);}_0x358549[_0xb5fa('0x3a')]=qs[_0xb5fa('0x3b')](_0x534884[_0xb5fa('0x33')]['sort']);_0x358549[_0xb5fa('0x3c')]=qs[_0xb5fa('0x35')](_[_0xb5fa('0x3d')](_0x534884[_0xb5fa('0x33')],_0x353314['filters']),_0x2a5690);if(_0x534884['query']['filter']){_0x358549['where']=_['merge'](_0x358549['where'],{'$or':_[_0xb5fa('0x2c')](_0x2a5690,function(_0x4c0a4d){if(_0x4c0a4d[_0xb5fa('0x30')]!==_0xb5fa('0x3e')){var _0x36db1a={};_0x36db1a[_0x4c0a4d[_0xb5fa('0x29')]]={'$like':'%'+_0x534884[_0xb5fa('0x33')][_0xb5fa('0x3f')]+'%'};return _0x36db1a;}})});}_0x358549=_['merge']({},_0x358549,_0x534884['options']);var _0x4c4bf0={'where':_0x358549[_0xb5fa('0x3c')]};return db['Integration'][_0xb5fa('0x1e')](_0x4c4bf0)['then'](function(_0x58aa97){_0x409af9[_0xb5fa('0x1e')]=_0x58aa97;if(_0x534884[_0xb5fa('0x33')][_0xb5fa('0x40')]){_0x358549[_0xb5fa('0x41')]=[{'all':!![]}];}return db[_0xb5fa('0x2d')][_0xb5fa('0x42')](_0x358549);})[_0xb5fa('0x43')](function(_0x83df0b){_0x409af9[_0xb5fa('0x44')]=_0x83df0b;return _0x409af9;})[_0xb5fa('0x43')](respondWithFilteredResult(_0x3506a4,_0x358549))['catch'](handleError(_0x3506a4,null));};exports[_0xb5fa('0x45')]=function(_0x4bc9df,_0x233f90){var _0x39aac3={'raw':![],'where':{'id':_0x4bc9df[_0xb5fa('0x46')]['id']}},_0x2c7c5f={};_0x2c7c5f[_0xb5fa('0x32')]=_[_0xb5fa('0x34')](db[_0xb5fa('0x2d')][_0xb5fa('0x2e')]);_0x2c7c5f['query']=_[_0xb5fa('0x34')](_0x4bc9df[_0xb5fa('0x33')]);_0x2c7c5f['filters']=_[_0xb5fa('0x47')](_0x2c7c5f['model'],_0x2c7c5f[_0xb5fa('0x33')]);_0x39aac3[_0xb5fa('0x36')]=_['intersection'](_0x2c7c5f['model'],qs[_0xb5fa('0x48')](_0x4bc9df[_0xb5fa('0x33')][_0xb5fa('0x48')]));_0x39aac3[_0xb5fa('0x36')]=_0x39aac3[_0xb5fa('0x36')][_0xb5fa('0x37')]?_0x39aac3[_0xb5fa('0x36')]:_0x2c7c5f[_0xb5fa('0x32')];if(_0x4bc9df['query'][_0xb5fa('0x40')]){_0x39aac3[_0xb5fa('0x41')]=[{'all':!![]}];}_0x39aac3=_['merge']({},_0x39aac3,_0x4bc9df[_0xb5fa('0x49')]);return db[_0xb5fa('0x2d')][_0xb5fa('0x4a')](_0x39aac3)[_0xb5fa('0x43')](handleEntityNotFound(_0x233f90,null))[_0xb5fa('0x43')](respondWithResult(_0x233f90,null))[_0xb5fa('0x4b')](handleError(_0x233f90,null));};exports[_0xb5fa('0x4c')]=function(_0x33eb2c,_0x20f5f5){return db[_0xb5fa('0x2d')][_0xb5fa('0x4c')](_0x33eb2c[_0xb5fa('0x4d')],{})[_0xb5fa('0x43')](respondWithResult(_0x20f5f5,0xc9))[_0xb5fa('0x4b')](handleError(_0x20f5f5,null));};exports[_0xb5fa('0x25')]=function(_0x3a39f2,_0x52f5d8){if(_0x3a39f2['body']['id']){delete _0x3a39f2[_0xb5fa('0x4d')]['id'];}return db['Integration'][_0xb5fa('0x4a')]({'where':{'id':_0x3a39f2[_0xb5fa('0x46')]['id']}})['then'](handleEntityNotFound(_0x52f5d8,null))[_0xb5fa('0x43')](saveUpdates(_0x3a39f2[_0xb5fa('0x4d')],null))[_0xb5fa('0x43')](respondWithResult(_0x52f5d8,null))[_0xb5fa('0x4b')](handleError(_0x52f5d8,null));};exports[_0xb5fa('0x26')]=function(_0x3ffee0,_0x51d5f7){return db[_0xb5fa('0x2d')]['find']({'where':{'id':_0x3ffee0[_0xb5fa('0x46')]['id']}})[_0xb5fa('0x43')](handleEntityNotFound(_0x51d5f7,null))[_0xb5fa('0x43')](removeEntity(_0x51d5f7,null))['catch'](handleError(_0x51d5f7,null));}; \ No newline at end of file +var _0x6343=['hasOwnProperty','nolimit','order','where','filter','merge','VIRTUAL','options','Integration','then','rows','catch','show','params','keys','includeAll','include','create','body','find','zip-dir','fast-json-patch','util','path','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','stack','send','map','rawAttributes','fieldName','type','key','model','name','filters','query','attributes','intersection','fields','length'];(function(_0x9525c1,_0x2ac5f5){var _0x3deb4e=function(_0x3ae637){while(--_0x3ae637){_0x9525c1['push'](_0x9525c1['shift']());}};_0x3deb4e(++_0x2ac5f5);}(_0x6343,0x168));var _0x3634=function(_0x1fd198,_0x5286f3){_0x1fd198=_0x1fd198-0x0;var _0x6e5aa4=_0x6343[_0x1fd198];return _0x6e5aa4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3634('0x0'));var jsonpatch=require(_0x3634('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3634('0x2'));var path=require(_0x3634('0x3'));var sox=require('sox');var csv=require(_0x3634('0x4'));var ejs=require(_0x3634('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3634('0x6'));var squel=require(_0x3634('0x7'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3634('0x8'));var toCsv=require(_0x3634('0x4'));var querystring=require(_0x3634('0x9'));var Papa=require(_0x3634('0xa'));var Redis=require(_0x3634('0xb'));var authService=require(_0x3634('0xc'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3634('0xd'));var logger=require(_0x3634('0xe'))('api');var utils=require(_0x3634('0xf'));var config=require(_0x3634('0x10'));var licenseUtil=require(_0x3634('0x11'));var db=require(_0x3634('0x12'))['db'];function respondWithStatusCode(_0x1e6a04,_0x151c8c){_0x151c8c=_0x151c8c||0xcc;return function(_0x35ae07){if(_0x35ae07){return _0x1e6a04[_0x3634('0x13')](_0x151c8c);}return _0x1e6a04[_0x3634('0x14')](_0x151c8c)[_0x3634('0x15')]();};}function respondWithResult(_0x299e53,_0x71d09b){_0x71d09b=_0x71d09b||0xc8;return function(_0x7e4801){if(_0x7e4801){return _0x299e53[_0x3634('0x14')](_0x71d09b)['json'](_0x7e4801);}};}function respondWithFilteredResult(_0x167247,_0x48787f){return function(_0x69609d){if(_0x69609d){var _0x18285c=typeof _0x48787f[_0x3634('0x16')]===_0x3634('0x17')&&typeof _0x48787f[_0x3634('0x18')]==='undefined';var _0x3121a3=_0x69609d['count'];var _0x50350d=_0x18285c?0x0:_0x48787f[_0x3634('0x16')];var _0x4b2115=_0x18285c?_0x69609d[_0x3634('0x19')]:_0x48787f[_0x3634('0x16')]+_0x48787f[_0x3634('0x18')];var _0x5603d2;if(_0x4b2115>=_0x3121a3){_0x4b2115=_0x3121a3;_0x5603d2=0xc8;}else{_0x5603d2=0xce;}_0x167247[_0x3634('0x14')](_0x5603d2);return _0x167247[_0x3634('0x1a')]('Content-Range',_0x50350d+'-'+_0x4b2115+'/'+_0x3121a3)[_0x3634('0x1b')](_0x69609d);}return null;};}function patchUpdates(_0x506281){return function(_0x742e56){try{jsonpatch[_0x3634('0x1c')](_0x742e56,_0x506281,!![]);}catch(_0x5b77a7){return BPromise[_0x3634('0x1d')](_0x5b77a7);}return _0x742e56[_0x3634('0x1e')]();};}function saveUpdates(_0x206c8e,_0x505026){return function(_0x22b7ef){if(_0x22b7ef){return _0x22b7ef[_0x3634('0x1f')](_0x206c8e)['then'](function(_0x3936ee){return _0x3936ee;});}return null;};}function removeEntity(_0x596acb,_0x5e9188){return function(_0x3a8c41){if(_0x3a8c41){return _0x3a8c41[_0x3634('0x20')]()['then'](function(){_0x596acb[_0x3634('0x14')](0xcc)[_0x3634('0x15')]();});}};}function handleEntityNotFound(_0x17db44,_0x225ddc){return function(_0x363ca2){if(!_0x363ca2){_0x17db44[_0x3634('0x13')](0x194);}return _0x363ca2;};}function handleError(_0x38e863,_0x4762b1){_0x4762b1=_0x4762b1||0x1f4;return function(_0x22f1f1){logger['error'](_0x22f1f1[_0x3634('0x21')]);if(_0x22f1f1['name']){delete _0x22f1f1['name'];}_0x38e863['status'](_0x4762b1)[_0x3634('0x22')](_0x22f1f1);};}exports['index']=function(_0x3bf28b,_0x12b80e){var _0x49804f={},_0x55a77f={},_0x282f73={'count':0x0,'rows':[]};var _0x5bd4e0=_[_0x3634('0x23')](db['Integration'][_0x3634('0x24')],function(_0x3d7322){return{'name':_0x3d7322[_0x3634('0x25')],'type':_0x3d7322[_0x3634('0x26')][_0x3634('0x27')]};});_0x55a77f[_0x3634('0x28')]=_[_0x3634('0x23')](_0x5bd4e0,_0x3634('0x29'));_0x55a77f['query']=_['keys'](_0x3bf28b['query']);_0x55a77f[_0x3634('0x2a')]=_['intersection'](_0x55a77f[_0x3634('0x28')],_0x55a77f[_0x3634('0x2b')]);_0x49804f[_0x3634('0x2c')]=_[_0x3634('0x2d')](_0x55a77f[_0x3634('0x28')],qs[_0x3634('0x2e')](_0x3bf28b['query'][_0x3634('0x2e')]));_0x49804f[_0x3634('0x2c')]=_0x49804f[_0x3634('0x2c')][_0x3634('0x2f')]?_0x49804f[_0x3634('0x2c')]:_0x55a77f[_0x3634('0x28')];if(!_0x3bf28b[_0x3634('0x2b')][_0x3634('0x30')](_0x3634('0x31'))){_0x49804f['limit']=qs[_0x3634('0x18')](_0x3bf28b[_0x3634('0x2b')][_0x3634('0x18')]);_0x49804f[_0x3634('0x16')]=qs['offset'](_0x3bf28b[_0x3634('0x2b')][_0x3634('0x16')]);}_0x49804f[_0x3634('0x32')]=qs['sort'](_0x3bf28b['query']['sort']);_0x49804f[_0x3634('0x33')]=qs[_0x3634('0x2a')](_['pick'](_0x3bf28b[_0x3634('0x2b')],_0x55a77f[_0x3634('0x2a')]),_0x5bd4e0);if(_0x3bf28b[_0x3634('0x2b')][_0x3634('0x34')]){_0x49804f[_0x3634('0x33')]=_[_0x3634('0x35')](_0x49804f[_0x3634('0x33')],{'$or':_['map'](_0x5bd4e0,function(_0x416987){if(_0x416987['type']!==_0x3634('0x36')){var _0x3ae966={};_0x3ae966[_0x416987[_0x3634('0x29')]]={'$like':'%'+_0x3bf28b[_0x3634('0x2b')][_0x3634('0x34')]+'%'};return _0x3ae966;}})});}_0x49804f=_['merge']({},_0x49804f,_0x3bf28b[_0x3634('0x37')]);var _0x33af29={'where':_0x49804f[_0x3634('0x33')]};return db[_0x3634('0x38')][_0x3634('0x19')](_0x33af29)[_0x3634('0x39')](function(_0x28c8d0){_0x282f73[_0x3634('0x19')]=_0x28c8d0;if(_0x3bf28b[_0x3634('0x2b')]['includeAll']){_0x49804f['include']=[{'all':!![]}];}return db[_0x3634('0x38')]['findAll'](_0x49804f);})['then'](function(_0x5948db){_0x282f73[_0x3634('0x3a')]=_0x5948db;return _0x282f73;})['then'](respondWithFilteredResult(_0x12b80e,_0x49804f))[_0x3634('0x3b')](handleError(_0x12b80e,null));};exports[_0x3634('0x3c')]=function(_0x53c1ea,_0x505be7){var _0x4896ab={'raw':![],'where':{'id':_0x53c1ea[_0x3634('0x3d')]['id']}},_0x324970={};_0x324970['model']=_[_0x3634('0x3e')](db[_0x3634('0x38')][_0x3634('0x24')]);_0x324970[_0x3634('0x2b')]=_[_0x3634('0x3e')](_0x53c1ea['query']);_0x324970['filters']=_[_0x3634('0x2d')](_0x324970[_0x3634('0x28')],_0x324970[_0x3634('0x2b')]);_0x4896ab[_0x3634('0x2c')]=_[_0x3634('0x2d')](_0x324970[_0x3634('0x28')],qs['fields'](_0x53c1ea[_0x3634('0x2b')][_0x3634('0x2e')]));_0x4896ab[_0x3634('0x2c')]=_0x4896ab['attributes']['length']?_0x4896ab[_0x3634('0x2c')]:_0x324970[_0x3634('0x28')];if(_0x53c1ea[_0x3634('0x2b')][_0x3634('0x3f')]){_0x4896ab[_0x3634('0x40')]=[{'all':!![]}];}_0x4896ab=_[_0x3634('0x35')]({},_0x4896ab,_0x53c1ea[_0x3634('0x37')]);return db[_0x3634('0x38')]['find'](_0x4896ab)[_0x3634('0x39')](handleEntityNotFound(_0x505be7,null))[_0x3634('0x39')](respondWithResult(_0x505be7,null))[_0x3634('0x3b')](handleError(_0x505be7,null));};exports[_0x3634('0x41')]=function(_0x615276,_0x151654){return db[_0x3634('0x38')][_0x3634('0x41')](_0x615276[_0x3634('0x42')],{})['then'](respondWithResult(_0x151654,0xc9))[_0x3634('0x3b')](handleError(_0x151654,null));};exports[_0x3634('0x1f')]=function(_0x4a4a94,_0x3c356b){if(_0x4a4a94[_0x3634('0x42')]['id']){delete _0x4a4a94[_0x3634('0x42')]['id'];}return db[_0x3634('0x38')][_0x3634('0x43')]({'where':{'id':_0x4a4a94[_0x3634('0x3d')]['id']}})['then'](handleEntityNotFound(_0x3c356b,null))[_0x3634('0x39')](saveUpdates(_0x4a4a94[_0x3634('0x42')],null))[_0x3634('0x39')](respondWithResult(_0x3c356b,null))[_0x3634('0x3b')](handleError(_0x3c356b,null));};exports[_0x3634('0x20')]=function(_0x582475,_0x66f6a4){return db[_0x3634('0x38')]['find']({'where':{'id':_0x582475['params']['id']}})[_0x3634('0x39')](handleEntityNotFound(_0x66f6a4,null))['then'](removeEntity(_0x66f6a4,null))[_0x3634('0x3b')](handleError(_0x66f6a4,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index bb5e928..2a21d51 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 _0x558b=['integrations','lodash','api','moment','bluebird','rimraf','../../config/environment','./integration.attributes','exports','Integration'];(function(_0x38c6e7,_0x387df2){var _0x37114b=function(_0x2aa963){while(--_0x2aa963){_0x38c6e7['push'](_0x38c6e7['shift']());}};_0x37114b(++_0x387df2);}(_0x558b,0x155));var _0xb558=function(_0x5ef23b,_0x5aad13){_0x5ef23b=_0x5ef23b-0x0;var _0x5ce885=_0x558b[_0x5ef23b];return _0x5ce885;};'use strict';var _=require(_0xb558('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb558('0x1'));var moment=require(_0xb558('0x2'));var BPromise=require(_0xb558('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb558('0x4'));var config=require(_0xb558('0x5'));var attributes=require(_0xb558('0x6'));module[_0xb558('0x7')]=function(_0x16378a,_0x3973a8){return _0x16378a['define'](_0xb558('0x8'),attributes,{'tableName':_0xb558('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x03b1=['rimraf','./integration.attributes','exports','define','Integration','integrations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x03b1,0x164));var _0x103b=function(_0x4ff8a5,_0x39c030){_0x4ff8a5=_0x4ff8a5-0x0;var _0x27c636=_0x03b1[_0x4ff8a5];return _0x27c636;};'use strict';var _=require(_0x103b('0x0'));var util=require(_0x103b('0x1'));var logger=require(_0x103b('0x2'))(_0x103b('0x3'));var moment=require(_0x103b('0x4'));var BPromise=require(_0x103b('0x5'));var rp=require(_0x103b('0x6'));var fs=require('fs');var path=require(_0x103b('0x7'));var rimraf=require(_0x103b('0x8'));var config=require('../../config/environment');var attributes=require(_0x103b('0x9'));module[_0x103b('0xa')]=function(_0x13f208,_0x4f5552){return _0x13f208[_0x103b('0xb')](_0x103b('0xc'),attributes,{'tableName':_0x103b('0xd'),'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 5eaf9f2..cefbe9b 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 _0x9f0e=['../../config/environment','jayson/promise','request','then','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0x22a82b,_0x327c67){var _0x5b5582=function(_0x939782){while(--_0x939782){_0x22a82b['push'](_0x22a82b['shift']());}};_0x5b5582(++_0x327c67);}(_0x9f0e,0x116));var _0xe9f0=function(_0x1f6851,_0x45a745){_0x1f6851=_0x1f6851-0x0;var _0x42aed9=_0x9f0e[_0x1f6851];return _0x42aed9;};'use strict';var _=require(_0xe9f0('0x0'));var util=require(_0xe9f0('0x1'));var moment=require(_0xe9f0('0x2'));var BPromise=require(_0xe9f0('0x3'));var rs=require(_0xe9f0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe9f0('0x5'));var logger=require(_0xe9f0('0x6'))(_0xe9f0('0x7'));var config=require(_0xe9f0('0x8'));var jayson=require(_0xe9f0('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3a17b3,_0x167198,_0xe64a79){return new BPromise(function(_0x4be6a6,_0xf4a256){return client[_0xe9f0('0xa')](_0x3a17b3,_0xe64a79)[_0xe9f0('0xb')](function(_0x3386a8){logger[_0xe9f0('0xc')](_0xe9f0('0xd'),_0x167198,_0xe9f0('0xe'));logger[_0xe9f0('0xf')](_0xe9f0('0x10'),_0x167198,'request\x20sent',JSON[_0xe9f0('0x11')](_0x3386a8));if(_0x3386a8[_0xe9f0('0x12')]){if(_0x3386a8[_0xe9f0('0x12')]['code']===0x1f4){logger[_0xe9f0('0x12')]('Integration,\x20%s,\x20%s',_0x167198,_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);return _0xf4a256(_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);}logger['error'](_0xe9f0('0xd'),_0x167198,_0x3386a8['error'][_0xe9f0('0x13')]);return _0x4be6a6(_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);}else{logger['info'](_0xe9f0('0xd'),_0x167198,_0xe9f0('0xe'));_0x4be6a6(_0x3386a8[_0xe9f0('0x14')]['message']);}})[_0xe9f0('0x15')](function(_0x1e16e0){logger[_0xe9f0('0x12')](_0xe9f0('0xd'),_0x167198,_0x1e16e0);_0xf4a256(_0x1e16e0);});});} \ No newline at end of file +var _0x7880=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xe4844,_0x3458cd){var _0x1d0606=function(_0x209001){while(--_0x209001){_0xe4844['push'](_0xe4844['shift']());}};_0x1d0606(++_0x3458cd);}(_0x7880,0x1f4));var _0x0788=function(_0x174a72,_0x46034c){_0x174a72=_0x174a72-0x0;var _0x32cecd=_0x7880[_0x174a72];return _0x32cecd;};'use strict';var _=require('lodash');var util=require(_0x0788('0x0'));var moment=require(_0x0788('0x1'));var BPromise=require(_0x0788('0x2'));var rs=require(_0x0788('0x3'));var fs=require('fs');var Redis=require(_0x0788('0x4'));var db=require(_0x0788('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0788('0x6'))(_0x0788('0x7'));var config=require(_0x0788('0x8'));var jayson=require(_0x0788('0x9'));var client=jayson[_0x0788('0xa')][_0x0788('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f9cb8,_0x44bbb5,_0x3c29f3){return new BPromise(function(_0x422f8b,_0x55e48a){return client[_0x0788('0xc')](_0x3f9cb8,_0x3c29f3)['then'](function(_0xabaf81){logger['info'](_0x0788('0xd'),_0x44bbb5,_0x0788('0xe'));logger[_0x0788('0xf')](_0x0788('0x10'),_0x44bbb5,_0x0788('0xe'),JSON['stringify'](_0xabaf81));if(_0xabaf81[_0x0788('0x11')]){if(_0xabaf81[_0x0788('0x11')][_0x0788('0x12')]===0x1f4){logger[_0x0788('0x11')](_0x0788('0xd'),_0x44bbb5,_0xabaf81[_0x0788('0x11')][_0x0788('0x13')]);return _0x55e48a(_0xabaf81['error'][_0x0788('0x13')]);}logger[_0x0788('0x11')](_0x0788('0xd'),_0x44bbb5,_0xabaf81[_0x0788('0x11')]['message']);return _0x422f8b(_0xabaf81[_0x0788('0x11')]['message']);}else{logger[_0x0788('0x14')](_0x0788('0xd'),_0x44bbb5,_0x0788('0xe'));_0x422f8b(_0xabaf81[_0x0788('0x15')][_0x0788('0x13')]);}})[_0x0788('0x16')](function(_0x5e1a29){logger['error'](_0x0788('0xd'),_0x44bbb5,_0x5e1a29);_0x55e48a(_0x5e1a29);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 81aca84..9be56da 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 _0xba34=['exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete'];(function(_0x500731,_0x18d0e4){var _0x24b1b3=function(_0x349ac1){while(--_0x349ac1){_0x500731['push'](_0x500731['shift']());}};_0x24b1b3(++_0x18d0e4);}(_0xba34,0x119));var _0x4ba3=function(_0x9d3e5e,_0x1336eb){_0x9d3e5e=_0x9d3e5e-0x0;var _0x23e350=_0xba34[_0x9d3e5e];return _0x23e350;};'use strict';var multer=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var path=require(_0x4ba3('0x2'));var timeout=require(_0x4ba3('0x3'));var express=require(_0x4ba3('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4ba3('0x5'));var config=require(_0x4ba3('0x6'));var controller=require(_0x4ba3('0x7'));router[_0x4ba3('0x8')]('/',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xa')]);router[_0x4ba3('0x8')]('/describe',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xb')]);router[_0x4ba3('0x8')](_0x4ba3('0xc'),auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xd')]);router[_0x4ba3('0xe')]('/',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xf')]);router[_0x4ba3('0x10')](_0x4ba3('0xc'),auth['isAuthenticated'](),controller[_0x4ba3('0x11')]);router[_0x4ba3('0x12')]('/:id',auth[_0x4ba3('0x9')](),controller['destroy']);module[_0x4ba3('0x13')]=router; \ No newline at end of file +var _0x66fa=['index','get','/describe','post','/:id','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x5d1d99,_0x10ca23){var _0x2957ec=function(_0x4f4ba){while(--_0x4f4ba){_0x5d1d99['push'](_0x5d1d99['shift']());}};_0x2957ec(++_0x10ca23);}(_0x66fa,0x117));var _0xa66f=function(_0x2b8b2f,_0x29b648){_0x2b8b2f=_0x2b8b2f-0x0;var _0x30996b=_0x66fa[_0x2b8b2f];return _0x30996b;};'use strict';var multer=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var path=require('path');var timeout=require(_0xa66f('0x2'));var express=require(_0xa66f('0x3'));var router=express[_0xa66f('0x4')]();var fs_extra=require(_0xa66f('0x5'));var auth=require(_0xa66f('0x6'));var interaction=require(_0xa66f('0x7'));var config=require(_0xa66f('0x8'));var controller=require('./integrationReport.controller');router['get']('/',auth[_0xa66f('0x9')](),controller[_0xa66f('0xa')]);router[_0xa66f('0xb')](_0xa66f('0xc'),auth[_0xa66f('0x9')](),controller['describe']);router[_0xa66f('0xb')]('/:id',auth[_0xa66f('0x9')](),controller['show']);router[_0xa66f('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xa66f('0xe'),auth[_0xa66f('0x9')](),controller['update']);router[_0xa66f('0xf')]('/:id',auth[_0xa66f('0x9')](),controller['destroy']);module[_0xa66f('0x10')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index e4d73a9..1e483fc 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 _0x83af=['TEXT','ENUM','SENDING','FAILED','sequelize','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x293c3d,_0xd89435){var _0x53cc1d=function(_0x46ecae){while(--_0x46ecae){_0x293c3d['push'](_0x293c3d['shift']());}};_0x53cc1d(++_0xd89435);}(_0x83af,0x1d8));var _0xf83a=function(_0x3ba2a3,_0x34d0ba){_0x3ba2a3=_0x3ba2a3-0x0;var _0x2d0e38=_0x83af[_0x3ba2a3];return _0x2d0e38;};'use strict';var Sequelize=require(_0xf83a('0x0'));module['exports']={'integration':{'type':Sequelize[_0xf83a('0x1')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0xf83a('0x1')]},'ticketId':{'type':Sequelize[_0xf83a('0x1')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0xf83a('0x1')]},'uniqueid':{'type':Sequelize[_0xf83a('0x1')]},'calleridnum':{'type':Sequelize[_0xf83a('0x1')]},'calleridname':{'type':Sequelize[_0xf83a('0x1')]},'queue':{'type':Sequelize[_0xf83a('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xf83a('0x1')]},'agentcalledAt':{'type':Sequelize[_0xf83a('0x2')]},'agentconnectAt':{'type':Sequelize[_0xf83a('0x2')]},'holdtime':{'type':Sequelize[_0xf83a('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xf83a('0x2')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0xf83a('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xf83a('0x3')]},'reason':{'type':Sequelize[_0xf83a('0x1')]},'agentringnoanswer':{'type':Sequelize[_0xf83a('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xf83a('0x2')]},'agentdump':{'type':Sequelize[_0xf83a('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xf83a('0x2')]},'lastevent':{'type':Sequelize[_0xf83a('0x1')]},'channel':{'type':Sequelize[_0xf83a('0x1')]},'channelstate':{'type':Sequelize[_0xf83a('0x3')]},'channelstatedesc':{'type':Sequelize[_0xf83a('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xf83a('0x1')]},'accountcode':{'type':Sequelize[_0xf83a('0x1')]},'context':{'type':Sequelize[_0xf83a('0x1')]},'exten':{'type':Sequelize[_0xf83a('0x1')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xf83a('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xf83a('0x1')]},'destcalleridnum':{'type':Sequelize[_0xf83a('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xf83a('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xf83a('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xf83a('0x1')]},'destpriority':{'type':Sequelize[_0xf83a('0x1')]},'destuniqueid':{'type':Sequelize[_0xf83a('0x1')]},'messageId':{'type':Sequelize[_0xf83a('0x1')]},'inReplyTo':{'type':Sequelize[_0xf83a('0x1')]},'subject':{'type':Sequelize[_0xf83a('0x1')]},'from':{'type':Sequelize[_0xf83a('0x1')]},'to':{'type':Sequelize[_0xf83a('0x1')]},'cc':{'type':Sequelize[_0xf83a('0x1')]},'attachment':{'type':Sequelize[_0xf83a('0x5')]},'html':{'type':Sequelize[_0xf83a('0x5')]},'text':{'type':Sequelize[_0xf83a('0x5')]},'status':{'type':Sequelize[_0xf83a('0x6')]('SENT',_0xf83a('0x7'),'RECEIVED',_0xf83a('0x8'))},'url':{'type':Sequelize[_0xf83a('0x1')]},'app':{'type':Sequelize[_0xf83a('0x1')]},'appdata':{'type':Sequelize[_0xf83a('0x1')]},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x28a2=['TEXT','ENUM','SENT','SENDING','RECEIVED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN'];(function(_0xa3903b,_0x58ac62){var _0x2c7126=function(_0xabdc1){while(--_0xabdc1){_0xa3903b['push'](_0xa3903b['shift']());}};_0x2c7126(++_0x58ac62);}(_0x28a2,0x165));var _0x228a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x28a2[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x228a('0x0'));module[_0x228a('0x1')]={'integration':{'type':Sequelize[_0x228a('0x2')]},'eventChannel':{'type':Sequelize[_0x228a('0x2')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0x228a('0x2')]},'integrationId':{'type':Sequelize[_0x228a('0x3')]},'contacts':{'type':Sequelize[_0x228a('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x228a('0x2')]},'calleridname':{'type':Sequelize[_0x228a('0x2')]},'queue':{'type':Sequelize[_0x228a('0x2')]},'interface':{'type':Sequelize[_0x228a('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x228a('0x4')]},'agentconnectAt':{'type':Sequelize[_0x228a('0x4')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x228a('0x4')]},'talktime':{'type':Sequelize[_0x228a('0x3')]},'agentacw':{'type':Sequelize[_0x228a('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0x228a('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x228a('0x4')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x228a('0x4')]},'lastevent':{'type':Sequelize[_0x228a('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x228a('0x2')]},'connectedlinename':{'type':Sequelize[_0x228a('0x2')]},'language':{'type':Sequelize[_0x228a('0x2')]},'accountcode':{'type':Sequelize[_0x228a('0x2')]},'context':{'type':Sequelize[_0x228a('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x228a('0x2')]},'destchannelstate':{'type':Sequelize[_0x228a('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x228a('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x228a('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x228a('0x2')]},'destlanguage':{'type':Sequelize[_0x228a('0x2')]},'destaccountcode':{'type':Sequelize[_0x228a('0x2')]},'destcontext':{'type':Sequelize[_0x228a('0x2')]},'destexten':{'type':Sequelize[_0x228a('0x2')]},'destpriority':{'type':Sequelize[_0x228a('0x2')]},'destuniqueid':{'type':Sequelize[_0x228a('0x2')]},'messageId':{'type':Sequelize[_0x228a('0x2')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0x228a('0x2')]},'to':{'type':Sequelize[_0x228a('0x2')]},'cc':{'type':Sequelize[_0x228a('0x2')]},'attachment':{'type':Sequelize[_0x228a('0x6')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0x228a('0x6')]},'status':{'type':Sequelize[_0x228a('0x7')](_0x228a('0x8'),_0x228a('0x9'),_0x228a('0xa'),'FAILED')},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0x228a('0x2')]},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0x228a('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 44cfaad..19bf36c 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 _0xd043=['moment','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','update','destroy','then','error','stack','name','send','index','map','IntegrationReport','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','where','VIRTUAL','includeAll','include','findAll','show','params','options','find','catch','create','body','describe','rimraf','zip-dir','fast-json-patch'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xd043,0x8d));var _0x3d04=function(_0x416ad,_0x3797e5){_0x416ad=_0x416ad-0x0;var _0x160983=_0xd043[_0x416ad];return _0x160983;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3d04('0x0'));var zipdir=require(_0x3d04('0x1'));var jsonpatch=require(_0x3d04('0x2'));var rp=require('request-promise');var moment=require(_0x3d04('0x3'));var BPromise=require(_0x3d04('0x4'));var Mustache=require(_0x3d04('0x5'));var util=require('util');var path=require(_0x3d04('0x6'));var sox=require('sox');var csv=require(_0x3d04('0x7'));var ejs=require(_0x3d04('0x8'));var fs=require('fs');var fs_extra=require(_0x3d04('0x9'));var _=require('lodash');var squel=require(_0x3d04('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3d04('0x7'));var querystring=require(_0x3d04('0xb'));var Papa=require(_0x3d04('0xc'));var Redis=require(_0x3d04('0xd'));var authService=require(_0x3d04('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3d04('0xf'));var logger=require(_0x3d04('0x10'))(_0x3d04('0x11'));var utils=require(_0x3d04('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3d04('0x13'))['db'];function respondWithStatusCode(_0x3e2aaf,_0x810e45){_0x810e45=_0x810e45||0xcc;return function(_0xf8bcce){if(_0xf8bcce){return _0x3e2aaf['sendStatus'](_0x810e45);}return _0x3e2aaf[_0x3d04('0x14')](_0x810e45)[_0x3d04('0x15')]();};}function respondWithResult(_0x4d682b,_0xa1028e){_0xa1028e=_0xa1028e||0xc8;return function(_0x2ef41d){if(_0x2ef41d){return _0x4d682b['status'](_0xa1028e)[_0x3d04('0x16')](_0x2ef41d);}};}function respondWithFilteredResult(_0x3a27f8,_0x7f5074){return function(_0x5c17c0){if(_0x5c17c0){var _0x1b5594=typeof _0x7f5074['offset']===_0x3d04('0x17')&&typeof _0x7f5074[_0x3d04('0x18')]===_0x3d04('0x17');var _0x56f7ed=_0x5c17c0[_0x3d04('0x19')];var _0x23d8d2=_0x1b5594?0x0:_0x7f5074[_0x3d04('0x1a')];var _0x2c3631=_0x1b5594?_0x5c17c0[_0x3d04('0x19')]:_0x7f5074[_0x3d04('0x1a')]+_0x7f5074[_0x3d04('0x18')];var _0x1b27a8;if(_0x2c3631>=_0x56f7ed){_0x2c3631=_0x56f7ed;_0x1b27a8=0xc8;}else{_0x1b27a8=0xce;}_0x3a27f8[_0x3d04('0x14')](_0x1b27a8);return _0x3a27f8[_0x3d04('0x1b')](_0x3d04('0x1c'),_0x23d8d2+'-'+_0x2c3631+'/'+_0x56f7ed)[_0x3d04('0x16')](_0x5c17c0);}return null;};}function patchUpdates(_0x3af112){return function(_0x4c6ea7){try{jsonpatch[_0x3d04('0x1d')](_0x4c6ea7,_0x3af112,!![]);}catch(_0x4a2ca2){return BPromise['reject'](_0x4a2ca2);}return _0x4c6ea7['save']();};}function saveUpdates(_0x4b3252,_0x13b680){return function(_0x59b9f8){if(_0x59b9f8){return _0x59b9f8[_0x3d04('0x1e')](_0x4b3252)['then'](function(_0x340a34){return _0x340a34;});}return null;};}function removeEntity(_0x4968c6,_0x1fe466){return function(_0x83d2b){if(_0x83d2b){return _0x83d2b[_0x3d04('0x1f')]()[_0x3d04('0x20')](function(){_0x4968c6[_0x3d04('0x14')](0xcc)[_0x3d04('0x15')]();});}};}function handleEntityNotFound(_0x136c94,_0x145e60){return function(_0x3a9514){if(!_0x3a9514){_0x136c94['sendStatus'](0x194);}return _0x3a9514;};}function handleError(_0x274232,_0x463412){_0x463412=_0x463412||0x1f4;return function(_0x1f46ae){logger[_0x3d04('0x21')](_0x1f46ae[_0x3d04('0x22')]);if(_0x1f46ae['name']){delete _0x1f46ae[_0x3d04('0x23')];}_0x274232[_0x3d04('0x14')](_0x463412)[_0x3d04('0x24')](_0x1f46ae);};}exports[_0x3d04('0x25')]=function(_0x4f5421,_0x2064b8){var _0x3de9b4={},_0x409c51={},_0x1f7e98={'count':0x0,'rows':[]};var _0x2e097e=_[_0x3d04('0x26')](db[_0x3d04('0x27')][_0x3d04('0x28')],function(_0x2ab384){return{'name':_0x2ab384[_0x3d04('0x29')],'type':_0x2ab384[_0x3d04('0x2a')][_0x3d04('0x2b')]};});_0x409c51[_0x3d04('0x2c')]=_[_0x3d04('0x26')](_0x2e097e,_0x3d04('0x23'));_0x409c51['query']=_[_0x3d04('0x2d')](_0x4f5421[_0x3d04('0x2e')]);_0x409c51['filters']=_[_0x3d04('0x2f')](_0x409c51['model'],_0x409c51[_0x3d04('0x2e')]);_0x3de9b4[_0x3d04('0x30')]=_[_0x3d04('0x2f')](_0x409c51[_0x3d04('0x2c')],qs[_0x3d04('0x31')](_0x4f5421[_0x3d04('0x2e')]['fields']));_0x3de9b4[_0x3d04('0x30')]=_0x3de9b4[_0x3d04('0x30')][_0x3d04('0x32')]?_0x3de9b4['attributes']:_0x409c51[_0x3d04('0x2c')];if(!_0x4f5421[_0x3d04('0x2e')][_0x3d04('0x33')](_0x3d04('0x34'))){_0x3de9b4[_0x3d04('0x18')]=qs[_0x3d04('0x18')](_0x4f5421[_0x3d04('0x2e')]['limit']);_0x3de9b4['offset']=qs['offset'](_0x4f5421['query']['offset']);}_0x3de9b4[_0x3d04('0x35')]=qs[_0x3d04('0x36')](_0x4f5421[_0x3d04('0x2e')][_0x3d04('0x36')]);_0x3de9b4['where']=qs[_0x3d04('0x37')](_[_0x3d04('0x38')](_0x4f5421[_0x3d04('0x2e')],_0x409c51[_0x3d04('0x37')]),_0x2e097e);if(_0x4f5421[_0x3d04('0x2e')][_0x3d04('0x39')]){_0x3de9b4['where']=_[_0x3d04('0x3a')](_0x3de9b4[_0x3d04('0x3b')],{'$or':_['map'](_0x2e097e,function(_0x59f150){if(_0x59f150[_0x3d04('0x2a')]!==_0x3d04('0x3c')){var _0x1a4307={};_0x1a4307[_0x59f150[_0x3d04('0x23')]]={'$like':'%'+_0x4f5421['query'][_0x3d04('0x39')]+'%'};return _0x1a4307;}})});}_0x3de9b4=_['merge']({},_0x3de9b4,_0x4f5421['options']);var _0x4ae0c5={'where':_0x3de9b4['where']};return db[_0x3d04('0x27')]['count'](_0x4ae0c5)[_0x3d04('0x20')](function(_0x99ca07){_0x1f7e98[_0x3d04('0x19')]=_0x99ca07;if(_0x4f5421[_0x3d04('0x2e')][_0x3d04('0x3d')]){_0x3de9b4[_0x3d04('0x3e')]=[{'all':!![]}];}return db[_0x3d04('0x27')][_0x3d04('0x3f')](_0x3de9b4);})[_0x3d04('0x20')](function(_0x126a2e){_0x1f7e98['rows']=_0x126a2e;return _0x1f7e98;})['then'](respondWithFilteredResult(_0x2064b8,_0x3de9b4))['catch'](handleError(_0x2064b8,null));};exports[_0x3d04('0x40')]=function(_0x5f16c4,_0x205acb){var _0x46bd36={'raw':![],'where':{'id':_0x5f16c4[_0x3d04('0x41')]['id']}},_0xb17ed2={};_0xb17ed2[_0x3d04('0x2c')]=_[_0x3d04('0x2d')](db['IntegrationReport'][_0x3d04('0x28')]);_0xb17ed2['query']=_[_0x3d04('0x2d')](_0x5f16c4[_0x3d04('0x2e')]);_0xb17ed2[_0x3d04('0x37')]=_[_0x3d04('0x2f')](_0xb17ed2[_0x3d04('0x2c')],_0xb17ed2[_0x3d04('0x2e')]);_0x46bd36[_0x3d04('0x30')]=_[_0x3d04('0x2f')](_0xb17ed2[_0x3d04('0x2c')],qs[_0x3d04('0x31')](_0x5f16c4[_0x3d04('0x2e')][_0x3d04('0x31')]));_0x46bd36['attributes']=_0x46bd36[_0x3d04('0x30')]['length']?_0x46bd36['attributes']:_0xb17ed2[_0x3d04('0x2c')];if(_0x5f16c4[_0x3d04('0x2e')]['includeAll']){_0x46bd36[_0x3d04('0x3e')]=[{'all':!![]}];}_0x46bd36=_['merge']({},_0x46bd36,_0x5f16c4[_0x3d04('0x42')]);return db['IntegrationReport'][_0x3d04('0x43')](_0x46bd36)[_0x3d04('0x20')](handleEntityNotFound(_0x205acb,null))[_0x3d04('0x20')](respondWithResult(_0x205acb,null))[_0x3d04('0x44')](handleError(_0x205acb,null));};exports[_0x3d04('0x45')]=function(_0x4abf5f,_0x44a486){return db[_0x3d04('0x27')][_0x3d04('0x45')](_0x4abf5f[_0x3d04('0x46')],{})[_0x3d04('0x20')](respondWithResult(_0x44a486,0xc9))['catch'](handleError(_0x44a486,null));};exports['update']=function(_0x4990a4,_0x17cc43){if(_0x4990a4[_0x3d04('0x46')]['id']){delete _0x4990a4['body']['id'];}return db['IntegrationReport'][_0x3d04('0x43')]({'where':{'id':_0x4990a4['params']['id']}})[_0x3d04('0x20')](handleEntityNotFound(_0x17cc43,null))[_0x3d04('0x20')](saveUpdates(_0x4990a4[_0x3d04('0x46')],null))[_0x3d04('0x20')](respondWithResult(_0x17cc43,null))['catch'](handleError(_0x17cc43,null));};exports[_0x3d04('0x1f')]=function(_0x5caf2e,_0x319cfc){return db[_0x3d04('0x27')][_0x3d04('0x43')]({'where':{'id':_0x5caf2e['params']['id']}})[_0x3d04('0x20')](handleEntityNotFound(_0x319cfc,null))[_0x3d04('0x20')](removeEntity(_0x319cfc,null))[_0x3d04('0x44')](handleError(_0x319cfc,null));};exports[_0x3d04('0x47')]=function(_0x479e18,_0x4ee44e){return db[_0x3d04('0x27')]['describe']()[_0x3d04('0x20')](respondWithResult(_0x4ee44e,null))[_0x3d04('0x44')](handleError(_0x4ee44e,null));}; \ No newline at end of file +var _0x0110=['error','stack','name','index','map','rawAttributes','fieldName','type','query','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','VIRTUAL','IntegrationReport','includeAll','include','rows','params','keys','options','find','catch','body','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','sendStatus'];(function(_0x47e6cf,_0x2d4ba7){var _0x510f08=function(_0x224399){while(--_0x224399){_0x47e6cf['push'](_0x47e6cf['shift']());}};_0x510f08(++_0x2d4ba7);}(_0x0110,0xfd));var _0x0011=function(_0xc91509,_0x377bad){_0xc91509=_0xc91509-0x0;var _0x2dc304=_0x0110[_0xc91509];return _0x2dc304;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0011('0x0'));var zipdir=require(_0x0011('0x1'));var jsonpatch=require(_0x0011('0x2'));var rp=require('request-promise');var moment=require(_0x0011('0x3'));var BPromise=require(_0x0011('0x4'));var Mustache=require(_0x0011('0x5'));var util=require(_0x0011('0x6'));var path=require(_0x0011('0x7'));var sox=require(_0x0011('0x8'));var csv=require(_0x0011('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0011('0xa'));var _=require(_0x0011('0xb'));var squel=require(_0x0011('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0011('0x9'));var querystring=require(_0x0011('0xd'));var Papa=require(_0x0011('0xe'));var Redis=require(_0x0011('0xf'));var authService=require(_0x0011('0x10'));var qs=require(_0x0011('0x11'));var as=require(_0x0011('0x12'));var hardwareService=require(_0x0011('0x13'));var logger=require('../../config/logger')(_0x0011('0x14'));var utils=require(_0x0011('0x15'));var config=require(_0x0011('0x16'));var licenseUtil=require(_0x0011('0x17'));var db=require(_0x0011('0x18'))['db'];function respondWithStatusCode(_0x5b35c2,_0x375063){_0x375063=_0x375063||0xcc;return function(_0x3ad9b5){if(_0x3ad9b5){return _0x5b35c2['sendStatus'](_0x375063);}return _0x5b35c2[_0x0011('0x19')](_0x375063)[_0x0011('0x1a')]();};}function respondWithResult(_0x55e9a6,_0x4c8e7a){_0x4c8e7a=_0x4c8e7a||0xc8;return function(_0x40e183){if(_0x40e183){return _0x55e9a6['status'](_0x4c8e7a)[_0x0011('0x1b')](_0x40e183);}};}function respondWithFilteredResult(_0x229ae1,_0x57bbae){return function(_0x12c3ec){if(_0x12c3ec){var _0x22c8f8=typeof _0x57bbae[_0x0011('0x1c')]===_0x0011('0x1d')&&typeof _0x57bbae[_0x0011('0x1e')]===_0x0011('0x1d');var _0x3add50=_0x12c3ec['count'];var _0x29f98c=_0x22c8f8?0x0:_0x57bbae['offset'];var _0xe83386=_0x22c8f8?_0x12c3ec[_0x0011('0x1f')]:_0x57bbae['offset']+_0x57bbae['limit'];var _0x4aa573;if(_0xe83386>=_0x3add50){_0xe83386=_0x3add50;_0x4aa573=0xc8;}else{_0x4aa573=0xce;}_0x229ae1[_0x0011('0x19')](_0x4aa573);return _0x229ae1[_0x0011('0x20')]('Content-Range',_0x29f98c+'-'+_0xe83386+'/'+_0x3add50)[_0x0011('0x1b')](_0x12c3ec);}return null;};}function patchUpdates(_0x1660fe){return function(_0x2fa978){try{jsonpatch[_0x0011('0x21')](_0x2fa978,_0x1660fe,!![]);}catch(_0x251419){return BPromise['reject'](_0x251419);}return _0x2fa978[_0x0011('0x22')]();};}function saveUpdates(_0x1f0f83,_0x2cb145){return function(_0x5a3933){if(_0x5a3933){return _0x5a3933[_0x0011('0x23')](_0x1f0f83)[_0x0011('0x24')](function(_0x2d8578){return _0x2d8578;});}return null;};}function removeEntity(_0x263f8a,_0x14b997){return function(_0x5cf9a2){if(_0x5cf9a2){return _0x5cf9a2[_0x0011('0x25')]()['then'](function(){_0x263f8a[_0x0011('0x19')](0xcc)[_0x0011('0x1a')]();});}};}function handleEntityNotFound(_0x58ec4b,_0x2effb3){return function(_0xe530bf){if(!_0xe530bf){_0x58ec4b[_0x0011('0x26')](0x194);}return _0xe530bf;};}function handleError(_0x2d3c64,_0x108958){_0x108958=_0x108958||0x1f4;return function(_0x7bad2c){logger[_0x0011('0x27')](_0x7bad2c[_0x0011('0x28')]);if(_0x7bad2c[_0x0011('0x29')]){delete _0x7bad2c[_0x0011('0x29')];}_0x2d3c64[_0x0011('0x19')](_0x108958)['send'](_0x7bad2c);};}exports[_0x0011('0x2a')]=function(_0x1d5bc0,_0x5d7c1f){var _0x52df7b={},_0x2ac27b={},_0x4704a9={'count':0x0,'rows':[]};var _0x5ef44e=_[_0x0011('0x2b')](db['IntegrationReport'][_0x0011('0x2c')],function(_0xaf63c4){return{'name':_0xaf63c4[_0x0011('0x2d')],'type':_0xaf63c4[_0x0011('0x2e')]['key']};});_0x2ac27b['model']=_[_0x0011('0x2b')](_0x5ef44e,_0x0011('0x29'));_0x2ac27b[_0x0011('0x2f')]=_['keys'](_0x1d5bc0[_0x0011('0x2f')]);_0x2ac27b['filters']=_[_0x0011('0x30')](_0x2ac27b[_0x0011('0x31')],_0x2ac27b[_0x0011('0x2f')]);_0x52df7b['attributes']=_[_0x0011('0x30')](_0x2ac27b[_0x0011('0x31')],qs['fields'](_0x1d5bc0['query'][_0x0011('0x32')]));_0x52df7b[_0x0011('0x33')]=_0x52df7b[_0x0011('0x33')][_0x0011('0x34')]?_0x52df7b[_0x0011('0x33')]:_0x2ac27b[_0x0011('0x31')];if(!_0x1d5bc0[_0x0011('0x2f')][_0x0011('0x35')]('nolimit')){_0x52df7b[_0x0011('0x1e')]=qs['limit'](_0x1d5bc0[_0x0011('0x2f')][_0x0011('0x1e')]);_0x52df7b[_0x0011('0x1c')]=qs[_0x0011('0x1c')](_0x1d5bc0['query'][_0x0011('0x1c')]);}_0x52df7b[_0x0011('0x36')]=qs[_0x0011('0x37')](_0x1d5bc0[_0x0011('0x2f')]['sort']);_0x52df7b['where']=qs[_0x0011('0x38')](_[_0x0011('0x39')](_0x1d5bc0[_0x0011('0x2f')],_0x2ac27b[_0x0011('0x38')]),_0x5ef44e);if(_0x1d5bc0[_0x0011('0x2f')][_0x0011('0x3a')]){_0x52df7b[_0x0011('0x3b')]=_[_0x0011('0x3c')](_0x52df7b[_0x0011('0x3b')],{'$or':_[_0x0011('0x2b')](_0x5ef44e,function(_0xd405ca){if(_0xd405ca['type']!==_0x0011('0x3d')){var _0x383b38={};_0x383b38[_0xd405ca[_0x0011('0x29')]]={'$like':'%'+_0x1d5bc0['query']['filter']+'%'};return _0x383b38;}})});}_0x52df7b=_[_0x0011('0x3c')]({},_0x52df7b,_0x1d5bc0['options']);var _0x5bfc1e={'where':_0x52df7b['where']};return db[_0x0011('0x3e')][_0x0011('0x1f')](_0x5bfc1e)[_0x0011('0x24')](function(_0x1d4450){_0x4704a9['count']=_0x1d4450;if(_0x1d5bc0[_0x0011('0x2f')][_0x0011('0x3f')]){_0x52df7b[_0x0011('0x40')]=[{'all':!![]}];}return db['IntegrationReport']['findAll'](_0x52df7b);})[_0x0011('0x24')](function(_0x248176){_0x4704a9[_0x0011('0x41')]=_0x248176;return _0x4704a9;})[_0x0011('0x24')](respondWithFilteredResult(_0x5d7c1f,_0x52df7b))['catch'](handleError(_0x5d7c1f,null));};exports['show']=function(_0x2db3da,_0x46d55e){var _0x1123f8={'raw':![],'where':{'id':_0x2db3da[_0x0011('0x42')]['id']}},_0x3a9745={};_0x3a9745[_0x0011('0x31')]=_[_0x0011('0x43')](db['IntegrationReport'][_0x0011('0x2c')]);_0x3a9745[_0x0011('0x2f')]=_[_0x0011('0x43')](_0x2db3da[_0x0011('0x2f')]);_0x3a9745[_0x0011('0x38')]=_[_0x0011('0x30')](_0x3a9745[_0x0011('0x31')],_0x3a9745[_0x0011('0x2f')]);_0x1123f8['attributes']=_[_0x0011('0x30')](_0x3a9745[_0x0011('0x31')],qs['fields'](_0x2db3da['query']['fields']));_0x1123f8[_0x0011('0x33')]=_0x1123f8[_0x0011('0x33')]['length']?_0x1123f8[_0x0011('0x33')]:_0x3a9745['model'];if(_0x2db3da['query'][_0x0011('0x3f')]){_0x1123f8[_0x0011('0x40')]=[{'all':!![]}];}_0x1123f8=_[_0x0011('0x3c')]({},_0x1123f8,_0x2db3da[_0x0011('0x44')]);return db[_0x0011('0x3e')][_0x0011('0x45')](_0x1123f8)[_0x0011('0x24')](handleEntityNotFound(_0x46d55e,null))[_0x0011('0x24')](respondWithResult(_0x46d55e,null))[_0x0011('0x46')](handleError(_0x46d55e,null));};exports['create']=function(_0x30597f,_0x3e427b){return db[_0x0011('0x3e')]['create'](_0x30597f[_0x0011('0x47')],{})[_0x0011('0x24')](respondWithResult(_0x3e427b,0xc9))[_0x0011('0x46')](handleError(_0x3e427b,null));};exports[_0x0011('0x23')]=function(_0x16e80d,_0x4fb584){if(_0x16e80d[_0x0011('0x47')]['id']){delete _0x16e80d[_0x0011('0x47')]['id'];}return db[_0x0011('0x3e')][_0x0011('0x45')]({'where':{'id':_0x16e80d['params']['id']}})[_0x0011('0x24')](handleEntityNotFound(_0x4fb584,null))[_0x0011('0x24')](saveUpdates(_0x16e80d[_0x0011('0x47')],null))[_0x0011('0x24')](respondWithResult(_0x4fb584,null))['catch'](handleError(_0x4fb584,null));};exports['destroy']=function(_0x245eba,_0x1b59a5){return db[_0x0011('0x3e')]['find']({'where':{'id':_0x245eba['params']['id']}})[_0x0011('0x24')](handleEntityNotFound(_0x1b59a5,null))[_0x0011('0x24')](removeEntity(_0x1b59a5,null))['catch'](handleError(_0x1b59a5,null));};exports[_0x0011('0x48')]=function(_0x42b1aa,_0x40398c){return db[_0x0011('0x3e')][_0x0011('0x48')]()[_0x0011('0x24')](respondWithResult(_0x40398c,null))[_0x0011('0x46')](handleError(_0x40398c,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 2ee9a03..d2a503b 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 _0x0524=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./integrationReport.attributes','exports','define','IntegrationReport','report_integration'];(function(_0x4b0290,_0x188c34){var _0x4bd9f4=function(_0x357f3f){while(--_0x357f3f){_0x4b0290['push'](_0x4b0290['shift']());}};_0x4bd9f4(++_0x188c34);}(_0x0524,0x1b2));var _0x4052=function(_0x569fef,_0x49c37a){_0x569fef=_0x569fef-0x0;var _0x11f20b=_0x0524[_0x569fef];return _0x11f20b;};'use strict';var _=require(_0x4052('0x0'));var util=require(_0x4052('0x1'));var logger=require(_0x4052('0x2'))(_0x4052('0x3'));var moment=require(_0x4052('0x4'));var BPromise=require(_0x4052('0x5'));var rp=require(_0x4052('0x6'));var fs=require('fs');var path=require(_0x4052('0x7'));var rimraf=require(_0x4052('0x8'));var config=require('../../config/environment');var attributes=require(_0x4052('0x9'));module[_0x4052('0xa')]=function(_0x4600c1,_0x44a56c){return _0x4600c1[_0x4052('0xb')](_0x4052('0xc'),attributes,{'tableName':_0x4052('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe789=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport'];(function(_0x11946c,_0x12152c){var _0x383935=function(_0x61fce2){while(--_0x61fce2){_0x11946c['push'](_0x11946c['shift']());}};_0x383935(++_0x12152c);}(_0xe789,0xfc));var _0x9e78=function(_0x265092,_0x304868){_0x265092=_0x265092-0x0;var _0x19f769=_0xe789[_0x265092];return _0x19f769;};'use strict';var _=require('lodash');var util=require(_0x9e78('0x0'));var logger=require(_0x9e78('0x1'))(_0x9e78('0x2'));var moment=require('moment');var BPromise=require(_0x9e78('0x3'));var rp=require(_0x9e78('0x4'));var fs=require('fs');var path=require(_0x9e78('0x5'));var rimraf=require(_0x9e78('0x6'));var config=require(_0x9e78('0x7'));var attributes=require(_0x9e78('0x8'));module[_0x9e78('0x9')]=function(_0x57d84b,_0x2a81d1){return _0x57d84b[_0x9e78('0xa')](_0x9e78('0xb'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.rpc.js b/server/api/integrationReport/integrationReport.rpc.js index 4adadfd..d4accea 100644 --- a/server/api/integrationReport/integrationReport.rpc.js +++ b/server/api/integrationReport/integrationReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3f8a=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x6fa759,_0xf81f7d){_0x6fa759=_0x6fa759-0x0;var _0x19fd29=_0x3f8a[_0x6fa759];return _0x19fd29;};'use strict';var _=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var moment=require(_0xa3f8('0x2'));var BPromise=require(_0xa3f8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa3f8('0x4'));var db=require(_0xa3f8('0x5'))['db'];var utils=require(_0xa3f8('0x6'));var logger=require(_0xa3f8('0x7'))(_0xa3f8('0x8'));var config=require(_0xa3f8('0x9'));var jayson=require(_0xa3f8('0xa'));var client=jayson[_0xa3f8('0xb')][_0xa3f8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xf895d9,_0xcfea5,_0x268332){return new BPromise(function(_0x2faf2e,_0x2448de){return client[_0xa3f8('0xd')](_0xf895d9,_0x268332)[_0xa3f8('0xe')](function(_0xcdb0d4){logger['info'](_0xa3f8('0xf'),_0xcfea5,_0xa3f8('0x10'));logger[_0xa3f8('0x11')](_0xa3f8('0x12'),_0xcfea5,'request\x20sent',JSON[_0xa3f8('0x13')](_0xcdb0d4));if(_0xcdb0d4[_0xa3f8('0x14')]){if(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x15')]===0x1f4){logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);return _0x2448de(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);}logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0xcdb0d4['error'][_0xa3f8('0x16')]);return _0x2faf2e(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);}else{logger[_0xa3f8('0x17')]('IntegrationReport,\x20%s,\x20%s',_0xcfea5,_0xa3f8('0x10'));_0x2faf2e(_0xcdb0d4[_0xa3f8('0x18')][_0xa3f8('0x16')]);}})[_0xa3f8('0x19')](function(_0x45ef64){logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0x45ef64);_0x2448de(_0x45ef64);});});} \ No newline at end of file +var _0xc2c7=['../../config/logger','jayson/promise','client','http','request','then','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0xc2c7,0x134));var _0x7c2c=function(_0x132327,_0x5733a6){_0x132327=_0x132327-0x0;var _0x1a1a89=_0xc2c7[_0x132327];return _0x1a1a89;};'use strict';var _=require('lodash');var util=require(_0x7c2c('0x0'));var moment=require(_0x7c2c('0x1'));var BPromise=require(_0x7c2c('0x2'));var rs=require(_0x7c2c('0x3'));var fs=require('fs');var Redis=require(_0x7c2c('0x4'));var db=require(_0x7c2c('0x5'))['db'];var utils=require(_0x7c2c('0x6'));var logger=require(_0x7c2c('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7c2c('0x8'));var client=jayson[_0x7c2c('0x9')][_0x7c2c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54f027,_0x4abe93,_0x5a1027){return new BPromise(function(_0x2274cd,_0x29638d){return client[_0x7c2c('0xb')](_0x54f027,_0x5a1027)[_0x7c2c('0xc')](function(_0x279cff){logger['info'](_0x7c2c('0xd'),_0x4abe93,_0x7c2c('0xe'));logger[_0x7c2c('0xf')](_0x7c2c('0x10'),_0x4abe93,_0x7c2c('0xe'),JSON[_0x7c2c('0x11')](_0x279cff));if(_0x279cff[_0x7c2c('0x12')]){if(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x13')]===0x1f4){logger[_0x7c2c('0x12')](_0x7c2c('0xd'),_0x4abe93,_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);return _0x29638d(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);}logger[_0x7c2c('0x12')]('IntegrationReport,\x20%s,\x20%s',_0x4abe93,_0x279cff['error'][_0x7c2c('0x14')]);return _0x2274cd(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);}else{logger['info'](_0x7c2c('0xd'),_0x4abe93,_0x7c2c('0xe'));_0x2274cd(_0x279cff['result'][_0x7c2c('0x14')]);}})['catch'](function(_0x1aa355){logger['error'](_0x7c2c('0xd'),_0x4abe93,_0x1aa355);_0x29638d(_0x1aa355);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index ae56476..5db7749 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 _0x3c34=['delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','/:id','show','/:id/sub_intervals','post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','update'];(function(_0xaa7194,_0x3388c2){var _0x3d1955=function(_0x19fd62){while(--_0x19fd62){_0xaa7194['push'](_0xaa7194['shift']());}};_0x3d1955(++_0x3388c2);}(_0x3c34,0x14c));var _0x43c3=function(_0x56fe98,_0x43dc16){_0x56fe98=_0x56fe98-0x0;var _0x212f4f=_0x3c34[_0x56fe98];return _0x212f4f;};'use strict';var multer=require(_0x43c3('0x0'));var util=require(_0x43c3('0x1'));var path=require(_0x43c3('0x2'));var timeout=require(_0x43c3('0x3'));var express=require(_0x43c3('0x4'));var router=express[_0x43c3('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x43c3('0x6'));var config=require(_0x43c3('0x7'));var controller=require(_0x43c3('0x8'));router[_0x43c3('0x9')]('/',auth[_0x43c3('0xa')](),controller['index']);router['get'](_0x43c3('0xb'),auth[_0x43c3('0xa')](),controller[_0x43c3('0xc')]);router[_0x43c3('0x9')](_0x43c3('0xd'),auth[_0x43c3('0xa')](),controller['getIntervals']);router[_0x43c3('0xe')]('/',auth[_0x43c3('0xa')](),controller[_0x43c3('0xf')]);router['post'](_0x43c3('0xd'),auth[_0x43c3('0xa')](),controller[_0x43c3('0x10')]);router[_0x43c3('0xe')](_0x43c3('0x11'),auth['isAuthenticated'](),controller[_0x43c3('0x12')]);router['put'](_0x43c3('0xb'),auth[_0x43c3('0xa')](),controller[_0x43c3('0x13')]);router[_0x43c3('0x14')](_0x43c3('0xb'),auth['isAuthenticated'](),controller[_0x43c3('0x15')]);module['exports']=router; \ No newline at end of file +var _0xcc0b=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./interval.controller','isAuthenticated','index','get','/:id','show','/:id/sub_intervals','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','update','delete','destroy'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0xcc0b,0xc0));var _0xbcc0=function(_0x1475a6,_0x56628c){_0x1475a6=_0x1475a6-0x0;var _0x3c0d07=_0xcc0b[_0x1475a6];return _0x3c0d07;};'use strict';var multer=require(_0xbcc0('0x0'));var util=require(_0xbcc0('0x1'));var path=require('path');var timeout=require(_0xbcc0('0x2'));var express=require(_0xbcc0('0x3'));var router=express[_0xbcc0('0x4')]();var fs_extra=require(_0xbcc0('0x5'));var auth=require(_0xbcc0('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xbcc0('0x7'));var controller=require(_0xbcc0('0x8'));router['get']('/',auth[_0xbcc0('0x9')](),controller[_0xbcc0('0xa')]);router[_0xbcc0('0xb')](_0xbcc0('0xc'),auth[_0xbcc0('0x9')](),controller[_0xbcc0('0xd')]);router['get'](_0xbcc0('0xe'),auth[_0xbcc0('0x9')](),controller[_0xbcc0('0xf')]);router[_0xbcc0('0x10')]('/',auth[_0xbcc0('0x9')](),controller[_0xbcc0('0x11')]);router[_0xbcc0('0x10')](_0xbcc0('0xe'),auth[_0xbcc0('0x9')](),controller[_0xbcc0('0x12')]);router[_0xbcc0('0x10')](_0xbcc0('0x13'),auth['isAuthenticated'](),controller[_0xbcc0('0x14')]);router['put']('/:id',auth[_0xbcc0('0x9')](),controller[_0xbcc0('0x15')]);router[_0xbcc0('0x16')](_0xbcc0('0xc'),auth[_0xbcc0('0x9')](),controller[_0xbcc0('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 99d734d..2879cad 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 _0x0432=['exports','STRING','sequelize'];(function(_0x4d0e8b,_0x25837e){var _0x1163d3=function(_0x417a53){while(--_0x417a53){_0x4d0e8b['push'](_0x4d0e8b['shift']());}};_0x1163d3(++_0x25837e);}(_0x0432,0xa4));var _0x2043=function(_0x28e72b,_0x50928c){_0x28e72b=_0x28e72b-0x0;var _0x40b78=_0x0432[_0x28e72b];return _0x40b78;};'use strict';var Sequelize=require(_0x2043('0x0'));module[_0x2043('0x1')]={'name':{'type':Sequelize[_0x2043('0x2')]},'description':{'type':Sequelize[_0x2043('0x2')]},'interval':{'type':Sequelize[_0x2043('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xad45=['exports','STRING','sequelize'];(function(_0x1a6108,_0x5805ff){var _0x2a19b7=function(_0x50705d){while(--_0x50705d){_0x1a6108['push'](_0x1a6108['shift']());}};_0x2a19b7(++_0x5805ff);}(_0xad45,0xd4));var _0x5ad4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xad45[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x5ad4('0x0'));module[_0x5ad4('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5ad4('0x2')]},'interval':{'type':Sequelize[_0x5ad4('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 774bc6c..4ed2b2c 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 _0x8488=['filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId','getIntervals','pick','findOne','sequelize','transaction','bulkCreate','eml-format','zip-dir','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','Intervals','sendStatus','error','stack','name','index','Interval','rawAttributes','type','key','model','map','query','keys'];(function(_0x334fea,_0x1f1e18){var _0x3c5829=function(_0x4fd6ac){while(--_0x4fd6ac){_0x334fea['push'](_0x334fea['shift']());}};_0x3c5829(++_0x1f1e18);}(_0x8488,0xd2));var _0x8848=function(_0x3ecdbf,_0x3140e7){_0x3ecdbf=_0x3ecdbf-0x0;var _0x15c92f=_0x8488[_0x3ecdbf];return _0x15c92f;};'use strict';var emlformat=require(_0x8848('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8848('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8848('0x2'));var Mustache=require(_0x8848('0x3'));var util=require(_0x8848('0x4'));var path=require('path');var sox=require(_0x8848('0x5'));var csv=require(_0x8848('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8848('0x7'));var _=require(_0x8848('0x8'));var squel=require(_0x8848('0x9'));var crypto=require(_0x8848('0xa'));var jsforce=require(_0x8848('0xb'));var deskjs=require(_0x8848('0xc'));var toCsv=require(_0x8848('0x6'));var querystring=require('querystring');var Papa=require(_0x8848('0xd'));var Redis=require('ioredis');var authService=require(_0x8848('0xe'));var qs=require(_0x8848('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8848('0x10'))(_0x8848('0x11'));var utils=require(_0x8848('0x12'));var config=require(_0x8848('0x13'));var licenseUtil=require(_0x8848('0x14'));var db=require(_0x8848('0x15'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x1e08c3,_0x29c69e){_0x29c69e=_0x29c69e||0xcc;return function(_0x1e41f3){if(_0x1e41f3){return _0x1e08c3['sendStatus'](_0x29c69e);}return _0x1e08c3['status'](_0x29c69e)[_0x8848('0x16')]();};}function respondWithResult(_0x33e20d,_0x374596){_0x374596=_0x374596||0xc8;return function(_0x281ce2){if(_0x281ce2){return _0x33e20d[_0x8848('0x17')](_0x374596)[_0x8848('0x18')](_0x281ce2);}};}function respondWithFilteredResult(_0x5ae41f,_0x4703f9){return function(_0x4fd4a4){if(_0x4fd4a4){var _0x267109=typeof _0x4703f9[_0x8848('0x19')]===_0x8848('0x1a')&&typeof _0x4703f9[_0x8848('0x1b')]===_0x8848('0x1a');var _0x596675=_0x4fd4a4[_0x8848('0x1c')];var _0x9349c6=_0x267109?0x0:_0x4703f9[_0x8848('0x19')];var _0x2fe2f0=_0x267109?_0x4fd4a4['count']:_0x4703f9[_0x8848('0x19')]+_0x4703f9[_0x8848('0x1b')];var _0xb74567;if(_0x2fe2f0>=_0x596675){_0x2fe2f0=_0x596675;_0xb74567=0xc8;}else{_0xb74567=0xce;}_0x5ae41f['status'](_0xb74567);return _0x5ae41f[_0x8848('0x1d')](_0x8848('0x1e'),_0x9349c6+'-'+_0x2fe2f0+'/'+_0x596675)[_0x8848('0x18')](_0x4fd4a4);}return null;};}function patchUpdates(_0x4a63da){return function(_0x5583dd){try{jsonpatch[_0x8848('0x1f')](_0x5583dd,_0x4a63da,!![]);}catch(_0x16fc86){return BPromise[_0x8848('0x20')](_0x16fc86);}return _0x5583dd['save']();};}function saveUpdates(_0x589703,_0x4725ca){return function(_0x1bc765){if(_0x1bc765){return _0x1bc765[_0x8848('0x21')](_0x589703)[_0x8848('0x22')](function(_0x5482c0){return _0x5482c0;});}return null;};}function removeEntity(_0x38e70f,_0x4d9871){return function(_0xace55f){if(_0xace55f){return _0xace55f[_0x8848('0x23')]()['then'](function(){var _0x4a1d2d=_0xace55f[_0x8848('0x24')]({'plain':!![]});var _0xd6d6c6=_0x8848('0x25');return db['UserProfileResource'][_0x8848('0x23')]({'where':{'type':_0xd6d6c6,'resourceId':_0x4a1d2d['id']}})[_0x8848('0x22')](function(){return _0xace55f;});})[_0x8848('0x22')](function(){_0x38e70f[_0x8848('0x17')](0xcc)[_0x8848('0x16')]();});}};}function handleEntityNotFound(_0x5eaf03,_0x3eb9ae){return function(_0x4a3c52){if(!_0x4a3c52){_0x5eaf03[_0x8848('0x26')](0x194);}return _0x4a3c52;};}function handleError(_0x1fce87,_0x2cf151){_0x2cf151=_0x2cf151||0x1f4;return function(_0xf918a3){logger[_0x8848('0x27')](_0xf918a3[_0x8848('0x28')]);if(_0xf918a3[_0x8848('0x29')]){delete _0xf918a3[_0x8848('0x29')];}_0x1fce87[_0x8848('0x17')](_0x2cf151)['send'](_0xf918a3);};}exports[_0x8848('0x2a')]=function(_0x269d23,_0x4126ff){var _0x2666f2={},_0x5aa524={},_0x52c0ab={'count':0x0,'rows':[]};var _0x3fae61=_['map'](db[_0x8848('0x2b')][_0x8848('0x2c')],function(_0x4fdb52){return{'name':_0x4fdb52['fieldName'],'type':_0x4fdb52[_0x8848('0x2d')][_0x8848('0x2e')]};});_0x5aa524[_0x8848('0x2f')]=_[_0x8848('0x30')](_0x3fae61,_0x8848('0x29'));_0x5aa524[_0x8848('0x31')]=_[_0x8848('0x32')](_0x269d23[_0x8848('0x31')]);_0x5aa524[_0x8848('0x33')]=_['intersection'](_0x5aa524[_0x8848('0x2f')],_0x5aa524[_0x8848('0x31')]);_0x2666f2[_0x8848('0x34')]=_[_0x8848('0x35')](_0x5aa524['model'],qs[_0x8848('0x36')](_0x269d23[_0x8848('0x31')]['fields']));_0x2666f2['attributes']=_0x2666f2[_0x8848('0x34')][_0x8848('0x37')]?_0x2666f2[_0x8848('0x34')]:_0x5aa524[_0x8848('0x2f')];if(!_0x269d23['query'][_0x8848('0x38')](_0x8848('0x39'))){_0x2666f2[_0x8848('0x1b')]=qs[_0x8848('0x1b')](_0x269d23[_0x8848('0x31')][_0x8848('0x1b')]);_0x2666f2[_0x8848('0x19')]=qs[_0x8848('0x19')](_0x269d23['query']['offset']);}_0x2666f2[_0x8848('0x3a')]=qs['sort'](_0x269d23[_0x8848('0x31')][_0x8848('0x3b')]);_0x2666f2[_0x8848('0x3c')]=qs[_0x8848('0x33')](_['pick'](_0x269d23['query'],_0x5aa524[_0x8848('0x33')]),_0x3fae61);if(_0x269d23[_0x8848('0x31')][_0x8848('0x3d')]){_0x2666f2[_0x8848('0x3c')]=_[_0x8848('0x3e')](_0x2666f2[_0x8848('0x3c')],{'$or':_[_0x8848('0x30')](_0x3fae61,function(_0x36068f){if(_0x36068f[_0x8848('0x2d')]!==_0x8848('0x3f')){var _0x5b727c={};_0x5b727c[_0x36068f['name']]={'$like':'%'+_0x269d23[_0x8848('0x31')][_0x8848('0x3d')]+'%'};return _0x5b727c;}})});}_0x2666f2=_[_0x8848('0x3e')]({},_0x2666f2,_0x269d23[_0x8848('0x40')]);var _0x208a20={'where':_0x2666f2[_0x8848('0x3c')]};return db[_0x8848('0x2b')]['count'](_0x208a20)[_0x8848('0x22')](function(_0x4f698e){_0x52c0ab['count']=_0x4f698e;if(_0x269d23[_0x8848('0x31')][_0x8848('0x41')]){_0x2666f2[_0x8848('0x42')]=[{'all':!![]}];}return db[_0x8848('0x2b')][_0x8848('0x43')](_0x2666f2);})[_0x8848('0x22')](function(_0x1050b5){_0x52c0ab[_0x8848('0x44')]=_0x1050b5;return _0x52c0ab;})[_0x8848('0x22')](respondWithFilteredResult(_0x4126ff,_0x2666f2))[_0x8848('0x45')](handleError(_0x4126ff,null));};exports[_0x8848('0x46')]=function(_0x4c8ff7,_0x21ce91){var _0x3b2d40={'raw':!![],'where':{'id':_0x4c8ff7[_0x8848('0x47')]['id']}},_0x1a5643={};_0x1a5643[_0x8848('0x2f')]=_[_0x8848('0x32')](db[_0x8848('0x2b')][_0x8848('0x2c')]);_0x1a5643[_0x8848('0x31')]=_[_0x8848('0x32')](_0x4c8ff7['query']);_0x1a5643[_0x8848('0x33')]=_[_0x8848('0x35')](_0x1a5643[_0x8848('0x2f')],_0x1a5643[_0x8848('0x31')]);_0x3b2d40['attributes']=_[_0x8848('0x35')](_0x1a5643['model'],qs[_0x8848('0x36')](_0x4c8ff7[_0x8848('0x31')][_0x8848('0x36')]));_0x3b2d40['attributes']=_0x3b2d40[_0x8848('0x34')]['length']?_0x3b2d40['attributes']:_0x1a5643[_0x8848('0x2f')];if(_0x4c8ff7[_0x8848('0x31')][_0x8848('0x41')]){_0x3b2d40['include']=[{'all':!![]}];}_0x3b2d40=_[_0x8848('0x3e')]({},_0x3b2d40,_0x4c8ff7[_0x8848('0x40')]);return db[_0x8848('0x2b')][_0x8848('0x48')](_0x3b2d40)[_0x8848('0x22')](handleEntityNotFound(_0x21ce91,null))[_0x8848('0x22')](respondWithResult(_0x21ce91,null))[_0x8848('0x45')](handleError(_0x21ce91,null));};exports[_0x8848('0x49')]=function(_0x4b2165,_0x16f36d){return db[_0x8848('0x2b')][_0x8848('0x49')](_0x4b2165[_0x8848('0x4a')],{})[_0x8848('0x22')](function(_0x5f00af){var _0x147507=_0x4b2165[_0x8848('0x4b')][_0x8848('0x24')]({'plain':!![]});if(!_0x147507)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x147507['role']===_0x8848('0x4b')){var _0x89d562=_0x5f00af[_0x8848('0x24')]({'plain':!![]});var _0x2ab34b=_0x8848('0x25');return db['UserProfileSection'][_0x8848('0x48')]({'where':{'name':_0x2ab34b,'userProfileId':_0x147507['userProfileId']},'raw':!![]})[_0x8848('0x22')](function(_0x3a4cef){if(_0x3a4cef&&_0x3a4cef[_0x8848('0x4c')]===0x0){return db[_0x8848('0x4d')][_0x8848('0x49')]({'name':_0x89d562['name'],'resourceId':_0x89d562['id'],'type':_0x3a4cef[_0x8848('0x29')],'sectionId':_0x3a4cef['id']},{})['then'](function(){return _0x5f00af;});}else{return _0x5f00af;}})[_0x8848('0x45')](function(_0x275b05){logger['error'](_0x8848('0x4e'),_0x275b05);throw _0x275b05;});}return _0x5f00af;})['then'](respondWithResult(_0x16f36d,0xc9))[_0x8848('0x45')](handleError(_0x16f36d,null));};exports['update']=function(_0x35bb3c,_0x1ec761){if(_0x35bb3c[_0x8848('0x4a')]['id']){delete _0x35bb3c[_0x8848('0x4a')]['id'];}return db[_0x8848('0x2b')][_0x8848('0x48')]({'where':{'id':_0x35bb3c[_0x8848('0x47')]['id']}})[_0x8848('0x22')](handleEntityNotFound(_0x1ec761,null))[_0x8848('0x22')](saveUpdates(_0x35bb3c[_0x8848('0x4a')],null))[_0x8848('0x22')](respondWithResult(_0x1ec761,null))[_0x8848('0x45')](handleError(_0x1ec761,null));};exports[_0x8848('0x23')]=function(_0x428118,_0x3826b4){return db['Interval'][_0x8848('0x48')]({'where':{'id':_0x428118[_0x8848('0x47')]['id']}})[_0x8848('0x22')](handleEntityNotFound(_0x3826b4,null))[_0x8848('0x22')](removeEntity(_0x3826b4,null))[_0x8848('0x45')](handleError(_0x3826b4,null));};exports[_0x8848('0x4f')]=function(_0x245605,_0x106dc2,_0x56c80e){if(_0x245605[_0x8848('0x4a')]['id']){delete _0x245605[_0x8848('0x4a')]['id'];}return db[_0x8848('0x2b')][_0x8848('0x48')]({'where':{'id':_0x245605['params']['id']}})[_0x8848('0x22')](handleEntityNotFound(_0x106dc2,null))[_0x8848('0x22')](function(_0x1476c3){if(_0x1476c3){_0x245605[_0x8848('0x4a')][_0x8848('0x50')]=_0x1476c3['id'];return db[_0x8848('0x2b')][_0x8848('0x49')](_0x245605[_0x8848('0x4a')]);}})[_0x8848('0x22')](respondWithResult(_0x106dc2,null))[_0x8848('0x45')](handleError(_0x106dc2,null));};exports[_0x8848('0x51')]=function(_0x23fa65,_0x8f7798,_0x2fd9da){var _0x469eea={};var _0x317a31={};var _0x52fb03;var _0x573ac6;return db[_0x8848('0x2b')]['findOne']({'where':{'id':_0x23fa65[_0x8848('0x47')]['id']}})[_0x8848('0x22')](handleEntityNotFound(_0x8f7798,null))[_0x8848('0x22')](function(_0x1e3d0f){if(_0x1e3d0f){_0x52fb03=_0x1e3d0f;_0x317a31[_0x8848('0x2f')]=_[_0x8848('0x32')](db['Interval']['rawAttributes']);_0x317a31[_0x8848('0x31')]=_[_0x8848('0x32')](_0x23fa65[_0x8848('0x31')]);_0x317a31[_0x8848('0x33')]=_[_0x8848('0x35')](_0x317a31[_0x8848('0x2f')],_0x317a31['query']);_0x469eea[_0x8848('0x34')]=_[_0x8848('0x35')](_0x317a31[_0x8848('0x2f')],qs[_0x8848('0x36')](_0x23fa65['query'][_0x8848('0x36')]));_0x469eea[_0x8848('0x34')]=_0x469eea[_0x8848('0x34')][_0x8848('0x37')]?_0x469eea[_0x8848('0x34')]:_0x317a31['model'];_0x469eea['order']=qs[_0x8848('0x3b')](_0x23fa65[_0x8848('0x31')]['sort']);_0x469eea[_0x8848('0x3c')]=qs[_0x8848('0x33')](_[_0x8848('0x52')](_0x23fa65[_0x8848('0x31')],_0x317a31[_0x8848('0x33')]));if(_0x23fa65[_0x8848('0x31')][_0x8848('0x3d')]){_0x469eea['where']=_['merge'](_0x469eea[_0x8848('0x3c')],{'$or':_[_0x8848('0x30')](_0x469eea[_0x8848('0x34')],function(_0x5d332c){var _0x57f96b={};_0x57f96b[_0x5d332c]={'$like':'%'+_0x23fa65[_0x8848('0x31')]['filter']+'%'};return _0x57f96b;})});}_0x469eea=_[_0x8848('0x3e')]({},_0x469eea,_0x23fa65[_0x8848('0x40')]);return _0x52fb03[_0x8848('0x51')](_0x469eea);}})[_0x8848('0x22')](function(_0x2643ef){if(_0x2643ef){_0x573ac6=_0x2643ef[_0x8848('0x37')];if(!_0x23fa65['query']['hasOwnProperty'](_0x8848('0x39'))){_0x469eea[_0x8848('0x1b')]=qs[_0x8848('0x1b')](_0x23fa65['query'][_0x8848('0x1b')]);_0x469eea['offset']=qs[_0x8848('0x19')](_0x23fa65[_0x8848('0x31')][_0x8848('0x19')]);}return _0x52fb03[_0x8848('0x51')](_0x469eea);}})[_0x8848('0x22')](function(_0x5784f4){if(_0x5784f4){return _0x5784f4?{'count':_0x573ac6,'rows':_0x5784f4}:null;}})[_0x8848('0x22')](respondWithResult(_0x8f7798,null))[_0x8848('0x45')](handleError(_0x8f7798,null));};exports['addIntervals']=function(_0x741207,_0x5b6438,_0x497aae){return db['Interval'][_0x8848('0x53')]({'where':{'id':_0x741207[_0x8848('0x47')]['id']}})['then'](handleEntityNotFound(_0x5b6438,null))[_0x8848('0x22')](function(_0x11eb61){if(_0x11eb61){return db[_0x8848('0x54')][_0x8848('0x55')](function(_0x3bd0ff){return db[_0x8848('0x2b')][_0x8848('0x23')]({'where':{'IntervalId':_0x741207[_0x8848('0x47')]['id']},'transaction':_0x3bd0ff})[_0x8848('0x22')](function(_0x5bf372){var _0x5d7cd6=_[_0x8848('0x30')](_0x741207[_0x8848('0x4a')],function(_0x201073){delete _0x201073['id'];_0x201073[_0x8848('0x50')]=_0x741207[_0x8848('0x47')]['id'];return _0x201073;});return db[_0x8848('0x2b')][_0x8848('0x56')](_0x5d7cd6,{'transaction':_0x3bd0ff});});})[_0x8848('0x22')](function(){return db['Interval']['findAll']({'where':{'IntervalId':_0x741207[_0x8848('0x47')]['id']}});});}})[_0x8848('0x22')](respondWithResult(_0x5b6438,null))[_0x8848('0x45')](handleError(_0x5b6438,null));}; \ No newline at end of file +var _0x6e03=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','Interval','rawAttributes','type','key','model','query','intersection','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','options','include','findAll','rows','params','keys','attributes','includeAll','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId','getIntervals','hasOwnProperty','addIntervals','findOne','sequelize','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x6eb7cc,_0x197324){var _0x10b5c8=function(_0xfe2f78){while(--_0xfe2f78){_0x6eb7cc['push'](_0x6eb7cc['shift']());}};_0x10b5c8(++_0x197324);}(_0x6e03,0x1ba));var _0x36e0=function(_0x288b93,_0x30cdf5){_0x288b93=_0x288b93-0x0;var _0x4fdee9=_0x6e03[_0x288b93];return _0x4fdee9;};'use strict';var emlformat=require(_0x36e0('0x0'));var rimraf=require(_0x36e0('0x1'));var zipdir=require(_0x36e0('0x2'));var jsonpatch=require(_0x36e0('0x3'));var rp=require(_0x36e0('0x4'));var moment=require(_0x36e0('0x5'));var BPromise=require(_0x36e0('0x6'));var Mustache=require(_0x36e0('0x7'));var util=require('util');var path=require(_0x36e0('0x8'));var sox=require(_0x36e0('0x9'));var csv=require(_0x36e0('0xa'));var ejs=require(_0x36e0('0xb'));var fs=require('fs');var fs_extra=require(_0x36e0('0xc'));var _=require(_0x36e0('0xd'));var squel=require(_0x36e0('0xe'));var crypto=require('crypto');var jsforce=require(_0x36e0('0xf'));var deskjs=require(_0x36e0('0x10'));var toCsv=require(_0x36e0('0xa'));var querystring=require(_0x36e0('0x11'));var Papa=require(_0x36e0('0x12'));var Redis=require(_0x36e0('0x13'));var authService=require(_0x36e0('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x36e0('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x36e0('0x16'))('api');var utils=require(_0x36e0('0x17'));var config=require(_0x36e0('0x18'));var licenseUtil=require(_0x36e0('0x19'));var db=require(_0x36e0('0x1a'))['db'];var extensions=require(_0x36e0('0x1b'));function respondWithStatusCode(_0x1bc77f,_0xa957aa){_0xa957aa=_0xa957aa||0xcc;return function(_0x1d2abc){if(_0x1d2abc){return _0x1bc77f[_0x36e0('0x1c')](_0xa957aa);}return _0x1bc77f[_0x36e0('0x1d')](_0xa957aa)[_0x36e0('0x1e')]();};}function respondWithResult(_0x1f59d3,_0x2e034d){_0x2e034d=_0x2e034d||0xc8;return function(_0x55deed){if(_0x55deed){return _0x1f59d3[_0x36e0('0x1d')](_0x2e034d)[_0x36e0('0x1f')](_0x55deed);}};}function respondWithFilteredResult(_0x47be65,_0x26c72b){return function(_0x19bdc2){if(_0x19bdc2){var _0x5f0f97=typeof _0x26c72b[_0x36e0('0x20')]===_0x36e0('0x21')&&typeof _0x26c72b[_0x36e0('0x22')]===_0x36e0('0x21');var _0x1497e9=_0x19bdc2[_0x36e0('0x23')];var _0xe1e8a4=_0x5f0f97?0x0:_0x26c72b[_0x36e0('0x20')];var _0x2ba882=_0x5f0f97?_0x19bdc2[_0x36e0('0x23')]:_0x26c72b[_0x36e0('0x20')]+_0x26c72b[_0x36e0('0x22')];var _0x7fc28a;if(_0x2ba882>=_0x1497e9){_0x2ba882=_0x1497e9;_0x7fc28a=0xc8;}else{_0x7fc28a=0xce;}_0x47be65[_0x36e0('0x1d')](_0x7fc28a);return _0x47be65[_0x36e0('0x24')](_0x36e0('0x25'),_0xe1e8a4+'-'+_0x2ba882+'/'+_0x1497e9)[_0x36e0('0x1f')](_0x19bdc2);}return null;};}function patchUpdates(_0x1dc3fd){return function(_0x3b5d96){try{jsonpatch['apply'](_0x3b5d96,_0x1dc3fd,!![]);}catch(_0x478a8f){return BPromise[_0x36e0('0x26')](_0x478a8f);}return _0x3b5d96[_0x36e0('0x27')]();};}function saveUpdates(_0x4a2984,_0x493dbd){return function(_0x585e3b){if(_0x585e3b){return _0x585e3b[_0x36e0('0x28')](_0x4a2984)[_0x36e0('0x29')](function(_0xa4c914){return _0xa4c914;});}return null;};}function removeEntity(_0x300400,_0x378d97){return function(_0x336b40){if(_0x336b40){return _0x336b40[_0x36e0('0x2a')]()[_0x36e0('0x29')](function(){var _0xfbc68f=_0x336b40[_0x36e0('0x2b')]({'plain':!![]});var _0x2a6599='Intervals';return db[_0x36e0('0x2c')]['destroy']({'where':{'type':_0x2a6599,'resourceId':_0xfbc68f['id']}})[_0x36e0('0x29')](function(){return _0x336b40;});})[_0x36e0('0x29')](function(){_0x300400[_0x36e0('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30c66e,_0x3bdcc6){return function(_0x238de4){if(!_0x238de4){_0x30c66e['sendStatus'](0x194);}return _0x238de4;};}function handleError(_0x423855,_0x5ad12a){_0x5ad12a=_0x5ad12a||0x1f4;return function(_0x34a492){logger[_0x36e0('0x2d')](_0x34a492[_0x36e0('0x2e')]);if(_0x34a492[_0x36e0('0x2f')]){delete _0x34a492[_0x36e0('0x2f')];}_0x423855[_0x36e0('0x1d')](_0x5ad12a)[_0x36e0('0x30')](_0x34a492);};}exports[_0x36e0('0x31')]=function(_0x40702f,_0x46c4fd){var _0x207b63={},_0x2d86f4={},_0x10f2de={'count':0x0,'rows':[]};var _0x30bb66=_[_0x36e0('0x32')](db[_0x36e0('0x33')][_0x36e0('0x34')],function(_0x361c1c){return{'name':_0x361c1c['fieldName'],'type':_0x361c1c[_0x36e0('0x35')][_0x36e0('0x36')]};});_0x2d86f4[_0x36e0('0x37')]=_[_0x36e0('0x32')](_0x30bb66,_0x36e0('0x2f'));_0x2d86f4[_0x36e0('0x38')]=_['keys'](_0x40702f[_0x36e0('0x38')]);_0x2d86f4['filters']=_['intersection'](_0x2d86f4['model'],_0x2d86f4[_0x36e0('0x38')]);_0x207b63['attributes']=_[_0x36e0('0x39')](_0x2d86f4[_0x36e0('0x37')],qs[_0x36e0('0x3a')](_0x40702f['query'][_0x36e0('0x3a')]));_0x207b63['attributes']=_0x207b63['attributes'][_0x36e0('0x3b')]?_0x207b63['attributes']:_0x2d86f4[_0x36e0('0x37')];if(!_0x40702f[_0x36e0('0x38')]['hasOwnProperty'](_0x36e0('0x3c'))){_0x207b63[_0x36e0('0x22')]=qs['limit'](_0x40702f[_0x36e0('0x38')][_0x36e0('0x22')]);_0x207b63['offset']=qs['offset'](_0x40702f[_0x36e0('0x38')]['offset']);}_0x207b63[_0x36e0('0x3d')]=qs['sort'](_0x40702f[_0x36e0('0x38')][_0x36e0('0x3e')]);_0x207b63[_0x36e0('0x3f')]=qs[_0x36e0('0x40')](_[_0x36e0('0x41')](_0x40702f['query'],_0x2d86f4[_0x36e0('0x40')]),_0x30bb66);if(_0x40702f[_0x36e0('0x38')][_0x36e0('0x42')]){_0x207b63['where']=_[_0x36e0('0x43')](_0x207b63['where'],{'$or':_['map'](_0x30bb66,function(_0x40d0e7){if(_0x40d0e7[_0x36e0('0x35')]!=='VIRTUAL'){var _0x1b9ef8={};_0x1b9ef8[_0x40d0e7[_0x36e0('0x2f')]]={'$like':'%'+_0x40702f[_0x36e0('0x38')][_0x36e0('0x42')]+'%'};return _0x1b9ef8;}})});}_0x207b63=_[_0x36e0('0x43')]({},_0x207b63,_0x40702f[_0x36e0('0x44')]);var _0x53d2a7={'where':_0x207b63[_0x36e0('0x3f')]};return db[_0x36e0('0x33')][_0x36e0('0x23')](_0x53d2a7)[_0x36e0('0x29')](function(_0x5cdc58){_0x10f2de[_0x36e0('0x23')]=_0x5cdc58;if(_0x40702f[_0x36e0('0x38')]['includeAll']){_0x207b63[_0x36e0('0x45')]=[{'all':!![]}];}return db['Interval'][_0x36e0('0x46')](_0x207b63);})[_0x36e0('0x29')](function(_0x46bffd){_0x10f2de[_0x36e0('0x47')]=_0x46bffd;return _0x10f2de;})[_0x36e0('0x29')](respondWithFilteredResult(_0x46c4fd,_0x207b63))['catch'](handleError(_0x46c4fd,null));};exports['show']=function(_0x2d7c83,_0x5a287b){var _0x1e6cdf={'raw':!![],'where':{'id':_0x2d7c83[_0x36e0('0x48')]['id']}},_0x469698={};_0x469698[_0x36e0('0x37')]=_['keys'](db[_0x36e0('0x33')][_0x36e0('0x34')]);_0x469698['query']=_[_0x36e0('0x49')](_0x2d7c83['query']);_0x469698[_0x36e0('0x40')]=_[_0x36e0('0x39')](_0x469698[_0x36e0('0x37')],_0x469698[_0x36e0('0x38')]);_0x1e6cdf['attributes']=_[_0x36e0('0x39')](_0x469698[_0x36e0('0x37')],qs[_0x36e0('0x3a')](_0x2d7c83[_0x36e0('0x38')][_0x36e0('0x3a')]));_0x1e6cdf['attributes']=_0x1e6cdf[_0x36e0('0x4a')][_0x36e0('0x3b')]?_0x1e6cdf[_0x36e0('0x4a')]:_0x469698['model'];if(_0x2d7c83[_0x36e0('0x38')][_0x36e0('0x4b')]){_0x1e6cdf[_0x36e0('0x45')]=[{'all':!![]}];}_0x1e6cdf=_['merge']({},_0x1e6cdf,_0x2d7c83[_0x36e0('0x44')]);return db[_0x36e0('0x33')]['find'](_0x1e6cdf)['then'](handleEntityNotFound(_0x5a287b,null))['then'](respondWithResult(_0x5a287b,null))[_0x36e0('0x4c')](handleError(_0x5a287b,null));};exports[_0x36e0('0x4d')]=function(_0x158dcf,_0x411539){return db[_0x36e0('0x33')][_0x36e0('0x4d')](_0x158dcf[_0x36e0('0x4e')],{})[_0x36e0('0x29')](function(_0x4f19aa){var _0x250247=_0x158dcf['user']['get']({'plain':!![]});if(!_0x250247)throw new Error(_0x36e0('0x4f'));if(_0x250247[_0x36e0('0x50')]===_0x36e0('0x51')){var _0x544d51=_0x4f19aa[_0x36e0('0x2b')]({'plain':!![]});var _0x9e9ea6='Intervals';return db['UserProfileSection'][_0x36e0('0x52')]({'where':{'name':_0x9e9ea6,'userProfileId':_0x250247[_0x36e0('0x53')]},'raw':!![]})[_0x36e0('0x29')](function(_0x33293c){if(_0x33293c&&_0x33293c[_0x36e0('0x54')]===0x0){return db[_0x36e0('0x2c')][_0x36e0('0x4d')]({'name':_0x544d51[_0x36e0('0x2f')],'resourceId':_0x544d51['id'],'type':_0x33293c[_0x36e0('0x2f')],'sectionId':_0x33293c['id']},{})[_0x36e0('0x29')](function(){return _0x4f19aa;});}else{return _0x4f19aa;}})[_0x36e0('0x4c')](function(_0x53dbf6){logger[_0x36e0('0x2d')](_0x36e0('0x55'),_0x53dbf6);throw _0x53dbf6;});}return _0x4f19aa;})['then'](respondWithResult(_0x411539,0xc9))['catch'](handleError(_0x411539,null));};exports['update']=function(_0x32230c,_0x224778){if(_0x32230c[_0x36e0('0x4e')]['id']){delete _0x32230c[_0x36e0('0x4e')]['id'];}return db[_0x36e0('0x33')][_0x36e0('0x52')]({'where':{'id':_0x32230c[_0x36e0('0x48')]['id']}})[_0x36e0('0x29')](handleEntityNotFound(_0x224778,null))['then'](saveUpdates(_0x32230c[_0x36e0('0x4e')],null))[_0x36e0('0x29')](respondWithResult(_0x224778,null))[_0x36e0('0x4c')](handleError(_0x224778,null));};exports[_0x36e0('0x2a')]=function(_0x4d8215,_0x17800d){return db[_0x36e0('0x33')][_0x36e0('0x52')]({'where':{'id':_0x4d8215[_0x36e0('0x48')]['id']}})['then'](handleEntityNotFound(_0x17800d,null))['then'](removeEntity(_0x17800d,null))[_0x36e0('0x4c')](handleError(_0x17800d,null));};exports[_0x36e0('0x56')]=function(_0x4e9a57,_0x4474a7,_0x4e1e90){if(_0x4e9a57[_0x36e0('0x4e')]['id']){delete _0x4e9a57[_0x36e0('0x4e')]['id'];}return db[_0x36e0('0x33')][_0x36e0('0x52')]({'where':{'id':_0x4e9a57[_0x36e0('0x48')]['id']}})[_0x36e0('0x29')](handleEntityNotFound(_0x4474a7,null))['then'](function(_0x3729bb){if(_0x3729bb){_0x4e9a57['body'][_0x36e0('0x57')]=_0x3729bb['id'];return db[_0x36e0('0x33')][_0x36e0('0x4d')](_0x4e9a57['body']);}})['then'](respondWithResult(_0x4474a7,null))[_0x36e0('0x4c')](handleError(_0x4474a7,null));};exports[_0x36e0('0x58')]=function(_0x13e185,_0x273539,_0x3eadee){var _0x54f8b8={};var _0x3537f2={};var _0x19fb15;var _0x2a51f1;return db[_0x36e0('0x33')]['findOne']({'where':{'id':_0x13e185['params']['id']}})[_0x36e0('0x29')](handleEntityNotFound(_0x273539,null))[_0x36e0('0x29')](function(_0x1955b7){if(_0x1955b7){_0x19fb15=_0x1955b7;_0x3537f2[_0x36e0('0x37')]=_[_0x36e0('0x49')](db['Interval'][_0x36e0('0x34')]);_0x3537f2[_0x36e0('0x38')]=_[_0x36e0('0x49')](_0x13e185[_0x36e0('0x38')]);_0x3537f2[_0x36e0('0x40')]=_[_0x36e0('0x39')](_0x3537f2[_0x36e0('0x37')],_0x3537f2[_0x36e0('0x38')]);_0x54f8b8[_0x36e0('0x4a')]=_['intersection'](_0x3537f2[_0x36e0('0x37')],qs['fields'](_0x13e185[_0x36e0('0x38')]['fields']));_0x54f8b8['attributes']=_0x54f8b8[_0x36e0('0x4a')][_0x36e0('0x3b')]?_0x54f8b8[_0x36e0('0x4a')]:_0x3537f2[_0x36e0('0x37')];_0x54f8b8[_0x36e0('0x3d')]=qs[_0x36e0('0x3e')](_0x13e185['query']['sort']);_0x54f8b8[_0x36e0('0x3f')]=qs[_0x36e0('0x40')](_[_0x36e0('0x41')](_0x13e185[_0x36e0('0x38')],_0x3537f2[_0x36e0('0x40')]));if(_0x13e185[_0x36e0('0x38')][_0x36e0('0x42')]){_0x54f8b8[_0x36e0('0x3f')]=_['merge'](_0x54f8b8[_0x36e0('0x3f')],{'$or':_[_0x36e0('0x32')](_0x54f8b8[_0x36e0('0x4a')],function(_0x182039){var _0x2b1adc={};_0x2b1adc[_0x182039]={'$like':'%'+_0x13e185[_0x36e0('0x38')][_0x36e0('0x42')]+'%'};return _0x2b1adc;})});}_0x54f8b8=_[_0x36e0('0x43')]({},_0x54f8b8,_0x13e185['options']);return _0x19fb15[_0x36e0('0x58')](_0x54f8b8);}})['then'](function(_0x45a008){if(_0x45a008){_0x2a51f1=_0x45a008['length'];if(!_0x13e185['query'][_0x36e0('0x59')](_0x36e0('0x3c'))){_0x54f8b8[_0x36e0('0x22')]=qs['limit'](_0x13e185['query'][_0x36e0('0x22')]);_0x54f8b8[_0x36e0('0x20')]=qs[_0x36e0('0x20')](_0x13e185[_0x36e0('0x38')]['offset']);}return _0x19fb15['getIntervals'](_0x54f8b8);}})['then'](function(_0xa7003f){if(_0xa7003f){return _0xa7003f?{'count':_0x2a51f1,'rows':_0xa7003f}:null;}})[_0x36e0('0x29')](respondWithResult(_0x273539,null))[_0x36e0('0x4c')](handleError(_0x273539,null));};exports[_0x36e0('0x5a')]=function(_0x59877e,_0x3d5c5c,_0x5c0fef){return db[_0x36e0('0x33')][_0x36e0('0x5b')]({'where':{'id':_0x59877e[_0x36e0('0x48')]['id']}})[_0x36e0('0x29')](handleEntityNotFound(_0x3d5c5c,null))[_0x36e0('0x29')](function(_0x1a3763){if(_0x1a3763){return db[_0x36e0('0x5c')]['transaction'](function(_0x4c074b){return db[_0x36e0('0x33')]['destroy']({'where':{'IntervalId':_0x59877e[_0x36e0('0x48')]['id']},'transaction':_0x4c074b})[_0x36e0('0x29')](function(_0x56440b){var _0x49e2f9=_[_0x36e0('0x32')](_0x59877e['body'],function(_0xe0ad0a){delete _0xe0ad0a['id'];_0xe0ad0a[_0x36e0('0x57')]=_0x59877e[_0x36e0('0x48')]['id'];return _0xe0ad0a;});return db['Interval']['bulkCreate'](_0x49e2f9,{'transaction':_0x4c074b});});})[_0x36e0('0x29')](function(){return db['Interval']['findAll']({'where':{'IntervalId':_0x59877e[_0x36e0('0x48')]['id']}});});}})['then'](respondWithResult(_0x3d5c5c,null))['catch'](handleError(_0x3d5c5c,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 263dbde..a7c968b 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 _0x4c35=['rimraf','./interval.attributes','../../components/extensions/rewrite','exports','Interval','tools_intervals','rewrite','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5dd240,_0xb30f56){var _0x437d22=function(_0x142d8c){while(--_0x142d8c){_0x5dd240['push'](_0x5dd240['shift']());}};_0x437d22(++_0xb30f56);}(_0x4c35,0xd9));var _0x54c3=function(_0xbb9dbf,_0x5dafa4){_0xbb9dbf=_0xbb9dbf-0x0;var _0x30223c=_0x4c35[_0xbb9dbf];return _0x30223c;};'use strict';var _=require(_0x54c3('0x0'));var util=require('util');var logger=require(_0x54c3('0x1'))(_0x54c3('0x2'));var moment=require(_0x54c3('0x3'));var BPromise=require(_0x54c3('0x4'));var rp=require(_0x54c3('0x5'));var fs=require('fs');var path=require(_0x54c3('0x6'));var rimraf=require(_0x54c3('0x7'));var config=require('../../config/environment');var attributes=require(_0x54c3('0x8'));var extensions=require(_0x54c3('0x9'));module[_0x54c3('0xa')]=function(_0x10fcbf,_0x3bc7cf){return _0x10fcbf['define'](_0x54c3('0xb'),attributes,{'tableName':_0x54c3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1c951f,_0x4bbf10){extensions[_0x54c3('0xd')](_0x10fcbf,_0x1c951f);},'afterBulkCreate':function(_0x13be2c,_0x34346f,_0x8f091d){_0x8f091d();extensions[_0x54c3('0xd')](_0x10fcbf,_0x13be2c[0x0]);},'afterUpdate':function(_0x2c8571,_0x48dbe1){extensions[_0x54c3('0xd')](_0x10fcbf,_0x2c8571);},'afterDestroy':function(_0x19401e,_0x4cff46){extensions[_0x54c3('0xd')](_0x10fcbf,_0x19401e);}}});}; \ No newline at end of file +var _0x4365=['rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','define','tools_intervals','rewrite','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x4365,0x143));var _0x5436=function(_0x2c8938,_0x183d38){_0x2c8938=_0x2c8938-0x0;var _0x3f42fe=_0x4365[_0x2c8938];return _0x3f42fe;};'use strict';var _=require(_0x5436('0x0'));var util=require(_0x5436('0x1'));var logger=require('../../config/logger')(_0x5436('0x2'));var moment=require(_0x5436('0x3'));var BPromise=require(_0x5436('0x4'));var rp=require(_0x5436('0x5'));var fs=require('fs');var path=require(_0x5436('0x6'));var rimraf=require(_0x5436('0x7'));var config=require(_0x5436('0x8'));var attributes=require(_0x5436('0x9'));var extensions=require(_0x5436('0xa'));module[_0x5436('0xb')]=function(_0x3ec009,_0x15f92f){return _0x3ec009[_0x5436('0xc')]('Interval',attributes,{'tableName':_0x5436('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x394230,_0x3e9ad2){extensions[_0x5436('0xe')](_0x3ec009,_0x394230);},'afterBulkCreate':function(_0xe1e512,_0x347c3c,_0x579a22){_0x579a22();extensions['rewrite'](_0x3ec009,_0xe1e512[0x0]);},'afterUpdate':function(_0x2f1d11,_0x314866){extensions[_0x5436('0xe')](_0x3ec009,_0x2f1d11);},'afterDestroy':function(_0x2422a4,_0x106f56){extensions[_0x5436('0xe')](_0x3ec009,_0x2422a4);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index b43ac11..5d28ca5 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(_0x1f530d,_0x18a19e){var _0x22103f=function(_0x2664c5){while(--_0x2664c5){_0x1f530d['push'](_0x1f530d['shift']());}};_0x22103f(++_0x18a19e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'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(_0x269ee8,_0x477226){var _0x4d98bd=function(_0x20d4c4){while(--_0x20d4c4){_0x269ee8['push'](_0x269ee8['shift']());}};_0x4d98bd(++_0x477226);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'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 2070ba6..663d38e 100644 --- a/server/api/jira/index.js +++ b/server/api/jira/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2032=['isAuthenticated','send','Router','../../components/auth/service','./jira.controller'];(function(_0x18af54,_0x5376cb){var _0x399a31=function(_0x4f43f6){while(--_0x4f43f6){_0x18af54['push'](_0x18af54['shift']());}};_0x399a31(++_0x5376cb);}(_0x2032,0xd9));var _0x2203=function(_0x58c2ff,_0x45b939){_0x58c2ff=_0x58c2ff-0x0;var _0x2fa3d4=_0x2032[_0x58c2ff];return _0x2fa3d4;};'use strict';var express=require('express');var router=express[_0x2203('0x0')]();var auth=require(_0x2203('0x1'));var controller=require(_0x2203('0x2'));router['post']('/',auth[_0x2203('0x3')](),controller[_0x2203('0x4')]);module['exports']=router; \ No newline at end of file +var _0xadb5=['post','isAuthenticated','exports','Router','./jira.controller'];(function(_0x2568ad,_0x188e38){var _0x206d1d=function(_0x3cb72d){while(--_0x3cb72d){_0x2568ad['push'](_0x2568ad['shift']());}};_0x206d1d(++_0x188e38);}(_0xadb5,0xad));var _0x5adb=function(_0x38c869,_0x2a289e){_0x38c869=_0x38c869-0x0;var _0x303b9a=_0xadb5[_0x38c869];return _0x303b9a;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['send']);module[_0x5adb('0x4')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 40e599c..ce6704a 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 _0x216d=['bluebird','https','../../config/logger','api','support','key','MOTGUI','summary','Report','\x20from\x20','description','stringify','Bug','customfield_11500','email','customfield_11501','fields','customfield_11502','newToken','customfield_11503','name','/rest/api/2/issue','POST','application/json','Basic\x20','base64','utf8','data','end','statusCode','parse','error','json','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','body','headers','connection','socket','remoteAddress'];(function(_0x37df6c,_0x2a9666){var _0x41f7aa=function(_0x2c9605){while(--_0x2c9605){_0x37df6c['push'](_0x37df6c['shift']());}};_0x41f7aa(++_0x2a9666);}(_0x216d,0xfc));var _0xd216=function(_0x3732c4,_0x331ff2){_0x3732c4=_0x3732c4-0x0;var _0x12ca48=_0x216d[_0x3732c4];return _0x12ca48;};'use strict';var BPromise=require(_0xd216('0x0'));var https=require(_0xd216('0x1'));var logger=require(_0xd216('0x2'))(_0xd216('0x3'));var USERNAME=_0xd216('0x4');var PASSWORD='3eAmWpBVP0';function openIssue(_0x1862bd,_0x10efa6){var _0x3703da={'fields':{'project':{'key':_0x1862bd[_0xd216('0x5')]||_0xd216('0x6')},'summary':(_0x1862bd[_0xd216('0x7')]||_0xd216('0x8'))+_0xd216('0x9')+_0x1862bd['ip'],'description':_0x1862bd[_0xd216('0xa')]||JSON[_0xd216('0xb')](_0x1862bd),'issuetype':{'name':_0x1862bd['issuetype']||_0xd216('0xc')}}};_0x3703da['fields'][_0xd216('0xd')]=_0x1862bd[_0xd216('0xe')];_0x3703da['fields'][_0xd216('0xf')]=_0x1862bd['oldToken'];_0x3703da[_0xd216('0x10')][_0xd216('0x11')]=_0x1862bd[_0xd216('0x12')];_0x3703da[_0xd216('0x10')][_0xd216('0x13')]=_0x1862bd[_0xd216('0x14')];_0x3703da[_0xd216('0x10')]['customfield_11504']=_0x1862bd['reason'];_0x3703da[_0xd216('0x10')]['customfield_10102']=_0x1862bd['ip'];var _0x64b95d={'host':'track.xcallymotion.com','port':0x1bb,'path':_0xd216('0x15'),'method':_0xd216('0x16'),'timeout':0x4e20,'headers':{'Content-Type':_0xd216('0x17'),'Authorization':_0xd216('0x18')+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0xd216('0x19'))}};var _0x514f31=JSON[_0xd216('0xb')](_0x3703da);var _0xfca5ad=https['request'](_0x64b95d,function(_0x10361d){_0x10361d['setEncoding'](_0xd216('0x1a'));var _0x4c0540='';_0x10361d['on'](_0xd216('0x1b'),function(_0x210b2f){_0x4c0540+=_0x210b2f;});_0x10361d['on'](_0xd216('0x1c'),function(){if(_0x10efa6){return _0x10efa6['status'](_0x10361d[_0xd216('0x1d')])['json'](JSON[_0xd216('0x1e')](_0x4c0540));}});});_0xfca5ad['on'](_0xd216('0x1f'),function(_0x56bb90){if(_0x10efa6){return _0x10efa6['status'](0x1f4)[_0xd216('0x20')]({'errors':[{'message':_0xd216('0x21'),'type':_0xd216('0x22')}]});}});_0xfca5ad[_0xd216('0x23')](_0x514f31);_0xfca5ad[_0xd216('0x1c')]();}exports[_0xd216('0x24')]=openIssue;exports['send']=function(_0x5e6afe,_0x314a2a){_0x5e6afe[_0xd216('0x25')]['ip']=_0x5e6afe[_0xd216('0x26')]['x-forwarded-for']||_0x5e6afe[_0xd216('0x27')]['remoteAddress']||_0x5e6afe[_0xd216('0x28')][_0xd216('0x29')]||_0x5e6afe['connection'][_0xd216('0x28')][_0xd216('0x29')];return openIssue(_0x5e6afe[_0xd216('0x25')],_0x314a2a);}; \ No newline at end of file +var _0x0c85=['description','stringify','issuetype','fields','customfield_11500','oldToken','newToken','customfield_11503','reason','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','toString','utf8','data','end','statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','headers','x-forwarded-for','socket','connection','https','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20'];(function(_0x3eccaa,_0xd2d4fa){var _0x59ef76=function(_0x24c1e1){while(--_0x24c1e1){_0x3eccaa['push'](_0x3eccaa['shift']());}};_0x59ef76(++_0xd2d4fa);}(_0x0c85,0x146));var _0x50c8=function(_0x207b0a,_0x1bb3a3){_0x207b0a=_0x207b0a-0x0;var _0x11d5bb=_0x0c85[_0x207b0a];return _0x11d5bb;};'use strict';var BPromise=require('bluebird');var https=require(_0x50c8('0x0'));var logger=require(_0x50c8('0x1'))(_0x50c8('0x2'));var USERNAME=_0x50c8('0x3');var PASSWORD=_0x50c8('0x4');function openIssue(_0xb6d638,_0x519d81){var _0xd082d5={'fields':{'project':{'key':_0xb6d638[_0x50c8('0x5')]||_0x50c8('0x6')},'summary':(_0xb6d638[_0x50c8('0x7')]||_0x50c8('0x8'))+_0x50c8('0x9')+_0xb6d638['ip'],'description':_0xb6d638[_0x50c8('0xa')]||JSON[_0x50c8('0xb')](_0xb6d638),'issuetype':{'name':_0xb6d638[_0x50c8('0xc')]||'Bug'}}};_0xd082d5[_0x50c8('0xd')][_0x50c8('0xe')]=_0xb6d638['email'];_0xd082d5[_0x50c8('0xd')]['customfield_11501']=_0xb6d638[_0x50c8('0xf')];_0xd082d5['fields']['customfield_11502']=_0xb6d638[_0x50c8('0x10')];_0xd082d5[_0x50c8('0xd')][_0x50c8('0x11')]=_0xb6d638['name'];_0xd082d5['fields']['customfield_11504']=_0xb6d638[_0x50c8('0x12')];_0xd082d5['fields']['customfield_10102']=_0xb6d638['ip'];var _0x1bd69f={'host':_0x50c8('0x13'),'port':0x1bb,'path':_0x50c8('0x14'),'method':_0x50c8('0x15'),'timeout':0x4e20,'headers':{'Content-Type':_0x50c8('0x16'),'Authorization':_0x50c8('0x17')+new Buffer(USERNAME+':'+PASSWORD)[_0x50c8('0x18')]('base64')}};var _0x453f44=JSON[_0x50c8('0xb')](_0xd082d5);var _0x592ee2=https['request'](_0x1bd69f,function(_0xd11873){_0xd11873['setEncoding'](_0x50c8('0x19'));var _0x4f4635='';_0xd11873['on'](_0x50c8('0x1a'),function(_0x13ad44){_0x4f4635+=_0x13ad44;});_0xd11873['on'](_0x50c8('0x1b'),function(){if(_0x519d81){return _0x519d81['status'](_0xd11873[_0x50c8('0x1c')])[_0x50c8('0x1d')](JSON[_0x50c8('0x1e')](_0x4f4635));}});});_0x592ee2['on'](_0x50c8('0x1f'),function(_0x43d3a7){if(_0x519d81){return _0x519d81['status'](0x1f4)[_0x50c8('0x1d')]({'errors':[{'message':_0x50c8('0x20'),'type':_0x50c8('0x21')}]});}});_0x592ee2[_0x50c8('0x22')](_0x453f44);_0x592ee2[_0x50c8('0x1b')]();}exports[_0x50c8('0x23')]=openIssue;exports[_0x50c8('0x24')]=function(_0x3d75d6,_0x3a193d){_0x3d75d6[_0x50c8('0x25')]['ip']=_0x3d75d6[_0x50c8('0x26')][_0x50c8('0x27')]||_0x3d75d6['connection']['remoteAddress']||_0x3d75d6[_0x50c8('0x28')]['remoteAddress']||_0x3d75d6[_0x50c8('0x29')][_0x50c8('0x28')]['remoteAddress'];return openIssue(_0x3d75d6[_0x50c8('0x25')],_0x3a193d);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 4c3c839..56d6a6a 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 _0x99e9=['update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put'];(function(_0x57e544,_0x1bc420){var _0x455bef=function(_0x6baf8d){while(--_0x6baf8d){_0x57e544['push'](_0x57e544['shift']());}};_0x455bef(++_0x1bc420);}(_0x99e9,0xb4));var _0x999e=function(_0x4d21ff,_0x19d202){_0x4d21ff=_0x4d21ff-0x0;var _0x22b554=_0x99e9[_0x4d21ff];return _0x22b554;};'use strict';var multer=require('multer');var util=require(_0x999e('0x0'));var path=require(_0x999e('0x1'));var timeout=require(_0x999e('0x2'));var express=require(_0x999e('0x3'));var router=express['Router']();var fs_extra=require(_0x999e('0x4'));var auth=require(_0x999e('0x5'));var interaction=require(_0x999e('0x6'));var config=require('../../config/environment');var controller=require(_0x999e('0x7'));router['get']('/',auth[_0x999e('0x8')](),controller[_0x999e('0x9')]);router[_0x999e('0xa')](_0x999e('0xb'),auth['isAuthenticated'](),controller[_0x999e('0xc')]);router[_0x999e('0xa')](_0x999e('0xd'),auth[_0x999e('0x8')](),controller[_0x999e('0xe')]);router[_0x999e('0xf')]('/',auth[_0x999e('0x8')](),controller[_0x999e('0x10')]);router[_0x999e('0x11')](_0x999e('0xd'),auth[_0x999e('0x8')](),controller[_0x999e('0x12')]);router[_0x999e('0x13')](_0x999e('0xd'),auth[_0x999e('0x8')](),controller[_0x999e('0x14')]);module[_0x999e('0x15')]=router; \ No newline at end of file +var _0x9bde=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','put','delete','destroy','util','connect-timeout','Router'];(function(_0x467b50,_0x104bc2){var _0x47bf95=function(_0x17adcb){while(--_0x17adcb){_0x467b50['push'](_0x467b50['shift']());}};_0x47bf95(++_0x104bc2);}(_0x9bde,0xe1));var _0xe9bd=function(_0x28c59f,_0x34a8d5){_0x28c59f=_0x28c59f-0x0;var _0x4066af=_0x9bde[_0x28c59f];return _0x4066af;};'use strict';var multer=require('multer');var util=require(_0xe9bd('0x0'));var path=require('path');var timeout=require(_0xe9bd('0x1'));var express=require('express');var router=express[_0xe9bd('0x2')]();var fs_extra=require(_0xe9bd('0x3'));var auth=require(_0xe9bd('0x4'));var interaction=require(_0xe9bd('0x5'));var config=require(_0xe9bd('0x6'));var controller=require(_0xe9bd('0x7'));router[_0xe9bd('0x8')]('/',auth['isAuthenticated'](),controller[_0xe9bd('0x9')]);router[_0xe9bd('0x8')](_0xe9bd('0xa'),auth[_0xe9bd('0xb')](),controller[_0xe9bd('0xc')]);router[_0xe9bd('0x8')](_0xe9bd('0xd'),auth[_0xe9bd('0xb')](),controller[_0xe9bd('0xe')]);router[_0xe9bd('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe9bd('0x10')](_0xe9bd('0xd'),auth[_0xe9bd('0xb')](),controller['update']);router[_0xe9bd('0x11')](_0xe9bd('0xd'),auth[_0xe9bd('0xb')](),controller[_0xe9bd('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 7cdbcdc..ad24523 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(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x7a54,0x106));var _0x47a5=function(_0x24ce8d,_0x449907){_0x24ce8d=_0x24ce8d-0x0;var _0x33a715=_0x7a54[_0x24ce8d];return _0x33a715;};'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(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x7a54,0x106));var _0x47a5=function(_0x3d708f,_0x48b141){_0x3d708f=_0x3d708f-0x0;var _0x505f30=_0x7a54[_0x3d708f];return _0x505f30;};'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 5e19c20..53f2cf1 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 _0xd8fb=['catch','show','params','keys','include','options','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','sox','to-csv','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','Content-Range','apply','reject','save','update','then','error','name','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','findAll','rows'];(function(_0x2c7552,_0x22938c){var _0x4ced52=function(_0xffad9a){while(--_0xffad9a){_0x2c7552['push'](_0x2c7552['shift']());}};_0x4ced52(++_0x22938c);}(_0xd8fb,0x99));var _0xbd8f=function(_0x27a7d0,_0x130d81){_0x27a7d0=_0x27a7d0-0x0;var _0xd148cb=_0xd8fb[_0x27a7d0];return _0xd148cb;};'use strict';var emlformat=require(_0xbd8f('0x0'));var rimraf=require(_0xbd8f('0x1'));var zipdir=require(_0xbd8f('0x2'));var jsonpatch=require(_0xbd8f('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbd8f('0x4'));var util=require(_0xbd8f('0x5'));var path=require('path');var sox=require(_0xbd8f('0x6'));var csv=require(_0xbd8f('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbd8f('0x8'));var _=require('lodash');var squel=require(_0xbd8f('0x9'));var crypto=require('crypto');var jsforce=require(_0xbd8f('0xa'));var deskjs=require(_0xbd8f('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbd8f('0xc'));var Redis=require(_0xbd8f('0xd'));var authService=require(_0xbd8f('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xbd8f('0xf'));var hardwareService=require(_0xbd8f('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0xbd8f('0x11'));var config=require(_0xbd8f('0x12'));var licenseUtil=require(_0xbd8f('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x230988,_0x159f09){_0x159f09=_0x159f09||0xcc;return function(_0x39be16){if(_0x39be16){return _0x230988[_0xbd8f('0x14')](_0x159f09);}return _0x230988[_0xbd8f('0x15')](_0x159f09)[_0xbd8f('0x16')]();};}function respondWithResult(_0x37d4d5,_0x29ffe8){_0x29ffe8=_0x29ffe8||0xc8;return function(_0x14606c){if(_0x14606c){return _0x37d4d5['status'](_0x29ffe8)[_0xbd8f('0x17')](_0x14606c);}};}function respondWithFilteredResult(_0x829fb2,_0xa57e91){return function(_0x10d72e){if(_0x10d72e){var _0x4da96f=typeof _0xa57e91[_0xbd8f('0x18')]===_0xbd8f('0x19')&&typeof _0xa57e91['limit']===_0xbd8f('0x19');var _0xf5e7a=_0x10d72e['count'];var _0x4435b9=_0x4da96f?0x0:_0xa57e91[_0xbd8f('0x18')];var _0x47d317=_0x4da96f?_0x10d72e['count']:_0xa57e91[_0xbd8f('0x18')]+_0xa57e91['limit'];var _0x5705c5;if(_0x47d317>=_0xf5e7a){_0x47d317=_0xf5e7a;_0x5705c5=0xc8;}else{_0x5705c5=0xce;}_0x829fb2[_0xbd8f('0x15')](_0x5705c5);return _0x829fb2['set'](_0xbd8f('0x1a'),_0x4435b9+'-'+_0x47d317+'/'+_0xf5e7a)[_0xbd8f('0x17')](_0x10d72e);}return null;};}function patchUpdates(_0xb47c8e){return function(_0x897f25){try{jsonpatch[_0xbd8f('0x1b')](_0x897f25,_0xb47c8e,!![]);}catch(_0x20cab7){return BPromise[_0xbd8f('0x1c')](_0x20cab7);}return _0x897f25[_0xbd8f('0x1d')]();};}function saveUpdates(_0x2fbe3b,_0x775acc){return function(_0xfe4048){if(_0xfe4048){return _0xfe4048[_0xbd8f('0x1e')](_0x2fbe3b)[_0xbd8f('0x1f')](function(_0x15c4a9){return _0x15c4a9;});}return null;};}function removeEntity(_0x320ede,_0xd11ae){return function(_0x395b1b){if(_0x395b1b){return _0x395b1b['destroy']()[_0xbd8f('0x1f')](function(){_0x320ede[_0xbd8f('0x15')](0xcc)[_0xbd8f('0x16')]();});}};}function handleEntityNotFound(_0x2f3df7,_0xa88414){return function(_0x2257fd){if(!_0x2257fd){_0x2f3df7[_0xbd8f('0x14')](0x194);}return _0x2257fd;};}function handleError(_0x264e62,_0x4ea554){_0x4ea554=_0x4ea554||0x1f4;return function(_0x40cb43){logger[_0xbd8f('0x20')](_0x40cb43['stack']);if(_0x40cb43[_0xbd8f('0x21')]){delete _0x40cb43['name'];}_0x264e62[_0xbd8f('0x15')](_0x4ea554)[_0xbd8f('0x22')](_0x40cb43);};}exports[_0xbd8f('0x23')]=function(_0x202126,_0x2aefa2){var _0x247b07={},_0x4c4431={},_0x166de7={'count':0x0,'rows':[]};var _0x14f3cb=_[_0xbd8f('0x24')](db[_0xbd8f('0x25')][_0xbd8f('0x26')],function(_0x2ac26f){return{'name':_0x2ac26f[_0xbd8f('0x27')],'type':_0x2ac26f['type'][_0xbd8f('0x28')]};});_0x4c4431[_0xbd8f('0x29')]=_[_0xbd8f('0x24')](_0x14f3cb,_0xbd8f('0x21'));_0x4c4431['query']=_['keys'](_0x202126[_0xbd8f('0x2a')]);_0x4c4431[_0xbd8f('0x2b')]=_[_0xbd8f('0x2c')](_0x4c4431[_0xbd8f('0x29')],_0x4c4431['query']);_0x247b07[_0xbd8f('0x2d')]=_[_0xbd8f('0x2c')](_0x4c4431[_0xbd8f('0x29')],qs[_0xbd8f('0x2e')](_0x202126[_0xbd8f('0x2a')]['fields']));_0x247b07[_0xbd8f('0x2d')]=_0x247b07[_0xbd8f('0x2d')][_0xbd8f('0x2f')]?_0x247b07[_0xbd8f('0x2d')]:_0x4c4431[_0xbd8f('0x29')];if(!_0x202126['query'][_0xbd8f('0x30')]('nolimit')){_0x247b07[_0xbd8f('0x31')]=qs[_0xbd8f('0x31')](_0x202126[_0xbd8f('0x2a')][_0xbd8f('0x31')]);_0x247b07[_0xbd8f('0x18')]=qs[_0xbd8f('0x18')](_0x202126['query']['offset']);}_0x247b07['order']=qs[_0xbd8f('0x32')](_0x202126[_0xbd8f('0x2a')][_0xbd8f('0x32')]);_0x247b07[_0xbd8f('0x33')]=qs[_0xbd8f('0x2b')](_[_0xbd8f('0x34')](_0x202126[_0xbd8f('0x2a')],_0x4c4431[_0xbd8f('0x2b')]),_0x14f3cb);if(_0x202126[_0xbd8f('0x2a')][_0xbd8f('0x35')]){_0x247b07[_0xbd8f('0x33')]=_[_0xbd8f('0x36')](_0x247b07[_0xbd8f('0x33')],{'$or':_[_0xbd8f('0x24')](_0x14f3cb,function(_0x391d45){if(_0x391d45['type']!==_0xbd8f('0x37')){var _0x4181e0={};_0x4181e0[_0x391d45['name']]={'$like':'%'+_0x202126[_0xbd8f('0x2a')][_0xbd8f('0x35')]+'%'};return _0x4181e0;}})});}_0x247b07=_[_0xbd8f('0x36')]({},_0x247b07,_0x202126['options']);var _0x21da54={'where':_0x247b07['where']};return db[_0xbd8f('0x25')][_0xbd8f('0x38')](_0x21da54)[_0xbd8f('0x1f')](function(_0x4f2ebc){_0x166de7[_0xbd8f('0x38')]=_0x4f2ebc;if(_0x202126[_0xbd8f('0x2a')][_0xbd8f('0x39')]){_0x247b07['include']=[{'all':!![]}];}return db[_0xbd8f('0x25')][_0xbd8f('0x3a')](_0x247b07);})[_0xbd8f('0x1f')](function(_0x351027){_0x166de7[_0xbd8f('0x3b')]=_0x351027;return _0x166de7;})[_0xbd8f('0x1f')](respondWithFilteredResult(_0x2aefa2,_0x247b07))[_0xbd8f('0x3c')](handleError(_0x2aefa2,null));};exports[_0xbd8f('0x3d')]=function(_0x14b768,_0x5e1e77){var _0x52c62b={'raw':!![],'where':{'id':_0x14b768[_0xbd8f('0x3e')]['id']}},_0x2907a3={};_0x2907a3[_0xbd8f('0x29')]=_[_0xbd8f('0x3f')](db['JscriptyAnswerReport'][_0xbd8f('0x26')]);_0x2907a3[_0xbd8f('0x2a')]=_[_0xbd8f('0x3f')](_0x14b768[_0xbd8f('0x2a')]);_0x2907a3[_0xbd8f('0x2b')]=_['intersection'](_0x2907a3['model'],_0x2907a3[_0xbd8f('0x2a')]);_0x52c62b['attributes']=_[_0xbd8f('0x2c')](_0x2907a3[_0xbd8f('0x29')],qs[_0xbd8f('0x2e')](_0x14b768[_0xbd8f('0x2a')][_0xbd8f('0x2e')]));_0x52c62b[_0xbd8f('0x2d')]=_0x52c62b[_0xbd8f('0x2d')][_0xbd8f('0x2f')]?_0x52c62b['attributes']:_0x2907a3[_0xbd8f('0x29')];if(_0x14b768[_0xbd8f('0x2a')][_0xbd8f('0x39')]){_0x52c62b[_0xbd8f('0x40')]=[{'all':!![]}];}_0x52c62b=_[_0xbd8f('0x36')]({},_0x52c62b,_0x14b768[_0xbd8f('0x41')]);return db[_0xbd8f('0x25')][_0xbd8f('0x42')](_0x52c62b)['then'](handleEntityNotFound(_0x5e1e77,null))[_0xbd8f('0x1f')](respondWithResult(_0x5e1e77,null))[_0xbd8f('0x3c')](handleError(_0x5e1e77,null));};exports[_0xbd8f('0x43')]=function(_0x1f12dd,_0x2fdbd0){return db[_0xbd8f('0x25')][_0xbd8f('0x43')](_0x1f12dd[_0xbd8f('0x44')],{})[_0xbd8f('0x1f')](respondWithResult(_0x2fdbd0,0xc9))[_0xbd8f('0x3c')](handleError(_0x2fdbd0,null));};exports[_0xbd8f('0x1e')]=function(_0x255c59,_0x3d0ffa){if(_0x255c59[_0xbd8f('0x44')]['id']){delete _0x255c59[_0xbd8f('0x44')]['id'];}return db[_0xbd8f('0x25')][_0xbd8f('0x42')]({'where':{'id':_0x255c59[_0xbd8f('0x3e')]['id']}})[_0xbd8f('0x1f')](handleEntityNotFound(_0x3d0ffa,null))['then'](saveUpdates(_0x255c59[_0xbd8f('0x44')],null))[_0xbd8f('0x1f')](respondWithResult(_0x3d0ffa,null))[_0xbd8f('0x3c')](handleError(_0x3d0ffa,null));};exports[_0xbd8f('0x45')]=function(_0x4ce6b0,_0x1b38ad){return db['JscriptyAnswerReport'][_0xbd8f('0x42')]({'where':{'id':_0x4ce6b0[_0xbd8f('0x3e')]['id']}})[_0xbd8f('0x1f')](handleEntityNotFound(_0x1b38ad,null))[_0xbd8f('0x1f')](removeEntity(_0x1b38ad,null))['catch'](handleError(_0x1b38ad,null));};exports[_0xbd8f('0x46')]=function(_0x35b814,_0x3b67ac){return db[_0xbd8f('0x25')][_0xbd8f('0x46')]()[_0xbd8f('0x1f')](respondWithResult(_0x3b67ac,null))['catch'](handleError(_0x3b67ac,null));}; \ No newline at end of file +var _0xe574=['hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','params','keys','options','find','create','body','update','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','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','undefined','limit','offset','count','set','Content-Range','apply','reject','save','destroy','then','error','stack','name','send','JscriptyAnswerReport','rawAttributes','fieldName','key','model','map','query','filters','intersection','fields','attributes','length'];(function(_0x28ddf9,_0x5ddce7){var _0x5d9d16=function(_0x2553d4){while(--_0x2553d4){_0x28ddf9['push'](_0x28ddf9['shift']());}};_0x5d9d16(++_0x5ddce7);}(_0xe574,0x100));var _0x4e57=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xe574[_0x199572];return _0x13cfa3;};'use strict';var emlformat=require(_0x4e57('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4e57('0x1'));var jsonpatch=require(_0x4e57('0x2'));var rp=require(_0x4e57('0x3'));var moment=require(_0x4e57('0x4'));var BPromise=require(_0x4e57('0x5'));var Mustache=require(_0x4e57('0x6'));var util=require(_0x4e57('0x7'));var path=require(_0x4e57('0x8'));var sox=require(_0x4e57('0x9'));var csv=require(_0x4e57('0xa'));var ejs=require(_0x4e57('0xb'));var fs=require('fs');var fs_extra=require(_0x4e57('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x4e57('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4e57('0xa'));var querystring=require(_0x4e57('0xe'));var Papa=require(_0x4e57('0xf'));var Redis=require(_0x4e57('0x10'));var authService=require(_0x4e57('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4e57('0x12'));var hardwareService=require(_0x4e57('0x13'));var logger=require(_0x4e57('0x14'))(_0x4e57('0x15'));var utils=require(_0x4e57('0x16'));var config=require(_0x4e57('0x17'));var licenseUtil=require(_0x4e57('0x18'));var db=require(_0x4e57('0x19'))['db'];function respondWithStatusCode(_0xed8cbc,_0x40c8c8){_0x40c8c8=_0x40c8c8||0xcc;return function(_0x330868){if(_0x330868){return _0xed8cbc[_0x4e57('0x1a')](_0x40c8c8);}return _0xed8cbc[_0x4e57('0x1b')](_0x40c8c8)[_0x4e57('0x1c')]();};}function respondWithResult(_0x28f876,_0x2e9fa8){_0x2e9fa8=_0x2e9fa8||0xc8;return function(_0x4f088a){if(_0x4f088a){return _0x28f876[_0x4e57('0x1b')](_0x2e9fa8)['json'](_0x4f088a);}};}function respondWithFilteredResult(_0x254285,_0x4af0a6){return function(_0x3401c4){if(_0x3401c4){var _0x214957=typeof _0x4af0a6['offset']===_0x4e57('0x1d')&&typeof _0x4af0a6[_0x4e57('0x1e')]===_0x4e57('0x1d');var _0xb06d8=_0x3401c4['count'];var _0x2ed980=_0x214957?0x0:_0x4af0a6[_0x4e57('0x1f')];var _0x3c2978=_0x214957?_0x3401c4[_0x4e57('0x20')]:_0x4af0a6[_0x4e57('0x1f')]+_0x4af0a6['limit'];var _0x182286;if(_0x3c2978>=_0xb06d8){_0x3c2978=_0xb06d8;_0x182286=0xc8;}else{_0x182286=0xce;}_0x254285[_0x4e57('0x1b')](_0x182286);return _0x254285[_0x4e57('0x21')](_0x4e57('0x22'),_0x2ed980+'-'+_0x3c2978+'/'+_0xb06d8)['json'](_0x3401c4);}return null;};}function patchUpdates(_0x372295){return function(_0x59df7a){try{jsonpatch[_0x4e57('0x23')](_0x59df7a,_0x372295,!![]);}catch(_0x5b6127){return BPromise[_0x4e57('0x24')](_0x5b6127);}return _0x59df7a[_0x4e57('0x25')]();};}function saveUpdates(_0x427c6b,_0x43c9a7){return function(_0x45f9cd){if(_0x45f9cd){return _0x45f9cd['update'](_0x427c6b)['then'](function(_0x17e309){return _0x17e309;});}return null;};}function removeEntity(_0x58d6ea,_0x315f7c){return function(_0x4cfa0e){if(_0x4cfa0e){return _0x4cfa0e[_0x4e57('0x26')]()[_0x4e57('0x27')](function(){_0x58d6ea[_0x4e57('0x1b')](0xcc)[_0x4e57('0x1c')]();});}};}function handleEntityNotFound(_0x29df93,_0xc75cb3){return function(_0x4fb5db){if(!_0x4fb5db){_0x29df93[_0x4e57('0x1a')](0x194);}return _0x4fb5db;};}function handleError(_0x316988,_0x503eaa){_0x503eaa=_0x503eaa||0x1f4;return function(_0x36b415){logger[_0x4e57('0x28')](_0x36b415[_0x4e57('0x29')]);if(_0x36b415[_0x4e57('0x2a')]){delete _0x36b415[_0x4e57('0x2a')];}_0x316988[_0x4e57('0x1b')](_0x503eaa)[_0x4e57('0x2b')](_0x36b415);};}exports['index']=function(_0x1a26f6,_0x431794){var _0x1da085={},_0x197bc1={},_0x27a22f={'count':0x0,'rows':[]};var _0x5d55b9=_['map'](db[_0x4e57('0x2c')][_0x4e57('0x2d')],function(_0x3ce391){return{'name':_0x3ce391[_0x4e57('0x2e')],'type':_0x3ce391['type'][_0x4e57('0x2f')]};});_0x197bc1[_0x4e57('0x30')]=_[_0x4e57('0x31')](_0x5d55b9,_0x4e57('0x2a'));_0x197bc1[_0x4e57('0x32')]=_['keys'](_0x1a26f6[_0x4e57('0x32')]);_0x197bc1[_0x4e57('0x33')]=_['intersection'](_0x197bc1[_0x4e57('0x30')],_0x197bc1['query']);_0x1da085['attributes']=_[_0x4e57('0x34')](_0x197bc1[_0x4e57('0x30')],qs[_0x4e57('0x35')](_0x1a26f6['query'][_0x4e57('0x35')]));_0x1da085['attributes']=_0x1da085[_0x4e57('0x36')][_0x4e57('0x37')]?_0x1da085[_0x4e57('0x36')]:_0x197bc1['model'];if(!_0x1a26f6[_0x4e57('0x32')][_0x4e57('0x38')](_0x4e57('0x39'))){_0x1da085[_0x4e57('0x1e')]=qs[_0x4e57('0x1e')](_0x1a26f6[_0x4e57('0x32')][_0x4e57('0x1e')]);_0x1da085[_0x4e57('0x1f')]=qs[_0x4e57('0x1f')](_0x1a26f6[_0x4e57('0x32')][_0x4e57('0x1f')]);}_0x1da085['order']=qs[_0x4e57('0x3a')](_0x1a26f6['query'][_0x4e57('0x3a')]);_0x1da085[_0x4e57('0x3b')]=qs[_0x4e57('0x33')](_[_0x4e57('0x3c')](_0x1a26f6['query'],_0x197bc1['filters']),_0x5d55b9);if(_0x1a26f6[_0x4e57('0x32')][_0x4e57('0x3d')]){_0x1da085[_0x4e57('0x3b')]=_[_0x4e57('0x3e')](_0x1da085[_0x4e57('0x3b')],{'$or':_[_0x4e57('0x31')](_0x5d55b9,function(_0x1ab62){if(_0x1ab62[_0x4e57('0x3f')]!==_0x4e57('0x40')){var _0x4ac448={};_0x4ac448[_0x1ab62[_0x4e57('0x2a')]]={'$like':'%'+_0x1a26f6['query'][_0x4e57('0x3d')]+'%'};return _0x4ac448;}})});}_0x1da085=_[_0x4e57('0x3e')]({},_0x1da085,_0x1a26f6['options']);var _0x1ff9e7={'where':_0x1da085[_0x4e57('0x3b')]};return db[_0x4e57('0x2c')][_0x4e57('0x20')](_0x1ff9e7)[_0x4e57('0x27')](function(_0x386d3a){_0x27a22f[_0x4e57('0x20')]=_0x386d3a;if(_0x1a26f6['query'][_0x4e57('0x41')]){_0x1da085[_0x4e57('0x42')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x4e57('0x43')](_0x1da085);})[_0x4e57('0x27')](function(_0x2ef995){_0x27a22f[_0x4e57('0x44')]=_0x2ef995;return _0x27a22f;})[_0x4e57('0x27')](respondWithFilteredResult(_0x431794,_0x1da085))[_0x4e57('0x45')](handleError(_0x431794,null));};exports['show']=function(_0x2e5e62,_0x3fd1b0){var _0x271551={'raw':!![],'where':{'id':_0x2e5e62[_0x4e57('0x46')]['id']}},_0x330da6={};_0x330da6[_0x4e57('0x30')]=_[_0x4e57('0x47')](db['JscriptyAnswerReport'][_0x4e57('0x2d')]);_0x330da6[_0x4e57('0x32')]=_[_0x4e57('0x47')](_0x2e5e62[_0x4e57('0x32')]);_0x330da6[_0x4e57('0x33')]=_['intersection'](_0x330da6[_0x4e57('0x30')],_0x330da6[_0x4e57('0x32')]);_0x271551[_0x4e57('0x36')]=_[_0x4e57('0x34')](_0x330da6[_0x4e57('0x30')],qs[_0x4e57('0x35')](_0x2e5e62[_0x4e57('0x32')][_0x4e57('0x35')]));_0x271551[_0x4e57('0x36')]=_0x271551[_0x4e57('0x36')]['length']?_0x271551['attributes']:_0x330da6['model'];if(_0x2e5e62[_0x4e57('0x32')][_0x4e57('0x41')]){_0x271551[_0x4e57('0x42')]=[{'all':!![]}];}_0x271551=_[_0x4e57('0x3e')]({},_0x271551,_0x2e5e62[_0x4e57('0x48')]);return db[_0x4e57('0x2c')][_0x4e57('0x49')](_0x271551)[_0x4e57('0x27')](handleEntityNotFound(_0x3fd1b0,null))[_0x4e57('0x27')](respondWithResult(_0x3fd1b0,null))[_0x4e57('0x45')](handleError(_0x3fd1b0,null));};exports[_0x4e57('0x4a')]=function(_0xe5c591,_0x423986){return db['JscriptyAnswerReport'][_0x4e57('0x4a')](_0xe5c591[_0x4e57('0x4b')],{})[_0x4e57('0x27')](respondWithResult(_0x423986,0xc9))[_0x4e57('0x45')](handleError(_0x423986,null));};exports[_0x4e57('0x4c')]=function(_0x41d476,_0x48869d){if(_0x41d476[_0x4e57('0x4b')]['id']){delete _0x41d476[_0x4e57('0x4b')]['id'];}return db[_0x4e57('0x2c')][_0x4e57('0x49')]({'where':{'id':_0x41d476[_0x4e57('0x46')]['id']}})[_0x4e57('0x27')](handleEntityNotFound(_0x48869d,null))[_0x4e57('0x27')](saveUpdates(_0x41d476[_0x4e57('0x4b')],null))['then'](respondWithResult(_0x48869d,null))[_0x4e57('0x45')](handleError(_0x48869d,null));};exports['destroy']=function(_0x3deb47,_0x328c2c){return db[_0x4e57('0x2c')]['find']({'where':{'id':_0x3deb47[_0x4e57('0x46')]['id']}})['then'](handleEntityNotFound(_0x328c2c,null))[_0x4e57('0x27')](removeEntity(_0x328c2c,null))[_0x4e57('0x45')](handleError(_0x328c2c,null));};exports[_0x4e57('0x4d')]=function(_0x139891,_0x12e2df){return db[_0x4e57('0x2c')][_0x4e57('0x4d')]()['then'](respondWithResult(_0x12e2df,null))['catch'](handleError(_0x12e2df,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 405f2ef..9d5dc18 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 _0xdd82=['request-promise','path','rimraf','./jscriptyAnswerReport.attributes','exports','define','report_jscripty_answers','lodash','util','../../config/logger','api','moment'];(function(_0x2cef86,_0xbae0a6){var _0x46dfd6=function(_0x52e464){while(--_0x52e464){_0x2cef86['push'](_0x2cef86['shift']());}};_0x46dfd6(++_0xbae0a6);}(_0xdd82,0xaf));var _0x2dd8=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xdd82[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x2dd8('0x0'));var util=require(_0x2dd8('0x1'));var logger=require(_0x2dd8('0x2'))(_0x2dd8('0x3'));var moment=require(_0x2dd8('0x4'));var BPromise=require('bluebird');var rp=require(_0x2dd8('0x5'));var fs=require('fs');var path=require(_0x2dd8('0x6'));var rimraf=require(_0x2dd8('0x7'));var config=require('../../config/environment');var attributes=require(_0x2dd8('0x8'));module[_0x2dd8('0x9')]=function(_0x86f06,_0x46a852){return _0x86f06[_0x2dd8('0xa')]('JscriptyAnswerReport',attributes,{'tableName':_0x2dd8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x225a=['moment','bluebird','request-promise','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','report_jscripty_answers','lodash','util'];(function(_0x2178ca,_0x141534){var _0x1f5ff3=function(_0x1c60af){while(--_0x1c60af){_0x2178ca['push'](_0x2178ca['shift']());}};_0x1f5ff3(++_0x141534);}(_0x225a,0xfb));var _0xa225=function(_0x259cdb,_0x3696ff){_0x259cdb=_0x259cdb-0x0;var _0x102792=_0x225a[_0x259cdb];return _0x102792;};'use strict';var _=require(_0xa225('0x0'));var util=require(_0xa225('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xa225('0x2'));var BPromise=require(_0xa225('0x3'));var rp=require(_0xa225('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa225('0x5'));var attributes=require(_0xa225('0x6'));module[_0xa225('0x7')]=function(_0x1f97ae,_0x28eb16){return _0x1f97ae[_0xa225('0x8')](_0xa225('0x9'),attributes,{'tableName':_0xa225('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 d498fd6..19ce803 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 _0xdf0f=['jayson/promise','client','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1dac6e,_0x3a402e){var _0x16783a=function(_0x11d678){while(--_0x11d678){_0x1dac6e['push'](_0x1dac6e['shift']());}};_0x16783a(++_0x3a402e);}(_0xdf0f,0x199));var _0xfdf0=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xdf0f[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require(_0xfdf0('0x0'));var moment=require(_0xfdf0('0x1'));var BPromise=require(_0xfdf0('0x2'));var rs=require(_0xfdf0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfdf0('0x4'))['db'];var utils=require(_0xfdf0('0x5'));var logger=require(_0xfdf0('0x6'))(_0xfdf0('0x7'));var config=require(_0xfdf0('0x8'));var jayson=require(_0xfdf0('0x9'));var client=jayson[_0xfdf0('0xa')][_0xfdf0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x139073,_0x1bb5fc,_0x20528f){return new BPromise(function(_0x637909,_0x5649ec){return client[_0xfdf0('0xc')](_0x139073,_0x20528f)[_0xfdf0('0xd')](function(_0x78afa5){logger[_0xfdf0('0xe')](_0xfdf0('0xf'),_0x1bb5fc,_0xfdf0('0x10'));logger[_0xfdf0('0x11')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x1bb5fc,_0xfdf0('0x10'),JSON[_0xfdf0('0x12')](_0x78afa5));if(_0x78afa5['error']){if(_0x78afa5[_0xfdf0('0x13')]['code']===0x1f4){logger['error'](_0xfdf0('0xf'),_0x1bb5fc,_0x78afa5[_0xfdf0('0x13')][_0xfdf0('0x14')]);return _0x5649ec(_0x78afa5[_0xfdf0('0x13')][_0xfdf0('0x14')]);}logger['error'](_0xfdf0('0xf'),_0x1bb5fc,_0x78afa5[_0xfdf0('0x13')][_0xfdf0('0x14')]);return _0x637909(_0x78afa5['error']['message']);}else{logger[_0xfdf0('0xe')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x1bb5fc,_0xfdf0('0x10'));_0x637909(_0x78afa5['result'][_0xfdf0('0x14')]);}})[_0xfdf0('0x15')](function(_0x27674e){logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x1bb5fc,_0x27674e);_0x5649ec(_0x27674e);});});} \ No newline at end of file +var _0xe730=['debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','message','JscriptyAnswerReport,\x20%s,\x20%s','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe730,0x1a9));var _0x0e73=function(_0x39af3f,_0x43351d){_0x39af3f=_0x39af3f-0x0;var _0x39195d=_0xe730[_0x39af3f];return _0x39195d;};'use strict';var _=require(_0x0e73('0x0'));var util=require(_0x0e73('0x1'));var moment=require(_0x0e73('0x2'));var BPromise=require(_0x0e73('0x3'));var rs=require(_0x0e73('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0e73('0x5'))['db'];var utils=require(_0x0e73('0x6'));var logger=require('../../config/logger')(_0x0e73('0x7'));var config=require(_0x0e73('0x8'));var jayson=require(_0x0e73('0x9'));var client=jayson[_0x0e73('0xa')][_0x0e73('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x21f438,_0x381b17,_0x58e899){return new BPromise(function(_0x286ac0,_0x1e50b3){return client[_0x0e73('0xc')](_0x21f438,_0x58e899)['then'](function(_0xa5ffb6){logger[_0x0e73('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x381b17,_0x0e73('0xe'));logger[_0x0e73('0xf')](_0x0e73('0x10'),_0x381b17,'request\x20sent',JSON[_0x0e73('0x11')](_0xa5ffb6));if(_0xa5ffb6['error']){if(_0xa5ffb6[_0x0e73('0x12')]['code']===0x1f4){logger[_0x0e73('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x381b17,_0xa5ffb6[_0x0e73('0x12')]['message']);return _0x1e50b3(_0xa5ffb6[_0x0e73('0x12')][_0x0e73('0x13')]);}logger[_0x0e73('0x12')](_0x0e73('0x14'),_0x381b17,_0xa5ffb6[_0x0e73('0x12')]['message']);return _0x286ac0(_0xa5ffb6[_0x0e73('0x12')][_0x0e73('0x13')]);}else{logger[_0x0e73('0xd')](_0x0e73('0x14'),_0x381b17,'request\x20sent');_0x286ac0(_0xa5ffb6['result'][_0x0e73('0x13')]);}})[_0x0e73('0x15')](function(_0x4a13a1){logger[_0x0e73('0x12')](_0x0e73('0x14'),_0x381b17,_0x4a13a1);_0x1e50b3(_0x4a13a1);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 081efdd..386053a 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 _0x848b=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyProject.controller','get','isAuthenticated','index','show','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','30s','getSummary','create','post','/:id/clone','put','update','destroy','util','path','connect-timeout','express'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x848b,0x11a));var _0xb848=function(_0x347d04,_0x1425ed){_0x347d04=_0x347d04-0x0;var _0x48d385=_0x848b[_0x347d04];return _0x48d385;};'use strict';var multer=require('multer');var util=require(_0xb848('0x0'));var path=require(_0xb848('0x1'));var timeout=require(_0xb848('0x2'));var express=require(_0xb848('0x3'));var router=express[_0xb848('0x4')]();var fs_extra=require(_0xb848('0x5'));var auth=require(_0xb848('0x6'));var interaction=require(_0xb848('0x7'));var config=require('../../config/environment');var controller=require(_0xb848('0x8'));router[_0xb848('0x9')]('/',auth[_0xb848('0xa')](),controller[_0xb848('0xb')]);router[_0xb848('0x9')]('/:id',auth[_0xb848('0xa')](),controller[_0xb848('0xc')]);router['get'](_0xb848('0xd'),auth['isAuthenticated'](),controller[_0xb848('0xe')]);router['get'](_0xb848('0xf'),auth[_0xb848('0xa')](),controller[_0xb848('0x10')]);router[_0xb848('0x9')](_0xb848('0x11'),auth[_0xb848('0xa')](),timeout(_0xb848('0x12')),controller[_0xb848('0x13')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb848('0x14')]);router[_0xb848('0x15')](_0xb848('0x16'),auth[_0xb848('0xa')](),controller['clone']);router[_0xb848('0x17')]('/:id',auth[_0xb848('0xa')](),controller[_0xb848('0x18')]);router['delete']('/:id',auth[_0xb848('0xa')](),controller[_0xb848('0x19')]);module['exports']=router; \ No newline at end of file +var _0xad4b=['/:id','getSessions','/:id/answers','getAnswers','/:id/summary','30s','getSummary','create','clone','put','update','destroy','exports','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index'];(function(_0x39e283,_0x247e6b){var _0x7de89f=function(_0x2f8c50){while(--_0x2f8c50){_0x39e283['push'](_0x39e283['shift']());}};_0x7de89f(++_0x247e6b);}(_0xad4b,0x166));var _0xbad4=function(_0x34021d,_0x753aa6){_0x34021d=_0x34021d-0x0;var _0x16597b=_0xad4b[_0x34021d];return _0x16597b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xbad4('0x0'));var timeout=require(_0xbad4('0x1'));var express=require('express');var router=express[_0xbad4('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xbad4('0x3'));var interaction=require(_0xbad4('0x4'));var config=require(_0xbad4('0x5'));var controller=require(_0xbad4('0x6'));router[_0xbad4('0x7')]('/',auth[_0xbad4('0x8')](),controller[_0xbad4('0x9')]);router[_0xbad4('0x7')](_0xbad4('0xa'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/sessions',auth[_0xbad4('0x8')](),controller[_0xbad4('0xb')]);router[_0xbad4('0x7')](_0xbad4('0xc'),auth[_0xbad4('0x8')](),controller[_0xbad4('0xd')]);router[_0xbad4('0x7')](_0xbad4('0xe'),auth[_0xbad4('0x8')](),timeout(_0xbad4('0xf')),controller[_0xbad4('0x10')]);router['post']('/',auth[_0xbad4('0x8')](),controller[_0xbad4('0x11')]);router['post']('/:id/clone',auth['isAuthenticated'](),controller[_0xbad4('0x12')]);router[_0xbad4('0x13')](_0xbad4('0xa'),auth[_0xbad4('0x8')](),controller[_0xbad4('0x14')]);router['delete']('/:id',auth[_0xbad4('0x8')](),controller[_0xbad4('0x15')]);module[_0xbad4('0x16')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 8a6e142..102ec09 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 _0xa7f9=['format','getDataValue','description','BOOLEAN','sequelize','lodash','util','STRING','name','setDataValue','isString','formData'];(function(_0x1e40f8,_0x461032){var _0x116025=function(_0x268b5d){while(--_0x268b5d){_0x1e40f8['push'](_0x1e40f8['shift']());}};_0x116025(++_0x461032);}(_0xa7f9,0x1c0));var _0x9a7f=function(_0x324277,_0xa7681f){_0x324277=_0x324277-0x0;var _0x42965e=_0xa7f9[_0x324277];return _0x42965e;};'use strict';var Sequelize=require(_0x9a7f('0x0'));var _=require(_0x9a7f('0x1'));var util=require(_0x9a7f('0x2'));module['exports']={'name':{'type':Sequelize[_0x9a7f('0x3')],'unique':_0x9a7f('0x4')},'description':{'type':Sequelize[_0x9a7f('0x3')]},'formData':{'type':Sequelize['TEXT']('long'),'set':function(_0x13df9d){if(_['isObjectLike'](_0x13df9d)){this[_0x9a7f('0x5')]('formData',JSON['stringify'](_0x13df9d));}else if(_[_0x9a7f('0x6')](_0x13df9d)){this['setDataValue'](_0x9a7f('0x7'),_0x13df9d);}else{this[_0x9a7f('0x5')](_0x9a7f('0x7'),util[_0x9a7f('0x8')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0x9a7f('0x9')](_0x9a7f('0x4'))||'',this[_0x9a7f('0x9')](_0x9a7f('0xa'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x9a7f('0xb')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x9a7f('0xb')],'defaultValue':![]}}; \ No newline at end of file +var _0x430f=['stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','description','BOOLEAN','sequelize','lodash','STRING','long','isObjectLike','setDataValue','formData'];(function(_0x3487b5,_0xa85f12){var _0xdd527b=function(_0x23c7bd){while(--_0x23c7bd){_0x3487b5['push'](_0x3487b5['shift']());}};_0xdd527b(++_0xa85f12);}(_0x430f,0xe3));var _0xf430=function(_0x3154f7,_0x4251c){_0x3154f7=_0x3154f7-0x0;var _0x52d50b=_0x430f[_0x3154f7];return _0x52d50b;};'use strict';var Sequelize=require(_0xf430('0x0'));var _=require(_0xf430('0x1'));var util=require('util');module['exports']={'name':{'type':Sequelize[_0xf430('0x2')],'unique':'name'},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize['TEXT'](_0xf430('0x3')),'set':function(_0x3a42e5){if(_[_0xf430('0x4')](_0x3a42e5)){this[_0xf430('0x5')](_0xf430('0x6'),JSON[_0xf430('0x7')](_0x3a42e5));}else if(_[_0xf430('0x8')](_0x3a42e5)){this[_0xf430('0x5')](_0xf430('0x6'),_0x3a42e5);}else{this[_0xf430('0x5')](_0xf430('0x6'),util[_0xf430('0x9')](_0xf430('0xa'),this['getDataValue']('name')||'',this['getDataValue'](_0xf430('0xb'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xf430('0xc')],'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 1954e29..39288cc 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 _0x4f08=['create','body','get','role','UserProfileSection','userProfileId','autoAssociation','clone','includeAll','options','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','findOne','JscriptySessionReport','hasOwnProperty','order','pick','getAnswers','JscriptyAnswerReport','findAll','number','fromCharCode','indexOf','toString','replace','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','download','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','save','then','Projects','UserProfileResource','destroy','error','name','send','map','JscriptyProject','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','length','sort','where','VIRTUAL','filter','merge','include','rows','catch','show','params','find'];(function(_0xe01fb8,_0x5d3a27){var _0x318cb3=function(_0x154999){while(--_0x154999){_0xe01fb8['push'](_0xe01fb8['shift']());}};_0x318cb3(++_0x5d3a27);}(_0x4f08,0x194));var _0x84f0=function(_0x39f115,_0x5bfc36){_0x39f115=_0x39f115-0x0;var _0x41067b=_0x4f08[_0x39f115];return _0x41067b;};'use strict';var emlformat=require(_0x84f0('0x0'));var rimraf=require(_0x84f0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x84f0('0x2'));var rp=require(_0x84f0('0x3'));var moment=require('moment');var BPromise=require(_0x84f0('0x4'));var Mustache=require(_0x84f0('0x5'));var util=require(_0x84f0('0x6'));var path=require('path');var sox=require(_0x84f0('0x7'));var csv=require('to-csv');var ejs=require(_0x84f0('0x8'));var fs=require('fs');var fs_extra=require(_0x84f0('0x9'));var _=require(_0x84f0('0xa'));var squel=require('squel');var crypto=require(_0x84f0('0xb'));var jsforce=require(_0x84f0('0xc'));var deskjs=require(_0x84f0('0xd'));var toCsv=require(_0x84f0('0xe'));var querystring=require(_0x84f0('0xf'));var Papa=require(_0x84f0('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x84f0('0x11'));var as=require(_0x84f0('0x12'));var hardwareService=require(_0x84f0('0x13'));var logger=require(_0x84f0('0x14'))(_0x84f0('0x15'));var utils=require(_0x84f0('0x16'));var config=require(_0x84f0('0x17'));var licenseUtil=require(_0x84f0('0x18'));var db=require(_0x84f0('0x19'))['db'];function respondWithStatusCode(_0x532506,_0xfe9718){_0xfe9718=_0xfe9718||0xcc;return function(_0x50a03b){if(_0x50a03b){return _0x532506[_0x84f0('0x1a')](_0xfe9718);}return _0x532506['status'](_0xfe9718)[_0x84f0('0x1b')]();};}function respondWithResult(_0x32c3e8,_0x278f4e){_0x278f4e=_0x278f4e||0xc8;return function(_0xb077e1){if(_0xb077e1){return _0x32c3e8[_0x84f0('0x1c')](_0x278f4e)[_0x84f0('0x1d')](_0xb077e1);}};}function respondWithFilteredResult(_0x4167f3,_0x407db6){return function(_0x1b5d88){if(_0x1b5d88){var _0x58f208=typeof _0x407db6[_0x84f0('0x1e')]===_0x84f0('0x1f')&&typeof _0x407db6[_0x84f0('0x20')]==='undefined';var _0x4ac111=_0x1b5d88[_0x84f0('0x21')];var _0x295fe5=_0x58f208?0x0:_0x407db6[_0x84f0('0x1e')];var _0x40f536=_0x58f208?_0x1b5d88[_0x84f0('0x21')]:_0x407db6[_0x84f0('0x1e')]+_0x407db6['limit'];var _0x597519;if(_0x40f536>=_0x4ac111){_0x40f536=_0x4ac111;_0x597519=0xc8;}else{_0x597519=0xce;}_0x4167f3['status'](_0x597519);return _0x4167f3['set'](_0x84f0('0x22'),_0x295fe5+'-'+_0x40f536+'/'+_0x4ac111)['json'](_0x1b5d88);}return null;};}function patchUpdates(_0x3353f9){return function(_0x29f979){try{jsonpatch[_0x84f0('0x23')](_0x29f979,_0x3353f9,!![]);}catch(_0xe1bf11){return BPromise['reject'](_0xe1bf11);}return _0x29f979[_0x84f0('0x24')]();};}function saveUpdates(_0x451e55,_0x2611cd){return function(_0x501665){if(_0x501665){return _0x501665['update'](_0x451e55)[_0x84f0('0x25')](function(_0x6c7e4e){return _0x6c7e4e;});}return null;};}function removeEntity(_0x44492a,_0x10133c){return function(_0x3a5ac2){if(_0x3a5ac2){return _0x3a5ac2['destroy']()[_0x84f0('0x25')](function(){var _0x57a067=_0x3a5ac2['get']({'plain':!![]});var _0x1e4da9=_0x84f0('0x26');return db[_0x84f0('0x27')][_0x84f0('0x28')]({'where':{'type':_0x1e4da9,'resourceId':_0x57a067['id']}})['then'](function(){return _0x3a5ac2;});})[_0x84f0('0x25')](function(){_0x44492a[_0x84f0('0x1c')](0xcc)[_0x84f0('0x1b')]();});}};}function handleEntityNotFound(_0xe67cd1,_0x124a37){return function(_0xf60719){if(!_0xf60719){_0xe67cd1[_0x84f0('0x1a')](0x194);}return _0xf60719;};}function handleError(_0x4a71b3,_0x1bfc7a){_0x1bfc7a=_0x1bfc7a||0x1f4;return function(_0x4c1186){logger[_0x84f0('0x29')](_0x4c1186['stack']);if(_0x4c1186[_0x84f0('0x2a')]){delete _0x4c1186['name'];}_0x4a71b3['status'](_0x1bfc7a)[_0x84f0('0x2b')](_0x4c1186);};}exports['index']=function(_0x30e559,_0x3e98db){var _0x1294de={},_0x344721={},_0x9e766c={'count':0x0,'rows':[]};var _0x2f0164=_[_0x84f0('0x2c')](db[_0x84f0('0x2d')][_0x84f0('0x2e')],function(_0x3dbfec){return{'name':_0x3dbfec['fieldName'],'type':_0x3dbfec[_0x84f0('0x2f')][_0x84f0('0x30')]};});_0x344721['model']=_[_0x84f0('0x2c')](_0x2f0164,'name');_0x344721[_0x84f0('0x31')]=_[_0x84f0('0x32')](_0x30e559[_0x84f0('0x31')]);_0x344721[_0x84f0('0x33')]=_[_0x84f0('0x34')](_0x344721[_0x84f0('0x35')],_0x344721[_0x84f0('0x31')]);_0x1294de['attributes']=_['intersection'](_0x344721[_0x84f0('0x35')],qs[_0x84f0('0x36')](_0x30e559['query'][_0x84f0('0x36')]));_0x1294de[_0x84f0('0x37')]=_0x1294de[_0x84f0('0x37')][_0x84f0('0x38')]?_0x1294de[_0x84f0('0x37')]:_0x344721[_0x84f0('0x35')];if(!_0x30e559[_0x84f0('0x31')]['hasOwnProperty']('nolimit')){_0x1294de[_0x84f0('0x20')]=qs[_0x84f0('0x20')](_0x30e559['query'][_0x84f0('0x20')]);_0x1294de[_0x84f0('0x1e')]=qs[_0x84f0('0x1e')](_0x30e559[_0x84f0('0x31')][_0x84f0('0x1e')]);}_0x1294de['order']=qs[_0x84f0('0x39')](_0x30e559[_0x84f0('0x31')][_0x84f0('0x39')]);_0x1294de[_0x84f0('0x3a')]=qs[_0x84f0('0x33')](_['pick'](_0x30e559['query'],_0x344721[_0x84f0('0x33')]),_0x2f0164);if(_0x30e559[_0x84f0('0x31')]['filter']){_0x1294de[_0x84f0('0x3a')]=_['merge'](_0x1294de[_0x84f0('0x3a')],{'$or':_[_0x84f0('0x2c')](_0x2f0164,function(_0x553499){if(_0x553499[_0x84f0('0x2f')]!==_0x84f0('0x3b')){var _0xa98eb8={};_0xa98eb8[_0x553499[_0x84f0('0x2a')]]={'$like':'%'+_0x30e559['query'][_0x84f0('0x3c')]+'%'};return _0xa98eb8;}})});}_0x1294de=_[_0x84f0('0x3d')]({},_0x1294de,_0x30e559['options']);var _0x393c30={'where':_0x1294de['where']};return db['JscriptyProject'][_0x84f0('0x21')](_0x393c30)['then'](function(_0x3266d0){_0x9e766c[_0x84f0('0x21')]=_0x3266d0;if(_0x30e559['query']['includeAll']){_0x1294de[_0x84f0('0x3e')]=[{'all':!![]}];}return db[_0x84f0('0x2d')]['findAll'](_0x1294de);})[_0x84f0('0x25')](function(_0x20b87a){_0x9e766c[_0x84f0('0x3f')]=_0x20b87a;return _0x9e766c;})[_0x84f0('0x25')](respondWithFilteredResult(_0x3e98db,_0x1294de))[_0x84f0('0x40')](handleError(_0x3e98db,null));};exports[_0x84f0('0x41')]=function(_0xd030c9,_0x5eaef0){var _0x194e8d={'raw':![],'where':{'id':_0xd030c9[_0x84f0('0x42')]['id']}},_0x3aad10={};_0x3aad10[_0x84f0('0x35')]=_[_0x84f0('0x32')](db[_0x84f0('0x2d')][_0x84f0('0x2e')]);_0x3aad10['query']=_[_0x84f0('0x32')](_0xd030c9['query']);_0x3aad10[_0x84f0('0x33')]=_[_0x84f0('0x34')](_0x3aad10[_0x84f0('0x35')],_0x3aad10[_0x84f0('0x31')]);_0x194e8d[_0x84f0('0x37')]=_[_0x84f0('0x34')](_0x3aad10[_0x84f0('0x35')],qs[_0x84f0('0x36')](_0xd030c9[_0x84f0('0x31')][_0x84f0('0x36')]));_0x194e8d[_0x84f0('0x37')]=_0x194e8d[_0x84f0('0x37')]['length']?_0x194e8d['attributes']:_0x3aad10[_0x84f0('0x35')];if(_0xd030c9[_0x84f0('0x31')]['includeAll']){_0x194e8d['include']=[{'all':!![]}];}_0x194e8d=_[_0x84f0('0x3d')]({},_0x194e8d,_0xd030c9['options']);return db[_0x84f0('0x2d')][_0x84f0('0x43')](_0x194e8d)['then'](handleEntityNotFound(_0x5eaef0,null))[_0x84f0('0x25')](respondWithResult(_0x5eaef0,null))[_0x84f0('0x40')](handleError(_0x5eaef0,null));};exports[_0x84f0('0x44')]=function(_0x50a3a4,_0x39e092){return db[_0x84f0('0x2d')][_0x84f0('0x44')](_0x50a3a4[_0x84f0('0x45')],{})[_0x84f0('0x25')](function(_0x2c7fb2){var _0x342480=_0x50a3a4['user'][_0x84f0('0x46')]({'plain':!![]});if(!_0x342480)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x342480[_0x84f0('0x47')]==='user'){var _0x267c2b=_0x2c7fb2[_0x84f0('0x46')]({'plain':!![]});var _0x4cceaf='Projects';return db[_0x84f0('0x48')][_0x84f0('0x43')]({'where':{'name':_0x4cceaf,'userProfileId':_0x342480[_0x84f0('0x49')]},'raw':!![]})['then'](function(_0xbc1be0){if(_0xbc1be0&&_0xbc1be0[_0x84f0('0x4a')]===0x0){return db[_0x84f0('0x27')][_0x84f0('0x44')]({'name':_0x267c2b[_0x84f0('0x2a')],'resourceId':_0x267c2b['id'],'type':_0xbc1be0[_0x84f0('0x2a')],'sectionId':_0xbc1be0['id']},{})[_0x84f0('0x25')](function(){return _0x2c7fb2;});}else{return _0x2c7fb2;}})[_0x84f0('0x40')](function(_0x532ccd){logger[_0x84f0('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x532ccd);throw _0x532ccd;});}return _0x2c7fb2;})[_0x84f0('0x25')](respondWithResult(_0x39e092,0xc9))[_0x84f0('0x40')](handleError(_0x39e092,null));};exports[_0x84f0('0x4b')]=function(_0x2935f5,_0x208d36){var _0x109a3d={'where':{'id':_0x2935f5[_0x84f0('0x42')]['id']}},_0xe400aa={};_0xe400aa['model']=_[_0x84f0('0x32')](db['JscriptyProject']['rawAttributes']);_0x109a3d[_0x84f0('0x37')]=_[_0x84f0('0x34')](_0xe400aa['model'],qs[_0x84f0('0x36')](_0x2935f5[_0x84f0('0x31')]['fields']));_0x109a3d['attributes']=_0x109a3d[_0x84f0('0x37')][_0x84f0('0x38')]?_0x109a3d['attributes']:_0xe400aa['model'];if(_0x2935f5[_0x84f0('0x31')][_0x84f0('0x4c')]){_0x109a3d[_0x84f0('0x3e')]=[{'all':!![]}];}_0x109a3d=_['merge']({},_0x109a3d,_0x2935f5[_0x84f0('0x4d')]);return db[_0x84f0('0x2d')][_0x84f0('0x43')](_0x109a3d)[_0x84f0('0x25')](handleEntityNotFound(_0x208d36,null))[_0x84f0('0x25')](function(_0x3327f8){if(_0x3327f8){var _0x301d33=_0x3327f8['get']({'plain':!![]});_0x301d33=qs[_0x84f0('0x4e')](_0x301d33,['id',_0x84f0('0x4f'),_0x84f0('0x50')]);_0x2935f5[_0x84f0('0x45')]=_[_0x84f0('0x4e')](_0x2935f5[_0x84f0('0x45')],['id',_0x84f0('0x4f'),_0x84f0('0x50')]);return db['JscriptyProject'][_0x84f0('0x44')](_['merge'](_0x301d33,_0x2935f5[_0x84f0('0x45')]),{'include':_0x2935f5[_0x84f0('0x31')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x4d52b5){var _0xdf2c1e=_0x2935f5['user'][_0x84f0('0x46')]({'plain':!![]});if(!_0xdf2c1e)throw new Error(_0x84f0('0x51'));if(_0xdf2c1e[_0x84f0('0x47')]===_0x84f0('0x52')){var _0x56de0d=_0x4d52b5[_0x84f0('0x46')]({'plain':!![]});var _0x2cda13='Projects';return db[_0x84f0('0x48')][_0x84f0('0x43')]({'where':{'name':_0x2cda13,'userProfileId':_0xdf2c1e['userProfileId']},'raw':!![]})[_0x84f0('0x25')](function(_0x49329e){if(_0x49329e&&_0x49329e['autoAssociation']===0x0){return db['UserProfileResource'][_0x84f0('0x44')]({'name':_0x56de0d[_0x84f0('0x2a')],'resourceId':_0x56de0d['id'],'type':_0x49329e['name'],'sectionId':_0x49329e['id']},{})[_0x84f0('0x25')](function(){return _0x4d52b5;});}else{return _0x4d52b5;}})['catch'](function(_0x4dc086){logger[_0x84f0('0x29')](_0x84f0('0x53'),_0x4dc086);throw _0x4dc086;});}return _0x4d52b5;});}})['then'](respondWithResult(_0x208d36,0xc9))[_0x84f0('0x40')](handleError(_0x208d36,null));};exports[_0x84f0('0x54')]=function(_0x317552,_0x4931dc){if(_0x317552['body']['id']){delete _0x317552['body']['id'];}return db[_0x84f0('0x2d')]['find']({'where':{'id':_0x317552[_0x84f0('0x42')]['id']}})[_0x84f0('0x25')](handleEntityNotFound(_0x4931dc,null))[_0x84f0('0x25')](saveUpdates(_0x317552[_0x84f0('0x45')],null))[_0x84f0('0x25')](respondWithResult(_0x4931dc,null))[_0x84f0('0x40')](handleError(_0x4931dc,null));};exports[_0x84f0('0x28')]=function(_0xa946e5,_0x14e4c2){return db['JscriptyProject'][_0x84f0('0x43')]({'where':{'id':_0xa946e5[_0x84f0('0x42')]['id']}})['then'](handleEntityNotFound(_0x14e4c2,null))[_0x84f0('0x25')](removeEntity(_0x14e4c2,null))[_0x84f0('0x40')](handleError(_0x14e4c2,null));};exports['getSessions']=function(_0x3b54c7,_0x5111db,_0xddb5f){var _0x33f2ce={'raw':!![],'where':{}};var _0x224d92={};var _0x59d18d={'count':0x0,'rows':[]};return db[_0x84f0('0x2d')][_0x84f0('0x55')]({'where':{'id':_0x3b54c7[_0x84f0('0x42')]['id']}})[_0x84f0('0x25')](handleEntityNotFound(_0x5111db,null))[_0x84f0('0x25')](function(_0x43319b){if(_0x43319b){_0x224d92[_0x84f0('0x35')]=_[_0x84f0('0x32')](db[_0x84f0('0x56')][_0x84f0('0x2e')]);_0x224d92[_0x84f0('0x31')]=_[_0x84f0('0x32')](_0x3b54c7[_0x84f0('0x31')]);_0x224d92[_0x84f0('0x33')]=_[_0x84f0('0x34')](_0x224d92['model'],_0x224d92[_0x84f0('0x31')]);_0x33f2ce['attributes']=_[_0x84f0('0x34')](_0x224d92['model'],qs[_0x84f0('0x36')](_0x3b54c7['query'][_0x84f0('0x36')]));_0x33f2ce[_0x84f0('0x37')]=_0x33f2ce[_0x84f0('0x37')][_0x84f0('0x38')]?_0x33f2ce[_0x84f0('0x37')]:_0x224d92[_0x84f0('0x35')];if(!_0x3b54c7[_0x84f0('0x31')][_0x84f0('0x57')]('nolimit')){_0x33f2ce[_0x84f0('0x20')]=qs['limit'](_0x3b54c7[_0x84f0('0x31')][_0x84f0('0x20')]);_0x33f2ce[_0x84f0('0x1e')]=qs['offset'](_0x3b54c7['query'][_0x84f0('0x1e')]);}_0x33f2ce[_0x84f0('0x58')]=qs['sort'](_0x3b54c7[_0x84f0('0x31')][_0x84f0('0x39')]);_0x33f2ce[_0x84f0('0x3a')]=qs[_0x84f0('0x33')](_[_0x84f0('0x59')](_0x3b54c7[_0x84f0('0x31')],_0x224d92[_0x84f0('0x33')]));_0x33f2ce[_0x84f0('0x3a')]['ProjectId']=_0x43319b['id'];if(_0x3b54c7[_0x84f0('0x31')][_0x84f0('0x3c')]){_0x33f2ce[_0x84f0('0x3a')]=_[_0x84f0('0x3d')](_0x33f2ce[_0x84f0('0x3a')],{'$or':_[_0x84f0('0x2c')](_0x33f2ce[_0x84f0('0x37')],function(_0x5f497c){var _0x44cfb5={};_0x44cfb5[_0x5f497c]={'$like':'%'+_0x3b54c7[_0x84f0('0x31')][_0x84f0('0x3c')]+'%'};return _0x44cfb5;})});}_0x33f2ce=_[_0x84f0('0x3d')]({},_0x33f2ce,_0x3b54c7[_0x84f0('0x4d')]);return db[_0x84f0('0x56')][_0x84f0('0x21')]({'where':_0x33f2ce[_0x84f0('0x3a')]})['then'](function(_0x49ba97){_0x59d18d['count']=_0x49ba97;if(_0x3b54c7[_0x84f0('0x31')][_0x84f0('0x4c')]){_0x33f2ce[_0x84f0('0x3e')]=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x33f2ce);})[_0x84f0('0x25')](function(_0x3c0459){_0x59d18d[_0x84f0('0x3f')]=_0x3c0459;return _0x59d18d;});}})[_0x84f0('0x25')](respondWithFilteredResult(_0x5111db,_0x33f2ce))[_0x84f0('0x40')](handleError(_0x5111db,null));};exports[_0x84f0('0x5a')]=function(_0x10b6bf,_0x55784d,_0x7bc26d){var _0x44a231={'raw':!![],'where':{}};var _0x22436f={};var _0x5df3d4={'count':0x0,'rows':[]};return db[_0x84f0('0x2d')][_0x84f0('0x55')]({'where':{'id':_0x10b6bf[_0x84f0('0x42')]['id']}})[_0x84f0('0x25')](handleEntityNotFound(_0x55784d,null))[_0x84f0('0x25')](function(_0x40b7dd){if(_0x40b7dd){_0x22436f[_0x84f0('0x35')]=_['keys'](db[_0x84f0('0x5b')][_0x84f0('0x2e')]);_0x22436f[_0x84f0('0x31')]=_['keys'](_0x10b6bf['query']);_0x22436f['filters']=_[_0x84f0('0x34')](_0x22436f[_0x84f0('0x35')],_0x22436f[_0x84f0('0x31')]);_0x44a231[_0x84f0('0x37')]=_['intersection'](_0x22436f[_0x84f0('0x35')],qs[_0x84f0('0x36')](_0x10b6bf[_0x84f0('0x31')]['fields']));_0x44a231['attributes']=_0x44a231[_0x84f0('0x37')][_0x84f0('0x38')]?_0x44a231[_0x84f0('0x37')]:_0x22436f[_0x84f0('0x35')];if(!_0x10b6bf[_0x84f0('0x31')][_0x84f0('0x57')]('nolimit')){_0x44a231[_0x84f0('0x20')]=qs[_0x84f0('0x20')](_0x10b6bf[_0x84f0('0x31')][_0x84f0('0x20')]);_0x44a231['offset']=qs[_0x84f0('0x1e')](_0x10b6bf[_0x84f0('0x31')]['offset']);}_0x44a231[_0x84f0('0x58')]=qs[_0x84f0('0x39')](_0x10b6bf[_0x84f0('0x31')][_0x84f0('0x39')]);_0x44a231[_0x84f0('0x3a')]=qs['filters'](_[_0x84f0('0x59')](_0x10b6bf[_0x84f0('0x31')],_0x22436f[_0x84f0('0x33')]));_0x44a231['where']['ProjectId']=_0x40b7dd['id'];if(_0x10b6bf[_0x84f0('0x31')]['filter']){_0x44a231[_0x84f0('0x3a')]=_[_0x84f0('0x3d')](_0x44a231[_0x84f0('0x3a')],{'$or':_[_0x84f0('0x2c')](_0x44a231['attributes'],function(_0x3de2db){var _0x3ff55c={};_0x3ff55c[_0x3de2db]={'$like':'%'+_0x10b6bf[_0x84f0('0x31')][_0x84f0('0x3c')]+'%'};return _0x3ff55c;})});}_0x44a231=_[_0x84f0('0x3d')]({},_0x44a231,_0x10b6bf['options']);return db['JscriptyAnswerReport'][_0x84f0('0x21')]({'where':_0x44a231[_0x84f0('0x3a')]})['then'](function(_0x1f47fa){_0x5df3d4['count']=_0x1f47fa;if(_0x10b6bf[_0x84f0('0x31')][_0x84f0('0x4c')]){_0x44a231['include']=[{'all':!![]}];}return db[_0x84f0('0x5b')][_0x84f0('0x5c')](_0x44a231);})[_0x84f0('0x25')](function(_0x55c943){_0x5df3d4[_0x84f0('0x3f')]=_0x55c943;return _0x5df3d4;});}})[_0x84f0('0x25')](respondWithFilteredResult(_0x55784d,_0x44a231))[_0x84f0('0x40')](handleError(_0x55784d,null));};function char(_0x3edb4b){return _0x84f0('0x5d')===typeof _0x3edb4b?String[_0x84f0('0x5e')]['apply'](null,arguments):_0x3edb4b;}function needsEncapsulation(_0x45fb19){return!!_0x45fb19&&(_0x45fb19['toString']()[_0x84f0('0x5f')](char(0xd))>=0x0||_0x45fb19['toString']()[_0x84f0('0x5f')](char(0xa))>=0x0||_0x45fb19[_0x84f0('0x60')]()['indexOf'](char(0x2c))>=0x0||_0x45fb19[_0x84f0('0x60')]()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x38516a){var _0x32d29b=char(0x22),_0x83d0aa='\x5c'+char(0x22),_0x1ae3bc=_0x38516a[_0x84f0('0x60')]()[_0x84f0('0x61')](new RegExp(_0x32d29b,'g'),_0x83d0aa);return _0x32d29b+_0x1ae3bc+_0x32d29b;}exports['getSummary']=function(_0x16a27b,_0x1f148d,_0x547a50){var _0x4503e0,_0x437011;var _0x36e3ac={'where':{'ProjectId':_0x16a27b[_0x84f0('0x42')]['id']}};if(_0x16a27b[_0x84f0('0x31')][_0x84f0('0x62')]){_0x36e3ac[_0x84f0('0x3a')][_0x84f0('0x63')]=JSON[_0x84f0('0x64')](_0x16a27b[_0x84f0('0x31')][_0x84f0('0x62')]);}return db['JscriptySessionReport']['findAll'](_0x36e3ac)[_0x84f0('0x25')](handleEntityNotFound(_0x1f148d,null))[_0x84f0('0x25')](function(_0x1b3d85){if(_0x1b3d85){_0x4503e0=_0x1b3d85;return db[_0x84f0('0x65')][_0x84f0('0x5c')]({'where':{'SessionId':{'$in':_[_0x84f0('0x2c')](_0x4503e0,'id')},'ProjectId':_0x16a27b[_0x84f0('0x42')]['id']},'order':_0x84f0('0x66')});}})[_0x84f0('0x25')](handleEntityNotFound(_0x1f148d,null))[_0x84f0('0x25')](function(_0x4a550a){if(_0x4a550a){_0x437011=_0x4a550a;var _0x3b9cc5={};for(var _0x6ef755=0x0,_0x5d5255=_0x437011[_0x84f0('0x38')];_0x6ef755<_0x5d5255;_0x6ef755++){if(!_0x3b9cc5[_0x84f0('0x57')](_0x437011[_0x6ef755]['questionId'])){_0x3b9cc5[_0x437011[_0x6ef755][_0x84f0('0x67')]]=needsEncapsulation(_0x437011[_0x6ef755][_0x84f0('0x68')])?encapsulate(_0x437011[_0x6ef755]['question']):_0x437011[_0x6ef755][_0x84f0('0x68')];}}var _0x2d617d=[],_0x48617d={};for(var _0x490cd3=0x0,_0x1fa2a0=_0x4503e0[_0x84f0('0x38')];_0x490cd3<_0x1fa2a0;_0x490cd3++){_0x48617d={'ProjectId':_0x16a27b[_0x84f0('0x42')]['id'],'SessionId':_0x4503e0[_0x490cd3]['id'],'StartTime':moment(_0x4503e0[_0x490cd3]['starttime'])[_0x84f0('0x69')](_0x84f0('0x6a'))};for(var _0x202ee0=0x0,_0x17dccc=_0x437011[_0x84f0('0x38')];_0x202ee0<_0x17dccc;_0x202ee0++){if(_0x437011[_0x202ee0][_0x84f0('0x6b')]==_0x4503e0[_0x490cd3]['id']&&_0x3b9cc5['hasOwnProperty'](_0x437011[_0x202ee0][_0x84f0('0x67')])){_0x48617d[_0x3b9cc5[_0x437011[_0x202ee0]['questionId']]]=_0x437011[_0x202ee0][_0x84f0('0x6c')];}}for(var _0x54dc6f in _0x3b9cc5){if(!_0x48617d[_0x84f0('0x57')](_0x3b9cc5[_0x54dc6f])){_0x48617d[_0x3b9cc5[_0x54dc6f]]=null;}}_0x2d617d[_0x84f0('0x6d')](_0x48617d);}return _0x2d617d;}})[_0x84f0('0x25')](function(_0x54631f){if(!_[_0x84f0('0x6e')](_0x54631f)){var _0x330765=toCsv(_0x54631f);var _0x40ac65=Date[_0x84f0('0x6f')]();fs[_0x84f0('0x70')](util[_0x84f0('0x69')](_0x84f0('0x71'),_0x16a27b[_0x84f0('0x42')]['id'],_0x40ac65),_0x330765);_0x1f148d[_0x84f0('0x72')]('Content-disposition',_0x84f0('0x73')+util['format'](_0x84f0('0x74'),_0x16a27b[_0x84f0('0x42')]['id'],_0x40ac65));_0x1f148d[_0x84f0('0x72')]('Content-type','text/csv');return _0x1f148d[_0x84f0('0x75')](util[_0x84f0('0x69')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x16a27b['params']['id'],_0x40ac65));}else{return _0x1f148d[_0x84f0('0x1a')](0xcc);}})[_0x84f0('0x40')](handleError(_0x1f148d,null));}; \ No newline at end of file +var _0x9458=['status','json','undefined','offset','count','limit','set','Content-Range','apply','update','then','get','Projects','UserProfileResource','destroy','error','stack','name','send','index','map','JscriptyProject','rawAttributes','model','query','keys','intersection','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','options','includeAll','rows','catch','params','fields','include','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','find','createdAt','updatedAt','body','omit','getSessions','findOne','ProjectId','JscriptySessionReport','findAll','JscriptyAnswerReport','nolimit','number','fromCharCode','toString','indexOf','replace','getSummary','starttime','parse','startTime','JscriptyQuestionReport','-createdAt','question','YYYY-MM-DD\x20HH:mm:ss','SessionId','push','isEmpty','now','writeFileSync','format','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Content-type','text/csv','download','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end'];(function(_0xa514c0,_0x3207da){var _0x2a68f3=function(_0x327eb1){while(--_0x327eb1){_0xa514c0['push'](_0xa514c0['shift']());}};_0x2a68f3(++_0x3207da);}(_0x9458,0x1b8));var _0x8945=function(_0x2df3aa,_0x26515c){_0x2df3aa=_0x2df3aa-0x0;var _0x6d82f8=_0x9458[_0x2df3aa];return _0x6d82f8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8945('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8945('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x8945('0x2'));var util=require(_0x8945('0x3'));var path=require(_0x8945('0x4'));var sox=require(_0x8945('0x5'));var csv=require(_0x8945('0x6'));var ejs=require(_0x8945('0x7'));var fs=require('fs');var fs_extra=require(_0x8945('0x8'));var _=require(_0x8945('0x9'));var squel=require(_0x8945('0xa'));var crypto=require(_0x8945('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x8945('0xc'));var toCsv=require(_0x8945('0x6'));var querystring=require(_0x8945('0xd'));var Papa=require(_0x8945('0xe'));var Redis=require(_0x8945('0xf'));var authService=require(_0x8945('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8945('0x11'));var hardwareService=require(_0x8945('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x8945('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x8945('0x14'));var db=require(_0x8945('0x15'))['db'];function respondWithStatusCode(_0x41e1dd,_0x1a7320){_0x1a7320=_0x1a7320||0xcc;return function(_0x3634fd){if(_0x3634fd){return _0x41e1dd[_0x8945('0x16')](_0x1a7320);}return _0x41e1dd['status'](_0x1a7320)[_0x8945('0x17')]();};}function respondWithResult(_0xaa2141,_0x57a68b){_0x57a68b=_0x57a68b||0xc8;return function(_0x4305f0){if(_0x4305f0){return _0xaa2141[_0x8945('0x18')](_0x57a68b)[_0x8945('0x19')](_0x4305f0);}};}function respondWithFilteredResult(_0xd6aa0,_0x1021ca){return function(_0x442241){if(_0x442241){var _0x5e9e50=typeof _0x1021ca['offset']===_0x8945('0x1a')&&typeof _0x1021ca['limit']==='undefined';var _0x308f54=_0x442241['count'];var _0x4bd38f=_0x5e9e50?0x0:_0x1021ca[_0x8945('0x1b')];var _0x1fe38f=_0x5e9e50?_0x442241[_0x8945('0x1c')]:_0x1021ca[_0x8945('0x1b')]+_0x1021ca[_0x8945('0x1d')];var _0x32ce5e;if(_0x1fe38f>=_0x308f54){_0x1fe38f=_0x308f54;_0x32ce5e=0xc8;}else{_0x32ce5e=0xce;}_0xd6aa0[_0x8945('0x18')](_0x32ce5e);return _0xd6aa0[_0x8945('0x1e')](_0x8945('0x1f'),_0x4bd38f+'-'+_0x1fe38f+'/'+_0x308f54)[_0x8945('0x19')](_0x442241);}return null;};}function patchUpdates(_0x1738e1){return function(_0x234d63){try{jsonpatch[_0x8945('0x20')](_0x234d63,_0x1738e1,!![]);}catch(_0x453495){return BPromise['reject'](_0x453495);}return _0x234d63['save']();};}function saveUpdates(_0x501422,_0x5046b1){return function(_0x25ede5){if(_0x25ede5){return _0x25ede5[_0x8945('0x21')](_0x501422)[_0x8945('0x22')](function(_0x20833b){return _0x20833b;});}return null;};}function removeEntity(_0xfecf2a,_0x5e69c){return function(_0x31a7ec){if(_0x31a7ec){return _0x31a7ec['destroy']()[_0x8945('0x22')](function(){var _0x199b73=_0x31a7ec[_0x8945('0x23')]({'plain':!![]});var _0x2cc49b=_0x8945('0x24');return db[_0x8945('0x25')][_0x8945('0x26')]({'where':{'type':_0x2cc49b,'resourceId':_0x199b73['id']}})[_0x8945('0x22')](function(){return _0x31a7ec;});})[_0x8945('0x22')](function(){_0xfecf2a[_0x8945('0x18')](0xcc)[_0x8945('0x17')]();});}};}function handleEntityNotFound(_0x3ff1d6,_0x52523a){return function(_0x40f6c5){if(!_0x40f6c5){_0x3ff1d6['sendStatus'](0x194);}return _0x40f6c5;};}function handleError(_0x856136,_0x4afd08){_0x4afd08=_0x4afd08||0x1f4;return function(_0xd5f709){logger[_0x8945('0x27')](_0xd5f709[_0x8945('0x28')]);if(_0xd5f709[_0x8945('0x29')]){delete _0xd5f709['name'];}_0x856136[_0x8945('0x18')](_0x4afd08)[_0x8945('0x2a')](_0xd5f709);};}exports[_0x8945('0x2b')]=function(_0x3aa963,_0x476788){var _0x44d620={},_0x28fe7f={},_0x2d4d80={'count':0x0,'rows':[]};var _0x3a094b=_[_0x8945('0x2c')](db[_0x8945('0x2d')][_0x8945('0x2e')],function(_0x19090e){return{'name':_0x19090e['fieldName'],'type':_0x19090e['type']['key']};});_0x28fe7f[_0x8945('0x2f')]=_['map'](_0x3a094b,'name');_0x28fe7f[_0x8945('0x30')]=_[_0x8945('0x31')](_0x3aa963[_0x8945('0x30')]);_0x28fe7f['filters']=_[_0x8945('0x32')](_0x28fe7f[_0x8945('0x2f')],_0x28fe7f['query']);_0x44d620[_0x8945('0x33')]=_[_0x8945('0x32')](_0x28fe7f[_0x8945('0x2f')],qs['fields'](_0x3aa963['query']['fields']));_0x44d620[_0x8945('0x33')]=_0x44d620['attributes'][_0x8945('0x34')]?_0x44d620[_0x8945('0x33')]:_0x28fe7f[_0x8945('0x2f')];if(!_0x3aa963[_0x8945('0x30')][_0x8945('0x35')]('nolimit')){_0x44d620[_0x8945('0x1d')]=qs['limit'](_0x3aa963[_0x8945('0x30')][_0x8945('0x1d')]);_0x44d620[_0x8945('0x1b')]=qs[_0x8945('0x1b')](_0x3aa963['query'][_0x8945('0x1b')]);}_0x44d620[_0x8945('0x36')]=qs[_0x8945('0x37')](_0x3aa963[_0x8945('0x30')][_0x8945('0x37')]);_0x44d620[_0x8945('0x38')]=qs[_0x8945('0x39')](_[_0x8945('0x3a')](_0x3aa963[_0x8945('0x30')],_0x28fe7f[_0x8945('0x39')]),_0x3a094b);if(_0x3aa963[_0x8945('0x30')][_0x8945('0x3b')]){_0x44d620[_0x8945('0x38')]=_[_0x8945('0x3c')](_0x44d620[_0x8945('0x38')],{'$or':_[_0x8945('0x2c')](_0x3a094b,function(_0x2cdb2c){if(_0x2cdb2c[_0x8945('0x3d')]!=='VIRTUAL'){var _0xd61060={};_0xd61060[_0x2cdb2c['name']]={'$like':'%'+_0x3aa963[_0x8945('0x30')][_0x8945('0x3b')]+'%'};return _0xd61060;}})});}_0x44d620=_[_0x8945('0x3c')]({},_0x44d620,_0x3aa963[_0x8945('0x3e')]);var _0x55967d={'where':_0x44d620[_0x8945('0x38')]};return db[_0x8945('0x2d')]['count'](_0x55967d)[_0x8945('0x22')](function(_0x1530c4){_0x2d4d80[_0x8945('0x1c')]=_0x1530c4;if(_0x3aa963[_0x8945('0x30')][_0x8945('0x3f')]){_0x44d620['include']=[{'all':!![]}];}return db[_0x8945('0x2d')]['findAll'](_0x44d620);})[_0x8945('0x22')](function(_0x4b5de2){_0x2d4d80[_0x8945('0x40')]=_0x4b5de2;return _0x2d4d80;})[_0x8945('0x22')](respondWithFilteredResult(_0x476788,_0x44d620))[_0x8945('0x41')](handleError(_0x476788,null));};exports['show']=function(_0x2b5131,_0x1ca86e){var _0x29b26d={'raw':![],'where':{'id':_0x2b5131[_0x8945('0x42')]['id']}},_0x558b2c={};_0x558b2c[_0x8945('0x2f')]=_['keys'](db[_0x8945('0x2d')]['rawAttributes']);_0x558b2c['query']=_[_0x8945('0x31')](_0x2b5131[_0x8945('0x30')]);_0x558b2c[_0x8945('0x39')]=_['intersection'](_0x558b2c[_0x8945('0x2f')],_0x558b2c[_0x8945('0x30')]);_0x29b26d[_0x8945('0x33')]=_[_0x8945('0x32')](_0x558b2c[_0x8945('0x2f')],qs[_0x8945('0x43')](_0x2b5131['query'][_0x8945('0x43')]));_0x29b26d['attributes']=_0x29b26d[_0x8945('0x33')][_0x8945('0x34')]?_0x29b26d[_0x8945('0x33')]:_0x558b2c[_0x8945('0x2f')];if(_0x2b5131[_0x8945('0x30')]['includeAll']){_0x29b26d[_0x8945('0x44')]=[{'all':!![]}];}_0x29b26d=_['merge']({},_0x29b26d,_0x2b5131[_0x8945('0x3e')]);return db['JscriptyProject']['find'](_0x29b26d)[_0x8945('0x22')](handleEntityNotFound(_0x1ca86e,null))[_0x8945('0x22')](respondWithResult(_0x1ca86e,null))['catch'](handleError(_0x1ca86e,null));};exports[_0x8945('0x45')]=function(_0x1b9dbb,_0x4cb19c){return db[_0x8945('0x2d')]['create'](_0x1b9dbb['body'],{})[_0x8945('0x22')](function(_0x3b7c84){var _0x5c6867=_0x1b9dbb[_0x8945('0x46')]['get']({'plain':!![]});if(!_0x5c6867)throw new Error(_0x8945('0x47'));if(_0x5c6867[_0x8945('0x48')]==='user'){var _0x58180d=_0x3b7c84['get']({'plain':!![]});var _0x519be3=_0x8945('0x24');return db[_0x8945('0x49')]['find']({'where':{'name':_0x519be3,'userProfileId':_0x5c6867[_0x8945('0x4a')]},'raw':!![]})['then'](function(_0x597fe7){if(_0x597fe7&&_0x597fe7[_0x8945('0x4b')]===0x0){return db['UserProfileResource'][_0x8945('0x45')]({'name':_0x58180d['name'],'resourceId':_0x58180d['id'],'type':_0x597fe7[_0x8945('0x29')],'sectionId':_0x597fe7['id']},{})[_0x8945('0x22')](function(){return _0x3b7c84;});}else{return _0x3b7c84;}})['catch'](function(_0x100082){logger[_0x8945('0x27')](_0x8945('0x4c'),_0x100082);throw _0x100082;});}return _0x3b7c84;})[_0x8945('0x22')](respondWithResult(_0x4cb19c,0xc9))['catch'](handleError(_0x4cb19c,null));};exports[_0x8945('0x4d')]=function(_0x40edb1,_0x3fb10b){var _0x34fa85={'where':{'id':_0x40edb1['params']['id']}},_0x50403b={};_0x50403b[_0x8945('0x2f')]=_[_0x8945('0x31')](db[_0x8945('0x2d')][_0x8945('0x2e')]);_0x34fa85[_0x8945('0x33')]=_[_0x8945('0x32')](_0x50403b[_0x8945('0x2f')],qs[_0x8945('0x43')](_0x40edb1[_0x8945('0x30')]['fields']));_0x34fa85[_0x8945('0x33')]=_0x34fa85[_0x8945('0x33')][_0x8945('0x34')]?_0x34fa85['attributes']:_0x50403b[_0x8945('0x2f')];if(_0x40edb1[_0x8945('0x30')][_0x8945('0x3f')]){_0x34fa85[_0x8945('0x44')]=[{'all':!![]}];}_0x34fa85=_[_0x8945('0x3c')]({},_0x34fa85,_0x40edb1[_0x8945('0x3e')]);return db[_0x8945('0x2d')][_0x8945('0x4e')](_0x34fa85)[_0x8945('0x22')](handleEntityNotFound(_0x3fb10b,null))[_0x8945('0x22')](function(_0x211088){if(_0x211088){var _0x3f41a0=_0x211088['get']({'plain':!![]});_0x3f41a0=qs['omit'](_0x3f41a0,['id',_0x8945('0x4f'),_0x8945('0x50')]);_0x40edb1[_0x8945('0x51')]=_[_0x8945('0x52')](_0x40edb1[_0x8945('0x51')],['id',_0x8945('0x4f'),_0x8945('0x50')]);return db['JscriptyProject'][_0x8945('0x45')](_['merge'](_0x3f41a0,_0x40edb1['body']),{'include':_0x40edb1[_0x8945('0x30')][_0x8945('0x3f')]?[{'all':!![]}]:undefined})[_0x8945('0x22')](function(_0x59daad){var _0x1d01a7=_0x40edb1[_0x8945('0x46')][_0x8945('0x23')]({'plain':!![]});if(!_0x1d01a7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1d01a7['role']==='user'){var _0x36459a=_0x59daad['get']({'plain':!![]});var _0x446473='Projects';return db[_0x8945('0x49')][_0x8945('0x4e')]({'where':{'name':_0x446473,'userProfileId':_0x1d01a7['userProfileId']},'raw':!![]})[_0x8945('0x22')](function(_0x3f9100){if(_0x3f9100&&_0x3f9100[_0x8945('0x4b')]===0x0){return db['UserProfileResource'][_0x8945('0x45')]({'name':_0x36459a[_0x8945('0x29')],'resourceId':_0x36459a['id'],'type':_0x3f9100[_0x8945('0x29')],'sectionId':_0x3f9100['id']},{})[_0x8945('0x22')](function(){return _0x59daad;});}else{return _0x59daad;}})['catch'](function(_0x549ae9){logger['error'](_0x8945('0x4c'),_0x549ae9);throw _0x549ae9;});}return _0x59daad;});}})[_0x8945('0x22')](respondWithResult(_0x3fb10b,0xc9))['catch'](handleError(_0x3fb10b,null));};exports[_0x8945('0x21')]=function(_0x1c8e42,_0x1d8ca2){if(_0x1c8e42[_0x8945('0x51')]['id']){delete _0x1c8e42[_0x8945('0x51')]['id'];}return db[_0x8945('0x2d')][_0x8945('0x4e')]({'where':{'id':_0x1c8e42[_0x8945('0x42')]['id']}})['then'](handleEntityNotFound(_0x1d8ca2,null))[_0x8945('0x22')](saveUpdates(_0x1c8e42[_0x8945('0x51')],null))[_0x8945('0x22')](respondWithResult(_0x1d8ca2,null))['catch'](handleError(_0x1d8ca2,null));};exports[_0x8945('0x26')]=function(_0x321760,_0x34fced){return db[_0x8945('0x2d')][_0x8945('0x4e')]({'where':{'id':_0x321760[_0x8945('0x42')]['id']}})[_0x8945('0x22')](handleEntityNotFound(_0x34fced,null))[_0x8945('0x22')](removeEntity(_0x34fced,null))[_0x8945('0x41')](handleError(_0x34fced,null));};exports[_0x8945('0x53')]=function(_0x4361be,_0x254495,_0x1a7b4b){var _0x47fada={'raw':!![],'where':{}};var _0xd5a354={};var _0x59fa8c={'count':0x0,'rows':[]};return db[_0x8945('0x2d')][_0x8945('0x54')]({'where':{'id':_0x4361be['params']['id']}})[_0x8945('0x22')](handleEntityNotFound(_0x254495,null))['then'](function(_0x38591c){if(_0x38591c){_0xd5a354[_0x8945('0x2f')]=_[_0x8945('0x31')](db['JscriptySessionReport'][_0x8945('0x2e')]);_0xd5a354['query']=_[_0x8945('0x31')](_0x4361be[_0x8945('0x30')]);_0xd5a354[_0x8945('0x39')]=_['intersection'](_0xd5a354[_0x8945('0x2f')],_0xd5a354[_0x8945('0x30')]);_0x47fada[_0x8945('0x33')]=_[_0x8945('0x32')](_0xd5a354[_0x8945('0x2f')],qs[_0x8945('0x43')](_0x4361be[_0x8945('0x30')][_0x8945('0x43')]));_0x47fada[_0x8945('0x33')]=_0x47fada[_0x8945('0x33')]['length']?_0x47fada[_0x8945('0x33')]:_0xd5a354[_0x8945('0x2f')];if(!_0x4361be['query'][_0x8945('0x35')]('nolimit')){_0x47fada[_0x8945('0x1d')]=qs[_0x8945('0x1d')](_0x4361be[_0x8945('0x30')][_0x8945('0x1d')]);_0x47fada[_0x8945('0x1b')]=qs[_0x8945('0x1b')](_0x4361be[_0x8945('0x30')][_0x8945('0x1b')]);}_0x47fada[_0x8945('0x36')]=qs[_0x8945('0x37')](_0x4361be[_0x8945('0x30')][_0x8945('0x37')]);_0x47fada[_0x8945('0x38')]=qs['filters'](_['pick'](_0x4361be[_0x8945('0x30')],_0xd5a354[_0x8945('0x39')]));_0x47fada[_0x8945('0x38')][_0x8945('0x55')]=_0x38591c['id'];if(_0x4361be['query'][_0x8945('0x3b')]){_0x47fada['where']=_[_0x8945('0x3c')](_0x47fada[_0x8945('0x38')],{'$or':_[_0x8945('0x2c')](_0x47fada[_0x8945('0x33')],function(_0x525873){var _0x4e5352={};_0x4e5352[_0x525873]={'$like':'%'+_0x4361be['query'][_0x8945('0x3b')]+'%'};return _0x4e5352;})});}_0x47fada=_['merge']({},_0x47fada,_0x4361be['options']);return db[_0x8945('0x56')][_0x8945('0x1c')]({'where':_0x47fada[_0x8945('0x38')]})[_0x8945('0x22')](function(_0x1a5f02){_0x59fa8c[_0x8945('0x1c')]=_0x1a5f02;if(_0x4361be[_0x8945('0x30')]['includeAll']){_0x47fada['include']=[{'all':!![]}];}return db[_0x8945('0x56')][_0x8945('0x57')](_0x47fada);})[_0x8945('0x22')](function(_0x2ff258){_0x59fa8c[_0x8945('0x40')]=_0x2ff258;return _0x59fa8c;});}})[_0x8945('0x22')](respondWithFilteredResult(_0x254495,_0x47fada))['catch'](handleError(_0x254495,null));};exports['getAnswers']=function(_0x44ab35,_0x3fc18c,_0x2d3c4a){var _0x1f68e3={'raw':!![],'where':{}};var _0xf4048c={};var _0x44b1c0={'count':0x0,'rows':[]};return db[_0x8945('0x2d')][_0x8945('0x54')]({'where':{'id':_0x44ab35[_0x8945('0x42')]['id']}})['then'](handleEntityNotFound(_0x3fc18c,null))[_0x8945('0x22')](function(_0x50ca21){if(_0x50ca21){_0xf4048c[_0x8945('0x2f')]=_[_0x8945('0x31')](db[_0x8945('0x58')]['rawAttributes']);_0xf4048c['query']=_[_0x8945('0x31')](_0x44ab35['query']);_0xf4048c['filters']=_[_0x8945('0x32')](_0xf4048c[_0x8945('0x2f')],_0xf4048c[_0x8945('0x30')]);_0x1f68e3[_0x8945('0x33')]=_[_0x8945('0x32')](_0xf4048c[_0x8945('0x2f')],qs['fields'](_0x44ab35['query']['fields']));_0x1f68e3[_0x8945('0x33')]=_0x1f68e3['attributes']['length']?_0x1f68e3[_0x8945('0x33')]:_0xf4048c[_0x8945('0x2f')];if(!_0x44ab35[_0x8945('0x30')][_0x8945('0x35')](_0x8945('0x59'))){_0x1f68e3['limit']=qs[_0x8945('0x1d')](_0x44ab35[_0x8945('0x30')][_0x8945('0x1d')]);_0x1f68e3[_0x8945('0x1b')]=qs['offset'](_0x44ab35[_0x8945('0x30')][_0x8945('0x1b')]);}_0x1f68e3[_0x8945('0x36')]=qs[_0x8945('0x37')](_0x44ab35[_0x8945('0x30')][_0x8945('0x37')]);_0x1f68e3[_0x8945('0x38')]=qs[_0x8945('0x39')](_[_0x8945('0x3a')](_0x44ab35[_0x8945('0x30')],_0xf4048c[_0x8945('0x39')]));_0x1f68e3[_0x8945('0x38')]['ProjectId']=_0x50ca21['id'];if(_0x44ab35['query'][_0x8945('0x3b')]){_0x1f68e3[_0x8945('0x38')]=_[_0x8945('0x3c')](_0x1f68e3[_0x8945('0x38')],{'$or':_['map'](_0x1f68e3[_0x8945('0x33')],function(_0x12c529){var _0x97d106={};_0x97d106[_0x12c529]={'$like':'%'+_0x44ab35[_0x8945('0x30')][_0x8945('0x3b')]+'%'};return _0x97d106;})});}_0x1f68e3=_[_0x8945('0x3c')]({},_0x1f68e3,_0x44ab35['options']);return db[_0x8945('0x58')][_0x8945('0x1c')]({'where':_0x1f68e3[_0x8945('0x38')]})[_0x8945('0x22')](function(_0x51f154){_0x44b1c0['count']=_0x51f154;if(_0x44ab35[_0x8945('0x30')]['includeAll']){_0x1f68e3['include']=[{'all':!![]}];}return db[_0x8945('0x58')]['findAll'](_0x1f68e3);})[_0x8945('0x22')](function(_0x4d0327){_0x44b1c0[_0x8945('0x40')]=_0x4d0327;return _0x44b1c0;});}})['then'](respondWithFilteredResult(_0x3fc18c,_0x1f68e3))[_0x8945('0x41')](handleError(_0x3fc18c,null));};function char(_0xa4890b){return _0x8945('0x5a')===typeof _0xa4890b?String[_0x8945('0x5b')][_0x8945('0x20')](null,arguments):_0xa4890b;}function needsEncapsulation(_0x289d43){return!!_0x289d43&&(_0x289d43[_0x8945('0x5c')]()['indexOf'](char(0xd))>=0x0||_0x289d43['toString']()[_0x8945('0x5d')](char(0xa))>=0x0||_0x289d43[_0x8945('0x5c')]()['indexOf'](char(0x2c))>=0x0||_0x289d43[_0x8945('0x5c')]()[_0x8945('0x5d')](char(0x22))>=0x0);}function encapsulate(_0x2d7d2d){var _0x3b199f=char(0x22),_0x411988='\x5c'+char(0x22),_0x18adc2=_0x2d7d2d[_0x8945('0x5c')]()[_0x8945('0x5e')](new RegExp(_0x3b199f,'g'),_0x411988);return _0x3b199f+_0x18adc2+_0x3b199f;}exports[_0x8945('0x5f')]=function(_0x150b9d,_0x417690,_0x30d1f5){var _0x243708,_0x2c9c13;var _0xfa64ae={'where':{'ProjectId':_0x150b9d[_0x8945('0x42')]['id']}};if(_0x150b9d[_0x8945('0x30')]['startTime']){_0xfa64ae[_0x8945('0x38')][_0x8945('0x60')]=JSON[_0x8945('0x61')](_0x150b9d[_0x8945('0x30')][_0x8945('0x62')]);}return db[_0x8945('0x56')][_0x8945('0x57')](_0xfa64ae)[_0x8945('0x22')](handleEntityNotFound(_0x417690,null))[_0x8945('0x22')](function(_0x1efed2){if(_0x1efed2){_0x243708=_0x1efed2;return db[_0x8945('0x63')][_0x8945('0x57')]({'where':{'SessionId':{'$in':_[_0x8945('0x2c')](_0x243708,'id')},'ProjectId':_0x150b9d[_0x8945('0x42')]['id']},'order':_0x8945('0x64')});}})[_0x8945('0x22')](handleEntityNotFound(_0x417690,null))[_0x8945('0x22')](function(_0x584b9b){if(_0x584b9b){_0x2c9c13=_0x584b9b;var _0x2b7fc4={};for(var _0x59834e=0x0,_0x5581d0=_0x2c9c13[_0x8945('0x34')];_0x59834e<_0x5581d0;_0x59834e++){if(!_0x2b7fc4[_0x8945('0x35')](_0x2c9c13[_0x59834e]['questionId'])){_0x2b7fc4[_0x2c9c13[_0x59834e]['questionId']]=needsEncapsulation(_0x2c9c13[_0x59834e][_0x8945('0x65')])?encapsulate(_0x2c9c13[_0x59834e][_0x8945('0x65')]):_0x2c9c13[_0x59834e][_0x8945('0x65')];}}var _0x1e1ccd=[],_0x82fe1c={};for(var _0x165c6d=0x0,_0x404bba=_0x243708[_0x8945('0x34')];_0x165c6d<_0x404bba;_0x165c6d++){_0x82fe1c={'ProjectId':_0x150b9d[_0x8945('0x42')]['id'],'SessionId':_0x243708[_0x165c6d]['id'],'StartTime':moment(_0x243708[_0x165c6d]['starttime'])['format'](_0x8945('0x66'))};for(var _0x44cdb2=0x0,_0x3ee07a=_0x2c9c13[_0x8945('0x34')];_0x44cdb2<_0x3ee07a;_0x44cdb2++){if(_0x2c9c13[_0x44cdb2][_0x8945('0x67')]==_0x243708[_0x165c6d]['id']&&_0x2b7fc4['hasOwnProperty'](_0x2c9c13[_0x44cdb2]['questionId'])){_0x82fe1c[_0x2b7fc4[_0x2c9c13[_0x44cdb2]['questionId']]]=_0x2c9c13[_0x44cdb2]['answer'];}}for(var _0x2e07bb in _0x2b7fc4){if(!_0x82fe1c[_0x8945('0x35')](_0x2b7fc4[_0x2e07bb])){_0x82fe1c[_0x2b7fc4[_0x2e07bb]]=null;}}_0x1e1ccd[_0x8945('0x68')](_0x82fe1c);}return _0x1e1ccd;}})[_0x8945('0x22')](function(_0x82bcb7){if(!_[_0x8945('0x69')](_0x82bcb7)){var _0x1d3c73=toCsv(_0x82bcb7);var _0x2fa855=Date[_0x8945('0x6a')]();fs[_0x8945('0x6b')](util[_0x8945('0x6c')](_0x8945('0x6d'),_0x150b9d['params']['id'],_0x2fa855),_0x1d3c73);_0x417690[_0x8945('0x6e')](_0x8945('0x6f'),_0x8945('0x70')+util[_0x8945('0x6c')]('Jscripty_Project_%d_Summary_%s.csv',_0x150b9d[_0x8945('0x42')]['id'],_0x2fa855));_0x417690['setHeader'](_0x8945('0x71'),_0x8945('0x72'));return _0x417690[_0x8945('0x73')](util[_0x8945('0x6c')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x150b9d[_0x8945('0x42')]['id'],_0x2fa855));}else{return _0x417690[_0x8945('0x16')](0xcc);}})['catch'](handleError(_0x417690,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index e514443..35afd7f 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 _0xf569=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./jscriptyProject.attributes','JscriptyProject','jscripty_projects','util'];(function(_0x2cc60c,_0x35bac5){var _0x3acc8b=function(_0x32d239){while(--_0x32d239){_0x2cc60c['push'](_0x2cc60c['shift']());}};_0x3acc8b(++_0x35bac5);}(_0xf569,0xd0));var _0x9f56=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xf569[_0x5d2803];return _0xdcad2c;};'use strict';var _=require('lodash');var util=require(_0x9f56('0x0'));var logger=require(_0x9f56('0x1'))(_0x9f56('0x2'));var moment=require(_0x9f56('0x3'));var BPromise=require(_0x9f56('0x4'));var rp=require(_0x9f56('0x5'));var fs=require('fs');var path=require(_0x9f56('0x6'));var rimraf=require(_0x9f56('0x7'));var config=require('../../config/environment');var attributes=require(_0x9f56('0x8'));module['exports']=function(_0x467a46,_0x3488f2){return _0x467a46['define'](_0x9f56('0x9'),attributes,{'tableName':_0x9f56('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2e3b=['moment','bluebird','request-promise','path','rimraf','./jscriptyProject.attributes','exports','define','jscripty_projects','util','../../config/logger','api'];(function(_0x460ef7,_0x1308d7){var _0x58b122=function(_0x564b12){while(--_0x564b12){_0x460ef7['push'](_0x460ef7['shift']());}};_0x58b122(++_0x1308d7);}(_0x2e3b,0x81));var _0xb2e3=function(_0x1c8fd4,_0x2a9eca){_0x1c8fd4=_0x1c8fd4-0x0;var _0x4a8221=_0x2e3b[_0x1c8fd4];return _0x4a8221;};'use strict';var _=require('lodash');var util=require(_0xb2e3('0x0'));var logger=require(_0xb2e3('0x1'))(_0xb2e3('0x2'));var moment=require(_0xb2e3('0x3'));var BPromise=require(_0xb2e3('0x4'));var rp=require(_0xb2e3('0x5'));var fs=require('fs');var path=require(_0xb2e3('0x6'));var rimraf=require(_0xb2e3('0x7'));var config=require('../../config/environment');var attributes=require(_0xb2e3('0x8'));module[_0xb2e3('0x9')]=function(_0x4eec77,_0x41ec29){return _0x4eec77[_0xb2e3('0xa')]('JscriptyProject',attributes,{'tableName':_0xb2e3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index 540c73a..caa8b45 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(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x5465e6,_0x2a8809){_0x5465e6=_0x5465e6-0x0;var _0x10044e=_0xbdb7[_0x5465e6];return _0x10044e;};'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 _0x54ef=['result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0xbd9f65,_0x487895){var _0x58e439=function(_0x12f05b){while(--_0x12f05b){_0xbd9f65['push'](_0xbd9f65['shift']());}};_0x58e439(++_0x487895);}(_0x54ef,0x112));var _0xf54e=function(_0x1a8a02,_0x209d87){_0x1a8a02=_0x1a8a02-0x0;var _0x18500d=_0x54ef[_0x1a8a02];return _0x18500d;};'use strict';var _=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var moment=require(_0xf54e('0x2'));var BPromise=require('bluebird');var rs=require(_0xf54e('0x3'));var fs=require('fs');var Redis=require(_0xf54e('0x4'));var db=require(_0xf54e('0x5'))['db'];var utils=require(_0xf54e('0x6'));var logger=require(_0xf54e('0x7'))(_0xf54e('0x8'));var config=require(_0xf54e('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf54e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x99cf9,_0x2464ae,_0x561870){return new BPromise(function(_0x27e69b,_0x57a1ce){return client[_0xf54e('0xb')](_0x99cf9,_0x561870)[_0xf54e('0xc')](function(_0x47c5e1){logger[_0xf54e('0xd')](_0xf54e('0xe'),_0x2464ae,_0xf54e('0xf'));logger[_0xf54e('0x10')]('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x2464ae,_0xf54e('0xf'),JSON[_0xf54e('0x11')](_0x47c5e1));if(_0x47c5e1[_0xf54e('0x12')]){if(_0x47c5e1[_0xf54e('0x12')]['code']===0x1f4){logger[_0xf54e('0x12')]('JscriptyProject,\x20%s,\x20%s',_0x2464ae,_0x47c5e1['error'][_0xf54e('0x13')]);return _0x57a1ce(_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);}logger[_0xf54e('0x12')]('JscriptyProject,\x20%s,\x20%s',_0x2464ae,_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);return _0x27e69b(_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);}else{logger['info'](_0xf54e('0xe'),_0x2464ae,_0xf54e('0xf'));_0x27e69b(_0x47c5e1[_0xf54e('0x14')]['message']);}})['catch'](function(_0xd87020){logger[_0xf54e('0x12')](_0xf54e('0xe'),_0x2464ae,_0xd87020);_0x57a1ce(_0xd87020);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 7376227..f3b57c4 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 _0x319f=['connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','/describe','isAuthenticated','describe','/:id','show','post','put','delete','exports','multer','util','path'];(function(_0x3f468d,_0x21b70b){var _0x1834c1=function(_0x52e0ca){while(--_0x52e0ca){_0x3f468d['push'](_0x3f468d['shift']());}};_0x1834c1(++_0x21b70b);}(_0x319f,0x12d));var _0xf319=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x319f[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0xf319('0x0'));var util=require(_0xf319('0x1'));var path=require(_0xf319('0x2'));var timeout=require(_0xf319('0x3'));var express=require('express');var router=express[_0xf319('0x4')]();var fs_extra=require(_0xf319('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf319('0x6'));var config=require(_0xf319('0x7'));var controller=require(_0xf319('0x8'));router[_0xf319('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xf319('0xa'),auth[_0xf319('0xb')](),controller[_0xf319('0xc')]);router[_0xf319('0x9')](_0xf319('0xd'),auth[_0xf319('0xb')](),controller[_0xf319('0xe')]);router[_0xf319('0xf')]('/',auth[_0xf319('0xb')](),controller['create']);router[_0xf319('0x10')](_0xf319('0xd'),auth[_0xf319('0xb')](),controller['update']);router[_0xf319('0x11')](_0xf319('0xd'),auth[_0xf319('0xb')](),controller['destroy']);module[_0xf319('0x12')]=router; \ No newline at end of file +var _0xe9a2=['Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','delete','exports','multer','util','path'];(function(_0x42ad72,_0x36989c){var _0x36ddbd=function(_0x59e627){while(--_0x59e627){_0x42ad72['push'](_0x42ad72['shift']());}};_0x36ddbd(++_0x36989c);}(_0xe9a2,0x1c5));var _0x2e9a=function(_0x14e57f,_0x45bd6d){_0x14e57f=_0x14e57f-0x0;var _0xb21b19=_0xe9a2[_0x14e57f];return _0xb21b19;};'use strict';var multer=require(_0x2e9a('0x0'));var util=require(_0x2e9a('0x1'));var path=require(_0x2e9a('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2e9a('0x3')]();var fs_extra=require(_0x2e9a('0x4'));var auth=require(_0x2e9a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2e9a('0x6'));var controller=require('./jscriptyQuestionReport.controller');router[_0x2e9a('0x7')]('/',auth[_0x2e9a('0x8')](),controller['index']);router[_0x2e9a('0x7')](_0x2e9a('0x9'),auth[_0x2e9a('0x8')](),controller[_0x2e9a('0xa')]);router[_0x2e9a('0x7')](_0x2e9a('0xb'),auth[_0x2e9a('0x8')](),controller[_0x2e9a('0xc')]);router[_0x2e9a('0xd')]('/',auth[_0x2e9a('0x8')](),controller[_0x2e9a('0xe')]);router[_0x2e9a('0xf')]('/:id',auth[_0x2e9a('0x8')](),controller[_0x2e9a('0x10')]);router[_0x2e9a('0x11')](_0x2e9a('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x2e9a('0x12')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 824ba1a..e6c519c 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(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x7a54,0x106));var _0x47a5=function(_0x2d7581,_0x1c4fc3){_0x2d7581=_0x2d7581-0x0;var _0x57215b=_0x7a54[_0x2d7581];return _0x57215b;};'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(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x7a54,0x106));var _0x47a5=function(_0x391c95,_0x32a99a){_0x391c95=_0x391c95-0x0;var _0xb6541=_0x7a54[_0x391c95];return _0xb6541;};'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 0bde60f..9221184 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 _0x06bc=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','merge','VIRTUAL','JscriptyQuestionReport','includeAll','include','rows','catch','show','params','keys','options','find','create','body','destroy','describe','eml-format','rimraf','request-promise','moment','mustache','util','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils'];(function(_0x38bcc9,_0x22aa31){var _0x3b0582=function(_0x3eb37c){while(--_0x3eb37c){_0x38bcc9['push'](_0x38bcc9['shift']());}};_0x3b0582(++_0x22aa31);}(_0x06bc,0xc6));var _0xc06b=function(_0x8cf7ac,_0x5123bc){_0x8cf7ac=_0x8cf7ac-0x0;var _0x2b6545=_0x06bc[_0x8cf7ac];return _0x2b6545;};'use strict';var emlformat=require(_0xc06b('0x0'));var rimraf=require(_0xc06b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc06b('0x2'));var moment=require(_0xc06b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc06b('0x4'));var util=require(_0xc06b('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xc06b('0x6'));var ejs=require(_0xc06b('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc06b('0x8'));var squel=require(_0xc06b('0x9'));var crypto=require(_0xc06b('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xc06b('0xb'));var toCsv=require(_0xc06b('0x6'));var querystring=require(_0xc06b('0xc'));var Papa=require(_0xc06b('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc06b('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc06b('0xf'))(_0xc06b('0x10'));var utils=require(_0xc06b('0x11'));var config=require(_0xc06b('0x12'));var licenseUtil=require(_0xc06b('0x13'));var db=require(_0xc06b('0x14'))['db'];function respondWithStatusCode(_0x24026f,_0xc568a4){_0xc568a4=_0xc568a4||0xcc;return function(_0x10cb22){if(_0x10cb22){return _0x24026f[_0xc06b('0x15')](_0xc568a4);}return _0x24026f[_0xc06b('0x16')](_0xc568a4)[_0xc06b('0x17')]();};}function respondWithResult(_0x42fceb,_0x1a06ae){_0x1a06ae=_0x1a06ae||0xc8;return function(_0x48ad7f){if(_0x48ad7f){return _0x42fceb[_0xc06b('0x16')](_0x1a06ae)['json'](_0x48ad7f);}};}function respondWithFilteredResult(_0x154436,_0x55d012){return function(_0x15d580){if(_0x15d580){var _0x34a049=typeof _0x55d012[_0xc06b('0x18')]===_0xc06b('0x19')&&typeof _0x55d012[_0xc06b('0x1a')]==='undefined';var _0x39b6d9=_0x15d580[_0xc06b('0x1b')];var _0x1839ba=_0x34a049?0x0:_0x55d012[_0xc06b('0x18')];var _0x4bdf5c=_0x34a049?_0x15d580[_0xc06b('0x1b')]:_0x55d012[_0xc06b('0x18')]+_0x55d012[_0xc06b('0x1a')];var _0x9fc620;if(_0x4bdf5c>=_0x39b6d9){_0x4bdf5c=_0x39b6d9;_0x9fc620=0xc8;}else{_0x9fc620=0xce;}_0x154436[_0xc06b('0x16')](_0x9fc620);return _0x154436[_0xc06b('0x1c')](_0xc06b('0x1d'),_0x1839ba+'-'+_0x4bdf5c+'/'+_0x39b6d9)[_0xc06b('0x1e')](_0x15d580);}return null;};}function patchUpdates(_0x85d351){return function(_0x25f45b){try{jsonpatch['apply'](_0x25f45b,_0x85d351,!![]);}catch(_0x2c46f4){return BPromise[_0xc06b('0x1f')](_0x2c46f4);}return _0x25f45b[_0xc06b('0x20')]();};}function saveUpdates(_0x33c3ce,_0xde8396){return function(_0x573ff3){if(_0x573ff3){return _0x573ff3[_0xc06b('0x21')](_0x33c3ce)[_0xc06b('0x22')](function(_0x2fcd98){return _0x2fcd98;});}return null;};}function removeEntity(_0x18b91d,_0xc61b6e){return function(_0x3adba8){if(_0x3adba8){return _0x3adba8['destroy']()[_0xc06b('0x22')](function(){_0x18b91d[_0xc06b('0x16')](0xcc)[_0xc06b('0x17')]();});}};}function handleEntityNotFound(_0x324f9e,_0x11868d){return function(_0x3b0e98){if(!_0x3b0e98){_0x324f9e[_0xc06b('0x15')](0x194);}return _0x3b0e98;};}function handleError(_0x1e7ab4,_0x4eafa3){_0x4eafa3=_0x4eafa3||0x1f4;return function(_0x21f526){logger[_0xc06b('0x23')](_0x21f526['stack']);if(_0x21f526['name']){delete _0x21f526[_0xc06b('0x24')];}_0x1e7ab4['status'](_0x4eafa3)[_0xc06b('0x25')](_0x21f526);};}exports[_0xc06b('0x26')]=function(_0x2545b7,_0x4e2ef2){var _0x4ab567={},_0x46c237={},_0x15c5b1={'count':0x0,'rows':[]};var _0x566c27=_[_0xc06b('0x27')](db['JscriptyQuestionReport'][_0xc06b('0x28')],function(_0xda7e9f){return{'name':_0xda7e9f[_0xc06b('0x29')],'type':_0xda7e9f[_0xc06b('0x2a')][_0xc06b('0x2b')]};});_0x46c237[_0xc06b('0x2c')]=_['map'](_0x566c27,_0xc06b('0x24'));_0x46c237[_0xc06b('0x2d')]=_['keys'](_0x2545b7[_0xc06b('0x2d')]);_0x46c237[_0xc06b('0x2e')]=_[_0xc06b('0x2f')](_0x46c237['model'],_0x46c237['query']);_0x4ab567['attributes']=_[_0xc06b('0x2f')](_0x46c237[_0xc06b('0x2c')],qs['fields'](_0x2545b7['query'][_0xc06b('0x30')]));_0x4ab567[_0xc06b('0x31')]=_0x4ab567[_0xc06b('0x31')][_0xc06b('0x32')]?_0x4ab567[_0xc06b('0x31')]:_0x46c237['model'];if(!_0x2545b7[_0xc06b('0x2d')]['hasOwnProperty'](_0xc06b('0x33'))){_0x4ab567[_0xc06b('0x1a')]=qs['limit'](_0x2545b7[_0xc06b('0x2d')]['limit']);_0x4ab567[_0xc06b('0x18')]=qs[_0xc06b('0x18')](_0x2545b7[_0xc06b('0x2d')][_0xc06b('0x18')]);}_0x4ab567[_0xc06b('0x34')]=qs['sort'](_0x2545b7[_0xc06b('0x2d')][_0xc06b('0x35')]);_0x4ab567[_0xc06b('0x36')]=qs['filters'](_['pick'](_0x2545b7[_0xc06b('0x2d')],_0x46c237['filters']),_0x566c27);if(_0x2545b7['query'][_0xc06b('0x37')]){_0x4ab567[_0xc06b('0x36')]=_[_0xc06b('0x38')](_0x4ab567[_0xc06b('0x36')],{'$or':_[_0xc06b('0x27')](_0x566c27,function(_0x3e4c98){if(_0x3e4c98['type']!==_0xc06b('0x39')){var _0x3e57a7={};_0x3e57a7[_0x3e4c98['name']]={'$like':'%'+_0x2545b7['query'][_0xc06b('0x37')]+'%'};return _0x3e57a7;}})});}_0x4ab567=_[_0xc06b('0x38')]({},_0x4ab567,_0x2545b7['options']);var _0x123517={'where':_0x4ab567['where']};return db[_0xc06b('0x3a')][_0xc06b('0x1b')](_0x123517)[_0xc06b('0x22')](function(_0x50f0b2){_0x15c5b1[_0xc06b('0x1b')]=_0x50f0b2;if(_0x2545b7['query'][_0xc06b('0x3b')]){_0x4ab567[_0xc06b('0x3c')]=[{'all':!![]}];}return db['JscriptyQuestionReport']['findAll'](_0x4ab567);})[_0xc06b('0x22')](function(_0x1e4ec7){_0x15c5b1[_0xc06b('0x3d')]=_0x1e4ec7;return _0x15c5b1;})['then'](respondWithFilteredResult(_0x4e2ef2,_0x4ab567))[_0xc06b('0x3e')](handleError(_0x4e2ef2,null));};exports[_0xc06b('0x3f')]=function(_0x4d4c2b,_0x2dcac9){var _0x11ff5e={'raw':!![],'where':{'id':_0x4d4c2b[_0xc06b('0x40')]['id']}},_0x10c997={};_0x10c997['model']=_[_0xc06b('0x41')](db[_0xc06b('0x3a')][_0xc06b('0x28')]);_0x10c997[_0xc06b('0x2d')]=_[_0xc06b('0x41')](_0x4d4c2b[_0xc06b('0x2d')]);_0x10c997[_0xc06b('0x2e')]=_[_0xc06b('0x2f')](_0x10c997[_0xc06b('0x2c')],_0x10c997[_0xc06b('0x2d')]);_0x11ff5e['attributes']=_[_0xc06b('0x2f')](_0x10c997[_0xc06b('0x2c')],qs[_0xc06b('0x30')](_0x4d4c2b[_0xc06b('0x2d')][_0xc06b('0x30')]));_0x11ff5e['attributes']=_0x11ff5e[_0xc06b('0x31')][_0xc06b('0x32')]?_0x11ff5e[_0xc06b('0x31')]:_0x10c997[_0xc06b('0x2c')];if(_0x4d4c2b[_0xc06b('0x2d')][_0xc06b('0x3b')]){_0x11ff5e[_0xc06b('0x3c')]=[{'all':!![]}];}_0x11ff5e=_[_0xc06b('0x38')]({},_0x11ff5e,_0x4d4c2b[_0xc06b('0x42')]);return db[_0xc06b('0x3a')][_0xc06b('0x43')](_0x11ff5e)[_0xc06b('0x22')](handleEntityNotFound(_0x2dcac9,null))[_0xc06b('0x22')](respondWithResult(_0x2dcac9,null))[_0xc06b('0x3e')](handleError(_0x2dcac9,null));};exports[_0xc06b('0x44')]=function(_0x28e58d,_0x1cb841){return db['JscriptyQuestionReport']['create'](_0x28e58d['body'],{})['then'](respondWithResult(_0x1cb841,0xc9))[_0xc06b('0x3e')](handleError(_0x1cb841,null));};exports['update']=function(_0x207e90,_0x323bac){if(_0x207e90[_0xc06b('0x45')]['id']){delete _0x207e90['body']['id'];}return db[_0xc06b('0x3a')][_0xc06b('0x43')]({'where':{'id':_0x207e90[_0xc06b('0x40')]['id']}})[_0xc06b('0x22')](handleEntityNotFound(_0x323bac,null))[_0xc06b('0x22')](saveUpdates(_0x207e90['body'],null))['then'](respondWithResult(_0x323bac,null))[_0xc06b('0x3e')](handleError(_0x323bac,null));};exports[_0xc06b('0x46')]=function(_0x19d8b4,_0xadba7b){return db['JscriptyQuestionReport'][_0xc06b('0x43')]({'where':{'id':_0x19d8b4[_0xc06b('0x40')]['id']}})[_0xc06b('0x22')](handleEntityNotFound(_0xadba7b,null))[_0xc06b('0x22')](removeEntity(_0xadba7b,null))[_0xc06b('0x3e')](handleError(_0xadba7b,null));};exports[_0xc06b('0x47')]=function(_0x2234e9,_0x307091){return db[_0xc06b('0x3a')][_0xc06b('0x47')]()[_0xc06b('0x22')](respondWithResult(_0x307091,null))[_0xc06b('0x3e')](handleError(_0x307091,null));}; \ No newline at end of file +var _0xa7d5=['fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','update','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','then','error','stack','name','send','index','map','JscriptyQuestionReport','rawAttributes'];(function(_0xe5f4da,_0x39ee72){var _0x222b72=function(_0x2d3f21){while(--_0x2d3f21){_0xe5f4da['push'](_0xe5f4da['shift']());}};_0x222b72(++_0x39ee72);}(_0xa7d5,0xba));var _0x5a7d=function(_0x458aa2,_0x2cc770){_0x458aa2=_0x458aa2-0x0;var _0x60b0a9=_0xa7d5[_0x458aa2];return _0x60b0a9;};'use strict';var emlformat=require(_0x5a7d('0x0'));var rimraf=require(_0x5a7d('0x1'));var zipdir=require(_0x5a7d('0x2'));var jsonpatch=require(_0x5a7d('0x3'));var rp=require(_0x5a7d('0x4'));var moment=require(_0x5a7d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5a7d('0x6'));var util=require(_0x5a7d('0x7'));var path=require(_0x5a7d('0x8'));var sox=require(_0x5a7d('0x9'));var csv=require('to-csv');var ejs=require(_0x5a7d('0xa'));var fs=require('fs');var fs_extra=require(_0x5a7d('0xb'));var _=require(_0x5a7d('0xc'));var squel=require(_0x5a7d('0xd'));var crypto=require('crypto');var jsforce=require(_0x5a7d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5a7d('0xf'));var querystring=require('querystring');var Papa=require(_0x5a7d('0x10'));var Redis=require(_0x5a7d('0x11'));var authService=require(_0x5a7d('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5a7d('0x13'));var hardwareService=require(_0x5a7d('0x14'));var logger=require(_0x5a7d('0x15'))(_0x5a7d('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5a7d('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x25ee36,_0x382613){_0x382613=_0x382613||0xcc;return function(_0x17f912){if(_0x17f912){return _0x25ee36[_0x5a7d('0x18')](_0x382613);}return _0x25ee36[_0x5a7d('0x19')](_0x382613)[_0x5a7d('0x1a')]();};}function respondWithResult(_0x323973,_0x1c5ed6){_0x1c5ed6=_0x1c5ed6||0xc8;return function(_0x1b1e81){if(_0x1b1e81){return _0x323973['status'](_0x1c5ed6)[_0x5a7d('0x1b')](_0x1b1e81);}};}function respondWithFilteredResult(_0x4d3d04,_0x2ec7a6){return function(_0x3f0b3a){if(_0x3f0b3a){var _0x402194=typeof _0x2ec7a6[_0x5a7d('0x1c')]==='undefined'&&typeof _0x2ec7a6[_0x5a7d('0x1d')]===_0x5a7d('0x1e');var _0x54eb14=_0x3f0b3a['count'];var _0x2cb98c=_0x402194?0x0:_0x2ec7a6['offset'];var _0x4acf73=_0x402194?_0x3f0b3a[_0x5a7d('0x1f')]:_0x2ec7a6[_0x5a7d('0x1c')]+_0x2ec7a6[_0x5a7d('0x1d')];var _0x299d66;if(_0x4acf73>=_0x54eb14){_0x4acf73=_0x54eb14;_0x299d66=0xc8;}else{_0x299d66=0xce;}_0x4d3d04[_0x5a7d('0x19')](_0x299d66);return _0x4d3d04[_0x5a7d('0x20')](_0x5a7d('0x21'),_0x2cb98c+'-'+_0x4acf73+'/'+_0x54eb14)[_0x5a7d('0x1b')](_0x3f0b3a);}return null;};}function patchUpdates(_0x36adec){return function(_0x112e33){try{jsonpatch[_0x5a7d('0x22')](_0x112e33,_0x36adec,!![]);}catch(_0x24ac5b){return BPromise[_0x5a7d('0x23')](_0x24ac5b);}return _0x112e33['save']();};}function saveUpdates(_0x4c89d9,_0x56426e){return function(_0x1a3c04){if(_0x1a3c04){return _0x1a3c04['update'](_0x4c89d9)[_0x5a7d('0x24')](function(_0x54bb1e){return _0x54bb1e;});}return null;};}function removeEntity(_0x925ebe,_0x125b28){return function(_0x1fbd53){if(_0x1fbd53){return _0x1fbd53['destroy']()[_0x5a7d('0x24')](function(){_0x925ebe['status'](0xcc)[_0x5a7d('0x1a')]();});}};}function handleEntityNotFound(_0x3faffb,_0x47b25c){return function(_0x1714eb){if(!_0x1714eb){_0x3faffb[_0x5a7d('0x18')](0x194);}return _0x1714eb;};}function handleError(_0x4c6f2d,_0x26db78){_0x26db78=_0x26db78||0x1f4;return function(_0x58c21e){logger[_0x5a7d('0x25')](_0x58c21e[_0x5a7d('0x26')]);if(_0x58c21e[_0x5a7d('0x27')]){delete _0x58c21e[_0x5a7d('0x27')];}_0x4c6f2d[_0x5a7d('0x19')](_0x26db78)[_0x5a7d('0x28')](_0x58c21e);};}exports[_0x5a7d('0x29')]=function(_0x57723e,_0x1e3e20){var _0x21cf42={},_0x4bc9e4={},_0xb2a49b={'count':0x0,'rows':[]};var _0x1c9605=_[_0x5a7d('0x2a')](db[_0x5a7d('0x2b')][_0x5a7d('0x2c')],function(_0x5da776){return{'name':_0x5da776[_0x5a7d('0x2d')],'type':_0x5da776['type']['key']};});_0x4bc9e4[_0x5a7d('0x2e')]=_[_0x5a7d('0x2a')](_0x1c9605,_0x5a7d('0x27'));_0x4bc9e4[_0x5a7d('0x2f')]=_[_0x5a7d('0x30')](_0x57723e[_0x5a7d('0x2f')]);_0x4bc9e4[_0x5a7d('0x31')]=_[_0x5a7d('0x32')](_0x4bc9e4[_0x5a7d('0x2e')],_0x4bc9e4[_0x5a7d('0x2f')]);_0x21cf42[_0x5a7d('0x33')]=_['intersection'](_0x4bc9e4[_0x5a7d('0x2e')],qs['fields'](_0x57723e[_0x5a7d('0x2f')][_0x5a7d('0x34')]));_0x21cf42['attributes']=_0x21cf42[_0x5a7d('0x33')][_0x5a7d('0x35')]?_0x21cf42['attributes']:_0x4bc9e4[_0x5a7d('0x2e')];if(!_0x57723e['query'][_0x5a7d('0x36')](_0x5a7d('0x37'))){_0x21cf42[_0x5a7d('0x1d')]=qs[_0x5a7d('0x1d')](_0x57723e['query'][_0x5a7d('0x1d')]);_0x21cf42[_0x5a7d('0x1c')]=qs[_0x5a7d('0x1c')](_0x57723e['query']['offset']);}_0x21cf42['order']=qs[_0x5a7d('0x38')](_0x57723e['query'][_0x5a7d('0x38')]);_0x21cf42[_0x5a7d('0x39')]=qs[_0x5a7d('0x31')](_[_0x5a7d('0x3a')](_0x57723e[_0x5a7d('0x2f')],_0x4bc9e4['filters']),_0x1c9605);if(_0x57723e[_0x5a7d('0x2f')][_0x5a7d('0x3b')]){_0x21cf42[_0x5a7d('0x39')]=_[_0x5a7d('0x3c')](_0x21cf42[_0x5a7d('0x39')],{'$or':_[_0x5a7d('0x2a')](_0x1c9605,function(_0x1cd381){if(_0x1cd381[_0x5a7d('0x3d')]!==_0x5a7d('0x3e')){var _0x4cf733={};_0x4cf733[_0x1cd381[_0x5a7d('0x27')]]={'$like':'%'+_0x57723e[_0x5a7d('0x2f')][_0x5a7d('0x3b')]+'%'};return _0x4cf733;}})});}_0x21cf42=_[_0x5a7d('0x3c')]({},_0x21cf42,_0x57723e['options']);var _0x471fe5={'where':_0x21cf42['where']};return db['JscriptyQuestionReport']['count'](_0x471fe5)['then'](function(_0x378c88){_0xb2a49b[_0x5a7d('0x1f')]=_0x378c88;if(_0x57723e[_0x5a7d('0x2f')][_0x5a7d('0x3f')]){_0x21cf42[_0x5a7d('0x40')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x5a7d('0x41')](_0x21cf42);})[_0x5a7d('0x24')](function(_0x223754){_0xb2a49b[_0x5a7d('0x42')]=_0x223754;return _0xb2a49b;})[_0x5a7d('0x24')](respondWithFilteredResult(_0x1e3e20,_0x21cf42))[_0x5a7d('0x43')](handleError(_0x1e3e20,null));};exports[_0x5a7d('0x44')]=function(_0x406a01,_0x4d0ec0){var _0x9ac7f4={'raw':!![],'where':{'id':_0x406a01[_0x5a7d('0x45')]['id']}},_0x5a73e3={};_0x5a73e3['model']=_[_0x5a7d('0x30')](db[_0x5a7d('0x2b')][_0x5a7d('0x2c')]);_0x5a73e3['query']=_[_0x5a7d('0x30')](_0x406a01['query']);_0x5a73e3[_0x5a7d('0x31')]=_[_0x5a7d('0x32')](_0x5a73e3[_0x5a7d('0x2e')],_0x5a73e3['query']);_0x9ac7f4[_0x5a7d('0x33')]=_[_0x5a7d('0x32')](_0x5a73e3[_0x5a7d('0x2e')],qs[_0x5a7d('0x34')](_0x406a01[_0x5a7d('0x2f')][_0x5a7d('0x34')]));_0x9ac7f4[_0x5a7d('0x33')]=_0x9ac7f4[_0x5a7d('0x33')][_0x5a7d('0x35')]?_0x9ac7f4[_0x5a7d('0x33')]:_0x5a73e3[_0x5a7d('0x2e')];if(_0x406a01['query'][_0x5a7d('0x3f')]){_0x9ac7f4[_0x5a7d('0x40')]=[{'all':!![]}];}_0x9ac7f4=_[_0x5a7d('0x3c')]({},_0x9ac7f4,_0x406a01[_0x5a7d('0x46')]);return db[_0x5a7d('0x2b')][_0x5a7d('0x47')](_0x9ac7f4)[_0x5a7d('0x24')](handleEntityNotFound(_0x4d0ec0,null))[_0x5a7d('0x24')](respondWithResult(_0x4d0ec0,null))[_0x5a7d('0x43')](handleError(_0x4d0ec0,null));};exports['create']=function(_0x3d937a,_0x4bc393){return db[_0x5a7d('0x2b')][_0x5a7d('0x48')](_0x3d937a[_0x5a7d('0x49')],{})['then'](respondWithResult(_0x4bc393,0xc9))[_0x5a7d('0x43')](handleError(_0x4bc393,null));};exports[_0x5a7d('0x4a')]=function(_0x506c6b,_0x55dd6d){if(_0x506c6b[_0x5a7d('0x49')]['id']){delete _0x506c6b[_0x5a7d('0x49')]['id'];}return db[_0x5a7d('0x2b')]['find']({'where':{'id':_0x506c6b[_0x5a7d('0x45')]['id']}})[_0x5a7d('0x24')](handleEntityNotFound(_0x55dd6d,null))['then'](saveUpdates(_0x506c6b['body'],null))[_0x5a7d('0x24')](respondWithResult(_0x55dd6d,null))[_0x5a7d('0x43')](handleError(_0x55dd6d,null));};exports[_0x5a7d('0x4b')]=function(_0x59662c,_0x2fa6df){return db[_0x5a7d('0x2b')][_0x5a7d('0x47')]({'where':{'id':_0x59662c[_0x5a7d('0x45')]['id']}})[_0x5a7d('0x24')](handleEntityNotFound(_0x2fa6df,null))[_0x5a7d('0x24')](removeEntity(_0x2fa6df,null))[_0x5a7d('0x43')](handleError(_0x2fa6df,null));};exports[_0x5a7d('0x4c')]=function(_0x5b90c4,_0x3c16e7){return db[_0x5a7d('0x2b')][_0x5a7d('0x4c')]()['then'](respondWithResult(_0x3c16e7,null))[_0x5a7d('0x43')](handleError(_0x3c16e7,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 1d2f01e..fb48fa9 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 _0xab70=['lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','define','JscriptyQuestionReport','report_jscripty_questions'];(function(_0x421cf8,_0x23152c){var _0x145c48=function(_0x565862){while(--_0x565862){_0x421cf8['push'](_0x421cf8['shift']());}};_0x145c48(++_0x23152c);}(_0xab70,0x78));var _0x0ab7=function(_0x46c17e,_0x2c1903){_0x46c17e=_0x46c17e-0x0;var _0x1a3e9e=_0xab70[_0x46c17e];return _0x1a3e9e;};'use strict';var _=require(_0x0ab7('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0ab7('0x1'));var moment=require(_0x0ab7('0x2'));var BPromise=require(_0x0ab7('0x3'));var rp=require(_0x0ab7('0x4'));var fs=require('fs');var path=require(_0x0ab7('0x5'));var rimraf=require(_0x0ab7('0x6'));var config=require(_0x0ab7('0x7'));var attributes=require(_0x0ab7('0x8'));module['exports']=function(_0x125ad1,_0x1b9874){return _0x125ad1[_0x0ab7('0x9')](_0x0ab7('0xa'),attributes,{'tableName':_0x0ab7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcc3f=['../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions','lodash','util','../../config/logger','bluebird','request-promise','rimraf'];(function(_0x2e75c8,_0x43557b){var _0x4ebdd0=function(_0x308628){while(--_0x308628){_0x2e75c8['push'](_0x2e75c8['shift']());}};_0x4ebdd0(++_0x43557b);}(_0xcc3f,0x11a));var _0xfcc3=function(_0x5766f2,_0x3c69c9){_0x5766f2=_0x5766f2-0x0;var _0x1e24ea=_0xcc3f[_0x5766f2];return _0x1e24ea;};'use strict';var _=require(_0xfcc3('0x0'));var util=require(_0xfcc3('0x1'));var logger=require(_0xfcc3('0x2'))('api');var moment=require('moment');var BPromise=require(_0xfcc3('0x3'));var rp=require(_0xfcc3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfcc3('0x5'));var config=require(_0xfcc3('0x6'));var attributes=require(_0xfcc3('0x7'));module[_0xfcc3('0x8')]=function(_0x12dcb3,_0xd2cc89){return _0x12dcb3[_0xfcc3('0x9')](_0xfcc3('0xa'),attributes,{'tableName':_0xfcc3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index efbb9fc..494e6be 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 _0x2658=['code','message','catch','lodash','moment','randomstring','ioredis','../../config/utils','client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1f6a77,_0x3fb516){var _0x3a8206=function(_0xee7b19){while(--_0xee7b19){_0x1f6a77['push'](_0x1f6a77['shift']());}};_0x3a8206(++_0x3fb516);}(_0x2658,0x120));var _0x8265=function(_0x24d91e,_0x5f0df4){_0x24d91e=_0x24d91e-0x0;var _0x34d6f6=_0x2658[_0x24d91e];return _0x34d6f6;};'use strict';var _=require(_0x8265('0x0'));var util=require('util');var moment=require(_0x8265('0x1'));var BPromise=require('bluebird');var rs=require(_0x8265('0x2'));var fs=require('fs');var Redis=require(_0x8265('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8265('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8265('0x5')][_0x8265('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x125dfc,_0x5855e1,_0x881573){return new BPromise(function(_0x28ec9c,_0x3f65dc){return client[_0x8265('0x7')](_0x125dfc,_0x881573)[_0x8265('0x8')](function(_0x23d5ec){logger[_0x8265('0x9')](_0x8265('0xa'),_0x5855e1,_0x8265('0xb'));logger[_0x8265('0xc')](_0x8265('0xd'),_0x5855e1,_0x8265('0xb'),JSON[_0x8265('0xe')](_0x23d5ec));if(_0x23d5ec[_0x8265('0xf')]){if(_0x23d5ec[_0x8265('0xf')][_0x8265('0x10')]===0x1f4){logger[_0x8265('0xf')](_0x8265('0xa'),_0x5855e1,_0x23d5ec[_0x8265('0xf')][_0x8265('0x11')]);return _0x3f65dc(_0x23d5ec[_0x8265('0xf')][_0x8265('0x11')]);}logger[_0x8265('0xf')](_0x8265('0xa'),_0x5855e1,_0x23d5ec[_0x8265('0xf')][_0x8265('0x11')]);return _0x28ec9c(_0x23d5ec[_0x8265('0xf')][_0x8265('0x11')]);}else{logger['info'](_0x8265('0xa'),_0x5855e1,_0x8265('0xb'));_0x28ec9c(_0x23d5ec['result']['message']);}})[_0x8265('0x12')](function(_0x4698d1){logger['error'](_0x8265('0xa'),_0x5855e1,_0x4698d1);_0x3f65dc(_0x4698d1);});});} \ No newline at end of file +var _0x6fb4=['../../config/environment','jayson/promise','client','request','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x6fb4,0x12b));var _0x46fb=function(_0xbe10dd,_0x498387){_0xbe10dd=_0xbe10dd-0x0;var _0x4578f8=_0x6fb4[_0xbe10dd];return _0x4578f8;};'use strict';var _=require(_0x46fb('0x0'));var util=require(_0x46fb('0x1'));var moment=require(_0x46fb('0x2'));var BPromise=require(_0x46fb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x46fb('0x4'));var logger=require(_0x46fb('0x5'))(_0x46fb('0x6'));var config=require(_0x46fb('0x7'));var jayson=require(_0x46fb('0x8'));var client=jayson[_0x46fb('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x545c1f,_0x4466b3,_0x1dca5b){return new BPromise(function(_0x436a15,_0x1b3c64){return client[_0x46fb('0xa')](_0x545c1f,_0x1dca5b)['then'](function(_0x8a019f){logger[_0x46fb('0xb')](_0x46fb('0xc'),_0x4466b3,_0x46fb('0xd'));logger['debug']('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x4466b3,'request\x20sent',JSON['stringify'](_0x8a019f));if(_0x8a019f[_0x46fb('0xe')]){if(_0x8a019f['error'][_0x46fb('0xf')]===0x1f4){logger[_0x46fb('0xe')](_0x46fb('0xc'),_0x4466b3,_0x8a019f[_0x46fb('0xe')][_0x46fb('0x10')]);return _0x1b3c64(_0x8a019f[_0x46fb('0xe')]['message']);}logger[_0x46fb('0xe')](_0x46fb('0xc'),_0x4466b3,_0x8a019f[_0x46fb('0xe')][_0x46fb('0x10')]);return _0x436a15(_0x8a019f[_0x46fb('0xe')][_0x46fb('0x10')]);}else{logger['info'](_0x46fb('0xc'),_0x4466b3,_0x46fb('0xd'));_0x436a15(_0x8a019f[_0x46fb('0x11')][_0x46fb('0x10')]);}})['catch'](function(_0x31041f){logger['error'](_0x46fb('0xc'),_0x4466b3,_0x31041f);_0x1b3c64(_0x31041f);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 6fefb21..c9899fe 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 _0xae55=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','describe','/:id','show','/:id/questions','post','update','delete','destroy','exports','multer','util'];(function(_0x37b7b6,_0x165a5c){var _0x10c4c3=function(_0x16d71e){while(--_0x16d71e){_0x37b7b6['push'](_0x37b7b6['shift']());}};_0x10c4c3(++_0x165a5c);}(_0xae55,0xfa));var _0x5ae5=function(_0xec4c09,_0x57262f){_0xec4c09=_0xec4c09-0x0;var _0x1f9860=_0xae55[_0xec4c09];return _0x1f9860;};'use strict';var multer=require(_0x5ae5('0x0'));var util=require(_0x5ae5('0x1'));var path=require('path');var timeout=require(_0x5ae5('0x2'));var express=require(_0x5ae5('0x3'));var router=express[_0x5ae5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5ae5('0x5'));var interaction=require(_0x5ae5('0x6'));var config=require(_0x5ae5('0x7'));var controller=require(_0x5ae5('0x8'));router[_0x5ae5('0x9')]('/',auth[_0x5ae5('0xa')](),controller[_0x5ae5('0xb')]);router[_0x5ae5('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x5ae5('0xc')]);router[_0x5ae5('0x9')](_0x5ae5('0xd'),auth[_0x5ae5('0xa')](),controller[_0x5ae5('0xe')]);router[_0x5ae5('0x9')](_0x5ae5('0xf'),auth[_0x5ae5('0xa')](),controller['getQuestions']);router[_0x5ae5('0x10')]('/',auth[_0x5ae5('0xa')](),controller['create']);router['put'](_0x5ae5('0xd'),auth[_0x5ae5('0xa')](),controller[_0x5ae5('0x11')]);router[_0x5ae5('0x12')](_0x5ae5('0xd'),auth[_0x5ae5('0xa')](),controller[_0x5ae5('0x13')]);module[_0x5ae5('0x14')]=router; \ No newline at end of file +var _0x32c9=['index','/describe','/:id','show','/:id/questions','getQuestions','post','create','put','update','delete','destroy','exports','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x32c9,0x7b));var _0x932c=function(_0x519d4c,_0x8c0763){_0x519d4c=_0x519d4c-0x0;var _0x2036ad=_0x32c9[_0x519d4c];return _0x2036ad;};'use strict';var multer=require('multer');var util=require(_0x932c('0x0'));var path=require('path');var timeout=require(_0x932c('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x932c('0x2'));var auth=require(_0x932c('0x3'));var interaction=require(_0x932c('0x4'));var config=require(_0x932c('0x5'));var controller=require(_0x932c('0x6'));router[_0x932c('0x7')]('/',auth[_0x932c('0x8')](),controller[_0x932c('0x9')]);router[_0x932c('0x7')](_0x932c('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x932c('0x7')](_0x932c('0xb'),auth[_0x932c('0x8')](),controller[_0x932c('0xc')]);router[_0x932c('0x7')](_0x932c('0xd'),auth[_0x932c('0x8')](),controller[_0x932c('0xe')]);router[_0x932c('0xf')]('/',auth[_0x932c('0x8')](),controller[_0x932c('0x10')]);router[_0x932c('0x11')]('/:id',auth[_0x932c('0x8')](),controller[_0x932c('0x12')]);router[_0x932c('0x13')](_0x932c('0xb'),auth['isAuthenticated'](),controller[_0x932c('0x14')]);module[_0x932c('0x15')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 98843c7..1e0d539 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 _0xc9c3=['starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','exports','setDataValue'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xc9c3,0x96));var _0x3c9c=function(_0x27093f,_0x2e3f22){_0x27093f=_0x27093f-0x0;var _0x2435e5=_0xc9c3[_0x27093f];return _0x2435e5;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x3c9c('0x0')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0xf34a69){this[_0x3c9c('0x1')](_0x3c9c('0x2'),_0xf34a69);this[_0x3c9c('0x1')](_0x3c9c('0x3'),moment()[_0x3c9c('0x4')](_0x3c9c('0x5')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x3c9c('0x6')]},'uniqueid':{'type':Sequelize[_0x3c9c('0x6')]},'calleridname':{'type':Sequelize[_0x3c9c('0x6')]},'calleridnum':{'type':Sequelize[_0x3c9c('0x6')]},'completed':{'type':Sequelize[_0x3c9c('0x7')],'defaultValue':![]}}; \ No newline at end of file +var _0x129a=['format','YYYY-MM-DD\x20HH:mm:ss','DATE','STRING','sequelize','setDataValue','starttime','endtime'];(function(_0x295d2e,_0x445fb6){var _0x39af83=function(_0x28b782){while(--_0x28b782){_0x295d2e['push'](_0x295d2e['shift']());}};_0x39af83(++_0x445fb6);}(_0x129a,0x74));var _0xa129=function(_0xecfc79,_0x3d8743){_0xecfc79=_0xecfc79-0x0;var _0xdbf877=_0x129a[_0xecfc79];return _0xdbf877;};'use strict';var moment=require('moment');var Sequelize=require(_0xa129('0x0'));module['exports']={'starttime':{'type':Sequelize['DATE'],'set':function(_0x236b82){this[_0xa129('0x1')](_0xa129('0x2'),_0x236b82);this[_0xa129('0x1')](_0xa129('0x3'),moment()[_0xa129('0x4')](_0xa129('0x5')));}},'endtime':{'type':Sequelize[_0xa129('0x6')]},'membername':{'type':Sequelize[_0xa129('0x7')]},'projectname':{'type':Sequelize[_0xa129('0x7')]},'queue':{'type':Sequelize[_0xa129('0x7')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xa129('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 20aa2ee..b5970d4 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 _0x8c2e=['request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','error','name','send','map','JscriptySessionReport','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','getQuestions','findOne','rawAttributes','SessionId','JscriptyQuestionReport','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x22cb5f,_0x2cdd63){var _0x274d36=function(_0x421472){while(--_0x421472){_0x22cb5f['push'](_0x22cb5f['shift']());}};_0x274d36(++_0x2cdd63);}(_0x8c2e,0xec));var _0xe8c2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8c2e[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xe8c2('0x0'));var rimraf=require(_0xe8c2('0x1'));var zipdir=require(_0xe8c2('0x2'));var jsonpatch=require(_0xe8c2('0x3'));var rp=require(_0xe8c2('0x4'));var moment=require('moment');var BPromise=require(_0xe8c2('0x5'));var Mustache=require(_0xe8c2('0x6'));var util=require(_0xe8c2('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xe8c2('0x8'));var ejs=require(_0xe8c2('0x9'));var fs=require('fs');var fs_extra=require(_0xe8c2('0xa'));var _=require('lodash');var squel=require(_0xe8c2('0xb'));var crypto=require('crypto');var jsforce=require(_0xe8c2('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe8c2('0x8'));var querystring=require(_0xe8c2('0xd'));var Papa=require(_0xe8c2('0xe'));var Redis=require(_0xe8c2('0xf'));var authService=require(_0xe8c2('0x10'));var qs=require(_0xe8c2('0x11'));var as=require(_0xe8c2('0x12'));var hardwareService=require(_0xe8c2('0x13'));var logger=require(_0xe8c2('0x14'))('api');var utils=require(_0xe8c2('0x15'));var config=require(_0xe8c2('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe8c2('0x17'))['db'];function respondWithStatusCode(_0x25c803,_0x5c6e62){_0x5c6e62=_0x5c6e62||0xcc;return function(_0x5321be){if(_0x5321be){return _0x25c803[_0xe8c2('0x18')](_0x5c6e62);}return _0x25c803['status'](_0x5c6e62)[_0xe8c2('0x19')]();};}function respondWithResult(_0x5439b3,_0x43e92d){_0x43e92d=_0x43e92d||0xc8;return function(_0x47d201){if(_0x47d201){return _0x5439b3[_0xe8c2('0x1a')](_0x43e92d)[_0xe8c2('0x1b')](_0x47d201);}};}function respondWithFilteredResult(_0x2c30f8,_0x5319ee){return function(_0x33fc2f){if(_0x33fc2f){var _0x307a4e=typeof _0x5319ee[_0xe8c2('0x1c')]===_0xe8c2('0x1d')&&typeof _0x5319ee['limit']===_0xe8c2('0x1d');var _0x2b308e=_0x33fc2f[_0xe8c2('0x1e')];var _0x362d74=_0x307a4e?0x0:_0x5319ee[_0xe8c2('0x1c')];var _0x36f268=_0x307a4e?_0x33fc2f[_0xe8c2('0x1e')]:_0x5319ee['offset']+_0x5319ee[_0xe8c2('0x1f')];var _0x3fcdb4;if(_0x36f268>=_0x2b308e){_0x36f268=_0x2b308e;_0x3fcdb4=0xc8;}else{_0x3fcdb4=0xce;}_0x2c30f8[_0xe8c2('0x1a')](_0x3fcdb4);return _0x2c30f8[_0xe8c2('0x20')](_0xe8c2('0x21'),_0x362d74+'-'+_0x36f268+'/'+_0x2b308e)[_0xe8c2('0x1b')](_0x33fc2f);}return null;};}function patchUpdates(_0x21aab9){return function(_0x11bd1f){try{jsonpatch[_0xe8c2('0x22')](_0x11bd1f,_0x21aab9,!![]);}catch(_0x87d07){return BPromise[_0xe8c2('0x23')](_0x87d07);}return _0x11bd1f[_0xe8c2('0x24')]();};}function saveUpdates(_0x171b2f,_0xf94310){return function(_0x43dbde){if(_0x43dbde){return _0x43dbde[_0xe8c2('0x25')](_0x171b2f)[_0xe8c2('0x26')](function(_0x1d865e){return _0x1d865e;});}return null;};}function removeEntity(_0x31000d,_0x1dd576){return function(_0x1aca1b){if(_0x1aca1b){return _0x1aca1b['destroy']()[_0xe8c2('0x26')](function(){_0x31000d[_0xe8c2('0x1a')](0xcc)[_0xe8c2('0x19')]();});}};}function handleEntityNotFound(_0x151f75,_0xd08c3){return function(_0x4763b2){if(!_0x4763b2){_0x151f75[_0xe8c2('0x18')](0x194);}return _0x4763b2;};}function handleError(_0xa1ae41,_0x3a8590){_0x3a8590=_0x3a8590||0x1f4;return function(_0x160e29){logger[_0xe8c2('0x27')](_0x160e29['stack']);if(_0x160e29[_0xe8c2('0x28')]){delete _0x160e29[_0xe8c2('0x28')];}_0xa1ae41[_0xe8c2('0x1a')](_0x3a8590)[_0xe8c2('0x29')](_0x160e29);};}exports['index']=function(_0x556f84,_0x378479){var _0x2b9dea={},_0x536c2c={},_0x1e7587={'count':0x0,'rows':[]};var _0x1203cb=_[_0xe8c2('0x2a')](db[_0xe8c2('0x2b')]['rawAttributes'],function(_0x5c99f6){return{'name':_0x5c99f6[_0xe8c2('0x2c')],'type':_0x5c99f6['type'][_0xe8c2('0x2d')]};});_0x536c2c[_0xe8c2('0x2e')]=_['map'](_0x1203cb,'name');_0x536c2c[_0xe8c2('0x2f')]=_[_0xe8c2('0x30')](_0x556f84['query']);_0x536c2c[_0xe8c2('0x31')]=_[_0xe8c2('0x32')](_0x536c2c[_0xe8c2('0x2e')],_0x536c2c[_0xe8c2('0x2f')]);_0x2b9dea['attributes']=_[_0xe8c2('0x32')](_0x536c2c[_0xe8c2('0x2e')],qs[_0xe8c2('0x33')](_0x556f84['query'][_0xe8c2('0x33')]));_0x2b9dea[_0xe8c2('0x34')]=_0x2b9dea[_0xe8c2('0x34')][_0xe8c2('0x35')]?_0x2b9dea[_0xe8c2('0x34')]:_0x536c2c[_0xe8c2('0x2e')];if(!_0x556f84[_0xe8c2('0x2f')][_0xe8c2('0x36')]('nolimit')){_0x2b9dea[_0xe8c2('0x1f')]=qs[_0xe8c2('0x1f')](_0x556f84[_0xe8c2('0x2f')]['limit']);_0x2b9dea[_0xe8c2('0x1c')]=qs[_0xe8c2('0x1c')](_0x556f84[_0xe8c2('0x2f')][_0xe8c2('0x1c')]);}_0x2b9dea[_0xe8c2('0x37')]=qs[_0xe8c2('0x38')](_0x556f84[_0xe8c2('0x2f')]['sort']);_0x2b9dea[_0xe8c2('0x39')]=qs[_0xe8c2('0x31')](_[_0xe8c2('0x3a')](_0x556f84['query'],_0x536c2c[_0xe8c2('0x31')]),_0x1203cb);if(_0x556f84[_0xe8c2('0x2f')][_0xe8c2('0x3b')]){_0x2b9dea['where']=_[_0xe8c2('0x3c')](_0x2b9dea['where'],{'$or':_[_0xe8c2('0x2a')](_0x1203cb,function(_0x4217ea){if(_0x4217ea[_0xe8c2('0x3d')]!==_0xe8c2('0x3e')){var _0x79ea34={};_0x79ea34[_0x4217ea['name']]={'$like':'%'+_0x556f84[_0xe8c2('0x2f')][_0xe8c2('0x3b')]+'%'};return _0x79ea34;}})});}_0x2b9dea=_[_0xe8c2('0x3c')]({},_0x2b9dea,_0x556f84[_0xe8c2('0x3f')]);var _0x377076={'where':_0x2b9dea[_0xe8c2('0x39')]};return db['JscriptySessionReport'][_0xe8c2('0x1e')](_0x377076)[_0xe8c2('0x26')](function(_0xaec800){_0x1e7587[_0xe8c2('0x1e')]=_0xaec800;if(_0x556f84['query'][_0xe8c2('0x40')]){_0x2b9dea[_0xe8c2('0x41')]=[{'all':!![]}];}return db[_0xe8c2('0x2b')][_0xe8c2('0x42')](_0x2b9dea);})[_0xe8c2('0x26')](function(_0x5f13df){_0x1e7587[_0xe8c2('0x43')]=_0x5f13df;return _0x1e7587;})[_0xe8c2('0x26')](respondWithFilteredResult(_0x378479,_0x2b9dea))[_0xe8c2('0x44')](handleError(_0x378479,null));};exports[_0xe8c2('0x45')]=function(_0x3b74e5,_0x39ddc1){var _0x4eccb1={'raw':!![],'where':{'id':_0x3b74e5[_0xe8c2('0x46')]['id']}},_0x10c228={};_0x10c228[_0xe8c2('0x2e')]=_[_0xe8c2('0x30')](db[_0xe8c2('0x2b')]['rawAttributes']);_0x10c228[_0xe8c2('0x2f')]=_[_0xe8c2('0x30')](_0x3b74e5[_0xe8c2('0x2f')]);_0x10c228[_0xe8c2('0x31')]=_['intersection'](_0x10c228[_0xe8c2('0x2e')],_0x10c228[_0xe8c2('0x2f')]);_0x4eccb1[_0xe8c2('0x34')]=_[_0xe8c2('0x32')](_0x10c228[_0xe8c2('0x2e')],qs[_0xe8c2('0x33')](_0x3b74e5[_0xe8c2('0x2f')][_0xe8c2('0x33')]));_0x4eccb1[_0xe8c2('0x34')]=_0x4eccb1[_0xe8c2('0x34')]['length']?_0x4eccb1[_0xe8c2('0x34')]:_0x10c228['model'];if(_0x3b74e5[_0xe8c2('0x2f')][_0xe8c2('0x40')]){_0x4eccb1['include']=[{'all':!![]}];}_0x4eccb1=_[_0xe8c2('0x3c')]({},_0x4eccb1,_0x3b74e5['options']);return db['JscriptySessionReport'][_0xe8c2('0x47')](_0x4eccb1)[_0xe8c2('0x26')](handleEntityNotFound(_0x39ddc1,null))[_0xe8c2('0x26')](respondWithResult(_0x39ddc1,null))['catch'](handleError(_0x39ddc1,null));};exports['create']=function(_0x442a5f,_0x2da42f){return db['JscriptySessionReport'][_0xe8c2('0x48')](_0x442a5f[_0xe8c2('0x49')],{})['then'](respondWithResult(_0x2da42f,0xc9))[_0xe8c2('0x44')](handleError(_0x2da42f,null));};exports[_0xe8c2('0x25')]=function(_0x107022,_0x20ecd9){if(_0x107022[_0xe8c2('0x49')]['id']){delete _0x107022[_0xe8c2('0x49')]['id'];}return db['JscriptySessionReport'][_0xe8c2('0x47')]({'where':{'id':_0x107022[_0xe8c2('0x46')]['id']}})[_0xe8c2('0x26')](handleEntityNotFound(_0x20ecd9,null))['then'](saveUpdates(_0x107022[_0xe8c2('0x49')],null))[_0xe8c2('0x26')](respondWithResult(_0x20ecd9,null))[_0xe8c2('0x44')](handleError(_0x20ecd9,null));};exports[_0xe8c2('0x4a')]=function(_0x1474e5,_0x1d3e3b){return db['JscriptySessionReport'][_0xe8c2('0x47')]({'where':{'id':_0x1474e5[_0xe8c2('0x46')]['id']}})[_0xe8c2('0x26')](handleEntityNotFound(_0x1d3e3b,null))['then'](removeEntity(_0x1d3e3b,null))[_0xe8c2('0x44')](handleError(_0x1d3e3b,null));};exports['describe']=function(_0x403e10,_0x4a3efd){return db['JscriptySessionReport']['describe']()[_0xe8c2('0x26')](respondWithResult(_0x4a3efd,null))[_0xe8c2('0x44')](handleError(_0x4a3efd,null));};exports[_0xe8c2('0x4b')]=function(_0x2511e3,_0x1942f8,_0x77a22c){var _0x35f8d9={'raw':!![],'where':{}};var _0x2ca248={};var _0x3351b1={'count':0x0,'rows':[]};return db[_0xe8c2('0x2b')][_0xe8c2('0x4c')]({'where':{'id':_0x2511e3[_0xe8c2('0x46')]['id']}})[_0xe8c2('0x26')](handleEntityNotFound(_0x1942f8,null))[_0xe8c2('0x26')](function(_0x4bc126){if(_0x4bc126){_0x2ca248[_0xe8c2('0x2e')]=_[_0xe8c2('0x30')](db['JscriptyQuestionReport'][_0xe8c2('0x4d')]);_0x2ca248[_0xe8c2('0x2f')]=_[_0xe8c2('0x30')](_0x2511e3[_0xe8c2('0x2f')]);_0x2ca248['filters']=_[_0xe8c2('0x32')](_0x2ca248[_0xe8c2('0x2e')],_0x2ca248[_0xe8c2('0x2f')]);_0x35f8d9[_0xe8c2('0x34')]=_[_0xe8c2('0x32')](_0x2ca248[_0xe8c2('0x2e')],qs['fields'](_0x2511e3['query'][_0xe8c2('0x33')]));_0x35f8d9[_0xe8c2('0x34')]=_0x35f8d9[_0xe8c2('0x34')][_0xe8c2('0x35')]?_0x35f8d9['attributes']:_0x2ca248[_0xe8c2('0x2e')];if(!_0x2511e3['query'][_0xe8c2('0x36')]('nolimit')){_0x35f8d9[_0xe8c2('0x1f')]=qs['limit'](_0x2511e3[_0xe8c2('0x2f')]['limit']);_0x35f8d9[_0xe8c2('0x1c')]=qs[_0xe8c2('0x1c')](_0x2511e3[_0xe8c2('0x2f')][_0xe8c2('0x1c')]);}_0x35f8d9[_0xe8c2('0x37')]=qs[_0xe8c2('0x38')](_0x2511e3[_0xe8c2('0x2f')][_0xe8c2('0x38')]);_0x35f8d9['where']=qs['filters'](_[_0xe8c2('0x3a')](_0x2511e3[_0xe8c2('0x2f')],_0x2ca248['filters']));_0x35f8d9['where'][_0xe8c2('0x4e')]=_0x4bc126['id'];if(_0x2511e3['query'][_0xe8c2('0x3b')]){_0x35f8d9[_0xe8c2('0x39')]=_[_0xe8c2('0x3c')](_0x35f8d9[_0xe8c2('0x39')],{'$or':_[_0xe8c2('0x2a')](_0x35f8d9[_0xe8c2('0x34')],function(_0x32879b){var _0x506974={};_0x506974[_0x32879b]={'$like':'%'+_0x2511e3[_0xe8c2('0x2f')]['filter']+'%'};return _0x506974;})});}_0x35f8d9=_[_0xe8c2('0x3c')]({},_0x35f8d9,_0x2511e3[_0xe8c2('0x3f')]);return db[_0xe8c2('0x4f')][_0xe8c2('0x1e')]({'where':_0x35f8d9[_0xe8c2('0x39')]})[_0xe8c2('0x26')](function(_0x440705){_0x3351b1['count']=_0x440705;if(_0x2511e3[_0xe8c2('0x2f')][_0xe8c2('0x40')]){_0x35f8d9[_0xe8c2('0x41')]=[{'all':!![]}];}return db[_0xe8c2('0x4f')][_0xe8c2('0x42')](_0x35f8d9);})[_0xe8c2('0x26')](function(_0x3ac0f7){_0x3351b1['rows']=_0x3ac0f7;return _0x3351b1;});}})['then'](respondWithFilteredResult(_0x1942f8,_0x35f8d9))[_0xe8c2('0x44')](handleError(_0x1942f8,null));}; \ No newline at end of file +var _0x9963=['moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','count','limit','set','reject','save','then','destroy','stack','name','send','index','map','JscriptySessionReport','fieldName','type','key','model','filters','intersection','query','attributes','fields','length','hasOwnProperty','offset','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','keys','rawAttributes','include','find','create','body','update','params','describe','findOne','nolimit','SessionId','JscriptyQuestionReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x376928,_0x2cc87b){var _0x58de33=function(_0x24cec3){while(--_0x24cec3){_0x376928['push'](_0x376928['shift']());}};_0x58de33(++_0x2cc87b);}(_0x9963,0xeb));var _0x3996=function(_0x5a2d3f,_0x27b04e){_0x5a2d3f=_0x5a2d3f-0x0;var _0x5c65d8=_0x9963[_0x5a2d3f];return _0x5c65d8;};'use strict';var emlformat=require(_0x3996('0x0'));var rimraf=require(_0x3996('0x1'));var zipdir=require(_0x3996('0x2'));var jsonpatch=require(_0x3996('0x3'));var rp=require(_0x3996('0x4'));var moment=require(_0x3996('0x5'));var BPromise=require(_0x3996('0x6'));var Mustache=require('mustache');var util=require(_0x3996('0x7'));var path=require(_0x3996('0x8'));var sox=require(_0x3996('0x9'));var csv=require(_0x3996('0xa'));var ejs=require(_0x3996('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3996('0xc'));var squel=require(_0x3996('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3996('0xe'));var toCsv=require(_0x3996('0xa'));var querystring=require(_0x3996('0xf'));var Papa=require(_0x3996('0x10'));var Redis=require(_0x3996('0x11'));var authService=require(_0x3996('0x12'));var qs=require(_0x3996('0x13'));var as=require(_0x3996('0x14'));var hardwareService=require(_0x3996('0x15'));var logger=require('../../config/logger')(_0x3996('0x16'));var utils=require('../../config/utils');var config=require(_0x3996('0x17'));var licenseUtil=require(_0x3996('0x18'));var db=require(_0x3996('0x19'))['db'];function respondWithStatusCode(_0x5bc458,_0x5d36b8){_0x5d36b8=_0x5d36b8||0xcc;return function(_0x4173e1){if(_0x4173e1){return _0x5bc458[_0x3996('0x1a')](_0x5d36b8);}return _0x5bc458['status'](_0x5d36b8)[_0x3996('0x1b')]();};}function respondWithResult(_0x44cee3,_0x1a0a2f){_0x1a0a2f=_0x1a0a2f||0xc8;return function(_0xb53c99){if(_0xb53c99){return _0x44cee3[_0x3996('0x1c')](_0x1a0a2f)[_0x3996('0x1d')](_0xb53c99);}};}function respondWithFilteredResult(_0x4ab648,_0x8f0275){return function(_0x40446f){if(_0x40446f){var _0x2ce309=typeof _0x8f0275['offset']==='undefined'&&typeof _0x8f0275['limit']===_0x3996('0x1e');var _0x2fc93a=_0x40446f[_0x3996('0x1f')];var _0x545308=_0x2ce309?0x0:_0x8f0275['offset'];var _0x232f5f=_0x2ce309?_0x40446f[_0x3996('0x1f')]:_0x8f0275['offset']+_0x8f0275[_0x3996('0x20')];var _0x54f040;if(_0x232f5f>=_0x2fc93a){_0x232f5f=_0x2fc93a;_0x54f040=0xc8;}else{_0x54f040=0xce;}_0x4ab648[_0x3996('0x1c')](_0x54f040);return _0x4ab648[_0x3996('0x21')]('Content-Range',_0x545308+'-'+_0x232f5f+'/'+_0x2fc93a)[_0x3996('0x1d')](_0x40446f);}return null;};}function patchUpdates(_0x2c277f){return function(_0x6b7f68){try{jsonpatch['apply'](_0x6b7f68,_0x2c277f,!![]);}catch(_0x188af2){return BPromise[_0x3996('0x22')](_0x188af2);}return _0x6b7f68[_0x3996('0x23')]();};}function saveUpdates(_0x4c2729,_0x3b76f8){return function(_0x1405d1){if(_0x1405d1){return _0x1405d1['update'](_0x4c2729)[_0x3996('0x24')](function(_0xb00562){return _0xb00562;});}return null;};}function removeEntity(_0x2cd78d,_0x12893c){return function(_0x1fd778){if(_0x1fd778){return _0x1fd778[_0x3996('0x25')]()[_0x3996('0x24')](function(){_0x2cd78d[_0x3996('0x1c')](0xcc)[_0x3996('0x1b')]();});}};}function handleEntityNotFound(_0x4411d8,_0x509d2c){return function(_0x52a9fe){if(!_0x52a9fe){_0x4411d8['sendStatus'](0x194);}return _0x52a9fe;};}function handleError(_0x1ab1a0,_0x37235a){_0x37235a=_0x37235a||0x1f4;return function(_0x2b434d){logger['error'](_0x2b434d[_0x3996('0x26')]);if(_0x2b434d[_0x3996('0x27')]){delete _0x2b434d[_0x3996('0x27')];}_0x1ab1a0[_0x3996('0x1c')](_0x37235a)[_0x3996('0x28')](_0x2b434d);};}exports[_0x3996('0x29')]=function(_0x1700c8,_0x125fa7){var _0x39e11a={},_0x5c2716={},_0x2f3b2f={'count':0x0,'rows':[]};var _0x4b164c=_[_0x3996('0x2a')](db[_0x3996('0x2b')]['rawAttributes'],function(_0x1c8a87){return{'name':_0x1c8a87[_0x3996('0x2c')],'type':_0x1c8a87[_0x3996('0x2d')][_0x3996('0x2e')]};});_0x5c2716[_0x3996('0x2f')]=_['map'](_0x4b164c,_0x3996('0x27'));_0x5c2716['query']=_['keys'](_0x1700c8['query']);_0x5c2716[_0x3996('0x30')]=_[_0x3996('0x31')](_0x5c2716[_0x3996('0x2f')],_0x5c2716[_0x3996('0x32')]);_0x39e11a[_0x3996('0x33')]=_[_0x3996('0x31')](_0x5c2716[_0x3996('0x2f')],qs[_0x3996('0x34')](_0x1700c8[_0x3996('0x32')][_0x3996('0x34')]));_0x39e11a[_0x3996('0x33')]=_0x39e11a[_0x3996('0x33')][_0x3996('0x35')]?_0x39e11a[_0x3996('0x33')]:_0x5c2716[_0x3996('0x2f')];if(!_0x1700c8[_0x3996('0x32')][_0x3996('0x36')]('nolimit')){_0x39e11a['limit']=qs[_0x3996('0x20')](_0x1700c8[_0x3996('0x32')]['limit']);_0x39e11a['offset']=qs['offset'](_0x1700c8[_0x3996('0x32')][_0x3996('0x37')]);}_0x39e11a['order']=qs['sort'](_0x1700c8[_0x3996('0x32')][_0x3996('0x38')]);_0x39e11a[_0x3996('0x39')]=qs[_0x3996('0x30')](_[_0x3996('0x3a')](_0x1700c8[_0x3996('0x32')],_0x5c2716[_0x3996('0x30')]),_0x4b164c);if(_0x1700c8[_0x3996('0x32')][_0x3996('0x3b')]){_0x39e11a[_0x3996('0x39')]=_[_0x3996('0x3c')](_0x39e11a['where'],{'$or':_['map'](_0x4b164c,function(_0x55caf5){if(_0x55caf5[_0x3996('0x2d')]!==_0x3996('0x3d')){var _0x26a2d0={};_0x26a2d0[_0x55caf5[_0x3996('0x27')]]={'$like':'%'+_0x1700c8[_0x3996('0x32')][_0x3996('0x3b')]+'%'};return _0x26a2d0;}})});}_0x39e11a=_[_0x3996('0x3c')]({},_0x39e11a,_0x1700c8[_0x3996('0x3e')]);var _0x325eea={'where':_0x39e11a[_0x3996('0x39')]};return db[_0x3996('0x2b')]['count'](_0x325eea)[_0x3996('0x24')](function(_0x21526e){_0x2f3b2f[_0x3996('0x1f')]=_0x21526e;if(_0x1700c8['query'][_0x3996('0x3f')]){_0x39e11a['include']=[{'all':!![]}];}return db[_0x3996('0x2b')][_0x3996('0x40')](_0x39e11a);})[_0x3996('0x24')](function(_0x539f33){_0x2f3b2f[_0x3996('0x41')]=_0x539f33;return _0x2f3b2f;})[_0x3996('0x24')](respondWithFilteredResult(_0x125fa7,_0x39e11a))[_0x3996('0x42')](handleError(_0x125fa7,null));};exports['show']=function(_0x22e00b,_0xe5762e){var _0x387572={'raw':!![],'where':{'id':_0x22e00b['params']['id']}},_0x3c110e={};_0x3c110e[_0x3996('0x2f')]=_[_0x3996('0x43')](db[_0x3996('0x2b')][_0x3996('0x44')]);_0x3c110e[_0x3996('0x32')]=_[_0x3996('0x43')](_0x22e00b[_0x3996('0x32')]);_0x3c110e[_0x3996('0x30')]=_[_0x3996('0x31')](_0x3c110e[_0x3996('0x2f')],_0x3c110e['query']);_0x387572[_0x3996('0x33')]=_[_0x3996('0x31')](_0x3c110e[_0x3996('0x2f')],qs['fields'](_0x22e00b[_0x3996('0x32')]['fields']));_0x387572[_0x3996('0x33')]=_0x387572[_0x3996('0x33')][_0x3996('0x35')]?_0x387572[_0x3996('0x33')]:_0x3c110e[_0x3996('0x2f')];if(_0x22e00b['query'][_0x3996('0x3f')]){_0x387572[_0x3996('0x45')]=[{'all':!![]}];}_0x387572=_[_0x3996('0x3c')]({},_0x387572,_0x22e00b[_0x3996('0x3e')]);return db['JscriptySessionReport'][_0x3996('0x46')](_0x387572)[_0x3996('0x24')](handleEntityNotFound(_0xe5762e,null))[_0x3996('0x24')](respondWithResult(_0xe5762e,null))['catch'](handleError(_0xe5762e,null));};exports['create']=function(_0xe84c99,_0x22c718){return db['JscriptySessionReport'][_0x3996('0x47')](_0xe84c99[_0x3996('0x48')],{})['then'](respondWithResult(_0x22c718,0xc9))[_0x3996('0x42')](handleError(_0x22c718,null));};exports[_0x3996('0x49')]=function(_0x1561bd,_0x8acb09){if(_0x1561bd[_0x3996('0x48')]['id']){delete _0x1561bd[_0x3996('0x48')]['id'];}return db[_0x3996('0x2b')][_0x3996('0x46')]({'where':{'id':_0x1561bd[_0x3996('0x4a')]['id']}})[_0x3996('0x24')](handleEntityNotFound(_0x8acb09,null))['then'](saveUpdates(_0x1561bd[_0x3996('0x48')],null))['then'](respondWithResult(_0x8acb09,null))[_0x3996('0x42')](handleError(_0x8acb09,null));};exports[_0x3996('0x25')]=function(_0x40c3d0,_0x4d0832){return db[_0x3996('0x2b')][_0x3996('0x46')]({'where':{'id':_0x40c3d0[_0x3996('0x4a')]['id']}})[_0x3996('0x24')](handleEntityNotFound(_0x4d0832,null))[_0x3996('0x24')](removeEntity(_0x4d0832,null))[_0x3996('0x42')](handleError(_0x4d0832,null));};exports[_0x3996('0x4b')]=function(_0x37fe0e,_0x578ab2){return db[_0x3996('0x2b')]['describe']()[_0x3996('0x24')](respondWithResult(_0x578ab2,null))[_0x3996('0x42')](handleError(_0x578ab2,null));};exports['getQuestions']=function(_0x47bc01,_0xa6d60d,_0x2bf915){var _0x38b5a7={'raw':!![],'where':{}};var _0x11c756={};var _0x573d6e={'count':0x0,'rows':[]};return db[_0x3996('0x2b')][_0x3996('0x4c')]({'where':{'id':_0x47bc01[_0x3996('0x4a')]['id']}})[_0x3996('0x24')](handleEntityNotFound(_0xa6d60d,null))[_0x3996('0x24')](function(_0x2dd65e){if(_0x2dd65e){_0x11c756[_0x3996('0x2f')]=_[_0x3996('0x43')](db['JscriptyQuestionReport'][_0x3996('0x44')]);_0x11c756[_0x3996('0x32')]=_[_0x3996('0x43')](_0x47bc01[_0x3996('0x32')]);_0x11c756[_0x3996('0x30')]=_[_0x3996('0x31')](_0x11c756[_0x3996('0x2f')],_0x11c756['query']);_0x38b5a7[_0x3996('0x33')]=_[_0x3996('0x31')](_0x11c756[_0x3996('0x2f')],qs[_0x3996('0x34')](_0x47bc01[_0x3996('0x32')][_0x3996('0x34')]));_0x38b5a7[_0x3996('0x33')]=_0x38b5a7['attributes'][_0x3996('0x35')]?_0x38b5a7[_0x3996('0x33')]:_0x11c756[_0x3996('0x2f')];if(!_0x47bc01[_0x3996('0x32')][_0x3996('0x36')](_0x3996('0x4d'))){_0x38b5a7[_0x3996('0x20')]=qs[_0x3996('0x20')](_0x47bc01['query']['limit']);_0x38b5a7['offset']=qs['offset'](_0x47bc01[_0x3996('0x32')][_0x3996('0x37')]);}_0x38b5a7['order']=qs[_0x3996('0x38')](_0x47bc01[_0x3996('0x32')][_0x3996('0x38')]);_0x38b5a7[_0x3996('0x39')]=qs[_0x3996('0x30')](_[_0x3996('0x3a')](_0x47bc01[_0x3996('0x32')],_0x11c756[_0x3996('0x30')]));_0x38b5a7[_0x3996('0x39')][_0x3996('0x4e')]=_0x2dd65e['id'];if(_0x47bc01[_0x3996('0x32')]['filter']){_0x38b5a7[_0x3996('0x39')]=_[_0x3996('0x3c')](_0x38b5a7[_0x3996('0x39')],{'$or':_['map'](_0x38b5a7[_0x3996('0x33')],function(_0x30e272){var _0x4419dc={};_0x4419dc[_0x30e272]={'$like':'%'+_0x47bc01[_0x3996('0x32')][_0x3996('0x3b')]+'%'};return _0x4419dc;})});}_0x38b5a7=_[_0x3996('0x3c')]({},_0x38b5a7,_0x47bc01[_0x3996('0x3e')]);return db[_0x3996('0x4f')]['count']({'where':_0x38b5a7[_0x3996('0x39')]})['then'](function(_0x3007a2){_0x573d6e[_0x3996('0x1f')]=_0x3007a2;if(_0x47bc01[_0x3996('0x32')][_0x3996('0x3f')]){_0x38b5a7[_0x3996('0x45')]=[{'all':!![]}];}return db[_0x3996('0x4f')][_0x3996('0x40')](_0x38b5a7);})[_0x3996('0x24')](function(_0x35179b){_0x573d6e['rows']=_0x35179b;return _0x573d6e;});}})['then'](respondWithFilteredResult(_0xa6d60d,_0x38b5a7))[_0x3996('0x42')](handleError(_0xa6d60d,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 65b94a2..4e7effe 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 _0xc6ac=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','JscriptySessionReport','report_jscripty_sessions','lodash','util','../../config/logger'];(function(_0x16dbfd,_0x2f9431){var _0x382254=function(_0x19dade){while(--_0x19dade){_0x16dbfd['push'](_0x16dbfd['shift']());}};_0x382254(++_0x2f9431);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x39b690,_0x27cdf5){_0x39b690=_0x39b690-0x0;var _0x1529a0=_0xc6ac[_0x39b690];return _0x1529a0;};'use strict';var _=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var logger=require(_0xcc6a('0x2'))(_0xcc6a('0x3'));var moment=require(_0xcc6a('0x4'));var BPromise=require(_0xcc6a('0x5'));var rp=require(_0xcc6a('0x6'));var fs=require('fs');var path=require(_0xcc6a('0x7'));var rimraf=require(_0xcc6a('0x8'));var config=require(_0xcc6a('0x9'));var attributes=require(_0xcc6a('0xa'));module[_0xcc6a('0xb')]=function(_0x12330e,_0x197bd7){return _0x12330e['define'](_0xcc6a('0xc'),attributes,{'tableName':_0xcc6a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8ca9=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','exports','define','JscriptySessionReport','report_jscripty_sessions'];(function(_0x41b4df,_0x15b067){var _0x55d4dc=function(_0x43e391){while(--_0x43e391){_0x41b4df['push'](_0x41b4df['shift']());}};_0x55d4dc(++_0x15b067);}(_0x8ca9,0x9c));var _0x98ca=function(_0x579e1c,_0x431a78){_0x579e1c=_0x579e1c-0x0;var _0xc97c18=_0x8ca9[_0x579e1c];return _0xc97c18;};'use strict';var _=require(_0x98ca('0x0'));var util=require(_0x98ca('0x1'));var logger=require(_0x98ca('0x2'))(_0x98ca('0x3'));var moment=require(_0x98ca('0x4'));var BPromise=require(_0x98ca('0x5'));var rp=require(_0x98ca('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x98ca('0x7'));var attributes=require('./jscriptySessionReport.attributes');module[_0x98ca('0x8')]=function(_0x48415d,_0x219619){return _0x48415d[_0x98ca('0x9')](_0x98ca('0xa'),attributes,{'tableName':_0x98ca('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 327559b..3d58a84 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 _0xa46e=['request','then','request\x20sent','debug','stringify','error','code','message','JscriptySessionReport,\x20%s,\x20%s','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','http'];(function(_0x3c8d6c,_0x51ae3a){var _0x146521=function(_0x4cd1ed){while(--_0x4cd1ed){_0x3c8d6c['push'](_0x3c8d6c['shift']());}};_0x146521(++_0x51ae3a);}(_0xa46e,0x8a));var _0xea46=function(_0x251d9c,_0x580977){_0x251d9c=_0x251d9c-0x0;var _0x16ae64=_0xa46e[_0x251d9c];return _0x16ae64;};'use strict';var _=require(_0xea46('0x0'));var util=require(_0xea46('0x1'));var moment=require('moment');var BPromise=require(_0xea46('0x2'));var rs=require(_0xea46('0x3'));var fs=require('fs');var Redis=require(_0xea46('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xea46('0x5'));var logger=require('../../config/logger')(_0xea46('0x6'));var config=require('../../config/environment');var jayson=require(_0xea46('0x7'));var client=jayson['client'][_0xea46('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3dc26f,_0x5f1cd1,_0x2d1b30){return new BPromise(function(_0x42771a,_0xe7d428){return client[_0xea46('0x9')](_0x3dc26f,_0x2d1b30)[_0xea46('0xa')](function(_0x4cf206){logger['info']('JscriptySessionReport,\x20%s,\x20%s',_0x5f1cd1,_0xea46('0xb'));logger[_0xea46('0xc')]('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x5f1cd1,_0xea46('0xb'),JSON[_0xea46('0xd')](_0x4cf206));if(_0x4cf206[_0xea46('0xe')]){if(_0x4cf206['error'][_0xea46('0xf')]===0x1f4){logger[_0xea46('0xe')]('JscriptySessionReport,\x20%s,\x20%s',_0x5f1cd1,_0x4cf206[_0xea46('0xe')][_0xea46('0x10')]);return _0xe7d428(_0x4cf206['error'][_0xea46('0x10')]);}logger['error'](_0xea46('0x11'),_0x5f1cd1,_0x4cf206[_0xea46('0xe')][_0xea46('0x10')]);return _0x42771a(_0x4cf206[_0xea46('0xe')][_0xea46('0x10')]);}else{logger[_0xea46('0x12')](_0xea46('0x11'),_0x5f1cd1,_0xea46('0xb'));_0x42771a(_0x4cf206[_0xea46('0x13')]['message']);}})[_0xea46('0x14')](function(_0xbf225e){logger[_0xea46('0xe')]('JscriptySessionReport,\x20%s,\x20%s',_0x5f1cd1,_0xbf225e);_0xe7d428(_0xbf225e);});});} \ No newline at end of file +var _0x3a6d=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x3a6d,0x143));var _0xd3a6=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x3a6d[_0x5d2803];return _0xdcad2c;};'use strict';var _=require(_0xd3a6('0x0'));var util=require(_0xd3a6('0x1'));var moment=require('moment');var BPromise=require(_0xd3a6('0x2'));var rs=require(_0xd3a6('0x3'));var fs=require('fs');var Redis=require(_0xd3a6('0x4'));var db=require(_0xd3a6('0x5'))['db'];var utils=require(_0xd3a6('0x6'));var logger=require('../../config/logger')(_0xd3a6('0x7'));var config=require(_0xd3a6('0x8'));var jayson=require(_0xd3a6('0x9'));var client=jayson[_0xd3a6('0xa')][_0xd3a6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x282cb1,_0x58d83a,_0x121bd2){return new BPromise(function(_0x134dd3,_0x16858){return client[_0xd3a6('0xc')](_0x282cb1,_0x121bd2)[_0xd3a6('0xd')](function(_0xa67661){logger[_0xd3a6('0xe')](_0xd3a6('0xf'),_0x58d83a,_0xd3a6('0x10'));logger['debug'](_0xd3a6('0x11'),_0x58d83a,_0xd3a6('0x10'),JSON[_0xd3a6('0x12')](_0xa67661));if(_0xa67661[_0xd3a6('0x13')]){if(_0xa67661[_0xd3a6('0x13')]['code']===0x1f4){logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x58d83a,_0xa67661[_0xd3a6('0x13')][_0xd3a6('0x14')]);return _0x16858(_0xa67661[_0xd3a6('0x13')][_0xd3a6('0x14')]);}logger[_0xd3a6('0x13')](_0xd3a6('0xf'),_0x58d83a,_0xa67661[_0xd3a6('0x13')]['message']);return _0x134dd3(_0xa67661[_0xd3a6('0x13')][_0xd3a6('0x14')]);}else{logger[_0xd3a6('0xe')]('JscriptySessionReport,\x20%s,\x20%s',_0x58d83a,_0xd3a6('0x10'));_0x134dd3(_0xa67661[_0xd3a6('0x15')][_0xd3a6('0x14')]);}})['catch'](function(_0x3498d5){logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x58d83a,_0x3498d5);_0x16858(_0x3498d5);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 695744c..3c09b75 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 _0x4f10=['./license.controller','get','index','put','/:id','update','/download_log_file','isAuthenticated','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x9bd36c,_0x4d72ca){var _0x4f856b=function(_0x5818d8){while(--_0x5818d8){_0x9bd36c['push'](_0x9bd36c['shift']());}};_0x4f856b(++_0x4d72ca);}(_0x4f10,0x129));var _0x04f1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4f10[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0x04f1('0x0'));var path=require(_0x04f1('0x1'));var timeout=require('connect-timeout');var express=require(_0x04f1('0x2'));var router=express['Router']();var fs_extra=require(_0x04f1('0x3'));var auth=require(_0x04f1('0x4'));var interaction=require(_0x04f1('0x5'));var config=require(_0x04f1('0x6'));var controller=require(_0x04f1('0x7'));router[_0x04f1('0x8')]('/',controller[_0x04f1('0x9')]);router[_0x04f1('0xa')](_0x04f1('0xb'),auth['isAuthenticated'](),controller[_0x04f1('0xc')]);router['get'](_0x04f1('0xd'),auth[_0x04f1('0xe')](),controller['downloadLogFile']);module[_0x04f1('0xf')]=router; \ No newline at end of file +var _0xf710=['get','index','put','isAuthenticated','update','/download_log_file','downloadLogFile','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller'];(function(_0x2df507,_0x553862){var _0x1f7167=function(_0x11319e){while(--_0x11319e){_0x2df507['push'](_0x2df507['shift']());}};_0x1f7167(++_0x553862);}(_0xf710,0x1b8));var _0x0f71=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xf710[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x0f71('0x0'));var util=require(_0x0f71('0x1'));var path=require(_0x0f71('0x2'));var timeout=require(_0x0f71('0x3'));var express=require(_0x0f71('0x4'));var router=express['Router']();var fs_extra=require(_0x0f71('0x5'));var auth=require(_0x0f71('0x6'));var interaction=require(_0x0f71('0x7'));var config=require(_0x0f71('0x8'));var controller=require(_0x0f71('0x9'));router[_0x0f71('0xa')]('/',controller[_0x0f71('0xb')]);router[_0x0f71('0xc')]('/:id',auth[_0x0f71('0xd')](),controller[_0x0f71('0xe')]);router[_0x0f71('0xa')](_0x0f71('0xf'),auth[_0x0f71('0xd')](),controller[_0x0f71('0x10')]);module[_0x0f71('0x11')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 0a946e9..7d081f8 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 _0xfe77=['STRING','INTEGER','sequelize','exports','TEXT'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xfe77,0x6b));var _0x7fe7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfe77[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x7fe7('0x0'));module[_0x7fe7('0x1')]={'license':{'type':Sequelize[_0x7fe7('0x2')]},'data1':{'type':Sequelize[_0x7fe7('0x3')]},'data2':{'type':Sequelize[_0x7fe7('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0x7fe7('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1b07=['exports','TEXT','STRING','INTEGER'];(function(_0x47a827,_0x498c6d){var _0x5d83b6=function(_0x2607dd){while(--_0x2607dd){_0x47a827['push'](_0x47a827['shift']());}};_0x5d83b6(++_0x498c6d);}(_0x1b07,0x100));var _0x71b0=function(_0x9b3efc,_0x577a0d){_0x9b3efc=_0x9b3efc-0x0;var _0x200f05=_0x1b07[_0x9b3efc];return _0x200f05;};'use strict';var Sequelize=require('sequelize');module[_0x71b0('0x0')]={'license':{'type':Sequelize[_0x71b0('0x1')]},'data1':{'type':Sequelize[_0x71b0('0x2')]},'data2':{'type':Sequelize[_0x71b0('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0x71b0('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index 8292bac..cfa4940 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 _0xe554=['download','eml-format','zip-dir','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','../../config/license/util','index','model','keys','License','rawAttributes','query','filters','attributes','intersection','fields','merge','options','getLicense','catch','body','find','get','demo','downloadLogFile','license-info.log','log','xcally','Content-disposition','Content-Type','text/plain'];(function(_0x5dc1cb,_0x1dd487){var _0x5df13f=function(_0x20a271){while(--_0x20a271){_0x5dc1cb['push'](_0x5dc1cb['shift']());}};_0x5df13f(++_0x1dd487);}(_0xe554,0x150));var _0x4e55=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xe554[_0x3bf83f];return _0x22c4a9;};'use strict';var emlformat=require(_0x4e55('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4e55('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4e55('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x4e55('0x3'));var util=require('util');var path=require('path');var sox=require(_0x4e55('0x4'));var csv=require(_0x4e55('0x5'));var ejs=require(_0x4e55('0x6'));var fs=require('fs');var fs_extra=require(_0x4e55('0x7'));var _=require(_0x4e55('0x8'));var squel=require(_0x4e55('0x9'));var crypto=require(_0x4e55('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x4e55('0xb'));var toCsv=require('to-csv');var querystring=require(_0x4e55('0xc'));var Papa=require(_0x4e55('0xd'));var Redis=require(_0x4e55('0xe'));var authService=require(_0x4e55('0xf'));var qs=require(_0x4e55('0x10'));var as=require(_0x4e55('0x11'));var hardwareService=require(_0x4e55('0x12'));var logger=require(_0x4e55('0x13'))(_0x4e55('0x14'));var utils=require(_0x4e55('0x15'));var config=require(_0x4e55('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x55d10c,_0x4d5c9a){_0x4d5c9a=_0x4d5c9a||0xcc;return function(_0x59d89b){if(_0x59d89b){return _0x55d10c[_0x4e55('0x17')](_0x4d5c9a);}return _0x55d10c[_0x4e55('0x18')](_0x4d5c9a)[_0x4e55('0x19')]();};}function respondWithResult(_0x379e2d,_0x28b1c8){_0x28b1c8=_0x28b1c8||0xc8;return function(_0x1159f1){if(_0x1159f1){return _0x379e2d['status'](_0x28b1c8)['json'](_0x1159f1);}};}function respondWithFilteredResult(_0x109728,_0x2e31b9){return function(_0x1aca01){if(_0x1aca01){var _0x432283=typeof _0x2e31b9['offset']===_0x4e55('0x1a')&&typeof _0x2e31b9[_0x4e55('0x1b')]===_0x4e55('0x1a');var _0x3201c2=_0x1aca01[_0x4e55('0x1c')];var _0x2fc5a3=_0x432283?0x0:_0x2e31b9[_0x4e55('0x1d')];var _0x1cf6ef=_0x432283?_0x1aca01[_0x4e55('0x1c')]:_0x2e31b9[_0x4e55('0x1d')]+_0x2e31b9['limit'];var _0x3e1403;if(_0x1cf6ef>=_0x3201c2){_0x1cf6ef=_0x3201c2;_0x3e1403=0xc8;}else{_0x3e1403=0xce;}_0x109728[_0x4e55('0x18')](_0x3e1403);return _0x109728['set'](_0x4e55('0x1e'),_0x2fc5a3+'-'+_0x1cf6ef+'/'+_0x3201c2)[_0x4e55('0x1f')](_0x1aca01);}return null;};}function patchUpdates(_0x21a9f2){return function(_0x2f74d7){try{jsonpatch[_0x4e55('0x20')](_0x2f74d7,_0x21a9f2,!![]);}catch(_0x18ff56){return BPromise[_0x4e55('0x21')](_0x18ff56);}return _0x2f74d7[_0x4e55('0x22')]();};}function saveUpdates(_0x5918ae,_0x12cefd){return function(_0xe8e473){if(_0xe8e473){return _0xe8e473[_0x4e55('0x23')](_0x5918ae)[_0x4e55('0x24')](function(_0x598515){return _0x598515;});}return null;};}function removeEntity(_0x523fdc,_0x4704e4){return function(_0x335e43){if(_0x335e43){return _0x335e43[_0x4e55('0x25')]()[_0x4e55('0x24')](function(){_0x523fdc['status'](0xcc)[_0x4e55('0x19')]();});}};}function handleEntityNotFound(_0x18ec85,_0x5e7c47){return function(_0x32d3ae){if(!_0x32d3ae){_0x18ec85[_0x4e55('0x17')](0x194);}return _0x32d3ae;};}function handleError(_0x3a19b0,_0xfafb26){_0xfafb26=_0xfafb26||0x1f4;return function(_0x29cbc){logger['error'](_0x29cbc[_0x4e55('0x26')]);if(_0x29cbc[_0x4e55('0x27')]){delete _0x29cbc[_0x4e55('0x27')];}_0x3a19b0[_0x4e55('0x18')](_0xfafb26)['send'](_0x29cbc);};}var utilLicense=require(_0x4e55('0x28'));exports[_0x4e55('0x29')]=function(_0xe34738,_0x1fcb98){var _0x7c931d={'raw':!![],'where':{'id':0x1}},_0x1f818f={};_0x1f818f[_0x4e55('0x2a')]=_[_0x4e55('0x2b')](db[_0x4e55('0x2c')][_0x4e55('0x2d')]);_0x1f818f[_0x4e55('0x2e')]=_[_0x4e55('0x2b')](_0xe34738[_0x4e55('0x2e')]);_0x1f818f[_0x4e55('0x2f')]=_['intersection'](_0x1f818f[_0x4e55('0x2a')],_0x1f818f[_0x4e55('0x2e')]);_0x7c931d[_0x4e55('0x30')]=_[_0x4e55('0x31')](_0x1f818f[_0x4e55('0x2a')],qs[_0x4e55('0x32')](_0xe34738[_0x4e55('0x2e')][_0x4e55('0x32')]));_0x7c931d[_0x4e55('0x30')]=_0x7c931d['attributes']['length']?_0x7c931d[_0x4e55('0x30')]:_0x1f818f[_0x4e55('0x2a')];_0x7c931d=_[_0x4e55('0x33')]({},_0x7c931d,_0xe34738[_0x4e55('0x34')]);return utilLicense[_0x4e55('0x35')](_0x7c931d)[_0x4e55('0x24')](respondWithResult(_0x1fcb98,null))[_0x4e55('0x36')](handleError(_0x1fcb98,null));};exports['update']=function(_0x4f2cc3,_0x24c442){if(_0x4f2cc3[_0x4e55('0x37')]['id']){delete _0x4f2cc3[_0x4e55('0x37')]['id'];}return db['License'][_0x4e55('0x38')]({'where':{'id':_0x4f2cc3['params']['id']}})[_0x4e55('0x24')](handleEntityNotFound(_0x24c442,null))[_0x4e55('0x24')](function(_0x40d0c9){var _0x4d85e0=_0x40d0c9[_0x4e55('0x39')]({'plain':!![]});return utilLicense['checkLicense'](_0x4d85e0,_0x4f2cc3['body']['key']);})['then'](function(_0x37cea4){if(!_0x37cea4[_0x4e55('0x3a')]){return saveUpdates(_0x4f2cc3[_0x4e55('0x37')],null);}return _0x37cea4;})[_0x4e55('0x24')](respondWithResult(_0x24c442,null))['catch'](handleError(_0x24c442,null));};exports[_0x4e55('0x3b')]=function(_0x11e8e9,_0x18df68){var _0x1fd677=_0x4e55('0x3c');var _0x16a907=path['join']('/var',_0x4e55('0x3d'),_0x4e55('0x3e'),_0x1fd677);_0x18df68['setHeader'](_0x4e55('0x3f'),'attachment;\x20filename='+_0x1fd677);_0x18df68['set'](_0x4e55('0x40'),_0x4e55('0x41'));_0x18df68[_0x4e55('0x42')](_0x16a907);}; \ No newline at end of file +var _0x102b=['ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','reject','save','then','stack','name','../../config/license/util','index','keys','License','rawAttributes','query','filters','intersection','model','fields','attributes','length','options','getLicense','update','body','find','params','get','demo','catch','downloadLogFile','/var','log','setHeader','Content-Type','download','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse'];(function(_0x4f495f,_0x1844cd){var _0x5c08c9=function(_0x357e34){while(--_0x357e34){_0x4f495f['push'](_0x4f495f['shift']());}};_0x5c08c9(++_0x1844cd);}(_0x102b,0xb0));var _0xb102=function(_0x5e318b,_0xb5b4b3){_0x5e318b=_0x5e318b-0x0;var _0x15ea6d=_0x102b[_0x5e318b];return _0x15ea6d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb102('0x0'));var zipdir=require(_0xb102('0x1'));var jsonpatch=require(_0xb102('0x2'));var rp=require(_0xb102('0x3'));var moment=require('moment');var BPromise=require(_0xb102('0x4'));var Mustache=require(_0xb102('0x5'));var util=require('util');var path=require(_0xb102('0x6'));var sox=require(_0xb102('0x7'));var csv=require(_0xb102('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb102('0x9'));var _=require(_0xb102('0xa'));var squel=require(_0xb102('0xb'));var crypto=require(_0xb102('0xc'));var jsforce=require(_0xb102('0xd'));var deskjs=require(_0xb102('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb102('0xf'));var Redis=require(_0xb102('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb102('0x11'));var hardwareService=require(_0xb102('0x12'));var logger=require(_0xb102('0x13'))('api');var utils=require(_0xb102('0x14'));var config=require(_0xb102('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xb102('0x16'))['db'];function respondWithStatusCode(_0x34a18a,_0x5dadc7){_0x5dadc7=_0x5dadc7||0xcc;return function(_0x1b42b4){if(_0x1b42b4){return _0x34a18a[_0xb102('0x17')](_0x5dadc7);}return _0x34a18a[_0xb102('0x18')](_0x5dadc7)[_0xb102('0x19')]();};}function respondWithResult(_0x4f322c,_0x4ed54d){_0x4ed54d=_0x4ed54d||0xc8;return function(_0x43267a){if(_0x43267a){return _0x4f322c['status'](_0x4ed54d)[_0xb102('0x1a')](_0x43267a);}};}function respondWithFilteredResult(_0x5e5054,_0x48d200){return function(_0x385a0b){if(_0x385a0b){var _0x2e1090=typeof _0x48d200[_0xb102('0x1b')]===_0xb102('0x1c')&&typeof _0x48d200['limit']===_0xb102('0x1c');var _0x2cb6de=_0x385a0b[_0xb102('0x1d')];var _0xae1ef7=_0x2e1090?0x0:_0x48d200['offset'];var _0x4ecd5a=_0x2e1090?_0x385a0b[_0xb102('0x1d')]:_0x48d200[_0xb102('0x1b')]+_0x48d200['limit'];var _0x4eb2fa;if(_0x4ecd5a>=_0x2cb6de){_0x4ecd5a=_0x2cb6de;_0x4eb2fa=0xc8;}else{_0x4eb2fa=0xce;}_0x5e5054[_0xb102('0x18')](_0x4eb2fa);return _0x5e5054['set'](_0xb102('0x1e'),_0xae1ef7+'-'+_0x4ecd5a+'/'+_0x2cb6de)[_0xb102('0x1a')](_0x385a0b);}return null;};}function patchUpdates(_0x19574f){return function(_0x2ece43){try{jsonpatch[_0xb102('0x1f')](_0x2ece43,_0x19574f,!![]);}catch(_0x1c2e88){return BPromise[_0xb102('0x20')](_0x1c2e88);}return _0x2ece43[_0xb102('0x21')]();};}function saveUpdates(_0x595b77,_0x225023){return function(_0x42404b){if(_0x42404b){return _0x42404b['update'](_0x595b77)[_0xb102('0x22')](function(_0x5f41f0){return _0x5f41f0;});}return null;};}function removeEntity(_0x1dbcc9,_0x74a9e5){return function(_0xf895cf){if(_0xf895cf){return _0xf895cf['destroy']()[_0xb102('0x22')](function(){_0x1dbcc9[_0xb102('0x18')](0xcc)[_0xb102('0x19')]();});}};}function handleEntityNotFound(_0x53556d,_0x19ca99){return function(_0x4f2cf7){if(!_0x4f2cf7){_0x53556d[_0xb102('0x17')](0x194);}return _0x4f2cf7;};}function handleError(_0x493801,_0x4714ac){_0x4714ac=_0x4714ac||0x1f4;return function(_0x3a1e13){logger['error'](_0x3a1e13[_0xb102('0x23')]);if(_0x3a1e13[_0xb102('0x24')]){delete _0x3a1e13[_0xb102('0x24')];}_0x493801[_0xb102('0x18')](_0x4714ac)['send'](_0x3a1e13);};}var utilLicense=require(_0xb102('0x25'));exports[_0xb102('0x26')]=function(_0x3198ef,_0x4042ae){var _0x2b7a99={'raw':!![],'where':{'id':0x1}},_0x2dfc7e={};_0x2dfc7e['model']=_[_0xb102('0x27')](db[_0xb102('0x28')][_0xb102('0x29')]);_0x2dfc7e[_0xb102('0x2a')]=_[_0xb102('0x27')](_0x3198ef[_0xb102('0x2a')]);_0x2dfc7e[_0xb102('0x2b')]=_[_0xb102('0x2c')](_0x2dfc7e['model'],_0x2dfc7e['query']);_0x2b7a99['attributes']=_['intersection'](_0x2dfc7e[_0xb102('0x2d')],qs[_0xb102('0x2e')](_0x3198ef[_0xb102('0x2a')][_0xb102('0x2e')]));_0x2b7a99[_0xb102('0x2f')]=_0x2b7a99[_0xb102('0x2f')][_0xb102('0x30')]?_0x2b7a99['attributes']:_0x2dfc7e[_0xb102('0x2d')];_0x2b7a99=_['merge']({},_0x2b7a99,_0x3198ef[_0xb102('0x31')]);return utilLicense[_0xb102('0x32')](_0x2b7a99)['then'](respondWithResult(_0x4042ae,null))['catch'](handleError(_0x4042ae,null));};exports[_0xb102('0x33')]=function(_0x1702d6,_0x13d532){if(_0x1702d6[_0xb102('0x34')]['id']){delete _0x1702d6['body']['id'];}return db[_0xb102('0x28')][_0xb102('0x35')]({'where':{'id':_0x1702d6[_0xb102('0x36')]['id']}})['then'](handleEntityNotFound(_0x13d532,null))[_0xb102('0x22')](function(_0x510bcf){var _0x499b66=_0x510bcf[_0xb102('0x37')]({'plain':!![]});return utilLicense['checkLicense'](_0x499b66,_0x1702d6[_0xb102('0x34')]['key']);})['then'](function(_0x510f1c){if(!_0x510f1c[_0xb102('0x38')]){return saveUpdates(_0x1702d6[_0xb102('0x34')],null);}return _0x510f1c;})[_0xb102('0x22')](respondWithResult(_0x13d532,null))[_0xb102('0x39')](handleError(_0x13d532,null));};exports[_0xb102('0x3a')]=function(_0x564b41,_0x43950e){var _0x5abdf0='license-info.log';var _0x275674=path['join'](_0xb102('0x3b'),_0xb102('0x3c'),'xcally',_0x5abdf0);_0x43950e[_0xb102('0x3d')]('Content-disposition','attachment;\x20filename='+_0x5abdf0);_0x43950e['set'](_0xb102('0x3e'),'text/plain');_0x43950e[_0xb102('0x3f')](_0x275674);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 17f46ce..5d001ed 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 _0x3b79=['path','rimraf','../../config/environment','exports','define','License','license','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x33add6,_0x435ffe){var _0x1d96ec=function(_0xd9d641){while(--_0xd9d641){_0x33add6['push'](_0x33add6['shift']());}};_0x1d96ec(++_0x435ffe);}(_0x3b79,0x1db));var _0x93b7=function(_0x78490b,_0x2c236f){_0x78490b=_0x78490b-0x0;var _0xf4b53b=_0x3b79[_0x78490b];return _0xf4b53b;};'use strict';var _=require('lodash');var util=require(_0x93b7('0x0'));var logger=require(_0x93b7('0x1'))(_0x93b7('0x2'));var moment=require(_0x93b7('0x3'));var BPromise=require(_0x93b7('0x4'));var rp=require(_0x93b7('0x5'));var fs=require('fs');var path=require(_0x93b7('0x6'));var rimraf=require(_0x93b7('0x7'));var config=require(_0x93b7('0x8'));var attributes=require('./license.attributes');module[_0x93b7('0x9')]=function(_0x353d22,_0x79426c){return _0x353d22[_0x93b7('0xa')](_0x93b7('0xb'),attributes,{'tableName':_0x93b7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x607d=['license','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./license.attributes','exports','define','License'];(function(_0x566de2,_0x86d8d8){var _0x2fc0b6=function(_0x29559c){while(--_0x29559c){_0x566de2['push'](_0x566de2['shift']());}};_0x2fc0b6(++_0x86d8d8);}(_0x607d,0x109));var _0xd607=function(_0x44d6e2,_0x220aa1){_0x44d6e2=_0x44d6e2-0x0;var _0xc0707d=_0x607d[_0x44d6e2];return _0xc0707d;};'use strict';var _=require(_0xd607('0x0'));var util=require(_0xd607('0x1'));var logger=require(_0xd607('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd607('0x3'));var fs=require('fs');var path=require(_0xd607('0x4'));var rimraf=require(_0xd607('0x5'));var config=require(_0xd607('0x6'));var attributes=require(_0xd607('0x7'));module[_0xd607('0x8')]=function(_0x729f28,_0x1200cb){return _0x729f28[_0xd607('0x9')](_0xd607('0xa'),attributes,{'tableName':_0xd607('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 52cd6eb..e82053d 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 _0xb247=['request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','License,\x20%s,\x20%s','debug','License,\x20%s,\x20%s,\x20%s'];(function(_0x2aaba4,_0x55b81c){var _0x263e18=function(_0x2945c4){while(--_0x2945c4){_0x2aaba4['push'](_0x2aaba4['shift']());}};_0x263e18(++_0x55b81c);}(_0xb247,0x1a8));var _0x7b24=function(_0x2e6544,_0x168aef){_0x2e6544=_0x2e6544-0x0;var _0x8dceb5=_0xb247[_0x2e6544];return _0x8dceb5;};'use strict';var _=require(_0x7b24('0x0'));var util=require(_0x7b24('0x1'));var moment=require(_0x7b24('0x2'));var BPromise=require(_0x7b24('0x3'));var rs=require(_0x7b24('0x4'));var fs=require('fs');var Redis=require(_0x7b24('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7b24('0x6'));var logger=require(_0x7b24('0x7'))(_0x7b24('0x8'));var config=require(_0x7b24('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x44ea42,_0x5a2f0d,_0x548aab){return new BPromise(function(_0x349a16,_0x313bdc){return client[_0x7b24('0xa')](_0x44ea42,_0x548aab)[_0x7b24('0xb')](function(_0x35a5b7){logger[_0x7b24('0xc')](_0x7b24('0xd'),_0x5a2f0d,'request\x20sent');logger[_0x7b24('0xe')](_0x7b24('0xf'),_0x5a2f0d,_0x7b24('0x10'),JSON[_0x7b24('0x11')](_0x35a5b7));if(_0x35a5b7[_0x7b24('0x12')]){if(_0x35a5b7[_0x7b24('0x12')]['code']===0x1f4){logger[_0x7b24('0x12')]('License,\x20%s,\x20%s',_0x5a2f0d,_0x35a5b7['error']['message']);return _0x313bdc(_0x35a5b7[_0x7b24('0x12')][_0x7b24('0x13')]);}logger[_0x7b24('0x12')]('License,\x20%s,\x20%s',_0x5a2f0d,_0x35a5b7[_0x7b24('0x12')]['message']);return _0x349a16(_0x35a5b7[_0x7b24('0x12')][_0x7b24('0x13')]);}else{logger[_0x7b24('0xc')](_0x7b24('0xd'),_0x5a2f0d,_0x7b24('0x10'));_0x349a16(_0x35a5b7[_0x7b24('0x14')][_0x7b24('0x13')]);}})[_0x7b24('0x15')](function(_0x218349){logger[_0x7b24('0x12')](_0x7b24('0xd'),_0x5a2f0d,_0x218349);_0x313bdc(_0x218349);});});} \ No newline at end of file +var _0x912b=['jayson/promise','client','http','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x912b,0x12d));var _0xb912=function(_0x10d34b,_0x4fef76){_0x10d34b=_0x10d34b-0x0;var _0x92b0bf=_0x912b[_0x10d34b];return _0x92b0bf;};'use strict';var _=require(_0xb912('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb912('0x1'));var rs=require(_0xb912('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb912('0x3'))['db'];var utils=require(_0xb912('0x4'));var logger=require(_0xb912('0x5'))('rpc');var config=require(_0xb912('0x6'));var jayson=require(_0xb912('0x7'));var client=jayson[_0xb912('0x8')][_0xb912('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2861de,_0x5f4365,_0x433f1a){return new BPromise(function(_0x1fc434,_0x5ce8dd){return client[_0xb912('0xa')](_0x2861de,_0x433f1a)[_0xb912('0xb')](function(_0x68f244){logger[_0xb912('0xc')](_0xb912('0xd'),_0x5f4365,_0xb912('0xe'));logger[_0xb912('0xf')](_0xb912('0x10'),_0x5f4365,_0xb912('0xe'),JSON[_0xb912('0x11')](_0x68f244));if(_0x68f244[_0xb912('0x12')]){if(_0x68f244['error'][_0xb912('0x13')]===0x1f4){logger[_0xb912('0x12')]('License,\x20%s,\x20%s',_0x5f4365,_0x68f244[_0xb912('0x12')]['message']);return _0x5ce8dd(_0x68f244['error'][_0xb912('0x14')]);}logger['error']('License,\x20%s,\x20%s',_0x5f4365,_0x68f244[_0xb912('0x12')][_0xb912('0x14')]);return _0x1fc434(_0x68f244[_0xb912('0x12')][_0xb912('0x14')]);}else{logger[_0xb912('0xc')](_0xb912('0xd'),_0x5f4365,_0xb912('0xe'));_0x1fc434(_0x68f244['result']['message']);}})[_0xb912('0x15')](function(_0x4fbf24){logger[_0xb912('0x12')](_0xb912('0xd'),_0x5f4365,_0x4fbf24);_0x5ce8dd(_0x4fbf24);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 481ece8..eb66659 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 _0x7d79=['getAnswers','getImap','getSmtp','/:id/interactions','getInteractions','/:id/applications','/:id/verify','/:id/users','getAgents','post','addAnswer','create','addImap','/:id/out_servers','addInteraction','addApplications','/:id/send','addAgents','put','update','removeDispositions','delete','removeAnswers','/:id/in_servers','removeImap','removeSmtp','destroy','removeAgents','exports','multer','util','path','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers'];(function(_0x1a3c37,_0x36504a){var _0x285fd6=function(_0x26454f){while(--_0x26454f){_0x1a3c37['push'](_0x1a3c37['shift']());}};_0x285fd6(++_0x36504a);}(_0x7d79,0x75));var _0x97d7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7d79[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x97d7('0x0'));var util=require(_0x97d7('0x1'));var path=require(_0x97d7('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x97d7('0x3'));var auth=require(_0x97d7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x97d7('0x5'));var controller=require('./mailAccount.controller');router[_0x97d7('0x6')]('/',auth[_0x97d7('0x7')](),controller['index']);router[_0x97d7('0x6')](_0x97d7('0x8'),auth[_0x97d7('0x7')](),controller[_0x97d7('0x9')]);router[_0x97d7('0x6')](_0x97d7('0xa'),auth['isAuthenticated'](),controller[_0x97d7('0xb')]);router['get'](_0x97d7('0xc'),auth[_0x97d7('0x7')](),controller[_0x97d7('0xd')]);router[_0x97d7('0x6')](_0x97d7('0xe'),auth[_0x97d7('0x7')](),controller[_0x97d7('0xf')]);router[_0x97d7('0x6')]('/:id/in_servers',auth[_0x97d7('0x7')](),controller[_0x97d7('0x10')]);router[_0x97d7('0x6')]('/:id/out_servers',auth[_0x97d7('0x7')](),controller[_0x97d7('0x11')]);router[_0x97d7('0x6')](_0x97d7('0x12'),auth[_0x97d7('0x7')](),controller[_0x97d7('0x13')]);router[_0x97d7('0x6')](_0x97d7('0x14'),auth[_0x97d7('0x7')](),controller['getApplications']);router[_0x97d7('0x6')]('/:id/messages',auth[_0x97d7('0x7')](),controller['getMessages']);router[_0x97d7('0x6')](_0x97d7('0x15'),auth[_0x97d7('0x7')](),controller['verifySmtp']);router[_0x97d7('0x6')](_0x97d7('0x16'),auth[_0x97d7('0x7')](),controller[_0x97d7('0x17')]);router[_0x97d7('0x18')](_0x97d7('0xc'),auth[_0x97d7('0x7')](),controller['addDisposition']);router['post'](_0x97d7('0xe'),auth[_0x97d7('0x7')](),controller[_0x97d7('0x19')]);router[_0x97d7('0x18')]('/',auth[_0x97d7('0x7')](),controller[_0x97d7('0x1a')]);router[_0x97d7('0x18')]('/:id/in_servers',auth[_0x97d7('0x7')](),controller[_0x97d7('0x1b')]);router[_0x97d7('0x18')](_0x97d7('0x1c'),auth[_0x97d7('0x7')](),controller['addSmtp']);router['post'](_0x97d7('0x12'),auth[_0x97d7('0x7')](),controller[_0x97d7('0x1d')]);router[_0x97d7('0x18')]('/:id/applications',auth[_0x97d7('0x7')](),controller[_0x97d7('0x1e')]);router[_0x97d7('0x18')](_0x97d7('0x1f'),auth[_0x97d7('0x7')](),controller['send']);router[_0x97d7('0x18')](_0x97d7('0x16'),auth['isAuthenticated'](),controller[_0x97d7('0x20')]);router[_0x97d7('0x21')](_0x97d7('0xa'),auth[_0x97d7('0x7')](),controller[_0x97d7('0x22')]);router['delete'](_0x97d7('0xc'),auth[_0x97d7('0x7')](),controller[_0x97d7('0x23')]);router[_0x97d7('0x24')](_0x97d7('0xe'),auth[_0x97d7('0x7')](),controller[_0x97d7('0x25')]);router[_0x97d7('0x24')](_0x97d7('0x26'),auth[_0x97d7('0x7')](),controller[_0x97d7('0x27')]);router[_0x97d7('0x24')]('/:id/out_servers',auth[_0x97d7('0x7')](),controller[_0x97d7('0x28')]);router[_0x97d7('0x24')]('/:id',auth[_0x97d7('0x7')](),controller[_0x97d7('0x29')]);router[_0x97d7('0x24')](_0x97d7('0x16'),auth[_0x97d7('0x7')](),controller[_0x97d7('0x2a')]);module[_0x97d7('0x2b')]=router; \ No newline at end of file +var _0xda00=['/:id/users','addAgents','update','delete','removeDispositions','removeImap','removeSmtp','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','getSmtp','/:id/interactions','getInteractions','/:id/messages','getMessages','/:id/verify','verifySmtp','addDisposition','post','addAnswer','addImap','/:id/out_servers','addSmtp','addInteraction','/:id/applications','addApplications'];(function(_0x54f08d,_0x4386f3){var _0x6d7d60=function(_0x5681f5){while(--_0x5681f5){_0x54f08d['push'](_0x54f08d['shift']());}};_0x6d7d60(++_0x4386f3);}(_0xda00,0xc1));var _0x0da0=function(_0x18e237,_0x20a38e){_0x18e237=_0x18e237-0x0;var _0x44fb16=_0xda00[_0x18e237];return _0x44fb16;};'use strict';var multer=require('multer');var util=require(_0x0da0('0x0'));var path=require(_0x0da0('0x1'));var timeout=require(_0x0da0('0x2'));var express=require(_0x0da0('0x3'));var router=express['Router']();var fs_extra=require(_0x0da0('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0da0('0x5'));var config=require(_0x0da0('0x6'));var controller=require(_0x0da0('0x7'));router[_0x0da0('0x8')]('/',auth['isAuthenticated'](),controller[_0x0da0('0x9')]);router[_0x0da0('0x8')](_0x0da0('0xa'),auth[_0x0da0('0xb')](),controller[_0x0da0('0xc')]);router[_0x0da0('0x8')](_0x0da0('0xd'),auth['isAuthenticated'](),controller[_0x0da0('0xe')]);router[_0x0da0('0x8')](_0x0da0('0xf'),auth[_0x0da0('0xb')](),controller[_0x0da0('0x10')]);router[_0x0da0('0x8')](_0x0da0('0x11'),auth[_0x0da0('0xb')](),controller[_0x0da0('0x12')]);router[_0x0da0('0x8')](_0x0da0('0x13'),auth['isAuthenticated'](),controller[_0x0da0('0x14')]);router[_0x0da0('0x8')]('/:id/out_servers',auth[_0x0da0('0xb')](),controller[_0x0da0('0x15')]);router[_0x0da0('0x8')](_0x0da0('0x16'),auth[_0x0da0('0xb')](),controller[_0x0da0('0x17')]);router[_0x0da0('0x8')]('/:id/applications',auth[_0x0da0('0xb')](),controller['getApplications']);router[_0x0da0('0x8')](_0x0da0('0x18'),auth[_0x0da0('0xb')](),controller[_0x0da0('0x19')]);router[_0x0da0('0x8')](_0x0da0('0x1a'),auth[_0x0da0('0xb')](),controller[_0x0da0('0x1b')]);router[_0x0da0('0x8')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router['post'](_0x0da0('0xf'),auth['isAuthenticated'](),controller[_0x0da0('0x1c')]);router[_0x0da0('0x1d')](_0x0da0('0x11'),auth[_0x0da0('0xb')](),controller[_0x0da0('0x1e')]);router['post']('/',auth[_0x0da0('0xb')](),controller['create']);router[_0x0da0('0x1d')](_0x0da0('0x13'),auth['isAuthenticated'](),controller[_0x0da0('0x1f')]);router[_0x0da0('0x1d')](_0x0da0('0x20'),auth[_0x0da0('0xb')](),controller[_0x0da0('0x21')]);router[_0x0da0('0x1d')](_0x0da0('0x16'),auth[_0x0da0('0xb')](),controller[_0x0da0('0x22')]);router[_0x0da0('0x1d')](_0x0da0('0x23'),auth[_0x0da0('0xb')](),controller[_0x0da0('0x24')]);router[_0x0da0('0x1d')]('/:id/send',auth[_0x0da0('0xb')](),controller['send']);router[_0x0da0('0x1d')](_0x0da0('0x25'),auth['isAuthenticated'](),controller[_0x0da0('0x26')]);router['put']('/:id',auth[_0x0da0('0xb')](),controller[_0x0da0('0x27')]);router[_0x0da0('0x28')](_0x0da0('0xf'),auth[_0x0da0('0xb')](),controller[_0x0da0('0x29')]);router[_0x0da0('0x28')](_0x0da0('0x11'),auth['isAuthenticated'](),controller['removeAnswers']);router[_0x0da0('0x28')](_0x0da0('0x13'),auth['isAuthenticated'](),controller[_0x0da0('0x2a')]);router[_0x0da0('0x28')](_0x0da0('0x20'),auth[_0x0da0('0xb')](),controller[_0x0da0('0x2b')]);router[_0x0da0('0x28')](_0x0da0('0xd'),auth[_0x0da0('0xb')](),controller[_0x0da0('0x2c')]);router[_0x0da0('0x28')](_0x0da0('0x25'),auth[_0x0da0('0xb')](),controller['removeAgents']);module[_0x0da0('0x2d')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 1dfc4ed..0d92687 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 _0x1277=['provider','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','ENUM','gmail','hotmail','yahoo','getDataValue','custom'];(function(_0x2aae09,_0x1a0169){var _0x2e8d72=function(_0x25f7cd){while(--_0x25f7cd){_0x2aae09['push'](_0x2aae09['shift']());}};_0x2e8d72(++_0x1a0169);}(_0x1277,0x7f));var _0x7127=function(_0x35294e,_0x11a9e8){_0x35294e=_0x35294e-0x0;var _0x2de2ba=_0x1277[_0x35294e];return _0x2de2ba;};'use strict';var Sequelize=require('sequelize');module[_0x7127('0x0')]={'description':{'type':Sequelize[_0x7127('0x1')]},'name':{'type':Sequelize[_0x7127('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x7127('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x7127('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x7127('0x2')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0x7127('0x3')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x7127('0x1')],'allowNull':![],'defaultValue':_0x7127('0x4')},'fontSize':{'type':Sequelize[_0x7127('0x5')](0x2)[_0x7127('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x7127('0x3')],'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[_0x7127('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x7127('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x7127('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x7127('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x7127('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7127('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7127('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7127('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x7127('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x7127('0x2')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x3d439e){if(!_0x3d439e)this[_0x7127('0x8')](_0x7127('0x9'),null);this[_0x7127('0x8')](_0x7127('0xa'),_0x3d439e);}},'provider':{'type':Sequelize[_0x7127('0xb')](_0x7127('0xc'),_0x7127('0xd'),_0x7127('0xe'),'outlook365'),'defaultValue':null,'get':function(){if(!this[_0x7127('0xf')]('provider'))return _0x7127('0x10');return this[_0x7127('0xf')](_0x7127('0x11'));},'set':function(_0x2a69ac){if(_0x2a69ac===_0x7127('0x10'))_0x2a69ac=null;return this[_0x7127('0x8')](_0x7127('0x11'),_0x2a69ac);}}}; \ No newline at end of file +var _0xfb86=['TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','ENUM','gmail','hotmail','yahoo','outlook365','provider','custom','sequelize','STRING','BOOLEAN','Arial,Helvetica,sans-serif','UNSIGNED'];(function(_0x5af59e,_0x3771c1){var _0x4240df=function(_0x2267fd){while(--_0x2267fd){_0x5af59e['push'](_0x5af59e['shift']());}};_0x4240df(++_0x3771c1);}(_0xfb86,0x177));var _0x6fb8=function(_0x5dd35a,_0x543f8d){_0x5dd35a=_0x5dd35a-0x0;var _0x6a3f73=_0xfb86[_0x5dd35a];return _0x6a3f73;};'use strict';var Sequelize=require(_0x6fb8('0x0'));module['exports']={'description':{'type':Sequelize[_0x6fb8('0x1')]},'name':{'type':Sequelize[_0x6fb8('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x6fb8('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x6fb8('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x6fb8('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0x6fb8('0x1')],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0x6fb8('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x6fb8('0x1')],'allowNull':![],'defaultValue':_0x6fb8('0x3')},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0x6fb8('0x4')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x6fb8('0x5')],'defaultValue':function(){return _0x6fb8('0x6');}},'notificationSound':{'type':Sequelize[_0x6fb8('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x6fb8('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x6fb8('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6fb8('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6fb8('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6fb8('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x6fb8('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x6fb8('0x2')],'defaultValue':![],'comment':_0x6fb8('0x9'),'set':function(_0x5b6fec){if(!_0x5b6fec)this[_0x6fb8('0xa')](_0x6fb8('0xb'),null);this['setDataValue']('mandatoryDisposition',_0x5b6fec);}},'provider':{'type':Sequelize[_0x6fb8('0xc')](_0x6fb8('0xd'),_0x6fb8('0xe'),_0x6fb8('0xf'),_0x6fb8('0x10')),'defaultValue':null,'get':function(){if(!this['getDataValue'](_0x6fb8('0x11')))return _0x6fb8('0x12');return this['getDataValue'](_0x6fb8('0x11'));},'set':function(_0x201b7d){if(_0x201b7d==='custom')_0x201b7d=null;return this['setDataValue'](_0x6fb8('0x11'),_0x201b7d);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 73b92c7..b9e4bcf 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 _0x6d4c=['stringify','error','code','message','result','catch','status','end','offset','undefined','limit','count','set','Content-Range','json','then','destroy','MailAccounts','UserProfileResource','sendStatus','stack','name','send','Imap','MailServerOut','Smtp','mandatoryDispositionPause','MailAccount','rawAttributes','type','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','include','findAll','rows','show','params','MailServerIn','Pause','includeAll','find','update','body','modernAuthentication','CloudProviderId','describe','addDisposition','MailAccountId','create','findOne','options','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','key','provider','custom','email','isNil','active','description','user','username','password','pass','service','host','port','authentication','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','MailInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tags','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','true','CmList','List','CmContact','Contacts','DESC','from','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','auth','secure','SendMail','sendMail','ListId','List\x20not\x20found','out','messageId','Interaction','verifySmtp','CloudProvider','OAuth2','data5','Sequelize','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','User','bluebird','util','path','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./mailAccount.socket','register','http','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s'];(function(_0x166d58,_0x2aae3e){var _0x2f9424=function(_0x1d137f){while(--_0x1d137f){_0x166d58['push'](_0x166d58['shift']());}};_0x2f9424(++_0x2aae3e);}(_0x6d4c,0xa5));var _0xc6d4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6d4c[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require('moment');var BPromise=require(_0xc6d4('0x0'));var util=require(_0xc6d4('0x1'));var path=require(_0xc6d4('0x2'));var _=require(_0xc6d4('0x3'));var juice=require('juice');var Redis=require(_0xc6d4('0x4'));var qs=require('../../components/parsers/qs');var logger=require(_0xc6d4('0x5'))(_0xc6d4('0x6'));var config=require(_0xc6d4('0x7'));var db=require(_0xc6d4('0x8'))['db'];config[_0xc6d4('0x9')]=_[_0xc6d4('0xa')](config[_0xc6d4('0x9')],{'host':_0xc6d4('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc6d4('0x9')]));require(_0xc6d4('0xc'))[_0xc6d4('0xd')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xc6d4('0xe')]({'port':0x232b});function respondWithRpcPromise(_0x221255,_0xcf4d93,_0x20703c,_0x13d39b){return new BPromise(function(_0x39988f,_0x14d953){var _0x3a5e08=_0x13d39b||client;return _0x3a5e08['request'](_0x221255,_0x20703c)['then'](function(_0x3754b2){logger[_0xc6d4('0xf')](_0xc6d4('0x10'),_0xcf4d93,_0xc6d4('0x11'));logger[_0xc6d4('0x12')](_0xc6d4('0x13'),_0xcf4d93,_0xc6d4('0x11'),JSON[_0xc6d4('0x14')](_0x3754b2));if(_0x3754b2[_0xc6d4('0x15')]){if(_0x3754b2[_0xc6d4('0x15')][_0xc6d4('0x16')]===0x1f4){logger['error'](_0xc6d4('0x10'),_0xcf4d93,_0x3754b2['error'][_0xc6d4('0x17')]);return _0x14d953(_0x3754b2[_0xc6d4('0x15')]['message']);}logger[_0xc6d4('0x15')](_0xc6d4('0x10'),_0xcf4d93,_0x3754b2[_0xc6d4('0x15')][_0xc6d4('0x17')]);return _0x39988f(_0x3754b2[_0xc6d4('0x15')][_0xc6d4('0x17')]);}else{logger[_0xc6d4('0xf')](_0xc6d4('0x10'),_0xcf4d93,'request\x20sent');_0x39988f(_0x3754b2[_0xc6d4('0x18')]['message']);}})[_0xc6d4('0x19')](function(_0x13b7e7){logger[_0xc6d4('0x15')]('MailAccount,\x20%s,\x20%s',_0xcf4d93,_0x13b7e7);_0x14d953(_0x13b7e7);});});}function respondWithStatusCode(_0x32e10a,_0x303007){_0x303007=_0x303007||0xcc;return function(_0x40cdc7){if(_0x40cdc7){return _0x32e10a['sendStatus'](_0x303007);}return _0x32e10a[_0xc6d4('0x1a')](_0x303007)[_0xc6d4('0x1b')]();};}function respondWithResult(_0x52d92d,_0x1a7a97){_0x1a7a97=_0x1a7a97||0xc8;return function(_0x404e1c){if(_0x404e1c){return _0x52d92d[_0xc6d4('0x1a')](_0x1a7a97)['json'](_0x404e1c);}};}function respondWithFilteredResult(_0x436683,_0x5c9d84){return function(_0x1ff4a9){if(_0x1ff4a9){var _0x2eaa2e=typeof _0x5c9d84[_0xc6d4('0x1c')]===_0xc6d4('0x1d')&&typeof _0x5c9d84[_0xc6d4('0x1e')]===_0xc6d4('0x1d');var _0x59e360=_0x1ff4a9['count'];var _0xc21ceb=_0x2eaa2e?0x0:_0x5c9d84[_0xc6d4('0x1c')];var _0xb10c97=_0x2eaa2e?_0x1ff4a9[_0xc6d4('0x1f')]:_0x5c9d84['offset']+_0x5c9d84[_0xc6d4('0x1e')];var _0x38b4e1;if(_0xb10c97>=_0x59e360){_0xb10c97=_0x59e360;_0x38b4e1=0xc8;}else{_0x38b4e1=0xce;}_0x436683[_0xc6d4('0x1a')](_0x38b4e1);return _0x436683[_0xc6d4('0x20')](_0xc6d4('0x21'),_0xc21ceb+'-'+_0xb10c97+'/'+_0x59e360)[_0xc6d4('0x22')](_0x1ff4a9);}return null;};}function saveUpdates(_0x3ed95b){return function(_0x334013){if(_0x334013){return _0x334013['update'](_0x3ed95b)[_0xc6d4('0x23')](function(_0xf4204e){return _0xf4204e;});}return null;};}function removeEntity(_0x40f558){return function(_0x2d6cab){if(_0x2d6cab){return _0x2d6cab[_0xc6d4('0x24')]()[_0xc6d4('0x23')](function(){var _0x105c66=_0x2d6cab['get']({'plain':!![]});var _0x587bff=_0xc6d4('0x25');return db[_0xc6d4('0x26')][_0xc6d4('0x24')]({'where':{'type':_0x587bff,'resourceId':_0x105c66['id']}})[_0xc6d4('0x23')](function(){return _0x2d6cab;});})[_0xc6d4('0x23')](function(){_0x40f558[_0xc6d4('0x1a')](0xcc)[_0xc6d4('0x1b')]();});}};}function handleEntityNotFound(_0x1d6a6a){return function(_0x44897a){if(!_0x44897a){_0x1d6a6a[_0xc6d4('0x27')](0x194);}return _0x44897a;};}function handleError(_0x383b9c,_0x36c0b4){_0x36c0b4=_0x36c0b4||0x1f4;return function(_0x4a5b31){logger[_0xc6d4('0x15')](_0x4a5b31[_0xc6d4('0x28')]);if(_0x4a5b31['name']){delete _0x4a5b31[_0xc6d4('0x29')];}_0x383b9c[_0xc6d4('0x1a')](_0x36c0b4)[_0xc6d4('0x2a')](_0x4a5b31);};}exports['index']=function(_0x4e04f3,_0x20bbcf){var _0x53531e={'include':[{'model':db['MailServerIn'],'as':_0xc6d4('0x2b')},{'model':db[_0xc6d4('0x2c')],'as':_0xc6d4('0x2d')},{'model':db['Pause'],'as':_0xc6d4('0x2e')}]},_0x51eb34={},_0x9ee989={'count':0x0,'rows':[]};var _0x3ac106=_['map'](db[_0xc6d4('0x2f')][_0xc6d4('0x30')],function(_0x1bff08){return{'name':_0x1bff08['fieldName'],'type':_0x1bff08[_0xc6d4('0x31')]['key']};});_0x51eb34[_0xc6d4('0x32')]=_[_0xc6d4('0x33')](_0x3ac106,'name');_0x51eb34[_0xc6d4('0x34')]=_[_0xc6d4('0x35')](_0x4e04f3[_0xc6d4('0x34')]);_0x51eb34['filters']=_['intersection'](_0x51eb34[_0xc6d4('0x32')],_0x51eb34[_0xc6d4('0x34')]);_0x53531e['attributes']=_[_0xc6d4('0x36')](_0x51eb34[_0xc6d4('0x32')],qs[_0xc6d4('0x37')](_0x4e04f3[_0xc6d4('0x34')]['fields']));_0x53531e['attributes']=_0x53531e[_0xc6d4('0x38')][_0xc6d4('0x39')]?_0x53531e['attributes']:_0x51eb34[_0xc6d4('0x32')];if(!_0x4e04f3[_0xc6d4('0x34')][_0xc6d4('0x3a')](_0xc6d4('0x3b'))){_0x53531e[_0xc6d4('0x1e')]=qs[_0xc6d4('0x1e')](_0x4e04f3[_0xc6d4('0x34')][_0xc6d4('0x1e')]);_0x53531e[_0xc6d4('0x1c')]=qs[_0xc6d4('0x1c')](_0x4e04f3[_0xc6d4('0x34')][_0xc6d4('0x1c')]);}_0x53531e[_0xc6d4('0x3c')]=qs[_0xc6d4('0x3d')](_0x4e04f3[_0xc6d4('0x34')][_0xc6d4('0x3d')]);_0x53531e[_0xc6d4('0x3e')]=qs[_0xc6d4('0x3f')](_[_0xc6d4('0x40')](_0x4e04f3[_0xc6d4('0x34')],_0x51eb34[_0xc6d4('0x3f')]),_0x3ac106);if(_0x4e04f3[_0xc6d4('0x34')][_0xc6d4('0x41')]){_0x53531e[_0xc6d4('0x3e')]=_[_0xc6d4('0x42')](_0x53531e[_0xc6d4('0x3e')],{'$or':_['map'](_0x3ac106,function(_0x37fe98){if(_0x37fe98[_0xc6d4('0x31')]!==_0xc6d4('0x43')){var _0x5e2975={};_0x5e2975[_0x37fe98['name']]={'$like':'%'+_0x4e04f3[_0xc6d4('0x34')][_0xc6d4('0x41')]+'%'};return _0x5e2975;}})});}_0x53531e=_[_0xc6d4('0x42')]({},_0x53531e,_0x4e04f3['options']);var _0x1ff060={'where':_0x53531e[_0xc6d4('0x3e')]};return db['MailAccount'][_0xc6d4('0x1f')](_0x1ff060)['then'](function(_0x5a7e81){_0x9ee989['count']=_0x5a7e81;if(_0x4e04f3['query']['includeAll']){_0x53531e[_0xc6d4('0x44')]=[{'all':!![]}];}return db['MailAccount'][_0xc6d4('0x45')](_0x53531e);})[_0xc6d4('0x23')](function(_0x215369){_0x9ee989[_0xc6d4('0x46')]=_0x215369;return _0x9ee989;})[_0xc6d4('0x23')](respondWithFilteredResult(_0x20bbcf,_0x53531e))[_0xc6d4('0x19')](handleError(_0x20bbcf,null));};exports[_0xc6d4('0x47')]=function(_0x2e951f,_0x5f39e0){var _0x558640={'raw':![],'where':{'id':_0x2e951f[_0xc6d4('0x48')]['id']},'include':[{'model':db[_0xc6d4('0x49')],'as':_0xc6d4('0x2b')},{'model':db['MailServerOut'],'as':_0xc6d4('0x2d')},{'model':db[_0xc6d4('0x4a')],'as':_0xc6d4('0x2e')}]},_0x57aa20={};_0x57aa20[_0xc6d4('0x32')]=_[_0xc6d4('0x35')](db[_0xc6d4('0x2f')][_0xc6d4('0x30')]);_0x57aa20[_0xc6d4('0x34')]=_[_0xc6d4('0x35')](_0x2e951f['query']);_0x57aa20[_0xc6d4('0x3f')]=_[_0xc6d4('0x36')](_0x57aa20['model'],_0x57aa20['query']);_0x558640['attributes']=_['intersection'](_0x57aa20[_0xc6d4('0x32')],qs['fields'](_0x2e951f[_0xc6d4('0x34')][_0xc6d4('0x37')]));_0x558640['attributes']=_0x558640[_0xc6d4('0x38')][_0xc6d4('0x39')]?_0x558640['attributes']:_0x57aa20[_0xc6d4('0x32')];if(_0x2e951f[_0xc6d4('0x34')][_0xc6d4('0x4b')]){_0x558640[_0xc6d4('0x44')]=[{'all':!![]}];}_0x558640=_[_0xc6d4('0x42')]({},_0x558640,_0x2e951f['options']);return db['MailAccount'][_0xc6d4('0x4c')](_0x558640)[_0xc6d4('0x23')](handleEntityNotFound(_0x5f39e0,null))[_0xc6d4('0x23')](respondWithResult(_0x5f39e0,null))[_0xc6d4('0x19')](handleError(_0x5f39e0,null));};exports[_0xc6d4('0x4d')]=function(_0x5aa86f,_0x31857a){if(_0x5aa86f[_0xc6d4('0x4e')]['id']){delete _0x5aa86f[_0xc6d4('0x4e')]['id'];}if(_0x5aa86f[_0xc6d4('0x4e')][_0xc6d4('0x2b')]){if(!_0x5aa86f[_0xc6d4('0x4e')][_0xc6d4('0x2b')][_0xc6d4('0x4f')]){_0x5aa86f[_0xc6d4('0x4e')][_0xc6d4('0x2b')][_0xc6d4('0x50')]=null;}}if(_0x5aa86f[_0xc6d4('0x4e')][_0xc6d4('0x2d')]){if(!_0x5aa86f[_0xc6d4('0x4e')][_0xc6d4('0x2d')][_0xc6d4('0x4f')]){_0x5aa86f[_0xc6d4('0x4e')][_0xc6d4('0x2d')][_0xc6d4('0x50')]=null;}}return db['MailAccount'][_0xc6d4('0x4c')]({'where':{'id':_0x5aa86f[_0xc6d4('0x48')]['id']},'include':[{'model':db[_0xc6d4('0x49')],'as':_0xc6d4('0x2b')},{'model':db[_0xc6d4('0x2c')],'as':_0xc6d4('0x2d')},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0xc6d4('0x23')](handleEntityNotFound(_0x31857a,null))[_0xc6d4('0x23')](saveUpdates(_0x5aa86f[_0xc6d4('0x4e')],null))[_0xc6d4('0x23')](function(_0x386505){if(_0x386505&&_0x5aa86f['body'][_0xc6d4('0x2b')]){return db[_0xc6d4('0x49')][_0xc6d4('0x4d')](_0x5aa86f[_0xc6d4('0x4e')]['Imap'],{'where':{'MailAccountId':_0x386505['id']}})[_0xc6d4('0x23')](function(){return _0x386505;});}return _0x386505;})[_0xc6d4('0x23')](function(_0x42cda7){if(_0x42cda7&&_0x5aa86f[_0xc6d4('0x4e')]['Smtp']){return db[_0xc6d4('0x2c')]['update'](_0x5aa86f['body'][_0xc6d4('0x2d')],{'where':{'MailAccountId':_0x42cda7['id']}})[_0xc6d4('0x23')](function(){return _0x42cda7;});}return _0x42cda7;})[_0xc6d4('0x23')](respondWithResult(_0x31857a,null))[_0xc6d4('0x19')](handleError(_0x31857a,null));};exports['describe']=function(_0x3b2493,_0x25e072){return db[_0xc6d4('0x2f')][_0xc6d4('0x51')]()[_0xc6d4('0x23')](respondWithResult(_0x25e072,null))['catch'](handleError(_0x25e072,null));};exports[_0xc6d4('0x52')]=function(_0xdecd89,_0x57cc8e){if(_0xdecd89[_0xc6d4('0x4e')]['id']){delete _0xdecd89[_0xc6d4('0x4e')]['id'];}return db['MailAccount'][_0xc6d4('0x4c')]({'where':{'id':_0xdecd89[_0xc6d4('0x48')]['id']}})[_0xc6d4('0x23')](handleEntityNotFound(_0x57cc8e,null))[_0xc6d4('0x23')](function(_0x3a04ad){if(_0x3a04ad){_0xdecd89[_0xc6d4('0x4e')][_0xc6d4('0x53')]=_0x3a04ad['id'];return db['Disposition'][_0xc6d4('0x54')](_0xdecd89[_0xc6d4('0x4e')]);}})[_0xc6d4('0x23')](respondWithResult(_0x57cc8e,null))['catch'](handleError(_0x57cc8e,null));};exports['getDispositions']=function(_0x3776c8,_0x896607){var _0x55836c={'raw':![],'where':{}};var _0x4a9ecb={};var _0x239dc1={'count':0x0,'rows':[]};return db[_0xc6d4('0x2f')][_0xc6d4('0x55')]({'where':{'id':_0x3776c8[_0xc6d4('0x48')]['id']}})[_0xc6d4('0x23')](handleEntityNotFound(_0x896607,null))['then'](function(_0x27a97a){if(_0x27a97a){_0x4a9ecb[_0xc6d4('0x32')]=_[_0xc6d4('0x35')](db['Disposition'][_0xc6d4('0x30')]);_0x4a9ecb['query']=_[_0xc6d4('0x35')](_0x3776c8[_0xc6d4('0x34')]);_0x4a9ecb[_0xc6d4('0x3f')]=_['intersection'](_0x4a9ecb['model'],_0x4a9ecb['query']);_0x55836c['attributes']=_[_0xc6d4('0x36')](_0x4a9ecb['model'],qs[_0xc6d4('0x37')](_0x3776c8[_0xc6d4('0x34')]['fields']));_0x55836c[_0xc6d4('0x38')]=_0x55836c[_0xc6d4('0x38')][_0xc6d4('0x39')]?_0x55836c['attributes']:_0x4a9ecb[_0xc6d4('0x32')];if(!_0x3776c8['query'][_0xc6d4('0x3a')]('nolimit')){_0x55836c['limit']=qs[_0xc6d4('0x1e')](_0x3776c8[_0xc6d4('0x34')]['limit']);_0x55836c['offset']=qs[_0xc6d4('0x1c')](_0x3776c8['query'][_0xc6d4('0x1c')]);}_0x55836c[_0xc6d4('0x3c')]=qs[_0xc6d4('0x3d')](_0x3776c8[_0xc6d4('0x34')][_0xc6d4('0x3d')]);_0x55836c[_0xc6d4('0x3e')]=qs[_0xc6d4('0x3f')](_[_0xc6d4('0x40')](_0x3776c8[_0xc6d4('0x34')],_0x4a9ecb[_0xc6d4('0x3f')]));_0x55836c[_0xc6d4('0x3e')]['MailAccountId']=_0x27a97a['id'];if(_0x3776c8[_0xc6d4('0x34')][_0xc6d4('0x41')]){_0x55836c[_0xc6d4('0x3e')]=_['merge'](_0x55836c[_0xc6d4('0x3e')],{'$or':_[_0xc6d4('0x33')](_0x55836c['attributes'],function(_0xca06c2){var _0xc76d4b={};_0xc76d4b[_0xca06c2]={'$like':'%'+_0x3776c8[_0xc6d4('0x34')][_0xc6d4('0x41')]+'%'};return _0xc76d4b;})});}_0x55836c=_[_0xc6d4('0x42')]({},_0x55836c,_0x3776c8[_0xc6d4('0x56')]);return db[_0xc6d4('0x57')][_0xc6d4('0x1f')]({'where':_0x55836c['where']})[_0xc6d4('0x23')](function(_0x47bb9d){_0x239dc1[_0xc6d4('0x1f')]=_0x47bb9d;if(_0x3776c8['query']['includeAll']){_0x55836c[_0xc6d4('0x44')]=[{'all':!![]}];}return db['Disposition'][_0xc6d4('0x45')](_0x55836c);})[_0xc6d4('0x23')](function(_0x48c246){_0x239dc1[_0xc6d4('0x46')]=_0x48c246;return _0x239dc1;});}})[_0xc6d4('0x23')](respondWithFilteredResult(_0x896607,_0x55836c))['catch'](handleError(_0x896607,null));};exports[_0xc6d4('0x58')]=function(_0x32a2b4,_0x3d5e4f){return db[_0xc6d4('0x2f')][_0xc6d4('0x4c')]({'where':{'id':_0x32a2b4[_0xc6d4('0x48')]['id']}})['then'](handleEntityNotFound(_0x3d5e4f,null))[_0xc6d4('0x23')](function(_0xb64184){if(_0xb64184){return _0xb64184[_0xc6d4('0x58')](_0x32a2b4[_0xc6d4('0x34')][_0xc6d4('0x59')]);}})[_0xc6d4('0x23')](respondWithStatusCode(_0x3d5e4f,null))[_0xc6d4('0x19')](handleError(_0x3d5e4f,null));};exports[_0xc6d4('0x5a')]=function(_0xf05df7,_0x97fef9){if(_0xf05df7[_0xc6d4('0x4e')]['id']){delete _0xf05df7[_0xc6d4('0x4e')]['id'];}return db['MailAccount'][_0xc6d4('0x4c')]({'where':{'id':_0xf05df7[_0xc6d4('0x48')]['id']}})['then'](handleEntityNotFound(_0x97fef9,null))[_0xc6d4('0x23')](function(_0x22f135){if(_0x22f135){_0xf05df7[_0xc6d4('0x4e')]['MailAccountId']=_0x22f135['id'];return db[_0xc6d4('0x5b')][_0xc6d4('0x54')](_0xf05df7[_0xc6d4('0x4e')]);}})[_0xc6d4('0x23')](respondWithResult(_0x97fef9,null))[_0xc6d4('0x19')](handleError(_0x97fef9,null));};exports[_0xc6d4('0x5c')]=function(_0x310636,_0x27ed97){var _0x59b471={'raw':![],'where':{}};var _0x27500f={};var _0x4fcae5={'count':0x0,'rows':[]};return db[_0xc6d4('0x2f')]['findOne']({'where':{'id':_0x310636[_0xc6d4('0x48')]['id']}})[_0xc6d4('0x23')](handleEntityNotFound(_0x27ed97,null))[_0xc6d4('0x23')](function(_0x3dfacc){if(_0x3dfacc){_0x27500f[_0xc6d4('0x32')]=_['keys'](db[_0xc6d4('0x5b')][_0xc6d4('0x30')]);_0x27500f[_0xc6d4('0x34')]=_['keys'](_0x310636[_0xc6d4('0x34')]);_0x27500f[_0xc6d4('0x3f')]=_[_0xc6d4('0x36')](_0x27500f[_0xc6d4('0x32')],_0x27500f[_0xc6d4('0x34')]);_0x59b471[_0xc6d4('0x38')]=_['intersection'](_0x27500f[_0xc6d4('0x32')],qs[_0xc6d4('0x37')](_0x310636[_0xc6d4('0x34')]['fields']));_0x59b471['attributes']=_0x59b471[_0xc6d4('0x38')][_0xc6d4('0x39')]?_0x59b471[_0xc6d4('0x38')]:_0x27500f[_0xc6d4('0x32')];if(!_0x310636[_0xc6d4('0x34')][_0xc6d4('0x3a')](_0xc6d4('0x3b'))){_0x59b471['limit']=qs[_0xc6d4('0x1e')](_0x310636[_0xc6d4('0x34')][_0xc6d4('0x1e')]);_0x59b471[_0xc6d4('0x1c')]=qs[_0xc6d4('0x1c')](_0x310636[_0xc6d4('0x34')][_0xc6d4('0x1c')]);}_0x59b471[_0xc6d4('0x3c')]=qs[_0xc6d4('0x3d')](_0x310636[_0xc6d4('0x34')]['sort']);_0x59b471[_0xc6d4('0x3e')]=qs[_0xc6d4('0x3f')](_[_0xc6d4('0x40')](_0x310636[_0xc6d4('0x34')],_0x27500f[_0xc6d4('0x3f')]));_0x59b471[_0xc6d4('0x3e')][_0xc6d4('0x53')]=_0x3dfacc['id'];if(_0x310636[_0xc6d4('0x34')][_0xc6d4('0x41')]){_0x59b471[_0xc6d4('0x3e')]=_[_0xc6d4('0x42')](_0x59b471[_0xc6d4('0x3e')],{'$or':_[_0xc6d4('0x33')](_0x59b471[_0xc6d4('0x38')],function(_0x3d1ba2){var _0x433618={};_0x433618[_0x3d1ba2]={'$like':'%'+_0x310636[_0xc6d4('0x34')][_0xc6d4('0x41')]+'%'};return _0x433618;})});}_0x59b471=_[_0xc6d4('0x42')]({},_0x59b471,_0x310636[_0xc6d4('0x56')]);return db[_0xc6d4('0x5b')][_0xc6d4('0x1f')]({'where':_0x59b471['where']})[_0xc6d4('0x23')](function(_0xb151ca){_0x4fcae5[_0xc6d4('0x1f')]=_0xb151ca;if(_0x310636[_0xc6d4('0x34')][_0xc6d4('0x4b')]){_0x59b471[_0xc6d4('0x44')]=[{'all':!![]}];}return db[_0xc6d4('0x5b')]['findAll'](_0x59b471);})[_0xc6d4('0x23')](function(_0x48e135){_0x4fcae5[_0xc6d4('0x46')]=_0x48e135;return _0x4fcae5;});}})[_0xc6d4('0x23')](respondWithFilteredResult(_0x27ed97,_0x59b471))['catch'](handleError(_0x27ed97,null));};exports[_0xc6d4('0x5d')]=function(_0x3c3fa5,_0x33e5e0){return db[_0xc6d4('0x2f')][_0xc6d4('0x4c')]({'where':{'id':_0x3c3fa5[_0xc6d4('0x48')]['id']}})[_0xc6d4('0x23')](handleEntityNotFound(_0x33e5e0,null))[_0xc6d4('0x23')](function(_0x312ca9){if(_0x312ca9){return _0x312ca9[_0xc6d4('0x5d')](_0x3c3fa5[_0xc6d4('0x34')][_0xc6d4('0x59')]);}})[_0xc6d4('0x23')](respondWithStatusCode(_0x33e5e0,null))[_0xc6d4('0x19')](handleError(_0x33e5e0,null));};exports['create']=function(_0xd12918,_0x2238c4){var _0x5a1620={'name':_0xd12918[_0xc6d4('0x4e')][_0xc6d4('0x29')],'key':_0xd12918[_0xc6d4('0x4e')][_0xc6d4('0x5e')],'provider':_0xd12918[_0xc6d4('0x4e')][_0xc6d4('0x5f')]===_0xc6d4('0x60')?null:_0xd12918[_0xc6d4('0x4e')][_0xc6d4('0x5f')],'email':_0xd12918['body'][_0xc6d4('0x61')],'ListId':_0xd12918['body']['ListId'],'active':!_[_0xc6d4('0x62')](_0xd12918[_0xc6d4('0x4e')][_0xc6d4('0x63')])?_0xd12918['body'][_0xc6d4('0x63')]:!![],'description':_0xd12918[_0xc6d4('0x4e')][_0xc6d4('0x64')]||null,'Imap':{},'Smtp':{}};if(_0x5a1620[_0xc6d4('0x5f')]){_0x5a1620['Imap'][_0xc6d4('0x65')]=_0x5a1620['Smtp']['user']=_0xd12918['body'][_0xc6d4('0x66')];_0x5a1620['Imap'][_0xc6d4('0x67')]=_0x5a1620[_0xc6d4('0x2d')][_0xc6d4('0x68')]=_0xd12918['body']['password'];if(_0xd12918[_0xc6d4('0x4e')][_0xc6d4('0x4f')]){_0x5a1620[_0xc6d4('0x2b')][_0xc6d4('0x4f')]=_0x5a1620['Smtp']['modernAuthentication']=!![];_0x5a1620[_0xc6d4('0x2b')][_0xc6d4('0x50')]=_0x5a1620['Smtp'][_0xc6d4('0x50')]=_0xd12918[_0xc6d4('0x4e')][_0xc6d4('0x50')];_0x5a1620['Imap'][_0xc6d4('0x67')]=_0x5a1620['Smtp'][_0xc6d4('0x68')]=null;}else{_0x5a1620[_0xc6d4('0x2b')][_0xc6d4('0x50')]=_0x5a1620['Smtp']['CloudProviderId']=null;}_0x5a1620[_0xc6d4('0x2b')]['service']=_0x5a1620[_0xc6d4('0x2d')][_0xc6d4('0x69')]=null;_0x5a1620[_0xc6d4('0x2b')][_0xc6d4('0x6a')]=_0x5a1620[_0xc6d4('0x2d')][_0xc6d4('0x6a')]=null;_0x5a1620[_0xc6d4('0x2b')][_0xc6d4('0x6b')]=_0x5a1620['Smtp']['port']=null;}else{if(_0xd12918[_0xc6d4('0x4e')][_0xc6d4('0x6c')]){_0x5a1620[_0xc6d4('0x2b')][_0xc6d4('0x65')]=_0x5a1620[_0xc6d4('0x2d')]['user']=_0xd12918[_0xc6d4('0x4e')][_0xc6d4('0x66')];_0x5a1620['Imap']['password']=_0x5a1620[_0xc6d4('0x2d')][_0xc6d4('0x68')]=_0xd12918[_0xc6d4('0x4e')][_0xc6d4('0x67')];}else{_0x5a1620[_0xc6d4('0x2b')]['authentication']=_0x5a1620[_0xc6d4('0x2d')][_0xc6d4('0x6c')]=![];_0x5a1620[_0xc6d4('0x2b')][_0xc6d4('0x65')]=_0x5a1620[_0xc6d4('0x2d')][_0xc6d4('0x65')]=null;_0x5a1620[_0xc6d4('0x2b')][_0xc6d4('0x67')]=_0x5a1620[_0xc6d4('0x2d')][_0xc6d4('0x68')]=null;}_0x5a1620[_0xc6d4('0x2b')][_0xc6d4('0x6a')]=_0xd12918[_0xc6d4('0x4e')][_0xc6d4('0x2b')]['host'];_0x5a1620[_0xc6d4('0x2b')]['port']=_0xd12918[_0xc6d4('0x4e')][_0xc6d4('0x2b')][_0xc6d4('0x6b')];_0x5a1620[_0xc6d4('0x2d')][_0xc6d4('0x6a')]=_0xd12918[_0xc6d4('0x4e')][_0xc6d4('0x2d')]['host'];_0x5a1620[_0xc6d4('0x2d')][_0xc6d4('0x6b')]=_0xd12918['body']['Smtp'][_0xc6d4('0x6b')];}return db[_0xc6d4('0x2f')][_0xc6d4('0x54')](_0x5a1620,{'include':[{'model':db['MailServerOut'],'as':_0xc6d4('0x2d')},{'model':db['MailServerIn'],'as':_0xc6d4('0x2b')}]})[_0xc6d4('0x23')](function(_0x20d940){var _0x3704c4=_0xd12918[_0xc6d4('0x65')]['get']({'plain':!![]});if(!_0x3704c4)throw new Error(_0xc6d4('0x6d'));if(_0x3704c4[_0xc6d4('0x6e')]===_0xc6d4('0x65')){var _0x2d5413=_0x20d940[_0xc6d4('0x6f')]({'plain':!![]});return db['UserProfileSection'][_0xc6d4('0x4c')]({'where':{'name':'MailAccounts','userProfileId':_0x3704c4[_0xc6d4('0x70')]},'raw':!![]})[_0xc6d4('0x23')](function(_0x2fc22c){if(_0x2fc22c&&_0x2fc22c[_0xc6d4('0x71')]===0x0){return db[_0xc6d4('0x26')][_0xc6d4('0x54')]({'name':_0x2d5413[_0xc6d4('0x29')],'resourceId':_0x2d5413['id'],'type':_0x2fc22c[_0xc6d4('0x29')],'sectionId':_0x2fc22c['id']},{})[_0xc6d4('0x23')](function(){return _0x20d940;});}else{return _0x20d940;}})[_0xc6d4('0x19')](function(_0x40411e){logger[_0xc6d4('0x15')](_0xc6d4('0x72'),_0x40411e);throw _0x40411e;});}return _0x20d940;})[_0xc6d4('0x23')](respondWithResult(_0x2238c4,0xc9))[_0xc6d4('0x19')](handleError(_0x2238c4,null));};exports[_0xc6d4('0x73')]=function(_0x25da4,_0x98dee8){return db[_0xc6d4('0x2f')][_0xc6d4('0x55')]({'where':{'id':_0x25da4[_0xc6d4('0x48')]['id']}})['then'](handleEntityNotFound(_0x98dee8,null))[_0xc6d4('0x23')](function(_0x591900){if(_0x591900){return _0x591900[_0xc6d4('0x73')]();}return null;})[_0xc6d4('0x23')](respondWithResult(_0x98dee8,null))[_0xc6d4('0x19')](handleError(_0x98dee8,null));};exports[_0xc6d4('0x74')]=function(_0xd128a2,_0x2e8a81){if(_0xd128a2[_0xc6d4('0x4e')]['id']){delete _0xd128a2[_0xc6d4('0x4e')]['id'];}return db[_0xc6d4('0x2f')]['find']({'where':{'id':_0xd128a2[_0xc6d4('0x48')]['id']}})[_0xc6d4('0x23')](handleEntityNotFound(_0x2e8a81,null))[_0xc6d4('0x23')](function(_0x126221){if(_0x126221){_0xd128a2[_0xc6d4('0x4e')]['MailAccountId']=_0x126221['id'];return db['MailServerIn']['create'](_0xd128a2[_0xc6d4('0x4e')]);}})['then'](respondWithResult(_0x2e8a81,null))['catch'](handleError(_0x2e8a81,null));};exports[_0xc6d4('0x75')]=function(_0x384d8e,_0x334eff){return db[_0xc6d4('0x2f')]['findOne']({'where':{'id':_0x384d8e[_0xc6d4('0x48')]['id']}})['then'](handleEntityNotFound(_0x334eff,null))[_0xc6d4('0x23')](function(_0x106daf){if(_0x106daf){return _0x106daf[_0xc6d4('0x76')](null);}return null;})['then'](respondWithStatusCode(_0x334eff,null))[_0xc6d4('0x19')](handleError(_0x334eff,null));};exports[_0xc6d4('0x77')]=function(_0x550a94,_0x3b6e75){return db[_0xc6d4('0x2f')][_0xc6d4('0x55')]({'where':{'id':_0x550a94[_0xc6d4('0x48')]['id']}})['then'](handleEntityNotFound(_0x3b6e75,null))[_0xc6d4('0x23')](function(_0x142ec5){if(_0x142ec5){return _0x142ec5[_0xc6d4('0x77')]();}return null;})[_0xc6d4('0x23')](respondWithResult(_0x3b6e75,null))[_0xc6d4('0x19')](handleError(_0x3b6e75,null));};exports[_0xc6d4('0x78')]=function(_0x21ed66,_0x5487b4){if(_0x21ed66[_0xc6d4('0x4e')]['id']){delete _0x21ed66[_0xc6d4('0x4e')]['id'];}return db['MailAccount'][_0xc6d4('0x4c')]({'where':{'id':_0x21ed66[_0xc6d4('0x48')]['id']}})[_0xc6d4('0x23')](handleEntityNotFound(_0x5487b4,null))[_0xc6d4('0x23')](function(_0xf4964c){if(_0xf4964c){_0x21ed66['body'][_0xc6d4('0x53')]=_0xf4964c['id'];return db[_0xc6d4('0x2c')][_0xc6d4('0x54')](_0x21ed66[_0xc6d4('0x4e')]);}})[_0xc6d4('0x23')](respondWithResult(_0x5487b4,null))[_0xc6d4('0x19')](handleError(_0x5487b4,null));};exports[_0xc6d4('0x79')]=function(_0x3b8ed9,_0x51808e){return db[_0xc6d4('0x2f')][_0xc6d4('0x55')]({'where':{'id':_0x3b8ed9['params']['id']}})['then'](handleEntityNotFound(_0x51808e,null))['then'](function(_0x51acb2){if(_0x51acb2){return _0x51acb2['setSmtp'](null);}return null;})[_0xc6d4('0x23')](respondWithStatusCode(_0x51808e,null))['catch'](handleError(_0x51808e,null));};exports['addInteraction']=function(_0x395119,_0x4e85b9){return db[_0xc6d4('0x7a')][_0xc6d4('0x4c')]({'where':{'id':_0x395119['params']['id']}})[_0xc6d4('0x23')](handleEntityNotFound(_0x4e85b9,null))['then'](function(_0xbbeadd){if(_0xbbeadd){return _0xbbeadd['addInteraction'](_0x395119[_0xc6d4('0x4e')][_0xc6d4('0x59')],_[_0xc6d4('0x7b')](_0x395119[_0xc6d4('0x4e')],[_0xc6d4('0x59'),'id'])||{});}})[_0xc6d4('0x23')](respondWithResult(_0x4e85b9,null))[_0xc6d4('0x19')](handleError(_0x4e85b9,null));};exports[_0xc6d4('0x7c')]=function(_0x80d5f,_0x421871){var _0x194b98={'raw':![],'where':{}};var _0x20731a={};var _0x402219={'count':0x0,'rows':[]};return db[_0xc6d4('0x2f')][_0xc6d4('0x55')]({'where':{'id':_0x80d5f[_0xc6d4('0x48')]['id']}})['then'](handleEntityNotFound(_0x421871,null))[_0xc6d4('0x23')](function(_0x2f3490){if(_0x2f3490){_0x20731a[_0xc6d4('0x32')]=_[_0xc6d4('0x35')](db[_0xc6d4('0x7a')][_0xc6d4('0x30')]);_0x20731a[_0xc6d4('0x34')]=_[_0xc6d4('0x35')](_0x80d5f[_0xc6d4('0x34')]);_0x20731a['filters']=_[_0xc6d4('0x36')](_0x20731a['model'],_0x20731a[_0xc6d4('0x34')]);_0x194b98['attributes']=_['intersection'](_0x20731a[_0xc6d4('0x32')],qs[_0xc6d4('0x37')](_0x80d5f[_0xc6d4('0x34')][_0xc6d4('0x37')]));_0x194b98['attributes']=_0x194b98[_0xc6d4('0x38')]['length']?_0x194b98['attributes']:_0x20731a[_0xc6d4('0x32')];if(!_0x80d5f[_0xc6d4('0x34')][_0xc6d4('0x3a')]('nolimit')){_0x194b98[_0xc6d4('0x1e')]=qs[_0xc6d4('0x1e')](_0x80d5f['query'][_0xc6d4('0x1e')]);_0x194b98[_0xc6d4('0x1c')]=qs['offset'](_0x80d5f[_0xc6d4('0x34')][_0xc6d4('0x1c')]);}_0x194b98[_0xc6d4('0x3c')]=qs[_0xc6d4('0x3d')](_0x80d5f['query'][_0xc6d4('0x3d')]);_0x194b98['where']=qs[_0xc6d4('0x3f')](_[_0xc6d4('0x40')](_0x80d5f[_0xc6d4('0x34')],_0x20731a[_0xc6d4('0x3f')]));_0x194b98['where'][_0xc6d4('0x53')]=_0x2f3490['id'];if(_0x80d5f['query'][_0xc6d4('0x41')]){_0x194b98[_0xc6d4('0x3e')]=_[_0xc6d4('0x42')](_0x194b98[_0xc6d4('0x3e')],{'$or':_['map'](_0x194b98[_0xc6d4('0x38')],function(_0x1ade6c){var _0x40e4be={};_0x40e4be[_0x1ade6c]={'$like':'%'+_0x80d5f['query'][_0xc6d4('0x41')]+'%'};return _0x40e4be;})});}_0x194b98=_['merge']({},_0x194b98,_0x80d5f['options']);return db[_0xc6d4('0x7a')][_0xc6d4('0x1f')]({'where':_0x194b98[_0xc6d4('0x3e')]})['then'](function(_0x38a5ac){_0x402219[_0xc6d4('0x1f')]=_0x38a5ac;if(_0x80d5f[_0xc6d4('0x34')][_0xc6d4('0x4b')]){_0x194b98[_0xc6d4('0x44')]=[{'model':db['CmContact'],'as':_0xc6d4('0x7d'),'required':![]},{'model':db['User'],'as':_0xc6d4('0x7e'),'attributes':[_0xc6d4('0x29'),_0xc6d4('0x7f'),_0xc6d4('0x80')],'required':![]},{'model':db['Tag'],'as':_0xc6d4('0x81'),'attributes':['id','name',_0xc6d4('0x82')],'where':_0x80d5f[_0xc6d4('0x34')][_0xc6d4('0x83')]?{'id':_0x80d5f['query'][_0xc6d4('0x83')]}:undefined,'required':_0x80d5f[_0xc6d4('0x34')][_0xc6d4('0x83')]?!![]:![]}];}return db[_0xc6d4('0x7a')][_0xc6d4('0x45')](_0x194b98);})[_0xc6d4('0x23')](function(_0x3e5e9d){_0x402219[_0xc6d4('0x46')]=_0x3e5e9d;return _0x402219;});}})[_0xc6d4('0x23')](respondWithFilteredResult(_0x421871,_0x194b98))['catch'](handleError(_0x421871,null));};exports[_0xc6d4('0x84')]=function addApplications(_0x30e31c,_0x6b5695){var _0x10a708=_0x30e31c[_0xc6d4('0x48')]['id'];var _0x29b720=_0x30e31c[_0xc6d4('0x4e')];var _0x1da9ac=0xc8;var _0x26dcbd=null;return db[_0xc6d4('0x85')][_0xc6d4('0x86')]({'isolationLevel':db[_0xc6d4('0x85')][_0xc6d4('0x87')][_0xc6d4('0x88')][_0xc6d4('0x89')]},function(_0x539807){return db['MailAccount'][_0xc6d4('0x55')]({'where':{'id':_0x10a708},'transaction':_0x539807})[_0xc6d4('0x23')](function(_0x5817e){if(_0x5817e){return db[_0xc6d4('0x8a')][_0xc6d4('0x24')]({'where':{'MailAccountId':_0x10a708},'transaction':_0x539807})[_0xc6d4('0x23')](function(){var _0x23c5ca=_[_0xc6d4('0x33')](_0x29b720,function(_0x3c6735){_0x3c6735['MailAccountId']=_0x10a708;return _0x3c6735;});return db[_0xc6d4('0x8a')][_0xc6d4('0x8b')](_0x23c5ca,{'transaction':_0x539807});});}else{_0x1da9ac=0x194;_0x26dcbd=[];}});})['then'](function(){if(_0x1da9ac!==0x194){return db[_0xc6d4('0x8a')][_0xc6d4('0x8c')]({'where':{'MailAccountId':_0x10a708},'order':_0xc6d4('0x8d')})[_0xc6d4('0x23')](function(_0x3eb330){_0x26dcbd=_0x3eb330;});}})[_0xc6d4('0x19')](function(_0x4e3023){_0x1da9ac=0x1f4;logger[_0xc6d4('0x15')](_0x4e3023[_0xc6d4('0x28')]);if(_0x4e3023[_0xc6d4('0x29')]){delete _0x4e3023[_0xc6d4('0x29')];}_0x26dcbd=_0x4e3023;})[_0xc6d4('0x8e')](function(){if(_0x26dcbd===null){_0x6b5695[_0xc6d4('0x27')](_0x1da9ac);}else{if(_0x1da9ac===0x1f4){_0x6b5695[_0xc6d4('0x1a')](_0x1da9ac)[_0xc6d4('0x2a')](_0x26dcbd);}else{_0x6b5695[_0xc6d4('0x1a')](_0x1da9ac)['json'](_0x26dcbd);}}});};exports['getApplications']=function(_0x134d95,_0x368dd9){var _0x133e97={};var _0xa3816b={};var _0x1541c5;var _0x1c87d0;return db[_0xc6d4('0x2f')][_0xc6d4('0x55')]({'where':{'id':_0x134d95[_0xc6d4('0x48')]['id']}})[_0xc6d4('0x23')](handleEntityNotFound(_0x368dd9,null))[_0xc6d4('0x23')](function(_0x17f6ec){if(_0x17f6ec){_0x1541c5=_0x17f6ec;_0xa3816b[_0xc6d4('0x32')]=_[_0xc6d4('0x35')](db[_0xc6d4('0x8a')][_0xc6d4('0x30')]);_0xa3816b[_0xc6d4('0x34')]=_[_0xc6d4('0x35')](_0x134d95[_0xc6d4('0x34')]);_0xa3816b[_0xc6d4('0x3f')]=_[_0xc6d4('0x36')](_0xa3816b[_0xc6d4('0x32')],_0xa3816b['query']);_0x133e97[_0xc6d4('0x38')]=_[_0xc6d4('0x36')](_0xa3816b[_0xc6d4('0x32')],qs['fields'](_0x134d95[_0xc6d4('0x34')][_0xc6d4('0x37')]));_0x133e97[_0xc6d4('0x38')]=_0x133e97[_0xc6d4('0x38')][_0xc6d4('0x39')]?_0x133e97[_0xc6d4('0x38')]:_0xa3816b[_0xc6d4('0x32')];_0x133e97[_0xc6d4('0x3c')]=qs[_0xc6d4('0x3d')](_0x134d95[_0xc6d4('0x34')][_0xc6d4('0x3d')]);_0x133e97[_0xc6d4('0x3e')]=qs[_0xc6d4('0x3f')](_[_0xc6d4('0x40')](_0x134d95[_0xc6d4('0x34')],_0xa3816b['filters']));if(_0x134d95[_0xc6d4('0x34')][_0xc6d4('0x41')]){_0x133e97[_0xc6d4('0x3e')]=_[_0xc6d4('0x42')](_0x133e97[_0xc6d4('0x3e')],{'$or':_[_0xc6d4('0x33')](_0x133e97[_0xc6d4('0x38')],function(_0x550864){var _0x2b9466={};_0x2b9466[_0x550864]={'$like':'%'+_0x134d95['query']['filter']+'%'};return _0x2b9466;})});}_0x133e97=_[_0xc6d4('0x42')]({},_0x133e97,_0x134d95['options']);return _0x1541c5[_0xc6d4('0x8f')](_0x133e97);}})[_0xc6d4('0x23')](function(_0x3daea2){if(_0x3daea2){_0x1c87d0=_0x3daea2['length'];if(!_0x134d95[_0xc6d4('0x34')][_0xc6d4('0x3a')](_0xc6d4('0x3b'))){_0x133e97['limit']=qs[_0xc6d4('0x1e')](_0x134d95[_0xc6d4('0x34')][_0xc6d4('0x1e')]);_0x133e97[_0xc6d4('0x1c')]=qs[_0xc6d4('0x1c')](_0x134d95[_0xc6d4('0x34')][_0xc6d4('0x1c')]);}return _0x1541c5[_0xc6d4('0x8f')](_0x133e97);}})[_0xc6d4('0x23')](function(_0x1a2130){if(_0x1a2130){return _0x1a2130?{'count':_0x1c87d0,'rows':_0x1a2130}:null;}})[_0xc6d4('0x23')](respondWithResult(_0x368dd9,null))['catch'](handleError(_0x368dd9,null));};exports['getMessages']=function(_0x5dd725,_0x1918b8){var _0x512321={'raw':!![],'where':{}};var _0x4ed38f={};var _0x2c6f69={'count':0x0,'rows':[]};return db[_0xc6d4('0x2f')][_0xc6d4('0x55')]({'where':{'id':_0x5dd725[_0xc6d4('0x48')]['id']}})['then'](handleEntityNotFound(_0x1918b8,null))['then'](function(_0x4f88d4){if(_0x4f88d4){_0x4ed38f[_0xc6d4('0x32')]=_[_0xc6d4('0x35')](db['MailMessage'][_0xc6d4('0x30')]);_0x4ed38f[_0xc6d4('0x34')]=_[_0xc6d4('0x35')](_0x5dd725[_0xc6d4('0x34')]);_0x4ed38f[_0xc6d4('0x3f')]=_[_0xc6d4('0x36')](_0x4ed38f[_0xc6d4('0x32')],_0x4ed38f[_0xc6d4('0x34')]);_0x512321[_0xc6d4('0x38')]=_[_0xc6d4('0x36')](_0x4ed38f[_0xc6d4('0x32')],qs[_0xc6d4('0x37')](_0x5dd725[_0xc6d4('0x34')][_0xc6d4('0x37')]));_0x512321['attributes']=_0x512321[_0xc6d4('0x38')][_0xc6d4('0x39')]?_0x512321['attributes']:_0x4ed38f['model'];if(!_0x5dd725[_0xc6d4('0x34')][_0xc6d4('0x3a')]('nolimit')){_0x512321[_0xc6d4('0x1e')]=qs[_0xc6d4('0x1e')](_0x5dd725[_0xc6d4('0x34')][_0xc6d4('0x1e')]);_0x512321[_0xc6d4('0x1c')]=qs[_0xc6d4('0x1c')](_0x5dd725[_0xc6d4('0x34')][_0xc6d4('0x1c')]);}_0x512321[_0xc6d4('0x3c')]=qs['sort'](_0x5dd725[_0xc6d4('0x34')]['sort']);_0x512321['where']=qs[_0xc6d4('0x3f')](_['pick'](_0x5dd725[_0xc6d4('0x34')],_0x4ed38f[_0xc6d4('0x3f')]));_0x512321[_0xc6d4('0x3e')]['MailAccountId']=_0x4f88d4['id'];if(_0x5dd725[_0xc6d4('0x34')]['filter']){_0x512321[_0xc6d4('0x3e')]=_['merge'](_0x512321[_0xc6d4('0x3e')],{'$or':_[_0xc6d4('0x33')](_0x512321[_0xc6d4('0x38')],function(_0x285d18){var _0x21a1cb={};_0x21a1cb[_0x285d18]={'$like':'%'+_0x5dd725[_0xc6d4('0x34')][_0xc6d4('0x41')]+'%'};return _0x21a1cb;})});}if(_0x5dd725['query'][_0xc6d4('0x90')]){var _0x207f94=_0x5dd725['query']['$gte'][_0xc6d4('0x91')](',');var _0x19f041={};_0x19f041[_0x207f94[0x0]]={'$gte':moment(_0x207f94[0x1])[_0xc6d4('0x92')](_0xc6d4('0x93'))};_0x512321[_0xc6d4('0x3e')]=_[_0xc6d4('0x42')](_0x512321['where'],_0x19f041);}_0x512321=_[_0xc6d4('0x42')]({},_0x512321,_0x5dd725['options']);return db[_0xc6d4('0x94')][_0xc6d4('0x1f')]({'where':_0x512321[_0xc6d4('0x3e')]})['then'](function(_0x3e7d6a){_0x2c6f69[_0xc6d4('0x1f')]=_0x3e7d6a;if(_0x5dd725['query'][_0xc6d4('0x4b')]){_0x512321[_0xc6d4('0x44')]=[{'all':!![]}];}return db[_0xc6d4('0x94')][_0xc6d4('0x45')](_0x512321);})['then'](function(_0x342caf){if(_0x5dd725[_0xc6d4('0x34')]['inlineCss']===_0xc6d4('0x95')){for(var _0x3375bb=0x0;_0x3375bb<_0x342caf[_0xc6d4('0x39')];_0x3375bb++){_0x342caf[_0x3375bb][_0xc6d4('0x4e')]=juice(_0x342caf[_0x3375bb]['body']);}}_0x2c6f69[_0xc6d4('0x46')]=_0x342caf;return _0x2c6f69;});}})[_0xc6d4('0x23')](respondWithFilteredResult(_0x1918b8,_0x512321))['catch'](handleError(_0x1918b8,null));};exports[_0xc6d4('0x2a')]=function(_0x13fd49,_0x245b11){var _0x28a272,_0xd88795={},_0x5a8eef;if(_0x13fd49[_0xc6d4('0x4e')]['to']){_0x5a8eef=_0x13fd49[_0xc6d4('0x4e')]['to']['split'](',')[0x0];}return db[_0xc6d4('0x2f')][_0xc6d4('0x4c')]({'where':{'id':_0x13fd49[_0xc6d4('0x48')]['id']},'include':[{'model':db[_0xc6d4('0x96')],'as':_0xc6d4('0x97'),'include':[{'model':db[_0xc6d4('0x98')],'as':_0xc6d4('0x99'),'where':{'email':_0x5a8eef},'limit':0x1,'order':[['updatedAt',_0xc6d4('0x9a')]]}]},{'model':db[_0xc6d4('0x2c')],'as':_0xc6d4('0x2d'),'raw':!![]}]})[_0xc6d4('0x23')](handleEntityNotFound(_0x245b11,null))['then'](function(_0xa9b280){if(_0xa9b280){_0x28a272=_0xa9b280;if(_0xa9b280[_0xc6d4('0x2d')]){if(_[_0xc6d4('0x62')](_0x13fd49[_0xc6d4('0x4e')][_0xc6d4('0x9b')])){_0x13fd49['body'][_0xc6d4('0x9b')]=util[_0xc6d4('0x92')](_0xc6d4('0x9c'),_0xa9b280[_0xc6d4('0x29')],_0xa9b280['email']||_0xa9b280['Smtp']['user']);}if(_0x13fd49[_0xc6d4('0x4e')]['attachments']&&_0x13fd49[_0xc6d4('0x4e')][_0xc6d4('0x9d')][_0xc6d4('0x39')]){for(var _0x3c6528=0x0;_0x3c6528<_0x13fd49[_0xc6d4('0x4e')][_0xc6d4('0x9d')][_0xc6d4('0x39')];_0x3c6528+=0x1){_0x13fd49[_0xc6d4('0x4e')][_0xc6d4('0x9d')][_0x3c6528]={'filename':_0x13fd49[_0xc6d4('0x4e')][_0xc6d4('0x9d')][_0x3c6528][_0xc6d4('0x29')],'path':path[_0xc6d4('0x9e')](config[_0xc6d4('0x9f')],_0xc6d4('0xa0'),_0x13fd49[_0xc6d4('0x4e')][_0xc6d4('0x9d')][_0x3c6528][_0xc6d4('0xa1')])};}}var _0x33172d={'tls':{'rejectUnauthorized':![]}};if(_[_0xc6d4('0x62')](_0xa9b280[_0xc6d4('0x2d')][_0xc6d4('0x69')])){if(_0xa9b280[_0xc6d4('0x2d')][_0xc6d4('0x6c')]){_0x33172d[_0xc6d4('0xa2')]={'user':_0xa9b280[_0xc6d4('0x2d')][_0xc6d4('0x65')],'pass':_0xa9b280['Smtp']['pass']};}_0x33172d[_0xc6d4('0x6a')]=_0xa9b280[_0xc6d4('0x2d')][_0xc6d4('0x6a')];_0x33172d['port']=_0xa9b280[_0xc6d4('0x2d')][_0xc6d4('0x6b')];_0x33172d['secure']=_0xa9b280[_0xc6d4('0x2d')][_0xc6d4('0xa3')];}else{_0x33172d[_0xc6d4('0x69')]=_0xa9b280['Smtp']['service'];_0x33172d[_0xc6d4('0xa2')]={'user':_0xa9b280[_0xc6d4('0x2d')]['user'],'pass':_0xa9b280[_0xc6d4('0x2d')][_0xc6d4('0x68')]};}return respondWithRpcPromise(_0xc6d4('0xa4'),_0xc6d4('0xa5'),{'account':_0x33172d,'message':_0x13fd49[_0xc6d4('0x4e')]});}else{throw new Error('List\x20not\x20found');}}})[_0xc6d4('0x23')](function(_0x83cb62){if(_0x83cb62){_0xd88795=_0x83cb62;if(_0x28a272[_0xc6d4('0x97')]){if(_0x28a272[_0xc6d4('0x97')]['Contacts'][_0xc6d4('0x39')]){return _0x28a272[_0xc6d4('0x97')][_0xc6d4('0x99')][0x0];}else{return db[_0xc6d4('0x98')]['create'](_['defaults'](_0x13fd49['body'],{'firstName':_0x13fd49[_0xc6d4('0x4e')]['to'],'email':_0x13fd49['body']['to'],'phone':_0x13fd49['body']['to'],'ListId':_0x28a272[_0xc6d4('0xa6')]}));}}else{throw new Error(_0xc6d4('0xa7'));}}})[_0xc6d4('0x23')](function(_0x4c30e7){if(_0x4c30e7){var _0x3b436b={'UserId':_0x13fd49[_0xc6d4('0x65')]['id'],'ContactId':_0x4c30e7['id'],'MailAccountId':_0x28a272['id'],'inReplyTo':_0xd88795['messageId'],'to':_0x13fd49['body'][_0xc6d4('0x9b')],'cc':_0x13fd49[_0xc6d4('0x4e')]['cc'],'subject':_0x13fd49[_0xc6d4('0x4e')]['subject'],'attach':_0x13fd49['body']['attach'],'firstMsgDirection':_0xc6d4('0xa8'),'lastMsgAt':moment()[_0xc6d4('0x92')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0xc6d4('0xa8'),'Messages':[_[_0xc6d4('0x42')](_0x13fd49[_0xc6d4('0x4e')],{'messageId':_0xd88795[_0xc6d4('0xa9')],'sentAt':moment()[_0xc6d4('0x92')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x28a272['id'],'UserId':_0x13fd49[_0xc6d4('0x65')]['id'],'ContactId':_0x4c30e7['id']})]};if(_0x13fd49[_0xc6d4('0x4e')][_0xc6d4('0xaa')]){_0x3b436b=_['merge'](_0x3b436b,_0x13fd49[_0xc6d4('0x4e')][_0xc6d4('0xaa')]);}return db[_0xc6d4('0x7a')]['create'](_0x3b436b,{'include':[{'model':db[_0xc6d4('0x94')],'as':'Messages'}]});}})['then'](respondWithResult(_0x245b11,null))[_0xc6d4('0x19')](handleError(_0x245b11,null));};exports[_0xc6d4('0xab')]=function(_0x1ef039,_0x4ff164){return db[_0xc6d4('0x2f')][_0xc6d4('0x4c')]({'where':{'id':_0x1ef039[_0xc6d4('0x48')]['id']},'include':[{'model':db[_0xc6d4('0x2c')],'as':_0xc6d4('0x2d'),'raw':!![],'include':[{'model':db[_0xc6d4('0xac')],'as':'CloudProvider','raw':!![]}]}]})[_0xc6d4('0x23')](handleEntityNotFound(_0x4ff164,null))[_0xc6d4('0x23')](function(_0x4fe419){if(!_0x4fe419[_0xc6d4('0x2d')])return;var _0x1e8034={'id':_0x4fe419['id'],'tls':{'rejectUnauthorized':![]}};if(_0x4fe419[_0xc6d4('0x5f')]!==_0xc6d4('0x60')){_0x1e8034[_0xc6d4('0x69')]=_0x4fe419[_0xc6d4('0x5f')];}else{_0x1e8034[_0xc6d4('0x6a')]=_0x4fe419[_0xc6d4('0x2d')][_0xc6d4('0x6a')];_0x1e8034['port']=_0x4fe419['Smtp'][_0xc6d4('0x6b')];_0x1e8034[_0xc6d4('0xa3')]=_0x4fe419[_0xc6d4('0x2d')][_0xc6d4('0xa3')];}if(_0x4fe419[_0xc6d4('0x2d')][_0xc6d4('0x6c')]){if(_0x4fe419['Smtp'][_0xc6d4('0x4f')]){_0x1e8034[_0xc6d4('0xa2')]={'type':_0xc6d4('0xad'),'user':_0x4fe419[_0xc6d4('0x2d')]['user'],'accessToken':_0x4fe419['Smtp'][_0xc6d4('0xac')][_0xc6d4('0xae')]};}else{_0x1e8034[_0xc6d4('0xa2')]={'user':_0x4fe419[_0xc6d4('0x2d')]['user'],'pass':_0x4fe419[_0xc6d4('0x2d')][_0xc6d4('0x68')]};}}return respondWithRpcPromise('VerifySmtp',_0xc6d4('0xab'),{'account':_0x1e8034});})[_0xc6d4('0x23')](respondWithResult(_0x4ff164,null))['catch'](handleError(_0x4ff164,null));};exports[_0xc6d4('0x24')]=function(_0x5e1e89,_0x462a37){return db[_0xc6d4('0x2f')][_0xc6d4('0x4c')]({'where':{'id':_0x5e1e89[_0xc6d4('0x48')]['id']}})[_0xc6d4('0x23')](handleEntityNotFound(_0x462a37,null))[_0xc6d4('0x23')](function(_0x5f54e2){if(_0x5f54e2&&_0x5f54e2[_0xc6d4('0x69')]){throw new db[(_0xc6d4('0xaf'))]['ValidationError']('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x5f54e2;})[_0xc6d4('0x23')](removeEntity(_0x462a37,null))[_0xc6d4('0x19')](handleError(_0x462a37,null));};exports[_0xc6d4('0xb0')]=function(_0x2f5644,_0x47649c){return db[_0xc6d4('0x2f')][_0xc6d4('0x4c')]({'where':{'id':_0x2f5644[_0xc6d4('0x48')]['id']}})[_0xc6d4('0x23')](handleEntityNotFound(_0x47649c,null))[_0xc6d4('0x23')](function(_0x52a1c4){if(_0x52a1c4){return _0x52a1c4['addAgents'](_0x2f5644[_0xc6d4('0x4e')][_0xc6d4('0x59')],_[_0xc6d4('0x7b')](_0x2f5644[_0xc6d4('0x4e')],['ids','id'])||{})[_0xc6d4('0xb1')](function(_0x117f84){for(var _0x1f2982=0x0;_0x1f2982<_0x2f5644[_0xc6d4('0x4e')]['ids']['length'];_0x1f2982+=0x1){socket[_0xc6d4('0xb2')](_0xc6d4('0xb3'),{'UserId':Number(_0x2f5644[_0xc6d4('0x4e')]['ids'][_0x1f2982]),'MailAccountId':Number(_0x2f5644[_0xc6d4('0x48')]['id'])});}return _0x117f84;});}})['then'](respondWithResult(_0x47649c,null))['catch'](handleError(_0x47649c,null));};exports[_0xc6d4('0xb4')]=function(_0x21a37f,_0x13e3d4){return db['MailAccount'][_0xc6d4('0x4c')]({'where':{'id':_0x21a37f['params']['id']}})[_0xc6d4('0x23')](handleEntityNotFound(_0x13e3d4,null))[_0xc6d4('0x23')](function(_0x16a5d5){if(_0x16a5d5){return _0x16a5d5[_0xc6d4('0xb4')](_0x21a37f[_0xc6d4('0x34')][_0xc6d4('0x59')])[_0xc6d4('0x23')](function(){if(_[_0xc6d4('0xb5')](_0x21a37f[_0xc6d4('0x34')][_0xc6d4('0x59')])){for(var _0x5a893e=0x0;_0x5a893e<_0x21a37f[_0xc6d4('0x34')][_0xc6d4('0x59')][_0xc6d4('0x39')];_0x5a893e+=0x1){socket[_0xc6d4('0xb2')](_0xc6d4('0xb6'),{'UserId':Number(_0x21a37f[_0xc6d4('0x34')]['ids'][_0x5a893e]),'MailAccountId':Number(_0x21a37f[_0xc6d4('0x48')]['id'])});}}else{socket['emit'](_0xc6d4('0xb6'),{'UserId':Number(_0x21a37f[_0xc6d4('0x34')][_0xc6d4('0x59')]),'MailAccountId':Number(_0x21a37f[_0xc6d4('0x48')]['id'])});}});}})[_0xc6d4('0x23')](respondWithStatusCode(_0x13e3d4,null))['catch'](handleError(_0x13e3d4,null));};exports[_0xc6d4('0xb7')]=function(_0x40e6bd,_0x260893){var _0x1298e1={};var _0x3a4f3f={};var _0x423c48;var _0x3b73af;return db['MailAccount'][_0xc6d4('0x55')]({'where':{'id':_0x40e6bd[_0xc6d4('0x48')]['id']}})['then'](handleEntityNotFound(_0x260893,null))['then'](function(_0x165bdf){if(_0x165bdf){_0x423c48=_0x165bdf;_0x3a4f3f[_0xc6d4('0x32')]=_['keys'](db[_0xc6d4('0xb8')][_0xc6d4('0x30')]);_0x3a4f3f['query']=_[_0xc6d4('0x35')](_0x40e6bd[_0xc6d4('0x34')]);_0x3a4f3f[_0xc6d4('0x3f')]=_[_0xc6d4('0x36')](_0x3a4f3f['model'],_0x3a4f3f[_0xc6d4('0x34')]);_0x1298e1['attributes']=_[_0xc6d4('0x36')](_0x3a4f3f[_0xc6d4('0x32')],qs[_0xc6d4('0x37')](_0x40e6bd[_0xc6d4('0x34')][_0xc6d4('0x37')]));_0x1298e1['attributes']=_0x1298e1[_0xc6d4('0x38')][_0xc6d4('0x39')]?_0x1298e1[_0xc6d4('0x38')]:_0x3a4f3f[_0xc6d4('0x32')];_0x1298e1[_0xc6d4('0x3c')]=qs[_0xc6d4('0x3d')](_0x40e6bd[_0xc6d4('0x34')][_0xc6d4('0x3d')]);_0x1298e1['where']=qs[_0xc6d4('0x3f')](_[_0xc6d4('0x40')](_0x40e6bd[_0xc6d4('0x34')],_0x3a4f3f['filters']));if(_0x40e6bd[_0xc6d4('0x34')][_0xc6d4('0x41')]){_0x1298e1[_0xc6d4('0x3e')]=_[_0xc6d4('0x42')](_0x1298e1[_0xc6d4('0x3e')],{'$or':_[_0xc6d4('0x33')](_0x1298e1[_0xc6d4('0x38')],function(_0x14a58e){var _0x1171f5={};_0x1171f5[_0x14a58e]={'$like':'%'+_0x40e6bd[_0xc6d4('0x34')]['filter']+'%'};return _0x1171f5;})});}_0x1298e1=_[_0xc6d4('0x42')]({},_0x1298e1,_0x40e6bd[_0xc6d4('0x56')]);return _0x423c48[_0xc6d4('0xb7')](_0x1298e1);}})[_0xc6d4('0x23')](function(_0x435ea3){if(_0x435ea3){_0x3b73af=_0x435ea3[_0xc6d4('0x39')];if(!_0x40e6bd['query']['hasOwnProperty']('nolimit')){_0x1298e1[_0xc6d4('0x1e')]=qs[_0xc6d4('0x1e')](_0x40e6bd['query'][_0xc6d4('0x1e')]);_0x1298e1[_0xc6d4('0x1c')]=qs[_0xc6d4('0x1c')](_0x40e6bd[_0xc6d4('0x34')][_0xc6d4('0x1c')]);}return _0x423c48[_0xc6d4('0xb7')](_0x1298e1);}})['then'](function(_0x493558){if(_0x493558){return _0x493558?{'count':_0x3b73af,'rows':_0x493558}:null;}})['then'](respondWithResult(_0x260893,null))[_0xc6d4('0x19')](handleError(_0x260893,null));}; \ No newline at end of file +var _0x9605=['port','authentication','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','transaction','sequelize','Transaction','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','finally','getApplications','getMessages','MailMessage','$gte','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','split','CmList','List','Contacts','updatedAt','DESC','from','format','%s\x20<%s>','attachments','join','secure','auth','SendMail','List\x20not\x20found','messageId','subject','out','Interaction','CloudProvider','OAuth2','data5','VerifySmtp','verifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','moment','bluebird','util','lodash','juice','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','then','info','MailAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','get','MailAccounts','sendStatus','stack','name','send','index','MailServerIn','Imap','Pause','mandatoryDispositionPause','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','MailAccount','includeAll','findAll','rows','show','MailServerOut','Smtp','rawAttributes','include','body','CloudProviderId','find','describe','addDisposition','params','MailAccountId','Disposition','create','getDispositions','findOne','pick','options','ids','addAnswer','CannedAnswer','getAnswers','map','removeAnswers','key','provider','email','ListId','isNil','active','description','user','username','password','modernAuthentication','pass','service','host'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9605,0x1cb));var _0x5960=function(_0x598703,_0x13c4f5){_0x598703=_0x598703-0x0;var _0x40fd44=_0x9605[_0x598703];return _0x40fd44;};'use strict';var moment=require(_0x5960('0x0'));var BPromise=require(_0x5960('0x1'));var util=require(_0x5960('0x2'));var path=require('path');var _=require(_0x5960('0x3'));var juice=require(_0x5960('0x4'));var Redis=require(_0x5960('0x5'));var qs=require('../../components/parsers/qs');var logger=require(_0x5960('0x6'))(_0x5960('0x7'));var config=require(_0x5960('0x8'));var db=require(_0x5960('0x9'))['db'];config[_0x5960('0xa')]=_[_0x5960('0xb')](config[_0x5960('0xa')],{'host':_0x5960('0xc'),'port':0x18eb});var socket=require(_0x5960('0xd'))(new Redis(config[_0x5960('0xa')]));require(_0x5960('0xe'))[_0x5960('0xf')](socket);var jayson=require(_0x5960('0x10'));var client=jayson[_0x5960('0x11')]['http']({'port':0x232b});function respondWithRpcPromise(_0x23133f,_0x451c8d,_0x58bae1,_0x12ffe5){return new BPromise(function(_0x536ee2,_0x184e03){var _0x3e13e7=_0x12ffe5||client;return _0x3e13e7['request'](_0x23133f,_0x58bae1)[_0x5960('0x12')](function(_0x263074){logger[_0x5960('0x13')](_0x5960('0x14'),_0x451c8d,'request\x20sent');logger[_0x5960('0x15')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x451c8d,_0x5960('0x16'),JSON[_0x5960('0x17')](_0x263074));if(_0x263074[_0x5960('0x18')]){if(_0x263074['error'][_0x5960('0x19')]===0x1f4){logger[_0x5960('0x18')](_0x5960('0x14'),_0x451c8d,_0x263074[_0x5960('0x18')][_0x5960('0x1a')]);return _0x184e03(_0x263074[_0x5960('0x18')]['message']);}logger[_0x5960('0x18')]('MailAccount,\x20%s,\x20%s',_0x451c8d,_0x263074['error'][_0x5960('0x1a')]);return _0x536ee2(_0x263074[_0x5960('0x18')][_0x5960('0x1a')]);}else{logger['info'](_0x5960('0x14'),_0x451c8d,_0x5960('0x16'));_0x536ee2(_0x263074[_0x5960('0x1b')][_0x5960('0x1a')]);}})[_0x5960('0x1c')](function(_0x76ff99){logger['error'](_0x5960('0x14'),_0x451c8d,_0x76ff99);_0x184e03(_0x76ff99);});});}function respondWithStatusCode(_0x15d121,_0x4a4c58){_0x4a4c58=_0x4a4c58||0xcc;return function(_0x3c79e2){if(_0x3c79e2){return _0x15d121['sendStatus'](_0x4a4c58);}return _0x15d121[_0x5960('0x1d')](_0x4a4c58)[_0x5960('0x1e')]();};}function respondWithResult(_0x2fd31c,_0x299e30){_0x299e30=_0x299e30||0xc8;return function(_0x199c28){if(_0x199c28){return _0x2fd31c[_0x5960('0x1d')](_0x299e30)[_0x5960('0x1f')](_0x199c28);}};}function respondWithFilteredResult(_0x5b4475,_0x32dc48){return function(_0x35e9da){if(_0x35e9da){var _0x67670e=typeof _0x32dc48[_0x5960('0x20')]===_0x5960('0x21')&&typeof _0x32dc48[_0x5960('0x22')]==='undefined';var _0x2a0745=_0x35e9da[_0x5960('0x23')];var _0x1faea8=_0x67670e?0x0:_0x32dc48[_0x5960('0x20')];var _0x33cd25=_0x67670e?_0x35e9da[_0x5960('0x23')]:_0x32dc48['offset']+_0x32dc48[_0x5960('0x22')];var _0x68dee9;if(_0x33cd25>=_0x2a0745){_0x33cd25=_0x2a0745;_0x68dee9=0xc8;}else{_0x68dee9=0xce;}_0x5b4475[_0x5960('0x1d')](_0x68dee9);return _0x5b4475[_0x5960('0x24')](_0x5960('0x25'),_0x1faea8+'-'+_0x33cd25+'/'+_0x2a0745)['json'](_0x35e9da);}return null;};}function saveUpdates(_0xd067a5){return function(_0x3b243d){if(_0x3b243d){return _0x3b243d[_0x5960('0x26')](_0xd067a5)[_0x5960('0x12')](function(_0x44341d){return _0x44341d;});}return null;};}function removeEntity(_0x379053){return function(_0x342a4f){if(_0x342a4f){return _0x342a4f[_0x5960('0x27')]()['then'](function(){var _0x452252=_0x342a4f[_0x5960('0x28')]({'plain':!![]});var _0xb7ef83=_0x5960('0x29');return db['UserProfileResource'][_0x5960('0x27')]({'where':{'type':_0xb7ef83,'resourceId':_0x452252['id']}})['then'](function(){return _0x342a4f;});})[_0x5960('0x12')](function(){_0x379053[_0x5960('0x1d')](0xcc)[_0x5960('0x1e')]();});}};}function handleEntityNotFound(_0x49e524){return function(_0x50f257){if(!_0x50f257){_0x49e524[_0x5960('0x2a')](0x194);}return _0x50f257;};}function handleError(_0x26f19d,_0x2ec9ed){_0x2ec9ed=_0x2ec9ed||0x1f4;return function(_0x56ae7c){logger[_0x5960('0x18')](_0x56ae7c[_0x5960('0x2b')]);if(_0x56ae7c[_0x5960('0x2c')]){delete _0x56ae7c['name'];}_0x26f19d[_0x5960('0x1d')](_0x2ec9ed)[_0x5960('0x2d')](_0x56ae7c);};}exports[_0x5960('0x2e')]=function(_0x2c40b9,_0x2a1702){var _0x275c1c={'include':[{'model':db[_0x5960('0x2f')],'as':_0x5960('0x30')},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0x5960('0x31')],'as':_0x5960('0x32')}]},_0x581978={},_0x806f2b={'count':0x0,'rows':[]};var _0x551a6a=_['map'](db['MailAccount']['rawAttributes'],function(_0x2d2ca2){return{'name':_0x2d2ca2[_0x5960('0x33')],'type':_0x2d2ca2[_0x5960('0x34')]['key']};});_0x581978[_0x5960('0x35')]=_['map'](_0x551a6a,_0x5960('0x2c'));_0x581978[_0x5960('0x36')]=_[_0x5960('0x37')](_0x2c40b9[_0x5960('0x36')]);_0x581978[_0x5960('0x38')]=_[_0x5960('0x39')](_0x581978[_0x5960('0x35')],_0x581978['query']);_0x275c1c['attributes']=_[_0x5960('0x39')](_0x581978[_0x5960('0x35')],qs[_0x5960('0x3a')](_0x2c40b9[_0x5960('0x36')][_0x5960('0x3a')]));_0x275c1c['attributes']=_0x275c1c[_0x5960('0x3b')][_0x5960('0x3c')]?_0x275c1c[_0x5960('0x3b')]:_0x581978['model'];if(!_0x2c40b9[_0x5960('0x36')][_0x5960('0x3d')](_0x5960('0x3e'))){_0x275c1c['limit']=qs[_0x5960('0x22')](_0x2c40b9[_0x5960('0x36')][_0x5960('0x22')]);_0x275c1c[_0x5960('0x20')]=qs['offset'](_0x2c40b9[_0x5960('0x36')][_0x5960('0x20')]);}_0x275c1c[_0x5960('0x3f')]=qs[_0x5960('0x40')](_0x2c40b9[_0x5960('0x36')]['sort']);_0x275c1c[_0x5960('0x41')]=qs[_0x5960('0x38')](_['pick'](_0x2c40b9[_0x5960('0x36')],_0x581978['filters']),_0x551a6a);if(_0x2c40b9[_0x5960('0x36')][_0x5960('0x42')]){_0x275c1c[_0x5960('0x41')]=_[_0x5960('0x43')](_0x275c1c[_0x5960('0x41')],{'$or':_['map'](_0x551a6a,function(_0x2ab426){if(_0x2ab426[_0x5960('0x34')]!==_0x5960('0x44')){var _0x31cd9b={};_0x31cd9b[_0x2ab426[_0x5960('0x2c')]]={'$like':'%'+_0x2c40b9[_0x5960('0x36')][_0x5960('0x42')]+'%'};return _0x31cd9b;}})});}_0x275c1c=_[_0x5960('0x43')]({},_0x275c1c,_0x2c40b9['options']);var _0x55019b={'where':_0x275c1c[_0x5960('0x41')]};return db[_0x5960('0x45')]['count'](_0x55019b)[_0x5960('0x12')](function(_0x30410f){_0x806f2b[_0x5960('0x23')]=_0x30410f;if(_0x2c40b9[_0x5960('0x36')][_0x5960('0x46')]){_0x275c1c['include']=[{'all':!![]}];}return db[_0x5960('0x45')][_0x5960('0x47')](_0x275c1c);})[_0x5960('0x12')](function(_0x3488d9){_0x806f2b[_0x5960('0x48')]=_0x3488d9;return _0x806f2b;})[_0x5960('0x12')](respondWithFilteredResult(_0x2a1702,_0x275c1c))['catch'](handleError(_0x2a1702,null));};exports[_0x5960('0x49')]=function(_0x37330d,_0x41a2be){var _0x3869cd={'raw':![],'where':{'id':_0x37330d['params']['id']},'include':[{'model':db[_0x5960('0x2f')],'as':_0x5960('0x30')},{'model':db[_0x5960('0x4a')],'as':_0x5960('0x4b')},{'model':db[_0x5960('0x31')],'as':'mandatoryDispositionPause'}]},_0x4627d8={};_0x4627d8[_0x5960('0x35')]=_['keys'](db[_0x5960('0x45')][_0x5960('0x4c')]);_0x4627d8['query']=_[_0x5960('0x37')](_0x37330d[_0x5960('0x36')]);_0x4627d8[_0x5960('0x38')]=_[_0x5960('0x39')](_0x4627d8[_0x5960('0x35')],_0x4627d8['query']);_0x3869cd[_0x5960('0x3b')]=_[_0x5960('0x39')](_0x4627d8[_0x5960('0x35')],qs[_0x5960('0x3a')](_0x37330d[_0x5960('0x36')][_0x5960('0x3a')]));_0x3869cd[_0x5960('0x3b')]=_0x3869cd[_0x5960('0x3b')][_0x5960('0x3c')]?_0x3869cd[_0x5960('0x3b')]:_0x4627d8['model'];if(_0x37330d[_0x5960('0x36')]['includeAll']){_0x3869cd[_0x5960('0x4d')]=[{'all':!![]}];}_0x3869cd=_['merge']({},_0x3869cd,_0x37330d['options']);return db[_0x5960('0x45')]['find'](_0x3869cd)['then'](handleEntityNotFound(_0x41a2be,null))[_0x5960('0x12')](respondWithResult(_0x41a2be,null))[_0x5960('0x1c')](handleError(_0x41a2be,null));};exports[_0x5960('0x26')]=function(_0x240a92,_0x168df8){if(_0x240a92[_0x5960('0x4e')]['id']){delete _0x240a92[_0x5960('0x4e')]['id'];}if(_0x240a92['body'][_0x5960('0x30')]){if(!_0x240a92[_0x5960('0x4e')][_0x5960('0x30')]['modernAuthentication']){_0x240a92[_0x5960('0x4e')]['Imap'][_0x5960('0x4f')]=null;}}if(_0x240a92[_0x5960('0x4e')][_0x5960('0x4b')]){if(!_0x240a92[_0x5960('0x4e')][_0x5960('0x4b')]['modernAuthentication']){_0x240a92[_0x5960('0x4e')]['Smtp']['CloudProviderId']=null;}}return db[_0x5960('0x45')][_0x5960('0x50')]({'where':{'id':_0x240a92['params']['id']},'include':[{'model':db['MailServerIn'],'as':_0x5960('0x30')},{'model':db[_0x5960('0x4a')],'as':_0x5960('0x4b')},{'model':db[_0x5960('0x31')],'as':_0x5960('0x32')}]})[_0x5960('0x12')](handleEntityNotFound(_0x168df8,null))[_0x5960('0x12')](saveUpdates(_0x240a92[_0x5960('0x4e')],null))[_0x5960('0x12')](function(_0x3037cf){if(_0x3037cf&&_0x240a92[_0x5960('0x4e')]['Imap']){return db[_0x5960('0x2f')][_0x5960('0x26')](_0x240a92[_0x5960('0x4e')][_0x5960('0x30')],{'where':{'MailAccountId':_0x3037cf['id']}})[_0x5960('0x12')](function(){return _0x3037cf;});}return _0x3037cf;})[_0x5960('0x12')](function(_0x4e95d3){if(_0x4e95d3&&_0x240a92[_0x5960('0x4e')][_0x5960('0x4b')]){return db['MailServerOut'][_0x5960('0x26')](_0x240a92['body'][_0x5960('0x4b')],{'where':{'MailAccountId':_0x4e95d3['id']}})[_0x5960('0x12')](function(){return _0x4e95d3;});}return _0x4e95d3;})[_0x5960('0x12')](respondWithResult(_0x168df8,null))[_0x5960('0x1c')](handleError(_0x168df8,null));};exports[_0x5960('0x51')]=function(_0x19d8ce,_0x3a6c11){return db[_0x5960('0x45')][_0x5960('0x51')]()['then'](respondWithResult(_0x3a6c11,null))['catch'](handleError(_0x3a6c11,null));};exports[_0x5960('0x52')]=function(_0x10408,_0x599ea4){if(_0x10408[_0x5960('0x4e')]['id']){delete _0x10408[_0x5960('0x4e')]['id'];}return db[_0x5960('0x45')][_0x5960('0x50')]({'where':{'id':_0x10408[_0x5960('0x53')]['id']}})[_0x5960('0x12')](handleEntityNotFound(_0x599ea4,null))[_0x5960('0x12')](function(_0x123da3){if(_0x123da3){_0x10408[_0x5960('0x4e')][_0x5960('0x54')]=_0x123da3['id'];return db[_0x5960('0x55')][_0x5960('0x56')](_0x10408[_0x5960('0x4e')]);}})[_0x5960('0x12')](respondWithResult(_0x599ea4,null))[_0x5960('0x1c')](handleError(_0x599ea4,null));};exports[_0x5960('0x57')]=function(_0x5a710d,_0x5726be){var _0x107cd4={'raw':![],'where':{}};var _0x1defc0={};var _0x372f88={'count':0x0,'rows':[]};return db[_0x5960('0x45')][_0x5960('0x58')]({'where':{'id':_0x5a710d[_0x5960('0x53')]['id']}})['then'](handleEntityNotFound(_0x5726be,null))['then'](function(_0x1bbfa7){if(_0x1bbfa7){_0x1defc0[_0x5960('0x35')]=_['keys'](db[_0x5960('0x55')][_0x5960('0x4c')]);_0x1defc0[_0x5960('0x36')]=_['keys'](_0x5a710d[_0x5960('0x36')]);_0x1defc0[_0x5960('0x38')]=_[_0x5960('0x39')](_0x1defc0[_0x5960('0x35')],_0x1defc0[_0x5960('0x36')]);_0x107cd4[_0x5960('0x3b')]=_[_0x5960('0x39')](_0x1defc0[_0x5960('0x35')],qs[_0x5960('0x3a')](_0x5a710d[_0x5960('0x36')][_0x5960('0x3a')]));_0x107cd4[_0x5960('0x3b')]=_0x107cd4[_0x5960('0x3b')][_0x5960('0x3c')]?_0x107cd4['attributes']:_0x1defc0[_0x5960('0x35')];if(!_0x5a710d[_0x5960('0x36')][_0x5960('0x3d')](_0x5960('0x3e'))){_0x107cd4['limit']=qs['limit'](_0x5a710d[_0x5960('0x36')]['limit']);_0x107cd4[_0x5960('0x20')]=qs['offset'](_0x5a710d['query'][_0x5960('0x20')]);}_0x107cd4[_0x5960('0x3f')]=qs[_0x5960('0x40')](_0x5a710d[_0x5960('0x36')][_0x5960('0x40')]);_0x107cd4[_0x5960('0x41')]=qs[_0x5960('0x38')](_[_0x5960('0x59')](_0x5a710d['query'],_0x1defc0[_0x5960('0x38')]));_0x107cd4[_0x5960('0x41')]['MailAccountId']=_0x1bbfa7['id'];if(_0x5a710d[_0x5960('0x36')][_0x5960('0x42')]){_0x107cd4[_0x5960('0x41')]=_['merge'](_0x107cd4[_0x5960('0x41')],{'$or':_['map'](_0x107cd4['attributes'],function(_0x54cf55){var _0xabd0d9={};_0xabd0d9[_0x54cf55]={'$like':'%'+_0x5a710d[_0x5960('0x36')][_0x5960('0x42')]+'%'};return _0xabd0d9;})});}_0x107cd4=_['merge']({},_0x107cd4,_0x5a710d[_0x5960('0x5a')]);return db['Disposition'][_0x5960('0x23')]({'where':_0x107cd4[_0x5960('0x41')]})[_0x5960('0x12')](function(_0x4b8317){_0x372f88[_0x5960('0x23')]=_0x4b8317;if(_0x5a710d[_0x5960('0x36')][_0x5960('0x46')]){_0x107cd4[_0x5960('0x4d')]=[{'all':!![]}];}return db[_0x5960('0x55')][_0x5960('0x47')](_0x107cd4);})[_0x5960('0x12')](function(_0x24d199){_0x372f88['rows']=_0x24d199;return _0x372f88;});}})[_0x5960('0x12')](respondWithFilteredResult(_0x5726be,_0x107cd4))['catch'](handleError(_0x5726be,null));};exports['removeDispositions']=function(_0x1aaa7d,_0x20f9de){return db['MailAccount'][_0x5960('0x50')]({'where':{'id':_0x1aaa7d[_0x5960('0x53')]['id']}})['then'](handleEntityNotFound(_0x20f9de,null))[_0x5960('0x12')](function(_0x439839){if(_0x439839){return _0x439839['removeDispositions'](_0x1aaa7d[_0x5960('0x36')][_0x5960('0x5b')]);}})[_0x5960('0x12')](respondWithStatusCode(_0x20f9de,null))[_0x5960('0x1c')](handleError(_0x20f9de,null));};exports[_0x5960('0x5c')]=function(_0x5b4e66,_0x21bacd){if(_0x5b4e66['body']['id']){delete _0x5b4e66[_0x5960('0x4e')]['id'];}return db[_0x5960('0x45')][_0x5960('0x50')]({'where':{'id':_0x5b4e66['params']['id']}})[_0x5960('0x12')](handleEntityNotFound(_0x21bacd,null))[_0x5960('0x12')](function(_0x3e1751){if(_0x3e1751){_0x5b4e66[_0x5960('0x4e')][_0x5960('0x54')]=_0x3e1751['id'];return db[_0x5960('0x5d')][_0x5960('0x56')](_0x5b4e66['body']);}})[_0x5960('0x12')](respondWithResult(_0x21bacd,null))[_0x5960('0x1c')](handleError(_0x21bacd,null));};exports[_0x5960('0x5e')]=function(_0x5bd331,_0x2dc1d9){var _0x29a02e={'raw':![],'where':{}};var _0x215bf6={};var _0x3a45f1={'count':0x0,'rows':[]};return db[_0x5960('0x45')][_0x5960('0x58')]({'where':{'id':_0x5bd331[_0x5960('0x53')]['id']}})[_0x5960('0x12')](handleEntityNotFound(_0x2dc1d9,null))[_0x5960('0x12')](function(_0xe9d2b3){if(_0xe9d2b3){_0x215bf6[_0x5960('0x35')]=_[_0x5960('0x37')](db[_0x5960('0x5d')]['rawAttributes']);_0x215bf6[_0x5960('0x36')]=_['keys'](_0x5bd331['query']);_0x215bf6[_0x5960('0x38')]=_[_0x5960('0x39')](_0x215bf6[_0x5960('0x35')],_0x215bf6[_0x5960('0x36')]);_0x29a02e['attributes']=_['intersection'](_0x215bf6[_0x5960('0x35')],qs[_0x5960('0x3a')](_0x5bd331[_0x5960('0x36')][_0x5960('0x3a')]));_0x29a02e['attributes']=_0x29a02e[_0x5960('0x3b')][_0x5960('0x3c')]?_0x29a02e[_0x5960('0x3b')]:_0x215bf6['model'];if(!_0x5bd331[_0x5960('0x36')]['hasOwnProperty'](_0x5960('0x3e'))){_0x29a02e[_0x5960('0x22')]=qs[_0x5960('0x22')](_0x5bd331[_0x5960('0x36')][_0x5960('0x22')]);_0x29a02e[_0x5960('0x20')]=qs[_0x5960('0x20')](_0x5bd331[_0x5960('0x36')]['offset']);}_0x29a02e[_0x5960('0x3f')]=qs[_0x5960('0x40')](_0x5bd331[_0x5960('0x36')][_0x5960('0x40')]);_0x29a02e[_0x5960('0x41')]=qs[_0x5960('0x38')](_[_0x5960('0x59')](_0x5bd331[_0x5960('0x36')],_0x215bf6['filters']));_0x29a02e['where']['MailAccountId']=_0xe9d2b3['id'];if(_0x5bd331[_0x5960('0x36')][_0x5960('0x42')]){_0x29a02e[_0x5960('0x41')]=_['merge'](_0x29a02e[_0x5960('0x41')],{'$or':_[_0x5960('0x5f')](_0x29a02e[_0x5960('0x3b')],function(_0x221da2){var _0x3f3a45={};_0x3f3a45[_0x221da2]={'$like':'%'+_0x5bd331[_0x5960('0x36')][_0x5960('0x42')]+'%'};return _0x3f3a45;})});}_0x29a02e=_['merge']({},_0x29a02e,_0x5bd331[_0x5960('0x5a')]);return db[_0x5960('0x5d')]['count']({'where':_0x29a02e['where']})[_0x5960('0x12')](function(_0x57eef9){_0x3a45f1[_0x5960('0x23')]=_0x57eef9;if(_0x5bd331['query'][_0x5960('0x46')]){_0x29a02e[_0x5960('0x4d')]=[{'all':!![]}];}return db[_0x5960('0x5d')][_0x5960('0x47')](_0x29a02e);})[_0x5960('0x12')](function(_0x3a5e43){_0x3a45f1[_0x5960('0x48')]=_0x3a5e43;return _0x3a45f1;});}})[_0x5960('0x12')](respondWithFilteredResult(_0x2dc1d9,_0x29a02e))[_0x5960('0x1c')](handleError(_0x2dc1d9,null));};exports['removeAnswers']=function(_0x22d120,_0x199669){return db[_0x5960('0x45')][_0x5960('0x50')]({'where':{'id':_0x22d120[_0x5960('0x53')]['id']}})[_0x5960('0x12')](handleEntityNotFound(_0x199669,null))[_0x5960('0x12')](function(_0x1115cc){if(_0x1115cc){return _0x1115cc[_0x5960('0x60')](_0x22d120['query'][_0x5960('0x5b')]);}})[_0x5960('0x12')](respondWithStatusCode(_0x199669,null))['catch'](handleError(_0x199669,null));};exports[_0x5960('0x56')]=function(_0x1d2110,_0x9e107c){var _0x3c33b2={'name':_0x1d2110[_0x5960('0x4e')][_0x5960('0x2c')],'key':_0x1d2110['body'][_0x5960('0x61')],'provider':_0x1d2110['body'][_0x5960('0x62')]==='custom'?null:_0x1d2110[_0x5960('0x4e')][_0x5960('0x62')],'email':_0x1d2110[_0x5960('0x4e')][_0x5960('0x63')],'ListId':_0x1d2110[_0x5960('0x4e')][_0x5960('0x64')],'active':!_[_0x5960('0x65')](_0x1d2110[_0x5960('0x4e')][_0x5960('0x66')])?_0x1d2110[_0x5960('0x4e')][_0x5960('0x66')]:!![],'description':_0x1d2110[_0x5960('0x4e')][_0x5960('0x67')]||null,'Imap':{},'Smtp':{}};if(_0x3c33b2[_0x5960('0x62')]){_0x3c33b2[_0x5960('0x30')][_0x5960('0x68')]=_0x3c33b2['Smtp'][_0x5960('0x68')]=_0x1d2110[_0x5960('0x4e')][_0x5960('0x69')];_0x3c33b2[_0x5960('0x30')][_0x5960('0x6a')]=_0x3c33b2['Smtp']['pass']=_0x1d2110[_0x5960('0x4e')][_0x5960('0x6a')];if(_0x1d2110[_0x5960('0x4e')][_0x5960('0x6b')]){_0x3c33b2[_0x5960('0x30')][_0x5960('0x6b')]=_0x3c33b2[_0x5960('0x4b')]['modernAuthentication']=!![];_0x3c33b2[_0x5960('0x30')]['CloudProviderId']=_0x3c33b2[_0x5960('0x4b')][_0x5960('0x4f')]=_0x1d2110[_0x5960('0x4e')][_0x5960('0x4f')];_0x3c33b2[_0x5960('0x30')][_0x5960('0x6a')]=_0x3c33b2['Smtp'][_0x5960('0x6c')]=null;}else{_0x3c33b2[_0x5960('0x30')][_0x5960('0x4f')]=_0x3c33b2[_0x5960('0x4b')][_0x5960('0x4f')]=null;}_0x3c33b2[_0x5960('0x30')][_0x5960('0x6d')]=_0x3c33b2[_0x5960('0x4b')][_0x5960('0x6d')]=null;_0x3c33b2[_0x5960('0x30')][_0x5960('0x6e')]=_0x3c33b2[_0x5960('0x4b')][_0x5960('0x6e')]=null;_0x3c33b2['Imap'][_0x5960('0x6f')]=_0x3c33b2['Smtp'][_0x5960('0x6f')]=null;}else{if(_0x1d2110[_0x5960('0x4e')]['authentication']){_0x3c33b2['Imap'][_0x5960('0x68')]=_0x3c33b2[_0x5960('0x4b')]['user']=_0x1d2110[_0x5960('0x4e')][_0x5960('0x69')];_0x3c33b2['Imap'][_0x5960('0x6a')]=_0x3c33b2[_0x5960('0x4b')][_0x5960('0x6c')]=_0x1d2110['body']['password'];}else{_0x3c33b2[_0x5960('0x30')][_0x5960('0x70')]=_0x3c33b2[_0x5960('0x4b')][_0x5960('0x70')]=![];_0x3c33b2[_0x5960('0x30')]['user']=_0x3c33b2[_0x5960('0x4b')]['user']=null;_0x3c33b2[_0x5960('0x30')][_0x5960('0x6a')]=_0x3c33b2['Smtp'][_0x5960('0x6c')]=null;}_0x3c33b2[_0x5960('0x30')]['host']=_0x1d2110[_0x5960('0x4e')][_0x5960('0x30')][_0x5960('0x6e')];_0x3c33b2[_0x5960('0x30')][_0x5960('0x6f')]=_0x1d2110[_0x5960('0x4e')][_0x5960('0x30')][_0x5960('0x6f')];_0x3c33b2[_0x5960('0x4b')][_0x5960('0x6e')]=_0x1d2110[_0x5960('0x4e')][_0x5960('0x4b')][_0x5960('0x6e')];_0x3c33b2[_0x5960('0x4b')][_0x5960('0x6f')]=_0x1d2110[_0x5960('0x4e')][_0x5960('0x4b')][_0x5960('0x6f')];}return db[_0x5960('0x45')]['create'](_0x3c33b2,{'include':[{'model':db['MailServerOut'],'as':_0x5960('0x4b')},{'model':db['MailServerIn'],'as':_0x5960('0x30')}]})[_0x5960('0x12')](function(_0x2f695a){var _0x2a9989=_0x1d2110[_0x5960('0x68')][_0x5960('0x28')]({'plain':!![]});if(!_0x2a9989)throw new Error(_0x5960('0x71'));if(_0x2a9989[_0x5960('0x72')]===_0x5960('0x68')){var _0x593952=_0x2f695a[_0x5960('0x28')]({'plain':!![]});return db[_0x5960('0x73')]['find']({'where':{'name':_0x5960('0x29'),'userProfileId':_0x2a9989[_0x5960('0x74')]},'raw':!![]})[_0x5960('0x12')](function(_0x562925){if(_0x562925&&_0x562925[_0x5960('0x75')]===0x0){return db[_0x5960('0x76')]['create']({'name':_0x593952[_0x5960('0x2c')],'resourceId':_0x593952['id'],'type':_0x562925[_0x5960('0x2c')],'sectionId':_0x562925['id']},{})[_0x5960('0x12')](function(){return _0x2f695a;});}else{return _0x2f695a;}})[_0x5960('0x1c')](function(_0x2765c3){logger[_0x5960('0x18')](_0x5960('0x77'),_0x2765c3);throw _0x2765c3;});}return _0x2f695a;})[_0x5960('0x12')](respondWithResult(_0x9e107c,0xc9))['catch'](handleError(_0x9e107c,null));};exports['getImap']=function(_0x16afe9,_0x12ab39){return db[_0x5960('0x45')][_0x5960('0x58')]({'where':{'id':_0x16afe9[_0x5960('0x53')]['id']}})[_0x5960('0x12')](handleEntityNotFound(_0x12ab39,null))['then'](function(_0x4baabd){if(_0x4baabd){return _0x4baabd['getImap']();}return null;})['then'](respondWithResult(_0x12ab39,null))['catch'](handleError(_0x12ab39,null));};exports['addImap']=function(_0x5cdee4,_0xb754e5){if(_0x5cdee4['body']['id']){delete _0x5cdee4['body']['id'];}return db[_0x5960('0x45')]['find']({'where':{'id':_0x5cdee4[_0x5960('0x53')]['id']}})['then'](handleEntityNotFound(_0xb754e5,null))['then'](function(_0x1cd40e){if(_0x1cd40e){_0x5cdee4[_0x5960('0x4e')][_0x5960('0x54')]=_0x1cd40e['id'];return db[_0x5960('0x2f')][_0x5960('0x56')](_0x5cdee4[_0x5960('0x4e')]);}})[_0x5960('0x12')](respondWithResult(_0xb754e5,null))[_0x5960('0x1c')](handleError(_0xb754e5,null));};exports['removeImap']=function(_0x4a95e2,_0x3118c3){return db['MailAccount'][_0x5960('0x58')]({'where':{'id':_0x4a95e2['params']['id']}})[_0x5960('0x12')](handleEntityNotFound(_0x3118c3,null))[_0x5960('0x12')](function(_0x1ea478){if(_0x1ea478){return _0x1ea478[_0x5960('0x78')](null);}return null;})[_0x5960('0x12')](respondWithStatusCode(_0x3118c3,null))[_0x5960('0x1c')](handleError(_0x3118c3,null));};exports[_0x5960('0x79')]=function(_0x5f5c9d,_0x257cfb){return db['MailAccount']['findOne']({'where':{'id':_0x5f5c9d[_0x5960('0x53')]['id']}})['then'](handleEntityNotFound(_0x257cfb,null))[_0x5960('0x12')](function(_0xa6509f){if(_0xa6509f){return _0xa6509f[_0x5960('0x79')]();}return null;})['then'](respondWithResult(_0x257cfb,null))[_0x5960('0x1c')](handleError(_0x257cfb,null));};exports[_0x5960('0x7a')]=function(_0x4012fc,_0x2eaf0f){if(_0x4012fc[_0x5960('0x4e')]['id']){delete _0x4012fc[_0x5960('0x4e')]['id'];}return db['MailAccount'][_0x5960('0x50')]({'where':{'id':_0x4012fc[_0x5960('0x53')]['id']}})[_0x5960('0x12')](handleEntityNotFound(_0x2eaf0f,null))['then'](function(_0x24d075){if(_0x24d075){_0x4012fc[_0x5960('0x4e')]['MailAccountId']=_0x24d075['id'];return db[_0x5960('0x4a')][_0x5960('0x56')](_0x4012fc[_0x5960('0x4e')]);}})[_0x5960('0x12')](respondWithResult(_0x2eaf0f,null))['catch'](handleError(_0x2eaf0f,null));};exports[_0x5960('0x7b')]=function(_0x1dfe81,_0x44e59f){return db[_0x5960('0x45')][_0x5960('0x58')]({'where':{'id':_0x1dfe81['params']['id']}})['then'](handleEntityNotFound(_0x44e59f,null))[_0x5960('0x12')](function(_0x44620c){if(_0x44620c){return _0x44620c[_0x5960('0x7c')](null);}return null;})['then'](respondWithStatusCode(_0x44e59f,null))[_0x5960('0x1c')](handleError(_0x44e59f,null));};exports[_0x5960('0x7d')]=function(_0x331604,_0x53246e){return db[_0x5960('0x7e')]['find']({'where':{'id':_0x331604[_0x5960('0x53')]['id']}})[_0x5960('0x12')](handleEntityNotFound(_0x53246e,null))[_0x5960('0x12')](function(_0x4f3821){if(_0x4f3821){return _0x4f3821['addInteraction'](_0x331604['body'][_0x5960('0x5b')],_[_0x5960('0x7f')](_0x331604[_0x5960('0x4e')],[_0x5960('0x5b'),'id'])||{});}})[_0x5960('0x12')](respondWithResult(_0x53246e,null))[_0x5960('0x1c')](handleError(_0x53246e,null));};exports[_0x5960('0x80')]=function(_0x14a986,_0x137ef3){var _0x4f898d={'raw':![],'where':{}};var _0x35b2e5={};var _0x548573={'count':0x0,'rows':[]};return db[_0x5960('0x45')][_0x5960('0x58')]({'where':{'id':_0x14a986['params']['id']}})[_0x5960('0x12')](handleEntityNotFound(_0x137ef3,null))[_0x5960('0x12')](function(_0x1360c7){if(_0x1360c7){_0x35b2e5[_0x5960('0x35')]=_[_0x5960('0x37')](db[_0x5960('0x7e')][_0x5960('0x4c')]);_0x35b2e5[_0x5960('0x36')]=_[_0x5960('0x37')](_0x14a986[_0x5960('0x36')]);_0x35b2e5[_0x5960('0x38')]=_[_0x5960('0x39')](_0x35b2e5[_0x5960('0x35')],_0x35b2e5[_0x5960('0x36')]);_0x4f898d['attributes']=_[_0x5960('0x39')](_0x35b2e5[_0x5960('0x35')],qs['fields'](_0x14a986[_0x5960('0x36')][_0x5960('0x3a')]));_0x4f898d[_0x5960('0x3b')]=_0x4f898d[_0x5960('0x3b')]['length']?_0x4f898d[_0x5960('0x3b')]:_0x35b2e5[_0x5960('0x35')];if(!_0x14a986[_0x5960('0x36')][_0x5960('0x3d')](_0x5960('0x3e'))){_0x4f898d[_0x5960('0x22')]=qs[_0x5960('0x22')](_0x14a986[_0x5960('0x36')][_0x5960('0x22')]);_0x4f898d[_0x5960('0x20')]=qs['offset'](_0x14a986[_0x5960('0x36')][_0x5960('0x20')]);}_0x4f898d[_0x5960('0x3f')]=qs[_0x5960('0x40')](_0x14a986['query'][_0x5960('0x40')]);_0x4f898d[_0x5960('0x41')]=qs['filters'](_['pick'](_0x14a986[_0x5960('0x36')],_0x35b2e5[_0x5960('0x38')]));_0x4f898d[_0x5960('0x41')][_0x5960('0x54')]=_0x1360c7['id'];if(_0x14a986['query'][_0x5960('0x42')]){_0x4f898d['where']=_[_0x5960('0x43')](_0x4f898d[_0x5960('0x41')],{'$or':_['map'](_0x4f898d['attributes'],function(_0x4a4469){var _0x148a8e={};_0x148a8e[_0x4a4469]={'$like':'%'+_0x14a986[_0x5960('0x36')]['filter']+'%'};return _0x148a8e;})});}_0x4f898d=_['merge']({},_0x4f898d,_0x14a986['options']);return db[_0x5960('0x7e')][_0x5960('0x23')]({'where':_0x4f898d[_0x5960('0x41')]})[_0x5960('0x12')](function(_0x2390c0){_0x548573[_0x5960('0x23')]=_0x2390c0;if(_0x14a986['query']['includeAll']){_0x4f898d[_0x5960('0x4d')]=[{'model':db[_0x5960('0x81')],'as':_0x5960('0x82'),'required':![]},{'model':db[_0x5960('0x83')],'as':_0x5960('0x84'),'attributes':['name',_0x5960('0x85'),_0x5960('0x86')],'required':![]},{'model':db[_0x5960('0x87')],'as':_0x5960('0x88'),'attributes':['id',_0x5960('0x2c'),_0x5960('0x89')],'where':_0x14a986['query'][_0x5960('0x8a')]?{'id':_0x14a986[_0x5960('0x36')]['tag']}:undefined,'required':_0x14a986[_0x5960('0x36')][_0x5960('0x8a')]?!![]:![]}];}return db['MailInteraction'][_0x5960('0x47')](_0x4f898d);})['then'](function(_0x2b8ecd){_0x548573[_0x5960('0x48')]=_0x2b8ecd;return _0x548573;});}})[_0x5960('0x12')](respondWithFilteredResult(_0x137ef3,_0x4f898d))[_0x5960('0x1c')](handleError(_0x137ef3,null));};exports[_0x5960('0x8b')]=function addApplications(_0x4c32d7,_0x4d65c7){var _0xece532=_0x4c32d7[_0x5960('0x53')]['id'];var _0x36a252=_0x4c32d7[_0x5960('0x4e')];var _0x41cd29=0xc8;var _0xefaab4=null;return db['sequelize'][_0x5960('0x8c')]({'isolationLevel':db[_0x5960('0x8d')][_0x5960('0x8e')]['ISOLATION_LEVELS'][_0x5960('0x8f')]},function(_0x5451f2){return db[_0x5960('0x45')]['findOne']({'where':{'id':_0xece532},'transaction':_0x5451f2})['then'](function(_0xa2aaea){if(_0xa2aaea){return db['MailApplication'][_0x5960('0x27')]({'where':{'MailAccountId':_0xece532},'transaction':_0x5451f2})[_0x5960('0x12')](function(){var _0x5e347c=_[_0x5960('0x5f')](_0x36a252,function(_0x226e43){_0x226e43[_0x5960('0x54')]=_0xece532;return _0x226e43;});return db[_0x5960('0x90')][_0x5960('0x91')](_0x5e347c,{'transaction':_0x5451f2});});}else{_0x41cd29=0x194;_0xefaab4=[];}});})['then'](function(){if(_0x41cd29!==0x194){return db['MailApplication'][_0x5960('0x92')]({'where':{'MailAccountId':_0xece532},'order':'priority'})[_0x5960('0x12')](function(_0x27594e){_0xefaab4=_0x27594e;});}})[_0x5960('0x1c')](function(_0x59e6ef){_0x41cd29=0x1f4;logger[_0x5960('0x18')](_0x59e6ef[_0x5960('0x2b')]);if(_0x59e6ef['name']){delete _0x59e6ef['name'];}_0xefaab4=_0x59e6ef;})[_0x5960('0x93')](function(){if(_0xefaab4===null){_0x4d65c7[_0x5960('0x2a')](_0x41cd29);}else{if(_0x41cd29===0x1f4){_0x4d65c7[_0x5960('0x1d')](_0x41cd29)[_0x5960('0x2d')](_0xefaab4);}else{_0x4d65c7['status'](_0x41cd29)[_0x5960('0x1f')](_0xefaab4);}}});};exports[_0x5960('0x94')]=function(_0x3adffa,_0x29e25f){var _0x2b18a5={};var _0x190cc6={};var _0x5f0f78;var _0x266fc7;return db[_0x5960('0x45')][_0x5960('0x58')]({'where':{'id':_0x3adffa[_0x5960('0x53')]['id']}})[_0x5960('0x12')](handleEntityNotFound(_0x29e25f,null))[_0x5960('0x12')](function(_0x36e210){if(_0x36e210){_0x5f0f78=_0x36e210;_0x190cc6[_0x5960('0x35')]=_[_0x5960('0x37')](db[_0x5960('0x90')][_0x5960('0x4c')]);_0x190cc6[_0x5960('0x36')]=_['keys'](_0x3adffa['query']);_0x190cc6[_0x5960('0x38')]=_[_0x5960('0x39')](_0x190cc6[_0x5960('0x35')],_0x190cc6[_0x5960('0x36')]);_0x2b18a5['attributes']=_[_0x5960('0x39')](_0x190cc6[_0x5960('0x35')],qs[_0x5960('0x3a')](_0x3adffa[_0x5960('0x36')]['fields']));_0x2b18a5[_0x5960('0x3b')]=_0x2b18a5[_0x5960('0x3b')]['length']?_0x2b18a5[_0x5960('0x3b')]:_0x190cc6[_0x5960('0x35')];_0x2b18a5[_0x5960('0x3f')]=qs[_0x5960('0x40')](_0x3adffa[_0x5960('0x36')][_0x5960('0x40')]);_0x2b18a5['where']=qs['filters'](_[_0x5960('0x59')](_0x3adffa[_0x5960('0x36')],_0x190cc6[_0x5960('0x38')]));if(_0x3adffa[_0x5960('0x36')][_0x5960('0x42')]){_0x2b18a5[_0x5960('0x41')]=_[_0x5960('0x43')](_0x2b18a5[_0x5960('0x41')],{'$or':_[_0x5960('0x5f')](_0x2b18a5[_0x5960('0x3b')],function(_0x454cc1){var _0x3bcc76={};_0x3bcc76[_0x454cc1]={'$like':'%'+_0x3adffa[_0x5960('0x36')]['filter']+'%'};return _0x3bcc76;})});}_0x2b18a5=_[_0x5960('0x43')]({},_0x2b18a5,_0x3adffa[_0x5960('0x5a')]);return _0x5f0f78['getApplications'](_0x2b18a5);}})['then'](function(_0x29ff02){if(_0x29ff02){_0x266fc7=_0x29ff02[_0x5960('0x3c')];if(!_0x3adffa[_0x5960('0x36')][_0x5960('0x3d')](_0x5960('0x3e'))){_0x2b18a5[_0x5960('0x22')]=qs[_0x5960('0x22')](_0x3adffa[_0x5960('0x36')]['limit']);_0x2b18a5[_0x5960('0x20')]=qs[_0x5960('0x20')](_0x3adffa[_0x5960('0x36')][_0x5960('0x20')]);}return _0x5f0f78[_0x5960('0x94')](_0x2b18a5);}})[_0x5960('0x12')](function(_0xd737da){if(_0xd737da){return _0xd737da?{'count':_0x266fc7,'rows':_0xd737da}:null;}})['then'](respondWithResult(_0x29e25f,null))[_0x5960('0x1c')](handleError(_0x29e25f,null));};exports[_0x5960('0x95')]=function(_0x4c6c6e,_0x59d2f9){var _0x4d14cb={'raw':!![],'where':{}};var _0x48d237={};var _0x6d970d={'count':0x0,'rows':[]};return db[_0x5960('0x45')]['findOne']({'where':{'id':_0x4c6c6e[_0x5960('0x53')]['id']}})[_0x5960('0x12')](handleEntityNotFound(_0x59d2f9,null))[_0x5960('0x12')](function(_0x414b7a){if(_0x414b7a){_0x48d237[_0x5960('0x35')]=_['keys'](db[_0x5960('0x96')]['rawAttributes']);_0x48d237[_0x5960('0x36')]=_[_0x5960('0x37')](_0x4c6c6e[_0x5960('0x36')]);_0x48d237[_0x5960('0x38')]=_[_0x5960('0x39')](_0x48d237['model'],_0x48d237[_0x5960('0x36')]);_0x4d14cb[_0x5960('0x3b')]=_[_0x5960('0x39')](_0x48d237[_0x5960('0x35')],qs[_0x5960('0x3a')](_0x4c6c6e[_0x5960('0x36')][_0x5960('0x3a')]));_0x4d14cb[_0x5960('0x3b')]=_0x4d14cb[_0x5960('0x3b')][_0x5960('0x3c')]?_0x4d14cb[_0x5960('0x3b')]:_0x48d237[_0x5960('0x35')];if(!_0x4c6c6e[_0x5960('0x36')]['hasOwnProperty'](_0x5960('0x3e'))){_0x4d14cb[_0x5960('0x22')]=qs[_0x5960('0x22')](_0x4c6c6e[_0x5960('0x36')]['limit']);_0x4d14cb[_0x5960('0x20')]=qs[_0x5960('0x20')](_0x4c6c6e[_0x5960('0x36')][_0x5960('0x20')]);}_0x4d14cb[_0x5960('0x3f')]=qs[_0x5960('0x40')](_0x4c6c6e[_0x5960('0x36')][_0x5960('0x40')]);_0x4d14cb[_0x5960('0x41')]=qs['filters'](_['pick'](_0x4c6c6e[_0x5960('0x36')],_0x48d237['filters']));_0x4d14cb[_0x5960('0x41')][_0x5960('0x54')]=_0x414b7a['id'];if(_0x4c6c6e[_0x5960('0x36')]['filter']){_0x4d14cb[_0x5960('0x41')]=_[_0x5960('0x43')](_0x4d14cb[_0x5960('0x41')],{'$or':_[_0x5960('0x5f')](_0x4d14cb[_0x5960('0x3b')],function(_0x124fd0){var _0x3aa8ea={};_0x3aa8ea[_0x124fd0]={'$like':'%'+_0x4c6c6e['query']['filter']+'%'};return _0x3aa8ea;})});}if(_0x4c6c6e[_0x5960('0x36')][_0x5960('0x97')]){var _0x114a2c=_0x4c6c6e[_0x5960('0x36')][_0x5960('0x97')]['split'](',');var _0x1dac03={};_0x1dac03[_0x114a2c[0x0]]={'$gte':moment(_0x114a2c[0x1])['format'](_0x5960('0x98'))};_0x4d14cb[_0x5960('0x41')]=_[_0x5960('0x43')](_0x4d14cb['where'],_0x1dac03);}_0x4d14cb=_[_0x5960('0x43')]({},_0x4d14cb,_0x4c6c6e[_0x5960('0x5a')]);return db[_0x5960('0x96')][_0x5960('0x23')]({'where':_0x4d14cb['where']})[_0x5960('0x12')](function(_0x51f0bf){_0x6d970d[_0x5960('0x23')]=_0x51f0bf;if(_0x4c6c6e[_0x5960('0x36')][_0x5960('0x46')]){_0x4d14cb[_0x5960('0x4d')]=[{'all':!![]}];}return db[_0x5960('0x96')][_0x5960('0x47')](_0x4d14cb);})[_0x5960('0x12')](function(_0xdcd40f){if(_0x4c6c6e['query'][_0x5960('0x99')]===_0x5960('0x9a')){for(var _0x403378=0x0;_0x403378<_0xdcd40f['length'];_0x403378++){_0xdcd40f[_0x403378]['body']=juice(_0xdcd40f[_0x403378][_0x5960('0x4e')]);}}_0x6d970d['rows']=_0xdcd40f;return _0x6d970d;});}})[_0x5960('0x12')](respondWithFilteredResult(_0x59d2f9,_0x4d14cb))['catch'](handleError(_0x59d2f9,null));};exports['send']=function(_0x148f8a,_0x1d29b8){var _0x32eb3a,_0x52a609={},_0x22a801;if(_0x148f8a[_0x5960('0x4e')]['to']){_0x22a801=_0x148f8a[_0x5960('0x4e')]['to'][_0x5960('0x9b')](',')[0x0];}return db['MailAccount'][_0x5960('0x50')]({'where':{'id':_0x148f8a[_0x5960('0x53')]['id']},'include':[{'model':db[_0x5960('0x9c')],'as':_0x5960('0x9d'),'include':[{'model':db[_0x5960('0x81')],'as':_0x5960('0x9e'),'where':{'email':_0x22a801},'limit':0x1,'order':[[_0x5960('0x9f'),_0x5960('0xa0')]]}]},{'model':db[_0x5960('0x4a')],'as':'Smtp','raw':!![]}]})['then'](handleEntityNotFound(_0x1d29b8,null))[_0x5960('0x12')](function(_0x567f2f){if(_0x567f2f){_0x32eb3a=_0x567f2f;if(_0x567f2f[_0x5960('0x4b')]){if(_[_0x5960('0x65')](_0x148f8a[_0x5960('0x4e')][_0x5960('0xa1')])){_0x148f8a['body'][_0x5960('0xa1')]=util[_0x5960('0xa2')](_0x5960('0xa3'),_0x567f2f[_0x5960('0x2c')],_0x567f2f['email']||_0x567f2f[_0x5960('0x4b')][_0x5960('0x68')]);}if(_0x148f8a['body'][_0x5960('0xa4')]&&_0x148f8a[_0x5960('0x4e')]['attachments'][_0x5960('0x3c')]){for(var _0x13450c=0x0;_0x13450c<_0x148f8a['body'][_0x5960('0xa4')][_0x5960('0x3c')];_0x13450c+=0x1){_0x148f8a[_0x5960('0x4e')][_0x5960('0xa4')][_0x13450c]={'filename':_0x148f8a[_0x5960('0x4e')][_0x5960('0xa4')][_0x13450c]['name'],'path':path[_0x5960('0xa5')](config['root'],'server/files/attachments',_0x148f8a[_0x5960('0x4e')]['attachments'][_0x13450c]['basename'])};}}var _0x56c941={'tls':{'rejectUnauthorized':![]}};if(_[_0x5960('0x65')](_0x567f2f[_0x5960('0x4b')][_0x5960('0x6d')])){if(_0x567f2f[_0x5960('0x4b')][_0x5960('0x70')]){_0x56c941['auth']={'user':_0x567f2f[_0x5960('0x4b')]['user'],'pass':_0x567f2f[_0x5960('0x4b')]['pass']};}_0x56c941[_0x5960('0x6e')]=_0x567f2f[_0x5960('0x4b')]['host'];_0x56c941[_0x5960('0x6f')]=_0x567f2f[_0x5960('0x4b')][_0x5960('0x6f')];_0x56c941['secure']=_0x567f2f[_0x5960('0x4b')][_0x5960('0xa6')];}else{_0x56c941[_0x5960('0x6d')]=_0x567f2f['Smtp'][_0x5960('0x6d')];_0x56c941[_0x5960('0xa7')]={'user':_0x567f2f[_0x5960('0x4b')][_0x5960('0x68')],'pass':_0x567f2f[_0x5960('0x4b')][_0x5960('0x6c')]};}return respondWithRpcPromise(_0x5960('0xa8'),'sendMail',{'account':_0x56c941,'message':_0x148f8a[_0x5960('0x4e')]});}else{throw new Error('List\x20not\x20found');}}})[_0x5960('0x12')](function(_0x5b57c6){if(_0x5b57c6){_0x52a609=_0x5b57c6;if(_0x32eb3a[_0x5960('0x9d')]){if(_0x32eb3a[_0x5960('0x9d')][_0x5960('0x9e')][_0x5960('0x3c')]){return _0x32eb3a[_0x5960('0x9d')][_0x5960('0x9e')][0x0];}else{return db[_0x5960('0x81')][_0x5960('0x56')](_[_0x5960('0xb')](_0x148f8a[_0x5960('0x4e')],{'firstName':_0x148f8a[_0x5960('0x4e')]['to'],'email':_0x148f8a[_0x5960('0x4e')]['to'],'phone':_0x148f8a['body']['to'],'ListId':_0x32eb3a['ListId']}));}}else{throw new Error(_0x5960('0xa9'));}}})['then'](function(_0x369f91){if(_0x369f91){var _0x3ee24b={'UserId':_0x148f8a[_0x5960('0x68')]['id'],'ContactId':_0x369f91['id'],'MailAccountId':_0x32eb3a['id'],'inReplyTo':_0x52a609[_0x5960('0xaa')],'to':_0x148f8a['body'][_0x5960('0xa1')],'cc':_0x148f8a[_0x5960('0x4e')]['cc'],'subject':_0x148f8a[_0x5960('0x4e')][_0x5960('0xab')],'attach':_0x148f8a['body']['attach'],'firstMsgDirection':_0x5960('0xac'),'lastMsgAt':moment()[_0x5960('0xa2')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'out','Messages':[_['merge'](_0x148f8a[_0x5960('0x4e')],{'messageId':_0x52a609[_0x5960('0xaa')],'sentAt':moment()[_0x5960('0xa2')](_0x5960('0x98')),'read':!![],'MailAccountId':_0x32eb3a['id'],'UserId':_0x148f8a[_0x5960('0x68')]['id'],'ContactId':_0x369f91['id']})]};if(_0x148f8a[_0x5960('0x4e')]['Interaction']){_0x3ee24b=_['merge'](_0x3ee24b,_0x148f8a[_0x5960('0x4e')][_0x5960('0xad')]);}return db[_0x5960('0x7e')]['create'](_0x3ee24b,{'include':[{'model':db[_0x5960('0x96')],'as':'Messages'}]});}})[_0x5960('0x12')](respondWithResult(_0x1d29b8,null))[_0x5960('0x1c')](handleError(_0x1d29b8,null));};exports['verifySmtp']=function(_0xe189f1,_0x310e0c){return db[_0x5960('0x45')][_0x5960('0x50')]({'where':{'id':_0xe189f1[_0x5960('0x53')]['id']},'include':[{'model':db[_0x5960('0x4a')],'as':_0x5960('0x4b'),'raw':!![],'include':[{'model':db[_0x5960('0xae')],'as':_0x5960('0xae'),'raw':!![]}]}]})[_0x5960('0x12')](handleEntityNotFound(_0x310e0c,null))[_0x5960('0x12')](function(_0x18ae67){if(!_0x18ae67[_0x5960('0x4b')])return;var _0xbd140b={'id':_0x18ae67['id'],'tls':{'rejectUnauthorized':![]}};if(_0x18ae67[_0x5960('0x62')]!=='custom'){_0xbd140b[_0x5960('0x6d')]=_0x18ae67[_0x5960('0x62')];}else{_0xbd140b['host']=_0x18ae67['Smtp'][_0x5960('0x6e')];_0xbd140b[_0x5960('0x6f')]=_0x18ae67[_0x5960('0x4b')][_0x5960('0x6f')];_0xbd140b[_0x5960('0xa6')]=_0x18ae67['Smtp']['secure'];}if(_0x18ae67['Smtp']['authentication']){if(_0x18ae67[_0x5960('0x4b')][_0x5960('0x6b')]){_0xbd140b['auth']={'type':_0x5960('0xaf'),'user':_0x18ae67[_0x5960('0x4b')][_0x5960('0x68')],'accessToken':_0x18ae67[_0x5960('0x4b')][_0x5960('0xae')][_0x5960('0xb0')]};}else{_0xbd140b[_0x5960('0xa7')]={'user':_0x18ae67[_0x5960('0x4b')][_0x5960('0x68')],'pass':_0x18ae67[_0x5960('0x4b')]['pass']};}}return respondWithRpcPromise(_0x5960('0xb1'),_0x5960('0xb2'),{'account':_0xbd140b});})[_0x5960('0x12')](respondWithResult(_0x310e0c,null))[_0x5960('0x1c')](handleError(_0x310e0c,null));};exports[_0x5960('0x27')]=function(_0x8283aa,_0x3a6fb4){return db[_0x5960('0x45')][_0x5960('0x50')]({'where':{'id':_0x8283aa['params']['id']}})['then'](handleEntityNotFound(_0x3a6fb4,null))[_0x5960('0x12')](function(_0x471540){if(_0x471540&&_0x471540[_0x5960('0x6d')]){throw new db[(_0x5960('0xb3'))][(_0x5960('0xb4'))](_0x5960('0xb5'));}return _0x471540;})[_0x5960('0x12')](removeEntity(_0x3a6fb4,null))[_0x5960('0x1c')](handleError(_0x3a6fb4,null));};exports[_0x5960('0xb6')]=function(_0xb36bd6,_0x11a7fa){return db['MailAccount'][_0x5960('0x50')]({'where':{'id':_0xb36bd6[_0x5960('0x53')]['id']}})[_0x5960('0x12')](handleEntityNotFound(_0x11a7fa,null))['then'](function(_0x4e066d){if(_0x4e066d){return _0x4e066d[_0x5960('0xb6')](_0xb36bd6[_0x5960('0x4e')][_0x5960('0x5b')],_['omit'](_0xb36bd6[_0x5960('0x4e')],[_0x5960('0x5b'),'id'])||{})[_0x5960('0xb7')](function(_0x181447){for(var _0x3c2767=0x0;_0x3c2767<_0xb36bd6[_0x5960('0x4e')]['ids']['length'];_0x3c2767+=0x1){socket[_0x5960('0xb8')](_0x5960('0xb9'),{'UserId':Number(_0xb36bd6[_0x5960('0x4e')][_0x5960('0x5b')][_0x3c2767]),'MailAccountId':Number(_0xb36bd6[_0x5960('0x53')]['id'])});}return _0x181447;});}})[_0x5960('0x12')](respondWithResult(_0x11a7fa,null))['catch'](handleError(_0x11a7fa,null));};exports[_0x5960('0xba')]=function(_0x26a1d3,_0x1141e6){return db[_0x5960('0x45')]['find']({'where':{'id':_0x26a1d3['params']['id']}})[_0x5960('0x12')](handleEntityNotFound(_0x1141e6,null))[_0x5960('0x12')](function(_0x448179){if(_0x448179){return _0x448179[_0x5960('0xba')](_0x26a1d3['query'][_0x5960('0x5b')])[_0x5960('0x12')](function(){if(_[_0x5960('0xbb')](_0x26a1d3['query'][_0x5960('0x5b')])){for(var _0x3f344=0x0;_0x3f344<_0x26a1d3[_0x5960('0x36')][_0x5960('0x5b')][_0x5960('0x3c')];_0x3f344+=0x1){socket['emit'](_0x5960('0xbc'),{'UserId':Number(_0x26a1d3['query'][_0x5960('0x5b')][_0x3f344]),'MailAccountId':Number(_0x26a1d3[_0x5960('0x53')]['id'])});}}else{socket[_0x5960('0xb8')](_0x5960('0xbc'),{'UserId':Number(_0x26a1d3[_0x5960('0x36')]['ids']),'MailAccountId':Number(_0x26a1d3[_0x5960('0x53')]['id'])});}});}})[_0x5960('0x12')](respondWithStatusCode(_0x1141e6,null))[_0x5960('0x1c')](handleError(_0x1141e6,null));};exports[_0x5960('0xbd')]=function(_0x45121d,_0x531a8e){var _0x164059={};var _0x1a7aa5={};var _0x32991d;var _0x292ef6;return db['MailAccount'][_0x5960('0x58')]({'where':{'id':_0x45121d['params']['id']}})[_0x5960('0x12')](handleEntityNotFound(_0x531a8e,null))[_0x5960('0x12')](function(_0x3d5104){if(_0x3d5104){_0x32991d=_0x3d5104;_0x1a7aa5['model']=_[_0x5960('0x37')](db[_0x5960('0x83')][_0x5960('0x4c')]);_0x1a7aa5[_0x5960('0x36')]=_[_0x5960('0x37')](_0x45121d[_0x5960('0x36')]);_0x1a7aa5['filters']=_[_0x5960('0x39')](_0x1a7aa5[_0x5960('0x35')],_0x1a7aa5[_0x5960('0x36')]);_0x164059[_0x5960('0x3b')]=_[_0x5960('0x39')](_0x1a7aa5[_0x5960('0x35')],qs[_0x5960('0x3a')](_0x45121d[_0x5960('0x36')]['fields']));_0x164059[_0x5960('0x3b')]=_0x164059[_0x5960('0x3b')][_0x5960('0x3c')]?_0x164059[_0x5960('0x3b')]:_0x1a7aa5['model'];_0x164059[_0x5960('0x3f')]=qs[_0x5960('0x40')](_0x45121d[_0x5960('0x36')][_0x5960('0x40')]);_0x164059['where']=qs[_0x5960('0x38')](_[_0x5960('0x59')](_0x45121d['query'],_0x1a7aa5[_0x5960('0x38')]));if(_0x45121d['query'][_0x5960('0x42')]){_0x164059[_0x5960('0x41')]=_['merge'](_0x164059[_0x5960('0x41')],{'$or':_[_0x5960('0x5f')](_0x164059[_0x5960('0x3b')],function(_0x533191){var _0x12b70a={};_0x12b70a[_0x533191]={'$like':'%'+_0x45121d[_0x5960('0x36')][_0x5960('0x42')]+'%'};return _0x12b70a;})});}_0x164059=_[_0x5960('0x43')]({},_0x164059,_0x45121d[_0x5960('0x5a')]);return _0x32991d[_0x5960('0xbd')](_0x164059);}})[_0x5960('0x12')](function(_0x4a2d81){if(_0x4a2d81){_0x292ef6=_0x4a2d81[_0x5960('0x3c')];if(!_0x45121d[_0x5960('0x36')][_0x5960('0x3d')](_0x5960('0x3e'))){_0x164059[_0x5960('0x22')]=qs[_0x5960('0x22')](_0x45121d[_0x5960('0x36')][_0x5960('0x22')]);_0x164059[_0x5960('0x20')]=qs[_0x5960('0x20')](_0x45121d[_0x5960('0x36')][_0x5960('0x20')]);}return _0x32991d['getAgents'](_0x164059);}})['then'](function(_0x54fdc4){if(_0x54fdc4){return _0x54fdc4?{'count':_0x292ef6,'rows':_0x54fdc4}:null;}})[_0x5960('0x12')](respondWithResult(_0x531a8e,null))[_0x5960('0x1c')](handleError(_0x531a8e,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 28808f9..e245bff 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 _0x22a7=['MailAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x563bfd,_0x5bc00b){var _0x27972f=function(_0x2814c9){while(--_0x2814c9){_0x563bfd['push'](_0x563bfd['shift']());}};_0x27972f(++_0x5bc00b);}(_0x22a7,0xe4));var _0x722a=function(_0x3c182f,_0x11141e){_0x3c182f=_0x3c182f-0x0;var _0x2c2e17=_0x22a7[_0x3c182f];return _0x2c2e17;};'use strict';var EventEmitter=require(_0x722a('0x0'));var MailAccount=require(_0x722a('0x1'))['db'][_0x722a('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x722a('0x3')](0x0);var events={'afterCreate':_0x722a('0x4'),'afterUpdate':_0x722a('0x5'),'afterDestroy':_0x722a('0x6')};function emitEvent(_0x43a0f5){return function(_0x464d07,_0x462040,_0x2b51f3){MailAccountEvents['emit'](_0x43a0f5+':'+_0x464d07['id'],_0x464d07);MailAccountEvents[_0x722a('0x7')](_0x43a0f5,_0x464d07);_0x2b51f3(null);};}for(var e in events){if(events[_0x722a('0x8')](e)){var event=events[e];MailAccount[_0x722a('0x9')](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file +var _0x8a25=['hasOwnProperty','hook','exports','events','../../mysqldb','MailAccount','setMaxListeners','save','update','emit'];(function(_0x376ffd,_0x248e99){var _0x52e460=function(_0x14e9ed){while(--_0x14e9ed){_0x376ffd['push'](_0x376ffd['shift']());}};_0x52e460(++_0x248e99);}(_0x8a25,0xb7));var _0x58a2=function(_0xb86801,_0x14f8fd){_0xb86801=_0xb86801-0x0;var _0x47a769=_0x8a25[_0xb86801];return _0x47a769;};'use strict';var EventEmitter=require(_0x58a2('0x0'));var MailAccount=require(_0x58a2('0x1'))['db'][_0x58a2('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x58a2('0x3')](0x0);var events={'afterCreate':_0x58a2('0x4'),'afterUpdate':_0x58a2('0x5'),'afterDestroy':'remove'};function emitEvent(_0x130516){return function(_0x5abbe9,_0x49d684,_0x403b8e){MailAccountEvents[_0x58a2('0x6')](_0x130516+':'+_0x5abbe9['id'],_0x5abbe9);MailAccountEvents[_0x58a2('0x6')](_0x130516,_0x5abbe9);_0x403b8e(null);};}for(var e in events){if(events[_0x58a2('0x7')](e)){var event=events[e];MailAccount[_0x58a2('0x8')](e,emitEvent(event));}}module[_0x58a2('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 d8abe30..1a15fd9 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 _0x8945=['exports','define','MailAccount','mail_accounts','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./mailAccount.attributes'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x8945,0xa0));var _0x5894=function(_0x102b8f,_0x156488){_0x102b8f=_0x102b8f-0x0;var _0x24d5ec=_0x8945[_0x102b8f];return _0x24d5ec;};'use strict';var _=require(_0x5894('0x0'));var util=require(_0x5894('0x1'));var logger=require(_0x5894('0x2'))(_0x5894('0x3'));var moment=require(_0x5894('0x4'));var BPromise=require('bluebird');var rp=require(_0x5894('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5894('0x6'));var config=require(_0x5894('0x7'));var attributes=require(_0x5894('0x8'));module[_0x5894('0x9')]=function(_0x22f2ca,_0x149d33){return _0x22f2ca[_0x5894('0xa')](_0x5894('0xb'),attributes,{'tableName':_0x5894('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9daa=['rimraf','../../config/environment','exports','define','MailAccount','mail_accounts','util','../../config/logger','bluebird','request-promise','path'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x9daa,0x1df));var _0xa9da=function(_0x3e52d1,_0x26d1e2){_0x3e52d1=_0x3e52d1-0x0;var _0x46c65b=_0x9daa[_0x3e52d1];return _0x46c65b;};'use strict';var _=require('lodash');var util=require(_0xa9da('0x0'));var logger=require(_0xa9da('0x1'))('api');var moment=require('moment');var BPromise=require(_0xa9da('0x2'));var rp=require(_0xa9da('0x3'));var fs=require('fs');var path=require(_0xa9da('0x4'));var rimraf=require(_0xa9da('0x5'));var config=require(_0xa9da('0x6'));var attributes=require('./mailAccount.attributes');module[_0xa9da('0x7')]=function(_0x4374d9,_0x1b3e44){return _0x4374d9[_0xa9da('0x8')](_0xa9da('0x9'),attributes,{'tableName':_0xa9da('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 358a556..6c59c7c 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 _0x9473=['MailServerOut','Smtp','get','applications','priority','asc','autoclose','push','length','create','messageId','generate','subject','attach','format','MailInteraction','MailMessage','Messages','Contact\x20not\x20found','YYYY-MM-DD\x20HH:mm:ss','created','originTo','originCc','originChannel','Email','ChatOfflineMessageId','Attachments','interaction','UserId','unshift','agent','name','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./mailAccount.socket','request','then','info','MailAccount,\x20%s,\x20%s','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','MailAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetMailAccount','find','ShowMailAccount','debug','NotifyMailAccount','mail','difference','keys','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','ListId','body','from','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','Contacts','DESC','MailApplication','Applications'];(function(_0x4f01a9,_0x4a0d3a){var _0x5f5ade=function(_0xbd7ca6){while(--_0xbd7ca6){_0x4f01a9['push'](_0x4f01a9['shift']());}};_0x5f5ade(++_0x4a0d3a);}(_0x9473,0x14f));var _0x3947=function(_0xefb3a2,_0x3b3be2){_0xefb3a2=_0xefb3a2-0x0;var _0x15d903=_0x9473[_0xefb3a2];return _0x15d903;};'use strict';var _=require(_0x3947('0x0'));var util=require(_0x3947('0x1'));var moment=require(_0x3947('0x2'));var BPromise=require(_0x3947('0x3'));var rs=require(_0x3947('0x4'));var fs=require('fs');var Redis=require(_0x3947('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x3947('0x6'));var logger=require('../../config/logger')(_0x3947('0x7'));var config=require(_0x3947('0x8'));var jayson=require(_0x3947('0x9'));var client=jayson[_0x3947('0xa')][_0x3947('0xb')]({'port':0x232c});config[_0x3947('0xc')]=_[_0x3947('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3947('0xe'))(new Redis(config[_0x3947('0xc')]));require(_0x3947('0xf'))['register'](socket);function respondWithRpcPromise(_0x416032,_0x1bd8e5,_0x3bf4c4){return new BPromise(function(_0x42c5d9,_0x197fec){return client[_0x3947('0x10')](_0x416032,_0x3bf4c4)[_0x3947('0x11')](function(_0x2d5ca7){logger[_0x3947('0x12')](_0x3947('0x13'),_0x1bd8e5,'request\x20sent');logger['debug'](_0x3947('0x14'),_0x1bd8e5,_0x3947('0x15'),JSON[_0x3947('0x16')](_0x2d5ca7));if(_0x2d5ca7[_0x3947('0x17')]){if(_0x2d5ca7['error']['code']===0x1f4){logger['error'](_0x3947('0x13'),_0x1bd8e5,_0x2d5ca7[_0x3947('0x17')][_0x3947('0x18')]);return _0x197fec(_0x2d5ca7[_0x3947('0x17')][_0x3947('0x18')]);}logger[_0x3947('0x17')](_0x3947('0x13'),_0x1bd8e5,_0x2d5ca7['error']['message']);return _0x42c5d9(_0x2d5ca7[_0x3947('0x17')]['message']);}else{logger['info'](_0x3947('0x13'),_0x1bd8e5,_0x3947('0x15'));_0x42c5d9(_0x2d5ca7[_0x3947('0x19')][_0x3947('0x18')]);}})[_0x3947('0x1a')](function(_0x500a81){logger['error'](_0x3947('0x13'),_0x1bd8e5,_0x500a81);_0x197fec(_0x500a81);});});}exports['GetMailAccount']=function(_0x4b07a9){var _0x2beb65=this;return new Promise(function(_0x198de9,_0x5cc379){return db[_0x3947('0x1b')][_0x3947('0x1c')]({'raw':_0x4b07a9[_0x3947('0x1d')]?_0x4b07a9[_0x3947('0x1d')][_0x3947('0x1e')]===undefined?!![]:![]:!![],'where':_0x4b07a9[_0x3947('0x1d')]?_0x4b07a9[_0x3947('0x1d')][_0x3947('0x1f')]||null:null,'attributes':_0x4b07a9[_0x3947('0x1d')]?_0x4b07a9[_0x3947('0x1d')][_0x3947('0x20')]||null:null,'limit':_0x4b07a9[_0x3947('0x1d')]?_0x4b07a9[_0x3947('0x1d')][_0x3947('0x21')]||null:null,'include':_0x4b07a9[_0x3947('0x1d')]?_0x4b07a9[_0x3947('0x1d')][_0x3947('0x22')]?_[_0x3947('0x23')](_0x4b07a9[_0x3947('0x1d')][_0x3947('0x22')],function(_0x4f2d68){return{'model':db[_0x4f2d68[_0x3947('0x24')]],'as':_0x4f2d68['as'],'attributes':_0x4f2d68[_0x3947('0x20')],'include':_0x4f2d68[_0x3947('0x22')]?_['map'](_0x4f2d68['include'],function(_0x317b44){return{'model':db[_0x317b44[_0x3947('0x24')]],'as':_0x317b44['as'],'attributes':_0x317b44[_0x3947('0x20')],'include':_0x317b44[_0x3947('0x22')]?_['map'](_0x317b44[_0x3947('0x22')],function(_0x4e8cfd){return{'model':db[_0x4e8cfd[_0x3947('0x24')]],'as':_0x4e8cfd['as'],'attributes':_0x4e8cfd['attributes']};}):[]};}):[]};}):[]:[]})[_0x3947('0x11')](function(_0xf9fbdf){logger[_0x3947('0x12')](_0x3947('0x25'),_0x4b07a9);logger['debug']('GetMailAccount',_0x4b07a9,JSON[_0x3947('0x16')](_0xf9fbdf));_0x198de9(_0xf9fbdf);})['catch'](function(_0x2554c9){logger[_0x3947('0x17')]('GetMailAccount',_0x2554c9['message'],_0x4b07a9);_0x5cc379(_0x2beb65[_0x3947('0x17')](0x1f4,_0x2554c9[_0x3947('0x18')]));});});};exports['ShowMailAccount']=function(_0x14c6d8){var _0x345798=this;return new Promise(function(_0x1bc8bb,_0x391c7d){return db['MailAccount'][_0x3947('0x26')]({'raw':_0x14c6d8[_0x3947('0x1d')]?_0x14c6d8['options'][_0x3947('0x1e')]===undefined?!![]:![]:!![],'where':_0x14c6d8['options']?_0x14c6d8[_0x3947('0x1d')][_0x3947('0x1f')]||null:null,'attributes':_0x14c6d8[_0x3947('0x1d')]?_0x14c6d8[_0x3947('0x1d')]['attributes']||null:null,'include':_0x14c6d8[_0x3947('0x1d')]?_0x14c6d8['options'][_0x3947('0x22')]?_[_0x3947('0x23')](_0x14c6d8[_0x3947('0x1d')][_0x3947('0x22')],function(_0x5bd74d){return{'model':db[_0x5bd74d[_0x3947('0x24')]],'as':_0x5bd74d['as'],'attributes':_0x5bd74d[_0x3947('0x20')],'include':_0x5bd74d[_0x3947('0x22')]?_['map'](_0x5bd74d['include'],function(_0x1a7c08){return{'model':db[_0x1a7c08[_0x3947('0x24')]],'as':_0x1a7c08['as'],'attributes':_0x1a7c08[_0x3947('0x20')],'include':_0x1a7c08[_0x3947('0x22')]?_[_0x3947('0x23')](_0x1a7c08[_0x3947('0x22')],function(_0x525492){return{'model':db[_0x525492[_0x3947('0x24')]],'as':_0x525492['as'],'attributes':_0x525492[_0x3947('0x20')]};}):[]};}):[]};}):[]:[]})[_0x3947('0x11')](function(_0x230da4){logger[_0x3947('0x12')](_0x3947('0x27'),_0x14c6d8);logger[_0x3947('0x28')]('ShowMailAccount',_0x14c6d8,JSON[_0x3947('0x16')](_0x230da4));_0x1bc8bb(_0x230da4);})['catch'](function(_0x192ca4){logger[_0x3947('0x17')](_0x3947('0x27'),_0x192ca4[_0x3947('0x18')],_0x14c6d8);_0x391c7d(_0x345798[_0x3947('0x17')](0x1f4,_0x192ca4[_0x3947('0x18')]));});});};exports[_0x3947('0x29')]=function(_0x1fc4a9){var _0x3c2c4d=this;return new Promise(function(_0x5397d1,_0x1ec29b){var _0x3bfb6c={'body':_0x1fc4a9['body'],'channel':_0x3947('0x2a')};var _0x23627f=_[_0x3947('0x2b')](_[_0x3947('0x2c')](db[_0x3947('0x2d')][_0x3947('0x2e')]),[_0x3947('0x2f'),_0x3947('0x30'),_0x3947('0x31'),_0x3947('0x32')]);var _0x390506=![];if(_0x1fc4a9[_0x3947('0x33')]['id']){delete _0x1fc4a9[_0x3947('0x33')]['id'];}if(_['isNil'](_0x1fc4a9['body'][_0x3947('0x34')])){return _0x1ec29b(_0x3c2c4d['error'](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x3947('0x35')](_0x1fc4a9[_0x3947('0x33')]['body'])||_0x1fc4a9[_0x3947('0x33')]['body']===''){return _0x1ec29b(_0x3c2c4d['error'](0x1f4,_0x3947('0x36')));}if(_[_0x3947('0x35')](_0x1fc4a9[_0x3947('0x33')][_0x3947('0x37')])){return _0x1ec29b(_0x3c2c4d[_0x3947('0x17')](0x1f4,_0x3947('0x38')+_0x23627f));}if(!_['includes'](_0x23627f,_0x1fc4a9[_0x3947('0x33')][_0x3947('0x37')])){return _0x1ec29b(_0x3c2c4d['error'](0x1f4,_0x3947('0x39')+_0x23627f));}var _0x1507d9={};_0x1507d9[_0x1fc4a9['body'][_0x3947('0x37')]]=_0x1fc4a9[_0x3947('0x33')][_0x3947('0x34')];return db[_0x3947('0x1b')][_0x3947('0x26')]({'where':{'id':_0x1fc4a9[_0x3947('0x3a')]['id']},'include':[{'model':db[_0x3947('0x3b')],'as':_0x3947('0x3c'),'include':[{'model':db[_0x3947('0x2d')],'as':_0x3947('0x3d'),'where':_0x1507d9,'limit':0x1,'order':[[_0x3947('0x30'),_0x3947('0x3e')]]}]},{'model':db[_0x3947('0x3f')],'as':_0x3947('0x40')},{'model':db[_0x3947('0x41')],'as':_0x3947('0x42')}]})[_0x3947('0x11')](function(_0xa4c485){if(_0xa4c485&&_0xa4c485[_0x3947('0x3c')]){var _0x186411=_0xa4c485[_0x3947('0x43')]({'plain':!![]});_0x3bfb6c[_0x3947('0x3a')]=_['omit'](_0x186411,[_0x3947('0x40'),'List']);_0x3bfb6c[_0x3947('0x44')]=_0x186411[_0x3947('0x40')];_0x3bfb6c['list']=_0x186411[_0x3947('0x3c')];_0x3bfb6c[_0x3947('0x44')]=_['orderBy'](_0x3bfb6c[_0x3947('0x44')],[_0x3947('0x45')],[_0x3947('0x46')]);if(_0x3bfb6c[_0x3947('0x3a')]&&_0x3bfb6c[_0x3947('0x3a')][_0x3947('0x47')]){_0x3bfb6c['applications'][_0x3947('0x48')]({'id':0x0,'priority':_0x3bfb6c['applications'][_0x3947('0x49')]+0x1,'app':'close','appdata':_0x3947('0x47'),'interval':'*,*,*,*'});}if(_0x3bfb6c[_0x3947('0x3a')][_0x3947('0x40')]){delete _0x3bfb6c[_0x3947('0x3a')][_0x3947('0x40')];}if(_0x3bfb6c[_0x3947('0x3a')][_0x3947('0x3c')]){delete _0x3bfb6c[_0x3947('0x3a')]['List'];}if(_0x186411[_0x3947('0x3c')][_0x3947('0x3d')][_0x3947('0x49')]){return _0x186411[_0x3947('0x3c')][_0x3947('0x3d')][0x0];}var _0x1feb78=_[_0x3947('0xd')](_0x1fc4a9[_0x3947('0x33')],{'firstName':_0x1fc4a9[_0x3947('0x33')][_0x3947('0x34')],'ListId':_0x186411['ListId']});_0x1feb78[_0x1fc4a9[_0x3947('0x33')][_0x3947('0x37')]]=_0x1fc4a9[_0x3947('0x33')][_0x3947('0x34')];return db[_0x3947('0x2d')][_0x3947('0x4a')](_0x1feb78);}else{throw new Error('List\x20not\x20found');}})['then'](function(_0x5798a3){_0x3bfb6c['contact']=_0x5798a3;if(_0x5798a3){if(!_0x1fc4a9[_0x3947('0x33')][_0x3947('0x18')][_0x3947('0x4b')]){_0x1fc4a9['body']['message']['messageId']=rs[_0x3947('0x4c')]()+'\x20'+_0x1fc4a9[_0x3947('0x33')][_0x3947('0x18')][_0x3947('0x34')];}var _0x3982e4={'ContactId':_0x5798a3['id'],'MailAccountId':_0x1fc4a9['account']['id'],'inReplyTo':_0x1fc4a9[_0x3947('0x33')]['message']['messageId'],'to':_0x1fc4a9[_0x3947('0x33')][_0x3947('0x18')][_0x3947('0x34')],'cc':_0x1fc4a9[_0x3947('0x33')][_0x3947('0x18')]['cc'],'subject':_0x1fc4a9['body'][_0x3947('0x18')][_0x3947('0x4d')],'attach':_0x1fc4a9[_0x3947('0x33')][_0x3947('0x18')][_0x3947('0x4e')],'lastMsgAt':moment()[_0x3947('0x4f')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0x3947('0x50')][_0x3947('0x26')]({'where':{'closed':![],'MailAccountId':_0x1fc4a9['account']['id']},'include':[{'model':db[_0x3947('0x51')],'as':_0x3947('0x52'),'attributes':['messageId'],'where':{'messageId':_0x1fc4a9[_0x3947('0x33')][_0x3947('0x18')]['inReplyTo']}}]})[_0x3947('0x11')](function(_0x30d3b4){if(_0x30d3b4){return[_0x30d3b4,![]];}return db[_0x3947('0x50')][_0x3947('0x4a')](_0x3982e4)['then'](function(_0xaae84b){return[_0xaae84b,!![]];});});}else{throw new Error(_0x3947('0x53'));}})['spread'](function(_0x16aba3,_0xa3ae10){if(_0x16aba3){_0x390506=_0xa3ae10;if(!_0xa3ae10){return _0x16aba3['update']({'inReplyTo':_0x1fc4a9[_0x3947('0x33')][_0x3947('0x18')][_0x3947('0x4b')],'to':_0x1fc4a9[_0x3947('0x33')]['message'][_0x3947('0x34')],'cc':_0x1fc4a9['body'][_0x3947('0x18')]['cc'],'subject':_0x1fc4a9[_0x3947('0x33')][_0x3947('0x18')][_0x3947('0x4d')],'attach':_0x16aba3[_0x3947('0x4e')]?_0x16aba3[_0x3947('0x4e')]:_0x1fc4a9[_0x3947('0x33')]['message'][_0x3947('0x4e')],'substatus':null,'substatusAt':moment()[_0x3947('0x4f')](_0x3947('0x54')),'lastMsgAt':moment()[_0x3947('0x4f')](_0x3947('0x54')),'lastMsgDirection':'in'});}else{return _0x16aba3;}}})[_0x3947('0x11')](function(_0x55146a){_0x3bfb6c['interaction']=_0x55146a[_0x3947('0x43')]({'plain':!![]});_0x3bfb6c['interaction'][_0x3947('0x55')]=_0x390506;return db['MailMessage'][_0x3947('0x4a')]({'body':_0x1fc4a9[_0x3947('0x33')][_0x3947('0x33')],'MailAccountId':_0x1fc4a9[_0x3947('0x3a')]['id'],'MailInteractionId':_0x55146a['id'],'direction':'in','ContactId':_0x3bfb6c['contact']['id'],'messageId':_0x1fc4a9[_0x3947('0x33')]['message'][_0x3947('0x4b')],'from':_0x1fc4a9[_0x3947('0x33')][_0x3947('0x18')][_0x3947('0x34')],'to':_0x1fc4a9[_0x3947('0x33')][_0x3947('0x18')]['to'],'cc':_0x1fc4a9[_0x3947('0x33')][_0x3947('0x18')]['cc'],'subject':_0x1fc4a9['body']['message'][_0x3947('0x4d')],'attach':_0x1fc4a9[_0x3947('0x33')][_0x3947('0x18')][_0x3947('0x4e')],'Attachments':_0x1fc4a9[_0x3947('0x33')]['message']['attachments'],'originTo':_0x1fc4a9[_0x3947('0x33')][_0x3947('0x18')][_0x3947('0x56')],'originCc':_0x1fc4a9[_0x3947('0x33')]['message'][_0x3947('0x57')],'bcc':_0x1fc4a9[_0x3947('0x33')][_0x3947('0x18')]['bcc'],'ChatWebsiteId':_0x1fc4a9[_0x3947('0x33')][_0x3947('0x18')]['ChatWebsiteId']||null,'originChannel':_0x1fc4a9[_0x3947('0x33')][_0x3947('0x18')][_0x3947('0x58')]||_0x3947('0x59'),'ChatOfflineMessageId':_0x1fc4a9[_0x3947('0x33')][_0x3947('0x18')][_0x3947('0x5a')]||null},{'include':[{'model':db['Attachment'],'as':_0x3947('0x5b')}]});})[_0x3947('0x11')](function(_0x344d8c){_0x3bfb6c['message']=_0x344d8c;if(_0x3bfb6c[_0x3947('0x5c')][_0x3947('0x5d')]){return db['User'][_0x3947('0x26')]({'attributes':['id','name'],'where':{'id':_0x3bfb6c[_0x3947('0x5c')][_0x3947('0x5d')]}})[_0x3947('0x11')](function(_0x3a18bb){if(_0x3a18bb){_0x3bfb6c['applications'][_0x3947('0x5e')]({'id':0x0,'priority':0x0,'app':_0x3947('0x5f'),'appdata':_0x3a18bb[_0x3947('0x60')]+','+(_0x3bfb6c['account'][_0x3947('0x61')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x3947('0x62'),_0x3947('0x63'),_0x3bfb6c);});}return respondWithRpcPromise(_0x3947('0x62'),'startRouting',_0x3bfb6c);})[_0x3947('0x11')](function(_0x4e1556){_0x5397d1(_0x4e1556);})[_0x3947('0x1a')](function(_0x2336ae){_0x1ec29b(_0x3c2c4d[_0x3947('0x17')](0x1f4,_0x2336ae['message']));});});}; \ No newline at end of file +var _0xb95a=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./mailAccount.socket','register','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowMailAccount','NotifyMailAccount','mail','difference','rawAttributes','updatedAt','CompanyId','ListId','body','from','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','find','account','CmList','List','CmContact','Contacts','DESC','MailApplication','Applications','MailServerOut','omit','applications','list','orderBy','priority','autoclose','push','length','close','*,*,*,*','create','List\x20not\x20found','contact','messageId','generate','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','inReplyTo','then','Contact\x20not\x20found','spread','subject','attach','interaction','get','created','originCc','bcc','ChatWebsiteId','Email','Attachment','Attachments','UserId','User','unshift','name','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x363968,_0x122f44){var _0x5ab2c9=function(_0x4e6aa2){while(--_0x4e6aa2){_0x363968['push'](_0x363968['shift']());}};_0x5ab2c9(++_0x122f44);}(_0xb95a,0x19a));var _0xab95=function(_0x3822a8,_0x547771){_0x3822a8=_0x3822a8-0x0;var _0xa6dff5=_0xb95a[_0x3822a8];return _0xa6dff5;};'use strict';var _=require(_0xab95('0x0'));var util=require(_0xab95('0x1'));var moment=require(_0xab95('0x2'));var BPromise=require(_0xab95('0x3'));var rs=require(_0xab95('0x4'));var fs=require('fs');var Redis=require(_0xab95('0x5'));var db=require(_0xab95('0x6'))['db'];var utils=require(_0xab95('0x7'));var logger=require('../../config/logger')(_0xab95('0x8'));var config=require(_0xab95('0x9'));var jayson=require(_0xab95('0xa'));var client=jayson[_0xab95('0xb')]['http']({'port':0x232c});config[_0xab95('0xc')]=_[_0xab95('0xd')](config[_0xab95('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xab95('0xe'))(new Redis(config[_0xab95('0xc')]));require(_0xab95('0xf'))[_0xab95('0x10')](socket);function respondWithRpcPromise(_0x3aa8de,_0x307e99,_0x57479d){return new BPromise(function(_0x2646ed,_0x38b259){return client['request'](_0x3aa8de,_0x57479d)['then'](function(_0x14a744){logger[_0xab95('0x11')](_0xab95('0x12'),_0x307e99,_0xab95('0x13'));logger[_0xab95('0x14')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x307e99,'request\x20sent',JSON[_0xab95('0x15')](_0x14a744));if(_0x14a744[_0xab95('0x16')]){if(_0x14a744['error'][_0xab95('0x17')]===0x1f4){logger[_0xab95('0x16')](_0xab95('0x12'),_0x307e99,_0x14a744[_0xab95('0x16')][_0xab95('0x18')]);return _0x38b259(_0x14a744[_0xab95('0x16')][_0xab95('0x18')]);}logger[_0xab95('0x16')](_0xab95('0x12'),_0x307e99,_0x14a744[_0xab95('0x16')]['message']);return _0x2646ed(_0x14a744[_0xab95('0x16')]['message']);}else{logger[_0xab95('0x11')](_0xab95('0x12'),_0x307e99,_0xab95('0x13'));_0x2646ed(_0x14a744[_0xab95('0x19')][_0xab95('0x18')]);}})[_0xab95('0x1a')](function(_0x5a19d5){logger['error']('MailAccount,\x20%s,\x20%s',_0x307e99,_0x5a19d5);_0x38b259(_0x5a19d5);});});}exports[_0xab95('0x1b')]=function(_0xd116f6){var _0x1ac2a8=this;return new Promise(function(_0x4c1770,_0x13277f){return db[_0xab95('0x1c')][_0xab95('0x1d')]({'raw':_0xd116f6[_0xab95('0x1e')]?_0xd116f6['options'][_0xab95('0x1f')]===undefined?!![]:![]:!![],'where':_0xd116f6[_0xab95('0x1e')]?_0xd116f6[_0xab95('0x1e')][_0xab95('0x20')]||null:null,'attributes':_0xd116f6[_0xab95('0x1e')]?_0xd116f6['options'][_0xab95('0x21')]||null:null,'limit':_0xd116f6[_0xab95('0x1e')]?_0xd116f6[_0xab95('0x1e')][_0xab95('0x22')]||null:null,'include':_0xd116f6['options']?_0xd116f6[_0xab95('0x1e')][_0xab95('0x23')]?_[_0xab95('0x24')](_0xd116f6[_0xab95('0x1e')][_0xab95('0x23')],function(_0x53a775){return{'model':db[_0x53a775[_0xab95('0x25')]],'as':_0x53a775['as'],'attributes':_0x53a775[_0xab95('0x21')],'include':_0x53a775[_0xab95('0x23')]?_[_0xab95('0x24')](_0x53a775[_0xab95('0x23')],function(_0x52cae5){return{'model':db[_0x52cae5[_0xab95('0x25')]],'as':_0x52cae5['as'],'attributes':_0x52cae5['attributes'],'include':_0x52cae5[_0xab95('0x23')]?_['map'](_0x52cae5['include'],function(_0x3b1b5b){return{'model':db[_0x3b1b5b[_0xab95('0x25')]],'as':_0x3b1b5b['as'],'attributes':_0x3b1b5b[_0xab95('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1d00bf){logger['info'](_0xab95('0x1b'),_0xd116f6);logger['debug']('GetMailAccount',_0xd116f6,JSON[_0xab95('0x15')](_0x1d00bf));_0x4c1770(_0x1d00bf);})[_0xab95('0x1a')](function(_0x1eda3c){logger['error'](_0xab95('0x1b'),_0x1eda3c[_0xab95('0x18')],_0xd116f6);_0x13277f(_0x1ac2a8[_0xab95('0x16')](0x1f4,_0x1eda3c['message']));});});};exports['ShowMailAccount']=function(_0x191ac0){var _0x205fe2=this;return new Promise(function(_0x1ef82d,_0x21316f){return db[_0xab95('0x1c')]['find']({'raw':_0x191ac0[_0xab95('0x1e')]?_0x191ac0[_0xab95('0x1e')][_0xab95('0x1f')]===undefined?!![]:![]:!![],'where':_0x191ac0[_0xab95('0x1e')]?_0x191ac0['options'][_0xab95('0x20')]||null:null,'attributes':_0x191ac0[_0xab95('0x1e')]?_0x191ac0['options']['attributes']||null:null,'include':_0x191ac0[_0xab95('0x1e')]?_0x191ac0[_0xab95('0x1e')][_0xab95('0x23')]?_[_0xab95('0x24')](_0x191ac0['options'][_0xab95('0x23')],function(_0x2979b4){return{'model':db[_0x2979b4[_0xab95('0x25')]],'as':_0x2979b4['as'],'attributes':_0x2979b4[_0xab95('0x21')],'include':_0x2979b4[_0xab95('0x23')]?_[_0xab95('0x24')](_0x2979b4[_0xab95('0x23')],function(_0x21c79b){return{'model':db[_0x21c79b[_0xab95('0x25')]],'as':_0x21c79b['as'],'attributes':_0x21c79b[_0xab95('0x21')],'include':_0x21c79b[_0xab95('0x23')]?_[_0xab95('0x24')](_0x21c79b[_0xab95('0x23')],function(_0x40d96c){return{'model':db[_0x40d96c[_0xab95('0x25')]],'as':_0x40d96c['as'],'attributes':_0x40d96c[_0xab95('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2b1083){logger[_0xab95('0x11')](_0xab95('0x26'),_0x191ac0);logger[_0xab95('0x14')](_0xab95('0x26'),_0x191ac0,JSON[_0xab95('0x15')](_0x2b1083));_0x1ef82d(_0x2b1083);})['catch'](function(_0x48060f){logger[_0xab95('0x16')](_0xab95('0x26'),_0x48060f['message'],_0x191ac0);_0x21316f(_0x205fe2[_0xab95('0x16')](0x1f4,_0x48060f[_0xab95('0x18')]));});});};exports[_0xab95('0x27')]=function(_0x5b9cc0){var _0x3400e7=this;return new Promise(function(_0x35f52f,_0x3c11d6){var _0x60938b={'body':_0x5b9cc0['body'],'channel':_0xab95('0x28')};var _0x2d4f1b=_[_0xab95('0x29')](_['keys'](db['CmContact'][_0xab95('0x2a')]),['createdAt',_0xab95('0x2b'),_0xab95('0x2c'),_0xab95('0x2d')]);var _0x3a88fb=![];if(_0x5b9cc0[_0xab95('0x2e')]['id']){delete _0x5b9cc0['body']['id'];}if(_['isNil'](_0x5b9cc0[_0xab95('0x2e')][_0xab95('0x2f')])){return _0x3c11d6(_0x3400e7[_0xab95('0x16')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0xab95('0x30')](_0x5b9cc0[_0xab95('0x2e')][_0xab95('0x2e')])||_0x5b9cc0[_0xab95('0x2e')][_0xab95('0x2e')]===''){return _0x3c11d6(_0x3400e7['error'](0x1f4,_0xab95('0x31')));}if(_[_0xab95('0x30')](_0x5b9cc0['body']['mapKey'])){return _0x3c11d6(_0x3400e7[_0xab95('0x16')](0x1f4,_0xab95('0x32')+_0x2d4f1b));}if(!_['includes'](_0x2d4f1b,_0x5b9cc0['body'][_0xab95('0x33')])){return _0x3c11d6(_0x3400e7[_0xab95('0x16')](0x1f4,_0xab95('0x34')+_0x2d4f1b));}var _0x46f872={};_0x46f872[_0x5b9cc0['body']['mapKey']]=_0x5b9cc0[_0xab95('0x2e')][_0xab95('0x2f')];return db[_0xab95('0x1c')][_0xab95('0x35')]({'where':{'id':_0x5b9cc0[_0xab95('0x36')]['id']},'include':[{'model':db[_0xab95('0x37')],'as':_0xab95('0x38'),'include':[{'model':db[_0xab95('0x39')],'as':_0xab95('0x3a'),'where':_0x46f872,'limit':0x1,'order':[[_0xab95('0x2b'),_0xab95('0x3b')]]}]},{'model':db[_0xab95('0x3c')],'as':_0xab95('0x3d')},{'model':db[_0xab95('0x3e')],'as':'Smtp'}]})['then'](function(_0x2fe275){if(_0x2fe275&&_0x2fe275[_0xab95('0x38')]){var _0x407452=_0x2fe275['get']({'plain':!![]});_0x60938b[_0xab95('0x36')]=_[_0xab95('0x3f')](_0x407452,[_0xab95('0x3d'),_0xab95('0x38')]);_0x60938b[_0xab95('0x40')]=_0x407452['Applications'];_0x60938b[_0xab95('0x41')]=_0x407452['List'];_0x60938b[_0xab95('0x40')]=_[_0xab95('0x42')](_0x60938b[_0xab95('0x40')],[_0xab95('0x43')],['asc']);if(_0x60938b[_0xab95('0x36')]&&_0x60938b[_0xab95('0x36')][_0xab95('0x44')]){_0x60938b['applications'][_0xab95('0x45')]({'id':0x0,'priority':_0x60938b[_0xab95('0x40')][_0xab95('0x46')]+0x1,'app':_0xab95('0x47'),'appdata':_0xab95('0x44'),'interval':_0xab95('0x48')});}if(_0x60938b[_0xab95('0x36')][_0xab95('0x3d')]){delete _0x60938b['account'][_0xab95('0x3d')];}if(_0x60938b[_0xab95('0x36')][_0xab95('0x38')]){delete _0x60938b[_0xab95('0x36')][_0xab95('0x38')];}if(_0x407452[_0xab95('0x38')][_0xab95('0x3a')][_0xab95('0x46')]){return _0x407452[_0xab95('0x38')][_0xab95('0x3a')][0x0];}var _0x2a4f01=_[_0xab95('0xd')](_0x5b9cc0['body'],{'firstName':_0x5b9cc0[_0xab95('0x2e')]['from'],'ListId':_0x407452['ListId']});_0x2a4f01[_0x5b9cc0['body'][_0xab95('0x33')]]=_0x5b9cc0[_0xab95('0x2e')]['from'];return db[_0xab95('0x39')][_0xab95('0x49')](_0x2a4f01);}else{throw new Error(_0xab95('0x4a'));}})['then'](function(_0x39c61c){_0x60938b[_0xab95('0x4b')]=_0x39c61c;if(_0x39c61c){if(!_0x5b9cc0[_0xab95('0x2e')][_0xab95('0x18')][_0xab95('0x4c')]){_0x5b9cc0[_0xab95('0x2e')][_0xab95('0x18')]['messageId']=rs[_0xab95('0x4d')]()+'\x20'+_0x5b9cc0['body'][_0xab95('0x18')][_0xab95('0x2f')];}var _0x55a866={'ContactId':_0x39c61c['id'],'MailAccountId':_0x5b9cc0[_0xab95('0x36')]['id'],'inReplyTo':_0x5b9cc0[_0xab95('0x2e')][_0xab95('0x18')]['messageId'],'to':_0x5b9cc0['body'][_0xab95('0x18')][_0xab95('0x2f')],'cc':_0x5b9cc0[_0xab95('0x2e')][_0xab95('0x18')]['cc'],'subject':_0x5b9cc0[_0xab95('0x2e')][_0xab95('0x18')]['subject'],'attach':_0x5b9cc0[_0xab95('0x2e')][_0xab95('0x18')]['attach'],'lastMsgAt':moment()[_0xab95('0x4e')](_0xab95('0x4f')),'lastMsgDirection':'in'};return db[_0xab95('0x50')][_0xab95('0x35')]({'where':{'closed':![],'MailAccountId':_0x5b9cc0[_0xab95('0x36')]['id']},'include':[{'model':db[_0xab95('0x51')],'as':'Messages','attributes':['messageId'],'where':{'messageId':_0x5b9cc0[_0xab95('0x2e')]['message'][_0xab95('0x52')]}}]})[_0xab95('0x53')](function(_0x53b8e0){if(_0x53b8e0){return[_0x53b8e0,![]];}return db[_0xab95('0x50')]['create'](_0x55a866)['then'](function(_0x13f6c7){return[_0x13f6c7,!![]];});});}else{throw new Error(_0xab95('0x54'));}})[_0xab95('0x55')](function(_0x5257ed,_0x141d38){if(_0x5257ed){_0x3a88fb=_0x141d38;if(!_0x141d38){return _0x5257ed['update']({'inReplyTo':_0x5b9cc0['body'][_0xab95('0x18')]['messageId'],'to':_0x5b9cc0[_0xab95('0x2e')][_0xab95('0x18')][_0xab95('0x2f')],'cc':_0x5b9cc0[_0xab95('0x2e')]['message']['cc'],'subject':_0x5b9cc0[_0xab95('0x2e')][_0xab95('0x18')][_0xab95('0x56')],'attach':_0x5257ed['attach']?_0x5257ed[_0xab95('0x57')]:_0x5b9cc0[_0xab95('0x2e')][_0xab95('0x18')][_0xab95('0x57')],'substatus':null,'substatusAt':moment()[_0xab95('0x4e')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()['format'](_0xab95('0x4f')),'lastMsgDirection':'in'});}else{return _0x5257ed;}}})[_0xab95('0x53')](function(_0x4cedf3){_0x60938b[_0xab95('0x58')]=_0x4cedf3[_0xab95('0x59')]({'plain':!![]});_0x60938b[_0xab95('0x58')][_0xab95('0x5a')]=_0x3a88fb;return db[_0xab95('0x51')][_0xab95('0x49')]({'body':_0x5b9cc0[_0xab95('0x2e')][_0xab95('0x2e')],'MailAccountId':_0x5b9cc0[_0xab95('0x36')]['id'],'MailInteractionId':_0x4cedf3['id'],'direction':'in','ContactId':_0x60938b[_0xab95('0x4b')]['id'],'messageId':_0x5b9cc0['body'][_0xab95('0x18')][_0xab95('0x4c')],'from':_0x5b9cc0['body'][_0xab95('0x18')][_0xab95('0x2f')],'to':_0x5b9cc0[_0xab95('0x2e')]['message']['to'],'cc':_0x5b9cc0[_0xab95('0x2e')]['message']['cc'],'subject':_0x5b9cc0[_0xab95('0x2e')]['message'][_0xab95('0x56')],'attach':_0x5b9cc0[_0xab95('0x2e')][_0xab95('0x18')][_0xab95('0x57')],'Attachments':_0x5b9cc0['body'][_0xab95('0x18')]['attachments'],'originTo':_0x5b9cc0[_0xab95('0x2e')]['message']['originTo'],'originCc':_0x5b9cc0['body'][_0xab95('0x18')][_0xab95('0x5b')],'bcc':_0x5b9cc0[_0xab95('0x2e')]['message'][_0xab95('0x5c')],'ChatWebsiteId':_0x5b9cc0['body']['message'][_0xab95('0x5d')]||null,'originChannel':_0x5b9cc0[_0xab95('0x2e')][_0xab95('0x18')]['originChannel']||_0xab95('0x5e'),'ChatOfflineMessageId':_0x5b9cc0[_0xab95('0x2e')][_0xab95('0x18')]['ChatOfflineMessageId']||null},{'include':[{'model':db[_0xab95('0x5f')],'as':_0xab95('0x60')}]});})[_0xab95('0x53')](function(_0x5cc9a7){_0x60938b[_0xab95('0x18')]=_0x5cc9a7;if(_0x60938b[_0xab95('0x58')][_0xab95('0x61')]){return db[_0xab95('0x62')]['find']({'attributes':['id','name'],'where':{'id':_0x60938b[_0xab95('0x58')][_0xab95('0x61')]}})[_0xab95('0x53')](function(_0x3e3842){if(_0x3e3842){_0x60938b[_0xab95('0x40')][_0xab95('0x63')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x3e3842[_0xab95('0x64')]+','+(_0x60938b[_0xab95('0x36')][_0xab95('0x65')]||0xa),'interval':_0xab95('0x48')});}return respondWithRpcPromise(_0xab95('0x66'),'startRouting',_0x60938b);});}return respondWithRpcPromise(_0xab95('0x66'),_0xab95('0x67'),_0x60938b);})[_0xab95('0x53')](function(_0xf1142c){_0x35f52f(_0xf1142c);})[_0xab95('0x1a')](function(_0x80255d){_0x3c11d6(_0x3400e7[_0xab95('0x16')](0x1f4,_0x80255d[_0xab95('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index ec16d41..750b3f0 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 _0x54b5=['remove','emit','removeListener','register','length','./mailAccount.events','save'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x54b5,0xad));var _0x554b=function(_0x13cb4f,_0x22d2fa){_0x13cb4f=_0x13cb4f-0x0;var _0x2d154f=_0x54b5[_0x13cb4f];return _0x2d154f;};'use strict';var MailAccountEvents=require(_0x554b('0x0'));var events=[_0x554b('0x1'),_0x554b('0x2'),'update'];function createListener(_0x2a1156,_0x51b10f){return function(_0x4c20d0){_0x51b10f[_0x554b('0x3')](_0x2a1156,_0x4c20d0);};}function removeListener(_0x360b8b,_0x21983b){return function(){MailAccountEvents[_0x554b('0x4')](_0x360b8b,_0x21983b);};}exports[_0x554b('0x5')]=function(_0x435ebb){for(var _0x298d6f=0x0,_0x1c4d03=events[_0x554b('0x6')];_0x298d6f<_0x1c4d03;_0x298d6f++){var _0x5a06a6=events[_0x298d6f];var _0x5d6dd7=createListener('mailAccount:'+_0x5a06a6,_0x435ebb);MailAccountEvents['on'](_0x5a06a6,_0x5d6dd7);}}; \ No newline at end of file +var _0xdb1f=['register','length','mailAccount:','save','remove','update','emit'];(function(_0x37ffea,_0x25b006){var _0x2e2615=function(_0x5e6c74){while(--_0x5e6c74){_0x37ffea['push'](_0x37ffea['shift']());}};_0x2e2615(++_0x25b006);}(_0xdb1f,0x81));var _0xfdb1=function(_0x40d067,_0x43d994){_0x40d067=_0x40d067-0x0;var _0x8f9291=_0xdb1f[_0x40d067];return _0x8f9291;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0xfdb1('0x0'),_0xfdb1('0x1'),_0xfdb1('0x2')];function createListener(_0x3b36aa,_0x426c02){return function(_0x492a4d){_0x426c02[_0xfdb1('0x3')](_0x3b36aa,_0x492a4d);};}function removeListener(_0x3e4b73,_0x27a73a){return function(){MailAccountEvents['removeListener'](_0x3e4b73,_0x27a73a);};}exports[_0xfdb1('0x4')]=function(_0xbcdc16){for(var _0x22e9b6=0x0,_0x355322=events[_0xfdb1('0x5')];_0x22e9b6<_0x355322;_0x22e9b6++){var _0x3cd033=events[_0x22e9b6];var _0x1ed5e0=createListener(_0xfdb1('0x6')+_0x3cd033,_0xbcdc16);MailAccountEvents['on'](_0x3cd033,_0x1ed5e0);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index e1f62e4..e95982d 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 _0x192c=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x192c,0x1ad));var _0xc192=function(_0x3776b4,_0x19a1e3){_0x3776b4=_0x3776b4-0x0;var _0x1636d9=_0x192c[_0x3776b4];return _0x1636d9;};'use strict';var multer=require('multer');var util=require(_0xc192('0x0'));var path=require(_0xc192('0x1'));var timeout=require(_0xc192('0x2'));var express=require('express');var router=express[_0xc192('0x3')]();var fs_extra=require(_0xc192('0x4'));var auth=require(_0xc192('0x5'));var interaction=require(_0xc192('0x6'));var config=require(_0xc192('0x7'));var controller=require('./mailApplication.controller');router[_0xc192('0x8')](_0xc192('0x9'),auth[_0xc192('0xa')](),controller[_0xc192('0xb')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc192('0xc')]);router[_0xc192('0xd')]('/:id',auth[_0xc192('0xa')](),controller[_0xc192('0xe')]);module[_0xc192('0xf')]=router; \ No newline at end of file +var _0xfdc4=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','show'];(function(_0x167d1b,_0x4b83f0){var _0x2a43e8=function(_0x2c5c1a){while(--_0x2c5c1a){_0x167d1b['push'](_0x167d1b['shift']());}};_0x2a43e8(++_0x4b83f0);}(_0xfdc4,0x125));var _0x4fdc=function(_0x4dc3ae,_0x57858d){_0x4dc3ae=_0x4dc3ae-0x0;var _0xaf6bbd=_0xfdc4[_0x4dc3ae];return _0xaf6bbd;};'use strict';var multer=require(_0x4fdc('0x0'));var util=require(_0x4fdc('0x1'));var path=require(_0x4fdc('0x2'));var timeout=require(_0x4fdc('0x3'));var express=require(_0x4fdc('0x4'));var router=express['Router']();var fs_extra=require(_0x4fdc('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4fdc('0x6'));var config=require(_0x4fdc('0x7'));var controller=require(_0x4fdc('0x8'));router[_0x4fdc('0x9')](_0x4fdc('0xa'),auth[_0x4fdc('0xb')](),controller[_0x4fdc('0xc')]);router[_0x4fdc('0xd')](_0x4fdc('0xa'),auth[_0x4fdc('0xb')](),controller[_0x4fdc('0xe')]);router[_0x4fdc('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x4fdc('0x10')]);module[_0x4fdc('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index c1b2673..333197c 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 _0xc4bd=['sequelize','exports','noop','STRING','*,*,*,*'];(function(_0xf8ebe,_0x4a8cba){var _0x11131f=function(_0x2a5d52){while(--_0x2a5d52){_0xf8ebe['push'](_0xf8ebe['shift']());}};_0x11131f(++_0x4a8cba);}(_0xc4bd,0xf5));var _0xdc4b=function(_0x5ad18c,_0x340ac2){_0x5ad18c=_0x5ad18c-0x0;var _0x23d3bb=_0xc4bd[_0x5ad18c];return _0x23d3bb;};'use strict';var Sequelize=require(_0xdc4b('0x0'));module[_0xdc4b('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xdc4b('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xdc4b('0x3')],'defaultValue':_0xdc4b('0x4')}}; \ No newline at end of file +var _0x19fa=['noop','TEXT','STRING','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x111c93,_0x17924a){var _0x436ab6=function(_0xb2de9){while(--_0xb2de9){_0x111c93['push'](_0x111c93['shift']());}};_0x436ab6(++_0x17924a);}(_0x19fa,0xcf));var _0xa19f=function(_0x3dedd6,_0x23d24d){_0x3dedd6=_0x3dedd6-0x0;var _0xdd02ab=_0x19fa[_0x3dedd6];return _0xdd02ab;};'use strict';var Sequelize=require(_0xa19f('0x0'));module[_0xa19f('0x1')]={'priority':{'type':Sequelize[_0xa19f('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa19f('0x3')},'appdata':{'type':Sequelize[_0xa19f('0x4')]()},'description':{'type':Sequelize[_0xa19f('0x5')]},'interval':{'type':Sequelize[_0xa19f('0x5')],'defaultValue':_0xa19f('0x6')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index bf7d797..63c2bb8 100644 --- a/server/api/mailApplication/mailApplication.controller.js +++ b/server/api/mailApplication/mailApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','show','params','model','keys','MailApplication','rawAttributes','query','attributes','intersection','fields','length','includeAll','include','merge','options','find','then','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set'];(function(_0xd10b43,_0x440ec1){var _0x369090=function(_0x5ae495){while(--_0x5ae495){_0xd10b43['push'](_0xd10b43['shift']());}};_0x369090(++_0x440ec1);}(_0x9c44,0x178));var _0x49c4=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x9c44[_0x13e741];return _0x3f8bb3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49c4('0x0'));var jsonpatch=require(_0x49c4('0x1'));var rp=require(_0x49c4('0x2'));var moment=require(_0x49c4('0x3'));var BPromise=require(_0x49c4('0x4'));var Mustache=require(_0x49c4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x49c4('0x6'));var csv=require('to-csv');var ejs=require(_0x49c4('0x7'));var fs=require('fs');var fs_extra=require(_0x49c4('0x8'));var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0xd'));var querystring=require(_0x49c4('0xe'));var Papa=require(_0x49c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0x10'));var as=require(_0x49c4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x12'))(_0x49c4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49c4('0x14'));var db=require(_0x49c4('0x15'))['db'];function respondWithStatusCode(_0x5487cd,_0x7df3a9){_0x7df3a9=_0x7df3a9||0xcc;return function(_0x403bfb){if(_0x403bfb){return _0x5487cd['sendStatus'](_0x7df3a9);}return _0x5487cd[_0x49c4('0x16')](_0x7df3a9)[_0x49c4('0x17')]();};}function respondWithResult(_0x21f15a,_0x2decee){_0x2decee=_0x2decee||0xc8;return function(_0x12777c){if(_0x12777c){return _0x21f15a[_0x49c4('0x16')](_0x2decee)[_0x49c4('0x18')](_0x12777c);}};}function respondWithFilteredResult(_0x3de397,_0x58d177){return function(_0x3acd06){if(_0x3acd06){var _0x141003=typeof _0x58d177[_0x49c4('0x19')]===_0x49c4('0x1a')&&typeof _0x58d177[_0x49c4('0x1b')]==='undefined';var _0x44e607=_0x3acd06[_0x49c4('0x1c')];var _0x4c3253=_0x141003?0x0:_0x58d177['offset'];var _0x3c782d=_0x141003?_0x3acd06[_0x49c4('0x1c')]:_0x58d177[_0x49c4('0x19')]+_0x58d177['limit'];var _0x24856d;if(_0x3c782d>=_0x44e607){_0x3c782d=_0x44e607;_0x24856d=0xc8;}else{_0x24856d=0xce;}_0x3de397['status'](_0x24856d);return _0x3de397[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x4c3253+'-'+_0x3c782d+'/'+_0x44e607)[_0x49c4('0x18')](_0x3acd06);}return null;};}function patchUpdates(_0x291526){return function(_0x382040){try{jsonpatch[_0x49c4('0x1f')](_0x382040,_0x291526,!![]);}catch(_0x280893){return BPromise[_0x49c4('0x20')](_0x280893);}return _0x382040[_0x49c4('0x21')]();};}function saveUpdates(_0x578447,_0x527126){return function(_0x57f502){if(_0x57f502){return _0x57f502[_0x49c4('0x22')](_0x578447)['then'](function(_0x592bb8){return _0x592bb8;});}return null;};}function removeEntity(_0x2263ae,_0x15581b){return function(_0x26c640){if(_0x26c640){return _0x26c640[_0x49c4('0x23')]()['then'](function(){_0x2263ae['status'](0xcc)[_0x49c4('0x17')]();});}};}function handleEntityNotFound(_0x9cb797,_0x565423){return function(_0x207358){if(!_0x207358){_0x9cb797[_0x49c4('0x24')](0x194);}return _0x207358;};}function handleError(_0x210159,_0xa7a826){_0xa7a826=_0xa7a826||0x1f4;return function(_0x531d92){logger['error'](_0x531d92[_0x49c4('0x25')]);if(_0x531d92['name']){delete _0x531d92[_0x49c4('0x26')];}_0x210159[_0x49c4('0x16')](_0xa7a826)[_0x49c4('0x27')](_0x531d92);};}exports[_0x49c4('0x28')]=function(_0x5987ae,_0x889909){var _0x2b2793={'raw':!![],'where':{'id':_0x5987ae[_0x49c4('0x29')]['id']}},_0x46e04d={};_0x46e04d[_0x49c4('0x2a')]=_[_0x49c4('0x2b')](db[_0x49c4('0x2c')][_0x49c4('0x2d')]);_0x46e04d[_0x49c4('0x2e')]=_[_0x49c4('0x2b')](_0x5987ae[_0x49c4('0x2e')]);_0x46e04d['filters']=_['intersection'](_0x46e04d['model'],_0x46e04d[_0x49c4('0x2e')]);_0x2b2793[_0x49c4('0x2f')]=_[_0x49c4('0x30')](_0x46e04d[_0x49c4('0x2a')],qs[_0x49c4('0x31')](_0x5987ae['query'][_0x49c4('0x31')]));_0x2b2793[_0x49c4('0x2f')]=_0x2b2793[_0x49c4('0x2f')][_0x49c4('0x32')]?_0x2b2793['attributes']:_0x46e04d['model'];if(_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x33')]){_0x2b2793[_0x49c4('0x34')]=[{'all':!![]}];}_0x2b2793=_[_0x49c4('0x35')]({},_0x2b2793,_0x5987ae[_0x49c4('0x36')]);return db['MailApplication'][_0x49c4('0x37')](_0x2b2793)[_0x49c4('0x38')](handleEntityNotFound(_0x889909,null))[_0x49c4('0x38')](respondWithResult(_0x889909,null))['catch'](handleError(_0x889909,null));};exports['update']=function(_0x85dce2,_0x1991e9){if(_0x85dce2[_0x49c4('0x39')]['id']){delete _0x85dce2[_0x49c4('0x39')]['id'];}return db[_0x49c4('0x2c')][_0x49c4('0x37')]({'where':{'id':_0x85dce2[_0x49c4('0x29')]['id']}})[_0x49c4('0x38')](handleEntityNotFound(_0x1991e9,null))[_0x49c4('0x38')](saveUpdates(_0x85dce2['body'],null))[_0x49c4('0x38')](respondWithResult(_0x1991e9,null))['catch'](handleError(_0x1991e9,null));};exports[_0x49c4('0x23')]=function(_0x349791,_0x2625a6){return db[_0x49c4('0x2c')]['find']({'where':{'id':_0x349791[_0x49c4('0x29')]['id']}})[_0x49c4('0x38')](handleEntityNotFound(_0x2625a6,null))[_0x49c4('0x38')](removeEntity(_0x2625a6,null))['catch'](handleError(_0x2625a6,null));}; \ No newline at end of file +var _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(_0x1b4912,_0x3e8bb9){var _0x48cac5=function(_0x55798b){while(--_0x55798b){_0x1b4912['push'](_0x1b4912['shift']());}};_0x48cac5(++_0x3e8bb9);}(_0xe706,0xa3));var _0x6e70=function(_0x2b9dcd,_0x3ec18c){_0x2b9dcd=_0x2b9dcd-0x0;var _0x4adb32=_0xe706[_0x2b9dcd];return _0x4adb32;};'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 diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 0642f8e..4c92f7e 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 _0x2b70=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','exports','define','mail_applications','lodash'];(function(_0x236f12,_0x4c7faf){var _0x32969a=function(_0x3a3e1d){while(--_0x3a3e1d){_0x236f12['push'](_0x236f12['shift']());}};_0x32969a(++_0x4c7faf);}(_0x2b70,0xa7));var _0x02b7=function(_0x1ee34b,_0x1b3de4){_0x1ee34b=_0x1ee34b-0x0;var _0xae8565=_0x2b70[_0x1ee34b];return _0xae8565;};'use strict';var _=require(_0x02b7('0x0'));var util=require(_0x02b7('0x1'));var logger=require(_0x02b7('0x2'))(_0x02b7('0x3'));var moment=require(_0x02b7('0x4'));var BPromise=require(_0x02b7('0x5'));var rp=require(_0x02b7('0x6'));var fs=require('fs');var path=require(_0x02b7('0x7'));var rimraf=require(_0x02b7('0x8'));var config=require(_0x02b7('0x9'));var attributes=require(_0x02b7('0xa'));module[_0x02b7('0xb')]=function(_0x1dedc6,_0x12141e){return _0x1dedc6[_0x02b7('0xc')]('MailApplication',attributes,{'tableName':_0x02b7('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x09c0=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','MailApplication','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x3a99f4,_0x2a81c1){var _0xea0b42=function(_0x41f533){while(--_0x41f533){_0x3a99f4['push'](_0x3a99f4['shift']());}};_0xea0b42(++_0x2a81c1);}(_0x09c0,0x1b2));var _0x009c=function(_0x40ea8f,_0x4c1502){_0x40ea8f=_0x40ea8f-0x0;var _0x362608=_0x09c0[_0x40ea8f];return _0x362608;};'use strict';var _=require(_0x009c('0x0'));var util=require(_0x009c('0x1'));var logger=require(_0x009c('0x2'))(_0x009c('0x3'));var moment=require(_0x009c('0x4'));var BPromise=require(_0x009c('0x5'));var rp=require(_0x009c('0x6'));var fs=require('fs');var path=require(_0x009c('0x7'));var rimraf=require(_0x009c('0x8'));var config=require(_0x009c('0x9'));var attributes=require('./mailApplication.attributes');module[_0x009c('0xa')]=function(_0x58c271,_0x5c90f0){return _0x58c271[_0x009c('0xb')](_0x009c('0xc'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x009c('0xd'),'collate':_0x009c('0xe')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 1b36106..68d6a48 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 _0x5f35=['randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateMailApplication','MailApplication','update','options','raw','where','attributes','limit','lodash','util','moment'];(function(_0x489b87,_0xd51c93){var _0x1823b6=function(_0x451c70){while(--_0x451c70){_0x489b87['push'](_0x489b87['shift']());}};_0x1823b6(++_0xd51c93);}(_0x5f35,0x165));var _0x55f3=function(_0x31b5b2,_0x5ab927){_0x31b5b2=_0x31b5b2-0x0;var _0x364f13=_0x5f35[_0x31b5b2];return _0x364f13;};'use strict';var _=require(_0x55f3('0x0'));var util=require(_0x55f3('0x1'));var moment=require(_0x55f3('0x2'));var BPromise=require('bluebird');var rs=require(_0x55f3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x55f3('0x4'))['db'];var utils=require(_0x55f3('0x5'));var logger=require(_0x55f3('0x6'))('rpc');var config=require(_0x55f3('0x7'));var jayson=require(_0x55f3('0x8'));var client=jayson[_0x55f3('0x9')][_0x55f3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x66867b,_0x34633e,_0x439eeb){return new BPromise(function(_0xc33e8c,_0x4edac0){return client['request'](_0x66867b,_0x439eeb)[_0x55f3('0xb')](function(_0x45a5f6){logger[_0x55f3('0xc')](_0x55f3('0xd'),_0x34633e,_0x55f3('0xe'));logger[_0x55f3('0xf')](_0x55f3('0x10'),_0x34633e,_0x55f3('0xe'),JSON['stringify'](_0x45a5f6));if(_0x45a5f6[_0x55f3('0x11')]){if(_0x45a5f6[_0x55f3('0x11')][_0x55f3('0x12')]===0x1f4){logger[_0x55f3('0x11')](_0x55f3('0xd'),_0x34633e,_0x45a5f6[_0x55f3('0x11')][_0x55f3('0x13')]);return _0x4edac0(_0x45a5f6[_0x55f3('0x11')][_0x55f3('0x13')]);}logger[_0x55f3('0x11')](_0x55f3('0xd'),_0x34633e,_0x45a5f6[_0x55f3('0x11')][_0x55f3('0x13')]);return _0xc33e8c(_0x45a5f6[_0x55f3('0x11')]['message']);}else{logger['info']('MailApplication,\x20%s,\x20%s',_0x34633e,_0x55f3('0xe'));_0xc33e8c(_0x45a5f6[_0x55f3('0x14')][_0x55f3('0x13')]);}})[_0x55f3('0x15')](function(_0x4a3a74){logger[_0x55f3('0x11')](_0x55f3('0xd'),_0x34633e,_0x4a3a74);_0x4edac0(_0x4a3a74);});});}exports[_0x55f3('0x16')]=function(_0x405417){var _0x2adedc=this;return new Promise(function(_0x1ef237,_0x43bec5){return db[_0x55f3('0x17')][_0x55f3('0x18')](_0x405417['body'],{'raw':_0x405417[_0x55f3('0x19')]?_0x405417[_0x55f3('0x19')][_0x55f3('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x405417[_0x55f3('0x19')]?_0x405417['options'][_0x55f3('0x1b')]||null:null,'attributes':_0x405417[_0x55f3('0x19')]?_0x405417[_0x55f3('0x19')][_0x55f3('0x1c')]||null:null,'limit':_0x405417[_0x55f3('0x19')]?_0x405417[_0x55f3('0x19')][_0x55f3('0x1d')]||null:null})[_0x55f3('0xb')](function(_0x498a09){logger['info'](_0x55f3('0x16'),_0x405417);logger[_0x55f3('0xf')](_0x55f3('0x16'),_0x405417,JSON['stringify'](_0x498a09));_0x1ef237(_0x498a09);})[_0x55f3('0x15')](function(_0x206089){logger[_0x55f3('0x11')]('UpdateMailApplication',_0x206089[_0x55f3('0x13')],_0x405417);_0x43bec5(_0x2adedc[_0x55f3('0x11')](0x1f4,_0x206089[_0x55f3('0x13')]));});});}; \ No newline at end of file +var _0xd040=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','error','message','catch','MailApplication','update','options','raw','where','attributes','then','UpdateMailApplication','lodash','moment','bluebird'];(function(_0x2d513f,_0x126f93){var _0x2488c3=function(_0x59599c){while(--_0x59599c){_0x2d513f['push'](_0x2d513f['shift']());}};_0x2488c3(++_0x126f93);}(_0xd040,0x1bd));var _0x0d04=function(_0xc01695,_0x503a33){_0xc01695=_0xc01695-0x0;var _0x523c1f=_0xd040[_0xc01695];return _0x523c1f;};'use strict';var _=require(_0x0d04('0x0'));var util=require('util');var moment=require(_0x0d04('0x1'));var BPromise=require(_0x0d04('0x2'));var rs=require(_0x0d04('0x3'));var fs=require('fs');var Redis=require(_0x0d04('0x4'));var db=require(_0x0d04('0x5'))['db'];var utils=require(_0x0d04('0x6'));var logger=require(_0x0d04('0x7'))(_0x0d04('0x8'));var config=require(_0x0d04('0x9'));var jayson=require(_0x0d04('0xa'));var client=jayson['client'][_0x0d04('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x27ee83,_0x5cb548,_0x5b1fbb){return new BPromise(function(_0x2a4144,_0x3e9bf8){return client[_0x0d04('0xc')](_0x27ee83,_0x5b1fbb)['then'](function(_0x29b400){logger[_0x0d04('0xd')](_0x0d04('0xe'),_0x5cb548,_0x0d04('0xf'));logger[_0x0d04('0x10')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x5cb548,'request\x20sent',JSON['stringify'](_0x29b400));if(_0x29b400['error']){if(_0x29b400[_0x0d04('0x11')]['code']===0x1f4){logger[_0x0d04('0x11')]('MailApplication,\x20%s,\x20%s',_0x5cb548,_0x29b400[_0x0d04('0x11')][_0x0d04('0x12')]);return _0x3e9bf8(_0x29b400[_0x0d04('0x11')]['message']);}logger['error'](_0x0d04('0xe'),_0x5cb548,_0x29b400[_0x0d04('0x11')][_0x0d04('0x12')]);return _0x2a4144(_0x29b400[_0x0d04('0x11')][_0x0d04('0x12')]);}else{logger[_0x0d04('0xd')](_0x0d04('0xe'),_0x5cb548,_0x0d04('0xf'));_0x2a4144(_0x29b400['result'][_0x0d04('0x12')]);}})[_0x0d04('0x13')](function(_0x15d97f){logger[_0x0d04('0x11')](_0x0d04('0xe'),_0x5cb548,_0x15d97f);_0x3e9bf8(_0x15d97f);});});}exports['UpdateMailApplication']=function(_0x4cf6f7){var _0x2f7d64=this;return new Promise(function(_0x120edc,_0x5898b7){return db[_0x0d04('0x14')][_0x0d04('0x15')](_0x4cf6f7['body'],{'raw':_0x4cf6f7[_0x0d04('0x16')]?_0x4cf6f7['options'][_0x0d04('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4cf6f7['options']?_0x4cf6f7[_0x0d04('0x16')][_0x0d04('0x18')]||null:null,'attributes':_0x4cf6f7[_0x0d04('0x16')]?_0x4cf6f7[_0x0d04('0x16')][_0x0d04('0x19')]||null:null,'limit':_0x4cf6f7['options']?_0x4cf6f7[_0x0d04('0x16')]['limit']||null:null})[_0x0d04('0x1a')](function(_0x42572e){logger[_0x0d04('0xd')](_0x0d04('0x1b'),_0x4cf6f7);logger[_0x0d04('0x10')](_0x0d04('0x1b'),_0x4cf6f7,JSON['stringify'](_0x42572e));_0x120edc(_0x42572e);})['catch'](function(_0x43bef1){logger[_0x0d04('0x11')](_0x0d04('0x1b'),_0x43bef1[_0x0d04('0x12')],_0x4cf6f7);_0x5898b7(_0x2f7d64[_0x0d04('0x11')](0x1f4,_0x43bef1[_0x0d04('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 1167501..16eb13a 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 _0x9a95=['/:id/download','download','create','addMessage','post','/:id/tags','tracked','mail','mailinteraction:addtags','put','mailinteraction:update','mailinteraction:destroy','delete','exports','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/messages'];(function(_0x962fc5,_0x58f074){var _0x43667c=function(_0x5e6ec0){while(--_0x5e6ec0){_0x962fc5['push'](_0x962fc5['shift']());}};_0x43667c(++_0x58f074);}(_0x9a95,0x1e2));var _0x59a9=function(_0x2cae33,_0x5d2f7c){_0x2cae33=_0x2cae33-0x0;var _0x2cb03e=_0x9a95[_0x2cae33];return _0x2cb03e;};'use strict';var express=require(_0x59a9('0x0'));var router=express[_0x59a9('0x1')]();var auth=require(_0x59a9('0x2'));var interaction=require(_0x59a9('0x3'));var controller=require(_0x59a9('0x4'));router['get']('/',auth[_0x59a9('0x5')](),controller['index']);router[_0x59a9('0x6')](_0x59a9('0x7'),auth['isAuthenticated'](),controller[_0x59a9('0x8')]);router['get'](_0x59a9('0x9'),auth['isAuthenticated'](),controller[_0x59a9('0xa')]);router[_0x59a9('0x6')](_0x59a9('0xb'),auth[_0x59a9('0x5')](),controller['getMessages']);router[_0x59a9('0x6')](_0x59a9('0xc'),auth[_0x59a9('0x5')](),controller[_0x59a9('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x59a9('0xe')]);router['post'](_0x59a9('0xb'),auth[_0x59a9('0x5')](),controller[_0x59a9('0xf')]);router[_0x59a9('0x10')](_0x59a9('0x11'),auth[_0x59a9('0x5')](),interaction[_0x59a9('0x12')](_0x59a9('0x13'),_0x59a9('0x14')),controller['addTags']);router[_0x59a9('0x15')]('/:id',auth['isAuthenticated'](),interaction[_0x59a9('0x12')](_0x59a9('0x13'),_0x59a9('0x16')),controller['update']);router['delete'](_0x59a9('0x9'),auth[_0x59a9('0x5')](),interaction[_0x59a9('0x12')](_0x59a9('0x13'),_0x59a9('0x17')),controller['destroy']);router[_0x59a9('0x18')]('/:id/tags',auth[_0x59a9('0x5')](),controller['removeTags']);module[_0x59a9('0x19')]=router; \ No newline at end of file +var _0x2a8d=['/:id','/:id/messages','getMessages','/:id/download','post','create','tracked','mail','mailinteraction:addtags','put','mailinteraction:update','delete','destroy','/:id/tags','removeTags','exports','express','Router','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','describe'];(function(_0xa3da82,_0x3be0c4){var _0x55a74=function(_0x4f0f76){while(--_0x4f0f76){_0xa3da82['push'](_0xa3da82['shift']());}};_0x55a74(++_0x3be0c4);}(_0x2a8d,0x178));var _0xd2a8=function(_0x35d649,_0x37210f){_0x35d649=_0x35d649-0x0;var _0x541bc4=_0x2a8d[_0x35d649];return _0x541bc4;};'use strict';var express=require(_0xd2a8('0x0'));var router=express[_0xd2a8('0x1')]();var auth=require('../../components/auth/service');var interaction=require(_0xd2a8('0x2'));var controller=require(_0xd2a8('0x3'));router[_0xd2a8('0x4')]('/',auth[_0xd2a8('0x5')](),controller[_0xd2a8('0x6')]);router[_0xd2a8('0x4')]('/describe',auth[_0xd2a8('0x5')](),controller[_0xd2a8('0x7')]);router['get'](_0xd2a8('0x8'),auth[_0xd2a8('0x5')](),controller['show']);router[_0xd2a8('0x4')](_0xd2a8('0x9'),auth['isAuthenticated'](),controller[_0xd2a8('0xa')]);router['get'](_0xd2a8('0xb'),auth[_0xd2a8('0x5')](),controller['download']);router[_0xd2a8('0xc')]('/',auth[_0xd2a8('0x5')](),controller[_0xd2a8('0xd')]);router[_0xd2a8('0xc')]('/:id/messages',auth[_0xd2a8('0x5')](),controller['addMessage']);router[_0xd2a8('0xc')]('/:id/tags',auth[_0xd2a8('0x5')](),interaction[_0xd2a8('0xe')](_0xd2a8('0xf'),_0xd2a8('0x10')),controller['addTags']);router[_0xd2a8('0x11')](_0xd2a8('0x8'),auth['isAuthenticated'](),interaction['tracked'](_0xd2a8('0xf'),_0xd2a8('0x12')),controller['update']);router[_0xd2a8('0x13')]('/:id',auth[_0xd2a8('0x5')](),interaction[_0xd2a8('0xe')](_0xd2a8('0xf'),'mailinteraction:destroy'),controller[_0xd2a8('0x14')]);router[_0xd2a8('0x13')](_0xd2a8('0x15'),auth[_0xd2a8('0x5')](),controller[_0xd2a8('0x16')]);module[_0xd2a8('0x17')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index ae580f7..ebf8e56 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 _0xe9fd=['out','sequelize','exports','BOOLEAN','DATE','STRING','long','TEXT','ENUM'];(function(_0x28470a,_0x37e9fe){var _0xcb3c52=function(_0x13208e){while(--_0x13208e){_0x28470a['push'](_0x28470a['shift']());}};_0xcb3c52(++_0x37e9fe);}(_0xe9fd,0x14e));var _0xde9f=function(_0x5e3fd4,_0x481b9e){_0x5e3fd4=_0x5e3fd4-0x0;var _0x5f59af=_0xe9fd[_0x5e3fd4];return _0x5f59af;};'use strict';var Sequelize=require(_0xde9f('0x0'));var iconv=require('iconv');module[_0xde9f('0x1')]={'closed':{'type':Sequelize[_0xde9f('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xde9f('0x3')]},'disposition':{'type':Sequelize[_0xde9f('0x4')]},'secondDisposition':{'type':Sequelize[_0xde9f('0x4')]},'thirdDisposition':{'type':Sequelize[_0xde9f('0x4')]},'note':{'type':Sequelize[_0xde9f('0x4')]},'inReplyTo':{'type':Sequelize[_0xde9f('0x4')](0x1fe)},'to':{'type':Sequelize[_0xde9f('0x4')]},'cc':{'type':Sequelize['TEXT'](_0xde9f('0x5'))},'subject':{'type':Sequelize[_0xde9f('0x6')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xde9f('0x3')]},'substatus':{'type':Sequelize[_0xde9f('0x4')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xde9f('0x7')]('in',_0xde9f('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xde9f('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xde9f('0x7')]('in',_0xde9f('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xde9f('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xe6c4=['STRING','TEXT','long','BOOLEAN','ENUM','out','exports','DATE'];(function(_0x1195a4,_0xae4404){var _0x32c32f=function(_0xbd69b2){while(--_0xbd69b2){_0x1195a4['push'](_0x1195a4['shift']());}};_0x32c32f(++_0xae4404);}(_0xe6c4,0x136));var _0x4e6c=function(_0xc7f290,_0x17c763){_0xc7f290=_0xc7f290-0x0;var _0x3b6ac0=_0xe6c4[_0xc7f290];return _0x3b6ac0;};'use strict';var Sequelize=require('sequelize');var iconv=require('iconv');module[_0x4e6c('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x4e6c('0x1')]},'disposition':{'type':Sequelize[_0x4e6c('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x4e6c('0x2')]},'inReplyTo':{'type':Sequelize[_0x4e6c('0x2')](0x1fe)},'to':{'type':Sequelize[_0x4e6c('0x2')]},'cc':{'type':Sequelize[_0x4e6c('0x3')](_0x4e6c('0x4'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0x4e6c('0x5')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x4e6c('0x1')]},'substatus':{'type':Sequelize[_0x4e6c('0x2')](0x3c)},'substatusAt':{'type':Sequelize[_0x4e6c('0x1')]},'firstMsgDirection':{'type':Sequelize[_0x4e6c('0x6')]('in',_0x4e6c('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x4e6c('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x4e6c('0x5')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 88b2a79..5d9e34c 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 _0x3f96=['rimraf','zip-dir','moment','bluebird','path','lodash','squel','juice','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','html-entities','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','sendStatus','status','end','json','offset','limit','count','set','Content-Range','update','then','destroy','error','stack','send','Users','map','TagIds','split','forEach','Tags','push','MailMessage','findOne','out','plainBody','-id','lastMsgText','catch','waiting','unmanaged','total','closed','UserId','talking','answered','index','MailInteraction','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','pick','select','field','name','color','from','ui.MailInteractionId','user_has_mail_interactions','u.id\x20=\x20ui.UserId','mail_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','parseSearch','conditions','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression','start','some','compact','MailAccountId','where','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','isEmail','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.closed','i.closedAt','i.lastMsgAt','i.disposition','i.secondDisposition','i.to','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','enableEmailPreview','all','rows','show','params','fields','includeAll','options','find','create','body','describe','addMessage','ids','omit','format','YYYY-MM-DD\x20HH:mm:ss','include','inlineCss','addTags','setTags','spread','findAll','mailInteractionTags:save','removeTags','download','unix','join','root','server','files','attachments','transcript-%d-%s.zip','Attachments','Messages','bcc','subject','each','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','basename','existsSync','readFileSync','build','message%d.eml','eml-format'];(function(_0x4e4c2d,_0x262cbb){var _0x1298b5=function(_0x25eda1){while(--_0x25eda1){_0x4e4c2d['push'](_0x4e4c2d['shift']());}};_0x1298b5(++_0x262cbb);}(_0x3f96,0x1d3));var _0x63f9=function(_0x30ff94,_0x34d0be){_0x30ff94=_0x30ff94-0x0;var _0x8813bf=_0x3f96[_0x30ff94];return _0x8813bf;};'use strict';var emlformat=require(_0x63f9('0x0'));var rimraf=require(_0x63f9('0x1'));var zipdir=require(_0x63f9('0x2'));var moment=require(_0x63f9('0x3'));var BPromise=require(_0x63f9('0x4'));var util=require('util');var path=require(_0x63f9('0x5'));var fs=require('fs');var _=require(_0x63f9('0x6'));var squel=require(_0x63f9('0x7'));var juice=require(_0x63f9('0x8'));var Redis=require(_0x63f9('0x9'));var qs=require('../../components/parsers/qs');var as=require(_0x63f9('0xa'));var logger=require(_0x63f9('0xb'))(_0x63f9('0xc'));var config=require(_0x63f9('0xd'));var db=require('../../mysqldb')['db'];var htmlEntities=require(_0x63f9('0xe'));config[_0x63f9('0xf')]=_[_0x63f9('0x10')](config[_0x63f9('0xf')],{'host':_0x63f9('0x11'),'port':0x18eb});var socket=require(_0x63f9('0x12'))(new Redis(config[_0x63f9('0xf')]));require(_0x63f9('0x13'))['register'](socket);function respondWithStatusCode(_0x3e038d,_0x1216f3){_0x1216f3=_0x1216f3||0xcc;return function(_0x4d2b17){if(_0x4d2b17){return _0x3e038d[_0x63f9('0x14')](_0x1216f3);}return _0x3e038d[_0x63f9('0x15')](_0x1216f3)[_0x63f9('0x16')]();};}function respondWithResult(_0x4a8acc,_0x45881b){_0x45881b=_0x45881b||0xc8;return function(_0x376780){if(_0x376780){return _0x4a8acc[_0x63f9('0x15')](_0x45881b)[_0x63f9('0x17')](_0x376780);}};}function respondWithFilteredResult(_0x10be8f,_0x568e3d){return function(_0x31997c){if(_0x31997c){var _0x51ec79=typeof _0x568e3d[_0x63f9('0x18')]==='undefined'&&typeof _0x568e3d[_0x63f9('0x19')]==='undefined';var _0x47050b=_0x31997c[_0x63f9('0x1a')];var _0x37fc43=_0x51ec79?0x0:_0x568e3d[_0x63f9('0x18')];var _0x100d39=_0x51ec79?_0x31997c[_0x63f9('0x1a')]:_0x568e3d[_0x63f9('0x18')]+_0x568e3d['limit'];var _0xc302eb;if(_0x100d39>=_0x47050b){_0x100d39=_0x47050b;_0xc302eb=0xc8;}else{_0xc302eb=0xce;}_0x10be8f[_0x63f9('0x15')](_0xc302eb);return _0x10be8f[_0x63f9('0x1b')](_0x63f9('0x1c'),_0x37fc43+'-'+_0x100d39+'/'+_0x47050b)[_0x63f9('0x17')](_0x31997c);}return null;};}function saveUpdates(_0x4bf06f){return function(_0x1e309f){if(_0x1e309f){return _0x1e309f[_0x63f9('0x1d')](_0x4bf06f)[_0x63f9('0x1e')](function(_0x4877e1){return _0x4877e1;});}return null;};}function removeEntity(_0x3b85c0){return function(_0x235354){if(_0x235354){return _0x235354[_0x63f9('0x1f')]()[_0x63f9('0x1e')](function(){_0x3b85c0[_0x63f9('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59f437){return function(_0xf74a50){if(!_0xf74a50){_0x59f437[_0x63f9('0x14')](0x194);}return _0xf74a50;};}function handleError(_0x3c0589,_0x39c2d4){_0x39c2d4=_0x39c2d4||0x1f4;return function(_0x390d7e){logger[_0x63f9('0x20')](_0x390d7e[_0x63f9('0x21')]);if(_0x390d7e['name']){delete _0x390d7e['name'];}_0x3c0589[_0x63f9('0x15')](_0x39c2d4)[_0x63f9('0x22')](_0x390d7e);};}function getInteractionUsers(_0x363468,_0x46f335){return new BPromise(function(_0x462fe9,_0x62c363){try{if(_0x46f335[_0x363468['id']]){_0x363468[_0x63f9('0x23')]=_[_0x63f9('0x24')](_0x46f335[_0x363468['id']],function(_0x5637c3){return{'id':_0x5637c3['id'],'fullname':_0x5637c3['fullname']};});}}catch(_0x5cf43d){_0x62c363(_0x5cf43d);}_0x462fe9(_0x363468);});}function getInteractionTags(_0x1fcb7c,_0x2361a9){return new BPromise(function(_0x14d708,_0x4bc6fd){try{if(_0x1fcb7c[_0x63f9('0x25')]){_0x1fcb7c['Tags']=[];_0x1fcb7c[_0x63f9('0x25')][_0x63f9('0x26')](',')[_0x63f9('0x27')](function(_0x51c84b){_0x1fcb7c[_0x63f9('0x28')][_0x63f9('0x29')](_0x2361a9[_0x51c84b]);});}delete _0x1fcb7c[_0x63f9('0x25')];}catch(_0x22a82a){_0x4bc6fd(_0x22a82a);}_0x14d708(_0x1fcb7c);});}function getLastMessageText(_0xbbcd99){return new BPromise(function(_0x921ebf,_0x4817bc){return db[_0x63f9('0x2a')][_0x63f9('0x2b')]({'where':{'$and':[{'MailInteractionId':_0xbbcd99['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x63f9('0x2c')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x63f9('0x2d')],'order':_0x63f9('0x2e'),'raw':!![]})[_0x63f9('0x1e')](function(_0x8a7a85){if(_0x8a7a85&&_0x8a7a85[_0x63f9('0x2d')]){_0xbbcd99[_0x63f9('0x2f')]=_['trimStart'](_0x8a7a85[_0x63f9('0x2d')]);}_0x921ebf(_0xbbcd99);})['catch'](function(_0x419ac8){_0x4817bc(_0x419ac8);});});}function updateMailInteraction(_0xc8819f,_0x522f77,_0x387beb,_0x3937de){return new BPromise(function(_0x5a7d46,_0xc7d23a){return getInteractionUsers(_0xc8819f,_0x387beb)['then'](function(_0x49b25d){return getInteractionTags(_0x49b25d,_0x522f77);})[_0x63f9('0x1e')](function(_0x3d7bd1){return getStateInteraction(_0x3d7bd1);})[_0x63f9('0x1e')](function(_0x5d90ea){if(_0x3937de){_0x5a7d46(getLastMessageText(_0x5d90ea));}else{_0x5a7d46(_0x5d90ea);}})[_0x63f9('0x30')](function(_0x5e5975){_0xc7d23a(_0x5e5975);});});}function getStateInteraction(_0x3841b5){return new BPromise(function(_0x1050d3){_0x3841b5[_0x63f9('0x31')]=0x0;_0x3841b5['talking']=0x0;_0x3841b5['answered']=0x0;_0x3841b5[_0x63f9('0x32')]=0x0;_0x3841b5[_0x63f9('0x33')]=0x0;if(!_0x3841b5[_0x63f9('0x34')]&&!_0x3841b5[_0x63f9('0x35')]){_0x3841b5['waiting']+=0x1;}if(!_0x3841b5[_0x63f9('0x34')]&&_0x3841b5[_0x63f9('0x35')]){_0x3841b5[_0x63f9('0x36')]+=0x1;if(_0x3841b5[_0x63f9('0x31')]){_0x3841b5['waiting']-=0x1;}}if(_0x3841b5[_0x63f9('0x34')]&&_0x3841b5[_0x63f9('0x35')]){_0x3841b5[_0x63f9('0x37')]+=0x1;if(_0x3841b5[_0x63f9('0x36')]){_0x3841b5[_0x63f9('0x36')]-=0x1;}}if(_0x3841b5[_0x63f9('0x34')]&&!_0x3841b5[_0x63f9('0x35')]){_0x3841b5[_0x63f9('0x32')]+=0x1;if(_0x3841b5[_0x63f9('0x31')]){_0x3841b5['waiting']-=0x1;}}_0x3841b5[_0x63f9('0x33')]+=0x1;_0x1050d3(_0x3841b5);});}exports[_0x63f9('0x38')]=function(_0x110aa1,_0x43ad05){var _0x39c6df={},_0x33d96a={},_0x5c78a8={'count':0x0,'rows':[]};var _0x32176a=_[_0x63f9('0x24')](db[_0x63f9('0x39')][_0x63f9('0x3a')],function(_0x35dec0){return{'name':_0x35dec0[_0x63f9('0x3b')],'type':_0x35dec0[_0x63f9('0x3c')][_0x63f9('0x3d')]};});_0x33d96a['model']=_['map'](_0x32176a,'name');_0x33d96a['query']=_[_0x63f9('0x3e')](_0x110aa1[_0x63f9('0x3f')]);_0x33d96a[_0x63f9('0x40')]=_[_0x63f9('0x41')](_0x33d96a[_0x63f9('0x42')],_0x33d96a[_0x63f9('0x3f')]);_0x39c6df[_0x63f9('0x43')]=_[_0x63f9('0x41')](_0x33d96a[_0x63f9('0x42')],qs['fields'](_0x110aa1[_0x63f9('0x3f')]['fields']));_0x39c6df[_0x63f9('0x43')]=_0x39c6df['attributes'][_0x63f9('0x44')]?_0x39c6df[_0x63f9('0x43')]:_0x33d96a[_0x63f9('0x42')];if(!_0x110aa1['query'][_0x63f9('0x45')](_0x63f9('0x46'))){_0x39c6df[_0x63f9('0x19')]=qs['limit'](_0x110aa1['query'][_0x63f9('0x19')]);_0x39c6df[_0x63f9('0x18')]=qs[_0x63f9('0x18')](_0x110aa1[_0x63f9('0x3f')][_0x63f9('0x18')]);}_0x39c6df[_0x63f9('0x47')]=qs['sort'](_0x110aa1[_0x63f9('0x3f')][_0x63f9('0x48')]);_0x39c6df['where']=qs[_0x63f9('0x40')](_[_0x63f9('0x49')](_0x110aa1[_0x63f9('0x3f')],_0x33d96a['filters']),_0x32176a);var _0x585202=[];var _0x2248b6=squel[_0x63f9('0x4a')]()['field']('id')[_0x63f9('0x4b')](_0x63f9('0x4c'))[_0x63f9('0x4b')](_0x63f9('0x4d'))[_0x63f9('0x4e')]('tools_tags');var _0x380ad0=squel[_0x63f9('0x4a')]()[_0x63f9('0x4b')]('u.id')['field']('u.fullname')['field'](_0x63f9('0x4f'))[_0x63f9('0x4e')](_0x63f9('0x50'),'ui')['left_join']('users','u',_0x63f9('0x51'));var _0x15c27b=squel[_0x63f9('0x4a')]()[_0x63f9('0x4e')](_0x63f9('0x52'),'i')[_0x63f9('0x53')](_0x63f9('0x54'),'c',_0x63f9('0x55'))['left_join'](_0x63f9('0x56'),'o',_0x63f9('0x57'))['left_join'](_0x63f9('0x58'),'a',_0x63f9('0x59'))['left_join'](_0x63f9('0x5a'),'me','me.MailInteractionId\x20=\x20i.id')[_0x63f9('0x53')](_0x63f9('0x5b'),'it',_0x63f9('0x5c'))[_0x63f9('0x53')](_0x63f9('0x5d'),'t',_0x63f9('0x5e'));var _0x5704b4=squel[_0x63f9('0x5f')]();var _0x5e859f=[];var _0x7e6f23=squel[_0x63f9('0x5f')]();var _0x4e18e4;if(_0x110aa1[_0x63f9('0x3f')]['search']){_0x4e18e4=as[_0x63f9('0x60')](_0x110aa1[_0x63f9('0x3f')]['search']);var _0x328ccc=_0x4e18e4['sqlOperator'];for(var _0x1cfed=0x0;_0x1cfed<_0x4e18e4[_0x63f9('0x61')]['length'];_0x1cfed++){var _0x2557ac=_0x4e18e4[_0x63f9('0x61')][_0x1cfed];var _0x1906c5='i';var _0x591c80=_['find'](_0x32176a,[_0x63f9('0x4c'),_0x2557ac[_0x63f9('0x4b')]]);if(!_0x591c80){switch(_0x2557ac['field']){case _0x63f9('0x62'):if(_0x2557ac[_0x63f9('0x63')]==0x1){_0x15c27b['having']('`'+_0x2557ac[_0x63f9('0x4b')]+_0x63f9('0x64'));}else{_0x15c27b[_0x63f9('0x65')]('`'+_0x2557ac['field']+_0x63f9('0x66'));}break;case _0x63f9('0x67'):if(_0x2557ac['operator']===_0x63f9('0x68')){if(_0x2557ac['value'][_0x63f9('0x26')]('\x20')['length']>0x1){_0x5704b4[_0x328ccc](_0x63f9('0x69'),qs[_0x63f9('0x6a')](_0x2557ac[_0x63f9('0x63')]),null);}else{var _0x25965d='%'+_0x2557ac[_0x63f9('0x63')]+'%';_0x5704b4[_0x328ccc]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x25965d,_0x25965d,_0x25965d);}}else{_0x591c80=_['find'](_0x32176a,[_0x63f9('0x4c'),_0x63f9('0x6b')]);_0x2557ac[_0x63f9('0x4b')]=_0x63f9('0x6b');_0x3f8f03=as['buildExpression'](_0x1906c5,_0x591c80[_0x63f9('0x3c')],_0x2557ac);_0x5704b4[_0x328ccc](_0x3f8f03[_0x63f9('0x6c')],_0x3f8f03['value']['start'],_0x3f8f03[_0x63f9('0x63')]['end']);}break;case _0x63f9('0x6d'):var _0x3726d0=_0x2557ac[_0x63f9('0x63')]['split'](',')[_0x63f9('0x24')](function(_0x59e104){return Number(_0x59e104);});_0x3726d0[_0x63f9('0x27')](function(_0x4579bf){_0x7e6f23['or'](_0x63f9('0x6e'),'%,'+_0x4579bf+',%');});_0x5e859f=_[_0x63f9('0x6f')](_0x5e859f,_0x3726d0);break;case _0x63f9('0x70'):if(_0x2557ac[_0x63f9('0x71')]===_0x63f9('0x68')){_0x5704b4[_0x328ccc](_0x63f9('0x72'),'%'+_0x2557ac[_0x63f9('0x63')]+'%',null);}else{_0x591c80=_['find'](_0x32176a,[_0x63f9('0x4c'),'UserId']);_0x2557ac[_0x63f9('0x4b')]=_0x63f9('0x35');_0x3f8f03=as[_0x63f9('0x73')](_0x1906c5,_0x591c80[_0x63f9('0x3c')],_0x2557ac);_0x5704b4[_0x328ccc](_0x3f8f03['text'],_0x3f8f03[_0x63f9('0x63')][_0x63f9('0x74')],_0x3f8f03['value'][_0x63f9('0x16')]);}break;case _0x63f9('0x2d'):_0x3f8f03=as[_0x63f9('0x73')]('me',null,_0x2557ac);_0x5704b4[_0x328ccc](_0x3f8f03['text'],_0x3f8f03[_0x63f9('0x63')][_0x63f9('0x74')],_0x3f8f03['value'][_0x63f9('0x16')]);break;}}else{var _0x3f8f03=as[_0x63f9('0x73')](_0x1906c5,_0x591c80[_0x63f9('0x3c')],_0x2557ac);_0x5704b4[_0x328ccc](_0x3f8f03[_0x63f9('0x6c')],_0x3f8f03[_0x63f9('0x63')]['start'],_0x3f8f03[_0x63f9('0x63')]['end']);}}}else{var _0x309c87=_(_0x110aa1[_0x63f9('0x3f')])[_0x63f9('0x3e')]()['map'](function(_0x59d31b){return _[_0x63f9('0x75')](_0x32176a,[_0x63f9('0x4c'),_0x59d31b])?_0x59d31b:undefined;})[_0x63f9('0x76')]()['value']();if(!_['isEmpty'](_0x309c87)){_0x309c87[_0x63f9('0x27')](function(_0x563400){if(_0x563400===_0x63f9('0x77')){_0x15c27b[_0x63f9('0x78')](_0x63f9('0x79'),[][_0x63f9('0x7a')](_0x110aa1[_0x63f9('0x3f')][_0x563400]));}else if(_0x563400===_0x63f9('0x7b')){var _0x43c615=JSON[_0x63f9('0x7c')](_0x110aa1['query'][_0x563400])[_0x63f9('0x7d')];var _0x21a516=JSON[_0x63f9('0x7c')](_0x110aa1[_0x63f9('0x3f')][_0x563400])[_0x63f9('0x7e')];_0x15c27b[_0x63f9('0x78')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x43c615,_0x21a516);}else{if(_0x110aa1[_0x63f9('0x3f')][_0x563400]===_0x63f9('0x7f')){_0x15c27b['where']('i.'+_0x563400+_0x63f9('0x80'));}else{_0x15c27b['where']('i.'+_0x563400+_0x63f9('0x81'),_0x110aa1[_0x63f9('0x3f')][_0x563400]);}}});}if(_0x110aa1[_0x63f9('0x3f')][_0x63f9('0x82')]){if(_0x110aa1[_0x63f9('0x3f')][_0x63f9('0x82')]==0x1){_0x15c27b[_0x63f9('0x65')](_0x63f9('0x83'));}else{_0x15c27b[_0x63f9('0x65')]('`unreadMessages`\x20>\x200');}}if(_0x110aa1[_0x63f9('0x3f')][_0x63f9('0x84')]){_0x5e859f=_['isArray'](_0x110aa1[_0x63f9('0x3f')][_0x63f9('0x84')])?_0x110aa1[_0x63f9('0x3f')][_0x63f9('0x84')]:new Array(_0x110aa1['query'][_0x63f9('0x84')]);_0x5e859f[_0x63f9('0x27')](function(_0x5ea558){_0x7e6f23['or'](_0x63f9('0x6e'),'%,'+_0x5ea558+',%');});}if(_0x110aa1[_0x63f9('0x3f')][_0x63f9('0x85')]){var _0x177b17=_0x110aa1[_0x63f9('0x3f')][_0x63f9('0x85')][_0x63f9('0x86')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x63f9('0x87')](_0x177b17)){_0x5704b4['or'](_0x63f9('0x88'),_0x177b17+'%');}else if(qs[_0x63f9('0x89')](_0x177b17)){_0x5704b4['or']('c.email\x20LIKE\x20?',_0x177b17+'%');}else{_0x5704b4['or'](_0x63f9('0x8a'),qs['getFullTextValue'](_0x177b17))['or'](_0x63f9('0x8b'),qs[_0x63f9('0x6a')](_0x177b17));}}}_0x15c27b[_0x63f9('0x78')](_0x5704b4);_0x15c27b[_0x63f9('0x8c')](_0x63f9('0x8d'));var _0x10362f={'type':db[_0x63f9('0x8e')][_0x63f9('0x8f')][_0x63f9('0x90')],'raw':!![]};var _0x1fde5f=_0x15c27b[_0x63f9('0x91')]();_0x1fde5f[_0x63f9('0x4b')](_0x63f9('0x8d'));_0x1fde5f[_0x63f9('0x4b')](_0x63f9('0x92'),_0x63f9('0x62'));if(_0x39c6df[_0x63f9('0x47')]){_0x39c6df[_0x63f9('0x47')][_0x63f9('0x27')](function(_0x334ff4){var _0x19ef69=_0x334ff4[0x0]==='contactName'?_0x334ff4[0x0]:'i.'+_0x334ff4[0x0];_0x15c27b['order'](_0x19ef69,_0x334ff4[0x1]===_0x63f9('0x93')?![]:!![]);});}if(!_['isEmpty'](_0x5e859f)){_0x15c27b['having'](_0x7e6f23);_0x1fde5f[_0x63f9('0x78')](_0x63f9('0x94'),_0x5e859f);}BPromise[_0x63f9('0x95')]()[_0x63f9('0x1e')](function(){if(!_0x4e18e4){if(_0x110aa1['query'][_0x63f9('0x77')])return;_0x1fde5f[_0x63f9('0x78')](_0x63f9('0x96'));_0x15c27b[_0x63f9('0x78')](_0x63f9('0x96'));return;}if(_0x110aa1[_0x63f9('0x97')][_0x63f9('0x98')]!==_0x63f9('0x99'))return;return _0x110aa1[_0x63f9('0x97')][_0x63f9('0x9a')]({'attributes':['id'],'raw':!![]})[_0x63f9('0x1e')](function(_0x220747){if(_['isEmpty'](_0x220747)){_0x1fde5f[_0x63f9('0x78')](_0x63f9('0x9b'));_0x15c27b[_0x63f9('0x78')](_0x63f9('0x9b'));}else{_0x1fde5f[_0x63f9('0x78')](_0x63f9('0x79'),_[_0x63f9('0x24')](_0x220747,'id'));_0x15c27b[_0x63f9('0x78')](_0x63f9('0x79'),_[_0x63f9('0x24')](_0x220747,'id'));}});})[_0x63f9('0x1e')](function(){if(_0x110aa1[_0x63f9('0x97')][_0x63f9('0x98')]===_0x63f9('0x99')&&!_0x4e18e4&&!_0x110aa1[_0x63f9('0x3f')][_0x63f9('0x77')])return[];return db[_0x63f9('0x9c')][_0x63f9('0x3f')](_0x1fde5f[_0x63f9('0x9d')](),_0x10362f);})[_0x63f9('0x1e')](function(_0x1993cf){_0x5c78a8[_0x63f9('0x1a')]=_0x1993cf[_0x63f9('0x44')];if(_0x5c78a8[_0x63f9('0x1a')]===0x0)return[];return db[_0x63f9('0x9c')][_0x63f9('0x3f')](_0x2248b6[_0x63f9('0x9d')](),_0x10362f)[_0x63f9('0x1e')](function(_0x24f445){_0x585202=_[_0x63f9('0x9e')](_0x24f445,'id');_0x10362f=_[_0x63f9('0x9f')](_0x10362f,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x110aa1['query']['fields']){_0x39c6df[_0x63f9('0x43')][_0x63f9('0x27')](function(_0x7641b1){_0x15c27b['field']('i.'+_0x7641b1);});}else{_0x15c27b[_0x63f9('0x4b')](_0x63f9('0x92'),'unreadMessages');_0x15c27b[_0x63f9('0x4b')](_0x63f9('0xa0'),_0x63f9('0xa1'));_0x15c27b[_0x63f9('0x4b')]('a.mandatoryDisposition',_0x63f9('0xa2'));_0x15c27b[_0x63f9('0x4b')](_0x63f9('0xa3'),'contactName');_0x15c27b['field'](_0x63f9('0x8d'));_0x15c27b[_0x63f9('0x4b')]('i.createdAt');_0x15c27b[_0x63f9('0x4b')]('i.updatedAt');_0x15c27b[_0x63f9('0x4b')](_0x63f9('0xa4'));_0x15c27b[_0x63f9('0x4b')](_0x63f9('0xa5'));_0x15c27b[_0x63f9('0x4b')]('i.attach');_0x15c27b[_0x63f9('0x4b')](_0x63f9('0xa6'));_0x15c27b[_0x63f9('0x4b')]('i.lastMsgDirection');_0x15c27b[_0x63f9('0x4b')]('i.subject');_0x15c27b['field'](_0x63f9('0xa7'));_0x15c27b[_0x63f9('0x4b')](_0x63f9('0xa8'));_0x15c27b['field']('i.thirdDisposition');_0x15c27b[_0x63f9('0x4b')]('i.substatus');_0x15c27b[_0x63f9('0x4b')](_0x63f9('0xa9'));_0x15c27b[_0x63f9('0x4b')]('i.ContactId');_0x15c27b['field'](_0x63f9('0xaa'));_0x15c27b[_0x63f9('0x4b')](_0x63f9('0xab'));_0x15c27b['field'](_0x63f9('0xac'),_0x63f9('0xad'));_0x15c27b['field']('c.lastName','Contact.lastName');_0x15c27b['field']('c.email',_0x63f9('0xae'));_0x15c27b[_0x63f9('0x4b')](_0x63f9('0xaf'),_0x63f9('0xb0'));_0x15c27b[_0x63f9('0x4b')]('c.mobile',_0x63f9('0xb1'));_0x15c27b['field'](_0x63f9('0xb2'),'Contact.fax');_0x15c27b['field'](_0x63f9('0xb3'),_0x63f9('0xb4'));_0x15c27b['field'](_0x63f9('0xb5'),_0x63f9('0xb6'));_0x15c27b[_0x63f9('0x4b')](_0x63f9('0xb7'),_0x63f9('0x25'));}if(_0x39c6df[_0x63f9('0x19')])_0x15c27b[_0x63f9('0x19')](_0x39c6df[_0x63f9('0x19')]);if(_0x39c6df[_0x63f9('0x18')])_0x15c27b[_0x63f9('0x18')](_0x39c6df['offset']);return db[_0x63f9('0x9c')]['query'](_0x15c27b[_0x63f9('0x9d')](),_0x10362f);})['then'](function(_0x2f36e1){if(_0x2f36e1[_0x63f9('0x44')]>0x0)_0x380ad0['where'](_0x63f9('0xb8'),_['map'](_0x2f36e1,'id'));return db[_0x63f9('0x9c')]['query'](_0x380ad0[_0x63f9('0x9d')](),_0x10362f)['then'](function(_0x2d7e9c){var _0x5ee759=_[_0x63f9('0xb9')](_0x2d7e9c,_0x63f9('0xba'));var _0x37d73c=[];return db[_0x63f9('0xbb')][_0x63f9('0x2b')]({'attributes':['enableEmailPreview'],'raw':!![]})[_0x63f9('0x1e')](function(_0x45a7de){var _0x45e924=_0x45a7de[_0x63f9('0xbc')];_0x2f36e1[_0x63f9('0x27')](function(_0x244015){_0x37d73c[_0x63f9('0x29')](updateMailInteraction(_0x244015,_0x585202,_0x5ee759,_0x45e924));});return BPromise[_0x63f9('0xbd')](_0x37d73c);});});});})[_0x63f9('0x1e')](function(_0x5b67e0){_0x5c78a8[_0x63f9('0xbe')]=_0x5b67e0;return _0x5c78a8;})[_0x63f9('0x1e')](respondWithFilteredResult(_0x43ad05,_0x39c6df))[_0x63f9('0x30')](handleError(_0x43ad05,null));};exports[_0x63f9('0xbf')]=function(_0x3505ab,_0x1b209c){var _0x4a82e6={'raw':![],'where':{'id':_0x3505ab[_0x63f9('0xc0')]['id']}},_0x43972d={};_0x43972d[_0x63f9('0x42')]=_[_0x63f9('0x3e')](db[_0x63f9('0x39')][_0x63f9('0x3a')]);_0x43972d[_0x63f9('0x3f')]=_[_0x63f9('0x3e')](_0x3505ab[_0x63f9('0x3f')]);_0x43972d[_0x63f9('0x40')]=_['intersection'](_0x43972d[_0x63f9('0x42')],_0x43972d[_0x63f9('0x3f')]);_0x4a82e6['attributes']=_[_0x63f9('0x41')](_0x43972d[_0x63f9('0x42')],qs[_0x63f9('0xc1')](_0x3505ab['query'][_0x63f9('0xc1')]));_0x4a82e6[_0x63f9('0x43')]=_0x4a82e6[_0x63f9('0x43')][_0x63f9('0x44')]?_0x4a82e6[_0x63f9('0x43')]:_0x43972d[_0x63f9('0x42')];if(_0x3505ab[_0x63f9('0x3f')][_0x63f9('0xc2')]){_0x4a82e6['include']=[{'all':!![]}];}_0x4a82e6=_[_0x63f9('0x9f')]({},_0x4a82e6,_0x3505ab[_0x63f9('0xc3')]);return db[_0x63f9('0x39')][_0x63f9('0xc4')](_0x4a82e6)[_0x63f9('0x1e')](handleEntityNotFound(_0x1b209c,null))[_0x63f9('0x1e')](respondWithResult(_0x1b209c,null))['catch'](handleError(_0x1b209c,null));};exports['create']=function(_0x5adc02,_0x2030b4){return db[_0x63f9('0x39')][_0x63f9('0xc5')](_0x5adc02['body'],{})[_0x63f9('0x1e')](respondWithResult(_0x2030b4,0xc9))[_0x63f9('0x30')](handleError(_0x2030b4,null));};exports[_0x63f9('0x1d')]=function(_0x2a3bed,_0x118314){if(_0x2a3bed['body']['id']){delete _0x2a3bed[_0x63f9('0xc6')]['id'];}return db[_0x63f9('0x39')][_0x63f9('0xc4')]({'where':{'id':_0x2a3bed[_0x63f9('0xc0')]['id']}})[_0x63f9('0x1e')](handleEntityNotFound(_0x118314,null))[_0x63f9('0x1e')](saveUpdates(_0x2a3bed[_0x63f9('0xc6')],null))[_0x63f9('0x1e')](respondWithResult(_0x118314,null))[_0x63f9('0x30')](handleError(_0x118314,null));};exports['destroy']=function(_0x121cad,_0x4c158a){return db[_0x63f9('0x39')][_0x63f9('0xc4')]({'where':{'id':_0x121cad[_0x63f9('0xc0')]['id']}})[_0x63f9('0x1e')](handleEntityNotFound(_0x4c158a,null))[_0x63f9('0x1e')](removeEntity(_0x4c158a,null))[_0x63f9('0x30')](handleError(_0x4c158a,null));};exports[_0x63f9('0xc7')]=function(_0x594f14,_0x1c890b){return db['MailInteraction'][_0x63f9('0xc7')]()[_0x63f9('0x1e')](respondWithResult(_0x1c890b,null))['catch'](handleError(_0x1c890b,null));};exports[_0x63f9('0xc8')]=function(_0x2bf15e,_0x744329){return db['MailMessage'][_0x63f9('0xc4')]({'where':{'id':_0x2bf15e[_0x63f9('0xc0')]['id']}})[_0x63f9('0x1e')](handleEntityNotFound(_0x744329,null))[_0x63f9('0x1e')](function(_0x2ae25e){if(_0x2ae25e){return _0x2ae25e['addMessage'](_0x2bf15e['body'][_0x63f9('0xc9')],_[_0x63f9('0xca')](_0x2bf15e[_0x63f9('0xc6')],[_0x63f9('0xc9'),'id'])||{});}})[_0x63f9('0x1e')](respondWithResult(_0x744329,null))[_0x63f9('0x30')](handleError(_0x744329,null));};exports['getMessages']=function(_0x14b97d,_0x84f4a5){var _0x1c6167={'raw':![],'where':{}};var _0x165563={};var _0x5f3965={'count':0x0,'rows':[]};return db['MailInteraction'][_0x63f9('0x2b')]({'where':{'id':_0x14b97d['params']['id']}})[_0x63f9('0x1e')](handleEntityNotFound(_0x84f4a5,null))[_0x63f9('0x1e')](function(_0x179e3c){if(_0x179e3c){_0x165563[_0x63f9('0x42')]=_[_0x63f9('0x3e')](db[_0x63f9('0x2a')]['rawAttributes']);_0x165563[_0x63f9('0x3f')]=_[_0x63f9('0x3e')](_0x14b97d[_0x63f9('0x3f')]);_0x165563['filters']=_['intersection'](_0x165563[_0x63f9('0x42')],_0x165563['query']);_0x1c6167[_0x63f9('0x43')]=_[_0x63f9('0x41')](_0x165563['model'],qs[_0x63f9('0xc1')](_0x14b97d['query']['fields']));_0x1c6167[_0x63f9('0x43')]=_0x1c6167[_0x63f9('0x43')][_0x63f9('0x44')]?_0x1c6167[_0x63f9('0x43')]:_0x165563[_0x63f9('0x42')];if(!_0x14b97d[_0x63f9('0x3f')][_0x63f9('0x45')](_0x63f9('0x46'))){_0x1c6167[_0x63f9('0x19')]=qs[_0x63f9('0x19')](_0x14b97d[_0x63f9('0x3f')]['limit']);_0x1c6167[_0x63f9('0x18')]=qs[_0x63f9('0x18')](_0x14b97d[_0x63f9('0x3f')][_0x63f9('0x18')]);}_0x1c6167[_0x63f9('0x47')]=qs[_0x63f9('0x48')](_0x14b97d[_0x63f9('0x3f')][_0x63f9('0x48')]);_0x1c6167['where']=qs[_0x63f9('0x40')](_['pick'](_0x14b97d[_0x63f9('0x3f')],_0x165563[_0x63f9('0x40')]));_0x1c6167['where'][_0x63f9('0xba')]=_0x179e3c['id'];if(_0x14b97d[_0x63f9('0x3f')][_0x63f9('0x85')]){_0x1c6167[_0x63f9('0x78')]=_[_0x63f9('0x9f')](_0x1c6167[_0x63f9('0x78')],{'$or':_[_0x63f9('0x24')](_0x1c6167[_0x63f9('0x43')],function(_0x51d1a2){var _0x33a960={};_0x33a960[_0x51d1a2]={'$like':'%'+_0x14b97d[_0x63f9('0x3f')]['filter']+'%'};return _0x33a960;})});}if(_0x14b97d[_0x63f9('0x3f')]['$gte']){var _0x29e4a8=_0x14b97d[_0x63f9('0x3f')][_0x63f9('0x7d')]['split'](',');var _0x2992af={};_0x2992af[_0x29e4a8[0x0]]={'$gte':moment(_0x29e4a8[0x1])[_0x63f9('0xcb')](_0x63f9('0xcc'))};_0x1c6167[_0x63f9('0x78')]=_[_0x63f9('0x9f')](_0x1c6167[_0x63f9('0x78')],_0x2992af);}_0x1c6167=_[_0x63f9('0x9f')]({},_0x1c6167,_0x14b97d['options']);return db[_0x63f9('0x2a')]['count']({'where':_0x1c6167[_0x63f9('0x78')]})[_0x63f9('0x1e')](function(_0x11f33b){_0x5f3965[_0x63f9('0x1a')]=_0x11f33b;if(_0x14b97d[_0x63f9('0x3f')]['includeAll']){_0x1c6167[_0x63f9('0xcd')]=[{'all':!![]}];}return db[_0x63f9('0x2a')]['findAll'](_0x1c6167);})[_0x63f9('0x1e')](function(_0x98f877){if(_0x14b97d[_0x63f9('0x3f')][_0x63f9('0xce')]==='true'){for(var _0x2b9b2c=0x0;_0x2b9b2c<_0x98f877[_0x63f9('0x44')];_0x2b9b2c++){_0x98f877[_0x2b9b2c][_0x63f9('0xc6')]=juice(_0x98f877[_0x2b9b2c][_0x63f9('0xc6')]);}}_0x5f3965['rows']=_0x98f877;return _0x5f3965;});}})[_0x63f9('0x1e')](respondWithFilteredResult(_0x84f4a5,_0x1c6167))[_0x63f9('0x30')](handleError(_0x84f4a5,null));};exports[_0x63f9('0xcf')]=function(_0x41a189,_0x4f065c){return db[_0x63f9('0x39')][_0x63f9('0xc4')]({'where':{'id':_0x41a189[_0x63f9('0xc0')]['id']}})[_0x63f9('0x1e')](handleEntityNotFound(_0x4f065c,null))[_0x63f9('0x1e')](function(_0x298941){if(_0x298941){return _0x298941[_0x63f9('0xd0')](_0x41a189['body'][_0x63f9('0xc9')],_[_0x63f9('0xca')](_0x41a189[_0x63f9('0xc6')],[_0x63f9('0xc9'),'id'])||{})[_0x63f9('0xd1')](function(){return db[_0x63f9('0x6d')][_0x63f9('0xd2')]({'attributes':['id',_0x63f9('0x4c'),'color'],'where':{'id':_0x41a189['body'][_0x63f9('0xc9')]}});})[_0x63f9('0x1e')](function(_0x4b5fa1){socket['emit'](_0x63f9('0xd3'),{'id':Number(_0x41a189[_0x63f9('0xc0')]['id']),'tags':_0x4b5fa1||[]});return{'id':Number(_0x41a189[_0x63f9('0xc0')]['id']),'tags':_0x4b5fa1||[]};});}})['then'](respondWithResult(_0x4f065c,null))[_0x63f9('0x30')](handleError(_0x4f065c,null));};exports[_0x63f9('0xd4')]=function(_0x18fd60,_0xf0c96d){return db[_0x63f9('0x39')][_0x63f9('0xc4')]({'where':{'id':_0x18fd60[_0x63f9('0xc0')]['id']}})[_0x63f9('0x1e')](handleEntityNotFound(_0xf0c96d,null))[_0x63f9('0x1e')](function(_0x3309e1){if(_0x3309e1){return _0x3309e1[_0x63f9('0xd4')](_0x18fd60[_0x63f9('0x3f')][_0x63f9('0xc9')]);}})[_0x63f9('0x1e')](respondWithStatusCode(_0xf0c96d,null))['catch'](handleError(_0xf0c96d,null));};exports[_0x63f9('0xd5')]=function(_0x2ceabe,_0x42cada){var _0x2f98f7=moment()[_0x63f9('0xd6')]()[_0x63f9('0x9d')]();var _0x3193c2=path[_0x63f9('0xd7')](config[_0x63f9('0xd8')],_0x63f9('0xd9'),_0x63f9('0xda'),'tmp');var _0x565d2a=path['join'](config[_0x63f9('0xd8')],_0x63f9('0xd9'),_0x63f9('0xda'),_0x63f9('0xdb'));var _0x2f269a=path[_0x63f9('0xd7')](_0x3193c2,_0x2f98f7);var _0x5cab8d=util[_0x63f9('0xcb')](_0x63f9('0xdc'),_0x2ceabe[_0x63f9('0xc0')]['id'],_0x2f98f7);var _0x5725a4=path[_0x63f9('0xd7')](_0x3193c2,_0x5cab8d);var _0x50973c=[];if(_0x2ceabe['query']['attachments']){_0x50973c[_0x63f9('0x29')]({'model':db['Attachment'],'as':_0x63f9('0xdd'),'raw':!![]});}var _0x4a9c38=[{'model':db[_0x63f9('0x2a')],'as':_0x63f9('0xde'),'attributes':['id',_0x63f9('0xc6'),_0x63f9('0x4e'),'to','cc',_0x63f9('0xdf'),_0x63f9('0xe0'),'createdAt'],'where':{'secret':![]},'order':qs[_0x63f9('0x48')]('id'),'include':_0x50973c}];return db[_0x63f9('0x39')]['find']({'where':{'id':_0x2ceabe[_0x63f9('0xc0')]['id']},'include':_0x4a9c38})[_0x63f9('0x1e')](handleEntityNotFound(_0x42cada,null))['then'](function(_0x15e51b){if(_0x15e51b&&_0x15e51b[_0x63f9('0xde')]){var _0x2631ad=_0x15e51b['get']({'plain':!![]});fs['mkdirSync'](_0x2f269a);return BPromise[_0x63f9('0xe1')](_0x2631ad[_0x63f9('0xde')],function(_0x14a825,_0x5e63e8){var _0x22ea6d={'from':_0x14a825['from'],'to':_0x14a825['to'],'subject':_0x14a825[_0x63f9('0xe0')],'html':htmlEntities[_0x63f9('0xe2')](_0x14a825[_0x63f9('0xc6')]),'headers':{'Date':moment(_0x14a825[_0x63f9('0x7b')])[_0x63f9('0xcb')](_0x63f9('0xe3'))},'attachments':[]};if(_0x14a825['cc']){_0x22ea6d[_0x63f9('0xe4')]['Cc']=_0x14a825['cc'];}if(_0x14a825[_0x63f9('0xdf')]){_0x22ea6d[_0x63f9('0xe4')]['Bcc']=_0x14a825[_0x63f9('0xdf')];}return new BPromise(function(_0x21edd2,_0x30c92b){if(_0x14a825[_0x63f9('0xdd')]){for(var _0x4cd6a6=0x0;_0x4cd6a6<_0x14a825[_0x63f9('0xdd')][_0x63f9('0x44')];_0x4cd6a6++){var _0x556297=_0x14a825[_0x63f9('0xdd')][_0x4cd6a6];var _0x5d0951=path[_0x63f9('0xd7')](_0x565d2a,_0x556297[_0x63f9('0xe5')]);if(fs[_0x63f9('0xe6')](_0x5d0951)){_0x22ea6d['attachments'][_0x63f9('0x29')]({'name':_0x556297[_0x63f9('0x4c')],'contentType':_0x556297[_0x63f9('0x3c')],'data':fs[_0x63f9('0xe7')](_0x5d0951)});}}}emlformat[_0x63f9('0xe8')](_0x22ea6d,function(_0x3cef5b,_0x3f5ebd){if(_0x3cef5b)return _0x30c92b(_0x3cef5b);fs['writeFileSync'](path['join'](_0x2f269a,util[_0x63f9('0xcb')](_0x63f9('0xe9'),_0x5e63e8)),_0x3f5ebd);return _0x21edd2(_0x3f5ebd);});});})[_0x63f9('0x1e')](function(){return new BPromise(function(_0x386c2c,_0x499317){zipdir(_0x2f269a,{'saveTo':_0x5725a4},function(_0x47c65c,_0x4e63ad){if(_0x47c65c)return _0x499317(_0x47c65c);return _0x386c2c(_0x4e63ad);});})[_0x63f9('0x1e')](function(){return new BPromise(function(_0x5970c1,_0x54d20a){rimraf(_0x2f269a,function(_0x44cabb){if(_0x44cabb)_0x54d20a(_0x44cabb);return _0x5970c1();});});})[_0x63f9('0x1e')](function(){return _0x42cada[_0x63f9('0xd5')](_0x5725a4,_0x5cab8d,function(_0x14d403){if(!_0x14d403)fs['unlinkSync'](_0x5725a4);});});});}else{return _0x42cada[_0x63f9('0x14')](0xc8);}})[_0x63f9('0x30')](handleError(_0x42cada,null));}; \ No newline at end of file +var _0xe3da=['rimraf','zip-dir','moment','bluebird','util','path','lodash','squel','juice','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','html-entities','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','status','end','json','offset','limit','undefined','count','set','update','then','sendStatus','error','stack','name','send','Users','fullname','TagIds','split','forEach','Tags','MailMessage','findOne','out','plainBody','lastMsgText','trimStart','catch','waiting','talking','unmanaged','closed','UserId','answered','total','index','MailInteraction','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','select','field','color','from','tools_tags','u.fullname','ui.MailInteractionId','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','expr','search','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','find','ContactId','buildExpression','text','start','Tag','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','type','some','compact','isEmpty','where','i.MailAccountId\x20IN\x20?','parse','$gte','$lte','null','\x20=\x20?','`unreadMessages`\x20=\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','i.id\x20LIKE\x20?','isEmail','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','resolve','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','map','sequelize','toString','merge','Account.key','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.createdAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.subject','i.thirdDisposition','i.ContactId','i.MailAccountId','i.UserId','c.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','Setting','enableEmailPreview','push','all','rows','params','includeAll','options','create','body','destroy','describe','ids','hasOwnProperty','nolimit','pick','MailInteractionId','format','include','findAll','inlineCss','true','addTags','omit','spread','emit','mailInteractionTags:save','removeTags','download','join','server','files','tmp','root','attachments','transcript-%d-%s.zip','Attachment','Attachments','createdAt','Messages','get','each','subject','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','basename','existsSync','readFileSync','build','writeFileSync','unlinkSync','eml-format'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xe3da,0x1cd));var _0xae3d=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xe3da[_0x19950b];return _0x3c6b41;};'use strict';var emlformat=require(_0xae3d('0x0'));var rimraf=require(_0xae3d('0x1'));var zipdir=require(_0xae3d('0x2'));var moment=require(_0xae3d('0x3'));var BPromise=require(_0xae3d('0x4'));var util=require(_0xae3d('0x5'));var path=require(_0xae3d('0x6'));var fs=require('fs');var _=require(_0xae3d('0x7'));var squel=require(_0xae3d('0x8'));var juice=require(_0xae3d('0x9'));var Redis=require(_0xae3d('0xa'));var qs=require(_0xae3d('0xb'));var as=require(_0xae3d('0xc'));var logger=require(_0xae3d('0xd'))(_0xae3d('0xe'));var config=require(_0xae3d('0xf'));var db=require('../../mysqldb')['db'];var htmlEntities=require(_0xae3d('0x10'));config[_0xae3d('0x11')]=_['defaults'](config['redis'],{'host':_0xae3d('0x12'),'port':0x18eb});var socket=require(_0xae3d('0x13'))(new Redis(config[_0xae3d('0x11')]));require(_0xae3d('0x14'))[_0xae3d('0x15')](socket);function respondWithStatusCode(_0x15d6da,_0x4bd4ec){_0x4bd4ec=_0x4bd4ec||0xcc;return function(_0x145762){if(_0x145762){return _0x15d6da['sendStatus'](_0x4bd4ec);}return _0x15d6da[_0xae3d('0x16')](_0x4bd4ec)[_0xae3d('0x17')]();};}function respondWithResult(_0x7770eb,_0x172f7a){_0x172f7a=_0x172f7a||0xc8;return function(_0x48aa74){if(_0x48aa74){return _0x7770eb[_0xae3d('0x16')](_0x172f7a)[_0xae3d('0x18')](_0x48aa74);}};}function respondWithFilteredResult(_0x16fd19,_0x1605ac){return function(_0x2afdd3){if(_0x2afdd3){var _0x430659=typeof _0x1605ac[_0xae3d('0x19')]==='undefined'&&typeof _0x1605ac[_0xae3d('0x1a')]===_0xae3d('0x1b');var _0x46295b=_0x2afdd3[_0xae3d('0x1c')];var _0x192c13=_0x430659?0x0:_0x1605ac[_0xae3d('0x19')];var _0x585160=_0x430659?_0x2afdd3[_0xae3d('0x1c')]:_0x1605ac[_0xae3d('0x19')]+_0x1605ac[_0xae3d('0x1a')];var _0x5303c2;if(_0x585160>=_0x46295b){_0x585160=_0x46295b;_0x5303c2=0xc8;}else{_0x5303c2=0xce;}_0x16fd19[_0xae3d('0x16')](_0x5303c2);return _0x16fd19[_0xae3d('0x1d')]('Content-Range',_0x192c13+'-'+_0x585160+'/'+_0x46295b)['json'](_0x2afdd3);}return null;};}function saveUpdates(_0x8a37cc){return function(_0x46a6d7){if(_0x46a6d7){return _0x46a6d7[_0xae3d('0x1e')](_0x8a37cc)[_0xae3d('0x1f')](function(_0x39828a){return _0x39828a;});}return null;};}function removeEntity(_0x577f62){return function(_0x121024){if(_0x121024){return _0x121024['destroy']()[_0xae3d('0x1f')](function(){_0x577f62[_0xae3d('0x16')](0xcc)[_0xae3d('0x17')]();});}};}function handleEntityNotFound(_0x263b0e){return function(_0x1facc1){if(!_0x1facc1){_0x263b0e[_0xae3d('0x20')](0x194);}return _0x1facc1;};}function handleError(_0x26c419,_0x155099){_0x155099=_0x155099||0x1f4;return function(_0x3224ff){logger[_0xae3d('0x21')](_0x3224ff[_0xae3d('0x22')]);if(_0x3224ff[_0xae3d('0x23')]){delete _0x3224ff[_0xae3d('0x23')];}_0x26c419[_0xae3d('0x16')](_0x155099)[_0xae3d('0x24')](_0x3224ff);};}function getInteractionUsers(_0x1fe90f,_0xfb54f6){return new BPromise(function(_0x21b608,_0x2131e9){try{if(_0xfb54f6[_0x1fe90f['id']]){_0x1fe90f[_0xae3d('0x25')]=_['map'](_0xfb54f6[_0x1fe90f['id']],function(_0x16c014){return{'id':_0x16c014['id'],'fullname':_0x16c014[_0xae3d('0x26')]};});}}catch(_0xb5940){_0x2131e9(_0xb5940);}_0x21b608(_0x1fe90f);});}function getInteractionTags(_0x52df0f,_0x256bd0){return new BPromise(function(_0x4391db,_0x8de288){try{if(_0x52df0f['TagIds']){_0x52df0f['Tags']=[];_0x52df0f[_0xae3d('0x27')][_0xae3d('0x28')](',')[_0xae3d('0x29')](function(_0x3114f9){_0x52df0f[_0xae3d('0x2a')]['push'](_0x256bd0[_0x3114f9]);});}delete _0x52df0f[_0xae3d('0x27')];}catch(_0x3a2434){_0x8de288(_0x3a2434);}_0x4391db(_0x52df0f);});}function getLastMessageText(_0x5a39c5){return new BPromise(function(_0x5c155e,_0x323715){return db[_0xae3d('0x2b')][_0xae3d('0x2c')]({'where':{'$and':[{'MailInteractionId':_0x5a39c5['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xae3d('0x2d')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xae3d('0x2e')],'order':'-id','raw':!![]})['then'](function(_0x5bd5bb){if(_0x5bd5bb&&_0x5bd5bb[_0xae3d('0x2e')]){_0x5a39c5[_0xae3d('0x2f')]=_[_0xae3d('0x30')](_0x5bd5bb[_0xae3d('0x2e')]);}_0x5c155e(_0x5a39c5);})['catch'](function(_0x31af1b){_0x323715(_0x31af1b);});});}function updateMailInteraction(_0x276183,_0x10ccd4,_0x3748d2,_0x422437){return new BPromise(function(_0x166631,_0x2dabb4){return getInteractionUsers(_0x276183,_0x3748d2)['then'](function(_0x8827c3){return getInteractionTags(_0x8827c3,_0x10ccd4);})['then'](function(_0x55aae4){return getStateInteraction(_0x55aae4);})[_0xae3d('0x1f')](function(_0x4cfe71){if(_0x422437){_0x166631(getLastMessageText(_0x4cfe71));}else{_0x166631(_0x4cfe71);}})[_0xae3d('0x31')](function(_0x4b79ed){_0x2dabb4(_0x4b79ed);});});}function getStateInteraction(_0x59425f){return new BPromise(function(_0x1a28b5){_0x59425f[_0xae3d('0x32')]=0x0;_0x59425f[_0xae3d('0x33')]=0x0;_0x59425f['answered']=0x0;_0x59425f[_0xae3d('0x34')]=0x0;_0x59425f['total']=0x0;if(!_0x59425f[_0xae3d('0x35')]&&!_0x59425f[_0xae3d('0x36')]){_0x59425f[_0xae3d('0x32')]+=0x1;}if(!_0x59425f[_0xae3d('0x35')]&&_0x59425f[_0xae3d('0x36')]){_0x59425f[_0xae3d('0x33')]+=0x1;if(_0x59425f[_0xae3d('0x32')]){_0x59425f[_0xae3d('0x32')]-=0x1;}}if(_0x59425f[_0xae3d('0x35')]&&_0x59425f[_0xae3d('0x36')]){_0x59425f[_0xae3d('0x37')]+=0x1;if(_0x59425f['talking']){_0x59425f['talking']-=0x1;}}if(_0x59425f[_0xae3d('0x35')]&&!_0x59425f['UserId']){_0x59425f[_0xae3d('0x34')]+=0x1;if(_0x59425f[_0xae3d('0x32')]){_0x59425f[_0xae3d('0x32')]-=0x1;}}_0x59425f[_0xae3d('0x38')]+=0x1;_0x1a28b5(_0x59425f);});}exports[_0xae3d('0x39')]=function(_0x35db44,_0x238e65){var _0x15350d={},_0x26de54={},_0xd8cd66={'count':0x0,'rows':[]};var _0x1de8da=_['map'](db[_0xae3d('0x3a')][_0xae3d('0x3b')],function(_0xb82d5d){return{'name':_0xb82d5d['fieldName'],'type':_0xb82d5d['type'][_0xae3d('0x3c')]};});_0x26de54[_0xae3d('0x3d')]=_['map'](_0x1de8da,_0xae3d('0x23'));_0x26de54[_0xae3d('0x3e')]=_[_0xae3d('0x3f')](_0x35db44[_0xae3d('0x3e')]);_0x26de54[_0xae3d('0x40')]=_[_0xae3d('0x41')](_0x26de54['model'],_0x26de54[_0xae3d('0x3e')]);_0x15350d[_0xae3d('0x42')]=_[_0xae3d('0x41')](_0x26de54[_0xae3d('0x3d')],qs[_0xae3d('0x43')](_0x35db44['query'][_0xae3d('0x43')]));_0x15350d['attributes']=_0x15350d[_0xae3d('0x42')][_0xae3d('0x44')]?_0x15350d[_0xae3d('0x42')]:_0x26de54[_0xae3d('0x3d')];if(!_0x35db44['query']['hasOwnProperty']('nolimit')){_0x15350d[_0xae3d('0x1a')]=qs[_0xae3d('0x1a')](_0x35db44['query']['limit']);_0x15350d['offset']=qs[_0xae3d('0x19')](_0x35db44[_0xae3d('0x3e')][_0xae3d('0x19')]);}_0x15350d[_0xae3d('0x45')]=qs[_0xae3d('0x46')](_0x35db44[_0xae3d('0x3e')][_0xae3d('0x46')]);_0x15350d['where']=qs['filters'](_['pick'](_0x35db44[_0xae3d('0x3e')],_0x26de54['filters']),_0x1de8da);var _0x2a3f95=[];var _0x14fad3=squel[_0xae3d('0x47')]()[_0xae3d('0x48')]('id')[_0xae3d('0x48')](_0xae3d('0x23'))[_0xae3d('0x48')](_0xae3d('0x49'))[_0xae3d('0x4a')](_0xae3d('0x4b'));var _0x49b8df=squel['select']()['field']('u.id')[_0xae3d('0x48')](_0xae3d('0x4c'))[_0xae3d('0x48')](_0xae3d('0x4d'))['from']('user_has_mail_interactions','ui')[_0xae3d('0x4e')](_0xae3d('0x4f'),'u',_0xae3d('0x50'));var _0x247a37=squel['select']()[_0xae3d('0x4a')](_0xae3d('0x51'),'i')[_0xae3d('0x4e')](_0xae3d('0x52'),'c',_0xae3d('0x53'))[_0xae3d('0x4e')](_0xae3d('0x4f'),'o',_0xae3d('0x54'))[_0xae3d('0x4e')](_0xae3d('0x55'),'a',_0xae3d('0x56'))[_0xae3d('0x4e')]('mail_messages','me','me.MailInteractionId\x20=\x20i.id')['left_join'](_0xae3d('0x57'),'it',_0xae3d('0x58'))['left_join'](_0xae3d('0x4b'),'t','t.id\x20=\x20it.TagId');var _0x5d2bcc=squel[_0xae3d('0x59')]();var _0x194f7c=[];var _0x440ae6=squel[_0xae3d('0x59')]();var _0x1478aa;if(_0x35db44[_0xae3d('0x3e')][_0xae3d('0x5a')]){_0x1478aa=as['parseSearch'](_0x35db44[_0xae3d('0x3e')][_0xae3d('0x5a')]);var _0x24fa2a=_0x1478aa[_0xae3d('0x5b')];for(var _0x486682=0x0;_0x486682<_0x1478aa[_0xae3d('0x5c')][_0xae3d('0x44')];_0x486682++){var _0x5d2340=_0x1478aa[_0xae3d('0x5c')][_0x486682];var _0x5b511f='i';var _0x5279a0=_['find'](_0x1de8da,[_0xae3d('0x23'),_0x5d2340['field']]);if(!_0x5279a0){switch(_0x5d2340['field']){case _0xae3d('0x5d'):if(_0x5d2340[_0xae3d('0x5e')]==0x1){_0x247a37[_0xae3d('0x5f')]('`'+_0x5d2340[_0xae3d('0x48')]+_0xae3d('0x60'));}else{_0x247a37[_0xae3d('0x5f')]('`'+_0x5d2340['field']+_0xae3d('0x61'));}break;case _0xae3d('0x62'):if(_0x5d2340[_0xae3d('0x63')]===_0xae3d('0x64')){if(_0x5d2340[_0xae3d('0x5e')][_0xae3d('0x28')]('\x20')['length']>0x1){_0x5d2bcc[_0x24fa2a](_0xae3d('0x65'),qs[_0xae3d('0x66')](_0x5d2340[_0xae3d('0x5e')]),null);}else{var _0x4d4c6e='%'+_0x5d2340['value']+'%';_0x5d2bcc[_0x24fa2a]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x4d4c6e,_0x4d4c6e,_0x4d4c6e);}}else{_0x5279a0=_[_0xae3d('0x67')](_0x1de8da,[_0xae3d('0x23'),'ContactId']);_0x5d2340[_0xae3d('0x48')]=_0xae3d('0x68');_0x2dba59=as[_0xae3d('0x69')](_0x5b511f,_0x5279a0['type'],_0x5d2340);_0x5d2bcc[_0x24fa2a](_0x2dba59[_0xae3d('0x6a')],_0x2dba59[_0xae3d('0x5e')][_0xae3d('0x6b')],_0x2dba59[_0xae3d('0x5e')][_0xae3d('0x17')]);}break;case _0xae3d('0x6c'):var _0x39dff1=_0x5d2340[_0xae3d('0x5e')]['split'](',')['map'](function(_0x2af2be){return Number(_0x2af2be);});_0x39dff1[_0xae3d('0x29')](function(_0x3d0a1a){_0x440ae6['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3d0a1a+',%');});_0x194f7c=_['union'](_0x194f7c,_0x39dff1);break;case _0xae3d('0x6d'):if(_0x5d2340[_0xae3d('0x63')]===_0xae3d('0x64')){_0x5d2bcc[_0x24fa2a](_0xae3d('0x6e'),'%'+_0x5d2340['value']+'%',null);}else{_0x5279a0=_[_0xae3d('0x67')](_0x1de8da,[_0xae3d('0x23'),'UserId']);_0x5d2340[_0xae3d('0x48')]=_0xae3d('0x36');_0x2dba59=as[_0xae3d('0x69')](_0x5b511f,_0x5279a0[_0xae3d('0x6f')],_0x5d2340);_0x5d2bcc[_0x24fa2a](_0x2dba59[_0xae3d('0x6a')],_0x2dba59[_0xae3d('0x5e')][_0xae3d('0x6b')],_0x2dba59['value'][_0xae3d('0x17')]);}break;case _0xae3d('0x2e'):_0x2dba59=as[_0xae3d('0x69')]('me',null,_0x5d2340);_0x5d2bcc[_0x24fa2a](_0x2dba59[_0xae3d('0x6a')],_0x2dba59[_0xae3d('0x5e')]['start'],_0x2dba59[_0xae3d('0x5e')][_0xae3d('0x17')]);break;}}else{var _0x2dba59=as[_0xae3d('0x69')](_0x5b511f,_0x5279a0[_0xae3d('0x6f')],_0x5d2340);_0x5d2bcc[_0x24fa2a](_0x2dba59[_0xae3d('0x6a')],_0x2dba59['value'][_0xae3d('0x6b')],_0x2dba59[_0xae3d('0x5e')]['end']);}}}else{var _0x292b03=_(_0x35db44[_0xae3d('0x3e')])[_0xae3d('0x3f')]()['map'](function(_0x492488){return _[_0xae3d('0x70')](_0x1de8da,[_0xae3d('0x23'),_0x492488])?_0x492488:undefined;})[_0xae3d('0x71')]()[_0xae3d('0x5e')]();if(!_[_0xae3d('0x72')](_0x292b03)){_0x292b03[_0xae3d('0x29')](function(_0x23502f){if(_0x23502f==='MailAccountId'){_0x247a37[_0xae3d('0x73')](_0xae3d('0x74'),[]['concat'](_0x35db44[_0xae3d('0x3e')][_0x23502f]));}else if(_0x23502f==='createdAt'){var _0x24684f=JSON[_0xae3d('0x75')](_0x35db44[_0xae3d('0x3e')][_0x23502f])[_0xae3d('0x76')];var _0x21923a=JSON['parse'](_0x35db44[_0xae3d('0x3e')][_0x23502f])[_0xae3d('0x77')];_0x247a37[_0xae3d('0x73')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x24684f,_0x21923a);}else{if(_0x35db44['query'][_0x23502f]===_0xae3d('0x78')){_0x247a37[_0xae3d('0x73')]('i.'+_0x23502f+'\x20IS\x20NULL');}else{_0x247a37['where']('i.'+_0x23502f+_0xae3d('0x79'),_0x35db44['query'][_0x23502f]);}}});}if(_0x35db44[_0xae3d('0x3e')]['read']){if(_0x35db44['query']['read']==0x1){_0x247a37['having'](_0xae3d('0x7a'));}else{_0x247a37[_0xae3d('0x5f')]('`unreadMessages`\x20>\x200');}}if(_0x35db44['query'][_0xae3d('0x7b')]){_0x194f7c=_[_0xae3d('0x7c')](_0x35db44[_0xae3d('0x3e')][_0xae3d('0x7b')])?_0x35db44[_0xae3d('0x3e')][_0xae3d('0x7b')]:new Array(_0x35db44[_0xae3d('0x3e')]['tag']);_0x194f7c[_0xae3d('0x29')](function(_0x3d6aef){_0x440ae6['or'](_0xae3d('0x7d'),'%,'+_0x3d6aef+',%');});}if(_0x35db44[_0xae3d('0x3e')][_0xae3d('0x7e')]){var _0x3f6c2f=_0x35db44['query'][_0xae3d('0x7e')][_0xae3d('0x7f')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x3f6c2f)){_0x5d2bcc['or'](_0xae3d('0x80'),_0x3f6c2f+'%');}else if(qs[_0xae3d('0x81')](_0x3f6c2f)){_0x5d2bcc['or']('c.email\x20LIKE\x20?',_0x3f6c2f+'%');}else{_0x5d2bcc['or'](_0xae3d('0x82'),qs[_0xae3d('0x66')](_0x3f6c2f))['or'](_0xae3d('0x83'),qs['getFullTextValue'](_0x3f6c2f));}}}_0x247a37[_0xae3d('0x73')](_0x5d2bcc);_0x247a37[_0xae3d('0x84')]('i.id');var _0x4e1d15={'type':db[_0xae3d('0x85')][_0xae3d('0x86')][_0xae3d('0x87')],'raw':!![]};var _0x502a4d=_0x247a37[_0xae3d('0x88')]();_0x502a4d[_0xae3d('0x48')]('i.id');_0x502a4d[_0xae3d('0x48')](_0xae3d('0x89'),_0xae3d('0x5d'));if(_0x15350d['order']){_0x15350d[_0xae3d('0x45')][_0xae3d('0x29')](function(_0x111d8f){var _0x53aab6=_0x111d8f[0x0]===_0xae3d('0x8a')?_0x111d8f[0x0]:'i.'+_0x111d8f[0x0];_0x247a37['order'](_0x53aab6,_0x111d8f[0x1]===_0xae3d('0x8b')?![]:!![]);});}if(!_['isEmpty'](_0x194f7c)){_0x247a37['having'](_0x440ae6);_0x502a4d[_0xae3d('0x73')]('t.id\x20IN\x20?',_0x194f7c);}BPromise[_0xae3d('0x8c')]()[_0xae3d('0x1f')](function(){if(!_0x1478aa){if(_0x35db44[_0xae3d('0x3e')][_0xae3d('0x8d')])return;_0x502a4d['where'](_0xae3d('0x8e'));_0x247a37[_0xae3d('0x73')](_0xae3d('0x8e'));return;}if(_0x35db44[_0xae3d('0x8f')][_0xae3d('0x90')]!==_0xae3d('0x91'))return;return _0x35db44[_0xae3d('0x8f')][_0xae3d('0x92')]({'attributes':['id'],'raw':!![]})[_0xae3d('0x1f')](function(_0x19f797){if(_[_0xae3d('0x72')](_0x19f797)){_0x502a4d[_0xae3d('0x73')](_0xae3d('0x93'));_0x247a37[_0xae3d('0x73')](_0xae3d('0x93'));}else{_0x502a4d[_0xae3d('0x73')](_0xae3d('0x74'),_['map'](_0x19f797,'id'));_0x247a37[_0xae3d('0x73')](_0xae3d('0x74'),_[_0xae3d('0x94')](_0x19f797,'id'));}});})[_0xae3d('0x1f')](function(){if(_0x35db44[_0xae3d('0x8f')]['role']===_0xae3d('0x91')&&!_0x1478aa&&!_0x35db44[_0xae3d('0x3e')][_0xae3d('0x8d')])return[];return db[_0xae3d('0x95')][_0xae3d('0x3e')](_0x502a4d[_0xae3d('0x96')](),_0x4e1d15);})[_0xae3d('0x1f')](function(_0x2f7ef0){_0xd8cd66['count']=_0x2f7ef0[_0xae3d('0x44')];if(_0xd8cd66[_0xae3d('0x1c')]===0x0)return[];return db[_0xae3d('0x95')]['query'](_0x14fad3[_0xae3d('0x96')](),_0x4e1d15)[_0xae3d('0x1f')](function(_0x95a92e){_0x2a3f95=_['keyBy'](_0x95a92e,'id');_0x4e1d15=_[_0xae3d('0x97')](_0x4e1d15,{'model':db[_0xae3d('0x3a')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x35db44['query'][_0xae3d('0x43')]){_0x15350d['attributes'][_0xae3d('0x29')](function(_0x53d7b0){_0x247a37[_0xae3d('0x48')]('i.'+_0x53d7b0);});}else{_0x247a37[_0xae3d('0x48')](_0xae3d('0x89'),_0xae3d('0x5d'));_0x247a37[_0xae3d('0x48')]('a.key',_0xae3d('0x98'));_0x247a37[_0xae3d('0x48')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0x247a37[_0xae3d('0x48')](_0xae3d('0x99'),_0xae3d('0x8a'));_0x247a37[_0xae3d('0x48')]('i.id');_0x247a37[_0xae3d('0x48')](_0xae3d('0x9a'));_0x247a37[_0xae3d('0x48')]('i.updatedAt');_0x247a37['field'](_0xae3d('0x9b'));_0x247a37['field'](_0xae3d('0x9c'));_0x247a37['field'](_0xae3d('0x9d'));_0x247a37[_0xae3d('0x48')](_0xae3d('0x9e'));_0x247a37[_0xae3d('0x48')]('i.lastMsgDirection');_0x247a37[_0xae3d('0x48')](_0xae3d('0x9f'));_0x247a37[_0xae3d('0x48')]('i.disposition');_0x247a37[_0xae3d('0x48')]('i.secondDisposition');_0x247a37[_0xae3d('0x48')](_0xae3d('0xa0'));_0x247a37['field']('i.substatus');_0x247a37[_0xae3d('0x48')]('i.to');_0x247a37['field'](_0xae3d('0xa1'));_0x247a37['field'](_0xae3d('0xa2'));_0x247a37['field'](_0xae3d('0xa3'));_0x247a37['field'](_0xae3d('0xa4'),'Contact.firstName');_0x247a37[_0xae3d('0x48')]('c.lastName',_0xae3d('0xa5'));_0x247a37[_0xae3d('0x48')](_0xae3d('0xa6'),_0xae3d('0xa7'));_0x247a37[_0xae3d('0x48')](_0xae3d('0xa8'),_0xae3d('0xa9'));_0x247a37[_0xae3d('0x48')](_0xae3d('0xaa'),'Contact.mobile');_0x247a37[_0xae3d('0x48')](_0xae3d('0xab'),_0xae3d('0xac'));_0x247a37[_0xae3d('0x48')](_0xae3d('0xad'),'Owner.fullname');_0x247a37[_0xae3d('0x48')](_0xae3d('0xae'),_0xae3d('0xaf'));_0x247a37['field'](_0xae3d('0xb0'),'TagIds');}if(_0x15350d['limit'])_0x247a37[_0xae3d('0x1a')](_0x15350d['limit']);if(_0x15350d[_0xae3d('0x19')])_0x247a37[_0xae3d('0x19')](_0x15350d[_0xae3d('0x19')]);return db[_0xae3d('0x95')][_0xae3d('0x3e')](_0x247a37[_0xae3d('0x96')](),_0x4e1d15);})[_0xae3d('0x1f')](function(_0x4230eb){if(_0x4230eb[_0xae3d('0x44')]>0x0)_0x49b8df[_0xae3d('0x73')](_0xae3d('0xb1'),_[_0xae3d('0x94')](_0x4230eb,'id'));return db['sequelize']['query'](_0x49b8df['toString'](),_0x4e1d15)['then'](function(_0x4e7344){var _0x2da8d2=_['groupBy'](_0x4e7344,'MailInteractionId');var _0x6d9889=[];return db[_0xae3d('0xb2')]['findOne']({'attributes':['enableEmailPreview'],'raw':!![]})[_0xae3d('0x1f')](function(_0x30ccf4){var _0x25255c=_0x30ccf4[_0xae3d('0xb3')];_0x4230eb[_0xae3d('0x29')](function(_0x1370f5){_0x6d9889[_0xae3d('0xb4')](updateMailInteraction(_0x1370f5,_0x2a3f95,_0x2da8d2,_0x25255c));});return BPromise[_0xae3d('0xb5')](_0x6d9889);});});});})[_0xae3d('0x1f')](function(_0x231cd2){_0xd8cd66[_0xae3d('0xb6')]=_0x231cd2;return _0xd8cd66;})[_0xae3d('0x1f')](respondWithFilteredResult(_0x238e65,_0x15350d))[_0xae3d('0x31')](handleError(_0x238e65,null));};exports['show']=function(_0x4f59df,_0x401ef2){var _0x55dcf4={'raw':![],'where':{'id':_0x4f59df[_0xae3d('0xb7')]['id']}},_0x2993ba={};_0x2993ba[_0xae3d('0x3d')]=_[_0xae3d('0x3f')](db['MailInteraction'][_0xae3d('0x3b')]);_0x2993ba[_0xae3d('0x3e')]=_[_0xae3d('0x3f')](_0x4f59df[_0xae3d('0x3e')]);_0x2993ba['filters']=_['intersection'](_0x2993ba['model'],_0x2993ba['query']);_0x55dcf4['attributes']=_[_0xae3d('0x41')](_0x2993ba[_0xae3d('0x3d')],qs[_0xae3d('0x43')](_0x4f59df[_0xae3d('0x3e')][_0xae3d('0x43')]));_0x55dcf4['attributes']=_0x55dcf4[_0xae3d('0x42')]['length']?_0x55dcf4[_0xae3d('0x42')]:_0x2993ba[_0xae3d('0x3d')];if(_0x4f59df[_0xae3d('0x3e')][_0xae3d('0xb8')]){_0x55dcf4['include']=[{'all':!![]}];}_0x55dcf4=_['merge']({},_0x55dcf4,_0x4f59df[_0xae3d('0xb9')]);return db[_0xae3d('0x3a')][_0xae3d('0x67')](_0x55dcf4)[_0xae3d('0x1f')](handleEntityNotFound(_0x401ef2,null))[_0xae3d('0x1f')](respondWithResult(_0x401ef2,null))[_0xae3d('0x31')](handleError(_0x401ef2,null));};exports[_0xae3d('0xba')]=function(_0x3ce3f2,_0x4d902c){return db[_0xae3d('0x3a')][_0xae3d('0xba')](_0x3ce3f2['body'],{})[_0xae3d('0x1f')](respondWithResult(_0x4d902c,0xc9))[_0xae3d('0x31')](handleError(_0x4d902c,null));};exports[_0xae3d('0x1e')]=function(_0x412005,_0x26e845){if(_0x412005[_0xae3d('0xbb')]['id']){delete _0x412005['body']['id'];}return db[_0xae3d('0x3a')][_0xae3d('0x67')]({'where':{'id':_0x412005[_0xae3d('0xb7')]['id']}})[_0xae3d('0x1f')](handleEntityNotFound(_0x26e845,null))[_0xae3d('0x1f')](saveUpdates(_0x412005[_0xae3d('0xbb')],null))[_0xae3d('0x1f')](respondWithResult(_0x26e845,null))[_0xae3d('0x31')](handleError(_0x26e845,null));};exports[_0xae3d('0xbc')]=function(_0x3933f6,_0x598534){return db['MailInteraction'][_0xae3d('0x67')]({'where':{'id':_0x3933f6[_0xae3d('0xb7')]['id']}})[_0xae3d('0x1f')](handleEntityNotFound(_0x598534,null))[_0xae3d('0x1f')](removeEntity(_0x598534,null))['catch'](handleError(_0x598534,null));};exports[_0xae3d('0xbd')]=function(_0x5ee764,_0x521065){return db[_0xae3d('0x3a')][_0xae3d('0xbd')]()[_0xae3d('0x1f')](respondWithResult(_0x521065,null))[_0xae3d('0x31')](handleError(_0x521065,null));};exports['addMessage']=function(_0x29e41a,_0x382c62){return db[_0xae3d('0x2b')]['find']({'where':{'id':_0x29e41a[_0xae3d('0xb7')]['id']}})[_0xae3d('0x1f')](handleEntityNotFound(_0x382c62,null))[_0xae3d('0x1f')](function(_0x5d96ba){if(_0x5d96ba){return _0x5d96ba['addMessage'](_0x29e41a[_0xae3d('0xbb')][_0xae3d('0xbe')],_['omit'](_0x29e41a[_0xae3d('0xbb')],[_0xae3d('0xbe'),'id'])||{});}})[_0xae3d('0x1f')](respondWithResult(_0x382c62,null))[_0xae3d('0x31')](handleError(_0x382c62,null));};exports['getMessages']=function(_0x54636b,_0x4b4b33){var _0x1bbe45={'raw':![],'where':{}};var _0x346691={};var _0x5ad93d={'count':0x0,'rows':[]};return db[_0xae3d('0x3a')][_0xae3d('0x2c')]({'where':{'id':_0x54636b[_0xae3d('0xb7')]['id']}})['then'](handleEntityNotFound(_0x4b4b33,null))[_0xae3d('0x1f')](function(_0x16da32){if(_0x16da32){_0x346691[_0xae3d('0x3d')]=_[_0xae3d('0x3f')](db[_0xae3d('0x2b')][_0xae3d('0x3b')]);_0x346691[_0xae3d('0x3e')]=_['keys'](_0x54636b[_0xae3d('0x3e')]);_0x346691[_0xae3d('0x40')]=_[_0xae3d('0x41')](_0x346691[_0xae3d('0x3d')],_0x346691[_0xae3d('0x3e')]);_0x1bbe45[_0xae3d('0x42')]=_[_0xae3d('0x41')](_0x346691[_0xae3d('0x3d')],qs['fields'](_0x54636b[_0xae3d('0x3e')][_0xae3d('0x43')]));_0x1bbe45['attributes']=_0x1bbe45[_0xae3d('0x42')]['length']?_0x1bbe45['attributes']:_0x346691['model'];if(!_0x54636b[_0xae3d('0x3e')][_0xae3d('0xbf')](_0xae3d('0xc0'))){_0x1bbe45[_0xae3d('0x1a')]=qs['limit'](_0x54636b['query'][_0xae3d('0x1a')]);_0x1bbe45[_0xae3d('0x19')]=qs['offset'](_0x54636b[_0xae3d('0x3e')]['offset']);}_0x1bbe45['order']=qs[_0xae3d('0x46')](_0x54636b[_0xae3d('0x3e')][_0xae3d('0x46')]);_0x1bbe45[_0xae3d('0x73')]=qs['filters'](_[_0xae3d('0xc1')](_0x54636b[_0xae3d('0x3e')],_0x346691['filters']));_0x1bbe45[_0xae3d('0x73')][_0xae3d('0xc2')]=_0x16da32['id'];if(_0x54636b[_0xae3d('0x3e')]['filter']){_0x1bbe45[_0xae3d('0x73')]=_[_0xae3d('0x97')](_0x1bbe45[_0xae3d('0x73')],{'$or':_[_0xae3d('0x94')](_0x1bbe45['attributes'],function(_0x50f096){var _0x118574={};_0x118574[_0x50f096]={'$like':'%'+_0x54636b['query']['filter']+'%'};return _0x118574;})});}if(_0x54636b[_0xae3d('0x3e')][_0xae3d('0x76')]){var _0x43142f=_0x54636b[_0xae3d('0x3e')][_0xae3d('0x76')][_0xae3d('0x28')](',');var _0x2522cf={};_0x2522cf[_0x43142f[0x0]]={'$gte':moment(_0x43142f[0x1])[_0xae3d('0xc3')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1bbe45[_0xae3d('0x73')]=_[_0xae3d('0x97')](_0x1bbe45[_0xae3d('0x73')],_0x2522cf);}_0x1bbe45=_['merge']({},_0x1bbe45,_0x54636b[_0xae3d('0xb9')]);return db[_0xae3d('0x2b')]['count']({'where':_0x1bbe45[_0xae3d('0x73')]})[_0xae3d('0x1f')](function(_0x22d02e){_0x5ad93d[_0xae3d('0x1c')]=_0x22d02e;if(_0x54636b[_0xae3d('0x3e')][_0xae3d('0xb8')]){_0x1bbe45[_0xae3d('0xc4')]=[{'all':!![]}];}return db[_0xae3d('0x2b')][_0xae3d('0xc5')](_0x1bbe45);})[_0xae3d('0x1f')](function(_0x5f3883){if(_0x54636b['query'][_0xae3d('0xc6')]===_0xae3d('0xc7')){for(var _0x43731e=0x0;_0x43731e<_0x5f3883[_0xae3d('0x44')];_0x43731e++){_0x5f3883[_0x43731e][_0xae3d('0xbb')]=juice(_0x5f3883[_0x43731e][_0xae3d('0xbb')]);}}_0x5ad93d['rows']=_0x5f3883;return _0x5ad93d;});}})[_0xae3d('0x1f')](respondWithFilteredResult(_0x4b4b33,_0x1bbe45))['catch'](handleError(_0x4b4b33,null));};exports[_0xae3d('0xc8')]=function(_0x4de900,_0xb58ccf){return db[_0xae3d('0x3a')][_0xae3d('0x67')]({'where':{'id':_0x4de900['params']['id']}})[_0xae3d('0x1f')](handleEntityNotFound(_0xb58ccf,null))['then'](function(_0x48fa46){if(_0x48fa46){return _0x48fa46['setTags'](_0x4de900[_0xae3d('0xbb')][_0xae3d('0xbe')],_[_0xae3d('0xc9')](_0x4de900['body'],[_0xae3d('0xbe'),'id'])||{})[_0xae3d('0xca')](function(){return db[_0xae3d('0x6c')][_0xae3d('0xc5')]({'attributes':['id',_0xae3d('0x23'),_0xae3d('0x49')],'where':{'id':_0x4de900[_0xae3d('0xbb')]['ids']}});})['then'](function(_0x58c160){socket[_0xae3d('0xcb')](_0xae3d('0xcc'),{'id':Number(_0x4de900[_0xae3d('0xb7')]['id']),'tags':_0x58c160||[]});return{'id':Number(_0x4de900['params']['id']),'tags':_0x58c160||[]};});}})[_0xae3d('0x1f')](respondWithResult(_0xb58ccf,null))[_0xae3d('0x31')](handleError(_0xb58ccf,null));};exports[_0xae3d('0xcd')]=function(_0x13e9e9,_0x476ec3){return db[_0xae3d('0x3a')]['find']({'where':{'id':_0x13e9e9[_0xae3d('0xb7')]['id']}})[_0xae3d('0x1f')](handleEntityNotFound(_0x476ec3,null))['then'](function(_0x4ff279){if(_0x4ff279){return _0x4ff279[_0xae3d('0xcd')](_0x13e9e9[_0xae3d('0x3e')]['ids']);}})['then'](respondWithStatusCode(_0x476ec3,null))[_0xae3d('0x31')](handleError(_0x476ec3,null));};exports[_0xae3d('0xce')]=function(_0xd2e6bd,_0x3d81a4){var _0x57b782=moment()['unix']()[_0xae3d('0x96')]();var _0x23edb4=path[_0xae3d('0xcf')](config['root'],_0xae3d('0xd0'),_0xae3d('0xd1'),_0xae3d('0xd2'));var _0x1669f0=path['join'](config[_0xae3d('0xd3')],_0xae3d('0xd0'),_0xae3d('0xd1'),_0xae3d('0xd4'));var _0x430c82=path[_0xae3d('0xcf')](_0x23edb4,_0x57b782);var _0x14d5d8=util['format'](_0xae3d('0xd5'),_0xd2e6bd[_0xae3d('0xb7')]['id'],_0x57b782);var _0x244fd3=path[_0xae3d('0xcf')](_0x23edb4,_0x14d5d8);var _0x53945e=[];if(_0xd2e6bd[_0xae3d('0x3e')][_0xae3d('0xd4')]){_0x53945e[_0xae3d('0xb4')]({'model':db[_0xae3d('0xd6')],'as':_0xae3d('0xd7'),'raw':!![]});}var _0x31482f=[{'model':db[_0xae3d('0x2b')],'as':'Messages','attributes':['id',_0xae3d('0xbb'),'from','to','cc','bcc','subject',_0xae3d('0xd8')],'where':{'secret':![]},'order':qs[_0xae3d('0x46')]('id'),'include':_0x53945e}];return db[_0xae3d('0x3a')][_0xae3d('0x67')]({'where':{'id':_0xd2e6bd[_0xae3d('0xb7')]['id']},'include':_0x31482f})[_0xae3d('0x1f')](handleEntityNotFound(_0x3d81a4,null))['then'](function(_0x5bd50d){if(_0x5bd50d&&_0x5bd50d[_0xae3d('0xd9')]){var _0x8342ea=_0x5bd50d[_0xae3d('0xda')]({'plain':!![]});fs['mkdirSync'](_0x430c82);return BPromise[_0xae3d('0xdb')](_0x8342ea[_0xae3d('0xd9')],function(_0x8fa3c9,_0x15ea05){var _0x287582={'from':_0x8fa3c9[_0xae3d('0x4a')],'to':_0x8fa3c9['to'],'subject':_0x8fa3c9[_0xae3d('0xdc')],'html':htmlEntities[_0xae3d('0xdd')](_0x8fa3c9[_0xae3d('0xbb')]),'headers':{'Date':moment(_0x8fa3c9[_0xae3d('0xd8')])[_0xae3d('0xc3')](_0xae3d('0xde'))},'attachments':[]};if(_0x8fa3c9['cc']){_0x287582[_0xae3d('0xdf')]['Cc']=_0x8fa3c9['cc'];}if(_0x8fa3c9[_0xae3d('0xe0')]){_0x287582[_0xae3d('0xdf')]['Bcc']=_0x8fa3c9[_0xae3d('0xe0')];}return new BPromise(function(_0x4d0c69,_0x38378d){if(_0x8fa3c9[_0xae3d('0xd7')]){for(var _0x9ff7c4=0x0;_0x9ff7c4<_0x8fa3c9[_0xae3d('0xd7')][_0xae3d('0x44')];_0x9ff7c4++){var _0x3b7a0e=_0x8fa3c9[_0xae3d('0xd7')][_0x9ff7c4];var _0x545e14=path[_0xae3d('0xcf')](_0x1669f0,_0x3b7a0e[_0xae3d('0xe1')]);if(fs[_0xae3d('0xe2')](_0x545e14)){_0x287582['attachments'][_0xae3d('0xb4')]({'name':_0x3b7a0e['name'],'contentType':_0x3b7a0e[_0xae3d('0x6f')],'data':fs[_0xae3d('0xe3')](_0x545e14)});}}}emlformat[_0xae3d('0xe4')](_0x287582,function(_0x49a399,_0x22ff21){if(_0x49a399)return _0x38378d(_0x49a399);fs[_0xae3d('0xe5')](path[_0xae3d('0xcf')](_0x430c82,util['format']('message%d.eml',_0x15ea05)),_0x22ff21);return _0x4d0c69(_0x22ff21);});});})[_0xae3d('0x1f')](function(){return new BPromise(function(_0x504340,_0x48c050){zipdir(_0x430c82,{'saveTo':_0x244fd3},function(_0x184dd7,_0x194fd4){if(_0x184dd7)return _0x48c050(_0x184dd7);return _0x504340(_0x194fd4);});})[_0xae3d('0x1f')](function(){return new BPromise(function(_0x7aa646,_0x2fbb90){rimraf(_0x430c82,function(_0x4ce1c1){if(_0x4ce1c1)_0x2fbb90(_0x4ce1c1);return _0x7aa646();});});})['then'](function(){return _0x3d81a4['download'](_0x244fd3,_0x14d5d8,function(_0x215e9f){if(!_0x215e9f)fs[_0xae3d('0xe6')](_0x244fd3);});});});}else{return _0x3d81a4['sendStatus'](0xc8);}})[_0xae3d('0x31')](handleError(_0x3d81a4,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 29ca137..9671e29 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 _0x7319=['remove','getUsers','then','setDataValue','Users','map','findAll','length','emit','catch','hook','exports','MailInteraction','save','update'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x7319,0x156));var _0x9731=function(_0xd21eab,_0x1471d3){_0xd21eab=_0xd21eab-0x0;var _0x409cb6=_0x7319[_0xd21eab];return _0x409cb6;};'use strict';var EventEmitter=require('events');var MailInteraction=require('../../mysqldb')['db'][_0x9731('0x0')];var MailMessage=require('../../mysqldb')['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9731('0x1'),'afterUpdate':_0x9731('0x2'),'afterDestroy':_0x9731('0x3')};function emitEvent(_0x459712){return function(_0x43a426,_0x5199a5,_0x140982){_0x43a426[_0x9731('0x4')]({'attributes':['id'],'raw':!![]})[_0x9731('0x5')](function(_0x52954c){_0x43a426[_0x9731('0x6')](_0x9731('0x7'),_0x52954c[_0x9731('0x8')](function(_0x1126f8){return{'id':_0x1126f8['id']};}));return MailMessage[_0x9731('0x9')]({'where':{'MailInteractionId':_0x43a426['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x5c7e98){_0x43a426['setDataValue']('unreadMessages',_0x5c7e98[_0x9731('0xa')]);MailInteractionEvents[_0x9731('0xb')](_0x459712+':'+_0x43a426['id'],_0x43a426);MailInteractionEvents[_0x9731('0xb')](_0x459712,_0x43a426);_0x140982(null);})[_0x9731('0xc')](_0x140982(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x9731('0xd')](e,emitEvent(event));}}module[_0x9731('0xe')]=MailInteractionEvents; \ No newline at end of file +var _0x1316=['hook','exports','../../mysqldb','MailInteraction','MailMessage','save','update','remove','then','setDataValue','Users','length','emit','catch','hasOwnProperty'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1316,0x89));var _0x6131=function(_0x163ecf,_0x5ba049){_0x163ecf=_0x163ecf-0x0;var _0x91c7af=_0x1316[_0x163ecf];return _0x91c7af;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0x6131('0x0'))['db'][_0x6131('0x1')];var MailMessage=require('../../mysqldb')['db'][_0x6131('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6131('0x3'),'afterUpdate':_0x6131('0x4'),'afterDestroy':_0x6131('0x5')};function emitEvent(_0x304905){return function(_0x50cf76,_0x336d60,_0x3b2ef4){_0x50cf76['getUsers']({'attributes':['id'],'raw':!![]})[_0x6131('0x6')](function(_0x1e68c8){_0x50cf76[_0x6131('0x7')](_0x6131('0x8'),_0x1e68c8['map'](function(_0x390ce7){return{'id':_0x390ce7['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x50cf76['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x17952a){_0x50cf76[_0x6131('0x7')]('unreadMessages',_0x17952a[_0x6131('0x9')]);MailInteractionEvents[_0x6131('0xa')](_0x304905+':'+_0x50cf76['id'],_0x50cf76);MailInteractionEvents['emit'](_0x304905,_0x50cf76);_0x3b2ef4(null);})[_0x6131('0xb')](_0x3b2ef4(null));};}for(var e in events){if(events[_0x6131('0xc')](e)){var event=events[e];MailInteraction[_0x6131('0xd')](e,emitEvent(event));}}module[_0x6131('0xe')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index c335a73..30a6adf 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 _0x0d1a=['substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','substatus','then','catch','utf8mb4','utf8mb4_unicode_ci','util','api','moment','request-promise','rimraf','../../config/environment','./mailInteraction.attributes','define','MailInteraction','fti_mail_interactions','subject','FULLTEXT'];(function(_0x41556e,_0x585c4e){var _0x3b587b=function(_0x11f57d){while(--_0x11f57d){_0x41556e['push'](_0x41556e['shift']());}};_0x3b587b(++_0x585c4e);}(_0x0d1a,0x1a9));var _0xa0d1=function(_0x19d41a,_0x39e703){_0x19d41a=_0x19d41a-0x0;var _0x2f0a19=_0x0d1a[_0x19d41a];return _0x2f0a19;};'use strict';var _=require('lodash');var util=require(_0xa0d1('0x0'));var logger=require('../../config/logger')(_0xa0d1('0x1'));var moment=require(_0xa0d1('0x2'));var BPromise=require('bluebird');var rp=require(_0xa0d1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa0d1('0x4'));var config=require(_0xa0d1('0x5'));var attributes=require(_0xa0d1('0x6'));module['exports']=function(_0x394f20,_0x5a51cd){return _0x394f20[_0xa0d1('0x7')](_0xa0d1('0x8'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0xa0d1('0x9'),'fields':[_0xa0d1('0xa'),'to'],'type':_0xa0d1('0xb')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4b444a,_0x24eb90,_0x512d0d){if(_0x4b444a['substatus']){_0x4b444a[_0xa0d1('0xc')]=moment()[_0xa0d1('0xd')](_0xa0d1('0xe'));}if(_0x4b444a[_0xa0d1('0xf')]){_0x4b444a[_0xa0d1('0x10')]=moment()[_0xa0d1('0xd')](_0xa0d1('0xe'));}_0x512d0d(null,_0x24eb90);},'beforeUpdate':function(_0x42a4f0,_0x35ab49,_0x5656cf){if(_0x42a4f0[_0xa0d1('0x11')](_0xa0d1('0x12'))){_0x42a4f0[_0xa0d1('0xc')]=_0x42a4f0[_0xa0d1('0x12')]?moment()[_0xa0d1('0xd')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x42a4f0[_0xa0d1('0x11')](_0xa0d1('0xf'))){_0x42a4f0[_0xa0d1('0x10')]=moment()['format'](_0xa0d1('0xe'));_0x42a4f0[_0xa0d1('0x12')]=null;_0x42a4f0[_0xa0d1('0xc')]=null;}_0x5656cf(null,_0x42a4f0);},'afterUpdate':function(_0x4dbb2c,_0x710f0b,_0x3531f4){var _0x7e596e=_0x394f20['models'];var _0x1b76f3=_0x4dbb2c['get']({'plain':!![]});if(_0x1b76f3[_0xa0d1('0xf')]){return _0x7e596e['MailMessage']['update']({'read':!![]},{'where':{'MailInteractionId':_0x1b76f3['id']}})[_0xa0d1('0x13')](function(){_0x3531f4();})[_0xa0d1('0x14')](function(_0x535050){_0x3531f4(_0x535050);});}else{_0x3531f4();}}},'charset':_0xa0d1('0x15'),'collate':_0xa0d1('0x16')});}; \ No newline at end of file +var _0x516e=['MailInteraction','subject','substatus','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','changed','substatusAt','models','get','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','define'];(function(_0x30d33e,_0x1ec619){var _0x493332=function(_0x3ccf7a){while(--_0x3ccf7a){_0x30d33e['push'](_0x30d33e['shift']());}};_0x493332(++_0x1ec619);}(_0x516e,0xbc));var _0xe516=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x516e[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0xe516('0x0'));var util=require(_0xe516('0x1'));var logger=require(_0xe516('0x2'))('api');var moment=require(_0xe516('0x3'));var BPromise=require(_0xe516('0x4'));var rp=require(_0xe516('0x5'));var fs=require('fs');var path=require(_0xe516('0x6'));var rimraf=require(_0xe516('0x7'));var config=require(_0xe516('0x8'));var attributes=require(_0xe516('0x9'));module[_0xe516('0xa')]=function(_0x3dd3d3,_0x3ff16b){return _0x3dd3d3[_0xe516('0xb')](_0xe516('0xc'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0xe516('0xd'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x30b474,_0x158d49,_0x176eb6){if(_0x30b474[_0xe516('0xe')]){_0x30b474['substatusAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}if(_0x30b474[_0xe516('0xf')]){_0x30b474[_0xe516('0x10')]=moment()[_0xe516('0x11')](_0xe516('0x12'));}_0x176eb6(null,_0x158d49);},'beforeUpdate':function(_0x39f32b,_0x6eb74a,_0x38ae00){if(_0x39f32b[_0xe516('0x13')](_0xe516('0xe'))){_0x39f32b[_0xe516('0x14')]=_0x39f32b[_0xe516('0xe')]?moment()['format'](_0xe516('0x12')):null;}if(_0x39f32b[_0xe516('0x13')](_0xe516('0xf'))){_0x39f32b[_0xe516('0x10')]=moment()[_0xe516('0x11')](_0xe516('0x12'));_0x39f32b['substatus']=null;_0x39f32b[_0xe516('0x14')]=null;}_0x38ae00(null,_0x39f32b);},'afterUpdate':function(_0x18a3ab,_0x1f677d,_0x513c3f){var _0x5b3808=_0x3dd3d3[_0xe516('0x15')];var _0x1becb3=_0x18a3ab[_0xe516('0x16')]({'plain':!![]});if(_0x1becb3[_0xe516('0xf')]){return _0x5b3808['MailMessage']['update']({'read':!![]},{'where':{'MailInteractionId':_0x1becb3['id']}})['then'](function(){_0x513c3f();})['catch'](function(_0x49768c){_0x513c3f(_0x49768c);});}else{_0x513c3f();}}},'charset':_0xe516('0x17'),'collate':_0xe516('0x18')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index e5db860..5328552 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 _0x1ed1=['UpdateMailInteraction','MailInteraction','body','options','raw','where','attributes','limit','catch','AddTagsToMailInteraction','addTags','ids','omit','AddTags','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x28d543,_0x5334f8){var _0x11dba5=function(_0x1a008a){while(--_0x1a008a){_0x28d543['push'](_0x28d543['shift']());}};_0x11dba5(++_0x5334f8);}(_0x1ed1,0x134));var _0x11ed=function(_0x41ae28,_0x5a9c4a){_0x41ae28=_0x41ae28-0x0;var _0x3cfee2=_0x1ed1[_0x41ae28];return _0x3cfee2;};'use strict';var _=require(_0x11ed('0x0'));var util=require('util');var moment=require(_0x11ed('0x1'));var BPromise=require('bluebird');var rs=require(_0x11ed('0x2'));var fs=require('fs');var Redis=require(_0x11ed('0x3'));var db=require(_0x11ed('0x4'))['db'];var utils=require(_0x11ed('0x5'));var logger=require(_0x11ed('0x6'))('rpc');var config=require(_0x11ed('0x7'));var jayson=require(_0x11ed('0x8'));var client=jayson[_0x11ed('0x9')][_0x11ed('0xa')]({'port':0x232a});config[_0x11ed('0xb')]=_['defaults'](config[_0x11ed('0xb')],{'host':_0x11ed('0xc'),'port':0x18eb});var socket=require(_0x11ed('0xd'))(new Redis(config['redis']));require(_0x11ed('0xe'))[_0x11ed('0xf')](socket);function respondWithRpcPromise(_0x52617c,_0x2c5a55,_0xae5b7f){return new BPromise(function(_0x5854ab,_0x304dd5){return client[_0x11ed('0x10')](_0x52617c,_0xae5b7f)[_0x11ed('0x11')](function(_0x2a1b86){logger[_0x11ed('0x12')](_0x11ed('0x13'),_0x2c5a55,_0x11ed('0x14'));logger[_0x11ed('0x15')](_0x11ed('0x16'),_0x2c5a55,_0x11ed('0x14'),JSON[_0x11ed('0x17')](_0x2a1b86));if(_0x2a1b86['error']){if(_0x2a1b86[_0x11ed('0x18')][_0x11ed('0x19')]===0x1f4){logger[_0x11ed('0x18')](_0x11ed('0x13'),_0x2c5a55,_0x2a1b86['error'][_0x11ed('0x1a')]);return _0x304dd5(_0x2a1b86[_0x11ed('0x18')][_0x11ed('0x1a')]);}logger['error'](_0x11ed('0x13'),_0x2c5a55,_0x2a1b86[_0x11ed('0x18')][_0x11ed('0x1a')]);return _0x5854ab(_0x2a1b86[_0x11ed('0x18')][_0x11ed('0x1a')]);}else{logger['info']('MailInteraction,\x20%s,\x20%s',_0x2c5a55,_0x11ed('0x14'));_0x5854ab(_0x2a1b86[_0x11ed('0x1b')]['message']);}})['catch'](function(_0x5bc0a7){logger[_0x11ed('0x18')](_0x11ed('0x13'),_0x2c5a55,_0x5bc0a7);_0x304dd5(_0x5bc0a7);});});}exports[_0x11ed('0x1c')]=function(_0x4e6f32){var _0x2b951b=this;return new Promise(function(_0x50727a,_0x2dea35){return db[_0x11ed('0x1d')]['update'](_0x4e6f32[_0x11ed('0x1e')],{'raw':_0x4e6f32['options']?_0x4e6f32[_0x11ed('0x1f')][_0x11ed('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e6f32['options']?_0x4e6f32[_0x11ed('0x1f')][_0x11ed('0x21')]||null:null,'attributes':_0x4e6f32[_0x11ed('0x1f')]?_0x4e6f32[_0x11ed('0x1f')][_0x11ed('0x22')]||null:null,'limit':_0x4e6f32[_0x11ed('0x1f')]?_0x4e6f32[_0x11ed('0x1f')][_0x11ed('0x23')]||null:null})[_0x11ed('0x11')](function(_0x1beb3f){logger[_0x11ed('0x12')](_0x11ed('0x1c'),_0x4e6f32);logger['debug'](_0x11ed('0x1c'),_0x4e6f32,JSON[_0x11ed('0x17')](_0x1beb3f));_0x50727a(_0x1beb3f);})[_0x11ed('0x24')](function(_0x5a893e){logger['error'](_0x11ed('0x1c'),_0x5a893e[_0x11ed('0x1a')],_0x4e6f32);_0x2dea35(_0x2b951b[_0x11ed('0x18')](0x1f4,_0x5a893e['message']));});});};exports[_0x11ed('0x25')]=function(_0x590d46){return new Promise(function(_0x327ddc,_0xba0086){return db['MailInteraction']['find']({'where':_0x590d46[_0x11ed('0x1f')]?_0x590d46[_0x11ed('0x1f')][_0x11ed('0x21')]||null:null})['then'](function(_0x3c710c){if(_0x3c710c){return _0x3c710c[_0x11ed('0x26')](_0x590d46[_0x11ed('0x1e')][_0x11ed('0x27')],_[_0x11ed('0x28')](_0x590d46[_0x11ed('0x1e')],[_0x11ed('0x27'),'id'])||{});}})['spread'](function(_0x358f4f){logger[_0x11ed('0x12')]('AddTags',_0x590d46);logger[_0x11ed('0x15')](_0x11ed('0x29'),_0x590d46,JSON['stringify'](_0x358f4f));_0x327ddc(_0x358f4f);})[_0x11ed('0x24')](function(_0x466511){logger['error'](_0x11ed('0x29'),_0x466511[_0x11ed('0x1a')],_0x590d46);_0xba0086(_this[_0x11ed('0x18')](0x1f4,_0x466511[_0x11ed('0x1a')]));});});}; \ No newline at end of file +var _0xd237=['socket.io-emitter','./mailInteraction.socket','register','request','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','UpdateMailInteraction','MailInteraction','update','body','options','then','catch','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xd237,0x12b));var _0x7d23=function(_0x4dba0d,_0x92bb78){_0x4dba0d=_0x4dba0d-0x0;var _0x50cf83=_0xd237[_0x4dba0d];return _0x50cf83;};'use strict';var _=require(_0x7d23('0x0'));var util=require(_0x7d23('0x1'));var moment=require(_0x7d23('0x2'));var BPromise=require(_0x7d23('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7d23('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7d23('0x5'));var logger=require(_0x7d23('0x6'))(_0x7d23('0x7'));var config=require(_0x7d23('0x8'));var jayson=require(_0x7d23('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x7d23('0xa')]=_[_0x7d23('0xb')](config['redis'],{'host':_0x7d23('0xc'),'port':0x18eb});var socket=require(_0x7d23('0xd'))(new Redis(config[_0x7d23('0xa')]));require(_0x7d23('0xe'))[_0x7d23('0xf')](socket);function respondWithRpcPromise(_0x1d6f29,_0x4bfa35,_0x14b2ed){return new BPromise(function(_0x658be1,_0x18768){return client[_0x7d23('0x10')](_0x1d6f29,_0x14b2ed)['then'](function(_0x1e1555){logger[_0x7d23('0x11')](_0x7d23('0x12'),_0x4bfa35,_0x7d23('0x13'));logger[_0x7d23('0x14')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x4bfa35,_0x7d23('0x13'),JSON[_0x7d23('0x15')](_0x1e1555));if(_0x1e1555[_0x7d23('0x16')]){if(_0x1e1555['error'][_0x7d23('0x17')]===0x1f4){logger['error'](_0x7d23('0x12'),_0x4bfa35,_0x1e1555[_0x7d23('0x16')][_0x7d23('0x18')]);return _0x18768(_0x1e1555[_0x7d23('0x16')][_0x7d23('0x18')]);}logger[_0x7d23('0x16')](_0x7d23('0x12'),_0x4bfa35,_0x1e1555[_0x7d23('0x16')][_0x7d23('0x18')]);return _0x658be1(_0x1e1555[_0x7d23('0x16')]['message']);}else{logger[_0x7d23('0x11')](_0x7d23('0x12'),_0x4bfa35,_0x7d23('0x13'));_0x658be1(_0x1e1555[_0x7d23('0x19')][_0x7d23('0x18')]);}})['catch'](function(_0x426edc){logger['error'](_0x7d23('0x12'),_0x4bfa35,_0x426edc);_0x18768(_0x426edc);});});}exports[_0x7d23('0x1a')]=function(_0x39ba4a){var _0x381c5d=this;return new Promise(function(_0x294794,_0x425521){return db[_0x7d23('0x1b')][_0x7d23('0x1c')](_0x39ba4a[_0x7d23('0x1d')],{'raw':_0x39ba4a['options']?_0x39ba4a[_0x7d23('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x39ba4a[_0x7d23('0x1e')]?_0x39ba4a['options']['where']||null:null,'attributes':_0x39ba4a[_0x7d23('0x1e')]?_0x39ba4a['options']['attributes']||null:null,'limit':_0x39ba4a['options']?_0x39ba4a[_0x7d23('0x1e')]['limit']||null:null})[_0x7d23('0x1f')](function(_0x5753b5){logger['info'](_0x7d23('0x1a'),_0x39ba4a);logger[_0x7d23('0x14')](_0x7d23('0x1a'),_0x39ba4a,JSON[_0x7d23('0x15')](_0x5753b5));_0x294794(_0x5753b5);})[_0x7d23('0x20')](function(_0x544005){logger[_0x7d23('0x16')](_0x7d23('0x1a'),_0x544005[_0x7d23('0x18')],_0x39ba4a);_0x425521(_0x381c5d['error'](0x1f4,_0x544005[_0x7d23('0x18')]));});});};exports['AddTagsToMailInteraction']=function(_0x2b349d){return new Promise(function(_0x1a7b15,_0x3ba9f5){return db[_0x7d23('0x1b')][_0x7d23('0x21')]({'where':_0x2b349d[_0x7d23('0x1e')]?_0x2b349d[_0x7d23('0x1e')]['where']||null:null})[_0x7d23('0x1f')](function(_0x530a1f){if(_0x530a1f){return _0x530a1f[_0x7d23('0x22')](_0x2b349d['body'][_0x7d23('0x23')],_[_0x7d23('0x24')](_0x2b349d['body'],['ids','id'])||{});}})[_0x7d23('0x25')](function(_0x57af3e){logger[_0x7d23('0x11')](_0x7d23('0x26'),_0x2b349d);logger[_0x7d23('0x14')](_0x7d23('0x26'),_0x2b349d,JSON['stringify'](_0x57af3e));_0x1a7b15(_0x57af3e);})[_0x7d23('0x20')](function(_0x2a8d2b){logger['error'](_0x7d23('0x26'),_0x2a8d2b['message'],_0x2b349d);_0x3ba9f5(_this[_0x7d23('0x16')](0x1f4,_0x2a8d2b[_0x7d23('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 498d629..4749096 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 _0xbe52=['emit','removeListener','register','length','mailInteraction:','./mailInteraction.events','save','remove'];(function(_0x2b8810,_0x55efdb){var _0x4c0f41=function(_0x3104cd){while(--_0x3104cd){_0x2b8810['push'](_0x2b8810['shift']());}};_0x4c0f41(++_0x55efdb);}(_0xbe52,0xed));var _0x2be5=function(_0x2fb096,_0x304e41){_0x2fb096=_0x2fb096-0x0;var _0xe8ad58=_0xbe52[_0x2fb096];return _0xe8ad58;};'use strict';var MailInteractionEvents=require(_0x2be5('0x0'));var events=[_0x2be5('0x1'),_0x2be5('0x2'),'update'];function createListener(_0x53eea2,_0x2f9d7b){return function(_0x1daf64){_0x2f9d7b[_0x2be5('0x3')](_0x53eea2,_0x1daf64);};}function removeListener(_0x35b082,_0x3c0e25){return function(){MailInteractionEvents[_0x2be5('0x4')](_0x35b082,_0x3c0e25);};}exports[_0x2be5('0x5')]=function(_0x2c37f3){for(var _0x1dcf41=0x0,_0x18f84c=events[_0x2be5('0x6')];_0x1dcf41<_0x18f84c;_0x1dcf41++){var _0x4b4aa4=events[_0x1dcf41];var _0x28281e=createListener(_0x2be5('0x7')+_0x4b4aa4,_0x2c37f3);MailInteractionEvents['on'](_0x4b4aa4,_0x28281e);}}; \ No newline at end of file +var _0x1793=['register','length','mailInteraction:','update','emit','removeListener'];(function(_0x51c819,_0xd812db){var _0x15c5d2=function(_0x2977f0){while(--_0x2977f0){_0x51c819['push'](_0x51c819['shift']());}};_0x15c5d2(++_0xd812db);}(_0x1793,0x165));var _0x3179=function(_0x397bfb,_0x589665){_0x397bfb=_0x397bfb-0x0;var _0x16c9b9=_0x1793[_0x397bfb];return _0x16c9b9;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=['save','remove',_0x3179('0x0')];function createListener(_0x55a9cb,_0x383179){return function(_0x1c5435){_0x383179[_0x3179('0x1')](_0x55a9cb,_0x1c5435);};}function removeListener(_0x1bd442,_0x562443){return function(){MailInteractionEvents[_0x3179('0x2')](_0x1bd442,_0x562443);};}exports[_0x3179('0x3')]=function(_0x3c7e9d){for(var _0x232d84=0x0,_0x39075b=events[_0x3179('0x4')];_0x232d84<_0x39075b;_0x232d84++){var _0x3932fe=events[_0x232d84];var _0x4ac734=createListener(_0x3179('0x5')+_0x3932fe,_0x3c7e9d);MailInteractionEvents['on'](_0x3932fe,_0x4ac734);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 1c4c136..a38b8fc 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 _0x3308=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','/:id/download','create','update','put','/:id/accept','accept','/:id/reject','reject','delete'];(function(_0x3d9557,_0x5d09d2){var _0x359ff8=function(_0x784fa){while(--_0x784fa){_0x3d9557['push'](_0x3d9557['shift']());}};_0x359ff8(++_0x5d09d2);}(_0x3308,0x160));var _0x8330=function(_0x29d776,_0x4852fd){_0x29d776=_0x29d776-0x0;var _0x3684f9=_0x3308[_0x29d776];return _0x3684f9;};'use strict';var multer=require(_0x8330('0x0'));var util=require(_0x8330('0x1'));var path=require(_0x8330('0x2'));var timeout=require(_0x8330('0x3'));var express=require(_0x8330('0x4'));var router=express[_0x8330('0x5')]();var fs_extra=require(_0x8330('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8330('0x7'));var controller=require('./mailMessage.controller');router[_0x8330('0x8')]('/',auth[_0x8330('0x9')](),controller[_0x8330('0xa')]);router['get'](_0x8330('0xb'),auth[_0x8330('0x9')](),controller[_0x8330('0xc')]);router[_0x8330('0x8')](_0x8330('0xd'),auth[_0x8330('0x9')](),controller['show']);router[_0x8330('0x8')](_0x8330('0xe'),auth[_0x8330('0x9')](),controller['download']);router['post']('/',auth['isAuthenticated'](),interaction['tracked']('mail','mailmessage:create'),controller[_0x8330('0xf')]);router['put'](_0x8330('0xd'),auth[_0x8330('0x9')](),controller[_0x8330('0x10')]);router[_0x8330('0x11')](_0x8330('0x12'),auth['isAuthenticated'](),controller[_0x8330('0x13')]);router['put'](_0x8330('0x14'),auth[_0x8330('0x9')](),controller[_0x8330('0x15')]);router[_0x8330('0x16')](_0x8330('0xd'),auth[_0x8330('0x9')](),controller[_0x8330('0x17')]);module[_0x8330('0x18')]=router; \ No newline at end of file +var _0x584a=['update','/:id/accept','/:id/reject','reject','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment','isAuthenticated','index','/describe','show','get','/:id/download','download','post','tracked','mail','mailmessage:create','create','put'];(function(_0x4fa3a0,_0x530b99){var _0x38f908=function(_0x164a20){while(--_0x164a20){_0x4fa3a0['push'](_0x4fa3a0['shift']());}};_0x38f908(++_0x530b99);}(_0x584a,0x1c0));var _0xa584=function(_0x2247ab,_0x3f4162){_0x2247ab=_0x2247ab-0x0;var _0x430062=_0x584a[_0x2247ab];return _0x430062;};'use strict';var multer=require(_0xa584('0x0'));var util=require(_0xa584('0x1'));var path=require('path');var timeout=require(_0xa584('0x2'));var express=require(_0xa584('0x3'));var router=express[_0xa584('0x4')]();var fs_extra=require(_0xa584('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa584('0x6'));var controller=require('./mailMessage.controller');router['get']('/',auth[_0xa584('0x7')](),controller[_0xa584('0x8')]);router['get'](_0xa584('0x9'),auth[_0xa584('0x7')](),controller['describe']);router['get']('/:id',auth[_0xa584('0x7')](),controller[_0xa584('0xa')]);router[_0xa584('0xb')](_0xa584('0xc'),auth[_0xa584('0x7')](),controller[_0xa584('0xd')]);router[_0xa584('0xe')]('/',auth[_0xa584('0x7')](),interaction[_0xa584('0xf')](_0xa584('0x10'),_0xa584('0x11')),controller[_0xa584('0x12')]);router[_0xa584('0x13')]('/:id',auth[_0xa584('0x7')](),controller[_0xa584('0x14')]);router[_0xa584('0x13')](_0xa584('0x15'),auth[_0xa584('0x7')](),controller['accept']);router[_0xa584('0x13')](_0xa584('0x16'),auth[_0xa584('0x7')](),controller[_0xa584('0x17')]);router[_0xa584('0x18')]('/:id',auth[_0xa584('0x7')](),controller['destroy']);module[_0xa584('0x19')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 35ff504..6437589 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 _0xf366=['TEXT','long','medium','BOOLEAN','ENUM','out','STRING','DATE','INTEGER','Chat','Email','lodash','exports'];(function(_0x22bdd3,_0x552e50){var _0x44d9d9=function(_0x2b4ab9){while(--_0x2b4ab9){_0x22bdd3['push'](_0x22bdd3['shift']());}};_0x44d9d9(++_0x552e50);}(_0xf366,0x129));var _0x6f36=function(_0x4863d9,_0x272d8f){_0x4863d9=_0x4863d9-0x0;var _0xa9e173=_0xf366[_0x4863d9];return _0xa9e173;};'use strict';var Sequelize=require('sequelize');var _=require(_0x6f36('0x0'));module[_0x6f36('0x1')]={'body':{'type':Sequelize[_0x6f36('0x2')](_0x6f36('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x6f36('0x2')](_0x6f36('0x4'))},'read':{'type':Sequelize[_0x6f36('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x6f36('0x6')]('in',_0x6f36('0x7')),'defaultValue':_0x6f36('0x7'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0x6f36('0x8')]},'to':{'type':Sequelize[_0x6f36('0x2')](_0x6f36('0x3'))},'cc':{'type':Sequelize[_0x6f36('0x2')](_0x6f36('0x3'))},'bcc':{'type':Sequelize[_0x6f36('0x2')](_0x6f36('0x3'))},'subject':{'type':Sequelize[_0x6f36('0x2')]},'sentAt':{'type':Sequelize[_0x6f36('0x9')]},'attach':{'type':Sequelize[_0x6f36('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize[_0x6f36('0x9')]},'originTo':{'type':Sequelize['TEXT'](_0x6f36('0x3'))},'originCc':{'type':Sequelize['TEXT'](_0x6f36('0x3'))},'originChannel':{'type':Sequelize[_0x6f36('0x6')]('Email',_0x6f36('0xb')),'defaultValue':_0x6f36('0xc'),'allowNull':![]}}; \ No newline at end of file +var _0xdb84=['exports','long','TEXT','medium','BOOLEAN','ENUM','out','STRING','DATE','INTEGER','Chat','Email','lodash'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0xdb84,0xa8));var _0x4db8=function(_0x5365a2,_0x347aa4){_0x5365a2=_0x5365a2-0x0;var _0x1f1667=_0xdb84[_0x5365a2];return _0x1f1667;};'use strict';var Sequelize=require('sequelize');var _=require(_0x4db8('0x0'));module[_0x4db8('0x1')]={'body':{'type':Sequelize['TEXT'](_0x4db8('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x4db8('0x3')](_0x4db8('0x4'))},'read':{'type':Sequelize[_0x4db8('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4db8('0x6')]('in',_0x4db8('0x7')),'defaultValue':_0x4db8('0x7'),'allowNull':![]},'messageId':{'type':Sequelize[_0x4db8('0x8')](0x1fe)},'from':{'type':Sequelize[_0x4db8('0x8')]},'to':{'type':Sequelize[_0x4db8('0x3')](_0x4db8('0x2'))},'cc':{'type':Sequelize[_0x4db8('0x3')](_0x4db8('0x2'))},'bcc':{'type':Sequelize[_0x4db8('0x3')](_0x4db8('0x2'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0x4db8('0x9')]},'attach':{'type':Sequelize[_0x4db8('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x4db8('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x4db8('0x9')]},'originTo':{'type':Sequelize[_0x4db8('0x3')](_0x4db8('0x2'))},'originCc':{'type':Sequelize[_0x4db8('0x3')](_0x4db8('0x2'))},'originChannel':{'type':Sequelize[_0x4db8('0x6')]('Email',_0x4db8('0xb')),'defaultValue':_0x4db8('0xc'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index cbeb082..b1fefd1 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 _0x5eef=['error','code','message','info','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','end','sendStatus','stack','name','send','index','map','type','key','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','MailMessage','include','findAll','rows','show','params','rawAttributes','fields','includeAll','find','body','describe','create','direction','out','secret','split','MailAccount','findOne','MailAccountId','CmList','List','CmContact','Contacts','updatedAt','DESC','Smtp','isNil','service','host','port','secure','auth','user','pass','attachments','root','server/files/attachments','ListId','SendMail','sendMail','messageId','YYYY-MM-DD\x20HH:mm:ss','mail','read','readAt','format','UserId','agent','get','MailInteraction','MailInteractionId','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','User','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','fromString','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','QueryTypes','fullname','EventManager','unix','toString','join','files','tmp','message-%s.eml','from','bcc','subject','createdAt','Attachment','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','push','readFileSync','build','writeFileSync','download','unlinkSync','eml-format','moment','bluebird','util','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','html-entities','./mailMessage.socket','register','jayson/promise','http','request','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0x5eef,0x144));var _0xf5ee=function(_0x4bf551,_0x2a8b39){_0x4bf551=_0x4bf551-0x0;var _0x31da5f=_0x5eef[_0x4bf551];return _0x31da5f;};'use strict';var emlformat=require(_0xf5ee('0x0'));var moment=require(_0xf5ee('0x1'));var BPromise=require(_0xf5ee('0x2'));var util=require(_0xf5ee('0x3'));var path=require('path');var fs=require('fs');var _=require(_0xf5ee('0x4'));var Redis=require(_0xf5ee('0x5'));var htmlToText=require(_0xf5ee('0x6'));var qs=require(_0xf5ee('0x7'));var logger=require(_0xf5ee('0x8'))(_0xf5ee('0x9'));var interaction_log=require(_0xf5ee('0x8'))(_0xf5ee('0xa'));var config=require(_0xf5ee('0xb'));var db=require(_0xf5ee('0xc'))['db'];config['redis']=_[_0xf5ee('0xd')](config['redis'],{'host':_0xf5ee('0xe'),'port':0x18eb});var socket=require(_0xf5ee('0xf'))(new Redis(config[_0xf5ee('0x10')]));var htmlEntities=require(_0xf5ee('0x11'));require(_0xf5ee('0x12'))[_0xf5ee('0x13')](socket);var jayson=require(_0xf5ee('0x14'));var client=jayson['client'][_0xf5ee('0x15')]({'port':0x232c});var client9003=jayson['client'][_0xf5ee('0x15')]({'port':0x232b});var client9002=jayson['client'][_0xf5ee('0x15')]({'port':0x232a});function respondWithRpcPromise(_0x1abd20,_0x203e5a,_0x335707,_0x407393){return new BPromise(function(_0xb48c49,_0x34de97){var _0x5a95f8=_0x407393||client;return _0x5a95f8[_0xf5ee('0x16')](_0x1abd20,_0x335707)[_0xf5ee('0x17')](function(_0x3df0f6){logger['info'](_0xf5ee('0x18'),_0x203e5a,_0xf5ee('0x19'));logger[_0xf5ee('0x1a')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x203e5a,'request\x20sent',JSON[_0xf5ee('0x1b')](_0x3df0f6));if(_0x3df0f6[_0xf5ee('0x1c')]){if(_0x3df0f6[_0xf5ee('0x1c')][_0xf5ee('0x1d')]===0x1f4){logger[_0xf5ee('0x1c')](_0xf5ee('0x18'),_0x203e5a,_0x3df0f6[_0xf5ee('0x1c')]['message']);return _0x34de97(_0x3df0f6[_0xf5ee('0x1c')][_0xf5ee('0x1e')]);}logger['error'](_0xf5ee('0x18'),_0x203e5a,_0x3df0f6[_0xf5ee('0x1c')]['message']);return _0xb48c49(_0x3df0f6['error'][_0xf5ee('0x1e')]);}else{logger[_0xf5ee('0x1f')](_0xf5ee('0x18'),_0x203e5a,_0xf5ee('0x19'));_0xb48c49(_0x3df0f6[_0xf5ee('0x20')][_0xf5ee('0x1e')]);}})[_0xf5ee('0x21')](function(_0x99718f){logger[_0xf5ee('0x1c')](_0xf5ee('0x18'),_0x203e5a,_0x99718f);_0x34de97(_0x99718f);});});}function respondWithResult(_0x1b0a65,_0x524c5e){_0x524c5e=_0x524c5e||0xc8;return function(_0x4cfaf1){if(_0x4cfaf1){return _0x1b0a65[_0xf5ee('0x22')](_0x524c5e)[_0xf5ee('0x23')](_0x4cfaf1);}};}function respondWithFilteredResult(_0xe6c3b,_0x1c8c88){return function(_0x22d017){if(_0x22d017){var _0x543351=typeof _0x1c8c88[_0xf5ee('0x24')]===_0xf5ee('0x25')&&typeof _0x1c8c88[_0xf5ee('0x26')]===_0xf5ee('0x25');var _0x530132=_0x22d017[_0xf5ee('0x27')];var _0x3eefc0=_0x543351?0x0:_0x1c8c88[_0xf5ee('0x24')];var _0xe5fa78=_0x543351?_0x22d017[_0xf5ee('0x27')]:_0x1c8c88[_0xf5ee('0x24')]+_0x1c8c88[_0xf5ee('0x26')];var _0x400d02;if(_0xe5fa78>=_0x530132){_0xe5fa78=_0x530132;_0x400d02=0xc8;}else{_0x400d02=0xce;}_0xe6c3b[_0xf5ee('0x22')](_0x400d02);return _0xe6c3b[_0xf5ee('0x28')](_0xf5ee('0x29'),_0x3eefc0+'-'+_0xe5fa78+'/'+_0x530132)[_0xf5ee('0x23')](_0x22d017);}return null;};}function saveUpdates(_0x308c61){return function(_0x31affd){if(_0x31affd){return _0x31affd[_0xf5ee('0x2a')](_0x308c61)[_0xf5ee('0x17')](function(_0x49311d){return _0x49311d;});}return null;};}function removeEntity(_0x3b50de){return function(_0x425bf2){if(_0x425bf2){return _0x425bf2[_0xf5ee('0x2b')]()[_0xf5ee('0x17')](function(){_0x3b50de[_0xf5ee('0x22')](0xcc)[_0xf5ee('0x2c')]();});}};}function handleEntityNotFound(_0xf77ef6){return function(_0x5344cb){if(!_0x5344cb){_0xf77ef6[_0xf5ee('0x2d')](0x194);}return _0x5344cb;};}function handleError(_0x583fd8,_0x4a24ed){_0x4a24ed=_0x4a24ed||0x1f4;return function(_0x5e1fad){logger[_0xf5ee('0x1c')](_0x5e1fad[_0xf5ee('0x2e')]);if(_0x5e1fad[_0xf5ee('0x2f')]){delete _0x5e1fad['name'];}_0x583fd8[_0xf5ee('0x22')](_0x4a24ed)[_0xf5ee('0x30')](_0x5e1fad);};}exports[_0xf5ee('0x31')]=function(_0x3e84c1,_0x8855d5){var _0x49d24b={},_0x1da516={},_0xe85d59={'count':0x0,'rows':[]};var _0x5da3bc=_[_0xf5ee('0x32')](db['MailMessage']['rawAttributes'],function(_0x14d3a0){return{'name':_0x14d3a0['fieldName'],'type':_0x14d3a0[_0xf5ee('0x33')][_0xf5ee('0x34')]};});_0x1da516[_0xf5ee('0x35')]=_[_0xf5ee('0x32')](_0x5da3bc,_0xf5ee('0x2f'));_0x1da516[_0xf5ee('0x36')]=_[_0xf5ee('0x37')](_0x3e84c1[_0xf5ee('0x36')]);_0x1da516[_0xf5ee('0x38')]=_['intersection'](_0x1da516[_0xf5ee('0x35')],_0x1da516[_0xf5ee('0x36')]);_0x49d24b[_0xf5ee('0x39')]=_[_0xf5ee('0x3a')](_0x1da516[_0xf5ee('0x35')],qs['fields'](_0x3e84c1[_0xf5ee('0x36')]['fields']));_0x49d24b[_0xf5ee('0x39')]=_0x49d24b['attributes'][_0xf5ee('0x3b')]?_0x49d24b[_0xf5ee('0x39')]:_0x1da516[_0xf5ee('0x35')];if(!_0x3e84c1[_0xf5ee('0x36')][_0xf5ee('0x3c')](_0xf5ee('0x3d'))){_0x49d24b['limit']=qs[_0xf5ee('0x26')](_0x3e84c1[_0xf5ee('0x36')]['limit']);_0x49d24b['offset']=qs[_0xf5ee('0x24')](_0x3e84c1[_0xf5ee('0x36')][_0xf5ee('0x24')]);}_0x49d24b[_0xf5ee('0x3e')]=qs[_0xf5ee('0x3f')](_0x3e84c1[_0xf5ee('0x36')][_0xf5ee('0x3f')]);_0x49d24b['where']=qs[_0xf5ee('0x38')](_[_0xf5ee('0x40')](_0x3e84c1['query'],_0x1da516['filters']),_0x5da3bc);if(_0x3e84c1[_0xf5ee('0x36')][_0xf5ee('0x41')]){_0x49d24b[_0xf5ee('0x42')]=_[_0xf5ee('0x43')](_0x49d24b[_0xf5ee('0x42')],{'$or':_[_0xf5ee('0x32')](_0x5da3bc,function(_0x42f030){if(_0x42f030[_0xf5ee('0x33')]!==_0xf5ee('0x44')){var _0x7d199a={};_0x7d199a[_0x42f030[_0xf5ee('0x2f')]]={'$like':'%'+_0x3e84c1[_0xf5ee('0x36')][_0xf5ee('0x41')]+'%'};return _0x7d199a;}})});}_0x49d24b=_['merge']({},_0x49d24b,_0x3e84c1['options']);var _0x2f5f81={'where':_0x49d24b[_0xf5ee('0x42')]};return db[_0xf5ee('0x45')][_0xf5ee('0x27')](_0x2f5f81)[_0xf5ee('0x17')](function(_0x1bef60){_0xe85d59[_0xf5ee('0x27')]=_0x1bef60;if(_0x3e84c1[_0xf5ee('0x36')]['includeAll']){_0x49d24b[_0xf5ee('0x46')]=[{'all':!![]}];}return db['MailMessage'][_0xf5ee('0x47')](_0x49d24b);})[_0xf5ee('0x17')](function(_0x1d6400){_0xe85d59[_0xf5ee('0x48')]=_0x1d6400;return _0xe85d59;})['then'](respondWithFilteredResult(_0x8855d5,_0x49d24b))[_0xf5ee('0x21')](handleError(_0x8855d5,null));};exports[_0xf5ee('0x49')]=function(_0x4099ab,_0x5e0df5){var _0x5dff82={'raw':!![],'where':{'id':_0x4099ab[_0xf5ee('0x4a')]['id']}},_0x4610ab={};_0x4610ab[_0xf5ee('0x35')]=_['keys'](db[_0xf5ee('0x45')][_0xf5ee('0x4b')]);_0x4610ab['query']=_['keys'](_0x4099ab[_0xf5ee('0x36')]);_0x4610ab['filters']=_['intersection'](_0x4610ab[_0xf5ee('0x35')],_0x4610ab['query']);_0x5dff82['attributes']=_['intersection'](_0x4610ab['model'],qs[_0xf5ee('0x4c')](_0x4099ab[_0xf5ee('0x36')][_0xf5ee('0x4c')]));_0x5dff82[_0xf5ee('0x39')]=_0x5dff82[_0xf5ee('0x39')]['length']?_0x5dff82[_0xf5ee('0x39')]:_0x4610ab[_0xf5ee('0x35')];if(_0x4099ab['query'][_0xf5ee('0x4d')]){_0x5dff82[_0xf5ee('0x46')]=[{'all':!![]}];}_0x5dff82=_[_0xf5ee('0x43')]({},_0x5dff82,_0x4099ab['options']);return db['MailMessage'][_0xf5ee('0x4e')](_0x5dff82)['then'](handleEntityNotFound(_0x5e0df5,null))[_0xf5ee('0x17')](respondWithResult(_0x5e0df5,null))[_0xf5ee('0x21')](handleError(_0x5e0df5,null));};exports['update']=function(_0x21536d,_0x2b397a){if(_0x21536d[_0xf5ee('0x4f')]['id']){delete _0x21536d[_0xf5ee('0x4f')]['id'];}return db['MailMessage'][_0xf5ee('0x4e')]({'where':{'id':_0x21536d[_0xf5ee('0x4a')]['id']}})[_0xf5ee('0x17')](handleEntityNotFound(_0x2b397a,null))[_0xf5ee('0x17')](saveUpdates(_0x21536d[_0xf5ee('0x4f')],null))[_0xf5ee('0x17')](respondWithResult(_0x2b397a,null))['catch'](handleError(_0x2b397a,null));};exports[_0xf5ee('0x2b')]=function(_0x1d46d0,_0x51bc1a){return db['MailMessage']['find']({'where':{'id':_0x1d46d0[_0xf5ee('0x4a')]['id']}})['then'](handleEntityNotFound(_0x51bc1a,null))[_0xf5ee('0x17')](removeEntity(_0x51bc1a,null))['catch'](handleError(_0x51bc1a,null));};exports[_0xf5ee('0x50')]=function(_0x4f3e29,_0x1d2bfe){return db[_0xf5ee('0x45')]['describe']()['then'](respondWithResult(_0x1d2bfe,null))[_0xf5ee('0x21')](handleError(_0x1d2bfe,null));};exports['create']=function(_0x10a56d,_0x54cda2){return db['MailMessage'][_0xf5ee('0x51')](_0x10a56d[_0xf5ee('0x4f')])['then'](function(_0x10e3e2){if(_0x10e3e2){if(_0x10e3e2[_0xf5ee('0x52')]===_0xf5ee('0x53')&&!_0x10e3e2[_0xf5ee('0x54')]){var _0x2fed9a,_0xe78596,_0x20da75;if(_0x10a56d[_0xf5ee('0x4f')]['to']){_0xe78596=_0x10a56d['body']['to'][_0xf5ee('0x55')](',')[0x0];}return db[_0xf5ee('0x56')][_0xf5ee('0x57')]({'where':{'id':_0x10e3e2[_0xf5ee('0x58')]},'include':[{'model':db[_0xf5ee('0x59')],'as':_0xf5ee('0x5a'),'include':[{'model':db[_0xf5ee('0x5b')],'as':_0xf5ee('0x5c'),'where':{'email':_0xe78596},'limit':0x1,'order':[[_0xf5ee('0x5d'),_0xf5ee('0x5e')]]}]},{'model':db['MailServerOut'],'as':_0xf5ee('0x5f'),'raw':!![]}]})[_0xf5ee('0x17')](function(_0x34ae14){_0x2fed9a=_0x34ae14;if(_0x2fed9a&&_0x2fed9a[_0xf5ee('0x5f')]){var _0x2c2b5b={'tls':{'rejectUnauthorized':![]}};if(_[_0xf5ee('0x60')](_0x2fed9a[_0xf5ee('0x5f')][_0xf5ee('0x61')])){_0x2c2b5b['host']=_0x2fed9a[_0xf5ee('0x5f')][_0xf5ee('0x62')];_0x2c2b5b[_0xf5ee('0x63')]=_0x2fed9a[_0xf5ee('0x5f')][_0xf5ee('0x63')];_0x2c2b5b[_0xf5ee('0x64')]=_0x2fed9a[_0xf5ee('0x5f')]['secure'];if(_0x2fed9a[_0xf5ee('0x5f')]['authentication']){_0x2c2b5b[_0xf5ee('0x65')]={'user':_0x2fed9a[_0xf5ee('0x5f')][_0xf5ee('0x66')],'pass':_0x2fed9a['Smtp'][_0xf5ee('0x67')]};}}else{_0x2c2b5b['service']=_0x2fed9a['Smtp'][_0xf5ee('0x61')];_0x2c2b5b['auth']={'user':_0x2fed9a[_0xf5ee('0x5f')][_0xf5ee('0x66')],'pass':_0x2fed9a[_0xf5ee('0x5f')][_0xf5ee('0x67')]};_0x2c2b5b['secure']=_0x2fed9a[_0xf5ee('0x5f')][_0xf5ee('0x64')];}if(_0x10a56d[_0xf5ee('0x4f')][_0xf5ee('0x68')]&&_0x10a56d['body']['attachments']['length']){for(var _0x18990c=0x0;_0x18990c<_0x10a56d[_0xf5ee('0x4f')]['attachments'][_0xf5ee('0x3b')];_0x18990c+=0x1){_0x10a56d[_0xf5ee('0x4f')]['attachments'][_0x18990c]={'filename':_0x10a56d[_0xf5ee('0x4f')][_0xf5ee('0x68')][_0x18990c]['name'],'path':path['join'](config[_0xf5ee('0x69')],_0xf5ee('0x6a'),_0x10a56d['body'][_0xf5ee('0x68')][_0x18990c]['basename'])};}}_0x20da75={'account':_0x2c2b5b,'message':_0x10a56d['body']};return;}})[_0xf5ee('0x17')](function(){if(_0x2fed9a[_0xf5ee('0x5a')]){if(_0x2fed9a[_0xf5ee('0x5a')][_0xf5ee('0x5c')][_0xf5ee('0x3b')]){return _0x2fed9a['List']['Contacts'][0x0];}else{return db[_0xf5ee('0x5b')][_0xf5ee('0x51')](_[_0xf5ee('0xd')](_0x10a56d[_0xf5ee('0x4f')],{'firstName':_0x10a56d[_0xf5ee('0x4f')]['to'],'email':_0x10a56d[_0xf5ee('0x4f')]['to'],'phone':_0x10a56d['body']['to'],'ListId':_0x2fed9a[_0xf5ee('0x6b')]}));}}else{throw new Error('List\x20not\x20found');}})[_0xf5ee('0x17')](function(){if(_0x20da75){return respondWithRpcPromise(_0xf5ee('0x6c'),_0xf5ee('0x6d'),_0x20da75,client9003)[_0xf5ee('0x17')](function(_0x3ea305){return _0x10e3e2[_0xf5ee('0x2a')]({'read':!![],'messageId':_0x3ea305[_0xf5ee('0x6e')],'sentAt':moment()['format'](_0xf5ee('0x6f'))});})[_0xf5ee('0x21')](function(_0x5e91aa){logger[_0xf5ee('0x1c')]('%s',JSON[_0xf5ee('0x1b')](_0x5e91aa));return _0x10e3e2;});}return _0x10e3e2;});}return _0x10e3e2;}})[_0xf5ee('0x17')](respondWithResult(_0x54cda2,0xc9))['catch'](handleError(_0x54cda2,null));};exports['accept']=function(_0x5bcb4f,_0x453433){var _0xcf5ec4={'agent':{},'channel':_0xf5ee('0x70')};if(_0x5bcb4f[_0xf5ee('0x4f')]['id']){delete _0x5bcb4f[_0xf5ee('0x4f')]['id'];}_0x5bcb4f[_0xf5ee('0x4f')][_0xf5ee('0x71')]=!![];_0x5bcb4f[_0xf5ee('0x4f')][_0xf5ee('0x72')]=moment()[_0xf5ee('0x73')](_0xf5ee('0x6f'));_0x5bcb4f[_0xf5ee('0x4f')][_0xf5ee('0x74')]=_0x5bcb4f[_0xf5ee('0x4f')]['UserId']||_0x5bcb4f[_0xf5ee('0x66')]['id'];_0xcf5ec4[_0xf5ee('0x75')]['id']=_0x5bcb4f[_0xf5ee('0x4f')]['UserId'];return db[_0xf5ee('0x45')][_0xf5ee('0x4e')]({'where':{'id':_0x5bcb4f[_0xf5ee('0x4a')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x453433,null))[_0xf5ee('0x17')](saveUpdates(_0x5bcb4f[_0xf5ee('0x4f')],null))['then'](function(_0x26a7d9){if(_0x26a7d9){_0xcf5ec4[_0xf5ee('0x1e')]=_0x26a7d9[_0xf5ee('0x76')]({'plain':!![]});return db[_0xf5ee('0x77')][_0xf5ee('0x4e')]({'where':{'id':_0x26a7d9[_0xf5ee('0x78')]}});}return null;})[_0xf5ee('0x17')](handleEntityNotFound(_0x453433,null))[_0xf5ee('0x17')](function(_0x4a7cc7){if(_0x4a7cc7){return _0x4a7cc7[_0xf5ee('0x2a')]({'UserId':_0x5bcb4f[_0xf5ee('0x4f')][_0xf5ee('0x74')],'read1stAt':_[_0xf5ee('0x60')](_0x4a7cc7[_0xf5ee('0x79')])?moment()[_0xf5ee('0x73')](_0xf5ee('0x6f')):undefined});}return null;})[_0xf5ee('0x17')](function(_0x3385fd){if(_0x3385fd){_0xcf5ec4[_0xf5ee('0x7a')]=_0x3385fd[_0xf5ee('0x76')]({'plain':!![]});interaction_log[_0xf5ee('0x1f')](_0xf5ee('0x7b'),_0x5bcb4f['user']['id'],_0x5bcb4f[_0xf5ee('0x66')][_0xf5ee('0x2f')],_0x5bcb4f[_0xf5ee('0x66')][_0xf5ee('0x7c')],_0xcf5ec4[_0xf5ee('0x7a')]['id'],_0x5bcb4f[_0xf5ee('0x4f')]?JSON[_0xf5ee('0x1b')](_0x5bcb4f[_0xf5ee('0x4f')]):'null');return respondWithRpcPromise(_0xf5ee('0x7d'),_0xf5ee('0x7e'),_0xcf5ec4);}return null;})[_0xf5ee('0x17')](function(_0xe9d7eb){var _0x51bc5f=_0xf5ee('0x7f')+_0xe9d7eb[_0xf5ee('0x1e')][_0xf5ee('0x80')];return db[_0xf5ee('0x81')][_0xf5ee('0x36')](_0x51bc5f,{'type':db[_0xf5ee('0x82')]['QueryTypes'][_0xf5ee('0x83')],'raw':!![]})[_0xf5ee('0x17')](function(_0x56ca9b){return _0x56ca9b;});})['then'](function(_0x2acb6f){if(_0x2acb6f){_0xcf5ec4['message'][_0xf5ee('0x84')]=_0x2acb6f[0x0];if(!_0x5bcb4f['body'][_0xf5ee('0x74')])return;return db[_0xf5ee('0x85')][_0xf5ee('0x4e')]({'where':{'id':_0x5bcb4f[_0xf5ee('0x4f')][_0xf5ee('0x74')],'role':_0xf5ee('0x75')},'attributes':['id','name','fullname',_0xf5ee('0x86'),_0xf5ee('0x87')],'raw':!![]});}return null;})['then'](function(_0x440167){if(!_0x440167)return null;_0xcf5ec4['message'][_0xf5ee('0x75')]=_0x440167;return _0xcf5ec4;})[_0xf5ee('0x17')](function(_0x258ec7){if(_0x258ec7){if(_0x5bcb4f[_0xf5ee('0x4f')][_0xf5ee('0x88')]){_0xcf5ec4[_0xf5ee('0x1e')][_0xf5ee('0x89')]=util[_0xf5ee('0x73')](_0xf5ee('0x8a'),_0x5bcb4f['user'][_0xf5ee('0x2f')]);_0xcf5ec4['message'][_0xf5ee('0x8b')]=_0xcf5ec4[_0xf5ee('0x8b')];_0xcf5ec4['message'][_0xf5ee('0x8c')]=_0xcf5ec4['channel'];_0xcf5ec4['message'][_0xf5ee('0x8d')]=_0xf5ee('0x8e');_0xcf5ec4[_0xf5ee('0x1e')][_0xf5ee('0x4f')]=htmlToText[_0xf5ee('0x8f')](_0xcf5ec4['message'][_0xf5ee('0x4f')]);return respondWithRpcPromise('EventManager','EventManager',{'event':'acceptmessage','message':_0xcf5ec4[_0xf5ee('0x1e')]},client9002)['then'](function(){return _0xcf5ec4;});}return _0xcf5ec4;}return null;})[_0xf5ee('0x17')](respondWithResult(_0x453433,null))[_0xf5ee('0x21')](handleError(_0x453433,null));};exports[_0xf5ee('0x90')]=function(_0x596e24,_0x2afc3c){var _0x44db57={'agent':{},'channel':_0xf5ee('0x70')};if(_0x596e24[_0xf5ee('0x4f')]['id']){delete _0x596e24['body']['id'];}_0x596e24[_0xf5ee('0x4f')][_0xf5ee('0x74')]=_0x596e24['body'][_0xf5ee('0x74')]||_0x596e24[_0xf5ee('0x66')]['id'];_0x44db57[_0xf5ee('0x75')]['id']=_0x596e24['body'][_0xf5ee('0x74')];return db[_0xf5ee('0x45')][_0xf5ee('0x4e')]({'where':{'id':_0x596e24[_0xf5ee('0x4a')]['id'],'UserId':null}})[_0xf5ee('0x17')](handleEntityNotFound(_0x2afc3c,null))['then'](function(_0x287bee){if(_0x287bee){_0x44db57[_0xf5ee('0x1e')]=_0x287bee[_0xf5ee('0x76')]({'plain':!![]});return db[_0xf5ee('0x77')][_0xf5ee('0x4e')]({'where':{'id':_0x287bee['MailInteractionId']}});}return null;})[_0xf5ee('0x17')](handleEntityNotFound(_0x2afc3c,null))['then'](function(_0x30fe18){if(_0x30fe18){_0x44db57[_0xf5ee('0x7a')]=_0x30fe18[_0xf5ee('0x76')]({'plain':!![]});interaction_log[_0xf5ee('0x1f')](_0xf5ee('0x91'),_0x596e24[_0xf5ee('0x66')]['id'],_0x596e24[_0xf5ee('0x66')]['name'],_0x596e24[_0xf5ee('0x66')][_0xf5ee('0x7c')],_0x44db57[_0xf5ee('0x7a')]['id'],_0x596e24['body']?JSON['stringify'](_0x596e24['body']):_0xf5ee('0x92'));return respondWithRpcPromise(_0xf5ee('0x93'),_0xf5ee('0x94'),_0x44db57);}return null;})[_0xf5ee('0x17')](function(_0x28765c){var _0x412479=_0xf5ee('0x7f')+_0x28765c[_0xf5ee('0x1e')][_0xf5ee('0x80')];return db[_0xf5ee('0x81')]['query'](_0x412479,{'type':db[_0xf5ee('0x82')][_0xf5ee('0x95')]['SELECT'],'raw':!![]})[_0xf5ee('0x17')](function(_0x141cf1){return _0x141cf1;});})['then'](function(_0x13b01b){if(_0x13b01b){_0x44db57[_0xf5ee('0x1e')][_0xf5ee('0x84')]=_0x13b01b[0x0];if(!_0x596e24[_0xf5ee('0x4f')][_0xf5ee('0x74')])return;return db[_0xf5ee('0x85')][_0xf5ee('0x4e')]({'where':{'id':_0x596e24['body'][_0xf5ee('0x74')],'role':_0xf5ee('0x75')},'attributes':['id','name',_0xf5ee('0x96'),_0xf5ee('0x86'),_0xf5ee('0x87')],'raw':!![]});}return null;})[_0xf5ee('0x17')](function(_0x262ded){if(!_0x262ded)return null;_0x44db57[_0xf5ee('0x1e')][_0xf5ee('0x75')]=_0x262ded;return _0x44db57;})[_0xf5ee('0x17')](function(_0x3dfac8){if(_0x3dfac8){_0x3dfac8[_0xf5ee('0x1e')][_0xf5ee('0x89')]=util[_0xf5ee('0x73')](_0xf5ee('0x8a'),_0x596e24[_0xf5ee('0x66')][_0xf5ee('0x2f')]);_0x3dfac8[_0xf5ee('0x1e')][_0xf5ee('0x8b')]=_0x44db57[_0xf5ee('0x8b')];_0x3dfac8[_0xf5ee('0x1e')][_0xf5ee('0x8c')]=_0x44db57[_0xf5ee('0x8b')];_0x3dfac8[_0xf5ee('0x1e')][_0xf5ee('0x8d')]=_0xf5ee('0x90');_0x3dfac8[_0xf5ee('0x1e')]['body']=htmlToText[_0xf5ee('0x8f')](_0x44db57[_0xf5ee('0x1e')][_0xf5ee('0x4f')]);respondWithRpcPromise(_0xf5ee('0x97'),'EventManager',{'event':'rejectmessage','message':_0x3dfac8['message']},client9002);return _0x44db57;}return null;})[_0xf5ee('0x17')](respondWithResult(_0x2afc3c,null))['catch'](handleError(_0x2afc3c,null));};exports['download']=function(_0x42530,_0x43e562){var _0x4bfe6a=moment()[_0xf5ee('0x98')]()[_0xf5ee('0x99')]();var _0x53835c=path[_0xf5ee('0x9a')](config[_0xf5ee('0x69')],'server',_0xf5ee('0x9b'),_0xf5ee('0x9c'));var _0x2d3e5b=path[_0xf5ee('0x9a')](config[_0xf5ee('0x69')],'server',_0xf5ee('0x9b'),_0xf5ee('0x68'));var _0x486118=util[_0xf5ee('0x73')](_0xf5ee('0x9d'),_0x4bfe6a);return db[_0xf5ee('0x45')]['find']({'where':{'id':_0x42530[_0xf5ee('0x4a')]['id']},'attributes':['id','body',_0xf5ee('0x9e'),'to','cc',_0xf5ee('0x9f'),_0xf5ee('0xa0'),_0xf5ee('0xa1')],'include':_0x42530[_0xf5ee('0x36')][_0xf5ee('0x68')]?[{'model':db[_0xf5ee('0xa2')],'as':_0xf5ee('0xa3')}]:undefined})[_0xf5ee('0x17')](handleEntityNotFound(_0x43e562,null))[_0xf5ee('0x17')](function(_0x3f68e8){if(_0x3f68e8){var _0xfc7c13=_0x3f68e8;var _0x34fb9d={'from':_0xfc7c13['from'],'to':_0xfc7c13['to'],'subject':_0xfc7c13[_0xf5ee('0xa0')],'html':htmlEntities[_0xf5ee('0xa4')](_0xfc7c13[_0xf5ee('0x4f')]),'headers':{'Date':moment(_0xfc7c13['createdAt'])['format'](_0xf5ee('0xa5'))},'attachments':[]};if(_0x3f68e8['cc']){_0x34fb9d['headers']['Cc']=_0x3f68e8['cc'];}if(_0x3f68e8[_0xf5ee('0x9f')]){_0x34fb9d[_0xf5ee('0xa6')][_0xf5ee('0xa7')]=_0x3f68e8[_0xf5ee('0x9f')];}return new BPromise(function(_0x590086,_0x20e6a0){if(_0x3f68e8[_0xf5ee('0xa3')]){for(var _0x21fd0d=0x0;_0x21fd0d<_0x3f68e8[_0xf5ee('0xa3')][_0xf5ee('0x3b')];_0x21fd0d++){var _0x291ee7=_0x3f68e8[_0xf5ee('0xa3')][_0x21fd0d];var _0x216308=path[_0xf5ee('0x9a')](_0x2d3e5b,_0x291ee7[_0xf5ee('0xa8')]);if(fs[_0xf5ee('0xa9')](_0x216308)){_0x34fb9d[_0xf5ee('0x68')][_0xf5ee('0xaa')]({'name':_0x291ee7['name'],'contentType':_0x291ee7[_0xf5ee('0x33')],'data':fs[_0xf5ee('0xab')](_0x216308)});}}}emlformat[_0xf5ee('0xac')](_0x34fb9d,function(_0x2286df,_0x5b28a5){if(_0x2286df)return _0x20e6a0(_0x2286df);fs[_0xf5ee('0xad')](path[_0xf5ee('0x9a')](_0x53835c,_0x486118),_0x5b28a5);return _0x590086(_0x5b28a5);});});}})[_0xf5ee('0x17')](function(_0x44682e){if(_0x44682e){return _0x43e562[_0xf5ee('0xae')](path[_0xf5ee('0x9a')](_0x53835c,_0x486118),_0x486118,function(_0x5ec47c){if(!_0x5ec47c)fs[_0xf5ee('0xaf')](path['join'](_0x53835c,_0x486118));});}})['catch'](handleError(_0x43e562,null));}; \ No newline at end of file +var _0x8fe0=['model','fields','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','MailMessage','includeAll','include','rows','params','filters','length','options','body','find','describe','create','direction','out','secret','split','MailAccount','findOne','MailAccountId','CmList','List','CmContact','Contacts','updatedAt','MailServerOut','Smtp','isNil','host','port','secure','authentication','auth','user','pass','service','attachments','join','server/files/attachments','ListId','List\x20not\x20found','SendMail','sendMail','messageId','format','accept','mail','read','UserId','agent','MailInteraction','read1stAt','interaction','get','role','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','contact','User','fullname','email','internal','manual','interface','channel','motionChannel','event','fromString','EventManager','acceptmessage','reject','MailInteractionId','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','SELECT','rejectmessage','download','unix','root','server','files','message-%s.eml','from','bcc','subject','createdAt','Attachments','headers','Bcc','basename','existsSync','push','build','writeFileSync','eml-format','bluebird','util','lodash','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','defaults','socket.io-emitter','redis','html-entities','./mailMessage.socket','jayson/promise','http','client','request','then','info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code','message','MailMessage,\x20%s,\x20%s','catch','status','json','undefined','limit','count','offset','set','Content-Range','update','destroy','end','sendStatus','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','intersection'];(function(_0xc97e22,_0x59577c){var _0x160f39=function(_0x1d6750){while(--_0x1d6750){_0xc97e22['push'](_0xc97e22['shift']());}};_0x160f39(++_0x59577c);}(_0x8fe0,0x6f));var _0x08fe=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x8fe0[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require(_0x08fe('0x0'));var moment=require('moment');var BPromise=require(_0x08fe('0x1'));var util=require(_0x08fe('0x2'));var path=require('path');var fs=require('fs');var _=require(_0x08fe('0x3'));var Redis=require('ioredis');var htmlToText=require(_0x08fe('0x4'));var qs=require(_0x08fe('0x5'));var logger=require(_0x08fe('0x6'))(_0x08fe('0x7'));var interaction_log=require('../../config/logger')(_0x08fe('0x8'));var config=require(_0x08fe('0x9'));var db=require(_0x08fe('0xa'))['db'];config['redis']=_[_0x08fe('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x08fe('0xc'))(new Redis(config[_0x08fe('0xd')]));var htmlEntities=require(_0x08fe('0xe'));require(_0x08fe('0xf'))['register'](socket);var jayson=require(_0x08fe('0x10'));var client=jayson['client'][_0x08fe('0x11')]({'port':0x232c});var client9003=jayson[_0x08fe('0x12')][_0x08fe('0x11')]({'port':0x232b});var client9002=jayson[_0x08fe('0x12')][_0x08fe('0x11')]({'port':0x232a});function respondWithRpcPromise(_0x589611,_0x2b37d4,_0xf4f1f7,_0x184491){return new BPromise(function(_0x52f203,_0x4f2b8a){var _0x5e2e30=_0x184491||client;return _0x5e2e30[_0x08fe('0x13')](_0x589611,_0xf4f1f7)[_0x08fe('0x14')](function(_0xac008c){logger[_0x08fe('0x15')]('MailMessage,\x20%s,\x20%s',_0x2b37d4,_0x08fe('0x16'));logger[_0x08fe('0x17')](_0x08fe('0x18'),_0x2b37d4,'request\x20sent',JSON['stringify'](_0xac008c));if(_0xac008c[_0x08fe('0x19')]){if(_0xac008c['error'][_0x08fe('0x1a')]===0x1f4){logger['error']('MailMessage,\x20%s,\x20%s',_0x2b37d4,_0xac008c[_0x08fe('0x19')][_0x08fe('0x1b')]);return _0x4f2b8a(_0xac008c['error'][_0x08fe('0x1b')]);}logger[_0x08fe('0x19')](_0x08fe('0x1c'),_0x2b37d4,_0xac008c[_0x08fe('0x19')][_0x08fe('0x1b')]);return _0x52f203(_0xac008c[_0x08fe('0x19')]['message']);}else{logger['info'](_0x08fe('0x1c'),_0x2b37d4,_0x08fe('0x16'));_0x52f203(_0xac008c['result'][_0x08fe('0x1b')]);}})[_0x08fe('0x1d')](function(_0x3e2cd2){logger[_0x08fe('0x19')](_0x08fe('0x1c'),_0x2b37d4,_0x3e2cd2);_0x4f2b8a(_0x3e2cd2);});});}function respondWithResult(_0x178ca6,_0x498128){_0x498128=_0x498128||0xc8;return function(_0x5b4cf0){if(_0x5b4cf0){return _0x178ca6[_0x08fe('0x1e')](_0x498128)[_0x08fe('0x1f')](_0x5b4cf0);}};}function respondWithFilteredResult(_0x1837cc,_0x501615){return function(_0x25549d){if(_0x25549d){var _0x1a842a=typeof _0x501615['offset']===_0x08fe('0x20')&&typeof _0x501615[_0x08fe('0x21')]===_0x08fe('0x20');var _0x446d6a=_0x25549d[_0x08fe('0x22')];var _0x4d3ac2=_0x1a842a?0x0:_0x501615['offset'];var _0x44c1c6=_0x1a842a?_0x25549d['count']:_0x501615[_0x08fe('0x23')]+_0x501615[_0x08fe('0x21')];var _0x359701;if(_0x44c1c6>=_0x446d6a){_0x44c1c6=_0x446d6a;_0x359701=0xc8;}else{_0x359701=0xce;}_0x1837cc[_0x08fe('0x1e')](_0x359701);return _0x1837cc[_0x08fe('0x24')](_0x08fe('0x25'),_0x4d3ac2+'-'+_0x44c1c6+'/'+_0x446d6a)['json'](_0x25549d);}return null;};}function saveUpdates(_0x35976a){return function(_0x43c734){if(_0x43c734){return _0x43c734[_0x08fe('0x26')](_0x35976a)[_0x08fe('0x14')](function(_0x42e3bd){return _0x42e3bd;});}return null;};}function removeEntity(_0x5ac07e){return function(_0x8949d5){if(_0x8949d5){return _0x8949d5[_0x08fe('0x27')]()[_0x08fe('0x14')](function(){_0x5ac07e[_0x08fe('0x1e')](0xcc)[_0x08fe('0x28')]();});}};}function handleEntityNotFound(_0x167eb9){return function(_0x577a18){if(!_0x577a18){_0x167eb9[_0x08fe('0x29')](0x194);}return _0x577a18;};}function handleError(_0x1d1234,_0x3f9bd8){_0x3f9bd8=_0x3f9bd8||0x1f4;return function(_0x2a26ac){logger['error'](_0x2a26ac['stack']);if(_0x2a26ac[_0x08fe('0x2a')]){delete _0x2a26ac['name'];}_0x1d1234[_0x08fe('0x1e')](_0x3f9bd8)[_0x08fe('0x2b')](_0x2a26ac);};}exports[_0x08fe('0x2c')]=function(_0x17e31f,_0x920728){var _0x24ac87={},_0xc1cc92={},_0x4352a9={'count':0x0,'rows':[]};var _0x2cf1f4=_[_0x08fe('0x2d')](db['MailMessage'][_0x08fe('0x2e')],function(_0x143072){return{'name':_0x143072[_0x08fe('0x2f')],'type':_0x143072[_0x08fe('0x30')][_0x08fe('0x31')]};});_0xc1cc92['model']=_[_0x08fe('0x2d')](_0x2cf1f4,_0x08fe('0x2a'));_0xc1cc92[_0x08fe('0x32')]=_[_0x08fe('0x33')](_0x17e31f[_0x08fe('0x32')]);_0xc1cc92['filters']=_[_0x08fe('0x34')](_0xc1cc92[_0x08fe('0x35')],_0xc1cc92[_0x08fe('0x32')]);_0x24ac87['attributes']=_[_0x08fe('0x34')](_0xc1cc92[_0x08fe('0x35')],qs[_0x08fe('0x36')](_0x17e31f[_0x08fe('0x32')][_0x08fe('0x36')]));_0x24ac87['attributes']=_0x24ac87[_0x08fe('0x37')]['length']?_0x24ac87[_0x08fe('0x37')]:_0xc1cc92[_0x08fe('0x35')];if(!_0x17e31f[_0x08fe('0x32')]['hasOwnProperty'](_0x08fe('0x38'))){_0x24ac87['limit']=qs[_0x08fe('0x21')](_0x17e31f[_0x08fe('0x32')][_0x08fe('0x21')]);_0x24ac87[_0x08fe('0x23')]=qs[_0x08fe('0x23')](_0x17e31f['query']['offset']);}_0x24ac87[_0x08fe('0x39')]=qs[_0x08fe('0x3a')](_0x17e31f[_0x08fe('0x32')][_0x08fe('0x3a')]);_0x24ac87[_0x08fe('0x3b')]=qs['filters'](_[_0x08fe('0x3c')](_0x17e31f[_0x08fe('0x32')],_0xc1cc92['filters']),_0x2cf1f4);if(_0x17e31f[_0x08fe('0x32')][_0x08fe('0x3d')]){_0x24ac87[_0x08fe('0x3b')]=_[_0x08fe('0x3e')](_0x24ac87[_0x08fe('0x3b')],{'$or':_[_0x08fe('0x2d')](_0x2cf1f4,function(_0x791fa3){if(_0x791fa3['type']!==_0x08fe('0x3f')){var _0x5b9a5e={};_0x5b9a5e[_0x791fa3[_0x08fe('0x2a')]]={'$like':'%'+_0x17e31f['query']['filter']+'%'};return _0x5b9a5e;}})});}_0x24ac87=_['merge']({},_0x24ac87,_0x17e31f['options']);var _0x59e50a={'where':_0x24ac87[_0x08fe('0x3b')]};return db[_0x08fe('0x40')][_0x08fe('0x22')](_0x59e50a)[_0x08fe('0x14')](function(_0x2f808a){_0x4352a9[_0x08fe('0x22')]=_0x2f808a;if(_0x17e31f['query'][_0x08fe('0x41')]){_0x24ac87[_0x08fe('0x42')]=[{'all':!![]}];}return db[_0x08fe('0x40')]['findAll'](_0x24ac87);})[_0x08fe('0x14')](function(_0x18acdc){_0x4352a9[_0x08fe('0x43')]=_0x18acdc;return _0x4352a9;})[_0x08fe('0x14')](respondWithFilteredResult(_0x920728,_0x24ac87))[_0x08fe('0x1d')](handleError(_0x920728,null));};exports['show']=function(_0x1ee502,_0x36289c){var _0x221f34={'raw':!![],'where':{'id':_0x1ee502[_0x08fe('0x44')]['id']}},_0x3e031b={};_0x3e031b['model']=_[_0x08fe('0x33')](db[_0x08fe('0x40')][_0x08fe('0x2e')]);_0x3e031b[_0x08fe('0x32')]=_[_0x08fe('0x33')](_0x1ee502['query']);_0x3e031b[_0x08fe('0x45')]=_[_0x08fe('0x34')](_0x3e031b[_0x08fe('0x35')],_0x3e031b[_0x08fe('0x32')]);_0x221f34['attributes']=_['intersection'](_0x3e031b[_0x08fe('0x35')],qs[_0x08fe('0x36')](_0x1ee502[_0x08fe('0x32')]['fields']));_0x221f34['attributes']=_0x221f34[_0x08fe('0x37')][_0x08fe('0x46')]?_0x221f34['attributes']:_0x3e031b[_0x08fe('0x35')];if(_0x1ee502['query'][_0x08fe('0x41')]){_0x221f34[_0x08fe('0x42')]=[{'all':!![]}];}_0x221f34=_[_0x08fe('0x3e')]({},_0x221f34,_0x1ee502[_0x08fe('0x47')]);return db[_0x08fe('0x40')]['find'](_0x221f34)['then'](handleEntityNotFound(_0x36289c,null))[_0x08fe('0x14')](respondWithResult(_0x36289c,null))[_0x08fe('0x1d')](handleError(_0x36289c,null));};exports[_0x08fe('0x26')]=function(_0x146d9f,_0x7f6a33){if(_0x146d9f[_0x08fe('0x48')]['id']){delete _0x146d9f[_0x08fe('0x48')]['id'];}return db[_0x08fe('0x40')][_0x08fe('0x49')]({'where':{'id':_0x146d9f[_0x08fe('0x44')]['id']}})[_0x08fe('0x14')](handleEntityNotFound(_0x7f6a33,null))['then'](saveUpdates(_0x146d9f[_0x08fe('0x48')],null))['then'](respondWithResult(_0x7f6a33,null))[_0x08fe('0x1d')](handleError(_0x7f6a33,null));};exports['destroy']=function(_0x394789,_0x3a75c7){return db[_0x08fe('0x40')][_0x08fe('0x49')]({'where':{'id':_0x394789[_0x08fe('0x44')]['id']}})[_0x08fe('0x14')](handleEntityNotFound(_0x3a75c7,null))[_0x08fe('0x14')](removeEntity(_0x3a75c7,null))[_0x08fe('0x1d')](handleError(_0x3a75c7,null));};exports['describe']=function(_0x489e0d,_0x5e7145){return db['MailMessage'][_0x08fe('0x4a')]()[_0x08fe('0x14')](respondWithResult(_0x5e7145,null))['catch'](handleError(_0x5e7145,null));};exports[_0x08fe('0x4b')]=function(_0x2fd40e,_0x485706){return db[_0x08fe('0x40')][_0x08fe('0x4b')](_0x2fd40e[_0x08fe('0x48')])[_0x08fe('0x14')](function(_0x2095e8){if(_0x2095e8){if(_0x2095e8[_0x08fe('0x4c')]===_0x08fe('0x4d')&&!_0x2095e8[_0x08fe('0x4e')]){var _0x5719c3,_0x587f7f,_0x185c8e;if(_0x2fd40e[_0x08fe('0x48')]['to']){_0x587f7f=_0x2fd40e[_0x08fe('0x48')]['to'][_0x08fe('0x4f')](',')[0x0];}return db[_0x08fe('0x50')][_0x08fe('0x51')]({'where':{'id':_0x2095e8[_0x08fe('0x52')]},'include':[{'model':db[_0x08fe('0x53')],'as':_0x08fe('0x54'),'include':[{'model':db[_0x08fe('0x55')],'as':_0x08fe('0x56'),'where':{'email':_0x587f7f},'limit':0x1,'order':[[_0x08fe('0x57'),'DESC']]}]},{'model':db[_0x08fe('0x58')],'as':_0x08fe('0x59'),'raw':!![]}]})[_0x08fe('0x14')](function(_0x1b242f){_0x5719c3=_0x1b242f;if(_0x5719c3&&_0x5719c3['Smtp']){var _0x496a32={'tls':{'rejectUnauthorized':![]}};if(_[_0x08fe('0x5a')](_0x5719c3[_0x08fe('0x59')]['service'])){_0x496a32['host']=_0x5719c3['Smtp'][_0x08fe('0x5b')];_0x496a32['port']=_0x5719c3[_0x08fe('0x59')][_0x08fe('0x5c')];_0x496a32[_0x08fe('0x5d')]=_0x5719c3['Smtp'][_0x08fe('0x5d')];if(_0x5719c3[_0x08fe('0x59')][_0x08fe('0x5e')]){_0x496a32[_0x08fe('0x5f')]={'user':_0x5719c3[_0x08fe('0x59')][_0x08fe('0x60')],'pass':_0x5719c3[_0x08fe('0x59')][_0x08fe('0x61')]};}}else{_0x496a32[_0x08fe('0x62')]=_0x5719c3['Smtp']['service'];_0x496a32[_0x08fe('0x5f')]={'user':_0x5719c3[_0x08fe('0x59')][_0x08fe('0x60')],'pass':_0x5719c3['Smtp']['pass']};_0x496a32[_0x08fe('0x5d')]=_0x5719c3['Smtp'][_0x08fe('0x5d')];}if(_0x2fd40e['body'][_0x08fe('0x63')]&&_0x2fd40e[_0x08fe('0x48')][_0x08fe('0x63')]['length']){for(var _0x847433=0x0;_0x847433<_0x2fd40e[_0x08fe('0x48')][_0x08fe('0x63')][_0x08fe('0x46')];_0x847433+=0x1){_0x2fd40e[_0x08fe('0x48')][_0x08fe('0x63')][_0x847433]={'filename':_0x2fd40e['body'][_0x08fe('0x63')][_0x847433][_0x08fe('0x2a')],'path':path[_0x08fe('0x64')](config['root'],_0x08fe('0x65'),_0x2fd40e[_0x08fe('0x48')][_0x08fe('0x63')][_0x847433]['basename'])};}}_0x185c8e={'account':_0x496a32,'message':_0x2fd40e[_0x08fe('0x48')]};return;}})[_0x08fe('0x14')](function(){if(_0x5719c3[_0x08fe('0x54')]){if(_0x5719c3[_0x08fe('0x54')][_0x08fe('0x56')][_0x08fe('0x46')]){return _0x5719c3[_0x08fe('0x54')][_0x08fe('0x56')][0x0];}else{return db['CmContact'][_0x08fe('0x4b')](_[_0x08fe('0xb')](_0x2fd40e[_0x08fe('0x48')],{'firstName':_0x2fd40e[_0x08fe('0x48')]['to'],'email':_0x2fd40e['body']['to'],'phone':_0x2fd40e['body']['to'],'ListId':_0x5719c3[_0x08fe('0x66')]}));}}else{throw new Error(_0x08fe('0x67'));}})[_0x08fe('0x14')](function(){if(_0x185c8e){return respondWithRpcPromise(_0x08fe('0x68'),_0x08fe('0x69'),_0x185c8e,client9003)[_0x08fe('0x14')](function(_0x24c612){return _0x2095e8['update']({'read':!![],'messageId':_0x24c612[_0x08fe('0x6a')],'sentAt':moment()[_0x08fe('0x6b')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x08fe('0x1d')](function(_0xcc284b){logger[_0x08fe('0x19')]('%s',JSON['stringify'](_0xcc284b));return _0x2095e8;});}return _0x2095e8;});}return _0x2095e8;}})['then'](respondWithResult(_0x485706,0xc9))[_0x08fe('0x1d')](handleError(_0x485706,null));};exports[_0x08fe('0x6c')]=function(_0x3b7a2c,_0xe2dea3){var _0x152a62={'agent':{},'channel':_0x08fe('0x6d')};if(_0x3b7a2c[_0x08fe('0x48')]['id']){delete _0x3b7a2c[_0x08fe('0x48')]['id'];}_0x3b7a2c[_0x08fe('0x48')][_0x08fe('0x6e')]=!![];_0x3b7a2c['body']['readAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3b7a2c['body'][_0x08fe('0x6f')]=_0x3b7a2c['body'][_0x08fe('0x6f')]||_0x3b7a2c['user']['id'];_0x152a62[_0x08fe('0x70')]['id']=_0x3b7a2c['body'][_0x08fe('0x6f')];return db[_0x08fe('0x40')][_0x08fe('0x49')]({'where':{'id':_0x3b7a2c[_0x08fe('0x44')]['id'],'UserId':null}})[_0x08fe('0x14')](handleEntityNotFound(_0xe2dea3,null))[_0x08fe('0x14')](saveUpdates(_0x3b7a2c['body'],null))[_0x08fe('0x14')](function(_0x4f3ece){if(_0x4f3ece){_0x152a62[_0x08fe('0x1b')]=_0x4f3ece['get']({'plain':!![]});return db[_0x08fe('0x71')][_0x08fe('0x49')]({'where':{'id':_0x4f3ece['MailInteractionId']}});}return null;})[_0x08fe('0x14')](handleEntityNotFound(_0xe2dea3,null))[_0x08fe('0x14')](function(_0x3ad4f8){if(_0x3ad4f8){return _0x3ad4f8[_0x08fe('0x26')]({'UserId':_0x3b7a2c['body'][_0x08fe('0x6f')],'read1stAt':_[_0x08fe('0x5a')](_0x3ad4f8[_0x08fe('0x72')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x08fe('0x14')](function(_0x3f859a){if(_0x3f859a){_0x152a62[_0x08fe('0x73')]=_0x3f859a[_0x08fe('0x74')]({'plain':!![]});interaction_log[_0x08fe('0x15')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3b7a2c[_0x08fe('0x60')]['id'],_0x3b7a2c[_0x08fe('0x60')][_0x08fe('0x2a')],_0x3b7a2c[_0x08fe('0x60')][_0x08fe('0x75')],_0x152a62[_0x08fe('0x73')]['id'],_0x3b7a2c[_0x08fe('0x48')]?JSON[_0x08fe('0x76')](_0x3b7a2c[_0x08fe('0x48')]):_0x08fe('0x77'));return respondWithRpcPromise(_0x08fe('0x78'),_0x08fe('0x79'),_0x152a62);}return null;})[_0x08fe('0x14')](function(_0x125126){var _0x2b8ad7=_0x08fe('0x7a')+_0x125126['message']['ContactId'];return db[_0x08fe('0x7b')][_0x08fe('0x32')](_0x2b8ad7,{'type':db['Sequelize'][_0x08fe('0x7c')]['SELECT'],'raw':!![]})[_0x08fe('0x14')](function(_0x59c4e4){return _0x59c4e4;});})[_0x08fe('0x14')](function(_0x591bde){if(_0x591bde){_0x152a62['message'][_0x08fe('0x7d')]=_0x591bde[0x0];if(!_0x3b7a2c[_0x08fe('0x48')][_0x08fe('0x6f')])return;return db[_0x08fe('0x7e')][_0x08fe('0x49')]({'where':{'id':_0x3b7a2c[_0x08fe('0x48')]['UserId'],'role':_0x08fe('0x70')},'attributes':['id',_0x08fe('0x2a'),_0x08fe('0x7f'),_0x08fe('0x80'),_0x08fe('0x81')],'raw':!![]});}return null;})[_0x08fe('0x14')](function(_0x2a182c){if(!_0x2a182c)return null;_0x152a62[_0x08fe('0x1b')][_0x08fe('0x70')]=_0x2a182c;return _0x152a62;})[_0x08fe('0x14')](function(_0x20fd69){if(_0x20fd69){if(_0x3b7a2c[_0x08fe('0x48')][_0x08fe('0x82')]){_0x152a62[_0x08fe('0x1b')][_0x08fe('0x83')]=util[_0x08fe('0x6b')]('SIP/%s',_0x3b7a2c['user'][_0x08fe('0x2a')]);_0x152a62[_0x08fe('0x1b')]['channel']=_0x152a62[_0x08fe('0x84')];_0x152a62[_0x08fe('0x1b')][_0x08fe('0x85')]=_0x152a62[_0x08fe('0x84')];_0x152a62[_0x08fe('0x1b')][_0x08fe('0x86')]=_0x08fe('0x6c');_0x152a62['message'][_0x08fe('0x48')]=htmlToText[_0x08fe('0x87')](_0x152a62[_0x08fe('0x1b')][_0x08fe('0x48')]);return respondWithRpcPromise(_0x08fe('0x88'),_0x08fe('0x88'),{'event':_0x08fe('0x89'),'message':_0x152a62[_0x08fe('0x1b')]},client9002)[_0x08fe('0x14')](function(){return _0x152a62;});}return _0x152a62;}return null;})['then'](respondWithResult(_0xe2dea3,null))[_0x08fe('0x1d')](handleError(_0xe2dea3,null));};exports[_0x08fe('0x8a')]=function(_0x328cea,_0x4c373a){var _0x20c997={'agent':{},'channel':_0x08fe('0x6d')};if(_0x328cea[_0x08fe('0x48')]['id']){delete _0x328cea['body']['id'];}_0x328cea['body'][_0x08fe('0x6f')]=_0x328cea['body'][_0x08fe('0x6f')]||_0x328cea[_0x08fe('0x60')]['id'];_0x20c997['agent']['id']=_0x328cea['body'][_0x08fe('0x6f')];return db[_0x08fe('0x40')][_0x08fe('0x49')]({'where':{'id':_0x328cea[_0x08fe('0x44')]['id'],'UserId':null}})[_0x08fe('0x14')](handleEntityNotFound(_0x4c373a,null))[_0x08fe('0x14')](function(_0x286213){if(_0x286213){_0x20c997[_0x08fe('0x1b')]=_0x286213['get']({'plain':!![]});return db[_0x08fe('0x71')][_0x08fe('0x49')]({'where':{'id':_0x286213[_0x08fe('0x8b')]}});}return null;})['then'](handleEntityNotFound(_0x4c373a,null))[_0x08fe('0x14')](function(_0x23e102){if(_0x23e102){_0x20c997[_0x08fe('0x73')]=_0x23e102['get']({'plain':!![]});interaction_log[_0x08fe('0x15')](_0x08fe('0x8c'),_0x328cea[_0x08fe('0x60')]['id'],_0x328cea[_0x08fe('0x60')][_0x08fe('0x2a')],_0x328cea[_0x08fe('0x60')][_0x08fe('0x75')],_0x20c997[_0x08fe('0x73')]['id'],_0x328cea[_0x08fe('0x48')]?JSON[_0x08fe('0x76')](_0x328cea[_0x08fe('0x48')]):'null');return respondWithRpcPromise(_0x08fe('0x8d'),_0x08fe('0x8e'),_0x20c997);}return null;})['then'](function(_0x4059c4){var _0x185d72=_0x08fe('0x7a')+_0x4059c4[_0x08fe('0x1b')]['ContactId'];return db[_0x08fe('0x7b')][_0x08fe('0x32')](_0x185d72,{'type':db[_0x08fe('0x8f')]['QueryTypes'][_0x08fe('0x90')],'raw':!![]})[_0x08fe('0x14')](function(_0x99b920){return _0x99b920;});})['then'](function(_0x324601){if(_0x324601){_0x20c997[_0x08fe('0x1b')][_0x08fe('0x7d')]=_0x324601[0x0];if(!_0x328cea[_0x08fe('0x48')]['UserId'])return;return db[_0x08fe('0x7e')][_0x08fe('0x49')]({'where':{'id':_0x328cea[_0x08fe('0x48')]['UserId'],'role':_0x08fe('0x70')},'attributes':['id',_0x08fe('0x2a'),_0x08fe('0x7f'),_0x08fe('0x80'),_0x08fe('0x81')],'raw':!![]});}return null;})[_0x08fe('0x14')](function(_0x4db059){if(!_0x4db059)return null;_0x20c997[_0x08fe('0x1b')][_0x08fe('0x70')]=_0x4db059;return _0x20c997;})['then'](function(_0x1b4620){if(_0x1b4620){_0x1b4620[_0x08fe('0x1b')][_0x08fe('0x83')]=util[_0x08fe('0x6b')]('SIP/%s',_0x328cea[_0x08fe('0x60')][_0x08fe('0x2a')]);_0x1b4620[_0x08fe('0x1b')][_0x08fe('0x84')]=_0x20c997[_0x08fe('0x84')];_0x1b4620[_0x08fe('0x1b')][_0x08fe('0x85')]=_0x20c997['channel'];_0x1b4620['message'][_0x08fe('0x86')]=_0x08fe('0x8a');_0x1b4620['message'][_0x08fe('0x48')]=htmlToText[_0x08fe('0x87')](_0x20c997['message'][_0x08fe('0x48')]);respondWithRpcPromise('EventManager',_0x08fe('0x88'),{'event':_0x08fe('0x91'),'message':_0x1b4620[_0x08fe('0x1b')]},client9002);return _0x20c997;}return null;})[_0x08fe('0x14')](respondWithResult(_0x4c373a,null))['catch'](handleError(_0x4c373a,null));};exports[_0x08fe('0x92')]=function(_0x2fee6c,_0xee25ed){var _0x58abc8=moment()[_0x08fe('0x93')]()['toString']();var _0x1f1d26=path[_0x08fe('0x64')](config[_0x08fe('0x94')],_0x08fe('0x95'),_0x08fe('0x96'),'tmp');var _0x12317c=path[_0x08fe('0x64')](config['root'],_0x08fe('0x95'),_0x08fe('0x96'),_0x08fe('0x63'));var _0x3eadd1=util[_0x08fe('0x6b')](_0x08fe('0x97'),_0x58abc8);return db[_0x08fe('0x40')]['find']({'where':{'id':_0x2fee6c[_0x08fe('0x44')]['id']},'attributes':['id',_0x08fe('0x48'),_0x08fe('0x98'),'to','cc',_0x08fe('0x99'),_0x08fe('0x9a'),_0x08fe('0x9b')],'include':_0x2fee6c[_0x08fe('0x32')]['attachments']?[{'model':db['Attachment'],'as':_0x08fe('0x9c')}]:undefined})[_0x08fe('0x14')](handleEntityNotFound(_0xee25ed,null))[_0x08fe('0x14')](function(_0x34e012){if(_0x34e012){var _0x4348ea=_0x34e012;var _0x5d420d={'from':_0x4348ea['from'],'to':_0x4348ea['to'],'subject':_0x4348ea[_0x08fe('0x9a')],'html':htmlEntities['decode'](_0x4348ea[_0x08fe('0x48')]),'headers':{'Date':moment(_0x4348ea['createdAt'])[_0x08fe('0x6b')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x34e012['cc']){_0x5d420d[_0x08fe('0x9d')]['Cc']=_0x34e012['cc'];}if(_0x34e012['bcc']){_0x5d420d[_0x08fe('0x9d')][_0x08fe('0x9e')]=_0x34e012[_0x08fe('0x99')];}return new BPromise(function(_0x3bc786,_0x556e04){if(_0x34e012[_0x08fe('0x9c')]){for(var _0x32249a=0x0;_0x32249a<_0x34e012[_0x08fe('0x9c')][_0x08fe('0x46')];_0x32249a++){var _0x32a69b=_0x34e012[_0x08fe('0x9c')][_0x32249a];var _0x29f81d=path[_0x08fe('0x64')](_0x12317c,_0x32a69b[_0x08fe('0x9f')]);if(fs[_0x08fe('0xa0')](_0x29f81d)){_0x5d420d[_0x08fe('0x63')][_0x08fe('0xa1')]({'name':_0x32a69b['name'],'contentType':_0x32a69b[_0x08fe('0x30')],'data':fs['readFileSync'](_0x29f81d)});}}}emlformat[_0x08fe('0xa2')](_0x5d420d,function(_0x2a83e9,_0x4f497a){if(_0x2a83e9)return _0x556e04(_0x2a83e9);fs[_0x08fe('0xa3')](path[_0x08fe('0x64')](_0x1f1d26,_0x3eadd1),_0x4f497a);return _0x3bc786(_0x4f497a);});});}})['then'](function(_0x354fd8){if(_0x354fd8){return _0xee25ed['download'](path[_0x08fe('0x64')](_0x1f1d26,_0x3eadd1),_0x3eadd1,function(_0x52184e){if(!_0x52184e)fs['unlinkSync'](path[_0x08fe('0x64')](_0x1f1d26,_0x3eadd1));});}})['catch'](handleError(_0xee25ed,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 34f802c..61da8c0 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 _0x32dc=['MailMessage','setMaxListeners','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x3e748d,_0x271178){var _0x3e87b5=function(_0x46dc23){while(--_0x46dc23){_0x3e748d['push'](_0x3e748d['shift']());}};_0x3e87b5(++_0x271178);}(_0x32dc,0x1b7));var _0xc32d=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x32dc[_0x1035c1];return _0x308d67;};'use strict';var EventEmitter=require(_0xc32d('0x0'));var MailMessage=require('../../mysqldb')['db'][_0xc32d('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xc32d('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc32d('0x3'),'afterDestroy':_0xc32d('0x4')};function emitEvent(_0x24dec0){return function(_0x1ec592,_0x290d00,_0x2208cc){MailMessageEvents[_0xc32d('0x5')](_0x24dec0+':'+_0x1ec592['id'],_0x1ec592);MailMessageEvents[_0xc32d('0x5')](_0x24dec0,_0x1ec592);_0x2208cc(null);};}for(var e in events){if(events[_0xc32d('0x6')](e)){var event=events[e];MailMessage[_0xc32d('0x7')](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file +var _0x9f8c=['events','MailMessage','setMaxListeners','save','update','remove','hasOwnProperty','hook','exports'];(function(_0x4da064,_0x6eb5e3){var _0x1d55f6=function(_0x202e4c){while(--_0x202e4c){_0x4da064['push'](_0x4da064['shift']());}};_0x1d55f6(++_0x6eb5e3);}(_0x9f8c,0x1dd));var _0xc9f8=function(_0x4f9529,_0x155980){_0x4f9529=_0x4f9529-0x0;var _0x1c0da0=_0x9f8c[_0x4f9529];return _0x1c0da0;};'use strict';var EventEmitter=require(_0xc9f8('0x0'));var MailMessage=require('../../mysqldb')['db'][_0xc9f8('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xc9f8('0x2')](0x0);var events={'afterCreate':_0xc9f8('0x3'),'afterUpdate':_0xc9f8('0x4'),'afterDestroy':_0xc9f8('0x5')};function emitEvent(_0x29359d){return function(_0x1059a3,_0x4a7ada,_0xdabdbd){MailMessageEvents['emit'](_0x29359d+':'+_0x1059a3['id'],_0x1059a3);MailMessageEvents['emit'](_0x29359d,_0x1059a3);_0xdabdbd(null);};}for(var e in events){if(events[_0xc9f8('0x6')](e)){var event=events[e];MailMessage[_0xc9f8('0x7')](e,emitEvent(event));}}module[_0xc9f8('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 4229c4f..c0f71d5 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 _0xe26e=['rimraf','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','fromString','get','direction','toLowerCase','UserId','MailInteraction','findOne','then','update','catch','error','utf8mb4','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x17781b,_0x1a2fa8){var _0x324137=function(_0x376b85){while(--_0x376b85){_0x17781b['push'](_0x17781b['shift']());}};_0x324137(++_0x1a2fa8);}(_0xe26e,0xb3));var _0xee26=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xe26e[_0x57b54c];return _0x59cc19;};'use strict';var _=require('lodash');var util=require(_0xee26('0x0'));var logger=require(_0xee26('0x1'))(_0xee26('0x2'));var moment=require(_0xee26('0x3'));var BPromise=require(_0xee26('0x4'));var rp=require(_0xee26('0x5'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0xee26('0x6'));var rimraf=require(_0xee26('0x7'));var config=require(_0xee26('0x8'));var attributes=require(_0xee26('0x9'));module[_0xee26('0xa')]=function(_0x1a8646,_0x10676b){return _0x1a8646[_0xee26('0xb')](_0xee26('0xc'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0xee26('0xd'),'fields':[_0xee26('0xd')]},{'name':_0xee26('0xe'),'fields':[_0xee26('0xf'),_0xee26('0x10')],'type':_0xee26('0x11')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4a8328,_0x142c93,_0x2236a7){if(_0x4a8328[_0xee26('0x12')]){_0x4a8328[_0xee26('0xf')]=htmlToText[_0xee26('0x13')](_0x4a8328['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x2236a7(null,_0x142c93);},'afterCreate':function(_0x2a3fd6,_0x1e908c,_0x5ab449){var _0x7e28d2=_0x1a8646['models'];var _0x21e932=_0x2a3fd6[_0xee26('0x14')]({'plain':!![]});if(_0x21e932[_0xee26('0x15')][_0xee26('0x16')]()==='in'||_0x21e932[_0xee26('0x15')][_0xee26('0x16')]()==='out'&&!_0x21e932['secret']&&!_['isNil'](_0x21e932[_0xee26('0x17')])){_0x7e28d2[_0xee26('0x18')][_0xee26('0x19')]({'where':{'id':_0x21e932['MailInteractionId']}})[_0xee26('0x1a')](function(_0x1a48f5){if(_0x1a48f5){_0x1a48f5[_0xee26('0x1b')]({'lastMsgAt':_0x21e932['createdAt'],'lastMsgDirection':_0x21e932[_0xee26('0x15')]['toLowerCase']()});}})[_0xee26('0x1c')](function(_0x10db2c){console[_0xee26('0x1d')](_0x10db2c);});}_0x5ab449();}},'charset':_0xee26('0x1e'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x98db=['messageId','fti_mail_messages','subject','body','plainBody','fromString','models','get','direction','out','secret','isNil','UserId','MailInteraction','findOne','MailInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','html-to-text','path','../../config/environment','./mailMessage.attributes','define','MailMessage','mail_messages'];(function(_0x33c1a1,_0x1d3a55){var _0x4f7dd2=function(_0x4f8af7){while(--_0x4f8af7){_0x33c1a1['push'](_0x33c1a1['shift']());}};_0x4f7dd2(++_0x1d3a55);}(_0x98db,0x7d));var _0xb98d=function(_0x2fa1c6,_0x4a5b8d){_0x2fa1c6=_0x2fa1c6-0x0;var _0x5f3257=_0x98db[_0x2fa1c6];return _0x5f3257;};'use strict';var _=require(_0xb98d('0x0'));var util=require(_0xb98d('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb98d('0x2'));var BPromise=require(_0xb98d('0x3'));var rp=require('request-promise');var htmlToText=require(_0xb98d('0x4'));var fs=require('fs');var path=require(_0xb98d('0x5'));var rimraf=require('rimraf');var config=require(_0xb98d('0x6'));var attributes=require(_0xb98d('0x7'));module['exports']=function(_0x29f6cc,_0x491029){return _0x29f6cc[_0xb98d('0x8')](_0xb98d('0x9'),attributes,{'tableName':_0xb98d('0xa'),'paranoid':![],'indexes':[{'name':_0xb98d('0xb'),'fields':['messageId']},{'name':_0xb98d('0xc'),'fields':['plainBody',_0xb98d('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2d332b,_0x2cba3f,_0x309fbf){if(_0x2d332b[_0xb98d('0xe')]){_0x2d332b[_0xb98d('0xf')]=htmlToText[_0xb98d('0x10')](_0x2d332b[_0xb98d('0xe')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x309fbf(null,_0x2cba3f);},'afterCreate':function(_0x318bc6,_0x2a9f5f,_0x35f289){var _0x40519e=_0x29f6cc[_0xb98d('0x11')];var _0x5967e5=_0x318bc6[_0xb98d('0x12')]({'plain':!![]});if(_0x5967e5[_0xb98d('0x13')]['toLowerCase']()==='in'||_0x5967e5['direction']['toLowerCase']()===_0xb98d('0x14')&&!_0x5967e5[_0xb98d('0x15')]&&!_[_0xb98d('0x16')](_0x5967e5[_0xb98d('0x17')])){_0x40519e[_0xb98d('0x18')][_0xb98d('0x19')]({'where':{'id':_0x5967e5[_0xb98d('0x1a')]}})[_0xb98d('0x1b')](function(_0x5bfb20){if(_0x5bfb20){_0x5bfb20[_0xb98d('0x1c')]({'lastMsgAt':_0x5967e5[_0xb98d('0x1d')],'lastMsgDirection':_0x5967e5[_0xb98d('0x13')]['toLowerCase']()});}})[_0xb98d('0x1e')](function(_0x461242){console[_0xb98d('0x1f')](_0x461242);});}_0x35f289();}},'charset':_0xb98d('0x20'),'collate':_0xb98d('0x21')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 6028a28..3fb5af3 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 _0xd4a2=['bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./mailMessage.socket','register','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','CreateMailMessage','create','body','options','raw','then','catch','lodash'];(function(_0x503b3b,_0x4d6f5d){var _0x12651b=function(_0x312e74){while(--_0x312e74){_0x503b3b['push'](_0x503b3b['shift']());}};_0x12651b(++_0x4d6f5d);}(_0xd4a2,0x173));var _0x2d4a=function(_0x284ea8,_0x1f0fe9){_0x284ea8=_0x284ea8-0x0;var _0x223297=_0xd4a2[_0x284ea8];return _0x223297;};'use strict';var _=require(_0x2d4a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2d4a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2d4a('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x2d4a('0x3'));var logger=require('../../config/logger')(_0x2d4a('0x4'));var config=require(_0x2d4a('0x5'));var jayson=require(_0x2d4a('0x6'));var client=jayson[_0x2d4a('0x7')][_0x2d4a('0x8')]({'port':0x232a});config['redis']=_[_0x2d4a('0x9')](config[_0x2d4a('0xa')],{'host':_0x2d4a('0xb'),'port':0x18eb});var socket=require(_0x2d4a('0xc'))(new Redis(config[_0x2d4a('0xa')]));require(_0x2d4a('0xd'))[_0x2d4a('0xe')](socket);function respondWithRpcPromise(_0x113839,_0x33b786,_0x4738dc){return new BPromise(function(_0x3abbbd,_0xce6af6){return client['request'](_0x113839,_0x4738dc)['then'](function(_0x4002de){logger['info'](_0x2d4a('0xf'),_0x33b786,_0x2d4a('0x10'));logger[_0x2d4a('0x11')](_0x2d4a('0x12'),_0x33b786,_0x2d4a('0x10'),JSON[_0x2d4a('0x13')](_0x4002de));if(_0x4002de[_0x2d4a('0x14')]){if(_0x4002de[_0x2d4a('0x14')]['code']===0x1f4){logger['error'](_0x2d4a('0xf'),_0x33b786,_0x4002de['error'][_0x2d4a('0x15')]);return _0xce6af6(_0x4002de[_0x2d4a('0x14')][_0x2d4a('0x15')]);}logger[_0x2d4a('0x14')]('MailMessage,\x20%s,\x20%s',_0x33b786,_0x4002de[_0x2d4a('0x14')]['message']);return _0x3abbbd(_0x4002de[_0x2d4a('0x14')]['message']);}else{logger[_0x2d4a('0x16')](_0x2d4a('0xf'),_0x33b786,_0x2d4a('0x10'));_0x3abbbd(_0x4002de[_0x2d4a('0x17')]['message']);}})['catch'](function(_0x5ac74b){logger[_0x2d4a('0x14')](_0x2d4a('0xf'),_0x33b786,_0x5ac74b);_0xce6af6(_0x5ac74b);});});}exports[_0x2d4a('0x18')]=function(_0x419df5){var _0x46c331=this;return new Promise(function(_0x2e4069,_0x56445a){return db['MailMessage'][_0x2d4a('0x19')](_0x419df5[_0x2d4a('0x1a')],{'raw':_0x419df5[_0x2d4a('0x1b')]?_0x419df5[_0x2d4a('0x1b')][_0x2d4a('0x1c')]===undefined?!![]:![]:!![]})[_0x2d4a('0x1d')](function(_0x22dd0b){logger[_0x2d4a('0x16')]('CreateMailMessage',_0x419df5);logger[_0x2d4a('0x11')](_0x2d4a('0x18'),_0x419df5,JSON[_0x2d4a('0x13')](_0x22dd0b));_0x2e4069(_0x22dd0b);})[_0x2d4a('0x1e')](function(_0x2c845c){logger[_0x2d4a('0x14')](_0x2d4a('0x18'),_0x2c845c[_0x2d4a('0x15')],_0x419df5);_0x56445a(_0x46c331['error'](0x1f4,_0x2c845c['message']));});});}; \ No newline at end of file +var _0xf7b4=['randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailMessage,\x20%s,\x20%s','message','result','catch','MailMessage','create','body','options','raw','CreateMailMessage','lodash','bluebird'];(function(_0x363ef8,_0x4ecb1a){var _0x148822=function(_0x232634){while(--_0x232634){_0x363ef8['push'](_0x363ef8['shift']());}};_0x148822(++_0x4ecb1a);}(_0xf7b4,0x152));var _0x4f7b=function(_0x1432a9,_0x7006bf){_0x1432a9=_0x1432a9-0x0;var _0x3e64e8=_0xf7b4[_0x1432a9];return _0x3e64e8;};'use strict';var _=require(_0x4f7b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4f7b('0x1'));var rs=require(_0x4f7b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4f7b('0x3'));var logger=require(_0x4f7b('0x4'))(_0x4f7b('0x5'));var config=require(_0x4f7b('0x6'));var jayson=require(_0x4f7b('0x7'));var client=jayson[_0x4f7b('0x8')][_0x4f7b('0x9')]({'port':0x232a});config[_0x4f7b('0xa')]=_[_0x4f7b('0xb')](config[_0x4f7b('0xa')],{'host':_0x4f7b('0xc'),'port':0x18eb});var socket=require(_0x4f7b('0xd'))(new Redis(config[_0x4f7b('0xa')]));require('./mailMessage.socket')[_0x4f7b('0xe')](socket);function respondWithRpcPromise(_0x1016e0,_0x479208,_0xdd1aab){return new BPromise(function(_0x3a3d6c,_0x408e01){return client[_0x4f7b('0xf')](_0x1016e0,_0xdd1aab)[_0x4f7b('0x10')](function(_0x55d69f){logger[_0x4f7b('0x11')]('MailMessage,\x20%s,\x20%s',_0x479208,'request\x20sent');logger[_0x4f7b('0x12')](_0x4f7b('0x13'),_0x479208,_0x4f7b('0x14'),JSON[_0x4f7b('0x15')](_0x55d69f));if(_0x55d69f['error']){if(_0x55d69f[_0x4f7b('0x16')][_0x4f7b('0x17')]===0x1f4){logger[_0x4f7b('0x16')](_0x4f7b('0x18'),_0x479208,_0x55d69f[_0x4f7b('0x16')][_0x4f7b('0x19')]);return _0x408e01(_0x55d69f[_0x4f7b('0x16')][_0x4f7b('0x19')]);}logger[_0x4f7b('0x16')](_0x4f7b('0x18'),_0x479208,_0x55d69f[_0x4f7b('0x16')][_0x4f7b('0x19')]);return _0x3a3d6c(_0x55d69f['error'][_0x4f7b('0x19')]);}else{logger['info']('MailMessage,\x20%s,\x20%s',_0x479208,_0x4f7b('0x14'));_0x3a3d6c(_0x55d69f[_0x4f7b('0x1a')]['message']);}})[_0x4f7b('0x1b')](function(_0x24c460){logger[_0x4f7b('0x16')](_0x4f7b('0x18'),_0x479208,_0x24c460);_0x408e01(_0x24c460);});});}exports['CreateMailMessage']=function(_0x1daa79){var _0x5adacb=this;return new Promise(function(_0x41cf36,_0x12374b){return db[_0x4f7b('0x1c')][_0x4f7b('0x1d')](_0x1daa79[_0x4f7b('0x1e')],{'raw':_0x1daa79[_0x4f7b('0x1f')]?_0x1daa79[_0x4f7b('0x1f')][_0x4f7b('0x20')]===undefined?!![]:![]:!![]})[_0x4f7b('0x10')](function(_0x5508bd){logger[_0x4f7b('0x11')](_0x4f7b('0x21'),_0x1daa79);logger[_0x4f7b('0x12')]('CreateMailMessage',_0x1daa79,JSON[_0x4f7b('0x15')](_0x5508bd));_0x41cf36(_0x5508bd);})[_0x4f7b('0x1b')](function(_0x5d22f4){logger[_0x4f7b('0x16')]('CreateMailMessage',_0x5d22f4[_0x4f7b('0x19')],_0x1daa79);_0x12374b(_0x5adacb[_0x4f7b('0x16')](0x1f4,_0x5d22f4[_0x4f7b('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index bc35e56..5d27167 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 _0xd859=['register','length','./mailMessage.events','save','remove','update','emit','removeListener'];(function(_0x1a309d,_0x201f52){var _0x1f7f0f=function(_0x425840){while(--_0x425840){_0x1a309d['push'](_0x1a309d['shift']());}};_0x1f7f0f(++_0x201f52);}(_0xd859,0x16a));var _0x9d85=function(_0x3bc158,_0x436e3a){_0x3bc158=_0x3bc158-0x0;var _0x977671=_0xd859[_0x3bc158];return _0x977671;};'use strict';var MailMessageEvents=require(_0x9d85('0x0'));var events=[_0x9d85('0x1'),_0x9d85('0x2'),_0x9d85('0x3')];function createListener(_0x448969,_0x33c831){return function(_0x1e3f09){_0x33c831[_0x9d85('0x4')](_0x448969,_0x1e3f09);};}function removeListener(_0x3f7ca9,_0x2adfd4){return function(){MailMessageEvents[_0x9d85('0x5')](_0x3f7ca9,_0x2adfd4);};}exports[_0x9d85('0x6')]=function(_0x2c0cc5){for(var _0xff7243=0x0,_0x5e3283=events[_0x9d85('0x7')];_0xff7243<_0x5e3283;_0xff7243++){var _0x18c657=events[_0xff7243];var _0x25e4c6=createListener('mailMessage:'+_0x18c657,_0x2c0cc5);MailMessageEvents['on'](_0x18c657,_0x25e4c6);}}; \ No newline at end of file +var _0x34cf=['emit','removeListener','register','mailMessage:','./mailMessage.events','save','update'];(function(_0x3fc98b,_0x1def0f){var _0x137229=function(_0x5763ea){while(--_0x5763ea){_0x3fc98b['push'](_0x3fc98b['shift']());}};_0x137229(++_0x1def0f);}(_0x34cf,0x170));var _0xf34c=function(_0x438351,_0x547c6f){_0x438351=_0x438351-0x0;var _0x2aef51=_0x34cf[_0x438351];return _0x2aef51;};'use strict';var MailMessageEvents=require(_0xf34c('0x0'));var events=[_0xf34c('0x1'),'remove',_0xf34c('0x2')];function createListener(_0x4feacc,_0x3abe9b){return function(_0x38e52c){_0x3abe9b[_0xf34c('0x3')](_0x4feacc,_0x38e52c);};}function removeListener(_0xc939bc,_0x1ca7ea){return function(){MailMessageEvents[_0xf34c('0x4')](_0xc939bc,_0x1ca7ea);};}exports[_0xf34c('0x5')]=function(_0x42792b){for(var _0x4c982c=0x0,_0x1f97ad=events['length'];_0x4c982c<_0x1f97ad;_0x4c982c++){var _0x557c98=events[_0x4c982c];var _0x40d755=createListener(_0xf34c('0x6')+_0x557c98,_0x42792b);MailMessageEvents['on'](_0x557c98,_0x40d755);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 1b1a724..1b17bc6 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 _0x8f68=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents','put','delete','removeTeams','removeAgents','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./mailQueue.controller','isAuthenticated','/describe','describe','get','/:id','show'];(function(_0x2b0a86,_0x2ecebd){var _0x955940=function(_0x1988f8){while(--_0x1988f8){_0x2b0a86['push'](_0x2b0a86['shift']());}};_0x955940(++_0x2ecebd);}(_0x8f68,0x16d));var _0x88f6=function(_0x476809,_0x30476c){_0x476809=_0x476809-0x0;var _0x2b4dc6=_0x8f68[_0x476809];return _0x2b4dc6;};'use strict';var multer=require(_0x88f6('0x0'));var util=require('util');var path=require(_0x88f6('0x1'));var timeout=require(_0x88f6('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x88f6('0x3'));var auth=require(_0x88f6('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x88f6('0x5'));var controller=require(_0x88f6('0x6'));router['get']('/',auth[_0x88f6('0x7')](),controller['index']);router['get'](_0x88f6('0x8'),auth[_0x88f6('0x7')](),controller[_0x88f6('0x9')]);router[_0x88f6('0xa')](_0x88f6('0xb'),auth[_0x88f6('0x7')](),controller[_0x88f6('0xc')]);router[_0x88f6('0xa')](_0x88f6('0xd'),auth[_0x88f6('0x7')](),controller[_0x88f6('0xe')]);router[_0x88f6('0xa')](_0x88f6('0xf'),auth[_0x88f6('0x7')](),controller[_0x88f6('0x10')]);router[_0x88f6('0xa')](_0x88f6('0x11'),auth[_0x88f6('0x7')](),controller[_0x88f6('0x12')]);router[_0x88f6('0x13')]('/',auth[_0x88f6('0x7')](),controller[_0x88f6('0x14')]);router[_0x88f6('0x13')](_0x88f6('0xf'),auth[_0x88f6('0x7')](),controller['addTeams']);router[_0x88f6('0x13')](_0x88f6('0x11'),auth[_0x88f6('0x7')](),controller[_0x88f6('0x15')]);router[_0x88f6('0x16')](_0x88f6('0xb'),auth[_0x88f6('0x7')](),controller['update']);router[_0x88f6('0x17')](_0x88f6('0xb'),auth[_0x88f6('0x7')](),controller['destroy']);router['delete'](_0x88f6('0xf'),auth['isAuthenticated'](),controller[_0x88f6('0x18')]);router[_0x88f6('0x17')]('/:id/users',auth['isAuthenticated'](),controller[_0x88f6('0x19')]);module[_0x88f6('0x1a')]=router; \ No newline at end of file +var _0x1273=['multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailQueue.controller','isAuthenticated','get','/describe','/:id','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents','update','delete','destroy','removeAgents','exports'];(function(_0x5c43cf,_0x297c45){var _0x56a800=function(_0x1f1b3e){while(--_0x1f1b3e){_0x5c43cf['push'](_0x5c43cf['shift']());}};_0x56a800(++_0x297c45);}(_0x1273,0xaf));var _0x3127=function(_0x28f03f,_0x2f4363){_0x28f03f=_0x28f03f-0x0;var _0x434899=_0x1273[_0x28f03f];return _0x434899;};'use strict';var multer=require(_0x3127('0x0'));var util=require(_0x3127('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3127('0x2'));var router=express[_0x3127('0x3')]();var fs_extra=require(_0x3127('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3127('0x5'));var config=require(_0x3127('0x6'));var controller=require(_0x3127('0x7'));router['get']('/',auth[_0x3127('0x8')](),controller['index']);router[_0x3127('0x9')](_0x3127('0xa'),auth[_0x3127('0x8')](),controller['describe']);router[_0x3127('0x9')](_0x3127('0xb'),auth[_0x3127('0x8')](),controller['show']);router['get']('/:id/members',auth['isAuthenticated'](),controller[_0x3127('0xc')]);router[_0x3127('0x9')](_0x3127('0xd'),auth[_0x3127('0x8')](),controller[_0x3127('0xe')]);router['get'](_0x3127('0xf'),auth[_0x3127('0x8')](),controller[_0x3127('0x10')]);router[_0x3127('0x11')]('/',auth[_0x3127('0x8')](),controller[_0x3127('0x12')]);router[_0x3127('0x11')](_0x3127('0xd'),auth[_0x3127('0x8')](),controller['addTeams']);router[_0x3127('0x11')](_0x3127('0xf'),auth[_0x3127('0x8')](),controller[_0x3127('0x13')]);router['put'](_0x3127('0xb'),auth[_0x3127('0x8')](),controller[_0x3127('0x14')]);router[_0x3127('0x15')]('/:id',auth[_0x3127('0x8')](),controller[_0x3127('0x16')]);router[_0x3127('0x15')](_0x3127('0xd'),auth['isAuthenticated'](),controller['removeTeams']);router['delete'](_0x3127('0xf'),auth[_0x3127('0x8')](),controller[_0x3127('0x17')]);module[_0x3127('0x18')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 2f0849a..1b8e59b 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 _0xb5ea=['sequelize','exports','STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x510b21,_0x48ce75){var _0x157417=function(_0x4492ca){while(--_0x4492ca){_0x510b21['push'](_0x510b21['shift']());}};_0x157417(++_0x48ce75);}(_0xb5ea,0x80));var _0xab5e=function(_0x1ce575,_0xc8d9ae){_0x1ce575=_0x1ce575-0x0;var _0x9f2ffb=_0xb5ea[_0x1ce575];return _0x9f2ffb;};'use strict';var Sequelize=require(_0xab5e('0x0'));module[_0xab5e('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xab5e('0x2')]},'timeout':{'type':Sequelize[_0xab5e('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xab5e('0x4')](_0xab5e('0x5'),_0xab5e('0x6'),_0xab5e('0x7'))}}; \ No newline at end of file +var _0xf3da=['beepall','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x127148,_0x39dad6){var _0x4f1d4b=function(_0x3ab071){while(--_0x3ab071){_0x127148['push'](_0x127148['shift']());}};_0x4f1d4b(++_0x39dad6);}(_0xf3da,0x199));var _0xaf3d=function(_0x34990e,_0x6b0647){_0x34990e=_0x34990e-0x0;var _0x2740b5=_0xf3da[_0x34990e];return _0x2740b5;};'use strict';var Sequelize=require(_0xaf3d('0x0'));module[_0xaf3d('0x1')]={'name':{'type':Sequelize[_0xaf3d('0x2')],'unique':_0xaf3d('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xaf3d('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xaf3d('0x5')](_0xaf3d('0x6'),_0xaf3d('0x7'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index ac0e25a..f224570 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 _0x6037=['fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','MailQueue','includeAll','include','findAll','rows','params','options','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','update','find','destroy','describe','getMembers','findOne','UserMailQueue','MailQueueId','User','findAndCountAll','UserId','mailPause','updatedAt','%s/%s','SIP','createdAt','getTeams','Team','addTeams','ids','Agents','voicePause','flatMap','transaction','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','field','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','SELECT','TeamId','includes','all','union','value','isEmpty','userMailQueue:remove','addAgents','spread','removeAgents','getAgents','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','redis','defaults','localhost','./mailQueue.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','get','MailQueues','UserProfileResource','sendStatus','error','stack','name','rawAttributes'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x6037,0xe2));var _0x7603=function(_0x5db687,_0x1cfa57){_0x5db687=_0x5db687-0x0;var _0x4096a0=_0x6037[_0x5db687];return _0x4096a0;};'use strict';var emlformat=require(_0x7603('0x0'));var rimraf=require(_0x7603('0x1'));var zipdir=require(_0x7603('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7603('0x3'));var moment=require('moment');var BPromise=require(_0x7603('0x4'));var Mustache=require(_0x7603('0x5'));var util=require('util');var path=require(_0x7603('0x6'));var sox=require(_0x7603('0x7'));var csv=require('to-csv');var ejs=require(_0x7603('0x8'));var fs=require('fs');var fs_extra=require(_0x7603('0x9'));var _=require(_0x7603('0xa'));var squel=require(_0x7603('0xb'));var crypto=require(_0x7603('0xc'));var jsforce=require(_0x7603('0xd'));var deskjs=require(_0x7603('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7603('0xf'));var Papa=require('papaparse');var Redis=require(_0x7603('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7603('0x11'));var hardwareService=require(_0x7603('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x7603('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7603('0x14'))['db'];config[_0x7603('0x15')]=_[_0x7603('0x16')](config[_0x7603('0x15')],{'host':_0x7603('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7603('0x15')]));require(_0x7603('0x18'))[_0x7603('0x19')](socket);function respondWithStatusCode(_0x3494d9,_0x5e93d2){_0x5e93d2=_0x5e93d2||0xcc;return function(_0x207c50){if(_0x207c50){return _0x3494d9['sendStatus'](_0x5e93d2);}return _0x3494d9[_0x7603('0x1a')](_0x5e93d2)[_0x7603('0x1b')]();};}function respondWithResult(_0x40d8d5,_0x35cb05){_0x35cb05=_0x35cb05||0xc8;return function(_0x16f940){if(_0x16f940){return _0x40d8d5['status'](_0x35cb05)[_0x7603('0x1c')](_0x16f940);}};}function respondWithFilteredResult(_0x5ab631,_0x57cef2){return function(_0x392589){if(_0x392589){var _0x14c7fb=typeof _0x57cef2[_0x7603('0x1d')]===_0x7603('0x1e')&&typeof _0x57cef2[_0x7603('0x1f')]==='undefined';var _0x372653=_0x392589[_0x7603('0x20')];var _0x7cc870=_0x14c7fb?0x0:_0x57cef2[_0x7603('0x1d')];var _0x58d32b=_0x14c7fb?_0x392589['count']:_0x57cef2['offset']+_0x57cef2[_0x7603('0x1f')];var _0x1c9746;if(_0x58d32b>=_0x372653){_0x58d32b=_0x372653;_0x1c9746=0xc8;}else{_0x1c9746=0xce;}_0x5ab631[_0x7603('0x1a')](_0x1c9746);return _0x5ab631[_0x7603('0x21')](_0x7603('0x22'),_0x7cc870+'-'+_0x58d32b+'/'+_0x372653)[_0x7603('0x1c')](_0x392589);}return null;};}function patchUpdates(_0x346623){return function(_0x3e24da){try{jsonpatch[_0x7603('0x23')](_0x3e24da,_0x346623,!![]);}catch(_0x398950){return BPromise['reject'](_0x398950);}return _0x3e24da[_0x7603('0x24')]();};}function saveUpdates(_0x2a440a,_0x7726dd){return function(_0x97c5ac){if(_0x97c5ac){return _0x97c5ac['update'](_0x2a440a)[_0x7603('0x25')](function(_0x27771f){return _0x27771f;});}return null;};}function removeEntity(_0x453ca4,_0x394f22){return function(_0x27fdc5){if(_0x27fdc5){return _0x27fdc5['destroy']()[_0x7603('0x25')](function(){var _0x59935c=_0x27fdc5[_0x7603('0x26')]({'plain':!![]});var _0x4e8797=_0x7603('0x27');return db[_0x7603('0x28')]['destroy']({'where':{'type':_0x4e8797,'resourceId':_0x59935c['id']}})['then'](function(){return _0x27fdc5;});})[_0x7603('0x25')](function(){_0x453ca4[_0x7603('0x1a')](0xcc)[_0x7603('0x1b')]();});}};}function handleEntityNotFound(_0x5ac9e4,_0x5ade9b){return function(_0x24872e){if(!_0x24872e){_0x5ac9e4[_0x7603('0x29')](0x194);}return _0x24872e;};}function handleError(_0x23a373,_0x310b59){_0x310b59=_0x310b59||0x1f4;return function(_0x20a190){logger[_0x7603('0x2a')](_0x20a190[_0x7603('0x2b')]);if(_0x20a190[_0x7603('0x2c')]){delete _0x20a190[_0x7603('0x2c')];}_0x23a373[_0x7603('0x1a')](_0x310b59)['send'](_0x20a190);};}exports['index']=function(_0x1a61a5,_0x2ab5d0){var _0x11132f={},_0x3d9da1={},_0x449098={'count':0x0,'rows':[]};var _0x67b479=_['map'](db['MailQueue'][_0x7603('0x2d')],function(_0x767bc7){return{'name':_0x767bc7[_0x7603('0x2e')],'type':_0x767bc7[_0x7603('0x2f')][_0x7603('0x30')]};});_0x3d9da1[_0x7603('0x31')]=_[_0x7603('0x32')](_0x67b479,_0x7603('0x2c'));_0x3d9da1[_0x7603('0x33')]=_[_0x7603('0x34')](_0x1a61a5['query']);_0x3d9da1[_0x7603('0x35')]=_[_0x7603('0x36')](_0x3d9da1[_0x7603('0x31')],_0x3d9da1[_0x7603('0x33')]);_0x11132f['attributes']=_[_0x7603('0x36')](_0x3d9da1['model'],qs[_0x7603('0x37')](_0x1a61a5[_0x7603('0x33')]['fields']));_0x11132f[_0x7603('0x38')]=_0x11132f[_0x7603('0x38')][_0x7603('0x39')]?_0x11132f['attributes']:_0x3d9da1['model'];if(!_0x1a61a5[_0x7603('0x33')][_0x7603('0x3a')](_0x7603('0x3b'))){_0x11132f[_0x7603('0x1f')]=qs[_0x7603('0x1f')](_0x1a61a5[_0x7603('0x33')]['limit']);_0x11132f[_0x7603('0x1d')]=qs['offset'](_0x1a61a5[_0x7603('0x33')]['offset']);}_0x11132f[_0x7603('0x3c')]=qs['sort'](_0x1a61a5[_0x7603('0x33')][_0x7603('0x3d')]);_0x11132f['where']=qs['filters'](_[_0x7603('0x3e')](_0x1a61a5[_0x7603('0x33')],_0x3d9da1['filters']),_0x67b479);if(_0x1a61a5[_0x7603('0x33')][_0x7603('0x3f')]){_0x11132f[_0x7603('0x40')]=_[_0x7603('0x41')](_0x11132f[_0x7603('0x40')],{'$or':_[_0x7603('0x32')](_0x67b479,function(_0x56a6ba){if(_0x56a6ba[_0x7603('0x2f')]!==_0x7603('0x42')){var _0x1736a1={};_0x1736a1[_0x56a6ba[_0x7603('0x2c')]]={'$like':'%'+_0x1a61a5[_0x7603('0x33')][_0x7603('0x3f')]+'%'};return _0x1736a1;}})});}_0x11132f=_[_0x7603('0x41')]({},_0x11132f,_0x1a61a5['options']);var _0x2b5f3d={'where':_0x11132f['where']};return db[_0x7603('0x43')][_0x7603('0x20')](_0x2b5f3d)[_0x7603('0x25')](function(_0xd49c15){_0x449098[_0x7603('0x20')]=_0xd49c15;if(_0x1a61a5[_0x7603('0x33')][_0x7603('0x44')]){_0x11132f[_0x7603('0x45')]=[{'all':!![]}];}return db[_0x7603('0x43')][_0x7603('0x46')](_0x11132f);})[_0x7603('0x25')](function(_0x319fdc){_0x449098[_0x7603('0x47')]=_0x319fdc;return _0x449098;})[_0x7603('0x25')](respondWithFilteredResult(_0x2ab5d0,_0x11132f))['catch'](handleError(_0x2ab5d0,null));};exports['show']=function(_0x186334,_0x392717){var _0x4a5da9={'raw':!![],'where':{'id':_0x186334[_0x7603('0x48')]['id']}},_0x213760={};_0x213760[_0x7603('0x31')]=_[_0x7603('0x34')](db[_0x7603('0x43')][_0x7603('0x2d')]);_0x213760[_0x7603('0x33')]=_['keys'](_0x186334['query']);_0x213760['filters']=_['intersection'](_0x213760[_0x7603('0x31')],_0x213760['query']);_0x4a5da9[_0x7603('0x38')]=_[_0x7603('0x36')](_0x213760[_0x7603('0x31')],qs['fields'](_0x186334[_0x7603('0x33')]['fields']));_0x4a5da9[_0x7603('0x38')]=_0x4a5da9[_0x7603('0x38')][_0x7603('0x39')]?_0x4a5da9[_0x7603('0x38')]:_0x213760[_0x7603('0x31')];if(_0x186334['query'][_0x7603('0x44')]){_0x4a5da9[_0x7603('0x45')]=[{'all':!![]}];}_0x4a5da9=_[_0x7603('0x41')]({},_0x4a5da9,_0x186334[_0x7603('0x49')]);return db[_0x7603('0x43')]['find'](_0x4a5da9)[_0x7603('0x25')](handleEntityNotFound(_0x392717,null))[_0x7603('0x25')](respondWithResult(_0x392717,null))[_0x7603('0x4a')](handleError(_0x392717,null));};exports['create']=function(_0x10a30f,_0x25f8dc){return db[_0x7603('0x43')][_0x7603('0x4b')](_0x10a30f[_0x7603('0x4c')],{})[_0x7603('0x25')](function(_0x848d60){var _0x1bc7cc=_0x10a30f[_0x7603('0x4d')][_0x7603('0x26')]({'plain':!![]});if(!_0x1bc7cc)throw new Error(_0x7603('0x4e'));if(_0x1bc7cc[_0x7603('0x4f')]===_0x7603('0x4d')){var _0x325b91=_0x848d60['get']({'plain':!![]});var _0x24fb21=_0x7603('0x27');return db[_0x7603('0x50')]['find']({'where':{'name':_0x24fb21,'userProfileId':_0x1bc7cc[_0x7603('0x51')]},'raw':!![]})[_0x7603('0x25')](function(_0x5619e8){if(_0x5619e8&&_0x5619e8[_0x7603('0x52')]===0x0){return db[_0x7603('0x28')]['create']({'name':_0x325b91['name'],'resourceId':_0x325b91['id'],'type':_0x5619e8[_0x7603('0x2c')],'sectionId':_0x5619e8['id']},{})[_0x7603('0x25')](function(){return _0x848d60;});}else{return _0x848d60;}})['catch'](function(_0x36394b){logger[_0x7603('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x36394b);throw _0x36394b;});}return _0x848d60;})[_0x7603('0x25')](respondWithResult(_0x25f8dc,0xc9))['catch'](handleError(_0x25f8dc,null));};exports[_0x7603('0x53')]=function(_0xdcdca0,_0x488ebe){if(_0xdcdca0[_0x7603('0x4c')]['id']){delete _0xdcdca0[_0x7603('0x4c')]['id'];}return db['MailQueue'][_0x7603('0x54')]({'where':{'id':_0xdcdca0[_0x7603('0x48')]['id']}})[_0x7603('0x25')](handleEntityNotFound(_0x488ebe,null))[_0x7603('0x25')](saveUpdates(_0xdcdca0[_0x7603('0x4c')],null))['then'](respondWithResult(_0x488ebe,null))[_0x7603('0x4a')](handleError(_0x488ebe,null));};exports[_0x7603('0x55')]=function(_0x1aa868,_0x3431f7){return db['MailQueue']['find']({'where':{'id':_0x1aa868[_0x7603('0x48')]['id']}})[_0x7603('0x25')](handleEntityNotFound(_0x3431f7,null))[_0x7603('0x25')](removeEntity(_0x3431f7,null))[_0x7603('0x4a')](handleError(_0x3431f7,null));};exports[_0x7603('0x56')]=function(_0x75c916,_0x12ac6e){return db[_0x7603('0x43')][_0x7603('0x56')]()['then'](respondWithResult(_0x12ac6e,null))['catch'](handleError(_0x12ac6e,null));};exports[_0x7603('0x57')]=function(_0x34c0fb,_0x3853a8,_0x563cf0){var _0x3c7428={'raw':!![],'where':{}},_0x5a55bc={},_0x455002;return db['MailQueue'][_0x7603('0x58')]({'where':{'id':_0x34c0fb[_0x7603('0x48')]['id']}})['then'](handleEntityNotFound(_0x3853a8,null))[_0x7603('0x25')](function(_0x292e28){if(_0x292e28){_0x455002=_0x292e28[_0x7603('0x26')]({'plain':!![]});_0x5a55bc['model']=_[_0x7603('0x34')](db[_0x7603('0x59')][_0x7603('0x2d')]);_0x5a55bc['query']=_[_0x7603('0x34')](_0x34c0fb[_0x7603('0x33')]);_0x5a55bc[_0x7603('0x35')]=_['intersection'](_0x5a55bc[_0x7603('0x31')],_0x5a55bc['query']);_0x3c7428[_0x7603('0x38')]=_['intersection'](_0x5a55bc[_0x7603('0x31')],qs[_0x7603('0x37')](_0x34c0fb[_0x7603('0x33')][_0x7603('0x37')]));_0x3c7428[_0x7603('0x38')]=_0x3c7428[_0x7603('0x38')][_0x7603('0x39')]?_0x3c7428[_0x7603('0x38')]:_0x5a55bc[_0x7603('0x31')];if(!_0x34c0fb['query'][_0x7603('0x3a')](_0x7603('0x3b'))){_0x3c7428[_0x7603('0x1f')]=qs['limit'](_0x34c0fb[_0x7603('0x33')][_0x7603('0x1f')]);_0x3c7428[_0x7603('0x1d')]=qs['offset'](_0x34c0fb[_0x7603('0x33')]['offset']);}_0x3c7428['order']=qs[_0x7603('0x3d')](_0x34c0fb[_0x7603('0x33')][_0x7603('0x3d')]);_0x3c7428['where']=qs[_0x7603('0x35')](_[_0x7603('0x3e')](_0x34c0fb[_0x7603('0x33')],_0x5a55bc[_0x7603('0x35')]));_0x3c7428[_0x7603('0x40')][_0x7603('0x5a')]=_0x292e28['id'];if(_0x34c0fb[_0x7603('0x33')][_0x7603('0x3f')]){_0x3c7428['where']=_[_0x7603('0x41')](_0x3c7428['where'],{'$or':_['map'](_0x3c7428[_0x7603('0x38')],function(_0x290d4e){var _0x533450={};_0x533450[_0x290d4e]={'$like':'%'+_0x34c0fb[_0x7603('0x33')]['filter']+'%'};return _0x533450;})});}_0x3c7428=_['merge']({},_0x3c7428,_0x34c0fb[_0x7603('0x49')]);return db[_0x7603('0x59')][_0x7603('0x46')](_0x3c7428);}})[_0x7603('0x25')](function(_0x1b30f6){if(_0x1b30f6){return db[_0x7603('0x5b')][_0x7603('0x5c')]({'where':{'id':_['map'](_0x1b30f6,_0x7603('0x5d')),'role':'agent'},'attributes':['id','name',_0x7603('0x5e'),_0x7603('0x5f'),'createdAt']});}})[_0x7603('0x25')](function(_0x4c260a){if(_0x4c260a){return{'count':_0x4c260a[_0x7603('0x20')],'rows':_['map'](_0x4c260a[_0x7603('0x47')],function(_0x24b8e5){return{'membername':_0x24b8e5[_0x7603('0x2c')],'UserId':_0x24b8e5['id'],'queue_name':_0x455002[_0x7603('0x2c')],'MailQueueId':_0x455002['id'],'interface':util['format'](_0x7603('0x60'),_0x7603('0x61'),_0x24b8e5[_0x7603('0x2c')]),'penalty':0x0,'paused':_0x24b8e5[_0x7603('0x5e')],'createdAt':_0x24b8e5[_0x7603('0x62')],'updatedAt':_0x24b8e5['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x7603('0x25')](respondWithFilteredResult(_0x3853a8,_0x3c7428))[_0x7603('0x4a')](handleError(_0x3853a8,null));};exports[_0x7603('0x63')]=function(_0x5c6dbe,_0x5228a7,_0x30d2a4){var _0x1d440f={};var _0x12e500={};var _0x3da537;var _0x35129a;return db[_0x7603('0x43')][_0x7603('0x58')]({'where':{'id':_0x5c6dbe[_0x7603('0x48')]['id']}})[_0x7603('0x25')](handleEntityNotFound(_0x5228a7,null))[_0x7603('0x25')](function(_0x47b0c5){if(_0x47b0c5){_0x3da537=_0x47b0c5;_0x12e500[_0x7603('0x31')]=_[_0x7603('0x34')](db[_0x7603('0x64')][_0x7603('0x2d')]);_0x12e500[_0x7603('0x33')]=_[_0x7603('0x34')](_0x5c6dbe[_0x7603('0x33')]);_0x12e500[_0x7603('0x35')]=_[_0x7603('0x36')](_0x12e500[_0x7603('0x31')],_0x12e500[_0x7603('0x33')]);_0x1d440f[_0x7603('0x38')]=_[_0x7603('0x36')](_0x12e500[_0x7603('0x31')],qs[_0x7603('0x37')](_0x5c6dbe['query'][_0x7603('0x37')]));_0x1d440f[_0x7603('0x38')]=_0x1d440f['attributes'][_0x7603('0x39')]?_0x1d440f[_0x7603('0x38')]:_0x12e500['model'];_0x1d440f[_0x7603('0x3c')]=qs['sort'](_0x5c6dbe['query'][_0x7603('0x3d')]);_0x1d440f[_0x7603('0x40')]=qs['filters'](_[_0x7603('0x3e')](_0x5c6dbe['query'],_0x12e500[_0x7603('0x35')]));if(_0x5c6dbe[_0x7603('0x33')][_0x7603('0x3f')]){_0x1d440f[_0x7603('0x40')]=_[_0x7603('0x41')](_0x1d440f['where'],{'$or':_[_0x7603('0x32')](_0x1d440f['attributes'],function(_0x520893){var _0x11a1b9={};_0x11a1b9[_0x520893]={'$like':'%'+_0x5c6dbe[_0x7603('0x33')][_0x7603('0x3f')]+'%'};return _0x11a1b9;})});}_0x1d440f=_[_0x7603('0x41')]({},_0x1d440f,_0x5c6dbe['options']);return _0x3da537[_0x7603('0x63')](_0x1d440f);}})[_0x7603('0x25')](function(_0x299ff6){if(_0x299ff6){_0x35129a=_0x299ff6['length'];if(!_0x5c6dbe[_0x7603('0x33')]['hasOwnProperty'](_0x7603('0x3b'))){_0x1d440f['limit']=qs['limit'](_0x5c6dbe[_0x7603('0x33')][_0x7603('0x1f')]);_0x1d440f['offset']=qs[_0x7603('0x1d')](_0x5c6dbe[_0x7603('0x33')][_0x7603('0x1d')]);}return _0x3da537[_0x7603('0x63')](_0x1d440f);}})[_0x7603('0x25')](function(_0x2a6132){if(_0x2a6132){return _0x2a6132?{'count':_0x35129a,'rows':_0x2a6132}:null;}})[_0x7603('0x25')](respondWithResult(_0x5228a7,null))[_0x7603('0x4a')](handleError(_0x5228a7,null));};exports[_0x7603('0x65')]=function(_0x4efdfb,_0x215df0,_0x4fbd44){var _0x4d576f=_0x4efdfb[_0x7603('0x4c')][_0x7603('0x66')];return db['Team'][_0x7603('0x46')]({'where':{'id':_0x4d576f},'attributes':['id'],'include':[{'model':db[_0x7603('0x5b')],'as':_0x7603('0x67'),'attributes':['id','name','online',_0x7603('0x68'),'interface'],'raw':!![]}]})[_0x7603('0x25')](function(_0x3b7839){if(_0x3b7839){var _0x5d56e1=_[_0x7603('0x69')](_0x3b7839,function(_0xdac58b){var _0x42592d=_0xdac58b[_0x7603('0x26')]({'plain':!![]});return _0x42592d[_0x7603('0x67')];});return db['MailQueue'][_0x7603('0x54')]({'where':{'id':_0x4efdfb[_0x7603('0x48')]['id']}})['then'](function(_0xddb815){return db['sequelize'][_0x7603('0x6a')](function(_0xe369cb){return _0xddb815[_0x7603('0x65')](_0x4d576f,{'transaction':_0xe369cb})[_0x7603('0x25')](function(){return BPromise['each'](_0x5d56e1,function(_0x38057){return db[_0x7603('0x59')][_0x7603('0x6b')]({'where':{'UserId':_0x38057['id'],'MailQueueId':_0x4efdfb[_0x7603('0x48')]['id']},'transaction':_0xe369cb});});})[_0x7603('0x25')](function(){_0x5d56e1[_0x7603('0x6c')](function(_0x569a1d){socket[_0x7603('0x6d')](_0x7603('0x6e'),{'UserId':_0x569a1d['id'],'MailQueueId':_0xddb815['id']});});});});});}})[_0x7603('0x25')](respondWithStatusCode(_0x215df0,null))[_0x7603('0x4a')](handleError(_0x215df0,null));};exports[_0x7603('0x6f')]=function(_0x238108,_0x59637f,_0x55e129){return db[_0x7603('0x64')][_0x7603('0x46')]({'where':{'id':_0x238108[_0x7603('0x33')][_0x7603('0x66')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x7603('0x67'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x59637f,null))[_0x7603('0x25')](function(_0x79eb4a){var _0xca392f=_[_0x7603('0x32')](_0x79eb4a,'id');var _0x2d884b=[];var _0x580b1e=[];var _0x32e8fb=squel['select']();_0x32e8fb[_0x7603('0x70')]('tq.TeamId')[_0x7603('0x71')](_0x7603('0x72'),'tq')[_0x7603('0x73')](_0x7603('0x74'),'ut',_0x7603('0x75'))[_0x7603('0x40')](_0x7603('0x76'),_0x238108['params']['id']);for(var _0x1e08c3=0x0;_0x1e08c3<_0x79eb4a['length'];_0x1e08c3+=0x1){let _0x57cd92=_0x79eb4a[_0x1e08c3];for(var _0x3d1d2c=0x0;_0x3d1d2c<_0x57cd92[_0x7603('0x67')][_0x7603('0x39')];_0x3d1d2c+=0x1){let _0x2bc08a=_0x57cd92[_0x7603('0x67')][_0x3d1d2c];var _0x6a437a=_0x32e8fb[_0x7603('0x77')]();_0x6a437a['where'](_0x7603('0x78'),_0x2bc08a['id']);_0x580b1e[_0x7603('0x79')](db[_0x7603('0x7a')][_0x7603('0x33')](_0x6a437a['toString'](),{'type':db[_0x7603('0x7a')][_0x7603('0x7b')][_0x7603('0x7c')]})[_0x7603('0x25')](function(_0x6bae35){if(_0x6bae35['length']===0x1){return _0x2bc08a['id'];}else{var _0x58c9c3=_['every'](_[_0x7603('0x32')](_0x6bae35,_0x7603('0x7d')),function(_0x498c4f){return _[_0x7603('0x7e')](_0xca392f,_0x498c4f);});if(_0x58c9c3){return _0x2bc08a['id'];}}}));}}return BPromise[_0x7603('0x7f')](_0x580b1e)[_0x7603('0x25')](function(_0x39ed4a){_0x2d884b=_(_0x2d884b)[_0x7603('0x80')](_0x39ed4a)['compact']()[_0x7603('0x81')]();return db[_0x7603('0x43')][_0x7603('0x54')]({'where':{'id':_0x238108[_0x7603('0x48')]['id']}})[_0x7603('0x25')](function(_0x4c08f1){return db[_0x7603('0x7a')][_0x7603('0x6a')](function(_0x2a7d00){return _0x4c08f1[_0x7603('0x6f')](_0x238108['query'][_0x7603('0x66')],{'transaction':_0x2a7d00})[_0x7603('0x25')](function(){if(!_[_0x7603('0x82')](_0x2d884b)){return _0x4c08f1['removeAgents'](_0x2d884b,{'transaction':_0x2a7d00});}})[_0x7603('0x25')](function(){_0x2d884b[_0x7603('0x6c')](function(_0x2a4866){socket['emit'](_0x7603('0x83'),{'UserId':_0x2a4866,'MailQueueId':_0x4c08f1['id']});});});});});});})[_0x7603('0x25')](respondWithStatusCode(_0x59637f,null))[_0x7603('0x4a')](handleError(_0x59637f,null));};exports[_0x7603('0x84')]=function(_0x3b8551,_0x5b1a69,_0x121594){return db[_0x7603('0x43')]['find']({'where':{'id':_0x3b8551[_0x7603('0x48')]['id']}})[_0x7603('0x25')](handleEntityNotFound(_0x5b1a69,null))[_0x7603('0x25')](function(_0x49736c){if(_0x49736c){return _0x49736c[_0x7603('0x84')](_0x3b8551['body']['ids'],_['omit'](_0x3b8551[_0x7603('0x4c')],['ids','id'])||{})[_0x7603('0x85')](function(_0x4e9a56){for(var _0x21dc6f=0x0;_0x21dc6f<_0x3b8551[_0x7603('0x4c')][_0x7603('0x66')][_0x7603('0x39')];_0x21dc6f+=0x1){socket['emit'](_0x7603('0x6e'),{'UserId':Number(_0x3b8551[_0x7603('0x4c')][_0x7603('0x66')][_0x21dc6f]),'MailQueueId':Number(_0x3b8551[_0x7603('0x48')]['id'])});}return _0x4e9a56;});}})[_0x7603('0x25')](respondWithResult(_0x5b1a69,null))[_0x7603('0x4a')](handleError(_0x5b1a69,null));};exports[_0x7603('0x86')]=function(_0x43159d,_0x531784,_0xfea60e){return db[_0x7603('0x43')][_0x7603('0x54')]({'where':{'id':_0x43159d[_0x7603('0x48')]['id']}})[_0x7603('0x25')](handleEntityNotFound(_0x531784,null))[_0x7603('0x25')](function(_0x32e6e6){if(_0x32e6e6){return _0x32e6e6[_0x7603('0x86')](_0x43159d[_0x7603('0x33')][_0x7603('0x66')])['then'](function(){if(_['isArray'](_0x43159d['query'][_0x7603('0x66')])){for(var _0x2b4cc9=0x0;_0x2b4cc9<_0x43159d[_0x7603('0x33')][_0x7603('0x66')][_0x7603('0x39')];_0x2b4cc9+=0x1){socket[_0x7603('0x6d')](_0x7603('0x83'),{'UserId':Number(_0x43159d[_0x7603('0x33')][_0x7603('0x66')][_0x2b4cc9]),'MailQueueId':Number(_0x43159d['params']['id'])});}}else{socket[_0x7603('0x6d')](_0x7603('0x83'),{'UserId':Number(_0x43159d[_0x7603('0x33')][_0x7603('0x66')]),'MailQueueId':Number(_0x43159d[_0x7603('0x48')]['id'])});}});}})['then'](respondWithStatusCode(_0x531784,null))[_0x7603('0x4a')](handleError(_0x531784,null));};exports['getAgents']=function(_0x2ef341,_0x394952,_0xd25dc9){var _0x345c8d={};var _0xcf956c={};var _0x5c0d14;var _0x4961ce;return db[_0x7603('0x43')][_0x7603('0x58')]({'where':{'id':_0x2ef341[_0x7603('0x48')]['id']}})[_0x7603('0x25')](handleEntityNotFound(_0x394952,null))[_0x7603('0x25')](function(_0x3e33e3){if(_0x3e33e3){_0x5c0d14=_0x3e33e3;_0xcf956c['model']=_[_0x7603('0x34')](db[_0x7603('0x5b')][_0x7603('0x2d')]);_0xcf956c[_0x7603('0x33')]=_[_0x7603('0x34')](_0x2ef341[_0x7603('0x33')]);_0xcf956c[_0x7603('0x35')]=_[_0x7603('0x36')](_0xcf956c[_0x7603('0x31')],_0xcf956c[_0x7603('0x33')]);_0x345c8d['attributes']=_[_0x7603('0x36')](_0xcf956c[_0x7603('0x31')],qs[_0x7603('0x37')](_0x2ef341[_0x7603('0x33')][_0x7603('0x37')]));_0x345c8d[_0x7603('0x38')]=_0x345c8d[_0x7603('0x38')][_0x7603('0x39')]?_0x345c8d[_0x7603('0x38')]:_0xcf956c[_0x7603('0x31')];_0x345c8d[_0x7603('0x3c')]=qs[_0x7603('0x3d')](_0x2ef341[_0x7603('0x33')]['sort']);_0x345c8d[_0x7603('0x40')]=qs['filters'](_['pick'](_0x2ef341[_0x7603('0x33')],_0xcf956c[_0x7603('0x35')]));if(_0x2ef341[_0x7603('0x33')][_0x7603('0x3f')]){_0x345c8d[_0x7603('0x40')]=_[_0x7603('0x41')](_0x345c8d['where'],{'$or':_[_0x7603('0x32')](_0x345c8d[_0x7603('0x38')],function(_0xf43b7f){var _0xfd7b9a={};_0xfd7b9a[_0xf43b7f]={'$like':'%'+_0x2ef341[_0x7603('0x33')][_0x7603('0x3f')]+'%'};return _0xfd7b9a;})});}_0x345c8d=_['merge']({},_0x345c8d,_0x2ef341[_0x7603('0x49')]);return _0x5c0d14[_0x7603('0x87')](_0x345c8d);}})[_0x7603('0x25')](function(_0x65d1a7){if(_0x65d1a7){_0x4961ce=_0x65d1a7[_0x7603('0x39')];if(!_0x2ef341[_0x7603('0x33')][_0x7603('0x3a')](_0x7603('0x3b'))){_0x345c8d[_0x7603('0x1f')]=qs[_0x7603('0x1f')](_0x2ef341[_0x7603('0x33')][_0x7603('0x1f')]);_0x345c8d['offset']=qs[_0x7603('0x1d')](_0x2ef341[_0x7603('0x33')][_0x7603('0x1d')]);}return _0x5c0d14[_0x7603('0x87')](_0x345c8d);}})[_0x7603('0x25')](function(_0x345685){if(_0x345685){return _0x345685?{'count':_0x4961ce,'rows':_0x345685}:null;}})[_0x7603('0x25')](respondWithResult(_0x394952,null))[_0x7603('0x4a')](handleError(_0x394952,null));}; \ No newline at end of file +var _0x8a30=['userMailQueue:save','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','sox','ejs','lodash','squel','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','end','offset','limit','undefined','count','json','apply','reject','save','update','then','destroy','MailQueues','UserProfileResource','error','stack','name','map','MailQueue','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','catch','params','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserMailQueue','MailQueueId','User','UserId','agent','mailPause','createdAt','rows','format','%s/%s','SIP','updatedAt','getTeams','Team','ids','findAll','Agents','online','voicePause','interface','flatMap','transaction','addTeams','each','findOrCreate','forEach','removeTeams','select','field','from','team_has_mail_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','SELECT','TeamId','includes','value','isEmpty','removeAgents','emit','userMailQueue:remove','addAgents','spread'];(function(_0x22d4f0,_0x2f9fcf){var _0x1bf852=function(_0x215869){while(--_0x215869){_0x22d4f0['push'](_0x22d4f0['shift']());}};_0x1bf852(++_0x2f9fcf);}(_0x8a30,0x1a1));var _0x08a3=function(_0x2b5f08,_0x567bd0){_0x2b5f08=_0x2b5f08-0x0;var _0x5ca4f6=_0x8a30[_0x2b5f08];return _0x5ca4f6;};'use strict';var emlformat=require(_0x08a3('0x0'));var rimraf=require(_0x08a3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x08a3('0x2'));var rp=require(_0x08a3('0x3'));var moment=require(_0x08a3('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x08a3('0x5'));var path=require(_0x08a3('0x6'));var sox=require(_0x08a3('0x7'));var csv=require('to-csv');var ejs=require(_0x08a3('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x08a3('0x9'));var squel=require(_0x08a3('0xa'));var crypto=require('crypto');var jsforce=require(_0x08a3('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x08a3('0xc'));var querystring=require('querystring');var Papa=require(_0x08a3('0xd'));var Redis=require(_0x08a3('0xe'));var authService=require(_0x08a3('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x08a3('0x10'));var hardwareService=require(_0x08a3('0x11'));var logger=require(_0x08a3('0x12'))(_0x08a3('0x13'));var utils=require(_0x08a3('0x14'));var config=require(_0x08a3('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x08a3('0x16')]=_['defaults'](config['redis'],{'host':_0x08a3('0x17'),'port':0x18eb});var socket=require(_0x08a3('0x18'))(new Redis(config['redis']));require(_0x08a3('0x19'))[_0x08a3('0x1a')](socket);function respondWithStatusCode(_0x2a6fda,_0x39fad7){_0x39fad7=_0x39fad7||0xcc;return function(_0x10b6a8){if(_0x10b6a8){return _0x2a6fda[_0x08a3('0x1b')](_0x39fad7);}return _0x2a6fda[_0x08a3('0x1c')](_0x39fad7)[_0x08a3('0x1d')]();};}function respondWithResult(_0x541851,_0x4074a0){_0x4074a0=_0x4074a0||0xc8;return function(_0x1bac61){if(_0x1bac61){return _0x541851[_0x08a3('0x1c')](_0x4074a0)['json'](_0x1bac61);}};}function respondWithFilteredResult(_0xd7b53e,_0x1ed571){return function(_0x513b7e){if(_0x513b7e){var _0x4c5c7e=typeof _0x1ed571[_0x08a3('0x1e')]==='undefined'&&typeof _0x1ed571[_0x08a3('0x1f')]===_0x08a3('0x20');var _0x13c227=_0x513b7e[_0x08a3('0x21')];var _0x13b284=_0x4c5c7e?0x0:_0x1ed571[_0x08a3('0x1e')];var _0x3a5935=_0x4c5c7e?_0x513b7e[_0x08a3('0x21')]:_0x1ed571[_0x08a3('0x1e')]+_0x1ed571[_0x08a3('0x1f')];var _0x3d4369;if(_0x3a5935>=_0x13c227){_0x3a5935=_0x13c227;_0x3d4369=0xc8;}else{_0x3d4369=0xce;}_0xd7b53e[_0x08a3('0x1c')](_0x3d4369);return _0xd7b53e['set']('Content-Range',_0x13b284+'-'+_0x3a5935+'/'+_0x13c227)[_0x08a3('0x22')](_0x513b7e);}return null;};}function patchUpdates(_0x53ac16){return function(_0x4df8b5){try{jsonpatch[_0x08a3('0x23')](_0x4df8b5,_0x53ac16,!![]);}catch(_0xdaa949){return BPromise[_0x08a3('0x24')](_0xdaa949);}return _0x4df8b5[_0x08a3('0x25')]();};}function saveUpdates(_0xd86e10,_0x23d2ba){return function(_0x38f69b){if(_0x38f69b){return _0x38f69b[_0x08a3('0x26')](_0xd86e10)[_0x08a3('0x27')](function(_0x123875){return _0x123875;});}return null;};}function removeEntity(_0x1ff832,_0x53102a){return function(_0x42931c){if(_0x42931c){return _0x42931c[_0x08a3('0x28')]()[_0x08a3('0x27')](function(){var _0x3fe4a0=_0x42931c['get']({'plain':!![]});var _0x25d7dc=_0x08a3('0x29');return db[_0x08a3('0x2a')][_0x08a3('0x28')]({'where':{'type':_0x25d7dc,'resourceId':_0x3fe4a0['id']}})['then'](function(){return _0x42931c;});})[_0x08a3('0x27')](function(){_0x1ff832[_0x08a3('0x1c')](0xcc)[_0x08a3('0x1d')]();});}};}function handleEntityNotFound(_0x5bbc90,_0x350dab){return function(_0x288d49){if(!_0x288d49){_0x5bbc90[_0x08a3('0x1b')](0x194);}return _0x288d49;};}function handleError(_0x37effa,_0x1aeff4){_0x1aeff4=_0x1aeff4||0x1f4;return function(_0x10d66c){logger[_0x08a3('0x2b')](_0x10d66c[_0x08a3('0x2c')]);if(_0x10d66c[_0x08a3('0x2d')]){delete _0x10d66c[_0x08a3('0x2d')];}_0x37effa[_0x08a3('0x1c')](_0x1aeff4)['send'](_0x10d66c);};}exports['index']=function(_0xa5b959,_0x15fa44){var _0x5f4aa3={},_0x117164={},_0x3f8d3b={'count':0x0,'rows':[]};var _0x362235=_[_0x08a3('0x2e')](db[_0x08a3('0x2f')][_0x08a3('0x30')],function(_0xb2cb0d){return{'name':_0xb2cb0d[_0x08a3('0x31')],'type':_0xb2cb0d[_0x08a3('0x32')]['key']};});_0x117164[_0x08a3('0x33')]=_[_0x08a3('0x2e')](_0x362235,'name');_0x117164[_0x08a3('0x34')]=_[_0x08a3('0x35')](_0xa5b959[_0x08a3('0x34')]);_0x117164[_0x08a3('0x36')]=_[_0x08a3('0x37')](_0x117164['model'],_0x117164['query']);_0x5f4aa3[_0x08a3('0x38')]=_['intersection'](_0x117164['model'],qs['fields'](_0xa5b959[_0x08a3('0x34')][_0x08a3('0x39')]));_0x5f4aa3[_0x08a3('0x38')]=_0x5f4aa3['attributes'][_0x08a3('0x3a')]?_0x5f4aa3[_0x08a3('0x38')]:_0x117164[_0x08a3('0x33')];if(!_0xa5b959[_0x08a3('0x34')][_0x08a3('0x3b')](_0x08a3('0x3c'))){_0x5f4aa3[_0x08a3('0x1f')]=qs[_0x08a3('0x1f')](_0xa5b959[_0x08a3('0x34')][_0x08a3('0x1f')]);_0x5f4aa3['offset']=qs['offset'](_0xa5b959[_0x08a3('0x34')][_0x08a3('0x1e')]);}_0x5f4aa3[_0x08a3('0x3d')]=qs[_0x08a3('0x3e')](_0xa5b959[_0x08a3('0x34')]['sort']);_0x5f4aa3[_0x08a3('0x3f')]=qs[_0x08a3('0x36')](_[_0x08a3('0x40')](_0xa5b959['query'],_0x117164[_0x08a3('0x36')]),_0x362235);if(_0xa5b959[_0x08a3('0x34')][_0x08a3('0x41')]){_0x5f4aa3['where']=_[_0x08a3('0x42')](_0x5f4aa3['where'],{'$or':_[_0x08a3('0x2e')](_0x362235,function(_0x5ad0b8){if(_0x5ad0b8[_0x08a3('0x32')]!==_0x08a3('0x43')){var _0x21de02={};_0x21de02[_0x5ad0b8[_0x08a3('0x2d')]]={'$like':'%'+_0xa5b959['query'][_0x08a3('0x41')]+'%'};return _0x21de02;}})});}_0x5f4aa3=_[_0x08a3('0x42')]({},_0x5f4aa3,_0xa5b959['options']);var _0x5762ea={'where':_0x5f4aa3[_0x08a3('0x3f')]};return db[_0x08a3('0x2f')][_0x08a3('0x21')](_0x5762ea)[_0x08a3('0x27')](function(_0x2e0e4b){_0x3f8d3b['count']=_0x2e0e4b;if(_0xa5b959[_0x08a3('0x34')]['includeAll']){_0x5f4aa3[_0x08a3('0x44')]=[{'all':!![]}];}return db[_0x08a3('0x2f')]['findAll'](_0x5f4aa3);})['then'](function(_0x5eab8d){_0x3f8d3b['rows']=_0x5eab8d;return _0x3f8d3b;})[_0x08a3('0x27')](respondWithFilteredResult(_0x15fa44,_0x5f4aa3))[_0x08a3('0x45')](handleError(_0x15fa44,null));};exports['show']=function(_0xba33f5,_0x3c6120){var _0x5a9d2f={'raw':!![],'where':{'id':_0xba33f5[_0x08a3('0x46')]['id']}},_0x1e8db7={};_0x1e8db7[_0x08a3('0x33')]=_[_0x08a3('0x35')](db[_0x08a3('0x2f')][_0x08a3('0x30')]);_0x1e8db7['query']=_[_0x08a3('0x35')](_0xba33f5[_0x08a3('0x34')]);_0x1e8db7[_0x08a3('0x36')]=_[_0x08a3('0x37')](_0x1e8db7[_0x08a3('0x33')],_0x1e8db7['query']);_0x5a9d2f[_0x08a3('0x38')]=_['intersection'](_0x1e8db7[_0x08a3('0x33')],qs[_0x08a3('0x39')](_0xba33f5[_0x08a3('0x34')][_0x08a3('0x39')]));_0x5a9d2f[_0x08a3('0x38')]=_0x5a9d2f[_0x08a3('0x38')][_0x08a3('0x3a')]?_0x5a9d2f[_0x08a3('0x38')]:_0x1e8db7[_0x08a3('0x33')];if(_0xba33f5[_0x08a3('0x34')][_0x08a3('0x47')]){_0x5a9d2f[_0x08a3('0x44')]=[{'all':!![]}];}_0x5a9d2f=_[_0x08a3('0x42')]({},_0x5a9d2f,_0xba33f5[_0x08a3('0x48')]);return db['MailQueue'][_0x08a3('0x49')](_0x5a9d2f)[_0x08a3('0x27')](handleEntityNotFound(_0x3c6120,null))[_0x08a3('0x27')](respondWithResult(_0x3c6120,null))[_0x08a3('0x45')](handleError(_0x3c6120,null));};exports[_0x08a3('0x4a')]=function(_0x1f1013,_0x41c0cc){return db[_0x08a3('0x2f')][_0x08a3('0x4a')](_0x1f1013[_0x08a3('0x4b')],{})[_0x08a3('0x27')](function(_0x2ce79c){var _0xc66d0f=_0x1f1013[_0x08a3('0x4c')]['get']({'plain':!![]});if(!_0xc66d0f)throw new Error(_0x08a3('0x4d'));if(_0xc66d0f[_0x08a3('0x4e')]==='user'){var _0x37f286=_0x2ce79c[_0x08a3('0x4f')]({'plain':!![]});var _0x320b34=_0x08a3('0x29');return db['UserProfileSection']['find']({'where':{'name':_0x320b34,'userProfileId':_0xc66d0f[_0x08a3('0x50')]},'raw':!![]})[_0x08a3('0x27')](function(_0x93e7f9){if(_0x93e7f9&&_0x93e7f9[_0x08a3('0x51')]===0x0){return db[_0x08a3('0x2a')][_0x08a3('0x4a')]({'name':_0x37f286[_0x08a3('0x2d')],'resourceId':_0x37f286['id'],'type':_0x93e7f9[_0x08a3('0x2d')],'sectionId':_0x93e7f9['id']},{})[_0x08a3('0x27')](function(){return _0x2ce79c;});}else{return _0x2ce79c;}})[_0x08a3('0x45')](function(_0x2f49ad){logger['error'](_0x08a3('0x52'),_0x2f49ad);throw _0x2f49ad;});}return _0x2ce79c;})['then'](respondWithResult(_0x41c0cc,0xc9))[_0x08a3('0x45')](handleError(_0x41c0cc,null));};exports['update']=function(_0x13ae17,_0x3efe5c){if(_0x13ae17[_0x08a3('0x4b')]['id']){delete _0x13ae17[_0x08a3('0x4b')]['id'];}return db['MailQueue'][_0x08a3('0x49')]({'where':{'id':_0x13ae17['params']['id']}})[_0x08a3('0x27')](handleEntityNotFound(_0x3efe5c,null))['then'](saveUpdates(_0x13ae17[_0x08a3('0x4b')],null))[_0x08a3('0x27')](respondWithResult(_0x3efe5c,null))[_0x08a3('0x45')](handleError(_0x3efe5c,null));};exports['destroy']=function(_0x5b9bc7,_0x288b3d){return db[_0x08a3('0x2f')][_0x08a3('0x49')]({'where':{'id':_0x5b9bc7[_0x08a3('0x46')]['id']}})[_0x08a3('0x27')](handleEntityNotFound(_0x288b3d,null))[_0x08a3('0x27')](removeEntity(_0x288b3d,null))[_0x08a3('0x45')](handleError(_0x288b3d,null));};exports[_0x08a3('0x53')]=function(_0x390d4c,_0x3afee6){return db[_0x08a3('0x2f')][_0x08a3('0x53')]()['then'](respondWithResult(_0x3afee6,null))['catch'](handleError(_0x3afee6,null));};exports[_0x08a3('0x54')]=function(_0x16c18e,_0x335d2b,_0x174880){var _0x43ba11={'raw':!![],'where':{}},_0x47df55={},_0x4b19fd;return db[_0x08a3('0x2f')][_0x08a3('0x55')]({'where':{'id':_0x16c18e[_0x08a3('0x46')]['id']}})['then'](handleEntityNotFound(_0x335d2b,null))[_0x08a3('0x27')](function(_0x31a949){if(_0x31a949){_0x4b19fd=_0x31a949[_0x08a3('0x4f')]({'plain':!![]});_0x47df55[_0x08a3('0x33')]=_[_0x08a3('0x35')](db[_0x08a3('0x56')][_0x08a3('0x30')]);_0x47df55[_0x08a3('0x34')]=_['keys'](_0x16c18e[_0x08a3('0x34')]);_0x47df55['filters']=_[_0x08a3('0x37')](_0x47df55[_0x08a3('0x33')],_0x47df55[_0x08a3('0x34')]);_0x43ba11[_0x08a3('0x38')]=_[_0x08a3('0x37')](_0x47df55['model'],qs[_0x08a3('0x39')](_0x16c18e['query']['fields']));_0x43ba11[_0x08a3('0x38')]=_0x43ba11[_0x08a3('0x38')][_0x08a3('0x3a')]?_0x43ba11[_0x08a3('0x38')]:_0x47df55['model'];if(!_0x16c18e['query'][_0x08a3('0x3b')](_0x08a3('0x3c'))){_0x43ba11['limit']=qs[_0x08a3('0x1f')](_0x16c18e[_0x08a3('0x34')][_0x08a3('0x1f')]);_0x43ba11[_0x08a3('0x1e')]=qs[_0x08a3('0x1e')](_0x16c18e['query'][_0x08a3('0x1e')]);}_0x43ba11[_0x08a3('0x3d')]=qs['sort'](_0x16c18e[_0x08a3('0x34')][_0x08a3('0x3e')]);_0x43ba11[_0x08a3('0x3f')]=qs['filters'](_['pick'](_0x16c18e[_0x08a3('0x34')],_0x47df55[_0x08a3('0x36')]));_0x43ba11[_0x08a3('0x3f')][_0x08a3('0x57')]=_0x31a949['id'];if(_0x16c18e[_0x08a3('0x34')][_0x08a3('0x41')]){_0x43ba11[_0x08a3('0x3f')]=_[_0x08a3('0x42')](_0x43ba11['where'],{'$or':_[_0x08a3('0x2e')](_0x43ba11[_0x08a3('0x38')],function(_0x3c5896){var _0x3d0251={};_0x3d0251[_0x3c5896]={'$like':'%'+_0x16c18e[_0x08a3('0x34')]['filter']+'%'};return _0x3d0251;})});}_0x43ba11=_[_0x08a3('0x42')]({},_0x43ba11,_0x16c18e[_0x08a3('0x48')]);return db[_0x08a3('0x56')]['findAll'](_0x43ba11);}})['then'](function(_0x5f558c){if(_0x5f558c){return db[_0x08a3('0x58')]['findAndCountAll']({'where':{'id':_[_0x08a3('0x2e')](_0x5f558c,_0x08a3('0x59')),'role':_0x08a3('0x5a')},'attributes':['id','name',_0x08a3('0x5b'),'updatedAt',_0x08a3('0x5c')]});}})[_0x08a3('0x27')](function(_0x99facf){if(_0x99facf){return{'count':_0x99facf[_0x08a3('0x21')],'rows':_['map'](_0x99facf[_0x08a3('0x5d')],function(_0x75781e){return{'membername':_0x75781e[_0x08a3('0x2d')],'UserId':_0x75781e['id'],'queue_name':_0x4b19fd['name'],'MailQueueId':_0x4b19fd['id'],'interface':util[_0x08a3('0x5e')](_0x08a3('0x5f'),_0x08a3('0x60'),_0x75781e[_0x08a3('0x2d')]),'penalty':0x0,'paused':_0x75781e[_0x08a3('0x5b')],'createdAt':_0x75781e[_0x08a3('0x5c')],'updatedAt':_0x75781e[_0x08a3('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x08a3('0x27')](respondWithFilteredResult(_0x335d2b,_0x43ba11))[_0x08a3('0x45')](handleError(_0x335d2b,null));};exports[_0x08a3('0x62')]=function(_0x2ca3c4,_0x454db5,_0x53cb29){var _0x3b0e54={};var _0x436efe={};var _0xb42a98;var _0x223420;return db[_0x08a3('0x2f')]['findOne']({'where':{'id':_0x2ca3c4[_0x08a3('0x46')]['id']}})['then'](handleEntityNotFound(_0x454db5,null))[_0x08a3('0x27')](function(_0xafe733){if(_0xafe733){_0xb42a98=_0xafe733;_0x436efe['model']=_[_0x08a3('0x35')](db[_0x08a3('0x63')][_0x08a3('0x30')]);_0x436efe['query']=_[_0x08a3('0x35')](_0x2ca3c4['query']);_0x436efe[_0x08a3('0x36')]=_[_0x08a3('0x37')](_0x436efe[_0x08a3('0x33')],_0x436efe[_0x08a3('0x34')]);_0x3b0e54[_0x08a3('0x38')]=_['intersection'](_0x436efe[_0x08a3('0x33')],qs['fields'](_0x2ca3c4[_0x08a3('0x34')][_0x08a3('0x39')]));_0x3b0e54[_0x08a3('0x38')]=_0x3b0e54[_0x08a3('0x38')][_0x08a3('0x3a')]?_0x3b0e54[_0x08a3('0x38')]:_0x436efe[_0x08a3('0x33')];_0x3b0e54['order']=qs[_0x08a3('0x3e')](_0x2ca3c4[_0x08a3('0x34')]['sort']);_0x3b0e54[_0x08a3('0x3f')]=qs[_0x08a3('0x36')](_[_0x08a3('0x40')](_0x2ca3c4['query'],_0x436efe[_0x08a3('0x36')]));if(_0x2ca3c4[_0x08a3('0x34')]['filter']){_0x3b0e54[_0x08a3('0x3f')]=_['merge'](_0x3b0e54[_0x08a3('0x3f')],{'$or':_['map'](_0x3b0e54[_0x08a3('0x38')],function(_0x2dd33b){var _0x1b0287={};_0x1b0287[_0x2dd33b]={'$like':'%'+_0x2ca3c4[_0x08a3('0x34')][_0x08a3('0x41')]+'%'};return _0x1b0287;})});}_0x3b0e54=_[_0x08a3('0x42')]({},_0x3b0e54,_0x2ca3c4[_0x08a3('0x48')]);return _0xb42a98['getTeams'](_0x3b0e54);}})[_0x08a3('0x27')](function(_0x373fcb){if(_0x373fcb){_0x223420=_0x373fcb[_0x08a3('0x3a')];if(!_0x2ca3c4['query'][_0x08a3('0x3b')]('nolimit')){_0x3b0e54[_0x08a3('0x1f')]=qs[_0x08a3('0x1f')](_0x2ca3c4['query'][_0x08a3('0x1f')]);_0x3b0e54[_0x08a3('0x1e')]=qs[_0x08a3('0x1e')](_0x2ca3c4[_0x08a3('0x34')][_0x08a3('0x1e')]);}return _0xb42a98['getTeams'](_0x3b0e54);}})['then'](function(_0xe1c85){if(_0xe1c85){return _0xe1c85?{'count':_0x223420,'rows':_0xe1c85}:null;}})['then'](respondWithResult(_0x454db5,null))['catch'](handleError(_0x454db5,null));};exports['addTeams']=function(_0x3262f0,_0x275a92,_0x4fe97d){var _0x1601fd=_0x3262f0[_0x08a3('0x4b')][_0x08a3('0x64')];return db[_0x08a3('0x63')][_0x08a3('0x65')]({'where':{'id':_0x1601fd},'attributes':['id'],'include':[{'model':db[_0x08a3('0x58')],'as':_0x08a3('0x66'),'attributes':['id',_0x08a3('0x2d'),_0x08a3('0x67'),_0x08a3('0x68'),_0x08a3('0x69')],'raw':!![]}]})[_0x08a3('0x27')](function(_0x5bcbe9){if(_0x5bcbe9){var _0x37f7d4=_[_0x08a3('0x6a')](_0x5bcbe9,function(_0x16d294){var _0x435d98=_0x16d294[_0x08a3('0x4f')]({'plain':!![]});return _0x435d98['Agents'];});return db[_0x08a3('0x2f')][_0x08a3('0x49')]({'where':{'id':_0x3262f0['params']['id']}})['then'](function(_0x623118){return db['sequelize'][_0x08a3('0x6b')](function(_0x1e692d){return _0x623118[_0x08a3('0x6c')](_0x1601fd,{'transaction':_0x1e692d})[_0x08a3('0x27')](function(){return BPromise[_0x08a3('0x6d')](_0x37f7d4,function(_0x269293){return db[_0x08a3('0x56')][_0x08a3('0x6e')]({'where':{'UserId':_0x269293['id'],'MailQueueId':_0x3262f0[_0x08a3('0x46')]['id']},'transaction':_0x1e692d});});})[_0x08a3('0x27')](function(){_0x37f7d4[_0x08a3('0x6f')](function(_0x5baded){socket['emit']('userMailQueue:save',{'UserId':_0x5baded['id'],'MailQueueId':_0x623118['id']});});});});});}})['then'](respondWithStatusCode(_0x275a92,null))[_0x08a3('0x45')](handleError(_0x275a92,null));};exports[_0x08a3('0x70')]=function(_0x1a579d,_0x2800c5,_0x41ca6e){return db['Team'][_0x08a3('0x65')]({'where':{'id':_0x1a579d[_0x08a3('0x34')][_0x08a3('0x64')]},'attributes':['id'],'include':[{'model':db[_0x08a3('0x58')],'as':_0x08a3('0x66'),'attributes':['id'],'raw':!![]}]})[_0x08a3('0x27')](handleEntityNotFound(_0x2800c5,null))[_0x08a3('0x27')](function(_0x393637){var _0x408474=_[_0x08a3('0x2e')](_0x393637,'id');var _0x1c827d=[];var _0x22b81d=[];var _0x584e41=squel[_0x08a3('0x71')]();_0x584e41[_0x08a3('0x72')]('tq.TeamId')[_0x08a3('0x73')](_0x08a3('0x74'),'tq')['join'](_0x08a3('0x75'),'ut',_0x08a3('0x76'))[_0x08a3('0x3f')](_0x08a3('0x77'),_0x1a579d[_0x08a3('0x46')]['id']);for(var _0x104f14=0x0;_0x104f14<_0x393637[_0x08a3('0x3a')];_0x104f14+=0x1){let _0x2b8164=_0x393637[_0x104f14];for(var _0x4ceabb=0x0;_0x4ceabb<_0x2b8164[_0x08a3('0x66')][_0x08a3('0x3a')];_0x4ceabb+=0x1){let _0x324c6b=_0x2b8164[_0x08a3('0x66')][_0x4ceabb];var _0x47087d=_0x584e41[_0x08a3('0x78')]();_0x47087d['where'](_0x08a3('0x79'),_0x324c6b['id']);_0x22b81d[_0x08a3('0x7a')](db[_0x08a3('0x7b')][_0x08a3('0x34')](_0x47087d['toString'](),{'type':db[_0x08a3('0x7b')][_0x08a3('0x7c')][_0x08a3('0x7d')]})[_0x08a3('0x27')](function(_0x155a52){if(_0x155a52[_0x08a3('0x3a')]===0x1){return _0x324c6b['id'];}else{var _0xf38c28=_['every'](_['map'](_0x155a52,_0x08a3('0x7e')),function(_0x270603){return _[_0x08a3('0x7f')](_0x408474,_0x270603);});if(_0xf38c28){return _0x324c6b['id'];}}}));}}return BPromise['all'](_0x22b81d)[_0x08a3('0x27')](function(_0x3f1905){_0x1c827d=_(_0x1c827d)['union'](_0x3f1905)['compact']()[_0x08a3('0x80')]();return db[_0x08a3('0x2f')][_0x08a3('0x49')]({'where':{'id':_0x1a579d['params']['id']}})['then'](function(_0x24203f){return db[_0x08a3('0x7b')][_0x08a3('0x6b')](function(_0x2da237){return _0x24203f[_0x08a3('0x70')](_0x1a579d['query']['ids'],{'transaction':_0x2da237})[_0x08a3('0x27')](function(){if(!_[_0x08a3('0x81')](_0x1c827d)){return _0x24203f[_0x08a3('0x82')](_0x1c827d,{'transaction':_0x2da237});}})[_0x08a3('0x27')](function(){_0x1c827d[_0x08a3('0x6f')](function(_0x19471e){socket[_0x08a3('0x83')](_0x08a3('0x84'),{'UserId':_0x19471e,'MailQueueId':_0x24203f['id']});});});});});});})[_0x08a3('0x27')](respondWithStatusCode(_0x2800c5,null))[_0x08a3('0x45')](handleError(_0x2800c5,null));};exports[_0x08a3('0x85')]=function(_0x5b7b5a,_0x561ae7,_0x3a6eb3){return db[_0x08a3('0x2f')][_0x08a3('0x49')]({'where':{'id':_0x5b7b5a['params']['id']}})[_0x08a3('0x27')](handleEntityNotFound(_0x561ae7,null))[_0x08a3('0x27')](function(_0x1b659b){if(_0x1b659b){return _0x1b659b['addAgents'](_0x5b7b5a[_0x08a3('0x4b')][_0x08a3('0x64')],_['omit'](_0x5b7b5a[_0x08a3('0x4b')],[_0x08a3('0x64'),'id'])||{})[_0x08a3('0x86')](function(_0x426250){for(var _0x1da0f3=0x0;_0x1da0f3<_0x5b7b5a[_0x08a3('0x4b')][_0x08a3('0x64')][_0x08a3('0x3a')];_0x1da0f3+=0x1){socket[_0x08a3('0x83')](_0x08a3('0x87'),{'UserId':Number(_0x5b7b5a['body'][_0x08a3('0x64')][_0x1da0f3]),'MailQueueId':Number(_0x5b7b5a[_0x08a3('0x46')]['id'])});}return _0x426250;});}})[_0x08a3('0x27')](respondWithResult(_0x561ae7,null))[_0x08a3('0x45')](handleError(_0x561ae7,null));};exports['removeAgents']=function(_0x4b82ff,_0x142dd5,_0x96e918){return db['MailQueue'][_0x08a3('0x49')]({'where':{'id':_0x4b82ff[_0x08a3('0x46')]['id']}})[_0x08a3('0x27')](handleEntityNotFound(_0x142dd5,null))['then'](function(_0x335384){if(_0x335384){return _0x335384[_0x08a3('0x82')](_0x4b82ff['query']['ids'])[_0x08a3('0x27')](function(){if(_[_0x08a3('0x88')](_0x4b82ff['query'][_0x08a3('0x64')])){for(var _0x14ce82=0x0;_0x14ce82<_0x4b82ff[_0x08a3('0x34')][_0x08a3('0x64')][_0x08a3('0x3a')];_0x14ce82+=0x1){socket[_0x08a3('0x83')](_0x08a3('0x84'),{'UserId':Number(_0x4b82ff['query']['ids'][_0x14ce82]),'MailQueueId':Number(_0x4b82ff['params']['id'])});}}else{socket[_0x08a3('0x83')](_0x08a3('0x84'),{'UserId':Number(_0x4b82ff[_0x08a3('0x34')][_0x08a3('0x64')]),'MailQueueId':Number(_0x4b82ff[_0x08a3('0x46')]['id'])});}});}})['then'](respondWithStatusCode(_0x142dd5,null))[_0x08a3('0x45')](handleError(_0x142dd5,null));};exports['getAgents']=function(_0x5b3589,_0x1972fb,_0x202f57){var _0x55b58b={};var _0x34a354={};var _0x38814f;var _0x2ad8a2;return db['MailQueue'][_0x08a3('0x55')]({'where':{'id':_0x5b3589[_0x08a3('0x46')]['id']}})[_0x08a3('0x27')](handleEntityNotFound(_0x1972fb,null))[_0x08a3('0x27')](function(_0x44dc96){if(_0x44dc96){_0x38814f=_0x44dc96;_0x34a354[_0x08a3('0x33')]=_['keys'](db[_0x08a3('0x58')]['rawAttributes']);_0x34a354['query']=_[_0x08a3('0x35')](_0x5b3589[_0x08a3('0x34')]);_0x34a354[_0x08a3('0x36')]=_[_0x08a3('0x37')](_0x34a354[_0x08a3('0x33')],_0x34a354[_0x08a3('0x34')]);_0x55b58b[_0x08a3('0x38')]=_[_0x08a3('0x37')](_0x34a354[_0x08a3('0x33')],qs[_0x08a3('0x39')](_0x5b3589[_0x08a3('0x34')][_0x08a3('0x39')]));_0x55b58b[_0x08a3('0x38')]=_0x55b58b['attributes'][_0x08a3('0x3a')]?_0x55b58b['attributes']:_0x34a354[_0x08a3('0x33')];_0x55b58b[_0x08a3('0x3d')]=qs[_0x08a3('0x3e')](_0x5b3589[_0x08a3('0x34')][_0x08a3('0x3e')]);_0x55b58b[_0x08a3('0x3f')]=qs['filters'](_[_0x08a3('0x40')](_0x5b3589[_0x08a3('0x34')],_0x34a354['filters']));if(_0x5b3589[_0x08a3('0x34')][_0x08a3('0x41')]){_0x55b58b[_0x08a3('0x3f')]=_['merge'](_0x55b58b[_0x08a3('0x3f')],{'$or':_[_0x08a3('0x2e')](_0x55b58b[_0x08a3('0x38')],function(_0x4caca9){var _0x3ecf82={};_0x3ecf82[_0x4caca9]={'$like':'%'+_0x5b3589[_0x08a3('0x34')][_0x08a3('0x41')]+'%'};return _0x3ecf82;})});}_0x55b58b=_[_0x08a3('0x42')]({},_0x55b58b,_0x5b3589[_0x08a3('0x48')]);return _0x38814f['getAgents'](_0x55b58b);}})[_0x08a3('0x27')](function(_0x3996fa){if(_0x3996fa){_0x2ad8a2=_0x3996fa[_0x08a3('0x3a')];if(!_0x5b3589[_0x08a3('0x34')][_0x08a3('0x3b')](_0x08a3('0x3c'))){_0x55b58b['limit']=qs[_0x08a3('0x1f')](_0x5b3589[_0x08a3('0x34')][_0x08a3('0x1f')]);_0x55b58b[_0x08a3('0x1e')]=qs[_0x08a3('0x1e')](_0x5b3589[_0x08a3('0x34')][_0x08a3('0x1e')]);}return _0x38814f[_0x08a3('0x89')](_0x55b58b);}})['then'](function(_0x41bb95){if(_0x41bb95){return _0x41bb95?{'count':_0x2ad8a2,'rows':_0x41bb95}:null;}})[_0x08a3('0x27')](respondWithResult(_0x1972fb,null))[_0x08a3('0x45')](handleError(_0x1972fb,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 345a549..2dcd5c8 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 _0x1e31=['hasOwnProperty','hook','exports','../../mysqldb','MailQueue','setMaxListeners','save','update','emit'];(function(_0x3e7e96,_0x5683ca){var _0x13f6f0=function(_0x320767){while(--_0x320767){_0x3e7e96['push'](_0x3e7e96['shift']());}};_0x13f6f0(++_0x5683ca);}(_0x1e31,0xd2));var _0x11e3=function(_0x4b1d31,_0x3bcf71){_0x4b1d31=_0x4b1d31-0x0;var _0x4b33ea=_0x1e31[_0x4b1d31];return _0x4b33ea;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x11e3('0x0'))['db'][_0x11e3('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x11e3('0x2')](0x0);var events={'afterCreate':_0x11e3('0x3'),'afterUpdate':_0x11e3('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3a8f9d){return function(_0x1ff7b8,_0x42167a,_0x37b065){MailQueueEvents[_0x11e3('0x5')](_0x3a8f9d+':'+_0x1ff7b8['id'],_0x1ff7b8);MailQueueEvents[_0x11e3('0x5')](_0x3a8f9d,_0x1ff7b8);_0x37b065(null);};}for(var e in events){if(events[_0x11e3('0x6')](e)){var event=events[e];MailQueue[_0x11e3('0x7')](e,emitEvent(event));}}module[_0x11e3('0x8')]=MailQueueEvents; \ No newline at end of file +var _0x8037=['events','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0xa8883,_0x1f107f){var _0x479426=function(_0x4e56b9){while(--_0x4e56b9){_0xa8883['push'](_0xa8883['shift']());}};_0x479426(++_0x1f107f);}(_0x8037,0x1d4));var _0x7803=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x8037[_0x42cae2];return _0x5f256f;};'use strict';var EventEmitter=require(_0x7803('0x0'));var MailQueue=require(_0x7803('0x1'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x7803('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7803('0x3'),'afterDestroy':_0x7803('0x4')};function emitEvent(_0x3b8e91){return function(_0x3368ed,_0x4a6df9,_0x2d53e6){MailQueueEvents[_0x7803('0x5')](_0x3b8e91+':'+_0x3368ed['id'],_0x3368ed);MailQueueEvents[_0x7803('0x5')](_0x3b8e91,_0x3368ed);_0x2d53e6(null);};}for(var e in events){if(events[_0x7803('0x6')](e)){var event=events[e];MailQueue[_0x7803('0x7')](e,emitEvent(event));}}module[_0x7803('0x8')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 13c306c..fdb497d 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 _0xd614=['util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./mailQueue.attributes','exports','define','mail_queues','lodash'];(function(_0x15bd7b,_0x467199){var _0x1a9989=function(_0xc4bf29){while(--_0xc4bf29){_0x15bd7b['push'](_0x15bd7b['shift']());}};_0x1a9989(++_0x467199);}(_0xd614,0xd7));var _0x4d61=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xd614[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0x4d61('0x0'));var util=require(_0x4d61('0x1'));var logger=require(_0x4d61('0x2'))(_0x4d61('0x3'));var moment=require(_0x4d61('0x4'));var BPromise=require(_0x4d61('0x5'));var rp=require(_0x4d61('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4d61('0x7'));var attributes=require(_0x4d61('0x8'));module[_0x4d61('0x9')]=function(_0x522777,_0x33f28e){return _0x522777[_0x4d61('0xa')]('MailQueue',attributes,{'tableName':_0x4d61('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2f57=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueue.attributes','exports','define','MailQueue','lodash'];(function(_0x1897d5,_0x3e298c){var _0x43f232=function(_0x3675f8){while(--_0x3675f8){_0x1897d5['push'](_0x1897d5['shift']());}};_0x43f232(++_0x3e298c);}(_0x2f57,0x1ed));var _0x72f5=function(_0x415dd8,_0x364c13){_0x415dd8=_0x415dd8-0x0;var _0x256f6a=_0x2f57[_0x415dd8];return _0x256f6a;};'use strict';var _=require(_0x72f5('0x0'));var util=require('util');var logger=require(_0x72f5('0x1'))(_0x72f5('0x2'));var moment=require(_0x72f5('0x3'));var BPromise=require(_0x72f5('0x4'));var rp=require(_0x72f5('0x5'));var fs=require('fs');var path=require(_0x72f5('0x6'));var rimraf=require(_0x72f5('0x7'));var config=require(_0x72f5('0x8'));var attributes=require(_0x72f5('0x9'));module[_0x72f5('0xa')]=function(_0x32b344,_0x2aa79a){return _0x32b344[_0x72f5('0xb')](_0x72f5('0xc'),attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index 930b474..0fe301a 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 _0xc474=['MailQueue','findAll','options','where','attributes','limit','include','model','map','debug','find','ShowMailQueue','lodash','util','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','request\x20sent','stringify','error','MailQueue,\x20%s,\x20%s','message','result','catch','GetMailQueue'];(function(_0x50a1f6,_0x238fd8){var _0x84f8d4=function(_0x2d9586){while(--_0x2d9586){_0x50a1f6['push'](_0x50a1f6['shift']());}};_0x84f8d4(++_0x238fd8);}(_0xc474,0x174));var _0x4c47=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0xc474[_0x2aec52];return _0x3b8835;};'use strict';var _=require(_0x4c47('0x0'));var util=require(_0x4c47('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4c47('0x2'));var fs=require('fs');var Redis=require(_0x4c47('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4c47('0x4'))(_0x4c47('0x5'));var config=require('../../config/environment');var jayson=require(_0x4c47('0x6'));var client=jayson[_0x4c47('0x7')][_0x4c47('0x8')]({'port':0x232a});config[_0x4c47('0x9')]=_[_0x4c47('0xa')](config[_0x4c47('0x9')],{'host':_0x4c47('0xb'),'port':0x18eb});var socket=require(_0x4c47('0xc'))(new Redis(config['redis']));require('./mailQueue.socket')[_0x4c47('0xd')](socket);function respondWithRpcPromise(_0x5ec90f,_0x5ab709,_0x97e60){return new BPromise(function(_0x40583b,_0x44cbb6){return client['request'](_0x5ec90f,_0x97e60)[_0x4c47('0xe')](function(_0x1a2973){logger[_0x4c47('0xf')]('MailQueue,\x20%s,\x20%s',_0x5ab709,'request\x20sent');logger['debug']('MailQueue,\x20%s,\x20%s,\x20%s',_0x5ab709,_0x4c47('0x10'),JSON[_0x4c47('0x11')](_0x1a2973));if(_0x1a2973[_0x4c47('0x12')]){if(_0x1a2973[_0x4c47('0x12')]['code']===0x1f4){logger[_0x4c47('0x12')](_0x4c47('0x13'),_0x5ab709,_0x1a2973[_0x4c47('0x12')][_0x4c47('0x14')]);return _0x44cbb6(_0x1a2973[_0x4c47('0x12')][_0x4c47('0x14')]);}logger['error'](_0x4c47('0x13'),_0x5ab709,_0x1a2973[_0x4c47('0x12')][_0x4c47('0x14')]);return _0x40583b(_0x1a2973['error'][_0x4c47('0x14')]);}else{logger['info'](_0x4c47('0x13'),_0x5ab709,_0x4c47('0x10'));_0x40583b(_0x1a2973[_0x4c47('0x15')]['message']);}})[_0x4c47('0x16')](function(_0x24e4f4){logger['error'](_0x4c47('0x13'),_0x5ab709,_0x24e4f4);_0x44cbb6(_0x24e4f4);});});}exports[_0x4c47('0x17')]=function(_0x40d70b){var _0x41bfff=this;return new Promise(function(_0x1713ce,_0x342453){return db[_0x4c47('0x18')][_0x4c47('0x19')]({'raw':_0x40d70b[_0x4c47('0x1a')]?_0x40d70b['options']['raw']===undefined?!![]:![]:!![],'where':_0x40d70b['options']?_0x40d70b[_0x4c47('0x1a')][_0x4c47('0x1b')]||null:null,'attributes':_0x40d70b[_0x4c47('0x1a')]?_0x40d70b[_0x4c47('0x1a')][_0x4c47('0x1c')]||null:null,'limit':_0x40d70b[_0x4c47('0x1a')]?_0x40d70b[_0x4c47('0x1a')][_0x4c47('0x1d')]||null:null,'include':_0x40d70b[_0x4c47('0x1a')]?_0x40d70b['options']['include']?_['map'](_0x40d70b[_0x4c47('0x1a')][_0x4c47('0x1e')],function(_0x1cf25a){return{'model':db[_0x1cf25a[_0x4c47('0x1f')]],'as':_0x1cf25a['as'],'attributes':_0x1cf25a[_0x4c47('0x1c')],'include':_0x1cf25a['include']?_[_0x4c47('0x20')](_0x1cf25a['include'],function(_0x58ae1a){return{'model':db[_0x58ae1a[_0x4c47('0x1f')]],'as':_0x58ae1a['as'],'attributes':_0x58ae1a[_0x4c47('0x1c')],'include':_0x58ae1a['include']?_['map'](_0x58ae1a[_0x4c47('0x1e')],function(_0x18f71a){return{'model':db[_0x18f71a[_0x4c47('0x1f')]],'as':_0x18f71a['as'],'attributes':_0x18f71a[_0x4c47('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x4c47('0xe')](function(_0x1904f8){logger[_0x4c47('0xf')](_0x4c47('0x17'),_0x40d70b);logger[_0x4c47('0x21')]('GetMailQueue',_0x40d70b,JSON[_0x4c47('0x11')](_0x1904f8));_0x1713ce(_0x1904f8);})[_0x4c47('0x16')](function(_0x99033e){logger[_0x4c47('0x12')]('GetMailQueue',_0x99033e[_0x4c47('0x14')],_0x40d70b);_0x342453(_0x41bfff['error'](0x1f4,_0x99033e['message']));});});};exports['ShowMailQueue']=function(_0x2655f5){var _0x6db13d=this;return new Promise(function(_0x11b096,_0x367e0d){return db['MailQueue'][_0x4c47('0x22')]({'raw':_0x2655f5[_0x4c47('0x1a')]?_0x2655f5[_0x4c47('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x2655f5[_0x4c47('0x1a')]?_0x2655f5[_0x4c47('0x1a')][_0x4c47('0x1b')]||null:null,'attributes':_0x2655f5[_0x4c47('0x1a')]?_0x2655f5[_0x4c47('0x1a')][_0x4c47('0x1c')]||null:null,'include':_0x2655f5[_0x4c47('0x1a')]?_0x2655f5[_0x4c47('0x1a')][_0x4c47('0x1e')]?_[_0x4c47('0x20')](_0x2655f5[_0x4c47('0x1a')][_0x4c47('0x1e')],function(_0x19775e){return{'model':db[_0x19775e[_0x4c47('0x1f')]],'as':_0x19775e['as'],'attributes':_0x19775e[_0x4c47('0x1c')],'include':_0x19775e['include']?_[_0x4c47('0x20')](_0x19775e[_0x4c47('0x1e')],function(_0x57229e){return{'model':db[_0x57229e[_0x4c47('0x1f')]],'as':_0x57229e['as'],'attributes':_0x57229e[_0x4c47('0x1c')],'include':_0x57229e['include']?_[_0x4c47('0x20')](_0x57229e['include'],function(_0x2a4b7f){return{'model':db[_0x2a4b7f[_0x4c47('0x1f')]],'as':_0x2a4b7f['as'],'attributes':_0x2a4b7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x4c47('0xe')](function(_0x5c9a23){logger[_0x4c47('0xf')](_0x4c47('0x23'),_0x2655f5);logger[_0x4c47('0x21')](_0x4c47('0x23'),_0x2655f5,JSON[_0x4c47('0x11')](_0x5c9a23));_0x11b096(_0x5c9a23);})[_0x4c47('0x16')](function(_0x20aae7){logger[_0x4c47('0x12')]('ShowMailQueue',_0x20aae7[_0x4c47('0x14')],_0x2655f5);_0x367e0d(_0x6db13d[_0x4c47('0x12')](0x1f4,_0x20aae7[_0x4c47('0x14')]));});});}; \ No newline at end of file +var _0xc125=['register','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetMailQueue','findAll','options','attributes','limit','include','map','model','debug','stringify','ShowMailQueue','MailQueue','find','where','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./mailQueue.socket'];(function(_0x454609,_0x1eb409){var _0x376d95=function(_0x18a5d0){while(--_0x18a5d0){_0x454609['push'](_0x454609['shift']());}};_0x376d95(++_0x1eb409);}(_0xc125,0x150));var _0x5c12=function(_0x54107a,_0x24ea28){_0x54107a=_0x54107a-0x0;var _0x2d03d7=_0xc125[_0x54107a];return _0x2d03d7;};'use strict';var _=require('lodash');var util=require(_0x5c12('0x0'));var moment=require('moment');var BPromise=require(_0x5c12('0x1'));var rs=require(_0x5c12('0x2'));var fs=require('fs');var Redis=require(_0x5c12('0x3'));var db=require(_0x5c12('0x4'))['db'];var utils=require(_0x5c12('0x5'));var logger=require(_0x5c12('0x6'))(_0x5c12('0x7'));var config=require(_0x5c12('0x8'));var jayson=require(_0x5c12('0x9'));var client=jayson[_0x5c12('0xa')][_0x5c12('0xb')]({'port':0x232a});config[_0x5c12('0xc')]=_['defaults'](config[_0x5c12('0xc')],{'host':_0x5c12('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5c12('0xc')]));require(_0x5c12('0xe'))[_0x5c12('0xf')](socket);function respondWithRpcPromise(_0x33f493,_0x1de9d4,_0xcd6635){return new BPromise(function(_0x9f206,_0x9e0245){return client['request'](_0x33f493,_0xcd6635)[_0x5c12('0x10')](function(_0x348029){logger[_0x5c12('0x11')](_0x5c12('0x12'),_0x1de9d4,_0x5c12('0x13'));logger['debug']('MailQueue,\x20%s,\x20%s,\x20%s',_0x1de9d4,_0x5c12('0x13'),JSON['stringify'](_0x348029));if(_0x348029[_0x5c12('0x14')]){if(_0x348029[_0x5c12('0x14')][_0x5c12('0x15')]===0x1f4){logger['error']('MailQueue,\x20%s,\x20%s',_0x1de9d4,_0x348029[_0x5c12('0x14')][_0x5c12('0x16')]);return _0x9e0245(_0x348029['error'][_0x5c12('0x16')]);}logger[_0x5c12('0x14')](_0x5c12('0x12'),_0x1de9d4,_0x348029['error']['message']);return _0x9f206(_0x348029[_0x5c12('0x14')][_0x5c12('0x16')]);}else{logger[_0x5c12('0x11')](_0x5c12('0x12'),_0x1de9d4,_0x5c12('0x13'));_0x9f206(_0x348029[_0x5c12('0x17')][_0x5c12('0x16')]);}})[_0x5c12('0x18')](function(_0x495e08){logger['error'](_0x5c12('0x12'),_0x1de9d4,_0x495e08);_0x9e0245(_0x495e08);});});}exports[_0x5c12('0x19')]=function(_0x38ebe4){var _0x39ce5b=this;return new Promise(function(_0x48252a,_0x3ea1b5){return db['MailQueue'][_0x5c12('0x1a')]({'raw':_0x38ebe4[_0x5c12('0x1b')]?_0x38ebe4['options']['raw']===undefined?!![]:![]:!![],'where':_0x38ebe4[_0x5c12('0x1b')]?_0x38ebe4[_0x5c12('0x1b')]['where']||null:null,'attributes':_0x38ebe4[_0x5c12('0x1b')]?_0x38ebe4['options'][_0x5c12('0x1c')]||null:null,'limit':_0x38ebe4[_0x5c12('0x1b')]?_0x38ebe4[_0x5c12('0x1b')][_0x5c12('0x1d')]||null:null,'include':_0x38ebe4[_0x5c12('0x1b')]?_0x38ebe4[_0x5c12('0x1b')][_0x5c12('0x1e')]?_[_0x5c12('0x1f')](_0x38ebe4[_0x5c12('0x1b')][_0x5c12('0x1e')],function(_0x23e787){return{'model':db[_0x23e787[_0x5c12('0x20')]],'as':_0x23e787['as'],'attributes':_0x23e787[_0x5c12('0x1c')],'include':_0x23e787['include']?_[_0x5c12('0x1f')](_0x23e787[_0x5c12('0x1e')],function(_0x21c7b8){return{'model':db[_0x21c7b8[_0x5c12('0x20')]],'as':_0x21c7b8['as'],'attributes':_0x21c7b8[_0x5c12('0x1c')],'include':_0x21c7b8[_0x5c12('0x1e')]?_['map'](_0x21c7b8[_0x5c12('0x1e')],function(_0x3e9bf5){return{'model':db[_0x3e9bf5[_0x5c12('0x20')]],'as':_0x3e9bf5['as'],'attributes':_0x3e9bf5['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x130be5){logger[_0x5c12('0x11')]('GetMailQueue',_0x38ebe4);logger[_0x5c12('0x21')](_0x5c12('0x19'),_0x38ebe4,JSON[_0x5c12('0x22')](_0x130be5));_0x48252a(_0x130be5);})['catch'](function(_0x41bc6a){logger['error'](_0x5c12('0x19'),_0x41bc6a[_0x5c12('0x16')],_0x38ebe4);_0x3ea1b5(_0x39ce5b[_0x5c12('0x14')](0x1f4,_0x41bc6a[_0x5c12('0x16')]));});});};exports[_0x5c12('0x23')]=function(_0x38f1c3){var _0x2a9fb3=this;return new Promise(function(_0x4c0a96,_0x5c45c2){return db[_0x5c12('0x24')][_0x5c12('0x25')]({'raw':_0x38f1c3[_0x5c12('0x1b')]?_0x38f1c3[_0x5c12('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x38f1c3['options']?_0x38f1c3[_0x5c12('0x1b')][_0x5c12('0x26')]||null:null,'attributes':_0x38f1c3['options']?_0x38f1c3['options']['attributes']||null:null,'include':_0x38f1c3[_0x5c12('0x1b')]?_0x38f1c3[_0x5c12('0x1b')][_0x5c12('0x1e')]?_[_0x5c12('0x1f')](_0x38f1c3[_0x5c12('0x1b')]['include'],function(_0x2ab7bf){return{'model':db[_0x2ab7bf[_0x5c12('0x20')]],'as':_0x2ab7bf['as'],'attributes':_0x2ab7bf['attributes'],'include':_0x2ab7bf[_0x5c12('0x1e')]?_[_0x5c12('0x1f')](_0x2ab7bf[_0x5c12('0x1e')],function(_0x46ba61){return{'model':db[_0x46ba61[_0x5c12('0x20')]],'as':_0x46ba61['as'],'attributes':_0x46ba61['attributes'],'include':_0x46ba61[_0x5c12('0x1e')]?_[_0x5c12('0x1f')](_0x46ba61['include'],function(_0x3600ed){return{'model':db[_0x3600ed[_0x5c12('0x20')]],'as':_0x3600ed['as'],'attributes':_0x3600ed[_0x5c12('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3b70ae){logger[_0x5c12('0x11')](_0x5c12('0x23'),_0x38f1c3);logger['debug'](_0x5c12('0x23'),_0x38f1c3,JSON['stringify'](_0x3b70ae));_0x4c0a96(_0x3b70ae);})['catch'](function(_0x50add3){logger[_0x5c12('0x14')](_0x5c12('0x23'),_0x50add3[_0x5c12('0x16')],_0x38f1c3);_0x5c45c2(_0x2a9fb3[_0x5c12('0x14')](0x1f4,_0x50add3[_0x5c12('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 565cf4d..ceab32b 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 _0xfcc8=['remove','update','removeListener','length','mailQueue:','./mailQueue.events','save'];(function(_0x275168,_0xe33f88){var _0x4a6013=function(_0x1babcd){while(--_0x1babcd){_0x275168['push'](_0x275168['shift']());}};_0x4a6013(++_0xe33f88);}(_0xfcc8,0xb4));var _0x8fcc=function(_0x19b5f1,_0x28c33b){_0x19b5f1=_0x19b5f1-0x0;var _0x31a5dc=_0xfcc8[_0x19b5f1];return _0x31a5dc;};'use strict';var MailQueueEvents=require(_0x8fcc('0x0'));var events=[_0x8fcc('0x1'),_0x8fcc('0x2'),_0x8fcc('0x3')];function createListener(_0x5e3eb2,_0x39681c){return function(_0x5bed54){_0x39681c['emit'](_0x5e3eb2,_0x5bed54);};}function removeListener(_0x464bda,_0x5915c5){return function(){MailQueueEvents[_0x8fcc('0x4')](_0x464bda,_0x5915c5);};}exports['register']=function(_0x423ef8){for(var _0x22dec9=0x0,_0xd44c17=events[_0x8fcc('0x5')];_0x22dec9<_0xd44c17;_0x22dec9++){var _0x310cad=events[_0x22dec9];var _0x1c8b19=createListener(_0x8fcc('0x6')+_0x310cad,_0x423ef8);MailQueueEvents['on'](_0x310cad,_0x1c8b19);}}; \ No newline at end of file +var _0x1161=['length','emit','register'];(function(_0x589aee,_0x140a03){var _0x2f5ed4=function(_0x3d224f){while(--_0x3d224f){_0x589aee['push'](_0x589aee['shift']());}};_0x2f5ed4(++_0x140a03);}(_0x1161,0xf7));var _0x1116=function(_0x3e9030,_0x1176b3){_0x3e9030=_0x3e9030-0x0;var _0x108578=_0x1161[_0x3e9030];return _0x108578;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=['save','remove','update'];function createListener(_0x544d68,_0x153aae){return function(_0x13c53a){_0x153aae[_0x1116('0x0')](_0x544d68,_0x13c53a);};}function removeListener(_0x4ec916,_0x3bfb3c){return function(){MailQueueEvents['removeListener'](_0x4ec916,_0x3bfb3c);};}exports[_0x1116('0x1')]=function(_0x521a75){for(var _0x5c72c8=0x0,_0x1cdaa9=events[_0x1116('0x2')];_0x5c72c8<_0x1cdaa9;_0x5c72c8++){var _0x5dfdec=events[_0x5c72c8];var _0x1e10fe=createListener('mailQueue:'+_0x5dfdec,_0x521a75);MailQueueEvents['on'](_0x5dfdec,_0x1e10fe);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 061d38f..2de9dda 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 _0xc570=['../../config/environment','./mailQueueReport.controller','index','get','/describe','isAuthenticated','/:id','show','create','update','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service'];(function(_0x81f727,_0x281765){var _0x1aff90=function(_0x1a8c2d){while(--_0x1a8c2d){_0x81f727['push'](_0x81f727['shift']());}};_0x1aff90(++_0x281765);}(_0xc570,0x12c));var _0x0c57=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xc570[_0x5783f4];return _0x28e380;};'use strict';var multer=require(_0x0c57('0x0'));var util=require('util');var path=require(_0x0c57('0x1'));var timeout=require(_0x0c57('0x2'));var express=require(_0x0c57('0x3'));var router=express['Router']();var fs_extra=require(_0x0c57('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0c57('0x5'));var config=require(_0x0c57('0x6'));var controller=require(_0x0c57('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x0c57('0x8')]);router[_0x0c57('0x9')](_0x0c57('0xa'),auth[_0x0c57('0xb')](),controller['describe']);router['get'](_0x0c57('0xc'),auth['isAuthenticated'](),controller[_0x0c57('0xd')]);router['post']('/',auth[_0x0c57('0xb')](),controller[_0x0c57('0xe')]);router['put'](_0x0c57('0xc'),auth[_0x0c57('0xb')](),controller[_0x0c57('0xf')]);router[_0x0c57('0x10')](_0x0c57('0xc'),auth['isAuthenticated'](),controller[_0x0c57('0x11')]);module['exports']=router; \ No newline at end of file +var _0x83d9=['show','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','index','/describe','isAuthenticated','/:id'];(function(_0x49f8c2,_0x5166b7){var _0x3e63ec=function(_0x575c26){while(--_0x575c26){_0x49f8c2['push'](_0x49f8c2['shift']());}};_0x3e63ec(++_0x5166b7);}(_0x83d9,0x194));var _0x983d=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0x83d9[_0x38a7ac];return _0x53061a;};'use strict';var multer=require(_0x983d('0x0'));var util=require(_0x983d('0x1'));var path=require(_0x983d('0x2'));var timeout=require(_0x983d('0x3'));var express=require(_0x983d('0x4'));var router=express[_0x983d('0x5')]();var fs_extra=require(_0x983d('0x6'));var auth=require(_0x983d('0x7'));var interaction=require(_0x983d('0x8'));var config=require(_0x983d('0x9'));var controller=require(_0x983d('0xa'));router[_0x983d('0xb')]('/',auth['isAuthenticated'](),controller[_0x983d('0xc')]);router[_0x983d('0xb')](_0x983d('0xd'),auth[_0x983d('0xe')](),controller['describe']);router['get'](_0x983d('0xf'),auth['isAuthenticated'](),controller[_0x983d('0x10')]);router['post']('/',auth[_0x983d('0xe')](),controller['create']);router['put'](_0x983d('0xf'),auth[_0x983d('0xe')](),controller[_0x983d('0x11')]);router['delete']('/:id',auth[_0x983d('0xe')](),controller[_0x983d('0x12')]);module[_0x983d('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 5cbdfac..9451467 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 _0x2cbd=['moment','sequelize','exports','STRING','DATE'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x2cbd,0x1ea));var _0xd2cb=function(_0x4953da,_0x5adaca){_0x4953da=_0x4953da-0x0;var _0x2d3780=_0x2cbd[_0x4953da];return _0x2d3780;};'use strict';var moment=require(_0xd2cb('0x0'));var Sequelize=require(_0xd2cb('0x1'));module[_0xd2cb('0x2')]={'uniqueid':{'type':Sequelize[_0xd2cb('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xd2cb('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xd2cb('0x4')]},'reason':{'type':Sequelize[_0xd2cb('0x3')]}}; \ No newline at end of file +var _0x9982=['sequelize','exports','STRING','DATE'];(function(_0x17270c,_0x3e56e6){var _0x555b6c=function(_0x3b5849){while(--_0x3b5849){_0x17270c['push'](_0x17270c['shift']());}};_0x555b6c(++_0x3e56e6);}(_0x9982,0x1c8));var _0x2998=function(_0x580b66,_0x2d8abc){_0x580b66=_0x580b66-0x0;var _0x430ae6=_0x9982[_0x580b66];return _0x430ae6;};'use strict';var moment=require('moment');var Sequelize=require(_0x2998('0x0'));module[_0x2998('0x1')]={'uniqueid':{'type':Sequelize[_0x2998('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x2998('0x2')]},'joinAt':{'type':Sequelize[_0x2998('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x2998('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 5dce24d..b47ad31 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 _0xa46e=['body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','undefined','limit','offset','set','Content-Range','reject','update','then','destroy','stack','name','send','index','map','MailQueueReport','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create'];(function(_0x18492c,_0x358be0){var _0x2f18b3=function(_0x358d94){while(--_0x358d94){_0x18492c['push'](_0x18492c['shift']());}};_0x2f18b3(++_0x358be0);}(_0xa46e,0x8a));var _0xea46=function(_0x4f0c2b,_0x2c9d14){_0x4f0c2b=_0x4f0c2b-0x0;var _0x526436=_0xa46e[_0x4f0c2b];return _0x526436;};'use strict';var emlformat=require(_0xea46('0x0'));var rimraf=require(_0xea46('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xea46('0x2'));var rp=require(_0xea46('0x3'));var moment=require(_0xea46('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xea46('0x5'));var util=require('util');var path=require(_0xea46('0x6'));var sox=require('sox');var csv=require(_0xea46('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xea46('0x8'));var _=require(_0xea46('0x9'));var squel=require('squel');var crypto=require(_0xea46('0xa'));var jsforce=require(_0xea46('0xb'));var deskjs=require(_0xea46('0xc'));var toCsv=require(_0xea46('0x7'));var querystring=require(_0xea46('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xea46('0xe'));var as=require(_0xea46('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xea46('0x10'))(_0xea46('0x11'));var utils=require(_0xea46('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xea46('0x13'));var db=require(_0xea46('0x14'))['db'];function respondWithStatusCode(_0x4e10f3,_0x13390c){_0x13390c=_0x13390c||0xcc;return function(_0x1a4fe2){if(_0x1a4fe2){return _0x4e10f3['sendStatus'](_0x13390c);}return _0x4e10f3[_0xea46('0x15')](_0x13390c)['end']();};}function respondWithResult(_0x3024af,_0x42c328){_0x42c328=_0x42c328||0xc8;return function(_0x6c4bc4){if(_0x6c4bc4){return _0x3024af[_0xea46('0x15')](_0x42c328)[_0xea46('0x16')](_0x6c4bc4);}};}function respondWithFilteredResult(_0x2ef436,_0x81ee45){return function(_0x20a79c){if(_0x20a79c){var _0x176ad2=typeof _0x81ee45['offset']===_0xea46('0x17')&&typeof _0x81ee45[_0xea46('0x18')]===_0xea46('0x17');var _0x59f28e=_0x20a79c['count'];var _0x19d5c1=_0x176ad2?0x0:_0x81ee45[_0xea46('0x19')];var _0x5cf5dd=_0x176ad2?_0x20a79c['count']:_0x81ee45[_0xea46('0x19')]+_0x81ee45[_0xea46('0x18')];var _0x4ff93d;if(_0x5cf5dd>=_0x59f28e){_0x5cf5dd=_0x59f28e;_0x4ff93d=0xc8;}else{_0x4ff93d=0xce;}_0x2ef436[_0xea46('0x15')](_0x4ff93d);return _0x2ef436[_0xea46('0x1a')](_0xea46('0x1b'),_0x19d5c1+'-'+_0x5cf5dd+'/'+_0x59f28e)[_0xea46('0x16')](_0x20a79c);}return null;};}function patchUpdates(_0x53b8db){return function(_0x2b6491){try{jsonpatch['apply'](_0x2b6491,_0x53b8db,!![]);}catch(_0x515e32){return BPromise[_0xea46('0x1c')](_0x515e32);}return _0x2b6491['save']();};}function saveUpdates(_0x4cc673,_0x5064d8){return function(_0x3b25fe){if(_0x3b25fe){return _0x3b25fe[_0xea46('0x1d')](_0x4cc673)[_0xea46('0x1e')](function(_0x5beb44){return _0x5beb44;});}return null;};}function removeEntity(_0x16f8fa,_0x59b10d){return function(_0x12e688){if(_0x12e688){return _0x12e688[_0xea46('0x1f')]()['then'](function(){_0x16f8fa[_0xea46('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b3a8f,_0x114bf9){return function(_0xd4cf78){if(!_0xd4cf78){_0x2b3a8f['sendStatus'](0x194);}return _0xd4cf78;};}function handleError(_0x5d2de1,_0x44e797){_0x44e797=_0x44e797||0x1f4;return function(_0x38ac07){logger['error'](_0x38ac07[_0xea46('0x20')]);if(_0x38ac07['name']){delete _0x38ac07[_0xea46('0x21')];}_0x5d2de1['status'](_0x44e797)[_0xea46('0x22')](_0x38ac07);};}exports[_0xea46('0x23')]=function(_0x6710ae,_0x44517d){var _0x146995={},_0x174345={},_0x4a5149={'count':0x0,'rows':[]};var _0x382bbc=_[_0xea46('0x24')](db[_0xea46('0x25')]['rawAttributes'],function(_0x3e7856){return{'name':_0x3e7856[_0xea46('0x26')],'type':_0x3e7856[_0xea46('0x27')]['key']};});_0x174345['model']=_['map'](_0x382bbc,_0xea46('0x21'));_0x174345[_0xea46('0x28')]=_[_0xea46('0x29')](_0x6710ae[_0xea46('0x28')]);_0x174345[_0xea46('0x2a')]=_[_0xea46('0x2b')](_0x174345[_0xea46('0x2c')],_0x174345[_0xea46('0x28')]);_0x146995[_0xea46('0x2d')]=_[_0xea46('0x2b')](_0x174345[_0xea46('0x2c')],qs['fields'](_0x6710ae[_0xea46('0x28')][_0xea46('0x2e')]));_0x146995[_0xea46('0x2d')]=_0x146995[_0xea46('0x2d')][_0xea46('0x2f')]?_0x146995[_0xea46('0x2d')]:_0x174345[_0xea46('0x2c')];if(!_0x6710ae['query'][_0xea46('0x30')](_0xea46('0x31'))){_0x146995[_0xea46('0x18')]=qs[_0xea46('0x18')](_0x6710ae[_0xea46('0x28')]['limit']);_0x146995['offset']=qs[_0xea46('0x19')](_0x6710ae[_0xea46('0x28')]['offset']);}_0x146995[_0xea46('0x32')]=qs[_0xea46('0x33')](_0x6710ae[_0xea46('0x28')][_0xea46('0x33')]);_0x146995['where']=qs['filters'](_[_0xea46('0x34')](_0x6710ae['query'],_0x174345[_0xea46('0x2a')]),_0x382bbc);if(_0x6710ae[_0xea46('0x28')]['filter']){_0x146995[_0xea46('0x35')]=_[_0xea46('0x36')](_0x146995['where'],{'$or':_[_0xea46('0x24')](_0x382bbc,function(_0xefad3e){if(_0xefad3e['type']!==_0xea46('0x37')){var _0x41e9e8={};_0x41e9e8[_0xefad3e[_0xea46('0x21')]]={'$like':'%'+_0x6710ae[_0xea46('0x28')]['filter']+'%'};return _0x41e9e8;}})});}_0x146995=_[_0xea46('0x36')]({},_0x146995,_0x6710ae[_0xea46('0x38')]);var _0x338c2d={'where':_0x146995[_0xea46('0x35')]};return db[_0xea46('0x25')]['count'](_0x338c2d)[_0xea46('0x1e')](function(_0xdb2e11){_0x4a5149['count']=_0xdb2e11;if(_0x6710ae[_0xea46('0x28')][_0xea46('0x39')]){_0x146995[_0xea46('0x3a')]=[{'all':!![]}];}return db[_0xea46('0x25')]['findAll'](_0x146995);})[_0xea46('0x1e')](function(_0x1cc8f8){_0x4a5149[_0xea46('0x3b')]=_0x1cc8f8;return _0x4a5149;})['then'](respondWithFilteredResult(_0x44517d,_0x146995))[_0xea46('0x3c')](handleError(_0x44517d,null));};exports[_0xea46('0x3d')]=function(_0x2c9491,_0x32c81c){var _0x3164c5={'raw':!![],'where':{'id':_0x2c9491[_0xea46('0x3e')]['id']}},_0xc45d74={};_0xc45d74[_0xea46('0x2c')]=_[_0xea46('0x29')](db[_0xea46('0x25')][_0xea46('0x3f')]);_0xc45d74[_0xea46('0x28')]=_[_0xea46('0x29')](_0x2c9491[_0xea46('0x28')]);_0xc45d74[_0xea46('0x2a')]=_['intersection'](_0xc45d74['model'],_0xc45d74[_0xea46('0x28')]);_0x3164c5[_0xea46('0x2d')]=_[_0xea46('0x2b')](_0xc45d74[_0xea46('0x2c')],qs['fields'](_0x2c9491['query']['fields']));_0x3164c5[_0xea46('0x2d')]=_0x3164c5[_0xea46('0x2d')]['length']?_0x3164c5[_0xea46('0x2d')]:_0xc45d74[_0xea46('0x2c')];if(_0x2c9491[_0xea46('0x28')][_0xea46('0x39')]){_0x3164c5[_0xea46('0x3a')]=[{'all':!![]}];}_0x3164c5=_['merge']({},_0x3164c5,_0x2c9491[_0xea46('0x38')]);return db['MailQueueReport'][_0xea46('0x40')](_0x3164c5)[_0xea46('0x1e')](handleEntityNotFound(_0x32c81c,null))[_0xea46('0x1e')](respondWithResult(_0x32c81c,null))[_0xea46('0x3c')](handleError(_0x32c81c,null));};exports[_0xea46('0x41')]=function(_0x1260d1,_0x36f697){return db['MailQueueReport'][_0xea46('0x41')](_0x1260d1[_0xea46('0x42')],{})['then'](respondWithResult(_0x36f697,0xc9))[_0xea46('0x3c')](handleError(_0x36f697,null));};exports[_0xea46('0x1d')]=function(_0x24d929,_0x548572){if(_0x24d929['body']['id']){delete _0x24d929[_0xea46('0x42')]['id'];}return db[_0xea46('0x25')][_0xea46('0x40')]({'where':{'id':_0x24d929[_0xea46('0x3e')]['id']}})[_0xea46('0x1e')](handleEntityNotFound(_0x548572,null))[_0xea46('0x1e')](saveUpdates(_0x24d929[_0xea46('0x42')],null))[_0xea46('0x1e')](respondWithResult(_0x548572,null))[_0xea46('0x3c')](handleError(_0x548572,null));};exports[_0xea46('0x1f')]=function(_0x48ad1c,_0x2144a0){return db['MailQueueReport'][_0xea46('0x40')]({'where':{'id':_0x48ad1c[_0xea46('0x3e')]['id']}})[_0xea46('0x1e')](handleEntityNotFound(_0x2144a0,null))['then'](removeEntity(_0x2144a0,null))[_0xea46('0x3c')](handleError(_0x2144a0,null));};exports[_0xea46('0x43')]=function(_0x334937,_0x2f49c8){return db['MailQueueReport']['describe']()[_0xea46('0x1e')](respondWithResult(_0x2f49c8,null))[_0xea46('0x3c')](handleError(_0x2f49c8,null));}; \ No newline at end of file +var _0xbff5=['squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','map','MailQueueReport','rawAttributes','fieldName','key','name','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','catch','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash'];(function(_0x5e9850,_0x291edf){var _0x2d3d96=function(_0x28f972){while(--_0x28f972){_0x5e9850['push'](_0x5e9850['shift']());}};_0x2d3d96(++_0x291edf);}(_0xbff5,0x1bc));var _0x5bff=function(_0xbb0a0f,_0x3d456a){_0xbb0a0f=_0xbb0a0f-0x0;var _0xb6d333=_0xbff5[_0xbb0a0f];return _0xb6d333;};'use strict';var emlformat=require(_0x5bff('0x0'));var rimraf=require(_0x5bff('0x1'));var zipdir=require(_0x5bff('0x2'));var jsonpatch=require(_0x5bff('0x3'));var rp=require(_0x5bff('0x4'));var moment=require(_0x5bff('0x5'));var BPromise=require(_0x5bff('0x6'));var Mustache=require('mustache');var util=require(_0x5bff('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x5bff('0x8'));var ejs=require(_0x5bff('0x9'));var fs=require('fs');var fs_extra=require(_0x5bff('0xa'));var _=require(_0x5bff('0xb'));var squel=require(_0x5bff('0xc'));var crypto=require(_0x5bff('0xd'));var jsforce=require(_0x5bff('0xe'));var deskjs=require(_0x5bff('0xf'));var toCsv=require(_0x5bff('0x8'));var querystring=require('querystring');var Papa=require(_0x5bff('0x10'));var Redis=require('ioredis');var authService=require(_0x5bff('0x11'));var qs=require(_0x5bff('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5bff('0x13'));var logger=require('../../config/logger')(_0x5bff('0x14'));var utils=require('../../config/utils');var config=require(_0x5bff('0x15'));var licenseUtil=require(_0x5bff('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x132dc9,_0x50e1e9){_0x50e1e9=_0x50e1e9||0xcc;return function(_0x335e78){if(_0x335e78){return _0x132dc9[_0x5bff('0x17')](_0x50e1e9);}return _0x132dc9['status'](_0x50e1e9)[_0x5bff('0x18')]();};}function respondWithResult(_0xa16a3f,_0x5b0d2d){_0x5b0d2d=_0x5b0d2d||0xc8;return function(_0x5f2a55){if(_0x5f2a55){return _0xa16a3f[_0x5bff('0x19')](_0x5b0d2d)[_0x5bff('0x1a')](_0x5f2a55);}};}function respondWithFilteredResult(_0x3a507c,_0x4d883e){return function(_0x2d22ab){if(_0x2d22ab){var _0x4612ec=typeof _0x4d883e[_0x5bff('0x1b')]==='undefined'&&typeof _0x4d883e[_0x5bff('0x1c')]===_0x5bff('0x1d');var _0x38daa0=_0x2d22ab['count'];var _0xc9fbc3=_0x4612ec?0x0:_0x4d883e[_0x5bff('0x1b')];var _0x36653b=_0x4612ec?_0x2d22ab[_0x5bff('0x1e')]:_0x4d883e['offset']+_0x4d883e[_0x5bff('0x1c')];var _0x5357d4;if(_0x36653b>=_0x38daa0){_0x36653b=_0x38daa0;_0x5357d4=0xc8;}else{_0x5357d4=0xce;}_0x3a507c[_0x5bff('0x19')](_0x5357d4);return _0x3a507c['set'](_0x5bff('0x1f'),_0xc9fbc3+'-'+_0x36653b+'/'+_0x38daa0)[_0x5bff('0x1a')](_0x2d22ab);}return null;};}function patchUpdates(_0x2a83ce){return function(_0x6cbfa){try{jsonpatch[_0x5bff('0x20')](_0x6cbfa,_0x2a83ce,!![]);}catch(_0x2012e4){return BPromise[_0x5bff('0x21')](_0x2012e4);}return _0x6cbfa[_0x5bff('0x22')]();};}function saveUpdates(_0x155e16,_0x490bc1){return function(_0x5f2593){if(_0x5f2593){return _0x5f2593[_0x5bff('0x23')](_0x155e16)[_0x5bff('0x24')](function(_0x1e7f8a){return _0x1e7f8a;});}return null;};}function removeEntity(_0x352b1f,_0x31d26b){return function(_0x3913fd){if(_0x3913fd){return _0x3913fd[_0x5bff('0x25')]()['then'](function(){_0x352b1f['status'](0xcc)[_0x5bff('0x18')]();});}};}function handleEntityNotFound(_0x53bd97,_0x220c8f){return function(_0xcc091d){if(!_0xcc091d){_0x53bd97[_0x5bff('0x17')](0x194);}return _0xcc091d;};}function handleError(_0x6f18f1,_0xfa361d){_0xfa361d=_0xfa361d||0x1f4;return function(_0x1140eb){logger[_0x5bff('0x26')](_0x1140eb[_0x5bff('0x27')]);if(_0x1140eb['name']){delete _0x1140eb['name'];}_0x6f18f1[_0x5bff('0x19')](_0xfa361d)[_0x5bff('0x28')](_0x1140eb);};}exports['index']=function(_0x36a7d2,_0x588078){var _0x5470cb={},_0x3eda3a={},_0x5cf207={'count':0x0,'rows':[]};var _0x3ed23b=_[_0x5bff('0x29')](db[_0x5bff('0x2a')][_0x5bff('0x2b')],function(_0x48aee1){return{'name':_0x48aee1[_0x5bff('0x2c')],'type':_0x48aee1['type'][_0x5bff('0x2d')]};});_0x3eda3a['model']=_[_0x5bff('0x29')](_0x3ed23b,_0x5bff('0x2e'));_0x3eda3a[_0x5bff('0x2f')]=_[_0x5bff('0x30')](_0x36a7d2[_0x5bff('0x2f')]);_0x3eda3a[_0x5bff('0x31')]=_['intersection'](_0x3eda3a[_0x5bff('0x32')],_0x3eda3a[_0x5bff('0x2f')]);_0x5470cb[_0x5bff('0x33')]=_[_0x5bff('0x34')](_0x3eda3a[_0x5bff('0x32')],qs[_0x5bff('0x35')](_0x36a7d2[_0x5bff('0x2f')][_0x5bff('0x35')]));_0x5470cb['attributes']=_0x5470cb[_0x5bff('0x33')][_0x5bff('0x36')]?_0x5470cb[_0x5bff('0x33')]:_0x3eda3a[_0x5bff('0x32')];if(!_0x36a7d2['query'][_0x5bff('0x37')](_0x5bff('0x38'))){_0x5470cb['limit']=qs[_0x5bff('0x1c')](_0x36a7d2[_0x5bff('0x2f')][_0x5bff('0x1c')]);_0x5470cb[_0x5bff('0x1b')]=qs['offset'](_0x36a7d2[_0x5bff('0x2f')][_0x5bff('0x1b')]);}_0x5470cb[_0x5bff('0x39')]=qs['sort'](_0x36a7d2[_0x5bff('0x2f')]['sort']);_0x5470cb[_0x5bff('0x3a')]=qs[_0x5bff('0x31')](_[_0x5bff('0x3b')](_0x36a7d2['query'],_0x3eda3a[_0x5bff('0x31')]),_0x3ed23b);if(_0x36a7d2[_0x5bff('0x2f')][_0x5bff('0x3c')]){_0x5470cb['where']=_[_0x5bff('0x3d')](_0x5470cb[_0x5bff('0x3a')],{'$or':_['map'](_0x3ed23b,function(_0x265cdb){if(_0x265cdb[_0x5bff('0x3e')]!==_0x5bff('0x3f')){var _0x77a071={};_0x77a071[_0x265cdb[_0x5bff('0x2e')]]={'$like':'%'+_0x36a7d2['query'][_0x5bff('0x3c')]+'%'};return _0x77a071;}})});}_0x5470cb=_['merge']({},_0x5470cb,_0x36a7d2[_0x5bff('0x40')]);var _0x2fecb9={'where':_0x5470cb[_0x5bff('0x3a')]};return db[_0x5bff('0x2a')][_0x5bff('0x1e')](_0x2fecb9)[_0x5bff('0x24')](function(_0x1d0346){_0x5cf207['count']=_0x1d0346;if(_0x36a7d2['query'][_0x5bff('0x41')]){_0x5470cb[_0x5bff('0x42')]=[{'all':!![]}];}return db[_0x5bff('0x2a')][_0x5bff('0x43')](_0x5470cb);})[_0x5bff('0x24')](function(_0xb7b82a){_0x5cf207[_0x5bff('0x44')]=_0xb7b82a;return _0x5cf207;})[_0x5bff('0x24')](respondWithFilteredResult(_0x588078,_0x5470cb))['catch'](handleError(_0x588078,null));};exports[_0x5bff('0x45')]=function(_0x49676f,_0x3dc13f){var _0x1b8c7f={'raw':!![],'where':{'id':_0x49676f[_0x5bff('0x46')]['id']}},_0x543517={};_0x543517[_0x5bff('0x32')]=_['keys'](db[_0x5bff('0x2a')][_0x5bff('0x2b')]);_0x543517[_0x5bff('0x2f')]=_['keys'](_0x49676f[_0x5bff('0x2f')]);_0x543517[_0x5bff('0x31')]=_[_0x5bff('0x34')](_0x543517['model'],_0x543517[_0x5bff('0x2f')]);_0x1b8c7f[_0x5bff('0x33')]=_[_0x5bff('0x34')](_0x543517[_0x5bff('0x32')],qs['fields'](_0x49676f[_0x5bff('0x2f')]['fields']));_0x1b8c7f['attributes']=_0x1b8c7f[_0x5bff('0x33')][_0x5bff('0x36')]?_0x1b8c7f['attributes']:_0x543517[_0x5bff('0x32')];if(_0x49676f[_0x5bff('0x2f')]['includeAll']){_0x1b8c7f[_0x5bff('0x42')]=[{'all':!![]}];}_0x1b8c7f=_[_0x5bff('0x3d')]({},_0x1b8c7f,_0x49676f[_0x5bff('0x40')]);return db[_0x5bff('0x2a')]['find'](_0x1b8c7f)[_0x5bff('0x24')](handleEntityNotFound(_0x3dc13f,null))[_0x5bff('0x24')](respondWithResult(_0x3dc13f,null))[_0x5bff('0x47')](handleError(_0x3dc13f,null));};exports[_0x5bff('0x48')]=function(_0x1e94c5,_0x2588b8){return db['MailQueueReport'][_0x5bff('0x48')](_0x1e94c5[_0x5bff('0x49')],{})['then'](respondWithResult(_0x2588b8,0xc9))[_0x5bff('0x47')](handleError(_0x2588b8,null));};exports['update']=function(_0x47fc14,_0x4ff13a){if(_0x47fc14[_0x5bff('0x49')]['id']){delete _0x47fc14[_0x5bff('0x49')]['id'];}return db['MailQueueReport'][_0x5bff('0x4a')]({'where':{'id':_0x47fc14[_0x5bff('0x46')]['id']}})[_0x5bff('0x24')](handleEntityNotFound(_0x4ff13a,null))[_0x5bff('0x24')](saveUpdates(_0x47fc14[_0x5bff('0x49')],null))['then'](respondWithResult(_0x4ff13a,null))[_0x5bff('0x47')](handleError(_0x4ff13a,null));};exports[_0x5bff('0x25')]=function(_0x5e99f5,_0x16c61e){return db['MailQueueReport'][_0x5bff('0x4a')]({'where':{'id':_0x5e99f5[_0x5bff('0x46')]['id']}})[_0x5bff('0x24')](handleEntityNotFound(_0x16c61e,null))[_0x5bff('0x24')](removeEntity(_0x16c61e,null))[_0x5bff('0x47')](handleError(_0x16c61e,null));};exports['describe']=function(_0x36089e,_0x18018e){return db['MailQueueReport'][_0x5bff('0x4b')]()[_0x5bff('0x24')](respondWithResult(_0x18018e,null))['catch'](handleError(_0x18018e,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 50ba9fb..212b6ed 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 _0x5f01=['request-promise','path','rimraf','./mailQueueReport.attributes','define','MailQueueReport','uniqueid','api','moment'];(function(_0x3d8638,_0xe27864){var _0xa63e4a=function(_0x210dc0){while(--_0x210dc0){_0x3d8638['push'](_0x3d8638['shift']());}};_0xa63e4a(++_0xe27864);}(_0x5f01,0x1a5));var _0x15f0=function(_0xed3292,_0x464f95){_0xed3292=_0xed3292-0x0;var _0x1d765e=_0x5f01[_0xed3292];return _0x1d765e;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x15f0('0x0'));var moment=require(_0x15f0('0x1'));var BPromise=require('bluebird');var rp=require(_0x15f0('0x2'));var fs=require('fs');var path=require(_0x15f0('0x3'));var rimraf=require(_0x15f0('0x4'));var config=require('../../config/environment');var attributes=require(_0x15f0('0x5'));module['exports']=function(_0x3e82c8,_0x5c23b4){return _0x3e82c8[_0x15f0('0x6')](_0x15f0('0x7'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0x15f0('0x8'),'fields':[_0x15f0('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc19a=['moment','bluebird','request-promise','rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','report_mail_queue','uniqueid','lodash','../../config/logger','api'];(function(_0xe6946,_0x8c96ef){var _0x372213=function(_0x390bbf){while(--_0x390bbf){_0xe6946['push'](_0xe6946['shift']());}};_0x372213(++_0x8c96ef);}(_0xc19a,0x135));var _0xac19=function(_0x51581e,_0x1ccc70){_0x51581e=_0x51581e-0x0;var _0x1d280d=_0xc19a[_0x51581e];return _0x1d280d;};'use strict';var _=require(_0xac19('0x0'));var util=require('util');var logger=require(_0xac19('0x1'))(_0xac19('0x2'));var moment=require(_0xac19('0x3'));var BPromise=require(_0xac19('0x4'));var rp=require(_0xac19('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xac19('0x6'));var config=require(_0xac19('0x7'));var attributes=require(_0xac19('0x8'));module[_0xac19('0x9')]=function(_0x5cc246,_0x384e31){return _0x5cc246[_0xac19('0xa')]('MailQueueReport',attributes,{'tableName':_0xac19('0xb'),'paranoid':![],'indexes':[{'name':_0xac19('0xc'),'fields':[_0xac19('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 84134dd..ddac874 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 _0xc4aa=['create','body','options','raw','update','where','attributes','limit','UpdateMailQueueReport','stringify','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','CreateMailQueueReport','MailQueueReport'];(function(_0x33e141,_0x291c1b){var _0x2a9296=function(_0x14b842){while(--_0x14b842){_0x33e141['push'](_0x33e141['shift']());}};_0x2a9296(++_0x291c1b);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0xc4aa[_0x2d2c16];return _0x53f2fb;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}exports[_0xac4a('0x15')]=function(_0x28e304){var _0x44ec59=this;return new Promise(function(_0x546c5d,_0x5ac21e){return db[_0xac4a('0x16')][_0xac4a('0x17')](_0x28e304[_0xac4a('0x18')],{'raw':_0x28e304['options']?_0x28e304[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![]})[_0xac4a('0xc')](function(_0x3a3cdb){logger[_0xac4a('0x13')](_0xac4a('0x15'),_0x28e304);logger[_0xac4a('0xf')](_0xac4a('0x15'),_0x28e304,JSON['stringify'](_0x3a3cdb));_0x546c5d(_0x3a3cdb);})[_0xac4a('0x14')](function(_0x3204ad){logger['error'](_0xac4a('0x15'),_0x3204ad[_0xac4a('0x12')],_0x28e304);_0x5ac21e(_0x44ec59[_0xac4a('0x10')](0x1f4,_0x3204ad[_0xac4a('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x1b7998){var _0x2503d8=this;return new Promise(function(_0x15435c,_0x412494){return db[_0xac4a('0x16')][_0xac4a('0x1b')](_0x1b7998[_0xac4a('0x18')],{'raw':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1c')]||null:null,'attributes':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1d')]||null:null,'limit':_0x1b7998['options']?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1e')]||null:null})[_0xac4a('0xc')](function(_0x2772fe){logger[_0xac4a('0x13')]('UpdateMailQueueReport',_0x1b7998);logger['debug'](_0xac4a('0x1f'),_0x1b7998,JSON[_0xac4a('0x20')](_0x2772fe));_0x15435c(_0x2772fe);})[_0xac4a('0x14')](function(_0x546b65){logger['error'](_0xac4a('0x1f'),_0x546b65[_0xac4a('0x12')],_0x1b7998);_0x412494(_0x2503d8[_0xac4a('0x10')](0x1f4,_0x546b65[_0xac4a('0x12')]));});});}; \ No newline at end of file +var _0x5f2f=['error','code','message','request\x20sent','result','catch','CreateMailQueueReport','MailQueueReport','create','body','options','raw','UpdateMailQueueReport','update','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','MailQueueReport,\x20%s,\x20%s','debug','stringify'];(function(_0x491025,_0xcfc7df){var _0x4c3f3=function(_0x11969d){while(--_0x11969d){_0x491025['push'](_0x491025['shift']());}};_0x4c3f3(++_0xcfc7df);}(_0x5f2f,0x73));var _0xf5f2=function(_0x48aaa9,_0x353658){_0x48aaa9=_0x48aaa9-0x0;var _0x49a3a2=_0x5f2f[_0x48aaa9];return _0x49a3a2;};'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')]('MailQueueReport,\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);});});}exports[_0xf5f2('0x17')]=function(_0x20fccd){var _0x28e097=this;return new Promise(function(_0x4ff59b,_0x3ee69){return db[_0xf5f2('0x18')][_0xf5f2('0x19')](_0x20fccd[_0xf5f2('0x1a')],{'raw':_0x20fccd['options']?_0x20fccd[_0xf5f2('0x1b')][_0xf5f2('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x47acfc){logger[_0xf5f2('0xd')](_0xf5f2('0x17'),_0x20fccd);logger['debug'](_0xf5f2('0x17'),_0x20fccd,JSON[_0xf5f2('0x10')](_0x47acfc));_0x4ff59b(_0x47acfc);})[_0xf5f2('0x16')](function(_0x39c024){logger[_0xf5f2('0x11')]('CreateMailQueueReport',_0x39c024[_0xf5f2('0x13')],_0x20fccd);_0x3ee69(_0x28e097[_0xf5f2('0x11')](0x1f4,_0x39c024[_0xf5f2('0x13')]));});});};exports[_0xf5f2('0x1d')]=function(_0x287ad5){var _0x5bdf4a=this;return new Promise(function(_0x529f07,_0x5f1124){return db[_0xf5f2('0x18')][_0xf5f2('0x1e')](_0x287ad5[_0xf5f2('0x1a')],{'raw':_0x287ad5[_0xf5f2('0x1b')]?_0x287ad5[_0xf5f2('0x1b')][_0xf5f2('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x287ad5[_0xf5f2('0x1b')]?_0x287ad5[_0xf5f2('0x1b')]['where']||null:null,'attributes':_0x287ad5[_0xf5f2('0x1b')]?_0x287ad5[_0xf5f2('0x1b')][_0xf5f2('0x1f')]||null:null,'limit':_0x287ad5[_0xf5f2('0x1b')]?_0x287ad5[_0xf5f2('0x1b')][_0xf5f2('0x20')]||null:null})['then'](function(_0x53cb96){logger[_0xf5f2('0xd')](_0xf5f2('0x1d'),_0x287ad5);logger[_0xf5f2('0xf')]('UpdateMailQueueReport',_0x287ad5,JSON['stringify'](_0x53cb96));_0x529f07(_0x53cb96);})[_0xf5f2('0x16')](function(_0x50b8a2){logger[_0xf5f2('0x11')](_0xf5f2('0x1d'),_0x50b8a2[_0xf5f2('0x13')],_0x287ad5);_0x5f1124(_0x5bdf4a['error'](0x1f4,_0x50b8a2['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 5e0d099..014f432 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x2bdecd,_0x21805f){var _0x56116e=function(_0x297d20){while(--_0x297d20){_0x2bdecd['push'](_0x2bdecd['shift']());}};_0x56116e(++_0x21805f);}(_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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x4bbabf,_0x3e3454){var _0x159343=function(_0x1a1ea2){while(--_0x1a1ea2){_0x4bbabf['push'](_0x4bbabf['shift']());}};_0x159343(++_0x3e3454);}(_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/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 6504efe..b525c93 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 _0x1281=['INTEGER','INBOX','sequelize','exports','STRING','BOOLEAN'];(function(_0x15ec4e,_0x40b7e0){var _0xb5e5dd=function(_0x42bdd7){while(--_0x42bdd7){_0x15ec4e['push'](_0x15ec4e['shift']());}};_0xb5e5dd(++_0x40b7e0);}(_0x1281,0x1f4));var _0x1128=function(_0x123b88,_0x209ac8){_0x123b88=_0x123b88-0x0;var _0x23dfd2=_0x1281[_0x123b88];return _0x23dfd2;};'use strict';var Sequelize=require(_0x1128('0x0'));module[_0x1128('0x1')]={'description':{'type':Sequelize[_0x1128('0x2')]},'host':{'type':Sequelize[_0x1128('0x2')]},'authentication':{'type':Sequelize[_0x1128('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x1128('0x2')]},'password':{'type':Sequelize[_0x1128('0x2')]},'port':{'type':Sequelize[_0x1128('0x4')]},'tls':{'type':Sequelize[_0x1128('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0x1128('0x5')},'connTimeout':{'type':Sequelize[_0x1128('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0x1128('0x2')]},'modernAuthentication':{'type':Sequelize[_0x1128('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xd420=['BOOLEAN','INTEGER','INBOX','sequelize','exports','STRING'];(function(_0x462b80,_0x313693){var _0x345f54=function(_0x28e6b4){while(--_0x28e6b4){_0x462b80['push'](_0x462b80['shift']());}};_0x345f54(++_0x313693);}(_0xd420,0xed));var _0x0d42=function(_0x3dacfc,_0x18e0b2){_0x3dacfc=_0x3dacfc-0x0;var _0xfe2eb7=_0xd420[_0x3dacfc];return _0xfe2eb7;};'use strict';var Sequelize=require(_0x0d42('0x0'));module[_0x0d42('0x1')]={'description':{'type':Sequelize[_0x0d42('0x2')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x0d42('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x0d42('0x2')]},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x0d42('0x4')]},'tls':{'type':Sequelize[_0x0d42('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x0d42('0x2')],'defaultValue':_0x0d42('0x5')},'connTimeout':{'type':Sequelize[_0x0d42('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x0d42('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0x0d42('0x2')]},'modernAuthentication':{'type':Sequelize[_0x0d42('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index e39364a..776c750 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 _0x34dd=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','lodash','util'];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0x34dd,0x1c0));var _0xd34d=function(_0x4dcf71,_0x4155fb){_0x4dcf71=_0x4dcf71-0x0;var _0x589fdb=_0x34dd[_0x4dcf71];return _0x589fdb;};'use strict';var _=require(_0xd34d('0x0'));var util=require(_0xd34d('0x1'));var logger=require(_0xd34d('0x2'))(_0xd34d('0x3'));var moment=require(_0xd34d('0x4'));var BPromise=require(_0xd34d('0x5'));var rp=require(_0xd34d('0x6'));var fs=require('fs');var path=require(_0xd34d('0x7'));var rimraf=require(_0xd34d('0x8'));var config=require(_0xd34d('0x9'));var attributes=require(_0xd34d('0xa'));module[_0xd34d('0xb')]=function(_0x1aff5b,_0x3c2e77){return _0x1aff5b[_0xd34d('0xc')](_0xd34d('0xd'),attributes,{'tableName':_0xd34d('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3f52=['exports','define','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0x3f52,0x80));var _0x23f5=function(_0x5ca5bc,_0x5b8a9d){_0x5ca5bc=_0x5ca5bc-0x0;var _0x26ca86=_0x3f52[_0x5ca5bc];return _0x26ca86;};'use strict';var _=require('lodash');var util=require(_0x23f5('0x0'));var logger=require(_0x23f5('0x1'))(_0x23f5('0x2'));var moment=require('moment');var BPromise=require(_0x23f5('0x3'));var rp=require(_0x23f5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x23f5('0x5'));var config=require(_0x23f5('0x6'));var attributes=require('./mailServerIn.attributes');module[_0x23f5('0x7')]=function(_0x446299,_0x252e31){return _0x446299[_0x23f5('0x8')]('MailServerIn',attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index f239e6e..cfe27b9 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 _0x4092=['http','request','then','request\x20sent','debug','stringify','error','code','message','MailServerIn,\x20%s,\x20%s','info','result','catch','GetMailServerIn','MailServerIn','options','raw','where','limit','include','map','attributes','model','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x4092,0x1af));var _0x2409=function(_0x3b2be3,_0x3e602d){_0x3b2be3=_0x3b2be3-0x0;var _0x511b35=_0x4092[_0x3b2be3];return _0x511b35;};'use strict';var _=require('lodash');var util=require(_0x2409('0x0'));var moment=require(_0x2409('0x1'));var BPromise=require(_0x2409('0x2'));var rs=require(_0x2409('0x3'));var fs=require('fs');var Redis=require(_0x2409('0x4'));var db=require(_0x2409('0x5'))['db'];var utils=require(_0x2409('0x6'));var logger=require(_0x2409('0x7'))(_0x2409('0x8'));var config=require('../../config/environment');var jayson=require(_0x2409('0x9'));var client=jayson[_0x2409('0xa')][_0x2409('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x483922,_0x35743c,_0x433df1){return new BPromise(function(_0xc0665c,_0x207784){return client[_0x2409('0xc')](_0x483922,_0x433df1)[_0x2409('0xd')](function(_0x326c5f){logger['info']('MailServerIn,\x20%s,\x20%s',_0x35743c,_0x2409('0xe'));logger[_0x2409('0xf')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x35743c,'request\x20sent',JSON[_0x2409('0x10')](_0x326c5f));if(_0x326c5f['error']){if(_0x326c5f[_0x2409('0x11')][_0x2409('0x12')]===0x1f4){logger[_0x2409('0x11')]('MailServerIn,\x20%s,\x20%s',_0x35743c,_0x326c5f['error'][_0x2409('0x13')]);return _0x207784(_0x326c5f[_0x2409('0x11')]['message']);}logger['error'](_0x2409('0x14'),_0x35743c,_0x326c5f[_0x2409('0x11')]['message']);return _0xc0665c(_0x326c5f['error']['message']);}else{logger[_0x2409('0x15')](_0x2409('0x14'),_0x35743c,_0x2409('0xe'));_0xc0665c(_0x326c5f[_0x2409('0x16')][_0x2409('0x13')]);}})[_0x2409('0x17')](function(_0x542b8f){logger['error']('MailServerIn,\x20%s,\x20%s',_0x35743c,_0x542b8f);_0x207784(_0x542b8f);});});}exports[_0x2409('0x18')]=function(_0x38bffc){var _0x3feaec=this;return new Promise(function(_0x30955b,_0x1e7763){return db[_0x2409('0x19')]['findAll']({'raw':_0x38bffc['options']?_0x38bffc[_0x2409('0x1a')][_0x2409('0x1b')]===undefined?!![]:![]:!![],'where':_0x38bffc['options']?_0x38bffc['options'][_0x2409('0x1c')]||null:null,'attributes':_0x38bffc[_0x2409('0x1a')]?_0x38bffc['options']['attributes']||null:null,'limit':_0x38bffc[_0x2409('0x1a')]?_0x38bffc[_0x2409('0x1a')][_0x2409('0x1d')]||null:null,'include':_0x38bffc[_0x2409('0x1a')]?_0x38bffc[_0x2409('0x1a')][_0x2409('0x1e')]?_[_0x2409('0x1f')](_0x38bffc['options']['include'],function(_0x17809d){return{'model':db[_0x17809d['model']],'as':_0x17809d['as'],'attributes':_0x17809d[_0x2409('0x20')],'include':_0x17809d[_0x2409('0x1e')]?_['map'](_0x17809d[_0x2409('0x1e')],function(_0x2be26d){return{'model':db[_0x2be26d['model']],'as':_0x2be26d['as'],'attributes':_0x2be26d[_0x2409('0x20')],'include':_0x2be26d[_0x2409('0x1e')]?_[_0x2409('0x1f')](_0x2be26d[_0x2409('0x1e')],function(_0x4a0b91){return{'model':db[_0x4a0b91[_0x2409('0x21')]],'as':_0x4a0b91['as'],'attributes':_0x4a0b91[_0x2409('0x20')]};}):[]};}):[]};}):[]:[]})[_0x2409('0xd')](function(_0x592c5d){logger[_0x2409('0x15')](_0x2409('0x18'),_0x38bffc);logger['debug'](_0x2409('0x18'),_0x38bffc,JSON[_0x2409('0x10')](_0x592c5d));_0x30955b(_0x592c5d);})[_0x2409('0x17')](function(_0x59bce9){logger[_0x2409('0x11')](_0x2409('0x18'),_0x59bce9['message'],_0x38bffc);_0x1e7763(_0x3feaec[_0x2409('0x11')](0x1f4,_0x59bce9[_0x2409('0x13')]));});});}; \ No newline at end of file +var _0xc698=['request\x20sent','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetMailServerIn','MailServerIn','findAll','options','where','attributes','limit','include','map','model','debug','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','jayson/promise','request','then','info','MailServerIn,\x20%s,\x20%s'];(function(_0x32a002,_0x4886d3){var _0x4741fc=function(_0x509bba){while(--_0x509bba){_0x32a002['push'](_0x32a002['shift']());}};_0x4741fc(++_0x4886d3);}(_0xc698,0x85));var _0x8c69=function(_0x27530d,_0x46480a){_0x27530d=_0x27530d-0x0;var _0x59e561=_0xc698[_0x27530d];return _0x59e561;};'use strict';var _=require(_0x8c69('0x0'));var util=require(_0x8c69('0x1'));var moment=require(_0x8c69('0x2'));var BPromise=require(_0x8c69('0x3'));var rs=require(_0x8c69('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8c69('0x5'));var logger=require('../../config/logger')(_0x8c69('0x6'));var config=require('../../config/environment');var jayson=require(_0x8c69('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x350620,_0x216981,_0x434e14){return new BPromise(function(_0x20a688,_0x34a8e8){return client[_0x8c69('0x8')](_0x350620,_0x434e14)[_0x8c69('0x9')](function(_0x260354){logger[_0x8c69('0xa')](_0x8c69('0xb'),_0x216981,_0x8c69('0xc'));logger['debug'](_0x8c69('0xd'),_0x216981,_0x8c69('0xc'),JSON[_0x8c69('0xe')](_0x260354));if(_0x260354['error']){if(_0x260354[_0x8c69('0xf')]['code']===0x1f4){logger[_0x8c69('0xf')]('MailServerIn,\x20%s,\x20%s',_0x216981,_0x260354[_0x8c69('0xf')]['message']);return _0x34a8e8(_0x260354[_0x8c69('0xf')]['message']);}logger[_0x8c69('0xf')](_0x8c69('0xb'),_0x216981,_0x260354['error'][_0x8c69('0x10')]);return _0x20a688(_0x260354['error'][_0x8c69('0x10')]);}else{logger[_0x8c69('0xa')](_0x8c69('0xb'),_0x216981,_0x8c69('0xc'));_0x20a688(_0x260354['result'][_0x8c69('0x10')]);}})[_0x8c69('0x11')](function(_0x388859){logger['error'](_0x8c69('0xb'),_0x216981,_0x388859);_0x34a8e8(_0x388859);});});}exports[_0x8c69('0x12')]=function(_0xfc7224){var _0x1193a2=this;return new Promise(function(_0x5a816c,_0x34d533){return db[_0x8c69('0x13')][_0x8c69('0x14')]({'raw':_0xfc7224[_0x8c69('0x15')]?_0xfc7224[_0x8c69('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0xfc7224[_0x8c69('0x15')]?_0xfc7224['options'][_0x8c69('0x16')]||null:null,'attributes':_0xfc7224[_0x8c69('0x15')]?_0xfc7224[_0x8c69('0x15')][_0x8c69('0x17')]||null:null,'limit':_0xfc7224[_0x8c69('0x15')]?_0xfc7224['options'][_0x8c69('0x18')]||null:null,'include':_0xfc7224[_0x8c69('0x15')]?_0xfc7224[_0x8c69('0x15')][_0x8c69('0x19')]?_[_0x8c69('0x1a')](_0xfc7224[_0x8c69('0x15')]['include'],function(_0x3fdadd){return{'model':db[_0x3fdadd[_0x8c69('0x1b')]],'as':_0x3fdadd['as'],'attributes':_0x3fdadd['attributes'],'include':_0x3fdadd[_0x8c69('0x19')]?_[_0x8c69('0x1a')](_0x3fdadd[_0x8c69('0x19')],function(_0x5373b7){return{'model':db[_0x5373b7['model']],'as':_0x5373b7['as'],'attributes':_0x5373b7[_0x8c69('0x17')],'include':_0x5373b7['include']?_['map'](_0x5373b7['include'],function(_0x37ba0e){return{'model':db[_0x37ba0e[_0x8c69('0x1b')]],'as':_0x37ba0e['as'],'attributes':_0x37ba0e[_0x8c69('0x17')]};}):[]};}):[]};}):[]:[]})[_0x8c69('0x9')](function(_0x1f0837){logger[_0x8c69('0xa')](_0x8c69('0x12'),_0xfc7224);logger[_0x8c69('0x1c')](_0x8c69('0x12'),_0xfc7224,JSON[_0x8c69('0xe')](_0x1f0837));_0x5a816c(_0x1f0837);})['catch'](function(_0x1155e2){logger[_0x8c69('0xf')](_0x8c69('0x12'),_0x1155e2[_0x8c69('0x10')],_0xfc7224);_0x34d533(_0x1193a2['error'](0x1f4,_0x1155e2[_0x8c69('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index f62fb97..14d5fb8 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(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x7a54,0x106));var _0x47a5=function(_0x1eada9,_0xaf081c){_0x1eada9=_0x1eada9-0x0;var _0xa4dea7=_0x7a54[_0x1eada9];return _0xa4dea7;};'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(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_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 266cd2b..88150eb 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 _0xa74f=['BOOLEAN','STRING','INTEGER'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0xa74f,0x9a));var _0xfa74=function(_0x288f5e,_0x205edd){_0x288f5e=_0x288f5e-0x0;var _0x476cc9=_0xa74f[_0x288f5e];return _0x476cc9;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0xfa74('0x0')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0xfa74('0x0')]},'port':{'type':Sequelize[_0xfa74('0x1')]},'secure':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':![]},'service':{'type':Sequelize[_0xfa74('0x0')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x1eba=['exports','STRING','BOOLEAN','sequelize'];(function(_0x385a53,_0x5e572d){var _0x4eb628=function(_0x32707b){while(--_0x32707b){_0x385a53['push'](_0x385a53['shift']());}};_0x4eb628(++_0x5e572d);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x43b584,_0x20a6bd){_0x43b584=_0x43b584-0x0;var _0x48f27b=_0x1eba[_0x43b584];return _0x48f27b;};'use strict';var Sequelize=require(_0xa1eb('0x0'));module[_0xa1eb('0x1')]={'description':{'type':Sequelize[_0xa1eb('0x2')]},'host':{'type':Sequelize[_0xa1eb('0x2')]},'user':{'type':Sequelize[_0xa1eb('0x2')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize[_0xa1eb('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0xa1eb('0x2')]},'authentication':{'type':Sequelize[_0xa1eb('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0xa1eb('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 fc169aa..ca173b2 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 _0x58eb=['pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','options','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','update','then','error','name','send','index','map','MailServerOut','rawAttributes','type','key','model','keys','query','intersection','attributes','fields','length','nolimit','sort','where','filters'];(function(_0x3f25db,_0x1d3686){var _0x54f29d=function(_0x2963bb){while(--_0x2963bb){_0x3f25db['push'](_0x3f25db['shift']());}};_0x54f29d(++_0x1d3686);}(_0x58eb,0x99));var _0xb58e=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0x58eb[_0x2f1762];return _0x8ab21;};'use strict';var emlformat=require(_0xb58e('0x0'));var rimraf=require(_0xb58e('0x1'));var zipdir=require(_0xb58e('0x2'));var jsonpatch=require(_0xb58e('0x3'));var rp=require('request-promise');var moment=require(_0xb58e('0x4'));var BPromise=require(_0xb58e('0x5'));var Mustache=require(_0xb58e('0x6'));var util=require('util');var path=require(_0xb58e('0x7'));var sox=require(_0xb58e('0x8'));var csv=require(_0xb58e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb58e('0xa'));var crypto=require(_0xb58e('0xb'));var jsforce=require(_0xb58e('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xb58e('0x9'));var querystring=require(_0xb58e('0xd'));var Papa=require('papaparse');var Redis=require(_0xb58e('0xe'));var authService=require(_0xb58e('0xf'));var qs=require(_0xb58e('0x10'));var as=require(_0xb58e('0x11'));var hardwareService=require(_0xb58e('0x12'));var logger=require(_0xb58e('0x13'))('api');var utils=require(_0xb58e('0x14'));var config=require(_0xb58e('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xb58e('0x16'))['db'];function respondWithStatusCode(_0x4d7ee7,_0x3eafdd){_0x3eafdd=_0x3eafdd||0xcc;return function(_0x93dcd9){if(_0x93dcd9){return _0x4d7ee7[_0xb58e('0x17')](_0x3eafdd);}return _0x4d7ee7[_0xb58e('0x18')](_0x3eafdd)[_0xb58e('0x19')]();};}function respondWithResult(_0x4b2a64,_0x5cf3be){_0x5cf3be=_0x5cf3be||0xc8;return function(_0x4b7110){if(_0x4b7110){return _0x4b2a64[_0xb58e('0x18')](_0x5cf3be)[_0xb58e('0x1a')](_0x4b7110);}};}function respondWithFilteredResult(_0x4e8aec,_0x515289){return function(_0x13dd08){if(_0x13dd08){var _0x469e27=typeof _0x515289[_0xb58e('0x1b')]==='undefined'&&typeof _0x515289[_0xb58e('0x1c')]==='undefined';var _0xb32d5b=_0x13dd08['count'];var _0x2fe33f=_0x469e27?0x0:_0x515289[_0xb58e('0x1b')];var _0x4ffed1=_0x469e27?_0x13dd08['count']:_0x515289['offset']+_0x515289[_0xb58e('0x1c')];var _0xe0e478;if(_0x4ffed1>=_0xb32d5b){_0x4ffed1=_0xb32d5b;_0xe0e478=0xc8;}else{_0xe0e478=0xce;}_0x4e8aec[_0xb58e('0x18')](_0xe0e478);return _0x4e8aec[_0xb58e('0x1d')](_0xb58e('0x1e'),_0x2fe33f+'-'+_0x4ffed1+'/'+_0xb32d5b)[_0xb58e('0x1a')](_0x13dd08);}return null;};}function patchUpdates(_0x43a805){return function(_0x2c124a){try{jsonpatch['apply'](_0x2c124a,_0x43a805,!![]);}catch(_0x10501f){return BPromise[_0xb58e('0x1f')](_0x10501f);}return _0x2c124a['save']();};}function saveUpdates(_0x1cc2ae,_0x31b9ef){return function(_0x1d8148){if(_0x1d8148){return _0x1d8148[_0xb58e('0x20')](_0x1cc2ae)[_0xb58e('0x21')](function(_0x4b014f){return _0x4b014f;});}return null;};}function removeEntity(_0x8e0ff4,_0xc7b4ab){return function(_0x21afc9){if(_0x21afc9){return _0x21afc9['destroy']()[_0xb58e('0x21')](function(){_0x8e0ff4[_0xb58e('0x18')](0xcc)[_0xb58e('0x19')]();});}};}function handleEntityNotFound(_0x4ac62d,_0x40a6da){return function(_0x4a2ced){if(!_0x4a2ced){_0x4ac62d[_0xb58e('0x17')](0x194);}return _0x4a2ced;};}function handleError(_0x4af944,_0xfc97f2){_0xfc97f2=_0xfc97f2||0x1f4;return function(_0x445922){logger[_0xb58e('0x22')](_0x445922['stack']);if(_0x445922[_0xb58e('0x23')]){delete _0x445922[_0xb58e('0x23')];}_0x4af944[_0xb58e('0x18')](_0xfc97f2)[_0xb58e('0x24')](_0x445922);};}exports[_0xb58e('0x25')]=function(_0x3f1f68,_0x1468a6){var _0x14c0c4={},_0x5b92d0={},_0x449587={'count':0x0,'rows':[]};var _0x3b3c96=_[_0xb58e('0x26')](db[_0xb58e('0x27')][_0xb58e('0x28')],function(_0x1c466f){return{'name':_0x1c466f['fieldName'],'type':_0x1c466f[_0xb58e('0x29')][_0xb58e('0x2a')]};});_0x5b92d0[_0xb58e('0x2b')]=_[_0xb58e('0x26')](_0x3b3c96,_0xb58e('0x23'));_0x5b92d0['query']=_[_0xb58e('0x2c')](_0x3f1f68[_0xb58e('0x2d')]);_0x5b92d0['filters']=_[_0xb58e('0x2e')](_0x5b92d0['model'],_0x5b92d0[_0xb58e('0x2d')]);_0x14c0c4[_0xb58e('0x2f')]=_['intersection'](_0x5b92d0[_0xb58e('0x2b')],qs[_0xb58e('0x30')](_0x3f1f68[_0xb58e('0x2d')][_0xb58e('0x30')]));_0x14c0c4[_0xb58e('0x2f')]=_0x14c0c4[_0xb58e('0x2f')][_0xb58e('0x31')]?_0x14c0c4[_0xb58e('0x2f')]:_0x5b92d0[_0xb58e('0x2b')];if(!_0x3f1f68['query']['hasOwnProperty'](_0xb58e('0x32'))){_0x14c0c4[_0xb58e('0x1c')]=qs[_0xb58e('0x1c')](_0x3f1f68[_0xb58e('0x2d')][_0xb58e('0x1c')]);_0x14c0c4['offset']=qs[_0xb58e('0x1b')](_0x3f1f68[_0xb58e('0x2d')][_0xb58e('0x1b')]);}_0x14c0c4['order']=qs['sort'](_0x3f1f68['query'][_0xb58e('0x33')]);_0x14c0c4[_0xb58e('0x34')]=qs[_0xb58e('0x35')](_[_0xb58e('0x36')](_0x3f1f68['query'],_0x5b92d0[_0xb58e('0x35')]),_0x3b3c96);if(_0x3f1f68['query'][_0xb58e('0x37')]){_0x14c0c4[_0xb58e('0x34')]=_[_0xb58e('0x38')](_0x14c0c4[_0xb58e('0x34')],{'$or':_['map'](_0x3b3c96,function(_0x42e89a){if(_0x42e89a[_0xb58e('0x29')]!==_0xb58e('0x39')){var _0x59ffaa={};_0x59ffaa[_0x42e89a[_0xb58e('0x23')]]={'$like':'%'+_0x3f1f68[_0xb58e('0x2d')]['filter']+'%'};return _0x59ffaa;}})});}_0x14c0c4=_[_0xb58e('0x38')]({},_0x14c0c4,_0x3f1f68['options']);var _0x4944aa={'where':_0x14c0c4[_0xb58e('0x34')]};return db[_0xb58e('0x27')]['count'](_0x4944aa)[_0xb58e('0x21')](function(_0x254e3c){_0x449587['count']=_0x254e3c;if(_0x3f1f68['query'][_0xb58e('0x3a')]){_0x14c0c4['include']=[{'all':!![]}];}return db[_0xb58e('0x27')][_0xb58e('0x3b')](_0x14c0c4);})[_0xb58e('0x21')](function(_0x440c1c){_0x449587[_0xb58e('0x3c')]=_0x440c1c;return _0x449587;})['then'](respondWithFilteredResult(_0x1468a6,_0x14c0c4))[_0xb58e('0x3d')](handleError(_0x1468a6,null));};exports[_0xb58e('0x3e')]=function(_0xf27286,_0x4eafc3){var _0x515195={'raw':!![],'where':{'id':_0xf27286[_0xb58e('0x3f')]['id']}},_0x2f6724={};_0x2f6724[_0xb58e('0x2b')]=_[_0xb58e('0x2c')](db[_0xb58e('0x27')][_0xb58e('0x28')]);_0x2f6724[_0xb58e('0x2d')]=_[_0xb58e('0x2c')](_0xf27286['query']);_0x2f6724[_0xb58e('0x35')]=_['intersection'](_0x2f6724[_0xb58e('0x2b')],_0x2f6724['query']);_0x515195['attributes']=_[_0xb58e('0x2e')](_0x2f6724[_0xb58e('0x2b')],qs[_0xb58e('0x30')](_0xf27286['query'][_0xb58e('0x30')]));_0x515195[_0xb58e('0x2f')]=_0x515195[_0xb58e('0x2f')][_0xb58e('0x31')]?_0x515195[_0xb58e('0x2f')]:_0x2f6724[_0xb58e('0x2b')];if(_0xf27286[_0xb58e('0x2d')]['includeAll']){_0x515195['include']=[{'all':!![]}];}_0x515195=_[_0xb58e('0x38')]({},_0x515195,_0xf27286[_0xb58e('0x40')]);return db[_0xb58e('0x27')][_0xb58e('0x41')](_0x515195)['then'](handleEntityNotFound(_0x4eafc3,null))['then'](respondWithResult(_0x4eafc3,null))[_0xb58e('0x3d')](handleError(_0x4eafc3,null));};exports[_0xb58e('0x42')]=function(_0x34abc3,_0x52fe1a){return db[_0xb58e('0x27')][_0xb58e('0x42')](_0x34abc3[_0xb58e('0x43')],{})[_0xb58e('0x21')](respondWithResult(_0x52fe1a,0xc9))[_0xb58e('0x3d')](handleError(_0x52fe1a,null));};exports[_0xb58e('0x20')]=function(_0x3613d2,_0x13fe06){if(_0x3613d2[_0xb58e('0x43')]['id']){delete _0x3613d2[_0xb58e('0x43')]['id'];}return db[_0xb58e('0x27')][_0xb58e('0x41')]({'where':{'id':_0x3613d2[_0xb58e('0x3f')]['id']}})['then'](handleEntityNotFound(_0x13fe06,null))[_0xb58e('0x21')](saveUpdates(_0x3613d2['body'],null))[_0xb58e('0x21')](respondWithResult(_0x13fe06,null))[_0xb58e('0x3d')](handleError(_0x13fe06,null));};exports[_0xb58e('0x44')]=function(_0xe864ca,_0x11af3b){return db['MailServerOut'][_0xb58e('0x41')]({'where':{'id':_0xe864ca[_0xb58e('0x3f')]['id']}})[_0xb58e('0x21')](handleEntityNotFound(_0x11af3b,null))[_0xb58e('0x21')](removeEntity(_0x11af3b,null))['catch'](handleError(_0x11af3b,null));}; \ No newline at end of file +var _0xbf56=['count','offset','set','Content-Range','apply','save','then','destroy','error','stack','send','MailServerOut','rawAttributes','fieldName','type','key','model','map','name','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','keys','length','find','create','body','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','undefined','limit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbf56,0x195));var _0x6bf5=function(_0x1a3ba0,_0x2c57bf){_0x1a3ba0=_0x1a3ba0-0x0;var _0x52a5c2=_0xbf56[_0x1a3ba0];return _0x52a5c2;};'use strict';var emlformat=require(_0x6bf5('0x0'));var rimraf=require(_0x6bf5('0x1'));var zipdir=require(_0x6bf5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6bf5('0x3'));var moment=require(_0x6bf5('0x4'));var BPromise=require(_0x6bf5('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6bf5('0x6'));var sox=require(_0x6bf5('0x7'));var csv=require(_0x6bf5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6bf5('0x9'));var squel=require('squel');var crypto=require(_0x6bf5('0xa'));var jsforce=require(_0x6bf5('0xb'));var deskjs=require(_0x6bf5('0xc'));var toCsv=require(_0x6bf5('0x8'));var querystring=require(_0x6bf5('0xd'));var Papa=require(_0x6bf5('0xe'));var Redis=require('ioredis');var authService=require(_0x6bf5('0xf'));var qs=require(_0x6bf5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6bf5('0x11'));var logger=require(_0x6bf5('0x12'))(_0x6bf5('0x13'));var utils=require(_0x6bf5('0x14'));var config=require(_0x6bf5('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x104ca2,_0xa311b4){_0xa311b4=_0xa311b4||0xcc;return function(_0x293b99){if(_0x293b99){return _0x104ca2[_0x6bf5('0x16')](_0xa311b4);}return _0x104ca2[_0x6bf5('0x17')](_0xa311b4)['end']();};}function respondWithResult(_0x233e7f,_0x16272e){_0x16272e=_0x16272e||0xc8;return function(_0x4278a2){if(_0x4278a2){return _0x233e7f[_0x6bf5('0x17')](_0x16272e)[_0x6bf5('0x18')](_0x4278a2);}};}function respondWithFilteredResult(_0x3beab7,_0x37ce50){return function(_0x20211d){if(_0x20211d){var _0x3dc8e3=typeof _0x37ce50['offset']===_0x6bf5('0x19')&&typeof _0x37ce50[_0x6bf5('0x1a')]===_0x6bf5('0x19');var _0x69f383=_0x20211d[_0x6bf5('0x1b')];var _0x49e494=_0x3dc8e3?0x0:_0x37ce50[_0x6bf5('0x1c')];var _0x38d36a=_0x3dc8e3?_0x20211d['count']:_0x37ce50[_0x6bf5('0x1c')]+_0x37ce50[_0x6bf5('0x1a')];var _0x33ff48;if(_0x38d36a>=_0x69f383){_0x38d36a=_0x69f383;_0x33ff48=0xc8;}else{_0x33ff48=0xce;}_0x3beab7[_0x6bf5('0x17')](_0x33ff48);return _0x3beab7[_0x6bf5('0x1d')](_0x6bf5('0x1e'),_0x49e494+'-'+_0x38d36a+'/'+_0x69f383)[_0x6bf5('0x18')](_0x20211d);}return null;};}function patchUpdates(_0x1281fb){return function(_0x3b27e9){try{jsonpatch[_0x6bf5('0x1f')](_0x3b27e9,_0x1281fb,!![]);}catch(_0x267755){return BPromise['reject'](_0x267755);}return _0x3b27e9[_0x6bf5('0x20')]();};}function saveUpdates(_0x2e0e62,_0x29aeac){return function(_0x14aa59){if(_0x14aa59){return _0x14aa59['update'](_0x2e0e62)[_0x6bf5('0x21')](function(_0x5884e9){return _0x5884e9;});}return null;};}function removeEntity(_0x52fda6,_0x1354a3){return function(_0x4b3397){if(_0x4b3397){return _0x4b3397[_0x6bf5('0x22')]()['then'](function(){_0x52fda6[_0x6bf5('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x580f35,_0x2e4227){return function(_0x4840cc){if(!_0x4840cc){_0x580f35[_0x6bf5('0x16')](0x194);}return _0x4840cc;};}function handleError(_0x43aa31,_0x5a0e01){_0x5a0e01=_0x5a0e01||0x1f4;return function(_0xcf43a9){logger[_0x6bf5('0x23')](_0xcf43a9[_0x6bf5('0x24')]);if(_0xcf43a9['name']){delete _0xcf43a9['name'];}_0x43aa31[_0x6bf5('0x17')](_0x5a0e01)[_0x6bf5('0x25')](_0xcf43a9);};}exports['index']=function(_0xab4cf0,_0x420675){var _0x12629c={},_0x1cd40f={},_0x1d8a4a={'count':0x0,'rows':[]};var _0x11bbe5=_['map'](db[_0x6bf5('0x26')][_0x6bf5('0x27')],function(_0xe97780){return{'name':_0xe97780[_0x6bf5('0x28')],'type':_0xe97780[_0x6bf5('0x29')][_0x6bf5('0x2a')]};});_0x1cd40f[_0x6bf5('0x2b')]=_[_0x6bf5('0x2c')](_0x11bbe5,_0x6bf5('0x2d'));_0x1cd40f['query']=_['keys'](_0xab4cf0[_0x6bf5('0x2e')]);_0x1cd40f[_0x6bf5('0x2f')]=_[_0x6bf5('0x30')](_0x1cd40f['model'],_0x1cd40f[_0x6bf5('0x2e')]);_0x12629c[_0x6bf5('0x31')]=_[_0x6bf5('0x30')](_0x1cd40f[_0x6bf5('0x2b')],qs['fields'](_0xab4cf0[_0x6bf5('0x2e')][_0x6bf5('0x32')]));_0x12629c[_0x6bf5('0x31')]=_0x12629c[_0x6bf5('0x31')]['length']?_0x12629c[_0x6bf5('0x31')]:_0x1cd40f[_0x6bf5('0x2b')];if(!_0xab4cf0['query'][_0x6bf5('0x33')](_0x6bf5('0x34'))){_0x12629c[_0x6bf5('0x1a')]=qs[_0x6bf5('0x1a')](_0xab4cf0[_0x6bf5('0x2e')][_0x6bf5('0x1a')]);_0x12629c['offset']=qs[_0x6bf5('0x1c')](_0xab4cf0[_0x6bf5('0x2e')]['offset']);}_0x12629c[_0x6bf5('0x35')]=qs[_0x6bf5('0x36')](_0xab4cf0[_0x6bf5('0x2e')]['sort']);_0x12629c[_0x6bf5('0x37')]=qs[_0x6bf5('0x2f')](_[_0x6bf5('0x38')](_0xab4cf0['query'],_0x1cd40f[_0x6bf5('0x2f')]),_0x11bbe5);if(_0xab4cf0['query'][_0x6bf5('0x39')]){_0x12629c[_0x6bf5('0x37')]=_[_0x6bf5('0x3a')](_0x12629c[_0x6bf5('0x37')],{'$or':_[_0x6bf5('0x2c')](_0x11bbe5,function(_0x568dab){if(_0x568dab[_0x6bf5('0x29')]!==_0x6bf5('0x3b')){var _0x45fabf={};_0x45fabf[_0x568dab[_0x6bf5('0x2d')]]={'$like':'%'+_0xab4cf0[_0x6bf5('0x2e')]['filter']+'%'};return _0x45fabf;}})});}_0x12629c=_[_0x6bf5('0x3a')]({},_0x12629c,_0xab4cf0[_0x6bf5('0x3c')]);var _0x3a69e8={'where':_0x12629c[_0x6bf5('0x37')]};return db['MailServerOut']['count'](_0x3a69e8)[_0x6bf5('0x21')](function(_0x819268){_0x1d8a4a['count']=_0x819268;if(_0xab4cf0[_0x6bf5('0x2e')][_0x6bf5('0x3d')]){_0x12629c[_0x6bf5('0x3e')]=[{'all':!![]}];}return db[_0x6bf5('0x26')]['findAll'](_0x12629c);})['then'](function(_0x5e08bf){_0x1d8a4a['rows']=_0x5e08bf;return _0x1d8a4a;})[_0x6bf5('0x21')](respondWithFilteredResult(_0x420675,_0x12629c))[_0x6bf5('0x3f')](handleError(_0x420675,null));};exports[_0x6bf5('0x40')]=function(_0x4ef1ae,_0x219361){var _0x74955d={'raw':!![],'where':{'id':_0x4ef1ae[_0x6bf5('0x41')]['id']}},_0x5e9454={};_0x5e9454[_0x6bf5('0x2b')]=_['keys'](db['MailServerOut'][_0x6bf5('0x27')]);_0x5e9454[_0x6bf5('0x2e')]=_[_0x6bf5('0x42')](_0x4ef1ae[_0x6bf5('0x2e')]);_0x5e9454[_0x6bf5('0x2f')]=_['intersection'](_0x5e9454['model'],_0x5e9454['query']);_0x74955d[_0x6bf5('0x31')]=_[_0x6bf5('0x30')](_0x5e9454['model'],qs[_0x6bf5('0x32')](_0x4ef1ae[_0x6bf5('0x2e')]['fields']));_0x74955d[_0x6bf5('0x31')]=_0x74955d[_0x6bf5('0x31')][_0x6bf5('0x43')]?_0x74955d['attributes']:_0x5e9454[_0x6bf5('0x2b')];if(_0x4ef1ae[_0x6bf5('0x2e')][_0x6bf5('0x3d')]){_0x74955d[_0x6bf5('0x3e')]=[{'all':!![]}];}_0x74955d=_['merge']({},_0x74955d,_0x4ef1ae['options']);return db['MailServerOut'][_0x6bf5('0x44')](_0x74955d)[_0x6bf5('0x21')](handleEntityNotFound(_0x219361,null))['then'](respondWithResult(_0x219361,null))['catch'](handleError(_0x219361,null));};exports[_0x6bf5('0x45')]=function(_0x1c9a53,_0x1a29dc){return db[_0x6bf5('0x26')][_0x6bf5('0x45')](_0x1c9a53[_0x6bf5('0x46')],{})[_0x6bf5('0x21')](respondWithResult(_0x1a29dc,0xc9))[_0x6bf5('0x3f')](handleError(_0x1a29dc,null));};exports[_0x6bf5('0x47')]=function(_0x252acb,_0x153e03){if(_0x252acb[_0x6bf5('0x46')]['id']){delete _0x252acb[_0x6bf5('0x46')]['id'];}return db[_0x6bf5('0x26')][_0x6bf5('0x44')]({'where':{'id':_0x252acb[_0x6bf5('0x41')]['id']}})['then'](handleEntityNotFound(_0x153e03,null))[_0x6bf5('0x21')](saveUpdates(_0x252acb['body'],null))[_0x6bf5('0x21')](respondWithResult(_0x153e03,null))[_0x6bf5('0x3f')](handleError(_0x153e03,null));};exports[_0x6bf5('0x22')]=function(_0x5cfc88,_0x52c582){return db[_0x6bf5('0x26')][_0x6bf5('0x44')]({'where':{'id':_0x5cfc88['params']['id']}})[_0x6bf5('0x21')](handleEntityNotFound(_0x52c582,null))[_0x6bf5('0x21')](removeEntity(_0x52c582,null))['catch'](handleError(_0x52c582,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 26fbf32..dff9d05 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 _0x363d=['path','rimraf','../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','mail_servers_out','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x124b74,_0x4d5bab){var _0x3cac56=function(_0x40f9ae){while(--_0x40f9ae){_0x124b74['push'](_0x124b74['shift']());}};_0x3cac56(++_0x4d5bab);}(_0x363d,0x14a));var _0xd363=function(_0x1558ab,_0x39d1de){_0x1558ab=_0x1558ab-0x0;var _0x53b64a=_0x363d[_0x1558ab];return _0x53b64a;};'use strict';var _=require(_0xd363('0x0'));var util=require(_0xd363('0x1'));var logger=require(_0xd363('0x2'))(_0xd363('0x3'));var moment=require('moment');var BPromise=require(_0xd363('0x4'));var rp=require(_0xd363('0x5'));var fs=require('fs');var path=require(_0xd363('0x6'));var rimraf=require(_0xd363('0x7'));var config=require(_0xd363('0x8'));var attributes=require(_0xd363('0x9'));module[_0xd363('0xa')]=function(_0x48c0dc,_0x2dc947){return _0x48c0dc[_0xd363('0xb')](_0xd363('0xc'),attributes,{'tableName':_0xd363('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8680=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','exports','define','mail_servers_out'];(function(_0x2dc157,_0x1bdf82){var _0x199141=function(_0x218158){while(--_0x218158){_0x2dc157['push'](_0x2dc157['shift']());}};_0x199141(++_0x1bdf82);}(_0x8680,0x1ad));var _0x0868=function(_0x2508c7,_0x4dc90){_0x2508c7=_0x2508c7-0x0;var _0x3e9eec=_0x8680[_0x2508c7];return _0x3e9eec;};'use strict';var _=require(_0x0868('0x0'));var util=require('util');var logger=require(_0x0868('0x1'))(_0x0868('0x2'));var moment=require(_0x0868('0x3'));var BPromise=require(_0x0868('0x4'));var rp=require(_0x0868('0x5'));var fs=require('fs');var path=require(_0x0868('0x6'));var rimraf=require(_0x0868('0x7'));var config=require(_0x0868('0x8'));var attributes=require(_0x0868('0x9'));module[_0x0868('0xa')]=function(_0x1593c4,_0x1cf430){return _0x1593c4[_0x0868('0xb')]('MailServerOut',attributes,{'tableName':_0x0868('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index d930483..0130244 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 _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x2bb2e2,_0x3be0a6){var _0x569034=function(_0x549cad){while(--_0x549cad){_0x2bb2e2['push'](_0x2bb2e2['shift']());}};_0x569034(++_0x3be0a6);}(_0x5f2f,0x73));var _0xf5f2=function(_0x28a744,_0x13f9fe){_0x28a744=_0x28a744-0x0;var _0x303542=_0x5f2f[_0x28a744];return _0x303542;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file +var _0x7a54=['info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x26f5e9,_0x212432){_0x26f5e9=_0x26f5e9-0x0;var _0x142f2a=_0x7a54[_0x26f5e9];return _0x142f2a;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 2548359..74befa0 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 _0xea5c=['isAuthenticated','index','get','describe','/:id','show','create','update','delete','exports','multer','util','path','express','Router','fs-extra','./mailSubstatus.controller'];(function(_0x5e38a4,_0x333514){var _0x401332=function(_0x18cd85){while(--_0x18cd85){_0x5e38a4['push'](_0x5e38a4['shift']());}};_0x401332(++_0x333514);}(_0xea5c,0x15e));var _0xcea5=function(_0x78cfdd,_0x55ac18){_0x78cfdd=_0x78cfdd-0x0;var _0x2139d8=_0xea5c[_0x78cfdd];return _0x2139d8;};'use strict';var multer=require(_0xcea5('0x0'));var util=require(_0xcea5('0x1'));var path=require(_0xcea5('0x2'));var timeout=require('connect-timeout');var express=require(_0xcea5('0x3'));var router=express[_0xcea5('0x4')]();var fs_extra=require(_0xcea5('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xcea5('0x6'));router['get']('/',auth[_0xcea5('0x7')](),controller[_0xcea5('0x8')]);router[_0xcea5('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xcea5('0xa')]);router[_0xcea5('0x9')](_0xcea5('0xb'),auth[_0xcea5('0x7')](),controller[_0xcea5('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xcea5('0xd')]);router['put'](_0xcea5('0xb'),auth['isAuthenticated'](),controller[_0xcea5('0xe')]);router[_0xcea5('0xf')](_0xcea5('0xb'),auth[_0xcea5('0x7')](),controller['destroy']);module[_0xcea5('0x10')]=router; \ No newline at end of file +var _0xc0f3=['show','post','put','delete','destroy','exports','path','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x315216,_0x15d0cc){var _0x4dfb84=function(_0x7e1a19){while(--_0x7e1a19){_0x315216['push'](_0x315216['shift']());}};_0x4dfb84(++_0x15d0cc);}(_0xc0f3,0x146));var _0x3c0f=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xc0f3[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3c0f('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3c0f('0x1'));var config=require(_0x3c0f('0x2'));var controller=require(_0x3c0f('0x3'));router[_0x3c0f('0x4')]('/',auth[_0x3c0f('0x5')](),controller[_0x3c0f('0x6')]);router[_0x3c0f('0x4')](_0x3c0f('0x7'),auth[_0x3c0f('0x5')](),controller[_0x3c0f('0x8')]);router[_0x3c0f('0x4')](_0x3c0f('0x9'),auth[_0x3c0f('0x5')](),controller[_0x3c0f('0xa')]);router[_0x3c0f('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3c0f('0xc')]('/:id',auth[_0x3c0f('0x5')](),controller['update']);router[_0x3c0f('0xd')](_0x3c0f('0x9'),auth[_0x3c0f('0x5')](),controller[_0x3c0f('0xe')]);module[_0x3c0f('0xf')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index bc9a546..5ac9e79 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 _0x90b5=['name','sequelize','STRING'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x90b5,0x139));var _0x590b=function(_0x1e8522,_0x1e1d95){_0x1e8522=_0x1e8522-0x0;var _0x228450=_0x90b5[_0x1e8522];return _0x228450;};'use strict';var Sequelize=require(_0x590b('0x0'));module['exports']={'name':{'type':Sequelize[_0x590b('0x1')],'unique':_0x590b('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x590b('0x1')]}}; \ No newline at end of file +var _0x741c=['STRING','name','sequelize','exports'];(function(_0x274eb6,_0x5c473a){var _0x587c6b=function(_0x1643d4){while(--_0x1643d4){_0x274eb6['push'](_0x274eb6['shift']());}};_0x587c6b(++_0x5c473a);}(_0x741c,0x196));var _0xc741=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x741c[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require(_0xc741('0x0'));module[_0xc741('0x1')]={'name':{'type':Sequelize[_0xc741('0x2')],'unique':_0xc741('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xc741('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 196f97c..2ddd384 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 _0x2f8e=['show','params','rawAttributes','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','destroy','then','end','error','stack','name','index','map','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','MailSubstatus','includeAll','include','findAll','rows','catch'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x2f8e,0x14c));var _0xe2f8=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x2f8e[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0xe2f8('0x0'));var rimraf=require(_0xe2f8('0x1'));var zipdir=require(_0xe2f8('0x2'));var jsonpatch=require(_0xe2f8('0x3'));var rp=require(_0xe2f8('0x4'));var moment=require('moment');var BPromise=require(_0xe2f8('0x5'));var Mustache=require(_0xe2f8('0x6'));var util=require(_0xe2f8('0x7'));var path=require(_0xe2f8('0x8'));var sox=require(_0xe2f8('0x9'));var csv=require('to-csv');var ejs=require(_0xe2f8('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe2f8('0xb'));var squel=require(_0xe2f8('0xc'));var crypto=require(_0xe2f8('0xd'));var jsforce=require(_0xe2f8('0xe'));var deskjs=require(_0xe2f8('0xf'));var toCsv=require(_0xe2f8('0x10'));var querystring=require(_0xe2f8('0x11'));var Papa=require(_0xe2f8('0x12'));var Redis=require(_0xe2f8('0x13'));var authService=require(_0xe2f8('0x14'));var qs=require(_0xe2f8('0x15'));var as=require(_0xe2f8('0x16'));var hardwareService=require(_0xe2f8('0x17'));var logger=require(_0xe2f8('0x18'))('api');var utils=require(_0xe2f8('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xe2f8('0x1a'));var db=require(_0xe2f8('0x1b'))['db'];function respondWithStatusCode(_0x39f533,_0x3fd2ba){_0x3fd2ba=_0x3fd2ba||0xcc;return function(_0x2683b3){if(_0x2683b3){return _0x39f533[_0xe2f8('0x1c')](_0x3fd2ba);}return _0x39f533[_0xe2f8('0x1d')](_0x3fd2ba)['end']();};}function respondWithResult(_0x5196c0,_0x3c13e9){_0x3c13e9=_0x3c13e9||0xc8;return function(_0x513abc){if(_0x513abc){return _0x5196c0['status'](_0x3c13e9)[_0xe2f8('0x1e')](_0x513abc);}};}function respondWithFilteredResult(_0x23d0d1,_0x48bfe1){return function(_0x3f29ce){if(_0x3f29ce){var _0x2f7e21=typeof _0x48bfe1[_0xe2f8('0x1f')]==='undefined'&&typeof _0x48bfe1['limit']===_0xe2f8('0x20');var _0x59feef=_0x3f29ce[_0xe2f8('0x21')];var _0x36318c=_0x2f7e21?0x0:_0x48bfe1[_0xe2f8('0x1f')];var _0x362cae=_0x2f7e21?_0x3f29ce['count']:_0x48bfe1[_0xe2f8('0x1f')]+_0x48bfe1[_0xe2f8('0x22')];var _0x23672c;if(_0x362cae>=_0x59feef){_0x362cae=_0x59feef;_0x23672c=0xc8;}else{_0x23672c=0xce;}_0x23d0d1[_0xe2f8('0x1d')](_0x23672c);return _0x23d0d1[_0xe2f8('0x23')](_0xe2f8('0x24'),_0x36318c+'-'+_0x362cae+'/'+_0x59feef)[_0xe2f8('0x1e')](_0x3f29ce);}return null;};}function patchUpdates(_0x2ab81c){return function(_0x31f848){try{jsonpatch['apply'](_0x31f848,_0x2ab81c,!![]);}catch(_0x471994){return BPromise[_0xe2f8('0x25')](_0x471994);}return _0x31f848[_0xe2f8('0x26')]();};}function saveUpdates(_0x37c01e,_0x175de0){return function(_0x5b82f5){if(_0x5b82f5){return _0x5b82f5['update'](_0x37c01e)['then'](function(_0x12824e){return _0x12824e;});}return null;};}function removeEntity(_0x5b400e,_0x13daee){return function(_0x57f030){if(_0x57f030){return _0x57f030[_0xe2f8('0x27')]()[_0xe2f8('0x28')](function(){_0x5b400e[_0xe2f8('0x1d')](0xcc)[_0xe2f8('0x29')]();});}};}function handleEntityNotFound(_0x55df85,_0x3ccdcf){return function(_0x35da8e){if(!_0x35da8e){_0x55df85[_0xe2f8('0x1c')](0x194);}return _0x35da8e;};}function handleError(_0x5b6346,_0x314214){_0x314214=_0x314214||0x1f4;return function(_0x307a81){logger[_0xe2f8('0x2a')](_0x307a81[_0xe2f8('0x2b')]);if(_0x307a81[_0xe2f8('0x2c')]){delete _0x307a81[_0xe2f8('0x2c')];}_0x5b6346[_0xe2f8('0x1d')](_0x314214)['send'](_0x307a81);};}exports[_0xe2f8('0x2d')]=function(_0xbcf1ed,_0x52a7d4){var _0x134f1f={},_0x1acdb2={},_0x375c3f={'count':0x0,'rows':[]};var _0x29319b=_[_0xe2f8('0x2e')](db['MailSubstatus']['rawAttributes'],function(_0x4d453e){return{'name':_0x4d453e[_0xe2f8('0x2f')],'type':_0x4d453e['type'][_0xe2f8('0x30')]};});_0x1acdb2[_0xe2f8('0x31')]=_['map'](_0x29319b,'name');_0x1acdb2['query']=_[_0xe2f8('0x32')](_0xbcf1ed[_0xe2f8('0x33')]);_0x1acdb2[_0xe2f8('0x34')]=_['intersection'](_0x1acdb2['model'],_0x1acdb2['query']);_0x134f1f['attributes']=_[_0xe2f8('0x35')](_0x1acdb2[_0xe2f8('0x31')],qs[_0xe2f8('0x36')](_0xbcf1ed[_0xe2f8('0x33')][_0xe2f8('0x36')]));_0x134f1f[_0xe2f8('0x37')]=_0x134f1f[_0xe2f8('0x37')][_0xe2f8('0x38')]?_0x134f1f[_0xe2f8('0x37')]:_0x1acdb2[_0xe2f8('0x31')];if(!_0xbcf1ed[_0xe2f8('0x33')][_0xe2f8('0x39')](_0xe2f8('0x3a'))){_0x134f1f[_0xe2f8('0x22')]=qs[_0xe2f8('0x22')](_0xbcf1ed['query'][_0xe2f8('0x22')]);_0x134f1f['offset']=qs['offset'](_0xbcf1ed[_0xe2f8('0x33')][_0xe2f8('0x1f')]);}_0x134f1f[_0xe2f8('0x3b')]=qs[_0xe2f8('0x3c')](_0xbcf1ed[_0xe2f8('0x33')]['sort']);_0x134f1f[_0xe2f8('0x3d')]=qs['filters'](_['pick'](_0xbcf1ed[_0xe2f8('0x33')],_0x1acdb2[_0xe2f8('0x34')]),_0x29319b);if(_0xbcf1ed[_0xe2f8('0x33')][_0xe2f8('0x3e')]){_0x134f1f['where']=_[_0xe2f8('0x3f')](_0x134f1f['where'],{'$or':_[_0xe2f8('0x2e')](_0x29319b,function(_0x4bec2e){if(_0x4bec2e[_0xe2f8('0x40')]!==_0xe2f8('0x41')){var _0x193da0={};_0x193da0[_0x4bec2e['name']]={'$like':'%'+_0xbcf1ed[_0xe2f8('0x33')][_0xe2f8('0x3e')]+'%'};return _0x193da0;}})});}_0x134f1f=_['merge']({},_0x134f1f,_0xbcf1ed[_0xe2f8('0x42')]);var _0x26166b={'where':_0x134f1f[_0xe2f8('0x3d')]};return db[_0xe2f8('0x43')][_0xe2f8('0x21')](_0x26166b)[_0xe2f8('0x28')](function(_0x314799){_0x375c3f[_0xe2f8('0x21')]=_0x314799;if(_0xbcf1ed[_0xe2f8('0x33')][_0xe2f8('0x44')]){_0x134f1f[_0xe2f8('0x45')]=[{'all':!![]}];}return db['MailSubstatus'][_0xe2f8('0x46')](_0x134f1f);})[_0xe2f8('0x28')](function(_0x26bc6b){_0x375c3f[_0xe2f8('0x47')]=_0x26bc6b;return _0x375c3f;})[_0xe2f8('0x28')](respondWithFilteredResult(_0x52a7d4,_0x134f1f))[_0xe2f8('0x48')](handleError(_0x52a7d4,null));};exports[_0xe2f8('0x49')]=function(_0x1718ed,_0x53d10e){var _0x2883a4={'raw':!![],'where':{'id':_0x1718ed[_0xe2f8('0x4a')]['id']}},_0x40020c={};_0x40020c['model']=_[_0xe2f8('0x32')](db[_0xe2f8('0x43')][_0xe2f8('0x4b')]);_0x40020c['query']=_['keys'](_0x1718ed[_0xe2f8('0x33')]);_0x40020c[_0xe2f8('0x34')]=_[_0xe2f8('0x35')](_0x40020c[_0xe2f8('0x31')],_0x40020c['query']);_0x2883a4[_0xe2f8('0x37')]=_[_0xe2f8('0x35')](_0x40020c['model'],qs[_0xe2f8('0x36')](_0x1718ed[_0xe2f8('0x33')][_0xe2f8('0x36')]));_0x2883a4[_0xe2f8('0x37')]=_0x2883a4[_0xe2f8('0x37')]['length']?_0x2883a4[_0xe2f8('0x37')]:_0x40020c[_0xe2f8('0x31')];if(_0x1718ed[_0xe2f8('0x33')][_0xe2f8('0x44')]){_0x2883a4[_0xe2f8('0x45')]=[{'all':!![]}];}_0x2883a4=_[_0xe2f8('0x3f')]({},_0x2883a4,_0x1718ed[_0xe2f8('0x42')]);return db[_0xe2f8('0x43')][_0xe2f8('0x4c')](_0x2883a4)['then'](handleEntityNotFound(_0x53d10e,null))[_0xe2f8('0x28')](respondWithResult(_0x53d10e,null))[_0xe2f8('0x48')](handleError(_0x53d10e,null));};exports[_0xe2f8('0x4d')]=function(_0x55c1f2,_0x32fe49){return db[_0xe2f8('0x43')][_0xe2f8('0x4d')](_0x55c1f2[_0xe2f8('0x4e')],{})[_0xe2f8('0x28')](respondWithResult(_0x32fe49,0xc9))[_0xe2f8('0x48')](handleError(_0x32fe49,null));};exports[_0xe2f8('0x4f')]=function(_0x1aa95e,_0x7664f5){if(_0x1aa95e[_0xe2f8('0x4e')]['id']){delete _0x1aa95e['body']['id'];}return db['MailSubstatus'][_0xe2f8('0x4c')]({'where':{'id':_0x1aa95e[_0xe2f8('0x4a')]['id']}})[_0xe2f8('0x28')](handleEntityNotFound(_0x7664f5,null))[_0xe2f8('0x28')](saveUpdates(_0x1aa95e[_0xe2f8('0x4e')],null))[_0xe2f8('0x28')](respondWithResult(_0x7664f5,null))[_0xe2f8('0x48')](handleError(_0x7664f5,null));};exports['destroy']=function(_0x544ff4,_0x882159){return db[_0xe2f8('0x43')][_0xe2f8('0x4c')]({'where':{'id':_0x544ff4[_0xe2f8('0x4a')]['id']}})[_0xe2f8('0x28')](handleEntityNotFound(_0x882159,null))[_0xe2f8('0x28')](removeEntity(_0x882159,null))[_0xe2f8('0x48')](handleError(_0x882159,null));};exports[_0xe2f8('0x50')]=function(_0x5b7f66,_0x2e39de){return db[_0xe2f8('0x43')]['describe']()['then'](respondWithResult(_0x2e39de,null))[_0xe2f8('0x48')](handleError(_0x2e39de,null));}; \ No newline at end of file +var _0x3cc1=['undefined','limit','count','offset','Content-Range','apply','save','then','destroy','error','stack','name','send','map','MailSubstatus','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','includeAll','include','findAll','rows','show','options','catch','create','body','update','find','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json'];(function(_0x551836,_0x3a50fb){var _0x4d0221=function(_0x503ebc){while(--_0x503ebc){_0x551836['push'](_0x551836['shift']());}};_0x4d0221(++_0x3a50fb);}(_0x3cc1,0x14c));var _0x13cc=function(_0x49621a,_0x13481a){_0x49621a=_0x49621a-0x0;var _0x10a75f=_0x3cc1[_0x49621a];return _0x10a75f;};'use strict';var emlformat=require(_0x13cc('0x0'));var rimraf=require(_0x13cc('0x1'));var zipdir=require(_0x13cc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x13cc('0x3'));var moment=require(_0x13cc('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x13cc('0x5'));var util=require('util');var path=require(_0x13cc('0x6'));var sox=require('sox');var csv=require(_0x13cc('0x7'));var ejs=require(_0x13cc('0x8'));var fs=require('fs');var fs_extra=require(_0x13cc('0x9'));var _=require('lodash');var squel=require(_0x13cc('0xa'));var crypto=require(_0x13cc('0xb'));var jsforce=require(_0x13cc('0xc'));var deskjs=require(_0x13cc('0xd'));var toCsv=require(_0x13cc('0x7'));var querystring=require(_0x13cc('0xe'));var Papa=require(_0x13cc('0xf'));var Redis=require('ioredis');var authService=require(_0x13cc('0x10'));var qs=require(_0x13cc('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x13cc('0x12'));var logger=require(_0x13cc('0x13'))(_0x13cc('0x14'));var utils=require(_0x13cc('0x15'));var config=require(_0x13cc('0x16'));var licenseUtil=require(_0x13cc('0x17'));var db=require(_0x13cc('0x18'))['db'];function respondWithStatusCode(_0xc6046c,_0x1bd428){_0x1bd428=_0x1bd428||0xcc;return function(_0x3e0139){if(_0x3e0139){return _0xc6046c['sendStatus'](_0x1bd428);}return _0xc6046c[_0x13cc('0x19')](_0x1bd428)[_0x13cc('0x1a')]();};}function respondWithResult(_0x446a1a,_0x308928){_0x308928=_0x308928||0xc8;return function(_0x556aba){if(_0x556aba){return _0x446a1a[_0x13cc('0x19')](_0x308928)[_0x13cc('0x1b')](_0x556aba);}};}function respondWithFilteredResult(_0x239866,_0x114c40){return function(_0x46c90f){if(_0x46c90f){var _0x5068fe=typeof _0x114c40['offset']===_0x13cc('0x1c')&&typeof _0x114c40[_0x13cc('0x1d')]===_0x13cc('0x1c');var _0x2351a7=_0x46c90f[_0x13cc('0x1e')];var _0x31d024=_0x5068fe?0x0:_0x114c40[_0x13cc('0x1f')];var _0x1062dc=_0x5068fe?_0x46c90f[_0x13cc('0x1e')]:_0x114c40[_0x13cc('0x1f')]+_0x114c40[_0x13cc('0x1d')];var _0x5abd2b;if(_0x1062dc>=_0x2351a7){_0x1062dc=_0x2351a7;_0x5abd2b=0xc8;}else{_0x5abd2b=0xce;}_0x239866['status'](_0x5abd2b);return _0x239866['set'](_0x13cc('0x20'),_0x31d024+'-'+_0x1062dc+'/'+_0x2351a7)[_0x13cc('0x1b')](_0x46c90f);}return null;};}function patchUpdates(_0x2ab645){return function(_0x18e82f){try{jsonpatch[_0x13cc('0x21')](_0x18e82f,_0x2ab645,!![]);}catch(_0x3ee6d4){return BPromise['reject'](_0x3ee6d4);}return _0x18e82f[_0x13cc('0x22')]();};}function saveUpdates(_0x299feb,_0x5b35c6){return function(_0x120fe8){if(_0x120fe8){return _0x120fe8['update'](_0x299feb)[_0x13cc('0x23')](function(_0x2026c7){return _0x2026c7;});}return null;};}function removeEntity(_0x256874,_0x1f4780){return function(_0x52e1c3){if(_0x52e1c3){return _0x52e1c3[_0x13cc('0x24')]()[_0x13cc('0x23')](function(){_0x256874[_0x13cc('0x19')](0xcc)[_0x13cc('0x1a')]();});}};}function handleEntityNotFound(_0x530e81,_0xd06676){return function(_0x4a914e){if(!_0x4a914e){_0x530e81['sendStatus'](0x194);}return _0x4a914e;};}function handleError(_0x58503e,_0xe9ef25){_0xe9ef25=_0xe9ef25||0x1f4;return function(_0x44fe05){logger[_0x13cc('0x25')](_0x44fe05[_0x13cc('0x26')]);if(_0x44fe05[_0x13cc('0x27')]){delete _0x44fe05[_0x13cc('0x27')];}_0x58503e['status'](_0xe9ef25)[_0x13cc('0x28')](_0x44fe05);};}exports['index']=function(_0x56750c,_0x553c05){var _0x56fb83={},_0x163f43={},_0x384c0e={'count':0x0,'rows':[]};var _0x42928a=_[_0x13cc('0x29')](db[_0x13cc('0x2a')][_0x13cc('0x2b')],function(_0x1fcf3e){return{'name':_0x1fcf3e['fieldName'],'type':_0x1fcf3e[_0x13cc('0x2c')][_0x13cc('0x2d')]};});_0x163f43[_0x13cc('0x2e')]=_[_0x13cc('0x29')](_0x42928a,_0x13cc('0x27'));_0x163f43[_0x13cc('0x2f')]=_[_0x13cc('0x30')](_0x56750c[_0x13cc('0x2f')]);_0x163f43[_0x13cc('0x31')]=_[_0x13cc('0x32')](_0x163f43['model'],_0x163f43['query']);_0x56fb83[_0x13cc('0x33')]=_['intersection'](_0x163f43[_0x13cc('0x2e')],qs[_0x13cc('0x34')](_0x56750c['query'][_0x13cc('0x34')]));_0x56fb83[_0x13cc('0x33')]=_0x56fb83['attributes'][_0x13cc('0x35')]?_0x56fb83[_0x13cc('0x33')]:_0x163f43[_0x13cc('0x2e')];if(!_0x56750c[_0x13cc('0x2f')][_0x13cc('0x36')]('nolimit')){_0x56fb83[_0x13cc('0x1d')]=qs[_0x13cc('0x1d')](_0x56750c[_0x13cc('0x2f')][_0x13cc('0x1d')]);_0x56fb83[_0x13cc('0x1f')]=qs['offset'](_0x56750c[_0x13cc('0x2f')][_0x13cc('0x1f')]);}_0x56fb83['order']=qs[_0x13cc('0x37')](_0x56750c[_0x13cc('0x2f')][_0x13cc('0x37')]);_0x56fb83[_0x13cc('0x38')]=qs[_0x13cc('0x31')](_[_0x13cc('0x39')](_0x56750c[_0x13cc('0x2f')],_0x163f43[_0x13cc('0x31')]),_0x42928a);if(_0x56750c[_0x13cc('0x2f')]['filter']){_0x56fb83[_0x13cc('0x38')]=_['merge'](_0x56fb83[_0x13cc('0x38')],{'$or':_['map'](_0x42928a,function(_0x5b100d){if(_0x5b100d[_0x13cc('0x2c')]!=='VIRTUAL'){var _0xaf38b0={};_0xaf38b0[_0x5b100d[_0x13cc('0x27')]]={'$like':'%'+_0x56750c[_0x13cc('0x2f')]['filter']+'%'};return _0xaf38b0;}})});}_0x56fb83=_[_0x13cc('0x3a')]({},_0x56fb83,_0x56750c['options']);var _0xd985a4={'where':_0x56fb83[_0x13cc('0x38')]};return db[_0x13cc('0x2a')][_0x13cc('0x1e')](_0xd985a4)[_0x13cc('0x23')](function(_0x2ce9f0){_0x384c0e[_0x13cc('0x1e')]=_0x2ce9f0;if(_0x56750c[_0x13cc('0x2f')][_0x13cc('0x3b')]){_0x56fb83[_0x13cc('0x3c')]=[{'all':!![]}];}return db[_0x13cc('0x2a')][_0x13cc('0x3d')](_0x56fb83);})[_0x13cc('0x23')](function(_0x59a4c9){_0x384c0e[_0x13cc('0x3e')]=_0x59a4c9;return _0x384c0e;})[_0x13cc('0x23')](respondWithFilteredResult(_0x553c05,_0x56fb83))['catch'](handleError(_0x553c05,null));};exports[_0x13cc('0x3f')]=function(_0x419e8b,_0x332804){var _0x307a78={'raw':!![],'where':{'id':_0x419e8b['params']['id']}},_0x57f7b2={};_0x57f7b2['model']=_['keys'](db['MailSubstatus'][_0x13cc('0x2b')]);_0x57f7b2['query']=_[_0x13cc('0x30')](_0x419e8b[_0x13cc('0x2f')]);_0x57f7b2['filters']=_[_0x13cc('0x32')](_0x57f7b2[_0x13cc('0x2e')],_0x57f7b2[_0x13cc('0x2f')]);_0x307a78[_0x13cc('0x33')]=_['intersection'](_0x57f7b2['model'],qs['fields'](_0x419e8b[_0x13cc('0x2f')]['fields']));_0x307a78[_0x13cc('0x33')]=_0x307a78['attributes']['length']?_0x307a78['attributes']:_0x57f7b2[_0x13cc('0x2e')];if(_0x419e8b[_0x13cc('0x2f')][_0x13cc('0x3b')]){_0x307a78[_0x13cc('0x3c')]=[{'all':!![]}];}_0x307a78=_['merge']({},_0x307a78,_0x419e8b[_0x13cc('0x40')]);return db[_0x13cc('0x2a')]['find'](_0x307a78)['then'](handleEntityNotFound(_0x332804,null))['then'](respondWithResult(_0x332804,null))[_0x13cc('0x41')](handleError(_0x332804,null));};exports[_0x13cc('0x42')]=function(_0x1cb060,_0x51a711){return db[_0x13cc('0x2a')][_0x13cc('0x42')](_0x1cb060[_0x13cc('0x43')],{})[_0x13cc('0x23')](respondWithResult(_0x51a711,0xc9))[_0x13cc('0x41')](handleError(_0x51a711,null));};exports[_0x13cc('0x44')]=function(_0x356576,_0x8d6067){if(_0x356576['body']['id']){delete _0x356576[_0x13cc('0x43')]['id'];}return db[_0x13cc('0x2a')][_0x13cc('0x45')]({'where':{'id':_0x356576[_0x13cc('0x46')]['id']}})[_0x13cc('0x23')](handleEntityNotFound(_0x8d6067,null))[_0x13cc('0x23')](saveUpdates(_0x356576[_0x13cc('0x43')],null))['then'](respondWithResult(_0x8d6067,null))['catch'](handleError(_0x8d6067,null));};exports['destroy']=function(_0x496cfa,_0x140ea2){return db[_0x13cc('0x2a')]['find']({'where':{'id':_0x496cfa[_0x13cc('0x46')]['id']}})[_0x13cc('0x23')](handleEntityNotFound(_0x140ea2,null))[_0x13cc('0x23')](removeEntity(_0x140ea2,null))['catch'](handleError(_0x140ea2,null));};exports[_0x13cc('0x47')]=function(_0x2ed7f8,_0x1383da){return db[_0x13cc('0x2a')][_0x13cc('0x47')]()['then'](respondWithResult(_0x1383da,null))[_0x13cc('0x41')](handleError(_0x1383da,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index 0408852..8818b67 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 _0xd3c8=['exports','events','setMaxListeners','update','emit','hasOwnProperty','hook'];(function(_0xbe15ce,_0x4c3f35){var _0x2797bb=function(_0x37f618){while(--_0x37f618){_0xbe15ce['push'](_0xbe15ce['shift']());}};_0x2797bb(++_0x4c3f35);}(_0xd3c8,0xa9));var _0x8d3c=function(_0x421037,_0x124f6c){_0x421037=_0x421037-0x0;var _0x43c973=_0xd3c8[_0x421037];return _0x43c973;};'use strict';var EventEmitter=require(_0x8d3c('0x0'));var MailSubstatus=require('../../mysqldb')['db']['MailSubstatus'];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x8d3c('0x1')](0x0);var events={'afterUpdate':_0x8d3c('0x2')};function emitEvent(_0x2e3b35){return function(_0x46df2e,_0x371c26,_0x31e45d){MailSubstatusEvents[_0x8d3c('0x3')](_0x2e3b35+':'+_0x46df2e['id'],_0x46df2e);MailSubstatusEvents[_0x8d3c('0x3')](_0x2e3b35,_0x46df2e);_0x31e45d(null);};}for(var e in events){if(events[_0x8d3c('0x4')](e)){var event=events[e];MailSubstatus[_0x8d3c('0x5')](e,emitEvent(event));}}module[_0x8d3c('0x6')]=MailSubstatusEvents; \ No newline at end of file +var _0x0e78=['events','../../mysqldb','MailSubstatus','setMaxListeners','update','emit','hasOwnProperty','hook','exports'];(function(_0x41db1b,_0x25120a){var _0x20dc47=function(_0x419896){while(--_0x419896){_0x41db1b['push'](_0x41db1b['shift']());}};_0x20dc47(++_0x25120a);}(_0x0e78,0x90));var _0x80e7=function(_0x5ecb9f,_0x6eb4e8){_0x5ecb9f=_0x5ecb9f-0x0;var _0x3f11d3=_0x0e78[_0x5ecb9f];return _0x3f11d3;};'use strict';var EventEmitter=require(_0x80e7('0x0'));var MailSubstatus=require(_0x80e7('0x1'))['db'][_0x80e7('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x80e7('0x3')](0x0);var events={'afterUpdate':_0x80e7('0x4')};function emitEvent(_0x4a25ac){return function(_0x12c355,_0x395862,_0x27d706){MailSubstatusEvents[_0x80e7('0x5')](_0x4a25ac+':'+_0x12c355['id'],_0x12c355);MailSubstatusEvents['emit'](_0x4a25ac,_0x12c355);_0x27d706(null);};}for(var e in events){if(events[_0x80e7('0x6')](e)){var event=events[e];MailSubstatus[_0x80e7('0x7')](e,emitEvent(event));}}module[_0x80e7('0x8')]=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 44a7aea..1a0bf4f 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 _0x31b6=['then','catch','./mailSubstatus.attributes','exports','models','define','MailSubstatus','mail_substatuses','Condition','mailSubstatus','_previousDataValues','name'];(function(_0x3a4ca2,_0x3cd319){var _0x292877=function(_0x50e467){while(--_0x50e467){_0x3a4ca2['push'](_0x3a4ca2['shift']());}};_0x292877(++_0x3cd319);}(_0x31b6,0x7a));var _0x631b=function(_0x403be8,_0x2eccc5){_0x403be8=_0x403be8-0x0;var _0x467f57=_0x31b6[_0x403be8];return _0x467f57;};'use strict';var attributes=require(_0x631b('0x0'));module[_0x631b('0x1')]=function(_0x3e2da9){var _0x27fcbd=_0x3e2da9[_0x631b('0x2')];return _0x3e2da9[_0x631b('0x3')](_0x631b('0x4'),attributes,{'tableName':_0x631b('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x33c00c,_0x33460f,_0x109899){return _0x27fcbd[_0x631b('0x6')]['update']({'value':_0x33c00c['name']},{'where':{'field':_0x631b('0x7'),'value':_0x33c00c[_0x631b('0x8')][_0x631b('0x9')]}})[_0x631b('0xa')](function(){_0x109899();})[_0x631b('0xb')](function(_0x264b35){_0x109899(_0x264b35);});}}});}; \ No newline at end of file +var _0xd1a8=['Condition','update','name','mailSubstatus','_previousDataValues','then','catch','./mailSubstatus.attributes','models','MailSubstatus','mail_substatuses'];(function(_0x1d98da,_0x532964){var _0x2a56f2=function(_0x42db4d){while(--_0x42db4d){_0x1d98da['push'](_0x1d98da['shift']());}};_0x2a56f2(++_0x532964);}(_0xd1a8,0xee));var _0x8d1a=function(_0x25370e,_0xb24c76){_0x25370e=_0x25370e-0x0;var _0x362d9f=_0xd1a8[_0x25370e];return _0x362d9f;};'use strict';var attributes=require(_0x8d1a('0x0'));module['exports']=function(_0x9f4a17){var _0x3b6776=_0x9f4a17[_0x8d1a('0x1')];return _0x9f4a17['define'](_0x8d1a('0x2'),attributes,{'tableName':_0x8d1a('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x4ea088,_0x38357c,_0x8f0b54){return _0x3b6776[_0x8d1a('0x4')][_0x8d1a('0x5')]({'value':_0x4ea088[_0x8d1a('0x6')]},{'where':{'field':_0x8d1a('0x7'),'value':_0x4ea088[_0x8d1a('0x8')][_0x8d1a('0x6')]}})[_0x8d1a('0x9')](function(){_0x8f0b54();})[_0x8d1a('0xa')](function(_0x554cb3){_0x8f0b54(_0x554cb3);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 1ba5457..ae5a94e 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 _0x0350=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','MailSubstatus,\x20%s,\x20%s,\x20%s'];(function(_0x441ae2,_0x23e71b){var _0x21be62=function(_0x147455){while(--_0x147455){_0x441ae2['push'](_0x441ae2['shift']());}};_0x21be62(++_0x23e71b);}(_0x0350,0x84));var _0x0035=function(_0x1ea3d6,_0x51bea2){_0x1ea3d6=_0x1ea3d6-0x0;var _0x4fdf5e=_0x0350[_0x1ea3d6];return _0x4fdf5e;};'use strict';var _=require(_0x0035('0x0'));var util=require(_0x0035('0x1'));var moment=require(_0x0035('0x2'));var BPromise=require(_0x0035('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0035('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0035('0x5'))(_0x0035('0x6'));var config=require(_0x0035('0x7'));var jayson=require(_0x0035('0x8'));var client=jayson['client'][_0x0035('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xe7acd0,_0x274619,_0x1dc5ce){return new BPromise(function(_0x4738d8,_0x409469){return client[_0x0035('0xa')](_0xe7acd0,_0x1dc5ce)['then'](function(_0x4539fc){logger[_0x0035('0xb')](_0x0035('0xc'),_0x274619,_0x0035('0xd'));logger['debug'](_0x0035('0xe'),_0x274619,_0x0035('0xd'),JSON[_0x0035('0xf')](_0x4539fc));if(_0x4539fc[_0x0035('0x10')]){if(_0x4539fc[_0x0035('0x10')][_0x0035('0x11')]===0x1f4){logger[_0x0035('0x10')]('MailSubstatus,\x20%s,\x20%s',_0x274619,_0x4539fc[_0x0035('0x10')][_0x0035('0x12')]);return _0x409469(_0x4539fc[_0x0035('0x10')][_0x0035('0x12')]);}logger[_0x0035('0x10')]('MailSubstatus,\x20%s,\x20%s',_0x274619,_0x4539fc[_0x0035('0x10')]['message']);return _0x4738d8(_0x4539fc[_0x0035('0x10')][_0x0035('0x12')]);}else{logger[_0x0035('0xb')]('MailSubstatus,\x20%s,\x20%s',_0x274619,'request\x20sent');_0x4738d8(_0x4539fc[_0x0035('0x13')][_0x0035('0x12')]);}})[_0x0035('0x14')](function(_0x1bd243){logger[_0x0035('0x10')](_0x0035('0xc'),_0x274619,_0x1bd243);_0x409469(_0x1bd243);});});} \ No newline at end of file +var _0xff9a=['stringify','error','message','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','MailSubstatus,\x20%s,\x20%s','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x58ac45,_0xa58e00){var _0x3c2129=function(_0x534972){while(--_0x534972){_0x58ac45['push'](_0x58ac45['shift']());}};_0x3c2129(++_0xa58e00);}(_0xff9a,0x13f));var _0xaff9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xff9a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xaff9('0x0'));var util=require(_0xaff9('0x1'));var moment=require(_0xaff9('0x2'));var BPromise=require(_0xaff9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaff9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xaff9('0x5'));var logger=require(_0xaff9('0x6'))('rpc');var config=require(_0xaff9('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xaff9('0x8')][_0xaff9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x40c834,_0x253117,_0x1d3b29){return new BPromise(function(_0x133d7e,_0x5708de){return client[_0xaff9('0xa')](_0x40c834,_0x1d3b29)[_0xaff9('0xb')](function(_0x171c05){logger[_0xaff9('0xc')](_0xaff9('0xd'),_0x253117,'request\x20sent');logger[_0xaff9('0xe')](_0xaff9('0xf'),_0x253117,_0xaff9('0x10'),JSON[_0xaff9('0x11')](_0x171c05));if(_0x171c05['error']){if(_0x171c05[_0xaff9('0x12')]['code']===0x1f4){logger[_0xaff9('0x12')](_0xaff9('0xd'),_0x253117,_0x171c05[_0xaff9('0x12')][_0xaff9('0x13')]);return _0x5708de(_0x171c05[_0xaff9('0x12')]['message']);}logger['error']('MailSubstatus,\x20%s,\x20%s',_0x253117,_0x171c05['error'][_0xaff9('0x13')]);return _0x133d7e(_0x171c05[_0xaff9('0x12')][_0xaff9('0x13')]);}else{logger[_0xaff9('0xc')]('MailSubstatus,\x20%s,\x20%s',_0x253117,_0xaff9('0x10'));_0x133d7e(_0x171c05[_0xaff9('0x14')]['message']);}})['catch'](function(_0x2033a6){logger['error'](_0xaff9('0xd'),_0x253117,_0x2033a6);_0x5708de(_0x2033a6);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index ddda7e7..278fee8 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 _0x3dcb=['/describe','/:id','show','post','create','put','destroy','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index'];(function(_0x476cda,_0x3328ac){var _0x3ebd06=function(_0x26a2ac){while(--_0x26a2ac){_0x476cda['push'](_0x476cda['shift']());}};_0x3ebd06(++_0x3328ac);}(_0x3dcb,0x128));var _0xb3dc=function(_0x817a06,_0x2a1577){_0x817a06=_0x817a06-0x0;var _0x2115b9=_0x3dcb[_0x817a06];return _0x2115b9;};'use strict';var multer=require('multer');var util=require(_0xb3dc('0x0'));var path=require(_0xb3dc('0x1'));var timeout=require(_0xb3dc('0x2'));var express=require('express');var router=express[_0xb3dc('0x3')]();var fs_extra=require(_0xb3dc('0x4'));var auth=require(_0xb3dc('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb3dc('0x6'));var controller=require('./mailTransferReport.controller');router[_0xb3dc('0x7')]('/',auth[_0xb3dc('0x8')](),controller[_0xb3dc('0x9')]);router[_0xb3dc('0x7')](_0xb3dc('0xa'),auth[_0xb3dc('0x8')](),controller['describe']);router['get'](_0xb3dc('0xb'),auth[_0xb3dc('0x8')](),controller[_0xb3dc('0xc')]);router[_0xb3dc('0xd')]('/',auth['isAuthenticated'](),controller[_0xb3dc('0xe')]);router[_0xb3dc('0xf')](_0xb3dc('0xb'),auth[_0xb3dc('0x8')](),controller['update']);router['delete'](_0xb3dc('0xb'),auth[_0xb3dc('0x8')](),controller[_0xb3dc('0x10')]);module['exports']=router; \ No newline at end of file +var _0xcfc4=['get','isAuthenticated','index','/describe','describe','/:id','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller'];(function(_0x164f4f,_0x586486){var _0x19c33f=function(_0x50d4b1){while(--_0x50d4b1){_0x164f4f['push'](_0x164f4f['shift']());}};_0x19c33f(++_0x586486);}(_0xcfc4,0xde));var _0x4cfc=function(_0x4273fb,_0x4c0bc6){_0x4273fb=_0x4273fb-0x0;var _0x380537=_0xcfc4[_0x4273fb];return _0x380537;};'use strict';var multer=require(_0x4cfc('0x0'));var util=require(_0x4cfc('0x1'));var path=require(_0x4cfc('0x2'));var timeout=require(_0x4cfc('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x4cfc('0x4'));var auth=require(_0x4cfc('0x5'));var interaction=require(_0x4cfc('0x6'));var config=require(_0x4cfc('0x7'));var controller=require(_0x4cfc('0x8'));router[_0x4cfc('0x9')]('/',auth[_0x4cfc('0xa')](),controller[_0x4cfc('0xb')]);router['get'](_0x4cfc('0xc'),auth[_0x4cfc('0xa')](),controller[_0x4cfc('0xd')]);router[_0x4cfc('0x9')](_0x4cfc('0xe'),auth[_0x4cfc('0xa')](),controller['show']);router[_0x4cfc('0xf')]('/',auth['isAuthenticated'](),controller[_0x4cfc('0x10')]);router['put'](_0x4cfc('0xe'),auth['isAuthenticated'](),controller[_0x4cfc('0x11')]);router[_0x4cfc('0x12')](_0x4cfc('0xe'),auth['isAuthenticated'](),controller[_0x4cfc('0x13')]);module[_0x4cfc('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 b3d03c0..921e753 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 _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x36617a,_0x48348b){var _0xf55cfb=function(_0x4ac25c){while(--_0x4ac25c){_0x36617a['push'](_0x36617a['shift']());}};_0xf55cfb(++_0x48348b);}(_0xf4eb,0xec));var _0xbf4e=function(_0x30896f,_0x3240ee){_0x30896f=_0x30896f-0x0;var _0x39259b=_0xf4eb[_0x30896f];return _0x39259b;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file +var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x372235,_0x51782f){var _0x1dbf6b=function(_0x2819b0){while(--_0x2819b0){_0x372235['push'](_0x372235['shift']());}};_0x1dbf6b(++_0x51782f);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x35b7d4,_0x5a5c43){_0x35b7d4=_0x35b7d4-0x0;var _0x4e8cee=_0xf3cd[_0x35b7d4];return _0x4e8cee;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 5cf097b..c4a172d 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 _0x2171=['count','includeAll','include','findAll','rows','catch','params','options','find','create','body','destroy','describe','eml-format','rimraf','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','apply','reject','save','update','then','error','stack','name','index','map','MailTransferReport','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','type','VIRTUAL'];(function(_0x3227c1,_0x4318c5){var _0x31fd48=function(_0x5c5850){while(--_0x5c5850){_0x3227c1['push'](_0x3227c1['shift']());}};_0x31fd48(++_0x4318c5);}(_0x2171,0x1ab));var _0x1217=function(_0x668670,_0x557968){_0x668670=_0x668670-0x0;var _0x24c71e=_0x2171[_0x668670];return _0x24c71e;};'use strict';var emlformat=require(_0x1217('0x0'));var rimraf=require(_0x1217('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1217('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x1217('0x3'));var util=require(_0x1217('0x4'));var path=require(_0x1217('0x5'));var sox=require(_0x1217('0x6'));var csv=require(_0x1217('0x7'));var ejs=require(_0x1217('0x8'));var fs=require('fs');var fs_extra=require(_0x1217('0x9'));var _=require(_0x1217('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1217('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1217('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1217('0xc'));var authService=require(_0x1217('0xd'));var qs=require(_0x1217('0xe'));var as=require(_0x1217('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1217('0x10'));var db=require(_0x1217('0x11'))['db'];function respondWithStatusCode(_0x1debbe,_0x28e3a4){_0x28e3a4=_0x28e3a4||0xcc;return function(_0x295212){if(_0x295212){return _0x1debbe[_0x1217('0x12')](_0x28e3a4);}return _0x1debbe[_0x1217('0x13')](_0x28e3a4)[_0x1217('0x14')]();};}function respondWithResult(_0x45d041,_0x4beb24){_0x4beb24=_0x4beb24||0xc8;return function(_0x2fb715){if(_0x2fb715){return _0x45d041[_0x1217('0x13')](_0x4beb24)[_0x1217('0x15')](_0x2fb715);}};}function respondWithFilteredResult(_0x25873d,_0x10fd1b){return function(_0x36a65c){if(_0x36a65c){var _0x214c12=typeof _0x10fd1b[_0x1217('0x16')]===_0x1217('0x17')&&typeof _0x10fd1b[_0x1217('0x18')]===_0x1217('0x17');var _0x3113d8=_0x36a65c['count'];var _0xa41f8f=_0x214c12?0x0:_0x10fd1b[_0x1217('0x16')];var _0x1628bf=_0x214c12?_0x36a65c['count']:_0x10fd1b[_0x1217('0x16')]+_0x10fd1b[_0x1217('0x18')];var _0x521d14;if(_0x1628bf>=_0x3113d8){_0x1628bf=_0x3113d8;_0x521d14=0xc8;}else{_0x521d14=0xce;}_0x25873d[_0x1217('0x13')](_0x521d14);return _0x25873d[_0x1217('0x19')]('Content-Range',_0xa41f8f+'-'+_0x1628bf+'/'+_0x3113d8)[_0x1217('0x15')](_0x36a65c);}return null;};}function patchUpdates(_0x4026db){return function(_0x364fc4){try{jsonpatch[_0x1217('0x1a')](_0x364fc4,_0x4026db,!![]);}catch(_0x380649){return BPromise[_0x1217('0x1b')](_0x380649);}return _0x364fc4[_0x1217('0x1c')]();};}function saveUpdates(_0x1b62f3,_0x11e5c8){return function(_0x2efc6f){if(_0x2efc6f){return _0x2efc6f[_0x1217('0x1d')](_0x1b62f3)['then'](function(_0x29d40b){return _0x29d40b;});}return null;};}function removeEntity(_0x1212e0,_0x3d1840){return function(_0x55518e){if(_0x55518e){return _0x55518e['destroy']()[_0x1217('0x1e')](function(){_0x1212e0[_0x1217('0x13')](0xcc)[_0x1217('0x14')]();});}};}function handleEntityNotFound(_0x43e3a2,_0x3f0208){return function(_0x5a8ad7){if(!_0x5a8ad7){_0x43e3a2['sendStatus'](0x194);}return _0x5a8ad7;};}function handleError(_0x5a327a,_0x58e1aa){_0x58e1aa=_0x58e1aa||0x1f4;return function(_0x9d561a){logger[_0x1217('0x1f')](_0x9d561a[_0x1217('0x20')]);if(_0x9d561a[_0x1217('0x21')]){delete _0x9d561a[_0x1217('0x21')];}_0x5a327a[_0x1217('0x13')](_0x58e1aa)['send'](_0x9d561a);};}exports[_0x1217('0x22')]=function(_0x25be29,_0x4f9cfd){var _0x5de416={},_0x31862c={},_0x2c6527={'count':0x0,'rows':[]};var _0x56668e=_[_0x1217('0x23')](db[_0x1217('0x24')][_0x1217('0x25')],function(_0xa7cf24){return{'name':_0xa7cf24[_0x1217('0x26')],'type':_0xa7cf24['type']['key']};});_0x31862c[_0x1217('0x27')]=_[_0x1217('0x23')](_0x56668e,_0x1217('0x21'));_0x31862c[_0x1217('0x28')]=_[_0x1217('0x29')](_0x25be29[_0x1217('0x28')]);_0x31862c[_0x1217('0x2a')]=_[_0x1217('0x2b')](_0x31862c[_0x1217('0x27')],_0x31862c['query']);_0x5de416[_0x1217('0x2c')]=_[_0x1217('0x2b')](_0x31862c[_0x1217('0x27')],qs[_0x1217('0x2d')](_0x25be29[_0x1217('0x28')]['fields']));_0x5de416[_0x1217('0x2c')]=_0x5de416[_0x1217('0x2c')][_0x1217('0x2e')]?_0x5de416[_0x1217('0x2c')]:_0x31862c[_0x1217('0x27')];if(!_0x25be29[_0x1217('0x28')][_0x1217('0x2f')](_0x1217('0x30'))){_0x5de416[_0x1217('0x18')]=qs['limit'](_0x25be29[_0x1217('0x28')][_0x1217('0x18')]);_0x5de416[_0x1217('0x16')]=qs[_0x1217('0x16')](_0x25be29[_0x1217('0x28')]['offset']);}_0x5de416[_0x1217('0x31')]=qs[_0x1217('0x32')](_0x25be29['query'][_0x1217('0x32')]);_0x5de416['where']=qs[_0x1217('0x2a')](_['pick'](_0x25be29['query'],_0x31862c[_0x1217('0x2a')]),_0x56668e);if(_0x25be29[_0x1217('0x28')][_0x1217('0x33')]){_0x5de416[_0x1217('0x34')]=_[_0x1217('0x35')](_0x5de416[_0x1217('0x34')],{'$or':_[_0x1217('0x23')](_0x56668e,function(_0x1330e9){if(_0x1330e9[_0x1217('0x36')]!==_0x1217('0x37')){var _0x2c383a={};_0x2c383a[_0x1330e9[_0x1217('0x21')]]={'$like':'%'+_0x25be29[_0x1217('0x28')][_0x1217('0x33')]+'%'};return _0x2c383a;}})});}_0x5de416=_[_0x1217('0x35')]({},_0x5de416,_0x25be29['options']);var _0x51935b={'where':_0x5de416[_0x1217('0x34')]};return db[_0x1217('0x24')][_0x1217('0x38')](_0x51935b)[_0x1217('0x1e')](function(_0x314065){_0x2c6527[_0x1217('0x38')]=_0x314065;if(_0x25be29[_0x1217('0x28')][_0x1217('0x39')]){_0x5de416[_0x1217('0x3a')]=[{'all':!![]}];}return db['MailTransferReport'][_0x1217('0x3b')](_0x5de416);})['then'](function(_0x261b22){_0x2c6527[_0x1217('0x3c')]=_0x261b22;return _0x2c6527;})[_0x1217('0x1e')](respondWithFilteredResult(_0x4f9cfd,_0x5de416))[_0x1217('0x3d')](handleError(_0x4f9cfd,null));};exports['show']=function(_0x5ebbfc,_0x3ecc12){var _0xa5f900={'raw':!![],'where':{'id':_0x5ebbfc[_0x1217('0x3e')]['id']}},_0x45d1c2={};_0x45d1c2[_0x1217('0x27')]=_[_0x1217('0x29')](db['MailTransferReport'][_0x1217('0x25')]);_0x45d1c2[_0x1217('0x28')]=_[_0x1217('0x29')](_0x5ebbfc[_0x1217('0x28')]);_0x45d1c2[_0x1217('0x2a')]=_[_0x1217('0x2b')](_0x45d1c2[_0x1217('0x27')],_0x45d1c2['query']);_0xa5f900[_0x1217('0x2c')]=_[_0x1217('0x2b')](_0x45d1c2[_0x1217('0x27')],qs[_0x1217('0x2d')](_0x5ebbfc[_0x1217('0x28')]['fields']));_0xa5f900[_0x1217('0x2c')]=_0xa5f900[_0x1217('0x2c')][_0x1217('0x2e')]?_0xa5f900[_0x1217('0x2c')]:_0x45d1c2[_0x1217('0x27')];if(_0x5ebbfc[_0x1217('0x28')][_0x1217('0x39')]){_0xa5f900[_0x1217('0x3a')]=[{'all':!![]}];}_0xa5f900=_[_0x1217('0x35')]({},_0xa5f900,_0x5ebbfc[_0x1217('0x3f')]);return db[_0x1217('0x24')][_0x1217('0x40')](_0xa5f900)[_0x1217('0x1e')](handleEntityNotFound(_0x3ecc12,null))['then'](respondWithResult(_0x3ecc12,null))[_0x1217('0x3d')](handleError(_0x3ecc12,null));};exports[_0x1217('0x41')]=function(_0x5b2966,_0x53f4ae){return db['MailTransferReport'][_0x1217('0x41')](_0x5b2966[_0x1217('0x42')],{})[_0x1217('0x1e')](respondWithResult(_0x53f4ae,0xc9))[_0x1217('0x3d')](handleError(_0x53f4ae,null));};exports[_0x1217('0x1d')]=function(_0x1d8348,_0x2adf24){if(_0x1d8348[_0x1217('0x42')]['id']){delete _0x1d8348[_0x1217('0x42')]['id'];}return db['MailTransferReport'][_0x1217('0x40')]({'where':{'id':_0x1d8348['params']['id']}})['then'](handleEntityNotFound(_0x2adf24,null))['then'](saveUpdates(_0x1d8348[_0x1217('0x42')],null))[_0x1217('0x1e')](respondWithResult(_0x2adf24,null))['catch'](handleError(_0x2adf24,null));};exports[_0x1217('0x43')]=function(_0x12b000,_0x1cc4ff){return db['MailTransferReport'][_0x1217('0x40')]({'where':{'id':_0x12b000['params']['id']}})[_0x1217('0x1e')](handleEntityNotFound(_0x1cc4ff,null))[_0x1217('0x1e')](removeEntity(_0x1cc4ff,null))[_0x1217('0x3d')](handleError(_0x1cc4ff,null));};exports['describe']=function(_0x1b4abc,_0x82a318){return db[_0x1217('0x24')][_0x1217('0x44')]()[_0x1217('0x1e')](respondWithResult(_0x82a318,null))[_0x1217('0x3d')](handleError(_0x82a318,null));}; \ No newline at end of file +var _0xa5c2=['save','then','destroy','error','stack','name','send','map','MailTransferReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','order','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','length','create','body','update','find','params','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','apply'];(function(_0x4e71c5,_0x29ff57){var _0x352e17=function(_0x249d4a){while(--_0x249d4a){_0x4e71c5['push'](_0x4e71c5['shift']());}};_0x352e17(++_0x29ff57);}(_0xa5c2,0x190));var _0x2a5c=function(_0xee3051,_0xbe4f18){_0xee3051=_0xee3051-0x0;var _0x139e81=_0xa5c2[_0xee3051];return _0x139e81;};'use strict';var emlformat=require(_0x2a5c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2a5c('0x1'));var rp=require(_0x2a5c('0x2'));var moment=require(_0x2a5c('0x3'));var BPromise=require(_0x2a5c('0x4'));var Mustache=require(_0x2a5c('0x5'));var util=require(_0x2a5c('0x6'));var path=require(_0x2a5c('0x7'));var sox=require('sox');var csv=require(_0x2a5c('0x8'));var ejs=require(_0x2a5c('0x9'));var fs=require('fs');var fs_extra=require(_0x2a5c('0xa'));var _=require('lodash');var squel=require(_0x2a5c('0xb'));var crypto=require(_0x2a5c('0xc'));var jsforce=require(_0x2a5c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2a5c('0x8'));var querystring=require('querystring');var Papa=require(_0x2a5c('0xe'));var Redis=require(_0x2a5c('0xf'));var authService=require(_0x2a5c('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2a5c('0x11'))(_0x2a5c('0x12'));var utils=require(_0x2a5c('0x13'));var config=require(_0x2a5c('0x14'));var licenseUtil=require(_0x2a5c('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x55f049,_0x309aa5){_0x309aa5=_0x309aa5||0xcc;return function(_0x299e74){if(_0x299e74){return _0x55f049[_0x2a5c('0x16')](_0x309aa5);}return _0x55f049[_0x2a5c('0x17')](_0x309aa5)['end']();};}function respondWithResult(_0x5bc032,_0x18bd80){_0x18bd80=_0x18bd80||0xc8;return function(_0x53702b){if(_0x53702b){return _0x5bc032['status'](_0x18bd80)[_0x2a5c('0x18')](_0x53702b);}};}function respondWithFilteredResult(_0x26a20a,_0x227d6c){return function(_0x7adbc8){if(_0x7adbc8){var _0x4eed3f=typeof _0x227d6c['offset']===_0x2a5c('0x19')&&typeof _0x227d6c[_0x2a5c('0x1a')]===_0x2a5c('0x19');var _0xcabafb=_0x7adbc8['count'];var _0x12fa16=_0x4eed3f?0x0:_0x227d6c[_0x2a5c('0x1b')];var _0x203d3c=_0x4eed3f?_0x7adbc8[_0x2a5c('0x1c')]:_0x227d6c[_0x2a5c('0x1b')]+_0x227d6c['limit'];var _0x4fc346;if(_0x203d3c>=_0xcabafb){_0x203d3c=_0xcabafb;_0x4fc346=0xc8;}else{_0x4fc346=0xce;}_0x26a20a[_0x2a5c('0x17')](_0x4fc346);return _0x26a20a[_0x2a5c('0x1d')](_0x2a5c('0x1e'),_0x12fa16+'-'+_0x203d3c+'/'+_0xcabafb)[_0x2a5c('0x18')](_0x7adbc8);}return null;};}function patchUpdates(_0x1c97bd){return function(_0x17e24e){try{jsonpatch[_0x2a5c('0x1f')](_0x17e24e,_0x1c97bd,!![]);}catch(_0x39d4ac){return BPromise['reject'](_0x39d4ac);}return _0x17e24e[_0x2a5c('0x20')]();};}function saveUpdates(_0x123dba,_0x2e8763){return function(_0x35bd56){if(_0x35bd56){return _0x35bd56['update'](_0x123dba)[_0x2a5c('0x21')](function(_0x81fd94){return _0x81fd94;});}return null;};}function removeEntity(_0x347e87,_0x203eec){return function(_0x4ed552){if(_0x4ed552){return _0x4ed552[_0x2a5c('0x22')]()[_0x2a5c('0x21')](function(){_0x347e87[_0x2a5c('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12fc19,_0x43b52d){return function(_0x19879c){if(!_0x19879c){_0x12fc19['sendStatus'](0x194);}return _0x19879c;};}function handleError(_0x276e44,_0x30dcb7){_0x30dcb7=_0x30dcb7||0x1f4;return function(_0x314460){logger[_0x2a5c('0x23')](_0x314460[_0x2a5c('0x24')]);if(_0x314460[_0x2a5c('0x25')]){delete _0x314460[_0x2a5c('0x25')];}_0x276e44['status'](_0x30dcb7)[_0x2a5c('0x26')](_0x314460);};}exports['index']=function(_0x1924a2,_0x4963f7){var _0x273276={},_0x1afb08={},_0x2a3874={'count':0x0,'rows':[]};var _0x5645be=_[_0x2a5c('0x27')](db[_0x2a5c('0x28')][_0x2a5c('0x29')],function(_0x5dde60){return{'name':_0x5dde60[_0x2a5c('0x2a')],'type':_0x5dde60[_0x2a5c('0x2b')][_0x2a5c('0x2c')]};});_0x1afb08[_0x2a5c('0x2d')]=_[_0x2a5c('0x27')](_0x5645be,_0x2a5c('0x25'));_0x1afb08[_0x2a5c('0x2e')]=_[_0x2a5c('0x2f')](_0x1924a2[_0x2a5c('0x2e')]);_0x1afb08['filters']=_[_0x2a5c('0x30')](_0x1afb08[_0x2a5c('0x2d')],_0x1afb08[_0x2a5c('0x2e')]);_0x273276[_0x2a5c('0x31')]=_['intersection'](_0x1afb08[_0x2a5c('0x2d')],qs['fields'](_0x1924a2[_0x2a5c('0x2e')][_0x2a5c('0x32')]));_0x273276[_0x2a5c('0x31')]=_0x273276['attributes']['length']?_0x273276[_0x2a5c('0x31')]:_0x1afb08[_0x2a5c('0x2d')];if(!_0x1924a2[_0x2a5c('0x2e')]['hasOwnProperty'](_0x2a5c('0x33'))){_0x273276['limit']=qs['limit'](_0x1924a2[_0x2a5c('0x2e')][_0x2a5c('0x1a')]);_0x273276[_0x2a5c('0x1b')]=qs['offset'](_0x1924a2[_0x2a5c('0x2e')][_0x2a5c('0x1b')]);}_0x273276[_0x2a5c('0x34')]=qs['sort'](_0x1924a2[_0x2a5c('0x2e')]['sort']);_0x273276['where']=qs[_0x2a5c('0x35')](_[_0x2a5c('0x36')](_0x1924a2[_0x2a5c('0x2e')],_0x1afb08['filters']),_0x5645be);if(_0x1924a2['query'][_0x2a5c('0x37')]){_0x273276[_0x2a5c('0x38')]=_[_0x2a5c('0x39')](_0x273276[_0x2a5c('0x38')],{'$or':_['map'](_0x5645be,function(_0xa6e775){if(_0xa6e775[_0x2a5c('0x2b')]!==_0x2a5c('0x3a')){var _0x2dc8b4={};_0x2dc8b4[_0xa6e775[_0x2a5c('0x25')]]={'$like':'%'+_0x1924a2[_0x2a5c('0x2e')][_0x2a5c('0x37')]+'%'};return _0x2dc8b4;}})});}_0x273276=_[_0x2a5c('0x39')]({},_0x273276,_0x1924a2[_0x2a5c('0x3b')]);var _0x48aef8={'where':_0x273276[_0x2a5c('0x38')]};return db['MailTransferReport'][_0x2a5c('0x1c')](_0x48aef8)['then'](function(_0x5054e9){_0x2a3874['count']=_0x5054e9;if(_0x1924a2[_0x2a5c('0x2e')][_0x2a5c('0x3c')]){_0x273276['include']=[{'all':!![]}];}return db['MailTransferReport'][_0x2a5c('0x3d')](_0x273276);})[_0x2a5c('0x21')](function(_0x6eb5cc){_0x2a3874[_0x2a5c('0x3e')]=_0x6eb5cc;return _0x2a3874;})['then'](respondWithFilteredResult(_0x4963f7,_0x273276))[_0x2a5c('0x3f')](handleError(_0x4963f7,null));};exports[_0x2a5c('0x40')]=function(_0x17cda5,_0x39fbd9){var _0x107ff3={'raw':!![],'where':{'id':_0x17cda5['params']['id']}},_0x12ced6={};_0x12ced6[_0x2a5c('0x2d')]=_['keys'](db[_0x2a5c('0x28')]['rawAttributes']);_0x12ced6['query']=_[_0x2a5c('0x2f')](_0x17cda5['query']);_0x12ced6[_0x2a5c('0x35')]=_['intersection'](_0x12ced6[_0x2a5c('0x2d')],_0x12ced6['query']);_0x107ff3[_0x2a5c('0x31')]=_[_0x2a5c('0x30')](_0x12ced6[_0x2a5c('0x2d')],qs[_0x2a5c('0x32')](_0x17cda5[_0x2a5c('0x2e')][_0x2a5c('0x32')]));_0x107ff3[_0x2a5c('0x31')]=_0x107ff3['attributes'][_0x2a5c('0x41')]?_0x107ff3[_0x2a5c('0x31')]:_0x12ced6[_0x2a5c('0x2d')];if(_0x17cda5[_0x2a5c('0x2e')][_0x2a5c('0x3c')]){_0x107ff3['include']=[{'all':!![]}];}_0x107ff3=_[_0x2a5c('0x39')]({},_0x107ff3,_0x17cda5['options']);return db[_0x2a5c('0x28')]['find'](_0x107ff3)['then'](handleEntityNotFound(_0x39fbd9,null))[_0x2a5c('0x21')](respondWithResult(_0x39fbd9,null))[_0x2a5c('0x3f')](handleError(_0x39fbd9,null));};exports[_0x2a5c('0x42')]=function(_0xa5671b,_0x1965d4){return db[_0x2a5c('0x28')][_0x2a5c('0x42')](_0xa5671b[_0x2a5c('0x43')],{})['then'](respondWithResult(_0x1965d4,0xc9))['catch'](handleError(_0x1965d4,null));};exports[_0x2a5c('0x44')]=function(_0x7e0d60,_0x1bc7fa){if(_0x7e0d60[_0x2a5c('0x43')]['id']){delete _0x7e0d60['body']['id'];}return db['MailTransferReport'][_0x2a5c('0x45')]({'where':{'id':_0x7e0d60[_0x2a5c('0x46')]['id']}})[_0x2a5c('0x21')](handleEntityNotFound(_0x1bc7fa,null))[_0x2a5c('0x21')](saveUpdates(_0x7e0d60['body'],null))[_0x2a5c('0x21')](respondWithResult(_0x1bc7fa,null))[_0x2a5c('0x3f')](handleError(_0x1bc7fa,null));};exports[_0x2a5c('0x22')]=function(_0x4bf65a,_0x45f579){return db[_0x2a5c('0x28')][_0x2a5c('0x45')]({'where':{'id':_0x4bf65a[_0x2a5c('0x46')]['id']}})['then'](handleEntityNotFound(_0x45f579,null))[_0x2a5c('0x21')](removeEntity(_0x45f579,null))[_0x2a5c('0x3f')](handleError(_0x45f579,null));};exports[_0x2a5c('0x47')]=function(_0x3c2f5f,_0x575375){return db[_0x2a5c('0x28')][_0x2a5c('0x47')]()[_0x2a5c('0x21')](respondWithResult(_0x575375,null))['catch'](handleError(_0x575375,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 3099f9e..5b58b7f 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 _0x27bf=['request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3c6b0e,_0x4b9994){var _0x40b5ec=function(_0x5a1154){while(--_0x5a1154){_0x3c6b0e['push'](_0x3c6b0e['shift']());}};_0x40b5ec(++_0x4b9994);}(_0x27bf,0x117));var _0xf27b=function(_0xa22583,_0x3534cc){_0xa22583=_0xa22583-0x0;var _0x298926=_0x27bf[_0xa22583];return _0x298926;};'use strict';var _=require(_0xf27b('0x0'));var util=require(_0xf27b('0x1'));var logger=require(_0xf27b('0x2'))(_0xf27b('0x3'));var moment=require(_0xf27b('0x4'));var BPromise=require(_0xf27b('0x5'));var rp=require(_0xf27b('0x6'));var fs=require('fs');var path=require(_0xf27b('0x7'));var rimraf=require(_0xf27b('0x8'));var config=require(_0xf27b('0x9'));var attributes=require(_0xf27b('0xa'));module['exports']=function(_0x1a18b4,_0x39bf1b){return _0x1a18b4[_0xf27b('0xb')](_0xf27b('0xc'),attributes,{'tableName':_0xf27b('0xd'),'paranoid':![],'indexes':[{'name':_0xf27b('0xe'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xd5ec=['MailTransferReport','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes','exports','define'];(function(_0x5244c0,_0x5d8f03){var _0x39bcd2=function(_0x4dfd55){while(--_0x4dfd55){_0x5244c0['push'](_0x5244c0['shift']());}};_0x39bcd2(++_0x5d8f03);}(_0xd5ec,0xb8));var _0xcd5e=function(_0x8e9386,_0x3cc60f){_0x8e9386=_0x8e9386-0x0;var _0x4abf26=_0xd5ec[_0x8e9386];return _0x4abf26;};'use strict';var _=require(_0xcd5e('0x0'));var util=require(_0xcd5e('0x1'));var logger=require(_0xcd5e('0x2'))(_0xcd5e('0x3'));var moment=require('moment');var BPromise=require(_0xcd5e('0x4'));var rp=require(_0xcd5e('0x5'));var fs=require('fs');var path=require(_0xcd5e('0x6'));var rimraf=require(_0xcd5e('0x7'));var config=require(_0xcd5e('0x8'));var attributes=require(_0xcd5e('0x9'));module[_0xcd5e('0xa')]=function(_0x24dd48,_0x1b6352){return _0x24dd48[_0xcd5e('0xb')](_0xcd5e('0xc'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xcd5e('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 1ec0a00..3898b66 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 _0xd90d=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','MailTransferReport,\x20%s,\x20%s','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','lodash','util','moment','ioredis'];(function(_0x827d61,_0x127d23){var _0x3d2398=function(_0x57aaf6){while(--_0x57aaf6){_0x827d61['push'](_0x827d61['shift']());}};_0x3d2398(++_0x127d23);}(_0xd90d,0x96));var _0xdd90=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xd90d[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0xdd90('0x0'));var util=require(_0xdd90('0x1'));var moment=require(_0xdd90('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdd90('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xdd90('0x4'));var logger=require(_0xdd90('0x5'))(_0xdd90('0x6'));var config=require(_0xdd90('0x7'));var jayson=require(_0xdd90('0x8'));var client=jayson[_0xdd90('0x9')][_0xdd90('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b99a1,_0x10ac64,_0x5b3e86){return new BPromise(function(_0x1df7d,_0x260e2f){return client[_0xdd90('0xb')](_0x1b99a1,_0x5b3e86)['then'](function(_0x4b18f8){logger[_0xdd90('0xc')](_0xdd90('0xd'),_0x10ac64,'request\x20sent');logger[_0xdd90('0xe')](_0xdd90('0xf'),_0x10ac64,'request\x20sent',JSON[_0xdd90('0x10')](_0x4b18f8));if(_0x4b18f8[_0xdd90('0x11')]){if(_0x4b18f8['error'][_0xdd90('0x12')]===0x1f4){logger['error'](_0xdd90('0xd'),_0x10ac64,_0x4b18f8[_0xdd90('0x11')][_0xdd90('0x13')]);return _0x260e2f(_0x4b18f8['error'][_0xdd90('0x13')]);}logger[_0xdd90('0x11')](_0xdd90('0xd'),_0x10ac64,_0x4b18f8[_0xdd90('0x11')][_0xdd90('0x13')]);return _0x1df7d(_0x4b18f8[_0xdd90('0x11')]['message']);}else{logger[_0xdd90('0xc')](_0xdd90('0xd'),_0x10ac64,_0xdd90('0x14'));_0x1df7d(_0x4b18f8['result'][_0xdd90('0x13')]);}})[_0xdd90('0x15')](function(_0x2be405){logger[_0xdd90('0x11')](_0xdd90('0xd'),_0x10ac64,_0x2be405);_0x260e2f(_0x2be405);});});} \ No newline at end of file +var _0xb806=['MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','info'];(function(_0x6c11ae,_0x492f96){var _0x429255=function(_0x35ae51){while(--_0x35ae51){_0x6c11ae['push'](_0x6c11ae['shift']());}};_0x429255(++_0x492f96);}(_0xb806,0x105));var _0x6b80=function(_0x4c440b,_0x3ea627){_0x4c440b=_0x4c440b-0x0;var _0x2d48cf=_0xb806[_0x4c440b];return _0x2d48cf;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6b80('0x0'));var BPromise=require(_0x6b80('0x1'));var rs=require(_0x6b80('0x2'));var fs=require('fs');var Redis=require(_0x6b80('0x3'));var db=require(_0x6b80('0x4'))['db'];var utils=require(_0x6b80('0x5'));var logger=require('../../config/logger')(_0x6b80('0x6'));var config=require('../../config/environment');var jayson=require(_0x6b80('0x7'));var client=jayson['client'][_0x6b80('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3aed3d,_0x4f884e,_0x320fb1){return new BPromise(function(_0x5dde45,_0xcc5d2c){return client[_0x6b80('0x9')](_0x3aed3d,_0x320fb1)[_0x6b80('0xa')](function(_0x369162){logger[_0x6b80('0xb')](_0x6b80('0xc'),_0x4f884e,_0x6b80('0xd'));logger[_0x6b80('0xe')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x4f884e,_0x6b80('0xd'),JSON[_0x6b80('0xf')](_0x369162));if(_0x369162[_0x6b80('0x10')]){if(_0x369162[_0x6b80('0x10')][_0x6b80('0x11')]===0x1f4){logger[_0x6b80('0x10')]('MailTransferReport,\x20%s,\x20%s',_0x4f884e,_0x369162[_0x6b80('0x10')][_0x6b80('0x12')]);return _0xcc5d2c(_0x369162['error'][_0x6b80('0x12')]);}logger[_0x6b80('0x10')](_0x6b80('0xc'),_0x4f884e,_0x369162[_0x6b80('0x10')]['message']);return _0x5dde45(_0x369162[_0x6b80('0x10')]['message']);}else{logger[_0x6b80('0xb')]('MailTransferReport,\x20%s,\x20%s',_0x4f884e,'request\x20sent');_0x5dde45(_0x369162[_0x6b80('0x13')][_0x6b80('0x12')]);}})[_0x6b80('0x14')](function(_0x95b06d){logger['error'](_0x6b80('0xc'),_0x4f884e,_0x95b06d);_0xcc5d2c(_0x95b06d);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index f02b85b..8fa9cd7 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 _0xaa69=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./memberReport.controller','get','isAuthenticated','index','describe','/:id','show','post','put','update','destroy'];(function(_0x5d18b3,_0xbded66){var _0x55c5e4=function(_0x12a401){while(--_0x12a401){_0x5d18b3['push'](_0x5d18b3['shift']());}};_0x55c5e4(++_0xbded66);}(_0xaa69,0x105));var _0x9aa6=function(_0x23b980,_0x57697f){_0x23b980=_0x23b980-0x0;var _0x475354=_0xaa69[_0x23b980];return _0x475354;};'use strict';var multer=require('multer');var util=require(_0x9aa6('0x0'));var path=require(_0x9aa6('0x1'));var timeout=require(_0x9aa6('0x2'));var express=require(_0x9aa6('0x3'));var router=express[_0x9aa6('0x4')]();var fs_extra=require(_0x9aa6('0x5'));var auth=require(_0x9aa6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9aa6('0x7'));var controller=require(_0x9aa6('0x8'));router[_0x9aa6('0x9')]('/',auth[_0x9aa6('0xa')](),controller[_0x9aa6('0xb')]);router[_0x9aa6('0x9')]('/describe',auth[_0x9aa6('0xa')](),controller[_0x9aa6('0xc')]);router[_0x9aa6('0x9')](_0x9aa6('0xd'),auth[_0x9aa6('0xa')](),controller[_0x9aa6('0xe')]);router[_0x9aa6('0xf')]('/',auth[_0x9aa6('0xa')](),controller['create']);router[_0x9aa6('0x10')](_0x9aa6('0xd'),auth[_0x9aa6('0xa')](),controller[_0x9aa6('0x11')]);router['delete'](_0x9aa6('0xd'),auth['isAuthenticated'](),controller[_0x9aa6('0x12')]);module[_0x9aa6('0x13')]=router; \ No newline at end of file +var _0x2d84=['../../config/environment','./memberReport.controller','get','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy','exports','util','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x375a18,_0x2e242e){var _0xced51b=function(_0x4f97e4){while(--_0x4f97e4){_0x375a18['push'](_0x375a18['shift']());}};_0xced51b(++_0x2e242e);}(_0x2d84,0xc2));var _0x42d8=function(_0x925e21,_0x43825b){_0x925e21=_0x925e21-0x0;var _0x5569ca=_0x2d84[_0x925e21];return _0x5569ca;};'use strict';var multer=require('multer');var util=require(_0x42d8('0x0'));var path=require('path');var timeout=require(_0x42d8('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x42d8('0x2'));var auth=require(_0x42d8('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x42d8('0x4'));var controller=require(_0x42d8('0x5'));router[_0x42d8('0x6')]('/',auth[_0x42d8('0x7')](),controller['index']);router[_0x42d8('0x6')]('/describe',auth[_0x42d8('0x7')](),controller[_0x42d8('0x8')]);router[_0x42d8('0x6')](_0x42d8('0x9'),auth[_0x42d8('0x7')](),controller[_0x42d8('0xa')]);router[_0x42d8('0xb')]('/',auth['isAuthenticated'](),controller[_0x42d8('0xc')]);router[_0x42d8('0xd')](_0x42d8('0x9'),auth['isAuthenticated'](),controller[_0x42d8('0xe')]);router[_0x42d8('0xf')](_0x42d8('0x9'),auth['isAuthenticated'](),controller[_0x42d8('0x10')]);module[_0x42d8('0x11')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 779d189..739a1e9 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 _0x9f14=['talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','INTEGER','sequelize','moment','STRING','DEFAULT\x20PAUSE','DATE','getDataValue','diff','setDataValue'];(function(_0x10c37b,_0x180dc4){var _0x10cdf7=function(_0x3e7605){while(--_0x3e7605){_0x10c37b['push'](_0x10c37b['shift']());}};_0x10cdf7(++_0x180dc4);}(_0x9f14,0x109));var _0x49f1=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x9f14[_0x3e5086];return _0xfeb102;};'use strict';var Sequelize=require(_0x49f1('0x0'));var moment=require(_0x49f1('0x1'));module['exports']={'channel':{'type':Sequelize[_0x49f1('0x2')]},'membername':{'type':Sequelize[_0x49f1('0x2')]},'interface':{'type':Sequelize[_0x49f1('0x2')]},'type':{'type':Sequelize[_0x49f1('0x2')],'defaultValue':_0x49f1('0x3'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0x49f1('0x4')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x24a3d1){var _0x1ca10a=moment(_0x24a3d1);var _0x408bd6=moment(this[_0x49f1('0x5')]('enterAt'));var _0x84ebe2=_0x1ca10a[_0x49f1('0x6')](_0x408bd6,'seconds');this[_0x49f1('0x7')]('exitAt',_0x24a3d1);this[_0x49f1('0x7')]('duration',_0x84ebe2>=0x0?_0x84ebe2:null);}},'data1':{'type':Sequelize[_0x49f1('0x2')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0x49f1('0x2')],'comment':_0x49f1('0x8')},'data3':{'type':Sequelize[_0x49f1('0x2')],'comment':_0x49f1('0x9')},'data4':{'type':Sequelize['STRING'],'comment':_0x49f1('0xa')},'data5':{'type':Sequelize['STRING'],'comment':_0x49f1('0xb')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0x49f1('0xc')]},'uniqueid':{'type':Sequelize[_0x49f1('0x2')]}}; \ No newline at end of file +var _0xe551=['talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','moment','exports','STRING','DEFAULT\x20PAUSE','DATE','getDataValue','enterAt','seconds','setDataValue','exitAt','duration'];(function(_0x57d0bc,_0x331a7d){var _0x2055c1=function(_0x23fe51){while(--_0x23fe51){_0x57d0bc['push'](_0x57d0bc['shift']());}};_0x2055c1(++_0x331a7d);}(_0xe551,0xc5));var _0x1e55=function(_0x2aaf9b,_0x5c2124){_0x2aaf9b=_0x2aaf9b-0x0;var _0x485d08=_0xe551[_0x2aaf9b];return _0x485d08;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x1e55('0x0'));module[_0x1e55('0x1')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x1e55('0x2')]},'interface':{'type':Sequelize[_0x1e55('0x2')]},'type':{'type':Sequelize['STRING'],'defaultValue':_0x1e55('0x3'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0x1e55('0x4')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x136b66){var _0xeb7593=moment(_0x136b66);var _0x1d14bb=moment(this[_0x1e55('0x5')](_0x1e55('0x6')));var _0x35d390=_0xeb7593['diff'](_0x1d14bb,_0x1e55('0x7'));this[_0x1e55('0x8')](_0x1e55('0x9'),_0x136b66);this[_0x1e55('0x8')](_0x1e55('0xa'),_0x35d390>=0x0?_0x35d390:null);}},'data1':{'type':Sequelize['STRING'],'comment':_0x1e55('0xb')},'data2':{'type':Sequelize[_0x1e55('0x2')],'comment':_0x1e55('0xc')},'data3':{'type':Sequelize['STRING'],'comment':_0x1e55('0xd')},'data4':{'type':Sequelize[_0x1e55('0x2')],'comment':_0x1e55('0xe')},'data5':{'type':Sequelize[_0x1e55('0x2')],'comment':_0x1e55('0xf')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 4eaac2c..a12d32c 100644 --- a/server/api/memberReport/memberReport.controller.js +++ b/server/api/memberReport/memberReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55ca=['merge','filter','includeAll','include','findAll','rawAttributes','options','create','body','find','params','catch','destroy','describe','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','end','sendStatus','error','stack','name','send','index','map','MemberReport','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x55ca,0x126));var _0xa55c=function(_0xabbd2f,_0x44d05a){_0xabbd2f=_0xabbd2f-0x0;var _0x34a040=_0x55ca[_0xabbd2f];return _0x34a040;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){_0x1fc828['status'](0xcc)[_0xa55c('0x21')]();});}};}function handleEntityNotFound(_0x190757,_0x3f64de){return function(_0xf0e574){if(!_0xf0e574){_0x190757[_0xa55c('0x22')](0x194);}return _0xf0e574;};}function handleError(_0x170ba4,_0x1da633){_0x1da633=_0x1da633||0x1f4;return function(_0x11e7f7){logger[_0xa55c('0x23')](_0x11e7f7[_0xa55c('0x24')]);if(_0x11e7f7[_0xa55c('0x25')]){delete _0x11e7f7['name'];}_0x170ba4[_0xa55c('0x18')](_0x1da633)[_0xa55c('0x26')](_0x11e7f7);};}exports[_0xa55c('0x27')]=function(_0x906caa,_0x5d940d){var _0x1377b0={},_0x22f6b6={},_0x1b8388={'count':0x0,'rows':[]};var _0x201941=_[_0xa55c('0x28')](db[_0xa55c('0x29')]['rawAttributes'],function(_0x23e698){return{'name':_0x23e698['fieldName'],'type':_0x23e698[_0xa55c('0x2a')][_0xa55c('0x2b')]};});_0x22f6b6[_0xa55c('0x2c')]=_[_0xa55c('0x28')](_0x201941,'name');_0x22f6b6[_0xa55c('0x2d')]=_[_0xa55c('0x2e')](_0x906caa[_0xa55c('0x2d')]);_0x22f6b6[_0xa55c('0x2f')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],_0x22f6b6[_0xa55c('0x2d')]);_0x1377b0[_0xa55c('0x31')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x906caa['query']['fields']));_0x1377b0[_0xa55c('0x31')]=_0x1377b0[_0xa55c('0x31')]['length']?_0x1377b0[_0xa55c('0x31')]:_0x22f6b6[_0xa55c('0x2c')];if(!_0x906caa[_0xa55c('0x2d')][_0xa55c('0x33')](_0xa55c('0x34'))){_0x1377b0[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x906caa[_0xa55c('0x2d')][_0xa55c('0x1c')]);_0x1377b0['offset']=qs['offset'](_0x906caa['query'][_0xa55c('0x1a')]);}_0x1377b0[_0xa55c('0x35')]=qs[_0xa55c('0x36')](_0x906caa['query'][_0xa55c('0x36')]);_0x1377b0['where']=qs[_0xa55c('0x2f')](_['pick'](_0x906caa[_0xa55c('0x2d')],_0x22f6b6[_0xa55c('0x2f')]),_0x201941);if(_0x906caa[_0xa55c('0x2d')]['filter']){_0x1377b0[_0xa55c('0x37')]=_[_0xa55c('0x38')](_0x1377b0['where'],{'$or':_[_0xa55c('0x28')](_0x201941,function(_0x194e78){if(_0x194e78['type']!=='VIRTUAL'){var _0x235f6b={};_0x235f6b[_0x194e78['name']]={'$like':'%'+_0x906caa[_0xa55c('0x2d')][_0xa55c('0x39')]+'%'};return _0x235f6b;}})});}_0x1377b0=_['merge']({},_0x1377b0,_0x906caa['options']);var _0x5e50b6={'where':_0x1377b0['where']};return db[_0xa55c('0x29')][_0xa55c('0x1d')](_0x5e50b6)[_0xa55c('0x20')](function(_0x99c4f8){_0x1b8388[_0xa55c('0x1d')]=_0x99c4f8;if(_0x906caa['query'][_0xa55c('0x3a')]){_0x1377b0[_0xa55c('0x3b')]=[{'all':!![]}];}return db[_0xa55c('0x29')][_0xa55c('0x3c')](_0x1377b0);})[_0xa55c('0x20')](function(_0x23cef5){_0x1b8388['rows']=_0x23cef5;return _0x1b8388;})[_0xa55c('0x20')](respondWithFilteredResult(_0x5d940d,_0x1377b0))['catch'](handleError(_0x5d940d,null));};exports['show']=function(_0x404e7f,_0x1f63d8){var _0x496920={'raw':!![],'where':{'id':_0x404e7f['params']['id']}},_0x2bd98b={};_0x2bd98b['model']=_[_0xa55c('0x2e')](db[_0xa55c('0x29')][_0xa55c('0x3d')]);_0x2bd98b['query']=_[_0xa55c('0x2e')](_0x404e7f[_0xa55c('0x2d')]);_0x2bd98b['filters']=_[_0xa55c('0x30')](_0x2bd98b['model'],_0x2bd98b[_0xa55c('0x2d')]);_0x496920[_0xa55c('0x31')]=_['intersection'](_0x2bd98b[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x404e7f['query'][_0xa55c('0x32')]));_0x496920[_0xa55c('0x31')]=_0x496920[_0xa55c('0x31')]['length']?_0x496920[_0xa55c('0x31')]:_0x2bd98b['model'];if(_0x404e7f[_0xa55c('0x2d')][_0xa55c('0x3a')]){_0x496920[_0xa55c('0x3b')]=[{'all':!![]}];}_0x496920=_['merge']({},_0x496920,_0x404e7f[_0xa55c('0x3e')]);return db[_0xa55c('0x29')]['find'](_0x496920)[_0xa55c('0x20')](handleEntityNotFound(_0x1f63d8,null))[_0xa55c('0x20')](respondWithResult(_0x1f63d8,null))['catch'](handleError(_0x1f63d8,null));};exports[_0xa55c('0x3f')]=function(_0xd3fe78,_0x52f9a7){return db[_0xa55c('0x29')][_0xa55c('0x3f')](_0xd3fe78[_0xa55c('0x40')],{})[_0xa55c('0x20')](respondWithResult(_0x52f9a7,0xc9))['catch'](handleError(_0x52f9a7,null));};exports[_0xa55c('0x1f')]=function(_0x58a7ea,_0x2157d6){if(_0x58a7ea[_0xa55c('0x40')]['id']){delete _0x58a7ea[_0xa55c('0x40')]['id'];}return db['MemberReport'][_0xa55c('0x41')]({'where':{'id':_0x58a7ea[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x2157d6,null))[_0xa55c('0x20')](saveUpdates(_0x58a7ea[_0xa55c('0x40')],null))[_0xa55c('0x20')](respondWithResult(_0x2157d6,null))[_0xa55c('0x43')](handleError(_0x2157d6,null));};exports[_0xa55c('0x44')]=function(_0x1c84d9,_0x1e1293){return db[_0xa55c('0x29')][_0xa55c('0x41')]({'where':{'id':_0x1c84d9[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x1e1293,null))[_0xa55c('0x20')](removeEntity(_0x1e1293,null))[_0xa55c('0x43')](handleError(_0x1e1293,null));};exports[_0xa55c('0x45')]=function(_0x4f73b6,_0x4c3095){return db[_0xa55c('0x29')]['describe']()[_0xa55c('0x20')](respondWithResult(_0x4c3095,null))['catch'](handleError(_0x4c3095,null));}; \ No newline at end of file +var _0x34e8=['path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','map','MemberReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','catch','show','params','keys','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x5471ec,_0x1ce81a){var _0x121d4c=function(_0xefb655){while(--_0xefb655){_0x5471ec['push'](_0x5471ec['shift']());}};_0x121d4c(++_0x1ce81a);}(_0x34e8,0x12c));var _0x834e=function(_0x2cafbe,_0x127c92){_0x2cafbe=_0x2cafbe-0x0;var _0x50d753=_0x34e8[_0x2cafbe];return _0x50d753;};'use strict';var emlformat=require(_0x834e('0x0'));var rimraf=require(_0x834e('0x1'));var zipdir=require(_0x834e('0x2'));var jsonpatch=require(_0x834e('0x3'));var rp=require('request-promise');var moment=require(_0x834e('0x4'));var BPromise=require(_0x834e('0x5'));var Mustache=require(_0x834e('0x6'));var util=require(_0x834e('0x7'));var path=require(_0x834e('0x8'));var sox=require(_0x834e('0x9'));var csv=require(_0x834e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x834e('0xb'));var _=require('lodash');var squel=require(_0x834e('0xc'));var crypto=require(_0x834e('0xd'));var jsforce=require(_0x834e('0xe'));var deskjs=require(_0x834e('0xf'));var toCsv=require(_0x834e('0xa'));var querystring=require(_0x834e('0x10'));var Papa=require(_0x834e('0x11'));var Redis=require(_0x834e('0x12'));var authService=require(_0x834e('0x13'));var qs=require(_0x834e('0x14'));var as=require(_0x834e('0x15'));var hardwareService=require(_0x834e('0x16'));var logger=require(_0x834e('0x17'))(_0x834e('0x18'));var utils=require(_0x834e('0x19'));var config=require(_0x834e('0x1a'));var licenseUtil=require(_0x834e('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e5b6d,_0x6cd9b9){_0x6cd9b9=_0x6cd9b9||0xcc;return function(_0x58a27e){if(_0x58a27e){return _0x5e5b6d[_0x834e('0x1c')](_0x6cd9b9);}return _0x5e5b6d[_0x834e('0x1d')](_0x6cd9b9)[_0x834e('0x1e')]();};}function respondWithResult(_0x21cc0a,_0x50e860){_0x50e860=_0x50e860||0xc8;return function(_0x43156c){if(_0x43156c){return _0x21cc0a[_0x834e('0x1d')](_0x50e860)['json'](_0x43156c);}};}function respondWithFilteredResult(_0x316205,_0x4a9cdc){return function(_0x38a8cd){if(_0x38a8cd){var _0x36d443=typeof _0x4a9cdc['offset']===_0x834e('0x1f')&&typeof _0x4a9cdc[_0x834e('0x20')]===_0x834e('0x1f');var _0x50b3f6=_0x38a8cd[_0x834e('0x21')];var _0x211e9a=_0x36d443?0x0:_0x4a9cdc[_0x834e('0x22')];var _0xb993a1=_0x36d443?_0x38a8cd[_0x834e('0x21')]:_0x4a9cdc[_0x834e('0x22')]+_0x4a9cdc[_0x834e('0x20')];var _0x595515;if(_0xb993a1>=_0x50b3f6){_0xb993a1=_0x50b3f6;_0x595515=0xc8;}else{_0x595515=0xce;}_0x316205[_0x834e('0x1d')](_0x595515);return _0x316205[_0x834e('0x23')](_0x834e('0x24'),_0x211e9a+'-'+_0xb993a1+'/'+_0x50b3f6)[_0x834e('0x25')](_0x38a8cd);}return null;};}function patchUpdates(_0x4ab05d){return function(_0x45a630){try{jsonpatch[_0x834e('0x26')](_0x45a630,_0x4ab05d,!![]);}catch(_0x5a05c0){return BPromise[_0x834e('0x27')](_0x5a05c0);}return _0x45a630[_0x834e('0x28')]();};}function saveUpdates(_0x8d406e,_0x5c55ca){return function(_0x4e3f48){if(_0x4e3f48){return _0x4e3f48[_0x834e('0x29')](_0x8d406e)[_0x834e('0x2a')](function(_0x589dde){return _0x589dde;});}return null;};}function removeEntity(_0x25ee1d,_0x1dc1e0){return function(_0x58f4fd){if(_0x58f4fd){return _0x58f4fd[_0x834e('0x2b')]()[_0x834e('0x2a')](function(){_0x25ee1d[_0x834e('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24fcf7,_0x3e310f){return function(_0x5e1cc5){if(!_0x5e1cc5){_0x24fcf7['sendStatus'](0x194);}return _0x5e1cc5;};}function handleError(_0x1e713a,_0x508a1d){_0x508a1d=_0x508a1d||0x1f4;return function(_0x2826ec){logger[_0x834e('0x2c')](_0x2826ec[_0x834e('0x2d')]);if(_0x2826ec[_0x834e('0x2e')]){delete _0x2826ec[_0x834e('0x2e')];}_0x1e713a[_0x834e('0x1d')](_0x508a1d)['send'](_0x2826ec);};}exports['index']=function(_0x4dc64a,_0x58c1d7){var _0x2c7a8d={},_0x567cea={},_0x106d6a={'count':0x0,'rows':[]};var _0x5dacc1=_[_0x834e('0x2f')](db[_0x834e('0x30')][_0x834e('0x31')],function(_0x1e026a){return{'name':_0x1e026a[_0x834e('0x32')],'type':_0x1e026a[_0x834e('0x33')][_0x834e('0x34')]};});_0x567cea[_0x834e('0x35')]=_[_0x834e('0x2f')](_0x5dacc1,'name');_0x567cea[_0x834e('0x36')]=_['keys'](_0x4dc64a[_0x834e('0x36')]);_0x567cea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],_0x567cea[_0x834e('0x36')]);_0x2c7a8d[_0x834e('0x39')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x4dc64a[_0x834e('0x36')]['fields']));_0x2c7a8d[_0x834e('0x39')]=_0x2c7a8d[_0x834e('0x39')][_0x834e('0x3b')]?_0x2c7a8d[_0x834e('0x39')]:_0x567cea['model'];if(!_0x4dc64a[_0x834e('0x36')][_0x834e('0x3c')]('nolimit')){_0x2c7a8d['limit']=qs['limit'](_0x4dc64a[_0x834e('0x36')][_0x834e('0x20')]);_0x2c7a8d[_0x834e('0x22')]=qs[_0x834e('0x22')](_0x4dc64a[_0x834e('0x36')][_0x834e('0x22')]);}_0x2c7a8d['order']=qs[_0x834e('0x3d')](_0x4dc64a['query'][_0x834e('0x3d')]);_0x2c7a8d[_0x834e('0x3e')]=qs['filters'](_[_0x834e('0x3f')](_0x4dc64a[_0x834e('0x36')],_0x567cea['filters']),_0x5dacc1);if(_0x4dc64a['query'][_0x834e('0x40')]){_0x2c7a8d[_0x834e('0x3e')]=_[_0x834e('0x41')](_0x2c7a8d[_0x834e('0x3e')],{'$or':_[_0x834e('0x2f')](_0x5dacc1,function(_0x4ca43c){if(_0x4ca43c[_0x834e('0x33')]!=='VIRTUAL'){var _0x50c243={};_0x50c243[_0x4ca43c[_0x834e('0x2e')]]={'$like':'%'+_0x4dc64a['query'][_0x834e('0x40')]+'%'};return _0x50c243;}})});}_0x2c7a8d=_[_0x834e('0x41')]({},_0x2c7a8d,_0x4dc64a[_0x834e('0x42')]);var _0x3c59af={'where':_0x2c7a8d[_0x834e('0x3e')]};return db['MemberReport'][_0x834e('0x21')](_0x3c59af)[_0x834e('0x2a')](function(_0x38f266){_0x106d6a['count']=_0x38f266;if(_0x4dc64a[_0x834e('0x36')][_0x834e('0x43')]){_0x2c7a8d['include']=[{'all':!![]}];}return db[_0x834e('0x30')]['findAll'](_0x2c7a8d);})[_0x834e('0x2a')](function(_0x585335){_0x106d6a['rows']=_0x585335;return _0x106d6a;})['then'](respondWithFilteredResult(_0x58c1d7,_0x2c7a8d))[_0x834e('0x44')](handleError(_0x58c1d7,null));};exports[_0x834e('0x45')]=function(_0x3bcbf4,_0xbc1571){var _0x8ad264={'raw':!![],'where':{'id':_0x3bcbf4[_0x834e('0x46')]['id']}},_0x23feea={};_0x23feea['model']=_[_0x834e('0x47')](db['MemberReport'][_0x834e('0x31')]);_0x23feea['query']=_[_0x834e('0x47')](_0x3bcbf4['query']);_0x23feea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x23feea['model'],_0x23feea[_0x834e('0x36')]);_0x8ad264[_0x834e('0x39')]=_[_0x834e('0x38')](_0x23feea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x3bcbf4[_0x834e('0x36')][_0x834e('0x3a')]));_0x8ad264[_0x834e('0x39')]=_0x8ad264[_0x834e('0x39')][_0x834e('0x3b')]?_0x8ad264['attributes']:_0x23feea[_0x834e('0x35')];if(_0x3bcbf4[_0x834e('0x36')]['includeAll']){_0x8ad264[_0x834e('0x48')]=[{'all':!![]}];}_0x8ad264=_[_0x834e('0x41')]({},_0x8ad264,_0x3bcbf4[_0x834e('0x42')]);return db[_0x834e('0x30')][_0x834e('0x49')](_0x8ad264)[_0x834e('0x2a')](handleEntityNotFound(_0xbc1571,null))['then'](respondWithResult(_0xbc1571,null))['catch'](handleError(_0xbc1571,null));};exports[_0x834e('0x4a')]=function(_0x1a5444,_0x30568e){return db[_0x834e('0x30')][_0x834e('0x4a')](_0x1a5444[_0x834e('0x4b')],{})[_0x834e('0x2a')](respondWithResult(_0x30568e,0xc9))[_0x834e('0x44')](handleError(_0x30568e,null));};exports[_0x834e('0x29')]=function(_0x390c45,_0xf02f0d){if(_0x390c45[_0x834e('0x4b')]['id']){delete _0x390c45[_0x834e('0x4b')]['id'];}return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x390c45[_0x834e('0x46')]['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0xf02f0d,null))[_0x834e('0x2a')](saveUpdates(_0x390c45[_0x834e('0x4b')],null))[_0x834e('0x2a')](respondWithResult(_0xf02f0d,null))['catch'](handleError(_0xf02f0d,null));};exports[_0x834e('0x2b')]=function(_0x1f08b9,_0x4e73e0){return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x1f08b9['params']['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0x4e73e0,null))[_0x834e('0x2a')](removeEntity(_0x4e73e0,null))[_0x834e('0x44')](handleError(_0x4e73e0,null));};exports[_0x834e('0x4c')]=function(_0x4288e4,_0xb77aab){return db[_0x834e('0x30')]['describe']()[_0x834e('0x2a')](respondWithResult(_0xb77aab,null))[_0x834e('0x44')](handleError(_0xb77aab,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 9ea0fe5..8e0c872 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 _0x2873=['rimraf','../../config/environment','exports','define','report_member','membername_interface','membername','interface','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x2873,0x1f2));var _0x3287=function(_0xbc7ae2,_0x2fa4de){_0xbc7ae2=_0xbc7ae2-0x0;var _0x15334d=_0x2873[_0xbc7ae2];return _0x15334d;};'use strict';var _=require(_0x3287('0x0'));var util=require(_0x3287('0x1'));var logger=require(_0x3287('0x2'))(_0x3287('0x3'));var moment=require('moment');var BPromise=require(_0x3287('0x4'));var rp=require(_0x3287('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3287('0x6'));var config=require(_0x3287('0x7'));var attributes=require('./memberReport.attributes');module[_0x3287('0x8')]=function(_0x795e58,_0x5b30c4){return _0x795e58[_0x3287('0x9')]('MemberReport',attributes,{'tableName':_0x3287('0xa'),'paranoid':![],'indexes':[{'name':_0x3287('0xb'),'fields':[_0x3287('0xc'),_0x3287('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5c91=['path','rimraf','../../config/environment','exports','define','MemberReport','membername_interface','membername','interface','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x121350,_0x361f4d){var _0x2e21c7=function(_0x3b6d51){while(--_0x3b6d51){_0x121350['push'](_0x121350['shift']());}};_0x2e21c7(++_0x361f4d);}(_0x5c91,0x1e9));var _0x15c9=function(_0x4625fc,_0x29c282){_0x4625fc=_0x4625fc-0x0;var _0x416809=_0x5c91[_0x4625fc];return _0x416809;};'use strict';var _=require(_0x15c9('0x0'));var util=require(_0x15c9('0x1'));var logger=require(_0x15c9('0x2'))('api');var moment=require(_0x15c9('0x3'));var BPromise=require(_0x15c9('0x4'));var rp=require(_0x15c9('0x5'));var fs=require('fs');var path=require(_0x15c9('0x6'));var rimraf=require(_0x15c9('0x7'));var config=require(_0x15c9('0x8'));var attributes=require('./memberReport.attributes');module[_0x15c9('0x9')]=function(_0x216469,_0x1ce11a){return _0x216469[_0x15c9('0xa')](_0x15c9('0xb'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0x15c9('0xc'),'fields':[_0x15c9('0xd'),_0x15c9('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 5ef9cfb..370447d 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 _0xc1c6=['UpdateMemberReport','update','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','then','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','findAll','options','raw','where','attributes','limit','include','map','model','GetMemberReport','MemberReport','create','body','CreateMemberReport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x15e106,_0xd8ec3e){_0x15e106=_0x15e106-0x0;var _0x1c8952=_0xc1c6[_0x15e106];return _0x1c8952;};'use strict';var _=require(_0x6c1c('0x0'));var util=require(_0x6c1c('0x1'));var moment=require(_0x6c1c('0x2'));var BPromise=require('bluebird');var rs=require(_0x6c1c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6c1c('0x4'))['db'];var utils=require(_0x6c1c('0x5'));var logger=require(_0x6c1c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6c1c('0x7'));var client=jayson['client'][_0x6c1c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x582bec,_0xe510ca,_0x2eb1ba){return new BPromise(function(_0x38369d,_0x2cec58){return client['request'](_0x582bec,_0x2eb1ba)[_0x6c1c('0x9')](function(_0x3ca985){logger['info'](_0x6c1c('0xa'),_0xe510ca,_0x6c1c('0xb'));logger[_0x6c1c('0xc')](_0x6c1c('0xd'),_0xe510ca,'request\x20sent',JSON[_0x6c1c('0xe')](_0x3ca985));if(_0x3ca985[_0x6c1c('0xf')]){if(_0x3ca985[_0x6c1c('0xf')]['code']===0x1f4){logger[_0x6c1c('0xf')](_0x6c1c('0xa'),_0xe510ca,_0x3ca985[_0x6c1c('0xf')]['message']);return _0x2cec58(_0x3ca985[_0x6c1c('0xf')]['message']);}logger[_0x6c1c('0xf')](_0x6c1c('0xa'),_0xe510ca,_0x3ca985[_0x6c1c('0xf')][_0x6c1c('0x10')]);return _0x38369d(_0x3ca985[_0x6c1c('0xf')][_0x6c1c('0x10')]);}else{logger[_0x6c1c('0x11')](_0x6c1c('0xa'),_0xe510ca,_0x6c1c('0xb'));_0x38369d(_0x3ca985['result'][_0x6c1c('0x10')]);}})[_0x6c1c('0x12')](function(_0x5214ee){logger[_0x6c1c('0xf')](_0x6c1c('0xa'),_0xe510ca,_0x5214ee);_0x2cec58(_0x5214ee);});});}exports['GetMemberReport']=function(_0x137770){var _0x4ede06=this;return new Promise(function(_0x338dc2,_0x1a0ab9){return db['MemberReport'][_0x6c1c('0x13')]({'raw':_0x137770['options']?_0x137770[_0x6c1c('0x14')][_0x6c1c('0x15')]===undefined?!![]:![]:!![],'where':_0x137770[_0x6c1c('0x14')]?_0x137770[_0x6c1c('0x14')][_0x6c1c('0x16')]||null:null,'attributes':_0x137770[_0x6c1c('0x14')]?_0x137770[_0x6c1c('0x14')][_0x6c1c('0x17')]||null:null,'limit':_0x137770[_0x6c1c('0x14')]?_0x137770[_0x6c1c('0x14')][_0x6c1c('0x18')]||null:null,'include':_0x137770[_0x6c1c('0x14')]?_0x137770[_0x6c1c('0x14')][_0x6c1c('0x19')]?_[_0x6c1c('0x1a')](_0x137770[_0x6c1c('0x14')][_0x6c1c('0x19')],function(_0x12c638){return{'model':db[_0x12c638[_0x6c1c('0x1b')]],'as':_0x12c638['as'],'attributes':_0x12c638[_0x6c1c('0x17')],'include':_0x12c638[_0x6c1c('0x19')]?_[_0x6c1c('0x1a')](_0x12c638[_0x6c1c('0x19')],function(_0x7ff10d){return{'model':db[_0x7ff10d[_0x6c1c('0x1b')]],'as':_0x7ff10d['as'],'attributes':_0x7ff10d[_0x6c1c('0x17')],'include':_0x7ff10d[_0x6c1c('0x19')]?_[_0x6c1c('0x1a')](_0x7ff10d[_0x6c1c('0x19')],function(_0x5f4568){return{'model':db[_0x5f4568[_0x6c1c('0x1b')]],'as':_0x5f4568['as'],'attributes':_0x5f4568['attributes']};}):[]};}):[]};}):[]:[]})[_0x6c1c('0x9')](function(_0x4c23f8){logger[_0x6c1c('0x11')]('GetMemberReport',_0x137770);logger[_0x6c1c('0xc')](_0x6c1c('0x1c'),_0x137770,JSON['stringify'](_0x4c23f8));_0x338dc2(_0x4c23f8);})[_0x6c1c('0x12')](function(_0x24da4c){logger['error'](_0x6c1c('0x1c'),_0x24da4c[_0x6c1c('0x10')],_0x137770);_0x1a0ab9(_0x4ede06[_0x6c1c('0xf')](0x1f4,_0x24da4c[_0x6c1c('0x10')]));});});};exports['CreateMemberReport']=function(_0x52c036){var _0x3cba17=this;return new Promise(function(_0x45128c,_0x21acef){return db[_0x6c1c('0x1d')][_0x6c1c('0x1e')](_0x52c036[_0x6c1c('0x1f')],{'raw':_0x52c036['options']?_0x52c036[_0x6c1c('0x14')][_0x6c1c('0x15')]===undefined?!![]:![]:!![]})['then'](function(_0x1b371d){logger[_0x6c1c('0x11')](_0x6c1c('0x20'),_0x52c036);logger[_0x6c1c('0xc')]('CreateMemberReport',_0x52c036,JSON[_0x6c1c('0xe')](_0x1b371d));_0x45128c(_0x1b371d);})[_0x6c1c('0x12')](function(_0x245433){logger['error'](_0x6c1c('0x20'),_0x245433['message'],_0x52c036);_0x21acef(_0x3cba17[_0x6c1c('0xf')](0x1f4,_0x245433['message']));});});};exports[_0x6c1c('0x21')]=function(_0x24d3e1){var _0x32916f=this;return new Promise(function(_0x54b8d3,_0x4f557a){return db[_0x6c1c('0x1d')][_0x6c1c('0x22')](_0x24d3e1[_0x6c1c('0x1f')],{'raw':_0x24d3e1['options']?_0x24d3e1[_0x6c1c('0x14')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24d3e1['options']?_0x24d3e1[_0x6c1c('0x14')][_0x6c1c('0x16')]||null:null,'attributes':_0x24d3e1[_0x6c1c('0x14')]?_0x24d3e1[_0x6c1c('0x14')]['attributes']||null:null,'limit':_0x24d3e1[_0x6c1c('0x14')]?_0x24d3e1[_0x6c1c('0x14')][_0x6c1c('0x18')]||null:null})[_0x6c1c('0x9')](function(_0x173a54){logger[_0x6c1c('0x11')](_0x6c1c('0x21'),_0x24d3e1);logger[_0x6c1c('0xc')](_0x6c1c('0x21'),_0x24d3e1,JSON[_0x6c1c('0xe')](_0x173a54));_0x54b8d3(_0x173a54);})['catch'](function(_0xb05b38){logger[_0x6c1c('0xf')](_0x6c1c('0x21'),_0xb05b38[_0x6c1c('0x10')],_0x24d3e1);_0x4f557a(_0x32916f[_0x6c1c('0xf')](0x1f4,_0xb05b38['message']));});});}; \ No newline at end of file +var _0x96e0=['MemberReport,\x20%s,\x20%s','debug','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','GetMemberReport','options','include','model','attributes','then','stringify','catch','CreateMemberReport','create','body','raw','MemberReport','update','where','limit','UpdateMemberReport','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','info'];(function(_0x402cf2,_0x534ce7){var _0x10ff22=function(_0x4ff065){while(--_0x4ff065){_0x402cf2['push'](_0x402cf2['shift']());}};_0x10ff22(++_0x534ce7);}(_0x96e0,0x7e));var _0x096e=function(_0x317cb6,_0x9f401e){_0x317cb6=_0x317cb6-0x0;var _0x1cb1f1=_0x96e0[_0x317cb6];return _0x1cb1f1;};'use strict';var _=require(_0x096e('0x0'));var util=require('util');var moment=require(_0x096e('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x096e('0x2'));var db=require(_0x096e('0x3'))['db'];var utils=require(_0x096e('0x4'));var logger=require(_0x096e('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x096e('0x6')][_0x096e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x23c5ab,_0x8c6e0c,_0x1f773){return new BPromise(function(_0x790c0c,_0x4a28b4){return client[_0x096e('0x8')](_0x23c5ab,_0x1f773)['then'](function(_0x19a954){logger[_0x096e('0x9')](_0x096e('0xa'),_0x8c6e0c,'request\x20sent');logger[_0x096e('0xb')](_0x096e('0xc'),_0x8c6e0c,_0x096e('0xd'),JSON['stringify'](_0x19a954));if(_0x19a954[_0x096e('0xe')]){if(_0x19a954[_0x096e('0xe')][_0x096e('0xf')]===0x1f4){logger[_0x096e('0xe')](_0x096e('0xa'),_0x8c6e0c,_0x19a954[_0x096e('0xe')][_0x096e('0x10')]);return _0x4a28b4(_0x19a954['error'][_0x096e('0x10')]);}logger[_0x096e('0xe')]('MemberReport,\x20%s,\x20%s',_0x8c6e0c,_0x19a954[_0x096e('0xe')][_0x096e('0x10')]);return _0x790c0c(_0x19a954[_0x096e('0xe')][_0x096e('0x10')]);}else{logger['info'](_0x096e('0xa'),_0x8c6e0c,_0x096e('0xd'));_0x790c0c(_0x19a954['result'][_0x096e('0x10')]);}})['catch'](function(_0x418e81){logger[_0x096e('0xe')](_0x096e('0xa'),_0x8c6e0c,_0x418e81);_0x4a28b4(_0x418e81);});});}exports[_0x096e('0x11')]=function(_0x396f57){var _0x38f8f0=this;return new Promise(function(_0x32da71,_0x50b29f){return db['MemberReport']['findAll']({'raw':_0x396f57[_0x096e('0x12')]?_0x396f57[_0x096e('0x12')]['raw']===undefined?!![]:![]:!![],'where':_0x396f57[_0x096e('0x12')]?_0x396f57[_0x096e('0x12')]['where']||null:null,'attributes':_0x396f57[_0x096e('0x12')]?_0x396f57['options']['attributes']||null:null,'limit':_0x396f57[_0x096e('0x12')]?_0x396f57[_0x096e('0x12')]['limit']||null:null,'include':_0x396f57[_0x096e('0x12')]?_0x396f57[_0x096e('0x12')][_0x096e('0x13')]?_['map'](_0x396f57['options'][_0x096e('0x13')],function(_0x4124b8){return{'model':db[_0x4124b8[_0x096e('0x14')]],'as':_0x4124b8['as'],'attributes':_0x4124b8[_0x096e('0x15')],'include':_0x4124b8[_0x096e('0x13')]?_['map'](_0x4124b8[_0x096e('0x13')],function(_0x5f5189){return{'model':db[_0x5f5189[_0x096e('0x14')]],'as':_0x5f5189['as'],'attributes':_0x5f5189[_0x096e('0x15')],'include':_0x5f5189[_0x096e('0x13')]?_['map'](_0x5f5189[_0x096e('0x13')],function(_0x56a2c3){return{'model':db[_0x56a2c3['model']],'as':_0x56a2c3['as'],'attributes':_0x56a2c3[_0x096e('0x15')]};}):[]};}):[]};}):[]:[]})[_0x096e('0x16')](function(_0x38027f){logger[_0x096e('0x9')](_0x096e('0x11'),_0x396f57);logger['debug'](_0x096e('0x11'),_0x396f57,JSON[_0x096e('0x17')](_0x38027f));_0x32da71(_0x38027f);})[_0x096e('0x18')](function(_0xe9a941){logger['error']('GetMemberReport',_0xe9a941[_0x096e('0x10')],_0x396f57);_0x50b29f(_0x38f8f0[_0x096e('0xe')](0x1f4,_0xe9a941[_0x096e('0x10')]));});});};exports[_0x096e('0x19')]=function(_0x424c33){var _0x11c585=this;return new Promise(function(_0x15f359,_0x2de062){return db['MemberReport'][_0x096e('0x1a')](_0x424c33[_0x096e('0x1b')],{'raw':_0x424c33['options']?_0x424c33[_0x096e('0x12')][_0x096e('0x1c')]===undefined?!![]:![]:!![]})[_0x096e('0x16')](function(_0x361499){logger['info'](_0x096e('0x19'),_0x424c33);logger[_0x096e('0xb')](_0x096e('0x19'),_0x424c33,JSON[_0x096e('0x17')](_0x361499));_0x15f359(_0x361499);})[_0x096e('0x18')](function(_0x49f8f2){logger[_0x096e('0xe')](_0x096e('0x19'),_0x49f8f2[_0x096e('0x10')],_0x424c33);_0x2de062(_0x11c585['error'](0x1f4,_0x49f8f2[_0x096e('0x10')]));});});};exports['UpdateMemberReport']=function(_0x53b50f){var _0x5bd524=this;return new Promise(function(_0x1ea29f,_0x67262a){return db[_0x096e('0x1d')][_0x096e('0x1e')](_0x53b50f[_0x096e('0x1b')],{'raw':_0x53b50f[_0x096e('0x12')]?_0x53b50f['options'][_0x096e('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x53b50f[_0x096e('0x12')]?_0x53b50f['options'][_0x096e('0x1f')]||null:null,'attributes':_0x53b50f[_0x096e('0x12')]?_0x53b50f[_0x096e('0x12')]['attributes']||null:null,'limit':_0x53b50f[_0x096e('0x12')]?_0x53b50f['options'][_0x096e('0x20')]||null:null})[_0x096e('0x16')](function(_0x2217ca){logger[_0x096e('0x9')](_0x096e('0x21'),_0x53b50f);logger[_0x096e('0xb')](_0x096e('0x21'),_0x53b50f,JSON[_0x096e('0x17')](_0x2217ca));_0x1ea29f(_0x2217ca);})[_0x096e('0x18')](function(_0x417182){logger['error'](_0x096e('0x21'),_0x417182['message'],_0x53b50f);_0x67262a(_0x5bd524[_0x096e('0xe')](0x1f4,_0x417182['message']));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index e96ab80..82d9bc4 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 _0xff7b=['multer','util','connect-timeout','express','fs-extra','../../components/auth/service','index','exports'];(function(_0x1af418,_0x578f1a){var _0x5d304b=function(_0x40bf4f){while(--_0x40bf4f){_0x1af418['push'](_0x1af418['shift']());}};_0x5d304b(++_0x578f1a);}(_0xff7b,0xe8));var _0xbff7=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xff7b[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0xbff7('0x0'));var util=require(_0xbff7('0x1'));var path=require('path');var timeout=require(_0xbff7('0x2'));var express=require(_0xbff7('0x3'));var router=express['Router']();var fs_extra=require(_0xbff7('0x4'));var auth=require(_0xbff7('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./migration.controller');router['get']('/',controller[_0xbff7('0x6')]);module[_0xbff7('0x7')]=router; \ No newline at end of file +var _0x7103=['../../components/auth/service','../../components/interaction/service','get','index','exports','multer','util','path','connect-timeout','fs-extra'];(function(_0x2d6d88,_0x2ea070){var _0x1991b0=function(_0x13b3fe){while(--_0x13b3fe){_0x2d6d88['push'](_0x2d6d88['shift']());}};_0x1991b0(++_0x2ea070);}(_0x7103,0x1db));var _0x3710=function(_0x2acb65,_0x2f59d5){_0x2acb65=_0x2acb65-0x0;var _0x504e1e=_0x7103[_0x2acb65];return _0x504e1e;};'use strict';var multer=require(_0x3710('0x0'));var util=require(_0x3710('0x1'));var path=require(_0x3710('0x2'));var timeout=require(_0x3710('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3710('0x4'));var auth=require(_0x3710('0x5'));var interaction=require(_0x3710('0x6'));var config=require('../../config/environment');var controller=require('./migration.controller');router[_0x3710('0x7')]('/',controller[_0x3710('0x8')]);module[_0x3710('0x9')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 884036c..49abc95 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 _0x97e7=['sequelize','exports','STRING','version'];(function(_0x265468,_0xcf7439){var _0x37d555=function(_0x47c742){while(--_0x47c742){_0x265468['push'](_0x265468['shift']());}};_0x37d555(++_0xcf7439);}(_0x97e7,0x100));var _0x797e=function(_0x1d475b,_0x14ba95){_0x1d475b=_0x1d475b-0x0;var _0x48edf2=_0x97e7[_0x1d475b];return _0x48edf2;};'use strict';var Sequelize=require(_0x797e('0x0'));module[_0x797e('0x1')]={'version':{'type':Sequelize[_0x797e('0x2')],'unique':_0x797e('0x3')}}; \ No newline at end of file +var _0x2611=['sequelize','exports','STRING','version'];(function(_0x2074db,_0x10b81b){var _0x27324c=function(_0x5c3d5c){while(--_0x5c3d5c){_0x2074db['push'](_0x2074db['shift']());}};_0x27324c(++_0x10b81b);}(_0x2611,0x114));var _0x1261=function(_0x100da0,_0x4181ec){_0x100da0=_0x100da0-0x0;var _0x27e744=_0x2611[_0x100da0];return _0x27e744;};'use strict';var Sequelize=require(_0x1261('0x0'));module[_0x1261('0x1')]={'version':{'type':Sequelize[_0x1261('0x2')],'unique':_0x1261('0x3')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 3e6516b..777a64b 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 _0x907d=['name','map','Migration','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','merge','where','VIRTUAL','filter','options','includeAll','findAll','then','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','to-csv','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','error','stack'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x907d,0x14b));var _0xd907=function(_0x22dac7,_0x45d32a){_0x22dac7=_0x22dac7-0x0;var _0x3e6cfa=_0x907d[_0x22dac7];return _0x3e6cfa;};'use strict';var emlformat=require(_0xd907('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd907('0x1'));var jsonpatch=require(_0xd907('0x2'));var rp=require(_0xd907('0x3'));var moment=require(_0xd907('0x4'));var BPromise=require(_0xd907('0x5'));var Mustache=require(_0xd907('0x6'));var util=require(_0xd907('0x7'));var path=require(_0xd907('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd907('0x9'));var fs=require('fs');var fs_extra=require(_0xd907('0xa'));var _=require(_0xd907('0xb'));var squel=require('squel');var crypto=require(_0xd907('0xc'));var jsforce=require(_0xd907('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd907('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd907('0xf'));var qs=require(_0xd907('0x10'));var as=require(_0xd907('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd907('0x12'))('api');var utils=require(_0xd907('0x13'));var config=require(_0xd907('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a4c95,_0x3c86ca){_0x3c86ca=_0x3c86ca||0xcc;return function(_0x12277a){if(_0x12277a){return _0x4a4c95[_0xd907('0x15')](_0x3c86ca);}return _0x4a4c95[_0xd907('0x16')](_0x3c86ca)['end']();};}function respondWithResult(_0x5b5610,_0xb78a8d){_0xb78a8d=_0xb78a8d||0xc8;return function(_0x37a6b2){if(_0x37a6b2){return _0x5b5610[_0xd907('0x16')](_0xb78a8d)[_0xd907('0x17')](_0x37a6b2);}};}function respondWithFilteredResult(_0x50f075,_0x3aecf4){return function(_0x2aca53){if(_0x2aca53){var _0x55288c=typeof _0x3aecf4[_0xd907('0x18')]===_0xd907('0x19')&&typeof _0x3aecf4[_0xd907('0x1a')]===_0xd907('0x19');var _0x21ac51=_0x2aca53['count'];var _0x4e3e58=_0x55288c?0x0:_0x3aecf4[_0xd907('0x18')];var _0x3c3af3=_0x55288c?_0x2aca53[_0xd907('0x1b')]:_0x3aecf4[_0xd907('0x18')]+_0x3aecf4[_0xd907('0x1a')];var _0x3e91f6;if(_0x3c3af3>=_0x21ac51){_0x3c3af3=_0x21ac51;_0x3e91f6=0xc8;}else{_0x3e91f6=0xce;}_0x50f075[_0xd907('0x16')](_0x3e91f6);return _0x50f075[_0xd907('0x1c')](_0xd907('0x1d'),_0x4e3e58+'-'+_0x3c3af3+'/'+_0x21ac51)['json'](_0x2aca53);}return null;};}function patchUpdates(_0x1cc409){return function(_0xcb8361){try{jsonpatch['apply'](_0xcb8361,_0x1cc409,!![]);}catch(_0x567723){return BPromise['reject'](_0x567723);}return _0xcb8361[_0xd907('0x1e')]();};}function saveUpdates(_0x369f48,_0x33b48d){return function(_0x33a9b5){if(_0x33a9b5){return _0x33a9b5[_0xd907('0x1f')](_0x369f48)['then'](function(_0x231d12){return _0x231d12;});}return null;};}function removeEntity(_0x2b2911,_0x196acc){return function(_0x1e2704){if(_0x1e2704){return _0x1e2704[_0xd907('0x20')]()['then'](function(){_0x2b2911[_0xd907('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9f6af,_0x209cf5){return function(_0x4948eb){if(!_0x4948eb){_0x9f6af['sendStatus'](0x194);}return _0x4948eb;};}function handleError(_0x1eeff3,_0x45da48){_0x45da48=_0x45da48||0x1f4;return function(_0x35095b){logger[_0xd907('0x21')](_0x35095b[_0xd907('0x22')]);if(_0x35095b[_0xd907('0x23')]){delete _0x35095b[_0xd907('0x23')];}_0x1eeff3['status'](_0x45da48)['send'](_0x35095b);};}exports['index']=function(_0x4f05d5,_0x45b87c){var _0x264379={},_0x56e46f={},_0x22bc90={'count':0x0,'rows':[]};var _0x28023d=_[_0xd907('0x24')](db[_0xd907('0x25')][_0xd907('0x26')],function(_0x5ca4aa){return{'name':_0x5ca4aa['fieldName'],'type':_0x5ca4aa[_0xd907('0x27')][_0xd907('0x28')]};});_0x56e46f[_0xd907('0x29')]=_[_0xd907('0x24')](_0x28023d,_0xd907('0x23'));_0x56e46f[_0xd907('0x2a')]=_[_0xd907('0x2b')](_0x4f05d5[_0xd907('0x2a')]);_0x56e46f[_0xd907('0x2c')]=_[_0xd907('0x2d')](_0x56e46f[_0xd907('0x29')],_0x56e46f['query']);_0x264379['attributes']=_[_0xd907('0x2d')](_0x56e46f[_0xd907('0x29')],qs[_0xd907('0x2e')](_0x4f05d5['query'][_0xd907('0x2e')]));_0x264379[_0xd907('0x2f')]=_0x264379[_0xd907('0x2f')]['length']?_0x264379[_0xd907('0x2f')]:_0x56e46f[_0xd907('0x29')];if(!_0x4f05d5[_0xd907('0x2a')][_0xd907('0x30')](_0xd907('0x31'))){_0x264379['limit']=qs[_0xd907('0x1a')](_0x4f05d5[_0xd907('0x2a')]['limit']);_0x264379['offset']=qs['offset'](_0x4f05d5[_0xd907('0x2a')][_0xd907('0x18')]);}_0x264379[_0xd907('0x32')]=qs['sort'](_0x4f05d5[_0xd907('0x2a')][_0xd907('0x33')]);_0x264379['where']=qs[_0xd907('0x2c')](_[_0xd907('0x34')](_0x4f05d5[_0xd907('0x2a')],_0x56e46f[_0xd907('0x2c')]),_0x28023d);if(_0x4f05d5['query']['filter']){_0x264379['where']=_[_0xd907('0x35')](_0x264379[_0xd907('0x36')],{'$or':_['map'](_0x28023d,function(_0x90e37a){if(_0x90e37a['type']!==_0xd907('0x37')){var _0x47fa43={};_0x47fa43[_0x90e37a[_0xd907('0x23')]]={'$like':'%'+_0x4f05d5[_0xd907('0x2a')][_0xd907('0x38')]+'%'};return _0x47fa43;}})});}_0x264379=_[_0xd907('0x35')]({},_0x264379,_0x4f05d5[_0xd907('0x39')]);var _0x306b17={'where':_0x264379[_0xd907('0x36')]};return db['Migration']['count'](_0x306b17)['then'](function(_0x517fa0){_0x22bc90['count']=_0x517fa0;if(_0x4f05d5['query'][_0xd907('0x3a')]){_0x264379['include']=[{'all':!![]}];}return db[_0xd907('0x25')][_0xd907('0x3b')](_0x264379);})['then'](function(_0xb7893c){_0x22bc90['rows']=_0xb7893c;return _0x22bc90;})[_0xd907('0x3c')](respondWithFilteredResult(_0x45b87c,_0x264379))['catch'](handleError(_0x45b87c,null));}; \ No newline at end of file +var _0x8ae2=['VIRTUAL','includeAll','include','findAll','rows','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','then','error','stack','name','send','Migration','fieldName','type','key','model','map','query','filters','attributes','fields','length','nolimit','sort','pick','filter','where','merge'];(function(_0x2503aa,_0x4ea0db){var _0x44f5e2=function(_0x49ca0d){while(--_0x49ca0d){_0x2503aa['push'](_0x2503aa['shift']());}};_0x44f5e2(++_0x4ea0db);}(_0x8ae2,0x140));var _0x28ae=function(_0x4b5a70,_0x42f61a){_0x4b5a70=_0x4b5a70-0x0;var _0x5bac61=_0x8ae2[_0x4b5a70];return _0x5bac61;};'use strict';var emlformat=require(_0x28ae('0x0'));var rimraf=require(_0x28ae('0x1'));var zipdir=require(_0x28ae('0x2'));var jsonpatch=require(_0x28ae('0x3'));var rp=require('request-promise');var moment=require(_0x28ae('0x4'));var BPromise=require(_0x28ae('0x5'));var Mustache=require('mustache');var util=require(_0x28ae('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x28ae('0x7'));var fs=require('fs');var fs_extra=require(_0x28ae('0x8'));var _=require(_0x28ae('0x9'));var squel=require(_0x28ae('0xa'));var crypto=require(_0x28ae('0xb'));var jsforce=require(_0x28ae('0xc'));var deskjs=require(_0x28ae('0xd'));var toCsv=require(_0x28ae('0xe'));var querystring=require('querystring');var Papa=require(_0x28ae('0xf'));var Redis=require(_0x28ae('0x10'));var authService=require(_0x28ae('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x28ae('0x12'));var hardwareService=require(_0x28ae('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x28ae('0x14'));var licenseUtil=require(_0x28ae('0x15'));var db=require(_0x28ae('0x16'))['db'];function respondWithStatusCode(_0x26e228,_0x53a917){_0x53a917=_0x53a917||0xcc;return function(_0x3083a4){if(_0x3083a4){return _0x26e228[_0x28ae('0x17')](_0x53a917);}return _0x26e228[_0x28ae('0x18')](_0x53a917)[_0x28ae('0x19')]();};}function respondWithResult(_0x3229e3,_0x52a096){_0x52a096=_0x52a096||0xc8;return function(_0x1b4704){if(_0x1b4704){return _0x3229e3[_0x28ae('0x18')](_0x52a096)[_0x28ae('0x1a')](_0x1b4704);}};}function respondWithFilteredResult(_0x48e4ed,_0x66c4fc){return function(_0x9966e0){if(_0x9966e0){var _0x8104e6=typeof _0x66c4fc[_0x28ae('0x1b')]===_0x28ae('0x1c')&&typeof _0x66c4fc[_0x28ae('0x1d')]===_0x28ae('0x1c');var _0x47a508=_0x9966e0['count'];var _0x90d212=_0x8104e6?0x0:_0x66c4fc[_0x28ae('0x1b')];var _0x4938c5=_0x8104e6?_0x9966e0[_0x28ae('0x1e')]:_0x66c4fc[_0x28ae('0x1b')]+_0x66c4fc['limit'];var _0x3ef524;if(_0x4938c5>=_0x47a508){_0x4938c5=_0x47a508;_0x3ef524=0xc8;}else{_0x3ef524=0xce;}_0x48e4ed['status'](_0x3ef524);return _0x48e4ed[_0x28ae('0x1f')](_0x28ae('0x20'),_0x90d212+'-'+_0x4938c5+'/'+_0x47a508)[_0x28ae('0x1a')](_0x9966e0);}return null;};}function patchUpdates(_0x1bd28f){return function(_0x2668b6){try{jsonpatch['apply'](_0x2668b6,_0x1bd28f,!![]);}catch(_0x50d4ed){return BPromise['reject'](_0x50d4ed);}return _0x2668b6[_0x28ae('0x21')]();};}function saveUpdates(_0x5410c3,_0x5d0ca1){return function(_0x172986){if(_0x172986){return _0x172986[_0x28ae('0x22')](_0x5410c3)['then'](function(_0xb660a4){return _0xb660a4;});}return null;};}function removeEntity(_0x3005ce,_0x184424){return function(_0x22134b){if(_0x22134b){return _0x22134b[_0x28ae('0x23')]()[_0x28ae('0x24')](function(){_0x3005ce[_0x28ae('0x18')](0xcc)[_0x28ae('0x19')]();});}};}function handleEntityNotFound(_0x30a875,_0x5ed4b5){return function(_0xc86528){if(!_0xc86528){_0x30a875[_0x28ae('0x17')](0x194);}return _0xc86528;};}function handleError(_0xfb21ef,_0x4bf5b6){_0x4bf5b6=_0x4bf5b6||0x1f4;return function(_0x1ab589){logger[_0x28ae('0x25')](_0x1ab589[_0x28ae('0x26')]);if(_0x1ab589[_0x28ae('0x27')]){delete _0x1ab589[_0x28ae('0x27')];}_0xfb21ef[_0x28ae('0x18')](_0x4bf5b6)[_0x28ae('0x28')](_0x1ab589);};}exports['index']=function(_0x5b571a,_0x58246f){var _0x58dea1={},_0x5e130d={},_0x57e0e6={'count':0x0,'rows':[]};var _0x5b5c3f=_['map'](db[_0x28ae('0x29')]['rawAttributes'],function(_0x2f1cf3){return{'name':_0x2f1cf3[_0x28ae('0x2a')],'type':_0x2f1cf3[_0x28ae('0x2b')][_0x28ae('0x2c')]};});_0x5e130d[_0x28ae('0x2d')]=_[_0x28ae('0x2e')](_0x5b5c3f,_0x28ae('0x27'));_0x5e130d[_0x28ae('0x2f')]=_['keys'](_0x5b571a['query']);_0x5e130d[_0x28ae('0x30')]=_['intersection'](_0x5e130d[_0x28ae('0x2d')],_0x5e130d[_0x28ae('0x2f')]);_0x58dea1[_0x28ae('0x31')]=_['intersection'](_0x5e130d[_0x28ae('0x2d')],qs['fields'](_0x5b571a['query'][_0x28ae('0x32')]));_0x58dea1[_0x28ae('0x31')]=_0x58dea1[_0x28ae('0x31')][_0x28ae('0x33')]?_0x58dea1[_0x28ae('0x31')]:_0x5e130d[_0x28ae('0x2d')];if(!_0x5b571a[_0x28ae('0x2f')]['hasOwnProperty'](_0x28ae('0x34'))){_0x58dea1[_0x28ae('0x1d')]=qs[_0x28ae('0x1d')](_0x5b571a[_0x28ae('0x2f')][_0x28ae('0x1d')]);_0x58dea1['offset']=qs['offset'](_0x5b571a[_0x28ae('0x2f')][_0x28ae('0x1b')]);}_0x58dea1['order']=qs[_0x28ae('0x35')](_0x5b571a[_0x28ae('0x2f')]['sort']);_0x58dea1['where']=qs[_0x28ae('0x30')](_[_0x28ae('0x36')](_0x5b571a[_0x28ae('0x2f')],_0x5e130d[_0x28ae('0x30')]),_0x5b5c3f);if(_0x5b571a['query'][_0x28ae('0x37')]){_0x58dea1[_0x28ae('0x38')]=_[_0x28ae('0x39')](_0x58dea1[_0x28ae('0x38')],{'$or':_[_0x28ae('0x2e')](_0x5b5c3f,function(_0x2792e5){if(_0x2792e5[_0x28ae('0x2b')]!==_0x28ae('0x3a')){var _0x171a16={};_0x171a16[_0x2792e5[_0x28ae('0x27')]]={'$like':'%'+_0x5b571a[_0x28ae('0x2f')][_0x28ae('0x37')]+'%'};return _0x171a16;}})});}_0x58dea1=_[_0x28ae('0x39')]({},_0x58dea1,_0x5b571a['options']);var _0x20da2d={'where':_0x58dea1[_0x28ae('0x38')]};return db['Migration'][_0x28ae('0x1e')](_0x20da2d)[_0x28ae('0x24')](function(_0x1372a8){_0x57e0e6['count']=_0x1372a8;if(_0x5b571a['query'][_0x28ae('0x3b')]){_0x58dea1[_0x28ae('0x3c')]=[{'all':!![]}];}return db[_0x28ae('0x29')][_0x28ae('0x3d')](_0x58dea1);})[_0x28ae('0x24')](function(_0x51851c){_0x57e0e6[_0x28ae('0x3e')]=_0x51851c;return _0x57e0e6;})['then'](respondWithFilteredResult(_0x58246f,_0x58dea1))['catch'](handleError(_0x58246f,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 94abade..803bbca 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 _0x1790=['lodash','../../config/logger','api','moment','rimraf','../../config/environment','./migration.attributes','exports','define','migrations'];(function(_0x50bf36,_0x1edc8c){var _0x15bac6=function(_0x15e7b7){while(--_0x15e7b7){_0x50bf36['push'](_0x50bf36['shift']());}};_0x15bac6(++_0x1edc8c);}(_0x1790,0x19a));var _0x0179=function(_0x5a4da7,_0x1ad425){_0x5a4da7=_0x5a4da7-0x0;var _0x39d9c9=_0x1790[_0x5a4da7];return _0x39d9c9;};'use strict';var _=require(_0x0179('0x0'));var util=require('util');var logger=require(_0x0179('0x1'))(_0x0179('0x2'));var moment=require(_0x0179('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0179('0x4'));var config=require(_0x0179('0x5'));var attributes=require(_0x0179('0x6'));module[_0x0179('0x7')]=function(_0x4e0de8,_0x5ffb92){return _0x4e0de8[_0x0179('0x8')]('Migration',attributes,{'tableName':_0x0179('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8525=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./migration.attributes','exports','define','migrations','util','../../config/logger','api'];(function(_0x2967c1,_0x202a72){var _0x103397=function(_0x14b5cc){while(--_0x14b5cc){_0x2967c1['push'](_0x2967c1['shift']());}};_0x103397(++_0x202a72);}(_0x8525,0xb3));var _0x5852=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x8525[_0x178e48];return _0x440d7e;};'use strict';var _=require('lodash');var util=require(_0x5852('0x0'));var logger=require(_0x5852('0x1'))(_0x5852('0x2'));var moment=require(_0x5852('0x3'));var BPromise=require(_0x5852('0x4'));var rp=require(_0x5852('0x5'));var fs=require('fs');var path=require(_0x5852('0x6'));var rimraf=require(_0x5852('0x7'));var config=require(_0x5852('0x8'));var attributes=require(_0x5852('0x9'));module[_0x5852('0xa')]=function(_0x3f3686,_0x512d5d){return _0x3f3686[_0x5852('0xb')]('Migration',attributes,{'tableName':_0x5852('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index 388e828..a35d774 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 _0xbe31=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Migration,\x20%s,\x20%s','util'];(function(_0x344252,_0xed61ee){var _0x586b80=function(_0x59ca9c){while(--_0x59ca9c){_0x344252['push'](_0x344252['shift']());}};_0x586b80(++_0xed61ee);}(_0xbe31,0x83));var _0x1be3=function(_0x545b1b,_0x5600f2){_0x545b1b=_0x545b1b-0x0;var _0x276f35=_0xbe31[_0x545b1b];return _0x276f35;};'use strict';var _=require('lodash');var util=require(_0x1be3('0x0'));var moment=require(_0x1be3('0x1'));var BPromise=require(_0x1be3('0x2'));var rs=require(_0x1be3('0x3'));var fs=require('fs');var Redis=require(_0x1be3('0x4'));var db=require(_0x1be3('0x5'))['db'];var utils=require(_0x1be3('0x6'));var logger=require(_0x1be3('0x7'))(_0x1be3('0x8'));var config=require('../../config/environment');var jayson=require(_0x1be3('0x9'));var client=jayson['client'][_0x1be3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa757b9,_0x3c925a,_0x2c3965){return new BPromise(function(_0x2bb749,_0x2e4488){return client[_0x1be3('0xb')](_0xa757b9,_0x2c3965)[_0x1be3('0xc')](function(_0x359742){logger[_0x1be3('0xd')]('Migration,\x20%s,\x20%s',_0x3c925a,_0x1be3('0xe'));logger[_0x1be3('0xf')](_0x1be3('0x10'),_0x3c925a,_0x1be3('0xe'),JSON[_0x1be3('0x11')](_0x359742));if(_0x359742[_0x1be3('0x12')]){if(_0x359742[_0x1be3('0x12')][_0x1be3('0x13')]===0x1f4){logger[_0x1be3('0x12')]('Migration,\x20%s,\x20%s',_0x3c925a,_0x359742[_0x1be3('0x12')]['message']);return _0x2e4488(_0x359742[_0x1be3('0x12')][_0x1be3('0x14')]);}logger['error'](_0x1be3('0x15'),_0x3c925a,_0x359742['error'][_0x1be3('0x14')]);return _0x2bb749(_0x359742[_0x1be3('0x12')][_0x1be3('0x14')]);}else{logger[_0x1be3('0xd')](_0x1be3('0x15'),_0x3c925a,_0x1be3('0xe'));_0x2bb749(_0x359742['result']['message']);}})['catch'](function(_0x52d2f2){logger[_0x1be3('0x12')]('Migration,\x20%s,\x20%s',_0x3c925a,_0x52d2f2);_0x2e4488(_0x52d2f2);});});} \ No newline at end of file +var _0x43c8=['client','http','then','Migration,\x20%s,\x20%s','debug','Migration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x43c8,0xaf));var _0x843c=function(_0x4c6cce,_0x280f27){_0x4c6cce=_0x4c6cce-0x0;var _0x4ef555=_0x43c8[_0x4c6cce];return _0x4ef555;};'use strict';var _=require('lodash');var util=require(_0x843c('0x0'));var moment=require('moment');var BPromise=require(_0x843c('0x1'));var rs=require(_0x843c('0x2'));var fs=require('fs');var Redis=require(_0x843c('0x3'));var db=require(_0x843c('0x4'))['db'];var utils=require(_0x843c('0x5'));var logger=require(_0x843c('0x6'))(_0x843c('0x7'));var config=require('../../config/environment');var jayson=require(_0x843c('0x8'));var client=jayson[_0x843c('0x9')][_0x843c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15bb1f,_0xd198e5,_0x49aee7){return new BPromise(function(_0x327327,_0x41f56d){return client['request'](_0x15bb1f,_0x49aee7)[_0x843c('0xb')](function(_0x566777){logger['info'](_0x843c('0xc'),_0xd198e5,'request\x20sent');logger[_0x843c('0xd')](_0x843c('0xe'),_0xd198e5,_0x843c('0xf'),JSON[_0x843c('0x10')](_0x566777));if(_0x566777['error']){if(_0x566777[_0x843c('0x11')][_0x843c('0x12')]===0x1f4){logger[_0x843c('0x11')](_0x843c('0xc'),_0xd198e5,_0x566777[_0x843c('0x11')][_0x843c('0x13')]);return _0x41f56d(_0x566777[_0x843c('0x11')][_0x843c('0x13')]);}logger[_0x843c('0x11')](_0x843c('0xc'),_0xd198e5,_0x566777[_0x843c('0x11')][_0x843c('0x13')]);return _0x327327(_0x566777[_0x843c('0x11')][_0x843c('0x13')]);}else{logger[_0x843c('0x14')]('Migration,\x20%s,\x20%s',_0xd198e5,_0x843c('0xf'));_0x327327(_0x566777[_0x843c('0x15')][_0x843c('0x13')]);}})[_0x843c('0x16')](function(_0x16e8f6){logger['error'](_0x843c('0xc'),_0xd198e5,_0x16e8f6);_0x41f56d(_0x16e8f6);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index b7edba4..d6bf762 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 _0x6c1a=['update','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','put','/:id'];(function(_0x13582d,_0x5548c2){var _0x486843=function(_0x1def5b){while(--_0x1def5b){_0x13582d['push'](_0x13582d['shift']());}};_0x486843(++_0x5548c2);}(_0x6c1a,0xf3));var _0xa6c1=function(_0x31324a,_0x275295){_0x31324a=_0x31324a-0x0;var _0x3a36de=_0x6c1a[_0x31324a];return _0x3a36de;};'use strict';var multer=require(_0xa6c1('0x0'));var util=require(_0xa6c1('0x1'));var path=require('path');var timeout=require(_0xa6c1('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xa6c1('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa6c1('0x4'));var config=require(_0xa6c1('0x5'));var controller=require('./network.controller');router[_0xa6c1('0x6')]('/',auth[_0xa6c1('0x7')](),controller[_0xa6c1('0x8')]);router[_0xa6c1('0x6')]('/:id',auth[_0xa6c1('0x7')](),controller[_0xa6c1('0x9')]);router[_0xa6c1('0xa')]('/',auth[_0xa6c1('0x7')](),controller['create']);router[_0xa6c1('0xb')](_0xa6c1('0xc'),auth[_0xa6c1('0x7')](),controller[_0xa6c1('0xd')]);router['delete']('/:id',auth[_0xa6c1('0x7')](),controller[_0xa6c1('0xe')]);module[_0xa6c1('0xf')]=router; \ No newline at end of file +var _0x4329=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','multer','util','path','connect-timeout','express'];(function(_0x253cd8,_0x5f0e6b){var _0x11aed6=function(_0x34e8be){while(--_0x34e8be){_0x253cd8['push'](_0x253cd8['shift']());}};_0x11aed6(++_0x5f0e6b);}(_0x4329,0x13b));var _0x9432=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x4329[_0x311c35];return _0x5cc50c;};'use strict';var multer=require(_0x9432('0x0'));var util=require(_0x9432('0x1'));var path=require(_0x9432('0x2'));var timeout=require(_0x9432('0x3'));var express=require(_0x9432('0x4'));var router=express[_0x9432('0x5')]();var fs_extra=require(_0x9432('0x6'));var auth=require(_0x9432('0x7'));var interaction=require(_0x9432('0x8'));var config=require(_0x9432('0x9'));var controller=require(_0x9432('0xa'));router[_0x9432('0xb')]('/',auth[_0x9432('0xc')](),controller[_0x9432('0xd')]);router['get'](_0x9432('0xe'),auth['isAuthenticated'](),controller[_0x9432('0xf')]);router[_0x9432('0x10')]('/',auth['isAuthenticated'](),controller[_0x9432('0x11')]);router[_0x9432('0x12')](_0x9432('0xe'),auth[_0x9432('0xc')](),controller[_0x9432('0x13')]);router['delete'](_0x9432('0xe'),auth[_0x9432('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 994715c..f5ef725 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 _0xcb29=['STRING','sequelize','exports','localnet','externip','stun'];(function(_0x10ad23,_0x23fecc){var _0x326910=function(_0x17eb02){while(--_0x17eb02){_0x10ad23['push'](_0x10ad23['shift']());}};_0x326910(++_0x23fecc);}(_0xcb29,0x169));var _0x9cb2=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xcb29[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require(_0x9cb2('0x0'));module[_0x9cb2('0x1')]={'type':{'type':Sequelize['ENUM'](_0x9cb2('0x2'),_0x9cb2('0x3'),_0x9cb2('0x4'),'turn')},'value':{'type':Sequelize[_0x9cb2('0x5')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa5b1=['stun','turn','STRING','sequelize','ENUM','localnet'];(function(_0x49bacf,_0x189a31){var _0xf6df4d=function(_0x44c26b){while(--_0x44c26b){_0x49bacf['push'](_0x49bacf['shift']());}};_0xf6df4d(++_0x189a31);}(_0xa5b1,0x159));var _0x1a5b=function(_0x1a69df,_0xaad1db){_0x1a69df=_0x1a69df-0x0;var _0xb82082=_0xa5b1[_0x1a69df];return _0xb82082;};'use strict';var Sequelize=require(_0x1a5b('0x0'));module['exports']={'type':{'type':Sequelize[_0x1a5b('0x1')](_0x1a5b('0x2'),'externip',_0x1a5b('0x3'),_0x1a5b('0x4'))},'value':{'type':Sequelize[_0x1a5b('0x5')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x1a5b('0x5')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index f0209a3..7299e75 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 _0xc770=['body','update','transaction','toUpperCase','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','request','then','info','Network,\x20%s,\x20%s','Network,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','destroy','stack','name','send','index','map','Network','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','create','sequelize','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','render','format'];(function(_0x15b4f9,_0x118471){var _0x567026=function(_0xb8ee8){while(--_0xb8ee8){_0x15b4f9['push'](_0x15b4f9['shift']());}};_0x567026(++_0x118471);}(_0xc770,0xd3));var _0x0c77=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc770[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x0c77('0x0'));var rimraf=require(_0x0c77('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0c77('0x2'));var moment=require(_0x0c77('0x3'));var BPromise=require(_0x0c77('0x4'));var Mustache=require(_0x0c77('0x5'));var util=require(_0x0c77('0x6'));var path=require(_0x0c77('0x7'));var sox=require(_0x0c77('0x8'));var csv=require(_0x0c77('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0c77('0xa'));var _=require(_0x0c77('0xb'));var squel=require('squel');var crypto=require(_0x0c77('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x0c77('0xd'));var toCsv=require(_0x0c77('0x9'));var querystring=require(_0x0c77('0xe'));var Papa=require('papaparse');var Redis=require(_0x0c77('0xf'));var authService=require(_0x0c77('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0c77('0x11'));var logger=require('../../config/logger')(_0x0c77('0x12'));var utils=require(_0x0c77('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x0c77('0x14'));var db=require(_0x0c77('0x15'))['db'];var jayson=require(_0x0c77('0x16'));var client=jayson[_0x0c77('0x17')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52eec1,_0x525e76,_0x466ac8,_0x8f7538){return new BPromise(function(_0x11a7ad,_0x29b1d0){var _0x4f38ec=_0x8f7538||client;return _0x4f38ec[_0x0c77('0x18')](_0x52eec1,_0x466ac8)[_0x0c77('0x19')](function(_0x4f7b5c){logger[_0x0c77('0x1a')](_0x0c77('0x1b'),_0x525e76,'request\x20sent');logger['debug'](_0x0c77('0x1c'),_0x525e76,_0x0c77('0x1d'),JSON['stringify'](_0x4f7b5c));if(_0x4f7b5c['error']){if(_0x4f7b5c[_0x0c77('0x1e')][_0x0c77('0x1f')]===0x1f4){logger[_0x0c77('0x1e')](_0x0c77('0x1b'),_0x525e76,_0x4f7b5c['error'][_0x0c77('0x20')]);return _0x29b1d0(_0x4f7b5c[_0x0c77('0x1e')][_0x0c77('0x20')]);}logger['error'](_0x0c77('0x1b'),_0x525e76,_0x4f7b5c[_0x0c77('0x1e')]['message']);return _0x11a7ad(_0x4f7b5c['error']['message']);}else{logger[_0x0c77('0x1a')](_0x0c77('0x1b'),_0x525e76,_0x0c77('0x1d'));_0x11a7ad(_0x4f7b5c[_0x0c77('0x21')][_0x0c77('0x20')]);}})[_0x0c77('0x22')](function(_0x30b77c){logger['error'](_0x0c77('0x1b'),_0x525e76,_0x30b77c);_0x29b1d0(_0x30b77c);});});}function respondWithStatusCode(_0x51097c,_0x2efe50){_0x2efe50=_0x2efe50||0xcc;return function(_0x5a6ae4){if(_0x5a6ae4){return _0x51097c[_0x0c77('0x23')](_0x2efe50);}return _0x51097c[_0x0c77('0x24')](_0x2efe50)[_0x0c77('0x25')]();};}function respondWithResult(_0x2802d1,_0x10768c){_0x10768c=_0x10768c||0xc8;return function(_0x4e787a){if(_0x4e787a){return _0x2802d1[_0x0c77('0x24')](_0x10768c)[_0x0c77('0x26')](_0x4e787a);}};}function respondWithFilteredResult(_0xec97c,_0x3c9b87){return function(_0x334353){if(_0x334353){var _0x4495cc=typeof _0x3c9b87[_0x0c77('0x27')]===_0x0c77('0x28')&&typeof _0x3c9b87[_0x0c77('0x29')]==='undefined';var _0x4b0edf=_0x334353[_0x0c77('0x2a')];var _0x549c06=_0x4495cc?0x0:_0x3c9b87[_0x0c77('0x27')];var _0xe4bf97=_0x4495cc?_0x334353[_0x0c77('0x2a')]:_0x3c9b87[_0x0c77('0x27')]+_0x3c9b87['limit'];var _0x33b6d0;if(_0xe4bf97>=_0x4b0edf){_0xe4bf97=_0x4b0edf;_0x33b6d0=0xc8;}else{_0x33b6d0=0xce;}_0xec97c['status'](_0x33b6d0);return _0xec97c[_0x0c77('0x2b')]('Content-Range',_0x549c06+'-'+_0xe4bf97+'/'+_0x4b0edf)['json'](_0x334353);}return null;};}function patchUpdates(_0x4029bb){return function(_0x184f73){try{jsonpatch[_0x0c77('0x2c')](_0x184f73,_0x4029bb,!![]);}catch(_0x2d55d4){return BPromise[_0x0c77('0x2d')](_0x2d55d4);}return _0x184f73['save']();};}function saveUpdates(_0x53a034,_0x57295e){return function(_0x3b2c86){if(_0x3b2c86){return _0x3b2c86['update'](_0x53a034)[_0x0c77('0x19')](function(_0x27e658){return _0x27e658;});}return null;};}function removeEntity(_0x3f6319,_0x4e3b52){return function(_0x362b01){if(_0x362b01){return _0x362b01[_0x0c77('0x2e')]()[_0x0c77('0x19')](function(){_0x3f6319['status'](0xcc)[_0x0c77('0x25')]();});}};}function handleEntityNotFound(_0x4e1b6c,_0x58e5be){return function(_0x57bc73){if(!_0x57bc73){_0x4e1b6c[_0x0c77('0x23')](0x194);}return _0x57bc73;};}function handleError(_0x190226,_0x4cc088){_0x4cc088=_0x4cc088||0x1f4;return function(_0x577866){logger['error'](_0x577866[_0x0c77('0x2f')]);if(_0x577866['name']){delete _0x577866[_0x0c77('0x30')];}_0x190226[_0x0c77('0x24')](_0x4cc088)[_0x0c77('0x31')](_0x577866);};}exports[_0x0c77('0x32')]=function(_0x8b5bf0,_0x4ad9d5){var _0x14b501={},_0x3a13e8={},_0x501455={'count':0x0,'rows':[]};var _0x1fec4c=_[_0x0c77('0x33')](db[_0x0c77('0x34')][_0x0c77('0x35')],function(_0x407a21){return{'name':_0x407a21['fieldName'],'type':_0x407a21[_0x0c77('0x36')][_0x0c77('0x37')]};});_0x3a13e8[_0x0c77('0x38')]=_[_0x0c77('0x33')](_0x1fec4c,_0x0c77('0x30'));_0x3a13e8[_0x0c77('0x39')]=_[_0x0c77('0x3a')](_0x8b5bf0['query']);_0x3a13e8[_0x0c77('0x3b')]=_[_0x0c77('0x3c')](_0x3a13e8[_0x0c77('0x38')],_0x3a13e8[_0x0c77('0x39')]);_0x14b501[_0x0c77('0x3d')]=_['intersection'](_0x3a13e8[_0x0c77('0x38')],qs[_0x0c77('0x3e')](_0x8b5bf0[_0x0c77('0x39')]['fields']));_0x14b501[_0x0c77('0x3d')]=_0x14b501['attributes'][_0x0c77('0x3f')]?_0x14b501[_0x0c77('0x3d')]:_0x3a13e8['model'];if(!_0x8b5bf0['query'][_0x0c77('0x40')]('nolimit')){_0x14b501[_0x0c77('0x29')]=qs[_0x0c77('0x29')](_0x8b5bf0[_0x0c77('0x39')]['limit']);_0x14b501[_0x0c77('0x27')]=qs['offset'](_0x8b5bf0[_0x0c77('0x39')][_0x0c77('0x27')]);}_0x14b501['order']=qs[_0x0c77('0x41')](_0x8b5bf0[_0x0c77('0x39')][_0x0c77('0x41')]);_0x14b501[_0x0c77('0x42')]=qs[_0x0c77('0x3b')](_[_0x0c77('0x43')](_0x8b5bf0[_0x0c77('0x39')],_0x3a13e8[_0x0c77('0x3b')]),_0x1fec4c);if(_0x8b5bf0[_0x0c77('0x39')]['filter']){_0x14b501['where']=_[_0x0c77('0x44')](_0x14b501[_0x0c77('0x42')],{'$or':_[_0x0c77('0x33')](_0x1fec4c,function(_0x556ab4){if(_0x556ab4[_0x0c77('0x36')]!==_0x0c77('0x45')){var _0xb08baa={};_0xb08baa[_0x556ab4[_0x0c77('0x30')]]={'$like':'%'+_0x8b5bf0[_0x0c77('0x39')]['filter']+'%'};return _0xb08baa;}})});}_0x14b501=_['merge']({},_0x14b501,_0x8b5bf0[_0x0c77('0x46')]);var _0x12db07={'where':_0x14b501[_0x0c77('0x42')]};return db[_0x0c77('0x34')][_0x0c77('0x2a')](_0x12db07)[_0x0c77('0x19')](function(_0x2de6c1){_0x501455[_0x0c77('0x2a')]=_0x2de6c1;if(_0x8b5bf0[_0x0c77('0x39')][_0x0c77('0x47')]){_0x14b501[_0x0c77('0x48')]=[{'all':!![]}];}return db[_0x0c77('0x34')][_0x0c77('0x49')](_0x14b501);})[_0x0c77('0x19')](function(_0x3ac417){_0x501455['rows']=_0x3ac417;return _0x501455;})[_0x0c77('0x19')](respondWithFilteredResult(_0x4ad9d5,_0x14b501))[_0x0c77('0x22')](handleError(_0x4ad9d5,null));};exports[_0x0c77('0x4a')]=function(_0xa9d2b0,_0xd43381){var _0x36e361={'raw':!![],'where':{'id':_0xa9d2b0[_0x0c77('0x4b')]['id']}},_0x4c1c8f={};_0x4c1c8f[_0x0c77('0x38')]=_[_0x0c77('0x3a')](db['Network'][_0x0c77('0x35')]);_0x4c1c8f[_0x0c77('0x39')]=_[_0x0c77('0x3a')](_0xa9d2b0[_0x0c77('0x39')]);_0x4c1c8f['filters']=_[_0x0c77('0x3c')](_0x4c1c8f[_0x0c77('0x38')],_0x4c1c8f['query']);_0x36e361[_0x0c77('0x3d')]=_[_0x0c77('0x3c')](_0x4c1c8f[_0x0c77('0x38')],qs[_0x0c77('0x3e')](_0xa9d2b0[_0x0c77('0x39')]['fields']));_0x36e361[_0x0c77('0x3d')]=_0x36e361[_0x0c77('0x3d')]['length']?_0x36e361[_0x0c77('0x3d')]:_0x4c1c8f['model'];if(_0xa9d2b0[_0x0c77('0x39')]['includeAll']){_0x36e361['include']=[{'all':!![]}];}_0x36e361=_[_0x0c77('0x44')]({},_0x36e361,_0xa9d2b0['options']);return db[_0x0c77('0x34')][_0x0c77('0x4c')](_0x36e361)[_0x0c77('0x19')](handleEntityNotFound(_0xd43381,null))[_0x0c77('0x19')](respondWithResult(_0xd43381,null))['catch'](handleError(_0xd43381,null));};exports[_0x0c77('0x4d')]=function(_0x1d3e81,_0x3da0cd,_0x26ddea){var _0xbb11c1;return db[_0x0c77('0x4e')]['transaction'](function(_0x22f3dd){return db[_0x0c77('0x34')][_0x0c77('0x4d')](_0x1d3e81['body'],{'raw':!![]})[_0x0c77('0x19')](function(_0x45f78c){_0xbb11c1=_0x45f78c;return db[_0x0c77('0x34')][_0x0c77('0x49')]({'where':{'type':_0x1d3e81['body'][_0x0c77('0x36')]},'raw':!![]});})[_0x0c77('0x19')](function(_0x381cde){if(_0xbb11c1[_0x0c77('0x36')]['toUpperCase']()==_0x0c77('0x4f')){var _0x11484f=fs[_0x0c77('0x50')](path[_0x0c77('0x51')](config[_0x0c77('0x52')],_0x0c77('0x53')),_0x0c77('0x54'));var _0x12de46=ejs['render'](_0x11484f,{'networks':_0x381cde||[]});fs[_0x0c77('0x55')](_0x0c77('0x56'),_0x12de46);return respondWithRpcPromise(_0x0c77('0x57'),_0x0c77('0x4d'),{'module':_0x0c77('0x58')});}else if(_0xbb11c1[_0x0c77('0x36')]['toUpperCase']()==_0x0c77('0x59')){var _0x167282=fs[_0x0c77('0x50')](path['join'](config[_0x0c77('0x52')],_0x0c77('0x5a')),_0x0c77('0x54'));var _0x1852d7=ejs['render'](_0x167282,{'networks':_0x381cde||[]});fs[_0x0c77('0x55')](_0x0c77('0x5b'),_0x1852d7);return respondWithRpcPromise(_0x0c77('0x57'),'create',{'module':'res_stun_monitor.so'});}else{var _0xef431f=fs[_0x0c77('0x50')](path['join'](config[_0x0c77('0x52')],_0x0c77('0x5c')),_0x0c77('0x54'));var _0x1ec8c7=ejs[_0x0c77('0x5d')](_0xef431f,{'networks':_0x381cde||[]});fs[_0x0c77('0x55')](util[_0x0c77('0x5e')]('/etc/asterisk/sip_xcally_%s.conf',_0x1d3e81[_0x0c77('0x5f')][_0x0c77('0x36')]['toLowerCase']()),_0x1ec8c7);return respondWithRpcPromise(_0x0c77('0x57'),_0x0c77('0x4d'),{'module':'chan_sip.so'});}return null;})[_0x0c77('0x19')](function(){return _0xbb11c1;});})['then'](respondWithResult(_0x3da0cd,0xc9))[_0x0c77('0x22')](handleError(_0x3da0cd,null));};exports[_0x0c77('0x60')]=function(_0x26483e,_0xa1cae8,_0x5363ff){var _0x1975d1;return db[_0x0c77('0x4e')][_0x0c77('0x61')](function(_0x1fdbcf){return db[_0x0c77('0x34')]['find']({'where':{'id':_0x26483e[_0x0c77('0x4b')]['id']}})[_0x0c77('0x19')](handleEntityNotFound(_0xa1cae8,null))[_0x0c77('0x19')](saveUpdates(_0x26483e['body'],null))[_0x0c77('0x19')](function(_0x2883cd){if(_0x2883cd){_0x1975d1=_0x2883cd;return db[_0x0c77('0x34')][_0x0c77('0x49')]({'where':{'type':_0x1975d1[_0x0c77('0x36')]},'raw':!![]});}return null;})[_0x0c77('0x19')](function(_0x3be819){if(_0x1975d1['type'][_0x0c77('0x62')]()==_0x0c77('0x4f')){var _0x1272cb=fs[_0x0c77('0x50')](path[_0x0c77('0x51')](config[_0x0c77('0x52')],_0x0c77('0x53')),_0x0c77('0x54'));var _0x5d00e1=ejs[_0x0c77('0x5d')](_0x1272cb,{'networks':_0x3be819||[]});fs[_0x0c77('0x55')]('/etc/asterisk/stun_xcally.conf',_0x5d00e1);return respondWithRpcPromise(_0x0c77('0x57'),_0x0c77('0x60'),{'module':_0x0c77('0x58')});}else if(_0x1975d1['type'][_0x0c77('0x62')]()==_0x0c77('0x59')){var _0x22f3a9=fs[_0x0c77('0x50')](path[_0x0c77('0x51')](config[_0x0c77('0x52')],_0x0c77('0x5a')),_0x0c77('0x54'));var _0x1adcbc=ejs[_0x0c77('0x5d')](_0x22f3a9,{'networks':_0x3be819||[]});fs[_0x0c77('0x55')]('/etc/asterisk/turn_xcally.conf',_0x1adcbc);return respondWithRpcPromise(_0x0c77('0x57'),'update',{'module':_0x0c77('0x58')});}else{var _0x58dce3=fs['readFileSync'](path['join'](config['root'],'server/files/templates/network.ejs'),_0x0c77('0x54'));var _0x520694=ejs[_0x0c77('0x5d')](_0x58dce3,{'networks':_0x3be819||[]});fs[_0x0c77('0x55')](util[_0x0c77('0x5e')](_0x0c77('0x63'),_0x26483e[_0x0c77('0x5f')][_0x0c77('0x36')][_0x0c77('0x64')]()),_0x520694);return respondWithRpcPromise('Reload',_0x0c77('0x60'),{'module':_0x0c77('0x65')});}return null;})[_0x0c77('0x19')](function(_0x3cbde3){if(_0x3cbde3){return _0x1975d1;}return null;});})[_0x0c77('0x19')](respondWithResult(_0xa1cae8,null))[_0x0c77('0x22')](handleError(_0xa1cae8,null));};exports[_0x0c77('0x2e')]=function(_0x3c7a1a,_0x32122c,_0x3cfa94){var _0x1e6b1e;return db[_0x0c77('0x34')]['find']({'where':{'id':_0x3c7a1a[_0x0c77('0x4b')]['id']}})['then'](function(_0x1f5f1b){_0x1e6b1e=_0x1f5f1b;return _0x1f5f1b;})[_0x0c77('0x19')](handleEntityNotFound(_0x32122c,null))[_0x0c77('0x19')](removeEntity(_0x32122c,null))[_0x0c77('0x19')](function(){if(_0x1e6b1e){return db[_0x0c77('0x34')][_0x0c77('0x49')]({'where':{'type':_0x1e6b1e[_0x0c77('0x36')]},'raw':!![]});}})[_0x0c77('0x19')](function(_0x371c05){if(_0x1e6b1e[_0x0c77('0x36')][_0x0c77('0x62')]()==_0x0c77('0x4f')){var _0x29999e=fs['readFileSync'](path[_0x0c77('0x51')](config[_0x0c77('0x52')],'server/files/templates/stun_multiple.ejs'),_0x0c77('0x54'));var _0xe5f350=ejs[_0x0c77('0x5d')](_0x29999e,{'networks':_0x371c05||[]});fs[_0x0c77('0x55')](_0x0c77('0x56'),_0xe5f350);return respondWithRpcPromise('Reload',_0x0c77('0x2e'),{'module':_0x0c77('0x58')});}else if(_0x1e6b1e[_0x0c77('0x36')][_0x0c77('0x62')]()=='TURN'){var _0x3f70bd=fs[_0x0c77('0x50')](path[_0x0c77('0x51')](config[_0x0c77('0x52')],_0x0c77('0x5a')),_0x0c77('0x54'));var _0x30644c=ejs[_0x0c77('0x5d')](_0x3f70bd,{'networks':_0x371c05||[]});fs[_0x0c77('0x55')](_0x0c77('0x5b'),_0x30644c);return respondWithRpcPromise(_0x0c77('0x57'),_0x0c77('0x2e'),{'module':_0x0c77('0x58')});}else{var _0x428830=fs['readFileSync'](path[_0x0c77('0x51')](config[_0x0c77('0x52')],_0x0c77('0x5c')),_0x0c77('0x54'));var _0x33a100=ejs[_0x0c77('0x5d')](_0x428830,{'networks':_0x371c05||[]});fs['writeFileSync'](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0x3c7a1a[_0x0c77('0x5f')]['type'][_0x0c77('0x64')]()),_0x33a100);return respondWithRpcPromise(_0x0c77('0x57'),_0x0c77('0x2e'),{'module':_0x0c77('0x65')});}return null;})['catch'](handleError(_0x32122c,null));}; \ No newline at end of file +var _0x9658=['http','request','then','info','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','Network,\x20%s,\x20%s','message','result','sendStatus','end','status','json','offset','limit','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','fieldName','type','key','model','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','map','Network','rows','catch','show','keys','rawAttributes','length','includeAll','include','options','find','transaction','create','body','toUpperCase','readFileSync','root','server/files/templates/stun_multiple.ejs','utf8','writeFileSync','Reload','res_stun_monitor.so','TURN','join','server/files/templates/turn_multiple.ejs','render','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','toLowerCase','chan_sip.so','sequelize','params','STUN','/etc/asterisk/stun_xcally.conf','/etc/asterisk/sip_xcally_%s.conf','eml-format','rimraf','zip-dir','fast-json-patch','util','sox','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','client'];(function(_0x8d3499,_0x16cda5){var _0x30dee7=function(_0xf65166){while(--_0xf65166){_0x8d3499['push'](_0x8d3499['shift']());}};_0x30dee7(++_0x16cda5);}(_0x9658,0xba));var _0x8965=function(_0x17823f,_0xffd807){_0x17823f=_0x17823f-0x0;var _0x51fc21=_0x9658[_0x17823f];return _0x51fc21;};'use strict';var emlformat=require(_0x8965('0x0'));var rimraf=require(_0x8965('0x1'));var zipdir=require(_0x8965('0x2'));var jsonpatch=require(_0x8965('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8965('0x4'));var path=require('path');var sox=require(_0x8965('0x5'));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(_0x8965('0x6'));var crypto=require(_0x8965('0x7'));var jsforce=require(_0x8965('0x8'));var deskjs=require(_0x8965('0x9'));var toCsv=require('to-csv');var querystring=require(_0x8965('0xa'));var Papa=require('papaparse');var Redis=require(_0x8965('0xb'));var authService=require(_0x8965('0xc'));var qs=require(_0x8965('0xd'));var as=require(_0x8965('0xe'));var hardwareService=require(_0x8965('0xf'));var logger=require('../../config/logger')(_0x8965('0x10'));var utils=require(_0x8965('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x8965('0x12'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0x8965('0x13')][_0x8965('0x14')]({'port':0x232a});function respondWithRpcPromise(_0x39788d,_0x4ad849,_0x34edc4,_0x172949){return new BPromise(function(_0x47a1cb,_0x5ed325){var _0x301a90=_0x172949||client;return _0x301a90[_0x8965('0x15')](_0x39788d,_0x34edc4)[_0x8965('0x16')](function(_0x306611){logger[_0x8965('0x17')]('Network,\x20%s,\x20%s',_0x4ad849,_0x8965('0x18'));logger[_0x8965('0x19')](_0x8965('0x1a'),_0x4ad849,'request\x20sent',JSON[_0x8965('0x1b')](_0x306611));if(_0x306611[_0x8965('0x1c')]){if(_0x306611[_0x8965('0x1c')]['code']===0x1f4){logger[_0x8965('0x1c')](_0x8965('0x1d'),_0x4ad849,_0x306611[_0x8965('0x1c')][_0x8965('0x1e')]);return _0x5ed325(_0x306611[_0x8965('0x1c')]['message']);}logger['error'](_0x8965('0x1d'),_0x4ad849,_0x306611[_0x8965('0x1c')][_0x8965('0x1e')]);return _0x47a1cb(_0x306611[_0x8965('0x1c')][_0x8965('0x1e')]);}else{logger[_0x8965('0x17')](_0x8965('0x1d'),_0x4ad849,_0x8965('0x18'));_0x47a1cb(_0x306611[_0x8965('0x1f')]['message']);}})['catch'](function(_0x482246){logger['error'](_0x8965('0x1d'),_0x4ad849,_0x482246);_0x5ed325(_0x482246);});});}function respondWithStatusCode(_0x208555,_0x1bba3a){_0x1bba3a=_0x1bba3a||0xcc;return function(_0x11deb3){if(_0x11deb3){return _0x208555[_0x8965('0x20')](_0x1bba3a);}return _0x208555['status'](_0x1bba3a)[_0x8965('0x21')]();};}function respondWithResult(_0x3f5197,_0x2eb0ef){_0x2eb0ef=_0x2eb0ef||0xc8;return function(_0x404c55){if(_0x404c55){return _0x3f5197[_0x8965('0x22')](_0x2eb0ef)[_0x8965('0x23')](_0x404c55);}};}function respondWithFilteredResult(_0x39c924,_0x5a7c41){return function(_0x2049de){if(_0x2049de){var _0x2228b4=typeof _0x5a7c41[_0x8965('0x24')]==='undefined'&&typeof _0x5a7c41[_0x8965('0x25')]==='undefined';var _0x578e0e=_0x2049de[_0x8965('0x26')];var _0x1c4215=_0x2228b4?0x0:_0x5a7c41[_0x8965('0x24')];var _0x396812=_0x2228b4?_0x2049de[_0x8965('0x26')]:_0x5a7c41[_0x8965('0x24')]+_0x5a7c41['limit'];var _0x4feca9;if(_0x396812>=_0x578e0e){_0x396812=_0x578e0e;_0x4feca9=0xc8;}else{_0x4feca9=0xce;}_0x39c924['status'](_0x4feca9);return _0x39c924[_0x8965('0x27')](_0x8965('0x28'),_0x1c4215+'-'+_0x396812+'/'+_0x578e0e)[_0x8965('0x23')](_0x2049de);}return null;};}function patchUpdates(_0x21a356){return function(_0x30a046){try{jsonpatch[_0x8965('0x29')](_0x30a046,_0x21a356,!![]);}catch(_0x1b4314){return BPromise[_0x8965('0x2a')](_0x1b4314);}return _0x30a046[_0x8965('0x2b')]();};}function saveUpdates(_0x3ac3d8,_0x3f57aa){return function(_0x29aec9){if(_0x29aec9){return _0x29aec9[_0x8965('0x2c')](_0x3ac3d8)[_0x8965('0x16')](function(_0x1d1f42){return _0x1d1f42;});}return null;};}function removeEntity(_0x3cde99,_0x4f5f47){return function(_0x5e12d7){if(_0x5e12d7){return _0x5e12d7[_0x8965('0x2d')]()[_0x8965('0x16')](function(){_0x3cde99['status'](0xcc)[_0x8965('0x21')]();});}};}function handleEntityNotFound(_0x3be773,_0x541b4c){return function(_0x748e01){if(!_0x748e01){_0x3be773['sendStatus'](0x194);}return _0x748e01;};}function handleError(_0x179245,_0xff35d7){_0xff35d7=_0xff35d7||0x1f4;return function(_0x41e11c){logger['error'](_0x41e11c[_0x8965('0x2e')]);if(_0x41e11c[_0x8965('0x2f')]){delete _0x41e11c[_0x8965('0x2f')];}_0x179245[_0x8965('0x22')](_0xff35d7)[_0x8965('0x30')](_0x41e11c);};}exports[_0x8965('0x31')]=function(_0x1bc564,_0x556a4d){var _0x389347={},_0x189ea5={},_0x3e1b2d={'count':0x0,'rows':[]};var _0x561a17=_['map'](db['Network']['rawAttributes'],function(_0x1cd2d0){return{'name':_0x1cd2d0[_0x8965('0x32')],'type':_0x1cd2d0[_0x8965('0x33')][_0x8965('0x34')]};});_0x189ea5[_0x8965('0x35')]=_['map'](_0x561a17,_0x8965('0x2f'));_0x189ea5[_0x8965('0x36')]=_['keys'](_0x1bc564['query']);_0x189ea5['filters']=_[_0x8965('0x37')](_0x189ea5['model'],_0x189ea5[_0x8965('0x36')]);_0x389347['attributes']=_[_0x8965('0x37')](_0x189ea5[_0x8965('0x35')],qs[_0x8965('0x38')](_0x1bc564['query'][_0x8965('0x38')]));_0x389347['attributes']=_0x389347[_0x8965('0x39')]['length']?_0x389347[_0x8965('0x39')]:_0x189ea5[_0x8965('0x35')];if(!_0x1bc564[_0x8965('0x36')][_0x8965('0x3a')](_0x8965('0x3b'))){_0x389347[_0x8965('0x25')]=qs[_0x8965('0x25')](_0x1bc564[_0x8965('0x36')][_0x8965('0x25')]);_0x389347['offset']=qs[_0x8965('0x24')](_0x1bc564[_0x8965('0x36')][_0x8965('0x24')]);}_0x389347[_0x8965('0x3c')]=qs[_0x8965('0x3d')](_0x1bc564['query'][_0x8965('0x3d')]);_0x389347[_0x8965('0x3e')]=qs[_0x8965('0x3f')](_['pick'](_0x1bc564[_0x8965('0x36')],_0x189ea5['filters']),_0x561a17);if(_0x1bc564['query'][_0x8965('0x40')]){_0x389347['where']=_[_0x8965('0x41')](_0x389347[_0x8965('0x3e')],{'$or':_[_0x8965('0x42')](_0x561a17,function(_0x212735){if(_0x212735[_0x8965('0x33')]!=='VIRTUAL'){var _0x16b5db={};_0x16b5db[_0x212735['name']]={'$like':'%'+_0x1bc564[_0x8965('0x36')]['filter']+'%'};return _0x16b5db;}})});}_0x389347=_[_0x8965('0x41')]({},_0x389347,_0x1bc564['options']);var _0x48ce92={'where':_0x389347[_0x8965('0x3e')]};return db['Network']['count'](_0x48ce92)[_0x8965('0x16')](function(_0x22d8c4){_0x3e1b2d[_0x8965('0x26')]=_0x22d8c4;if(_0x1bc564[_0x8965('0x36')]['includeAll']){_0x389347['include']=[{'all':!![]}];}return db[_0x8965('0x43')]['findAll'](_0x389347);})[_0x8965('0x16')](function(_0x1692fc){_0x3e1b2d[_0x8965('0x44')]=_0x1692fc;return _0x3e1b2d;})['then'](respondWithFilteredResult(_0x556a4d,_0x389347))[_0x8965('0x45')](handleError(_0x556a4d,null));};exports[_0x8965('0x46')]=function(_0x1693c3,_0x43afa1){var _0x3307a3={'raw':!![],'where':{'id':_0x1693c3['params']['id']}},_0x2240b3={};_0x2240b3[_0x8965('0x35')]=_[_0x8965('0x47')](db[_0x8965('0x43')][_0x8965('0x48')]);_0x2240b3[_0x8965('0x36')]=_[_0x8965('0x47')](_0x1693c3[_0x8965('0x36')]);_0x2240b3['filters']=_[_0x8965('0x37')](_0x2240b3[_0x8965('0x35')],_0x2240b3['query']);_0x3307a3['attributes']=_['intersection'](_0x2240b3[_0x8965('0x35')],qs[_0x8965('0x38')](_0x1693c3[_0x8965('0x36')][_0x8965('0x38')]));_0x3307a3['attributes']=_0x3307a3['attributes'][_0x8965('0x49')]?_0x3307a3[_0x8965('0x39')]:_0x2240b3[_0x8965('0x35')];if(_0x1693c3[_0x8965('0x36')][_0x8965('0x4a')]){_0x3307a3[_0x8965('0x4b')]=[{'all':!![]}];}_0x3307a3=_[_0x8965('0x41')]({},_0x3307a3,_0x1693c3[_0x8965('0x4c')]);return db['Network'][_0x8965('0x4d')](_0x3307a3)['then'](handleEntityNotFound(_0x43afa1,null))[_0x8965('0x16')](respondWithResult(_0x43afa1,null))[_0x8965('0x45')](handleError(_0x43afa1,null));};exports['create']=function(_0x3e9467,_0x39d3e0,_0x37bb27){var _0x3cea2e;return db['sequelize'][_0x8965('0x4e')](function(_0x200ea6){return db[_0x8965('0x43')][_0x8965('0x4f')](_0x3e9467['body'],{'raw':!![]})['then'](function(_0x3e687b){_0x3cea2e=_0x3e687b;return db['Network']['findAll']({'where':{'type':_0x3e9467[_0x8965('0x50')]['type']},'raw':!![]});})[_0x8965('0x16')](function(_0x16b6df){if(_0x3cea2e[_0x8965('0x33')][_0x8965('0x51')]()=='STUN'){var _0x56e810=fs[_0x8965('0x52')](path['join'](config[_0x8965('0x53')],_0x8965('0x54')),_0x8965('0x55'));var _0x5357b2=ejs['render'](_0x56e810,{'networks':_0x16b6df||[]});fs[_0x8965('0x56')]('/etc/asterisk/stun_xcally.conf',_0x5357b2);return respondWithRpcPromise(_0x8965('0x57'),_0x8965('0x4f'),{'module':_0x8965('0x58')});}else if(_0x3cea2e[_0x8965('0x33')][_0x8965('0x51')]()==_0x8965('0x59')){var _0x1220bb=fs[_0x8965('0x52')](path[_0x8965('0x5a')](config[_0x8965('0x53')],_0x8965('0x5b')),_0x8965('0x55'));var _0x4f3f09=ejs[_0x8965('0x5c')](_0x1220bb,{'networks':_0x16b6df||[]});fs[_0x8965('0x56')](_0x8965('0x5d'),_0x4f3f09);return respondWithRpcPromise('Reload',_0x8965('0x4f'),{'module':_0x8965('0x58')});}else{var _0x4c3a8b=fs[_0x8965('0x52')](path[_0x8965('0x5a')](config[_0x8965('0x53')],_0x8965('0x5e')),'utf8');var _0x4bfe37=ejs[_0x8965('0x5c')](_0x4c3a8b,{'networks':_0x16b6df||[]});fs[_0x8965('0x56')](util[_0x8965('0x5f')]('/etc/asterisk/sip_xcally_%s.conf',_0x3e9467['body'][_0x8965('0x33')][_0x8965('0x60')]()),_0x4bfe37);return respondWithRpcPromise(_0x8965('0x57'),'create',{'module':_0x8965('0x61')});}return null;})[_0x8965('0x16')](function(){return _0x3cea2e;});})[_0x8965('0x16')](respondWithResult(_0x39d3e0,0xc9))[_0x8965('0x45')](handleError(_0x39d3e0,null));};exports['update']=function(_0x1d2f8b,_0x135ac9,_0x142273){var _0x546c20;return db[_0x8965('0x62')]['transaction'](function(_0x2aa7a9){return db['Network'][_0x8965('0x4d')]({'where':{'id':_0x1d2f8b[_0x8965('0x63')]['id']}})[_0x8965('0x16')](handleEntityNotFound(_0x135ac9,null))['then'](saveUpdates(_0x1d2f8b['body'],null))[_0x8965('0x16')](function(_0x15f720){if(_0x15f720){_0x546c20=_0x15f720;return db['Network']['findAll']({'where':{'type':_0x546c20[_0x8965('0x33')]},'raw':!![]});}return null;})[_0x8965('0x16')](function(_0x29e727){if(_0x546c20[_0x8965('0x33')]['toUpperCase']()==_0x8965('0x64')){var _0x2986cd=fs[_0x8965('0x52')](path['join'](config[_0x8965('0x53')],_0x8965('0x54')),_0x8965('0x55'));var _0x5537b0=ejs[_0x8965('0x5c')](_0x2986cd,{'networks':_0x29e727||[]});fs[_0x8965('0x56')](_0x8965('0x65'),_0x5537b0);return respondWithRpcPromise(_0x8965('0x57'),'update',{'module':_0x8965('0x58')});}else if(_0x546c20[_0x8965('0x33')][_0x8965('0x51')]()==_0x8965('0x59')){var _0x22e35e=fs[_0x8965('0x52')](path['join'](config[_0x8965('0x53')],_0x8965('0x5b')),_0x8965('0x55'));var _0x3e4d7a=ejs[_0x8965('0x5c')](_0x22e35e,{'networks':_0x29e727||[]});fs[_0x8965('0x56')](_0x8965('0x5d'),_0x3e4d7a);return respondWithRpcPromise(_0x8965('0x57'),_0x8965('0x2c'),{'module':_0x8965('0x58')});}else{var _0x4c3244=fs[_0x8965('0x52')](path[_0x8965('0x5a')](config[_0x8965('0x53')],'server/files/templates/network.ejs'),_0x8965('0x55'));var _0x364ad2=ejs[_0x8965('0x5c')](_0x4c3244,{'networks':_0x29e727||[]});fs['writeFileSync'](util[_0x8965('0x5f')](_0x8965('0x66'),_0x1d2f8b[_0x8965('0x50')][_0x8965('0x33')][_0x8965('0x60')]()),_0x364ad2);return respondWithRpcPromise('Reload','update',{'module':_0x8965('0x61')});}return null;})[_0x8965('0x16')](function(_0x1a9483){if(_0x1a9483){return _0x546c20;}return null;});})['then'](respondWithResult(_0x135ac9,null))['catch'](handleError(_0x135ac9,null));};exports[_0x8965('0x2d')]=function(_0x485593,_0xeefb97,_0x2bf9e9){var _0x1fc2eb;return db[_0x8965('0x43')][_0x8965('0x4d')]({'where':{'id':_0x485593['params']['id']}})['then'](function(_0x4ebde4){_0x1fc2eb=_0x4ebde4;return _0x4ebde4;})[_0x8965('0x16')](handleEntityNotFound(_0xeefb97,null))['then'](removeEntity(_0xeefb97,null))[_0x8965('0x16')](function(){if(_0x1fc2eb){return db[_0x8965('0x43')]['findAll']({'where':{'type':_0x1fc2eb[_0x8965('0x33')]},'raw':!![]});}})[_0x8965('0x16')](function(_0x4392fb){if(_0x1fc2eb[_0x8965('0x33')][_0x8965('0x51')]()==_0x8965('0x64')){var _0x4624c0=fs['readFileSync'](path['join'](config['root'],_0x8965('0x54')),_0x8965('0x55'));var _0x52d2ac=ejs[_0x8965('0x5c')](_0x4624c0,{'networks':_0x4392fb||[]});fs[_0x8965('0x56')](_0x8965('0x65'),_0x52d2ac);return respondWithRpcPromise('Reload',_0x8965('0x2d'),{'module':_0x8965('0x58')});}else if(_0x1fc2eb[_0x8965('0x33')][_0x8965('0x51')]()==_0x8965('0x59')){var _0x1fb07f=fs[_0x8965('0x52')](path[_0x8965('0x5a')](config['root'],_0x8965('0x5b')),_0x8965('0x55'));var _0x4daa5c=ejs[_0x8965('0x5c')](_0x1fb07f,{'networks':_0x4392fb||[]});fs['writeFileSync'](_0x8965('0x5d'),_0x4daa5c);return respondWithRpcPromise('Reload',_0x8965('0x2d'),{'module':_0x8965('0x58')});}else{var _0x570e0b=fs[_0x8965('0x52')](path[_0x8965('0x5a')](config[_0x8965('0x53')],'server/files/templates/network.ejs'),_0x8965('0x55'));var _0x1b7be9=ejs['render'](_0x570e0b,{'networks':_0x4392fb||[]});fs[_0x8965('0x56')](util['format'](_0x8965('0x66'),_0x485593[_0x8965('0x50')][_0x8965('0x33')][_0x8965('0x60')]()),_0x1b7be9);return respondWithRpcPromise(_0x8965('0x57'),_0x8965('0x2d'),{'module':_0x8965('0x61')});}return null;})[_0x8965('0x45')](handleError(_0xeefb97,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 8282dda..1bf1197 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 _0xb9a7=['exports','define','Network','network','util','bluebird','path','rimraf','../../config/environment','./network.attributes'];(function(_0x218d57,_0x2a2f1f){var _0x241e9b=function(_0x24dc14){while(--_0x24dc14){_0x218d57['push'](_0x218d57['shift']());}};_0x241e9b(++_0x2a2f1f);}(_0xb9a7,0x112));var _0x7b9a=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0xb9a7[_0x88cd7b];return _0x56fcc8;};'use strict';var _=require('lodash');var util=require(_0x7b9a('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x7b9a('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7b9a('0x2'));var rimraf=require(_0x7b9a('0x3'));var config=require(_0x7b9a('0x4'));var attributes=require(_0x7b9a('0x5'));module[_0x7b9a('0x6')]=function(_0xf6dae2,_0x22764f){return _0xf6dae2[_0x7b9a('0x7')](_0x7b9a('0x8'),attributes,{'tableName':_0x7b9a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x073e=['rimraf','../../config/environment','define','Network','network','lodash','util','../../config/logger','api','path'];(function(_0x488fc6,_0x66eac5){var _0x1dedd6=function(_0x556782){while(--_0x556782){_0x488fc6['push'](_0x488fc6['shift']());}};_0x1dedd6(++_0x66eac5);}(_0x073e,0x181));var _0xe073=function(_0x32f7ed,_0x294a27){_0x32f7ed=_0x32f7ed-0x0;var _0x564f8c=_0x073e[_0x32f7ed];return _0x564f8c;};'use strict';var _=require(_0xe073('0x0'));var util=require(_0xe073('0x1'));var logger=require(_0xe073('0x2'))(_0xe073('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe073('0x4'));var rimraf=require(_0xe073('0x5'));var config=require(_0xe073('0x6'));var attributes=require('./network.attributes');module['exports']=function(_0x4bc6b3,_0x45995e){return _0x4bc6b3[_0xe073('0x7')](_0xe073('0x8'),attributes,{'tableName':_0xe073('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index f09ecaa..726dd9d 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x139276,_0xfcdf80){var _0x18ba65=function(_0x449092){while(--_0x449092){_0x139276['push'](_0x139276['shift']());}};_0x18ba65(++_0xfcdf80);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file +var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xeebebf,_0xf07abb){var _0x68dbbd=function(_0x4e785c){while(--_0x4e785c){_0xeebebf['push'](_0xeebebf['shift']());}};_0x68dbbd(++_0xf07abb);}(_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 moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 514b2d1..d78795f 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 _0x398b=['delete','removeAnswers','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelAccount.controller','get','isAuthenticated','index','/describe','/:id','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','getInteractions','/:id/users','post','create','/:id/dispositions','addDisposition','addAnswer','/:id/notify','addApplications','put','destroy'];(function(_0x135ee2,_0xe82bbe){var _0x3f3cff=function(_0x2e8812){while(--_0x2e8812){_0x135ee2['push'](_0x135ee2['shift']());}};_0x3f3cff(++_0xe82bbe);}(_0x398b,0x88));var _0xb398=function(_0xbfbef0,_0x218b21){_0xbfbef0=_0xbfbef0-0x0;var _0x3fdf6f=_0x398b[_0xbfbef0];return _0x3fdf6f;};'use strict';var multer=require(_0xb398('0x0'));var util=require(_0xb398('0x1'));var path=require(_0xb398('0x2'));var timeout=require('connect-timeout');var express=require(_0xb398('0x3'));var router=express[_0xb398('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb398('0x5'));var interaction=require(_0xb398('0x6'));var config=require('../../config/environment');var controller=require(_0xb398('0x7'));router[_0xb398('0x8')]('/',auth[_0xb398('0x9')](),controller[_0xb398('0xa')]);router['get'](_0xb398('0xb'),auth[_0xb398('0x9')](),controller['describe']);router['get'](_0xb398('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xb398('0x8')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xb398('0xd')]);router[_0xb398('0x8')](_0xb398('0xe'),auth[_0xb398('0x9')](),controller[_0xb398('0xf')]);router[_0xb398('0x8')](_0xb398('0x10'),auth[_0xb398('0x9')](),controller['getApplications']);router[_0xb398('0x8')](_0xb398('0x11'),auth['isAuthenticated'](),controller[_0xb398('0x12')]);router[_0xb398('0x8')](_0xb398('0x13'),auth[_0xb398('0x9')](),controller['getAgents']);router[_0xb398('0x14')]('/',auth[_0xb398('0x9')](),controller[_0xb398('0x15')]);router[_0xb398('0x14')](_0xb398('0x16'),auth[_0xb398('0x9')](),controller[_0xb398('0x17')]);router[_0xb398('0x14')]('/:id/canned_answers',auth[_0xb398('0x9')](),controller[_0xb398('0x18')]);router[_0xb398('0x14')](_0xb398('0x19'),controller['notify']);router['post']('/:id/applications',auth[_0xb398('0x9')](),controller[_0xb398('0x1a')]);router[_0xb398('0x14')](_0xb398('0x13'),auth[_0xb398('0x9')](),controller['addAgents']);router[_0xb398('0x14')]('/:id/send',auth['isAuthenticated'](),controller['send']);router[_0xb398('0x1b')]('/:id',auth[_0xb398('0x9')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xb398('0x1c')]);router[_0xb398('0x1d')](_0xb398('0x16'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0xb398('0x1d')](_0xb398('0xe'),auth[_0xb398('0x9')](),controller[_0xb398('0x1e')]);router['delete'](_0xb398('0x13'),auth['isAuthenticated'](),controller[_0xb398('0x1f')]);module[_0xb398('0x20')]=router; \ No newline at end of file +var _0x0b90=['/:id/interactions','getInteractions','/:id/users','getAgents','post','create','addDisposition','addAnswer','/:id/notify','notify','addApplications','addAgents','/:id/send','put','update','delete','removeDispositions','removeAnswers','removeAgents','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/applications','getApplications'];(function(_0x22e659,_0x33080b){var _0x334625=function(_0x590b28){while(--_0x590b28){_0x22e659['push'](_0x22e659['shift']());}};_0x334625(++_0x33080b);}(_0x0b90,0x116));var _0x00b9=function(_0x414668,_0x2324c7){_0x414668=_0x414668-0x0;var _0x303221=_0x0b90[_0x414668];return _0x303221;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x00b9('0x0'));var timeout=require(_0x00b9('0x1'));var express=require('express');var router=express[_0x00b9('0x2')]();var fs_extra=require(_0x00b9('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x00b9('0x4'));var config=require(_0x00b9('0x5'));var controller=require(_0x00b9('0x6'));router[_0x00b9('0x7')]('/',auth[_0x00b9('0x8')](),controller[_0x00b9('0x9')]);router[_0x00b9('0x7')]('/describe',auth[_0x00b9('0x8')](),controller[_0x00b9('0xa')]);router[_0x00b9('0x7')](_0x00b9('0xb'),auth['isAuthenticated'](),controller[_0x00b9('0xc')]);router[_0x00b9('0x7')](_0x00b9('0xd'),auth[_0x00b9('0x8')](),controller[_0x00b9('0xe')]);router[_0x00b9('0x7')](_0x00b9('0xf'),auth['isAuthenticated'](),controller['getAnswers']);router[_0x00b9('0x7')](_0x00b9('0x10'),auth[_0x00b9('0x8')](),controller[_0x00b9('0x11')]);router[_0x00b9('0x7')](_0x00b9('0x12'),auth[_0x00b9('0x8')](),controller[_0x00b9('0x13')]);router[_0x00b9('0x7')](_0x00b9('0x14'),auth[_0x00b9('0x8')](),controller[_0x00b9('0x15')]);router[_0x00b9('0x16')]('/',auth['isAuthenticated'](),controller[_0x00b9('0x17')]);router['post']('/:id/dispositions',auth[_0x00b9('0x8')](),controller[_0x00b9('0x18')]);router[_0x00b9('0x16')]('/:id/canned_answers',auth[_0x00b9('0x8')](),controller[_0x00b9('0x19')]);router['post'](_0x00b9('0x1a'),controller[_0x00b9('0x1b')]);router[_0x00b9('0x16')](_0x00b9('0x10'),auth[_0x00b9('0x8')](),controller[_0x00b9('0x1c')]);router[_0x00b9('0x16')](_0x00b9('0x14'),auth[_0x00b9('0x8')](),controller[_0x00b9('0x1d')]);router[_0x00b9('0x16')](_0x00b9('0x1e'),auth['isAuthenticated'](),controller['send']);router[_0x00b9('0x1f')](_0x00b9('0xb'),auth[_0x00b9('0x8')](),controller[_0x00b9('0x20')]);router[_0x00b9('0x21')](_0x00b9('0xb'),auth['isAuthenticated'](),controller['destroy']);router[_0x00b9('0x21')](_0x00b9('0xd'),auth[_0x00b9('0x8')](),controller[_0x00b9('0x22')]);router[_0x00b9('0x21')](_0x00b9('0xf'),auth[_0x00b9('0x8')](),controller[_0x00b9('0x23')]);router[_0x00b9('0x21')](_0x00b9('0x14'),auth[_0x00b9('0x8')](),controller[_0x00b9('0x24')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 0f8cd5c..aac41ad 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 _0x9bda=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','generate'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x9bda,0x133));var _0xa9bd=function(_0x147497,_0x43e433){_0x147497=_0x147497-0x0;var _0x35f45=_0x9bda[_0x147497];return _0x35f45;};'use strict';var Sequelize=require(_0xa9bd('0x0'));var rs=require('randomstring');module[_0xa9bd('0x1')]={'name':{'type':Sequelize[_0xa9bd('0x2')],'unique':_0xa9bd('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xa9bd('0x2')]},'token':{'type':Sequelize[_0xa9bd('0x2')],'defaultValue':function(){return rs[_0xa9bd('0x4')]();}},'replyUri':{'type':Sequelize[_0xa9bd('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xa9bd('0x5');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa9bd('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xa9bd('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xa9bd('0x2')]},'queueTransfer':{'type':Sequelize[_0xa9bd('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa9bd('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa9bd('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa9bd('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0xa9bd('0x8')},'mandatoryDisposition':{'type':Sequelize[_0xa9bd('0x6')],'defaultValue':![],'comment':_0xa9bd('0x9'),'set':function(_0xaa35fe){if(!_0xaa35fe)this[_0xa9bd('0xa')](_0xa9bd('0xb'),null);this[_0xa9bd('0xa')](_0xa9bd('0xc'),_0xaa35fe);}}}; \ No newline at end of file +var _0x30cb=['INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','randomstring','exports','name','STRING','generate','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN'];(function(_0x50b602,_0x537deb){var _0x56b735=function(_0x5c8dae){while(--_0x5c8dae){_0x50b602['push'](_0x50b602['shift']());}};_0x56b735(++_0x537deb);}(_0x30cb,0x130));var _0xb30c=function(_0x13b3b5,_0x52d8d8){_0x13b3b5=_0x13b3b5-0x0;var _0x337cd0=_0x30cb[_0x13b3b5];return _0x337cd0;};'use strict';var Sequelize=require(_0xb30c('0x0'));var rs=require(_0xb30c('0x1'));module[_0xb30c('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0xb30c('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xb30c('0x4')]},'token':{'type':Sequelize[_0xb30c('0x4')],'defaultValue':function(){return rs[_0xb30c('0x5')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xb30c('0x6');}},'notificationSound':{'type':Sequelize[_0xb30c('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb30c('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xb30c('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xb30c('0x4')]},'queueTransfer':{'type':Sequelize[_0xb30c('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb30c('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb30c('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb30c('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0xb30c('0x9')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xb30c('0xa'),'set':function(_0x5e8e6f){if(!_0x5e8e6f)this[_0xb30c('0xb')](_0xb30c('0xc'),null);this[_0xb30c('0xb')]('mandatoryDisposition',_0x5e8e6f);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index c454d22..7053244 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 _0xfa90=['mandatoryDispositionPause','map','OpenchannelAccount','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','filter','where','includeAll','findAll','rows','show','params','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','describe','addDisposition','OpenchannelAccountId','Disposition','nolimit','options','include','removeDispositions','ids','addAnswer','CannedAnswer','findOne','pick','merge','removeAnswers','openchannel','ValidationError','difference','createdAt','updatedAt','CompanyId','Sequelize','from\x20is\x20mandatory','isNil','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','from','CmList','List','OpenchannelApplication','Applications','applications','list','orderBy','priority','account','Contacts','ListId','CmContact','firstName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','contact','lastName','messageId','update','interaction','created','autoclose','push','close','*,*,*,*','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','stack','finally','getApplications','getInteractions','Contact','Owner','internal','Tag','tag','addAgents','omit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','DESC','out','OpenchannelMessage','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','http','client','then','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','info','catch','sendStatus','json','offset','undefined','limit','count','status','Content-Range','reject','save','destroy','get','OpenchannelAccounts','UserProfileResource','end','name','send','Pause'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfa90,0x140));var _0x0fa9=function(_0x1ed7e5,_0xc20b04){_0x1ed7e5=_0x1ed7e5-0x0;var _0x10113a=_0xfa90[_0x1ed7e5];return _0x10113a;};'use strict';var emlformat=require(_0x0fa9('0x0'));var rimraf=require(_0x0fa9('0x1'));var zipdir=require(_0x0fa9('0x2'));var jsonpatch=require(_0x0fa9('0x3'));var rp=require(_0x0fa9('0x4'));var moment=require('moment');var BPromise=require(_0x0fa9('0x5'));var Mustache=require(_0x0fa9('0x6'));var util=require(_0x0fa9('0x7'));var path=require(_0x0fa9('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0fa9('0x9'));var squel=require(_0x0fa9('0xa'));var crypto=require(_0x0fa9('0xb'));var jsforce=require(_0x0fa9('0xc'));var deskjs=require(_0x0fa9('0xd'));var toCsv=require(_0x0fa9('0xe'));var querystring=require(_0x0fa9('0xf'));var Papa=require(_0x0fa9('0x10'));var Redis=require(_0x0fa9('0x11'));var authService=require(_0x0fa9('0x12'));var qs=require(_0x0fa9('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0fa9('0x14'))('api');var utils=require(_0x0fa9('0x15'));var config=require(_0x0fa9('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x0fa9('0x17'))['db'];config[_0x0fa9('0x18')]=_[_0x0fa9('0x19')](config[_0x0fa9('0x18')],{'host':_0x0fa9('0x1a'),'port':0x18eb});var socket=require(_0x0fa9('0x1b'))(new Redis(config['redis']));require(_0x0fa9('0x1c'))[_0x0fa9('0x1d')](socket);var jayson=require(_0x0fa9('0x1e'));var client=jayson['client'][_0x0fa9('0x1f')]({'port':0x232c});var client9002=jayson[_0x0fa9('0x20')][_0x0fa9('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x5dc1c3,_0x2e3b92,_0x40b153,_0x4ae6e3){return new BPromise(function(_0x50d8f0,_0x4f11a6){var _0x2cb136=_0x4ae6e3||client;return _0x2cb136['request'](_0x5dc1c3,_0x40b153)[_0x0fa9('0x21')](function(_0x52e817){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x2e3b92,_0x0fa9('0x22'));logger[_0x0fa9('0x23')](_0x0fa9('0x24'),_0x2e3b92,_0x0fa9('0x22'),JSON[_0x0fa9('0x25')](_0x52e817));if(_0x52e817[_0x0fa9('0x26')]){if(_0x52e817[_0x0fa9('0x26')][_0x0fa9('0x27')]===0x1f4){logger['error'](_0x0fa9('0x28'),_0x2e3b92,_0x52e817[_0x0fa9('0x26')][_0x0fa9('0x29')]);return _0x4f11a6(_0x52e817[_0x0fa9('0x26')][_0x0fa9('0x29')]);}logger['error'](_0x0fa9('0x28'),_0x2e3b92,_0x52e817[_0x0fa9('0x26')][_0x0fa9('0x29')]);return _0x50d8f0(_0x52e817[_0x0fa9('0x26')][_0x0fa9('0x29')]);}else{logger[_0x0fa9('0x2a')](_0x0fa9('0x28'),_0x2e3b92,'request\x20sent');_0x50d8f0(_0x52e817['result']['message']);}})[_0x0fa9('0x2b')](function(_0x28aaf7){logger[_0x0fa9('0x26')](_0x0fa9('0x28'),_0x2e3b92,_0x28aaf7);_0x4f11a6(_0x28aaf7);});});}function respondWithStatusCode(_0x10160b,_0x5bfe05){_0x5bfe05=_0x5bfe05||0xcc;return function(_0x2ce960){if(_0x2ce960){return _0x10160b[_0x0fa9('0x2c')](_0x5bfe05);}return _0x10160b['status'](_0x5bfe05)['end']();};}function respondWithResult(_0x3adae3,_0x472ba7){_0x472ba7=_0x472ba7||0xc8;return function(_0x3c4ec8){if(_0x3c4ec8){return _0x3adae3['status'](_0x472ba7)[_0x0fa9('0x2d')](_0x3c4ec8);}};}function respondWithFilteredResult(_0x39247c,_0x16e65c){return function(_0x3d25e7){if(_0x3d25e7){var _0x2945c4=typeof _0x16e65c[_0x0fa9('0x2e')]===_0x0fa9('0x2f')&&typeof _0x16e65c[_0x0fa9('0x30')]===_0x0fa9('0x2f');var _0x17a587=_0x3d25e7[_0x0fa9('0x31')];var _0x3d7552=_0x2945c4?0x0:_0x16e65c[_0x0fa9('0x2e')];var _0x51095e=_0x2945c4?_0x3d25e7[_0x0fa9('0x31')]:_0x16e65c[_0x0fa9('0x2e')]+_0x16e65c['limit'];var _0x3db8e0;if(_0x51095e>=_0x17a587){_0x51095e=_0x17a587;_0x3db8e0=0xc8;}else{_0x3db8e0=0xce;}_0x39247c[_0x0fa9('0x32')](_0x3db8e0);return _0x39247c['set'](_0x0fa9('0x33'),_0x3d7552+'-'+_0x51095e+'/'+_0x17a587)['json'](_0x3d25e7);}return null;};}function patchUpdates(_0x5ca84c){return function(_0x5833b8){try{jsonpatch['apply'](_0x5833b8,_0x5ca84c,!![]);}catch(_0x1e7369){return BPromise[_0x0fa9('0x34')](_0x1e7369);}return _0x5833b8[_0x0fa9('0x35')]();};}function saveUpdates(_0x3ab8be,_0x4b0cee){return function(_0x97a2a9){if(_0x97a2a9){return _0x97a2a9['update'](_0x3ab8be)['then'](function(_0x426c6e){return _0x426c6e;});}return null;};}function removeEntity(_0x5ec90c,_0x5ce792){return function(_0x8ba041){if(_0x8ba041){return _0x8ba041[_0x0fa9('0x36')]()[_0x0fa9('0x21')](function(){var _0x5eace1=_0x8ba041[_0x0fa9('0x37')]({'plain':!![]});var _0x539f6b=_0x0fa9('0x38');return db[_0x0fa9('0x39')][_0x0fa9('0x36')]({'where':{'type':_0x539f6b,'resourceId':_0x5eace1['id']}})[_0x0fa9('0x21')](function(){return _0x8ba041;});})[_0x0fa9('0x21')](function(){_0x5ec90c[_0x0fa9('0x32')](0xcc)[_0x0fa9('0x3a')]();});}};}function handleEntityNotFound(_0x8ab8ac,_0x165e56){return function(_0x800d7c){if(!_0x800d7c){_0x8ab8ac[_0x0fa9('0x2c')](0x194);}return _0x800d7c;};}function handleError(_0x191e4d,_0x183087){_0x183087=_0x183087||0x1f4;return function(_0x2bcd1c){logger[_0x0fa9('0x26')](_0x2bcd1c['stack']);if(_0x2bcd1c[_0x0fa9('0x3b')]){delete _0x2bcd1c[_0x0fa9('0x3b')];}_0x191e4d[_0x0fa9('0x32')](_0x183087)[_0x0fa9('0x3c')](_0x2bcd1c);};}exports['index']=function(_0x534b40,_0x5d8454){var _0x5d5c9b={'include':[{'model':db[_0x0fa9('0x3d')],'as':_0x0fa9('0x3e')}]},_0x169a34={},_0x204f19={'count':0x0,'rows':[]};var _0x4054d3=_[_0x0fa9('0x3f')](db[_0x0fa9('0x40')]['rawAttributes'],function(_0x5218de){return{'name':_0x5218de['fieldName'],'type':_0x5218de[_0x0fa9('0x41')][_0x0fa9('0x42')]};});_0x169a34[_0x0fa9('0x43')]=_[_0x0fa9('0x3f')](_0x4054d3,_0x0fa9('0x3b'));_0x169a34['query']=_[_0x0fa9('0x44')](_0x534b40[_0x0fa9('0x45')]);_0x169a34[_0x0fa9('0x46')]=_[_0x0fa9('0x47')](_0x169a34['model'],_0x169a34[_0x0fa9('0x45')]);_0x5d5c9b['attributes']=_[_0x0fa9('0x47')](_0x169a34[_0x0fa9('0x43')],qs[_0x0fa9('0x48')](_0x534b40[_0x0fa9('0x45')]['fields']));_0x5d5c9b['attributes']=_0x5d5c9b[_0x0fa9('0x49')][_0x0fa9('0x4a')]?_0x5d5c9b[_0x0fa9('0x49')]:_0x169a34['model'];if(!_0x534b40['query'][_0x0fa9('0x4b')]('nolimit')){_0x5d5c9b[_0x0fa9('0x30')]=qs[_0x0fa9('0x30')](_0x534b40[_0x0fa9('0x45')][_0x0fa9('0x30')]);_0x5d5c9b[_0x0fa9('0x2e')]=qs[_0x0fa9('0x2e')](_0x534b40['query'][_0x0fa9('0x2e')]);}_0x5d5c9b[_0x0fa9('0x4c')]=qs[_0x0fa9('0x4d')](_0x534b40[_0x0fa9('0x45')][_0x0fa9('0x4d')]);_0x5d5c9b['where']=qs[_0x0fa9('0x46')](_['pick'](_0x534b40[_0x0fa9('0x45')],_0x169a34['filters']),_0x4054d3);if(_0x534b40[_0x0fa9('0x45')][_0x0fa9('0x4e')]){_0x5d5c9b['where']=_['merge'](_0x5d5c9b['where'],{'$or':_[_0x0fa9('0x3f')](_0x4054d3,function(_0x973d9b){if(_0x973d9b[_0x0fa9('0x41')]!=='VIRTUAL'){var _0x3143d0={};_0x3143d0[_0x973d9b[_0x0fa9('0x3b')]]={'$like':'%'+_0x534b40['query'][_0x0fa9('0x4e')]+'%'};return _0x3143d0;}})});}_0x5d5c9b=_['merge']({},_0x5d5c9b,_0x534b40['options']);var _0x281852={'where':_0x5d5c9b[_0x0fa9('0x4f')]};return db[_0x0fa9('0x40')][_0x0fa9('0x31')](_0x281852)[_0x0fa9('0x21')](function(_0x3f58c7){_0x204f19[_0x0fa9('0x31')]=_0x3f58c7;if(_0x534b40[_0x0fa9('0x45')][_0x0fa9('0x50')]){_0x5d5c9b['include']=[{'all':!![]}];}return db[_0x0fa9('0x40')][_0x0fa9('0x51')](_0x5d5c9b);})['then'](function(_0x1f29ce){_0x204f19[_0x0fa9('0x52')]=_0x1f29ce;return _0x204f19;})[_0x0fa9('0x21')](respondWithFilteredResult(_0x5d8454,_0x5d5c9b))[_0x0fa9('0x2b')](handleError(_0x5d8454,null));};exports[_0x0fa9('0x53')]=function(_0x2018f0,_0x25f8f7){var _0x549c13={'raw':![],'where':{'id':_0x2018f0[_0x0fa9('0x54')]['id']},'include':[{'model':db[_0x0fa9('0x3d')],'as':_0x0fa9('0x3e')}]},_0x5a3b5f={};_0x5a3b5f[_0x0fa9('0x43')]=_[_0x0fa9('0x44')](db[_0x0fa9('0x40')][_0x0fa9('0x55')]);_0x5a3b5f['query']=_[_0x0fa9('0x44')](_0x2018f0['query']);_0x5a3b5f[_0x0fa9('0x46')]=_['intersection'](_0x5a3b5f['model'],_0x5a3b5f[_0x0fa9('0x45')]);_0x549c13[_0x0fa9('0x49')]=_['intersection'](_0x5a3b5f[_0x0fa9('0x43')],qs[_0x0fa9('0x48')](_0x2018f0['query'][_0x0fa9('0x48')]));_0x549c13[_0x0fa9('0x49')]=_0x549c13[_0x0fa9('0x49')][_0x0fa9('0x4a')]?_0x549c13[_0x0fa9('0x49')]:_0x5a3b5f['model'];if(_0x2018f0[_0x0fa9('0x45')][_0x0fa9('0x50')]){_0x549c13['include']=[{'all':!![]}];}_0x549c13=_['merge']({},_0x549c13,_0x2018f0['options']);return db[_0x0fa9('0x40')][_0x0fa9('0x56')](_0x549c13)[_0x0fa9('0x21')](handleEntityNotFound(_0x25f8f7,null))['then'](respondWithResult(_0x25f8f7,null))[_0x0fa9('0x2b')](handleError(_0x25f8f7,null));};exports['create']=function(_0x350c4f,_0xfae1cb){return db['OpenchannelAccount'][_0x0fa9('0x57')](_0x350c4f[_0x0fa9('0x58')],{})[_0x0fa9('0x21')](function(_0x4944f8){var _0x1ad3a1=_0x350c4f[_0x0fa9('0x59')][_0x0fa9('0x37')]({'plain':!![]});if(!_0x1ad3a1)throw new Error(_0x0fa9('0x5a'));if(_0x1ad3a1[_0x0fa9('0x5b')]==='user'){var _0x4cad7b=_0x4944f8[_0x0fa9('0x37')]({'plain':!![]});var _0x47522e=_0x0fa9('0x38');return db[_0x0fa9('0x5c')][_0x0fa9('0x56')]({'where':{'name':_0x47522e,'userProfileId':_0x1ad3a1[_0x0fa9('0x5d')]},'raw':!![]})[_0x0fa9('0x21')](function(_0x56ac60){if(_0x56ac60&&_0x56ac60['autoAssociation']===0x0){return db[_0x0fa9('0x39')][_0x0fa9('0x57')]({'name':_0x4cad7b[_0x0fa9('0x3b')],'resourceId':_0x4cad7b['id'],'type':_0x56ac60['name'],'sectionId':_0x56ac60['id']},{})['then'](function(){return _0x4944f8;});}else{return _0x4944f8;}})[_0x0fa9('0x2b')](function(_0x224c69){logger[_0x0fa9('0x26')](_0x0fa9('0x5e'),_0x224c69);throw _0x224c69;});}return _0x4944f8;})[_0x0fa9('0x21')](respondWithResult(_0xfae1cb,0xc9))[_0x0fa9('0x2b')](handleError(_0xfae1cb,null));};exports['update']=function(_0x14e0a6,_0x13a6a4){if(_0x14e0a6[_0x0fa9('0x58')]['id']){delete _0x14e0a6[_0x0fa9('0x58')]['id'];}return db['OpenchannelAccount'][_0x0fa9('0x56')]({'where':{'id':_0x14e0a6[_0x0fa9('0x54')]['id']},'include':[{'model':db[_0x0fa9('0x3d')],'as':_0x0fa9('0x3e')}]})[_0x0fa9('0x21')](handleEntityNotFound(_0x13a6a4,null))['then'](saveUpdates(_0x14e0a6[_0x0fa9('0x58')],null))[_0x0fa9('0x21')](respondWithResult(_0x13a6a4,null))[_0x0fa9('0x2b')](handleError(_0x13a6a4,null));};exports[_0x0fa9('0x36')]=function(_0x4a96a8,_0x13d590){return db[_0x0fa9('0x40')][_0x0fa9('0x56')]({'where':{'id':_0x4a96a8[_0x0fa9('0x54')]['id']}})['then'](handleEntityNotFound(_0x13d590,null))[_0x0fa9('0x21')](removeEntity(_0x13d590,null))['catch'](handleError(_0x13d590,null));};exports[_0x0fa9('0x5f')]=function(_0x4e7986,_0x74509d){return db['OpenchannelAccount'][_0x0fa9('0x5f')]()[_0x0fa9('0x21')](respondWithResult(_0x74509d,null))[_0x0fa9('0x2b')](handleError(_0x74509d,null));};exports[_0x0fa9('0x60')]=function(_0x333085,_0x538457,_0x14f3aa){if(_0x333085[_0x0fa9('0x58')]['id']){delete _0x333085[_0x0fa9('0x58')]['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x333085[_0x0fa9('0x54')]['id']}})[_0x0fa9('0x21')](handleEntityNotFound(_0x538457,null))['then'](function(_0x2d238f){if(_0x2d238f){_0x333085[_0x0fa9('0x58')][_0x0fa9('0x61')]=_0x2d238f['id'];return db[_0x0fa9('0x62')][_0x0fa9('0x57')](_0x333085[_0x0fa9('0x58')]);}})['then'](respondWithResult(_0x538457,null))[_0x0fa9('0x2b')](handleError(_0x538457,null));};exports['getDispositions']=function(_0x26b921,_0x3f258a,_0x3fe211){var _0x3d9eec={'raw':![],'where':{}};var _0x18f560={};var _0x444c39={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0x26b921[_0x0fa9('0x54')]['id']}})[_0x0fa9('0x21')](handleEntityNotFound(_0x3f258a,null))[_0x0fa9('0x21')](function(_0x593948){if(_0x593948){_0x18f560[_0x0fa9('0x43')]=_[_0x0fa9('0x44')](db[_0x0fa9('0x62')][_0x0fa9('0x55')]);_0x18f560[_0x0fa9('0x45')]=_[_0x0fa9('0x44')](_0x26b921[_0x0fa9('0x45')]);_0x18f560['filters']=_[_0x0fa9('0x47')](_0x18f560[_0x0fa9('0x43')],_0x18f560[_0x0fa9('0x45')]);_0x3d9eec[_0x0fa9('0x49')]=_[_0x0fa9('0x47')](_0x18f560['model'],qs[_0x0fa9('0x48')](_0x26b921['query'][_0x0fa9('0x48')]));_0x3d9eec[_0x0fa9('0x49')]=_0x3d9eec['attributes'][_0x0fa9('0x4a')]?_0x3d9eec[_0x0fa9('0x49')]:_0x18f560[_0x0fa9('0x43')];if(!_0x26b921[_0x0fa9('0x45')][_0x0fa9('0x4b')](_0x0fa9('0x63'))){_0x3d9eec['limit']=qs[_0x0fa9('0x30')](_0x26b921[_0x0fa9('0x45')][_0x0fa9('0x30')]);_0x3d9eec[_0x0fa9('0x2e')]=qs['offset'](_0x26b921[_0x0fa9('0x45')][_0x0fa9('0x2e')]);}_0x3d9eec[_0x0fa9('0x4c')]=qs[_0x0fa9('0x4d')](_0x26b921['query'][_0x0fa9('0x4d')]);_0x3d9eec[_0x0fa9('0x4f')]=qs[_0x0fa9('0x46')](_['pick'](_0x26b921[_0x0fa9('0x45')],_0x18f560[_0x0fa9('0x46')]));_0x3d9eec[_0x0fa9('0x4f')][_0x0fa9('0x61')]=_0x593948['id'];if(_0x26b921[_0x0fa9('0x45')][_0x0fa9('0x4e')]){_0x3d9eec[_0x0fa9('0x4f')]=_['merge'](_0x3d9eec['where'],{'$or':_[_0x0fa9('0x3f')](_0x3d9eec[_0x0fa9('0x49')],function(_0x2ffda1){var _0x3ba4d6={};_0x3ba4d6[_0x2ffda1]={'$like':'%'+_0x26b921['query']['filter']+'%'};return _0x3ba4d6;})});}_0x3d9eec=_['merge']({},_0x3d9eec,_0x26b921[_0x0fa9('0x64')]);return db[_0x0fa9('0x62')][_0x0fa9('0x31')]({'where':_0x3d9eec['where']})[_0x0fa9('0x21')](function(_0x3a5e73){_0x444c39[_0x0fa9('0x31')]=_0x3a5e73;if(_0x26b921[_0x0fa9('0x45')][_0x0fa9('0x50')]){_0x3d9eec[_0x0fa9('0x65')]=[{'all':!![]}];}return db[_0x0fa9('0x62')][_0x0fa9('0x51')](_0x3d9eec);})[_0x0fa9('0x21')](function(_0x4298ed){_0x444c39[_0x0fa9('0x52')]=_0x4298ed;return _0x444c39;});}})['then'](respondWithFilteredResult(_0x3f258a,_0x3d9eec))[_0x0fa9('0x2b')](handleError(_0x3f258a,null));};exports[_0x0fa9('0x66')]=function(_0x4a637c,_0x348a1e,_0x2bb94e){return db[_0x0fa9('0x40')][_0x0fa9('0x56')]({'where':{'id':_0x4a637c[_0x0fa9('0x54')]['id']}})[_0x0fa9('0x21')](handleEntityNotFound(_0x348a1e,null))['then'](function(_0x1a68ff){if(_0x1a68ff){return _0x1a68ff[_0x0fa9('0x66')](_0x4a637c[_0x0fa9('0x45')][_0x0fa9('0x67')]);}})[_0x0fa9('0x21')](respondWithStatusCode(_0x348a1e,null))[_0x0fa9('0x2b')](handleError(_0x348a1e,null));};exports[_0x0fa9('0x68')]=function(_0x243a2f,_0x15661a,_0x215909){if(_0x243a2f['body']['id']){delete _0x243a2f['body']['id'];}return db[_0x0fa9('0x40')][_0x0fa9('0x56')]({'where':{'id':_0x243a2f[_0x0fa9('0x54')]['id']}})['then'](handleEntityNotFound(_0x15661a,null))[_0x0fa9('0x21')](function(_0x2e925e){if(_0x2e925e){_0x243a2f['body']['OpenchannelAccountId']=_0x2e925e['id'];return db[_0x0fa9('0x69')][_0x0fa9('0x57')](_0x243a2f[_0x0fa9('0x58')]);}})['then'](respondWithResult(_0x15661a,null))['catch'](handleError(_0x15661a,null));};exports['getAnswers']=function(_0x24c10a,_0x3aa72c,_0x29a900){var _0x2e4e62={'raw':![],'where':{}};var _0x4f4399={};var _0x2898ae={'count':0x0,'rows':[]};return db[_0x0fa9('0x40')][_0x0fa9('0x6a')]({'where':{'id':_0x24c10a[_0x0fa9('0x54')]['id']}})[_0x0fa9('0x21')](handleEntityNotFound(_0x3aa72c,null))[_0x0fa9('0x21')](function(_0x13872c){if(_0x13872c){_0x4f4399[_0x0fa9('0x43')]=_[_0x0fa9('0x44')](db[_0x0fa9('0x69')]['rawAttributes']);_0x4f4399[_0x0fa9('0x45')]=_[_0x0fa9('0x44')](_0x24c10a['query']);_0x4f4399['filters']=_[_0x0fa9('0x47')](_0x4f4399['model'],_0x4f4399[_0x0fa9('0x45')]);_0x2e4e62[_0x0fa9('0x49')]=_['intersection'](_0x4f4399[_0x0fa9('0x43')],qs['fields'](_0x24c10a['query']['fields']));_0x2e4e62[_0x0fa9('0x49')]=_0x2e4e62['attributes'][_0x0fa9('0x4a')]?_0x2e4e62[_0x0fa9('0x49')]:_0x4f4399[_0x0fa9('0x43')];if(!_0x24c10a[_0x0fa9('0x45')]['hasOwnProperty'](_0x0fa9('0x63'))){_0x2e4e62[_0x0fa9('0x30')]=qs[_0x0fa9('0x30')](_0x24c10a[_0x0fa9('0x45')]['limit']);_0x2e4e62[_0x0fa9('0x2e')]=qs['offset'](_0x24c10a[_0x0fa9('0x45')][_0x0fa9('0x2e')]);}_0x2e4e62[_0x0fa9('0x4c')]=qs[_0x0fa9('0x4d')](_0x24c10a[_0x0fa9('0x45')][_0x0fa9('0x4d')]);_0x2e4e62[_0x0fa9('0x4f')]=qs['filters'](_[_0x0fa9('0x6b')](_0x24c10a[_0x0fa9('0x45')],_0x4f4399['filters']));_0x2e4e62[_0x0fa9('0x4f')][_0x0fa9('0x61')]=_0x13872c['id'];if(_0x24c10a[_0x0fa9('0x45')][_0x0fa9('0x4e')]){_0x2e4e62['where']=_[_0x0fa9('0x6c')](_0x2e4e62[_0x0fa9('0x4f')],{'$or':_[_0x0fa9('0x3f')](_0x2e4e62[_0x0fa9('0x49')],function(_0x12a8bd){var _0x162f4c={};_0x162f4c[_0x12a8bd]={'$like':'%'+_0x24c10a[_0x0fa9('0x45')][_0x0fa9('0x4e')]+'%'};return _0x162f4c;})});}_0x2e4e62=_['merge']({},_0x2e4e62,_0x24c10a[_0x0fa9('0x64')]);return db[_0x0fa9('0x69')][_0x0fa9('0x31')]({'where':_0x2e4e62[_0x0fa9('0x4f')]})[_0x0fa9('0x21')](function(_0x541dd9){_0x2898ae[_0x0fa9('0x31')]=_0x541dd9;if(_0x24c10a[_0x0fa9('0x45')][_0x0fa9('0x50')]){_0x2e4e62['include']=[{'all':!![]}];}return db[_0x0fa9('0x69')][_0x0fa9('0x51')](_0x2e4e62);})[_0x0fa9('0x21')](function(_0x5009e3){_0x2898ae[_0x0fa9('0x52')]=_0x5009e3;return _0x2898ae;});}})['then'](respondWithFilteredResult(_0x3aa72c,_0x2e4e62))[_0x0fa9('0x2b')](handleError(_0x3aa72c,null));};exports['removeAnswers']=function(_0x15b21f,_0xa2f0cc,_0xfcee8c){return db[_0x0fa9('0x40')][_0x0fa9('0x56')]({'where':{'id':_0x15b21f[_0x0fa9('0x54')]['id']}})['then'](handleEntityNotFound(_0xa2f0cc,null))['then'](function(_0x49d1d1){if(_0x49d1d1){return _0x49d1d1[_0x0fa9('0x6d')](_0x15b21f[_0x0fa9('0x45')]['ids']);}})[_0x0fa9('0x21')](respondWithStatusCode(_0xa2f0cc,null))[_0x0fa9('0x2b')](handleError(_0xa2f0cc,null));};exports['notify']=function(_0x507fa4,_0x4f7e80,_0x3ccda5){var _0x14e555={'body':_0x507fa4[_0x0fa9('0x58')],'channel':_0x0fa9('0x6e')};var _0x1c26e0=[];var _0x149cad=[];var _0x3b6f8b={};var _0x3c4a67=![];return db['CmContact'][_0x0fa9('0x5f')]()['then'](function(_0x558d2f){if(!_0x558d2f){throw new db['Sequelize'][(_0x0fa9('0x6f'))]('no\x20available\x20attributes');}_0x1c26e0=_[_0x0fa9('0x70')](_[_0x0fa9('0x44')](_0x558d2f),[_0x0fa9('0x71'),_0x0fa9('0x72')]);_0x149cad=_['difference'](_[_0x0fa9('0x44')](_0x558d2f),['createdAt',_0x0fa9('0x72'),_0x0fa9('0x73'),'ListId']);if(_0x507fa4['body']['id']){delete _0x507fa4[_0x0fa9('0x58')]['id'];}if(_['isNil'](_0x507fa4['body']['from'])){throw new db[(_0x0fa9('0x74'))][(_0x0fa9('0x6f'))](_0x0fa9('0x75'));}if(_[_0x0fa9('0x76')](_0x507fa4[_0x0fa9('0x58')][_0x0fa9('0x58')])||_0x507fa4['body']['body']===''){throw new db[(_0x0fa9('0x74'))][(_0x0fa9('0x6f'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x0fa9('0x76')](_0x507fa4[_0x0fa9('0x58')]['mapKey'])){throw new db['Sequelize'][(_0x0fa9('0x6f'))](_0x0fa9('0x77')+_0x149cad);}if(!_[_0x0fa9('0x78')](_0x149cad,_0x507fa4['body']['mapKey'])){throw new db[(_0x0fa9('0x74'))][(_0x0fa9('0x6f'))](_0x0fa9('0x79')+_0x149cad);}_0x3b6f8b[_0x507fa4[_0x0fa9('0x58')][_0x0fa9('0x7a')]]=_0x507fa4[_0x0fa9('0x58')][_0x0fa9('0x7b')];})['then'](function(){return db[_0x0fa9('0x40')]['find']({'where':{'id':_0x507fa4[_0x0fa9('0x54')]['id']},'include':[{'model':db[_0x0fa9('0x7c')],'as':_0x0fa9('0x7d'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x3b6f8b,'limit':0x1,'order':[[_0x0fa9('0x72'),'DESC']]}]},{'model':db[_0x0fa9('0x7e')],'as':_0x0fa9('0x7f')}]});})[_0x0fa9('0x21')](handleEntityNotFound(_0x4f7e80,null))[_0x0fa9('0x21')](function(_0x3fdf1a){if(_0x3fdf1a&&_0x3fdf1a['List']){_0x14e555['account']=_0x3fdf1a;_0x14e555[_0x0fa9('0x80')]=_0x3fdf1a['Applications'];_0x14e555[_0x0fa9('0x81')]=_0x3fdf1a[_0x0fa9('0x7d')];_0x14e555[_0x0fa9('0x80')]=_[_0x0fa9('0x82')](_0x14e555[_0x0fa9('0x80')],[_0x0fa9('0x83')],['asc']);if(_0x14e555[_0x0fa9('0x84')][_0x0fa9('0x7f')]){delete _0x14e555[_0x0fa9('0x84')][_0x0fa9('0x7f')];}if(_0x14e555['account'][_0x0fa9('0x7d')]&&_0x14e555['account'][_0x0fa9('0x7d')][_0x0fa9('0x85')][_0x0fa9('0x4a')]){return _0x14e555['account']['List'][_0x0fa9('0x85')][0x0];}var _0x396f2f=_[_0x0fa9('0x19')](_0x507fa4[_0x0fa9('0x58')],{'firstName':_0x507fa4[_0x0fa9('0x58')][_0x0fa9('0x7b')],'ListId':_0x3fdf1a[_0x0fa9('0x86')]});_0x396f2f[_0x507fa4[_0x0fa9('0x58')][_0x0fa9('0x7a')]]=_0x507fa4[_0x0fa9('0x58')][_0x0fa9('0x7b')];return db[_0x0fa9('0x87')][_0x0fa9('0x57')](_0x396f2f,{'fields':_0x1c26e0,'raw':!![]});}})[_0x0fa9('0x21')](handleEntityNotFound(_0x4f7e80,null))['then'](function(_0x2cdd13){_0x14e555['contact']=_0x2cdd13;if(_0x2cdd13){var _0x172c06={'ContactId':_0x2cdd13['id'],'OpenchannelAccountId':_0x507fa4['params']['id'],'from':(_0x2cdd13[_0x0fa9('0x88')]||'')+'\x20'+(_0x2cdd13['lastName']||'')};var _0x3ed0a9={'OpenchannelAccountId':_0x507fa4[_0x0fa9('0x54')]['id'],'closed':![]};if(_0x507fa4[_0x0fa9('0x58')][_0x0fa9('0x89')]){_0x3ed0a9[_0x0fa9('0x89')]=_0x507fa4[_0x0fa9('0x58')][_0x0fa9('0x89')];return db[_0x0fa9('0x8a')]['find']({'where':_0x3ed0a9})[_0x0fa9('0x21')](function(_0x59d91e){if(_0x59d91e){return[_0x59d91e,![]];}_0x172c06[_0x0fa9('0x89')]=_0x507fa4[_0x0fa9('0x58')][_0x0fa9('0x89')];_0x172c06[_0x0fa9('0x8b')]=_0x507fa4[_0x0fa9('0x58')][_0x0fa9('0x8b')];return db[_0x0fa9('0x8a')]['create'](_0x172c06)['then'](function(_0x3f92f1){return[_0x3f92f1,!![]];});});}else{_0x3ed0a9['threadId']=null;}_0x3ed0a9[_0x0fa9('0x8c')]=_0x2cdd13['id'];return db[_0x0fa9('0x8a')][_0x0fa9('0x56')]({'where':_0x3ed0a9})[_0x0fa9('0x21')](function(_0x5bf758){if(_0x5bf758){return[_0x5bf758,![]];}return db['OpenchannelInteraction'][_0x0fa9('0x57')](_0x172c06)[_0x0fa9('0x21')](function(_0x2fb898){return[_0x2fb898,!![]];});});}})[_0x0fa9('0x8d')](function(_0x49bdea,_0x24c076){if(_0x49bdea){_0x3c4a67=_0x24c076;if(!_0x24c076){var _0x306ce2={'from':(_0x14e555[_0x0fa9('0x8e')]['firstName']||'')+'\x20'+(_0x14e555[_0x0fa9('0x8e')][_0x0fa9('0x8f')]||'')};if(_0x507fa4['body'][_0x0fa9('0x89')]&&_0x507fa4[_0x0fa9('0x58')]['messageId']&&_0x507fa4[_0x0fa9('0x58')]['threadId']!=_0x507fa4[_0x0fa9('0x58')]['messageId']){_0x306ce2[_0x0fa9('0x89')]=_0x507fa4[_0x0fa9('0x58')][_0x0fa9('0x90')];}return _0x49bdea[_0x0fa9('0x91')](_0x306ce2);}else{return _0x49bdea;}}})['then'](function(_0x479e8c){_0x14e555[_0x0fa9('0x92')]=_0x479e8c['get']({'plain':!![]});_0x14e555[_0x0fa9('0x92')][_0x0fa9('0x93')]=_0x3c4a67;if(_0x14e555[_0x0fa9('0x92')]['created']){if(_0x14e555[_0x0fa9('0x84')][_0x0fa9('0x94')]){_0x14e555[_0x0fa9('0x80')][_0x0fa9('0x95')]({'id':0x0,'priority':_0x14e555[_0x0fa9('0x80')][_0x0fa9('0x4a')]+0x1,'app':_0x0fa9('0x96'),'appdata':'unmanaged','interval':_0x0fa9('0x97')});}}return db['OpenchannelMessage'][_0x0fa9('0x57')]({'body':_0x507fa4[_0x0fa9('0x58')][_0x0fa9('0x58')],'OpenchannelAccountId':_0x507fa4[_0x0fa9('0x54')]['id'],'OpenchannelInteractionId':_0x479e8c['id'],'direction':'in','ContactId':_0x14e555[_0x0fa9('0x8e')]['id'],'AttachmentId':_0x507fa4[_0x0fa9('0x58')]['AttachmentId']});})[_0x0fa9('0x21')](function(_0x557dae){_0x14e555[_0x0fa9('0x29')]=_0x557dae;if(_0x14e555[_0x0fa9('0x92')][_0x0fa9('0x98')]){return db[_0x0fa9('0x99')][_0x0fa9('0x56')]({'attributes':['id','name'],'where':{'id':_0x14e555[_0x0fa9('0x92')][_0x0fa9('0x98')]}})[_0x0fa9('0x21')](function(_0x1cf9c0){if(_0x1cf9c0){_0x14e555[_0x0fa9('0x80')][_0x0fa9('0x9a')]({'id':0x0,'priority':0x0,'app':_0x0fa9('0x9b'),'appdata':_0x1cf9c0[_0x0fa9('0x3b')]+','+(_0x14e555[_0x0fa9('0x84')][_0x0fa9('0x9c')]||0xa),'interval':'*,*,*,*'});_0x14e555[_0x0fa9('0x9d')]=![];}return respondWithRpcPromise(_0x0fa9('0x9e'),_0x0fa9('0x9f'),_0x14e555);});}return respondWithRpcPromise(_0x0fa9('0x9e'),'startRouting',_0x14e555);})['then'](function(_0x19e95a){respondWithRpcPromise(_0x0fa9('0xa0'),_0x0fa9('0xa0'),{'event':_0x0fa9('0xa1'),'message':_0x19e95a},client9002);return _0x19e95a;})[_0x0fa9('0x21')](respondWithResult(_0x4f7e80,null))[_0x0fa9('0x2b')](handleError(_0x4f7e80,null));};exports[_0x0fa9('0xa2')]=function(_0x5dde4b,_0x2db369){var _0x59db65=_0x5dde4b[_0x0fa9('0x54')]['id'];var _0x5cd78c=_0x5dde4b[_0x0fa9('0x58')];var _0xd9da97=0xc8;var _0x232e8a=null;return db[_0x0fa9('0xa3')][_0x0fa9('0xa4')]({'isolationLevel':db[_0x0fa9('0xa3')][_0x0fa9('0xa5')][_0x0fa9('0xa6')][_0x0fa9('0xa7')]},function(_0x1ebb8a){return db['OpenchannelAccount'][_0x0fa9('0x6a')]({'where':{'id':_0x59db65},'transaction':_0x1ebb8a})[_0x0fa9('0x21')](function(_0x49f083){if(_0x49f083){return db[_0x0fa9('0x7e')]['destroy']({'where':{'OpenchannelAccountId':_0x59db65},'transaction':_0x1ebb8a})[_0x0fa9('0x21')](function(){var _0x95794b=_[_0x0fa9('0x3f')](_0x5cd78c,function(_0x578a2a){_0x578a2a[_0x0fa9('0x61')]=_0x59db65;return _0x578a2a;});return db['OpenchannelApplication']['bulkCreate'](_0x95794b,{'transaction':_0x1ebb8a});});}else{_0xd9da97=0x194;_0x232e8a=[];}});})[_0x0fa9('0x21')](function(){if(_0xd9da97!==0x194){return db[_0x0fa9('0x7e')][_0x0fa9('0xa8')]({'where':{'OpenchannelAccountId':_0x59db65},'order':_0x0fa9('0x83')})['then'](function(_0x30a4d7){_0x232e8a=_0x30a4d7;});}})[_0x0fa9('0x2b')](function(_0x330611){_0xd9da97=0x1f4;logger[_0x0fa9('0x26')](_0x330611[_0x0fa9('0xa9')]);if(_0x330611[_0x0fa9('0x3b')]){delete _0x330611[_0x0fa9('0x3b')];}_0x232e8a=_0x330611;})[_0x0fa9('0xaa')](function(){if(_0x232e8a===null){_0x2db369[_0x0fa9('0x2c')](_0xd9da97);}else{if(_0xd9da97===0x1f4){_0x2db369[_0x0fa9('0x32')](_0xd9da97)[_0x0fa9('0x3c')](_0x232e8a);}else{_0x2db369[_0x0fa9('0x32')](_0xd9da97)['json'](_0x232e8a);}}});};exports[_0x0fa9('0xab')]=function(_0x1e387f,_0x2b3033,_0x1a59d4){var _0x19e75d={};var _0x189eba={};var _0x2923ee;var _0x22c764;return db['OpenchannelAccount'][_0x0fa9('0x6a')]({'where':{'id':_0x1e387f[_0x0fa9('0x54')]['id']}})[_0x0fa9('0x21')](handleEntityNotFound(_0x2b3033,null))[_0x0fa9('0x21')](function(_0x32c0b3){if(_0x32c0b3){_0x2923ee=_0x32c0b3;_0x189eba[_0x0fa9('0x43')]=_[_0x0fa9('0x44')](db[_0x0fa9('0x7e')][_0x0fa9('0x55')]);_0x189eba[_0x0fa9('0x45')]=_['keys'](_0x1e387f[_0x0fa9('0x45')]);_0x189eba[_0x0fa9('0x46')]=_['intersection'](_0x189eba[_0x0fa9('0x43')],_0x189eba[_0x0fa9('0x45')]);_0x19e75d[_0x0fa9('0x49')]=_[_0x0fa9('0x47')](_0x189eba[_0x0fa9('0x43')],qs[_0x0fa9('0x48')](_0x1e387f[_0x0fa9('0x45')][_0x0fa9('0x48')]));_0x19e75d['attributes']=_0x19e75d['attributes'][_0x0fa9('0x4a')]?_0x19e75d[_0x0fa9('0x49')]:_0x189eba[_0x0fa9('0x43')];_0x19e75d[_0x0fa9('0x4c')]=qs['sort'](_0x1e387f[_0x0fa9('0x45')][_0x0fa9('0x4d')]);_0x19e75d['where']=qs[_0x0fa9('0x46')](_[_0x0fa9('0x6b')](_0x1e387f[_0x0fa9('0x45')],_0x189eba[_0x0fa9('0x46')]));if(_0x1e387f['query'][_0x0fa9('0x4e')]){_0x19e75d['where']=_['merge'](_0x19e75d[_0x0fa9('0x4f')],{'$or':_['map'](_0x19e75d[_0x0fa9('0x49')],function(_0x4f71b2){var _0x23a485={};_0x23a485[_0x4f71b2]={'$like':'%'+_0x1e387f['query'][_0x0fa9('0x4e')]+'%'};return _0x23a485;})});}_0x19e75d=_['merge']({},_0x19e75d,_0x1e387f[_0x0fa9('0x64')]);return _0x2923ee[_0x0fa9('0xab')](_0x19e75d);}})[_0x0fa9('0x21')](function(_0x3864a5){if(_0x3864a5){_0x22c764=_0x3864a5[_0x0fa9('0x4a')];if(!_0x1e387f[_0x0fa9('0x45')][_0x0fa9('0x4b')](_0x0fa9('0x63'))){_0x19e75d[_0x0fa9('0x30')]=qs[_0x0fa9('0x30')](_0x1e387f[_0x0fa9('0x45')]['limit']);_0x19e75d['offset']=qs[_0x0fa9('0x2e')](_0x1e387f[_0x0fa9('0x45')]['offset']);}return _0x2923ee[_0x0fa9('0xab')](_0x19e75d);}})[_0x0fa9('0x21')](function(_0x37d0d4){if(_0x37d0d4){return _0x37d0d4?{'count':_0x22c764,'rows':_0x37d0d4}:null;}})[_0x0fa9('0x21')](respondWithResult(_0x2b3033,null))[_0x0fa9('0x2b')](handleError(_0x2b3033,null));};exports[_0x0fa9('0xac')]=function(_0x269117,_0x5b4b4f,_0x2d9f1f){var _0x230645={'raw':![],'where':{}};var _0x2b1bd0={};var _0x4c6012={'count':0x0,'rows':[]};return db[_0x0fa9('0x40')][_0x0fa9('0x6a')]({'where':{'id':_0x269117[_0x0fa9('0x54')]['id']}})[_0x0fa9('0x21')](handleEntityNotFound(_0x5b4b4f,null))[_0x0fa9('0x21')](function(_0xbbb77d){if(_0xbbb77d){_0x2b1bd0[_0x0fa9('0x43')]=_[_0x0fa9('0x44')](db[_0x0fa9('0x8a')]['rawAttributes']);_0x2b1bd0[_0x0fa9('0x45')]=_['keys'](_0x269117[_0x0fa9('0x45')]);_0x2b1bd0[_0x0fa9('0x46')]=_[_0x0fa9('0x47')](_0x2b1bd0['model'],_0x2b1bd0[_0x0fa9('0x45')]);_0x230645[_0x0fa9('0x49')]=_[_0x0fa9('0x47')](_0x2b1bd0['model'],qs[_0x0fa9('0x48')](_0x269117[_0x0fa9('0x45')][_0x0fa9('0x48')]));_0x230645[_0x0fa9('0x49')]=_0x230645[_0x0fa9('0x49')][_0x0fa9('0x4a')]?_0x230645['attributes']:_0x2b1bd0[_0x0fa9('0x43')];if(!_0x269117[_0x0fa9('0x45')][_0x0fa9('0x4b')](_0x0fa9('0x63'))){_0x230645[_0x0fa9('0x30')]=qs[_0x0fa9('0x30')](_0x269117['query'][_0x0fa9('0x30')]);_0x230645[_0x0fa9('0x2e')]=qs[_0x0fa9('0x2e')](_0x269117['query']['offset']);}_0x230645[_0x0fa9('0x4c')]=qs[_0x0fa9('0x4d')](_0x269117['query'][_0x0fa9('0x4d')]);_0x230645[_0x0fa9('0x4f')]=qs[_0x0fa9('0x46')](_[_0x0fa9('0x6b')](_0x269117['query'],_0x2b1bd0['filters']));_0x230645[_0x0fa9('0x4f')][_0x0fa9('0x61')]=_0xbbb77d['id'];if(_0x269117[_0x0fa9('0x45')]['filter']){_0x230645[_0x0fa9('0x4f')]=_[_0x0fa9('0x6c')](_0x230645[_0x0fa9('0x4f')],{'$or':_[_0x0fa9('0x3f')](_0x230645['attributes'],function(_0x3d9cd6){var _0x36f422={};_0x36f422[_0x3d9cd6]={'$like':'%'+_0x269117['query'][_0x0fa9('0x4e')]+'%'};return _0x36f422;})});}_0x230645=_['merge']({},_0x230645,_0x269117[_0x0fa9('0x64')]);return db['OpenchannelInteraction'][_0x0fa9('0x31')]({'where':_0x230645[_0x0fa9('0x4f')]})[_0x0fa9('0x21')](function(_0xe8c65b){_0x4c6012[_0x0fa9('0x31')]=_0xe8c65b;if(_0x269117['query'][_0x0fa9('0x50')]){_0x230645[_0x0fa9('0x65')]=[{'model':db[_0x0fa9('0x87')],'as':_0x0fa9('0xad'),'required':![]},{'model':db['User'],'as':_0x0fa9('0xae'),'attributes':[_0x0fa9('0x3b'),'fullname',_0x0fa9('0xaf')],'required':![]},{'model':db[_0x0fa9('0xb0')],'as':'Tags','attributes':['id',_0x0fa9('0x3b'),'color'],'where':_0x269117[_0x0fa9('0x45')]['tag']?{'id':_0x269117[_0x0fa9('0x45')][_0x0fa9('0xb1')]}:undefined,'required':_0x269117[_0x0fa9('0x45')][_0x0fa9('0xb1')]?!![]:![]}];}return db['OpenchannelInteraction'][_0x0fa9('0x51')](_0x230645);})[_0x0fa9('0x21')](function(_0xac6beb){_0x4c6012[_0x0fa9('0x52')]=_0xac6beb;return _0x4c6012;});}})['then'](respondWithFilteredResult(_0x5b4b4f,_0x230645))[_0x0fa9('0x2b')](handleError(_0x5b4b4f,null));};exports['addAgents']=function(_0x1913b1,_0x21b8a2,_0x485781){return db[_0x0fa9('0x40')][_0x0fa9('0x56')]({'where':{'id':_0x1913b1[_0x0fa9('0x54')]['id']}})[_0x0fa9('0x21')](handleEntityNotFound(_0x21b8a2,null))[_0x0fa9('0x21')](function(_0x41efc2){if(_0x41efc2){return _0x41efc2[_0x0fa9('0xb2')](_0x1913b1['body'][_0x0fa9('0x67')],_[_0x0fa9('0xb3')](_0x1913b1[_0x0fa9('0x58')],[_0x0fa9('0x67'),'id'])||{})['spread'](function(_0x1fbd80){for(var _0x34e55b=0x0;_0x34e55b<_0x1913b1['body'][_0x0fa9('0x67')][_0x0fa9('0x4a')];_0x34e55b+=0x1){socket['emit'](_0x0fa9('0xb4'),{'UserId':Number(_0x1913b1['body']['ids'][_0x34e55b]),'OpenchannelAccountId':Number(_0x1913b1['params']['id'])});}return _0x1fbd80;});}})[_0x0fa9('0x21')](respondWithResult(_0x21b8a2,null))['catch'](handleError(_0x21b8a2,null));};exports[_0x0fa9('0xb5')]=function(_0x343680,_0x4f5fae,_0x546f00){return db['OpenchannelAccount']['find']({'where':{'id':_0x343680[_0x0fa9('0x54')]['id']}})[_0x0fa9('0x21')](handleEntityNotFound(_0x4f5fae,null))['then'](function(_0x7b6934){if(_0x7b6934){return _0x7b6934['removeAgents'](_0x343680[_0x0fa9('0x45')][_0x0fa9('0x67')])[_0x0fa9('0x21')](function(){if(_[_0x0fa9('0xb6')](_0x343680[_0x0fa9('0x45')][_0x0fa9('0x67')])){for(var _0x4a4d8e=0x0;_0x4a4d8e<_0x343680['query'][_0x0fa9('0x67')]['length'];_0x4a4d8e+=0x1){socket['emit']('userOpenchannelAccount:remove',{'UserId':Number(_0x343680['query'][_0x0fa9('0x67')][_0x4a4d8e]),'OpenchannelAccountId':Number(_0x343680[_0x0fa9('0x54')]['id'])});}}else{socket['emit'](_0x0fa9('0xb7'),{'UserId':Number(_0x343680[_0x0fa9('0x45')][_0x0fa9('0x67')]),'OpenchannelAccountId':Number(_0x343680[_0x0fa9('0x54')]['id'])});}});}})[_0x0fa9('0x21')](respondWithStatusCode(_0x4f5fae,null))[_0x0fa9('0x2b')](handleError(_0x4f5fae,null));};exports[_0x0fa9('0xb8')]=function(_0x2dd04d,_0x47d8e6,_0xe45e30){var _0x737c1f={};var _0x5571d5={};var _0x2d370e;var _0x37f6c7;return db[_0x0fa9('0x40')]['findOne']({'where':{'id':_0x2dd04d[_0x0fa9('0x54')]['id']}})['then'](handleEntityNotFound(_0x47d8e6,null))[_0x0fa9('0x21')](function(_0x335661){if(_0x335661){_0x2d370e=_0x335661;_0x5571d5[_0x0fa9('0x43')]=_[_0x0fa9('0x44')](db[_0x0fa9('0x99')][_0x0fa9('0x55')]);_0x5571d5[_0x0fa9('0x45')]=_[_0x0fa9('0x44')](_0x2dd04d[_0x0fa9('0x45')]);_0x5571d5['filters']=_['intersection'](_0x5571d5['model'],_0x5571d5['query']);_0x737c1f[_0x0fa9('0x49')]=_['intersection'](_0x5571d5[_0x0fa9('0x43')],qs[_0x0fa9('0x48')](_0x2dd04d['query'][_0x0fa9('0x48')]));_0x737c1f[_0x0fa9('0x49')]=_0x737c1f[_0x0fa9('0x49')][_0x0fa9('0x4a')]?_0x737c1f[_0x0fa9('0x49')]:_0x5571d5[_0x0fa9('0x43')];_0x737c1f['order']=qs['sort'](_0x2dd04d[_0x0fa9('0x45')][_0x0fa9('0x4d')]);_0x737c1f[_0x0fa9('0x4f')]=qs['filters'](_[_0x0fa9('0x6b')](_0x2dd04d[_0x0fa9('0x45')],_0x5571d5[_0x0fa9('0x46')]));if(_0x2dd04d[_0x0fa9('0x45')][_0x0fa9('0x4e')]){_0x737c1f[_0x0fa9('0x4f')]=_['merge'](_0x737c1f[_0x0fa9('0x4f')],{'$or':_[_0x0fa9('0x3f')](_0x737c1f[_0x0fa9('0x49')],function(_0x2fd90f){var _0x237b76={};_0x237b76[_0x2fd90f]={'$like':'%'+_0x2dd04d[_0x0fa9('0x45')][_0x0fa9('0x4e')]+'%'};return _0x237b76;})});}_0x737c1f=_[_0x0fa9('0x6c')]({},_0x737c1f,_0x2dd04d['options']);return _0x2d370e[_0x0fa9('0xb8')](_0x737c1f);}})['then'](function(_0x461136){if(_0x461136){_0x37f6c7=_0x461136['length'];if(!_0x2dd04d[_0x0fa9('0x45')][_0x0fa9('0x4b')](_0x0fa9('0x63'))){_0x737c1f[_0x0fa9('0x30')]=qs[_0x0fa9('0x30')](_0x2dd04d[_0x0fa9('0x45')]['limit']);_0x737c1f['offset']=qs['offset'](_0x2dd04d['query'][_0x0fa9('0x2e')]);}return _0x2d370e['getAgents'](_0x737c1f);}})['then'](function(_0x24f28f){if(_0x24f28f){return _0x24f28f?{'count':_0x37f6c7,'rows':_0x24f28f}:null;}})[_0x0fa9('0x21')](respondWithResult(_0x47d8e6,null))[_0x0fa9('0x2b')](handleError(_0x47d8e6,null));};exports[_0x0fa9('0x3c')]=function(_0x5ddfb5,_0x6f7797,_0x417b29){var _0x292306,_0xeac819,_0x212eac;if(_['isNil'](_0x5ddfb5['body']['body'])||_0x5ddfb5[_0x0fa9('0x58')][_0x0fa9('0x58')]===''){throw new db[(_0x0fa9('0x74'))][(_0x0fa9('0x6f'))](_0x0fa9('0xb9'));}if(_['isNil'](_0x5ddfb5[_0x0fa9('0x58')]['to'])){}_0x292306=_0x5ddfb5['body']['to'];return db[_0x0fa9('0x40')]['findOne']({'where':{'id':_0x5ddfb5[_0x0fa9('0x54')]['id']}})['then'](handleEntityNotFound(_0x6f7797,null))[_0x0fa9('0x21')](function(_0x139214){if(_0x139214){return db['OpenchannelAccount'][_0x0fa9('0x56')]({'where':{'id':_0x139214['id']},'include':[{'model':db[_0x0fa9('0x7c')],'as':_0x0fa9('0x7d'),'include':[{'model':db[_0x0fa9('0x87')],'as':_0x0fa9('0x85'),'where':{[_0x139214[_0x0fa9('0x7a')]]:_0x292306},'limit':0x1,'order':[['updatedAt',_0x0fa9('0xba')]]}]}]})[_0x0fa9('0x21')](handleEntityNotFound(_0x6f7797,null))[_0x0fa9('0x21')](function(_0x352202){if(_0x352202&&_0x352202[_0x0fa9('0x7d')]){_0xeac819=_0x352202[_0x0fa9('0x37')]({'plain':!![]});if(_0xeac819[_0x0fa9('0x7d')]&&_0xeac819[_0x0fa9('0x7d')][_0x0fa9('0x85')]['length']){return _0xeac819['List']['Contacts'][0x0];}return db[_0x0fa9('0x87')]['create'](_[_0x0fa9('0x19')](_0x5ddfb5['body'],{'firstName':_0x292306,[_0x352202[_0x0fa9('0x7a')]]:_0x292306,'phone':_0x292306,'ListId':_0xeac819[_0x0fa9('0x86')]}));}})[_0x0fa9('0x21')](handleEntityNotFound(_0x6f7797,null))[_0x0fa9('0x21')](function(_0xc8ad1f){if(_0xc8ad1f){_0x212eac=_0xc8ad1f;return db['OpenchannelInteraction'][_0x0fa9('0x56')]({'where':{'ContactId':_0x212eac['id'],'closed':![],'OpenchannelAccountId':_0xeac819['id']}})[_0x0fa9('0x21')](function(_0x141807){if(_0x141807){return[_0x141807,![]];}return db['OpenchannelInteraction'][_0x0fa9('0x57')]({'UserId':_0x5ddfb5[_0x0fa9('0x59')]['id'],'ContactId':_0x212eac['id'],'OpenchannelAccountId':_0xeac819['id'],'lastMsgDirection':_0x0fa9('0xbb'),'Messages':[_[_0x0fa9('0x6c')](_0x5ddfb5['body'],{'read':![],'body':_0x5ddfb5[_0x0fa9('0x58')][_0x0fa9('0x58')],'OpenchannelAccountId':_0xeac819['id'],'UserId':_0x5ddfb5[_0x0fa9('0x59')]['id'],'ContactId':_0x212eac['id']})]},{'include':[{'model':db[_0x0fa9('0xbc')],'as':_0x0fa9('0xbd')}]})['then'](function(_0x912fac){return[_0x912fac,!![]];});});}})['spread'](function(_0x497415,_0x49ca21){if(_0x49ca21){return _0x497415;}return db[_0x0fa9('0xbc')][_0x0fa9('0x57')](_[_0x0fa9('0x6c')](_0x5ddfb5[_0x0fa9('0x58')],{'read':![],'body':_0x5ddfb5[_0x0fa9('0x58')][_0x0fa9('0x58')],'OpenchannelAccountId':_0xeac819['id'],'OpenchannelInteractionId':_0x497415['id'],'UserId':_0x5ddfb5[_0x0fa9('0x59')]['id'],'ContactId':_0x212eac['id']}))[_0x0fa9('0x21')](function(_0x369143){_0x497415[_0x0fa9('0xbe')][_0x0fa9('0xbd')]=[];_0x497415[_0x0fa9('0xbe')]['Messages'][_0x0fa9('0x95')](_0x369143[_0x0fa9('0xbe')]);return _0x497415;});});}})[_0x0fa9('0x21')](respondWithResult(_0x6f7797,null))[_0x0fa9('0x2b')](handleError(_0x6f7797,null));}; \ No newline at end of file +var _0xe87a=['findOne','hasOwnProperty','pick','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','notify','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','ListId','from\x20is\x20mandatory','isNil','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','Contacts','DESC','OpenchannelApplication','Applications','account','list','applications','orderBy','priority','asc','contact','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','firstName','messageId','interaction','created','autoclose','push','close','unmanaged','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','addApplications','transaction','sequelize','Transaction','bulkCreate','findAndCountAll','finally','getApplications','Contact','internal','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','Messages','dataValues','eml-format','rimraf','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','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','end','status','undefined','limit','offset','count','Content-Range','json','reject','update','destroy','get','OpenchannelAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','type','key','query','keys','filters','model','attributes','intersection','fields','length','nolimit','order','sort','filter','where','merge','VIRTUAL','options','OpenchannelAccount','includeAll','include','findAll','rows','show','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','find','params','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions'];(function(_0x547add,_0x387042){var _0x2ed1f3=function(_0x3bbb4d){while(--_0x3bbb4d){_0x547add['push'](_0x547add['shift']());}};_0x2ed1f3(++_0x387042);}(_0xe87a,0x110));var _0xae87=function(_0x355835,_0x5a3069){_0x355835=_0x355835-0x0;var _0x5236b2=_0xe87a[_0x355835];return _0x5236b2;};'use strict';var emlformat=require(_0xae87('0x0'));var rimraf=require(_0xae87('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xae87('0x2'));var Mustache=require(_0xae87('0x3'));var util=require(_0xae87('0x4'));var path=require(_0xae87('0x5'));var sox=require(_0xae87('0x6'));var csv=require(_0xae87('0x7'));var ejs=require(_0xae87('0x8'));var fs=require('fs');var fs_extra=require(_0xae87('0x9'));var _=require('lodash');var squel=require(_0xae87('0xa'));var crypto=require(_0xae87('0xb'));var jsforce=require(_0xae87('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xae87('0x7'));var querystring=require(_0xae87('0xd'));var Papa=require(_0xae87('0xe'));var Redis=require(_0xae87('0xf'));var authService=require(_0xae87('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xae87('0x11'));var hardwareService=require(_0xae87('0x12'));var logger=require(_0xae87('0x13'))(_0xae87('0x14'));var utils=require('../../config/utils');var config=require(_0xae87('0x15'));var licenseUtil=require(_0xae87('0x16'));var db=require('../../mysqldb')['db'];config[_0xae87('0x17')]=_[_0xae87('0x18')](config[_0xae87('0x17')],{'host':_0xae87('0x19'),'port':0x18eb});var socket=require(_0xae87('0x1a'))(new Redis(config['redis']));require('./openchannelAccount.socket')[_0xae87('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0xae87('0x1c')]['http']({'port':0x232c});var client9002=jayson['client'][_0xae87('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x5ccb35,_0x1e377d,_0x424433,_0x353935){return new BPromise(function(_0x44ca2f,_0x3a8fa1){var _0x5bc7ab=_0x353935||client;return _0x5bc7ab[_0xae87('0x1e')](_0x5ccb35,_0x424433)[_0xae87('0x1f')](function(_0x526ad9){logger[_0xae87('0x20')](_0xae87('0x21'),_0x1e377d,_0xae87('0x22'));logger[_0xae87('0x23')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x1e377d,_0xae87('0x22'),JSON[_0xae87('0x24')](_0x526ad9));if(_0x526ad9[_0xae87('0x25')]){if(_0x526ad9[_0xae87('0x25')][_0xae87('0x26')]===0x1f4){logger[_0xae87('0x25')]('OpenchannelAccount,\x20%s,\x20%s',_0x1e377d,_0x526ad9['error'][_0xae87('0x27')]);return _0x3a8fa1(_0x526ad9[_0xae87('0x25')][_0xae87('0x27')]);}logger['error'](_0xae87('0x21'),_0x1e377d,_0x526ad9['error'][_0xae87('0x27')]);return _0x44ca2f(_0x526ad9[_0xae87('0x25')]['message']);}else{logger[_0xae87('0x20')]('OpenchannelAccount,\x20%s,\x20%s',_0x1e377d,_0xae87('0x22'));_0x44ca2f(_0x526ad9[_0xae87('0x28')]['message']);}})['catch'](function(_0x49ccdf){logger[_0xae87('0x25')]('OpenchannelAccount,\x20%s,\x20%s',_0x1e377d,_0x49ccdf);_0x3a8fa1(_0x49ccdf);});});}function respondWithStatusCode(_0x44cd28,_0x237412){_0x237412=_0x237412||0xcc;return function(_0x3998a9){if(_0x3998a9){return _0x44cd28[_0xae87('0x29')](_0x237412);}return _0x44cd28['status'](_0x237412)[_0xae87('0x2a')]();};}function respondWithResult(_0x45399a,_0x5e3715){_0x5e3715=_0x5e3715||0xc8;return function(_0x5bda79){if(_0x5bda79){return _0x45399a[_0xae87('0x2b')](_0x5e3715)['json'](_0x5bda79);}};}function respondWithFilteredResult(_0x5de3d0,_0x122883){return function(_0x51346c){if(_0x51346c){var _0x3ee52c=typeof _0x122883['offset']===_0xae87('0x2c')&&typeof _0x122883[_0xae87('0x2d')]===_0xae87('0x2c');var _0x11c5c8=_0x51346c['count'];var _0x4bf64b=_0x3ee52c?0x0:_0x122883[_0xae87('0x2e')];var _0x9d3677=_0x3ee52c?_0x51346c[_0xae87('0x2f')]:_0x122883[_0xae87('0x2e')]+_0x122883['limit'];var _0x374694;if(_0x9d3677>=_0x11c5c8){_0x9d3677=_0x11c5c8;_0x374694=0xc8;}else{_0x374694=0xce;}_0x5de3d0[_0xae87('0x2b')](_0x374694);return _0x5de3d0['set'](_0xae87('0x30'),_0x4bf64b+'-'+_0x9d3677+'/'+_0x11c5c8)[_0xae87('0x31')](_0x51346c);}return null;};}function patchUpdates(_0x3cf947){return function(_0x3ef959){try{jsonpatch['apply'](_0x3ef959,_0x3cf947,!![]);}catch(_0x3dfe73){return BPromise[_0xae87('0x32')](_0x3dfe73);}return _0x3ef959['save']();};}function saveUpdates(_0x4aab3d,_0x5c9e87){return function(_0x16e554){if(_0x16e554){return _0x16e554[_0xae87('0x33')](_0x4aab3d)[_0xae87('0x1f')](function(_0x180fe6){return _0x180fe6;});}return null;};}function removeEntity(_0x14837b,_0x5b407d){return function(_0x330460){if(_0x330460){return _0x330460[_0xae87('0x34')]()[_0xae87('0x1f')](function(){var _0x45df8d=_0x330460[_0xae87('0x35')]({'plain':!![]});var _0x450d3d=_0xae87('0x36');return db[_0xae87('0x37')]['destroy']({'where':{'type':_0x450d3d,'resourceId':_0x45df8d['id']}})['then'](function(){return _0x330460;});})[_0xae87('0x1f')](function(){_0x14837b['status'](0xcc)[_0xae87('0x2a')]();});}};}function handleEntityNotFound(_0x55808a,_0x4426ce){return function(_0x555102){if(!_0x555102){_0x55808a[_0xae87('0x29')](0x194);}return _0x555102;};}function handleError(_0x4842b1,_0x5c3982){_0x5c3982=_0x5c3982||0x1f4;return function(_0x2a9238){logger['error'](_0x2a9238[_0xae87('0x38')]);if(_0x2a9238[_0xae87('0x39')]){delete _0x2a9238[_0xae87('0x39')];}_0x4842b1[_0xae87('0x2b')](_0x5c3982)[_0xae87('0x3a')](_0x2a9238);};}exports[_0xae87('0x3b')]=function(_0x557147,_0x400381){var _0x24ce6b={'include':[{'model':db[_0xae87('0x3c')],'as':_0xae87('0x3d')}]},_0x213d1b={},_0x2b4d1a={'count':0x0,'rows':[]};var _0x37cf98=_[_0xae87('0x3e')](db['OpenchannelAccount'][_0xae87('0x3f')],function(_0x37816e){return{'name':_0x37816e['fieldName'],'type':_0x37816e[_0xae87('0x40')][_0xae87('0x41')]};});_0x213d1b['model']=_['map'](_0x37cf98,_0xae87('0x39'));_0x213d1b[_0xae87('0x42')]=_[_0xae87('0x43')](_0x557147[_0xae87('0x42')]);_0x213d1b[_0xae87('0x44')]=_['intersection'](_0x213d1b[_0xae87('0x45')],_0x213d1b['query']);_0x24ce6b[_0xae87('0x46')]=_[_0xae87('0x47')](_0x213d1b['model'],qs[_0xae87('0x48')](_0x557147[_0xae87('0x42')][_0xae87('0x48')]));_0x24ce6b[_0xae87('0x46')]=_0x24ce6b[_0xae87('0x46')][_0xae87('0x49')]?_0x24ce6b[_0xae87('0x46')]:_0x213d1b['model'];if(!_0x557147[_0xae87('0x42')]['hasOwnProperty'](_0xae87('0x4a'))){_0x24ce6b[_0xae87('0x2d')]=qs[_0xae87('0x2d')](_0x557147[_0xae87('0x42')][_0xae87('0x2d')]);_0x24ce6b['offset']=qs[_0xae87('0x2e')](_0x557147[_0xae87('0x42')][_0xae87('0x2e')]);}_0x24ce6b[_0xae87('0x4b')]=qs[_0xae87('0x4c')](_0x557147[_0xae87('0x42')][_0xae87('0x4c')]);_0x24ce6b['where']=qs['filters'](_['pick'](_0x557147[_0xae87('0x42')],_0x213d1b[_0xae87('0x44')]),_0x37cf98);if(_0x557147[_0xae87('0x42')][_0xae87('0x4d')]){_0x24ce6b[_0xae87('0x4e')]=_[_0xae87('0x4f')](_0x24ce6b[_0xae87('0x4e')],{'$or':_['map'](_0x37cf98,function(_0x411b8a){if(_0x411b8a[_0xae87('0x40')]!==_0xae87('0x50')){var _0x4b3556={};_0x4b3556[_0x411b8a[_0xae87('0x39')]]={'$like':'%'+_0x557147[_0xae87('0x42')][_0xae87('0x4d')]+'%'};return _0x4b3556;}})});}_0x24ce6b=_['merge']({},_0x24ce6b,_0x557147[_0xae87('0x51')]);var _0x2efeba={'where':_0x24ce6b[_0xae87('0x4e')]};return db[_0xae87('0x52')][_0xae87('0x2f')](_0x2efeba)[_0xae87('0x1f')](function(_0x4c5ea2){_0x2b4d1a[_0xae87('0x2f')]=_0x4c5ea2;if(_0x557147['query'][_0xae87('0x53')]){_0x24ce6b[_0xae87('0x54')]=[{'all':!![]}];}return db[_0xae87('0x52')][_0xae87('0x55')](_0x24ce6b);})[_0xae87('0x1f')](function(_0x4c2dcb){_0x2b4d1a[_0xae87('0x56')]=_0x4c2dcb;return _0x2b4d1a;})['then'](respondWithFilteredResult(_0x400381,_0x24ce6b))['catch'](handleError(_0x400381,null));};exports[_0xae87('0x57')]=function(_0x3e8b41,_0x4d035e){var _0xba632c={'raw':![],'where':{'id':_0x3e8b41['params']['id']},'include':[{'model':db['Pause'],'as':_0xae87('0x3d')}]},_0x57833b={};_0x57833b[_0xae87('0x45')]=_[_0xae87('0x43')](db[_0xae87('0x52')][_0xae87('0x3f')]);_0x57833b['query']=_[_0xae87('0x43')](_0x3e8b41[_0xae87('0x42')]);_0x57833b[_0xae87('0x44')]=_[_0xae87('0x47')](_0x57833b['model'],_0x57833b[_0xae87('0x42')]);_0xba632c['attributes']=_[_0xae87('0x47')](_0x57833b[_0xae87('0x45')],qs['fields'](_0x3e8b41[_0xae87('0x42')][_0xae87('0x48')]));_0xba632c[_0xae87('0x46')]=_0xba632c[_0xae87('0x46')][_0xae87('0x49')]?_0xba632c[_0xae87('0x46')]:_0x57833b[_0xae87('0x45')];if(_0x3e8b41[_0xae87('0x42')][_0xae87('0x53')]){_0xba632c[_0xae87('0x54')]=[{'all':!![]}];}_0xba632c=_[_0xae87('0x4f')]({},_0xba632c,_0x3e8b41[_0xae87('0x51')]);return db[_0xae87('0x52')]['find'](_0xba632c)[_0xae87('0x1f')](handleEntityNotFound(_0x4d035e,null))[_0xae87('0x1f')](respondWithResult(_0x4d035e,null))[_0xae87('0x58')](handleError(_0x4d035e,null));};exports['create']=function(_0x50d70f,_0x5ba119){return db[_0xae87('0x52')][_0xae87('0x59')](_0x50d70f[_0xae87('0x5a')],{})[_0xae87('0x1f')](function(_0x463e7b){var _0x2f98df=_0x50d70f['user'][_0xae87('0x35')]({'plain':!![]});if(!_0x2f98df)throw new Error(_0xae87('0x5b'));if(_0x2f98df['role']===_0xae87('0x5c')){var _0x65486d=_0x463e7b[_0xae87('0x35')]({'plain':!![]});var _0x33529d=_0xae87('0x36');return db[_0xae87('0x5d')]['find']({'where':{'name':_0x33529d,'userProfileId':_0x2f98df[_0xae87('0x5e')]},'raw':!![]})[_0xae87('0x1f')](function(_0x440ff7){if(_0x440ff7&&_0x440ff7['autoAssociation']===0x0){return db['UserProfileResource'][_0xae87('0x59')]({'name':_0x65486d[_0xae87('0x39')],'resourceId':_0x65486d['id'],'type':_0x440ff7['name'],'sectionId':_0x440ff7['id']},{})[_0xae87('0x1f')](function(){return _0x463e7b;});}else{return _0x463e7b;}})[_0xae87('0x58')](function(_0x17dcd7){logger[_0xae87('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x17dcd7);throw _0x17dcd7;});}return _0x463e7b;})[_0xae87('0x1f')](respondWithResult(_0x5ba119,0xc9))[_0xae87('0x58')](handleError(_0x5ba119,null));};exports[_0xae87('0x33')]=function(_0x51435b,_0x16b300){if(_0x51435b[_0xae87('0x5a')]['id']){delete _0x51435b['body']['id'];}return db[_0xae87('0x52')][_0xae87('0x5f')]({'where':{'id':_0x51435b[_0xae87('0x60')]['id']},'include':[{'model':db[_0xae87('0x3c')],'as':_0xae87('0x3d')}]})[_0xae87('0x1f')](handleEntityNotFound(_0x16b300,null))[_0xae87('0x1f')](saveUpdates(_0x51435b[_0xae87('0x5a')],null))[_0xae87('0x1f')](respondWithResult(_0x16b300,null))[_0xae87('0x58')](handleError(_0x16b300,null));};exports[_0xae87('0x34')]=function(_0x4517ea,_0x22a789){return db[_0xae87('0x52')][_0xae87('0x5f')]({'where':{'id':_0x4517ea[_0xae87('0x60')]['id']}})['then'](handleEntityNotFound(_0x22a789,null))['then'](removeEntity(_0x22a789,null))[_0xae87('0x58')](handleError(_0x22a789,null));};exports[_0xae87('0x61')]=function(_0x5ebe61,_0x37ab76){return db[_0xae87('0x52')][_0xae87('0x61')]()['then'](respondWithResult(_0x37ab76,null))[_0xae87('0x58')](handleError(_0x37ab76,null));};exports[_0xae87('0x62')]=function(_0x3a6f57,_0x41355a,_0x26601b){if(_0x3a6f57[_0xae87('0x5a')]['id']){delete _0x3a6f57[_0xae87('0x5a')]['id'];}return db[_0xae87('0x52')]['find']({'where':{'id':_0x3a6f57[_0xae87('0x60')]['id']}})['then'](handleEntityNotFound(_0x41355a,null))[_0xae87('0x1f')](function(_0x58cf5c){if(_0x58cf5c){_0x3a6f57[_0xae87('0x5a')][_0xae87('0x63')]=_0x58cf5c['id'];return db[_0xae87('0x64')][_0xae87('0x59')](_0x3a6f57[_0xae87('0x5a')]);}})[_0xae87('0x1f')](respondWithResult(_0x41355a,null))[_0xae87('0x58')](handleError(_0x41355a,null));};exports[_0xae87('0x65')]=function(_0x41c9c5,_0x5d8b55,_0x45ad86){var _0x546a0d={'raw':![],'where':{}};var _0xc34444={};var _0x4ac7b4={'count':0x0,'rows':[]};return db[_0xae87('0x52')][_0xae87('0x66')]({'where':{'id':_0x41c9c5[_0xae87('0x60')]['id']}})[_0xae87('0x1f')](handleEntityNotFound(_0x5d8b55,null))[_0xae87('0x1f')](function(_0x4bc87e){if(_0x4bc87e){_0xc34444[_0xae87('0x45')]=_[_0xae87('0x43')](db[_0xae87('0x64')][_0xae87('0x3f')]);_0xc34444[_0xae87('0x42')]=_['keys'](_0x41c9c5['query']);_0xc34444['filters']=_[_0xae87('0x47')](_0xc34444[_0xae87('0x45')],_0xc34444[_0xae87('0x42')]);_0x546a0d[_0xae87('0x46')]=_[_0xae87('0x47')](_0xc34444['model'],qs[_0xae87('0x48')](_0x41c9c5[_0xae87('0x42')][_0xae87('0x48')]));_0x546a0d['attributes']=_0x546a0d[_0xae87('0x46')]['length']?_0x546a0d['attributes']:_0xc34444[_0xae87('0x45')];if(!_0x41c9c5[_0xae87('0x42')][_0xae87('0x67')]('nolimit')){_0x546a0d['limit']=qs['limit'](_0x41c9c5['query'][_0xae87('0x2d')]);_0x546a0d['offset']=qs[_0xae87('0x2e')](_0x41c9c5[_0xae87('0x42')][_0xae87('0x2e')]);}_0x546a0d[_0xae87('0x4b')]=qs[_0xae87('0x4c')](_0x41c9c5['query'][_0xae87('0x4c')]);_0x546a0d[_0xae87('0x4e')]=qs[_0xae87('0x44')](_[_0xae87('0x68')](_0x41c9c5[_0xae87('0x42')],_0xc34444[_0xae87('0x44')]));_0x546a0d[_0xae87('0x4e')][_0xae87('0x63')]=_0x4bc87e['id'];if(_0x41c9c5['query'][_0xae87('0x4d')]){_0x546a0d['where']=_[_0xae87('0x4f')](_0x546a0d[_0xae87('0x4e')],{'$or':_[_0xae87('0x3e')](_0x546a0d[_0xae87('0x46')],function(_0x57b4f2){var _0x2c00ba={};_0x2c00ba[_0x57b4f2]={'$like':'%'+_0x41c9c5['query'][_0xae87('0x4d')]+'%'};return _0x2c00ba;})});}_0x546a0d=_['merge']({},_0x546a0d,_0x41c9c5['options']);return db[_0xae87('0x64')][_0xae87('0x2f')]({'where':_0x546a0d[_0xae87('0x4e')]})[_0xae87('0x1f')](function(_0x3164cb){_0x4ac7b4[_0xae87('0x2f')]=_0x3164cb;if(_0x41c9c5[_0xae87('0x42')]['includeAll']){_0x546a0d['include']=[{'all':!![]}];}return db[_0xae87('0x64')][_0xae87('0x55')](_0x546a0d);})[_0xae87('0x1f')](function(_0x1376e4){_0x4ac7b4['rows']=_0x1376e4;return _0x4ac7b4;});}})[_0xae87('0x1f')](respondWithFilteredResult(_0x5d8b55,_0x546a0d))[_0xae87('0x58')](handleError(_0x5d8b55,null));};exports['removeDispositions']=function(_0xf31984,_0x1d41ba,_0x22e655){return db[_0xae87('0x52')][_0xae87('0x5f')]({'where':{'id':_0xf31984[_0xae87('0x60')]['id']}})['then'](handleEntityNotFound(_0x1d41ba,null))[_0xae87('0x1f')](function(_0xe9b03b){if(_0xe9b03b){return _0xe9b03b[_0xae87('0x69')](_0xf31984['query'][_0xae87('0x6a')]);}})[_0xae87('0x1f')](respondWithStatusCode(_0x1d41ba,null))[_0xae87('0x58')](handleError(_0x1d41ba,null));};exports[_0xae87('0x6b')]=function(_0x3563ce,_0x5d94c8,_0x48895b){if(_0x3563ce['body']['id']){delete _0x3563ce['body']['id'];}return db[_0xae87('0x52')][_0xae87('0x5f')]({'where':{'id':_0x3563ce['params']['id']}})[_0xae87('0x1f')](handleEntityNotFound(_0x5d94c8,null))[_0xae87('0x1f')](function(_0x2b5b50){if(_0x2b5b50){_0x3563ce[_0xae87('0x5a')][_0xae87('0x63')]=_0x2b5b50['id'];return db['CannedAnswer'][_0xae87('0x59')](_0x3563ce[_0xae87('0x5a')]);}})[_0xae87('0x1f')](respondWithResult(_0x5d94c8,null))[_0xae87('0x58')](handleError(_0x5d94c8,null));};exports[_0xae87('0x6c')]=function(_0x495ade,_0x5b9ef4,_0x2aca71){var _0x20173b={'raw':![],'where':{}};var _0x1904f8={};var _0x2a6945={'count':0x0,'rows':[]};return db[_0xae87('0x52')][_0xae87('0x66')]({'where':{'id':_0x495ade['params']['id']}})[_0xae87('0x1f')](handleEntityNotFound(_0x5b9ef4,null))['then'](function(_0x46f8e5){if(_0x46f8e5){_0x1904f8[_0xae87('0x45')]=_[_0xae87('0x43')](db['CannedAnswer']['rawAttributes']);_0x1904f8[_0xae87('0x42')]=_[_0xae87('0x43')](_0x495ade[_0xae87('0x42')]);_0x1904f8[_0xae87('0x44')]=_[_0xae87('0x47')](_0x1904f8[_0xae87('0x45')],_0x1904f8[_0xae87('0x42')]);_0x20173b[_0xae87('0x46')]=_[_0xae87('0x47')](_0x1904f8[_0xae87('0x45')],qs[_0xae87('0x48')](_0x495ade[_0xae87('0x42')][_0xae87('0x48')]));_0x20173b[_0xae87('0x46')]=_0x20173b[_0xae87('0x46')][_0xae87('0x49')]?_0x20173b[_0xae87('0x46')]:_0x1904f8[_0xae87('0x45')];if(!_0x495ade[_0xae87('0x42')][_0xae87('0x67')](_0xae87('0x4a'))){_0x20173b[_0xae87('0x2d')]=qs[_0xae87('0x2d')](_0x495ade[_0xae87('0x42')]['limit']);_0x20173b[_0xae87('0x2e')]=qs['offset'](_0x495ade[_0xae87('0x42')][_0xae87('0x2e')]);}_0x20173b[_0xae87('0x4b')]=qs[_0xae87('0x4c')](_0x495ade[_0xae87('0x42')][_0xae87('0x4c')]);_0x20173b[_0xae87('0x4e')]=qs[_0xae87('0x44')](_[_0xae87('0x68')](_0x495ade[_0xae87('0x42')],_0x1904f8[_0xae87('0x44')]));_0x20173b[_0xae87('0x4e')][_0xae87('0x63')]=_0x46f8e5['id'];if(_0x495ade[_0xae87('0x42')][_0xae87('0x4d')]){_0x20173b[_0xae87('0x4e')]=_['merge'](_0x20173b[_0xae87('0x4e')],{'$or':_[_0xae87('0x3e')](_0x20173b[_0xae87('0x46')],function(_0x4f539f){var _0x16089b={};_0x16089b[_0x4f539f]={'$like':'%'+_0x495ade[_0xae87('0x42')]['filter']+'%'};return _0x16089b;})});}_0x20173b=_[_0xae87('0x4f')]({},_0x20173b,_0x495ade[_0xae87('0x51')]);return db[_0xae87('0x6d')][_0xae87('0x2f')]({'where':_0x20173b[_0xae87('0x4e')]})[_0xae87('0x1f')](function(_0x545a5d){_0x2a6945[_0xae87('0x2f')]=_0x545a5d;if(_0x495ade[_0xae87('0x42')][_0xae87('0x53')]){_0x20173b[_0xae87('0x54')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x20173b);})['then'](function(_0x3bcd2e){_0x2a6945[_0xae87('0x56')]=_0x3bcd2e;return _0x2a6945;});}})[_0xae87('0x1f')](respondWithFilteredResult(_0x5b9ef4,_0x20173b))[_0xae87('0x58')](handleError(_0x5b9ef4,null));};exports[_0xae87('0x6e')]=function(_0x3e72b1,_0x150a21,_0x13b7db){return db['OpenchannelAccount'][_0xae87('0x5f')]({'where':{'id':_0x3e72b1[_0xae87('0x60')]['id']}})[_0xae87('0x1f')](handleEntityNotFound(_0x150a21,null))[_0xae87('0x1f')](function(_0x575f8b){if(_0x575f8b){return _0x575f8b[_0xae87('0x6e')](_0x3e72b1['query'][_0xae87('0x6a')]);}})[_0xae87('0x1f')](respondWithStatusCode(_0x150a21,null))[_0xae87('0x58')](handleError(_0x150a21,null));};exports[_0xae87('0x6f')]=function(_0x19786d,_0x1bf5dd,_0x3b8680){var _0x380d67={'body':_0x19786d[_0xae87('0x5a')],'channel':'openchannel'};var _0x18dff9=[];var _0x2ca272=[];var _0x5e143f={};var _0x3870f6=![];return db[_0xae87('0x70')][_0xae87('0x61')]()['then'](function(_0x5cd93d){if(!_0x5cd93d){throw new db[(_0xae87('0x71'))][(_0xae87('0x72'))](_0xae87('0x73'));}_0x18dff9=_['difference'](_[_0xae87('0x43')](_0x5cd93d),[_0xae87('0x74'),_0xae87('0x75')]);_0x2ca272=_[_0xae87('0x76')](_[_0xae87('0x43')](_0x5cd93d),[_0xae87('0x74'),_0xae87('0x75'),'CompanyId',_0xae87('0x77')]);if(_0x19786d[_0xae87('0x5a')]['id']){delete _0x19786d[_0xae87('0x5a')]['id'];}if(_['isNil'](_0x19786d[_0xae87('0x5a')]['from'])){throw new db['Sequelize']['ValidationError'](_0xae87('0x78'));}if(_[_0xae87('0x79')](_0x19786d[_0xae87('0x5a')][_0xae87('0x5a')])||_0x19786d[_0xae87('0x5a')][_0xae87('0x5a')]===''){throw new db[(_0xae87('0x71'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xae87('0x79')](_0x19786d[_0xae87('0x5a')][_0xae87('0x7a')])){throw new db[(_0xae87('0x71'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2ca272);}if(!_[_0xae87('0x7b')](_0x2ca272,_0x19786d[_0xae87('0x5a')][_0xae87('0x7a')])){throw new db[(_0xae87('0x71'))][(_0xae87('0x72'))](_0xae87('0x7c')+_0x2ca272);}_0x5e143f[_0x19786d[_0xae87('0x5a')]['mapKey']]=_0x19786d[_0xae87('0x5a')][_0xae87('0x7d')];})[_0xae87('0x1f')](function(){return db[_0xae87('0x52')][_0xae87('0x5f')]({'where':{'id':_0x19786d[_0xae87('0x60')]['id']},'include':[{'model':db[_0xae87('0x7e')],'as':_0xae87('0x7f'),'include':[{'model':db[_0xae87('0x70')],'as':_0xae87('0x80'),'where':_0x5e143f,'limit':0x1,'order':[[_0xae87('0x75'),_0xae87('0x81')]]}]},{'model':db[_0xae87('0x82')],'as':_0xae87('0x83')}]});})[_0xae87('0x1f')](handleEntityNotFound(_0x1bf5dd,null))[_0xae87('0x1f')](function(_0x46fde0){if(_0x46fde0&&_0x46fde0[_0xae87('0x7f')]){_0x380d67[_0xae87('0x84')]=_0x46fde0;_0x380d67['applications']=_0x46fde0[_0xae87('0x83')];_0x380d67[_0xae87('0x85')]=_0x46fde0[_0xae87('0x7f')];_0x380d67[_0xae87('0x86')]=_[_0xae87('0x87')](_0x380d67[_0xae87('0x86')],[_0xae87('0x88')],[_0xae87('0x89')]);if(_0x380d67[_0xae87('0x84')][_0xae87('0x83')]){delete _0x380d67[_0xae87('0x84')][_0xae87('0x83')];}if(_0x380d67['account'][_0xae87('0x7f')]&&_0x380d67[_0xae87('0x84')][_0xae87('0x7f')][_0xae87('0x80')]['length']){return _0x380d67['account'][_0xae87('0x7f')][_0xae87('0x80')][0x0];}var _0x111e89=_[_0xae87('0x18')](_0x19786d[_0xae87('0x5a')],{'firstName':_0x19786d['body'][_0xae87('0x7d')],'ListId':_0x46fde0[_0xae87('0x77')]});_0x111e89[_0x19786d[_0xae87('0x5a')][_0xae87('0x7a')]]=_0x19786d[_0xae87('0x5a')][_0xae87('0x7d')];return db['CmContact'][_0xae87('0x59')](_0x111e89,{'fields':_0x18dff9,'raw':!![]});}})[_0xae87('0x1f')](handleEntityNotFound(_0x1bf5dd,null))[_0xae87('0x1f')](function(_0x177eb8){_0x380d67[_0xae87('0x8a')]=_0x177eb8;if(_0x177eb8){var _0xbbafd1={'ContactId':_0x177eb8['id'],'OpenchannelAccountId':_0x19786d['params']['id'],'from':(_0x177eb8['firstName']||'')+'\x20'+(_0x177eb8[_0xae87('0x8b')]||'')};var _0x3d7fe9={'OpenchannelAccountId':_0x19786d[_0xae87('0x60')]['id'],'closed':![]};if(_0x19786d[_0xae87('0x5a')][_0xae87('0x8c')]){_0x3d7fe9[_0xae87('0x8c')]=_0x19786d[_0xae87('0x5a')]['threadId'];return db[_0xae87('0x8d')][_0xae87('0x5f')]({'where':_0x3d7fe9})['then'](function(_0x598841){if(_0x598841){return[_0x598841,![]];}_0xbbafd1['threadId']=_0x19786d[_0xae87('0x5a')][_0xae87('0x8c')];_0xbbafd1[_0xae87('0x8e')]=_0x19786d[_0xae87('0x5a')][_0xae87('0x8e')];return db['OpenchannelInteraction'][_0xae87('0x59')](_0xbbafd1)[_0xae87('0x1f')](function(_0xaf2ac8){return[_0xaf2ac8,!![]];});});}else{_0x3d7fe9[_0xae87('0x8c')]=null;}_0x3d7fe9[_0xae87('0x8f')]=_0x177eb8['id'];return db[_0xae87('0x8d')][_0xae87('0x5f')]({'where':_0x3d7fe9})[_0xae87('0x1f')](function(_0x3345b4){if(_0x3345b4){return[_0x3345b4,![]];}return db[_0xae87('0x8d')][_0xae87('0x59')](_0xbbafd1)['then'](function(_0x1a52f1){return[_0x1a52f1,!![]];});});}})[_0xae87('0x90')](function(_0x3f8890,_0xf87890){if(_0x3f8890){_0x3870f6=_0xf87890;if(!_0xf87890){var _0x1b6029={'from':(_0x380d67[_0xae87('0x8a')][_0xae87('0x91')]||'')+'\x20'+(_0x380d67[_0xae87('0x8a')][_0xae87('0x8b')]||'')};if(_0x19786d[_0xae87('0x5a')][_0xae87('0x8c')]&&_0x19786d[_0xae87('0x5a')]['messageId']&&_0x19786d[_0xae87('0x5a')][_0xae87('0x8c')]!=_0x19786d[_0xae87('0x5a')][_0xae87('0x92')]){_0x1b6029[_0xae87('0x8c')]=_0x19786d[_0xae87('0x5a')][_0xae87('0x92')];}return _0x3f8890[_0xae87('0x33')](_0x1b6029);}else{return _0x3f8890;}}})[_0xae87('0x1f')](function(_0xff2f0b){_0x380d67[_0xae87('0x93')]=_0xff2f0b[_0xae87('0x35')]({'plain':!![]});_0x380d67[_0xae87('0x93')][_0xae87('0x94')]=_0x3870f6;if(_0x380d67[_0xae87('0x93')][_0xae87('0x94')]){if(_0x380d67[_0xae87('0x84')][_0xae87('0x95')]){_0x380d67['applications'][_0xae87('0x96')]({'id':0x0,'priority':_0x380d67[_0xae87('0x86')][_0xae87('0x49')]+0x1,'app':_0xae87('0x97'),'appdata':_0xae87('0x98'),'interval':'*,*,*,*'});}}return db[_0xae87('0x99')][_0xae87('0x59')]({'body':_0x19786d[_0xae87('0x5a')]['body'],'OpenchannelAccountId':_0x19786d[_0xae87('0x60')]['id'],'OpenchannelInteractionId':_0xff2f0b['id'],'direction':'in','ContactId':_0x380d67[_0xae87('0x8a')]['id'],'AttachmentId':_0x19786d[_0xae87('0x5a')][_0xae87('0x9a')]});})[_0xae87('0x1f')](function(_0x5ecd5b){_0x380d67[_0xae87('0x27')]=_0x5ecd5b;if(_0x380d67[_0xae87('0x93')][_0xae87('0x9b')]){return db[_0xae87('0x9c')][_0xae87('0x5f')]({'attributes':['id',_0xae87('0x39')],'where':{'id':_0x380d67['interaction'][_0xae87('0x9b')]}})[_0xae87('0x1f')](function(_0x44a499){if(_0x44a499){_0x380d67[_0xae87('0x86')][_0xae87('0x9d')]({'id':0x0,'priority':0x0,'app':_0xae87('0x9e'),'appdata':_0x44a499[_0xae87('0x39')]+','+(_0x380d67[_0xae87('0x84')]['waitForTheAssignedAgent']||0xa),'interval':_0xae87('0x9f')});_0x380d67[_0xae87('0xa0')]=![];}return respondWithRpcPromise(_0xae87('0xa1'),_0xae87('0xa2'),_0x380d67);});}return respondWithRpcPromise(_0xae87('0xa1'),'startRouting',_0x380d67);})[_0xae87('0x1f')](function(_0x486d8e){respondWithRpcPromise(_0xae87('0xa3'),_0xae87('0xa3'),{'event':'notify','message':_0x486d8e},client9002);return _0x486d8e;})[_0xae87('0x1f')](respondWithResult(_0x1bf5dd,null))['catch'](handleError(_0x1bf5dd,null));};exports[_0xae87('0xa4')]=function(_0x5c84cd,_0x2cd244){var _0x3bd7fe=_0x5c84cd['params']['id'];var _0x48a3f0=_0x5c84cd['body'];var _0x45f528=0xc8;var _0x803673=null;return db['sequelize'][_0xae87('0xa5')]({'isolationLevel':db[_0xae87('0xa6')][_0xae87('0xa7')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x40f4b1){return db[_0xae87('0x52')]['findOne']({'where':{'id':_0x3bd7fe},'transaction':_0x40f4b1})['then'](function(_0x3d6432){if(_0x3d6432){return db['OpenchannelApplication'][_0xae87('0x34')]({'where':{'OpenchannelAccountId':_0x3bd7fe},'transaction':_0x40f4b1})[_0xae87('0x1f')](function(){var _0x494972=_[_0xae87('0x3e')](_0x48a3f0,function(_0x181d7b){_0x181d7b['OpenchannelAccountId']=_0x3bd7fe;return _0x181d7b;});return db[_0xae87('0x82')][_0xae87('0xa8')](_0x494972,{'transaction':_0x40f4b1});});}else{_0x45f528=0x194;_0x803673=[];}});})['then'](function(){if(_0x45f528!==0x194){return db[_0xae87('0x82')][_0xae87('0xa9')]({'where':{'OpenchannelAccountId':_0x3bd7fe},'order':'priority'})['then'](function(_0x15fc81){_0x803673=_0x15fc81;});}})['catch'](function(_0x59557d){_0x45f528=0x1f4;logger[_0xae87('0x25')](_0x59557d[_0xae87('0x38')]);if(_0x59557d[_0xae87('0x39')]){delete _0x59557d[_0xae87('0x39')];}_0x803673=_0x59557d;})[_0xae87('0xaa')](function(){if(_0x803673===null){_0x2cd244[_0xae87('0x29')](_0x45f528);}else{if(_0x45f528===0x1f4){_0x2cd244[_0xae87('0x2b')](_0x45f528)[_0xae87('0x3a')](_0x803673);}else{_0x2cd244[_0xae87('0x2b')](_0x45f528)['json'](_0x803673);}}});};exports[_0xae87('0xab')]=function(_0x1a498f,_0xd0014b,_0x34e1d3){var _0x5836ad={};var _0x277d56={};var _0x176ffd;var _0x59af22;return db['OpenchannelAccount'][_0xae87('0x66')]({'where':{'id':_0x1a498f['params']['id']}})[_0xae87('0x1f')](handleEntityNotFound(_0xd0014b,null))[_0xae87('0x1f')](function(_0x3546c8){if(_0x3546c8){_0x176ffd=_0x3546c8;_0x277d56['model']=_['keys'](db['OpenchannelApplication']['rawAttributes']);_0x277d56[_0xae87('0x42')]=_['keys'](_0x1a498f[_0xae87('0x42')]);_0x277d56[_0xae87('0x44')]=_[_0xae87('0x47')](_0x277d56[_0xae87('0x45')],_0x277d56[_0xae87('0x42')]);_0x5836ad[_0xae87('0x46')]=_[_0xae87('0x47')](_0x277d56['model'],qs[_0xae87('0x48')](_0x1a498f[_0xae87('0x42')][_0xae87('0x48')]));_0x5836ad[_0xae87('0x46')]=_0x5836ad[_0xae87('0x46')][_0xae87('0x49')]?_0x5836ad[_0xae87('0x46')]:_0x277d56[_0xae87('0x45')];_0x5836ad[_0xae87('0x4b')]=qs[_0xae87('0x4c')](_0x1a498f[_0xae87('0x42')][_0xae87('0x4c')]);_0x5836ad[_0xae87('0x4e')]=qs[_0xae87('0x44')](_[_0xae87('0x68')](_0x1a498f[_0xae87('0x42')],_0x277d56[_0xae87('0x44')]));if(_0x1a498f[_0xae87('0x42')]['filter']){_0x5836ad[_0xae87('0x4e')]=_['merge'](_0x5836ad[_0xae87('0x4e')],{'$or':_['map'](_0x5836ad[_0xae87('0x46')],function(_0x132586){var _0x9706db={};_0x9706db[_0x132586]={'$like':'%'+_0x1a498f[_0xae87('0x42')][_0xae87('0x4d')]+'%'};return _0x9706db;})});}_0x5836ad=_[_0xae87('0x4f')]({},_0x5836ad,_0x1a498f[_0xae87('0x51')]);return _0x176ffd[_0xae87('0xab')](_0x5836ad);}})[_0xae87('0x1f')](function(_0x1ba00d){if(_0x1ba00d){_0x59af22=_0x1ba00d[_0xae87('0x49')];if(!_0x1a498f[_0xae87('0x42')]['hasOwnProperty'](_0xae87('0x4a'))){_0x5836ad[_0xae87('0x2d')]=qs[_0xae87('0x2d')](_0x1a498f[_0xae87('0x42')][_0xae87('0x2d')]);_0x5836ad[_0xae87('0x2e')]=qs[_0xae87('0x2e')](_0x1a498f[_0xae87('0x42')]['offset']);}return _0x176ffd['getApplications'](_0x5836ad);}})[_0xae87('0x1f')](function(_0x47eab1){if(_0x47eab1){return _0x47eab1?{'count':_0x59af22,'rows':_0x47eab1}:null;}})['then'](respondWithResult(_0xd0014b,null))[_0xae87('0x58')](handleError(_0xd0014b,null));};exports['getInteractions']=function(_0x53a66f,_0x22b968,_0x27b7c9){var _0x1f6685={'raw':![],'where':{}};var _0x3e299a={};var _0x19bc3f={'count':0x0,'rows':[]};return db[_0xae87('0x52')][_0xae87('0x66')]({'where':{'id':_0x53a66f[_0xae87('0x60')]['id']}})[_0xae87('0x1f')](handleEntityNotFound(_0x22b968,null))['then'](function(_0x1ee035){if(_0x1ee035){_0x3e299a[_0xae87('0x45')]=_['keys'](db[_0xae87('0x8d')]['rawAttributes']);_0x3e299a['query']=_[_0xae87('0x43')](_0x53a66f[_0xae87('0x42')]);_0x3e299a[_0xae87('0x44')]=_[_0xae87('0x47')](_0x3e299a[_0xae87('0x45')],_0x3e299a[_0xae87('0x42')]);_0x1f6685[_0xae87('0x46')]=_[_0xae87('0x47')](_0x3e299a['model'],qs[_0xae87('0x48')](_0x53a66f['query'][_0xae87('0x48')]));_0x1f6685['attributes']=_0x1f6685[_0xae87('0x46')][_0xae87('0x49')]?_0x1f6685[_0xae87('0x46')]:_0x3e299a[_0xae87('0x45')];if(!_0x53a66f[_0xae87('0x42')]['hasOwnProperty']('nolimit')){_0x1f6685[_0xae87('0x2d')]=qs[_0xae87('0x2d')](_0x53a66f['query'][_0xae87('0x2d')]);_0x1f6685['offset']=qs[_0xae87('0x2e')](_0x53a66f[_0xae87('0x42')]['offset']);}_0x1f6685[_0xae87('0x4b')]=qs[_0xae87('0x4c')](_0x53a66f[_0xae87('0x42')][_0xae87('0x4c')]);_0x1f6685['where']=qs['filters'](_[_0xae87('0x68')](_0x53a66f[_0xae87('0x42')],_0x3e299a[_0xae87('0x44')]));_0x1f6685[_0xae87('0x4e')][_0xae87('0x63')]=_0x1ee035['id'];if(_0x53a66f[_0xae87('0x42')][_0xae87('0x4d')]){_0x1f6685[_0xae87('0x4e')]=_[_0xae87('0x4f')](_0x1f6685[_0xae87('0x4e')],{'$or':_['map'](_0x1f6685[_0xae87('0x46')],function(_0x5e3f4d){var _0x49ad55={};_0x49ad55[_0x5e3f4d]={'$like':'%'+_0x53a66f[_0xae87('0x42')]['filter']+'%'};return _0x49ad55;})});}_0x1f6685=_['merge']({},_0x1f6685,_0x53a66f[_0xae87('0x51')]);return db[_0xae87('0x8d')][_0xae87('0x2f')]({'where':_0x1f6685[_0xae87('0x4e')]})[_0xae87('0x1f')](function(_0x44b775){_0x19bc3f[_0xae87('0x2f')]=_0x44b775;if(_0x53a66f[_0xae87('0x42')][_0xae87('0x53')]){_0x1f6685[_0xae87('0x54')]=[{'model':db['CmContact'],'as':_0xae87('0xac'),'required':![]},{'model':db[_0xae87('0x9c')],'as':'Owner','attributes':[_0xae87('0x39'),'fullname',_0xae87('0xad')],'required':![]},{'model':db['Tag'],'as':_0xae87('0xae'),'attributes':['id','name',_0xae87('0xaf')],'where':_0x53a66f[_0xae87('0x42')]['tag']?{'id':_0x53a66f[_0xae87('0x42')][_0xae87('0xb0')]}:undefined,'required':_0x53a66f[_0xae87('0x42')]['tag']?!![]:![]}];}return db[_0xae87('0x8d')][_0xae87('0x55')](_0x1f6685);})[_0xae87('0x1f')](function(_0x5af5fd){_0x19bc3f['rows']=_0x5af5fd;return _0x19bc3f;});}})[_0xae87('0x1f')](respondWithFilteredResult(_0x22b968,_0x1f6685))[_0xae87('0x58')](handleError(_0x22b968,null));};exports['addAgents']=function(_0x1d6d0e,_0x324df1,_0x5c481f){return db[_0xae87('0x52')]['find']({'where':{'id':_0x1d6d0e[_0xae87('0x60')]['id']}})[_0xae87('0x1f')](handleEntityNotFound(_0x324df1,null))[_0xae87('0x1f')](function(_0x3fde77){if(_0x3fde77){return _0x3fde77[_0xae87('0xb1')](_0x1d6d0e[_0xae87('0x5a')][_0xae87('0x6a')],_[_0xae87('0xb2')](_0x1d6d0e[_0xae87('0x5a')],[_0xae87('0x6a'),'id'])||{})[_0xae87('0x90')](function(_0xa0ebd2){for(var _0x12312a=0x0;_0x12312a<_0x1d6d0e[_0xae87('0x5a')][_0xae87('0x6a')][_0xae87('0x49')];_0x12312a+=0x1){socket[_0xae87('0xb3')](_0xae87('0xb4'),{'UserId':Number(_0x1d6d0e[_0xae87('0x5a')][_0xae87('0x6a')][_0x12312a]),'OpenchannelAccountId':Number(_0x1d6d0e['params']['id'])});}return _0xa0ebd2;});}})[_0xae87('0x1f')](respondWithResult(_0x324df1,null))[_0xae87('0x58')](handleError(_0x324df1,null));};exports['removeAgents']=function(_0x28b899,_0x36b2b6,_0x1c7d06){return db[_0xae87('0x52')][_0xae87('0x5f')]({'where':{'id':_0x28b899['params']['id']}})[_0xae87('0x1f')](handleEntityNotFound(_0x36b2b6,null))['then'](function(_0x531e0e){if(_0x531e0e){return _0x531e0e[_0xae87('0xb5')](_0x28b899[_0xae87('0x42')][_0xae87('0x6a')])[_0xae87('0x1f')](function(){if(_[_0xae87('0xb6')](_0x28b899[_0xae87('0x42')][_0xae87('0x6a')])){for(var _0x2c113b=0x0;_0x2c113b<_0x28b899[_0xae87('0x42')]['ids'][_0xae87('0x49')];_0x2c113b+=0x1){socket[_0xae87('0xb3')]('userOpenchannelAccount:remove',{'UserId':Number(_0x28b899[_0xae87('0x42')][_0xae87('0x6a')][_0x2c113b]),'OpenchannelAccountId':Number(_0x28b899[_0xae87('0x60')]['id'])});}}else{socket[_0xae87('0xb3')]('userOpenchannelAccount:remove',{'UserId':Number(_0x28b899[_0xae87('0x42')][_0xae87('0x6a')]),'OpenchannelAccountId':Number(_0x28b899[_0xae87('0x60')]['id'])});}});}})[_0xae87('0x1f')](respondWithStatusCode(_0x36b2b6,null))[_0xae87('0x58')](handleError(_0x36b2b6,null));};exports[_0xae87('0xb7')]=function(_0xcf7a88,_0x575f50,_0x5f96d6){var _0x5701c2={};var _0x1bb3d0={};var _0x1a6dae;var _0x173bb5;return db['OpenchannelAccount'][_0xae87('0x66')]({'where':{'id':_0xcf7a88[_0xae87('0x60')]['id']}})[_0xae87('0x1f')](handleEntityNotFound(_0x575f50,null))[_0xae87('0x1f')](function(_0x421a0d){if(_0x421a0d){_0x1a6dae=_0x421a0d;_0x1bb3d0[_0xae87('0x45')]=_['keys'](db[_0xae87('0x9c')][_0xae87('0x3f')]);_0x1bb3d0['query']=_[_0xae87('0x43')](_0xcf7a88[_0xae87('0x42')]);_0x1bb3d0[_0xae87('0x44')]=_['intersection'](_0x1bb3d0['model'],_0x1bb3d0[_0xae87('0x42')]);_0x5701c2[_0xae87('0x46')]=_[_0xae87('0x47')](_0x1bb3d0[_0xae87('0x45')],qs[_0xae87('0x48')](_0xcf7a88[_0xae87('0x42')][_0xae87('0x48')]));_0x5701c2[_0xae87('0x46')]=_0x5701c2[_0xae87('0x46')][_0xae87('0x49')]?_0x5701c2[_0xae87('0x46')]:_0x1bb3d0[_0xae87('0x45')];_0x5701c2[_0xae87('0x4b')]=qs[_0xae87('0x4c')](_0xcf7a88[_0xae87('0x42')][_0xae87('0x4c')]);_0x5701c2[_0xae87('0x4e')]=qs[_0xae87('0x44')](_['pick'](_0xcf7a88[_0xae87('0x42')],_0x1bb3d0[_0xae87('0x44')]));if(_0xcf7a88[_0xae87('0x42')][_0xae87('0x4d')]){_0x5701c2['where']=_['merge'](_0x5701c2['where'],{'$or':_[_0xae87('0x3e')](_0x5701c2[_0xae87('0x46')],function(_0xc4f9bf){var _0x515d1f={};_0x515d1f[_0xc4f9bf]={'$like':'%'+_0xcf7a88[_0xae87('0x42')][_0xae87('0x4d')]+'%'};return _0x515d1f;})});}_0x5701c2=_['merge']({},_0x5701c2,_0xcf7a88[_0xae87('0x51')]);return _0x1a6dae[_0xae87('0xb7')](_0x5701c2);}})[_0xae87('0x1f')](function(_0x24d128){if(_0x24d128){_0x173bb5=_0x24d128[_0xae87('0x49')];if(!_0xcf7a88[_0xae87('0x42')][_0xae87('0x67')](_0xae87('0x4a'))){_0x5701c2['limit']=qs[_0xae87('0x2d')](_0xcf7a88[_0xae87('0x42')][_0xae87('0x2d')]);_0x5701c2['offset']=qs[_0xae87('0x2e')](_0xcf7a88[_0xae87('0x42')]['offset']);}return _0x1a6dae[_0xae87('0xb7')](_0x5701c2);}})[_0xae87('0x1f')](function(_0x277005){if(_0x277005){return _0x277005?{'count':_0x173bb5,'rows':_0x277005}:null;}})[_0xae87('0x1f')](respondWithResult(_0x575f50,null))[_0xae87('0x58')](handleError(_0x575f50,null));};exports[_0xae87('0x3a')]=function(_0x245b19,_0x1c7387,_0x124809){var _0x55b646,_0x327466,_0x253173;if(_['isNil'](_0x245b19[_0xae87('0x5a')][_0xae87('0x5a')])||_0x245b19[_0xae87('0x5a')][_0xae87('0x5a')]===''){throw new db[(_0xae87('0x71'))]['ValidationError'](_0xae87('0xb8'));}if(_['isNil'](_0x245b19[_0xae87('0x5a')]['to'])){}_0x55b646=_0x245b19[_0xae87('0x5a')]['to'];return db[_0xae87('0x52')][_0xae87('0x66')]({'where':{'id':_0x245b19[_0xae87('0x60')]['id']}})[_0xae87('0x1f')](handleEntityNotFound(_0x1c7387,null))['then'](function(_0x645e61){if(_0x645e61){return db[_0xae87('0x52')][_0xae87('0x5f')]({'where':{'id':_0x645e61['id']},'include':[{'model':db['CmList'],'as':_0xae87('0x7f'),'include':[{'model':db['CmContact'],'as':_0xae87('0x80'),'where':{[_0x645e61['mapKey']]:_0x55b646},'limit':0x1,'order':[[_0xae87('0x75'),_0xae87('0x81')]]}]}]})['then'](handleEntityNotFound(_0x1c7387,null))['then'](function(_0x11ad67){if(_0x11ad67&&_0x11ad67[_0xae87('0x7f')]){_0x327466=_0x11ad67[_0xae87('0x35')]({'plain':!![]});if(_0x327466['List']&&_0x327466[_0xae87('0x7f')]['Contacts'][_0xae87('0x49')]){return _0x327466[_0xae87('0x7f')][_0xae87('0x80')][0x0];}return db[_0xae87('0x70')][_0xae87('0x59')](_[_0xae87('0x18')](_0x245b19[_0xae87('0x5a')],{'firstName':_0x55b646,[_0x11ad67[_0xae87('0x7a')]]:_0x55b646,'phone':_0x55b646,'ListId':_0x327466[_0xae87('0x77')]}));}})[_0xae87('0x1f')](handleEntityNotFound(_0x1c7387,null))[_0xae87('0x1f')](function(_0x466dde){if(_0x466dde){_0x253173=_0x466dde;return db[_0xae87('0x8d')]['find']({'where':{'ContactId':_0x253173['id'],'closed':![],'OpenchannelAccountId':_0x327466['id']}})[_0xae87('0x1f')](function(_0x172f32){if(_0x172f32){return[_0x172f32,![]];}return db['OpenchannelInteraction'][_0xae87('0x59')]({'UserId':_0x245b19['user']['id'],'ContactId':_0x253173['id'],'OpenchannelAccountId':_0x327466['id'],'lastMsgDirection':'out','Messages':[_[_0xae87('0x4f')](_0x245b19['body'],{'read':![],'body':_0x245b19[_0xae87('0x5a')]['body'],'OpenchannelAccountId':_0x327466['id'],'UserId':_0x245b19[_0xae87('0x5c')]['id'],'ContactId':_0x253173['id']})]},{'include':[{'model':db[_0xae87('0x99')],'as':_0xae87('0xb9')}]})[_0xae87('0x1f')](function(_0x3e5544){return[_0x3e5544,!![]];});});}})[_0xae87('0x90')](function(_0x54924a,_0x3b0a6a){if(_0x3b0a6a){return _0x54924a;}return db['OpenchannelMessage'][_0xae87('0x59')](_['merge'](_0x245b19[_0xae87('0x5a')],{'read':![],'body':_0x245b19[_0xae87('0x5a')][_0xae87('0x5a')],'OpenchannelAccountId':_0x327466['id'],'OpenchannelInteractionId':_0x54924a['id'],'UserId':_0x245b19[_0xae87('0x5c')]['id'],'ContactId':_0x253173['id']}))['then'](function(_0x35a6a6){_0x54924a['dataValues']['Messages']=[];_0x54924a[_0xae87('0xba')][_0xae87('0xb9')][_0xae87('0x96')](_0x35a6a6[_0xae87('0xba')]);return _0x54924a;});});}})[_0xae87('0x1f')](respondWithResult(_0x1c7387,null))[_0xae87('0x58')](handleError(_0x1c7387,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 64a36a6..dfc7c40 100644 --- a/server/api/openchannelAccount/openchannelAccount.events.js +++ b/server/api/openchannelAccount/openchannelAccount.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa75b=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x589722,_0xcea6fc){var _0x31eb3f=function(_0x24913b){while(--_0x24913b){_0x589722['push'](_0x589722['shift']());}};_0x31eb3f(++_0xcea6fc);}(_0xa75b,0x170));var _0xba75=function(_0x28d7e5,_0x4eacda){_0x28d7e5=_0x28d7e5-0x0;var _0xfcb0a0=_0xa75b[_0x28d7e5];return _0xfcb0a0;};'use strict';var EventEmitter=require(_0xba75('0x0'));var OpenchannelAccount=require('../../mysqldb')['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xba75('0x1')](0x0);var events={'afterCreate':_0xba75('0x2'),'afterUpdate':_0xba75('0x3'),'afterDestroy':_0xba75('0x4')};function emitEvent(_0x1760c0){return function(_0x336606,_0x152269,_0x398bd5){OpenchannelAccountEvents[_0xba75('0x5')](_0x1760c0+':'+_0x336606['id'],_0x336606);OpenchannelAccountEvents[_0xba75('0x5')](_0x1760c0,_0x336606);_0x398bd5(null);};}for(var e in events){if(events[_0xba75('0x6')](e)){var event=events[e];OpenchannelAccount[_0xba75('0x7')](e,emitEvent(event));}}module[_0xba75('0x8')]=OpenchannelAccountEvents; \ No newline at end of file +var _0xb903=['setMaxListeners','update','remove','emit','hasOwnProperty','events','../../mysqldb','OpenchannelAccount'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0xb903,0x185));var _0x3b90=function(_0x25643d,_0x3eb3eb){_0x25643d=_0x25643d-0x0;var _0xe63a6a=_0xb903[_0x25643d];return _0xe63a6a;};'use strict';var EventEmitter=require(_0x3b90('0x0'));var OpenchannelAccount=require(_0x3b90('0x1'))['db'][_0x3b90('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x3b90('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3b90('0x4'),'afterDestroy':_0x3b90('0x5')};function emitEvent(_0x3b024a){return function(_0x1cd5d8,_0x30d8db,_0x40f726){OpenchannelAccountEvents[_0x3b90('0x6')](_0x3b024a+':'+_0x1cd5d8['id'],_0x1cd5d8);OpenchannelAccountEvents['emit'](_0x3b024a,_0x1cd5d8);_0x40f726(null);};}for(var e in events){if(events[_0x3b90('0x7')](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 7750b00..fbc4185 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(_0x4c42dc,_0x576416){var _0x41bec7=function(_0xde5141){while(--_0xde5141){_0x4c42dc['push'](_0x4c42dc['shift']());}};_0x41bec7(++_0x576416);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'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(_0x6cce58,_0x53f220){var _0x3b76cb=function(_0x59b0d3){while(--_0x59b0d3){_0x6cce58['push'](_0x6cce58['shift']());}};_0x3b76cb(++_0x53f220);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'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 1a9795f..119976a 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 _0x4746=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x4746,0xc6));var _0x6474=function(_0x5442e7,_0x1a4021){_0x5442e7=_0x5442e7-0x0;var _0x583552=_0x4746[_0x5442e7];return _0x583552;};'use strict';var _=require(_0x6474('0x0'));var util=require(_0x6474('0x1'));var moment=require('moment');var BPromise=require(_0x6474('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6474('0x3'));var db=require(_0x6474('0x4'))['db'];var utils=require(_0x6474('0x5'));var logger=require(_0x6474('0x6'))(_0x6474('0x7'));var config=require('../../config/environment');var jayson=require(_0x6474('0x8'));var client=jayson[_0x6474('0x9')]['http']({'port':0x232a});config[_0x6474('0xa')]=_[_0x6474('0xb')](config[_0x6474('0xa')],{'host':_0x6474('0xc'),'port':0x18eb});var socket=require(_0x6474('0xd'))(new Redis(config[_0x6474('0xa')]));require('./openchannelAccount.socket')[_0x6474('0xe')](socket);function respondWithRpcPromise(_0x5bbee1,_0x5335ac,_0x347697){return new BPromise(function(_0x1a202c,_0x4c970d){return client[_0x6474('0xf')](_0x5bbee1,_0x347697)['then'](function(_0x212cda){logger['info'](_0x6474('0x10'),_0x5335ac,_0x6474('0x11'));logger['debug']('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x5335ac,'request\x20sent',JSON[_0x6474('0x12')](_0x212cda));if(_0x212cda[_0x6474('0x13')]){if(_0x212cda[_0x6474('0x13')][_0x6474('0x14')]===0x1f4){logger[_0x6474('0x13')](_0x6474('0x10'),_0x5335ac,_0x212cda[_0x6474('0x13')][_0x6474('0x15')]);return _0x4c970d(_0x212cda[_0x6474('0x13')]['message']);}logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x5335ac,_0x212cda[_0x6474('0x13')][_0x6474('0x15')]);return _0x1a202c(_0x212cda[_0x6474('0x13')][_0x6474('0x15')]);}else{logger[_0x6474('0x16')]('OpenchannelAccount,\x20%s,\x20%s',_0x5335ac,_0x6474('0x11'));_0x1a202c(_0x212cda[_0x6474('0x17')][_0x6474('0x15')]);}})[_0x6474('0x18')](function(_0x17a086){logger[_0x6474('0x13')](_0x6474('0x10'),_0x5335ac,_0x17a086);_0x4c970d(_0x17a086);});});} \ No newline at end of file +var _0x593e=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0x4657d7,_0x19fffb){var _0x51816e=function(_0x53747f){while(--_0x53747f){_0x4657d7['push'](_0x4657d7['shift']());}};_0x51816e(++_0x19fffb);}(_0x593e,0xcb));var _0xe593=function(_0x22e6d6,_0x57c25f){_0x22e6d6=_0x22e6d6-0x0;var _0x7ec020=_0x593e[_0x22e6d6];return _0x7ec020;};'use strict';var _=require(_0xe593('0x0'));var util=require(_0xe593('0x1'));var moment=require(_0xe593('0x2'));var BPromise=require(_0xe593('0x3'));var rs=require(_0xe593('0x4'));var fs=require('fs');var Redis=require(_0xe593('0x5'));var db=require(_0xe593('0x6'))['db'];var utils=require(_0xe593('0x7'));var logger=require('../../config/logger')(_0xe593('0x8'));var config=require(_0xe593('0x9'));var jayson=require(_0xe593('0xa'));var client=jayson[_0xe593('0xb')][_0xe593('0xc')]({'port':0x232a});config[_0xe593('0xd')]=_[_0xe593('0xe')](config[_0xe593('0xd')],{'host':_0xe593('0xf'),'port':0x18eb});var socket=require(_0xe593('0x10'))(new Redis(config['redis']));require(_0xe593('0x11'))[_0xe593('0x12')](socket);function respondWithRpcPromise(_0x38d977,_0x5ba75c,_0x5f1222){return new BPromise(function(_0x3032ee,_0xeefe30){return client[_0xe593('0x13')](_0x38d977,_0x5f1222)['then'](function(_0x6a5d4f){logger[_0xe593('0x14')](_0xe593('0x15'),_0x5ba75c,_0xe593('0x16'));logger[_0xe593('0x17')](_0xe593('0x18'),_0x5ba75c,_0xe593('0x16'),JSON[_0xe593('0x19')](_0x6a5d4f));if(_0x6a5d4f[_0xe593('0x1a')]){if(_0x6a5d4f[_0xe593('0x1a')]['code']===0x1f4){logger[_0xe593('0x1a')](_0xe593('0x15'),_0x5ba75c,_0x6a5d4f['error'][_0xe593('0x1b')]);return _0xeefe30(_0x6a5d4f[_0xe593('0x1a')]['message']);}logger[_0xe593('0x1a')](_0xe593('0x15'),_0x5ba75c,_0x6a5d4f[_0xe593('0x1a')][_0xe593('0x1b')]);return _0x3032ee(_0x6a5d4f[_0xe593('0x1a')][_0xe593('0x1b')]);}else{logger['info'](_0xe593('0x15'),_0x5ba75c,_0xe593('0x16'));_0x3032ee(_0x6a5d4f['result'][_0xe593('0x1b')]);}})[_0xe593('0x1c')](function(_0x56b4ff){logger[_0xe593('0x1a')](_0xe593('0x15'),_0x5ba75c,_0x56b4ff);_0xeefe30(_0x56b4ff);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 042771c..74f6b3d 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 _0x1020=['./openchannelAccount.events','remove','update','emit','removeListener','register','length'];(function(_0x389a61,_0x20216c){var _0x1acde9=function(_0x3c72d3){while(--_0x3c72d3){_0x389a61['push'](_0x389a61['shift']());}};_0x1acde9(++_0x20216c);}(_0x1020,0x1a4));var _0x0102=function(_0x33155c,_0x3fdde1){_0x33155c=_0x33155c-0x0;var _0x5becf7=_0x1020[_0x33155c];return _0x5becf7;};'use strict';var OpenchannelAccountEvents=require(_0x0102('0x0'));var events=['save',_0x0102('0x1'),_0x0102('0x2')];function createListener(_0x35fd2b,_0x15aee5){return function(_0x1240be){_0x15aee5[_0x0102('0x3')](_0x35fd2b,_0x1240be);};}function removeListener(_0x2fea82,_0x3d59aa){return function(){OpenchannelAccountEvents[_0x0102('0x4')](_0x2fea82,_0x3d59aa);};}exports[_0x0102('0x5')]=function(_0x27dd86){for(var _0x3afe31=0x0,_0x55229f=events[_0x0102('0x6')];_0x3afe31<_0x55229f;_0x3afe31++){var _0x1aa60e=events[_0x3afe31];var _0x43df9f=createListener('openchannelAccount:'+_0x1aa60e,_0x27dd86);OpenchannelAccountEvents['on'](_0x1aa60e,_0x43df9f);}}; \ No newline at end of file +var _0x44a3=['openchannelAccount:','./openchannelAccount.events','save','remove','update','emit','removeListener','register'];(function(_0x5bfb26,_0x47872f){var _0x89f8e3=function(_0x5a1019){while(--_0x5a1019){_0x5bfb26['push'](_0x5bfb26['shift']());}};_0x89f8e3(++_0x47872f);}(_0x44a3,0x1a9));var _0x344a=function(_0x64f59a,_0x549247){_0x64f59a=_0x64f59a-0x0;var _0x54ff1d=_0x44a3[_0x64f59a];return _0x54ff1d;};'use strict';var OpenchannelAccountEvents=require(_0x344a('0x0'));var events=[_0x344a('0x1'),_0x344a('0x2'),_0x344a('0x3')];function createListener(_0xdffe0b,_0x42b3a6){return function(_0x3bb844){_0x42b3a6[_0x344a('0x4')](_0xdffe0b,_0x3bb844);};}function removeListener(_0x528a13,_0x23004c){return function(){OpenchannelAccountEvents[_0x344a('0x5')](_0x528a13,_0x23004c);};}exports[_0x344a('0x6')]=function(_0x28b51e){for(var _0x39984a=0x0,_0x504bd1=events['length'];_0x39984a<_0x504bd1;_0x39984a++){var _0x55ddca=events[_0x39984a];var _0x484661=createListener(_0x344a('0x7')+_0x55ddca,_0x28b51e);OpenchannelAccountEvents['on'](_0x55ddca,_0x484661);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 9f3f8d7..aedc19f 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 _0x05a8=['get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','util','path','connect-timeout','Router','../../components/interaction/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x05a8,0xeb));var _0x805a=function(_0x7fe765,_0x2fc59e){_0x7fe765=_0x7fe765-0x0;var _0x52262a=_0x05a8[_0x7fe765];return _0x52262a;};'use strict';var multer=require('multer');var util=require(_0x805a('0x0'));var path=require(_0x805a('0x1'));var timeout=require(_0x805a('0x2'));var express=require('express');var router=express[_0x805a('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x805a('0x4'));var config=require('../../config/environment');var controller=require('./openchannelApplication.controller');router[_0x805a('0x5')]('/',auth[_0x805a('0x6')](),controller[_0x805a('0x7')]);router[_0x805a('0x5')](_0x805a('0x8'),auth[_0x805a('0x6')](),controller[_0x805a('0x9')]);router[_0x805a('0xa')]('/',auth[_0x805a('0x6')](),controller[_0x805a('0xb')]);router[_0x805a('0xc')]('/:id',auth[_0x805a('0x6')](),controller[_0x805a('0xd')]);router[_0x805a('0xe')](_0x805a('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0x805a('0xf')]=router; \ No newline at end of file +var _0x8370=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','put','update'];(function(_0x16446a,_0x5e9140){var _0x2c7051=function(_0x2e6a25){while(--_0x2e6a25){_0x16446a['push'](_0x16446a['shift']());}};_0x2c7051(++_0x5e9140);}(_0x8370,0x1ef));var _0x0837=function(_0x425c63,_0x30100a){_0x425c63=_0x425c63-0x0;var _0x5990e6=_0x8370[_0x425c63];return _0x5990e6;};'use strict';var multer=require(_0x0837('0x0'));var util=require(_0x0837('0x1'));var path=require(_0x0837('0x2'));var timeout=require(_0x0837('0x3'));var express=require(_0x0837('0x4'));var router=express[_0x0837('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0837('0x6'));var interaction=require(_0x0837('0x7'));var config=require(_0x0837('0x8'));var controller=require('./openchannelApplication.controller');router[_0x0837('0x9')]('/',auth[_0x0837('0xa')](),controller[_0x0837('0xb')]);router[_0x0837('0x9')](_0x0837('0xc'),auth[_0x0837('0xa')](),controller['show']);router['post']('/',auth[_0x0837('0xa')](),controller['create']);router[_0x0837('0xd')](_0x0837('0xc'),auth['isAuthenticated'](),controller[_0x0837('0xe')]);router['delete'](_0x0837('0xc'),auth[_0x0837('0xa')](),controller[_0x0837('0xf')]);module[_0x0837('0x10')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 994705b..2bcd9ac 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 _0x5946=['noop','TEXT','sequelize','exports','INTEGER','STRING'];(function(_0x235289,_0x212c5a){var _0x185f9f=function(_0x184ba1){while(--_0x184ba1){_0x235289['push'](_0x235289['shift']());}};_0x185f9f(++_0x212c5a);}(_0x5946,0xec));var _0x6594=function(_0x496333,_0x1c47d6){_0x496333=_0x496333-0x0;var _0x44256e=_0x5946[_0x496333];return _0x44256e;};'use strict';var Sequelize=require(_0x6594('0x0'));module[_0x6594('0x1')]={'priority':{'type':Sequelize[_0x6594('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x6594('0x3')],'allowNull':![],'defaultValue':_0x6594('0x4')},'appdata':{'type':Sequelize[_0x6594('0x5')]()},'description':{'type':Sequelize[_0x6594('0x3')]},'interval':{'type':Sequelize[_0x6594('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x5b0f=['TEXT','*,*,*,*','INTEGER','STRING','noop'];(function(_0x514292,_0x478a6f){var _0x222999=function(_0x28a709){while(--_0x28a709){_0x514292['push'](_0x514292['shift']());}};_0x222999(++_0x478a6f);}(_0x5b0f,0x151));var _0xf5b0=function(_0x45ca1f,_0x2341c9){_0x45ca1f=_0x45ca1f-0x0;var _0x11b2ce=_0x5b0f[_0x45ca1f];return _0x11b2ce;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0xf5b0('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0xf5b0('0x1')],'allowNull':![],'defaultValue':_0xf5b0('0x2')},'appdata':{'type':Sequelize[_0xf5b0('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xf5b0('0x4')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 02dbb0a..db050fb 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 _0x823d=['destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','OpenchannelApplication','findAll','rows','params','intersection','find','catch','create','update','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','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/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then'];(function(_0x3c62ab,_0x33f23d){var _0x536970=function(_0x3a4759){while(--_0x3a4759){_0x3c62ab['push'](_0x3c62ab['shift']());}};_0x536970(++_0x33f23d);}(_0x823d,0x78));var _0xd823=function(_0x259e77,_0x52f430){_0x259e77=_0x259e77-0x0;var _0x1f93bd=_0x823d[_0x259e77];return _0x1f93bd;};'use strict';var emlformat=require(_0xd823('0x0'));var rimraf=require(_0xd823('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd823('0x2'));var rp=require(_0xd823('0x3'));var moment=require(_0xd823('0x4'));var BPromise=require(_0xd823('0x5'));var Mustache=require(_0xd823('0x6'));var util=require(_0xd823('0x7'));var path=require('path');var sox=require(_0xd823('0x8'));var csv=require(_0xd823('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd823('0xa'));var _=require(_0xd823('0xb'));var squel=require(_0xd823('0xc'));var crypto=require(_0xd823('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xd823('0xe'));var toCsv=require(_0xd823('0x9'));var querystring=require(_0xd823('0xf'));var Papa=require(_0xd823('0x10'));var Redis=require(_0xd823('0x11'));var authService=require(_0xd823('0x12'));var qs=require(_0xd823('0x13'));var as=require(_0xd823('0x14'));var hardwareService=require(_0xd823('0x15'));var logger=require(_0xd823('0x16'))(_0xd823('0x17'));var utils=require(_0xd823('0x18'));var config=require(_0xd823('0x19'));var licenseUtil=require(_0xd823('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b2527,_0x14417e){_0x14417e=_0x14417e||0xcc;return function(_0x1e0319){if(_0x1e0319){return _0x1b2527[_0xd823('0x1b')](_0x14417e);}return _0x1b2527[_0xd823('0x1c')](_0x14417e)[_0xd823('0x1d')]();};}function respondWithResult(_0x9b67ea,_0x5ce6aa){_0x5ce6aa=_0x5ce6aa||0xc8;return function(_0x1e04d4){if(_0x1e04d4){return _0x9b67ea['status'](_0x5ce6aa)[_0xd823('0x1e')](_0x1e04d4);}};}function respondWithFilteredResult(_0x478489,_0x1ccd69){return function(_0xee9a52){if(_0xee9a52){var _0x15f997=typeof _0x1ccd69[_0xd823('0x1f')]===_0xd823('0x20')&&typeof _0x1ccd69[_0xd823('0x21')]===_0xd823('0x20');var _0x13c071=_0xee9a52[_0xd823('0x22')];var _0x39a1df=_0x15f997?0x0:_0x1ccd69['offset'];var _0x3ddfca=_0x15f997?_0xee9a52['count']:_0x1ccd69[_0xd823('0x1f')]+_0x1ccd69[_0xd823('0x21')];var _0x558e34;if(_0x3ddfca>=_0x13c071){_0x3ddfca=_0x13c071;_0x558e34=0xc8;}else{_0x558e34=0xce;}_0x478489[_0xd823('0x1c')](_0x558e34);return _0x478489[_0xd823('0x23')](_0xd823('0x24'),_0x39a1df+'-'+_0x3ddfca+'/'+_0x13c071)['json'](_0xee9a52);}return null;};}function patchUpdates(_0x1a8808){return function(_0x2d2fd6){try{jsonpatch['apply'](_0x2d2fd6,_0x1a8808,!![]);}catch(_0x40fc45){return BPromise[_0xd823('0x25')](_0x40fc45);}return _0x2d2fd6[_0xd823('0x26')]();};}function saveUpdates(_0x22f120,_0x4f2f4e){return function(_0x49b67a){if(_0x49b67a){return _0x49b67a['update'](_0x22f120)[_0xd823('0x27')](function(_0x2eff0a){return _0x2eff0a;});}return null;};}function removeEntity(_0x484945,_0x32dd7f){return function(_0x2b0eb4){if(_0x2b0eb4){return _0x2b0eb4[_0xd823('0x28')]()['then'](function(){_0x484945['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c1380,_0x37f6c3){return function(_0x30a8b7){if(!_0x30a8b7){_0x1c1380[_0xd823('0x1b')](0x194);}return _0x30a8b7;};}function handleError(_0xf3e9b8,_0x3ca6ad){_0x3ca6ad=_0x3ca6ad||0x1f4;return function(_0x37cbf7){logger[_0xd823('0x29')](_0x37cbf7[_0xd823('0x2a')]);if(_0x37cbf7['name']){delete _0x37cbf7[_0xd823('0x2b')];}_0xf3e9b8[_0xd823('0x1c')](_0x3ca6ad)[_0xd823('0x2c')](_0x37cbf7);};}exports[_0xd823('0x2d')]=function(_0x2e1b00,_0x182d8d){var _0x5aef8b={},_0x4cd19c={},_0x5b955a={'count':0x0,'rows':[]};var _0x3c54da=_[_0xd823('0x2e')](db['OpenchannelApplication'][_0xd823('0x2f')],function(_0x497d25){return{'name':_0x497d25[_0xd823('0x30')],'type':_0x497d25[_0xd823('0x31')][_0xd823('0x32')]};});_0x4cd19c[_0xd823('0x33')]=_[_0xd823('0x2e')](_0x3c54da,_0xd823('0x2b'));_0x4cd19c[_0xd823('0x34')]=_[_0xd823('0x35')](_0x2e1b00[_0xd823('0x34')]);_0x4cd19c['filters']=_['intersection'](_0x4cd19c[_0xd823('0x33')],_0x4cd19c[_0xd823('0x34')]);_0x5aef8b[_0xd823('0x36')]=_['intersection'](_0x4cd19c['model'],qs[_0xd823('0x37')](_0x2e1b00[_0xd823('0x34')][_0xd823('0x37')]));_0x5aef8b['attributes']=_0x5aef8b[_0xd823('0x36')][_0xd823('0x38')]?_0x5aef8b[_0xd823('0x36')]:_0x4cd19c['model'];if(!_0x2e1b00[_0xd823('0x34')][_0xd823('0x39')](_0xd823('0x3a'))){_0x5aef8b[_0xd823('0x21')]=qs[_0xd823('0x21')](_0x2e1b00['query']['limit']);_0x5aef8b[_0xd823('0x1f')]=qs[_0xd823('0x1f')](_0x2e1b00[_0xd823('0x34')][_0xd823('0x1f')]);}_0x5aef8b[_0xd823('0x3b')]=qs[_0xd823('0x3c')](_0x2e1b00[_0xd823('0x34')]['sort']);_0x5aef8b[_0xd823('0x3d')]=qs[_0xd823('0x3e')](_[_0xd823('0x3f')](_0x2e1b00[_0xd823('0x34')],_0x4cd19c[_0xd823('0x3e')]),_0x3c54da);if(_0x2e1b00['query']['filter']){_0x5aef8b[_0xd823('0x3d')]=_[_0xd823('0x40')](_0x5aef8b[_0xd823('0x3d')],{'$or':_[_0xd823('0x2e')](_0x3c54da,function(_0x6a1da3){if(_0x6a1da3[_0xd823('0x31')]!==_0xd823('0x41')){var _0x3454a4={};_0x3454a4[_0x6a1da3[_0xd823('0x2b')]]={'$like':'%'+_0x2e1b00['query'][_0xd823('0x42')]+'%'};return _0x3454a4;}})});}_0x5aef8b=_['merge']({},_0x5aef8b,_0x2e1b00[_0xd823('0x43')]);var _0x4ebacd={'where':_0x5aef8b[_0xd823('0x3d')]};return db['OpenchannelApplication'][_0xd823('0x22')](_0x4ebacd)[_0xd823('0x27')](function(_0x4f087e){_0x5b955a['count']=_0x4f087e;if(_0x2e1b00[_0xd823('0x34')][_0xd823('0x44')]){_0x5aef8b[_0xd823('0x45')]=[{'all':!![]}];}return db[_0xd823('0x46')][_0xd823('0x47')](_0x5aef8b);})[_0xd823('0x27')](function(_0x2ad3c1){_0x5b955a[_0xd823('0x48')]=_0x2ad3c1;return _0x5b955a;})['then'](respondWithFilteredResult(_0x182d8d,_0x5aef8b))['catch'](handleError(_0x182d8d,null));};exports['show']=function(_0x1e5f10,_0x2cf71a){var _0x38db9b={'raw':!![],'where':{'id':_0x1e5f10[_0xd823('0x49')]['id']}},_0x56ec21={};_0x56ec21[_0xd823('0x33')]=_[_0xd823('0x35')](db[_0xd823('0x46')][_0xd823('0x2f')]);_0x56ec21[_0xd823('0x34')]=_['keys'](_0x1e5f10[_0xd823('0x34')]);_0x56ec21['filters']=_[_0xd823('0x4a')](_0x56ec21['model'],_0x56ec21[_0xd823('0x34')]);_0x38db9b['attributes']=_['intersection'](_0x56ec21['model'],qs['fields'](_0x1e5f10[_0xd823('0x34')][_0xd823('0x37')]));_0x38db9b[_0xd823('0x36')]=_0x38db9b['attributes'][_0xd823('0x38')]?_0x38db9b['attributes']:_0x56ec21[_0xd823('0x33')];if(_0x1e5f10['query']['includeAll']){_0x38db9b['include']=[{'all':!![]}];}_0x38db9b=_['merge']({},_0x38db9b,_0x1e5f10['options']);return db[_0xd823('0x46')][_0xd823('0x4b')](_0x38db9b)[_0xd823('0x27')](handleEntityNotFound(_0x2cf71a,null))[_0xd823('0x27')](respondWithResult(_0x2cf71a,null))[_0xd823('0x4c')](handleError(_0x2cf71a,null));};exports[_0xd823('0x4d')]=function(_0x53780d,_0x3c1544){return db[_0xd823('0x46')][_0xd823('0x4d')](_0x53780d['body'],{})[_0xd823('0x27')](respondWithResult(_0x3c1544,0xc9))[_0xd823('0x4c')](handleError(_0x3c1544,null));};exports[_0xd823('0x4e')]=function(_0x28bcdb,_0x1f6050){if(_0x28bcdb[_0xd823('0x4f')]['id']){delete _0x28bcdb[_0xd823('0x4f')]['id'];}return db['OpenchannelApplication']['find']({'where':{'id':_0x28bcdb['params']['id']}})[_0xd823('0x27')](handleEntityNotFound(_0x1f6050,null))[_0xd823('0x27')](saveUpdates(_0x28bcdb[_0xd823('0x4f')],null))[_0xd823('0x27')](respondWithResult(_0x1f6050,null))[_0xd823('0x4c')](handleError(_0x1f6050,null));};exports[_0xd823('0x28')]=function(_0xb2a15c,_0x102b6f){return db['OpenchannelApplication'][_0xd823('0x4b')]({'where':{'id':_0xb2a15c['params']['id']}})[_0xd823('0x27')](handleEntityNotFound(_0x102b6f,null))['then'](removeEntity(_0x102b6f,null))[_0xd823('0x4c')](handleError(_0x102b6f,null));}; \ No newline at end of file +var _0x9dfa=['../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','end','name','send','index','map','OpenchannelApplication','rawAttributes','type','key','model','query','keys','filters','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','findAll','rows','catch','show','params','intersection','includeAll','include','find','create','body','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x258a87,_0x297b47){var _0x48c3a6=function(_0x2b58c8){while(--_0x2b58c8){_0x258a87['push'](_0x258a87['shift']());}};_0x48c3a6(++_0x297b47);}(_0x9dfa,0x1a6));var _0xa9df=function(_0x286f92,_0x12ae38){_0x286f92=_0x286f92-0x0;var _0x19b09f=_0x9dfa[_0x286f92];return _0x19b09f;};'use strict';var emlformat=require(_0xa9df('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa9df('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa9df('0x2'));var moment=require(_0xa9df('0x3'));var BPromise=require(_0xa9df('0x4'));var Mustache=require(_0xa9df('0x5'));var util=require('util');var path=require(_0xa9df('0x6'));var sox=require(_0xa9df('0x7'));var csv=require(_0xa9df('0x8'));var ejs=require(_0xa9df('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa9df('0xa'));var crypto=require(_0xa9df('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xa9df('0xc'));var toCsv=require(_0xa9df('0x8'));var querystring=require(_0xa9df('0xd'));var Papa=require(_0xa9df('0xe'));var Redis=require(_0xa9df('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa9df('0x10'));var as=require(_0xa9df('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa9df('0x12'))(_0xa9df('0x13'));var utils=require(_0xa9df('0x14'));var config=require(_0xa9df('0x15'));var licenseUtil=require(_0xa9df('0x16'));var db=require(_0xa9df('0x17'))['db'];function respondWithStatusCode(_0x1e7785,_0x59d0e1){_0x59d0e1=_0x59d0e1||0xcc;return function(_0x17b031){if(_0x17b031){return _0x1e7785[_0xa9df('0x18')](_0x59d0e1);}return _0x1e7785['status'](_0x59d0e1)['end']();};}function respondWithResult(_0x343285,_0x38af8d){_0x38af8d=_0x38af8d||0xc8;return function(_0x194ba6){if(_0x194ba6){return _0x343285[_0xa9df('0x19')](_0x38af8d)[_0xa9df('0x1a')](_0x194ba6);}};}function respondWithFilteredResult(_0x26f9aa,_0x7cb418){return function(_0x942c78){if(_0x942c78){var _0x2dd5e9=typeof _0x7cb418[_0xa9df('0x1b')]==='undefined'&&typeof _0x7cb418[_0xa9df('0x1c')]===_0xa9df('0x1d');var _0x82fba4=_0x942c78[_0xa9df('0x1e')];var _0x83b446=_0x2dd5e9?0x0:_0x7cb418[_0xa9df('0x1b')];var _0x56dcf7=_0x2dd5e9?_0x942c78[_0xa9df('0x1e')]:_0x7cb418[_0xa9df('0x1b')]+_0x7cb418[_0xa9df('0x1c')];var _0x107820;if(_0x56dcf7>=_0x82fba4){_0x56dcf7=_0x82fba4;_0x107820=0xc8;}else{_0x107820=0xce;}_0x26f9aa[_0xa9df('0x19')](_0x107820);return _0x26f9aa[_0xa9df('0x1f')](_0xa9df('0x20'),_0x83b446+'-'+_0x56dcf7+'/'+_0x82fba4)[_0xa9df('0x1a')](_0x942c78);}return null;};}function patchUpdates(_0x50de4c){return function(_0x8dfe01){try{jsonpatch[_0xa9df('0x21')](_0x8dfe01,_0x50de4c,!![]);}catch(_0x5ba8d6){return BPromise[_0xa9df('0x22')](_0x5ba8d6);}return _0x8dfe01[_0xa9df('0x23')]();};}function saveUpdates(_0x3db035,_0x322b4a){return function(_0x5e6ac1){if(_0x5e6ac1){return _0x5e6ac1[_0xa9df('0x24')](_0x3db035)['then'](function(_0x2714f7){return _0x2714f7;});}return null;};}function removeEntity(_0x1359f6,_0x1a9b71){return function(_0x34b6a7){if(_0x34b6a7){return _0x34b6a7[_0xa9df('0x25')]()[_0xa9df('0x26')](function(){_0x1359f6[_0xa9df('0x19')](0xcc)[_0xa9df('0x27')]();});}};}function handleEntityNotFound(_0x264fd0,_0x5aa123){return function(_0x134cfc){if(!_0x134cfc){_0x264fd0[_0xa9df('0x18')](0x194);}return _0x134cfc;};}function handleError(_0x359916,_0x13e292){_0x13e292=_0x13e292||0x1f4;return function(_0x2bce7b){logger['error'](_0x2bce7b['stack']);if(_0x2bce7b[_0xa9df('0x28')]){delete _0x2bce7b['name'];}_0x359916['status'](_0x13e292)[_0xa9df('0x29')](_0x2bce7b);};}exports[_0xa9df('0x2a')]=function(_0xceafc2,_0x707837){var _0x7eaee2={},_0x38410c={},_0x13762a={'count':0x0,'rows':[]};var _0x2bd54b=_[_0xa9df('0x2b')](db[_0xa9df('0x2c')][_0xa9df('0x2d')],function(_0xff9795){return{'name':_0xff9795['fieldName'],'type':_0xff9795[_0xa9df('0x2e')][_0xa9df('0x2f')]};});_0x38410c[_0xa9df('0x30')]=_[_0xa9df('0x2b')](_0x2bd54b,_0xa9df('0x28'));_0x38410c[_0xa9df('0x31')]=_[_0xa9df('0x32')](_0xceafc2[_0xa9df('0x31')]);_0x38410c[_0xa9df('0x33')]=_['intersection'](_0x38410c[_0xa9df('0x30')],_0x38410c[_0xa9df('0x31')]);_0x7eaee2[_0xa9df('0x34')]=_['intersection'](_0x38410c[_0xa9df('0x30')],qs[_0xa9df('0x35')](_0xceafc2[_0xa9df('0x31')][_0xa9df('0x35')]));_0x7eaee2[_0xa9df('0x34')]=_0x7eaee2['attributes'][_0xa9df('0x36')]?_0x7eaee2[_0xa9df('0x34')]:_0x38410c['model'];if(!_0xceafc2[_0xa9df('0x31')]['hasOwnProperty'](_0xa9df('0x37'))){_0x7eaee2[_0xa9df('0x1c')]=qs['limit'](_0xceafc2[_0xa9df('0x31')][_0xa9df('0x1c')]);_0x7eaee2['offset']=qs[_0xa9df('0x1b')](_0xceafc2[_0xa9df('0x31')][_0xa9df('0x1b')]);}_0x7eaee2[_0xa9df('0x38')]=qs[_0xa9df('0x39')](_0xceafc2[_0xa9df('0x31')]['sort']);_0x7eaee2[_0xa9df('0x3a')]=qs[_0xa9df('0x33')](_[_0xa9df('0x3b')](_0xceafc2[_0xa9df('0x31')],_0x38410c[_0xa9df('0x33')]),_0x2bd54b);if(_0xceafc2[_0xa9df('0x31')][_0xa9df('0x3c')]){_0x7eaee2[_0xa9df('0x3a')]=_[_0xa9df('0x3d')](_0x7eaee2[_0xa9df('0x3a')],{'$or':_[_0xa9df('0x2b')](_0x2bd54b,function(_0xdf2fe4){if(_0xdf2fe4[_0xa9df('0x2e')]!=='VIRTUAL'){var _0x22721a={};_0x22721a[_0xdf2fe4[_0xa9df('0x28')]]={'$like':'%'+_0xceafc2[_0xa9df('0x31')][_0xa9df('0x3c')]+'%'};return _0x22721a;}})});}_0x7eaee2=_[_0xa9df('0x3d')]({},_0x7eaee2,_0xceafc2[_0xa9df('0x3e')]);var _0x7a4eb={'where':_0x7eaee2[_0xa9df('0x3a')]};return db[_0xa9df('0x2c')][_0xa9df('0x1e')](_0x7a4eb)[_0xa9df('0x26')](function(_0x4b0648){_0x13762a[_0xa9df('0x1e')]=_0x4b0648;if(_0xceafc2['query']['includeAll']){_0x7eaee2['include']=[{'all':!![]}];}return db[_0xa9df('0x2c')][_0xa9df('0x3f')](_0x7eaee2);})[_0xa9df('0x26')](function(_0xcdfa54){_0x13762a[_0xa9df('0x40')]=_0xcdfa54;return _0x13762a;})[_0xa9df('0x26')](respondWithFilteredResult(_0x707837,_0x7eaee2))[_0xa9df('0x41')](handleError(_0x707837,null));};exports[_0xa9df('0x42')]=function(_0x5c2296,_0x343999){var _0x39abd9={'raw':!![],'where':{'id':_0x5c2296[_0xa9df('0x43')]['id']}},_0x55ab4a={};_0x55ab4a[_0xa9df('0x30')]=_[_0xa9df('0x32')](db[_0xa9df('0x2c')][_0xa9df('0x2d')]);_0x55ab4a[_0xa9df('0x31')]=_['keys'](_0x5c2296['query']);_0x55ab4a[_0xa9df('0x33')]=_['intersection'](_0x55ab4a['model'],_0x55ab4a[_0xa9df('0x31')]);_0x39abd9['attributes']=_[_0xa9df('0x44')](_0x55ab4a[_0xa9df('0x30')],qs[_0xa9df('0x35')](_0x5c2296['query'][_0xa9df('0x35')]));_0x39abd9[_0xa9df('0x34')]=_0x39abd9[_0xa9df('0x34')]['length']?_0x39abd9[_0xa9df('0x34')]:_0x55ab4a[_0xa9df('0x30')];if(_0x5c2296[_0xa9df('0x31')][_0xa9df('0x45')]){_0x39abd9[_0xa9df('0x46')]=[{'all':!![]}];}_0x39abd9=_[_0xa9df('0x3d')]({},_0x39abd9,_0x5c2296[_0xa9df('0x3e')]);return db['OpenchannelApplication'][_0xa9df('0x47')](_0x39abd9)[_0xa9df('0x26')](handleEntityNotFound(_0x343999,null))[_0xa9df('0x26')](respondWithResult(_0x343999,null))['catch'](handleError(_0x343999,null));};exports[_0xa9df('0x48')]=function(_0x557c5f,_0x1016d4){return db[_0xa9df('0x2c')][_0xa9df('0x48')](_0x557c5f[_0xa9df('0x49')],{})[_0xa9df('0x26')](respondWithResult(_0x1016d4,0xc9))[_0xa9df('0x41')](handleError(_0x1016d4,null));};exports[_0xa9df('0x24')]=function(_0x32e375,_0x28fbe9){if(_0x32e375[_0xa9df('0x49')]['id']){delete _0x32e375['body']['id'];}return db[_0xa9df('0x2c')][_0xa9df('0x47')]({'where':{'id':_0x32e375[_0xa9df('0x43')]['id']}})[_0xa9df('0x26')](handleEntityNotFound(_0x28fbe9,null))[_0xa9df('0x26')](saveUpdates(_0x32e375[_0xa9df('0x49')],null))[_0xa9df('0x26')](respondWithResult(_0x28fbe9,null))[_0xa9df('0x41')](handleError(_0x28fbe9,null));};exports['destroy']=function(_0x2a9c6f,_0x102317){return db['OpenchannelApplication'][_0xa9df('0x47')]({'where':{'id':_0x2a9c6f['params']['id']}})[_0xa9df('0x26')](handleEntityNotFound(_0x102317,null))[_0xa9df('0x26')](removeEntity(_0x102317,null))[_0xa9df('0x41')](handleError(_0x102317,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index a8faf32..39189f0 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 _0x8e04=['moment','bluebird','rimraf','define','OpenchannelApplication','utf8mb4','lodash','util','../../config/logger','api'];(function(_0x282685,_0x1650b5){var _0x37dc35=function(_0x58a165){while(--_0x58a165){_0x282685['push'](_0x282685['shift']());}};_0x37dc35(++_0x1650b5);}(_0x8e04,0x10a));var _0x48e0=function(_0x5bb9ac,_0x417c09){_0x5bb9ac=_0x5bb9ac-0x0;var _0x38fd65=_0x8e04[_0x5bb9ac];return _0x38fd65;};'use strict';var _=require(_0x48e0('0x0'));var util=require(_0x48e0('0x1'));var logger=require(_0x48e0('0x2'))(_0x48e0('0x3'));var moment=require(_0x48e0('0x4'));var BPromise=require(_0x48e0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x48e0('0x6'));var config=require('../../config/environment');var attributes=require('./openchannelApplication.attributes');module['exports']=function(_0x57c169,_0x319d31){return _0x57c169[_0x48e0('0x7')](_0x48e0('0x8'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x48e0('0x9'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xe9a3=['request-promise','path','rimraf','../../config/environment','./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird'];(function(_0x50b1c5,_0x1cf2a9){var _0x344f99=function(_0x5d6ef0){while(--_0x5d6ef0){_0x50b1c5['push'](_0x50b1c5['shift']());}};_0x344f99(++_0x1cf2a9);}(_0xe9a3,0x182));var _0x3e9a=function(_0x38f72e,_0x53c635){_0x38f72e=_0x38f72e-0x0;var _0x409dda=_0xe9a3[_0x38f72e];return _0x409dda;};'use strict';var _=require(_0x3e9a('0x0'));var util=require(_0x3e9a('0x1'));var logger=require(_0x3e9a('0x2'))('api');var moment=require('moment');var BPromise=require(_0x3e9a('0x3'));var rp=require(_0x3e9a('0x4'));var fs=require('fs');var path=require(_0x3e9a('0x5'));var rimraf=require(_0x3e9a('0x6'));var config=require(_0x3e9a('0x7'));var attributes=require(_0x3e9a('0x8'));module[_0x3e9a('0x9')]=function(_0xbcface,_0x5e69ac){return _0xbcface[_0x3e9a('0xa')](_0x3e9a('0xb'),attributes,{'tableName':_0x3e9a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3e9a('0xd'),'collate':_0x3e9a('0xe')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index f672491..c4bd76a 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 _0x7619=['where','attributes','limit','then','info','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','OpenchannelApplication,\x20%s,\x20%s','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','UpdateOpenchannelApplication','update','body','options'];(function(_0x55d673,_0x57901c){var _0x3fde68=function(_0x5e8597){while(--_0x5e8597){_0x55d673['push'](_0x55d673['shift']());}};_0x3fde68(++_0x57901c);}(_0x7619,0x101));var _0x9761=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7619[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9761('0x0'));var util=require('util');var moment=require(_0x9761('0x1'));var BPromise=require(_0x9761('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9761('0x3'))['db'];var utils=require(_0x9761('0x4'));var logger=require(_0x9761('0x5'))('rpc');var config=require(_0x9761('0x6'));var jayson=require(_0x9761('0x7'));var client=jayson[_0x9761('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x11ae66,_0x1b24d6,_0x31f99b){return new BPromise(function(_0x1f0573,_0x5c30df){return client[_0x9761('0x9')](_0x11ae66,_0x31f99b)['then'](function(_0x5ea104){logger['info'](_0x9761('0xa'),_0x1b24d6,'request\x20sent');logger[_0x9761('0xb')](_0x9761('0xc'),_0x1b24d6,_0x9761('0xd'),JSON[_0x9761('0xe')](_0x5ea104));if(_0x5ea104[_0x9761('0xf')]){if(_0x5ea104['error']['code']===0x1f4){logger[_0x9761('0xf')]('OpenchannelApplication,\x20%s,\x20%s',_0x1b24d6,_0x5ea104[_0x9761('0xf')][_0x9761('0x10')]);return _0x5c30df(_0x5ea104[_0x9761('0xf')][_0x9761('0x10')]);}logger[_0x9761('0xf')](_0x9761('0xa'),_0x1b24d6,_0x5ea104['error'][_0x9761('0x10')]);return _0x1f0573(_0x5ea104['error'][_0x9761('0x10')]);}else{logger['info'](_0x9761('0xa'),_0x1b24d6,_0x9761('0xd'));_0x1f0573(_0x5ea104[_0x9761('0x11')]['message']);}})[_0x9761('0x12')](function(_0x13a818){logger[_0x9761('0xf')]('OpenchannelApplication,\x20%s,\x20%s',_0x1b24d6,_0x13a818);_0x5c30df(_0x13a818);});});}exports[_0x9761('0x13')]=function(_0x1b3f1e){var _0x360062=this;return new Promise(function(_0x501d08,_0x2ade6e){return db['OpenchannelApplication'][_0x9761('0x14')](_0x1b3f1e[_0x9761('0x15')],{'raw':_0x1b3f1e[_0x9761('0x16')]?_0x1b3f1e['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b3f1e['options']?_0x1b3f1e[_0x9761('0x16')][_0x9761('0x17')]||null:null,'attributes':_0x1b3f1e[_0x9761('0x16')]?_0x1b3f1e['options'][_0x9761('0x18')]||null:null,'limit':_0x1b3f1e[_0x9761('0x16')]?_0x1b3f1e[_0x9761('0x16')][_0x9761('0x19')]||null:null})[_0x9761('0x1a')](function(_0x5c5ebd){logger[_0x9761('0x1b')](_0x9761('0x13'),_0x1b3f1e);logger['debug'](_0x9761('0x13'),_0x1b3f1e,JSON[_0x9761('0xe')](_0x5c5ebd));_0x501d08(_0x5c5ebd);})[_0x9761('0x12')](function(_0x3adaae){logger[_0x9761('0xf')](_0x9761('0x13'),_0x3adaae[_0x9761('0x10')],_0x1b3f1e);_0x2ade6e(_0x360062[_0x9761('0xf')](0x1f4,_0x3adaae[_0x9761('0x10')]));});});}; \ No newline at end of file +var _0xa009=['info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','body','options','where','attributes','UpdateOpenchannelApplication','debug','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x3cd2f5,_0x44d359){var _0x58c3c5=function(_0x3c4d15){while(--_0x3c4d15){_0x3cd2f5['push'](_0x3cd2f5['shift']());}};_0x58c3c5(++_0x44d359);}(_0xa009,0x10a));var _0x9a00=function(_0x51d6db,_0x19d9af){_0x51d6db=_0x51d6db-0x0;var _0x39f768=_0xa009[_0x51d6db];return _0x39f768;};'use strict';var _=require(_0x9a00('0x0'));var util=require(_0x9a00('0x1'));var moment=require(_0x9a00('0x2'));var BPromise=require(_0x9a00('0x3'));var rs=require(_0x9a00('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9a00('0x5'))['db'];var utils=require(_0x9a00('0x6'));var logger=require(_0x9a00('0x7'))(_0x9a00('0x8'));var config=require(_0x9a00('0x9'));var jayson=require(_0x9a00('0xa'));var client=jayson[_0x9a00('0xb')][_0x9a00('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3ecab6,_0x29cc78,_0x33a301){return new BPromise(function(_0x35c6fb,_0x225fee){return client['request'](_0x3ecab6,_0x33a301)[_0x9a00('0xd')](function(_0x54c6e4){logger[_0x9a00('0xe')](_0x9a00('0xf'),_0x29cc78,_0x9a00('0x10'));logger['debug']('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x29cc78,_0x9a00('0x10'),JSON[_0x9a00('0x11')](_0x54c6e4));if(_0x54c6e4[_0x9a00('0x12')]){if(_0x54c6e4[_0x9a00('0x12')]['code']===0x1f4){logger['error'](_0x9a00('0xf'),_0x29cc78,_0x54c6e4[_0x9a00('0x12')]['message']);return _0x225fee(_0x54c6e4[_0x9a00('0x12')][_0x9a00('0x13')]);}logger[_0x9a00('0x12')]('OpenchannelApplication,\x20%s,\x20%s',_0x29cc78,_0x54c6e4[_0x9a00('0x12')][_0x9a00('0x13')]);return _0x35c6fb(_0x54c6e4[_0x9a00('0x12')][_0x9a00('0x13')]);}else{logger[_0x9a00('0xe')](_0x9a00('0xf'),_0x29cc78,'request\x20sent');_0x35c6fb(_0x54c6e4[_0x9a00('0x14')][_0x9a00('0x13')]);}})['catch'](function(_0x1bc109){logger[_0x9a00('0x12')]('OpenchannelApplication,\x20%s,\x20%s',_0x29cc78,_0x1bc109);_0x225fee(_0x1bc109);});});}exports['UpdateOpenchannelApplication']=function(_0x5d144a){var _0x4c7890=this;return new Promise(function(_0x184158,_0xf1f761){return db['OpenchannelApplication']['update'](_0x5d144a[_0x9a00('0x15')],{'raw':_0x5d144a[_0x9a00('0x16')]?_0x5d144a['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d144a['options']?_0x5d144a[_0x9a00('0x16')][_0x9a00('0x17')]||null:null,'attributes':_0x5d144a[_0x9a00('0x16')]?_0x5d144a[_0x9a00('0x16')][_0x9a00('0x18')]||null:null,'limit':_0x5d144a['options']?_0x5d144a['options']['limit']||null:null})['then'](function(_0x2dbb1e){logger[_0x9a00('0xe')](_0x9a00('0x19'),_0x5d144a);logger[_0x9a00('0x1a')]('UpdateOpenchannelApplication',_0x5d144a,JSON[_0x9a00('0x11')](_0x2dbb1e));_0x184158(_0x2dbb1e);})[_0x9a00('0x1b')](function(_0x2b2de1){logger[_0x9a00('0x12')](_0x9a00('0x19'),_0x2b2de1[_0x9a00('0x13')],_0x5d144a);_0xf1f761(_0x4c7890[_0x9a00('0x12')](0x1f4,_0x2b2de1[_0x9a00('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 9ff5136..a9595d5 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 _0x2c88=['isAuthenticated','index','describe','show','getMessages','/:id/download','download','post','create','/:id/messages','tracked','addTags','put','openchannel','openchannelinteraction:update','update','delete','/:id','/:id/tags','removeTags','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get'];(function(_0x3a607e,_0x54d530){var _0x37b106=function(_0x1becae){while(--_0x1becae){_0x3a607e['push'](_0x3a607e['shift']());}};_0x37b106(++_0x54d530);}(_0x2c88,0x1b8));var _0x82c8=function(_0x2721db,_0x4daedb){_0x2721db=_0x2721db-0x0;var _0x8b5675=_0x2c88[_0x2721db];return _0x8b5675;};'use strict';var multer=require('multer');var util=require(_0x82c8('0x0'));var path=require('path');var timeout=require(_0x82c8('0x1'));var express=require(_0x82c8('0x2'));var router=express[_0x82c8('0x3')]();var fs_extra=require(_0x82c8('0x4'));var auth=require(_0x82c8('0x5'));var interaction=require(_0x82c8('0x6'));var config=require(_0x82c8('0x7'));var controller=require(_0x82c8('0x8'));router[_0x82c8('0x9')]('/',auth[_0x82c8('0xa')](),controller[_0x82c8('0xb')]);router['get']('/describe',auth[_0x82c8('0xa')](),controller[_0x82c8('0xc')]);router[_0x82c8('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x82c8('0xd')]);router[_0x82c8('0x9')]('/:id/messages',auth[_0x82c8('0xa')](),controller[_0x82c8('0xe')]);router[_0x82c8('0x9')](_0x82c8('0xf'),auth[_0x82c8('0xa')](),controller[_0x82c8('0x10')]);router[_0x82c8('0x11')]('/',auth['isAuthenticated'](),controller[_0x82c8('0x12')]);router['post'](_0x82c8('0x13'),auth['isAuthenticated'](),controller['addMessage']);router['post']('/:id/tags',auth[_0x82c8('0xa')](),interaction[_0x82c8('0x14')]('openchannel','openchannelinteraction:addtags'),controller[_0x82c8('0x15')]);router[_0x82c8('0x16')]('/:id',auth[_0x82c8('0xa')](),interaction['tracked'](_0x82c8('0x17'),_0x82c8('0x18')),controller[_0x82c8('0x19')]);router[_0x82c8('0x1a')](_0x82c8('0x1b'),auth[_0x82c8('0xa')](),interaction[_0x82c8('0x14')](_0x82c8('0x17'),'openchannelinteraction:destroy'),controller['destroy']);router[_0x82c8('0x1a')](_0x82c8('0x1c'),auth['isAuthenticated'](),controller[_0x82c8('0x1d')]);module['exports']=router; \ No newline at end of file +var _0x7e7c=['openchannelinteraction:destroy','destroy','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/messages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','openchannel','addTags','put','openchannelinteraction:update','delete'];(function(_0x494223,_0x2c1f71){var _0xdaf98=function(_0x1f790e){while(--_0x1f790e){_0x494223['push'](_0x494223['shift']());}};_0xdaf98(++_0x2c1f71);}(_0x7e7c,0x16f));var _0xc7e7=function(_0x545a3a,_0x3123aa){_0x545a3a=_0x545a3a-0x0;var _0x5a5493=_0x7e7c[_0x545a3a];return _0x5a5493;};'use strict';var multer=require(_0xc7e7('0x0'));var util=require(_0xc7e7('0x1'));var path=require('path');var timeout=require(_0xc7e7('0x2'));var express=require(_0xc7e7('0x3'));var router=express[_0xc7e7('0x4')]();var fs_extra=require(_0xc7e7('0x5'));var auth=require(_0xc7e7('0x6'));var interaction=require(_0xc7e7('0x7'));var config=require('../../config/environment');var controller=require(_0xc7e7('0x8'));router[_0xc7e7('0x9')]('/',auth['isAuthenticated'](),controller[_0xc7e7('0xa')]);router[_0xc7e7('0x9')](_0xc7e7('0xb'),auth[_0xc7e7('0xc')](),controller[_0xc7e7('0xd')]);router[_0xc7e7('0x9')](_0xc7e7('0xe'),auth['isAuthenticated'](),controller[_0xc7e7('0xf')]);router['get'](_0xc7e7('0x10'),auth[_0xc7e7('0xc')](),controller['getMessages']);router[_0xc7e7('0x9')](_0xc7e7('0x11'),auth['isAuthenticated'](),controller[_0xc7e7('0x12')]);router[_0xc7e7('0x13')]('/',auth[_0xc7e7('0xc')](),controller[_0xc7e7('0x14')]);router[_0xc7e7('0x13')](_0xc7e7('0x10'),auth[_0xc7e7('0xc')](),controller[_0xc7e7('0x15')]);router['post'](_0xc7e7('0x16'),auth[_0xc7e7('0xc')](),interaction[_0xc7e7('0x17')](_0xc7e7('0x18'),'openchannelinteraction:addtags'),controller[_0xc7e7('0x19')]);router[_0xc7e7('0x1a')](_0xc7e7('0xe'),auth[_0xc7e7('0xc')](),interaction[_0xc7e7('0x17')]('openchannel',_0xc7e7('0x1b')),controller['update']);router[_0xc7e7('0x1c')](_0xc7e7('0xe'),auth[_0xc7e7('0xc')](),interaction[_0xc7e7('0x17')]('openchannel',_0xc7e7('0x1d')),controller[_0xc7e7('0x1e')]);router[_0xc7e7('0x1c')](_0xc7e7('0x16'),auth[_0xc7e7('0xc')](),controller[_0xc7e7('0x1f')]);module[_0xc7e7('0x20')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 27621ec..08cd36a 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 _0xf675=['DATE','ENUM','out','sequelize','exports','BOOLEAN','STRING'];(function(_0x12da78,_0x5f07c0){var _0x32ba3e=function(_0x43b95f){while(--_0x43b95f){_0x12da78['push'](_0x12da78['shift']());}};_0x32ba3e(++_0x5f07c0);}(_0xf675,0x199));var _0x5f67=function(_0xe4c712,_0x1e26d5){_0xe4c712=_0xe4c712-0x0;var _0x101962=_0xf675[_0xe4c712];return _0x101962;};'use strict';var Sequelize=require(_0x5f67('0x0'));module[_0x5f67('0x1')]={'closed':{'type':Sequelize[_0x5f67('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x5f67('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x5f67('0x3')]},'note':{'type':Sequelize[_0x5f67('0x3')]},'read1stAt':{'type':Sequelize[_0x5f67('0x4')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0x5f67('0x3')]},'lastMsgAt':{'type':Sequelize[_0x5f67('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x5f67('0x5')]('in',_0x5f67('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize[_0x5f67('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xd1b3=['BOOLEAN','DATE','STRING','ENUM','out','sequelize','exports'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xd1b3,0xec));var _0x3d1b=function(_0x3ec007,_0x1bc13e){_0x3ec007=_0x3ec007-0x0;var _0x640cb6=_0xd1b3[_0x3ec007];return _0x640cb6;};'use strict';var Sequelize=require(_0x3d1b('0x0'));module[_0x3d1b('0x1')]={'closed':{'type':Sequelize[_0x3d1b('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3d1b('0x3')]},'disposition':{'type':Sequelize[_0x3d1b('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x3d1b('0x3')]},'threadId':{'type':Sequelize[_0x3d1b('0x4')]},'externalUrl':{'type':Sequelize[_0x3d1b('0x4')]},'lastMsgAt':{'type':Sequelize[_0x3d1b('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x3d1b('0x5')]('in',_0x3d1b('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x3d1b('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x3d1b('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 2ea12bb..c28c080 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 _0x883f=['spread','emit','openchannelInteractionTags:save','removeTags','download','unix','join','root','server','files','attachments','firstName','lastName','Attachment','Messages','secret','OpenchannelAccount','Account','Owner','get','mkdirSync','Openchannel','N.A.','createdAt','closedAt','disposition','threadId','Public','Private','existsSync','createReadStream','pipe','direction','System','basename','views','downloadInteraction.ejs','transcript-','.pdf','log','err','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','end','status','offset','limit','count','set','Content-Range','json','apply','update','then','destroy','error','name','send','Users','fullname','TagIds','split','Tags','unmanaged','total','UserId','waiting','closed','talking','answered','index','map','OpenchannelInteraction','fieldName','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','filters','select','field','color','from','tools_tags','u.fullname','openchannel_interactions','cm_contacts','left_join','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','conditions','unreadMessages','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','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','type','text','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','some','compact','isEmpty','concat','parse','$gte','where','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','OpenchannelAccountId','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','role','user','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','agent','toString','sequelize','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','push','all','rows','catch','params','rawAttributes','include','options','describe','addMessage','OpenchannelMessage','ids','omit','findOne','hasOwnProperty','pick','OpenchannelInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags'];(function(_0x1ac120,_0x3e7e45){var _0x19b703=function(_0x5f32cb){while(--_0x5f32cb){_0x1ac120['push'](_0x1ac120['shift']());}};_0x19b703(++_0x3e7e45);}(_0x883f,0x113));var _0xf883=function(_0x401234,_0xfd4275){_0x401234=_0x401234-0x0;var _0x12842c=_0x883f[_0x401234];return _0x12842c;};'use strict';var emlformat=require(_0xf883('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf883('0x1'));var jsonpatch=require(_0xf883('0x2'));var rp=require(_0xf883('0x3'));var moment=require(_0xf883('0x4'));var BPromise=require(_0xf883('0x5'));var Mustache=require(_0xf883('0x6'));var util=require(_0xf883('0x7'));var path=require(_0xf883('0x8'));var sox=require(_0xf883('0x9'));var csv=require(_0xf883('0xa'));var ejs=require(_0xf883('0xb'));var fs=require('fs');var fs_extra=require(_0xf883('0xc'));var _=require(_0xf883('0xd'));var squel=require('squel');var crypto=require(_0xf883('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xf883('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf883('0x10'));var Redis=require('ioredis');var authService=require(_0xf883('0x11'));var qs=require(_0xf883('0x12'));var as=require(_0xf883('0x13'));var pdf=require(_0xf883('0x14'));var hardwareService=require(_0xf883('0x15'));var logger=require(_0xf883('0x16'))(_0xf883('0x17'));var utils=require(_0xf883('0x18'));var config=require(_0xf883('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xf883('0x1a')]=_['defaults'](config[_0xf883('0x1a')],{'host':_0xf883('0x1b'),'port':0x18eb});var socket=require(_0xf883('0x1c'))(new Redis(config['redis']));require(_0xf883('0x1d'))[_0xf883('0x1e')](socket);function respondWithStatusCode(_0x2aca73,_0x4cb6f9){_0x4cb6f9=_0x4cb6f9||0xcc;return function(_0xc7a548){if(_0xc7a548){return _0x2aca73[_0xf883('0x1f')](_0x4cb6f9);}return _0x2aca73['status'](_0x4cb6f9)[_0xf883('0x20')]();};}function respondWithResult(_0x4674e8,_0x4350c5){_0x4350c5=_0x4350c5||0xc8;return function(_0x5b3d03){if(_0x5b3d03){return _0x4674e8[_0xf883('0x21')](_0x4350c5)['json'](_0x5b3d03);}};}function respondWithFilteredResult(_0x3cdac6,_0x240e67){return function(_0x4284c2){if(_0x4284c2){var _0x185dfe=typeof _0x240e67[_0xf883('0x22')]==='undefined'&&typeof _0x240e67[_0xf883('0x23')]==='undefined';var _0x3a955c=_0x4284c2[_0xf883('0x24')];var _0x558468=_0x185dfe?0x0:_0x240e67[_0xf883('0x22')];var _0x1d154a=_0x185dfe?_0x4284c2['count']:_0x240e67[_0xf883('0x22')]+_0x240e67['limit'];var _0x1efaeb;if(_0x1d154a>=_0x3a955c){_0x1d154a=_0x3a955c;_0x1efaeb=0xc8;}else{_0x1efaeb=0xce;}_0x3cdac6[_0xf883('0x21')](_0x1efaeb);return _0x3cdac6[_0xf883('0x25')](_0xf883('0x26'),_0x558468+'-'+_0x1d154a+'/'+_0x3a955c)[_0xf883('0x27')](_0x4284c2);}return null;};}function patchUpdates(_0x1ceb5f){return function(_0x2720a5){try{jsonpatch[_0xf883('0x28')](_0x2720a5,_0x1ceb5f,!![]);}catch(_0x1b8141){return BPromise['reject'](_0x1b8141);}return _0x2720a5['save']();};}function saveUpdates(_0x5f40a9,_0x19c008){return function(_0x2dbc01){if(_0x2dbc01){return _0x2dbc01[_0xf883('0x29')](_0x5f40a9)[_0xf883('0x2a')](function(_0x31ea6d){return _0x31ea6d;});}return null;};}function removeEntity(_0x37ebcb,_0x85c845){return function(_0x5bba07){if(_0x5bba07){return _0x5bba07[_0xf883('0x2b')]()[_0xf883('0x2a')](function(){_0x37ebcb[_0xf883('0x21')](0xcc)[_0xf883('0x20')]();});}};}function handleEntityNotFound(_0x5cbead,_0x55acae){return function(_0x11a6db){if(!_0x11a6db){_0x5cbead[_0xf883('0x1f')](0x194);}return _0x11a6db;};}function handleError(_0x11d37a,_0x16a4b2){_0x16a4b2=_0x16a4b2||0x1f4;return function(_0x192400){logger[_0xf883('0x2c')](_0x192400['stack']);if(_0x192400[_0xf883('0x2d')]){delete _0x192400[_0xf883('0x2d')];}_0x11d37a[_0xf883('0x21')](_0x16a4b2)[_0xf883('0x2e')](_0x192400);};}function getInteractionUsers(_0x28e2e1,_0x4537d8){return new BPromise(function(_0x58c8d9,_0x2f4abd){try{if(_0x4537d8[_0x28e2e1['id']]){_0x28e2e1[_0xf883('0x2f')]=_['map'](_0x4537d8[_0x28e2e1['id']],function(_0x2d9a44){return{'id':_0x2d9a44['id'],'fullname':_0x2d9a44[_0xf883('0x30')]};});}}catch(_0x522ef0){_0x2f4abd(_0x522ef0);}_0x58c8d9(_0x28e2e1);});}function getInteractionTags(_0x17e26f,_0x3fbb11){return new BPromise(function(_0x2514bc,_0x5317aa){try{if(_0x17e26f[_0xf883('0x31')]){_0x17e26f['Tags']=[];_0x17e26f[_0xf883('0x31')][_0xf883('0x32')](',')['forEach'](function(_0xfb48fc){_0x17e26f[_0xf883('0x33')]['push'](_0x3fbb11[_0xfb48fc]);});}delete _0x17e26f[_0xf883('0x31')];}catch(_0x674bea){_0x5317aa(_0x674bea);}_0x2514bc(_0x17e26f);});}function updateOpenchannelInteraction(_0x5bd75f,_0x5386fb,_0x5dfe27){return new BPromise(function(_0x472110,_0x106df9){return getInteractionUsers(_0x5bd75f,_0x5dfe27)[_0xf883('0x2a')](function(_0x760319){return getInteractionTags(_0x760319,_0x5386fb);})[_0xf883('0x2a')](function(_0x59e343){return getStateInteraction(_0x59e343);})[_0xf883('0x2a')](function(_0x10f812){_0x472110(_0x10f812);})['catch'](function(_0x587c7c){_0x106df9(_0x587c7c);});});}function getStateInteraction(_0x40acb4){return new BPromise(function(_0x2f0803){_0x40acb4['waiting']=0x0;_0x40acb4['talking']=0x0;_0x40acb4['answered']=0x0;_0x40acb4[_0xf883('0x34')]=0x0;_0x40acb4[_0xf883('0x35')]=0x0;if(!_0x40acb4['closed']&&!_0x40acb4[_0xf883('0x36')]){_0x40acb4[_0xf883('0x37')]+=0x1;}if(!_0x40acb4[_0xf883('0x38')]&&_0x40acb4[_0xf883('0x36')]){_0x40acb4[_0xf883('0x39')]+=0x1;if(_0x40acb4[_0xf883('0x37')]){_0x40acb4[_0xf883('0x37')]-=0x1;}}if(_0x40acb4[_0xf883('0x38')]&&_0x40acb4[_0xf883('0x36')]){_0x40acb4[_0xf883('0x3a')]+=0x1;if(_0x40acb4[_0xf883('0x39')]){_0x40acb4[_0xf883('0x39')]-=0x1;}}if(_0x40acb4[_0xf883('0x38')]&&!_0x40acb4[_0xf883('0x36')]){_0x40acb4['unmanaged']+=0x1;if(_0x40acb4[_0xf883('0x37')]){_0x40acb4['waiting']-=0x1;}}_0x40acb4[_0xf883('0x35')]+=0x1;_0x2f0803(_0x40acb4);});}exports[_0xf883('0x3b')]=function(_0x25434d,_0x24cecc){var _0x26cdcb={},_0x528385={},_0xf3da49={'count':0x0,'rows':[]};var _0x52a88b=_[_0xf883('0x3c')](db[_0xf883('0x3d')]['rawAttributes'],function(_0x4f7556){return{'name':_0x4f7556[_0xf883('0x3e')],'type':_0x4f7556['type'][_0xf883('0x3f')]};});_0x528385[_0xf883('0x40')]=_[_0xf883('0x3c')](_0x52a88b,_0xf883('0x2d'));_0x528385[_0xf883('0x41')]=_[_0xf883('0x42')](_0x25434d[_0xf883('0x41')]);_0x528385['filters']=_[_0xf883('0x43')](_0x528385['model'],_0x528385[_0xf883('0x41')]);_0x26cdcb[_0xf883('0x44')]=_['intersection'](_0x528385[_0xf883('0x40')],qs[_0xf883('0x45')](_0x25434d[_0xf883('0x41')][_0xf883('0x45')]));_0x26cdcb[_0xf883('0x44')]=_0x26cdcb[_0xf883('0x44')][_0xf883('0x46')]?_0x26cdcb[_0xf883('0x44')]:_0x528385[_0xf883('0x40')];if(!_0x25434d[_0xf883('0x41')]['hasOwnProperty'](_0xf883('0x47'))){_0x26cdcb[_0xf883('0x23')]=qs['limit'](_0x25434d[_0xf883('0x41')]['limit']);_0x26cdcb[_0xf883('0x22')]=qs[_0xf883('0x22')](_0x25434d['query']['offset']);}_0x26cdcb[_0xf883('0x48')]=qs[_0xf883('0x49')](_0x25434d[_0xf883('0x41')]['sort']);_0x26cdcb['where']=qs[_0xf883('0x4a')](_['pick'](_0x25434d[_0xf883('0x41')],_0x528385[_0xf883('0x4a')]),_0x52a88b);var _0x146305=[];var _0x4cc12a=squel[_0xf883('0x4b')]()['field']('id')[_0xf883('0x4c')](_0xf883('0x2d'))[_0xf883('0x4c')](_0xf883('0x4d'))[_0xf883('0x4e')](_0xf883('0x4f'));var _0x2c7429=squel[_0xf883('0x4b')]()[_0xf883('0x4c')]('u.id')['field'](_0xf883('0x50'))[_0xf883('0x4c')]('ui.OpenchannelInteractionId')[_0xf883('0x4e')]('user_has_openchannel_interactions','ui')['left_join']('users','u','u.id\x20=\x20ui.UserId');var _0x4dc7da=squel[_0xf883('0x4b')]()[_0xf883('0x4e')](_0xf883('0x51'),'i')['left_join'](_0xf883('0x52'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xf883('0x53')]('users','o',_0xf883('0x54'))[_0xf883('0x53')](_0xf883('0x55'),'a',_0xf883('0x56'))[_0xf883('0x53')]('openchannel_messages','me','me.OpenchannelInteractionId\x20=\x20i.id')[_0xf883('0x53')](_0xf883('0x57'),'it',_0xf883('0x58'))[_0xf883('0x53')](_0xf883('0x4f'),'t',_0xf883('0x59'));var _0x3796ee=squel[_0xf883('0x5a')]();var _0x3ae923=[];var _0x311319=squel[_0xf883('0x5a')]();var _0x49101a;if(_0x25434d[_0xf883('0x41')]['search']){_0x49101a=as['parseSearch'](_0x25434d[_0xf883('0x41')][_0xf883('0x5b')]);var _0x24412e=_0x49101a['sqlOperator'];for(var _0x523486=0x0;_0x523486<_0x49101a[_0xf883('0x5c')][_0xf883('0x46')];_0x523486++){var _0x53fabe=_0x49101a[_0xf883('0x5c')][_0x523486];var _0x1185f0='i';var _0x81bf3d=_['find'](_0x52a88b,[_0xf883('0x2d'),_0x53fabe[_0xf883('0x4c')]]);if(!_0x81bf3d){switch(_0x53fabe[_0xf883('0x4c')]){case _0xf883('0x5d'):if(_0x53fabe[_0xf883('0x5e')]==0x1){_0x4dc7da['having']('`'+_0x53fabe['field']+_0xf883('0x5f'));}else{_0x4dc7da[_0xf883('0x60')]('`'+_0x53fabe[_0xf883('0x4c')]+_0xf883('0x61'));}break;case _0xf883('0x62'):if(_0x53fabe[_0xf883('0x63')]===_0xf883('0x64')){if(_0x53fabe[_0xf883('0x5e')][_0xf883('0x32')]('\x20')['length']>0x1){_0x3796ee[_0x24412e](_0xf883('0x65'),qs[_0xf883('0x66')](_0x53fabe['value']),null);}else{var _0x1fee71='%'+_0x53fabe[_0xf883('0x5e')]+'%';_0x3796ee[_0x24412e](_0xf883('0x67'),_0x1fee71,_0x1fee71,_0x1fee71);}}else{_0x81bf3d=_[_0xf883('0x68')](_0x52a88b,['name','ContactId']);_0x53fabe['field']=_0xf883('0x69');_0x7158e=as[_0xf883('0x6a')](_0x1185f0,_0x81bf3d[_0xf883('0x6b')],_0x53fabe);_0x3796ee[_0x24412e](_0x7158e[_0xf883('0x6c')],_0x7158e[_0xf883('0x5e')]['start'],_0x7158e[_0xf883('0x5e')][_0xf883('0x20')]);}break;case _0xf883('0x6d'):var _0x535022=_0x53fabe[_0xf883('0x5e')][_0xf883('0x32')](',')[_0xf883('0x3c')](function(_0x11c0a){return Number(_0x11c0a);});_0x535022[_0xf883('0x6e')](function(_0x3c1cae){_0x311319['or'](_0xf883('0x6f'),'%,'+_0x3c1cae+',%');});_0x3ae923=_[_0xf883('0x70')](_0x3ae923,_0x535022);break;case _0xf883('0x71'):if(_0x53fabe[_0xf883('0x63')]===_0xf883('0x64')){_0x3796ee[_0x24412e](_0xf883('0x72'),'%'+_0x53fabe[_0xf883('0x5e')]+'%',null);}else{_0x81bf3d=_['find'](_0x52a88b,[_0xf883('0x2d'),_0xf883('0x36')]);_0x53fabe[_0xf883('0x4c')]=_0xf883('0x36');_0x7158e=as[_0xf883('0x6a')](_0x1185f0,_0x81bf3d[_0xf883('0x6b')],_0x53fabe);_0x3796ee[_0x24412e](_0x7158e['text'],_0x7158e[_0xf883('0x5e')]['start'],_0x7158e[_0xf883('0x5e')][_0xf883('0x20')]);}break;case _0xf883('0x73'):_0x7158e=as[_0xf883('0x6a')]('me',null,_0x53fabe);_0x3796ee[_0x24412e](_0x7158e[_0xf883('0x6c')],_0x7158e['value']['start'],_0x7158e[_0xf883('0x5e')][_0xf883('0x20')]);break;}}else{var _0x7158e=as['buildExpression'](_0x1185f0,_0x81bf3d['type'],_0x53fabe);_0x3796ee[_0x24412e](_0x7158e['text'],_0x7158e['value']['start'],_0x7158e[_0xf883('0x5e')]['end']);}}}else{var _0x5d494c=_(_0x25434d['query'])[_0xf883('0x42')]()[_0xf883('0x3c')](function(_0x32b588){return _[_0xf883('0x74')](_0x52a88b,[_0xf883('0x2d'),_0x32b588])?_0x32b588:undefined;})[_0xf883('0x75')]()[_0xf883('0x5e')]();if(!_[_0xf883('0x76')](_0x5d494c)){_0x5d494c[_0xf883('0x6e')](function(_0x150c7b){if(_0x150c7b==='OpenchannelAccountId'){_0x4dc7da['where']('i.OpenchannelAccountId\x20IN\x20?',[][_0xf883('0x77')](_0x25434d[_0xf883('0x41')][_0x150c7b]));}else if(_0x150c7b==='createdAt'){var _0x1d3afc=JSON[_0xf883('0x78')](_0x25434d[_0xf883('0x41')][_0x150c7b])[_0xf883('0x79')];var _0x59f1cb=JSON[_0xf883('0x78')](_0x25434d[_0xf883('0x41')][_0x150c7b])['$lte'];_0x4dc7da[_0xf883('0x7a')](_0xf883('0x7b'),_0x1d3afc,_0x59f1cb);}else{if(_0x25434d[_0xf883('0x41')][_0x150c7b]==='null'){_0x4dc7da[_0xf883('0x7a')]('i.'+_0x150c7b+_0xf883('0x7c'));}else{_0x4dc7da[_0xf883('0x7a')]('i.'+_0x150c7b+'\x20=\x20?',_0x25434d[_0xf883('0x41')][_0x150c7b]);}}});}if(_0x25434d['query'][_0xf883('0x7d')]){if(_0x25434d[_0xf883('0x41')][_0xf883('0x7d')]==0x1){_0x4dc7da[_0xf883('0x60')]('`unreadMessages`\x20=\x200');}else{_0x4dc7da[_0xf883('0x60')](_0xf883('0x7e'));}}if(_0x25434d[_0xf883('0x41')][_0xf883('0x7f')]){_0x3ae923=_[_0xf883('0x80')](_0x25434d[_0xf883('0x41')][_0xf883('0x7f')])?_0x25434d[_0xf883('0x41')]['tag']:new Array(_0x25434d[_0xf883('0x41')]['tag']);_0x3ae923[_0xf883('0x6e')](function(_0x16c8ec){_0x311319['or'](_0xf883('0x6f'),'%,'+_0x16c8ec+',%');});}if(_0x25434d[_0xf883('0x41')]['filter']){var _0x485c0e=_0x25434d[_0xf883('0x41')][_0xf883('0x81')][_0xf883('0x82')]('\x5c','\x5c\x5c')[_0xf883('0x82')](/'/g,'\x27\x27');if(qs[_0xf883('0x83')](_0x485c0e)){_0x3796ee['or'](_0xf883('0x84'),_0x485c0e+'%');}else{_0x3796ee['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x485c0e))['or'](_0xf883('0x85'),_0x485c0e+'%')['or'](_0xf883('0x86'),_0x485c0e+'%');}}}_0x4dc7da[_0xf883('0x7a')](_0x3796ee);_0x4dc7da[_0xf883('0x87')](_0xf883('0x88'));var _0x6f1004={'type':db['Sequelize'][_0xf883('0x89')][_0xf883('0x8a')],'raw':!![]};var _0x35f11c=_0x4dc7da['clone']();_0x35f11c[_0xf883('0x4c')](_0xf883('0x88'));_0x35f11c[_0xf883('0x4c')](_0xf883('0x8b'),'unreadMessages');if(_0x26cdcb[_0xf883('0x48')]){_0x26cdcb[_0xf883('0x48')][_0xf883('0x6e')](function(_0x19c6f8){var _0xcbfa97=_0x19c6f8[0x0]===_0xf883('0x8c')?_0x19c6f8[0x0]:'i.'+_0x19c6f8[0x0];_0x4dc7da[_0xf883('0x48')](_0xcbfa97,_0x19c6f8[0x1]===_0xf883('0x8d')?![]:!![]);});}if(!_[_0xf883('0x76')](_0x3ae923)){_0x4dc7da[_0xf883('0x60')](_0x311319);_0x35f11c[_0xf883('0x7a')](_0xf883('0x8e'),_0x3ae923);}BPromise['resolve']()[_0xf883('0x2a')](function(){if(!_0x49101a){if(_0x25434d['query'][_0xf883('0x8f')])return;_0x35f11c[_0xf883('0x7a')](_0xf883('0x90'));_0x4dc7da['where'](_0xf883('0x90'));return;}if(_0x25434d['user'][_0xf883('0x91')]!=='agent')return;return _0x25434d[_0xf883('0x92')][_0xf883('0x93')]({'attributes':['id'],'raw':!![]})[_0xf883('0x2a')](function(_0x2bb93a){if(_[_0xf883('0x76')](_0x2bb93a)){_0x35f11c[_0xf883('0x7a')](_0xf883('0x94'));_0x4dc7da['where'](_0xf883('0x94'));}else{_0x35f11c[_0xf883('0x7a')](_0xf883('0x95'),_['map'](_0x2bb93a,'id'));_0x4dc7da[_0xf883('0x7a')](_0xf883('0x95'),_[_0xf883('0x3c')](_0x2bb93a,'id'));}});})[_0xf883('0x2a')](function(){if(_0x25434d['user'][_0xf883('0x91')]===_0xf883('0x96')&&!_0x49101a&&!_0x25434d[_0xf883('0x41')][_0xf883('0x8f')])return[];return db['sequelize'][_0xf883('0x41')](_0x35f11c[_0xf883('0x97')](),_0x6f1004);})[_0xf883('0x2a')](function(_0xfd12cd){_0xf3da49['count']=_0xfd12cd[_0xf883('0x46')];if(_0xf3da49[_0xf883('0x24')]===0x0)return[];return db[_0xf883('0x98')][_0xf883('0x41')](_0x4cc12a[_0xf883('0x97')](),_0x6f1004)['then'](function(_0x191bea){_0x146305=_[_0xf883('0x99')](_0x191bea,'id');_0x6f1004=_[_0xf883('0x9a')](_0x6f1004,{'model':db[_0xf883('0x3d')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x25434d['query'][_0xf883('0x45')]){_0x26cdcb[_0xf883('0x44')][_0xf883('0x6e')](function(_0x236b47){_0x4dc7da[_0xf883('0x4c')]('i.'+_0x236b47);});}else{_0x4dc7da[_0xf883('0x4c')](_0xf883('0x8b'),_0xf883('0x5d'));_0x4dc7da[_0xf883('0x4c')](_0xf883('0x9b'),_0xf883('0x9c'));_0x4dc7da[_0xf883('0x4c')](_0xf883('0x9d'),_0xf883('0x9e'));_0x4dc7da['field'](_0xf883('0x9f'),_0xf883('0x8c'));_0x4dc7da[_0xf883('0x4c')](_0xf883('0xa0'));_0x4dc7da[_0xf883('0x4c')](_0xf883('0xa1'),'Contact.firstName');_0x4dc7da[_0xf883('0x4c')](_0xf883('0xa2'),_0xf883('0xa3'));_0x4dc7da['field'](_0xf883('0xa4'),_0xf883('0xa5'));_0x4dc7da['field']('c.phone',_0xf883('0xa6'));_0x4dc7da['field']('c.mobile','Contact.mobile');_0x4dc7da[_0xf883('0x4c')]('c.fax','Contact.fax');_0x4dc7da[_0xf883('0x4c')]('o.fullname',_0xf883('0xa7'));_0x4dc7da['field']('o.internal','Owner.internal');_0x4dc7da[_0xf883('0x4c')](_0xf883('0xa8'),_0xf883('0x31'));}if(_0x26cdcb[_0xf883('0x23')])_0x4dc7da[_0xf883('0x23')](_0x26cdcb[_0xf883('0x23')]);if(_0x26cdcb[_0xf883('0x22')])_0x4dc7da[_0xf883('0x22')](_0x26cdcb[_0xf883('0x22')]);return db[_0xf883('0x98')][_0xf883('0x41')](_0x4dc7da[_0xf883('0x97')](),_0x6f1004);})['then'](function(_0x22bb39){if(_0x22bb39['length']>0x0)_0x2c7429[_0xf883('0x7a')]('ui.OpenchannelInteractionId\x20IN\x20?',_[_0xf883('0x3c')](_0x22bb39,'id'));return db[_0xf883('0x98')][_0xf883('0x41')](_0x2c7429[_0xf883('0x97')](),_0x6f1004)['then'](function(_0x45d1ce){var _0x2496aa=_['groupBy'](_0x45d1ce,'OpenchannelInteractionId');var _0x2db9bb=[];_0x22bb39[_0xf883('0x6e')](function(_0x58a4b0){_0x2db9bb[_0xf883('0xa9')](updateOpenchannelInteraction(_0x58a4b0,_0x146305,_0x2496aa));});return BPromise[_0xf883('0xaa')](_0x2db9bb);});});})[_0xf883('0x2a')](function(_0xff0367){_0xf3da49[_0xf883('0xab')]=_0xff0367;return _0xf3da49;})[_0xf883('0x2a')](respondWithFilteredResult(_0x24cecc,_0x26cdcb))[_0xf883('0xac')](handleError(_0x24cecc,null));};exports['show']=function(_0x354f6c,_0xac80d8){var _0x422dd8={};if(_0x354f6c['query'][_0xf883('0x6b')]&&_0x354f6c[_0xf883('0x41')][_0xf883('0x6b')]===_0xf883('0x4e')){_0x422dd8[_0xf883('0x4e')]=_0x354f6c[_0xf883('0xad')]['id'];}else{_0x422dd8['id']=_0x354f6c[_0xf883('0xad')]['id'];}var _0x4b46ef={'raw':![],'where':_0x422dd8},_0x36b027={};_0x36b027[_0xf883('0x40')]=_['keys'](db[_0xf883('0x3d')][_0xf883('0xae')]);_0x36b027[_0xf883('0x41')]=_['keys'](_0x354f6c[_0xf883('0x41')]);_0x36b027[_0xf883('0x4a')]=_['intersection'](_0x36b027[_0xf883('0x40')],_0x36b027['query']);_0x4b46ef['attributes']=_[_0xf883('0x43')](_0x36b027[_0xf883('0x40')],qs[_0xf883('0x45')](_0x354f6c[_0xf883('0x41')][_0xf883('0x45')]));_0x4b46ef['attributes']=_0x4b46ef[_0xf883('0x44')]['length']?_0x4b46ef[_0xf883('0x44')]:_0x36b027[_0xf883('0x40')];if(_0x354f6c['query']['includeAll']){_0x4b46ef[_0xf883('0xaf')]=[{'all':!![]}];}_0x4b46ef=_[_0xf883('0x9a')]({},_0x4b46ef,_0x354f6c[_0xf883('0xb0')]);return db[_0xf883('0x3d')][_0xf883('0x68')](_0x4b46ef)[_0xf883('0x2a')](handleEntityNotFound(_0xac80d8,null))[_0xf883('0x2a')](respondWithResult(_0xac80d8,null))[_0xf883('0xac')](handleError(_0xac80d8,null));};exports['create']=function(_0x157669,_0x30408b){return db['OpenchannelInteraction']['create'](_0x157669[_0xf883('0x73')],{})[_0xf883('0x2a')](respondWithResult(_0x30408b,0xc9))['catch'](handleError(_0x30408b,null));};exports['update']=function(_0x154b2d,_0x44beac){if(_0x154b2d[_0xf883('0x73')]['id']){delete _0x154b2d[_0xf883('0x73')]['id'];}return db[_0xf883('0x3d')][_0xf883('0x68')]({'where':{'id':_0x154b2d[_0xf883('0xad')]['id']}})[_0xf883('0x2a')](handleEntityNotFound(_0x44beac,null))['then'](saveUpdates(_0x154b2d['body'],null))[_0xf883('0x2a')](respondWithResult(_0x44beac,null))[_0xf883('0xac')](handleError(_0x44beac,null));};exports[_0xf883('0x2b')]=function(_0x50cbca,_0x45d417){return db[_0xf883('0x3d')][_0xf883('0x68')]({'where':{'id':_0x50cbca[_0xf883('0xad')]['id']}})[_0xf883('0x2a')](handleEntityNotFound(_0x45d417,null))[_0xf883('0x2a')](removeEntity(_0x45d417,null))[_0xf883('0xac')](handleError(_0x45d417,null));};exports[_0xf883('0xb1')]=function(_0x3b8bec,_0x14bb6e){return db[_0xf883('0x3d')][_0xf883('0xb1')]()[_0xf883('0x2a')](respondWithResult(_0x14bb6e,null))[_0xf883('0xac')](handleError(_0x14bb6e,null));};exports[_0xf883('0xb2')]=function(_0xf8b0e2,_0x4ca7ac,_0x54a52f){return db[_0xf883('0xb3')][_0xf883('0x68')]({'where':{'id':_0xf8b0e2['params']['id']}})[_0xf883('0x2a')](handleEntityNotFound(_0x4ca7ac,null))[_0xf883('0x2a')](function(_0x51f9ff){if(_0x51f9ff){return _0x51f9ff['addMessage'](_0xf8b0e2[_0xf883('0x73')][_0xf883('0xb4')],_[_0xf883('0xb5')](_0xf8b0e2[_0xf883('0x73')],[_0xf883('0xb4'),'id'])||{});}})[_0xf883('0x2a')](respondWithResult(_0x4ca7ac,null))['catch'](handleError(_0x4ca7ac,null));};exports['getMessages']=function(_0xfe9f63,_0x9832a8,_0x2ec7bd){var _0x54b9b4={'raw':![],'where':{}};var _0x32205b={};var _0x194a5d={'count':0x0,'rows':[]};return db[_0xf883('0x3d')][_0xf883('0xb6')]({'where':{'id':_0xfe9f63[_0xf883('0xad')]['id']}})[_0xf883('0x2a')](handleEntityNotFound(_0x9832a8,null))[_0xf883('0x2a')](function(_0x3aad07){if(_0x3aad07){_0x32205b[_0xf883('0x40')]=_[_0xf883('0x42')](db[_0xf883('0xb3')][_0xf883('0xae')]);_0x32205b['query']=_[_0xf883('0x42')](_0xfe9f63[_0xf883('0x41')]);_0x32205b[_0xf883('0x4a')]=_['intersection'](_0x32205b[_0xf883('0x40')],_0x32205b[_0xf883('0x41')]);_0x54b9b4[_0xf883('0x44')]=_['intersection'](_0x32205b[_0xf883('0x40')],qs[_0xf883('0x45')](_0xfe9f63[_0xf883('0x41')][_0xf883('0x45')]));_0x54b9b4[_0xf883('0x44')]=_0x54b9b4[_0xf883('0x44')][_0xf883('0x46')]?_0x54b9b4[_0xf883('0x44')]:_0x32205b[_0xf883('0x40')];if(!_0xfe9f63[_0xf883('0x41')][_0xf883('0xb7')](_0xf883('0x47'))){_0x54b9b4['limit']=qs['limit'](_0xfe9f63[_0xf883('0x41')]['limit']);_0x54b9b4[_0xf883('0x22')]=qs['offset'](_0xfe9f63[_0xf883('0x41')][_0xf883('0x22')]);}_0x54b9b4[_0xf883('0x48')]=qs[_0xf883('0x49')](_0xfe9f63[_0xf883('0x41')][_0xf883('0x49')]);_0x54b9b4[_0xf883('0x7a')]=qs[_0xf883('0x4a')](_[_0xf883('0xb8')](_0xfe9f63[_0xf883('0x41')],_0x32205b[_0xf883('0x4a')]));_0x54b9b4[_0xf883('0x7a')][_0xf883('0xb9')]=_0x3aad07['id'];if(_0xfe9f63[_0xf883('0x41')][_0xf883('0x81')]){_0x54b9b4['where']=_[_0xf883('0x9a')](_0x54b9b4['where'],{'$or':_[_0xf883('0x3c')](_0x54b9b4[_0xf883('0x44')],function(_0x526f97){var _0x547387={};_0x547387[_0x526f97]={'$like':'%'+_0xfe9f63[_0xf883('0x41')][_0xf883('0x81')]+'%'};return _0x547387;})});}if(_0xfe9f63['query']['$gte']){var _0xc3539d=_0xfe9f63[_0xf883('0x41')][_0xf883('0x79')][_0xf883('0x32')](',');var _0x432b99={};_0x432b99[_0xc3539d[0x0]]={'$gte':moment(_0xc3539d[0x1])[_0xf883('0xba')](_0xf883('0xbb'))};_0x54b9b4['where']=_['merge'](_0x54b9b4[_0xf883('0x7a')],_0x432b99);}_0x54b9b4=_['merge']({},_0x54b9b4,_0xfe9f63['options']);return db[_0xf883('0xb3')][_0xf883('0x24')]({'where':_0x54b9b4[_0xf883('0x7a')]})[_0xf883('0x2a')](function(_0x454641){_0x194a5d[_0xf883('0x24')]=_0x454641;if(_0xfe9f63['query']['includeAll']){_0x54b9b4[_0xf883('0xaf')]=[{'all':!![]}];}return db[_0xf883('0xb3')][_0xf883('0xbc')](_0x54b9b4);})['then'](function(_0x456cee){_0x194a5d[_0xf883('0xab')]=_0x456cee;return _0x194a5d;});}})['then'](respondWithFilteredResult(_0x9832a8,_0x54b9b4))['catch'](handleError(_0x9832a8,null));};exports[_0xf883('0xbd')]=function(_0x2fd8f0,_0x22fd9b,_0x1e3b12){return db['OpenchannelInteraction'][_0xf883('0x68')]({'where':{'id':_0x2fd8f0[_0xf883('0xad')]['id']}})[_0xf883('0x2a')](handleEntityNotFound(_0x22fd9b,null))['then'](function(_0x71b9bb){if(_0x71b9bb){return _0x71b9bb[_0xf883('0xbe')](_0x2fd8f0['body'][_0xf883('0xb4')],_['omit'](_0x2fd8f0[_0xf883('0x73')],[_0xf883('0xb4'),'id'])||{})[_0xf883('0xbf')](function(){return db[_0xf883('0x6d')][_0xf883('0xbc')]({'attributes':['id',_0xf883('0x2d'),_0xf883('0x4d')],'where':{'id':_0x2fd8f0['body'][_0xf883('0xb4')]}});})[_0xf883('0x2a')](function(_0x1a24b7){socket[_0xf883('0xc0')](_0xf883('0xc1'),{'id':Number(_0x2fd8f0['params']['id']),'tags':_0x1a24b7||[]});return{'id':Number(_0x2fd8f0[_0xf883('0xad')]['id']),'tags':_0x1a24b7||[]};});}})[_0xf883('0x2a')](respondWithResult(_0x22fd9b,null))['catch'](handleError(_0x22fd9b,null));};exports[_0xf883('0xc2')]=function(_0x116ab0,_0x4ebb35,_0x2b981a){return db[_0xf883('0x3d')][_0xf883('0x68')]({'where':{'id':_0x116ab0[_0xf883('0xad')]['id']}})[_0xf883('0x2a')](handleEntityNotFound(_0x4ebb35,null))[_0xf883('0x2a')](function(_0x1e4b0e){if(_0x1e4b0e){return _0x1e4b0e[_0xf883('0xc2')](_0x116ab0[_0xf883('0x41')]['ids']);}})[_0xf883('0x2a')](respondWithStatusCode(_0x4ebb35,null))['catch'](handleError(_0x4ebb35,null));};exports[_0xf883('0xc3')]=function(_0x27a684,_0x55fbd2){var _0x52b8a0=moment()[_0xf883('0xc4')]()[_0xf883('0x97')]();var _0x229906=path[_0xf883('0xc5')](config[_0xf883('0xc6')],_0xf883('0xc7'),_0xf883('0xc8'),'tmp');var _0x26a4a4=path[_0xf883('0xc5')](config[_0xf883('0xc6')],_0xf883('0xc7'),'files',_0xf883('0xc9'));var _0x3defc0=path[_0xf883('0xc5')](_0x229906,_0x52b8a0);var _0x541370=util['format']('transcript-%d-%s.zip',_0x27a684[_0xf883('0xad')]['id'],_0x52b8a0);var _0x2fcf28=path['join'](_0x229906,_0x541370);var _0x581778=[];_0x581778[_0xf883('0xa9')]({'model':db[_0xf883('0x71')],'as':'User','attributes':['id',_0xf883('0x30')],'raw':!![]});_0x581778[_0xf883('0xa9')]({'model':db['CmContact'],'as':_0xf883('0x62'),'attributes':['id',_0xf883('0xca'),_0xf883('0xcb')],'raw':!![]});if(_0x27a684[_0xf883('0x41')][_0xf883('0xc9')]){_0x581778[_0xf883('0xa9')]({'model':db['Attachment'],'as':_0xf883('0xcc'),'raw':!![]});}var _0x315fc1=[{'model':db[_0xf883('0xb3')],'as':_0xf883('0xcd'),'attributes':['id','body','createdAt','direction',_0xf883('0xce'),'read'],'include':_0x581778}];_0x315fc1['push']({'model':db[_0xf883('0xcf')],'as':_0xf883('0xd0'),'attributes':['id',_0xf883('0x2d')]});_0x315fc1[_0xf883('0xa9')]({'model':db['User'],'as':_0xf883('0xd1'),'attributes':['id',_0xf883('0x30')]});return db['OpenchannelInteraction'][_0xf883('0x68')]({'where':{'id':_0x27a684[_0xf883('0xad')]['id']},'include':_0x315fc1})[_0xf883('0x2a')](handleEntityNotFound(_0x55fbd2,null))['then'](function(_0x311c85){if(_0x311c85){var _0xc6f2e8=_0x311c85[_0xf883('0xd2')]({'plain':!![]});fs[_0xf883('0xd3')](_0x3defc0);var _0x43a11e={'channel':_0xf883('0xd4'),'account':_0xc6f2e8[_0xf883('0xd0')][_0xf883('0x2d')],'agent':_0xc6f2e8['Owner']?_0xc6f2e8['Owner'][_0xf883('0x30')]:_0xf883('0xd5'),'createdAt':moment(_0xc6f2e8[_0xf883('0xd6')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xf883('0x97')](),'closedAt':_0xc6f2e8[_0xf883('0x38')]?moment(_0xc6f2e8[_0xf883('0xd7')])[_0xf883('0xba')]('YYYY-MM-DD\x20HH:mm:ss')[_0xf883('0x97')]():'','disposition':_0xc6f2e8[_0xf883('0xd8')],'visibility':_0xc6f2e8[_0xf883('0xd9')]?_0xf883('0xda'):_0xf883('0xdb'),'messages':_(_0xc6f2e8[_0xf883('0xcd')])['filter']({'secret':![]})[_0xf883('0x3c')](function(_0x39857e){if(_0x39857e[_0xf883('0xcc')]){var _0x2c096a=path['join'](_0x26a4a4,_0x39857e[_0xf883('0xcc')]['basename']);if(fs[_0xf883('0xdc')](_0x2c096a)){fs[_0xf883('0xdd')](_0x2c096a)[_0xf883('0xde')](fs['createWriteStream'](path[_0xf883('0xc5')](_0x3defc0,_0x39857e[_0xf883('0xcc')]['basename'])));}}return{'date':moment(_0x39857e[_0xf883('0xd6')])[_0xf883('0xba')](_0xf883('0xbb'))[_0xf883('0x97')](),'sender':_0x39857e[_0xf883('0xdf')]==='out'?_0x39857e[_0xf883('0x71')]?_0x39857e[_0xf883('0x71')][_0xf883('0x30')]:_0xf883('0xe0'):_0x39857e[_0xf883('0x62')][_0xf883('0xca')]+(_0x39857e['Contact']['lastName']?'\x20'+_0x39857e[_0xf883('0x62')][_0xf883('0xcb')]:''),'body':_0x39857e[_0xf883('0xcc')]?_0x39857e['Attachment'][_0xf883('0xe1')]:_0x39857e[_0xf883('0x73')],'direction':_0x39857e[_0xf883('0xdf')]==='out'?'A':'C','secret':_0x39857e['secret'],'read':_0x39857e[_0xf883('0x7d')],'attachment':_0x39857e[_0xf883('0xcc')]};})['value']()};return ejs['renderFile'](path[_0xf883('0xc5')](config[_0xf883('0xc6')],_0xf883('0xc7'),_0xf883('0xe2'),_0xf883('0xe3')),{'interaction':_0x43a11e})[_0xf883('0x2a')](function(_0x510ea4){var _0x496bca=path[_0xf883('0xc5')](_0x3defc0,_0xf883('0xe4')+_0xc6f2e8['id']+'-'+_0x52b8a0+_0xf883('0xe5'));var _0x814a8f={'path':_0x496bca,'channel':'Openchannel','interactionId':_0xc6f2e8['id']};return pdf['createPdfFromHTML'](_0x510ea4,_0x814a8f);})[_0xf883('0x2a')](function(){return new BPromise(function(_0xf824f3,_0x51a93a){zipdir(_0x3defc0,{'saveTo':_0x2fcf28},function(_0x358e83,_0x127dc0){if(_0x358e83)return _0x51a93a(_0x358e83);return _0xf824f3(_0x127dc0);});})['then'](function(){return new BPromise(function(_0x44e213,_0x484d8b){rimraf(_0x3defc0,function(_0x4ca9c4){if(_0x4ca9c4)_0x484d8b(_0x4ca9c4);return _0x44e213();});});})['then'](function(){return _0x55fbd2[_0xf883('0xc3')](_0x2fcf28,_0x541370,function(_0x3fd3da){if(_0x3fd3da){console[_0xf883('0xe6')](_0xf883('0xe7'),_0x3fd3da);}else{fs[_0xf883('0xe8')](_0x2fcf28);}});});});}else{return _0x55fbd2[_0xf883('0x1f')](0xc8);}})['catch'](handleError(_0x55fbd2,null));}; \ No newline at end of file +var _0xc893=['start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','isEmpty','OpenchannelAccountId','where','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','tag','isArray','filter','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','all','rows','params','includeAll','include','options','create','destroy','describe','OpenchannelMessage','addMessage','ids','omit','getMessages','hasOwnProperty','nolimit','OpenchannelInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','color','emit','openchannelInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','transcript-%d-%s.zip','CmContact','lastName','attachments','Attachment','secret','OpenchannelAccount','Account','Owner','get','mkdirSync','disposition','Public','Private','Messages','basename','existsSync','createReadStream','pipe','createWriteStream','direction','out','System','firstName','renderFile','transcript-','.pdf','Openchannel','createPdfFromHTML','log','err','unlinkSync','eml-format','fast-json-patch','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/environment','localhost','socket.io-emitter','redis','./openchannelInteraction.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','error','stack','name','Users','map','fullname','TagIds','Tags','forEach','push','catch','waiting','answered','total','UserId','closed','talking','unmanaged','OpenchannelInteraction','rawAttributes','fieldName','key','keys','query','filters','intersection','model','attributes','fields','length','order','sort','pick','select','field','from','tools_tags','u.id','u.fullname','user_has_openchannel_interactions','left_join','users','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','it.OpenchannelInteractionId\x20=\x20i.id','expr','parseSearch','search','conditions','find','unreadMessages','value','having','`\x20=\x200','Contact','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text'];(function(_0x4a75ba,_0x5e7dae){var _0x57ff22=function(_0x2d4a1d){while(--_0x2d4a1d){_0x4a75ba['push'](_0x4a75ba['shift']());}};_0x57ff22(++_0x5e7dae);}(_0xc893,0x177));var _0x3c89=function(_0x530d54,_0x23d988){_0x530d54=_0x530d54-0x0;var _0x37aef1=_0xc893[_0x530d54];return _0x37aef1;};'use strict';var emlformat=require(_0x3c89('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3c89('0x1'));var rp=require('request-promise');var moment=require(_0x3c89('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x3c89('0x3'));var util=require('util');var path=require(_0x3c89('0x4'));var sox=require('sox');var csv=require(_0x3c89('0x5'));var ejs=require(_0x3c89('0x6'));var fs=require('fs');var fs_extra=require(_0x3c89('0x7'));var _=require(_0x3c89('0x8'));var squel=require(_0x3c89('0x9'));var crypto=require(_0x3c89('0xa'));var jsforce=require(_0x3c89('0xb'));var deskjs=require(_0x3c89('0xc'));var toCsv=require(_0x3c89('0x5'));var querystring=require('querystring');var Papa=require(_0x3c89('0xd'));var Redis=require(_0x3c89('0xe'));var authService=require(_0x3c89('0xf'));var qs=require(_0x3c89('0x10'));var as=require(_0x3c89('0x11'));var pdf=require(_0x3c89('0x12'));var hardwareService=require(_0x3c89('0x13'));var logger=require(_0x3c89('0x14'))(_0x3c89('0x15'));var utils=require('../../config/utils');var config=require(_0x3c89('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x3c89('0x17'),'port':0x18eb});var socket=require(_0x3c89('0x18'))(new Redis(config[_0x3c89('0x19')]));require(_0x3c89('0x1a'))[_0x3c89('0x1b')](socket);function respondWithStatusCode(_0x35c535,_0x315a10){_0x315a10=_0x315a10||0xcc;return function(_0xb92546){if(_0xb92546){return _0x35c535[_0x3c89('0x1c')](_0x315a10);}return _0x35c535[_0x3c89('0x1d')](_0x315a10)[_0x3c89('0x1e')]();};}function respondWithResult(_0x2e3949,_0x2fbb08){_0x2fbb08=_0x2fbb08||0xc8;return function(_0x8fffc5){if(_0x8fffc5){return _0x2e3949['status'](_0x2fbb08)[_0x3c89('0x1f')](_0x8fffc5);}};}function respondWithFilteredResult(_0x6a4c12,_0x5a89ab){return function(_0x1d0bcf){if(_0x1d0bcf){var _0x5bb5d4=typeof _0x5a89ab['offset']===_0x3c89('0x20')&&typeof _0x5a89ab[_0x3c89('0x21')]===_0x3c89('0x20');var _0x9924ee=_0x1d0bcf[_0x3c89('0x22')];var _0x44d268=_0x5bb5d4?0x0:_0x5a89ab[_0x3c89('0x23')];var _0x38d855=_0x5bb5d4?_0x1d0bcf[_0x3c89('0x22')]:_0x5a89ab[_0x3c89('0x23')]+_0x5a89ab[_0x3c89('0x21')];var _0x3fb973;if(_0x38d855>=_0x9924ee){_0x38d855=_0x9924ee;_0x3fb973=0xc8;}else{_0x3fb973=0xce;}_0x6a4c12['status'](_0x3fb973);return _0x6a4c12[_0x3c89('0x24')](_0x3c89('0x25'),_0x44d268+'-'+_0x38d855+'/'+_0x9924ee)[_0x3c89('0x1f')](_0x1d0bcf);}return null;};}function patchUpdates(_0x1aebcf){return function(_0x4dfa93){try{jsonpatch[_0x3c89('0x26')](_0x4dfa93,_0x1aebcf,!![]);}catch(_0x1eafd5){return BPromise[_0x3c89('0x27')](_0x1eafd5);}return _0x4dfa93['save']();};}function saveUpdates(_0x2f7bb8,_0x3e48b0){return function(_0x49866a){if(_0x49866a){return _0x49866a[_0x3c89('0x28')](_0x2f7bb8)[_0x3c89('0x29')](function(_0x295d31){return _0x295d31;});}return null;};}function removeEntity(_0x4704f6,_0x2e8ef9){return function(_0x50e8e9){if(_0x50e8e9){return _0x50e8e9['destroy']()[_0x3c89('0x29')](function(){_0x4704f6[_0x3c89('0x1d')](0xcc)[_0x3c89('0x1e')]();});}};}function handleEntityNotFound(_0x2e103e,_0x106bef){return function(_0x355c8f){if(!_0x355c8f){_0x2e103e[_0x3c89('0x1c')](0x194);}return _0x355c8f;};}function handleError(_0x387b2b,_0x56fbb5){_0x56fbb5=_0x56fbb5||0x1f4;return function(_0x912f62){logger[_0x3c89('0x2a')](_0x912f62[_0x3c89('0x2b')]);if(_0x912f62[_0x3c89('0x2c')]){delete _0x912f62['name'];}_0x387b2b[_0x3c89('0x1d')](_0x56fbb5)['send'](_0x912f62);};}function getInteractionUsers(_0x5de33b,_0x476f40){return new BPromise(function(_0x4b2b84,_0x142367){try{if(_0x476f40[_0x5de33b['id']]){_0x5de33b[_0x3c89('0x2d')]=_[_0x3c89('0x2e')](_0x476f40[_0x5de33b['id']],function(_0x303f5d){return{'id':_0x303f5d['id'],'fullname':_0x303f5d[_0x3c89('0x2f')]};});}}catch(_0x159cad){_0x142367(_0x159cad);}_0x4b2b84(_0x5de33b);});}function getInteractionTags(_0x59792b,_0x116b56){return new BPromise(function(_0x37038a,_0x522872){try{if(_0x59792b[_0x3c89('0x30')]){_0x59792b[_0x3c89('0x31')]=[];_0x59792b['TagIds']['split'](',')[_0x3c89('0x32')](function(_0x3993f4){_0x59792b[_0x3c89('0x31')][_0x3c89('0x33')](_0x116b56[_0x3993f4]);});}delete _0x59792b[_0x3c89('0x30')];}catch(_0x38c463){_0x522872(_0x38c463);}_0x37038a(_0x59792b);});}function updateOpenchannelInteraction(_0x3a427a,_0x392fc7,_0x190502){return new BPromise(function(_0x329306,_0x51680d){return getInteractionUsers(_0x3a427a,_0x190502)[_0x3c89('0x29')](function(_0x318608){return getInteractionTags(_0x318608,_0x392fc7);})[_0x3c89('0x29')](function(_0x414ae6){return getStateInteraction(_0x414ae6);})[_0x3c89('0x29')](function(_0xd02d4c){_0x329306(_0xd02d4c);})[_0x3c89('0x34')](function(_0x42a359){_0x51680d(_0x42a359);});});}function getStateInteraction(_0x1cd842){return new BPromise(function(_0x50828a){_0x1cd842[_0x3c89('0x35')]=0x0;_0x1cd842['talking']=0x0;_0x1cd842[_0x3c89('0x36')]=0x0;_0x1cd842['unmanaged']=0x0;_0x1cd842[_0x3c89('0x37')]=0x0;if(!_0x1cd842['closed']&&!_0x1cd842[_0x3c89('0x38')]){_0x1cd842[_0x3c89('0x35')]+=0x1;}if(!_0x1cd842[_0x3c89('0x39')]&&_0x1cd842[_0x3c89('0x38')]){_0x1cd842['talking']+=0x1;if(_0x1cd842['waiting']){_0x1cd842['waiting']-=0x1;}}if(_0x1cd842[_0x3c89('0x39')]&&_0x1cd842[_0x3c89('0x38')]){_0x1cd842[_0x3c89('0x36')]+=0x1;if(_0x1cd842[_0x3c89('0x3a')]){_0x1cd842['talking']-=0x1;}}if(_0x1cd842['closed']&&!_0x1cd842[_0x3c89('0x38')]){_0x1cd842[_0x3c89('0x3b')]+=0x1;if(_0x1cd842[_0x3c89('0x35')]){_0x1cd842[_0x3c89('0x35')]-=0x1;}}_0x1cd842[_0x3c89('0x37')]+=0x1;_0x50828a(_0x1cd842);});}exports['index']=function(_0x15e57b,_0xc0a240){var _0x1f2812={},_0x2428cc={},_0x5e3bbe={'count':0x0,'rows':[]};var _0x9b767d=_['map'](db[_0x3c89('0x3c')][_0x3c89('0x3d')],function(_0x3041a7){return{'name':_0x3041a7[_0x3c89('0x3e')],'type':_0x3041a7['type'][_0x3c89('0x3f')]};});_0x2428cc['model']=_['map'](_0x9b767d,_0x3c89('0x2c'));_0x2428cc['query']=_[_0x3c89('0x40')](_0x15e57b[_0x3c89('0x41')]);_0x2428cc[_0x3c89('0x42')]=_[_0x3c89('0x43')](_0x2428cc[_0x3c89('0x44')],_0x2428cc[_0x3c89('0x41')]);_0x1f2812[_0x3c89('0x45')]=_[_0x3c89('0x43')](_0x2428cc[_0x3c89('0x44')],qs[_0x3c89('0x46')](_0x15e57b[_0x3c89('0x41')][_0x3c89('0x46')]));_0x1f2812['attributes']=_0x1f2812[_0x3c89('0x45')][_0x3c89('0x47')]?_0x1f2812[_0x3c89('0x45')]:_0x2428cc[_0x3c89('0x44')];if(!_0x15e57b[_0x3c89('0x41')]['hasOwnProperty']('nolimit')){_0x1f2812[_0x3c89('0x21')]=qs[_0x3c89('0x21')](_0x15e57b[_0x3c89('0x41')][_0x3c89('0x21')]);_0x1f2812[_0x3c89('0x23')]=qs[_0x3c89('0x23')](_0x15e57b[_0x3c89('0x41')][_0x3c89('0x23')]);}_0x1f2812[_0x3c89('0x48')]=qs[_0x3c89('0x49')](_0x15e57b[_0x3c89('0x41')][_0x3c89('0x49')]);_0x1f2812['where']=qs[_0x3c89('0x42')](_[_0x3c89('0x4a')](_0x15e57b[_0x3c89('0x41')],_0x2428cc['filters']),_0x9b767d);var _0x1c8019=[];var _0x4a1c61=squel[_0x3c89('0x4b')]()[_0x3c89('0x4c')]('id')['field'](_0x3c89('0x2c'))['field']('color')[_0x3c89('0x4d')](_0x3c89('0x4e'));var _0x10930d=squel[_0x3c89('0x4b')]()[_0x3c89('0x4c')](_0x3c89('0x4f'))[_0x3c89('0x4c')](_0x3c89('0x50'))[_0x3c89('0x4c')]('ui.OpenchannelInteractionId')[_0x3c89('0x4d')](_0x3c89('0x51'),'ui')[_0x3c89('0x52')](_0x3c89('0x53'),'u','u.id\x20=\x20ui.UserId');var _0x3b748f=squel[_0x3c89('0x4b')]()[_0x3c89('0x4d')]('openchannel_interactions','i')[_0x3c89('0x52')]('cm_contacts','c',_0x3c89('0x54'))[_0x3c89('0x52')]('users','o',_0x3c89('0x55'))[_0x3c89('0x52')](_0x3c89('0x56'),'a',_0x3c89('0x57'))[_0x3c89('0x52')](_0x3c89('0x58'),'me',_0x3c89('0x59'))[_0x3c89('0x52')]('openchannel_interaction_has_tags','it',_0x3c89('0x5a'))[_0x3c89('0x52')](_0x3c89('0x4e'),'t','t.id\x20=\x20it.TagId');var _0x8ddf57=squel[_0x3c89('0x5b')]();var _0x4d1074=[];var _0xbd52f2=squel[_0x3c89('0x5b')]();var _0x1043a6;if(_0x15e57b[_0x3c89('0x41')]['search']){_0x1043a6=as[_0x3c89('0x5c')](_0x15e57b[_0x3c89('0x41')][_0x3c89('0x5d')]);var _0x37a414=_0x1043a6['sqlOperator'];for(var _0x51dfd0=0x0;_0x51dfd0<_0x1043a6['conditions'][_0x3c89('0x47')];_0x51dfd0++){var _0x536cbf=_0x1043a6[_0x3c89('0x5e')][_0x51dfd0];var _0x4bd952='i';var _0xa9a739=_[_0x3c89('0x5f')](_0x9b767d,[_0x3c89('0x2c'),_0x536cbf[_0x3c89('0x4c')]]);if(!_0xa9a739){switch(_0x536cbf[_0x3c89('0x4c')]){case _0x3c89('0x60'):if(_0x536cbf[_0x3c89('0x61')]==0x1){_0x3b748f[_0x3c89('0x62')]('`'+_0x536cbf[_0x3c89('0x4c')]+_0x3c89('0x63'));}else{_0x3b748f['having']('`'+_0x536cbf[_0x3c89('0x4c')]+'`\x20>\x200');}break;case _0x3c89('0x64'):if(_0x536cbf[_0x3c89('0x65')]===_0x3c89('0x66')){if(_0x536cbf[_0x3c89('0x61')][_0x3c89('0x67')]('\x20')[_0x3c89('0x47')]>0x1){_0x8ddf57[_0x37a414](_0x3c89('0x68'),qs[_0x3c89('0x69')](_0x536cbf[_0x3c89('0x61')]),null);}else{var _0x508550='%'+_0x536cbf[_0x3c89('0x61')]+'%';_0x8ddf57[_0x37a414](_0x3c89('0x6a'),_0x508550,_0x508550,_0x508550);}}else{_0xa9a739=_[_0x3c89('0x5f')](_0x9b767d,['name','ContactId']);_0x536cbf[_0x3c89('0x4c')]=_0x3c89('0x6b');_0x4e7e61=as[_0x3c89('0x6c')](_0x4bd952,_0xa9a739[_0x3c89('0x6d')],_0x536cbf);_0x8ddf57[_0x37a414](_0x4e7e61[_0x3c89('0x6e')],_0x4e7e61['value'][_0x3c89('0x6f')],_0x4e7e61['value'][_0x3c89('0x1e')]);}break;case _0x3c89('0x70'):var _0x4f786e=_0x536cbf[_0x3c89('0x61')][_0x3c89('0x67')](',')[_0x3c89('0x2e')](function(_0x1042a5){return Number(_0x1042a5);});_0x4f786e[_0x3c89('0x32')](function(_0xdf00ae){_0xbd52f2['or'](_0x3c89('0x71'),'%,'+_0xdf00ae+',%');});_0x4d1074=_[_0x3c89('0x72')](_0x4d1074,_0x4f786e);break;case _0x3c89('0x73'):if(_0x536cbf[_0x3c89('0x65')]===_0x3c89('0x66')){_0x8ddf57[_0x37a414](_0x3c89('0x74'),'%'+_0x536cbf[_0x3c89('0x61')]+'%',null);}else{_0xa9a739=_[_0x3c89('0x5f')](_0x9b767d,['name',_0x3c89('0x38')]);_0x536cbf['field']='UserId';_0x4e7e61=as[_0x3c89('0x6c')](_0x4bd952,_0xa9a739[_0x3c89('0x6d')],_0x536cbf);_0x8ddf57[_0x37a414](_0x4e7e61[_0x3c89('0x6e')],_0x4e7e61['value']['start'],_0x4e7e61[_0x3c89('0x61')][_0x3c89('0x1e')]);}break;case _0x3c89('0x75'):_0x4e7e61=as[_0x3c89('0x6c')]('me',null,_0x536cbf);_0x8ddf57[_0x37a414](_0x4e7e61[_0x3c89('0x6e')],_0x4e7e61[_0x3c89('0x61')]['start'],_0x4e7e61[_0x3c89('0x61')][_0x3c89('0x1e')]);break;}}else{var _0x4e7e61=as[_0x3c89('0x6c')](_0x4bd952,_0xa9a739['type'],_0x536cbf);_0x8ddf57[_0x37a414](_0x4e7e61[_0x3c89('0x6e')],_0x4e7e61[_0x3c89('0x61')][_0x3c89('0x6f')],_0x4e7e61[_0x3c89('0x61')][_0x3c89('0x1e')]);}}}else{var _0x21e2b0=_(_0x15e57b[_0x3c89('0x41')])[_0x3c89('0x40')]()[_0x3c89('0x2e')](function(_0x2b5b0f){return _['some'](_0x9b767d,[_0x3c89('0x2c'),_0x2b5b0f])?_0x2b5b0f:undefined;})['compact']()[_0x3c89('0x61')]();if(!_[_0x3c89('0x76')](_0x21e2b0)){_0x21e2b0[_0x3c89('0x32')](function(_0x4597be){if(_0x4597be===_0x3c89('0x77')){_0x3b748f[_0x3c89('0x78')](_0x3c89('0x79'),[][_0x3c89('0x7a')](_0x15e57b[_0x3c89('0x41')][_0x4597be]));}else if(_0x4597be===_0x3c89('0x7b')){var _0x35e592=JSON[_0x3c89('0x7c')](_0x15e57b['query'][_0x4597be])[_0x3c89('0x7d')];var _0x1428d2=JSON[_0x3c89('0x7c')](_0x15e57b[_0x3c89('0x41')][_0x4597be])[_0x3c89('0x7e')];_0x3b748f[_0x3c89('0x78')](_0x3c89('0x7f'),_0x35e592,_0x1428d2);}else{if(_0x15e57b['query'][_0x4597be]===_0x3c89('0x80')){_0x3b748f[_0x3c89('0x78')]('i.'+_0x4597be+_0x3c89('0x81'));}else{_0x3b748f[_0x3c89('0x78')]('i.'+_0x4597be+'\x20=\x20?',_0x15e57b[_0x3c89('0x41')][_0x4597be]);}}});}if(_0x15e57b[_0x3c89('0x41')][_0x3c89('0x82')]){if(_0x15e57b[_0x3c89('0x41')]['read']==0x1){_0x3b748f[_0x3c89('0x62')](_0x3c89('0x83'));}else{_0x3b748f[_0x3c89('0x62')]('`unreadMessages`\x20>\x200');}}if(_0x15e57b[_0x3c89('0x41')][_0x3c89('0x84')]){_0x4d1074=_[_0x3c89('0x85')](_0x15e57b['query'][_0x3c89('0x84')])?_0x15e57b[_0x3c89('0x41')][_0x3c89('0x84')]:new Array(_0x15e57b[_0x3c89('0x41')][_0x3c89('0x84')]);_0x4d1074[_0x3c89('0x32')](function(_0x61888c){_0xbd52f2['or'](_0x3c89('0x71'),'%,'+_0x61888c+',%');});}if(_0x15e57b[_0x3c89('0x41')][_0x3c89('0x86')]){var _0x16e3b2=_0x15e57b[_0x3c89('0x41')][_0x3c89('0x86')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x3c89('0x87')](_0x16e3b2)){_0x8ddf57['or'](_0x3c89('0x88'),_0x16e3b2+'%');}else{_0x8ddf57['or'](_0x3c89('0x89'),qs[_0x3c89('0x69')](_0x16e3b2))['or'](_0x3c89('0x8a'),_0x16e3b2+'%')['or'](_0x3c89('0x8b'),_0x16e3b2+'%');}}}_0x3b748f['where'](_0x8ddf57);_0x3b748f[_0x3c89('0x8c')]('i.id');var _0x5afe27={'type':db[_0x3c89('0x8d')]['QueryTypes']['SELECT'],'raw':!![]};var _0x24f101=_0x3b748f['clone']();_0x24f101[_0x3c89('0x4c')](_0x3c89('0x8e'));_0x24f101[_0x3c89('0x4c')](_0x3c89('0x8f'),_0x3c89('0x60'));if(_0x1f2812[_0x3c89('0x48')]){_0x1f2812[_0x3c89('0x48')][_0x3c89('0x32')](function(_0x294c20){var _0x31c8b=_0x294c20[0x0]===_0x3c89('0x90')?_0x294c20[0x0]:'i.'+_0x294c20[0x0];_0x3b748f[_0x3c89('0x48')](_0x31c8b,_0x294c20[0x1]===_0x3c89('0x91')?![]:!![]);});}if(!_[_0x3c89('0x76')](_0x4d1074)){_0x3b748f[_0x3c89('0x62')](_0xbd52f2);_0x24f101[_0x3c89('0x78')](_0x3c89('0x92'),_0x4d1074);}BPromise[_0x3c89('0x93')]()[_0x3c89('0x29')](function(){if(!_0x1043a6){if(_0x15e57b[_0x3c89('0x41')][_0x3c89('0x77')])return;_0x24f101[_0x3c89('0x78')](_0x3c89('0x94'));_0x3b748f['where'](_0x3c89('0x94'));return;}if(_0x15e57b[_0x3c89('0x95')][_0x3c89('0x96')]!==_0x3c89('0x97'))return;return _0x15e57b[_0x3c89('0x95')][_0x3c89('0x98')]({'attributes':['id'],'raw':!![]})[_0x3c89('0x29')](function(_0x4a3cb7){if(_[_0x3c89('0x76')](_0x4a3cb7)){_0x24f101['where'](_0x3c89('0x99'));_0x3b748f[_0x3c89('0x78')](_0x3c89('0x99'));}else{_0x24f101[_0x3c89('0x78')](_0x3c89('0x79'),_['map'](_0x4a3cb7,'id'));_0x3b748f[_0x3c89('0x78')](_0x3c89('0x79'),_['map'](_0x4a3cb7,'id'));}});})[_0x3c89('0x29')](function(){if(_0x15e57b['user'][_0x3c89('0x96')]==='agent'&&!_0x1043a6&&!_0x15e57b['query'][_0x3c89('0x77')])return[];return db[_0x3c89('0x9a')][_0x3c89('0x41')](_0x24f101['toString'](),_0x5afe27);})[_0x3c89('0x29')](function(_0xe44063){_0x5e3bbe[_0x3c89('0x22')]=_0xe44063[_0x3c89('0x47')];if(_0x5e3bbe[_0x3c89('0x22')]===0x0)return[];return db[_0x3c89('0x9a')]['query'](_0x4a1c61[_0x3c89('0x9b')](),_0x5afe27)[_0x3c89('0x29')](function(_0x301be4){_0x1c8019=_[_0x3c89('0x9c')](_0x301be4,'id');_0x5afe27=_[_0x3c89('0x9d')](_0x5afe27,{'model':db[_0x3c89('0x3c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x15e57b[_0x3c89('0x41')][_0x3c89('0x46')]){_0x1f2812[_0x3c89('0x45')][_0x3c89('0x32')](function(_0x6d140a){_0x3b748f[_0x3c89('0x4c')]('i.'+_0x6d140a);});}else{_0x3b748f[_0x3c89('0x4c')](_0x3c89('0x8f'),'unreadMessages');_0x3b748f[_0x3c89('0x4c')]('a.key',_0x3c89('0x9e'));_0x3b748f['field'](_0x3c89('0x9f'),_0x3c89('0xa0'));_0x3b748f['field'](_0x3c89('0xa1'),_0x3c89('0x90'));_0x3b748f[_0x3c89('0x4c')](_0x3c89('0xa2'));_0x3b748f[_0x3c89('0x4c')](_0x3c89('0xa3'),_0x3c89('0xa4'));_0x3b748f['field'](_0x3c89('0xa5'),_0x3c89('0xa6'));_0x3b748f[_0x3c89('0x4c')](_0x3c89('0xa7'),_0x3c89('0xa8'));_0x3b748f['field'](_0x3c89('0xa9'),_0x3c89('0xaa'));_0x3b748f[_0x3c89('0x4c')](_0x3c89('0xab'),'Contact.mobile');_0x3b748f[_0x3c89('0x4c')]('c.fax',_0x3c89('0xac'));_0x3b748f[_0x3c89('0x4c')](_0x3c89('0xad'),_0x3c89('0xae'));_0x3b748f[_0x3c89('0x4c')](_0x3c89('0xaf'),'Owner.internal');_0x3b748f[_0x3c89('0x4c')](_0x3c89('0xb0'),'TagIds');}if(_0x1f2812[_0x3c89('0x21')])_0x3b748f[_0x3c89('0x21')](_0x1f2812[_0x3c89('0x21')]);if(_0x1f2812[_0x3c89('0x23')])_0x3b748f[_0x3c89('0x23')](_0x1f2812['offset']);return db[_0x3c89('0x9a')][_0x3c89('0x41')](_0x3b748f['toString'](),_0x5afe27);})[_0x3c89('0x29')](function(_0xd3365e){if(_0xd3365e[_0x3c89('0x47')]>0x0)_0x10930d['where']('ui.OpenchannelInteractionId\x20IN\x20?',_[_0x3c89('0x2e')](_0xd3365e,'id'));return db['sequelize']['query'](_0x10930d['toString'](),_0x5afe27)['then'](function(_0x9fc93f){var _0x4f21db=_['groupBy'](_0x9fc93f,'OpenchannelInteractionId');var _0xb482dd=[];_0xd3365e[_0x3c89('0x32')](function(_0x1fc120){_0xb482dd['push'](updateOpenchannelInteraction(_0x1fc120,_0x1c8019,_0x4f21db));});return BPromise[_0x3c89('0xb1')](_0xb482dd);});});})[_0x3c89('0x29')](function(_0x459c41){_0x5e3bbe[_0x3c89('0xb2')]=_0x459c41;return _0x5e3bbe;})[_0x3c89('0x29')](respondWithFilteredResult(_0xc0a240,_0x1f2812))[_0x3c89('0x34')](handleError(_0xc0a240,null));};exports['show']=function(_0x4f758e,_0x21297f){var _0x576ff2={};if(_0x4f758e['query'][_0x3c89('0x6d')]&&_0x4f758e[_0x3c89('0x41')]['type']===_0x3c89('0x4d')){_0x576ff2['from']=_0x4f758e[_0x3c89('0xb3')]['id'];}else{_0x576ff2['id']=_0x4f758e['params']['id'];}var _0x190b46={'raw':![],'where':_0x576ff2},_0x367381={};_0x367381[_0x3c89('0x44')]=_[_0x3c89('0x40')](db[_0x3c89('0x3c')]['rawAttributes']);_0x367381[_0x3c89('0x41')]=_[_0x3c89('0x40')](_0x4f758e[_0x3c89('0x41')]);_0x367381[_0x3c89('0x42')]=_[_0x3c89('0x43')](_0x367381['model'],_0x367381[_0x3c89('0x41')]);_0x190b46[_0x3c89('0x45')]=_['intersection'](_0x367381[_0x3c89('0x44')],qs['fields'](_0x4f758e['query']['fields']));_0x190b46[_0x3c89('0x45')]=_0x190b46[_0x3c89('0x45')]['length']?_0x190b46[_0x3c89('0x45')]:_0x367381[_0x3c89('0x44')];if(_0x4f758e[_0x3c89('0x41')][_0x3c89('0xb4')]){_0x190b46[_0x3c89('0xb5')]=[{'all':!![]}];}_0x190b46=_['merge']({},_0x190b46,_0x4f758e[_0x3c89('0xb6')]);return db['OpenchannelInteraction'][_0x3c89('0x5f')](_0x190b46)[_0x3c89('0x29')](handleEntityNotFound(_0x21297f,null))[_0x3c89('0x29')](respondWithResult(_0x21297f,null))['catch'](handleError(_0x21297f,null));};exports['create']=function(_0x336c8a,_0x3a8337){return db[_0x3c89('0x3c')][_0x3c89('0xb7')](_0x336c8a[_0x3c89('0x75')],{})[_0x3c89('0x29')](respondWithResult(_0x3a8337,0xc9))[_0x3c89('0x34')](handleError(_0x3a8337,null));};exports[_0x3c89('0x28')]=function(_0x9703c6,_0x24c547){if(_0x9703c6[_0x3c89('0x75')]['id']){delete _0x9703c6[_0x3c89('0x75')]['id'];}return db[_0x3c89('0x3c')][_0x3c89('0x5f')]({'where':{'id':_0x9703c6[_0x3c89('0xb3')]['id']}})[_0x3c89('0x29')](handleEntityNotFound(_0x24c547,null))[_0x3c89('0x29')](saveUpdates(_0x9703c6[_0x3c89('0x75')],null))['then'](respondWithResult(_0x24c547,null))[_0x3c89('0x34')](handleError(_0x24c547,null));};exports[_0x3c89('0xb8')]=function(_0x410cbb,_0x2557cd){return db[_0x3c89('0x3c')][_0x3c89('0x5f')]({'where':{'id':_0x410cbb[_0x3c89('0xb3')]['id']}})['then'](handleEntityNotFound(_0x2557cd,null))[_0x3c89('0x29')](removeEntity(_0x2557cd,null))[_0x3c89('0x34')](handleError(_0x2557cd,null));};exports[_0x3c89('0xb9')]=function(_0x523581,_0x3c636e){return db[_0x3c89('0x3c')][_0x3c89('0xb9')]()[_0x3c89('0x29')](respondWithResult(_0x3c636e,null))[_0x3c89('0x34')](handleError(_0x3c636e,null));};exports['addMessage']=function(_0x14b3e6,_0x2af2d8,_0x170c19){return db[_0x3c89('0xba')][_0x3c89('0x5f')]({'where':{'id':_0x14b3e6[_0x3c89('0xb3')]['id']}})[_0x3c89('0x29')](handleEntityNotFound(_0x2af2d8,null))[_0x3c89('0x29')](function(_0x13e2c5){if(_0x13e2c5){return _0x13e2c5[_0x3c89('0xbb')](_0x14b3e6[_0x3c89('0x75')][_0x3c89('0xbc')],_[_0x3c89('0xbd')](_0x14b3e6[_0x3c89('0x75')],[_0x3c89('0xbc'),'id'])||{});}})[_0x3c89('0x29')](respondWithResult(_0x2af2d8,null))[_0x3c89('0x34')](handleError(_0x2af2d8,null));};exports[_0x3c89('0xbe')]=function(_0x30206e,_0x2e3e69,_0xacc7fd){var _0x593907={'raw':![],'where':{}};var _0x7b1f66={};var _0x1d188f={'count':0x0,'rows':[]};return db['OpenchannelInteraction']['findOne']({'where':{'id':_0x30206e['params']['id']}})[_0x3c89('0x29')](handleEntityNotFound(_0x2e3e69,null))[_0x3c89('0x29')](function(_0x177be3){if(_0x177be3){_0x7b1f66[_0x3c89('0x44')]=_[_0x3c89('0x40')](db[_0x3c89('0xba')][_0x3c89('0x3d')]);_0x7b1f66[_0x3c89('0x41')]=_[_0x3c89('0x40')](_0x30206e[_0x3c89('0x41')]);_0x7b1f66[_0x3c89('0x42')]=_[_0x3c89('0x43')](_0x7b1f66['model'],_0x7b1f66[_0x3c89('0x41')]);_0x593907[_0x3c89('0x45')]=_[_0x3c89('0x43')](_0x7b1f66[_0x3c89('0x44')],qs[_0x3c89('0x46')](_0x30206e[_0x3c89('0x41')][_0x3c89('0x46')]));_0x593907[_0x3c89('0x45')]=_0x593907[_0x3c89('0x45')]['length']?_0x593907['attributes']:_0x7b1f66[_0x3c89('0x44')];if(!_0x30206e[_0x3c89('0x41')][_0x3c89('0xbf')](_0x3c89('0xc0'))){_0x593907[_0x3c89('0x21')]=qs[_0x3c89('0x21')](_0x30206e['query'][_0x3c89('0x21')]);_0x593907[_0x3c89('0x23')]=qs['offset'](_0x30206e['query']['offset']);}_0x593907['order']=qs['sort'](_0x30206e[_0x3c89('0x41')][_0x3c89('0x49')]);_0x593907[_0x3c89('0x78')]=qs['filters'](_['pick'](_0x30206e['query'],_0x7b1f66[_0x3c89('0x42')]));_0x593907[_0x3c89('0x78')][_0x3c89('0xc1')]=_0x177be3['id'];if(_0x30206e[_0x3c89('0x41')]['filter']){_0x593907[_0x3c89('0x78')]=_[_0x3c89('0x9d')](_0x593907[_0x3c89('0x78')],{'$or':_['map'](_0x593907[_0x3c89('0x45')],function(_0x38ebd9){var _0x48a483={};_0x48a483[_0x38ebd9]={'$like':'%'+_0x30206e['query']['filter']+'%'};return _0x48a483;})});}if(_0x30206e[_0x3c89('0x41')][_0x3c89('0x7d')]){var _0x442f8f=_0x30206e[_0x3c89('0x41')]['$gte'][_0x3c89('0x67')](',');var _0x4afda1={};_0x4afda1[_0x442f8f[0x0]]={'$gte':moment(_0x442f8f[0x1])[_0x3c89('0xc2')](_0x3c89('0xc3'))};_0x593907[_0x3c89('0x78')]=_[_0x3c89('0x9d')](_0x593907['where'],_0x4afda1);}_0x593907=_[_0x3c89('0x9d')]({},_0x593907,_0x30206e[_0x3c89('0xb6')]);return db[_0x3c89('0xba')][_0x3c89('0x22')]({'where':_0x593907[_0x3c89('0x78')]})[_0x3c89('0x29')](function(_0x830380){_0x1d188f[_0x3c89('0x22')]=_0x830380;if(_0x30206e[_0x3c89('0x41')][_0x3c89('0xb4')]){_0x593907[_0x3c89('0xb5')]=[{'all':!![]}];}return db[_0x3c89('0xba')][_0x3c89('0xc4')](_0x593907);})[_0x3c89('0x29')](function(_0x33c18f){_0x1d188f[_0x3c89('0xb2')]=_0x33c18f;return _0x1d188f;});}})[_0x3c89('0x29')](respondWithFilteredResult(_0x2e3e69,_0x593907))[_0x3c89('0x34')](handleError(_0x2e3e69,null));};exports[_0x3c89('0xc5')]=function(_0x336b5a,_0x44875e,_0x3f2aee){return db[_0x3c89('0x3c')][_0x3c89('0x5f')]({'where':{'id':_0x336b5a[_0x3c89('0xb3')]['id']}})[_0x3c89('0x29')](handleEntityNotFound(_0x44875e,null))[_0x3c89('0x29')](function(_0x33dd80){if(_0x33dd80){return _0x33dd80[_0x3c89('0xc6')](_0x336b5a['body'][_0x3c89('0xbc')],_[_0x3c89('0xbd')](_0x336b5a[_0x3c89('0x75')],[_0x3c89('0xbc'),'id'])||{})[_0x3c89('0xc7')](function(){return db[_0x3c89('0x70')][_0x3c89('0xc4')]({'attributes':['id',_0x3c89('0x2c'),_0x3c89('0xc8')],'where':{'id':_0x336b5a[_0x3c89('0x75')][_0x3c89('0xbc')]}});})[_0x3c89('0x29')](function(_0x4a9fd2){socket[_0x3c89('0xc9')](_0x3c89('0xca'),{'id':Number(_0x336b5a[_0x3c89('0xb3')]['id']),'tags':_0x4a9fd2||[]});return{'id':Number(_0x336b5a[_0x3c89('0xb3')]['id']),'tags':_0x4a9fd2||[]};});}})[_0x3c89('0x29')](respondWithResult(_0x44875e,null))[_0x3c89('0x34')](handleError(_0x44875e,null));};exports[_0x3c89('0xcb')]=function(_0x2bd302,_0x67a1f1,_0x1cf56f){return db[_0x3c89('0x3c')][_0x3c89('0x5f')]({'where':{'id':_0x2bd302[_0x3c89('0xb3')]['id']}})[_0x3c89('0x29')](handleEntityNotFound(_0x67a1f1,null))[_0x3c89('0x29')](function(_0x59c0e3){if(_0x59c0e3){return _0x59c0e3[_0x3c89('0xcb')](_0x2bd302[_0x3c89('0x41')][_0x3c89('0xbc')]);}})[_0x3c89('0x29')](respondWithStatusCode(_0x67a1f1,null))[_0x3c89('0x34')](handleError(_0x67a1f1,null));};exports[_0x3c89('0xcc')]=function(_0x29eb93,_0x5c5d66){var _0x5319ce=moment()[_0x3c89('0xcd')]()[_0x3c89('0x9b')]();var _0x2756b7=path[_0x3c89('0xce')](config[_0x3c89('0xcf')],_0x3c89('0xd0'),_0x3c89('0xd1'),_0x3c89('0xd2'));var _0x4e3e6d=path[_0x3c89('0xce')](config[_0x3c89('0xcf')],_0x3c89('0xd0'),'files','attachments');var _0x5d0465=path['join'](_0x2756b7,_0x5319ce);var _0x566645=util['format'](_0x3c89('0xd3'),_0x29eb93[_0x3c89('0xb3')]['id'],_0x5319ce);var _0x2ab58e=path[_0x3c89('0xce')](_0x2756b7,_0x566645);var _0x46db6e=[];_0x46db6e[_0x3c89('0x33')]({'model':db[_0x3c89('0x73')],'as':'User','attributes':['id',_0x3c89('0x2f')],'raw':!![]});_0x46db6e['push']({'model':db[_0x3c89('0xd4')],'as':'Contact','attributes':['id','firstName',_0x3c89('0xd5')],'raw':!![]});if(_0x29eb93[_0x3c89('0x41')][_0x3c89('0xd6')]){_0x46db6e['push']({'model':db['Attachment'],'as':_0x3c89('0xd7'),'raw':!![]});}var _0x628d21=[{'model':db[_0x3c89('0xba')],'as':'Messages','attributes':['id',_0x3c89('0x75'),_0x3c89('0x7b'),'direction',_0x3c89('0xd8'),_0x3c89('0x82')],'include':_0x46db6e}];_0x628d21[_0x3c89('0x33')]({'model':db[_0x3c89('0xd9')],'as':_0x3c89('0xda'),'attributes':['id','name']});_0x628d21[_0x3c89('0x33')]({'model':db[_0x3c89('0x73')],'as':_0x3c89('0xdb'),'attributes':['id',_0x3c89('0x2f')]});return db['OpenchannelInteraction'][_0x3c89('0x5f')]({'where':{'id':_0x29eb93[_0x3c89('0xb3')]['id']},'include':_0x628d21})['then'](handleEntityNotFound(_0x5c5d66,null))[_0x3c89('0x29')](function(_0x1820f1){if(_0x1820f1){var _0x55f140=_0x1820f1[_0x3c89('0xdc')]({'plain':!![]});fs[_0x3c89('0xdd')](_0x5d0465);var _0x497678={'channel':'Openchannel','account':_0x55f140[_0x3c89('0xda')]['name'],'agent':_0x55f140[_0x3c89('0xdb')]?_0x55f140['Owner'][_0x3c89('0x2f')]:'N.A.','createdAt':moment(_0x55f140[_0x3c89('0x7b')])[_0x3c89('0xc2')](_0x3c89('0xc3'))[_0x3c89('0x9b')](),'closedAt':_0x55f140[_0x3c89('0x39')]?moment(_0x55f140['closedAt'])['format'](_0x3c89('0xc3'))[_0x3c89('0x9b')]():'','disposition':_0x55f140[_0x3c89('0xde')],'visibility':_0x55f140['threadId']?_0x3c89('0xdf'):_0x3c89('0xe0'),'messages':_(_0x55f140[_0x3c89('0xe1')])[_0x3c89('0x86')]({'secret':![]})[_0x3c89('0x2e')](function(_0x25c27d){if(_0x25c27d['Attachment']){var _0x823c5a=path['join'](_0x4e3e6d,_0x25c27d[_0x3c89('0xd7')][_0x3c89('0xe2')]);if(fs[_0x3c89('0xe3')](_0x823c5a)){fs[_0x3c89('0xe4')](_0x823c5a)[_0x3c89('0xe5')](fs[_0x3c89('0xe6')](path[_0x3c89('0xce')](_0x5d0465,_0x25c27d[_0x3c89('0xd7')][_0x3c89('0xe2')])));}}return{'date':moment(_0x25c27d[_0x3c89('0x7b')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x3c89('0x9b')](),'sender':_0x25c27d[_0x3c89('0xe7')]===_0x3c89('0xe8')?_0x25c27d[_0x3c89('0x73')]?_0x25c27d[_0x3c89('0x73')]['fullname']:_0x3c89('0xe9'):_0x25c27d[_0x3c89('0x64')][_0x3c89('0xea')]+(_0x25c27d[_0x3c89('0x64')][_0x3c89('0xd5')]?'\x20'+_0x25c27d[_0x3c89('0x64')][_0x3c89('0xd5')]:''),'body':_0x25c27d[_0x3c89('0xd7')]?_0x25c27d[_0x3c89('0xd7')][_0x3c89('0xe2')]:_0x25c27d['body'],'direction':_0x25c27d[_0x3c89('0xe7')]==='out'?'A':'C','secret':_0x25c27d[_0x3c89('0xd8')],'read':_0x25c27d[_0x3c89('0x82')],'attachment':_0x25c27d[_0x3c89('0xd7')]};})[_0x3c89('0x61')]()};return ejs[_0x3c89('0xeb')](path[_0x3c89('0xce')](config[_0x3c89('0xcf')],_0x3c89('0xd0'),'views','downloadInteraction.ejs'),{'interaction':_0x497678})[_0x3c89('0x29')](function(_0x5825ba){var _0x83499=path[_0x3c89('0xce')](_0x5d0465,_0x3c89('0xec')+_0x55f140['id']+'-'+_0x5319ce+_0x3c89('0xed'));var _0x25230c={'path':_0x83499,'channel':_0x3c89('0xee'),'interactionId':_0x55f140['id']};return pdf[_0x3c89('0xef')](_0x5825ba,_0x25230c);})[_0x3c89('0x29')](function(){return new BPromise(function(_0x5d4e17,_0x6cf5e8){zipdir(_0x5d0465,{'saveTo':_0x2ab58e},function(_0x36ad46,_0x9bfdbb){if(_0x36ad46)return _0x6cf5e8(_0x36ad46);return _0x5d4e17(_0x9bfdbb);});})[_0x3c89('0x29')](function(){return new BPromise(function(_0x575490,_0x51a4fd){rimraf(_0x5d0465,function(_0x385c74){if(_0x385c74)_0x51a4fd(_0x385c74);return _0x575490();});});})[_0x3c89('0x29')](function(){return _0x5c5d66[_0x3c89('0xcc')](_0x2ab58e,_0x566645,function(_0xf7eb95){if(_0xf7eb95){console[_0x3c89('0xf0')](_0x3c89('0xf1'),_0xf7eb95);}else{fs[_0x3c89('0xf2')](_0x2ab58e);}});});});}else{return _0x5c5d66[_0x3c89('0x1c')](0xc8);}})[_0x3c89('0x34')](handleError(_0x5c5d66,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 5a4d21c..ecd5cdf 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 _0xf5ef=['setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','emit','catch','hasOwnProperty','hook','exports','events','OpenchannelInteraction','../../mysqldb'];(function(_0x17ab90,_0x5b71a9){var _0x2ab4c3=function(_0x6eda61){while(--_0x6eda61){_0x17ab90['push'](_0x17ab90['shift']());}};_0x2ab4c3(++_0x5b71a9);}(_0xf5ef,0x12d));var _0xff5e=function(_0x28c5ed,_0x1d47d3){_0x28c5ed=_0x28c5ed-0x0;var _0x412eea=_0xf5ef[_0x28c5ed];return _0x412eea;};'use strict';var EventEmitter=require(_0xff5e('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db'][_0xff5e('0x1')];var OpenchannelMessage=require(_0xff5e('0x2'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xff5e('0x3')](0x0);var events={'afterCreate':_0xff5e('0x4'),'afterUpdate':_0xff5e('0x5'),'afterDestroy':_0xff5e('0x6')};function emitEvent(_0x326b6b){return function(_0x967483,_0x1e46e4,_0x1d03df){_0x967483[_0xff5e('0x7')]({'attributes':['id'],'raw':!![]})[_0xff5e('0x8')](function(_0x1328cb){_0x967483[_0xff5e('0x9')](_0xff5e('0xa'),_0x1328cb[_0xff5e('0xb')](function(_0xa1bba8){return{'id':_0xa1bba8['id']};}));return OpenchannelMessage[_0xff5e('0xc')]({'where':{'OpenchannelInteractionId':_0x967483['id'],'direction':'in','read':![]},'raw':!![]});})[_0xff5e('0x8')](function(_0x5ba7b5){_0x967483['setDataValue'](_0xff5e('0xd'),_0x5ba7b5['length']);OpenchannelInteractionEvents[_0xff5e('0xe')](_0x326b6b+':'+_0x967483['id'],_0x967483);OpenchannelInteractionEvents['emit'](_0x326b6b,_0x967483);_0x1d03df(null);})[_0xff5e('0xf')](_0x1d03df(null));};}for(var e in events){if(events[_0xff5e('0x10')](e)){var event=events[e];OpenchannelInteraction[_0xff5e('0x11')](e,emitEvent(event));}}module[_0xff5e('0x12')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x9f22=['catch','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','remove','getUsers','then','setDataValue','map','findAll','unreadMessages','length','emit'];(function(_0x50a19b,_0x80c4d0){var _0x19b42d=function(_0x15a23f){while(--_0x15a23f){_0x50a19b['push'](_0x50a19b['shift']());}};_0x19b42d(++_0x80c4d0);}(_0x9f22,0x1f1));var _0x29f2=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x9f22[_0x167cc1];return _0x10bc4b;};'use strict';var EventEmitter=require(_0x29f2('0x0'));var OpenchannelInteraction=require(_0x29f2('0x1'))['db'][_0x29f2('0x2')];var OpenchannelMessage=require('../../mysqldb')['db'][_0x29f2('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x29f2('0x4')};function emitEvent(_0xdde5ea){return function(_0x4614db,_0x5e8b0d,_0x5c5dba){_0x4614db[_0x29f2('0x5')]({'attributes':['id'],'raw':!![]})[_0x29f2('0x6')](function(_0x1ca178){_0x4614db[_0x29f2('0x7')]('Users',_0x1ca178[_0x29f2('0x8')](function(_0x1d228e){return{'id':_0x1d228e['id']};}));return OpenchannelMessage[_0x29f2('0x9')]({'where':{'OpenchannelInteractionId':_0x4614db['id'],'direction':'in','read':![]},'raw':!![]});})[_0x29f2('0x6')](function(_0x26b08e){_0x4614db[_0x29f2('0x7')](_0x29f2('0xa'),_0x26b08e[_0x29f2('0xb')]);OpenchannelInteractionEvents[_0x29f2('0xc')](_0xdde5ea+':'+_0x4614db['id'],_0x4614db);OpenchannelInteractionEvents['emit'](_0xdde5ea,_0x4614db);_0x5c5dba(null);})[_0x29f2('0xd')](_0x5c5dba(null));};}for(var e in events){if(events[_0x29f2('0xe')](e)){var event=events[e];OpenchannelInteraction[_0x29f2('0xf')](e,emitEvent(event));}}module[_0x29f2('0x10')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index f48ec6e..1629746 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 _0x8ec6=['YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./openchannelInteraction.attributes','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','closed','closedAt','format'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0x8ec6,0x157));var _0x68ec=function(_0x4f1dfd,_0x1b44aa){_0x4f1dfd=_0x4f1dfd-0x0;var _0x3edc55=_0x8ec6[_0x4f1dfd];return _0x3edc55;};'use strict';var _=require(_0x68ec('0x0'));var util=require(_0x68ec('0x1'));var logger=require(_0x68ec('0x2'))(_0x68ec('0x3'));var moment=require(_0x68ec('0x4'));var BPromise=require(_0x68ec('0x5'));var rp=require(_0x68ec('0x6'));var fs=require('fs');var path=require(_0x68ec('0x7'));var rimraf=require(_0x68ec('0x8'));var config=require('../../config/environment');var attributes=require(_0x68ec('0x9'));module['exports']=function(_0x40371c,_0x59cad2){return _0x40371c['define'](_0x68ec('0xa'),attributes,{'tableName':_0x68ec('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x68ec('0xc'),'collate':_0x68ec('0xd'),'hooks':{'beforeUpdate':function(_0x2a987c,_0xbcf645,_0x5c6963){if(_0x2a987c['changed'](_0x68ec('0xe'))){_0x2a987c[_0x68ec('0xf')]=moment()[_0x68ec('0x10')](_0x68ec('0x11'));}_0x5c6963(null,_0x2a987c);}}});}; \ No newline at end of file +var _0xa24f=['define','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports'];(function(_0x4bc60f,_0x4e1759){var _0x6f4c4d=function(_0x164773){while(--_0x164773){_0x4bc60f['push'](_0x4bc60f['shift']());}};_0x6f4c4d(++_0x4e1759);}(_0xa24f,0x118));var _0xfa24=function(_0x12b683,_0x124186){_0x12b683=_0x12b683-0x0;var _0xfb150b=_0xa24f[_0x12b683];return _0xfb150b;};'use strict';var _=require('lodash');var util=require(_0xfa24('0x0'));var logger=require(_0xfa24('0x1'))('api');var moment=require('moment');var BPromise=require(_0xfa24('0x2'));var rp=require(_0xfa24('0x3'));var fs=require('fs');var path=require(_0xfa24('0x4'));var rimraf=require(_0xfa24('0x5'));var config=require(_0xfa24('0x6'));var attributes=require(_0xfa24('0x7'));module[_0xfa24('0x8')]=function(_0x5492e5,_0x487697){return _0x5492e5[_0xfa24('0x9')]('OpenchannelInteraction',attributes,{'tableName':_0xfa24('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfa24('0xb'),'collate':_0xfa24('0xc'),'hooks':{'beforeUpdate':function(_0x3ba1a9,_0x8d28f8,_0x2b00c7){if(_0x3ba1a9[_0xfa24('0xd')]('closed')){_0x3ba1a9[_0xfa24('0xe')]=moment()[_0xfa24('0xf')](_0xfa24('0x10'));}_0x2b00c7(null,_0x3ba1a9);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index d8d5338..680aaac 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 _0x1429=['stringify','AddTagsToOpenchannelInteraction','find','addTags','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./openchannelInteraction.socket','request','then','info','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','error','code','OpenchannelInteraction,\x20%s,\x20%s','message','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','where','attributes','limit'];(function(_0x510b98,_0x4c4cbb){var _0x45e775=function(_0x29ec11){while(--_0x29ec11){_0x510b98['push'](_0x510b98['shift']());}};_0x45e775(++_0x4c4cbb);}(_0x1429,0x1a2));var _0x9142=function(_0x32bda5,_0x1a809b){_0x32bda5=_0x32bda5-0x0;var _0x383d68=_0x1429[_0x32bda5];return _0x383d68;};'use strict';var _=require('lodash');var util=require(_0x9142('0x0'));var moment=require(_0x9142('0x1'));var BPromise=require(_0x9142('0x2'));var rs=require(_0x9142('0x3'));var fs=require('fs');var Redis=require(_0x9142('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x9142('0x5'));var jayson=require(_0x9142('0x6'));var client=jayson[_0x9142('0x7')][_0x9142('0x8')]({'port':0x232a});config[_0x9142('0x9')]=_[_0x9142('0xa')](config[_0x9142('0x9')],{'host':_0x9142('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9142('0x9')]));require(_0x9142('0xc'))['register'](socket);function respondWithRpcPromise(_0x2a401f,_0x48f3f9,_0x3a1338){return new BPromise(function(_0x21ca1a,_0x2dd69a){return client[_0x9142('0xd')](_0x2a401f,_0x3a1338)[_0x9142('0xe')](function(_0x312b19){logger[_0x9142('0xf')]('OpenchannelInteraction,\x20%s,\x20%s',_0x48f3f9,_0x9142('0x10'));logger[_0x9142('0x11')](_0x9142('0x12'),_0x48f3f9,_0x9142('0x10'),JSON['stringify'](_0x312b19));if(_0x312b19[_0x9142('0x13')]){if(_0x312b19[_0x9142('0x13')][_0x9142('0x14')]===0x1f4){logger[_0x9142('0x13')](_0x9142('0x15'),_0x48f3f9,_0x312b19[_0x9142('0x13')][_0x9142('0x16')]);return _0x2dd69a(_0x312b19[_0x9142('0x13')][_0x9142('0x16')]);}logger['error'](_0x9142('0x15'),_0x48f3f9,_0x312b19[_0x9142('0x13')][_0x9142('0x16')]);return _0x21ca1a(_0x312b19[_0x9142('0x13')]['message']);}else{logger[_0x9142('0xf')]('OpenchannelInteraction,\x20%s,\x20%s',_0x48f3f9,_0x9142('0x10'));_0x21ca1a(_0x312b19['result']['message']);}})[_0x9142('0x17')](function(_0x554969){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x48f3f9,_0x554969);_0x2dd69a(_0x554969);});});}exports[_0x9142('0x18')]=function(_0x596473){var _0x509e24=this;return new Promise(function(_0x39d364,_0x200d62){return db[_0x9142('0x19')][_0x9142('0x1a')](_0x596473[_0x9142('0x1b')],{'raw':_0x596473[_0x9142('0x1c')]?_0x596473['options'][_0x9142('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x596473[_0x9142('0x1c')]?_0x596473['options'][_0x9142('0x1e')]||null:null,'attributes':_0x596473['options']?_0x596473['options'][_0x9142('0x1f')]||null:null,'limit':_0x596473[_0x9142('0x1c')]?_0x596473[_0x9142('0x1c')][_0x9142('0x20')]||null:null})[_0x9142('0xe')](function(_0x1321fa){logger[_0x9142('0xf')]('UpdateOpenchannelInteraction',_0x596473);logger[_0x9142('0x11')]('UpdateOpenchannelInteraction',_0x596473,JSON[_0x9142('0x21')](_0x1321fa));_0x39d364(_0x1321fa);})[_0x9142('0x17')](function(_0x437691){logger[_0x9142('0x13')](_0x9142('0x18'),_0x437691[_0x9142('0x16')],_0x596473);_0x200d62(_0x509e24[_0x9142('0x13')](0x1f4,_0x437691[_0x9142('0x16')]));});});};exports[_0x9142('0x22')]=function(_0x3a1dba){return new Promise(function(_0x462f2d,_0x3343e2){return db[_0x9142('0x19')][_0x9142('0x23')]({'where':_0x3a1dba[_0x9142('0x1c')]?_0x3a1dba['options']['where']||null:null})[_0x9142('0xe')](function(_0x4fbc77){if(_0x4fbc77){return _0x4fbc77[_0x9142('0x24')](_0x3a1dba[_0x9142('0x1b')][_0x9142('0x25')],_[_0x9142('0x26')](_0x3a1dba['body'],[_0x9142('0x25'),'id'])||{});}})[_0x9142('0x27')](function(_0x474821){logger[_0x9142('0xf')](_0x9142('0x28'),_0x3a1dba);logger[_0x9142('0x11')](_0x9142('0x28'),_0x3a1dba,JSON[_0x9142('0x21')](_0x474821));_0x462f2d(_0x474821);})[_0x9142('0x17')](function(_0x3cb7c6){logger[_0x9142('0x13')](_0x9142('0x28'),_0x3cb7c6[_0x9142('0x16')],_0x3a1dba);_0x3343e2(_this[_0x9142('0x13')](0x1f4,_0x3cb7c6['message']));});});}; \ No newline at end of file +var _0x5ab6=['rpc','../../config/environment','client','defaults','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateOpenchannelInteraction','update','body','options','raw','where','attributes','debug','AddTagsToOpenchannelInteraction','addTags','omit','ids','spread','AddTags','moment','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5ab6,0x10c));var _0x65ab=function(_0x58990a,_0x220295){_0x58990a=_0x58990a-0x0;var _0x96e41d=_0x5ab6[_0x58990a];return _0x96e41d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x65ab('0x0'));var BPromise=require(_0x65ab('0x1'));var rs=require(_0x65ab('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x65ab('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x65ab('0x4'))(_0x65ab('0x5'));var config=require(_0x65ab('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x65ab('0x7')]['http']({'port':0x232a});config['redis']=_[_0x65ab('0x8')](config[_0x65ab('0x9')],{'host':_0x65ab('0xa'),'port':0x18eb});var socket=require(_0x65ab('0xb'))(new Redis(config[_0x65ab('0x9')]));require(_0x65ab('0xc'))[_0x65ab('0xd')](socket);function respondWithRpcPromise(_0x3eb224,_0x24a585,_0x6de649){return new BPromise(function(_0x117eca,_0x360b14){return client[_0x65ab('0xe')](_0x3eb224,_0x6de649)[_0x65ab('0xf')](function(_0x493b9a){logger[_0x65ab('0x10')](_0x65ab('0x11'),_0x24a585,_0x65ab('0x12'));logger['debug']('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x24a585,_0x65ab('0x12'),JSON[_0x65ab('0x13')](_0x493b9a));if(_0x493b9a[_0x65ab('0x14')]){if(_0x493b9a[_0x65ab('0x14')][_0x65ab('0x15')]===0x1f4){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x24a585,_0x493b9a['error'][_0x65ab('0x16')]);return _0x360b14(_0x493b9a[_0x65ab('0x14')][_0x65ab('0x16')]);}logger[_0x65ab('0x14')](_0x65ab('0x11'),_0x24a585,_0x493b9a[_0x65ab('0x14')][_0x65ab('0x16')]);return _0x117eca(_0x493b9a[_0x65ab('0x14')]['message']);}else{logger['info'](_0x65ab('0x11'),_0x24a585,_0x65ab('0x12'));_0x117eca(_0x493b9a[_0x65ab('0x17')][_0x65ab('0x16')]);}})[_0x65ab('0x18')](function(_0x3edd9d){logger['error'](_0x65ab('0x11'),_0x24a585,_0x3edd9d);_0x360b14(_0x3edd9d);});});}exports[_0x65ab('0x19')]=function(_0x39bbe0){var _0x31e3e2=this;return new Promise(function(_0x32f275,_0x42c32a){return db['OpenchannelInteraction'][_0x65ab('0x1a')](_0x39bbe0[_0x65ab('0x1b')],{'raw':_0x39bbe0['options']?_0x39bbe0[_0x65ab('0x1c')][_0x65ab('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x39bbe0['options']?_0x39bbe0[_0x65ab('0x1c')][_0x65ab('0x1e')]||null:null,'attributes':_0x39bbe0['options']?_0x39bbe0['options'][_0x65ab('0x1f')]||null:null,'limit':_0x39bbe0[_0x65ab('0x1c')]?_0x39bbe0['options']['limit']||null:null})['then'](function(_0x2bd879){logger[_0x65ab('0x10')](_0x65ab('0x19'),_0x39bbe0);logger[_0x65ab('0x20')](_0x65ab('0x19'),_0x39bbe0,JSON['stringify'](_0x2bd879));_0x32f275(_0x2bd879);})['catch'](function(_0x1a96d9){logger[_0x65ab('0x14')](_0x65ab('0x19'),_0x1a96d9[_0x65ab('0x16')],_0x39bbe0);_0x42c32a(_0x31e3e2[_0x65ab('0x14')](0x1f4,_0x1a96d9[_0x65ab('0x16')]));});});};exports[_0x65ab('0x21')]=function(_0x2ec1ab){return new Promise(function(_0x5d6d17,_0x1a31bc){return db['OpenchannelInteraction']['find']({'where':_0x2ec1ab[_0x65ab('0x1c')]?_0x2ec1ab[_0x65ab('0x1c')][_0x65ab('0x1e')]||null:null})[_0x65ab('0xf')](function(_0x3a6273){if(_0x3a6273){return _0x3a6273[_0x65ab('0x22')](_0x2ec1ab[_0x65ab('0x1b')]['ids'],_[_0x65ab('0x23')](_0x2ec1ab[_0x65ab('0x1b')],[_0x65ab('0x24'),'id'])||{});}})[_0x65ab('0x25')](function(_0x3db4e6){logger[_0x65ab('0x10')](_0x65ab('0x26'),_0x2ec1ab);logger['debug'](_0x65ab('0x26'),_0x2ec1ab,JSON[_0x65ab('0x13')](_0x3db4e6));_0x5d6d17(_0x3db4e6);})[_0x65ab('0x18')](function(_0x286116){logger[_0x65ab('0x14')](_0x65ab('0x26'),_0x286116['message'],_0x2ec1ab);_0x1a31bc(_this[_0x65ab('0x14')](0x1f4,_0x286116['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index fe0b37c..daa3d90 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 _0xf15f=['save','remove','update','emit','removeListener','register','length','openchannelInteraction:','./openchannelInteraction.events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf15f,0x7d));var _0xff15=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xf15f[_0x4c12ec];return _0x3ae42c;};'use strict';var OpenchannelInteractionEvents=require(_0xff15('0x0'));var events=[_0xff15('0x1'),_0xff15('0x2'),_0xff15('0x3')];function createListener(_0x1a4951,_0x37b908){return function(_0x2f689a){_0x37b908[_0xff15('0x4')](_0x1a4951,_0x2f689a);};}function removeListener(_0x1510e2,_0x46dac3){return function(){OpenchannelInteractionEvents[_0xff15('0x5')](_0x1510e2,_0x46dac3);};}exports[_0xff15('0x6')]=function(_0x24672a){for(var _0x2b22c4=0x0,_0x59e887=events[_0xff15('0x7')];_0x2b22c4<_0x59e887;_0x2b22c4++){var _0x3233d9=events[_0x2b22c4];var _0x257c92=createListener(_0xff15('0x8')+_0x3233d9,_0x24672a);OpenchannelInteractionEvents['on'](_0x3233d9,_0x257c92);}}; \ No newline at end of file +var _0xadf0=['emit','removeListener','register','length','openchannelInteraction:','save','remove','update'];(function(_0x2bb814,_0x440edd){var _0x446074=function(_0x56e9cb){while(--_0x56e9cb){_0x2bb814['push'](_0x2bb814['shift']());}};_0x446074(++_0x440edd);}(_0xadf0,0x115));var _0x0adf=function(_0x5c1494,_0x216b96){_0x5c1494=_0x5c1494-0x0;var _0x3d6437=_0xadf0[_0x5c1494];return _0x3d6437;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0x0adf('0x0'),_0x0adf('0x1'),_0x0adf('0x2')];function createListener(_0x2a639c,_0x546a03){return function(_0x19aab4){_0x546a03[_0x0adf('0x3')](_0x2a639c,_0x19aab4);};}function removeListener(_0x1827ea,_0x692df1){return function(){OpenchannelInteractionEvents[_0x0adf('0x4')](_0x1827ea,_0x692df1);};}exports[_0x0adf('0x5')]=function(_0xf9d176){for(var _0x40bbc9=0x0,_0x4b4b1b=events[_0x0adf('0x6')];_0x40bbc9<_0x4b4b1b;_0x40bbc9++){var _0x390abd=events[_0x40bbc9];var _0x278cf9=createListener(_0x0adf('0x7')+_0x390abd,_0xf9d176);OpenchannelInteractionEvents['on'](_0x390abd,_0x278cf9);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index cc9f1ef..9150b1c 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 _0xa9e0=['index','/describe','show','post','isAuthenticated','tracked','openchannel','openchannelmessage:create','update','put','/:id/accept','accept','reject','delete','/:id','destroy','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get'];(function(_0x33f0d0,_0x2da676){var _0xdfb647=function(_0x1a33a0){while(--_0x1a33a0){_0x33f0d0['push'](_0x33f0d0['shift']());}};_0xdfb647(++_0x2da676);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),interaction[_0x0a9e('0xe')](_0x0a9e('0xf'),_0x0a9e('0x10')),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0x11')]);router[_0x0a9e('0x12')](_0x0a9e('0x13'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);router[_0x0a9e('0x12')]('/:id/reject',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x15')]);router[_0x0a9e('0x16')](_0x0a9e('0x17'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x18')]);module['exports']=router; \ No newline at end of file +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(_0x375514,_0x391128){var _0x6929d2=function(_0x45820d){while(--_0x45820d){_0x375514['push'](_0x375514['shift']());}};_0x6929d2(++_0x391128);}(_0xe706,0xa3));var _0x6e70=function(_0x45b625,_0x165113){_0x45b625=_0x45b625-0x0;var _0x2a1e5c=_0xe706[_0x45b625];return _0x2a1e5c;};'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 dea4fff..47a9770 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 _0x69d4=['DATE','STRING','TEXT','sequelize','exports','medium','BOOLEAN','out'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x69d4,0x83));var _0x469d=function(_0x547ff4,_0x416fa1){_0x547ff4=_0x547ff4-0x0;var _0xe41057=_0x69d4[_0x547ff4];return _0xe41057;};'use strict';var Sequelize=require(_0x469d('0x0'));module[_0x469d('0x1')]={'body':{'type':Sequelize['TEXT'](_0x469d('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x469d('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x469d('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x469d('0x4')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x469d('0x5')]},'providerName':{'type':Sequelize[_0x469d('0x6')]},'providerResponse':{'type':Sequelize[_0x469d('0x7')]}}; \ No newline at end of file +var _0xe2ab=['BOOLEAN','out','DATE','STRING','sequelize','exports','TEXT','medium'];(function(_0xe254d7,_0xcd1347){var _0x13b791=function(_0x55798f){while(--_0x55798f){_0xe254d7['push'](_0xe254d7['shift']());}};_0x13b791(++_0xcd1347);}(_0xe2ab,0xc4));var _0xbe2a=function(_0xc1a7d3,_0x6ac180){_0xc1a7d3=_0xc1a7d3-0x0;var _0x576e8d=_0xe2ab[_0xc1a7d3];return _0x576e8d;};'use strict';var Sequelize=require(_0xbe2a('0x0'));module[_0xbe2a('0x1')]={'body':{'type':Sequelize[_0xbe2a('0x2')](_0xbe2a('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xbe2a('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0xbe2a('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xbe2a('0x5')),'defaultValue':_0xbe2a('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xbe2a('0x6')]},'providerName':{'type':Sequelize[_0xbe2a('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 3e1f734..c980ee7 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 _0xbb57=['catch','show','params','find','create','body','describe','openchannel-interactions','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteractionId','update','read1stAt','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','Sequelize','SELECT','User','email','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','OpenchannelInteraction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','RejectMessage','contact','fullname','internal','rejectmessage','eml-format','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','defaults','localhost','redis','./openchannelMessage.socket','register','client','http','then','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','OpenchannelMessage,\x20%s,\x20%s','message','info','result','sendStatus','end','status','json','offset','limit','count','set','Content-Range','apply','reject','save','destroy','stack','name','index','map','OpenchannelMessage','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','merge','VIRTUAL','options','where','includeAll','include','findAll','rows'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xbb57,0x136));var _0x7bb5=function(_0x37d1e8,_0x5b878c){_0x37d1e8=_0x37d1e8-0x0;var _0x1efa61=_0xbb57[_0x37d1e8];return _0x1efa61;};'use strict';var emlformat=require(_0x7bb5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7bb5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7bb5('0x2'));var Mustache=require(_0x7bb5('0x3'));var util=require(_0x7bb5('0x4'));var path=require(_0x7bb5('0x5'));var sox=require(_0x7bb5('0x6'));var csv=require(_0x7bb5('0x7'));var ejs=require(_0x7bb5('0x8'));var fs=require('fs');var fs_extra=require(_0x7bb5('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7bb5('0xa'));var toCsv=require(_0x7bb5('0x7'));var querystring=require(_0x7bb5('0xb'));var Papa=require(_0x7bb5('0xc'));var Redis=require('ioredis');var authService=require(_0x7bb5('0xd'));var qs=require(_0x7bb5('0xe'));var as=require(_0x7bb5('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7bb5('0x10'))(_0x7bb5('0x11'));var utils=require('../../config/utils');var config=require(_0x7bb5('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x7bb5('0x13'))['db'];config['redis']=_[_0x7bb5('0x14')](config['redis'],{'host':_0x7bb5('0x15'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7bb5('0x16')]));require(_0x7bb5('0x17'))[_0x7bb5('0x18')](socket);var jayson=require('jayson/promise');var client=jayson[_0x7bb5('0x19')][_0x7bb5('0x1a')]({'port':0x232c});var client9002=jayson['client'][_0x7bb5('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x38f366,_0x4d4029,_0x267aca,_0x1e2e01){return new BPromise(function(_0x4ece59,_0x2ed7dd){var _0x25f197=_0x1e2e01||client;return _0x25f197['request'](_0x38f366,_0x267aca)[_0x7bb5('0x1b')](function(_0x13cda7){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x4d4029,_0x7bb5('0x1c'));logger[_0x7bb5('0x1d')](_0x7bb5('0x1e'),_0x4d4029,_0x7bb5('0x1c'),JSON['stringify'](_0x13cda7));if(_0x13cda7[_0x7bb5('0x1f')]){if(_0x13cda7[_0x7bb5('0x1f')][_0x7bb5('0x20')]===0x1f4){logger['error'](_0x7bb5('0x21'),_0x4d4029,_0x13cda7[_0x7bb5('0x1f')]['message']);return _0x2ed7dd(_0x13cda7['error'][_0x7bb5('0x22')]);}logger[_0x7bb5('0x1f')](_0x7bb5('0x21'),_0x4d4029,_0x13cda7['error'][_0x7bb5('0x22')]);return _0x4ece59(_0x13cda7[_0x7bb5('0x1f')][_0x7bb5('0x22')]);}else{logger[_0x7bb5('0x23')](_0x7bb5('0x21'),_0x4d4029,_0x7bb5('0x1c'));_0x4ece59(_0x13cda7[_0x7bb5('0x24')][_0x7bb5('0x22')]);}})['catch'](function(_0x51bf3e){logger[_0x7bb5('0x1f')]('OpenchannelMessage,\x20%s,\x20%s',_0x4d4029,_0x51bf3e);_0x2ed7dd(_0x51bf3e);});});}function respondWithStatusCode(_0x2de211,_0x406228){_0x406228=_0x406228||0xcc;return function(_0x16550b){if(_0x16550b){return _0x2de211[_0x7bb5('0x25')](_0x406228);}return _0x2de211['status'](_0x406228)[_0x7bb5('0x26')]();};}function respondWithResult(_0x3fa08a,_0x20f846){_0x20f846=_0x20f846||0xc8;return function(_0x20b975){if(_0x20b975){return _0x3fa08a[_0x7bb5('0x27')](_0x20f846)[_0x7bb5('0x28')](_0x20b975);}};}function respondWithFilteredResult(_0xc363b5,_0x190ec3){return function(_0x214087){if(_0x214087){var _0xef946=typeof _0x190ec3[_0x7bb5('0x29')]==='undefined'&&typeof _0x190ec3[_0x7bb5('0x2a')]==='undefined';var _0x3c93d0=_0x214087[_0x7bb5('0x2b')];var _0x4ed58d=_0xef946?0x0:_0x190ec3[_0x7bb5('0x29')];var _0x5c61bb=_0xef946?_0x214087[_0x7bb5('0x2b')]:_0x190ec3[_0x7bb5('0x29')]+_0x190ec3[_0x7bb5('0x2a')];var _0x29a135;if(_0x5c61bb>=_0x3c93d0){_0x5c61bb=_0x3c93d0;_0x29a135=0xc8;}else{_0x29a135=0xce;}_0xc363b5[_0x7bb5('0x27')](_0x29a135);return _0xc363b5[_0x7bb5('0x2c')](_0x7bb5('0x2d'),_0x4ed58d+'-'+_0x5c61bb+'/'+_0x3c93d0)[_0x7bb5('0x28')](_0x214087);}return null;};}function patchUpdates(_0x4ac1ce){return function(_0x424ac0){try{jsonpatch[_0x7bb5('0x2e')](_0x424ac0,_0x4ac1ce,!![]);}catch(_0x5d1acf){return BPromise[_0x7bb5('0x2f')](_0x5d1acf);}return _0x424ac0[_0x7bb5('0x30')]();};}function saveUpdates(_0x3002e0,_0x58abe8){return function(_0x177c52){if(_0x177c52){return _0x177c52['update'](_0x3002e0)[_0x7bb5('0x1b')](function(_0x629d36){return _0x629d36;});}return null;};}function removeEntity(_0x50e43c,_0x44b607){return function(_0xb5a337){if(_0xb5a337){return _0xb5a337[_0x7bb5('0x31')]()[_0x7bb5('0x1b')](function(){_0x50e43c[_0x7bb5('0x27')](0xcc)[_0x7bb5('0x26')]();});}};}function handleEntityNotFound(_0x59014d,_0x35e8bd){return function(_0x1e986e){if(!_0x1e986e){_0x59014d['sendStatus'](0x194);}return _0x1e986e;};}function handleError(_0x11d9f5,_0x37c620){_0x37c620=_0x37c620||0x1f4;return function(_0x1626c4){logger[_0x7bb5('0x1f')](_0x1626c4[_0x7bb5('0x32')]);if(_0x1626c4[_0x7bb5('0x33')]){delete _0x1626c4['name'];}_0x11d9f5[_0x7bb5('0x27')](_0x37c620)['send'](_0x1626c4);};}exports[_0x7bb5('0x34')]=function(_0xcb6f79,_0xfd2161){var _0x53016b={},_0x24e438={},_0x577303={'count':0x0,'rows':[]};var _0x45cad3=_[_0x7bb5('0x35')](db[_0x7bb5('0x36')][_0x7bb5('0x37')],function(_0x2735ab){return{'name':_0x2735ab[_0x7bb5('0x38')],'type':_0x2735ab[_0x7bb5('0x39')][_0x7bb5('0x3a')]};});_0x24e438[_0x7bb5('0x3b')]=_[_0x7bb5('0x35')](_0x45cad3,_0x7bb5('0x33'));_0x24e438['query']=_[_0x7bb5('0x3c')](_0xcb6f79[_0x7bb5('0x3d')]);_0x24e438[_0x7bb5('0x3e')]=_[_0x7bb5('0x3f')](_0x24e438['model'],_0x24e438[_0x7bb5('0x3d')]);_0x53016b[_0x7bb5('0x40')]=_[_0x7bb5('0x3f')](_0x24e438[_0x7bb5('0x3b')],qs[_0x7bb5('0x41')](_0xcb6f79[_0x7bb5('0x3d')]['fields']));_0x53016b[_0x7bb5('0x40')]=_0x53016b[_0x7bb5('0x40')][_0x7bb5('0x42')]?_0x53016b[_0x7bb5('0x40')]:_0x24e438[_0x7bb5('0x3b')];if(!_0xcb6f79[_0x7bb5('0x3d')]['hasOwnProperty'](_0x7bb5('0x43'))){_0x53016b[_0x7bb5('0x2a')]=qs[_0x7bb5('0x2a')](_0xcb6f79[_0x7bb5('0x3d')][_0x7bb5('0x2a')]);_0x53016b[_0x7bb5('0x29')]=qs[_0x7bb5('0x29')](_0xcb6f79['query'][_0x7bb5('0x29')]);}_0x53016b[_0x7bb5('0x44')]=qs[_0x7bb5('0x45')](_0xcb6f79[_0x7bb5('0x3d')][_0x7bb5('0x45')]);_0x53016b['where']=qs[_0x7bb5('0x3e')](_[_0x7bb5('0x46')](_0xcb6f79[_0x7bb5('0x3d')],_0x24e438[_0x7bb5('0x3e')]),_0x45cad3);if(_0xcb6f79[_0x7bb5('0x3d')][_0x7bb5('0x47')]){_0x53016b['where']=_[_0x7bb5('0x48')](_0x53016b['where'],{'$or':_[_0x7bb5('0x35')](_0x45cad3,function(_0x55d2fe){if(_0x55d2fe[_0x7bb5('0x39')]!==_0x7bb5('0x49')){var _0x346410={};_0x346410[_0x55d2fe[_0x7bb5('0x33')]]={'$like':'%'+_0xcb6f79[_0x7bb5('0x3d')]['filter']+'%'};return _0x346410;}})});}_0x53016b=_['merge']({},_0x53016b,_0xcb6f79[_0x7bb5('0x4a')]);var _0x37d194={'where':_0x53016b[_0x7bb5('0x4b')]};return db[_0x7bb5('0x36')]['count'](_0x37d194)['then'](function(_0x427516){_0x577303[_0x7bb5('0x2b')]=_0x427516;if(_0xcb6f79[_0x7bb5('0x3d')][_0x7bb5('0x4c')]){_0x53016b[_0x7bb5('0x4d')]=[{'all':!![]}];}return db[_0x7bb5('0x36')][_0x7bb5('0x4e')](_0x53016b);})[_0x7bb5('0x1b')](function(_0x49af2c){_0x577303[_0x7bb5('0x4f')]=_0x49af2c;return _0x577303;})[_0x7bb5('0x1b')](respondWithFilteredResult(_0xfd2161,_0x53016b))[_0x7bb5('0x50')](handleError(_0xfd2161,null));};exports[_0x7bb5('0x51')]=function(_0x81e590,_0x3da5ed){var _0x21e026={'raw':!![],'where':{'id':_0x81e590[_0x7bb5('0x52')]['id']}},_0x16f75c={};_0x16f75c[_0x7bb5('0x3b')]=_[_0x7bb5('0x3c')](db[_0x7bb5('0x36')][_0x7bb5('0x37')]);_0x16f75c[_0x7bb5('0x3d')]=_[_0x7bb5('0x3c')](_0x81e590[_0x7bb5('0x3d')]);_0x16f75c['filters']=_[_0x7bb5('0x3f')](_0x16f75c[_0x7bb5('0x3b')],_0x16f75c['query']);_0x21e026['attributes']=_['intersection'](_0x16f75c['model'],qs[_0x7bb5('0x41')](_0x81e590[_0x7bb5('0x3d')]['fields']));_0x21e026[_0x7bb5('0x40')]=_0x21e026['attributes']['length']?_0x21e026[_0x7bb5('0x40')]:_0x16f75c['model'];if(_0x81e590[_0x7bb5('0x3d')][_0x7bb5('0x4c')]){_0x21e026[_0x7bb5('0x4d')]=[{'all':!![]}];}_0x21e026=_['merge']({},_0x21e026,_0x81e590[_0x7bb5('0x4a')]);return db[_0x7bb5('0x36')][_0x7bb5('0x53')](_0x21e026)[_0x7bb5('0x1b')](handleEntityNotFound(_0x3da5ed,null))[_0x7bb5('0x1b')](respondWithResult(_0x3da5ed,null))[_0x7bb5('0x50')](handleError(_0x3da5ed,null));};exports['create']=function(_0x3b2cf5,_0x15dc03){return db[_0x7bb5('0x36')][_0x7bb5('0x54')](_0x3b2cf5[_0x7bb5('0x55')],{})[_0x7bb5('0x1b')](respondWithResult(_0x15dc03,0xc9))[_0x7bb5('0x50')](handleError(_0x15dc03,null));};exports['update']=function(_0x579320,_0x5dd008){if(_0x579320[_0x7bb5('0x55')]['id']){delete _0x579320[_0x7bb5('0x55')]['id'];}return db[_0x7bb5('0x36')][_0x7bb5('0x53')]({'where':{'id':_0x579320[_0x7bb5('0x52')]['id']}})[_0x7bb5('0x1b')](handleEntityNotFound(_0x5dd008,null))['then'](saveUpdates(_0x579320[_0x7bb5('0x55')],null))[_0x7bb5('0x1b')](respondWithResult(_0x5dd008,null))[_0x7bb5('0x50')](handleError(_0x5dd008,null));};exports[_0x7bb5('0x31')]=function(_0x2682a4,_0x4cee92){return db[_0x7bb5('0x36')][_0x7bb5('0x53')]({'where':{'id':_0x2682a4['params']['id']}})[_0x7bb5('0x1b')](handleEntityNotFound(_0x4cee92,null))[_0x7bb5('0x1b')](removeEntity(_0x4cee92,null))[_0x7bb5('0x50')](handleError(_0x4cee92,null));};exports[_0x7bb5('0x56')]=function(_0x197a67,_0x1e98eb){return db[_0x7bb5('0x36')][_0x7bb5('0x56')]()['then'](respondWithResult(_0x1e98eb,null))['catch'](handleError(_0x1e98eb,null));};var interaction_log=require(_0x7bb5('0x10'))(_0x7bb5('0x57'));exports[_0x7bb5('0x58')]=function(_0x173953,_0x93bdf4,_0x2da918){var _0x1f9816={'agent':{},'channel':_0x7bb5('0x59')};if(_0x173953[_0x7bb5('0x55')]['id']){delete _0x173953[_0x7bb5('0x55')]['id'];}_0x173953[_0x7bb5('0x55')][_0x7bb5('0x5a')]=!![];_0x173953[_0x7bb5('0x55')][_0x7bb5('0x5b')]=moment()[_0x7bb5('0x5c')](_0x7bb5('0x5d'));_0x173953['body'][_0x7bb5('0x5e')]=_0x173953['body'][_0x7bb5('0x5e')]||_0x173953[_0x7bb5('0x5f')]['id'];_0x1f9816[_0x7bb5('0x60')]['id']=_0x173953[_0x7bb5('0x55')][_0x7bb5('0x5e')];return db['OpenchannelMessage']['find']({'where':{'id':_0x173953[_0x7bb5('0x52')]['id'],'UserId':null}})[_0x7bb5('0x1b')](handleEntityNotFound(_0x93bdf4,null))[_0x7bb5('0x1b')](saveUpdates(_0x173953[_0x7bb5('0x55')],null))[_0x7bb5('0x1b')](function(_0xe1472d){if(_0xe1472d){_0x1f9816[_0x7bb5('0x22')]=_0xe1472d[_0x7bb5('0x61')]({'plain':!![]});return db['OpenchannelInteraction']['find']({'where':{'id':_0xe1472d[_0x7bb5('0x62')]}});}return null;})[_0x7bb5('0x1b')](handleEntityNotFound(_0x93bdf4,null))[_0x7bb5('0x1b')](function(_0x84d88c){if(_0x84d88c){return _0x84d88c[_0x7bb5('0x63')]({'UserId':_0x173953[_0x7bb5('0x55')][_0x7bb5('0x5e')],'read1stAt':_['isNil'](_0x84d88c[_0x7bb5('0x64')])?moment()[_0x7bb5('0x5c')](_0x7bb5('0x5d')):undefined});}return null;})['then'](function(_0x1fc6b1){if(_0x1fc6b1){_0x1f9816[_0x7bb5('0x65')]=_0x1fc6b1[_0x7bb5('0x61')]({'plain':!![]});interaction_log[_0x7bb5('0x23')](_0x7bb5('0x66'),_0x173953['user']['id'],_0x173953['user'][_0x7bb5('0x33')],_0x173953['user']['role'],_0x1f9816[_0x7bb5('0x65')]['id'],_0x173953[_0x7bb5('0x55')]?JSON['stringify'](_0x173953[_0x7bb5('0x55')]):_0x7bb5('0x67'));return respondWithRpcPromise(_0x7bb5('0x68'),_0x7bb5('0x69'),_0x1f9816);}return null;})['then'](function(_0x1c25ae){var _0x932f80=_0x7bb5('0x6a')+_0x1c25ae[_0x7bb5('0x22')][_0x7bb5('0x6b')];return db[_0x7bb5('0x6c')]['query'](_0x932f80,{'type':db[_0x7bb5('0x6d')]['QueryTypes'][_0x7bb5('0x6e')],'raw':!![]})[_0x7bb5('0x1b')](function(_0x4b1cdc){return _0x4b1cdc;});})[_0x7bb5('0x1b')](function(_0x1e434e){if(_0x1e434e){_0x1f9816[_0x7bb5('0x22')]['contact']=_0x1e434e[0x0];if(!_0x173953[_0x7bb5('0x55')][_0x7bb5('0x5e')])return;return db[_0x7bb5('0x6f')][_0x7bb5('0x53')]({'where':{'id':_0x173953[_0x7bb5('0x55')]['UserId'],'role':'agent'},'attributes':['id',_0x7bb5('0x33'),'fullname',_0x7bb5('0x70'),'internal'],'raw':!![]});}return null;})[_0x7bb5('0x1b')](function(_0x56974b){if(!_0x56974b)return null;_0x1f9816['message']['agent']=_0x56974b;return _0x1f9816;})[_0x7bb5('0x1b')](function(_0x5951eb){if(_0x5951eb){if(_0x173953['body'][_0x7bb5('0x71')]){_0x1f9816[_0x7bb5('0x22')][_0x7bb5('0x72')]=util[_0x7bb5('0x5c')](_0x7bb5('0x73'),_0x173953['user'][_0x7bb5('0x33')]);_0x1f9816['message'][_0x7bb5('0x74')]=_0x1f9816['channel'];_0x1f9816['message'][_0x7bb5('0x75')]=_0x1f9816[_0x7bb5('0x74')];_0x1f9816[_0x7bb5('0x22')][_0x7bb5('0x76')]=_0x7bb5('0x58');return respondWithRpcPromise('EventManager',_0x7bb5('0x77'),{'event':_0x7bb5('0x78'),'message':_0x1f9816[_0x7bb5('0x22')]},client9002)['then'](function(){return _0x1f9816;});}return _0x1f9816;}return null;})['then'](respondWithResult(_0x93bdf4,null))['catch'](handleError(_0x93bdf4,null));};var interaction_log=require(_0x7bb5('0x10'))('openchannel-interactions');exports[_0x7bb5('0x2f')]=function(_0x3b098,_0x318d02,_0xbaa821){var _0x57f7c8={'agent':{},'channel':_0x7bb5('0x59')};if(_0x3b098[_0x7bb5('0x55')]['id']){delete _0x3b098[_0x7bb5('0x55')]['id'];}_0x3b098[_0x7bb5('0x55')][_0x7bb5('0x5e')]=_0x3b098[_0x7bb5('0x55')][_0x7bb5('0x5e')]||_0x3b098[_0x7bb5('0x5f')]['id'];_0x57f7c8['agent']['id']=_0x3b098[_0x7bb5('0x55')][_0x7bb5('0x5e')];return db[_0x7bb5('0x36')]['find']({'where':{'id':_0x3b098[_0x7bb5('0x52')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x318d02,null))[_0x7bb5('0x1b')](function(_0x1260b2){if(_0x1260b2){_0x57f7c8[_0x7bb5('0x22')]=_0x1260b2[_0x7bb5('0x61')]({'plain':!![]});return db[_0x7bb5('0x79')][_0x7bb5('0x53')]({'where':{'id':_0x1260b2['OpenchannelInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x318d02,null))[_0x7bb5('0x1b')](function(_0x204ffa){if(_0x204ffa){_0x57f7c8['interaction']=_0x204ffa['get']({'plain':!![]});interaction_log[_0x7bb5('0x23')](_0x7bb5('0x7a'),_0x3b098[_0x7bb5('0x5f')]['id'],_0x3b098['user'][_0x7bb5('0x33')],_0x3b098[_0x7bb5('0x5f')][_0x7bb5('0x7b')],_0x57f7c8[_0x7bb5('0x65')]['id'],_0x3b098[_0x7bb5('0x55')]?JSON[_0x7bb5('0x7c')](_0x3b098[_0x7bb5('0x55')]):_0x7bb5('0x67'));return respondWithRpcPromise(_0x7bb5('0x7d'),'rejectMessage',_0x57f7c8);}return null;})['then'](function(_0x2ad397){var _0xabc66e=_0x7bb5('0x6a')+_0x2ad397['message'][_0x7bb5('0x6b')];return db[_0x7bb5('0x6c')][_0x7bb5('0x3d')](_0xabc66e,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x7bb5('0x1b')](function(_0x3fd424){return _0x3fd424;});})[_0x7bb5('0x1b')](function(_0x2a9fe3){if(_0x2a9fe3){_0x57f7c8[_0x7bb5('0x22')][_0x7bb5('0x7e')]=_0x2a9fe3[0x0];if(!_0x3b098[_0x7bb5('0x55')][_0x7bb5('0x5e')])return;return db[_0x7bb5('0x6f')]['find']({'where':{'id':_0x3b098[_0x7bb5('0x55')][_0x7bb5('0x5e')],'role':_0x7bb5('0x60')},'attributes':['id',_0x7bb5('0x33'),_0x7bb5('0x7f'),_0x7bb5('0x70'),_0x7bb5('0x80')],'raw':!![]});}return null;})['then'](function(_0x9ed2ab){if(!_0x9ed2ab)return null;_0x57f7c8[_0x7bb5('0x22')][_0x7bb5('0x60')]=_0x9ed2ab;return _0x57f7c8;})[_0x7bb5('0x1b')](function(_0x1576fa){if(_0x1576fa){_0x1576fa[_0x7bb5('0x22')][_0x7bb5('0x72')]=util[_0x7bb5('0x5c')](_0x7bb5('0x73'),_0x3b098[_0x7bb5('0x5f')]['name']);_0x1576fa[_0x7bb5('0x22')][_0x7bb5('0x74')]=_0x57f7c8[_0x7bb5('0x74')];_0x1576fa['message'][_0x7bb5('0x75')]=_0x57f7c8[_0x7bb5('0x74')];_0x1576fa['message']['event']=_0x7bb5('0x2f');respondWithRpcPromise(_0x7bb5('0x77'),'EventManager',{'event':_0x7bb5('0x81'),'message':_0x1576fa[_0x7bb5('0x22')]},client9002);return _0x57f7c8;}return null;})[_0x7bb5('0x1b')](respondWithResult(_0x318d02,null))[_0x7bb5('0x50')](handleError(_0x318d02,null));}; \ No newline at end of file +var _0x5e11=['include','findAll','rows','catch','show','params','find','create','body','describe','openchannel-interactions','accept','openchannel','readAt','format','UserId','user','get','OpenchannelInteraction','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','SELECT','contact','agent','fullname','email','internal','manual','interface','SIP/%s','channel','EventManager','acceptmessage','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize','Sequelize','User','event','reject','rejectmessage','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','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','error','message','result','sendStatus','status','end','offset','limit','set','Content-Range','apply','save','update','destroy','name','OpenchannelMessage','rawAttributes','key','model','map','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','count','includeAll'];(function(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_0x5e11,0x1c3));var _0x15e1=function(_0x8af54b,_0x280be5){_0x8af54b=_0x8af54b-0x0;var _0x27d8f0=_0x5e11[_0x8af54b];return _0x27d8f0;};'use strict';var emlformat=require(_0x15e1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x15e1('0x1'));var jsonpatch=require(_0x15e1('0x2'));var rp=require(_0x15e1('0x3'));var moment=require(_0x15e1('0x4'));var BPromise=require(_0x15e1('0x5'));var Mustache=require(_0x15e1('0x6'));var util=require('util');var path=require(_0x15e1('0x7'));var sox=require('sox');var csv=require(_0x15e1('0x8'));var ejs=require(_0x15e1('0x9'));var fs=require('fs');var fs_extra=require(_0x15e1('0xa'));var _=require(_0x15e1('0xb'));var squel=require(_0x15e1('0xc'));var crypto=require('crypto');var jsforce=require(_0x15e1('0xd'));var deskjs=require(_0x15e1('0xe'));var toCsv=require(_0x15e1('0x8'));var querystring=require(_0x15e1('0xf'));var Papa=require('papaparse');var Redis=require(_0x15e1('0x10'));var authService=require(_0x15e1('0x11'));var qs=require(_0x15e1('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x15e1('0x13'));var logger=require(_0x15e1('0x14'))(_0x15e1('0x15'));var utils=require(_0x15e1('0x16'));var config=require(_0x15e1('0x17'));var licenseUtil=require(_0x15e1('0x18'));var db=require(_0x15e1('0x19'))['db'];config[_0x15e1('0x1a')]=_[_0x15e1('0x1b')](config[_0x15e1('0x1a')],{'host':_0x15e1('0x1c'),'port':0x18eb});var socket=require(_0x15e1('0x1d'))(new Redis(config['redis']));require(_0x15e1('0x1e'))[_0x15e1('0x1f')](socket);var jayson=require(_0x15e1('0x20'));var client=jayson['client'][_0x15e1('0x21')]({'port':0x232c});var client9002=jayson[_0x15e1('0x22')]['http']({'port':0x232a});function respondWithRpcPromise(_0x381bb4,_0xa1ba90,_0x36f758,_0x448d59){return new BPromise(function(_0x36d214,_0x14cd54){var _0x376500=_0x448d59||client;return _0x376500[_0x15e1('0x23')](_0x381bb4,_0x36f758)[_0x15e1('0x24')](function(_0x252f3a){logger[_0x15e1('0x25')](_0x15e1('0x26'),_0xa1ba90,_0x15e1('0x27'));logger[_0x15e1('0x28')](_0x15e1('0x29'),_0xa1ba90,_0x15e1('0x27'),JSON['stringify'](_0x252f3a));if(_0x252f3a[_0x15e1('0x2a')]){if(_0x252f3a[_0x15e1('0x2a')]['code']===0x1f4){logger[_0x15e1('0x2a')](_0x15e1('0x26'),_0xa1ba90,_0x252f3a[_0x15e1('0x2a')][_0x15e1('0x2b')]);return _0x14cd54(_0x252f3a['error']['message']);}logger[_0x15e1('0x2a')](_0x15e1('0x26'),_0xa1ba90,_0x252f3a[_0x15e1('0x2a')][_0x15e1('0x2b')]);return _0x36d214(_0x252f3a[_0x15e1('0x2a')][_0x15e1('0x2b')]);}else{logger[_0x15e1('0x25')]('OpenchannelMessage,\x20%s,\x20%s',_0xa1ba90,'request\x20sent');_0x36d214(_0x252f3a[_0x15e1('0x2c')][_0x15e1('0x2b')]);}})['catch'](function(_0x4b89a3){logger[_0x15e1('0x2a')](_0x15e1('0x26'),_0xa1ba90,_0x4b89a3);_0x14cd54(_0x4b89a3);});});}function respondWithStatusCode(_0x4c3cdb,_0x477ff1){_0x477ff1=_0x477ff1||0xcc;return function(_0x1c8538){if(_0x1c8538){return _0x4c3cdb[_0x15e1('0x2d')](_0x477ff1);}return _0x4c3cdb[_0x15e1('0x2e')](_0x477ff1)[_0x15e1('0x2f')]();};}function respondWithResult(_0x5619fc,_0x506af2){_0x506af2=_0x506af2||0xc8;return function(_0x4c14c3){if(_0x4c14c3){return _0x5619fc[_0x15e1('0x2e')](_0x506af2)['json'](_0x4c14c3);}};}function respondWithFilteredResult(_0x2dd839,_0x23664b){return function(_0x201b53){if(_0x201b53){var _0x16c14e=typeof _0x23664b[_0x15e1('0x30')]==='undefined'&&typeof _0x23664b[_0x15e1('0x31')]==='undefined';var _0x231cd9=_0x201b53['count'];var _0x58b19b=_0x16c14e?0x0:_0x23664b[_0x15e1('0x30')];var _0x5e8eb7=_0x16c14e?_0x201b53['count']:_0x23664b['offset']+_0x23664b[_0x15e1('0x31')];var _0x31aa27;if(_0x5e8eb7>=_0x231cd9){_0x5e8eb7=_0x231cd9;_0x31aa27=0xc8;}else{_0x31aa27=0xce;}_0x2dd839['status'](_0x31aa27);return _0x2dd839[_0x15e1('0x32')](_0x15e1('0x33'),_0x58b19b+'-'+_0x5e8eb7+'/'+_0x231cd9)['json'](_0x201b53);}return null;};}function patchUpdates(_0x2bc455){return function(_0x159299){try{jsonpatch[_0x15e1('0x34')](_0x159299,_0x2bc455,!![]);}catch(_0xcfdd11){return BPromise['reject'](_0xcfdd11);}return _0x159299[_0x15e1('0x35')]();};}function saveUpdates(_0x40a779,_0x53499b){return function(_0x51a55d){if(_0x51a55d){return _0x51a55d[_0x15e1('0x36')](_0x40a779)['then'](function(_0x59ffd1){return _0x59ffd1;});}return null;};}function removeEntity(_0x573b12,_0x1e9056){return function(_0x13cb61){if(_0x13cb61){return _0x13cb61[_0x15e1('0x37')]()[_0x15e1('0x24')](function(){_0x573b12[_0x15e1('0x2e')](0xcc)[_0x15e1('0x2f')]();});}};}function handleEntityNotFound(_0x3829c9,_0x4fc7f5){return function(_0x103ad0){if(!_0x103ad0){_0x3829c9[_0x15e1('0x2d')](0x194);}return _0x103ad0;};}function handleError(_0x1f19be,_0x141306){_0x141306=_0x141306||0x1f4;return function(_0x49866d){logger['error'](_0x49866d['stack']);if(_0x49866d[_0x15e1('0x38')]){delete _0x49866d['name'];}_0x1f19be[_0x15e1('0x2e')](_0x141306)['send'](_0x49866d);};}exports['index']=function(_0x3a163e,_0x3d8d9b){var _0x3865bd={},_0x2b0147={},_0x358bd9={'count':0x0,'rows':[]};var _0x2cf4f6=_['map'](db[_0x15e1('0x39')][_0x15e1('0x3a')],function(_0x5f2704){return{'name':_0x5f2704['fieldName'],'type':_0x5f2704['type'][_0x15e1('0x3b')]};});_0x2b0147[_0x15e1('0x3c')]=_[_0x15e1('0x3d')](_0x2cf4f6,_0x15e1('0x38'));_0x2b0147[_0x15e1('0x3e')]=_[_0x15e1('0x3f')](_0x3a163e[_0x15e1('0x3e')]);_0x2b0147['filters']=_[_0x15e1('0x40')](_0x2b0147[_0x15e1('0x3c')],_0x2b0147[_0x15e1('0x3e')]);_0x3865bd['attributes']=_[_0x15e1('0x40')](_0x2b0147[_0x15e1('0x3c')],qs[_0x15e1('0x41')](_0x3a163e[_0x15e1('0x3e')][_0x15e1('0x41')]));_0x3865bd[_0x15e1('0x42')]=_0x3865bd['attributes'][_0x15e1('0x43')]?_0x3865bd['attributes']:_0x2b0147['model'];if(!_0x3a163e[_0x15e1('0x3e')]['hasOwnProperty'](_0x15e1('0x44'))){_0x3865bd[_0x15e1('0x31')]=qs[_0x15e1('0x31')](_0x3a163e['query'][_0x15e1('0x31')]);_0x3865bd[_0x15e1('0x30')]=qs[_0x15e1('0x30')](_0x3a163e[_0x15e1('0x3e')][_0x15e1('0x30')]);}_0x3865bd[_0x15e1('0x45')]=qs[_0x15e1('0x46')](_0x3a163e['query'][_0x15e1('0x46')]);_0x3865bd[_0x15e1('0x47')]=qs['filters'](_[_0x15e1('0x48')](_0x3a163e['query'],_0x2b0147[_0x15e1('0x49')]),_0x2cf4f6);if(_0x3a163e[_0x15e1('0x3e')][_0x15e1('0x4a')]){_0x3865bd['where']=_[_0x15e1('0x4b')](_0x3865bd['where'],{'$or':_[_0x15e1('0x3d')](_0x2cf4f6,function(_0xa75222){if(_0xa75222[_0x15e1('0x4c')]!==_0x15e1('0x4d')){var _0x5bdd31={};_0x5bdd31[_0xa75222[_0x15e1('0x38')]]={'$like':'%'+_0x3a163e[_0x15e1('0x3e')][_0x15e1('0x4a')]+'%'};return _0x5bdd31;}})});}_0x3865bd=_[_0x15e1('0x4b')]({},_0x3865bd,_0x3a163e[_0x15e1('0x4e')]);var _0x2bcd04={'where':_0x3865bd[_0x15e1('0x47')]};return db[_0x15e1('0x39')]['count'](_0x2bcd04)['then'](function(_0x1abac3){_0x358bd9[_0x15e1('0x4f')]=_0x1abac3;if(_0x3a163e[_0x15e1('0x3e')][_0x15e1('0x50')]){_0x3865bd[_0x15e1('0x51')]=[{'all':!![]}];}return db[_0x15e1('0x39')][_0x15e1('0x52')](_0x3865bd);})[_0x15e1('0x24')](function(_0x429a23){_0x358bd9[_0x15e1('0x53')]=_0x429a23;return _0x358bd9;})[_0x15e1('0x24')](respondWithFilteredResult(_0x3d8d9b,_0x3865bd))[_0x15e1('0x54')](handleError(_0x3d8d9b,null));};exports[_0x15e1('0x55')]=function(_0x4c21d1,_0x42e3b2){var _0x47651e={'raw':!![],'where':{'id':_0x4c21d1[_0x15e1('0x56')]['id']}},_0x5a2adb={};_0x5a2adb[_0x15e1('0x3c')]=_[_0x15e1('0x3f')](db[_0x15e1('0x39')]['rawAttributes']);_0x5a2adb[_0x15e1('0x3e')]=_[_0x15e1('0x3f')](_0x4c21d1[_0x15e1('0x3e')]);_0x5a2adb[_0x15e1('0x49')]=_[_0x15e1('0x40')](_0x5a2adb['model'],_0x5a2adb[_0x15e1('0x3e')]);_0x47651e['attributes']=_[_0x15e1('0x40')](_0x5a2adb[_0x15e1('0x3c')],qs[_0x15e1('0x41')](_0x4c21d1[_0x15e1('0x3e')]['fields']));_0x47651e[_0x15e1('0x42')]=_0x47651e['attributes']['length']?_0x47651e[_0x15e1('0x42')]:_0x5a2adb[_0x15e1('0x3c')];if(_0x4c21d1[_0x15e1('0x3e')][_0x15e1('0x50')]){_0x47651e[_0x15e1('0x51')]=[{'all':!![]}];}_0x47651e=_[_0x15e1('0x4b')]({},_0x47651e,_0x4c21d1['options']);return db[_0x15e1('0x39')][_0x15e1('0x57')](_0x47651e)['then'](handleEntityNotFound(_0x42e3b2,null))[_0x15e1('0x24')](respondWithResult(_0x42e3b2,null))[_0x15e1('0x54')](handleError(_0x42e3b2,null));};exports[_0x15e1('0x58')]=function(_0x12874f,_0x23e718){return db['OpenchannelMessage']['create'](_0x12874f[_0x15e1('0x59')],{})[_0x15e1('0x24')](respondWithResult(_0x23e718,0xc9))[_0x15e1('0x54')](handleError(_0x23e718,null));};exports[_0x15e1('0x36')]=function(_0x12762a,_0x448003){if(_0x12762a[_0x15e1('0x59')]['id']){delete _0x12762a['body']['id'];}return db[_0x15e1('0x39')][_0x15e1('0x57')]({'where':{'id':_0x12762a['params']['id']}})[_0x15e1('0x24')](handleEntityNotFound(_0x448003,null))[_0x15e1('0x24')](saveUpdates(_0x12762a['body'],null))[_0x15e1('0x24')](respondWithResult(_0x448003,null))[_0x15e1('0x54')](handleError(_0x448003,null));};exports[_0x15e1('0x37')]=function(_0x3b7bb9,_0x5fb6c4){return db['OpenchannelMessage'][_0x15e1('0x57')]({'where':{'id':_0x3b7bb9['params']['id']}})[_0x15e1('0x24')](handleEntityNotFound(_0x5fb6c4,null))[_0x15e1('0x24')](removeEntity(_0x5fb6c4,null))[_0x15e1('0x54')](handleError(_0x5fb6c4,null));};exports['describe']=function(_0x31aff6,_0x35e1f2){return db[_0x15e1('0x39')][_0x15e1('0x5a')]()[_0x15e1('0x24')](respondWithResult(_0x35e1f2,null))[_0x15e1('0x54')](handleError(_0x35e1f2,null));};var interaction_log=require(_0x15e1('0x14'))(_0x15e1('0x5b'));exports[_0x15e1('0x5c')]=function(_0x5615d8,_0x2b9396,_0x733125){var _0x3fd418={'agent':{},'channel':_0x15e1('0x5d')};if(_0x5615d8[_0x15e1('0x59')]['id']){delete _0x5615d8['body']['id'];}_0x5615d8[_0x15e1('0x59')]['read']=!![];_0x5615d8[_0x15e1('0x59')][_0x15e1('0x5e')]=moment()[_0x15e1('0x5f')]('YYYY-MM-DD\x20HH:mm:ss');_0x5615d8[_0x15e1('0x59')][_0x15e1('0x60')]=_0x5615d8['body']['UserId']||_0x5615d8[_0x15e1('0x61')]['id'];_0x3fd418['agent']['id']=_0x5615d8[_0x15e1('0x59')][_0x15e1('0x60')];return db[_0x15e1('0x39')]['find']({'where':{'id':_0x5615d8['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2b9396,null))['then'](saveUpdates(_0x5615d8['body'],null))['then'](function(_0x5f5410){if(_0x5f5410){_0x3fd418[_0x15e1('0x2b')]=_0x5f5410[_0x15e1('0x62')]({'plain':!![]});return db[_0x15e1('0x63')][_0x15e1('0x57')]({'where':{'id':_0x5f5410['OpenchannelInteractionId']}});}return null;})[_0x15e1('0x24')](handleEntityNotFound(_0x2b9396,null))[_0x15e1('0x24')](function(_0xba31bf){if(_0xba31bf){return _0xba31bf[_0x15e1('0x36')]({'UserId':_0x5615d8[_0x15e1('0x59')]['UserId'],'read1stAt':_['isNil'](_0xba31bf[_0x15e1('0x64')])?moment()[_0x15e1('0x5f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x15e1('0x24')](function(_0x2bc8b){if(_0x2bc8b){_0x3fd418[_0x15e1('0x65')]=_0x2bc8b[_0x15e1('0x62')]({'plain':!![]});interaction_log[_0x15e1('0x25')](_0x15e1('0x66'),_0x5615d8['user']['id'],_0x5615d8['user'][_0x15e1('0x38')],_0x5615d8[_0x15e1('0x61')][_0x15e1('0x67')],_0x3fd418[_0x15e1('0x65')]['id'],_0x5615d8[_0x15e1('0x59')]?JSON[_0x15e1('0x68')](_0x5615d8[_0x15e1('0x59')]):_0x15e1('0x69'));return respondWithRpcPromise(_0x15e1('0x6a'),_0x15e1('0x6b'),_0x3fd418);}return null;})[_0x15e1('0x24')](function(_0x13a4f0){var _0x1de725=_0x15e1('0x6c')+_0x13a4f0[_0x15e1('0x2b')][_0x15e1('0x6d')];return db['sequelize'][_0x15e1('0x3e')](_0x1de725,{'type':db['Sequelize'][_0x15e1('0x6e')][_0x15e1('0x6f')],'raw':!![]})[_0x15e1('0x24')](function(_0x5d5c37){return _0x5d5c37;});})['then'](function(_0x1f108b){if(_0x1f108b){_0x3fd418[_0x15e1('0x2b')][_0x15e1('0x70')]=_0x1f108b[0x0];if(!_0x5615d8[_0x15e1('0x59')][_0x15e1('0x60')])return;return db['User'][_0x15e1('0x57')]({'where':{'id':_0x5615d8[_0x15e1('0x59')][_0x15e1('0x60')],'role':_0x15e1('0x71')},'attributes':['id',_0x15e1('0x38'),_0x15e1('0x72'),_0x15e1('0x73'),_0x15e1('0x74')],'raw':!![]});}return null;})[_0x15e1('0x24')](function(_0x42b0dc){if(!_0x42b0dc)return null;_0x3fd418[_0x15e1('0x2b')][_0x15e1('0x71')]=_0x42b0dc;return _0x3fd418;})[_0x15e1('0x24')](function(_0x33d840){if(_0x33d840){if(_0x5615d8[_0x15e1('0x59')][_0x15e1('0x75')]){_0x3fd418[_0x15e1('0x2b')][_0x15e1('0x76')]=util[_0x15e1('0x5f')](_0x15e1('0x77'),_0x5615d8[_0x15e1('0x61')][_0x15e1('0x38')]);_0x3fd418[_0x15e1('0x2b')][_0x15e1('0x78')]=_0x3fd418[_0x15e1('0x78')];_0x3fd418[_0x15e1('0x2b')]['motionChannel']=_0x3fd418[_0x15e1('0x78')];_0x3fd418[_0x15e1('0x2b')]['event']='accept';return respondWithRpcPromise('EventManager',_0x15e1('0x79'),{'event':_0x15e1('0x7a'),'message':_0x3fd418[_0x15e1('0x2b')]},client9002)['then'](function(){return _0x3fd418;});}return _0x3fd418;}return null;})[_0x15e1('0x24')](respondWithResult(_0x2b9396,null))[_0x15e1('0x54')](handleError(_0x2b9396,null));};var interaction_log=require(_0x15e1('0x14'))(_0x15e1('0x5b'));exports['reject']=function(_0x291626,_0x52f8a3,_0xffd9b5){var _0x4f1496={'agent':{},'channel':'openchannel'};if(_0x291626[_0x15e1('0x59')]['id']){delete _0x291626[_0x15e1('0x59')]['id'];}_0x291626[_0x15e1('0x59')][_0x15e1('0x60')]=_0x291626['body'][_0x15e1('0x60')]||_0x291626[_0x15e1('0x61')]['id'];_0x4f1496['agent']['id']=_0x291626[_0x15e1('0x59')]['UserId'];return db[_0x15e1('0x39')][_0x15e1('0x57')]({'where':{'id':_0x291626[_0x15e1('0x56')]['id'],'UserId':null}})[_0x15e1('0x24')](handleEntityNotFound(_0x52f8a3,null))[_0x15e1('0x24')](function(_0xf00afd){if(_0xf00afd){_0x4f1496[_0x15e1('0x2b')]=_0xf00afd[_0x15e1('0x62')]({'plain':!![]});return db[_0x15e1('0x63')]['find']({'where':{'id':_0xf00afd[_0x15e1('0x7b')]}});}return null;})[_0x15e1('0x24')](handleEntityNotFound(_0x52f8a3,null))[_0x15e1('0x24')](function(_0x169d2c){if(_0x169d2c){_0x4f1496[_0x15e1('0x65')]=_0x169d2c[_0x15e1('0x62')]({'plain':!![]});interaction_log[_0x15e1('0x25')](_0x15e1('0x7c'),_0x291626[_0x15e1('0x61')]['id'],_0x291626[_0x15e1('0x61')][_0x15e1('0x38')],_0x291626[_0x15e1('0x61')]['role'],_0x4f1496[_0x15e1('0x65')]['id'],_0x291626[_0x15e1('0x59')]?JSON[_0x15e1('0x68')](_0x291626[_0x15e1('0x59')]):_0x15e1('0x69'));return respondWithRpcPromise(_0x15e1('0x7d'),_0x15e1('0x7e'),_0x4f1496);}return null;})['then'](function(_0x1ddba3){var _0x36e4cf=_0x15e1('0x6c')+_0x1ddba3[_0x15e1('0x2b')][_0x15e1('0x6d')];return db[_0x15e1('0x7f')][_0x15e1('0x3e')](_0x36e4cf,{'type':db[_0x15e1('0x80')][_0x15e1('0x6e')][_0x15e1('0x6f')],'raw':!![]})['then'](function(_0x1bafb2){return _0x1bafb2;});})[_0x15e1('0x24')](function(_0x391726){if(_0x391726){_0x4f1496[_0x15e1('0x2b')][_0x15e1('0x70')]=_0x391726[0x0];if(!_0x291626[_0x15e1('0x59')][_0x15e1('0x60')])return;return db[_0x15e1('0x81')][_0x15e1('0x57')]({'where':{'id':_0x291626[_0x15e1('0x59')][_0x15e1('0x60')],'role':_0x15e1('0x71')},'attributes':['id','name',_0x15e1('0x72'),_0x15e1('0x73'),_0x15e1('0x74')],'raw':!![]});}return null;})[_0x15e1('0x24')](function(_0x3a5951){if(!_0x3a5951)return null;_0x4f1496[_0x15e1('0x2b')][_0x15e1('0x71')]=_0x3a5951;return _0x4f1496;})[_0x15e1('0x24')](function(_0x8f1dbc){if(_0x8f1dbc){_0x8f1dbc['message'][_0x15e1('0x76')]=util[_0x15e1('0x5f')](_0x15e1('0x77'),_0x291626['user'][_0x15e1('0x38')]);_0x8f1dbc[_0x15e1('0x2b')][_0x15e1('0x78')]=_0x4f1496[_0x15e1('0x78')];_0x8f1dbc[_0x15e1('0x2b')]['motionChannel']=_0x4f1496[_0x15e1('0x78')];_0x8f1dbc[_0x15e1('0x2b')][_0x15e1('0x82')]=_0x15e1('0x83');respondWithRpcPromise(_0x15e1('0x79'),_0x15e1('0x79'),{'event':_0x15e1('0x84'),'message':_0x8f1dbc[_0x15e1('0x2b')]},client9002);return _0x4f1496;}return null;})['then'](respondWithResult(_0x52f8a3,null))[_0x15e1('0x54')](handleError(_0x52f8a3,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 6512f42..7e41085 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 _0x9384=['hasOwnProperty','exports','../../mysqldb','OpenchannelMessage','save','update','remove','emit'];(function(_0x5cc3d4,_0x2a352a){var _0x1a7344=function(_0x5e81f3){while(--_0x5e81f3){_0x5cc3d4['push'](_0x5cc3d4['shift']());}};_0x1a7344(++_0x2a352a);}(_0x9384,0xea));var _0x4938=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0x9384[_0x7e2eb0];return _0xd92de4;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0x4938('0x0'))['db'][_0x4938('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4938('0x2'),'afterUpdate':_0x4938('0x3'),'afterDestroy':_0x4938('0x4')};function emitEvent(_0x37716b){return function(_0x3c9635,_0x40644f,_0x3b5ca4){OpenchannelMessageEvents[_0x4938('0x5')](_0x37716b+':'+_0x3c9635['id'],_0x3c9635);OpenchannelMessageEvents[_0x4938('0x5')](_0x37716b,_0x3c9635);_0x3b5ca4(null);};}for(var e in events){if(events[_0x4938('0x6')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x4938('0x7')]=OpenchannelMessageEvents; \ No newline at end of file +var _0xdcb7=['../../mysqldb','OpenchannelMessage','setMaxListeners','update','remove','emit','hook','exports'];(function(_0x50d26b,_0x259ae9){var _0x5b8cdc=function(_0x5b5fa7){while(--_0x5b5fa7){_0x50d26b['push'](_0x50d26b['shift']());}};_0x5b8cdc(++_0x259ae9);}(_0xdcb7,0x118));var _0x7dcb=function(_0xd76573,_0x1a0f36){_0xd76573=_0xd76573-0x0;var _0x171c44=_0xdcb7[_0xd76573];return _0x171c44;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0x7dcb('0x0'))['db'][_0x7dcb('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x7dcb('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7dcb('0x3'),'afterDestroy':_0x7dcb('0x4')};function emitEvent(_0x567c1c){return function(_0x128672,_0x4023c0,_0x3c4fec){OpenchannelMessageEvents[_0x7dcb('0x5')](_0x567c1c+':'+_0x128672['id'],_0x128672);OpenchannelMessageEvents['emit'](_0x567c1c,_0x128672);_0x3c4fec(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0x7dcb('0x6')](e,emitEvent(event));}}module[_0x7dcb('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 f9db9ff..e99e305 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 _0x0972=['rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','createdAt','catch','CmContact','describe','find','OpenchannelAccountId','Interactions','Contact','keys','info','OpenchannelMessage,\x20%s,\x20%s','format','replyUri','length','Interaction','omit','POST','method','GET','afterCreate','Message\x20%d\x20forwarded\x20to\x20%s','threadId','error','finally','utf8mb4','utf8mb4_unicode_ci','util','api','bluebird','request-promise'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x0972,0x64));var _0x2097=function(_0x5ad3b1,_0x10a697){_0x5ad3b1=_0x5ad3b1-0x0;var _0x42065d=_0x0972[_0x5ad3b1];return _0x42065d;};'use strict';var _=require('lodash');var util=require(_0x2097('0x0'));var logger=require('../../config/logger')(_0x2097('0x1'));var moment=require('moment');var BPromise=require(_0x2097('0x2'));var rp=require(_0x2097('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2097('0x4'));var config=require(_0x2097('0x5'));var attributes=require(_0x2097('0x6'));module[_0x2097('0x7')]=function(_0x2f84d8,_0x11ed13){return _0x2f84d8[_0x2097('0x8')]('OpenchannelMessage',attributes,{'tableName':_0x2097('0x9'),'paranoid':![],'indexes':[{'name':_0x2097('0xa'),'fields':[_0x2097('0xb')],'type':_0x2097('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3b8fac,_0x59d947,_0x2e0024){var _0x3b8b76=_0x2f84d8[_0x2097('0xd')];var _0x430754=_0x3b8fac[_0x2097('0xe')]({'plain':!![]});if(_0x430754[_0x2097('0xf')][_0x2097('0x10')]()==='in'||_0x430754[_0x2097('0xf')][_0x2097('0x10')]()===_0x2097('0x11')&&!_0x430754[_0x2097('0x12')]&&!_[_0x2097('0x13')](_0x430754[_0x2097('0x14')])){_0x3b8b76[_0x2097('0x15')][_0x2097('0x16')]({'where':{'id':_0x430754[_0x2097('0x17')]}})[_0x2097('0x18')](function(_0x1c9ef9){if(_0x1c9ef9){_0x1c9ef9[_0x2097('0x19')]({'lastMsgAt':_0x430754[_0x2097('0x1a')],'lastMsgDirection':_0x430754['direction'][_0x2097('0x10')]()});}})[_0x2097('0x1b')](function(_0x4d31bc){console['error'](_0x4d31bc);});}if(_0x430754['direction']===_0x2097('0x11')&&!_0x430754['secret']){var _0x28c35c;_0x3b8b76[_0x2097('0x1c')][_0x2097('0x1d')]()[_0x2097('0x18')](function(_0x44c584){return _0x3b8b76['OpenchannelAccount'][_0x2097('0x1e')]({'where':{'id':_0x430754[_0x2097('0x1f')]},'include':[{'model':_0x3b8b76[_0x2097('0x15')],'as':_0x2097('0x20'),'where':{'id':_0x430754[_0x2097('0x17')]},'limit':0x1,'include':[{'model':_0x3b8b76[_0x2097('0x1c')],'as':_0x2097('0x21'),'attributes':_[_0x2097('0x22')](_0x44c584)}]}]});})['then'](function(_0x4d957e){_0x28c35c=_0x4d957e[_0x2097('0xe')]({'plain':!![]});if(_0x28c35c&&_0x28c35c['replyUri']){logger[_0x2097('0x23')](_0x2097('0x24'),'afterCreate',util[_0x2097('0x25')]('Forwarding\x20message\x20%d\x20to\x20%s',_0x430754['id'],_0x28c35c[_0x2097('0x26')]));if(_0x28c35c[_0x2097('0x20')]&&_0x28c35c[_0x2097('0x20')][_0x2097('0x27')]){_0x430754[_0x2097('0x28')]=_[_0x2097('0x29')](_0x28c35c['Interactions'][0x0],_0x2097('0x21'));_0x430754['Contact']=_0x28c35c[_0x2097('0x20')][0x0][_0x2097('0x21')];}var _0x59d947={'method':_0x2097('0x2a'),'uri':encodeURI(_0x28c35c['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x59d947[_0x2097('0x2b')]){case _0x2097('0x2c'):_0x59d947['qs']=_0x430754;break;case'POST':_0x59d947[_0x2097('0xb')]=_0x430754;break;}return rp(_0x59d947)['then'](function(_0x29b879){logger['info'](_0x2097('0x24'),_0x2097('0x2d'),util[_0x2097('0x25')](_0x2097('0x2e'),_0x430754['id'],_0x28c35c[_0x2097('0x26')]));if(_0x29b879[_0x2097('0xb')][_0x2097('0x2f')]&&_0x29b879['body'][_0x2097('0x2f')]!=_0x430754[_0x2097('0x28')]['threadId']){return _0x3b8b76[_0x2097('0x15')][_0x2097('0x19')]({'threadId':_0x29b879['body']['threadId']},{'logging':!![],'where':{'id':_0x430754[_0x2097('0x28')]['id']}});}else{return;}})[_0x2097('0x18')](function(){return _0x3b8fac[_0x2097('0x19')]({'read':!![]});})[_0x2097('0x1b')](function(_0x74ccdc){logger[_0x2097('0x30')]('OpenchannelMessage,\x20%s,\x20%s',_0x2097('0x2d'),util['inspect'](_0x74ccdc,{'showHidden':![],'depth':null}));_0x2e0024();});}else{_0x2e0024();}})[_0x2097('0x31')](function(){_0x2e0024();});}else{_0x2e0024();}}},'charset':_0x2097('0x32'),'collate':_0x2097('0x33')});}; \ No newline at end of file +var _0x757a=['find','OpenchannelAccountId','OpenchannelInteraction','Interactions','keys','replyUri','info','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','Contact','POST','method','OpenchannelMessage,\x20%s,\x20%s','threadId','afterCreate','inspect','finally','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','UserId','OpenchannelInteractionId','update','createdAt','catch','error','out','secret','CmContact','describe','then'];(function(_0x5ef545,_0x3b8929){var _0x14e1c3=function(_0x184e51){while(--_0x184e51){_0x5ef545['push'](_0x5ef545['shift']());}};_0x14e1c3(++_0x3b8929);}(_0x757a,0xde));var _0xa757=function(_0x2e45a7,_0x3258fc){_0x2e45a7=_0x2e45a7-0x0;var _0x3bb9f0=_0x757a[_0x2e45a7];return _0x3bb9f0;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('OpenchannelMessage',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xb')],'type':_0xa757('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3a3db6,_0x5aef8a,_0x89c630){var _0x2ca96f=_0x5edca8[_0xa757('0xd')];var _0x3e2c9a=_0x3a3db6[_0xa757('0xe')]({'plain':!![]});if(_0x3e2c9a[_0xa757('0xf')][_0xa757('0x10')]()==='in'||_0x3e2c9a['direction']['toLowerCase']()==='out'&&!_0x3e2c9a['secret']&&!_['isNil'](_0x3e2c9a[_0xa757('0x11')])){_0x2ca96f['OpenchannelInteraction']['findOne']({'where':{'id':_0x3e2c9a[_0xa757('0x12')]}})['then'](function(_0x481508){if(_0x481508){_0x481508[_0xa757('0x13')]({'lastMsgAt':_0x3e2c9a[_0xa757('0x14')],'lastMsgDirection':_0x3e2c9a[_0xa757('0xf')][_0xa757('0x10')]()});}})[_0xa757('0x15')](function(_0x31cfd2){console[_0xa757('0x16')](_0x31cfd2);});}if(_0x3e2c9a[_0xa757('0xf')]===_0xa757('0x17')&&!_0x3e2c9a[_0xa757('0x18')]){var _0x50aac1;_0x2ca96f[_0xa757('0x19')][_0xa757('0x1a')]()[_0xa757('0x1b')](function(_0x4d9f58){return _0x2ca96f['OpenchannelAccount'][_0xa757('0x1c')]({'where':{'id':_0x3e2c9a[_0xa757('0x1d')]},'include':[{'model':_0x2ca96f[_0xa757('0x1e')],'as':_0xa757('0x1f'),'where':{'id':_0x3e2c9a[_0xa757('0x12')]},'limit':0x1,'include':[{'model':_0x2ca96f[_0xa757('0x19')],'as':'Contact','attributes':_[_0xa757('0x20')](_0x4d9f58)}]}]});})['then'](function(_0x32c2a1){_0x50aac1=_0x32c2a1[_0xa757('0xe')]({'plain':!![]});if(_0x50aac1&&_0x50aac1[_0xa757('0x21')]){logger[_0xa757('0x22')]('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0xa757('0x23')](_0xa757('0x24'),_0x3e2c9a['id'],_0x50aac1[_0xa757('0x21')]));if(_0x50aac1[_0xa757('0x1f')]&&_0x50aac1[_0xa757('0x1f')][_0xa757('0x25')]){_0x3e2c9a[_0xa757('0x26')]=_[_0xa757('0x27')](_0x50aac1[_0xa757('0x1f')][0x0],'Contact');_0x3e2c9a[_0xa757('0x28')]=_0x50aac1['Interactions'][0x0][_0xa757('0x28')];}var _0x5aef8a={'method':_0xa757('0x29'),'uri':encodeURI(_0x50aac1[_0xa757('0x21')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x5aef8a[_0xa757('0x2a')]){case'GET':_0x5aef8a['qs']=_0x3e2c9a;break;case _0xa757('0x29'):_0x5aef8a[_0xa757('0xb')]=_0x3e2c9a;break;}return rp(_0x5aef8a)[_0xa757('0x1b')](function(_0x3bf7f3){logger['info'](_0xa757('0x2b'),'afterCreate',util['format']('Message\x20%d\x20forwarded\x20to\x20%s',_0x3e2c9a['id'],_0x50aac1['replyUri']));if(_0x3bf7f3[_0xa757('0xb')]['threadId']&&_0x3bf7f3[_0xa757('0xb')][_0xa757('0x2c')]!=_0x3e2c9a['Interaction'][_0xa757('0x2c')]){return _0x2ca96f['OpenchannelInteraction'][_0xa757('0x13')]({'threadId':_0x3bf7f3[_0xa757('0xb')]['threadId']},{'logging':!![],'where':{'id':_0x3e2c9a[_0xa757('0x26')]['id']}});}else{return;}})['then'](function(){return _0x3a3db6[_0xa757('0x13')]({'read':!![]});})[_0xa757('0x15')](function(_0x458974){logger[_0xa757('0x16')](_0xa757('0x2b'),_0xa757('0x2d'),util[_0xa757('0x2e')](_0x458974,{'showHidden':![],'depth':null}));_0x89c630();});}else{_0x89c630();}})[_0xa757('0x2f')](function(){_0x89c630();});}else{_0x89c630();}}},'charset':_0xa757('0x30'),'collate':_0xa757('0x31')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index d6acf52..7849b37 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 _0x5f66=['stringify','error','code','message','info','result','OpenchannelMessage','create','body','options','raw','CreateOpenchannelMessage','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x5fef56,_0x384034){var _0xe49065=function(_0x1949dc){while(--_0x1949dc){_0x5fef56['push'](_0x5fef56['shift']());}};_0xe49065(++_0x384034);}(_0x5f66,0x1a0));var _0x65f6=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x5f66[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});config['redis']=_[_0x65f6('0x9')](config[_0x65f6('0xa')],{'host':_0x65f6('0xb'),'port':0x18eb});var socket=require(_0x65f6('0xc'))(new Redis(config[_0x65f6('0xa')]));require(_0x65f6('0xd'))['register'](socket);function respondWithRpcPromise(_0x5123ee,_0x18fea1,_0x2f6d5b){return new BPromise(function(_0x264647,_0x25c416){return client['request'](_0x5123ee,_0x2f6d5b)[_0x65f6('0xe')](function(_0x571436){logger['info'](_0x65f6('0xf'),_0x18fea1,'request\x20sent');logger[_0x65f6('0x10')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x18fea1,_0x65f6('0x11'),JSON[_0x65f6('0x12')](_0x571436));if(_0x571436[_0x65f6('0x13')]){if(_0x571436[_0x65f6('0x13')][_0x65f6('0x14')]===0x1f4){logger[_0x65f6('0x13')](_0x65f6('0xf'),_0x18fea1,_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);return _0x25c416(_0x571436[_0x65f6('0x13')]['message']);}logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x571436['error'][_0x65f6('0x15')]);return _0x264647(_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);}else{logger[_0x65f6('0x16')](_0x65f6('0xf'),_0x18fea1,_0x65f6('0x11'));_0x264647(_0x571436[_0x65f6('0x17')][_0x65f6('0x15')]);}})['catch'](function(_0x4d79a1){logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x4d79a1);_0x25c416(_0x4d79a1);});});}exports['CreateOpenchannelMessage']=function(_0x5c5b91){var _0x365159=this;return new Promise(function(_0x21ea88,_0x5114a4){return db[_0x65f6('0x18')][_0x65f6('0x19')](_0x5c5b91[_0x65f6('0x1a')],{'raw':_0x5c5b91[_0x65f6('0x1b')]?_0x5c5b91[_0x65f6('0x1b')][_0x65f6('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x197a49){logger['info']('CreateOpenchannelMessage',_0x5c5b91);logger[_0x65f6('0x10')](_0x65f6('0x1d'),_0x5c5b91,JSON['stringify'](_0x197a49));_0x21ea88(_0x197a49);})[_0x65f6('0x1e')](function(_0x471a33){logger[_0x65f6('0x13')](_0x65f6('0x1d'),_0x471a33['message'],_0x5c5b91);_0x5114a4(_0x365159[_0x65f6('0x13')](0x1f4,_0x471a33[_0x65f6('0x15')]));});});}; \ No newline at end of file +var _0xdb28=['then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateOpenchannelMessage','OpenchannelMessage','create','body','options','raw','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','request'];(function(_0x368a3e,_0x47b292){var _0x3cb213=function(_0x1c283d){while(--_0x1c283d){_0x368a3e['push'](_0x368a3e['shift']());}};_0x3cb213(++_0x47b292);}(_0xdb28,0x106));var _0x8db2=function(_0x58b3da,_0x27c48c){_0x58b3da=_0x58b3da-0x0;var _0x5efbcd=_0xdb28[_0x58b3da];return _0x5efbcd;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});config['redis']=_[_0x8db2('0xb')](config[_0x8db2('0xc')],{'host':_0x8db2('0xd'),'port':0x18eb});var socket=require(_0x8db2('0xe'))(new Redis(config[_0x8db2('0xc')]));require(_0x8db2('0xf'))[_0x8db2('0x10')](socket);function respondWithRpcPromise(_0x4ba340,_0x30dc90,_0x476216){return new BPromise(function(_0x1f62af,_0x57015f){return client[_0x8db2('0x11')](_0x4ba340,_0x476216)[_0x8db2('0x12')](function(_0x576475){logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));logger[_0x8db2('0x16')](_0x8db2('0x17'),_0x30dc90,'request\x20sent',JSON['stringify'](_0x576475));if(_0x576475[_0x8db2('0x18')]){if(_0x576475[_0x8db2('0x18')][_0x8db2('0x19')]===0x1f4){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x57015f(_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);}logger[_0x8db2('0x18')]('OpenchannelMessage,\x20%s,\x20%s',_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x1f62af(_0x576475['error'][_0x8db2('0x1a')]);}else{logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));_0x1f62af(_0x576475[_0x8db2('0x1b')][_0x8db2('0x1a')]);}})['catch'](function(_0x5df464){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x5df464);_0x57015f(_0x5df464);});});}exports[_0x8db2('0x1c')]=function(_0x1b64e4){var _0x58562e=this;return new Promise(function(_0x431d60,_0x36a9ff){return db[_0x8db2('0x1d')][_0x8db2('0x1e')](_0x1b64e4[_0x8db2('0x1f')],{'raw':_0x1b64e4['options']?_0x1b64e4[_0x8db2('0x20')][_0x8db2('0x21')]===undefined?!![]:![]:!![]})[_0x8db2('0x12')](function(_0x125be2){logger[_0x8db2('0x13')](_0x8db2('0x1c'),_0x1b64e4);logger[_0x8db2('0x16')]('CreateOpenchannelMessage',_0x1b64e4,JSON[_0x8db2('0x22')](_0x125be2));_0x431d60(_0x125be2);})['catch'](function(_0x5725f0){logger['error']('CreateOpenchannelMessage',_0x5725f0[_0x8db2('0x1a')],_0x1b64e4);_0x36a9ff(_0x58562e[_0x8db2('0x18')](0x1f4,_0x5725f0[_0x8db2('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 3db9054..7131e92 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 _0x8c46=['emit','removeListener','register','length','openchannelMessage:','./openchannelMessage.events','update'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x8c46,0x171));var _0x68c4=function(_0x4d5c11,_0x482ae0){_0x4d5c11=_0x4d5c11-0x0;var _0x1ce899=_0x8c46[_0x4d5c11];return _0x1ce899;};'use strict';var OpenchannelMessageEvents=require(_0x68c4('0x0'));var events=['save','remove',_0x68c4('0x1')];function createListener(_0x56779a,_0x5c3af6){return function(_0x667c59){_0x5c3af6[_0x68c4('0x2')](_0x56779a,_0x667c59);};}function removeListener(_0x1837ee,_0x1e3662){return function(){OpenchannelMessageEvents[_0x68c4('0x3')](_0x1837ee,_0x1e3662);};}exports[_0x68c4('0x4')]=function(_0x40ce21){for(var _0x1516cf=0x0,_0x3da9c3=events[_0x68c4('0x5')];_0x1516cf<_0x3da9c3;_0x1516cf++){var _0x5e57ce=events[_0x1516cf];var _0x1754d7=createListener(_0x68c4('0x6')+_0x5e57ce,_0x40ce21);OpenchannelMessageEvents['on'](_0x5e57ce,_0x1754d7);}}; \ No newline at end of file +var _0x61d7=['emit','removeListener','register','length','openchannelMessage:','save','remove','update'];(function(_0x5f4a78,_0x54ca12){var _0x12b53b=function(_0x107895){while(--_0x107895){_0x5f4a78['push'](_0x5f4a78['shift']());}};_0x12b53b(++_0x54ca12);}(_0x61d7,0x1dd));var _0x761d=function(_0xd017cb,_0x594d3f){_0xd017cb=_0xd017cb-0x0;var _0x2872f7=_0x61d7[_0xd017cb];return _0x2872f7;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0x761d('0x0'),_0x761d('0x1'),_0x761d('0x2')];function createListener(_0x26a59d,_0xfda685){return function(_0x2387e9){_0xfda685[_0x761d('0x3')](_0x26a59d,_0x2387e9);};}function removeListener(_0xc524b3,_0xf2ccb4){return function(){OpenchannelMessageEvents[_0x761d('0x4')](_0xc524b3,_0xf2ccb4);};}exports[_0x761d('0x5')]=function(_0x1aec9d){for(var _0xc06ff9=0x0,_0x5684fb=events[_0x761d('0x6')];_0xc06ff9<_0x5684fb;_0xc06ff9++){var _0x28b077=events[_0xc06ff9];var _0x4ba88f=createListener(_0x761d('0x7')+_0x28b077,_0x1aec9d);OpenchannelMessageEvents['on'](_0x28b077,_0x4ba88f);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index edd4ac4..7804866 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 _0xfeab=['/describe','describe','/:id','/:id/members','getMembers','getAgents','post','create','/:id/teams','/:id/users','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','../../config/environment','./openchannelQueue.controller','isAuthenticated','get'];(function(_0x23607f,_0x51db51){var _0x5a5be0=function(_0x22223e){while(--_0x22223e){_0x23607f['push'](_0x23607f['shift']());}};_0x5a5be0(++_0x51db51);}(_0xfeab,0x9e));var _0xbfea=function(_0x143f29,_0x16c93d){_0x143f29=_0x143f29-0x0;var _0x59b164=_0xfeab[_0x143f29];return _0x59b164;};'use strict';var multer=require(_0xbfea('0x0'));var util=require(_0xbfea('0x1'));var path=require(_0xbfea('0x2'));var timeout=require(_0xbfea('0x3'));var express=require(_0xbfea('0x4'));var router=express['Router']();var fs_extra=require(_0xbfea('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xbfea('0x6'));var controller=require(_0xbfea('0x7'));router['get']('/',auth[_0xbfea('0x8')](),controller['index']);router[_0xbfea('0x9')](_0xbfea('0xa'),auth[_0xbfea('0x8')](),controller[_0xbfea('0xb')]);router[_0xbfea('0x9')](_0xbfea('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xbfea('0x9')](_0xbfea('0xd'),auth[_0xbfea('0x8')](),controller[_0xbfea('0xe')]);router['get']('/:id/teams',auth[_0xbfea('0x8')](),controller['getTeams']);router[_0xbfea('0x9')]('/:id/users',auth[_0xbfea('0x8')](),controller[_0xbfea('0xf')]);router[_0xbfea('0x10')]('/',auth[_0xbfea('0x8')](),controller[_0xbfea('0x11')]);router[_0xbfea('0x10')](_0xbfea('0x12'),auth[_0xbfea('0x8')](),controller['addTeams']);router[_0xbfea('0x10')](_0xbfea('0x13'),auth[_0xbfea('0x8')](),controller[_0xbfea('0x14')]);router[_0xbfea('0x15')](_0xbfea('0xc'),auth[_0xbfea('0x8')](),controller[_0xbfea('0x16')]);router[_0xbfea('0x17')](_0xbfea('0xc'),auth[_0xbfea('0x8')](),controller[_0xbfea('0x18')]);router[_0xbfea('0x17')]('/:id/teams',auth[_0xbfea('0x8')](),controller[_0xbfea('0x19')]);router[_0xbfea('0x17')](_0xbfea('0x13'),auth[_0xbfea('0x8')](),controller[_0xbfea('0x1a')]);module[_0xbfea('0x1b')]=router; \ No newline at end of file +var _0x3a18=['exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./openchannelQueue.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/members','getMembers','getTeams','getAgents','post','addTeams','addAgents','put','update','delete','destroy','/:id/teams','removeTeams','/:id/users'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x3a18,0x12d));var _0x83a1=function(_0x157e03,_0x4e4969){_0x157e03=_0x157e03-0x0;var _0x3be50f=_0x3a18[_0x157e03];return _0x3be50f;};'use strict';var multer=require(_0x83a1('0x0'));var util=require(_0x83a1('0x1'));var path=require(_0x83a1('0x2'));var timeout=require(_0x83a1('0x3'));var express=require(_0x83a1('0x4'));var router=express[_0x83a1('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x83a1('0x6'));var controller=require(_0x83a1('0x7'));router['get']('/',auth[_0x83a1('0x8')](),controller[_0x83a1('0x9')]);router[_0x83a1('0xa')](_0x83a1('0xb'),auth[_0x83a1('0x8')](),controller[_0x83a1('0xc')]);router[_0x83a1('0xa')](_0x83a1('0xd'),auth[_0x83a1('0x8')](),controller[_0x83a1('0xe')]);router[_0x83a1('0xa')](_0x83a1('0xf'),auth['isAuthenticated'](),controller[_0x83a1('0x10')]);router[_0x83a1('0xa')]('/:id/teams',auth[_0x83a1('0x8')](),controller[_0x83a1('0x11')]);router[_0x83a1('0xa')]('/:id/users',auth[_0x83a1('0x8')](),controller[_0x83a1('0x12')]);router[_0x83a1('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0x83a1('0x13')]('/:id/teams',auth[_0x83a1('0x8')](),controller[_0x83a1('0x14')]);router[_0x83a1('0x13')]('/:id/users',auth['isAuthenticated'](),controller[_0x83a1('0x15')]);router[_0x83a1('0x16')](_0x83a1('0xd'),auth[_0x83a1('0x8')](),controller[_0x83a1('0x17')]);router[_0x83a1('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x83a1('0x19')]);router['delete'](_0x83a1('0x1a'),auth[_0x83a1('0x8')](),controller[_0x83a1('0x1b')]);router[_0x83a1('0x18')](_0x83a1('0x1c'),auth[_0x83a1('0x8')](),controller['removeAgents']);module[_0x83a1('0x1d')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 1e30edf..b4ab3b4 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 _0xe272=['ENUM','rrmemory','roundrobin','sequelize','exports','STRING','name'];(function(_0x9aada2,_0xd2d349){var _0x196dff=function(_0x5ad061){while(--_0x5ad061){_0x9aada2['push'](_0x9aada2['shift']());}};_0x196dff(++_0xd2d349);}(_0xe272,0x1d8));var _0x2e27=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xe272[_0x2b4411];return _0x8e41ef;};'use strict';var Sequelize=require(_0x2e27('0x0'));module[_0x2e27('0x1')]={'name':{'type':Sequelize[_0x2e27('0x2')],'unique':_0x2e27('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2e27('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2e27('0x4')](_0x2e27('0x5'),'beepall',_0x2e27('0x6'))}}; \ No newline at end of file +var _0x9c11=['INTEGER','ENUM','rrmemory','roundrobin','exports','STRING'];(function(_0x5d0e93,_0x46a5e6){var _0x31890a=function(_0x33f8b0){while(--_0x33f8b0){_0x5d0e93['push'](_0x5d0e93['shift']());}};_0x31890a(++_0x46a5e6);}(_0x9c11,0x19c));var _0x19c1=function(_0xe69634,_0x4037d4){_0xe69634=_0xe69634-0x0;var _0x1f9e2b=_0x9c11[_0xe69634];return _0x1f9e2b;};'use strict';var Sequelize=require('sequelize');module[_0x19c1('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x19c1('0x1')]},'timeout':{'type':Sequelize[_0x19c1('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x19c1('0x3')](_0x19c1('0x4'),'beepall',_0x19c1('0x5'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index ce6866b..3b613c3 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 _0xeba2=['findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','format','getTeams','Team','addTeams','ids','User','Agents','online','voicePause','interface','flatMap','transaction','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','QueryTypes','SELECT','TeamId','union','compact','value','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','getAgents','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','lodash','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','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','end','offset','count','limit','Content-Range','reject','save','update','then','destroy','OpenchannelQueues','stack','name','send','index','map','OpenchannelQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','rows','show','params','find','catch','create','body','user','get','role','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMembers','UserOpenchannelQueue','findAll'];(function(_0x5e5358,_0x480a72){var _0x4922ae=function(_0x152e3e){while(--_0x152e3e){_0x5e5358['push'](_0x5e5358['shift']());}};_0x4922ae(++_0x480a72);}(_0xeba2,0x143));var _0x2eba=function(_0xf2628e,_0x521bf7){_0xf2628e=_0xf2628e-0x0;var _0x13863a=_0xeba2[_0xf2628e];return _0x13863a;};'use strict';var emlformat=require(_0x2eba('0x0'));var rimraf=require(_0x2eba('0x1'));var zipdir=require(_0x2eba('0x2'));var jsonpatch=require(_0x2eba('0x3'));var rp=require(_0x2eba('0x4'));var moment=require('moment');var BPromise=require(_0x2eba('0x5'));var Mustache=require(_0x2eba('0x6'));var util=require('util');var path=require(_0x2eba('0x7'));var sox=require(_0x2eba('0x8'));var csv=require('to-csv');var ejs=require(_0x2eba('0x9'));var fs=require('fs');var fs_extra=require(_0x2eba('0xa'));var _=require(_0x2eba('0xb'));var squel=require(_0x2eba('0xc'));var crypto=require(_0x2eba('0xd'));var jsforce=require(_0x2eba('0xe'));var deskjs=require(_0x2eba('0xf'));var toCsv=require('to-csv');var querystring=require(_0x2eba('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2eba('0x11'));var qs=require(_0x2eba('0x12'));var as=require(_0x2eba('0x13'));var hardwareService=require(_0x2eba('0x14'));var logger=require(_0x2eba('0x15'))(_0x2eba('0x16'));var utils=require(_0x2eba('0x17'));var config=require(_0x2eba('0x18'));var licenseUtil=require(_0x2eba('0x19'));var db=require('../../mysqldb')['db'];config[_0x2eba('0x1a')]=_[_0x2eba('0x1b')](config[_0x2eba('0x1a')],{'host':_0x2eba('0x1c'),'port':0x18eb});var socket=require(_0x2eba('0x1d'))(new Redis(config[_0x2eba('0x1a')]));require(_0x2eba('0x1e'))[_0x2eba('0x1f')](socket);function respondWithStatusCode(_0x161909,_0xef190f){_0xef190f=_0xef190f||0xcc;return function(_0x6a2bd5){if(_0x6a2bd5){return _0x161909[_0x2eba('0x20')](_0xef190f);}return _0x161909[_0x2eba('0x21')](_0xef190f)[_0x2eba('0x22')]();};}function respondWithResult(_0x41bae9,_0x12ab45){_0x12ab45=_0x12ab45||0xc8;return function(_0x188c46){if(_0x188c46){return _0x41bae9[_0x2eba('0x21')](_0x12ab45)['json'](_0x188c46);}};}function respondWithFilteredResult(_0x14c284,_0x5269e7){return function(_0x117099){if(_0x117099){var _0x12d28e=typeof _0x5269e7[_0x2eba('0x23')]==='undefined'&&typeof _0x5269e7['limit']==='undefined';var _0x148f3e=_0x117099[_0x2eba('0x24')];var _0x22aabc=_0x12d28e?0x0:_0x5269e7[_0x2eba('0x23')];var _0x59d7d2=_0x12d28e?_0x117099['count']:_0x5269e7['offset']+_0x5269e7[_0x2eba('0x25')];var _0x214cb2;if(_0x59d7d2>=_0x148f3e){_0x59d7d2=_0x148f3e;_0x214cb2=0xc8;}else{_0x214cb2=0xce;}_0x14c284['status'](_0x214cb2);return _0x14c284['set'](_0x2eba('0x26'),_0x22aabc+'-'+_0x59d7d2+'/'+_0x148f3e)['json'](_0x117099);}return null;};}function patchUpdates(_0x4b9331){return function(_0xecd45){try{jsonpatch['apply'](_0xecd45,_0x4b9331,!![]);}catch(_0x22d998){return BPromise[_0x2eba('0x27')](_0x22d998);}return _0xecd45[_0x2eba('0x28')]();};}function saveUpdates(_0x5c54b2,_0x125893){return function(_0x54bdd3){if(_0x54bdd3){return _0x54bdd3[_0x2eba('0x29')](_0x5c54b2)[_0x2eba('0x2a')](function(_0x5052c2){return _0x5052c2;});}return null;};}function removeEntity(_0x188042,_0x1966bf){return function(_0x1c4d28){if(_0x1c4d28){return _0x1c4d28[_0x2eba('0x2b')]()[_0x2eba('0x2a')](function(){var _0xf32b25=_0x1c4d28['get']({'plain':!![]});var _0xf519ff=_0x2eba('0x2c');return db['UserProfileResource']['destroy']({'where':{'type':_0xf519ff,'resourceId':_0xf32b25['id']}})['then'](function(){return _0x1c4d28;});})[_0x2eba('0x2a')](function(){_0x188042[_0x2eba('0x21')](0xcc)[_0x2eba('0x22')]();});}};}function handleEntityNotFound(_0x454b8f,_0x34b1d1){return function(_0x3e7342){if(!_0x3e7342){_0x454b8f['sendStatus'](0x194);}return _0x3e7342;};}function handleError(_0x4fdfa1,_0x2077a0){_0x2077a0=_0x2077a0||0x1f4;return function(_0x2e79e0){logger['error'](_0x2e79e0[_0x2eba('0x2d')]);if(_0x2e79e0[_0x2eba('0x2e')]){delete _0x2e79e0[_0x2eba('0x2e')];}_0x4fdfa1[_0x2eba('0x21')](_0x2077a0)[_0x2eba('0x2f')](_0x2e79e0);};}exports[_0x2eba('0x30')]=function(_0x8d3531,_0x156319){var _0x1526f7={},_0xa359a9={},_0x28eabe={'count':0x0,'rows':[]};var _0x22a65a=_[_0x2eba('0x31')](db[_0x2eba('0x32')][_0x2eba('0x33')],function(_0x5cf5eb){return{'name':_0x5cf5eb[_0x2eba('0x34')],'type':_0x5cf5eb[_0x2eba('0x35')][_0x2eba('0x36')]};});_0xa359a9[_0x2eba('0x37')]=_[_0x2eba('0x31')](_0x22a65a,'name');_0xa359a9[_0x2eba('0x38')]=_[_0x2eba('0x39')](_0x8d3531[_0x2eba('0x38')]);_0xa359a9[_0x2eba('0x3a')]=_[_0x2eba('0x3b')](_0xa359a9['model'],_0xa359a9[_0x2eba('0x38')]);_0x1526f7['attributes']=_[_0x2eba('0x3b')](_0xa359a9[_0x2eba('0x37')],qs[_0x2eba('0x3c')](_0x8d3531[_0x2eba('0x38')][_0x2eba('0x3c')]));_0x1526f7[_0x2eba('0x3d')]=_0x1526f7[_0x2eba('0x3d')][_0x2eba('0x3e')]?_0x1526f7[_0x2eba('0x3d')]:_0xa359a9[_0x2eba('0x37')];if(!_0x8d3531[_0x2eba('0x38')][_0x2eba('0x3f')](_0x2eba('0x40'))){_0x1526f7[_0x2eba('0x25')]=qs[_0x2eba('0x25')](_0x8d3531['query'][_0x2eba('0x25')]);_0x1526f7['offset']=qs[_0x2eba('0x23')](_0x8d3531[_0x2eba('0x38')]['offset']);}_0x1526f7[_0x2eba('0x41')]=qs[_0x2eba('0x42')](_0x8d3531[_0x2eba('0x38')]['sort']);_0x1526f7['where']=qs[_0x2eba('0x3a')](_[_0x2eba('0x43')](_0x8d3531[_0x2eba('0x38')],_0xa359a9[_0x2eba('0x3a')]),_0x22a65a);if(_0x8d3531[_0x2eba('0x38')][_0x2eba('0x44')]){_0x1526f7['where']=_[_0x2eba('0x45')](_0x1526f7[_0x2eba('0x46')],{'$or':_[_0x2eba('0x31')](_0x22a65a,function(_0x51c2c9){if(_0x51c2c9[_0x2eba('0x35')]!==_0x2eba('0x47')){var _0x1ba9c4={};_0x1ba9c4[_0x51c2c9[_0x2eba('0x2e')]]={'$like':'%'+_0x8d3531['query'][_0x2eba('0x44')]+'%'};return _0x1ba9c4;}})});}_0x1526f7=_[_0x2eba('0x45')]({},_0x1526f7,_0x8d3531[_0x2eba('0x48')]);var _0x59e3f1={'where':_0x1526f7['where']};return db[_0x2eba('0x32')]['count'](_0x59e3f1)['then'](function(_0x5bdce7){_0x28eabe[_0x2eba('0x24')]=_0x5bdce7;if(_0x8d3531['query'][_0x2eba('0x49')]){_0x1526f7[_0x2eba('0x4a')]=[{'all':!![]}];}return db[_0x2eba('0x32')]['findAll'](_0x1526f7);})[_0x2eba('0x2a')](function(_0x39b59d){_0x28eabe[_0x2eba('0x4b')]=_0x39b59d;return _0x28eabe;})[_0x2eba('0x2a')](respondWithFilteredResult(_0x156319,_0x1526f7))['catch'](handleError(_0x156319,null));};exports[_0x2eba('0x4c')]=function(_0x128a8e,_0xcc7ddf){var _0x547ab2={'raw':!![],'where':{'id':_0x128a8e[_0x2eba('0x4d')]['id']}},_0x1176bd={};_0x1176bd[_0x2eba('0x37')]=_['keys'](db[_0x2eba('0x32')][_0x2eba('0x33')]);_0x1176bd[_0x2eba('0x38')]=_[_0x2eba('0x39')](_0x128a8e[_0x2eba('0x38')]);_0x1176bd[_0x2eba('0x3a')]=_[_0x2eba('0x3b')](_0x1176bd['model'],_0x1176bd[_0x2eba('0x38')]);_0x547ab2[_0x2eba('0x3d')]=_[_0x2eba('0x3b')](_0x1176bd[_0x2eba('0x37')],qs[_0x2eba('0x3c')](_0x128a8e[_0x2eba('0x38')]['fields']));_0x547ab2[_0x2eba('0x3d')]=_0x547ab2[_0x2eba('0x3d')]['length']?_0x547ab2[_0x2eba('0x3d')]:_0x1176bd[_0x2eba('0x37')];if(_0x128a8e[_0x2eba('0x38')][_0x2eba('0x49')]){_0x547ab2['include']=[{'all':!![]}];}_0x547ab2=_[_0x2eba('0x45')]({},_0x547ab2,_0x128a8e[_0x2eba('0x48')]);return db['OpenchannelQueue'][_0x2eba('0x4e')](_0x547ab2)[_0x2eba('0x2a')](handleEntityNotFound(_0xcc7ddf,null))[_0x2eba('0x2a')](respondWithResult(_0xcc7ddf,null))[_0x2eba('0x4f')](handleError(_0xcc7ddf,null));};exports[_0x2eba('0x50')]=function(_0x235793,_0xf87441){return db['OpenchannelQueue'][_0x2eba('0x50')](_0x235793[_0x2eba('0x51')],{})['then'](function(_0x27bd6b){var _0x4078f7=_0x235793[_0x2eba('0x52')][_0x2eba('0x53')]({'plain':!![]});if(!_0x4078f7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4078f7[_0x2eba('0x54')]===_0x2eba('0x52')){var _0x55ad73=_0x27bd6b['get']({'plain':!![]});var _0x4c10ab=_0x2eba('0x2c');return db['UserProfileSection'][_0x2eba('0x4e')]({'where':{'name':_0x4c10ab,'userProfileId':_0x4078f7[_0x2eba('0x55')]},'raw':!![]})[_0x2eba('0x2a')](function(_0x29b7df){if(_0x29b7df&&_0x29b7df['autoAssociation']===0x0){return db['UserProfileResource'][_0x2eba('0x50')]({'name':_0x55ad73['name'],'resourceId':_0x55ad73['id'],'type':_0x29b7df[_0x2eba('0x2e')],'sectionId':_0x29b7df['id']},{})[_0x2eba('0x2a')](function(){return _0x27bd6b;});}else{return _0x27bd6b;}})[_0x2eba('0x4f')](function(_0x374e5c){logger[_0x2eba('0x56')](_0x2eba('0x57'),_0x374e5c);throw _0x374e5c;});}return _0x27bd6b;})[_0x2eba('0x2a')](respondWithResult(_0xf87441,0xc9))[_0x2eba('0x4f')](handleError(_0xf87441,null));};exports[_0x2eba('0x29')]=function(_0x299b0f,_0x1117fa){if(_0x299b0f[_0x2eba('0x51')]['id']){delete _0x299b0f['body']['id'];}return db[_0x2eba('0x32')][_0x2eba('0x4e')]({'where':{'id':_0x299b0f['params']['id']}})[_0x2eba('0x2a')](handleEntityNotFound(_0x1117fa,null))[_0x2eba('0x2a')](saveUpdates(_0x299b0f[_0x2eba('0x51')],null))[_0x2eba('0x2a')](respondWithResult(_0x1117fa,null))[_0x2eba('0x4f')](handleError(_0x1117fa,null));};exports[_0x2eba('0x2b')]=function(_0x4ad02d,_0x18ace8){return db['OpenchannelQueue']['find']({'where':{'id':_0x4ad02d[_0x2eba('0x4d')]['id']}})['then'](handleEntityNotFound(_0x18ace8,null))[_0x2eba('0x2a')](removeEntity(_0x18ace8,null))[_0x2eba('0x4f')](handleError(_0x18ace8,null));};exports['describe']=function(_0x1b2c2b,_0x3e187f){return db['OpenchannelQueue']['describe']()['then'](respondWithResult(_0x3e187f,null))[_0x2eba('0x4f')](handleError(_0x3e187f,null));};exports[_0x2eba('0x58')]=function(_0x48dcf7,_0x59d7f8,_0x4f551f){var _0x4730b4={'raw':!![],'where':{}},_0x2570e1={},_0x2dfeb8;return db[_0x2eba('0x32')]['findOne']({'where':{'id':_0x48dcf7[_0x2eba('0x4d')]['id']}})['then'](handleEntityNotFound(_0x59d7f8,null))[_0x2eba('0x2a')](function(_0x33a2a3){if(_0x33a2a3){_0x2dfeb8=_0x33a2a3[_0x2eba('0x53')]({'plain':!![]});_0x2570e1[_0x2eba('0x37')]=_[_0x2eba('0x39')](db[_0x2eba('0x59')]['rawAttributes']);_0x2570e1[_0x2eba('0x38')]=_['keys'](_0x48dcf7[_0x2eba('0x38')]);_0x2570e1[_0x2eba('0x3a')]=_[_0x2eba('0x3b')](_0x2570e1[_0x2eba('0x37')],_0x2570e1[_0x2eba('0x38')]);_0x4730b4[_0x2eba('0x3d')]=_[_0x2eba('0x3b')](_0x2570e1[_0x2eba('0x37')],qs['fields'](_0x48dcf7[_0x2eba('0x38')][_0x2eba('0x3c')]));_0x4730b4[_0x2eba('0x3d')]=_0x4730b4[_0x2eba('0x3d')]['length']?_0x4730b4['attributes']:_0x2570e1['model'];if(!_0x48dcf7[_0x2eba('0x38')][_0x2eba('0x3f')](_0x2eba('0x40'))){_0x4730b4['limit']=qs[_0x2eba('0x25')](_0x48dcf7[_0x2eba('0x38')]['limit']);_0x4730b4[_0x2eba('0x23')]=qs['offset'](_0x48dcf7['query']['offset']);}_0x4730b4['order']=qs[_0x2eba('0x42')](_0x48dcf7['query'][_0x2eba('0x42')]);_0x4730b4[_0x2eba('0x46')]=qs[_0x2eba('0x3a')](_['pick'](_0x48dcf7[_0x2eba('0x38')],_0x2570e1[_0x2eba('0x3a')]));_0x4730b4[_0x2eba('0x46')]['OpenchannelQueueId']=_0x33a2a3['id'];if(_0x48dcf7['query'][_0x2eba('0x44')]){_0x4730b4[_0x2eba('0x46')]=_[_0x2eba('0x45')](_0x4730b4[_0x2eba('0x46')],{'$or':_[_0x2eba('0x31')](_0x4730b4[_0x2eba('0x3d')],function(_0x271323){var _0x6fc130={};_0x6fc130[_0x271323]={'$like':'%'+_0x48dcf7[_0x2eba('0x38')][_0x2eba('0x44')]+'%'};return _0x6fc130;})});}_0x4730b4=_[_0x2eba('0x45')]({},_0x4730b4,_0x48dcf7['options']);return db[_0x2eba('0x59')][_0x2eba('0x5a')](_0x4730b4);}})['then'](function(_0x4dbb42){if(_0x4dbb42){return db['User'][_0x2eba('0x5b')]({'where':{'id':_[_0x2eba('0x31')](_0x4dbb42,_0x2eba('0x5c')),'role':_0x2eba('0x5d')},'attributes':['id',_0x2eba('0x2e'),_0x2eba('0x5e'),_0x2eba('0x5f'),_0x2eba('0x60')]});}})[_0x2eba('0x2a')](function(_0x1a4677){if(_0x1a4677){return{'count':_0x1a4677[_0x2eba('0x24')],'rows':_[_0x2eba('0x31')](_0x1a4677[_0x2eba('0x4b')],function(_0x45eb68){return{'membername':_0x45eb68[_0x2eba('0x2e')],'UserId':_0x45eb68['id'],'queue_name':_0x2dfeb8['name'],'OpenchannelQueueId':_0x2dfeb8['id'],'interface':util[_0x2eba('0x61')]('%s/%s','SIP',_0x45eb68[_0x2eba('0x2e')]),'penalty':0x0,'paused':_0x45eb68[_0x2eba('0x5e')],'createdAt':_0x45eb68['createdAt'],'updatedAt':_0x45eb68[_0x2eba('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x2eba('0x2a')](respondWithFilteredResult(_0x59d7f8,_0x4730b4))[_0x2eba('0x4f')](handleError(_0x59d7f8,null));};exports[_0x2eba('0x62')]=function(_0x59f742,_0x4d4a0c,_0x4ade92){var _0x3dcbf8={};var _0x3c4874={};var _0x511a14;var _0x48ee86;return db[_0x2eba('0x32')]['findOne']({'where':{'id':_0x59f742[_0x2eba('0x4d')]['id']}})[_0x2eba('0x2a')](handleEntityNotFound(_0x4d4a0c,null))[_0x2eba('0x2a')](function(_0x437564){if(_0x437564){_0x511a14=_0x437564;_0x3c4874[_0x2eba('0x37')]=_[_0x2eba('0x39')](db[_0x2eba('0x63')][_0x2eba('0x33')]);_0x3c4874['query']=_['keys'](_0x59f742[_0x2eba('0x38')]);_0x3c4874[_0x2eba('0x3a')]=_['intersection'](_0x3c4874['model'],_0x3c4874[_0x2eba('0x38')]);_0x3dcbf8[_0x2eba('0x3d')]=_[_0x2eba('0x3b')](_0x3c4874['model'],qs[_0x2eba('0x3c')](_0x59f742[_0x2eba('0x38')][_0x2eba('0x3c')]));_0x3dcbf8['attributes']=_0x3dcbf8[_0x2eba('0x3d')]['length']?_0x3dcbf8['attributes']:_0x3c4874[_0x2eba('0x37')];_0x3dcbf8[_0x2eba('0x41')]=qs['sort'](_0x59f742['query'][_0x2eba('0x42')]);_0x3dcbf8['where']=qs[_0x2eba('0x3a')](_[_0x2eba('0x43')](_0x59f742[_0x2eba('0x38')],_0x3c4874[_0x2eba('0x3a')]));if(_0x59f742[_0x2eba('0x38')][_0x2eba('0x44')]){_0x3dcbf8[_0x2eba('0x46')]=_[_0x2eba('0x45')](_0x3dcbf8[_0x2eba('0x46')],{'$or':_['map'](_0x3dcbf8[_0x2eba('0x3d')],function(_0x52d52d){var _0xb77b89={};_0xb77b89[_0x52d52d]={'$like':'%'+_0x59f742[_0x2eba('0x38')][_0x2eba('0x44')]+'%'};return _0xb77b89;})});}_0x3dcbf8=_[_0x2eba('0x45')]({},_0x3dcbf8,_0x59f742[_0x2eba('0x48')]);return _0x511a14[_0x2eba('0x62')](_0x3dcbf8);}})[_0x2eba('0x2a')](function(_0x114acb){if(_0x114acb){_0x48ee86=_0x114acb[_0x2eba('0x3e')];if(!_0x59f742['query'][_0x2eba('0x3f')]('nolimit')){_0x3dcbf8[_0x2eba('0x25')]=qs[_0x2eba('0x25')](_0x59f742[_0x2eba('0x38')]['limit']);_0x3dcbf8[_0x2eba('0x23')]=qs['offset'](_0x59f742['query']['offset']);}return _0x511a14[_0x2eba('0x62')](_0x3dcbf8);}})[_0x2eba('0x2a')](function(_0x40b5ad){if(_0x40b5ad){return _0x40b5ad?{'count':_0x48ee86,'rows':_0x40b5ad}:null;}})[_0x2eba('0x2a')](respondWithResult(_0x4d4a0c,null))[_0x2eba('0x4f')](handleError(_0x4d4a0c,null));};exports[_0x2eba('0x64')]=function(_0x1d85bc,_0x21e4bb,_0x100e42){var _0x23e71e=_0x1d85bc[_0x2eba('0x51')][_0x2eba('0x65')];return db[_0x2eba('0x63')][_0x2eba('0x5a')]({'where':{'id':_0x23e71e},'attributes':['id'],'include':[{'model':db[_0x2eba('0x66')],'as':_0x2eba('0x67'),'attributes':['id',_0x2eba('0x2e'),_0x2eba('0x68'),_0x2eba('0x69'),_0x2eba('0x6a')],'raw':!![]}]})[_0x2eba('0x2a')](function(_0x56f877){if(_0x56f877){var _0x476025=_[_0x2eba('0x6b')](_0x56f877,function(_0x115290){var _0x5dfcc0=_0x115290[_0x2eba('0x53')]({'plain':!![]});return _0x5dfcc0['Agents'];});return db[_0x2eba('0x32')][_0x2eba('0x4e')]({'where':{'id':_0x1d85bc[_0x2eba('0x4d')]['id']}})[_0x2eba('0x2a')](function(_0x4ba9df){return db['sequelize'][_0x2eba('0x6c')](function(_0x5e1d36){return _0x4ba9df[_0x2eba('0x64')](_0x23e71e,{'transaction':_0x5e1d36})[_0x2eba('0x2a')](function(){return BPromise[_0x2eba('0x6d')](_0x476025,function(_0x555c5b){return db[_0x2eba('0x59')][_0x2eba('0x6e')]({'where':{'UserId':_0x555c5b['id'],'OpenchannelQueueId':_0x1d85bc['params']['id']},'transaction':_0x5e1d36});});})[_0x2eba('0x2a')](function(){_0x476025[_0x2eba('0x6f')](function(_0x6dfed1){socket[_0x2eba('0x70')](_0x2eba('0x71'),{'UserId':_0x6dfed1['id'],'OpenchannelQueueId':_0x4ba9df['id']});});});});});}})['then'](respondWithStatusCode(_0x21e4bb,null))['catch'](handleError(_0x21e4bb,null));};exports[_0x2eba('0x72')]=function(_0x121b5b,_0x51edcb,_0x114ead){return db[_0x2eba('0x63')]['findAll']({'where':{'id':_0x121b5b[_0x2eba('0x38')]['ids']},'attributes':['id'],'include':[{'model':db[_0x2eba('0x66')],'as':_0x2eba('0x67'),'attributes':['id'],'raw':!![]}]})[_0x2eba('0x2a')](handleEntityNotFound(_0x51edcb,null))[_0x2eba('0x2a')](function(_0x4c7ab2){var _0x2b5799=_[_0x2eba('0x31')](_0x4c7ab2,'id');var _0x501e99=[];var _0x1e04a4=[];var _0x2655d5=squel[_0x2eba('0x73')]();_0x2655d5[_0x2eba('0x74')](_0x2eba('0x75'))[_0x2eba('0x76')]('team_has_openchannel_queues','tq')[_0x2eba('0x77')](_0x2eba('0x78'),'ut',_0x2eba('0x79'))[_0x2eba('0x46')]('OpenchannelQueueId\x20=\x20?',_0x121b5b['params']['id']);for(var _0x9c6e8=0x0;_0x9c6e8<_0x4c7ab2[_0x2eba('0x3e')];_0x9c6e8+=0x1){let _0x4fda30=_0x4c7ab2[_0x9c6e8];for(var _0x462b85=0x0;_0x462b85<_0x4fda30['Agents'][_0x2eba('0x3e')];_0x462b85+=0x1){let _0x577782=_0x4fda30[_0x2eba('0x67')][_0x462b85];var _0x3cd7f7=_0x2655d5[_0x2eba('0x7a')]();_0x3cd7f7[_0x2eba('0x46')](_0x2eba('0x7b'),_0x577782['id']);_0x1e04a4['push'](db['sequelize'][_0x2eba('0x38')](_0x3cd7f7['toString'](),{'type':db['sequelize'][_0x2eba('0x7c')][_0x2eba('0x7d')]})[_0x2eba('0x2a')](function(_0x23f6ac){if(_0x23f6ac[_0x2eba('0x3e')]===0x1){return _0x577782['id'];}else{var _0x2f4b2a=_['every'](_['map'](_0x23f6ac,_0x2eba('0x7e')),function(_0x5a713a){return _['includes'](_0x2b5799,_0x5a713a);});if(_0x2f4b2a){return _0x577782['id'];}}}));}}return BPromise['all'](_0x1e04a4)[_0x2eba('0x2a')](function(_0x20beb4){_0x501e99=_(_0x501e99)[_0x2eba('0x7f')](_0x20beb4)[_0x2eba('0x80')]()[_0x2eba('0x81')]();return db[_0x2eba('0x32')][_0x2eba('0x4e')]({'where':{'id':_0x121b5b[_0x2eba('0x4d')]['id']}})['then'](function(_0x2f3c63){return db['sequelize'][_0x2eba('0x6c')](function(_0x73bb90){return _0x2f3c63[_0x2eba('0x72')](_0x121b5b[_0x2eba('0x38')][_0x2eba('0x65')],{'transaction':_0x73bb90})[_0x2eba('0x2a')](function(){if(!_[_0x2eba('0x82')](_0x501e99)){return _0x2f3c63[_0x2eba('0x83')](_0x501e99,{'transaction':_0x73bb90});}})['then'](function(){_0x501e99[_0x2eba('0x6f')](function(_0x11d833){socket[_0x2eba('0x70')](_0x2eba('0x84'),{'UserId':_0x11d833,'OpenchannelQueueId':_0x2f3c63['id']});});});});});});})[_0x2eba('0x2a')](respondWithStatusCode(_0x51edcb,null))[_0x2eba('0x4f')](handleError(_0x51edcb,null));};exports[_0x2eba('0x85')]=function(_0xf833d1,_0x3f7a44,_0x40de8d){return db['OpenchannelQueue'][_0x2eba('0x4e')]({'where':{'id':_0xf833d1[_0x2eba('0x4d')]['id']}})[_0x2eba('0x2a')](handleEntityNotFound(_0x3f7a44,null))['then'](function(_0x478ada){if(_0x478ada){return _0x478ada[_0x2eba('0x85')](_0xf833d1[_0x2eba('0x51')][_0x2eba('0x65')],_[_0x2eba('0x86')](_0xf833d1['body'],[_0x2eba('0x65'),'id'])||{})[_0x2eba('0x87')](function(_0x3ff5a1){for(var _0xfd70a5=0x0;_0xfd70a5<_0xf833d1[_0x2eba('0x51')][_0x2eba('0x65')][_0x2eba('0x3e')];_0xfd70a5+=0x1){socket[_0x2eba('0x70')](_0x2eba('0x71'),{'UserId':Number(_0xf833d1[_0x2eba('0x51')][_0x2eba('0x65')][_0xfd70a5]),'OpenchannelQueueId':Number(_0xf833d1[_0x2eba('0x4d')]['id'])});}return _0x3ff5a1;});}})[_0x2eba('0x2a')](respondWithResult(_0x3f7a44,null))['catch'](handleError(_0x3f7a44,null));};exports['removeAgents']=function(_0x474f26,_0x21ba41,_0x3b3a19){return db['OpenchannelQueue'][_0x2eba('0x4e')]({'where':{'id':_0x474f26[_0x2eba('0x4d')]['id']}})[_0x2eba('0x2a')](handleEntityNotFound(_0x21ba41,null))['then'](function(_0x3acdbd){if(_0x3acdbd){return _0x3acdbd[_0x2eba('0x83')](_0x474f26[_0x2eba('0x38')][_0x2eba('0x65')])[_0x2eba('0x2a')](function(){if(_['isArray'](_0x474f26[_0x2eba('0x38')][_0x2eba('0x65')])){for(var _0x5079cd=0x0;_0x5079cd<_0x474f26[_0x2eba('0x38')]['ids'][_0x2eba('0x3e')];_0x5079cd+=0x1){socket[_0x2eba('0x70')]('userOpenchannelQueue:remove',{'UserId':Number(_0x474f26[_0x2eba('0x38')][_0x2eba('0x65')][_0x5079cd]),'OpenchannelQueueId':Number(_0x474f26['params']['id'])});}}else{socket[_0x2eba('0x70')](_0x2eba('0x84'),{'UserId':Number(_0x474f26[_0x2eba('0x38')][_0x2eba('0x65')]),'OpenchannelQueueId':Number(_0x474f26[_0x2eba('0x4d')]['id'])});}});}})[_0x2eba('0x2a')](respondWithStatusCode(_0x21ba41,null))[_0x2eba('0x4f')](handleError(_0x21ba41,null));};exports[_0x2eba('0x88')]=function(_0x2005a1,_0x140657,_0xbc4053){var _0x5cc035={};var _0xc28f9e={};var _0x30df93;var _0x5921a9;return db[_0x2eba('0x32')][_0x2eba('0x89')]({'where':{'id':_0x2005a1[_0x2eba('0x4d')]['id']}})[_0x2eba('0x2a')](handleEntityNotFound(_0x140657,null))[_0x2eba('0x2a')](function(_0xae500){if(_0xae500){_0x30df93=_0xae500;_0xc28f9e[_0x2eba('0x37')]=_[_0x2eba('0x39')](db[_0x2eba('0x66')]['rawAttributes']);_0xc28f9e['query']=_['keys'](_0x2005a1['query']);_0xc28f9e['filters']=_[_0x2eba('0x3b')](_0xc28f9e['model'],_0xc28f9e[_0x2eba('0x38')]);_0x5cc035[_0x2eba('0x3d')]=_['intersection'](_0xc28f9e[_0x2eba('0x37')],qs[_0x2eba('0x3c')](_0x2005a1[_0x2eba('0x38')][_0x2eba('0x3c')]));_0x5cc035[_0x2eba('0x3d')]=_0x5cc035[_0x2eba('0x3d')][_0x2eba('0x3e')]?_0x5cc035[_0x2eba('0x3d')]:_0xc28f9e[_0x2eba('0x37')];_0x5cc035[_0x2eba('0x41')]=qs[_0x2eba('0x42')](_0x2005a1[_0x2eba('0x38')][_0x2eba('0x42')]);_0x5cc035[_0x2eba('0x46')]=qs[_0x2eba('0x3a')](_['pick'](_0x2005a1[_0x2eba('0x38')],_0xc28f9e['filters']));if(_0x2005a1['query'][_0x2eba('0x44')]){_0x5cc035[_0x2eba('0x46')]=_[_0x2eba('0x45')](_0x5cc035['where'],{'$or':_[_0x2eba('0x31')](_0x5cc035[_0x2eba('0x3d')],function(_0xf77bec){var _0xd16b7b={};_0xd16b7b[_0xf77bec]={'$like':'%'+_0x2005a1[_0x2eba('0x38')][_0x2eba('0x44')]+'%'};return _0xd16b7b;})});}_0x5cc035=_[_0x2eba('0x45')]({},_0x5cc035,_0x2005a1[_0x2eba('0x48')]);return _0x30df93['getAgents'](_0x5cc035);}})[_0x2eba('0x2a')](function(_0x5501e1){if(_0x5501e1){_0x5921a9=_0x5501e1[_0x2eba('0x3e')];if(!_0x2005a1['query'][_0x2eba('0x3f')](_0x2eba('0x40'))){_0x5cc035[_0x2eba('0x25')]=qs[_0x2eba('0x25')](_0x2005a1[_0x2eba('0x38')][_0x2eba('0x25')]);_0x5cc035[_0x2eba('0x23')]=qs[_0x2eba('0x23')](_0x2005a1[_0x2eba('0x38')][_0x2eba('0x23')]);}return _0x30df93['getAgents'](_0x5cc035);}})['then'](function(_0x67a442){if(_0x67a442){return _0x67a442?{'count':_0x5921a9,'rows':_0x67a442}:null;}})['then'](respondWithResult(_0x140657,null))['catch'](handleError(_0x140657,null));}; \ No newline at end of file +var _0xc535=['UserOpenchannelQueue','User','findAndCountAll','updatedAt','createdAt','format','%s/%s','SIP','openchannelPause','getTeams','addTeams','ids','Team','Agents','online','interface','sequelize','forEach','emit','userOpenchannelQueue:save','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','transaction','removeTeams','isEmpty','removeAgents','addAgents','omit','spread','isArray','userOpenchannelQueue:remove','getAgents','findOne','zip-dir','fast-json-patch','moment','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','OpenchannelQueues','error','stack','name','send','OpenchannelQueue','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','VIRTUAL','filter','options','findAll','rows','catch','show','keys','include','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','params','describe','getMembers','OpenchannelQueueId'];(function(_0x18b12a,_0x464577){var _0x4fa1b0=function(_0x7891fa){while(--_0x7891fa){_0x18b12a['push'](_0x18b12a['shift']());}};_0x4fa1b0(++_0x464577);}(_0xc535,0x13f));var _0x5c53=function(_0x3781b5,_0x39cc4d){_0x3781b5=_0x3781b5-0x0;var _0x34cb87=_0xc535[_0x3781b5];return _0x34cb87;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5c53('0x0'));var jsonpatch=require(_0x5c53('0x1'));var rp=require('request-promise');var moment=require(_0x5c53('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x5c53('0x3'));var sox=require(_0x5c53('0x4'));var csv=require(_0x5c53('0x5'));var ejs=require(_0x5c53('0x6'));var fs=require('fs');var fs_extra=require(_0x5c53('0x7'));var _=require(_0x5c53('0x8'));var squel=require('squel');var crypto=require(_0x5c53('0x9'));var jsforce=require(_0x5c53('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x5c53('0x5'));var querystring=require(_0x5c53('0xb'));var Papa=require(_0x5c53('0xc'));var Redis=require(_0x5c53('0xd'));var authService=require(_0x5c53('0xe'));var qs=require(_0x5c53('0xf'));var as=require(_0x5c53('0x10'));var hardwareService=require(_0x5c53('0x11'));var logger=require(_0x5c53('0x12'))('api');var utils=require(_0x5c53('0x13'));var config=require(_0x5c53('0x14'));var licenseUtil=require(_0x5c53('0x15'));var db=require(_0x5c53('0x16'))['db'];config['redis']=_[_0x5c53('0x17')](config[_0x5c53('0x18')],{'host':_0x5c53('0x19'),'port':0x18eb});var socket=require(_0x5c53('0x1a'))(new Redis(config[_0x5c53('0x18')]));require(_0x5c53('0x1b'))[_0x5c53('0x1c')](socket);function respondWithStatusCode(_0x5650ca,_0x1c3012){_0x1c3012=_0x1c3012||0xcc;return function(_0xd32e3d){if(_0xd32e3d){return _0x5650ca[_0x5c53('0x1d')](_0x1c3012);}return _0x5650ca['status'](_0x1c3012)[_0x5c53('0x1e')]();};}function respondWithResult(_0x43309f,_0x5249e0){_0x5249e0=_0x5249e0||0xc8;return function(_0x521a17){if(_0x521a17){return _0x43309f[_0x5c53('0x1f')](_0x5249e0)[_0x5c53('0x20')](_0x521a17);}};}function respondWithFilteredResult(_0x311c10,_0x4b0efa){return function(_0x3e2793){if(_0x3e2793){var _0x598c24=typeof _0x4b0efa[_0x5c53('0x21')]===_0x5c53('0x22')&&typeof _0x4b0efa[_0x5c53('0x23')]==='undefined';var _0x95762c=_0x3e2793['count'];var _0x5d4bf4=_0x598c24?0x0:_0x4b0efa[_0x5c53('0x21')];var _0x2abbc9=_0x598c24?_0x3e2793[_0x5c53('0x24')]:_0x4b0efa[_0x5c53('0x21')]+_0x4b0efa[_0x5c53('0x23')];var _0x33fb7b;if(_0x2abbc9>=_0x95762c){_0x2abbc9=_0x95762c;_0x33fb7b=0xc8;}else{_0x33fb7b=0xce;}_0x311c10['status'](_0x33fb7b);return _0x311c10[_0x5c53('0x25')](_0x5c53('0x26'),_0x5d4bf4+'-'+_0x2abbc9+'/'+_0x95762c)['json'](_0x3e2793);}return null;};}function patchUpdates(_0x2bfcd1){return function(_0x981f88){try{jsonpatch['apply'](_0x981f88,_0x2bfcd1,!![]);}catch(_0x2f9931){return BPromise[_0x5c53('0x27')](_0x2f9931);}return _0x981f88['save']();};}function saveUpdates(_0x4d3f69,_0x928fd1){return function(_0x3100aa){if(_0x3100aa){return _0x3100aa[_0x5c53('0x28')](_0x4d3f69)[_0x5c53('0x29')](function(_0x48fa61){return _0x48fa61;});}return null;};}function removeEntity(_0x4c2748,_0x163737){return function(_0x4eb6f7){if(_0x4eb6f7){return _0x4eb6f7[_0x5c53('0x2a')]()[_0x5c53('0x29')](function(){var _0x4929bc=_0x4eb6f7['get']({'plain':!![]});var _0x36e4dc=_0x5c53('0x2b');return db['UserProfileResource'][_0x5c53('0x2a')]({'where':{'type':_0x36e4dc,'resourceId':_0x4929bc['id']}})['then'](function(){return _0x4eb6f7;});})[_0x5c53('0x29')](function(){_0x4c2748[_0x5c53('0x1f')](0xcc)[_0x5c53('0x1e')]();});}};}function handleEntityNotFound(_0x3be3cd,_0x4470e6){return function(_0xde2c7b){if(!_0xde2c7b){_0x3be3cd[_0x5c53('0x1d')](0x194);}return _0xde2c7b;};}function handleError(_0x18110c,_0x2de88e){_0x2de88e=_0x2de88e||0x1f4;return function(_0x139a50){logger[_0x5c53('0x2c')](_0x139a50[_0x5c53('0x2d')]);if(_0x139a50[_0x5c53('0x2e')]){delete _0x139a50[_0x5c53('0x2e')];}_0x18110c[_0x5c53('0x1f')](_0x2de88e)[_0x5c53('0x2f')](_0x139a50);};}exports['index']=function(_0x4d049e,_0x5b3d2a){var _0x4caf53={},_0x9bb7f={},_0x7e8b19={'count':0x0,'rows':[]};var _0x4735c8=_['map'](db[_0x5c53('0x30')][_0x5c53('0x31')],function(_0x2d3934){return{'name':_0x2d3934[_0x5c53('0x32')],'type':_0x2d3934[_0x5c53('0x33')][_0x5c53('0x34')]};});_0x9bb7f[_0x5c53('0x35')]=_['map'](_0x4735c8,'name');_0x9bb7f[_0x5c53('0x36')]=_['keys'](_0x4d049e['query']);_0x9bb7f[_0x5c53('0x37')]=_[_0x5c53('0x38')](_0x9bb7f[_0x5c53('0x35')],_0x9bb7f[_0x5c53('0x36')]);_0x4caf53[_0x5c53('0x39')]=_[_0x5c53('0x38')](_0x9bb7f['model'],qs[_0x5c53('0x3a')](_0x4d049e[_0x5c53('0x36')]['fields']));_0x4caf53[_0x5c53('0x39')]=_0x4caf53[_0x5c53('0x39')][_0x5c53('0x3b')]?_0x4caf53[_0x5c53('0x39')]:_0x9bb7f[_0x5c53('0x35')];if(!_0x4d049e[_0x5c53('0x36')][_0x5c53('0x3c')](_0x5c53('0x3d'))){_0x4caf53[_0x5c53('0x23')]=qs[_0x5c53('0x23')](_0x4d049e[_0x5c53('0x36')]['limit']);_0x4caf53[_0x5c53('0x21')]=qs[_0x5c53('0x21')](_0x4d049e[_0x5c53('0x36')][_0x5c53('0x21')]);}_0x4caf53[_0x5c53('0x3e')]=qs[_0x5c53('0x3f')](_0x4d049e[_0x5c53('0x36')][_0x5c53('0x3f')]);_0x4caf53[_0x5c53('0x40')]=qs[_0x5c53('0x37')](_[_0x5c53('0x41')](_0x4d049e[_0x5c53('0x36')],_0x9bb7f[_0x5c53('0x37')]),_0x4735c8);if(_0x4d049e[_0x5c53('0x36')]['filter']){_0x4caf53[_0x5c53('0x40')]=_[_0x5c53('0x42')](_0x4caf53[_0x5c53('0x40')],{'$or':_[_0x5c53('0x43')](_0x4735c8,function(_0x1899b9){if(_0x1899b9[_0x5c53('0x33')]!==_0x5c53('0x44')){var _0x55ddf1={};_0x55ddf1[_0x1899b9[_0x5c53('0x2e')]]={'$like':'%'+_0x4d049e[_0x5c53('0x36')][_0x5c53('0x45')]+'%'};return _0x55ddf1;}})});}_0x4caf53=_['merge']({},_0x4caf53,_0x4d049e[_0x5c53('0x46')]);var _0x4819e5={'where':_0x4caf53['where']};return db[_0x5c53('0x30')][_0x5c53('0x24')](_0x4819e5)[_0x5c53('0x29')](function(_0x21495b){_0x7e8b19[_0x5c53('0x24')]=_0x21495b;if(_0x4d049e[_0x5c53('0x36')]['includeAll']){_0x4caf53['include']=[{'all':!![]}];}return db[_0x5c53('0x30')][_0x5c53('0x47')](_0x4caf53);})[_0x5c53('0x29')](function(_0x4eb20c){_0x7e8b19[_0x5c53('0x48')]=_0x4eb20c;return _0x7e8b19;})[_0x5c53('0x29')](respondWithFilteredResult(_0x5b3d2a,_0x4caf53))[_0x5c53('0x49')](handleError(_0x5b3d2a,null));};exports[_0x5c53('0x4a')]=function(_0x168138,_0x468df6){var _0xcff7a5={'raw':!![],'where':{'id':_0x168138['params']['id']}},_0x49937b={};_0x49937b['model']=_[_0x5c53('0x4b')](db[_0x5c53('0x30')]['rawAttributes']);_0x49937b[_0x5c53('0x36')]=_[_0x5c53('0x4b')](_0x168138[_0x5c53('0x36')]);_0x49937b['filters']=_[_0x5c53('0x38')](_0x49937b[_0x5c53('0x35')],_0x49937b[_0x5c53('0x36')]);_0xcff7a5[_0x5c53('0x39')]=_[_0x5c53('0x38')](_0x49937b[_0x5c53('0x35')],qs[_0x5c53('0x3a')](_0x168138['query'][_0x5c53('0x3a')]));_0xcff7a5[_0x5c53('0x39')]=_0xcff7a5[_0x5c53('0x39')][_0x5c53('0x3b')]?_0xcff7a5['attributes']:_0x49937b[_0x5c53('0x35')];if(_0x168138[_0x5c53('0x36')]['includeAll']){_0xcff7a5[_0x5c53('0x4c')]=[{'all':!![]}];}_0xcff7a5=_[_0x5c53('0x42')]({},_0xcff7a5,_0x168138[_0x5c53('0x46')]);return db[_0x5c53('0x30')]['find'](_0xcff7a5)[_0x5c53('0x29')](handleEntityNotFound(_0x468df6,null))[_0x5c53('0x29')](respondWithResult(_0x468df6,null))[_0x5c53('0x49')](handleError(_0x468df6,null));};exports['create']=function(_0x3fa8f1,_0x550906){return db[_0x5c53('0x30')][_0x5c53('0x4d')](_0x3fa8f1[_0x5c53('0x4e')],{})['then'](function(_0x282883){var _0x118289=_0x3fa8f1['user'][_0x5c53('0x4f')]({'plain':!![]});if(!_0x118289)throw new Error(_0x5c53('0x50'));if(_0x118289[_0x5c53('0x51')]===_0x5c53('0x52')){var _0x57dc68=_0x282883[_0x5c53('0x4f')]({'plain':!![]});var _0x251ab6=_0x5c53('0x2b');return db[_0x5c53('0x53')][_0x5c53('0x54')]({'where':{'name':_0x251ab6,'userProfileId':_0x118289['userProfileId']},'raw':!![]})[_0x5c53('0x29')](function(_0x6b51e4){if(_0x6b51e4&&_0x6b51e4['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x57dc68[_0x5c53('0x2e')],'resourceId':_0x57dc68['id'],'type':_0x6b51e4[_0x5c53('0x2e')],'sectionId':_0x6b51e4['id']},{})[_0x5c53('0x29')](function(){return _0x282883;});}else{return _0x282883;}})[_0x5c53('0x49')](function(_0x252e44){logger[_0x5c53('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x252e44);throw _0x252e44;});}return _0x282883;})[_0x5c53('0x29')](respondWithResult(_0x550906,0xc9))['catch'](handleError(_0x550906,null));};exports[_0x5c53('0x28')]=function(_0x24367f,_0x4a7538){if(_0x24367f['body']['id']){delete _0x24367f[_0x5c53('0x4e')]['id'];}return db[_0x5c53('0x30')][_0x5c53('0x54')]({'where':{'id':_0x24367f[_0x5c53('0x55')]['id']}})[_0x5c53('0x29')](handleEntityNotFound(_0x4a7538,null))[_0x5c53('0x29')](saveUpdates(_0x24367f['body'],null))[_0x5c53('0x29')](respondWithResult(_0x4a7538,null))[_0x5c53('0x49')](handleError(_0x4a7538,null));};exports[_0x5c53('0x2a')]=function(_0x56ca8f,_0x52ef09){return db[_0x5c53('0x30')][_0x5c53('0x54')]({'where':{'id':_0x56ca8f[_0x5c53('0x55')]['id']}})[_0x5c53('0x29')](handleEntityNotFound(_0x52ef09,null))[_0x5c53('0x29')](removeEntity(_0x52ef09,null))['catch'](handleError(_0x52ef09,null));};exports[_0x5c53('0x56')]=function(_0x1ecfd6,_0x4d5c64){return db['OpenchannelQueue']['describe']()[_0x5c53('0x29')](respondWithResult(_0x4d5c64,null))[_0x5c53('0x49')](handleError(_0x4d5c64,null));};exports[_0x5c53('0x57')]=function(_0x295f0b,_0x2c4e15,_0x13f2f9){var _0x1a5ae9={'raw':!![],'where':{}},_0x568b9b={},_0x448591;return db[_0x5c53('0x30')]['findOne']({'where':{'id':_0x295f0b[_0x5c53('0x55')]['id']}})[_0x5c53('0x29')](handleEntityNotFound(_0x2c4e15,null))[_0x5c53('0x29')](function(_0x4a223f){if(_0x4a223f){_0x448591=_0x4a223f[_0x5c53('0x4f')]({'plain':!![]});_0x568b9b[_0x5c53('0x35')]=_[_0x5c53('0x4b')](db['UserOpenchannelQueue'][_0x5c53('0x31')]);_0x568b9b[_0x5c53('0x36')]=_['keys'](_0x295f0b['query']);_0x568b9b[_0x5c53('0x37')]=_[_0x5c53('0x38')](_0x568b9b[_0x5c53('0x35')],_0x568b9b['query']);_0x1a5ae9[_0x5c53('0x39')]=_[_0x5c53('0x38')](_0x568b9b[_0x5c53('0x35')],qs[_0x5c53('0x3a')](_0x295f0b['query'][_0x5c53('0x3a')]));_0x1a5ae9[_0x5c53('0x39')]=_0x1a5ae9[_0x5c53('0x39')][_0x5c53('0x3b')]?_0x1a5ae9[_0x5c53('0x39')]:_0x568b9b[_0x5c53('0x35')];if(!_0x295f0b[_0x5c53('0x36')][_0x5c53('0x3c')](_0x5c53('0x3d'))){_0x1a5ae9[_0x5c53('0x23')]=qs[_0x5c53('0x23')](_0x295f0b[_0x5c53('0x36')][_0x5c53('0x23')]);_0x1a5ae9[_0x5c53('0x21')]=qs[_0x5c53('0x21')](_0x295f0b[_0x5c53('0x36')][_0x5c53('0x21')]);}_0x1a5ae9[_0x5c53('0x3e')]=qs[_0x5c53('0x3f')](_0x295f0b[_0x5c53('0x36')][_0x5c53('0x3f')]);_0x1a5ae9['where']=qs['filters'](_[_0x5c53('0x41')](_0x295f0b['query'],_0x568b9b['filters']));_0x1a5ae9[_0x5c53('0x40')][_0x5c53('0x58')]=_0x4a223f['id'];if(_0x295f0b[_0x5c53('0x36')]['filter']){_0x1a5ae9[_0x5c53('0x40')]=_[_0x5c53('0x42')](_0x1a5ae9['where'],{'$or':_[_0x5c53('0x43')](_0x1a5ae9['attributes'],function(_0x463a87){var _0x299df7={};_0x299df7[_0x463a87]={'$like':'%'+_0x295f0b[_0x5c53('0x36')][_0x5c53('0x45')]+'%'};return _0x299df7;})});}_0x1a5ae9=_[_0x5c53('0x42')]({},_0x1a5ae9,_0x295f0b['options']);return db[_0x5c53('0x59')]['findAll'](_0x1a5ae9);}})['then'](function(_0x22749f){if(_0x22749f){return db[_0x5c53('0x5a')][_0x5c53('0x5b')]({'where':{'id':_['map'](_0x22749f,'UserId'),'role':'agent'},'attributes':['id',_0x5c53('0x2e'),'openchannelPause',_0x5c53('0x5c'),_0x5c53('0x5d')]});}})[_0x5c53('0x29')](function(_0x289077){if(_0x289077){return{'count':_0x289077['count'],'rows':_['map'](_0x289077[_0x5c53('0x48')],function(_0x53307a){return{'membername':_0x53307a['name'],'UserId':_0x53307a['id'],'queue_name':_0x448591[_0x5c53('0x2e')],'OpenchannelQueueId':_0x448591['id'],'interface':util[_0x5c53('0x5e')](_0x5c53('0x5f'),_0x5c53('0x60'),_0x53307a['name']),'penalty':0x0,'paused':_0x53307a[_0x5c53('0x61')],'createdAt':_0x53307a['createdAt'],'updatedAt':_0x53307a[_0x5c53('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x5c53('0x29')](respondWithFilteredResult(_0x2c4e15,_0x1a5ae9))['catch'](handleError(_0x2c4e15,null));};exports[_0x5c53('0x62')]=function(_0x2f8fda,_0x22b3ae,_0x5b692a){var _0x55d76f={};var _0xf6b053={};var _0x151dfd;var _0x224dbd;return db[_0x5c53('0x30')]['findOne']({'where':{'id':_0x2f8fda[_0x5c53('0x55')]['id']}})[_0x5c53('0x29')](handleEntityNotFound(_0x22b3ae,null))[_0x5c53('0x29')](function(_0x32438e){if(_0x32438e){_0x151dfd=_0x32438e;_0xf6b053[_0x5c53('0x35')]=_[_0x5c53('0x4b')](db['Team'][_0x5c53('0x31')]);_0xf6b053['query']=_['keys'](_0x2f8fda['query']);_0xf6b053[_0x5c53('0x37')]=_[_0x5c53('0x38')](_0xf6b053['model'],_0xf6b053[_0x5c53('0x36')]);_0x55d76f[_0x5c53('0x39')]=_[_0x5c53('0x38')](_0xf6b053[_0x5c53('0x35')],qs[_0x5c53('0x3a')](_0x2f8fda[_0x5c53('0x36')][_0x5c53('0x3a')]));_0x55d76f['attributes']=_0x55d76f['attributes'][_0x5c53('0x3b')]?_0x55d76f[_0x5c53('0x39')]:_0xf6b053[_0x5c53('0x35')];_0x55d76f['order']=qs[_0x5c53('0x3f')](_0x2f8fda[_0x5c53('0x36')][_0x5c53('0x3f')]);_0x55d76f[_0x5c53('0x40')]=qs['filters'](_[_0x5c53('0x41')](_0x2f8fda['query'],_0xf6b053[_0x5c53('0x37')]));if(_0x2f8fda[_0x5c53('0x36')][_0x5c53('0x45')]){_0x55d76f[_0x5c53('0x40')]=_['merge'](_0x55d76f[_0x5c53('0x40')],{'$or':_[_0x5c53('0x43')](_0x55d76f[_0x5c53('0x39')],function(_0x4aabd6){var _0x5116b6={};_0x5116b6[_0x4aabd6]={'$like':'%'+_0x2f8fda[_0x5c53('0x36')][_0x5c53('0x45')]+'%'};return _0x5116b6;})});}_0x55d76f=_['merge']({},_0x55d76f,_0x2f8fda[_0x5c53('0x46')]);return _0x151dfd[_0x5c53('0x62')](_0x55d76f);}})[_0x5c53('0x29')](function(_0x34bb60){if(_0x34bb60){_0x224dbd=_0x34bb60[_0x5c53('0x3b')];if(!_0x2f8fda[_0x5c53('0x36')]['hasOwnProperty']('nolimit')){_0x55d76f['limit']=qs['limit'](_0x2f8fda[_0x5c53('0x36')][_0x5c53('0x23')]);_0x55d76f[_0x5c53('0x21')]=qs[_0x5c53('0x21')](_0x2f8fda[_0x5c53('0x36')]['offset']);}return _0x151dfd[_0x5c53('0x62')](_0x55d76f);}})[_0x5c53('0x29')](function(_0x5c368d){if(_0x5c368d){return _0x5c368d?{'count':_0x224dbd,'rows':_0x5c368d}:null;}})[_0x5c53('0x29')](respondWithResult(_0x22b3ae,null))[_0x5c53('0x49')](handleError(_0x22b3ae,null));};exports[_0x5c53('0x63')]=function(_0x2c4a73,_0x3255b8,_0x3db408){var _0x2624cb=_0x2c4a73[_0x5c53('0x4e')][_0x5c53('0x64')];return db[_0x5c53('0x65')][_0x5c53('0x47')]({'where':{'id':_0x2624cb},'attributes':['id'],'include':[{'model':db[_0x5c53('0x5a')],'as':_0x5c53('0x66'),'attributes':['id',_0x5c53('0x2e'),_0x5c53('0x67'),'voicePause',_0x5c53('0x68')],'raw':!![]}]})[_0x5c53('0x29')](function(_0x188810){if(_0x188810){var _0x235a7d=_['flatMap'](_0x188810,function(_0x1f2c73){var _0x118b94=_0x1f2c73[_0x5c53('0x4f')]({'plain':!![]});return _0x118b94[_0x5c53('0x66')];});return db[_0x5c53('0x30')][_0x5c53('0x54')]({'where':{'id':_0x2c4a73[_0x5c53('0x55')]['id']}})[_0x5c53('0x29')](function(_0x20dcdc){return db[_0x5c53('0x69')]['transaction'](function(_0x2c4b5c){return _0x20dcdc[_0x5c53('0x63')](_0x2624cb,{'transaction':_0x2c4b5c})[_0x5c53('0x29')](function(){return BPromise['each'](_0x235a7d,function(_0x3637eb){return db[_0x5c53('0x59')]['findOrCreate']({'where':{'UserId':_0x3637eb['id'],'OpenchannelQueueId':_0x2c4a73[_0x5c53('0x55')]['id']},'transaction':_0x2c4b5c});});})['then'](function(){_0x235a7d[_0x5c53('0x6a')](function(_0x4e2fd7){socket[_0x5c53('0x6b')](_0x5c53('0x6c'),{'UserId':_0x4e2fd7['id'],'OpenchannelQueueId':_0x20dcdc['id']});});});});});}})[_0x5c53('0x29')](respondWithStatusCode(_0x3255b8,null))['catch'](handleError(_0x3255b8,null));};exports['removeTeams']=function(_0x542553,_0x1b805f,_0x107075){return db[_0x5c53('0x65')][_0x5c53('0x47')]({'where':{'id':_0x542553['query'][_0x5c53('0x64')]},'attributes':['id'],'include':[{'model':db[_0x5c53('0x5a')],'as':_0x5c53('0x66'),'attributes':['id'],'raw':!![]}]})[_0x5c53('0x29')](handleEntityNotFound(_0x1b805f,null))[_0x5c53('0x29')](function(_0xac2966){var _0x7f2aa6=_[_0x5c53('0x43')](_0xac2966,'id');var _0x389620=[];var _0x5c7a4c=[];var _0x31df5c=squel['select']();_0x31df5c['field'](_0x5c53('0x6d'))[_0x5c53('0x6e')]('team_has_openchannel_queues','tq')[_0x5c53('0x6f')](_0x5c53('0x70'),'ut',_0x5c53('0x71'))['where']('OpenchannelQueueId\x20=\x20?',_0x542553[_0x5c53('0x55')]['id']);for(var _0x4e29e4=0x0;_0x4e29e4<_0xac2966[_0x5c53('0x3b')];_0x4e29e4+=0x1){let _0x3e8d06=_0xac2966[_0x4e29e4];for(var _0x365b90=0x0;_0x365b90<_0x3e8d06[_0x5c53('0x66')]['length'];_0x365b90+=0x1){let _0x52bd14=_0x3e8d06[_0x5c53('0x66')][_0x365b90];var _0x266617=_0x31df5c[_0x5c53('0x72')]();_0x266617['where'](_0x5c53('0x73'),_0x52bd14['id']);_0x5c7a4c[_0x5c53('0x74')](db['sequelize']['query'](_0x266617['toString'](),{'type':db[_0x5c53('0x69')][_0x5c53('0x75')][_0x5c53('0x76')]})[_0x5c53('0x29')](function(_0x591e2d){if(_0x591e2d[_0x5c53('0x3b')]===0x1){return _0x52bd14['id'];}else{var _0x839404=_[_0x5c53('0x77')](_[_0x5c53('0x43')](_0x591e2d,_0x5c53('0x78')),function(_0x398321){return _[_0x5c53('0x79')](_0x7f2aa6,_0x398321);});if(_0x839404){return _0x52bd14['id'];}}}));}}return BPromise[_0x5c53('0x7a')](_0x5c7a4c)['then'](function(_0x4e8bc0){_0x389620=_(_0x389620)['union'](_0x4e8bc0)[_0x5c53('0x7b')]()[_0x5c53('0x7c')]();return db[_0x5c53('0x30')][_0x5c53('0x54')]({'where':{'id':_0x542553[_0x5c53('0x55')]['id']}})['then'](function(_0x50b163){return db[_0x5c53('0x69')][_0x5c53('0x7d')](function(_0x1e54b3){return _0x50b163[_0x5c53('0x7e')](_0x542553[_0x5c53('0x36')][_0x5c53('0x64')],{'transaction':_0x1e54b3})[_0x5c53('0x29')](function(){if(!_[_0x5c53('0x7f')](_0x389620)){return _0x50b163[_0x5c53('0x80')](_0x389620,{'transaction':_0x1e54b3});}})[_0x5c53('0x29')](function(){_0x389620[_0x5c53('0x6a')](function(_0x5bbaa9){socket[_0x5c53('0x6b')]('userOpenchannelQueue:remove',{'UserId':_0x5bbaa9,'OpenchannelQueueId':_0x50b163['id']});});});});});});})[_0x5c53('0x29')](respondWithStatusCode(_0x1b805f,null))[_0x5c53('0x49')](handleError(_0x1b805f,null));};exports[_0x5c53('0x81')]=function(_0x41a749,_0x77845e,_0xe8e03f){return db[_0x5c53('0x30')]['find']({'where':{'id':_0x41a749[_0x5c53('0x55')]['id']}})['then'](handleEntityNotFound(_0x77845e,null))[_0x5c53('0x29')](function(_0x55d02c){if(_0x55d02c){return _0x55d02c['addAgents'](_0x41a749['body']['ids'],_[_0x5c53('0x82')](_0x41a749[_0x5c53('0x4e')],[_0x5c53('0x64'),'id'])||{})[_0x5c53('0x83')](function(_0x5773d7){for(var _0x135926=0x0;_0x135926<_0x41a749[_0x5c53('0x4e')][_0x5c53('0x64')][_0x5c53('0x3b')];_0x135926+=0x1){socket[_0x5c53('0x6b')]('userOpenchannelQueue:save',{'UserId':Number(_0x41a749[_0x5c53('0x4e')][_0x5c53('0x64')][_0x135926]),'OpenchannelQueueId':Number(_0x41a749[_0x5c53('0x55')]['id'])});}return _0x5773d7;});}})['then'](respondWithResult(_0x77845e,null))[_0x5c53('0x49')](handleError(_0x77845e,null));};exports[_0x5c53('0x80')]=function(_0x6ce411,_0x39a489,_0x1713e4){return db[_0x5c53('0x30')][_0x5c53('0x54')]({'where':{'id':_0x6ce411[_0x5c53('0x55')]['id']}})['then'](handleEntityNotFound(_0x39a489,null))[_0x5c53('0x29')](function(_0x40bf18){if(_0x40bf18){return _0x40bf18[_0x5c53('0x80')](_0x6ce411[_0x5c53('0x36')][_0x5c53('0x64')])[_0x5c53('0x29')](function(){if(_[_0x5c53('0x84')](_0x6ce411[_0x5c53('0x36')][_0x5c53('0x64')])){for(var _0x6646c1=0x0;_0x6646c1<_0x6ce411[_0x5c53('0x36')]['ids'][_0x5c53('0x3b')];_0x6646c1+=0x1){socket['emit'](_0x5c53('0x85'),{'UserId':Number(_0x6ce411[_0x5c53('0x36')]['ids'][_0x6646c1]),'OpenchannelQueueId':Number(_0x6ce411[_0x5c53('0x55')]['id'])});}}else{socket[_0x5c53('0x6b')](_0x5c53('0x85'),{'UserId':Number(_0x6ce411['query']['ids']),'OpenchannelQueueId':Number(_0x6ce411[_0x5c53('0x55')]['id'])});}});}})[_0x5c53('0x29')](respondWithStatusCode(_0x39a489,null))['catch'](handleError(_0x39a489,null));};exports[_0x5c53('0x86')]=function(_0x21822e,_0x26267b,_0x14a03a){var _0x3ff43b={};var _0x44a9c3={};var _0x254bc1;var _0x381466;return db['OpenchannelQueue'][_0x5c53('0x87')]({'where':{'id':_0x21822e[_0x5c53('0x55')]['id']}})['then'](handleEntityNotFound(_0x26267b,null))[_0x5c53('0x29')](function(_0x1a8ae7){if(_0x1a8ae7){_0x254bc1=_0x1a8ae7;_0x44a9c3[_0x5c53('0x35')]=_[_0x5c53('0x4b')](db[_0x5c53('0x5a')][_0x5c53('0x31')]);_0x44a9c3[_0x5c53('0x36')]=_[_0x5c53('0x4b')](_0x21822e[_0x5c53('0x36')]);_0x44a9c3[_0x5c53('0x37')]=_[_0x5c53('0x38')](_0x44a9c3[_0x5c53('0x35')],_0x44a9c3[_0x5c53('0x36')]);_0x3ff43b['attributes']=_['intersection'](_0x44a9c3[_0x5c53('0x35')],qs[_0x5c53('0x3a')](_0x21822e['query'][_0x5c53('0x3a')]));_0x3ff43b[_0x5c53('0x39')]=_0x3ff43b[_0x5c53('0x39')][_0x5c53('0x3b')]?_0x3ff43b[_0x5c53('0x39')]:_0x44a9c3[_0x5c53('0x35')];_0x3ff43b['order']=qs[_0x5c53('0x3f')](_0x21822e['query'][_0x5c53('0x3f')]);_0x3ff43b['where']=qs[_0x5c53('0x37')](_[_0x5c53('0x41')](_0x21822e[_0x5c53('0x36')],_0x44a9c3[_0x5c53('0x37')]));if(_0x21822e[_0x5c53('0x36')]['filter']){_0x3ff43b[_0x5c53('0x40')]=_['merge'](_0x3ff43b['where'],{'$or':_[_0x5c53('0x43')](_0x3ff43b[_0x5c53('0x39')],function(_0x2ab7f3){var _0xa5c7f7={};_0xa5c7f7[_0x2ab7f3]={'$like':'%'+_0x21822e[_0x5c53('0x36')][_0x5c53('0x45')]+'%'};return _0xa5c7f7;})});}_0x3ff43b=_[_0x5c53('0x42')]({},_0x3ff43b,_0x21822e[_0x5c53('0x46')]);return _0x254bc1['getAgents'](_0x3ff43b);}})['then'](function(_0x344c52){if(_0x344c52){_0x381466=_0x344c52[_0x5c53('0x3b')];if(!_0x21822e[_0x5c53('0x36')][_0x5c53('0x3c')](_0x5c53('0x3d'))){_0x3ff43b[_0x5c53('0x23')]=qs[_0x5c53('0x23')](_0x21822e[_0x5c53('0x36')][_0x5c53('0x23')]);_0x3ff43b[_0x5c53('0x21')]=qs[_0x5c53('0x21')](_0x21822e['query'][_0x5c53('0x21')]);}return _0x254bc1[_0x5c53('0x86')](_0x3ff43b);}})[_0x5c53('0x29')](function(_0x5204ff){if(_0x5204ff){return _0x5204ff?{'count':_0x381466,'rows':_0x5204ff}:null;}})['then'](respondWithResult(_0x26267b,null))[_0x5c53('0x49')](handleError(_0x26267b,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 52649df..d11b54d 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 _0xe8c1=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','OpenchannelQueue'];(function(_0x54276,_0x1a4ffa){var _0x3d741d=function(_0x4f7cbd){while(--_0x4f7cbd){_0x54276['push'](_0x54276['shift']());}};_0x3d741d(++_0x1a4ffa);}(_0xe8c1,0xbe));var _0x1e8c=function(_0x35fb56,_0x5dadff){_0x35fb56=_0x35fb56-0x0;var _0x2fd52c=_0xe8c1[_0x35fb56];return _0x2fd52c;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0x1e8c('0x0'))['db'][_0x1e8c('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x1e8c('0x2'),'afterDestroy':_0x1e8c('0x3')};function emitEvent(_0x2e8810){return function(_0x593578,_0x4bd5cc,_0x32b787){OpenchannelQueueEvents[_0x1e8c('0x4')](_0x2e8810+':'+_0x593578['id'],_0x593578);OpenchannelQueueEvents[_0x1e8c('0x4')](_0x2e8810,_0x593578);_0x32b787(null);};}for(var e in events){if(events[_0x1e8c('0x5')](e)){var event=events[e];OpenchannelQueue[_0x1e8c('0x6')](e,emitEvent(event));}}module[_0x1e8c('0x7')]=OpenchannelQueueEvents; \ No newline at end of file +var _0xdcb7=['setMaxListeners','update','emit','exports','events','OpenchannelQueue'];(function(_0x114720,_0x100b90){var _0x482582=function(_0x2998e3){while(--_0x2998e3){_0x114720['push'](_0x114720['shift']());}};_0x482582(++_0x100b90);}(_0xdcb7,0xc4));var _0x7dcb=function(_0x40b2ce,_0x97223c){_0x40b2ce=_0x40b2ce-0x0;var _0x3ed488=_0xdcb7[_0x40b2ce];return _0x3ed488;};'use strict';var EventEmitter=require(_0x7dcb('0x0'));var OpenchannelQueue=require('../../mysqldb')['db'][_0x7dcb('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x7dcb('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7dcb('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3f34fb){return function(_0x13720b,_0x24a133,_0x3dcfc7){OpenchannelQueueEvents[_0x7dcb('0x4')](_0x3f34fb+':'+_0x13720b['id'],_0x13720b);OpenchannelQueueEvents[_0x7dcb('0x4')](_0x3f34fb,_0x13720b);_0x3dcfc7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0x7dcb('0x5')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 012e73d..a6bbfa1 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 _0xe62e=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues'];(function(_0x3ad70f,_0x20063e){var _0x32fb64=function(_0x1473b4){while(--_0x1473b4){_0x3ad70f['push'](_0x3ad70f['shift']());}};_0x32fb64(++_0x20063e);}(_0xe62e,0x118));var _0xee62=function(_0x16fc99,_0x23589d){_0x16fc99=_0x16fc99-0x0;var _0x8ed00a=_0xe62e[_0x16fc99];return _0x8ed00a;};'use strict';var _=require(_0xee62('0x0'));var util=require(_0xee62('0x1'));var logger=require(_0xee62('0x2'))(_0xee62('0x3'));var moment=require('moment');var BPromise=require(_0xee62('0x4'));var rp=require(_0xee62('0x5'));var fs=require('fs');var path=require(_0xee62('0x6'));var rimraf=require(_0xee62('0x7'));var config=require(_0xee62('0x8'));var attributes=require(_0xee62('0x9'));module[_0xee62('0xa')]=function(_0x13e563,_0x116966){return _0x13e563[_0xee62('0xb')](_0xee62('0xc'),attributes,{'tableName':_0xee62('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2fb5=['path','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x2fd285,_0x5e6f64){var _0x50fe1a=function(_0x4a8558){while(--_0x4a8558){_0x2fd285['push'](_0x2fd285['shift']());}};_0x50fe1a(++_0x5e6f64);}(_0x2fb5,0x8a));var _0x52fb=function(_0x56a871,_0x18b7fe){_0x56a871=_0x56a871-0x0;var _0x124954=_0x2fb5[_0x56a871];return _0x124954;};'use strict';var _=require(_0x52fb('0x0'));var util=require('util');var logger=require(_0x52fb('0x1'))('api');var moment=require(_0x52fb('0x2'));var BPromise=require(_0x52fb('0x3'));var rp=require(_0x52fb('0x4'));var fs=require('fs');var path=require(_0x52fb('0x5'));var rimraf=require('rimraf');var config=require(_0x52fb('0x6'));var attributes=require(_0x52fb('0x7'));module[_0x52fb('0x8')]=function(_0x59c2aa,_0x4701cb){return _0x59c2aa[_0x52fb('0x9')](_0x52fb('0xa'),attributes,{'tableName':'openchannel_queues','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 6e1d47d..8d3fc84 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 _0xb56e=['model','debug','GetOpenchannelQueue','catch','find','ShowOpenchannelQueue','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','OpenchannelQueue','findAll','options','raw','where','attributes','limit','map','include'];(function(_0x23f8d2,_0x301fec){var _0x5d174b=function(_0x2c3c9e){while(--_0x2c3c9e){_0x23f8d2['push'](_0x23f8d2['shift']());}};_0x5d174b(++_0x301fec);}(_0xb56e,0x18c));var _0xeb56=function(_0x37b136,_0x46b3e8){_0x37b136=_0x37b136-0x0;var _0x4a7a95=_0xb56e[_0x37b136];return _0x4a7a95;};'use strict';var _=require(_0xeb56('0x0'));var util=require(_0xeb56('0x1'));var moment=require(_0xeb56('0x2'));var BPromise=require(_0xeb56('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeb56('0x4'));var db=require(_0xeb56('0x5'))['db'];var utils=require(_0xeb56('0x6'));var logger=require('../../config/logger')(_0xeb56('0x7'));var config=require(_0xeb56('0x8'));var jayson=require(_0xeb56('0x9'));var client=jayson[_0xeb56('0xa')][_0xeb56('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xeb56('0xc')],{'host':_0xeb56('0xd'),'port':0x18eb});var socket=require(_0xeb56('0xe'))(new Redis(config[_0xeb56('0xc')]));require('./openchannelQueue.socket')[_0xeb56('0xf')](socket);function respondWithRpcPromise(_0x3cbb6d,_0x517d1a,_0x5b7a17){return new BPromise(function(_0x30e208,_0x15fd22){return client['request'](_0x3cbb6d,_0x5b7a17)[_0xeb56('0x10')](function(_0x5347e6){logger[_0xeb56('0x11')](_0xeb56('0x12'),_0x517d1a,_0xeb56('0x13'));logger['debug']('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x517d1a,'request\x20sent',JSON[_0xeb56('0x14')](_0x5347e6));if(_0x5347e6[_0xeb56('0x15')]){if(_0x5347e6[_0xeb56('0x15')][_0xeb56('0x16')]===0x1f4){logger[_0xeb56('0x15')](_0xeb56('0x12'),_0x517d1a,_0x5347e6[_0xeb56('0x15')][_0xeb56('0x17')]);return _0x15fd22(_0x5347e6[_0xeb56('0x15')][_0xeb56('0x17')]);}logger[_0xeb56('0x15')](_0xeb56('0x12'),_0x517d1a,_0x5347e6[_0xeb56('0x15')][_0xeb56('0x17')]);return _0x30e208(_0x5347e6[_0xeb56('0x15')][_0xeb56('0x17')]);}else{logger[_0xeb56('0x11')]('OpenchannelQueue,\x20%s,\x20%s',_0x517d1a,'request\x20sent');_0x30e208(_0x5347e6['result'][_0xeb56('0x17')]);}})['catch'](function(_0x467278){logger[_0xeb56('0x15')](_0xeb56('0x12'),_0x517d1a,_0x467278);_0x15fd22(_0x467278);});});}exports['GetOpenchannelQueue']=function(_0x328a50){var _0x5caa41=this;return new Promise(function(_0x3b9cb7,_0x14d580){return db[_0xeb56('0x18')][_0xeb56('0x19')]({'raw':_0x328a50[_0xeb56('0x1a')]?_0x328a50['options'][_0xeb56('0x1b')]===undefined?!![]:![]:!![],'where':_0x328a50['options']?_0x328a50[_0xeb56('0x1a')][_0xeb56('0x1c')]||null:null,'attributes':_0x328a50['options']?_0x328a50[_0xeb56('0x1a')][_0xeb56('0x1d')]||null:null,'limit':_0x328a50['options']?_0x328a50['options'][_0xeb56('0x1e')]||null:null,'include':_0x328a50[_0xeb56('0x1a')]?_0x328a50[_0xeb56('0x1a')]['include']?_[_0xeb56('0x1f')](_0x328a50['options'][_0xeb56('0x20')],function(_0x4d202c){return{'model':db[_0x4d202c[_0xeb56('0x21')]],'as':_0x4d202c['as'],'attributes':_0x4d202c[_0xeb56('0x1d')],'include':_0x4d202c[_0xeb56('0x20')]?_['map'](_0x4d202c[_0xeb56('0x20')],function(_0x2a9557){return{'model':db[_0x2a9557[_0xeb56('0x21')]],'as':_0x2a9557['as'],'attributes':_0x2a9557[_0xeb56('0x1d')],'include':_0x2a9557[_0xeb56('0x20')]?_[_0xeb56('0x1f')](_0x2a9557['include'],function(_0x3dd1ed){return{'model':db[_0x3dd1ed[_0xeb56('0x21')]],'as':_0x3dd1ed['as'],'attributes':_0x3dd1ed[_0xeb56('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xeb56('0x10')](function(_0x2de284){logger[_0xeb56('0x11')]('GetOpenchannelQueue',_0x328a50);logger[_0xeb56('0x22')](_0xeb56('0x23'),_0x328a50,JSON[_0xeb56('0x14')](_0x2de284));_0x3b9cb7(_0x2de284);})[_0xeb56('0x24')](function(_0x493f50){logger[_0xeb56('0x15')](_0xeb56('0x23'),_0x493f50['message'],_0x328a50);_0x14d580(_0x5caa41['error'](0x1f4,_0x493f50[_0xeb56('0x17')]));});});};exports['ShowOpenchannelQueue']=function(_0x1630b4){var _0x291ff9=this;return new Promise(function(_0x22a1de,_0x347bc5){return db[_0xeb56('0x18')][_0xeb56('0x25')]({'raw':_0x1630b4[_0xeb56('0x1a')]?_0x1630b4[_0xeb56('0x1a')][_0xeb56('0x1b')]===undefined?!![]:![]:!![],'where':_0x1630b4[_0xeb56('0x1a')]?_0x1630b4[_0xeb56('0x1a')]['where']||null:null,'attributes':_0x1630b4[_0xeb56('0x1a')]?_0x1630b4[_0xeb56('0x1a')][_0xeb56('0x1d')]||null:null,'include':_0x1630b4[_0xeb56('0x1a')]?_0x1630b4[_0xeb56('0x1a')][_0xeb56('0x20')]?_['map'](_0x1630b4[_0xeb56('0x1a')][_0xeb56('0x20')],function(_0x593c0f){return{'model':db[_0x593c0f[_0xeb56('0x21')]],'as':_0x593c0f['as'],'attributes':_0x593c0f[_0xeb56('0x1d')],'include':_0x593c0f[_0xeb56('0x20')]?_[_0xeb56('0x1f')](_0x593c0f['include'],function(_0x48fc40){return{'model':db[_0x48fc40[_0xeb56('0x21')]],'as':_0x48fc40['as'],'attributes':_0x48fc40[_0xeb56('0x1d')],'include':_0x48fc40[_0xeb56('0x20')]?_['map'](_0x48fc40[_0xeb56('0x20')],function(_0x27d45a){return{'model':db[_0x27d45a[_0xeb56('0x21')]],'as':_0x27d45a['as'],'attributes':_0x27d45a[_0xeb56('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xeb56('0x10')](function(_0x28bed1){logger[_0xeb56('0x11')](_0xeb56('0x26'),_0x1630b4);logger[_0xeb56('0x22')](_0xeb56('0x26'),_0x1630b4,JSON[_0xeb56('0x14')](_0x28bed1));_0x22a1de(_0x28bed1);})[_0xeb56('0x24')](function(_0xc9d5af){logger[_0xeb56('0x15')](_0xeb56('0x26'),_0xc9d5af['message'],_0x1630b4);_0x347bc5(_0x291ff9[_0xeb56('0x15')](0x1f4,_0xc9d5af[_0xeb56('0x17')]));});});}; \ No newline at end of file +var _0xe80f=['jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','include','map','model','stringify','catch','ShowOpenchannelQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x35bfbd,_0x1f5eaf){var _0x4b083f=function(_0x488457){while(--_0x488457){_0x35bfbd['push'](_0x35bfbd['shift']());}};_0x4b083f(++_0x1f5eaf);}(_0xe80f,0x76));var _0xfe80=function(_0x12adb5,_0x18631d){_0x12adb5=_0x12adb5-0x0;var _0x7e5aff=_0xe80f[_0x12adb5];return _0x7e5aff;};'use strict';var _=require(_0xfe80('0x0'));var util=require(_0xfe80('0x1'));var moment=require(_0xfe80('0x2'));var BPromise=require(_0xfe80('0x3'));var rs=require(_0xfe80('0x4'));var fs=require('fs');var Redis=require(_0xfe80('0x5'));var db=require(_0xfe80('0x6'))['db'];var utils=require(_0xfe80('0x7'));var logger=require(_0xfe80('0x8'))(_0xfe80('0x9'));var config=require(_0xfe80('0xa'));var jayson=require(_0xfe80('0xb'));var client=jayson[_0xfe80('0xc')][_0xfe80('0xd')]({'port':0x232a});config['redis']=_[_0xfe80('0xe')](config[_0xfe80('0xf')],{'host':_0xfe80('0x10'),'port':0x18eb});var socket=require(_0xfe80('0x11'))(new Redis(config['redis']));require(_0xfe80('0x12'))[_0xfe80('0x13')](socket);function respondWithRpcPromise(_0x1e7b86,_0x2baefc,_0x1b435e){return new BPromise(function(_0xf0f4c0,_0x3bf73c){return client[_0xfe80('0x14')](_0x1e7b86,_0x1b435e)[_0xfe80('0x15')](function(_0x46ac17){logger[_0xfe80('0x16')](_0xfe80('0x17'),_0x2baefc,_0xfe80('0x18'));logger[_0xfe80('0x19')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x2baefc,'request\x20sent',JSON['stringify'](_0x46ac17));if(_0x46ac17[_0xfe80('0x1a')]){if(_0x46ac17[_0xfe80('0x1a')][_0xfe80('0x1b')]===0x1f4){logger[_0xfe80('0x1a')](_0xfe80('0x17'),_0x2baefc,_0x46ac17[_0xfe80('0x1a')][_0xfe80('0x1c')]);return _0x3bf73c(_0x46ac17[_0xfe80('0x1a')][_0xfe80('0x1c')]);}logger[_0xfe80('0x1a')](_0xfe80('0x17'),_0x2baefc,_0x46ac17[_0xfe80('0x1a')][_0xfe80('0x1c')]);return _0xf0f4c0(_0x46ac17['error'][_0xfe80('0x1c')]);}else{logger['info'](_0xfe80('0x17'),_0x2baefc,_0xfe80('0x18'));_0xf0f4c0(_0x46ac17[_0xfe80('0x1d')][_0xfe80('0x1c')]);}})['catch'](function(_0x38eea0){logger[_0xfe80('0x1a')](_0xfe80('0x17'),_0x2baefc,_0x38eea0);_0x3bf73c(_0x38eea0);});});}exports[_0xfe80('0x1e')]=function(_0x1a30e0){var _0x15260a=this;return new Promise(function(_0x1dfc85,_0x2725df){return db[_0xfe80('0x1f')][_0xfe80('0x20')]({'raw':_0x1a30e0['options']?_0x1a30e0[_0xfe80('0x21')][_0xfe80('0x22')]===undefined?!![]:![]:!![],'where':_0x1a30e0['options']?_0x1a30e0[_0xfe80('0x21')][_0xfe80('0x23')]||null:null,'attributes':_0x1a30e0[_0xfe80('0x21')]?_0x1a30e0[_0xfe80('0x21')][_0xfe80('0x24')]||null:null,'limit':_0x1a30e0[_0xfe80('0x21')]?_0x1a30e0[_0xfe80('0x21')]['limit']||null:null,'include':_0x1a30e0['options']?_0x1a30e0[_0xfe80('0x21')][_0xfe80('0x25')]?_[_0xfe80('0x26')](_0x1a30e0[_0xfe80('0x21')][_0xfe80('0x25')],function(_0x31b257){return{'model':db[_0x31b257['model']],'as':_0x31b257['as'],'attributes':_0x31b257[_0xfe80('0x24')],'include':_0x31b257[_0xfe80('0x25')]?_[_0xfe80('0x26')](_0x31b257[_0xfe80('0x25')],function(_0x2db0eb){return{'model':db[_0x2db0eb[_0xfe80('0x27')]],'as':_0x2db0eb['as'],'attributes':_0x2db0eb['attributes'],'include':_0x2db0eb[_0xfe80('0x25')]?_['map'](_0x2db0eb[_0xfe80('0x25')],function(_0x1f088e){return{'model':db[_0x1f088e[_0xfe80('0x27')]],'as':_0x1f088e['as'],'attributes':_0x1f088e[_0xfe80('0x24')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x59947a){logger[_0xfe80('0x16')]('GetOpenchannelQueue',_0x1a30e0);logger[_0xfe80('0x19')]('GetOpenchannelQueue',_0x1a30e0,JSON[_0xfe80('0x28')](_0x59947a));_0x1dfc85(_0x59947a);})[_0xfe80('0x29')](function(_0x2862dc){logger['error']('GetOpenchannelQueue',_0x2862dc[_0xfe80('0x1c')],_0x1a30e0);_0x2725df(_0x15260a[_0xfe80('0x1a')](0x1f4,_0x2862dc[_0xfe80('0x1c')]));});});};exports[_0xfe80('0x2a')]=function(_0xf4b35f){var _0x2fffdd=this;return new Promise(function(_0x320a51,_0x432592){return db['OpenchannelQueue']['find']({'raw':_0xf4b35f[_0xfe80('0x21')]?_0xf4b35f[_0xfe80('0x21')][_0xfe80('0x22')]===undefined?!![]:![]:!![],'where':_0xf4b35f[_0xfe80('0x21')]?_0xf4b35f[_0xfe80('0x21')][_0xfe80('0x23')]||null:null,'attributes':_0xf4b35f[_0xfe80('0x21')]?_0xf4b35f[_0xfe80('0x21')][_0xfe80('0x24')]||null:null,'include':_0xf4b35f['options']?_0xf4b35f[_0xfe80('0x21')][_0xfe80('0x25')]?_[_0xfe80('0x26')](_0xf4b35f[_0xfe80('0x21')][_0xfe80('0x25')],function(_0x509662){return{'model':db[_0x509662[_0xfe80('0x27')]],'as':_0x509662['as'],'attributes':_0x509662[_0xfe80('0x24')],'include':_0x509662[_0xfe80('0x25')]?_['map'](_0x509662[_0xfe80('0x25')],function(_0x15b408){return{'model':db[_0x15b408[_0xfe80('0x27')]],'as':_0x15b408['as'],'attributes':_0x15b408[_0xfe80('0x24')],'include':_0x15b408[_0xfe80('0x25')]?_[_0xfe80('0x26')](_0x15b408['include'],function(_0x294b60){return{'model':db[_0x294b60[_0xfe80('0x27')]],'as':_0x294b60['as'],'attributes':_0x294b60['attributes']};}):[]};}):[]};}):[]:[]})[_0xfe80('0x15')](function(_0x513db5){logger[_0xfe80('0x16')](_0xfe80('0x2a'),_0xf4b35f);logger[_0xfe80('0x19')]('ShowOpenchannelQueue',_0xf4b35f,JSON[_0xfe80('0x28')](_0x513db5));_0x320a51(_0x513db5);})[_0xfe80('0x29')](function(_0x4b70aa){logger['error']('ShowOpenchannelQueue',_0x4b70aa[_0xfe80('0x1c')],_0xf4b35f);_0x432592(_0x2fffdd[_0xfe80('0x1a')](0x1f4,_0x4b70aa[_0xfe80('0x1c')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index affb4d9..2b8a0a7 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 _0xa273=['openchannelQueue:','./openchannelQueue.events','remove','emit','removeListener','register','length'];(function(_0x4e84a8,_0x1e04d3){var _0x17c24f=function(_0x3f97d7){while(--_0x3f97d7){_0x4e84a8['push'](_0x4e84a8['shift']());}};_0x17c24f(++_0x1e04d3);}(_0xa273,0xf6));var _0x3a27=function(_0x46faaa,_0x10d92c){_0x46faaa=_0x46faaa-0x0;var _0x2d10e4=_0xa273[_0x46faaa];return _0x2d10e4;};'use strict';var OpenchannelQueueEvents=require(_0x3a27('0x0'));var events=['save',_0x3a27('0x1'),'update'];function createListener(_0x1d3b92,_0x5a7cd2){return function(_0x44fb89){_0x5a7cd2[_0x3a27('0x2')](_0x1d3b92,_0x44fb89);};}function removeListener(_0x226758,_0x1614e9){return function(){OpenchannelQueueEvents[_0x3a27('0x3')](_0x226758,_0x1614e9);};}exports[_0x3a27('0x4')]=function(_0x25a070){for(var _0x68e7b1=0x0,_0x17a675=events[_0x3a27('0x5')];_0x68e7b1<_0x17a675;_0x68e7b1++){var _0x1864b1=events[_0x68e7b1];var _0x6d2329=createListener(_0x3a27('0x6')+_0x1864b1,_0x25a070);OpenchannelQueueEvents['on'](_0x1864b1,_0x6d2329);}}; \ No newline at end of file +var _0xd501=['save','remove','update','openchannelQueue:','./openchannelQueue.events'];(function(_0x1084a5,_0x579890){var _0xf18360=function(_0x595ade){while(--_0x595ade){_0x1084a5['push'](_0x1084a5['shift']());}};_0xf18360(++_0x579890);}(_0xd501,0x135));var _0x1d50=function(_0x2638fc,_0x1482a2){_0x2638fc=_0x2638fc-0x0;var _0x2b59d5=_0xd501[_0x2638fc];return _0x2b59d5;};'use strict';var OpenchannelQueueEvents=require(_0x1d50('0x0'));var events=[_0x1d50('0x1'),_0x1d50('0x2'),_0x1d50('0x3')];function createListener(_0x29437d,_0x1df57e){return function(_0x2f1d9e){_0x1df57e['emit'](_0x29437d,_0x2f1d9e);};}function removeListener(_0x3ba683,_0x1a9230){return function(){OpenchannelQueueEvents['removeListener'](_0x3ba683,_0x1a9230);};}exports['register']=function(_0x2a5088){for(var _0x1129df=0x0,_0x472295=events['length'];_0x1129df<_0x472295;_0x1129df++){var _0x34ba42=events[_0x1129df];var _0x34cfc7=createListener(_0x1d50('0x4')+_0x34ba42,_0x2a5088);OpenchannelQueueEvents['on'](_0x34ba42,_0x34cfc7);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 1dba74d..d9bbce2 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 _0x6a37=['describe','show','create','put','update','delete','/:id','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated'];(function(_0x255e63,_0x19f0c1){var _0x2f70ae=function(_0x483910){while(--_0x483910){_0x255e63['push'](_0x255e63['shift']());}};_0x2f70ae(++_0x19f0c1);}(_0x6a37,0xbc));var _0x76a3=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x6a37[_0x4e676e];return _0x336a3c;};'use strict';var multer=require(_0x76a3('0x0'));var util=require(_0x76a3('0x1'));var path=require('path');var timeout=require(_0x76a3('0x2'));var express=require(_0x76a3('0x3'));var router=express[_0x76a3('0x4')]();var fs_extra=require(_0x76a3('0x5'));var auth=require(_0x76a3('0x6'));var interaction=require(_0x76a3('0x7'));var config=require(_0x76a3('0x8'));var controller=require(_0x76a3('0x9'));router[_0x76a3('0xa')]('/',auth[_0x76a3('0xb')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0x76a3('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x76a3('0xd')]);router['post']('/',auth[_0x76a3('0xb')](),controller[_0x76a3('0xe')]);router[_0x76a3('0xf')]('/:id',auth[_0x76a3('0xb')](),controller[_0x76a3('0x10')]);router[_0x76a3('0x11')](_0x76a3('0x12'),auth[_0x76a3('0xb')](),controller['destroy']);module[_0x76a3('0x13')]=router; \ No newline at end of file +var _0x446f=['/:id','post','update','delete','destroy','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x261b8a,_0x553ec4){var _0x3455e8=function(_0xdf10d4){while(--_0xdf10d4){_0x261b8a['push'](_0x261b8a['shift']());}};_0x3455e8(++_0x553ec4);}(_0x446f,0x1a3));var _0xf446=function(_0x1ee26a,_0x868ccd){_0x1ee26a=_0x1ee26a-0x0;var _0x262776=_0x446f[_0x1ee26a];return _0x262776;};'use strict';var multer=require(_0xf446('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf446('0x1'));var express=require(_0xf446('0x2'));var router=express[_0xf446('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf446('0x4'));var interaction=require(_0xf446('0x5'));var config=require(_0xf446('0x6'));var controller=require(_0xf446('0x7'));router[_0xf446('0x8')]('/',auth[_0xf446('0x9')](),controller[_0xf446('0xa')]);router[_0xf446('0x8')](_0xf446('0xb'),auth[_0xf446('0x9')](),controller[_0xf446('0xc')]);router[_0xf446('0x8')](_0xf446('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xf446('0xe')]('/',auth[_0xf446('0x9')](),controller['create']);router['put'](_0xf446('0xd'),auth[_0xf446('0x9')](),controller[_0xf446('0xf')]);router[_0xf446('0x10')]('/:id',auth[_0xf446('0x9')](),controller[_0xf446('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 4b7f3b6..c76a1e0 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 _0x5a81=['STRING','DATE','sequelize','exports'];(function(_0xab3e6a,_0xa3278b){var _0x47fa47=function(_0x129195){while(--_0x129195){_0xab3e6a['push'](_0xab3e6a['shift']());}};_0x47fa47(++_0xa3278b);}(_0x5a81,0x92));var _0x15a8=function(_0x3f4553,_0x5ed68e){_0x3f4553=_0x3f4553-0x0;var _0x130b63=_0x5a81[_0x3f4553];return _0x130b63;};'use strict';var moment=require('moment');var Sequelize=require(_0x15a8('0x0'));module[_0x15a8('0x1')]={'uniqueid':{'type':Sequelize[_0x15a8('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x15a8('0x3')]},'exitAt':{'type':Sequelize[_0x15a8('0x3')]},'reason':{'type':Sequelize[_0x15a8('0x2')]}}; \ No newline at end of file +var _0x8055=['sequelize','STRING','DATE'];(function(_0x58204d,_0x3980ea){var _0x2c9224=function(_0x479395){while(--_0x479395){_0x58204d['push'](_0x58204d['shift']());}};_0x2c9224(++_0x3980ea);}(_0x8055,0x1c2));var _0x5805=function(_0x1b38fc,_0x55cb9e){_0x1b38fc=_0x1b38fc-0x0;var _0x485523=_0x8055[_0x1b38fc];return _0x485523;};'use strict';var moment=require('moment');var Sequelize=require(_0x5805('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x5805('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x5805('0x1')]},'joinAt':{'type':Sequelize[_0x5805('0x2')]},'leaveAt':{'type':Sequelize[_0x5805('0x2')]},'acceptAt':{'type':Sequelize[_0x5805('0x2')]},'exitAt':{'type':Sequelize[_0x5805('0x2')]},'reason':{'type':Sequelize[_0x5805('0x1')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 5674eba..71126a5 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 _0xa660=['error','name','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','limit','sort','where','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','fields','length','find','create','body','params','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','reject','save','update','then'];(function(_0x24a398,_0x68e471){var _0x5e2566=function(_0x1bfb70){while(--_0x1bfb70){_0x24a398['push'](_0x24a398['shift']());}};_0x5e2566(++_0x68e471);}(_0xa660,0x159));var _0x0a66=function(_0x4d1a63,_0x3e1504){_0x4d1a63=_0x4d1a63-0x0;var _0x1f574c=_0xa660[_0x4d1a63];return _0x1f574c;};'use strict';var emlformat=require(_0x0a66('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0a66('0x1'));var jsonpatch=require(_0x0a66('0x2'));var rp=require(_0x0a66('0x3'));var moment=require(_0x0a66('0x4'));var BPromise=require(_0x0a66('0x5'));var Mustache=require(_0x0a66('0x6'));var util=require(_0x0a66('0x7'));var path=require(_0x0a66('0x8'));var sox=require(_0x0a66('0x9'));var csv=require(_0x0a66('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a66('0xb'));var _=require(_0x0a66('0xc'));var squel=require(_0x0a66('0xd'));var crypto=require(_0x0a66('0xe'));var jsforce=require(_0x0a66('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0a66('0xa'));var querystring=require(_0x0a66('0x10'));var Papa=require(_0x0a66('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0a66('0x12'));var as=require(_0x0a66('0x13'));var hardwareService=require(_0x0a66('0x14'));var logger=require('../../config/logger')(_0x0a66('0x15'));var utils=require(_0x0a66('0x16'));var config=require(_0x0a66('0x17'));var licenseUtil=require(_0x0a66('0x18'));var db=require(_0x0a66('0x19'))['db'];function respondWithStatusCode(_0x27041a,_0xe9961d){_0xe9961d=_0xe9961d||0xcc;return function(_0x545a06){if(_0x545a06){return _0x27041a[_0x0a66('0x1a')](_0xe9961d);}return _0x27041a[_0x0a66('0x1b')](_0xe9961d)[_0x0a66('0x1c')]();};}function respondWithResult(_0x276df0,_0x8b690){_0x8b690=_0x8b690||0xc8;return function(_0x13d791){if(_0x13d791){return _0x276df0[_0x0a66('0x1b')](_0x8b690)[_0x0a66('0x1d')](_0x13d791);}};}function respondWithFilteredResult(_0x13e7b5,_0x46b39c){return function(_0x563127){if(_0x563127){var _0x4fc382=typeof _0x46b39c['offset']===_0x0a66('0x1e')&&typeof _0x46b39c['limit']==='undefined';var _0x28cc36=_0x563127[_0x0a66('0x1f')];var _0x59747b=_0x4fc382?0x0:_0x46b39c['offset'];var _0x1d29f7=_0x4fc382?_0x563127[_0x0a66('0x1f')]:_0x46b39c[_0x0a66('0x20')]+_0x46b39c['limit'];var _0x2d9a40;if(_0x1d29f7>=_0x28cc36){_0x1d29f7=_0x28cc36;_0x2d9a40=0xc8;}else{_0x2d9a40=0xce;}_0x13e7b5[_0x0a66('0x1b')](_0x2d9a40);return _0x13e7b5[_0x0a66('0x21')](_0x0a66('0x22'),_0x59747b+'-'+_0x1d29f7+'/'+_0x28cc36)[_0x0a66('0x1d')](_0x563127);}return null;};}function patchUpdates(_0xfb59e9){return function(_0x5c6c63){try{jsonpatch[_0x0a66('0x23')](_0x5c6c63,_0xfb59e9,!![]);}catch(_0x2f0eab){return BPromise[_0x0a66('0x24')](_0x2f0eab);}return _0x5c6c63[_0x0a66('0x25')]();};}function saveUpdates(_0x24851c,_0x40cabd){return function(_0x383a5f){if(_0x383a5f){return _0x383a5f[_0x0a66('0x26')](_0x24851c)[_0x0a66('0x27')](function(_0x2cdc8e){return _0x2cdc8e;});}return null;};}function removeEntity(_0x369fd5,_0x15c1f0){return function(_0xb04b0){if(_0xb04b0){return _0xb04b0['destroy']()[_0x0a66('0x27')](function(){_0x369fd5['status'](0xcc)[_0x0a66('0x1c')]();});}};}function handleEntityNotFound(_0x410750,_0xf231a1){return function(_0x3df420){if(!_0x3df420){_0x410750[_0x0a66('0x1a')](0x194);}return _0x3df420;};}function handleError(_0xb2ec07,_0x32d6dd){_0x32d6dd=_0x32d6dd||0x1f4;return function(_0x255411){logger[_0x0a66('0x28')](_0x255411['stack']);if(_0x255411['name']){delete _0x255411[_0x0a66('0x29')];}_0xb2ec07[_0x0a66('0x1b')](_0x32d6dd)['send'](_0x255411);};}exports[_0x0a66('0x2a')]=function(_0x18ed7b,_0x1855ce){var _0x18a067={},_0x3e828d={},_0xbf0307={'count':0x0,'rows':[]};var _0x230fce=_[_0x0a66('0x2b')](db[_0x0a66('0x2c')][_0x0a66('0x2d')],function(_0x4e0ab5){return{'name':_0x4e0ab5[_0x0a66('0x2e')],'type':_0x4e0ab5[_0x0a66('0x2f')][_0x0a66('0x30')]};});_0x3e828d[_0x0a66('0x31')]=_['map'](_0x230fce,'name');_0x3e828d[_0x0a66('0x32')]=_[_0x0a66('0x33')](_0x18ed7b['query']);_0x3e828d[_0x0a66('0x34')]=_[_0x0a66('0x35')](_0x3e828d[_0x0a66('0x31')],_0x3e828d[_0x0a66('0x32')]);_0x18a067['attributes']=_[_0x0a66('0x35')](_0x3e828d[_0x0a66('0x31')],qs['fields'](_0x18ed7b['query']['fields']));_0x18a067['attributes']=_0x18a067[_0x0a66('0x36')]['length']?_0x18a067[_0x0a66('0x36')]:_0x3e828d['model'];if(!_0x18ed7b['query'][_0x0a66('0x37')](_0x0a66('0x38'))){_0x18a067['limit']=qs[_0x0a66('0x39')](_0x18ed7b['query']['limit']);_0x18a067[_0x0a66('0x20')]=qs[_0x0a66('0x20')](_0x18ed7b[_0x0a66('0x32')][_0x0a66('0x20')]);}_0x18a067['order']=qs[_0x0a66('0x3a')](_0x18ed7b[_0x0a66('0x32')]['sort']);_0x18a067['where']=qs[_0x0a66('0x34')](_['pick'](_0x18ed7b[_0x0a66('0x32')],_0x3e828d[_0x0a66('0x34')]),_0x230fce);if(_0x18ed7b[_0x0a66('0x32')]['filter']){_0x18a067[_0x0a66('0x3b')]=_[_0x0a66('0x3c')](_0x18a067[_0x0a66('0x3b')],{'$or':_[_0x0a66('0x2b')](_0x230fce,function(_0x587640){if(_0x587640[_0x0a66('0x2f')]!==_0x0a66('0x3d')){var _0x468f7d={};_0x468f7d[_0x587640[_0x0a66('0x29')]]={'$like':'%'+_0x18ed7b[_0x0a66('0x32')][_0x0a66('0x3e')]+'%'};return _0x468f7d;}})});}_0x18a067=_['merge']({},_0x18a067,_0x18ed7b[_0x0a66('0x3f')]);var _0x240360={'where':_0x18a067['where']};return db[_0x0a66('0x2c')][_0x0a66('0x1f')](_0x240360)[_0x0a66('0x27')](function(_0x745ec5){_0xbf0307['count']=_0x745ec5;if(_0x18ed7b[_0x0a66('0x32')][_0x0a66('0x40')]){_0x18a067[_0x0a66('0x41')]=[{'all':!![]}];}return db[_0x0a66('0x2c')]['findAll'](_0x18a067);})[_0x0a66('0x27')](function(_0x3a3749){_0xbf0307[_0x0a66('0x42')]=_0x3a3749;return _0xbf0307;})[_0x0a66('0x27')](respondWithFilteredResult(_0x1855ce,_0x18a067))[_0x0a66('0x43')](handleError(_0x1855ce,null));};exports[_0x0a66('0x44')]=function(_0x4712dc,_0x3ffd73){var _0x590b47={'raw':!![],'where':{'id':_0x4712dc['params']['id']}},_0x41040b={};_0x41040b['model']=_[_0x0a66('0x33')](db['OpenchannelQueueReport']['rawAttributes']);_0x41040b[_0x0a66('0x32')]=_[_0x0a66('0x33')](_0x4712dc['query']);_0x41040b[_0x0a66('0x34')]=_[_0x0a66('0x35')](_0x41040b['model'],_0x41040b[_0x0a66('0x32')]);_0x590b47[_0x0a66('0x36')]=_[_0x0a66('0x35')](_0x41040b[_0x0a66('0x31')],qs[_0x0a66('0x45')](_0x4712dc[_0x0a66('0x32')][_0x0a66('0x45')]));_0x590b47[_0x0a66('0x36')]=_0x590b47[_0x0a66('0x36')][_0x0a66('0x46')]?_0x590b47[_0x0a66('0x36')]:_0x41040b[_0x0a66('0x31')];if(_0x4712dc[_0x0a66('0x32')][_0x0a66('0x40')]){_0x590b47[_0x0a66('0x41')]=[{'all':!![]}];}_0x590b47=_[_0x0a66('0x3c')]({},_0x590b47,_0x4712dc[_0x0a66('0x3f')]);return db['OpenchannelQueueReport'][_0x0a66('0x47')](_0x590b47)[_0x0a66('0x27')](handleEntityNotFound(_0x3ffd73,null))[_0x0a66('0x27')](respondWithResult(_0x3ffd73,null))['catch'](handleError(_0x3ffd73,null));};exports[_0x0a66('0x48')]=function(_0x27a286,_0x5b1532){return db['OpenchannelQueueReport'][_0x0a66('0x48')](_0x27a286[_0x0a66('0x49')],{})[_0x0a66('0x27')](respondWithResult(_0x5b1532,0xc9))[_0x0a66('0x43')](handleError(_0x5b1532,null));};exports['update']=function(_0x56db31,_0x13c06f){if(_0x56db31[_0x0a66('0x49')]['id']){delete _0x56db31[_0x0a66('0x49')]['id'];}return db['OpenchannelQueueReport'][_0x0a66('0x47')]({'where':{'id':_0x56db31[_0x0a66('0x4a')]['id']}})[_0x0a66('0x27')](handleEntityNotFound(_0x13c06f,null))['then'](saveUpdates(_0x56db31['body'],null))[_0x0a66('0x27')](respondWithResult(_0x13c06f,null))[_0x0a66('0x43')](handleError(_0x13c06f,null));};exports[_0x0a66('0x4b')]=function(_0x479586,_0x36b0d6){return db[_0x0a66('0x2c')][_0x0a66('0x47')]({'where':{'id':_0x479586[_0x0a66('0x4a')]['id']}})[_0x0a66('0x27')](handleEntityNotFound(_0x36b0d6,null))['then'](removeEntity(_0x36b0d6,null))[_0x0a66('0x43')](handleError(_0x36b0d6,null));};exports[_0x0a66('0x4c')]=function(_0x142be0,_0x416314){return db[_0x0a66('0x2c')][_0x0a66('0x4c')]()[_0x0a66('0x27')](respondWithResult(_0x416314,null))['catch'](handleError(_0x416314,null));}; \ No newline at end of file +var _0x47d4=['send','index','OpenchannelQueueReport','key','query','filters','attributes','intersection','model','fields','length','nolimit','order','sort','where','pick','filter','map','type','VIRTUAL','includeAll','include','rows','catch','show','params','keys','merge','options','create','body','find','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name'];(function(_0x4aa908,_0x3fd06c){var _0x454e62=function(_0xb19377){while(--_0xb19377){_0x4aa908['push'](_0x4aa908['shift']());}};_0x454e62(++_0x3fd06c);}(_0x47d4,0x6c));var _0x447d=function(_0x3e4f18,_0x42065f){_0x3e4f18=_0x3e4f18-0x0;var _0x3a6c85=_0x47d4[_0x3e4f18];return _0x3a6c85;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x447d('0x0'));var jsonpatch=require(_0x447d('0x1'));var rp=require(_0x447d('0x2'));var moment=require(_0x447d('0x3'));var BPromise=require(_0x447d('0x4'));var Mustache=require('mustache');var util=require(_0x447d('0x5'));var path=require(_0x447d('0x6'));var sox=require(_0x447d('0x7'));var csv=require(_0x447d('0x8'));var ejs=require(_0x447d('0x9'));var fs=require('fs');var fs_extra=require(_0x447d('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x447d('0xb'));var deskjs=require(_0x447d('0xc'));var toCsv=require(_0x447d('0x8'));var querystring=require(_0x447d('0xd'));var Papa=require(_0x447d('0xe'));var Redis=require(_0x447d('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x447d('0x10'));var as=require(_0x447d('0x11'));var hardwareService=require(_0x447d('0x12'));var logger=require(_0x447d('0x13'))('api');var utils=require(_0x447d('0x14'));var config=require(_0x447d('0x15'));var licenseUtil=require(_0x447d('0x16'));var db=require(_0x447d('0x17'))['db'];function respondWithStatusCode(_0x5bcefe,_0x17dde0){_0x17dde0=_0x17dde0||0xcc;return function(_0x47776c){if(_0x47776c){return _0x5bcefe[_0x447d('0x18')](_0x17dde0);}return _0x5bcefe['status'](_0x17dde0)['end']();};}function respondWithResult(_0x1561b5,_0x208767){_0x208767=_0x208767||0xc8;return function(_0x281c79){if(_0x281c79){return _0x1561b5[_0x447d('0x19')](_0x208767)['json'](_0x281c79);}};}function respondWithFilteredResult(_0x3c18d2,_0x47d3f0){return function(_0x390edc){if(_0x390edc){var _0x41c292=typeof _0x47d3f0[_0x447d('0x1a')]===_0x447d('0x1b')&&typeof _0x47d3f0[_0x447d('0x1c')]==='undefined';var _0x26409e=_0x390edc[_0x447d('0x1d')];var _0x5a5eb2=_0x41c292?0x0:_0x47d3f0[_0x447d('0x1a')];var _0x51c640=_0x41c292?_0x390edc['count']:_0x47d3f0[_0x447d('0x1a')]+_0x47d3f0[_0x447d('0x1c')];var _0x22eb95;if(_0x51c640>=_0x26409e){_0x51c640=_0x26409e;_0x22eb95=0xc8;}else{_0x22eb95=0xce;}_0x3c18d2[_0x447d('0x19')](_0x22eb95);return _0x3c18d2[_0x447d('0x1e')](_0x447d('0x1f'),_0x5a5eb2+'-'+_0x51c640+'/'+_0x26409e)[_0x447d('0x20')](_0x390edc);}return null;};}function patchUpdates(_0x3e7f03){return function(_0x532cec){try{jsonpatch[_0x447d('0x21')](_0x532cec,_0x3e7f03,!![]);}catch(_0x17f82c){return BPromise[_0x447d('0x22')](_0x17f82c);}return _0x532cec[_0x447d('0x23')]();};}function saveUpdates(_0x82515,_0x537195){return function(_0x2996f0){if(_0x2996f0){return _0x2996f0[_0x447d('0x24')](_0x82515)[_0x447d('0x25')](function(_0x39f249){return _0x39f249;});}return null;};}function removeEntity(_0x145011,_0x252526){return function(_0x286b21){if(_0x286b21){return _0x286b21[_0x447d('0x26')]()[_0x447d('0x25')](function(){_0x145011[_0x447d('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20fc75,_0x262871){return function(_0x38a45d){if(!_0x38a45d){_0x20fc75[_0x447d('0x18')](0x194);}return _0x38a45d;};}function handleError(_0x2e8357,_0x1d0a9c){_0x1d0a9c=_0x1d0a9c||0x1f4;return function(_0x88ff80){logger[_0x447d('0x27')](_0x88ff80[_0x447d('0x28')]);if(_0x88ff80[_0x447d('0x29')]){delete _0x88ff80[_0x447d('0x29')];}_0x2e8357['status'](_0x1d0a9c)[_0x447d('0x2a')](_0x88ff80);};}exports[_0x447d('0x2b')]=function(_0x524ae8,_0x4396fc){var _0x4b9a5a={},_0x22cceb={},_0x96861e={'count':0x0,'rows':[]};var _0x1575f8=_['map'](db[_0x447d('0x2c')]['rawAttributes'],function(_0x3e4a44){return{'name':_0x3e4a44['fieldName'],'type':_0x3e4a44['type'][_0x447d('0x2d')]};});_0x22cceb['model']=_['map'](_0x1575f8,'name');_0x22cceb[_0x447d('0x2e')]=_['keys'](_0x524ae8['query']);_0x22cceb[_0x447d('0x2f')]=_['intersection'](_0x22cceb['model'],_0x22cceb['query']);_0x4b9a5a[_0x447d('0x30')]=_[_0x447d('0x31')](_0x22cceb[_0x447d('0x32')],qs['fields'](_0x524ae8[_0x447d('0x2e')][_0x447d('0x33')]));_0x4b9a5a[_0x447d('0x30')]=_0x4b9a5a[_0x447d('0x30')][_0x447d('0x34')]?_0x4b9a5a['attributes']:_0x22cceb[_0x447d('0x32')];if(!_0x524ae8[_0x447d('0x2e')]['hasOwnProperty'](_0x447d('0x35'))){_0x4b9a5a[_0x447d('0x1c')]=qs['limit'](_0x524ae8[_0x447d('0x2e')][_0x447d('0x1c')]);_0x4b9a5a['offset']=qs[_0x447d('0x1a')](_0x524ae8[_0x447d('0x2e')][_0x447d('0x1a')]);}_0x4b9a5a[_0x447d('0x36')]=qs['sort'](_0x524ae8[_0x447d('0x2e')][_0x447d('0x37')]);_0x4b9a5a[_0x447d('0x38')]=qs['filters'](_[_0x447d('0x39')](_0x524ae8[_0x447d('0x2e')],_0x22cceb[_0x447d('0x2f')]),_0x1575f8);if(_0x524ae8[_0x447d('0x2e')][_0x447d('0x3a')]){_0x4b9a5a[_0x447d('0x38')]=_['merge'](_0x4b9a5a[_0x447d('0x38')],{'$or':_[_0x447d('0x3b')](_0x1575f8,function(_0x3c4476){if(_0x3c4476[_0x447d('0x3c')]!==_0x447d('0x3d')){var _0x544024={};_0x544024[_0x3c4476[_0x447d('0x29')]]={'$like':'%'+_0x524ae8['query']['filter']+'%'};return _0x544024;}})});}_0x4b9a5a=_['merge']({},_0x4b9a5a,_0x524ae8['options']);var _0x5e14f1={'where':_0x4b9a5a[_0x447d('0x38')]};return db[_0x447d('0x2c')]['count'](_0x5e14f1)[_0x447d('0x25')](function(_0x140f8d){_0x96861e['count']=_0x140f8d;if(_0x524ae8[_0x447d('0x2e')][_0x447d('0x3e')]){_0x4b9a5a[_0x447d('0x3f')]=[{'all':!![]}];}return db[_0x447d('0x2c')]['findAll'](_0x4b9a5a);})[_0x447d('0x25')](function(_0x268728){_0x96861e[_0x447d('0x40')]=_0x268728;return _0x96861e;})[_0x447d('0x25')](respondWithFilteredResult(_0x4396fc,_0x4b9a5a))[_0x447d('0x41')](handleError(_0x4396fc,null));};exports[_0x447d('0x42')]=function(_0x4bc428,_0x221843){var _0x3895d5={'raw':!![],'where':{'id':_0x4bc428[_0x447d('0x43')]['id']}},_0x46ac76={};_0x46ac76[_0x447d('0x32')]=_[_0x447d('0x44')](db[_0x447d('0x2c')]['rawAttributes']);_0x46ac76['query']=_['keys'](_0x4bc428[_0x447d('0x2e')]);_0x46ac76[_0x447d('0x2f')]=_[_0x447d('0x31')](_0x46ac76[_0x447d('0x32')],_0x46ac76[_0x447d('0x2e')]);_0x3895d5[_0x447d('0x30')]=_[_0x447d('0x31')](_0x46ac76[_0x447d('0x32')],qs['fields'](_0x4bc428[_0x447d('0x2e')][_0x447d('0x33')]));_0x3895d5[_0x447d('0x30')]=_0x3895d5[_0x447d('0x30')]['length']?_0x3895d5[_0x447d('0x30')]:_0x46ac76[_0x447d('0x32')];if(_0x4bc428[_0x447d('0x2e')][_0x447d('0x3e')]){_0x3895d5[_0x447d('0x3f')]=[{'all':!![]}];}_0x3895d5=_[_0x447d('0x45')]({},_0x3895d5,_0x4bc428[_0x447d('0x46')]);return db[_0x447d('0x2c')]['find'](_0x3895d5)['then'](handleEntityNotFound(_0x221843,null))['then'](respondWithResult(_0x221843,null))[_0x447d('0x41')](handleError(_0x221843,null));};exports[_0x447d('0x47')]=function(_0x276d1c,_0x341af1){return db[_0x447d('0x2c')][_0x447d('0x47')](_0x276d1c[_0x447d('0x48')],{})[_0x447d('0x25')](respondWithResult(_0x341af1,0xc9))[_0x447d('0x41')](handleError(_0x341af1,null));};exports[_0x447d('0x24')]=function(_0x6bb40a,_0x1dd46c){if(_0x6bb40a[_0x447d('0x48')]['id']){delete _0x6bb40a['body']['id'];}return db[_0x447d('0x2c')]['find']({'where':{'id':_0x6bb40a['params']['id']}})[_0x447d('0x25')](handleEntityNotFound(_0x1dd46c,null))[_0x447d('0x25')](saveUpdates(_0x6bb40a[_0x447d('0x48')],null))[_0x447d('0x25')](respondWithResult(_0x1dd46c,null))[_0x447d('0x41')](handleError(_0x1dd46c,null));};exports['destroy']=function(_0x1eb2dc,_0x25a20f){return db[_0x447d('0x2c')][_0x447d('0x49')]({'where':{'id':_0x1eb2dc['params']['id']}})['then'](handleEntityNotFound(_0x25a20f,null))[_0x447d('0x25')](removeEntity(_0x25a20f,null))[_0x447d('0x41')](handleError(_0x25a20f,null));};exports[_0x447d('0x4a')]=function(_0x558386,_0x5a8b1f){return db['OpenchannelQueueReport'][_0x447d('0x4a')]()[_0x447d('0x25')](respondWithResult(_0x5a8b1f,null))['catch'](handleError(_0x5a8b1f,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index ec0e92b..c73ee77 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 _0x5fc3=['util','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelQueueReport.attributes','exports','define','report_openchannel_queue','uniqueid','lodash'];(function(_0x3f4100,_0x54582e){var _0x48fff1=function(_0x1b1d8d){while(--_0x1b1d8d){_0x3f4100['push'](_0x3f4100['shift']());}};_0x48fff1(++_0x54582e);}(_0x5fc3,0xa8));var _0x35fc=function(_0x269ee8,_0x477226){_0x269ee8=_0x269ee8-0x0;var _0x4d98bd=_0x5fc3[_0x269ee8];return _0x4d98bd;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var logger=require('../../config/logger')(_0x35fc('0x2'));var moment=require(_0x35fc('0x3'));var BPromise=require(_0x35fc('0x4'));var rp=require(_0x35fc('0x5'));var fs=require('fs');var path=require(_0x35fc('0x6'));var rimraf=require('rimraf');var config=require(_0x35fc('0x7'));var attributes=require(_0x35fc('0x8'));module[_0x35fc('0x9')]=function(_0x5b85ad,_0x5754be){return _0x5b85ad[_0x35fc('0xa')]('OpenchannelQueueReport',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[{'name':_0x35fc('0xc'),'fields':[_0x35fc('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1261=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','define','report_openchannel_queue','uniqueid','util'];(function(_0x6652bd,_0x1b1557){var _0x28b129=function(_0x4428a0){while(--_0x4428a0){_0x6652bd['push'](_0x6652bd['shift']());}};_0x28b129(++_0x1b1557);}(_0x1261,0x144));var _0x1126=function(_0x234ae1,_0x42bdd6){_0x234ae1=_0x234ae1-0x0;var _0x227ba0=_0x1261[_0x234ae1];return _0x227ba0;};'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 e4bad29..8ee1086 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 _0xefda=['lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelQueueReport,\x20%s,\x20%s','message','info','result','catch','CreateOpenchannelQueueReport','create','body','options','raw','UpdateOpenchannelQueueReport','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xefda,0x96));var _0xaefd=function(_0x4794a2,_0x5d31a8){_0x4794a2=_0x4794a2-0x0;var _0x3f146c=_0xefda[_0x4794a2];return _0x3f146c;};'use strict';var _=require(_0xaefd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xaefd('0x1'));var rs=require(_0xaefd('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaefd('0x3'))['db'];var utils=require(_0xaefd('0x4'));var logger=require(_0xaefd('0x5'))(_0xaefd('0x6'));var config=require(_0xaefd('0x7'));var jayson=require(_0xaefd('0x8'));var client=jayson['client'][_0xaefd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3b9736,_0x24d10c,_0x1d76f3){return new BPromise(function(_0x4ce248,_0x15193c){return client[_0xaefd('0xa')](_0x3b9736,_0x1d76f3)[_0xaefd('0xb')](function(_0x4d44ed){logger['info']('OpenchannelQueueReport,\x20%s,\x20%s',_0x24d10c,_0xaefd('0xc'));logger[_0xaefd('0xd')](_0xaefd('0xe'),_0x24d10c,_0xaefd('0xc'),JSON[_0xaefd('0xf')](_0x4d44ed));if(_0x4d44ed[_0xaefd('0x10')]){if(_0x4d44ed[_0xaefd('0x10')][_0xaefd('0x11')]===0x1f4){logger[_0xaefd('0x10')](_0xaefd('0x12'),_0x24d10c,_0x4d44ed[_0xaefd('0x10')]['message']);return _0x15193c(_0x4d44ed[_0xaefd('0x10')]['message']);}logger[_0xaefd('0x10')](_0xaefd('0x12'),_0x24d10c,_0x4d44ed[_0xaefd('0x10')][_0xaefd('0x13')]);return _0x4ce248(_0x4d44ed['error'][_0xaefd('0x13')]);}else{logger[_0xaefd('0x14')](_0xaefd('0x12'),_0x24d10c,_0xaefd('0xc'));_0x4ce248(_0x4d44ed[_0xaefd('0x15')][_0xaefd('0x13')]);}})[_0xaefd('0x16')](function(_0x23d736){logger['error'](_0xaefd('0x12'),_0x24d10c,_0x23d736);_0x15193c(_0x23d736);});});}exports[_0xaefd('0x17')]=function(_0x9748f4){var _0x1737a1=this;return new Promise(function(_0x2db61b,_0x244956){return db['OpenchannelQueueReport'][_0xaefd('0x18')](_0x9748f4[_0xaefd('0x19')],{'raw':_0x9748f4[_0xaefd('0x1a')]?_0x9748f4[_0xaefd('0x1a')][_0xaefd('0x1b')]===undefined?!![]:![]:!![]})[_0xaefd('0xb')](function(_0x5282ed){logger[_0xaefd('0x14')](_0xaefd('0x17'),_0x9748f4);logger[_0xaefd('0xd')](_0xaefd('0x17'),_0x9748f4,JSON[_0xaefd('0xf')](_0x5282ed));_0x2db61b(_0x5282ed);})['catch'](function(_0x479486){logger['error'](_0xaefd('0x17'),_0x479486[_0xaefd('0x13')],_0x9748f4);_0x244956(_0x1737a1[_0xaefd('0x10')](0x1f4,_0x479486['message']));});});};exports[_0xaefd('0x1c')]=function(_0x4cd9b2){var _0x3deec8=this;return new Promise(function(_0x3caa99,_0x1a05eb){return db['OpenchannelQueueReport'][_0xaefd('0x1d')](_0x4cd9b2[_0xaefd('0x19')],{'raw':_0x4cd9b2[_0xaefd('0x1a')]?_0x4cd9b2[_0xaefd('0x1a')][_0xaefd('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4cd9b2['options']?_0x4cd9b2[_0xaefd('0x1a')]['where']||null:null,'attributes':_0x4cd9b2[_0xaefd('0x1a')]?_0x4cd9b2[_0xaefd('0x1a')]['attributes']||null:null,'limit':_0x4cd9b2[_0xaefd('0x1a')]?_0x4cd9b2[_0xaefd('0x1a')]['limit']||null:null})[_0xaefd('0xb')](function(_0x114ec0){logger[_0xaefd('0x14')]('UpdateOpenchannelQueueReport',_0x4cd9b2);logger[_0xaefd('0xd')]('UpdateOpenchannelQueueReport',_0x4cd9b2,JSON[_0xaefd('0xf')](_0x114ec0));_0x3caa99(_0x114ec0);})['catch'](function(_0x4a1acb){logger[_0xaefd('0x10')](_0xaefd('0x1c'),_0x4a1acb['message'],_0x4cd9b2);_0x1a05eb(_0x3deec8['error'](0x1f4,_0x4a1acb['message']));});});}; \ No newline at end of file +var _0x3de3=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','CreateOpenchannelQueueReport','create','options','raw','OpenchannelQueueReport','body','attributes','limit','UpdateOpenchannelQueueReport','lodash','moment','bluebird'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0x3de3,0x1ce));var _0x33de=function(_0x3e61c1,_0x328e40){_0x3e61c1=_0x3e61c1-0x0;var _0x1fb81b=_0x3de3[_0x3e61c1];return _0x1fb81b;};'use strict';var _=require(_0x33de('0x0'));var util=require('util');var moment=require(_0x33de('0x1'));var BPromise=require(_0x33de('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x33de('0x3'));var db=require(_0x33de('0x4'))['db'];var utils=require(_0x33de('0x5'));var logger=require(_0x33de('0x6'))('rpc');var config=require(_0x33de('0x7'));var jayson=require(_0x33de('0x8'));var client=jayson['client'][_0x33de('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x587be8,_0x13afea,_0x35ee93){return new BPromise(function(_0x7ceca6,_0x486ab6){return client[_0x33de('0xa')](_0x587be8,_0x35ee93)[_0x33de('0xb')](function(_0x2e0419){logger['info'](_0x33de('0xc'),_0x13afea,_0x33de('0xd'));logger[_0x33de('0xe')](_0x33de('0xf'),_0x13afea,_0x33de('0xd'),JSON[_0x33de('0x10')](_0x2e0419));if(_0x2e0419[_0x33de('0x11')]){if(_0x2e0419[_0x33de('0x11')][_0x33de('0x12')]===0x1f4){logger[_0x33de('0x11')](_0x33de('0xc'),_0x13afea,_0x2e0419['error'][_0x33de('0x13')]);return _0x486ab6(_0x2e0419[_0x33de('0x11')]['message']);}logger['error'](_0x33de('0xc'),_0x13afea,_0x2e0419[_0x33de('0x11')][_0x33de('0x13')]);return _0x7ceca6(_0x2e0419[_0x33de('0x11')]['message']);}else{logger[_0x33de('0x14')](_0x33de('0xc'),_0x13afea,'request\x20sent');_0x7ceca6(_0x2e0419['result'][_0x33de('0x13')]);}})[_0x33de('0x15')](function(_0x13e832){logger['error'](_0x33de('0xc'),_0x13afea,_0x13e832);_0x486ab6(_0x13e832);});});}exports[_0x33de('0x16')]=function(_0x52cfa0){var _0x2815a7=this;return new Promise(function(_0x201ff3,_0x482667){return db['OpenchannelQueueReport'][_0x33de('0x17')](_0x52cfa0['body'],{'raw':_0x52cfa0[_0x33de('0x18')]?_0x52cfa0[_0x33de('0x18')][_0x33de('0x19')]===undefined?!![]:![]:!![]})[_0x33de('0xb')](function(_0xc4f1a4){logger[_0x33de('0x14')](_0x33de('0x16'),_0x52cfa0);logger['debug']('CreateOpenchannelQueueReport',_0x52cfa0,JSON[_0x33de('0x10')](_0xc4f1a4));_0x201ff3(_0xc4f1a4);})['catch'](function(_0x8acd8d){logger['error'](_0x33de('0x16'),_0x8acd8d[_0x33de('0x13')],_0x52cfa0);_0x482667(_0x2815a7['error'](0x1f4,_0x8acd8d[_0x33de('0x13')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x67d040){var _0x5c602d=this;return new Promise(function(_0x62743b,_0x24e282){return db[_0x33de('0x1a')]['update'](_0x67d040[_0x33de('0x1b')],{'raw':_0x67d040[_0x33de('0x18')]?_0x67d040[_0x33de('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x67d040[_0x33de('0x18')]?_0x67d040['options']['where']||null:null,'attributes':_0x67d040[_0x33de('0x18')]?_0x67d040[_0x33de('0x18')][_0x33de('0x1c')]||null:null,'limit':_0x67d040[_0x33de('0x18')]?_0x67d040[_0x33de('0x18')][_0x33de('0x1d')]||null:null})[_0x33de('0xb')](function(_0x1b4703){logger['info']('UpdateOpenchannelQueueReport',_0x67d040);logger[_0x33de('0xe')](_0x33de('0x1e'),_0x67d040,JSON[_0x33de('0x10')](_0x1b4703));_0x62743b(_0x1b4703);})[_0x33de('0x15')](function(_0x167cec){logger[_0x33de('0x11')](_0x33de('0x1e'),_0x167cec['message'],_0x67d040);_0x24e282(_0x5c602d[_0x33de('0x11')](0x1f4,_0x167cec[_0x33de('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 6714e9b..dcd53ae 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 _0x7393=['get','/describe','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5f7bbe,_0x395d8c){var _0x5a5000=function(_0x334f07){while(--_0x334f07){_0x5f7bbe['push'](_0x5f7bbe['shift']());}};_0x5a5000(++_0x395d8c);}(_0x7393,0x1d8));var _0x3739=function(_0x3a97f6,_0x452367){_0x3a97f6=_0x3a97f6-0x0;var _0x4986ed=_0x7393[_0x3a97f6];return _0x4986ed;};'use strict';var multer=require('multer');var util=require(_0x3739('0x0'));var path=require(_0x3739('0x1'));var timeout=require(_0x3739('0x2'));var express=require(_0x3739('0x3'));var router=express[_0x3739('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3739('0x5'));var interaction=require(_0x3739('0x6'));var config=require(_0x3739('0x7'));var controller=require('./openchannelTransferReport.controller');router[_0x3739('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3739('0x8')](_0x3739('0x9'),auth[_0x3739('0xa')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x3739('0xb')]);router[_0x3739('0xc')]('/',auth['isAuthenticated'](),controller[_0x3739('0xd')]);router[_0x3739('0xe')](_0x3739('0xf'),auth[_0x3739('0xa')](),controller[_0x3739('0x10')]);router[_0x3739('0x11')](_0x3739('0xf'),auth[_0x3739('0xa')](),controller[_0x3739('0x12')]);module[_0x3739('0x13')]=router; \ No newline at end of file +var _0x71d4=['update','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x71d4,0x106));var _0x471d=function(_0x1ea57a,_0x920358){_0x1ea57a=_0x1ea57a-0x0;var _0x1be668=_0x71d4[_0x1ea57a];return _0x1be668;};'use strict';var multer=require(_0x471d('0x0'));var util=require(_0x471d('0x1'));var path=require(_0x471d('0x2'));var timeout=require(_0x471d('0x3'));var express=require('express');var router=express[_0x471d('0x4')]();var fs_extra=require(_0x471d('0x5'));var auth=require(_0x471d('0x6'));var interaction=require(_0x471d('0x7'));var config=require(_0x471d('0x8'));var controller=require(_0x471d('0x9'));router[_0x471d('0xa')]('/',auth[_0x471d('0xb')](),controller[_0x471d('0xc')]);router[_0x471d('0xa')](_0x471d('0xd'),auth['isAuthenticated'](),controller[_0x471d('0xe')]);router[_0x471d('0xa')](_0x471d('0xf'),auth[_0x471d('0xb')](),controller[_0x471d('0x10')]);router['post']('/',auth[_0x471d('0xb')](),controller['create']);router[_0x471d('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x471d('0x12')]);router['delete'](_0x471d('0xf'),auth[_0x471d('0xb')](),controller[_0x471d('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index c0dac6d..d231959 100644 --- a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js +++ b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x1a0073,_0x2c3af7){var _0x50a1a0=function(_0xde4165){while(--_0xde4165){_0x1a0073['push'](_0x1a0073['shift']());}};_0x50a1a0(++_0x2c3af7);}(_0xf3cd,0xfe));var _0xdf3c=function(_0xcb0eb2,_0x3906bf){_0xcb0eb2=_0xcb0eb2-0x0;var _0xbab9b8=_0xf3cd[_0xcb0eb2];return _0xbab9b8;};'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 _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x4996d5,_0x123daf){var _0x4793f9=function(_0x30c7ec){while(--_0x30c7ec){_0x4996d5['push'](_0x4996d5['shift']());}};_0x4793f9(++_0x123daf);}(_0x9bde,0xe1));var _0xe9bd=function(_0x14cbb5,_0x11a0fd){_0x14cbb5=_0x14cbb5-0x0;var _0x250972=_0x9bde[_0x14cbb5];return _0x250972;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 3c9a70d..788f97e 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 _0x33c8=['rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','options','create','update','body','find','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','limit','set','Content-Range','reject','save','destroy','then','sendStatus','name','index','map','OpenchannelTransferReport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x33c8,0xb7));var _0x833c=function(_0x4ee5aa,_0x4f2d01){_0x4ee5aa=_0x4ee5aa-0x0;var _0x171eb1=_0x33c8[_0x4ee5aa];return _0x171eb1;};'use strict';var emlformat=require(_0x833c('0x0'));var rimraf=require(_0x833c('0x1'));var zipdir=require(_0x833c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x833c('0x3'));var moment=require(_0x833c('0x4'));var BPromise=require(_0x833c('0x5'));var Mustache=require(_0x833c('0x6'));var util=require(_0x833c('0x7'));var path=require(_0x833c('0x8'));var sox=require('sox');var csv=require(_0x833c('0x9'));var ejs=require(_0x833c('0xa'));var fs=require('fs');var fs_extra=require(_0x833c('0xb'));var _=require(_0x833c('0xc'));var squel=require('squel');var crypto=require(_0x833c('0xd'));var jsforce=require(_0x833c('0xe'));var deskjs=require(_0x833c('0xf'));var toCsv=require(_0x833c('0x9'));var querystring=require(_0x833c('0x10'));var Papa=require(_0x833c('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x833c('0x12'));var as=require(_0x833c('0x13'));var hardwareService=require(_0x833c('0x14'));var logger=require(_0x833c('0x15'))(_0x833c('0x16'));var utils=require(_0x833c('0x17'));var config=require(_0x833c('0x18'));var licenseUtil=require(_0x833c('0x19'));var db=require(_0x833c('0x1a'))['db'];function respondWithStatusCode(_0x5a3b35,_0x2a6669){_0x2a6669=_0x2a6669||0xcc;return function(_0x12eb6b){if(_0x12eb6b){return _0x5a3b35['sendStatus'](_0x2a6669);}return _0x5a3b35[_0x833c('0x1b')](_0x2a6669)[_0x833c('0x1c')]();};}function respondWithResult(_0x55f7ae,_0x4cc31f){_0x4cc31f=_0x4cc31f||0xc8;return function(_0x251455){if(_0x251455){return _0x55f7ae[_0x833c('0x1b')](_0x4cc31f)[_0x833c('0x1d')](_0x251455);}};}function respondWithFilteredResult(_0x22e729,_0x342bf4){return function(_0x1962d3){if(_0x1962d3){var _0x5d181b=typeof _0x342bf4['offset']===_0x833c('0x1e')&&typeof _0x342bf4['limit']===_0x833c('0x1e');var _0x2b2e81=_0x1962d3[_0x833c('0x1f')];var _0x361c61=_0x5d181b?0x0:_0x342bf4[_0x833c('0x20')];var _0x203019=_0x5d181b?_0x1962d3[_0x833c('0x1f')]:_0x342bf4[_0x833c('0x20')]+_0x342bf4[_0x833c('0x21')];var _0xb29fbc;if(_0x203019>=_0x2b2e81){_0x203019=_0x2b2e81;_0xb29fbc=0xc8;}else{_0xb29fbc=0xce;}_0x22e729[_0x833c('0x1b')](_0xb29fbc);return _0x22e729[_0x833c('0x22')](_0x833c('0x23'),_0x361c61+'-'+_0x203019+'/'+_0x2b2e81)[_0x833c('0x1d')](_0x1962d3);}return null;};}function patchUpdates(_0x3b4089){return function(_0x99e836){try{jsonpatch['apply'](_0x99e836,_0x3b4089,!![]);}catch(_0x4fa6ce){return BPromise[_0x833c('0x24')](_0x4fa6ce);}return _0x99e836[_0x833c('0x25')]();};}function saveUpdates(_0x43964d,_0x1fd037){return function(_0x189632){if(_0x189632){return _0x189632['update'](_0x43964d)['then'](function(_0x5c73e7){return _0x5c73e7;});}return null;};}function removeEntity(_0x5c503c,_0x125b97){return function(_0xb11a88){if(_0xb11a88){return _0xb11a88[_0x833c('0x26')]()[_0x833c('0x27')](function(){_0x5c503c[_0x833c('0x1b')](0xcc)[_0x833c('0x1c')]();});}};}function handleEntityNotFound(_0x45920f,_0x1dd4cf){return function(_0x41dbd9){if(!_0x41dbd9){_0x45920f[_0x833c('0x28')](0x194);}return _0x41dbd9;};}function handleError(_0x58aaa3,_0x25fd3c){_0x25fd3c=_0x25fd3c||0x1f4;return function(_0x2e2715){logger['error'](_0x2e2715['stack']);if(_0x2e2715[_0x833c('0x29')]){delete _0x2e2715[_0x833c('0x29')];}_0x58aaa3['status'](_0x25fd3c)['send'](_0x2e2715);};}exports[_0x833c('0x2a')]=function(_0x157141,_0x396e37){var _0x5b4a3c={},_0x349c87={},_0x50616c={'count':0x0,'rows':[]};var _0x3a07fa=_[_0x833c('0x2b')](db[_0x833c('0x2c')][_0x833c('0x2d')],function(_0x42481e){return{'name':_0x42481e[_0x833c('0x2e')],'type':_0x42481e[_0x833c('0x2f')][_0x833c('0x30')]};});_0x349c87[_0x833c('0x31')]=_[_0x833c('0x2b')](_0x3a07fa,_0x833c('0x29'));_0x349c87[_0x833c('0x32')]=_[_0x833c('0x33')](_0x157141[_0x833c('0x32')]);_0x349c87['filters']=_['intersection'](_0x349c87[_0x833c('0x31')],_0x349c87['query']);_0x5b4a3c[_0x833c('0x34')]=_[_0x833c('0x35')](_0x349c87['model'],qs[_0x833c('0x36')](_0x157141['query']['fields']));_0x5b4a3c['attributes']=_0x5b4a3c['attributes'][_0x833c('0x37')]?_0x5b4a3c[_0x833c('0x34')]:_0x349c87[_0x833c('0x31')];if(!_0x157141[_0x833c('0x32')][_0x833c('0x38')]('nolimit')){_0x5b4a3c[_0x833c('0x21')]=qs[_0x833c('0x21')](_0x157141['query'][_0x833c('0x21')]);_0x5b4a3c['offset']=qs[_0x833c('0x20')](_0x157141[_0x833c('0x32')][_0x833c('0x20')]);}_0x5b4a3c[_0x833c('0x39')]=qs['sort'](_0x157141[_0x833c('0x32')][_0x833c('0x3a')]);_0x5b4a3c[_0x833c('0x3b')]=qs['filters'](_[_0x833c('0x3c')](_0x157141['query'],_0x349c87['filters']),_0x3a07fa);if(_0x157141[_0x833c('0x32')][_0x833c('0x3d')]){_0x5b4a3c[_0x833c('0x3b')]=_[_0x833c('0x3e')](_0x5b4a3c[_0x833c('0x3b')],{'$or':_['map'](_0x3a07fa,function(_0x238089){if(_0x238089[_0x833c('0x2f')]!=='VIRTUAL'){var _0x20f646={};_0x20f646[_0x238089[_0x833c('0x29')]]={'$like':'%'+_0x157141[_0x833c('0x32')][_0x833c('0x3d')]+'%'};return _0x20f646;}})});}_0x5b4a3c=_[_0x833c('0x3e')]({},_0x5b4a3c,_0x157141['options']);var _0x184efd={'where':_0x5b4a3c[_0x833c('0x3b')]};return db[_0x833c('0x2c')]['count'](_0x184efd)[_0x833c('0x27')](function(_0x45b096){_0x50616c[_0x833c('0x1f')]=_0x45b096;if(_0x157141[_0x833c('0x32')][_0x833c('0x3f')]){_0x5b4a3c[_0x833c('0x40')]=[{'all':!![]}];}return db[_0x833c('0x2c')][_0x833c('0x41')](_0x5b4a3c);})['then'](function(_0x5db04d){_0x50616c[_0x833c('0x42')]=_0x5db04d;return _0x50616c;})['then'](respondWithFilteredResult(_0x396e37,_0x5b4a3c))[_0x833c('0x43')](handleError(_0x396e37,null));};exports[_0x833c('0x44')]=function(_0x109a2f,_0x41bc8e){var _0x382d64={'raw':!![],'where':{'id':_0x109a2f[_0x833c('0x45')]['id']}},_0x14d37a={};_0x14d37a[_0x833c('0x31')]=_[_0x833c('0x33')](db[_0x833c('0x2c')][_0x833c('0x2d')]);_0x14d37a[_0x833c('0x32')]=_[_0x833c('0x33')](_0x109a2f[_0x833c('0x32')]);_0x14d37a['filters']=_[_0x833c('0x35')](_0x14d37a['model'],_0x14d37a[_0x833c('0x32')]);_0x382d64['attributes']=_[_0x833c('0x35')](_0x14d37a[_0x833c('0x31')],qs[_0x833c('0x36')](_0x109a2f[_0x833c('0x32')]['fields']));_0x382d64[_0x833c('0x34')]=_0x382d64[_0x833c('0x34')][_0x833c('0x37')]?_0x382d64['attributes']:_0x14d37a['model'];if(_0x109a2f[_0x833c('0x32')][_0x833c('0x3f')]){_0x382d64[_0x833c('0x40')]=[{'all':!![]}];}_0x382d64=_['merge']({},_0x382d64,_0x109a2f[_0x833c('0x46')]);return db[_0x833c('0x2c')]['find'](_0x382d64)['then'](handleEntityNotFound(_0x41bc8e,null))['then'](respondWithResult(_0x41bc8e,null))['catch'](handleError(_0x41bc8e,null));};exports['create']=function(_0xd38974,_0x509890){return db[_0x833c('0x2c')][_0x833c('0x47')](_0xd38974['body'],{})[_0x833c('0x27')](respondWithResult(_0x509890,0xc9))['catch'](handleError(_0x509890,null));};exports[_0x833c('0x48')]=function(_0x3c1e4b,_0x1de6b6){if(_0x3c1e4b['body']['id']){delete _0x3c1e4b[_0x833c('0x49')]['id'];}return db['OpenchannelTransferReport'][_0x833c('0x4a')]({'where':{'id':_0x3c1e4b[_0x833c('0x45')]['id']}})[_0x833c('0x27')](handleEntityNotFound(_0x1de6b6,null))['then'](saveUpdates(_0x3c1e4b[_0x833c('0x49')],null))[_0x833c('0x27')](respondWithResult(_0x1de6b6,null))['catch'](handleError(_0x1de6b6,null));};exports['destroy']=function(_0x5b9e29,_0x2052a9){return db[_0x833c('0x2c')][_0x833c('0x4a')]({'where':{'id':_0x5b9e29[_0x833c('0x45')]['id']}})[_0x833c('0x27')](handleEntityNotFound(_0x2052a9,null))[_0x833c('0x27')](removeEntity(_0x2052a9,null))[_0x833c('0x43')](handleError(_0x2052a9,null));};exports[_0x833c('0x4b')]=function(_0x1d1eec,_0x2bb6d6){return db[_0x833c('0x2c')][_0x833c('0x4b')]()['then'](respondWithResult(_0x2bb6d6,null))[_0x833c('0x43')](handleError(_0x2bb6d6,null));}; \ No newline at end of file +var _0xadcb=['options','includeAll','include','findAll','rows','catch','show','merge','find','create','body','params','describe','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','index','map','OpenchannelTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL'];(function(_0x59603a,_0x31dd2b){var _0x199d46=function(_0x4cc156){while(--_0x4cc156){_0x59603a['push'](_0x59603a['shift']());}};_0x199d46(++_0x31dd2b);}(_0xadcb,0x139));var _0xbadc=function(_0x927d2f,_0x5785ab){_0x927d2f=_0x927d2f-0x0;var _0x4ae681=_0xadcb[_0x927d2f];return _0x4ae681;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xbadc('0x0'));var jsonpatch=require(_0xbadc('0x1'));var rp=require(_0xbadc('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbadc('0x3'));var path=require(_0xbadc('0x4'));var sox=require(_0xbadc('0x5'));var csv=require(_0xbadc('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbadc('0x7'));var _=require(_0xbadc('0x8'));var squel=require(_0xbadc('0x9'));var crypto=require(_0xbadc('0xa'));var jsforce=require(_0xbadc('0xb'));var deskjs=require(_0xbadc('0xc'));var toCsv=require(_0xbadc('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xbadc('0xd'));var as=require(_0xbadc('0xe'));var hardwareService=require(_0xbadc('0xf'));var logger=require(_0xbadc('0x10'))(_0xbadc('0x11'));var utils=require(_0xbadc('0x12'));var config=require(_0xbadc('0x13'));var licenseUtil=require(_0xbadc('0x14'));var db=require(_0xbadc('0x15'))['db'];function respondWithStatusCode(_0x4cc3fa,_0x470b24){_0x470b24=_0x470b24||0xcc;return function(_0x552a3a){if(_0x552a3a){return _0x4cc3fa[_0xbadc('0x16')](_0x470b24);}return _0x4cc3fa['status'](_0x470b24)[_0xbadc('0x17')]();};}function respondWithResult(_0x549079,_0x4dab25){_0x4dab25=_0x4dab25||0xc8;return function(_0x3cdb94){if(_0x3cdb94){return _0x549079[_0xbadc('0x18')](_0x4dab25)[_0xbadc('0x19')](_0x3cdb94);}};}function respondWithFilteredResult(_0x2679d5,_0x3b6d10){return function(_0x26e05c){if(_0x26e05c){var _0x2f94c0=typeof _0x3b6d10[_0xbadc('0x1a')]===_0xbadc('0x1b')&&typeof _0x3b6d10[_0xbadc('0x1c')]===_0xbadc('0x1b');var _0x5e2ec3=_0x26e05c['count'];var _0x25b263=_0x2f94c0?0x0:_0x3b6d10[_0xbadc('0x1a')];var _0x28e68a=_0x2f94c0?_0x26e05c[_0xbadc('0x1d')]:_0x3b6d10['offset']+_0x3b6d10['limit'];var _0x29c432;if(_0x28e68a>=_0x5e2ec3){_0x28e68a=_0x5e2ec3;_0x29c432=0xc8;}else{_0x29c432=0xce;}_0x2679d5['status'](_0x29c432);return _0x2679d5[_0xbadc('0x1e')](_0xbadc('0x1f'),_0x25b263+'-'+_0x28e68a+'/'+_0x5e2ec3)[_0xbadc('0x19')](_0x26e05c);}return null;};}function patchUpdates(_0x156e83){return function(_0x5924e8){try{jsonpatch['apply'](_0x5924e8,_0x156e83,!![]);}catch(_0x4865dc){return BPromise[_0xbadc('0x20')](_0x4865dc);}return _0x5924e8[_0xbadc('0x21')]();};}function saveUpdates(_0x10fb14,_0x157445){return function(_0x464575){if(_0x464575){return _0x464575[_0xbadc('0x22')](_0x10fb14)['then'](function(_0x4e04f1){return _0x4e04f1;});}return null;};}function removeEntity(_0x43bc10,_0x1527ec){return function(_0x18c23c){if(_0x18c23c){return _0x18c23c[_0xbadc('0x23')]()[_0xbadc('0x24')](function(){_0x43bc10[_0xbadc('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x503e6d,_0x35e169){return function(_0x5b805b){if(!_0x5b805b){_0x503e6d[_0xbadc('0x16')](0x194);}return _0x5b805b;};}function handleError(_0x21d713,_0x2eeb6a){_0x2eeb6a=_0x2eeb6a||0x1f4;return function(_0x11dd34){logger[_0xbadc('0x25')](_0x11dd34[_0xbadc('0x26')]);if(_0x11dd34[_0xbadc('0x27')]){delete _0x11dd34[_0xbadc('0x27')];}_0x21d713[_0xbadc('0x18')](_0x2eeb6a)[_0xbadc('0x28')](_0x11dd34);};}exports[_0xbadc('0x29')]=function(_0xd437b5,_0x386a8b){var _0x4479e6={},_0x56f73b={},_0x39f75f={'count':0x0,'rows':[]};var _0x41adaa=_[_0xbadc('0x2a')](db[_0xbadc('0x2b')][_0xbadc('0x2c')],function(_0x33e768){return{'name':_0x33e768[_0xbadc('0x2d')],'type':_0x33e768[_0xbadc('0x2e')]['key']};});_0x56f73b[_0xbadc('0x2f')]=_[_0xbadc('0x2a')](_0x41adaa,_0xbadc('0x27'));_0x56f73b[_0xbadc('0x30')]=_[_0xbadc('0x31')](_0xd437b5[_0xbadc('0x30')]);_0x56f73b[_0xbadc('0x32')]=_[_0xbadc('0x33')](_0x56f73b['model'],_0x56f73b[_0xbadc('0x30')]);_0x4479e6[_0xbadc('0x34')]=_['intersection'](_0x56f73b[_0xbadc('0x2f')],qs[_0xbadc('0x35')](_0xd437b5[_0xbadc('0x30')][_0xbadc('0x35')]));_0x4479e6[_0xbadc('0x34')]=_0x4479e6['attributes']['length']?_0x4479e6[_0xbadc('0x34')]:_0x56f73b[_0xbadc('0x2f')];if(!_0xd437b5[_0xbadc('0x30')][_0xbadc('0x36')](_0xbadc('0x37'))){_0x4479e6[_0xbadc('0x1c')]=qs[_0xbadc('0x1c')](_0xd437b5['query'][_0xbadc('0x1c')]);_0x4479e6[_0xbadc('0x1a')]=qs['offset'](_0xd437b5[_0xbadc('0x30')]['offset']);}_0x4479e6[_0xbadc('0x38')]=qs['sort'](_0xd437b5[_0xbadc('0x30')][_0xbadc('0x39')]);_0x4479e6['where']=qs[_0xbadc('0x32')](_[_0xbadc('0x3a')](_0xd437b5[_0xbadc('0x30')],_0x56f73b[_0xbadc('0x32')]),_0x41adaa);if(_0xd437b5[_0xbadc('0x30')][_0xbadc('0x3b')]){_0x4479e6[_0xbadc('0x3c')]=_['merge'](_0x4479e6[_0xbadc('0x3c')],{'$or':_['map'](_0x41adaa,function(_0x3f1db7){if(_0x3f1db7[_0xbadc('0x2e')]!==_0xbadc('0x3d')){var _0x3db6b6={};_0x3db6b6[_0x3f1db7['name']]={'$like':'%'+_0xd437b5[_0xbadc('0x30')][_0xbadc('0x3b')]+'%'};return _0x3db6b6;}})});}_0x4479e6=_['merge']({},_0x4479e6,_0xd437b5[_0xbadc('0x3e')]);var _0x1f009f={'where':_0x4479e6[_0xbadc('0x3c')]};return db[_0xbadc('0x2b')][_0xbadc('0x1d')](_0x1f009f)[_0xbadc('0x24')](function(_0x5d4c4e){_0x39f75f[_0xbadc('0x1d')]=_0x5d4c4e;if(_0xd437b5['query'][_0xbadc('0x3f')]){_0x4479e6[_0xbadc('0x40')]=[{'all':!![]}];}return db[_0xbadc('0x2b')][_0xbadc('0x41')](_0x4479e6);})[_0xbadc('0x24')](function(_0x5a4032){_0x39f75f[_0xbadc('0x42')]=_0x5a4032;return _0x39f75f;})[_0xbadc('0x24')](respondWithFilteredResult(_0x386a8b,_0x4479e6))[_0xbadc('0x43')](handleError(_0x386a8b,null));};exports[_0xbadc('0x44')]=function(_0x521414,_0x57b707){var _0x5eafa3={'raw':!![],'where':{'id':_0x521414['params']['id']}},_0x5b9142={};_0x5b9142[_0xbadc('0x2f')]=_[_0xbadc('0x31')](db[_0xbadc('0x2b')]['rawAttributes']);_0x5b9142[_0xbadc('0x30')]=_[_0xbadc('0x31')](_0x521414['query']);_0x5b9142[_0xbadc('0x32')]=_[_0xbadc('0x33')](_0x5b9142[_0xbadc('0x2f')],_0x5b9142[_0xbadc('0x30')]);_0x5eafa3[_0xbadc('0x34')]=_['intersection'](_0x5b9142[_0xbadc('0x2f')],qs['fields'](_0x521414[_0xbadc('0x30')][_0xbadc('0x35')]));_0x5eafa3[_0xbadc('0x34')]=_0x5eafa3[_0xbadc('0x34')]['length']?_0x5eafa3[_0xbadc('0x34')]:_0x5b9142[_0xbadc('0x2f')];if(_0x521414[_0xbadc('0x30')]['includeAll']){_0x5eafa3['include']=[{'all':!![]}];}_0x5eafa3=_[_0xbadc('0x45')]({},_0x5eafa3,_0x521414[_0xbadc('0x3e')]);return db[_0xbadc('0x2b')][_0xbadc('0x46')](_0x5eafa3)[_0xbadc('0x24')](handleEntityNotFound(_0x57b707,null))[_0xbadc('0x24')](respondWithResult(_0x57b707,null))[_0xbadc('0x43')](handleError(_0x57b707,null));};exports[_0xbadc('0x47')]=function(_0x159a42,_0x217b3f){return db[_0xbadc('0x2b')][_0xbadc('0x47')](_0x159a42[_0xbadc('0x48')],{})[_0xbadc('0x24')](respondWithResult(_0x217b3f,0xc9))[_0xbadc('0x43')](handleError(_0x217b3f,null));};exports[_0xbadc('0x22')]=function(_0x318630,_0x2f4eca){if(_0x318630['body']['id']){delete _0x318630[_0xbadc('0x48')]['id'];}return db[_0xbadc('0x2b')][_0xbadc('0x46')]({'where':{'id':_0x318630[_0xbadc('0x49')]['id']}})[_0xbadc('0x24')](handleEntityNotFound(_0x2f4eca,null))[_0xbadc('0x24')](saveUpdates(_0x318630[_0xbadc('0x48')],null))[_0xbadc('0x24')](respondWithResult(_0x2f4eca,null))['catch'](handleError(_0x2f4eca,null));};exports[_0xbadc('0x23')]=function(_0x2cf5b0,_0x5b193f){return db[_0xbadc('0x2b')][_0xbadc('0x46')]({'where':{'id':_0x2cf5b0[_0xbadc('0x49')]['id']}})['then'](handleEntityNotFound(_0x5b193f,null))[_0xbadc('0x24')](removeEntity(_0x5b193f,null))[_0xbadc('0x43')](handleError(_0x5b193f,null));};exports['describe']=function(_0x485142,_0x32f734){return db[_0xbadc('0x2b')][_0xbadc('0x4a')]()[_0xbadc('0x24')](respondWithResult(_0x32f734,null))[_0xbadc('0x43')](handleError(_0x32f734,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index d039c71..9432285 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 _0x4324=['api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x1ee477,_0xe2f0a2){var _0x33ce18=function(_0x154e48){while(--_0x154e48){_0x1ee477['push'](_0x1ee477['shift']());}};_0x33ce18(++_0xe2f0a2);}(_0x4324,0xcf));var _0x4432=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x4324[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x4432('0x0'));var util=require(_0x4432('0x1'));var logger=require(_0x4432('0x2'))(_0x4432('0x3'));var moment=require(_0x4432('0x4'));var BPromise=require(_0x4432('0x5'));var rp=require(_0x4432('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4432('0x7'));var config=require(_0x4432('0x8'));var attributes=require('./openchannelTransferReport.attributes');module[_0x4432('0x9')]=function(_0x40ca4e,_0x215b63){return _0x40ca4e[_0x4432('0xa')](_0x4432('0xb'),attributes,{'tableName':_0x4432('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x4432('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x46f8=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','OpenchannelTransferReport','report_openchannel_transfer','lodash'];(function(_0x4ba7e7,_0x283ce9){var _0x1cb6df=function(_0x50e985){while(--_0x50e985){_0x4ba7e7['push'](_0x4ba7e7['shift']());}};_0x1cb6df(++_0x283ce9);}(_0x46f8,0xcf));var _0x846f=function(_0x205f9d,_0x44e56c){_0x205f9d=_0x205f9d-0x0;var _0x589764=_0x46f8[_0x205f9d];return _0x589764;};'use strict';var _=require(_0x846f('0x0'));var util=require('util');var logger=require(_0x846f('0x1'))(_0x846f('0x2'));var moment=require(_0x846f('0x3'));var BPromise=require(_0x846f('0x4'));var rp=require(_0x846f('0x5'));var fs=require('fs');var path=require(_0x846f('0x6'));var rimraf=require(_0x846f('0x7'));var config=require(_0x846f('0x8'));var attributes=require(_0x846f('0x9'));module[_0x846f('0xa')]=function(_0x321b57,_0x4e2d52){return _0x321b57['define'](_0x846f('0xb'),attributes,{'tableName':_0x846f('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index cbdc70c..a44d24a 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 _0xeff8=['util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash'];(function(_0x1b7b25,_0x14f673){var _0x2dcd50=function(_0x5483a8){while(--_0x5483a8){_0x1b7b25['push'](_0x1b7b25['shift']());}};_0x2dcd50(++_0x14f673);}(_0xeff8,0x186));var _0x8eff=function(_0x4953da,_0x5adaca){_0x4953da=_0x4953da-0x0;var _0x2d3780=_0xeff8[_0x4953da];return _0x2d3780;};'use strict';var _=require(_0x8eff('0x0'));var util=require(_0x8eff('0x1'));var moment=require('moment');var BPromise=require(_0x8eff('0x2'));var rs=require(_0x8eff('0x3'));var fs=require('fs');var Redis=require(_0x8eff('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8eff('0x5'));var logger=require(_0x8eff('0x6'))(_0x8eff('0x7'));var config=require(_0x8eff('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8eff('0x9')][_0x8eff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3409bc,_0x323b2,_0x491f01){return new BPromise(function(_0x3fb9ee,_0x19557f){return client[_0x8eff('0xb')](_0x3409bc,_0x491f01)[_0x8eff('0xc')](function(_0x5bd403){logger['info'](_0x8eff('0xd'),_0x323b2,_0x8eff('0xe'));logger[_0x8eff('0xf')]('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x323b2,_0x8eff('0xe'),JSON[_0x8eff('0x10')](_0x5bd403));if(_0x5bd403['error']){if(_0x5bd403[_0x8eff('0x11')][_0x8eff('0x12')]===0x1f4){logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x323b2,_0x5bd403[_0x8eff('0x11')][_0x8eff('0x13')]);return _0x19557f(_0x5bd403[_0x8eff('0x11')][_0x8eff('0x13')]);}logger[_0x8eff('0x11')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x323b2,_0x5bd403[_0x8eff('0x11')][_0x8eff('0x13')]);return _0x3fb9ee(_0x5bd403[_0x8eff('0x11')][_0x8eff('0x13')]);}else{logger[_0x8eff('0x14')](_0x8eff('0xd'),_0x323b2,_0x8eff('0xe'));_0x3fb9ee(_0x5bd403[_0x8eff('0x15')][_0x8eff('0x13')]);}})[_0x8eff('0x16')](function(_0x137344){logger['error'](_0x8eff('0xd'),_0x323b2,_0x137344);_0x19557f(_0x137344);});});} \ No newline at end of file +var _0xfd6e=['OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','randomstring','ioredis','rpc','client','http','request','then','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x310043,_0x435e95){var _0x43283d=function(_0x247ab8){while(--_0x247ab8){_0x310043['push'](_0x310043['shift']());}};_0x43283d(++_0x435e95);}(_0xfd6e,0x16e));var _0xefd6=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xfd6e[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xefd6('0x0'));var util=require('util');var moment=require(_0xefd6('0x1'));var BPromise=require('bluebird');var rs=require(_0xefd6('0x2'));var fs=require('fs');var Redis=require(_0xefd6('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xefd6('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xefd6('0x5')][_0xefd6('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x26e108,_0xe477f9,_0x340765){return new BPromise(function(_0x5da399,_0x59c636){return client[_0xefd6('0x7')](_0x26e108,_0x340765)[_0xefd6('0x8')](function(_0x3c941a){logger['info'](_0xefd6('0x9'),_0xe477f9,_0xefd6('0xa'));logger[_0xefd6('0xb')](_0xefd6('0xc'),_0xe477f9,'request\x20sent',JSON[_0xefd6('0xd')](_0x3c941a));if(_0x3c941a[_0xefd6('0xe')]){if(_0x3c941a[_0xefd6('0xe')][_0xefd6('0xf')]===0x1f4){logger[_0xefd6('0xe')](_0xefd6('0x9'),_0xe477f9,_0x3c941a[_0xefd6('0xe')][_0xefd6('0x10')]);return _0x59c636(_0x3c941a['error'][_0xefd6('0x10')]);}logger[_0xefd6('0xe')](_0xefd6('0x9'),_0xe477f9,_0x3c941a[_0xefd6('0xe')][_0xefd6('0x10')]);return _0x5da399(_0x3c941a['error'][_0xefd6('0x10')]);}else{logger['info'](_0xefd6('0x9'),_0xe477f9,'request\x20sent');_0x5da399(_0x3c941a[_0xefd6('0x11')][_0xefd6('0x10')]);}})['catch'](function(_0x17bf20){logger[_0xefd6('0xe')](_0xefd6('0x9'),_0xe477f9,_0x17bf20);_0x59c636(_0x17bf20);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index a99ffef..6ab65f9 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 _0xbed3=['get','index','/:id','isAuthenticated','post','create','put','update','exports','multer','connect-timeout','express','Router','../../components/auth/service','./pause.controller'];(function(_0x35559f,_0x1b5309){var _0x1d5da0=function(_0x591856){while(--_0x591856){_0x35559f['push'](_0x35559f['shift']());}};_0x1d5da0(++_0x1b5309);}(_0xbed3,0x81));var _0x3bed=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbed3[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x3bed('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3bed('0x1'));var express=require(_0x3bed('0x2'));var router=express[_0x3bed('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3bed('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3bed('0x5'));router[_0x3bed('0x6')]('/',auth['isAuthenticated'](),controller[_0x3bed('0x7')]);router[_0x3bed('0x6')](_0x3bed('0x8'),auth[_0x3bed('0x9')](),controller['show']);router[_0x3bed('0xa')]('/',auth['isAuthenticated'](),controller[_0x3bed('0xb')]);router[_0x3bed('0xc')](_0x3bed('0x8'),auth[_0x3bed('0x9')](),controller[_0x3bed('0xd')]);router['delete'](_0x3bed('0x8'),auth[_0x3bed('0x9')](),controller['destroy']);module[_0x3bed('0xe')]=router; \ No newline at end of file +var _0xe50e=['path','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','show','post','create','delete','destroy','exports','multer','util'];(function(_0x12cd86,_0x4d2880){var _0x2824bf=function(_0x568baf){while(--_0x568baf){_0x12cd86['push'](_0x12cd86['shift']());}};_0x2824bf(++_0x4d2880);}(_0xe50e,0x7e));var _0xee50=function(_0xdb549,_0x411ca7){_0xdb549=_0xdb549-0x0;var _0x2f3fe2=_0xe50e[_0xdb549];return _0x2f3fe2;};'use strict';var multer=require(_0xee50('0x0'));var util=require(_0xee50('0x1'));var path=require(_0xee50('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xee50('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xee50('0x4'));var interaction=require(_0xee50('0x5'));var config=require('../../config/environment');var controller=require('./pause.controller');router['get']('/',auth[_0xee50('0x6')](),controller[_0xee50('0x7')]);router[_0xee50('0x8')](_0xee50('0x9'),auth[_0xee50('0x6')](),controller[_0xee50('0xa')]);router[_0xee50('0xb')]('/',auth[_0xee50('0x6')](),controller[_0xee50('0xc')]);router['put'](_0xee50('0x9'),auth[_0xee50('0x6')](),controller['update']);router[_0xee50('0xd')](_0xee50('0x9'),auth['isAuthenticated'](),controller[_0xee50('0xe')]);module[_0xee50('0xf')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index a8eaf3b..6a6f574 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 _0x1664=['STRING','name','sequelize','exports'];(function(_0x461eaa,_0x5b9604){var _0x3f2756=function(_0xddf81a){while(--_0xddf81a){_0x461eaa['push'](_0x461eaa['shift']());}};_0x3f2756(++_0x5b9604);}(_0x1664,0xd2));var _0x4166=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0x1664[_0x29d915];return _0x160f86;};'use strict';var Sequelize=require(_0x4166('0x0'));module[_0x4166('0x1')]={'name':{'type':Sequelize[_0x4166('0x2')],'unique':_0x4166('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x574f=['exports','STRING','sequelize'];(function(_0x5cc71f,_0x4f6f52){var _0x4e1b52=function(_0x1bea3b){while(--_0x1bea3b){_0x5cc71f['push'](_0x5cc71f['shift']());}};_0x4e1b52(++_0x4f6f52);}(_0x574f,0x152));var _0xf574=function(_0x50969d,_0x329035){_0x50969d=_0x50969d-0x0;var _0x1b909f=_0x574f[_0x50969d];return _0x1b909f;};'use strict';var Sequelize=require(_0xf574('0x0'));module[_0xf574('0x1')]={'name':{'type':Sequelize[_0xf574('0x2')],'unique':'name','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 f46d00a..b1b8f3c 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 _0x2ffa=['autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','Pauses','UserProfileResource','error','stack','name','send','index','map','Pause','rawAttributes','type','key','model','query','intersection','attributes','fields','length','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection'];(function(_0x234d16,_0x43302d){var _0x333f22=function(_0x42482a){while(--_0x42482a){_0x234d16['push'](_0x234d16['shift']());}};_0x333f22(++_0x43302d);}(_0x2ffa,0x13f));var _0xa2ff=function(_0x3e1332,_0xbdbdd6){_0x3e1332=_0x3e1332-0x0;var _0x2a967b=_0x2ffa[_0x3e1332];return _0x2a967b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa2ff('0x0'));var zipdir=require(_0xa2ff('0x1'));var jsonpatch=require(_0xa2ff('0x2'));var rp=require('request-promise');var moment=require(_0xa2ff('0x3'));var BPromise=require(_0xa2ff('0x4'));var Mustache=require(_0xa2ff('0x5'));var util=require(_0xa2ff('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xa2ff('0x7'));var ejs=require(_0xa2ff('0x8'));var fs=require('fs');var fs_extra=require(_0xa2ff('0x9'));var _=require('lodash');var squel=require(_0xa2ff('0xa'));var crypto=require(_0xa2ff('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa2ff('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa2ff('0xc'));var qs=require(_0xa2ff('0xd'));var as=require(_0xa2ff('0xe'));var hardwareService=require(_0xa2ff('0xf'));var logger=require('../../config/logger')(_0xa2ff('0x10'));var utils=require('../../config/utils');var config=require(_0xa2ff('0x11'));var licenseUtil=require(_0xa2ff('0x12'));var db=require(_0xa2ff('0x13'))['db'];function respondWithStatusCode(_0x10f9d2,_0x13ef6d){_0x13ef6d=_0x13ef6d||0xcc;return function(_0x541371){if(_0x541371){return _0x10f9d2[_0xa2ff('0x14')](_0x13ef6d);}return _0x10f9d2[_0xa2ff('0x15')](_0x13ef6d)[_0xa2ff('0x16')]();};}function respondWithResult(_0x4a764e,_0x41de4b){_0x41de4b=_0x41de4b||0xc8;return function(_0x567a3a){if(_0x567a3a){return _0x4a764e[_0xa2ff('0x15')](_0x41de4b)[_0xa2ff('0x17')](_0x567a3a);}};}function respondWithFilteredResult(_0x654d84,_0x183bba){return function(_0x516b4d){if(_0x516b4d){var _0x5263f8=typeof _0x183bba[_0xa2ff('0x18')]==='undefined'&&typeof _0x183bba[_0xa2ff('0x19')]===_0xa2ff('0x1a');var _0x1df7d=_0x516b4d[_0xa2ff('0x1b')];var _0x59184f=_0x5263f8?0x0:_0x183bba[_0xa2ff('0x18')];var _0x2cf47d=_0x5263f8?_0x516b4d[_0xa2ff('0x1b')]:_0x183bba['offset']+_0x183bba[_0xa2ff('0x19')];var _0x24f155;if(_0x2cf47d>=_0x1df7d){_0x2cf47d=_0x1df7d;_0x24f155=0xc8;}else{_0x24f155=0xce;}_0x654d84['status'](_0x24f155);return _0x654d84['set'](_0xa2ff('0x1c'),_0x59184f+'-'+_0x2cf47d+'/'+_0x1df7d)[_0xa2ff('0x17')](_0x516b4d);}return null;};}function patchUpdates(_0x445061){return function(_0x42a02f){try{jsonpatch[_0xa2ff('0x1d')](_0x42a02f,_0x445061,!![]);}catch(_0x31f008){return BPromise[_0xa2ff('0x1e')](_0x31f008);}return _0x42a02f[_0xa2ff('0x1f')]();};}function saveUpdates(_0x5b02e3,_0x192816){return function(_0x303259){if(_0x303259){return _0x303259[_0xa2ff('0x20')](_0x5b02e3)[_0xa2ff('0x21')](function(_0x1b782f){return _0x1b782f;});}return null;};}function removeEntity(_0x3025f2,_0x252598){return function(_0x4bafd7){if(_0x4bafd7){return _0x4bafd7[_0xa2ff('0x22')]()[_0xa2ff('0x21')](function(){var _0x4a3790=_0x4bafd7['get']({'plain':!![]});var _0x393633=_0xa2ff('0x23');return db[_0xa2ff('0x24')][_0xa2ff('0x22')]({'where':{'type':_0x393633,'resourceId':_0x4a3790['id']}})[_0xa2ff('0x21')](function(){return _0x4bafd7;});})[_0xa2ff('0x21')](function(){_0x3025f2['status'](0xcc)[_0xa2ff('0x16')]();});}};}function handleEntityNotFound(_0x202d36,_0xa9e981){return function(_0x2e967e){if(!_0x2e967e){_0x202d36[_0xa2ff('0x14')](0x194);}return _0x2e967e;};}function handleError(_0x2d3538,_0x27d581){_0x27d581=_0x27d581||0x1f4;return function(_0x443a65){logger[_0xa2ff('0x25')](_0x443a65[_0xa2ff('0x26')]);if(_0x443a65['name']){delete _0x443a65[_0xa2ff('0x27')];}_0x2d3538['status'](_0x27d581)[_0xa2ff('0x28')](_0x443a65);};}exports[_0xa2ff('0x29')]=function(_0x4906ec,_0x4a5ef7){var _0x39d52b={},_0x341188={},_0x5fb955={'count':0x0,'rows':[]};var _0x141b16=_[_0xa2ff('0x2a')](db[_0xa2ff('0x2b')][_0xa2ff('0x2c')],function(_0xd6d247){return{'name':_0xd6d247['fieldName'],'type':_0xd6d247[_0xa2ff('0x2d')][_0xa2ff('0x2e')]};});_0x341188[_0xa2ff('0x2f')]=_[_0xa2ff('0x2a')](_0x141b16,_0xa2ff('0x27'));_0x341188[_0xa2ff('0x30')]=_['keys'](_0x4906ec[_0xa2ff('0x30')]);_0x341188['filters']=_[_0xa2ff('0x31')](_0x341188[_0xa2ff('0x2f')],_0x341188['query']);_0x39d52b[_0xa2ff('0x32')]=_['intersection'](_0x341188[_0xa2ff('0x2f')],qs[_0xa2ff('0x33')](_0x4906ec['query']['fields']));_0x39d52b['attributes']=_0x39d52b[_0xa2ff('0x32')][_0xa2ff('0x34')]?_0x39d52b[_0xa2ff('0x32')]:_0x341188[_0xa2ff('0x2f')];if(!_0x4906ec['query']['hasOwnProperty'](_0xa2ff('0x35'))){_0x39d52b[_0xa2ff('0x19')]=qs['limit'](_0x4906ec['query']['limit']);_0x39d52b[_0xa2ff('0x18')]=qs[_0xa2ff('0x18')](_0x4906ec[_0xa2ff('0x30')][_0xa2ff('0x18')]);}_0x39d52b[_0xa2ff('0x36')]=qs['sort'](_0x4906ec[_0xa2ff('0x30')][_0xa2ff('0x37')]);_0x39d52b['where']=qs[_0xa2ff('0x38')](_[_0xa2ff('0x39')](_0x4906ec['query'],_0x341188['filters']),_0x141b16);if(_0x4906ec[_0xa2ff('0x30')][_0xa2ff('0x3a')]){_0x39d52b[_0xa2ff('0x3b')]=_['merge'](_0x39d52b[_0xa2ff('0x3b')],{'$or':_[_0xa2ff('0x2a')](_0x141b16,function(_0x2ee583){if(_0x2ee583[_0xa2ff('0x2d')]!==_0xa2ff('0x3c')){var _0x15931a={};_0x15931a[_0x2ee583['name']]={'$like':'%'+_0x4906ec[_0xa2ff('0x30')]['filter']+'%'};return _0x15931a;}})});}_0x39d52b=_[_0xa2ff('0x3d')]({},_0x39d52b,_0x4906ec[_0xa2ff('0x3e')]);var _0x2ae319={'where':_0x39d52b[_0xa2ff('0x3b')]};return db[_0xa2ff('0x2b')][_0xa2ff('0x1b')](_0x2ae319)['then'](function(_0x5dabe7){_0x5fb955['count']=_0x5dabe7;if(_0x4906ec[_0xa2ff('0x30')][_0xa2ff('0x3f')]){_0x39d52b[_0xa2ff('0x40')]=[{'all':!![]}];}return db[_0xa2ff('0x2b')][_0xa2ff('0x41')](_0x39d52b);})[_0xa2ff('0x21')](function(_0x4ea21f){_0x5fb955[_0xa2ff('0x42')]=_0x4ea21f;return _0x5fb955;})[_0xa2ff('0x21')](respondWithFilteredResult(_0x4a5ef7,_0x39d52b))['catch'](handleError(_0x4a5ef7,null));};exports[_0xa2ff('0x43')]=function(_0xb49d06,_0x2e1333){var _0x58f475={'raw':!![],'where':{'id':_0xb49d06['params']['id']}},_0x4333eb={};_0x4333eb[_0xa2ff('0x2f')]=_['keys'](db[_0xa2ff('0x2b')]['rawAttributes']);_0x4333eb[_0xa2ff('0x30')]=_['keys'](_0xb49d06[_0xa2ff('0x30')]);_0x4333eb[_0xa2ff('0x38')]=_[_0xa2ff('0x31')](_0x4333eb['model'],_0x4333eb[_0xa2ff('0x30')]);_0x58f475[_0xa2ff('0x32')]=_[_0xa2ff('0x31')](_0x4333eb[_0xa2ff('0x2f')],qs[_0xa2ff('0x33')](_0xb49d06[_0xa2ff('0x30')]['fields']));_0x58f475['attributes']=_0x58f475['attributes']['length']?_0x58f475['attributes']:_0x4333eb['model'];if(_0xb49d06[_0xa2ff('0x30')][_0xa2ff('0x3f')]){_0x58f475['include']=[{'all':!![]}];}_0x58f475=_[_0xa2ff('0x3d')]({},_0x58f475,_0xb49d06['options']);return db[_0xa2ff('0x2b')][_0xa2ff('0x44')](_0x58f475)[_0xa2ff('0x21')](handleEntityNotFound(_0x2e1333,null))[_0xa2ff('0x21')](respondWithResult(_0x2e1333,null))[_0xa2ff('0x45')](handleError(_0x2e1333,null));};exports[_0xa2ff('0x46')]=function(_0x3310db,_0x2d3eba){return db[_0xa2ff('0x2b')][_0xa2ff('0x46')](_0x3310db[_0xa2ff('0x47')],{})[_0xa2ff('0x21')](function(_0xb06161){var _0x34bbed=_0x3310db['user']['get']({'plain':!![]});if(!_0x34bbed)throw new Error(_0xa2ff('0x48'));if(_0x34bbed[_0xa2ff('0x49')]===_0xa2ff('0x4a')){var _0x2a1ea3=_0xb06161['get']({'plain':!![]});var _0x3d4c8e='Pauses';return db[_0xa2ff('0x4b')][_0xa2ff('0x44')]({'where':{'name':_0x3d4c8e,'userProfileId':_0x34bbed['userProfileId']},'raw':!![]})['then'](function(_0x4bdd59){if(_0x4bdd59&&_0x4bdd59[_0xa2ff('0x4c')]===0x0){return db[_0xa2ff('0x24')][_0xa2ff('0x46')]({'name':_0x2a1ea3[_0xa2ff('0x27')],'resourceId':_0x2a1ea3['id'],'type':_0x4bdd59['name'],'sectionId':_0x4bdd59['id']},{})[_0xa2ff('0x21')](function(){return _0xb06161;});}else{return _0xb06161;}})[_0xa2ff('0x45')](function(_0x302bcb){logger['error'](_0xa2ff('0x4d'),_0x302bcb);throw _0x302bcb;});}return _0xb06161;})[_0xa2ff('0x21')](respondWithResult(_0x2d3eba,0xc9))['catch'](handleError(_0x2d3eba,null));};exports[_0xa2ff('0x20')]=function(_0x1292c6,_0x111dd3){if(_0x1292c6['body']['id']){delete _0x1292c6[_0xa2ff('0x47')]['id'];}return db[_0xa2ff('0x2b')][_0xa2ff('0x44')]({'where':{'id':_0x1292c6[_0xa2ff('0x4e')]['id']}})[_0xa2ff('0x21')](handleEntityNotFound(_0x111dd3,null))[_0xa2ff('0x21')](saveUpdates(_0x1292c6[_0xa2ff('0x47')],null))[_0xa2ff('0x21')](respondWithResult(_0x111dd3,null))[_0xa2ff('0x45')](handleError(_0x111dd3,null));};exports['destroy']=function(_0x5d3404,_0x6ff2a4){return db[_0xa2ff('0x2b')][_0xa2ff('0x44')]({'where':{'id':_0x5d3404[_0xa2ff('0x4e')]['id']}})[_0xa2ff('0x21')](handleEntityNotFound(_0x6ff2a4,null))[_0xa2ff('0x21')](removeEntity(_0x6ff2a4,null))[_0xa2ff('0x45')](handleError(_0x6ff2a4,null));}; \ No newline at end of file +var _0xd7ac=['options','includeAll','findAll','rows','show','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','params','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','apply','update','then','destroy','get','Pauses','UserProfileResource','error','name','send','map','Pause','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge'];(function(_0xd31048,_0x5bc8b2){var _0x59f681=function(_0x252d7f){while(--_0x252d7f){_0xd31048['push'](_0xd31048['shift']());}};_0x59f681(++_0x5bc8b2);}(_0xd7ac,0xb0));var _0xcd7a=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xd7ac[_0x178e48];return _0x440d7e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xcd7a('0x0'));var jsonpatch=require(_0xcd7a('0x1'));var rp=require(_0xcd7a('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xcd7a('0x3'));var util=require(_0xcd7a('0x4'));var path=require('path');var sox=require(_0xcd7a('0x5'));var csv=require(_0xcd7a('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcd7a('0x7'));var _=require(_0xcd7a('0x8'));var squel=require('squel');var crypto=require(_0xcd7a('0x9'));var jsforce=require(_0xcd7a('0xa'));var deskjs=require(_0xcd7a('0xb'));var toCsv=require(_0xcd7a('0x6'));var querystring=require(_0xcd7a('0xc'));var Papa=require(_0xcd7a('0xd'));var Redis=require(_0xcd7a('0xe'));var authService=require(_0xcd7a('0xf'));var qs=require(_0xcd7a('0x10'));var as=require(_0xcd7a('0x11'));var hardwareService=require(_0xcd7a('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xcd7a('0x13'));var config=require(_0xcd7a('0x14'));var licenseUtil=require(_0xcd7a('0x15'));var db=require(_0xcd7a('0x16'))['db'];function respondWithStatusCode(_0x3f8e77,_0x322b47){_0x322b47=_0x322b47||0xcc;return function(_0x32dd3a){if(_0x32dd3a){return _0x3f8e77[_0xcd7a('0x17')](_0x322b47);}return _0x3f8e77[_0xcd7a('0x18')](_0x322b47)['end']();};}function respondWithResult(_0x51854e,_0x3dc2d7){_0x3dc2d7=_0x3dc2d7||0xc8;return function(_0x4d094f){if(_0x4d094f){return _0x51854e['status'](_0x3dc2d7)[_0xcd7a('0x19')](_0x4d094f);}};}function respondWithFilteredResult(_0x24b9f9,_0x13f670){return function(_0x1328f5){if(_0x1328f5){var _0x2a9737=typeof _0x13f670[_0xcd7a('0x1a')]==='undefined'&&typeof _0x13f670['limit']===_0xcd7a('0x1b');var _0x45632f=_0x1328f5[_0xcd7a('0x1c')];var _0xf19d86=_0x2a9737?0x0:_0x13f670[_0xcd7a('0x1a')];var _0x3d7e28=_0x2a9737?_0x1328f5[_0xcd7a('0x1c')]:_0x13f670['offset']+_0x13f670['limit'];var _0xaa9de3;if(_0x3d7e28>=_0x45632f){_0x3d7e28=_0x45632f;_0xaa9de3=0xc8;}else{_0xaa9de3=0xce;}_0x24b9f9[_0xcd7a('0x18')](_0xaa9de3);return _0x24b9f9[_0xcd7a('0x1d')]('Content-Range',_0xf19d86+'-'+_0x3d7e28+'/'+_0x45632f)[_0xcd7a('0x19')](_0x1328f5);}return null;};}function patchUpdates(_0x19edda){return function(_0x275065){try{jsonpatch[_0xcd7a('0x1e')](_0x275065,_0x19edda,!![]);}catch(_0x2c26a9){return BPromise['reject'](_0x2c26a9);}return _0x275065['save']();};}function saveUpdates(_0x10b0b8,_0x375f1c){return function(_0x27447b){if(_0x27447b){return _0x27447b[_0xcd7a('0x1f')](_0x10b0b8)[_0xcd7a('0x20')](function(_0x5df2ba){return _0x5df2ba;});}return null;};}function removeEntity(_0x4434f2,_0x180eaa){return function(_0xc1b5fa){if(_0xc1b5fa){return _0xc1b5fa[_0xcd7a('0x21')]()[_0xcd7a('0x20')](function(){var _0x5db1f8=_0xc1b5fa[_0xcd7a('0x22')]({'plain':!![]});var _0x2ccc30=_0xcd7a('0x23');return db[_0xcd7a('0x24')]['destroy']({'where':{'type':_0x2ccc30,'resourceId':_0x5db1f8['id']}})[_0xcd7a('0x20')](function(){return _0xc1b5fa;});})[_0xcd7a('0x20')](function(){_0x4434f2[_0xcd7a('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2361f3,_0x191556){return function(_0x2d6373){if(!_0x2d6373){_0x2361f3[_0xcd7a('0x17')](0x194);}return _0x2d6373;};}function handleError(_0x1ccb51,_0x2885fb){_0x2885fb=_0x2885fb||0x1f4;return function(_0x2a9ee5){logger[_0xcd7a('0x25')](_0x2a9ee5['stack']);if(_0x2a9ee5[_0xcd7a('0x26')]){delete _0x2a9ee5[_0xcd7a('0x26')];}_0x1ccb51[_0xcd7a('0x18')](_0x2885fb)[_0xcd7a('0x27')](_0x2a9ee5);};}exports['index']=function(_0x3745c4,_0x271aa3){var _0xdb32fc={},_0x56e28a={},_0x4f4f98={'count':0x0,'rows':[]};var _0x501ccf=_[_0xcd7a('0x28')](db[_0xcd7a('0x29')][_0xcd7a('0x2a')],function(_0x38661b){return{'name':_0x38661b[_0xcd7a('0x2b')],'type':_0x38661b[_0xcd7a('0x2c')]['key']};});_0x56e28a['model']=_[_0xcd7a('0x28')](_0x501ccf,_0xcd7a('0x26'));_0x56e28a[_0xcd7a('0x2d')]=_[_0xcd7a('0x2e')](_0x3745c4[_0xcd7a('0x2d')]);_0x56e28a[_0xcd7a('0x2f')]=_[_0xcd7a('0x30')](_0x56e28a[_0xcd7a('0x31')],_0x56e28a[_0xcd7a('0x2d')]);_0xdb32fc[_0xcd7a('0x32')]=_[_0xcd7a('0x30')](_0x56e28a[_0xcd7a('0x31')],qs[_0xcd7a('0x33')](_0x3745c4[_0xcd7a('0x2d')][_0xcd7a('0x33')]));_0xdb32fc[_0xcd7a('0x32')]=_0xdb32fc[_0xcd7a('0x32')][_0xcd7a('0x34')]?_0xdb32fc[_0xcd7a('0x32')]:_0x56e28a['model'];if(!_0x3745c4[_0xcd7a('0x2d')][_0xcd7a('0x35')](_0xcd7a('0x36'))){_0xdb32fc[_0xcd7a('0x37')]=qs[_0xcd7a('0x37')](_0x3745c4[_0xcd7a('0x2d')][_0xcd7a('0x37')]);_0xdb32fc[_0xcd7a('0x1a')]=qs[_0xcd7a('0x1a')](_0x3745c4[_0xcd7a('0x2d')][_0xcd7a('0x1a')]);}_0xdb32fc[_0xcd7a('0x38')]=qs[_0xcd7a('0x39')](_0x3745c4['query'][_0xcd7a('0x39')]);_0xdb32fc[_0xcd7a('0x3a')]=qs[_0xcd7a('0x2f')](_['pick'](_0x3745c4[_0xcd7a('0x2d')],_0x56e28a['filters']),_0x501ccf);if(_0x3745c4[_0xcd7a('0x2d')][_0xcd7a('0x3b')]){_0xdb32fc[_0xcd7a('0x3a')]=_['merge'](_0xdb32fc[_0xcd7a('0x3a')],{'$or':_['map'](_0x501ccf,function(_0x112ce6){if(_0x112ce6[_0xcd7a('0x2c')]!=='VIRTUAL'){var _0xc32cd1={};_0xc32cd1[_0x112ce6[_0xcd7a('0x26')]]={'$like':'%'+_0x3745c4[_0xcd7a('0x2d')]['filter']+'%'};return _0xc32cd1;}})});}_0xdb32fc=_[_0xcd7a('0x3c')]({},_0xdb32fc,_0x3745c4[_0xcd7a('0x3d')]);var _0x2b86e4={'where':_0xdb32fc[_0xcd7a('0x3a')]};return db[_0xcd7a('0x29')][_0xcd7a('0x1c')](_0x2b86e4)[_0xcd7a('0x20')](function(_0x3339d1){_0x4f4f98[_0xcd7a('0x1c')]=_0x3339d1;if(_0x3745c4[_0xcd7a('0x2d')][_0xcd7a('0x3e')]){_0xdb32fc['include']=[{'all':!![]}];}return db[_0xcd7a('0x29')][_0xcd7a('0x3f')](_0xdb32fc);})[_0xcd7a('0x20')](function(_0x175ddc){_0x4f4f98[_0xcd7a('0x40')]=_0x175ddc;return _0x4f4f98;})['then'](respondWithFilteredResult(_0x271aa3,_0xdb32fc))['catch'](handleError(_0x271aa3,null));};exports[_0xcd7a('0x41')]=function(_0x5dc907,_0x77005f){var _0x4c2c4a={'raw':!![],'where':{'id':_0x5dc907['params']['id']}},_0x212678={};_0x212678[_0xcd7a('0x31')]=_[_0xcd7a('0x2e')](db[_0xcd7a('0x29')]['rawAttributes']);_0x212678['query']=_[_0xcd7a('0x2e')](_0x5dc907[_0xcd7a('0x2d')]);_0x212678[_0xcd7a('0x2f')]=_[_0xcd7a('0x30')](_0x212678[_0xcd7a('0x31')],_0x212678['query']);_0x4c2c4a['attributes']=_[_0xcd7a('0x30')](_0x212678[_0xcd7a('0x31')],qs['fields'](_0x5dc907['query'][_0xcd7a('0x33')]));_0x4c2c4a['attributes']=_0x4c2c4a[_0xcd7a('0x32')][_0xcd7a('0x34')]?_0x4c2c4a[_0xcd7a('0x32')]:_0x212678[_0xcd7a('0x31')];if(_0x5dc907['query'][_0xcd7a('0x3e')]){_0x4c2c4a[_0xcd7a('0x42')]=[{'all':!![]}];}_0x4c2c4a=_[_0xcd7a('0x3c')]({},_0x4c2c4a,_0x5dc907[_0xcd7a('0x3d')]);return db[_0xcd7a('0x29')][_0xcd7a('0x43')](_0x4c2c4a)[_0xcd7a('0x20')](handleEntityNotFound(_0x77005f,null))[_0xcd7a('0x20')](respondWithResult(_0x77005f,null))[_0xcd7a('0x44')](handleError(_0x77005f,null));};exports[_0xcd7a('0x45')]=function(_0x15c248,_0x2a5576){return db[_0xcd7a('0x29')][_0xcd7a('0x45')](_0x15c248['body'],{})[_0xcd7a('0x20')](function(_0x39a404){var _0x1404f9=_0x15c248[_0xcd7a('0x46')][_0xcd7a('0x22')]({'plain':!![]});if(!_0x1404f9)throw new Error(_0xcd7a('0x47'));if(_0x1404f9[_0xcd7a('0x48')]===_0xcd7a('0x46')){var _0x1adc70=_0x39a404[_0xcd7a('0x22')]({'plain':!![]});var _0x2f4921='Pauses';return db[_0xcd7a('0x49')][_0xcd7a('0x43')]({'where':{'name':_0x2f4921,'userProfileId':_0x1404f9[_0xcd7a('0x4a')]},'raw':!![]})[_0xcd7a('0x20')](function(_0xd4491a){if(_0xd4491a&&_0xd4491a[_0xcd7a('0x4b')]===0x0){return db[_0xcd7a('0x24')][_0xcd7a('0x45')]({'name':_0x1adc70[_0xcd7a('0x26')],'resourceId':_0x1adc70['id'],'type':_0xd4491a['name'],'sectionId':_0xd4491a['id']},{})[_0xcd7a('0x20')](function(){return _0x39a404;});}else{return _0x39a404;}})[_0xcd7a('0x44')](function(_0x40f19a){logger[_0xcd7a('0x25')](_0xcd7a('0x4c'),_0x40f19a);throw _0x40f19a;});}return _0x39a404;})[_0xcd7a('0x20')](respondWithResult(_0x2a5576,0xc9))[_0xcd7a('0x44')](handleError(_0x2a5576,null));};exports[_0xcd7a('0x1f')]=function(_0x317289,_0xa1dc5e){if(_0x317289[_0xcd7a('0x4d')]['id']){delete _0x317289['body']['id'];}return db[_0xcd7a('0x29')][_0xcd7a('0x43')]({'where':{'id':_0x317289['params']['id']}})[_0xcd7a('0x20')](handleEntityNotFound(_0xa1dc5e,null))[_0xcd7a('0x20')](saveUpdates(_0x317289['body'],null))[_0xcd7a('0x20')](respondWithResult(_0xa1dc5e,null))[_0xcd7a('0x44')](handleError(_0xa1dc5e,null));};exports[_0xcd7a('0x21')]=function(_0x8d47f4,_0x11bf03){return db[_0xcd7a('0x29')][_0xcd7a('0x43')]({'where':{'id':_0x8d47f4[_0xcd7a('0x4e')]['id']}})['then'](handleEntityNotFound(_0x11bf03,null))[_0xcd7a('0x20')](removeEntity(_0x11bf03,null))[_0xcd7a('0x44')](handleError(_0x11bf03,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index b8b211e..26d853b 100644 --- a/server/api/pause/pause.model.js +++ b/server/api/pause/pause.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe14b=['bluebird','path','./pause.attributes','exports','define','Pause','tools_pauses','lodash','util','moment'];(function(_0x4aeaed,_0x20506f){var _0x584c3c=function(_0x2d2e54){while(--_0x2d2e54){_0x4aeaed['push'](_0x4aeaed['shift']());}};_0x584c3c(++_0x20506f);}(_0xe14b,0x93));var _0xbe14=function(_0x211e5a,_0x316ab4){_0x211e5a=_0x211e5a-0x0;var _0x3eb1aa=_0xe14b[_0x211e5a];return _0x3eb1aa;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf494=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','define','lodash','util'];(function(_0x4e48f9,_0x4d8d49){var _0x45d217=function(_0x1304e7){while(--_0x1304e7){_0x4e48f9['push'](_0x4e48f9['shift']());}};_0x45d217(++_0x4d8d49);}(_0xf494,0x1c6));var _0x4f49=function(_0x281357,_0x3dada9){_0x281357=_0x281357-0x0;var _0x3d0f2d=_0xf494[_0x281357];return _0x3d0f2d;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var logger=require(_0x4f49('0x2'))('api');var moment=require(_0x4f49('0x3'));var BPromise=require(_0x4f49('0x4'));var rp=require(_0x4f49('0x5'));var fs=require('fs');var path=require(_0x4f49('0x6'));var rimraf=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var attributes=require(_0x4f49('0x9'));module[_0x4f49('0xa')]=function(_0xc5e778,_0x413530){return _0xc5e778[_0x4f49('0xb')]('Pause',attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index 695ee9b..8d837d4 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(_0x2010da,_0x27c595){var _0x203164=function(_0x5029fd){while(--_0x5029fd){_0x2010da['push'](_0x2010da['shift']());}};_0x203164(++_0x27c595);}(_0x7a54,0x106));var _0x47a5=function(_0x823dab,_0x1694f3){_0x823dab=_0x823dab-0x0;var _0xe52970=_0x7a54[_0x823dab];return _0xe52970;};'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(_0x294ff9,_0x364045){var _0x25edd0=function(_0x585bb3){while(--_0x585bb3){_0x294ff9['push'](_0x294ff9['shift']());}};_0x25edd0(++_0x364045);}(_0xb10b,0x12a));var _0xbb10=function(_0x1ca995,_0x458edc){_0x1ca995=_0x1ca995-0x0;var _0x6c1cbb=_0xb10b[_0x1ca995];return _0x6c1cbb;};'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 034534c..141457f 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 _0x0faf=['extname','now','post','single','file','webhookPost','put','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','isAuthenticated','index','get','/webhook','webhookGet','/:id','/:id/download','download','diskStorage','join','server/files/plugins','originalname','replace','basename'];(function(_0x3cd91d,_0x163516){var _0x3b4fab=function(_0x1b3319){while(--_0x1b3319){_0x3cd91d['push'](_0x3cd91d['shift']());}};_0x3b4fab(++_0x163516);}(_0x0faf,0x132));var _0xf0fa=function(_0x5f382f,_0x3f1432){_0x5f382f=_0x5f382f-0x0;var _0x3bb11b=_0x0faf[_0x5f382f];return _0x3bb11b;};'use strict';var multer=require(_0xf0fa('0x0'));var util=require('util');var path=require(_0xf0fa('0x1'));var timeout=require(_0xf0fa('0x2'));var express=require(_0xf0fa('0x3'));var router=express[_0xf0fa('0x4')]();var fs_extra=require(_0xf0fa('0x5'));var auth=require(_0xf0fa('0x6'));var interaction=require(_0xf0fa('0x7'));var config=require(_0xf0fa('0x8'));var controller=require(_0xf0fa('0x9'));router['get']('/',auth[_0xf0fa('0xa')](),controller[_0xf0fa('0xb')]);router[_0xf0fa('0xc')](_0xf0fa('0xd'),controller[_0xf0fa('0xe')]);router['get'](_0xf0fa('0xf'),auth[_0xf0fa('0xa')](),controller['show']);router['get'](_0xf0fa('0x10'),auth[_0xf0fa('0xa')](),controller[_0xf0fa('0x11')]);var upload=multer({'storage':multer[_0xf0fa('0x12')]({'destination':function(_0x2bd807,_0x1151ea,_0x379ff6){_0x379ff6(null,path[_0xf0fa('0x13')](config['root'],_0xf0fa('0x14')));},'filename':function(_0x5b38fa,_0x2f46ff,_0x521034){_0x2f46ff[_0xf0fa('0x15')]=_0x2f46ff[_0xf0fa('0x15')][_0xf0fa('0x16')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x521034(null,util['format']('%s-%s%s',path[_0xf0fa('0x17')](_0x2f46ff['originalname'],path[_0xf0fa('0x18')](_0x2f46ff[_0xf0fa('0x15')])),Date[_0xf0fa('0x19')](),path[_0xf0fa('0x18')](_0x2f46ff[_0xf0fa('0x15')])));}})});router[_0xf0fa('0x1a')]('/',upload[_0xf0fa('0x1b')](_0xf0fa('0x1c')),controller['upload']);router[_0xf0fa('0x1a')](_0xf0fa('0xd'),controller[_0xf0fa('0x1d')]);router[_0xf0fa('0x1e')](_0xf0fa('0xf'),auth[_0xf0fa('0xa')](),controller['update']);router['delete'](_0xf0fa('0xf'),auth[_0xf0fa('0xa')](),controller[_0xf0fa('0x1f')]);module[_0xf0fa('0x20')]=router; \ No newline at end of file +var _0xd0bb=['../../components/auth/service','../../config/environment','get','isAuthenticated','index','/webhook','/:id','show','download','diskStorage','root','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','post','single','file','webhookPost','put','update','delete','exports','multer','util','path','express','fs-extra'];(function(_0xf699a2,_0x4b6421){var _0x17f686=function(_0x5efe3b){while(--_0x5efe3b){_0xf699a2['push'](_0xf699a2['shift']());}};_0x17f686(++_0x4b6421);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0xcdfdb2,_0x151157){_0xcdfdb2=_0xcdfdb2-0x0;var _0x21f715=_0xd0bb[_0xcdfdb2];return _0x21f715;};'use strict';var multer=require(_0xbd0b('0x0'));var util=require(_0xbd0b('0x1'));var path=require(_0xbd0b('0x2'));var timeout=require('connect-timeout');var express=require(_0xbd0b('0x3'));var router=express['Router']();var fs_extra=require(_0xbd0b('0x4'));var auth=require(_0xbd0b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xbd0b('0x6'));var controller=require('./plugin.controller');router[_0xbd0b('0x7')]('/',auth[_0xbd0b('0x8')](),controller[_0xbd0b('0x9')]);router[_0xbd0b('0x7')](_0xbd0b('0xa'),controller['webhookGet']);router[_0xbd0b('0x7')](_0xbd0b('0xb'),auth[_0xbd0b('0x8')](),controller[_0xbd0b('0xc')]);router[_0xbd0b('0x7')]('/:id/download',auth['isAuthenticated'](),controller[_0xbd0b('0xd')]);var upload=multer({'storage':multer[_0xbd0b('0xe')]({'destination':function(_0x4a69ff,_0x26b834,_0x196beb){_0x196beb(null,path['join'](config[_0xbd0b('0xf')],_0xbd0b('0x10')));},'filename':function(_0x3a4b28,_0x315ed9,_0x2621bf){_0x315ed9[_0xbd0b('0x11')]=_0x315ed9[_0xbd0b('0x11')][_0xbd0b('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2621bf(null,util[_0xbd0b('0x13')](_0xbd0b('0x14'),path[_0xbd0b('0x15')](_0x315ed9['originalname'],path[_0xbd0b('0x16')](_0x315ed9['originalname'])),Date['now'](),path[_0xbd0b('0x16')](_0x315ed9[_0xbd0b('0x11')])));}})});router[_0xbd0b('0x17')]('/',upload[_0xbd0b('0x18')](_0xbd0b('0x19')),controller['upload']);router['post'](_0xbd0b('0xa'),controller[_0xbd0b('0x1a')]);router[_0xbd0b('0x1b')](_0xbd0b('0xb'),auth[_0xbd0b('0x8')](),controller[_0xbd0b('0x1c')]);router['delete'](_0xbd0b('0xb'),auth['isAuthenticated'](),controller[_0xbd0b('0x1d')]);module[_0xbd0b('0x1e')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index aa60a2a..b4998e1 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 _0x238d=['sequelize','exports','STRING','ENUM','script','TEXT','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'];(function(_0x315a04,_0x36e566){var _0x176926=function(_0x4db34d){while(--_0x4db34d){_0x315a04['push'](_0x315a04['shift']());}};_0x176926(++_0x36e566);}(_0x238d,0x1bc));var _0xd238=function(_0x487f86,_0x32d35b){_0x487f86=_0x487f86-0x0;var _0x49cf32=_0x238d[_0x487f86];return _0x49cf32;};'use strict';var Sequelize=require(_0xd238('0x0'));module[_0xd238('0x1')]={'name':{'type':Sequelize[_0xd238('0x2')]},'type':{'type':Sequelize[_0xd238('0x3')]('html',_0xd238('0x4'))},'description':{'type':Sequelize[_0xd238('0x5')]},'version':{'type':Sequelize[_0xd238('0x5')]},'path':{'type':Sequelize[_0xd238('0x2')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xd238('0x6')},'sidebar':{'type':Sequelize[_0xd238('0x3')](_0xd238('0x7'),_0xd238('0x8'),_0xd238('0x9'),_0xd238('0xa')),'defaultValue':_0xd238('0x9'),'comment':_0xd238('0xb')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0xd238('0x2')]},'agentUrl':{'type':Sequelize[_0xd238('0x2')]},'scriptName':{'type':Sequelize[_0xd238('0x2')]},'scriptPath':{'type':Sequelize[_0xd238('0x2')]}}; \ No newline at end of file +var _0xe340=['sequelize','exports','STRING','ENUM','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','never','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'];(function(_0xa16cd6,_0x5d1986){var _0x3f1420=function(_0x4b7309){while(--_0x4b7309){_0xa16cd6['push'](_0xa16cd6['shift']());}};_0x3f1420(++_0x5d1986);}(_0xe340,0x10a));var _0x0e34=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xe340[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0x0e34('0x0'));module[_0x0e34('0x1')]={'name':{'type':Sequelize[_0x0e34('0x2')]},'type':{'type':Sequelize[_0x0e34('0x3')](_0x0e34('0x4'),_0x0e34('0x5'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0x0e34('0x6')]},'path':{'type':Sequelize['STRING'],'comment':_0x0e34('0x7')},'active':{'type':Sequelize[_0x0e34('0x8')],'defaultValue':0x0,'comment':_0x0e34('0x9')},'sidebar':{'type':Sequelize['ENUM'](_0x0e34('0xa'),'agentOnly','always',_0x0e34('0xb')),'defaultValue':_0x0e34('0xc'),'comment':_0x0e34('0xd')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0x0e34('0x2')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index eca3670..45e43b3 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 _0x46f9=['count','includeAll','include','findAll','rows','catch','show','params','find','download','join','root','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','Error','pipe','glob','dirname','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','Download\x20completed','upload','filename','extname','file','info','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','Invalid\x20manifest:\x20parameters\x20missing','parameters','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','description','sidebar','icon','html','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','unlinkSync','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','http://localhost:','encoding','%s%s','headers','content-length','content-type','endsWith','statusCode','hostname','method','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','end','error','stack','name','send','index','map','Plugin','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','where','pick','filter','merge','VIRTUAL','options'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x46f9,0x1c5));var _0x946f=function(_0x313f90,_0xa58897){_0x313f90=_0x313f90-0x0;var _0x3e0fb6=_0x46f9[_0x313f90];return _0x3e0fb6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x946f('0x0'));var zipdir=require(_0x946f('0x1'));var jsonpatch=require(_0x946f('0x2'));var rp=require('request-promise');var moment=require(_0x946f('0x3'));var BPromise=require(_0x946f('0x4'));var Mustache=require(_0x946f('0x5'));var util=require(_0x946f('0x6'));var path=require(_0x946f('0x7'));var sox=require(_0x946f('0x8'));var csv=require('to-csv');var ejs=require(_0x946f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x946f('0xa'));var squel=require(_0x946f('0xb'));var crypto=require(_0x946f('0xc'));var jsforce=require(_0x946f('0xd'));var deskjs=require(_0x946f('0xe'));var toCsv=require(_0x946f('0xf'));var querystring=require(_0x946f('0x10'));var Papa=require(_0x946f('0x11'));var extract=require('extract-zip');var rimraf=require(_0x946f('0x0'));var archiver=require('archiver');var Redis=require(_0x946f('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x946f('0x13'));var as=require(_0x946f('0x14'));var hardwareService=require(_0x946f('0x15'));var logger=require(_0x946f('0x16'))(_0x946f('0x17'));var utils=require(_0x946f('0x18'));var config=require(_0x946f('0x19'));var licenseUtil=require(_0x946f('0x1a'));var db=require(_0x946f('0x1b'))['db'];config[_0x946f('0x1c')]=_[_0x946f('0x1d')](config[_0x946f('0x1c')],{'host':_0x946f('0x1e'),'port':0x18eb});var socket=require(_0x946f('0x1f'))(new Redis(config[_0x946f('0x1c')]));require(_0x946f('0x20'))['register'](socket);function respondWithStatusCode(_0x48a710,_0x182dbc){_0x182dbc=_0x182dbc||0xcc;return function(_0xa016ae){if(_0xa016ae){return _0x48a710[_0x946f('0x21')](_0x182dbc);}return _0x48a710[_0x946f('0x22')](_0x182dbc)['end']();};}function respondWithResult(_0x5c2358,_0x16a7b3){_0x16a7b3=_0x16a7b3||0xc8;return function(_0x3cf46f){if(_0x3cf46f){return _0x5c2358[_0x946f('0x22')](_0x16a7b3)[_0x946f('0x23')](_0x3cf46f);}};}function respondWithFilteredResult(_0x421ff9,_0x2b33ca){return function(_0x32ec33){if(_0x32ec33){var _0x1ceb14=typeof _0x2b33ca[_0x946f('0x24')]===_0x946f('0x25')&&typeof _0x2b33ca['limit']===_0x946f('0x25');var _0x20556b=_0x32ec33['count'];var _0x3dc226=_0x1ceb14?0x0:_0x2b33ca[_0x946f('0x24')];var _0x7f615d=_0x1ceb14?_0x32ec33['count']:_0x2b33ca[_0x946f('0x24')]+_0x2b33ca[_0x946f('0x26')];var _0x3512e6;if(_0x7f615d>=_0x20556b){_0x7f615d=_0x20556b;_0x3512e6=0xc8;}else{_0x3512e6=0xce;}_0x421ff9['status'](_0x3512e6);return _0x421ff9[_0x946f('0x27')](_0x946f('0x28'),_0x3dc226+'-'+_0x7f615d+'/'+_0x20556b)[_0x946f('0x23')](_0x32ec33);}return null;};}function patchUpdates(_0x282cdb){return function(_0x13efc8){try{jsonpatch[_0x946f('0x29')](_0x13efc8,_0x282cdb,!![]);}catch(_0xa28d13){return BPromise['reject'](_0xa28d13);}return _0x13efc8[_0x946f('0x2a')]();};}function saveUpdates(_0x1d6fa0,_0x413069){return function(_0x59cb09){if(_0x59cb09){return _0x59cb09[_0x946f('0x2b')](_0x1d6fa0)[_0x946f('0x2c')](function(_0x1e6895){return _0x1e6895;});}return null;};}function removeEntity(_0x542063,_0x5a33e9){return function(_0xb91f4f){if(_0xb91f4f){return _0xb91f4f[_0x946f('0x2d')]()[_0x946f('0x2c')](function(){var _0x3fa0f2=_0xb91f4f[_0x946f('0x2e')]({'plain':!![]});var _0x6f4e8='Plugins';return db[_0x946f('0x2f')][_0x946f('0x2d')]({'where':{'type':_0x6f4e8,'resourceId':_0x3fa0f2['id']}})[_0x946f('0x2c')](function(){return _0xb91f4f;});})[_0x946f('0x2c')](function(){_0x542063[_0x946f('0x22')](0xcc)[_0x946f('0x30')]();});}};}function handleEntityNotFound(_0x2b50aa,_0x42b3cf){return function(_0x592720){if(!_0x592720){_0x2b50aa[_0x946f('0x21')](0x194);}return _0x592720;};}function handleError(_0x2f6c0c,_0x2146b1){_0x2146b1=_0x2146b1||0x1f4;return function(_0x561f90){logger[_0x946f('0x31')](_0x561f90[_0x946f('0x32')]);if(_0x561f90[_0x946f('0x33')]){delete _0x561f90[_0x946f('0x33')];}_0x2f6c0c[_0x946f('0x22')](_0x2146b1)[_0x946f('0x34')](_0x561f90);};}exports[_0x946f('0x35')]=function(_0x595724,_0x4f18be){var _0x5a2774={},_0x449e86={},_0x4fab34={'count':0x0,'rows':[]};var _0x4d7833=_[_0x946f('0x36')](db[_0x946f('0x37')][_0x946f('0x38')],function(_0x38508d){return{'name':_0x38508d['fieldName'],'type':_0x38508d[_0x946f('0x39')][_0x946f('0x3a')]};});_0x449e86['model']=_[_0x946f('0x36')](_0x4d7833,'name');_0x449e86[_0x946f('0x3b')]=_[_0x946f('0x3c')](_0x595724['query']);_0x449e86[_0x946f('0x3d')]=_[_0x946f('0x3e')](_0x449e86[_0x946f('0x3f')],_0x449e86[_0x946f('0x3b')]);_0x5a2774[_0x946f('0x40')]=_[_0x946f('0x3e')](_0x449e86[_0x946f('0x3f')],qs[_0x946f('0x41')](_0x595724[_0x946f('0x3b')][_0x946f('0x41')]));_0x5a2774[_0x946f('0x40')]=_0x5a2774[_0x946f('0x40')][_0x946f('0x42')]?_0x5a2774['attributes']:_0x449e86[_0x946f('0x3f')];if(!_0x595724['query'][_0x946f('0x43')]('nolimit')){_0x5a2774[_0x946f('0x26')]=qs['limit'](_0x595724[_0x946f('0x3b')][_0x946f('0x26')]);_0x5a2774['offset']=qs['offset'](_0x595724[_0x946f('0x3b')][_0x946f('0x24')]);}_0x5a2774[_0x946f('0x44')]=qs['sort'](_0x595724[_0x946f('0x3b')]['sort']);_0x5a2774[_0x946f('0x45')]=qs[_0x946f('0x3d')](_[_0x946f('0x46')](_0x595724[_0x946f('0x3b')],_0x449e86[_0x946f('0x3d')]),_0x4d7833);if(_0x595724[_0x946f('0x3b')][_0x946f('0x47')]){_0x5a2774[_0x946f('0x45')]=_[_0x946f('0x48')](_0x5a2774[_0x946f('0x45')],{'$or':_[_0x946f('0x36')](_0x4d7833,function(_0x4ceb5b){if(_0x4ceb5b['type']!==_0x946f('0x49')){var _0x4d7666={};_0x4d7666[_0x4ceb5b[_0x946f('0x33')]]={'$like':'%'+_0x595724['query'][_0x946f('0x47')]+'%'};return _0x4d7666;}})});}_0x5a2774=_[_0x946f('0x48')]({},_0x5a2774,_0x595724[_0x946f('0x4a')]);var _0x433b73={'where':_0x5a2774[_0x946f('0x45')]};return db[_0x946f('0x37')][_0x946f('0x4b')](_0x433b73)[_0x946f('0x2c')](function(_0x445206){_0x4fab34[_0x946f('0x4b')]=_0x445206;if(_0x595724[_0x946f('0x3b')][_0x946f('0x4c')]){_0x5a2774[_0x946f('0x4d')]=[{'all':!![]}];}return db[_0x946f('0x37')][_0x946f('0x4e')](_0x5a2774);})['then'](function(_0x5063ac){_0x4fab34[_0x946f('0x4f')]=_0x5063ac;return _0x4fab34;})[_0x946f('0x2c')](respondWithFilteredResult(_0x4f18be,_0x5a2774))[_0x946f('0x50')](handleError(_0x4f18be,null));};exports[_0x946f('0x51')]=function(_0x42e73b,_0x714eeb){var _0x3f4022={'raw':!![],'where':{'id':_0x42e73b[_0x946f('0x52')]['id']}},_0x1177a1={};_0x1177a1[_0x946f('0x3f')]=_[_0x946f('0x3c')](db[_0x946f('0x37')][_0x946f('0x38')]);_0x1177a1[_0x946f('0x3b')]=_[_0x946f('0x3c')](_0x42e73b[_0x946f('0x3b')]);_0x1177a1[_0x946f('0x3d')]=_['intersection'](_0x1177a1[_0x946f('0x3f')],_0x1177a1[_0x946f('0x3b')]);_0x3f4022[_0x946f('0x40')]=_[_0x946f('0x3e')](_0x1177a1[_0x946f('0x3f')],qs['fields'](_0x42e73b[_0x946f('0x3b')][_0x946f('0x41')]));_0x3f4022['attributes']=_0x3f4022[_0x946f('0x40')][_0x946f('0x42')]?_0x3f4022[_0x946f('0x40')]:_0x1177a1['model'];if(_0x42e73b[_0x946f('0x3b')][_0x946f('0x4c')]){_0x3f4022[_0x946f('0x4d')]=[{'all':!![]}];}_0x3f4022=_[_0x946f('0x48')]({},_0x3f4022,_0x42e73b['options']);return db['Plugin'][_0x946f('0x53')](_0x3f4022)[_0x946f('0x2c')](handleEntityNotFound(_0x714eeb,null))[_0x946f('0x2c')](respondWithResult(_0x714eeb,null))['catch'](handleError(_0x714eeb,null));};exports[_0x946f('0x54')]=function(_0x1d0134,_0x3e2955,_0x17e02e){return db[_0x946f('0x37')][_0x946f('0x53')]({'where':{'id':_0x1d0134[_0x946f('0x52')]['id']},'attributes':[_0x946f('0x33'),'path'],'raw':!![]})[_0x946f('0x2c')](handleEntityNotFound(_0x3e2955,null))['then'](function(_0x76bfa1){if(_0x76bfa1){var _0x10677d=path[_0x946f('0x55')](config[_0x946f('0x56')],_0x946f('0x57'),util[_0x946f('0x58')](_0x946f('0x59'),path[_0x946f('0x5a')](_0x76bfa1[_0x946f('0x7')])));var _0x3ba652=fs[_0x946f('0x5b')](_0x10677d);var _0x326850=archiver(_0x946f('0x5c'),{'zlib':{'level':0x9}});_0x326850['on'](_0x946f('0x5d'),function(_0x428821){if(_0x428821[_0x946f('0x5e')]===_0x946f('0x5f')){logger[_0x946f('0x31')](_0x428821);}else{throw new db[(_0x946f('0x60'))]['Error'](_0x946f('0x61'));}});_0x326850['on'](_0x946f('0x31'),function(_0x3191b2){throw new db[(_0x946f('0x60'))][(_0x946f('0x62'))](_0x946f('0x61'));});_0x326850[_0x946f('0x63')](_0x3ba652);_0x326850[_0x946f('0x64')]('**/*',{'cwd':path[_0x946f('0x55')](config[_0x946f('0x56')],'server/files/plugins',path[_0x946f('0x65')](_0x76bfa1['path'])),'ignore':[path[_0x946f('0x55')](path[_0x946f('0x5a')](_0x76bfa1[_0x946f('0x7')]),'node_modules/**/*'),path[_0x946f('0x55')](path['basename'](_0x76bfa1[_0x946f('0x7')]),_0x946f('0x66'))],'nodir':!![]})[_0x946f('0x67')]();_0x3ba652['on'](_0x946f('0x68'),function(){if(!fs[_0x946f('0x69')](_0x10677d)){throw new db['Sequelize'][(_0x946f('0x62'))](_0x946f('0x6a'));}return _0x3e2955[_0x946f('0x54')](_0x10677d,util[_0x946f('0x58')](_0x946f('0x59'),path[_0x946f('0x5a')](_0x76bfa1[_0x946f('0x7')])),function(_0x4b3ebc){if(_0x4b3ebc){throw new db[(_0x946f('0x60'))]['Error'](_0x946f('0x6b'));}fs['unlinkSync'](_0x10677d);logger['info'](_0x946f('0x6c'));logger['info']('Temporary\x20file\x20removed');});});}return null;})[_0x946f('0x50')](handleError(_0x3e2955,null));};exports[_0x946f('0x6d')]=function(_0x10f6bf,_0x3adfee,_0x1512a2){var _0xfff0aa=path[_0x946f('0x5a')](_0x10f6bf['file'][_0x946f('0x6e')],path[_0x946f('0x6f')](_0x10f6bf[_0x946f('0x70')][_0x946f('0x6e')]));var _0x440930=path[_0x946f('0x55')](config[_0x946f('0x56')],_0x946f('0x57'),_0x10f6bf[_0x946f('0x70')][_0x946f('0x6e')]);var _0x5cf45e=path['join'](config[_0x946f('0x56')],_0x946f('0x57'),_0xfff0aa);logger[_0x946f('0x71')](_0x946f('0x72'),_0x440930);logger['info'](_0x946f('0x73'),_0x5cf45e);try{fs['chmodSync'](_0x440930,parseInt('0777',0x8));extract(_0x440930,{'dir':_0x5cf45e},function(_0x3eba4f){if(_0x3eba4f){logger[_0x946f('0x31')](_0x3eba4f);handleError(_0x3eba4f,!![]);};var _0x168881=fs[_0x946f('0x74')](_0x5cf45e);if(_0x168881[_0x946f('0x42')]>0x1){removeReferences(_0x440930,_0x5cf45e);logger[_0x946f('0x31')](_0x946f('0x75'));return _0x1512a2(new Error(_0x946f('0x75')));}var _0x5011dd=fs[_0x946f('0x76')](path[_0x946f('0x55')](_0x5cf45e,_0x168881[0x0]));if(_0x5011dd[_0x946f('0x77')]()){removeReferences(_0x440930,_0x5cf45e);logger[_0x946f('0x31')]('Invalid\x20plugin\x20structure');return _0x1512a2(new Error(_0x946f('0x75')));}if(_0x5011dd['isDirectory']()){var _0x1b17e9=fs['readdirSync'](path[_0x946f('0x55')](_0x5cf45e,_0x168881[0x0]));if(_0x1b17e9[_0x946f('0x42')]===0x0){removeReferences(_0x440930,_0x5cf45e);logger[_0x946f('0x31')](_0x946f('0x75'));return _0x1512a2(new Error(_0x946f('0x75')));}var _0x46deed=_0x1b17e9[_0x946f('0x78')](function(_0x73f10d){return _0x73f10d===_0x946f('0x79');});if(!_0x46deed){return _0x1512a2(new Error(_0x946f('0x7a')));}var _0x385b6c=fs[_0x946f('0x7b')](path[_0x946f('0x55')](_0x5cf45e,_0x168881[0x0],_0x946f('0x79')));var _0x4503cd=JSON[_0x946f('0x7c')](_0x385b6c);if(_0x946f('0x25')==typeof _0x4503cd[_0x946f('0x33')]){return _0x1512a2(new Error(_0x946f('0x7d')));}if(_0x946f('0x25')==typeof _0x4503cd[_0x946f('0x39')]){return _0x1512a2(new Error(_0x946f('0x7e')));}if(_0x946f('0x25')==typeof _0x4503cd[_0x946f('0x7f')]){return _0x1512a2(new Error(_0x946f('0x80')));}if(_0x946f('0x25')==typeof _0x4503cd['parameters']){return _0x1512a2(new Error(_0x946f('0x81')));}if(_0x4503cd[_0x946f('0x39')]==='html'){if(_0x946f('0x25')==typeof _0x4503cd[_0x946f('0x82')][_0x946f('0x83')]){return _0x1512a2(new Error(_0x946f('0x84')));}if('undefined'==typeof _0x4503cd[_0x946f('0x82')][_0x946f('0x83')][_0x946f('0x85')]&&_0x946f('0x25')==typeof _0x4503cd[_0x946f('0x82')][_0x946f('0x83')][_0x946f('0x86')]){return _0x1512a2(new Error(_0x946f('0x87')));}}else if(_0x4503cd[_0x946f('0x39')]===_0x946f('0x88')){if('undefined'==typeof _0x4503cd[_0x946f('0x82')][_0x946f('0x89')]){return _0x1512a2(new Error(_0x946f('0x8a')));}if('undefined'==typeof _0x4503cd[_0x946f('0x82')][_0x946f('0x8b')]){return _0x1512a2(new Error(_0x946f('0x8c')));}}else{return _0x1512a2(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x24f72c=_0x4503cd['name'];var _0x23a07b=_0x4503cd[_0x946f('0x8d')];var _0x32c61d=_0x4503cd['type'];var _0x417a95=_0x4503cd['sidebar']?_0x4503cd[_0x946f('0x8e')]:'always';var _0x324db4=_0x4503cd['icon']?_0x4503cd[_0x946f('0x8f')]:'icon-apps';var _0x1814d6='';var _0x3bc2dd='';var _0x1ce3dc='';var _0x4077b5='';var _0x6d30c1=_0x4503cd['version'];if(_0x32c61d===_0x946f('0x90')){if(_0x946f('0x25')!=typeof _0x4503cd[_0x946f('0x82')][_0x946f('0x83')]['admin']){var _0xfbef48=_0x4503cd[_0x946f('0x82')][_0x946f('0x83')][_0x946f('0x85')];if(!/^(f|ht)tps?:\/\//i[_0x946f('0x91')](_0xfbef48)){_0x1814d6=path[_0x946f('0x55')](_0x946f('0x92'),_0xfff0aa,_0x168881[0x0],_0xfbef48);}else{_0x1814d6=_0xfbef48;}}else{logger['info'](_0x946f('0x93'));}if(_0x946f('0x25')!=typeof _0x4503cd[_0x946f('0x82')]['views'][_0x946f('0x86')]){var _0x3b9289=_0x4503cd[_0x946f('0x82')][_0x946f('0x83')][_0x946f('0x86')];if(!/^(f|ht)tps?:\/\//i[_0x946f('0x91')](_0x3b9289)){_0x3bc2dd=path['join'](_0x946f('0x92'),_0xfff0aa,_0x168881[0x0],_0x3b9289);}else{_0x3bc2dd=_0x3b9289;}}else{logger[_0x946f('0x71')](_0x946f('0x94'));}}else if(_0x32c61d===_0x946f('0x88')){_0x1ce3dc=_0x4503cd[_0x946f('0x82')][_0x946f('0x89')];_0x4077b5=_0x4503cd['parameters'][_0x946f('0x8b')];if(_0x946f('0x25')!=typeof _0x4503cd['parameters'][_0x946f('0x83')]){if(_0x946f('0x25')!=typeof _0x4503cd[_0x946f('0x82')][_0x946f('0x83')][_0x946f('0x85')]){var _0xfbef48=_0x4503cd[_0x946f('0x82')][_0x946f('0x83')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x946f('0x91')](_0xfbef48)){_0x1814d6=path['join'](_0x946f('0x92'),_0xfff0aa,_0x168881[0x0],_0xfbef48);}else{_0x1814d6=_0xfbef48;}}if('undefined'!=typeof _0x4503cd[_0x946f('0x82')][_0x946f('0x83')][_0x946f('0x86')]){var _0x3b9289=_0x4503cd[_0x946f('0x82')][_0x946f('0x83')][_0x946f('0x86')];if(!/^(f|ht)tps?:\/\//i[_0x946f('0x91')](_0x3b9289)){_0x3bc2dd=path['join']('plugins',_0xfff0aa,_0x168881[0x0],_0x3b9289);}else{_0x3bc2dd=_0x3b9289;}}}}var _0x3134d5={'name':_0x24f72c,'description':_0x23a07b,'path':path[_0x946f('0x55')](_0xfff0aa,_0x168881[0x0]),'type':_0x32c61d,'sidebar':_0x417a95,'icon':_0x324db4,'adminUrl':_0x1814d6,'agentUrl':_0x3bc2dd,'scriptName':_0x1ce3dc,'scriptPath':_0x4077b5,'version':_0x6d30c1};removeReferences(_0x440930,null);return db[_0x946f('0x37')][_0x946f('0x95')](_0x3134d5)[_0x946f('0x2c')](function(_0x3bb7ff){var _0x3cddcd={'role':_0x10f6bf[_0x946f('0x96')][_0x946f('0x97')],'userProfileId':_0x10f6bf[_0x946f('0x96')]['userProfileId']};if(!_0x3cddcd)throw new Error(_0x946f('0x98'));if(_0x3cddcd[_0x946f('0x97')]===_0x946f('0x99')){var _0x55e66d=_0x3bb7ff[_0x946f('0x2e')]({'plain':!![]});return db[_0x946f('0x9a')]['find']({'where':{'name':'Plugins','userProfileId':_0x3cddcd['userProfileId']},'raw':!![]})[_0x946f('0x2c')](function(_0x866aee){if(_0x866aee&&_0x866aee[_0x946f('0x9b')]===0x0){return db[_0x946f('0x2f')][_0x946f('0x95')]({'name':_0x55e66d[_0x946f('0x33')],'resourceId':_0x55e66d['id'],'type':_0x866aee[_0x946f('0x33')],'sectionId':_0x866aee['id']},{})[_0x946f('0x2c')](function(){return _0x3bb7ff;});}else{return _0x3bb7ff;}})['catch'](function(_0x422de8){logger[_0x946f('0x31')](_0x946f('0x9c'),_0x422de8);throw _0x422de8;});}return _0x3bb7ff;})[_0x946f('0x2c')](respondWithResult(_0x3adfee,null))['catch'](handleError(_0x3adfee,null));}});}catch(_0xcebc81){_0x3adfee[_0x946f('0x22')](0x1f4)[_0x946f('0x34')](_0xcebc81);}};function removeReferences(_0x273baa,_0x3edb80){try{if(_0x273baa){fs[_0x946f('0x9d')](_0x273baa);logger['info'](_0x946f('0x9e'));}if(_0x3edb80){rimraf(_0x3edb80,function(){});logger[_0x946f('0x71')](_0x946f('0x9f'));}}catch(_0xc8db67){logger['error'](_0xc8db67);}}exports[_0x946f('0x2b')]=function(_0x301d2f,_0x355513,_0x21b1bd){return db[_0x946f('0x37')][_0x946f('0x53')]({'where':{'id':_0x301d2f[_0x946f('0x52')]['id']}})[_0x946f('0x2c')](handleEntityNotFound(_0x355513,null))['then'](saveUpdates(_0x301d2f['body'],null))[_0x946f('0x2c')](respondWithResult(_0x355513,null))[_0x946f('0x50')](handleError(_0x355513,null));};exports[_0x946f('0xa0')]=function(_0x3768af,_0x44e139,_0x4b844f){return db[_0x946f('0x37')]['find']({'where':{'id':_0x3768af[_0x946f('0x52')]['id']}})[_0x946f('0x2c')](function(_0x329c8d){if(_0x329c8d){return _0x329c8d[_0x946f('0x2d')]();}})[_0x946f('0x2c')](function(_0x5d1458){rimraf(path[_0x946f('0x55')](config[_0x946f('0x56')],_0x946f('0x57'),path[_0x946f('0x65')](_0x5d1458[_0x946f('0x7')])),function(){});return _0x5d1458;})[_0x946f('0x2c')](handleEntityNotFound(_0x44e139,null))[_0x946f('0x2c')](respondWithStatusCode(_0x44e139,null))[_0x946f('0x50')](handleError(_0x44e139,null));};exports[_0x946f('0xa1')]=function(_0x2a7040,_0x2949a1,_0x5ed7b7){return BPromise[_0x946f('0xa2')]()[_0x946f('0x2c')](function(){if(!_0x2a7040[_0x946f('0x3b')][_0x946f('0x7')]){throw new Error(_0x946f('0xa3'));}if(!_0x2a7040[_0x946f('0x3b')][_0x946f('0xa4')]){throw new Error(_0x946f('0xa5'));}var _0x2421e2=_0x2a7040[_0x946f('0x3b')]['hostname']?_0x2a7040[_0x946f('0x3b')]['hostname']+':'+_0x2a7040[_0x946f('0x3b')][_0x946f('0xa4')]:_0x946f('0xa6')+_0x2a7040[_0x946f('0x3b')][_0x946f('0xa4')];var _0x460dc0=_0x2a7040[_0x946f('0x3b')]['json']?_0x2a7040[_0x946f('0x3b')][_0x946f('0x23')]:!![];var _0x410ac3=_0x2a7040['query'][_0x946f('0xa7')]?_0x2a7040['query'][_0x946f('0xa7')]:null;var _0x296ac0={'method':_0x2a7040['method'],'uri':util[_0x946f('0x58')](_0x946f('0xa8'),_0x2421e2,_0x2a7040['query'][_0x946f('0x7')]),'json':_0x460dc0,'resolveWithFullResponse':!![],'encoding':_0x410ac3,'qs':_0x2a7040['query']};if(_0x2a7040['headers']){_0x296ac0[_0x946f('0xa9')]=_0x2a7040[_0x946f('0xa9')];if(_0x296ac0['headers'][_0x946f('0xaa')]){delete _0x296ac0[_0x946f('0xa9')][_0x946f('0xaa')];}}if(_0x296ac0['headers'][_0x946f('0xab')]){delete _0x296ac0[_0x946f('0xa9')][_0x946f('0xab')];}return rp(_0x296ac0);})[_0x946f('0x2c')](function(_0x403c5e){if(_0x403c5e){_0x2949a1[_0x946f('0x27')](_0x403c5e[_0x946f('0xa9')]);logger[_0x946f('0x71')](_0x403c5e[_0x946f('0x96')]);if(_[_0x946f('0xac')](_0x2a7040[_0x946f('0x3b')][_0x946f('0x7')],'download')&&_0x403c5e[_0x946f('0xad')]==0x1f4){return _0x2949a1['sendStatus'](_0x403c5e['statusCode']);}else{return _0x2949a1[_0x946f('0x22')](_0x403c5e[_0x946f('0xad')])[_0x946f('0x34')](_0x403c5e['body']);}}else{return _0x2949a1[_0x946f('0x21')](0xc8);}})[_0x946f('0x50')](handleError(_0x2949a1,null));};exports['webhookPost']=function(_0x15e0b1,_0x38fd42,_0x31f8e7){return BPromise['resolve']()[_0x946f('0x2c')](function(){if(!_0x15e0b1[_0x946f('0x3b')][_0x946f('0x7')]){throw new Error(_0x946f('0xa3'));}if(!_0x15e0b1[_0x946f('0x3b')][_0x946f('0xa4')]){throw new Error(_0x946f('0xa5'));}var _0x5796d1=_0x15e0b1['query'][_0x946f('0xae')]?_0x15e0b1['query'][_0x946f('0xae')]+':'+_0x15e0b1[_0x946f('0x3b')]['port']:_0x946f('0xa6')+_0x15e0b1[_0x946f('0x3b')][_0x946f('0xa4')];var _0x19ec15=_0x15e0b1[_0x946f('0x3b')][_0x946f('0x23')]?_0x15e0b1[_0x946f('0x3b')]['json']:!![];var _0x2b6345=_0x15e0b1[_0x946f('0x3b')]['encoding']?_0x15e0b1[_0x946f('0x3b')]['encoding']:null;var _0xe0e3a8={'method':_0x15e0b1[_0x946f('0xaf')],'uri':util[_0x946f('0x58')](_0x946f('0xa8'),_0x5796d1,_0x15e0b1[_0x946f('0x3b')]['path']),'json':_0x19ec15,'resolveWithFullResponse':!![],'encoding':_0x2b6345,'body':_0x15e0b1[_0x946f('0x96')]};if(_0x15e0b1[_0x946f('0xa9')]){_0xe0e3a8[_0x946f('0xa9')]=_0x15e0b1['headers'];if(_0xe0e3a8[_0x946f('0xa9')][_0x946f('0xaa')]){delete _0xe0e3a8['headers'][_0x946f('0xaa')];}}if(_0xe0e3a8[_0x946f('0xa9')][_0x946f('0xab')]){delete _0xe0e3a8[_0x946f('0xa9')][_0x946f('0xab')];}return rp(_0xe0e3a8);})[_0x946f('0x2c')](function(_0x25cf59){if(_0x25cf59){_0x38fd42[_0x946f('0x27')](_0x25cf59[_0x946f('0xa9')]);logger[_0x946f('0x71')](_0x25cf59[_0x946f('0x96')]);return _0x38fd42[_0x946f('0x22')](_0x25cf59[_0x946f('0xad')])[_0x946f('0x34')](_0x25cf59[_0x946f('0x96')]);}else{return _0x38fd42[_0x946f('0x21')](0xc8);}})[_0x946f('0x50')](handleError(_0x38fd42,null));}; \ No newline at end of file +var _0x41ec=['destroy','get','UserProfileResource','error','stack','name','send','index','map','Plugin','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','filter','where','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','options','download','find','join','root','server/files/plugins','format','%s.zip','createWriteStream','zip','warning','code','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','Sequelize','pipe','**/*','dirname','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','basename','unlinkSync','Download\x20completed','info','Temporary\x20file\x20removed','upload','file','extname','filename','Plugin\x20upload\x20destination:\x20%s','chmodSync','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','icon','icon-apps','admin','test','Warning:\x20admin\x20view\x20not\x20specified','agent','Warning:\x20agent\x20view\x20not\x20specified','scriptPath','plugins','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','delete','webhookGet','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','port','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','resolve','eml-format','rimraf','zip-dir','fast-json-patch','mustache','path','to-csv','fs-extra','squel','crypto','papaparse','extract-zip','archiver','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then'];(function(_0x2391f3,_0x1b45cc){var _0x1695ab=function(_0x475506){while(--_0x475506){_0x2391f3['push'](_0x2391f3['shift']());}};_0x1695ab(++_0x1b45cc);}(_0x41ec,0x1c5));var _0xc41e=function(_0x5bac51,_0x5972e8){_0x5bac51=_0x5bac51-0x0;var _0x350984=_0x41ec[_0x5bac51];return _0x350984;};'use strict';var emlformat=require(_0xc41e('0x0'));var rimraf=require(_0xc41e('0x1'));var zipdir=require(_0xc41e('0x2'));var jsonpatch=require(_0xc41e('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc41e('0x4'));var util=require('util');var path=require(_0xc41e('0x5'));var sox=require('sox');var csv=require(_0xc41e('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc41e('0x7'));var _=require('lodash');var squel=require(_0xc41e('0x8'));var crypto=require(_0xc41e('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc41e('0x6'));var querystring=require('querystring');var Papa=require(_0xc41e('0xa'));var extract=require(_0xc41e('0xb'));var rimraf=require(_0xc41e('0x1'));var archiver=require(_0xc41e('0xc'));var Redis=require(_0xc41e('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xc41e('0xe'));var as=require(_0xc41e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xc41e('0x10'));var config=require(_0xc41e('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0xc41e('0x12'))['db'];config[_0xc41e('0x13')]=_[_0xc41e('0x14')](config[_0xc41e('0x13')],{'host':_0xc41e('0x15'),'port':0x18eb});var socket=require(_0xc41e('0x16'))(new Redis(config[_0xc41e('0x13')]));require(_0xc41e('0x17'))[_0xc41e('0x18')](socket);function respondWithStatusCode(_0x3feb21,_0x192d0d){_0x192d0d=_0x192d0d||0xcc;return function(_0xf67a8b){if(_0xf67a8b){return _0x3feb21[_0xc41e('0x19')](_0x192d0d);}return _0x3feb21['status'](_0x192d0d)['end']();};}function respondWithResult(_0x139645,_0x2b637c){_0x2b637c=_0x2b637c||0xc8;return function(_0x2f2cb){if(_0x2f2cb){return _0x139645[_0xc41e('0x1a')](_0x2b637c)[_0xc41e('0x1b')](_0x2f2cb);}};}function respondWithFilteredResult(_0x5e981c,_0x1d580e){return function(_0x3304f4){if(_0x3304f4){var _0x2c7e49=typeof _0x1d580e[_0xc41e('0x1c')]===_0xc41e('0x1d')&&typeof _0x1d580e['limit']===_0xc41e('0x1d');var _0x531dd3=_0x3304f4[_0xc41e('0x1e')];var _0x4ae4e7=_0x2c7e49?0x0:_0x1d580e[_0xc41e('0x1c')];var _0x2c145b=_0x2c7e49?_0x3304f4[_0xc41e('0x1e')]:_0x1d580e[_0xc41e('0x1c')]+_0x1d580e[_0xc41e('0x1f')];var _0x4a2b7d;if(_0x2c145b>=_0x531dd3){_0x2c145b=_0x531dd3;_0x4a2b7d=0xc8;}else{_0x4a2b7d=0xce;}_0x5e981c['status'](_0x4a2b7d);return _0x5e981c[_0xc41e('0x20')](_0xc41e('0x21'),_0x4ae4e7+'-'+_0x2c145b+'/'+_0x531dd3)['json'](_0x3304f4);}return null;};}function patchUpdates(_0x142486){return function(_0x12a0c2){try{jsonpatch[_0xc41e('0x22')](_0x12a0c2,_0x142486,!![]);}catch(_0x5213a3){return BPromise[_0xc41e('0x23')](_0x5213a3);}return _0x12a0c2[_0xc41e('0x24')]();};}function saveUpdates(_0x2de130,_0x32e12d){return function(_0x3ed32a){if(_0x3ed32a){return _0x3ed32a[_0xc41e('0x25')](_0x2de130)[_0xc41e('0x26')](function(_0x1bf932){return _0x1bf932;});}return null;};}function removeEntity(_0x12478a,_0x22520d){return function(_0xc174fd){if(_0xc174fd){return _0xc174fd[_0xc41e('0x27')]()['then'](function(){var _0x4bb93c=_0xc174fd[_0xc41e('0x28')]({'plain':!![]});var _0x572cbc='Plugins';return db[_0xc41e('0x29')][_0xc41e('0x27')]({'where':{'type':_0x572cbc,'resourceId':_0x4bb93c['id']}})['then'](function(){return _0xc174fd;});})[_0xc41e('0x26')](function(){_0x12478a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x47d6b1,_0x240581){return function(_0x3849a1){if(!_0x3849a1){_0x47d6b1[_0xc41e('0x19')](0x194);}return _0x3849a1;};}function handleError(_0x2f374c,_0x18d5e1){_0x18d5e1=_0x18d5e1||0x1f4;return function(_0x403b1b){logger[_0xc41e('0x2a')](_0x403b1b[_0xc41e('0x2b')]);if(_0x403b1b['name']){delete _0x403b1b[_0xc41e('0x2c')];}_0x2f374c[_0xc41e('0x1a')](_0x18d5e1)[_0xc41e('0x2d')](_0x403b1b);};}exports[_0xc41e('0x2e')]=function(_0x56dc5d,_0x1f17f2){var _0x431004={},_0x2c309f={},_0x2f0acd={'count':0x0,'rows':[]};var _0xfecbc=_[_0xc41e('0x2f')](db[_0xc41e('0x30')][_0xc41e('0x31')],function(_0x4e3e4c){return{'name':_0x4e3e4c[_0xc41e('0x32')],'type':_0x4e3e4c[_0xc41e('0x33')]['key']};});_0x2c309f[_0xc41e('0x34')]=_[_0xc41e('0x2f')](_0xfecbc,'name');_0x2c309f[_0xc41e('0x35')]=_[_0xc41e('0x36')](_0x56dc5d[_0xc41e('0x35')]);_0x2c309f[_0xc41e('0x37')]=_[_0xc41e('0x38')](_0x2c309f[_0xc41e('0x34')],_0x2c309f[_0xc41e('0x35')]);_0x431004[_0xc41e('0x39')]=_['intersection'](_0x2c309f['model'],qs[_0xc41e('0x3a')](_0x56dc5d[_0xc41e('0x35')][_0xc41e('0x3a')]));_0x431004[_0xc41e('0x39')]=_0x431004[_0xc41e('0x39')][_0xc41e('0x3b')]?_0x431004[_0xc41e('0x39')]:_0x2c309f[_0xc41e('0x34')];if(!_0x56dc5d[_0xc41e('0x35')][_0xc41e('0x3c')]('nolimit')){_0x431004[_0xc41e('0x1f')]=qs['limit'](_0x56dc5d['query']['limit']);_0x431004['offset']=qs['offset'](_0x56dc5d[_0xc41e('0x35')][_0xc41e('0x1c')]);}_0x431004[_0xc41e('0x3d')]=qs['sort'](_0x56dc5d['query'][_0xc41e('0x3e')]);_0x431004['where']=qs[_0xc41e('0x37')](_['pick'](_0x56dc5d[_0xc41e('0x35')],_0x2c309f[_0xc41e('0x37')]),_0xfecbc);if(_0x56dc5d['query'][_0xc41e('0x3f')]){_0x431004[_0xc41e('0x40')]=_[_0xc41e('0x41')](_0x431004[_0xc41e('0x40')],{'$or':_[_0xc41e('0x2f')](_0xfecbc,function(_0x4ac7ec){if(_0x4ac7ec[_0xc41e('0x33')]!==_0xc41e('0x42')){var _0x418c28={};_0x418c28[_0x4ac7ec['name']]={'$like':'%'+_0x56dc5d[_0xc41e('0x35')]['filter']+'%'};return _0x418c28;}})});}_0x431004=_[_0xc41e('0x41')]({},_0x431004,_0x56dc5d['options']);var _0x12339f={'where':_0x431004['where']};return db['Plugin'][_0xc41e('0x1e')](_0x12339f)[_0xc41e('0x26')](function(_0x4180d8){_0x2f0acd['count']=_0x4180d8;if(_0x56dc5d[_0xc41e('0x35')][_0xc41e('0x43')]){_0x431004[_0xc41e('0x44')]=[{'all':!![]}];}return db[_0xc41e('0x30')][_0xc41e('0x45')](_0x431004);})[_0xc41e('0x26')](function(_0x1dabf4){_0x2f0acd['rows']=_0x1dabf4;return _0x2f0acd;})[_0xc41e('0x26')](respondWithFilteredResult(_0x1f17f2,_0x431004))[_0xc41e('0x46')](handleError(_0x1f17f2,null));};exports[_0xc41e('0x47')]=function(_0x516b4b,_0x2c2f70){var _0x56f2f8={'raw':!![],'where':{'id':_0x516b4b[_0xc41e('0x48')]['id']}},_0x18a78={};_0x18a78[_0xc41e('0x34')]=_[_0xc41e('0x36')](db[_0xc41e('0x30')][_0xc41e('0x31')]);_0x18a78[_0xc41e('0x35')]=_[_0xc41e('0x36')](_0x516b4b[_0xc41e('0x35')]);_0x18a78[_0xc41e('0x37')]=_[_0xc41e('0x38')](_0x18a78['model'],_0x18a78[_0xc41e('0x35')]);_0x56f2f8[_0xc41e('0x39')]=_[_0xc41e('0x38')](_0x18a78[_0xc41e('0x34')],qs['fields'](_0x516b4b[_0xc41e('0x35')][_0xc41e('0x3a')]));_0x56f2f8[_0xc41e('0x39')]=_0x56f2f8[_0xc41e('0x39')][_0xc41e('0x3b')]?_0x56f2f8['attributes']:_0x18a78['model'];if(_0x516b4b[_0xc41e('0x35')][_0xc41e('0x43')]){_0x56f2f8[_0xc41e('0x44')]=[{'all':!![]}];}_0x56f2f8=_[_0xc41e('0x41')]({},_0x56f2f8,_0x516b4b[_0xc41e('0x49')]);return db[_0xc41e('0x30')]['find'](_0x56f2f8)['then'](handleEntityNotFound(_0x2c2f70,null))['then'](respondWithResult(_0x2c2f70,null))[_0xc41e('0x46')](handleError(_0x2c2f70,null));};exports[_0xc41e('0x4a')]=function(_0x4a09bf,_0x388dfc,_0x57667d){return db[_0xc41e('0x30')][_0xc41e('0x4b')]({'where':{'id':_0x4a09bf['params']['id']},'attributes':[_0xc41e('0x2c'),_0xc41e('0x5')],'raw':!![]})[_0xc41e('0x26')](handleEntityNotFound(_0x388dfc,null))['then'](function(_0x3b0e8d){if(_0x3b0e8d){var _0x3c5a1c=path[_0xc41e('0x4c')](config[_0xc41e('0x4d')],_0xc41e('0x4e'),util[_0xc41e('0x4f')](_0xc41e('0x50'),path['basename'](_0x3b0e8d[_0xc41e('0x5')])));var _0x38c0c6=fs[_0xc41e('0x51')](_0x3c5a1c);var _0x31cf0c=archiver(_0xc41e('0x52'),{'zlib':{'level':0x9}});_0x31cf0c['on'](_0xc41e('0x53'),function(_0x2708dd){if(_0x2708dd[_0xc41e('0x54')]==='ENOENT'){logger['error'](_0x2708dd);}else{throw new db['Sequelize'][(_0xc41e('0x55'))](_0xc41e('0x56'));}});_0x31cf0c['on'](_0xc41e('0x2a'),function(_0x1fa970){throw new db[(_0xc41e('0x57'))][(_0xc41e('0x55'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x31cf0c[_0xc41e('0x58')](_0x38c0c6);_0x31cf0c['glob'](_0xc41e('0x59'),{'cwd':path[_0xc41e('0x4c')](config[_0xc41e('0x4d')],_0xc41e('0x4e'),path[_0xc41e('0x5a')](_0x3b0e8d[_0xc41e('0x5')])),'ignore':[path['join'](path['basename'](_0x3b0e8d[_0xc41e('0x5')]),_0xc41e('0x5b')),path[_0xc41e('0x4c')](path['basename'](_0x3b0e8d[_0xc41e('0x5')]),_0xc41e('0x5c'))],'nodir':!![]})[_0xc41e('0x5d')]();_0x38c0c6['on'](_0xc41e('0x5e'),function(){if(!fs[_0xc41e('0x5f')](_0x3c5a1c)){throw new db[(_0xc41e('0x57'))]['Error'](_0xc41e('0x60'));}return _0x388dfc['download'](_0x3c5a1c,util[_0xc41e('0x4f')](_0xc41e('0x50'),path[_0xc41e('0x61')](_0x3b0e8d[_0xc41e('0x5')])),function(_0xb2bd98){if(_0xb2bd98){throw new db[(_0xc41e('0x57'))][(_0xc41e('0x55'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0xc41e('0x62')](_0x3c5a1c);logger['info'](_0xc41e('0x63'));logger[_0xc41e('0x64')](_0xc41e('0x65'));});});}return null;})[_0xc41e('0x46')](handleError(_0x388dfc,null));};exports[_0xc41e('0x66')]=function(_0xe47042,_0x2aa6ed,_0x30a87e){var _0x20c0b6=path['basename'](_0xe47042[_0xc41e('0x67')]['filename'],path[_0xc41e('0x68')](_0xe47042[_0xc41e('0x67')][_0xc41e('0x69')]));var _0x4c065a=path[_0xc41e('0x4c')](config[_0xc41e('0x4d')],_0xc41e('0x4e'),_0xe47042[_0xc41e('0x67')]['filename']);var _0x1da4d1=path['join'](config['root'],_0xc41e('0x4e'),_0x20c0b6);logger['info']('Plugin\x20upload\x20filepath:\x20%s',_0x4c065a);logger[_0xc41e('0x64')](_0xc41e('0x6a'),_0x1da4d1);try{fs[_0xc41e('0x6b')](_0x4c065a,parseInt('0777',0x8));extract(_0x4c065a,{'dir':_0x1da4d1},function(_0x77f329){if(_0x77f329){logger['error'](_0x77f329);handleError(_0x77f329,!![]);};var _0x195cbd=fs[_0xc41e('0x6c')](_0x1da4d1);if(_0x195cbd[_0xc41e('0x3b')]>0x1){removeReferences(_0x4c065a,_0x1da4d1);logger['error'](_0xc41e('0x6d'));return _0x30a87e(new Error(_0xc41e('0x6d')));}var _0x4f64fb=fs[_0xc41e('0x6e')](path[_0xc41e('0x4c')](_0x1da4d1,_0x195cbd[0x0]));if(_0x4f64fb[_0xc41e('0x6f')]()){removeReferences(_0x4c065a,_0x1da4d1);logger[_0xc41e('0x2a')](_0xc41e('0x6d'));return _0x30a87e(new Error(_0xc41e('0x6d')));}if(_0x4f64fb[_0xc41e('0x70')]()){var _0x474228=fs[_0xc41e('0x6c')](path['join'](_0x1da4d1,_0x195cbd[0x0]));if(_0x474228['length']===0x0){removeReferences(_0x4c065a,_0x1da4d1);logger[_0xc41e('0x2a')]('Invalid\x20plugin\x20structure');return _0x30a87e(new Error(_0xc41e('0x6d')));}var _0x37b752=_0x474228[_0xc41e('0x71')](function(_0x346aab){return _0x346aab===_0xc41e('0x72');});if(!_0x37b752){return _0x30a87e(new Error('Plugin\x20manifest\x20missing'));}var _0x538fc2=fs['readFileSync'](path['join'](_0x1da4d1,_0x195cbd[0x0],_0xc41e('0x72')));var _0xd23329=JSON['parse'](_0x538fc2);if(_0xc41e('0x1d')==typeof _0xd23329[_0xc41e('0x2c')]){return _0x30a87e(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0xc41e('0x1d')==typeof _0xd23329[_0xc41e('0x33')]){return _0x30a87e(new Error(_0xc41e('0x73')));}if(_0xc41e('0x1d')==typeof _0xd23329[_0xc41e('0x74')]){return _0x30a87e(new Error(_0xc41e('0x75')));}if('undefined'==typeof _0xd23329[_0xc41e('0x76')]){return _0x30a87e(new Error(_0xc41e('0x77')));}if(_0xd23329[_0xc41e('0x33')]===_0xc41e('0x78')){if(_0xc41e('0x1d')==typeof _0xd23329[_0xc41e('0x76')][_0xc41e('0x79')]){return _0x30a87e(new Error(_0xc41e('0x7a')));}if(_0xc41e('0x1d')==typeof _0xd23329[_0xc41e('0x76')]['views']['admin']&&_0xc41e('0x1d')==typeof _0xd23329['parameters']['views']['agent']){return _0x30a87e(new Error(_0xc41e('0x7b')));}}else if(_0xd23329[_0xc41e('0x33')]===_0xc41e('0x7c')){if(_0xc41e('0x1d')==typeof _0xd23329[_0xc41e('0x76')][_0xc41e('0x7d')]){return _0x30a87e(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0xc41e('0x1d')==typeof _0xd23329[_0xc41e('0x76')]['scriptPath']){return _0x30a87e(new Error(_0xc41e('0x7e')));}}else{return _0x30a87e(new Error(_0xc41e('0x7f')));}var _0x46da0a=_0xd23329[_0xc41e('0x2c')];var _0x27bbba=_0xd23329[_0xc41e('0x80')];var _0x5b414a=_0xd23329[_0xc41e('0x33')];var _0x2adf0e=_0xd23329[_0xc41e('0x81')]?_0xd23329[_0xc41e('0x81')]:'always';var _0x5c05e5=_0xd23329[_0xc41e('0x82')]?_0xd23329[_0xc41e('0x82')]:_0xc41e('0x83');var _0x2651d7='';var _0x16a913='';var _0x2218e2='';var _0x19f523='';var _0x3ba2e9=_0xd23329['version'];if(_0x5b414a===_0xc41e('0x78')){if('undefined'!=typeof _0xd23329[_0xc41e('0x76')]['views'][_0xc41e('0x84')]){var _0x2ee7e1=_0xd23329[_0xc41e('0x76')][_0xc41e('0x79')][_0xc41e('0x84')];if(!/^(f|ht)tps?:\/\//i[_0xc41e('0x85')](_0x2ee7e1)){_0x2651d7=path[_0xc41e('0x4c')]('plugins',_0x20c0b6,_0x195cbd[0x0],_0x2ee7e1);}else{_0x2651d7=_0x2ee7e1;}}else{logger['info'](_0xc41e('0x86'));}if(_0xc41e('0x1d')!=typeof _0xd23329[_0xc41e('0x76')][_0xc41e('0x79')][_0xc41e('0x87')]){var _0x36bab0=_0xd23329[_0xc41e('0x76')][_0xc41e('0x79')][_0xc41e('0x87')];if(!/^(f|ht)tps?:\/\//i[_0xc41e('0x85')](_0x36bab0)){_0x16a913=path['join']('plugins',_0x20c0b6,_0x195cbd[0x0],_0x36bab0);}else{_0x16a913=_0x36bab0;}}else{logger['info'](_0xc41e('0x88'));}}else if(_0x5b414a===_0xc41e('0x7c')){_0x2218e2=_0xd23329[_0xc41e('0x76')][_0xc41e('0x7d')];_0x19f523=_0xd23329[_0xc41e('0x76')][_0xc41e('0x89')];if(_0xc41e('0x1d')!=typeof _0xd23329['parameters']['views']){if(_0xc41e('0x1d')!=typeof _0xd23329[_0xc41e('0x76')]['views']['admin']){var _0x2ee7e1=_0xd23329[_0xc41e('0x76')][_0xc41e('0x79')][_0xc41e('0x84')];if(!/^(f|ht)tps?:\/\//i[_0xc41e('0x85')](_0x2ee7e1)){_0x2651d7=path[_0xc41e('0x4c')](_0xc41e('0x8a'),_0x20c0b6,_0x195cbd[0x0],_0x2ee7e1);}else{_0x2651d7=_0x2ee7e1;}}if(_0xc41e('0x1d')!=typeof _0xd23329['parameters'][_0xc41e('0x79')][_0xc41e('0x87')]){var _0x36bab0=_0xd23329[_0xc41e('0x76')][_0xc41e('0x79')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0xc41e('0x85')](_0x36bab0)){_0x16a913=path[_0xc41e('0x4c')](_0xc41e('0x8a'),_0x20c0b6,_0x195cbd[0x0],_0x36bab0);}else{_0x16a913=_0x36bab0;}}}}var _0x474e5b={'name':_0x46da0a,'description':_0x27bbba,'path':path[_0xc41e('0x4c')](_0x20c0b6,_0x195cbd[0x0]),'type':_0x5b414a,'sidebar':_0x2adf0e,'icon':_0x5c05e5,'adminUrl':_0x2651d7,'agentUrl':_0x16a913,'scriptName':_0x2218e2,'scriptPath':_0x19f523,'version':_0x3ba2e9};removeReferences(_0x4c065a,null);return db['Plugin']['create'](_0x474e5b)['then'](function(_0x6b2236){var _0x11f415={'role':_0xe47042[_0xc41e('0x8b')]['role'],'userProfileId':_0xe47042['body'][_0xc41e('0x8c')]};if(!_0x11f415)throw new Error(_0xc41e('0x8d'));if(_0x11f415['role']===_0xc41e('0x8e')){var _0x512da1=_0x6b2236[_0xc41e('0x28')]({'plain':!![]});return db[_0xc41e('0x8f')][_0xc41e('0x4b')]({'where':{'name':'Plugins','userProfileId':_0x11f415['userProfileId']},'raw':!![]})[_0xc41e('0x26')](function(_0x5ab21b){if(_0x5ab21b&&_0x5ab21b[_0xc41e('0x90')]===0x0){return db['UserProfileResource'][_0xc41e('0x91')]({'name':_0x512da1[_0xc41e('0x2c')],'resourceId':_0x512da1['id'],'type':_0x5ab21b[_0xc41e('0x2c')],'sectionId':_0x5ab21b['id']},{})['then'](function(){return _0x6b2236;});}else{return _0x6b2236;}})[_0xc41e('0x46')](function(_0x5c1e8c){logger[_0xc41e('0x2a')](_0xc41e('0x92'),_0x5c1e8c);throw _0x5c1e8c;});}return _0x6b2236;})[_0xc41e('0x26')](respondWithResult(_0x2aa6ed,null))[_0xc41e('0x46')](handleError(_0x2aa6ed,null));}});}catch(_0x31c96f){_0x2aa6ed[_0xc41e('0x1a')](0x1f4)[_0xc41e('0x2d')](_0x31c96f);}};function removeReferences(_0x1fe6d9,_0x5759b8){try{if(_0x1fe6d9){fs['unlinkSync'](_0x1fe6d9);logger[_0xc41e('0x64')](_0xc41e('0x93'));}if(_0x5759b8){rimraf(_0x5759b8,function(){});logger['info']('Extracted\x20folder\x20removed');}}catch(_0x34ccbd){logger['error'](_0x34ccbd);}}exports['update']=function(_0x3fab49,_0x59c3c0,_0x55e643){return db['Plugin'][_0xc41e('0x4b')]({'where':{'id':_0x3fab49['params']['id']}})[_0xc41e('0x26')](handleEntityNotFound(_0x59c3c0,null))[_0xc41e('0x26')](saveUpdates(_0x3fab49['body'],null))[_0xc41e('0x26')](respondWithResult(_0x59c3c0,null))['catch'](handleError(_0x59c3c0,null));};exports[_0xc41e('0x94')]=function(_0x3aa67f,_0x6488ad,_0x533239){return db['Plugin'][_0xc41e('0x4b')]({'where':{'id':_0x3aa67f[_0xc41e('0x48')]['id']}})[_0xc41e('0x26')](function(_0x162c12){if(_0x162c12){return _0x162c12[_0xc41e('0x27')]();}})[_0xc41e('0x26')](function(_0x124863){rimraf(path[_0xc41e('0x4c')](config[_0xc41e('0x4d')],_0xc41e('0x4e'),path['dirname'](_0x124863[_0xc41e('0x5')])),function(){});return _0x124863;})[_0xc41e('0x26')](handleEntityNotFound(_0x6488ad,null))['then'](respondWithStatusCode(_0x6488ad,null))[_0xc41e('0x46')](handleError(_0x6488ad,null));};exports[_0xc41e('0x95')]=function(_0x55cd12,_0x288ce2,_0x5700e6){return BPromise['resolve']()[_0xc41e('0x26')](function(){if(!_0x55cd12[_0xc41e('0x35')][_0xc41e('0x5')]){throw new Error(_0xc41e('0x96'));}if(!_0x55cd12[_0xc41e('0x35')]['port']){throw new Error(_0xc41e('0x97'));}var _0x35a35a=_0x55cd12[_0xc41e('0x35')][_0xc41e('0x98')]?_0x55cd12['query'][_0xc41e('0x98')]+':'+_0x55cd12[_0xc41e('0x35')][_0xc41e('0x99')]:_0xc41e('0x9a')+_0x55cd12['query']['port'];var _0x321f56=_0x55cd12[_0xc41e('0x35')]['json']?_0x55cd12[_0xc41e('0x35')][_0xc41e('0x1b')]:!![];var _0x1912a8=_0x55cd12[_0xc41e('0x35')][_0xc41e('0x9b')]?_0x55cd12[_0xc41e('0x35')][_0xc41e('0x9b')]:null;var _0x3d102a={'method':_0x55cd12[_0xc41e('0x9c')],'uri':util[_0xc41e('0x4f')](_0xc41e('0x9d'),_0x35a35a,_0x55cd12[_0xc41e('0x35')][_0xc41e('0x5')]),'json':_0x321f56,'resolveWithFullResponse':!![],'encoding':_0x1912a8,'qs':_0x55cd12[_0xc41e('0x35')]};if(_0x55cd12['headers']){_0x3d102a[_0xc41e('0x9e')]=_0x55cd12['headers'];if(_0x3d102a['headers'][_0xc41e('0x9f')]){delete _0x3d102a[_0xc41e('0x9e')]['content-length'];}}if(_0x3d102a[_0xc41e('0x9e')][_0xc41e('0xa0')]){delete _0x3d102a['headers'][_0xc41e('0xa0')];}return rp(_0x3d102a);})[_0xc41e('0x26')](function(_0x4f168d){if(_0x4f168d){_0x288ce2[_0xc41e('0x20')](_0x4f168d['headers']);logger[_0xc41e('0x64')](_0x4f168d[_0xc41e('0x8b')]);if(_[_0xc41e('0xa1')](_0x55cd12[_0xc41e('0x35')][_0xc41e('0x5')],_0xc41e('0x4a'))&&_0x4f168d['statusCode']==0x1f4){return _0x288ce2[_0xc41e('0x19')](_0x4f168d[_0xc41e('0xa2')]);}else{return _0x288ce2[_0xc41e('0x1a')](_0x4f168d[_0xc41e('0xa2')])[_0xc41e('0x2d')](_0x4f168d[_0xc41e('0x8b')]);}}else{return _0x288ce2[_0xc41e('0x19')](0xc8);}})[_0xc41e('0x46')](handleError(_0x288ce2,null));};exports['webhookPost']=function(_0x2fc9e8,_0x33d098,_0x4cf073){return BPromise[_0xc41e('0xa3')]()['then'](function(){if(!_0x2fc9e8[_0xc41e('0x35')]['path']){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x2fc9e8[_0xc41e('0x35')][_0xc41e('0x99')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x5b3d23=_0x2fc9e8[_0xc41e('0x35')][_0xc41e('0x98')]?_0x2fc9e8['query']['hostname']+':'+_0x2fc9e8[_0xc41e('0x35')][_0xc41e('0x99')]:_0xc41e('0x9a')+_0x2fc9e8[_0xc41e('0x35')][_0xc41e('0x99')];var _0x50f203=_0x2fc9e8[_0xc41e('0x35')][_0xc41e('0x1b')]?_0x2fc9e8[_0xc41e('0x35')][_0xc41e('0x1b')]:!![];var _0x200279=_0x2fc9e8['query'][_0xc41e('0x9b')]?_0x2fc9e8[_0xc41e('0x35')][_0xc41e('0x9b')]:null;var _0x17ba10={'method':_0x2fc9e8[_0xc41e('0x9c')],'uri':util['format'](_0xc41e('0x9d'),_0x5b3d23,_0x2fc9e8[_0xc41e('0x35')]['path']),'json':_0x50f203,'resolveWithFullResponse':!![],'encoding':_0x200279,'body':_0x2fc9e8['body']};if(_0x2fc9e8[_0xc41e('0x9e')]){_0x17ba10['headers']=_0x2fc9e8[_0xc41e('0x9e')];if(_0x17ba10[_0xc41e('0x9e')][_0xc41e('0x9f')]){delete _0x17ba10[_0xc41e('0x9e')][_0xc41e('0x9f')];}}if(_0x17ba10[_0xc41e('0x9e')][_0xc41e('0xa0')]){delete _0x17ba10[_0xc41e('0x9e')]['content-type'];}return rp(_0x17ba10);})[_0xc41e('0x26')](function(_0x1fa3b0){if(_0x1fa3b0){_0x33d098[_0xc41e('0x20')](_0x1fa3b0[_0xc41e('0x9e')]);logger['info'](_0x1fa3b0[_0xc41e('0x8b')]);return _0x33d098[_0xc41e('0x1a')](_0x1fa3b0['statusCode'])[_0xc41e('0x2d')](_0x1fa3b0[_0xc41e('0x8b')]);}else{return _0x33d098[_0xc41e('0x19')](0xc8);}})[_0xc41e('0x46')](handleError(_0x33d098,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index db88234..95a4b71 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 _0xabce=['events','../../mysqldb','Plugin','setMaxListeners','save','emit','hook'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xabce,0x103));var _0xeabc=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xabce[_0x3b380d];return _0x54502b;};'use strict';var EventEmitter=require(_0xeabc('0x0'));var Plugin=require(_0xeabc('0x1'))['db'][_0xeabc('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0xeabc('0x3')](0x0);var events={'afterCreate':_0xeabc('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2e01eb){return function(_0x1d9f37,_0x1a88a7,_0x5e9e2d){PluginEvents['emit'](_0x2e01eb+':'+_0x1d9f37['id'],_0x1d9f37);PluginEvents[_0xeabc('0x5')](_0x2e01eb,_0x1d9f37);_0x5e9e2d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0xeabc('0x6')](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file +var _0x06f4=['setMaxListeners','save','emit','hook','events','../../mysqldb'];(function(_0x30faee,_0x1c3794){var _0x3a90ab=function(_0x11129b){while(--_0x11129b){_0x30faee['push'](_0x30faee['shift']());}};_0x3a90ab(++_0x1c3794);}(_0x06f4,0x136));var _0x406f=function(_0x510992,_0x2c10de){_0x510992=_0x510992-0x0;var _0x1f4ee0=_0x06f4[_0x510992];return _0x1f4ee0;};'use strict';var EventEmitter=require(_0x406f('0x0'));var Plugin=require(_0x406f('0x1'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0x406f('0x2')](0x0);var events={'afterCreate':_0x406f('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3a4ff0){return function(_0x5ed32f,_0x32abfd,_0x275c63){PluginEvents[_0x406f('0x4')](_0x3a4ff0+':'+_0x5ed32f['id'],_0x5ed32f);PluginEvents[_0x406f('0x4')](_0x3a4ff0,_0x5ed32f);_0x275c63(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0x406f('0x5')](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index ec02fe5..a1f8218 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 _0x7fad=['rimraf','../../config/environment','./plugin.attributes','exports','define','Plugin','plugins','util','api','moment','bluebird','request-promise','path'];(function(_0x210e6f,_0x1f28b4){var _0x27eeb6=function(_0x25e9df){while(--_0x25e9df){_0x210e6f['push'](_0x210e6f['shift']());}};_0x27eeb6(++_0x1f28b4);}(_0x7fad,0x1db));var _0xd7fa=function(_0xc82d1a,_0x145c50){_0xc82d1a=_0xc82d1a-0x0;var _0x32fad2=_0x7fad[_0xc82d1a];return _0x32fad2;};'use strict';var _=require('lodash');var util=require(_0xd7fa('0x0'));var logger=require('../../config/logger')(_0xd7fa('0x1'));var moment=require(_0xd7fa('0x2'));var BPromise=require(_0xd7fa('0x3'));var rp=require(_0xd7fa('0x4'));var fs=require('fs');var path=require(_0xd7fa('0x5'));var rimraf=require(_0xd7fa('0x6'));var config=require(_0xd7fa('0x7'));var attributes=require(_0xd7fa('0x8'));module[_0xd7fa('0x9')]=function(_0x16884a,_0x574766){return _0x16884a[_0xd7fa('0xa')](_0xd7fa('0xb'),attributes,{'tableName':_0xd7fa('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfde9=['../../config/logger','api','moment','request-promise','path','../../config/environment','./plugin.attributes','exports','define','Plugin','plugins','lodash','util'];(function(_0x124e35,_0x49adf4){var _0x1f5b38=function(_0x138315){while(--_0x138315){_0x124e35['push'](_0x124e35['shift']());}};_0x1f5b38(++_0x49adf4);}(_0xfde9,0x66));var _0x9fde=function(_0x1780f8,_0x11ba93){_0x1780f8=_0x1780f8-0x0;var _0x33a410=_0xfde9[_0x1780f8];return _0x33a410;};'use strict';var _=require(_0x9fde('0x0'));var util=require(_0x9fde('0x1'));var logger=require(_0x9fde('0x2'))(_0x9fde('0x3'));var moment=require(_0x9fde('0x4'));var BPromise=require('bluebird');var rp=require(_0x9fde('0x5'));var fs=require('fs');var path=require(_0x9fde('0x6'));var rimraf=require('rimraf');var config=require(_0x9fde('0x7'));var attributes=require(_0x9fde('0x8'));module[_0x9fde('0x9')]=function(_0x2e512a,_0x23419b){return _0x2e512a[_0x9fde('0xa')](_0x9fde('0xb'),attributes,{'tableName':_0x9fde('0xc'),'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 227631f..a3c307c 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 _0xfec8=['options','raw','lodash','util','bluebird','ioredis','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./plugin.socket','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','CreatePlugin','create'];(function(_0x5280eb,_0x293fb6){var _0x4da89f=function(_0x243d65){while(--_0x243d65){_0x5280eb['push'](_0x5280eb['shift']());}};_0x4da89f(++_0x293fb6);}(_0xfec8,0x107));var _0x8fec=function(_0x56b138,_0x2396d6){_0x56b138=_0x56b138-0x0;var _0x3df878=_0xfec8[_0x56b138];return _0x3df878;};'use strict';var _=require(_0x8fec('0x0'));var util=require(_0x8fec('0x1'));var moment=require('moment');var BPromise=require(_0x8fec('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8fec('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8fec('0x4'))(_0x8fec('0x5'));var config=require(_0x8fec('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x8fec('0x7')][_0x8fec('0x8')]({'port':0x232a});config[_0x8fec('0x9')]=_[_0x8fec('0xa')](config[_0x8fec('0x9')],{'host':_0x8fec('0xb'),'port':0x18eb});var socket=require(_0x8fec('0xc'))(new Redis(config['redis']));require(_0x8fec('0xd'))['register'](socket);function respondWithRpcPromise(_0x754d4a,_0x3ff0f6,_0x2cfe12){return new BPromise(function(_0x1fc540,_0xf1fa02){return client[_0x8fec('0xe')](_0x754d4a,_0x2cfe12)[_0x8fec('0xf')](function(_0x6b010d){logger[_0x8fec('0x10')](_0x8fec('0x11'),_0x3ff0f6,_0x8fec('0x12'));logger[_0x8fec('0x13')]('Plugin,\x20%s,\x20%s,\x20%s',_0x3ff0f6,_0x8fec('0x12'),JSON[_0x8fec('0x14')](_0x6b010d));if(_0x6b010d[_0x8fec('0x15')]){if(_0x6b010d[_0x8fec('0x15')][_0x8fec('0x16')]===0x1f4){logger[_0x8fec('0x15')](_0x8fec('0x11'),_0x3ff0f6,_0x6b010d['error']['message']);return _0xf1fa02(_0x6b010d['error']['message']);}logger[_0x8fec('0x15')](_0x8fec('0x11'),_0x3ff0f6,_0x6b010d[_0x8fec('0x15')][_0x8fec('0x17')]);return _0x1fc540(_0x6b010d[_0x8fec('0x15')][_0x8fec('0x17')]);}else{logger[_0x8fec('0x10')](_0x8fec('0x11'),_0x3ff0f6,'request\x20sent');_0x1fc540(_0x6b010d['result'][_0x8fec('0x17')]);}})[_0x8fec('0x18')](function(_0x2e6d29){logger[_0x8fec('0x15')](_0x8fec('0x11'),_0x3ff0f6,_0x2e6d29);_0xf1fa02(_0x2e6d29);});});}exports[_0x8fec('0x19')]=function(_0x1c9354){var _0x2b08f5=this;return new Promise(function(_0x36ad60,_0xabc321){return db['Plugin'][_0x8fec('0x1a')](_0x1c9354['body'],{'raw':_0x1c9354[_0x8fec('0x1b')]?_0x1c9354[_0x8fec('0x1b')][_0x8fec('0x1c')]===undefined?!![]:![]:!![]})[_0x8fec('0xf')](function(_0x32ce0a){logger[_0x8fec('0x10')](_0x8fec('0x19'),_0x1c9354);logger[_0x8fec('0x13')](_0x8fec('0x19'),_0x1c9354,JSON[_0x8fec('0x14')](_0x32ce0a));_0x36ad60(_0x32ce0a);})[_0x8fec('0x18')](function(_0xee42a3){logger['error'](_0x8fec('0x19'),_0xee42a3[_0x8fec('0x17')],_0x1c9354);_0xabc321(_0x2b08f5[_0x8fec('0x15')](0x1f4,_0xee42a3['message']));});});}; \ No newline at end of file +var _0x7701=['info','request\x20sent','debug','stringify','error','code','message','Plugin,\x20%s,\x20%s','catch','CreatePlugin','create','body','options','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then'];(function(_0x24f735,_0x4630b2){var _0x251faa=function(_0x3c41a3){while(--_0x3c41a3){_0x24f735['push'](_0x24f735['shift']());}};_0x251faa(++_0x4630b2);}(_0x7701,0xc2));var _0x1770=function(_0x13bf70,_0x1d6a0b){_0x13bf70=_0x13bf70-0x0;var _0x2d1e30=_0x7701[_0x13bf70];return _0x2d1e30;};'use strict';var _=require(_0x1770('0x0'));var util=require(_0x1770('0x1'));var moment=require(_0x1770('0x2'));var BPromise=require(_0x1770('0x3'));var rs=require(_0x1770('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1770('0x5'))['db'];var utils=require(_0x1770('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x1770('0x7'));var client=jayson[_0x1770('0x8')]['http']({'port':0x232a});config[_0x1770('0x9')]=_[_0x1770('0xa')](config['redis'],{'host':_0x1770('0xb'),'port':0x18eb});var socket=require(_0x1770('0xc'))(new Redis(config['redis']));require('./plugin.socket')[_0x1770('0xd')](socket);function respondWithRpcPromise(_0x390dd0,_0x1b070c,_0x317d69){return new BPromise(function(_0x6dcbcf,_0x134e75){return client[_0x1770('0xe')](_0x390dd0,_0x317d69)[_0x1770('0xf')](function(_0x71e043){logger[_0x1770('0x10')]('Plugin,\x20%s,\x20%s',_0x1b070c,_0x1770('0x11'));logger[_0x1770('0x12')]('Plugin,\x20%s,\x20%s,\x20%s',_0x1b070c,'request\x20sent',JSON[_0x1770('0x13')](_0x71e043));if(_0x71e043[_0x1770('0x14')]){if(_0x71e043[_0x1770('0x14')][_0x1770('0x15')]===0x1f4){logger[_0x1770('0x14')]('Plugin,\x20%s,\x20%s',_0x1b070c,_0x71e043['error'][_0x1770('0x16')]);return _0x134e75(_0x71e043[_0x1770('0x14')][_0x1770('0x16')]);}logger[_0x1770('0x14')](_0x1770('0x17'),_0x1b070c,_0x71e043['error'][_0x1770('0x16')]);return _0x6dcbcf(_0x71e043[_0x1770('0x14')][_0x1770('0x16')]);}else{logger[_0x1770('0x10')](_0x1770('0x17'),_0x1b070c,_0x1770('0x11'));_0x6dcbcf(_0x71e043['result'][_0x1770('0x16')]);}})[_0x1770('0x18')](function(_0xe9e640){logger[_0x1770('0x14')](_0x1770('0x17'),_0x1b070c,_0xe9e640);_0x134e75(_0xe9e640);});});}exports[_0x1770('0x19')]=function(_0x30d481){var _0x2870d1=this;return new Promise(function(_0x28c767,_0x3f494c){return db['Plugin'][_0x1770('0x1a')](_0x30d481[_0x1770('0x1b')],{'raw':_0x30d481[_0x1770('0x1c')]?_0x30d481[_0x1770('0x1c')][_0x1770('0x1d')]===undefined?!![]:![]:!![]})[_0x1770('0xf')](function(_0x3f4d71){logger[_0x1770('0x10')]('CreatePlugin',_0x30d481);logger[_0x1770('0x12')](_0x1770('0x19'),_0x30d481,JSON[_0x1770('0x13')](_0x3f4d71));_0x28c767(_0x3f4d71);})[_0x1770('0x18')](function(_0xd82dea){logger[_0x1770('0x14')]('CreatePlugin',_0xd82dea[_0x1770('0x16')],_0x30d481);_0x3f494c(_0x2870d1[_0x1770('0x14')](0x1f4,_0xd82dea['message']));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index e037dc3..bbb9bbd 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 _0x17f0=['plugin:','./plugin.events','remove','emit','removeListener','length'];(function(_0xcbf12b,_0x4fbc71){var _0x65b619=function(_0x5a0e72){while(--_0x5a0e72){_0xcbf12b['push'](_0xcbf12b['shift']());}};_0x65b619(++_0x4fbc71);}(_0x17f0,0x67));var _0x017f=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x17f0[_0x36ed48];return _0x51c63a;};'use strict';var PluginEvents=require(_0x017f('0x0'));var events=['save',_0x017f('0x1'),'update'];function createListener(_0xed91df,_0x2895ac){return function(_0xe7a90){_0x2895ac[_0x017f('0x2')](_0xed91df,_0xe7a90);};}function removeListener(_0x152bc5,_0x2a1cca){return function(){PluginEvents[_0x017f('0x3')](_0x152bc5,_0x2a1cca);};}exports['register']=function(_0x552250){for(var _0x11f872=0x0,_0x5f0a14=events[_0x017f('0x4')];_0x11f872<_0x5f0a14;_0x11f872++){var _0x291a81=events[_0x11f872];var _0x4f5871=createListener(_0x017f('0x5')+_0x291a81,_0x552250);PluginEvents['on'](_0x291a81,_0x4f5871);}}; \ No newline at end of file +var _0x2eb2=['register','plugin:','./plugin.events','save','update'];(function(_0x1702b8,_0x28c7da){var _0x50028a=function(_0x4135b1){while(--_0x4135b1){_0x1702b8['push'](_0x1702b8['shift']());}};_0x50028a(++_0x28c7da);}(_0x2eb2,0xde));var _0x22eb=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0x2eb2[_0x2576d7];return _0x16a08c;};'use strict';var PluginEvents=require(_0x22eb('0x0'));var events=[_0x22eb('0x1'),'remove',_0x22eb('0x2')];function createListener(_0x45458a,_0x2740d9){return function(_0x5668a8){_0x2740d9['emit'](_0x45458a,_0x5668a8);};}function removeListener(_0xc771d5,_0x1d36f9){return function(){PluginEvents['removeListener'](_0xc771d5,_0x1d36f9);};}exports[_0x22eb('0x3')]=function(_0x528517){for(var _0x5c5e48=0x0,_0x3ac768=events['length'];_0x5c5e48<_0x3ac768;_0x5c5e48++){var _0x2dee64=events[_0x5c5e48];var _0xb6a151=createListener(_0x22eb('0x4')+_0x2dee64,_0x528517);PluginEvents['on'](_0x2dee64,_0xb6a151);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 2f74bb7..2636e5e 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(_0x1f4b18,_0x24e49d){var _0x5636d3=function(_0x46eee0){while(--_0x46eee0){_0x1f4b18['push'](_0x1f4b18['shift']());}};_0x5636d3(++_0x24e49d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'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(_0x1a575e,_0x3dd212){var _0x8261c9=function(_0x29b4d7){while(--_0x29b4d7){_0x1a575e['push'](_0x1a575e['shift']());}};_0x8261c9(++_0x3dd212);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'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 39ed063..f2923c5 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 _0x878f=['dirname','start','dump','restart','stop','hasOwnProperty','params','send','destroy','delete','Unknown\x20id','../../config/pm2','../../config/logger','api','path','child_process','exec','bluebird','sendStatus','status','name','info','index','then','express','motion2','length','catch','show','describe','create','body','script','../../files/plugins','cwd','chdir'];(function(_0x5e66a8,_0x4bb854){var _0x51dd31=function(_0x363cc7){while(--_0x363cc7){_0x5e66a8['push'](_0x5e66a8['shift']());}};_0x51dd31(++_0x4bb854);}(_0x878f,0x173));var _0xf878=function(_0x5363e0,_0x29693b){_0x5363e0=_0x5363e0-0x0;var _0x273cee=_0x878f[_0x5363e0];return _0x273cee;};'use strict';var _=require('lodash');var pm2=require(_0xf878('0x0'));var logger=require(_0xf878('0x1'))(_0xf878('0x2'));var path=require(_0xf878('0x3'));var exec=require(_0xf878('0x4'))[_0xf878('0x5')];var BPromise=require(_0xf878('0x6'));function handleEntityNotFound(_0x45a37b,_0x240b48){return function(_0xcf1927){if(!_0xcf1927){_0x45a37b[_0xf878('0x7')](0x194);;}return _0xcf1927;};}function respondWithResult(_0x4bc9aa,_0x4ac8d8){_0x4ac8d8=_0x4ac8d8||0xc8;return function(_0x3c5f5c){if(_0x3c5f5c){return _0x4bc9aa[_0xf878('0x8')](_0x4ac8d8)['json'](_0x3c5f5c);}return null;};}function handleError(_0x52851e,_0x530767){_0x530767=_0x530767||0x1f4;return function(_0x3329df){logger['error'](_0x3329df['stack']);if(_0x3329df[_0xf878('0x9')]){delete _0x3329df[_0xf878('0x9')];}_0x52851e[_0xf878('0x8')](_0x530767)['send'](_0x3329df);};}function execChildProcess(){return new BPromise(function(_0xb2863e,_0x1399a3){exec('npm\x20install',function(_0xdf76,_0x4f7e7f,_0x31d3d2){logger[_0xf878('0xa')](_0x4f7e7f);logger[_0xf878('0xa')](_0x31d3d2);if(_0xdf76){logger['error'](_0xdf76);return _0x1399a3(_0xdf76);}return _0xb2863e(_0x4f7e7f);});});}exports[_0xf878('0xb')]=function(_0x38eddf,_0x39b1bb){return pm2['list']()[_0xf878('0xc')](function(_0x3902f7){if(_0x3902f7){var _0x119e9e=_['reject'](_0x3902f7,function(_0x568a3a){return _0x568a3a[_0xf878('0x9')]===_0xf878('0xd')||_0x568a3a[_0xf878('0x9')]===_0xf878('0xe');});return{'rows':_0x119e9e,'count':_0x119e9e[_0xf878('0xf')]};}return null;})[_0xf878('0xc')](respondWithResult(_0x39b1bb,null))[_0xf878('0x10')](handleError(_0x39b1bb,null));};exports[_0xf878('0x11')]=function(_0x3c5dee,_0x3a55f3){return pm2[_0xf878('0x12')](_0x3c5dee['params']['id'])[_0xf878('0xc')](respondWithResult(_0x3a55f3,null))[_0xf878('0xc')](handleEntityNotFound(_0x3a55f3,null))[_0xf878('0x10')](handleError(_0x3a55f3,null));};exports[_0xf878('0x13')]=function(_0x3714f6,_0x237d15){if(_0x3714f6[_0xf878('0x14')]['name']&&_0x3714f6[_0xf878('0x14')][_0xf878('0x15')]){var _0x250f85=path['join'](__dirname,_0xf878('0x16'),_0x3714f6[_0xf878('0x14')][_0xf878('0x15')]);var _0x392822=process[_0xf878('0x17')]();process[_0xf878('0x18')](path[_0xf878('0x19')](_0x250f85));return execChildProcess()[_0xf878('0xc')](function(_0x212436){process[_0xf878('0x18')](_0x392822);return pm2[_0xf878('0x1a')]({'name':_0x3714f6['body'][_0xf878('0x9')],'script':_0x250f85});})['then'](function(_0xa3d3d3){pm2[_0xf878('0x1b')]();return _0xa3d3d3[0x0];})[_0xf878('0xc')](respondWithResult(_0x237d15,0xc9))[_0xf878('0x10')](handleError(_0x237d15,null));}else{return _0x237d15[_0xf878('0x8')](0x1f4)['send']({'message':'Missing\x20name\x20and/or\x20path'});}};exports['update']=function(_0x242926,_0x3baba4){if(_0x242926[_0xf878('0x14')]['id']){delete _0x242926['body']['id'];}var _0xfa3e11={'online':_0xf878('0x1c'),'stopped':_0xf878('0x1d')};if(_0xfa3e11[_0xf878('0x1e')](_0x242926[_0xf878('0x14')]['status'])){return pm2[_0xfa3e11[_0x242926['body'][_0xf878('0x8')]]](_0x242926[_0xf878('0x1f')]['id'])['then'](respondWithResult(_0x3baba4,0xc8))[_0xf878('0x10')](handleError(_0x3baba4,null));}else{return _0x3baba4['status'](0x1f4)[_0xf878('0x20')]({'message':'Unknown\x20status'});}};exports[_0xf878('0x21')]=function(_0x49e66a,_0x2630fb){if(_0x49e66a['body']['id']){delete _0x49e66a[_0xf878('0x14')]['id'];}if(_0x49e66a[_0xf878('0x1f')]['id']){return pm2[_0xf878('0x22')](_0x49e66a[_0xf878('0x1f')]['id'])[_0xf878('0xc')](function(_0x716782){pm2['dump']();return _0x716782[0x0];})[_0xf878('0xc')](respondWithResult(_0x2630fb,null))[_0xf878('0x10')](handleError(_0x2630fb,null));}else{return _0x2630fb[_0xf878('0x8')](0x1f4)[_0xf878('0x20')]({'message':_0xf878('0x23')});}}; \ No newline at end of file +var _0x579c=['express','catch','show','describe','params','body','script','join','../../files/plugins','cwd','chdir','dirname','start','status','Missing\x20name\x20and/or\x20path','restart','stop','hasOwnProperty','Unknown\x20status','destroy','delete','dump','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','path','exec','sendStatus','json','error','stack','name','send','npm\x20install','info','index','then'];(function(_0x451bdd,_0x93118e){var _0x58d600=function(_0x5c3d84){while(--_0x5c3d84){_0x451bdd['push'](_0x451bdd['shift']());}};_0x58d600(++_0x93118e);}(_0x579c,0xda));var _0xc579=function(_0xbc21d0,_0x52cea0){_0xbc21d0=_0xbc21d0-0x0;var _0xb1cccc=_0x579c[_0xbc21d0];return _0xb1cccc;};'use strict';var _=require(_0xc579('0x0'));var pm2=require(_0xc579('0x1'));var logger=require(_0xc579('0x2'))(_0xc579('0x3'));var path=require(_0xc579('0x4'));var exec=require('child_process')[_0xc579('0x5')];var BPromise=require('bluebird');function handleEntityNotFound(_0x21a0a2,_0x3b913c){return function(_0x1ce62b){if(!_0x1ce62b){_0x21a0a2[_0xc579('0x6')](0x194);;}return _0x1ce62b;};}function respondWithResult(_0x124ee5,_0x1bd276){_0x1bd276=_0x1bd276||0xc8;return function(_0x2e451b){if(_0x2e451b){return _0x124ee5['status'](_0x1bd276)[_0xc579('0x7')](_0x2e451b);}return null;};}function handleError(_0x293c4a,_0x2ce949){_0x2ce949=_0x2ce949||0x1f4;return function(_0x2361fc){logger[_0xc579('0x8')](_0x2361fc[_0xc579('0x9')]);if(_0x2361fc[_0xc579('0xa')]){delete _0x2361fc[_0xc579('0xa')];}_0x293c4a['status'](_0x2ce949)[_0xc579('0xb')](_0x2361fc);};}function execChildProcess(){return new BPromise(function(_0x2048bc,_0x17e37f){exec(_0xc579('0xc'),function(_0x9e3fd3,_0x4577a2,_0x2a8e70){logger[_0xc579('0xd')](_0x4577a2);logger[_0xc579('0xd')](_0x2a8e70);if(_0x9e3fd3){logger[_0xc579('0x8')](_0x9e3fd3);return _0x17e37f(_0x9e3fd3);}return _0x2048bc(_0x4577a2);});});}exports[_0xc579('0xe')]=function(_0x4ac675,_0x177314){return pm2['list']()[_0xc579('0xf')](function(_0x59243e){if(_0x59243e){var _0x424e15=_['reject'](_0x59243e,function(_0x44cd32){return _0x44cd32['name']===_0xc579('0x10')||_0x44cd32[_0xc579('0xa')]==='motion2';});return{'rows':_0x424e15,'count':_0x424e15['length']};}return null;})[_0xc579('0xf')](respondWithResult(_0x177314,null))[_0xc579('0x11')](handleError(_0x177314,null));};exports[_0xc579('0x12')]=function(_0x414ee7,_0x7d5865){return pm2[_0xc579('0x13')](_0x414ee7[_0xc579('0x14')]['id'])[_0xc579('0xf')](respondWithResult(_0x7d5865,null))[_0xc579('0xf')](handleEntityNotFound(_0x7d5865,null))[_0xc579('0x11')](handleError(_0x7d5865,null));};exports['create']=function(_0x463f5e,_0x2b7d74){if(_0x463f5e['body'][_0xc579('0xa')]&&_0x463f5e[_0xc579('0x15')][_0xc579('0x16')]){var _0x6501bc=path[_0xc579('0x17')](__dirname,_0xc579('0x18'),_0x463f5e[_0xc579('0x15')][_0xc579('0x16')]);var _0x55781e=process[_0xc579('0x19')]();process[_0xc579('0x1a')](path[_0xc579('0x1b')](_0x6501bc));return execChildProcess()[_0xc579('0xf')](function(_0x1da86e){process['chdir'](_0x55781e);return pm2[_0xc579('0x1c')]({'name':_0x463f5e[_0xc579('0x15')][_0xc579('0xa')],'script':_0x6501bc});})['then'](function(_0x45e1ac){pm2['dump']();return _0x45e1ac[0x0];})[_0xc579('0xf')](respondWithResult(_0x2b7d74,0xc9))[_0xc579('0x11')](handleError(_0x2b7d74,null));}else{return _0x2b7d74[_0xc579('0x1d')](0x1f4)['send']({'message':_0xc579('0x1e')});}};exports['update']=function(_0x532b33,_0x56439a){if(_0x532b33[_0xc579('0x15')]['id']){delete _0x532b33[_0xc579('0x15')]['id'];}var _0xfdbb73={'online':_0xc579('0x1f'),'stopped':_0xc579('0x20')};if(_0xfdbb73[_0xc579('0x21')](_0x532b33[_0xc579('0x15')]['status'])){return pm2[_0xfdbb73[_0x532b33['body'][_0xc579('0x1d')]]](_0x532b33['params']['id'])[_0xc579('0xf')](respondWithResult(_0x56439a,0xc8))[_0xc579('0x11')](handleError(_0x56439a,null));}else{return _0x56439a[_0xc579('0x1d')](0x1f4)[_0xc579('0xb')]({'message':_0xc579('0x22')});}};exports[_0xc579('0x23')]=function(_0x45e6a3,_0x133d08){if(_0x45e6a3['body']['id']){delete _0x45e6a3[_0xc579('0x15')]['id'];}if(_0x45e6a3[_0xc579('0x14')]['id']){return pm2[_0xc579('0x24')](_0x45e6a3[_0xc579('0x14')]['id'])['then'](function(_0x57299e){pm2[_0xc579('0x25')]();return _0x57299e[0x0];})['then'](respondWithResult(_0x133d08,null))[_0xc579('0x11')](handleError(_0x133d08,null));}else{return _0x133d08[_0xc579('0x1d')](0x1f4)[_0xc579('0xb')]({'message':_0xc579('0x26')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 0f3c919..5341120 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 _0x6620=['Router','../../components/auth/service','./realtime.controller','get','/agents','isAuthenticated','getAgents','getQueues','express'];(function(_0x457344,_0xa0753e){var _0x29af78=function(_0x4ff13a){while(--_0x4ff13a){_0x457344['push'](_0x457344['shift']());}};_0x29af78(++_0xa0753e);}(_0x6620,0x1ee));var _0x0662=function(_0x457e0b,_0x2e87d1){_0x457e0b=_0x457e0b-0x0;var _0x5d7ddf=_0x6620[_0x457e0b];return _0x5d7ddf;};'use strict';var express=require(_0x0662('0x0'));var router=express[_0x0662('0x1')]();var auth=require(_0x0662('0x2'));var controller=require(_0x0662('0x3'));router[_0x0662('0x4')](_0x0662('0x5'),auth[_0x0662('0x6')](),controller[_0x0662('0x7')]);router[_0x0662('0x4')]('/queues',auth[_0x0662('0x6')](),controller[_0x0662('0x8')]);module['exports']=router; \ No newline at end of file +var _0x63f3=['express','Router','../../components/auth/service','./realtime.controller','get','isAuthenticated','getAgents','/queues','getQueues'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x63f3,0x15f));var _0x363f=function(_0x119b3e,_0x588d50){_0x119b3e=_0x119b3e-0x0;var _0x1169ae=_0x63f3[_0x119b3e];return _0x1169ae;};'use strict';var express=require(_0x363f('0x0'));var router=express[_0x363f('0x1')]();var auth=require(_0x363f('0x2'));var controller=require(_0x363f('0x3'));router[_0x363f('0x4')]('/agents',auth[_0x363f('0x5')](),controller[_0x363f('0x6')]);router['get'](_0x363f('0x7'),auth[_0x363f('0x5')](),controller[_0x363f('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 061ec73..876082e 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 _0x4c60=['smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','destconnectedlinenum','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','resolve','User','rawAttributes','fieldName','type','query','role','agent','getOptions','raw','user','userProfileId','sort','getResources','findAndCountAll','rows','pick','omit','globalStatus','globalStatusFilter','pauseType','pauseTypeFilter','getQueues','mail','chat','openchannel','fax','channel','includes','toLowerCase','Invalid\x20channel','key','Queues','UserProfile','all','util','lodash','jayson/promise','../../components/parsers/qs','api','http','offset','undefined','count','status','Content-Range','json','error','stack','name','send','request','Agents','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','merge','voice','startCase','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','VoiceQueuesChannels','catch','loggedIn','waiting','talking','outbound','push','pTalking','originated','message','dialActive','startProgressive','erlangCallToSecond','erlangAbandonmentRate','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','map','get','agents','paused','loggedInDb','available','busy','find','filter','length','some','toString','UserId','online','voiceStatus','Queue','Pause','findAll','QueueId','idle','unavailable','ringing','chatPause','mailPause','openchannelPause','smsPause','voicePause','every','pause','chatStatus','faxStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','*pause','getAgents','userpic','lastLoginAt','address','whatsappPause','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity'];(function(_0x195c04,_0x23e0b3){var _0x2e5a59=function(_0x395a92){while(--_0x395a92){_0x195c04['push'](_0x195c04['shift']());}};_0x2e5a59(++_0x23e0b3);}(_0x4c60,0xc1));var _0x04c6=function(_0x45ade2,_0x4dba24){_0x45ade2=_0x45ade2-0x0;var _0x5c79e1=_0x4c60[_0x45ade2];return _0x5c79e1;};'use strict';var util=require(_0x04c6('0x0'));var _=require(_0x04c6('0x1'));var jayson=require(_0x04c6('0x2'));var qs=require(_0x04c6('0x3'));var logger=require('../../config/logger')(_0x04c6('0x4'));var db=require('../../mysqldb')['db'];var amiClient=jayson['client']['http']({'port':0x232a});var routingClient=jayson['client'][_0x04c6('0x5')]({'port':0x232c});function respondWithFilteredResult(_0xc6e772,_0x2054da){return function(_0x12bd5d){if(_0x12bd5d){var _0x2b9041=typeof _0x2054da[_0x04c6('0x6')]===_0x04c6('0x7')&&typeof _0x2054da['limit']===_0x04c6('0x7');var _0x43a27e=_0x12bd5d[_0x04c6('0x8')];var _0x30b901=_0x2b9041?0x0:_0x2054da['offset'];var _0x59a98c=_0x2b9041?_0x12bd5d['count']:_0x2054da[_0x04c6('0x6')]+_0x2054da['limit'];var _0x15d31a;if(_0x59a98c>=_0x43a27e){_0x59a98c=_0x43a27e;_0x15d31a=0xc8;}else{_0x15d31a=0xce;}_0xc6e772[_0x04c6('0x9')](_0x15d31a);return _0xc6e772['set'](_0x04c6('0xa'),_0x30b901+'-'+_0x59a98c+'/'+_0x43a27e)[_0x04c6('0xb')](_0x12bd5d);}return null;};}function handleError(_0x119187,_0x4e5e6){_0x4e5e6=_0x4e5e6||0x1f4;return function(_0x52cdcf){logger[_0x04c6('0xc')](_0x52cdcf[_0x04c6('0xd')]);if(_0x52cdcf[_0x04c6('0xe')]){delete _0x52cdcf['name'];}_0x119187[_0x04c6('0x9')](_0x4e5e6)[_0x04c6('0xf')](_0x52cdcf);};}function getRealtimeAgents(){return new Promise(function(_0x28632e,_0x3e80a6){return amiClient[_0x04c6('0x10')](_0x04c6('0x11'),{})[_0x04c6('0x12')](function(_0x3d46a9){if(_0x3d46a9['error'])throw new Error(_0x04c6('0x13'));var _0xa2bc92=_0x3d46a9[_0x04c6('0x14')];return routingClient[_0x04c6('0x10')](_0x04c6('0x11'),{})[_0x04c6('0x12')](function(_0x21674a){if(_0x21674a[_0x04c6('0xc')])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');var _0x142065=_0x21674a[_0x04c6('0x14')];return _0x28632e(_[_0x04c6('0x15')]({},_0xa2bc92,_0x142065));});})['catch'](function(_0x4cef4e){_0x3e80a6(_0x4cef4e);});});}function getRealtimeQueues(_0x53ac86,_0x41ad4f){return new Promise(function(_0xb997e0,_0x50dd61){var _0x5a5e9e=_0x41ad4f===_0x04c6('0x16')?amiClient:routingClient;return _0x5a5e9e[_0x04c6('0x10')](_[_0x04c6('0x17')](_0x41ad4f)+'Queues',_0x53ac86)[_0x04c6('0x12')](function(_0x13f2dc){if(_0x13f2dc[_0x04c6('0xc')])throw new Error(util['format'](_0x04c6('0x18'),_0x41ad4f));return _0xb997e0(_0x13f2dc[_0x04c6('0x14')]);})['catch'](function(_0x54a8b0){_0x50dd61(_0x54a8b0);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x4c8d72,_0x348ea3){return amiClient[_0x04c6('0x10')](_0x04c6('0x19'),{})[_0x04c6('0x12')](function(_0x3e1328){if(_0x3e1328['error'])throw new Error('Unable\x20to\x20retrieve\x20voice\x20queues\x20channels');return _0x4c8d72(_0x3e1328[_0x04c6('0x14')]);})[_0x04c6('0x1a')](function(_0x9acfa){_0x348ea3(_0x9acfa);});});}function initializeQueues(_0x3233d7,_0x4f256f,_0x1f5aaf,_0x47c69a){var _0x1d0d3f=[_0x04c6('0x1b'),'available',_0x04c6('0x1c'),_0x04c6('0x1d'),'paused'];if(_0x1f5aaf==='voice'&&_0x47c69a===_0x04c6('0x1e')){_0x1d0d3f[_0x04c6('0x1f')](_0x04c6('0x20'),_0x04c6('0x21'),_0x04c6('0x22'),_0x04c6('0x23'),'dialMethod','Trunk','startPredictive',_0x04c6('0x24'),'erlangCalls',_0x04c6('0x25'),_0x04c6('0x26'),'erlangBusyFactor',_0x04c6('0x27'),_0x04c6('0x28'),_0x04c6('0x29'),_0x04c6('0x2a'),'predictiveIntervalTotalCalls',_0x04c6('0x2b'),_0x04c6('0x2c'),_0x04c6('0x2d'),_0x04c6('0x2e'),_0x04c6('0x2f'));}return _0x3233d7[_0x04c6('0x30')](function(_0x3e59b2){var _0x46380e=_0x3e59b2[_0x04c6('0x31')]({'plain':!![]});_0x46380e[_0x04c6('0x32')]=[];_0x46380e[_0x04c6('0x33')]=0x0;_0x46380e[_0x04c6('0x34')]=0x0;_0x46380e[_0x04c6('0x1b')]=0x0;_0x46380e[_0x04c6('0x35')]=0x0;_0x46380e[_0x04c6('0x1c')]=0x0;if(_0x1f5aaf==='voice'){_0x46380e[_0x04c6('0x1d')]=0x0;_0x46380e[_0x04c6('0x36')]=0x0;if(_0x47c69a===_0x04c6('0x1e')){_0x46380e[_0x04c6('0x20')]=0x0;_0x46380e['originated']=0x0;}}var _0x181736=_[_0x04c6('0x37')](_0x4f256f,['id',_0x46380e['id']]);if(_0x181736)_['merge'](_0x46380e,_['pick'](_0x181736,_0x1d0d3f));return _0x46380e;});}function updateAgentVoiceStatus(_0x4aac49,_0x4f0600,_0x2382ff){var _0x4f9a6c=_[_0x04c6('0x38')](_0x2382ff,['queue',_0x4f0600[_0x04c6('0xe')]]);if(_0x4f9a6c[_0x04c6('0x39')]===0x0)return _0x4aac49[_0x04c6('0x36')]=!![];if(_[_0x04c6('0x3a')](_0x4f9a6c,['connectedlinenum',_0x4aac49['internal'][_0x04c6('0x3b')]()]))return _0x4aac49[_0x04c6('0x1d')]=!![];if(!_0x4aac49['talking'])return _0x4aac49[_0x04c6('0x36')]=!![];}function getVoiceQueueAgents(_0x5ce4b0,_0x501d7d,_0x317350,_0x5aede6){var _0x181d3f=_[_0x04c6('0x37')](_0x501d7d,['id',_0x5ce4b0['id']]);if(!_0x181d3f)return _0x5ce4b0;return _0x181d3f['getMembers']({'raw':!![]})[_0x04c6('0x12')](function(_0x5cc157){for(var _0x1dafa5=0x0;_0x1dafa5<_0x5cc157[_0x04c6('0x39')];_0x1dafa5++){var _0x2d83eb=_[_0x04c6('0x37')](_0x317350,['id',_0x5cc157[_0x1dafa5][_0x04c6('0x3c')]]);if(!_0x2d83eb){_0x2d83eb={'id':_0x5cc157[_0x1dafa5]['UserId'],'name':_0x5cc157[_0x1dafa5][_0x04c6('0x3c')],'accountcode':'','online':![]};}var _0x51aacb={'id':_0x2d83eb['id'],'name':_0x2d83eb[_0x04c6('0xe')],'internal':_0x2d83eb['accountcode'],'online':Boolean(_0x2d83eb[_0x04c6('0x3d')]),'paused':Boolean(_0x5cc157[_0x1dafa5][_0x04c6('0x33')])};if(_0x2d83eb[_0x04c6('0x3e')]===_0x04c6('0x1d'))updateAgentVoiceStatus(_0x51aacb,_0x5ce4b0,_0x5aede6);if(_0x51aacb[_0x04c6('0x3d')])_0x5ce4b0[_0x04c6('0x34')]++;if(_0x51aacb[_0x04c6('0x36')])_0x5ce4b0['busy']++;if(_0x51aacb[_0x04c6('0x33')]&&!_0x51aacb['busy']&&!_0x51aacb[_0x04c6('0x1d')])_0x5ce4b0['paused']++;_0x5ce4b0['agents'][_0x04c6('0x1f')](_0x51aacb);}return _0x5ce4b0;});}function getQueueAgents(_0x58a9ad,_0x4584ae,_0x445f6c){var _0x15995b='User'+_[_0x04c6('0x17')](_0x445f6c)+_0x04c6('0x3f');var _0x121093=_0x445f6c+_0x04c6('0x40');return db[_0x15995b][_0x04c6('0x41')]({'where':{[_[_0x04c6('0x17')](_0x445f6c)+_0x04c6('0x42')]:_0x58a9ad['id']},'raw':!![]})['then'](function(_0x547082){for(var _0x56820=0x0;_0x56820<_0x547082[_0x04c6('0x39')];_0x56820++){var _0x417cb7=_['find'](_0x4584ae,['id',_0x547082[_0x56820][_0x04c6('0x3c')]]);if(!_0x417cb7){_0x417cb7={'id':_0x547082[_0x56820][_0x04c6('0x3c')],'name':_0x547082[_0x56820][_0x04c6('0x3c')],'online':![],['pauseField']:![]};}var _0x549911={'id':_0x417cb7['id'],'name':_0x417cb7['name'],'online':Boolean(_0x417cb7['online']),'paused':Boolean(_0x417cb7[_0x121093])};if(_0x549911[_0x04c6('0x3d')])_0x58a9ad[_0x04c6('0x34')]++;_0x58a9ad['agents'][_0x04c6('0x1f')](_0x549911);}return _0x58a9ad;});}function isIdle(_0x3de8a9){return _0x3de8a9===_0x04c6('0x43')||_0x3de8a9==='unknown'||_0x3de8a9===_0x04c6('0x44')||_0x3de8a9===_0x04c6('0x45')||_['isNil'](_0x3de8a9);}function isAgentPaused(_0x25a6fc,_0x203943){var _0x2472ed=[_0x25a6fc[_0x04c6('0x46')],_0x25a6fc['faxPause'],_0x25a6fc[_0x04c6('0x47')],_0x25a6fc[_0x04c6('0x48')],_0x25a6fc[_0x04c6('0x49')],_0x25a6fc[_0x04c6('0x4a')],_0x25a6fc['whatsappPause']];if(!_0x203943)return _[_0x04c6('0x4b')](_0x2472ed);var _0x17824f=_[_0x04c6('0x38')](_0x2472ed);return _0x17824f[_0x04c6('0x39')]>0x0&&_0x17824f['length']<_0x2472ed[_0x04c6('0x39')]?!![]:![];}function isAgentIdle(_0x42273e){if(_0x42273e[_0x04c6('0x3e')]!=='idle'&&_0x42273e[_0x04c6('0x4a')]){_0x42273e[_0x04c6('0x3e')]=_0x04c6('0x4c');return![];}return _[_0x04c6('0x4b')]([_0x42273e[_0x04c6('0x4d')],_0x42273e[_0x04c6('0x4e')],_0x42273e[_0x04c6('0x4f')],_0x42273e[_0x04c6('0x50')],_0x42273e[_0x04c6('0x51')],_0x42273e[_0x04c6('0x3e')],_0x42273e[_0x04c6('0x52')]],isIdle);}function getAgentStatus(_0x3ab244){var _0x3a0b12='unknown';if(isAgentPaused(_0x3ab244))_0x3a0b12=_0x04c6('0x4c');else if(isAgentPaused(_0x3ab244,!![]))_0x3a0b12=_0x04c6('0x53');else if(isAgentIdle(_0x3ab244))_0x3a0b12=_0x04c6('0x43');else _0x3a0b12=_0x04c6('0x36');return _0x3a0b12;}exports[_0x04c6('0x54')]=function(_0x48124f,_0x3bac84){var _0x17778b={'count':0x0,'rows':[]},_0xc29082={},_0x32d5e8,_0x28dfd0,_0x45fbd5=[_0x04c6('0x55'),_0x04c6('0x3d'),_0x04c6('0x56'),'lastPauseAt','pauseType','lastPauseAt','internal',_0x04c6('0x57'),'chatPause',_0x04c6('0x48'),'mailPause',_0x04c6('0x49'),_0x04c6('0x58'),'faxPause','voicePause',_0x04c6('0x59'),_0x04c6('0x5a'),_0x04c6('0x5b'),_0x04c6('0x5c'),'whatsappCapacity',_0x04c6('0x5d'),_0x04c6('0x5e'),_0x04c6('0x5f'),_0x04c6('0x60'),_0x04c6('0x61'),_0x04c6('0x62'),_0x04c6('0x63'),'chatStatus',_0x04c6('0x50'),'mailStatus',_0x04c6('0x51'),_0x04c6('0x52'),'faxStatus',_0x04c6('0x3e'),_0x04c6('0x64'),_0x04c6('0x65'),_0x04c6('0x66'),_0x04c6('0x67'),_0x04c6('0x68'),_0x04c6('0x69'),_0x04c6('0x6a'),'queue',_0x04c6('0x6b'),'screenrecording',_0x04c6('0x6c'),_0x04c6('0x6d'),'routealias'],_0x111364=['chatPause',_0x04c6('0x48'),'mailPause',_0x04c6('0x49'),_0x04c6('0x58'),'faxPause',_0x04c6('0x4a'),_0x04c6('0x3d')];Promise[_0x04c6('0x6e')]()[_0x04c6('0x12')](function(){var _0x2be139=_[_0x04c6('0x30')](db[_0x04c6('0x6f')][_0x04c6('0x70')],function(_0x243bc4){return{'name':_0x243bc4[_0x04c6('0x71')],'type':_0x243bc4[_0x04c6('0x72')]['key']};});_0x48124f[_0x04c6('0x73')][_0x04c6('0x74')]=_0x04c6('0x75');_0x48124f[_0x04c6('0x73')]['online']=!![];_0xc29082=qs[_0x04c6('0x76')](_0x2be139,_0x48124f);_0xc29082[_0x04c6('0x77')]=!![];if(_0x48124f[_0x04c6('0x78')]['role']==='user'){var _0x1655af={'params':{'id':_0x48124f[_0x04c6('0x78')][_0x04c6('0x79')]},'query':{'section':_0x04c6('0x11'),'role':_0x04c6('0x75'),'online':!![],'nolimit':_0x48124f[_0x04c6('0x73')]['nolimit'],'sort':_0x48124f[_0x04c6('0x73')][_0x04c6('0x7a')],'filter':_0x48124f[_0x04c6('0x73')]['filter'],'raw':!![]}};return db['UserProfile'][_0x04c6('0x7b')](_0x1655af);}return db[_0x04c6('0x6f')][_0x04c6('0x7c')](_0xc29082);})[_0x04c6('0x12')](function(_0x54d615){_0x17778b[_0x04c6('0x8')]=_0x54d615['count'];_0x32d5e8=_0x54d615['rows'];return getRealtimeAgents();})[_0x04c6('0x12')](function(_0xe178dd){_0x28dfd0=_0xe178dd[_0x04c6('0x7d')];return _0x32d5e8[_0x04c6('0x30')](function(_0x43260e){var _0x281c2b=_[_0x04c6('0x37')](_0x28dfd0,['id',_0x43260e['id']]);if(_0x281c2b)_['merge'](_0x43260e,_[_0x04c6('0x7e')](_[_0x04c6('0x7f')](_0x281c2b,_0x111364),_0x45fbd5));_0x43260e[_0x04c6('0x80')]=getAgentStatus(_0x43260e);return _0x43260e;});})[_0x04c6('0x12')](function(_0x1c2e79){if(_0x48124f['query']['globalStatusFilter']){var _0x271c8b=_[_0x04c6('0x38')](_0x1c2e79,[_0x04c6('0x80'),_0x48124f['query'][_0x04c6('0x81')]]);if(_0x48124f[_0x04c6('0x73')]['pauseTypeFilter']){_0x271c8b=_[_0x04c6('0x38')](_0x271c8b,[_0x04c6('0x82'),_0x48124f[_0x04c6('0x73')][_0x04c6('0x83')]]);}}_0x17778b[_0x04c6('0x7d')]=_0x271c8b||_0x1c2e79;return _0x17778b;})[_0x04c6('0x12')](respondWithFilteredResult(_0x3bac84,_0xc29082))[_0x04c6('0x1a')](handleError(_0x3bac84,null));};exports[_0x04c6('0x84')]=function(_0x22ae65,_0x3552cd){var _0x2d7ecc=[_0x04c6('0x85'),_0x04c6('0x86'),'sms',_0x04c6('0x87'),_0x04c6('0x88'),'whatsapp',_0x04c6('0x16')];var _0x285dd1={'count':0x0,'rows':[]},_0xd57626={},_0x465d96,_0x172787,_0x4e8d22,_0x25b712,_0x4dc248;Promise[_0x04c6('0x6e')]()['then'](function(){if(_0x22ae65[_0x04c6('0x73')][_0x04c6('0x89')]){if(!_[_0x04c6('0x8a')](_0x2d7ecc,_0x22ae65[_0x04c6('0x73')][_0x04c6('0x89')][_0x04c6('0x8b')]()))throw new Error(_0x04c6('0x8c'));_0x465d96=_0x22ae65[_0x04c6('0x73')][_0x04c6('0x89')]['toLowerCase']();}var _0x2aa93b=_[_0x04c6('0x17')](_0x465d96)+'Queue';var _0x9825cf=_['map'](db[_0x2aa93b][_0x04c6('0x70')],function(_0x111382){return{'name':_0x111382['fieldName'],'type':_0x111382[_0x04c6('0x72')][_0x04c6('0x8d')]};});_0xd57626=qs['getOptions'](_0x9825cf,_0x22ae65);if(_0x22ae65[_0x04c6('0x78')][_0x04c6('0x74')]==='user'){var _0x7b9132={'params':{'id':_0x22ae65[_0x04c6('0x78')]['userProfileId']},'query':{'section':_0x465d96===_0x04c6('0x16')&&_0x22ae65[_0x04c6('0x73')]['type']==='outbound'?'QueueCampaigns':_[_0x04c6('0x17')](_0x465d96)+_0x04c6('0x8e'),'type':_0x22ae65[_0x04c6('0x73')][_0x04c6('0x72')],'nolimit':!![],'sort':_0x04c6('0xe'),'filter':_0x22ae65['query'][_0x04c6('0x38')]}};return db[_0x04c6('0x8f')][_0x04c6('0x7b')](_0x7b9132);}return db[_0x2aa93b][_0x04c6('0x7c')](_0xd57626);})[_0x04c6('0x12')](function(_0x57e90a){_0x285dd1[_0x04c6('0x8')]=_0x57e90a['count'];_0x172787=_0x57e90a[_0x04c6('0x7d')];return getRealtimeQueues(_0x22ae65,_0x465d96);})['then'](function(_0x202761){_0x25b712=_0x202761['rows'];return getRealtimeAgents();})['then'](function(_0x289469){_0x4e8d22=_0x289469['rows'];if(_0x465d96!=_0x04c6('0x16'))return;return getRealtimeVoiceQueueChannels();})[_0x04c6('0x12')](function(_0x174de6){_0x4dc248=_0x174de6?_0x174de6[_0x04c6('0x7d')]:[];return initializeQueues(_0x172787,_0x25b712,_0x465d96,_0x22ae65[_0x04c6('0x73')]['type']);})['then'](function(_0x45b648){var _0x14be40=_0x45b648[_0x04c6('0x30')](function(_0x14072a){if(_0x465d96===_0x04c6('0x16'))return getVoiceQueueAgents(_0x14072a,_0x172787,_0x4e8d22,_0x4dc248);else return getQueueAgents(_0x14072a,_0x4e8d22,_0x465d96);});return Promise[_0x04c6('0x90')](_0x14be40);})['then'](function(_0x1a9a95){_0x285dd1['rows']=_0x1a9a95;return _0x285dd1;})['then'](respondWithFilteredResult(_0x3552cd,_0xd57626))[_0x04c6('0x1a')](handleError(_0x3552cd,null));}; \ No newline at end of file +var _0xbd51=['name','send','request','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Agents','then','merge','catch','voice','startCase','Queues','format','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','loggedIn','available','waiting','talking','paused','outbound','push','pTalking','message','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','map','get','loggedInDb','originated','find','pick','filter','busy','some','connectedlinenum','internal','toString','getMembers','length','UserId','online','voiceStatus','agents','User','Queue','Pause','findAll','QueueId','idle','unknown','unavailable','ringing','isNil','chatPause','faxPause','mailPause','openchannelPause','smsPause','whatsappPause','every','voicePause','chatStatus','faxStatus','mailStatus','openchannelStatus','smsStatus','pause','getAgents','userpic','lastLoginAt','pauseType','lastPauseAt','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','faxCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','faxCurrentCapacity','whatsappStatus','mailStatusTime','smsStatusTime','whatsappStatusTime','queue','screenrecording','phoneBarEnableScreenRecordingByAgent','routealias','rawAttributes','key','query','role','user','nolimit','sort','UserProfile','getResources','findAndCountAll','rows','omit','globalStatus','globalStatusFilter','pauseTypeFilter','getQueues','mail','chat','sms','fax','resolve','channel','toLowerCase','Invalid\x20channel','fieldName','getOptions','userProfileId','type','all','util','jayson/promise','../../components/parsers/qs','../../config/logger','api','http','offset','undefined','limit','count','set','json','error','stack'];(function(_0x1610f5,_0x460748){var _0x450825=function(_0x21e62c){while(--_0x21e62c){_0x1610f5['push'](_0x1610f5['shift']());}};_0x450825(++_0x460748);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x432554,_0x4198f9){_0x432554=_0x432554-0x0;var _0x41e5b8=_0xbd51[_0x432554];return _0x41e5b8;};'use strict';var util=require(_0x1bd5('0x0'));var _=require('lodash');var jayson=require(_0x1bd5('0x1'));var qs=require(_0x1bd5('0x2'));var logger=require(_0x1bd5('0x3'))(_0x1bd5('0x4'));var db=require('../../mysqldb')['db'];var amiClient=jayson['client']['http']({'port':0x232a});var routingClient=jayson['client'][_0x1bd5('0x5')]({'port':0x232c});function respondWithFilteredResult(_0x362b24,_0x43e6b6){return function(_0x59ddfb){if(_0x59ddfb){var _0x29abea=typeof _0x43e6b6[_0x1bd5('0x6')]===_0x1bd5('0x7')&&typeof _0x43e6b6[_0x1bd5('0x8')]===_0x1bd5('0x7');var _0x4a7f90=_0x59ddfb[_0x1bd5('0x9')];var _0x5c8e0d=_0x29abea?0x0:_0x43e6b6[_0x1bd5('0x6')];var _0x28df8e=_0x29abea?_0x59ddfb[_0x1bd5('0x9')]:_0x43e6b6[_0x1bd5('0x6')]+_0x43e6b6[_0x1bd5('0x8')];var _0x3e3d06;if(_0x28df8e>=_0x4a7f90){_0x28df8e=_0x4a7f90;_0x3e3d06=0xc8;}else{_0x3e3d06=0xce;}_0x362b24['status'](_0x3e3d06);return _0x362b24[_0x1bd5('0xa')]('Content-Range',_0x5c8e0d+'-'+_0x28df8e+'/'+_0x4a7f90)[_0x1bd5('0xb')](_0x59ddfb);}return null;};}function handleError(_0x24e38c,_0x37e8e1){_0x37e8e1=_0x37e8e1||0x1f4;return function(_0x14606b){logger[_0x1bd5('0xc')](_0x14606b[_0x1bd5('0xd')]);if(_0x14606b[_0x1bd5('0xe')]){delete _0x14606b['name'];}_0x24e38c['status'](_0x37e8e1)[_0x1bd5('0xf')](_0x14606b);};}function getRealtimeAgents(){return new Promise(function(_0x6d2c40,_0x33f82a){return amiClient[_0x1bd5('0x10')]('Agents',{})['then'](function(_0xa63190){if(_0xa63190[_0x1bd5('0xc')])throw new Error(_0x1bd5('0x11'));var _0x4793dd=_0xa63190[_0x1bd5('0x12')];return routingClient[_0x1bd5('0x10')](_0x1bd5('0x13'),{})[_0x1bd5('0x14')](function(_0x4670b5){if(_0x4670b5['error'])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');var _0x2fe1a1=_0x4670b5[_0x1bd5('0x12')];return _0x6d2c40(_[_0x1bd5('0x15')]({},_0x4793dd,_0x2fe1a1));});})[_0x1bd5('0x16')](function(_0x459649){_0x33f82a(_0x459649);});});}function getRealtimeQueues(_0x2ff39a,_0x3fbb39){return new Promise(function(_0x2a746d,_0x456051){var _0xb1ac1e=_0x3fbb39===_0x1bd5('0x17')?amiClient:routingClient;return _0xb1ac1e[_0x1bd5('0x10')](_[_0x1bd5('0x18')](_0x3fbb39)+_0x1bd5('0x19'),_0x2ff39a)[_0x1bd5('0x14')](function(_0x46c580){if(_0x46c580[_0x1bd5('0xc')])throw new Error(util[_0x1bd5('0x1a')]('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0x3fbb39));return _0x2a746d(_0x46c580[_0x1bd5('0x12')]);})['catch'](function(_0x18fd18){_0x456051(_0x18fd18);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x1e534e,_0x3b6eb8){return amiClient['request'](_0x1bd5('0x1b'),{})['then'](function(_0x2ed551){if(_0x2ed551[_0x1bd5('0xc')])throw new Error(_0x1bd5('0x1c'));return _0x1e534e(_0x2ed551[_0x1bd5('0x12')]);})['catch'](function(_0x202ed3){_0x3b6eb8(_0x202ed3);});});}function initializeQueues(_0x69bb17,_0x20245c,_0x3b1090,_0x4cebd0){var _0xdba332=[_0x1bd5('0x1d'),_0x1bd5('0x1e'),_0x1bd5('0x1f'),_0x1bd5('0x20'),_0x1bd5('0x21')];if(_0x3b1090==='voice'&&_0x4cebd0===_0x1bd5('0x22')){_0xdba332[_0x1bd5('0x23')](_0x1bd5('0x24'),'originated',_0x1bd5('0x25'),_0x1bd5('0x26'),_0x1bd5('0x27'),_0x1bd5('0x28'),_0x1bd5('0x29'),_0x1bd5('0x2a'),'erlangCalls','erlangCallToSecond',_0x1bd5('0x2b'),_0x1bd5('0x2c'),'dialPredictiveInterval',_0x1bd5('0x2d'),_0x1bd5('0x2e'),_0x1bd5('0x2f'),_0x1bd5('0x30'),'predictiveIntervalAnsweredCalls',_0x1bd5('0x31'),_0x1bd5('0x32'),_0x1bd5('0x33'),_0x1bd5('0x34'));}return _0x69bb17[_0x1bd5('0x35')](function(_0x223161){var _0x42fb08=_0x223161[_0x1bd5('0x36')]({'plain':!![]});_0x42fb08['agents']=[];_0x42fb08[_0x1bd5('0x21')]=0x0;_0x42fb08[_0x1bd5('0x37')]=0x0;_0x42fb08[_0x1bd5('0x1d')]=0x0;_0x42fb08[_0x1bd5('0x1e')]=0x0;_0x42fb08[_0x1bd5('0x1f')]=0x0;if(_0x3b1090===_0x1bd5('0x17')){_0x42fb08[_0x1bd5('0x20')]=0x0;_0x42fb08['busy']=0x0;if(_0x4cebd0===_0x1bd5('0x22')){_0x42fb08[_0x1bd5('0x24')]=0x0;_0x42fb08[_0x1bd5('0x38')]=0x0;}}var _0x2f5a48=_[_0x1bd5('0x39')](_0x20245c,['id',_0x42fb08['id']]);if(_0x2f5a48)_[_0x1bd5('0x15')](_0x42fb08,_[_0x1bd5('0x3a')](_0x2f5a48,_0xdba332));return _0x42fb08;});}function updateAgentVoiceStatus(_0x4cc9ba,_0x5e8b61,_0x155e4c){var _0x2f8897=_[_0x1bd5('0x3b')](_0x155e4c,['queue',_0x5e8b61[_0x1bd5('0xe')]]);if(_0x2f8897['length']===0x0)return _0x4cc9ba[_0x1bd5('0x3c')]=!![];if(_[_0x1bd5('0x3d')](_0x2f8897,[_0x1bd5('0x3e'),_0x4cc9ba[_0x1bd5('0x3f')][_0x1bd5('0x40')]()]))return _0x4cc9ba[_0x1bd5('0x20')]=!![];if(!_0x4cc9ba[_0x1bd5('0x20')])return _0x4cc9ba[_0x1bd5('0x3c')]=!![];}function getVoiceQueueAgents(_0x4bbefc,_0x114a96,_0x2978d8,_0x502724){var _0x3b5a0d=_[_0x1bd5('0x39')](_0x114a96,['id',_0x4bbefc['id']]);if(!_0x3b5a0d)return _0x4bbefc;return _0x3b5a0d[_0x1bd5('0x41')]({'raw':!![]})['then'](function(_0x2933a7){for(var _0x53482=0x0;_0x53482<_0x2933a7[_0x1bd5('0x42')];_0x53482++){var _0x4074f1=_['find'](_0x2978d8,['id',_0x2933a7[_0x53482][_0x1bd5('0x43')]]);if(!_0x4074f1){_0x4074f1={'id':_0x2933a7[_0x53482][_0x1bd5('0x43')],'name':_0x2933a7[_0x53482][_0x1bd5('0x43')],'accountcode':'','online':![]};}var _0x11e996={'id':_0x4074f1['id'],'name':_0x4074f1['name'],'internal':_0x4074f1['accountcode'],'online':Boolean(_0x4074f1[_0x1bd5('0x44')]),'paused':Boolean(_0x2933a7[_0x53482][_0x1bd5('0x21')])};if(_0x4074f1[_0x1bd5('0x45')]==='talking')updateAgentVoiceStatus(_0x11e996,_0x4bbefc,_0x502724);if(_0x11e996[_0x1bd5('0x44')])_0x4bbefc[_0x1bd5('0x37')]++;if(_0x11e996['busy'])_0x4bbefc[_0x1bd5('0x3c')]++;if(_0x11e996['paused']&&!_0x11e996[_0x1bd5('0x3c')]&&!_0x11e996[_0x1bd5('0x20')])_0x4bbefc['paused']++;_0x4bbefc[_0x1bd5('0x46')][_0x1bd5('0x23')](_0x11e996);}return _0x4bbefc;});}function getQueueAgents(_0x617f97,_0x27c011,_0x3323a2){var _0x25b35a=_0x1bd5('0x47')+_[_0x1bd5('0x18')](_0x3323a2)+_0x1bd5('0x48');var _0x3e31d3=_0x3323a2+_0x1bd5('0x49');return db[_0x25b35a][_0x1bd5('0x4a')]({'where':{[_['startCase'](_0x3323a2)+_0x1bd5('0x4b')]:_0x617f97['id']},'raw':!![]})[_0x1bd5('0x14')](function(_0x335125){for(var _0x52ade4=0x0;_0x52ade4<_0x335125[_0x1bd5('0x42')];_0x52ade4++){var _0x12e616=_['find'](_0x27c011,['id',_0x335125[_0x52ade4][_0x1bd5('0x43')]]);if(!_0x12e616){_0x12e616={'id':_0x335125[_0x52ade4]['UserId'],'name':_0x335125[_0x52ade4][_0x1bd5('0x43')],'online':![],['pauseField']:![]};}var _0x558fec={'id':_0x12e616['id'],'name':_0x12e616[_0x1bd5('0xe')],'online':Boolean(_0x12e616[_0x1bd5('0x44')]),'paused':Boolean(_0x12e616[_0x3e31d3])};if(_0x558fec['online'])_0x617f97[_0x1bd5('0x37')]++;_0x617f97['agents'][_0x1bd5('0x23')](_0x558fec);}return _0x617f97;});}function isIdle(_0x38dced){return _0x38dced===_0x1bd5('0x4c')||_0x38dced===_0x1bd5('0x4d')||_0x38dced===_0x1bd5('0x4e')||_0x38dced===_0x1bd5('0x4f')||_[_0x1bd5('0x50')](_0x38dced);}function isAgentPaused(_0x308de2,_0x53070e){var _0x13985e=[_0x308de2[_0x1bd5('0x51')],_0x308de2[_0x1bd5('0x52')],_0x308de2[_0x1bd5('0x53')],_0x308de2[_0x1bd5('0x54')],_0x308de2[_0x1bd5('0x55')],_0x308de2['voicePause'],_0x308de2[_0x1bd5('0x56')]];if(!_0x53070e)return _[_0x1bd5('0x57')](_0x13985e);var _0x3ae0d2=_[_0x1bd5('0x3b')](_0x13985e);return _0x3ae0d2[_0x1bd5('0x42')]>0x0&&_0x3ae0d2[_0x1bd5('0x42')]<_0x13985e[_0x1bd5('0x42')]?!![]:![];}function isAgentIdle(_0x539d0e){if(_0x539d0e['voiceStatus']!==_0x1bd5('0x4c')&&_0x539d0e[_0x1bd5('0x58')]){_0x539d0e[_0x1bd5('0x45')]='pause';return![];}return _[_0x1bd5('0x57')]([_0x539d0e[_0x1bd5('0x59')],_0x539d0e[_0x1bd5('0x5a')],_0x539d0e[_0x1bd5('0x5b')],_0x539d0e[_0x1bd5('0x5c')],_0x539d0e[_0x1bd5('0x5d')],_0x539d0e[_0x1bd5('0x45')],_0x539d0e['whatsappStatus']],isIdle);}function getAgentStatus(_0x316fbb){var _0x2bcd23='unknown';if(isAgentPaused(_0x316fbb))_0x2bcd23=_0x1bd5('0x5e');else if(isAgentPaused(_0x316fbb,!![]))_0x2bcd23='*pause';else if(isAgentIdle(_0x316fbb))_0x2bcd23=_0x1bd5('0x4c');else _0x2bcd23='busy';return _0x2bcd23;}exports[_0x1bd5('0x5f')]=function(_0x555ba1,_0x5a011e){var _0x25308f={'count':0x0,'rows':[]},_0x1abfb6={},_0x1b74c2,_0x363ba8,_0x41035d=[_0x1bd5('0x60'),'online',_0x1bd5('0x61'),'lastPauseAt',_0x1bd5('0x62'),_0x1bd5('0x63'),_0x1bd5('0x3f'),'address','chatPause',_0x1bd5('0x54'),_0x1bd5('0x53'),_0x1bd5('0x55'),_0x1bd5('0x56'),_0x1bd5('0x52'),_0x1bd5('0x58'),_0x1bd5('0x64'),_0x1bd5('0x65'),_0x1bd5('0x66'),_0x1bd5('0x67'),'whatsappCapacity',_0x1bd5('0x68'),'chatCurrentCapacity',_0x1bd5('0x69'),_0x1bd5('0x6a'),_0x1bd5('0x6b'),'whatsappCurrentCapacity',_0x1bd5('0x6c'),_0x1bd5('0x59'),_0x1bd5('0x5c'),'mailStatus',_0x1bd5('0x5d'),_0x1bd5('0x6d'),_0x1bd5('0x5a'),_0x1bd5('0x45'),'chatStatusTime','openchannelStatusTime',_0x1bd5('0x6e'),_0x1bd5('0x6f'),_0x1bd5('0x70'),'faxStatusTime','voiceStatusTime',_0x1bd5('0x71'),'destconnectedlinenum',_0x1bd5('0x72'),_0x1bd5('0x73'),'phoneBarEnableAutomaticScreenRecording',_0x1bd5('0x74')],_0x33f011=['chatPause',_0x1bd5('0x54'),'mailPause',_0x1bd5('0x55'),_0x1bd5('0x56'),'faxPause',_0x1bd5('0x58'),_0x1bd5('0x44')];Promise['resolve']()['then'](function(){var _0x24eeaa=_[_0x1bd5('0x35')](db['User'][_0x1bd5('0x75')],function(_0x40b508){return{'name':_0x40b508['fieldName'],'type':_0x40b508['type'][_0x1bd5('0x76')]};});_0x555ba1[_0x1bd5('0x77')][_0x1bd5('0x78')]='agent';_0x555ba1[_0x1bd5('0x77')][_0x1bd5('0x44')]=!![];_0x1abfb6=qs['getOptions'](_0x24eeaa,_0x555ba1);_0x1abfb6['raw']=!![];if(_0x555ba1[_0x1bd5('0x79')][_0x1bd5('0x78')]===_0x1bd5('0x79')){var _0xbbbef4={'params':{'id':_0x555ba1[_0x1bd5('0x79')]['userProfileId']},'query':{'section':_0x1bd5('0x13'),'role':'agent','online':!![],'nolimit':_0x555ba1[_0x1bd5('0x77')][_0x1bd5('0x7a')],'sort':_0x555ba1[_0x1bd5('0x77')][_0x1bd5('0x7b')],'filter':_0x555ba1['query']['filter'],'raw':!![]}};return db[_0x1bd5('0x7c')][_0x1bd5('0x7d')](_0xbbbef4);}return db[_0x1bd5('0x47')][_0x1bd5('0x7e')](_0x1abfb6);})[_0x1bd5('0x14')](function(_0x484fbf){_0x25308f[_0x1bd5('0x9')]=_0x484fbf[_0x1bd5('0x9')];_0x1b74c2=_0x484fbf[_0x1bd5('0x7f')];return getRealtimeAgents();})[_0x1bd5('0x14')](function(_0x2ab197){_0x363ba8=_0x2ab197[_0x1bd5('0x7f')];return _0x1b74c2[_0x1bd5('0x35')](function(_0x27be44){var _0x3f9518=_[_0x1bd5('0x39')](_0x363ba8,['id',_0x27be44['id']]);if(_0x3f9518)_[_0x1bd5('0x15')](_0x27be44,_[_0x1bd5('0x3a')](_[_0x1bd5('0x80')](_0x3f9518,_0x33f011),_0x41035d));_0x27be44[_0x1bd5('0x81')]=getAgentStatus(_0x27be44);return _0x27be44;});})[_0x1bd5('0x14')](function(_0x4ba749){if(_0x555ba1[_0x1bd5('0x77')][_0x1bd5('0x82')]){var _0x56e99c=_[_0x1bd5('0x3b')](_0x4ba749,[_0x1bd5('0x81'),_0x555ba1[_0x1bd5('0x77')][_0x1bd5('0x82')]]);if(_0x555ba1[_0x1bd5('0x77')][_0x1bd5('0x83')]){_0x56e99c=_[_0x1bd5('0x3b')](_0x56e99c,['pauseType',_0x555ba1[_0x1bd5('0x77')][_0x1bd5('0x83')]]);}}_0x25308f[_0x1bd5('0x7f')]=_0x56e99c||_0x4ba749;return _0x25308f;})[_0x1bd5('0x14')](respondWithFilteredResult(_0x5a011e,_0x1abfb6))['catch'](handleError(_0x5a011e,null));};exports[_0x1bd5('0x84')]=function(_0x31effa,_0x173fd2){var _0xefa1ee=[_0x1bd5('0x85'),_0x1bd5('0x86'),_0x1bd5('0x87'),'openchannel',_0x1bd5('0x88'),'whatsapp','voice'];var _0x34f98c={'count':0x0,'rows':[]},_0x596db9={},_0x1ede81,_0x1a4ee6,_0x560f20,_0x3d7a5b,_0xbcdba5;Promise[_0x1bd5('0x89')]()[_0x1bd5('0x14')](function(){if(_0x31effa[_0x1bd5('0x77')][_0x1bd5('0x8a')]){if(!_['includes'](_0xefa1ee,_0x31effa[_0x1bd5('0x77')][_0x1bd5('0x8a')][_0x1bd5('0x8b')]()))throw new Error(_0x1bd5('0x8c'));_0x1ede81=_0x31effa['query']['channel'][_0x1bd5('0x8b')]();}var _0x45f10d=_[_0x1bd5('0x18')](_0x1ede81)+_0x1bd5('0x48');var _0x502942=_[_0x1bd5('0x35')](db[_0x45f10d]['rawAttributes'],function(_0x5e64c0){return{'name':_0x5e64c0[_0x1bd5('0x8d')],'type':_0x5e64c0['type'][_0x1bd5('0x76')]};});_0x596db9=qs[_0x1bd5('0x8e')](_0x502942,_0x31effa);if(_0x31effa[_0x1bd5('0x79')][_0x1bd5('0x78')]===_0x1bd5('0x79')){var _0xab4ed6={'params':{'id':_0x31effa[_0x1bd5('0x79')][_0x1bd5('0x8f')]},'query':{'section':_0x1ede81===_0x1bd5('0x17')&&_0x31effa['query'][_0x1bd5('0x90')]==='outbound'?'QueueCampaigns':_['startCase'](_0x1ede81)+_0x1bd5('0x19'),'type':_0x31effa['query'][_0x1bd5('0x90')],'nolimit':!![],'sort':_0x1bd5('0xe'),'filter':_0x31effa[_0x1bd5('0x77')][_0x1bd5('0x3b')]}};return db[_0x1bd5('0x7c')][_0x1bd5('0x7d')](_0xab4ed6);}return db[_0x45f10d][_0x1bd5('0x7e')](_0x596db9);})['then'](function(_0xfc9282){_0x34f98c['count']=_0xfc9282[_0x1bd5('0x9')];_0x1a4ee6=_0xfc9282[_0x1bd5('0x7f')];return getRealtimeQueues(_0x31effa,_0x1ede81);})[_0x1bd5('0x14')](function(_0x50f2ac){_0x3d7a5b=_0x50f2ac['rows'];return getRealtimeAgents();})[_0x1bd5('0x14')](function(_0x56b322){_0x560f20=_0x56b322[_0x1bd5('0x7f')];if(_0x1ede81!='voice')return;return getRealtimeVoiceQueueChannels();})[_0x1bd5('0x14')](function(_0x16f996){_0xbcdba5=_0x16f996?_0x16f996[_0x1bd5('0x7f')]:[];return initializeQueues(_0x1a4ee6,_0x3d7a5b,_0x1ede81,_0x31effa[_0x1bd5('0x77')][_0x1bd5('0x90')]);})[_0x1bd5('0x14')](function(_0x35fb1c){var _0x3ff0da=_0x35fb1c[_0x1bd5('0x35')](function(_0x3cfbed){if(_0x1ede81===_0x1bd5('0x17'))return getVoiceQueueAgents(_0x3cfbed,_0x1a4ee6,_0x560f20,_0xbcdba5);else return getQueueAgents(_0x3cfbed,_0x560f20,_0x1ede81);});return Promise[_0x1bd5('0x91')](_0x3ff0da);})[_0x1bd5('0x14')](function(_0x3882db){_0x34f98c['rows']=_0x3882db;return _0x34f98c;})[_0x1bd5('0x14')](respondWithFilteredResult(_0x173fd2,_0x596db9))[_0x1bd5('0x16')](handleError(_0x173fd2,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 2afdb9b..3d3bc89 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(_0xd04611,_0x6f7365){var _0x72e2db=function(_0x349948){while(--_0x349948){_0xd04611['push'](_0xd04611['shift']());}};_0x72e2db(++_0x6f7365);}(_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 +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x1bc77a,_0x2f0207){var _0x3103c1=function(_0x320dfb){while(--_0x320dfb){_0x1bc77a['push'](_0x1bc77a['shift']());}};_0x3103c1(++_0x2f0207);}(_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/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 365432d..4c6aae3 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 _0x1c88=['DATE','sequelize','INTEGER','STRING'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0x1c88,0x1a9));var _0x81c8=function(_0x26659f,_0x32f426){_0x26659f=_0x26659f-0x0;var _0x42667f=_0x1c88[_0x26659f];return _0x42667f;};'use strict';var Sequelize=require(_0x81c8('0x0'));module['exports']={'state':{'type':Sequelize[_0x81c8('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x81c8('0x2')]},'scheduledat':{'type':Sequelize[_0x81c8('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x81c8('0x3')]},'ringtime':{'type':Sequelize[_0x81c8('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x81c8('0x2')]},'campaigntype':{'type':Sequelize[_0x81c8('0x2')]},'membername':{'type':Sequelize[_0x81c8('0x2')]}}; \ No newline at end of file +var _0x7b84=['exports','INTEGER','STRING','DATE','sequelize'];(function(_0x1004f7,_0x508ac2){var _0x398771=function(_0x48b38c){while(--_0x48b38c){_0x1004f7['push'](_0x1004f7['shift']());}};_0x398771(++_0x508ac2);}(_0x7b84,0x167));var _0x47b8=function(_0x5a26ef,_0x3cb28b){_0x5a26ef=_0x5a26ef-0x0;var _0x2dce29=_0x7b84[_0x5a26ef];return _0x2dce29;};'use strict';var Sequelize=require(_0x47b8('0x0'));module[_0x47b8('0x1')]={'state':{'type':Sequelize[_0x47b8('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0x47b8('0x3')]},'starttime':{'type':Sequelize[_0x47b8('0x4')]},'responsetime':{'type':Sequelize[_0x47b8('0x4')]},'ringtime':{'type':Sequelize[_0x47b8('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x47b8('0x3')]},'campaigntype':{'type':Sequelize[_0x47b8('0x3')]},'membername':{'type':Sequelize[_0x47b8('0x3')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 0f24a99..79ed279 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 _0x2a05=['../../config/environment','./reportAgentPreview.attributes','exports','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x2a05,0x1bf));var _0x52a0=function(_0x87b481,_0x261d8f){_0x87b481=_0x87b481-0x0;var _0x377b2a=_0x2a05[_0x87b481];return _0x377b2a;};'use strict';var _=require(_0x52a0('0x0'));var util=require(_0x52a0('0x1'));var logger=require(_0x52a0('0x2'))(_0x52a0('0x3'));var moment=require('moment');var BPromise=require(_0x52a0('0x4'));var rp=require(_0x52a0('0x5'));var fs=require('fs');var path=require(_0x52a0('0x6'));var rimraf=require(_0x52a0('0x7'));var config=require(_0x52a0('0x8'));var attributes=require(_0x52a0('0x9'));module[_0x52a0('0xa')]=function(_0x254228,_0x209d99){return _0x254228['define'](_0x52a0('0xb'),attributes,{'tableName':_0x52a0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6cdf=['exports','report_agent_preview','lodash','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes'];(function(_0x246227,_0x12bfcb){var _0x37bd4a=function(_0x4670f4){while(--_0x4670f4){_0x246227['push'](_0x246227['shift']());}};_0x37bd4a(++_0x12bfcb);}(_0x6cdf,0xde));var _0xf6cd=function(_0x47cc74,_0x4598df){_0x47cc74=_0x47cc74-0x0;var _0xdfe813=_0x6cdf[_0x47cc74];return _0xdfe813;};'use strict';var _=require(_0xf6cd('0x0'));var util=require('util');var logger=require(_0xf6cd('0x1'))(_0xf6cd('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf6cd('0x3'));var fs=require('fs');var path=require(_0xf6cd('0x4'));var rimraf=require(_0xf6cd('0x5'));var config=require(_0xf6cd('0x6'));var attributes=require(_0xf6cd('0x7'));module[_0xf6cd('0x8')]=function(_0x53f8f3,_0x3169e1){return _0x53f8f3['define']('ReportAgentPreview',attributes,{'tableName':_0xf6cd('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 eb6c94f..5c659dc 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 _0xf6f0=['catch','CreateReportAgentPreview','body','options','raw','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','ReportAgentPreview,\x20%s,\x20%s','message'];(function(_0x36f60c,_0x249ad8){var _0x361095=function(_0x535bb2){while(--_0x535bb2){_0x36f60c['push'](_0x36f60c['shift']());}};_0x361095(++_0x249ad8);}(_0xf6f0,0x157));var _0x0f6f=function(_0x219143,_0x451ca3){_0x219143=_0x219143-0x0;var _0x501e6b=_0xf6f0[_0x219143];return _0x501e6b;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x0f6f('0x0'));var rs=require(_0x0f6f('0x1'));var fs=require('fs');var Redis=require(_0x0f6f('0x2'));var db=require(_0x0f6f('0x3'))['db'];var utils=require(_0x0f6f('0x4'));var logger=require(_0x0f6f('0x5'))(_0x0f6f('0x6'));var config=require(_0x0f6f('0x7'));var jayson=require(_0x0f6f('0x8'));var client=jayson[_0x0f6f('0x9')][_0x0f6f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb0ca5c,_0xc44c63,_0x256f8e){return new BPromise(function(_0x5b2901,_0x73535c){return client[_0x0f6f('0xb')](_0xb0ca5c,_0x256f8e)[_0x0f6f('0xc')](function(_0x8c542d){logger[_0x0f6f('0xd')]('ReportAgentPreview,\x20%s,\x20%s',_0xc44c63,_0x0f6f('0xe'));logger['debug'](_0x0f6f('0xf'),_0xc44c63,'request\x20sent',JSON[_0x0f6f('0x10')](_0x8c542d));if(_0x8c542d[_0x0f6f('0x11')]){if(_0x8c542d['error'][_0x0f6f('0x12')]===0x1f4){logger[_0x0f6f('0x11')](_0x0f6f('0x13'),_0xc44c63,_0x8c542d['error'][_0x0f6f('0x14')]);return _0x73535c(_0x8c542d[_0x0f6f('0x11')][_0x0f6f('0x14')]);}logger['error'](_0x0f6f('0x13'),_0xc44c63,_0x8c542d[_0x0f6f('0x11')][_0x0f6f('0x14')]);return _0x5b2901(_0x8c542d[_0x0f6f('0x11')][_0x0f6f('0x14')]);}else{logger[_0x0f6f('0xd')](_0x0f6f('0x13'),_0xc44c63,_0x0f6f('0xe'));_0x5b2901(_0x8c542d['result'][_0x0f6f('0x14')]);}})[_0x0f6f('0x15')](function(_0x30962c){logger[_0x0f6f('0x11')]('ReportAgentPreview,\x20%s,\x20%s',_0xc44c63,_0x30962c);_0x73535c(_0x30962c);});});}exports[_0x0f6f('0x16')]=function(_0x156a5e){var _0x444c61=this;return new Promise(function(_0x22adcc,_0x383087){return db['ReportAgentPreview']['create'](_0x156a5e[_0x0f6f('0x17')],{'raw':_0x156a5e[_0x0f6f('0x18')]?_0x156a5e['options'][_0x0f6f('0x19')]===undefined?!![]:![]:!![]})[_0x0f6f('0xc')](function(_0x4c801b){logger[_0x0f6f('0xd')](_0x0f6f('0x16'),_0x156a5e);logger['debug']('CreateReportAgentPreview',_0x156a5e,JSON['stringify'](_0x4c801b));_0x22adcc(_0x4c801b);})[_0x0f6f('0x15')](function(_0x304707){logger['error']('CreateReportAgentPreview',_0x304707['message'],_0x156a5e);_0x383087(_0x444c61[_0x0f6f('0x11')](0x1f4,_0x304707[_0x0f6f('0x14')]));});});}; \ No newline at end of file +var _0x3c96=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','error','message','result','create','options','raw','CreateReportAgentPreview','stringify','catch','lodash','util'];(function(_0xaf5070,_0x33b5d2){var _0x542b0f=function(_0x2ae485){while(--_0x2ae485){_0xaf5070['push'](_0xaf5070['shift']());}};_0x542b0f(++_0x33b5d2);}(_0x3c96,0xfa));var _0x63c9=function(_0x5f0bc8,_0x268899){_0x5f0bc8=_0x5f0bc8-0x0;var _0x453484=_0x3c96[_0x5f0bc8];return _0x453484;};'use strict';var _=require(_0x63c9('0x0'));var util=require(_0x63c9('0x1'));var moment=require(_0x63c9('0x2'));var BPromise=require(_0x63c9('0x3'));var rs=require(_0x63c9('0x4'));var fs=require('fs');var Redis=require(_0x63c9('0x5'));var db=require(_0x63c9('0x6'))['db'];var utils=require(_0x63c9('0x7'));var logger=require(_0x63c9('0x8'))(_0x63c9('0x9'));var config=require(_0x63c9('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x63c9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x288f71,_0x43ffe3,_0x399a8f){return new BPromise(function(_0x195525,_0x30b459){return client[_0x63c9('0xc')](_0x288f71,_0x399a8f)[_0x63c9('0xd')](function(_0x28962c){logger[_0x63c9('0xe')](_0x63c9('0xf'),_0x43ffe3,_0x63c9('0x10'));logger[_0x63c9('0x11')](_0x63c9('0x12'),_0x43ffe3,_0x63c9('0x10'),JSON['stringify'](_0x28962c));if(_0x28962c[_0x63c9('0x13')]){if(_0x28962c[_0x63c9('0x13')]['code']===0x1f4){logger[_0x63c9('0x13')](_0x63c9('0xf'),_0x43ffe3,_0x28962c[_0x63c9('0x13')][_0x63c9('0x14')]);return _0x30b459(_0x28962c[_0x63c9('0x13')][_0x63c9('0x14')]);}logger[_0x63c9('0x13')](_0x63c9('0xf'),_0x43ffe3,_0x28962c[_0x63c9('0x13')]['message']);return _0x195525(_0x28962c['error']['message']);}else{logger[_0x63c9('0xe')](_0x63c9('0xf'),_0x43ffe3,_0x63c9('0x10'));_0x195525(_0x28962c[_0x63c9('0x15')][_0x63c9('0x14')]);}})['catch'](function(_0x5e9cce){logger[_0x63c9('0x13')]('ReportAgentPreview,\x20%s,\x20%s',_0x43ffe3,_0x5e9cce);_0x30b459(_0x5e9cce);});});}exports['CreateReportAgentPreview']=function(_0x4ffdaf){var _0x5ea02a=this;return new Promise(function(_0x372b5f,_0x54b8b7){return db['ReportAgentPreview'][_0x63c9('0x16')](_0x4ffdaf['body'],{'raw':_0x4ffdaf[_0x63c9('0x17')]?_0x4ffdaf[_0x63c9('0x17')][_0x63c9('0x18')]===undefined?!![]:![]:!![]})[_0x63c9('0xd')](function(_0x27f1af){logger[_0x63c9('0xe')](_0x63c9('0x19'),_0x4ffdaf);logger['debug'](_0x63c9('0x19'),_0x4ffdaf,JSON[_0x63c9('0x1a')](_0x27f1af));_0x372b5f(_0x27f1af);})[_0x63c9('0x1b')](function(_0x6a48c){logger['error']('CreateReportAgentPreview',_0x6a48c[_0x63c9('0x14')],_0x4ffdaf);_0x54b8b7(_0x5ea02a[_0x63c9('0x13')](0x1f4,_0x6a48c[_0x63c9('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index af4aad5..d901e95 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 _0x2ad8=['/whatsapp/queues/:id','/agents/:id/notify','agentNotify','exports','multer','util','express','Router','../../components/auth/service','./rpc.controller','/voice/channels','isAuthenticated','voiceChannels','voiceChannelMixMonitor','get','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelRedirect','showVoiceQueues','put','/voice/queues/:id','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','telephones','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','mail','/mail/queues/:id','showMailQueues','queueNotify','chat','/chat/queues/:id','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','/sms/queues/:id','showSmsQueues'];(function(_0x3166c2,_0x54ae94){var _0x4419bf=function(_0x1f7c3a){while(--_0x1f7c3a){_0x3166c2['push'](_0x3166c2['shift']());}};_0x4419bf(++_0x54ae94);}(_0x2ad8,0x1a3));var _0x82ad=function(_0x1363e7,_0x1e578b){_0x1363e7=_0x1363e7-0x0;var _0x1498c6=_0x2ad8[_0x1363e7];return _0x1498c6;};'use strict';var multer=require(_0x82ad('0x0'));var util=require(_0x82ad('0x1'));var path=require('path');var express=require(_0x82ad('0x2'));var router=express[_0x82ad('0x3')]();var auth=require(_0x82ad('0x4'));var controller=require(_0x82ad('0x5'));router['get'](_0x82ad('0x6'),auth[_0x82ad('0x7')](),controller[_0x82ad('0x8')]);router['get']('/voice/channels/:uniqueid/mixmonitor',auth[_0x82ad('0x7')](),controller[_0x82ad('0x9')]);router[_0x82ad('0xa')](_0x82ad('0xb'),auth[_0x82ad('0x7')](),controller[_0x82ad('0xc')]);router[_0x82ad('0xa')](_0x82ad('0xd'),auth[_0x82ad('0x7')](),controller[_0x82ad('0xe')]);router['get'](_0x82ad('0xf'),auth['isAuthenticated'](),controller[_0x82ad('0x10')]);router['get'](_0x82ad('0x11'),auth[_0x82ad('0x7')](),controller[_0x82ad('0x12')]);router[_0x82ad('0xa')](_0x82ad('0x13'),auth['isAuthenticated'](),controller[_0x82ad('0x14')]);router['get'](_0x82ad('0x15'),auth[_0x82ad('0x7')](),controller[_0x82ad('0x16')]);router[_0x82ad('0xa')]('/sms/queues',auth['isAuthenticated'](),controller['smsQueues']);router['get'](_0x82ad('0x17'),auth[_0x82ad('0x7')](),controller[_0x82ad('0x18')]);router[_0x82ad('0xa')](_0x82ad('0x19'),auth[_0x82ad('0x7')](),controller[_0x82ad('0x1a')]);router[_0x82ad('0xa')](_0x82ad('0x1b'),auth['isAuthenticated'](),controller[_0x82ad('0x1c')]);router[_0x82ad('0xa')](_0x82ad('0x1d'),auth[_0x82ad('0x7')](),controller[_0x82ad('0x1e')]);router[_0x82ad('0xa')]('/voice/queues/channels/:uniqueid',auth['isAuthenticated'](),controller[_0x82ad('0x1f')]);router[_0x82ad('0xa')](_0x82ad('0x20'),auth['isAuthenticated'](),controller['voiceQueuesChannelHangup']);router[_0x82ad('0xa')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x82ad('0x7')](),controller[_0x82ad('0x21')]);router[_0x82ad('0xa')]('/voice/queues/:id',auth[_0x82ad('0x7')](),controller[_0x82ad('0x22')]);router[_0x82ad('0x23')](_0x82ad('0x24'),auth[_0x82ad('0x7')](),controller[_0x82ad('0x25')]);router['get'](_0x82ad('0x26'),auth['isAuthenticated'](),controller[_0x82ad('0x27')]);router[_0x82ad('0xa')](_0x82ad('0x28'),auth[_0x82ad('0x7')](),controller[_0x82ad('0x29')]);router[_0x82ad('0xa')](_0x82ad('0x2a'),auth['isAuthenticated'](),controller[_0x82ad('0x2b')]);router[_0x82ad('0x23')](_0x82ad('0x2c'),auth[_0x82ad('0x7')](),controller[_0x82ad('0x2d')]);router[_0x82ad('0xa')]('/telephones',auth['isAuthenticated'](),controller[_0x82ad('0x2e')]);router[_0x82ad('0xa')]('/trunks',auth[_0x82ad('0x7')](),controller['trunks']);router[_0x82ad('0xa')]('/campaigns',auth[_0x82ad('0x7')](),controller[_0x82ad('0x2f')]);router[_0x82ad('0xa')](_0x82ad('0x30'),auth['isAuthenticated'](),controller[_0x82ad('0x31')]);router['get'](_0x82ad('0x32'),auth[_0x82ad('0x7')](),controller[_0x82ad('0x33')]);router['get']('/mail/queues/waitinginteractions',auth[_0x82ad('0x7')](),controller['mailQueuesWaitingInteractions']);router[_0x82ad('0xa')]('/openchannel/queues/waitinginteractions',auth[_0x82ad('0x7')](),controller[_0x82ad('0x34')]);router[_0x82ad('0xa')](_0x82ad('0x35'),auth[_0x82ad('0x7')](),controller[_0x82ad('0x36')]);router[_0x82ad('0xa')](_0x82ad('0x37'),auth[_0x82ad('0x7')](),controller[_0x82ad('0x38')]);router['get']('/whatsapp/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x82ad('0x39')]);router[_0x82ad('0xa')](_0x82ad('0x3a'),auth['isAuthenticated'](),controller[_0x82ad('0x3b')]);router[_0x82ad('0x3c')](_0x82ad('0x3d'),auth[_0x82ad('0x7')](),controller['queueNotify'](_0x82ad('0x3e')));router['get'](_0x82ad('0x3f'),auth[_0x82ad('0x7')](),controller[_0x82ad('0x40')]);router[_0x82ad('0x3c')]('/chat/queues/:id/notify',auth['isAuthenticated'](),controller[_0x82ad('0x41')](_0x82ad('0x42')));router[_0x82ad('0xa')](_0x82ad('0x43'),auth[_0x82ad('0x7')](),controller['showChatQueues']);router[_0x82ad('0x3c')]('/fax/queues/:id/notify',auth[_0x82ad('0x7')](),controller['queueNotify'](_0x82ad('0x44')));router[_0x82ad('0xa')](_0x82ad('0x45'),auth['isAuthenticated'](),controller[_0x82ad('0x46')]);router[_0x82ad('0x3c')](_0x82ad('0x47'),auth['isAuthenticated'](),controller['queueNotify']('openchannel'));router[_0x82ad('0xa')](_0x82ad('0x48'),auth[_0x82ad('0x7')](),controller[_0x82ad('0x49')]);router['post'](_0x82ad('0x4a'),auth['isAuthenticated'](),controller[_0x82ad('0x41')](_0x82ad('0x4b')));router[_0x82ad('0x3c')](_0x82ad('0x4c'),auth[_0x82ad('0x7')](),controller[_0x82ad('0x41')]('whatsapp'));router[_0x82ad('0xa')](_0x82ad('0x4d'),auth[_0x82ad('0x7')](),controller[_0x82ad('0x4e')]);router[_0x82ad('0xa')](_0x82ad('0x4f'),auth['isAuthenticated'](),controller['showWhatsappQueues']);router[_0x82ad('0x3c')](_0x82ad('0x50'),auth[_0x82ad('0x7')](),controller[_0x82ad('0x51')]);module[_0x82ad('0x52')]=router; \ No newline at end of file +var _0xd87a=['sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','util','path','Router','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','/mail/queues','mailQueues','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','/outbound','outbound','/outbound/channels','outboundChannels','agents','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','showChatQueues','/fax/queues/:id/notify','/fax/queues/:id','/openchannel/queues/:id/notify','openchannel','showOpenchannelQueues','/sms/queues/:id/notify'];(function(_0x195fe3,_0x4ec0bb){var _0x5651b6=function(_0x55750c){while(--_0x55750c){_0x195fe3['push'](_0x195fe3['shift']());}};_0x5651b6(++_0x4ec0bb);}(_0xd87a,0x15e));var _0xad87=function(_0x333714,_0x3370ac){_0x333714=_0x333714-0x0;var _0x4c211e=_0xd87a[_0x333714];return _0x4c211e;};'use strict';var multer=require(_0xad87('0x0'));var util=require(_0xad87('0x1'));var path=require(_0xad87('0x2'));var express=require('express');var router=express[_0xad87('0x3')]();var auth=require('../../components/auth/service');var controller=require('./rpc.controller');router[_0xad87('0x4')](_0xad87('0x5'),auth[_0xad87('0x6')](),controller[_0xad87('0x7')]);router[_0xad87('0x4')](_0xad87('0x8'),auth[_0xad87('0x6')](),controller['voiceChannelMixMonitor']);router[_0xad87('0x4')]('/voice/channels/:uniqueid/stopmixmonitor',auth[_0xad87('0x6')](),controller[_0xad87('0x9')]);router[_0xad87('0x4')](_0xad87('0xa'),auth[_0xad87('0x6')](),controller[_0xad87('0xb')]);router['get'](_0xad87('0xc'),auth[_0xad87('0x6')](),controller['chatQueues']);router[_0xad87('0x4')](_0xad87('0xd'),auth[_0xad87('0x6')](),controller[_0xad87('0xe')]);router['get']('/mail/accounts',auth[_0xad87('0x6')](),controller[_0xad87('0xf')]);router[_0xad87('0x4')](_0xad87('0x10'),auth[_0xad87('0x6')](),controller[_0xad87('0x11')]);router[_0xad87('0x4')](_0xad87('0x12'),auth[_0xad87('0x6')](),controller[_0xad87('0x13')]);router[_0xad87('0x4')](_0xad87('0x14'),auth['isAuthenticated'](),controller[_0xad87('0x15')]);router[_0xad87('0x4')](_0xad87('0x16'),auth[_0xad87('0x6')](),controller[_0xad87('0x17')]);router['get'](_0xad87('0x18'),auth['isAuthenticated'](),controller[_0xad87('0x19')]);router['get'](_0xad87('0x1a'),auth[_0xad87('0x6')](),controller['voiceQueuesChannels']);router[_0xad87('0x4')](_0xad87('0x1b'),auth[_0xad87('0x6')](),controller[_0xad87('0x1c')]);router[_0xad87('0x4')](_0xad87('0x1d'),auth[_0xad87('0x6')](),controller['voiceQueuesChannelHangup']);router[_0xad87('0x4')](_0xad87('0x1e'),auth[_0xad87('0x6')](),controller[_0xad87('0x1f')]);router['get'](_0xad87('0x20'),auth['isAuthenticated'](),controller[_0xad87('0x21')]);router[_0xad87('0x22')](_0xad87('0x20'),auth['isAuthenticated'](),controller['updateVoiceQueue']);router['get'](_0xad87('0x23'),auth['isAuthenticated'](),controller[_0xad87('0x24')]);router[_0xad87('0x4')](_0xad87('0x25'),auth['isAuthenticated'](),controller[_0xad87('0x26')]);router[_0xad87('0x4')]('/agents',auth[_0xad87('0x6')](),controller[_0xad87('0x27')]);router['put']('/agents/:id/capacity',auth['isAuthenticated'](),controller['agentCapacity']);router[_0xad87('0x4')](_0xad87('0x28'),auth[_0xad87('0x6')](),controller[_0xad87('0x29')]);router['get'](_0xad87('0x2a'),auth[_0xad87('0x6')](),controller[_0xad87('0x2b')]);router[_0xad87('0x4')](_0xad87('0x2c'),auth[_0xad87('0x6')](),controller[_0xad87('0x2d')]);router['get'](_0xad87('0x2e'),auth[_0xad87('0x6')](),controller[_0xad87('0x2f')]);router[_0xad87('0x4')](_0xad87('0x30'),auth['isAuthenticated'](),controller[_0xad87('0x31')]);router[_0xad87('0x4')](_0xad87('0x32'),auth[_0xad87('0x6')](),controller[_0xad87('0x33')]);router['get'](_0xad87('0x34'),auth[_0xad87('0x6')](),controller[_0xad87('0x35')]);router[_0xad87('0x4')](_0xad87('0x36'),auth[_0xad87('0x6')](),controller[_0xad87('0x37')]);router[_0xad87('0x4')]('/sms/queues/waitinginteractions',auth[_0xad87('0x6')](),controller[_0xad87('0x38')]);router[_0xad87('0x4')](_0xad87('0x39'),auth['isAuthenticated'](),controller[_0xad87('0x3a')]);router[_0xad87('0x4')](_0xad87('0x3b'),auth[_0xad87('0x6')](),controller[_0xad87('0x3c')]);router[_0xad87('0x3d')](_0xad87('0x3e'),auth[_0xad87('0x6')](),controller[_0xad87('0x3f')]('mail'));router[_0xad87('0x4')](_0xad87('0x40'),auth[_0xad87('0x6')](),controller[_0xad87('0x41')]);router[_0xad87('0x3d')](_0xad87('0x42'),auth['isAuthenticated'](),controller[_0xad87('0x3f')](_0xad87('0x43')));router[_0xad87('0x4')]('/chat/queues/:id',auth['isAuthenticated'](),controller[_0xad87('0x44')]);router['post'](_0xad87('0x45'),auth[_0xad87('0x6')](),controller[_0xad87('0x3f')]('fax'));router[_0xad87('0x4')](_0xad87('0x46'),auth[_0xad87('0x6')](),controller['showFaxQueues']);router[_0xad87('0x3d')](_0xad87('0x47'),auth[_0xad87('0x6')](),controller[_0xad87('0x3f')](_0xad87('0x48')));router[_0xad87('0x4')]('/openchannel/queues/:id',auth[_0xad87('0x6')](),controller[_0xad87('0x49')]);router[_0xad87('0x3d')](_0xad87('0x4a'),auth[_0xad87('0x6')](),controller['queueNotify'](_0xad87('0x4b')));router[_0xad87('0x3d')](_0xad87('0x4c'),auth[_0xad87('0x6')](),controller['queueNotify'](_0xad87('0x4d')));router[_0xad87('0x4')](_0xad87('0x4e'),auth[_0xad87('0x6')](),controller[_0xad87('0x4f')]);router[_0xad87('0x4')](_0xad87('0x50'),auth['isAuthenticated'](),controller[_0xad87('0x51')]);router['post'](_0xad87('0x52'),auth['isAuthenticated'](),controller[_0xad87('0x53')]);module[_0xad87('0x54')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index ee413ae..7f3ba7b 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 _0x7fbe=['VoiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','Agents','agentCapacity','interaction','MemberReport','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','SIP/%s','user','interface','agent','internal','AgentCapacity','telephones','Telephones','trunks','Campaigns','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','showOpenchannelQueues','OpenchannelQueues','smsQueues','showSmsQueues','SmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','showFaxQueues','FaxQueues','faxAccounts','FaxAccounts','ChatQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','rows','filter','map','queue_id','uniq','value','indexOf','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','chat','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','InteractionId','QueueId','create','queueTransferTimeout','agentNotify','channel','Channel\x20field\x20is\x20mandatory','capitalize','Website','User','Agent\x20not\x20found','From','TransferReport','Start','agentTransferTimeout','*,*,*,*','lodash','util','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','error','code','message','result','catch','status','json','stack','name','send','isNil','find','voiceChannels','query','VoiceChannelMixMonitor','merge','params','then','voiceQueues','showVoiceQueues','VoiceQueues','UpdateVoiceQueue','body'];(function(_0x49f1b4,_0x4dbe76){var _0xf341d9=function(_0x1af0d6){while(--_0x1af0d6){_0x49f1b4['push'](_0x49f1b4['shift']());}};_0xf341d9(++_0x4dbe76);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x4d3329,_0x53e55b){_0x4d3329=_0x4d3329-0x0;var _0x3abb35=_0x7fbe[_0x4d3329];return _0x3abb35;};'use strict';var BPromise=require('bluebird');var moment=require('moment');var _=require(_0xe7fb('0x0'));var util=require(_0xe7fb('0x1'));var db=require(_0xe7fb('0x2'))['db'];var logger=require(_0xe7fb('0x3'))(_0xe7fb('0x4'));var jayson=require(_0xe7fb('0x5'));var amiClient=jayson[_0xe7fb('0x6')][_0xe7fb('0x7')]({'port':0x232a});var mailClient=jayson[_0xe7fb('0x6')][_0xe7fb('0x7')]({'port':0x232b});var routingClient=jayson[_0xe7fb('0x6')][_0xe7fb('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){var _0x1d0741=_0x5ad75b?_0x5ad75b:amiClient;return _0x1d0741[_0xe7fb('0x8')](_0x24cd67,_0x1f943f)['then'](function(_0x558857){if(_0x558857[_0xe7fb('0x9')]){if(_0x558857[_0xe7fb('0x9')][_0xe7fb('0xa')]===0x1f4){return _0x228f6b(_0x558857[_0xe7fb('0x9')][_0xe7fb('0xb')]);}return _0x213ebc(_0x558857[_0xe7fb('0x9')][_0xe7fb('0xb')]);}else{_0x213ebc(_0x558857[_0xe7fb('0xc')]);}})[_0xe7fb('0xd')](function(_0x2fe8ab){_0x228f6b(_0x2fe8ab);});});}function respondWithResult(_0x2437d4,_0x188e1d){_0x188e1d=_0x188e1d||0xc8;return function(_0xdf9760){if(_0xdf9760){return _0x2437d4[_0xe7fb('0xe')](_0x188e1d)[_0xe7fb('0xf')](_0xdf9760);}return _0x2437d4['sendStatus'](0x194);};}function handleError(_0x278b75,_0x2225e5){_0x2225e5=_0x2225e5||0x1f4;return function(_0x5573ab){logger[_0xe7fb('0x9')](_0x5573ab[_0xe7fb('0x10')]);if(_0x5573ab['name']){delete _0x5573ab[_0xe7fb('0x11')];}_0x278b75['status'](_0x2225e5)[_0xe7fb('0x12')](_0x5573ab);};}function findById(_0x18d23c){return function(_0x12603d){if(!_[_0xe7fb('0x13')](_0x18d23c)&&!_['isNil'](_0x12603d)&&!_[_0xe7fb('0x13')](_0x12603d['rows'])){return _[_0xe7fb('0x14')](_0x12603d['rows'],function(_0x1e77fd){return _0x1e77fd['id']==_0x18d23c;});}return null;};}exports[_0xe7fb('0x15')]=function(_0x3f96a7,_0x182269){return respondWithRpcPromise('VoiceChannels',_0x3f96a7[_0xe7fb('0x16')])['then'](respondWithResult(_0x182269,null))[_0xe7fb('0xd')](handleError(_0x182269,null));};exports['voiceChannelMixMonitor']=function(_0x15f7a4,_0x4ea664){return respondWithRpcPromise(_0xe7fb('0x17'),_[_0xe7fb('0x18')](_0x15f7a4['query'],_0x15f7a4[_0xe7fb('0x19')]))[_0xe7fb('0x1a')](respondWithResult(_0x4ea664,null))[_0xe7fb('0xd')](handleError(_0x4ea664,null));};exports['voiceChannelStopMixMonitor']=function(_0x469d50,_0x469ead){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_['merge'](_0x469d50['query'],_0x469d50[_0xe7fb('0x19')]))['then'](respondWithResult(_0x469ead,null))['catch'](handleError(_0x469ead,null));};exports[_0xe7fb('0x1b')]=function(_0x32e8b2,_0x2996ae){return respondWithRpcPromise('VoiceQueues',_0x32e8b2[_0xe7fb('0x16')])[_0xe7fb('0x1a')](respondWithResult(_0x2996ae,null))[_0xe7fb('0xd')](handleError(_0x2996ae,null));};exports[_0xe7fb('0x1c')]=function(_0x392d75,_0x16237a){return respondWithRpcPromise(_0xe7fb('0x1d'),_0x392d75['query'])['then'](findById(_0x392d75[_0xe7fb('0x19')]['id']))[_0xe7fb('0x1a')](respondWithResult(_0x16237a,null))[_0xe7fb('0xd')](handleError(_0x16237a,null));};exports['updateVoiceQueue']=function(_0xb1f2f4,_0x251807){return respondWithRpcPromise(_0xe7fb('0x1e'),_[_0xe7fb('0x18')](_0xb1f2f4[_0xe7fb('0x1f')],_0xb1f2f4[_0xe7fb('0x19')]))[_0xe7fb('0x1a')](respondWithResult(_0x251807,null))[_0xe7fb('0xd')](handleError(_0x251807,null));};exports['voiceQueuesPreview']=function(_0x3d1fb5,_0x1742f3){return respondWithRpcPromise(_0xe7fb('0x20'),_['merge'](_0x3d1fb5['query'],_0x3d1fb5[_0xe7fb('0x19')]))['then'](respondWithResult(_0x1742f3,null))[_0xe7fb('0xd')](handleError(_0x1742f3,null));};exports[_0xe7fb('0x21')]=function(_0xe49053,_0x2a4745){return respondWithRpcPromise('VoiceQueuesChannels',_0xe49053[_0xe7fb('0x16')])[_0xe7fb('0x1a')](respondWithResult(_0x2a4745,null))[_0xe7fb('0xd')](handleError(_0x2a4745,null));};exports[_0xe7fb('0x22')]=function(_0x2d650d,_0x480819){return respondWithRpcPromise(_0xe7fb('0x23'),_[_0xe7fb('0x18')](_0x2d650d[_0xe7fb('0x16')],_0x2d650d[_0xe7fb('0x19')]))[_0xe7fb('0x1a')](respondWithResult(_0x480819,null))[_0xe7fb('0xd')](handleError(_0x480819,null));};exports[_0xe7fb('0x24')]=function(_0x147eb1,_0x389903){return respondWithRpcPromise('VoiceQueuesChannelHangup',_[_0xe7fb('0x18')](_0x147eb1[_0xe7fb('0x16')],_0x147eb1[_0xe7fb('0x19')]))['then'](respondWithResult(_0x389903,null))[_0xe7fb('0xd')](handleError(_0x389903,null));};exports[_0xe7fb('0x25')]=function(_0x4218bc,_0x1530b1){return respondWithRpcPromise(_0xe7fb('0x26'),_[_0xe7fb('0x18')](_0x4218bc[_0xe7fb('0x16')],_0x4218bc[_0xe7fb('0x19')]))[_0xe7fb('0x1a')](respondWithResult(_0x1530b1,null))[_0xe7fb('0xd')](handleError(_0x1530b1,null));};exports[_0xe7fb('0x27')]=function(_0x3c4f4b,_0x1544f2){return respondWithRpcPromise(_0xe7fb('0x28'),_0x3c4f4b[_0xe7fb('0x16')])[_0xe7fb('0x1a')](respondWithResult(_0x1544f2,null))[_0xe7fb('0xd')](handleError(_0x1544f2,null));};exports[_0xe7fb('0x29')]=function(_0x21e35c,_0x4d6fe6){return respondWithRpcPromise(_0xe7fb('0x2a'),_0x21e35c[_0xe7fb('0x16')])[_0xe7fb('0x1a')](respondWithResult(_0x4d6fe6,null))[_0xe7fb('0xd')](handleError(_0x4d6fe6,null));};exports['agents']=function(_0x3426a9,_0x186418){var _0xd472d;return respondWithRpcPromise(_0xe7fb('0x2b'),_0x3426a9['query'])[_0xe7fb('0x1a')](function(_0x451a6c){_0xd472d=_0x451a6c;return respondWithRpcPromise(_0xe7fb('0x2b'),_0x3426a9[_0xe7fb('0x16')],routingClient);})[_0xe7fb('0x1a')](function(_0xb729fc){return _['merge']({},_0xb729fc,_0xd472d);})[_0xe7fb('0x1a')](respondWithResult(_0x186418,null))[_0xe7fb('0xd')](handleError(_0x186418,null));};exports[_0xe7fb('0x2c')]=function(_0x4b263d,_0x36a341){if(_0x4b263d[_0xe7fb('0x1f')]&&_0x4b263d['body']['interaction']&&_0x4b263d['user']&&_0x4b263d['user']['name']){for(var _0x900d67 in _0x4b263d[_0xe7fb('0x1f')][_0xe7fb('0x2d')]){if(_0x4b263d['body'][_0xe7fb('0x2d')]['hasOwnProperty'](_0x900d67)){db[_0xe7fb('0x2e')][_0xe7fb('0x2f')]({'where':{'channel':_0x900d67,'membername':_0x4b263d['user'][_0xe7fb('0x11')],'type':_0xe7fb('0x30'),'exitAt':null,'uniqueid':_0x4b263d[_0xe7fb('0x1f')][_0xe7fb('0x2d')][_0x900d67]&&_0x4b263d['body'][_0xe7fb('0x2d')][_0x900d67][_0xe7fb('0x31')]?{'$notIn':_0x4b263d[_0xe7fb('0x1f')]['interaction'][_0x900d67]}:{'$ne':null}}})[_0xe7fb('0x1a')](function(_0x6eb1ab){var _0x13b17f=moment()[_0xe7fb('0x32')](_0xe7fb('0x33'));for(var _0x5a1ce1=0x0,_0x2eb999=_0x6eb1ab['length'];_0x5a1ce1<_0x2eb999;_0x5a1ce1+=0x1){_0x6eb1ab[_0x5a1ce1][_0xe7fb('0x34')]({'exitAt':_0x13b17f});}});for(var _0x468c62=0x0;_0x468c62<_0x4b263d[_0xe7fb('0x1f')][_0xe7fb('0x2d')][_0x900d67][_0xe7fb('0x31')];_0x468c62+=0x1){db['MemberReport'][_0xe7fb('0x35')]({'where':{'channel':_0x900d67,'membername':_0x4b263d['user']['name'],'type':_0xe7fb('0x30'),'uniqueid':_0x4b263d[_0xe7fb('0x1f')][_0xe7fb('0x2d')][_0x900d67][_0x468c62],'exitAt':null},'defaults':{'channel':_0x900d67,'membername':_0x4b263d['user'][_0xe7fb('0x11')],'interface':_[_0xe7fb('0x13')](_0x4b263d['user']['interface'])?util[_0xe7fb('0x32')](_0xe7fb('0x36'),_0x4b263d[_0xe7fb('0x37')][_0xe7fb('0x11')]):_0x4b263d[_0xe7fb('0x37')][_0xe7fb('0x38')],'type':_0xe7fb('0x30'),'enterAt':moment()[_0xe7fb('0x32')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0xe7fb('0x39'),'internal':_0x4b263d['user'][_0xe7fb('0x3a')],'uniqueid':_0x4b263d[_0xe7fb('0x1f')]['interaction'][_0x900d67][_0x468c62]}});}}}}return respondWithRpcPromise(_0xe7fb('0x3b'),{'id':_0x4b263d['params']['id'],'capacity':_0x4b263d[_0xe7fb('0x1f')]['capacity']},routingClient)[_0xe7fb('0x1a')](respondWithResult(_0x36a341,null))['catch'](handleError(_0x36a341,null));};exports[_0xe7fb('0x3c')]=function(_0x59158c,_0x1fff6c){return respondWithRpcPromise(_0xe7fb('0x3d'),_0x59158c[_0xe7fb('0x16')])[_0xe7fb('0x1a')](respondWithResult(_0x1fff6c,null))[_0xe7fb('0xd')](handleError(_0x1fff6c,null));};exports[_0xe7fb('0x3e')]=function(_0x2f4760,_0x582a4a){return respondWithRpcPromise('Trunks',_0x2f4760[_0xe7fb('0x16')])['then'](respondWithResult(_0x582a4a,null))['catch'](handleError(_0x582a4a,null));};exports['campaigns']=function(_0x50b8df,_0x539252){return respondWithRpcPromise(_0xe7fb('0x3f'),_0x50b8df[_0xe7fb('0x16')])[_0xe7fb('0x1a')](respondWithResult(_0x539252,null))[_0xe7fb('0xd')](handleError(_0x539252,null));};exports['chatQueues']=function(_0x37af37,_0x236b35){return respondWithRpcPromise(_0xe7fb('0x40'),_0x37af37['query'],routingClient)['then'](respondWithResult(_0x236b35,null))[_0xe7fb('0xd')](handleError(_0x236b35,null));};exports[_0xe7fb('0x41')]=function(_0x300b8e,_0x4f4ba3){return respondWithRpcPromise(_0xe7fb('0x40'),_0x300b8e[_0xe7fb('0x16')],routingClient)[_0xe7fb('0x1a')](findById(_0x300b8e[_0xe7fb('0x19')]['id']))['then'](respondWithResult(_0x4f4ba3,null))['catch'](handleError(_0x4f4ba3,null));};exports[_0xe7fb('0x42')]=function(_0x3104c2,_0x1f16b2){return respondWithRpcPromise(_0xe7fb('0x43'),_0x3104c2[_0xe7fb('0x16')],routingClient)['then'](respondWithResult(_0x1f16b2,null))[_0xe7fb('0xd')](handleError(_0x1f16b2,null));};exports[_0xe7fb('0x44')]=function(_0x23755b,_0x590d7a){return respondWithRpcPromise('MailQueues',_0x23755b[_0xe7fb('0x16')],routingClient)[_0xe7fb('0x1a')](findById(_0x23755b[_0xe7fb('0x19')]['id']))[_0xe7fb('0x1a')](respondWithResult(_0x590d7a,null))[_0xe7fb('0xd')](handleError(_0x590d7a,null));};exports[_0xe7fb('0x45')]=function(_0x585b7c,_0x1e21e4){return respondWithRpcPromise(_0xe7fb('0x46'),_0x585b7c[_0xe7fb('0x16')],mailClient)[_0xe7fb('0x1a')](respondWithResult(_0x1e21e4,null))[_0xe7fb('0xd')](handleError(_0x1e21e4,null));};exports[_0xe7fb('0x47')]=function(_0x554092,_0x2e457c){return respondWithRpcPromise('OpenchannelQueues',_0x554092[_0xe7fb('0x16')],routingClient)[_0xe7fb('0x1a')](respondWithResult(_0x2e457c,null))[_0xe7fb('0xd')](handleError(_0x2e457c,null));};exports[_0xe7fb('0x48')]=function(_0x5925e6,_0x47ac92){return respondWithRpcPromise(_0xe7fb('0x49'),_0x5925e6[_0xe7fb('0x16')],routingClient)[_0xe7fb('0x1a')](findById(_0x5925e6[_0xe7fb('0x19')]['id']))[_0xe7fb('0x1a')](respondWithResult(_0x47ac92,null))['catch'](handleError(_0x47ac92,null));};exports[_0xe7fb('0x4a')]=function(_0x58d4ec,_0x127b0e){return respondWithRpcPromise('SmsQueues',_0x58d4ec['query'],routingClient)[_0xe7fb('0x1a')](respondWithResult(_0x127b0e,null))[_0xe7fb('0xd')](handleError(_0x127b0e,null));};exports[_0xe7fb('0x4b')]=function(_0x5da884,_0x475716){return respondWithRpcPromise(_0xe7fb('0x4c'),_0x5da884[_0xe7fb('0x16')],routingClient)[_0xe7fb('0x1a')](findById(_0x5da884[_0xe7fb('0x19')]['id']))['then'](respondWithResult(_0x475716,null))[_0xe7fb('0xd')](handleError(_0x475716,null));};exports[_0xe7fb('0x4d')]=function(_0x5151ec,_0x4136ae){return respondWithRpcPromise(_0xe7fb('0x4e'),_0x5151ec['query'],routingClient)[_0xe7fb('0x1a')](respondWithResult(_0x4136ae,null))['catch'](handleError(_0x4136ae,null));};exports[_0xe7fb('0x4f')]=function(_0x1dc9c1,_0xa93f35){return respondWithRpcPromise('WhatsappQueues',_0x1dc9c1[_0xe7fb('0x16')],routingClient)[_0xe7fb('0x1a')](findById(_0x1dc9c1[_0xe7fb('0x19')]['id']))[_0xe7fb('0x1a')](respondWithResult(_0xa93f35,null))[_0xe7fb('0xd')](handleError(_0xa93f35,null));};exports[_0xe7fb('0x50')]=function(_0xcdc72e,_0x187040){return respondWithRpcPromise('FaxQueues',_0xcdc72e['query'],routingClient)[_0xe7fb('0x1a')](respondWithResult(_0x187040,null))[_0xe7fb('0xd')](handleError(_0x187040,null));};exports[_0xe7fb('0x51')]=function(_0x50c705,_0x519c5f){return respondWithRpcPromise(_0xe7fb('0x52'),_0x50c705[_0xe7fb('0x16')],routingClient)[_0xe7fb('0x1a')](findById(_0x50c705[_0xe7fb('0x19')]['id']))[_0xe7fb('0x1a')](respondWithResult(_0x519c5f,null))[_0xe7fb('0xd')](handleError(_0x519c5f,null));};exports[_0xe7fb('0x53')]=function(_0x3f11f1,_0xb06693){return respondWithRpcPromise(_0xe7fb('0x54'),_0x3f11f1[_0xe7fb('0x16')])[_0xe7fb('0x1a')](respondWithResult(_0xb06693,null))[_0xe7fb('0xd')](handleError(_0xb06693,null));};exports['chatQueuesWaitingInteractions']=function(_0x4fa142,_0x125427){return respondWithRpcPromise(_0xe7fb('0x55'),_0x4fa142[_0xe7fb('0x16')],routingClient)[_0xe7fb('0x1a')](respondWithResult(_0x125427,null))[_0xe7fb('0xd')](handleError(_0x125427,null));};exports['mailQueuesWaitingInteractions']=function(_0x43f14b,_0x1beb13){return respondWithRpcPromise(_0xe7fb('0x56'),_0x43f14b[_0xe7fb('0x16')],routingClient)[_0xe7fb('0x1a')](respondWithResult(_0x1beb13,null))[_0xe7fb('0xd')](handleError(_0x1beb13,null));};exports[_0xe7fb('0x57')]=function(_0x1e6256,_0xa7fa61){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x1e6256[_0xe7fb('0x16')],routingClient)['then'](respondWithResult(_0xa7fa61,null))[_0xe7fb('0xd')](handleError(_0xa7fa61,null));};exports[_0xe7fb('0x58')]=function(_0x2a2079,_0x31c159){return respondWithRpcPromise(_0xe7fb('0x59'),_0x2a2079['query'],routingClient)[_0xe7fb('0x1a')](function(_0x38e66a){if(_0x2a2079[_0xe7fb('0x16')][_0xe7fb('0x5a')]!==undefined){var _0x15d881=_(_0x38e66a[_0xe7fb('0x5b')])[_0xe7fb('0x5c')]([_0x2a2079[_0xe7fb('0x16')][_0xe7fb('0x5a')],_0x2a2079[_0xe7fb('0x19')]['id']])[_0xe7fb('0x5d')](_0xe7fb('0x5e'))[_0xe7fb('0x5f')]()[_0xe7fb('0x60')]();return _0x38e66a['rows']['filter'](function(_0x48a015){return _0x15d881[_0xe7fb('0x61')](_0x48a015[_0xe7fb('0x5e')])>-0x1;});}else{return _0x38e66a[_0xe7fb('0x5b')][_0xe7fb('0x5c')](function(_0x535e8b){return _0x535e8b[_0xe7fb('0x5e')]===parseInt(_0x2a2079[_0xe7fb('0x19')]['id']);});}})[_0xe7fb('0x1a')](respondWithResult(_0x31c159,null))[_0xe7fb('0xd')](handleError(_0x31c159,null));};exports['smsQueuesWaitingInteractions']=function(_0x2f7fa6,_0x5650c6){return respondWithRpcPromise(_0xe7fb('0x62'),_0x2f7fa6[_0xe7fb('0x16')],routingClient)[_0xe7fb('0x1a')](respondWithResult(_0x5650c6,null))[_0xe7fb('0xd')](handleError(_0x5650c6,null));};exports[_0xe7fb('0x63')]=function(_0x4ab541,_0x3ffd6c){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x4ab541[_0xe7fb('0x16')],routingClient)['then'](respondWithResult(_0x3ffd6c,null))[_0xe7fb('0xd')](handleError(_0x3ffd6c,null));};exports[_0xe7fb('0x64')]=function(_0x4c37cd,_0x2b6d69){return respondWithRpcPromise(_0xe7fb('0x65'),_0x4c37cd[_0xe7fb('0x16')],routingClient)[_0xe7fb('0x1a')](respondWithResult(_0x2b6d69,null))['catch'](handleError(_0x2b6d69,null));};exports[_0xe7fb('0x66')]=function(_0x277335){return function(_0x1412e2,_0x4d0eed){var _0x11d5b6,_0x4b2cc4;var _0x5b1e28=_['capitalize'](_0x277335);var _0x3c99e7=_0x277335===_0xe7fb('0x67')?'Website':_0xe7fb('0x68');return db[_0x5b1e28+_0xe7fb('0x69')][_0xe7fb('0x6a')]({'raw':!![],'where':{'id':_0x1412e2[_0xe7fb('0x19')]['id']}})[_0xe7fb('0x1a')](function(_0x1cc21d){if(_[_0xe7fb('0x13')](_0x1cc21d)){throw new Error(_0x5b1e28+_0xe7fb('0x6b'));}_0x11d5b6=_0x1cc21d;return db[_0x5b1e28+_0xe7fb('0x6c')][_0xe7fb('0x6a')]({'where':{'id':_0x1412e2[_0xe7fb('0x1f')][_0xe7fb('0x6d')]},'include':[{'model':db[_0x5b1e28+_0xe7fb('0x6e')],'as':_0xe7fb('0x6e')},{'model':db[_0x5b1e28+_0x3c99e7],'as':_0xe7fb('0x68')}]});})[_0xe7fb('0x1a')](function(_0x3c5bd9){if(_[_0xe7fb('0x13')](_0x3c5bd9)){throw new Error(_0x5b1e28+_0xe7fb('0x6f'));}_0x4b2cc4=_0x3c5bd9;return _0x3c5bd9[_0xe7fb('0x70')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x47568c={'uniqueid':_0x277335+'.'+_0x4b2cc4['id']+'.'+_0x4b2cc4[_0xe7fb('0x6e')]['id'],'FromUserId':_0x1412e2[_0xe7fb('0x37')]['id'],'type':_0xe7fb('0x71')};_0x47568c[_0x5b1e28+_0xe7fb('0x72')]=_0x4b2cc4['id'];_0x47568c[_0x5b1e28+_0xe7fb('0x73')]=_0x4b2cc4[_0xe7fb('0x6e')]['id'];_0x47568c['From'+_0x5b1e28+_0x3c99e7+'Id']=_0x4b2cc4['Account']['id'];_0x47568c['To'+_0x5b1e28+_0xe7fb('0x74')]=_0x11d5b6['id'];return db[_0x5b1e28+'TransferReport'][_0xe7fb('0x75')](_0x47568c);})[_0xe7fb('0x1a')](function(){return respondWithRpcPromise('Start',{'channel':_0x277335,'interaction':_0x4b2cc4[_0xe7fb('0x6e')],'message':_0x4b2cc4,'account':_0x4b2cc4[_0xe7fb('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':_0xe7fb('0x71'),'appdata':_0x11d5b6[_0xe7fb('0x11')]+','+(_0x4b2cc4[_0xe7fb('0x68')][_0xe7fb('0x76')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xe7fb('0x1a')](respondWithResult(_0x4d0eed,null))[_0xe7fb('0xd')](handleError(_0x4d0eed,null));};};exports[_0xe7fb('0x77')]=function(_0xae9441,_0x276c28){var _0xd5a417,_0x48de0c;if(_['isNil'](_0xae9441['body'][_0xe7fb('0x78')])){throw new Error(_0xe7fb('0x79'));}var _0x2b0600=_0xae9441['body'][_0xe7fb('0x78')];var _0x57ee3b=_[_0xe7fb('0x7a')](_0x2b0600);var _0x278a6c=_0x2b0600===_0xe7fb('0x67')?_0xe7fb('0x7b'):'Account';return db[_0xe7fb('0x7c')][_0xe7fb('0x6a')]({'raw':!![],'where':{'id':_0xae9441[_0xe7fb('0x19')]['id'],'role':_0xe7fb('0x39')}})[_0xe7fb('0x1a')](function(_0x33262f){if(_[_0xe7fb('0x13')](_0x33262f)){throw new Error(_0xe7fb('0x7d'));}_0xd5a417=_0x33262f;return db[_0x57ee3b+'Message']['findOne']({'where':{'id':_0xae9441[_0xe7fb('0x1f')]['messageId']},'include':[{'model':db[_0x57ee3b+_0xe7fb('0x6e')],'as':_0xe7fb('0x6e')},{'model':db[_0x57ee3b+_0x278a6c],'as':_0xe7fb('0x68')}]});})[_0xe7fb('0x1a')](function(_0x58352d){if(_['isNil'](_0x58352d)){throw new Error(_0x57ee3b+_0xe7fb('0x6f'));}_0x48de0c=_0x58352d;return _0x58352d[_0xe7fb('0x70')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x21cb12={'uniqueid':_0x2b0600+'.'+_0x48de0c['id']+'.'+_0x48de0c[_0xe7fb('0x6e')]['id'],'FromUserId':_0xae9441[_0xe7fb('0x37')]['id'],'type':_0xe7fb('0x71'),'ToUserId':_0xd5a417['id']};_0x21cb12[_0x57ee3b+_0xe7fb('0x72')]=_0x48de0c['id'];_0x21cb12[_0x57ee3b+_0xe7fb('0x73')]=_0x48de0c['Interaction']['id'];_0x21cb12[_0xe7fb('0x7e')+_0x57ee3b+_0x278a6c+'Id']=_0x48de0c[_0xe7fb('0x68')]['id'];return db[_0x57ee3b+_0xe7fb('0x7f')][_0xe7fb('0x75')](_0x21cb12);})[_0xe7fb('0x1a')](function(){return respondWithRpcPromise(_0xe7fb('0x80'),{'channel':_0x2b0600,'interaction':_0x48de0c[_0xe7fb('0x6e')],'message':_0x48de0c,'account':_0x48de0c[_0xe7fb('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':_0xe7fb('0x39'),'appdata':_0xd5a417[_0xe7fb('0x11')]+','+(_0x48de0c[_0xe7fb('0x68')][_0xe7fb('0x81')]||0x12c),'interval':_0xe7fb('0x82')}]},routingClient);})[_0xe7fb('0x1a')](respondWithResult(_0x276c28,null))[_0xe7fb('0xd')](handleError(_0x276c28,null));}; \ No newline at end of file +var _0x6f47=['voiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','interaction','user','hasOwnProperty','MemberReport','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','interface','agent','internal','telephones','trunks','Trunks','Campaigns','showChatQueues','ChatQueues','MailQueues','showMailQueues','mailAccounts','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','queue_id','uniq','value','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','InteractionId','From','QueueId','Start','queueTransferTimeout','*,*,*,*','channel','Channel\x20field\x20is\x20mandatory','User','create','moment','lodash','../../mysqldb','api','client','http','request','then','error','code','message','result','catch','status','sendStatus','stack','name','send','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','merge','params','VoiceChannelStopMixMonitor','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel'];(function(_0x58e4ee,_0x1be8fb){var _0x58f139=function(_0x187842){while(--_0x187842){_0x58e4ee['push'](_0x58e4ee['shift']());}};_0x58f139(++_0x1be8fb);}(_0x6f47,0xc7));var _0x76f4=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x6f47[_0x9cd4c3];return _0x4c9025;};'use strict';var BPromise=require('bluebird');var moment=require(_0x76f4('0x0'));var _=require(_0x76f4('0x1'));var util=require('util');var db=require(_0x76f4('0x2'))['db'];var logger=require('../../config/logger')(_0x76f4('0x3'));var jayson=require('jayson/promise');var amiClient=jayson[_0x76f4('0x4')][_0x76f4('0x5')]({'port':0x232a});var mailClient=jayson[_0x76f4('0x4')][_0x76f4('0x5')]({'port':0x232b});var routingClient=jayson['client'][_0x76f4('0x5')]({'port':0x232c});function respondWithRpcPromise(_0xfc2405,_0x2176a7,_0x497f99){return new BPromise(function(_0x1a3172,_0x25656d){var _0x65d2c7=_0x497f99?_0x497f99:amiClient;return _0x65d2c7[_0x76f4('0x6')](_0xfc2405,_0x2176a7)[_0x76f4('0x7')](function(_0x4c6b5c){if(_0x4c6b5c['error']){if(_0x4c6b5c[_0x76f4('0x8')][_0x76f4('0x9')]===0x1f4){return _0x25656d(_0x4c6b5c['error']['message']);}return _0x1a3172(_0x4c6b5c[_0x76f4('0x8')][_0x76f4('0xa')]);}else{_0x1a3172(_0x4c6b5c[_0x76f4('0xb')]);}})[_0x76f4('0xc')](function(_0x1aee7f){_0x25656d(_0x1aee7f);});});}function respondWithResult(_0xafd21e,_0xf7e347){_0xf7e347=_0xf7e347||0xc8;return function(_0x3ec740){if(_0x3ec740){return _0xafd21e[_0x76f4('0xd')](_0xf7e347)['json'](_0x3ec740);}return _0xafd21e[_0x76f4('0xe')](0x194);};}function handleError(_0x30dabf,_0x5da1ff){_0x5da1ff=_0x5da1ff||0x1f4;return function(_0x4b6021){logger['error'](_0x4b6021[_0x76f4('0xf')]);if(_0x4b6021[_0x76f4('0x10')]){delete _0x4b6021[_0x76f4('0x10')];}_0x30dabf[_0x76f4('0xd')](_0x5da1ff)[_0x76f4('0x11')](_0x4b6021);};}function findById(_0x2b5e23){return function(_0x46ba51){if(!_[_0x76f4('0x12')](_0x2b5e23)&&!_[_0x76f4('0x12')](_0x46ba51)&&!_[_0x76f4('0x12')](_0x46ba51[_0x76f4('0x13')])){return _[_0x76f4('0x14')](_0x46ba51[_0x76f4('0x13')],function(_0x38450e){return _0x38450e['id']==_0x2b5e23;});}return null;};}exports[_0x76f4('0x15')]=function(_0x397360,_0xfedbe4){return respondWithRpcPromise(_0x76f4('0x16'),_0x397360[_0x76f4('0x17')])[_0x76f4('0x7')](respondWithResult(_0xfedbe4,null))[_0x76f4('0xc')](handleError(_0xfedbe4,null));};exports[_0x76f4('0x18')]=function(_0x5bf3d5,_0x262937){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0x76f4('0x19')](_0x5bf3d5[_0x76f4('0x17')],_0x5bf3d5[_0x76f4('0x1a')]))['then'](respondWithResult(_0x262937,null))['catch'](handleError(_0x262937,null));};exports['voiceChannelStopMixMonitor']=function(_0x465240,_0x681d67){return respondWithRpcPromise(_0x76f4('0x1b'),_[_0x76f4('0x19')](_0x465240[_0x76f4('0x17')],_0x465240[_0x76f4('0x1a')]))[_0x76f4('0x7')](respondWithResult(_0x681d67,null))['catch'](handleError(_0x681d67,null));};exports['voiceQueues']=function(_0x3794fa,_0x497913){return respondWithRpcPromise(_0x76f4('0x1c'),_0x3794fa['query'])['then'](respondWithResult(_0x497913,null))['catch'](handleError(_0x497913,null));};exports[_0x76f4('0x1d')]=function(_0x38300d,_0xd368a2){return respondWithRpcPromise(_0x76f4('0x1c'),_0x38300d[_0x76f4('0x17')])[_0x76f4('0x7')](findById(_0x38300d['params']['id']))[_0x76f4('0x7')](respondWithResult(_0xd368a2,null))['catch'](handleError(_0xd368a2,null));};exports['updateVoiceQueue']=function(_0x5b3f07,_0x10ddb4){return respondWithRpcPromise(_0x76f4('0x1e'),_[_0x76f4('0x19')](_0x5b3f07[_0x76f4('0x1f')],_0x5b3f07['params']))[_0x76f4('0x7')](respondWithResult(_0x10ddb4,null))['catch'](handleError(_0x10ddb4,null));};exports[_0x76f4('0x20')]=function(_0x3c7513,_0x43ac4a){return respondWithRpcPromise(_0x76f4('0x21'),_[_0x76f4('0x19')](_0x3c7513['query'],_0x3c7513['params']))[_0x76f4('0x7')](respondWithResult(_0x43ac4a,null))[_0x76f4('0xc')](handleError(_0x43ac4a,null));};exports[_0x76f4('0x22')]=function(_0x281db6,_0x1f2adf){return respondWithRpcPromise(_0x76f4('0x23'),_0x281db6[_0x76f4('0x17')])[_0x76f4('0x7')](respondWithResult(_0x1f2adf,null))[_0x76f4('0xc')](handleError(_0x1f2adf,null));};exports[_0x76f4('0x24')]=function(_0x308af2,_0x2527a6){return respondWithRpcPromise('VoiceQueuesChannel',_['merge'](_0x308af2['query'],_0x308af2['params']))[_0x76f4('0x7')](respondWithResult(_0x2527a6,null))[_0x76f4('0xc')](handleError(_0x2527a6,null));};exports[_0x76f4('0x25')]=function(_0x456b1f,_0x26fdd6){return respondWithRpcPromise('VoiceQueuesChannelHangup',_[_0x76f4('0x19')](_0x456b1f[_0x76f4('0x17')],_0x456b1f[_0x76f4('0x1a')]))[_0x76f4('0x7')](respondWithResult(_0x26fdd6,null))[_0x76f4('0xc')](handleError(_0x26fdd6,null));};exports[_0x76f4('0x26')]=function(_0xb806cc,_0x28d9d6){return respondWithRpcPromise(_0x76f4('0x27'),_[_0x76f4('0x19')](_0xb806cc[_0x76f4('0x17')],_0xb806cc[_0x76f4('0x1a')]))[_0x76f4('0x7')](respondWithResult(_0x28d9d6,null))[_0x76f4('0xc')](handleError(_0x28d9d6,null));};exports[_0x76f4('0x28')]=function(_0x88506b,_0x3308e3){return respondWithRpcPromise(_0x76f4('0x29'),_0x88506b['query'])[_0x76f4('0x7')](respondWithResult(_0x3308e3,null))[_0x76f4('0xc')](handleError(_0x3308e3,null));};exports[_0x76f4('0x2a')]=function(_0x589637,_0x597e83){return respondWithRpcPromise(_0x76f4('0x2b'),_0x589637['query'])[_0x76f4('0x7')](respondWithResult(_0x597e83,null))['catch'](handleError(_0x597e83,null));};exports[_0x76f4('0x2c')]=function(_0x16f36d,_0x312243){var _0x378675;return respondWithRpcPromise(_0x76f4('0x2d'),_0x16f36d[_0x76f4('0x17')])[_0x76f4('0x7')](function(_0x109ad9){_0x378675=_0x109ad9;return respondWithRpcPromise(_0x76f4('0x2d'),_0x16f36d[_0x76f4('0x17')],routingClient);})['then'](function(_0x5b8d2d){return _[_0x76f4('0x19')]({},_0x5b8d2d,_0x378675);})[_0x76f4('0x7')](respondWithResult(_0x312243,null))[_0x76f4('0xc')](handleError(_0x312243,null));};exports[_0x76f4('0x2e')]=function(_0x2b7dc8,_0x2d6068){if(_0x2b7dc8[_0x76f4('0x1f')]&&_0x2b7dc8[_0x76f4('0x1f')][_0x76f4('0x2f')]&&_0x2b7dc8['user']&&_0x2b7dc8[_0x76f4('0x30')][_0x76f4('0x10')]){for(var _0x4f0d1a in _0x2b7dc8['body'][_0x76f4('0x2f')]){if(_0x2b7dc8[_0x76f4('0x1f')][_0x76f4('0x2f')][_0x76f4('0x31')](_0x4f0d1a)){db[_0x76f4('0x32')]['findAll']({'where':{'channel':_0x4f0d1a,'membername':_0x2b7dc8[_0x76f4('0x30')][_0x76f4('0x10')],'type':_0x76f4('0x33'),'exitAt':null,'uniqueid':_0x2b7dc8[_0x76f4('0x1f')][_0x76f4('0x2f')][_0x4f0d1a]&&_0x2b7dc8[_0x76f4('0x1f')]['interaction'][_0x4f0d1a][_0x76f4('0x34')]?{'$notIn':_0x2b7dc8[_0x76f4('0x1f')][_0x76f4('0x2f')][_0x4f0d1a]}:{'$ne':null}}})['then'](function(_0x571261){var _0x11ea58=moment()[_0x76f4('0x35')](_0x76f4('0x36'));for(var _0x2bea6d=0x0,_0x36fa03=_0x571261['length'];_0x2bea6d<_0x36fa03;_0x2bea6d+=0x1){_0x571261[_0x2bea6d]['updateAttributes']({'exitAt':_0x11ea58});}});for(var _0x8e5b60=0x0;_0x8e5b60<_0x2b7dc8['body'][_0x76f4('0x2f')][_0x4f0d1a][_0x76f4('0x34')];_0x8e5b60+=0x1){db['MemberReport']['findOrCreate']({'where':{'channel':_0x4f0d1a,'membername':_0x2b7dc8[_0x76f4('0x30')][_0x76f4('0x10')],'type':_0x76f4('0x33'),'uniqueid':_0x2b7dc8[_0x76f4('0x1f')]['interaction'][_0x4f0d1a][_0x8e5b60],'exitAt':null},'defaults':{'channel':_0x4f0d1a,'membername':_0x2b7dc8[_0x76f4('0x30')][_0x76f4('0x10')],'interface':_[_0x76f4('0x12')](_0x2b7dc8['user'][_0x76f4('0x37')])?util[_0x76f4('0x35')]('SIP/%s',_0x2b7dc8['user'][_0x76f4('0x10')]):_0x2b7dc8[_0x76f4('0x30')][_0x76f4('0x37')],'type':_0x76f4('0x33'),'enterAt':moment()[_0x76f4('0x35')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x76f4('0x38'),'internal':_0x2b7dc8['user'][_0x76f4('0x39')],'uniqueid':_0x2b7dc8[_0x76f4('0x1f')][_0x76f4('0x2f')][_0x4f0d1a][_0x8e5b60]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x2b7dc8[_0x76f4('0x1a')]['id'],'capacity':_0x2b7dc8[_0x76f4('0x1f')]['capacity']},routingClient)[_0x76f4('0x7')](respondWithResult(_0x2d6068,null))[_0x76f4('0xc')](handleError(_0x2d6068,null));};exports[_0x76f4('0x3a')]=function(_0x1c658c,_0x40ff20){return respondWithRpcPromise('Telephones',_0x1c658c[_0x76f4('0x17')])['then'](respondWithResult(_0x40ff20,null))[_0x76f4('0xc')](handleError(_0x40ff20,null));};exports[_0x76f4('0x3b')]=function(_0x154ba,_0x5121ec){return respondWithRpcPromise(_0x76f4('0x3c'),_0x154ba[_0x76f4('0x17')])[_0x76f4('0x7')](respondWithResult(_0x5121ec,null))[_0x76f4('0xc')](handleError(_0x5121ec,null));};exports['campaigns']=function(_0x2028e9,_0xf11e07){return respondWithRpcPromise(_0x76f4('0x3d'),_0x2028e9[_0x76f4('0x17')])['then'](respondWithResult(_0xf11e07,null))[_0x76f4('0xc')](handleError(_0xf11e07,null));};exports['chatQueues']=function(_0x129048,_0x190c8d){return respondWithRpcPromise('ChatQueues',_0x129048['query'],routingClient)[_0x76f4('0x7')](respondWithResult(_0x190c8d,null))[_0x76f4('0xc')](handleError(_0x190c8d,null));};exports[_0x76f4('0x3e')]=function(_0x596b51,_0x27ba06){return respondWithRpcPromise(_0x76f4('0x3f'),_0x596b51[_0x76f4('0x17')],routingClient)['then'](findById(_0x596b51['params']['id']))[_0x76f4('0x7')](respondWithResult(_0x27ba06,null))[_0x76f4('0xc')](handleError(_0x27ba06,null));};exports['mailQueues']=function(_0x490ced,_0x3f1840){return respondWithRpcPromise(_0x76f4('0x40'),_0x490ced[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x3f1840,null))[_0x76f4('0xc')](handleError(_0x3f1840,null));};exports[_0x76f4('0x41')]=function(_0x97be11,_0x36a52a){return respondWithRpcPromise(_0x76f4('0x40'),_0x97be11['query'],routingClient)['then'](findById(_0x97be11['params']['id']))[_0x76f4('0x7')](respondWithResult(_0x36a52a,null))[_0x76f4('0xc')](handleError(_0x36a52a,null));};exports[_0x76f4('0x42')]=function(_0x3b6c16,_0x4c9d64){return respondWithRpcPromise('MailAccounts',_0x3b6c16[_0x76f4('0x17')],mailClient)['then'](respondWithResult(_0x4c9d64,null))[_0x76f4('0xc')](handleError(_0x4c9d64,null));};exports['openchannelQueues']=function(_0x4285dd,_0x25e510){return respondWithRpcPromise(_0x76f4('0x43'),_0x4285dd[_0x76f4('0x17')],routingClient)['then'](respondWithResult(_0x25e510,null))[_0x76f4('0xc')](handleError(_0x25e510,null));};exports[_0x76f4('0x44')]=function(_0x22a0cc,_0x40c170){return respondWithRpcPromise(_0x76f4('0x43'),_0x22a0cc[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](findById(_0x22a0cc['params']['id']))[_0x76f4('0x7')](respondWithResult(_0x40c170,null))[_0x76f4('0xc')](handleError(_0x40c170,null));};exports[_0x76f4('0x45')]=function(_0x320a87,_0x28cf4c){return respondWithRpcPromise(_0x76f4('0x46'),_0x320a87[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x28cf4c,null))['catch'](handleError(_0x28cf4c,null));};exports['showSmsQueues']=function(_0xa3091a,_0x617924){return respondWithRpcPromise(_0x76f4('0x46'),_0xa3091a['query'],routingClient)[_0x76f4('0x7')](findById(_0xa3091a['params']['id']))[_0x76f4('0x7')](respondWithResult(_0x617924,null))[_0x76f4('0xc')](handleError(_0x617924,null));};exports['whatsappQueues']=function(_0xda0ac2,_0x37b7f7){return respondWithRpcPromise(_0x76f4('0x47'),_0xda0ac2[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x37b7f7,null))[_0x76f4('0xc')](handleError(_0x37b7f7,null));};exports[_0x76f4('0x48')]=function(_0x410d83,_0x1f7257){return respondWithRpcPromise('WhatsappQueues',_0x410d83[_0x76f4('0x17')],routingClient)['then'](findById(_0x410d83[_0x76f4('0x1a')]['id']))[_0x76f4('0x7')](respondWithResult(_0x1f7257,null))[_0x76f4('0xc')](handleError(_0x1f7257,null));};exports[_0x76f4('0x49')]=function(_0xfbb52c,_0x8de630){return respondWithRpcPromise(_0x76f4('0x4a'),_0xfbb52c[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x8de630,null))[_0x76f4('0xc')](handleError(_0x8de630,null));};exports['showFaxQueues']=function(_0x30f3de,_0x6f874d){return respondWithRpcPromise('FaxQueues',_0x30f3de[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](findById(_0x30f3de[_0x76f4('0x1a')]['id']))['then'](respondWithResult(_0x6f874d,null))[_0x76f4('0xc')](handleError(_0x6f874d,null));};exports[_0x76f4('0x4b')]=function(_0x3e829f,_0x52610a){return respondWithRpcPromise(_0x76f4('0x4c'),_0x3e829f[_0x76f4('0x17')])[_0x76f4('0x7')](respondWithResult(_0x52610a,null))[_0x76f4('0xc')](handleError(_0x52610a,null));};exports[_0x76f4('0x4d')]=function(_0x10ee07,_0x19b99c){return respondWithRpcPromise(_0x76f4('0x4e'),_0x10ee07[_0x76f4('0x17')],routingClient)['then'](respondWithResult(_0x19b99c,null))[_0x76f4('0xc')](handleError(_0x19b99c,null));};exports[_0x76f4('0x4f')]=function(_0x19fdc3,_0x39c9af){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x19fdc3[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x39c9af,null))[_0x76f4('0xc')](handleError(_0x39c9af,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x43b44d,_0x1375d5){return respondWithRpcPromise(_0x76f4('0x50'),_0x43b44d[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x1375d5,null))['catch'](handleError(_0x1375d5,null));};exports[_0x76f4('0x51')]=function(_0x4dd41f,_0x2b8467){return respondWithRpcPromise(_0x76f4('0x50'),_0x4dd41f['query'],routingClient)['then'](function(_0x58251e){if(_0x4dd41f[_0x76f4('0x17')][_0x76f4('0x52')]!==undefined){var _0x1e7b6=_(_0x58251e[_0x76f4('0x13')])[_0x76f4('0x53')]([_0x4dd41f[_0x76f4('0x17')]['type'],_0x4dd41f[_0x76f4('0x1a')]['id']])[_0x76f4('0x54')](_0x76f4('0x55'))[_0x76f4('0x56')]()[_0x76f4('0x57')]();return _0x58251e[_0x76f4('0x13')][_0x76f4('0x53')](function(_0x202fc8){return _0x1e7b6['indexOf'](_0x202fc8[_0x76f4('0x55')])>-0x1;});}else{return _0x58251e['rows'][_0x76f4('0x53')](function(_0x30358a){return _0x30358a[_0x76f4('0x55')]===parseInt(_0x4dd41f[_0x76f4('0x1a')]['id']);});}})[_0x76f4('0x7')](respondWithResult(_0x2b8467,null))[_0x76f4('0xc')](handleError(_0x2b8467,null));};exports[_0x76f4('0x58')]=function(_0x2a0491,_0x54729b){return respondWithRpcPromise(_0x76f4('0x59'),_0x2a0491['query'],routingClient)['then'](respondWithResult(_0x54729b,null))['catch'](handleError(_0x54729b,null));};exports[_0x76f4('0x5a')]=function(_0x402209,_0x279040){return respondWithRpcPromise(_0x76f4('0x5b'),_0x402209['query'],routingClient)[_0x76f4('0x7')](respondWithResult(_0x279040,null))[_0x76f4('0xc')](handleError(_0x279040,null));};exports[_0x76f4('0x5c')]=function(_0x5f5c24,_0x12f16e){return respondWithRpcPromise(_0x76f4('0x5d'),_0x5f5c24[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x12f16e,null))[_0x76f4('0xc')](handleError(_0x12f16e,null));};exports[_0x76f4('0x5e')]=function(_0x3b5e15){return function(_0x4b562c,_0x2e991e){var _0xa49e2a,_0x4c7307;var _0x3bc914=_[_0x76f4('0x5f')](_0x3b5e15);var _0x5e6393=_0x3b5e15===_0x76f4('0x60')?_0x76f4('0x61'):_0x76f4('0x62');return db[_0x3bc914+_0x76f4('0x63')][_0x76f4('0x64')]({'raw':!![],'where':{'id':_0x4b562c[_0x76f4('0x1a')]['id']}})['then'](function(_0x2dac86){if(_[_0x76f4('0x12')](_0x2dac86)){throw new Error(_0x3bc914+_0x76f4('0x65'));}_0xa49e2a=_0x2dac86;return db[_0x3bc914+_0x76f4('0x66')]['findOne']({'where':{'id':_0x4b562c[_0x76f4('0x1f')]['messageId']},'include':[{'model':db[_0x3bc914+_0x76f4('0x67')],'as':'Interaction'},{'model':db[_0x3bc914+_0x5e6393],'as':_0x76f4('0x62')}]});})[_0x76f4('0x7')](function(_0x59e9ed){if(_['isNil'](_0x59e9ed)){throw new Error(_0x3bc914+_0x76f4('0x68'));}_0x4c7307=_0x59e9ed;return _0x59e9ed[_0x76f4('0x69')]({'read':0x0,'readAt':null,'UserId':null});})[_0x76f4('0x7')](function(){var _0x4a2969={'uniqueid':_0x3b5e15+'.'+_0x4c7307['id']+'.'+_0x4c7307['Interaction']['id'],'FromUserId':_0x4b562c[_0x76f4('0x30')]['id'],'type':_0x76f4('0x6a')};_0x4a2969[_0x3bc914+_0x76f4('0x6b')]=_0x4c7307['id'];_0x4a2969[_0x3bc914+_0x76f4('0x6c')]=_0x4c7307[_0x76f4('0x67')]['id'];_0x4a2969[_0x76f4('0x6d')+_0x3bc914+_0x5e6393+'Id']=_0x4c7307[_0x76f4('0x62')]['id'];_0x4a2969['To'+_0x3bc914+_0x76f4('0x6e')]=_0xa49e2a['id'];return db[_0x3bc914+'TransferReport']['create'](_0x4a2969);})[_0x76f4('0x7')](function(){return respondWithRpcPromise(_0x76f4('0x6f'),{'channel':_0x3b5e15,'interaction':_0x4c7307[_0x76f4('0x67')],'message':_0x4c7307,'account':_0x4c7307['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0x76f4('0x6a'),'appdata':_0xa49e2a[_0x76f4('0x10')]+','+(_0x4c7307[_0x76f4('0x62')][_0x76f4('0x70')]||0x12c),'interval':_0x76f4('0x71')}]},routingClient);})[_0x76f4('0x7')](respondWithResult(_0x2e991e,null))[_0x76f4('0xc')](handleError(_0x2e991e,null));};};exports['agentNotify']=function(_0x13cf2a,_0x316f86){var _0x3e537b,_0x53252e;if(_[_0x76f4('0x12')](_0x13cf2a[_0x76f4('0x1f')][_0x76f4('0x72')])){throw new Error(_0x76f4('0x73'));}var _0x5080a9=_0x13cf2a[_0x76f4('0x1f')]['channel'];var _0xc80d4c=_['capitalize'](_0x5080a9);var _0x238df3=_0x5080a9===_0x76f4('0x60')?_0x76f4('0x61'):'Account';return db[_0x76f4('0x74')][_0x76f4('0x64')]({'raw':!![],'where':{'id':_0x13cf2a[_0x76f4('0x1a')]['id'],'role':'agent'}})[_0x76f4('0x7')](function(_0x460867){if(_['isNil'](_0x460867)){throw new Error('Agent\x20not\x20found');}_0x3e537b=_0x460867;return db[_0xc80d4c+_0x76f4('0x66')][_0x76f4('0x64')]({'where':{'id':_0x13cf2a['body']['messageId']},'include':[{'model':db[_0xc80d4c+_0x76f4('0x67')],'as':_0x76f4('0x67')},{'model':db[_0xc80d4c+_0x238df3],'as':'Account'}]});})[_0x76f4('0x7')](function(_0x54ae6c){if(_['isNil'](_0x54ae6c)){throw new Error(_0xc80d4c+'\x20Message\x20not\x20found');}_0x53252e=_0x54ae6c;return _0x54ae6c[_0x76f4('0x69')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x59265d={'uniqueid':_0x5080a9+'.'+_0x53252e['id']+'.'+_0x53252e[_0x76f4('0x67')]['id'],'FromUserId':_0x13cf2a['user']['id'],'type':'queue','ToUserId':_0x3e537b['id']};_0x59265d[_0xc80d4c+_0x76f4('0x6b')]=_0x53252e['id'];_0x59265d[_0xc80d4c+'InteractionId']=_0x53252e[_0x76f4('0x67')]['id'];_0x59265d[_0x76f4('0x6d')+_0xc80d4c+_0x238df3+'Id']=_0x53252e['Account']['id'];return db[_0xc80d4c+'TransferReport'][_0x76f4('0x75')](_0x59265d);})[_0x76f4('0x7')](function(){return respondWithRpcPromise(_0x76f4('0x6f'),{'channel':_0x5080a9,'interaction':_0x53252e['Interaction'],'message':_0x53252e,'account':_0x53252e[_0x76f4('0x62')],'applications':[{'id':0x0,'priority':0x1,'app':_0x76f4('0x38'),'appdata':_0x3e537b[_0x76f4('0x10')]+','+(_0x53252e[_0x76f4('0x62')]['agentTransferTimeout']||0x12c),'interval':_0x76f4('0x71')}]},routingClient);})[_0x76f4('0x7')](respondWithResult(_0x316f86,null))[_0x76f4('0xc')](handleError(_0x316f86,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 198299c..504237a 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 _0x0457=['fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/:id','show','/:id/run','isAuthenticated','run','post','create','delete','destroy','multer','path','connect-timeout'];(function(_0x310a1b,_0x4c9129){var _0xdea206=function(_0x1f1e8d){while(--_0x1f1e8d){_0x310a1b['push'](_0x310a1b['shift']());}};_0xdea206(++_0x4c9129);}(_0x0457,0x195));var _0x7045=function(_0x4ed32d,_0x327695){_0x4ed32d=_0x4ed32d-0x0;var _0xf624df=_0x0457[_0x4ed32d];return _0xf624df;};'use strict';var multer=require(_0x7045('0x0'));var util=require('util');var path=require(_0x7045('0x1'));var timeout=require(_0x7045('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7045('0x3'));var auth=require(_0x7045('0x4'));var interaction=require(_0x7045('0x5'));var config=require('../../config/environment');var controller=require('./schedule.controller');router[_0x7045('0x6')]('/',auth['isAuthenticated'](),controller[_0x7045('0x7')]);router['get'](_0x7045('0x8'),auth['isAuthenticated'](),controller[_0x7045('0x9')]);router[_0x7045('0x6')](_0x7045('0xa'),auth[_0x7045('0xb')](),controller[_0x7045('0xc')]);router[_0x7045('0xd')]('/',auth[_0x7045('0xb')](),controller[_0x7045('0xe')]);router['put'](_0x7045('0x8'),auth[_0x7045('0xb')](),controller['update']);router[_0x7045('0xf')](_0x7045('0x8'),auth[_0x7045('0xb')](),controller[_0x7045('0x10')]);module['exports']=router; \ No newline at end of file +var _0x0634=['update','delete','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','show','/:id/run','run','post','create','put','/:id'];(function(_0x467a4f,_0x543b78){var _0xb4ce19=function(_0x4c7c2a){while(--_0x4c7c2a){_0x467a4f['push'](_0x467a4f['shift']());}};_0xb4ce19(++_0x543b78);}(_0x0634,0x144));var _0x4063=function(_0x5a3137,_0x23709f){_0x5a3137=_0x5a3137-0x0;var _0x1af665=_0x0634[_0x5a3137];return _0x1af665;};'use strict';var multer=require(_0x4063('0x0'));var util=require(_0x4063('0x1'));var path=require('path');var timeout=require(_0x4063('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x4063('0x3'));var auth=require(_0x4063('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4063('0x5'));var controller=require('./schedule.controller');router['get']('/',auth[_0x4063('0x6')](),controller[_0x4063('0x7')]);router[_0x4063('0x8')]('/:id',auth[_0x4063('0x6')](),controller[_0x4063('0x9')]);router['get'](_0x4063('0xa'),auth[_0x4063('0x6')](),controller[_0x4063('0xb')]);router[_0x4063('0xc')]('/',auth[_0x4063('0x6')](),controller[_0x4063('0xd')]);router[_0x4063('0xe')](_0x4063('0xf'),auth[_0x4063('0x6')](),controller[_0x4063('0x10')]);router[_0x4063('0x11')](_0x4063('0xf'),auth['isAuthenticated'](),controller[_0x4063('0x12')]);module[_0x4063('0x13')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index d6a8af0..7abb90b 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 _0xfc79=['years','months','weeks','hours','minutes','days','csv','pdf','xlsx','default','custom','TEXT','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM'];(function(_0x48c7fe,_0xf9fd9d){var _0x11b768=function(_0x7cf575){while(--_0x7cf575){_0x48c7fe['push'](_0x48c7fe['shift']());}};_0x11b768(++_0xf9fd9d);}(_0xfc79,0x150));var _0x9fc7=function(_0x43811d,_0x4243d3){_0x43811d=_0x43811d-0x0;var _0x31b6e5=_0xfc79[_0x43811d];return _0x31b6e5;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9fc7('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x9fc7('0x0')]},'active':{'type':Sequelize[_0x9fc7('0x1')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x9fc7('0x0')],'allowNull':![],'defaultValue':_0x9fc7('0x2')},'startAt':{'type':Sequelize[_0x9fc7('0x3')],'allowNull':![]},'endAt':{'type':Sequelize[_0x9fc7('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x9fc7('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x9fc7('0x5')](_0x9fc7('0x6'),'quarters',_0x9fc7('0x7'),_0x9fc7('0x8'),'days',_0x9fc7('0x9'),_0x9fc7('0xa')),'allowNull':![],'defaultValue':_0x9fc7('0xb')},'output':{'type':Sequelize[_0x9fc7('0x5')](_0x9fc7('0xc'),_0x9fc7('0xd'),_0x9fc7('0xe')),'allowNull':![],'defaultValue':_0x9fc7('0xc')},'type':{'type':Sequelize[_0x9fc7('0x5')]('custom',_0x9fc7('0xf')),'allowNull':![],'defaultValue':_0x9fc7('0x10')},'sendMail':{'type':Sequelize[_0x9fc7('0x1')],'defaultValue':![]},'email':{'type':Sequelize[_0x9fc7('0x0')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0x9fc7('0x11')]},'sendIfEmpty':{'type':Sequelize[_0x9fc7('0x1')],'defaultValue':!![]}}; \ No newline at end of file +var _0x5d8e=['quarters','minutes','days','csv','pdf','xlsx','custom','default','TEXT','sequelize','exports','STRING','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years'];(function(_0x106204,_0x5cf2a3){var _0x9be083=function(_0x377485){while(--_0x377485){_0x106204['push'](_0x106204['shift']());}};_0x9be083(++_0x5cf2a3);}(_0x5d8e,0x12a));var _0xe5d8=function(_0x58e3bc,_0x41a387){_0x58e3bc=_0x58e3bc-0x0;var _0x3fc974=_0x5d8e[_0x58e3bc];return _0x3fc974;};'use strict';var Sequelize=require(_0xe5d8('0x0'));module[_0xe5d8('0x1')]={'name':{'type':Sequelize[_0xe5d8('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xe5d8('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xe5d8('0x2')],'allowNull':![],'defaultValue':_0xe5d8('0x3')},'startAt':{'type':Sequelize[_0xe5d8('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0xe5d8('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xe5d8('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xe5d8('0x6')](_0xe5d8('0x7'),_0xe5d8('0x8'),'months','weeks','days','hours',_0xe5d8('0x9')),'allowNull':![],'defaultValue':_0xe5d8('0xa')},'output':{'type':Sequelize['ENUM'](_0xe5d8('0xb'),_0xe5d8('0xc'),_0xe5d8('0xd')),'allowNull':![],'defaultValue':_0xe5d8('0xb')},'type':{'type':Sequelize[_0xe5d8('0x6')](_0xe5d8('0xe'),_0xe5d8('0xf')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0xe5d8('0x2')]},'cc':{'type':Sequelize[_0xe5d8('0x10')]},'bcc':{'type':Sequelize[_0xe5d8('0x10')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 07963f5..a497059 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 _0x2fa0=['limit','count','set','Content-Range','apply','save','update','then','destroy','get','Scheduler','UserProfileResource','end','stack','name','send','Schedule','rawAttributes','fieldName','key','model','map','keys','query','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined'];(function(_0x5df8eb,_0x580d4d){var _0xe1de05=function(_0x3735ef){while(--_0x3735ef){_0x5df8eb['push'](_0x5df8eb['shift']());}};_0xe1de05(++_0x580d4d);}(_0x2fa0,0x17f));var _0x02fa=function(_0x433298,_0x118456){_0x433298=_0x433298-0x0;var _0x5d0c18=_0x2fa0[_0x433298];return _0x5d0c18;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x02fa('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x02fa('0x1'));var moment=require(_0x02fa('0x2'));var BPromise=require(_0x02fa('0x3'));var Mustache=require(_0x02fa('0x4'));var util=require(_0x02fa('0x5'));var path=require(_0x02fa('0x6'));var sox=require(_0x02fa('0x7'));var csv=require(_0x02fa('0x8'));var ejs=require(_0x02fa('0x9'));var fs=require('fs');var fs_extra=require(_0x02fa('0xa'));var _=require('lodash');var squel=require(_0x02fa('0xb'));var crypto=require(_0x02fa('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x02fa('0xd'));var toCsv=require(_0x02fa('0x8'));var querystring=require(_0x02fa('0xe'));var Papa=require('papaparse');var Redis=require(_0x02fa('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x02fa('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x02fa('0x11'));var logger=require('../../config/logger')(_0x02fa('0x12'));var utils=require(_0x02fa('0x13'));var config=require(_0x02fa('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x02fa('0x15'))['db'];function respondWithStatusCode(_0x356c4c,_0x55a0fc){_0x55a0fc=_0x55a0fc||0xcc;return function(_0x4e8ac5){if(_0x4e8ac5){return _0x356c4c[_0x02fa('0x16')](_0x55a0fc);}return _0x356c4c[_0x02fa('0x17')](_0x55a0fc)['end']();};}function respondWithResult(_0x4abcf5,_0x3a1a1e){_0x3a1a1e=_0x3a1a1e||0xc8;return function(_0x2ce8c8){if(_0x2ce8c8){return _0x4abcf5[_0x02fa('0x17')](_0x3a1a1e)[_0x02fa('0x18')](_0x2ce8c8);}};}function respondWithFilteredResult(_0xba8c41,_0x3868ab){return function(_0x4ba54b){if(_0x4ba54b){var _0x1c43b9=typeof _0x3868ab[_0x02fa('0x19')]===_0x02fa('0x1a')&&typeof _0x3868ab[_0x02fa('0x1b')]===_0x02fa('0x1a');var _0x53ce57=_0x4ba54b[_0x02fa('0x1c')];var _0x3f3562=_0x1c43b9?0x0:_0x3868ab[_0x02fa('0x19')];var _0x3fc34c=_0x1c43b9?_0x4ba54b[_0x02fa('0x1c')]:_0x3868ab[_0x02fa('0x19')]+_0x3868ab[_0x02fa('0x1b')];var _0x486867;if(_0x3fc34c>=_0x53ce57){_0x3fc34c=_0x53ce57;_0x486867=0xc8;}else{_0x486867=0xce;}_0xba8c41[_0x02fa('0x17')](_0x486867);return _0xba8c41[_0x02fa('0x1d')](_0x02fa('0x1e'),_0x3f3562+'-'+_0x3fc34c+'/'+_0x53ce57)[_0x02fa('0x18')](_0x4ba54b);}return null;};}function patchUpdates(_0x1f24fb){return function(_0x20a85b){try{jsonpatch[_0x02fa('0x1f')](_0x20a85b,_0x1f24fb,!![]);}catch(_0x3d413e){return BPromise['reject'](_0x3d413e);}return _0x20a85b[_0x02fa('0x20')]();};}function saveUpdates(_0x485463,_0x33bc36){return function(_0xfdf8e7){if(_0xfdf8e7){return _0xfdf8e7[_0x02fa('0x21')](_0x485463)[_0x02fa('0x22')](function(_0x55a6cc){return _0x55a6cc;});}return null;};}function removeEntity(_0x4087a1,_0x38007a){return function(_0x7c8817){if(_0x7c8817){return _0x7c8817[_0x02fa('0x23')]()[_0x02fa('0x22')](function(){var _0x42bce2=_0x7c8817[_0x02fa('0x24')]({'plain':!![]});var _0xd6414e=_0x02fa('0x25');return db[_0x02fa('0x26')][_0x02fa('0x23')]({'where':{'type':_0xd6414e,'resourceId':_0x42bce2['id']}})[_0x02fa('0x22')](function(){return _0x7c8817;});})['then'](function(){_0x4087a1[_0x02fa('0x17')](0xcc)[_0x02fa('0x27')]();});}};}function handleEntityNotFound(_0x5f199c,_0x1cf625){return function(_0x4d40b6){if(!_0x4d40b6){_0x5f199c[_0x02fa('0x16')](0x194);}return _0x4d40b6;};}function handleError(_0x51bf49,_0x19d4bc){_0x19d4bc=_0x19d4bc||0x1f4;return function(_0x490eda){logger['error'](_0x490eda[_0x02fa('0x28')]);if(_0x490eda[_0x02fa('0x29')]){delete _0x490eda[_0x02fa('0x29')];}_0x51bf49[_0x02fa('0x17')](_0x19d4bc)[_0x02fa('0x2a')](_0x490eda);};}exports['index']=function(_0x1275d7,_0x5604b2){var _0x303d19={},_0x83f380={},_0x31d7c6={'count':0x0,'rows':[]};var _0x195990=_['map'](db[_0x02fa('0x2b')][_0x02fa('0x2c')],function(_0x504d31){return{'name':_0x504d31[_0x02fa('0x2d')],'type':_0x504d31['type'][_0x02fa('0x2e')]};});_0x83f380[_0x02fa('0x2f')]=_[_0x02fa('0x30')](_0x195990,'name');_0x83f380['query']=_[_0x02fa('0x31')](_0x1275d7[_0x02fa('0x32')]);_0x83f380[_0x02fa('0x33')]=_['intersection'](_0x83f380[_0x02fa('0x2f')],_0x83f380[_0x02fa('0x32')]);_0x303d19[_0x02fa('0x34')]=_[_0x02fa('0x35')](_0x83f380[_0x02fa('0x2f')],qs['fields'](_0x1275d7[_0x02fa('0x32')][_0x02fa('0x36')]));_0x303d19['attributes']=_0x303d19[_0x02fa('0x34')]['length']?_0x303d19[_0x02fa('0x34')]:_0x83f380[_0x02fa('0x2f')];if(!_0x1275d7[_0x02fa('0x32')][_0x02fa('0x37')]('nolimit')){_0x303d19[_0x02fa('0x1b')]=qs[_0x02fa('0x1b')](_0x1275d7[_0x02fa('0x32')]['limit']);_0x303d19[_0x02fa('0x19')]=qs['offset'](_0x1275d7[_0x02fa('0x32')]['offset']);}_0x303d19[_0x02fa('0x38')]=qs[_0x02fa('0x39')](_0x1275d7['query'][_0x02fa('0x39')]);_0x303d19[_0x02fa('0x3a')]=qs['filters'](_[_0x02fa('0x3b')](_0x1275d7[_0x02fa('0x32')],_0x83f380[_0x02fa('0x33')]),_0x195990);if(_0x1275d7[_0x02fa('0x32')][_0x02fa('0x3c')]){_0x303d19[_0x02fa('0x3a')]=_[_0x02fa('0x3d')](_0x303d19['where'],{'$or':_[_0x02fa('0x30')](_0x195990,function(_0x3c5c0b){if(_0x3c5c0b[_0x02fa('0x3e')]!==_0x02fa('0x3f')){var _0x507d4e={};_0x507d4e[_0x3c5c0b[_0x02fa('0x29')]]={'$like':'%'+_0x1275d7[_0x02fa('0x32')]['filter']+'%'};return _0x507d4e;}})});}_0x303d19=_['merge']({},_0x303d19,_0x1275d7[_0x02fa('0x40')]);var _0x217d11={'where':_0x303d19[_0x02fa('0x3a')]};return db[_0x02fa('0x2b')]['count'](_0x217d11)['then'](function(_0x429538){_0x31d7c6[_0x02fa('0x1c')]=_0x429538;if(_0x1275d7['query'][_0x02fa('0x41')]){_0x303d19[_0x02fa('0x42')]=[{'all':!![]}];}return db[_0x02fa('0x2b')]['findAll'](_0x303d19);})[_0x02fa('0x22')](function(_0x36946a){_0x31d7c6[_0x02fa('0x43')]=_0x36946a;return _0x31d7c6;})[_0x02fa('0x22')](respondWithFilteredResult(_0x5604b2,_0x303d19))[_0x02fa('0x44')](handleError(_0x5604b2,null));};exports[_0x02fa('0x45')]=function(_0x55f724,_0x439936){var _0x4e0dc3={'raw':![],'where':{'id':_0x55f724[_0x02fa('0x46')]['id']}},_0xf7f2c1={};_0xf7f2c1[_0x02fa('0x2f')]=_[_0x02fa('0x31')](db[_0x02fa('0x2b')][_0x02fa('0x2c')]);_0xf7f2c1['query']=_['keys'](_0x55f724[_0x02fa('0x32')]);_0xf7f2c1[_0x02fa('0x33')]=_[_0x02fa('0x35')](_0xf7f2c1[_0x02fa('0x2f')],_0xf7f2c1[_0x02fa('0x32')]);_0x4e0dc3[_0x02fa('0x34')]=_['intersection'](_0xf7f2c1['model'],qs[_0x02fa('0x36')](_0x55f724[_0x02fa('0x32')][_0x02fa('0x36')]));_0x4e0dc3[_0x02fa('0x34')]=_0x4e0dc3[_0x02fa('0x34')]['length']?_0x4e0dc3['attributes']:_0xf7f2c1[_0x02fa('0x2f')];if(_0x55f724[_0x02fa('0x32')][_0x02fa('0x41')]){_0x4e0dc3[_0x02fa('0x42')]=[{'all':!![]}];}_0x4e0dc3=_[_0x02fa('0x3d')]({},_0x4e0dc3,_0x55f724['options']);return db[_0x02fa('0x2b')][_0x02fa('0x47')](_0x4e0dc3)['then'](handleEntityNotFound(_0x439936,null))[_0x02fa('0x22')](respondWithResult(_0x439936,null))[_0x02fa('0x44')](handleError(_0x439936,null));};exports[_0x02fa('0x48')]=function(_0x51de2a,_0x56c74a){return db[_0x02fa('0x2b')][_0x02fa('0x48')](_0x51de2a[_0x02fa('0x49')],{})[_0x02fa('0x22')](function(_0x230a8b){var _0x3c2b6b=_0x51de2a['user']['get']({'plain':!![]});if(!_0x3c2b6b)throw new Error(_0x02fa('0x4a'));if(_0x3c2b6b[_0x02fa('0x4b')]===_0x02fa('0x4c')){var _0x3caeef=_0x230a8b[_0x02fa('0x24')]({'plain':!![]});var _0xd15ecd='Scheduler';return db['UserProfileSection'][_0x02fa('0x47')]({'where':{'name':_0xd15ecd,'userProfileId':_0x3c2b6b[_0x02fa('0x4d')]},'raw':!![]})[_0x02fa('0x22')](function(_0xc613c9){if(_0xc613c9&&_0xc613c9[_0x02fa('0x4e')]===0x0){return db[_0x02fa('0x26')][_0x02fa('0x48')]({'name':_0x3caeef[_0x02fa('0x29')],'resourceId':_0x3caeef['id'],'type':_0xc613c9[_0x02fa('0x29')],'sectionId':_0xc613c9['id']},{})[_0x02fa('0x22')](function(){return _0x230a8b;});}else{return _0x230a8b;}})[_0x02fa('0x44')](function(_0x4e7bb1){logger['error'](_0x02fa('0x4f'),_0x4e7bb1);throw _0x4e7bb1;});}return _0x230a8b;})[_0x02fa('0x22')](respondWithResult(_0x56c74a,0xc9))[_0x02fa('0x44')](handleError(_0x56c74a,null));};exports['update']=function(_0x475132,_0x26ea01){if(_0x475132[_0x02fa('0x49')]['id']){delete _0x475132[_0x02fa('0x49')]['id'];}return db[_0x02fa('0x2b')][_0x02fa('0x47')]({'where':{'id':_0x475132['params']['id']}})['then'](handleEntityNotFound(_0x26ea01,null))[_0x02fa('0x22')](saveUpdates(_0x475132[_0x02fa('0x49')],null))[_0x02fa('0x22')](respondWithResult(_0x26ea01,null))[_0x02fa('0x44')](handleError(_0x26ea01,null));};exports[_0x02fa('0x23')]=function(_0x3167a4,_0x2ba59e){return db[_0x02fa('0x2b')][_0x02fa('0x47')]({'where':{'id':_0x3167a4[_0x02fa('0x46')]['id']}})[_0x02fa('0x22')](handleEntityNotFound(_0x2ba59e,null))[_0x02fa('0x22')](removeEntity(_0x2ba59e,null))['catch'](handleError(_0x2ba59e,null));};exports[_0x02fa('0x50')]=function(_0x344032,_0x5805f4,_0x401603){var _0xa47b8=require(_0x02fa('0x51'));return db['Schedule']['find']({'where':{'id':_0x344032['params']['id']},'raw':!![]})[_0x02fa('0x22')](handleEntityNotFound(_0x5805f4,null))[_0x02fa('0x22')](function(){_0xa47b8[_0x02fa('0x50')](_0x344032[_0x02fa('0x46')]['id']);})['then'](respondWithStatusCode(_0x5805f4,null))['catch'](handleError(_0x5805f4,null));}; \ No newline at end of file +var _0xb714=['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','offset','limit','undefined','count','set','Content-Range','json','reject','save','update','then','get','Scheduler','UserProfileResource','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','Schedule','include','findAll','rows','catch','show','params','includeAll','find','create','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','run','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','fs-extra','lodash','squel','crypto'];(function(_0x106db6,_0xd6decc){var _0x4dc175=function(_0x14c433){while(--_0x14c433){_0x106db6['push'](_0x106db6['shift']());}};_0x4dc175(++_0xd6decc);}(_0xb714,0x1a7));var _0x4b71=function(_0x2f479d,_0x1d6836){_0x2f479d=_0x2f479d-0x0;var _0x300d48=_0xb714[_0x2f479d];return _0x300d48;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4b71('0x0'));var zipdir=require(_0x4b71('0x1'));var jsonpatch=require(_0x4b71('0x2'));var rp=require(_0x4b71('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4b71('0x4'));var path=require(_0x4b71('0x5'));var sox=require(_0x4b71('0x6'));var csv=require(_0x4b71('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4b71('0x8'));var _=require(_0x4b71('0x9'));var squel=require(_0x4b71('0xa'));var crypto=require(_0x4b71('0xb'));var jsforce=require(_0x4b71('0xc'));var deskjs=require(_0x4b71('0xd'));var toCsv=require(_0x4b71('0x7'));var querystring=require(_0x4b71('0xe'));var Papa=require(_0x4b71('0xf'));var Redis=require(_0x4b71('0x10'));var authService=require(_0x4b71('0x11'));var qs=require(_0x4b71('0x12'));var as=require(_0x4b71('0x13'));var hardwareService=require(_0x4b71('0x14'));var logger=require(_0x4b71('0x15'))(_0x4b71('0x16'));var utils=require(_0x4b71('0x17'));var config=require(_0x4b71('0x18'));var licenseUtil=require(_0x4b71('0x19'));var db=require(_0x4b71('0x1a'))['db'];function respondWithStatusCode(_0x2b8b36,_0x446d72){_0x446d72=_0x446d72||0xcc;return function(_0x2377ec){if(_0x2377ec){return _0x2b8b36[_0x4b71('0x1b')](_0x446d72);}return _0x2b8b36[_0x4b71('0x1c')](_0x446d72)[_0x4b71('0x1d')]();};}function respondWithResult(_0x253861,_0x24127e){_0x24127e=_0x24127e||0xc8;return function(_0x1ac272){if(_0x1ac272){return _0x253861[_0x4b71('0x1c')](_0x24127e)['json'](_0x1ac272);}};}function respondWithFilteredResult(_0x3adafd,_0x68608c){return function(_0x5ad091){if(_0x5ad091){var _0x214a49=typeof _0x68608c[_0x4b71('0x1e')]==='undefined'&&typeof _0x68608c[_0x4b71('0x1f')]===_0x4b71('0x20');var _0x1d3d87=_0x5ad091[_0x4b71('0x21')];var _0x35f6d3=_0x214a49?0x0:_0x68608c[_0x4b71('0x1e')];var _0x204984=_0x214a49?_0x5ad091['count']:_0x68608c['offset']+_0x68608c['limit'];var _0x412e42;if(_0x204984>=_0x1d3d87){_0x204984=_0x1d3d87;_0x412e42=0xc8;}else{_0x412e42=0xce;}_0x3adafd[_0x4b71('0x1c')](_0x412e42);return _0x3adafd[_0x4b71('0x22')](_0x4b71('0x23'),_0x35f6d3+'-'+_0x204984+'/'+_0x1d3d87)[_0x4b71('0x24')](_0x5ad091);}return null;};}function patchUpdates(_0x1269d9){return function(_0x3c8f78){try{jsonpatch['apply'](_0x3c8f78,_0x1269d9,!![]);}catch(_0x4cfb66){return BPromise[_0x4b71('0x25')](_0x4cfb66);}return _0x3c8f78[_0x4b71('0x26')]();};}function saveUpdates(_0x3aec90,_0x4d172c){return function(_0x49b9f4){if(_0x49b9f4){return _0x49b9f4[_0x4b71('0x27')](_0x3aec90)[_0x4b71('0x28')](function(_0xbaa969){return _0xbaa969;});}return null;};}function removeEntity(_0x5bcd25,_0x259094){return function(_0x10f1bc){if(_0x10f1bc){return _0x10f1bc['destroy']()[_0x4b71('0x28')](function(){var _0x28f74d=_0x10f1bc[_0x4b71('0x29')]({'plain':!![]});var _0x42e5ae=_0x4b71('0x2a');return db[_0x4b71('0x2b')][_0x4b71('0x2c')]({'where':{'type':_0x42e5ae,'resourceId':_0x28f74d['id']}})[_0x4b71('0x28')](function(){return _0x10f1bc;});})[_0x4b71('0x28')](function(){_0x5bcd25[_0x4b71('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41ff35,_0x523a3c){return function(_0x33110a){if(!_0x33110a){_0x41ff35[_0x4b71('0x1b')](0x194);}return _0x33110a;};}function handleError(_0x3e4d5d,_0x106c41){_0x106c41=_0x106c41||0x1f4;return function(_0x442939){logger[_0x4b71('0x2d')](_0x442939[_0x4b71('0x2e')]);if(_0x442939['name']){delete _0x442939[_0x4b71('0x2f')];}_0x3e4d5d[_0x4b71('0x1c')](_0x106c41)[_0x4b71('0x30')](_0x442939);};}exports[_0x4b71('0x31')]=function(_0x1f0116,_0x85f28c){var _0x469f10={},_0x18afca={},_0x4f44be={'count':0x0,'rows':[]};var _0x253c86=_[_0x4b71('0x32')](db['Schedule'][_0x4b71('0x33')],function(_0xf33d05){return{'name':_0xf33d05[_0x4b71('0x34')],'type':_0xf33d05[_0x4b71('0x35')][_0x4b71('0x36')]};});_0x18afca[_0x4b71('0x37')]=_[_0x4b71('0x32')](_0x253c86,_0x4b71('0x2f'));_0x18afca[_0x4b71('0x38')]=_[_0x4b71('0x39')](_0x1f0116[_0x4b71('0x38')]);_0x18afca['filters']=_['intersection'](_0x18afca[_0x4b71('0x37')],_0x18afca[_0x4b71('0x38')]);_0x469f10[_0x4b71('0x3a')]=_[_0x4b71('0x3b')](_0x18afca['model'],qs['fields'](_0x1f0116[_0x4b71('0x38')][_0x4b71('0x3c')]));_0x469f10['attributes']=_0x469f10['attributes'][_0x4b71('0x3d')]?_0x469f10[_0x4b71('0x3a')]:_0x18afca[_0x4b71('0x37')];if(!_0x1f0116[_0x4b71('0x38')]['hasOwnProperty'](_0x4b71('0x3e'))){_0x469f10[_0x4b71('0x1f')]=qs[_0x4b71('0x1f')](_0x1f0116[_0x4b71('0x38')][_0x4b71('0x1f')]);_0x469f10[_0x4b71('0x1e')]=qs['offset'](_0x1f0116['query'][_0x4b71('0x1e')]);}_0x469f10[_0x4b71('0x3f')]=qs['sort'](_0x1f0116[_0x4b71('0x38')][_0x4b71('0x40')]);_0x469f10[_0x4b71('0x41')]=qs[_0x4b71('0x42')](_['pick'](_0x1f0116[_0x4b71('0x38')],_0x18afca[_0x4b71('0x42')]),_0x253c86);if(_0x1f0116[_0x4b71('0x38')][_0x4b71('0x43')]){_0x469f10[_0x4b71('0x41')]=_[_0x4b71('0x44')](_0x469f10['where'],{'$or':_[_0x4b71('0x32')](_0x253c86,function(_0x1dc935){if(_0x1dc935[_0x4b71('0x35')]!==_0x4b71('0x45')){var _0x31cd76={};_0x31cd76[_0x1dc935[_0x4b71('0x2f')]]={'$like':'%'+_0x1f0116['query'][_0x4b71('0x43')]+'%'};return _0x31cd76;}})});}_0x469f10=_[_0x4b71('0x44')]({},_0x469f10,_0x1f0116[_0x4b71('0x46')]);var _0x436499={'where':_0x469f10['where']};return db[_0x4b71('0x47')][_0x4b71('0x21')](_0x436499)['then'](function(_0x188a4e){_0x4f44be[_0x4b71('0x21')]=_0x188a4e;if(_0x1f0116['query']['includeAll']){_0x469f10[_0x4b71('0x48')]=[{'all':!![]}];}return db[_0x4b71('0x47')][_0x4b71('0x49')](_0x469f10);})[_0x4b71('0x28')](function(_0x1fea7b){_0x4f44be[_0x4b71('0x4a')]=_0x1fea7b;return _0x4f44be;})[_0x4b71('0x28')](respondWithFilteredResult(_0x85f28c,_0x469f10))[_0x4b71('0x4b')](handleError(_0x85f28c,null));};exports[_0x4b71('0x4c')]=function(_0x391d18,_0x502910){var _0x30008e={'raw':![],'where':{'id':_0x391d18[_0x4b71('0x4d')]['id']}},_0x1c49fe={};_0x1c49fe[_0x4b71('0x37')]=_['keys'](db[_0x4b71('0x47')]['rawAttributes']);_0x1c49fe['query']=_['keys'](_0x391d18[_0x4b71('0x38')]);_0x1c49fe[_0x4b71('0x42')]=_[_0x4b71('0x3b')](_0x1c49fe['model'],_0x1c49fe[_0x4b71('0x38')]);_0x30008e['attributes']=_['intersection'](_0x1c49fe[_0x4b71('0x37')],qs[_0x4b71('0x3c')](_0x391d18[_0x4b71('0x38')][_0x4b71('0x3c')]));_0x30008e[_0x4b71('0x3a')]=_0x30008e[_0x4b71('0x3a')][_0x4b71('0x3d')]?_0x30008e[_0x4b71('0x3a')]:_0x1c49fe['model'];if(_0x391d18['query'][_0x4b71('0x4e')]){_0x30008e[_0x4b71('0x48')]=[{'all':!![]}];}_0x30008e=_['merge']({},_0x30008e,_0x391d18['options']);return db['Schedule'][_0x4b71('0x4f')](_0x30008e)[_0x4b71('0x28')](handleEntityNotFound(_0x502910,null))[_0x4b71('0x28')](respondWithResult(_0x502910,null))['catch'](handleError(_0x502910,null));};exports[_0x4b71('0x50')]=function(_0x5e9cee,_0x1c6f02){return db[_0x4b71('0x47')][_0x4b71('0x50')](_0x5e9cee['body'],{})[_0x4b71('0x28')](function(_0x8fce6b){var _0x2dd949=_0x5e9cee['user'][_0x4b71('0x29')]({'plain':!![]});if(!_0x2dd949)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2dd949['role']==='user'){var _0x2f7fce=_0x8fce6b[_0x4b71('0x29')]({'plain':!![]});var _0x3667ed='Scheduler';return db[_0x4b71('0x51')][_0x4b71('0x4f')]({'where':{'name':_0x3667ed,'userProfileId':_0x2dd949[_0x4b71('0x52')]},'raw':!![]})[_0x4b71('0x28')](function(_0x3c821d){if(_0x3c821d&&_0x3c821d[_0x4b71('0x53')]===0x0){return db[_0x4b71('0x2b')][_0x4b71('0x50')]({'name':_0x2f7fce['name'],'resourceId':_0x2f7fce['id'],'type':_0x3c821d[_0x4b71('0x2f')],'sectionId':_0x3c821d['id']},{})[_0x4b71('0x28')](function(){return _0x8fce6b;});}else{return _0x8fce6b;}})[_0x4b71('0x4b')](function(_0x31c101){logger[_0x4b71('0x2d')](_0x4b71('0x54'),_0x31c101);throw _0x31c101;});}return _0x8fce6b;})['then'](respondWithResult(_0x1c6f02,0xc9))[_0x4b71('0x4b')](handleError(_0x1c6f02,null));};exports[_0x4b71('0x27')]=function(_0x5a0e37,_0x14ef7e){if(_0x5a0e37[_0x4b71('0x55')]['id']){delete _0x5a0e37['body']['id'];}return db[_0x4b71('0x47')][_0x4b71('0x4f')]({'where':{'id':_0x5a0e37['params']['id']}})[_0x4b71('0x28')](handleEntityNotFound(_0x14ef7e,null))[_0x4b71('0x28')](saveUpdates(_0x5a0e37[_0x4b71('0x55')],null))[_0x4b71('0x28')](respondWithResult(_0x14ef7e,null))[_0x4b71('0x4b')](handleError(_0x14ef7e,null));};exports[_0x4b71('0x2c')]=function(_0x5aa170,_0x395248){return db[_0x4b71('0x47')][_0x4b71('0x4f')]({'where':{'id':_0x5aa170[_0x4b71('0x4d')]['id']}})[_0x4b71('0x28')](handleEntityNotFound(_0x395248,null))[_0x4b71('0x28')](removeEntity(_0x395248,null))[_0x4b71('0x4b')](handleError(_0x395248,null));};exports[_0x4b71('0x56')]=function(_0x4a3a12,_0x2477ec,_0x4aa3fb){var _0x5f2168=require('../../config/schedule');return db[_0x4b71('0x47')][_0x4b71('0x4f')]({'where':{'id':_0x4a3a12[_0x4b71('0x4d')]['id']},'raw':!![]})[_0x4b71('0x28')](handleEntityNotFound(_0x2477ec,null))[_0x4b71('0x28')](function(){_0x5f2168['run'](_0x4a3a12[_0x4b71('0x4d')]['id']);})[_0x4b71('0x28')](respondWithStatusCode(_0x2477ec,null))[_0x4b71('0x4b')](handleError(_0x2477ec,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index c2300e1..07000e8 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 _0x2070=['lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','./schedule.attributes','define','tools_schedules'];(function(_0x30056a,_0x4b6322){var _0x2f0799=function(_0x1da9eb){while(--_0x1da9eb){_0x30056a['push'](_0x30056a['shift']());}};_0x2f0799(++_0x4b6322);}(_0x2070,0x14a));var _0x0207=function(_0x4042f2,_0x2ac76f){_0x4042f2=_0x4042f2-0x0;var _0x53919d=_0x2070[_0x4042f2];return _0x53919d;};'use strict';var _=require(_0x0207('0x0'));var util=require('util');var logger=require(_0x0207('0x1'))(_0x0207('0x2'));var moment=require('moment');var BPromise=require(_0x0207('0x3'));var rp=require(_0x0207('0x4'));var fs=require('fs');var path=require(_0x0207('0x5'));var rimraf=require(_0x0207('0x6'));var config=require('../../config/environment');var attributes=require(_0x0207('0x7'));module['exports']=function(_0x27cdfd,_0xe69362){return _0x27cdfd[_0x0207('0x8')]('Schedule',attributes,{'tableName':_0x0207('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6f9b=['./schedule.attributes','define','Schedule','tools_schedules','lodash','../../config/logger','request-promise','path','rimraf','../../config/environment'];(function(_0x96d942,_0x43dedb){var _0x57407a=function(_0x36993f){while(--_0x36993f){_0x96d942['push'](_0x96d942['shift']());}};_0x57407a(++_0x43dedb);}(_0x6f9b,0x130));var _0xb6f9=function(_0x2995e4,_0xf7c850){_0x2995e4=_0x2995e4-0x0;var _0x570153=_0x6f9b[_0x2995e4];return _0x570153;};'use strict';var _=require(_0xb6f9('0x0'));var util=require('util');var logger=require(_0xb6f9('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb6f9('0x2'));var fs=require('fs');var path=require(_0xb6f9('0x3'));var rimraf=require(_0xb6f9('0x4'));var config=require(_0xb6f9('0x5'));var attributes=require(_0xb6f9('0x6'));module['exports']=function(_0x18008b,_0x96c710){return _0x18008b[_0xb6f9('0x7')](_0xb6f9('0x8'),attributes,{'tableName':_0xb6f9('0x9'),'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 b49fe4e..598fb76 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 _0x8ac3=['Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','code','error','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x44e58d,_0x3e282f){var _0x232137=function(_0x193e9f){while(--_0x193e9f){_0x44e58d['push'](_0x44e58d['shift']());}};_0x232137(++_0x3e282f);}(_0x8ac3,0xee));var _0x38ac=function(_0x5b49d2,_0x217a26){_0x5b49d2=_0x5b49d2-0x0;var _0xc4b634=_0x8ac3[_0x5b49d2];return _0xc4b634;};'use strict';var _=require(_0x38ac('0x0'));var util=require(_0x38ac('0x1'));var moment=require('moment');var BPromise=require(_0x38ac('0x2'));var rs=require(_0x38ac('0x3'));var fs=require('fs');var Redis=require(_0x38ac('0x4'));var db=require(_0x38ac('0x5'))['db'];var utils=require(_0x38ac('0x6'));var logger=require(_0x38ac('0x7'))('rpc');var config=require(_0x38ac('0x8'));var jayson=require(_0x38ac('0x9'));var client=jayson[_0x38ac('0xa')][_0x38ac('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x14b9a5,_0xa97391,_0x1d1cc0){return new BPromise(function(_0x389083,_0xe588a6){return client[_0x38ac('0xc')](_0x14b9a5,_0x1d1cc0)[_0x38ac('0xd')](function(_0x536270){logger[_0x38ac('0xe')](_0x38ac('0xf'),_0xa97391,_0x38ac('0x10'));logger[_0x38ac('0x11')](_0x38ac('0x12'),_0xa97391,_0x38ac('0x10'),JSON['stringify'](_0x536270));if(_0x536270['error']){if(_0x536270['error'][_0x38ac('0x13')]===0x1f4){logger['error'](_0x38ac('0xf'),_0xa97391,_0x536270[_0x38ac('0x14')]['message']);return _0xe588a6(_0x536270[_0x38ac('0x14')][_0x38ac('0x15')]);}logger[_0x38ac('0x14')](_0x38ac('0xf'),_0xa97391,_0x536270[_0x38ac('0x14')][_0x38ac('0x15')]);return _0x389083(_0x536270[_0x38ac('0x14')][_0x38ac('0x15')]);}else{logger[_0x38ac('0xe')]('Schedule,\x20%s,\x20%s',_0xa97391,_0x38ac('0x10'));_0x389083(_0x536270[_0x38ac('0x16')][_0x38ac('0x15')]);}})['catch'](function(_0x19c6ea){logger['error']('Schedule,\x20%s,\x20%s',_0xa97391,_0x19c6ea);_0xe588a6(_0x19c6ea);});});} \ No newline at end of file +var _0xfd53=['client','http','request','then','info','Schedule,\x20%s,\x20%s','debug','Schedule,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x59f438,_0x1718f1){var _0x4dcb8f=function(_0x4fb64b){while(--_0x4fb64b){_0x59f438['push'](_0x59f438['shift']());}};_0x4dcb8f(++_0x1718f1);}(_0xfd53,0x69));var _0x3fd5=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0xfd53[_0x1ccdf7];return _0x52a0ae;};'use strict';var _=require(_0x3fd5('0x0'));var util=require(_0x3fd5('0x1'));var moment=require('moment');var BPromise=require(_0x3fd5('0x2'));var rs=require(_0x3fd5('0x3'));var fs=require('fs');var Redis=require(_0x3fd5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3fd5('0x5'));var logger=require(_0x3fd5('0x6'))(_0x3fd5('0x7'));var config=require(_0x3fd5('0x8'));var jayson=require(_0x3fd5('0x9'));var client=jayson[_0x3fd5('0xa')][_0x3fd5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x22b2b1,_0x335ffe,_0x3a3fd8){return new BPromise(function(_0x5a2516,_0x1c198f){return client[_0x3fd5('0xc')](_0x22b2b1,_0x3a3fd8)[_0x3fd5('0xd')](function(_0x478d0a){logger[_0x3fd5('0xe')](_0x3fd5('0xf'),_0x335ffe,'request\x20sent');logger[_0x3fd5('0x10')](_0x3fd5('0x11'),_0x335ffe,_0x3fd5('0x12'),JSON[_0x3fd5('0x13')](_0x478d0a));if(_0x478d0a[_0x3fd5('0x14')]){if(_0x478d0a[_0x3fd5('0x14')]['code']===0x1f4){logger[_0x3fd5('0x14')](_0x3fd5('0xf'),_0x335ffe,_0x478d0a[_0x3fd5('0x14')]['message']);return _0x1c198f(_0x478d0a['error']['message']);}logger['error'](_0x3fd5('0xf'),_0x335ffe,_0x478d0a[_0x3fd5('0x14')][_0x3fd5('0x15')]);return _0x5a2516(_0x478d0a[_0x3fd5('0x14')][_0x3fd5('0x15')]);}else{logger[_0x3fd5('0xe')](_0x3fd5('0xf'),_0x335ffe,_0x3fd5('0x12'));_0x5a2516(_0x478d0a['result'][_0x3fd5('0x15')]);}})[_0x3fd5('0x16')](function(_0x3b0ab3){logger[_0x3fd5('0x14')](_0x3fd5('0xf'),_0x335ffe,_0x3b0ab3);_0x1c198f(_0x3b0ab3);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 47f65f9..5e70df2 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 _0xa84e=['get','index','/describe','isAuthenticated','describe','/:id','show','/:id/download','download','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./screenRecording.controller'];(function(_0x20410e,_0x2796a6){var _0x4426ee=function(_0x2b6e4f){while(--_0x2b6e4f){_0x20410e['push'](_0x20410e['shift']());}};_0x4426ee(++_0x2796a6);}(_0xa84e,0x151));var _0xea84=function(_0x27470d,_0x20ad27){_0x27470d=_0x27470d-0x0;var _0x2cab2b=_0xa84e[_0x27470d];return _0x2cab2b;};'use strict';var multer=require(_0xea84('0x0'));var util=require(_0xea84('0x1'));var path=require(_0xea84('0x2'));var timeout=require(_0xea84('0x3'));var express=require(_0xea84('0x4'));var router=express['Router']();var fs_extra=require(_0xea84('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xea84('0x6'));var config=require('../../config/environment');var controller=require(_0xea84('0x7'));router[_0xea84('0x8')]('/',auth['isAuthenticated'](),controller[_0xea84('0x9')]);router[_0xea84('0x8')](_0xea84('0xa'),auth[_0xea84('0xb')](),controller[_0xea84('0xc')]);router['get'](_0xea84('0xd'),auth[_0xea84('0xb')](),controller[_0xea84('0xe')]);router[_0xea84('0x8')](_0xea84('0xf'),auth['isAuthenticated'](),controller[_0xea84('0x10')]);router[_0xea84('0x11')]('/',auth[_0xea84('0xb')](),controller[_0xea84('0x12')]);router[_0xea84('0x13')](_0xea84('0xd'),auth[_0xea84('0xb')](),controller[_0xea84('0x14')]);router[_0xea84('0x15')](_0xea84('0xd'),auth[_0xea84('0xb')](),controller[_0xea84('0x16')]);module['exports']=router; \ No newline at end of file +var _0xed46=['index','/describe','isAuthenticated','describe','/:id','show','/:id/download','download','post','create','update','delete','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0xed46,0x1b1));var _0x6ed4=function(_0x4d6624,_0x78b606){_0x4d6624=_0x4d6624-0x0;var _0x5dbb01=_0xed46[_0x4d6624];return _0x5dbb01;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6ed4('0x0'));var timeout=require(_0x6ed4('0x1'));var express=require(_0x6ed4('0x2'));var router=express['Router']();var fs_extra=require(_0x6ed4('0x3'));var auth=require(_0x6ed4('0x4'));var interaction=require(_0x6ed4('0x5'));var config=require(_0x6ed4('0x6'));var controller=require('./screenRecording.controller');router[_0x6ed4('0x7')]('/',auth['isAuthenticated'](),controller[_0x6ed4('0x8')]);router[_0x6ed4('0x7')](_0x6ed4('0x9'),auth[_0x6ed4('0xa')](),controller[_0x6ed4('0xb')]);router[_0x6ed4('0x7')](_0x6ed4('0xc'),auth[_0x6ed4('0xa')](),controller[_0x6ed4('0xd')]);router[_0x6ed4('0x7')](_0x6ed4('0xe'),auth[_0x6ed4('0xa')](),controller[_0x6ed4('0xf')]);router[_0x6ed4('0x10')]('/',auth[_0x6ed4('0xa')](),controller[_0x6ed4('0x11')]);router['put'](_0x6ed4('0xc'),auth['isAuthenticated'](),controller[_0x6ed4('0x12')]);router[_0x6ed4('0x13')](_0x6ed4('0xc'),auth[_0x6ed4('0xa')](),controller['destroy']);module[_0x6ed4('0x14')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 7941ab2..fdfef1b 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 _0x4732=['createdAt','MM-DD-YYYY\x20HH:mm','updatedAt','sequelize','path','exports','VIRTUAL','getDataValue','value','extname','STRING','setDataValue','INTEGER','startedAt','closedAt','DATE','format','toString'];(function(_0x70be4c,_0x237521){var _0x33e829=function(_0x4516bc){while(--_0x4516bc){_0x70be4c['push'](_0x70be4c['shift']());}};_0x33e829(++_0x237521);}(_0x4732,0x17d));var _0x2473=function(_0x14a0a0,_0x45d0cf){_0x14a0a0=_0x14a0a0-0x0;var _0x56b651=_0x4732[_0x14a0a0];return _0x56b651;};'use strict';var Sequelize=require(_0x2473('0x0'));var moment=require('moment');var path=require(_0x2473('0x1'));var config=require('../../config/environment');module[_0x2473('0x2')]={'format':{'type':Sequelize[_0x2473('0x3')],'get':function(){return this[_0x2473('0x4')](_0x2473('0x5'))?path[_0x2473('0x6')](this[_0x2473('0x4')](_0x2473('0x5'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x2473('0x7')]},'value':{'type':Sequelize[_0x2473('0x7')],'set':function(_0x50e340){var _0x4be81c=_0x50e340['replace'](/\\/g,'/');this[_0x2473('0x8')](_0x2473('0x5'),_0x4be81c);}},'rating':{'type':Sequelize[_0x2473('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x2473('0x9')],'set':function(_0x52fffe){this['setDataValue'](_0x2473('0xa'),moment()['subtract'](_0x52fffe,'ms'));this[_0x2473('0x8')](_0x2473('0xb'),moment());this['setDataValue']('duration',_0x52fffe);}},'startedAt':{'type':Sequelize[_0x2473('0xc')],'get':function(){return moment(this[_0x2473('0x4')](_0x2473('0xa')))[_0x2473('0xd')]('MM-DD-YYYY\x20HH:mm')[_0x2473('0xe')]();}},'closedAt':{'type':Sequelize[_0x2473('0xc')],'get':function(){return moment(this[_0x2473('0x4')](_0x2473('0xb')))['format']('MM-DD-YYYY\x20HH:mm')['toString']();}},'createdAt':{'type':Sequelize[_0x2473('0xc')],'get':function(){return moment(this[_0x2473('0x4')](_0x2473('0xf')))[_0x2473('0xd')](_0x2473('0x10'))[_0x2473('0xe')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x2473('0x4')](_0x2473('0x11')))[_0x2473('0xd')](_0x2473('0x10'))[_0x2473('0xe')]();}}}; \ No newline at end of file +var _0xd4ad=['toString','updatedAt','sequelize','moment','path','../../config/environment','VIRTUAL','getDataValue','value','STRING','setDataValue','INTEGER','startedAt','subtract','DATE','format','MM-DD-YYYY\x20HH:mm','closedAt'];(function(_0x42228c,_0x4f4164){var _0x12a7b2=function(_0x405cf8){while(--_0x405cf8){_0x42228c['push'](_0x42228c['shift']());}};_0x12a7b2(++_0x4f4164);}(_0xd4ad,0x158));var _0xdd4a=function(_0xaadf8b,_0x1afa74){_0xaadf8b=_0xaadf8b-0x0;var _0x1c22f2=_0xd4ad[_0xaadf8b];return _0x1c22f2;};'use strict';var Sequelize=require(_0xdd4a('0x0'));var moment=require(_0xdd4a('0x1'));var path=require(_0xdd4a('0x2'));var config=require(_0xdd4a('0x3'));module['exports']={'format':{'type':Sequelize[_0xdd4a('0x4')],'get':function(){return this[_0xdd4a('0x5')]('value')?path['extname'](this[_0xdd4a('0x5')](_0xdd4a('0x6'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xdd4a('0x7')]},'value':{'type':Sequelize['STRING'],'set':function(_0xd243eb){var _0xb14ae6=_0xd243eb['replace'](/\\/g,'/');this[_0xdd4a('0x8')]('value',_0xb14ae6);}},'rating':{'type':Sequelize[_0xdd4a('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xdd4a('0x9')],'set':function(_0x42fa33){this[_0xdd4a('0x8')](_0xdd4a('0xa'),moment()[_0xdd4a('0xb')](_0x42fa33,'ms'));this['setDataValue']('closedAt',moment());this[_0xdd4a('0x8')]('duration',_0x42fa33);}},'startedAt':{'type':Sequelize[_0xdd4a('0xc')],'get':function(){return moment(this[_0xdd4a('0x5')]('startedAt'))[_0xdd4a('0xd')](_0xdd4a('0xe'))['toString']();}},'closedAt':{'type':Sequelize[_0xdd4a('0xc')],'get':function(){return moment(this['getDataValue'](_0xdd4a('0xf')))['format'](_0xdd4a('0xe'))['toString']();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xdd4a('0x5')]('createdAt'))['format']('MM-DD-YYYY\x20HH:mm')[_0xdd4a('0x10')]();}},'updatedAt':{'type':Sequelize[_0xdd4a('0xc')],'get':function(){return moment(this[_0xdd4a('0x5')](_0xdd4a('0x11')))[_0xdd4a('0xd')](_0xdd4a('0xe'))[_0xdd4a('0x10')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index f103e99..13d953d 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 _0xae24=['status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','then','destroy','stack','name','send','index','map','ScreenRecording','fieldName','type','key','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','duration','createdAt','closedAt','find','describe','download','../../components/encryptor','uniqueid','value','join','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','recording','root','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','unlink','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','unlinkSync','.cypher','eml-format','zip-dir','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0xae24,0x182));var _0x4ae2=function(_0x130fae,_0x5a7e2f){_0x130fae=_0x130fae-0x0;var _0x3a4546=_0xae24[_0x130fae];return _0x3a4546;};'use strict';var emlformat=require(_0x4ae2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4ae2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4ae2('0x2'));var moment=require(_0x4ae2('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4ae2('0x4'));var path=require('path');var sox=require(_0x4ae2('0x5'));var csv=require(_0x4ae2('0x6'));var ejs=require(_0x4ae2('0x7'));var fs=require('fs');var fs_extra=require(_0x4ae2('0x8'));var _=require(_0x4ae2('0x9'));var squel=require(_0x4ae2('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4ae2('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4ae2('0xc'));var Redis=require(_0x4ae2('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x4ae2('0xe'));var as=require(_0x4ae2('0xf'));var hardwareService=require(_0x4ae2('0x10'));var logger=require(_0x4ae2('0x11'))('api');var utils=require(_0x4ae2('0x12'));var config=require(_0x4ae2('0x13'));var licenseUtil=require(_0x4ae2('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x25d2b4,_0x22ac1e){_0x22ac1e=_0x22ac1e||0xcc;return function(_0x30d6c4){if(_0x30d6c4){return _0x25d2b4[_0x4ae2('0x15')](_0x22ac1e);}return _0x25d2b4[_0x4ae2('0x16')](_0x22ac1e)[_0x4ae2('0x17')]();};}function respondWithResult(_0x145287,_0x3cabc9){_0x3cabc9=_0x3cabc9||0xc8;return function(_0xd527a0){if(_0xd527a0){return _0x145287['status'](_0x3cabc9)['json'](_0xd527a0);}};}function respondWithFilteredResult(_0x4d5cab,_0x2f3936){return function(_0xf834a1){if(_0xf834a1){var _0x5f447a=typeof _0x2f3936[_0x4ae2('0x18')]===_0x4ae2('0x19')&&typeof _0x2f3936[_0x4ae2('0x1a')]===_0x4ae2('0x19');var _0x428d24=_0xf834a1[_0x4ae2('0x1b')];var _0x3d4259=_0x5f447a?0x0:_0x2f3936[_0x4ae2('0x18')];var _0x41b672=_0x5f447a?_0xf834a1[_0x4ae2('0x1b')]:_0x2f3936['offset']+_0x2f3936['limit'];var _0x44a2d3;if(_0x41b672>=_0x428d24){_0x41b672=_0x428d24;_0x44a2d3=0xc8;}else{_0x44a2d3=0xce;}_0x4d5cab[_0x4ae2('0x16')](_0x44a2d3);return _0x4d5cab['set'](_0x4ae2('0x1c'),_0x3d4259+'-'+_0x41b672+'/'+_0x428d24)[_0x4ae2('0x1d')](_0xf834a1);}return null;};}function patchUpdates(_0xccb3b){return function(_0x2ad222){try{jsonpatch[_0x4ae2('0x1e')](_0x2ad222,_0xccb3b,!![]);}catch(_0x497218){return BPromise[_0x4ae2('0x1f')](_0x497218);}return _0x2ad222['save']();};}function saveUpdates(_0x522165,_0x2ceec4){return function(_0x151b70){if(_0x151b70){return _0x151b70[_0x4ae2('0x20')](_0x522165)[_0x4ae2('0x21')](function(_0xca16bf){return _0xca16bf;});}return null;};}function removeEntity(_0x526768,_0x1005e0){return function(_0x4a0ddb){if(_0x4a0ddb){return _0x4a0ddb[_0x4ae2('0x22')]()[_0x4ae2('0x21')](function(){_0x526768[_0x4ae2('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x43f112,_0x6f0cc6){return function(_0x2454b3){if(!_0x2454b3){_0x43f112[_0x4ae2('0x15')](0x194);}return _0x2454b3;};}function handleError(_0x1c2934,_0x255772){_0x255772=_0x255772||0x1f4;return function(_0x5b2e65){logger['error'](_0x5b2e65[_0x4ae2('0x23')]);if(_0x5b2e65[_0x4ae2('0x24')]){delete _0x5b2e65[_0x4ae2('0x24')];}_0x1c2934[_0x4ae2('0x16')](_0x255772)[_0x4ae2('0x25')](_0x5b2e65);};}exports[_0x4ae2('0x26')]=function(_0x57a377,_0x5ec1fd){var _0x3e2666={},_0x4e7741={},_0x554cff={'count':0x0,'rows':[]};var _0x5e9f03=_[_0x4ae2('0x27')](db[_0x4ae2('0x28')]['rawAttributes'],function(_0x883fd5){return{'name':_0x883fd5[_0x4ae2('0x29')],'type':_0x883fd5[_0x4ae2('0x2a')][_0x4ae2('0x2b')]};});_0x4e7741[_0x4ae2('0x2c')]=_[_0x4ae2('0x2d')](_[_0x4ae2('0x27')](_0x5e9f03,_0x4ae2('0x24')),[_0x4ae2('0x2e')]);_0x4e7741[_0x4ae2('0x2f')]=_[_0x4ae2('0x30')](_0x57a377[_0x4ae2('0x2f')]);_0x4e7741[_0x4ae2('0x31')]=_[_0x4ae2('0x32')](_0x4e7741[_0x4ae2('0x2c')],_0x4e7741[_0x4ae2('0x2f')]);_0x3e2666[_0x4ae2('0x33')]=_['intersection'](_0x4e7741[_0x4ae2('0x2c')],qs['fields'](_0x57a377[_0x4ae2('0x2f')][_0x4ae2('0x34')]));_0x3e2666['attributes']=_0x3e2666[_0x4ae2('0x33')][_0x4ae2('0x35')]?_0x3e2666[_0x4ae2('0x33')]:_0x4e7741[_0x4ae2('0x2c')];if(!_0x57a377['query'][_0x4ae2('0x36')](_0x4ae2('0x37'))){_0x3e2666[_0x4ae2('0x1a')]=qs[_0x4ae2('0x1a')](_0x57a377[_0x4ae2('0x2f')][_0x4ae2('0x1a')]);_0x3e2666[_0x4ae2('0x18')]=qs[_0x4ae2('0x18')](_0x57a377[_0x4ae2('0x2f')]['offset']);}_0x3e2666[_0x4ae2('0x38')]=qs['sort'](_0x57a377[_0x4ae2('0x2f')][_0x4ae2('0x39')]);_0x3e2666[_0x4ae2('0x3a')]=qs[_0x4ae2('0x31')](_[_0x4ae2('0x3b')](_0x57a377[_0x4ae2('0x2f')],_0x4e7741['filters']),_0x5e9f03);if(_0x57a377[_0x4ae2('0x2f')][_0x4ae2('0x3c')]){_0x3e2666[_0x4ae2('0x3a')]=_[_0x4ae2('0x3d')](_0x3e2666['where'],{'$or':_[_0x4ae2('0x27')](_0x5e9f03,function(_0x34a784){if(_0x34a784[_0x4ae2('0x2a')]!==_0x4ae2('0x3e')){var _0x232243={};_0x232243[_0x34a784[_0x4ae2('0x24')]]={'$like':'%'+_0x57a377[_0x4ae2('0x2f')][_0x4ae2('0x3c')]+'%'};return _0x232243;}})});}_0x3e2666=_[_0x4ae2('0x3d')]({},_0x3e2666,_0x57a377[_0x4ae2('0x3f')]);var _0x2aaef1={'where':_0x3e2666['where']};return db[_0x4ae2('0x28')][_0x4ae2('0x1b')](_0x2aaef1)[_0x4ae2('0x21')](function(_0x1473e6){_0x554cff['count']=_0x1473e6;if(_0x57a377['query'][_0x4ae2('0x40')]){_0x3e2666[_0x4ae2('0x41')]=[{'all':!![]}];}return db[_0x4ae2('0x28')][_0x4ae2('0x42')](_0x3e2666);})['then'](function(_0x3c0a56){_0x554cff[_0x4ae2('0x43')]=_0x3c0a56;return _0x554cff;})['then'](respondWithFilteredResult(_0x5ec1fd,_0x3e2666))[_0x4ae2('0x44')](handleError(_0x5ec1fd,null));};exports[_0x4ae2('0x45')]=function(_0x11a5d9,_0x5a9126){var _0x2f6431={'raw':![],'where':{'id':_0x11a5d9[_0x4ae2('0x46')]['id']}},_0x29e12c={};_0x29e12c[_0x4ae2('0x2c')]=_[_0x4ae2('0x30')](db[_0x4ae2('0x28')][_0x4ae2('0x47')]);_0x29e12c[_0x4ae2('0x2f')]=_['keys'](_0x11a5d9[_0x4ae2('0x2f')]);_0x29e12c[_0x4ae2('0x31')]=_['intersection'](_0x29e12c[_0x4ae2('0x2c')],_0x29e12c[_0x4ae2('0x2f')]);_0x2f6431['attributes']=_[_0x4ae2('0x32')](_0x29e12c[_0x4ae2('0x2c')],qs['fields'](_0x11a5d9[_0x4ae2('0x2f')][_0x4ae2('0x34')]));_0x2f6431[_0x4ae2('0x33')]=_0x2f6431['attributes']['length']?_0x2f6431[_0x4ae2('0x33')]:_0x29e12c[_0x4ae2('0x2c')];if(_0x11a5d9[_0x4ae2('0x2f')][_0x4ae2('0x40')]){_0x2f6431['include']=[{'all':!![]}];}_0x2f6431=_[_0x4ae2('0x3d')]({},_0x2f6431,_0x11a5d9[_0x4ae2('0x3f')]);return db[_0x4ae2('0x28')]['find'](_0x2f6431)[_0x4ae2('0x21')](handleEntityNotFound(_0x5a9126,null))[_0x4ae2('0x21')](respondWithResult(_0x5a9126,null))[_0x4ae2('0x44')](handleError(_0x5a9126,null));};exports['create']=function(_0x16bf0b,_0x24ec08){return db[_0x4ae2('0x28')][_0x4ae2('0x48')](_0x16bf0b[_0x4ae2('0x49')],{})[_0x4ae2('0x21')](respondWithResult(_0x24ec08,0xc9))[_0x4ae2('0x44')](handleError(_0x24ec08,null));};exports[_0x4ae2('0x20')]=function(_0x3a6110,_0xf6d12a){if(_0x3a6110['body']['id']){delete _0x3a6110[_0x4ae2('0x49')]['id'];}delete _0x3a6110[_0x4ae2('0x49')][_0x4ae2('0x4a')];delete _0x3a6110[_0x4ae2('0x49')][_0x4ae2('0x4b')];delete _0x3a6110[_0x4ae2('0x49')][_0x4ae2('0x4c')];delete _0x3a6110[_0x4ae2('0x49')]['value'];return db[_0x4ae2('0x28')][_0x4ae2('0x4d')]({'where':{'id':_0x3a6110['params']['id']}})[_0x4ae2('0x21')](handleEntityNotFound(_0xf6d12a,null))[_0x4ae2('0x21')](saveUpdates(_0x3a6110['body'],null))[_0x4ae2('0x21')](respondWithResult(_0xf6d12a,null))['catch'](handleError(_0xf6d12a,null));};exports[_0x4ae2('0x4e')]=function(_0x5e1c80,_0x1ae8bb){return db[_0x4ae2('0x28')][_0x4ae2('0x4e')]()[_0x4ae2('0x21')](respondWithResult(_0x1ae8bb,null))[_0x4ae2('0x44')](handleError(_0x1ae8bb,null));};exports[_0x4ae2('0x4f')]=function(_0x201260,_0xf77b17,_0x28de70){var _0x529355=require(_0x4ae2('0x50'));var _0x4284b4=![];var _0x825c3a={};if(_0x201260[_0x4ae2('0x2f')]['type']&&_0x201260[_0x4ae2('0x2f')][_0x4ae2('0x2a')]===_0x4ae2('0x51')){_0x825c3a['uniqueid']=_0x201260['params']['id'];}else{_0x825c3a['id']=_0x201260[_0x4ae2('0x46')]['id'];}return db[_0x4ae2('0x28')][_0x4ae2('0x4d')]({'where':_0x825c3a,'attributes':['id',_0x4ae2('0x52')],'raw':!![]})[_0x4ae2('0x21')](handleEntityNotFound(_0xf77b17,null))[_0x4ae2('0x21')](function(_0x18a8e6){if(_0x18a8e6){var _0x390c1f=path[_0x4ae2('0x53')](config['root'],_0x4ae2('0x54'),_0x18a8e6['value']);var _0x11f028=util[_0x4ae2('0x2e')](_0x4ae2('0x55'),_0x390c1f);if(fs[_0x4ae2('0x56')](_0x11f028)){_0x4284b4=!![];return _0x529355[_0x4ae2('0x57')](_0x11f028,_0x390c1f,config[_0x4ae2('0x58')][_0x4ae2('0x59')])[_0x4ae2('0x21')](function(){return _0x18a8e6;});}return _0x18a8e6;}})['then'](function(_0x496f98){if(_0x496f98){var _0x33fb77=path[_0x4ae2('0x53')](config[_0x4ae2('0x5a')],'server/files/screen_recordings',_0x496f98['value']);if(!fs[_0x4ae2('0x56')](_0x33fb77)){throw new db[(_0x4ae2('0x5b'))][(_0x4ae2('0x5c'))](_0x4ae2('0x5d'));}if(_0x496f98[_0x4ae2('0x5e')]){return _0xf77b17['download'](_0x33fb77,_0x496f98['filename']+path['extname'](_0x33fb77),function(){if(_0x4284b4){fs[_0x4ae2('0x5f')](_0x33fb77);}});}else{return _0xf77b17['download'](_0x33fb77,function(_0x4e54d1){if(_0x4284b4){fs[_0x4ae2('0x5f')](_0x33fb77);}});}}})['catch'](function(_0x3efbaf){if(_0x3efbaf['message']===_0x4ae2('0x5d')){_0xf77b17['status'](0x194)[_0x4ae2('0x25')]('Not\x20found');}else{return handleError(_0xf77b17,null);}});};exports[_0x4ae2('0x22')]=function(_0x981338,_0x3f46f3){return db[_0x4ae2('0x28')][_0x4ae2('0x4d')]({'where':{'id':_0x981338['params']['id']}})['then'](function(_0x344963){if(_[_0x4ae2('0x60')](_0x344963)){throw new ReferenceError('Entity\x20not\x20found');}return _0x344963;})[_0x4ae2('0x21')](function(_0x29183d){var _0x517800=path[_0x4ae2('0x53')](config[_0x4ae2('0x5a')],'server/files/screen_recordings',_0x29183d['value']);logger[_0x4ae2('0x61')](_0x4ae2('0x62'),_0x517800);if(!_['isNil'](_0x29183d[_0x4ae2('0x52')])&&fs[_0x4ae2('0x56')](_0x517800)){logger[_0x4ae2('0x61')](_0x4ae2('0x63')+_0x517800+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x4ae2('0x64')](_0x517800);}_0x517800=_0x517800+_0x4ae2('0x65');if(!_['isNil'](_0x29183d[_0x4ae2('0x52')])&&fs[_0x4ae2('0x56')](_0x517800)){logger[_0x4ae2('0x61')]('File:\x20\x22'+_0x517800+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x4ae2('0x64')](_0x517800);}return _0x29183d;})['then'](function(_0x3f24bb){if(!_0x3f24bb)throw new InternalError();return _0x3f24bb['destroy']();})[_0x4ae2('0x21')](function(){_0x3f46f3['status'](0xcc)[_0x4ae2('0x17')]();})['catch'](handleError(_0x3f46f3,null));}; \ No newline at end of file +var _0x7bae=['zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','save','update','then','error','stack','name','index','map','ScreenRecording','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','type','VIRTUAL','filter','includeAll','findAll','rows','catch','params','options','find','create','body','duration','createdAt','value','describe','download','../../components/encryptor','uniqueid','join','root','format','%s.cypher','existsSync','secrets','recording','server/files/screen_recordings','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','send','destroy','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione'];(function(_0xf34895,_0x21fb70){var _0x143f44=function(_0x2e7730){while(--_0x2e7730){_0xf34895['push'](_0xf34895['shift']());}};_0x143f44(++_0x21fb70);}(_0x7bae,0x13b));var _0xe7ba=function(_0x4bb66f,_0x3cd682){_0x4bb66f=_0x4bb66f-0x0;var _0xf2772f=_0x7bae[_0x4bb66f];return _0xf2772f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe7ba('0x0'));var jsonpatch=require(_0xe7ba('0x1'));var rp=require('request-promise');var moment=require(_0xe7ba('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xe7ba('0x3'));var util=require(_0xe7ba('0x4'));var path=require(_0xe7ba('0x5'));var sox=require(_0xe7ba('0x6'));var csv=require(_0xe7ba('0x7'));var ejs=require(_0xe7ba('0x8'));var fs=require('fs');var fs_extra=require(_0xe7ba('0x9'));var _=require(_0xe7ba('0xa'));var squel=require(_0xe7ba('0xb'));var crypto=require(_0xe7ba('0xc'));var jsforce=require(_0xe7ba('0xd'));var deskjs=require(_0xe7ba('0xe'));var toCsv=require(_0xe7ba('0x7'));var querystring=require(_0xe7ba('0xf'));var Papa=require('papaparse');var Redis=require(_0xe7ba('0x10'));var authService=require(_0xe7ba('0x11'));var qs=require(_0xe7ba('0x12'));var as=require(_0xe7ba('0x13'));var hardwareService=require(_0xe7ba('0x14'));var logger=require(_0xe7ba('0x15'))(_0xe7ba('0x16'));var utils=require(_0xe7ba('0x17'));var config=require(_0xe7ba('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xe7ba('0x19'))['db'];function respondWithStatusCode(_0x588c8b,_0x602b1){_0x602b1=_0x602b1||0xcc;return function(_0x45229c){if(_0x45229c){return _0x588c8b[_0xe7ba('0x1a')](_0x602b1);}return _0x588c8b[_0xe7ba('0x1b')](_0x602b1)[_0xe7ba('0x1c')]();};}function respondWithResult(_0x41369f,_0x561dbb){_0x561dbb=_0x561dbb||0xc8;return function(_0x561c48){if(_0x561c48){return _0x41369f[_0xe7ba('0x1b')](_0x561dbb)[_0xe7ba('0x1d')](_0x561c48);}};}function respondWithFilteredResult(_0x359f6f,_0x5d1d03){return function(_0x4390e3){if(_0x4390e3){var _0x4b20fd=typeof _0x5d1d03['offset']==='undefined'&&typeof _0x5d1d03[_0xe7ba('0x1e')]==='undefined';var _0x41a773=_0x4390e3['count'];var _0x4e3021=_0x4b20fd?0x0:_0x5d1d03['offset'];var _0x3f326a=_0x4b20fd?_0x4390e3[_0xe7ba('0x1f')]:_0x5d1d03[_0xe7ba('0x20')]+_0x5d1d03[_0xe7ba('0x1e')];var _0x1c8b5b;if(_0x3f326a>=_0x41a773){_0x3f326a=_0x41a773;_0x1c8b5b=0xc8;}else{_0x1c8b5b=0xce;}_0x359f6f['status'](_0x1c8b5b);return _0x359f6f[_0xe7ba('0x21')](_0xe7ba('0x22'),_0x4e3021+'-'+_0x3f326a+'/'+_0x41a773)[_0xe7ba('0x1d')](_0x4390e3);}return null;};}function patchUpdates(_0x136ec6){return function(_0x4aaf35){try{jsonpatch[_0xe7ba('0x23')](_0x4aaf35,_0x136ec6,!![]);}catch(_0x2936b7){return BPromise['reject'](_0x2936b7);}return _0x4aaf35[_0xe7ba('0x24')]();};}function saveUpdates(_0x4514e8,_0x27c882){return function(_0x7ab9e4){if(_0x7ab9e4){return _0x7ab9e4[_0xe7ba('0x25')](_0x4514e8)[_0xe7ba('0x26')](function(_0x293b14){return _0x293b14;});}return null;};}function removeEntity(_0x2b29f0,_0x41cbd9){return function(_0xa72f1c){if(_0xa72f1c){return _0xa72f1c['destroy']()['then'](function(){_0x2b29f0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4363a8,_0x576513){return function(_0x4ecc0d){if(!_0x4ecc0d){_0x4363a8['sendStatus'](0x194);}return _0x4ecc0d;};}function handleError(_0x255def,_0x32cc00){_0x32cc00=_0x32cc00||0x1f4;return function(_0xe32862){logger[_0xe7ba('0x27')](_0xe32862[_0xe7ba('0x28')]);if(_0xe32862[_0xe7ba('0x29')]){delete _0xe32862[_0xe7ba('0x29')];}_0x255def[_0xe7ba('0x1b')](_0x32cc00)['send'](_0xe32862);};}exports[_0xe7ba('0x2a')]=function(_0x48c869,_0x102925){var _0x92fe7={},_0x369451={},_0x4bf5f9={'count':0x0,'rows':[]};var _0x587c7d=_[_0xe7ba('0x2b')](db[_0xe7ba('0x2c')][_0xe7ba('0x2d')],function(_0x20b6cd){return{'name':_0x20b6cd[_0xe7ba('0x2e')],'type':_0x20b6cd['type'][_0xe7ba('0x2f')]};});_0x369451[_0xe7ba('0x30')]=_['differenceBy'](_[_0xe7ba('0x2b')](_0x587c7d,'name'),['format']);_0x369451[_0xe7ba('0x31')]=_[_0xe7ba('0x32')](_0x48c869[_0xe7ba('0x31')]);_0x369451['filters']=_[_0xe7ba('0x33')](_0x369451['model'],_0x369451[_0xe7ba('0x31')]);_0x92fe7[_0xe7ba('0x34')]=_[_0xe7ba('0x33')](_0x369451[_0xe7ba('0x30')],qs[_0xe7ba('0x35')](_0x48c869['query'][_0xe7ba('0x35')]));_0x92fe7[_0xe7ba('0x34')]=_0x92fe7['attributes'][_0xe7ba('0x36')]?_0x92fe7[_0xe7ba('0x34')]:_0x369451[_0xe7ba('0x30')];if(!_0x48c869['query'][_0xe7ba('0x37')](_0xe7ba('0x38'))){_0x92fe7['limit']=qs[_0xe7ba('0x1e')](_0x48c869[_0xe7ba('0x31')][_0xe7ba('0x1e')]);_0x92fe7['offset']=qs[_0xe7ba('0x20')](_0x48c869[_0xe7ba('0x31')]['offset']);}_0x92fe7[_0xe7ba('0x39')]=qs[_0xe7ba('0x3a')](_0x48c869[_0xe7ba('0x31')]['sort']);_0x92fe7['where']=qs[_0xe7ba('0x3b')](_[_0xe7ba('0x3c')](_0x48c869[_0xe7ba('0x31')],_0x369451[_0xe7ba('0x3b')]),_0x587c7d);if(_0x48c869[_0xe7ba('0x31')]['filter']){_0x92fe7[_0xe7ba('0x3d')]=_[_0xe7ba('0x3e')](_0x92fe7[_0xe7ba('0x3d')],{'$or':_[_0xe7ba('0x2b')](_0x587c7d,function(_0x5e9619){if(_0x5e9619[_0xe7ba('0x3f')]!==_0xe7ba('0x40')){var _0x46e31a={};_0x46e31a[_0x5e9619[_0xe7ba('0x29')]]={'$like':'%'+_0x48c869[_0xe7ba('0x31')][_0xe7ba('0x41')]+'%'};return _0x46e31a;}})});}_0x92fe7=_[_0xe7ba('0x3e')]({},_0x92fe7,_0x48c869['options']);var _0x3429fa={'where':_0x92fe7[_0xe7ba('0x3d')]};return db[_0xe7ba('0x2c')][_0xe7ba('0x1f')](_0x3429fa)[_0xe7ba('0x26')](function(_0x3b3abe){_0x4bf5f9[_0xe7ba('0x1f')]=_0x3b3abe;if(_0x48c869[_0xe7ba('0x31')][_0xe7ba('0x42')]){_0x92fe7['include']=[{'all':!![]}];}return db[_0xe7ba('0x2c')][_0xe7ba('0x43')](_0x92fe7);})['then'](function(_0x5dae52){_0x4bf5f9[_0xe7ba('0x44')]=_0x5dae52;return _0x4bf5f9;})[_0xe7ba('0x26')](respondWithFilteredResult(_0x102925,_0x92fe7))[_0xe7ba('0x45')](handleError(_0x102925,null));};exports['show']=function(_0x249e1d,_0x82246e){var _0x3569b6={'raw':![],'where':{'id':_0x249e1d[_0xe7ba('0x46')]['id']}},_0x12770d={};_0x12770d['model']=_[_0xe7ba('0x32')](db['ScreenRecording'][_0xe7ba('0x2d')]);_0x12770d[_0xe7ba('0x31')]=_[_0xe7ba('0x32')](_0x249e1d[_0xe7ba('0x31')]);_0x12770d[_0xe7ba('0x3b')]=_[_0xe7ba('0x33')](_0x12770d[_0xe7ba('0x30')],_0x12770d[_0xe7ba('0x31')]);_0x3569b6['attributes']=_[_0xe7ba('0x33')](_0x12770d[_0xe7ba('0x30')],qs[_0xe7ba('0x35')](_0x249e1d[_0xe7ba('0x31')][_0xe7ba('0x35')]));_0x3569b6[_0xe7ba('0x34')]=_0x3569b6[_0xe7ba('0x34')][_0xe7ba('0x36')]?_0x3569b6[_0xe7ba('0x34')]:_0x12770d[_0xe7ba('0x30')];if(_0x249e1d['query'][_0xe7ba('0x42')]){_0x3569b6['include']=[{'all':!![]}];}_0x3569b6=_[_0xe7ba('0x3e')]({},_0x3569b6,_0x249e1d[_0xe7ba('0x47')]);return db[_0xe7ba('0x2c')][_0xe7ba('0x48')](_0x3569b6)[_0xe7ba('0x26')](handleEntityNotFound(_0x82246e,null))[_0xe7ba('0x26')](respondWithResult(_0x82246e,null))['catch'](handleError(_0x82246e,null));};exports[_0xe7ba('0x49')]=function(_0x1cc668,_0x3f17ed){return db[_0xe7ba('0x2c')][_0xe7ba('0x49')](_0x1cc668[_0xe7ba('0x4a')],{})[_0xe7ba('0x26')](respondWithResult(_0x3f17ed,0xc9))[_0xe7ba('0x45')](handleError(_0x3f17ed,null));};exports[_0xe7ba('0x25')]=function(_0x1189bd,_0xbe2a32){if(_0x1189bd['body']['id']){delete _0x1189bd[_0xe7ba('0x4a')]['id'];}delete _0x1189bd[_0xe7ba('0x4a')][_0xe7ba('0x4b')];delete _0x1189bd[_0xe7ba('0x4a')][_0xe7ba('0x4c')];delete _0x1189bd[_0xe7ba('0x4a')]['closedAt'];delete _0x1189bd[_0xe7ba('0x4a')][_0xe7ba('0x4d')];return db['ScreenRecording'][_0xe7ba('0x48')]({'where':{'id':_0x1189bd[_0xe7ba('0x46')]['id']}})[_0xe7ba('0x26')](handleEntityNotFound(_0xbe2a32,null))[_0xe7ba('0x26')](saveUpdates(_0x1189bd['body'],null))['then'](respondWithResult(_0xbe2a32,null))[_0xe7ba('0x45')](handleError(_0xbe2a32,null));};exports[_0xe7ba('0x4e')]=function(_0x285743,_0x5af106){return db[_0xe7ba('0x2c')][_0xe7ba('0x4e')]()[_0xe7ba('0x26')](respondWithResult(_0x5af106,null))[_0xe7ba('0x45')](handleError(_0x5af106,null));};exports[_0xe7ba('0x4f')]=function(_0x6b6f1,_0xf3a41f,_0x5e6612){var _0x2a6fdd=require(_0xe7ba('0x50'));var _0x316b51=![];var _0x5863c8={};if(_0x6b6f1[_0xe7ba('0x31')][_0xe7ba('0x3f')]&&_0x6b6f1['query'][_0xe7ba('0x3f')]===_0xe7ba('0x51')){_0x5863c8['uniqueid']=_0x6b6f1[_0xe7ba('0x46')]['id'];}else{_0x5863c8['id']=_0x6b6f1['params']['id'];}return db[_0xe7ba('0x2c')][_0xe7ba('0x48')]({'where':_0x5863c8,'attributes':['id',_0xe7ba('0x4d')],'raw':!![]})['then'](handleEntityNotFound(_0xf3a41f,null))[_0xe7ba('0x26')](function(_0x1128be){if(_0x1128be){var _0x314549=path[_0xe7ba('0x52')](config[_0xe7ba('0x53')],'server/files/screen_recordings',_0x1128be[_0xe7ba('0x4d')]);var _0x455e50=util[_0xe7ba('0x54')](_0xe7ba('0x55'),_0x314549);if(fs[_0xe7ba('0x56')](_0x455e50)){_0x316b51=!![];return _0x2a6fdd['decryptFile'](_0x455e50,_0x314549,config[_0xe7ba('0x57')][_0xe7ba('0x58')])[_0xe7ba('0x26')](function(){return _0x1128be;});}return _0x1128be;}})[_0xe7ba('0x26')](function(_0x57b23e){if(_0x57b23e){var _0x3e31c1=path[_0xe7ba('0x52')](config[_0xe7ba('0x53')],_0xe7ba('0x59'),_0x57b23e[_0xe7ba('0x4d')]);if(!fs[_0xe7ba('0x56')](_0x3e31c1)){throw new db['Sequelize'][(_0xe7ba('0x5a'))](_0xe7ba('0x5b'));}if(_0x57b23e[_0xe7ba('0x5c')]){return _0xf3a41f['download'](_0x3e31c1,_0x57b23e[_0xe7ba('0x5c')]+path[_0xe7ba('0x5d')](_0x3e31c1),function(){if(_0x316b51){fs[_0xe7ba('0x5e')](_0x3e31c1);}});}else{return _0xf3a41f[_0xe7ba('0x4f')](_0x3e31c1,function(_0x45fb0f){if(_0x316b51){fs[_0xe7ba('0x5e')](_0x3e31c1);}});}}})[_0xe7ba('0x45')](function(_0x3351d5){if(_0x3351d5[_0xe7ba('0x5f')]===_0xe7ba('0x5b')){_0xf3a41f[_0xe7ba('0x1b')](0x194)[_0xe7ba('0x60')]('Not\x20found');}else{return handleError(_0xf3a41f,null);}});};exports[_0xe7ba('0x61')]=function(_0x384cea,_0x357af4){return db['ScreenRecording'][_0xe7ba('0x48')]({'where':{'id':_0x384cea['params']['id']}})[_0xe7ba('0x26')](function(_0x194dff){if(_[_0xe7ba('0x62')](_0x194dff)){throw new ReferenceError('Entity\x20not\x20found');}return _0x194dff;})['then'](function(_0x46d06e){var _0x2812af=path[_0xe7ba('0x52')](config['root'],_0xe7ba('0x59'),_0x46d06e[_0xe7ba('0x4d')]);logger[_0xe7ba('0x63')](_0xe7ba('0x64'),_0x2812af);if(!_[_0xe7ba('0x62')](_0x46d06e['value'])&&fs[_0xe7ba('0x56')](_0x2812af)){logger[_0xe7ba('0x63')](_0xe7ba('0x65')+_0x2812af+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xe7ba('0x66')](_0x2812af);}_0x2812af=_0x2812af+_0xe7ba('0x67');if(!_[_0xe7ba('0x62')](_0x46d06e[_0xe7ba('0x4d')])&&fs[_0xe7ba('0x56')](_0x2812af)){logger[_0xe7ba('0x63')](_0xe7ba('0x65')+_0x2812af+_0xe7ba('0x68'));fs[_0xe7ba('0x66')](_0x2812af);}return _0x46d06e;})[_0xe7ba('0x26')](function(_0x5a5394){if(!_0x5a5394)throw new InternalError();return _0x5a5394[_0xe7ba('0x61')]();})[_0xe7ba('0x26')](function(){_0x357af4[_0xe7ba('0x1b')](0xcc)[_0xe7ba('0x1c')]();})['catch'](handleError(_0x357af4,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 89afc1b..b3c8888 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 _0xe8a3=['request-promise','path','../../config/environment','./screenRecording.attributes','exports','define','screen_recordings','util','../../config/logger','api','moment','bluebird'];(function(_0x4b4cea,_0x13a17a){var _0x3aa234=function(_0x36cf44){while(--_0x36cf44){_0x4b4cea['push'](_0x4b4cea['shift']());}};_0x3aa234(++_0x13a17a);}(_0xe8a3,0x67));var _0x3e8a=function(_0x23fcad,_0x2b4c2e){_0x23fcad=_0x23fcad-0x0;var _0x3e4d60=_0xe8a3[_0x23fcad];return _0x3e4d60;};'use strict';var _=require('lodash');var util=require(_0x3e8a('0x0'));var logger=require(_0x3e8a('0x1'))(_0x3e8a('0x2'));var moment=require(_0x3e8a('0x3'));var BPromise=require(_0x3e8a('0x4'));var rp=require(_0x3e8a('0x5'));var fs=require('fs');var path=require(_0x3e8a('0x6'));var rimraf=require('rimraf');var config=require(_0x3e8a('0x7'));var attributes=require(_0x3e8a('0x8'));module[_0x3e8a('0x9')]=function(_0x43af29,_0x1b922b){return _0x43af29[_0x3e8a('0xa')]('ScreenRecording',attributes,{'tableName':_0x3e8a('0xb'),'paranoid':![],'indexes':[{'name':'interactionid','fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x90a2=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ScreenRecording','interactionid'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x90a2,0x78));var _0x290a=function(_0x5eb161,_0x18dc89){_0x5eb161=_0x5eb161-0x0;var _0x217564=_0x90a2[_0x5eb161];return _0x217564;};'use strict';var _=require('lodash');var util=require(_0x290a('0x0'));var logger=require('../../config/logger')(_0x290a('0x1'));var moment=require(_0x290a('0x2'));var BPromise=require(_0x290a('0x3'));var rp=require(_0x290a('0x4'));var fs=require('fs');var path=require(_0x290a('0x5'));var rimraf=require(_0x290a('0x6'));var config=require(_0x290a('0x7'));var attributes=require('./screenRecording.attributes');module[_0x290a('0x8')]=function(_0x35ae0b,_0x5f3b16){return _0x35ae0b[_0x290a('0x9')](_0x290a('0xa'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0x290a('0xb'),'fields':[_0x290a('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 4d42372..0131a46 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 _0xa45a=['result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xa45a,0x1c9));var _0xaa45=function(_0xbc82fb,_0x313c22){_0xbc82fb=_0xbc82fb-0x0;var _0x5d293e=_0xa45a[_0xbc82fb];return _0x5d293e;};'use strict';var _=require(_0xaa45('0x0'));var util=require(_0xaa45('0x1'));var moment=require(_0xaa45('0x2'));var BPromise=require(_0xaa45('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaa45('0x4'));var db=require(_0xaa45('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xaa45('0x6'))(_0xaa45('0x7'));var config=require(_0xaa45('0x8'));var jayson=require(_0xaa45('0x9'));var client=jayson[_0xaa45('0xa')][_0xaa45('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d34d6,_0x3bbbba,_0x542a9b){return new BPromise(function(_0x143315,_0xfeac0c){return client[_0xaa45('0xc')](_0x5d34d6,_0x542a9b)[_0xaa45('0xd')](function(_0xa2aad8){logger[_0xaa45('0xe')](_0xaa45('0xf'),_0x3bbbba,_0xaa45('0x10'));logger[_0xaa45('0x11')](_0xaa45('0x12'),_0x3bbbba,'request\x20sent',JSON[_0xaa45('0x13')](_0xa2aad8));if(_0xa2aad8['error']){if(_0xa2aad8[_0xaa45('0x14')][_0xaa45('0x15')]===0x1f4){logger[_0xaa45('0x14')]('ScreenRecording,\x20%s,\x20%s',_0x3bbbba,_0xa2aad8[_0xaa45('0x14')][_0xaa45('0x16')]);return _0xfeac0c(_0xa2aad8[_0xaa45('0x14')][_0xaa45('0x16')]);}logger[_0xaa45('0x14')](_0xaa45('0xf'),_0x3bbbba,_0xa2aad8['error']['message']);return _0x143315(_0xa2aad8[_0xaa45('0x14')][_0xaa45('0x16')]);}else{logger['info'](_0xaa45('0xf'),_0x3bbbba,_0xaa45('0x10'));_0x143315(_0xa2aad8[_0xaa45('0x17')][_0xaa45('0x16')]);}})['catch'](function(_0x3af433){logger[_0xaa45('0x14')](_0xaa45('0xf'),_0x3bbbba,_0x3af433);_0xfeac0c(_0x3af433);});});} \ No newline at end of file +var _0x6487=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','ScreenRecording,\x20%s,\x20%s','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x12d013,_0x286e4c){var _0x54220c=function(_0x31d518){while(--_0x31d518){_0x12d013['push'](_0x12d013['shift']());}};_0x54220c(++_0x286e4c);}(_0x6487,0x6a));var _0x7648=function(_0x2bb428,_0x2714eb){_0x2bb428=_0x2bb428-0x0;var _0x2cba6c=_0x6487[_0x2bb428];return _0x2cba6c;};'use strict';var _=require('lodash');var util=require(_0x7648('0x0'));var moment=require('moment');var BPromise=require(_0x7648('0x1'));var rs=require(_0x7648('0x2'));var fs=require('fs');var Redis=require(_0x7648('0x3'));var db=require(_0x7648('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7648('0x5'))(_0x7648('0x6'));var config=require(_0x7648('0x7'));var jayson=require(_0x7648('0x8'));var client=jayson['client'][_0x7648('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xcfa3d3,_0x3af68e,_0x522e1d){return new BPromise(function(_0x1d0a1d,_0x5eae72){return client[_0x7648('0xa')](_0xcfa3d3,_0x522e1d)[_0x7648('0xb')](function(_0x2b57c5){logger['info'](_0x7648('0xc'),_0x3af68e,'request\x20sent');logger[_0x7648('0xd')](_0x7648('0xe'),_0x3af68e,_0x7648('0xf'),JSON[_0x7648('0x10')](_0x2b57c5));if(_0x2b57c5[_0x7648('0x11')]){if(_0x2b57c5[_0x7648('0x11')][_0x7648('0x12')]===0x1f4){logger['error'](_0x7648('0xc'),_0x3af68e,_0x2b57c5[_0x7648('0x11')]['message']);return _0x5eae72(_0x2b57c5[_0x7648('0x11')][_0x7648('0x13')]);}logger[_0x7648('0x11')](_0x7648('0xc'),_0x3af68e,_0x2b57c5[_0x7648('0x11')][_0x7648('0x13')]);return _0x1d0a1d(_0x2b57c5[_0x7648('0x11')][_0x7648('0x13')]);}else{logger[_0x7648('0x14')]('ScreenRecording,\x20%s,\x20%s',_0x3af68e,_0x7648('0xf'));_0x1d0a1d(_0x2b57c5['result'][_0x7648('0x13')]);}})[_0x7648('0x15')](function(_0x554f73){logger[_0x7648('0x11')](_0x7648('0xc'),_0x3af68e,_0x554f73);_0x5eae72(_0x554f73);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index f2c5154..421caf9 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 _0xdbf0=['logo','extname','originalname','post','/:id/logo','single','file','addLogo','format','logologin','/:id/logo_login','addLogoLogin','addPreferred','favicon','/:id/favicon','addFavicon','put','multer','util','connect-timeout','Router','../../components/auth/service','../../config/environment','./setting.controller','get','isAuthenticated','getDate','/:id','getLogo','getLogoLogin','gdpr','/:id/preferred','getFavicon','diskStorage','join','root','server/files/images/logos/','%s%s'];(function(_0x1574c5,_0x107f22){var _0x3cf252=function(_0x3547dc){while(--_0x3547dc){_0x1574c5['push'](_0x1574c5['shift']());}};_0x3cf252(++_0x107f22);}(_0xdbf0,0x1b3));var _0x0dbf=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xdbf0[_0x3e5086];return _0xfeb102;};'use strict';var multer=require(_0x0dbf('0x0'));var util=require(_0x0dbf('0x1'));var path=require('path');var timeout=require(_0x0dbf('0x2'));var express=require('express');var router=express[_0x0dbf('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0dbf('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x0dbf('0x5'));var controller=require(_0x0dbf('0x6'));router[_0x0dbf('0x7')]('/',auth[_0x0dbf('0x8')](),controller['index']);router[_0x0dbf('0x7')]('/now',controller[_0x0dbf('0x9')]);router[_0x0dbf('0x7')](_0x0dbf('0xa'),controller['show']);router[_0x0dbf('0x7')]('/:id/logo',controller[_0x0dbf('0xb')]);router['get']('/:id/logo_login',controller[_0x0dbf('0xc')]);router[_0x0dbf('0x7')]('/:id/gdpr',controller[_0x0dbf('0xd')]);router[_0x0dbf('0x7')](_0x0dbf('0xe'),controller['getPreferred']);router[_0x0dbf('0x7')]('/:id/favicon',controller[_0x0dbf('0xf')]);var upload=multer({'storage':multer[_0x0dbf('0x10')]({'destination':function(_0x3f792a,_0x17a793,_0x401ea0){_0x401ea0(null,path[_0x0dbf('0x11')](config[_0x0dbf('0x12')],_0x0dbf('0x13')));},'filename':function(_0x3122f5,_0x1e2ce4,_0x81f1b6){_0x81f1b6(null,util['format'](_0x0dbf('0x14'),_0x0dbf('0x15'),path[_0x0dbf('0x16')](_0x1e2ce4[_0x0dbf('0x17')])));}})});router[_0x0dbf('0x18')](_0x0dbf('0x19'),upload[_0x0dbf('0x1a')](_0x0dbf('0x1b')),controller[_0x0dbf('0x1c')]);var upload=multer({'storage':multer[_0x0dbf('0x10')]({'destination':function(_0x13d1c1,_0x28a13d,_0x4d711a){_0x4d711a(null,path['join'](config[_0x0dbf('0x12')],'server/files/images/logos/'));},'filename':function(_0x46d201,_0x344ebb,_0xbcac83){_0xbcac83(null,util[_0x0dbf('0x1d')](_0x0dbf('0x14'),_0x0dbf('0x1e'),path[_0x0dbf('0x16')](_0x344ebb[_0x0dbf('0x17')])));}})});router[_0x0dbf('0x18')](_0x0dbf('0x1f'),upload[_0x0dbf('0x1a')](_0x0dbf('0x1b')),controller[_0x0dbf('0x20')]);var upload=multer({'storage':multer[_0x0dbf('0x10')]({'destination':function(_0x2981e8,_0x2d250e,_0x1e98e9){_0x1e98e9(null,path[_0x0dbf('0x11')](config['root'],'server/files/images/logos/'));},'filename':function(_0x3ffb87,_0x36427c,_0x2e4aa6){_0x2e4aa6(null,util['format'](_0x0dbf('0x14'),'preferred',path['extname'](_0x36427c[_0x0dbf('0x17')])));}})});router[_0x0dbf('0x18')]('/:id/preferred',upload[_0x0dbf('0x1a')](_0x0dbf('0x1b')),controller[_0x0dbf('0x21')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2b1713,_0x6d9e49,_0x19413a){_0x19413a(null,path[_0x0dbf('0x11')](config[_0x0dbf('0x12')],'server/files/images/logos/'));},'filename':function(_0x2e5963,_0x47d44d,_0x36d689){_0x36d689(null,util[_0x0dbf('0x1d')]('%s%s',_0x0dbf('0x22'),path[_0x0dbf('0x16')](_0x47d44d['originalname'])));}})});router[_0x0dbf('0x18')](_0x0dbf('0x23'),upload[_0x0dbf('0x1a')](_0x0dbf('0x1b')),controller[_0x0dbf('0x24')]);router[_0x0dbf('0x25')](_0x0dbf('0xa'),auth['isAuthenticated'](),controller['update']);module['exports']=router; \ No newline at end of file +var _0xb562=['index','/now','getDate','/:id','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','format','%s%s','logo','originalname','post','single','logologin','file','addLogoLogin','extname','addPreferred','addFavicon','put','update','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated'];(function(_0xa01528,_0x16c4ee){var _0x84b41a=function(_0x480259){while(--_0x480259){_0xa01528['push'](_0xa01528['shift']());}};_0x84b41a(++_0x16c4ee);}(_0xb562,0x122));var _0x2b56=function(_0x12ad5e,_0xb35614){_0x12ad5e=_0x12ad5e-0x0;var _0x5241fd=_0xb562[_0x12ad5e];return _0x5241fd;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2b56('0x0'));var timeout=require(_0x2b56('0x1'));var express=require(_0x2b56('0x2'));var router=express[_0x2b56('0x3')]();var fs_extra=require(_0x2b56('0x4'));var auth=require(_0x2b56('0x5'));var interaction=require(_0x2b56('0x6'));var config=require(_0x2b56('0x7'));var controller=require(_0x2b56('0x8'));router[_0x2b56('0x9')]('/',auth[_0x2b56('0xa')](),controller[_0x2b56('0xb')]);router[_0x2b56('0x9')](_0x2b56('0xc'),controller[_0x2b56('0xd')]);router[_0x2b56('0x9')](_0x2b56('0xe'),controller[_0x2b56('0xf')]);router[_0x2b56('0x9')](_0x2b56('0x10'),controller[_0x2b56('0x11')]);router['get'](_0x2b56('0x12'),controller[_0x2b56('0x13')]);router[_0x2b56('0x9')]('/:id/gdpr',controller['gdpr']);router['get'](_0x2b56('0x14'),controller[_0x2b56('0x15')]);router[_0x2b56('0x9')](_0x2b56('0x16'),controller[_0x2b56('0x17')]);var upload=multer({'storage':multer[_0x2b56('0x18')]({'destination':function(_0x1c480c,_0xa97fd2,_0x4fcca5){_0x4fcca5(null,path[_0x2b56('0x19')](config[_0x2b56('0x1a')],_0x2b56('0x1b')));},'filename':function(_0x5b5aed,_0x37c72c,_0x50c51d){_0x50c51d(null,util[_0x2b56('0x1c')](_0x2b56('0x1d'),_0x2b56('0x1e'),path['extname'](_0x37c72c[_0x2b56('0x1f')])));}})});router[_0x2b56('0x20')](_0x2b56('0x10'),upload[_0x2b56('0x21')]('file'),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3d7c59,_0x56cf21,_0x1e2ff7){_0x1e2ff7(null,path['join'](config[_0x2b56('0x1a')],_0x2b56('0x1b')));},'filename':function(_0x17cb44,_0x5ed806,_0x21ea3a){_0x21ea3a(null,util['format'](_0x2b56('0x1d'),_0x2b56('0x22'),path['extname'](_0x5ed806['originalname'])));}})});router[_0x2b56('0x20')](_0x2b56('0x12'),upload[_0x2b56('0x21')](_0x2b56('0x23')),controller[_0x2b56('0x24')]);var upload=multer({'storage':multer[_0x2b56('0x18')]({'destination':function(_0x29a2c9,_0x4b12e4,_0x3cded2){_0x3cded2(null,path[_0x2b56('0x19')](config[_0x2b56('0x1a')],_0x2b56('0x1b')));},'filename':function(_0x506df3,_0x55b606,_0x5bd1e7){_0x5bd1e7(null,util[_0x2b56('0x1c')](_0x2b56('0x1d'),'preferred',path[_0x2b56('0x25')](_0x55b606[_0x2b56('0x1f')])));}})});router['post'](_0x2b56('0x14'),upload[_0x2b56('0x21')](_0x2b56('0x23')),controller[_0x2b56('0x26')]);var upload=multer({'storage':multer[_0x2b56('0x18')]({'destination':function(_0x5722f3,_0x3221e4,_0xae520){_0xae520(null,path['join'](config['root'],_0x2b56('0x1b')));},'filename':function(_0x58acba,_0xb78241,_0x1e1cdd){_0x1e1cdd(null,util[_0x2b56('0x1c')](_0x2b56('0x1d'),'favicon',path[_0x2b56('0x25')](_0xb78241['originalname'])));}})});router[_0x2b56('0x20')](_0x2b56('0x16'),upload[_0x2b56('0x21')](_0x2b56('0x23')),controller[_0x2b56('0x27')]);router[_0x2b56('0x28')](_0x2b56('0xe'),auth['isAuthenticated'](),controller[_0x2b56('0x29')]);module[_0x2b56('0x2a')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index fdf455a..7c499bc 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 _0x1724=['BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED','sequelize','INTEGER','min_internal','/var/opt/motion2/server/files/sounds/converted','STRING'];(function(_0x3f2303,_0x34167b){var _0x1d916e=function(_0x5a5b96){while(--_0x5a5b96){_0x3f2303['push'](_0x3f2303['shift']());}};_0x1d916e(++_0x34167b);}(_0x1724,0xca));var _0x4172=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0x1724[_0x3899d1];return _0xeb4a7d;};'use strict';var Sequelize=require(_0x4172('0x0'));module['exports']={'min_internal':{'type':Sequelize[_0x4172('0x1')](0xb),'unique':_0x4172('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x4172('0x1')](0xb),'unique':'min_mailbox','defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x4172('0x1')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize['STRING'],'defaultValue':_0x4172('0x3')},'logo':{'type':Sequelize[_0x4172('0x4')]},'defaultLogo':{'type':Sequelize[_0x4172('0x5')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x4172('0x4')]},'defaultLoginLogo':{'type':Sequelize[_0x4172('0x5')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x4172('0x5')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x4172('0x5')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x4172('0x4')]},'turnaddr':{'type':Sequelize[_0x4172('0x4')]},'turnusername':{'type':Sequelize[_0x4172('0x4')]},'turnpassword':{'type':Sequelize[_0x4172('0x4')]},'pageTitle':{'type':Sequelize[_0x4172('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x4172('0x5')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x4172('0x1')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x4172('0x5')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x4172('0x4')],'defaultValue':_0x4172('0x6')},'enableEmailPreview':{'type':Sequelize[_0x4172('0x5')],'defaultValue':![]},'split':{'type':Sequelize[_0x4172('0x5')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x4172('0x1')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x4172('0x1')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x4172('0x1')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x4172('0x4')],'defaultValue':_0x4172('0x7')},'chatTimeout':{'type':Sequelize[_0x4172('0x1')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x4172('0x5')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x4172('0x5')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x4172('0x4')]},'allowedLoginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x4172('0x1')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x4172('0x4')]},'defaultFavicon':{'type':Sequelize[_0x4172('0x5')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x4172('0x1')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x4172('0x5')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x4172('0x1')]},'transcribeRegion':{'type':Sequelize[_0x4172('0x4')]},'sentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x4172('0x5')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x4172('0x1')]},'sentimentRegion':{'type':Sequelize[_0x4172('0x4')]},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize['STRING']},'googleSsoEnabled':{'type':Sequelize[_0x4172('0x5')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x4172('0x5')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x4172('0x1')](0x2)[_0x4172('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x4172('0x1')](0x2)[_0x4172('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x4172('0x1')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x4172('0x5')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x4172('0x1')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x4172('0x1')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x4172('0x1')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x4172('0x5')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x4172('0x5')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x4172('0x5')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x4172('0x1')],'defaultValue':0x5},'disabledCookie':{'type':Sequelize[_0x4172('0x5')],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x4172('0x1')],'defaultValue':0x14}}; \ No newline at end of file +var _0x5942=['exports','INTEGER','min_internal','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED','sequelize'];(function(_0x2c1448,_0x2bd921){var _0x3e2128=function(_0x298ee6){while(--_0x298ee6){_0x2c1448['push'](_0x2c1448['shift']());}};_0x3e2128(++_0x2bd921);}(_0x5942,0x16a));var _0x2594=function(_0x5d2d6a,_0x1e291e){_0x5d2d6a=_0x5d2d6a-0x0;var _0x4d9067=_0x5942[_0x5d2d6a];return _0x4d9067;};'use strict';var Sequelize=require(_0x2594('0x0'));module[_0x2594('0x1')]={'min_internal':{'type':Sequelize[_0x2594('0x2')](0xb),'unique':_0x2594('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x2594('0x2')](0xb),'unique':_0x2594('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x2594('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x2594('0x5')],'defaultValue':_0x2594('0x6')},'logo':{'type':Sequelize[_0x2594('0x5')]},'defaultLogo':{'type':Sequelize[_0x2594('0x7')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x2594('0x5')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x2594('0x7')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x2594('0x7')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x2594('0x7')],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x2594('0x5')]},'turnusername':{'type':Sequelize[_0x2594('0x5')]},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x2594('0x5')]},'defaultPageTitle':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x2594('0x7')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x2594('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x2594('0x7')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':_0x2594('0x8')},'enableEmailPreview':{'type':Sequelize[_0x2594('0x7')],'defaultValue':![]},'split':{'type':Sequelize[_0x2594('0x7')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x2594('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x2594('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x2594('0x5')],'defaultValue':_0x2594('0x9')},'chatTimeout':{'type':Sequelize[_0x2594('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x2594('0x7')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x2594('0x5')]},'defaultPreferred':{'type':Sequelize[_0x2594('0x7')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x2594('0x7')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x2594('0x5')]},'allowedLoginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x2594('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x2594('0x5')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x2594('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x2594('0x7')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x2594('0x2')]},'transcribeRegion':{'type':Sequelize[_0x2594('0x5')]},'sentiment':{'type':Sequelize[_0x2594('0x7')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x2594('0x7')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize['INTEGER']},'sentimentRegion':{'type':Sequelize[_0x2594('0x5')]},'language':{'type':Sequelize[_0x2594('0x5')]},'bucket':{'type':Sequelize[_0x2594('0x5')]},'googleSsoEnabled':{'type':Sequelize[_0x2594('0x7')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x2594('0x7')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x2594('0x7')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x2594('0x2')](0x2)[_0x2594('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x2594('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize['INTEGER'](0x2)[_0x2594('0xa')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x2594('0x2')](0x2)[_0x2594('0xa')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x2594('0x7')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x2594('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x2594('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x2594('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x2594('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x2594('0x7')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x2594('0x7')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x2594('0x2')],'defaultValue':0x5},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x2594('0x2')],'defaultValue':0x14}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 56413be..873ec2f 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 _0xc3d6=['../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','destroy','end','name','index','map','Setting','rawAttributes','key','model','query','keys','intersection','fields','attributes','nolimit','order','sort','where','filter','merge','options','includeAll','include','rows','show','params','filters','find','body','addLogo','file','logo','filename','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','preferred','favicon','defaultLoginLogo','defaultPreferred','defaultFavicon','join','root','toLower','default_logo.svg','upperFirst','custom','existsSync','Sequelize','ValidationError','\x20not\x20found','download','defaultLogo','default_loginLogo.svg','default','gdpr','securePassword','getPreferred','default_preferred.png','addFavicon','getFavicon','getDate','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x7ac6d3,_0x5511bd){var _0xa1e3df=function(_0x308660){while(--_0x308660){_0x7ac6d3['push'](_0x7ac6d3['shift']());}};_0xa1e3df(++_0x5511bd);}(_0xc3d6,0x153));var _0x6c3d=function(_0x526cda,_0x30e4e0){_0x526cda=_0x526cda-0x0;var _0xc8cb9f=_0xc3d6[_0x526cda];return _0xc8cb9f;};'use strict';var emlformat=require(_0x6c3d('0x0'));var rimraf=require(_0x6c3d('0x1'));var zipdir=require(_0x6c3d('0x2'));var jsonpatch=require(_0x6c3d('0x3'));var rp=require(_0x6c3d('0x4'));var moment=require(_0x6c3d('0x5'));var BPromise=require(_0x6c3d('0x6'));var Mustache=require(_0x6c3d('0x7'));var util=require(_0x6c3d('0x8'));var path=require(_0x6c3d('0x9'));var sox=require('sox');var csv=require(_0x6c3d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6c3d('0xb'));var _=require('lodash');var squel=require(_0x6c3d('0xc'));var crypto=require(_0x6c3d('0xd'));var jsforce=require(_0x6c3d('0xe'));var deskjs=require(_0x6c3d('0xf'));var toCsv=require(_0x6c3d('0xa'));var querystring=require(_0x6c3d('0x10'));var Papa=require(_0x6c3d('0x11'));var Redis=require(_0x6c3d('0x12'));var authService=require(_0x6c3d('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x6c3d('0x14'));var hardwareService=require(_0x6c3d('0x15'));var logger=require('../../config/logger')(_0x6c3d('0x16'));var utils=require(_0x6c3d('0x17'));var config=require(_0x6c3d('0x18'));var licenseUtil=require(_0x6c3d('0x19'));var db=require(_0x6c3d('0x1a'))['db'];var jayson=require(_0x6c3d('0x1b'));var client=jayson[_0x6c3d('0x1c')][_0x6c3d('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x3e31d9,_0x43a9a6,_0x57f277,_0x2b0ec3){return new BPromise(function(_0x306341,_0x373519){var _0xddee73=_0x2b0ec3||client;return _0xddee73[_0x6c3d('0x1e')](_0x3e31d9,_0x57f277)[_0x6c3d('0x1f')](function(_0x4454c8){logger[_0x6c3d('0x20')](_0x6c3d('0x21'),_0x43a9a6,_0x6c3d('0x22'));logger[_0x6c3d('0x23')]('Setting,\x20%s,\x20%s,\x20%s',_0x43a9a6,_0x6c3d('0x22'),JSON[_0x6c3d('0x24')](_0x4454c8));if(_0x4454c8[_0x6c3d('0x25')]){if(_0x4454c8[_0x6c3d('0x25')]['code']===0x1f4){logger[_0x6c3d('0x25')](_0x6c3d('0x21'),_0x43a9a6,_0x4454c8['error'][_0x6c3d('0x26')]);return _0x373519(_0x4454c8[_0x6c3d('0x25')][_0x6c3d('0x26')]);}logger[_0x6c3d('0x25')](_0x6c3d('0x21'),_0x43a9a6,_0x4454c8[_0x6c3d('0x25')]['message']);return _0x306341(_0x4454c8[_0x6c3d('0x25')][_0x6c3d('0x26')]);}else{logger[_0x6c3d('0x20')]('Setting,\x20%s,\x20%s',_0x43a9a6,'request\x20sent');_0x306341(_0x4454c8[_0x6c3d('0x27')][_0x6c3d('0x26')]);}})[_0x6c3d('0x28')](function(_0x28c203){logger['error'](_0x6c3d('0x21'),_0x43a9a6,_0x28c203);_0x373519(_0x28c203);});});}function respondWithStatusCode(_0xb1b565,_0x546433){_0x546433=_0x546433||0xcc;return function(_0x4c94be){if(_0x4c94be){return _0xb1b565[_0x6c3d('0x29')](_0x546433);}return _0xb1b565['status'](_0x546433)['end']();};}function respondWithResult(_0x422fcf,_0x28aeb3){_0x28aeb3=_0x28aeb3||0xc8;return function(_0x40b4c4){if(_0x40b4c4){return _0x422fcf[_0x6c3d('0x2a')](_0x28aeb3)[_0x6c3d('0x2b')](_0x40b4c4);}};}function respondWithFilteredResult(_0x27ba54,_0x9ae845){return function(_0x1f4846){if(_0x1f4846){var _0x4e9eda=typeof _0x9ae845[_0x6c3d('0x2c')]==='undefined'&&typeof _0x9ae845[_0x6c3d('0x2d')]===_0x6c3d('0x2e');var _0x2f3897=_0x1f4846[_0x6c3d('0x2f')];var _0x2a4557=_0x4e9eda?0x0:_0x9ae845[_0x6c3d('0x2c')];var _0x3253df=_0x4e9eda?_0x1f4846['count']:_0x9ae845['offset']+_0x9ae845[_0x6c3d('0x2d')];var _0x469c65;if(_0x3253df>=_0x2f3897){_0x3253df=_0x2f3897;_0x469c65=0xc8;}else{_0x469c65=0xce;}_0x27ba54[_0x6c3d('0x2a')](_0x469c65);return _0x27ba54[_0x6c3d('0x30')](_0x6c3d('0x31'),_0x2a4557+'-'+_0x3253df+'/'+_0x2f3897)[_0x6c3d('0x2b')](_0x1f4846);}return null;};}function patchUpdates(_0x160d6d){return function(_0x8dfdda){try{jsonpatch[_0x6c3d('0x32')](_0x8dfdda,_0x160d6d,!![]);}catch(_0x29b8e1){return BPromise[_0x6c3d('0x33')](_0x29b8e1);}return _0x8dfdda['save']();};}function saveUpdates(_0x5c6ff1,_0x116b8e){return function(_0x114918){if(_0x114918){return _0x114918[_0x6c3d('0x34')](_0x5c6ff1)['then'](function(_0x4a1513){return _0x4a1513;});}return null;};}function removeEntity(_0x48320a,_0x571201){return function(_0x46942d){if(_0x46942d){return _0x46942d[_0x6c3d('0x35')]()[_0x6c3d('0x1f')](function(){_0x48320a['status'](0xcc)[_0x6c3d('0x36')]();});}};}function handleEntityNotFound(_0xd96415,_0x261022){return function(_0x5247a4){if(!_0x5247a4){_0xd96415[_0x6c3d('0x29')](0x194);}return _0x5247a4;};}function handleError(_0x20f1cc,_0x9142ab){_0x9142ab=_0x9142ab||0x1f4;return function(_0x159f59){logger[_0x6c3d('0x25')](_0x159f59['stack']);if(_0x159f59[_0x6c3d('0x37')]){delete _0x159f59[_0x6c3d('0x37')];}_0x20f1cc[_0x6c3d('0x2a')](_0x9142ab)['send'](_0x159f59);};}exports[_0x6c3d('0x38')]=function(_0x405db3,_0x3b6776){var _0x4dc7d7={},_0x4b8b34={},_0x441ea5={'count':0x0,'rows':[]};var _0x460395=_[_0x6c3d('0x39')](db[_0x6c3d('0x3a')][_0x6c3d('0x3b')],function(_0x36c343){return{'name':_0x36c343['fieldName'],'type':_0x36c343['type'][_0x6c3d('0x3c')]};});_0x4b8b34[_0x6c3d('0x3d')]=_[_0x6c3d('0x39')](_0x460395,_0x6c3d('0x37'));_0x4b8b34[_0x6c3d('0x3e')]=_[_0x6c3d('0x3f')](_0x405db3['query']);_0x4b8b34['filters']=_[_0x6c3d('0x40')](_0x4b8b34[_0x6c3d('0x3d')],_0x4b8b34['query']);_0x4dc7d7['attributes']=_['intersection'](_0x4b8b34[_0x6c3d('0x3d')],qs[_0x6c3d('0x41')](_0x405db3[_0x6c3d('0x3e')][_0x6c3d('0x41')]));_0x4dc7d7[_0x6c3d('0x42')]=_0x4dc7d7['attributes']['length']?_0x4dc7d7['attributes']:_0x4b8b34[_0x6c3d('0x3d')];if(!_0x405db3[_0x6c3d('0x3e')]['hasOwnProperty'](_0x6c3d('0x43'))){_0x4dc7d7[_0x6c3d('0x2d')]=qs[_0x6c3d('0x2d')](_0x405db3['query']['limit']);_0x4dc7d7['offset']=qs[_0x6c3d('0x2c')](_0x405db3[_0x6c3d('0x3e')][_0x6c3d('0x2c')]);}_0x4dc7d7[_0x6c3d('0x44')]=qs[_0x6c3d('0x45')](_0x405db3['query'][_0x6c3d('0x45')]);_0x4dc7d7[_0x6c3d('0x46')]=qs['filters'](_['pick'](_0x405db3[_0x6c3d('0x3e')],_0x4b8b34['filters']),_0x460395);if(_0x405db3[_0x6c3d('0x3e')][_0x6c3d('0x47')]){_0x4dc7d7[_0x6c3d('0x46')]=_[_0x6c3d('0x48')](_0x4dc7d7[_0x6c3d('0x46')],{'$or':_[_0x6c3d('0x39')](_0x460395,function(_0x4fa1c3){if(_0x4fa1c3['type']!=='VIRTUAL'){var _0x6bb42a={};_0x6bb42a[_0x4fa1c3[_0x6c3d('0x37')]]={'$like':'%'+_0x405db3[_0x6c3d('0x3e')]['filter']+'%'};return _0x6bb42a;}})});}_0x4dc7d7=_['merge']({},_0x4dc7d7,_0x405db3[_0x6c3d('0x49')]);var _0x57f8db={'where':_0x4dc7d7[_0x6c3d('0x46')]};return db[_0x6c3d('0x3a')][_0x6c3d('0x2f')](_0x57f8db)[_0x6c3d('0x1f')](function(_0x18c0b5){_0x441ea5['count']=_0x18c0b5;if(_0x405db3[_0x6c3d('0x3e')][_0x6c3d('0x4a')]){_0x4dc7d7[_0x6c3d('0x4b')]=[{'all':!![]}];}return db[_0x6c3d('0x3a')]['findAll'](_0x4dc7d7);})[_0x6c3d('0x1f')](function(_0x2377bb){_0x441ea5[_0x6c3d('0x4c')]=_0x2377bb;return _0x441ea5;})[_0x6c3d('0x1f')](respondWithFilteredResult(_0x3b6776,_0x4dc7d7))[_0x6c3d('0x28')](handleError(_0x3b6776,null));};exports[_0x6c3d('0x4d')]=function(_0x554b90,_0x399bcd){var _0x1ad558={'raw':![],'where':{'id':_0x554b90[_0x6c3d('0x4e')]['id']}},_0x3c50b2={};_0x3c50b2[_0x6c3d('0x3d')]=_[_0x6c3d('0x3f')](db[_0x6c3d('0x3a')][_0x6c3d('0x3b')]);_0x3c50b2[_0x6c3d('0x3e')]=_['keys'](_0x554b90['query']);_0x3c50b2[_0x6c3d('0x4f')]=_[_0x6c3d('0x40')](_0x3c50b2[_0x6c3d('0x3d')],_0x3c50b2[_0x6c3d('0x3e')]);_0x1ad558[_0x6c3d('0x42')]=_['intersection'](_0x3c50b2[_0x6c3d('0x3d')],qs[_0x6c3d('0x41')](_0x554b90[_0x6c3d('0x3e')][_0x6c3d('0x41')]));_0x1ad558[_0x6c3d('0x42')]=_0x1ad558[_0x6c3d('0x42')]['length']?_0x1ad558[_0x6c3d('0x42')]:_0x3c50b2['model'];if(_0x554b90[_0x6c3d('0x3e')][_0x6c3d('0x4a')]){_0x1ad558['include']=[{'all':!![]}];}_0x1ad558=_['merge']({},_0x1ad558,_0x554b90['options']);return db[_0x6c3d('0x3a')][_0x6c3d('0x50')](_0x1ad558)[_0x6c3d('0x1f')](handleEntityNotFound(_0x399bcd,null))['then'](respondWithResult(_0x399bcd,null))[_0x6c3d('0x28')](handleError(_0x399bcd,null));};exports[_0x6c3d('0x34')]=function(_0x724d1d,_0x50a8c2){if(_0x724d1d[_0x6c3d('0x51')]['id']){delete _0x724d1d[_0x6c3d('0x51')]['id'];}return db[_0x6c3d('0x3a')]['find']({'where':{'id':_0x724d1d['params']['id']}})[_0x6c3d('0x1f')](handleEntityNotFound(_0x50a8c2,null))[_0x6c3d('0x1f')](saveUpdates(_0x724d1d[_0x6c3d('0x51')],null))[_0x6c3d('0x1f')](respondWithResult(_0x50a8c2,null))[_0x6c3d('0x28')](handleError(_0x50a8c2,null));};exports[_0x6c3d('0x52')]=function(_0x543cb0,_0x3cae11,_0x104277){if(_0x543cb0[_0x6c3d('0x53')]&&_0x543cb0[_0x6c3d('0x53')]['filename']){_0x543cb0['body'][_0x6c3d('0x54')]=_0x543cb0[_0x6c3d('0x53')][_0x6c3d('0x55')];}return db[_0x6c3d('0x3a')][_0x6c3d('0x50')]({'where':{'id':_0x543cb0[_0x6c3d('0x4e')]['id']}})[_0x6c3d('0x1f')](handleEntityNotFound(_0x3cae11,null))[_0x6c3d('0x1f')](saveUpdates(_0x543cb0[_0x6c3d('0x51')],null))[_0x6c3d('0x1f')](respondWithResult(_0x3cae11,null))['catch'](handleError(_0x3cae11,null));};exports[_0x6c3d('0x56')]=function(_0x49c4cf,_0xa27c65,_0x19c682){if(_0x49c4cf[_0x6c3d('0x53')]&&_0x49c4cf[_0x6c3d('0x53')][_0x6c3d('0x55')]){_0x49c4cf['body'][_0x6c3d('0x57')]=_0x49c4cf[_0x6c3d('0x53')][_0x6c3d('0x55')];}return db[_0x6c3d('0x3a')][_0x6c3d('0x50')]({'where':{'id':_0x49c4cf['params']['id']}})['then'](handleEntityNotFound(_0xa27c65,null))[_0x6c3d('0x1f')](saveUpdates(_0x49c4cf[_0x6c3d('0x51')],null))['then'](respondWithResult(_0xa27c65,null))[_0x6c3d('0x28')](handleError(_0xa27c65,null));};var utilLicense=require(_0x6c3d('0x19'));exports[_0x6c3d('0x58')]=function(_0x9eef00,_0x1a2489,_0x228bc7){var _0x56874a=_0x6c3d('0x59');var _0x2ae7c4={'custom':![]};return utilLicense[_0x6c3d('0x5a')]()[_0x6c3d('0x1f')](function(_0x1ef826){if(_0x1ef826){_0x2ae7c4=_0x1ef826;}return db[_0x6c3d('0x3a')][_0x6c3d('0x50')]({'where':{'id':_0x9eef00[_0x6c3d('0x4e')]['id']},'attributes':['logo',_0x6c3d('0x57'),_0x6c3d('0x5b'),_0x6c3d('0x5c'),'defaultLogo',_0x6c3d('0x5d'),_0x6c3d('0x5e'),_0x6c3d('0x5f')],'raw':!![]});})[_0x6c3d('0x1f')](handleEntityNotFound(_0x1a2489,null))['then'](function(_0x26db86){if(_0x26db86){var _0x199fde=_0x26db86[_0x6c3d('0x54')]&&fs['existsSync'](path[_0x6c3d('0x60')](config[_0x6c3d('0x61')],_0x56874a,_['toLower'](_0x26db86[_0x6c3d('0x54')])))?path['join'](config[_0x6c3d('0x61')],_0x56874a,_['toLower'](_0x26db86[_0x6c3d('0x54')])):path['join'](config['root'],_0x56874a,_[_0x6c3d('0x62')](_0x6c3d('0x63')));var _0x3eb38a='default'+_[_0x6c3d('0x64')](_0x6c3d('0x54'));if(_0x26db86[_0x3eb38a]||!_0x2ae7c4[_0x6c3d('0x65')]){_0x199fde=path[_0x6c3d('0x60')](config[_0x6c3d('0x61')],_0x56874a,_[_0x6c3d('0x62')](_0x6c3d('0x63')));}if(!fs[_0x6c3d('0x66')](_0x199fde)){throw new db[(_0x6c3d('0x67'))][(_0x6c3d('0x68'))](_['upperFirst'](_0x6c3d('0x54'))+_0x6c3d('0x69'));}return _0x1a2489[_0x6c3d('0x6a')](_0x199fde);}})['catch'](handleError(_0x1a2489,null));};var utilLicense=require(_0x6c3d('0x19'));exports['getLogoLogin']=function(_0x1622af,_0x1da333,_0x6e8109){var _0x939cfc=_0x6c3d('0x59');var _0x3eb992={'custom':![]};return utilLicense[_0x6c3d('0x5a')]()[_0x6c3d('0x1f')](function(_0x55126a){if(_0x55126a){_0x3eb992=_0x55126a;}return db[_0x6c3d('0x3a')]['find']({'where':{'id':_0x1622af[_0x6c3d('0x4e')]['id']},'attributes':[_0x6c3d('0x54'),'loginLogo',_0x6c3d('0x5b'),_0x6c3d('0x5c'),_0x6c3d('0x6b'),_0x6c3d('0x5d'),_0x6c3d('0x5e'),'defaultFavicon'],'raw':!![]});})[_0x6c3d('0x1f')](handleEntityNotFound(_0x1da333,null))['then'](function(_0x203be8){if(_0x203be8){var _0x38fbcb=_0x203be8[_0x6c3d('0x57')]&&fs[_0x6c3d('0x66')](path[_0x6c3d('0x60')](config[_0x6c3d('0x61')],_0x939cfc,_['toLower'](_0x203be8[_0x6c3d('0x57')])))?path[_0x6c3d('0x60')](config[_0x6c3d('0x61')],_0x939cfc,_[_0x6c3d('0x62')](_0x203be8[_0x6c3d('0x57')])):path['join'](config['root'],_0x939cfc,_['toLower'](_0x6c3d('0x6c')));var _0x2740b7=_0x6c3d('0x6d')+_['upperFirst'](_0x6c3d('0x57'));if(_0x203be8[_0x2740b7]||!_0x3eb992['custom']){_0x38fbcb=path[_0x6c3d('0x60')](config[_0x6c3d('0x61')],_0x939cfc,_[_0x6c3d('0x62')]('default_loginLogo.svg'));}if(!fs[_0x6c3d('0x66')](_0x38fbcb)){throw new db[(_0x6c3d('0x67'))][(_0x6c3d('0x68'))](_['upperFirst'](_0x6c3d('0x57'))+_0x6c3d('0x69'));}return _0x1da333['download'](_0x38fbcb);}})[_0x6c3d('0x28')](handleError(_0x1da333,null));};exports[_0x6c3d('0x6e')]=function(_0x2af916,_0x39efcc){return db[_0x6c3d('0x3a')]['find']({'where':{'id':_0x2af916['params']['id']},'attributes':[_0x6c3d('0x6f')]})[_0x6c3d('0x1f')](respondWithResult(_0x39efcc,null))['catch'](handleError(_0x39efcc,null));};exports['addPreferred']=function(_0x439542,_0x44ee2a,_0x32c8ed){if(_0x439542[_0x6c3d('0x53')]&&_0x439542[_0x6c3d('0x53')]['filename']){_0x439542[_0x6c3d('0x51')][_0x6c3d('0x5b')]=_0x439542[_0x6c3d('0x53')][_0x6c3d('0x55')];}return db[_0x6c3d('0x3a')][_0x6c3d('0x50')]({'where':{'id':_0x439542['params']['id']}})[_0x6c3d('0x1f')](handleEntityNotFound(_0x44ee2a,null))[_0x6c3d('0x1f')](saveUpdates(_0x439542['body'],null))[_0x6c3d('0x1f')](respondWithResult(_0x44ee2a,null))[_0x6c3d('0x28')](handleError(_0x44ee2a,null));};var utilLicense=require(_0x6c3d('0x19'));exports[_0x6c3d('0x70')]=function(_0x536ecc,_0x355df3,_0x587345){var _0x1cbe7b=_0x6c3d('0x59');var _0x406e6d={'custom':![]};return utilLicense['getLicense']()[_0x6c3d('0x1f')](function(_0x29bc1d){if(_0x29bc1d){_0x406e6d=_0x29bc1d;}return db[_0x6c3d('0x3a')][_0x6c3d('0x50')]({'where':{'id':_0x536ecc[_0x6c3d('0x4e')]['id']},'attributes':['logo',_0x6c3d('0x57'),_0x6c3d('0x5b'),'favicon','defaultLogo',_0x6c3d('0x5d'),_0x6c3d('0x5e'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x355df3,null))['then'](function(_0x47098e){if(_0x47098e){var _0xa8c94e=_0x47098e[_0x6c3d('0x5b')]&&fs[_0x6c3d('0x66')](path[_0x6c3d('0x60')](config[_0x6c3d('0x61')],_0x1cbe7b,_['toLower'](_0x47098e[_0x6c3d('0x5b')])))?path[_0x6c3d('0x60')](config[_0x6c3d('0x61')],_0x1cbe7b,_[_0x6c3d('0x62')](_0x47098e[_0x6c3d('0x5b')])):path[_0x6c3d('0x60')](config[_0x6c3d('0x61')],_0x1cbe7b,_[_0x6c3d('0x62')](_0x6c3d('0x71')));var _0x2977b4='default'+_[_0x6c3d('0x64')](_0x6c3d('0x5b'));if(_0x47098e[_0x2977b4]||!_0x406e6d[_0x6c3d('0x65')]||!_0x406e6d[_0x6c3d('0x5b')]){_0xa8c94e=path[_0x6c3d('0x60')](config['root'],_0x1cbe7b,_[_0x6c3d('0x62')](_0x6c3d('0x71')));}if(!fs[_0x6c3d('0x66')](_0xa8c94e)){throw new db['Sequelize'][(_0x6c3d('0x68'))](_['upperFirst']('preferred')+_0x6c3d('0x69'));}return _0x355df3[_0x6c3d('0x6a')](_0xa8c94e);}})[_0x6c3d('0x28')](handleError(_0x355df3,null));};exports[_0x6c3d('0x72')]=function(_0x2a014d,_0x3935b6,_0x122d17){if(_0x2a014d['file']&&_0x2a014d[_0x6c3d('0x53')][_0x6c3d('0x55')]){_0x2a014d[_0x6c3d('0x51')][_0x6c3d('0x5c')]=_0x2a014d[_0x6c3d('0x53')][_0x6c3d('0x55')];}return db[_0x6c3d('0x3a')][_0x6c3d('0x50')]({'where':{'id':_0x2a014d[_0x6c3d('0x4e')]['id']}})[_0x6c3d('0x1f')](handleEntityNotFound(_0x3935b6,null))[_0x6c3d('0x1f')](saveUpdates(_0x2a014d[_0x6c3d('0x51')],null))[_0x6c3d('0x1f')](respondWithResult(_0x3935b6,null))[_0x6c3d('0x28')](handleError(_0x3935b6,null));};var utilLicense=require(_0x6c3d('0x19'));exports[_0x6c3d('0x73')]=function(_0x18133f,_0x2f0df6,_0x551c8b){var _0xd3c420=_0x6c3d('0x59');var _0x2a010a={'custom':![]};return utilLicense[_0x6c3d('0x5a')]()['then'](function(_0x3e005e){if(_0x3e005e){_0x2a010a=_0x3e005e;}return db[_0x6c3d('0x3a')]['find']({'where':{'id':_0x18133f[_0x6c3d('0x4e')]['id']},'attributes':[_0x6c3d('0x54'),'loginLogo',_0x6c3d('0x5b'),_0x6c3d('0x5c'),'defaultLogo',_0x6c3d('0x5d'),_0x6c3d('0x5e'),_0x6c3d('0x5f')],'raw':!![]});})[_0x6c3d('0x1f')](handleEntityNotFound(_0x2f0df6,null))[_0x6c3d('0x1f')](function(_0x122c07){if(_0x122c07){var _0x58c565=_0x122c07[_0x6c3d('0x5c')]&&fs[_0x6c3d('0x66')](path[_0x6c3d('0x60')](config[_0x6c3d('0x61')],_0xd3c420,_[_0x6c3d('0x62')](_0x122c07[_0x6c3d('0x5c')])))?path[_0x6c3d('0x60')](config[_0x6c3d('0x61')],_0xd3c420,_['toLower'](_0x122c07[_0x6c3d('0x5c')])):path[_0x6c3d('0x60')](config[_0x6c3d('0x61')],_0xd3c420,_[_0x6c3d('0x62')]('default_favicon.ico'));var _0x107c8c='default'+_['upperFirst'](_0x6c3d('0x5c'));if(_0x122c07[_0x107c8c]||!_0x2a010a[_0x6c3d('0x65')]){_0x58c565=path[_0x6c3d('0x60')](config[_0x6c3d('0x61')],_0xd3c420,_[_0x6c3d('0x62')]('default_favicon.ico'));}if(!fs[_0x6c3d('0x66')](_0x58c565)){throw new db[(_0x6c3d('0x67'))][(_0x6c3d('0x68'))](_[_0x6c3d('0x64')](_0x6c3d('0x5c'))+_0x6c3d('0x69'));}return _0x2f0df6[_0x6c3d('0x6a')](_0x58c565);}})[_0x6c3d('0x28')](handleError(_0x2f0df6,null));};exports[_0x6c3d('0x74')]=function(_0x14c947,_0x2511d9){var _0x3d4530={'offset':moment()[_0x6c3d('0x75')]()};_0x3d4530['now']=moment()[_0x6c3d('0x75')](_0x3d4530[_0x6c3d('0x2c')])[_0x6c3d('0x76')](_0x6c3d('0x77'));return _0x2511d9['status'](0xc8)['send'](_0x3d4530);}; \ No newline at end of file +var _0xafa8=['key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','merge','where','filter','options','includeAll','include','findAll','catch','show','length','find','body','addLogo','file','filename','logo','params','loginLogo','getLogo','server/files/images/logos','getLicense','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','existsSync','join','root','toLower','default','upperFirst','custom','default_logo.svg','Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin','default_loginLogo.svg','gdpr','securePassword','getPreferred','defaultFavicon','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','now','YYYY-MM-DD\x20HH:mm:ss:SSS','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','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','jayson/promise','client','http','request','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','end','offset','limit','undefined','count','json','apply','save','update','then','sendStatus','stack','name','map','Setting','rawAttributes','fieldName','type'];(function(_0x51329d,_0x100bf0){var _0x333256=function(_0xee0bea){while(--_0xee0bea){_0x51329d['push'](_0x51329d['shift']());}};_0x333256(++_0x100bf0);}(_0xafa8,0x135));var _0x8afa=function(_0x37b3e5,_0x33b516){_0x37b3e5=_0x37b3e5-0x0;var _0x207f20=_0xafa8[_0x37b3e5];return _0x207f20;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8afa('0x0'));var zipdir=require(_0x8afa('0x1'));var jsonpatch=require(_0x8afa('0x2'));var rp=require(_0x8afa('0x3'));var moment=require(_0x8afa('0x4'));var BPromise=require(_0x8afa('0x5'));var Mustache=require(_0x8afa('0x6'));var util=require('util');var path=require(_0x8afa('0x7'));var sox=require('sox');var csv=require(_0x8afa('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8afa('0x9'));var squel=require(_0x8afa('0xa'));var crypto=require(_0x8afa('0xb'));var jsforce=require(_0x8afa('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8afa('0x8'));var querystring=require(_0x8afa('0xd'));var Papa=require(_0x8afa('0xe'));var Redis=require(_0x8afa('0xf'));var authService=require(_0x8afa('0x10'));var qs=require(_0x8afa('0x11'));var as=require(_0x8afa('0x12'));var hardwareService=require(_0x8afa('0x13'));var logger=require(_0x8afa('0x14'))('api');var utils=require(_0x8afa('0x15'));var config=require(_0x8afa('0x16'));var licenseUtil=require(_0x8afa('0x17'));var db=require(_0x8afa('0x18'))['db'];var jayson=require(_0x8afa('0x19'));var client=jayson[_0x8afa('0x1a')][_0x8afa('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0xdb432a,_0x471e33,_0x5a131f,_0x2b78b){return new BPromise(function(_0x522ec9,_0xc468a0){var _0x39a113=_0x2b78b||client;return _0x39a113[_0x8afa('0x1c')](_0xdb432a,_0x5a131f)['then'](function(_0x6ebbce){logger[_0x8afa('0x1d')](_0x8afa('0x1e'),_0x471e33,_0x8afa('0x1f'));logger['debug'](_0x8afa('0x20'),_0x471e33,_0x8afa('0x1f'),JSON[_0x8afa('0x21')](_0x6ebbce));if(_0x6ebbce['error']){if(_0x6ebbce[_0x8afa('0x22')][_0x8afa('0x23')]===0x1f4){logger[_0x8afa('0x22')](_0x8afa('0x1e'),_0x471e33,_0x6ebbce[_0x8afa('0x22')][_0x8afa('0x24')]);return _0xc468a0(_0x6ebbce[_0x8afa('0x22')]['message']);}logger[_0x8afa('0x22')](_0x8afa('0x1e'),_0x471e33,_0x6ebbce[_0x8afa('0x22')][_0x8afa('0x24')]);return _0x522ec9(_0x6ebbce[_0x8afa('0x22')]['message']);}else{logger['info'](_0x8afa('0x1e'),_0x471e33,'request\x20sent');_0x522ec9(_0x6ebbce[_0x8afa('0x25')][_0x8afa('0x24')]);}})['catch'](function(_0x1f0fac){logger[_0x8afa('0x22')](_0x8afa('0x1e'),_0x471e33,_0x1f0fac);_0xc468a0(_0x1f0fac);});});}function respondWithStatusCode(_0x302013,_0x47896f){_0x47896f=_0x47896f||0xcc;return function(_0x3b7cf2){if(_0x3b7cf2){return _0x302013['sendStatus'](_0x47896f);}return _0x302013[_0x8afa('0x26')](_0x47896f)[_0x8afa('0x27')]();};}function respondWithResult(_0x1c48fa,_0x599777){_0x599777=_0x599777||0xc8;return function(_0xdde12){if(_0xdde12){return _0x1c48fa['status'](_0x599777)['json'](_0xdde12);}};}function respondWithFilteredResult(_0x29805d,_0x58ff48){return function(_0x3ced14){if(_0x3ced14){var _0x229f34=typeof _0x58ff48[_0x8afa('0x28')]==='undefined'&&typeof _0x58ff48[_0x8afa('0x29')]===_0x8afa('0x2a');var _0x8a419=_0x3ced14[_0x8afa('0x2b')];var _0x2be75b=_0x229f34?0x0:_0x58ff48[_0x8afa('0x28')];var _0x1292c7=_0x229f34?_0x3ced14[_0x8afa('0x2b')]:_0x58ff48[_0x8afa('0x28')]+_0x58ff48['limit'];var _0x43d3c2;if(_0x1292c7>=_0x8a419){_0x1292c7=_0x8a419;_0x43d3c2=0xc8;}else{_0x43d3c2=0xce;}_0x29805d[_0x8afa('0x26')](_0x43d3c2);return _0x29805d['set']('Content-Range',_0x2be75b+'-'+_0x1292c7+'/'+_0x8a419)[_0x8afa('0x2c')](_0x3ced14);}return null;};}function patchUpdates(_0x4f6297){return function(_0x26a1e9){try{jsonpatch[_0x8afa('0x2d')](_0x26a1e9,_0x4f6297,!![]);}catch(_0x3e0cc7){return BPromise['reject'](_0x3e0cc7);}return _0x26a1e9[_0x8afa('0x2e')]();};}function saveUpdates(_0x309864,_0x5e7a6b){return function(_0x430e2c){if(_0x430e2c){return _0x430e2c[_0x8afa('0x2f')](_0x309864)[_0x8afa('0x30')](function(_0x27c0a0){return _0x27c0a0;});}return null;};}function removeEntity(_0x5cb6b0,_0x4499e7){return function(_0x58551f){if(_0x58551f){return _0x58551f['destroy']()['then'](function(){_0x5cb6b0[_0x8afa('0x26')](0xcc)[_0x8afa('0x27')]();});}};}function handleEntityNotFound(_0x5a0a4e,_0x40142e){return function(_0x3b3e10){if(!_0x3b3e10){_0x5a0a4e[_0x8afa('0x31')](0x194);}return _0x3b3e10;};}function handleError(_0x4f06c0,_0x4ce2e2){_0x4ce2e2=_0x4ce2e2||0x1f4;return function(_0x4e3f4a){logger[_0x8afa('0x22')](_0x4e3f4a[_0x8afa('0x32')]);if(_0x4e3f4a[_0x8afa('0x33')]){delete _0x4e3f4a[_0x8afa('0x33')];}_0x4f06c0['status'](_0x4ce2e2)['send'](_0x4e3f4a);};}exports['index']=function(_0x354c1c,_0x11a0aa){var _0x1be4ec={},_0x5a1c8b={},_0x3ddb1e={'count':0x0,'rows':[]};var _0x569667=_[_0x8afa('0x34')](db[_0x8afa('0x35')][_0x8afa('0x36')],function(_0x349e87){return{'name':_0x349e87[_0x8afa('0x37')],'type':_0x349e87[_0x8afa('0x38')][_0x8afa('0x39')]};});_0x5a1c8b['model']=_[_0x8afa('0x34')](_0x569667,_0x8afa('0x33'));_0x5a1c8b[_0x8afa('0x3a')]=_[_0x8afa('0x3b')](_0x354c1c[_0x8afa('0x3a')]);_0x5a1c8b[_0x8afa('0x3c')]=_[_0x8afa('0x3d')](_0x5a1c8b[_0x8afa('0x3e')],_0x5a1c8b[_0x8afa('0x3a')]);_0x1be4ec[_0x8afa('0x3f')]=_[_0x8afa('0x3d')](_0x5a1c8b['model'],qs[_0x8afa('0x40')](_0x354c1c['query'][_0x8afa('0x40')]));_0x1be4ec['attributes']=_0x1be4ec[_0x8afa('0x3f')]['length']?_0x1be4ec[_0x8afa('0x3f')]:_0x5a1c8b['model'];if(!_0x354c1c['query'][_0x8afa('0x41')](_0x8afa('0x42'))){_0x1be4ec[_0x8afa('0x29')]=qs[_0x8afa('0x29')](_0x354c1c[_0x8afa('0x3a')][_0x8afa('0x29')]);_0x1be4ec[_0x8afa('0x28')]=qs[_0x8afa('0x28')](_0x354c1c[_0x8afa('0x3a')][_0x8afa('0x28')]);}_0x1be4ec[_0x8afa('0x43')]=qs[_0x8afa('0x44')](_0x354c1c[_0x8afa('0x3a')][_0x8afa('0x44')]);_0x1be4ec['where']=qs[_0x8afa('0x3c')](_[_0x8afa('0x45')](_0x354c1c[_0x8afa('0x3a')],_0x5a1c8b[_0x8afa('0x3c')]),_0x569667);if(_0x354c1c[_0x8afa('0x3a')]['filter']){_0x1be4ec['where']=_[_0x8afa('0x46')](_0x1be4ec[_0x8afa('0x47')],{'$or':_[_0x8afa('0x34')](_0x569667,function(_0x124c66){if(_0x124c66[_0x8afa('0x38')]!=='VIRTUAL'){var _0x42e7a4={};_0x42e7a4[_0x124c66[_0x8afa('0x33')]]={'$like':'%'+_0x354c1c[_0x8afa('0x3a')][_0x8afa('0x48')]+'%'};return _0x42e7a4;}})});}_0x1be4ec=_[_0x8afa('0x46')]({},_0x1be4ec,_0x354c1c[_0x8afa('0x49')]);var _0x3f8b6c={'where':_0x1be4ec[_0x8afa('0x47')]};return db[_0x8afa('0x35')][_0x8afa('0x2b')](_0x3f8b6c)[_0x8afa('0x30')](function(_0x2d26c4){_0x3ddb1e[_0x8afa('0x2b')]=_0x2d26c4;if(_0x354c1c['query'][_0x8afa('0x4a')]){_0x1be4ec[_0x8afa('0x4b')]=[{'all':!![]}];}return db['Setting'][_0x8afa('0x4c')](_0x1be4ec);})[_0x8afa('0x30')](function(_0x51f8a2){_0x3ddb1e['rows']=_0x51f8a2;return _0x3ddb1e;})[_0x8afa('0x30')](respondWithFilteredResult(_0x11a0aa,_0x1be4ec))[_0x8afa('0x4d')](handleError(_0x11a0aa,null));};exports[_0x8afa('0x4e')]=function(_0x11a1ae,_0x50a9a2){var _0x53fef9={'raw':![],'where':{'id':_0x11a1ae['params']['id']}},_0x10afc0={};_0x10afc0['model']=_[_0x8afa('0x3b')](db[_0x8afa('0x35')][_0x8afa('0x36')]);_0x10afc0['query']=_[_0x8afa('0x3b')](_0x11a1ae[_0x8afa('0x3a')]);_0x10afc0['filters']=_[_0x8afa('0x3d')](_0x10afc0[_0x8afa('0x3e')],_0x10afc0[_0x8afa('0x3a')]);_0x53fef9[_0x8afa('0x3f')]=_[_0x8afa('0x3d')](_0x10afc0[_0x8afa('0x3e')],qs['fields'](_0x11a1ae['query'][_0x8afa('0x40')]));_0x53fef9['attributes']=_0x53fef9[_0x8afa('0x3f')][_0x8afa('0x4f')]?_0x53fef9[_0x8afa('0x3f')]:_0x10afc0[_0x8afa('0x3e')];if(_0x11a1ae[_0x8afa('0x3a')][_0x8afa('0x4a')]){_0x53fef9[_0x8afa('0x4b')]=[{'all':!![]}];}_0x53fef9=_[_0x8afa('0x46')]({},_0x53fef9,_0x11a1ae[_0x8afa('0x49')]);return db[_0x8afa('0x35')][_0x8afa('0x50')](_0x53fef9)[_0x8afa('0x30')](handleEntityNotFound(_0x50a9a2,null))[_0x8afa('0x30')](respondWithResult(_0x50a9a2,null))[_0x8afa('0x4d')](handleError(_0x50a9a2,null));};exports[_0x8afa('0x2f')]=function(_0x3b5ee4,_0x24c5af){if(_0x3b5ee4[_0x8afa('0x51')]['id']){delete _0x3b5ee4['body']['id'];}return db['Setting'][_0x8afa('0x50')]({'where':{'id':_0x3b5ee4['params']['id']}})[_0x8afa('0x30')](handleEntityNotFound(_0x24c5af,null))[_0x8afa('0x30')](saveUpdates(_0x3b5ee4[_0x8afa('0x51')],null))['then'](respondWithResult(_0x24c5af,null))['catch'](handleError(_0x24c5af,null));};exports[_0x8afa('0x52')]=function(_0x42c84a,_0x1e229c,_0x20f486){if(_0x42c84a[_0x8afa('0x53')]&&_0x42c84a[_0x8afa('0x53')][_0x8afa('0x54')]){_0x42c84a[_0x8afa('0x51')][_0x8afa('0x55')]=_0x42c84a[_0x8afa('0x53')]['filename'];}return db[_0x8afa('0x35')][_0x8afa('0x50')]({'where':{'id':_0x42c84a[_0x8afa('0x56')]['id']}})[_0x8afa('0x30')](handleEntityNotFound(_0x1e229c,null))[_0x8afa('0x30')](saveUpdates(_0x42c84a[_0x8afa('0x51')],null))[_0x8afa('0x30')](respondWithResult(_0x1e229c,null))[_0x8afa('0x4d')](handleError(_0x1e229c,null));};exports['addLogoLogin']=function(_0x3a8763,_0x2e87c3,_0x4311d1){if(_0x3a8763[_0x8afa('0x53')]&&_0x3a8763[_0x8afa('0x53')][_0x8afa('0x54')]){_0x3a8763[_0x8afa('0x51')][_0x8afa('0x57')]=_0x3a8763['file'][_0x8afa('0x54')];}return db[_0x8afa('0x35')][_0x8afa('0x50')]({'where':{'id':_0x3a8763[_0x8afa('0x56')]['id']}})[_0x8afa('0x30')](handleEntityNotFound(_0x2e87c3,null))['then'](saveUpdates(_0x3a8763['body'],null))['then'](respondWithResult(_0x2e87c3,null))[_0x8afa('0x4d')](handleError(_0x2e87c3,null));};var utilLicense=require(_0x8afa('0x17'));exports[_0x8afa('0x58')]=function(_0x1b9819,_0x48839c,_0x4ade29){var _0x24b183=_0x8afa('0x59');var _0x43c758={'custom':![]};return utilLicense[_0x8afa('0x5a')]()[_0x8afa('0x30')](function(_0x44ccba){if(_0x44ccba){_0x43c758=_0x44ccba;}return db[_0x8afa('0x35')][_0x8afa('0x50')]({'where':{'id':_0x1b9819[_0x8afa('0x56')]['id']},'attributes':[_0x8afa('0x55'),'loginLogo',_0x8afa('0x5b'),_0x8afa('0x5c'),_0x8afa('0x5d'),_0x8afa('0x5e'),_0x8afa('0x5f'),'defaultFavicon'],'raw':!![]});})[_0x8afa('0x30')](handleEntityNotFound(_0x48839c,null))[_0x8afa('0x30')](function(_0x12647f){if(_0x12647f){var _0x239ac6=_0x12647f[_0x8afa('0x55')]&&fs[_0x8afa('0x60')](path[_0x8afa('0x61')](config[_0x8afa('0x62')],_0x24b183,_['toLower'](_0x12647f[_0x8afa('0x55')])))?path[_0x8afa('0x61')](config[_0x8afa('0x62')],_0x24b183,_[_0x8afa('0x63')](_0x12647f[_0x8afa('0x55')])):path[_0x8afa('0x61')](config[_0x8afa('0x62')],_0x24b183,_[_0x8afa('0x63')]('default_logo.svg'));var _0x36d246=_0x8afa('0x64')+_[_0x8afa('0x65')](_0x8afa('0x55'));if(_0x12647f[_0x36d246]||!_0x43c758[_0x8afa('0x66')]){_0x239ac6=path['join'](config['root'],_0x24b183,_['toLower'](_0x8afa('0x67')));}if(!fs[_0x8afa('0x60')](_0x239ac6)){throw new db[(_0x8afa('0x68'))][(_0x8afa('0x69'))](_['upperFirst'](_0x8afa('0x55'))+_0x8afa('0x6a'));}return _0x48839c[_0x8afa('0x6b')](_0x239ac6);}})[_0x8afa('0x4d')](handleError(_0x48839c,null));};var utilLicense=require(_0x8afa('0x17'));exports[_0x8afa('0x6c')]=function(_0x23748b,_0x21001e,_0x44d993){var _0x343e79=_0x8afa('0x59');var _0x4e1b41={'custom':![]};return utilLicense['getLicense']()[_0x8afa('0x30')](function(_0x3490a7){if(_0x3490a7){_0x4e1b41=_0x3490a7;}return db[_0x8afa('0x35')]['find']({'where':{'id':_0x23748b[_0x8afa('0x56')]['id']},'attributes':['logo',_0x8afa('0x57'),'preferred',_0x8afa('0x5c'),_0x8afa('0x5d'),_0x8afa('0x5e'),_0x8afa('0x5f'),'defaultFavicon'],'raw':!![]});})[_0x8afa('0x30')](handleEntityNotFound(_0x21001e,null))[_0x8afa('0x30')](function(_0x5c53b9){if(_0x5c53b9){var _0x2ea46e=_0x5c53b9[_0x8afa('0x57')]&&fs[_0x8afa('0x60')](path[_0x8afa('0x61')](config[_0x8afa('0x62')],_0x343e79,_[_0x8afa('0x63')](_0x5c53b9[_0x8afa('0x57')])))?path[_0x8afa('0x61')](config['root'],_0x343e79,_[_0x8afa('0x63')](_0x5c53b9['loginLogo'])):path['join'](config[_0x8afa('0x62')],_0x343e79,_[_0x8afa('0x63')](_0x8afa('0x6d')));var _0x13e111=_0x8afa('0x64')+_[_0x8afa('0x65')](_0x8afa('0x57'));if(_0x5c53b9[_0x13e111]||!_0x4e1b41[_0x8afa('0x66')]){_0x2ea46e=path['join'](config[_0x8afa('0x62')],_0x343e79,_[_0x8afa('0x63')](_0x8afa('0x6d')));}if(!fs[_0x8afa('0x60')](_0x2ea46e)){throw new db[(_0x8afa('0x68'))][(_0x8afa('0x69'))](_[_0x8afa('0x65')](_0x8afa('0x57'))+_0x8afa('0x6a'));}return _0x21001e[_0x8afa('0x6b')](_0x2ea46e);}})['catch'](handleError(_0x21001e,null));};exports[_0x8afa('0x6e')]=function(_0x1db923,_0x434ea7){return db[_0x8afa('0x35')][_0x8afa('0x50')]({'where':{'id':_0x1db923[_0x8afa('0x56')]['id']},'attributes':[_0x8afa('0x6f')]})[_0x8afa('0x30')](respondWithResult(_0x434ea7,null))[_0x8afa('0x4d')](handleError(_0x434ea7,null));};exports['addPreferred']=function(_0x36a09a,_0x559506,_0x188a21){if(_0x36a09a[_0x8afa('0x53')]&&_0x36a09a[_0x8afa('0x53')][_0x8afa('0x54')]){_0x36a09a[_0x8afa('0x51')][_0x8afa('0x5b')]=_0x36a09a[_0x8afa('0x53')]['filename'];}return db['Setting']['find']({'where':{'id':_0x36a09a[_0x8afa('0x56')]['id']}})[_0x8afa('0x30')](handleEntityNotFound(_0x559506,null))[_0x8afa('0x30')](saveUpdates(_0x36a09a[_0x8afa('0x51')],null))[_0x8afa('0x30')](respondWithResult(_0x559506,null))[_0x8afa('0x4d')](handleError(_0x559506,null));};var utilLicense=require(_0x8afa('0x17'));exports[_0x8afa('0x70')]=function(_0xbee70f,_0x5c68fa,_0x1be595){var _0x3abd5b=_0x8afa('0x59');var _0x39e990={'custom':![]};return utilLicense[_0x8afa('0x5a')]()[_0x8afa('0x30')](function(_0x46c349){if(_0x46c349){_0x39e990=_0x46c349;}return db[_0x8afa('0x35')][_0x8afa('0x50')]({'where':{'id':_0xbee70f['params']['id']},'attributes':[_0x8afa('0x55'),'loginLogo',_0x8afa('0x5b'),_0x8afa('0x5c'),'defaultLogo','defaultLoginLogo',_0x8afa('0x5f'),_0x8afa('0x71')],'raw':!![]});})[_0x8afa('0x30')](handleEntityNotFound(_0x5c68fa,null))[_0x8afa('0x30')](function(_0x3d98bf){if(_0x3d98bf){var _0x14e94c=_0x3d98bf[_0x8afa('0x5b')]&&fs['existsSync'](path[_0x8afa('0x61')](config[_0x8afa('0x62')],_0x3abd5b,_[_0x8afa('0x63')](_0x3d98bf[_0x8afa('0x5b')])))?path[_0x8afa('0x61')](config[_0x8afa('0x62')],_0x3abd5b,_[_0x8afa('0x63')](_0x3d98bf[_0x8afa('0x5b')])):path[_0x8afa('0x61')](config[_0x8afa('0x62')],_0x3abd5b,_[_0x8afa('0x63')](_0x8afa('0x72')));var _0x414769='default'+_[_0x8afa('0x65')](_0x8afa('0x5b'));if(_0x3d98bf[_0x414769]||!_0x39e990[_0x8afa('0x66')]||!_0x39e990[_0x8afa('0x5b')]){_0x14e94c=path[_0x8afa('0x61')](config[_0x8afa('0x62')],_0x3abd5b,_['toLower'](_0x8afa('0x72')));}if(!fs[_0x8afa('0x60')](_0x14e94c)){throw new db['Sequelize']['ValidationError'](_[_0x8afa('0x65')](_0x8afa('0x5b'))+'\x20not\x20found');}return _0x5c68fa[_0x8afa('0x6b')](_0x14e94c);}})[_0x8afa('0x4d')](handleError(_0x5c68fa,null));};exports[_0x8afa('0x73')]=function(_0x116ff2,_0x3cbd71,_0x2c4063){if(_0x116ff2[_0x8afa('0x53')]&&_0x116ff2[_0x8afa('0x53')][_0x8afa('0x54')]){_0x116ff2['body'][_0x8afa('0x5c')]=_0x116ff2[_0x8afa('0x53')][_0x8afa('0x54')];}return db[_0x8afa('0x35')][_0x8afa('0x50')]({'where':{'id':_0x116ff2['params']['id']}})[_0x8afa('0x30')](handleEntityNotFound(_0x3cbd71,null))[_0x8afa('0x30')](saveUpdates(_0x116ff2[_0x8afa('0x51')],null))[_0x8afa('0x30')](respondWithResult(_0x3cbd71,null))[_0x8afa('0x4d')](handleError(_0x3cbd71,null));};var utilLicense=require(_0x8afa('0x17'));exports[_0x8afa('0x74')]=function(_0x4b928f,_0x3dc6bb,_0x3979f1){var _0x105fce=_0x8afa('0x59');var _0x1b7a0b={'custom':![]};return utilLicense[_0x8afa('0x5a')]()[_0x8afa('0x30')](function(_0x16eb12){if(_0x16eb12){_0x1b7a0b=_0x16eb12;}return db['Setting'][_0x8afa('0x50')]({'where':{'id':_0x4b928f[_0x8afa('0x56')]['id']},'attributes':[_0x8afa('0x55'),_0x8afa('0x57'),_0x8afa('0x5b'),_0x8afa('0x5c'),_0x8afa('0x5d'),_0x8afa('0x5e'),_0x8afa('0x5f'),'defaultFavicon'],'raw':!![]});})[_0x8afa('0x30')](handleEntityNotFound(_0x3dc6bb,null))[_0x8afa('0x30')](function(_0x2fb4f3){if(_0x2fb4f3){var _0xedce50=_0x2fb4f3[_0x8afa('0x5c')]&&fs[_0x8afa('0x60')](path['join'](config[_0x8afa('0x62')],_0x105fce,_[_0x8afa('0x63')](_0x2fb4f3[_0x8afa('0x5c')])))?path[_0x8afa('0x61')](config[_0x8afa('0x62')],_0x105fce,_[_0x8afa('0x63')](_0x2fb4f3[_0x8afa('0x5c')])):path['join'](config[_0x8afa('0x62')],_0x105fce,_[_0x8afa('0x63')](_0x8afa('0x75')));var _0x58ebcd=_0x8afa('0x64')+_[_0x8afa('0x65')](_0x8afa('0x5c'));if(_0x2fb4f3[_0x58ebcd]||!_0x1b7a0b[_0x8afa('0x66')]){_0xedce50=path[_0x8afa('0x61')](config[_0x8afa('0x62')],_0x105fce,_['toLower']('default_favicon.ico'));}if(!fs[_0x8afa('0x60')](_0xedce50)){throw new db['Sequelize'][(_0x8afa('0x69'))](_['upperFirst']('favicon')+_0x8afa('0x6a'));}return _0x3dc6bb[_0x8afa('0x6b')](_0xedce50);}})['catch'](handleError(_0x3dc6bb,null));};exports[_0x8afa('0x76')]=function(_0x2e04cc,_0x3802a4){var _0x578a05={'offset':moment()[_0x8afa('0x77')]()};_0x578a05[_0x8afa('0x78')]=moment()['utcOffset'](_0x578a05[_0x8afa('0x28')])['format'](_0x8afa('0x79'));return _0x3802a4['status'](0xc8)['send'](_0x578a05);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index d445d3b..8536a75 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 _0x3e74=['exports','Setting','settings','lodash','../../config/logger','api','moment','path','../../config/environment','./setting.attributes'];(function(_0x40ea21,_0xe55b66){var _0x555e46=function(_0x5e73fc){while(--_0x5e73fc){_0x40ea21['push'](_0x40ea21['shift']());}};_0x555e46(++_0xe55b66);}(_0x3e74,0x175));var _0x43e7=function(_0x151641,_0x4f1190){_0x151641=_0x151641-0x0;var _0x1ba3b0=_0x3e74[_0x151641];return _0x1ba3b0;};'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 _0x9957=['exports','define','Setting','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./setting.attributes'];(function(_0x2080a3,_0x48acfa){var _0x8d7d17=function(_0x2dbc06){while(--_0x2dbc06){_0x2080a3['push'](_0x2080a3['shift']());}};_0x8d7d17(++_0x48acfa);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'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 35eda46..5265f9d 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 _0xf047=['bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','info','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','error','code','Setting,\x20%s,\x20%s','message','result','ShowSetting','options','raw','where','attributes','include','map','model','then','stringify','catch','lodash','moment'];(function(_0x2c0114,_0x51af30){var _0x376d10=function(_0xee0dff){while(--_0xee0dff){_0x2c0114['push'](_0x2c0114['shift']());}};_0x376d10(++_0x51af30);}(_0xf047,0x72));var _0x7f04=function(_0x43f638,_0x45397c){_0x43f638=_0x43f638-0x0;var _0x30d91f=_0xf047[_0x43f638];return _0x30d91f;};'use strict';var _=require(_0x7f04('0x0'));var util=require('util');var moment=require(_0x7f04('0x1'));var BPromise=require(_0x7f04('0x2'));var rs=require(_0x7f04('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7f04('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7f04('0x5'))(_0x7f04('0x6'));var config=require('../../config/environment');var jayson=require(_0x7f04('0x7'));var client=jayson[_0x7f04('0x8')][_0x7f04('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2539d9,_0x5e563d,_0x4d6618){return new BPromise(function(_0x5bd50f,_0x56a550){return client['request'](_0x2539d9,_0x4d6618)['then'](function(_0x2f6d56){logger[_0x7f04('0xa')]('Setting,\x20%s,\x20%s',_0x5e563d,_0x7f04('0xb'));logger['debug'](_0x7f04('0xc'),_0x5e563d,_0x7f04('0xb'),JSON['stringify'](_0x2f6d56));if(_0x2f6d56[_0x7f04('0xd')]){if(_0x2f6d56[_0x7f04('0xd')][_0x7f04('0xe')]===0x1f4){logger[_0x7f04('0xd')](_0x7f04('0xf'),_0x5e563d,_0x2f6d56[_0x7f04('0xd')][_0x7f04('0x10')]);return _0x56a550(_0x2f6d56[_0x7f04('0xd')][_0x7f04('0x10')]);}logger[_0x7f04('0xd')](_0x7f04('0xf'),_0x5e563d,_0x2f6d56[_0x7f04('0xd')][_0x7f04('0x10')]);return _0x5bd50f(_0x2f6d56[_0x7f04('0xd')]['message']);}else{logger[_0x7f04('0xa')](_0x7f04('0xf'),_0x5e563d,_0x7f04('0xb'));_0x5bd50f(_0x2f6d56[_0x7f04('0x11')][_0x7f04('0x10')]);}})['catch'](function(_0x3f8d28){logger['error'](_0x7f04('0xf'),_0x5e563d,_0x3f8d28);_0x56a550(_0x3f8d28);});});}exports[_0x7f04('0x12')]=function(_0x59839e){var _0x2a7d12=this;return new Promise(function(_0x3ecf48,_0x530e24){return db['Setting']['find']({'raw':_0x59839e[_0x7f04('0x13')]?_0x59839e[_0x7f04('0x13')][_0x7f04('0x14')]===undefined?!![]:![]:!![],'where':_0x59839e[_0x7f04('0x13')]?_0x59839e[_0x7f04('0x13')][_0x7f04('0x15')]||null:null,'attributes':_0x59839e[_0x7f04('0x13')]?_0x59839e[_0x7f04('0x13')][_0x7f04('0x16')]||null:null,'include':_0x59839e[_0x7f04('0x13')]?_0x59839e[_0x7f04('0x13')][_0x7f04('0x17')]?_[_0x7f04('0x18')](_0x59839e[_0x7f04('0x13')][_0x7f04('0x17')],function(_0x2e407a){return{'model':db[_0x2e407a['model']],'as':_0x2e407a['as'],'attributes':_0x2e407a[_0x7f04('0x16')],'include':_0x2e407a[_0x7f04('0x17')]?_[_0x7f04('0x18')](_0x2e407a[_0x7f04('0x17')],function(_0x553ebb){return{'model':db[_0x553ebb[_0x7f04('0x19')]],'as':_0x553ebb['as'],'attributes':_0x553ebb[_0x7f04('0x16')],'include':_0x553ebb[_0x7f04('0x17')]?_[_0x7f04('0x18')](_0x553ebb[_0x7f04('0x17')],function(_0xaf7f04){return{'model':db[_0xaf7f04[_0x7f04('0x19')]],'as':_0xaf7f04['as'],'attributes':_0xaf7f04[_0x7f04('0x16')]};}):[]};}):[]};}):[]:[]})[_0x7f04('0x1a')](function(_0x11ef88){logger[_0x7f04('0xa')]('ShowSetting',_0x59839e);logger['debug'](_0x7f04('0x12'),_0x59839e,JSON[_0x7f04('0x1b')](_0x11ef88));_0x3ecf48(_0x11ef88);})[_0x7f04('0x1c')](function(_0x538f61){logger[_0x7f04('0xd')]('ShowSetting',_0x538f61[_0x7f04('0x10')],_0x59839e);_0x530e24(_0x2a7d12[_0x7f04('0xd')](0x1f4,_0x538f61[_0x7f04('0x10')]));});});}; \ No newline at end of file +var _0x0789=['result','catch','ShowSetting','Setting','options','include','map','model','attributes','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','then','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0xc4fae9,_0x326f6d){var _0x5aeef3=function(_0x23ccef){while(--_0x23ccef){_0xc4fae9['push'](_0xc4fae9['shift']());}};_0x5aeef3(++_0x326f6d);}(_0x0789,0xf3));var _0x9078=function(_0x27d9cc,_0x17ba1d){_0x27d9cc=_0x27d9cc-0x0;var _0x36ec49=_0x0789[_0x27d9cc];return _0x36ec49;};'use strict';var _=require(_0x9078('0x0'));var util=require(_0x9078('0x1'));var moment=require('moment');var BPromise=require(_0x9078('0x2'));var rs=require(_0x9078('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9078('0x4'))['db'];var utils=require(_0x9078('0x5'));var logger=require('../../config/logger')(_0x9078('0x6'));var config=require(_0x9078('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x222d33,_0x494bd0,_0x524520){return new BPromise(function(_0x54789a,_0x2e28a0){return client['request'](_0x222d33,_0x524520)[_0x9078('0x8')](function(_0x3d53e3){logger[_0x9078('0x9')](_0x9078('0xa'),_0x494bd0,_0x9078('0xb'));logger['debug'](_0x9078('0xc'),_0x494bd0,'request\x20sent',JSON[_0x9078('0xd')](_0x3d53e3));if(_0x3d53e3[_0x9078('0xe')]){if(_0x3d53e3['error'][_0x9078('0xf')]===0x1f4){logger[_0x9078('0xe')](_0x9078('0xa'),_0x494bd0,_0x3d53e3[_0x9078('0xe')][_0x9078('0x10')]);return _0x2e28a0(_0x3d53e3['error'][_0x9078('0x10')]);}logger[_0x9078('0xe')](_0x9078('0xa'),_0x494bd0,_0x3d53e3['error']['message']);return _0x54789a(_0x3d53e3[_0x9078('0xe')]['message']);}else{logger[_0x9078('0x9')]('Setting,\x20%s,\x20%s',_0x494bd0,_0x9078('0xb'));_0x54789a(_0x3d53e3[_0x9078('0x11')][_0x9078('0x10')]);}})[_0x9078('0x12')](function(_0xed3cff){logger[_0x9078('0xe')](_0x9078('0xa'),_0x494bd0,_0xed3cff);_0x2e28a0(_0xed3cff);});});}exports[_0x9078('0x13')]=function(_0x5a9352){var _0x127e81=this;return new Promise(function(_0x1b0035,_0x4ce8d8){return db[_0x9078('0x14')]['find']({'raw':_0x5a9352['options']?_0x5a9352[_0x9078('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x5a9352['options']?_0x5a9352['options']['where']||null:null,'attributes':_0x5a9352[_0x9078('0x15')]?_0x5a9352[_0x9078('0x15')]['attributes']||null:null,'include':_0x5a9352['options']?_0x5a9352[_0x9078('0x15')][_0x9078('0x16')]?_[_0x9078('0x17')](_0x5a9352['options'][_0x9078('0x16')],function(_0x1c4c42){return{'model':db[_0x1c4c42[_0x9078('0x18')]],'as':_0x1c4c42['as'],'attributes':_0x1c4c42[_0x9078('0x19')],'include':_0x1c4c42[_0x9078('0x16')]?_['map'](_0x1c4c42[_0x9078('0x16')],function(_0x471b28){return{'model':db[_0x471b28['model']],'as':_0x471b28['as'],'attributes':_0x471b28['attributes'],'include':_0x471b28['include']?_[_0x9078('0x17')](_0x471b28['include'],function(_0x19b4ed){return{'model':db[_0x19b4ed['model']],'as':_0x19b4ed['as'],'attributes':_0x19b4ed['attributes']};}):[]};}):[]};}):[]:[]})[_0x9078('0x8')](function(_0x311ea4){logger[_0x9078('0x9')](_0x9078('0x13'),_0x5a9352);logger['debug']('ShowSetting',_0x5a9352,JSON[_0x9078('0xd')](_0x311ea4));_0x1b0035(_0x311ea4);})[_0x9078('0x12')](function(_0x320b25){logger['error']('ShowSetting',_0x320b25[_0x9078('0x10')],_0x5a9352);_0x4ce8d8(_0x127e81[_0x9078('0xe')](0x1f4,_0x320b25['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 89511ef..e962f33 100644 --- a/server/api/smsAccount/index.js +++ b/server/api/smsAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe14b=['./smsAccount.controller','get','isAuthenticated','index','/describe','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','getAgents','post','create','addDisposition','addAnswer','/:id/notify','notify','addApplications','/:id/send','send','put','update','/:id','destroy','removeDispositions','delete','/:id/users','removeAgents','multer','util','express','Router','../../components/auth/service'];(function(_0x45598f,_0x1649ec){var _0x517e2b=function(_0xd0990e){while(--_0xd0990e){_0x45598f['push'](_0x45598f['shift']());}};_0x517e2b(++_0x1649ec);}(_0xe14b,0x93));var _0xbe14=function(_0xd5c108,_0xe48ebc){_0xd5c108=_0xd5c108-0x0;var _0x517a0b=_0xe14b[_0xd5c108];return _0x517a0b;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getDispositions']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x6')](_0xbe14('0x10'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x6')](_0xbe14('0x12'),controller[_0xbe14('0x13')]);router[_0xbe14('0x6')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x14')]);router[_0xbe14('0x15')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x16')]);router['post'](_0xbe14('0xb'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x15')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);router['post'](_0xbe14('0x19'),controller[_0xbe14('0x1a')]);router[_0xbe14('0x15')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x1b')]);router['post'](_0xbe14('0x1c'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x1d')]);router[_0xbe14('0x15')](_0xbe14('0x12'),controller['status']);router[_0xbe14('0x15')]('/:id/users',auth[_0xbe14('0x7')](),controller['addAgents']);router[_0xbe14('0x1e')]('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0x1f')]);router['delete'](_0xbe14('0x20'),auth['isAuthenticated'](),controller[_0xbe14('0x21')]);router['delete'](_0xbe14('0xb'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x22')]);router[_0xbe14('0x23')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeAnswers']);router[_0xbe14('0x23')](_0xbe14('0x24'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x25')]);module['exports']=router; \ No newline at end of file +var _0xabce=['/:id/users','getAgents','create','post','addAnswer','/:id/notify','notify','/:id/send','send','status','addAgents','put','update','delete','/:id','destroy','removeDispositions','removeAnswers','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status'];(function(_0xd9ab8b,_0x53343){var _0x3121a1=function(_0x5dbb9d){while(--_0x5dbb9d){_0xd9ab8b['push'](_0xd9ab8b['shift']());}};_0x3121a1(++_0x53343);}(_0xabce,0x103));var _0xeabc=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xabce[_0x491a7f];return _0x3d8f44;};'use strict';var multer=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var path=require(_0xeabc('0x2'));var timeout=require(_0xeabc('0x3'));var express=require(_0xeabc('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xeabc('0x5'));var interaction=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var controller=require('./smsAccount.controller');router['get']('/',auth[_0xeabc('0x8')](),controller['index']);router[_0xeabc('0x9')]('/describe',auth[_0xeabc('0x8')](),controller[_0xeabc('0xa')]);router[_0xeabc('0x9')]('/:id',auth[_0xeabc('0x8')](),controller[_0xeabc('0xb')]);router[_0xeabc('0x9')](_0xeabc('0xc'),auth[_0xeabc('0x8')](),controller[_0xeabc('0xd')]);router[_0xeabc('0x9')](_0xeabc('0xe'),auth[_0xeabc('0x8')](),controller[_0xeabc('0xf')]);router[_0xeabc('0x9')](_0xeabc('0x10'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x11')]);router[_0xeabc('0x9')](_0xeabc('0x12'),auth['isAuthenticated'](),controller[_0xeabc('0x13')]);router[_0xeabc('0x9')](_0xeabc('0x14'),controller['statusGet']);router['get'](_0xeabc('0x15'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x16')]);router['post']('/',auth[_0xeabc('0x8')](),controller[_0xeabc('0x17')]);router['post']('/:id/dispositions',auth[_0xeabc('0x8')](),controller['addDisposition']);router[_0xeabc('0x18')](_0xeabc('0xe'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x19')]);router[_0xeabc('0x18')](_0xeabc('0x1a'),controller[_0xeabc('0x1b')]);router[_0xeabc('0x18')]('/:id/applications',auth[_0xeabc('0x8')](),controller['addApplications']);router[_0xeabc('0x18')](_0xeabc('0x1c'),auth['isAuthenticated'](),controller[_0xeabc('0x1d')]);router[_0xeabc('0x18')](_0xeabc('0x14'),controller[_0xeabc('0x1e')]);router[_0xeabc('0x18')]('/:id/users',auth[_0xeabc('0x8')](),controller[_0xeabc('0x1f')]);router[_0xeabc('0x20')]('/:id',auth[_0xeabc('0x8')](),controller[_0xeabc('0x21')]);router[_0xeabc('0x22')](_0xeabc('0x23'),auth['isAuthenticated'](),controller[_0xeabc('0x24')]);router['delete'](_0xeabc('0xc'),auth['isAuthenticated'](),controller[_0xeabc('0x25')]);router[_0xeabc('0x22')](_0xeabc('0xe'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x26')]);router[_0xeabc('0x22')](_0xeabc('0x15'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xeabc('0x27')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 6b99d13..ead1a2a 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 _0xc159=['clicksend','plivo','clickatell','bandwidth','csc','infobip','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','randomstring','exports','STRING','generate','ENUM','twilio','skebby'];(function(_0x4592dc,_0x12b7f1){var _0x2a39c2=function(_0x31e208){while(--_0x31e208){_0x4592dc['push'](_0x4592dc['shift']());}};_0x2a39c2(++_0x12b7f1);}(_0xc159,0x116));var _0x9c15=function(_0x7275e9,_0x321fa5){_0x7275e9=_0x7275e9-0x0;var _0x17b99d=_0xc159[_0x7275e9];return _0x17b99d;};'use strict';var Sequelize=require(_0x9c15('0x0'));var rs=require(_0x9c15('0x1'));module[_0x9c15('0x2')]={'name':{'type':Sequelize[_0x9c15('0x3')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x9c15('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x9c15('0x3')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x9c15('0x4')]();}},'phone':{'type':Sequelize[_0x9c15('0x3')]},'type':{'type':Sequelize[_0x9c15('0x5')](_0x9c15('0x6'),_0x9c15('0x7'),'connectel',_0x9c15('0x8'),_0x9c15('0x9'),_0x9c15('0xa'),_0x9c15('0xb'),_0x9c15('0xc'),_0x9c15('0xd'),_0x9c15('0xe'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x9c15('0x3')]},'smsMethod':{'type':Sequelize[_0x9c15('0x5')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x9c15('0x3')]},'apiKey':{'type':Sequelize[_0x9c15('0x3')]},'applicationId':{'type':Sequelize[_0x9c15('0x3')]},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0x9c15('0x3')]},'deliveryReport':{'type':Sequelize[_0x9c15('0xf')],'defaultValue':![]},'description':{'type':Sequelize[_0x9c15('0x3')]},'notificationTemplate':{'type':Sequelize[_0x9c15('0x10')],'defaultValue':function(){return _0x9c15('0x11');}},'notificationSound':{'type':Sequelize[_0x9c15('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9c15('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x9c15('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9c15('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9c15('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9c15('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x9c15('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x9c15('0xf')],'defaultValue':![],'comment':_0x9c15('0x13'),'set':function(_0x59ab29){if(!_0x59ab29)this[_0x9c15('0x14')](_0x9c15('0x15'),null);this['setDataValue']('mandatoryDisposition',_0x59ab29);}}}; \ No newline at end of file +var _0x1d47=['clickatell','bandwidth','csc','infobip','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','STRING','name','ENUM','skebby','connectel','clicksend'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x1d47,0x1e7));var _0x71d4=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0x1d47[_0x1ccdf7];return _0x52a0ae;};'use strict';var Sequelize=require(_0x71d4('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0x71d4('0x1')],'unique':_0x71d4('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x71d4('0x1')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x71d4('0x1')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x71d4('0x3')]('twilio',_0x71d4('0x4'),_0x71d4('0x5'),_0x71d4('0x6'),'plivo',_0x71d4('0x7'),_0x71d4('0x8'),_0x71d4('0x9'),_0x71d4('0xa'),'intelepeer')},'accountSid':{'type':Sequelize[_0x71d4('0x1')]},'authId':{'type':Sequelize[_0x71d4('0x1')]},'authToken':{'type':Sequelize[_0x71d4('0x1')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0x71d4('0x1')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize[_0x71d4('0x1')]},'accountId':{'type':Sequelize[_0x71d4('0x1')]},'senderString':{'type':Sequelize[_0x71d4('0x1')]},'deliveryReport':{'type':Sequelize[_0x71d4('0xb')],'defaultValue':![]},'description':{'type':Sequelize[_0x71d4('0x1')]},'notificationTemplate':{'type':Sequelize[_0x71d4('0xc')],'defaultValue':function(){return _0x71d4('0xd');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x71d4('0xb')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x71d4('0xb')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x71d4('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x71d4('0x1')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x71d4('0xf')},'mandatoryDisposition':{'type':Sequelize[_0x71d4('0xb')],'defaultValue':![],'comment':_0x71d4('0x10'),'set':function(_0x4bb859){if(!_0x4bb859)this[_0x71d4('0x11')]('mandatoryDispositionPauseId',null);this[_0x71d4('0x11')](_0x71d4('0x12'),_0x4bb859);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index a0ad08f..4b34d04 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 _0xa6ba=['reject','save','update','destroy','get','UserProfileResource','name','mandatoryDispositionPause','SmsAccount','rawAttributes','fieldName','query','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','includeAll','findAll','show','Pause','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsAccounts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','SmsAccountId','Disposition','findOne','keys','hasOwnProperty','rows','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','SmsApplication','Applications','account','applications','orderBy','priority','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','CompanyId','mobile','twilio','from','Body','MessageSid','skebby','sender','connectel','clicksend','messageId','From','Text','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','text','replyMessageId','bandwidth','intelepeer','refid','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','CmList','ListId','Contacts','DESC','list','omit','defaults','contact','SmsInteraction','spread','interaction','autoclose','push','close','unmanaged','*,*,*,*','created','ContactId','AttachmentId','UserId','User','unshift','startRouting','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','text/xml','send','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','map','findAndCountAll','stack','finally','getApplications','getInteractions','Contact','fullname','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','List','Messages','SmsMessage','dataValues','received\x20delivery\x20report\x20from','skebby_dispatch_id','requestid','status_code','message_id','infobip','groupName','DELIVERED','redif','inspect','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','userSmsAccount:save','removeAgents','isArray','emit','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','http','request','then','info','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x3c2d29,_0x50344c){var _0x38685f=function(_0x39d8fc){while(--_0x39d8fc){_0x3c2d29['push'](_0x3c2d29['shift']());}};_0x38685f(++_0x50344c);}(_0xa6ba,0xad));var _0xaa6b=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0xa6ba[_0x543084];return _0x306a57;};'use strict';var emlformat=require(_0xaa6b('0x0'));var rimraf=require(_0xaa6b('0x1'));var zipdir=require(_0xaa6b('0x2'));var jsonpatch=require(_0xaa6b('0x3'));var rp=require(_0xaa6b('0x4'));var moment=require(_0xaa6b('0x5'));var BPromise=require(_0xaa6b('0x6'));var Mustache=require(_0xaa6b('0x7'));var util=require(_0xaa6b('0x8'));var path=require(_0xaa6b('0x9'));var sox=require(_0xaa6b('0xa'));var csv=require('to-csv');var ejs=require(_0xaa6b('0xb'));var fs=require('fs');var fs_extra=require(_0xaa6b('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xaa6b('0xd'));var toCsv=require(_0xaa6b('0xe'));var querystring=require(_0xaa6b('0xf'));var Papa=require(_0xaa6b('0x10'));var Redis=require('ioredis');var authService=require(_0xaa6b('0x11'));var qs=require(_0xaa6b('0x12'));var as=require(_0xaa6b('0x13'));var hardwareService=require(_0xaa6b('0x14'));var logger=require('../../config/logger')(_0xaa6b('0x15'));var utils=require(_0xaa6b('0x16'));var config=require(_0xaa6b('0x17'));var licenseUtil=require(_0xaa6b('0x18'));var db=require(_0xaa6b('0x19'))['db'];config['redis']=_['defaults'](config[_0xaa6b('0x1a')],{'host':_0xaa6b('0x1b'),'port':0x18eb});var socket=require(_0xaa6b('0x1c'))(new Redis(config[_0xaa6b('0x1a')]));require(_0xaa6b('0x1d'))[_0xaa6b('0x1e')](socket);var jayson=require(_0xaa6b('0x1f'));var client=jayson['client'][_0xaa6b('0x20')]({'port':0x232c});function respondWithRpcPromise(_0xf7746b,_0x6f97a8,_0x32c226,_0x4e63dc){return new BPromise(function(_0x2cfa9f,_0x3a462c){var _0x5135a5=_0x4e63dc||client;return _0x5135a5[_0xaa6b('0x21')](_0xf7746b,_0x32c226)[_0xaa6b('0x22')](function(_0x316369){logger[_0xaa6b('0x23')]('SmsAccount,\x20%s,\x20%s',_0x6f97a8,'request\x20sent');logger[_0xaa6b('0x24')](_0xaa6b('0x25'),_0x6f97a8,_0xaa6b('0x26'),JSON[_0xaa6b('0x27')](_0x316369));if(_0x316369[_0xaa6b('0x28')]){if(_0x316369['error'][_0xaa6b('0x29')]===0x1f4){logger[_0xaa6b('0x28')](_0xaa6b('0x2a'),_0x6f97a8,_0x316369[_0xaa6b('0x28')][_0xaa6b('0x2b')]);return _0x3a462c(_0x316369[_0xaa6b('0x28')][_0xaa6b('0x2b')]);}logger[_0xaa6b('0x28')](_0xaa6b('0x2a'),_0x6f97a8,_0x316369[_0xaa6b('0x28')][_0xaa6b('0x2b')]);return _0x2cfa9f(_0x316369[_0xaa6b('0x28')]['message']);}else{logger['info'](_0xaa6b('0x2a'),_0x6f97a8,_0xaa6b('0x26'));_0x2cfa9f(_0x316369[_0xaa6b('0x2c')]['message']);}})[_0xaa6b('0x2d')](function(_0x2f9182){logger[_0xaa6b('0x28')](_0xaa6b('0x2a'),_0x6f97a8,_0x2f9182);_0x3a462c(_0x2f9182);});});}function respondWithStatusCode(_0x312b94,_0x15beed){_0x15beed=_0x15beed||0xcc;return function(_0x2171ce){if(_0x2171ce){return _0x312b94[_0xaa6b('0x2e')](_0x15beed);}return _0x312b94[_0xaa6b('0x2f')](_0x15beed)[_0xaa6b('0x30')]();};}function respondWithResult(_0x5cca84,_0x3580e4){_0x3580e4=_0x3580e4||0xc8;return function(_0x6540cf){if(_0x6540cf){return _0x5cca84[_0xaa6b('0x2f')](_0x3580e4)[_0xaa6b('0x31')](_0x6540cf);}};}function respondWithFilteredResult(_0x2fcf76,_0x56eeb0){return function(_0x5a2f73){if(_0x5a2f73){var _0x137c08=typeof _0x56eeb0[_0xaa6b('0x32')]===_0xaa6b('0x33')&&typeof _0x56eeb0[_0xaa6b('0x34')]===_0xaa6b('0x33');var _0x9e95d7=_0x5a2f73[_0xaa6b('0x35')];var _0x4e07bb=_0x137c08?0x0:_0x56eeb0[_0xaa6b('0x32')];var _0x1f5ca0=_0x137c08?_0x5a2f73[_0xaa6b('0x35')]:_0x56eeb0[_0xaa6b('0x32')]+_0x56eeb0[_0xaa6b('0x34')];var _0x37ae74;if(_0x1f5ca0>=_0x9e95d7){_0x1f5ca0=_0x9e95d7;_0x37ae74=0xc8;}else{_0x37ae74=0xce;}_0x2fcf76[_0xaa6b('0x2f')](_0x37ae74);return _0x2fcf76[_0xaa6b('0x36')](_0xaa6b('0x37'),_0x4e07bb+'-'+_0x1f5ca0+'/'+_0x9e95d7)['json'](_0x5a2f73);}return null;};}function patchUpdates(_0x16cfbe){return function(_0x3833df){try{jsonpatch['apply'](_0x3833df,_0x16cfbe,!![]);}catch(_0x30bb79){return BPromise[_0xaa6b('0x38')](_0x30bb79);}return _0x3833df[_0xaa6b('0x39')]();};}function saveUpdates(_0x3f7ade,_0x2b2fb2){return function(_0x1ad3ba){if(_0x1ad3ba){return _0x1ad3ba[_0xaa6b('0x3a')](_0x3f7ade)[_0xaa6b('0x22')](function(_0x3f55a8){return _0x3f55a8;});}return null;};}function removeEntity(_0x5bdf0e,_0x416900){return function(_0x12c39e){if(_0x12c39e){return _0x12c39e[_0xaa6b('0x3b')]()[_0xaa6b('0x22')](function(){var _0xab7033=_0x12c39e[_0xaa6b('0x3c')]({'plain':!![]});var _0x46a531='SmsAccounts';return db[_0xaa6b('0x3d')][_0xaa6b('0x3b')]({'where':{'type':_0x46a531,'resourceId':_0xab7033['id']}})[_0xaa6b('0x22')](function(){return _0x12c39e;});})['then'](function(){_0x5bdf0e[_0xaa6b('0x2f')](0xcc)[_0xaa6b('0x30')]();});}};}function handleEntityNotFound(_0x54a95e,_0x287ed2){return function(_0x42099e){if(!_0x42099e){_0x54a95e['sendStatus'](0x194);}return _0x42099e;};}function handleError(_0x58b13a,_0x193fa2){_0x193fa2=_0x193fa2||0x1f4;return function(_0x32d877){logger[_0xaa6b('0x28')](_0x32d877['stack']);if(_0x32d877[_0xaa6b('0x3e')]){delete _0x32d877['name'];}_0x58b13a[_0xaa6b('0x2f')](_0x193fa2)['send'](_0x32d877);};}exports['index']=function(_0x3279a8,_0x2bc961){var _0x2c80fb={'include':[{'model':db['Pause'],'as':_0xaa6b('0x3f')}]},_0x4a557e={},_0x26de51={'count':0x0,'rows':[]};var _0x29d185=_['map'](db[_0xaa6b('0x40')][_0xaa6b('0x41')],function(_0x510235){return{'name':_0x510235[_0xaa6b('0x42')],'type':_0x510235['type']['key']};});_0x4a557e['model']=_['map'](_0x29d185,_0xaa6b('0x3e'));_0x4a557e['query']=_['keys'](_0x3279a8[_0xaa6b('0x43')]);_0x4a557e['filters']=_[_0xaa6b('0x44')](_0x4a557e[_0xaa6b('0x45')],_0x4a557e[_0xaa6b('0x43')]);_0x2c80fb[_0xaa6b('0x46')]=_[_0xaa6b('0x44')](_0x4a557e[_0xaa6b('0x45')],qs[_0xaa6b('0x47')](_0x3279a8[_0xaa6b('0x43')][_0xaa6b('0x47')]));_0x2c80fb['attributes']=_0x2c80fb[_0xaa6b('0x46')][_0xaa6b('0x48')]?_0x2c80fb[_0xaa6b('0x46')]:_0x4a557e[_0xaa6b('0x45')];if(!_0x3279a8[_0xaa6b('0x43')]['hasOwnProperty'](_0xaa6b('0x49'))){_0x2c80fb[_0xaa6b('0x34')]=qs[_0xaa6b('0x34')](_0x3279a8[_0xaa6b('0x43')]['limit']);_0x2c80fb[_0xaa6b('0x32')]=qs[_0xaa6b('0x32')](_0x3279a8['query'][_0xaa6b('0x32')]);}_0x2c80fb[_0xaa6b('0x4a')]=qs[_0xaa6b('0x4b')](_0x3279a8[_0xaa6b('0x43')][_0xaa6b('0x4b')]);_0x2c80fb[_0xaa6b('0x4c')]=qs['filters'](_[_0xaa6b('0x4d')](_0x3279a8[_0xaa6b('0x43')],_0x4a557e[_0xaa6b('0x4e')]),_0x29d185);if(_0x3279a8[_0xaa6b('0x43')][_0xaa6b('0x4f')]){_0x2c80fb[_0xaa6b('0x4c')]=_[_0xaa6b('0x50')](_0x2c80fb[_0xaa6b('0x4c')],{'$or':_['map'](_0x29d185,function(_0x5b1c02){if(_0x5b1c02[_0xaa6b('0x51')]!==_0xaa6b('0x52')){var _0x28f58d={};_0x28f58d[_0x5b1c02[_0xaa6b('0x3e')]]={'$like':'%'+_0x3279a8[_0xaa6b('0x43')][_0xaa6b('0x4f')]+'%'};return _0x28f58d;}})});}_0x2c80fb=_[_0xaa6b('0x50')]({},_0x2c80fb,_0x3279a8[_0xaa6b('0x53')]);var _0x1678c4={'where':_0x2c80fb['where']};return db[_0xaa6b('0x40')][_0xaa6b('0x35')](_0x1678c4)[_0xaa6b('0x22')](function(_0x5f5c88){_0x26de51['count']=_0x5f5c88;if(_0x3279a8['query'][_0xaa6b('0x54')]){_0x2c80fb['include']=[{'all':!![]}];}return db['SmsAccount'][_0xaa6b('0x55')](_0x2c80fb);})[_0xaa6b('0x22')](function(_0x39fe53){_0x26de51['rows']=_0x39fe53;return _0x26de51;})[_0xaa6b('0x22')](respondWithFilteredResult(_0x2bc961,_0x2c80fb))[_0xaa6b('0x2d')](handleError(_0x2bc961,null));};exports[_0xaa6b('0x56')]=function(_0x588c9d,_0x4e6a25){var _0x30e760={'raw':![],'where':{'id':_0x588c9d['params']['id']},'include':[{'model':db[_0xaa6b('0x57')],'as':'mandatoryDispositionPause'}]},_0x5c87f3={};_0x5c87f3['model']=_['keys'](db[_0xaa6b('0x40')][_0xaa6b('0x41')]);_0x5c87f3['query']=_['keys'](_0x588c9d[_0xaa6b('0x43')]);_0x5c87f3[_0xaa6b('0x4e')]=_['intersection'](_0x5c87f3[_0xaa6b('0x45')],_0x5c87f3[_0xaa6b('0x43')]);_0x30e760[_0xaa6b('0x46')]=_[_0xaa6b('0x44')](_0x5c87f3[_0xaa6b('0x45')],qs[_0xaa6b('0x47')](_0x588c9d[_0xaa6b('0x43')]['fields']));_0x30e760[_0xaa6b('0x46')]=_0x30e760[_0xaa6b('0x46')]['length']?_0x30e760[_0xaa6b('0x46')]:_0x5c87f3['model'];if(_0x588c9d[_0xaa6b('0x43')][_0xaa6b('0x54')]){_0x30e760[_0xaa6b('0x58')]=[{'all':!![]}];}_0x30e760=_[_0xaa6b('0x50')]({},_0x30e760,_0x588c9d[_0xaa6b('0x53')]);return db[_0xaa6b('0x40')][_0xaa6b('0x59')](_0x30e760)[_0xaa6b('0x22')](handleEntityNotFound(_0x4e6a25,null))['then'](respondWithResult(_0x4e6a25,null))['catch'](handleError(_0x4e6a25,null));};exports[_0xaa6b('0x5a')]=function(_0x379f05,_0x41379c){return db[_0xaa6b('0x40')][_0xaa6b('0x5a')](_0x379f05[_0xaa6b('0x5b')],{})[_0xaa6b('0x22')](function(_0x3ef03e){var _0x47e02d=_0x379f05[_0xaa6b('0x5c')][_0xaa6b('0x3c')]({'plain':!![]});if(!_0x47e02d)throw new Error(_0xaa6b('0x5d'));if(_0x47e02d[_0xaa6b('0x5e')]===_0xaa6b('0x5c')){var _0x40a50b=_0x3ef03e[_0xaa6b('0x3c')]({'plain':!![]});var _0x35c9ec=_0xaa6b('0x5f');return db['UserProfileSection'][_0xaa6b('0x59')]({'where':{'name':_0x35c9ec,'userProfileId':_0x47e02d[_0xaa6b('0x60')]},'raw':!![]})[_0xaa6b('0x22')](function(_0x1f094b){if(_0x1f094b&&_0x1f094b[_0xaa6b('0x61')]===0x0){return db[_0xaa6b('0x3d')][_0xaa6b('0x5a')]({'name':_0x40a50b[_0xaa6b('0x3e')],'resourceId':_0x40a50b['id'],'type':_0x1f094b[_0xaa6b('0x3e')],'sectionId':_0x1f094b['id']},{})[_0xaa6b('0x22')](function(){return _0x3ef03e;});}else{return _0x3ef03e;}})[_0xaa6b('0x2d')](function(_0x194449){logger[_0xaa6b('0x28')](_0xaa6b('0x62'),_0x194449);throw _0x194449;});}return _0x3ef03e;})['then'](respondWithResult(_0x41379c,0xc9))[_0xaa6b('0x2d')](handleError(_0x41379c,null));};exports[_0xaa6b('0x3a')]=function(_0x235af1,_0x886007){if(_0x235af1[_0xaa6b('0x5b')]['id']){delete _0x235af1['body']['id'];}return db['SmsAccount']['find']({'where':{'id':_0x235af1[_0xaa6b('0x63')]['id']},'include':[{'model':db[_0xaa6b('0x57')],'as':_0xaa6b('0x3f')}]})['then'](handleEntityNotFound(_0x886007,null))[_0xaa6b('0x22')](saveUpdates(_0x235af1[_0xaa6b('0x5b')],null))[_0xaa6b('0x22')](respondWithResult(_0x886007,null))[_0xaa6b('0x2d')](handleError(_0x886007,null));};exports[_0xaa6b('0x3b')]=function(_0x4a1a2f,_0x1ee4d1){return db[_0xaa6b('0x40')][_0xaa6b('0x59')]({'where':{'id':_0x4a1a2f[_0xaa6b('0x63')]['id']}})['then'](handleEntityNotFound(_0x1ee4d1,null))['then'](removeEntity(_0x1ee4d1,null))[_0xaa6b('0x2d')](handleError(_0x1ee4d1,null));};exports[_0xaa6b('0x64')]=function(_0x4c8a99,_0x31591a){return db['SmsAccount']['describe']()[_0xaa6b('0x22')](respondWithResult(_0x31591a,null))[_0xaa6b('0x2d')](handleError(_0x31591a,null));};exports[_0xaa6b('0x65')]=function(_0x3b6ce8,_0x46a328,_0x1b25ee){if(_0x3b6ce8[_0xaa6b('0x5b')]['id']){delete _0x3b6ce8[_0xaa6b('0x5b')]['id'];}return db[_0xaa6b('0x40')]['find']({'where':{'id':_0x3b6ce8[_0xaa6b('0x63')]['id']}})[_0xaa6b('0x22')](handleEntityNotFound(_0x46a328,null))[_0xaa6b('0x22')](function(_0x105bc0){if(_0x105bc0){_0x3b6ce8[_0xaa6b('0x5b')][_0xaa6b('0x66')]=_0x105bc0['id'];return db[_0xaa6b('0x67')][_0xaa6b('0x5a')](_0x3b6ce8[_0xaa6b('0x5b')]);}})[_0xaa6b('0x22')](respondWithResult(_0x46a328,null))['catch'](handleError(_0x46a328,null));};exports['getDispositions']=function(_0x5186e5,_0x36e32b,_0x31d539){var _0x4775f4={'raw':![],'where':{}};var _0x179853={};var _0x3aceda={'count':0x0,'rows':[]};return db[_0xaa6b('0x40')][_0xaa6b('0x68')]({'where':{'id':_0x5186e5[_0xaa6b('0x63')]['id']}})[_0xaa6b('0x22')](handleEntityNotFound(_0x36e32b,null))[_0xaa6b('0x22')](function(_0xda713d){if(_0xda713d){_0x179853['model']=_[_0xaa6b('0x69')](db['Disposition'][_0xaa6b('0x41')]);_0x179853[_0xaa6b('0x43')]=_[_0xaa6b('0x69')](_0x5186e5[_0xaa6b('0x43')]);_0x179853['filters']=_['intersection'](_0x179853[_0xaa6b('0x45')],_0x179853[_0xaa6b('0x43')]);_0x4775f4[_0xaa6b('0x46')]=_['intersection'](_0x179853['model'],qs[_0xaa6b('0x47')](_0x5186e5[_0xaa6b('0x43')][_0xaa6b('0x47')]));_0x4775f4[_0xaa6b('0x46')]=_0x4775f4[_0xaa6b('0x46')][_0xaa6b('0x48')]?_0x4775f4[_0xaa6b('0x46')]:_0x179853[_0xaa6b('0x45')];if(!_0x5186e5[_0xaa6b('0x43')][_0xaa6b('0x6a')](_0xaa6b('0x49'))){_0x4775f4[_0xaa6b('0x34')]=qs[_0xaa6b('0x34')](_0x5186e5['query'][_0xaa6b('0x34')]);_0x4775f4[_0xaa6b('0x32')]=qs[_0xaa6b('0x32')](_0x5186e5['query'][_0xaa6b('0x32')]);}_0x4775f4[_0xaa6b('0x4a')]=qs['sort'](_0x5186e5[_0xaa6b('0x43')][_0xaa6b('0x4b')]);_0x4775f4[_0xaa6b('0x4c')]=qs['filters'](_[_0xaa6b('0x4d')](_0x5186e5[_0xaa6b('0x43')],_0x179853['filters']));_0x4775f4[_0xaa6b('0x4c')][_0xaa6b('0x66')]=_0xda713d['id'];if(_0x5186e5['query']['filter']){_0x4775f4[_0xaa6b('0x4c')]=_['merge'](_0x4775f4[_0xaa6b('0x4c')],{'$or':_['map'](_0x4775f4[_0xaa6b('0x46')],function(_0x4f8e9a){var _0x3f5966={};_0x3f5966[_0x4f8e9a]={'$like':'%'+_0x5186e5[_0xaa6b('0x43')][_0xaa6b('0x4f')]+'%'};return _0x3f5966;})});}_0x4775f4=_['merge']({},_0x4775f4,_0x5186e5[_0xaa6b('0x53')]);return db[_0xaa6b('0x67')][_0xaa6b('0x35')]({'where':_0x4775f4['where']})[_0xaa6b('0x22')](function(_0x31e753){_0x3aceda[_0xaa6b('0x35')]=_0x31e753;if(_0x5186e5[_0xaa6b('0x43')][_0xaa6b('0x54')]){_0x4775f4['include']=[{'all':!![]}];}return db[_0xaa6b('0x67')][_0xaa6b('0x55')](_0x4775f4);})[_0xaa6b('0x22')](function(_0x3e2fed){_0x3aceda[_0xaa6b('0x6b')]=_0x3e2fed;return _0x3aceda;});}})[_0xaa6b('0x22')](respondWithFilteredResult(_0x36e32b,_0x4775f4))[_0xaa6b('0x2d')](handleError(_0x36e32b,null));};exports[_0xaa6b('0x6c')]=function(_0x5f552c,_0x562b78,_0x598f15){return db[_0xaa6b('0x40')]['find']({'where':{'id':_0x5f552c[_0xaa6b('0x63')]['id']}})['then'](handleEntityNotFound(_0x562b78,null))['then'](function(_0xa6b34c){if(_0xa6b34c){return _0xa6b34c[_0xaa6b('0x6c')](_0x5f552c[_0xaa6b('0x43')][_0xaa6b('0x6d')]);}})['then'](respondWithStatusCode(_0x562b78,null))['catch'](handleError(_0x562b78,null));};exports[_0xaa6b('0x6e')]=function(_0x5d1c94,_0x66f13e,_0x2c005d){if(_0x5d1c94[_0xaa6b('0x5b')]['id']){delete _0x5d1c94[_0xaa6b('0x5b')]['id'];}return db[_0xaa6b('0x40')]['find']({'where':{'id':_0x5d1c94[_0xaa6b('0x63')]['id']}})['then'](handleEntityNotFound(_0x66f13e,null))['then'](function(_0x5f2e0b){if(_0x5f2e0b){_0x5d1c94[_0xaa6b('0x5b')][_0xaa6b('0x66')]=_0x5f2e0b['id'];return db[_0xaa6b('0x6f')][_0xaa6b('0x5a')](_0x5d1c94[_0xaa6b('0x5b')]);}})['then'](respondWithResult(_0x66f13e,null))[_0xaa6b('0x2d')](handleError(_0x66f13e,null));};exports['getAnswers']=function(_0x4ac2fa,_0x483149,_0x28c2ed){var _0x2e8f4e={'raw':![],'where':{}};var _0x421a54={};var _0x3c6bb7={'count':0x0,'rows':[]};return db[_0xaa6b('0x40')][_0xaa6b('0x68')]({'where':{'id':_0x4ac2fa['params']['id']}})['then'](handleEntityNotFound(_0x483149,null))[_0xaa6b('0x22')](function(_0x2fd676){if(_0x2fd676){_0x421a54[_0xaa6b('0x45')]=_[_0xaa6b('0x69')](db[_0xaa6b('0x6f')][_0xaa6b('0x41')]);_0x421a54[_0xaa6b('0x43')]=_[_0xaa6b('0x69')](_0x4ac2fa[_0xaa6b('0x43')]);_0x421a54[_0xaa6b('0x4e')]=_[_0xaa6b('0x44')](_0x421a54[_0xaa6b('0x45')],_0x421a54[_0xaa6b('0x43')]);_0x2e8f4e[_0xaa6b('0x46')]=_['intersection'](_0x421a54[_0xaa6b('0x45')],qs[_0xaa6b('0x47')](_0x4ac2fa[_0xaa6b('0x43')][_0xaa6b('0x47')]));_0x2e8f4e[_0xaa6b('0x46')]=_0x2e8f4e['attributes']['length']?_0x2e8f4e['attributes']:_0x421a54['model'];if(!_0x4ac2fa[_0xaa6b('0x43')][_0xaa6b('0x6a')](_0xaa6b('0x49'))){_0x2e8f4e[_0xaa6b('0x34')]=qs[_0xaa6b('0x34')](_0x4ac2fa[_0xaa6b('0x43')][_0xaa6b('0x34')]);_0x2e8f4e[_0xaa6b('0x32')]=qs[_0xaa6b('0x32')](_0x4ac2fa[_0xaa6b('0x43')][_0xaa6b('0x32')]);}_0x2e8f4e[_0xaa6b('0x4a')]=qs['sort'](_0x4ac2fa['query']['sort']);_0x2e8f4e['where']=qs[_0xaa6b('0x4e')](_[_0xaa6b('0x4d')](_0x4ac2fa[_0xaa6b('0x43')],_0x421a54[_0xaa6b('0x4e')]));_0x2e8f4e['where'][_0xaa6b('0x66')]=_0x2fd676['id'];if(_0x4ac2fa['query'][_0xaa6b('0x4f')]){_0x2e8f4e['where']=_[_0xaa6b('0x50')](_0x2e8f4e[_0xaa6b('0x4c')],{'$or':_['map'](_0x2e8f4e['attributes'],function(_0x4b91bc){var _0x91dd48={};_0x91dd48[_0x4b91bc]={'$like':'%'+_0x4ac2fa[_0xaa6b('0x43')]['filter']+'%'};return _0x91dd48;})});}_0x2e8f4e=_[_0xaa6b('0x50')]({},_0x2e8f4e,_0x4ac2fa[_0xaa6b('0x53')]);return db[_0xaa6b('0x6f')][_0xaa6b('0x35')]({'where':_0x2e8f4e['where']})[_0xaa6b('0x22')](function(_0x1917a0){_0x3c6bb7[_0xaa6b('0x35')]=_0x1917a0;if(_0x4ac2fa[_0xaa6b('0x43')][_0xaa6b('0x54')]){_0x2e8f4e[_0xaa6b('0x58')]=[{'all':!![]}];}return db[_0xaa6b('0x6f')][_0xaa6b('0x55')](_0x2e8f4e);})['then'](function(_0x2d2115){_0x3c6bb7[_0xaa6b('0x6b')]=_0x2d2115;return _0x3c6bb7;});}})['then'](respondWithFilteredResult(_0x483149,_0x2e8f4e))['catch'](handleError(_0x483149,null));};exports[_0xaa6b('0x70')]=function(_0x5b5892,_0x25eefd,_0x412176){return db[_0xaa6b('0x40')][_0xaa6b('0x59')]({'where':{'id':_0x5b5892[_0xaa6b('0x63')]['id']}})[_0xaa6b('0x22')](handleEntityNotFound(_0x25eefd,null))[_0xaa6b('0x22')](function(_0x3948a8){if(_0x3948a8){return _0x3948a8['removeAnswers'](_0x5b5892['query'][_0xaa6b('0x6d')]);}})[_0xaa6b('0x22')](respondWithStatusCode(_0x25eefd,null))[_0xaa6b('0x2d')](handleError(_0x25eefd,null));};exports['notify']=function(_0x4952fc,_0xefd8e0,_0x46cba1){var _0x966ed7={'channel':'sms'};var _0x86892c=[];var _0x3dc999=[];var _0x36dc98={};return db[_0xaa6b('0x40')]['find']({'where':{'id':_0x4952fc[_0xaa6b('0x63')]['id']},'include':[{'model':db[_0xaa6b('0x71')],'as':_0xaa6b('0x72')}]})[_0xaa6b('0x22')](handleEntityNotFound(_0xefd8e0,null))[_0xaa6b('0x22')](function(_0x446c2e){_0x966ed7[_0xaa6b('0x73')]=_0x446c2e;_0x966ed7[_0xaa6b('0x74')]=_[_0xaa6b('0x75')](_0x446c2e[_0xaa6b('0x72')],[_0xaa6b('0x76')],[_0xaa6b('0x77')]);if(_0x966ed7[_0xaa6b('0x73')][_0xaa6b('0x72')]){delete _0x966ed7[_0xaa6b('0x73')]['Applications'];}return db[_0xaa6b('0x78')]['describe']();})['then'](function(_0x41b15d){if(!_0x41b15d){throw new db[(_0xaa6b('0x79'))][(_0xaa6b('0x7a'))](_0xaa6b('0x7b'));}_0x86892c=_['difference'](_['keys'](_0x41b15d),[_0xaa6b('0x7c'),_0xaa6b('0x7d')]);_0x3dc999=_['difference'](_['keys'](_0x41b15d),[_0xaa6b('0x7c'),'updatedAt',_0xaa6b('0x7e'),'ListId']);_0x966ed7[_0xaa6b('0x5b')]={'mapKey':_0xaa6b('0x7f')};if(_0x966ed7['account']['type']){switch(_0x966ed7[_0xaa6b('0x73')]['type']){case _0xaa6b('0x80'):_0x966ed7[_0xaa6b('0x5b')][_0xaa6b('0x81')]=_0x4952fc[_0xaa6b('0x5b')]['From'];_0x966ed7[_0xaa6b('0x5b')][_0xaa6b('0x5b')]=_0x4952fc[_0xaa6b('0x5b')][_0xaa6b('0x82')];_0x966ed7[_0xaa6b('0x5b')]['messageId']=_0x4952fc[_0xaa6b('0x5b')][_0xaa6b('0x83')];break;case _0xaa6b('0x84'):_0x966ed7[_0xaa6b('0x5b')][_0xaa6b('0x81')]='+'+_0x4952fc[_0xaa6b('0x5b')][_0xaa6b('0x85')];_0x966ed7[_0xaa6b('0x5b')][_0xaa6b('0x5b')]=_0x4952fc[_0xaa6b('0x5b')]['text'];break;case _0xaa6b('0x86'):_0x966ed7[_0xaa6b('0x5b')][_0xaa6b('0x81')]=_0x4952fc[_0xaa6b('0x5b')]['from'];_0x966ed7[_0xaa6b('0x5b')][_0xaa6b('0x5b')]=_0x4952fc[_0xaa6b('0x5b')][_0xaa6b('0x2b')];break;case _0xaa6b('0x87'):_0x966ed7[_0xaa6b('0x5b')][_0xaa6b('0x81')]=_0x4952fc['body'][_0xaa6b('0x81')];_0x966ed7[_0xaa6b('0x5b')][_0xaa6b('0x5b')]=_0x4952fc[_0xaa6b('0x5b')][_0xaa6b('0x5b')];_0x966ed7['body'][_0xaa6b('0x88')]=_0x4952fc[_0xaa6b('0x5b')]['message_id'];break;case'plivo':_0x966ed7['body'][_0xaa6b('0x81')]=_0x4952fc['body'][_0xaa6b('0x89')];_0x966ed7['body']['body']=_0x4952fc[_0xaa6b('0x5b')][_0xaa6b('0x8a')];_0x966ed7[_0xaa6b('0x5b')][_0xaa6b('0x88')]=_0x4952fc[_0xaa6b('0x5b')]['MessageUUID'];break;case'infobip':_0x966ed7['body']['from']='+'+_0x4952fc[_0xaa6b('0x5b')][_0xaa6b('0x8b')][0x0][_0xaa6b('0x81')];_0x966ed7[_0xaa6b('0x5b')]['body']=_0x4952fc[_0xaa6b('0x5b')][_0xaa6b('0x8b')][0x0]['text'];_0x966ed7[_0xaa6b('0x5b')][_0xaa6b('0x88')]=_0x4952fc[_0xaa6b('0x5b')][_0xaa6b('0x8b')][0x0][_0xaa6b('0x88')];break;case _0xaa6b('0x8c'):_0x966ed7[_0xaa6b('0x5b')][_0xaa6b('0x81')]=_0x4952fc['body'][_0xaa6b('0x8d')];_0x966ed7['body'][_0xaa6b('0x5b')]=_0x4952fc[_0xaa6b('0x5b')][_0xaa6b('0x8e')][_0xaa6b('0x2b')];break;case _0xaa6b('0x8f'):_0x966ed7[_0xaa6b('0x5b')][_0xaa6b('0x81')]=_0x4952fc[_0xaa6b('0x5b')][_0xaa6b('0x90')];_0x966ed7['body'][_0xaa6b('0x5b')]=_0x4952fc[_0xaa6b('0x5b')][_0xaa6b('0x91')];_0x966ed7[_0xaa6b('0x5b')][_0xaa6b('0x88')]=_0x4952fc['body'][_0xaa6b('0x92')];break;case _0xaa6b('0x93'):_0x966ed7[_0xaa6b('0x5b')][_0xaa6b('0x88')]=_0x4952fc[_0xaa6b('0x5b')][0x0][_0xaa6b('0x2b')]['id'];_0x966ed7[_0xaa6b('0x5b')]['from']=_0x4952fc[_0xaa6b('0x5b')][0x0][_0xaa6b('0x2b')]['from'];_0x966ed7['body']['body']=_0x4952fc[_0xaa6b('0x5b')][0x0][_0xaa6b('0x2b')][_0xaa6b('0x91')];break;case _0xaa6b('0x94'):_0x966ed7[_0xaa6b('0x5b')][_0xaa6b('0x81')]=_0x4952fc[_0xaa6b('0x5b')]['from'];_0x966ed7[_0xaa6b('0x5b')][_0xaa6b('0x5b')]=_0x4952fc[_0xaa6b('0x5b')][_0xaa6b('0x2b')];_0x966ed7[_0xaa6b('0x5b')][_0xaa6b('0x88')]=_0x4952fc['body'][_0xaa6b('0x95')];break;}}if(_0x966ed7[_0xaa6b('0x5b')]['id']){delete _0x966ed7['body']['id'];}if(_[_0xaa6b('0x96')](_0x966ed7['body']['from'])){throw new db[(_0xaa6b('0x79'))][(_0xaa6b('0x7a'))]('from\x20is\x20mandatory');}if(_[_0xaa6b('0x96')](_0x966ed7['body']['body'])||_0x966ed7['body'][_0xaa6b('0x5b')]===''){throw new db[(_0xaa6b('0x79'))][(_0xaa6b('0x7a'))](_0xaa6b('0x97'));}if(_[_0xaa6b('0x96')](_0x966ed7[_0xaa6b('0x5b')]['mapKey'])){throw new db['Sequelize'][(_0xaa6b('0x7a'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3dc999);}if(!_['includes'](_0x3dc999,_0x966ed7[_0xaa6b('0x5b')][_0xaa6b('0x98')])){throw new db[(_0xaa6b('0x79'))][(_0xaa6b('0x7a'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3dc999);}_0x36dc98[_0x966ed7['body'][_0xaa6b('0x98')]]=_0x966ed7[_0xaa6b('0x5b')]['from'];return db[_0xaa6b('0x99')][_0xaa6b('0x59')]({'where':{'id':_0x966ed7[_0xaa6b('0x73')][_0xaa6b('0x9a')]},'include':[{'model':db['CmContact'],'as':_0xaa6b('0x9b'),'where':_0x36dc98,'limit':0x1,'order':[[_0xaa6b('0x7d'),_0xaa6b('0x9c')]]}]});})[_0xaa6b('0x22')](handleEntityNotFound(_0xefd8e0,null))[_0xaa6b('0x22')](function(_0x371f78){if(_0x371f78){_0x966ed7[_0xaa6b('0x9d')]=_[_0xaa6b('0x9e')](_0x371f78,['Contacts']);if(_0x371f78[_0xaa6b('0x9b')][_0xaa6b('0x48')]){return _0x371f78[_0xaa6b('0x9b')][0x0];}var _0x4f85a5=_[_0xaa6b('0x9f')](_0x966ed7[_0xaa6b('0x5b')],{'firstName':_0x966ed7[_0xaa6b('0x5b')]['from'],'ListId':_0x371f78['id']});_0x4f85a5[_0x966ed7[_0xaa6b('0x5b')][_0xaa6b('0x98')]]=_0x966ed7[_0xaa6b('0x5b')]['from'];return db[_0xaa6b('0x78')][_0xaa6b('0x5a')](_0x4f85a5,{'fields':_0x86892c,'raw':!![]});}})[_0xaa6b('0x22')](handleEntityNotFound(_0xefd8e0,null))[_0xaa6b('0x22')](function(_0x32f50e){if(_0x32f50e){_0x966ed7[_0xaa6b('0xa0')]=_0x32f50e;var _0x1cc996={'ContactId':_0x32f50e['id'],'phone':_0x966ed7[_0xaa6b('0x5b')]['from'],'SmsAccountId':_0x4952fc[_0xaa6b('0x63')]['id']};var _0x551ded={'ContactId':_0x32f50e['id'],'SmsAccountId':_0x4952fc[_0xaa6b('0x63')]['id'],'closed':![]};return db[_0xaa6b('0xa1')][_0xaa6b('0x59')]({'where':_0x551ded})[_0xaa6b('0x22')](function(_0x405307){if(_0x405307){return[_0x405307,![]];}return db[_0xaa6b('0xa1')][_0xaa6b('0x5a')](_0x1cc996)[_0xaa6b('0x22')](function(_0x4bfa61){return[_0x4bfa61,!![]];});});}})[_0xaa6b('0xa2')](function(_0x267dc4,_0x1a2552){_0x966ed7[_0xaa6b('0xa3')]=_0x267dc4[_0xaa6b('0x3c')]({'plain':!![]});_0x966ed7[_0xaa6b('0xa3')]['created']=![];if(_0x1a2552){if(_0x966ed7[_0xaa6b('0x73')][_0xaa6b('0xa4')]){_0x966ed7[_0xaa6b('0x74')][_0xaa6b('0xa5')]({'id':0x0,'priority':_0x966ed7[_0xaa6b('0x74')][_0xaa6b('0x48')]+0x1,'app':_0xaa6b('0xa6'),'appdata':_0xaa6b('0xa7'),'interval':_0xaa6b('0xa8')});}_0x966ed7['interaction'][_0xaa6b('0xa9')]=!![];}return db['SmsMessage'][_0xaa6b('0x5a')]({'phone':_0x966ed7[_0xaa6b('0x5b')]['from'],'messageId':_0x966ed7[_0xaa6b('0x5b')]['messageId'],'body':_0x966ed7[_0xaa6b('0x5b')][_0xaa6b('0x5b')],'SmsAccountId':_0x4952fc['params']['id'],'SmsInteractionId':_0x267dc4['id'],'direction':'in','ContactId':_0x267dc4[_0xaa6b('0xaa')],'AttachmentId':_0x966ed7[_0xaa6b('0x5b')][_0xaa6b('0xab')]});})[_0xaa6b('0x22')](function(_0x36ed7b){_0x966ed7['message']=_0x36ed7b;if(_0x966ed7['interaction'][_0xaa6b('0xac')]){return db[_0xaa6b('0xad')][_0xaa6b('0x59')]({'attributes':['id','name'],'where':{'id':_0x966ed7[_0xaa6b('0xa3')][_0xaa6b('0xac')]}})[_0xaa6b('0x22')](function(_0x233592){if(_0x233592){_0x966ed7[_0xaa6b('0x74')][_0xaa6b('0xae')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x233592['name']+','+(_0x966ed7[_0xaa6b('0x73')]['waitForTheAssignedAgent']||0xa),'interval':_0xaa6b('0xa8')});}return respondWithRpcPromise('Start',_0xaa6b('0xaf'),_0x966ed7);});}return respondWithRpcPromise('Start',_0xaa6b('0xaf'),_0x966ed7);})[_0xaa6b('0x22')](function(_0x406095){if(_0x406095){var _0x5662ff=0xc8;var _0x2d5178='receiveMessage';logger['info'](_0xaa6b('0x25'),_0x2d5178,_0x5662ff,_0xaa6b('0xb0'));logger['debug'](_0xaa6b('0xb1'),_0x2d5178,_0x5662ff,'entity\x20found',JSON[_0xaa6b('0x27')](_0x406095));if(_0x966ed7['account']['type']==='twilio'){return _0xefd8e0[_0xaa6b('0x2f')](_0x5662ff)[_0xaa6b('0x36')]('Content-Type',_0xaa6b('0xb2'))[_0xaa6b('0xb3')]('\x0a');}else{return _0xefd8e0[_0xaa6b('0x2f')](_0x5662ff)[_0xaa6b('0x31')](_0x406095);}}})[_0xaa6b('0x2d')](handleError(_0xefd8e0,null));};exports['addApplications']=function(_0x4f4f1b,_0x65b264){var _0x43b242=_0x4f4f1b[_0xaa6b('0x63')]['id'];var _0x13147f=_0x4f4f1b[_0xaa6b('0x5b')];var _0x532497=0xc8;var _0x3b0bd5=null;return db['sequelize'][_0xaa6b('0xb4')]({'isolationLevel':db[_0xaa6b('0xb5')][_0xaa6b('0xb6')][_0xaa6b('0xb7')][_0xaa6b('0xb8')]},function(_0x39c550){return db[_0xaa6b('0x40')]['findOne']({'where':{'id':_0x43b242},'transaction':_0x39c550})[_0xaa6b('0x22')](function(_0xa1bcdf){if(_0xa1bcdf){return db['SmsApplication']['destroy']({'where':{'SmsAccountId':_0x43b242},'transaction':_0x39c550})[_0xaa6b('0x22')](function(){var _0x48e858=_[_0xaa6b('0xb9')](_0x13147f,function(_0x43735d){_0x43735d[_0xaa6b('0x66')]=_0x43b242;return _0x43735d;});return db['SmsApplication']['bulkCreate'](_0x48e858,{'transaction':_0x39c550});});}else{_0x532497=0x194;_0x3b0bd5=[];}});})[_0xaa6b('0x22')](function(){if(_0x532497!==0x194){return db[_0xaa6b('0x71')][_0xaa6b('0xba')]({'where':{'SmsAccountId':_0x43b242},'order':_0xaa6b('0x76')})[_0xaa6b('0x22')](function(_0x19c521){_0x3b0bd5=_0x19c521;});}})[_0xaa6b('0x2d')](function(_0x208aad){_0x532497=0x1f4;logger[_0xaa6b('0x28')](_0x208aad[_0xaa6b('0xbb')]);if(_0x208aad[_0xaa6b('0x3e')]){delete _0x208aad[_0xaa6b('0x3e')];}_0x3b0bd5=_0x208aad;})[_0xaa6b('0xbc')](function(){if(_0x3b0bd5===null){_0x65b264[_0xaa6b('0x2e')](_0x532497);}else{if(_0x532497===0x1f4){_0x65b264[_0xaa6b('0x2f')](_0x532497)[_0xaa6b('0xb3')](_0x3b0bd5);}else{_0x65b264[_0xaa6b('0x2f')](_0x532497)[_0xaa6b('0x31')](_0x3b0bd5);}}});};exports[_0xaa6b('0xbd')]=function(_0x593f63,_0xc27ff1,_0x16aae9){var _0x576532={};var _0x34efdb={};var _0xb37ea3;var _0x47f4c6;return db['SmsAccount'][_0xaa6b('0x68')]({'where':{'id':_0x593f63[_0xaa6b('0x63')]['id']}})[_0xaa6b('0x22')](handleEntityNotFound(_0xc27ff1,null))[_0xaa6b('0x22')](function(_0x13b876){if(_0x13b876){_0xb37ea3=_0x13b876;_0x34efdb[_0xaa6b('0x45')]=_[_0xaa6b('0x69')](db[_0xaa6b('0x71')][_0xaa6b('0x41')]);_0x34efdb['query']=_[_0xaa6b('0x69')](_0x593f63[_0xaa6b('0x43')]);_0x34efdb[_0xaa6b('0x4e')]=_[_0xaa6b('0x44')](_0x34efdb[_0xaa6b('0x45')],_0x34efdb['query']);_0x576532[_0xaa6b('0x46')]=_[_0xaa6b('0x44')](_0x34efdb[_0xaa6b('0x45')],qs[_0xaa6b('0x47')](_0x593f63[_0xaa6b('0x43')]['fields']));_0x576532[_0xaa6b('0x46')]=_0x576532[_0xaa6b('0x46')][_0xaa6b('0x48')]?_0x576532[_0xaa6b('0x46')]:_0x34efdb['model'];_0x576532[_0xaa6b('0x4a')]=qs['sort'](_0x593f63[_0xaa6b('0x43')]['sort']);_0x576532['where']=qs['filters'](_[_0xaa6b('0x4d')](_0x593f63[_0xaa6b('0x43')],_0x34efdb['filters']));if(_0x593f63[_0xaa6b('0x43')][_0xaa6b('0x4f')]){_0x576532['where']=_[_0xaa6b('0x50')](_0x576532[_0xaa6b('0x4c')],{'$or':_[_0xaa6b('0xb9')](_0x576532[_0xaa6b('0x46')],function(_0x35230f){var _0xb73c0f={};_0xb73c0f[_0x35230f]={'$like':'%'+_0x593f63['query'][_0xaa6b('0x4f')]+'%'};return _0xb73c0f;})});}_0x576532=_[_0xaa6b('0x50')]({},_0x576532,_0x593f63[_0xaa6b('0x53')]);return _0xb37ea3[_0xaa6b('0xbd')](_0x576532);}})[_0xaa6b('0x22')](function(_0xe186d7){if(_0xe186d7){_0x47f4c6=_0xe186d7['length'];if(!_0x593f63[_0xaa6b('0x43')][_0xaa6b('0x6a')](_0xaa6b('0x49'))){_0x576532['limit']=qs['limit'](_0x593f63['query'][_0xaa6b('0x34')]);_0x576532[_0xaa6b('0x32')]=qs[_0xaa6b('0x32')](_0x593f63[_0xaa6b('0x43')][_0xaa6b('0x32')]);}return _0xb37ea3['getApplications'](_0x576532);}})[_0xaa6b('0x22')](function(_0x4598e7){if(_0x4598e7){return _0x4598e7?{'count':_0x47f4c6,'rows':_0x4598e7}:null;}})[_0xaa6b('0x22')](respondWithResult(_0xc27ff1,null))['catch'](handleError(_0xc27ff1,null));};exports[_0xaa6b('0xbe')]=function(_0x4bf4a6,_0x412e57,_0x501247){var _0x54bb15={'raw':![],'where':{}};var _0x1a81f2={};var _0x5103c1={'count':0x0,'rows':[]};return db[_0xaa6b('0x40')][_0xaa6b('0x68')]({'where':{'id':_0x4bf4a6[_0xaa6b('0x63')]['id']}})[_0xaa6b('0x22')](handleEntityNotFound(_0x412e57,null))[_0xaa6b('0x22')](function(_0x4bfa92){if(_0x4bfa92){_0x1a81f2[_0xaa6b('0x45')]=_[_0xaa6b('0x69')](db['SmsInteraction'][_0xaa6b('0x41')]);_0x1a81f2[_0xaa6b('0x43')]=_['keys'](_0x4bf4a6[_0xaa6b('0x43')]);_0x1a81f2[_0xaa6b('0x4e')]=_['intersection'](_0x1a81f2[_0xaa6b('0x45')],_0x1a81f2[_0xaa6b('0x43')]);_0x54bb15['attributes']=_[_0xaa6b('0x44')](_0x1a81f2['model'],qs[_0xaa6b('0x47')](_0x4bf4a6[_0xaa6b('0x43')][_0xaa6b('0x47')]));_0x54bb15[_0xaa6b('0x46')]=_0x54bb15[_0xaa6b('0x46')][_0xaa6b('0x48')]?_0x54bb15['attributes']:_0x1a81f2[_0xaa6b('0x45')];if(!_0x4bf4a6[_0xaa6b('0x43')][_0xaa6b('0x6a')](_0xaa6b('0x49'))){_0x54bb15[_0xaa6b('0x34')]=qs[_0xaa6b('0x34')](_0x4bf4a6[_0xaa6b('0x43')][_0xaa6b('0x34')]);_0x54bb15[_0xaa6b('0x32')]=qs[_0xaa6b('0x32')](_0x4bf4a6['query'][_0xaa6b('0x32')]);}_0x54bb15[_0xaa6b('0x4a')]=qs['sort'](_0x4bf4a6[_0xaa6b('0x43')][_0xaa6b('0x4b')]);_0x54bb15[_0xaa6b('0x4c')]=qs[_0xaa6b('0x4e')](_[_0xaa6b('0x4d')](_0x4bf4a6[_0xaa6b('0x43')],_0x1a81f2['filters']));_0x54bb15[_0xaa6b('0x4c')][_0xaa6b('0x66')]=_0x4bfa92['id'];if(_0x4bf4a6[_0xaa6b('0x43')]['filter']){_0x54bb15['where']=_[_0xaa6b('0x50')](_0x54bb15[_0xaa6b('0x4c')],{'$or':_['map'](_0x54bb15['attributes'],function(_0x396276){var _0x4366a0={};_0x4366a0[_0x396276]={'$like':'%'+_0x4bf4a6['query']['filter']+'%'};return _0x4366a0;})});}_0x54bb15=_[_0xaa6b('0x50')]({},_0x54bb15,_0x4bf4a6[_0xaa6b('0x53')]);return db[_0xaa6b('0xa1')][_0xaa6b('0x35')]({'where':_0x54bb15[_0xaa6b('0x4c')]})[_0xaa6b('0x22')](function(_0x51f17a){_0x5103c1[_0xaa6b('0x35')]=_0x51f17a;if(_0x4bf4a6[_0xaa6b('0x43')]['includeAll']){_0x54bb15['include']=[{'model':db[_0xaa6b('0x78')],'as':_0xaa6b('0xbf'),'required':![]},{'model':db[_0xaa6b('0xad')],'as':'Owner','attributes':[_0xaa6b('0x3e'),_0xaa6b('0xc0'),_0xaa6b('0xc1')],'required':![]},{'model':db[_0xaa6b('0xc2')],'as':_0xaa6b('0xc3'),'attributes':['id',_0xaa6b('0x3e'),_0xaa6b('0xc4')],'where':_0x4bf4a6['query'][_0xaa6b('0xc5')]?{'id':_0x4bf4a6['query'][_0xaa6b('0xc5')]}:undefined,'required':_0x4bf4a6[_0xaa6b('0x43')]['tag']?!![]:![]}];}return db[_0xaa6b('0xa1')]['findAll'](_0x54bb15);})[_0xaa6b('0x22')](function(_0x289c5b){_0x5103c1[_0xaa6b('0x6b')]=_0x289c5b;return _0x5103c1;});}})[_0xaa6b('0x22')](respondWithFilteredResult(_0x412e57,_0x54bb15))['catch'](handleError(_0x412e57,null));};exports[_0xaa6b('0xb3')]=function(_0x47073c,_0x45e433,_0x480563){var _0x234b0d,_0x17967e,_0x3eab74;if(_[_0xaa6b('0x96')](_0x47073c[_0xaa6b('0x5b')][_0xaa6b('0x5b')])||_0x47073c[_0xaa6b('0x5b')][_0xaa6b('0x5b')]===''){throw new db[(_0xaa6b('0x79'))]['ValidationError'](_0xaa6b('0x97'));}if(_['isNil'](_0x47073c[_0xaa6b('0x5b')]['to'])){throw new db[(_0xaa6b('0x79'))]['ValidationError'](_0xaa6b('0xc6'));}_0x234b0d=_0x47073c[_0xaa6b('0x5b')]['to'];return db[_0xaa6b('0x40')][_0xaa6b('0x59')]({'where':{'id':_0x47073c[_0xaa6b('0x63')]['id']},'include':[{'model':db[_0xaa6b('0x99')],'as':'List','include':[{'model':db[_0xaa6b('0x78')],'as':_0xaa6b('0x9b'),'where':{'mobile':_0x234b0d},'limit':0x1,'order':[[_0xaa6b('0x7d'),_0xaa6b('0x9c')]]}]}]})[_0xaa6b('0x22')](handleEntityNotFound(_0x45e433,null))[_0xaa6b('0x22')](function(_0x2bb14c){if(_0x2bb14c&&_0x2bb14c[_0xaa6b('0xc7')]){_0x17967e=_0x2bb14c['get']({'plain':!![]});if(_0x17967e['List']&&_0x17967e[_0xaa6b('0xc7')]['Contacts'][_0xaa6b('0x48')]){return _0x17967e[_0xaa6b('0xc7')][_0xaa6b('0x9b')][0x0];}return db[_0xaa6b('0x78')][_0xaa6b('0x5a')](_[_0xaa6b('0x9f')](_0x47073c[_0xaa6b('0x5b')],{'firstName':_0x234b0d,'mobile':_0x234b0d,'phone':_0x234b0d,'ListId':_0x17967e[_0xaa6b('0x9a')]}));}})[_0xaa6b('0x22')](handleEntityNotFound(_0x45e433,null))[_0xaa6b('0x22')](function(_0x487df5){if(_0x487df5){_0x3eab74=_0x487df5;return db[_0xaa6b('0xa1')][_0xaa6b('0x59')]({'where':{'ContactId':_0x3eab74['id'],'closed':![],'SmsAccountId':_0x17967e['id']}})['then'](function(_0x8573a6){if(_0x8573a6){return[_0x8573a6,![]];}return db[_0xaa6b('0xa1')]['create']({'UserId':_0x47073c[_0xaa6b('0x5c')]['id'],'ContactId':_0x3eab74['id'],'SmsAccountId':_0x17967e['id'],'phone':_0x234b0d,'firstMsgDirection':'out','Messages':[_[_0xaa6b('0x50')](_0x47073c[_0xaa6b('0x5b')],{'read':![],'body':_0x47073c[_0xaa6b('0x5b')][_0xaa6b('0x5b')],'phone':_0x234b0d,'SmsAccountId':_0x17967e['id'],'UserId':_0x47073c[_0xaa6b('0x5c')]['id'],'ContactId':_0x3eab74['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0xaa6b('0xc8')}]})[_0xaa6b('0x22')](function(_0x5f0c73){return[_0x5f0c73,!![]];});});}})[_0xaa6b('0xa2')](function(_0x57fa65,_0x5a5e36){if(_0x5a5e36){return _0x57fa65;}return db[_0xaa6b('0xc9')][_0xaa6b('0x5a')](_[_0xaa6b('0x50')](_0x47073c[_0xaa6b('0x5b')],{'read':![],'body':_0x47073c['body']['body'],'phone':_0x234b0d,'SmsAccountId':_0x17967e['id'],'SmsInteractionId':_0x57fa65['id'],'UserId':_0x47073c[_0xaa6b('0x5c')]['id'],'ContactId':_0x3eab74['id']}))['then'](function(_0x4e5b0d){_0x57fa65[_0xaa6b('0xca')][_0xaa6b('0xc8')]=[];_0x57fa65['dataValues']['Messages'][_0xaa6b('0xa5')](_0x4e5b0d[_0xaa6b('0xca')]);return _0x57fa65;});})[_0xaa6b('0x22')](respondWithResult(_0x45e433,null))[_0xaa6b('0x2d')](handleError(_0x45e433,null));};exports[_0xaa6b('0x2f')]=function(_0x5ceb43,_0x35f63b,_0x3a1589){if(_0x5ceb43[_0xaa6b('0x5b')]['id']){delete _0x5ceb43[_0xaa6b('0x5b')]['id'];}var _0x58427f,_0x448980,_0x217984;return db[_0xaa6b('0x40')][_0xaa6b('0x59')]({'where':{'id':_0x5ceb43[_0xaa6b('0x63')]['id']}})[_0xaa6b('0x22')](handleEntityNotFound(_0x35f63b,null))[_0xaa6b('0x22')](function(_0x233be2){if(_0x233be2){_0x217984=_0x233be2;logger[_0xaa6b('0x24')](_0xaa6b('0x25'),'status',_0xaa6b('0xcb'),_0x233be2['type'],util['inspect'](_0x5ceb43[_0xaa6b('0x5b')],{'showHidden':![],'depth':null}));switch(_0x233be2[_0xaa6b('0x51')]){case _0xaa6b('0x84'):if(_0x5ceb43[_0xaa6b('0x5b')][_0xaa6b('0xcc')]&&_0x5ceb43['body'][_0xaa6b('0x2f')]){_0x448980=_0x5ceb43['body'][_0xaa6b('0x2f')];return db[_0xaa6b('0xc9')][_0xaa6b('0x59')]({'where':{'messageId':_0x5ceb43[_0xaa6b('0x5b')][_0xaa6b('0xcc')]}});}break;case _0xaa6b('0x86'):if(_0x5ceb43[_0xaa6b('0x5b')][_0xaa6b('0xcd')]&&_0x5ceb43[_0xaa6b('0x5b')]['statusInt']){_0x448980=_0x5ceb43[_0xaa6b('0x5b')]['statusInt'];return db[_0xaa6b('0xc9')][_0xaa6b('0x59')]({'where':{'messageId':_0x5ceb43[_0xaa6b('0x5b')]['requestid']}});}break;case _0xaa6b('0x87'):if(_0x5ceb43[_0xaa6b('0x5b')]['message_id']&&_0x5ceb43['body'][_0xaa6b('0xce')]){_0x448980=_0x5ceb43[_0xaa6b('0x5b')]['status_code'];return db[_0xaa6b('0xc9')][_0xaa6b('0x59')]({'where':{'messageId':_0x5ceb43[_0xaa6b('0x5b')][_0xaa6b('0xcf')]}});}break;case _0xaa6b('0xd0'):var _0x418e5e=_0x5ceb43[_0xaa6b('0x5b')][_0xaa6b('0x8b')][0x0];if(_0x418e5e[_0xaa6b('0x88')]&&_0x418e5e[_0xaa6b('0x2f')][_0xaa6b('0xd1')]===_0xaa6b('0xd2')){_0x448980=_0x418e5e[_0xaa6b('0x2f')][_0xaa6b('0xd1')];return db[_0xaa6b('0xc9')][_0xaa6b('0x59')]({'where':{'messageId':_0x418e5e['messageId']}});}break;case _0xaa6b('0x8f'):if(_0x5ceb43[_0xaa6b('0x5b')][_0xaa6b('0x88')]&&_0x5ceb43[_0xaa6b('0x5b')][_0xaa6b('0x2f')]){_0x448980=_0x5ceb43[_0xaa6b('0x5b')][_0xaa6b('0x2f')];return db['SmsMessage']['find']({'where':{'messageId':_0x5ceb43[_0xaa6b('0x5b')][_0xaa6b('0x88')]}});}break;case _0xaa6b('0x93'):if(_0x5ceb43[_0xaa6b('0x5b')][0x0]['message']['id']){_0x448980=_0x5ceb43[_0xaa6b('0x5b')][0x0]['type'];return db['SmsMessage'][_0xaa6b('0x59')]({'where':{'messageId':_0x5ceb43[_0xaa6b('0x5b')][0x0][_0xaa6b('0x2b')]['id']}});}break;case _0xaa6b('0x94'):if(_0x5ceb43['body']['redif']&&_0x5ceb43['body'][_0xaa6b('0x2f')]){_0x448980=_0x5ceb43[_0xaa6b('0x5b')]['status'];return db[_0xaa6b('0xc9')][_0xaa6b('0x59')]({'where':{'messageId':_0x5ceb43['body'][_0xaa6b('0xd3')]}});}break;}}})[_0xaa6b('0x22')](handleEntityNotFound(_0x35f63b,null))[_0xaa6b('0x22')](function(_0x2c717d){if(_0x2c717d){_0x58427f=_0x2c717d;switch(_0x217984[_0xaa6b('0x51')]){case _0xaa6b('0x84'):if(_0x448980===_0xaa6b('0xd2')){return _0x58427f[_0xaa6b('0x3a')]({'read':!![]});}else{logger[_0xaa6b('0x28')](_0xaa6b('0x25'),_0xaa6b('0x2f'),_0xaa6b('0x84'),util[_0xaa6b('0xd4')](_0x5ceb43[_0xaa6b('0x5b')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x448980==='1'){return _0x58427f['update']({'read':!![]});}else{logger[_0xaa6b('0x28')](_0xaa6b('0x25'),_0xaa6b('0x2f'),_0xaa6b('0x84'),util[_0xaa6b('0xd4')](_0x5ceb43[_0xaa6b('0x5b')],{'showHidden':![],'depth':null}));}break;case _0xaa6b('0x87'):if(!_0x5ceb43['body'][_0xaa6b('0xd5')]&&_0x448980>=0xc8&&_0x448980<=0xce){return _0x58427f['update']({'read':!![]});}else{logger[_0xaa6b('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xaa6b('0x2f'),_0xaa6b('0x87'),util[_0xaa6b('0xd4')](_0x5ceb43[_0xaa6b('0x5b')],{'showHidden':![],'depth':null}));}break;case _0xaa6b('0xd0'):var _0x5c02e3=_0x5ceb43[_0xaa6b('0x5b')][_0xaa6b('0x8b')][0x0];if(_0x5c02e3['status'][_0xaa6b('0xd1')]===_0xaa6b('0xd2')){return _0x58427f[_0xaa6b('0x3a')]({'read':!![]});}else{logger[_0xaa6b('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xaa6b('0x2f'),_0xaa6b('0xd0'),util[_0xaa6b('0xd4')](_0x5ceb43['body'],{'showHidden':![],'depth':null}));}break;case _0xaa6b('0x8f'):if(_0x448980==_0xaa6b('0xd6')||_0x448980==_0xaa6b('0xd7')){return _0x58427f['update']({'read':!![]});}else{logger[_0xaa6b('0x28')](_0xaa6b('0x25'),'status',_0xaa6b('0x8f'),util[_0xaa6b('0xd4')](_0x5ceb43['body'],{'showHidden':![],'depth':null}));}break;case _0xaa6b('0x93'):if(_0x448980==_0xaa6b('0xd8')){return _0x58427f['update']({'read':!![]});}else{logger[_0xaa6b('0x28')](_0xaa6b('0x25'),_0xaa6b('0x2f'),_0xaa6b('0x93'),util['inspect'](_0x5ceb43[_0xaa6b('0x5b')],{'showHidden':![],'depth':null}));}break;case _0xaa6b('0x94'):if(_0x448980===_0xaa6b('0xd9')||_0x448980===_0xaa6b('0xda')){return _0x58427f[_0xaa6b('0x3a')]({'read':!![]});}else{logger[_0xaa6b('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xaa6b('0x2f'),_0xaa6b('0x94'),util['inspect'](_0x5ceb43[_0xaa6b('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x58427f;}})[_0xaa6b('0x22')](respondWithResult(_0x35f63b,null))[_0xaa6b('0x2d')](handleError(_0x35f63b,null));};exports[_0xaa6b('0xdb')]=function(_0x115d87,_0x3559dc,_0x334ba2){var _0x1839e9,_0x290fef,_0x373249;return db[_0xaa6b('0x40')][_0xaa6b('0x59')]({'where':{'id':_0x115d87[_0xaa6b('0x63')]['id']}})[_0xaa6b('0x22')](handleEntityNotFound(_0x3559dc,null))[_0xaa6b('0x22')](function(_0x51e133){if(_0x51e133){_0x373249=_0x51e133;logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xaa6b('0xcb'),_0x51e133[_0xaa6b('0x51')],util[_0xaa6b('0xd4')](_0x115d87[_0xaa6b('0x43')],{'showHidden':![],'depth':null}));switch(_0x51e133[_0xaa6b('0x51')]){case _0xaa6b('0x8c'):if(_0x115d87['query'][_0xaa6b('0xdc')]&&_0x115d87[_0xaa6b('0x43')][_0xaa6b('0xdd')]){_0x290fef=_0x115d87[_0xaa6b('0x43')][_0xaa6b('0xdd')];return db[_0xaa6b('0xc9')][_0xaa6b('0x59')]({'where':{'messageId':_0x115d87[_0xaa6b('0x43')][_0xaa6b('0xdc')]}});}break;}}})[_0xaa6b('0x22')](handleEntityNotFound(_0x3559dc,null))[_0xaa6b('0x22')](function(_0x4e13ef){if(_0x4e13ef){_0x1839e9=_0x4e13ef;switch(_0x373249[_0xaa6b('0x51')]){case _0xaa6b('0x8c'):if(_0x290fef==='2'||_0x290fef==='6'){return _0x1839e9['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xaa6b('0x8c'),util['inspect'](_0x115d87[_0xaa6b('0x43')],{'showHidden':![],'depth':null}));};break;}return _0x1839e9;}})[_0xaa6b('0x22')](respondWithResult(_0x3559dc,null))[_0xaa6b('0x2d')](handleError(_0x3559dc,null));};exports[_0xaa6b('0xde')]=function(_0xe4bfaa,_0x3b4403,_0x412506){return db[_0xaa6b('0x40')]['find']({'where':{'id':_0xe4bfaa[_0xaa6b('0x63')]['id']}})[_0xaa6b('0x22')](handleEntityNotFound(_0x3b4403,null))['then'](function(_0x503166){if(_0x503166){return _0x503166['addAgents'](_0xe4bfaa['body'][_0xaa6b('0x6d')],_[_0xaa6b('0x9e')](_0xe4bfaa['body'],['ids','id'])||{})[_0xaa6b('0xa2')](function(_0x818ed2){for(var _0x89a4c4=0x0;_0x89a4c4<_0xe4bfaa[_0xaa6b('0x5b')][_0xaa6b('0x6d')][_0xaa6b('0x48')];_0x89a4c4+=0x1){socket['emit'](_0xaa6b('0xdf'),{'UserId':Number(_0xe4bfaa[_0xaa6b('0x5b')][_0xaa6b('0x6d')][_0x89a4c4]),'SmsAccountId':Number(_0xe4bfaa[_0xaa6b('0x63')]['id'])});}return _0x818ed2;});}})[_0xaa6b('0x22')](respondWithResult(_0x3b4403,null))[_0xaa6b('0x2d')](handleError(_0x3b4403,null));};exports[_0xaa6b('0xe0')]=function(_0x1ccbc4,_0x42d460,_0x40ab8e){return db[_0xaa6b('0x40')][_0xaa6b('0x59')]({'where':{'id':_0x1ccbc4[_0xaa6b('0x63')]['id']}})['then'](handleEntityNotFound(_0x42d460,null))['then'](function(_0x1491b4){if(_0x1491b4){return _0x1491b4[_0xaa6b('0xe0')](_0x1ccbc4['query'][_0xaa6b('0x6d')])['then'](function(){if(_[_0xaa6b('0xe1')](_0x1ccbc4[_0xaa6b('0x43')]['ids'])){for(var _0x21bc4a=0x0;_0x21bc4a<_0x1ccbc4[_0xaa6b('0x43')]['ids'][_0xaa6b('0x48')];_0x21bc4a+=0x1){socket[_0xaa6b('0xe2')](_0xaa6b('0xe3'),{'UserId':Number(_0x1ccbc4[_0xaa6b('0x43')]['ids'][_0x21bc4a]),'SmsAccountId':Number(_0x1ccbc4[_0xaa6b('0x63')]['id'])});}}else{socket[_0xaa6b('0xe2')](_0xaa6b('0xe3'),{'UserId':Number(_0x1ccbc4[_0xaa6b('0x43')][_0xaa6b('0x6d')]),'SmsAccountId':Number(_0x1ccbc4['params']['id'])});}});}})[_0xaa6b('0x22')](respondWithStatusCode(_0x42d460,null))[_0xaa6b('0x2d')](handleError(_0x42d460,null));};exports['getAgents']=function(_0xcd7551,_0x116e75,_0x4e6c2d){var _0x469c5a={};var _0x955f29={};var _0x361748;var _0x5dc028;return db[_0xaa6b('0x40')][_0xaa6b('0x68')]({'where':{'id':_0xcd7551[_0xaa6b('0x63')]['id']}})[_0xaa6b('0x22')](handleEntityNotFound(_0x116e75,null))[_0xaa6b('0x22')](function(_0x173455){if(_0x173455){_0x361748=_0x173455;_0x955f29[_0xaa6b('0x45')]=_['keys'](db[_0xaa6b('0xad')][_0xaa6b('0x41')]);_0x955f29['query']=_[_0xaa6b('0x69')](_0xcd7551[_0xaa6b('0x43')]);_0x955f29[_0xaa6b('0x4e')]=_[_0xaa6b('0x44')](_0x955f29[_0xaa6b('0x45')],_0x955f29[_0xaa6b('0x43')]);_0x469c5a['attributes']=_[_0xaa6b('0x44')](_0x955f29[_0xaa6b('0x45')],qs[_0xaa6b('0x47')](_0xcd7551[_0xaa6b('0x43')][_0xaa6b('0x47')]));_0x469c5a[_0xaa6b('0x46')]=_0x469c5a[_0xaa6b('0x46')][_0xaa6b('0x48')]?_0x469c5a['attributes']:_0x955f29['model'];_0x469c5a[_0xaa6b('0x4a')]=qs[_0xaa6b('0x4b')](_0xcd7551[_0xaa6b('0x43')][_0xaa6b('0x4b')]);_0x469c5a[_0xaa6b('0x4c')]=qs[_0xaa6b('0x4e')](_['pick'](_0xcd7551[_0xaa6b('0x43')],_0x955f29['filters']));if(_0xcd7551[_0xaa6b('0x43')][_0xaa6b('0x4f')]){_0x469c5a['where']=_[_0xaa6b('0x50')](_0x469c5a[_0xaa6b('0x4c')],{'$or':_[_0xaa6b('0xb9')](_0x469c5a['attributes'],function(_0x536390){var _0x1b08de={};_0x1b08de[_0x536390]={'$like':'%'+_0xcd7551[_0xaa6b('0x43')]['filter']+'%'};return _0x1b08de;})});}_0x469c5a=_[_0xaa6b('0x50')]({},_0x469c5a,_0xcd7551[_0xaa6b('0x53')]);return _0x361748[_0xaa6b('0xe4')](_0x469c5a);}})['then'](function(_0x29f0eb){if(_0x29f0eb){_0x5dc028=_0x29f0eb[_0xaa6b('0x48')];if(!_0xcd7551[_0xaa6b('0x43')][_0xaa6b('0x6a')](_0xaa6b('0x49'))){_0x469c5a[_0xaa6b('0x34')]=qs[_0xaa6b('0x34')](_0xcd7551[_0xaa6b('0x43')][_0xaa6b('0x34')]);_0x469c5a[_0xaa6b('0x32')]=qs[_0xaa6b('0x32')](_0xcd7551[_0xaa6b('0x43')][_0xaa6b('0x32')]);}return _0x361748[_0xaa6b('0xe4')](_0x469c5a);}})[_0xaa6b('0x22')](function(_0x2aa468){if(_0x2aa468){return _0x2aa468?{'count':_0x5dc028,'rows':_0x2aa468}:null;}})[_0xaa6b('0x22')](respondWithResult(_0x116e75,null))['catch'](handleError(_0x116e75,null));}; \ No newline at end of file +var _0x92d1=['jayson/promise','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','get','SmsAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','fieldName','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','options','SmsAccount','include','findAll','catch','params','length','includeAll','merge','find','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','SmsAccountId','Disposition','getDispositions','findOne','rawAttributes','pick','rows','removeDispositions','ids','addAnswer','getAnswers','removeAnswers','notify','sms','SmsApplication','Applications','account','priority','asc','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','Body','messageId','MessageSid','skebby','sender','text','connectel','clicksend','message_id','plivo','Text','MessageUUID','results','originatingAddress','segmentedMessage','replyMessageId','bandwidth','intelepeer','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmContact','Contacts','list','omit','contact','SmsInteraction','interaction','created','autoclose','push','close','SmsMessage','AttachmentId','UserId','User','applications','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','text/xml','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','Contact','internal','Tag','Tags','color','tag','List','DESC','defaults','out','Messages','dataValues','inspect','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','clickatell','redif','error_code','infobip','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','received\x20delivery\x20report\x20from','message-id','state','csc','addAgents','spread','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./smsAccount.socket','register'];(function(_0x41768c,_0x1b2884){var _0x3ab8c0=function(_0x15649d){while(--_0x15649d){_0x41768c['push'](_0x41768c['shift']());}};_0x3ab8c0(++_0x1b2884);}(_0x92d1,0x1b3));var _0x192d=function(_0x53c134,_0x169b6c){_0x53c134=_0x53c134-0x0;var _0x469a82=_0x92d1[_0x53c134];return _0x469a82;};'use strict';var emlformat=require(_0x192d('0x0'));var rimraf=require(_0x192d('0x1'));var zipdir=require(_0x192d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x192d('0x3'));var moment=require(_0x192d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x192d('0x5'));var util=require(_0x192d('0x6'));var path=require(_0x192d('0x7'));var sox=require('sox');var csv=require(_0x192d('0x8'));var ejs=require(_0x192d('0x9'));var fs=require('fs');var fs_extra=require(_0x192d('0xa'));var _=require('lodash');var squel=require(_0x192d('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x192d('0x8'));var querystring=require('querystring');var Papa=require(_0x192d('0xc'));var Redis=require(_0x192d('0xd'));var authService=require(_0x192d('0xe'));var qs=require(_0x192d('0xf'));var as=require(_0x192d('0x10'));var hardwareService=require(_0x192d('0x11'));var logger=require(_0x192d('0x12'))('api');var utils=require(_0x192d('0x13'));var config=require(_0x192d('0x14'));var licenseUtil=require(_0x192d('0x15'));var db=require('../../mysqldb')['db'];config[_0x192d('0x16')]=_['defaults'](config[_0x192d('0x16')],{'host':_0x192d('0x17'),'port':0x18eb});var socket=require(_0x192d('0x18'))(new Redis(config[_0x192d('0x16')]));require(_0x192d('0x19'))[_0x192d('0x1a')](socket);var jayson=require(_0x192d('0x1b'));var client=jayson['client'][_0x192d('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x1c7b5f,_0x2f2cd0,_0x5aafc7,_0x3b17e4){return new BPromise(function(_0x523f21,_0xa061c2){var _0x598c6b=_0x3b17e4||client;return _0x598c6b[_0x192d('0x1d')](_0x1c7b5f,_0x5aafc7)[_0x192d('0x1e')](function(_0x4fcef5){logger[_0x192d('0x1f')](_0x192d('0x20'),_0x2f2cd0,'request\x20sent');logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x2f2cd0,_0x192d('0x21'),JSON[_0x192d('0x22')](_0x4fcef5));if(_0x4fcef5[_0x192d('0x23')]){if(_0x4fcef5[_0x192d('0x23')]['code']===0x1f4){logger[_0x192d('0x23')]('SmsAccount,\x20%s,\x20%s',_0x2f2cd0,_0x4fcef5[_0x192d('0x23')][_0x192d('0x24')]);return _0xa061c2(_0x4fcef5['error'][_0x192d('0x24')]);}logger[_0x192d('0x23')](_0x192d('0x20'),_0x2f2cd0,_0x4fcef5[_0x192d('0x23')]['message']);return _0x523f21(_0x4fcef5[_0x192d('0x23')][_0x192d('0x24')]);}else{logger[_0x192d('0x1f')](_0x192d('0x20'),_0x2f2cd0,'request\x20sent');_0x523f21(_0x4fcef5[_0x192d('0x25')][_0x192d('0x24')]);}})['catch'](function(_0x34f062){logger[_0x192d('0x23')](_0x192d('0x20'),_0x2f2cd0,_0x34f062);_0xa061c2(_0x34f062);});});}function respondWithStatusCode(_0x291f83,_0x371834){_0x371834=_0x371834||0xcc;return function(_0x49189c){if(_0x49189c){return _0x291f83[_0x192d('0x26')](_0x371834);}return _0x291f83[_0x192d('0x27')](_0x371834)[_0x192d('0x28')]();};}function respondWithResult(_0x4ae6ca,_0x368d49){_0x368d49=_0x368d49||0xc8;return function(_0x219588){if(_0x219588){return _0x4ae6ca[_0x192d('0x27')](_0x368d49)['json'](_0x219588);}};}function respondWithFilteredResult(_0x6d9286,_0x40b963){return function(_0x26e7c8){if(_0x26e7c8){var _0x4fdeb9=typeof _0x40b963[_0x192d('0x29')]===_0x192d('0x2a')&&typeof _0x40b963[_0x192d('0x2b')]==='undefined';var _0x5a2a9a=_0x26e7c8[_0x192d('0x2c')];var _0x175663=_0x4fdeb9?0x0:_0x40b963[_0x192d('0x29')];var _0x1d05ed=_0x4fdeb9?_0x26e7c8[_0x192d('0x2c')]:_0x40b963[_0x192d('0x29')]+_0x40b963[_0x192d('0x2b')];var _0x26d68d;if(_0x1d05ed>=_0x5a2a9a){_0x1d05ed=_0x5a2a9a;_0x26d68d=0xc8;}else{_0x26d68d=0xce;}_0x6d9286[_0x192d('0x27')](_0x26d68d);return _0x6d9286[_0x192d('0x2d')](_0x192d('0x2e'),_0x175663+'-'+_0x1d05ed+'/'+_0x5a2a9a)[_0x192d('0x2f')](_0x26e7c8);}return null;};}function patchUpdates(_0x1b8a9a){return function(_0x240427){try{jsonpatch[_0x192d('0x30')](_0x240427,_0x1b8a9a,!![]);}catch(_0x3f3a33){return BPromise[_0x192d('0x31')](_0x3f3a33);}return _0x240427[_0x192d('0x32')]();};}function saveUpdates(_0x161405,_0x43920c){return function(_0x41b82a){if(_0x41b82a){return _0x41b82a[_0x192d('0x33')](_0x161405)['then'](function(_0x442462){return _0x442462;});}return null;};}function removeEntity(_0x107c2e,_0x22378c){return function(_0x107eec){if(_0x107eec){return _0x107eec[_0x192d('0x34')]()['then'](function(){var _0x1a6f05=_0x107eec[_0x192d('0x35')]({'plain':!![]});var _0x43b718=_0x192d('0x36');return db[_0x192d('0x37')][_0x192d('0x34')]({'where':{'type':_0x43b718,'resourceId':_0x1a6f05['id']}})[_0x192d('0x1e')](function(){return _0x107eec;});})[_0x192d('0x1e')](function(){_0x107c2e[_0x192d('0x27')](0xcc)[_0x192d('0x28')]();});}};}function handleEntityNotFound(_0x205d99,_0x593afc){return function(_0x3c01ec){if(!_0x3c01ec){_0x205d99[_0x192d('0x26')](0x194);}return _0x3c01ec;};}function handleError(_0x2adee5,_0x2dd198){_0x2dd198=_0x2dd198||0x1f4;return function(_0x1a7907){logger[_0x192d('0x23')](_0x1a7907[_0x192d('0x38')]);if(_0x1a7907[_0x192d('0x39')]){delete _0x1a7907[_0x192d('0x39')];}_0x2adee5[_0x192d('0x27')](_0x2dd198)[_0x192d('0x3a')](_0x1a7907);};}exports[_0x192d('0x3b')]=function(_0x3bf0cd,_0x3523bd){var _0x182e5b={'include':[{'model':db[_0x192d('0x3c')],'as':_0x192d('0x3d')}]},_0x47ba82={},_0xf9ca2b={'count':0x0,'rows':[]};var _0x2b2bc7=_[_0x192d('0x3e')](db['SmsAccount']['rawAttributes'],function(_0x1c1fce){return{'name':_0x1c1fce[_0x192d('0x3f')],'type':_0x1c1fce['type']['key']};});_0x47ba82[_0x192d('0x40')]=_[_0x192d('0x3e')](_0x2b2bc7,_0x192d('0x39'));_0x47ba82[_0x192d('0x41')]=_[_0x192d('0x42')](_0x3bf0cd[_0x192d('0x41')]);_0x47ba82[_0x192d('0x43')]=_[_0x192d('0x44')](_0x47ba82[_0x192d('0x40')],_0x47ba82[_0x192d('0x41')]);_0x182e5b['attributes']=_[_0x192d('0x44')](_0x47ba82[_0x192d('0x40')],qs[_0x192d('0x45')](_0x3bf0cd['query'][_0x192d('0x45')]));_0x182e5b[_0x192d('0x46')]=_0x182e5b[_0x192d('0x46')]['length']?_0x182e5b[_0x192d('0x46')]:_0x47ba82[_0x192d('0x40')];if(!_0x3bf0cd[_0x192d('0x41')][_0x192d('0x47')](_0x192d('0x48'))){_0x182e5b['limit']=qs['limit'](_0x3bf0cd[_0x192d('0x41')][_0x192d('0x2b')]);_0x182e5b[_0x192d('0x29')]=qs[_0x192d('0x29')](_0x3bf0cd['query']['offset']);}_0x182e5b[_0x192d('0x49')]=qs[_0x192d('0x4a')](_0x3bf0cd[_0x192d('0x41')][_0x192d('0x4a')]);_0x182e5b[_0x192d('0x4b')]=qs[_0x192d('0x43')](_['pick'](_0x3bf0cd['query'],_0x47ba82[_0x192d('0x43')]),_0x2b2bc7);if(_0x3bf0cd[_0x192d('0x41')][_0x192d('0x4c')]){_0x182e5b['where']=_['merge'](_0x182e5b['where'],{'$or':_[_0x192d('0x3e')](_0x2b2bc7,function(_0x5662b){if(_0x5662b[_0x192d('0x4d')]!==_0x192d('0x4e')){var _0x18aebc={};_0x18aebc[_0x5662b[_0x192d('0x39')]]={'$like':'%'+_0x3bf0cd['query'][_0x192d('0x4c')]+'%'};return _0x18aebc;}})});}_0x182e5b=_['merge']({},_0x182e5b,_0x3bf0cd[_0x192d('0x4f')]);var _0x4c0c13={'where':_0x182e5b['where']};return db[_0x192d('0x50')][_0x192d('0x2c')](_0x4c0c13)[_0x192d('0x1e')](function(_0x25a69d){_0xf9ca2b[_0x192d('0x2c')]=_0x25a69d;if(_0x3bf0cd[_0x192d('0x41')]['includeAll']){_0x182e5b[_0x192d('0x51')]=[{'all':!![]}];}return db[_0x192d('0x50')][_0x192d('0x52')](_0x182e5b);})[_0x192d('0x1e')](function(_0x53fb21){_0xf9ca2b['rows']=_0x53fb21;return _0xf9ca2b;})['then'](respondWithFilteredResult(_0x3523bd,_0x182e5b))[_0x192d('0x53')](handleError(_0x3523bd,null));};exports['show']=function(_0x506c33,_0x2dff3e){var _0x76cf48={'raw':![],'where':{'id':_0x506c33[_0x192d('0x54')]['id']},'include':[{'model':db[_0x192d('0x3c')],'as':_0x192d('0x3d')}]},_0x36955c={};_0x36955c['model']=_[_0x192d('0x42')](db[_0x192d('0x50')]['rawAttributes']);_0x36955c[_0x192d('0x41')]=_['keys'](_0x506c33[_0x192d('0x41')]);_0x36955c[_0x192d('0x43')]=_[_0x192d('0x44')](_0x36955c[_0x192d('0x40')],_0x36955c[_0x192d('0x41')]);_0x76cf48[_0x192d('0x46')]=_['intersection'](_0x36955c[_0x192d('0x40')],qs[_0x192d('0x45')](_0x506c33[_0x192d('0x41')][_0x192d('0x45')]));_0x76cf48[_0x192d('0x46')]=_0x76cf48['attributes'][_0x192d('0x55')]?_0x76cf48['attributes']:_0x36955c[_0x192d('0x40')];if(_0x506c33[_0x192d('0x41')][_0x192d('0x56')]){_0x76cf48[_0x192d('0x51')]=[{'all':!![]}];}_0x76cf48=_[_0x192d('0x57')]({},_0x76cf48,_0x506c33['options']);return db[_0x192d('0x50')][_0x192d('0x58')](_0x76cf48)['then'](handleEntityNotFound(_0x2dff3e,null))[_0x192d('0x1e')](respondWithResult(_0x2dff3e,null))[_0x192d('0x53')](handleError(_0x2dff3e,null));};exports[_0x192d('0x59')]=function(_0x4ebd96,_0x2f08af){return db[_0x192d('0x50')]['create'](_0x4ebd96[_0x192d('0x5a')],{})['then'](function(_0x4c4c74){var _0x46376f=_0x4ebd96['user'][_0x192d('0x35')]({'plain':!![]});if(!_0x46376f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x46376f[_0x192d('0x5b')]===_0x192d('0x5c')){var _0xc39a83=_0x4c4c74['get']({'plain':!![]});var _0x4793e6=_0x192d('0x36');return db[_0x192d('0x5d')][_0x192d('0x58')]({'where':{'name':_0x4793e6,'userProfileId':_0x46376f[_0x192d('0x5e')]},'raw':!![]})[_0x192d('0x1e')](function(_0x1a2ce9){if(_0x1a2ce9&&_0x1a2ce9[_0x192d('0x5f')]===0x0){return db[_0x192d('0x37')][_0x192d('0x59')]({'name':_0xc39a83[_0x192d('0x39')],'resourceId':_0xc39a83['id'],'type':_0x1a2ce9[_0x192d('0x39')],'sectionId':_0x1a2ce9['id']},{})[_0x192d('0x1e')](function(){return _0x4c4c74;});}else{return _0x4c4c74;}})[_0x192d('0x53')](function(_0x25d99f){logger[_0x192d('0x23')](_0x192d('0x60'),_0x25d99f);throw _0x25d99f;});}return _0x4c4c74;})[_0x192d('0x1e')](respondWithResult(_0x2f08af,0xc9))[_0x192d('0x53')](handleError(_0x2f08af,null));};exports[_0x192d('0x33')]=function(_0x296b9e,_0x431ebb){if(_0x296b9e[_0x192d('0x5a')]['id']){delete _0x296b9e[_0x192d('0x5a')]['id'];}return db[_0x192d('0x50')]['find']({'where':{'id':_0x296b9e[_0x192d('0x54')]['id']},'include':[{'model':db['Pause'],'as':_0x192d('0x3d')}]})[_0x192d('0x1e')](handleEntityNotFound(_0x431ebb,null))['then'](saveUpdates(_0x296b9e[_0x192d('0x5a')],null))[_0x192d('0x1e')](respondWithResult(_0x431ebb,null))[_0x192d('0x53')](handleError(_0x431ebb,null));};exports[_0x192d('0x34')]=function(_0x52a4c8,_0x15c81d){return db[_0x192d('0x50')][_0x192d('0x58')]({'where':{'id':_0x52a4c8[_0x192d('0x54')]['id']}})['then'](handleEntityNotFound(_0x15c81d,null))[_0x192d('0x1e')](removeEntity(_0x15c81d,null))[_0x192d('0x53')](handleError(_0x15c81d,null));};exports[_0x192d('0x61')]=function(_0x35402c,_0x5319b1){return db[_0x192d('0x50')][_0x192d('0x61')]()[_0x192d('0x1e')](respondWithResult(_0x5319b1,null))[_0x192d('0x53')](handleError(_0x5319b1,null));};exports['addDisposition']=function(_0x1c0509,_0x22e525,_0x20502f){if(_0x1c0509[_0x192d('0x5a')]['id']){delete _0x1c0509[_0x192d('0x5a')]['id'];}return db[_0x192d('0x50')][_0x192d('0x58')]({'where':{'id':_0x1c0509[_0x192d('0x54')]['id']}})[_0x192d('0x1e')](handleEntityNotFound(_0x22e525,null))[_0x192d('0x1e')](function(_0x3ad5dd){if(_0x3ad5dd){_0x1c0509[_0x192d('0x5a')][_0x192d('0x62')]=_0x3ad5dd['id'];return db[_0x192d('0x63')]['create'](_0x1c0509[_0x192d('0x5a')]);}})[_0x192d('0x1e')](respondWithResult(_0x22e525,null))[_0x192d('0x53')](handleError(_0x22e525,null));};exports[_0x192d('0x64')]=function(_0x3aaaa8,_0x364e56,_0x2ab9c1){var _0x3c112d={'raw':![],'where':{}};var _0x589f4a={};var _0x4b3803={'count':0x0,'rows':[]};return db[_0x192d('0x50')][_0x192d('0x65')]({'where':{'id':_0x3aaaa8[_0x192d('0x54')]['id']}})[_0x192d('0x1e')](handleEntityNotFound(_0x364e56,null))[_0x192d('0x1e')](function(_0x25c48b){if(_0x25c48b){_0x589f4a['model']=_[_0x192d('0x42')](db[_0x192d('0x63')][_0x192d('0x66')]);_0x589f4a[_0x192d('0x41')]=_['keys'](_0x3aaaa8[_0x192d('0x41')]);_0x589f4a[_0x192d('0x43')]=_['intersection'](_0x589f4a['model'],_0x589f4a[_0x192d('0x41')]);_0x3c112d[_0x192d('0x46')]=_[_0x192d('0x44')](_0x589f4a[_0x192d('0x40')],qs['fields'](_0x3aaaa8[_0x192d('0x41')][_0x192d('0x45')]));_0x3c112d[_0x192d('0x46')]=_0x3c112d[_0x192d('0x46')]['length']?_0x3c112d[_0x192d('0x46')]:_0x589f4a[_0x192d('0x40')];if(!_0x3aaaa8[_0x192d('0x41')][_0x192d('0x47')](_0x192d('0x48'))){_0x3c112d[_0x192d('0x2b')]=qs['limit'](_0x3aaaa8[_0x192d('0x41')]['limit']);_0x3c112d['offset']=qs[_0x192d('0x29')](_0x3aaaa8[_0x192d('0x41')][_0x192d('0x29')]);}_0x3c112d[_0x192d('0x49')]=qs['sort'](_0x3aaaa8[_0x192d('0x41')][_0x192d('0x4a')]);_0x3c112d[_0x192d('0x4b')]=qs[_0x192d('0x43')](_[_0x192d('0x67')](_0x3aaaa8[_0x192d('0x41')],_0x589f4a[_0x192d('0x43')]));_0x3c112d[_0x192d('0x4b')][_0x192d('0x62')]=_0x25c48b['id'];if(_0x3aaaa8[_0x192d('0x41')][_0x192d('0x4c')]){_0x3c112d[_0x192d('0x4b')]=_[_0x192d('0x57')](_0x3c112d[_0x192d('0x4b')],{'$or':_[_0x192d('0x3e')](_0x3c112d['attributes'],function(_0x2c6408){var _0x5b5964={};_0x5b5964[_0x2c6408]={'$like':'%'+_0x3aaaa8[_0x192d('0x41')]['filter']+'%'};return _0x5b5964;})});}_0x3c112d=_['merge']({},_0x3c112d,_0x3aaaa8['options']);return db[_0x192d('0x63')][_0x192d('0x2c')]({'where':_0x3c112d[_0x192d('0x4b')]})[_0x192d('0x1e')](function(_0x554107){_0x4b3803[_0x192d('0x2c')]=_0x554107;if(_0x3aaaa8[_0x192d('0x41')][_0x192d('0x56')]){_0x3c112d[_0x192d('0x51')]=[{'all':!![]}];}return db[_0x192d('0x63')][_0x192d('0x52')](_0x3c112d);})[_0x192d('0x1e')](function(_0x593cd1){_0x4b3803[_0x192d('0x68')]=_0x593cd1;return _0x4b3803;});}})['then'](respondWithFilteredResult(_0x364e56,_0x3c112d))['catch'](handleError(_0x364e56,null));};exports[_0x192d('0x69')]=function(_0x15f1d7,_0x29b660,_0x51bdfe){return db['SmsAccount']['find']({'where':{'id':_0x15f1d7[_0x192d('0x54')]['id']}})[_0x192d('0x1e')](handleEntityNotFound(_0x29b660,null))[_0x192d('0x1e')](function(_0x8c256){if(_0x8c256){return _0x8c256[_0x192d('0x69')](_0x15f1d7[_0x192d('0x41')][_0x192d('0x6a')]);}})['then'](respondWithStatusCode(_0x29b660,null))['catch'](handleError(_0x29b660,null));};exports[_0x192d('0x6b')]=function(_0x124e1d,_0x1953a3,_0x2e2519){if(_0x124e1d['body']['id']){delete _0x124e1d['body']['id'];}return db[_0x192d('0x50')][_0x192d('0x58')]({'where':{'id':_0x124e1d['params']['id']}})[_0x192d('0x1e')](handleEntityNotFound(_0x1953a3,null))['then'](function(_0x4eb8a6){if(_0x4eb8a6){_0x124e1d['body'][_0x192d('0x62')]=_0x4eb8a6['id'];return db['CannedAnswer']['create'](_0x124e1d['body']);}})[_0x192d('0x1e')](respondWithResult(_0x1953a3,null))[_0x192d('0x53')](handleError(_0x1953a3,null));};exports[_0x192d('0x6c')]=function(_0x2723dc,_0x1d9e80,_0x5e2432){var _0x57d351={'raw':![],'where':{}};var _0x6874b3={};var _0x224eb5={'count':0x0,'rows':[]};return db[_0x192d('0x50')]['findOne']({'where':{'id':_0x2723dc['params']['id']}})['then'](handleEntityNotFound(_0x1d9e80,null))[_0x192d('0x1e')](function(_0x29d6db){if(_0x29d6db){_0x6874b3[_0x192d('0x40')]=_[_0x192d('0x42')](db['CannedAnswer'][_0x192d('0x66')]);_0x6874b3[_0x192d('0x41')]=_['keys'](_0x2723dc[_0x192d('0x41')]);_0x6874b3[_0x192d('0x43')]=_['intersection'](_0x6874b3['model'],_0x6874b3[_0x192d('0x41')]);_0x57d351[_0x192d('0x46')]=_[_0x192d('0x44')](_0x6874b3[_0x192d('0x40')],qs['fields'](_0x2723dc[_0x192d('0x41')][_0x192d('0x45')]));_0x57d351[_0x192d('0x46')]=_0x57d351[_0x192d('0x46')][_0x192d('0x55')]?_0x57d351[_0x192d('0x46')]:_0x6874b3[_0x192d('0x40')];if(!_0x2723dc['query']['hasOwnProperty'](_0x192d('0x48'))){_0x57d351['limit']=qs[_0x192d('0x2b')](_0x2723dc['query'][_0x192d('0x2b')]);_0x57d351[_0x192d('0x29')]=qs[_0x192d('0x29')](_0x2723dc[_0x192d('0x41')]['offset']);}_0x57d351[_0x192d('0x49')]=qs[_0x192d('0x4a')](_0x2723dc[_0x192d('0x41')]['sort']);_0x57d351[_0x192d('0x4b')]=qs[_0x192d('0x43')](_[_0x192d('0x67')](_0x2723dc[_0x192d('0x41')],_0x6874b3[_0x192d('0x43')]));_0x57d351['where'][_0x192d('0x62')]=_0x29d6db['id'];if(_0x2723dc[_0x192d('0x41')][_0x192d('0x4c')]){_0x57d351['where']=_['merge'](_0x57d351['where'],{'$or':_['map'](_0x57d351[_0x192d('0x46')],function(_0x3aa583){var _0x1fb3dc={};_0x1fb3dc[_0x3aa583]={'$like':'%'+_0x2723dc[_0x192d('0x41')][_0x192d('0x4c')]+'%'};return _0x1fb3dc;})});}_0x57d351=_[_0x192d('0x57')]({},_0x57d351,_0x2723dc[_0x192d('0x4f')]);return db['CannedAnswer'][_0x192d('0x2c')]({'where':_0x57d351[_0x192d('0x4b')]})[_0x192d('0x1e')](function(_0x578d02){_0x224eb5[_0x192d('0x2c')]=_0x578d02;if(_0x2723dc[_0x192d('0x41')][_0x192d('0x56')]){_0x57d351[_0x192d('0x51')]=[{'all':!![]}];}return db['CannedAnswer'][_0x192d('0x52')](_0x57d351);})[_0x192d('0x1e')](function(_0x28f97d){_0x224eb5['rows']=_0x28f97d;return _0x224eb5;});}})[_0x192d('0x1e')](respondWithFilteredResult(_0x1d9e80,_0x57d351))[_0x192d('0x53')](handleError(_0x1d9e80,null));};exports[_0x192d('0x6d')]=function(_0x3f3ad0,_0x2ac3c4,_0x32294a){return db[_0x192d('0x50')][_0x192d('0x58')]({'where':{'id':_0x3f3ad0[_0x192d('0x54')]['id']}})['then'](handleEntityNotFound(_0x2ac3c4,null))[_0x192d('0x1e')](function(_0x4a9afb){if(_0x4a9afb){return _0x4a9afb[_0x192d('0x6d')](_0x3f3ad0[_0x192d('0x41')][_0x192d('0x6a')]);}})[_0x192d('0x1e')](respondWithStatusCode(_0x2ac3c4,null))['catch'](handleError(_0x2ac3c4,null));};exports[_0x192d('0x6e')]=function(_0x473735,_0x59cd7e,_0x286843){var _0xf9356e={'channel':_0x192d('0x6f')};var _0x48078d=[];var _0x5ca6d5=[];var _0x19d8d8={};return db[_0x192d('0x50')][_0x192d('0x58')]({'where':{'id':_0x473735[_0x192d('0x54')]['id']},'include':[{'model':db[_0x192d('0x70')],'as':_0x192d('0x71')}]})['then'](handleEntityNotFound(_0x59cd7e,null))[_0x192d('0x1e')](function(_0x1ba3e5){_0xf9356e[_0x192d('0x72')]=_0x1ba3e5;_0xf9356e['applications']=_['orderBy'](_0x1ba3e5[_0x192d('0x71')],[_0x192d('0x73')],[_0x192d('0x74')]);if(_0xf9356e['account'][_0x192d('0x71')]){delete _0xf9356e[_0x192d('0x72')][_0x192d('0x71')];}return db['CmContact'][_0x192d('0x61')]();})[_0x192d('0x1e')](function(_0x1ef1af){if(!_0x1ef1af){throw new db[(_0x192d('0x75'))][(_0x192d('0x76'))]('no\x20available\x20attributes');}_0x48078d=_[_0x192d('0x77')](_[_0x192d('0x42')](_0x1ef1af),[_0x192d('0x78'),'updatedAt']);_0x5ca6d5=_[_0x192d('0x77')](_[_0x192d('0x42')](_0x1ef1af),['createdAt',_0x192d('0x79'),_0x192d('0x7a'),_0x192d('0x7b')]);_0xf9356e[_0x192d('0x5a')]={'mapKey':_0x192d('0x7c')};if(_0xf9356e[_0x192d('0x72')][_0x192d('0x4d')]){switch(_0xf9356e[_0x192d('0x72')][_0x192d('0x4d')]){case _0x192d('0x7d'):_0xf9356e['body'][_0x192d('0x7e')]=_0x473735[_0x192d('0x5a')][_0x192d('0x7f')];_0xf9356e[_0x192d('0x5a')][_0x192d('0x5a')]=_0x473735[_0x192d('0x5a')][_0x192d('0x80')];_0xf9356e[_0x192d('0x5a')][_0x192d('0x81')]=_0x473735[_0x192d('0x5a')][_0x192d('0x82')];break;case _0x192d('0x83'):_0xf9356e[_0x192d('0x5a')][_0x192d('0x7e')]='+'+_0x473735[_0x192d('0x5a')][_0x192d('0x84')];_0xf9356e[_0x192d('0x5a')][_0x192d('0x5a')]=_0x473735[_0x192d('0x5a')][_0x192d('0x85')];break;case _0x192d('0x86'):_0xf9356e[_0x192d('0x5a')][_0x192d('0x7e')]=_0x473735[_0x192d('0x5a')][_0x192d('0x7e')];_0xf9356e[_0x192d('0x5a')][_0x192d('0x5a')]=_0x473735[_0x192d('0x5a')][_0x192d('0x24')];break;case _0x192d('0x87'):_0xf9356e['body'][_0x192d('0x7e')]=_0x473735[_0x192d('0x5a')][_0x192d('0x7e')];_0xf9356e[_0x192d('0x5a')][_0x192d('0x5a')]=_0x473735['body']['body'];_0xf9356e['body'][_0x192d('0x81')]=_0x473735[_0x192d('0x5a')][_0x192d('0x88')];break;case _0x192d('0x89'):_0xf9356e[_0x192d('0x5a')][_0x192d('0x7e')]=_0x473735['body']['From'];_0xf9356e[_0x192d('0x5a')][_0x192d('0x5a')]=_0x473735[_0x192d('0x5a')][_0x192d('0x8a')];_0xf9356e[_0x192d('0x5a')]['messageId']=_0x473735[_0x192d('0x5a')][_0x192d('0x8b')];break;case'infobip':_0xf9356e[_0x192d('0x5a')][_0x192d('0x7e')]='+'+_0x473735[_0x192d('0x5a')][_0x192d('0x8c')][0x0][_0x192d('0x7e')];_0xf9356e['body'][_0x192d('0x5a')]=_0x473735['body'][_0x192d('0x8c')][0x0][_0x192d('0x85')];_0xf9356e[_0x192d('0x5a')][_0x192d('0x81')]=_0x473735[_0x192d('0x5a')][_0x192d('0x8c')][0x0][_0x192d('0x81')];break;case'csc':_0xf9356e[_0x192d('0x5a')][_0x192d('0x7e')]=_0x473735[_0x192d('0x5a')][_0x192d('0x8d')];_0xf9356e['body'][_0x192d('0x5a')]=_0x473735[_0x192d('0x5a')][_0x192d('0x8e')][_0x192d('0x24')];break;case'clickatell':_0xf9356e[_0x192d('0x5a')]['from']=_0x473735[_0x192d('0x5a')]['fromNumber'];_0xf9356e['body'][_0x192d('0x5a')]=_0x473735['body'][_0x192d('0x85')];_0xf9356e[_0x192d('0x5a')][_0x192d('0x81')]=_0x473735[_0x192d('0x5a')][_0x192d('0x8f')];break;case _0x192d('0x90'):_0xf9356e['body'][_0x192d('0x81')]=_0x473735[_0x192d('0x5a')][0x0][_0x192d('0x24')]['id'];_0xf9356e[_0x192d('0x5a')]['from']=_0x473735[_0x192d('0x5a')][0x0][_0x192d('0x24')][_0x192d('0x7e')];_0xf9356e[_0x192d('0x5a')][_0x192d('0x5a')]=_0x473735['body'][0x0][_0x192d('0x24')]['text'];break;case _0x192d('0x91'):_0xf9356e[_0x192d('0x5a')]['from']=_0x473735['body'][_0x192d('0x7e')];_0xf9356e[_0x192d('0x5a')][_0x192d('0x5a')]=_0x473735[_0x192d('0x5a')][_0x192d('0x24')];_0xf9356e['body'][_0x192d('0x81')]=_0x473735['body'][_0x192d('0x92')];break;}}if(_0xf9356e['body']['id']){delete _0xf9356e[_0x192d('0x5a')]['id'];}if(_[_0x192d('0x93')](_0xf9356e[_0x192d('0x5a')]['from'])){throw new db[(_0x192d('0x75'))]['ValidationError'](_0x192d('0x94'));}if(_[_0x192d('0x93')](_0xf9356e[_0x192d('0x5a')][_0x192d('0x5a')])||_0xf9356e[_0x192d('0x5a')][_0x192d('0x5a')]===''){throw new db['Sequelize'][(_0x192d('0x76'))](_0x192d('0x95'));}if(_[_0x192d('0x93')](_0xf9356e[_0x192d('0x5a')][_0x192d('0x96')])){throw new db['Sequelize'][(_0x192d('0x76'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5ca6d5);}if(!_[_0x192d('0x97')](_0x5ca6d5,_0xf9356e['body'][_0x192d('0x96')])){throw new db[(_0x192d('0x75'))][(_0x192d('0x76'))](_0x192d('0x98')+_0x5ca6d5);}_0x19d8d8[_0xf9356e[_0x192d('0x5a')]['mapKey']]=_0xf9356e['body']['from'];return db['CmList'][_0x192d('0x58')]({'where':{'id':_0xf9356e[_0x192d('0x72')][_0x192d('0x7b')]},'include':[{'model':db[_0x192d('0x99')],'as':_0x192d('0x9a'),'where':_0x19d8d8,'limit':0x1,'order':[[_0x192d('0x79'),'DESC']]}]});})['then'](handleEntityNotFound(_0x59cd7e,null))[_0x192d('0x1e')](function(_0x2e982){if(_0x2e982){_0xf9356e[_0x192d('0x9b')]=_[_0x192d('0x9c')](_0x2e982,[_0x192d('0x9a')]);if(_0x2e982[_0x192d('0x9a')][_0x192d('0x55')]){return _0x2e982['Contacts'][0x0];}var _0x117285=_['defaults'](_0xf9356e['body'],{'firstName':_0xf9356e[_0x192d('0x5a')][_0x192d('0x7e')],'ListId':_0x2e982['id']});_0x117285[_0xf9356e[_0x192d('0x5a')][_0x192d('0x96')]]=_0xf9356e[_0x192d('0x5a')][_0x192d('0x7e')];return db[_0x192d('0x99')][_0x192d('0x59')](_0x117285,{'fields':_0x48078d,'raw':!![]});}})[_0x192d('0x1e')](handleEntityNotFound(_0x59cd7e,null))[_0x192d('0x1e')](function(_0x29182a){if(_0x29182a){_0xf9356e[_0x192d('0x9d')]=_0x29182a;var _0x35b58f={'ContactId':_0x29182a['id'],'phone':_0xf9356e[_0x192d('0x5a')][_0x192d('0x7e')],'SmsAccountId':_0x473735[_0x192d('0x54')]['id']};var _0x2ffecc={'ContactId':_0x29182a['id'],'SmsAccountId':_0x473735[_0x192d('0x54')]['id'],'closed':![]};return db[_0x192d('0x9e')][_0x192d('0x58')]({'where':_0x2ffecc})[_0x192d('0x1e')](function(_0x37dee4){if(_0x37dee4){return[_0x37dee4,![]];}return db[_0x192d('0x9e')][_0x192d('0x59')](_0x35b58f)[_0x192d('0x1e')](function(_0x95c1ff){return[_0x95c1ff,!![]];});});}})['spread'](function(_0x3a14d1,_0x21cae5){_0xf9356e[_0x192d('0x9f')]=_0x3a14d1[_0x192d('0x35')]({'plain':!![]});_0xf9356e['interaction'][_0x192d('0xa0')]=![];if(_0x21cae5){if(_0xf9356e[_0x192d('0x72')][_0x192d('0xa1')]){_0xf9356e['applications'][_0x192d('0xa2')]({'id':0x0,'priority':_0xf9356e['applications']['length']+0x1,'app':_0x192d('0xa3'),'appdata':'unmanaged','interval':'*,*,*,*'});}_0xf9356e[_0x192d('0x9f')][_0x192d('0xa0')]=!![];}return db[_0x192d('0xa4')][_0x192d('0x59')]({'phone':_0xf9356e[_0x192d('0x5a')][_0x192d('0x7e')],'messageId':_0xf9356e[_0x192d('0x5a')][_0x192d('0x81')],'body':_0xf9356e['body'][_0x192d('0x5a')],'SmsAccountId':_0x473735[_0x192d('0x54')]['id'],'SmsInteractionId':_0x3a14d1['id'],'direction':'in','ContactId':_0x3a14d1['ContactId'],'AttachmentId':_0xf9356e[_0x192d('0x5a')][_0x192d('0xa5')]});})[_0x192d('0x1e')](function(_0x1fbae3){_0xf9356e[_0x192d('0x24')]=_0x1fbae3;if(_0xf9356e[_0x192d('0x9f')][_0x192d('0xa6')]){return db[_0x192d('0xa7')][_0x192d('0x58')]({'attributes':['id',_0x192d('0x39')],'where':{'id':_0xf9356e[_0x192d('0x9f')][_0x192d('0xa6')]}})['then'](function(_0x5b2f0c){if(_0x5b2f0c){_0xf9356e[_0x192d('0xa8')][_0x192d('0xa9')]({'id':0x0,'priority':0x0,'app':_0x192d('0xaa'),'appdata':_0x5b2f0c[_0x192d('0x39')]+','+(_0xf9356e['account'][_0x192d('0xab')]||0xa),'interval':_0x192d('0xac')});}return respondWithRpcPromise(_0x192d('0xad'),_0x192d('0xae'),_0xf9356e);});}return respondWithRpcPromise('Start',_0x192d('0xae'),_0xf9356e);})[_0x192d('0x1e')](function(_0x4e8293){if(_0x4e8293){var _0x21784a=0xc8;var _0x4c6a9c=_0x192d('0xaf');logger[_0x192d('0x1f')](_0x192d('0xb0'),_0x4c6a9c,_0x21784a,_0x192d('0xb1'));logger[_0x192d('0xb2')](_0x192d('0xb3'),_0x4c6a9c,_0x21784a,_0x192d('0xb1'),JSON[_0x192d('0x22')](_0x4e8293));if(_0xf9356e[_0x192d('0x72')][_0x192d('0x4d')]===_0x192d('0x7d')){return _0x59cd7e[_0x192d('0x27')](_0x21784a)[_0x192d('0x2d')]('Content-Type',_0x192d('0xb4'))[_0x192d('0x3a')]('\x0a');}else{return _0x59cd7e[_0x192d('0x27')](_0x21784a)[_0x192d('0x2f')](_0x4e8293);}}})[_0x192d('0x53')](handleError(_0x59cd7e,null));};exports[_0x192d('0xb5')]=function(_0x59ae88,_0x1a0159){var _0x5f3fcb=_0x59ae88[_0x192d('0x54')]['id'];var _0xc0d675=_0x59ae88['body'];var _0x466d71=0xc8;var _0xd2d13f=null;return db[_0x192d('0xb6')]['transaction']({'isolationLevel':db[_0x192d('0xb6')][_0x192d('0xb7')][_0x192d('0xb8')][_0x192d('0xb9')]},function(_0x3d06c4){return db[_0x192d('0x50')][_0x192d('0x65')]({'where':{'id':_0x5f3fcb},'transaction':_0x3d06c4})[_0x192d('0x1e')](function(_0x162ff5){if(_0x162ff5){return db[_0x192d('0x70')][_0x192d('0x34')]({'where':{'SmsAccountId':_0x5f3fcb},'transaction':_0x3d06c4})[_0x192d('0x1e')](function(){var _0x270e45=_[_0x192d('0x3e')](_0xc0d675,function(_0x17b6e7){_0x17b6e7[_0x192d('0x62')]=_0x5f3fcb;return _0x17b6e7;});return db[_0x192d('0x70')][_0x192d('0xba')](_0x270e45,{'transaction':_0x3d06c4});});}else{_0x466d71=0x194;_0xd2d13f=[];}});})['then'](function(){if(_0x466d71!==0x194){return db[_0x192d('0x70')][_0x192d('0xbb')]({'where':{'SmsAccountId':_0x5f3fcb},'order':_0x192d('0x73')})[_0x192d('0x1e')](function(_0x1464b8){_0xd2d13f=_0x1464b8;});}})[_0x192d('0x53')](function(_0xc7bf08){_0x466d71=0x1f4;logger[_0x192d('0x23')](_0xc7bf08[_0x192d('0x38')]);if(_0xc7bf08['name']){delete _0xc7bf08[_0x192d('0x39')];}_0xd2d13f=_0xc7bf08;})[_0x192d('0xbc')](function(){if(_0xd2d13f===null){_0x1a0159[_0x192d('0x26')](_0x466d71);}else{if(_0x466d71===0x1f4){_0x1a0159['status'](_0x466d71)[_0x192d('0x3a')](_0xd2d13f);}else{_0x1a0159[_0x192d('0x27')](_0x466d71)[_0x192d('0x2f')](_0xd2d13f);}}});};exports['getApplications']=function(_0x53a2be,_0x44acd0,_0xef1f7){var _0x284ae2={};var _0x1b9287={};var _0x1b3943;var _0x2571bf;return db['SmsAccount']['findOne']({'where':{'id':_0x53a2be[_0x192d('0x54')]['id']}})[_0x192d('0x1e')](handleEntityNotFound(_0x44acd0,null))[_0x192d('0x1e')](function(_0x3e3cfb){if(_0x3e3cfb){_0x1b3943=_0x3e3cfb;_0x1b9287['model']=_[_0x192d('0x42')](db['SmsApplication'][_0x192d('0x66')]);_0x1b9287[_0x192d('0x41')]=_['keys'](_0x53a2be[_0x192d('0x41')]);_0x1b9287[_0x192d('0x43')]=_['intersection'](_0x1b9287[_0x192d('0x40')],_0x1b9287[_0x192d('0x41')]);_0x284ae2[_0x192d('0x46')]=_[_0x192d('0x44')](_0x1b9287[_0x192d('0x40')],qs[_0x192d('0x45')](_0x53a2be[_0x192d('0x41')]['fields']));_0x284ae2[_0x192d('0x46')]=_0x284ae2[_0x192d('0x46')][_0x192d('0x55')]?_0x284ae2[_0x192d('0x46')]:_0x1b9287['model'];_0x284ae2['order']=qs['sort'](_0x53a2be['query'][_0x192d('0x4a')]);_0x284ae2[_0x192d('0x4b')]=qs[_0x192d('0x43')](_[_0x192d('0x67')](_0x53a2be[_0x192d('0x41')],_0x1b9287[_0x192d('0x43')]));if(_0x53a2be[_0x192d('0x41')][_0x192d('0x4c')]){_0x284ae2[_0x192d('0x4b')]=_[_0x192d('0x57')](_0x284ae2[_0x192d('0x4b')],{'$or':_['map'](_0x284ae2[_0x192d('0x46')],function(_0x25e613){var _0xf11b62={};_0xf11b62[_0x25e613]={'$like':'%'+_0x53a2be[_0x192d('0x41')][_0x192d('0x4c')]+'%'};return _0xf11b62;})});}_0x284ae2=_['merge']({},_0x284ae2,_0x53a2be[_0x192d('0x4f')]);return _0x1b3943[_0x192d('0xbd')](_0x284ae2);}})[_0x192d('0x1e')](function(_0x18786c){if(_0x18786c){_0x2571bf=_0x18786c[_0x192d('0x55')];if(!_0x53a2be[_0x192d('0x41')][_0x192d('0x47')](_0x192d('0x48'))){_0x284ae2[_0x192d('0x2b')]=qs[_0x192d('0x2b')](_0x53a2be['query'][_0x192d('0x2b')]);_0x284ae2[_0x192d('0x29')]=qs['offset'](_0x53a2be['query'][_0x192d('0x29')]);}return _0x1b3943[_0x192d('0xbd')](_0x284ae2);}})['then'](function(_0x35a41a){if(_0x35a41a){return _0x35a41a?{'count':_0x2571bf,'rows':_0x35a41a}:null;}})['then'](respondWithResult(_0x44acd0,null))[_0x192d('0x53')](handleError(_0x44acd0,null));};exports[_0x192d('0xbe')]=function(_0x270e31,_0x337936,_0x3301c0){var _0x321d37={'raw':![],'where':{}};var _0x432e48={};var _0x4527b7={'count':0x0,'rows':[]};return db['SmsAccount'][_0x192d('0x65')]({'where':{'id':_0x270e31[_0x192d('0x54')]['id']}})[_0x192d('0x1e')](handleEntityNotFound(_0x337936,null))[_0x192d('0x1e')](function(_0x82910e){if(_0x82910e){_0x432e48[_0x192d('0x40')]=_[_0x192d('0x42')](db[_0x192d('0x9e')][_0x192d('0x66')]);_0x432e48[_0x192d('0x41')]=_[_0x192d('0x42')](_0x270e31[_0x192d('0x41')]);_0x432e48[_0x192d('0x43')]=_[_0x192d('0x44')](_0x432e48[_0x192d('0x40')],_0x432e48['query']);_0x321d37[_0x192d('0x46')]=_['intersection'](_0x432e48[_0x192d('0x40')],qs[_0x192d('0x45')](_0x270e31['query'][_0x192d('0x45')]));_0x321d37[_0x192d('0x46')]=_0x321d37[_0x192d('0x46')][_0x192d('0x55')]?_0x321d37[_0x192d('0x46')]:_0x432e48[_0x192d('0x40')];if(!_0x270e31[_0x192d('0x41')][_0x192d('0x47')](_0x192d('0x48'))){_0x321d37[_0x192d('0x2b')]=qs[_0x192d('0x2b')](_0x270e31[_0x192d('0x41')][_0x192d('0x2b')]);_0x321d37[_0x192d('0x29')]=qs['offset'](_0x270e31[_0x192d('0x41')][_0x192d('0x29')]);}_0x321d37['order']=qs[_0x192d('0x4a')](_0x270e31[_0x192d('0x41')][_0x192d('0x4a')]);_0x321d37[_0x192d('0x4b')]=qs[_0x192d('0x43')](_[_0x192d('0x67')](_0x270e31[_0x192d('0x41')],_0x432e48[_0x192d('0x43')]));_0x321d37[_0x192d('0x4b')][_0x192d('0x62')]=_0x82910e['id'];if(_0x270e31[_0x192d('0x41')]['filter']){_0x321d37[_0x192d('0x4b')]=_[_0x192d('0x57')](_0x321d37['where'],{'$or':_[_0x192d('0x3e')](_0x321d37[_0x192d('0x46')],function(_0x2e9b4e){var _0x5c99dc={};_0x5c99dc[_0x2e9b4e]={'$like':'%'+_0x270e31[_0x192d('0x41')][_0x192d('0x4c')]+'%'};return _0x5c99dc;})});}_0x321d37=_[_0x192d('0x57')]({},_0x321d37,_0x270e31[_0x192d('0x4f')]);return db[_0x192d('0x9e')][_0x192d('0x2c')]({'where':_0x321d37[_0x192d('0x4b')]})['then'](function(_0x163069){_0x4527b7[_0x192d('0x2c')]=_0x163069;if(_0x270e31[_0x192d('0x41')][_0x192d('0x56')]){_0x321d37[_0x192d('0x51')]=[{'model':db['CmContact'],'as':_0x192d('0xbf'),'required':![]},{'model':db[_0x192d('0xa7')],'as':'Owner','attributes':['name','fullname',_0x192d('0xc0')],'required':![]},{'model':db[_0x192d('0xc1')],'as':_0x192d('0xc2'),'attributes':['id',_0x192d('0x39'),_0x192d('0xc3')],'where':_0x270e31['query'][_0x192d('0xc4')]?{'id':_0x270e31[_0x192d('0x41')][_0x192d('0xc4')]}:undefined,'required':_0x270e31['query'][_0x192d('0xc4')]?!![]:![]}];}return db[_0x192d('0x9e')][_0x192d('0x52')](_0x321d37);})['then'](function(_0x314e74){_0x4527b7[_0x192d('0x68')]=_0x314e74;return _0x4527b7;});}})['then'](respondWithFilteredResult(_0x337936,_0x321d37))[_0x192d('0x53')](handleError(_0x337936,null));};exports[_0x192d('0x3a')]=function(_0x127cd5,_0x5a229f,_0x2df0bc){var _0x1d70b5,_0x7df0f8,_0x490537;if(_['isNil'](_0x127cd5[_0x192d('0x5a')][_0x192d('0x5a')])||_0x127cd5[_0x192d('0x5a')][_0x192d('0x5a')]===''){throw new db[(_0x192d('0x75'))][(_0x192d('0x76'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x127cd5[_0x192d('0x5a')]['to'])){throw new db[(_0x192d('0x75'))]['ValidationError']('to\x20is\x20mandatory');}_0x1d70b5=_0x127cd5[_0x192d('0x5a')]['to'];return db[_0x192d('0x50')][_0x192d('0x58')]({'where':{'id':_0x127cd5[_0x192d('0x54')]['id']},'include':[{'model':db['CmList'],'as':_0x192d('0xc5'),'include':[{'model':db['CmContact'],'as':_0x192d('0x9a'),'where':{'mobile':_0x1d70b5},'limit':0x1,'order':[[_0x192d('0x79'),_0x192d('0xc6')]]}]}]})['then'](handleEntityNotFound(_0x5a229f,null))[_0x192d('0x1e')](function(_0x437330){if(_0x437330&&_0x437330[_0x192d('0xc5')]){_0x7df0f8=_0x437330[_0x192d('0x35')]({'plain':!![]});if(_0x7df0f8['List']&&_0x7df0f8[_0x192d('0xc5')]['Contacts'][_0x192d('0x55')]){return _0x7df0f8[_0x192d('0xc5')]['Contacts'][0x0];}return db[_0x192d('0x99')][_0x192d('0x59')](_[_0x192d('0xc7')](_0x127cd5[_0x192d('0x5a')],{'firstName':_0x1d70b5,'mobile':_0x1d70b5,'phone':_0x1d70b5,'ListId':_0x7df0f8['ListId']}));}})[_0x192d('0x1e')](handleEntityNotFound(_0x5a229f,null))[_0x192d('0x1e')](function(_0x635c5f){if(_0x635c5f){_0x490537=_0x635c5f;return db[_0x192d('0x9e')][_0x192d('0x58')]({'where':{'ContactId':_0x490537['id'],'closed':![],'SmsAccountId':_0x7df0f8['id']}})[_0x192d('0x1e')](function(_0x2ebed6){if(_0x2ebed6){return[_0x2ebed6,![]];}return db['SmsInteraction'][_0x192d('0x59')]({'UserId':_0x127cd5['user']['id'],'ContactId':_0x490537['id'],'SmsAccountId':_0x7df0f8['id'],'phone':_0x1d70b5,'firstMsgDirection':_0x192d('0xc8'),'Messages':[_[_0x192d('0x57')](_0x127cd5[_0x192d('0x5a')],{'read':![],'body':_0x127cd5[_0x192d('0x5a')][_0x192d('0x5a')],'phone':_0x1d70b5,'SmsAccountId':_0x7df0f8['id'],'UserId':_0x127cd5[_0x192d('0x5c')]['id'],'ContactId':_0x490537['id']})]},{'include':[{'model':db[_0x192d('0xa4')],'as':_0x192d('0xc9')}]})[_0x192d('0x1e')](function(_0x3f3d3e){return[_0x3f3d3e,!![]];});});}})['spread'](function(_0x3c80ad,_0xd1eb9){if(_0xd1eb9){return _0x3c80ad;}return db[_0x192d('0xa4')][_0x192d('0x59')](_[_0x192d('0x57')](_0x127cd5['body'],{'read':![],'body':_0x127cd5['body']['body'],'phone':_0x1d70b5,'SmsAccountId':_0x7df0f8['id'],'SmsInteractionId':_0x3c80ad['id'],'UserId':_0x127cd5[_0x192d('0x5c')]['id'],'ContactId':_0x490537['id']}))['then'](function(_0x3c02dc){_0x3c80ad['dataValues'][_0x192d('0xc9')]=[];_0x3c80ad[_0x192d('0xca')][_0x192d('0xc9')][_0x192d('0xa2')](_0x3c02dc[_0x192d('0xca')]);return _0x3c80ad;});})[_0x192d('0x1e')](respondWithResult(_0x5a229f,null))[_0x192d('0x53')](handleError(_0x5a229f,null));};exports[_0x192d('0x27')]=function(_0x135815,_0x4410cc,_0x18dae2){if(_0x135815[_0x192d('0x5a')]['id']){delete _0x135815[_0x192d('0x5a')]['id'];}var _0x3c65c8,_0x359af7,_0x4a52f4;return db[_0x192d('0x50')][_0x192d('0x58')]({'where':{'id':_0x135815[_0x192d('0x54')]['id']}})['then'](handleEntityNotFound(_0x4410cc,null))[_0x192d('0x1e')](function(_0x4e993a){if(_0x4e993a){_0x4a52f4=_0x4e993a;logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x192d('0x27'),'received\x20delivery\x20report\x20from',_0x4e993a['type'],util[_0x192d('0xcb')](_0x135815['body'],{'showHidden':![],'depth':null}));switch(_0x4e993a['type']){case _0x192d('0x83'):if(_0x135815[_0x192d('0x5a')][_0x192d('0xcc')]&&_0x135815['body'][_0x192d('0x27')]){_0x359af7=_0x135815[_0x192d('0x5a')][_0x192d('0x27')];return db['SmsMessage'][_0x192d('0x58')]({'where':{'messageId':_0x135815['body'][_0x192d('0xcc')]}});}break;case _0x192d('0x86'):if(_0x135815['body'][_0x192d('0xcd')]&&_0x135815[_0x192d('0x5a')][_0x192d('0xce')]){_0x359af7=_0x135815['body'][_0x192d('0xce')];return db['SmsMessage'][_0x192d('0x58')]({'where':{'messageId':_0x135815[_0x192d('0x5a')][_0x192d('0xcd')]}});}break;case _0x192d('0x87'):if(_0x135815[_0x192d('0x5a')]['message_id']&&_0x135815[_0x192d('0x5a')][_0x192d('0xcf')]){_0x359af7=_0x135815[_0x192d('0x5a')][_0x192d('0xcf')];return db[_0x192d('0xa4')][_0x192d('0x58')]({'where':{'messageId':_0x135815[_0x192d('0x5a')][_0x192d('0x88')]}});}break;case'infobip':var _0x2eb042=_0x135815['body'][_0x192d('0x8c')][0x0];if(_0x2eb042[_0x192d('0x81')]&&_0x2eb042[_0x192d('0x27')][_0x192d('0xd0')]===_0x192d('0xd1')){_0x359af7=_0x2eb042[_0x192d('0x27')]['groupName'];return db['SmsMessage'][_0x192d('0x58')]({'where':{'messageId':_0x2eb042['messageId']}});}break;case _0x192d('0xd2'):if(_0x135815[_0x192d('0x5a')][_0x192d('0x81')]&&_0x135815[_0x192d('0x5a')][_0x192d('0x27')]){_0x359af7=_0x135815['body'][_0x192d('0x27')];return db[_0x192d('0xa4')][_0x192d('0x58')]({'where':{'messageId':_0x135815[_0x192d('0x5a')][_0x192d('0x81')]}});}break;case'bandwidth':if(_0x135815[_0x192d('0x5a')][0x0]['message']['id']){_0x359af7=_0x135815[_0x192d('0x5a')][0x0][_0x192d('0x4d')];return db[_0x192d('0xa4')]['find']({'where':{'messageId':_0x135815[_0x192d('0x5a')][0x0][_0x192d('0x24')]['id']}});}break;case _0x192d('0x91'):if(_0x135815[_0x192d('0x5a')][_0x192d('0xd3')]&&_0x135815['body'][_0x192d('0x27')]){_0x359af7=_0x135815[_0x192d('0x5a')][_0x192d('0x27')];return db['SmsMessage']['find']({'where':{'messageId':_0x135815[_0x192d('0x5a')][_0x192d('0xd3')]}});}break;}}})[_0x192d('0x1e')](handleEntityNotFound(_0x4410cc,null))[_0x192d('0x1e')](function(_0x50f765){if(_0x50f765){_0x3c65c8=_0x50f765;switch(_0x4a52f4['type']){case _0x192d('0x83'):if(_0x359af7===_0x192d('0xd1')){return _0x3c65c8['update']({'read':!![]});}else{logger[_0x192d('0x23')](_0x192d('0xb0'),_0x192d('0x27'),'skebby',util[_0x192d('0xcb')](_0x135815['body'],{'showHidden':![],'depth':null}));}break;case _0x192d('0x86'):if(_0x359af7==='1'){return _0x3c65c8['update']({'read':!![]});}else{logger['error'](_0x192d('0xb0'),_0x192d('0x27'),_0x192d('0x83'),util['inspect'](_0x135815[_0x192d('0x5a')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x135815[_0x192d('0x5a')][_0x192d('0xd4')]&&_0x359af7>=0xc8&&_0x359af7<=0xce){return _0x3c65c8[_0x192d('0x33')]({'read':!![]});}else{logger[_0x192d('0x23')](_0x192d('0xb0'),'status',_0x192d('0x87'),util[_0x192d('0xcb')](_0x135815['body'],{'showHidden':![],'depth':null}));}break;case _0x192d('0xd5'):var _0x48fb8d=_0x135815[_0x192d('0x5a')][_0x192d('0x8c')][0x0];if(_0x48fb8d[_0x192d('0x27')][_0x192d('0xd0')]===_0x192d('0xd1')){return _0x3c65c8[_0x192d('0x33')]({'read':!![]});}else{logger[_0x192d('0x23')](_0x192d('0xb0'),_0x192d('0x27'),_0x192d('0xd5'),util['inspect'](_0x135815[_0x192d('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x192d('0xd2'):if(_0x359af7==_0x192d('0xd6')||_0x359af7==_0x192d('0xd7')){return _0x3c65c8['update']({'read':!![]});}else{logger[_0x192d('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x192d('0x27'),'clickatell',util[_0x192d('0xcb')](_0x135815['body'],{'showHidden':![],'depth':null}));}break;case _0x192d('0x90'):if(_0x359af7=='message-delivered'){return _0x3c65c8[_0x192d('0x33')]({'read':!![]});}else{logger[_0x192d('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x192d('0x90'),util[_0x192d('0xcb')](_0x135815[_0x192d('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x192d('0x91'):if(_0x359af7===_0x192d('0xd8')||_0x359af7===_0x192d('0xd9')){return _0x3c65c8[_0x192d('0x33')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x192d('0x27'),_0x192d('0x91'),util['inspect'](_0x135815['body'],{'showHidden':![],'depth':null}));}break;}return _0x3c65c8;}})['then'](respondWithResult(_0x4410cc,null))[_0x192d('0x53')](handleError(_0x4410cc,null));};exports[_0x192d('0xda')]=function(_0x2c6b5d,_0x390061,_0x53f249){var _0x29f21c,_0x2162c3,_0x46975d;return db[_0x192d('0x50')][_0x192d('0x58')]({'where':{'id':_0x2c6b5d[_0x192d('0x54')]['id']}})[_0x192d('0x1e')](handleEntityNotFound(_0x390061,null))[_0x192d('0x1e')](function(_0x387ac1){if(_0x387ac1){_0x46975d=_0x387ac1;logger['debug'](_0x192d('0xb0'),'status',_0x192d('0xdb'),_0x387ac1[_0x192d('0x4d')],util[_0x192d('0xcb')](_0x2c6b5d['query'],{'showHidden':![],'depth':null}));switch(_0x387ac1['type']){case'csc':if(_0x2c6b5d[_0x192d('0x41')][_0x192d('0xdc')]&&_0x2c6b5d[_0x192d('0x41')][_0x192d('0xdd')]){_0x2162c3=_0x2c6b5d[_0x192d('0x41')][_0x192d('0xdd')];return db[_0x192d('0xa4')]['find']({'where':{'messageId':_0x2c6b5d[_0x192d('0x41')]['message-id']}});}break;}}})[_0x192d('0x1e')](handleEntityNotFound(_0x390061,null))[_0x192d('0x1e')](function(_0x5c7e0d){if(_0x5c7e0d){_0x29f21c=_0x5c7e0d;switch(_0x46975d[_0x192d('0x4d')]){case _0x192d('0xde'):if(_0x2162c3==='2'||_0x2162c3==='6'){return _0x29f21c['update']({'read':!![]});}else{logger[_0x192d('0x23')](_0x192d('0xb0'),'status',_0x192d('0xde'),util[_0x192d('0xcb')](_0x2c6b5d[_0x192d('0x41')],{'showHidden':![],'depth':null}));};break;}return _0x29f21c;}})[_0x192d('0x1e')](respondWithResult(_0x390061,null))['catch'](handleError(_0x390061,null));};exports[_0x192d('0xdf')]=function(_0x559fb7,_0x3bca96,_0xb55ac6){return db[_0x192d('0x50')][_0x192d('0x58')]({'where':{'id':_0x559fb7[_0x192d('0x54')]['id']}})['then'](handleEntityNotFound(_0x3bca96,null))['then'](function(_0x3b3e9a){if(_0x3b3e9a){return _0x3b3e9a[_0x192d('0xdf')](_0x559fb7[_0x192d('0x5a')][_0x192d('0x6a')],_[_0x192d('0x9c')](_0x559fb7[_0x192d('0x5a')],[_0x192d('0x6a'),'id'])||{})[_0x192d('0xe0')](function(_0x4ebcdc){for(var _0x4cda78=0x0;_0x4cda78<_0x559fb7['body'][_0x192d('0x6a')][_0x192d('0x55')];_0x4cda78+=0x1){socket[_0x192d('0xe1')](_0x192d('0xe2'),{'UserId':Number(_0x559fb7[_0x192d('0x5a')][_0x192d('0x6a')][_0x4cda78]),'SmsAccountId':Number(_0x559fb7[_0x192d('0x54')]['id'])});}return _0x4ebcdc;});}})[_0x192d('0x1e')](respondWithResult(_0x3bca96,null))[_0x192d('0x53')](handleError(_0x3bca96,null));};exports[_0x192d('0xe3')]=function(_0x1912b7,_0x26a002,_0x28fe1f){return db[_0x192d('0x50')][_0x192d('0x58')]({'where':{'id':_0x1912b7['params']['id']}})[_0x192d('0x1e')](handleEntityNotFound(_0x26a002,null))[_0x192d('0x1e')](function(_0x2ecdeb){if(_0x2ecdeb){return _0x2ecdeb['removeAgents'](_0x1912b7['query'][_0x192d('0x6a')])['then'](function(){if(_[_0x192d('0xe4')](_0x1912b7[_0x192d('0x41')]['ids'])){for(var _0x48cbe9=0x0;_0x48cbe9<_0x1912b7['query'][_0x192d('0x6a')][_0x192d('0x55')];_0x48cbe9+=0x1){socket[_0x192d('0xe1')](_0x192d('0xe5'),{'UserId':Number(_0x1912b7[_0x192d('0x41')][_0x192d('0x6a')][_0x48cbe9]),'SmsAccountId':Number(_0x1912b7[_0x192d('0x54')]['id'])});}}else{socket[_0x192d('0xe1')](_0x192d('0xe5'),{'UserId':Number(_0x1912b7[_0x192d('0x41')][_0x192d('0x6a')]),'SmsAccountId':Number(_0x1912b7[_0x192d('0x54')]['id'])});}});}})[_0x192d('0x1e')](respondWithStatusCode(_0x26a002,null))['catch'](handleError(_0x26a002,null));};exports['getAgents']=function(_0x3c676e,_0x51ce9e,_0x1fba1e){var _0x23ef70={};var _0x97385e={};var _0x6da40;var _0x26e78f;return db['SmsAccount'][_0x192d('0x65')]({'where':{'id':_0x3c676e[_0x192d('0x54')]['id']}})[_0x192d('0x1e')](handleEntityNotFound(_0x51ce9e,null))[_0x192d('0x1e')](function(_0x5d16fd){if(_0x5d16fd){_0x6da40=_0x5d16fd;_0x97385e[_0x192d('0x40')]=_[_0x192d('0x42')](db['User']['rawAttributes']);_0x97385e[_0x192d('0x41')]=_[_0x192d('0x42')](_0x3c676e[_0x192d('0x41')]);_0x97385e['filters']=_['intersection'](_0x97385e[_0x192d('0x40')],_0x97385e['query']);_0x23ef70[_0x192d('0x46')]=_[_0x192d('0x44')](_0x97385e[_0x192d('0x40')],qs[_0x192d('0x45')](_0x3c676e[_0x192d('0x41')][_0x192d('0x45')]));_0x23ef70[_0x192d('0x46')]=_0x23ef70[_0x192d('0x46')]['length']?_0x23ef70[_0x192d('0x46')]:_0x97385e['model'];_0x23ef70[_0x192d('0x49')]=qs[_0x192d('0x4a')](_0x3c676e[_0x192d('0x41')][_0x192d('0x4a')]);_0x23ef70[_0x192d('0x4b')]=qs['filters'](_[_0x192d('0x67')](_0x3c676e[_0x192d('0x41')],_0x97385e['filters']));if(_0x3c676e['query'][_0x192d('0x4c')]){_0x23ef70[_0x192d('0x4b')]=_[_0x192d('0x57')](_0x23ef70['where'],{'$or':_[_0x192d('0x3e')](_0x23ef70[_0x192d('0x46')],function(_0x532cd1){var _0x5c138b={};_0x5c138b[_0x532cd1]={'$like':'%'+_0x3c676e[_0x192d('0x41')]['filter']+'%'};return _0x5c138b;})});}_0x23ef70=_[_0x192d('0x57')]({},_0x23ef70,_0x3c676e[_0x192d('0x4f')]);return _0x6da40[_0x192d('0xe6')](_0x23ef70);}})[_0x192d('0x1e')](function(_0x2fd5c9){if(_0x2fd5c9){_0x26e78f=_0x2fd5c9[_0x192d('0x55')];if(!_0x3c676e[_0x192d('0x41')][_0x192d('0x47')](_0x192d('0x48'))){_0x23ef70['limit']=qs[_0x192d('0x2b')](_0x3c676e['query'][_0x192d('0x2b')]);_0x23ef70[_0x192d('0x29')]=qs[_0x192d('0x29')](_0x3c676e[_0x192d('0x41')]['offset']);}return _0x6da40[_0x192d('0xe6')](_0x23ef70);}})[_0x192d('0x1e')](function(_0x44055e){if(_0x44055e){return _0x44055e?{'count':_0x26e78f,'rows':_0x44055e}:null;}})['then'](respondWithResult(_0x51ce9e,null))[_0x192d('0x53')](handleError(_0x51ce9e,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 403471e..db0a78c 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 _0xf421=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsAccount','setMaxListeners','save'];(function(_0x3fba9f,_0x3b7b9b){var _0x192cf1=function(_0x557290){while(--_0x557290){_0x3fba9f['push'](_0x3fba9f['shift']());}};_0x192cf1(++_0x3b7b9b);}(_0xf421,0x1c9));var _0x1f42=function(_0x287d51,_0x46b59f){_0x287d51=_0x287d51-0x0;var _0x3709c7=_0xf421[_0x287d51];return _0x3709c7;};'use strict';var EventEmitter=require(_0x1f42('0x0'));var SmsAccount=require(_0x1f42('0x1'))['db'][_0x1f42('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x1f42('0x3')](0x0);var events={'afterCreate':_0x1f42('0x4'),'afterUpdate':_0x1f42('0x5'),'afterDestroy':_0x1f42('0x6')};function emitEvent(_0x2e5393){return function(_0x36ba29,_0x4aa7c7,_0x1688f1){SmsAccountEvents['emit'](_0x2e5393+':'+_0x36ba29['id'],_0x36ba29);SmsAccountEvents[_0x1f42('0x7')](_0x2e5393,_0x36ba29);_0x1688f1(null);};}for(var e in events){if(events[_0x1f42('0x8')](e)){var event=events[e];SmsAccount[_0x1f42('0x9')](e,emitEvent(event));}}module[_0x1f42('0xa')]=SmsAccountEvents; \ No newline at end of file +var _0x5eb9=['hasOwnProperty','hook','exports','events','../../mysqldb','SmsAccount','setMaxListeners','save','update'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x5eb9,0xe4));var _0x95eb=function(_0x35c300,_0x284351){_0x35c300=_0x35c300-0x0;var _0x59e44b=_0x5eb9[_0x35c300];return _0x59e44b;};'use strict';var EventEmitter=require(_0x95eb('0x0'));var SmsAccount=require(_0x95eb('0x1'))['db'][_0x95eb('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x95eb('0x3')](0x0);var events={'afterCreate':_0x95eb('0x4'),'afterUpdate':_0x95eb('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1cce0f){return function(_0x518763,_0x37e92a,_0x27f14e){SmsAccountEvents['emit'](_0x1cce0f+':'+_0x518763['id'],_0x518763);SmsAccountEvents['emit'](_0x1cce0f,_0x518763);_0x27f14e(null);};}for(var e in events){if(events[_0x95eb('0x6')](e)){var event=events[e];SmsAccount[_0x95eb('0x7')](e,emitEvent(event));}}module[_0x95eb('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 b4d1ce7..66bac68 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 _0x84df=['sms_accounts','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsAccount.attributes','exports','SmsAccount'];(function(_0x152121,_0x120c53){var _0x592a85=function(_0x241cab){while(--_0x241cab){_0x152121['push'](_0x152121['shift']());}};_0x592a85(++_0x120c53);}(_0x84df,0x175));var _0xf84d=function(_0x406696,_0x39f9b1){_0x406696=_0x406696-0x0;var _0x10e35c=_0x84df[_0x406696];return _0x10e35c;};'use strict';var _=require(_0xf84d('0x0'));var util=require(_0xf84d('0x1'));var logger=require('../../config/logger')(_0xf84d('0x2'));var moment=require(_0xf84d('0x3'));var BPromise=require(_0xf84d('0x4'));var rp=require(_0xf84d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf84d('0x6'));var config=require(_0xf84d('0x7'));var attributes=require(_0xf84d('0x8'));module[_0xf84d('0x9')]=function(_0x1ade21,_0x5783c3){return _0x1ade21['define'](_0xf84d('0xa'),attributes,{'tableName':_0xf84d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4a5f=['path','rimraf','../../config/environment','./smsAccount.attributes','exports','define','SmsAccount','sms_accounts','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x4c4d07,_0x48512b){var _0x278851=function(_0x507727){while(--_0x507727){_0x4c4d07['push'](_0x4c4d07['shift']());}};_0x278851(++_0x48512b);}(_0x4a5f,0x13c));var _0xf4a5=function(_0xdb027c,_0x555595){_0xdb027c=_0xdb027c-0x0;var _0x7b4cf3=_0x4a5f[_0xdb027c];return _0x7b4cf3;};'use strict';var _=require(_0xf4a5('0x0'));var util=require(_0xf4a5('0x1'));var logger=require(_0xf4a5('0x2'))(_0xf4a5('0x3'));var moment=require(_0xf4a5('0x4'));var BPromise=require('bluebird');var rp=require(_0xf4a5('0x5'));var fs=require('fs');var path=require(_0xf4a5('0x6'));var rimraf=require(_0xf4a5('0x7'));var config=require(_0xf4a5('0x8'));var attributes=require(_0xf4a5('0x9'));module[_0xf4a5('0xa')]=function(_0x1b93a3,_0x31992e){return _0x1b93a3[_0xf4a5('0xb')](_0xf4a5('0xc'),attributes,{'tableName':_0xf4a5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.rpc.js b/server/api/smsAccount/smsAccount.rpc.js index 19a566e..464b858 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 _0x02bc=['include','map','model','stringify','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','./smsAccount.socket','request','then','info','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','SmsAccount,\x20%s,\x20%s','message','result','SmsAccount','find','options','where','attributes'];(function(_0x462b34,_0x2dbe8c){var _0x1a5506=function(_0xe95f){while(--_0xe95f){_0x462b34['push'](_0x462b34['shift']());}};_0x1a5506(++_0x2dbe8c);}(_0x02bc,0xb4));var _0xc02b=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x02bc[_0x432682];return _0x463d05;};'use strict';var _=require(_0xc02b('0x0'));var util=require(_0xc02b('0x1'));var moment=require(_0xc02b('0x2'));var BPromise=require(_0xc02b('0x3'));var rs=require(_0xc02b('0x4'));var fs=require('fs');var Redis=require(_0xc02b('0x5'));var db=require(_0xc02b('0x6'))['db'];var utils=require(_0xc02b('0x7'));var logger=require(_0xc02b('0x8'))('rpc');var config=require(_0xc02b('0x9'));var jayson=require(_0xc02b('0xa'));var client=jayson[_0xc02b('0xb')][_0xc02b('0xc')]({'port':0x232a});config[_0xc02b('0xd')]=_['defaults'](config['redis'],{'host':_0xc02b('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc02b('0xd')]));require(_0xc02b('0xf'))['register'](socket);function respondWithRpcPromise(_0x5d6693,_0x13c151,_0x4ddc51){return new BPromise(function(_0x93a79d,_0x34e250){return client[_0xc02b('0x10')](_0x5d6693,_0x4ddc51)[_0xc02b('0x11')](function(_0xf5b17){logger[_0xc02b('0x12')]('SmsAccount,\x20%s,\x20%s',_0x13c151,'request\x20sent');logger['debug'](_0xc02b('0x13'),_0x13c151,_0xc02b('0x14'),JSON['stringify'](_0xf5b17));if(_0xf5b17[_0xc02b('0x15')]){if(_0xf5b17[_0xc02b('0x15')]['code']===0x1f4){logger[_0xc02b('0x15')]('SmsAccount,\x20%s,\x20%s',_0x13c151,_0xf5b17['error']['message']);return _0x34e250(_0xf5b17['error']['message']);}logger['error'](_0xc02b('0x16'),_0x13c151,_0xf5b17[_0xc02b('0x15')][_0xc02b('0x17')]);return _0x93a79d(_0xf5b17['error'][_0xc02b('0x17')]);}else{logger[_0xc02b('0x12')]('SmsAccount,\x20%s,\x20%s',_0x13c151,_0xc02b('0x14'));_0x93a79d(_0xf5b17[_0xc02b('0x18')]['message']);}})['catch'](function(_0x79f80d){logger['error'](_0xc02b('0x16'),_0x13c151,_0x79f80d);_0x34e250(_0x79f80d);});});}exports['ShowSmsAccount']=function(_0x34b9c0){var _0x2f8cc2=this;return new Promise(function(_0x290f3a,_0x2127a2){return db[_0xc02b('0x19')][_0xc02b('0x1a')]({'raw':_0x34b9c0[_0xc02b('0x1b')]?_0x34b9c0['options']['raw']===undefined?!![]:![]:!![],'where':_0x34b9c0['options']?_0x34b9c0[_0xc02b('0x1b')][_0xc02b('0x1c')]||null:null,'attributes':_0x34b9c0[_0xc02b('0x1b')]?_0x34b9c0[_0xc02b('0x1b')][_0xc02b('0x1d')]||null:null,'include':_0x34b9c0[_0xc02b('0x1b')]?_0x34b9c0['options'][_0xc02b('0x1e')]?_[_0xc02b('0x1f')](_0x34b9c0['options'][_0xc02b('0x1e')],function(_0x350171){return{'model':db[_0x350171[_0xc02b('0x20')]],'as':_0x350171['as'],'attributes':_0x350171[_0xc02b('0x1d')],'include':_0x350171[_0xc02b('0x1e')]?_[_0xc02b('0x1f')](_0x350171[_0xc02b('0x1e')],function(_0x5b091a){return{'model':db[_0x5b091a[_0xc02b('0x20')]],'as':_0x5b091a['as'],'attributes':_0x5b091a[_0xc02b('0x1d')],'include':_0x5b091a[_0xc02b('0x1e')]?_['map'](_0x5b091a[_0xc02b('0x1e')],function(_0x51a6cd){return{'model':db[_0x51a6cd[_0xc02b('0x20')]],'as':_0x51a6cd['as'],'attributes':_0x51a6cd['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4b8037){logger['info']('ShowSmsAccount',_0x34b9c0);logger['debug']('ShowSmsAccount',_0x34b9c0,JSON[_0xc02b('0x21')](_0x4b8037));_0x290f3a(_0x4b8037);})[_0xc02b('0x22')](function(_0x35ba77){logger['error']('ShowSmsAccount',_0x35ba77['message'],_0x34b9c0);_0x2127a2(_0x2f8cc2['error'](0x1f4,_0x35ba77['message']));});});}; \ No newline at end of file +var _0x8b2d=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./smsAccount.socket','register','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','ShowSmsAccount','SmsAccount','raw','options','where','attributes','map','include','lodash','util','moment'];(function(_0x2aaf36,_0x2eb341){var _0x274055=function(_0x12d07d){while(--_0x12d07d){_0x2aaf36['push'](_0x2aaf36['shift']());}};_0x274055(++_0x2eb341);}(_0x8b2d,0x100));var _0xd8b2=function(_0x428018,_0x2e3229){_0x428018=_0x428018-0x0;var _0x49fefa=_0x8b2d[_0x428018];return _0x49fefa;};'use strict';var _=require(_0xd8b2('0x0'));var util=require(_0xd8b2('0x1'));var moment=require(_0xd8b2('0x2'));var BPromise=require(_0xd8b2('0x3'));var rs=require(_0xd8b2('0x4'));var fs=require('fs');var Redis=require(_0xd8b2('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd8b2('0x6'));var logger=require(_0xd8b2('0x7'))(_0xd8b2('0x8'));var config=require(_0xd8b2('0x9'));var jayson=require(_0xd8b2('0xa'));var client=jayson[_0xd8b2('0xb')][_0xd8b2('0xc')]({'port':0x232a});config[_0xd8b2('0xd')]=_[_0xd8b2('0xe')](config[_0xd8b2('0xd')],{'host':_0xd8b2('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd8b2('0xd')]));require(_0xd8b2('0x10'))[_0xd8b2('0x11')](socket);function respondWithRpcPromise(_0x23eac4,_0x31da27,_0x507c61){return new BPromise(function(_0x2fbe00,_0x385106){return client[_0xd8b2('0x12')](_0x23eac4,_0x507c61)[_0xd8b2('0x13')](function(_0x200eb3){logger[_0xd8b2('0x14')](_0xd8b2('0x15'),_0x31da27,_0xd8b2('0x16'));logger[_0xd8b2('0x17')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x31da27,_0xd8b2('0x16'),JSON[_0xd8b2('0x18')](_0x200eb3));if(_0x200eb3[_0xd8b2('0x19')]){if(_0x200eb3['error'][_0xd8b2('0x1a')]===0x1f4){logger[_0xd8b2('0x19')](_0xd8b2('0x15'),_0x31da27,_0x200eb3[_0xd8b2('0x19')][_0xd8b2('0x1b')]);return _0x385106(_0x200eb3[_0xd8b2('0x19')][_0xd8b2('0x1b')]);}logger[_0xd8b2('0x19')](_0xd8b2('0x15'),_0x31da27,_0x200eb3[_0xd8b2('0x19')][_0xd8b2('0x1b')]);return _0x2fbe00(_0x200eb3[_0xd8b2('0x19')][_0xd8b2('0x1b')]);}else{logger[_0xd8b2('0x14')](_0xd8b2('0x15'),_0x31da27,_0xd8b2('0x16'));_0x2fbe00(_0x200eb3[_0xd8b2('0x1c')]['message']);}})['catch'](function(_0x41f778){logger[_0xd8b2('0x19')](_0xd8b2('0x15'),_0x31da27,_0x41f778);_0x385106(_0x41f778);});});}exports[_0xd8b2('0x1d')]=function(_0x2e5dd9){var _0x230643=this;return new Promise(function(_0x1a429b,_0x3763cd){return db[_0xd8b2('0x1e')]['find']({'raw':_0x2e5dd9['options']?_0x2e5dd9['options'][_0xd8b2('0x1f')]===undefined?!![]:![]:!![],'where':_0x2e5dd9[_0xd8b2('0x20')]?_0x2e5dd9[_0xd8b2('0x20')][_0xd8b2('0x21')]||null:null,'attributes':_0x2e5dd9[_0xd8b2('0x20')]?_0x2e5dd9['options'][_0xd8b2('0x22')]||null:null,'include':_0x2e5dd9['options']?_0x2e5dd9['options']['include']?_[_0xd8b2('0x23')](_0x2e5dd9[_0xd8b2('0x20')]['include'],function(_0x2c84a9){return{'model':db[_0x2c84a9['model']],'as':_0x2c84a9['as'],'attributes':_0x2c84a9[_0xd8b2('0x22')],'include':_0x2c84a9[_0xd8b2('0x24')]?_[_0xd8b2('0x23')](_0x2c84a9['include'],function(_0x1c3e80){return{'model':db[_0x1c3e80['model']],'as':_0x1c3e80['as'],'attributes':_0x1c3e80[_0xd8b2('0x22')],'include':_0x1c3e80[_0xd8b2('0x24')]?_[_0xd8b2('0x23')](_0x1c3e80[_0xd8b2('0x24')],function(_0x29c90e){return{'model':db[_0x29c90e['model']],'as':_0x29c90e['as'],'attributes':_0x29c90e[_0xd8b2('0x22')]};}):[]};}):[]};}):[]:[]})[_0xd8b2('0x13')](function(_0x3ebb7f){logger[_0xd8b2('0x14')]('ShowSmsAccount',_0x2e5dd9);logger[_0xd8b2('0x17')]('ShowSmsAccount',_0x2e5dd9,JSON['stringify'](_0x3ebb7f));_0x1a429b(_0x3ebb7f);})['catch'](function(_0x10da37){logger[_0xd8b2('0x19')](_0xd8b2('0x1d'),_0x10da37['message'],_0x2e5dd9);_0x3763cd(_0x230643[_0xd8b2('0x19')](0x1f4,_0x10da37['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index ee9056d..3262cfd 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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'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 0433b89..92dec88 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(_0x4c4b04,_0x569c2b){var _0xad2374=function(_0x1fb354){while(--_0x1fb354){_0x4c4b04['push'](_0x4c4b04['shift']());}};_0xad2374(++_0x569c2b);}(_0x008c,0x188));var _0xc008=function(_0x267c52,_0x3c0df3){_0x267c52=_0x267c52-0x0;var _0x46c47b=_0x008c[_0x267c52];return _0x46c47b;};'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 _0x55ca=['update','delete','/:id','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','show','create'];(function(_0x1fa124,_0x4a26af){var _0x325a2c=function(_0x111d9e){while(--_0x111d9e){_0x1fa124['push'](_0x1fa124['shift']());}};_0x325a2c(++_0x4a26af);}(_0x55ca,0x126));var _0xa55c=function(_0x7642c,_0x2ec4b0){_0x7642c=_0x7642c-0x0;var _0x5412fd=_0x55ca[_0x7642c];return _0x5412fd;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['post']('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0xb')]);router['put']('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xc')]);router[_0xa55c('0xd')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);module[_0xa55c('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 0120345..261bced 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 _0x5815=['INTEGER','STRING','noop','*,*,*,*','sequelize','exports'];(function(_0x427476,_0x318626){var _0x2f9771=function(_0x18d583){while(--_0x18d583){_0x427476['push'](_0x427476['shift']());}};_0x2f9771(++_0x318626);}(_0x5815,0x1d2));var _0x5581=function(_0x2082a1,_0x590127){_0x2082a1=_0x2082a1-0x0;var _0x7df734=_0x5815[_0x2082a1];return _0x7df734;};'use strict';var Sequelize=require(_0x5581('0x0'));module[_0x5581('0x1')]={'priority':{'type':Sequelize[_0x5581('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x5581('0x3')],'allowNull':![],'defaultValue':_0x5581('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x5581('0x3')]},'interval':{'type':Sequelize[_0x5581('0x3')],'defaultValue':_0x5581('0x5')}}; \ No newline at end of file +var _0x08ad=['TEXT','sequelize','INTEGER','STRING'];(function(_0x449fa0,_0x23fa3d){var _0x1b2dda=function(_0x4f61f1){while(--_0x4f61f1){_0x449fa0['push'](_0x449fa0['shift']());}};_0x1b2dda(++_0x23fa3d);}(_0x08ad,0x1e5));var _0xd08a=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0x08ad[_0x1beef3];return _0x5af964;};'use strict';var Sequelize=require(_0xd08a('0x0'));module['exports']={'priority':{'type':Sequelize[_0xd08a('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xd08a('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xd08a('0x3')]()},'description':{'type':Sequelize[_0xd08a('0x2')]},'interval':{'type':Sequelize[_0xd08a('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 9f1cdfa..9616dc3 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 _0x6e94=['filter','merge','VIRTUAL','options','SmsApplication','include','rows','catch','params','intersection','length','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','then','destroy','sendStatus','name','index','map','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x53f9c2,_0x5659e9){var _0x960075=function(_0x4d281a){while(--_0x4d281a){_0x53f9c2['push'](_0x53f9c2['shift']());}};_0x960075(++_0x5659e9);}(_0x6e94,0x126));var _0x46e9=function(_0xfa634c,_0x414e0e){_0xfa634c=_0xfa634c-0x0;var _0x73e478=_0x6e94[_0xfa634c];return _0x73e478;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x46e9('0x0'));var zipdir=require(_0x46e9('0x1'));var jsonpatch=require(_0x46e9('0x2'));var rp=require(_0x46e9('0x3'));var moment=require(_0x46e9('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x46e9('0x5'));var path=require(_0x46e9('0x6'));var sox=require(_0x46e9('0x7'));var csv=require(_0x46e9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x46e9('0x9'));var _=require(_0x46e9('0xa'));var squel=require(_0x46e9('0xb'));var crypto=require(_0x46e9('0xc'));var jsforce=require(_0x46e9('0xd'));var deskjs=require(_0x46e9('0xe'));var toCsv=require(_0x46e9('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x46e9('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x46e9('0x10'));var as=require(_0x46e9('0x11'));var hardwareService=require(_0x46e9('0x12'));var logger=require(_0x46e9('0x13'))(_0x46e9('0x14'));var utils=require(_0x46e9('0x15'));var config=require(_0x46e9('0x16'));var licenseUtil=require(_0x46e9('0x17'));var db=require(_0x46e9('0x18'))['db'];function respondWithStatusCode(_0x5868b2,_0x2fc3f6){_0x2fc3f6=_0x2fc3f6||0xcc;return function(_0x41c2c4){if(_0x41c2c4){return _0x5868b2['sendStatus'](_0x2fc3f6);}return _0x5868b2[_0x46e9('0x19')](_0x2fc3f6)[_0x46e9('0x1a')]();};}function respondWithResult(_0x5cfcd1,_0x40f3b1){_0x40f3b1=_0x40f3b1||0xc8;return function(_0x4c7da9){if(_0x4c7da9){return _0x5cfcd1['status'](_0x40f3b1)['json'](_0x4c7da9);}};}function respondWithFilteredResult(_0x54c3d6,_0x453bf3){return function(_0x534e8d){if(_0x534e8d){var _0x561768=typeof _0x453bf3[_0x46e9('0x1b')]===_0x46e9('0x1c')&&typeof _0x453bf3[_0x46e9('0x1d')]===_0x46e9('0x1c');var _0x1761ff=_0x534e8d[_0x46e9('0x1e')];var _0x3a0d52=_0x561768?0x0:_0x453bf3[_0x46e9('0x1b')];var _0x473738=_0x561768?_0x534e8d[_0x46e9('0x1e')]:_0x453bf3[_0x46e9('0x1b')]+_0x453bf3[_0x46e9('0x1d')];var _0x5ea3a3;if(_0x473738>=_0x1761ff){_0x473738=_0x1761ff;_0x5ea3a3=0xc8;}else{_0x5ea3a3=0xce;}_0x54c3d6[_0x46e9('0x19')](_0x5ea3a3);return _0x54c3d6[_0x46e9('0x1f')](_0x46e9('0x20'),_0x3a0d52+'-'+_0x473738+'/'+_0x1761ff)[_0x46e9('0x21')](_0x534e8d);}return null;};}function patchUpdates(_0x63d9b1){return function(_0x290377){try{jsonpatch['apply'](_0x290377,_0x63d9b1,!![]);}catch(_0x1d588f){return BPromise['reject'](_0x1d588f);}return _0x290377['save']();};}function saveUpdates(_0x354759,_0x3e3b54){return function(_0x556698){if(_0x556698){return _0x556698['update'](_0x354759)[_0x46e9('0x22')](function(_0x35ff51){return _0x35ff51;});}return null;};}function removeEntity(_0x5f4f90,_0x221fbc){return function(_0x2db92c){if(_0x2db92c){return _0x2db92c[_0x46e9('0x23')]()[_0x46e9('0x22')](function(){_0x5f4f90[_0x46e9('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4418d1,_0x5c8122){return function(_0x5ea013){if(!_0x5ea013){_0x4418d1[_0x46e9('0x24')](0x194);}return _0x5ea013;};}function handleError(_0x5b2b53,_0x507760){_0x507760=_0x507760||0x1f4;return function(_0x3fe21c){logger['error'](_0x3fe21c['stack']);if(_0x3fe21c[_0x46e9('0x25')]){delete _0x3fe21c[_0x46e9('0x25')];}_0x5b2b53[_0x46e9('0x19')](_0x507760)['send'](_0x3fe21c);};}exports[_0x46e9('0x26')]=function(_0x50cf1b,_0x1e28a1){var _0x453928={},_0x454387={},_0x116324={'count':0x0,'rows':[]};var _0x19c86a=_[_0x46e9('0x27')](db['SmsApplication'][_0x46e9('0x28')],function(_0x4b4889){return{'name':_0x4b4889[_0x46e9('0x29')],'type':_0x4b4889[_0x46e9('0x2a')][_0x46e9('0x2b')]};});_0x454387['model']=_['map'](_0x19c86a,_0x46e9('0x25'));_0x454387[_0x46e9('0x2c')]=_[_0x46e9('0x2d')](_0x50cf1b[_0x46e9('0x2c')]);_0x454387[_0x46e9('0x2e')]=_['intersection'](_0x454387[_0x46e9('0x2f')],_0x454387[_0x46e9('0x2c')]);_0x453928[_0x46e9('0x30')]=_['intersection'](_0x454387[_0x46e9('0x2f')],qs[_0x46e9('0x31')](_0x50cf1b[_0x46e9('0x2c')]['fields']));_0x453928[_0x46e9('0x30')]=_0x453928[_0x46e9('0x30')]['length']?_0x453928['attributes']:_0x454387['model'];if(!_0x50cf1b[_0x46e9('0x2c')][_0x46e9('0x32')](_0x46e9('0x33'))){_0x453928[_0x46e9('0x1d')]=qs[_0x46e9('0x1d')](_0x50cf1b[_0x46e9('0x2c')][_0x46e9('0x1d')]);_0x453928[_0x46e9('0x1b')]=qs[_0x46e9('0x1b')](_0x50cf1b[_0x46e9('0x2c')]['offset']);}_0x453928[_0x46e9('0x34')]=qs[_0x46e9('0x35')](_0x50cf1b['query'][_0x46e9('0x35')]);_0x453928[_0x46e9('0x36')]=qs['filters'](_[_0x46e9('0x37')](_0x50cf1b[_0x46e9('0x2c')],_0x454387['filters']),_0x19c86a);if(_0x50cf1b[_0x46e9('0x2c')][_0x46e9('0x38')]){_0x453928[_0x46e9('0x36')]=_[_0x46e9('0x39')](_0x453928['where'],{'$or':_[_0x46e9('0x27')](_0x19c86a,function(_0x54e9fb){if(_0x54e9fb[_0x46e9('0x2a')]!==_0x46e9('0x3a')){var _0xac0c0d={};_0xac0c0d[_0x54e9fb['name']]={'$like':'%'+_0x50cf1b[_0x46e9('0x2c')][_0x46e9('0x38')]+'%'};return _0xac0c0d;}})});}_0x453928=_[_0x46e9('0x39')]({},_0x453928,_0x50cf1b[_0x46e9('0x3b')]);var _0x4f33d4={'where':_0x453928[_0x46e9('0x36')]};return db[_0x46e9('0x3c')][_0x46e9('0x1e')](_0x4f33d4)[_0x46e9('0x22')](function(_0x2f480b){_0x116324[_0x46e9('0x1e')]=_0x2f480b;if(_0x50cf1b['query']['includeAll']){_0x453928[_0x46e9('0x3d')]=[{'all':!![]}];}return db[_0x46e9('0x3c')]['findAll'](_0x453928);})[_0x46e9('0x22')](function(_0x577fa6){_0x116324[_0x46e9('0x3e')]=_0x577fa6;return _0x116324;})[_0x46e9('0x22')](respondWithFilteredResult(_0x1e28a1,_0x453928))[_0x46e9('0x3f')](handleError(_0x1e28a1,null));};exports['show']=function(_0x57cad7,_0x4a9031){var _0x4f8436={'raw':!![],'where':{'id':_0x57cad7[_0x46e9('0x40')]['id']}},_0x3ef13f={};_0x3ef13f[_0x46e9('0x2f')]=_['keys'](db[_0x46e9('0x3c')][_0x46e9('0x28')]);_0x3ef13f[_0x46e9('0x2c')]=_[_0x46e9('0x2d')](_0x57cad7['query']);_0x3ef13f[_0x46e9('0x2e')]=_['intersection'](_0x3ef13f['model'],_0x3ef13f[_0x46e9('0x2c')]);_0x4f8436['attributes']=_[_0x46e9('0x41')](_0x3ef13f[_0x46e9('0x2f')],qs[_0x46e9('0x31')](_0x57cad7[_0x46e9('0x2c')][_0x46e9('0x31')]));_0x4f8436[_0x46e9('0x30')]=_0x4f8436[_0x46e9('0x30')][_0x46e9('0x42')]?_0x4f8436[_0x46e9('0x30')]:_0x3ef13f[_0x46e9('0x2f')];if(_0x57cad7[_0x46e9('0x2c')]['includeAll']){_0x4f8436[_0x46e9('0x3d')]=[{'all':!![]}];}_0x4f8436=_['merge']({},_0x4f8436,_0x57cad7['options']);return db[_0x46e9('0x3c')][_0x46e9('0x43')](_0x4f8436)[_0x46e9('0x22')](handleEntityNotFound(_0x4a9031,null))['then'](respondWithResult(_0x4a9031,null))[_0x46e9('0x3f')](handleError(_0x4a9031,null));};exports[_0x46e9('0x44')]=function(_0x3ba6d6,_0x4f1670){return db[_0x46e9('0x3c')][_0x46e9('0x44')](_0x3ba6d6[_0x46e9('0x45')],{})[_0x46e9('0x22')](respondWithResult(_0x4f1670,0xc9))[_0x46e9('0x3f')](handleError(_0x4f1670,null));};exports['update']=function(_0x4592a3,_0x165502){if(_0x4592a3[_0x46e9('0x45')]['id']){delete _0x4592a3[_0x46e9('0x45')]['id'];}return db['SmsApplication']['find']({'where':{'id':_0x4592a3[_0x46e9('0x40')]['id']}})[_0x46e9('0x22')](handleEntityNotFound(_0x165502,null))['then'](saveUpdates(_0x4592a3[_0x46e9('0x45')],null))[_0x46e9('0x22')](respondWithResult(_0x165502,null))[_0x46e9('0x3f')](handleError(_0x165502,null));};exports[_0x46e9('0x23')]=function(_0x55d41a,_0x4b7b1a){return db[_0x46e9('0x3c')]['find']({'where':{'id':_0x55d41a['params']['id']}})[_0x46e9('0x22')](handleEntityNotFound(_0x4b7b1a,null))[_0x46e9('0x22')](removeEntity(_0x4b7b1a,null))[_0x46e9('0x3f')](handleError(_0x4b7b1a,null));}; \ No newline at end of file +var _0x112b=['where','filter','merge','VIRTUAL','options','SmsApplication','includeAll','findAll','rows','params','include','find','create','body','catch','destroy','rimraf','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','apply','save','update','then','stack','name','send','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort'];(function(_0x12c350,_0x17f36e){var _0xa7d2bd=function(_0x2ab930){while(--_0x2ab930){_0x12c350['push'](_0x12c350['shift']());}};_0xa7d2bd(++_0x17f36e);}(_0x112b,0x1ec));var _0xb112=function(_0x250f95,_0x5a5728){_0x250f95=_0x250f95-0x0;var _0x4ada97=_0x112b[_0x250f95];return _0x4ada97;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb112('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb112('0x1'));var BPromise=require(_0xb112('0x2'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb112('0x3'));var sox=require('sox');var csv=require(_0xb112('0x4'));var ejs=require(_0xb112('0x5'));var fs=require('fs');var fs_extra=require(_0xb112('0x6'));var _=require(_0xb112('0x7'));var squel=require('squel');var crypto=require(_0xb112('0x8'));var jsforce=require(_0xb112('0x9'));var deskjs=require(_0xb112('0xa'));var toCsv=require('to-csv');var querystring=require(_0xb112('0xb'));var Papa=require('papaparse');var Redis=require(_0xb112('0xc'));var authService=require(_0xb112('0xd'));var qs=require(_0xb112('0xe'));var as=require(_0xb112('0xf'));var hardwareService=require(_0xb112('0x10'));var logger=require('../../config/logger')(_0xb112('0x11'));var utils=require(_0xb112('0x12'));var config=require(_0xb112('0x13'));var licenseUtil=require(_0xb112('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xece768,_0x44fef9){_0x44fef9=_0x44fef9||0xcc;return function(_0x3afd05){if(_0x3afd05){return _0xece768[_0xb112('0x15')](_0x44fef9);}return _0xece768[_0xb112('0x16')](_0x44fef9)[_0xb112('0x17')]();};}function respondWithResult(_0x2dddf5,_0x4d5a78){_0x4d5a78=_0x4d5a78||0xc8;return function(_0x1e281d){if(_0x1e281d){return _0x2dddf5[_0xb112('0x16')](_0x4d5a78)['json'](_0x1e281d);}};}function respondWithFilteredResult(_0x2590f4,_0x2fb190){return function(_0x14d57a){if(_0x14d57a){var _0x13be5e=typeof _0x2fb190['offset']===_0xb112('0x18')&&typeof _0x2fb190[_0xb112('0x19')]===_0xb112('0x18');var _0x4e2b6b=_0x14d57a[_0xb112('0x1a')];var _0x1a9989=_0x13be5e?0x0:_0x2fb190['offset'];var _0x102af4=_0x13be5e?_0x14d57a[_0xb112('0x1a')]:_0x2fb190[_0xb112('0x1b')]+_0x2fb190[_0xb112('0x19')];var _0x2494bc;if(_0x102af4>=_0x4e2b6b){_0x102af4=_0x4e2b6b;_0x2494bc=0xc8;}else{_0x2494bc=0xce;}_0x2590f4['status'](_0x2494bc);return _0x2590f4['set'](_0xb112('0x1c'),_0x1a9989+'-'+_0x102af4+'/'+_0x4e2b6b)[_0xb112('0x1d')](_0x14d57a);}return null;};}function patchUpdates(_0x1eeb73){return function(_0x1bea1d){try{jsonpatch[_0xb112('0x1e')](_0x1bea1d,_0x1eeb73,!![]);}catch(_0x586746){return BPromise['reject'](_0x586746);}return _0x1bea1d[_0xb112('0x1f')]();};}function saveUpdates(_0x4e3496,_0x364b86){return function(_0x3efbb6){if(_0x3efbb6){return _0x3efbb6[_0xb112('0x20')](_0x4e3496)[_0xb112('0x21')](function(_0xe6542a){return _0xe6542a;});}return null;};}function removeEntity(_0xbbe4d1,_0x2cc217){return function(_0x100119){if(_0x100119){return _0x100119['destroy']()['then'](function(){_0xbbe4d1['status'](0xcc)[_0xb112('0x17')]();});}};}function handleEntityNotFound(_0x1c1dde,_0xa40de0){return function(_0x2c99ef){if(!_0x2c99ef){_0x1c1dde[_0xb112('0x15')](0x194);}return _0x2c99ef;};}function handleError(_0x1a3a89,_0x2c1c64){_0x2c1c64=_0x2c1c64||0x1f4;return function(_0x2f58d4){logger['error'](_0x2f58d4[_0xb112('0x22')]);if(_0x2f58d4[_0xb112('0x23')]){delete _0x2f58d4[_0xb112('0x23')];}_0x1a3a89[_0xb112('0x16')](_0x2c1c64)[_0xb112('0x24')](_0x2f58d4);};}exports['index']=function(_0x1fdf2f,_0x735fdc){var _0x10b154={},_0xce1b81={},_0x1d7a7b={'count':0x0,'rows':[]};var _0x871d7=_['map'](db['SmsApplication'][_0xb112('0x25')],function(_0x500f02){return{'name':_0x500f02[_0xb112('0x26')],'type':_0x500f02[_0xb112('0x27')]['key']};});_0xce1b81[_0xb112('0x28')]=_[_0xb112('0x29')](_0x871d7,'name');_0xce1b81[_0xb112('0x2a')]=_[_0xb112('0x2b')](_0x1fdf2f[_0xb112('0x2a')]);_0xce1b81[_0xb112('0x2c')]=_[_0xb112('0x2d')](_0xce1b81[_0xb112('0x28')],_0xce1b81['query']);_0x10b154[_0xb112('0x2e')]=_['intersection'](_0xce1b81[_0xb112('0x28')],qs[_0xb112('0x2f')](_0x1fdf2f[_0xb112('0x2a')][_0xb112('0x2f')]));_0x10b154[_0xb112('0x2e')]=_0x10b154[_0xb112('0x2e')][_0xb112('0x30')]?_0x10b154[_0xb112('0x2e')]:_0xce1b81[_0xb112('0x28')];if(!_0x1fdf2f[_0xb112('0x2a')]['hasOwnProperty'](_0xb112('0x31'))){_0x10b154[_0xb112('0x19')]=qs[_0xb112('0x19')](_0x1fdf2f[_0xb112('0x2a')][_0xb112('0x19')]);_0x10b154['offset']=qs['offset'](_0x1fdf2f['query']['offset']);}_0x10b154[_0xb112('0x32')]=qs[_0xb112('0x33')](_0x1fdf2f[_0xb112('0x2a')]['sort']);_0x10b154[_0xb112('0x34')]=qs[_0xb112('0x2c')](_['pick'](_0x1fdf2f['query'],_0xce1b81[_0xb112('0x2c')]),_0x871d7);if(_0x1fdf2f['query'][_0xb112('0x35')]){_0x10b154[_0xb112('0x34')]=_[_0xb112('0x36')](_0x10b154[_0xb112('0x34')],{'$or':_[_0xb112('0x29')](_0x871d7,function(_0x403403){if(_0x403403[_0xb112('0x27')]!==_0xb112('0x37')){var _0x17d04c={};_0x17d04c[_0x403403['name']]={'$like':'%'+_0x1fdf2f[_0xb112('0x2a')][_0xb112('0x35')]+'%'};return _0x17d04c;}})});}_0x10b154=_['merge']({},_0x10b154,_0x1fdf2f[_0xb112('0x38')]);var _0x5556f7={'where':_0x10b154[_0xb112('0x34')]};return db[_0xb112('0x39')][_0xb112('0x1a')](_0x5556f7)[_0xb112('0x21')](function(_0x1494cf){_0x1d7a7b[_0xb112('0x1a')]=_0x1494cf;if(_0x1fdf2f[_0xb112('0x2a')][_0xb112('0x3a')]){_0x10b154['include']=[{'all':!![]}];}return db[_0xb112('0x39')][_0xb112('0x3b')](_0x10b154);})[_0xb112('0x21')](function(_0x5de198){_0x1d7a7b[_0xb112('0x3c')]=_0x5de198;return _0x1d7a7b;})[_0xb112('0x21')](respondWithFilteredResult(_0x735fdc,_0x10b154))['catch'](handleError(_0x735fdc,null));};exports['show']=function(_0x15415b,_0x3fbe0e){var _0xdec7f4={'raw':!![],'where':{'id':_0x15415b[_0xb112('0x3d')]['id']}},_0x31b031={};_0x31b031[_0xb112('0x28')]=_[_0xb112('0x2b')](db[_0xb112('0x39')][_0xb112('0x25')]);_0x31b031[_0xb112('0x2a')]=_[_0xb112('0x2b')](_0x15415b[_0xb112('0x2a')]);_0x31b031['filters']=_[_0xb112('0x2d')](_0x31b031['model'],_0x31b031[_0xb112('0x2a')]);_0xdec7f4['attributes']=_[_0xb112('0x2d')](_0x31b031['model'],qs[_0xb112('0x2f')](_0x15415b[_0xb112('0x2a')]['fields']));_0xdec7f4['attributes']=_0xdec7f4[_0xb112('0x2e')][_0xb112('0x30')]?_0xdec7f4['attributes']:_0x31b031[_0xb112('0x28')];if(_0x15415b[_0xb112('0x2a')][_0xb112('0x3a')]){_0xdec7f4[_0xb112('0x3e')]=[{'all':!![]}];}_0xdec7f4=_[_0xb112('0x36')]({},_0xdec7f4,_0x15415b[_0xb112('0x38')]);return db[_0xb112('0x39')][_0xb112('0x3f')](_0xdec7f4)[_0xb112('0x21')](handleEntityNotFound(_0x3fbe0e,null))[_0xb112('0x21')](respondWithResult(_0x3fbe0e,null))['catch'](handleError(_0x3fbe0e,null));};exports[_0xb112('0x40')]=function(_0x5e3215,_0x2fc722){return db['SmsApplication'][_0xb112('0x40')](_0x5e3215[_0xb112('0x41')],{})[_0xb112('0x21')](respondWithResult(_0x2fc722,0xc9))[_0xb112('0x42')](handleError(_0x2fc722,null));};exports['update']=function(_0x3ac53c,_0x305332){if(_0x3ac53c['body']['id']){delete _0x3ac53c['body']['id'];}return db[_0xb112('0x39')][_0xb112('0x3f')]({'where':{'id':_0x3ac53c['params']['id']}})['then'](handleEntityNotFound(_0x305332,null))['then'](saveUpdates(_0x3ac53c['body'],null))['then'](respondWithResult(_0x305332,null))['catch'](handleError(_0x305332,null));};exports[_0xb112('0x43')]=function(_0x14a4c3,_0x1fb194){return db['SmsApplication'][_0xb112('0x3f')]({'where':{'id':_0x14a4c3['params']['id']}})['then'](handleEntityNotFound(_0x1fb194,null))[_0xb112('0x21')](removeEntity(_0x1fb194,null))['catch'](handleError(_0x1fb194,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 552d269..9d29965 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 _0xdcde=['path','rimraf','../../config/environment','exports','SmsApplication','sms_applications','utf8mb4','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xdcde,0x8b));var _0xedcd=function(_0x2679c0,_0x2ee8b5){_0x2679c0=_0x2679c0-0x0;var _0x1e54b1=_0xdcde[_0x2679c0];return _0x1e54b1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xedcd('0x0'))(_0xedcd('0x1'));var moment=require(_0xedcd('0x2'));var BPromise=require(_0xedcd('0x3'));var rp=require(_0xedcd('0x4'));var fs=require('fs');var path=require(_0xedcd('0x5'));var rimraf=require(_0xedcd('0x6'));var config=require(_0xedcd('0x7'));var attributes=require('./smsApplication.attributes');module[_0xedcd('0x8')]=function(_0x3f0d88,_0xb4e2a7){return _0x3f0d88['define'](_0xedcd('0x9'),attributes,{'tableName':_0xedcd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xedcd('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x0408=['api','bluebird','request-promise','rimraf','../../config/environment','./smsApplication.attributes','define','SmsApplication','sms_applications','utf8mb4_unicode_ci','util','../../config/logger'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0408,0x1ba));var _0x8040=function(_0x5c1b1f,_0x1cc3f1){_0x5c1b1f=_0x5c1b1f-0x0;var _0x2a4efb=_0x0408[_0x5c1b1f];return _0x2a4efb;};'use strict';var _=require('lodash');var util=require(_0x8040('0x0'));var logger=require(_0x8040('0x1'))(_0x8040('0x2'));var moment=require('moment');var BPromise=require(_0x8040('0x3'));var rp=require(_0x8040('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8040('0x5'));var config=require(_0x8040('0x6'));var attributes=require(_0x8040('0x7'));module['exports']=function(_0x5a3148,_0x19b509){return _0x5a3148[_0x8040('0x8')](_0x8040('0x9'),attributes,{'tableName':_0x8040('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x8040('0xb')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 919d77a..9b1520c 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 _0x56b9=['moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','SmsApplication,\x20%s,\x20%s','debug','SmsApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util'];(function(_0x36f47e,_0x1d85cd){var _0x4e6a98=function(_0x2e4935){while(--_0x2e4935){_0x36f47e['push'](_0x36f47e['shift']());}};_0x4e6a98(++_0x1d85cd);}(_0x56b9,0x196));var _0x956b=function(_0x98f6aa,_0x189da0){_0x98f6aa=_0x98f6aa-0x0;var _0x25b7da=_0x56b9[_0x98f6aa];return _0x25b7da;};'use strict';var _=require(_0x956b('0x0'));var util=require(_0x956b('0x1'));var moment=require(_0x956b('0x2'));var BPromise=require(_0x956b('0x3'));var rs=require(_0x956b('0x4'));var fs=require('fs');var Redis=require(_0x956b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x956b('0x6'));var logger=require('../../config/logger')(_0x956b('0x7'));var config=require(_0x956b('0x8'));var jayson=require(_0x956b('0x9'));var client=jayson['client'][_0x956b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3d40b0,_0x322012,_0x2683d8){return new BPromise(function(_0x222eae,_0x299c94){return client[_0x956b('0xb')](_0x3d40b0,_0x2683d8)[_0x956b('0xc')](function(_0x5e0388){logger[_0x956b('0xd')](_0x956b('0xe'),_0x322012,'request\x20sent');logger[_0x956b('0xf')](_0x956b('0x10'),_0x322012,_0x956b('0x11'),JSON[_0x956b('0x12')](_0x5e0388));if(_0x5e0388[_0x956b('0x13')]){if(_0x5e0388['error'][_0x956b('0x14')]===0x1f4){logger[_0x956b('0x13')](_0x956b('0xe'),_0x322012,_0x5e0388[_0x956b('0x13')][_0x956b('0x15')]);return _0x299c94(_0x5e0388[_0x956b('0x13')][_0x956b('0x15')]);}logger[_0x956b('0x13')](_0x956b('0xe'),_0x322012,_0x5e0388[_0x956b('0x13')][_0x956b('0x15')]);return _0x222eae(_0x5e0388['error'][_0x956b('0x15')]);}else{logger[_0x956b('0xd')](_0x956b('0xe'),_0x322012,'request\x20sent');_0x222eae(_0x5e0388[_0x956b('0x16')][_0x956b('0x15')]);}})[_0x956b('0x17')](function(_0x3cc1b7){logger[_0x956b('0x13')](_0x956b('0xe'),_0x322012,_0x3cc1b7);_0x299c94(_0x3cc1b7);});});} \ No newline at end of file +var _0x22b4=['ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x2430b9,_0x5b5a3f){var _0x28f133=function(_0x58cb2a){while(--_0x58cb2a){_0x2430b9['push'](_0x2430b9['shift']());}};_0x28f133(++_0x5b5a3f);}(_0x22b4,0x8b));var _0x422b=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0x22b4[_0x411017];return _0x2adeea;};'use strict';var _=require(_0x422b('0x0'));var util=require(_0x422b('0x1'));var moment=require(_0x422b('0x2'));var BPromise=require(_0x422b('0x3'));var rs=require(_0x422b('0x4'));var fs=require('fs');var Redis=require(_0x422b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x422b('0x6'));var logger=require(_0x422b('0x7'))('rpc');var config=require(_0x422b('0x8'));var jayson=require(_0x422b('0x9'));var client=jayson[_0x422b('0xa')][_0x422b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x115622,_0x170011,_0x48bdd2){return new BPromise(function(_0x5932a3,_0x4e6253){return client[_0x422b('0xc')](_0x115622,_0x48bdd2)[_0x422b('0xd')](function(_0x1c9adc){logger[_0x422b('0xe')](_0x422b('0xf'),_0x170011,_0x422b('0x10'));logger['debug'](_0x422b('0x11'),_0x170011,_0x422b('0x10'),JSON[_0x422b('0x12')](_0x1c9adc));if(_0x1c9adc[_0x422b('0x13')]){if(_0x1c9adc[_0x422b('0x13')][_0x422b('0x14')]===0x1f4){logger[_0x422b('0x13')](_0x422b('0xf'),_0x170011,_0x1c9adc['error']['message']);return _0x4e6253(_0x1c9adc[_0x422b('0x13')][_0x422b('0x15')]);}logger[_0x422b('0x13')](_0x422b('0xf'),_0x170011,_0x1c9adc[_0x422b('0x13')][_0x422b('0x15')]);return _0x5932a3(_0x1c9adc[_0x422b('0x13')][_0x422b('0x15')]);}else{logger['info'](_0x422b('0xf'),_0x170011,'request\x20sent');_0x5932a3(_0x1c9adc[_0x422b('0x16')][_0x422b('0x15')]);}})[_0x422b('0x17')](function(_0x2718e3){logger[_0x422b('0x13')](_0x422b('0xf'),_0x170011,_0x2718e3);_0x4e6253(_0x2718e3);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 8105239..33da1bf 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 _0xed3c=['sms','smsinteraction:addtags','addTags','put','tracked','smsinteraction:update','update','delete','/:id','smsinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./smsInteraction.controller','get','isAuthenticated','index','describe','show','/:id/messages','getMessages','/:id/download','download','create','post','addMessage'];(function(_0x3aac23,_0x4b5a92){var _0x4d0f6a=function(_0x5156a1){while(--_0x5156a1){_0x3aac23['push'](_0x3aac23['shift']());}};_0x4d0f6a(++_0x4b5a92);}(_0xed3c,0x1a6));var _0xced3=function(_0x51ed46,_0x4b7ad2){_0x51ed46=_0x51ed46-0x0;var _0xc2b1e7=_0xed3c[_0x51ed46];return _0xc2b1e7;};'use strict';var multer=require(_0xced3('0x0'));var util=require(_0xced3('0x1'));var path=require(_0xced3('0x2'));var timeout=require(_0xced3('0x3'));var express=require('express');var router=express[_0xced3('0x4')]();var fs_extra=require(_0xced3('0x5'));var auth=require(_0xced3('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xced3('0x7'));router[_0xced3('0x8')]('/',auth[_0xced3('0x9')](),controller[_0xced3('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xced3('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xced3('0xc')]);router[_0xced3('0x8')](_0xced3('0xd'),auth[_0xced3('0x9')](),controller[_0xced3('0xe')]);router['get'](_0xced3('0xf'),auth[_0xced3('0x9')](),controller[_0xced3('0x10')]);router['post']('/',auth[_0xced3('0x9')](),controller[_0xced3('0x11')]);router[_0xced3('0x12')](_0xced3('0xd'),auth[_0xced3('0x9')](),controller[_0xced3('0x13')]);router[_0xced3('0x12')]('/:id/tags',auth[_0xced3('0x9')](),interaction['tracked'](_0xced3('0x14'),_0xced3('0x15')),controller[_0xced3('0x16')]);router[_0xced3('0x17')]('/:id',auth[_0xced3('0x9')](),interaction[_0xced3('0x18')]('sms',_0xced3('0x19')),controller[_0xced3('0x1a')]);router[_0xced3('0x1b')](_0xced3('0x1c'),auth['isAuthenticated'](),interaction[_0xced3('0x18')]('sms',_0xced3('0x1d')),controller[_0xced3('0x1e')]);router[_0xced3('0x1b')](_0xced3('0x1f'),auth[_0xced3('0x9')](),controller[_0xced3('0x20')]);module[_0xced3('0x21')]=router; \ No newline at end of file +var _0x955f=['fs-extra','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','download','post','create','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express'];(function(_0x384f8c,_0x2e9f97){var _0x3591d9=function(_0x1ed982){while(--_0x1ed982){_0x384f8c['push'](_0x384f8c['shift']());}};_0x3591d9(++_0x2e9f97);}(_0x955f,0x1eb));var _0xf955=function(_0x15152d,_0x48da78){_0x15152d=_0x15152d-0x0;var _0x1dc2c3=_0x955f[_0x15152d];return _0x1dc2c3;};'use strict';var multer=require(_0xf955('0x0'));var util=require(_0xf955('0x1'));var path=require(_0xf955('0x2'));var timeout=require(_0xf955('0x3'));var express=require(_0xf955('0x4'));var router=express['Router']();var fs_extra=require(_0xf955('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf955('0x6'));var controller=require('./smsInteraction.controller');router[_0xf955('0x7')]('/',auth[_0xf955('0x8')](),controller[_0xf955('0x9')]);router['get'](_0xf955('0xa'),auth[_0xf955('0x8')](),controller['describe']);router[_0xf955('0x7')](_0xf955('0xb'),auth[_0xf955('0x8')](),controller[_0xf955('0xc')]);router[_0xf955('0x7')](_0xf955('0xd'),auth[_0xf955('0x8')](),controller['getMessages']);router[_0xf955('0x7')]('/:id/download',auth[_0xf955('0x8')](),controller[_0xf955('0xe')]);router[_0xf955('0xf')]('/',auth['isAuthenticated'](),controller[_0xf955('0x10')]);router['post'](_0xf955('0xd'),auth['isAuthenticated'](),controller[_0xf955('0x11')]);router[_0xf955('0xf')](_0xf955('0x12'),auth[_0xf955('0x8')](),interaction[_0xf955('0x13')](_0xf955('0x14'),_0xf955('0x15')),controller[_0xf955('0x16')]);router[_0xf955('0x17')](_0xf955('0xb'),auth['isAuthenticated'](),interaction[_0xf955('0x13')]('sms',_0xf955('0x18')),controller[_0xf955('0x19')]);router[_0xf955('0x1a')](_0xf955('0xb'),auth['isAuthenticated'](),interaction['tracked'](_0xf955('0x14'),_0xf955('0x1b')),controller[_0xf955('0x1c')]);router['delete'](_0xf955('0x12'),auth[_0xf955('0x8')](),controller[_0xf955('0x1d')]);module[_0xf955('0x1e')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 79099be..ae34787 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 _0x933c=['out','sequelize','moment','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x533524,_0x39b2d2){var _0x7be805=function(_0x52a4d0){while(--_0x52a4d0){_0x533524['push'](_0x533524['shift']());}};_0x7be805(++_0x39b2d2);}(_0x933c,0x99));var _0xc933=function(_0x1939b8,_0x2d907c){_0x1939b8=_0x1939b8-0x0;var _0x5a6328=_0x933c[_0x1939b8];return _0x5a6328;};'use strict';var Sequelize=require(_0xc933('0x0'));var moment=require(_0xc933('0x1'));module[_0xc933('0x2')]={'closed':{'type':Sequelize[_0xc933('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xc933('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xc933('0x5')]},'note':{'type':Sequelize[_0xc933('0x5')]},'phone':{'type':Sequelize[_0xc933('0x5')]},'read1stAt':{'type':Sequelize[_0xc933('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xc933('0x6')]('in',_0xc933('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xc933('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xc933('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x1793=['sequelize','moment','exports','BOOLEAN','STRING','out','DATE'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x1793,0x1ce));var _0x3179=function(_0x59a222,_0x4123e8){_0x59a222=_0x59a222-0x0;var _0x10d34b=_0x1793[_0x59a222];return _0x10d34b;};'use strict';var Sequelize=require(_0x3179('0x0'));var moment=require(_0x3179('0x1'));module[_0x3179('0x2')]={'closed':{'type':Sequelize[_0x3179('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x3179('0x4')]},'secondDisposition':{'type':Sequelize[_0x3179('0x4')]},'thirdDisposition':{'type':Sequelize[_0x3179('0x4')]},'note':{'type':Sequelize[_0x3179('0x4')]},'phone':{'type':Sequelize[_0x3179('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x3179('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x3179('0x6')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x3179('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 4bcdc3b..6c0220e 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 _0x426b=['fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','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','redis','defaults','localhost','./smsInteraction.socket','register','end','status','undefined','count','offset','set','apply','reject','then','sendStatus','error','stack','name','send','Users','fullname','Tags','split','forEach','push','catch','waiting','talking','answered','unmanaged','total','closed','UserId','index','map','SmsInteraction','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','length','nolimit','limit','order','filters','select','field','color','tools_tags','u.id','u.fullname','from','user_has_sms_interactions','users','u.id\x20=\x20ui.UserId','sms_interactions','left_join','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression','body','keys','some','compact','isEmpty','where','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.phone\x20LIKE\x20?','group','i.id','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','SmsAccountId','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','ui.SmsInteractionId\x20IN\x20?','groupBy','all','rows','params','includeAll','include','options','create','describe','addMessage','ids','omit','findOne','SmsMessage','hasOwnProperty','sort','pick','SmsInteractionId','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','spread','smsInteractionTags:save','removeTags','unix','join','root','server','files','attachments','format','CmContact','firstName','lastName','secret','Account','Owner','get','Sms','N.A.','closedAt','Messages','out','System','direction','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf'];(function(_0x21d416,_0x2b8d90){var _0x3ced8d=function(_0x30ef8c){while(--_0x30ef8c){_0x21d416['push'](_0x21d416['shift']());}};_0x3ced8d(++_0x2b8d90);}(_0x426b,0x1d8));var _0xb426=function(_0x2e44cf,_0x16f684){_0x2e44cf=_0x2e44cf-0x0;var _0x361268=_0x426b[_0x2e44cf];return _0x361268;};'use strict';var emlformat=require(_0xb426('0x0'));var rimraf=require(_0xb426('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb426('0x2'));var rp=require(_0xb426('0x3'));var moment=require(_0xb426('0x4'));var BPromise=require(_0xb426('0x5'));var Mustache=require(_0xb426('0x6'));var util=require('util');var path=require(_0xb426('0x7'));var sox=require(_0xb426('0x8'));var csv=require('to-csv');var ejs=require(_0xb426('0x9'));var fs=require('fs');var fs_extra=require(_0xb426('0xa'));var _=require(_0xb426('0xb'));var squel=require(_0xb426('0xc'));var crypto=require(_0xb426('0xd'));var jsforce=require(_0xb426('0xe'));var deskjs=require(_0xb426('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb426('0x10'));var Papa=require(_0xb426('0x11'));var Redis=require(_0xb426('0x12'));var authService=require(_0xb426('0x13'));var qs=require(_0xb426('0x14'));var as=require('../../components/parsers/advancedSearch');var pdf=require('../../components/export/pdf');var hardwareService=require(_0xb426('0x15'));var logger=require(_0xb426('0x16'))('api');var utils=require(_0xb426('0x17'));var config=require(_0xb426('0x18'));var licenseUtil=require(_0xb426('0x19'));var db=require(_0xb426('0x1a'))['db'];config[_0xb426('0x1b')]=_[_0xb426('0x1c')](config['redis'],{'host':_0xb426('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb426('0x1b')]));require(_0xb426('0x1e'))[_0xb426('0x1f')](socket);function respondWithStatusCode(_0x1d6084,_0x490b48){_0x490b48=_0x490b48||0xcc;return function(_0x421b07){if(_0x421b07){return _0x1d6084['sendStatus'](_0x490b48);}return _0x1d6084['status'](_0x490b48)[_0xb426('0x20')]();};}function respondWithResult(_0x3f8272,_0x3c7a5a){_0x3c7a5a=_0x3c7a5a||0xc8;return function(_0x197408){if(_0x197408){return _0x3f8272[_0xb426('0x21')](_0x3c7a5a)['json'](_0x197408);}};}function respondWithFilteredResult(_0x1db8ea,_0x5d9c67){return function(_0x36178e){if(_0x36178e){var _0x2f1446=typeof _0x5d9c67['offset']===_0xb426('0x22')&&typeof _0x5d9c67['limit']==='undefined';var _0x203374=_0x36178e[_0xb426('0x23')];var _0xcd284b=_0x2f1446?0x0:_0x5d9c67[_0xb426('0x24')];var _0x791da5=_0x2f1446?_0x36178e[_0xb426('0x23')]:_0x5d9c67[_0xb426('0x24')]+_0x5d9c67['limit'];var _0x4d4ce0;if(_0x791da5>=_0x203374){_0x791da5=_0x203374;_0x4d4ce0=0xc8;}else{_0x4d4ce0=0xce;}_0x1db8ea[_0xb426('0x21')](_0x4d4ce0);return _0x1db8ea[_0xb426('0x25')]('Content-Range',_0xcd284b+'-'+_0x791da5+'/'+_0x203374)['json'](_0x36178e);}return null;};}function patchUpdates(_0x311677){return function(_0x481238){try{jsonpatch[_0xb426('0x26')](_0x481238,_0x311677,!![]);}catch(_0x5825c7){return BPromise[_0xb426('0x27')](_0x5825c7);}return _0x481238['save']();};}function saveUpdates(_0xaa5951,_0x4f70fa){return function(_0x412e47){if(_0x412e47){return _0x412e47['update'](_0xaa5951)['then'](function(_0x1f1482){return _0x1f1482;});}return null;};}function removeEntity(_0x5b6765,_0x58c001){return function(_0x35337e){if(_0x35337e){return _0x35337e['destroy']()[_0xb426('0x28')](function(){_0x5b6765['status'](0xcc)[_0xb426('0x20')]();});}};}function handleEntityNotFound(_0x3990d3,_0x5ef66a){return function(_0x3416f7){if(!_0x3416f7){_0x3990d3[_0xb426('0x29')](0x194);}return _0x3416f7;};}function handleError(_0x3ad23b,_0x489dda){_0x489dda=_0x489dda||0x1f4;return function(_0x59887a){logger[_0xb426('0x2a')](_0x59887a[_0xb426('0x2b')]);if(_0x59887a[_0xb426('0x2c')]){delete _0x59887a[_0xb426('0x2c')];}_0x3ad23b['status'](_0x489dda)[_0xb426('0x2d')](_0x59887a);};}function getInteractionUsers(_0x4c1f66,_0x309a5a){return new BPromise(function(_0x44ca97,_0x47bc8b){try{if(_0x309a5a[_0x4c1f66['id']]){_0x4c1f66[_0xb426('0x2e')]=_['map'](_0x309a5a[_0x4c1f66['id']],function(_0x4c1d8a){return{'id':_0x4c1d8a['id'],'fullname':_0x4c1d8a[_0xb426('0x2f')]};});}}catch(_0x4cea54){_0x47bc8b(_0x4cea54);}_0x44ca97(_0x4c1f66);});}function getInteractionTags(_0x2b306a,_0xb1b7f9){return new BPromise(function(_0x4ea447,_0x5a482c){try{if(_0x2b306a['TagIds']){_0x2b306a[_0xb426('0x30')]=[];_0x2b306a['TagIds'][_0xb426('0x31')](',')[_0xb426('0x32')](function(_0x95012c){_0x2b306a['Tags'][_0xb426('0x33')](_0xb1b7f9[_0x95012c]);});}delete _0x2b306a['TagIds'];}catch(_0x53ecc2){_0x5a482c(_0x53ecc2);}_0x4ea447(_0x2b306a);});}function updateSmsInteraction(_0x5c58ab,_0x20d937,_0x590791){return new BPromise(function(_0x30e089,_0x21eac3){return getInteractionUsers(_0x5c58ab,_0x590791)[_0xb426('0x28')](function(_0x54d9a2){return getInteractionTags(_0x54d9a2,_0x20d937);})[_0xb426('0x28')](function(_0x11edbb){return getStateInteraction(_0x11edbb);})[_0xb426('0x28')](function(_0x2388e7){_0x30e089(_0x2388e7);})[_0xb426('0x34')](function(_0xa0d4b9){_0x21eac3(_0xa0d4b9);});});}function getStateInteraction(_0x8c361d){return new BPromise(function(_0x2079f9){_0x8c361d[_0xb426('0x35')]=0x0;_0x8c361d[_0xb426('0x36')]=0x0;_0x8c361d[_0xb426('0x37')]=0x0;_0x8c361d[_0xb426('0x38')]=0x0;_0x8c361d[_0xb426('0x39')]=0x0;if(!_0x8c361d[_0xb426('0x3a')]&&!_0x8c361d[_0xb426('0x3b')]){_0x8c361d[_0xb426('0x35')]+=0x1;}if(!_0x8c361d[_0xb426('0x3a')]&&_0x8c361d[_0xb426('0x3b')]){_0x8c361d[_0xb426('0x36')]+=0x1;if(_0x8c361d['waiting']){_0x8c361d[_0xb426('0x35')]-=0x1;}}if(_0x8c361d[_0xb426('0x3a')]&&_0x8c361d[_0xb426('0x3b')]){_0x8c361d[_0xb426('0x37')]+=0x1;if(_0x8c361d[_0xb426('0x36')]){_0x8c361d[_0xb426('0x36')]-=0x1;}}if(_0x8c361d[_0xb426('0x3a')]&&!_0x8c361d[_0xb426('0x3b')]){_0x8c361d[_0xb426('0x38')]+=0x1;if(_0x8c361d['waiting']){_0x8c361d[_0xb426('0x35')]-=0x1;}}_0x8c361d[_0xb426('0x39')]+=0x1;_0x2079f9(_0x8c361d);});}exports[_0xb426('0x3c')]=function(_0x709847,_0x483087){var _0x5e2dcb={},_0x365a08={},_0x3037f8={'count':0x0,'rows':[]};var _0x372eee=_[_0xb426('0x3d')](db[_0xb426('0x3e')][_0xb426('0x3f')],function(_0x5d6088){return{'name':_0x5d6088[_0xb426('0x40')],'type':_0x5d6088[_0xb426('0x41')][_0xb426('0x42')]};});_0x365a08[_0xb426('0x43')]=_['map'](_0x372eee,_0xb426('0x2c'));_0x365a08[_0xb426('0x44')]=_['keys'](_0x709847[_0xb426('0x44')]);_0x365a08['filters']=_['intersection'](_0x365a08[_0xb426('0x43')],_0x365a08[_0xb426('0x44')]);_0x5e2dcb[_0xb426('0x45')]=_[_0xb426('0x46')](_0x365a08[_0xb426('0x43')],qs['fields'](_0x709847[_0xb426('0x44')][_0xb426('0x47')]));_0x5e2dcb[_0xb426('0x45')]=_0x5e2dcb[_0xb426('0x45')][_0xb426('0x48')]?_0x5e2dcb['attributes']:_0x365a08['model'];if(!_0x709847[_0xb426('0x44')]['hasOwnProperty'](_0xb426('0x49'))){_0x5e2dcb[_0xb426('0x4a')]=qs['limit'](_0x709847['query'][_0xb426('0x4a')]);_0x5e2dcb[_0xb426('0x24')]=qs[_0xb426('0x24')](_0x709847[_0xb426('0x44')][_0xb426('0x24')]);}_0x5e2dcb[_0xb426('0x4b')]=qs['sort'](_0x709847['query']['sort']);_0x5e2dcb['where']=qs['filters'](_['pick'](_0x709847[_0xb426('0x44')],_0x365a08[_0xb426('0x4c')]),_0x372eee);var _0x380ac5=[];var _0x44cfdd=squel[_0xb426('0x4d')]()[_0xb426('0x4e')]('id')[_0xb426('0x4e')](_0xb426('0x2c'))[_0xb426('0x4e')](_0xb426('0x4f'))['from'](_0xb426('0x50'));var _0x29c00e=squel[_0xb426('0x4d')]()[_0xb426('0x4e')](_0xb426('0x51'))[_0xb426('0x4e')](_0xb426('0x52'))[_0xb426('0x4e')]('ui.SmsInteractionId')[_0xb426('0x53')](_0xb426('0x54'),'ui')['left_join'](_0xb426('0x55'),'u',_0xb426('0x56'));var _0x35e9ea=squel['select']()[_0xb426('0x53')](_0xb426('0x57'),'i')[_0xb426('0x58')]('cm_contacts','c',_0xb426('0x59'))[_0xb426('0x58')](_0xb426('0x55'),'o',_0xb426('0x5a'))['left_join'](_0xb426('0x5b'),'a',_0xb426('0x5c'))['left_join']('sms_messages','me',_0xb426('0x5d'))[_0xb426('0x58')](_0xb426('0x5e'),'it',_0xb426('0x5f'))['left_join'](_0xb426('0x50'),'t',_0xb426('0x60'));var _0x1d210d=squel[_0xb426('0x61')]();var _0x943ba4=[];var _0x56dfed=squel[_0xb426('0x61')]();var _0xbc7d84;if(_0x709847[_0xb426('0x44')]['search']){_0xbc7d84=as['parseSearch'](_0x709847['query'][_0xb426('0x62')]);var _0x1edd73=_0xbc7d84[_0xb426('0x63')];for(var _0x219932=0x0;_0x219932<_0xbc7d84['conditions']['length'];_0x219932++){var _0x46671a=_0xbc7d84[_0xb426('0x64')][_0x219932];var _0xe28042='i';var _0x38979d=_[_0xb426('0x65')](_0x372eee,[_0xb426('0x2c'),_0x46671a[_0xb426('0x4e')]]);if(!_0x38979d){switch(_0x46671a[_0xb426('0x4e')]){case _0xb426('0x66'):if(_0x46671a[_0xb426('0x67')]==0x1){_0x35e9ea[_0xb426('0x68')]('`'+_0x46671a[_0xb426('0x4e')]+_0xb426('0x69'));}else{_0x35e9ea[_0xb426('0x68')]('`'+_0x46671a[_0xb426('0x4e')]+'`\x20>\x200');}break;case _0xb426('0x6a'):if(_0x46671a[_0xb426('0x6b')]===_0xb426('0x6c')){if(_0x46671a['value'][_0xb426('0x31')]('\x20')[_0xb426('0x48')]>0x1){_0x1d210d[_0x1edd73](_0xb426('0x6d'),qs[_0xb426('0x6e')](_0x46671a[_0xb426('0x67')]),null);}else{var _0x2f3675='%'+_0x46671a['value']+'%';_0x1d210d[_0x1edd73](_0xb426('0x6f'),_0x2f3675,_0x2f3675,_0x2f3675);}}else{_0x38979d=_[_0xb426('0x65')](_0x372eee,[_0xb426('0x2c'),_0xb426('0x70')]);_0x46671a['field']=_0xb426('0x70');_0x3d19af=as['buildExpression'](_0xe28042,_0x38979d[_0xb426('0x41')],_0x46671a);_0x1d210d[_0x1edd73](_0x3d19af[_0xb426('0x71')],_0x3d19af[_0xb426('0x67')][_0xb426('0x72')],_0x3d19af[_0xb426('0x67')][_0xb426('0x20')]);}break;case'Tag':var _0x135994=_0x46671a['value'][_0xb426('0x31')](',')['map'](function(_0x194a5b){return Number(_0x194a5b);});_0x135994[_0xb426('0x32')](function(_0x57d555){_0x56dfed['or'](_0xb426('0x73'),'%,'+_0x57d555+',%');});_0x943ba4=_[_0xb426('0x74')](_0x943ba4,_0x135994);break;case _0xb426('0x75'):if(_0x46671a['operator']===_0xb426('0x6c')){_0x1d210d[_0x1edd73](_0xb426('0x76'),'%'+_0x46671a[_0xb426('0x67')]+'%',null);}else{_0x38979d=_['find'](_0x372eee,[_0xb426('0x2c'),_0xb426('0x3b')]);_0x46671a[_0xb426('0x4e')]=_0xb426('0x3b');_0x3d19af=as[_0xb426('0x77')](_0xe28042,_0x38979d[_0xb426('0x41')],_0x46671a);_0x1d210d[_0x1edd73](_0x3d19af[_0xb426('0x71')],_0x3d19af['value'][_0xb426('0x72')],_0x3d19af[_0xb426('0x67')][_0xb426('0x20')]);}break;case _0xb426('0x78'):_0x3d19af=as[_0xb426('0x77')]('me',null,_0x46671a);_0x1d210d[_0x1edd73](_0x3d19af[_0xb426('0x71')],_0x3d19af[_0xb426('0x67')][_0xb426('0x72')],_0x3d19af[_0xb426('0x67')][_0xb426('0x20')]);break;}}else{var _0x3d19af=as[_0xb426('0x77')](_0xe28042,_0x38979d['type'],_0x46671a);_0x1d210d[_0x1edd73](_0x3d19af['text'],_0x3d19af[_0xb426('0x67')][_0xb426('0x72')],_0x3d19af[_0xb426('0x67')][_0xb426('0x20')]);}}}else{var _0x27a15e=_(_0x709847[_0xb426('0x44')])[_0xb426('0x79')]()['map'](function(_0x1ea703){return _[_0xb426('0x7a')](_0x372eee,[_0xb426('0x2c'),_0x1ea703])?_0x1ea703:undefined;})[_0xb426('0x7b')]()[_0xb426('0x67')]();if(!_[_0xb426('0x7c')](_0x27a15e)){_0x27a15e[_0xb426('0x32')](function(_0xc1ffdb){if(_0xc1ffdb==='SmsAccountId'){_0x35e9ea[_0xb426('0x7d')](_0xb426('0x7e'),[][_0xb426('0x7f')](_0x709847[_0xb426('0x44')][_0xc1ffdb]));}else if(_0xc1ffdb===_0xb426('0x80')){var _0x41da6d=JSON[_0xb426('0x81')](_0x709847[_0xb426('0x44')][_0xc1ffdb])[_0xb426('0x82')];var _0xa5da86=JSON[_0xb426('0x81')](_0x709847[_0xb426('0x44')][_0xc1ffdb])[_0xb426('0x83')];_0x35e9ea['where'](_0xb426('0x84'),_0x41da6d,_0xa5da86);}else{if(_0x709847['query'][_0xc1ffdb]===_0xb426('0x85')){_0x35e9ea['where']('i.'+_0xc1ffdb+_0xb426('0x86'));}else{_0x35e9ea['where']('i.'+_0xc1ffdb+_0xb426('0x87'),_0x709847[_0xb426('0x44')][_0xc1ffdb]);}}});}if(_0x709847['query'][_0xb426('0x88')]){if(_0x709847[_0xb426('0x44')][_0xb426('0x88')]==0x1){_0x35e9ea[_0xb426('0x68')](_0xb426('0x89'));}else{_0x35e9ea['having'](_0xb426('0x8a'));}}if(_0x709847[_0xb426('0x44')][_0xb426('0x8b')]){_0x943ba4=_[_0xb426('0x8c')](_0x709847['query']['tag'])?_0x709847['query'][_0xb426('0x8b')]:new Array(_0x709847[_0xb426('0x44')][_0xb426('0x8b')]);_0x943ba4[_0xb426('0x32')](function(_0x14c04e){_0x56dfed['or'](_0xb426('0x73'),'%,'+_0x14c04e+',%');});}if(_0x709847[_0xb426('0x44')]['filter']){var _0x5a37b3=_0x709847[_0xb426('0x44')][_0xb426('0x8d')][_0xb426('0x8e')]('\x5c','\x5c\x5c')[_0xb426('0x8e')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x5a37b3)){_0x1d210d['or']('i.id\x20LIKE\x20?',_0x5a37b3+'%')['or'](_0xb426('0x8f'),_0x5a37b3+'%');}else{_0x1d210d['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x5a37b3))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x5a37b3+'%');}}}_0x35e9ea[_0xb426('0x7d')](_0x1d210d);_0x35e9ea[_0xb426('0x90')](_0xb426('0x91'));var _0x14de59={'type':db['Sequelize'][_0xb426('0x92')]['SELECT'],'raw':!![]};var _0x285e6e=_0x35e9ea[_0xb426('0x93')]();_0x285e6e['field'](_0xb426('0x91'));_0x285e6e['field'](_0xb426('0x94'),_0xb426('0x66'));if(_0x5e2dcb[_0xb426('0x4b')]){_0x5e2dcb[_0xb426('0x4b')][_0xb426('0x32')](function(_0x58e5af){var _0x5ee25b=_0x58e5af[0x0]===_0xb426('0x95')?_0x58e5af[0x0]:'i.'+_0x58e5af[0x0];_0x35e9ea[_0xb426('0x4b')](_0x5ee25b,_0x58e5af[0x1]===_0xb426('0x96')?![]:!![]);});}if(!_[_0xb426('0x7c')](_0x943ba4)){_0x35e9ea[_0xb426('0x68')](_0x56dfed);_0x285e6e[_0xb426('0x7d')](_0xb426('0x97'),_0x943ba4);}BPromise[_0xb426('0x98')]()[_0xb426('0x28')](function(){if(!_0xbc7d84){if(_0x709847[_0xb426('0x44')][_0xb426('0x99')])return;_0x285e6e[_0xb426('0x7d')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');_0x35e9ea['where'](_0xb426('0x9a'));return;}if(_0x709847[_0xb426('0x9b')]['role']!==_0xb426('0x9c'))return;return _0x709847['user'][_0xb426('0x9d')]({'attributes':['id'],'raw':!![]})[_0xb426('0x28')](function(_0x37184c){if(_[_0xb426('0x7c')](_0x37184c)){_0x285e6e[_0xb426('0x7d')](_0xb426('0x9e'));_0x35e9ea[_0xb426('0x7d')](_0xb426('0x9e'));}else{_0x285e6e[_0xb426('0x7d')](_0xb426('0x7e'),_[_0xb426('0x3d')](_0x37184c,'id'));_0x35e9ea[_0xb426('0x7d')](_0xb426('0x7e'),_[_0xb426('0x3d')](_0x37184c,'id'));}});})[_0xb426('0x28')](function(){if(_0x709847[_0xb426('0x9b')]['role']===_0xb426('0x9c')&&!_0xbc7d84&&!_0x709847[_0xb426('0x44')][_0xb426('0x99')])return[];return db[_0xb426('0x9f')][_0xb426('0x44')](_0x285e6e[_0xb426('0xa0')](),_0x14de59);})[_0xb426('0x28')](function(_0x23c151){_0x3037f8[_0xb426('0x23')]=_0x23c151[_0xb426('0x48')];if(_0x3037f8[_0xb426('0x23')]===0x0)return[];return db[_0xb426('0x9f')]['query'](_0x44cfdd[_0xb426('0xa0')](),_0x14de59)['then'](function(_0x39d4cd){_0x380ac5=_[_0xb426('0xa1')](_0x39d4cd,'id');_0x14de59=_[_0xb426('0xa2')](_0x14de59,{'model':db[_0xb426('0x3e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x709847[_0xb426('0x44')][_0xb426('0x47')]){_0x5e2dcb[_0xb426('0x45')][_0xb426('0x32')](function(_0x4979fe){_0x35e9ea[_0xb426('0x4e')]('i.'+_0x4979fe);});}else{_0x35e9ea[_0xb426('0x4e')](_0xb426('0x94'),_0xb426('0x66'));_0x35e9ea[_0xb426('0x4e')](_0xb426('0xa3'),'Account.key');_0x35e9ea[_0xb426('0x4e')](_0xb426('0xa4'),_0xb426('0xa5'));_0x35e9ea[_0xb426('0x4e')](_0xb426('0xa6'),_0xb426('0x95'));_0x35e9ea[_0xb426('0x4e')](_0xb426('0xa7'));_0x35e9ea[_0xb426('0x4e')](_0xb426('0xa8'),'Contact.firstName');_0x35e9ea[_0xb426('0x4e')](_0xb426('0xa9'),_0xb426('0xaa'));_0x35e9ea[_0xb426('0x4e')](_0xb426('0xab'),'Contact.email');_0x35e9ea[_0xb426('0x4e')](_0xb426('0xac'),_0xb426('0xad'));_0x35e9ea[_0xb426('0x4e')](_0xb426('0xae'),_0xb426('0xaf'));_0x35e9ea[_0xb426('0x4e')](_0xb426('0xb0'),_0xb426('0xb1'));_0x35e9ea[_0xb426('0x4e')](_0xb426('0xb2'),'Owner.fullname');_0x35e9ea['field'](_0xb426('0xb3'),'Owner.internal');_0x35e9ea['field'](_0xb426('0xb4'),_0xb426('0xb5'));}if(_0x5e2dcb[_0xb426('0x4a')])_0x35e9ea[_0xb426('0x4a')](_0x5e2dcb[_0xb426('0x4a')]);if(_0x5e2dcb[_0xb426('0x24')])_0x35e9ea[_0xb426('0x24')](_0x5e2dcb['offset']);return db[_0xb426('0x9f')][_0xb426('0x44')](_0x35e9ea[_0xb426('0xa0')](),_0x14de59);})[_0xb426('0x28')](function(_0x30bfa0){if(_0x30bfa0[_0xb426('0x48')]>0x0)_0x29c00e[_0xb426('0x7d')](_0xb426('0xb6'),_[_0xb426('0x3d')](_0x30bfa0,'id'));return db[_0xb426('0x9f')]['query'](_0x29c00e[_0xb426('0xa0')](),_0x14de59)[_0xb426('0x28')](function(_0x12c53b){var _0x3b4aef=_[_0xb426('0xb7')](_0x12c53b,'SmsInteractionId');var _0x194e45=[];_0x30bfa0[_0xb426('0x32')](function(_0x40c353){_0x194e45[_0xb426('0x33')](updateSmsInteraction(_0x40c353,_0x380ac5,_0x3b4aef));});return BPromise[_0xb426('0xb8')](_0x194e45);});});})[_0xb426('0x28')](function(_0x314e06){_0x3037f8[_0xb426('0xb9')]=_0x314e06;return _0x3037f8;})[_0xb426('0x28')](respondWithFilteredResult(_0x483087,_0x5e2dcb))['catch'](handleError(_0x483087,null));};exports['show']=function(_0x314641,_0x2edf26){var _0x4d10c1={'raw':![],'where':{'id':_0x314641[_0xb426('0xba')]['id']}},_0x1c0521={};_0x1c0521[_0xb426('0x43')]=_[_0xb426('0x79')](db[_0xb426('0x3e')][_0xb426('0x3f')]);_0x1c0521[_0xb426('0x44')]=_['keys'](_0x314641[_0xb426('0x44')]);_0x1c0521['filters']=_['intersection'](_0x1c0521[_0xb426('0x43')],_0x1c0521[_0xb426('0x44')]);_0x4d10c1[_0xb426('0x45')]=_[_0xb426('0x46')](_0x1c0521[_0xb426('0x43')],qs[_0xb426('0x47')](_0x314641['query'][_0xb426('0x47')]));_0x4d10c1[_0xb426('0x45')]=_0x4d10c1[_0xb426('0x45')][_0xb426('0x48')]?_0x4d10c1['attributes']:_0x1c0521['model'];if(_0x314641['query'][_0xb426('0xbb')]){_0x4d10c1[_0xb426('0xbc')]=[{'all':!![]}];}_0x4d10c1=_['merge']({},_0x4d10c1,_0x314641[_0xb426('0xbd')]);return db[_0xb426('0x3e')][_0xb426('0x65')](_0x4d10c1)[_0xb426('0x28')](handleEntityNotFound(_0x2edf26,null))[_0xb426('0x28')](respondWithResult(_0x2edf26,null))[_0xb426('0x34')](handleError(_0x2edf26,null));};exports[_0xb426('0xbe')]=function(_0x283b0d,_0x291bdc){return db['SmsInteraction'][_0xb426('0xbe')](_0x283b0d['body'],{})[_0xb426('0x28')](respondWithResult(_0x291bdc,0xc9))[_0xb426('0x34')](handleError(_0x291bdc,null));};exports['update']=function(_0x22db86,_0x5db1af){if(_0x22db86['body']['id']){delete _0x22db86[_0xb426('0x78')]['id'];}return db[_0xb426('0x3e')]['find']({'where':{'id':_0x22db86[_0xb426('0xba')]['id']}})[_0xb426('0x28')](handleEntityNotFound(_0x5db1af,null))['then'](saveUpdates(_0x22db86[_0xb426('0x78')],null))[_0xb426('0x28')](respondWithResult(_0x5db1af,null))['catch'](handleError(_0x5db1af,null));};exports['destroy']=function(_0x47a8da,_0x4a3003){return db[_0xb426('0x3e')][_0xb426('0x65')]({'where':{'id':_0x47a8da[_0xb426('0xba')]['id']}})['then'](handleEntityNotFound(_0x4a3003,null))[_0xb426('0x28')](removeEntity(_0x4a3003,null))[_0xb426('0x34')](handleError(_0x4a3003,null));};exports[_0xb426('0xbf')]=function(_0x2e6bea,_0x11f81d){return db[_0xb426('0x3e')][_0xb426('0xbf')]()[_0xb426('0x28')](respondWithResult(_0x11f81d,null))['catch'](handleError(_0x11f81d,null));};exports[_0xb426('0xc0')]=function(_0x275587,_0x43aeeb,_0x1ba749){return db['SmsMessage']['find']({'where':{'id':_0x275587[_0xb426('0xba')]['id']}})['then'](handleEntityNotFound(_0x43aeeb,null))[_0xb426('0x28')](function(_0x133295){if(_0x133295){return _0x133295['addMessage'](_0x275587['body'][_0xb426('0xc1')],_[_0xb426('0xc2')](_0x275587['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x43aeeb,null))[_0xb426('0x34')](handleError(_0x43aeeb,null));};exports['getMessages']=function(_0x40f2ba,_0x2dcc6b,_0x594d5b){var _0x55db84={'raw':![],'where':{}};var _0x33f9fe={};var _0x13a5f7={'count':0x0,'rows':[]};return db['SmsInteraction'][_0xb426('0xc3')]({'where':{'id':_0x40f2ba['params']['id']}})[_0xb426('0x28')](handleEntityNotFound(_0x2dcc6b,null))[_0xb426('0x28')](function(_0x668b6b){if(_0x668b6b){_0x33f9fe[_0xb426('0x43')]=_[_0xb426('0x79')](db[_0xb426('0xc4')][_0xb426('0x3f')]);_0x33f9fe[_0xb426('0x44')]=_[_0xb426('0x79')](_0x40f2ba[_0xb426('0x44')]);_0x33f9fe[_0xb426('0x4c')]=_[_0xb426('0x46')](_0x33f9fe[_0xb426('0x43')],_0x33f9fe[_0xb426('0x44')]);_0x55db84['attributes']=_['intersection'](_0x33f9fe[_0xb426('0x43')],qs[_0xb426('0x47')](_0x40f2ba[_0xb426('0x44')]['fields']));_0x55db84[_0xb426('0x45')]=_0x55db84['attributes']['length']?_0x55db84[_0xb426('0x45')]:_0x33f9fe['model'];if(!_0x40f2ba[_0xb426('0x44')][_0xb426('0xc5')](_0xb426('0x49'))){_0x55db84[_0xb426('0x4a')]=qs['limit'](_0x40f2ba[_0xb426('0x44')]['limit']);_0x55db84[_0xb426('0x24')]=qs[_0xb426('0x24')](_0x40f2ba[_0xb426('0x44')][_0xb426('0x24')]);}_0x55db84[_0xb426('0x4b')]=qs[_0xb426('0xc6')](_0x40f2ba[_0xb426('0x44')][_0xb426('0xc6')]);_0x55db84[_0xb426('0x7d')]=qs[_0xb426('0x4c')](_[_0xb426('0xc7')](_0x40f2ba[_0xb426('0x44')],_0x33f9fe[_0xb426('0x4c')]));_0x55db84[_0xb426('0x7d')][_0xb426('0xc8')]=_0x668b6b['id'];if(_0x40f2ba[_0xb426('0x44')][_0xb426('0x8d')]){_0x55db84[_0xb426('0x7d')]=_[_0xb426('0xa2')](_0x55db84[_0xb426('0x7d')],{'$or':_[_0xb426('0x3d')](_0x55db84[_0xb426('0x45')],function(_0x3acbe8){var _0x43248b={};_0x43248b[_0x3acbe8]={'$like':'%'+_0x40f2ba['query'][_0xb426('0x8d')]+'%'};return _0x43248b;})});}if(_0x40f2ba[_0xb426('0x44')]['$gte']){var _0x44e4b0=_0x40f2ba[_0xb426('0x44')][_0xb426('0x82')][_0xb426('0x31')](',');var _0x5ed82a={};_0x5ed82a[_0x44e4b0[0x0]]={'$gte':moment(_0x44e4b0[0x1])['format'](_0xb426('0xc9'))};_0x55db84[_0xb426('0x7d')]=_[_0xb426('0xa2')](_0x55db84[_0xb426('0x7d')],_0x5ed82a);}_0x55db84=_[_0xb426('0xa2')]({},_0x55db84,_0x40f2ba['options']);return db[_0xb426('0xc4')][_0xb426('0x23')]({'where':_0x55db84[_0xb426('0x7d')]})[_0xb426('0x28')](function(_0x3d1f23){_0x13a5f7['count']=_0x3d1f23;if(_0x40f2ba['query'][_0xb426('0xbb')]){_0x55db84[_0xb426('0xbc')]=[{'all':!![]}];}return db['SmsMessage'][_0xb426('0xca')](_0x55db84);})[_0xb426('0x28')](function(_0x310737){_0x13a5f7[_0xb426('0xb9')]=_0x310737;return _0x13a5f7;});}})[_0xb426('0x28')](respondWithFilteredResult(_0x2dcc6b,_0x55db84))['catch'](handleError(_0x2dcc6b,null));};exports[_0xb426('0xcb')]=function(_0xddf7f9,_0x62eda3,_0x3d779b){return db[_0xb426('0x3e')][_0xb426('0x65')]({'where':{'id':_0xddf7f9[_0xb426('0xba')]['id']}})['then'](handleEntityNotFound(_0x62eda3,null))[_0xb426('0x28')](function(_0x55b2d5){if(_0x55b2d5){return _0x55b2d5['setTags'](_0xddf7f9[_0xb426('0x78')][_0xb426('0xc1')],_[_0xb426('0xc2')](_0xddf7f9[_0xb426('0x78')],[_0xb426('0xc1'),'id'])||{})[_0xb426('0xcc')](function(){return db['Tag'][_0xb426('0xca')]({'attributes':['id','name',_0xb426('0x4f')],'where':{'id':_0xddf7f9[_0xb426('0x78')]['ids']}});})[_0xb426('0x28')](function(_0x4e7990){socket['emit'](_0xb426('0xcd'),{'id':Number(_0xddf7f9[_0xb426('0xba')]['id']),'tags':_0x4e7990||[]});return{'id':Number(_0xddf7f9[_0xb426('0xba')]['id']),'tags':_0x4e7990||[]};});}})[_0xb426('0x28')](respondWithResult(_0x62eda3,null))['catch'](handleError(_0x62eda3,null));};exports['removeTags']=function(_0x239170,_0x139600,_0x478a34){return db[_0xb426('0x3e')][_0xb426('0x65')]({'where':{'id':_0x239170[_0xb426('0xba')]['id']}})['then'](handleEntityNotFound(_0x139600,null))[_0xb426('0x28')](function(_0x4c95f3){if(_0x4c95f3){return _0x4c95f3[_0xb426('0xce')](_0x239170[_0xb426('0x44')][_0xb426('0xc1')]);}})[_0xb426('0x28')](respondWithStatusCode(_0x139600,null))[_0xb426('0x34')](handleError(_0x139600,null));};exports['download']=function(_0x1554ac,_0x2eb759){var _0x45cab1=moment()[_0xb426('0xcf')]()['toString']();var _0x688da1=path[_0xb426('0xd0')](config[_0xb426('0xd1')],_0xb426('0xd2'),_0xb426('0xd3'),'tmp');var _0x5bc392=path[_0xb426('0xd0')](config['root'],_0xb426('0xd2'),_0xb426('0xd3'),_0xb426('0xd4'));var _0x379bbf=path[_0xb426('0xd0')](_0x688da1,_0x45cab1);var _0x1dff7a=util[_0xb426('0xd5')]('transcript-%d-%s.zip',_0x1554ac[_0xb426('0xba')]['id'],_0x45cab1);var _0x1955c9=path['join'](_0x688da1,_0x1dff7a);var _0x4486d8=[];_0x4486d8[_0xb426('0x33')]({'model':db[_0xb426('0x75')],'as':_0xb426('0x75'),'attributes':['id','fullname'],'raw':!![]});_0x4486d8[_0xb426('0x33')]({'model':db[_0xb426('0xd6')],'as':'Contact','attributes':['id',_0xb426('0xd7'),_0xb426('0xd8')],'raw':!![]});var _0x1bbb54=[{'model':db['SmsMessage'],'as':'Messages','attributes':['id','body','createdAt','direction',_0xb426('0xd9'),'read'],'include':_0x4486d8}];_0x1bbb54[_0xb426('0x33')]({'model':db['SmsAccount'],'as':_0xb426('0xda'),'attributes':['id',_0xb426('0x2c')]});_0x1bbb54[_0xb426('0x33')]({'model':db['User'],'as':_0xb426('0xdb'),'attributes':['id',_0xb426('0x2f')]});return db[_0xb426('0x3e')]['find']({'where':{'id':_0x1554ac[_0xb426('0xba')]['id']},'include':_0x1bbb54})[_0xb426('0x28')](handleEntityNotFound(_0x2eb759,null))['then'](function(_0x168b75){if(_0x168b75){var _0x51a45a=_0x168b75[_0xb426('0xdc')]({'plain':!![]});fs['mkdirSync'](_0x379bbf);var _0x1d27c9={'channel':_0xb426('0xdd'),'account':_0x51a45a[_0xb426('0xda')][_0xb426('0x2c')],'agent':_0x51a45a['Owner']?_0x51a45a[_0xb426('0xdb')]['fullname']:_0xb426('0xde'),'createdAt':moment(_0x51a45a[_0xb426('0x80')])[_0xb426('0xd5')](_0xb426('0xc9'))[_0xb426('0xa0')](),'closedAt':_0x51a45a[_0xb426('0x3a')]?moment(_0x51a45a[_0xb426('0xdf')])[_0xb426('0xd5')](_0xb426('0xc9'))[_0xb426('0xa0')]():'','disposition':_0x51a45a['disposition'],'messages':_(_0x51a45a[_0xb426('0xe0')])[_0xb426('0x8d')]({'secret':![]})[_0xb426('0x3d')](function(_0x5b1582){return{'date':moment(_0x5b1582['createdAt'])[_0xb426('0xd5')]('YYYY-MM-DD\x20HH:mm:ss')[_0xb426('0xa0')](),'sender':_0x5b1582['direction']===_0xb426('0xe1')?_0x5b1582['User']?_0x5b1582['User'][_0xb426('0x2f')]:_0xb426('0xe2'):_0x5b1582[_0xb426('0x6a')][_0xb426('0xd7')]+(_0x5b1582[_0xb426('0x6a')][_0xb426('0xd8')]?'\x20'+_0x5b1582[_0xb426('0x6a')]['lastName']:''),'body':_0x5b1582[_0xb426('0x78')],'direction':_0x5b1582[_0xb426('0xe3')]===_0xb426('0xe1')?'A':'C','secret':_0x5b1582[_0xb426('0xd9')],'read':_0x5b1582[_0xb426('0x88')]};})[_0xb426('0x67')]()};return ejs[_0xb426('0xe4')](path[_0xb426('0xd0')](config[_0xb426('0xd1')],_0xb426('0xd2'),_0xb426('0xe5'),_0xb426('0xe6')),{'interaction':_0x1d27c9})[_0xb426('0x28')](function(_0x16399d){var _0x2f1c26=path['join'](_0x379bbf,_0xb426('0xe7')+_0x51a45a['id']+'-'+_0x45cab1+_0xb426('0xe8'));var _0x232a14={'path':_0x2f1c26,'channel':_0xb426('0xdd'),'interactionId':_0x51a45a['id']};return pdf[_0xb426('0xe9')](_0x16399d,_0x232a14);})[_0xb426('0x28')](function(){return new BPromise(function(_0x1f9867,_0xae4a6e){zipdir(_0x379bbf,{'saveTo':_0x1955c9},function(_0x474202,_0x53279a){if(_0x474202)return _0xae4a6e(_0x474202);return _0x1f9867(_0x53279a);});})['then'](function(){return new BPromise(function(_0x52cd5d,_0x43844b){rimraf(_0x379bbf,function(_0x40f9fb){if(_0x40f9fb)_0x43844b(_0x40f9fb);return _0x52cd5d();});});})['then'](function(){return _0x2eb759['download'](_0x1955c9,_0x1dff7a,function(_0x57c2ee){if(_0x57c2ee){console[_0xb426('0xea')](_0xb426('0xeb'),_0x57c2ee);}else{fs[_0xb426('0xec')](_0x1955c9);}});});});}else{return _0x2eb759[_0xb426('0x29')](0xc8);}})[_0xb426('0x34')](handleError(_0x2eb759,null));}; \ No newline at end of file +var _0xeb40=['from','tools_tags','u.id','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','cm_contacts','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','unreadMessages','value','having','Contact','$substring','ContactId','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','operator','body','buildExpression','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','parse','$gte','$lte','where','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','isNumeric','i.phone\x20LIKE\x20?','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','t.id\x20IN\x20?','user','role','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','toString','sequelize','keyBy','merge','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','c.lastName','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','SmsInteractionId','all','rows','show','params','include','describe','addMessage','SmsMessage','omit','ids','getMessages','findOne','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','addTags','setTags','emit','smsInteractionTags:save','removeTags','download','unix','root','join','attachments','format','transcript-%d-%s.zip','User','CmContact','firstName','lastName','createdAt','direction','secret','SmsAccount','get','Sms','Account','Owner','N.A.','closedAt','disposition','Messages','out','System','renderFile','server','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','redis','register','sendStatus','status','end','json','undefined','limit','offset','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','Users','fullname','TagIds','Tags','split','forEach','push','catch','talking','answered','unmanaged','total','UserId','waiting','closed','map','SmsInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','select','field','color'];(function(_0x5df9f1,_0x504715){var _0xbf8d46=function(_0x4015e4){while(--_0x4015e4){_0x5df9f1['push'](_0x5df9f1['shift']());}};_0xbf8d46(++_0x504715);}(_0xeb40,0x176));var _0x0eb4=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xeb40[_0xc4001c];return _0x49f7bc;};'use strict';var emlformat=require(_0x0eb4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0eb4('0x1'));var jsonpatch=require(_0x0eb4('0x2'));var rp=require(_0x0eb4('0x3'));var moment=require(_0x0eb4('0x4'));var BPromise=require(_0x0eb4('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x0eb4('0x6'));var sox=require(_0x0eb4('0x7'));var csv=require('to-csv');var ejs=require(_0x0eb4('0x8'));var fs=require('fs');var fs_extra=require(_0x0eb4('0x9'));var _=require(_0x0eb4('0xa'));var squel=require('squel');var crypto=require(_0x0eb4('0xb'));var jsforce=require(_0x0eb4('0xc'));var deskjs=require(_0x0eb4('0xd'));var toCsv=require(_0x0eb4('0xe'));var querystring=require(_0x0eb4('0xf'));var Papa=require('papaparse');var Redis=require(_0x0eb4('0x10'));var authService=require(_0x0eb4('0x11'));var qs=require(_0x0eb4('0x12'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x0eb4('0x13'));var hardwareService=require(_0x0eb4('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x0eb4('0x15'));var licenseUtil=require(_0x0eb4('0x16'));var db=require(_0x0eb4('0x17'))['db'];config[_0x0eb4('0x18')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0eb4('0x18')]));require('./smsInteraction.socket')[_0x0eb4('0x19')](socket);function respondWithStatusCode(_0x27b656,_0x15261f){_0x15261f=_0x15261f||0xcc;return function(_0x72bb06){if(_0x72bb06){return _0x27b656[_0x0eb4('0x1a')](_0x15261f);}return _0x27b656[_0x0eb4('0x1b')](_0x15261f)[_0x0eb4('0x1c')]();};}function respondWithResult(_0x3bfdb7,_0xb42e40){_0xb42e40=_0xb42e40||0xc8;return function(_0x5229c1){if(_0x5229c1){return _0x3bfdb7[_0x0eb4('0x1b')](_0xb42e40)[_0x0eb4('0x1d')](_0x5229c1);}};}function respondWithFilteredResult(_0x3b2115,_0xd1c182){return function(_0x3cf4d9){if(_0x3cf4d9){var _0xd737a2=typeof _0xd1c182['offset']===_0x0eb4('0x1e')&&typeof _0xd1c182[_0x0eb4('0x1f')]===_0x0eb4('0x1e');var _0x47ac1f=_0x3cf4d9['count'];var _0x18861e=_0xd737a2?0x0:_0xd1c182[_0x0eb4('0x20')];var _0x50c658=_0xd737a2?_0x3cf4d9[_0x0eb4('0x21')]:_0xd1c182[_0x0eb4('0x20')]+_0xd1c182[_0x0eb4('0x1f')];var _0x5ab105;if(_0x50c658>=_0x47ac1f){_0x50c658=_0x47ac1f;_0x5ab105=0xc8;}else{_0x5ab105=0xce;}_0x3b2115[_0x0eb4('0x1b')](_0x5ab105);return _0x3b2115['set'](_0x0eb4('0x22'),_0x18861e+'-'+_0x50c658+'/'+_0x47ac1f)['json'](_0x3cf4d9);}return null;};}function patchUpdates(_0x1f150d){return function(_0x3f1298){try{jsonpatch[_0x0eb4('0x23')](_0x3f1298,_0x1f150d,!![]);}catch(_0x5c67f3){return BPromise[_0x0eb4('0x24')](_0x5c67f3);}return _0x3f1298[_0x0eb4('0x25')]();};}function saveUpdates(_0x11f699,_0x658aa0){return function(_0x157714){if(_0x157714){return _0x157714[_0x0eb4('0x26')](_0x11f699)[_0x0eb4('0x27')](function(_0xb437a3){return _0xb437a3;});}return null;};}function removeEntity(_0x164d93,_0x50c022){return function(_0x523b67){if(_0x523b67){return _0x523b67[_0x0eb4('0x28')]()[_0x0eb4('0x27')](function(){_0x164d93[_0x0eb4('0x1b')](0xcc)[_0x0eb4('0x1c')]();});}};}function handleEntityNotFound(_0x2f1bf2,_0xc10558){return function(_0x5125b7){if(!_0x5125b7){_0x2f1bf2[_0x0eb4('0x1a')](0x194);}return _0x5125b7;};}function handleError(_0x4480f2,_0x4c9bc8){_0x4c9bc8=_0x4c9bc8||0x1f4;return function(_0x4d7414){logger[_0x0eb4('0x29')](_0x4d7414[_0x0eb4('0x2a')]);if(_0x4d7414[_0x0eb4('0x2b')]){delete _0x4d7414[_0x0eb4('0x2b')];}_0x4480f2[_0x0eb4('0x1b')](_0x4c9bc8)['send'](_0x4d7414);};}function getInteractionUsers(_0x56b54b,_0x3c3ba0){return new BPromise(function(_0x185aae,_0xa3735a){try{if(_0x3c3ba0[_0x56b54b['id']]){_0x56b54b[_0x0eb4('0x2c')]=_['map'](_0x3c3ba0[_0x56b54b['id']],function(_0x1d75d9){return{'id':_0x1d75d9['id'],'fullname':_0x1d75d9[_0x0eb4('0x2d')]};});}}catch(_0x29032b){_0xa3735a(_0x29032b);}_0x185aae(_0x56b54b);});}function getInteractionTags(_0x44cad8,_0x47f624){return new BPromise(function(_0xd25a3d,_0x5cc733){try{if(_0x44cad8[_0x0eb4('0x2e')]){_0x44cad8[_0x0eb4('0x2f')]=[];_0x44cad8[_0x0eb4('0x2e')][_0x0eb4('0x30')](',')[_0x0eb4('0x31')](function(_0x88cc89){_0x44cad8[_0x0eb4('0x2f')][_0x0eb4('0x32')](_0x47f624[_0x88cc89]);});}delete _0x44cad8[_0x0eb4('0x2e')];}catch(_0x53d5c2){_0x5cc733(_0x53d5c2);}_0xd25a3d(_0x44cad8);});}function updateSmsInteraction(_0x472d40,_0x16dce8,_0x2d7d02){return new BPromise(function(_0x457bdb,_0xe8b817){return getInteractionUsers(_0x472d40,_0x2d7d02)[_0x0eb4('0x27')](function(_0x2009d4){return getInteractionTags(_0x2009d4,_0x16dce8);})['then'](function(_0x48257d){return getStateInteraction(_0x48257d);})[_0x0eb4('0x27')](function(_0x3a0cba){_0x457bdb(_0x3a0cba);})[_0x0eb4('0x33')](function(_0x1f9d4a){_0xe8b817(_0x1f9d4a);});});}function getStateInteraction(_0x539eeb){return new BPromise(function(_0x30761e){_0x539eeb['waiting']=0x0;_0x539eeb[_0x0eb4('0x34')]=0x0;_0x539eeb[_0x0eb4('0x35')]=0x0;_0x539eeb[_0x0eb4('0x36')]=0x0;_0x539eeb[_0x0eb4('0x37')]=0x0;if(!_0x539eeb['closed']&&!_0x539eeb[_0x0eb4('0x38')]){_0x539eeb[_0x0eb4('0x39')]+=0x1;}if(!_0x539eeb[_0x0eb4('0x3a')]&&_0x539eeb[_0x0eb4('0x38')]){_0x539eeb[_0x0eb4('0x34')]+=0x1;if(_0x539eeb[_0x0eb4('0x39')]){_0x539eeb[_0x0eb4('0x39')]-=0x1;}}if(_0x539eeb[_0x0eb4('0x3a')]&&_0x539eeb['UserId']){_0x539eeb['answered']+=0x1;if(_0x539eeb['talking']){_0x539eeb[_0x0eb4('0x34')]-=0x1;}}if(_0x539eeb[_0x0eb4('0x3a')]&&!_0x539eeb[_0x0eb4('0x38')]){_0x539eeb[_0x0eb4('0x36')]+=0x1;if(_0x539eeb[_0x0eb4('0x39')]){_0x539eeb['waiting']-=0x1;}}_0x539eeb[_0x0eb4('0x37')]+=0x1;_0x30761e(_0x539eeb);});}exports['index']=function(_0x4dabc6,_0x465f15){var _0x43c77f={},_0x140e84={},_0x36277c={'count':0x0,'rows':[]};var _0x3a90d5=_[_0x0eb4('0x3b')](db[_0x0eb4('0x3c')][_0x0eb4('0x3d')],function(_0x471f0a){return{'name':_0x471f0a[_0x0eb4('0x3e')],'type':_0x471f0a[_0x0eb4('0x3f')][_0x0eb4('0x40')]};});_0x140e84[_0x0eb4('0x41')]=_[_0x0eb4('0x3b')](_0x3a90d5,_0x0eb4('0x2b'));_0x140e84[_0x0eb4('0x42')]=_[_0x0eb4('0x43')](_0x4dabc6[_0x0eb4('0x42')]);_0x140e84[_0x0eb4('0x44')]=_[_0x0eb4('0x45')](_0x140e84[_0x0eb4('0x41')],_0x140e84[_0x0eb4('0x42')]);_0x43c77f['attributes']=_[_0x0eb4('0x45')](_0x140e84['model'],qs[_0x0eb4('0x46')](_0x4dabc6[_0x0eb4('0x42')]['fields']));_0x43c77f['attributes']=_0x43c77f[_0x0eb4('0x47')][_0x0eb4('0x48')]?_0x43c77f[_0x0eb4('0x47')]:_0x140e84['model'];if(!_0x4dabc6['query'][_0x0eb4('0x49')](_0x0eb4('0x4a'))){_0x43c77f[_0x0eb4('0x1f')]=qs['limit'](_0x4dabc6[_0x0eb4('0x42')][_0x0eb4('0x1f')]);_0x43c77f[_0x0eb4('0x20')]=qs[_0x0eb4('0x20')](_0x4dabc6[_0x0eb4('0x42')]['offset']);}_0x43c77f['order']=qs[_0x0eb4('0x4b')](_0x4dabc6['query'][_0x0eb4('0x4b')]);_0x43c77f['where']=qs[_0x0eb4('0x44')](_[_0x0eb4('0x4c')](_0x4dabc6[_0x0eb4('0x42')],_0x140e84[_0x0eb4('0x44')]),_0x3a90d5);var _0x205464=[];var _0x5cf15a=squel[_0x0eb4('0x4d')]()[_0x0eb4('0x4e')]('id')[_0x0eb4('0x4e')](_0x0eb4('0x2b'))[_0x0eb4('0x4e')](_0x0eb4('0x4f'))[_0x0eb4('0x50')](_0x0eb4('0x51'));var _0x3dde97=squel[_0x0eb4('0x4d')]()[_0x0eb4('0x4e')](_0x0eb4('0x52'))[_0x0eb4('0x4e')](_0x0eb4('0x53'))['field'](_0x0eb4('0x54'))[_0x0eb4('0x50')](_0x0eb4('0x55'),'ui')[_0x0eb4('0x56')](_0x0eb4('0x57'),'u',_0x0eb4('0x58'));var _0x36c01b=squel[_0x0eb4('0x4d')]()[_0x0eb4('0x50')](_0x0eb4('0x59'),'i')[_0x0eb4('0x56')](_0x0eb4('0x5a'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x0eb4('0x56')](_0x0eb4('0x57'),'o',_0x0eb4('0x5b'))['left_join'](_0x0eb4('0x5c'),'a',_0x0eb4('0x5d'))[_0x0eb4('0x56')](_0x0eb4('0x5e'),'me','me.SmsInteractionId\x20=\x20i.id')[_0x0eb4('0x56')](_0x0eb4('0x5f'),'it',_0x0eb4('0x60'))[_0x0eb4('0x56')](_0x0eb4('0x51'),'t',_0x0eb4('0x61'));var _0x3124ae=squel[_0x0eb4('0x62')]();var _0x2eaec6=[];var _0x212364=squel[_0x0eb4('0x62')]();var _0x40f61c;if(_0x4dabc6[_0x0eb4('0x42')][_0x0eb4('0x63')]){_0x40f61c=as['parseSearch'](_0x4dabc6[_0x0eb4('0x42')][_0x0eb4('0x63')]);var _0x2824e6=_0x40f61c[_0x0eb4('0x64')];for(var _0x1217e0=0x0;_0x1217e0<_0x40f61c[_0x0eb4('0x65')][_0x0eb4('0x48')];_0x1217e0++){var _0xd21bf2=_0x40f61c[_0x0eb4('0x65')][_0x1217e0];var _0x55453c='i';var _0x3345b9=_[_0x0eb4('0x66')](_0x3a90d5,[_0x0eb4('0x2b'),_0xd21bf2[_0x0eb4('0x4e')]]);if(!_0x3345b9){switch(_0xd21bf2[_0x0eb4('0x4e')]){case _0x0eb4('0x67'):if(_0xd21bf2[_0x0eb4('0x68')]==0x1){_0x36c01b[_0x0eb4('0x69')]('`'+_0xd21bf2[_0x0eb4('0x4e')]+'`\x20=\x200');}else{_0x36c01b[_0x0eb4('0x69')]('`'+_0xd21bf2['field']+'`\x20>\x200');}break;case _0x0eb4('0x6a'):if(_0xd21bf2['operator']===_0x0eb4('0x6b')){if(_0xd21bf2[_0x0eb4('0x68')]['split']('\x20')[_0x0eb4('0x48')]>0x1){_0x3124ae[_0x2824e6]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0xd21bf2[_0x0eb4('0x68')]),null);}else{var _0x5d2ae5='%'+_0xd21bf2[_0x0eb4('0x68')]+'%';_0x3124ae[_0x2824e6]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x5d2ae5,_0x5d2ae5,_0x5d2ae5);}}else{_0x3345b9=_[_0x0eb4('0x66')](_0x3a90d5,['name',_0x0eb4('0x6c')]);_0xd21bf2[_0x0eb4('0x4e')]=_0x0eb4('0x6c');_0x368a30=as['buildExpression'](_0x55453c,_0x3345b9['type'],_0xd21bf2);_0x3124ae[_0x2824e6](_0x368a30[_0x0eb4('0x6d')],_0x368a30[_0x0eb4('0x68')][_0x0eb4('0x6e')],_0x368a30[_0x0eb4('0x68')][_0x0eb4('0x1c')]);}break;case _0x0eb4('0x6f'):var _0x1e3e85=_0xd21bf2[_0x0eb4('0x68')][_0x0eb4('0x30')](',')[_0x0eb4('0x3b')](function(_0x49b2c0){return Number(_0x49b2c0);});_0x1e3e85['forEach'](function(_0x328511){_0x212364['or'](_0x0eb4('0x70'),'%,'+_0x328511+',%');});_0x2eaec6=_[_0x0eb4('0x71')](_0x2eaec6,_0x1e3e85);break;case'User':if(_0xd21bf2[_0x0eb4('0x72')]===_0x0eb4('0x6b')){_0x3124ae[_0x2824e6]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0xd21bf2[_0x0eb4('0x68')]+'%',null);}else{_0x3345b9=_[_0x0eb4('0x66')](_0x3a90d5,['name',_0x0eb4('0x38')]);_0xd21bf2['field']='UserId';_0x368a30=as['buildExpression'](_0x55453c,_0x3345b9[_0x0eb4('0x3f')],_0xd21bf2);_0x3124ae[_0x2824e6](_0x368a30[_0x0eb4('0x6d')],_0x368a30[_0x0eb4('0x68')][_0x0eb4('0x6e')],_0x368a30[_0x0eb4('0x68')]['end']);}break;case _0x0eb4('0x73'):_0x368a30=as[_0x0eb4('0x74')]('me',null,_0xd21bf2);_0x3124ae[_0x2824e6](_0x368a30[_0x0eb4('0x6d')],_0x368a30[_0x0eb4('0x68')]['start'],_0x368a30['value'][_0x0eb4('0x1c')]);break;}}else{var _0x368a30=as[_0x0eb4('0x74')](_0x55453c,_0x3345b9[_0x0eb4('0x3f')],_0xd21bf2);_0x3124ae[_0x2824e6](_0x368a30[_0x0eb4('0x6d')],_0x368a30[_0x0eb4('0x68')][_0x0eb4('0x6e')],_0x368a30['value'][_0x0eb4('0x1c')]);}}}else{var _0x2d4383=_(_0x4dabc6[_0x0eb4('0x42')])['keys']()['map'](function(_0x513057){return _['some'](_0x3a90d5,[_0x0eb4('0x2b'),_0x513057])?_0x513057:undefined;})['compact']()[_0x0eb4('0x68')]();if(!_[_0x0eb4('0x75')](_0x2d4383)){_0x2d4383['forEach'](function(_0x2a4da8){if(_0x2a4da8===_0x0eb4('0x76')){_0x36c01b['where'](_0x0eb4('0x77'),[][_0x0eb4('0x78')](_0x4dabc6[_0x0eb4('0x42')][_0x2a4da8]));}else if(_0x2a4da8==='createdAt'){var _0x20d6e0=JSON[_0x0eb4('0x79')](_0x4dabc6['query'][_0x2a4da8])[_0x0eb4('0x7a')];var _0x1479ed=JSON[_0x0eb4('0x79')](_0x4dabc6[_0x0eb4('0x42')][_0x2a4da8])[_0x0eb4('0x7b')];_0x36c01b[_0x0eb4('0x7c')](_0x0eb4('0x7d'),_0x20d6e0,_0x1479ed);}else{if(_0x4dabc6[_0x0eb4('0x42')][_0x2a4da8]===_0x0eb4('0x7e')){_0x36c01b[_0x0eb4('0x7c')]('i.'+_0x2a4da8+'\x20IS\x20NULL');}else{_0x36c01b['where']('i.'+_0x2a4da8+'\x20=\x20?',_0x4dabc6[_0x0eb4('0x42')][_0x2a4da8]);}}});}if(_0x4dabc6['query']['read']){if(_0x4dabc6['query'][_0x0eb4('0x7f')]==0x1){_0x36c01b[_0x0eb4('0x69')](_0x0eb4('0x80'));}else{_0x36c01b[_0x0eb4('0x69')]('`unreadMessages`\x20>\x200');}}if(_0x4dabc6[_0x0eb4('0x42')][_0x0eb4('0x81')]){_0x2eaec6=_[_0x0eb4('0x82')](_0x4dabc6[_0x0eb4('0x42')][_0x0eb4('0x81')])?_0x4dabc6[_0x0eb4('0x42')]['tag']:new Array(_0x4dabc6['query'][_0x0eb4('0x81')]);_0x2eaec6[_0x0eb4('0x31')](function(_0x57ca34){_0x212364['or'](_0x0eb4('0x70'),'%,'+_0x57ca34+',%');});}if(_0x4dabc6[_0x0eb4('0x42')]['filter']){var _0x439d97=_0x4dabc6[_0x0eb4('0x42')][_0x0eb4('0x83')][_0x0eb4('0x84')]('\x5c','\x5c\x5c')[_0x0eb4('0x84')](/'/g,'\x27\x27');if(qs[_0x0eb4('0x85')](_0x439d97)){_0x3124ae['or']('i.id\x20LIKE\x20?',_0x439d97+'%')['or'](_0x0eb4('0x86'),_0x439d97+'%');}else{_0x3124ae['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0eb4('0x87')](_0x439d97))['or'](_0x0eb4('0x88'),_0x439d97+'%');}}}_0x36c01b[_0x0eb4('0x7c')](_0x3124ae);_0x36c01b[_0x0eb4('0x89')](_0x0eb4('0x8a'));var _0x544efb={'type':db['Sequelize'][_0x0eb4('0x8b')][_0x0eb4('0x8c')],'raw':!![]};var _0x117a56=_0x36c01b['clone']();_0x117a56[_0x0eb4('0x4e')](_0x0eb4('0x8a'));_0x117a56[_0x0eb4('0x4e')](_0x0eb4('0x8d'),'unreadMessages');if(_0x43c77f['order']){_0x43c77f[_0x0eb4('0x8e')]['forEach'](function(_0x5bff7f){var _0x829bb3=_0x5bff7f[0x0]===_0x0eb4('0x8f')?_0x5bff7f[0x0]:'i.'+_0x5bff7f[0x0];_0x36c01b[_0x0eb4('0x8e')](_0x829bb3,_0x5bff7f[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x2eaec6)){_0x36c01b[_0x0eb4('0x69')](_0x212364);_0x117a56[_0x0eb4('0x7c')](_0x0eb4('0x90'),_0x2eaec6);}BPromise['resolve']()[_0x0eb4('0x27')](function(){if(!_0x40f61c){if(_0x4dabc6[_0x0eb4('0x42')]['SmsAccountId'])return;_0x117a56[_0x0eb4('0x7c')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');_0x36c01b[_0x0eb4('0x7c')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x4dabc6[_0x0eb4('0x91')][_0x0eb4('0x92')]!==_0x0eb4('0x93'))return;return _0x4dabc6['user'][_0x0eb4('0x94')]({'attributes':['id'],'raw':!![]})[_0x0eb4('0x27')](function(_0x945ac){if(_['isEmpty'](_0x945ac)){_0x117a56['where'](_0x0eb4('0x95'));_0x36c01b[_0x0eb4('0x7c')](_0x0eb4('0x95'));}else{_0x117a56[_0x0eb4('0x7c')](_0x0eb4('0x77'),_[_0x0eb4('0x3b')](_0x945ac,'id'));_0x36c01b[_0x0eb4('0x7c')](_0x0eb4('0x77'),_[_0x0eb4('0x3b')](_0x945ac,'id'));}});})[_0x0eb4('0x27')](function(){if(_0x4dabc6['user']['role']===_0x0eb4('0x93')&&!_0x40f61c&&!_0x4dabc6[_0x0eb4('0x42')][_0x0eb4('0x76')])return[];return db['sequelize'][_0x0eb4('0x42')](_0x117a56[_0x0eb4('0x96')](),_0x544efb);})[_0x0eb4('0x27')](function(_0x2af6b7){_0x36277c[_0x0eb4('0x21')]=_0x2af6b7[_0x0eb4('0x48')];if(_0x36277c[_0x0eb4('0x21')]===0x0)return[];return db[_0x0eb4('0x97')][_0x0eb4('0x42')](_0x5cf15a[_0x0eb4('0x96')](),_0x544efb)['then'](function(_0x13daa9){_0x205464=_[_0x0eb4('0x98')](_0x13daa9,'id');_0x544efb=_[_0x0eb4('0x99')](_0x544efb,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4dabc6[_0x0eb4('0x42')][_0x0eb4('0x46')]){_0x43c77f[_0x0eb4('0x47')][_0x0eb4('0x31')](function(_0x326074){_0x36c01b[_0x0eb4('0x4e')]('i.'+_0x326074);});}else{_0x36c01b[_0x0eb4('0x4e')](_0x0eb4('0x8d'),_0x0eb4('0x67'));_0x36c01b[_0x0eb4('0x4e')](_0x0eb4('0x9a'),'Account.key');_0x36c01b[_0x0eb4('0x4e')](_0x0eb4('0x9b'),_0x0eb4('0x9c'));_0x36c01b[_0x0eb4('0x4e')](_0x0eb4('0x9d'),'contactName');_0x36c01b[_0x0eb4('0x4e')]('i.*');_0x36c01b[_0x0eb4('0x4e')](_0x0eb4('0x9e'),_0x0eb4('0x9f'));_0x36c01b[_0x0eb4('0x4e')](_0x0eb4('0xa0'),'Contact.lastName');_0x36c01b[_0x0eb4('0x4e')]('c.email',_0x0eb4('0xa1'));_0x36c01b[_0x0eb4('0x4e')](_0x0eb4('0xa2'),_0x0eb4('0xa3'));_0x36c01b[_0x0eb4('0x4e')]('c.mobile',_0x0eb4('0xa4'));_0x36c01b[_0x0eb4('0x4e')](_0x0eb4('0xa5'),_0x0eb4('0xa6'));_0x36c01b[_0x0eb4('0x4e')](_0x0eb4('0xa7'),_0x0eb4('0xa8'));_0x36c01b[_0x0eb4('0x4e')](_0x0eb4('0xa9'),_0x0eb4('0xaa'));_0x36c01b['field'](_0x0eb4('0xab'),_0x0eb4('0x2e'));}if(_0x43c77f['limit'])_0x36c01b[_0x0eb4('0x1f')](_0x43c77f['limit']);if(_0x43c77f[_0x0eb4('0x20')])_0x36c01b[_0x0eb4('0x20')](_0x43c77f[_0x0eb4('0x20')]);return db[_0x0eb4('0x97')][_0x0eb4('0x42')](_0x36c01b['toString'](),_0x544efb);})[_0x0eb4('0x27')](function(_0x1923c8){if(_0x1923c8[_0x0eb4('0x48')]>0x0)_0x3dde97['where']('ui.SmsInteractionId\x20IN\x20?',_['map'](_0x1923c8,'id'));return db[_0x0eb4('0x97')][_0x0eb4('0x42')](_0x3dde97[_0x0eb4('0x96')](),_0x544efb)[_0x0eb4('0x27')](function(_0x32e75d){var _0x358ba3=_['groupBy'](_0x32e75d,_0x0eb4('0xac'));var _0x1012a2=[];_0x1923c8[_0x0eb4('0x31')](function(_0x513535){_0x1012a2['push'](updateSmsInteraction(_0x513535,_0x205464,_0x358ba3));});return BPromise[_0x0eb4('0xad')](_0x1012a2);});});})['then'](function(_0x4e8c98){_0x36277c[_0x0eb4('0xae')]=_0x4e8c98;return _0x36277c;})[_0x0eb4('0x27')](respondWithFilteredResult(_0x465f15,_0x43c77f))[_0x0eb4('0x33')](handleError(_0x465f15,null));};exports[_0x0eb4('0xaf')]=function(_0x1d9b39,_0x30122e){var _0x3647f0={'raw':![],'where':{'id':_0x1d9b39[_0x0eb4('0xb0')]['id']}},_0x58d527={};_0x58d527[_0x0eb4('0x41')]=_[_0x0eb4('0x43')](db[_0x0eb4('0x3c')][_0x0eb4('0x3d')]);_0x58d527[_0x0eb4('0x42')]=_[_0x0eb4('0x43')](_0x1d9b39[_0x0eb4('0x42')]);_0x58d527[_0x0eb4('0x44')]=_[_0x0eb4('0x45')](_0x58d527['model'],_0x58d527['query']);_0x3647f0[_0x0eb4('0x47')]=_[_0x0eb4('0x45')](_0x58d527[_0x0eb4('0x41')],qs[_0x0eb4('0x46')](_0x1d9b39[_0x0eb4('0x42')][_0x0eb4('0x46')]));_0x3647f0[_0x0eb4('0x47')]=_0x3647f0['attributes'][_0x0eb4('0x48')]?_0x3647f0[_0x0eb4('0x47')]:_0x58d527[_0x0eb4('0x41')];if(_0x1d9b39[_0x0eb4('0x42')]['includeAll']){_0x3647f0[_0x0eb4('0xb1')]=[{'all':!![]}];}_0x3647f0=_[_0x0eb4('0x99')]({},_0x3647f0,_0x1d9b39['options']);return db[_0x0eb4('0x3c')][_0x0eb4('0x66')](_0x3647f0)[_0x0eb4('0x27')](handleEntityNotFound(_0x30122e,null))[_0x0eb4('0x27')](respondWithResult(_0x30122e,null))[_0x0eb4('0x33')](handleError(_0x30122e,null));};exports['create']=function(_0x11fa4c,_0x4bfb2e){return db[_0x0eb4('0x3c')]['create'](_0x11fa4c[_0x0eb4('0x73')],{})[_0x0eb4('0x27')](respondWithResult(_0x4bfb2e,0xc9))[_0x0eb4('0x33')](handleError(_0x4bfb2e,null));};exports[_0x0eb4('0x26')]=function(_0x551766,_0x2e87f1){if(_0x551766[_0x0eb4('0x73')]['id']){delete _0x551766['body']['id'];}return db[_0x0eb4('0x3c')][_0x0eb4('0x66')]({'where':{'id':_0x551766[_0x0eb4('0xb0')]['id']}})[_0x0eb4('0x27')](handleEntityNotFound(_0x2e87f1,null))[_0x0eb4('0x27')](saveUpdates(_0x551766[_0x0eb4('0x73')],null))[_0x0eb4('0x27')](respondWithResult(_0x2e87f1,null))[_0x0eb4('0x33')](handleError(_0x2e87f1,null));};exports['destroy']=function(_0x1298c4,_0x5c0ea7){return db[_0x0eb4('0x3c')][_0x0eb4('0x66')]({'where':{'id':_0x1298c4[_0x0eb4('0xb0')]['id']}})['then'](handleEntityNotFound(_0x5c0ea7,null))['then'](removeEntity(_0x5c0ea7,null))[_0x0eb4('0x33')](handleError(_0x5c0ea7,null));};exports[_0x0eb4('0xb2')]=function(_0x13465c,_0x52f659){return db[_0x0eb4('0x3c')]['describe']()[_0x0eb4('0x27')](respondWithResult(_0x52f659,null))[_0x0eb4('0x33')](handleError(_0x52f659,null));};exports[_0x0eb4('0xb3')]=function(_0x100d10,_0x5aba5d,_0x270156){return db[_0x0eb4('0xb4')]['find']({'where':{'id':_0x100d10['params']['id']}})['then'](handleEntityNotFound(_0x5aba5d,null))[_0x0eb4('0x27')](function(_0x364517){if(_0x364517){return _0x364517[_0x0eb4('0xb3')](_0x100d10[_0x0eb4('0x73')]['ids'],_[_0x0eb4('0xb5')](_0x100d10[_0x0eb4('0x73')],[_0x0eb4('0xb6'),'id'])||{});}})[_0x0eb4('0x27')](respondWithResult(_0x5aba5d,null))['catch'](handleError(_0x5aba5d,null));};exports[_0x0eb4('0xb7')]=function(_0x3f46e5,_0x54802b,_0x17ac9c){var _0x5f4fdd={'raw':![],'where':{}};var _0x22c1f5={};var _0x5d213c={'count':0x0,'rows':[]};return db[_0x0eb4('0x3c')][_0x0eb4('0xb8')]({'where':{'id':_0x3f46e5['params']['id']}})[_0x0eb4('0x27')](handleEntityNotFound(_0x54802b,null))[_0x0eb4('0x27')](function(_0x1386ab){if(_0x1386ab){_0x22c1f5[_0x0eb4('0x41')]=_[_0x0eb4('0x43')](db['SmsMessage'][_0x0eb4('0x3d')]);_0x22c1f5[_0x0eb4('0x42')]=_[_0x0eb4('0x43')](_0x3f46e5[_0x0eb4('0x42')]);_0x22c1f5['filters']=_['intersection'](_0x22c1f5[_0x0eb4('0x41')],_0x22c1f5[_0x0eb4('0x42')]);_0x5f4fdd['attributes']=_['intersection'](_0x22c1f5['model'],qs['fields'](_0x3f46e5['query'][_0x0eb4('0x46')]));_0x5f4fdd['attributes']=_0x5f4fdd[_0x0eb4('0x47')][_0x0eb4('0x48')]?_0x5f4fdd[_0x0eb4('0x47')]:_0x22c1f5[_0x0eb4('0x41')];if(!_0x3f46e5[_0x0eb4('0x42')][_0x0eb4('0x49')]('nolimit')){_0x5f4fdd['limit']=qs[_0x0eb4('0x1f')](_0x3f46e5['query']['limit']);_0x5f4fdd[_0x0eb4('0x20')]=qs[_0x0eb4('0x20')](_0x3f46e5[_0x0eb4('0x42')][_0x0eb4('0x20')]);}_0x5f4fdd[_0x0eb4('0x8e')]=qs[_0x0eb4('0x4b')](_0x3f46e5[_0x0eb4('0x42')][_0x0eb4('0x4b')]);_0x5f4fdd[_0x0eb4('0x7c')]=qs[_0x0eb4('0x44')](_[_0x0eb4('0x4c')](_0x3f46e5[_0x0eb4('0x42')],_0x22c1f5[_0x0eb4('0x44')]));_0x5f4fdd[_0x0eb4('0x7c')]['SmsInteractionId']=_0x1386ab['id'];if(_0x3f46e5[_0x0eb4('0x42')][_0x0eb4('0x83')]){_0x5f4fdd['where']=_[_0x0eb4('0x99')](_0x5f4fdd[_0x0eb4('0x7c')],{'$or':_[_0x0eb4('0x3b')](_0x5f4fdd[_0x0eb4('0x47')],function(_0x562c17){var _0x234ba2={};_0x234ba2[_0x562c17]={'$like':'%'+_0x3f46e5[_0x0eb4('0x42')]['filter']+'%'};return _0x234ba2;})});}if(_0x3f46e5[_0x0eb4('0x42')][_0x0eb4('0x7a')]){var _0x59b03b=_0x3f46e5[_0x0eb4('0x42')][_0x0eb4('0x7a')][_0x0eb4('0x30')](',');var _0x3ec760={};_0x3ec760[_0x59b03b[0x0]]={'$gte':moment(_0x59b03b[0x1])['format'](_0x0eb4('0xb9'))};_0x5f4fdd[_0x0eb4('0x7c')]=_[_0x0eb4('0x99')](_0x5f4fdd[_0x0eb4('0x7c')],_0x3ec760);}_0x5f4fdd=_[_0x0eb4('0x99')]({},_0x5f4fdd,_0x3f46e5['options']);return db[_0x0eb4('0xb4')][_0x0eb4('0x21')]({'where':_0x5f4fdd['where']})['then'](function(_0xe2bb57){_0x5d213c['count']=_0xe2bb57;if(_0x3f46e5[_0x0eb4('0x42')][_0x0eb4('0xba')]){_0x5f4fdd[_0x0eb4('0xb1')]=[{'all':!![]}];}return db[_0x0eb4('0xb4')][_0x0eb4('0xbb')](_0x5f4fdd);})['then'](function(_0x3540e4){_0x5d213c[_0x0eb4('0xae')]=_0x3540e4;return _0x5d213c;});}})['then'](respondWithFilteredResult(_0x54802b,_0x5f4fdd))[_0x0eb4('0x33')](handleError(_0x54802b,null));};exports[_0x0eb4('0xbc')]=function(_0x13ea0c,_0x43be9a,_0x41e958){return db[_0x0eb4('0x3c')][_0x0eb4('0x66')]({'where':{'id':_0x13ea0c[_0x0eb4('0xb0')]['id']}})[_0x0eb4('0x27')](handleEntityNotFound(_0x43be9a,null))['then'](function(_0x345cf4){if(_0x345cf4){return _0x345cf4[_0x0eb4('0xbd')](_0x13ea0c[_0x0eb4('0x73')][_0x0eb4('0xb6')],_[_0x0eb4('0xb5')](_0x13ea0c[_0x0eb4('0x73')],[_0x0eb4('0xb6'),'id'])||{})['spread'](function(){return db[_0x0eb4('0x6f')][_0x0eb4('0xbb')]({'attributes':['id','name',_0x0eb4('0x4f')],'where':{'id':_0x13ea0c[_0x0eb4('0x73')][_0x0eb4('0xb6')]}});})['then'](function(_0x518dc2){socket[_0x0eb4('0xbe')](_0x0eb4('0xbf'),{'id':Number(_0x13ea0c[_0x0eb4('0xb0')]['id']),'tags':_0x518dc2||[]});return{'id':Number(_0x13ea0c['params']['id']),'tags':_0x518dc2||[]};});}})[_0x0eb4('0x27')](respondWithResult(_0x43be9a,null))['catch'](handleError(_0x43be9a,null));};exports['removeTags']=function(_0x42345c,_0x2b4eb2,_0x26b4d4){return db[_0x0eb4('0x3c')][_0x0eb4('0x66')]({'where':{'id':_0x42345c[_0x0eb4('0xb0')]['id']}})['then'](handleEntityNotFound(_0x2b4eb2,null))[_0x0eb4('0x27')](function(_0x53b4fa){if(_0x53b4fa){return _0x53b4fa[_0x0eb4('0xc0')](_0x42345c[_0x0eb4('0x42')][_0x0eb4('0xb6')]);}})[_0x0eb4('0x27')](respondWithStatusCode(_0x2b4eb2,null))[_0x0eb4('0x33')](handleError(_0x2b4eb2,null));};exports[_0x0eb4('0xc1')]=function(_0x3c8ffe,_0x162e89){var _0x59e855=moment()[_0x0eb4('0xc2')]()[_0x0eb4('0x96')]();var _0x72c136=path['join'](config[_0x0eb4('0xc3')],'server','files','tmp');var _0xfbaad6=path[_0x0eb4('0xc4')](config[_0x0eb4('0xc3')],'server','files',_0x0eb4('0xc5'));var _0x1044df=path[_0x0eb4('0xc4')](_0x72c136,_0x59e855);var _0x34cb1b=util[_0x0eb4('0xc6')](_0x0eb4('0xc7'),_0x3c8ffe['params']['id'],_0x59e855);var _0x338bef=path['join'](_0x72c136,_0x34cb1b);var _0x2b2a0f=[];_0x2b2a0f[_0x0eb4('0x32')]({'model':db[_0x0eb4('0xc8')],'as':_0x0eb4('0xc8'),'attributes':['id','fullname'],'raw':!![]});_0x2b2a0f[_0x0eb4('0x32')]({'model':db[_0x0eb4('0xc9')],'as':'Contact','attributes':['id',_0x0eb4('0xca'),_0x0eb4('0xcb')],'raw':!![]});var _0x5db396=[{'model':db[_0x0eb4('0xb4')],'as':'Messages','attributes':['id',_0x0eb4('0x73'),_0x0eb4('0xcc'),_0x0eb4('0xcd'),_0x0eb4('0xce'),'read'],'include':_0x2b2a0f}];_0x5db396[_0x0eb4('0x32')]({'model':db[_0x0eb4('0xcf')],'as':'Account','attributes':['id','name']});_0x5db396[_0x0eb4('0x32')]({'model':db[_0x0eb4('0xc8')],'as':'Owner','attributes':['id','fullname']});return db['SmsInteraction'][_0x0eb4('0x66')]({'where':{'id':_0x3c8ffe['params']['id']},'include':_0x5db396})['then'](handleEntityNotFound(_0x162e89,null))[_0x0eb4('0x27')](function(_0x4a5c9b){if(_0x4a5c9b){var _0x164952=_0x4a5c9b[_0x0eb4('0xd0')]({'plain':!![]});fs['mkdirSync'](_0x1044df);var _0x53228f={'channel':_0x0eb4('0xd1'),'account':_0x164952[_0x0eb4('0xd2')][_0x0eb4('0x2b')],'agent':_0x164952[_0x0eb4('0xd3')]?_0x164952[_0x0eb4('0xd3')][_0x0eb4('0x2d')]:_0x0eb4('0xd4'),'createdAt':moment(_0x164952[_0x0eb4('0xcc')])[_0x0eb4('0xc6')](_0x0eb4('0xb9'))[_0x0eb4('0x96')](),'closedAt':_0x164952[_0x0eb4('0x3a')]?moment(_0x164952[_0x0eb4('0xd5')])['format'](_0x0eb4('0xb9'))[_0x0eb4('0x96')]():'','disposition':_0x164952[_0x0eb4('0xd6')],'messages':_(_0x164952[_0x0eb4('0xd7')])[_0x0eb4('0x83')]({'secret':![]})['map'](function(_0x2875f4){return{'date':moment(_0x2875f4[_0x0eb4('0xcc')])[_0x0eb4('0xc6')](_0x0eb4('0xb9'))[_0x0eb4('0x96')](),'sender':_0x2875f4[_0x0eb4('0xcd')]===_0x0eb4('0xd8')?_0x2875f4[_0x0eb4('0xc8')]?_0x2875f4[_0x0eb4('0xc8')][_0x0eb4('0x2d')]:_0x0eb4('0xd9'):_0x2875f4['Contact']['firstName']+(_0x2875f4[_0x0eb4('0x6a')][_0x0eb4('0xcb')]?'\x20'+_0x2875f4[_0x0eb4('0x6a')][_0x0eb4('0xcb')]:''),'body':_0x2875f4[_0x0eb4('0x73')],'direction':_0x2875f4['direction']==='out'?'A':'C','secret':_0x2875f4[_0x0eb4('0xce')],'read':_0x2875f4[_0x0eb4('0x7f')]};})[_0x0eb4('0x68')]()};return ejs[_0x0eb4('0xda')](path[_0x0eb4('0xc4')](config['root'],_0x0eb4('0xdb'),_0x0eb4('0xdc'),_0x0eb4('0xdd')),{'interaction':_0x53228f})[_0x0eb4('0x27')](function(_0x5d2204){var _0x505336=path[_0x0eb4('0xc4')](_0x1044df,_0x0eb4('0xde')+_0x164952['id']+'-'+_0x59e855+_0x0eb4('0xdf'));var _0xd75ef1={'path':_0x505336,'channel':_0x0eb4('0xd1'),'interactionId':_0x164952['id']};return pdf[_0x0eb4('0xe0')](_0x5d2204,_0xd75ef1);})[_0x0eb4('0x27')](function(){return new BPromise(function(_0x2df42a,_0x257de5){zipdir(_0x1044df,{'saveTo':_0x338bef},function(_0x3f2833,_0x5b8b89){if(_0x3f2833)return _0x257de5(_0x3f2833);return _0x2df42a(_0x5b8b89);});})[_0x0eb4('0x27')](function(){return new BPromise(function(_0x1aa107,_0x4b5f5f){rimraf(_0x1044df,function(_0x370ab9){if(_0x370ab9)_0x4b5f5f(_0x370ab9);return _0x1aa107();});});})[_0x0eb4('0x27')](function(){return _0x162e89[_0x0eb4('0xc1')](_0x338bef,_0x34cb1b,function(_0x4dee50){if(_0x4dee50){console[_0x0eb4('0xe1')]('err',_0x4dee50);}else{fs[_0x0eb4('0xe2')](_0x338bef);}});});});}else{return _0x162e89[_0x0eb4('0x1a')](0xc8);}})['catch'](handleError(_0x162e89,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index d90730c..cab197b 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 _0x0598=['catch','hasOwnProperty','events','../../mysqldb','save','update','setDataValue','Users','map','then','unreadMessages','length'];(function(_0x476ab8,_0x19f377){var _0x58fdf6=function(_0x1df1b2){while(--_0x1df1b2){_0x476ab8['push'](_0x476ab8['shift']());}};_0x58fdf6(++_0x19f377);}(_0x0598,0x92));var _0x8059=function(_0x24126f,_0x2202ae){_0x24126f=_0x24126f-0x0;var _0xc9b13a=_0x0598[_0x24126f];return _0xc9b13a;};'use strict';var EventEmitter=require(_0x8059('0x0'));var SmsInteraction=require(_0x8059('0x1'))['db']['SmsInteraction'];var SmsMessage=require(_0x8059('0x1'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8059('0x2'),'afterUpdate':_0x8059('0x3'),'afterDestroy':'remove'};function emitEvent(_0x54f42f){return function(_0x555fb5,_0x467206,_0xa7d7c1){_0x555fb5['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x248273){_0x555fb5[_0x8059('0x4')](_0x8059('0x5'),_0x248273[_0x8059('0x6')](function(_0x5df268){return{'id':_0x5df268['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x555fb5['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8059('0x7')](function(_0x1bf5fd){_0x555fb5[_0x8059('0x4')](_0x8059('0x8'),_0x1bf5fd[_0x8059('0x9')]);SmsInteractionEvents['emit'](_0x54f42f+':'+_0x555fb5['id'],_0x555fb5);SmsInteractionEvents['emit'](_0x54f42f,_0x555fb5);_0xa7d7c1(null);})[_0x8059('0xa')](_0xa7d7c1(null));};}for(var e in events){if(events[_0x8059('0xb')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file +var _0x1a85=['then','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','SmsInteraction','../../mysqldb','SmsMessage','update','remove','getUsers','setDataValue','map'];(function(_0x2450b7,_0x2b81c8){var _0x3ba81d=function(_0x317523){while(--_0x317523){_0x2450b7['push'](_0x2450b7['shift']());}};_0x3ba81d(++_0x2b81c8);}(_0x1a85,0x178));var _0x51a8=function(_0x2a5541,_0x1324c3){_0x2a5541=_0x2a5541-0x0;var _0x54fd9e=_0x1a85[_0x2a5541];return _0x54fd9e;};'use strict';var EventEmitter=require('events');var SmsInteraction=require('../../mysqldb')['db'][_0x51a8('0x0')];var SmsMessage=require(_0x51a8('0x1'))['db'][_0x51a8('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x51a8('0x3'),'afterDestroy':_0x51a8('0x4')};function emitEvent(_0x99e371){return function(_0x48a21b,_0xaac0bf,_0x4b76a8){_0x48a21b[_0x51a8('0x5')]({'attributes':['id'],'raw':!![]})['then'](function(_0x331117){_0x48a21b[_0x51a8('0x6')]('Users',_0x331117[_0x51a8('0x7')](function(_0x513685){return{'id':_0x513685['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x48a21b['id'],'direction':'in','read':![]},'raw':!![]});})[_0x51a8('0x8')](function(_0x2f276b){_0x48a21b[_0x51a8('0x6')](_0x51a8('0x9'),_0x2f276b[_0x51a8('0xa')]);SmsInteractionEvents[_0x51a8('0xb')](_0x99e371+':'+_0x48a21b['id'],_0x48a21b);SmsInteractionEvents[_0x51a8('0xb')](_0x99e371,_0x48a21b);_0x4b76a8(null);})[_0x51a8('0xc')](_0x4b76a8(null));};}for(var e in events){if(events[_0x51a8('0xd')](e)){var event=events[e];SmsInteraction[_0x51a8('0xe')](e,emitEvent(event));}}module[_0x51a8('0xf')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index a2d7903..f8e62c2 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 _0xfc76=['bluebird','request-promise','path','../../config/environment','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','format','util','../../config/logger','api','moment'];(function(_0x55816d,_0x15c16){var _0x2e91c5=function(_0xa4374c){while(--_0xa4374c){_0x55816d['push'](_0x55816d['shift']());}};_0x2e91c5(++_0x15c16);}(_0xfc76,0x96));var _0x6fc7=function(_0x1bf2dd,_0x3bed45){_0x1bf2dd=_0x1bf2dd-0x0;var _0x3e2001=_0xfc76[_0x1bf2dd];return _0x3e2001;};'use strict';var _=require('lodash');var util=require(_0x6fc7('0x0'));var logger=require(_0x6fc7('0x1'))(_0x6fc7('0x2'));var moment=require(_0x6fc7('0x3'));var BPromise=require(_0x6fc7('0x4'));var rp=require(_0x6fc7('0x5'));var fs=require('fs');var path=require(_0x6fc7('0x6'));var rimraf=require('rimraf');var config=require(_0x6fc7('0x7'));var attributes=require(_0x6fc7('0x8'));module[_0x6fc7('0x9')]=function(_0x57c11d,_0x5a5ef3){return _0x57c11d[_0x6fc7('0xa')](_0x6fc7('0xb'),attributes,{'tableName':_0x6fc7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4592a4,_0x4d9810,_0x548f8d){if(_0x4592a4['changed']('closed')){_0x4592a4['closedAt']=moment()[_0x6fc7('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x548f8d(null,_0x4592a4);}}});}; \ No newline at end of file +var _0xa058=['./smsInteraction.attributes','define','SmsInteraction','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x41f5a6,_0xb35c51){var _0x241efd=function(_0x2cfaa5){while(--_0x2cfaa5){_0x41f5a6['push'](_0x41f5a6['shift']());}};_0x241efd(++_0xb35c51);}(_0xa058,0x16f));var _0x8a05=function(_0x5ce15c,_0x19c917){_0x5ce15c=_0x5ce15c-0x0;var _0x36e4f5=_0xa058[_0x5ce15c];return _0x36e4f5;};'use strict';var _=require(_0x8a05('0x0'));var util=require('util');var logger=require(_0x8a05('0x1'))(_0x8a05('0x2'));var moment=require(_0x8a05('0x3'));var BPromise=require(_0x8a05('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8a05('0x5'));var rimraf=require(_0x8a05('0x6'));var config=require(_0x8a05('0x7'));var attributes=require(_0x8a05('0x8'));module['exports']=function(_0x3b6e99,_0x4eba2a){return _0x3b6e99[_0x8a05('0x9')](_0x8a05('0xa'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3c3a99,_0x131f68,_0x2faa5b){if(_0x3c3a99['changed'](_0x8a05('0xb'))){_0x3c3a99[_0x8a05('0xc')]=moment()[_0x8a05('0xd')](_0x8a05('0xe'));}_0x2faa5b(null,_0x3c3a99);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index bc7d3bb..c3b64d0 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 _0x29d0=['request\x20sent','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SmsInteraction','update','body','options','raw','where','attributes','debug','UpdateSmsInteraction','AddTagsToSmsInteraction','find','addTags','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','./smsInteraction.socket','register','request','then','info','SmsInteraction,\x20%s,\x20%s'];(function(_0x13561c,_0x39f191){var _0x48f231=function(_0x19c49b){while(--_0x19c49b){_0x13561c['push'](_0x13561c['shift']());}};_0x48f231(++_0x39f191);}(_0x29d0,0x19b));var _0x029d=function(_0x3f1899,_0x4a0a39){_0x3f1899=_0x3f1899-0x0;var _0x5d2b33=_0x29d0[_0x3f1899];return _0x5d2b33;};'use strict';var _=require('lodash');var util=require(_0x029d('0x0'));var moment=require(_0x029d('0x1'));var BPromise=require(_0x029d('0x2'));var rs=require(_0x029d('0x3'));var fs=require('fs');var Redis=require(_0x029d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x029d('0x5'));var logger=require(_0x029d('0x6'))(_0x029d('0x7'));var config=require(_0x029d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x029d('0x9')]['http']({'port':0x232a});config[_0x029d('0xa')]=_[_0x029d('0xb')](config[_0x029d('0xa')],{'host':_0x029d('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x029d('0xa')]));require(_0x029d('0xd'))[_0x029d('0xe')](socket);function respondWithRpcPromise(_0x40c087,_0x358b2b,_0x2a2524){return new BPromise(function(_0x19dcce,_0x5c4b36){return client[_0x029d('0xf')](_0x40c087,_0x2a2524)[_0x029d('0x10')](function(_0x4eec9a){logger[_0x029d('0x11')](_0x029d('0x12'),_0x358b2b,_0x029d('0x13'));logger['debug'](_0x029d('0x14'),_0x358b2b,_0x029d('0x13'),JSON[_0x029d('0x15')](_0x4eec9a));if(_0x4eec9a[_0x029d('0x16')]){if(_0x4eec9a[_0x029d('0x16')][_0x029d('0x17')]===0x1f4){logger[_0x029d('0x16')](_0x029d('0x12'),_0x358b2b,_0x4eec9a[_0x029d('0x16')][_0x029d('0x18')]);return _0x5c4b36(_0x4eec9a[_0x029d('0x16')]['message']);}logger[_0x029d('0x16')]('SmsInteraction,\x20%s,\x20%s',_0x358b2b,_0x4eec9a[_0x029d('0x16')][_0x029d('0x18')]);return _0x19dcce(_0x4eec9a[_0x029d('0x16')][_0x029d('0x18')]);}else{logger[_0x029d('0x11')](_0x029d('0x12'),_0x358b2b,'request\x20sent');_0x19dcce(_0x4eec9a[_0x029d('0x19')][_0x029d('0x18')]);}})[_0x029d('0x1a')](function(_0x5456a7){logger[_0x029d('0x16')](_0x029d('0x12'),_0x358b2b,_0x5456a7);_0x5c4b36(_0x5456a7);});});}exports['UpdateSmsInteraction']=function(_0x4535ea){var _0x49ca63=this;return new Promise(function(_0x31cff9,_0xc392e4){return db[_0x029d('0x1b')][_0x029d('0x1c')](_0x4535ea[_0x029d('0x1d')],{'raw':_0x4535ea[_0x029d('0x1e')]?_0x4535ea[_0x029d('0x1e')][_0x029d('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4535ea['options']?_0x4535ea[_0x029d('0x1e')][_0x029d('0x20')]||null:null,'attributes':_0x4535ea['options']?_0x4535ea['options'][_0x029d('0x21')]||null:null,'limit':_0x4535ea[_0x029d('0x1e')]?_0x4535ea[_0x029d('0x1e')]['limit']||null:null})[_0x029d('0x10')](function(_0x15e0a4){logger[_0x029d('0x11')]('UpdateSmsInteraction',_0x4535ea);logger[_0x029d('0x22')](_0x029d('0x23'),_0x4535ea,JSON[_0x029d('0x15')](_0x15e0a4));_0x31cff9(_0x15e0a4);})['catch'](function(_0x2422fa){logger['error'](_0x029d('0x23'),_0x2422fa[_0x029d('0x18')],_0x4535ea);_0xc392e4(_0x49ca63['error'](0x1f4,_0x2422fa[_0x029d('0x18')]));});});};exports[_0x029d('0x24')]=function(_0x3ebfb1){return new Promise(function(_0x231826,_0x37e75c){return db[_0x029d('0x1b')][_0x029d('0x25')]({'where':_0x3ebfb1[_0x029d('0x1e')]?_0x3ebfb1[_0x029d('0x1e')][_0x029d('0x20')]||null:null})[_0x029d('0x10')](function(_0x42f7c){if(_0x42f7c){return _0x42f7c[_0x029d('0x26')](_0x3ebfb1[_0x029d('0x1d')][_0x029d('0x27')],_[_0x029d('0x28')](_0x3ebfb1[_0x029d('0x1d')],['ids','id'])||{});}})[_0x029d('0x29')](function(_0x2c5aee){logger['info']('AddTags',_0x3ebfb1);logger[_0x029d('0x22')](_0x029d('0x2a'),_0x3ebfb1,JSON[_0x029d('0x15')](_0x2c5aee));_0x231826(_0x2c5aee);})[_0x029d('0x1a')](function(_0x1af594){logger[_0x029d('0x16')](_0x029d('0x2a'),_0x1af594[_0x029d('0x18')],_0x3ebfb1);_0x37e75c(_this[_0x029d('0x16')](0x1f4,_0x1af594['message']));});});}; \ No newline at end of file +var _0x897a=['randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','./smsInteraction.socket','register','request','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateSmsInteraction','SmsInteraction','options','raw','where','limit','then','AddTagsToSmsInteraction','find','body','ids','AddTags','lodash','util'];(function(_0x471448,_0x1c0e9e){var _0x38190b=function(_0x41dd2f){while(--_0x41dd2f){_0x471448['push'](_0x471448['shift']());}};_0x38190b(++_0x1c0e9e);}(_0x897a,0x154));var _0xa897=function(_0x28eb67,_0x2bc565){_0x28eb67=_0x28eb67-0x0;var _0x493bdb=_0x897a[_0x28eb67];return _0x493bdb;};'use strict';var _=require(_0xa897('0x0'));var util=require(_0xa897('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa897('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa897('0x3'))['db'];var utils=require(_0xa897('0x4'));var logger=require(_0xa897('0x5'))('rpc');var config=require(_0xa897('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xa897('0x7')][_0xa897('0x8')]({'port':0x232a});config[_0xa897('0x9')]=_[_0xa897('0xa')](config[_0xa897('0x9')],{'host':_0xa897('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa897('0x9')]));require(_0xa897('0xc'))[_0xa897('0xd')](socket);function respondWithRpcPromise(_0x565f8e,_0x19e9d7,_0x688a9){return new BPromise(function(_0x2e2e89,_0x82fc16){return client[_0xa897('0xe')](_0x565f8e,_0x688a9)['then'](function(_0xb94593){logger[_0xa897('0xf')](_0xa897('0x10'),_0x19e9d7,_0xa897('0x11'));logger[_0xa897('0x12')](_0xa897('0x13'),_0x19e9d7,_0xa897('0x11'),JSON[_0xa897('0x14')](_0xb94593));if(_0xb94593[_0xa897('0x15')]){if(_0xb94593[_0xa897('0x15')][_0xa897('0x16')]===0x1f4){logger[_0xa897('0x15')]('SmsInteraction,\x20%s,\x20%s',_0x19e9d7,_0xb94593[_0xa897('0x15')][_0xa897('0x17')]);return _0x82fc16(_0xb94593[_0xa897('0x15')][_0xa897('0x17')]);}logger[_0xa897('0x15')](_0xa897('0x10'),_0x19e9d7,_0xb94593[_0xa897('0x15')][_0xa897('0x17')]);return _0x2e2e89(_0xb94593['error'][_0xa897('0x17')]);}else{logger['info'](_0xa897('0x10'),_0x19e9d7,_0xa897('0x11'));_0x2e2e89(_0xb94593[_0xa897('0x18')]['message']);}})[_0xa897('0x19')](function(_0x2827fa){logger[_0xa897('0x15')]('SmsInteraction,\x20%s,\x20%s',_0x19e9d7,_0x2827fa);_0x82fc16(_0x2827fa);});});}exports[_0xa897('0x1a')]=function(_0x5da7e5){var _0x339012=this;return new Promise(function(_0x10d71b,_0x5f3972){return db[_0xa897('0x1b')]['update'](_0x5da7e5['body'],{'raw':_0x5da7e5['options']?_0x5da7e5[_0xa897('0x1c')][_0xa897('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5da7e5[_0xa897('0x1c')]?_0x5da7e5[_0xa897('0x1c')][_0xa897('0x1e')]||null:null,'attributes':_0x5da7e5[_0xa897('0x1c')]?_0x5da7e5[_0xa897('0x1c')]['attributes']||null:null,'limit':_0x5da7e5[_0xa897('0x1c')]?_0x5da7e5[_0xa897('0x1c')][_0xa897('0x1f')]||null:null})[_0xa897('0x20')](function(_0xc33098){logger[_0xa897('0xf')](_0xa897('0x1a'),_0x5da7e5);logger[_0xa897('0x12')]('UpdateSmsInteraction',_0x5da7e5,JSON[_0xa897('0x14')](_0xc33098));_0x10d71b(_0xc33098);})[_0xa897('0x19')](function(_0x5a0c77){logger[_0xa897('0x15')](_0xa897('0x1a'),_0x5a0c77[_0xa897('0x17')],_0x5da7e5);_0x5f3972(_0x339012[_0xa897('0x15')](0x1f4,_0x5a0c77[_0xa897('0x17')]));});});};exports[_0xa897('0x21')]=function(_0x2a317a){return new Promise(function(_0x504a15,_0x251602){return db['SmsInteraction'][_0xa897('0x22')]({'where':_0x2a317a[_0xa897('0x1c')]?_0x2a317a['options'][_0xa897('0x1e')]||null:null})[_0xa897('0x20')](function(_0x58f0a3){if(_0x58f0a3){return _0x58f0a3['addTags'](_0x2a317a[_0xa897('0x23')][_0xa897('0x24')],_['omit'](_0x2a317a[_0xa897('0x23')],[_0xa897('0x24'),'id'])||{});}})['spread'](function(_0x13e4c0){logger['info'](_0xa897('0x25'),_0x2a317a);logger[_0xa897('0x12')](_0xa897('0x25'),_0x2a317a,JSON[_0xa897('0x14')](_0x13e4c0));_0x504a15(_0x13e4c0);})[_0xa897('0x19')](function(_0x312956){logger[_0xa897('0x15')](_0xa897('0x25'),_0x312956[_0xa897('0x17')],_0x2a317a);_0x251602(_this['error'](0x1f4,_0x312956[_0xa897('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 78662c7..8943a50 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 _0x3f7e=['save','remove','update','emit','removeListener','register','length','./smsInteraction.events'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x3f7e,0x77));var _0xe3f7=function(_0x8c3ab6,_0x583f2c){_0x8c3ab6=_0x8c3ab6-0x0;var _0x410d67=_0x3f7e[_0x8c3ab6];return _0x410d67;};'use strict';var SmsInteractionEvents=require(_0xe3f7('0x0'));var events=[_0xe3f7('0x1'),_0xe3f7('0x2'),_0xe3f7('0x3')];function createListener(_0x900a51,_0x31f29e){return function(_0x55c67d){_0x31f29e[_0xe3f7('0x4')](_0x900a51,_0x55c67d);};}function removeListener(_0x29cb79,_0x12db65){return function(){SmsInteractionEvents[_0xe3f7('0x5')](_0x29cb79,_0x12db65);};}exports[_0xe3f7('0x6')]=function(_0x3f4d8e){for(var _0x669265=0x0,_0x1ea818=events[_0xe3f7('0x7')];_0x669265<_0x1ea818;_0x669265++){var _0x21871d=events[_0x669265];var _0x5c4755=createListener('smsInteraction:'+_0x21871d,_0x3f4d8e);SmsInteractionEvents['on'](_0x21871d,_0x5c4755);}}; \ No newline at end of file +var _0x74d9=['save','remove','emit','removeListener','register','length','smsInteraction:','./smsInteraction.events'];(function(_0x49b13b,_0x39ce97){var _0x17d11d=function(_0x4aa80a){while(--_0x4aa80a){_0x49b13b['push'](_0x49b13b['shift']());}};_0x17d11d(++_0x39ce97);}(_0x74d9,0x18f));var _0x974d=function(_0x58b6d8,_0x3f3cb1){_0x58b6d8=_0x58b6d8-0x0;var _0x928a75=_0x74d9[_0x58b6d8];return _0x928a75;};'use strict';var SmsInteractionEvents=require(_0x974d('0x0'));var events=[_0x974d('0x1'),_0x974d('0x2'),'update'];function createListener(_0x3b4e0c,_0x8d2d91){return function(_0x1cc62b){_0x8d2d91[_0x974d('0x3')](_0x3b4e0c,_0x1cc62b);};}function removeListener(_0x4c3ad6,_0x43c994){return function(){SmsInteractionEvents[_0x974d('0x4')](_0x4c3ad6,_0x43c994);};}exports[_0x974d('0x5')]=function(_0x18d12e){for(var _0x1f6539=0x0,_0x5af83b=events[_0x974d('0x6')];_0x1f6539<_0x5af83b;_0x1f6539++){var _0x2621db=events[_0x1f6539];var _0x4c2f54=createListener(_0x974d('0x7')+_0x2621db,_0x18d12e);SmsInteractionEvents['on'](_0x2621db,_0x4c2f54);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 23177d6..a4bec30 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 _0x359c=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','sms','smsmessage:create','create','/:id/status','put','/:id/accept','accept'];(function(_0x123251,_0x511089){var _0x114da1=function(_0x1fd37a){while(--_0x1fd37a){_0x123251['push'](_0x123251['shift']());}};_0x114da1(++_0x511089);}(_0x359c,0xa5));var _0xc359=function(_0x2b93bb,_0x51002a){_0x2b93bb=_0x2b93bb-0x0;var _0x2bedc9=_0x359c[_0x2b93bb];return _0x2bedc9;};'use strict';var multer=require(_0xc359('0x0'));var util=require(_0xc359('0x1'));var path=require(_0xc359('0x2'));var timeout=require(_0xc359('0x3'));var express=require(_0xc359('0x4'));var router=express[_0xc359('0x5')]();var fs_extra=require(_0xc359('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc359('0x7'));var controller=require(_0xc359('0x8'));router[_0xc359('0x9')]('/',auth[_0xc359('0xa')](),controller[_0xc359('0xb')]);router[_0xc359('0x9')](_0xc359('0xc'),auth[_0xc359('0xa')](),controller[_0xc359('0xd')]);router[_0xc359('0x9')](_0xc359('0xe'),auth[_0xc359('0xa')](),controller[_0xc359('0xf')]);router[_0xc359('0x10')]('/',auth[_0xc359('0xa')](),interaction['tracked'](_0xc359('0x11'),_0xc359('0x12')),controller[_0xc359('0x13')]);router[_0xc359('0x10')](_0xc359('0x14'),controller['status']);router['put']('/:id',auth[_0xc359('0xa')](),controller['update']);router[_0xc359('0x15')](_0xc359('0x16'),auth[_0xc359('0xa')](),controller[_0xc359('0x17')]);router['put']('/:id/reject',auth['isAuthenticated'](),controller['reject']);router[_0xc359('0x18')](_0xc359('0xe'),auth['isAuthenticated'](),controller[_0xc359('0x19')]);module[_0xc359('0x1a')]=router; \ No newline at end of file +var _0xc932=['connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','describe','/:id','show','post','sms','smsmessage:create','create','status','update','put','/:id/accept','accept','/:id/reject','reject','destroy','exports','multer'];(function(_0x14707c,_0x293c6e){var _0xcb4183=function(_0xb4b908){while(--_0xb4b908){_0x14707c['push'](_0x14707c['shift']());}};_0xcb4183(++_0x293c6e);}(_0xc932,0x18f));var _0x2c93=function(_0x3a544a,_0x73a217){_0x3a544a=_0x3a544a-0x0;var _0x342f1e=_0xc932[_0x3a544a];return _0x342f1e;};'use strict';var multer=require(_0x2c93('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2c93('0x1'));var express=require(_0x2c93('0x2'));var router=express['Router']();var fs_extra=require(_0x2c93('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x2c93('0x4'));var config=require(_0x2c93('0x5'));var controller=require(_0x2c93('0x6'));router[_0x2c93('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0x2c93('0x8')](),controller[_0x2c93('0x9')]);router[_0x2c93('0x7')](_0x2c93('0xa'),auth['isAuthenticated'](),controller[_0x2c93('0xb')]);router[_0x2c93('0xc')]('/',auth[_0x2c93('0x8')](),interaction['tracked'](_0x2c93('0xd'),_0x2c93('0xe')),controller[_0x2c93('0xf')]);router['post']('/:id/status',controller[_0x2c93('0x10')]);router['put']('/:id',auth[_0x2c93('0x8')](),controller[_0x2c93('0x11')]);router[_0x2c93('0x12')](_0x2c93('0x13'),auth['isAuthenticated'](),controller[_0x2c93('0x14')]);router[_0x2c93('0x12')](_0x2c93('0x15'),auth[_0x2c93('0x8')](),controller[_0x2c93('0x16')]);router['delete'](_0x2c93('0xa'),auth[_0x2c93('0x8')](),controller[_0x2c93('0x17')]);module[_0x2c93('0x18')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 0fcd0ce..16ddbeb 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 _0xb40c=['STRING','DATE','sequelize','exports','TEXT','BOOLEAN','out'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0xb40c,0x79));var _0xcb40=function(_0x11bb6c,_0x57f583){_0x11bb6c=_0x11bb6c-0x0;var _0xc08bea=_0xb40c[_0x11bb6c];return _0xc08bea;};'use strict';var Sequelize=require(_0xcb40('0x0'));module[_0xcb40('0x1')]={'body':{'type':Sequelize[_0xcb40('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xcb40('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xcb40('0x4')),'defaultValue':_0xcb40('0x4'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0xcb40('0x5')]},'readAt':{'type':Sequelize[_0xcb40('0x6')]},'secret':{'type':Sequelize[_0xcb40('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xcb40('0x5')]},'providerResponse':{'type':Sequelize[_0xcb40('0x2')]}}; \ No newline at end of file +var _0x9fce=['sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','STRING','DATE'];(function(_0x49fec0,_0x3c2dc9){var _0x24681a=function(_0x2ce8c0){while(--_0x2ce8c0){_0x49fec0['push'](_0x49fec0['shift']());}};_0x24681a(++_0x3c2dc9);}(_0x9fce,0x99));var _0xe9fc=function(_0x30c7c5,_0x168208){_0x30c7c5=_0x30c7c5-0x0;var _0x29e24e=_0x9fce[_0x30c7c5];return _0x29e24e;};'use strict';var Sequelize=require(_0xe9fc('0x0'));module[_0xe9fc('0x1')]={'body':{'type':Sequelize[_0xe9fc('0x2')](_0xe9fc('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xe9fc('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xe9fc('0x5')]('in',_0xe9fc('0x6')),'defaultValue':_0xe9fc('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0xe9fc('0x7')](0xbe)},'phone':{'type':Sequelize[_0xe9fc('0x7')]},'readAt':{'type':Sequelize[_0xe9fc('0x8')]},'secret':{'type':Sequelize[_0xe9fc('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xe9fc('0x7')]},'providerResponse':{'type':Sequelize[_0xe9fc('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 9aa8213..7bde346 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 _0xb758=['internal','manual','channel','motionChannel','event','EventManager','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','SELECT','interface','SIP/%s','SmsAccountId','received\x20delivery\x20report\x20from','inspect','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','plivo','MessageUUID','indexOf','sent','delivered','plivio','infobip','results','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./smsMessage.socket','register','jayson/promise','client','http','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','apply','reject','save','update','then','destroy','stack','name','send','index','map','SmsMessage','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','rows','show','params','keys','options','find','create','body','describe','sms-interactions','sms','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','SmsInteraction','SmsInteractionId','isNil','read1stAt','format','interaction','get','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','contact','User','fullname','email'];(function(_0x407cb1,_0x2b1ac1){var _0x11bd3b=function(_0x5de5b3){while(--_0x5de5b3){_0x407cb1['push'](_0x407cb1['shift']());}};_0x11bd3b(++_0x2b1ac1);}(_0xb758,0x14a));var _0x8b75=function(_0x3c2b2e,_0x3e6e53){_0x3c2b2e=_0x3c2b2e-0x0;var _0x27a338=_0xb758[_0x3c2b2e];return _0x27a338;};'use strict';var emlformat=require(_0x8b75('0x0'));var rimraf=require(_0x8b75('0x1'));var zipdir=require(_0x8b75('0x2'));var jsonpatch=require(_0x8b75('0x3'));var rp=require('request-promise');var moment=require(_0x8b75('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8b75('0x5'));var util=require('util');var path=require(_0x8b75('0x6'));var sox=require(_0x8b75('0x7'));var csv=require('to-csv');var ejs=require(_0x8b75('0x8'));var fs=require('fs');var fs_extra=require(_0x8b75('0x9'));var _=require(_0x8b75('0xa'));var squel=require(_0x8b75('0xb'));var crypto=require(_0x8b75('0xc'));var jsforce=require(_0x8b75('0xd'));var deskjs=require(_0x8b75('0xe'));var toCsv=require(_0x8b75('0xf'));var querystring=require(_0x8b75('0x10'));var Papa=require(_0x8b75('0x11'));var Redis=require(_0x8b75('0x12'));var authService=require(_0x8b75('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x8b75('0x14'));var hardwareService=require(_0x8b75('0x15'));var logger=require(_0x8b75('0x16'))(_0x8b75('0x17'));var utils=require(_0x8b75('0x18'));var config=require(_0x8b75('0x19'));var licenseUtil=require(_0x8b75('0x1a'));var db=require('../../mysqldb')['db'];config[_0x8b75('0x1b')]=_[_0x8b75('0x1c')](config['redis'],{'host':_0x8b75('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8b75('0x1b')]));require(_0x8b75('0x1e'))[_0x8b75('0x1f')](socket);var jayson=require(_0x8b75('0x20'));var client=jayson[_0x8b75('0x21')][_0x8b75('0x22')]({'port':0x232c});var client9002=jayson[_0x8b75('0x21')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10b52c,_0x1f48a7,_0x32a73f,_0x78e366){return new BPromise(function(_0x1aed0a,_0x286df6){var _0x3367a=_0x78e366||client;return _0x3367a['request'](_0x10b52c,_0x32a73f)['then'](function(_0x553587){logger[_0x8b75('0x23')](_0x8b75('0x24'),_0x1f48a7,_0x8b75('0x25'));logger[_0x8b75('0x26')](_0x8b75('0x27'),_0x1f48a7,_0x8b75('0x25'),JSON[_0x8b75('0x28')](_0x553587));if(_0x553587[_0x8b75('0x29')]){if(_0x553587['error'][_0x8b75('0x2a')]===0x1f4){logger[_0x8b75('0x29')]('SmsMessage,\x20%s,\x20%s',_0x1f48a7,_0x553587[_0x8b75('0x29')]['message']);return _0x286df6(_0x553587['error']['message']);}logger[_0x8b75('0x29')](_0x8b75('0x24'),_0x1f48a7,_0x553587[_0x8b75('0x29')][_0x8b75('0x2b')]);return _0x1aed0a(_0x553587[_0x8b75('0x29')][_0x8b75('0x2b')]);}else{logger['info'](_0x8b75('0x24'),_0x1f48a7,_0x8b75('0x25'));_0x1aed0a(_0x553587[_0x8b75('0x2c')]['message']);}})[_0x8b75('0x2d')](function(_0x53bdc9){logger['error']('SmsMessage,\x20%s,\x20%s',_0x1f48a7,_0x53bdc9);_0x286df6(_0x53bdc9);});});}function respondWithStatusCode(_0x6b7b21,_0x273cb7){_0x273cb7=_0x273cb7||0xcc;return function(_0x4663a0){if(_0x4663a0){return _0x6b7b21[_0x8b75('0x2e')](_0x273cb7);}return _0x6b7b21[_0x8b75('0x2f')](_0x273cb7)[_0x8b75('0x30')]();};}function respondWithResult(_0x4d3fbd,_0x3f9b7c){_0x3f9b7c=_0x3f9b7c||0xc8;return function(_0x473532){if(_0x473532){return _0x4d3fbd[_0x8b75('0x2f')](_0x3f9b7c)[_0x8b75('0x31')](_0x473532);}};}function respondWithFilteredResult(_0xe5d5cf,_0x5bac9a){return function(_0x18f40f){if(_0x18f40f){var _0xe35c84=typeof _0x5bac9a[_0x8b75('0x32')]===_0x8b75('0x33')&&typeof _0x5bac9a['limit']===_0x8b75('0x33');var _0x4b7606=_0x18f40f[_0x8b75('0x34')];var _0x160588=_0xe35c84?0x0:_0x5bac9a['offset'];var _0x3bb985=_0xe35c84?_0x18f40f[_0x8b75('0x34')]:_0x5bac9a[_0x8b75('0x32')]+_0x5bac9a['limit'];var _0x1fd454;if(_0x3bb985>=_0x4b7606){_0x3bb985=_0x4b7606;_0x1fd454=0xc8;}else{_0x1fd454=0xce;}_0xe5d5cf[_0x8b75('0x2f')](_0x1fd454);return _0xe5d5cf['set']('Content-Range',_0x160588+'-'+_0x3bb985+'/'+_0x4b7606)[_0x8b75('0x31')](_0x18f40f);}return null;};}function patchUpdates(_0x59263d){return function(_0x1b094f){try{jsonpatch[_0x8b75('0x35')](_0x1b094f,_0x59263d,!![]);}catch(_0x12e266){return BPromise[_0x8b75('0x36')](_0x12e266);}return _0x1b094f[_0x8b75('0x37')]();};}function saveUpdates(_0x1a09b6,_0x45da4b){return function(_0x5af8c6){if(_0x5af8c6){return _0x5af8c6[_0x8b75('0x38')](_0x1a09b6)[_0x8b75('0x39')](function(_0x487f20){return _0x487f20;});}return null;};}function removeEntity(_0x2292cf,_0x3c7be6){return function(_0x5cc0a3){if(_0x5cc0a3){return _0x5cc0a3[_0x8b75('0x3a')]()[_0x8b75('0x39')](function(){_0x2292cf[_0x8b75('0x2f')](0xcc)[_0x8b75('0x30')]();});}};}function handleEntityNotFound(_0x4eff9d,_0x530123){return function(_0x859140){if(!_0x859140){_0x4eff9d[_0x8b75('0x2e')](0x194);}return _0x859140;};}function handleError(_0x3b7b58,_0x2f2fb7){_0x2f2fb7=_0x2f2fb7||0x1f4;return function(_0x2b9b58){logger[_0x8b75('0x29')](_0x2b9b58[_0x8b75('0x3b')]);if(_0x2b9b58[_0x8b75('0x3c')]){delete _0x2b9b58[_0x8b75('0x3c')];}_0x3b7b58[_0x8b75('0x2f')](_0x2f2fb7)[_0x8b75('0x3d')](_0x2b9b58);};}exports[_0x8b75('0x3e')]=function(_0x43d831,_0x118794){var _0x2c3e4c={},_0x585c13={},_0x4bdcc2={'count':0x0,'rows':[]};var _0x358bba=_[_0x8b75('0x3f')](db[_0x8b75('0x40')][_0x8b75('0x41')],function(_0x5bc8ac){return{'name':_0x5bc8ac[_0x8b75('0x42')],'type':_0x5bc8ac[_0x8b75('0x43')][_0x8b75('0x44')]};});_0x585c13['model']=_[_0x8b75('0x3f')](_0x358bba,_0x8b75('0x3c'));_0x585c13[_0x8b75('0x45')]=_['keys'](_0x43d831[_0x8b75('0x45')]);_0x585c13[_0x8b75('0x46')]=_[_0x8b75('0x47')](_0x585c13[_0x8b75('0x48')],_0x585c13[_0x8b75('0x45')]);_0x2c3e4c[_0x8b75('0x49')]=_[_0x8b75('0x47')](_0x585c13[_0x8b75('0x48')],qs[_0x8b75('0x4a')](_0x43d831['query'][_0x8b75('0x4a')]));_0x2c3e4c[_0x8b75('0x49')]=_0x2c3e4c['attributes'][_0x8b75('0x4b')]?_0x2c3e4c[_0x8b75('0x49')]:_0x585c13[_0x8b75('0x48')];if(!_0x43d831['query'][_0x8b75('0x4c')](_0x8b75('0x4d'))){_0x2c3e4c[_0x8b75('0x4e')]=qs[_0x8b75('0x4e')](_0x43d831[_0x8b75('0x45')][_0x8b75('0x4e')]);_0x2c3e4c[_0x8b75('0x32')]=qs[_0x8b75('0x32')](_0x43d831[_0x8b75('0x45')][_0x8b75('0x32')]);}_0x2c3e4c[_0x8b75('0x4f')]=qs[_0x8b75('0x50')](_0x43d831['query'][_0x8b75('0x50')]);_0x2c3e4c[_0x8b75('0x51')]=qs[_0x8b75('0x46')](_['pick'](_0x43d831['query'],_0x585c13[_0x8b75('0x46')]),_0x358bba);if(_0x43d831[_0x8b75('0x45')][_0x8b75('0x52')]){_0x2c3e4c['where']=_[_0x8b75('0x53')](_0x2c3e4c[_0x8b75('0x51')],{'$or':_[_0x8b75('0x3f')](_0x358bba,function(_0x4092f5){if(_0x4092f5[_0x8b75('0x43')]!==_0x8b75('0x54')){var _0x36079d={};_0x36079d[_0x4092f5[_0x8b75('0x3c')]]={'$like':'%'+_0x43d831['query']['filter']+'%'};return _0x36079d;}})});}_0x2c3e4c=_[_0x8b75('0x53')]({},_0x2c3e4c,_0x43d831['options']);var _0x5f5d3c={'where':_0x2c3e4c[_0x8b75('0x51')]};return db[_0x8b75('0x40')][_0x8b75('0x34')](_0x5f5d3c)['then'](function(_0x4b0a5c){_0x4bdcc2[_0x8b75('0x34')]=_0x4b0a5c;if(_0x43d831[_0x8b75('0x45')][_0x8b75('0x55')]){_0x2c3e4c[_0x8b75('0x56')]=[{'all':!![]}];}return db['SmsMessage']['findAll'](_0x2c3e4c);})[_0x8b75('0x39')](function(_0x37d21a){_0x4bdcc2[_0x8b75('0x57')]=_0x37d21a;return _0x4bdcc2;})[_0x8b75('0x39')](respondWithFilteredResult(_0x118794,_0x2c3e4c))[_0x8b75('0x2d')](handleError(_0x118794,null));};exports[_0x8b75('0x58')]=function(_0x23df4c,_0x8318a3){var _0x25321e={'raw':!![],'where':{'id':_0x23df4c[_0x8b75('0x59')]['id']}},_0x2e41e8={};_0x2e41e8['model']=_[_0x8b75('0x5a')](db[_0x8b75('0x40')]['rawAttributes']);_0x2e41e8['query']=_[_0x8b75('0x5a')](_0x23df4c[_0x8b75('0x45')]);_0x2e41e8['filters']=_[_0x8b75('0x47')](_0x2e41e8['model'],_0x2e41e8[_0x8b75('0x45')]);_0x25321e['attributes']=_[_0x8b75('0x47')](_0x2e41e8[_0x8b75('0x48')],qs['fields'](_0x23df4c[_0x8b75('0x45')][_0x8b75('0x4a')]));_0x25321e[_0x8b75('0x49')]=_0x25321e[_0x8b75('0x49')][_0x8b75('0x4b')]?_0x25321e[_0x8b75('0x49')]:_0x2e41e8[_0x8b75('0x48')];if(_0x23df4c['query']['includeAll']){_0x25321e['include']=[{'all':!![]}];}_0x25321e=_[_0x8b75('0x53')]({},_0x25321e,_0x23df4c[_0x8b75('0x5b')]);return db[_0x8b75('0x40')][_0x8b75('0x5c')](_0x25321e)[_0x8b75('0x39')](handleEntityNotFound(_0x8318a3,null))[_0x8b75('0x39')](respondWithResult(_0x8318a3,null))[_0x8b75('0x2d')](handleError(_0x8318a3,null));};exports[_0x8b75('0x5d')]=function(_0x1613e7,_0x253946){return db[_0x8b75('0x40')][_0x8b75('0x5d')](_0x1613e7[_0x8b75('0x5e')],{})[_0x8b75('0x39')](respondWithResult(_0x253946,0xc9))[_0x8b75('0x2d')](handleError(_0x253946,null));};exports[_0x8b75('0x38')]=function(_0x2cf0be,_0x36a80d){if(_0x2cf0be[_0x8b75('0x5e')]['id']){delete _0x2cf0be[_0x8b75('0x5e')]['id'];}return db[_0x8b75('0x40')][_0x8b75('0x5c')]({'where':{'id':_0x2cf0be[_0x8b75('0x59')]['id']}})[_0x8b75('0x39')](handleEntityNotFound(_0x36a80d,null))[_0x8b75('0x39')](saveUpdates(_0x2cf0be['body'],null))[_0x8b75('0x39')](respondWithResult(_0x36a80d,null))[_0x8b75('0x2d')](handleError(_0x36a80d,null));};exports[_0x8b75('0x3a')]=function(_0x1f4ec5,_0x4da7fe){return db[_0x8b75('0x40')][_0x8b75('0x5c')]({'where':{'id':_0x1f4ec5[_0x8b75('0x59')]['id']}})[_0x8b75('0x39')](handleEntityNotFound(_0x4da7fe,null))[_0x8b75('0x39')](removeEntity(_0x4da7fe,null))[_0x8b75('0x2d')](handleError(_0x4da7fe,null));};exports[_0x8b75('0x5f')]=function(_0x107ef5,_0x387be1){return db[_0x8b75('0x40')][_0x8b75('0x5f')]()[_0x8b75('0x39')](respondWithResult(_0x387be1,null))[_0x8b75('0x2d')](handleError(_0x387be1,null));};var interaction_log=require(_0x8b75('0x16'))(_0x8b75('0x60'));exports['accept']=function(_0x47676d,_0x352566,_0x33e6a1){var _0x531064={'agent':{},'channel':_0x8b75('0x61')};if(_0x47676d['body']['id']){delete _0x47676d[_0x8b75('0x5e')]['id'];}_0x47676d[_0x8b75('0x5e')][_0x8b75('0x62')]=!![];_0x47676d[_0x8b75('0x5e')][_0x8b75('0x63')]=moment()['format'](_0x8b75('0x64'));_0x47676d[_0x8b75('0x5e')]['UserId']=_0x47676d['body'][_0x8b75('0x65')]||_0x47676d[_0x8b75('0x66')]['id'];_0x531064[_0x8b75('0x67')]['id']=_0x47676d[_0x8b75('0x5e')][_0x8b75('0x65')];return db['SmsMessage'][_0x8b75('0x5c')]({'where':{'id':_0x47676d[_0x8b75('0x59')]['id'],'UserId':null}})[_0x8b75('0x39')](handleEntityNotFound(_0x352566,null))['then'](saveUpdates(_0x47676d['body'],null))['then'](function(_0x347a46){if(_0x347a46){_0x531064['message']=_0x347a46['get']({'plain':!![]});return db[_0x8b75('0x68')][_0x8b75('0x5c')]({'where':{'id':_0x347a46[_0x8b75('0x69')]}});}return null;})['then'](handleEntityNotFound(_0x352566,null))[_0x8b75('0x39')](function(_0x33f70d){if(_0x33f70d){return _0x33f70d[_0x8b75('0x38')]({'UserId':_0x47676d['body'][_0x8b75('0x65')],'read1stAt':_[_0x8b75('0x6a')](_0x33f70d[_0x8b75('0x6b')])?moment()[_0x8b75('0x6c')](_0x8b75('0x64')):undefined});}return null;})[_0x8b75('0x39')](function(_0x4fbf76){if(_0x4fbf76){_0x531064[_0x8b75('0x6d')]=_0x4fbf76[_0x8b75('0x6e')]({'plain':!![]});interaction_log[_0x8b75('0x23')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x47676d[_0x8b75('0x66')]['id'],_0x47676d[_0x8b75('0x66')][_0x8b75('0x3c')],_0x47676d[_0x8b75('0x66')][_0x8b75('0x6f')],_0x531064[_0x8b75('0x6d')]['id'],_0x47676d['body']?JSON[_0x8b75('0x28')](_0x47676d[_0x8b75('0x5e')]):_0x8b75('0x70'));return respondWithRpcPromise(_0x8b75('0x71'),_0x8b75('0x72'),_0x531064);}return null;})[_0x8b75('0x39')](function(_0x2d5a29){var _0x1157df=_0x8b75('0x73')+_0x2d5a29[_0x8b75('0x2b')][_0x8b75('0x74')];return db['sequelize']['query'](_0x1157df,{'type':db[_0x8b75('0x75')][_0x8b75('0x76')]['SELECT'],'raw':!![]})['then'](function(_0x330a1f){return _0x330a1f;});})[_0x8b75('0x39')](function(_0x3644dd){if(_0x3644dd){_0x531064['message'][_0x8b75('0x77')]=_0x3644dd[0x0];if(!_0x47676d[_0x8b75('0x5e')][_0x8b75('0x65')])return;return db[_0x8b75('0x78')][_0x8b75('0x5c')]({'where':{'id':_0x47676d[_0x8b75('0x5e')][_0x8b75('0x65')],'role':'agent'},'attributes':['id',_0x8b75('0x3c'),_0x8b75('0x79'),_0x8b75('0x7a'),_0x8b75('0x7b')],'raw':!![]});}return null;})[_0x8b75('0x39')](function(_0x135119){if(!_0x135119)return null;_0x531064[_0x8b75('0x2b')][_0x8b75('0x67')]=_0x135119;return _0x531064;})['then'](function(_0x26d292){if(_0x26d292){if(_0x47676d[_0x8b75('0x5e')][_0x8b75('0x7c')]){_0x531064[_0x8b75('0x2b')]['interface']=util[_0x8b75('0x6c')]('SIP/%s',_0x47676d[_0x8b75('0x66')][_0x8b75('0x3c')]);_0x531064[_0x8b75('0x2b')][_0x8b75('0x7d')]=_0x531064[_0x8b75('0x7d')];_0x531064[_0x8b75('0x2b')][_0x8b75('0x7e')]=_0x531064[_0x8b75('0x7d')];_0x531064[_0x8b75('0x2b')][_0x8b75('0x7f')]='accept';return respondWithRpcPromise(_0x8b75('0x80'),_0x8b75('0x80'),{'event':_0x8b75('0x81'),'message':_0x531064[_0x8b75('0x2b')]},client9002)[_0x8b75('0x39')](function(){return _0x531064;});}return _0x531064;}return null;})[_0x8b75('0x39')](respondWithResult(_0x352566,null))[_0x8b75('0x2d')](handleError(_0x352566,null));};var interaction_log=require(_0x8b75('0x16'))('sms-interactions');exports['reject']=function(_0x4592c6,_0x42629c,_0xd8fc2c){var _0x166a94={'agent':{},'channel':_0x8b75('0x61')};if(_0x4592c6['body']['id']){delete _0x4592c6[_0x8b75('0x5e')]['id'];}_0x4592c6['body']['UserId']=_0x4592c6['body'][_0x8b75('0x65')]||_0x4592c6[_0x8b75('0x66')]['id'];_0x166a94[_0x8b75('0x67')]['id']=_0x4592c6['body']['UserId'];return db['SmsMessage'][_0x8b75('0x5c')]({'where':{'id':_0x4592c6[_0x8b75('0x59')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x42629c,null))[_0x8b75('0x39')](function(_0x4156c2){if(_0x4156c2){_0x166a94[_0x8b75('0x2b')]=_0x4156c2[_0x8b75('0x6e')]({'plain':!![]});return db[_0x8b75('0x68')]['find']({'where':{'id':_0x4156c2[_0x8b75('0x69')]}});}return null;})[_0x8b75('0x39')](handleEntityNotFound(_0x42629c,null))[_0x8b75('0x39')](function(_0x55aa90){if(_0x55aa90){_0x166a94[_0x8b75('0x6d')]=_0x55aa90[_0x8b75('0x6e')]({'plain':!![]});interaction_log[_0x8b75('0x23')](_0x8b75('0x82'),_0x4592c6[_0x8b75('0x66')]['id'],_0x4592c6[_0x8b75('0x66')][_0x8b75('0x3c')],_0x4592c6[_0x8b75('0x66')][_0x8b75('0x6f')],_0x166a94[_0x8b75('0x6d')]['id'],_0x4592c6[_0x8b75('0x5e')]?JSON[_0x8b75('0x28')](_0x4592c6[_0x8b75('0x5e')]):'null');return respondWithRpcPromise(_0x8b75('0x83'),'rejectMessage',_0x166a94);}return null;})[_0x8b75('0x39')](function(_0x134c68){var _0x498e8f=_0x8b75('0x73')+_0x134c68[_0x8b75('0x2b')]['ContactId'];return db['sequelize'][_0x8b75('0x45')](_0x498e8f,{'type':db[_0x8b75('0x75')][_0x8b75('0x76')][_0x8b75('0x84')],'raw':!![]})['then'](function(_0x5975f2){return _0x5975f2;});})['then'](function(_0x23c392){if(_0x23c392){_0x166a94['message']['contact']=_0x23c392[0x0];if(!_0x4592c6[_0x8b75('0x5e')][_0x8b75('0x65')])return;return db[_0x8b75('0x78')][_0x8b75('0x5c')]({'where':{'id':_0x4592c6[_0x8b75('0x5e')][_0x8b75('0x65')],'role':'agent'},'attributes':['id',_0x8b75('0x3c'),_0x8b75('0x79'),_0x8b75('0x7a'),'internal'],'raw':!![]});}return null;})[_0x8b75('0x39')](function(_0x17d133){if(!_0x17d133)return null;_0x166a94[_0x8b75('0x2b')][_0x8b75('0x67')]=_0x17d133;return _0x166a94;})[_0x8b75('0x39')](function(_0x216b93){if(_0x216b93){_0x216b93[_0x8b75('0x2b')][_0x8b75('0x85')]=util[_0x8b75('0x6c')](_0x8b75('0x86'),_0x4592c6[_0x8b75('0x66')][_0x8b75('0x3c')]);_0x216b93[_0x8b75('0x2b')][_0x8b75('0x7d')]=_0x166a94['channel'];_0x216b93[_0x8b75('0x2b')][_0x8b75('0x7e')]=_0x166a94[_0x8b75('0x7d')];_0x216b93[_0x8b75('0x2b')][_0x8b75('0x7f')]=_0x8b75('0x36');respondWithRpcPromise(_0x8b75('0x80'),_0x8b75('0x80'),{'event':'rejectmessage','message':_0x216b93[_0x8b75('0x2b')]},client9002);return _0x166a94;}return null;})[_0x8b75('0x39')](respondWithResult(_0x42629c,null))[_0x8b75('0x2d')](handleError(_0x42629c,null));};exports['status']=function(_0x4352c0,_0x4de111,_0x56fd02){if(_0x4352c0[_0x8b75('0x5e')]['id']){delete _0x4352c0[_0x8b75('0x5e')]['id'];}var _0x5a70e6;return db[_0x8b75('0x40')][_0x8b75('0x5c')]({'where':{'id':_0x4352c0[_0x8b75('0x59')]['id']}})['then'](handleEntityNotFound(_0x4de111,null))[_0x8b75('0x39')](function(_0x3fc78e){if(_0x3fc78e){_0x5a70e6=_0x3fc78e;return db['SmsAccount'][_0x8b75('0x5c')]({'where':{'id':_0x3fc78e[_0x8b75('0x87')]}});}})[_0x8b75('0x39')](handleEntityNotFound(_0x4de111,null))[_0x8b75('0x39')](function(_0x19133e){if(_0x19133e){logger['debug'](_0x8b75('0x27'),_0x8b75('0x2f'),_0x8b75('0x88'),_0x19133e[_0x8b75('0x43')],util[_0x8b75('0x89')](_0x4352c0[_0x8b75('0x5e')],{'showHidden':![],'depth':null}));switch(_0x19133e['type']){case'twilio':if(_0x4352c0[_0x8b75('0x5e')][_0x8b75('0x8a')]&&_0x4352c0[_0x8b75('0x5e')][_0x8b75('0x8a')]===_0x5a70e6[_0x8b75('0x8b')]){return _0x5a70e6[_0x8b75('0x38')]({'read':!![]});}else{logger[_0x8b75('0x29')](_0x8b75('0x8c'),_0x8b75('0x2f'),_0x8b75('0x8d'),util[_0x8b75('0x89')](_0x4352c0[_0x8b75('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x8b75('0x8e'):if(_0x4352c0['body'][_0x8b75('0x8f')]&&_0x4352c0['body'][_0x8b75('0x8f')]===_0x5a70e6['messageId']&&_[_0x8b75('0x90')]([_0x8b75('0x91'),_0x8b75('0x92')],_0x4352c0['body']['Status'])>=0x0){return _0x5a70e6[_0x8b75('0x38')]({'read':!![]});}else{logger[_0x8b75('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x8b75('0x2f'),_0x8b75('0x93'),util[_0x8b75('0x89')](_0x4352c0[_0x8b75('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x8b75('0x94'):var _0x41d0aa=_0x4352c0['body'][_0x8b75('0x95')][0x0];if(_0x41d0aa[_0x8b75('0x2f')]['groupName']===_0x8b75('0x96')){return _0x5a70e6[_0x8b75('0x38')]({'read':!![]});}else{logger[_0x8b75('0x29')](_0x8b75('0x8c'),'status',_0x8b75('0x94'),util[_0x8b75('0x89')](_0x4352c0[_0x8b75('0x5e')],{'showHidden':![],'depth':null}));}break;}return _0x5a70e6;}})[_0x8b75('0x39')](respondWithResult(_0x4de111,null))[_0x8b75('0x2d')](handleError(_0x4de111,null));}; \ No newline at end of file +var _0x3d2f=['SmsMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','SmsMessage','rawAttributes','type','key','model','query','attributes','intersection','fields','length','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','keys','find','create','body','params','describe','sms-interactions','accept','read','UserId','user','agent','get','SmsInteraction','isNil','read1stAt','format','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','EventManager','sms','SmsInteractionId','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','QueryTypes','event','rejectmessage','SmsAccount','received\x20delivery\x20report\x20from','inspect','MessageSid','messageId','twilio','plivo','MessageUUID','indexOf','delivered','infobip','results','DELIVERED','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','./smsMessage.socket','register','jayson/promise','client','http','request','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2cfb48,_0x24b83b){var _0xc4594f=function(_0x3bc089){while(--_0x3bc089){_0x2cfb48['push'](_0x2cfb48['shift']());}};_0xc4594f(++_0x24b83b);}(_0x3d2f,0x18f));var _0xf3d2=function(_0x575bf3,_0x4d6f17){_0x575bf3=_0x575bf3-0x0;var _0x1e98d5=_0x3d2f[_0x575bf3];return _0x1e98d5;};'use strict';var emlformat=require(_0xf3d2('0x0'));var rimraf=require(_0xf3d2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf3d2('0x2'));var rp=require(_0xf3d2('0x3'));var moment=require(_0xf3d2('0x4'));var BPromise=require(_0xf3d2('0x5'));var Mustache=require(_0xf3d2('0x6'));var util=require(_0xf3d2('0x7'));var path=require(_0xf3d2('0x8'));var sox=require('sox');var csv=require(_0xf3d2('0x9'));var ejs=require(_0xf3d2('0xa'));var fs=require('fs');var fs_extra=require(_0xf3d2('0xb'));var _=require(_0xf3d2('0xc'));var squel=require(_0xf3d2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf3d2('0xe'));var deskjs=require(_0xf3d2('0xf'));var toCsv=require('to-csv');var querystring=require(_0xf3d2('0x10'));var Papa=require('papaparse');var Redis=require(_0xf3d2('0x11'));var authService=require(_0xf3d2('0x12'));var qs=require(_0xf3d2('0x13'));var as=require(_0xf3d2('0x14'));var hardwareService=require(_0xf3d2('0x15'));var logger=require(_0xf3d2('0x16'))('api');var utils=require(_0xf3d2('0x17'));var config=require(_0xf3d2('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xf3d2('0x19'))['db'];config['redis']=_[_0xf3d2('0x1a')](config[_0xf3d2('0x1b')],{'host':_0xf3d2('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf3d2('0x1b')]));require(_0xf3d2('0x1d'))[_0xf3d2('0x1e')](socket);var jayson=require(_0xf3d2('0x1f'));var client=jayson[_0xf3d2('0x20')][_0xf3d2('0x21')]({'port':0x232c});var client9002=jayson['client'][_0xf3d2('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x892094,_0x3a43f6,_0x24cfc1,_0x92ba9c){return new BPromise(function(_0x3daaaf,_0x3f66a2){var _0x171875=_0x92ba9c||client;return _0x171875[_0xf3d2('0x22')](_0x892094,_0x24cfc1)['then'](function(_0x454ab3){logger[_0xf3d2('0x23')]('SmsMessage,\x20%s,\x20%s',_0x3a43f6,_0xf3d2('0x24'));logger[_0xf3d2('0x25')](_0xf3d2('0x26'),_0x3a43f6,'request\x20sent',JSON[_0xf3d2('0x27')](_0x454ab3));if(_0x454ab3[_0xf3d2('0x28')]){if(_0x454ab3[_0xf3d2('0x28')][_0xf3d2('0x29')]===0x1f4){logger[_0xf3d2('0x28')](_0xf3d2('0x2a'),_0x3a43f6,_0x454ab3[_0xf3d2('0x28')][_0xf3d2('0x2b')]);return _0x3f66a2(_0x454ab3[_0xf3d2('0x28')][_0xf3d2('0x2b')]);}logger['error'](_0xf3d2('0x2a'),_0x3a43f6,_0x454ab3[_0xf3d2('0x28')][_0xf3d2('0x2b')]);return _0x3daaaf(_0x454ab3[_0xf3d2('0x28')][_0xf3d2('0x2b')]);}else{logger[_0xf3d2('0x23')](_0xf3d2('0x2a'),_0x3a43f6,_0xf3d2('0x24'));_0x3daaaf(_0x454ab3[_0xf3d2('0x2c')]['message']);}})[_0xf3d2('0x2d')](function(_0x1c6ae5){logger['error'](_0xf3d2('0x2a'),_0x3a43f6,_0x1c6ae5);_0x3f66a2(_0x1c6ae5);});});}function respondWithStatusCode(_0x5e3509,_0x354107){_0x354107=_0x354107||0xcc;return function(_0x50e9e7){if(_0x50e9e7){return _0x5e3509[_0xf3d2('0x2e')](_0x354107);}return _0x5e3509[_0xf3d2('0x2f')](_0x354107)['end']();};}function respondWithResult(_0x5f298d,_0x3ea85d){_0x3ea85d=_0x3ea85d||0xc8;return function(_0x135191){if(_0x135191){return _0x5f298d[_0xf3d2('0x2f')](_0x3ea85d)['json'](_0x135191);}};}function respondWithFilteredResult(_0x2ff7c5,_0x3cdb21){return function(_0x39e846){if(_0x39e846){var _0x5c866d=typeof _0x3cdb21[_0xf3d2('0x30')]===_0xf3d2('0x31')&&typeof _0x3cdb21['limit']==='undefined';var _0x187c53=_0x39e846[_0xf3d2('0x32')];var _0x374583=_0x5c866d?0x0:_0x3cdb21['offset'];var _0x357e2f=_0x5c866d?_0x39e846[_0xf3d2('0x32')]:_0x3cdb21[_0xf3d2('0x30')]+_0x3cdb21[_0xf3d2('0x33')];var _0x5df3a2;if(_0x357e2f>=_0x187c53){_0x357e2f=_0x187c53;_0x5df3a2=0xc8;}else{_0x5df3a2=0xce;}_0x2ff7c5['status'](_0x5df3a2);return _0x2ff7c5[_0xf3d2('0x34')](_0xf3d2('0x35'),_0x374583+'-'+_0x357e2f+'/'+_0x187c53)['json'](_0x39e846);}return null;};}function patchUpdates(_0x4cfa13){return function(_0x20bc74){try{jsonpatch[_0xf3d2('0x36')](_0x20bc74,_0x4cfa13,!![]);}catch(_0xda56df){return BPromise[_0xf3d2('0x37')](_0xda56df);}return _0x20bc74[_0xf3d2('0x38')]();};}function saveUpdates(_0xa17d5,_0x3dad62){return function(_0x165144){if(_0x165144){return _0x165144[_0xf3d2('0x39')](_0xa17d5)[_0xf3d2('0x3a')](function(_0x3315c0){return _0x3315c0;});}return null;};}function removeEntity(_0x4ba7c5,_0x4dcf90){return function(_0x13348f){if(_0x13348f){return _0x13348f[_0xf3d2('0x3b')]()[_0xf3d2('0x3a')](function(){_0x4ba7c5[_0xf3d2('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x23051e,_0x12be59){return function(_0x2c81b3){if(!_0x2c81b3){_0x23051e[_0xf3d2('0x2e')](0x194);}return _0x2c81b3;};}function handleError(_0x96fa1b,_0x26d9d2){_0x26d9d2=_0x26d9d2||0x1f4;return function(_0xb3dc39){logger['error'](_0xb3dc39[_0xf3d2('0x3c')]);if(_0xb3dc39[_0xf3d2('0x3d')]){delete _0xb3dc39[_0xf3d2('0x3d')];}_0x96fa1b['status'](_0x26d9d2)[_0xf3d2('0x3e')](_0xb3dc39);};}exports[_0xf3d2('0x3f')]=function(_0x5d830c,_0x59d092){var _0x1f6bd6={},_0x39f2a3={},_0x31ab4b={'count':0x0,'rows':[]};var _0x2927f6=_[_0xf3d2('0x40')](db[_0xf3d2('0x41')][_0xf3d2('0x42')],function(_0x3a2988){return{'name':_0x3a2988['fieldName'],'type':_0x3a2988[_0xf3d2('0x43')][_0xf3d2('0x44')]};});_0x39f2a3[_0xf3d2('0x45')]=_['map'](_0x2927f6,_0xf3d2('0x3d'));_0x39f2a3[_0xf3d2('0x46')]=_['keys'](_0x5d830c[_0xf3d2('0x46')]);_0x39f2a3['filters']=_['intersection'](_0x39f2a3[_0xf3d2('0x45')],_0x39f2a3[_0xf3d2('0x46')]);_0x1f6bd6[_0xf3d2('0x47')]=_[_0xf3d2('0x48')](_0x39f2a3[_0xf3d2('0x45')],qs['fields'](_0x5d830c[_0xf3d2('0x46')][_0xf3d2('0x49')]));_0x1f6bd6['attributes']=_0x1f6bd6['attributes'][_0xf3d2('0x4a')]?_0x1f6bd6[_0xf3d2('0x47')]:_0x39f2a3[_0xf3d2('0x45')];if(!_0x5d830c[_0xf3d2('0x46')]['hasOwnProperty']('nolimit')){_0x1f6bd6[_0xf3d2('0x33')]=qs[_0xf3d2('0x33')](_0x5d830c[_0xf3d2('0x46')][_0xf3d2('0x33')]);_0x1f6bd6['offset']=qs[_0xf3d2('0x30')](_0x5d830c[_0xf3d2('0x46')]['offset']);}_0x1f6bd6['order']=qs[_0xf3d2('0x4b')](_0x5d830c[_0xf3d2('0x46')][_0xf3d2('0x4b')]);_0x1f6bd6[_0xf3d2('0x4c')]=qs[_0xf3d2('0x4d')](_[_0xf3d2('0x4e')](_0x5d830c[_0xf3d2('0x46')],_0x39f2a3[_0xf3d2('0x4d')]),_0x2927f6);if(_0x5d830c[_0xf3d2('0x46')][_0xf3d2('0x4f')]){_0x1f6bd6['where']=_[_0xf3d2('0x50')](_0x1f6bd6[_0xf3d2('0x4c')],{'$or':_[_0xf3d2('0x40')](_0x2927f6,function(_0x50339c){if(_0x50339c[_0xf3d2('0x43')]!==_0xf3d2('0x51')){var _0x3b1540={};_0x3b1540[_0x50339c[_0xf3d2('0x3d')]]={'$like':'%'+_0x5d830c['query'][_0xf3d2('0x4f')]+'%'};return _0x3b1540;}})});}_0x1f6bd6=_[_0xf3d2('0x50')]({},_0x1f6bd6,_0x5d830c[_0xf3d2('0x52')]);var _0x433f81={'where':_0x1f6bd6[_0xf3d2('0x4c')]};return db[_0xf3d2('0x41')][_0xf3d2('0x32')](_0x433f81)[_0xf3d2('0x3a')](function(_0xe1f0e3){_0x31ab4b[_0xf3d2('0x32')]=_0xe1f0e3;if(_0x5d830c[_0xf3d2('0x46')][_0xf3d2('0x53')]){_0x1f6bd6[_0xf3d2('0x54')]=[{'all':!![]}];}return db[_0xf3d2('0x41')][_0xf3d2('0x55')](_0x1f6bd6);})[_0xf3d2('0x3a')](function(_0x9948bf){_0x31ab4b['rows']=_0x9948bf;return _0x31ab4b;})[_0xf3d2('0x3a')](respondWithFilteredResult(_0x59d092,_0x1f6bd6))[_0xf3d2('0x2d')](handleError(_0x59d092,null));};exports[_0xf3d2('0x56')]=function(_0x3270a1,_0xd3ccb2){var _0x902184={'raw':!![],'where':{'id':_0x3270a1['params']['id']}},_0x28a76d={};_0x28a76d['model']=_[_0xf3d2('0x57')](db[_0xf3d2('0x41')][_0xf3d2('0x42')]);_0x28a76d[_0xf3d2('0x46')]=_[_0xf3d2('0x57')](_0x3270a1[_0xf3d2('0x46')]);_0x28a76d[_0xf3d2('0x4d')]=_[_0xf3d2('0x48')](_0x28a76d['model'],_0x28a76d[_0xf3d2('0x46')]);_0x902184[_0xf3d2('0x47')]=_[_0xf3d2('0x48')](_0x28a76d[_0xf3d2('0x45')],qs[_0xf3d2('0x49')](_0x3270a1[_0xf3d2('0x46')][_0xf3d2('0x49')]));_0x902184[_0xf3d2('0x47')]=_0x902184['attributes']['length']?_0x902184[_0xf3d2('0x47')]:_0x28a76d[_0xf3d2('0x45')];if(_0x3270a1[_0xf3d2('0x46')][_0xf3d2('0x53')]){_0x902184['include']=[{'all':!![]}];}_0x902184=_['merge']({},_0x902184,_0x3270a1[_0xf3d2('0x52')]);return db['SmsMessage'][_0xf3d2('0x58')](_0x902184)['then'](handleEntityNotFound(_0xd3ccb2,null))[_0xf3d2('0x3a')](respondWithResult(_0xd3ccb2,null))[_0xf3d2('0x2d')](handleError(_0xd3ccb2,null));};exports[_0xf3d2('0x59')]=function(_0x5a6ebd,_0x46688a){return db[_0xf3d2('0x41')][_0xf3d2('0x59')](_0x5a6ebd[_0xf3d2('0x5a')],{})[_0xf3d2('0x3a')](respondWithResult(_0x46688a,0xc9))[_0xf3d2('0x2d')](handleError(_0x46688a,null));};exports['update']=function(_0x3a2858,_0x310e4e){if(_0x3a2858[_0xf3d2('0x5a')]['id']){delete _0x3a2858['body']['id'];}return db[_0xf3d2('0x41')][_0xf3d2('0x58')]({'where':{'id':_0x3a2858[_0xf3d2('0x5b')]['id']}})[_0xf3d2('0x3a')](handleEntityNotFound(_0x310e4e,null))['then'](saveUpdates(_0x3a2858[_0xf3d2('0x5a')],null))[_0xf3d2('0x3a')](respondWithResult(_0x310e4e,null))[_0xf3d2('0x2d')](handleError(_0x310e4e,null));};exports[_0xf3d2('0x3b')]=function(_0x2b0668,_0xd7328b){return db[_0xf3d2('0x41')][_0xf3d2('0x58')]({'where':{'id':_0x2b0668['params']['id']}})[_0xf3d2('0x3a')](handleEntityNotFound(_0xd7328b,null))['then'](removeEntity(_0xd7328b,null))['catch'](handleError(_0xd7328b,null));};exports[_0xf3d2('0x5c')]=function(_0x1fecf4,_0x44efb3){return db[_0xf3d2('0x41')][_0xf3d2('0x5c')]()['then'](respondWithResult(_0x44efb3,null))[_0xf3d2('0x2d')](handleError(_0x44efb3,null));};var interaction_log=require(_0xf3d2('0x16'))(_0xf3d2('0x5d'));exports[_0xf3d2('0x5e')]=function(_0xd3dfee,_0x2ecbac,_0x10cd6a){var _0x434fc3={'agent':{},'channel':'sms'};if(_0xd3dfee['body']['id']){delete _0xd3dfee[_0xf3d2('0x5a')]['id'];}_0xd3dfee['body'][_0xf3d2('0x5f')]=!![];_0xd3dfee[_0xf3d2('0x5a')]['readAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0xd3dfee[_0xf3d2('0x5a')][_0xf3d2('0x60')]=_0xd3dfee[_0xf3d2('0x5a')][_0xf3d2('0x60')]||_0xd3dfee[_0xf3d2('0x61')]['id'];_0x434fc3[_0xf3d2('0x62')]['id']=_0xd3dfee[_0xf3d2('0x5a')]['UserId'];return db[_0xf3d2('0x41')][_0xf3d2('0x58')]({'where':{'id':_0xd3dfee['params']['id'],'UserId':null}})[_0xf3d2('0x3a')](handleEntityNotFound(_0x2ecbac,null))['then'](saveUpdates(_0xd3dfee['body'],null))['then'](function(_0x5bdf27){if(_0x5bdf27){_0x434fc3[_0xf3d2('0x2b')]=_0x5bdf27[_0xf3d2('0x63')]({'plain':!![]});return db[_0xf3d2('0x64')][_0xf3d2('0x58')]({'where':{'id':_0x5bdf27['SmsInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x2ecbac,null))[_0xf3d2('0x3a')](function(_0x15ca80){if(_0x15ca80){return _0x15ca80['update']({'UserId':_0xd3dfee['body']['UserId'],'read1stAt':_[_0xf3d2('0x65')](_0x15ca80[_0xf3d2('0x66')])?moment()[_0xf3d2('0x67')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xf3d2('0x3a')](function(_0x3a3685){if(_0x3a3685){_0x434fc3[_0xf3d2('0x68')]=_0x3a3685[_0xf3d2('0x63')]({'plain':!![]});interaction_log[_0xf3d2('0x23')](_0xf3d2('0x69'),_0xd3dfee[_0xf3d2('0x61')]['id'],_0xd3dfee[_0xf3d2('0x61')][_0xf3d2('0x3d')],_0xd3dfee[_0xf3d2('0x61')][_0xf3d2('0x6a')],_0x434fc3[_0xf3d2('0x68')]['id'],_0xd3dfee[_0xf3d2('0x5a')]?JSON[_0xf3d2('0x27')](_0xd3dfee['body']):'null');return respondWithRpcPromise(_0xf3d2('0x6b'),_0xf3d2('0x6c'),_0x434fc3);}return null;})[_0xf3d2('0x3a')](function(_0x1742a5){var _0x22ca68=_0xf3d2('0x6d')+_0x1742a5[_0xf3d2('0x2b')][_0xf3d2('0x6e')];return db[_0xf3d2('0x6f')][_0xf3d2('0x46')](_0x22ca68,{'type':db[_0xf3d2('0x70')]['QueryTypes'][_0xf3d2('0x71')],'raw':!![]})[_0xf3d2('0x3a')](function(_0x44f303){return _0x44f303;});})[_0xf3d2('0x3a')](function(_0x2e6123){if(_0x2e6123){_0x434fc3[_0xf3d2('0x2b')][_0xf3d2('0x72')]=_0x2e6123[0x0];if(!_0xd3dfee[_0xf3d2('0x5a')][_0xf3d2('0x60')])return;return db[_0xf3d2('0x73')][_0xf3d2('0x58')]({'where':{'id':_0xd3dfee[_0xf3d2('0x5a')][_0xf3d2('0x60')],'role':_0xf3d2('0x62')},'attributes':['id','name',_0xf3d2('0x74'),_0xf3d2('0x75'),_0xf3d2('0x76')],'raw':!![]});}return null;})[_0xf3d2('0x3a')](function(_0x5b9bab){if(!_0x5b9bab)return null;_0x434fc3['message'][_0xf3d2('0x62')]=_0x5b9bab;return _0x434fc3;})['then'](function(_0x89d7b0){if(_0x89d7b0){if(_0xd3dfee[_0xf3d2('0x5a')][_0xf3d2('0x77')]){_0x434fc3[_0xf3d2('0x2b')][_0xf3d2('0x78')]=util[_0xf3d2('0x67')](_0xf3d2('0x79'),_0xd3dfee[_0xf3d2('0x61')][_0xf3d2('0x3d')]);_0x434fc3[_0xf3d2('0x2b')][_0xf3d2('0x7a')]=_0x434fc3[_0xf3d2('0x7a')];_0x434fc3[_0xf3d2('0x2b')][_0xf3d2('0x7b')]=_0x434fc3[_0xf3d2('0x7a')];_0x434fc3[_0xf3d2('0x2b')]['event']=_0xf3d2('0x5e');return respondWithRpcPromise(_0xf3d2('0x7c'),_0xf3d2('0x7c'),{'event':'acceptmessage','message':_0x434fc3[_0xf3d2('0x2b')]},client9002)[_0xf3d2('0x3a')](function(){return _0x434fc3;});}return _0x434fc3;}return null;})[_0xf3d2('0x3a')](respondWithResult(_0x2ecbac,null))[_0xf3d2('0x2d')](handleError(_0x2ecbac,null));};var interaction_log=require(_0xf3d2('0x16'))(_0xf3d2('0x5d'));exports[_0xf3d2('0x37')]=function(_0x5534cd,_0x5cb2a9,_0x174e43){var _0x2bdd8e={'agent':{},'channel':_0xf3d2('0x7d')};if(_0x5534cd['body']['id']){delete _0x5534cd[_0xf3d2('0x5a')]['id'];}_0x5534cd[_0xf3d2('0x5a')][_0xf3d2('0x60')]=_0x5534cd[_0xf3d2('0x5a')][_0xf3d2('0x60')]||_0x5534cd[_0xf3d2('0x61')]['id'];_0x2bdd8e[_0xf3d2('0x62')]['id']=_0x5534cd[_0xf3d2('0x5a')][_0xf3d2('0x60')];return db[_0xf3d2('0x41')][_0xf3d2('0x58')]({'where':{'id':_0x5534cd[_0xf3d2('0x5b')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5cb2a9,null))[_0xf3d2('0x3a')](function(_0x158c00){if(_0x158c00){_0x2bdd8e[_0xf3d2('0x2b')]=_0x158c00['get']({'plain':!![]});return db['SmsInteraction'][_0xf3d2('0x58')]({'where':{'id':_0x158c00[_0xf3d2('0x7e')]}});}return null;})['then'](handleEntityNotFound(_0x5cb2a9,null))[_0xf3d2('0x3a')](function(_0x1c98a3){if(_0x1c98a3){_0x2bdd8e[_0xf3d2('0x68')]=_0x1c98a3[_0xf3d2('0x63')]({'plain':!![]});interaction_log['info'](_0xf3d2('0x7f'),_0x5534cd['user']['id'],_0x5534cd[_0xf3d2('0x61')][_0xf3d2('0x3d')],_0x5534cd['user'][_0xf3d2('0x6a')],_0x2bdd8e[_0xf3d2('0x68')]['id'],_0x5534cd[_0xf3d2('0x5a')]?JSON[_0xf3d2('0x27')](_0x5534cd[_0xf3d2('0x5a')]):_0xf3d2('0x80'));return respondWithRpcPromise(_0xf3d2('0x81'),_0xf3d2('0x82'),_0x2bdd8e);}return null;})[_0xf3d2('0x3a')](function(_0x513c99){var _0x2d1f5d='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x513c99['message'][_0xf3d2('0x6e')];return db[_0xf3d2('0x6f')][_0xf3d2('0x46')](_0x2d1f5d,{'type':db[_0xf3d2('0x70')][_0xf3d2('0x83')][_0xf3d2('0x71')],'raw':!![]})[_0xf3d2('0x3a')](function(_0x392e9b){return _0x392e9b;});})[_0xf3d2('0x3a')](function(_0x1cdd23){if(_0x1cdd23){_0x2bdd8e[_0xf3d2('0x2b')]['contact']=_0x1cdd23[0x0];if(!_0x5534cd[_0xf3d2('0x5a')]['UserId'])return;return db[_0xf3d2('0x73')][_0xf3d2('0x58')]({'where':{'id':_0x5534cd[_0xf3d2('0x5a')][_0xf3d2('0x60')],'role':'agent'},'attributes':['id','name','fullname',_0xf3d2('0x75'),_0xf3d2('0x76')],'raw':!![]});}return null;})[_0xf3d2('0x3a')](function(_0x5ab9c){if(!_0x5ab9c)return null;_0x2bdd8e[_0xf3d2('0x2b')][_0xf3d2('0x62')]=_0x5ab9c;return _0x2bdd8e;})[_0xf3d2('0x3a')](function(_0x2bbe3d){if(_0x2bbe3d){_0x2bbe3d[_0xf3d2('0x2b')][_0xf3d2('0x78')]=util['format']('SIP/%s',_0x5534cd[_0xf3d2('0x61')]['name']);_0x2bbe3d['message'][_0xf3d2('0x7a')]=_0x2bdd8e[_0xf3d2('0x7a')];_0x2bbe3d[_0xf3d2('0x2b')]['motionChannel']=_0x2bdd8e[_0xf3d2('0x7a')];_0x2bbe3d[_0xf3d2('0x2b')][_0xf3d2('0x84')]='reject';respondWithRpcPromise(_0xf3d2('0x7c'),'EventManager',{'event':_0xf3d2('0x85'),'message':_0x2bbe3d[_0xf3d2('0x2b')]},client9002);return _0x2bdd8e;}return null;})[_0xf3d2('0x3a')](respondWithResult(_0x5cb2a9,null))['catch'](handleError(_0x5cb2a9,null));};exports[_0xf3d2('0x2f')]=function(_0x5bdea6,_0x749438,_0x9b08d1){if(_0x5bdea6[_0xf3d2('0x5a')]['id']){delete _0x5bdea6[_0xf3d2('0x5a')]['id'];}var _0x3cfe2e;return db[_0xf3d2('0x41')][_0xf3d2('0x58')]({'where':{'id':_0x5bdea6[_0xf3d2('0x5b')]['id']}})['then'](handleEntityNotFound(_0x749438,null))[_0xf3d2('0x3a')](function(_0x2eddeb){if(_0x2eddeb){_0x3cfe2e=_0x2eddeb;return db[_0xf3d2('0x86')]['find']({'where':{'id':_0x2eddeb['SmsAccountId']}});}})['then'](handleEntityNotFound(_0x749438,null))[_0xf3d2('0x3a')](function(_0x330c28){if(_0x330c28){logger[_0xf3d2('0x25')](_0xf3d2('0x26'),_0xf3d2('0x2f'),_0xf3d2('0x87'),_0x330c28[_0xf3d2('0x43')],util[_0xf3d2('0x88')](_0x5bdea6[_0xf3d2('0x5a')],{'showHidden':![],'depth':null}));switch(_0x330c28['type']){case'twilio':if(_0x5bdea6[_0xf3d2('0x5a')][_0xf3d2('0x89')]&&_0x5bdea6['body'][_0xf3d2('0x89')]===_0x3cfe2e[_0xf3d2('0x8a')]){return _0x3cfe2e[_0xf3d2('0x39')]({'read':!![]});}else{logger[_0xf3d2('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xf3d2('0x8b'),util[_0xf3d2('0x88')](_0x5bdea6['body'],{'showHidden':![],'depth':null}));}break;case _0xf3d2('0x8c'):if(_0x5bdea6[_0xf3d2('0x5a')][_0xf3d2('0x8d')]&&_0x5bdea6[_0xf3d2('0x5a')][_0xf3d2('0x8d')]===_0x3cfe2e[_0xf3d2('0x8a')]&&_[_0xf3d2('0x8e')](['sent',_0xf3d2('0x8f')],_0x5bdea6[_0xf3d2('0x5a')]['Status'])>=0x0){return _0x3cfe2e[_0xf3d2('0x39')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status','plivio',util[_0xf3d2('0x88')](_0x5bdea6['body'],{'showHidden':![],'depth':null}));}break;case _0xf3d2('0x90'):var _0x334e75=_0x5bdea6[_0xf3d2('0x5a')][_0xf3d2('0x91')][0x0];if(_0x334e75[_0xf3d2('0x2f')]['groupName']===_0xf3d2('0x92')){return _0x3cfe2e[_0xf3d2('0x39')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xf3d2('0x90'),util[_0xf3d2('0x88')](_0x5bdea6[_0xf3d2('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x3cfe2e;}})[_0xf3d2('0x3a')](respondWithResult(_0x749438,null))[_0xf3d2('0x2d')](handleError(_0x749438,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 0262bce..ec3c6ad 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 _0x45f5=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsMessage','save','update','remove'];(function(_0x4197d1,_0x3889f7){var _0x8d5c0=function(_0x43ec1b){while(--_0x43ec1b){_0x4197d1['push'](_0x4197d1['shift']());}};_0x8d5c0(++_0x3889f7);}(_0x45f5,0x1d0));var _0x545f=function(_0x2459fd,_0x575d9b){_0x2459fd=_0x2459fd-0x0;var _0x364cd2=_0x45f5[_0x2459fd];return _0x364cd2;};'use strict';var EventEmitter=require(_0x545f('0x0'));var SmsMessage=require(_0x545f('0x1'))['db'][_0x545f('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x545f('0x3'),'afterUpdate':_0x545f('0x4'),'afterDestroy':_0x545f('0x5')};function emitEvent(_0x4a278c){return function(_0x1db3a8,_0x2963b6,_0x236191){SmsMessageEvents[_0x545f('0x6')](_0x4a278c+':'+_0x1db3a8['id'],_0x1db3a8);SmsMessageEvents['emit'](_0x4a278c,_0x1db3a8);_0x236191(null);};}for(var e in events){if(events[_0x545f('0x7')](e)){var event=events[e];SmsMessage[_0x545f('0x8')](e,emitEvent(event));}}module[_0x545f('0x9')]=SmsMessageEvents; \ No newline at end of file +var _0x928e=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x36a5b9,_0x16b921){var _0x4c4261=function(_0x817673){while(--_0x817673){_0x36a5b9['push'](_0x36a5b9['shift']());}};_0x4c4261(++_0x16b921);}(_0x928e,0x177));var _0xe928=function(_0x51b499,_0x54b2b5){_0x51b499=_0x51b499-0x0;var _0x8a7947=_0x928e[_0x51b499];return _0x8a7947;};'use strict';var EventEmitter=require(_0xe928('0x0'));var SmsMessage=require(_0xe928('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xe928('0x2')](0x0);var events={'afterCreate':_0xe928('0x3'),'afterUpdate':_0xe928('0x4'),'afterDestroy':_0xe928('0x5')};function emitEvent(_0x3f04e7){return function(_0x3dc862,_0x7d98bf,_0x5c445b){SmsMessageEvents[_0xe928('0x6')](_0x3f04e7+':'+_0x3dc862['id'],_0x3dc862);SmsMessageEvents[_0xe928('0x6')](_0x3f04e7,_0x3dc862);_0x5c445b(null);};}for(var e in events){if(events[_0xe928('0x7')](e)){var event=events[e];SmsMessage[_0xe928('0x8')](e,emitEvent(event));}}module[_0xe928('0x9')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 4e6b6ad..000bdad 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 _0xfb8b=['/sms/2/text/advanced','application/json','IBSSO\x20','infobip','Missing\x20parameters:\x20base_url','csc','crypto','login','sender','text','timestamp','keys','apiKey','createHash','md5','digest','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','apiMessageId','%s:%s','accountId','/messages','applicationId','bandwidth','intelepeer','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','finally','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','./smsMessage.attributes','exports','define','sms_messages','messageId','body','models','get','toLowerCase','out','secret','isNil','SmsInteractionId','SmsInteraction','update','direction','catch','error','SmsAccount','SmsAccountId','then','type','twilio','accountSid','phone','authToken','messages','/api/sms/messages/','/status?token=','token','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','login?username=','&password=','GET','split','sms','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','xCALLY\x20Motion','format','Basic\x20%s','toString','base64','http_code','data','clickSend','remote','authId','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','plivo','baseUrl','/auth/1/session'];(function(_0x2be501,_0x5052ea){var _0x1fae7c=function(_0x5b1638){while(--_0x5b1638){_0x2be501['push'](_0x2be501['shift']());}};_0x1fae7c(++_0x5052ea);}(_0xfb8b,0x108));var _0xbfb8=function(_0x1867a7,_0x5adb74){_0x1867a7=_0x1867a7-0x0;var _0x58b13e=_0xfb8b[_0x1867a7];return _0x58b13e;};'use strict';var _=require(_0xbfb8('0x0'));var util=require('util');var logger=require(_0xbfb8('0x1'))(_0xbfb8('0x2'));var moment=require(_0xbfb8('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbfb8('0x4'));var rimraf=require(_0xbfb8('0x5'));var config=require(_0xbfb8('0x6'));var attributes=require(_0xbfb8('0x7'));module[_0xbfb8('0x8')]=function(_0x46349b,_0x500861){return _0x46349b[_0xbfb8('0x9')]('SmsMessage',attributes,{'tableName':_0xbfb8('0xa'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0xbfb8('0xb')]},{'name':'fti_sms_messages','fields':[_0xbfb8('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x38917b,_0x2c35ba,_0x2d9614){var _0x3c5000=_0x46349b[_0xbfb8('0xd')];var _0x16ade4=_0x38917b[_0xbfb8('0xe')]({'plain':!![]});if(_0x16ade4['direction'][_0xbfb8('0xf')]()==='in'||_0x16ade4['direction'][_0xbfb8('0xf')]()===_0xbfb8('0x10')&&!_0x16ade4[_0xbfb8('0x11')]&&!_[_0xbfb8('0x12')](_0x16ade4['UserId'])&&!_['isNil'](_0x16ade4[_0xbfb8('0x13')])){_0x3c5000[_0xbfb8('0x14')]['findOne']({'where':{'id':_0x16ade4['SmsInteractionId']}})['then'](function(_0x4f3e7a){if(_0x4f3e7a){_0x4f3e7a[_0xbfb8('0x15')]({'lastMsgAt':_0x16ade4['createdAt'],'lastMsgDirection':_0x16ade4[_0xbfb8('0x16')][_0xbfb8('0xf')]()});}})[_0xbfb8('0x17')](function(_0x4c0e30){console[_0xbfb8('0x18')](_0x4c0e30);});}if(_0x16ade4[_0xbfb8('0x16')]==='out'&&!_0x16ade4['secret']){var _0x2f444e;_0x3c5000[_0xbfb8('0x19')]['find']({'where':{'id':_0x16ade4[_0xbfb8('0x1a')]},'raw':!![]})[_0xbfb8('0x1b')](function(_0x4d9847){_0x2f444e=_0x4d9847;if(_0x2f444e&&_0x2f444e[_0xbfb8('0x1c')]){switch(_0x2f444e[_0xbfb8('0x1c')]){case'twilio':var _0x55bfe4=require(_0xbfb8('0x1d'));if(_0x2f444e[_0xbfb8('0x1e')]&&_0x2f444e['authToken']&&_0x2f444e[_0xbfb8('0x1f')]){var _0x2792e2=new _0x55bfe4(_0x2f444e[_0xbfb8('0x1e')],_0x2f444e[_0xbfb8('0x20')]);_0x2792e2[_0xbfb8('0x21')]['create']({'body':_0x16ade4['body'],'to':_0x16ade4['phone'],'from':_0x2f444e[_0xbfb8('0x1f')],'statusCallback':_0x2f444e['remote']+_0xbfb8('0x22')+_0x16ade4['id']+_0xbfb8('0x23')+_0x2f444e[_0xbfb8('0x24')]})['then'](function(_0x3ca041){if(_0x3ca041['sid']){return _0x38917b[_0xbfb8('0x15')]({'messageId':_0x3ca041['sid']});}})[_0xbfb8('0x17')](function(_0x336a21){logger[_0xbfb8('0x18')](_0xbfb8('0x25'),_0xbfb8('0x26'),_0xbfb8('0x1d'),util[_0xbfb8('0x27')](_0x336a21,{'showHidden':![],'depth':null}));});}else{logger[_0xbfb8('0x18')](_0xbfb8('0x25'),_0xbfb8('0x26'),_0xbfb8('0x1d'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0xbfb8('0x28'):var _0x4f80d8=_0xbfb8('0x29');if(_0x2f444e[_0xbfb8('0x2a')]&&_0x2f444e[_0xbfb8('0x2b')]){var _0xe3bbf1={'recipient':[_0x16ade4[_0xbfb8('0x1f')]],'message':_0x16ade4[_0xbfb8('0xc')],'message_type':_0x2f444e[_0xbfb8('0x2c')]};if(_0x2f444e[_0xbfb8('0x2c')]&&_0x2f444e['smsMethod']!=='SI'){_0xe3bbf1['sender']=_0x2f444e[_0xbfb8('0x1f')];}var _0x445a4f={'url':_0x4f80d8+_0xbfb8('0x2d')+_0x2f444e['username']+_0xbfb8('0x2e')+_0x2f444e[_0xbfb8('0x2b')],'method':_0xbfb8('0x2f')};rp(_0x445a4f)['then'](function(_0x77fb4b){var _0x53f4a7=_0x77fb4b[_0xbfb8('0x30')](';');var _0xc8b326={'user_key':_0x53f4a7[0x0],'session_key':_0x53f4a7[0x1]};_0x445a4f={'url':_0x4f80d8+_0xbfb8('0x31'),'method':_0xbfb8('0x32'),'headers':{'user_key':_0xc8b326[_0xbfb8('0x33')],'Session_key':_0xc8b326[_0xbfb8('0x34')]},'json':!![],'body':_0xe3bbf1};return rp(_0x445a4f);})['then'](function(_0x3bc16e){if(_0x3bc16e[_0xbfb8('0x35')]>=0x1){var _0x451683={'messageId':_0x3bc16e[_0xbfb8('0x36')]};if(_0x2f444e[_0xbfb8('0x2c')]!=='GP'||!_0x2f444e[_0xbfb8('0x37')]){_0x451683[_0xbfb8('0x38')]=!![];}return _0x38917b[_0xbfb8('0x15')](_0x451683);}else{return logger[_0xbfb8('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xbfb8('0x28'),util[_0xbfb8('0x27')](_0x3bc16e,{'showHidden':![],'depth':null}));}})[_0xbfb8('0x17')](function(_0xb12a67){return logger['error'](_0xbfb8('0x25'),_0xbfb8('0x26'),_0xbfb8('0x28'),util[_0xbfb8('0x27')](_0xb12a67,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xbfb8('0x25'),_0xbfb8('0x26'),_0xbfb8('0x28'),_0xbfb8('0x39'));}break;case _0xbfb8('0x3a'):if(_0x2f444e[_0xbfb8('0x20')]){var _0x3c4a58={'recipient':_0x16ade4['phone'],'message':_0x16ade4[_0xbfb8('0xc')],'sender':_0x2f444e[_0xbfb8('0x3b')]||_0x2f444e[_0xbfb8('0x1f')],'authorization':_0x2f444e[_0xbfb8('0x20')]};var _0x2c35ba={'method':_0xbfb8('0x32'),'uri':_0xbfb8('0x3c'),'body':_0x3c4a58,'json':!![]};rp(_0x2c35ba)[_0xbfb8('0x1b')](function(_0x250fca){var _0x21dcba={'messageId':_0x250fca[_0xbfb8('0x3d')]};if(!_0x2f444e[_0xbfb8('0x37')]){_0x21dcba[_0xbfb8('0x38')]=!![];}return _0x38917b[_0xbfb8('0x15')](_0x21dcba);})[_0xbfb8('0x17')](function(_0x51e89f){logger[_0xbfb8('0x18')](_0xbfb8('0x25'),'afterCreate','connectel',util[_0xbfb8('0x27')](_0x51e89f,{'showHidden':![],'depth':null}));});}else{logger[_0xbfb8('0x18')](_0xbfb8('0x25'),_0xbfb8('0x26'),_0xbfb8('0x3a'),_0xbfb8('0x3e'));}break;case'clicksend':if(_0x2f444e[_0xbfb8('0x2a')]&&_0x2f444e[_0xbfb8('0x2b')]){var _0x3c4a58={'messages':[{'source':_0xbfb8('0x3f'),'to':_0x16ade4[_0xbfb8('0x1f')],'body':_0x16ade4['body'],'from':_0x2f444e[_0xbfb8('0x3b')]||_0x2f444e[_0xbfb8('0x1f')]}]};var _0x279f96=util[_0xbfb8('0x40')]('%s:%s',_0x2f444e[_0xbfb8('0x2a')],_0x2f444e['password']);var _0x2c35ba={'method':_0xbfb8('0x32'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x3c4a58,'headers':{'Authorization':util['format'](_0xbfb8('0x41'),new Buffer(_0x279f96)[_0xbfb8('0x42')](_0xbfb8('0x43')))},'json':!![]};rp(_0x2c35ba)[_0xbfb8('0x1b')](function(_0x39f852){if(_0x39f852['http_code']>=0xc8&&_0x39f852[_0xbfb8('0x44')]<=0xce){if(_0x39f852[_0xbfb8('0x45')]&&_0x39f852[_0xbfb8('0x45')]['queued_count']>0x0){var _0x342392=_['head'](_0x39f852[_0xbfb8('0x45')][_0xbfb8('0x21')]);var _0x104baa={'messageId':_0x342392['message_id']};if(!_0x2f444e[_0xbfb8('0x37')]){_0x104baa[_0xbfb8('0x38')]=!![];}return _0x38917b[_0xbfb8('0x15')](_0x104baa);}else{logger[_0xbfb8('0x18')](_0xbfb8('0x25'),_0xbfb8('0x26'),'clickSend',util[_0xbfb8('0x27')](_0x39f852,{'showHidden':![],'depth':null}));}}else{logger[_0xbfb8('0x18')](_0xbfb8('0x25'),'afterCreate',_0xbfb8('0x46'),util[_0xbfb8('0x27')](_0x39f852,{'showHidden':![],'depth':null}));}})[_0xbfb8('0x17')](function(_0x2accff){logger[_0xbfb8('0x18')](_0xbfb8('0x25'),_0xbfb8('0x26'),_0xbfb8('0x46'),util[_0xbfb8('0x27')](_0x2accff,{'showHidden':![],'depth':null}));});}else{logger[_0xbfb8('0x18')](_0xbfb8('0x25'),'afterCreate','clickSend',_0xbfb8('0x39'));}break;case'plivo':if(_0x2f444e['authId']&&_0x2f444e[_0xbfb8('0x20')]){var _0x3c4a58={'dst':_0x16ade4[_0xbfb8('0x1f')],'text':_0x16ade4[_0xbfb8('0xc')],'src':_0x2f444e['senderString']||_0x2f444e[_0xbfb8('0x1f')],'url':_0x2f444e[_0xbfb8('0x47')]+'/api/sms/messages/'+_0x16ade4['id']+_0xbfb8('0x23')+_0x2f444e[_0xbfb8('0x24')]};var _0x279f96=util['format']('%s:%s',_0x2f444e[_0xbfb8('0x48')],_0x2f444e['authToken']);var _0x2c35ba={'method':_0xbfb8('0x32'),'uri':util[_0xbfb8('0x40')](_0xbfb8('0x49'),_0x2f444e[_0xbfb8('0x48')]),'body':_0x3c4a58,'headers':{'Authorization':util[_0xbfb8('0x40')](_0xbfb8('0x41'),new Buffer(_0x279f96)[_0xbfb8('0x42')]('base64'))},'json':!![]};rp(_0x2c35ba)[_0xbfb8('0x1b')](function(_0xa66ba5){var _0x1e5866={'messageId':_0xa66ba5[_0xbfb8('0x4a')][0x0]};return _0x38917b[_0xbfb8('0x15')](_0x1e5866);})[_0xbfb8('0x17')](function(_0x423266){logger[_0xbfb8('0x18')](_0xbfb8('0x25'),'afterCreate',_0xbfb8('0x4b'),util[_0xbfb8('0x27')](_0x423266,{'showHidden':![],'depth':null}));});}else{logger[_0xbfb8('0x18')](_0xbfb8('0x25'),'afterCreate',_0xbfb8('0x4b'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case'infobip':if(_0x2f444e[_0xbfb8('0x2a')]&&_0x2f444e[_0xbfb8('0x2b')]){if(_0x2f444e[_0xbfb8('0x4c')]){var _0x5ddc1f={'method':_0xbfb8('0x32'),'uri':_0x2f444e['baseUrl']+_0xbfb8('0x4d'),'body':{'username':_0x2f444e[_0xbfb8('0x2a')],'password':_0x2f444e[_0xbfb8('0x2b')]},'json':!![]};return rp(_0x5ddc1f)[_0xbfb8('0x1b')](function(_0x2e43e0){var _0x216f03={'method':_0xbfb8('0x32'),'uri':_0x2f444e[_0xbfb8('0x4c')]+_0xbfb8('0x4e'),'body':{'messages':[{'from':_0x2f444e[_0xbfb8('0x1f')],'destinations':[{'to':_0x16ade4[_0xbfb8('0x1f')]}],'text':_0x16ade4[_0xbfb8('0xc')],'notifyUrl':_0x2f444e[_0xbfb8('0x47')]+_0xbfb8('0x22')+_0x16ade4['id']+_0xbfb8('0x23')+_0x2f444e['token'],'notifyContentType':_0xbfb8('0x4f'),'callbackData':_0x2f444e[_0xbfb8('0x1f')]+';'+_0x16ade4[_0xbfb8('0xc')]}]},'headers':{'Authorization':_0xbfb8('0x50')+_0x2e43e0[_0xbfb8('0x24')]},'json':!![]};return rp(_0x216f03)[_0xbfb8('0x1b')](function(_0x1223d2){if(_0x1223d2[_0xbfb8('0x21')]){var _0x3b9b40={'messageId':_0x1223d2[_0xbfb8('0x21')][0x0][_0xbfb8('0xb')]};if(!_0x2f444e[_0xbfb8('0x37')]){_0x3b9b40[_0xbfb8('0x38')]=!![];}return _0x38917b['update'](_0x3b9b40);}else{return logger[_0xbfb8('0x18')](_0xbfb8('0x25'),_0xbfb8('0x26'),'infobip',util[_0xbfb8('0x27')](_0x1223d2,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x34120a){return logger[_0xbfb8('0x18')](_0xbfb8('0x25'),'afterCreate',_0xbfb8('0x51'),util[_0xbfb8('0x27')](_0x34120a,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xbfb8('0x25'),_0xbfb8('0x26'),_0xbfb8('0x51'),_0xbfb8('0x52'));}}else{logger[_0xbfb8('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xbfb8('0x26'),'infobip','Missing\x20parameters:\x20username,\x20password');}break;case _0xbfb8('0x53'):var _0x2f406f=require(_0xbfb8('0x54'));if(_0x2f444e['apiKey']){var _0xb43cc1={};_0xb43cc1[_0xbfb8('0x55')]=_0x2f444e[_0xbfb8('0x2a')];_0xb43cc1[_0xbfb8('0x1f')]=_0x16ade4[_0xbfb8('0x1f')];_0xb43cc1[_0xbfb8('0x56')]=_0x2f444e[_0xbfb8('0x1f')];_0xb43cc1[_0xbfb8('0x57')]=_0x16ade4[_0xbfb8('0xc')];_0xb43cc1[_0xbfb8('0x58')]=+new Date();var _0x25a831='';var _0x2936c9='';var _0x27589f=Object[_0xbfb8('0x59')](_0xb43cc1);_0x27589f['sort']();for(var _0x287ecb=0x0;_0x287ecb<_0x27589f['length'];_0x287ecb++){if(_0x25a831!=''){_0x25a831+='&';}_0x25a831+=_0x27589f[_0x287ecb]+'='+encodeURIComponent(_0xb43cc1[_0x27589f[_0x287ecb]]);_0x2936c9+=_0xb43cc1[_0x27589f[_0x287ecb]];}_0x2936c9+=_0x2f444e[_0xbfb8('0x5a')];_0x2936c9=_0x2f406f[_0xbfb8('0x5b')](_0xbfb8('0x5c'))[_0xbfb8('0x15')](_0x2936c9)[_0xbfb8('0x5d')]('hex');if(_0x25a831!==''){_0x25a831+='&';}_0x25a831+='signature='+_0x2936c9;var _0x445a4f={'method':_0xbfb8('0x2f'),'uri':_0x2f444e['baseUrl']+_0xbfb8('0x5e')+_0x25a831,'json':!![]};return rp(_0x445a4f)['then'](function(_0x5371a3){var _0x4392fd=Object[_0xbfb8('0x59')](_0x5371a3);if(_0x5371a3[_0x4392fd[0x0]]['error']&&parseInt(_0x5371a3[_0x4392fd[0x0]][_0xbfb8('0x18')])===0x0){var _0x734b6f={'messageId':_0x5371a3[_0x4392fd[0x0]][_0xbfb8('0x5f')]};if(!_0x2f444e[_0xbfb8('0x37')]){_0x734b6f['read']=!![];}return _0x38917b[_0xbfb8('0x15')](_0x734b6f);}else{return logger[_0xbfb8('0x18')](_0xbfb8('0x25'),_0xbfb8('0x26'),_0xbfb8('0x53'),util[_0xbfb8('0x27')](_0x5371a3[_0xbfb8('0x18')],{'showHidden':![],'depth':null}));}})[_0xbfb8('0x17')](function(_0x3870de){return logger[_0xbfb8('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xbfb8('0x26'),_0xbfb8('0x53'),util[_0xbfb8('0x27')](_0x3870de,{'showHidden':![],'depth':null}));});}else{logger[_0xbfb8('0x18')](_0xbfb8('0x25'),_0xbfb8('0x26'),_0xbfb8('0x53'),_0xbfb8('0x60'));}break;case _0xbfb8('0x61'):if(_0x2f444e['apiKey']){var _0x54c47b={'method':_0xbfb8('0x32'),'uri':_0xbfb8('0x62'),'headers':{'Authorization':_0x2f444e[_0xbfb8('0x5a')]},'body':{'content':_0x16ade4[_0xbfb8('0xc')],'to':[_0x16ade4['phone']],'from':_0x2f444e['phone'],'binary':![],'clientMessageId':'uuid','charset':'UTF-8'},'json':!![]};rp(_0x54c47b)['then'](function(_0x2f92f7){if(!_0x2f92f7[_0xbfb8('0x18')]){var _0x27def8={'messageId':_0x2f92f7[_0xbfb8('0x21')][0x0][_0xbfb8('0x63')]};if(!_0x2f444e[_0xbfb8('0x37')]){_0x27def8[_0xbfb8('0x38')]=!![];}return _0x38917b['update'](_0x27def8);}else{return logger[_0xbfb8('0x18')](_0xbfb8('0x25'),_0xbfb8('0x26'),_0xbfb8('0x61'),util[_0xbfb8('0x27')](_0x2f92f7[_0xbfb8('0x18')],{'showHidden':![],'depth':null}));}})[_0xbfb8('0x17')](function(_0x258faa){return logger[_0xbfb8('0x18')](_0xbfb8('0x25'),_0xbfb8('0x26'),_0xbfb8('0x61'),util['inspect'](_0x258faa,{'showHidden':![],'depth':null}));});}else{logger[_0xbfb8('0x18')](_0xbfb8('0x25'),_0xbfb8('0x26'),_0xbfb8('0x61'),'Missing\x20parameters:\x20apiKey');}break;case'bandwidth':if(_0x2f444e[_0xbfb8('0x2a')]&&_0x2f444e[_0xbfb8('0x2b')]){var _0x279f96=util['format'](_0xbfb8('0x64'),_0x2f444e['username'],_0x2f444e[_0xbfb8('0x2b')]);var _0x2c35ba={'method':_0xbfb8('0x32'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x2f444e[_0xbfb8('0x65')]+_0xbfb8('0x66'),'body':{'to':[_0x16ade4[_0xbfb8('0x1f')]],'text':_0x16ade4[_0xbfb8('0xc')],'from':_0x2f444e['phone'],'applicationId':_0x2f444e[_0xbfb8('0x67')]},'headers':{'Authorization':util[_0xbfb8('0x40')]('Basic\x20%s',new Buffer(_0x279f96)[_0xbfb8('0x42')](_0xbfb8('0x43')))},'json':!![]};rp(_0x2c35ba)['then'](function(_0x4afe76){if(_0x4afe76['id']){var _0x42a4ab={'messageId':_0x4afe76['id']};return _0x38917b[_0xbfb8('0x15')](_0x42a4ab);}else{logger[_0xbfb8('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xbfb8('0x68'),util[_0xbfb8('0x27')](_0x4afe76,{'showHidden':![],'depth':null}));}})[_0xbfb8('0x17')](function(_0x1892e7){logger[_0xbfb8('0x18')](_0xbfb8('0x25'),'afterCreate',_0xbfb8('0x68'),util[_0xbfb8('0x27')](_0x1892e7,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xbfb8('0x25'),_0xbfb8('0x26'),_0xbfb8('0x68'),_0xbfb8('0x39'));}break;case _0xbfb8('0x69'):if(_0x2f444e['apiKey']){var _0x2e11ce={};var _0x445a4f={'method':_0xbfb8('0x32'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0xbfb8('0x6a')+_0x2f444e[_0xbfb8('0x5a')],'Content-Type':_0xbfb8('0x4f')},'body':{'from':_0x2f444e[_0xbfb8('0x1f')],'to':_0x16ade4[_0xbfb8('0x1f')],'text':_0x16ade4[_0xbfb8('0xc')]},'json':!![]};return rp(_0x445a4f)[_0xbfb8('0x1b')](function(_0x465a80){if(_0x465a80[_0xbfb8('0x6b')]==0xca){_0x2e11ce[_0xbfb8('0x6c')]=_0x465a80;var _0x47569e={'method':_0xbfb8('0x32'),'uri':_0xbfb8('0x6d'),'headers':{'Authorization':_0xbfb8('0x6a')+_0x2f444e['apiKey'],'Content-Type':_0xbfb8('0x4f')},'body':{'refid':_0x2e11ce['message'][_0xbfb8('0x6e')]},'json':!![]};return rp(_0x47569e)[_0xbfb8('0x1b')](function(_0x524e2b){_0x2e11ce[_0xbfb8('0x6f')]=_0x524e2b;var _0x5abc90={'messageId':_0x2e11ce['message'][_0xbfb8('0x6e')],'read':!![]};return _0x38917b['update'](_0x5abc90);});}else{return logger[_0xbfb8('0x18')](_0xbfb8('0x25'),'afterCreate','intelepeer',util['inspect'](_0x465a80,{'showHidden':![],'depth':null}));}})['catch'](function(_0x50356b){return logger[_0xbfb8('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xbfb8('0x26'),_0xbfb8('0x69'),util[_0xbfb8('0x27')](_0x50356b,{'showHidden':![],'depth':null}));});}else{return logger[_0xbfb8('0x18')](_0xbfb8('0x25'),_0xbfb8('0x26'),_0xbfb8('0x69'),_0xbfb8('0x70'));}break;}}})[_0xbfb8('0x71')](function(){_0x2d9614();});}else{_0x2d9614();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x802a=['moment','bluebird','request-promise','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','models','direction','toLowerCase','out','secret','isNil','UserId','SmsInteractionId','SmsInteraction','findOne','update','createdAt','error','find','then','twilio','accountSid','authToken','messages','create','phone','remote','/api/sms/messages/','/status?token=','token','sid','catch','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','&password=','GET','sms','user_key','total_sent','internal_order_id','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','connectel','senderString','POST','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','format','%s:%s','Basic\x20%s','base64','http_code','data','queued_count','message_id','clickSend','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','infobip','Missing\x20parameters:\x20base_url','crypto','apiKey','login','text','keys','sort','createHash','hex','/external/get/send.php?','csc','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','intelepeer','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','refid','status','Token\x20not\x20received','finally','utf8mb4_unicode_ci','util','../../config/logger'];(function(_0x143d34,_0x3ae787){var _0x41ba78=function(_0x390a3b){while(--_0x390a3b){_0x143d34['push'](_0x143d34['shift']());}};_0x41ba78(++_0x3ae787);}(_0x802a,0xee));var _0xa802=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x802a[_0x413feb];return _0x40ee88;};'use strict';var _=require('lodash');var util=require(_0xa802('0x0'));var logger=require(_0xa802('0x1'))('api');var moment=require(_0xa802('0x2'));var BPromise=require(_0xa802('0x3'));var rp=require(_0xa802('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa802('0x5'));var config=require(_0xa802('0x6'));var attributes=require(_0xa802('0x7'));module[_0xa802('0x8')]=function(_0x151de5,_0x12708b){return _0x151de5[_0xa802('0x9')](_0xa802('0xa'),attributes,{'tableName':_0xa802('0xb'),'paranoid':![],'indexes':[{'name':_0xa802('0xc'),'fields':['messageId']},{'name':_0xa802('0xd'),'fields':[_0xa802('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x30d27b,_0xe11c43,_0x3c1f23){var _0x1266d2=_0x151de5[_0xa802('0xf')];var _0x1eb58e=_0x30d27b['get']({'plain':!![]});if(_0x1eb58e[_0xa802('0x10')][_0xa802('0x11')]()==='in'||_0x1eb58e[_0xa802('0x10')][_0xa802('0x11')]()===_0xa802('0x12')&&!_0x1eb58e[_0xa802('0x13')]&&!_[_0xa802('0x14')](_0x1eb58e[_0xa802('0x15')])&&!_[_0xa802('0x14')](_0x1eb58e[_0xa802('0x16')])){_0x1266d2[_0xa802('0x17')][_0xa802('0x18')]({'where':{'id':_0x1eb58e[_0xa802('0x16')]}})['then'](function(_0x3e4e53){if(_0x3e4e53){_0x3e4e53[_0xa802('0x19')]({'lastMsgAt':_0x1eb58e[_0xa802('0x1a')],'lastMsgDirection':_0x1eb58e[_0xa802('0x10')][_0xa802('0x11')]()});}})['catch'](function(_0x2bb14b){console[_0xa802('0x1b')](_0x2bb14b);});}if(_0x1eb58e[_0xa802('0x10')]===_0xa802('0x12')&&!_0x1eb58e[_0xa802('0x13')]){var _0x54741f;_0x1266d2['SmsAccount'][_0xa802('0x1c')]({'where':{'id':_0x1eb58e['SmsAccountId']},'raw':!![]})[_0xa802('0x1d')](function(_0x36959f){_0x54741f=_0x36959f;if(_0x54741f&&_0x54741f['type']){switch(_0x54741f['type']){case'twilio':var _0x2fda5f=require(_0xa802('0x1e'));if(_0x54741f[_0xa802('0x1f')]&&_0x54741f['authToken']&&_0x54741f['phone']){var _0x26a7a4=new _0x2fda5f(_0x54741f[_0xa802('0x1f')],_0x54741f[_0xa802('0x20')]);_0x26a7a4[_0xa802('0x21')][_0xa802('0x22')]({'body':_0x1eb58e['body'],'to':_0x1eb58e['phone'],'from':_0x54741f[_0xa802('0x23')],'statusCallback':_0x54741f[_0xa802('0x24')]+_0xa802('0x25')+_0x1eb58e['id']+_0xa802('0x26')+_0x54741f[_0xa802('0x27')]})['then'](function(_0xed5b09){if(_0xed5b09[_0xa802('0x28')]){return _0x30d27b[_0xa802('0x19')]({'messageId':_0xed5b09[_0xa802('0x28')]});}})[_0xa802('0x29')](function(_0xd13456){logger['error'](_0xa802('0x2a'),_0xa802('0x2b'),_0xa802('0x1e'),util[_0xa802('0x2c')](_0xd13456,{'showHidden':![],'depth':null}));});}else{logger[_0xa802('0x1b')](_0xa802('0x2a'),_0xa802('0x2b'),'twilio',_0xa802('0x2d'));}break;case _0xa802('0x2e'):var _0x384d54=_0xa802('0x2f');if(_0x54741f[_0xa802('0x30')]&&_0x54741f[_0xa802('0x31')]){var _0x2e1ffa={'recipient':[_0x1eb58e[_0xa802('0x23')]],'message':_0x1eb58e['body'],'message_type':_0x54741f[_0xa802('0x32')]};if(_0x54741f['smsMethod']&&_0x54741f[_0xa802('0x32')]!=='SI'){_0x2e1ffa[_0xa802('0x33')]=_0x54741f[_0xa802('0x23')];}var _0x4f8e77={'url':_0x384d54+_0xa802('0x34')+_0x54741f[_0xa802('0x30')]+_0xa802('0x35')+_0x54741f[_0xa802('0x31')],'method':_0xa802('0x36')};rp(_0x4f8e77)[_0xa802('0x1d')](function(_0x2d0b2c){var _0xd17bcd=_0x2d0b2c['split'](';');var _0x4bee88={'user_key':_0xd17bcd[0x0],'session_key':_0xd17bcd[0x1]};_0x4f8e77={'url':_0x384d54+_0xa802('0x37'),'method':'POST','headers':{'user_key':_0x4bee88[_0xa802('0x38')],'Session_key':_0x4bee88['session_key']},'json':!![],'body':_0x2e1ffa};return rp(_0x4f8e77);})[_0xa802('0x1d')](function(_0xd6bd67){if(_0xd6bd67[_0xa802('0x39')]>=0x1){var _0x463a3e={'messageId':_0xd6bd67[_0xa802('0x3a')]};if(_0x54741f['smsMethod']!=='GP'||!_0x54741f[_0xa802('0x3b')]){_0x463a3e[_0xa802('0x3c')]=!![];}return _0x30d27b[_0xa802('0x19')](_0x463a3e);}else{return logger[_0xa802('0x1b')](_0xa802('0x2a'),'afterCreate','skebby',util[_0xa802('0x2c')](_0xd6bd67,{'showHidden':![],'depth':null}));}})['catch'](function(_0xcf1f83){return logger['error'](_0xa802('0x2a'),_0xa802('0x2b'),_0xa802('0x2e'),util[_0xa802('0x2c')](_0xcf1f83,{'showHidden':![],'depth':null}));});}else{logger[_0xa802('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xa802('0x2e'),_0xa802('0x3d'));}break;case _0xa802('0x3e'):if(_0x54741f[_0xa802('0x20')]){var _0x153bec={'recipient':_0x1eb58e['phone'],'message':_0x1eb58e['body'],'sender':_0x54741f[_0xa802('0x3f')]||_0x54741f[_0xa802('0x23')],'authorization':_0x54741f[_0xa802('0x20')]};var _0xe11c43={'method':_0xa802('0x40'),'uri':_0xa802('0x41'),'body':_0x153bec,'json':!![]};rp(_0xe11c43)[_0xa802('0x1d')](function(_0x12f4ed){var _0x546414={'messageId':_0x12f4ed[_0xa802('0x42')]};if(!_0x54741f[_0xa802('0x3b')]){_0x546414[_0xa802('0x3c')]=!![];}return _0x30d27b['update'](_0x546414);})[_0xa802('0x29')](function(_0x558992){logger['error'](_0xa802('0x2a'),_0xa802('0x2b'),_0xa802('0x3e'),util[_0xa802('0x2c')](_0x558992,{'showHidden':![],'depth':null}));});}else{logger[_0xa802('0x1b')](_0xa802('0x2a'),_0xa802('0x2b'),_0xa802('0x3e'),_0xa802('0x43'));}break;case _0xa802('0x44'):if(_0x54741f['username']&&_0x54741f[_0xa802('0x31')]){var _0x153bec={'messages':[{'source':'xCALLY\x20Motion','to':_0x1eb58e['phone'],'body':_0x1eb58e['body'],'from':_0x54741f[_0xa802('0x3f')]||_0x54741f[_0xa802('0x23')]}]};var _0x18e7f9=util[_0xa802('0x45')](_0xa802('0x46'),_0x54741f[_0xa802('0x30')],_0x54741f[_0xa802('0x31')]);var _0xe11c43={'method':_0xa802('0x40'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x153bec,'headers':{'Authorization':util[_0xa802('0x45')](_0xa802('0x47'),new Buffer(_0x18e7f9)['toString'](_0xa802('0x48')))},'json':!![]};rp(_0xe11c43)['then'](function(_0x294b13){if(_0x294b13[_0xa802('0x49')]>=0xc8&&_0x294b13['http_code']<=0xce){if(_0x294b13[_0xa802('0x4a')]&&_0x294b13[_0xa802('0x4a')][_0xa802('0x4b')]>0x0){var _0x559e27=_['head'](_0x294b13[_0xa802('0x4a')]['messages']);var _0x2e6bee={'messageId':_0x559e27[_0xa802('0x4c')]};if(!_0x54741f[_0xa802('0x3b')]){_0x2e6bee[_0xa802('0x3c')]=!![];}return _0x30d27b['update'](_0x2e6bee);}else{logger[_0xa802('0x1b')](_0xa802('0x2a'),_0xa802('0x2b'),_0xa802('0x4d'),util['inspect'](_0x294b13,{'showHidden':![],'depth':null}));}}else{logger[_0xa802('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xa802('0x2b'),'clickSend',util['inspect'](_0x294b13,{'showHidden':![],'depth':null}));}})[_0xa802('0x29')](function(_0x473b9d){logger[_0xa802('0x1b')](_0xa802('0x2a'),_0xa802('0x2b'),_0xa802('0x4d'),util[_0xa802('0x2c')](_0x473b9d,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xa802('0x2a'),_0xa802('0x2b'),_0xa802('0x4d'),_0xa802('0x3d'));}break;case _0xa802('0x4e'):if(_0x54741f[_0xa802('0x4f')]&&_0x54741f[_0xa802('0x20')]){var _0x153bec={'dst':_0x1eb58e[_0xa802('0x23')],'text':_0x1eb58e[_0xa802('0xe')],'src':_0x54741f[_0xa802('0x3f')]||_0x54741f[_0xa802('0x23')],'url':_0x54741f['remote']+_0xa802('0x25')+_0x1eb58e['id']+'/status?token='+_0x54741f[_0xa802('0x27')]};var _0x18e7f9=util[_0xa802('0x45')](_0xa802('0x46'),_0x54741f[_0xa802('0x4f')],_0x54741f['authToken']);var _0xe11c43={'method':_0xa802('0x40'),'uri':util[_0xa802('0x45')](_0xa802('0x50'),_0x54741f[_0xa802('0x4f')]),'body':_0x153bec,'headers':{'Authorization':util[_0xa802('0x45')](_0xa802('0x47'),new Buffer(_0x18e7f9)['toString'](_0xa802('0x48')))},'json':!![]};rp(_0xe11c43)[_0xa802('0x1d')](function(_0x9fb61a){var _0x4c5c5d={'messageId':_0x9fb61a[_0xa802('0x51')][0x0]};return _0x30d27b[_0xa802('0x19')](_0x4c5c5d);})[_0xa802('0x29')](function(_0x1a17d8){logger[_0xa802('0x1b')](_0xa802('0x2a'),_0xa802('0x2b'),_0xa802('0x4e'),util[_0xa802('0x2c')](_0x1a17d8,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xa802('0x2b'),_0xa802('0x4e'),_0xa802('0x52'));}break;case'infobip':if(_0x54741f[_0xa802('0x30')]&&_0x54741f[_0xa802('0x31')]){if(_0x54741f[_0xa802('0x53')]){var _0x72d83f={'method':'POST','uri':_0x54741f['baseUrl']+_0xa802('0x54'),'body':{'username':_0x54741f[_0xa802('0x30')],'password':_0x54741f[_0xa802('0x31')]},'json':!![]};return rp(_0x72d83f)[_0xa802('0x1d')](function(_0x3a9a83){var _0x27b834={'method':'POST','uri':_0x54741f['baseUrl']+_0xa802('0x55'),'body':{'messages':[{'from':_0x54741f['phone'],'destinations':[{'to':_0x1eb58e[_0xa802('0x23')]}],'text':_0x1eb58e[_0xa802('0xe')],'notifyUrl':_0x54741f[_0xa802('0x24')]+_0xa802('0x25')+_0x1eb58e['id']+'/status?token='+_0x54741f[_0xa802('0x27')],'notifyContentType':_0xa802('0x56'),'callbackData':_0x54741f[_0xa802('0x23')]+';'+_0x1eb58e[_0xa802('0xe')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x3a9a83[_0xa802('0x27')]},'json':!![]};return rp(_0x27b834)[_0xa802('0x1d')](function(_0x108772){if(_0x108772[_0xa802('0x21')]){var _0x55d25a={'messageId':_0x108772[_0xa802('0x21')][0x0][_0xa802('0xc')]};if(!_0x54741f[_0xa802('0x3b')]){_0x55d25a[_0xa802('0x3c')]=!![];}return _0x30d27b[_0xa802('0x19')](_0x55d25a);}else{return logger[_0xa802('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xa802('0x2b'),_0xa802('0x57'),util[_0xa802('0x2c')](_0x108772,{'showHidden':![],'depth':null}));}});})[_0xa802('0x29')](function(_0x21f5e1){return logger[_0xa802('0x1b')](_0xa802('0x2a'),_0xa802('0x2b'),_0xa802('0x57'),util[_0xa802('0x2c')](_0x21f5e1,{'showHidden':![],'depth':null}));});}else{logger[_0xa802('0x1b')](_0xa802('0x2a'),'afterCreate','infobip',_0xa802('0x58'));}}else{logger['error'](_0xa802('0x2a'),_0xa802('0x2b'),'infobip',_0xa802('0x3d'));}break;case'csc':var _0x1876bf=require(_0xa802('0x59'));if(_0x54741f[_0xa802('0x5a')]){var _0x59012f={};_0x59012f[_0xa802('0x5b')]=_0x54741f[_0xa802('0x30')];_0x59012f[_0xa802('0x23')]=_0x1eb58e[_0xa802('0x23')];_0x59012f['sender']=_0x54741f[_0xa802('0x23')];_0x59012f[_0xa802('0x5c')]=_0x1eb58e[_0xa802('0xe')];_0x59012f['timestamp']=+new Date();var _0x57e752='';var _0x2a7356='';var _0x4c7d7b=Object[_0xa802('0x5d')](_0x59012f);_0x4c7d7b[_0xa802('0x5e')]();for(var _0x341dce=0x0;_0x341dce<_0x4c7d7b['length'];_0x341dce++){if(_0x57e752!=''){_0x57e752+='&';}_0x57e752+=_0x4c7d7b[_0x341dce]+'='+encodeURIComponent(_0x59012f[_0x4c7d7b[_0x341dce]]);_0x2a7356+=_0x59012f[_0x4c7d7b[_0x341dce]];}_0x2a7356+=_0x54741f[_0xa802('0x5a')];_0x2a7356=_0x1876bf[_0xa802('0x5f')]('md5')[_0xa802('0x19')](_0x2a7356)['digest'](_0xa802('0x60'));if(_0x57e752!==''){_0x57e752+='&';}_0x57e752+='signature='+_0x2a7356;var _0x4f8e77={'method':_0xa802('0x36'),'uri':_0x54741f[_0xa802('0x53')]+_0xa802('0x61')+_0x57e752,'json':!![]};return rp(_0x4f8e77)[_0xa802('0x1d')](function(_0x1f01d0){var _0x154fd5=Object[_0xa802('0x5d')](_0x1f01d0);if(_0x1f01d0[_0x154fd5[0x0]][_0xa802('0x1b')]&&parseInt(_0x1f01d0[_0x154fd5[0x0]][_0xa802('0x1b')])===0x0){var _0x5a645b={'messageId':_0x1f01d0[_0x154fd5[0x0]]['id_sms']};if(!_0x54741f['deliveryReport']){_0x5a645b[_0xa802('0x3c')]=!![];}return _0x30d27b[_0xa802('0x19')](_0x5a645b);}else{return logger[_0xa802('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xa802('0x62'),util[_0xa802('0x2c')](_0x1f01d0[_0xa802('0x1b')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x1a7d69){return logger[_0xa802('0x1b')](_0xa802('0x2a'),_0xa802('0x2b'),_0xa802('0x62'),util[_0xa802('0x2c')](_0x1a7d69,{'showHidden':![],'depth':null}));});}else{logger[_0xa802('0x1b')](_0xa802('0x2a'),_0xa802('0x2b'),_0xa802('0x62'),_0xa802('0x63'));}break;case _0xa802('0x64'):if(_0x54741f['apiKey']){var _0x4df4b1={'method':_0xa802('0x40'),'uri':_0xa802('0x65'),'headers':{'Authorization':_0x54741f[_0xa802('0x5a')]},'body':{'content':_0x1eb58e[_0xa802('0xe')],'to':[_0x1eb58e['phone']],'from':_0x54741f['phone'],'binary':![],'clientMessageId':_0xa802('0x66'),'charset':_0xa802('0x67')},'json':!![]};rp(_0x4df4b1)['then'](function(_0x51a069){if(!_0x51a069[_0xa802('0x1b')]){var _0x49eae4={'messageId':_0x51a069[_0xa802('0x21')][0x0][_0xa802('0x68')]};if(!_0x54741f[_0xa802('0x3b')]){_0x49eae4[_0xa802('0x3c')]=!![];}return _0x30d27b[_0xa802('0x19')](_0x49eae4);}else{return logger[_0xa802('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xa802('0x2b'),_0xa802('0x64'),util[_0xa802('0x2c')](_0x51a069['error'],{'showHidden':![],'depth':null}));}})[_0xa802('0x29')](function(_0x31f7f5){return logger[_0xa802('0x1b')](_0xa802('0x2a'),_0xa802('0x2b'),_0xa802('0x64'),util[_0xa802('0x2c')](_0x31f7f5,{'showHidden':![],'depth':null}));});}else{logger[_0xa802('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xa802('0x2b'),_0xa802('0x64'),'Missing\x20parameters:\x20apiKey');}break;case _0xa802('0x69'):if(_0x54741f['username']&&_0x54741f[_0xa802('0x31')]){var _0x18e7f9=util[_0xa802('0x45')](_0xa802('0x46'),_0x54741f[_0xa802('0x30')],_0x54741f[_0xa802('0x31')]);var _0xe11c43={'method':_0xa802('0x40'),'uri':_0xa802('0x6a')+_0x54741f[_0xa802('0x6b')]+_0xa802('0x6c'),'body':{'to':[_0x1eb58e[_0xa802('0x23')]],'text':_0x1eb58e[_0xa802('0xe')],'from':_0x54741f[_0xa802('0x23')],'applicationId':_0x54741f[_0xa802('0x6d')]},'headers':{'Authorization':util[_0xa802('0x45')](_0xa802('0x47'),new Buffer(_0x18e7f9)['toString'](_0xa802('0x48')))},'json':!![]};rp(_0xe11c43)[_0xa802('0x1d')](function(_0xcb8205){if(_0xcb8205['id']){var _0xc12442={'messageId':_0xcb8205['id']};return _0x30d27b['update'](_0xc12442);}else{logger[_0xa802('0x1b')](_0xa802('0x2a'),_0xa802('0x2b'),_0xa802('0x69'),util[_0xa802('0x2c')](_0xcb8205,{'showHidden':![],'depth':null}));}})[_0xa802('0x29')](function(_0x4ef901){logger[_0xa802('0x1b')](_0xa802('0x2a'),_0xa802('0x2b'),_0xa802('0x69'),util[_0xa802('0x2c')](_0x4ef901,{'showHidden':![],'depth':null}));});}else{logger[_0xa802('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xa802('0x2b'),_0xa802('0x69'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xa802('0x6e'):if(_0x54741f[_0xa802('0x5a')]){var _0x24cd8c={};var _0x4f8e77={'method':_0xa802('0x40'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':'Bearer\x20'+_0x54741f['apiKey'],'Content-Type':_0xa802('0x56')},'body':{'from':_0x54741f['phone'],'to':_0x1eb58e[_0xa802('0x23')],'text':_0x1eb58e[_0xa802('0xe')]},'json':!![]};return rp(_0x4f8e77)['then'](function(_0x28732d){if(_0x28732d[_0xa802('0x6f')]==0xca){_0x24cd8c[_0xa802('0x70')]=_0x28732d;var _0x3bec32={'method':_0xa802('0x40'),'uri':_0xa802('0x71'),'headers':{'Authorization':_0xa802('0x72')+_0x54741f[_0xa802('0x5a')],'Content-Type':_0xa802('0x56')},'body':{'refid':_0x24cd8c[_0xa802('0x70')][_0xa802('0x73')]},'json':!![]};return rp(_0x3bec32)[_0xa802('0x1d')](function(_0x583b4f){_0x24cd8c[_0xa802('0x74')]=_0x583b4f;var _0x5c547b={'messageId':_0x24cd8c['message']['refid'],'read':!![]};return _0x30d27b[_0xa802('0x19')](_0x5c547b);});}else{return logger[_0xa802('0x1b')](_0xa802('0x2a'),_0xa802('0x2b'),_0xa802('0x6e'),util['inspect'](_0x28732d,{'showHidden':![],'depth':null}));}})['catch'](function(_0x724d0e){return logger[_0xa802('0x1b')](_0xa802('0x2a'),_0xa802('0x2b'),_0xa802('0x6e'),util[_0xa802('0x2c')](_0x724d0e,{'showHidden':![],'depth':null}));});}else{return logger[_0xa802('0x1b')](_0xa802('0x2a'),_0xa802('0x2b'),'intelepeer',_0xa802('0x75'));}break;}}})[_0xa802('0x76')](function(){_0x3c1f23();});}else{_0x3c1f23();}}},'charset':'utf8mb4','collate':_0xa802('0x77')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index c00794c..0871067 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 _0xf7ef=['localhost','socket.io-emitter','./smsMessage.socket','register','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','CreateSmsMessage','SmsMessage','create','body','options','raw','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','redis','defaults'];(function(_0x10bcc4,_0x4400e2){var _0x2da988=function(_0x2ee849){while(--_0x2ee849){_0x10bcc4['push'](_0x10bcc4['shift']());}};_0x2da988(++_0x4400e2);}(_0xf7ef,0x181));var _0xff7e=function(_0x289577,_0xc1ba55){_0x289577=_0x289577-0x0;var _0x191cc8=_0xf7ef[_0x289577];return _0x191cc8;};'use strict';var _=require(_0xff7e('0x0'));var util=require(_0xff7e('0x1'));var moment=require(_0xff7e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xff7e('0x3'));var db=require(_0xff7e('0x4'))['db'];var utils=require(_0xff7e('0x5'));var logger=require('../../config/logger')(_0xff7e('0x6'));var config=require('../../config/environment');var jayson=require(_0xff7e('0x7'));var client=jayson['client'][_0xff7e('0x8')]({'port':0x232a});config[_0xff7e('0x9')]=_[_0xff7e('0xa')](config[_0xff7e('0x9')],{'host':_0xff7e('0xb'),'port':0x18eb});var socket=require(_0xff7e('0xc'))(new Redis(config[_0xff7e('0x9')]));require(_0xff7e('0xd'))[_0xff7e('0xe')](socket);function respondWithRpcPromise(_0x2a4f0b,_0x4235ae,_0x2f6a6c){return new BPromise(function(_0x6bcdb5,_0x559149){return client[_0xff7e('0xf')](_0x2a4f0b,_0x2f6a6c)[_0xff7e('0x10')](function(_0x2fa105){logger[_0xff7e('0x11')](_0xff7e('0x12'),_0x4235ae,_0xff7e('0x13'));logger[_0xff7e('0x14')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4235ae,_0xff7e('0x13'),JSON[_0xff7e('0x15')](_0x2fa105));if(_0x2fa105[_0xff7e('0x16')]){if(_0x2fa105[_0xff7e('0x16')][_0xff7e('0x17')]===0x1f4){logger[_0xff7e('0x16')](_0xff7e('0x12'),_0x4235ae,_0x2fa105[_0xff7e('0x16')][_0xff7e('0x18')]);return _0x559149(_0x2fa105[_0xff7e('0x16')][_0xff7e('0x18')]);}logger[_0xff7e('0x16')]('SmsMessage,\x20%s,\x20%s',_0x4235ae,_0x2fa105[_0xff7e('0x16')][_0xff7e('0x18')]);return _0x6bcdb5(_0x2fa105[_0xff7e('0x16')][_0xff7e('0x18')]);}else{logger['info']('SmsMessage,\x20%s,\x20%s',_0x4235ae,'request\x20sent');_0x6bcdb5(_0x2fa105[_0xff7e('0x19')][_0xff7e('0x18')]);}})['catch'](function(_0x4ee076){logger[_0xff7e('0x16')](_0xff7e('0x12'),_0x4235ae,_0x4ee076);_0x559149(_0x4ee076);});});}exports[_0xff7e('0x1a')]=function(_0x560587){var _0x426c02=this;return new Promise(function(_0x14d9f9,_0x2b90f9){return db[_0xff7e('0x1b')][_0xff7e('0x1c')](_0x560587[_0xff7e('0x1d')],{'raw':_0x560587['options']?_0x560587[_0xff7e('0x1e')][_0xff7e('0x1f')]===undefined?!![]:![]:!![]})[_0xff7e('0x10')](function(_0x2c61a3){logger['info'](_0xff7e('0x1a'),_0x560587);logger[_0xff7e('0x14')]('CreateSmsMessage',_0x560587,JSON[_0xff7e('0x15')](_0x2c61a3));_0x14d9f9(_0x2c61a3);})[_0xff7e('0x20')](function(_0x3f2bdf){logger[_0xff7e('0x16')](_0xff7e('0x1a'),_0x3f2bdf[_0xff7e('0x18')],_0x560587);_0x2b90f9(_0x426c02['error'](0x1f4,_0x3f2bdf[_0xff7e('0x18')]));});});}; \ No newline at end of file +var _0x97eb=['options','raw','CreateSmsMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','body'];(function(_0x18bcce,_0x36dbf9){var _0x4735f6=function(_0x1f008b){while(--_0x1f008b){_0x18bcce['push'](_0x18bcce['shift']());}};_0x4735f6(++_0x36dbf9);}(_0x97eb,0xfb));var _0xb97e=function(_0x4410a9,_0x83bf3c){_0x4410a9=_0x4410a9-0x0;var _0x24f50e=_0x97eb[_0x4410a9];return _0x24f50e;};'use strict';var _=require(_0xb97e('0x0'));var util=require(_0xb97e('0x1'));var moment=require(_0xb97e('0x2'));var BPromise=require(_0xb97e('0x3'));var rs=require(_0xb97e('0x4'));var fs=require('fs');var Redis=require(_0xb97e('0x5'));var db=require(_0xb97e('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb97e('0x7'));var config=require(_0xb97e('0x8'));var jayson=require(_0xb97e('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0xb97e('0xa')]=_[_0xb97e('0xb')](config[_0xb97e('0xa')],{'host':_0xb97e('0xc'),'port':0x18eb});var socket=require(_0xb97e('0xd'))(new Redis(config[_0xb97e('0xa')]));require(_0xb97e('0xe'))[_0xb97e('0xf')](socket);function respondWithRpcPromise(_0x5f5ce3,_0x49b30e,_0x2b51ae){return new BPromise(function(_0x38cdc0,_0x3ce7f2){return client[_0xb97e('0x10')](_0x5f5ce3,_0x2b51ae)[_0xb97e('0x11')](function(_0x3dfe05){logger[_0xb97e('0x12')](_0xb97e('0x13'),_0x49b30e,_0xb97e('0x14'));logger[_0xb97e('0x15')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x49b30e,_0xb97e('0x14'),JSON[_0xb97e('0x16')](_0x3dfe05));if(_0x3dfe05[_0xb97e('0x17')]){if(_0x3dfe05[_0xb97e('0x17')][_0xb97e('0x18')]===0x1f4){logger[_0xb97e('0x17')](_0xb97e('0x13'),_0x49b30e,_0x3dfe05[_0xb97e('0x17')][_0xb97e('0x19')]);return _0x3ce7f2(_0x3dfe05['error']['message']);}logger[_0xb97e('0x17')]('SmsMessage,\x20%s,\x20%s',_0x49b30e,_0x3dfe05[_0xb97e('0x17')][_0xb97e('0x19')]);return _0x38cdc0(_0x3dfe05[_0xb97e('0x17')]['message']);}else{logger[_0xb97e('0x12')](_0xb97e('0x13'),_0x49b30e,'request\x20sent');_0x38cdc0(_0x3dfe05['result']['message']);}})[_0xb97e('0x1a')](function(_0x39cbb8){logger[_0xb97e('0x17')]('SmsMessage,\x20%s,\x20%s',_0x49b30e,_0x39cbb8);_0x3ce7f2(_0x39cbb8);});});}exports['CreateSmsMessage']=function(_0xfa5257){var _0x4bbda2=this;return new Promise(function(_0x5bdba4,_0x2a94e7){return db['SmsMessage']['create'](_0xfa5257[_0xb97e('0x1b')],{'raw':_0xfa5257[_0xb97e('0x1c')]?_0xfa5257[_0xb97e('0x1c')][_0xb97e('0x1d')]===undefined?!![]:![]:!![]})[_0xb97e('0x11')](function(_0x252203){logger[_0xb97e('0x12')](_0xb97e('0x1e'),_0xfa5257);logger[_0xb97e('0x15')](_0xb97e('0x1e'),_0xfa5257,JSON[_0xb97e('0x16')](_0x252203));_0x5bdba4(_0x252203);})[_0xb97e('0x1a')](function(_0x5d363e){logger['error'](_0xb97e('0x1e'),_0x5d363e[_0xb97e('0x19')],_0xfa5257);_0x2a94e7(_0x4bbda2[_0xb97e('0x17')](0x1f4,_0x5d363e[_0xb97e('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 5b51312..6c6f721 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 _0xc9fa=['removeListener','register','length','./smsMessage.events','save','remove','emit'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xc9fa,0x129));var _0xac9f=function(_0x5f0888,_0x339dae){_0x5f0888=_0x5f0888-0x0;var _0x2cbad2=_0xc9fa[_0x5f0888];return _0x2cbad2;};'use strict';var SmsMessageEvents=require(_0xac9f('0x0'));var events=[_0xac9f('0x1'),_0xac9f('0x2'),'update'];function createListener(_0x21ebb0,_0x4f5ad2){return function(_0x20d10e){_0x4f5ad2[_0xac9f('0x3')](_0x21ebb0,_0x20d10e);};}function removeListener(_0x416dbe,_0x5d5bf6){return function(){SmsMessageEvents[_0xac9f('0x4')](_0x416dbe,_0x5d5bf6);};}exports[_0xac9f('0x5')]=function(_0x509a31){for(var _0x199939=0x0,_0x3f0a33=events[_0xac9f('0x6')];_0x199939<_0x3f0a33;_0x199939++){var _0x21ee84=events[_0x199939];var _0x562307=createListener('smsMessage:'+_0x21ee84,_0x509a31);SmsMessageEvents['on'](_0x21ee84,_0x562307);}}; \ No newline at end of file +var _0xa00c=['length','save','remove','update','removeListener','register'];(function(_0x2caf7d,_0x3eaba9){var _0x391549=function(_0x378914){while(--_0x378914){_0x2caf7d['push'](_0x2caf7d['shift']());}};_0x391549(++_0x3eaba9);}(_0xa00c,0xf1));var _0xca00=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa00c[_0x19e35c];return _0x3e1fe8;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0xca00('0x0'),_0xca00('0x1'),_0xca00('0x2')];function createListener(_0x54fbb7,_0x362a8e){return function(_0x1fcd4e){_0x362a8e['emit'](_0x54fbb7,_0x1fcd4e);};}function removeListener(_0x20f926,_0x30cb4f){return function(){SmsMessageEvents[_0xca00('0x3')](_0x20f926,_0x30cb4f);};}exports[_0xca00('0x4')]=function(_0x8c67b8){for(var _0x151994=0x0,_0x59e424=events[_0xca00('0x5')];_0x151994<_0x59e424;_0x151994++){var _0x49f5ae=events[_0x151994];var _0x332e7a=createListener('smsMessage:'+_0x49f5ae,_0x8c67b8);SmsMessageEvents['on'](_0x49f5ae,_0x332e7a);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 0aab99c..78a6e44 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 _0xd82d=['describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','post','put','update','delete','destroy','removeAgents','exports','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','/describe'];(function(_0x2ed2f0,_0x1f75c2){var _0x4a4969=function(_0x42ed5d){while(--_0x42ed5d){_0x2ed2f0['push'](_0x2ed2f0['shift']());}};_0x4a4969(++_0x1f75c2);}(_0xd82d,0x145));var _0xdd82=function(_0x211a51,_0x4e0374){_0x211a51=_0x211a51-0x0;var _0x54f820=_0xd82d[_0x211a51];return _0x54f820;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xdd82('0x0'));var express=require('express');var router=express[_0xdd82('0x1')]();var fs_extra=require(_0xdd82('0x2'));var auth=require(_0xdd82('0x3'));var interaction=require(_0xdd82('0x4'));var config=require(_0xdd82('0x5'));var controller=require(_0xdd82('0x6'));router[_0xdd82('0x7')]('/',auth[_0xdd82('0x8')](),controller[_0xdd82('0x9')]);router['get'](_0xdd82('0xa'),auth['isAuthenticated'](),controller[_0xdd82('0xb')]);router[_0xdd82('0x7')](_0xdd82('0xc'),auth[_0xdd82('0x8')](),controller[_0xdd82('0xd')]);router[_0xdd82('0x7')](_0xdd82('0xe'),auth['isAuthenticated'](),controller[_0xdd82('0xf')]);router[_0xdd82('0x7')](_0xdd82('0x10'),auth['isAuthenticated'](),controller[_0xdd82('0x11')]);router[_0xdd82('0x7')](_0xdd82('0x12'),auth[_0xdd82('0x8')](),controller[_0xdd82('0x13')]);router['post']('/',auth['isAuthenticated'](),controller[_0xdd82('0x14')]);router[_0xdd82('0x15')](_0xdd82('0x10'),auth[_0xdd82('0x8')](),controller['addTeams']);router[_0xdd82('0x15')](_0xdd82('0x12'),auth[_0xdd82('0x8')](),controller['addAgents']);router[_0xdd82('0x16')](_0xdd82('0xc'),auth[_0xdd82('0x8')](),controller[_0xdd82('0x17')]);router[_0xdd82('0x18')](_0xdd82('0xc'),auth['isAuthenticated'](),controller[_0xdd82('0x19')]);router['delete']('/:id/teams',auth[_0xdd82('0x8')](),controller['removeTeams']);router[_0xdd82('0x18')]('/:id/users',auth[_0xdd82('0x8')](),controller[_0xdd82('0x1a')]);module[_0xdd82('0x1b')]=router; \ No newline at end of file +var _0xbf97=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','show','/:id/members','getMembers','/:id/teams','getAgents','post','create','addTeams','addAgents','put','delete','/:id','destroy','/:id/users','removeAgents','exports','multer','util','connect-timeout','express'];(function(_0x49b14d,_0x578d07){var _0x3d2488=function(_0x5a8668){while(--_0x5a8668){_0x49b14d['push'](_0x49b14d['shift']());}};_0x3d2488(++_0x578d07);}(_0xbf97,0x8d));var _0x7bf9=function(_0x54759a,_0x37483a){_0x54759a=_0x54759a-0x0;var _0x59ffe9=_0xbf97[_0x54759a];return _0x59ffe9;};'use strict';var multer=require(_0x7bf9('0x0'));var util=require(_0x7bf9('0x1'));var path=require('path');var timeout=require(_0x7bf9('0x2'));var express=require(_0x7bf9('0x3'));var router=express[_0x7bf9('0x4')]();var fs_extra=require(_0x7bf9('0x5'));var auth=require(_0x7bf9('0x6'));var interaction=require(_0x7bf9('0x7'));var config=require(_0x7bf9('0x8'));var controller=require('./smsQueue.controller');router[_0x7bf9('0x9')]('/',auth[_0x7bf9('0xa')](),controller[_0x7bf9('0xb')]);router[_0x7bf9('0x9')]('/describe',auth[_0x7bf9('0xa')](),controller[_0x7bf9('0xc')]);router[_0x7bf9('0x9')]('/:id',auth[_0x7bf9('0xa')](),controller[_0x7bf9('0xd')]);router[_0x7bf9('0x9')](_0x7bf9('0xe'),auth['isAuthenticated'](),controller[_0x7bf9('0xf')]);router['get'](_0x7bf9('0x10'),auth[_0x7bf9('0xa')](),controller['getTeams']);router[_0x7bf9('0x9')]('/:id/users',auth[_0x7bf9('0xa')](),controller[_0x7bf9('0x11')]);router[_0x7bf9('0x12')]('/',auth[_0x7bf9('0xa')](),controller[_0x7bf9('0x13')]);router['post'](_0x7bf9('0x10'),auth['isAuthenticated'](),controller[_0x7bf9('0x14')]);router[_0x7bf9('0x12')]('/:id/users',auth[_0x7bf9('0xa')](),controller[_0x7bf9('0x15')]);router[_0x7bf9('0x16')]('/:id',auth[_0x7bf9('0xa')](),controller['update']);router[_0x7bf9('0x17')](_0x7bf9('0x18'),auth[_0x7bf9('0xa')](),controller[_0x7bf9('0x19')]);router[_0x7bf9('0x17')](_0x7bf9('0x10'),auth[_0x7bf9('0xa')](),controller['removeTeams']);router['delete'](_0x7bf9('0x1a'),auth[_0x7bf9('0xa')](),controller[_0x7bf9('0x1b')]);module[_0x7bf9('0x1c')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index b92927d..17ca601 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 _0x7fb9=['beepall','roundrobin','name','STRING','INTEGER'];(function(_0x1e33b5,_0x48feec){var _0x2a6450=function(_0x35de64){while(--_0x35de64){_0x1e33b5['push'](_0x1e33b5['shift']());}};_0x2a6450(++_0x48feec);}(_0x7fb9,0x11f));var _0x97fb=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0x7fb9[_0x12d033];return _0x3b4e80;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x97fb('0x0'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x97fb('0x1')]},'timeout':{'type':Sequelize[_0x97fb('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x97fb('0x3'),_0x97fb('0x4'))}}; \ No newline at end of file +var _0xccaf=['roundrobin','sequelize','exports','STRING','name','ENUM','beepall'];(function(_0x529e8c,_0x5c970a){var _0x284a19=function(_0x11f62e){while(--_0x11f62e){_0x529e8c['push'](_0x529e8c['shift']());}};_0x284a19(++_0x5c970a);}(_0xccaf,0x12e));var _0xfcca=function(_0x5756f8,_0x22b6d5){_0x5756f8=_0x5756f8-0x0;var _0x3bb749=_0xccaf[_0x5756f8];return _0x3bb749;};'use strict';var Sequelize=require(_0xfcca('0x0'));module[_0xfcca('0x1')]={'name':{'type':Sequelize[_0xfcca('0x2')],'unique':_0xfcca('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xfcca('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xfcca('0x4')]('rrmemory',_0xfcca('0x5'),_0xfcca('0x6'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index a49fd95..fd8fe12 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 _0xbc3d=['mustache','util','path','sox','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','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','UserProfileResource','status','end','name','send','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','SmsQueue','findAll','catch','show','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsQueues','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserSmsQueue','nolimit','SmsQueueId','User','smsPause','updatedAt','createdAt','rows','format','SIP','getTeams','Team','addTeams','Agents','online','voicePause','interface','flatMap','sequelize','findOrCreate','userSmsQueue:save','ids','select','field','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','QueryTypes','every','TeamId','includes','all','union','compact','transaction','isEmpty','forEach','emit','addAgents','omit','spread','removeAgents','isArray','userSmsQueue:remove','getAgents','eml-format','request-promise','moment'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xbc3d,0x1ad));var _0xdbc3=function(_0x4207f4,_0x1f778b){_0x4207f4=_0x4207f4-0x0;var _0x29a621=_0xbc3d[_0x4207f4];return _0x29a621;};'use strict';var emlformat=require(_0xdbc3('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xdbc3('0x1'));var moment=require(_0xdbc3('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xdbc3('0x3'));var util=require(_0xdbc3('0x4'));var path=require(_0xdbc3('0x5'));var sox=require(_0xdbc3('0x6'));var csv=require('to-csv');var ejs=require(_0xdbc3('0x7'));var fs=require('fs');var fs_extra=require(_0xdbc3('0x8'));var _=require(_0xdbc3('0x9'));var squel=require('squel');var crypto=require(_0xdbc3('0xa'));var jsforce=require(_0xdbc3('0xb'));var deskjs=require(_0xdbc3('0xc'));var toCsv=require(_0xdbc3('0xd'));var querystring=require(_0xdbc3('0xe'));var Papa=require(_0xdbc3('0xf'));var Redis=require(_0xdbc3('0x10'));var authService=require(_0xdbc3('0x11'));var qs=require(_0xdbc3('0x12'));var as=require(_0xdbc3('0x13'));var hardwareService=require(_0xdbc3('0x14'));var logger=require(_0xdbc3('0x15'))(_0xdbc3('0x16'));var utils=require(_0xdbc3('0x17'));var config=require(_0xdbc3('0x18'));var licenseUtil=require(_0xdbc3('0x19'));var db=require(_0xdbc3('0x1a'))['db'];config[_0xdbc3('0x1b')]=_['defaults'](config[_0xdbc3('0x1b')],{'host':_0xdbc3('0x1c'),'port':0x18eb});var socket=require(_0xdbc3('0x1d'))(new Redis(config[_0xdbc3('0x1b')]));require(_0xdbc3('0x1e'))[_0xdbc3('0x1f')](socket);function respondWithStatusCode(_0x331b81,_0x11916e){_0x11916e=_0x11916e||0xcc;return function(_0x3e5cf4){if(_0x3e5cf4){return _0x331b81[_0xdbc3('0x20')](_0x11916e);}return _0x331b81['status'](_0x11916e)['end']();};}function respondWithResult(_0x5243bb,_0x2ccb90){_0x2ccb90=_0x2ccb90||0xc8;return function(_0x422cba){if(_0x422cba){return _0x5243bb['status'](_0x2ccb90)[_0xdbc3('0x21')](_0x422cba);}};}function respondWithFilteredResult(_0x5d30f9,_0x31f332){return function(_0x375965){if(_0x375965){var _0x1bb2ba=typeof _0x31f332[_0xdbc3('0x22')]===_0xdbc3('0x23')&&typeof _0x31f332[_0xdbc3('0x24')]===_0xdbc3('0x23');var _0x3026ad=_0x375965['count'];var _0x543d18=_0x1bb2ba?0x0:_0x31f332[_0xdbc3('0x22')];var _0x14e446=_0x1bb2ba?_0x375965[_0xdbc3('0x25')]:_0x31f332[_0xdbc3('0x22')]+_0x31f332['limit'];var _0x24f955;if(_0x14e446>=_0x3026ad){_0x14e446=_0x3026ad;_0x24f955=0xc8;}else{_0x24f955=0xce;}_0x5d30f9['status'](_0x24f955);return _0x5d30f9[_0xdbc3('0x26')](_0xdbc3('0x27'),_0x543d18+'-'+_0x14e446+'/'+_0x3026ad)[_0xdbc3('0x21')](_0x375965);}return null;};}function patchUpdates(_0x19b9a6){return function(_0xd33416){try{jsonpatch[_0xdbc3('0x28')](_0xd33416,_0x19b9a6,!![]);}catch(_0x2153ce){return BPromise[_0xdbc3('0x29')](_0x2153ce);}return _0xd33416['save']();};}function saveUpdates(_0x94160d,_0x2e6a72){return function(_0x1c2f9e){if(_0x1c2f9e){return _0x1c2f9e[_0xdbc3('0x2a')](_0x94160d)[_0xdbc3('0x2b')](function(_0x8d9be2){return _0x8d9be2;});}return null;};}function removeEntity(_0x30e77a,_0x4b056d){return function(_0x1f9a33){if(_0x1f9a33){return _0x1f9a33[_0xdbc3('0x2c')]()['then'](function(){var _0x4e3713=_0x1f9a33['get']({'plain':!![]});var _0x428444='SmsQueues';return db[_0xdbc3('0x2d')][_0xdbc3('0x2c')]({'where':{'type':_0x428444,'resourceId':_0x4e3713['id']}})[_0xdbc3('0x2b')](function(){return _0x1f9a33;});})['then'](function(){_0x30e77a[_0xdbc3('0x2e')](0xcc)[_0xdbc3('0x2f')]();});}};}function handleEntityNotFound(_0x257de9,_0x43a87d){return function(_0x3616b1){if(!_0x3616b1){_0x257de9[_0xdbc3('0x20')](0x194);}return _0x3616b1;};}function handleError(_0x1b3254,_0x396234){_0x396234=_0x396234||0x1f4;return function(_0x1ba693){logger['error'](_0x1ba693['stack']);if(_0x1ba693[_0xdbc3('0x30')]){delete _0x1ba693['name'];}_0x1b3254[_0xdbc3('0x2e')](_0x396234)[_0xdbc3('0x31')](_0x1ba693);};}exports['index']=function(_0xc93138,_0x51241b){var _0x1c9240={},_0x1a5fdb={},_0x3d546d={'count':0x0,'rows':[]};var _0x587547=_['map'](db['SmsQueue'][_0xdbc3('0x32')],function(_0x38d926){return{'name':_0x38d926[_0xdbc3('0x33')],'type':_0x38d926['type'][_0xdbc3('0x34')]};});_0x1a5fdb[_0xdbc3('0x35')]=_[_0xdbc3('0x36')](_0x587547,_0xdbc3('0x30'));_0x1a5fdb[_0xdbc3('0x37')]=_[_0xdbc3('0x38')](_0xc93138[_0xdbc3('0x37')]);_0x1a5fdb[_0xdbc3('0x39')]=_[_0xdbc3('0x3a')](_0x1a5fdb[_0xdbc3('0x35')],_0x1a5fdb[_0xdbc3('0x37')]);_0x1c9240[_0xdbc3('0x3b')]=_[_0xdbc3('0x3a')](_0x1a5fdb[_0xdbc3('0x35')],qs[_0xdbc3('0x3c')](_0xc93138['query'][_0xdbc3('0x3c')]));_0x1c9240['attributes']=_0x1c9240[_0xdbc3('0x3b')][_0xdbc3('0x3d')]?_0x1c9240[_0xdbc3('0x3b')]:_0x1a5fdb[_0xdbc3('0x35')];if(!_0xc93138[_0xdbc3('0x37')][_0xdbc3('0x3e')]('nolimit')){_0x1c9240[_0xdbc3('0x24')]=qs[_0xdbc3('0x24')](_0xc93138['query']['limit']);_0x1c9240['offset']=qs['offset'](_0xc93138[_0xdbc3('0x37')][_0xdbc3('0x22')]);}_0x1c9240[_0xdbc3('0x3f')]=qs[_0xdbc3('0x40')](_0xc93138[_0xdbc3('0x37')][_0xdbc3('0x40')]);_0x1c9240['where']=qs['filters'](_[_0xdbc3('0x41')](_0xc93138['query'],_0x1a5fdb[_0xdbc3('0x39')]),_0x587547);if(_0xc93138['query'][_0xdbc3('0x42')]){_0x1c9240[_0xdbc3('0x43')]=_[_0xdbc3('0x44')](_0x1c9240[_0xdbc3('0x43')],{'$or':_[_0xdbc3('0x36')](_0x587547,function(_0x18719f){if(_0x18719f[_0xdbc3('0x45')]!==_0xdbc3('0x46')){var _0x2a009c={};_0x2a009c[_0x18719f[_0xdbc3('0x30')]]={'$like':'%'+_0xc93138[_0xdbc3('0x37')][_0xdbc3('0x42')]+'%'};return _0x2a009c;}})});}_0x1c9240=_[_0xdbc3('0x44')]({},_0x1c9240,_0xc93138[_0xdbc3('0x47')]);var _0x4a83d8={'where':_0x1c9240[_0xdbc3('0x43')]};return db['SmsQueue'][_0xdbc3('0x25')](_0x4a83d8)[_0xdbc3('0x2b')](function(_0x415340){_0x3d546d[_0xdbc3('0x25')]=_0x415340;if(_0xc93138[_0xdbc3('0x37')][_0xdbc3('0x48')]){_0x1c9240['include']=[{'all':!![]}];}return db[_0xdbc3('0x49')][_0xdbc3('0x4a')](_0x1c9240);})['then'](function(_0x3acb87){_0x3d546d['rows']=_0x3acb87;return _0x3d546d;})['then'](respondWithFilteredResult(_0x51241b,_0x1c9240))[_0xdbc3('0x4b')](handleError(_0x51241b,null));};exports[_0xdbc3('0x4c')]=function(_0x3a9c34,_0xe433f4){var _0x1581de={'raw':!![],'where':{'id':_0x3a9c34[_0xdbc3('0x4d')]['id']}},_0xbc26fb={};_0xbc26fb[_0xdbc3('0x35')]=_[_0xdbc3('0x38')](db[_0xdbc3('0x49')]['rawAttributes']);_0xbc26fb[_0xdbc3('0x37')]=_[_0xdbc3('0x38')](_0x3a9c34[_0xdbc3('0x37')]);_0xbc26fb[_0xdbc3('0x39')]=_[_0xdbc3('0x3a')](_0xbc26fb[_0xdbc3('0x35')],_0xbc26fb[_0xdbc3('0x37')]);_0x1581de['attributes']=_[_0xdbc3('0x3a')](_0xbc26fb[_0xdbc3('0x35')],qs[_0xdbc3('0x3c')](_0x3a9c34[_0xdbc3('0x37')][_0xdbc3('0x3c')]));_0x1581de['attributes']=_0x1581de[_0xdbc3('0x3b')][_0xdbc3('0x3d')]?_0x1581de[_0xdbc3('0x3b')]:_0xbc26fb[_0xdbc3('0x35')];if(_0x3a9c34[_0xdbc3('0x37')][_0xdbc3('0x48')]){_0x1581de['include']=[{'all':!![]}];}_0x1581de=_[_0xdbc3('0x44')]({},_0x1581de,_0x3a9c34[_0xdbc3('0x47')]);return db['SmsQueue'][_0xdbc3('0x4e')](_0x1581de)['then'](handleEntityNotFound(_0xe433f4,null))[_0xdbc3('0x2b')](respondWithResult(_0xe433f4,null))[_0xdbc3('0x4b')](handleError(_0xe433f4,null));};exports[_0xdbc3('0x4f')]=function(_0x54d676,_0x471e55){return db[_0xdbc3('0x49')][_0xdbc3('0x4f')](_0x54d676[_0xdbc3('0x50')],{})['then'](function(_0x3b5c50){var _0x23a6b6=_0x54d676[_0xdbc3('0x51')][_0xdbc3('0x52')]({'plain':!![]});if(!_0x23a6b6)throw new Error(_0xdbc3('0x53'));if(_0x23a6b6[_0xdbc3('0x54')]==='user'){var _0xe4fdf=_0x3b5c50['get']({'plain':!![]});var _0x37adc3=_0xdbc3('0x55');return db['UserProfileSection']['find']({'where':{'name':_0x37adc3,'userProfileId':_0x23a6b6[_0xdbc3('0x56')]},'raw':!![]})[_0xdbc3('0x2b')](function(_0xc4557a){if(_0xc4557a&&_0xc4557a[_0xdbc3('0x57')]===0x0){return db[_0xdbc3('0x2d')]['create']({'name':_0xe4fdf[_0xdbc3('0x30')],'resourceId':_0xe4fdf['id'],'type':_0xc4557a[_0xdbc3('0x30')],'sectionId':_0xc4557a['id']},{})[_0xdbc3('0x2b')](function(){return _0x3b5c50;});}else{return _0x3b5c50;}})[_0xdbc3('0x4b')](function(_0x525e6e){logger[_0xdbc3('0x58')](_0xdbc3('0x59'),_0x525e6e);throw _0x525e6e;});}return _0x3b5c50;})[_0xdbc3('0x2b')](respondWithResult(_0x471e55,0xc9))['catch'](handleError(_0x471e55,null));};exports[_0xdbc3('0x2a')]=function(_0x1996c5,_0x175c38){if(_0x1996c5['body']['id']){delete _0x1996c5['body']['id'];}return db[_0xdbc3('0x49')][_0xdbc3('0x4e')]({'where':{'id':_0x1996c5['params']['id']}})[_0xdbc3('0x2b')](handleEntityNotFound(_0x175c38,null))[_0xdbc3('0x2b')](saveUpdates(_0x1996c5[_0xdbc3('0x50')],null))['then'](respondWithResult(_0x175c38,null))[_0xdbc3('0x4b')](handleError(_0x175c38,null));};exports[_0xdbc3('0x2c')]=function(_0x288c1e,_0xc8b8e5){return db[_0xdbc3('0x49')]['find']({'where':{'id':_0x288c1e[_0xdbc3('0x4d')]['id']}})[_0xdbc3('0x2b')](handleEntityNotFound(_0xc8b8e5,null))[_0xdbc3('0x2b')](removeEntity(_0xc8b8e5,null))[_0xdbc3('0x4b')](handleError(_0xc8b8e5,null));};exports['describe']=function(_0x15b304,_0x37e8f5){return db[_0xdbc3('0x49')][_0xdbc3('0x5a')]()['then'](respondWithResult(_0x37e8f5,null))['catch'](handleError(_0x37e8f5,null));};exports[_0xdbc3('0x5b')]=function(_0xa44f59,_0x4ee62a,_0x5dbb81){var _0x12a092={'raw':!![],'where':{}},_0x57703c={},_0x5bc213;return db[_0xdbc3('0x49')][_0xdbc3('0x5c')]({'where':{'id':_0xa44f59[_0xdbc3('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4ee62a,null))[_0xdbc3('0x2b')](function(_0x480421){if(_0x480421){_0x5bc213=_0x480421[_0xdbc3('0x52')]({'plain':!![]});_0x57703c[_0xdbc3('0x35')]=_[_0xdbc3('0x38')](db[_0xdbc3('0x5d')][_0xdbc3('0x32')]);_0x57703c[_0xdbc3('0x37')]=_['keys'](_0xa44f59[_0xdbc3('0x37')]);_0x57703c[_0xdbc3('0x39')]=_[_0xdbc3('0x3a')](_0x57703c[_0xdbc3('0x35')],_0x57703c[_0xdbc3('0x37')]);_0x12a092[_0xdbc3('0x3b')]=_[_0xdbc3('0x3a')](_0x57703c[_0xdbc3('0x35')],qs['fields'](_0xa44f59[_0xdbc3('0x37')]['fields']));_0x12a092[_0xdbc3('0x3b')]=_0x12a092[_0xdbc3('0x3b')][_0xdbc3('0x3d')]?_0x12a092[_0xdbc3('0x3b')]:_0x57703c[_0xdbc3('0x35')];if(!_0xa44f59[_0xdbc3('0x37')][_0xdbc3('0x3e')](_0xdbc3('0x5e'))){_0x12a092[_0xdbc3('0x24')]=qs[_0xdbc3('0x24')](_0xa44f59[_0xdbc3('0x37')][_0xdbc3('0x24')]);_0x12a092[_0xdbc3('0x22')]=qs['offset'](_0xa44f59[_0xdbc3('0x37')]['offset']);}_0x12a092[_0xdbc3('0x3f')]=qs[_0xdbc3('0x40')](_0xa44f59[_0xdbc3('0x37')]['sort']);_0x12a092[_0xdbc3('0x43')]=qs[_0xdbc3('0x39')](_[_0xdbc3('0x41')](_0xa44f59[_0xdbc3('0x37')],_0x57703c[_0xdbc3('0x39')]));_0x12a092['where'][_0xdbc3('0x5f')]=_0x480421['id'];if(_0xa44f59[_0xdbc3('0x37')]['filter']){_0x12a092['where']=_['merge'](_0x12a092[_0xdbc3('0x43')],{'$or':_[_0xdbc3('0x36')](_0x12a092['attributes'],function(_0x319531){var _0x2c5b4b={};_0x2c5b4b[_0x319531]={'$like':'%'+_0xa44f59[_0xdbc3('0x37')][_0xdbc3('0x42')]+'%'};return _0x2c5b4b;})});}_0x12a092=_['merge']({},_0x12a092,_0xa44f59[_0xdbc3('0x47')]);return db[_0xdbc3('0x5d')]['findAll'](_0x12a092);}})['then'](function(_0x147cc4){if(_0x147cc4){return db[_0xdbc3('0x60')]['findAndCountAll']({'where':{'id':_['map'](_0x147cc4,'UserId'),'role':'agent'},'attributes':['id',_0xdbc3('0x30'),_0xdbc3('0x61'),_0xdbc3('0x62'),_0xdbc3('0x63')]});}})[_0xdbc3('0x2b')](function(_0x333c53){if(_0x333c53){return{'count':_0x333c53[_0xdbc3('0x25')],'rows':_['map'](_0x333c53[_0xdbc3('0x64')],function(_0x4f61ac){return{'membername':_0x4f61ac[_0xdbc3('0x30')],'UserId':_0x4f61ac['id'],'queue_name':_0x5bc213[_0xdbc3('0x30')],'SmsQueueId':_0x5bc213['id'],'interface':util[_0xdbc3('0x65')]('%s/%s',_0xdbc3('0x66'),_0x4f61ac['name']),'penalty':0x0,'paused':_0x4f61ac[_0xdbc3('0x61')],'createdAt':_0x4f61ac['createdAt'],'updatedAt':_0x4f61ac[_0xdbc3('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xdbc3('0x2b')](respondWithFilteredResult(_0x4ee62a,_0x12a092))['catch'](handleError(_0x4ee62a,null));};exports[_0xdbc3('0x67')]=function(_0x1054f6,_0x4f5306,_0x5602bc){var _0x447f56={};var _0x46bac5={};var _0x43b2eb;var _0x10982b;return db[_0xdbc3('0x49')][_0xdbc3('0x5c')]({'where':{'id':_0x1054f6[_0xdbc3('0x4d')]['id']}})[_0xdbc3('0x2b')](handleEntityNotFound(_0x4f5306,null))[_0xdbc3('0x2b')](function(_0x57c865){if(_0x57c865){_0x43b2eb=_0x57c865;_0x46bac5[_0xdbc3('0x35')]=_[_0xdbc3('0x38')](db[_0xdbc3('0x68')]['rawAttributes']);_0x46bac5[_0xdbc3('0x37')]=_[_0xdbc3('0x38')](_0x1054f6[_0xdbc3('0x37')]);_0x46bac5[_0xdbc3('0x39')]=_[_0xdbc3('0x3a')](_0x46bac5[_0xdbc3('0x35')],_0x46bac5[_0xdbc3('0x37')]);_0x447f56[_0xdbc3('0x3b')]=_[_0xdbc3('0x3a')](_0x46bac5[_0xdbc3('0x35')],qs[_0xdbc3('0x3c')](_0x1054f6['query'][_0xdbc3('0x3c')]));_0x447f56[_0xdbc3('0x3b')]=_0x447f56[_0xdbc3('0x3b')][_0xdbc3('0x3d')]?_0x447f56['attributes']:_0x46bac5['model'];_0x447f56[_0xdbc3('0x3f')]=qs['sort'](_0x1054f6[_0xdbc3('0x37')][_0xdbc3('0x40')]);_0x447f56[_0xdbc3('0x43')]=qs[_0xdbc3('0x39')](_[_0xdbc3('0x41')](_0x1054f6[_0xdbc3('0x37')],_0x46bac5[_0xdbc3('0x39')]));if(_0x1054f6[_0xdbc3('0x37')][_0xdbc3('0x42')]){_0x447f56['where']=_[_0xdbc3('0x44')](_0x447f56[_0xdbc3('0x43')],{'$or':_[_0xdbc3('0x36')](_0x447f56[_0xdbc3('0x3b')],function(_0x52fae1){var _0x3195a8={};_0x3195a8[_0x52fae1]={'$like':'%'+_0x1054f6[_0xdbc3('0x37')][_0xdbc3('0x42')]+'%'};return _0x3195a8;})});}_0x447f56=_['merge']({},_0x447f56,_0x1054f6['options']);return _0x43b2eb['getTeams'](_0x447f56);}})[_0xdbc3('0x2b')](function(_0x80e21e){if(_0x80e21e){_0x10982b=_0x80e21e['length'];if(!_0x1054f6['query'][_0xdbc3('0x3e')](_0xdbc3('0x5e'))){_0x447f56[_0xdbc3('0x24')]=qs[_0xdbc3('0x24')](_0x1054f6[_0xdbc3('0x37')][_0xdbc3('0x24')]);_0x447f56[_0xdbc3('0x22')]=qs[_0xdbc3('0x22')](_0x1054f6[_0xdbc3('0x37')][_0xdbc3('0x22')]);}return _0x43b2eb[_0xdbc3('0x67')](_0x447f56);}})[_0xdbc3('0x2b')](function(_0x461c74){if(_0x461c74){return _0x461c74?{'count':_0x10982b,'rows':_0x461c74}:null;}})[_0xdbc3('0x2b')](respondWithResult(_0x4f5306,null))[_0xdbc3('0x4b')](handleError(_0x4f5306,null));};exports[_0xdbc3('0x69')]=function(_0x558a51,_0x524a44,_0x45c2f1){var _0x38c0a9=_0x558a51[_0xdbc3('0x50')]['ids'];return db[_0xdbc3('0x68')][_0xdbc3('0x4a')]({'where':{'id':_0x38c0a9},'attributes':['id'],'include':[{'model':db[_0xdbc3('0x60')],'as':_0xdbc3('0x6a'),'attributes':['id',_0xdbc3('0x30'),_0xdbc3('0x6b'),_0xdbc3('0x6c'),_0xdbc3('0x6d')],'raw':!![]}]})['then'](function(_0x2dff8e){if(_0x2dff8e){var _0x242070=_[_0xdbc3('0x6e')](_0x2dff8e,function(_0x20ef44){var _0x50337d=_0x20ef44[_0xdbc3('0x52')]({'plain':!![]});return _0x50337d[_0xdbc3('0x6a')];});return db['SmsQueue'][_0xdbc3('0x4e')]({'where':{'id':_0x558a51[_0xdbc3('0x4d')]['id']}})[_0xdbc3('0x2b')](function(_0x44b8f6){return db[_0xdbc3('0x6f')]['transaction'](function(_0x5df37a){return _0x44b8f6[_0xdbc3('0x69')](_0x38c0a9,{'transaction':_0x5df37a})[_0xdbc3('0x2b')](function(){return BPromise['each'](_0x242070,function(_0x427a3d){return db[_0xdbc3('0x5d')][_0xdbc3('0x70')]({'where':{'UserId':_0x427a3d['id'],'SmsQueueId':_0x558a51[_0xdbc3('0x4d')]['id']},'transaction':_0x5df37a});});})[_0xdbc3('0x2b')](function(){_0x242070['forEach'](function(_0x306d0d){socket['emit'](_0xdbc3('0x71'),{'UserId':_0x306d0d['id'],'SmsQueueId':_0x44b8f6['id']});});});});});}})[_0xdbc3('0x2b')](respondWithStatusCode(_0x524a44,null))[_0xdbc3('0x4b')](handleError(_0x524a44,null));};exports['removeTeams']=function(_0x2f2d83,_0x467ddd,_0x5bd6c3){return db[_0xdbc3('0x68')]['findAll']({'where':{'id':_0x2f2d83[_0xdbc3('0x37')][_0xdbc3('0x72')]},'attributes':['id'],'include':[{'model':db[_0xdbc3('0x60')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xdbc3('0x2b')](handleEntityNotFound(_0x467ddd,null))['then'](function(_0x113e98){var _0xb2278a=_['map'](_0x113e98,'id');var _0x51a968=[];var _0x82a742=[];var _0x54ffe3=squel[_0xdbc3('0x73')]();_0x54ffe3[_0xdbc3('0x74')](_0xdbc3('0x75'))[_0xdbc3('0x76')](_0xdbc3('0x77'),'tq')[_0xdbc3('0x78')](_0xdbc3('0x79'),'ut',_0xdbc3('0x7a'))[_0xdbc3('0x43')](_0xdbc3('0x7b'),_0x2f2d83[_0xdbc3('0x4d')]['id']);for(var _0x4c09d6=0x0;_0x4c09d6<_0x113e98['length'];_0x4c09d6+=0x1){let _0x3d1a98=_0x113e98[_0x4c09d6];for(var _0x2e51c3=0x0;_0x2e51c3<_0x3d1a98[_0xdbc3('0x6a')][_0xdbc3('0x3d')];_0x2e51c3+=0x1){let _0x5550e1=_0x3d1a98[_0xdbc3('0x6a')][_0x2e51c3];var _0x5350dd=_0x54ffe3[_0xdbc3('0x7c')]();_0x5350dd[_0xdbc3('0x43')](_0xdbc3('0x7d'),_0x5550e1['id']);_0x82a742['push'](db['sequelize'][_0xdbc3('0x37')](_0x5350dd['toString'](),{'type':db['sequelize'][_0xdbc3('0x7e')]['SELECT']})[_0xdbc3('0x2b')](function(_0x31c75a){if(_0x31c75a['length']===0x1){return _0x5550e1['id'];}else{var _0x5e677d=_[_0xdbc3('0x7f')](_['map'](_0x31c75a,_0xdbc3('0x80')),function(_0x43cf39){return _[_0xdbc3('0x81')](_0xb2278a,_0x43cf39);});if(_0x5e677d){return _0x5550e1['id'];}}}));}}return BPromise[_0xdbc3('0x82')](_0x82a742)[_0xdbc3('0x2b')](function(_0x2e492c){_0x51a968=_(_0x51a968)[_0xdbc3('0x83')](_0x2e492c)[_0xdbc3('0x84')]()['value']();return db[_0xdbc3('0x49')][_0xdbc3('0x4e')]({'where':{'id':_0x2f2d83[_0xdbc3('0x4d')]['id']}})[_0xdbc3('0x2b')](function(_0x39b9b3){return db[_0xdbc3('0x6f')][_0xdbc3('0x85')](function(_0x100425){return _0x39b9b3['removeTeams'](_0x2f2d83[_0xdbc3('0x37')][_0xdbc3('0x72')],{'transaction':_0x100425})[_0xdbc3('0x2b')](function(){if(!_[_0xdbc3('0x86')](_0x51a968)){return _0x39b9b3['removeAgents'](_0x51a968,{'transaction':_0x100425});}})['then'](function(){_0x51a968[_0xdbc3('0x87')](function(_0x4803f4){socket[_0xdbc3('0x88')]('userSmsQueue:remove',{'UserId':_0x4803f4,'SmsQueueId':_0x39b9b3['id']});});});});});});})['then'](respondWithStatusCode(_0x467ddd,null))[_0xdbc3('0x4b')](handleError(_0x467ddd,null));};exports[_0xdbc3('0x89')]=function(_0x584781,_0x39bff4,_0x547bd3){return db[_0xdbc3('0x49')]['find']({'where':{'id':_0x584781['params']['id']}})[_0xdbc3('0x2b')](handleEntityNotFound(_0x39bff4,null))[_0xdbc3('0x2b')](function(_0x1ea6db){if(_0x1ea6db){return _0x1ea6db[_0xdbc3('0x89')](_0x584781[_0xdbc3('0x50')][_0xdbc3('0x72')],_[_0xdbc3('0x8a')](_0x584781[_0xdbc3('0x50')],[_0xdbc3('0x72'),'id'])||{})[_0xdbc3('0x8b')](function(_0x296b50){for(var _0x1610b1=0x0;_0x1610b1<_0x584781['body'][_0xdbc3('0x72')]['length'];_0x1610b1+=0x1){socket[_0xdbc3('0x88')](_0xdbc3('0x71'),{'UserId':Number(_0x584781[_0xdbc3('0x50')][_0xdbc3('0x72')][_0x1610b1]),'SmsQueueId':Number(_0x584781[_0xdbc3('0x4d')]['id'])});}return _0x296b50;});}})[_0xdbc3('0x2b')](respondWithResult(_0x39bff4,null))[_0xdbc3('0x4b')](handleError(_0x39bff4,null));};exports[_0xdbc3('0x8c')]=function(_0x536539,_0x3cbc86,_0x4f181a){return db[_0xdbc3('0x49')][_0xdbc3('0x4e')]({'where':{'id':_0x536539[_0xdbc3('0x4d')]['id']}})[_0xdbc3('0x2b')](handleEntityNotFound(_0x3cbc86,null))[_0xdbc3('0x2b')](function(_0x242e3d){if(_0x242e3d){return _0x242e3d[_0xdbc3('0x8c')](_0x536539[_0xdbc3('0x37')]['ids'])[_0xdbc3('0x2b')](function(){if(_[_0xdbc3('0x8d')](_0x536539[_0xdbc3('0x37')][_0xdbc3('0x72')])){for(var _0x4d6df5=0x0;_0x4d6df5<_0x536539[_0xdbc3('0x37')][_0xdbc3('0x72')]['length'];_0x4d6df5+=0x1){socket[_0xdbc3('0x88')](_0xdbc3('0x8e'),{'UserId':Number(_0x536539[_0xdbc3('0x37')][_0xdbc3('0x72')][_0x4d6df5]),'SmsQueueId':Number(_0x536539[_0xdbc3('0x4d')]['id'])});}}else{socket['emit'](_0xdbc3('0x8e'),{'UserId':Number(_0x536539['query'][_0xdbc3('0x72')]),'SmsQueueId':Number(_0x536539['params']['id'])});}});}})['then'](respondWithStatusCode(_0x3cbc86,null))[_0xdbc3('0x4b')](handleError(_0x3cbc86,null));};exports[_0xdbc3('0x8f')]=function(_0x2ccbc6,_0x1a14e6,_0x4bf126){var _0x5e43ca={};var _0x57f8d1={};var _0xc112b8;var _0x36e5c4;return db[_0xdbc3('0x49')][_0xdbc3('0x5c')]({'where':{'id':_0x2ccbc6[_0xdbc3('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1a14e6,null))[_0xdbc3('0x2b')](function(_0x3d85ff){if(_0x3d85ff){_0xc112b8=_0x3d85ff;_0x57f8d1[_0xdbc3('0x35')]=_[_0xdbc3('0x38')](db[_0xdbc3('0x60')][_0xdbc3('0x32')]);_0x57f8d1[_0xdbc3('0x37')]=_[_0xdbc3('0x38')](_0x2ccbc6['query']);_0x57f8d1[_0xdbc3('0x39')]=_[_0xdbc3('0x3a')](_0x57f8d1[_0xdbc3('0x35')],_0x57f8d1[_0xdbc3('0x37')]);_0x5e43ca['attributes']=_[_0xdbc3('0x3a')](_0x57f8d1[_0xdbc3('0x35')],qs[_0xdbc3('0x3c')](_0x2ccbc6['query'][_0xdbc3('0x3c')]));_0x5e43ca[_0xdbc3('0x3b')]=_0x5e43ca[_0xdbc3('0x3b')][_0xdbc3('0x3d')]?_0x5e43ca[_0xdbc3('0x3b')]:_0x57f8d1[_0xdbc3('0x35')];_0x5e43ca[_0xdbc3('0x3f')]=qs[_0xdbc3('0x40')](_0x2ccbc6[_0xdbc3('0x37')][_0xdbc3('0x40')]);_0x5e43ca[_0xdbc3('0x43')]=qs[_0xdbc3('0x39')](_[_0xdbc3('0x41')](_0x2ccbc6[_0xdbc3('0x37')],_0x57f8d1[_0xdbc3('0x39')]));if(_0x2ccbc6[_0xdbc3('0x37')][_0xdbc3('0x42')]){_0x5e43ca['where']=_[_0xdbc3('0x44')](_0x5e43ca[_0xdbc3('0x43')],{'$or':_[_0xdbc3('0x36')](_0x5e43ca['attributes'],function(_0x21e8f3){var _0x15bea8={};_0x15bea8[_0x21e8f3]={'$like':'%'+_0x2ccbc6[_0xdbc3('0x37')]['filter']+'%'};return _0x15bea8;})});}_0x5e43ca=_['merge']({},_0x5e43ca,_0x2ccbc6['options']);return _0xc112b8[_0xdbc3('0x8f')](_0x5e43ca);}})[_0xdbc3('0x2b')](function(_0x1d371e){if(_0x1d371e){_0x36e5c4=_0x1d371e[_0xdbc3('0x3d')];if(!_0x2ccbc6[_0xdbc3('0x37')]['hasOwnProperty'](_0xdbc3('0x5e'))){_0x5e43ca[_0xdbc3('0x24')]=qs[_0xdbc3('0x24')](_0x2ccbc6['query'][_0xdbc3('0x24')]);_0x5e43ca[_0xdbc3('0x22')]=qs['offset'](_0x2ccbc6[_0xdbc3('0x37')][_0xdbc3('0x22')]);}return _0xc112b8[_0xdbc3('0x8f')](_0x5e43ca);}})['then'](function(_0x164bc3){if(_0x164bc3){return _0x164bc3?{'count':_0x36e5c4,'rows':_0x164bc3}:null;}})[_0xdbc3('0x2b')](respondWithResult(_0x1a14e6,null))['catch'](handleError(_0x1a14e6,null));}; \ No newline at end of file +var _0x4f41=['keys','filters','intersection','attributes','fields','nolimit','sort','where','filter','merge','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','user','role','SmsQueues','UserProfileSection','userProfileId','autoAssociation','describe','getMembers','findOne','UserSmsQueue','hasOwnProperty','pick','SmsQueueId','User','UserId','smsPause','createdAt','format','%s/%s','SIP','getTeams','Team','order','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','removeTeams','select','field','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','TeamId','union','compact','isEmpty','removeAgents','emit','addAgents','omit','spread','userSmsQueue:save','userSmsQueue:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','end','error','index','map','SmsQueue','rawAttributes','type','key','model','name','query'];(function(_0x16d147,_0x5bf739){var _0x3764c6=function(_0x1698ac){while(--_0x1698ac){_0x16d147['push'](_0x16d147['shift']());}};_0x3764c6(++_0x5bf739);}(_0x4f41,0xdd));var _0x14f4=function(_0x1d930e,_0x20d8b8){_0x1d930e=_0x1d930e-0x0;var _0x5bbd66=_0x4f41[_0x1d930e];return _0x5bbd66;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x14f4('0x0'));var zipdir=require(_0x14f4('0x1'));var jsonpatch=require(_0x14f4('0x2'));var rp=require(_0x14f4('0x3'));var moment=require(_0x14f4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x14f4('0x5'));var util=require(_0x14f4('0x6'));var path=require(_0x14f4('0x7'));var sox=require('sox');var csv=require(_0x14f4('0x8'));var ejs=require(_0x14f4('0x9'));var fs=require('fs');var fs_extra=require(_0x14f4('0xa'));var _=require(_0x14f4('0xb'));var squel=require(_0x14f4('0xc'));var crypto=require(_0x14f4('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x14f4('0xe'));var toCsv=require('to-csv');var querystring=require(_0x14f4('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x14f4('0x10'));var qs=require(_0x14f4('0x11'));var as=require(_0x14f4('0x12'));var hardwareService=require(_0x14f4('0x13'));var logger=require('../../config/logger')(_0x14f4('0x14'));var utils=require(_0x14f4('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x14f4('0x16'));var db=require(_0x14f4('0x17'))['db'];config[_0x14f4('0x18')]=_['defaults'](config['redis'],{'host':_0x14f4('0x19'),'port':0x18eb});var socket=require(_0x14f4('0x1a'))(new Redis(config[_0x14f4('0x18')]));require('./smsQueue.socket')[_0x14f4('0x1b')](socket);function respondWithStatusCode(_0x4ea5cd,_0x53aaa3){_0x53aaa3=_0x53aaa3||0xcc;return function(_0x3d4250){if(_0x3d4250){return _0x4ea5cd['sendStatus'](_0x53aaa3);}return _0x4ea5cd[_0x14f4('0x1c')](_0x53aaa3)['end']();};}function respondWithResult(_0x25285d,_0x303cae){_0x303cae=_0x303cae||0xc8;return function(_0x425b62){if(_0x425b62){return _0x25285d[_0x14f4('0x1c')](_0x303cae)[_0x14f4('0x1d')](_0x425b62);}};}function respondWithFilteredResult(_0x56f319,_0x148488){return function(_0x33faba){if(_0x33faba){var _0x3bf390=typeof _0x148488[_0x14f4('0x1e')]===_0x14f4('0x1f')&&typeof _0x148488[_0x14f4('0x20')]===_0x14f4('0x1f');var _0x30a638=_0x33faba[_0x14f4('0x21')];var _0x4248f6=_0x3bf390?0x0:_0x148488[_0x14f4('0x1e')];var _0x330a47=_0x3bf390?_0x33faba[_0x14f4('0x21')]:_0x148488['offset']+_0x148488[_0x14f4('0x20')];var _0x313130;if(_0x330a47>=_0x30a638){_0x330a47=_0x30a638;_0x313130=0xc8;}else{_0x313130=0xce;}_0x56f319[_0x14f4('0x1c')](_0x313130);return _0x56f319[_0x14f4('0x22')](_0x14f4('0x23'),_0x4248f6+'-'+_0x330a47+'/'+_0x30a638)[_0x14f4('0x1d')](_0x33faba);}return null;};}function patchUpdates(_0x16e7e3){return function(_0x4af16d){try{jsonpatch[_0x14f4('0x24')](_0x4af16d,_0x16e7e3,!![]);}catch(_0x2f249e){return BPromise[_0x14f4('0x25')](_0x2f249e);}return _0x4af16d[_0x14f4('0x26')]();};}function saveUpdates(_0x3cdc4e,_0x194ea2){return function(_0x5c7c34){if(_0x5c7c34){return _0x5c7c34[_0x14f4('0x27')](_0x3cdc4e)[_0x14f4('0x28')](function(_0x4940ed){return _0x4940ed;});}return null;};}function removeEntity(_0x3b9bea,_0x1ed0c3){return function(_0x4c1f24){if(_0x4c1f24){return _0x4c1f24[_0x14f4('0x29')]()[_0x14f4('0x28')](function(){var _0xca507f=_0x4c1f24[_0x14f4('0x2a')]({'plain':!![]});var _0x1ab97f='SmsQueues';return db[_0x14f4('0x2b')]['destroy']({'where':{'type':_0x1ab97f,'resourceId':_0xca507f['id']}})[_0x14f4('0x28')](function(){return _0x4c1f24;});})[_0x14f4('0x28')](function(){_0x3b9bea[_0x14f4('0x1c')](0xcc)[_0x14f4('0x2c')]();});}};}function handleEntityNotFound(_0x8b5bf8,_0x26f77d){return function(_0xe0fc7d){if(!_0xe0fc7d){_0x8b5bf8['sendStatus'](0x194);}return _0xe0fc7d;};}function handleError(_0xa9b3d3,_0x1d8340){_0x1d8340=_0x1d8340||0x1f4;return function(_0xe886ea){logger[_0x14f4('0x2d')](_0xe886ea['stack']);if(_0xe886ea['name']){delete _0xe886ea['name'];}_0xa9b3d3['status'](_0x1d8340)['send'](_0xe886ea);};}exports[_0x14f4('0x2e')]=function(_0x2ac100,_0x2de057){var _0x159cfd={},_0x238073={},_0x4f13ab={'count':0x0,'rows':[]};var _0x46c082=_[_0x14f4('0x2f')](db[_0x14f4('0x30')][_0x14f4('0x31')],function(_0x23e32a){return{'name':_0x23e32a['fieldName'],'type':_0x23e32a[_0x14f4('0x32')][_0x14f4('0x33')]};});_0x238073[_0x14f4('0x34')]=_[_0x14f4('0x2f')](_0x46c082,_0x14f4('0x35'));_0x238073[_0x14f4('0x36')]=_[_0x14f4('0x37')](_0x2ac100[_0x14f4('0x36')]);_0x238073[_0x14f4('0x38')]=_[_0x14f4('0x39')](_0x238073['model'],_0x238073[_0x14f4('0x36')]);_0x159cfd[_0x14f4('0x3a')]=_[_0x14f4('0x39')](_0x238073[_0x14f4('0x34')],qs['fields'](_0x2ac100['query'][_0x14f4('0x3b')]));_0x159cfd['attributes']=_0x159cfd[_0x14f4('0x3a')]['length']?_0x159cfd[_0x14f4('0x3a')]:_0x238073[_0x14f4('0x34')];if(!_0x2ac100[_0x14f4('0x36')]['hasOwnProperty'](_0x14f4('0x3c'))){_0x159cfd[_0x14f4('0x20')]=qs[_0x14f4('0x20')](_0x2ac100[_0x14f4('0x36')][_0x14f4('0x20')]);_0x159cfd['offset']=qs['offset'](_0x2ac100[_0x14f4('0x36')][_0x14f4('0x1e')]);}_0x159cfd['order']=qs[_0x14f4('0x3d')](_0x2ac100[_0x14f4('0x36')]['sort']);_0x159cfd[_0x14f4('0x3e')]=qs[_0x14f4('0x38')](_['pick'](_0x2ac100['query'],_0x238073[_0x14f4('0x38')]),_0x46c082);if(_0x2ac100[_0x14f4('0x36')][_0x14f4('0x3f')]){_0x159cfd['where']=_[_0x14f4('0x40')](_0x159cfd[_0x14f4('0x3e')],{'$or':_[_0x14f4('0x2f')](_0x46c082,function(_0x3982cf){if(_0x3982cf[_0x14f4('0x32')]!=='VIRTUAL'){var _0x5e6a8d={};_0x5e6a8d[_0x3982cf['name']]={'$like':'%'+_0x2ac100[_0x14f4('0x36')][_0x14f4('0x3f')]+'%'};return _0x5e6a8d;}})});}_0x159cfd=_[_0x14f4('0x40')]({},_0x159cfd,_0x2ac100['options']);var _0x14b3b6={'where':_0x159cfd[_0x14f4('0x3e')]};return db['SmsQueue'][_0x14f4('0x21')](_0x14b3b6)[_0x14f4('0x28')](function(_0x339d6c){_0x4f13ab[_0x14f4('0x21')]=_0x339d6c;if(_0x2ac100['query'][_0x14f4('0x41')]){_0x159cfd[_0x14f4('0x42')]=[{'all':!![]}];}return db[_0x14f4('0x30')][_0x14f4('0x43')](_0x159cfd);})['then'](function(_0x501b9e){_0x4f13ab[_0x14f4('0x44')]=_0x501b9e;return _0x4f13ab;})[_0x14f4('0x28')](respondWithFilteredResult(_0x2de057,_0x159cfd))[_0x14f4('0x45')](handleError(_0x2de057,null));};exports[_0x14f4('0x46')]=function(_0x298394,_0x8646ee){var _0x30b0ea={'raw':!![],'where':{'id':_0x298394[_0x14f4('0x47')]['id']}},_0x42f72e={};_0x42f72e['model']=_[_0x14f4('0x37')](db[_0x14f4('0x30')]['rawAttributes']);_0x42f72e[_0x14f4('0x36')]=_[_0x14f4('0x37')](_0x298394[_0x14f4('0x36')]);_0x42f72e['filters']=_[_0x14f4('0x39')](_0x42f72e[_0x14f4('0x34')],_0x42f72e['query']);_0x30b0ea[_0x14f4('0x3a')]=_[_0x14f4('0x39')](_0x42f72e[_0x14f4('0x34')],qs[_0x14f4('0x3b')](_0x298394[_0x14f4('0x36')]['fields']));_0x30b0ea[_0x14f4('0x3a')]=_0x30b0ea[_0x14f4('0x3a')][_0x14f4('0x48')]?_0x30b0ea[_0x14f4('0x3a')]:_0x42f72e[_0x14f4('0x34')];if(_0x298394[_0x14f4('0x36')][_0x14f4('0x41')]){_0x30b0ea[_0x14f4('0x42')]=[{'all':!![]}];}_0x30b0ea=_[_0x14f4('0x40')]({},_0x30b0ea,_0x298394[_0x14f4('0x49')]);return db['SmsQueue'][_0x14f4('0x4a')](_0x30b0ea)[_0x14f4('0x28')](handleEntityNotFound(_0x8646ee,null))[_0x14f4('0x28')](respondWithResult(_0x8646ee,null))['catch'](handleError(_0x8646ee,null));};exports['create']=function(_0xb3c73d,_0x56ede8){return db[_0x14f4('0x30')][_0x14f4('0x4b')](_0xb3c73d[_0x14f4('0x4c')],{})['then'](function(_0x5736e6){var _0x477fd7=_0xb3c73d[_0x14f4('0x4d')]['get']({'plain':!![]});if(!_0x477fd7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x477fd7[_0x14f4('0x4e')]===_0x14f4('0x4d')){var _0x51bd68=_0x5736e6[_0x14f4('0x2a')]({'plain':!![]});var _0x3a5ba7=_0x14f4('0x4f');return db[_0x14f4('0x50')]['find']({'where':{'name':_0x3a5ba7,'userProfileId':_0x477fd7[_0x14f4('0x51')]},'raw':!![]})[_0x14f4('0x28')](function(_0x417b92){if(_0x417b92&&_0x417b92[_0x14f4('0x52')]===0x0){return db[_0x14f4('0x2b')][_0x14f4('0x4b')]({'name':_0x51bd68[_0x14f4('0x35')],'resourceId':_0x51bd68['id'],'type':_0x417b92[_0x14f4('0x35')],'sectionId':_0x417b92['id']},{})[_0x14f4('0x28')](function(){return _0x5736e6;});}else{return _0x5736e6;}})[_0x14f4('0x45')](function(_0x323d83){logger[_0x14f4('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x323d83);throw _0x323d83;});}return _0x5736e6;})[_0x14f4('0x28')](respondWithResult(_0x56ede8,0xc9))['catch'](handleError(_0x56ede8,null));};exports[_0x14f4('0x27')]=function(_0x54374a,_0x3a3f87){if(_0x54374a[_0x14f4('0x4c')]['id']){delete _0x54374a['body']['id'];}return db[_0x14f4('0x30')][_0x14f4('0x4a')]({'where':{'id':_0x54374a['params']['id']}})[_0x14f4('0x28')](handleEntityNotFound(_0x3a3f87,null))[_0x14f4('0x28')](saveUpdates(_0x54374a['body'],null))[_0x14f4('0x28')](respondWithResult(_0x3a3f87,null))[_0x14f4('0x45')](handleError(_0x3a3f87,null));};exports[_0x14f4('0x29')]=function(_0x492a00,_0x3dba7d){return db[_0x14f4('0x30')]['find']({'where':{'id':_0x492a00['params']['id']}})[_0x14f4('0x28')](handleEntityNotFound(_0x3dba7d,null))[_0x14f4('0x28')](removeEntity(_0x3dba7d,null))[_0x14f4('0x45')](handleError(_0x3dba7d,null));};exports['describe']=function(_0x371753,_0x1a1af3){return db[_0x14f4('0x30')][_0x14f4('0x53')]()[_0x14f4('0x28')](respondWithResult(_0x1a1af3,null))['catch'](handleError(_0x1a1af3,null));};exports[_0x14f4('0x54')]=function(_0x16568d,_0x5635cb,_0x4ceea7){var _0x482441={'raw':!![],'where':{}},_0x59beeb={},_0x18ecdd;return db['SmsQueue'][_0x14f4('0x55')]({'where':{'id':_0x16568d['params']['id']}})[_0x14f4('0x28')](handleEntityNotFound(_0x5635cb,null))[_0x14f4('0x28')](function(_0x5be564){if(_0x5be564){_0x18ecdd=_0x5be564['get']({'plain':!![]});_0x59beeb[_0x14f4('0x34')]=_[_0x14f4('0x37')](db[_0x14f4('0x56')][_0x14f4('0x31')]);_0x59beeb[_0x14f4('0x36')]=_[_0x14f4('0x37')](_0x16568d[_0x14f4('0x36')]);_0x59beeb['filters']=_[_0x14f4('0x39')](_0x59beeb[_0x14f4('0x34')],_0x59beeb[_0x14f4('0x36')]);_0x482441[_0x14f4('0x3a')]=_[_0x14f4('0x39')](_0x59beeb[_0x14f4('0x34')],qs[_0x14f4('0x3b')](_0x16568d[_0x14f4('0x36')][_0x14f4('0x3b')]));_0x482441[_0x14f4('0x3a')]=_0x482441['attributes'][_0x14f4('0x48')]?_0x482441[_0x14f4('0x3a')]:_0x59beeb[_0x14f4('0x34')];if(!_0x16568d['query'][_0x14f4('0x57')](_0x14f4('0x3c'))){_0x482441['limit']=qs[_0x14f4('0x20')](_0x16568d[_0x14f4('0x36')][_0x14f4('0x20')]);_0x482441[_0x14f4('0x1e')]=qs[_0x14f4('0x1e')](_0x16568d[_0x14f4('0x36')]['offset']);}_0x482441['order']=qs[_0x14f4('0x3d')](_0x16568d[_0x14f4('0x36')]['sort']);_0x482441[_0x14f4('0x3e')]=qs[_0x14f4('0x38')](_[_0x14f4('0x58')](_0x16568d[_0x14f4('0x36')],_0x59beeb[_0x14f4('0x38')]));_0x482441[_0x14f4('0x3e')][_0x14f4('0x59')]=_0x5be564['id'];if(_0x16568d['query'][_0x14f4('0x3f')]){_0x482441[_0x14f4('0x3e')]=_[_0x14f4('0x40')](_0x482441[_0x14f4('0x3e')],{'$or':_[_0x14f4('0x2f')](_0x482441[_0x14f4('0x3a')],function(_0x5aa016){var _0x30bd16={};_0x30bd16[_0x5aa016]={'$like':'%'+_0x16568d[_0x14f4('0x36')][_0x14f4('0x3f')]+'%'};return _0x30bd16;})});}_0x482441=_['merge']({},_0x482441,_0x16568d[_0x14f4('0x49')]);return db[_0x14f4('0x56')][_0x14f4('0x43')](_0x482441);}})[_0x14f4('0x28')](function(_0x2be1c0){if(_0x2be1c0){return db[_0x14f4('0x5a')]['findAndCountAll']({'where':{'id':_['map'](_0x2be1c0,_0x14f4('0x5b')),'role':'agent'},'attributes':['id','name',_0x14f4('0x5c'),'updatedAt',_0x14f4('0x5d')]});}})['then'](function(_0x4671b6){if(_0x4671b6){return{'count':_0x4671b6[_0x14f4('0x21')],'rows':_[_0x14f4('0x2f')](_0x4671b6['rows'],function(_0x509d05){return{'membername':_0x509d05[_0x14f4('0x35')],'UserId':_0x509d05['id'],'queue_name':_0x18ecdd[_0x14f4('0x35')],'SmsQueueId':_0x18ecdd['id'],'interface':util[_0x14f4('0x5e')](_0x14f4('0x5f'),_0x14f4('0x60'),_0x509d05[_0x14f4('0x35')]),'penalty':0x0,'paused':_0x509d05[_0x14f4('0x5c')],'createdAt':_0x509d05[_0x14f4('0x5d')],'updatedAt':_0x509d05['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x14f4('0x28')](respondWithFilteredResult(_0x5635cb,_0x482441))['catch'](handleError(_0x5635cb,null));};exports[_0x14f4('0x61')]=function(_0x2b130b,_0xa8e31c,_0x5c1fae){var _0x46d70c={};var _0x1fd25d={};var _0x3465b6;var _0x49a626;return db[_0x14f4('0x30')][_0x14f4('0x55')]({'where':{'id':_0x2b130b[_0x14f4('0x47')]['id']}})[_0x14f4('0x28')](handleEntityNotFound(_0xa8e31c,null))[_0x14f4('0x28')](function(_0x3c661a){if(_0x3c661a){_0x3465b6=_0x3c661a;_0x1fd25d['model']=_[_0x14f4('0x37')](db[_0x14f4('0x62')][_0x14f4('0x31')]);_0x1fd25d[_0x14f4('0x36')]=_[_0x14f4('0x37')](_0x2b130b[_0x14f4('0x36')]);_0x1fd25d[_0x14f4('0x38')]=_[_0x14f4('0x39')](_0x1fd25d[_0x14f4('0x34')],_0x1fd25d[_0x14f4('0x36')]);_0x46d70c[_0x14f4('0x3a')]=_[_0x14f4('0x39')](_0x1fd25d[_0x14f4('0x34')],qs[_0x14f4('0x3b')](_0x2b130b[_0x14f4('0x36')]['fields']));_0x46d70c['attributes']=_0x46d70c[_0x14f4('0x3a')][_0x14f4('0x48')]?_0x46d70c[_0x14f4('0x3a')]:_0x1fd25d[_0x14f4('0x34')];_0x46d70c[_0x14f4('0x63')]=qs[_0x14f4('0x3d')](_0x2b130b['query'][_0x14f4('0x3d')]);_0x46d70c[_0x14f4('0x3e')]=qs['filters'](_[_0x14f4('0x58')](_0x2b130b[_0x14f4('0x36')],_0x1fd25d['filters']));if(_0x2b130b[_0x14f4('0x36')]['filter']){_0x46d70c['where']=_[_0x14f4('0x40')](_0x46d70c[_0x14f4('0x3e')],{'$or':_[_0x14f4('0x2f')](_0x46d70c['attributes'],function(_0x8be7eb){var _0x12c398={};_0x12c398[_0x8be7eb]={'$like':'%'+_0x2b130b[_0x14f4('0x36')][_0x14f4('0x3f')]+'%'};return _0x12c398;})});}_0x46d70c=_[_0x14f4('0x40')]({},_0x46d70c,_0x2b130b[_0x14f4('0x49')]);return _0x3465b6[_0x14f4('0x61')](_0x46d70c);}})[_0x14f4('0x28')](function(_0x18664c){if(_0x18664c){_0x49a626=_0x18664c[_0x14f4('0x48')];if(!_0x2b130b[_0x14f4('0x36')]['hasOwnProperty'](_0x14f4('0x3c'))){_0x46d70c[_0x14f4('0x20')]=qs[_0x14f4('0x20')](_0x2b130b[_0x14f4('0x36')][_0x14f4('0x20')]);_0x46d70c[_0x14f4('0x1e')]=qs[_0x14f4('0x1e')](_0x2b130b[_0x14f4('0x36')]['offset']);}return _0x3465b6['getTeams'](_0x46d70c);}})[_0x14f4('0x28')](function(_0x2efa61){if(_0x2efa61){return _0x2efa61?{'count':_0x49a626,'rows':_0x2efa61}:null;}})[_0x14f4('0x28')](respondWithResult(_0xa8e31c,null))[_0x14f4('0x45')](handleError(_0xa8e31c,null));};exports[_0x14f4('0x64')]=function(_0x43f71c,_0x247473,_0x43e19a){var _0xcca849=_0x43f71c[_0x14f4('0x4c')][_0x14f4('0x65')];return db[_0x14f4('0x62')]['findAll']({'where':{'id':_0xcca849},'attributes':['id'],'include':[{'model':db[_0x14f4('0x5a')],'as':_0x14f4('0x66'),'attributes':['id',_0x14f4('0x35'),_0x14f4('0x67'),_0x14f4('0x68'),_0x14f4('0x69')],'raw':!![]}]})[_0x14f4('0x28')](function(_0x1e8ab4){if(_0x1e8ab4){var _0x21d9e8=_[_0x14f4('0x6a')](_0x1e8ab4,function(_0x1596f3){var _0x40786e=_0x1596f3[_0x14f4('0x2a')]({'plain':!![]});return _0x40786e['Agents'];});return db['SmsQueue']['find']({'where':{'id':_0x43f71c['params']['id']}})[_0x14f4('0x28')](function(_0x28d70c){return db[_0x14f4('0x6b')][_0x14f4('0x6c')](function(_0x5f5c4c){return _0x28d70c[_0x14f4('0x64')](_0xcca849,{'transaction':_0x5f5c4c})[_0x14f4('0x28')](function(){return BPromise[_0x14f4('0x6d')](_0x21d9e8,function(_0x3e631a){return db[_0x14f4('0x56')][_0x14f4('0x6e')]({'where':{'UserId':_0x3e631a['id'],'SmsQueueId':_0x43f71c[_0x14f4('0x47')]['id']},'transaction':_0x5f5c4c});});})[_0x14f4('0x28')](function(){_0x21d9e8[_0x14f4('0x6f')](function(_0x1cb00e){socket['emit']('userSmsQueue:save',{'UserId':_0x1cb00e['id'],'SmsQueueId':_0x28d70c['id']});});});});});}})[_0x14f4('0x28')](respondWithStatusCode(_0x247473,null))[_0x14f4('0x45')](handleError(_0x247473,null));};exports[_0x14f4('0x70')]=function(_0x55a2b5,_0xd03f2d,_0x454167){return db[_0x14f4('0x62')][_0x14f4('0x43')]({'where':{'id':_0x55a2b5[_0x14f4('0x36')][_0x14f4('0x65')]},'attributes':['id'],'include':[{'model':db[_0x14f4('0x5a')],'as':_0x14f4('0x66'),'attributes':['id'],'raw':!![]}]})[_0x14f4('0x28')](handleEntityNotFound(_0xd03f2d,null))[_0x14f4('0x28')](function(_0x10d19d){var _0x1b44db=_[_0x14f4('0x2f')](_0x10d19d,'id');var _0x493f9c=[];var _0x362b83=[];var _0x52d653=squel[_0x14f4('0x71')]();_0x52d653[_0x14f4('0x72')](_0x14f4('0x73'))[_0x14f4('0x74')](_0x14f4('0x75'),'tq')[_0x14f4('0x76')](_0x14f4('0x77'),'ut',_0x14f4('0x78'))['where'](_0x14f4('0x79'),_0x55a2b5[_0x14f4('0x47')]['id']);for(var _0x1cc5c6=0x0;_0x1cc5c6<_0x10d19d[_0x14f4('0x48')];_0x1cc5c6+=0x1){let _0x422660=_0x10d19d[_0x1cc5c6];for(var _0x2eae55=0x0;_0x2eae55<_0x422660['Agents']['length'];_0x2eae55+=0x1){let _0x1137d8=_0x422660['Agents'][_0x2eae55];var _0x4377e0=_0x52d653[_0x14f4('0x7a')]();_0x4377e0[_0x14f4('0x3e')](_0x14f4('0x7b'),_0x1137d8['id']);_0x362b83[_0x14f4('0x7c')](db['sequelize'][_0x14f4('0x36')](_0x4377e0[_0x14f4('0x7d')](),{'type':db['sequelize']['QueryTypes']['SELECT']})['then'](function(_0x4475e7){if(_0x4475e7[_0x14f4('0x48')]===0x1){return _0x1137d8['id'];}else{var _0xd82534=_['every'](_[_0x14f4('0x2f')](_0x4475e7,_0x14f4('0x7e')),function(_0x45b2ed){return _['includes'](_0x1b44db,_0x45b2ed);});if(_0xd82534){return _0x1137d8['id'];}}}));}}return BPromise['all'](_0x362b83)[_0x14f4('0x28')](function(_0x1924a6){_0x493f9c=_(_0x493f9c)[_0x14f4('0x7f')](_0x1924a6)[_0x14f4('0x80')]()['value']();return db[_0x14f4('0x30')][_0x14f4('0x4a')]({'where':{'id':_0x55a2b5[_0x14f4('0x47')]['id']}})[_0x14f4('0x28')](function(_0x24b550){return db[_0x14f4('0x6b')][_0x14f4('0x6c')](function(_0x20257d){return _0x24b550[_0x14f4('0x70')](_0x55a2b5['query']['ids'],{'transaction':_0x20257d})['then'](function(){if(!_[_0x14f4('0x81')](_0x493f9c)){return _0x24b550[_0x14f4('0x82')](_0x493f9c,{'transaction':_0x20257d});}})[_0x14f4('0x28')](function(){_0x493f9c[_0x14f4('0x6f')](function(_0x1f11ac){socket[_0x14f4('0x83')]('userSmsQueue:remove',{'UserId':_0x1f11ac,'SmsQueueId':_0x24b550['id']});});});});});});})[_0x14f4('0x28')](respondWithStatusCode(_0xd03f2d,null))[_0x14f4('0x45')](handleError(_0xd03f2d,null));};exports['addAgents']=function(_0x3964b1,_0x3f4fb6,_0x244804){return db[_0x14f4('0x30')][_0x14f4('0x4a')]({'where':{'id':_0x3964b1[_0x14f4('0x47')]['id']}})['then'](handleEntityNotFound(_0x3f4fb6,null))[_0x14f4('0x28')](function(_0x56d714){if(_0x56d714){return _0x56d714[_0x14f4('0x84')](_0x3964b1[_0x14f4('0x4c')][_0x14f4('0x65')],_[_0x14f4('0x85')](_0x3964b1[_0x14f4('0x4c')],[_0x14f4('0x65'),'id'])||{})[_0x14f4('0x86')](function(_0x1603dc){for(var _0x3b3c7e=0x0;_0x3b3c7e<_0x3964b1[_0x14f4('0x4c')]['ids'][_0x14f4('0x48')];_0x3b3c7e+=0x1){socket[_0x14f4('0x83')](_0x14f4('0x87'),{'UserId':Number(_0x3964b1[_0x14f4('0x4c')][_0x14f4('0x65')][_0x3b3c7e]),'SmsQueueId':Number(_0x3964b1[_0x14f4('0x47')]['id'])});}return _0x1603dc;});}})[_0x14f4('0x28')](respondWithResult(_0x3f4fb6,null))['catch'](handleError(_0x3f4fb6,null));};exports[_0x14f4('0x82')]=function(_0x329603,_0x54973d,_0x4ff2df){return db[_0x14f4('0x30')][_0x14f4('0x4a')]({'where':{'id':_0x329603[_0x14f4('0x47')]['id']}})[_0x14f4('0x28')](handleEntityNotFound(_0x54973d,null))[_0x14f4('0x28')](function(_0x393008){if(_0x393008){return _0x393008[_0x14f4('0x82')](_0x329603[_0x14f4('0x36')][_0x14f4('0x65')])['then'](function(){if(_['isArray'](_0x329603['query']['ids'])){for(var _0xa2fa46=0x0;_0xa2fa46<_0x329603[_0x14f4('0x36')][_0x14f4('0x65')]['length'];_0xa2fa46+=0x1){socket[_0x14f4('0x83')](_0x14f4('0x88'),{'UserId':Number(_0x329603[_0x14f4('0x36')]['ids'][_0xa2fa46]),'SmsQueueId':Number(_0x329603[_0x14f4('0x47')]['id'])});}}else{socket[_0x14f4('0x83')](_0x14f4('0x88'),{'UserId':Number(_0x329603[_0x14f4('0x36')][_0x14f4('0x65')]),'SmsQueueId':Number(_0x329603['params']['id'])});}});}})['then'](respondWithStatusCode(_0x54973d,null))[_0x14f4('0x45')](handleError(_0x54973d,null));};exports['getAgents']=function(_0x41f484,_0x2dab7b,_0x11b9bc){var _0x3959d5={};var _0x2b85cd={};var _0x495dcc;var _0x5d6af4;return db[_0x14f4('0x30')]['findOne']({'where':{'id':_0x41f484[_0x14f4('0x47')]['id']}})[_0x14f4('0x28')](handleEntityNotFound(_0x2dab7b,null))[_0x14f4('0x28')](function(_0x1163e8){if(_0x1163e8){_0x495dcc=_0x1163e8;_0x2b85cd[_0x14f4('0x34')]=_[_0x14f4('0x37')](db[_0x14f4('0x5a')][_0x14f4('0x31')]);_0x2b85cd[_0x14f4('0x36')]=_[_0x14f4('0x37')](_0x41f484[_0x14f4('0x36')]);_0x2b85cd[_0x14f4('0x38')]=_[_0x14f4('0x39')](_0x2b85cd[_0x14f4('0x34')],_0x2b85cd[_0x14f4('0x36')]);_0x3959d5[_0x14f4('0x3a')]=_['intersection'](_0x2b85cd[_0x14f4('0x34')],qs[_0x14f4('0x3b')](_0x41f484[_0x14f4('0x36')]['fields']));_0x3959d5['attributes']=_0x3959d5[_0x14f4('0x3a')]['length']?_0x3959d5[_0x14f4('0x3a')]:_0x2b85cd[_0x14f4('0x34')];_0x3959d5[_0x14f4('0x63')]=qs[_0x14f4('0x3d')](_0x41f484[_0x14f4('0x36')][_0x14f4('0x3d')]);_0x3959d5[_0x14f4('0x3e')]=qs[_0x14f4('0x38')](_['pick'](_0x41f484['query'],_0x2b85cd[_0x14f4('0x38')]));if(_0x41f484[_0x14f4('0x36')]['filter']){_0x3959d5[_0x14f4('0x3e')]=_[_0x14f4('0x40')](_0x3959d5[_0x14f4('0x3e')],{'$or':_[_0x14f4('0x2f')](_0x3959d5[_0x14f4('0x3a')],function(_0x4a28e5){var _0x1a1b8={};_0x1a1b8[_0x4a28e5]={'$like':'%'+_0x41f484[_0x14f4('0x36')]['filter']+'%'};return _0x1a1b8;})});}_0x3959d5=_[_0x14f4('0x40')]({},_0x3959d5,_0x41f484[_0x14f4('0x49')]);return _0x495dcc[_0x14f4('0x89')](_0x3959d5);}})[_0x14f4('0x28')](function(_0x4e16e1){if(_0x4e16e1){_0x5d6af4=_0x4e16e1[_0x14f4('0x48')];if(!_0x41f484[_0x14f4('0x36')]['hasOwnProperty'](_0x14f4('0x3c'))){_0x3959d5[_0x14f4('0x20')]=qs[_0x14f4('0x20')](_0x41f484[_0x14f4('0x36')][_0x14f4('0x20')]);_0x3959d5[_0x14f4('0x1e')]=qs[_0x14f4('0x1e')](_0x41f484[_0x14f4('0x36')][_0x14f4('0x1e')]);}return _0x495dcc[_0x14f4('0x89')](_0x3959d5);}})['then'](function(_0xac0d04){if(_0xac0d04){return _0xac0d04?{'count':_0x5d6af4,'rows':_0xac0d04}:null;}})[_0x14f4('0x28')](respondWithResult(_0x2dab7b,null))['catch'](handleError(_0x2dab7b,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 0727d4a..a5ddab1 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 _0xf671=['hasOwnProperty','hook','events','../../mysqldb','SmsQueue','setMaxListeners','save','emit'];(function(_0x49c5d4,_0x26aba8){var _0x22143=function(_0x203a16){while(--_0x203a16){_0x49c5d4['push'](_0x49c5d4['shift']());}};_0x22143(++_0x26aba8);}(_0xf671,0xb2));var _0x1f67=function(_0x532c55,_0x4dab9a){_0x532c55=_0x532c55-0x0;var _0x1eefe9=_0xf671[_0x532c55];return _0x1eefe9;};'use strict';var EventEmitter=require(_0x1f67('0x0'));var SmsQueue=require(_0x1f67('0x1'))['db'][_0x1f67('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x1f67('0x3')](0x0);var events={'afterCreate':_0x1f67('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x207d5e){return function(_0x45f973,_0x438e20,_0x55997e){SmsQueueEvents['emit'](_0x207d5e+':'+_0x45f973['id'],_0x45f973);SmsQueueEvents[_0x1f67('0x5')](_0x207d5e,_0x45f973);_0x55997e(null);};}for(var e in events){if(events[_0x1f67('0x6')](e)){var event=events[e];SmsQueue[_0x1f67('0x7')](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file +var _0x775e=['hasOwnProperty','hook','events','SmsQueue','setMaxListeners','save','update','emit'];(function(_0x59a3e9,_0x27fb38){var _0x5179ac=function(_0x5a9b1c){while(--_0x5a9b1c){_0x59a3e9['push'](_0x59a3e9['shift']());}};_0x5179ac(++_0x27fb38);}(_0x775e,0xda));var _0xe775=function(_0x27bf50,_0x4e2433){_0x27bf50=_0x27bf50-0x0;var _0x521995=_0x775e[_0x27bf50];return _0x521995;};'use strict';var EventEmitter=require(_0xe775('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0xe775('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xe775('0x2')](0x0);var events={'afterCreate':_0xe775('0x3'),'afterUpdate':_0xe775('0x4'),'afterDestroy':'remove'};function emitEvent(_0x95078d){return function(_0x43afd3,_0x330d30,_0x523a54){SmsQueueEvents[_0xe775('0x5')](_0x95078d+':'+_0x43afd3['id'],_0x43afd3);SmsQueueEvents[_0xe775('0x5')](_0x95078d,_0x43afd3);_0x523a54(null);};}for(var e in events){if(events[_0xe775('0x6')](e)){var event=events[e];SmsQueue[_0xe775('0x7')](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 2aa879f..6c72824 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 _0xfb52=['request-promise','path','exports','SmsQueue','sms_queues','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xfb52,0x7e));var _0x2fb5=function(_0x4ce178,_0x228a4f){_0x4ce178=_0x4ce178-0x0;var _0x21a47f=_0xfb52[_0x4ce178];return _0x21a47f;};'use strict';var _=require(_0x2fb5('0x0'));var util=require(_0x2fb5('0x1'));var logger=require(_0x2fb5('0x2'))(_0x2fb5('0x3'));var moment=require(_0x2fb5('0x4'));var BPromise=require(_0x2fb5('0x5'));var rp=require(_0x2fb5('0x6'));var fs=require('fs');var path=require(_0x2fb5('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./smsQueue.attributes');module[_0x2fb5('0x8')]=function(_0x5e3f95,_0x113c63){return _0x5e3f95['define'](_0x2fb5('0x9'),attributes,{'tableName':_0x2fb5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9372=['path','../../config/environment','exports','SmsQueue','sms_queues','lodash','api'];(function(_0x4f4f59,_0x4215c1){var _0x322725=function(_0x4eda03){while(--_0x4eda03){_0x4f4f59['push'](_0x4f4f59['shift']());}};_0x322725(++_0x4215c1);}(_0x9372,0x155));var _0x2937=function(_0x40c48c,_0x499e99){_0x40c48c=_0x40c48c-0x0;var _0x5186bc=_0x9372[_0x40c48c];return _0x5186bc;};'use strict';var _=require(_0x2937('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2937('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2937('0x2'));var rimraf=require('rimraf');var config=require(_0x2937('0x3'));var attributes=require('./smsQueue.attributes');module[_0x2937('0x4')]=function(_0x108926,_0x1d507c){return _0x108926['define'](_0x2937('0x5'),attributes,{'tableName':_0x2937('0x6'),'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 425c985..af86ea7 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 _0x142e=['rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','then','info','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','SmsQueue,\x20%s,\x20%s','message','result','catch','GetSmsQueue','SmsQueue','findAll','options','raw','attributes','limit','map','include','model','ShowSmsQueue','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x5111e7,_0x2789a3){var _0x47e315=function(_0x154d36){while(--_0x154d36){_0x5111e7['push'](_0x5111e7['shift']());}};_0x47e315(++_0x2789a3);}(_0x142e,0x1e4));var _0xe142=function(_0x3ea5cd,_0x407716){_0x3ea5cd=_0x3ea5cd-0x0;var _0x384157=_0x142e[_0x3ea5cd];return _0x384157;};'use strict';var _=require(_0xe142('0x0'));var util=require(_0xe142('0x1'));var moment=require(_0xe142('0x2'));var BPromise=require(_0xe142('0x3'));var rs=require(_0xe142('0x4'));var fs=require('fs');var Redis=require(_0xe142('0x5'));var db=require(_0xe142('0x6'))['db'];var utils=require(_0xe142('0x7'));var logger=require('../../config/logger')(_0xe142('0x8'));var config=require(_0xe142('0x9'));var jayson=require(_0xe142('0xa'));var client=jayson[_0xe142('0xb')]['http']({'port':0x232a});config[_0xe142('0xc')]=_[_0xe142('0xd')](config[_0xe142('0xc')],{'host':_0xe142('0xe'),'port':0x18eb});var socket=require(_0xe142('0xf'))(new Redis(config['redis']));require('./smsQueue.socket')[_0xe142('0x10')](socket);function respondWithRpcPromise(_0x3fcd93,_0x35f5db,_0x5a5977){return new BPromise(function(_0x320156,_0x199dfc){return client['request'](_0x3fcd93,_0x5a5977)[_0xe142('0x11')](function(_0x40a952){logger[_0xe142('0x12')]('SmsQueue,\x20%s,\x20%s',_0x35f5db,_0xe142('0x13'));logger[_0xe142('0x14')](_0xe142('0x15'),_0x35f5db,_0xe142('0x13'),JSON[_0xe142('0x16')](_0x40a952));if(_0x40a952[_0xe142('0x17')]){if(_0x40a952['error']['code']===0x1f4){logger['error'](_0xe142('0x18'),_0x35f5db,_0x40a952['error'][_0xe142('0x19')]);return _0x199dfc(_0x40a952[_0xe142('0x17')][_0xe142('0x19')]);}logger[_0xe142('0x17')](_0xe142('0x18'),_0x35f5db,_0x40a952[_0xe142('0x17')][_0xe142('0x19')]);return _0x320156(_0x40a952[_0xe142('0x17')]['message']);}else{logger[_0xe142('0x12')]('SmsQueue,\x20%s,\x20%s',_0x35f5db,_0xe142('0x13'));_0x320156(_0x40a952[_0xe142('0x1a')]['message']);}})[_0xe142('0x1b')](function(_0xd4cc01){logger['error'](_0xe142('0x18'),_0x35f5db,_0xd4cc01);_0x199dfc(_0xd4cc01);});});}exports[_0xe142('0x1c')]=function(_0x248ae9){var _0x5d60fe=this;return new Promise(function(_0x58638b,_0x313068){return db[_0xe142('0x1d')][_0xe142('0x1e')]({'raw':_0x248ae9[_0xe142('0x1f')]?_0x248ae9[_0xe142('0x1f')][_0xe142('0x20')]===undefined?!![]:![]:!![],'where':_0x248ae9['options']?_0x248ae9[_0xe142('0x1f')]['where']||null:null,'attributes':_0x248ae9['options']?_0x248ae9[_0xe142('0x1f')][_0xe142('0x21')]||null:null,'limit':_0x248ae9['options']?_0x248ae9[_0xe142('0x1f')][_0xe142('0x22')]||null:null,'include':_0x248ae9[_0xe142('0x1f')]?_0x248ae9[_0xe142('0x1f')]['include']?_[_0xe142('0x23')](_0x248ae9[_0xe142('0x1f')][_0xe142('0x24')],function(_0x2793db){return{'model':db[_0x2793db['model']],'as':_0x2793db['as'],'attributes':_0x2793db[_0xe142('0x21')],'include':_0x2793db[_0xe142('0x24')]?_['map'](_0x2793db[_0xe142('0x24')],function(_0x553809){return{'model':db[_0x553809[_0xe142('0x25')]],'as':_0x553809['as'],'attributes':_0x553809[_0xe142('0x21')],'include':_0x553809[_0xe142('0x24')]?_['map'](_0x553809['include'],function(_0x18c353){return{'model':db[_0x18c353['model']],'as':_0x18c353['as'],'attributes':_0x18c353[_0xe142('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x40421d){logger[_0xe142('0x12')](_0xe142('0x1c'),_0x248ae9);logger['debug']('GetSmsQueue',_0x248ae9,JSON[_0xe142('0x16')](_0x40421d));_0x58638b(_0x40421d);})[_0xe142('0x1b')](function(_0x43bb14){logger['error'](_0xe142('0x1c'),_0x43bb14[_0xe142('0x19')],_0x248ae9);_0x313068(_0x5d60fe['error'](0x1f4,_0x43bb14[_0xe142('0x19')]));});});};exports[_0xe142('0x26')]=function(_0xb749bb){var _0x2a9385=this;return new Promise(function(_0x2b14ad,_0x49f5d8){return db[_0xe142('0x1d')][_0xe142('0x27')]({'raw':_0xb749bb[_0xe142('0x1f')]?_0xb749bb['options'][_0xe142('0x20')]===undefined?!![]:![]:!![],'where':_0xb749bb[_0xe142('0x1f')]?_0xb749bb[_0xe142('0x1f')][_0xe142('0x28')]||null:null,'attributes':_0xb749bb['options']?_0xb749bb[_0xe142('0x1f')]['attributes']||null:null,'include':_0xb749bb[_0xe142('0x1f')]?_0xb749bb[_0xe142('0x1f')]['include']?_['map'](_0xb749bb[_0xe142('0x1f')][_0xe142('0x24')],function(_0xa7d80e){return{'model':db[_0xa7d80e['model']],'as':_0xa7d80e['as'],'attributes':_0xa7d80e['attributes'],'include':_0xa7d80e[_0xe142('0x24')]?_[_0xe142('0x23')](_0xa7d80e[_0xe142('0x24')],function(_0x24e4e5){return{'model':db[_0x24e4e5[_0xe142('0x25')]],'as':_0x24e4e5['as'],'attributes':_0x24e4e5[_0xe142('0x21')],'include':_0x24e4e5['include']?_[_0xe142('0x23')](_0x24e4e5[_0xe142('0x24')],function(_0x20a49c){return{'model':db[_0x20a49c[_0xe142('0x25')]],'as':_0x20a49c['as'],'attributes':_0x20a49c[_0xe142('0x21')]};}):[]};}):[]};}):[]:[]})[_0xe142('0x11')](function(_0x4b7dfb){logger[_0xe142('0x12')](_0xe142('0x26'),_0xb749bb);logger[_0xe142('0x14')](_0xe142('0x26'),_0xb749bb,JSON[_0xe142('0x16')](_0x4b7dfb));_0x2b14ad(_0x4b7dfb);})[_0xe142('0x1b')](function(_0x2d4028){logger[_0xe142('0x17')](_0xe142('0x26'),_0x2d4028[_0xe142('0x19')],_0xb749bb);_0x49f5d8(_0x2a9385[_0xe142('0x17')](0x1f4,_0x2d4028[_0xe142('0x19')]));});});}; \ No newline at end of file +var _0xc101=['stringify','error','code','message','info','catch','SmsQueue','findAll','options','raw','attributes','limit','include','map','model','GetSmsQueue','debug','find','where','ShowSmsQueue','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./smsQueue.socket','register','request','then','SmsQueue,\x20%s,\x20%s','request\x20sent','SmsQueue,\x20%s,\x20%s,\x20%s'];(function(_0x27ecef,_0x137bfe){var _0x4e7c5b=function(_0x5dbfa6){while(--_0x5dbfa6){_0x27ecef['push'](_0x27ecef['shift']());}};_0x4e7c5b(++_0x137bfe);}(_0xc101,0x8c));var _0x1c10=function(_0x173113,_0x316a7c){_0x173113=_0x173113-0x0;var _0x3bea89=_0xc101[_0x173113];return _0x3bea89;};'use strict';var _=require(_0x1c10('0x0'));var util=require(_0x1c10('0x1'));var moment=require(_0x1c10('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1c10('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1c10('0x4'));var logger=require(_0x1c10('0x5'))(_0x1c10('0x6'));var config=require(_0x1c10('0x7'));var jayson=require(_0x1c10('0x8'));var client=jayson[_0x1c10('0x9')]['http']({'port':0x232a});config[_0x1c10('0xa')]=_[_0x1c10('0xb')](config[_0x1c10('0xa')],{'host':_0x1c10('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x1c10('0xd'))[_0x1c10('0xe')](socket);function respondWithRpcPromise(_0x1cb690,_0x293221,_0x58f000){return new BPromise(function(_0x554d96,_0x3acac4){return client[_0x1c10('0xf')](_0x1cb690,_0x58f000)[_0x1c10('0x10')](function(_0x4bd51f){logger['info'](_0x1c10('0x11'),_0x293221,_0x1c10('0x12'));logger['debug'](_0x1c10('0x13'),_0x293221,_0x1c10('0x12'),JSON[_0x1c10('0x14')](_0x4bd51f));if(_0x4bd51f[_0x1c10('0x15')]){if(_0x4bd51f[_0x1c10('0x15')][_0x1c10('0x16')]===0x1f4){logger['error'](_0x1c10('0x11'),_0x293221,_0x4bd51f[_0x1c10('0x15')][_0x1c10('0x17')]);return _0x3acac4(_0x4bd51f[_0x1c10('0x15')][_0x1c10('0x17')]);}logger[_0x1c10('0x15')](_0x1c10('0x11'),_0x293221,_0x4bd51f['error'][_0x1c10('0x17')]);return _0x554d96(_0x4bd51f[_0x1c10('0x15')][_0x1c10('0x17')]);}else{logger[_0x1c10('0x18')]('SmsQueue,\x20%s,\x20%s',_0x293221,_0x1c10('0x12'));_0x554d96(_0x4bd51f['result'][_0x1c10('0x17')]);}})[_0x1c10('0x19')](function(_0x269fdd){logger['error']('SmsQueue,\x20%s,\x20%s',_0x293221,_0x269fdd);_0x3acac4(_0x269fdd);});});}exports['GetSmsQueue']=function(_0x1f90f9){var _0x1496a6=this;return new Promise(function(_0x4a2187,_0x162ab0){return db[_0x1c10('0x1a')][_0x1c10('0x1b')]({'raw':_0x1f90f9['options']?_0x1f90f9[_0x1c10('0x1c')][_0x1c10('0x1d')]===undefined?!![]:![]:!![],'where':_0x1f90f9[_0x1c10('0x1c')]?_0x1f90f9[_0x1c10('0x1c')]['where']||null:null,'attributes':_0x1f90f9['options']?_0x1f90f9['options'][_0x1c10('0x1e')]||null:null,'limit':_0x1f90f9[_0x1c10('0x1c')]?_0x1f90f9[_0x1c10('0x1c')][_0x1c10('0x1f')]||null:null,'include':_0x1f90f9[_0x1c10('0x1c')]?_0x1f90f9['options'][_0x1c10('0x20')]?_[_0x1c10('0x21')](_0x1f90f9[_0x1c10('0x1c')][_0x1c10('0x20')],function(_0x438e60){return{'model':db[_0x438e60[_0x1c10('0x22')]],'as':_0x438e60['as'],'attributes':_0x438e60[_0x1c10('0x1e')],'include':_0x438e60[_0x1c10('0x20')]?_['map'](_0x438e60[_0x1c10('0x20')],function(_0x3db9da){return{'model':db[_0x3db9da['model']],'as':_0x3db9da['as'],'attributes':_0x3db9da['attributes'],'include':_0x3db9da[_0x1c10('0x20')]?_[_0x1c10('0x21')](_0x3db9da[_0x1c10('0x20')],function(_0x163c52){return{'model':db[_0x163c52[_0x1c10('0x22')]],'as':_0x163c52['as'],'attributes':_0x163c52[_0x1c10('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2a2119){logger[_0x1c10('0x18')](_0x1c10('0x23'),_0x1f90f9);logger[_0x1c10('0x24')](_0x1c10('0x23'),_0x1f90f9,JSON[_0x1c10('0x14')](_0x2a2119));_0x4a2187(_0x2a2119);})['catch'](function(_0x409b5e){logger[_0x1c10('0x15')]('GetSmsQueue',_0x409b5e['message'],_0x1f90f9);_0x162ab0(_0x1496a6[_0x1c10('0x15')](0x1f4,_0x409b5e['message']));});});};exports['ShowSmsQueue']=function(_0x4fa932){var _0x99b42a=this;return new Promise(function(_0x1ac990,_0x449a36){return db['SmsQueue'][_0x1c10('0x25')]({'raw':_0x4fa932[_0x1c10('0x1c')]?_0x4fa932[_0x1c10('0x1c')][_0x1c10('0x1d')]===undefined?!![]:![]:!![],'where':_0x4fa932['options']?_0x4fa932['options'][_0x1c10('0x26')]||null:null,'attributes':_0x4fa932['options']?_0x4fa932['options']['attributes']||null:null,'include':_0x4fa932[_0x1c10('0x1c')]?_0x4fa932[_0x1c10('0x1c')][_0x1c10('0x20')]?_[_0x1c10('0x21')](_0x4fa932[_0x1c10('0x1c')]['include'],function(_0x2d6d42){return{'model':db[_0x2d6d42[_0x1c10('0x22')]],'as':_0x2d6d42['as'],'attributes':_0x2d6d42[_0x1c10('0x1e')],'include':_0x2d6d42[_0x1c10('0x20')]?_['map'](_0x2d6d42[_0x1c10('0x20')],function(_0x4dc5be){return{'model':db[_0x4dc5be['model']],'as':_0x4dc5be['as'],'attributes':_0x4dc5be[_0x1c10('0x1e')],'include':_0x4dc5be['include']?_[_0x1c10('0x21')](_0x4dc5be['include'],function(_0x1d6012){return{'model':db[_0x1d6012[_0x1c10('0x22')]],'as':_0x1d6012['as'],'attributes':_0x1d6012[_0x1c10('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x1c10('0x10')](function(_0x318a55){logger[_0x1c10('0x18')](_0x1c10('0x27'),_0x4fa932);logger[_0x1c10('0x24')](_0x1c10('0x27'),_0x4fa932,JSON['stringify'](_0x318a55));_0x1ac990(_0x318a55);})[_0x1c10('0x19')](function(_0x9c6f64){logger['error'](_0x1c10('0x27'),_0x9c6f64['message'],_0x4fa932);_0x449a36(_0x99b42a[_0x1c10('0x15')](0x1f4,_0x9c6f64[_0x1c10('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 7376785..3fc04a8 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 _0xf42e=['smsQueue:','./smsQueue.events','save','remove','update','emit','removeListener'];(function(_0x323d3a,_0x400d82){var _0x22cddb=function(_0x191de8){while(--_0x191de8){_0x323d3a['push'](_0x323d3a['shift']());}};_0x22cddb(++_0x400d82);}(_0xf42e,0x1b3));var _0xef42=function(_0x52f85f,_0x46c1c4){_0x52f85f=_0x52f85f-0x0;var _0x5dffa2=_0xf42e[_0x52f85f];return _0x5dffa2;};'use strict';var SmsQueueEvents=require(_0xef42('0x0'));var events=[_0xef42('0x1'),_0xef42('0x2'),_0xef42('0x3')];function createListener(_0x5500b8,_0x52e76b){return function(_0x519fb8){_0x52e76b[_0xef42('0x4')](_0x5500b8,_0x519fb8);};}function removeListener(_0x58e010,_0x8600dd){return function(){SmsQueueEvents[_0xef42('0x5')](_0x58e010,_0x8600dd);};}exports['register']=function(_0x2a88c0){for(var _0x3e03dd=0x0,_0x60219d=events['length'];_0x3e03dd<_0x60219d;_0x3e03dd++){var _0x5d3817=events[_0x3e03dd];var _0x327ad9=createListener(_0xef42('0x6')+_0x5d3817,_0x2a88c0);SmsQueueEvents['on'](_0x5d3817,_0x327ad9);}}; \ No newline at end of file +var _0x0cda=['smsQueue:','save','remove','update','register'];(function(_0x1c41c6,_0x4a55a7){var _0x133349=function(_0xf11100){while(--_0xf11100){_0x1c41c6['push'](_0x1c41c6['shift']());}};_0x133349(++_0x4a55a7);}(_0x0cda,0x1dc));var _0xa0cd=function(_0x375e5d,_0x24eff8){_0x375e5d=_0x375e5d-0x0;var _0x4ccea8=_0x0cda[_0x375e5d];return _0x4ccea8;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0xa0cd('0x0'),_0xa0cd('0x1'),_0xa0cd('0x2')];function createListener(_0x5587b9,_0xf9f32d){return function(_0x331ca9){_0xf9f32d['emit'](_0x5587b9,_0x331ca9);};}function removeListener(_0x1d25f4,_0x146860){return function(){SmsQueueEvents['removeListener'](_0x1d25f4,_0x146860);};}exports[_0xa0cd('0x3')]=function(_0x1c206d){for(var _0x3e8651=0x0,_0x13e762=events['length'];_0x3e8651<_0x13e762;_0x3e8651++){var _0x42eec3=events[_0x3e8651];var _0x2dc088=createListener(_0xa0cd('0x4')+_0x42eec3,_0x1c206d);SmsQueueEvents['on'](_0x42eec3,_0x2dc088);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 14dc549..759f816 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 _0x303f=['multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','./smsQueueReport.controller','get','isAuthenticated','index','/describe','describe','show','create','put','update','delete','destroy','exports'];(function(_0x507337,_0x12992f){var _0x5345c9=function(_0x2df27c){while(--_0x2df27c){_0x507337['push'](_0x507337['shift']());}};_0x5345c9(++_0x12992f);}(_0x303f,0xbe));var _0xf303=function(_0x4c224a,_0x34bb){_0x4c224a=_0x4c224a-0x0;var _0x4cf8d7=_0x303f[_0x4c224a];return _0x4cf8d7;};'use strict';var multer=require(_0xf303('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf303('0x1'));var express=require(_0xf303('0x2'));var router=express[_0xf303('0x3')]();var fs_extra=require(_0xf303('0x4'));var auth=require(_0xf303('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf303('0x6'));router[_0xf303('0x7')]('/',auth[_0xf303('0x8')](),controller[_0xf303('0x9')]);router[_0xf303('0x7')](_0xf303('0xa'),auth['isAuthenticated'](),controller[_0xf303('0xb')]);router['get']('/:id',auth[_0xf303('0x8')](),controller[_0xf303('0xc')]);router['post']('/',auth[_0xf303('0x8')](),controller[_0xf303('0xd')]);router[_0xf303('0xe')]('/:id',auth[_0xf303('0x8')](),controller[_0xf303('0xf')]);router[_0xf303('0x10')]('/:id',auth[_0xf303('0x8')](),controller[_0xf303('0x11')]);module[_0xf303('0x12')]=router; \ No newline at end of file +var _0x03e2=['/:id','show','post','create','put','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe'];(function(_0x194186,_0x124234){var _0x2471fc=function(_0xdf7041){while(--_0xdf7041){_0x194186['push'](_0x194186['shift']());}};_0x2471fc(++_0x124234);}(_0x03e2,0x119));var _0x203e=function(_0x30d5ba,_0x314ff7){_0x30d5ba=_0x30d5ba-0x0;var _0x4721d7=_0x03e2[_0x30d5ba];return _0x4721d7;};'use strict';var multer=require('multer');var util=require(_0x203e('0x0'));var path=require(_0x203e('0x1'));var timeout=require(_0x203e('0x2'));var express=require(_0x203e('0x3'));var router=express[_0x203e('0x4')]();var fs_extra=require(_0x203e('0x5'));var auth=require(_0x203e('0x6'));var interaction=require(_0x203e('0x7'));var config=require(_0x203e('0x8'));var controller=require('./smsQueueReport.controller');router[_0x203e('0x9')]('/',auth[_0x203e('0xa')](),controller['index']);router[_0x203e('0x9')](_0x203e('0xb'),auth['isAuthenticated'](),controller[_0x203e('0xc')]);router[_0x203e('0x9')](_0x203e('0xd'),auth['isAuthenticated'](),controller[_0x203e('0xe')]);router[_0x203e('0xf')]('/',auth[_0x203e('0xa')](),controller[_0x203e('0x10')]);router[_0x203e('0x11')]('/:id',auth[_0x203e('0xa')](),controller[_0x203e('0x12')]);router[_0x203e('0x13')](_0x203e('0xd'),auth[_0x203e('0xa')](),controller[_0x203e('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 4035c5d..06a8a1f 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 _0xbf2d=['STRING','DATE','moment','exports'];(function(_0x3cf5a3,_0x5a4492){var _0x39ba2d=function(_0x3ed989){while(--_0x3ed989){_0x3cf5a3['push'](_0x3cf5a3['shift']());}};_0x39ba2d(++_0x5a4492);}(_0xbf2d,0xb6));var _0xdbf2=function(_0x3a5b8c,_0x55cc2e){_0x3a5b8c=_0x3a5b8c-0x0;var _0x4300ae=_0xbf2d[_0x3a5b8c];return _0x4300ae;};'use strict';var moment=require(_0xdbf2('0x0'));var Sequelize=require('sequelize');module[_0xdbf2('0x1')]={'uniqueid':{'type':Sequelize[_0xdbf2('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xdbf2('0x3')]},'leaveAt':{'type':Sequelize[_0xdbf2('0x3')]},'acceptAt':{'type':Sequelize[_0xdbf2('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xdbf2('0x2')]}}; \ No newline at end of file +var _0x5153=['moment','STRING','DATE'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x5153,0x159));var _0x3515=function(_0x3fcd46,_0x127439){_0x3fcd46=_0x3fcd46-0x0;var _0x97943f=_0x5153[_0x3fcd46];return _0x97943f;};'use strict';var moment=require(_0x3515('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x3515('0x1')]},'joinAt':{'type':Sequelize[_0x3515('0x2')]},'leaveAt':{'type':Sequelize[_0x3515('0x2')]},'acceptAt':{'type':Sequelize[_0x3515('0x2')]},'exitAt':{'type':Sequelize[_0x3515('0x2')]},'reason':{'type':Sequelize[_0x3515('0x1')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 78d26bf..58de7b2 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 _0xd4c7=['eml-format','rimraf','fast-json-patch','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','Content-Range','json','apply','reject','save','update','destroy','then','error','name','index','SmsQueueReport','rawAttributes','type','key','map','keys','query','intersection','model','attributes','fields','length','nolimit','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe'];(function(_0x15942a,_0x13b58c){var _0x36a9fb=function(_0x549c27){while(--_0x549c27){_0x15942a['push'](_0x15942a['shift']());}};_0x36a9fb(++_0x13b58c);}(_0xd4c7,0x90));var _0x7d4c=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xd4c7[_0x2b4411];return _0x8e41ef;};'use strict';var emlformat=require(_0x7d4c('0x0'));var rimraf=require(_0x7d4c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7d4c('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7d4c('0x3'));var Mustache=require(_0x7d4c('0x4'));var util=require(_0x7d4c('0x5'));var path=require('path');var sox=require(_0x7d4c('0x6'));var csv=require('to-csv');var ejs=require(_0x7d4c('0x7'));var fs=require('fs');var fs_extra=require(_0x7d4c('0x8'));var _=require(_0x7d4c('0x9'));var squel=require('squel');var crypto=require(_0x7d4c('0xa'));var jsforce=require(_0x7d4c('0xb'));var deskjs=require(_0x7d4c('0xc'));var toCsv=require(_0x7d4c('0xd'));var querystring=require(_0x7d4c('0xe'));var Papa=require(_0x7d4c('0xf'));var Redis=require(_0x7d4c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x7d4c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7d4c('0x12'));var logger=require('../../config/logger')(_0x7d4c('0x13'));var utils=require(_0x7d4c('0x14'));var config=require(_0x7d4c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x7d4c('0x16'))['db'];function respondWithStatusCode(_0x61d24e,_0x1cb14b){_0x1cb14b=_0x1cb14b||0xcc;return function(_0x4f247b){if(_0x4f247b){return _0x61d24e[_0x7d4c('0x17')](_0x1cb14b);}return _0x61d24e[_0x7d4c('0x18')](_0x1cb14b)[_0x7d4c('0x19')]();};}function respondWithResult(_0x4f4952,_0x197a63){_0x197a63=_0x197a63||0xc8;return function(_0x218b13){if(_0x218b13){return _0x4f4952[_0x7d4c('0x18')](_0x197a63)['json'](_0x218b13);}};}function respondWithFilteredResult(_0x81c2c8,_0x5ebf10){return function(_0x105ecf){if(_0x105ecf){var _0x2f10b4=typeof _0x5ebf10[_0x7d4c('0x1a')]==='undefined'&&typeof _0x5ebf10[_0x7d4c('0x1b')]===_0x7d4c('0x1c');var _0x1982cb=_0x105ecf[_0x7d4c('0x1d')];var _0xeee93b=_0x2f10b4?0x0:_0x5ebf10[_0x7d4c('0x1a')];var _0x1ef5e7=_0x2f10b4?_0x105ecf[_0x7d4c('0x1d')]:_0x5ebf10['offset']+_0x5ebf10[_0x7d4c('0x1b')];var _0x35057e;if(_0x1ef5e7>=_0x1982cb){_0x1ef5e7=_0x1982cb;_0x35057e=0xc8;}else{_0x35057e=0xce;}_0x81c2c8['status'](_0x35057e);return _0x81c2c8['set'](_0x7d4c('0x1e'),_0xeee93b+'-'+_0x1ef5e7+'/'+_0x1982cb)[_0x7d4c('0x1f')](_0x105ecf);}return null;};}function patchUpdates(_0x240157){return function(_0x443bf7){try{jsonpatch[_0x7d4c('0x20')](_0x443bf7,_0x240157,!![]);}catch(_0x44f8cb){return BPromise[_0x7d4c('0x21')](_0x44f8cb);}return _0x443bf7[_0x7d4c('0x22')]();};}function saveUpdates(_0x282638,_0x2fd45e){return function(_0x320745){if(_0x320745){return _0x320745[_0x7d4c('0x23')](_0x282638)['then'](function(_0x1e97c0){return _0x1e97c0;});}return null;};}function removeEntity(_0x5af4ce,_0x1ab620){return function(_0x2096c4){if(_0x2096c4){return _0x2096c4[_0x7d4c('0x24')]()[_0x7d4c('0x25')](function(){_0x5af4ce[_0x7d4c('0x18')](0xcc)[_0x7d4c('0x19')]();});}};}function handleEntityNotFound(_0x98cccb,_0x1b12b1){return function(_0x3f9ce8){if(!_0x3f9ce8){_0x98cccb[_0x7d4c('0x17')](0x194);}return _0x3f9ce8;};}function handleError(_0x49bf3b,_0x1fc0f5){_0x1fc0f5=_0x1fc0f5||0x1f4;return function(_0x5f10a1){logger[_0x7d4c('0x26')](_0x5f10a1['stack']);if(_0x5f10a1[_0x7d4c('0x27')]){delete _0x5f10a1[_0x7d4c('0x27')];}_0x49bf3b[_0x7d4c('0x18')](_0x1fc0f5)['send'](_0x5f10a1);};}exports[_0x7d4c('0x28')]=function(_0x3784a0,_0x4b1c06){var _0x116b20={},_0x135018={},_0x7cb400={'count':0x0,'rows':[]};var _0x5603e4=_['map'](db[_0x7d4c('0x29')][_0x7d4c('0x2a')],function(_0x7e5c95){return{'name':_0x7e5c95['fieldName'],'type':_0x7e5c95[_0x7d4c('0x2b')][_0x7d4c('0x2c')]};});_0x135018['model']=_[_0x7d4c('0x2d')](_0x5603e4,_0x7d4c('0x27'));_0x135018['query']=_[_0x7d4c('0x2e')](_0x3784a0[_0x7d4c('0x2f')]);_0x135018['filters']=_[_0x7d4c('0x30')](_0x135018[_0x7d4c('0x31')],_0x135018[_0x7d4c('0x2f')]);_0x116b20[_0x7d4c('0x32')]=_[_0x7d4c('0x30')](_0x135018['model'],qs[_0x7d4c('0x33')](_0x3784a0['query']['fields']));_0x116b20['attributes']=_0x116b20[_0x7d4c('0x32')][_0x7d4c('0x34')]?_0x116b20[_0x7d4c('0x32')]:_0x135018[_0x7d4c('0x31')];if(!_0x3784a0['query']['hasOwnProperty'](_0x7d4c('0x35'))){_0x116b20[_0x7d4c('0x1b')]=qs[_0x7d4c('0x1b')](_0x3784a0[_0x7d4c('0x2f')]['limit']);_0x116b20[_0x7d4c('0x1a')]=qs[_0x7d4c('0x1a')](_0x3784a0[_0x7d4c('0x2f')]['offset']);}_0x116b20['order']=qs[_0x7d4c('0x36')](_0x3784a0[_0x7d4c('0x2f')][_0x7d4c('0x36')]);_0x116b20[_0x7d4c('0x37')]=qs[_0x7d4c('0x38')](_[_0x7d4c('0x39')](_0x3784a0[_0x7d4c('0x2f')],_0x135018[_0x7d4c('0x38')]),_0x5603e4);if(_0x3784a0[_0x7d4c('0x2f')][_0x7d4c('0x3a')]){_0x116b20[_0x7d4c('0x37')]=_[_0x7d4c('0x3b')](_0x116b20[_0x7d4c('0x37')],{'$or':_['map'](_0x5603e4,function(_0x44b3f2){if(_0x44b3f2[_0x7d4c('0x2b')]!=='VIRTUAL'){var _0x46c9c6={};_0x46c9c6[_0x44b3f2['name']]={'$like':'%'+_0x3784a0[_0x7d4c('0x2f')][_0x7d4c('0x3a')]+'%'};return _0x46c9c6;}})});}_0x116b20=_[_0x7d4c('0x3b')]({},_0x116b20,_0x3784a0[_0x7d4c('0x3c')]);var _0x498846={'where':_0x116b20['where']};return db[_0x7d4c('0x29')]['count'](_0x498846)[_0x7d4c('0x25')](function(_0x5134fd){_0x7cb400[_0x7d4c('0x1d')]=_0x5134fd;if(_0x3784a0[_0x7d4c('0x2f')][_0x7d4c('0x3d')]){_0x116b20[_0x7d4c('0x3e')]=[{'all':!![]}];}return db[_0x7d4c('0x29')][_0x7d4c('0x3f')](_0x116b20);})[_0x7d4c('0x25')](function(_0x2341a1){_0x7cb400[_0x7d4c('0x40')]=_0x2341a1;return _0x7cb400;})['then'](respondWithFilteredResult(_0x4b1c06,_0x116b20))[_0x7d4c('0x41')](handleError(_0x4b1c06,null));};exports[_0x7d4c('0x42')]=function(_0x4a2a73,_0x4e3ee5){var _0x13cf69={'raw':!![],'where':{'id':_0x4a2a73[_0x7d4c('0x43')]['id']}},_0x3efb5b={};_0x3efb5b[_0x7d4c('0x31')]=_['keys'](db[_0x7d4c('0x29')][_0x7d4c('0x2a')]);_0x3efb5b[_0x7d4c('0x2f')]=_[_0x7d4c('0x2e')](_0x4a2a73['query']);_0x3efb5b[_0x7d4c('0x38')]=_[_0x7d4c('0x30')](_0x3efb5b[_0x7d4c('0x31')],_0x3efb5b[_0x7d4c('0x2f')]);_0x13cf69[_0x7d4c('0x32')]=_[_0x7d4c('0x30')](_0x3efb5b[_0x7d4c('0x31')],qs[_0x7d4c('0x33')](_0x4a2a73['query'][_0x7d4c('0x33')]));_0x13cf69[_0x7d4c('0x32')]=_0x13cf69[_0x7d4c('0x32')][_0x7d4c('0x34')]?_0x13cf69[_0x7d4c('0x32')]:_0x3efb5b[_0x7d4c('0x31')];if(_0x4a2a73[_0x7d4c('0x2f')][_0x7d4c('0x3d')]){_0x13cf69[_0x7d4c('0x3e')]=[{'all':!![]}];}_0x13cf69=_[_0x7d4c('0x3b')]({},_0x13cf69,_0x4a2a73['options']);return db['SmsQueueReport'][_0x7d4c('0x44')](_0x13cf69)[_0x7d4c('0x25')](handleEntityNotFound(_0x4e3ee5,null))[_0x7d4c('0x25')](respondWithResult(_0x4e3ee5,null))[_0x7d4c('0x41')](handleError(_0x4e3ee5,null));};exports[_0x7d4c('0x45')]=function(_0x44d6cb,_0x2bb396){return db[_0x7d4c('0x29')]['create'](_0x44d6cb[_0x7d4c('0x46')],{})[_0x7d4c('0x25')](respondWithResult(_0x2bb396,0xc9))[_0x7d4c('0x41')](handleError(_0x2bb396,null));};exports['update']=function(_0x29ff7d,_0x7d58fd){if(_0x29ff7d[_0x7d4c('0x46')]['id']){delete _0x29ff7d['body']['id'];}return db[_0x7d4c('0x29')][_0x7d4c('0x44')]({'where':{'id':_0x29ff7d[_0x7d4c('0x43')]['id']}})[_0x7d4c('0x25')](handleEntityNotFound(_0x7d58fd,null))[_0x7d4c('0x25')](saveUpdates(_0x29ff7d[_0x7d4c('0x46')],null))['then'](respondWithResult(_0x7d58fd,null))[_0x7d4c('0x41')](handleError(_0x7d58fd,null));};exports[_0x7d4c('0x24')]=function(_0x4af8d0,_0x529dac){return db[_0x7d4c('0x29')][_0x7d4c('0x44')]({'where':{'id':_0x4af8d0[_0x7d4c('0x43')]['id']}})['then'](handleEntityNotFound(_0x529dac,null))[_0x7d4c('0x25')](removeEntity(_0x529dac,null))['catch'](handleError(_0x529dac,null));};exports[_0x7d4c('0x47')]=function(_0x5f4a6a,_0x5aaa53){return db['SmsQueueReport']['describe']()[_0x7d4c('0x25')](respondWithResult(_0x5aaa53,null))['catch'](handleError(_0x5aaa53,null));}; \ No newline at end of file +var _0x2969=['type','VIRTUAL','options','include','findAll','catch','show','params','fields','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','SmsQueueReport','rawAttributes','fieldName','key','model','map','query','intersection','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge'];(function(_0x5205f8,_0x2f8226){var _0x5eacb5=function(_0x138d08){while(--_0x138d08){_0x5205f8['push'](_0x5205f8['shift']());}};_0x5eacb5(++_0x2f8226);}(_0x2969,0x180));var _0x9296=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x2969[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0x9296('0x0'));var rimraf=require(_0x9296('0x1'));var zipdir=require(_0x9296('0x2'));var jsonpatch=require(_0x9296('0x3'));var rp=require(_0x9296('0x4'));var moment=require(_0x9296('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9296('0x6'));var util=require('util');var path=require(_0x9296('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9296('0x8'));var fs=require('fs');var fs_extra=require(_0x9296('0x9'));var _=require(_0x9296('0xa'));var squel=require(_0x9296('0xb'));var crypto=require(_0x9296('0xc'));var jsforce=require(_0x9296('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x9296('0xe'));var querystring=require(_0x9296('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9296('0x10'));var qs=require(_0x9296('0x11'));var as=require(_0x9296('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9296('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x9296('0x14'));var licenseUtil=require(_0x9296('0x15'));var db=require(_0x9296('0x16'))['db'];function respondWithStatusCode(_0x29a3e5,_0xfa8830){_0xfa8830=_0xfa8830||0xcc;return function(_0x51caea){if(_0x51caea){return _0x29a3e5[_0x9296('0x17')](_0xfa8830);}return _0x29a3e5[_0x9296('0x18')](_0xfa8830)[_0x9296('0x19')]();};}function respondWithResult(_0x2fef16,_0x2aeaf5){_0x2aeaf5=_0x2aeaf5||0xc8;return function(_0x5716a4){if(_0x5716a4){return _0x2fef16[_0x9296('0x18')](_0x2aeaf5)[_0x9296('0x1a')](_0x5716a4);}};}function respondWithFilteredResult(_0x296fbd,_0x1375b1){return function(_0x17e923){if(_0x17e923){var _0x1101d0=typeof _0x1375b1[_0x9296('0x1b')]===_0x9296('0x1c')&&typeof _0x1375b1[_0x9296('0x1d')]===_0x9296('0x1c');var _0x32f65e=_0x17e923[_0x9296('0x1e')];var _0x251667=_0x1101d0?0x0:_0x1375b1[_0x9296('0x1b')];var _0x39ae99=_0x1101d0?_0x17e923['count']:_0x1375b1[_0x9296('0x1b')]+_0x1375b1[_0x9296('0x1d')];var _0x40e08b;if(_0x39ae99>=_0x32f65e){_0x39ae99=_0x32f65e;_0x40e08b=0xc8;}else{_0x40e08b=0xce;}_0x296fbd[_0x9296('0x18')](_0x40e08b);return _0x296fbd['set'](_0x9296('0x1f'),_0x251667+'-'+_0x39ae99+'/'+_0x32f65e)[_0x9296('0x1a')](_0x17e923);}return null;};}function patchUpdates(_0x2bd17d){return function(_0x4ace52){try{jsonpatch['apply'](_0x4ace52,_0x2bd17d,!![]);}catch(_0x5e04c6){return BPromise[_0x9296('0x20')](_0x5e04c6);}return _0x4ace52[_0x9296('0x21')]();};}function saveUpdates(_0x93915,_0x3a594b){return function(_0x4ad74f){if(_0x4ad74f){return _0x4ad74f[_0x9296('0x22')](_0x93915)[_0x9296('0x23')](function(_0x1e0d8e){return _0x1e0d8e;});}return null;};}function removeEntity(_0x4cc43c,_0x357e2f){return function(_0x35bf8f){if(_0x35bf8f){return _0x35bf8f[_0x9296('0x24')]()['then'](function(){_0x4cc43c[_0x9296('0x18')](0xcc)[_0x9296('0x19')]();});}};}function handleEntityNotFound(_0xf84cf2,_0x107598){return function(_0x20e24e){if(!_0x20e24e){_0xf84cf2[_0x9296('0x17')](0x194);}return _0x20e24e;};}function handleError(_0x37a9e0,_0x3c1b8d){_0x3c1b8d=_0x3c1b8d||0x1f4;return function(_0x1b2a3a){logger[_0x9296('0x25')](_0x1b2a3a[_0x9296('0x26')]);if(_0x1b2a3a[_0x9296('0x27')]){delete _0x1b2a3a[_0x9296('0x27')];}_0x37a9e0[_0x9296('0x18')](_0x3c1b8d)[_0x9296('0x28')](_0x1b2a3a);};}exports[_0x9296('0x29')]=function(_0x1cbdcd,_0x53a877){var _0x4a50b7={},_0x1f6eff={},_0xd0e0d8={'count':0x0,'rows':[]};var _0x4a9bbe=_['map'](db[_0x9296('0x2a')][_0x9296('0x2b')],function(_0x1cbb00){return{'name':_0x1cbb00[_0x9296('0x2c')],'type':_0x1cbb00['type'][_0x9296('0x2d')]};});_0x1f6eff[_0x9296('0x2e')]=_[_0x9296('0x2f')](_0x4a9bbe,_0x9296('0x27'));_0x1f6eff[_0x9296('0x30')]=_['keys'](_0x1cbdcd[_0x9296('0x30')]);_0x1f6eff['filters']=_['intersection'](_0x1f6eff[_0x9296('0x2e')],_0x1f6eff[_0x9296('0x30')]);_0x4a50b7['attributes']=_[_0x9296('0x31')](_0x1f6eff['model'],qs['fields'](_0x1cbdcd[_0x9296('0x30')]['fields']));_0x4a50b7[_0x9296('0x32')]=_0x4a50b7[_0x9296('0x32')][_0x9296('0x33')]?_0x4a50b7[_0x9296('0x32')]:_0x1f6eff[_0x9296('0x2e')];if(!_0x1cbdcd[_0x9296('0x30')][_0x9296('0x34')]('nolimit')){_0x4a50b7['limit']=qs[_0x9296('0x1d')](_0x1cbdcd[_0x9296('0x30')][_0x9296('0x1d')]);_0x4a50b7[_0x9296('0x1b')]=qs[_0x9296('0x1b')](_0x1cbdcd[_0x9296('0x30')]['offset']);}_0x4a50b7[_0x9296('0x35')]=qs[_0x9296('0x36')](_0x1cbdcd[_0x9296('0x30')][_0x9296('0x36')]);_0x4a50b7[_0x9296('0x37')]=qs[_0x9296('0x38')](_[_0x9296('0x39')](_0x1cbdcd['query'],_0x1f6eff[_0x9296('0x38')]),_0x4a9bbe);if(_0x1cbdcd[_0x9296('0x30')][_0x9296('0x3a')]){_0x4a50b7[_0x9296('0x37')]=_[_0x9296('0x3b')](_0x4a50b7[_0x9296('0x37')],{'$or':_[_0x9296('0x2f')](_0x4a9bbe,function(_0x19f57d){if(_0x19f57d[_0x9296('0x3c')]!==_0x9296('0x3d')){var _0x1e60da={};_0x1e60da[_0x19f57d[_0x9296('0x27')]]={'$like':'%'+_0x1cbdcd['query'][_0x9296('0x3a')]+'%'};return _0x1e60da;}})});}_0x4a50b7=_[_0x9296('0x3b')]({},_0x4a50b7,_0x1cbdcd[_0x9296('0x3e')]);var _0x476e81={'where':_0x4a50b7['where']};return db['SmsQueueReport'][_0x9296('0x1e')](_0x476e81)[_0x9296('0x23')](function(_0x42f47b){_0xd0e0d8['count']=_0x42f47b;if(_0x1cbdcd[_0x9296('0x30')]['includeAll']){_0x4a50b7[_0x9296('0x3f')]=[{'all':!![]}];}return db['SmsQueueReport'][_0x9296('0x40')](_0x4a50b7);})['then'](function(_0x49fd54){_0xd0e0d8['rows']=_0x49fd54;return _0xd0e0d8;})['then'](respondWithFilteredResult(_0x53a877,_0x4a50b7))[_0x9296('0x41')](handleError(_0x53a877,null));};exports[_0x9296('0x42')]=function(_0x2ef13c,_0x34bda6){var _0x4ec64f={'raw':!![],'where':{'id':_0x2ef13c[_0x9296('0x43')]['id']}},_0x3d51c1={};_0x3d51c1['model']=_['keys'](db[_0x9296('0x2a')]['rawAttributes']);_0x3d51c1[_0x9296('0x30')]=_['keys'](_0x2ef13c[_0x9296('0x30')]);_0x3d51c1[_0x9296('0x38')]=_[_0x9296('0x31')](_0x3d51c1[_0x9296('0x2e')],_0x3d51c1[_0x9296('0x30')]);_0x4ec64f[_0x9296('0x32')]=_[_0x9296('0x31')](_0x3d51c1['model'],qs[_0x9296('0x44')](_0x2ef13c[_0x9296('0x30')][_0x9296('0x44')]));_0x4ec64f['attributes']=_0x4ec64f[_0x9296('0x32')][_0x9296('0x33')]?_0x4ec64f['attributes']:_0x3d51c1[_0x9296('0x2e')];if(_0x2ef13c[_0x9296('0x30')][_0x9296('0x45')]){_0x4ec64f['include']=[{'all':!![]}];}_0x4ec64f=_['merge']({},_0x4ec64f,_0x2ef13c['options']);return db[_0x9296('0x2a')][_0x9296('0x46')](_0x4ec64f)[_0x9296('0x23')](handleEntityNotFound(_0x34bda6,null))['then'](respondWithResult(_0x34bda6,null))[_0x9296('0x41')](handleError(_0x34bda6,null));};exports[_0x9296('0x47')]=function(_0x4e5fb9,_0x218778){return db[_0x9296('0x2a')]['create'](_0x4e5fb9['body'],{})['then'](respondWithResult(_0x218778,0xc9))[_0x9296('0x41')](handleError(_0x218778,null));};exports[_0x9296('0x22')]=function(_0x31573c,_0x20312b){if(_0x31573c[_0x9296('0x48')]['id']){delete _0x31573c['body']['id'];}return db[_0x9296('0x2a')][_0x9296('0x46')]({'where':{'id':_0x31573c[_0x9296('0x43')]['id']}})[_0x9296('0x23')](handleEntityNotFound(_0x20312b,null))[_0x9296('0x23')](saveUpdates(_0x31573c[_0x9296('0x48')],null))[_0x9296('0x23')](respondWithResult(_0x20312b,null))[_0x9296('0x41')](handleError(_0x20312b,null));};exports[_0x9296('0x24')]=function(_0x591212,_0xa67eea){return db[_0x9296('0x2a')][_0x9296('0x46')]({'where':{'id':_0x591212[_0x9296('0x43')]['id']}})[_0x9296('0x23')](handleEntityNotFound(_0xa67eea,null))[_0x9296('0x23')](removeEntity(_0xa67eea,null))[_0x9296('0x41')](handleError(_0xa67eea,null));};exports[_0x9296('0x49')]=function(_0x230a1a,_0x2feb78){return db['SmsQueueReport'][_0x9296('0x49')]()[_0x9296('0x23')](respondWithResult(_0x2feb78,null))[_0x9296('0x41')](handleError(_0x2feb78,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 8c01b7c..28e389e 100644 --- a/server/api/smsQueueReport/smsQueueReport.model.js +++ b/server/api/smsQueueReport/smsQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid','lodash','util'];(function(_0x10c2d3,_0x2f5914){var _0x5a0b13=function(_0x412864){while(--_0x412864){_0x10c2d3['push'](_0x10c2d3['shift']());}};_0x5a0b13(++_0x2f5914);}(_0xe706,0xa3));var _0x6e70=function(_0x15a8e1,_0x21e63d){_0x15a8e1=_0x15a8e1-0x0;var _0x185130=_0xe706[_0x15a8e1];return _0x185130;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','define','SmsQueueReport','uniqueid','lodash'];(function(_0x2c173a,_0x156eb2){var _0x121eec=function(_0x3fdd45){while(--_0x3fdd45){_0x2c173a['push'](_0x2c173a['shift']());}};_0x121eec(++_0x156eb2);}(_0xb7e7,0x121));var _0x7b7e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xb7e7[_0x3c2a69];return _0x596bc8;};'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 02af2c2..6a8732d 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 _0x13e2=['result','catch','CreateSmsQueueReport','SmsQueueReport','body','options','raw','debug','update','where','attributes','limit','UpdateSmsQueueReport','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x26e6d5,_0x13ceff){var _0x174341=function(_0x53b570){while(--_0x53b570){_0x26e6d5['push'](_0x26e6d5['shift']());}};_0x174341(++_0x13ceff);}(_0x13e2,0x1a0));var _0x213e=function(_0x42a1ed,_0x2a12ed){_0x42a1ed=_0x42a1ed-0x0;var _0x1bea9a=_0x13e2[_0x42a1ed];return _0x1bea9a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x213e('0x0'));var BPromise=require(_0x213e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x213e('0x2'));var logger=require(_0x213e('0x3'))(_0x213e('0x4'));var config=require(_0x213e('0x5'));var jayson=require(_0x213e('0x6'));var client=jayson[_0x213e('0x7')][_0x213e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2b299e,_0xbbf76f,_0x148722){return new BPromise(function(_0x55ad0d,_0x24ec42){return client[_0x213e('0x9')](_0x2b299e,_0x148722)[_0x213e('0xa')](function(_0x4e6b8a){logger[_0x213e('0xb')](_0x213e('0xc'),_0xbbf76f,_0x213e('0xd'));logger['debug']('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0xbbf76f,_0x213e('0xd'),JSON[_0x213e('0xe')](_0x4e6b8a));if(_0x4e6b8a[_0x213e('0xf')]){if(_0x4e6b8a[_0x213e('0xf')][_0x213e('0x10')]===0x1f4){logger[_0x213e('0xf')](_0x213e('0xc'),_0xbbf76f,_0x4e6b8a[_0x213e('0xf')]['message']);return _0x24ec42(_0x4e6b8a[_0x213e('0xf')][_0x213e('0x11')]);}logger[_0x213e('0xf')](_0x213e('0xc'),_0xbbf76f,_0x4e6b8a[_0x213e('0xf')][_0x213e('0x11')]);return _0x55ad0d(_0x4e6b8a[_0x213e('0xf')][_0x213e('0x11')]);}else{logger[_0x213e('0xb')](_0x213e('0xc'),_0xbbf76f,_0x213e('0xd'));_0x55ad0d(_0x4e6b8a[_0x213e('0x12')][_0x213e('0x11')]);}})[_0x213e('0x13')](function(_0x177a90){logger[_0x213e('0xf')](_0x213e('0xc'),_0xbbf76f,_0x177a90);_0x24ec42(_0x177a90);});});}exports[_0x213e('0x14')]=function(_0x2d2a16){var _0x149e89=this;return new Promise(function(_0x2eff65,_0x132dcd){return db[_0x213e('0x15')]['create'](_0x2d2a16[_0x213e('0x16')],{'raw':_0x2d2a16[_0x213e('0x17')]?_0x2d2a16[_0x213e('0x17')][_0x213e('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x416781){logger[_0x213e('0xb')]('CreateSmsQueueReport',_0x2d2a16);logger[_0x213e('0x19')]('CreateSmsQueueReport',_0x2d2a16,JSON[_0x213e('0xe')](_0x416781));_0x2eff65(_0x416781);})[_0x213e('0x13')](function(_0x442c44){logger[_0x213e('0xf')](_0x213e('0x14'),_0x442c44[_0x213e('0x11')],_0x2d2a16);_0x132dcd(_0x149e89[_0x213e('0xf')](0x1f4,_0x442c44[_0x213e('0x11')]));});});};exports['UpdateSmsQueueReport']=function(_0x152798){var _0x5f2f31=this;return new Promise(function(_0x476e72,_0x3fa317){return db['SmsQueueReport'][_0x213e('0x1a')](_0x152798[_0x213e('0x16')],{'raw':_0x152798[_0x213e('0x17')]?_0x152798['options'][_0x213e('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x152798[_0x213e('0x17')]?_0x152798[_0x213e('0x17')][_0x213e('0x1b')]||null:null,'attributes':_0x152798[_0x213e('0x17')]?_0x152798['options'][_0x213e('0x1c')]||null:null,'limit':_0x152798[_0x213e('0x17')]?_0x152798['options'][_0x213e('0x1d')]||null:null})['then'](function(_0x2650e8){logger['info'](_0x213e('0x1e'),_0x152798);logger[_0x213e('0x19')]('UpdateSmsQueueReport',_0x152798,JSON[_0x213e('0xe')](_0x2650e8));_0x476e72(_0x2650e8);})[_0x213e('0x13')](function(_0x4bf887){logger[_0x213e('0xf')](_0x213e('0x1e'),_0x4bf887[_0x213e('0x11')],_0x152798);_0x3fa317(_0x5f2f31[_0x213e('0xf')](0x1f4,_0x4bf887['message']));});});}; \ No newline at end of file +var _0xa697=['request\x20sent','stringify','error','code','message','info','result','catch','CreateSmsQueueReport','SmsQueueReport','create','options','raw','then','UpdateSmsQueueReport','body','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','http','request','SmsQueueReport,\x20%s,\x20%s','debug'];(function(_0x352fbf,_0x5d417d){var _0x45784a=function(_0x22a0ff){while(--_0x22a0ff){_0x352fbf['push'](_0x352fbf['shift']());}};_0x45784a(++_0x5d417d);}(_0xa697,0xf3));var _0x7a69=function(_0x1af092,_0x5a3e78){_0x1af092=_0x1af092-0x0;var _0x485afd=_0xa697[_0x1af092];return _0x485afd;};'use strict';var _=require(_0x7a69('0x0'));var util=require(_0x7a69('0x1'));var moment=require(_0x7a69('0x2'));var BPromise=require(_0x7a69('0x3'));var rs=require(_0x7a69('0x4'));var fs=require('fs');var Redis=require(_0x7a69('0x5'));var db=require(_0x7a69('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7a69('0x7'));var config=require('../../config/environment');var jayson=require(_0x7a69('0x8'));var client=jayson['client'][_0x7a69('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x388dff,_0x477933,_0x411180){return new BPromise(function(_0x3d51db,_0xe413e3){return client[_0x7a69('0xa')](_0x388dff,_0x411180)['then'](function(_0x4c6f01){logger['info'](_0x7a69('0xb'),_0x477933,'request\x20sent');logger[_0x7a69('0xc')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x477933,_0x7a69('0xd'),JSON[_0x7a69('0xe')](_0x4c6f01));if(_0x4c6f01[_0x7a69('0xf')]){if(_0x4c6f01[_0x7a69('0xf')][_0x7a69('0x10')]===0x1f4){logger[_0x7a69('0xf')](_0x7a69('0xb'),_0x477933,_0x4c6f01[_0x7a69('0xf')]['message']);return _0xe413e3(_0x4c6f01[_0x7a69('0xf')][_0x7a69('0x11')]);}logger[_0x7a69('0xf')](_0x7a69('0xb'),_0x477933,_0x4c6f01[_0x7a69('0xf')]['message']);return _0x3d51db(_0x4c6f01[_0x7a69('0xf')][_0x7a69('0x11')]);}else{logger[_0x7a69('0x12')](_0x7a69('0xb'),_0x477933,_0x7a69('0xd'));_0x3d51db(_0x4c6f01[_0x7a69('0x13')][_0x7a69('0x11')]);}})[_0x7a69('0x14')](function(_0x985fc2){logger['error'](_0x7a69('0xb'),_0x477933,_0x985fc2);_0xe413e3(_0x985fc2);});});}exports[_0x7a69('0x15')]=function(_0x2c9ec9){var _0x4058d9=this;return new Promise(function(_0x28d459,_0x2f6f8e){return db[_0x7a69('0x16')][_0x7a69('0x17')](_0x2c9ec9['body'],{'raw':_0x2c9ec9[_0x7a69('0x18')]?_0x2c9ec9[_0x7a69('0x18')][_0x7a69('0x19')]===undefined?!![]:![]:!![]})[_0x7a69('0x1a')](function(_0x1753cd){logger[_0x7a69('0x12')](_0x7a69('0x15'),_0x2c9ec9);logger['debug'](_0x7a69('0x15'),_0x2c9ec9,JSON['stringify'](_0x1753cd));_0x28d459(_0x1753cd);})[_0x7a69('0x14')](function(_0x42fe88){logger[_0x7a69('0xf')](_0x7a69('0x15'),_0x42fe88['message'],_0x2c9ec9);_0x2f6f8e(_0x4058d9[_0x7a69('0xf')](0x1f4,_0x42fe88['message']));});});};exports[_0x7a69('0x1b')]=function(_0x16db57){var _0x2aa4fd=this;return new Promise(function(_0x4e62fc,_0x30bfd2){return db[_0x7a69('0x16')]['update'](_0x16db57[_0x7a69('0x1c')],{'raw':_0x16db57['options']?_0x16db57[_0x7a69('0x18')][_0x7a69('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16db57[_0x7a69('0x18')]?_0x16db57[_0x7a69('0x18')][_0x7a69('0x1d')]||null:null,'attributes':_0x16db57[_0x7a69('0x18')]?_0x16db57['options'][_0x7a69('0x1e')]||null:null,'limit':_0x16db57['options']?_0x16db57[_0x7a69('0x18')][_0x7a69('0x1f')]||null:null})[_0x7a69('0x1a')](function(_0x21e614){logger[_0x7a69('0x12')](_0x7a69('0x1b'),_0x16db57);logger[_0x7a69('0xc')](_0x7a69('0x1b'),_0x16db57,JSON['stringify'](_0x21e614));_0x4e62fc(_0x21e614);})['catch'](function(_0x5f2e3d){logger['error'](_0x7a69('0x1b'),_0x5f2e3d[_0x7a69('0x11')],_0x16db57);_0x30bfd2(_0x2aa4fd[_0x7a69('0xf')](0x1f4,_0x5f2e3d[_0x7a69('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 8ee91b6..d095f12 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 _0x7579=['delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','isAuthenticated','index','get','/:id','post','create','put','update'];(function(_0xa9f89e,_0x51ee9e){var _0x5a979d=function(_0x190606){while(--_0x190606){_0xa9f89e['push'](_0xa9f89e['shift']());}};_0x5a979d(++_0x51ee9e);}(_0x7579,0x1e2));var _0x9757=function(_0x493b27,_0xad3bf){_0x493b27=_0x493b27-0x0;var _0x57d4d7=_0x7579[_0x493b27];return _0x57d4d7;};'use strict';var multer=require(_0x9757('0x0'));var util=require(_0x9757('0x1'));var path=require(_0x9757('0x2'));var timeout=require(_0x9757('0x3'));var express=require(_0x9757('0x4'));var router=express[_0x9757('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9757('0x6'));var interaction=require(_0x9757('0x7'));var config=require(_0x9757('0x8'));var controller=require(_0x9757('0x9'));router['get']('/',auth[_0x9757('0xa')](),controller[_0x9757('0xb')]);router[_0x9757('0xc')]('/describe',auth[_0x9757('0xa')](),controller['describe']);router[_0x9757('0xc')](_0x9757('0xd'),auth[_0x9757('0xa')](),controller['show']);router[_0x9757('0xe')]('/',auth[_0x9757('0xa')](),controller[_0x9757('0xf')]);router[_0x9757('0x10')](_0x9757('0xd'),auth[_0x9757('0xa')](),controller[_0x9757('0x11')]);router[_0x9757('0x12')](_0x9757('0xd'),auth[_0x9757('0xa')](),controller[_0x9757('0x13')]);module['exports']=router; \ No newline at end of file +var _0x8ece=['describe','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','isAuthenticated','index','get','/describe'];(function(_0x4915c2,_0x42d37b){var _0x5e26df=function(_0x175bd3){while(--_0x175bd3){_0x4915c2['push'](_0x4915c2['shift']());}};_0x5e26df(++_0x42d37b);}(_0x8ece,0x195));var _0xe8ec=function(_0x519b11,_0x39c586){_0x519b11=_0x519b11-0x0;var _0x18c00a=_0x8ece[_0x519b11];return _0x18c00a;};'use strict';var multer=require(_0xe8ec('0x0'));var util=require(_0xe8ec('0x1'));var path=require(_0xe8ec('0x2'));var timeout=require(_0xe8ec('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe8ec('0x4'));var auth=require(_0xe8ec('0x5'));var interaction=require(_0xe8ec('0x6'));var config=require(_0xe8ec('0x7'));var controller=require(_0xe8ec('0x8'));router['get']('/',auth[_0xe8ec('0x9')](),controller[_0xe8ec('0xa')]);router[_0xe8ec('0xb')](_0xe8ec('0xc'),auth[_0xe8ec('0x9')](),controller[_0xe8ec('0xd')]);router[_0xe8ec('0xb')]('/:id',auth[_0xe8ec('0x9')](),controller['show']);router[_0xe8ec('0xe')]('/',auth['isAuthenticated'](),controller[_0xe8ec('0xf')]);router[_0xe8ec('0x10')](_0xe8ec('0x11'),auth[_0xe8ec('0x9')](),controller[_0xe8ec('0x12')]);router[_0xe8ec('0x13')](_0xe8ec('0x11'),auth[_0xe8ec('0x9')](),controller[_0xe8ec('0x14')]);module[_0xe8ec('0x15')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 8169035..c17ae54 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 _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x4e193e,_0x55e21f){var _0x597620=function(_0x399333){while(--_0x399333){_0x4e193e['push'](_0x4e193e['shift']());}};_0x597620(++_0x55e21f);}(_0xf4eb,0xec));var _0xbf4e=function(_0x2982a2,_0x3b21a4){_0x2982a2=_0x2982a2-0x0;var _0x1cccc7=_0xf4eb[_0x2982a2];return _0x1cccc7;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file +var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x46ddb8,_0x387537){var _0x86e681=function(_0x449e7b){while(--_0x449e7b){_0x46ddb8['push'](_0x46ddb8['shift']());}};_0x86e681(++_0x387537);}(_0xf4eb,0xec));var _0xbf4e=function(_0x1c96a3,_0x5d35ef){_0x1c96a3=_0x1c96a3-0x0;var _0x3de2f6=_0xf4eb[_0x1c96a3];return _0x3de2f6;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index ee60007..6484b5e 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 _0x632a=['findAll','rows','show','params','rawAttributes','options','catch','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','SmsTransferReport','fieldName','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','includeAll','include'];(function(_0x101f7e,_0x5175f9){var _0x136dde=function(_0xe3cd3a){while(--_0xe3cd3a){_0x101f7e['push'](_0x101f7e['shift']());}};_0x136dde(++_0x5175f9);}(_0x632a,0x15b));var _0xa632=function(_0xc330e2,_0x2710df){_0xc330e2=_0xc330e2-0x0;var _0x97df23=_0x632a[_0xc330e2];return _0x97df23;};'use strict';var emlformat=require(_0xa632('0x0'));var rimraf=require(_0xa632('0x1'));var zipdir=require(_0xa632('0x2'));var jsonpatch=require(_0xa632('0x3'));var rp=require(_0xa632('0x4'));var moment=require(_0xa632('0x5'));var BPromise=require(_0xa632('0x6'));var Mustache=require(_0xa632('0x7'));var util=require(_0xa632('0x8'));var path=require('path');var sox=require(_0xa632('0x9'));var csv=require(_0xa632('0xa'));var ejs=require(_0xa632('0xb'));var fs=require('fs');var fs_extra=require(_0xa632('0xc'));var _=require(_0xa632('0xd'));var squel=require(_0xa632('0xe'));var crypto=require(_0xa632('0xf'));var jsforce=require(_0xa632('0x10'));var deskjs=require(_0xa632('0x11'));var toCsv=require(_0xa632('0xa'));var querystring=require(_0xa632('0x12'));var Papa=require(_0xa632('0x13'));var Redis=require(_0xa632('0x14'));var authService=require(_0xa632('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0xa632('0x16'));var hardwareService=require(_0xa632('0x17'));var logger=require(_0xa632('0x18'))(_0xa632('0x19'));var utils=require(_0xa632('0x1a'));var config=require(_0xa632('0x1b'));var licenseUtil=require(_0xa632('0x1c'));var db=require(_0xa632('0x1d'))['db'];function respondWithStatusCode(_0x311f32,_0x14c6e4){_0x14c6e4=_0x14c6e4||0xcc;return function(_0x33e7e1){if(_0x33e7e1){return _0x311f32['sendStatus'](_0x14c6e4);}return _0x311f32[_0xa632('0x1e')](_0x14c6e4)[_0xa632('0x1f')]();};}function respondWithResult(_0x2dac20,_0x1e9083){_0x1e9083=_0x1e9083||0xc8;return function(_0x471d01){if(_0x471d01){return _0x2dac20[_0xa632('0x1e')](_0x1e9083)[_0xa632('0x20')](_0x471d01);}};}function respondWithFilteredResult(_0x4781b5,_0x53c721){return function(_0x6fe284){if(_0x6fe284){var _0x5b7dc3=typeof _0x53c721[_0xa632('0x21')]===_0xa632('0x22')&&typeof _0x53c721[_0xa632('0x23')]==='undefined';var _0x16eefd=_0x6fe284[_0xa632('0x24')];var _0xd5ae94=_0x5b7dc3?0x0:_0x53c721[_0xa632('0x21')];var _0x53180c=_0x5b7dc3?_0x6fe284[_0xa632('0x24')]:_0x53c721['offset']+_0x53c721[_0xa632('0x23')];var _0x30e682;if(_0x53180c>=_0x16eefd){_0x53180c=_0x16eefd;_0x30e682=0xc8;}else{_0x30e682=0xce;}_0x4781b5['status'](_0x30e682);return _0x4781b5[_0xa632('0x25')](_0xa632('0x26'),_0xd5ae94+'-'+_0x53180c+'/'+_0x16eefd)['json'](_0x6fe284);}return null;};}function patchUpdates(_0x245ec7){return function(_0x4b1634){try{jsonpatch[_0xa632('0x27')](_0x4b1634,_0x245ec7,!![]);}catch(_0x421241){return BPromise[_0xa632('0x28')](_0x421241);}return _0x4b1634[_0xa632('0x29')]();};}function saveUpdates(_0x206f46,_0x526d18){return function(_0x263852){if(_0x263852){return _0x263852[_0xa632('0x2a')](_0x206f46)[_0xa632('0x2b')](function(_0x2bae8b){return _0x2bae8b;});}return null;};}function removeEntity(_0x41c16a,_0x4ddb3a){return function(_0x36a912){if(_0x36a912){return _0x36a912[_0xa632('0x2c')]()[_0xa632('0x2b')](function(){_0x41c16a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b0599,_0x206629){return function(_0x2390b9){if(!_0x2390b9){_0x3b0599['sendStatus'](0x194);}return _0x2390b9;};}function handleError(_0x220835,_0x3e31e4){_0x3e31e4=_0x3e31e4||0x1f4;return function(_0x290816){logger[_0xa632('0x2d')](_0x290816[_0xa632('0x2e')]);if(_0x290816[_0xa632('0x2f')]){delete _0x290816[_0xa632('0x2f')];}_0x220835[_0xa632('0x1e')](_0x3e31e4)['send'](_0x290816);};}exports[_0xa632('0x30')]=function(_0x3698a6,_0x2d6732){var _0x25dab5={},_0x382c46={},_0x5ead9c={'count':0x0,'rows':[]};var _0x1965ac=_[_0xa632('0x31')](db[_0xa632('0x32')]['rawAttributes'],function(_0x45ba4e){return{'name':_0x45ba4e[_0xa632('0x33')],'type':_0x45ba4e['type'][_0xa632('0x34')]};});_0x382c46['model']=_[_0xa632('0x31')](_0x1965ac,_0xa632('0x2f'));_0x382c46[_0xa632('0x35')]=_[_0xa632('0x36')](_0x3698a6[_0xa632('0x35')]);_0x382c46[_0xa632('0x37')]=_['intersection'](_0x382c46[_0xa632('0x38')],_0x382c46[_0xa632('0x35')]);_0x25dab5[_0xa632('0x39')]=_[_0xa632('0x3a')](_0x382c46[_0xa632('0x38')],qs[_0xa632('0x3b')](_0x3698a6[_0xa632('0x35')][_0xa632('0x3b')]));_0x25dab5[_0xa632('0x39')]=_0x25dab5['attributes'][_0xa632('0x3c')]?_0x25dab5[_0xa632('0x39')]:_0x382c46['model'];if(!_0x3698a6[_0xa632('0x35')][_0xa632('0x3d')](_0xa632('0x3e'))){_0x25dab5['limit']=qs[_0xa632('0x23')](_0x3698a6[_0xa632('0x35')][_0xa632('0x23')]);_0x25dab5[_0xa632('0x21')]=qs[_0xa632('0x21')](_0x3698a6[_0xa632('0x35')][_0xa632('0x21')]);}_0x25dab5[_0xa632('0x3f')]=qs[_0xa632('0x40')](_0x3698a6[_0xa632('0x35')][_0xa632('0x40')]);_0x25dab5[_0xa632('0x41')]=qs['filters'](_[_0xa632('0x42')](_0x3698a6[_0xa632('0x35')],_0x382c46[_0xa632('0x37')]),_0x1965ac);if(_0x3698a6['query']['filter']){_0x25dab5['where']=_[_0xa632('0x43')](_0x25dab5[_0xa632('0x41')],{'$or':_['map'](_0x1965ac,function(_0x299316){if(_0x299316[_0xa632('0x44')]!==_0xa632('0x45')){var _0x164c95={};_0x164c95[_0x299316[_0xa632('0x2f')]]={'$like':'%'+_0x3698a6[_0xa632('0x35')][_0xa632('0x46')]+'%'};return _0x164c95;}})});}_0x25dab5=_['merge']({},_0x25dab5,_0x3698a6['options']);var _0x2026e7={'where':_0x25dab5[_0xa632('0x41')]};return db[_0xa632('0x32')]['count'](_0x2026e7)[_0xa632('0x2b')](function(_0x78384f){_0x5ead9c[_0xa632('0x24')]=_0x78384f;if(_0x3698a6['query'][_0xa632('0x47')]){_0x25dab5[_0xa632('0x48')]=[{'all':!![]}];}return db['SmsTransferReport'][_0xa632('0x49')](_0x25dab5);})[_0xa632('0x2b')](function(_0x3fc48d){_0x5ead9c[_0xa632('0x4a')]=_0x3fc48d;return _0x5ead9c;})[_0xa632('0x2b')](respondWithFilteredResult(_0x2d6732,_0x25dab5))['catch'](handleError(_0x2d6732,null));};exports[_0xa632('0x4b')]=function(_0x3963d1,_0x5b7e54){var _0x450415={'raw':!![],'where':{'id':_0x3963d1[_0xa632('0x4c')]['id']}},_0x292915={};_0x292915[_0xa632('0x38')]=_[_0xa632('0x36')](db[_0xa632('0x32')][_0xa632('0x4d')]);_0x292915[_0xa632('0x35')]=_['keys'](_0x3963d1[_0xa632('0x35')]);_0x292915[_0xa632('0x37')]=_[_0xa632('0x3a')](_0x292915['model'],_0x292915['query']);_0x450415['attributes']=_[_0xa632('0x3a')](_0x292915[_0xa632('0x38')],qs[_0xa632('0x3b')](_0x3963d1['query'][_0xa632('0x3b')]));_0x450415['attributes']=_0x450415[_0xa632('0x39')][_0xa632('0x3c')]?_0x450415[_0xa632('0x39')]:_0x292915[_0xa632('0x38')];if(_0x3963d1['query'][_0xa632('0x47')]){_0x450415['include']=[{'all':!![]}];}_0x450415=_[_0xa632('0x43')]({},_0x450415,_0x3963d1[_0xa632('0x4e')]);return db[_0xa632('0x32')]['find'](_0x450415)[_0xa632('0x2b')](handleEntityNotFound(_0x5b7e54,null))[_0xa632('0x2b')](respondWithResult(_0x5b7e54,null))[_0xa632('0x4f')](handleError(_0x5b7e54,null));};exports['create']=function(_0x3af3fa,_0x2c1bc4){return db[_0xa632('0x32')][_0xa632('0x50')](_0x3af3fa[_0xa632('0x51')],{})[_0xa632('0x2b')](respondWithResult(_0x2c1bc4,0xc9))[_0xa632('0x4f')](handleError(_0x2c1bc4,null));};exports['update']=function(_0x556e73,_0x258e4d){if(_0x556e73[_0xa632('0x51')]['id']){delete _0x556e73[_0xa632('0x51')]['id'];}return db['SmsTransferReport'][_0xa632('0x52')]({'where':{'id':_0x556e73[_0xa632('0x4c')]['id']}})[_0xa632('0x2b')](handleEntityNotFound(_0x258e4d,null))[_0xa632('0x2b')](saveUpdates(_0x556e73['body'],null))['then'](respondWithResult(_0x258e4d,null))['catch'](handleError(_0x258e4d,null));};exports[_0xa632('0x2c')]=function(_0x25a83a,_0x5213d2){return db['SmsTransferReport']['find']({'where':{'id':_0x25a83a[_0xa632('0x4c')]['id']}})[_0xa632('0x2b')](handleEntityNotFound(_0x5213d2,null))[_0xa632('0x2b')](removeEntity(_0x5213d2,null))[_0xa632('0x4f')](handleError(_0x5213d2,null));};exports[_0xa632('0x53')]=function(_0x49f3ec,_0x58a047){return db[_0xa632('0x32')][_0xa632('0x53')]()[_0xa632('0x2b')](respondWithResult(_0x58a047,null))['catch'](handleError(_0x58a047,null));}; \ No newline at end of file +var _0x3ac3=['to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','update','destroy','sendStatus','stack','name','index','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','then','include','findAll','catch','show','params','keys','SmsTransferReport','includeAll','options','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x3ac3,0x1b4));var _0x33ac=function(_0x3e32a8,_0x255953){_0x3e32a8=_0x3e32a8-0x0;var _0x2997b0=_0x3ac3[_0x3e32a8];return _0x2997b0;};'use strict';var emlformat=require(_0x33ac('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x33ac('0x1'));var jsonpatch=require(_0x33ac('0x2'));var rp=require(_0x33ac('0x3'));var moment=require(_0x33ac('0x4'));var BPromise=require(_0x33ac('0x5'));var Mustache=require(_0x33ac('0x6'));var util=require('util');var path=require(_0x33ac('0x7'));var sox=require('sox');var csv=require(_0x33ac('0x8'));var ejs=require(_0x33ac('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x33ac('0xa'));var squel=require('squel');var crypto=require(_0x33ac('0xb'));var jsforce=require(_0x33ac('0xc'));var deskjs=require(_0x33ac('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x33ac('0xe'));var Redis=require(_0x33ac('0xf'));var authService=require(_0x33ac('0x10'));var qs=require(_0x33ac('0x11'));var as=require(_0x33ac('0x12'));var hardwareService=require(_0x33ac('0x13'));var logger=require(_0x33ac('0x14'))(_0x33ac('0x15'));var utils=require(_0x33ac('0x16'));var config=require(_0x33ac('0x17'));var licenseUtil=require(_0x33ac('0x18'));var db=require(_0x33ac('0x19'))['db'];function respondWithStatusCode(_0xa59602,_0x126e3f){_0x126e3f=_0x126e3f||0xcc;return function(_0x2ee483){if(_0x2ee483){return _0xa59602['sendStatus'](_0x126e3f);}return _0xa59602['status'](_0x126e3f)[_0x33ac('0x1a')]();};}function respondWithResult(_0x4ae68f,_0x411ee5){_0x411ee5=_0x411ee5||0xc8;return function(_0x248623){if(_0x248623){return _0x4ae68f['status'](_0x411ee5)[_0x33ac('0x1b')](_0x248623);}};}function respondWithFilteredResult(_0x463d7b,_0x40d0a3){return function(_0x4f5be7){if(_0x4f5be7){var _0x1fd6c5=typeof _0x40d0a3[_0x33ac('0x1c')]===_0x33ac('0x1d')&&typeof _0x40d0a3['limit']===_0x33ac('0x1d');var _0x39b52a=_0x4f5be7[_0x33ac('0x1e')];var _0x5d884e=_0x1fd6c5?0x0:_0x40d0a3['offset'];var _0xf21253=_0x1fd6c5?_0x4f5be7['count']:_0x40d0a3[_0x33ac('0x1c')]+_0x40d0a3[_0x33ac('0x1f')];var _0x1a84f1;if(_0xf21253>=_0x39b52a){_0xf21253=_0x39b52a;_0x1a84f1=0xc8;}else{_0x1a84f1=0xce;}_0x463d7b[_0x33ac('0x20')](_0x1a84f1);return _0x463d7b[_0x33ac('0x21')](_0x33ac('0x22'),_0x5d884e+'-'+_0xf21253+'/'+_0x39b52a)['json'](_0x4f5be7);}return null;};}function patchUpdates(_0x1e9ce1){return function(_0x42b0d6){try{jsonpatch[_0x33ac('0x23')](_0x42b0d6,_0x1e9ce1,!![]);}catch(_0x223fbb){return BPromise['reject'](_0x223fbb);}return _0x42b0d6['save']();};}function saveUpdates(_0x20636b,_0x9ffc68){return function(_0x124640){if(_0x124640){return _0x124640[_0x33ac('0x24')](_0x20636b)['then'](function(_0x31c502){return _0x31c502;});}return null;};}function removeEntity(_0x540160,_0x34126d){return function(_0x5ecc70){if(_0x5ecc70){return _0x5ecc70[_0x33ac('0x25')]()['then'](function(){_0x540160[_0x33ac('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36ceac,_0x4b7f18){return function(_0x33f354){if(!_0x33f354){_0x36ceac[_0x33ac('0x26')](0x194);}return _0x33f354;};}function handleError(_0x323597,_0x182c07){_0x182c07=_0x182c07||0x1f4;return function(_0x275598){logger['error'](_0x275598[_0x33ac('0x27')]);if(_0x275598[_0x33ac('0x28')]){delete _0x275598[_0x33ac('0x28')];}_0x323597[_0x33ac('0x20')](_0x182c07)['send'](_0x275598);};}exports[_0x33ac('0x29')]=function(_0x49c05f,_0x190e8e){var _0x1bb796={},_0x258928={},_0x254a48={'count':0x0,'rows':[]};var _0x278e38=_['map'](db['SmsTransferReport'][_0x33ac('0x2a')],function(_0x4e3f7f){return{'name':_0x4e3f7f[_0x33ac('0x2b')],'type':_0x4e3f7f[_0x33ac('0x2c')]['key']};});_0x258928[_0x33ac('0x2d')]=_[_0x33ac('0x2e')](_0x278e38,_0x33ac('0x28'));_0x258928[_0x33ac('0x2f')]=_['keys'](_0x49c05f[_0x33ac('0x2f')]);_0x258928[_0x33ac('0x30')]=_[_0x33ac('0x31')](_0x258928[_0x33ac('0x2d')],_0x258928[_0x33ac('0x2f')]);_0x1bb796[_0x33ac('0x32')]=_[_0x33ac('0x31')](_0x258928[_0x33ac('0x2d')],qs[_0x33ac('0x33')](_0x49c05f['query'][_0x33ac('0x33')]));_0x1bb796['attributes']=_0x1bb796[_0x33ac('0x32')][_0x33ac('0x34')]?_0x1bb796[_0x33ac('0x32')]:_0x258928[_0x33ac('0x2d')];if(!_0x49c05f[_0x33ac('0x2f')]['hasOwnProperty'](_0x33ac('0x35'))){_0x1bb796[_0x33ac('0x1f')]=qs[_0x33ac('0x1f')](_0x49c05f[_0x33ac('0x2f')][_0x33ac('0x1f')]);_0x1bb796[_0x33ac('0x1c')]=qs[_0x33ac('0x1c')](_0x49c05f[_0x33ac('0x2f')][_0x33ac('0x1c')]);}_0x1bb796[_0x33ac('0x36')]=qs[_0x33ac('0x37')](_0x49c05f[_0x33ac('0x2f')][_0x33ac('0x37')]);_0x1bb796[_0x33ac('0x38')]=qs[_0x33ac('0x30')](_[_0x33ac('0x39')](_0x49c05f[_0x33ac('0x2f')],_0x258928['filters']),_0x278e38);if(_0x49c05f[_0x33ac('0x2f')][_0x33ac('0x3a')]){_0x1bb796[_0x33ac('0x38')]=_['merge'](_0x1bb796[_0x33ac('0x38')],{'$or':_[_0x33ac('0x2e')](_0x278e38,function(_0x1e9907){if(_0x1e9907[_0x33ac('0x2c')]!=='VIRTUAL'){var _0x3ba5d2={};_0x3ba5d2[_0x1e9907[_0x33ac('0x28')]]={'$like':'%'+_0x49c05f[_0x33ac('0x2f')]['filter']+'%'};return _0x3ba5d2;}})});}_0x1bb796=_[_0x33ac('0x3b')]({},_0x1bb796,_0x49c05f['options']);var _0x11e701={'where':_0x1bb796[_0x33ac('0x38')]};return db['SmsTransferReport'][_0x33ac('0x1e')](_0x11e701)[_0x33ac('0x3c')](function(_0x38e40e){_0x254a48[_0x33ac('0x1e')]=_0x38e40e;if(_0x49c05f['query']['includeAll']){_0x1bb796[_0x33ac('0x3d')]=[{'all':!![]}];}return db['SmsTransferReport'][_0x33ac('0x3e')](_0x1bb796);})[_0x33ac('0x3c')](function(_0x3897cb){_0x254a48['rows']=_0x3897cb;return _0x254a48;})[_0x33ac('0x3c')](respondWithFilteredResult(_0x190e8e,_0x1bb796))[_0x33ac('0x3f')](handleError(_0x190e8e,null));};exports[_0x33ac('0x40')]=function(_0x4b02e7,_0x1ff2b7){var _0xdbf38e={'raw':!![],'where':{'id':_0x4b02e7[_0x33ac('0x41')]['id']}},_0xc59fdc={};_0xc59fdc['model']=_[_0x33ac('0x42')](db[_0x33ac('0x43')][_0x33ac('0x2a')]);_0xc59fdc[_0x33ac('0x2f')]=_[_0x33ac('0x42')](_0x4b02e7[_0x33ac('0x2f')]);_0xc59fdc[_0x33ac('0x30')]=_[_0x33ac('0x31')](_0xc59fdc['model'],_0xc59fdc[_0x33ac('0x2f')]);_0xdbf38e['attributes']=_['intersection'](_0xc59fdc[_0x33ac('0x2d')],qs[_0x33ac('0x33')](_0x4b02e7['query'][_0x33ac('0x33')]));_0xdbf38e[_0x33ac('0x32')]=_0xdbf38e[_0x33ac('0x32')][_0x33ac('0x34')]?_0xdbf38e[_0x33ac('0x32')]:_0xc59fdc[_0x33ac('0x2d')];if(_0x4b02e7[_0x33ac('0x2f')][_0x33ac('0x44')]){_0xdbf38e[_0x33ac('0x3d')]=[{'all':!![]}];}_0xdbf38e=_[_0x33ac('0x3b')]({},_0xdbf38e,_0x4b02e7[_0x33ac('0x45')]);return db[_0x33ac('0x43')]['find'](_0xdbf38e)[_0x33ac('0x3c')](handleEntityNotFound(_0x1ff2b7,null))[_0x33ac('0x3c')](respondWithResult(_0x1ff2b7,null))['catch'](handleError(_0x1ff2b7,null));};exports[_0x33ac('0x46')]=function(_0x385dc3,_0x5eed62){return db[_0x33ac('0x43')][_0x33ac('0x46')](_0x385dc3['body'],{})[_0x33ac('0x3c')](respondWithResult(_0x5eed62,0xc9))[_0x33ac('0x3f')](handleError(_0x5eed62,null));};exports[_0x33ac('0x24')]=function(_0x51d7cf,_0x5ce318){if(_0x51d7cf[_0x33ac('0x47')]['id']){delete _0x51d7cf['body']['id'];}return db['SmsTransferReport'][_0x33ac('0x48')]({'where':{'id':_0x51d7cf[_0x33ac('0x41')]['id']}})[_0x33ac('0x3c')](handleEntityNotFound(_0x5ce318,null))[_0x33ac('0x3c')](saveUpdates(_0x51d7cf[_0x33ac('0x47')],null))[_0x33ac('0x3c')](respondWithResult(_0x5ce318,null))[_0x33ac('0x3f')](handleError(_0x5ce318,null));};exports[_0x33ac('0x25')]=function(_0x4a6c72,_0x6221a0){return db[_0x33ac('0x43')]['find']({'where':{'id':_0x4a6c72[_0x33ac('0x41')]['id']}})[_0x33ac('0x3c')](handleEntityNotFound(_0x6221a0,null))[_0x33ac('0x3c')](removeEntity(_0x6221a0,null))[_0x33ac('0x3f')](handleError(_0x6221a0,null));};exports[_0x33ac('0x49')]=function(_0x5d3841,_0x257232){return db[_0x33ac('0x43')][_0x33ac('0x49')]()[_0x33ac('0x3c')](respondWithResult(_0x257232,null))[_0x33ac('0x3f')](handleError(_0x257232,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index f7f0273..bb412c8 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 _0x7c53=['rimraf','../../config/environment','./smsTransferReport.attributes','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','moment','bluebird','request-promise','path'];(function(_0x577168,_0x1dec18){var _0x288c71=function(_0x6c0698){while(--_0x6c0698){_0x577168['push'](_0x577168['shift']());}};_0x288c71(++_0x1dec18);}(_0x7c53,0xbb));var _0x37c5=function(_0x8feac6,_0x5c6fc1){_0x8feac6=_0x8feac6-0x0;var _0x52e685=_0x7c53[_0x8feac6];return _0x52e685;};'use strict';var _=require(_0x37c5('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x37c5('0x1'));var BPromise=require(_0x37c5('0x2'));var rp=require(_0x37c5('0x3'));var fs=require('fs');var path=require(_0x37c5('0x4'));var rimraf=require(_0x37c5('0x5'));var config=require(_0x37c5('0x6'));var attributes=require(_0x37c5('0x7'));module['exports']=function(_0x186929,_0x9ce684){return _0x186929[_0x37c5('0x8')](_0x37c5('0x9'),attributes,{'tableName':_0x37c5('0xa'),'paranoid':![],'indexes':[{'name':_0x37c5('0xb'),'fields':[_0x37c5('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x39d4=['define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./smsTransferReport.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x39d4,0x9e));var _0x439d=function(_0x15f41c,_0x3e3eb7){_0x15f41c=_0x15f41c-0x0;var _0x405130=_0x39d4[_0x15f41c];return _0x405130;};'use strict';var _=require(_0x439d('0x0'));var util=require(_0x439d('0x1'));var logger=require(_0x439d('0x2'))(_0x439d('0x3'));var moment=require(_0x439d('0x4'));var BPromise=require(_0x439d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x439d('0x6'));var rimraf=require(_0x439d('0x7'));var config=require(_0x439d('0x8'));var attributes=require(_0x439d('0x9'));module['exports']=function(_0x4dbacf,_0x947f62){return _0x4dbacf[_0x439d('0xa')](_0x439d('0xb'),attributes,{'tableName':_0x439d('0xc'),'paranoid':![],'indexes':[{'name':_0x439d('0xd'),'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 8d322a9..09bb0ea 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 _0x4f99=['client','http','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x2dc14b,_0x2f1f9f){var _0x514740=function(_0x5eb0ba){while(--_0x5eb0ba){_0x2dc14b['push'](_0x2dc14b['shift']());}};_0x514740(++_0x2f1f9f);}(_0x4f99,0x157));var _0x94f9=function(_0xa7d8c3,_0x46ff3a){_0xa7d8c3=_0xa7d8c3-0x0;var _0xb38061=_0x4f99[_0xa7d8c3];return _0xb38061;};'use strict';var _=require(_0x94f9('0x0'));var util=require(_0x94f9('0x1'));var moment=require('moment');var BPromise=require(_0x94f9('0x2'));var rs=require(_0x94f9('0x3'));var fs=require('fs');var Redis=require(_0x94f9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x94f9('0x5'));var logger=require(_0x94f9('0x6'))('rpc');var config=require(_0x94f9('0x7'));var jayson=require(_0x94f9('0x8'));var client=jayson[_0x94f9('0x9')][_0x94f9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36bfd9,_0x484a54,_0x1e4823){return new BPromise(function(_0x5a4301,_0x3550f0){return client['request'](_0x36bfd9,_0x1e4823)[_0x94f9('0xb')](function(_0x50af31){logger[_0x94f9('0xc')](_0x94f9('0xd'),_0x484a54,_0x94f9('0xe'));logger[_0x94f9('0xf')](_0x94f9('0x10'),_0x484a54,_0x94f9('0xe'),JSON[_0x94f9('0x11')](_0x50af31));if(_0x50af31['error']){if(_0x50af31[_0x94f9('0x12')][_0x94f9('0x13')]===0x1f4){logger[_0x94f9('0x12')](_0x94f9('0xd'),_0x484a54,_0x50af31[_0x94f9('0x12')][_0x94f9('0x14')]);return _0x3550f0(_0x50af31[_0x94f9('0x12')][_0x94f9('0x14')]);}logger[_0x94f9('0x12')](_0x94f9('0xd'),_0x484a54,_0x50af31[_0x94f9('0x12')][_0x94f9('0x14')]);return _0x5a4301(_0x50af31[_0x94f9('0x12')][_0x94f9('0x14')]);}else{logger[_0x94f9('0xc')]('SmsTransferReport,\x20%s,\x20%s',_0x484a54,_0x94f9('0xe'));_0x5a4301(_0x50af31[_0x94f9('0x15')][_0x94f9('0x14')]);}})['catch'](function(_0x490841){logger[_0x94f9('0x12')](_0x94f9('0xd'),_0x484a54,_0x490841);_0x3550f0(_0x490841);});});} \ No newline at end of file +var _0x032e=['code','message','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x1985b1,_0x2454fb){var _0xcf5cb6=function(_0x266342){while(--_0x266342){_0x1985b1['push'](_0x1985b1['shift']());}};_0xcf5cb6(++_0x2454fb);}(_0x032e,0x124));var _0xe032=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x032e[_0x3054be];return _0x3df150;};'use strict';var _=require(_0xe032('0x0'));var util=require('util');var moment=require(_0xe032('0x1'));var BPromise=require(_0xe032('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe032('0x3'))['db'];var utils=require(_0xe032('0x4'));var logger=require(_0xe032('0x5'))(_0xe032('0x6'));var config=require(_0xe032('0x7'));var jayson=require(_0xe032('0x8'));var client=jayson[_0xe032('0x9')][_0xe032('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x37432f,_0x1576c8,_0x3289b0){return new BPromise(function(_0xd84027,_0xaf3907){return client[_0xe032('0xb')](_0x37432f,_0x3289b0)[_0xe032('0xc')](function(_0x2d8a14){logger[_0xe032('0xd')](_0xe032('0xe'),_0x1576c8,'request\x20sent');logger[_0xe032('0xf')](_0xe032('0x10'),_0x1576c8,_0xe032('0x11'),JSON[_0xe032('0x12')](_0x2d8a14));if(_0x2d8a14[_0xe032('0x13')]){if(_0x2d8a14[_0xe032('0x13')][_0xe032('0x14')]===0x1f4){logger['error'](_0xe032('0xe'),_0x1576c8,_0x2d8a14[_0xe032('0x13')][_0xe032('0x15')]);return _0xaf3907(_0x2d8a14[_0xe032('0x13')]['message']);}logger[_0xe032('0x13')](_0xe032('0xe'),_0x1576c8,_0x2d8a14[_0xe032('0x13')][_0xe032('0x15')]);return _0xd84027(_0x2d8a14[_0xe032('0x13')][_0xe032('0x15')]);}else{logger[_0xe032('0xd')]('SmsTransferReport,\x20%s,\x20%s',_0x1576c8,_0xe032('0x11'));_0xd84027(_0x2d8a14[_0xe032('0x16')][_0xe032('0x15')]);}})[_0xe032('0x17')](function(_0x1938c4){logger[_0xe032('0x13')]('SmsTransferReport,\x20%s,\x20%s',_0x1576c8,_0x1938c4);_0xaf3907(_0x1938c4);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 182b2c6..c8ac018 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 _0x2ad8=['download','diskStorage','join','originalname','replace','format','%s-%s%s','basename','now','single','file','create','put','delete','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id','show','/:id/download'];(function(_0x19d48b,_0xf68c66){var _0x2d3f1e=function(_0x156b57){while(--_0x156b57){_0x19d48b['push'](_0x19d48b['shift']());}};_0x2d3f1e(++_0xf68c66);}(_0x2ad8,0x176));var _0x82ad=function(_0x119cd8,_0x556b73){_0x119cd8=_0x119cd8-0x0;var _0x7072a3=_0x2ad8[_0x119cd8];return _0x7072a3;};'use strict';var multer=require(_0x82ad('0x0'));var util=require(_0x82ad('0x1'));var path=require('path');var timeout=require(_0x82ad('0x2'));var express=require(_0x82ad('0x3'));var router=express[_0x82ad('0x4')]();var fs_extra=require(_0x82ad('0x5'));var auth=require(_0x82ad('0x6'));var interaction=require(_0x82ad('0x7'));var config=require(_0x82ad('0x8'));var controller=require(_0x82ad('0x9'));router[_0x82ad('0xa')]('/',auth[_0x82ad('0xb')](),controller[_0x82ad('0xc')]);router['get'](_0x82ad('0xd'),auth[_0x82ad('0xb')](),controller[_0x82ad('0xe')]);router['get'](_0x82ad('0xf'),auth['isAuthenticated'](),controller[_0x82ad('0x10')]);var upload=multer({'storage':multer[_0x82ad('0x11')]({'destination':function(_0x4d2c60,_0x17dc03,_0x1395f2){_0x1395f2(null,path[_0x82ad('0x12')](config['root'],'server/files/sounds/original/'));},'filename':function(_0x4dafea,_0x51fc52,_0x33ae5f){_0x51fc52[_0x82ad('0x13')]=_0x51fc52['originalname'][_0x82ad('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x33ae5f(null,util[_0x82ad('0x15')](_0x82ad('0x16'),path[_0x82ad('0x17')](_0x51fc52[_0x82ad('0x13')],path['extname'](_0x51fc52[_0x82ad('0x13')])),Date[_0x82ad('0x18')](),path['extname'](_0x51fc52[_0x82ad('0x13')])));}})});router['post']('/',upload[_0x82ad('0x19')](_0x82ad('0x1a')),controller[_0x82ad('0x1b')]);router[_0x82ad('0x1c')]('/:id',auth[_0x82ad('0xb')](),controller['update']);router['delete'](_0x82ad('0xd'),auth[_0x82ad('0xb')](),controller[_0x82ad('0x1d')]);module['exports']=router; \ No newline at end of file +var _0x8a2f=['isAuthenticated','index','/:id','/:id/download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','extname','now','single','create','put','update','delete','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x153798,_0x20c9f4){var _0x21e876=function(_0x4045db){while(--_0x4045db){_0x153798['push'](_0x153798['shift']());}};_0x21e876(++_0x20c9f4);}(_0x8a2f,0x14c));var _0xf8a2=function(_0x221a06,_0x2584be){_0x221a06=_0x221a06-0x0;var _0x50955a=_0x8a2f[_0x221a06];return _0x50955a;};'use strict';var multer=require(_0xf8a2('0x0'));var util=require(_0xf8a2('0x1'));var path=require('path');var timeout=require(_0xf8a2('0x2'));var express=require(_0xf8a2('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf8a2('0x4'));var interaction=require(_0xf8a2('0x5'));var config=require('../../config/environment');var controller=require('./sound.controller');router['get']('/',auth[_0xf8a2('0x6')](),controller[_0xf8a2('0x7')]);router['get'](_0xf8a2('0x8'),auth[_0xf8a2('0x6')](),controller['show']);router['get'](_0xf8a2('0x9'),auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer[_0xf8a2('0xa')]({'destination':function(_0x378481,_0x3ea821,_0x54efbd){_0x54efbd(null,path[_0xf8a2('0xb')](config[_0xf8a2('0xc')],_0xf8a2('0xd')));},'filename':function(_0xbfc527,_0x5d4584,_0x3b4642){_0x5d4584['originalname']=_0x5d4584[_0xf8a2('0xe')][_0xf8a2('0xf')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3b4642(null,util[_0xf8a2('0x10')](_0xf8a2('0x11'),path['basename'](_0x5d4584[_0xf8a2('0xe')],path[_0xf8a2('0x12')](_0x5d4584['originalname'])),Date[_0xf8a2('0x13')](),path['extname'](_0x5d4584[_0xf8a2('0xe')])));}})});router['post']('/',upload[_0xf8a2('0x14')]('file'),controller[_0xf8a2('0x15')]);router[_0xf8a2('0x16')](_0xf8a2('0x8'),auth[_0xf8a2('0x6')](),controller[_0xf8a2('0x17')]);router[_0xf8a2('0x18')](_0xf8a2('0x8'),auth[_0xf8a2('0x6')](),controller['delete']);module[_0xf8a2('0x19')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 21e9953..2ff937b 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 _0xb465=['FLOAT','INTEGER','BIGINT','exports','STRING','name'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xb465,0x9f));var _0x5b46=function(_0x1c273d,_0x42046e){_0x1c273d=_0x1c273d-0x0;var _0x3974cd=_0xb465[_0x1c273d];return _0x3974cd;};'use strict';var Sequelize=require('sequelize');module[_0x5b46('0x0')]={'name':{'type':Sequelize[_0x5b46('0x1')],'unique':_0x5b46('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x5b46('0x1')]},'display_name':{'type':Sequelize[_0x5b46('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0x5b46('0x1')]},'original_format':{'type':Sequelize[_0x5b46('0x1')]},'original_duration':{'type':Sequelize[_0x5b46('0x3')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0x5b46('0x4')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize[_0x5b46('0x3')]},'converted_sampleCount':{'type':Sequelize[_0x5b46('0x5')]},'converted_channelCount':{'type':Sequelize[_0x5b46('0x4')]},'converted_bitRate':{'type':Sequelize[_0x5b46('0x5')]},'converted_sampleRate':{'type':Sequelize[_0x5b46('0x4')]}}; \ No newline at end of file +var _0x045a=['sequelize','exports','STRING','FLOAT','BIGINT','INTEGER'];(function(_0x5ad220,_0x27407e){var _0xdec77d=function(_0x58d736){while(--_0x58d736){_0x5ad220['push'](_0x5ad220['shift']());}};_0xdec77d(++_0x27407e);}(_0x045a,0x19e));var _0xa045=function(_0x56b323,_0x2abd23){_0x56b323=_0x56b323-0x0;var _0x5a477c=_0x045a[_0x56b323];return _0x5a477c;};'use strict';var Sequelize=require(_0xa045('0x0'));module[_0xa045('0x1')]={'name':{'type':Sequelize[_0xa045('0x2')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0xa045('0x2')]},'original_format':{'type':Sequelize[_0xa045('0x2')]},'original_duration':{'type':Sequelize[_0xa045('0x3')]},'original_sampleCount':{'type':Sequelize[_0xa045('0x4')]},'original_channelCount':{'type':Sequelize[_0xa045('0x5')]},'original_bitRate':{'type':Sequelize[_0xa045('0x4')]},'original_sampleRate':{'type':Sequelize[_0xa045('0x5')]},'converted_format':{'type':Sequelize[_0xa045('0x2')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0xa045('0x4')]},'converted_channelCount':{'type':Sequelize[_0xa045('0x5')]},'converted_bitRate':{'type':Sequelize[_0xa045('0x4')]},'converted_sampleRate':{'type':Sequelize[_0xa045('0x5')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 02ad815..e3735c5 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 _0xe210=['error','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_sampleCount','converted_bitRate','converted_sampleRate','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','start','description','delete','server/files/sounds/original','original_format','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','count','set','Content-Range','reject','update','then','destroy','get','Sounds','UserProfileResource','end','name','send','index','map','Sound','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','options','where','include','findAll','rows','catch','show','params','includeAll','find','save_name','existsSync','join','root','server/files/sounds/converted','converted_format','Sequelize','ValidationError','download','%s.%s','format','create','extname','file','filename','originalname','substring','wav','basename','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode'];(function(_0x302aaf,_0x1ab784){var _0x2bedb9=function(_0x41773d){while(--_0x41773d){_0x302aaf['push'](_0x302aaf['shift']());}};_0x2bedb9(++_0x1ab784);}(_0xe210,0x196));var _0x0e21=function(_0x50aa2e,_0xfbd6f0){_0x50aa2e=_0x50aa2e-0x0;var _0x5e07f0=_0xe210[_0x50aa2e];return _0x5e07f0;};'use strict';var emlformat=require(_0x0e21('0x0'));var rimraf=require(_0x0e21('0x1'));var zipdir=require(_0x0e21('0x2'));var jsonpatch=require(_0x0e21('0x3'));var rp=require('request-promise');var moment=require(_0x0e21('0x4'));var BPromise=require(_0x0e21('0x5'));var Mustache=require(_0x0e21('0x6'));var util=require(_0x0e21('0x7'));var path=require(_0x0e21('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0e21('0x9'));var fs=require('fs');var fs_extra=require(_0x0e21('0xa'));var _=require(_0x0e21('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0e21('0xc'));var deskjs=require(_0x0e21('0xd'));var toCsv=require('to-csv');var querystring=require(_0x0e21('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0e21('0xf'));var qs=require(_0x0e21('0x10'));var as=require(_0x0e21('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0e21('0x12'))(_0x0e21('0x13'));var utils=require(_0x0e21('0x14'));var config=require(_0x0e21('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x0e21('0x16'))['db'];function respondWithStatusCode(_0xeb297f,_0x707dc){_0x707dc=_0x707dc||0xcc;return function(_0x498dd4){if(_0x498dd4){return _0xeb297f[_0x0e21('0x17')](_0x707dc);}return _0xeb297f[_0x0e21('0x18')](_0x707dc)['end']();};}function respondWithResult(_0x51938f,_0x26234a){_0x26234a=_0x26234a||0xc8;return function(_0x4f2847){if(_0x4f2847){return _0x51938f[_0x0e21('0x18')](_0x26234a)[_0x0e21('0x19')](_0x4f2847);}};}function respondWithFilteredResult(_0x12604e,_0x54d0d2){return function(_0x5c6a23){if(_0x5c6a23){var _0x1c5e77=typeof _0x54d0d2[_0x0e21('0x1a')]==='undefined'&&typeof _0x54d0d2[_0x0e21('0x1b')]==='undefined';var _0x248c50=_0x5c6a23[_0x0e21('0x1c')];var _0x23e4a8=_0x1c5e77?0x0:_0x54d0d2['offset'];var _0x286cf0=_0x1c5e77?_0x5c6a23['count']:_0x54d0d2['offset']+_0x54d0d2[_0x0e21('0x1b')];var _0x34954c;if(_0x286cf0>=_0x248c50){_0x286cf0=_0x248c50;_0x34954c=0xc8;}else{_0x34954c=0xce;}_0x12604e[_0x0e21('0x18')](_0x34954c);return _0x12604e[_0x0e21('0x1d')](_0x0e21('0x1e'),_0x23e4a8+'-'+_0x286cf0+'/'+_0x248c50)[_0x0e21('0x19')](_0x5c6a23);}return null;};}function patchUpdates(_0x51f01c){return function(_0x343c55){try{jsonpatch['apply'](_0x343c55,_0x51f01c,!![]);}catch(_0xeb1132){return BPromise[_0x0e21('0x1f')](_0xeb1132);}return _0x343c55['save']();};}function saveUpdates(_0x400127,_0x289445){return function(_0x5e5c19){if(_0x5e5c19){return _0x5e5c19[_0x0e21('0x20')](_0x400127)[_0x0e21('0x21')](function(_0x3c7960){return _0x3c7960;});}return null;};}function removeEntity(_0x17b20a,_0x345c28){return function(_0x3c315f){if(_0x3c315f){return _0x3c315f[_0x0e21('0x22')]()[_0x0e21('0x21')](function(){var _0x2cea09=_0x3c315f[_0x0e21('0x23')]({'plain':!![]});var _0x43b753=_0x0e21('0x24');return db[_0x0e21('0x25')][_0x0e21('0x22')]({'where':{'type':_0x43b753,'resourceId':_0x2cea09['id']}})['then'](function(){return _0x3c315f;});})['then'](function(){_0x17b20a['status'](0xcc)[_0x0e21('0x26')]();});}};}function handleEntityNotFound(_0x410cda,_0x44cb3f){return function(_0x574c14){if(!_0x574c14){_0x410cda[_0x0e21('0x17')](0x194);}return _0x574c14;};}function handleError(_0x26cbf3,_0x21226e){_0x21226e=_0x21226e||0x1f4;return function(_0x56451f){logger['error'](_0x56451f['stack']);if(_0x56451f[_0x0e21('0x27')]){delete _0x56451f['name'];}_0x26cbf3[_0x0e21('0x18')](_0x21226e)[_0x0e21('0x28')](_0x56451f);};}exports[_0x0e21('0x29')]=function(_0x57f328,_0x8437c5){var _0x13fc0b={},_0x897e0={},_0x5030b1={'count':0x0,'rows':[]};var _0x51eeb5=_[_0x0e21('0x2a')](db[_0x0e21('0x2b')][_0x0e21('0x2c')],function(_0x12eb0b){return{'name':_0x12eb0b[_0x0e21('0x2d')],'type':_0x12eb0b[_0x0e21('0x2e')][_0x0e21('0x2f')]};});_0x897e0[_0x0e21('0x30')]=_[_0x0e21('0x2a')](_0x51eeb5,_0x0e21('0x27'));_0x897e0[_0x0e21('0x31')]=_[_0x0e21('0x32')](_0x57f328['query']);_0x897e0['filters']=_[_0x0e21('0x33')](_0x897e0[_0x0e21('0x30')],_0x897e0[_0x0e21('0x31')]);_0x13fc0b[_0x0e21('0x34')]=_[_0x0e21('0x33')](_0x897e0['model'],qs[_0x0e21('0x35')](_0x57f328[_0x0e21('0x31')][_0x0e21('0x35')]));_0x13fc0b['attributes']=_0x13fc0b[_0x0e21('0x34')][_0x0e21('0x36')]?_0x13fc0b[_0x0e21('0x34')]:_0x897e0[_0x0e21('0x30')];if(!_0x57f328[_0x0e21('0x31')][_0x0e21('0x37')](_0x0e21('0x38'))){_0x13fc0b[_0x0e21('0x1b')]=qs['limit'](_0x57f328[_0x0e21('0x31')][_0x0e21('0x1b')]);_0x13fc0b[_0x0e21('0x1a')]=qs[_0x0e21('0x1a')](_0x57f328[_0x0e21('0x31')][_0x0e21('0x1a')]);}_0x13fc0b[_0x0e21('0x39')]=qs[_0x0e21('0x3a')](_0x57f328[_0x0e21('0x31')][_0x0e21('0x3a')]);_0x13fc0b['where']=qs[_0x0e21('0x3b')](_[_0x0e21('0x3c')](_0x57f328['query'],_0x897e0[_0x0e21('0x3b')]),_0x51eeb5);if(_0x57f328[_0x0e21('0x31')][_0x0e21('0x3d')]){_0x13fc0b['where']=_[_0x0e21('0x3e')](_0x13fc0b['where'],{'$or':_[_0x0e21('0x2a')](_0x51eeb5,function(_0x226a8c){if(_0x226a8c[_0x0e21('0x2e')]!=='VIRTUAL'){var _0x45c1dd={};_0x45c1dd[_0x226a8c[_0x0e21('0x27')]]={'$like':'%'+_0x57f328[_0x0e21('0x31')][_0x0e21('0x3d')]+'%'};return _0x45c1dd;}})});}_0x13fc0b=_['merge']({},_0x13fc0b,_0x57f328[_0x0e21('0x3f')]);var _0xa1e0bc={'where':_0x13fc0b[_0x0e21('0x40')]};return db[_0x0e21('0x2b')][_0x0e21('0x1c')](_0xa1e0bc)[_0x0e21('0x21')](function(_0x1116e3){_0x5030b1['count']=_0x1116e3;if(_0x57f328[_0x0e21('0x31')]['includeAll']){_0x13fc0b[_0x0e21('0x41')]=[{'all':!![]}];}return db[_0x0e21('0x2b')][_0x0e21('0x42')](_0x13fc0b);})[_0x0e21('0x21')](function(_0x5d06f8){_0x5030b1[_0x0e21('0x43')]=_0x5d06f8;return _0x5030b1;})[_0x0e21('0x21')](respondWithFilteredResult(_0x8437c5,_0x13fc0b))[_0x0e21('0x44')](handleError(_0x8437c5,null));};exports[_0x0e21('0x45')]=function(_0x2c937f,_0x2d672e){var _0x3b49ad={'raw':!![],'where':{'id':_0x2c937f[_0x0e21('0x46')]['id']}},_0x143ac0={};_0x143ac0[_0x0e21('0x30')]=_[_0x0e21('0x32')](db['Sound'][_0x0e21('0x2c')]);_0x143ac0[_0x0e21('0x31')]=_['keys'](_0x2c937f[_0x0e21('0x31')]);_0x143ac0[_0x0e21('0x3b')]=_['intersection'](_0x143ac0[_0x0e21('0x30')],_0x143ac0['query']);_0x3b49ad[_0x0e21('0x34')]=_[_0x0e21('0x33')](_0x143ac0[_0x0e21('0x30')],qs[_0x0e21('0x35')](_0x2c937f[_0x0e21('0x31')][_0x0e21('0x35')]));_0x3b49ad[_0x0e21('0x34')]=_0x3b49ad['attributes'][_0x0e21('0x36')]?_0x3b49ad[_0x0e21('0x34')]:_0x143ac0['model'];if(_0x2c937f[_0x0e21('0x31')][_0x0e21('0x47')]){_0x3b49ad['include']=[{'all':!![]}];}_0x3b49ad=_[_0x0e21('0x3e')]({},_0x3b49ad,_0x2c937f[_0x0e21('0x3f')]);return db[_0x0e21('0x2b')][_0x0e21('0x48')](_0x3b49ad)[_0x0e21('0x21')](handleEntityNotFound(_0x2d672e,null))[_0x0e21('0x21')](respondWithResult(_0x2d672e,null))[_0x0e21('0x44')](handleError(_0x2d672e,null));};exports['download']=function(_0x1ce2f3,_0xc25cda,_0x399a31){return db[_0x0e21('0x2b')]['find']({'where':{'id':_0x1ce2f3[_0x0e21('0x46')]['id']},'attributes':[_0x0e21('0x27'),_0x0e21('0x49'),'converted_format'],'raw':!![]})['then'](handleEntityNotFound(_0xc25cda,null))[_0x0e21('0x21')](function(_0x1ec2de){if(_0x1ec2de){if(!fs[_0x0e21('0x4a')](path[_0x0e21('0x4b')](config[_0x0e21('0x4c')],_0x0e21('0x4d'),_0x1ec2de[_0x0e21('0x49')]+'.'+_0x1ec2de[_0x0e21('0x4e')]))){throw new db[(_0x0e21('0x4f'))][(_0x0e21('0x50'))]('Sound\x20not\x20found');}return _0xc25cda[_0x0e21('0x51')](path[_0x0e21('0x4b')](config[_0x0e21('0x4c')],_0x0e21('0x4d'),util['format'](_0x0e21('0x52'),_0x1ec2de[_0x0e21('0x49')],_0x1ec2de['converted_format'])),util[_0x0e21('0x53')](_0x0e21('0x52'),_0x1ec2de[_0x0e21('0x27')],_0x1ec2de[_0x0e21('0x4e')]));}return null;})[_0x0e21('0x44')](handleError(_0xc25cda,null));};exports[_0x0e21('0x54')]=function(_0x414654,_0x13c160,_0x5dbbae){var _0xaee8c2={'name':path['basename'](_0x414654['file']['originalname'],path[_0x0e21('0x55')](_0x414654[_0x0e21('0x56')]['originalname'])),'save_name':path['basename'](_0x414654[_0x0e21('0x56')]['filename'],path['extname'](_0x414654[_0x0e21('0x56')][_0x0e21('0x57')])),'original_format':path[_0x0e21('0x55')](_0x414654[_0x0e21('0x56')][_0x0e21('0x58')])[_0x0e21('0x59')](0x1),'converted_format':_0x0e21('0x5a')};var _0x139f50=path[_0x0e21('0x4b')](config[_0x0e21('0x4c')],'server/files/sounds/original',_0x414654[_0x0e21('0x56')]['filename']);var _0x5c2761=path[_0x0e21('0x4b')](config[_0x0e21('0x4c')],_0x0e21('0x4d'),util[_0x0e21('0x53')](_0x0e21('0x52'),path[_0x0e21('0x5b')](_0x414654['file'][_0x0e21('0x57')],path[_0x0e21('0x55')](_0x414654['file'][_0x0e21('0x57')])),_0xaee8c2['converted_format']));logger[_0x0e21('0x5c')](_0x0e21('0x5d'),_0x139f50);logger[_0x0e21('0x5c')](_0x0e21('0x5e'),_0x5c2761);try{fs[_0x0e21('0x5f')](_0x139f50,parseInt(_0x0e21('0x60'),0x8));var _0x4572d7=sox[_0x0e21('0x61')](_0x139f50,_0x5c2761,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4572d7['on'](_0x0e21('0x62'),function(_0x8643a6){fs['unlinkSync'](_0x139f50);_0x13c160[_0x0e21('0x18')](0x1f4)['send'](_0x8643a6);});_0x4572d7['on'](_0x0e21('0x63'),function(_0x5df254){_0xaee8c2[_0x0e21('0x64')]=isNaN(_0x5df254[_0x0e21('0x65')])?null:_0x5df254[_0x0e21('0x65')]*0x3e8;_0xaee8c2[_0x0e21('0x66')]=isNaN(_0x5df254[_0x0e21('0x67')])?null:_0x5df254[_0x0e21('0x67')];_0xaee8c2[_0x0e21('0x68')]=isNaN(_0x5df254[_0x0e21('0x69')])?null:_0x5df254[_0x0e21('0x69')];_0xaee8c2[_0x0e21('0x6a')]=isNaN(_0x5df254[_0x0e21('0x6b')])?null:_0x5df254[_0x0e21('0x6b')];_0xaee8c2[_0x0e21('0x6c')]=isNaN(_0x5df254[_0x0e21('0x6d')])?null:_0x5df254[_0x0e21('0x6d')];});_0x4572d7['on'](_0x0e21('0x6e'),function(_0x201f0a){_0xaee8c2['converted_duration']=isNaN(_0x201f0a[_0x0e21('0x65')])?null:_0x201f0a['duration']*0x3e8;_0xaee8c2[_0x0e21('0x6f')]=isNaN(_0x201f0a[_0x0e21('0x67')])?null:_0x201f0a['sampleCount'];_0xaee8c2['converted_channelCount']=isNaN(_0x201f0a[_0x0e21('0x69')])?null:_0x201f0a['channelCount'];_0xaee8c2[_0x0e21('0x70')]=isNaN(_0x201f0a[_0x0e21('0x6b')])?null:_0x201f0a['bitRate'];_0xaee8c2[_0x0e21('0x71')]=isNaN(_0x201f0a['sampleRate'])?null:_0x201f0a[_0x0e21('0x6d')];});_0x4572d7['on'](_0x0e21('0x26'),function(){fs['chmodSync'](_0x5c2761,parseInt(_0x0e21('0x60'),0x8));return db['Sound'][_0x0e21('0x54')](_0xaee8c2)[_0x0e21('0x21')](function(_0x514032){var _0x18b47f={'role':_0x414654[_0x0e21('0x72')][_0x0e21('0x73')],'userProfileId':_0x414654[_0x0e21('0x72')][_0x0e21('0x74')]};if(!_0x18b47f)throw new Error(_0x0e21('0x75'));if(_0x18b47f[_0x0e21('0x73')]==='user'){var _0x57009e=_0x514032['get']({'plain':!![]});return db[_0x0e21('0x76')][_0x0e21('0x48')]({'where':{'name':_0x0e21('0x24'),'userProfileId':_0x18b47f[_0x0e21('0x74')]},'raw':!![]})['then'](function(_0x2fb7a6){if(_0x2fb7a6&&_0x2fb7a6[_0x0e21('0x77')]===0x0){return db[_0x0e21('0x25')][_0x0e21('0x54')]({'name':_0x57009e[_0x0e21('0x27')],'resourceId':_0x57009e['id'],'type':_0x2fb7a6['name'],'sectionId':_0x2fb7a6['id']},{})[_0x0e21('0x21')](function(){return _0x514032;});}else{return _0x514032;}})['catch'](function(_0x361ebe){logger[_0x0e21('0x62')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x361ebe);throw _0x361ebe;});}return _0x514032;})['then'](respondWithResult(_0x13c160,null))[_0x0e21('0x44')](handleError(_0x13c160,null));});_0x4572d7[_0x0e21('0x78')]();}catch(_0x443e8b){_0x13c160['status'](0x1f4)[_0x0e21('0x28')](_0x443e8b);}};exports[_0x0e21('0x20')]=function(_0x11a8b3,_0x2bfe21,_0x51f74e){return db['Sound'][_0x0e21('0x48')]({'where':{'id':_0x11a8b3[_0x0e21('0x46')]['id']}})[_0x0e21('0x21')](handleEntityNotFound(_0x2bfe21,null))['then'](saveUpdates(_[_0x0e21('0x3c')](_0x11a8b3['body'],[_0x0e21('0x27'),_0x0e21('0x79')]),null))[_0x0e21('0x21')](respondWithResult(_0x2bfe21,null))[_0x0e21('0x44')](handleError(_0x2bfe21,null));};exports[_0x0e21('0x7a')]=function(_0x546f1b,_0x1ca4d7,_0x118c8){return db['Sound']['find']({'where':{'id':_0x546f1b[_0x0e21('0x46')]['id']}})[_0x0e21('0x21')](function(_0x443699){if(_0x443699){return _0x443699['destroy']();}})[_0x0e21('0x21')](function(_0x44cfc9){var _0x50dd9f=path[_0x0e21('0x4b')](config[_0x0e21('0x4c')],_0x0e21('0x7b'),util[_0x0e21('0x53')](_0x0e21('0x52'),_0x44cfc9[_0x0e21('0x49')],_0x44cfc9[_0x0e21('0x7c')]));var _0x213d48=path['join'](config[_0x0e21('0x4c')],_0x0e21('0x4d'),util[_0x0e21('0x53')](_0x0e21('0x52'),_0x44cfc9['save_name'],_0x44cfc9[_0x0e21('0x4e')]));fs['unlinkSync'](_0x50dd9f);fs[_0x0e21('0x7d')](_0x213d48);return _0x44cfc9;})[_0x0e21('0x21')](function(_0x27d7b0){if(_0x27d7b0){return _0x1ca4d7['status'](0xcc)[_0x0e21('0x26')]();}})['then'](handleEntityNotFound(_0x1ca4d7,null))[_0x0e21('0x44')](handleError(_0x1ca4d7,null));}; \ No newline at end of file +var _0x7346=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','pick','description','delete','original_format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','get','Sounds','UserProfileResource','end','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','length','attributes','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','Sound','includeAll','include','findAll','rows','catch','params','keys','fields','find','download','converted_format','root','server/files/sounds/converted','save_name','Sequelize','ValidationError','join','format','%s.%s','create','basename','file','originalname','filename','extname','wav','server/files/sounds/original','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','error','unlinkSync','send','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation'];(function(_0x49c057,_0xc808ed){var _0xd8f0e6=function(_0x5b9042){while(--_0x5b9042){_0x49c057['push'](_0x49c057['shift']());}};_0xd8f0e6(++_0xc808ed);}(_0x7346,0x84));var _0x6734=function(_0x5dd928,_0x3316a7){_0x5dd928=_0x5dd928-0x0;var _0x599f53=_0x7346[_0x5dd928];return _0x599f53;};'use strict';var emlformat=require(_0x6734('0x0'));var rimraf=require(_0x6734('0x1'));var zipdir=require(_0x6734('0x2'));var jsonpatch=require(_0x6734('0x3'));var rp=require(_0x6734('0x4'));var moment=require(_0x6734('0x5'));var BPromise=require(_0x6734('0x6'));var Mustache=require(_0x6734('0x7'));var util=require(_0x6734('0x8'));var path=require('path');var sox=require(_0x6734('0x9'));var csv=require(_0x6734('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6734('0xb'));var _=require(_0x6734('0xc'));var squel=require(_0x6734('0xd'));var crypto=require('crypto');var jsforce=require(_0x6734('0xe'));var deskjs=require(_0x6734('0xf'));var toCsv=require(_0x6734('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6734('0x10'));var authService=require(_0x6734('0x11'));var qs=require(_0x6734('0x12'));var as=require(_0x6734('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6734('0x14'))('api');var utils=require(_0x6734('0x15'));var config=require(_0x6734('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x6734('0x17'))['db'];function respondWithStatusCode(_0x48835e,_0xb60a68){_0xb60a68=_0xb60a68||0xcc;return function(_0x28ada6){if(_0x28ada6){return _0x48835e[_0x6734('0x18')](_0xb60a68);}return _0x48835e[_0x6734('0x19')](_0xb60a68)['end']();};}function respondWithResult(_0x2f332f,_0x31be0e){_0x31be0e=_0x31be0e||0xc8;return function(_0x597893){if(_0x597893){return _0x2f332f[_0x6734('0x19')](_0x31be0e)[_0x6734('0x1a')](_0x597893);}};}function respondWithFilteredResult(_0x557a14,_0x9c97fd){return function(_0xdc8b96){if(_0xdc8b96){var _0x5d1555=typeof _0x9c97fd[_0x6734('0x1b')]===_0x6734('0x1c')&&typeof _0x9c97fd[_0x6734('0x1d')]==='undefined';var _0x32b25f=_0xdc8b96[_0x6734('0x1e')];var _0x3dd236=_0x5d1555?0x0:_0x9c97fd['offset'];var _0x10ce9d=_0x5d1555?_0xdc8b96[_0x6734('0x1e')]:_0x9c97fd[_0x6734('0x1b')]+_0x9c97fd[_0x6734('0x1d')];var _0x5021fc;if(_0x10ce9d>=_0x32b25f){_0x10ce9d=_0x32b25f;_0x5021fc=0xc8;}else{_0x5021fc=0xce;}_0x557a14[_0x6734('0x19')](_0x5021fc);return _0x557a14[_0x6734('0x1f')](_0x6734('0x20'),_0x3dd236+'-'+_0x10ce9d+'/'+_0x32b25f)[_0x6734('0x1a')](_0xdc8b96);}return null;};}function patchUpdates(_0x571da3){return function(_0x32599e){try{jsonpatch[_0x6734('0x21')](_0x32599e,_0x571da3,!![]);}catch(_0x4054aa){return BPromise['reject'](_0x4054aa);}return _0x32599e['save']();};}function saveUpdates(_0x9ef362,_0x471fd8){return function(_0x20d8bc){if(_0x20d8bc){return _0x20d8bc[_0x6734('0x22')](_0x9ef362)[_0x6734('0x23')](function(_0x19837e){return _0x19837e;});}return null;};}function removeEntity(_0x426e1b,_0x234486){return function(_0x52bf6f){if(_0x52bf6f){return _0x52bf6f[_0x6734('0x24')]()['then'](function(){var _0x5612a1=_0x52bf6f[_0x6734('0x25')]({'plain':!![]});var _0x322c4d=_0x6734('0x26');return db[_0x6734('0x27')][_0x6734('0x24')]({'where':{'type':_0x322c4d,'resourceId':_0x5612a1['id']}})[_0x6734('0x23')](function(){return _0x52bf6f;});})[_0x6734('0x23')](function(){_0x426e1b['status'](0xcc)[_0x6734('0x28')]();});}};}function handleEntityNotFound(_0x4b71b5,_0x459d76){return function(_0x3f74f2){if(!_0x3f74f2){_0x4b71b5['sendStatus'](0x194);}return _0x3f74f2;};}function handleError(_0x50f8a2,_0xd2f06d){_0xd2f06d=_0xd2f06d||0x1f4;return function(_0x276f8a){logger['error'](_0x276f8a[_0x6734('0x29')]);if(_0x276f8a[_0x6734('0x2a')]){delete _0x276f8a[_0x6734('0x2a')];}_0x50f8a2[_0x6734('0x19')](_0xd2f06d)['send'](_0x276f8a);};}exports[_0x6734('0x2b')]=function(_0x2dc945,_0x52a199){var _0x341ad6={},_0x2d72f3={},_0x3bce17={'count':0x0,'rows':[]};var _0x860c9d=_[_0x6734('0x2c')](db['Sound'][_0x6734('0x2d')],function(_0x45db27){return{'name':_0x45db27[_0x6734('0x2e')],'type':_0x45db27[_0x6734('0x2f')][_0x6734('0x30')]};});_0x2d72f3[_0x6734('0x31')]=_[_0x6734('0x2c')](_0x860c9d,_0x6734('0x2a'));_0x2d72f3['query']=_['keys'](_0x2dc945[_0x6734('0x32')]);_0x2d72f3[_0x6734('0x33')]=_['intersection'](_0x2d72f3[_0x6734('0x31')],_0x2d72f3[_0x6734('0x32')]);_0x341ad6['attributes']=_[_0x6734('0x34')](_0x2d72f3[_0x6734('0x31')],qs['fields'](_0x2dc945[_0x6734('0x32')]['fields']));_0x341ad6['attributes']=_0x341ad6['attributes'][_0x6734('0x35')]?_0x341ad6[_0x6734('0x36')]:_0x2d72f3[_0x6734('0x31')];if(!_0x2dc945[_0x6734('0x32')][_0x6734('0x37')](_0x6734('0x38'))){_0x341ad6[_0x6734('0x1d')]=qs[_0x6734('0x1d')](_0x2dc945['query']['limit']);_0x341ad6['offset']=qs['offset'](_0x2dc945['query']['offset']);}_0x341ad6[_0x6734('0x39')]=qs[_0x6734('0x3a')](_0x2dc945[_0x6734('0x32')][_0x6734('0x3a')]);_0x341ad6[_0x6734('0x3b')]=qs[_0x6734('0x33')](_['pick'](_0x2dc945[_0x6734('0x32')],_0x2d72f3['filters']),_0x860c9d);if(_0x2dc945[_0x6734('0x32')][_0x6734('0x3c')]){_0x341ad6[_0x6734('0x3b')]=_['merge'](_0x341ad6[_0x6734('0x3b')],{'$or':_['map'](_0x860c9d,function(_0x5f5402){if(_0x5f5402[_0x6734('0x2f')]!==_0x6734('0x3d')){var _0x569b2b={};_0x569b2b[_0x5f5402[_0x6734('0x2a')]]={'$like':'%'+_0x2dc945['query'][_0x6734('0x3c')]+'%'};return _0x569b2b;}})});}_0x341ad6=_[_0x6734('0x3e')]({},_0x341ad6,_0x2dc945[_0x6734('0x3f')]);var _0x350beb={'where':_0x341ad6[_0x6734('0x3b')]};return db[_0x6734('0x40')][_0x6734('0x1e')](_0x350beb)[_0x6734('0x23')](function(_0x111c4c){_0x3bce17[_0x6734('0x1e')]=_0x111c4c;if(_0x2dc945[_0x6734('0x32')][_0x6734('0x41')]){_0x341ad6[_0x6734('0x42')]=[{'all':!![]}];}return db[_0x6734('0x40')][_0x6734('0x43')](_0x341ad6);})['then'](function(_0x26cf42){_0x3bce17[_0x6734('0x44')]=_0x26cf42;return _0x3bce17;})[_0x6734('0x23')](respondWithFilteredResult(_0x52a199,_0x341ad6))[_0x6734('0x45')](handleError(_0x52a199,null));};exports['show']=function(_0xfc37cc,_0x4f495a){var _0x297eb9={'raw':!![],'where':{'id':_0xfc37cc[_0x6734('0x46')]['id']}},_0x510fdb={};_0x510fdb[_0x6734('0x31')]=_[_0x6734('0x47')](db[_0x6734('0x40')][_0x6734('0x2d')]);_0x510fdb[_0x6734('0x32')]=_[_0x6734('0x47')](_0xfc37cc[_0x6734('0x32')]);_0x510fdb[_0x6734('0x33')]=_[_0x6734('0x34')](_0x510fdb[_0x6734('0x31')],_0x510fdb[_0x6734('0x32')]);_0x297eb9[_0x6734('0x36')]=_[_0x6734('0x34')](_0x510fdb[_0x6734('0x31')],qs[_0x6734('0x48')](_0xfc37cc[_0x6734('0x32')][_0x6734('0x48')]));_0x297eb9['attributes']=_0x297eb9[_0x6734('0x36')][_0x6734('0x35')]?_0x297eb9['attributes']:_0x510fdb[_0x6734('0x31')];if(_0xfc37cc[_0x6734('0x32')]['includeAll']){_0x297eb9['include']=[{'all':!![]}];}_0x297eb9=_['merge']({},_0x297eb9,_0xfc37cc[_0x6734('0x3f')]);return db[_0x6734('0x40')][_0x6734('0x49')](_0x297eb9)[_0x6734('0x23')](handleEntityNotFound(_0x4f495a,null))[_0x6734('0x23')](respondWithResult(_0x4f495a,null))[_0x6734('0x45')](handleError(_0x4f495a,null));};exports[_0x6734('0x4a')]=function(_0x12a200,_0x4b958,_0x34f913){return db[_0x6734('0x40')][_0x6734('0x49')]({'where':{'id':_0x12a200[_0x6734('0x46')]['id']},'attributes':[_0x6734('0x2a'),'save_name',_0x6734('0x4b')],'raw':!![]})[_0x6734('0x23')](handleEntityNotFound(_0x4b958,null))['then'](function(_0x4314eb){if(_0x4314eb){if(!fs['existsSync'](path['join'](config[_0x6734('0x4c')],_0x6734('0x4d'),_0x4314eb[_0x6734('0x4e')]+'.'+_0x4314eb[_0x6734('0x4b')]))){throw new db[(_0x6734('0x4f'))][(_0x6734('0x50'))]('Sound\x20not\x20found');}return _0x4b958[_0x6734('0x4a')](path[_0x6734('0x51')](config[_0x6734('0x4c')],_0x6734('0x4d'),util[_0x6734('0x52')]('%s.%s',_0x4314eb[_0x6734('0x4e')],_0x4314eb['converted_format'])),util[_0x6734('0x52')](_0x6734('0x53'),_0x4314eb[_0x6734('0x2a')],_0x4314eb[_0x6734('0x4b')]));}return null;})[_0x6734('0x45')](handleError(_0x4b958,null));};exports[_0x6734('0x54')]=function(_0x4146ab,_0x346a92,_0x109c66){var _0x39ee84={'name':path[_0x6734('0x55')](_0x4146ab[_0x6734('0x56')][_0x6734('0x57')],path['extname'](_0x4146ab['file'][_0x6734('0x57')])),'save_name':path[_0x6734('0x55')](_0x4146ab['file']['filename'],path['extname'](_0x4146ab[_0x6734('0x56')][_0x6734('0x58')])),'original_format':path[_0x6734('0x59')](_0x4146ab[_0x6734('0x56')][_0x6734('0x57')])['substring'](0x1),'converted_format':_0x6734('0x5a')};var _0x3f9bda=path[_0x6734('0x51')](config[_0x6734('0x4c')],_0x6734('0x5b'),_0x4146ab[_0x6734('0x56')][_0x6734('0x58')]);var _0x4449eb=path[_0x6734('0x51')](config[_0x6734('0x4c')],_0x6734('0x4d'),util[_0x6734('0x52')](_0x6734('0x53'),path[_0x6734('0x55')](_0x4146ab[_0x6734('0x56')][_0x6734('0x58')],path['extname'](_0x4146ab[_0x6734('0x56')][_0x6734('0x58')])),_0x39ee84[_0x6734('0x4b')]));logger[_0x6734('0x5c')]('Sound\x20upload\x20filepath:\x20%s',_0x3f9bda);logger[_0x6734('0x5c')](_0x6734('0x5d'),_0x4449eb);try{fs[_0x6734('0x5e')](_0x3f9bda,parseInt(_0x6734('0x5f'),0x8));var _0x442e52=sox[_0x6734('0x60')](_0x3f9bda,_0x4449eb,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x442e52['on'](_0x6734('0x61'),function(_0x3e544a){fs[_0x6734('0x62')](_0x3f9bda);_0x346a92['status'](0x1f4)[_0x6734('0x63')](_0x3e544a);});_0x442e52['on'](_0x6734('0x64'),function(_0x1969de){_0x39ee84[_0x6734('0x65')]=isNaN(_0x1969de['duration'])?null:_0x1969de[_0x6734('0x66')]*0x3e8;_0x39ee84[_0x6734('0x67')]=isNaN(_0x1969de[_0x6734('0x68')])?null:_0x1969de[_0x6734('0x68')];_0x39ee84[_0x6734('0x69')]=isNaN(_0x1969de['channelCount'])?null:_0x1969de[_0x6734('0x6a')];_0x39ee84[_0x6734('0x6b')]=isNaN(_0x1969de[_0x6734('0x6c')])?null:_0x1969de[_0x6734('0x6c')];_0x39ee84[_0x6734('0x6d')]=isNaN(_0x1969de['sampleRate'])?null:_0x1969de[_0x6734('0x6e')];});_0x442e52['on']('dest',function(_0x4e7ea4){_0x39ee84[_0x6734('0x6f')]=isNaN(_0x4e7ea4['duration'])?null:_0x4e7ea4[_0x6734('0x66')]*0x3e8;_0x39ee84[_0x6734('0x70')]=isNaN(_0x4e7ea4['sampleCount'])?null:_0x4e7ea4[_0x6734('0x68')];_0x39ee84[_0x6734('0x71')]=isNaN(_0x4e7ea4[_0x6734('0x6a')])?null:_0x4e7ea4['channelCount'];_0x39ee84[_0x6734('0x72')]=isNaN(_0x4e7ea4[_0x6734('0x6c')])?null:_0x4e7ea4[_0x6734('0x6c')];_0x39ee84[_0x6734('0x73')]=isNaN(_0x4e7ea4[_0x6734('0x6e')])?null:_0x4e7ea4[_0x6734('0x6e')];});_0x442e52['on'](_0x6734('0x28'),function(){fs[_0x6734('0x5e')](_0x4449eb,parseInt('0777',0x8));return db[_0x6734('0x40')][_0x6734('0x54')](_0x39ee84)[_0x6734('0x23')](function(_0x1fdaea){var _0x7fc754={'role':_0x4146ab[_0x6734('0x74')][_0x6734('0x75')],'userProfileId':_0x4146ab['body']['userProfileId']};if(!_0x7fc754)throw new Error(_0x6734('0x76'));if(_0x7fc754[_0x6734('0x75')]===_0x6734('0x77')){var _0x529914=_0x1fdaea[_0x6734('0x25')]({'plain':!![]});return db['UserProfileSection'][_0x6734('0x49')]({'where':{'name':_0x6734('0x26'),'userProfileId':_0x7fc754[_0x6734('0x78')]},'raw':!![]})[_0x6734('0x23')](function(_0x323d5d){if(_0x323d5d&&_0x323d5d[_0x6734('0x79')]===0x0){return db['UserProfileResource'][_0x6734('0x54')]({'name':_0x529914[_0x6734('0x2a')],'resourceId':_0x529914['id'],'type':_0x323d5d[_0x6734('0x2a')],'sectionId':_0x323d5d['id']},{})[_0x6734('0x23')](function(){return _0x1fdaea;});}else{return _0x1fdaea;}})[_0x6734('0x45')](function(_0x11d5d6){logger[_0x6734('0x61')](_0x6734('0x7a'),_0x11d5d6);throw _0x11d5d6;});}return _0x1fdaea;})['then'](respondWithResult(_0x346a92,null))['catch'](handleError(_0x346a92,null));});_0x442e52['start']();}catch(_0x1b25cd){_0x346a92[_0x6734('0x19')](0x1f4)[_0x6734('0x63')](_0x1b25cd);}};exports['update']=function(_0x3b3207,_0x18583b,_0x5f4dbd){return db[_0x6734('0x40')][_0x6734('0x49')]({'where':{'id':_0x3b3207[_0x6734('0x46')]['id']}})[_0x6734('0x23')](handleEntityNotFound(_0x18583b,null))[_0x6734('0x23')](saveUpdates(_[_0x6734('0x7b')](_0x3b3207[_0x6734('0x74')],[_0x6734('0x2a'),_0x6734('0x7c')]),null))['then'](respondWithResult(_0x18583b,null))[_0x6734('0x45')](handleError(_0x18583b,null));};exports[_0x6734('0x7d')]=function(_0x4c4afe,_0x26f589,_0x537cd5){return db[_0x6734('0x40')]['find']({'where':{'id':_0x4c4afe[_0x6734('0x46')]['id']}})[_0x6734('0x23')](function(_0x342743){if(_0x342743){return _0x342743[_0x6734('0x24')]();}})[_0x6734('0x23')](function(_0x357fec){var _0x210e95=path[_0x6734('0x51')](config[_0x6734('0x4c')],'server/files/sounds/original',util[_0x6734('0x52')]('%s.%s',_0x357fec['save_name'],_0x357fec[_0x6734('0x7e')]));var _0x406df4=path[_0x6734('0x51')](config['root'],_0x6734('0x4d'),util[_0x6734('0x52')](_0x6734('0x53'),_0x357fec[_0x6734('0x4e')],_0x357fec['converted_format']));fs[_0x6734('0x62')](_0x210e95);fs[_0x6734('0x62')](_0x406df4);return _0x357fec;})[_0x6734('0x23')](function(_0x3837e1){if(_0x3837e1){return _0x26f589[_0x6734('0x19')](0xcc)[_0x6734('0x28')]();}})['then'](handleEntityNotFound(_0x26f589,null))[_0x6734('0x45')](handleError(_0x26f589,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index d1bf564..e19a0ba 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 _0x6779=['util','../../config/logger','bluebird','path','rimraf','../../config/environment','./sound.attributes','exports','define','lodash'];(function(_0x29d850,_0x128fca){var _0x123065=function(_0x519f86){while(--_0x519f86){_0x29d850['push'](_0x29d850['shift']());}};_0x123065(++_0x128fca);}(_0x6779,0x77));var _0x9677=function(_0x1fbca0,_0x506b2d){_0x1fbca0=_0x1fbca0-0x0;var _0x1ddfdf=_0x6779[_0x1fbca0];return _0x1ddfdf;};'use strict';var _=require(_0x9677('0x0'));var util=require(_0x9677('0x1'));var logger=require(_0x9677('0x2'))('api');var moment=require('moment');var BPromise=require(_0x9677('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9677('0x4'));var rimraf=require(_0x9677('0x5'));var config=require(_0x9677('0x6'));var attributes=require(_0x9677('0x7'));module[_0x9677('0x8')]=function(_0x3c4b45,_0x4d6b01){return _0x3c4b45[_0x9677('0x9')]('Sound',attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x238c=['Sound','tools_sounds','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./sound.attributes','define'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x238c,0x86));var _0xc238=function(_0x236f12,_0x4c7faf){_0x236f12=_0x236f12-0x0;var _0x32969a=_0x238c[_0x236f12];return _0x32969a;};'use strict';var _=require(_0xc238('0x0'));var util=require(_0xc238('0x1'));var logger=require('../../config/logger')(_0xc238('0x2'));var moment=require(_0xc238('0x3'));var BPromise=require(_0xc238('0x4'));var rp=require(_0xc238('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc238('0x6'));var config=require(_0xc238('0x7'));var attributes=require(_0xc238('0x8'));module['exports']=function(_0x1831e3,_0x440c7c){return _0x1831e3[_0xc238('0x9')](_0xc238('0xa'),attributes,{'tableName':_0xc238('0xb'),'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 a728fa2..d6705ee 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 _0xf662=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowSound','Sound','find','options','raw','attributes','include','map','model','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf662,0x170));var _0x2f66=function(_0x4599b6,_0x40c254){_0x4599b6=_0x4599b6-0x0;var _0x2e014c=_0xf662[_0x4599b6];return _0x2e014c;};'use strict';var _=require(_0x2f66('0x0'));var util=require(_0x2f66('0x1'));var moment=require(_0x2f66('0x2'));var BPromise=require('bluebird');var rs=require(_0x2f66('0x3'));var fs=require('fs');var Redis=require(_0x2f66('0x4'));var db=require(_0x2f66('0x5'))['db'];var utils=require(_0x2f66('0x6'));var logger=require(_0x2f66('0x7'))(_0x2f66('0x8'));var config=require(_0x2f66('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2f66('0xa')][_0x2f66('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x46407d,_0x19332e,_0x1a08f8){return new BPromise(function(_0x567a42,_0x249ebc){return client[_0x2f66('0xc')](_0x46407d,_0x1a08f8)[_0x2f66('0xd')](function(_0x5f7289){logger[_0x2f66('0xe')](_0x2f66('0xf'),_0x19332e,_0x2f66('0x10'));logger[_0x2f66('0x11')](_0x2f66('0x12'),_0x19332e,_0x2f66('0x10'),JSON['stringify'](_0x5f7289));if(_0x5f7289[_0x2f66('0x13')]){if(_0x5f7289[_0x2f66('0x13')][_0x2f66('0x14')]===0x1f4){logger[_0x2f66('0x13')](_0x2f66('0xf'),_0x19332e,_0x5f7289[_0x2f66('0x13')][_0x2f66('0x15')]);return _0x249ebc(_0x5f7289[_0x2f66('0x13')][_0x2f66('0x15')]);}logger[_0x2f66('0x13')](_0x2f66('0xf'),_0x19332e,_0x5f7289[_0x2f66('0x13')][_0x2f66('0x15')]);return _0x567a42(_0x5f7289[_0x2f66('0x13')][_0x2f66('0x15')]);}else{logger[_0x2f66('0xe')](_0x2f66('0xf'),_0x19332e,_0x2f66('0x10'));_0x567a42(_0x5f7289[_0x2f66('0x16')][_0x2f66('0x15')]);}})[_0x2f66('0x17')](function(_0x3328b2){logger[_0x2f66('0x13')]('Sound,\x20%s,\x20%s',_0x19332e,_0x3328b2);_0x249ebc(_0x3328b2);});});}exports[_0x2f66('0x18')]=function(_0x1429be){var _0x59c149=this;return new Promise(function(_0x389498,_0x47fa92){return db[_0x2f66('0x19')][_0x2f66('0x1a')]({'raw':_0x1429be[_0x2f66('0x1b')]?_0x1429be[_0x2f66('0x1b')][_0x2f66('0x1c')]===undefined?!![]:![]:!![],'where':_0x1429be[_0x2f66('0x1b')]?_0x1429be['options']['where']||null:null,'attributes':_0x1429be[_0x2f66('0x1b')]?_0x1429be[_0x2f66('0x1b')][_0x2f66('0x1d')]||null:null,'include':_0x1429be[_0x2f66('0x1b')]?_0x1429be[_0x2f66('0x1b')][_0x2f66('0x1e')]?_[_0x2f66('0x1f')](_0x1429be[_0x2f66('0x1b')]['include'],function(_0xe07892){return{'model':db[_0xe07892['model']],'as':_0xe07892['as'],'attributes':_0xe07892[_0x2f66('0x1d')],'include':_0xe07892[_0x2f66('0x1e')]?_[_0x2f66('0x1f')](_0xe07892['include'],function(_0x46ff9b){return{'model':db[_0x46ff9b[_0x2f66('0x20')]],'as':_0x46ff9b['as'],'attributes':_0x46ff9b[_0x2f66('0x1d')],'include':_0x46ff9b[_0x2f66('0x1e')]?_['map'](_0x46ff9b[_0x2f66('0x1e')],function(_0x116039){return{'model':db[_0x116039[_0x2f66('0x20')]],'as':_0x116039['as'],'attributes':_0x116039[_0x2f66('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x2f66('0xd')](function(_0x36a237){logger[_0x2f66('0xe')](_0x2f66('0x18'),_0x1429be);logger['debug'](_0x2f66('0x18'),_0x1429be,JSON[_0x2f66('0x21')](_0x36a237));_0x389498(_0x36a237);})[_0x2f66('0x17')](function(_0x24bcf8){logger[_0x2f66('0x13')](_0x2f66('0x18'),_0x24bcf8[_0x2f66('0x15')],_0x1429be);_0x47fa92(_0x59c149[_0x2f66('0x13')](0x1f4,_0x24bcf8[_0x2f66('0x15')]));});});}; \ No newline at end of file +var _0xb050=['error','code','Sound,\x20%s,\x20%s','message','info','result','catch','ShowSound','Sound','find','options','raw','attributes','map','include','model','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','debug','Sound,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x16552c,_0x35c4d6){var _0x241ba5=function(_0x26e5ad){while(--_0x26e5ad){_0x16552c['push'](_0x16552c['shift']());}};_0x241ba5(++_0x35c4d6);}(_0xb050,0x1d0));var _0x0b05=function(_0x3fd0ab,_0x5af156){_0x3fd0ab=_0x3fd0ab-0x0;var _0xa278a5=_0xb050[_0x3fd0ab];return _0xa278a5;};'use strict';var _=require(_0x0b05('0x0'));var util=require(_0x0b05('0x1'));var moment=require('moment');var BPromise=require(_0x0b05('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0b05('0x3'));var db=require(_0x0b05('0x4'))['db'];var utils=require(_0x0b05('0x5'));var logger=require(_0x0b05('0x6'))(_0x0b05('0x7'));var config=require('../../config/environment');var jayson=require(_0x0b05('0x8'));var client=jayson['client'][_0x0b05('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2a1280,_0x2191d6,_0xceedd6){return new BPromise(function(_0x3c1e05,_0x42414f){return client[_0x0b05('0xa')](_0x2a1280,_0xceedd6)[_0x0b05('0xb')](function(_0x3c4ac6){logger['info']('Sound,\x20%s,\x20%s',_0x2191d6,'request\x20sent');logger[_0x0b05('0xc')](_0x0b05('0xd'),_0x2191d6,_0x0b05('0xe'),JSON[_0x0b05('0xf')](_0x3c4ac6));if(_0x3c4ac6['error']){if(_0x3c4ac6[_0x0b05('0x10')][_0x0b05('0x11')]===0x1f4){logger['error'](_0x0b05('0x12'),_0x2191d6,_0x3c4ac6['error'][_0x0b05('0x13')]);return _0x42414f(_0x3c4ac6[_0x0b05('0x10')][_0x0b05('0x13')]);}logger['error'](_0x0b05('0x12'),_0x2191d6,_0x3c4ac6[_0x0b05('0x10')][_0x0b05('0x13')]);return _0x3c1e05(_0x3c4ac6['error']['message']);}else{logger[_0x0b05('0x14')]('Sound,\x20%s,\x20%s',_0x2191d6,_0x0b05('0xe'));_0x3c1e05(_0x3c4ac6[_0x0b05('0x15')][_0x0b05('0x13')]);}})[_0x0b05('0x16')](function(_0xf2a511){logger[_0x0b05('0x10')](_0x0b05('0x12'),_0x2191d6,_0xf2a511);_0x42414f(_0xf2a511);});});}exports[_0x0b05('0x17')]=function(_0xb5eba9){var _0x51f91c=this;return new Promise(function(_0x7ba397,_0xb5ca14){return db[_0x0b05('0x18')][_0x0b05('0x19')]({'raw':_0xb5eba9[_0x0b05('0x1a')]?_0xb5eba9[_0x0b05('0x1a')][_0x0b05('0x1b')]===undefined?!![]:![]:!![],'where':_0xb5eba9[_0x0b05('0x1a')]?_0xb5eba9[_0x0b05('0x1a')]['where']||null:null,'attributes':_0xb5eba9[_0x0b05('0x1a')]?_0xb5eba9['options'][_0x0b05('0x1c')]||null:null,'include':_0xb5eba9['options']?_0xb5eba9['options']['include']?_[_0x0b05('0x1d')](_0xb5eba9[_0x0b05('0x1a')][_0x0b05('0x1e')],function(_0x1dbbce){return{'model':db[_0x1dbbce[_0x0b05('0x1f')]],'as':_0x1dbbce['as'],'attributes':_0x1dbbce['attributes'],'include':_0x1dbbce[_0x0b05('0x1e')]?_['map'](_0x1dbbce[_0x0b05('0x1e')],function(_0x2a41b3){return{'model':db[_0x2a41b3[_0x0b05('0x1f')]],'as':_0x2a41b3['as'],'attributes':_0x2a41b3['attributes'],'include':_0x2a41b3['include']?_[_0x0b05('0x1d')](_0x2a41b3[_0x0b05('0x1e')],function(_0x1938a0){return{'model':db[_0x1938a0[_0x0b05('0x1f')]],'as':_0x1938a0['as'],'attributes':_0x1938a0[_0x0b05('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x0b05('0xb')](function(_0x6eb8f1){logger[_0x0b05('0x14')](_0x0b05('0x17'),_0xb5eba9);logger['debug']('ShowSound',_0xb5eba9,JSON[_0x0b05('0xf')](_0x6eb8f1));_0x7ba397(_0x6eb8f1);})[_0x0b05('0x16')](function(_0x4b4c56){logger[_0x0b05('0x10')](_0x0b05('0x17'),_0x4b4c56[_0x0b05('0x13')],_0xb5eba9);_0xb5ca14(_0x51f91c['error'](0x1f4,_0x4b4c56['message']));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 2072d44..ed06c90 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 _0xac4a=['express','Router','../../components/interaction/service','../../config/environment','./squareMessage.controller','isAuthenticated','get','show','create','/:id','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x107634,_0x4ca2e9){var _0x137d88=function(_0x16af1e){while(--_0x16af1e){_0x107634['push'](_0x107634['shift']());}};_0x137d88(++_0x4ca2e9);}(_0xac4a,0x13f));var _0xaac4=function(_0x53a509,_0x180c59){_0x53a509=_0x53a509-0x0;var _0x5a013a=_0xac4a[_0x53a509];return _0x5a013a;};'use strict';var multer=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var path=require(_0xaac4('0x2'));var timeout=require(_0xaac4('0x3'));var express=require(_0xaac4('0x4'));var router=express[_0xaac4('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xaac4('0x6'));var config=require(_0xaac4('0x7'));var controller=require(_0xaac4('0x8'));router['get']('/',auth[_0xaac4('0x9')](),controller['index']);router[_0xaac4('0xa')]('/:id',auth[_0xaac4('0x9')](),controller[_0xaac4('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xaac4('0xc')]);router['put'](_0xaac4('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xaac4('0xe')](_0xaac4('0xd'),auth[_0xaac4('0x9')](),controller[_0xaac4('0xf')]);module[_0xaac4('0x10')]=router; \ No newline at end of file +var _0x9ffd=['util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareMessage.controller','isAuthenticated','index','get','/:id','show','post','create','delete','destroy','exports','multer'];(function(_0x4c184d,_0x4278ab){var _0x23d997=function(_0x22d068){while(--_0x22d068){_0x4c184d['push'](_0x4c184d['shift']());}};_0x23d997(++_0x4278ab);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x4db5fb,_0x1180c6){_0x4db5fb=_0x4db5fb-0x0;var _0x280835=_0x9ffd[_0x4db5fb];return _0x280835;};'use strict';var multer=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var path=require(_0xd9ff('0x2'));var timeout=require('connect-timeout');var express=require(_0xd9ff('0x3'));var router=express[_0xd9ff('0x4')]();var fs_extra=require(_0xd9ff('0x5'));var auth=require(_0xd9ff('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd9ff('0x7'));var controller=require(_0xd9ff('0x8'));router['get']('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xa')]);router[_0xd9ff('0xb')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xd')]);router[_0xd9ff('0xe')]('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xd9ff('0x10')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x11')]);module[_0xd9ff('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index fa7d186..a6b23ed 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 _0xea6d=['ENUM','out','STRING','TEXT','exports','medium'];(function(_0xf79891,_0x399c9b){var _0x4a248c=function(_0x1694ac){while(--_0x1694ac){_0xf79891['push'](_0xf79891['shift']());}};_0x4a248c(++_0x399c9b);}(_0xea6d,0x100));var _0xdea6=function(_0x49249c,_0x1e0997){_0x49249c=_0x49249c-0x0;var _0x484741=_0xea6d[_0x49249c];return _0x484741;};'use strict';var Sequelize=require('sequelize');module[_0xdea6('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize['TEXT'](_0xdea6('0x1')),'allowNull':![]},'direction':{'type':Sequelize[_0xdea6('0x2')]('in','out'),'defaultValue':_0xdea6('0x3'),'allowNull':![]},'providerName':{'type':Sequelize[_0xdea6('0x4')]},'providerResponse':{'type':Sequelize[_0xdea6('0x5')]}}; \ No newline at end of file +var _0x734c=['medium','ENUM','out','sequelize','exports','STRING','TEXT'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x734c,0xdc));var _0xc734=function(_0x18bd2a,_0x3f93f0){_0x18bd2a=_0x18bd2a-0x0;var _0x546f18=_0x734c[_0x18bd2a];return _0x546f18;};'use strict';var Sequelize=require(_0xc734('0x0'));module[_0xc734('0x1')]={'uniqueid':{'type':Sequelize[_0xc734('0x2')]},'body':{'type':Sequelize[_0xc734('0x3')](_0xc734('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0xc734('0x5')]('in',_0xc734('0x6')),'defaultValue':_0xc734('0x6'),'allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 48db33d..7ef397b 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 _0xe1e8=['map','SquareMessage','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','update','eml-format','zip-dir','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','then','destroy','stack','name','send','index'];(function(_0x2221a7,_0x3c3ab9){var _0x30ec70=function(_0x44e134){while(--_0x44e134){_0x2221a7['push'](_0x2221a7['shift']());}};_0x30ec70(++_0x3c3ab9);}(_0xe1e8,0x1cb));var _0x8e1e=function(_0x51c51f,_0x43fa96){_0x51c51f=_0x51c51f-0x0;var _0x28665f=_0xe1e8[_0x51c51f];return _0x28665f;};'use strict';var emlformat=require(_0x8e1e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8e1e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8e1e('0x2'));var BPromise=require(_0x8e1e('0x3'));var Mustache=require(_0x8e1e('0x4'));var util=require(_0x8e1e('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x8e1e('0x6'));var ejs=require(_0x8e1e('0x7'));var fs=require('fs');var fs_extra=require(_0x8e1e('0x8'));var _=require(_0x8e1e('0x9'));var squel=require('squel');var crypto=require(_0x8e1e('0xa'));var jsforce=require(_0x8e1e('0xb'));var deskjs=require(_0x8e1e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8e1e('0xd'));var Redis=require(_0x8e1e('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x8e1e('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8e1e('0x10'));var logger=require(_0x8e1e('0x11'))(_0x8e1e('0x12'));var utils=require(_0x8e1e('0x13'));var config=require(_0x8e1e('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x8e1e('0x15'))['db'];function respondWithStatusCode(_0x206783,_0x3d0265){_0x3d0265=_0x3d0265||0xcc;return function(_0x57919e){if(_0x57919e){return _0x206783[_0x8e1e('0x16')](_0x3d0265);}return _0x206783[_0x8e1e('0x17')](_0x3d0265)[_0x8e1e('0x18')]();};}function respondWithResult(_0x161bb7,_0x5cb057){_0x5cb057=_0x5cb057||0xc8;return function(_0x5b8fd1){if(_0x5b8fd1){return _0x161bb7['status'](_0x5cb057)[_0x8e1e('0x19')](_0x5b8fd1);}};}function respondWithFilteredResult(_0x120903,_0x2d2d4f){return function(_0x1bd383){if(_0x1bd383){var _0xf439a=typeof _0x2d2d4f['offset']==='undefined'&&typeof _0x2d2d4f[_0x8e1e('0x1a')]===_0x8e1e('0x1b');var _0x31a1f4=_0x1bd383[_0x8e1e('0x1c')];var _0x4738f3=_0xf439a?0x0:_0x2d2d4f[_0x8e1e('0x1d')];var _0x5bbfde=_0xf439a?_0x1bd383[_0x8e1e('0x1c')]:_0x2d2d4f[_0x8e1e('0x1d')]+_0x2d2d4f['limit'];var _0x4e9fd4;if(_0x5bbfde>=_0x31a1f4){_0x5bbfde=_0x31a1f4;_0x4e9fd4=0xc8;}else{_0x4e9fd4=0xce;}_0x120903[_0x8e1e('0x17')](_0x4e9fd4);return _0x120903[_0x8e1e('0x1e')](_0x8e1e('0x1f'),_0x4738f3+'-'+_0x5bbfde+'/'+_0x31a1f4)[_0x8e1e('0x19')](_0x1bd383);}return null;};}function patchUpdates(_0x325028){return function(_0xa5c182){try{jsonpatch['apply'](_0xa5c182,_0x325028,!![]);}catch(_0x7ad0a5){return BPromise['reject'](_0x7ad0a5);}return _0xa5c182['save']();};}function saveUpdates(_0x4e2e6d,_0x849b18){return function(_0x342ae1){if(_0x342ae1){return _0x342ae1['update'](_0x4e2e6d)[_0x8e1e('0x20')](function(_0x47972b){return _0x47972b;});}return null;};}function removeEntity(_0x323286,_0x499c31){return function(_0x4e5a22){if(_0x4e5a22){return _0x4e5a22[_0x8e1e('0x21')]()[_0x8e1e('0x20')](function(){_0x323286[_0x8e1e('0x17')](0xcc)[_0x8e1e('0x18')]();});}};}function handleEntityNotFound(_0x584bb6,_0x31371f){return function(_0x3b9587){if(!_0x3b9587){_0x584bb6[_0x8e1e('0x16')](0x194);}return _0x3b9587;};}function handleError(_0x5c9ed8,_0x509fe6){_0x509fe6=_0x509fe6||0x1f4;return function(_0xbd295f){logger['error'](_0xbd295f[_0x8e1e('0x22')]);if(_0xbd295f[_0x8e1e('0x23')]){delete _0xbd295f[_0x8e1e('0x23')];}_0x5c9ed8[_0x8e1e('0x17')](_0x509fe6)[_0x8e1e('0x24')](_0xbd295f);};}exports[_0x8e1e('0x25')]=function(_0x1764b4,_0x370ee2){var _0x4d7008={},_0x53756d={},_0x2e7d84={'count':0x0,'rows':[]};var _0x1ad99e=_[_0x8e1e('0x26')](db[_0x8e1e('0x27')]['rawAttributes'],function(_0x227fd3){return{'name':_0x227fd3[_0x8e1e('0x28')],'type':_0x227fd3[_0x8e1e('0x29')][_0x8e1e('0x2a')]};});_0x53756d[_0x8e1e('0x2b')]=_['map'](_0x1ad99e,_0x8e1e('0x23'));_0x53756d[_0x8e1e('0x2c')]=_[_0x8e1e('0x2d')](_0x1764b4[_0x8e1e('0x2c')]);_0x53756d[_0x8e1e('0x2e')]=_[_0x8e1e('0x2f')](_0x53756d['model'],_0x53756d[_0x8e1e('0x2c')]);_0x4d7008[_0x8e1e('0x30')]=_['intersection'](_0x53756d[_0x8e1e('0x2b')],qs['fields'](_0x1764b4[_0x8e1e('0x2c')][_0x8e1e('0x31')]));_0x4d7008[_0x8e1e('0x30')]=_0x4d7008[_0x8e1e('0x30')]['length']?_0x4d7008['attributes']:_0x53756d[_0x8e1e('0x2b')];if(!_0x1764b4[_0x8e1e('0x2c')][_0x8e1e('0x32')]('nolimit')){_0x4d7008['limit']=qs[_0x8e1e('0x1a')](_0x1764b4[_0x8e1e('0x2c')][_0x8e1e('0x1a')]);_0x4d7008['offset']=qs[_0x8e1e('0x1d')](_0x1764b4[_0x8e1e('0x2c')]['offset']);}_0x4d7008[_0x8e1e('0x33')]=qs[_0x8e1e('0x34')](_0x1764b4[_0x8e1e('0x2c')]['sort']);_0x4d7008[_0x8e1e('0x35')]=qs[_0x8e1e('0x2e')](_[_0x8e1e('0x36')](_0x1764b4['query'],_0x53756d[_0x8e1e('0x2e')]),_0x1ad99e);if(_0x1764b4[_0x8e1e('0x2c')][_0x8e1e('0x37')]){_0x4d7008[_0x8e1e('0x35')]=_[_0x8e1e('0x38')](_0x4d7008['where'],{'$or':_['map'](_0x1ad99e,function(_0x1be215){if(_0x1be215[_0x8e1e('0x29')]!==_0x8e1e('0x39')){var _0x235962={};_0x235962[_0x1be215[_0x8e1e('0x23')]]={'$like':'%'+_0x1764b4[_0x8e1e('0x2c')][_0x8e1e('0x37')]+'%'};return _0x235962;}})});}_0x4d7008=_[_0x8e1e('0x38')]({},_0x4d7008,_0x1764b4[_0x8e1e('0x3a')]);var _0x1a9b74={'where':_0x4d7008[_0x8e1e('0x35')]};return db[_0x8e1e('0x27')][_0x8e1e('0x1c')](_0x1a9b74)[_0x8e1e('0x20')](function(_0x2e01d5){_0x2e7d84[_0x8e1e('0x1c')]=_0x2e01d5;if(_0x1764b4[_0x8e1e('0x2c')][_0x8e1e('0x3b')]){_0x4d7008[_0x8e1e('0x3c')]=[{'all':!![]}];}return db['SquareMessage'][_0x8e1e('0x3d')](_0x4d7008);})['then'](function(_0x28517b){_0x2e7d84[_0x8e1e('0x3e')]=_0x28517b;return _0x2e7d84;})['then'](respondWithFilteredResult(_0x370ee2,_0x4d7008))[_0x8e1e('0x3f')](handleError(_0x370ee2,null));};exports[_0x8e1e('0x40')]=function(_0x45cebd,_0x53c00f){var _0x46ad25={'raw':!![],'where':{'id':_0x45cebd[_0x8e1e('0x41')]['id']}},_0x50f510={};_0x50f510['model']=_[_0x8e1e('0x2d')](db[_0x8e1e('0x27')][_0x8e1e('0x42')]);_0x50f510[_0x8e1e('0x2c')]=_[_0x8e1e('0x2d')](_0x45cebd[_0x8e1e('0x2c')]);_0x50f510[_0x8e1e('0x2e')]=_[_0x8e1e('0x2f')](_0x50f510[_0x8e1e('0x2b')],_0x50f510[_0x8e1e('0x2c')]);_0x46ad25[_0x8e1e('0x30')]=_[_0x8e1e('0x2f')](_0x50f510[_0x8e1e('0x2b')],qs[_0x8e1e('0x31')](_0x45cebd[_0x8e1e('0x2c')][_0x8e1e('0x31')]));_0x46ad25[_0x8e1e('0x30')]=_0x46ad25[_0x8e1e('0x30')]['length']?_0x46ad25['attributes']:_0x50f510['model'];if(_0x45cebd['query']['includeAll']){_0x46ad25[_0x8e1e('0x3c')]=[{'all':!![]}];}_0x46ad25=_[_0x8e1e('0x38')]({},_0x46ad25,_0x45cebd[_0x8e1e('0x3a')]);return db['SquareMessage'][_0x8e1e('0x43')](_0x46ad25)[_0x8e1e('0x20')](handleEntityNotFound(_0x53c00f,null))[_0x8e1e('0x20')](respondWithResult(_0x53c00f,null))['catch'](handleError(_0x53c00f,null));};exports[_0x8e1e('0x44')]=function(_0x116553,_0x4ea221){return db[_0x8e1e('0x27')][_0x8e1e('0x44')](_0x116553[_0x8e1e('0x45')],{})[_0x8e1e('0x20')](respondWithResult(_0x4ea221,0xc9))['catch'](handleError(_0x4ea221,null));};exports[_0x8e1e('0x46')]=function(_0x16d169,_0x26a8dd){if(_0x16d169[_0x8e1e('0x45')]['id']){delete _0x16d169['body']['id'];}return db[_0x8e1e('0x27')][_0x8e1e('0x43')]({'where':{'id':_0x16d169[_0x8e1e('0x41')]['id']}})[_0x8e1e('0x20')](handleEntityNotFound(_0x26a8dd,null))[_0x8e1e('0x20')](saveUpdates(_0x16d169[_0x8e1e('0x45')],null))['then'](respondWithResult(_0x26a8dd,null))[_0x8e1e('0x3f')](handleError(_0x26a8dd,null));};exports['destroy']=function(_0x517dc3,_0x15dd5a){return db[_0x8e1e('0x27')][_0x8e1e('0x43')]({'where':{'id':_0x517dc3[_0x8e1e('0x41')]['id']}})[_0x8e1e('0x20')](handleEntityNotFound(_0x15dd5a,null))[_0x8e1e('0x20')](removeEntity(_0x15dd5a,null))[_0x8e1e('0x3f')](handleError(_0x15dd5a,null));}; \ No newline at end of file +var _0x11c3=['filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','rows','show','include','create','body','catch','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','count','set','Content-Range','json','apply','reject','update','destroy','then','error','stack','name','send','index','SquareMessage','rawAttributes','fieldName','type','key','model','map','query','keys'];(function(_0x476bf4,_0x2a3755){var _0x788ffe=function(_0x13fa11){while(--_0x13fa11){_0x476bf4['push'](_0x476bf4['shift']());}};_0x788ffe(++_0x2a3755);}(_0x11c3,0xee));var _0x311c=function(_0x3cfa61,_0x20ce70){_0x3cfa61=_0x3cfa61-0x0;var _0x207a31=_0x11c3[_0x3cfa61];return _0x207a31;};'use strict';var emlformat=require(_0x311c('0x0'));var rimraf=require(_0x311c('0x1'));var zipdir=require(_0x311c('0x2'));var jsonpatch=require(_0x311c('0x3'));var rp=require('request-promise');var moment=require(_0x311c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x311c('0x5'));var util=require(_0x311c('0x6'));var path=require(_0x311c('0x7'));var sox=require(_0x311c('0x8'));var csv=require(_0x311c('0x9'));var ejs=require(_0x311c('0xa'));var fs=require('fs');var fs_extra=require(_0x311c('0xb'));var _=require(_0x311c('0xc'));var squel=require(_0x311c('0xd'));var crypto=require('crypto');var jsforce=require(_0x311c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x311c('0x9'));var querystring=require('querystring');var Papa=require(_0x311c('0xf'));var Redis=require('ioredis');var authService=require(_0x311c('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x311c('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x311c('0x12'));var utils=require(_0x311c('0x13'));var config=require(_0x311c('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x311c('0x15'))['db'];function respondWithStatusCode(_0x5311f8,_0x38c245){_0x38c245=_0x38c245||0xcc;return function(_0x2b3c6d){if(_0x2b3c6d){return _0x5311f8[_0x311c('0x16')](_0x38c245);}return _0x5311f8[_0x311c('0x17')](_0x38c245)[_0x311c('0x18')]();};}function respondWithResult(_0x83a61a,_0x1aebcf){_0x1aebcf=_0x1aebcf||0xc8;return function(_0x1b884b){if(_0x1b884b){return _0x83a61a[_0x311c('0x17')](_0x1aebcf)['json'](_0x1b884b);}};}function respondWithFilteredResult(_0x1be213,_0x305555){return function(_0x48b5f2){if(_0x48b5f2){var _0x4166c7=typeof _0x305555[_0x311c('0x19')]==='undefined'&&typeof _0x305555[_0x311c('0x1a')]==='undefined';var _0xce750e=_0x48b5f2[_0x311c('0x1b')];var _0xd9a203=_0x4166c7?0x0:_0x305555[_0x311c('0x19')];var _0x5d6dfd=_0x4166c7?_0x48b5f2[_0x311c('0x1b')]:_0x305555[_0x311c('0x19')]+_0x305555[_0x311c('0x1a')];var _0x1914d1;if(_0x5d6dfd>=_0xce750e){_0x5d6dfd=_0xce750e;_0x1914d1=0xc8;}else{_0x1914d1=0xce;}_0x1be213[_0x311c('0x17')](_0x1914d1);return _0x1be213[_0x311c('0x1c')](_0x311c('0x1d'),_0xd9a203+'-'+_0x5d6dfd+'/'+_0xce750e)[_0x311c('0x1e')](_0x48b5f2);}return null;};}function patchUpdates(_0x39c3d1){return function(_0xea8605){try{jsonpatch[_0x311c('0x1f')](_0xea8605,_0x39c3d1,!![]);}catch(_0x215edd){return BPromise[_0x311c('0x20')](_0x215edd);}return _0xea8605['save']();};}function saveUpdates(_0x55d271,_0x59b43c){return function(_0x169575){if(_0x169575){return _0x169575[_0x311c('0x21')](_0x55d271)['then'](function(_0x5373dd){return _0x5373dd;});}return null;};}function removeEntity(_0x52c0a7,_0x284862){return function(_0x390d27){if(_0x390d27){return _0x390d27[_0x311c('0x22')]()[_0x311c('0x23')](function(){_0x52c0a7[_0x311c('0x17')](0xcc)[_0x311c('0x18')]();});}};}function handleEntityNotFound(_0x54cf7e,_0x448355){return function(_0x4c868c){if(!_0x4c868c){_0x54cf7e[_0x311c('0x16')](0x194);}return _0x4c868c;};}function handleError(_0x508dea,_0x22aef5){_0x22aef5=_0x22aef5||0x1f4;return function(_0x534047){logger[_0x311c('0x24')](_0x534047[_0x311c('0x25')]);if(_0x534047[_0x311c('0x26')]){delete _0x534047['name'];}_0x508dea[_0x311c('0x17')](_0x22aef5)[_0x311c('0x27')](_0x534047);};}exports[_0x311c('0x28')]=function(_0x4a9339,_0x5d63df){var _0x27e524={},_0x1d3407={},_0x19c98c={'count':0x0,'rows':[]};var _0x1e822a=_['map'](db[_0x311c('0x29')][_0x311c('0x2a')],function(_0x449b66){return{'name':_0x449b66[_0x311c('0x2b')],'type':_0x449b66[_0x311c('0x2c')][_0x311c('0x2d')]};});_0x1d3407[_0x311c('0x2e')]=_[_0x311c('0x2f')](_0x1e822a,'name');_0x1d3407[_0x311c('0x30')]=_[_0x311c('0x31')](_0x4a9339[_0x311c('0x30')]);_0x1d3407[_0x311c('0x32')]=_[_0x311c('0x33')](_0x1d3407[_0x311c('0x2e')],_0x1d3407[_0x311c('0x30')]);_0x27e524[_0x311c('0x34')]=_[_0x311c('0x33')](_0x1d3407[_0x311c('0x2e')],qs[_0x311c('0x35')](_0x4a9339[_0x311c('0x30')]['fields']));_0x27e524['attributes']=_0x27e524['attributes'][_0x311c('0x36')]?_0x27e524[_0x311c('0x34')]:_0x1d3407[_0x311c('0x2e')];if(!_0x4a9339['query'][_0x311c('0x37')]('nolimit')){_0x27e524[_0x311c('0x1a')]=qs[_0x311c('0x1a')](_0x4a9339[_0x311c('0x30')][_0x311c('0x1a')]);_0x27e524['offset']=qs[_0x311c('0x19')](_0x4a9339[_0x311c('0x30')][_0x311c('0x19')]);}_0x27e524[_0x311c('0x38')]=qs[_0x311c('0x39')](_0x4a9339[_0x311c('0x30')]['sort']);_0x27e524[_0x311c('0x3a')]=qs[_0x311c('0x32')](_[_0x311c('0x3b')](_0x4a9339['query'],_0x1d3407[_0x311c('0x32')]),_0x1e822a);if(_0x4a9339[_0x311c('0x30')][_0x311c('0x3c')]){_0x27e524[_0x311c('0x3a')]=_['merge'](_0x27e524[_0x311c('0x3a')],{'$or':_[_0x311c('0x2f')](_0x1e822a,function(_0x2a6033){if(_0x2a6033[_0x311c('0x2c')]!==_0x311c('0x3d')){var _0x3cbd31={};_0x3cbd31[_0x2a6033[_0x311c('0x26')]]={'$like':'%'+_0x4a9339[_0x311c('0x30')][_0x311c('0x3c')]+'%'};return _0x3cbd31;}})});}_0x27e524=_[_0x311c('0x3e')]({},_0x27e524,_0x4a9339[_0x311c('0x3f')]);var _0x2f84d4={'where':_0x27e524[_0x311c('0x3a')]};return db['SquareMessage'][_0x311c('0x1b')](_0x2f84d4)[_0x311c('0x23')](function(_0x5d545f){_0x19c98c[_0x311c('0x1b')]=_0x5d545f;if(_0x4a9339[_0x311c('0x30')][_0x311c('0x40')]){_0x27e524['include']=[{'all':!![]}];}return db['SquareMessage']['findAll'](_0x27e524);})['then'](function(_0x4f712f){_0x19c98c[_0x311c('0x41')]=_0x4f712f;return _0x19c98c;})[_0x311c('0x23')](respondWithFilteredResult(_0x5d63df,_0x27e524))['catch'](handleError(_0x5d63df,null));};exports[_0x311c('0x42')]=function(_0x58833d,_0x3ad049){var _0x24c8be={'raw':!![],'where':{'id':_0x58833d['params']['id']}},_0x76d2b4={};_0x76d2b4[_0x311c('0x2e')]=_['keys'](db[_0x311c('0x29')][_0x311c('0x2a')]);_0x76d2b4[_0x311c('0x30')]=_[_0x311c('0x31')](_0x58833d[_0x311c('0x30')]);_0x76d2b4[_0x311c('0x32')]=_[_0x311c('0x33')](_0x76d2b4[_0x311c('0x2e')],_0x76d2b4[_0x311c('0x30')]);_0x24c8be[_0x311c('0x34')]=_[_0x311c('0x33')](_0x76d2b4[_0x311c('0x2e')],qs[_0x311c('0x35')](_0x58833d[_0x311c('0x30')][_0x311c('0x35')]));_0x24c8be[_0x311c('0x34')]=_0x24c8be[_0x311c('0x34')][_0x311c('0x36')]?_0x24c8be[_0x311c('0x34')]:_0x76d2b4[_0x311c('0x2e')];if(_0x58833d[_0x311c('0x30')][_0x311c('0x40')]){_0x24c8be[_0x311c('0x43')]=[{'all':!![]}];}_0x24c8be=_[_0x311c('0x3e')]({},_0x24c8be,_0x58833d['options']);return db['SquareMessage']['find'](_0x24c8be)['then'](handleEntityNotFound(_0x3ad049,null))[_0x311c('0x23')](respondWithResult(_0x3ad049,null))['catch'](handleError(_0x3ad049,null));};exports[_0x311c('0x44')]=function(_0x1848ba,_0x22ecee){return db[_0x311c('0x29')][_0x311c('0x44')](_0x1848ba[_0x311c('0x45')],{})['then'](respondWithResult(_0x22ecee,0xc9))['catch'](handleError(_0x22ecee,null));};exports[_0x311c('0x21')]=function(_0x4ed3df,_0x5b1306){if(_0x4ed3df[_0x311c('0x45')]['id']){delete _0x4ed3df[_0x311c('0x45')]['id'];}return db[_0x311c('0x29')]['find']({'where':{'id':_0x4ed3df['params']['id']}})['then'](handleEntityNotFound(_0x5b1306,null))[_0x311c('0x23')](saveUpdates(_0x4ed3df['body'],null))[_0x311c('0x23')](respondWithResult(_0x5b1306,null))[_0x311c('0x46')](handleError(_0x5b1306,null));};exports['destroy']=function(_0x81275a,_0xcb3bf6){return db['SquareMessage']['find']({'where':{'id':_0x81275a[_0x311c('0x47')]['id']}})[_0x311c('0x23')](handleEntityNotFound(_0xcb3bf6,null))[_0x311c('0x23')](removeEntity(_0xcb3bf6,null))[_0x311c('0x46')](handleError(_0xcb3bf6,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 61f7875..eb521fd 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 _0x3c46=['define','SquareMessage','square_messages','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./squareMessage.attributes','exports'];(function(_0x3a031a,_0xd706bb){var _0x2c71c6=function(_0x2d6b6b){while(--_0x2d6b6b){_0x3a031a['push'](_0x3a031a['shift']());}};_0x2c71c6(++_0xd706bb);}(_0x3c46,0xb9));var _0x63c4=function(_0x1ab50c,_0x54a581){_0x1ab50c=_0x1ab50c-0x0;var _0x23e558=_0x3c46[_0x1ab50c];return _0x23e558;};'use strict';var _=require(_0x63c4('0x0'));var util=require(_0x63c4('0x1'));var logger=require(_0x63c4('0x2'))(_0x63c4('0x3'));var moment=require(_0x63c4('0x4'));var BPromise=require(_0x63c4('0x5'));var rp=require(_0x63c4('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x63c4('0x7'));var config=require(_0x63c4('0x8'));var attributes=require(_0x63c4('0x9'));module[_0x63c4('0xa')]=function(_0x3bb643,_0x1f4de3){return _0x3bb643[_0x63c4('0xb')](_0x63c4('0xc'),attributes,{'tableName':_0x63c4('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x00e2=['path','rimraf','../../config/environment','./squareMessage.attributes','exports','define','SquareMessage','square_messages','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x30a8ea,_0x371a09){var _0x90d0d8=function(_0x3b1ab0){while(--_0x3b1ab0){_0x30a8ea['push'](_0x30a8ea['shift']());}};_0x90d0d8(++_0x371a09);}(_0x00e2,0x1ac));var _0x200e=function(_0x1a87b3,_0x45ba68){_0x1a87b3=_0x1a87b3-0x0;var _0x37e84d=_0x00e2[_0x1a87b3];return _0x37e84d;};'use strict';var _=require(_0x200e('0x0'));var util=require(_0x200e('0x1'));var logger=require(_0x200e('0x2'))(_0x200e('0x3'));var moment=require(_0x200e('0x4'));var BPromise=require(_0x200e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x200e('0x6'));var rimraf=require(_0x200e('0x7'));var config=require(_0x200e('0x8'));var attributes=require(_0x200e('0x9'));module[_0x200e('0xa')]=function(_0x440815,_0x3a645c){return _0x440815[_0x200e('0xb')](_0x200e('0xc'),attributes,{'tableName':_0x200e('0xd'),'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 d6ab691..ba572db 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 _0xfb98=['error','message','result','SquareMessage','body','options','raw','CreateSquareMessage','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SquareMessage,\x20%s,\x20%s','debug','SquareMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x5192de,_0x4e91cd){var _0x4e287e=function(_0x3639bc){while(--_0x3639bc){_0x5192de['push'](_0x5192de['shift']());}};_0x4e287e(++_0x4e91cd);}(_0xfb98,0x9f));var _0x8fb9=function(_0x408bfb,_0x2c2919){_0x408bfb=_0x408bfb-0x0;var _0x53efbd=_0xfb98[_0x408bfb];return _0x53efbd;};'use strict';var _=require(_0x8fb9('0x0'));var util=require(_0x8fb9('0x1'));var moment=require(_0x8fb9('0x2'));var BPromise=require(_0x8fb9('0x3'));var rs=require(_0x8fb9('0x4'));var fs=require('fs');var Redis=require(_0x8fb9('0x5'));var db=require(_0x8fb9('0x6'))['db'];var utils=require(_0x8fb9('0x7'));var logger=require(_0x8fb9('0x8'))(_0x8fb9('0x9'));var config=require('../../config/environment');var jayson=require(_0x8fb9('0xa'));var client=jayson[_0x8fb9('0xb')][_0x8fb9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x20a163,_0x5befcf,_0x36cdff){return new BPromise(function(_0x59f0ce,_0x5aed15){return client[_0x8fb9('0xd')](_0x20a163,_0x36cdff)[_0x8fb9('0xe')](function(_0x1bc6f7){logger[_0x8fb9('0xf')](_0x8fb9('0x10'),_0x5befcf,'request\x20sent');logger[_0x8fb9('0x11')](_0x8fb9('0x12'),_0x5befcf,_0x8fb9('0x13'),JSON[_0x8fb9('0x14')](_0x1bc6f7));if(_0x1bc6f7[_0x8fb9('0x15')]){if(_0x1bc6f7[_0x8fb9('0x15')]['code']===0x1f4){logger[_0x8fb9('0x15')](_0x8fb9('0x10'),_0x5befcf,_0x1bc6f7[_0x8fb9('0x15')][_0x8fb9('0x16')]);return _0x5aed15(_0x1bc6f7['error']['message']);}logger['error'](_0x8fb9('0x10'),_0x5befcf,_0x1bc6f7['error'][_0x8fb9('0x16')]);return _0x59f0ce(_0x1bc6f7[_0x8fb9('0x15')][_0x8fb9('0x16')]);}else{logger[_0x8fb9('0xf')]('SquareMessage,\x20%s,\x20%s',_0x5befcf,_0x8fb9('0x13'));_0x59f0ce(_0x1bc6f7[_0x8fb9('0x17')][_0x8fb9('0x16')]);}})['catch'](function(_0x457a8f){logger[_0x8fb9('0x15')]('SquareMessage,\x20%s,\x20%s',_0x5befcf,_0x457a8f);_0x5aed15(_0x457a8f);});});}exports['CreateSquareMessage']=function(_0x43c66c){var _0x4f257a=this;return new Promise(function(_0x1b3b27,_0x43e0af){return db[_0x8fb9('0x18')]['create'](_0x43c66c[_0x8fb9('0x19')],{'raw':_0x43c66c[_0x8fb9('0x1a')]?_0x43c66c[_0x8fb9('0x1a')][_0x8fb9('0x1b')]===undefined?!![]:![]:!![]})[_0x8fb9('0xe')](function(_0x3ec383){logger['info'](_0x8fb9('0x1c'),_0x43c66c);logger[_0x8fb9('0x11')](_0x8fb9('0x1c'),_0x43c66c,JSON[_0x8fb9('0x14')](_0x3ec383));_0x1b3b27(_0x3ec383);})[_0x8fb9('0x1d')](function(_0xeabff){logger['error'](_0x8fb9('0x1c'),_0xeabff[_0x8fb9('0x16')],_0x43c66c);_0x43e0af(_0x4f257a['error'](0x1f4,_0xeabff['message']));});});}; \ No newline at end of file +var _0x5977=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateSquareMessage','body','options','raw','lodash','util','moment','bluebird'];(function(_0x1eba22,_0x4c9665){var _0x1dfad1=function(_0x29d7c8){while(--_0x29d7c8){_0x1eba22['push'](_0x1eba22['shift']());}};_0x1dfad1(++_0x4c9665);}(_0x5977,0x1cc));var _0x7597=function(_0x550802,_0x1eab89){_0x550802=_0x550802-0x0;var _0xa42ec8=_0x5977[_0x550802];return _0xa42ec8;};'use strict';var _=require(_0x7597('0x0'));var util=require(_0x7597('0x1'));var moment=require(_0x7597('0x2'));var BPromise=require(_0x7597('0x3'));var rs=require(_0x7597('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7597('0x5'))['db'];var utils=require(_0x7597('0x6'));var logger=require(_0x7597('0x7'))(_0x7597('0x8'));var config=require(_0x7597('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7597('0xa')][_0x7597('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x10f708,_0x3b0009,_0x36399a){return new BPromise(function(_0x4646da,_0x3cc540){return client[_0x7597('0xc')](_0x10f708,_0x36399a)[_0x7597('0xd')](function(_0x201ae8){logger['info'](_0x7597('0xe'),_0x3b0009,_0x7597('0xf'));logger[_0x7597('0x10')](_0x7597('0x11'),_0x3b0009,_0x7597('0xf'),JSON[_0x7597('0x12')](_0x201ae8));if(_0x201ae8['error']){if(_0x201ae8[_0x7597('0x13')][_0x7597('0x14')]===0x1f4){logger[_0x7597('0x13')](_0x7597('0xe'),_0x3b0009,_0x201ae8['error'][_0x7597('0x15')]);return _0x3cc540(_0x201ae8['error'][_0x7597('0x15')]);}logger[_0x7597('0x13')](_0x7597('0xe'),_0x3b0009,_0x201ae8[_0x7597('0x13')][_0x7597('0x15')]);return _0x4646da(_0x201ae8[_0x7597('0x13')]['message']);}else{logger[_0x7597('0x16')](_0x7597('0xe'),_0x3b0009,_0x7597('0xf'));_0x4646da(_0x201ae8[_0x7597('0x17')][_0x7597('0x15')]);}})[_0x7597('0x18')](function(_0x1a95e3){logger[_0x7597('0x13')](_0x7597('0xe'),_0x3b0009,_0x1a95e3);_0x3cc540(_0x1a95e3);});});}exports[_0x7597('0x19')]=function(_0x1c0b9f){var _0x28ac43=this;return new Promise(function(_0xd36bbd,_0xc89f22){return db['SquareMessage']['create'](_0x1c0b9f[_0x7597('0x1a')],{'raw':_0x1c0b9f[_0x7597('0x1b')]?_0x1c0b9f[_0x7597('0x1b')][_0x7597('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x300c14){logger['info']('CreateSquareMessage',_0x1c0b9f);logger[_0x7597('0x10')](_0x7597('0x19'),_0x1c0b9f,JSON[_0x7597('0x12')](_0x300c14));_0xd36bbd(_0x300c14);})[_0x7597('0x18')](function(_0x1400f2){logger[_0x7597('0x13')](_0x7597('0x19'),_0x1400f2[_0x7597('0x15')],_0x1c0b9f);_0xc89f22(_0x28ac43[_0x7597('0x13')](0x1f4,_0x1400f2[_0x7597('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index a723ed3..3d25af5 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 _0x5664=['test','post','create','update','delete','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/test'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x5664,0x65));var _0x4566=function(_0x1bb58c,_0x2c8a4d){_0x1bb58c=_0x1bb58c-0x0;var _0x277586=_0x5664[_0x1bb58c];return _0x277586;};'use strict';var multer=require('multer');var util=require(_0x4566('0x0'));var path=require(_0x4566('0x1'));var timeout=require(_0x4566('0x2'));var express=require(_0x4566('0x3'));var router=express['Router']();var fs_extra=require(_0x4566('0x4'));var auth=require(_0x4566('0x5'));var interaction=require(_0x4566('0x6'));var config=require(_0x4566('0x7'));var controller=require('./squareOdbc.controller');router[_0x4566('0x8')]('/',auth[_0x4566('0x9')](),controller[_0x4566('0xa')]);router[_0x4566('0x8')](_0x4566('0xb'),auth[_0x4566('0x9')](),controller['show']);router[_0x4566('0x8')](_0x4566('0xc'),auth[_0x4566('0x9')](),timeout('15s'),controller[_0x4566('0xd')]);router[_0x4566('0xe')]('/',auth[_0x4566('0x9')](),controller[_0x4566('0xf')]);router['put'](_0x4566('0xb'),auth['isAuthenticated'](),controller[_0x4566('0x10')]);router[_0x4566('0x11')](_0x4566('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x4566('0x12')]=router; \ No newline at end of file +var _0x020b=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','15s','test','post','create','put'];(function(_0x50aaf7,_0x238040){var _0x2d996b=function(_0x481332){while(--_0x481332){_0x50aaf7['push'](_0x50aaf7['shift']());}};_0x2d996b(++_0x238040);}(_0x020b,0x1d1));var _0xb020=function(_0x169351,_0x59cf90){_0x169351=_0x169351-0x0;var _0x113658=_0x020b[_0x169351];return _0x113658;};'use strict';var multer=require(_0xb020('0x0'));var util=require(_0xb020('0x1'));var path=require(_0xb020('0x2'));var timeout=require(_0xb020('0x3'));var express=require(_0xb020('0x4'));var router=express[_0xb020('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb020('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb020('0x7'));var controller=require(_0xb020('0x8'));router[_0xb020('0x9')]('/',auth[_0xb020('0xa')](),controller[_0xb020('0xb')]);router['get'](_0xb020('0xc'),auth[_0xb020('0xa')](),controller[_0xb020('0xd')]);router[_0xb020('0x9')]('/:id/test',auth['isAuthenticated'](),timeout(_0xb020('0xe')),controller[_0xb020('0xf')]);router[_0xb020('0x10')]('/',auth['isAuthenticated'](),controller[_0xb020('0x11')]);router[_0xb020('0x12')](_0xb020('0xc'),auth[_0xb020('0xa')](),controller['update']);router[_0xb020('0x13')](_0xb020('0xc'),auth[_0xb020('0xa')](),controller[_0xb020('0x14')]);module[_0xb020('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 8883820..cfb1687 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 _0xd6aa=['exports','STRING','name','sequelize'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0xd6aa,0x137));var _0xad6a=function(_0x1b3aa1,_0x282743){_0x1b3aa1=_0x1b3aa1-0x0;var _0x5ef553=_0xd6aa[_0x1b3aa1];return _0x5ef553;};'use strict';var Sequelize=require(_0xad6a('0x0'));module[_0xad6a('0x1')]={'name':{'type':Sequelize[_0xad6a('0x2')],'unique':_0xad6a('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0xad6a('0x2')]},'description':{'type':Sequelize[_0xad6a('0x2')]}}; \ No newline at end of file +var _0xa54c=['exports','STRING','sequelize'];(function(_0x48f7cf,_0x4baa04){var _0xc201c0=function(_0x23ff34){while(--_0x23ff34){_0x48f7cf['push'](_0x48f7cf['shift']());}};_0xc201c0(++_0x4baa04);}(_0xa54c,0x1e5));var _0xca54=function(_0x33bc64,_0x4d1e92){_0x33bc64=_0x33bc64-0x0;var _0x3fdd34=_0xa54c[_0x33bc64];return _0x3fdd34;};'use strict';var Sequelize=require(_0xca54('0x0'));module[_0xca54('0x1')]={'name':{'type':Sequelize[_0xca54('0x2')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0xca54('0x2')]},'description':{'type':Sequelize[_0xca54('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index d8b4e4f..ba6c87b 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 _0x7fe4=['test','odbc','openSync','dsn','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','ODBC','UserProfileResource','destroy','sendStatus','error','stack','name','send','map','SquareOdbc','rawAttributes','type','model','query','keys','attributes','intersection','fields','nolimit','order','sort','filters','where','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','length','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'];(function(_0x2307fa,_0x266e5e){var _0x496486=function(_0x53466e){while(--_0x53466e){_0x2307fa['push'](_0x2307fa['shift']());}};_0x496486(++_0x266e5e);}(_0x7fe4,0x1cc));var _0x47fe=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0x7fe4[_0x45783c];return _0x1161da;};'use strict';var emlformat=require(_0x47fe('0x0'));var rimraf=require(_0x47fe('0x1'));var zipdir=require(_0x47fe('0x2'));var jsonpatch=require(_0x47fe('0x3'));var rp=require(_0x47fe('0x4'));var moment=require(_0x47fe('0x5'));var BPromise=require(_0x47fe('0x6'));var Mustache=require(_0x47fe('0x7'));var util=require(_0x47fe('0x8'));var path=require(_0x47fe('0x9'));var sox=require(_0x47fe('0xa'));var csv=require(_0x47fe('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47fe('0xc'));var _=require(_0x47fe('0xd'));var squel=require(_0x47fe('0xe'));var crypto=require(_0x47fe('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x47fe('0x10'));var toCsv=require(_0x47fe('0xb'));var querystring=require(_0x47fe('0x11'));var Papa=require(_0x47fe('0x12'));var Redis=require(_0x47fe('0x13'));var authService=require(_0x47fe('0x14'));var qs=require(_0x47fe('0x15'));var as=require(_0x47fe('0x16'));var hardwareService=require(_0x47fe('0x17'));var logger=require(_0x47fe('0x18'))('api');var utils=require(_0x47fe('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x47fe('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x259637,_0xb7978d){_0xb7978d=_0xb7978d||0xcc;return function(_0x624832){if(_0x624832){return _0x259637['sendStatus'](_0xb7978d);}return _0x259637[_0x47fe('0x1b')](_0xb7978d)[_0x47fe('0x1c')]();};}function respondWithResult(_0x54681a,_0x2ed3eb){_0x2ed3eb=_0x2ed3eb||0xc8;return function(_0x1ea657){if(_0x1ea657){return _0x54681a[_0x47fe('0x1b')](_0x2ed3eb)[_0x47fe('0x1d')](_0x1ea657);}};}function respondWithFilteredResult(_0x1bdc7b,_0xe3f264){return function(_0xd49f8){if(_0xd49f8){var _0x27f74e=typeof _0xe3f264[_0x47fe('0x1e')]===_0x47fe('0x1f')&&typeof _0xe3f264[_0x47fe('0x20')]==='undefined';var _0x366b82=_0xd49f8['count'];var _0x3dc127=_0x27f74e?0x0:_0xe3f264[_0x47fe('0x1e')];var _0x1c7732=_0x27f74e?_0xd49f8[_0x47fe('0x21')]:_0xe3f264[_0x47fe('0x1e')]+_0xe3f264[_0x47fe('0x20')];var _0x5eb451;if(_0x1c7732>=_0x366b82){_0x1c7732=_0x366b82;_0x5eb451=0xc8;}else{_0x5eb451=0xce;}_0x1bdc7b['status'](_0x5eb451);return _0x1bdc7b[_0x47fe('0x22')](_0x47fe('0x23'),_0x3dc127+'-'+_0x1c7732+'/'+_0x366b82)[_0x47fe('0x1d')](_0xd49f8);}return null;};}function patchUpdates(_0x4f2375){return function(_0x989b45){try{jsonpatch[_0x47fe('0x24')](_0x989b45,_0x4f2375,!![]);}catch(_0x124176){return BPromise[_0x47fe('0x25')](_0x124176);}return _0x989b45[_0x47fe('0x26')]();};}function saveUpdates(_0x488225,_0x51b94e){return function(_0x34cc79){if(_0x34cc79){return _0x34cc79[_0x47fe('0x27')](_0x488225)['then'](function(_0x488a1a){return _0x488a1a;});}return null;};}function removeEntity(_0xf8319f,_0x4b4e38){return function(_0x5c5965){if(_0x5c5965){return _0x5c5965['destroy']()[_0x47fe('0x28')](function(){var _0x28b537=_0x5c5965[_0x47fe('0x29')]({'plain':!![]});var _0x30851e=_0x47fe('0x2a');return db[_0x47fe('0x2b')][_0x47fe('0x2c')]({'where':{'type':_0x30851e,'resourceId':_0x28b537['id']}})[_0x47fe('0x28')](function(){return _0x5c5965;});})[_0x47fe('0x28')](function(){_0xf8319f[_0x47fe('0x1b')](0xcc)[_0x47fe('0x1c')]();});}};}function handleEntityNotFound(_0x3c9a17,_0x2beb58){return function(_0x5ebab5){if(!_0x5ebab5){_0x3c9a17[_0x47fe('0x2d')](0x194);}return _0x5ebab5;};}function handleError(_0x259c1a,_0x2fb53f){_0x2fb53f=_0x2fb53f||0x1f4;return function(_0x529053){logger[_0x47fe('0x2e')](_0x529053[_0x47fe('0x2f')]);if(_0x529053['name']){delete _0x529053[_0x47fe('0x30')];}_0x259c1a[_0x47fe('0x1b')](_0x2fb53f)[_0x47fe('0x31')](_0x529053);};}exports['index']=function(_0x2fb732,_0x149342){var _0x5a2d01={},_0x1c21a1={},_0x448899={'count':0x0,'rows':[]};var _0x557b02=_[_0x47fe('0x32')](db[_0x47fe('0x33')][_0x47fe('0x34')],function(_0x1ed268){return{'name':_0x1ed268['fieldName'],'type':_0x1ed268[_0x47fe('0x35')]['key']};});_0x1c21a1[_0x47fe('0x36')]=_[_0x47fe('0x32')](_0x557b02,'name');_0x1c21a1[_0x47fe('0x37')]=_[_0x47fe('0x38')](_0x2fb732[_0x47fe('0x37')]);_0x1c21a1['filters']=_['intersection'](_0x1c21a1[_0x47fe('0x36')],_0x1c21a1[_0x47fe('0x37')]);_0x5a2d01[_0x47fe('0x39')]=_[_0x47fe('0x3a')](_0x1c21a1[_0x47fe('0x36')],qs[_0x47fe('0x3b')](_0x2fb732[_0x47fe('0x37')][_0x47fe('0x3b')]));_0x5a2d01[_0x47fe('0x39')]=_0x5a2d01[_0x47fe('0x39')]['length']?_0x5a2d01[_0x47fe('0x39')]:_0x1c21a1[_0x47fe('0x36')];if(!_0x2fb732[_0x47fe('0x37')]['hasOwnProperty'](_0x47fe('0x3c'))){_0x5a2d01[_0x47fe('0x20')]=qs['limit'](_0x2fb732[_0x47fe('0x37')][_0x47fe('0x20')]);_0x5a2d01[_0x47fe('0x1e')]=qs[_0x47fe('0x1e')](_0x2fb732[_0x47fe('0x37')][_0x47fe('0x1e')]);}_0x5a2d01[_0x47fe('0x3d')]=qs['sort'](_0x2fb732['query'][_0x47fe('0x3e')]);_0x5a2d01['where']=qs[_0x47fe('0x3f')](_['pick'](_0x2fb732['query'],_0x1c21a1[_0x47fe('0x3f')]),_0x557b02);if(_0x2fb732[_0x47fe('0x37')]['filter']){_0x5a2d01[_0x47fe('0x40')]=_[_0x47fe('0x41')](_0x5a2d01[_0x47fe('0x40')],{'$or':_[_0x47fe('0x32')](_0x557b02,function(_0x2466b1){if(_0x2466b1[_0x47fe('0x35')]!=='VIRTUAL'){var _0x3555e2={};_0x3555e2[_0x2466b1[_0x47fe('0x30')]]={'$like':'%'+_0x2fb732[_0x47fe('0x37')][_0x47fe('0x42')]+'%'};return _0x3555e2;}})});}_0x5a2d01=_[_0x47fe('0x41')]({},_0x5a2d01,_0x2fb732[_0x47fe('0x43')]);var _0x545a94={'where':_0x5a2d01['where']};return db[_0x47fe('0x33')][_0x47fe('0x21')](_0x545a94)[_0x47fe('0x28')](function(_0x4a9993){_0x448899[_0x47fe('0x21')]=_0x4a9993;if(_0x2fb732[_0x47fe('0x37')][_0x47fe('0x44')]){_0x5a2d01[_0x47fe('0x45')]=[{'all':!![]}];}return db[_0x47fe('0x33')][_0x47fe('0x46')](_0x5a2d01);})[_0x47fe('0x28')](function(_0x4af6fa){_0x448899[_0x47fe('0x47')]=_0x4af6fa;return _0x448899;})[_0x47fe('0x28')](respondWithFilteredResult(_0x149342,_0x5a2d01))[_0x47fe('0x48')](handleError(_0x149342,null));};exports[_0x47fe('0x49')]=function(_0x2cc8c3,_0x2f6dff){var _0x54e1de={'raw':!![],'where':{'id':_0x2cc8c3[_0x47fe('0x4a')]['id']}},_0xb08a31={};_0xb08a31[_0x47fe('0x36')]=_['keys'](db[_0x47fe('0x33')]['rawAttributes']);_0xb08a31[_0x47fe('0x37')]=_[_0x47fe('0x38')](_0x2cc8c3['query']);_0xb08a31['filters']=_[_0x47fe('0x3a')](_0xb08a31['model'],_0xb08a31['query']);_0x54e1de[_0x47fe('0x39')]=_['intersection'](_0xb08a31[_0x47fe('0x36')],qs[_0x47fe('0x3b')](_0x2cc8c3[_0x47fe('0x37')]['fields']));_0x54e1de[_0x47fe('0x39')]=_0x54e1de[_0x47fe('0x39')][_0x47fe('0x4b')]?_0x54e1de['attributes']:_0xb08a31[_0x47fe('0x36')];if(_0x2cc8c3[_0x47fe('0x37')][_0x47fe('0x44')]){_0x54e1de[_0x47fe('0x45')]=[{'all':!![]}];}_0x54e1de=_[_0x47fe('0x41')]({},_0x54e1de,_0x2cc8c3[_0x47fe('0x43')]);return db[_0x47fe('0x33')][_0x47fe('0x4c')](_0x54e1de)[_0x47fe('0x28')](handleEntityNotFound(_0x2f6dff,null))[_0x47fe('0x28')](respondWithResult(_0x2f6dff,null))[_0x47fe('0x48')](handleError(_0x2f6dff,null));};exports[_0x47fe('0x4d')]=function(_0x44be91,_0xb218d){return db['SquareOdbc'][_0x47fe('0x4d')](_0x44be91[_0x47fe('0x4e')],{})[_0x47fe('0x28')](function(_0x53087b){var _0xe8c536=_0x44be91['user']['get']({'plain':!![]});if(!_0xe8c536)throw new Error(_0x47fe('0x4f'));if(_0xe8c536[_0x47fe('0x50')]===_0x47fe('0x51')){var _0xc75ad0=_0x53087b[_0x47fe('0x29')]({'plain':!![]});var _0xbb0568=_0x47fe('0x2a');return db[_0x47fe('0x52')][_0x47fe('0x4c')]({'where':{'name':_0xbb0568,'userProfileId':_0xe8c536[_0x47fe('0x53')]},'raw':!![]})[_0x47fe('0x28')](function(_0x4b2a1f){if(_0x4b2a1f&&_0x4b2a1f[_0x47fe('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0xc75ad0[_0x47fe('0x30')],'resourceId':_0xc75ad0['id'],'type':_0x4b2a1f[_0x47fe('0x30')],'sectionId':_0x4b2a1f['id']},{})[_0x47fe('0x28')](function(){return _0x53087b;});}else{return _0x53087b;}})[_0x47fe('0x48')](function(_0x10d82e){logger[_0x47fe('0x2e')](_0x47fe('0x55'),_0x10d82e);throw _0x10d82e;});}return _0x53087b;})[_0x47fe('0x28')](respondWithResult(_0xb218d,0xc9))[_0x47fe('0x48')](handleError(_0xb218d,null));};exports[_0x47fe('0x27')]=function(_0x336e82,_0x1e86b4){if(_0x336e82[_0x47fe('0x4e')]['id']){delete _0x336e82[_0x47fe('0x4e')]['id'];}return db[_0x47fe('0x33')]['find']({'where':{'id':_0x336e82['params']['id']}})[_0x47fe('0x28')](handleEntityNotFound(_0x1e86b4,null))[_0x47fe('0x28')](saveUpdates(_0x336e82['body'],null))[_0x47fe('0x28')](respondWithResult(_0x1e86b4,null))['catch'](handleError(_0x1e86b4,null));};exports['destroy']=function(_0x3853f7,_0x263a55){return db['SquareOdbc']['find']({'where':{'id':_0x3853f7[_0x47fe('0x4a')]['id']}})[_0x47fe('0x28')](handleEntityNotFound(_0x263a55,null))[_0x47fe('0x28')](removeEntity(_0x263a55,null))[_0x47fe('0x48')](handleError(_0x263a55,null));};exports[_0x47fe('0x56')]=function(_0x17c20d,_0x48bf19,_0x52b560){var _0x353d73;return db[_0x47fe('0x33')][_0x47fe('0x4c')]({'where':{'id':_0x17c20d['params']['id']},'attributes':['id','dsn']})[_0x47fe('0x28')](handleEntityNotFound(_0x48bf19,null))[_0x47fe('0x28')](function(_0x3da73b){if(_0x3da73b){var _0x3504a2=require(_0x47fe('0x57'))();_0x3504a2[_0x47fe('0x58')](_0x3da73b[_0x47fe('0x59')]);_0x3504a2[_0x47fe('0x5a')]();return _0x3da73b;}})['then'](respondWithResult(_0x48bf19,null))[_0x47fe('0x48')](handleError(_0x48bf19,null));}; \ No newline at end of file +var _0x6112=['attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','dsn','odbc','openSync','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','destroy','then','get','ODBC','end','error','stack','name','send','index','map','SquareOdbc','rawAttributes','type','model','query','keys','filters','intersection','fields','length'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x6112,0xd8));var _0x2611=function(_0x4d0630,_0x558c89){_0x4d0630=_0x4d0630-0x0;var _0x1b6475=_0x6112[_0x4d0630];return _0x1b6475;};'use strict';var emlformat=require(_0x2611('0x0'));var rimraf=require(_0x2611('0x1'));var zipdir=require(_0x2611('0x2'));var jsonpatch=require(_0x2611('0x3'));var rp=require(_0x2611('0x4'));var moment=require(_0x2611('0x5'));var BPromise=require(_0x2611('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2611('0x7'));var sox=require(_0x2611('0x8'));var csv=require(_0x2611('0x9'));var ejs=require(_0x2611('0xa'));var fs=require('fs');var fs_extra=require(_0x2611('0xb'));var _=require(_0x2611('0xc'));var squel=require(_0x2611('0xd'));var crypto=require(_0x2611('0xe'));var jsforce=require(_0x2611('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x2611('0x9'));var querystring=require(_0x2611('0x10'));var Papa=require(_0x2611('0x11'));var Redis=require(_0x2611('0x12'));var authService=require(_0x2611('0x13'));var qs=require(_0x2611('0x14'));var as=require(_0x2611('0x15'));var hardwareService=require(_0x2611('0x16'));var logger=require(_0x2611('0x17'))(_0x2611('0x18'));var utils=require('../../config/utils');var config=require(_0x2611('0x19'));var licenseUtil=require(_0x2611('0x1a'));var db=require(_0x2611('0x1b'))['db'];function respondWithStatusCode(_0x35f397,_0x3b4523){_0x3b4523=_0x3b4523||0xcc;return function(_0x2b423b){if(_0x2b423b){return _0x35f397[_0x2611('0x1c')](_0x3b4523);}return _0x35f397[_0x2611('0x1d')](_0x3b4523)['end']();};}function respondWithResult(_0x4deec9,_0x38efb4){_0x38efb4=_0x38efb4||0xc8;return function(_0x491016){if(_0x491016){return _0x4deec9[_0x2611('0x1d')](_0x38efb4)[_0x2611('0x1e')](_0x491016);}};}function respondWithFilteredResult(_0x26b752,_0x314408){return function(_0x47e211){if(_0x47e211){var _0x1a6f4d=typeof _0x314408[_0x2611('0x1f')]===_0x2611('0x20')&&typeof _0x314408[_0x2611('0x21')]===_0x2611('0x20');var _0x579d38=_0x47e211['count'];var _0x3049e9=_0x1a6f4d?0x0:_0x314408[_0x2611('0x1f')];var _0x18b6bf=_0x1a6f4d?_0x47e211[_0x2611('0x22')]:_0x314408[_0x2611('0x1f')]+_0x314408[_0x2611('0x21')];var _0x2dde38;if(_0x18b6bf>=_0x579d38){_0x18b6bf=_0x579d38;_0x2dde38=0xc8;}else{_0x2dde38=0xce;}_0x26b752[_0x2611('0x1d')](_0x2dde38);return _0x26b752['set'](_0x2611('0x23'),_0x3049e9+'-'+_0x18b6bf+'/'+_0x579d38)[_0x2611('0x1e')](_0x47e211);}return null;};}function patchUpdates(_0x1d16db){return function(_0x3da0d){try{jsonpatch['apply'](_0x3da0d,_0x1d16db,!![]);}catch(_0xc4f8d1){return BPromise[_0x2611('0x24')](_0xc4f8d1);}return _0x3da0d[_0x2611('0x25')]();};}function saveUpdates(_0x534431,_0x1f958d){return function(_0x2922f8){if(_0x2922f8){return _0x2922f8[_0x2611('0x26')](_0x534431)['then'](function(_0x106b69){return _0x106b69;});}return null;};}function removeEntity(_0xa92210,_0x2a7bcd){return function(_0x2647b8){if(_0x2647b8){return _0x2647b8[_0x2611('0x27')]()[_0x2611('0x28')](function(){var _0x1c37bd=_0x2647b8[_0x2611('0x29')]({'plain':!![]});var _0xefe042=_0x2611('0x2a');return db['UserProfileResource'][_0x2611('0x27')]({'where':{'type':_0xefe042,'resourceId':_0x1c37bd['id']}})[_0x2611('0x28')](function(){return _0x2647b8;});})[_0x2611('0x28')](function(){_0xa92210[_0x2611('0x1d')](0xcc)[_0x2611('0x2b')]();});}};}function handleEntityNotFound(_0x2d33ca,_0x55508e){return function(_0x40746e){if(!_0x40746e){_0x2d33ca[_0x2611('0x1c')](0x194);}return _0x40746e;};}function handleError(_0x278429,_0x2c5f0b){_0x2c5f0b=_0x2c5f0b||0x1f4;return function(_0x25e130){logger[_0x2611('0x2c')](_0x25e130[_0x2611('0x2d')]);if(_0x25e130['name']){delete _0x25e130[_0x2611('0x2e')];}_0x278429[_0x2611('0x1d')](_0x2c5f0b)[_0x2611('0x2f')](_0x25e130);};}exports[_0x2611('0x30')]=function(_0x3d0f46,_0xfb4d86){var _0x5d5585={},_0x33f5a4={},_0x25484a={'count':0x0,'rows':[]};var _0x2ea03d=_[_0x2611('0x31')](db[_0x2611('0x32')][_0x2611('0x33')],function(_0x359601){return{'name':_0x359601['fieldName'],'type':_0x359601[_0x2611('0x34')]['key']};});_0x33f5a4[_0x2611('0x35')]=_[_0x2611('0x31')](_0x2ea03d,_0x2611('0x2e'));_0x33f5a4[_0x2611('0x36')]=_[_0x2611('0x37')](_0x3d0f46['query']);_0x33f5a4[_0x2611('0x38')]=_[_0x2611('0x39')](_0x33f5a4[_0x2611('0x35')],_0x33f5a4[_0x2611('0x36')]);_0x5d5585['attributes']=_[_0x2611('0x39')](_0x33f5a4[_0x2611('0x35')],qs[_0x2611('0x3a')](_0x3d0f46[_0x2611('0x36')]['fields']));_0x5d5585['attributes']=_0x5d5585['attributes'][_0x2611('0x3b')]?_0x5d5585[_0x2611('0x3c')]:_0x33f5a4[_0x2611('0x35')];if(!_0x3d0f46[_0x2611('0x36')][_0x2611('0x3d')](_0x2611('0x3e'))){_0x5d5585[_0x2611('0x21')]=qs['limit'](_0x3d0f46['query'][_0x2611('0x21')]);_0x5d5585[_0x2611('0x1f')]=qs[_0x2611('0x1f')](_0x3d0f46['query']['offset']);}_0x5d5585[_0x2611('0x3f')]=qs['sort'](_0x3d0f46['query'][_0x2611('0x40')]);_0x5d5585[_0x2611('0x41')]=qs[_0x2611('0x38')](_[_0x2611('0x42')](_0x3d0f46[_0x2611('0x36')],_0x33f5a4['filters']),_0x2ea03d);if(_0x3d0f46[_0x2611('0x36')][_0x2611('0x43')]){_0x5d5585['where']=_['merge'](_0x5d5585[_0x2611('0x41')],{'$or':_[_0x2611('0x31')](_0x2ea03d,function(_0xb95fb2){if(_0xb95fb2['type']!=='VIRTUAL'){var _0x5965c4={};_0x5965c4[_0xb95fb2['name']]={'$like':'%'+_0x3d0f46[_0x2611('0x36')]['filter']+'%'};return _0x5965c4;}})});}_0x5d5585=_[_0x2611('0x44')]({},_0x5d5585,_0x3d0f46[_0x2611('0x45')]);var _0x19ccd8={'where':_0x5d5585[_0x2611('0x41')]};return db[_0x2611('0x32')][_0x2611('0x22')](_0x19ccd8)[_0x2611('0x28')](function(_0x5d2246){_0x25484a[_0x2611('0x22')]=_0x5d2246;if(_0x3d0f46[_0x2611('0x36')]['includeAll']){_0x5d5585[_0x2611('0x46')]=[{'all':!![]}];}return db[_0x2611('0x32')][_0x2611('0x47')](_0x5d5585);})[_0x2611('0x28')](function(_0x2ca0b7){_0x25484a[_0x2611('0x48')]=_0x2ca0b7;return _0x25484a;})[_0x2611('0x28')](respondWithFilteredResult(_0xfb4d86,_0x5d5585))[_0x2611('0x49')](handleError(_0xfb4d86,null));};exports[_0x2611('0x4a')]=function(_0x96bc65,_0x9684f2){var _0x233089={'raw':!![],'where':{'id':_0x96bc65[_0x2611('0x4b')]['id']}},_0x54011d={};_0x54011d['model']=_[_0x2611('0x37')](db[_0x2611('0x32')][_0x2611('0x33')]);_0x54011d[_0x2611('0x36')]=_['keys'](_0x96bc65['query']);_0x54011d[_0x2611('0x38')]=_['intersection'](_0x54011d[_0x2611('0x35')],_0x54011d[_0x2611('0x36')]);_0x233089[_0x2611('0x3c')]=_['intersection'](_0x54011d[_0x2611('0x35')],qs[_0x2611('0x3a')](_0x96bc65['query'][_0x2611('0x3a')]));_0x233089[_0x2611('0x3c')]=_0x233089[_0x2611('0x3c')]['length']?_0x233089[_0x2611('0x3c')]:_0x54011d[_0x2611('0x35')];if(_0x96bc65[_0x2611('0x36')][_0x2611('0x4c')]){_0x233089['include']=[{'all':!![]}];}_0x233089=_['merge']({},_0x233089,_0x96bc65[_0x2611('0x45')]);return db[_0x2611('0x32')][_0x2611('0x4d')](_0x233089)[_0x2611('0x28')](handleEntityNotFound(_0x9684f2,null))[_0x2611('0x28')](respondWithResult(_0x9684f2,null))[_0x2611('0x49')](handleError(_0x9684f2,null));};exports[_0x2611('0x4e')]=function(_0x3371c4,_0x38f521){return db[_0x2611('0x32')]['create'](_0x3371c4[_0x2611('0x4f')],{})[_0x2611('0x28')](function(_0x96fd60){var _0x3ad322=_0x3371c4[_0x2611('0x50')][_0x2611('0x29')]({'plain':!![]});if(!_0x3ad322)throw new Error(_0x2611('0x51'));if(_0x3ad322[_0x2611('0x52')]===_0x2611('0x50')){var _0x4afd25=_0x96fd60[_0x2611('0x29')]({'plain':!![]});var _0x2ba670=_0x2611('0x2a');return db[_0x2611('0x53')][_0x2611('0x4d')]({'where':{'name':_0x2ba670,'userProfileId':_0x3ad322[_0x2611('0x54')]},'raw':!![]})[_0x2611('0x28')](function(_0x3ecde6){if(_0x3ecde6&&_0x3ecde6['autoAssociation']===0x0){return db[_0x2611('0x55')]['create']({'name':_0x4afd25[_0x2611('0x2e')],'resourceId':_0x4afd25['id'],'type':_0x3ecde6[_0x2611('0x2e')],'sectionId':_0x3ecde6['id']},{})[_0x2611('0x28')](function(){return _0x96fd60;});}else{return _0x96fd60;}})[_0x2611('0x49')](function(_0x5e8b9f){logger[_0x2611('0x2c')](_0x2611('0x56'),_0x5e8b9f);throw _0x5e8b9f;});}return _0x96fd60;})[_0x2611('0x28')](respondWithResult(_0x38f521,0xc9))[_0x2611('0x49')](handleError(_0x38f521,null));};exports['update']=function(_0x12d286,_0x35e0bc){if(_0x12d286[_0x2611('0x4f')]['id']){delete _0x12d286['body']['id'];}return db['SquareOdbc'][_0x2611('0x4d')]({'where':{'id':_0x12d286[_0x2611('0x4b')]['id']}})[_0x2611('0x28')](handleEntityNotFound(_0x35e0bc,null))[_0x2611('0x28')](saveUpdates(_0x12d286[_0x2611('0x4f')],null))['then'](respondWithResult(_0x35e0bc,null))[_0x2611('0x49')](handleError(_0x35e0bc,null));};exports[_0x2611('0x27')]=function(_0x3cec8d,_0x418893){return db[_0x2611('0x32')][_0x2611('0x4d')]({'where':{'id':_0x3cec8d[_0x2611('0x4b')]['id']}})[_0x2611('0x28')](handleEntityNotFound(_0x418893,null))[_0x2611('0x28')](removeEntity(_0x418893,null))['catch'](handleError(_0x418893,null));};exports[_0x2611('0x57')]=function(_0x18d35a,_0xe73bd4,_0x4f4317){var _0x6e82df;return db[_0x2611('0x32')][_0x2611('0x4d')]({'where':{'id':_0x18d35a[_0x2611('0x4b')]['id']},'attributes':['id',_0x2611('0x58')]})[_0x2611('0x28')](handleEntityNotFound(_0xe73bd4,null))['then'](function(_0x260a6e){if(_0x260a6e){var _0x49b52b=require(_0x2611('0x59'))();_0x49b52b[_0x2611('0x5a')](_0x260a6e[_0x2611('0x58')]);_0x49b52b[_0x2611('0x5b')]();return _0x260a6e;}})[_0x2611('0x28')](respondWithResult(_0xe73bd4,null))[_0x2611('0x49')](handleError(_0xe73bd4,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index bb882f9..3b2a173 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 _0x1213=['bluebird','path','rimraf','../../config/environment','./squareOdbc.attributes','exports','define','square_odbc','lodash','util','api'];(function(_0x477c9e,_0x3a5b92){var _0x3dc0e4=function(_0x16c08b){while(--_0x16c08b){_0x477c9e['push'](_0x477c9e['shift']());}};_0x3dc0e4(++_0x3a5b92);}(_0x1213,0xb8));var _0x3121=function(_0x447725,_0x49753b){_0x447725=_0x447725-0x0;var _0x399167=_0x1213[_0x447725];return _0x399167;};'use strict';var _=require(_0x3121('0x0'));var util=require(_0x3121('0x1'));var logger=require('../../config/logger')(_0x3121('0x2'));var moment=require('moment');var BPromise=require(_0x3121('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3121('0x4'));var rimraf=require(_0x3121('0x5'));var config=require(_0x3121('0x6'));var attributes=require(_0x3121('0x7'));module[_0x3121('0x8')]=function(_0x516782,_0x2965db){return _0x516782[_0x3121('0x9')]('SquareOdbc',attributes,{'tableName':_0x3121('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcd8e=['square_odbc','api','moment','bluebird','path','./squareOdbc.attributes','exports','define'];(function(_0x397cfb,_0xb8f317){var _0x15fed9=function(_0x3eba43){while(--_0x3eba43){_0x397cfb['push'](_0x397cfb['shift']());}};_0x15fed9(++_0xb8f317);}(_0xcd8e,0xf1));var _0xecd8=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xcd8e[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xecd8('0x0'));var moment=require(_0xecd8('0x1'));var BPromise=require(_0xecd8('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xecd8('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xecd8('0x4'));module[_0xecd8('0x5')]=function(_0x2b500f,_0x2f2dc1){return _0x2b500f[_0xecd8('0x6')]('SquareOdbc',attributes,{'tableName':_0xecd8('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index 22555b7..ac6e9fe 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 _0x5b81=['attributes','include','map','model','debug','lodash','moment','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','SquareOdbc,\x20%s,\x20%s','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ShowSquareOdbc','SquareOdbc','find','options','raw','where'];(function(_0x36eb8d,_0x1a4ee5){var _0x271aab=function(_0x12d1fb){while(--_0x12d1fb){_0x36eb8d['push'](_0x36eb8d['shift']());}};_0x271aab(++_0x1a4ee5);}(_0x5b81,0x13b));var _0x15b8=function(_0x4c15f1,_0x2f056c){_0x4c15f1=_0x4c15f1-0x0;var _0xc81295=_0x5b81[_0x4c15f1];return _0xc81295;};'use strict';var _=require(_0x15b8('0x0'));var util=require('util');var moment=require(_0x15b8('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x15b8('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x15b8('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x15b8('0x4'));var jayson=require(_0x15b8('0x5'));var client=jayson[_0x15b8('0x6')][_0x15b8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5f36d5,_0x251205,_0x4b4197){return new BPromise(function(_0x36d1e2,_0x2127c3){return client[_0x15b8('0x8')](_0x5f36d5,_0x4b4197)[_0x15b8('0x9')](function(_0x5cb2d5){logger[_0x15b8('0xa')](_0x15b8('0xb'),_0x251205,'request\x20sent');logger['debug'](_0x15b8('0xc'),_0x251205,_0x15b8('0xd'),JSON[_0x15b8('0xe')](_0x5cb2d5));if(_0x5cb2d5[_0x15b8('0xf')]){if(_0x5cb2d5['error'][_0x15b8('0x10')]===0x1f4){logger[_0x15b8('0xf')](_0x15b8('0xb'),_0x251205,_0x5cb2d5[_0x15b8('0xf')][_0x15b8('0x11')]);return _0x2127c3(_0x5cb2d5[_0x15b8('0xf')]['message']);}logger[_0x15b8('0xf')](_0x15b8('0xb'),_0x251205,_0x5cb2d5[_0x15b8('0xf')][_0x15b8('0x11')]);return _0x36d1e2(_0x5cb2d5[_0x15b8('0xf')][_0x15b8('0x11')]);}else{logger['info']('SquareOdbc,\x20%s,\x20%s',_0x251205,_0x15b8('0xd'));_0x36d1e2(_0x5cb2d5[_0x15b8('0x12')][_0x15b8('0x11')]);}})[_0x15b8('0x13')](function(_0x54fb21){logger[_0x15b8('0xf')](_0x15b8('0xb'),_0x251205,_0x54fb21);_0x2127c3(_0x54fb21);});});}exports[_0x15b8('0x14')]=function(_0x54be04){var _0x571aa6=this;return new Promise(function(_0xedd58d,_0x432b1f){return db[_0x15b8('0x15')][_0x15b8('0x16')]({'raw':_0x54be04[_0x15b8('0x17')]?_0x54be04['options'][_0x15b8('0x18')]===undefined?!![]:![]:!![],'where':_0x54be04[_0x15b8('0x17')]?_0x54be04['options'][_0x15b8('0x19')]||null:null,'attributes':_0x54be04[_0x15b8('0x17')]?_0x54be04[_0x15b8('0x17')][_0x15b8('0x1a')]||null:null,'include':_0x54be04[_0x15b8('0x17')]?_0x54be04[_0x15b8('0x17')][_0x15b8('0x1b')]?_[_0x15b8('0x1c')](_0x54be04['options'][_0x15b8('0x1b')],function(_0x51c611){return{'model':db[_0x51c611['model']],'as':_0x51c611['as'],'attributes':_0x51c611[_0x15b8('0x1a')],'include':_0x51c611[_0x15b8('0x1b')]?_['map'](_0x51c611[_0x15b8('0x1b')],function(_0x222ae7){return{'model':db[_0x222ae7[_0x15b8('0x1d')]],'as':_0x222ae7['as'],'attributes':_0x222ae7[_0x15b8('0x1a')],'include':_0x222ae7[_0x15b8('0x1b')]?_[_0x15b8('0x1c')](_0x222ae7[_0x15b8('0x1b')],function(_0x511729){return{'model':db[_0x511729[_0x15b8('0x1d')]],'as':_0x511729['as'],'attributes':_0x511729[_0x15b8('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x15b8('0x9')](function(_0x4ba9a4){logger[_0x15b8('0xa')]('ShowSquareOdbc',_0x54be04);logger[_0x15b8('0x1e')](_0x15b8('0x14'),_0x54be04,JSON[_0x15b8('0xe')](_0x4ba9a4));_0xedd58d(_0x4ba9a4);})[_0x15b8('0x13')](function(_0x3514e3){logger[_0x15b8('0xf')](_0x15b8('0x14'),_0x3514e3[_0x15b8('0x11')],_0x54be04);_0x432b1f(_0x571aa6[_0x15b8('0xf')](0x1f4,_0x3514e3['message']));});});}; \ No newline at end of file +var _0xd368=['message','info','catch','ShowSquareOdbc','find','options','raw','where','include','model','attributes','map','debug','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','request\x20sent','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareOdbc,\x20%s,\x20%s'];(function(_0x4d96d5,_0x3e6d17){var _0x438e44=function(_0x36e18e){while(--_0x36e18e){_0x4d96d5['push'](_0x4d96d5['shift']());}};_0x438e44(++_0x3e6d17);}(_0xd368,0x6a));var _0x8d36=function(_0x35c6df,_0x53ddc5){_0x35c6df=_0x35c6df-0x0;var _0x4ceda3=_0xd368[_0x35c6df];return _0x4ceda3;};'use strict';var _=require(_0x8d36('0x0'));var util=require(_0x8d36('0x1'));var moment=require('moment');var BPromise=require(_0x8d36('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8d36('0x3'));var db=require(_0x8d36('0x4'))['db'];var utils=require(_0x8d36('0x5'));var logger=require(_0x8d36('0x6'))(_0x8d36('0x7'));var config=require(_0x8d36('0x8'));var jayson=require(_0x8d36('0x9'));var client=jayson['client'][_0x8d36('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x53a9db,_0xb183a7,_0x7b387b){return new BPromise(function(_0x4b8f5e,_0x444667){return client['request'](_0x53a9db,_0x7b387b)[_0x8d36('0xb')](function(_0x16339a){logger['info']('SquareOdbc,\x20%s,\x20%s',_0xb183a7,_0x8d36('0xc'));logger['debug'](_0x8d36('0xd'),_0xb183a7,'request\x20sent',JSON[_0x8d36('0xe')](_0x16339a));if(_0x16339a['error']){if(_0x16339a[_0x8d36('0xf')][_0x8d36('0x10')]===0x1f4){logger['error'](_0x8d36('0x11'),_0xb183a7,_0x16339a[_0x8d36('0xf')][_0x8d36('0x12')]);return _0x444667(_0x16339a[_0x8d36('0xf')][_0x8d36('0x12')]);}logger[_0x8d36('0xf')](_0x8d36('0x11'),_0xb183a7,_0x16339a['error'][_0x8d36('0x12')]);return _0x4b8f5e(_0x16339a[_0x8d36('0xf')][_0x8d36('0x12')]);}else{logger[_0x8d36('0x13')](_0x8d36('0x11'),_0xb183a7,'request\x20sent');_0x4b8f5e(_0x16339a['result'][_0x8d36('0x12')]);}})[_0x8d36('0x14')](function(_0x550ada){logger[_0x8d36('0xf')](_0x8d36('0x11'),_0xb183a7,_0x550ada);_0x444667(_0x550ada);});});}exports[_0x8d36('0x15')]=function(_0x183305){var _0x4e8454=this;return new Promise(function(_0x270411,_0x3dce0a){return db['SquareOdbc'][_0x8d36('0x16')]({'raw':_0x183305[_0x8d36('0x17')]?_0x183305[_0x8d36('0x17')][_0x8d36('0x18')]===undefined?!![]:![]:!![],'where':_0x183305[_0x8d36('0x17')]?_0x183305[_0x8d36('0x17')][_0x8d36('0x19')]||null:null,'attributes':_0x183305[_0x8d36('0x17')]?_0x183305[_0x8d36('0x17')]['attributes']||null:null,'include':_0x183305[_0x8d36('0x17')]?_0x183305[_0x8d36('0x17')][_0x8d36('0x1a')]?_['map'](_0x183305[_0x8d36('0x17')][_0x8d36('0x1a')],function(_0x48c1af){return{'model':db[_0x48c1af[_0x8d36('0x1b')]],'as':_0x48c1af['as'],'attributes':_0x48c1af[_0x8d36('0x1c')],'include':_0x48c1af['include']?_[_0x8d36('0x1d')](_0x48c1af[_0x8d36('0x1a')],function(_0x4f5000){return{'model':db[_0x4f5000['model']],'as':_0x4f5000['as'],'attributes':_0x4f5000[_0x8d36('0x1c')],'include':_0x4f5000[_0x8d36('0x1a')]?_[_0x8d36('0x1d')](_0x4f5000['include'],function(_0x545eb4){return{'model':db[_0x545eb4['model']],'as':_0x545eb4['as'],'attributes':_0x545eb4[_0x8d36('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x50500b){logger['info'](_0x8d36('0x15'),_0x183305);logger[_0x8d36('0x1e')]('ShowSquareOdbc',_0x183305,JSON[_0x8d36('0xe')](_0x50500b));_0x270411(_0x50500b);})[_0x8d36('0x14')](function(_0x4d85bd){logger[_0x8d36('0xf')]('ShowSquareOdbc',_0x4d85bd['message'],_0x183305);_0x3dce0a(_0x4e8454[_0x8d36('0xf')](0x1f4,_0x4d85bd[_0x8d36('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 9a632a0..0399d39 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 _0x56c8=['/:id','/:id/users','getUsers','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x26b80e,_0x5c9333){var _0x84a8a8=function(_0x2e5b4a){while(--_0x2e5b4a){_0x26b80e['push'](_0x26b80e['shift']());}};_0x84a8a8(++_0x5c9333);}(_0x56c8,0x12f));var _0x856c=function(_0x1c516b,_0x543355){_0x1c516b=_0x1c516b-0x0;var _0x3aa323=_0x56c8[_0x1c516b];return _0x3aa323;};'use strict';var multer=require(_0x856c('0x0'));var util=require(_0x856c('0x1'));var path=require(_0x856c('0x2'));var timeout=require(_0x856c('0x3'));var express=require('express');var router=express[_0x856c('0x4')]();var fs_extra=require(_0x856c('0x5'));var auth=require(_0x856c('0x6'));var interaction=require(_0x856c('0x7'));var config=require(_0x856c('0x8'));var controller=require('./squareProject.controller');router[_0x856c('0x9')]('/',auth[_0x856c('0xa')](),controller[_0x856c('0xb')]);router[_0x856c('0x9')](_0x856c('0xc'),auth[_0x856c('0xa')](),controller['show']);router['get'](_0x856c('0xd'),auth[_0x856c('0xa')](),controller[_0x856c('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x856c('0xf')](_0x856c('0xd'),auth[_0x856c('0xa')](),controller['addUsers']);router[_0x856c('0x10')](_0x856c('0xc'),auth['isAuthenticated'](),controller[_0x856c('0x11')]);router[_0x856c('0x12')](_0x856c('0xc'),auth[_0x856c('0xa')](),controller[_0x856c('0x13')]);router[_0x856c('0x12')](_0x856c('0xd'),auth[_0x856c('0xa')](),controller['removeUsers']);module[_0x856c('0x14')]=router; \ No newline at end of file +var _0x3ace=['isAuthenticated','getUsers','create','post','addUsers','put','update','delete','destroy','removeUsers','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./squareProject.controller','index','/:id','show','get','/:id/users'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x3ace,0xda));var _0xe3ac=function(_0xa5f29d,_0xab1442){_0xa5f29d=_0xa5f29d-0x0;var _0x4f61d3=_0x3ace[_0xa5f29d];return _0x4f61d3;};'use strict';var multer=require('multer');var util=require(_0xe3ac('0x0'));var path=require(_0xe3ac('0x1'));var timeout=require(_0xe3ac('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe3ac('0x3'));var auth=require(_0xe3ac('0x4'));var interaction=require(_0xe3ac('0x5'));var config=require('../../config/environment');var controller=require(_0xe3ac('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xe3ac('0x7')]);router['get'](_0xe3ac('0x8'),auth['isAuthenticated'](),controller[_0xe3ac('0x9')]);router[_0xe3ac('0xa')](_0xe3ac('0xb'),auth[_0xe3ac('0xc')](),controller[_0xe3ac('0xd')]);router['post']('/',auth[_0xe3ac('0xc')](),controller[_0xe3ac('0xe')]);router[_0xe3ac('0xf')]('/:id/users',auth[_0xe3ac('0xc')](),controller[_0xe3ac('0x10')]);router[_0xe3ac('0x11')](_0xe3ac('0x8'),auth[_0xe3ac('0xc')](),controller[_0xe3ac('0x12')]);router[_0xe3ac('0x13')](_0xe3ac('0x8'),auth[_0xe3ac('0xc')](),controller[_0xe3ac('0x14')]);router[_0xe3ac('0x13')](_0xe3ac('0xb'),auth[_0xe3ac('0xc')](),controller[_0xe3ac('0x15')]);module[_0xe3ac('0x16')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 2406950..1a5b307 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 _0xef4d=['getDataValue','preproduction','toString','utf8','production','DATE','sequelize','exports','name','STRING','TEXT','BLOB','long'];(function(_0x1a64da,_0x13a6f5){var _0x37eb35=function(_0x1a638a){while(--_0x1a638a){_0x1a64da['push'](_0x1a64da['shift']());}};_0x37eb35(++_0x13a6f5);}(_0xef4d,0xaf));var _0xdef4=function(_0x369151,_0x179f72){_0x369151=_0x369151-0x0;var _0x4292d5=_0xef4d[_0x369151];return _0x4292d5;};'use strict';var Sequelize=require(_0xdef4('0x0'));module[_0xdef4('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xdef4('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xdef4('0x3')]},'notes':{'type':Sequelize[_0xdef4('0x4')]},'preproduction':{'type':Sequelize[_0xdef4('0x5')](_0xdef4('0x6')),'get':function(){if(this[_0xdef4('0x7')](_0xdef4('0x8'))){return this[_0xdef4('0x7')](_0xdef4('0x8'))[_0xdef4('0x9')](_0xdef4('0xa'));}}},'production':{'type':Sequelize[_0xdef4('0x5')](_0xdef4('0x6')),'get':function(){if(this[_0xdef4('0x7')](_0xdef4('0xb'))){return this['getDataValue'](_0xdef4('0xb'))[_0xdef4('0x9')](_0xdef4('0xa'));}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0xdef4('0xc')]}}; \ No newline at end of file +var _0x7899=['BLOB','getDataValue','preproduction','long','production','toString','DATE','exports','name','STRING','TEXT'];(function(_0x513c06,_0x3b6f47){var _0x4dce1e=function(_0x387641){while(--_0x387641){_0x513c06['push'](_0x513c06['shift']());}};_0x4dce1e(++_0x3b6f47);}(_0x7899,0x167));var _0x9789=function(_0x4653f7,_0x3d3ae3){_0x4653f7=_0x4653f7-0x0;var _0x5454da=_0x7899[_0x4653f7];return _0x5454da;};'use strict';var Sequelize=require('sequelize');module[_0x9789('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x9789('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0x9789('0x2')]},'notes':{'type':Sequelize[_0x9789('0x3')]},'preproduction':{'type':Sequelize[_0x9789('0x4')]('long'),'get':function(){if(this[_0x9789('0x5')](_0x9789('0x6'))){return this[_0x9789('0x5')]('preproduction')['toString']('utf8');}}},'production':{'type':Sequelize[_0x9789('0x4')](_0x9789('0x7')),'get':function(){if(this[_0x9789('0x5')](_0x9789('0x8'))){return this[_0x9789('0x5')](_0x9789('0x8'))[_0x9789('0x9')]('utf8');}}},'savedAt':{'type':Sequelize[_0x9789('0xa')]},'publishedAt':{'type':Sequelize[_0x9789('0xa')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index e95aa43..9d9762b 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 _0x7fb3=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./squareProject.socket','status','end','json','offset','undefined','count','limit','Content-Range','apply','save','update','then','destroy','get','SquareProjects','sendStatus','error','stack','name','send','index','map','SquareProject','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','order','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis'];(function(_0x573500,_0x171587){var _0x7a64e4=function(_0x208cb4){while(--_0x208cb4){_0x573500['push'](_0x573500['shift']());}};_0x7a64e4(++_0x171587);}(_0x7fb3,0x1d3));var _0x37fb=function(_0x6173fc,_0x32aadf){_0x6173fc=_0x6173fc-0x0;var _0x965fbe=_0x7fb3[_0x6173fc];return _0x965fbe;};'use strict';var emlformat=require(_0x37fb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x37fb('0x1'));var jsonpatch=require(_0x37fb('0x2'));var rp=require('request-promise');var moment=require(_0x37fb('0x3'));var BPromise=require(_0x37fb('0x4'));var Mustache=require(_0x37fb('0x5'));var util=require('util');var path=require(_0x37fb('0x6'));var sox=require(_0x37fb('0x7'));var csv=require(_0x37fb('0x8'));var ejs=require(_0x37fb('0x9'));var fs=require('fs');var fs_extra=require(_0x37fb('0xa'));var _=require(_0x37fb('0xb'));var squel=require(_0x37fb('0xc'));var crypto=require(_0x37fb('0xd'));var jsforce=require(_0x37fb('0xe'));var deskjs=require(_0x37fb('0xf'));var toCsv=require(_0x37fb('0x8'));var querystring=require(_0x37fb('0x10'));var Papa=require('papaparse');var Redis=require(_0x37fb('0x11'));var authService=require(_0x37fb('0x12'));var qs=require(_0x37fb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x37fb('0x14'));var logger=require(_0x37fb('0x15'))(_0x37fb('0x16'));var utils=require(_0x37fb('0x17'));var config=require(_0x37fb('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x37fb('0x19'))['db'];config[_0x37fb('0x1a')]=_['defaults'](config[_0x37fb('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x37fb('0x1b'))(new Redis(config[_0x37fb('0x1a')]));require(_0x37fb('0x1c'))['register'](socket);function respondWithStatusCode(_0x24cc3e,_0x30af8b){_0x30af8b=_0x30af8b||0xcc;return function(_0x7f7e35){if(_0x7f7e35){return _0x24cc3e['sendStatus'](_0x30af8b);}return _0x24cc3e[_0x37fb('0x1d')](_0x30af8b)[_0x37fb('0x1e')]();};}function respondWithResult(_0x2f5910,_0x4a46cc){_0x4a46cc=_0x4a46cc||0xc8;return function(_0x16481b){if(_0x16481b){return _0x2f5910['status'](_0x4a46cc)[_0x37fb('0x1f')](_0x16481b);}};}function respondWithFilteredResult(_0x50ab17,_0x19e828){return function(_0x316cd3){if(_0x316cd3){var _0x31e03a=typeof _0x19e828[_0x37fb('0x20')]===_0x37fb('0x21')&&typeof _0x19e828['limit']===_0x37fb('0x21');var _0x1b2dbe=_0x316cd3[_0x37fb('0x22')];var _0x32099a=_0x31e03a?0x0:_0x19e828[_0x37fb('0x20')];var _0x1e230b=_0x31e03a?_0x316cd3[_0x37fb('0x22')]:_0x19e828[_0x37fb('0x20')]+_0x19e828[_0x37fb('0x23')];var _0x574bd3;if(_0x1e230b>=_0x1b2dbe){_0x1e230b=_0x1b2dbe;_0x574bd3=0xc8;}else{_0x574bd3=0xce;}_0x50ab17[_0x37fb('0x1d')](_0x574bd3);return _0x50ab17['set'](_0x37fb('0x24'),_0x32099a+'-'+_0x1e230b+'/'+_0x1b2dbe)[_0x37fb('0x1f')](_0x316cd3);}return null;};}function patchUpdates(_0x25d9e5){return function(_0xe1594f){try{jsonpatch[_0x37fb('0x25')](_0xe1594f,_0x25d9e5,!![]);}catch(_0x3b5e06){return BPromise['reject'](_0x3b5e06);}return _0xe1594f[_0x37fb('0x26')]();};}function saveUpdates(_0x47f950,_0x4e1479){return function(_0x10e3f4){if(_0x10e3f4){return _0x10e3f4[_0x37fb('0x27')](_0x47f950)[_0x37fb('0x28')](function(_0x313c0c){return _0x313c0c;});}return null;};}function removeEntity(_0x256606,_0x38ca6e){return function(_0x1f7fac){if(_0x1f7fac){return _0x1f7fac[_0x37fb('0x29')]()[_0x37fb('0x28')](function(){var _0x41690d=_0x1f7fac[_0x37fb('0x2a')]({'plain':!![]});var _0x6b750e=_0x37fb('0x2b');return db['UserProfileResource'][_0x37fb('0x29')]({'where':{'type':_0x6b750e,'resourceId':_0x41690d['id']}})[_0x37fb('0x28')](function(){return _0x1f7fac;});})['then'](function(){_0x256606[_0x37fb('0x1d')](0xcc)[_0x37fb('0x1e')]();});}};}function handleEntityNotFound(_0x67d467,_0x1af59a){return function(_0x2f7719){if(!_0x2f7719){_0x67d467[_0x37fb('0x2c')](0x194);}return _0x2f7719;};}function handleError(_0x2b7639,_0x330f83){_0x330f83=_0x330f83||0x1f4;return function(_0x22f668){logger[_0x37fb('0x2d')](_0x22f668[_0x37fb('0x2e')]);if(_0x22f668[_0x37fb('0x2f')]){delete _0x22f668[_0x37fb('0x2f')];}_0x2b7639[_0x37fb('0x1d')](_0x330f83)[_0x37fb('0x30')](_0x22f668);};}exports[_0x37fb('0x31')]=function(_0x5e431c,_0x23c9b6){var _0xdf67fd={},_0x257048={},_0x350213={'count':0x0,'rows':[]};var _0x101fbc=_[_0x37fb('0x32')](db[_0x37fb('0x33')][_0x37fb('0x34')],function(_0x191f01){return{'name':_0x191f01[_0x37fb('0x35')],'type':_0x191f01[_0x37fb('0x36')]['key']};});_0x257048[_0x37fb('0x37')]=_[_0x37fb('0x32')](_0x101fbc,_0x37fb('0x2f'));_0x257048[_0x37fb('0x38')]=_[_0x37fb('0x39')](_0x5e431c[_0x37fb('0x38')]);_0x257048[_0x37fb('0x3a')]=_[_0x37fb('0x3b')](_0x257048[_0x37fb('0x37')],_0x257048['query']);_0xdf67fd[_0x37fb('0x3c')]=_[_0x37fb('0x3b')](_0x257048[_0x37fb('0x37')],qs[_0x37fb('0x3d')](_0x5e431c[_0x37fb('0x38')]['fields']));_0xdf67fd[_0x37fb('0x3c')]=_0xdf67fd[_0x37fb('0x3c')][_0x37fb('0x3e')]?_0xdf67fd['attributes']:_0x257048[_0x37fb('0x37')];if(!_0x5e431c[_0x37fb('0x38')][_0x37fb('0x3f')](_0x37fb('0x40'))){_0xdf67fd['limit']=qs[_0x37fb('0x23')](_0x5e431c[_0x37fb('0x38')][_0x37fb('0x23')]);_0xdf67fd[_0x37fb('0x20')]=qs[_0x37fb('0x20')](_0x5e431c[_0x37fb('0x38')][_0x37fb('0x20')]);}_0xdf67fd['order']=qs['sort'](_0x5e431c[_0x37fb('0x38')][_0x37fb('0x41')]);_0xdf67fd[_0x37fb('0x42')]=qs[_0x37fb('0x3a')](_[_0x37fb('0x43')](_0x5e431c[_0x37fb('0x38')],_0x257048['filters']),_0x101fbc);if(_0x5e431c[_0x37fb('0x38')][_0x37fb('0x44')]){_0xdf67fd[_0x37fb('0x42')]=_[_0x37fb('0x45')](_0xdf67fd[_0x37fb('0x42')],{'$or':_[_0x37fb('0x32')](_0x101fbc,function(_0x4af743){if(_0x4af743['type']!=='VIRTUAL'){var _0x10e45e={};_0x10e45e[_0x4af743[_0x37fb('0x2f')]]={'$like':'%'+_0x5e431c[_0x37fb('0x38')][_0x37fb('0x44')]+'%'};return _0x10e45e;}})});}_0xdf67fd=_[_0x37fb('0x45')]({},_0xdf67fd,_0x5e431c[_0x37fb('0x46')]);var _0x4b447d={'where':_0xdf67fd[_0x37fb('0x42')]};return db['SquareProject']['count'](_0x4b447d)[_0x37fb('0x28')](function(_0x40c41e){_0x350213['count']=_0x40c41e;if(_0x5e431c[_0x37fb('0x38')][_0x37fb('0x47')]){_0xdf67fd[_0x37fb('0x48')]=[{'all':!![]}];}return db['SquareProject'][_0x37fb('0x49')](_0xdf67fd);})['then'](function(_0xaf15c3){_0x350213[_0x37fb('0x4a')]=_0xaf15c3;return _0x350213;})[_0x37fb('0x28')](respondWithFilteredResult(_0x23c9b6,_0xdf67fd))[_0x37fb('0x4b')](handleError(_0x23c9b6,null));};exports['show']=function(_0x2e8bb5,_0xf67bee){var _0x45499a={'raw':![],'where':{'id':_0x2e8bb5['params']['id']}},_0x16d5d5={};_0x16d5d5[_0x37fb('0x37')]=_[_0x37fb('0x39')](db[_0x37fb('0x33')][_0x37fb('0x34')]);_0x16d5d5['query']=_[_0x37fb('0x39')](_0x2e8bb5[_0x37fb('0x38')]);_0x16d5d5[_0x37fb('0x3a')]=_[_0x37fb('0x3b')](_0x16d5d5[_0x37fb('0x37')],_0x16d5d5['query']);_0x45499a[_0x37fb('0x3c')]=_[_0x37fb('0x3b')](_0x16d5d5['model'],qs[_0x37fb('0x3d')](_0x2e8bb5[_0x37fb('0x38')]['fields']));_0x45499a['attributes']=_0x45499a['attributes'][_0x37fb('0x3e')]?_0x45499a[_0x37fb('0x3c')]:_0x16d5d5['model'];if(_0x2e8bb5[_0x37fb('0x38')][_0x37fb('0x47')]){_0x45499a[_0x37fb('0x48')]=[{'all':!![]}];}_0x45499a=_[_0x37fb('0x45')]({},_0x45499a,_0x2e8bb5[_0x37fb('0x46')]);return db[_0x37fb('0x33')][_0x37fb('0x4c')](_0x45499a)[_0x37fb('0x28')](handleEntityNotFound(_0xf67bee,null))['then'](respondWithResult(_0xf67bee,null))[_0x37fb('0x4b')](handleError(_0xf67bee,null));};exports['create']=function(_0x17d0d7,_0xf8539f){return db['SquareProject'][_0x37fb('0x4d')](_0x17d0d7[_0x37fb('0x4e')],{})[_0x37fb('0x28')](function(_0x4c5146){var _0x2615bf=_0x17d0d7[_0x37fb('0x4f')][_0x37fb('0x2a')]({'plain':!![]});if(!_0x2615bf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2615bf[_0x37fb('0x50')]===_0x37fb('0x4f')){var _0x2e239b=_0x4c5146['get']({'plain':!![]});var _0x1d38f3=_0x37fb('0x2b');return db[_0x37fb('0x51')][_0x37fb('0x4c')]({'where':{'name':_0x1d38f3,'userProfileId':_0x2615bf[_0x37fb('0x52')]},'raw':!![]})['then'](function(_0x1d7a6d){if(_0x1d7a6d&&_0x1d7a6d[_0x37fb('0x53')]===0x0){return db[_0x37fb('0x54')]['create']({'name':_0x2e239b[_0x37fb('0x2f')],'resourceId':_0x2e239b['id'],'type':_0x1d7a6d[_0x37fb('0x2f')],'sectionId':_0x1d7a6d['id']},{})[_0x37fb('0x28')](function(){return _0x4c5146;});}else{return _0x4c5146;}})[_0x37fb('0x4b')](function(_0x3bf7d1){logger[_0x37fb('0x2d')](_0x37fb('0x55'),_0x3bf7d1);throw _0x3bf7d1;});}return _0x4c5146;})[_0x37fb('0x28')](respondWithResult(_0xf8539f,0xc9))[_0x37fb('0x4b')](handleError(_0xf8539f,null));};exports['update']=function(_0x3d2939,_0x3dd272){if(_0x3d2939['body']['id']){delete _0x3d2939[_0x37fb('0x4e')]['id'];}return db[_0x37fb('0x33')][_0x37fb('0x4c')]({'where':{'id':_0x3d2939[_0x37fb('0x56')]['id']}})[_0x37fb('0x28')](handleEntityNotFound(_0x3dd272,null))['then'](saveUpdates(_0x3d2939[_0x37fb('0x4e')],null))['then'](respondWithResult(_0x3dd272,null))[_0x37fb('0x4b')](handleError(_0x3dd272,null));};exports[_0x37fb('0x29')]=function(_0x568710,_0x311edb){return db[_0x37fb('0x33')][_0x37fb('0x4c')]({'where':{'id':_0x568710[_0x37fb('0x56')]['id']}})[_0x37fb('0x28')](handleEntityNotFound(_0x311edb,null))['then'](removeEntity(_0x311edb,null))['catch'](handleError(_0x311edb,null));};exports[_0x37fb('0x57')]=function(_0x1beb15,_0x3db348,_0x443215){return db[_0x37fb('0x33')][_0x37fb('0x4c')]({'where':{'id':_0x1beb15[_0x37fb('0x56')]['id']}})['then'](handleEntityNotFound(_0x3db348,null))[_0x37fb('0x28')](function(_0x48d283){if(_0x48d283){return _0x48d283[_0x37fb('0x57')](_0x1beb15['body'][_0x37fb('0x58')],_[_0x37fb('0x59')](_0x1beb15[_0x37fb('0x4e')],['ids','id'])||{});}})[_0x37fb('0x28')](respondWithResult(_0x3db348,null))[_0x37fb('0x4b')](handleError(_0x3db348,null));};exports[_0x37fb('0x5a')]=function(_0x4299e8,_0x3467bb,_0x1b9b58){return db[_0x37fb('0x33')]['find']({'where':{'id':_0x4299e8[_0x37fb('0x56')]['id']}})[_0x37fb('0x28')](handleEntityNotFound(_0x3467bb,null))[_0x37fb('0x28')](function(_0x411744){if(_0x411744){return _0x411744['removeUsers'](_0x4299e8[_0x37fb('0x38')]['ids'])[_0x37fb('0x28')](function(){if(_[_0x37fb('0x5b')](_0x4299e8[_0x37fb('0x38')][_0x37fb('0x58')])){for(var _0x344525=0x0;_0x344525<_0x4299e8[_0x37fb('0x38')][_0x37fb('0x58')][_0x37fb('0x3e')];_0x344525+=0x1){socket[_0x37fb('0x5c')](_0x37fb('0x5d'),{'UserId':Number(_0x4299e8['query'][_0x37fb('0x58')][_0x344525]),'SquareProjectId':Number(_0x4299e8[_0x37fb('0x56')]['id'])});}}else{socket[_0x37fb('0x5c')](_0x37fb('0x5d'),{'UserId':Number(_0x4299e8[_0x37fb('0x38')][_0x37fb('0x58')]),'SquareProjectId':Number(_0x4299e8[_0x37fb('0x56')]['id'])});}});}})['then'](respondWithStatusCode(_0x3467bb,null))['catch'](handleError(_0x3467bb,null));};exports[_0x37fb('0x5e')]=function(_0x3bbb38,_0x28b512,_0x47c28e){var _0x4950b8={};var _0x15b9d8={};var _0x43d099;var _0x52ac87;return db[_0x37fb('0x33')][_0x37fb('0x5f')]({'where':{'id':_0x3bbb38[_0x37fb('0x56')]['id']}})[_0x37fb('0x28')](handleEntityNotFound(_0x28b512,null))['then'](function(_0x59192f){if(_0x59192f){_0x43d099=_0x59192f;_0x15b9d8['model']=_[_0x37fb('0x39')](db['User'][_0x37fb('0x34')]);_0x15b9d8[_0x37fb('0x38')]=_[_0x37fb('0x39')](_0x3bbb38[_0x37fb('0x38')]);_0x15b9d8[_0x37fb('0x3a')]=_[_0x37fb('0x3b')](_0x15b9d8['model'],_0x15b9d8['query']);_0x4950b8['attributes']=_['intersection'](_0x15b9d8[_0x37fb('0x37')],qs[_0x37fb('0x3d')](_0x3bbb38[_0x37fb('0x38')][_0x37fb('0x3d')]));_0x4950b8[_0x37fb('0x3c')]=_0x4950b8[_0x37fb('0x3c')][_0x37fb('0x3e')]?_0x4950b8['attributes']:_0x15b9d8['model'];_0x4950b8[_0x37fb('0x60')]=qs['sort'](_0x3bbb38[_0x37fb('0x38')][_0x37fb('0x41')]);_0x4950b8[_0x37fb('0x42')]=qs[_0x37fb('0x3a')](_[_0x37fb('0x43')](_0x3bbb38['query'],_0x15b9d8['filters']));if(_0x3bbb38[_0x37fb('0x38')][_0x37fb('0x44')]){_0x4950b8[_0x37fb('0x42')]=_[_0x37fb('0x45')](_0x4950b8[_0x37fb('0x42')],{'$or':_['map'](_0x4950b8['attributes'],function(_0x3a0c85){var _0x57fad9={};_0x57fad9[_0x3a0c85]={'$like':'%'+_0x3bbb38['query']['filter']+'%'};return _0x57fad9;})});}_0x4950b8=_[_0x37fb('0x45')]({},_0x4950b8,_0x3bbb38[_0x37fb('0x46')]);return _0x43d099[_0x37fb('0x5e')](_0x4950b8);}})['then'](function(_0x8d1a12){if(_0x8d1a12){_0x52ac87=_0x8d1a12[_0x37fb('0x3e')];if(!_0x3bbb38[_0x37fb('0x38')]['hasOwnProperty']('nolimit')){_0x4950b8[_0x37fb('0x23')]=qs[_0x37fb('0x23')](_0x3bbb38[_0x37fb('0x38')][_0x37fb('0x23')]);_0x4950b8['offset']=qs[_0x37fb('0x20')](_0x3bbb38[_0x37fb('0x38')]['offset']);}return _0x43d099['getUsers'](_0x4950b8);}})[_0x37fb('0x28')](function(_0x23bd8a){if(_0x23bd8a){return _0x23bd8a?{'count':_0x52ac87,'rows':_0x23bd8a}:null;}})['then'](respondWithResult(_0x28b512,null))[_0x37fb('0x4b')](handleError(_0x28b512,null));}; \ No newline at end of file +var _0xe4fb=['error','stack','name','send','map','SquareProject','rawAttributes','fieldName','type','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','find','create','body','user','SquareProjects','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','destroy','addUsers','ids','omit','removeUsers','emit','userSquareProject:remove','findOne','User','getUsers','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','defaults','localhost','socket.io-emitter','./squareProject.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','apply','save','update','then','get','UserProfileResource'];(function(_0x572350,_0x458c25){var _0x123788=function(_0x399627){while(--_0x399627){_0x572350['push'](_0x572350['shift']());}};_0x123788(++_0x458c25);}(_0xe4fb,0x150));var _0xbe4f=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xe4fb[_0x3bf83f];return _0x22c4a9;};'use strict';var emlformat=require(_0xbe4f('0x0'));var rimraf=require(_0xbe4f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbe4f('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xbe4f('0x3'));var Mustache=require(_0xbe4f('0x4'));var util=require(_0xbe4f('0x5'));var path=require(_0xbe4f('0x6'));var sox=require(_0xbe4f('0x7'));var csv=require(_0xbe4f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbe4f('0x9'));var _=require(_0xbe4f('0xa'));var squel=require(_0xbe4f('0xb'));var crypto=require(_0xbe4f('0xc'));var jsforce=require(_0xbe4f('0xd'));var deskjs=require(_0xbe4f('0xe'));var toCsv=require(_0xbe4f('0x8'));var querystring=require(_0xbe4f('0xf'));var Papa=require(_0xbe4f('0x10'));var Redis=require(_0xbe4f('0x11'));var authService=require(_0xbe4f('0x12'));var qs=require(_0xbe4f('0x13'));var as=require(_0xbe4f('0x14'));var hardwareService=require(_0xbe4f('0x15'));var logger=require(_0xbe4f('0x16'))('api');var utils=require(_0xbe4f('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xbe4f('0x18'))['db'];config['redis']=_[_0xbe4f('0x19')](config['redis'],{'host':_0xbe4f('0x1a'),'port':0x18eb});var socket=require(_0xbe4f('0x1b'))(new Redis(config['redis']));require(_0xbe4f('0x1c'))[_0xbe4f('0x1d')](socket);function respondWithStatusCode(_0x3254d4,_0x2d9eb7){_0x2d9eb7=_0x2d9eb7||0xcc;return function(_0x1f0745){if(_0x1f0745){return _0x3254d4[_0xbe4f('0x1e')](_0x2d9eb7);}return _0x3254d4[_0xbe4f('0x1f')](_0x2d9eb7)[_0xbe4f('0x20')]();};}function respondWithResult(_0x32592b,_0x4788fd){_0x4788fd=_0x4788fd||0xc8;return function(_0x45e969){if(_0x45e969){return _0x32592b[_0xbe4f('0x1f')](_0x4788fd)[_0xbe4f('0x21')](_0x45e969);}};}function respondWithFilteredResult(_0x40b18b,_0x30e95e){return function(_0x56d957){if(_0x56d957){var _0x112236=typeof _0x30e95e[_0xbe4f('0x22')]===_0xbe4f('0x23')&&typeof _0x30e95e[_0xbe4f('0x24')]===_0xbe4f('0x23');var _0x201bdf=_0x56d957[_0xbe4f('0x25')];var _0x388963=_0x112236?0x0:_0x30e95e[_0xbe4f('0x22')];var _0x4d9e41=_0x112236?_0x56d957[_0xbe4f('0x25')]:_0x30e95e[_0xbe4f('0x22')]+_0x30e95e[_0xbe4f('0x24')];var _0x5bfec2;if(_0x4d9e41>=_0x201bdf){_0x4d9e41=_0x201bdf;_0x5bfec2=0xc8;}else{_0x5bfec2=0xce;}_0x40b18b[_0xbe4f('0x1f')](_0x5bfec2);return _0x40b18b['set']('Content-Range',_0x388963+'-'+_0x4d9e41+'/'+_0x201bdf)['json'](_0x56d957);}return null;};}function patchUpdates(_0x4fefd6){return function(_0x5d47b5){try{jsonpatch[_0xbe4f('0x26')](_0x5d47b5,_0x4fefd6,!![]);}catch(_0x22525e){return BPromise['reject'](_0x22525e);}return _0x5d47b5[_0xbe4f('0x27')]();};}function saveUpdates(_0x49b1e4,_0x351db1){return function(_0x264fba){if(_0x264fba){return _0x264fba[_0xbe4f('0x28')](_0x49b1e4)[_0xbe4f('0x29')](function(_0x567c2f){return _0x567c2f;});}return null;};}function removeEntity(_0x266eb3,_0x4da43d){return function(_0x45480b){if(_0x45480b){return _0x45480b['destroy']()[_0xbe4f('0x29')](function(){var _0x5b59cd=_0x45480b[_0xbe4f('0x2a')]({'plain':!![]});var _0x5598ea='SquareProjects';return db[_0xbe4f('0x2b')]['destroy']({'where':{'type':_0x5598ea,'resourceId':_0x5b59cd['id']}})[_0xbe4f('0x29')](function(){return _0x45480b;});})[_0xbe4f('0x29')](function(){_0x266eb3[_0xbe4f('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d832e,_0x47861a){return function(_0x73c98e){if(!_0x73c98e){_0x5d832e[_0xbe4f('0x1e')](0x194);}return _0x73c98e;};}function handleError(_0x1e1ab9,_0x52d2e5){_0x52d2e5=_0x52d2e5||0x1f4;return function(_0x39b0c9){logger[_0xbe4f('0x2c')](_0x39b0c9[_0xbe4f('0x2d')]);if(_0x39b0c9['name']){delete _0x39b0c9[_0xbe4f('0x2e')];}_0x1e1ab9[_0xbe4f('0x1f')](_0x52d2e5)[_0xbe4f('0x2f')](_0x39b0c9);};}exports['index']=function(_0x9a93a9,_0x53a8c6){var _0x2ace33={},_0x4c94b0={},_0x4ee3f6={'count':0x0,'rows':[]};var _0x32bfdf=_[_0xbe4f('0x30')](db[_0xbe4f('0x31')][_0xbe4f('0x32')],function(_0x464623){return{'name':_0x464623[_0xbe4f('0x33')],'type':_0x464623[_0xbe4f('0x34')]['key']};});_0x4c94b0[_0xbe4f('0x35')]=_[_0xbe4f('0x30')](_0x32bfdf,_0xbe4f('0x2e'));_0x4c94b0['query']=_[_0xbe4f('0x36')](_0x9a93a9[_0xbe4f('0x37')]);_0x4c94b0[_0xbe4f('0x38')]=_['intersection'](_0x4c94b0[_0xbe4f('0x35')],_0x4c94b0[_0xbe4f('0x37')]);_0x2ace33[_0xbe4f('0x39')]=_[_0xbe4f('0x3a')](_0x4c94b0['model'],qs[_0xbe4f('0x3b')](_0x9a93a9[_0xbe4f('0x37')][_0xbe4f('0x3b')]));_0x2ace33[_0xbe4f('0x39')]=_0x2ace33['attributes'][_0xbe4f('0x3c')]?_0x2ace33[_0xbe4f('0x39')]:_0x4c94b0[_0xbe4f('0x35')];if(!_0x9a93a9[_0xbe4f('0x37')][_0xbe4f('0x3d')](_0xbe4f('0x3e'))){_0x2ace33[_0xbe4f('0x24')]=qs[_0xbe4f('0x24')](_0x9a93a9['query'][_0xbe4f('0x24')]);_0x2ace33[_0xbe4f('0x22')]=qs[_0xbe4f('0x22')](_0x9a93a9[_0xbe4f('0x37')][_0xbe4f('0x22')]);}_0x2ace33[_0xbe4f('0x3f')]=qs[_0xbe4f('0x40')](_0x9a93a9['query'][_0xbe4f('0x40')]);_0x2ace33[_0xbe4f('0x41')]=qs['filters'](_[_0xbe4f('0x42')](_0x9a93a9['query'],_0x4c94b0['filters']),_0x32bfdf);if(_0x9a93a9['query'][_0xbe4f('0x43')]){_0x2ace33[_0xbe4f('0x41')]=_[_0xbe4f('0x44')](_0x2ace33['where'],{'$or':_[_0xbe4f('0x30')](_0x32bfdf,function(_0x25ec66){if(_0x25ec66[_0xbe4f('0x34')]!=='VIRTUAL'){var _0x2b9691={};_0x2b9691[_0x25ec66[_0xbe4f('0x2e')]]={'$like':'%'+_0x9a93a9['query'][_0xbe4f('0x43')]+'%'};return _0x2b9691;}})});}_0x2ace33=_[_0xbe4f('0x44')]({},_0x2ace33,_0x9a93a9[_0xbe4f('0x45')]);var _0x4cfdb5={'where':_0x2ace33[_0xbe4f('0x41')]};return db['SquareProject'][_0xbe4f('0x25')](_0x4cfdb5)[_0xbe4f('0x29')](function(_0x5c7071){_0x4ee3f6[_0xbe4f('0x25')]=_0x5c7071;if(_0x9a93a9[_0xbe4f('0x37')][_0xbe4f('0x46')]){_0x2ace33[_0xbe4f('0x47')]=[{'all':!![]}];}return db[_0xbe4f('0x31')]['findAll'](_0x2ace33);})[_0xbe4f('0x29')](function(_0x5ed04c){_0x4ee3f6[_0xbe4f('0x48')]=_0x5ed04c;return _0x4ee3f6;})[_0xbe4f('0x29')](respondWithFilteredResult(_0x53a8c6,_0x2ace33))[_0xbe4f('0x49')](handleError(_0x53a8c6,null));};exports[_0xbe4f('0x4a')]=function(_0x1c38e9,_0x556c40){var _0x1e6201={'raw':![],'where':{'id':_0x1c38e9['params']['id']}},_0x29713a={};_0x29713a[_0xbe4f('0x35')]=_[_0xbe4f('0x36')](db['SquareProject'][_0xbe4f('0x32')]);_0x29713a['query']=_[_0xbe4f('0x36')](_0x1c38e9[_0xbe4f('0x37')]);_0x29713a[_0xbe4f('0x38')]=_['intersection'](_0x29713a[_0xbe4f('0x35')],_0x29713a[_0xbe4f('0x37')]);_0x1e6201['attributes']=_[_0xbe4f('0x3a')](_0x29713a[_0xbe4f('0x35')],qs[_0xbe4f('0x3b')](_0x1c38e9['query']['fields']));_0x1e6201[_0xbe4f('0x39')]=_0x1e6201[_0xbe4f('0x39')][_0xbe4f('0x3c')]?_0x1e6201[_0xbe4f('0x39')]:_0x29713a[_0xbe4f('0x35')];if(_0x1c38e9[_0xbe4f('0x37')][_0xbe4f('0x46')]){_0x1e6201['include']=[{'all':!![]}];}_0x1e6201=_[_0xbe4f('0x44')]({},_0x1e6201,_0x1c38e9[_0xbe4f('0x45')]);return db[_0xbe4f('0x31')][_0xbe4f('0x4b')](_0x1e6201)[_0xbe4f('0x29')](handleEntityNotFound(_0x556c40,null))[_0xbe4f('0x29')](respondWithResult(_0x556c40,null))[_0xbe4f('0x49')](handleError(_0x556c40,null));};exports[_0xbe4f('0x4c')]=function(_0x3343a1,_0x4b3717){return db[_0xbe4f('0x31')][_0xbe4f('0x4c')](_0x3343a1[_0xbe4f('0x4d')],{})[_0xbe4f('0x29')](function(_0x2f6702){var _0x36917c=_0x3343a1[_0xbe4f('0x4e')][_0xbe4f('0x2a')]({'plain':!![]});if(!_0x36917c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x36917c['role']===_0xbe4f('0x4e')){var _0x2b9695=_0x2f6702[_0xbe4f('0x2a')]({'plain':!![]});var _0x383905=_0xbe4f('0x4f');return db[_0xbe4f('0x50')][_0xbe4f('0x4b')]({'where':{'name':_0x383905,'userProfileId':_0x36917c[_0xbe4f('0x51')]},'raw':!![]})[_0xbe4f('0x29')](function(_0x317108){if(_0x317108&&_0x317108[_0xbe4f('0x52')]===0x0){return db['UserProfileResource'][_0xbe4f('0x4c')]({'name':_0x2b9695[_0xbe4f('0x2e')],'resourceId':_0x2b9695['id'],'type':_0x317108[_0xbe4f('0x2e')],'sectionId':_0x317108['id']},{})[_0xbe4f('0x29')](function(){return _0x2f6702;});}else{return _0x2f6702;}})[_0xbe4f('0x49')](function(_0x229370){logger[_0xbe4f('0x2c')](_0xbe4f('0x53'),_0x229370);throw _0x229370;});}return _0x2f6702;})[_0xbe4f('0x29')](respondWithResult(_0x4b3717,0xc9))[_0xbe4f('0x49')](handleError(_0x4b3717,null));};exports[_0xbe4f('0x28')]=function(_0x1521ca,_0x179fce){if(_0x1521ca[_0xbe4f('0x4d')]['id']){delete _0x1521ca[_0xbe4f('0x4d')]['id'];}return db[_0xbe4f('0x31')][_0xbe4f('0x4b')]({'where':{'id':_0x1521ca[_0xbe4f('0x54')]['id']}})[_0xbe4f('0x29')](handleEntityNotFound(_0x179fce,null))[_0xbe4f('0x29')](saveUpdates(_0x1521ca[_0xbe4f('0x4d')],null))[_0xbe4f('0x29')](respondWithResult(_0x179fce,null))[_0xbe4f('0x49')](handleError(_0x179fce,null));};exports[_0xbe4f('0x55')]=function(_0x2e9b5d,_0x297c22){return db[_0xbe4f('0x31')]['find']({'where':{'id':_0x2e9b5d[_0xbe4f('0x54')]['id']}})[_0xbe4f('0x29')](handleEntityNotFound(_0x297c22,null))['then'](removeEntity(_0x297c22,null))[_0xbe4f('0x49')](handleError(_0x297c22,null));};exports['addUsers']=function(_0x2d817c,_0xfe8ffb,_0x70c120){return db[_0xbe4f('0x31')][_0xbe4f('0x4b')]({'where':{'id':_0x2d817c['params']['id']}})[_0xbe4f('0x29')](handleEntityNotFound(_0xfe8ffb,null))['then'](function(_0x2df23e){if(_0x2df23e){return _0x2df23e[_0xbe4f('0x56')](_0x2d817c[_0xbe4f('0x4d')][_0xbe4f('0x57')],_[_0xbe4f('0x58')](_0x2d817c[_0xbe4f('0x4d')],[_0xbe4f('0x57'),'id'])||{});}})[_0xbe4f('0x29')](respondWithResult(_0xfe8ffb,null))[_0xbe4f('0x49')](handleError(_0xfe8ffb,null));};exports[_0xbe4f('0x59')]=function(_0x3140f9,_0x308461,_0x2701be){return db[_0xbe4f('0x31')][_0xbe4f('0x4b')]({'where':{'id':_0x3140f9['params']['id']}})[_0xbe4f('0x29')](handleEntityNotFound(_0x308461,null))[_0xbe4f('0x29')](function(_0xcfa317){if(_0xcfa317){return _0xcfa317['removeUsers'](_0x3140f9[_0xbe4f('0x37')][_0xbe4f('0x57')])[_0xbe4f('0x29')](function(){if(_['isArray'](_0x3140f9[_0xbe4f('0x37')]['ids'])){for(var _0x55e957=0x0;_0x55e957<_0x3140f9[_0xbe4f('0x37')][_0xbe4f('0x57')][_0xbe4f('0x3c')];_0x55e957+=0x1){socket[_0xbe4f('0x5a')](_0xbe4f('0x5b'),{'UserId':Number(_0x3140f9['query'][_0xbe4f('0x57')][_0x55e957]),'SquareProjectId':Number(_0x3140f9[_0xbe4f('0x54')]['id'])});}}else{socket['emit'](_0xbe4f('0x5b'),{'UserId':Number(_0x3140f9[_0xbe4f('0x37')][_0xbe4f('0x57')]),'SquareProjectId':Number(_0x3140f9[_0xbe4f('0x54')]['id'])});}});}})[_0xbe4f('0x29')](respondWithStatusCode(_0x308461,null))[_0xbe4f('0x49')](handleError(_0x308461,null));};exports['getUsers']=function(_0x49fbd1,_0x53607b,_0x33f5cd){var _0x49ae65={};var _0x25174a={};var _0x535dcc;var _0x329153;return db[_0xbe4f('0x31')][_0xbe4f('0x5c')]({'where':{'id':_0x49fbd1['params']['id']}})[_0xbe4f('0x29')](handleEntityNotFound(_0x53607b,null))['then'](function(_0x28ddcc){if(_0x28ddcc){_0x535dcc=_0x28ddcc;_0x25174a[_0xbe4f('0x35')]=_[_0xbe4f('0x36')](db[_0xbe4f('0x5d')][_0xbe4f('0x32')]);_0x25174a[_0xbe4f('0x37')]=_[_0xbe4f('0x36')](_0x49fbd1[_0xbe4f('0x37')]);_0x25174a[_0xbe4f('0x38')]=_['intersection'](_0x25174a[_0xbe4f('0x35')],_0x25174a[_0xbe4f('0x37')]);_0x49ae65['attributes']=_[_0xbe4f('0x3a')](_0x25174a[_0xbe4f('0x35')],qs[_0xbe4f('0x3b')](_0x49fbd1['query'][_0xbe4f('0x3b')]));_0x49ae65['attributes']=_0x49ae65[_0xbe4f('0x39')]['length']?_0x49ae65['attributes']:_0x25174a[_0xbe4f('0x35')];_0x49ae65['order']=qs[_0xbe4f('0x40')](_0x49fbd1[_0xbe4f('0x37')][_0xbe4f('0x40')]);_0x49ae65[_0xbe4f('0x41')]=qs['filters'](_[_0xbe4f('0x42')](_0x49fbd1[_0xbe4f('0x37')],_0x25174a[_0xbe4f('0x38')]));if(_0x49fbd1[_0xbe4f('0x37')][_0xbe4f('0x43')]){_0x49ae65[_0xbe4f('0x41')]=_['merge'](_0x49ae65[_0xbe4f('0x41')],{'$or':_[_0xbe4f('0x30')](_0x49ae65['attributes'],function(_0x5d3bd8){var _0xec60d3={};_0xec60d3[_0x5d3bd8]={'$like':'%'+_0x49fbd1[_0xbe4f('0x37')][_0xbe4f('0x43')]+'%'};return _0xec60d3;})});}_0x49ae65=_[_0xbe4f('0x44')]({},_0x49ae65,_0x49fbd1[_0xbe4f('0x45')]);return _0x535dcc[_0xbe4f('0x5e')](_0x49ae65);}})[_0xbe4f('0x29')](function(_0x205eaa){if(_0x205eaa){_0x329153=_0x205eaa[_0xbe4f('0x3c')];if(!_0x49fbd1[_0xbe4f('0x37')][_0xbe4f('0x3d')](_0xbe4f('0x3e'))){_0x49ae65[_0xbe4f('0x24')]=qs['limit'](_0x49fbd1[_0xbe4f('0x37')][_0xbe4f('0x24')]);_0x49ae65[_0xbe4f('0x22')]=qs[_0xbe4f('0x22')](_0x49fbd1[_0xbe4f('0x37')][_0xbe4f('0x22')]);}return _0x535dcc[_0xbe4f('0x5e')](_0x49ae65);}})['then'](function(_0x3cfdcc){if(_0x3cfdcc){return _0x3cfdcc?{'count':_0x329153,'rows':_0x3cfdcc}:null;}})[_0xbe4f('0x29')](respondWithResult(_0x53607b,null))[_0xbe4f('0x49')](handleError(_0x53607b,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 677874f..2320790 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 _0xc396=['setMaxListeners','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0xc396,0x1de));var _0x6c39=function(_0x199b70,_0x415ba7){_0x199b70=_0x199b70-0x0;var _0x8b87d4=_0xc396[_0x199b70];return _0x8b87d4;};'use strict';var EventEmitter=require(_0x6c39('0x0'));var SquareProject=require(_0x6c39('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x6c39('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6c39('0x3'),'afterDestroy':'remove'};function emitEvent(_0x12f818){return function(_0x170896,_0x558c63,_0x2dbb7e){SquareProjectEvents['emit'](_0x12f818+':'+_0x170896['id'],_0x170896);SquareProjectEvents[_0x6c39('0x4')](_0x12f818,_0x170896);_0x2dbb7e(null);};}for(var e in events){if(events[_0x6c39('0x5')](e)){var event=events[e];SquareProject[_0x6c39('0x6')](e,emitEvent(event));}}module[_0x6c39('0x7')]=SquareProjectEvents; \ No newline at end of file +var _0x6f79=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','SquareProject','save','update','remove'];(function(_0x2442b9,_0x3d87e9){var _0x31b571=function(_0x1e10ee){while(--_0x1e10ee){_0x2442b9['push'](_0x2442b9['shift']());}};_0x31b571(++_0x3d87e9);}(_0x6f79,0x1c6));var _0x96f7=function(_0x3f665a,_0x378980){_0x3f665a=_0x3f665a-0x0;var _0x376f08=_0x6f79[_0x3f665a];return _0x376f08;};'use strict';var EventEmitter=require(_0x96f7('0x0'));var SquareProject=require(_0x96f7('0x1'))['db'][_0x96f7('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x96f7('0x3'),'afterUpdate':_0x96f7('0x4'),'afterDestroy':_0x96f7('0x5')};function emitEvent(_0x4f969f){return function(_0x48a71c,_0x3649bd,_0x38a5dd){SquareProjectEvents[_0x96f7('0x6')](_0x4f969f+':'+_0x48a71c['id'],_0x48a71c);SquareProjectEvents[_0x96f7('0x6')](_0x4f969f,_0x48a71c);_0x38a5dd(null);};}for(var e in events){if(events[_0x96f7('0x7')](e)){var event=events[e];SquareProject[_0x96f7('0x8')](e,emitEvent(event));}}module[_0x96f7('0x9')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 39c0ce2..0b6bb99 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 _0x43df=['./squareProject.attributes','exports','SquareProject','square_projects','changed','savedAt','format','production','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4c56ee,_0x15d6a8){var _0x3d5dce=function(_0x2122bc){while(--_0x2122bc){_0x4c56ee['push'](_0x4c56ee['shift']());}};_0x3d5dce(++_0x15d6a8);}(_0x43df,0x14d));var _0xf43d=function(_0x340b5f,_0x1dabc7){_0x340b5f=_0x340b5f-0x0;var _0x150ddf=_0x43df[_0x340b5f];return _0x150ddf;};'use strict';var _=require(_0xf43d('0x0'));var util=require(_0xf43d('0x1'));var logger=require('../../config/logger')(_0xf43d('0x2'));var moment=require(_0xf43d('0x3'));var BPromise=require(_0xf43d('0x4'));var rp=require(_0xf43d('0x5'));var fs=require('fs');var path=require(_0xf43d('0x6'));var rimraf=require(_0xf43d('0x7'));var config=require(_0xf43d('0x8'));var attributes=require(_0xf43d('0x9'));module[_0xf43d('0xa')]=function(_0x13f952,_0x1eb040){return _0x13f952['define'](_0xf43d('0xb'),attributes,{'tableName':_0xf43d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x7dcba4,_0x3c93f2,_0x102f53){if(_0x7dcba4[_0xf43d('0xd')]('preproduction')){_0x7dcba4[_0xf43d('0xe')]=moment()[_0xf43d('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x7dcba4[_0xf43d('0xd')](_0xf43d('0x10'))){_0x7dcba4['publishedAt']=moment()[_0xf43d('0xf')](_0xf43d('0x11'));}_0x102f53(null,_0x7dcba4);}}});}; \ No newline at end of file +var _0x6fbe=['preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','changed','production','util','api','moment','bluebird','path','../../config/environment','define','SquareProject','square_projects'];(function(_0x45b55b,_0x20f1fd){var _0x22f271=function(_0x2d3508){while(--_0x2d3508){_0x45b55b['push'](_0x45b55b['shift']());}};_0x22f271(++_0x20f1fd);}(_0x6fbe,0x123));var _0xe6fb=function(_0x53bd1c,_0x28e800){_0x53bd1c=_0x53bd1c-0x0;var _0x2b6d54=_0x6fbe[_0x53bd1c];return _0x2b6d54;};'use strict';var _=require('lodash');var util=require(_0xe6fb('0x0'));var logger=require('../../config/logger')(_0xe6fb('0x1'));var moment=require(_0xe6fb('0x2'));var BPromise=require(_0xe6fb('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe6fb('0x4'));var rimraf=require('rimraf');var config=require(_0xe6fb('0x5'));var attributes=require('./squareProject.attributes');module['exports']=function(_0x4f6877,_0xd621a2){return _0x4f6877[_0xe6fb('0x6')](_0xe6fb('0x7'),attributes,{'tableName':_0xe6fb('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x553d58,_0x22f772,_0x516213){if(_0x553d58['changed'](_0xe6fb('0x9'))){_0x553d58[_0xe6fb('0xa')]=moment()[_0xe6fb('0xb')](_0xe6fb('0xc'));}if(_0x553d58[_0xe6fb('0xd')](_0xe6fb('0xe'))){_0x553d58['publishedAt']=moment()[_0xe6fb('0xb')](_0xe6fb('0xc'));}_0x516213(null,_0x553d58);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index e0ff80c..e436767 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 _0x7094=['stringify','error','code','SquareProject,\x20%s,\x20%s','message','result','catch','ShowSquareProject','find','options','raw','where','attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','request','then','info','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s'];(function(_0xa5a2e,_0x55ad0d){var _0x261b44=function(_0x498885){while(--_0x498885){_0xa5a2e['push'](_0xa5a2e['shift']());}};_0x261b44(++_0x55ad0d);}(_0x7094,0x196));var _0x4709=function(_0x26a46e,_0x3ede52){_0x26a46e=_0x26a46e-0x0;var _0x1e3ae2=_0x7094[_0x26a46e];return _0x1e3ae2;};'use strict';var _=require(_0x4709('0x0'));var util=require(_0x4709('0x1'));var moment=require('moment');var BPromise=require(_0x4709('0x2'));var rs=require(_0x4709('0x3'));var fs=require('fs');var Redis=require(_0x4709('0x4'));var db=require(_0x4709('0x5'))['db'];var utils=require(_0x4709('0x6'));var logger=require(_0x4709('0x7'))(_0x4709('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4709('0x9')][_0x4709('0xa')]({'port':0x232a});config[_0x4709('0xb')]=_[_0x4709('0xc')](config[_0x4709('0xb')],{'host':_0x4709('0xd'),'port':0x18eb});var socket=require(_0x4709('0xe'))(new Redis(config[_0x4709('0xb')]));require(_0x4709('0xf'))[_0x4709('0x10')](socket);function respondWithRpcPromise(_0x50cfb0,_0x425b10,_0x35117c){return new BPromise(function(_0x280c7b,_0x3b2777){return client[_0x4709('0x11')](_0x50cfb0,_0x35117c)[_0x4709('0x12')](function(_0x2d3181){logger[_0x4709('0x13')]('SquareProject,\x20%s,\x20%s',_0x425b10,_0x4709('0x14'));logger[_0x4709('0x15')](_0x4709('0x16'),_0x425b10,_0x4709('0x14'),JSON[_0x4709('0x17')](_0x2d3181));if(_0x2d3181[_0x4709('0x18')]){if(_0x2d3181[_0x4709('0x18')][_0x4709('0x19')]===0x1f4){logger[_0x4709('0x18')](_0x4709('0x1a'),_0x425b10,_0x2d3181[_0x4709('0x18')]['message']);return _0x3b2777(_0x2d3181['error'][_0x4709('0x1b')]);}logger[_0x4709('0x18')](_0x4709('0x1a'),_0x425b10,_0x2d3181[_0x4709('0x18')][_0x4709('0x1b')]);return _0x280c7b(_0x2d3181[_0x4709('0x18')][_0x4709('0x1b')]);}else{logger[_0x4709('0x13')]('SquareProject,\x20%s,\x20%s',_0x425b10,_0x4709('0x14'));_0x280c7b(_0x2d3181[_0x4709('0x1c')]['message']);}})[_0x4709('0x1d')](function(_0x2a4c0a){logger[_0x4709('0x18')](_0x4709('0x1a'),_0x425b10,_0x2a4c0a);_0x3b2777(_0x2a4c0a);});});}exports[_0x4709('0x1e')]=function(_0x10279b){var _0x1d6732=this;return new Promise(function(_0x2a9a68,_0x1b56fa){return db['SquareProject'][_0x4709('0x1f')]({'raw':_0x10279b[_0x4709('0x20')]?_0x10279b[_0x4709('0x20')][_0x4709('0x21')]===undefined?!![]:![]:!![],'where':_0x10279b[_0x4709('0x20')]?_0x10279b[_0x4709('0x20')][_0x4709('0x22')]||null:null,'attributes':_0x10279b[_0x4709('0x20')]?_0x10279b[_0x4709('0x20')][_0x4709('0x23')]||null:null,'include':_0x10279b[_0x4709('0x20')]?_0x10279b[_0x4709('0x20')][_0x4709('0x24')]?_[_0x4709('0x25')](_0x10279b['options'][_0x4709('0x24')],function(_0x52f7e6){return{'model':db[_0x52f7e6['model']],'as':_0x52f7e6['as'],'attributes':_0x52f7e6[_0x4709('0x23')],'include':_0x52f7e6[_0x4709('0x24')]?_[_0x4709('0x25')](_0x52f7e6[_0x4709('0x24')],function(_0x1b2665){return{'model':db[_0x1b2665[_0x4709('0x26')]],'as':_0x1b2665['as'],'attributes':_0x1b2665[_0x4709('0x23')],'include':_0x1b2665[_0x4709('0x24')]?_['map'](_0x1b2665[_0x4709('0x24')],function(_0x1de00d){return{'model':db[_0x1de00d['model']],'as':_0x1de00d['as'],'attributes':_0x1de00d[_0x4709('0x23')]};}):[]};}):[]};}):[]:[]})[_0x4709('0x12')](function(_0x5cfb0d){logger[_0x4709('0x13')]('ShowSquareProject',_0x10279b);logger[_0x4709('0x15')](_0x4709('0x1e'),_0x10279b,JSON[_0x4709('0x17')](_0x5cfb0d));_0x2a9a68(_0x5cfb0d);})['catch'](function(_0x3eaf86){logger['error'](_0x4709('0x1e'),_0x3eaf86['message'],_0x10279b);_0x1b56fa(_0x1d6732[_0x4709('0x18')](0x1f4,_0x3eaf86['message']));});});}; \ No newline at end of file +var _0x6b79=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','then','info','SquareProject,\x20%s,\x20%s','debug','SquareProject,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','ShowSquareProject','SquareProject','find','options','raw','attributes','include','map','model','lodash','util'];(function(_0x443bbb,_0x3b17ee){var _0x4549a0=function(_0x1829fc){while(--_0x1829fc){_0x443bbb['push'](_0x443bbb['shift']());}};_0x4549a0(++_0x3b17ee);}(_0x6b79,0x154));var _0x96b7=function(_0x46b5ae,_0x65afcf){_0x46b5ae=_0x46b5ae-0x0;var _0x59d2d1=_0x6b79[_0x46b5ae];return _0x59d2d1;};'use strict';var _=require(_0x96b7('0x0'));var util=require(_0x96b7('0x1'));var moment=require(_0x96b7('0x2'));var BPromise=require(_0x96b7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x96b7('0x4'));var db=require(_0x96b7('0x5'))['db'];var utils=require(_0x96b7('0x6'));var logger=require(_0x96b7('0x7'))(_0x96b7('0x8'));var config=require(_0x96b7('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x96b7('0xa')][_0x96b7('0xb')]({'port':0x232a});config[_0x96b7('0xc')]=_[_0x96b7('0xd')](config[_0x96b7('0xc')],{'host':_0x96b7('0xe'),'port':0x18eb});var socket=require(_0x96b7('0xf'))(new Redis(config[_0x96b7('0xc')]));require(_0x96b7('0x10'))[_0x96b7('0x11')](socket);function respondWithRpcPromise(_0x17afaa,_0x17a4a4,_0x595704){return new BPromise(function(_0x1fb9db,_0x19f26e){return client['request'](_0x17afaa,_0x595704)[_0x96b7('0x12')](function(_0x124a41){logger[_0x96b7('0x13')](_0x96b7('0x14'),_0x17a4a4,'request\x20sent');logger[_0x96b7('0x15')](_0x96b7('0x16'),_0x17a4a4,_0x96b7('0x17'),JSON[_0x96b7('0x18')](_0x124a41));if(_0x124a41[_0x96b7('0x19')]){if(_0x124a41[_0x96b7('0x19')]['code']===0x1f4){logger['error'](_0x96b7('0x14'),_0x17a4a4,_0x124a41[_0x96b7('0x19')][_0x96b7('0x1a')]);return _0x19f26e(_0x124a41['error'][_0x96b7('0x1a')]);}logger['error']('SquareProject,\x20%s,\x20%s',_0x17a4a4,_0x124a41[_0x96b7('0x19')][_0x96b7('0x1a')]);return _0x1fb9db(_0x124a41['error'][_0x96b7('0x1a')]);}else{logger[_0x96b7('0x13')](_0x96b7('0x14'),_0x17a4a4,_0x96b7('0x17'));_0x1fb9db(_0x124a41[_0x96b7('0x1b')][_0x96b7('0x1a')]);}})[_0x96b7('0x1c')](function(_0x12b3e8){logger[_0x96b7('0x19')](_0x96b7('0x14'),_0x17a4a4,_0x12b3e8);_0x19f26e(_0x12b3e8);});});}exports[_0x96b7('0x1d')]=function(_0x14d71b){var _0x407046=this;return new Promise(function(_0x3eeec8,_0x47deb8){return db[_0x96b7('0x1e')][_0x96b7('0x1f')]({'raw':_0x14d71b[_0x96b7('0x20')]?_0x14d71b['options'][_0x96b7('0x21')]===undefined?!![]:![]:!![],'where':_0x14d71b[_0x96b7('0x20')]?_0x14d71b[_0x96b7('0x20')]['where']||null:null,'attributes':_0x14d71b[_0x96b7('0x20')]?_0x14d71b['options'][_0x96b7('0x22')]||null:null,'include':_0x14d71b[_0x96b7('0x20')]?_0x14d71b['options'][_0x96b7('0x23')]?_[_0x96b7('0x24')](_0x14d71b[_0x96b7('0x20')][_0x96b7('0x23')],function(_0x3f2eee){return{'model':db[_0x3f2eee[_0x96b7('0x25')]],'as':_0x3f2eee['as'],'attributes':_0x3f2eee[_0x96b7('0x22')],'include':_0x3f2eee[_0x96b7('0x23')]?_[_0x96b7('0x24')](_0x3f2eee[_0x96b7('0x23')],function(_0x550dda){return{'model':db[_0x550dda[_0x96b7('0x25')]],'as':_0x550dda['as'],'attributes':_0x550dda['attributes'],'include':_0x550dda['include']?_[_0x96b7('0x24')](_0x550dda[_0x96b7('0x23')],function(_0x53d3a5){return{'model':db[_0x53d3a5[_0x96b7('0x25')]],'as':_0x53d3a5['as'],'attributes':_0x53d3a5[_0x96b7('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x19b740){logger[_0x96b7('0x13')](_0x96b7('0x1d'),_0x14d71b);logger['debug'](_0x96b7('0x1d'),_0x14d71b,JSON['stringify'](_0x19b740));_0x3eeec8(_0x19b740);})[_0x96b7('0x1c')](function(_0xdfaae0){logger[_0x96b7('0x19')](_0x96b7('0x1d'),_0xdfaae0[_0x96b7('0x1a')],_0x14d71b);_0x47deb8(_0x407046[_0x96b7('0x19')](0x1f4,_0xdfaae0['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index a495bb6..3d9b43b 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 _0x84f4=['emit','squareProject:','./squareProject.events','save','remove'];(function(_0xdf07df,_0x39e3b2){var _0x4dcea6=function(_0x101def){while(--_0x101def){_0xdf07df['push'](_0xdf07df['shift']());}};_0x4dcea6(++_0x39e3b2);}(_0x84f4,0x165));var _0x484f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x84f4[_0x3dd15e];return _0x231fd0;};'use strict';var SquareProjectEvents=require(_0x484f('0x0'));var events=[_0x484f('0x1'),_0x484f('0x2'),'update'];function createListener(_0xc760cd,_0x18073f){return function(_0x155d3a){_0x18073f[_0x484f('0x3')](_0xc760cd,_0x155d3a);};}function removeListener(_0x56142b,_0x53caf7){return function(){SquareProjectEvents['removeListener'](_0x56142b,_0x53caf7);};}exports['register']=function(_0x48a0d2){for(var _0x415d1b=0x0,_0x44f279=events['length'];_0x415d1b<_0x44f279;_0x415d1b++){var _0xfcd972=events[_0x415d1b];var _0x36f33e=createListener(_0x484f('0x4')+_0xfcd972,_0x48a0d2);SquareProjectEvents['on'](_0xfcd972,_0x36f33e);}}; \ No newline at end of file +var _0xd972=['save','update','emit','removeListener','register','length','squareProject:','./squareProject.events'];(function(_0x11131a,_0x1b848f){var _0x23a3ec=function(_0x12d3f1){while(--_0x12d3f1){_0x11131a['push'](_0x11131a['shift']());}};_0x23a3ec(++_0x1b848f);}(_0xd972,0x137));var _0x2d97=function(_0x5ae2e8,_0x4d7779){_0x5ae2e8=_0x5ae2e8-0x0;var _0x614f4b=_0xd972[_0x5ae2e8];return _0x614f4b;};'use strict';var SquareProjectEvents=require(_0x2d97('0x0'));var events=[_0x2d97('0x1'),'remove',_0x2d97('0x2')];function createListener(_0xc3ff66,_0x1a00eb){return function(_0x41f355){_0x1a00eb[_0x2d97('0x3')](_0xc3ff66,_0x41f355);};}function removeListener(_0x330d6f,_0x1beadb){return function(){SquareProjectEvents[_0x2d97('0x4')](_0x330d6f,_0x1beadb);};}exports[_0x2d97('0x5')]=function(_0x30b63d){for(var _0x5b1de3=0x0,_0xe4ad11=events[_0x2d97('0x6')];_0x5b1de3<_0xe4ad11;_0x5b1de3++){var _0x53d80b=events[_0x5b1de3];var _0x546e1b=createListener(_0x2d97('0x7')+_0x53d80b,_0x30b63d);SquareProjectEvents['on'](_0x53d80b,_0x546e1b);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 1c63680..c2e516a 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(_0x5a6743,_0x2cb9b8){var _0x51894e=function(_0x1e40b5){while(--_0x1e40b5){_0x5a6743['push'](_0x5a6743['shift']());}};_0x51894e(++_0x2cb9b8);}(_0x7a54,0x106));var _0x47a5=function(_0x204354,_0x408a72){_0x204354=_0x204354-0x0;var _0x3e928b=_0x7a54[_0x204354];return _0x3e928b;};'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 _0x7fbe=['/:id','show','/:id/download','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','index'];(function(_0x3ebc74,_0x1edda2){var _0x37b5f8=function(_0x59e2da){while(--_0x59e2da){_0x3ebc74['push'](_0x3ebc74['shift']());}};_0x37b5f8(++_0x1edda2);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x3c2a87,_0x301e33){_0x3c2a87=_0x3c2a87-0x0;var _0x3a4efd=_0x7fbe[_0x3c2a87];return _0x3a4efd;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7fb('0x0'));var timeout=require(_0xe7fb('0x1'));var express=require(_0xe7fb('0x2'));var router=express[_0xe7fb('0x3')]();var fs_extra=require(_0xe7fb('0x4'));var auth=require(_0xe7fb('0x5'));var interaction=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var controller=require(_0xe7fb('0x8'));router[_0xe7fb('0x9')]('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xb')]);router[_0xe7fb('0x9')](_0xe7fb('0xc'),auth['isAuthenticated'](),controller[_0xe7fb('0xd')]);router[_0xe7fb('0x9')](_0xe7fb('0xe'),auth[_0xe7fb('0xa')](),controller['download']);router['post']('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xf')]);router[_0xe7fb('0x10')](_0xe7fb('0xc'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x11')]);router[_0xe7fb('0x12')](_0xe7fb('0xc'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x13')]);module[_0xe7fb('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 1ba9f97..70bb75e 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 _0x2675=['getDataValue','savePath','lastIndexOf','sequelize','STRING','VIRTUAL'];(function(_0x25d73b,_0x15dae9){var _0x5f4b34=function(_0x2b3532){while(--_0x2b3532){_0x25d73b['push'](_0x25d73b['shift']());}};_0x5f4b34(++_0x15dae9);}(_0x2675,0x75));var _0x5267=function(_0x1a6fcf,_0x70c146){_0x1a6fcf=_0x1a6fcf-0x0;var _0x5598bd=_0x2675[_0x1a6fcf];return _0x5598bd;};'use strict';var Sequelize=require(_0x5267('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x5267('0x1')]},'context':{'type':Sequelize[_0x5267('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x5267('0x1')]},'accountcode':{'type':Sequelize[_0x5267('0x1')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0x5267('0x1')]},'saveName':{'type':Sequelize[_0x5267('0x1')]},'filename':{'type':Sequelize[_0x5267('0x1')]},'savePath':{'type':Sequelize[_0x5267('0x1')]},'format':{'type':Sequelize[_0x5267('0x2')],'get':function(){var _0xc56cd5='';var _0x527c16=this[_0x5267('0x3')](_0x5267('0x4'));if(_0x527c16){_0xc56cd5=_0x527c16['substring'](_0x527c16[_0x5267('0x5')]('.'));}return _0xc56cd5;}}}; \ No newline at end of file +var _0xf494=['STRING','VIRTUAL','getDataValue','savePath','substring','lastIndexOf','sequelize','exports'];(function(_0x51c819,_0xd812db){var _0x15c5d2=function(_0x2977f0){while(--_0x2977f0){_0x51c819['push'](_0x51c819['shift']());}};_0x15c5d2(++_0xd812db);}(_0xf494,0x1c6));var _0x4f49=function(_0x5754f7,_0x218ace){_0x5754f7=_0x5754f7-0x0;var _0x5a357b=_0xf494[_0x5754f7];return _0x5a357b;};'use strict';var Sequelize=require(_0x4f49('0x0'));module[_0x4f49('0x1')]={'uniqueid':{'type':Sequelize[_0x4f49('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x4f49('0x2')]},'context':{'type':Sequelize[_0x4f49('0x2')]},'extension':{'type':Sequelize[_0x4f49('0x2')]},'priority':{'type':Sequelize[_0x4f49('0x2')]},'accountcode':{'type':Sequelize[_0x4f49('0x2')]},'dnid':{'type':Sequelize[_0x4f49('0x2')]},'projectName':{'type':Sequelize[_0x4f49('0x2')]},'saveName':{'type':Sequelize[_0x4f49('0x2')]},'filename':{'type':Sequelize[_0x4f49('0x2')]},'savePath':{'type':Sequelize[_0x4f49('0x2')]},'format':{'type':Sequelize[_0x4f49('0x3')],'get':function(){var _0x5eb186='';var _0x58e9a0=this[_0x4f49('0x4')](_0x4f49('0x5'));if(_0x58e9a0){_0x5eb186=_0x58e9a0[_0x4f49('0x6')](_0x58e9a0[_0x4f49('0x7')]('.'));}return _0x5eb186;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index e8994d6..e3182ca 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 _0xf014=['fields','attributes','sort','pick','where','merge','filter','SquareRecording','includeAll','findAll','rows','catch','show','params','length','include','find','create','body','download','uniqueid','savePath','filename','format','%s.cypher','existsSync','decryptFile','secrets','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','unlink','Not\x20found','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection'];(function(_0x10c681,_0x3ae83b){var _0x34dfc6=function(_0x42a60f){while(--_0x42a60f){_0x10c681['push'](_0x10c681['shift']());}};_0x34dfc6(++_0x3ae83b);}(_0xf014,0xe2));var _0x4f01=function(_0x14a0b5,_0x1de8af){_0x14a0b5=_0x14a0b5-0x0;var _0x3a320b=_0xf014[_0x14a0b5];return _0x3a320b;};'use strict';var emlformat=require(_0x4f01('0x0'));var rimraf=require(_0x4f01('0x1'));var zipdir=require(_0x4f01('0x2'));var jsonpatch=require(_0x4f01('0x3'));var rp=require('request-promise');var moment=require(_0x4f01('0x4'));var BPromise=require(_0x4f01('0x5'));var Mustache=require(_0x4f01('0x6'));var util=require(_0x4f01('0x7'));var path=require(_0x4f01('0x8'));var sox=require(_0x4f01('0x9'));var csv=require(_0x4f01('0xa'));var ejs=require(_0x4f01('0xb'));var fs=require('fs');var fs_extra=require(_0x4f01('0xc'));var _=require('lodash');var squel=require(_0x4f01('0xd'));var crypto=require(_0x4f01('0xe'));var jsforce=require(_0x4f01('0xf'));var deskjs=require(_0x4f01('0x10'));var toCsv=require(_0x4f01('0xa'));var querystring=require(_0x4f01('0x11'));var Papa=require(_0x4f01('0x12'));var Redis=require(_0x4f01('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x4f01('0x14'));var as=require(_0x4f01('0x15'));var hardwareService=require(_0x4f01('0x16'));var logger=require(_0x4f01('0x17'))('api');var utils=require(_0x4f01('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x4f01('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x110385,_0x5c4fbb){_0x5c4fbb=_0x5c4fbb||0xcc;return function(_0x1f3c71){if(_0x1f3c71){return _0x110385[_0x4f01('0x1a')](_0x5c4fbb);}return _0x110385[_0x4f01('0x1b')](_0x5c4fbb)[_0x4f01('0x1c')]();};}function respondWithResult(_0x5388be,_0x1414d9){_0x1414d9=_0x1414d9||0xc8;return function(_0x603d91){if(_0x603d91){return _0x5388be[_0x4f01('0x1b')](_0x1414d9)[_0x4f01('0x1d')](_0x603d91);}};}function respondWithFilteredResult(_0x1021c0,_0x3be9a0){return function(_0x38ab2e){if(_0x38ab2e){var _0x46a4cc=typeof _0x3be9a0[_0x4f01('0x1e')]==='undefined'&&typeof _0x3be9a0[_0x4f01('0x1f')]===_0x4f01('0x20');var _0x153091=_0x38ab2e[_0x4f01('0x21')];var _0x20256a=_0x46a4cc?0x0:_0x3be9a0[_0x4f01('0x1e')];var _0x4a4b37=_0x46a4cc?_0x38ab2e[_0x4f01('0x21')]:_0x3be9a0['offset']+_0x3be9a0[_0x4f01('0x1f')];var _0x530dfb;if(_0x4a4b37>=_0x153091){_0x4a4b37=_0x153091;_0x530dfb=0xc8;}else{_0x530dfb=0xce;}_0x1021c0['status'](_0x530dfb);return _0x1021c0[_0x4f01('0x22')](_0x4f01('0x23'),_0x20256a+'-'+_0x4a4b37+'/'+_0x153091)[_0x4f01('0x1d')](_0x38ab2e);}return null;};}function patchUpdates(_0x4c066c){return function(_0x1968ca){try{jsonpatch[_0x4f01('0x24')](_0x1968ca,_0x4c066c,!![]);}catch(_0x14ecc3){return BPromise['reject'](_0x14ecc3);}return _0x1968ca[_0x4f01('0x25')]();};}function saveUpdates(_0x49fab0,_0x20ffc0){return function(_0xa813e4){if(_0xa813e4){return _0xa813e4[_0x4f01('0x26')](_0x49fab0)[_0x4f01('0x27')](function(_0x567cb6){return _0x567cb6;});}return null;};}function removeEntity(_0x42550d,_0x346d2a){return function(_0x4d4b98){if(_0x4d4b98){return _0x4d4b98[_0x4f01('0x28')]()[_0x4f01('0x27')](function(){_0x42550d['status'](0xcc)[_0x4f01('0x1c')]();});}};}function handleEntityNotFound(_0x3e9e83,_0x352a2b){return function(_0x522a61){if(!_0x522a61){_0x3e9e83[_0x4f01('0x1a')](0x194);}return _0x522a61;};}function handleError(_0x1e640d,_0x528891){_0x528891=_0x528891||0x1f4;return function(_0x8adb6e){logger['error'](_0x8adb6e['stack']);if(_0x8adb6e[_0x4f01('0x29')]){delete _0x8adb6e[_0x4f01('0x29')];}_0x1e640d[_0x4f01('0x1b')](_0x528891)[_0x4f01('0x2a')](_0x8adb6e);};}exports[_0x4f01('0x2b')]=function(_0x4eb9c4,_0x443bde){var _0x54e295={},_0x43dd33={},_0x26a3c6={'count':0x0,'rows':[]};var _0x5e933f=_[_0x4f01('0x2c')](db['SquareRecording'][_0x4f01('0x2d')],function(_0x5d525c){return{'name':_0x5d525c['fieldName'],'type':_0x5d525c[_0x4f01('0x2e')][_0x4f01('0x2f')]};});_0x43dd33[_0x4f01('0x30')]=_[_0x4f01('0x2c')](_0x5e933f,_0x4f01('0x29'));_0x43dd33[_0x4f01('0x31')]=_[_0x4f01('0x32')](_0x4eb9c4[_0x4f01('0x31')]);_0x43dd33[_0x4f01('0x33')]=_['intersection'](_0x43dd33[_0x4f01('0x30')],_0x43dd33[_0x4f01('0x31')]);_0x54e295['attributes']=_[_0x4f01('0x34')](_0x43dd33[_0x4f01('0x30')],qs['fields'](_0x4eb9c4[_0x4f01('0x31')][_0x4f01('0x35')]));_0x54e295['attributes']=_0x54e295[_0x4f01('0x36')]['length']?_0x54e295[_0x4f01('0x36')]:_0x43dd33[_0x4f01('0x30')];if(!_0x4eb9c4[_0x4f01('0x31')]['hasOwnProperty']('nolimit')){_0x54e295[_0x4f01('0x1f')]=qs[_0x4f01('0x1f')](_0x4eb9c4[_0x4f01('0x31')][_0x4f01('0x1f')]);_0x54e295['offset']=qs['offset'](_0x4eb9c4[_0x4f01('0x31')][_0x4f01('0x1e')]);}_0x54e295['order']=qs[_0x4f01('0x37')](_0x4eb9c4['query'][_0x4f01('0x37')]);_0x54e295['where']=qs[_0x4f01('0x33')](_[_0x4f01('0x38')](_0x4eb9c4[_0x4f01('0x31')],_0x43dd33['filters']),_0x5e933f);if(_0x4eb9c4[_0x4f01('0x31')]['filter']){_0x54e295[_0x4f01('0x39')]=_[_0x4f01('0x3a')](_0x54e295['where'],{'$or':_['map'](_0x5e933f,function(_0x1a2bea){if(_0x1a2bea[_0x4f01('0x2e')]!=='VIRTUAL'){var _0x130f83={};_0x130f83[_0x1a2bea[_0x4f01('0x29')]]={'$like':'%'+_0x4eb9c4[_0x4f01('0x31')][_0x4f01('0x3b')]+'%'};return _0x130f83;}})});}_0x54e295=_['merge']({},_0x54e295,_0x4eb9c4['options']);var _0x3bd7f1={'where':_0x54e295[_0x4f01('0x39')]};return db[_0x4f01('0x3c')][_0x4f01('0x21')](_0x3bd7f1)[_0x4f01('0x27')](function(_0x42df68){_0x26a3c6[_0x4f01('0x21')]=_0x42df68;if(_0x4eb9c4[_0x4f01('0x31')][_0x4f01('0x3d')]){_0x54e295['include']=[{'all':!![]}];}return db[_0x4f01('0x3c')][_0x4f01('0x3e')](_0x54e295);})[_0x4f01('0x27')](function(_0x41bccf){_0x26a3c6[_0x4f01('0x3f')]=_0x41bccf;return _0x26a3c6;})[_0x4f01('0x27')](respondWithFilteredResult(_0x443bde,_0x54e295))[_0x4f01('0x40')](handleError(_0x443bde,null));};exports[_0x4f01('0x41')]=function(_0x38eb6f,_0x46587d){var _0x51e30f={'raw':!![],'where':{'id':_0x38eb6f[_0x4f01('0x42')]['id']}},_0x52dbec={};_0x52dbec[_0x4f01('0x30')]=_['keys'](db[_0x4f01('0x3c')][_0x4f01('0x2d')]);_0x52dbec[_0x4f01('0x31')]=_['keys'](_0x38eb6f[_0x4f01('0x31')]);_0x52dbec[_0x4f01('0x33')]=_['intersection'](_0x52dbec['model'],_0x52dbec[_0x4f01('0x31')]);_0x51e30f['attributes']=_[_0x4f01('0x34')](_0x52dbec[_0x4f01('0x30')],qs[_0x4f01('0x35')](_0x38eb6f[_0x4f01('0x31')]['fields']));_0x51e30f[_0x4f01('0x36')]=_0x51e30f['attributes'][_0x4f01('0x43')]?_0x51e30f['attributes']:_0x52dbec[_0x4f01('0x30')];if(_0x38eb6f['query'][_0x4f01('0x3d')]){_0x51e30f[_0x4f01('0x44')]=[{'all':!![]}];}_0x51e30f=_[_0x4f01('0x3a')]({},_0x51e30f,_0x38eb6f['options']);return db[_0x4f01('0x3c')][_0x4f01('0x45')](_0x51e30f)[_0x4f01('0x27')](handleEntityNotFound(_0x46587d,null))['then'](respondWithResult(_0x46587d,null))[_0x4f01('0x40')](handleError(_0x46587d,null));};exports[_0x4f01('0x46')]=function(_0xa8f10b,_0x4ae7dd){return db[_0x4f01('0x3c')][_0x4f01('0x46')](_0xa8f10b[_0x4f01('0x47')],{})['then'](respondWithResult(_0x4ae7dd,0xc9))[_0x4f01('0x40')](handleError(_0x4ae7dd,null));};exports['update']=function(_0x112a5c,_0x534c2f){if(_0x112a5c['body']['id']){delete _0x112a5c[_0x4f01('0x47')]['id'];}return db['SquareRecording'][_0x4f01('0x45')]({'where':{'id':_0x112a5c[_0x4f01('0x42')]['id']}})[_0x4f01('0x27')](handleEntityNotFound(_0x534c2f,null))[_0x4f01('0x27')](saveUpdates(_0x112a5c['body'],null))[_0x4f01('0x27')](respondWithResult(_0x534c2f,null))[_0x4f01('0x40')](handleError(_0x534c2f,null));};exports[_0x4f01('0x48')]=function(_0x46fc8e,_0x13f3e1,_0x17276f){var _0x3ac42f=require('../../components/encryptor');var _0x4891fc=![];var _0xe6b108={};if(_0x46fc8e[_0x4f01('0x31')]['type']&&_0x46fc8e[_0x4f01('0x31')][_0x4f01('0x2e')]===_0x4f01('0x49')){_0xe6b108[_0x4f01('0x49')]=_0x46fc8e[_0x4f01('0x42')]['id'];}else{_0xe6b108['id']=_0x46fc8e[_0x4f01('0x42')]['id'];}return db[_0x4f01('0x3c')][_0x4f01('0x45')]({'where':_0xe6b108,'attributes':['id',_0x4f01('0x4a'),_0x4f01('0x4b')],'raw':!![]})[_0x4f01('0x27')](handleEntityNotFound(_0x13f3e1,null))['then'](function(_0x375153){if(_0x375153){var _0x33a7e3=_0x375153[_0x4f01('0x4a')];var _0x1e8d0e=util[_0x4f01('0x4c')](_0x4f01('0x4d'),_0x33a7e3);if(fs[_0x4f01('0x4e')](_0x1e8d0e)){_0x4891fc=!![];return _0x3ac42f[_0x4f01('0x4f')](_0x1e8d0e,_0x33a7e3,config[_0x4f01('0x50')]['recording'])[_0x4f01('0x27')](function(){return _0x375153;});}return _0x375153;}})[_0x4f01('0x27')](function(_0x50932a){if(_0x50932a){var _0x3a3c7a=_0x50932a['savePath'];if(!fs['existsSync'](_0x3a3c7a)){throw new db[(_0x4f01('0x51'))][(_0x4f01('0x52'))](_0x4f01('0x53'));}if(_0x50932a['filename']){return _0x13f3e1[_0x4f01('0x48')](_0x3a3c7a,_0x50932a[_0x4f01('0x4b')]+path[_0x4f01('0x54')](_0x3a3c7a),function(){if(_0x4891fc){fs[_0x4f01('0x55')](_0x3a3c7a);}});}else{return _0x13f3e1['download'](_0x3a3c7a,function(_0x44d01b){if(_0x4891fc){fs[_0x4f01('0x55')](_0x3a3c7a);}});}}})[_0x4f01('0x40')](function(_0x2fb267){if(_0x2fb267['message']===_0x4f01('0x53')){_0x13f3e1[_0x4f01('0x1b')](0x194)['send'](_0x4f01('0x56'));}else{return handleError(_0x13f3e1,null);}});};exports['destroy']=function(_0x11e5ec,_0x2c2077){return db[_0x4f01('0x3c')][_0x4f01('0x45')]({'where':{'id':_0x11e5ec['params']['id']}})['then'](function(_0x17fba9){if(_[_0x4f01('0x57')](_0x17fba9)){throw new ReferenceError('Entity\x20not\x20found');}return _0x17fba9;})[_0x4f01('0x27')](function(_0x26c0f9){var _0xa018cb=_0x26c0f9[_0x4f01('0x4a')];logger[_0x4f01('0x58')](_0x4f01('0x59'),_0xa018cb);if(!_[_0x4f01('0x57')](_0x26c0f9[_0x4f01('0x4a')])&&fs['existsSync'](_0xa018cb)){logger[_0x4f01('0x58')](_0x4f01('0x5a')+_0xa018cb+_0x4f01('0x5b'));fs[_0x4f01('0x5c')](_0xa018cb);}_0xa018cb=_0xa018cb+'.cypher';if(!_[_0x4f01('0x57')](_0x26c0f9[_0x4f01('0x4a')])&&fs[_0x4f01('0x4e')](_0xa018cb)){logger[_0x4f01('0x58')](_0x4f01('0x5a')+_0xa018cb+_0x4f01('0x5b'));fs[_0x4f01('0x5c')](_0xa018cb);}return _0x26c0f9;})[_0x4f01('0x27')](function(_0x12df91){if(!_0x12df91)throw new InternalError();return _0x12df91[_0x4f01('0x28')]();})[_0x4f01('0x27')](function(){_0x2c2077[_0x4f01('0x1b')](0xcc)['end']();})[_0x4f01('0x40')](handleError(_0x2c2077,null));}; \ No newline at end of file +var _0x5c2e=['map','SquareRecording','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','download','../../components/encryptor','type','uniqueid','savePath','filename','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','unlink','Not\x20found','isNil','Entity\x20not\x20found','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','fast-json-patch','request-promise','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','end','json','offset','limit','undefined','count','set','Content-Range','save','then','destroy','status','stack','name','send','index'];(function(_0x14e7b1,_0x4bc299){var _0x504308=function(_0x3c7270){while(--_0x3c7270){_0x14e7b1['push'](_0x14e7b1['shift']());}};_0x504308(++_0x4bc299);}(_0x5c2e,0xea));var _0xe5c2=function(_0x37a79c,_0x2b19f0){_0x37a79c=_0x37a79c-0x0;var _0x561d89=_0x5c2e[_0x37a79c];return _0x561d89;};'use strict';var emlformat=require(_0xe5c2('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe5c2('0x1'));var rp=require(_0xe5c2('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xe5c2('0x3'));var sox=require(_0xe5c2('0x4'));var csv=require(_0xe5c2('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe5c2('0x6'));var _=require('lodash');var squel=require(_0xe5c2('0x7'));var crypto=require(_0xe5c2('0x8'));var jsforce=require(_0xe5c2('0x9'));var deskjs=require(_0xe5c2('0xa'));var toCsv=require(_0xe5c2('0x5'));var querystring=require(_0xe5c2('0xb'));var Papa=require(_0xe5c2('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe5c2('0xd'));var as=require(_0xe5c2('0xe'));var hardwareService=require(_0xe5c2('0xf'));var logger=require('../../config/logger')(_0xe5c2('0x10'));var utils=require('../../config/utils');var config=require(_0xe5c2('0x11'));var licenseUtil=require(_0xe5c2('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3bf316,_0x177624){_0x177624=_0x177624||0xcc;return function(_0x13d49c){if(_0x13d49c){return _0x3bf316[_0xe5c2('0x13')](_0x177624);}return _0x3bf316['status'](_0x177624)[_0xe5c2('0x14')]();};}function respondWithResult(_0x12ebf9,_0x5dd888){_0x5dd888=_0x5dd888||0xc8;return function(_0x4b095b){if(_0x4b095b){return _0x12ebf9['status'](_0x5dd888)[_0xe5c2('0x15')](_0x4b095b);}};}function respondWithFilteredResult(_0x17cab6,_0x4a2064){return function(_0x25e5c1){if(_0x25e5c1){var _0x1f6fca=typeof _0x4a2064[_0xe5c2('0x16')]==='undefined'&&typeof _0x4a2064[_0xe5c2('0x17')]===_0xe5c2('0x18');var _0x5a11a0=_0x25e5c1[_0xe5c2('0x19')];var _0x99ab67=_0x1f6fca?0x0:_0x4a2064[_0xe5c2('0x16')];var _0x2bc4d2=_0x1f6fca?_0x25e5c1[_0xe5c2('0x19')]:_0x4a2064['offset']+_0x4a2064[_0xe5c2('0x17')];var _0x1c9879;if(_0x2bc4d2>=_0x5a11a0){_0x2bc4d2=_0x5a11a0;_0x1c9879=0xc8;}else{_0x1c9879=0xce;}_0x17cab6['status'](_0x1c9879);return _0x17cab6[_0xe5c2('0x1a')](_0xe5c2('0x1b'),_0x99ab67+'-'+_0x2bc4d2+'/'+_0x5a11a0)['json'](_0x25e5c1);}return null;};}function patchUpdates(_0x5b06e3){return function(_0x527f6b){try{jsonpatch['apply'](_0x527f6b,_0x5b06e3,!![]);}catch(_0x4c0b22){return BPromise['reject'](_0x4c0b22);}return _0x527f6b[_0xe5c2('0x1c')]();};}function saveUpdates(_0x14b8f9,_0x30b63b){return function(_0x4b8a74){if(_0x4b8a74){return _0x4b8a74['update'](_0x14b8f9)[_0xe5c2('0x1d')](function(_0x44d580){return _0x44d580;});}return null;};}function removeEntity(_0x596d32,_0x34d999){return function(_0x1a1e5f){if(_0x1a1e5f){return _0x1a1e5f[_0xe5c2('0x1e')]()[_0xe5c2('0x1d')](function(){_0x596d32[_0xe5c2('0x1f')](0xcc)[_0xe5c2('0x14')]();});}};}function handleEntityNotFound(_0x284e1c,_0x21868a){return function(_0x38f6c9){if(!_0x38f6c9){_0x284e1c[_0xe5c2('0x13')](0x194);}return _0x38f6c9;};}function handleError(_0x190c35,_0x1b303e){_0x1b303e=_0x1b303e||0x1f4;return function(_0x3cca02){logger['error'](_0x3cca02[_0xe5c2('0x20')]);if(_0x3cca02['name']){delete _0x3cca02[_0xe5c2('0x21')];}_0x190c35[_0xe5c2('0x1f')](_0x1b303e)[_0xe5c2('0x22')](_0x3cca02);};}exports[_0xe5c2('0x23')]=function(_0x340a99,_0x3dcaf0){var _0x1e90f8={},_0x52aba5={},_0x33d609={'count':0x0,'rows':[]};var _0x235299=_[_0xe5c2('0x24')](db[_0xe5c2('0x25')][_0xe5c2('0x26')],function(_0xd30d0){return{'name':_0xd30d0[_0xe5c2('0x27')],'type':_0xd30d0['type']['key']};});_0x52aba5[_0xe5c2('0x28')]=_[_0xe5c2('0x24')](_0x235299,_0xe5c2('0x21'));_0x52aba5[_0xe5c2('0x29')]=_[_0xe5c2('0x2a')](_0x340a99['query']);_0x52aba5[_0xe5c2('0x2b')]=_[_0xe5c2('0x2c')](_0x52aba5[_0xe5c2('0x28')],_0x52aba5[_0xe5c2('0x29')]);_0x1e90f8[_0xe5c2('0x2d')]=_[_0xe5c2('0x2c')](_0x52aba5['model'],qs[_0xe5c2('0x2e')](_0x340a99[_0xe5c2('0x29')][_0xe5c2('0x2e')]));_0x1e90f8['attributes']=_0x1e90f8[_0xe5c2('0x2d')][_0xe5c2('0x2f')]?_0x1e90f8[_0xe5c2('0x2d')]:_0x52aba5[_0xe5c2('0x28')];if(!_0x340a99[_0xe5c2('0x29')][_0xe5c2('0x30')]('nolimit')){_0x1e90f8['limit']=qs[_0xe5c2('0x17')](_0x340a99[_0xe5c2('0x29')][_0xe5c2('0x17')]);_0x1e90f8['offset']=qs[_0xe5c2('0x16')](_0x340a99[_0xe5c2('0x29')][_0xe5c2('0x16')]);}_0x1e90f8[_0xe5c2('0x31')]=qs[_0xe5c2('0x32')](_0x340a99[_0xe5c2('0x29')]['sort']);_0x1e90f8[_0xe5c2('0x33')]=qs['filters'](_[_0xe5c2('0x34')](_0x340a99['query'],_0x52aba5['filters']),_0x235299);if(_0x340a99[_0xe5c2('0x29')][_0xe5c2('0x35')]){_0x1e90f8['where']=_[_0xe5c2('0x36')](_0x1e90f8['where'],{'$or':_['map'](_0x235299,function(_0x2b92a3){if(_0x2b92a3['type']!==_0xe5c2('0x37')){var _0x4395b3={};_0x4395b3[_0x2b92a3[_0xe5c2('0x21')]]={'$like':'%'+_0x340a99[_0xe5c2('0x29')][_0xe5c2('0x35')]+'%'};return _0x4395b3;}})});}_0x1e90f8=_[_0xe5c2('0x36')]({},_0x1e90f8,_0x340a99['options']);var _0x52da80={'where':_0x1e90f8['where']};return db[_0xe5c2('0x25')][_0xe5c2('0x19')](_0x52da80)[_0xe5c2('0x1d')](function(_0x436654){_0x33d609[_0xe5c2('0x19')]=_0x436654;if(_0x340a99[_0xe5c2('0x29')][_0xe5c2('0x38')]){_0x1e90f8[_0xe5c2('0x39')]=[{'all':!![]}];}return db[_0xe5c2('0x25')][_0xe5c2('0x3a')](_0x1e90f8);})[_0xe5c2('0x1d')](function(_0x260517){_0x33d609[_0xe5c2('0x3b')]=_0x260517;return _0x33d609;})[_0xe5c2('0x1d')](respondWithFilteredResult(_0x3dcaf0,_0x1e90f8))[_0xe5c2('0x3c')](handleError(_0x3dcaf0,null));};exports[_0xe5c2('0x3d')]=function(_0x47a449,_0x2dbf9c){var _0xed3e11={'raw':!![],'where':{'id':_0x47a449[_0xe5c2('0x3e')]['id']}},_0x4385db={};_0x4385db[_0xe5c2('0x28')]=_[_0xe5c2('0x2a')](db[_0xe5c2('0x25')][_0xe5c2('0x26')]);_0x4385db['query']=_['keys'](_0x47a449[_0xe5c2('0x29')]);_0x4385db[_0xe5c2('0x2b')]=_[_0xe5c2('0x2c')](_0x4385db[_0xe5c2('0x28')],_0x4385db[_0xe5c2('0x29')]);_0xed3e11['attributes']=_['intersection'](_0x4385db[_0xe5c2('0x28')],qs[_0xe5c2('0x2e')](_0x47a449[_0xe5c2('0x29')][_0xe5c2('0x2e')]));_0xed3e11[_0xe5c2('0x2d')]=_0xed3e11[_0xe5c2('0x2d')][_0xe5c2('0x2f')]?_0xed3e11[_0xe5c2('0x2d')]:_0x4385db[_0xe5c2('0x28')];if(_0x47a449['query'][_0xe5c2('0x38')]){_0xed3e11[_0xe5c2('0x39')]=[{'all':!![]}];}_0xed3e11=_[_0xe5c2('0x36')]({},_0xed3e11,_0x47a449['options']);return db['SquareRecording'][_0xe5c2('0x3f')](_0xed3e11)['then'](handleEntityNotFound(_0x2dbf9c,null))['then'](respondWithResult(_0x2dbf9c,null))[_0xe5c2('0x3c')](handleError(_0x2dbf9c,null));};exports[_0xe5c2('0x40')]=function(_0x557329,_0x4a07ca){return db[_0xe5c2('0x25')][_0xe5c2('0x40')](_0x557329[_0xe5c2('0x41')],{})['then'](respondWithResult(_0x4a07ca,0xc9))[_0xe5c2('0x3c')](handleError(_0x4a07ca,null));};exports[_0xe5c2('0x42')]=function(_0x4fc907,_0x256da1){if(_0x4fc907['body']['id']){delete _0x4fc907[_0xe5c2('0x41')]['id'];}return db[_0xe5c2('0x25')]['find']({'where':{'id':_0x4fc907[_0xe5c2('0x3e')]['id']}})[_0xe5c2('0x1d')](handleEntityNotFound(_0x256da1,null))['then'](saveUpdates(_0x4fc907[_0xe5c2('0x41')],null))['then'](respondWithResult(_0x256da1,null))[_0xe5c2('0x3c')](handleError(_0x256da1,null));};exports[_0xe5c2('0x43')]=function(_0x42df6f,_0x89d3e8,_0x286f4a){var _0x320841=require(_0xe5c2('0x44'));var _0x37931f=![];var _0x5b7b98={};if(_0x42df6f['query'][_0xe5c2('0x45')]&&_0x42df6f[_0xe5c2('0x29')]['type']===_0xe5c2('0x46')){_0x5b7b98['uniqueid']=_0x42df6f[_0xe5c2('0x3e')]['id'];}else{_0x5b7b98['id']=_0x42df6f['params']['id'];}return db['SquareRecording'][_0xe5c2('0x3f')]({'where':_0x5b7b98,'attributes':['id',_0xe5c2('0x47'),_0xe5c2('0x48')],'raw':!![]})[_0xe5c2('0x1d')](handleEntityNotFound(_0x89d3e8,null))[_0xe5c2('0x1d')](function(_0x605825){if(_0x605825){var _0x5c3420=_0x605825[_0xe5c2('0x47')];var _0x1f3bfd=util['format'](_0xe5c2('0x49'),_0x5c3420);if(fs[_0xe5c2('0x4a')](_0x1f3bfd)){_0x37931f=!![];return _0x320841[_0xe5c2('0x4b')](_0x1f3bfd,_0x5c3420,config[_0xe5c2('0x4c')][_0xe5c2('0x4d')])[_0xe5c2('0x1d')](function(){return _0x605825;});}return _0x605825;}})[_0xe5c2('0x1d')](function(_0x2ca2a8){if(_0x2ca2a8){var _0x2b1c27=_0x2ca2a8['savePath'];if(!fs['existsSync'](_0x2b1c27)){throw new db[(_0xe5c2('0x4e'))][(_0xe5c2('0x4f'))](_0xe5c2('0x50'));}if(_0x2ca2a8[_0xe5c2('0x48')]){return _0x89d3e8[_0xe5c2('0x43')](_0x2b1c27,_0x2ca2a8['filename']+path['extname'](_0x2b1c27),function(){if(_0x37931f){fs[_0xe5c2('0x51')](_0x2b1c27);}});}else{return _0x89d3e8[_0xe5c2('0x43')](_0x2b1c27,function(_0x299bd0){if(_0x37931f){fs[_0xe5c2('0x51')](_0x2b1c27);}});}}})['catch'](function(_0x1acc7b){if(_0x1acc7b['message']===_0xe5c2('0x50')){_0x89d3e8[_0xe5c2('0x1f')](0x194)[_0xe5c2('0x22')](_0xe5c2('0x52'));}else{return handleError(_0x89d3e8,null);}});};exports[_0xe5c2('0x1e')]=function(_0x136c89,_0x4aad2a){return db[_0xe5c2('0x25')][_0xe5c2('0x3f')]({'where':{'id':_0x136c89['params']['id']}})[_0xe5c2('0x1d')](function(_0x5c86d2){if(_[_0xe5c2('0x53')](_0x5c86d2)){throw new ReferenceError(_0xe5c2('0x54'));}return _0x5c86d2;})[_0xe5c2('0x1d')](function(_0x5b1b73){var _0x13b74a=_0x5b1b73[_0xe5c2('0x47')];logger[_0xe5c2('0x55')]('cancellazione\x20fisica\x20documento\x20%s',_0x13b74a);if(!_[_0xe5c2('0x53')](_0x5b1b73[_0xe5c2('0x47')])&&fs[_0xe5c2('0x4a')](_0x13b74a)){logger[_0xe5c2('0x55')](_0xe5c2('0x56')+_0x13b74a+_0xe5c2('0x57'));fs[_0xe5c2('0x58')](_0x13b74a);}_0x13b74a=_0x13b74a+_0xe5c2('0x59');if(!_[_0xe5c2('0x53')](_0x5b1b73['savePath'])&&fs['existsSync'](_0x13b74a)){logger[_0xe5c2('0x55')]('File:\x20\x22'+_0x13b74a+_0xe5c2('0x57'));fs[_0xe5c2('0x58')](_0x13b74a);}return _0x5b1b73;})['then'](function(_0x1c92f3){if(!_0x1c92f3)throw new InternalError();return _0x1c92f3[_0xe5c2('0x1e')]();})['then'](function(){_0x4aad2a[_0xe5c2('0x1f')](0xcc)[_0xe5c2('0x14')]();})[_0xe5c2('0x3c')](handleError(_0x4aad2a,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 083a0d2..853fc40 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 _0x13c5=['exports','square_recordings','lodash','path','./squareRecording.attributes'];(function(_0x3fe469,_0x40058a){var _0x78e9ae=function(_0xe474eb){while(--_0xe474eb){_0x3fe469['push'](_0x3fe469['shift']());}};_0x78e9ae(++_0x40058a);}(_0x13c5,0x7a));var _0x513c=function(_0xcd903d,_0x2dcbc0){_0xcd903d=_0xcd903d-0x0;var _0x4342a3=_0x13c5[_0xcd903d];return _0x4342a3;};'use strict';var _=require(_0x513c('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x513c('0x1'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x513c('0x2'));module[_0x513c('0x3')]=function(_0x982017,_0x2ad2db){return _0x982017['define']('SquareRecording',attributes,{'tableName':_0x513c('0x4'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x07fa=['../../config/logger','api','moment','bluebird','path','rimraf','SquareRecording','util'];(function(_0x4fccad,_0x4cbcd3){var _0xae928f=function(_0x39d273){while(--_0x39d273){_0x4fccad['push'](_0x4fccad['shift']());}};_0xae928f(++_0x4cbcd3);}(_0x07fa,0x177));var _0xa07f=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x07fa[_0x178e48];return _0x440d7e;};'use strict';var _=require('lodash');var util=require(_0xa07f('0x0'));var logger=require(_0xa07f('0x1'))(_0xa07f('0x2'));var moment=require(_0xa07f('0x3'));var BPromise=require(_0xa07f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa07f('0x5'));var rimraf=require(_0xa07f('0x6'));var config=require('../../config/environment');var attributes=require('./squareRecording.attributes');module['exports']=function(_0x3fb738,_0x362c91){return _0x3fb738['define'](_0xa07f('0x7'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index 568b222..88f24b5 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 _0xe38e=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','CreateSquareRecording','SquareRecording','create','body','then','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xf5d71c,_0x2613a6){var _0x5af672=function(_0x191f52){while(--_0x191f52){_0xf5d71c['push'](_0xf5d71c['shift']());}};_0x5af672(++_0x2613a6);}(_0xe38e,0x1e0));var _0xee38=function(_0xa685f1,_0x14b0e2){_0xa685f1=_0xa685f1-0x0;var _0x566511=_0xe38e[_0xa685f1];return _0x566511;};'use strict';var _=require(_0xee38('0x0'));var util=require('util');var moment=require(_0xee38('0x1'));var BPromise=require(_0xee38('0x2'));var rs=require(_0xee38('0x3'));var fs=require('fs');var Redis=require(_0xee38('0x4'));var db=require(_0xee38('0x5'))['db'];var utils=require(_0xee38('0x6'));var logger=require(_0xee38('0x7'))('rpc');var config=require(_0xee38('0x8'));var jayson=require(_0xee38('0x9'));var client=jayson['client'][_0xee38('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x10bd47,_0x5266fc,_0x247011){return new BPromise(function(_0x529145,_0x173318){return client[_0xee38('0xb')](_0x10bd47,_0x247011)['then'](function(_0x2e9c9c){logger['info'](_0xee38('0xc'),_0x5266fc,_0xee38('0xd'));logger[_0xee38('0xe')](_0xee38('0xf'),_0x5266fc,_0xee38('0xd'),JSON[_0xee38('0x10')](_0x2e9c9c));if(_0x2e9c9c['error']){if(_0x2e9c9c[_0xee38('0x11')][_0xee38('0x12')]===0x1f4){logger[_0xee38('0x11')](_0xee38('0xc'),_0x5266fc,_0x2e9c9c[_0xee38('0x11')][_0xee38('0x13')]);return _0x173318(_0x2e9c9c[_0xee38('0x11')][_0xee38('0x13')]);}logger[_0xee38('0x11')](_0xee38('0xc'),_0x5266fc,_0x2e9c9c[_0xee38('0x11')][_0xee38('0x13')]);return _0x529145(_0x2e9c9c['error']['message']);}else{logger[_0xee38('0x14')](_0xee38('0xc'),_0x5266fc,_0xee38('0xd'));_0x529145(_0x2e9c9c['result']['message']);}})[_0xee38('0x15')](function(_0x1c6a28){logger[_0xee38('0x11')](_0xee38('0xc'),_0x5266fc,_0x1c6a28);_0x173318(_0x1c6a28);});});}exports[_0xee38('0x16')]=function(_0x4707e7){var _0x137974=this;return new Promise(function(_0x40afb0,_0x5b2b04){return db[_0xee38('0x17')][_0xee38('0x18')](_0x4707e7[_0xee38('0x19')],{'raw':_0x4707e7['options']?_0x4707e7['options']['raw']===undefined?!![]:![]:!![]})[_0xee38('0x1a')](function(_0x432a6e){logger['info'](_0xee38('0x16'),_0x4707e7);logger[_0xee38('0xe')](_0xee38('0x16'),_0x4707e7,JSON[_0xee38('0x10')](_0x432a6e));_0x40afb0(_0x432a6e);})[_0xee38('0x15')](function(_0x47329e){logger['error'](_0xee38('0x16'),_0x47329e[_0xee38('0x13')],_0x4707e7);_0x5b2b04(_0x137974['error'](0x1f4,_0x47329e[_0xee38('0x13')]));});});}; \ No newline at end of file +var _0x8bd3=['request','then','info','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SquareRecording,\x20%s,\x20%s','result','CreateSquareRecording','SquareRecording','body','options','raw','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x174cef,_0x393495){var _0x238b83=function(_0x2c78d3){while(--_0x2c78d3){_0x174cef['push'](_0x174cef['shift']());}};_0x238b83(++_0x393495);}(_0x8bd3,0x1b6));var _0x38bd=function(_0x40f4cc,_0x432f55){_0x40f4cc=_0x40f4cc-0x0;var _0x458315=_0x8bd3[_0x40f4cc];return _0x458315;};'use strict';var _=require('lodash');var util=require(_0x38bd('0x0'));var moment=require(_0x38bd('0x1'));var BPromise=require(_0x38bd('0x2'));var rs=require(_0x38bd('0x3'));var fs=require('fs');var Redis=require(_0x38bd('0x4'));var db=require(_0x38bd('0x5'))['db'];var utils=require(_0x38bd('0x6'));var logger=require(_0x38bd('0x7'))('rpc');var config=require(_0x38bd('0x8'));var jayson=require(_0x38bd('0x9'));var client=jayson[_0x38bd('0xa')][_0x38bd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52c3d2,_0x285a8f,_0x1494d7){return new BPromise(function(_0x40a054,_0x6b895c){return client[_0x38bd('0xc')](_0x52c3d2,_0x1494d7)[_0x38bd('0xd')](function(_0x51317f){logger[_0x38bd('0xe')]('SquareRecording,\x20%s,\x20%s',_0x285a8f,_0x38bd('0xf'));logger[_0x38bd('0x10')](_0x38bd('0x11'),_0x285a8f,'request\x20sent',JSON[_0x38bd('0x12')](_0x51317f));if(_0x51317f[_0x38bd('0x13')]){if(_0x51317f[_0x38bd('0x13')][_0x38bd('0x14')]===0x1f4){logger['error']('SquareRecording,\x20%s,\x20%s',_0x285a8f,_0x51317f[_0x38bd('0x13')][_0x38bd('0x15')]);return _0x6b895c(_0x51317f['error'][_0x38bd('0x15')]);}logger['error'](_0x38bd('0x16'),_0x285a8f,_0x51317f['error'][_0x38bd('0x15')]);return _0x40a054(_0x51317f['error'][_0x38bd('0x15')]);}else{logger[_0x38bd('0xe')](_0x38bd('0x16'),_0x285a8f,_0x38bd('0xf'));_0x40a054(_0x51317f[_0x38bd('0x17')][_0x38bd('0x15')]);}})['catch'](function(_0x492199){logger[_0x38bd('0x13')]('SquareRecording,\x20%s,\x20%s',_0x285a8f,_0x492199);_0x6b895c(_0x492199);});});}exports[_0x38bd('0x18')]=function(_0x131996){var _0x3a4b4a=this;return new Promise(function(_0x5eb0e7,_0x2d8f62){return db[_0x38bd('0x19')]['create'](_0x131996[_0x38bd('0x1a')],{'raw':_0x131996[_0x38bd('0x1b')]?_0x131996[_0x38bd('0x1b')][_0x38bd('0x1c')]===undefined?!![]:![]:!![]})[_0x38bd('0xd')](function(_0x2b132f){logger['info'](_0x38bd('0x18'),_0x131996);logger[_0x38bd('0x10')](_0x38bd('0x18'),_0x131996,JSON[_0x38bd('0x12')](_0x2b132f));_0x5eb0e7(_0x2b132f);})[_0x38bd('0x1d')](function(_0x54bd0e){logger[_0x38bd('0x13')](_0x38bd('0x18'),_0x54bd0e[_0x38bd('0x15')],_0x131996);_0x2d8f62(_0x3a4b4a['error'](0x1f4,_0x54bd0e[_0x38bd('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 7156090..fb49a8e 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(_0x26c04b,_0x43a36){var _0x5d1bed=function(_0x2d60af){while(--_0x2d60af){_0x26c04b['push'](_0x26c04b['shift']());}};_0x5d1bed(++_0x43a36);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbaf0[_0x6c993a];return _0x27f547;};'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 _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(_0x52de74,_0x152687){var _0x33113e=function(_0x182424){while(--_0x182424){_0x52de74['push'](_0x52de74['shift']());}};_0x33113e(++_0x152687);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./squareReport.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 39466ca..7c89218 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 _0x2b63=['sequelize','exports','STRING','DATE'];(function(_0x2c398c,_0x26eee2){var _0x1a7964=function(_0x2b04f3){while(--_0x2b04f3){_0x2c398c['push'](_0x2c398c['shift']());}};_0x1a7964(++_0x26eee2);}(_0x2b63,0x1d4));var _0x32b6=function(_0x30735f,_0x3c2cec){_0x30735f=_0x30735f-0x0;var _0x140ac6=_0x2b63[_0x30735f];return _0x140ac6;};'use strict';var Sequelize=require(_0x32b6('0x0'));module[_0x32b6('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x32b6('0x2')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x32b6('0x2')]},'uniqueid':{'type':Sequelize[_0x32b6('0x2')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x32b6('0x2')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0x32b6('0x2')]},'callingani2':{'type':Sequelize[_0x32b6('0x2')]},'callington':{'type':Sequelize[_0x32b6('0x2')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x32b6('0x2')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x32b6('0x2')]},'extension':{'type':Sequelize[_0x32b6('0x2')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x32b6('0x2')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0x32b6('0x2')]},'project_name':{'type':Sequelize[_0x32b6('0x2')]},'joinAt':{'type':Sequelize[_0x32b6('0x3')]},'leaveAt':{'type':Sequelize[_0x32b6('0x3')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x8ce1=['STRING','DATE','BOOLEAN','sequelize'];(function(_0x8d8917,_0x504e20){var _0x55bd93=function(_0x24db56){while(--_0x24db56){_0x8d8917['push'](_0x8d8917['shift']());}};_0x55bd93(++_0x504e20);}(_0x8ce1,0xc7));var _0x18ce=function(_0x538975,_0x491851){_0x538975=_0x538975-0x0;var _0x6452b=_0x8ce1[_0x538975];return _0x6452b;};'use strict';var Sequelize=require(_0x18ce('0x0'));module['exports']={'network':{'type':Sequelize[_0x18ce('0x1')]},'network_script':{'type':Sequelize[_0x18ce('0x1')]},'request':{'type':Sequelize[_0x18ce('0x1')]},'channel':{'type':Sequelize[_0x18ce('0x1')]},'language':{'type':Sequelize[_0x18ce('0x1')]},'type':{'type':Sequelize[_0x18ce('0x1')]},'uniqueid':{'type':Sequelize[_0x18ce('0x1')]},'version':{'type':Sequelize[_0x18ce('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x18ce('0x1')]},'callingpres':{'type':Sequelize[_0x18ce('0x1')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0x18ce('0x1')]},'callingtns':{'type':Sequelize[_0x18ce('0x1')]},'dnid':{'type':Sequelize[_0x18ce('0x1')]},'rdnis':{'type':Sequelize[_0x18ce('0x1')]},'context':{'type':Sequelize[_0x18ce('0x1')]},'extension':{'type':Sequelize[_0x18ce('0x1')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x18ce('0x1')]},'accountcode':{'type':Sequelize[_0x18ce('0x1')]},'threadid':{'type':Sequelize[_0x18ce('0x1')]},'project_name':{'type':Sequelize[_0x18ce('0x1')]},'joinAt':{'type':Sequelize[_0x18ce('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0x18ce('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index b68306d..8cacc9d 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 _0xd92b=['api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','save','update','then','name','send','index','map','SquareReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','options','findAll','rows','catch','show','params','includeAll','find','create','body','destroy','describe','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/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x815ca5,_0x3bbad3){var _0x42b5ec=function(_0x5a7bc6){while(--_0x5a7bc6){_0x815ca5['push'](_0x815ca5['shift']());}};_0x42b5ec(++_0x3bbad3);}(_0xd92b,0x116));var _0xbd92=function(_0x2a9c27,_0xa9f75){_0x2a9c27=_0x2a9c27-0x0;var _0x22b1c9=_0xd92b[_0x2a9c27];return _0x22b1c9;};'use strict';var emlformat=require(_0xbd92('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbd92('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbd92('0x2'));var moment=require(_0xbd92('0x3'));var BPromise=require(_0xbd92('0x4'));var Mustache=require(_0xbd92('0x5'));var util=require(_0xbd92('0x6'));var path=require(_0xbd92('0x7'));var sox=require(_0xbd92('0x8'));var csv=require(_0xbd92('0x9'));var ejs=require(_0xbd92('0xa'));var fs=require('fs');var fs_extra=require(_0xbd92('0xb'));var _=require(_0xbd92('0xc'));var squel=require(_0xbd92('0xd'));var crypto=require(_0xbd92('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xbd92('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbd92('0x10'));var Redis=require(_0xbd92('0x11'));var authService=require(_0xbd92('0x12'));var qs=require(_0xbd92('0x13'));var as=require(_0xbd92('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbd92('0x15'))(_0xbd92('0x16'));var utils=require(_0xbd92('0x17'));var config=require(_0xbd92('0x18'));var licenseUtil=require(_0xbd92('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x15d00a,_0x3d431f){_0x3d431f=_0x3d431f||0xcc;return function(_0x275567){if(_0x275567){return _0x15d00a[_0xbd92('0x1a')](_0x3d431f);}return _0x15d00a[_0xbd92('0x1b')](_0x3d431f)[_0xbd92('0x1c')]();};}function respondWithResult(_0x46f1b0,_0x1f758a){_0x1f758a=_0x1f758a||0xc8;return function(_0x2e2ba4){if(_0x2e2ba4){return _0x46f1b0[_0xbd92('0x1b')](_0x1f758a)[_0xbd92('0x1d')](_0x2e2ba4);}};}function respondWithFilteredResult(_0x4e0597,_0x4b1d7e){return function(_0x5af1f7){if(_0x5af1f7){var _0x3b81b5=typeof _0x4b1d7e['offset']===_0xbd92('0x1e')&&typeof _0x4b1d7e[_0xbd92('0x1f')]===_0xbd92('0x1e');var _0x4b6301=_0x5af1f7[_0xbd92('0x20')];var _0x3511ae=_0x3b81b5?0x0:_0x4b1d7e[_0xbd92('0x21')];var _0x5e3854=_0x3b81b5?_0x5af1f7[_0xbd92('0x20')]:_0x4b1d7e[_0xbd92('0x21')]+_0x4b1d7e[_0xbd92('0x1f')];var _0x51d1f4;if(_0x5e3854>=_0x4b6301){_0x5e3854=_0x4b6301;_0x51d1f4=0xc8;}else{_0x51d1f4=0xce;}_0x4e0597[_0xbd92('0x1b')](_0x51d1f4);return _0x4e0597['set'](_0xbd92('0x22'),_0x3511ae+'-'+_0x5e3854+'/'+_0x4b6301)[_0xbd92('0x1d')](_0x5af1f7);}return null;};}function patchUpdates(_0x2689ef){return function(_0x228c7d){try{jsonpatch['apply'](_0x228c7d,_0x2689ef,!![]);}catch(_0x277c83){return BPromise['reject'](_0x277c83);}return _0x228c7d[_0xbd92('0x23')]();};}function saveUpdates(_0x1197aa,_0x36df86){return function(_0x281857){if(_0x281857){return _0x281857[_0xbd92('0x24')](_0x1197aa)[_0xbd92('0x25')](function(_0x4b9fdf){return _0x4b9fdf;});}return null;};}function removeEntity(_0x5ba96c,_0x5cd017){return function(_0x4d4cc5){if(_0x4d4cc5){return _0x4d4cc5['destroy']()[_0xbd92('0x25')](function(){_0x5ba96c['status'](0xcc)[_0xbd92('0x1c')]();});}};}function handleEntityNotFound(_0x5f1a75,_0x2db368){return function(_0x579db6){if(!_0x579db6){_0x5f1a75[_0xbd92('0x1a')](0x194);}return _0x579db6;};}function handleError(_0xccfd2e,_0x16e52c){_0x16e52c=_0x16e52c||0x1f4;return function(_0x3da33a){logger['error'](_0x3da33a['stack']);if(_0x3da33a[_0xbd92('0x26')]){delete _0x3da33a[_0xbd92('0x26')];}_0xccfd2e[_0xbd92('0x1b')](_0x16e52c)[_0xbd92('0x27')](_0x3da33a);};}exports[_0xbd92('0x28')]=function(_0x2b3649,_0x115be6){var _0x3ca977={},_0x1d7b67={},_0x7d5b33={'count':0x0,'rows':[]};var _0x213c26=_[_0xbd92('0x29')](db[_0xbd92('0x2a')][_0xbd92('0x2b')],function(_0x307b28){return{'name':_0x307b28[_0xbd92('0x2c')],'type':_0x307b28[_0xbd92('0x2d')][_0xbd92('0x2e')]};});_0x1d7b67[_0xbd92('0x2f')]=_['map'](_0x213c26,'name');_0x1d7b67[_0xbd92('0x30')]=_[_0xbd92('0x31')](_0x2b3649[_0xbd92('0x30')]);_0x1d7b67['filters']=_[_0xbd92('0x32')](_0x1d7b67[_0xbd92('0x2f')],_0x1d7b67['query']);_0x3ca977[_0xbd92('0x33')]=_['intersection'](_0x1d7b67['model'],qs['fields'](_0x2b3649[_0xbd92('0x30')][_0xbd92('0x34')]));_0x3ca977['attributes']=_0x3ca977[_0xbd92('0x33')][_0xbd92('0x35')]?_0x3ca977[_0xbd92('0x33')]:_0x1d7b67[_0xbd92('0x2f')];if(!_0x2b3649[_0xbd92('0x30')][_0xbd92('0x36')](_0xbd92('0x37'))){_0x3ca977[_0xbd92('0x1f')]=qs[_0xbd92('0x1f')](_0x2b3649[_0xbd92('0x30')][_0xbd92('0x1f')]);_0x3ca977['offset']=qs[_0xbd92('0x21')](_0x2b3649['query'][_0xbd92('0x21')]);}_0x3ca977[_0xbd92('0x38')]=qs['sort'](_0x2b3649[_0xbd92('0x30')][_0xbd92('0x39')]);_0x3ca977[_0xbd92('0x3a')]=qs['filters'](_[_0xbd92('0x3b')](_0x2b3649[_0xbd92('0x30')],_0x1d7b67[_0xbd92('0x3c')]),_0x213c26);if(_0x2b3649[_0xbd92('0x30')][_0xbd92('0x3d')]){_0x3ca977[_0xbd92('0x3a')]=_[_0xbd92('0x3e')](_0x3ca977[_0xbd92('0x3a')],{'$or':_['map'](_0x213c26,function(_0x9acae7){if(_0x9acae7[_0xbd92('0x2d')]!=='VIRTUAL'){var _0x44f455={};_0x44f455[_0x9acae7['name']]={'$like':'%'+_0x2b3649['query']['filter']+'%'};return _0x44f455;}})});}_0x3ca977=_[_0xbd92('0x3e')]({},_0x3ca977,_0x2b3649[_0xbd92('0x3f')]);var _0x544cb5={'where':_0x3ca977['where']};return db['SquareReport']['count'](_0x544cb5)[_0xbd92('0x25')](function(_0x11a898){_0x7d5b33[_0xbd92('0x20')]=_0x11a898;if(_0x2b3649['query']['includeAll']){_0x3ca977['include']=[{'all':!![]}];}return db[_0xbd92('0x2a')][_0xbd92('0x40')](_0x3ca977);})['then'](function(_0x52fe94){_0x7d5b33[_0xbd92('0x41')]=_0x52fe94;return _0x7d5b33;})['then'](respondWithFilteredResult(_0x115be6,_0x3ca977))[_0xbd92('0x42')](handleError(_0x115be6,null));};exports[_0xbd92('0x43')]=function(_0x5a61e9,_0x51ff62){var _0x12aae2={'raw':!![],'where':{'id':_0x5a61e9[_0xbd92('0x44')]['id']}},_0x3975a0={};_0x3975a0[_0xbd92('0x2f')]=_['keys'](db[_0xbd92('0x2a')][_0xbd92('0x2b')]);_0x3975a0[_0xbd92('0x30')]=_[_0xbd92('0x31')](_0x5a61e9[_0xbd92('0x30')]);_0x3975a0[_0xbd92('0x3c')]=_[_0xbd92('0x32')](_0x3975a0[_0xbd92('0x2f')],_0x3975a0['query']);_0x12aae2['attributes']=_['intersection'](_0x3975a0[_0xbd92('0x2f')],qs['fields'](_0x5a61e9['query']['fields']));_0x12aae2[_0xbd92('0x33')]=_0x12aae2['attributes'][_0xbd92('0x35')]?_0x12aae2[_0xbd92('0x33')]:_0x3975a0[_0xbd92('0x2f')];if(_0x5a61e9[_0xbd92('0x30')][_0xbd92('0x45')]){_0x12aae2['include']=[{'all':!![]}];}_0x12aae2=_[_0xbd92('0x3e')]({},_0x12aae2,_0x5a61e9[_0xbd92('0x3f')]);return db[_0xbd92('0x2a')][_0xbd92('0x46')](_0x12aae2)[_0xbd92('0x25')](handleEntityNotFound(_0x51ff62,null))[_0xbd92('0x25')](respondWithResult(_0x51ff62,null))[_0xbd92('0x42')](handleError(_0x51ff62,null));};exports[_0xbd92('0x47')]=function(_0xe02b35,_0x1b48df){return db[_0xbd92('0x2a')][_0xbd92('0x47')](_0xe02b35[_0xbd92('0x48')],{})[_0xbd92('0x25')](respondWithResult(_0x1b48df,0xc9))[_0xbd92('0x42')](handleError(_0x1b48df,null));};exports['update']=function(_0x5bd635,_0x17d598){if(_0x5bd635[_0xbd92('0x48')]['id']){delete _0x5bd635[_0xbd92('0x48')]['id'];}return db[_0xbd92('0x2a')][_0xbd92('0x46')]({'where':{'id':_0x5bd635[_0xbd92('0x44')]['id']}})['then'](handleEntityNotFound(_0x17d598,null))[_0xbd92('0x25')](saveUpdates(_0x5bd635[_0xbd92('0x48')],null))[_0xbd92('0x25')](respondWithResult(_0x17d598,null))['catch'](handleError(_0x17d598,null));};exports[_0xbd92('0x49')]=function(_0x47986a,_0x340719){return db['SquareReport'][_0xbd92('0x46')]({'where':{'id':_0x47986a[_0xbd92('0x44')]['id']}})[_0xbd92('0x25')](handleEntityNotFound(_0x340719,null))[_0xbd92('0x25')](removeEntity(_0x340719,null))[_0xbd92('0x42')](handleError(_0x340719,null));};exports[_0xbd92('0x4a')]=function(_0x593247,_0x555819){return db[_0xbd92('0x2a')][_0xbd92('0x4a')]()[_0xbd92('0x25')](respondWithResult(_0x555819,null))[_0xbd92('0x42')](handleError(_0x555819,null));}; \ No newline at end of file +var _0xd3ee=['end','json','offset','limit','undefined','count','set','Content-Range','save','update','then','stack','name','send','index','SquareReport','rawAttributes','type','map','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','include','find','create','body','destroy','describe','eml-format','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0xfbd17b,_0x13445f){var _0x35e40f=function(_0x8c0349){while(--_0x8c0349){_0xfbd17b['push'](_0xfbd17b['shift']());}};_0x35e40f(++_0x13445f);}(_0xd3ee,0x1a6));var _0xed3e=function(_0x4a5494,_0x3ad336){_0x4a5494=_0x4a5494-0x0;var _0x57cbb5=_0xd3ee[_0x4a5494];return _0x57cbb5;};'use strict';var emlformat=require(_0xed3e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xed3e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xed3e('0x2'));var BPromise=require(_0xed3e('0x3'));var Mustache=require(_0xed3e('0x4'));var util=require(_0xed3e('0x5'));var path=require(_0xed3e('0x6'));var sox=require('sox');var csv=require(_0xed3e('0x7'));var ejs=require(_0xed3e('0x8'));var fs=require('fs');var fs_extra=require(_0xed3e('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xed3e('0xa'));var jsforce=require(_0xed3e('0xb'));var deskjs=require(_0xed3e('0xc'));var toCsv=require(_0xed3e('0x7'));var querystring=require(_0xed3e('0xd'));var Papa=require(_0xed3e('0xe'));var Redis=require(_0xed3e('0xf'));var authService=require(_0xed3e('0x10'));var qs=require(_0xed3e('0x11'));var as=require(_0xed3e('0x12'));var hardwareService=require(_0xed3e('0x13'));var logger=require(_0xed3e('0x14'))(_0xed3e('0x15'));var utils=require(_0xed3e('0x16'));var config=require(_0xed3e('0x17'));var licenseUtil=require(_0xed3e('0x18'));var db=require(_0xed3e('0x19'))['db'];function respondWithStatusCode(_0x4adfde,_0x3fe628){_0x3fe628=_0x3fe628||0xcc;return function(_0x203da7){if(_0x203da7){return _0x4adfde[_0xed3e('0x1a')](_0x3fe628);}return _0x4adfde[_0xed3e('0x1b')](_0x3fe628)[_0xed3e('0x1c')]();};}function respondWithResult(_0xbbe8b6,_0x552d1a){_0x552d1a=_0x552d1a||0xc8;return function(_0x53a8c7){if(_0x53a8c7){return _0xbbe8b6[_0xed3e('0x1b')](_0x552d1a)[_0xed3e('0x1d')](_0x53a8c7);}};}function respondWithFilteredResult(_0x4042b4,_0x448389){return function(_0x3c21f5){if(_0x3c21f5){var _0x31faa9=typeof _0x448389[_0xed3e('0x1e')]==='undefined'&&typeof _0x448389[_0xed3e('0x1f')]===_0xed3e('0x20');var _0x4a4126=_0x3c21f5[_0xed3e('0x21')];var _0x40feef=_0x31faa9?0x0:_0x448389['offset'];var _0x3d7fb6=_0x31faa9?_0x3c21f5['count']:_0x448389['offset']+_0x448389[_0xed3e('0x1f')];var _0x15df45;if(_0x3d7fb6>=_0x4a4126){_0x3d7fb6=_0x4a4126;_0x15df45=0xc8;}else{_0x15df45=0xce;}_0x4042b4[_0xed3e('0x1b')](_0x15df45);return _0x4042b4[_0xed3e('0x22')](_0xed3e('0x23'),_0x40feef+'-'+_0x3d7fb6+'/'+_0x4a4126)[_0xed3e('0x1d')](_0x3c21f5);}return null;};}function patchUpdates(_0x134a72){return function(_0x35af95){try{jsonpatch['apply'](_0x35af95,_0x134a72,!![]);}catch(_0x1be1a6){return BPromise['reject'](_0x1be1a6);}return _0x35af95[_0xed3e('0x24')]();};}function saveUpdates(_0x3b0df1,_0x1cd61e){return function(_0x335375){if(_0x335375){return _0x335375[_0xed3e('0x25')](_0x3b0df1)[_0xed3e('0x26')](function(_0x470646){return _0x470646;});}return null;};}function removeEntity(_0x3a6d2d,_0xaa7a9f){return function(_0x4062b8){if(_0x4062b8){return _0x4062b8['destroy']()[_0xed3e('0x26')](function(){_0x3a6d2d[_0xed3e('0x1b')](0xcc)[_0xed3e('0x1c')]();});}};}function handleEntityNotFound(_0x32d74b,_0x3b1e4b){return function(_0x3524a7){if(!_0x3524a7){_0x32d74b[_0xed3e('0x1a')](0x194);}return _0x3524a7;};}function handleError(_0x56331a,_0xe778d8){_0xe778d8=_0xe778d8||0x1f4;return function(_0x8e5582){logger['error'](_0x8e5582[_0xed3e('0x27')]);if(_0x8e5582[_0xed3e('0x28')]){delete _0x8e5582[_0xed3e('0x28')];}_0x56331a[_0xed3e('0x1b')](_0xe778d8)[_0xed3e('0x29')](_0x8e5582);};}exports[_0xed3e('0x2a')]=function(_0x5c369a,_0x548567){var _0x224885={},_0x2437a0={},_0x377cd4={'count':0x0,'rows':[]};var _0x51df14=_['map'](db[_0xed3e('0x2b')][_0xed3e('0x2c')],function(_0x58bb79){return{'name':_0x58bb79['fieldName'],'type':_0x58bb79[_0xed3e('0x2d')]['key']};});_0x2437a0['model']=_[_0xed3e('0x2e')](_0x51df14,_0xed3e('0x28'));_0x2437a0[_0xed3e('0x2f')]=_[_0xed3e('0x30')](_0x5c369a['query']);_0x2437a0[_0xed3e('0x31')]=_['intersection'](_0x2437a0[_0xed3e('0x32')],_0x2437a0['query']);_0x224885['attributes']=_[_0xed3e('0x33')](_0x2437a0[_0xed3e('0x32')],qs[_0xed3e('0x34')](_0x5c369a[_0xed3e('0x2f')][_0xed3e('0x34')]));_0x224885['attributes']=_0x224885[_0xed3e('0x35')][_0xed3e('0x36')]?_0x224885[_0xed3e('0x35')]:_0x2437a0[_0xed3e('0x32')];if(!_0x5c369a[_0xed3e('0x2f')][_0xed3e('0x37')]('nolimit')){_0x224885[_0xed3e('0x1f')]=qs[_0xed3e('0x1f')](_0x5c369a[_0xed3e('0x2f')]['limit']);_0x224885['offset']=qs[_0xed3e('0x1e')](_0x5c369a['query'][_0xed3e('0x1e')]);}_0x224885[_0xed3e('0x38')]=qs[_0xed3e('0x39')](_0x5c369a[_0xed3e('0x2f')][_0xed3e('0x39')]);_0x224885['where']=qs[_0xed3e('0x31')](_[_0xed3e('0x3a')](_0x5c369a[_0xed3e('0x2f')],_0x2437a0[_0xed3e('0x31')]),_0x51df14);if(_0x5c369a[_0xed3e('0x2f')][_0xed3e('0x3b')]){_0x224885[_0xed3e('0x3c')]=_[_0xed3e('0x3d')](_0x224885[_0xed3e('0x3c')],{'$or':_[_0xed3e('0x2e')](_0x51df14,function(_0x561e8a){if(_0x561e8a[_0xed3e('0x2d')]!==_0xed3e('0x3e')){var _0x471e5c={};_0x471e5c[_0x561e8a[_0xed3e('0x28')]]={'$like':'%'+_0x5c369a['query'][_0xed3e('0x3b')]+'%'};return _0x471e5c;}})});}_0x224885=_[_0xed3e('0x3d')]({},_0x224885,_0x5c369a[_0xed3e('0x3f')]);var _0x21c180={'where':_0x224885[_0xed3e('0x3c')]};return db['SquareReport'][_0xed3e('0x21')](_0x21c180)[_0xed3e('0x26')](function(_0x35b4e9){_0x377cd4['count']=_0x35b4e9;if(_0x5c369a['query'][_0xed3e('0x40')]){_0x224885['include']=[{'all':!![]}];}return db['SquareReport'][_0xed3e('0x41')](_0x224885);})[_0xed3e('0x26')](function(_0x5091d0){_0x377cd4[_0xed3e('0x42')]=_0x5091d0;return _0x377cd4;})[_0xed3e('0x26')](respondWithFilteredResult(_0x548567,_0x224885))[_0xed3e('0x43')](handleError(_0x548567,null));};exports['show']=function(_0x2d60f9,_0x54b893){var _0x530a2c={'raw':!![],'where':{'id':_0x2d60f9[_0xed3e('0x44')]['id']}},_0x488fec={};_0x488fec[_0xed3e('0x32')]=_[_0xed3e('0x30')](db[_0xed3e('0x2b')]['rawAttributes']);_0x488fec[_0xed3e('0x2f')]=_[_0xed3e('0x30')](_0x2d60f9['query']);_0x488fec[_0xed3e('0x31')]=_[_0xed3e('0x33')](_0x488fec['model'],_0x488fec[_0xed3e('0x2f')]);_0x530a2c[_0xed3e('0x35')]=_[_0xed3e('0x33')](_0x488fec[_0xed3e('0x32')],qs[_0xed3e('0x34')](_0x2d60f9[_0xed3e('0x2f')][_0xed3e('0x34')]));_0x530a2c[_0xed3e('0x35')]=_0x530a2c[_0xed3e('0x35')][_0xed3e('0x36')]?_0x530a2c[_0xed3e('0x35')]:_0x488fec['model'];if(_0x2d60f9[_0xed3e('0x2f')][_0xed3e('0x40')]){_0x530a2c[_0xed3e('0x45')]=[{'all':!![]}];}_0x530a2c=_[_0xed3e('0x3d')]({},_0x530a2c,_0x2d60f9[_0xed3e('0x3f')]);return db['SquareReport'][_0xed3e('0x46')](_0x530a2c)[_0xed3e('0x26')](handleEntityNotFound(_0x54b893,null))[_0xed3e('0x26')](respondWithResult(_0x54b893,null))[_0xed3e('0x43')](handleError(_0x54b893,null));};exports['create']=function(_0x3545ec,_0x59c13c){return db['SquareReport'][_0xed3e('0x47')](_0x3545ec[_0xed3e('0x48')],{})[_0xed3e('0x26')](respondWithResult(_0x59c13c,0xc9))[_0xed3e('0x43')](handleError(_0x59c13c,null));};exports[_0xed3e('0x25')]=function(_0x41efab,_0x110d19){if(_0x41efab['body']['id']){delete _0x41efab[_0xed3e('0x48')]['id'];}return db['SquareReport'][_0xed3e('0x46')]({'where':{'id':_0x41efab[_0xed3e('0x44')]['id']}})[_0xed3e('0x26')](handleEntityNotFound(_0x110d19,null))[_0xed3e('0x26')](saveUpdates(_0x41efab[_0xed3e('0x48')],null))[_0xed3e('0x26')](respondWithResult(_0x110d19,null))[_0xed3e('0x43')](handleError(_0x110d19,null));};exports[_0xed3e('0x49')]=function(_0x14e287,_0x1cda9f){return db[_0xed3e('0x2b')][_0xed3e('0x46')]({'where':{'id':_0x14e287['params']['id']}})[_0xed3e('0x26')](handleEntityNotFound(_0x1cda9f,null))[_0xed3e('0x26')](removeEntity(_0x1cda9f,null))[_0xed3e('0x43')](handleError(_0x1cda9f,null));};exports[_0xed3e('0x4a')]=function(_0x4bc034,_0x5d2630){return db[_0xed3e('0x2b')][_0xed3e('0x4a')]()[_0xed3e('0x26')](respondWithResult(_0x5d2630,null))[_0xed3e('0x43')](handleError(_0x5d2630,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index ef8084b..1eadd8a 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 _0xfe6c=['project_name','leaveAt','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','exports','define','report_square'];(function(_0x5121f7,_0x4ddd3a){var _0x2b115b=function(_0xa62744){while(--_0xa62744){_0x5121f7['push'](_0x5121f7['shift']());}};_0x2b115b(++_0x4ddd3a);}(_0xfe6c,0x64));var _0xcfe6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfe6c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xcfe6('0x0'));var util=require(_0xcfe6('0x1'));var logger=require(_0xcfe6('0x2'))('api');var moment=require(_0xcfe6('0x3'));var BPromise=require('bluebird');var rp=require(_0xcfe6('0x4'));var fs=require('fs');var path=require(_0xcfe6('0x5'));var rimraf=require(_0xcfe6('0x6'));var config=require(_0xcfe6('0x7'));var attributes=require(_0xcfe6('0x8'));module[_0xcfe6('0x9')]=function(_0x41e7d2,_0x3408a8){return _0x41e7d2[_0xcfe6('0xa')]('SquareReport',attributes,{'tableName':_0xcfe6('0xb'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':['uniqueid',_0xcfe6('0xc')]},{'name':_0xcfe6('0xd'),'fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file +var _0xf3dd=['uid_pname','uniqueid','project_name','leaveAt','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','define','SquareReport','report_square'];(function(_0x5e3903,_0x2ff515){var _0x5a79c6=function(_0x2b9d52){while(--_0x2b9d52){_0x5e3903['push'](_0x5e3903['shift']());}};_0x5a79c6(++_0x2ff515);}(_0xf3dd,0x1f1));var _0xdf3d=function(_0x3b57d2,_0x440aa9){_0x3b57d2=_0x3b57d2-0x0;var _0x5a133f=_0xf3dd[_0x3b57d2];return _0x5a133f;};'use strict';var _=require(_0xdf3d('0x0'));var util=require(_0xdf3d('0x1'));var logger=require('../../config/logger')(_0xdf3d('0x2'));var moment=require(_0xdf3d('0x3'));var BPromise=require(_0xdf3d('0x4'));var rp=require(_0xdf3d('0x5'));var fs=require('fs');var path=require(_0xdf3d('0x6'));var rimraf=require(_0xdf3d('0x7'));var config=require(_0xdf3d('0x8'));var attributes=require(_0xdf3d('0x9'));module['exports']=function(_0x5b2a97,_0x43c0f2){return _0x5b2a97[_0xdf3d('0xa')](_0xdf3d('0xb'),attributes,{'tableName':_0xdf3d('0xc'),'paranoid':![],'indexes':[{'name':_0xdf3d('0xd'),'fields':[_0xdf3d('0xe'),_0xdf3d('0xf')]},{'name':_0xdf3d('0x10'),'fields':[_0xdf3d('0x10')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 32993ef..32e702b 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 _0x8284=['debug','request\x20sent','stringify','error','code','message','SquareReport,\x20%s,\x20%s','info','catch','CreateSquareReport','body','options','raw','UpdateSquareReport','SquareReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x587983,_0x169c97){var _0x4b844c=function(_0x4700e2){while(--_0x4700e2){_0x587983['push'](_0x587983['shift']());}};_0x4b844c(++_0x169c97);}(_0x8284,0x97));var _0x4828=function(_0x5a352e,_0x396cb5){_0x5a352e=_0x5a352e-0x0;var _0x175cb8=_0x8284[_0x5a352e];return _0x175cb8;};'use strict';var _=require(_0x4828('0x0'));var util=require(_0x4828('0x1'));var moment=require(_0x4828('0x2'));var BPromise=require(_0x4828('0x3'));var rs=require(_0x4828('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4828('0x5'));var logger=require(_0x4828('0x6'))(_0x4828('0x7'));var config=require(_0x4828('0x8'));var jayson=require(_0x4828('0x9'));var client=jayson[_0x4828('0xa')][_0x4828('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5a8833,_0x7e17ae,_0x29a108){return new BPromise(function(_0x5e0f01,_0x1e5860){return client[_0x4828('0xc')](_0x5a8833,_0x29a108)[_0x4828('0xd')](function(_0x5ce3a1){logger['info']('SquareReport,\x20%s,\x20%s',_0x7e17ae,'request\x20sent');logger[_0x4828('0xe')]('SquareReport,\x20%s,\x20%s,\x20%s',_0x7e17ae,_0x4828('0xf'),JSON[_0x4828('0x10')](_0x5ce3a1));if(_0x5ce3a1[_0x4828('0x11')]){if(_0x5ce3a1['error'][_0x4828('0x12')]===0x1f4){logger['error']('SquareReport,\x20%s,\x20%s',_0x7e17ae,_0x5ce3a1[_0x4828('0x11')][_0x4828('0x13')]);return _0x1e5860(_0x5ce3a1['error'][_0x4828('0x13')]);}logger['error'](_0x4828('0x14'),_0x7e17ae,_0x5ce3a1[_0x4828('0x11')]['message']);return _0x5e0f01(_0x5ce3a1[_0x4828('0x11')][_0x4828('0x13')]);}else{logger[_0x4828('0x15')](_0x4828('0x14'),_0x7e17ae,_0x4828('0xf'));_0x5e0f01(_0x5ce3a1['result'][_0x4828('0x13')]);}})[_0x4828('0x16')](function(_0x1de2a2){logger[_0x4828('0x11')](_0x4828('0x14'),_0x7e17ae,_0x1de2a2);_0x1e5860(_0x1de2a2);});});}exports[_0x4828('0x17')]=function(_0xc8123){var _0xad509b=this;return new Promise(function(_0x3166fe,_0x2af73d){return db['SquareReport']['create'](_0xc8123[_0x4828('0x18')],{'raw':_0xc8123[_0x4828('0x19')]?_0xc8123['options'][_0x4828('0x1a')]===undefined?!![]:![]:!![]})[_0x4828('0xd')](function(_0x34b2c0){logger[_0x4828('0x15')](_0x4828('0x17'),_0xc8123);logger[_0x4828('0xe')]('CreateSquareReport',_0xc8123,JSON['stringify'](_0x34b2c0));_0x3166fe(_0x34b2c0);})['catch'](function(_0x1d71aa){logger[_0x4828('0x11')]('CreateSquareReport',_0x1d71aa[_0x4828('0x13')],_0xc8123);_0x2af73d(_0xad509b[_0x4828('0x11')](0x1f4,_0x1d71aa[_0x4828('0x13')]));});});};exports[_0x4828('0x1b')]=function(_0x19eb50){var _0x561951=this;return new Promise(function(_0x22848c,_0x11bc99){return db[_0x4828('0x1c')][_0x4828('0x1d')](_0x19eb50[_0x4828('0x18')],{'raw':_0x19eb50[_0x4828('0x19')]?_0x19eb50[_0x4828('0x19')][_0x4828('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19eb50[_0x4828('0x19')]?_0x19eb50[_0x4828('0x19')][_0x4828('0x1e')]||null:null,'attributes':_0x19eb50['options']?_0x19eb50[_0x4828('0x19')][_0x4828('0x1f')]||null:null,'limit':_0x19eb50[_0x4828('0x19')]?_0x19eb50[_0x4828('0x19')][_0x4828('0x20')]||null:null})[_0x4828('0xd')](function(_0x37dd43){logger[_0x4828('0x15')](_0x4828('0x1b'),_0x19eb50);logger[_0x4828('0xe')](_0x4828('0x1b'),_0x19eb50,JSON['stringify'](_0x37dd43));_0x22848c(_0x37dd43);})[_0x4828('0x16')](function(_0x11a2e7){logger['error'](_0x4828('0x1b'),_0x11a2e7['message'],_0x19eb50);_0x11bc99(_0x561951['error'](0x1f4,_0x11a2e7[_0x4828('0x13')]));});});}; \ No newline at end of file +var _0x10e1=['options','stringify','UpdateSquareReport','update','raw','where','attributes','limit','then','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','debug','SquareReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','SquareReport,\x20%s,\x20%s','message','result','catch','CreateSquareReport','SquareReport','create','body'];(function(_0x496978,_0x129c35){var _0x1cb9ef=function(_0x45f7ab){while(--_0x45f7ab){_0x496978['push'](_0x496978['shift']());}};_0x1cb9ef(++_0x129c35);}(_0x10e1,0x14d));var _0x110e=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x10e1[_0x46698a];return _0x356db0;};'use strict';var _=require(_0x110e('0x0'));var util=require('util');var moment=require(_0x110e('0x1'));var BPromise=require(_0x110e('0x2'));var rs=require(_0x110e('0x3'));var fs=require('fs');var Redis=require(_0x110e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x110e('0x5'));var logger=require(_0x110e('0x6'))(_0x110e('0x7'));var config=require(_0x110e('0x8'));var jayson=require(_0x110e('0x9'));var client=jayson[_0x110e('0xa')][_0x110e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1dcf27,_0x272dc4,_0x3dacdc){return new BPromise(function(_0x54cc85,_0x420f30){return client[_0x110e('0xc')](_0x1dcf27,_0x3dacdc)['then'](function(_0x2bb301){logger[_0x110e('0xd')]('SquareReport,\x20%s,\x20%s',_0x272dc4,'request\x20sent');logger[_0x110e('0xe')](_0x110e('0xf'),_0x272dc4,_0x110e('0x10'),JSON['stringify'](_0x2bb301));if(_0x2bb301[_0x110e('0x11')]){if(_0x2bb301[_0x110e('0x11')][_0x110e('0x12')]===0x1f4){logger[_0x110e('0x11')](_0x110e('0x13'),_0x272dc4,_0x2bb301[_0x110e('0x11')][_0x110e('0x14')]);return _0x420f30(_0x2bb301[_0x110e('0x11')][_0x110e('0x14')]);}logger[_0x110e('0x11')]('SquareReport,\x20%s,\x20%s',_0x272dc4,_0x2bb301[_0x110e('0x11')][_0x110e('0x14')]);return _0x54cc85(_0x2bb301[_0x110e('0x11')]['message']);}else{logger['info']('SquareReport,\x20%s,\x20%s',_0x272dc4,_0x110e('0x10'));_0x54cc85(_0x2bb301[_0x110e('0x15')]['message']);}})[_0x110e('0x16')](function(_0x40531f){logger[_0x110e('0x11')](_0x110e('0x13'),_0x272dc4,_0x40531f);_0x420f30(_0x40531f);});});}exports[_0x110e('0x17')]=function(_0x5578ee){var _0x10b187=this;return new Promise(function(_0x597971,_0x3b8d06){return db[_0x110e('0x18')][_0x110e('0x19')](_0x5578ee[_0x110e('0x1a')],{'raw':_0x5578ee[_0x110e('0x1b')]?_0x5578ee['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1fbe7d){logger[_0x110e('0xd')](_0x110e('0x17'),_0x5578ee);logger[_0x110e('0xe')]('CreateSquareReport',_0x5578ee,JSON[_0x110e('0x1c')](_0x1fbe7d));_0x597971(_0x1fbe7d);})[_0x110e('0x16')](function(_0x472ab6){logger[_0x110e('0x11')](_0x110e('0x17'),_0x472ab6['message'],_0x5578ee);_0x3b8d06(_0x10b187[_0x110e('0x11')](0x1f4,_0x472ab6[_0x110e('0x14')]));});});};exports[_0x110e('0x1d')]=function(_0x5a5d26){var _0x2f6b43=this;return new Promise(function(_0x120f24,_0xf81152){return db['SquareReport'][_0x110e('0x1e')](_0x5a5d26[_0x110e('0x1a')],{'raw':_0x5a5d26[_0x110e('0x1b')]?_0x5a5d26[_0x110e('0x1b')][_0x110e('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a5d26[_0x110e('0x1b')]?_0x5a5d26[_0x110e('0x1b')][_0x110e('0x20')]||null:null,'attributes':_0x5a5d26[_0x110e('0x1b')]?_0x5a5d26[_0x110e('0x1b')][_0x110e('0x21')]||null:null,'limit':_0x5a5d26[_0x110e('0x1b')]?_0x5a5d26[_0x110e('0x1b')][_0x110e('0x22')]||null:null})[_0x110e('0x23')](function(_0x147a5d){logger[_0x110e('0xd')](_0x110e('0x1d'),_0x5a5d26);logger[_0x110e('0xe')](_0x110e('0x1d'),_0x5a5d26,JSON[_0x110e('0x1c')](_0x147a5d));_0x120f24(_0x147a5d);})[_0x110e('0x16')](function(_0x1696ba){logger[_0x110e('0x11')](_0x110e('0x1d'),_0x1696ba[_0x110e('0x14')],_0x5a5d26);_0xf81152(_0x2f6b43[_0x110e('0x11')](0x1f4,_0x1696ba[_0x110e('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 321e570..bc13143 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 _0x878c=['../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0xe6e78c,_0x582369){var _0x2a09c8=function(_0x470ccc){while(--_0x470ccc){_0xe6e78c['push'](_0xe6e78c['shift']());}};_0x2a09c8(++_0x582369);}(_0x878c,0x175));var _0xc878=function(_0x2083e6,_0x5a997a){_0x2083e6=_0x2083e6-0x0;var _0x3b1aae=_0x878c[_0x2083e6];return _0x3b1aae;};'use strict';var multer=require('multer');var util=require(_0xc878('0x0'));var path=require(_0xc878('0x1'));var timeout=require(_0xc878('0x2'));var express=require(_0xc878('0x3'));var router=express[_0xc878('0x4')]();var fs_extra=require(_0xc878('0x5'));var auth=require(_0xc878('0x6'));var interaction=require(_0xc878('0x7'));var config=require(_0xc878('0x8'));var controller=require('./squareReportDetail.controller');router[_0xc878('0x9')]('/',auth[_0xc878('0xa')](),controller['index']);router[_0xc878('0x9')](_0xc878('0xb'),auth[_0xc878('0xa')](),controller[_0xc878('0xc')]);router[_0xc878('0x9')](_0xc878('0xd'),auth[_0xc878('0xa')](),controller[_0xc878('0xe')]);router[_0xc878('0xf')]('/',auth[_0xc878('0xa')](),controller[_0xc878('0x10')]);router[_0xc878('0x11')](_0xc878('0xd'),auth[_0xc878('0xa')](),controller[_0xc878('0x12')]);router['delete']('/:id',auth[_0xc878('0xa')](),controller[_0xc878('0x13')]);module['exports']=router; \ No newline at end of file +var _0x744c=['show','create','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./squareReportDetail.controller','get','index','/describe','isAuthenticated','describe','/:id'];(function(_0x366413,_0x3581a0){var _0x20742c=function(_0x279c86){while(--_0x279c86){_0x366413['push'](_0x366413['shift']());}};_0x20742c(++_0x3581a0);}(_0x744c,0xd4));var _0xc744=function(_0x536c66,_0x570b6b){_0x536c66=_0x536c66-0x0;var _0x221d57=_0x744c[_0x536c66];return _0x221d57;};'use strict';var multer=require(_0xc744('0x0'));var util=require(_0xc744('0x1'));var path=require(_0xc744('0x2'));var timeout=require(_0xc744('0x3'));var express=require(_0xc744('0x4'));var router=express[_0xc744('0x5')]();var fs_extra=require(_0xc744('0x6'));var auth=require(_0xc744('0x7'));var interaction=require(_0xc744('0x8'));var config=require('../../config/environment');var controller=require(_0xc744('0x9'));router[_0xc744('0xa')]('/',auth['isAuthenticated'](),controller[_0xc744('0xb')]);router[_0xc744('0xa')](_0xc744('0xc'),auth[_0xc744('0xd')](),controller[_0xc744('0xe')]);router[_0xc744('0xa')](_0xc744('0xf'),auth[_0xc744('0xd')](),controller[_0xc744('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc744('0x11')]);router['put'](_0xc744('0xf'),auth[_0xc744('0xd')](),controller['update']);router[_0xc744('0x12')]('/:id',auth[_0xc744('0xd')](),controller['destroy']);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 ef68f5a..1525fbb 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 _0xfe74=['STRING','TEXT','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfe74,0x196));var _0x4fe7=function(_0x589367,_0x33d2c3){_0x589367=_0x589367-0x0;var _0x38aa01=_0xfe74[_0x589367];return _0x38aa01;};'use strict';var Sequelize=require(_0x4fe7('0x0'));module[_0x4fe7('0x1')]={'uniqueid':{'type':Sequelize[_0x4fe7('0x2')]},'node':{'type':Sequelize[_0x4fe7('0x2')]},'application':{'type':Sequelize[_0x4fe7('0x2')]},'data':{'type':Sequelize[_0x4fe7('0x3')]},'project_name':{'type':Sequelize[_0x4fe7('0x2')]},'callerid':{'type':Sequelize[_0x4fe7('0x2')]}}; \ No newline at end of file +var _0xf1f8=['STRING','sequelize','exports'];(function(_0x9b4427,_0x1428d0){var _0x6fe73b=function(_0x4ed7ee){while(--_0x4ed7ee){_0x9b4427['push'](_0x9b4427['shift']());}};_0x6fe73b(++_0x1428d0);}(_0xf1f8,0x9a));var _0x8f1f=function(_0x2f31a0,_0x1b2247){_0x2f31a0=_0x2f31a0-0x0;var _0x51798f=_0xf1f8[_0x2f31a0];return _0x51798f;};'use strict';var Sequelize=require(_0x8f1f('0x0'));module[_0x8f1f('0x1')]={'uniqueid':{'type':Sequelize[_0x8f1f('0x2')]},'node':{'type':Sequelize[_0x8f1f('0x2')]},'application':{'type':Sequelize[_0x8f1f('0x2')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x8f1f('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 3fb12c0..cd1abf7 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 _0x9b8c=['attributes','fields','length','nolimit','order','sort','pick','filter','VIRTUAL','merge','where','includeAll','include','findAll','rows','show','params','model','keys','options','find','create','body','catch','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','error','name','send','map','SquareDetailsReport','rawAttributes','fieldName','type','key','query','filters','intersection'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x9b8c,0x1ed));var _0xc9b8=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0x9b8c[_0x2576d7];return _0x16a08c;};'use strict';var emlformat=require(_0xc9b8('0x0'));var rimraf=require(_0xc9b8('0x1'));var zipdir=require(_0xc9b8('0x2'));var jsonpatch=require(_0xc9b8('0x3'));var rp=require(_0xc9b8('0x4'));var moment=require(_0xc9b8('0x5'));var BPromise=require(_0xc9b8('0x6'));var Mustache=require(_0xc9b8('0x7'));var util=require(_0xc9b8('0x8'));var path=require('path');var sox=require(_0xc9b8('0x9'));var csv=require(_0xc9b8('0xa'));var ejs=require(_0xc9b8('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc9b8('0xc'));var squel=require(_0xc9b8('0xd'));var crypto=require(_0xc9b8('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc9b8('0xf'));var toCsv=require(_0xc9b8('0xa'));var querystring=require(_0xc9b8('0x10'));var Papa=require('papaparse');var Redis=require(_0xc9b8('0x11'));var authService=require(_0xc9b8('0x12'));var qs=require(_0xc9b8('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc9b8('0x14'));var logger=require('../../config/logger')(_0xc9b8('0x15'));var utils=require(_0xc9b8('0x16'));var config=require(_0xc9b8('0x17'));var licenseUtil=require(_0xc9b8('0x18'));var db=require(_0xc9b8('0x19'))['db'];function respondWithStatusCode(_0x101545,_0x3114bd){_0x3114bd=_0x3114bd||0xcc;return function(_0x202e17){if(_0x202e17){return _0x101545[_0xc9b8('0x1a')](_0x3114bd);}return _0x101545[_0xc9b8('0x1b')](_0x3114bd)[_0xc9b8('0x1c')]();};}function respondWithResult(_0x4a66e9,_0x3d739b){_0x3d739b=_0x3d739b||0xc8;return function(_0x316aaf){if(_0x316aaf){return _0x4a66e9[_0xc9b8('0x1b')](_0x3d739b)[_0xc9b8('0x1d')](_0x316aaf);}};}function respondWithFilteredResult(_0xf0fd6a,_0x26ff1e){return function(_0x225388){if(_0x225388){var _0x152859=typeof _0x26ff1e[_0xc9b8('0x1e')]===_0xc9b8('0x1f')&&typeof _0x26ff1e[_0xc9b8('0x20')]===_0xc9b8('0x1f');var _0x58c985=_0x225388['count'];var _0x520718=_0x152859?0x0:_0x26ff1e[_0xc9b8('0x1e')];var _0xe66ec6=_0x152859?_0x225388[_0xc9b8('0x21')]:_0x26ff1e['offset']+_0x26ff1e[_0xc9b8('0x20')];var _0xba243c;if(_0xe66ec6>=_0x58c985){_0xe66ec6=_0x58c985;_0xba243c=0xc8;}else{_0xba243c=0xce;}_0xf0fd6a['status'](_0xba243c);return _0xf0fd6a[_0xc9b8('0x22')](_0xc9b8('0x23'),_0x520718+'-'+_0xe66ec6+'/'+_0x58c985)[_0xc9b8('0x1d')](_0x225388);}return null;};}function patchUpdates(_0x6f99c1){return function(_0x3cb761){try{jsonpatch['apply'](_0x3cb761,_0x6f99c1,!![]);}catch(_0xc49678){return BPromise[_0xc9b8('0x24')](_0xc49678);}return _0x3cb761[_0xc9b8('0x25')]();};}function saveUpdates(_0x345e6b,_0x3b6391){return function(_0xa2599a){if(_0xa2599a){return _0xa2599a[_0xc9b8('0x26')](_0x345e6b)['then'](function(_0x5f33b9){return _0x5f33b9;});}return null;};}function removeEntity(_0x1f92f7,_0x253a57){return function(_0x26e9df){if(_0x26e9df){return _0x26e9df[_0xc9b8('0x27')]()[_0xc9b8('0x28')](function(){_0x1f92f7[_0xc9b8('0x1b')](0xcc)[_0xc9b8('0x1c')]();});}};}function handleEntityNotFound(_0x2f907b,_0xbfe1d4){return function(_0x3cb550){if(!_0x3cb550){_0x2f907b['sendStatus'](0x194);}return _0x3cb550;};}function handleError(_0x953585,_0x268177){_0x268177=_0x268177||0x1f4;return function(_0xb7904d){logger[_0xc9b8('0x29')](_0xb7904d['stack']);if(_0xb7904d[_0xc9b8('0x2a')]){delete _0xb7904d[_0xc9b8('0x2a')];}_0x953585[_0xc9b8('0x1b')](_0x268177)[_0xc9b8('0x2b')](_0xb7904d);};}exports['index']=function(_0x254086,_0x446b86){var _0x15b6c6={},_0x18ad7e={},_0x58dbbb={'count':0x0,'rows':[]};var _0x33eac0=_[_0xc9b8('0x2c')](db[_0xc9b8('0x2d')][_0xc9b8('0x2e')],function(_0x528950){return{'name':_0x528950[_0xc9b8('0x2f')],'type':_0x528950[_0xc9b8('0x30')][_0xc9b8('0x31')]};});_0x18ad7e['model']=_['map'](_0x33eac0,'name');_0x18ad7e[_0xc9b8('0x32')]=_['keys'](_0x254086[_0xc9b8('0x32')]);_0x18ad7e[_0xc9b8('0x33')]=_[_0xc9b8('0x34')](_0x18ad7e['model'],_0x18ad7e['query']);_0x15b6c6[_0xc9b8('0x35')]=_[_0xc9b8('0x34')](_0x18ad7e['model'],qs[_0xc9b8('0x36')](_0x254086[_0xc9b8('0x32')][_0xc9b8('0x36')]));_0x15b6c6['attributes']=_0x15b6c6['attributes'][_0xc9b8('0x37')]?_0x15b6c6['attributes']:_0x18ad7e['model'];if(!_0x254086[_0xc9b8('0x32')]['hasOwnProperty'](_0xc9b8('0x38'))){_0x15b6c6[_0xc9b8('0x20')]=qs['limit'](_0x254086[_0xc9b8('0x32')][_0xc9b8('0x20')]);_0x15b6c6[_0xc9b8('0x1e')]=qs['offset'](_0x254086[_0xc9b8('0x32')][_0xc9b8('0x1e')]);}_0x15b6c6[_0xc9b8('0x39')]=qs['sort'](_0x254086[_0xc9b8('0x32')][_0xc9b8('0x3a')]);_0x15b6c6['where']=qs[_0xc9b8('0x33')](_[_0xc9b8('0x3b')](_0x254086[_0xc9b8('0x32')],_0x18ad7e[_0xc9b8('0x33')]),_0x33eac0);if(_0x254086[_0xc9b8('0x32')][_0xc9b8('0x3c')]){_0x15b6c6['where']=_['merge'](_0x15b6c6['where'],{'$or':_[_0xc9b8('0x2c')](_0x33eac0,function(_0x430199){if(_0x430199['type']!==_0xc9b8('0x3d')){var _0x5157ca={};_0x5157ca[_0x430199['name']]={'$like':'%'+_0x254086[_0xc9b8('0x32')][_0xc9b8('0x3c')]+'%'};return _0x5157ca;}})});}_0x15b6c6=_[_0xc9b8('0x3e')]({},_0x15b6c6,_0x254086['options']);var _0x25d00f={'where':_0x15b6c6[_0xc9b8('0x3f')]};return db[_0xc9b8('0x2d')][_0xc9b8('0x21')](_0x25d00f)[_0xc9b8('0x28')](function(_0x25deaa){_0x58dbbb[_0xc9b8('0x21')]=_0x25deaa;if(_0x254086['query'][_0xc9b8('0x40')]){_0x15b6c6[_0xc9b8('0x41')]=[{'all':!![]}];}return db[_0xc9b8('0x2d')][_0xc9b8('0x42')](_0x15b6c6);})[_0xc9b8('0x28')](function(_0x1238d4){_0x58dbbb[_0xc9b8('0x43')]=_0x1238d4;return _0x58dbbb;})[_0xc9b8('0x28')](respondWithFilteredResult(_0x446b86,_0x15b6c6))['catch'](handleError(_0x446b86,null));};exports[_0xc9b8('0x44')]=function(_0x3fbdc1,_0x17bff5){var _0x2c8956={'raw':!![],'where':{'id':_0x3fbdc1[_0xc9b8('0x45')]['id']}},_0x287dd3={};_0x287dd3[_0xc9b8('0x46')]=_[_0xc9b8('0x47')](db[_0xc9b8('0x2d')][_0xc9b8('0x2e')]);_0x287dd3[_0xc9b8('0x32')]=_[_0xc9b8('0x47')](_0x3fbdc1[_0xc9b8('0x32')]);_0x287dd3[_0xc9b8('0x33')]=_[_0xc9b8('0x34')](_0x287dd3['model'],_0x287dd3[_0xc9b8('0x32')]);_0x2c8956['attributes']=_[_0xc9b8('0x34')](_0x287dd3['model'],qs['fields'](_0x3fbdc1[_0xc9b8('0x32')][_0xc9b8('0x36')]));_0x2c8956[_0xc9b8('0x35')]=_0x2c8956[_0xc9b8('0x35')][_0xc9b8('0x37')]?_0x2c8956[_0xc9b8('0x35')]:_0x287dd3[_0xc9b8('0x46')];if(_0x3fbdc1[_0xc9b8('0x32')][_0xc9b8('0x40')]){_0x2c8956[_0xc9b8('0x41')]=[{'all':!![]}];}_0x2c8956=_[_0xc9b8('0x3e')]({},_0x2c8956,_0x3fbdc1[_0xc9b8('0x48')]);return db['SquareDetailsReport'][_0xc9b8('0x49')](_0x2c8956)['then'](handleEntityNotFound(_0x17bff5,null))[_0xc9b8('0x28')](respondWithResult(_0x17bff5,null))['catch'](handleError(_0x17bff5,null));};exports[_0xc9b8('0x4a')]=function(_0x4d6df2,_0x116047){return db[_0xc9b8('0x2d')]['create'](_0x4d6df2[_0xc9b8('0x4b')],{})[_0xc9b8('0x28')](respondWithResult(_0x116047,0xc9))[_0xc9b8('0x4c')](handleError(_0x116047,null));};exports[_0xc9b8('0x26')]=function(_0x2ddb87,_0x4fea7e){if(_0x2ddb87[_0xc9b8('0x4b')]['id']){delete _0x2ddb87[_0xc9b8('0x4b')]['id'];}return db[_0xc9b8('0x2d')][_0xc9b8('0x49')]({'where':{'id':_0x2ddb87[_0xc9b8('0x45')]['id']}})[_0xc9b8('0x28')](handleEntityNotFound(_0x4fea7e,null))[_0xc9b8('0x28')](saveUpdates(_0x2ddb87[_0xc9b8('0x4b')],null))[_0xc9b8('0x28')](respondWithResult(_0x4fea7e,null))['catch'](handleError(_0x4fea7e,null));};exports[_0xc9b8('0x27')]=function(_0x344411,_0x2f15f5){return db[_0xc9b8('0x2d')]['find']({'where':{'id':_0x344411[_0xc9b8('0x45')]['id']}})[_0xc9b8('0x28')](handleEntityNotFound(_0x2f15f5,null))[_0xc9b8('0x28')](removeEntity(_0x2f15f5,null))[_0xc9b8('0x4c')](handleError(_0x2f15f5,null));};exports[_0xc9b8('0x4d')]=function(_0x8ac25,_0x16aaa7){return db['SquareDetailsReport']['describe']()['then'](respondWithResult(_0x16aaa7,null))[_0xc9b8('0x4c')](handleError(_0x16aaa7,null));}; \ No newline at end of file +var _0xb9dc=['mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','sendStatus','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','status','error','name','send','SquareDetailsReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','include','findAll','rows','catch','show','includeAll','find','create','body','params','describe','eml-format','fast-json-patch','request-promise','moment','bluebird'];(function(_0x144932,_0x29eb6a){var _0x46e030=function(_0x183573){while(--_0x183573){_0x144932['push'](_0x144932['shift']());}};_0x46e030(++_0x29eb6a);}(_0xb9dc,0x1b1));var _0xcb9d=function(_0xa78ed,_0x335b53){_0xa78ed=_0xa78ed-0x0;var _0xb20bc7=_0xb9dc[_0xa78ed];return _0xb20bc7;};'use strict';var emlformat=require(_0xcb9d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xcb9d('0x1'));var rp=require(_0xcb9d('0x2'));var moment=require(_0xcb9d('0x3'));var BPromise=require(_0xcb9d('0x4'));var Mustache=require(_0xcb9d('0x5'));var util=require(_0xcb9d('0x6'));var path=require(_0xcb9d('0x7'));var sox=require(_0xcb9d('0x8'));var csv=require(_0xcb9d('0x9'));var ejs=require(_0xcb9d('0xa'));var fs=require('fs');var fs_extra=require(_0xcb9d('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xcb9d('0xc'));var jsforce=require(_0xcb9d('0xd'));var deskjs=require(_0xcb9d('0xe'));var toCsv=require(_0xcb9d('0x9'));var querystring=require(_0xcb9d('0xf'));var Papa=require('papaparse');var Redis=require(_0xcb9d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xcb9d('0x11'));var as=require(_0xcb9d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcb9d('0x13'))('api');var utils=require(_0xcb9d('0x14'));var config=require(_0xcb9d('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c03e1,_0x2ae0aa){_0x2ae0aa=_0x2ae0aa||0xcc;return function(_0x3f9add){if(_0x3f9add){return _0x2c03e1[_0xcb9d('0x16')](_0x2ae0aa);}return _0x2c03e1['status'](_0x2ae0aa)[_0xcb9d('0x17')]();};}function respondWithResult(_0x330353,_0x253642){_0x253642=_0x253642||0xc8;return function(_0x7c815a){if(_0x7c815a){return _0x330353['status'](_0x253642)[_0xcb9d('0x18')](_0x7c815a);}};}function respondWithFilteredResult(_0x83d326,_0x1778ef){return function(_0x38b0d6){if(_0x38b0d6){var _0x3e9860=typeof _0x1778ef[_0xcb9d('0x19')]===_0xcb9d('0x1a')&&typeof _0x1778ef[_0xcb9d('0x1b')]==='undefined';var _0x510402=_0x38b0d6[_0xcb9d('0x1c')];var _0x27a12a=_0x3e9860?0x0:_0x1778ef[_0xcb9d('0x19')];var _0x384bb9=_0x3e9860?_0x38b0d6['count']:_0x1778ef[_0xcb9d('0x19')]+_0x1778ef[_0xcb9d('0x1b')];var _0x22c1bf;if(_0x384bb9>=_0x510402){_0x384bb9=_0x510402;_0x22c1bf=0xc8;}else{_0x22c1bf=0xce;}_0x83d326['status'](_0x22c1bf);return _0x83d326[_0xcb9d('0x1d')](_0xcb9d('0x1e'),_0x27a12a+'-'+_0x384bb9+'/'+_0x510402)[_0xcb9d('0x18')](_0x38b0d6);}return null;};}function patchUpdates(_0x30007f){return function(_0x421a8a){try{jsonpatch['apply'](_0x421a8a,_0x30007f,!![]);}catch(_0x7cf96e){return BPromise[_0xcb9d('0x1f')](_0x7cf96e);}return _0x421a8a[_0xcb9d('0x20')]();};}function saveUpdates(_0x59178a,_0x5b28e2){return function(_0x411ccd){if(_0x411ccd){return _0x411ccd[_0xcb9d('0x21')](_0x59178a)[_0xcb9d('0x22')](function(_0x1f1fe5){return _0x1f1fe5;});}return null;};}function removeEntity(_0x464f9e,_0x491ed9){return function(_0x5d7151){if(_0x5d7151){return _0x5d7151[_0xcb9d('0x23')]()['then'](function(){_0x464f9e[_0xcb9d('0x24')](0xcc)[_0xcb9d('0x17')]();});}};}function handleEntityNotFound(_0x1bc7f8,_0x1ce27f){return function(_0x154a1b){if(!_0x154a1b){_0x1bc7f8[_0xcb9d('0x16')](0x194);}return _0x154a1b;};}function handleError(_0x5b3074,_0x408d1a){_0x408d1a=_0x408d1a||0x1f4;return function(_0x5b28e9){logger[_0xcb9d('0x25')](_0x5b28e9['stack']);if(_0x5b28e9[_0xcb9d('0x26')]){delete _0x5b28e9[_0xcb9d('0x26')];}_0x5b3074['status'](_0x408d1a)[_0xcb9d('0x27')](_0x5b28e9);};}exports['index']=function(_0x45b2d5,_0x41b57e){var _0x2b83ee={},_0x2452ad={},_0x42fb06={'count':0x0,'rows':[]};var _0x229225=_['map'](db[_0xcb9d('0x28')][_0xcb9d('0x29')],function(_0x90cde6){return{'name':_0x90cde6['fieldName'],'type':_0x90cde6[_0xcb9d('0x2a')][_0xcb9d('0x2b')]};});_0x2452ad[_0xcb9d('0x2c')]=_['map'](_0x229225,_0xcb9d('0x26'));_0x2452ad[_0xcb9d('0x2d')]=_[_0xcb9d('0x2e')](_0x45b2d5['query']);_0x2452ad[_0xcb9d('0x2f')]=_[_0xcb9d('0x30')](_0x2452ad[_0xcb9d('0x2c')],_0x2452ad['query']);_0x2b83ee[_0xcb9d('0x31')]=_['intersection'](_0x2452ad[_0xcb9d('0x2c')],qs[_0xcb9d('0x32')](_0x45b2d5[_0xcb9d('0x2d')][_0xcb9d('0x32')]));_0x2b83ee['attributes']=_0x2b83ee[_0xcb9d('0x31')][_0xcb9d('0x33')]?_0x2b83ee[_0xcb9d('0x31')]:_0x2452ad['model'];if(!_0x45b2d5[_0xcb9d('0x2d')]['hasOwnProperty'](_0xcb9d('0x34'))){_0x2b83ee[_0xcb9d('0x1b')]=qs[_0xcb9d('0x1b')](_0x45b2d5[_0xcb9d('0x2d')][_0xcb9d('0x1b')]);_0x2b83ee[_0xcb9d('0x19')]=qs[_0xcb9d('0x19')](_0x45b2d5[_0xcb9d('0x2d')][_0xcb9d('0x19')]);}_0x2b83ee[_0xcb9d('0x35')]=qs[_0xcb9d('0x36')](_0x45b2d5[_0xcb9d('0x2d')][_0xcb9d('0x36')]);_0x2b83ee[_0xcb9d('0x37')]=qs['filters'](_[_0xcb9d('0x38')](_0x45b2d5['query'],_0x2452ad['filters']),_0x229225);if(_0x45b2d5[_0xcb9d('0x2d')][_0xcb9d('0x39')]){_0x2b83ee[_0xcb9d('0x37')]=_[_0xcb9d('0x3a')](_0x2b83ee['where'],{'$or':_[_0xcb9d('0x3b')](_0x229225,function(_0x5cb34f){if(_0x5cb34f[_0xcb9d('0x2a')]!==_0xcb9d('0x3c')){var _0x575f22={};_0x575f22[_0x5cb34f[_0xcb9d('0x26')]]={'$like':'%'+_0x45b2d5[_0xcb9d('0x2d')]['filter']+'%'};return _0x575f22;}})});}_0x2b83ee=_[_0xcb9d('0x3a')]({},_0x2b83ee,_0x45b2d5[_0xcb9d('0x3d')]);var _0x4e01f5={'where':_0x2b83ee[_0xcb9d('0x37')]};return db[_0xcb9d('0x28')][_0xcb9d('0x1c')](_0x4e01f5)[_0xcb9d('0x22')](function(_0x572f69){_0x42fb06[_0xcb9d('0x1c')]=_0x572f69;if(_0x45b2d5[_0xcb9d('0x2d')]['includeAll']){_0x2b83ee[_0xcb9d('0x3e')]=[{'all':!![]}];}return db[_0xcb9d('0x28')][_0xcb9d('0x3f')](_0x2b83ee);})[_0xcb9d('0x22')](function(_0x2b0f3c){_0x42fb06[_0xcb9d('0x40')]=_0x2b0f3c;return _0x42fb06;})[_0xcb9d('0x22')](respondWithFilteredResult(_0x41b57e,_0x2b83ee))[_0xcb9d('0x41')](handleError(_0x41b57e,null));};exports[_0xcb9d('0x42')]=function(_0x2d879f,_0x1c6d8c){var _0x3f5be7={'raw':!![],'where':{'id':_0x2d879f['params']['id']}},_0x51597c={};_0x51597c[_0xcb9d('0x2c')]=_[_0xcb9d('0x2e')](db['SquareDetailsReport'][_0xcb9d('0x29')]);_0x51597c[_0xcb9d('0x2d')]=_['keys'](_0x2d879f['query']);_0x51597c['filters']=_[_0xcb9d('0x30')](_0x51597c[_0xcb9d('0x2c')],_0x51597c[_0xcb9d('0x2d')]);_0x3f5be7[_0xcb9d('0x31')]=_['intersection'](_0x51597c['model'],qs[_0xcb9d('0x32')](_0x2d879f[_0xcb9d('0x2d')][_0xcb9d('0x32')]));_0x3f5be7['attributes']=_0x3f5be7[_0xcb9d('0x31')][_0xcb9d('0x33')]?_0x3f5be7[_0xcb9d('0x31')]:_0x51597c['model'];if(_0x2d879f[_0xcb9d('0x2d')][_0xcb9d('0x43')]){_0x3f5be7[_0xcb9d('0x3e')]=[{'all':!![]}];}_0x3f5be7=_[_0xcb9d('0x3a')]({},_0x3f5be7,_0x2d879f[_0xcb9d('0x3d')]);return db[_0xcb9d('0x28')][_0xcb9d('0x44')](_0x3f5be7)[_0xcb9d('0x22')](handleEntityNotFound(_0x1c6d8c,null))[_0xcb9d('0x22')](respondWithResult(_0x1c6d8c,null))[_0xcb9d('0x41')](handleError(_0x1c6d8c,null));};exports[_0xcb9d('0x45')]=function(_0x286721,_0x319b75){return db['SquareDetailsReport'][_0xcb9d('0x45')](_0x286721['body'],{})[_0xcb9d('0x22')](respondWithResult(_0x319b75,0xc9))[_0xcb9d('0x41')](handleError(_0x319b75,null));};exports['update']=function(_0x4ce9fc,_0x2111c9){if(_0x4ce9fc['body']['id']){delete _0x4ce9fc[_0xcb9d('0x46')]['id'];}return db[_0xcb9d('0x28')][_0xcb9d('0x44')]({'where':{'id':_0x4ce9fc['params']['id']}})[_0xcb9d('0x22')](handleEntityNotFound(_0x2111c9,null))[_0xcb9d('0x22')](saveUpdates(_0x4ce9fc[_0xcb9d('0x46')],null))['then'](respondWithResult(_0x2111c9,null))['catch'](handleError(_0x2111c9,null));};exports[_0xcb9d('0x23')]=function(_0x64b5c3,_0x5671a9){return db['SquareDetailsReport'][_0xcb9d('0x44')]({'where':{'id':_0x64b5c3[_0xcb9d('0x47')]['id']}})['then'](handleEntityNotFound(_0x5671a9,null))[_0xcb9d('0x22')](removeEntity(_0x5671a9,null))[_0xcb9d('0x41')](handleError(_0x5671a9,null));};exports[_0xcb9d('0x48')]=function(_0x129ac8,_0x4c242d){return db[_0xcb9d('0x28')][_0xcb9d('0x48')]()[_0xcb9d('0x22')](respondWithResult(_0x4c242d,null))['catch'](handleError(_0x4c242d,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 5333cad..d241352 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 _0x7be8=['SquareDetailsReport','report_square_details','lodash','util','api','bluebird','path','rimraf','../../config/environment','./squareReportDetail.attributes','exports','define'];(function(_0x4d55ed,_0x18ebc8){var _0x2cb865=function(_0x40ba34){while(--_0x40ba34){_0x4d55ed['push'](_0x4d55ed['shift']());}};_0x2cb865(++_0x18ebc8);}(_0x7be8,0x7a));var _0x87be=function(_0x5c489b,_0x22f0a6){_0x5c489b=_0x5c489b-0x0;var _0x39ffa7=_0x7be8[_0x5c489b];return _0x39ffa7;};'use strict';var _=require(_0x87be('0x0'));var util=require(_0x87be('0x1'));var logger=require('../../config/logger')(_0x87be('0x2'));var moment=require('moment');var BPromise=require(_0x87be('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x87be('0x4'));var rimraf=require(_0x87be('0x5'));var config=require(_0x87be('0x6'));var attributes=require(_0x87be('0x7'));module[_0x87be('0x8')]=function(_0x3babb1,_0x4f59be){return _0x3babb1[_0x87be('0x9')](_0x87be('0xa'),attributes,{'tableName':_0x87be('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5198=['SquareDetailsReport','report_square_details','lodash','../../config/logger','api','moment','request-promise','rimraf','./squareReportDetail.attributes','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5198,0x1ba));var _0x8519=function(_0x37b55a,_0x5cbe44){_0x37b55a=_0x37b55a-0x0;var _0x16c813=_0x5198[_0x37b55a];return _0x16c813;};'use strict';var _=require(_0x8519('0x0'));var util=require('util');var logger=require(_0x8519('0x1'))(_0x8519('0x2'));var moment=require(_0x8519('0x3'));var BPromise=require('bluebird');var rp=require(_0x8519('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8519('0x5'));var config=require('../../config/environment');var attributes=require(_0x8519('0x6'));module[_0x8519('0x7')]=function(_0x5bec20,_0x9cc478){return _0x5bec20[_0x8519('0x8')](_0x8519('0x9'),attributes,{'tableName':_0x8519('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 d84f2a0..225f95f 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 _0x25e7=['SquareDetailsReport','create','body','options','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateSquareDetailsReport'];(function(_0x1bc013,_0x7771c6){var _0x55df36=function(_0x1c02e0){while(--_0x1c02e0){_0x1bc013['push'](_0x1bc013['shift']());}};_0x55df36(++_0x7771c6);}(_0x25e7,0x1d6));var _0x725e=function(_0x5a07a2,_0x32f99c){_0x5a07a2=_0x5a07a2-0x0;var _0x2238fe=_0x25e7[_0x5a07a2];return _0x2238fe;};'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')]('SquareDetailsReport,\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);});});}exports[_0x725e('0x16')]=function(_0x397e33){var _0x268438=this;return new Promise(function(_0x2811e7,_0x528e7d){return db[_0x725e('0x17')][_0x725e('0x18')](_0x397e33[_0x725e('0x19')],{'raw':_0x397e33[_0x725e('0x1a')]?_0x397e33[_0x725e('0x1a')][_0x725e('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x2fc416){logger[_0x725e('0xd')](_0x725e('0x16'),_0x397e33);logger[_0x725e('0x10')](_0x725e('0x16'),_0x397e33,JSON[_0x725e('0x1c')](_0x2fc416));_0x2811e7(_0x2fc416);})[_0x725e('0x15')](function(_0x262b01){logger[_0x725e('0x12')]('CreateSquareDetailsReport',_0x262b01[_0x725e('0x13')],_0x397e33);_0x528e7d(_0x268438[_0x725e('0x12')](0x1f4,_0x262b01[_0x725e('0x13')]));});});}; \ No newline at end of file +var _0x160f=['../../config/environment','client','http','then','info','SquareDetailsReport,\x20%s,\x20%s','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0xd8a25f,_0x245f97){var _0x4cedf1=function(_0x5ebb6e){while(--_0x5ebb6e){_0xd8a25f['push'](_0xd8a25f['shift']());}};_0x4cedf1(++_0x245f97);}(_0x160f,0x1ef));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf160('0x0'));var util=require(_0xf160('0x1'));var moment=require(_0xf160('0x2'));var BPromise=require(_0xf160('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf160('0x4'));var db=require(_0xf160('0x5'))['db'];var utils=require(_0xf160('0x6'));var logger=require(_0xf160('0x7'))(_0xf160('0x8'));var config=require(_0xf160('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf160('0xa')][_0xf160('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x49fe49,_0x59440e,_0x41e909){return new BPromise(function(_0x5b76c8,_0x4bf890){return client['request'](_0x49fe49,_0x41e909)[_0xf160('0xc')](function(_0x90608){logger[_0xf160('0xd')](_0xf160('0xe'),_0x59440e,'request\x20sent');logger['debug'](_0xf160('0xf'),_0x59440e,_0xf160('0x10'),JSON[_0xf160('0x11')](_0x90608));if(_0x90608['error']){if(_0x90608[_0xf160('0x12')][_0xf160('0x13')]===0x1f4){logger[_0xf160('0x12')](_0xf160('0xe'),_0x59440e,_0x90608[_0xf160('0x12')]['message']);return _0x4bf890(_0x90608[_0xf160('0x12')]['message']);}logger[_0xf160('0x12')](_0xf160('0xe'),_0x59440e,_0x90608[_0xf160('0x12')][_0xf160('0x14')]);return _0x5b76c8(_0x90608[_0xf160('0x12')][_0xf160('0x14')]);}else{logger[_0xf160('0xd')](_0xf160('0xe'),_0x59440e,_0xf160('0x10'));_0x5b76c8(_0x90608['result'][_0xf160('0x14')]);}})[_0xf160('0x15')](function(_0x8699a0){logger[_0xf160('0x12')]('SquareDetailsReport,\x20%s,\x20%s',_0x59440e,_0x8699a0);_0x4bf890(_0x8699a0);});});}exports[_0xf160('0x16')]=function(_0x4b8185){var _0x5388c7=this;return new Promise(function(_0x1cf6ba,_0x1e0c78){return db[_0xf160('0x17')][_0xf160('0x18')](_0x4b8185[_0xf160('0x19')],{'raw':_0x4b8185[_0xf160('0x1a')]?_0x4b8185[_0xf160('0x1a')][_0xf160('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x40ccf0){logger[_0xf160('0xd')](_0xf160('0x16'),_0x4b8185);logger['debug'](_0xf160('0x16'),_0x4b8185,JSON[_0xf160('0x11')](_0x40ccf0));_0x1cf6ba(_0x40ccf0);})[_0xf160('0x15')](function(_0x36d0cb){logger[_0xf160('0x12')](_0xf160('0x16'),_0x36d0cb[_0xf160('0x14')],_0x4b8185);_0x1e0c78(_0x5388c7['error'](0x1f4,_0x36d0cb[_0xf160('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index dad478f..e984b58 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 _0x8f31=['/process/:pid/kill','killProcess','exports','express','Router','../../components/auth/service','./system.controller','get','isAuthenticated','index'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0x8f31,0xa3));var _0x18f3=function(_0x4bc65f,_0x39ec43){_0x4bc65f=_0x4bc65f-0x0;var _0x44f85f=_0x8f31[_0x4bc65f];return _0x44f85f;};'use strict';var express=require(_0x18f3('0x0'));var router=express[_0x18f3('0x1')]();var auth=require(_0x18f3('0x2'));var controller=require(_0x18f3('0x3'));router[_0x18f3('0x4')]('/',auth[_0x18f3('0x5')](),controller[_0x18f3('0x6')]);router[_0x18f3('0x4')](_0x18f3('0x7'),auth[_0x18f3('0x5')](),controller[_0x18f3('0x8')]);module[_0x18f3('0x9')]=router; \ No newline at end of file +var _0xa4fa=['isAuthenticated','/process/:pid/kill','exports','express','../../components/auth/service','./system.controller','get'];(function(_0x3360b2,_0x471371){var _0x3e7862=function(_0x519b87){while(--_0x519b87){_0x3360b2['push'](_0x3360b2['shift']());}};_0x3e7862(++_0x471371);}(_0xa4fa,0x1df));var _0xaa4f=function(_0x438cb6,_0x4458f8){_0x438cb6=_0x438cb6-0x0;var _0x36ed9e=_0xa4fa[_0x438cb6];return _0x36ed9e;};'use strict';var express=require(_0xaa4f('0x0'));var router=express['Router']();var auth=require(_0xaa4f('0x1'));var controller=require(_0xaa4f('0x2'));router[_0xaa4f('0x3')]('/',auth[_0xaa4f('0x4')](),controller['index']);router[_0xaa4f('0x3')](_0xaa4f('0x5'),auth[_0xaa4f('0x4')](),controller['killProcess']);module[_0xaa4f('0x6')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 494fb74..c3040fa 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 _0x0ce7=['bluebird','lodash','inspect','name','send','index','then','catch','json','killProcess','components/import/cm','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','indexOf','format','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','exec','../../config/logger','api','util'];(function(_0x2fee96,_0x2f735d){var _0x2e6ad1=function(_0x2c55ad){while(--_0x2c55ad){_0x2fee96['push'](_0x2fee96['shift']());}};_0x2e6ad1(++_0x2f735d);}(_0x0ce7,0x119));var _0x70ce=function(_0x512653,_0x596518){_0x512653=_0x512653-0x0;var _0x30966b=_0x0ce7[_0x512653];return _0x30966b;};'use strict';var info=require(_0x70ce('0x0'));var exec=require('child_process')[_0x70ce('0x1')];var logger=require(_0x70ce('0x2'))(_0x70ce('0x3'));var util=require(_0x70ce('0x4'));var BPromise=require(_0x70ce('0x5'));var _=require(_0x70ce('0x6'));function handleError(_0x26696b,_0x501622,_0x576a03){_0x501622=_0x501622||0x1f4;return function(_0x367cdd){logger['error']('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x576a03,_0x501622,util[_0x70ce('0x7')](_0x367cdd,{'showHidden':![],'depth':null}));delete _0x367cdd[_0x70ce('0x8')];_0x26696b['status'](_0x501622)[_0x70ce('0x9')](_0x367cdd);};}exports[_0x70ce('0xa')]=function(_0x383625,_0x1ce1e9){return info['getAllData']()[_0x70ce('0xb')](function(_0x255cc8){return _0x1ce1e9['status'](0xc8)['json'](_0x255cc8);})[_0x70ce('0xc')](function(_0x46324d){return _0x1ce1e9['status'](0x1f4)[_0x70ce('0xd')](_0x46324d);});};exports[_0x70ce('0xe')]=function(_0x3f7443,_0x101adb){var _0x114a65=[_0x70ce('0xf')];return new BPromise(function(_0x522256,_0x5ae035){return exec(util['format'](_0x70ce('0x10'),_0x3f7443[_0x70ce('0x11')][_0x70ce('0x12')]),function(_0x1bc9ac,_0x297d98,_0xc44505){if(_0x1bc9ac){return _0x5ae035(_0x1bc9ac);}return _0x522256(_0x297d98);});})[_0x70ce('0xb')](function(_0x4f13fd){var _0x5f4e7e=![];var _0x107a44=_0x4f13fd[_0x70ce('0x13')](/\n/);for(var _0xa729d8=0x0,_0x1048ac=_0x114a65['length'];_0xa729d8<_0x1048ac,_0x5f4e7e===![];_0xa729d8+=0x1){if(_0x4f13fd[_0x70ce('0x14')](_0x114a65[_0xa729d8])>=0x0){_0x5f4e7e=!![];}}if(!_0x5f4e7e){throw new Error(util[_0x70ce('0x15')](_0x70ce('0x16'),_0x3f7443[_0x70ce('0x11')][_0x70ce('0x12')]));}process[_0x70ce('0x17')](_0x3f7443[_0x70ce('0x11')]['pid'],_0x70ce('0x18'));return _0x101adb['status'](0xc8)[_0x70ce('0xd')]({'message':util[_0x70ce('0x15')](_0x70ce('0x19'),_0x3f7443[_0x70ce('0x11')][_0x70ce('0x12')])});})[_0x70ce('0xc')](handleError(_0x101adb,null,_0x70ce('0xe')));}; \ No newline at end of file +var _0xf4a0=['format','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec','../../config/logger','api','util','lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','name','status','send','index','getAllData','then','json','killProcess','components/import/cm','params','split','Process\x20with\x20pid\x20%s\x20not\x20found!','pid','kill','SIGINT'];(function(_0x1a0c59,_0x3b4dcc){var _0xed67c9=function(_0x247698){while(--_0x247698){_0x1a0c59['push'](_0x1a0c59['shift']());}};_0xed67c9(++_0x3b4dcc);}(_0xf4a0,0x98));var _0x0f4a=function(_0x223aab,_0x249f78){_0x223aab=_0x223aab-0x0;var _0x2b4dc8=_0xf4a0[_0x223aab];return _0x2b4dc8;};'use strict';var info=require(_0x0f4a('0x0'));var exec=require(_0x0f4a('0x1'))[_0x0f4a('0x2')];var logger=require(_0x0f4a('0x3'))(_0x0f4a('0x4'));var util=require(_0x0f4a('0x5'));var BPromise=require('bluebird');var _=require(_0x0f4a('0x6'));function handleError(_0x4ed7f0,_0x3dbb96,_0x265f1b){_0x3dbb96=_0x3dbb96||0x1f4;return function(_0x124f22){logger['error'](_0x0f4a('0x7'),_0x265f1b,_0x3dbb96,util['inspect'](_0x124f22,{'showHidden':![],'depth':null}));delete _0x124f22[_0x0f4a('0x8')];_0x4ed7f0[_0x0f4a('0x9')](_0x3dbb96)[_0x0f4a('0xa')](_0x124f22);};}exports[_0x0f4a('0xb')]=function(_0x1c7951,_0x389b51){return info[_0x0f4a('0xc')]()[_0x0f4a('0xd')](function(_0x5744c6){return _0x389b51[_0x0f4a('0x9')](0xc8)[_0x0f4a('0xe')](_0x5744c6);})['catch'](function(_0x3df234){return _0x389b51[_0x0f4a('0x9')](0x1f4)[_0x0f4a('0xe')](_0x3df234);});};exports[_0x0f4a('0xf')]=function(_0x20dfb4,_0x261656){var _0x21fd82=[_0x0f4a('0x10')];return new BPromise(function(_0x358697,_0x51c06c){return exec(util['format']('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x20dfb4[_0x0f4a('0x11')]['pid']),function(_0x59715c,_0x2f1b72,_0x1d5d29){if(_0x59715c){return _0x51c06c(_0x59715c);}return _0x358697(_0x2f1b72);});})[_0x0f4a('0xd')](function(_0x22879a){var _0x23ae1e=![];var _0x3784fb=_0x22879a[_0x0f4a('0x12')](/\n/);for(var _0x5b0d2f=0x0,_0x47310b=_0x21fd82['length'];_0x5b0d2f<_0x47310b,_0x23ae1e===![];_0x5b0d2f+=0x1){if(_0x22879a['indexOf'](_0x21fd82[_0x5b0d2f])>=0x0){_0x23ae1e=!![];}}if(!_0x23ae1e){throw new Error(util['format'](_0x0f4a('0x13'),_0x20dfb4['params'][_0x0f4a('0x14')]));}process[_0x0f4a('0x15')](_0x20dfb4[_0x0f4a('0x11')][_0x0f4a('0x14')],_0x0f4a('0x16'));return _0x261656['status'](0xc8)[_0x0f4a('0xe')]({'message':util[_0x0f4a('0x17')](_0x0f4a('0x18'),_0x20dfb4[_0x0f4a('0x11')][_0x0f4a('0x14')])});})['catch'](handleError(_0x261656,null,_0x0f4a('0xf')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index d10dc68..dcf92b1 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 _0x5b7b=['isAuthenticated','index','/:id','post','create','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get'];(function(_0x54a8d3,_0x12b8b7){var _0x5eec0e=function(_0xbc1ade){while(--_0xbc1ade){_0x54a8d3['push'](_0x54a8d3['shift']());}};_0x5eec0e(++_0x12b8b7);}(_0x5b7b,0xd9));var _0xb5b7=function(_0x22b8a3,_0x2a79a7){_0x22b8a3=_0x22b8a3-0x0;var _0x199a0c=_0x5b7b[_0x22b8a3];return _0x199a0c;};'use strict';var multer=require(_0xb5b7('0x0'));var util=require('util');var path=require(_0xb5b7('0x1'));var timeout=require(_0xb5b7('0x2'));var express=require(_0xb5b7('0x3'));var router=express[_0xb5b7('0x4')]();var fs_extra=require(_0xb5b7('0x5'));var auth=require(_0xb5b7('0x6'));var interaction=require(_0xb5b7('0x7'));var config=require(_0xb5b7('0x8'));var controller=require(_0xb5b7('0x9'));router[_0xb5b7('0xa')]('/',auth[_0xb5b7('0xb')](),controller[_0xb5b7('0xc')]);router[_0xb5b7('0xa')](_0xb5b7('0xd'),auth[_0xb5b7('0xb')](),controller['show']);router[_0xb5b7('0xe')]('/',auth[_0xb5b7('0xb')](),controller[_0xb5b7('0xf')]);router['put'](_0xb5b7('0xd'),auth[_0xb5b7('0xb')](),controller['update']);router[_0xb5b7('0x10')]('/:id',auth[_0xb5b7('0xb')](),controller[_0xb5b7('0x11')]);module[_0xb5b7('0x12')]=router; \ No newline at end of file +var _0xffb0=['create','update','destroy','exports','path','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post'];(function(_0x2ae2cd,_0xb42c96){var _0xc52725=function(_0x4dda00){while(--_0x4dda00){_0x2ae2cd['push'](_0x2ae2cd['shift']());}};_0xc52725(++_0xb42c96);}(_0xffb0,0x1d5));var _0x0ffb=function(_0x3d8fed,_0x970b4e){_0x3d8fed=_0x3d8fed-0x0;var _0x310058=_0xffb0[_0x3d8fed];return _0x310058;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0ffb('0x0'));var timeout=require('connect-timeout');var express=require(_0x0ffb('0x1'));var router=express[_0x0ffb('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x0ffb('0x3'));var interaction=require(_0x0ffb('0x4'));var config=require('../../config/environment');var controller=require('./tag.controller');router[_0x0ffb('0x5')]('/',auth[_0x0ffb('0x6')](),controller[_0x0ffb('0x7')]);router[_0x0ffb('0x5')](_0x0ffb('0x8'),auth['isAuthenticated'](),controller[_0x0ffb('0x9')]);router[_0x0ffb('0xa')]('/',auth[_0x0ffb('0x6')](),controller[_0x0ffb('0xb')]);router['put'](_0x0ffb('0x8'),auth[_0x0ffb('0x6')](),controller[_0x0ffb('0xc')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0ffb('0xd')]);module[_0x0ffb('0xe')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 6921465..bd5939e 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 _0xd61e=['name','#0091EA','sequelize','exports','STRING'];(function(_0x639778,_0x3232d2){var _0x321b6b=function(_0x57754a){while(--_0x57754a){_0x639778['push'](_0x639778['shift']());}};_0x321b6b(++_0x3232d2);}(_0xd61e,0x13d));var _0xed61=function(_0x935075,_0x10110a){_0x935075=_0x935075-0x0;var _0x5bc40d=_0xd61e[_0x935075];return _0x5bc40d;};'use strict';var Sequelize=require(_0xed61('0x0'));module[_0xed61('0x1')]={'name':{'type':Sequelize[_0xed61('0x2')],'unique':_0xed61('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xed61('0x2')],'defaultValue':_0xed61('0x4')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6be1=['sequelize','exports','STRING'];(function(_0x4499a3,_0x5dfeff){var _0xb88043=function(_0x38a4b2){while(--_0x38a4b2){_0x4499a3['push'](_0x4499a3['shift']());}};_0xb88043(++_0x5dfeff);}(_0x6be1,0x12f));var _0x16be=function(_0x20fa22,_0x21ebdf){_0x20fa22=_0x20fa22-0x0;var _0x21a43e=_0x6be1[_0x20fa22];return _0x21a43e;};'use strict';var Sequelize=require(_0x16be('0x0'));module[_0x16be('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0x16be('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 23d35cf..dde0d73 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 _0x3eec=['set','Content-Range','apply','reject','save','update','then','get','Tags','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','find','Tag','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','json','undefined','count','offset','limit'];(function(_0x2a9e33,_0x588b29){var _0x3337e4=function(_0x4d6f42){while(--_0x4d6f42){_0x2a9e33['push'](_0x2a9e33['shift']());}};_0x3337e4(++_0x588b29);}(_0x3eec,0x1e9));var _0xc3ee=function(_0x3f7c6b,_0x4ac9b6){_0x3f7c6b=_0x3f7c6b-0x0;var _0x4ad8b6=_0x3eec[_0x3f7c6b];return _0x4ad8b6;};'use strict';var emlformat=require(_0xc3ee('0x0'));var rimraf=require(_0xc3ee('0x1'));var zipdir=require(_0xc3ee('0x2'));var jsonpatch=require(_0xc3ee('0x3'));var rp=require('request-promise');var moment=require(_0xc3ee('0x4'));var BPromise=require(_0xc3ee('0x5'));var Mustache=require(_0xc3ee('0x6'));var util=require(_0xc3ee('0x7'));var path=require(_0xc3ee('0x8'));var sox=require(_0xc3ee('0x9'));var csv=require('to-csv');var ejs=require(_0xc3ee('0xa'));var fs=require('fs');var fs_extra=require(_0xc3ee('0xb'));var _=require(_0xc3ee('0xc'));var squel=require(_0xc3ee('0xd'));var crypto=require(_0xc3ee('0xe'));var jsforce=require(_0xc3ee('0xf'));var deskjs=require(_0xc3ee('0x10'));var toCsv=require(_0xc3ee('0x11'));var querystring=require(_0xc3ee('0x12'));var Papa=require(_0xc3ee('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc3ee('0x14'));var as=require(_0xc3ee('0x15'));var hardwareService=require(_0xc3ee('0x16'));var logger=require(_0xc3ee('0x17'))('api');var utils=require(_0xc3ee('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xc3ee('0x19'));var db=require(_0xc3ee('0x1a'))['db'];function respondWithStatusCode(_0x4beb01,_0x5f2c3a){_0x5f2c3a=_0x5f2c3a||0xcc;return function(_0x2eb82e){if(_0x2eb82e){return _0x4beb01['sendStatus'](_0x5f2c3a);}return _0x4beb01[_0xc3ee('0x1b')](_0x5f2c3a)['end']();};}function respondWithResult(_0x19feb3,_0x58ebe7){_0x58ebe7=_0x58ebe7||0xc8;return function(_0x3d669d){if(_0x3d669d){return _0x19feb3[_0xc3ee('0x1b')](_0x58ebe7)[_0xc3ee('0x1c')](_0x3d669d);}};}function respondWithFilteredResult(_0x664bad,_0x476f8f){return function(_0xf63359){if(_0xf63359){var _0x277e11=typeof _0x476f8f['offset']===_0xc3ee('0x1d')&&typeof _0x476f8f['limit']===_0xc3ee('0x1d');var _0x1bf49a=_0xf63359[_0xc3ee('0x1e')];var _0x219db0=_0x277e11?0x0:_0x476f8f[_0xc3ee('0x1f')];var _0x3acb0c=_0x277e11?_0xf63359[_0xc3ee('0x1e')]:_0x476f8f[_0xc3ee('0x1f')]+_0x476f8f[_0xc3ee('0x20')];var _0x202a9a;if(_0x3acb0c>=_0x1bf49a){_0x3acb0c=_0x1bf49a;_0x202a9a=0xc8;}else{_0x202a9a=0xce;}_0x664bad[_0xc3ee('0x1b')](_0x202a9a);return _0x664bad[_0xc3ee('0x21')](_0xc3ee('0x22'),_0x219db0+'-'+_0x3acb0c+'/'+_0x1bf49a)[_0xc3ee('0x1c')](_0xf63359);}return null;};}function patchUpdates(_0x3e7224){return function(_0x46a8c9){try{jsonpatch[_0xc3ee('0x23')](_0x46a8c9,_0x3e7224,!![]);}catch(_0x30df3a){return BPromise[_0xc3ee('0x24')](_0x30df3a);}return _0x46a8c9[_0xc3ee('0x25')]();};}function saveUpdates(_0x11778f,_0x493fea){return function(_0x4d672e){if(_0x4d672e){return _0x4d672e[_0xc3ee('0x26')](_0x11778f)[_0xc3ee('0x27')](function(_0x3b8f75){return _0x3b8f75;});}return null;};}function removeEntity(_0x464ffc,_0x28bfeb){return function(_0x238df7){if(_0x238df7){return _0x238df7['destroy']()[_0xc3ee('0x27')](function(){var _0x3f8f7b=_0x238df7[_0xc3ee('0x28')]({'plain':!![]});var _0xfd03bd=_0xc3ee('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0xfd03bd,'resourceId':_0x3f8f7b['id']}})[_0xc3ee('0x27')](function(){return _0x238df7;});})[_0xc3ee('0x27')](function(){_0x464ffc[_0xc3ee('0x1b')](0xcc)[_0xc3ee('0x2a')]();});}};}function handleEntityNotFound(_0x836fac,_0x4ecfec){return function(_0x56201a){if(!_0x56201a){_0x836fac['sendStatus'](0x194);}return _0x56201a;};}function handleError(_0x1be005,_0x2f2c29){_0x2f2c29=_0x2f2c29||0x1f4;return function(_0x44678b){logger[_0xc3ee('0x2b')](_0x44678b[_0xc3ee('0x2c')]);if(_0x44678b['name']){delete _0x44678b[_0xc3ee('0x2d')];}_0x1be005[_0xc3ee('0x1b')](_0x2f2c29)[_0xc3ee('0x2e')](_0x44678b);};}exports[_0xc3ee('0x2f')]=function(_0x1f7b3a,_0x8bbe1e){var _0x3b17f7={},_0x4da264={},_0x330b71={'count':0x0,'rows':[]};var _0x35c19a=_[_0xc3ee('0x30')](db['Tag'][_0xc3ee('0x31')],function(_0x240a16){return{'name':_0x240a16[_0xc3ee('0x32')],'type':_0x240a16[_0xc3ee('0x33')][_0xc3ee('0x34')]};});_0x4da264[_0xc3ee('0x35')]=_[_0xc3ee('0x30')](_0x35c19a,'name');_0x4da264[_0xc3ee('0x36')]=_['keys'](_0x1f7b3a[_0xc3ee('0x36')]);_0x4da264[_0xc3ee('0x37')]=_[_0xc3ee('0x38')](_0x4da264[_0xc3ee('0x35')],_0x4da264[_0xc3ee('0x36')]);_0x3b17f7[_0xc3ee('0x39')]=_['intersection'](_0x4da264[_0xc3ee('0x35')],qs[_0xc3ee('0x3a')](_0x1f7b3a[_0xc3ee('0x36')][_0xc3ee('0x3a')]));_0x3b17f7[_0xc3ee('0x39')]=_0x3b17f7[_0xc3ee('0x39')][_0xc3ee('0x3b')]?_0x3b17f7[_0xc3ee('0x39')]:_0x4da264[_0xc3ee('0x35')];if(!_0x1f7b3a[_0xc3ee('0x36')][_0xc3ee('0x3c')](_0xc3ee('0x3d'))){_0x3b17f7[_0xc3ee('0x20')]=qs[_0xc3ee('0x20')](_0x1f7b3a[_0xc3ee('0x36')][_0xc3ee('0x20')]);_0x3b17f7[_0xc3ee('0x1f')]=qs[_0xc3ee('0x1f')](_0x1f7b3a[_0xc3ee('0x36')][_0xc3ee('0x1f')]);}_0x3b17f7[_0xc3ee('0x3e')]=qs['sort'](_0x1f7b3a[_0xc3ee('0x36')]['sort']);_0x3b17f7[_0xc3ee('0x3f')]=qs[_0xc3ee('0x37')](_[_0xc3ee('0x40')](_0x1f7b3a[_0xc3ee('0x36')],_0x4da264[_0xc3ee('0x37')]),_0x35c19a);if(_0x1f7b3a[_0xc3ee('0x36')]['filter']){_0x3b17f7[_0xc3ee('0x3f')]=_[_0xc3ee('0x41')](_0x3b17f7[_0xc3ee('0x3f')],{'$or':_['map'](_0x35c19a,function(_0x181179){if(_0x181179[_0xc3ee('0x33')]!==_0xc3ee('0x42')){var _0x1fe17f={};_0x1fe17f[_0x181179[_0xc3ee('0x2d')]]={'$like':'%'+_0x1f7b3a[_0xc3ee('0x36')][_0xc3ee('0x43')]+'%'};return _0x1fe17f;}})});}_0x3b17f7=_[_0xc3ee('0x41')]({},_0x3b17f7,_0x1f7b3a[_0xc3ee('0x44')]);var _0x23d365={'where':_0x3b17f7[_0xc3ee('0x3f')]};return db['Tag'][_0xc3ee('0x1e')](_0x23d365)[_0xc3ee('0x27')](function(_0x4a89b7){_0x330b71['count']=_0x4a89b7;if(_0x1f7b3a[_0xc3ee('0x36')][_0xc3ee('0x45')]){_0x3b17f7[_0xc3ee('0x46')]=[{'all':!![]}];}return db['Tag'][_0xc3ee('0x47')](_0x3b17f7);})[_0xc3ee('0x27')](function(_0x112e77){_0x330b71[_0xc3ee('0x48')]=_0x112e77;return _0x330b71;})[_0xc3ee('0x27')](respondWithFilteredResult(_0x8bbe1e,_0x3b17f7))[_0xc3ee('0x49')](handleError(_0x8bbe1e,null));};exports[_0xc3ee('0x4a')]=function(_0x724c4e,_0x49b424){var _0x602d47={'raw':!![],'where':{'id':_0x724c4e[_0xc3ee('0x4b')]['id']}},_0xf833d9={};_0xf833d9[_0xc3ee('0x35')]=_[_0xc3ee('0x4c')](db['Tag'][_0xc3ee('0x31')]);_0xf833d9['query']=_['keys'](_0x724c4e[_0xc3ee('0x36')]);_0xf833d9[_0xc3ee('0x37')]=_['intersection'](_0xf833d9[_0xc3ee('0x35')],_0xf833d9[_0xc3ee('0x36')]);_0x602d47['attributes']=_[_0xc3ee('0x38')](_0xf833d9['model'],qs[_0xc3ee('0x3a')](_0x724c4e['query'][_0xc3ee('0x3a')]));_0x602d47[_0xc3ee('0x39')]=_0x602d47['attributes']['length']?_0x602d47['attributes']:_0xf833d9[_0xc3ee('0x35')];if(_0x724c4e[_0xc3ee('0x36')][_0xc3ee('0x45')]){_0x602d47[_0xc3ee('0x46')]=[{'all':!![]}];}_0x602d47=_[_0xc3ee('0x41')]({},_0x602d47,_0x724c4e['options']);return db['Tag'][_0xc3ee('0x4d')](_0x602d47)[_0xc3ee('0x27')](handleEntityNotFound(_0x49b424,null))['then'](respondWithResult(_0x49b424,null))[_0xc3ee('0x49')](handleError(_0x49b424,null));};exports['create']=function(_0x60e36a,_0x5d0017){return db[_0xc3ee('0x4e')][_0xc3ee('0x4f')](_0x60e36a[_0xc3ee('0x50')],{})[_0xc3ee('0x27')](function(_0x8c8cc6){var _0x281adc=_0x60e36a[_0xc3ee('0x51')]['get']({'plain':!![]});if(!_0x281adc)throw new Error(_0xc3ee('0x52'));if(_0x281adc[_0xc3ee('0x53')]===_0xc3ee('0x51')){var _0x237aa8=_0x8c8cc6['get']({'plain':!![]});var _0xd246f2=_0xc3ee('0x29');return db[_0xc3ee('0x54')][_0xc3ee('0x4d')]({'where':{'name':_0xd246f2,'userProfileId':_0x281adc[_0xc3ee('0x55')]},'raw':!![]})[_0xc3ee('0x27')](function(_0x14df9d){if(_0x14df9d&&_0x14df9d['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x237aa8['name'],'resourceId':_0x237aa8['id'],'type':_0x14df9d[_0xc3ee('0x2d')],'sectionId':_0x14df9d['id']},{})[_0xc3ee('0x27')](function(){return _0x8c8cc6;});}else{return _0x8c8cc6;}})[_0xc3ee('0x49')](function(_0x2b9ea){logger[_0xc3ee('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2b9ea);throw _0x2b9ea;});}return _0x8c8cc6;})['then'](respondWithResult(_0x5d0017,0xc9))[_0xc3ee('0x49')](handleError(_0x5d0017,null));};exports['update']=function(_0x1ca127,_0x28eca9){if(_0x1ca127[_0xc3ee('0x50')]['id']){delete _0x1ca127['body']['id'];}return db[_0xc3ee('0x4e')][_0xc3ee('0x4d')]({'where':{'id':_0x1ca127[_0xc3ee('0x4b')]['id']}})[_0xc3ee('0x27')](handleEntityNotFound(_0x28eca9,null))[_0xc3ee('0x27')](saveUpdates(_0x1ca127[_0xc3ee('0x50')],null))[_0xc3ee('0x27')](respondWithResult(_0x28eca9,null))[_0xc3ee('0x49')](handleError(_0x28eca9,null));};exports[_0xc3ee('0x56')]=function(_0x5d5ca5,_0x3fdc8f){return db[_0xc3ee('0x4e')][_0xc3ee('0x4d')]({'where':{'id':_0x5d5ca5[_0xc3ee('0x4b')]['id']}})[_0xc3ee('0x27')](handleEntityNotFound(_0x3fdc8f,null))[_0xc3ee('0x27')](removeEntity(_0x3fdc8f,null))[_0xc3ee('0x49')](handleError(_0x3fdc8f,null));}; \ No newline at end of file +var _0xedd9=['userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','then','get','Tags','end','error','stack','name','send','index','map','Tag','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','includeAll','rows','catch','show','params','keys','include','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection'];(function(_0x37e188,_0x49d9b9){var _0xd8f577=function(_0x2925f8){while(--_0x2925f8){_0x37e188['push'](_0x37e188['shift']());}};_0xd8f577(++_0x49d9b9);}(_0xedd9,0xfc));var _0x9edd=function(_0x4829a1,_0x5b18eb){_0x4829a1=_0x4829a1-0x0;var _0xc144b0=_0xedd9[_0x4829a1];return _0xc144b0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9edd('0x0'));var zipdir=require(_0x9edd('0x1'));var jsonpatch=require(_0x9edd('0x2'));var rp=require(_0x9edd('0x3'));var moment=require(_0x9edd('0x4'));var BPromise=require(_0x9edd('0x5'));var Mustache=require(_0x9edd('0x6'));var util=require(_0x9edd('0x7'));var path=require('path');var sox=require(_0x9edd('0x8'));var csv=require(_0x9edd('0x9'));var ejs=require(_0x9edd('0xa'));var fs=require('fs');var fs_extra=require(_0x9edd('0xb'));var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0x9'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var as=require(_0x9edd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9edd('0x13'))(_0x9edd('0x14'));var utils=require('../../config/utils');var config=require(_0x9edd('0x15'));var licenseUtil=require(_0x9edd('0x16'));var db=require(_0x9edd('0x17'))['db'];function respondWithStatusCode(_0xfd544a,_0x287ddd){_0x287ddd=_0x287ddd||0xcc;return function(_0x3a7b84){if(_0x3a7b84){return _0xfd544a[_0x9edd('0x18')](_0x287ddd);}return _0xfd544a[_0x9edd('0x19')](_0x287ddd)['end']();};}function respondWithResult(_0x176bfa,_0x44fc7c){_0x44fc7c=_0x44fc7c||0xc8;return function(_0x891832){if(_0x891832){return _0x176bfa[_0x9edd('0x19')](_0x44fc7c)[_0x9edd('0x1a')](_0x891832);}};}function respondWithFilteredResult(_0x338f3c,_0x1042aa){return function(_0x75a4ab){if(_0x75a4ab){var _0x4ea60f=typeof _0x1042aa[_0x9edd('0x1b')]===_0x9edd('0x1c')&&typeof _0x1042aa[_0x9edd('0x1d')]==='undefined';var _0x1b54c0=_0x75a4ab[_0x9edd('0x1e')];var _0x40ba32=_0x4ea60f?0x0:_0x1042aa['offset'];var _0x43dc70=_0x4ea60f?_0x75a4ab['count']:_0x1042aa[_0x9edd('0x1b')]+_0x1042aa[_0x9edd('0x1d')];var _0x4bdb88;if(_0x43dc70>=_0x1b54c0){_0x43dc70=_0x1b54c0;_0x4bdb88=0xc8;}else{_0x4bdb88=0xce;}_0x338f3c['status'](_0x4bdb88);return _0x338f3c[_0x9edd('0x1f')]('Content-Range',_0x40ba32+'-'+_0x43dc70+'/'+_0x1b54c0)[_0x9edd('0x1a')](_0x75a4ab);}return null;};}function patchUpdates(_0x54a03f){return function(_0x535f37){try{jsonpatch[_0x9edd('0x20')](_0x535f37,_0x54a03f,!![]);}catch(_0x1c46a8){return BPromise['reject'](_0x1c46a8);}return _0x535f37['save']();};}function saveUpdates(_0x341d67,_0x186186){return function(_0x477878){if(_0x477878){return _0x477878['update'](_0x341d67)[_0x9edd('0x21')](function(_0x1dca43){return _0x1dca43;});}return null;};}function removeEntity(_0x44a6c1,_0x2ca65f){return function(_0x339a0d){if(_0x339a0d){return _0x339a0d['destroy']()[_0x9edd('0x21')](function(){var _0xeaf55a=_0x339a0d[_0x9edd('0x22')]({'plain':!![]});var _0x2f9f86=_0x9edd('0x23');return db['UserProfileResource']['destroy']({'where':{'type':_0x2f9f86,'resourceId':_0xeaf55a['id']}})[_0x9edd('0x21')](function(){return _0x339a0d;});})[_0x9edd('0x21')](function(){_0x44a6c1[_0x9edd('0x19')](0xcc)[_0x9edd('0x24')]();});}};}function handleEntityNotFound(_0x3c2227,_0x4fe471){return function(_0x57a2cc){if(!_0x57a2cc){_0x3c2227[_0x9edd('0x18')](0x194);}return _0x57a2cc;};}function handleError(_0x257a26,_0x1c762c){_0x1c762c=_0x1c762c||0x1f4;return function(_0x52746a){logger[_0x9edd('0x25')](_0x52746a[_0x9edd('0x26')]);if(_0x52746a[_0x9edd('0x27')]){delete _0x52746a[_0x9edd('0x27')];}_0x257a26['status'](_0x1c762c)[_0x9edd('0x28')](_0x52746a);};}exports[_0x9edd('0x29')]=function(_0xbe87e1,_0x12c1bc){var _0xbbf08f={},_0x42e664={},_0x209aba={'count':0x0,'rows':[]};var _0x1fba7b=_[_0x9edd('0x2a')](db[_0x9edd('0x2b')][_0x9edd('0x2c')],function(_0x138002){return{'name':_0x138002[_0x9edd('0x2d')],'type':_0x138002[_0x9edd('0x2e')][_0x9edd('0x2f')]};});_0x42e664['model']=_[_0x9edd('0x2a')](_0x1fba7b,_0x9edd('0x27'));_0x42e664[_0x9edd('0x30')]=_['keys'](_0xbe87e1[_0x9edd('0x30')]);_0x42e664[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x42e664[_0x9edd('0x33')],_0x42e664[_0x9edd('0x30')]);_0xbbf08f[_0x9edd('0x34')]=_[_0x9edd('0x32')](_0x42e664[_0x9edd('0x33')],qs[_0x9edd('0x35')](_0xbe87e1[_0x9edd('0x30')][_0x9edd('0x35')]));_0xbbf08f[_0x9edd('0x34')]=_0xbbf08f[_0x9edd('0x34')][_0x9edd('0x36')]?_0xbbf08f['attributes']:_0x42e664[_0x9edd('0x33')];if(!_0xbe87e1['query'][_0x9edd('0x37')](_0x9edd('0x38'))){_0xbbf08f[_0x9edd('0x1d')]=qs[_0x9edd('0x1d')](_0xbe87e1[_0x9edd('0x30')]['limit']);_0xbbf08f[_0x9edd('0x1b')]=qs[_0x9edd('0x1b')](_0xbe87e1[_0x9edd('0x30')][_0x9edd('0x1b')]);}_0xbbf08f[_0x9edd('0x39')]=qs[_0x9edd('0x3a')](_0xbe87e1[_0x9edd('0x30')][_0x9edd('0x3a')]);_0xbbf08f[_0x9edd('0x3b')]=qs[_0x9edd('0x31')](_['pick'](_0xbe87e1[_0x9edd('0x30')],_0x42e664['filters']),_0x1fba7b);if(_0xbe87e1[_0x9edd('0x30')]['filter']){_0xbbf08f[_0x9edd('0x3b')]=_[_0x9edd('0x3c')](_0xbbf08f[_0x9edd('0x3b')],{'$or':_['map'](_0x1fba7b,function(_0x2e85aa){if(_0x2e85aa[_0x9edd('0x2e')]!==_0x9edd('0x3d')){var _0x48958a={};_0x48958a[_0x2e85aa[_0x9edd('0x27')]]={'$like':'%'+_0xbe87e1['query'][_0x9edd('0x3e')]+'%'};return _0x48958a;}})});}_0xbbf08f=_[_0x9edd('0x3c')]({},_0xbbf08f,_0xbe87e1['options']);var _0x315f52={'where':_0xbbf08f[_0x9edd('0x3b')]};return db[_0x9edd('0x2b')][_0x9edd('0x1e')](_0x315f52)['then'](function(_0x449f01){_0x209aba['count']=_0x449f01;if(_0xbe87e1[_0x9edd('0x30')][_0x9edd('0x3f')]){_0xbbf08f['include']=[{'all':!![]}];}return db[_0x9edd('0x2b')]['findAll'](_0xbbf08f);})['then'](function(_0x369b69){_0x209aba[_0x9edd('0x40')]=_0x369b69;return _0x209aba;})[_0x9edd('0x21')](respondWithFilteredResult(_0x12c1bc,_0xbbf08f))[_0x9edd('0x41')](handleError(_0x12c1bc,null));};exports[_0x9edd('0x42')]=function(_0x4737ae,_0x3ff512){var _0x75efbe={'raw':!![],'where':{'id':_0x4737ae[_0x9edd('0x43')]['id']}},_0x18c149={};_0x18c149[_0x9edd('0x33')]=_[_0x9edd('0x44')](db[_0x9edd('0x2b')][_0x9edd('0x2c')]);_0x18c149[_0x9edd('0x30')]=_['keys'](_0x4737ae[_0x9edd('0x30')]);_0x18c149[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x18c149[_0x9edd('0x33')],_0x18c149[_0x9edd('0x30')]);_0x75efbe[_0x9edd('0x34')]=_[_0x9edd('0x32')](_0x18c149['model'],qs['fields'](_0x4737ae['query'][_0x9edd('0x35')]));_0x75efbe['attributes']=_0x75efbe[_0x9edd('0x34')][_0x9edd('0x36')]?_0x75efbe[_0x9edd('0x34')]:_0x18c149[_0x9edd('0x33')];if(_0x4737ae[_0x9edd('0x30')]['includeAll']){_0x75efbe[_0x9edd('0x45')]=[{'all':!![]}];}_0x75efbe=_[_0x9edd('0x3c')]({},_0x75efbe,_0x4737ae[_0x9edd('0x46')]);return db['Tag'][_0x9edd('0x47')](_0x75efbe)[_0x9edd('0x21')](handleEntityNotFound(_0x3ff512,null))[_0x9edd('0x21')](respondWithResult(_0x3ff512,null))[_0x9edd('0x41')](handleError(_0x3ff512,null));};exports[_0x9edd('0x48')]=function(_0x35bdec,_0x4d4f33){return db[_0x9edd('0x2b')][_0x9edd('0x48')](_0x35bdec['body'],{})[_0x9edd('0x21')](function(_0x8d8701){var _0x4bb324=_0x35bdec[_0x9edd('0x49')][_0x9edd('0x22')]({'plain':!![]});if(!_0x4bb324)throw new Error(_0x9edd('0x4a'));if(_0x4bb324['role']===_0x9edd('0x49')){var _0x151157=_0x8d8701[_0x9edd('0x22')]({'plain':!![]});var _0x28c7bd='Tags';return db[_0x9edd('0x4b')][_0x9edd('0x47')]({'where':{'name':_0x28c7bd,'userProfileId':_0x4bb324[_0x9edd('0x4c')]},'raw':!![]})['then'](function(_0x16951a){if(_0x16951a&&_0x16951a[_0x9edd('0x4d')]===0x0){return db['UserProfileResource'][_0x9edd('0x48')]({'name':_0x151157['name'],'resourceId':_0x151157['id'],'type':_0x16951a[_0x9edd('0x27')],'sectionId':_0x16951a['id']},{})[_0x9edd('0x21')](function(){return _0x8d8701;});}else{return _0x8d8701;}})[_0x9edd('0x41')](function(_0x3fcdf5){logger[_0x9edd('0x25')](_0x9edd('0x4e'),_0x3fcdf5);throw _0x3fcdf5;});}return _0x8d8701;})[_0x9edd('0x21')](respondWithResult(_0x4d4f33,0xc9))[_0x9edd('0x41')](handleError(_0x4d4f33,null));};exports[_0x9edd('0x4f')]=function(_0x25d9cc,_0x31272d){if(_0x25d9cc['body']['id']){delete _0x25d9cc[_0x9edd('0x50')]['id'];}return db[_0x9edd('0x2b')][_0x9edd('0x47')]({'where':{'id':_0x25d9cc['params']['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x31272d,null))['then'](saveUpdates(_0x25d9cc['body'],null))['then'](respondWithResult(_0x31272d,null))[_0x9edd('0x41')](handleError(_0x31272d,null));};exports[_0x9edd('0x51')]=function(_0x366316,_0x35ddb3){return db['Tag']['find']({'where':{'id':_0x366316['params']['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x35ddb3,null))[_0x9edd('0x21')](removeEntity(_0x35ddb3,null))[_0x9edd('0x41')](handleError(_0x35ddb3,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index c578eda..1756251 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 _0xbdee=['tools_tags','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','Tag'];(function(_0x545fd5,_0x38f377){var _0x5babce=function(_0x29cd09){while(--_0x29cd09){_0x545fd5['push'](_0x545fd5['shift']());}};_0x5babce(++_0x38f377);}(_0xbdee,0x181));var _0xebde=function(_0x38a1b2,_0x4257b3){_0x38a1b2=_0x38a1b2-0x0;var _0x5d4164=_0xbdee[_0x38a1b2];return _0x5d4164;};'use strict';var _=require(_0xebde('0x0'));var util=require(_0xebde('0x1'));var logger=require('../../config/logger')(_0xebde('0x2'));var moment=require(_0xebde('0x3'));var BPromise=require(_0xebde('0x4'));var rp=require(_0xebde('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xebde('0x6'));var config=require(_0xebde('0x7'));var attributes=require('./tag.attributes');module[_0xebde('0x8')]=function(_0x15ad6f,_0xfddbc5){return _0x15ad6f[_0xebde('0x9')](_0xebde('0xa'),attributes,{'tableName':_0xebde('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcf9e=['util','../../config/logger','api','bluebird','path','../../config/environment','./tag.attributes','exports','Tag','tools_tags','lodash'];(function(_0x45a5db,_0x3e7481){var _0x20cf38=function(_0x41f528){while(--_0x41f528){_0x45a5db['push'](_0x45a5db['shift']());}};_0x20cf38(++_0x3e7481);}(_0xcf9e,0x83));var _0xecf9=function(_0x3b63d8,_0x55c3b0){_0x3b63d8=_0x3b63d8-0x0;var _0x53d161=_0xcf9e[_0x3b63d8];return _0x53d161;};'use strict';var _=require(_0xecf9('0x0'));var util=require(_0xecf9('0x1'));var logger=require(_0xecf9('0x2'))(_0xecf9('0x3'));var moment=require('moment');var BPromise=require(_0xecf9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xecf9('0x5'));var rimraf=require('rimraf');var config=require(_0xecf9('0x6'));var attributes=require(_0xecf9('0x7'));module[_0xecf9('0x8')]=function(_0x26f932,_0x63fbab){return _0x26f932['define'](_0xecf9('0x9'),attributes,{'tableName':_0xecf9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index ec39c97..b8bc0fa 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 _0xdd0c=['error','code','message','result','catch','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x941f77,_0x448bef){var _0x5c9aa2=function(_0x5554b7){while(--_0x5554b7){_0x941f77['push'](_0x941f77['shift']());}};_0x5c9aa2(++_0x448bef);}(_0xdd0c,0x165));var _0xcdd0=function(_0x15d135,_0x22ffde){_0x15d135=_0x15d135-0x0;var _0x1d72d0=_0xdd0c[_0x15d135];return _0x1d72d0;};'use strict';var _=require('lodash');var util=require(_0xcdd0('0x0'));var moment=require(_0xcdd0('0x1'));var BPromise=require(_0xcdd0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcdd0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xcdd0('0x4'));var logger=require(_0xcdd0('0x5'))(_0xcdd0('0x6'));var config=require(_0xcdd0('0x7'));var jayson=require(_0xcdd0('0x8'));var client=jayson['client'][_0xcdd0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1b6f5d,_0x1fd3f6,_0x15c402){return new BPromise(function(_0x337496,_0x557a65){return client[_0xcdd0('0xa')](_0x1b6f5d,_0x15c402)['then'](function(_0x5db720){logger[_0xcdd0('0xb')](_0xcdd0('0xc'),_0x1fd3f6,_0xcdd0('0xd'));logger[_0xcdd0('0xe')](_0xcdd0('0xf'),_0x1fd3f6,_0xcdd0('0xd'),JSON[_0xcdd0('0x10')](_0x5db720));if(_0x5db720[_0xcdd0('0x11')]){if(_0x5db720[_0xcdd0('0x11')][_0xcdd0('0x12')]===0x1f4){logger['error']('Tag,\x20%s,\x20%s',_0x1fd3f6,_0x5db720[_0xcdd0('0x11')][_0xcdd0('0x13')]);return _0x557a65(_0x5db720['error'][_0xcdd0('0x13')]);}logger[_0xcdd0('0x11')]('Tag,\x20%s,\x20%s',_0x1fd3f6,_0x5db720[_0xcdd0('0x11')][_0xcdd0('0x13')]);return _0x337496(_0x5db720[_0xcdd0('0x11')][_0xcdd0('0x13')]);}else{logger[_0xcdd0('0xb')]('Tag,\x20%s,\x20%s',_0x1fd3f6,'request\x20sent');_0x337496(_0x5db720[_0xcdd0('0x14')][_0xcdd0('0x13')]);}})[_0xcdd0('0x15')](function(_0xf7af04){logger[_0xcdd0('0x11')](_0xcdd0('0xc'),_0x1fd3f6,_0xf7af04);_0x557a65(_0xf7af04);});});} \ No newline at end of file +var _0x0e9f=['debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','Tag,\x20%s,\x20%s','message','catch','lodash','util','randomstring','../../config/utils','../../config/environment','jayson/promise','http','then','info','request\x20sent'];(function(_0x1ad926,_0x3e1fed){var _0x1b81dc=function(_0x506f83){while(--_0x506f83){_0x1ad926['push'](_0x1ad926['shift']());}};_0x1b81dc(++_0x3e1fed);}(_0x0e9f,0x116));var _0xf0e9=function(_0x186a3b,_0x4f2165){_0x186a3b=_0x186a3b-0x0;var _0x392661=_0x0e9f[_0x186a3b];return _0x392661;};'use strict';var _=require(_0xf0e9('0x0'));var util=require(_0xf0e9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf0e9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf0e9('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0xf0e9('0x4'));var jayson=require(_0xf0e9('0x5'));var client=jayson['client'][_0xf0e9('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x4a35a3,_0x3f9792,_0x2fa08f){return new BPromise(function(_0x106ba0,_0x58edfe){return client['request'](_0x4a35a3,_0x2fa08f)[_0xf0e9('0x7')](function(_0x7b3146){logger[_0xf0e9('0x8')]('Tag,\x20%s,\x20%s',_0x3f9792,_0xf0e9('0x9'));logger[_0xf0e9('0xa')](_0xf0e9('0xb'),_0x3f9792,'request\x20sent',JSON[_0xf0e9('0xc')](_0x7b3146));if(_0x7b3146[_0xf0e9('0xd')]){if(_0x7b3146[_0xf0e9('0xd')][_0xf0e9('0xe')]===0x1f4){logger['error'](_0xf0e9('0xf'),_0x3f9792,_0x7b3146['error'][_0xf0e9('0x10')]);return _0x58edfe(_0x7b3146[_0xf0e9('0xd')]['message']);}logger[_0xf0e9('0xd')](_0xf0e9('0xf'),_0x3f9792,_0x7b3146[_0xf0e9('0xd')][_0xf0e9('0x10')]);return _0x106ba0(_0x7b3146[_0xf0e9('0xd')][_0xf0e9('0x10')]);}else{logger['info'](_0xf0e9('0xf'),_0x3f9792,_0xf0e9('0x9'));_0x106ba0(_0x7b3146['result'][_0xf0e9('0x10')]);}})[_0xf0e9('0x11')](function(_0x3d0b4d){logger[_0xf0e9('0xd')]('Tag,\x20%s,\x20%s',_0x3f9792,_0x3d0b4d);_0x58edfe(_0x3d0b4d);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 5c6e7d9..62d3677 100644 --- a/server/api/team/index.js +++ b/server/api/team/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/team/team.attributes.js b/server/api/team/team.attributes.js index c972c5d..0ae2ef7 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 _0xb10b=['name','sequelize','STRING'];(function(_0x56fa19,_0x1789c1){var _0x4d1bed=function(_0x2df9ec){while(--_0x2df9ec){_0x56fa19['push'](_0x56fa19['shift']());}};_0x4d1bed(++_0x1789c1);}(_0xb10b,0x12a));var _0xbb10=function(_0x4291a2,_0x2ee2e5){_0x4291a2=_0x4291a2-0x0;var _0x235817=_0xb10b[_0x4291a2];return _0x235817;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}}; \ No newline at end of file +var _0xe706=['STRING','sequelize','exports'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0xe706,0xa3));var _0x6e70=function(_0xf5d71c,_0x2613a6){_0xf5d71c=_0xf5d71c-0x0;var _0x5af672=_0xe706[_0xf5d71c];return _0x5af672;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'name':{'type':Sequelize[_0x6e70('0x2')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x6e70('0x2')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 2d8bf4d..7c894ad 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 _0x9de2=['request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./team.socket','register','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','where','filter','merge','type','VIRTUAL','options','Team','includeAll','findAll','rows','show','params','length','include','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','UserVoiceQueue','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','UserChatQueue','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','Teams','end','getQueues','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','order','sort','Queues','addQueues','add','ids','removeQueues','findOne','remove','addAgents','isArray','Voice','Chat','Sms','Fax','Openchannel','Whatsapp','through','TeamVoiceQueue','penalty','User','findOrCreate','Queue:save','QueueId','online','voicePause','interface','isNil','format','SIP/%s','all','spread','removeAgents','Mail','emit','Queue:remove','UserVoiceQueueRt','pick','getAgents','eml-format','rimraf','fast-json-patch'];(function(_0x4b2426,_0x5a1056){var _0x171413=function(_0x5708dd){while(--_0x5708dd){_0x4b2426['push'](_0x4b2426['shift']());}};_0x171413(++_0x5a1056);}(_0x9de2,0x141));var _0x29de=function(_0x230da2,_0x4df769){_0x230da2=_0x230da2-0x0;var _0x47179d=_0x9de2[_0x230da2];return _0x47179d;};'use strict';var emlformat=require(_0x29de('0x0'));var rimraf=require(_0x29de('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x29de('0x2'));var rp=require(_0x29de('0x3'));var moment=require('moment');var BPromise=require(_0x29de('0x4'));var Mustache=require(_0x29de('0x5'));var util=require(_0x29de('0x6'));var path=require(_0x29de('0x7'));var sox=require(_0x29de('0x8'));var csv=require('to-csv');var ejs=require(_0x29de('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x29de('0xa'));var squel=require(_0x29de('0xb'));var crypto=require(_0x29de('0xc'));var jsforce=require(_0x29de('0xd'));var deskjs=require(_0x29de('0xe'));var toCsv=require(_0x29de('0xf'));var querystring=require(_0x29de('0x10'));var Papa=require(_0x29de('0x11'));var Redis=require(_0x29de('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x29de('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x29de('0x14'));var logger=require('../../config/logger')(_0x29de('0x15'));var utils=require(_0x29de('0x16'));var config=require(_0x29de('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x29de('0x18'))['db'];config[_0x29de('0x19')]=_[_0x29de('0x1a')](config[_0x29de('0x19')],{'host':_0x29de('0x1b'),'port':0x18eb});var socket=require(_0x29de('0x1c'))(new Redis(config[_0x29de('0x19')]));require(_0x29de('0x1d'))[_0x29de('0x1e')](socket);function respondWithStatusCode(_0x37357b,_0x414f7d){_0x414f7d=_0x414f7d||0xcc;return function(_0x55e3d6){if(_0x55e3d6){return _0x37357b[_0x29de('0x1f')](_0x414f7d);}return _0x37357b[_0x29de('0x20')](_0x414f7d)['end']();};}function respondWithResult(_0x1bda17,_0x588ccd){_0x588ccd=_0x588ccd||0xc8;return function(_0x2acc32){if(_0x2acc32){return _0x1bda17[_0x29de('0x20')](_0x588ccd)['json'](_0x2acc32);}};}function respondWithFilteredResult(_0xe406a6,_0x16e1ac){return function(_0x2f4304){if(_0x2f4304){var _0x2c523d=typeof _0x16e1ac[_0x29de('0x21')]===_0x29de('0x22')&&typeof _0x16e1ac[_0x29de('0x23')]==='undefined';var _0x12fb47=_0x2f4304[_0x29de('0x24')];var _0x327146=_0x2c523d?0x0:_0x16e1ac['offset'];var _0x32c294=_0x2c523d?_0x2f4304['count']:_0x16e1ac[_0x29de('0x21')]+_0x16e1ac[_0x29de('0x23')];var _0x3a0a25;if(_0x32c294>=_0x12fb47){_0x32c294=_0x12fb47;_0x3a0a25=0xc8;}else{_0x3a0a25=0xce;}_0xe406a6[_0x29de('0x20')](_0x3a0a25);return _0xe406a6[_0x29de('0x25')](_0x29de('0x26'),_0x327146+'-'+_0x32c294+'/'+_0x12fb47)['json'](_0x2f4304);}return null;};}function patchUpdates(_0x18da2d){return function(_0x4bdeb6){try{jsonpatch[_0x29de('0x27')](_0x4bdeb6,_0x18da2d,!![]);}catch(_0x2e5e1e){return BPromise[_0x29de('0x28')](_0x2e5e1e);}return _0x4bdeb6['save']();};}function saveUpdates(_0x29c212,_0x3b33a6){return function(_0x249356){if(_0x249356){return _0x249356[_0x29de('0x29')](_0x29c212)[_0x29de('0x2a')](function(_0x28f21){return _0x28f21;});}return null;};}function handleEntityNotFound(_0x24ecc2,_0x25d8eb){return function(_0x57df14){if(!_0x57df14){_0x24ecc2[_0x29de('0x1f')](0x194);}return _0x57df14;};}function handleError(_0x6cb490,_0x1cae06){_0x1cae06=_0x1cae06||0x1f4;return function(_0x8115d8){logger[_0x29de('0x2b')](_0x8115d8[_0x29de('0x2c')]);if(_0x8115d8[_0x29de('0x2d')]){delete _0x8115d8[_0x29de('0x2d')];}_0x6cb490[_0x29de('0x20')](_0x1cae06)[_0x29de('0x2e')](_0x8115d8);};}exports[_0x29de('0x2f')]=function(_0xad3b34,_0x3ed86b){var _0x5ac36a={},_0x67bbcd={},_0x216e94={'count':0x0,'rows':[]};var _0x5e1ef6=_[_0x29de('0x30')](db['Team'][_0x29de('0x31')],function(_0x312cad){return{'name':_0x312cad[_0x29de('0x32')],'type':_0x312cad['type'][_0x29de('0x33')]};});_0x67bbcd[_0x29de('0x34')]=_[_0x29de('0x30')](_0x5e1ef6,_0x29de('0x2d'));_0x67bbcd[_0x29de('0x35')]=_[_0x29de('0x36')](_0xad3b34[_0x29de('0x35')]);_0x67bbcd[_0x29de('0x37')]=_[_0x29de('0x38')](_0x67bbcd[_0x29de('0x34')],_0x67bbcd[_0x29de('0x35')]);_0x5ac36a[_0x29de('0x39')]=_[_0x29de('0x38')](_0x67bbcd[_0x29de('0x34')],qs[_0x29de('0x3a')](_0xad3b34[_0x29de('0x35')][_0x29de('0x3a')]));_0x5ac36a[_0x29de('0x39')]=_0x5ac36a[_0x29de('0x39')]['length']?_0x5ac36a[_0x29de('0x39')]:_0x67bbcd['model'];if(!_0xad3b34[_0x29de('0x35')][_0x29de('0x3b')](_0x29de('0x3c'))){_0x5ac36a['limit']=qs['limit'](_0xad3b34[_0x29de('0x35')][_0x29de('0x23')]);_0x5ac36a[_0x29de('0x21')]=qs[_0x29de('0x21')](_0xad3b34[_0x29de('0x35')][_0x29de('0x21')]);}_0x5ac36a['order']=qs['sort'](_0xad3b34[_0x29de('0x35')]['sort']);_0x5ac36a[_0x29de('0x3d')]=qs[_0x29de('0x37')](_['pick'](_0xad3b34[_0x29de('0x35')],_0x67bbcd['filters']),_0x5e1ef6);if(_0xad3b34['query'][_0x29de('0x3e')]){_0x5ac36a[_0x29de('0x3d')]=_[_0x29de('0x3f')](_0x5ac36a[_0x29de('0x3d')],{'$or':_[_0x29de('0x30')](_0x5e1ef6,function(_0x26c681){if(_0x26c681[_0x29de('0x40')]!==_0x29de('0x41')){var _0x47fea1={};_0x47fea1[_0x26c681[_0x29de('0x2d')]]={'$like':'%'+_0xad3b34[_0x29de('0x35')]['filter']+'%'};return _0x47fea1;}})});}_0x5ac36a=_[_0x29de('0x3f')]({},_0x5ac36a,_0xad3b34[_0x29de('0x42')]);var _0x2c516f={'where':_0x5ac36a[_0x29de('0x3d')]};return db[_0x29de('0x43')]['count'](_0x2c516f)['then'](function(_0x57b6bb){_0x216e94[_0x29de('0x24')]=_0x57b6bb;if(_0xad3b34[_0x29de('0x35')][_0x29de('0x44')]){_0x5ac36a['include']=[{'all':!![]}];}return db['Team'][_0x29de('0x45')](_0x5ac36a);})[_0x29de('0x2a')](function(_0x3278d7){_0x216e94[_0x29de('0x46')]=_0x3278d7;return _0x216e94;})['then'](respondWithFilteredResult(_0x3ed86b,_0x5ac36a))['catch'](handleError(_0x3ed86b,null));};exports[_0x29de('0x47')]=function(_0x3ce427,_0x3ef047){var _0x6bbdf2={'raw':![],'where':{'id':_0x3ce427[_0x29de('0x48')]['id']}},_0x2b1057={};_0x2b1057[_0x29de('0x34')]=_[_0x29de('0x36')](db[_0x29de('0x43')]['rawAttributes']);_0x2b1057['query']=_[_0x29de('0x36')](_0x3ce427[_0x29de('0x35')]);_0x2b1057[_0x29de('0x37')]=_[_0x29de('0x38')](_0x2b1057[_0x29de('0x34')],_0x2b1057[_0x29de('0x35')]);_0x6bbdf2[_0x29de('0x39')]=_['intersection'](_0x2b1057[_0x29de('0x34')],qs[_0x29de('0x3a')](_0x3ce427['query'][_0x29de('0x3a')]));_0x6bbdf2[_0x29de('0x39')]=_0x6bbdf2[_0x29de('0x39')][_0x29de('0x49')]?_0x6bbdf2['attributes']:_0x2b1057[_0x29de('0x34')];if(_0x3ce427['query']['includeAll']){_0x6bbdf2[_0x29de('0x4a')]=[{'all':!![]}];}_0x6bbdf2=_['merge']({},_0x6bbdf2,_0x3ce427[_0x29de('0x42')]);return db[_0x29de('0x43')][_0x29de('0x4b')](_0x6bbdf2)['then'](handleEntityNotFound(_0x3ef047,null))['then'](respondWithResult(_0x3ef047,null))[_0x29de('0x4c')](handleError(_0x3ef047,null));};exports[_0x29de('0x4d')]=function(_0x5f274c,_0x1e2548){return db[_0x29de('0x43')][_0x29de('0x4d')](_0x5f274c[_0x29de('0x4e')],{})[_0x29de('0x2a')](function(_0x53b242){var _0x3e4a2a=_0x5f274c[_0x29de('0x4f')][_0x29de('0x50')]({'plain':!![]});if(!_0x3e4a2a)throw new Error(_0x29de('0x51'));if(_0x3e4a2a[_0x29de('0x52')]===_0x29de('0x4f')){var _0xe252d3=_0x53b242[_0x29de('0x50')]({'plain':!![]});var _0x58ac84='Teams';return db[_0x29de('0x53')]['find']({'where':{'name':_0x58ac84,'userProfileId':_0x3e4a2a[_0x29de('0x54')]},'raw':!![]})['then'](function(_0xc7424a){if(_0xc7424a&&_0xc7424a[_0x29de('0x55')]===0x0){return db[_0x29de('0x56')]['create']({'name':_0xe252d3[_0x29de('0x2d')],'resourceId':_0xe252d3['id'],'type':_0xc7424a['name'],'sectionId':_0xc7424a['id']},{})['then'](function(){return _0x53b242;});}else{return _0x53b242;}})['catch'](function(_0x446ce8){logger[_0x29de('0x2b')](_0x29de('0x57'),_0x446ce8);throw _0x446ce8;});}return _0x53b242;})[_0x29de('0x2a')](respondWithResult(_0x1e2548,0xc9))[_0x29de('0x4c')](handleError(_0x1e2548,null));};exports[_0x29de('0x29')]=function(_0x4a7a3f,_0x1110d5){if(_0x4a7a3f[_0x29de('0x4e')]['id']){delete _0x4a7a3f[_0x29de('0x4e')]['id'];}return db['Team'][_0x29de('0x4b')]({'where':{'id':_0x4a7a3f['params']['id']}})[_0x29de('0x2a')](handleEntityNotFound(_0x1110d5,null))[_0x29de('0x2a')](saveUpdates(_0x4a7a3f[_0x29de('0x4e')],null))['then'](respondWithResult(_0x1110d5,null))[_0x29de('0x4c')](handleError(_0x1110d5,null));};exports[_0x29de('0x58')]=function(_0x1a4389,_0x26f270){var _0x257910=_0x1a4389[_0x29de('0x48')]['id'];var _0x2790d4=[];return db[_0x29de('0x59')][_0x29de('0x5a')](function(_0x34b821){var _0x4cb730=_0x29de('0x5b')+_0x257910;return db[_0x29de('0x59')][_0x29de('0x35')](_0x4cb730,{'type':db[_0x29de('0x5c')][_0x29de('0x5d')][_0x29de('0x5e')],'raw':!![],'transaction':_0x34b821})['then'](function(_0x5e9d28){_0x2790d4=_[_0x29de('0x30')](_0x5e9d28,function(_0x4ef6ab){return Number(_0x4ef6ab[_0x29de('0x5f')]);});})[_0x29de('0x2a')](function(){var _0x354eb0=_0x29de('0x60')+_0x257910;return db[_0x29de('0x59')][_0x29de('0x35')](_0x354eb0,{'type':db[_0x29de('0x5c')][_0x29de('0x5d')][_0x29de('0x5e')],'raw':!![],'transaction':_0x34b821});})['then'](function(_0x38f1bc){var _0x4520ab=_['map'](_0x38f1bc,function(_0x2c1d23){return Number(_0x2c1d23['VoiceQueueId']);});return db[_0x29de('0x61')]['destroy']({'where':{'UserId':{'$in':_0x2790d4},'VoiceQueueId':{'$in':_0x4520ab}},'transaction':_0x34b821});})[_0x29de('0x2a')](function(){var _0x59460e='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0x257910;return db['sequelize'][_0x29de('0x35')](_0x59460e,{'type':db[_0x29de('0x5c')][_0x29de('0x5d')][_0x29de('0x5e')],'raw':!![],'transaction':_0x34b821});})['then'](function(_0x2afd1e){var _0x1994a3=_['map'](_0x2afd1e,function(_0xdff683){return Number(_0xdff683[_0x29de('0x62')]);});return db[_0x29de('0x63')][_0x29de('0x58')]({'where':{'UserId':{'$in':_0x2790d4},'MailQueueId':{'$in':_0x1994a3}},'transaction':_0x34b821});})[_0x29de('0x2a')](function(){var _0x4eda0f=_0x29de('0x64')+_0x257910;return db[_0x29de('0x59')][_0x29de('0x35')](_0x4eda0f,{'type':db[_0x29de('0x5c')][_0x29de('0x5d')][_0x29de('0x5e')],'raw':!![],'transaction':_0x34b821});})[_0x29de('0x2a')](function(_0x4ff2b7){var _0x4360a5=_[_0x29de('0x30')](_0x4ff2b7,function(_0x11025c){return Number(_0x11025c['SmsQueueId']);});return db[_0x29de('0x65')][_0x29de('0x58')]({'where':{'UserId':{'$in':_0x2790d4},'SmsQueueId':{'$in':_0x4360a5}},'transaction':_0x34b821});})[_0x29de('0x2a')](function(){var _0x29010a=_0x29de('0x66')+_0x257910;return db[_0x29de('0x59')][_0x29de('0x35')](_0x29010a,{'type':db[_0x29de('0x5c')][_0x29de('0x5d')][_0x29de('0x5e')],'raw':!![],'transaction':_0x34b821});})[_0x29de('0x2a')](function(_0x6a93a0){var _0x363180=_[_0x29de('0x30')](_0x6a93a0,function(_0x14ff2){return Number(_0x14ff2['ChatQueueId']);});return db[_0x29de('0x67')][_0x29de('0x58')]({'where':{'UserId':{'$in':_0x2790d4},'ChatQueueId':{'$in':_0x363180}},'transaction':_0x34b821});})[_0x29de('0x2a')](function(){var _0x2afe2d='SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20'+_0x257910;return db[_0x29de('0x59')][_0x29de('0x35')](_0x2afe2d,{'type':db[_0x29de('0x5c')][_0x29de('0x5d')][_0x29de('0x5e')],'raw':!![],'transaction':_0x34b821});})[_0x29de('0x2a')](function(_0x53394c){var _0x5bdf5d=_[_0x29de('0x30')](_0x53394c,function(_0x14ec84){return Number(_0x14ec84[_0x29de('0x68')]);});return db[_0x29de('0x69')][_0x29de('0x58')]({'where':{'UserId':{'$in':_0x2790d4},'FaxQueueId':{'$in':_0x5bdf5d}},'transaction':_0x34b821});})[_0x29de('0x2a')](function(){var _0x2120c6=_0x29de('0x6a')+_0x257910;return db[_0x29de('0x59')][_0x29de('0x35')](_0x2120c6,{'type':db[_0x29de('0x5c')]['QueryTypes'][_0x29de('0x5e')],'raw':!![],'transaction':_0x34b821});})[_0x29de('0x2a')](function(_0x413e6c){var _0x1d622a=_[_0x29de('0x30')](_0x413e6c,function(_0x32858e){return Number(_0x32858e[_0x29de('0x6b')]);});return db['UserOpenchannelQueue'][_0x29de('0x58')]({'where':{'UserId':{'$in':_0x2790d4},'OpenchannelQueueId':{'$in':_0x1d622a}},'transaction':_0x34b821});})[_0x29de('0x2a')](function(){var _0x3c47c2=_0x29de('0x6c')+_0x257910;return db[_0x29de('0x59')][_0x29de('0x35')](_0x3c47c2,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x34b821});})['then'](function(_0x530a01){var _0x2b8e79=_[_0x29de('0x30')](_0x530a01,function(_0x527fb6){return Number(_0x527fb6[_0x29de('0x6d')]);});return db['UserWhatsappQueue'][_0x29de('0x58')]({'where':{'UserId':{'$in':_0x2790d4},'WhatsappQueueId':{'$in':_0x2b8e79}},'transaction':_0x34b821});})[_0x29de('0x2a')](function(){return db[_0x29de('0x6e')][_0x29de('0x4b')]({'where':{'TeamId':_0x257910}});})[_0x29de('0x2a')](function(_0x27b4ed){if(_0x27b4ed===null){return;}return db[_0x29de('0x6f')][_0x29de('0x58')]({'where':{'UserId':{'$in':_0x2790d4},'VoicePrefixId':_0x27b4ed[_0x29de('0x70')]},'transaction':_0x34b821});})[_0x29de('0x2a')](function(){return db['Team'][_0x29de('0x58')]({'where':{'id':_0x257910},'cascade':!![],'transaction':_0x34b821});})[_0x29de('0x2a')](function(_0x4c6fce){if(_0x4c6fce===0x0){_0x26f270['sendStatus'](0x194);}else{return db['UserProfileResource'][_0x29de('0x58')]({'where':{'type':_0x29de('0x71'),'resourceId':_0x257910},'cascade':!![],'transaction':_0x34b821})[_0x29de('0x2a')](function(){_0x26f270[_0x29de('0x20')](0xcc)[_0x29de('0x72')]();});}})[_0x29de('0x4c')](function(_0x29ec8d){_0x26f270['status'](0x1f4)[_0x29de('0x2e')](_0x29ec8d);});});};exports[_0x29de('0x73')]=function(_0x2dd0d6,_0x16e973,_0x394ac5){return db[_0x29de('0x43')]['findOne']({'where':{'id':_0x2dd0d6[_0x29de('0x48')]['id']}})[_0x29de('0x2a')](handleEntityNotFound(_0x16e973,null))['then'](function(_0xbbf762){if(!_0x2dd0d6['query'][_0x29de('0x74')]||!utils[_0x29de('0x75')](_0x2dd0d6[_0x29de('0x35')][_0x29de('0x74')])){throw new db[(_0x29de('0x5c'))][(_0x29de('0x76'))](_0x29de('0x77'));}var _0x22967b={};var _0x4024b7={};_0x4024b7[_0x29de('0x34')]=_[_0x29de('0x36')](db[_[_0x29de('0x78')](_0x2dd0d6[_0x29de('0x35')][_0x29de('0x74')][_0x29de('0x79')]())+_0x29de('0x7a')][_0x29de('0x31')]);_0x4024b7[_0x29de('0x35')]=_[_0x29de('0x36')](_0x2dd0d6[_0x29de('0x35')]);_0x4024b7['filters']=_[_0x29de('0x38')](_0x4024b7[_0x29de('0x34')],_0x4024b7['query']);_0x22967b[_0x29de('0x39')]=_[_0x29de('0x38')](_0x4024b7[_0x29de('0x34')],qs[_0x29de('0x3a')](_0x2dd0d6[_0x29de('0x35')][_0x29de('0x3a')]));_0x22967b[_0x29de('0x39')]=_0x22967b['attributes']['length']?_0x22967b['attributes']:_0x4024b7[_0x29de('0x34')];_0x22967b[_0x29de('0x23')]=qs['limit'](_0x2dd0d6[_0x29de('0x35')][_0x29de('0x23')]);_0x22967b['offset']=qs[_0x29de('0x21')](_0x2dd0d6[_0x29de('0x35')][_0x29de('0x21')]);_0x22967b[_0x29de('0x7b')]=qs['sort'](_0x2dd0d6[_0x29de('0x35')][_0x29de('0x7c')]);_0x22967b[_0x29de('0x3d')]=qs[_0x29de('0x37')](_['pick'](_0x2dd0d6[_0x29de('0x35')],_0x4024b7[_0x29de('0x37')]));_0x22967b=_[_0x29de('0x3f')]({},_0x22967b,_0x2dd0d6[_0x29de('0x42')]);return _0xbbf762[_0x29de('0x50')+_[_0x29de('0x78')](_0x2dd0d6[_0x29de('0x35')][_0x29de('0x74')][_0x29de('0x79')]())+_0x29de('0x7d')](_0x22967b);})[_0x29de('0x2a')](respondWithResult(_0x16e973,null))['catch'](handleError(_0x16e973,null));};exports[_0x29de('0x7e')]=function(_0x46c30c,_0x3be0b3,_0x17a972){return db[_0x29de('0x43')]['findOne']({'where':{'id':_0x46c30c[_0x29de('0x48')]['id']}})[_0x29de('0x2a')](function(_0xc0a1a){if(_0xc0a1a){if(!_0x46c30c[_0x29de('0x4e')]['channel']||!utils[_0x29de('0x75')](_0x46c30c[_0x29de('0x4e')][_0x29de('0x74')])){throw new db[(_0x29de('0x5c'))][(_0x29de('0x76'))](_0x29de('0x77'));}return _0xc0a1a[_0x29de('0x7f')+_['capitalize'](_0x46c30c[_0x29de('0x4e')][_0x29de('0x74')][_0x29de('0x79')]())+_0x29de('0x7d')](_0x46c30c[_0x29de('0x4e')][_0x29de('0x80')]);}return null;})[_0x29de('0x2a')](handleEntityNotFound(_0x3be0b3,null))[_0x29de('0x2a')](respondWithStatusCode(_0x3be0b3,null))[_0x29de('0x4c')](handleError(_0x3be0b3,null));};exports[_0x29de('0x81')]=function(_0x336348,_0x53b114,_0x2f4bf1){return db[_0x29de('0x43')][_0x29de('0x82')]({'where':{'id':_0x336348[_0x29de('0x48')]['id']}})[_0x29de('0x2a')](function(_0x56aed6){if(_0x56aed6){if(!_0x336348[_0x29de('0x35')][_0x29de('0x74')]||!utils[_0x29de('0x75')](_0x336348[_0x29de('0x35')][_0x29de('0x74')])){throw new db[(_0x29de('0x5c'))]['ValidationError']('Unknown\x20channel');}return _0x56aed6[_0x29de('0x83')+_[_0x29de('0x78')](_0x336348[_0x29de('0x35')]['channel'][_0x29de('0x79')]())+_0x29de('0x7d')](_0x336348[_0x29de('0x35')][_0x29de('0x80')]);}return null;})[_0x29de('0x2a')](handleEntityNotFound(_0x53b114,null))[_0x29de('0x2a')](respondWithStatusCode(_0x53b114,null))['catch'](handleError(_0x53b114,null));};exports[_0x29de('0x84')]=function(_0xea3bb,_0x2e734d){var _0x28f521=_[_0x29de('0x85')](_0xea3bb[_0x29de('0x4e')][_0x29de('0x80')])?_0xea3bb[_0x29de('0x4e')][_0x29de('0x80')]:[_0xea3bb[_0x29de('0x4e')][_0x29de('0x80')]];var _0x5412db=_0xea3bb[_0x29de('0x48')]['id'];return db['Team'][_0x29de('0x4b')]({'where':{'id':_0x5412db}})[_0x29de('0x2a')](handleEntityNotFound(_0x2e734d,null))['then'](function(_0x344ebf){if(_0x344ebf){var _0x489f81=[_0x29de('0x86'),_0x29de('0x87'),'Mail',_0x29de('0x88'),_0x29de('0x89'),_0x29de('0x8a'),_0x29de('0x8b')];return db['sequelize'][_0x29de('0x5a')](function(_0x44c5b8){var _0x17f21d=_['map'](_0x489f81,function(_0xdd41cc){var _0x4d0ba3={'attributes':['id',_0x29de('0x2d')]};if(_0xdd41cc===_0x29de('0x86')){_0x4d0ba3[_0x29de('0x8c')]={'attributes':['penalty']};}return _0x344ebf[_0x29de('0x50')+_0xdd41cc+'Queues'](_0x4d0ba3)[_0x29de('0x2a')](function(_0x4da6d2){var _0x29e93b=_[_0x29de('0x30')](_0x4da6d2,function(_0x1c3b80){var _0x1ad283=_[_0x29de('0x30')](_0x28f521,function(_0x1508ec){var _0x472d59={'where':{'UserId':_0x1508ec,[_0xdd41cc+'QueueId']:_0x1c3b80['id']},'transaction':_0x44c5b8};if(_0xdd41cc===_0x29de('0x86')){_0x472d59[_0x29de('0x1a')]={'penalty':_0x1c3b80[_0x29de('0x8d')][_0x29de('0x8e')]};}return db[_0x29de('0x8f')+_0xdd41cc+_0x29de('0x7a')][_0x29de('0x90')](_0x472d59)[_0x29de('0x2a')](function(){socket['emit'](_0x29de('0x4f')+_0xdd41cc+_0x29de('0x91'),{'UserId':_0x1508ec,[_0xdd41cc+_0x29de('0x92')]:_0x1c3b80['id']});if(_0xdd41cc!==_0x29de('0x86')){return;}return db[_0x29de('0x8f')][_0x29de('0x45')]({'where':{'id':_0x28f521,'online':0x1},'attributes':['id',_0x29de('0x2d'),_0x29de('0x93'),_0x29de('0x94'),_0x29de('0x95')],'raw':!![]})['then'](function(_0x18efa5){var _0x53ea3a=_[_0x29de('0x30')](_0x18efa5,function(_0x2b8b14){return db['UserVoiceQueueRt']['upsert']({'membername':_0x2b8b14[_0x29de('0x2d')],'UserId':_0x2b8b14['id'],'queue_name':_0x1c3b80[_0x29de('0x2d')],'VoiceQueueId':_0x1c3b80['id'],'interface':_[_0x29de('0x96')](_0x2b8b14[_0x29de('0x95')])?util[_0x29de('0x97')](_0x29de('0x98'),_0x2b8b14[_0x29de('0x2d')]):_0x2b8b14[_0x29de('0x95')],'paused':_0x2b8b14['voicePause']||![],'penalty':_0x1c3b80[_0x29de('0x8d')][_0x29de('0x8e')]},{'transaction':_0x44c5b8});});return Promise[_0x29de('0x99')](_0x53ea3a);});});});return Promise['all'](_0x1ad283);});return Promise[_0x29de('0x99')](_0x29e93b);})['then'](function(){return db[_0x29de('0x6e')][_0x29de('0x82')]({'where':{'teamId':_0x5412db}})[_0x29de('0x2a')](function(_0x1fc122){if(_0x1fc122){var _0x2bb953=_[_0x29de('0x30')](_0x28f521,function(_0x55e366){db[_0x29de('0x6f')]['upsert']({'UserId':_0x55e366,'VoicePrefixId':_0x1fc122[_0x29de('0x70')]});});return Promise[_0x29de('0x99')](_0x2bb953);}});});});return Promise[_0x29de('0x99')](_0x17f21d)['then'](function(){return _0x344ebf['addAgents'](_0x28f521,{'transaction':_0x44c5b8})[_0x29de('0x9a')](function(_0x1680c9){return _0x1680c9;});});});}})[_0x29de('0x2a')](respondWithResult(_0x2e734d,null))[_0x29de('0x4c')](handleError(_0x2e734d,null));};exports[_0x29de('0x9b')]=function(_0x5327f9,_0x3cb09c){var _0x299dd5=_['isArray'](_0x5327f9[_0x29de('0x35')][_0x29de('0x80')])?_0x5327f9[_0x29de('0x35')][_0x29de('0x80')]:[_0x5327f9['query'][_0x29de('0x80')]];var _0x11e381=_0x5327f9[_0x29de('0x48')]['id'];return db[_0x29de('0x43')]['find']({'where':{'id':_0x11e381}})[_0x29de('0x2a')](handleEntityNotFound(_0x3cb09c,null))[_0x29de('0x2a')](function(_0x1a10c0){if(_0x1a10c0){var _0x37e0e0=[_0x29de('0x86'),_0x29de('0x87'),_0x29de('0x9c'),_0x29de('0x88'),_0x29de('0x89'),'Openchannel',_0x29de('0x8b')];return db[_0x29de('0x59')][_0x29de('0x5a')](function(_0x4ada7a){var _0x317c7d=_[_0x29de('0x30')](_0x37e0e0,function(_0x37ac9f){var _0x1d6edc={'attributes':['id','name']};return _0x1a10c0[_0x29de('0x50')+_0x37ac9f+_0x29de('0x7d')](_0x1d6edc)['then'](function(_0x325309){var _0x5239dd=_[_0x29de('0x30')](_0x325309,function(_0x229873){return _0x229873[_0x29de('0x9b')](_0x299dd5,{'transaction':_0x4ada7a})[_0x29de('0x2a')](function(){var _0x301b93=_[_0x29de('0x30')](_0x299dd5,function(_0x77f6d9){socket[_0x29de('0x9d')](_0x29de('0x4f')+_0x37ac9f+_0x29de('0x9e'),{'UserId':Number(_0x77f6d9),[_0x37ac9f+_0x29de('0x92')]:_0x229873['id']});if(_0x37ac9f!==_0x29de('0x86')){return;}return db[_0x29de('0x9f')][_0x29de('0x58')]({'where':{'VoiceQueueId':_0x229873['id'],'UserId':_0x77f6d9},'transaction':_0x4ada7a});});return Promise[_0x29de('0x99')](_0x301b93);});});return Promise['all'](_0x5239dd);});});return Promise[_0x29de('0x99')](_0x317c7d)['then'](function(){return _0x1a10c0['removeAgents'](_0x299dd5,{'transaction':_0x4ada7a});})[_0x29de('0x2a')](function(){return db[_0x29de('0x6e')][_0x29de('0x82')]({'where':{'teamId':_0x11e381}})[_0x29de('0x2a')](function(_0x20e0b1){if(_0x20e0b1){var _0x442da4=_[_0x29de('0x30')](_0x299dd5,function(_0x491b42){db[_0x29de('0x6f')][_0x29de('0x58')]({'where':{'UserId':_0x491b42,'VoicePrefixId':_0x20e0b1[_0x29de('0x70')]}});});return Promise[_0x29de('0x99')](_0x442da4);}});});});}})['then'](respondWithStatusCode(_0x3cb09c,null))[_0x29de('0x4c')](handleError(_0x3cb09c,null));};exports['getAgents']=function(_0x5d959f,_0x412019,_0x44b40f){var _0x531eae={};var _0x3dd0d6={};var _0x103c4a;var _0x5db146;return db['Team'][_0x29de('0x82')]({'where':{'id':_0x5d959f[_0x29de('0x48')]['id']}})['then'](handleEntityNotFound(_0x412019,null))[_0x29de('0x2a')](function(_0x18afad){if(_0x18afad){_0x103c4a=_0x18afad;_0x3dd0d6['model']=_[_0x29de('0x36')](db[_0x29de('0x8f')][_0x29de('0x31')]);_0x3dd0d6['query']=_[_0x29de('0x36')](_0x5d959f[_0x29de('0x35')]);_0x3dd0d6[_0x29de('0x37')]=_[_0x29de('0x38')](_0x3dd0d6[_0x29de('0x34')],_0x3dd0d6[_0x29de('0x35')]);_0x531eae['attributes']=_[_0x29de('0x38')](_0x3dd0d6[_0x29de('0x34')],qs[_0x29de('0x3a')](_0x5d959f['query'][_0x29de('0x3a')]));_0x531eae[_0x29de('0x39')]=_0x531eae[_0x29de('0x39')]['length']?_0x531eae[_0x29de('0x39')]:_0x3dd0d6[_0x29de('0x34')];_0x531eae[_0x29de('0x7b')]=qs[_0x29de('0x7c')](_0x5d959f[_0x29de('0x35')][_0x29de('0x7c')]);_0x531eae[_0x29de('0x3d')]=qs[_0x29de('0x37')](_[_0x29de('0xa0')](_0x5d959f[_0x29de('0x35')],_0x3dd0d6[_0x29de('0x37')]));if(_0x5d959f['query'][_0x29de('0x3e')]){_0x531eae[_0x29de('0x3d')]=_[_0x29de('0x3f')](_0x531eae[_0x29de('0x3d')],{'$or':_[_0x29de('0x30')](_0x531eae[_0x29de('0x39')],function(_0x51ce7d){var _0xf9b695={};_0xf9b695[_0x51ce7d]={'$like':'%'+_0x5d959f[_0x29de('0x35')]['filter']+'%'};return _0xf9b695;})});}_0x531eae=_[_0x29de('0x3f')]({},_0x531eae,_0x5d959f['options']);return _0x103c4a['getAgents'](_0x531eae);}})['then'](function(_0x3c60d7){if(_0x3c60d7){_0x5db146=_0x3c60d7[_0x29de('0x49')];if(!_0x5d959f['query'][_0x29de('0x3b')]('nolimit')){_0x531eae[_0x29de('0x23')]=qs[_0x29de('0x23')](_0x5d959f[_0x29de('0x35')][_0x29de('0x23')]);_0x531eae['offset']=qs[_0x29de('0x21')](_0x5d959f[_0x29de('0x35')]['offset']);}return _0x103c4a[_0x29de('0xa1')](_0x531eae);}})[_0x29de('0x2a')](function(_0x22c124){if(_0x22c124){return _0x22c124?{'count':_0x5db146,'rows':_0x22c124}:null;}})[_0x29de('0x2a')](respondWithResult(_0x412019,null))[_0x29de('0x4c')](handleError(_0x412019,null));}; \ No newline at end of file +var _0x5890=['pick','filter','merge','VIRTUAL','options','then','includeAll','rows','catch','show','params','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','Teams','UserProfileSection','find','autoAssociation','update','destroy','sequelize','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','Sequelize','VoiceQueueId','UserVoiceQueue','MailQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','UserProfileResource','send','getQueues','findOne','channel','Unknown\x20channel','toLowerCase','Queue','capitalize','Queues','addQueues','add','ids','removeQueues','isValidChannel','ValidationError','remove','addAgents','Voice','Chat','Sms','Fax','Whatsapp','transaction','penalty','TeamVoiceQueue','User','findOrCreate','Queue:save','QueueId','findAll','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','all','spread','removeAgents','isArray','emit','Queue:remove','getAgents','hasOwnProperty','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','./team.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','error','stack','name','map','Team','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where'];(function(_0x1a1fb4,_0x32e717){var _0x3bb705=function(_0x25876f){while(--_0x25876f){_0x1a1fb4['push'](_0x1a1fb4['shift']());}};_0x3bb705(++_0x32e717);}(_0x5890,0xf3));var _0x0589=function(_0x1dfa3d,_0x592b50){_0x1dfa3d=_0x1dfa3d-0x0;var _0x5da24a=_0x5890[_0x1dfa3d];return _0x5da24a;};'use strict';var emlformat=require(_0x0589('0x0'));var rimraf=require(_0x0589('0x1'));var zipdir=require(_0x0589('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0589('0x3'));var moment=require(_0x0589('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0589('0x5'));var util=require(_0x0589('0x6'));var path=require(_0x0589('0x7'));var sox=require(_0x0589('0x8'));var csv=require(_0x0589('0x9'));var ejs=require(_0x0589('0xa'));var fs=require('fs');var fs_extra=require(_0x0589('0xb'));var _=require(_0x0589('0xc'));var squel=require('squel');var crypto=require(_0x0589('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x0589('0xe'));var toCsv=require(_0x0589('0x9'));var querystring=require(_0x0589('0xf'));var Papa=require(_0x0589('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0589('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0589('0x12'));var logger=require(_0x0589('0x13'))(_0x0589('0x14'));var utils=require(_0x0589('0x15'));var config=require(_0x0589('0x16'));var licenseUtil=require(_0x0589('0x17'));var db=require(_0x0589('0x18'))['db'];config['redis']=_[_0x0589('0x19')](config[_0x0589('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0589('0x1b'))[_0x0589('0x1c')](socket);function respondWithStatusCode(_0x38ef8f,_0x16ae3d){_0x16ae3d=_0x16ae3d||0xcc;return function(_0x2a81a9){if(_0x2a81a9){return _0x38ef8f[_0x0589('0x1d')](_0x16ae3d);}return _0x38ef8f[_0x0589('0x1e')](_0x16ae3d)[_0x0589('0x1f')]();};}function respondWithResult(_0xc0a10d,_0x3db443){_0x3db443=_0x3db443||0xc8;return function(_0x2664ca){if(_0x2664ca){return _0xc0a10d[_0x0589('0x1e')](_0x3db443)[_0x0589('0x20')](_0x2664ca);}};}function respondWithFilteredResult(_0x1d1df1,_0x3a9b9b){return function(_0x583250){if(_0x583250){var _0xcfbe87=typeof _0x3a9b9b['offset']===_0x0589('0x21')&&typeof _0x3a9b9b[_0x0589('0x22')]===_0x0589('0x21');var _0x1ce099=_0x583250[_0x0589('0x23')];var _0x5b8d97=_0xcfbe87?0x0:_0x3a9b9b[_0x0589('0x24')];var _0x581c8f=_0xcfbe87?_0x583250[_0x0589('0x23')]:_0x3a9b9b[_0x0589('0x24')]+_0x3a9b9b[_0x0589('0x22')];var _0x4680d2;if(_0x581c8f>=_0x1ce099){_0x581c8f=_0x1ce099;_0x4680d2=0xc8;}else{_0x4680d2=0xce;}_0x1d1df1[_0x0589('0x1e')](_0x4680d2);return _0x1d1df1[_0x0589('0x25')]('Content-Range',_0x5b8d97+'-'+_0x581c8f+'/'+_0x1ce099)[_0x0589('0x20')](_0x583250);}return null;};}function patchUpdates(_0x4495c9){return function(_0x53a437){try{jsonpatch[_0x0589('0x26')](_0x53a437,_0x4495c9,!![]);}catch(_0x467cd0){return BPromise[_0x0589('0x27')](_0x467cd0);}return _0x53a437[_0x0589('0x28')]();};}function saveUpdates(_0x15f3f5,_0x26b418){return function(_0x187891){if(_0x187891){return _0x187891['update'](_0x15f3f5)['then'](function(_0x19f5f2){return _0x19f5f2;});}return null;};}function handleEntityNotFound(_0x234a52,_0x179715){return function(_0x46d7fe){if(!_0x46d7fe){_0x234a52[_0x0589('0x1d')](0x194);}return _0x46d7fe;};}function handleError(_0x576dbe,_0x2e4305){_0x2e4305=_0x2e4305||0x1f4;return function(_0x1fbe18){logger[_0x0589('0x29')](_0x1fbe18[_0x0589('0x2a')]);if(_0x1fbe18[_0x0589('0x2b')]){delete _0x1fbe18['name'];}_0x576dbe[_0x0589('0x1e')](_0x2e4305)['send'](_0x1fbe18);};}exports['index']=function(_0x5cf7af,_0x5111ac){var _0x1f38c7={},_0x3760f5={},_0x5d15ae={'count':0x0,'rows':[]};var _0x21bba8=_[_0x0589('0x2c')](db[_0x0589('0x2d')][_0x0589('0x2e')],function(_0x2b9664){return{'name':_0x2b9664['fieldName'],'type':_0x2b9664['type']['key']};});_0x3760f5[_0x0589('0x2f')]=_[_0x0589('0x2c')](_0x21bba8,_0x0589('0x2b'));_0x3760f5[_0x0589('0x30')]=_[_0x0589('0x31')](_0x5cf7af[_0x0589('0x30')]);_0x3760f5[_0x0589('0x32')]=_[_0x0589('0x33')](_0x3760f5[_0x0589('0x2f')],_0x3760f5[_0x0589('0x30')]);_0x1f38c7[_0x0589('0x34')]=_[_0x0589('0x33')](_0x3760f5[_0x0589('0x2f')],qs[_0x0589('0x35')](_0x5cf7af['query'][_0x0589('0x35')]));_0x1f38c7[_0x0589('0x34')]=_0x1f38c7['attributes'][_0x0589('0x36')]?_0x1f38c7[_0x0589('0x34')]:_0x3760f5[_0x0589('0x2f')];if(!_0x5cf7af[_0x0589('0x30')]['hasOwnProperty'](_0x0589('0x37'))){_0x1f38c7[_0x0589('0x22')]=qs[_0x0589('0x22')](_0x5cf7af[_0x0589('0x30')][_0x0589('0x22')]);_0x1f38c7[_0x0589('0x24')]=qs[_0x0589('0x24')](_0x5cf7af[_0x0589('0x30')][_0x0589('0x24')]);}_0x1f38c7[_0x0589('0x38')]=qs[_0x0589('0x39')](_0x5cf7af[_0x0589('0x30')][_0x0589('0x39')]);_0x1f38c7[_0x0589('0x3a')]=qs[_0x0589('0x32')](_[_0x0589('0x3b')](_0x5cf7af['query'],_0x3760f5['filters']),_0x21bba8);if(_0x5cf7af['query'][_0x0589('0x3c')]){_0x1f38c7[_0x0589('0x3a')]=_[_0x0589('0x3d')](_0x1f38c7[_0x0589('0x3a')],{'$or':_['map'](_0x21bba8,function(_0x5925d1){if(_0x5925d1['type']!==_0x0589('0x3e')){var _0xa7d814={};_0xa7d814[_0x5925d1[_0x0589('0x2b')]]={'$like':'%'+_0x5cf7af[_0x0589('0x30')]['filter']+'%'};return _0xa7d814;}})});}_0x1f38c7=_[_0x0589('0x3d')]({},_0x1f38c7,_0x5cf7af[_0x0589('0x3f')]);var _0x53fe11={'where':_0x1f38c7[_0x0589('0x3a')]};return db[_0x0589('0x2d')][_0x0589('0x23')](_0x53fe11)[_0x0589('0x40')](function(_0x2a129e){_0x5d15ae['count']=_0x2a129e;if(_0x5cf7af[_0x0589('0x30')][_0x0589('0x41')]){_0x1f38c7['include']=[{'all':!![]}];}return db[_0x0589('0x2d')]['findAll'](_0x1f38c7);})[_0x0589('0x40')](function(_0x2a1c97){_0x5d15ae[_0x0589('0x42')]=_0x2a1c97;return _0x5d15ae;})['then'](respondWithFilteredResult(_0x5111ac,_0x1f38c7))[_0x0589('0x43')](handleError(_0x5111ac,null));};exports[_0x0589('0x44')]=function(_0x4aaad3,_0x33b67a){var _0xd758e7={'raw':![],'where':{'id':_0x4aaad3[_0x0589('0x45')]['id']}},_0x23cf3c={};_0x23cf3c[_0x0589('0x2f')]=_['keys'](db[_0x0589('0x2d')]['rawAttributes']);_0x23cf3c[_0x0589('0x30')]=_[_0x0589('0x31')](_0x4aaad3['query']);_0x23cf3c['filters']=_['intersection'](_0x23cf3c[_0x0589('0x2f')],_0x23cf3c['query']);_0xd758e7[_0x0589('0x34')]=_[_0x0589('0x33')](_0x23cf3c[_0x0589('0x2f')],qs[_0x0589('0x35')](_0x4aaad3[_0x0589('0x30')][_0x0589('0x35')]));_0xd758e7['attributes']=_0xd758e7['attributes']['length']?_0xd758e7['attributes']:_0x23cf3c[_0x0589('0x2f')];if(_0x4aaad3[_0x0589('0x30')]['includeAll']){_0xd758e7[_0x0589('0x46')]=[{'all':!![]}];}_0xd758e7=_[_0x0589('0x3d')]({},_0xd758e7,_0x4aaad3['options']);return db['Team']['find'](_0xd758e7)[_0x0589('0x40')](handleEntityNotFound(_0x33b67a,null))[_0x0589('0x40')](respondWithResult(_0x33b67a,null))[_0x0589('0x43')](handleError(_0x33b67a,null));};exports[_0x0589('0x47')]=function(_0x230dec,_0x16f339){return db[_0x0589('0x2d')]['create'](_0x230dec[_0x0589('0x48')],{})[_0x0589('0x40')](function(_0x1ab33c){var _0x3125c9=_0x230dec[_0x0589('0x49')]['get']({'plain':!![]});if(!_0x3125c9)throw new Error(_0x0589('0x4a'));if(_0x3125c9['role']===_0x0589('0x49')){var _0x2e2ebe=_0x1ab33c[_0x0589('0x4b')]({'plain':!![]});var _0xc7a482=_0x0589('0x4c');return db[_0x0589('0x4d')][_0x0589('0x4e')]({'where':{'name':_0xc7a482,'userProfileId':_0x3125c9['userProfileId']},'raw':!![]})['then'](function(_0x378e79){if(_0x378e79&&_0x378e79[_0x0589('0x4f')]===0x0){return db['UserProfileResource']['create']({'name':_0x2e2ebe[_0x0589('0x2b')],'resourceId':_0x2e2ebe['id'],'type':_0x378e79[_0x0589('0x2b')],'sectionId':_0x378e79['id']},{})[_0x0589('0x40')](function(){return _0x1ab33c;});}else{return _0x1ab33c;}})[_0x0589('0x43')](function(_0x58b3b4){logger[_0x0589('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x58b3b4);throw _0x58b3b4;});}return _0x1ab33c;})['then'](respondWithResult(_0x16f339,0xc9))[_0x0589('0x43')](handleError(_0x16f339,null));};exports[_0x0589('0x50')]=function(_0x1b60d1,_0x220931){if(_0x1b60d1[_0x0589('0x48')]['id']){delete _0x1b60d1['body']['id'];}return db['Team'][_0x0589('0x4e')]({'where':{'id':_0x1b60d1[_0x0589('0x45')]['id']}})[_0x0589('0x40')](handleEntityNotFound(_0x220931,null))['then'](saveUpdates(_0x1b60d1['body'],null))[_0x0589('0x40')](respondWithResult(_0x220931,null))['catch'](handleError(_0x220931,null));};exports[_0x0589('0x51')]=function(_0x259328,_0x161673){var _0x189c5c=_0x259328[_0x0589('0x45')]['id'];var _0x9b9b7=[];return db[_0x0589('0x52')]['transaction'](function(_0x38c614){var _0x3fbdaf=_0x0589('0x53')+_0x189c5c;return db['sequelize'][_0x0589('0x30')](_0x3fbdaf,{'type':db['Sequelize'][_0x0589('0x54')][_0x0589('0x55')],'raw':!![],'transaction':_0x38c614})[_0x0589('0x40')](function(_0x506e11){_0x9b9b7=_[_0x0589('0x2c')](_0x506e11,function(_0x4280e4){return Number(_0x4280e4[_0x0589('0x56')]);});})['then'](function(){var _0x412385=_0x0589('0x57')+_0x189c5c;return db['sequelize']['query'](_0x412385,{'type':db[_0x0589('0x58')][_0x0589('0x54')][_0x0589('0x55')],'raw':!![],'transaction':_0x38c614});})[_0x0589('0x40')](function(_0x259326){var _0x418963=_[_0x0589('0x2c')](_0x259326,function(_0x4aa449){return Number(_0x4aa449[_0x0589('0x59')]);});return db[_0x0589('0x5a')][_0x0589('0x51')]({'where':{'UserId':{'$in':_0x9b9b7},'VoiceQueueId':{'$in':_0x418963}},'transaction':_0x38c614});})['then'](function(){var _0x3cb6de='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0x189c5c;return db[_0x0589('0x52')][_0x0589('0x30')](_0x3cb6de,{'type':db[_0x0589('0x58')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x38c614});})['then'](function(_0x153136){var _0x11e08b=_['map'](_0x153136,function(_0x49281d){return Number(_0x49281d[_0x0589('0x5b')]);});return db['UserMailQueue']['destroy']({'where':{'UserId':{'$in':_0x9b9b7},'MailQueueId':{'$in':_0x11e08b}},'transaction':_0x38c614});})['then'](function(){var _0x333c24='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x189c5c;return db[_0x0589('0x52')][_0x0589('0x30')](_0x333c24,{'type':db[_0x0589('0x58')]['QueryTypes'][_0x0589('0x55')],'raw':!![],'transaction':_0x38c614});})[_0x0589('0x40')](function(_0x3b304d){var _0x29710f=_[_0x0589('0x2c')](_0x3b304d,function(_0x4222b7){return Number(_0x4222b7['SmsQueueId']);});return db[_0x0589('0x5c')]['destroy']({'where':{'UserId':{'$in':_0x9b9b7},'SmsQueueId':{'$in':_0x29710f}},'transaction':_0x38c614});})[_0x0589('0x40')](function(){var _0x11e464=_0x0589('0x5d')+_0x189c5c;return db['sequelize'][_0x0589('0x30')](_0x11e464,{'type':db[_0x0589('0x58')][_0x0589('0x54')][_0x0589('0x55')],'raw':!![],'transaction':_0x38c614});})[_0x0589('0x40')](function(_0x368fe0){var _0x307a1e=_[_0x0589('0x2c')](_0x368fe0,function(_0x2c8e3c){return Number(_0x2c8e3c[_0x0589('0x5e')]);});return db['UserChatQueue']['destroy']({'where':{'UserId':{'$in':_0x9b9b7},'ChatQueueId':{'$in':_0x307a1e}},'transaction':_0x38c614});})[_0x0589('0x40')](function(){var _0x12f911=_0x0589('0x5f')+_0x189c5c;return db[_0x0589('0x52')]['query'](_0x12f911,{'type':db[_0x0589('0x58')][_0x0589('0x54')]['SELECT'],'raw':!![],'transaction':_0x38c614});})['then'](function(_0x2212f4){var _0x779ec7=_[_0x0589('0x2c')](_0x2212f4,function(_0x27d0a6){return Number(_0x27d0a6[_0x0589('0x60')]);});return db['UserFaxQueue'][_0x0589('0x51')]({'where':{'UserId':{'$in':_0x9b9b7},'FaxQueueId':{'$in':_0x779ec7}},'transaction':_0x38c614});})[_0x0589('0x40')](function(){var _0x1f11ae=_0x0589('0x61')+_0x189c5c;return db[_0x0589('0x52')][_0x0589('0x30')](_0x1f11ae,{'type':db[_0x0589('0x58')][_0x0589('0x54')][_0x0589('0x55')],'raw':!![],'transaction':_0x38c614});})['then'](function(_0x199354){var _0x32a0e6=_['map'](_0x199354,function(_0x23fdcb){return Number(_0x23fdcb['OpenchannelQueueId']);});return db[_0x0589('0x62')][_0x0589('0x51')]({'where':{'UserId':{'$in':_0x9b9b7},'OpenchannelQueueId':{'$in':_0x32a0e6}},'transaction':_0x38c614});})[_0x0589('0x40')](function(){var _0x3d79ed=_0x0589('0x63')+_0x189c5c;return db[_0x0589('0x52')]['query'](_0x3d79ed,{'type':db[_0x0589('0x58')][_0x0589('0x54')]['SELECT'],'raw':!![],'transaction':_0x38c614});})['then'](function(_0x4984b2){var _0x32bfe0=_['map'](_0x4984b2,function(_0x36b241){return Number(_0x36b241[_0x0589('0x64')]);});return db[_0x0589('0x65')]['destroy']({'where':{'UserId':{'$in':_0x9b9b7},'WhatsappQueueId':{'$in':_0x32bfe0}},'transaction':_0x38c614});})['then'](function(){return db[_0x0589('0x66')][_0x0589('0x4e')]({'where':{'TeamId':_0x189c5c}});})[_0x0589('0x40')](function(_0xfe679c){if(_0xfe679c===null){return;}return db[_0x0589('0x67')][_0x0589('0x51')]({'where':{'UserId':{'$in':_0x9b9b7},'VoicePrefixId':_0xfe679c['VoicePrefixId']},'transaction':_0x38c614});})[_0x0589('0x40')](function(){return db[_0x0589('0x2d')][_0x0589('0x51')]({'where':{'id':_0x189c5c},'cascade':!![],'transaction':_0x38c614});})[_0x0589('0x40')](function(_0x6a37f5){if(_0x6a37f5===0x0){_0x161673[_0x0589('0x1d')](0x194);}else{return db[_0x0589('0x68')][_0x0589('0x51')]({'where':{'type':_0x0589('0x4c'),'resourceId':_0x189c5c},'cascade':!![],'transaction':_0x38c614})['then'](function(){_0x161673['status'](0xcc)['end']();});}})['catch'](function(_0x3e3990){_0x161673[_0x0589('0x1e')](0x1f4)[_0x0589('0x69')](_0x3e3990);});});};exports[_0x0589('0x6a')]=function(_0x4ffafb,_0x37ca93,_0x2f6868){return db[_0x0589('0x2d')][_0x0589('0x6b')]({'where':{'id':_0x4ffafb[_0x0589('0x45')]['id']}})[_0x0589('0x40')](handleEntityNotFound(_0x37ca93,null))[_0x0589('0x40')](function(_0x5ef6ae){if(!_0x4ffafb[_0x0589('0x30')][_0x0589('0x6c')]||!utils['isValidChannel'](_0x4ffafb[_0x0589('0x30')]['channel'])){throw new db[(_0x0589('0x58'))]['ValidationError'](_0x0589('0x6d'));}var _0x38d9bb={};var _0x1fef45={};_0x1fef45[_0x0589('0x2f')]=_[_0x0589('0x31')](db[_['capitalize'](_0x4ffafb['query'][_0x0589('0x6c')][_0x0589('0x6e')]())+_0x0589('0x6f')][_0x0589('0x2e')]);_0x1fef45[_0x0589('0x30')]=_[_0x0589('0x31')](_0x4ffafb[_0x0589('0x30')]);_0x1fef45[_0x0589('0x32')]=_[_0x0589('0x33')](_0x1fef45[_0x0589('0x2f')],_0x1fef45[_0x0589('0x30')]);_0x38d9bb[_0x0589('0x34')]=_[_0x0589('0x33')](_0x1fef45[_0x0589('0x2f')],qs['fields'](_0x4ffafb[_0x0589('0x30')][_0x0589('0x35')]));_0x38d9bb['attributes']=_0x38d9bb['attributes']['length']?_0x38d9bb['attributes']:_0x1fef45[_0x0589('0x2f')];_0x38d9bb['limit']=qs[_0x0589('0x22')](_0x4ffafb['query'][_0x0589('0x22')]);_0x38d9bb[_0x0589('0x24')]=qs[_0x0589('0x24')](_0x4ffafb[_0x0589('0x30')]['offset']);_0x38d9bb[_0x0589('0x38')]=qs[_0x0589('0x39')](_0x4ffafb[_0x0589('0x30')][_0x0589('0x39')]);_0x38d9bb['where']=qs[_0x0589('0x32')](_[_0x0589('0x3b')](_0x4ffafb[_0x0589('0x30')],_0x1fef45[_0x0589('0x32')]));_0x38d9bb=_['merge']({},_0x38d9bb,_0x4ffafb[_0x0589('0x3f')]);return _0x5ef6ae[_0x0589('0x4b')+_[_0x0589('0x70')](_0x4ffafb[_0x0589('0x30')][_0x0589('0x6c')][_0x0589('0x6e')]())+_0x0589('0x71')](_0x38d9bb);})[_0x0589('0x40')](respondWithResult(_0x37ca93,null))['catch'](handleError(_0x37ca93,null));};exports[_0x0589('0x72')]=function(_0x3c38ac,_0x6ff19b,_0x2f6e43){return db[_0x0589('0x2d')][_0x0589('0x6b')]({'where':{'id':_0x3c38ac[_0x0589('0x45')]['id']}})[_0x0589('0x40')](function(_0x4bf6e3){if(_0x4bf6e3){if(!_0x3c38ac['body'][_0x0589('0x6c')]||!utils['isValidChannel'](_0x3c38ac[_0x0589('0x48')][_0x0589('0x6c')])){throw new db[(_0x0589('0x58'))]['ValidationError'](_0x0589('0x6d'));}return _0x4bf6e3[_0x0589('0x73')+_[_0x0589('0x70')](_0x3c38ac['body'][_0x0589('0x6c')][_0x0589('0x6e')]())+'Queues'](_0x3c38ac['body'][_0x0589('0x74')]);}return null;})[_0x0589('0x40')](handleEntityNotFound(_0x6ff19b,null))['then'](respondWithStatusCode(_0x6ff19b,null))[_0x0589('0x43')](handleError(_0x6ff19b,null));};exports[_0x0589('0x75')]=function(_0x228baa,_0x4999ac,_0x3d98aa){return db[_0x0589('0x2d')][_0x0589('0x6b')]({'where':{'id':_0x228baa[_0x0589('0x45')]['id']}})['then'](function(_0x4a22a3){if(_0x4a22a3){if(!_0x228baa[_0x0589('0x30')][_0x0589('0x6c')]||!utils[_0x0589('0x76')](_0x228baa[_0x0589('0x30')]['channel'])){throw new db[(_0x0589('0x58'))][(_0x0589('0x77'))](_0x0589('0x6d'));}return _0x4a22a3[_0x0589('0x78')+_[_0x0589('0x70')](_0x228baa[_0x0589('0x30')][_0x0589('0x6c')][_0x0589('0x6e')]())+_0x0589('0x71')](_0x228baa['query'][_0x0589('0x74')]);}return null;})[_0x0589('0x40')](handleEntityNotFound(_0x4999ac,null))[_0x0589('0x40')](respondWithStatusCode(_0x4999ac,null))[_0x0589('0x43')](handleError(_0x4999ac,null));};exports[_0x0589('0x79')]=function(_0x102e36,_0x25a720){var _0x46d968=_['isArray'](_0x102e36[_0x0589('0x48')][_0x0589('0x74')])?_0x102e36['body'][_0x0589('0x74')]:[_0x102e36['body'][_0x0589('0x74')]];var _0x35eb68=_0x102e36['params']['id'];return db[_0x0589('0x2d')][_0x0589('0x4e')]({'where':{'id':_0x35eb68}})[_0x0589('0x40')](handleEntityNotFound(_0x25a720,null))[_0x0589('0x40')](function(_0x5cffe6){if(_0x5cffe6){var _0x48db5e=[_0x0589('0x7a'),_0x0589('0x7b'),'Mail',_0x0589('0x7c'),_0x0589('0x7d'),'Openchannel',_0x0589('0x7e')];return db[_0x0589('0x52')][_0x0589('0x7f')](function(_0x18c374){var _0x2d6bdd=_[_0x0589('0x2c')](_0x48db5e,function(_0x30d4e6){var _0x517751={'attributes':['id',_0x0589('0x2b')]};if(_0x30d4e6===_0x0589('0x7a')){_0x517751['through']={'attributes':[_0x0589('0x80')]};}return _0x5cffe6[_0x0589('0x4b')+_0x30d4e6+_0x0589('0x71')](_0x517751)[_0x0589('0x40')](function(_0x361171){var _0x5d483f=_[_0x0589('0x2c')](_0x361171,function(_0x1a58df){var _0x2b8b2b=_[_0x0589('0x2c')](_0x46d968,function(_0x6b681b){var _0x29ff47={'where':{'UserId':_0x6b681b,[_0x30d4e6+'QueueId']:_0x1a58df['id']},'transaction':_0x18c374};if(_0x30d4e6==='Voice'){_0x29ff47[_0x0589('0x19')]={'penalty':_0x1a58df[_0x0589('0x81')][_0x0589('0x80')]};}return db[_0x0589('0x82')+_0x30d4e6+_0x0589('0x6f')][_0x0589('0x83')](_0x29ff47)[_0x0589('0x40')](function(){socket['emit']('user'+_0x30d4e6+_0x0589('0x84'),{'UserId':_0x6b681b,[_0x30d4e6+_0x0589('0x85')]:_0x1a58df['id']});if(_0x30d4e6!==_0x0589('0x7a')){return;}return db[_0x0589('0x82')][_0x0589('0x86')]({'where':{'id':_0x46d968,'online':0x1},'attributes':['id','name',_0x0589('0x87'),_0x0589('0x88'),_0x0589('0x89')],'raw':!![]})[_0x0589('0x40')](function(_0x2923a3){var _0x42ec03=_[_0x0589('0x2c')](_0x2923a3,function(_0x221bf6){return db[_0x0589('0x8a')][_0x0589('0x8b')]({'membername':_0x221bf6[_0x0589('0x2b')],'UserId':_0x221bf6['id'],'queue_name':_0x1a58df['name'],'VoiceQueueId':_0x1a58df['id'],'interface':_[_0x0589('0x8c')](_0x221bf6[_0x0589('0x89')])?util[_0x0589('0x8d')](_0x0589('0x8e'),_0x221bf6[_0x0589('0x2b')]):_0x221bf6['interface'],'paused':_0x221bf6[_0x0589('0x88')]||![],'penalty':_0x1a58df['TeamVoiceQueue'][_0x0589('0x80')]},{'transaction':_0x18c374});});return Promise[_0x0589('0x8f')](_0x42ec03);});});});return Promise['all'](_0x2b8b2b);});return Promise[_0x0589('0x8f')](_0x5d483f);})[_0x0589('0x40')](function(){return db[_0x0589('0x66')]['findOne']({'where':{'teamId':_0x35eb68}})[_0x0589('0x40')](function(_0x42d792){if(_0x42d792){var _0x235faa=_[_0x0589('0x2c')](_0x46d968,function(_0x8fc053){db['UserVoicePrefix'][_0x0589('0x8b')]({'UserId':_0x8fc053,'VoicePrefixId':_0x42d792['VoicePrefixId']});});return Promise[_0x0589('0x8f')](_0x235faa);}});});});return Promise['all'](_0x2d6bdd)[_0x0589('0x40')](function(){return _0x5cffe6[_0x0589('0x79')](_0x46d968,{'transaction':_0x18c374})[_0x0589('0x90')](function(_0x23e6bb){return _0x23e6bb;});});});}})[_0x0589('0x40')](respondWithResult(_0x25a720,null))[_0x0589('0x43')](handleError(_0x25a720,null));};exports[_0x0589('0x91')]=function(_0x36d7a9,_0x389faa){var _0x2072f8=_[_0x0589('0x92')](_0x36d7a9[_0x0589('0x30')][_0x0589('0x74')])?_0x36d7a9[_0x0589('0x30')][_0x0589('0x74')]:[_0x36d7a9['query'][_0x0589('0x74')]];var _0x49555c=_0x36d7a9[_0x0589('0x45')]['id'];return db['Team'][_0x0589('0x4e')]({'where':{'id':_0x49555c}})['then'](handleEntityNotFound(_0x389faa,null))[_0x0589('0x40')](function(_0x19b02f){if(_0x19b02f){var _0x4fd43d=[_0x0589('0x7a'),'Chat','Mail','Sms',_0x0589('0x7d'),'Openchannel',_0x0589('0x7e')];return db[_0x0589('0x52')]['transaction'](function(_0x3c6712){var _0x83355b=_[_0x0589('0x2c')](_0x4fd43d,function(_0x5b5c9b){var _0x5edd41={'attributes':['id',_0x0589('0x2b')]};return _0x19b02f[_0x0589('0x4b')+_0x5b5c9b+_0x0589('0x71')](_0x5edd41)[_0x0589('0x40')](function(_0x332f0e){var _0x2603fc=_['map'](_0x332f0e,function(_0x388e2c){return _0x388e2c[_0x0589('0x91')](_0x2072f8,{'transaction':_0x3c6712})[_0x0589('0x40')](function(){var _0x5ca7af=_[_0x0589('0x2c')](_0x2072f8,function(_0x40ef2d){socket[_0x0589('0x93')](_0x0589('0x49')+_0x5b5c9b+_0x0589('0x94'),{'UserId':Number(_0x40ef2d),[_0x5b5c9b+_0x0589('0x85')]:_0x388e2c['id']});if(_0x5b5c9b!==_0x0589('0x7a')){return;}return db[_0x0589('0x8a')][_0x0589('0x51')]({'where':{'VoiceQueueId':_0x388e2c['id'],'UserId':_0x40ef2d},'transaction':_0x3c6712});});return Promise[_0x0589('0x8f')](_0x5ca7af);});});return Promise[_0x0589('0x8f')](_0x2603fc);});});return Promise[_0x0589('0x8f')](_0x83355b)[_0x0589('0x40')](function(){return _0x19b02f[_0x0589('0x91')](_0x2072f8,{'transaction':_0x3c6712});})[_0x0589('0x40')](function(){return db['TeamVoicePrefix'][_0x0589('0x6b')]({'where':{'teamId':_0x49555c}})[_0x0589('0x40')](function(_0x3ecdee){if(_0x3ecdee){var _0x52d421=_[_0x0589('0x2c')](_0x2072f8,function(_0x955255){db[_0x0589('0x67')][_0x0589('0x51')]({'where':{'UserId':_0x955255,'VoicePrefixId':_0x3ecdee['VoicePrefixId']}});});return Promise['all'](_0x52d421);}});});});}})['then'](respondWithStatusCode(_0x389faa,null))[_0x0589('0x43')](handleError(_0x389faa,null));};exports[_0x0589('0x95')]=function(_0x293b21,_0x2271d8,_0x12af33){var _0x3cca4e={};var _0x4a55cd={};var _0x4e74c;var _0x139a71;return db[_0x0589('0x2d')]['findOne']({'where':{'id':_0x293b21['params']['id']}})[_0x0589('0x40')](handleEntityNotFound(_0x2271d8,null))[_0x0589('0x40')](function(_0x4c1d48){if(_0x4c1d48){_0x4e74c=_0x4c1d48;_0x4a55cd[_0x0589('0x2f')]=_[_0x0589('0x31')](db[_0x0589('0x82')]['rawAttributes']);_0x4a55cd[_0x0589('0x30')]=_[_0x0589('0x31')](_0x293b21[_0x0589('0x30')]);_0x4a55cd[_0x0589('0x32')]=_['intersection'](_0x4a55cd['model'],_0x4a55cd[_0x0589('0x30')]);_0x3cca4e['attributes']=_[_0x0589('0x33')](_0x4a55cd['model'],qs[_0x0589('0x35')](_0x293b21['query'][_0x0589('0x35')]));_0x3cca4e[_0x0589('0x34')]=_0x3cca4e['attributes'][_0x0589('0x36')]?_0x3cca4e[_0x0589('0x34')]:_0x4a55cd[_0x0589('0x2f')];_0x3cca4e[_0x0589('0x38')]=qs[_0x0589('0x39')](_0x293b21[_0x0589('0x30')][_0x0589('0x39')]);_0x3cca4e[_0x0589('0x3a')]=qs['filters'](_[_0x0589('0x3b')](_0x293b21[_0x0589('0x30')],_0x4a55cd[_0x0589('0x32')]));if(_0x293b21[_0x0589('0x30')]['filter']){_0x3cca4e[_0x0589('0x3a')]=_[_0x0589('0x3d')](_0x3cca4e[_0x0589('0x3a')],{'$or':_['map'](_0x3cca4e[_0x0589('0x34')],function(_0x1888c7){var _0x2d5648={};_0x2d5648[_0x1888c7]={'$like':'%'+_0x293b21[_0x0589('0x30')][_0x0589('0x3c')]+'%'};return _0x2d5648;})});}_0x3cca4e=_[_0x0589('0x3d')]({},_0x3cca4e,_0x293b21[_0x0589('0x3f')]);return _0x4e74c[_0x0589('0x95')](_0x3cca4e);}})[_0x0589('0x40')](function(_0x466ce2){if(_0x466ce2){_0x139a71=_0x466ce2[_0x0589('0x36')];if(!_0x293b21[_0x0589('0x30')][_0x0589('0x96')]('nolimit')){_0x3cca4e['limit']=qs['limit'](_0x293b21['query'][_0x0589('0x22')]);_0x3cca4e['offset']=qs['offset'](_0x293b21[_0x0589('0x30')][_0x0589('0x24')]);}return _0x4e74c[_0x0589('0x95')](_0x3cca4e);}})[_0x0589('0x40')](function(_0x45b973){if(_0x45b973){return _0x45b973?{'count':_0x139a71,'rows':_0x45b973}:null;}})[_0x0589('0x40')](respondWithResult(_0x2271d8,null))[_0x0589('0x43')](handleError(_0x2271d8,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 6e63bca..739f34a 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 _0x73f1=['Team','setMaxListeners','save','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x1dc5a4,_0x2e364a){var _0x4abd2a=function(_0x2aba4d){while(--_0x2aba4d){_0x1dc5a4['push'](_0x1dc5a4['shift']());}};_0x4abd2a(++_0x2e364a);}(_0x73f1,0x10c));var _0x173f=function(_0x437ab9,_0x3ee599){_0x437ab9=_0x437ab9-0x0;var _0x365d84=_0x73f1[_0x437ab9];return _0x365d84;};'use strict';var EventEmitter=require(_0x173f('0x0'));var Team=require(_0x173f('0x1'))['db'][_0x173f('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x173f('0x3')](0x0);var events={'afterCreate':_0x173f('0x4'),'afterUpdate':'update','afterDestroy':_0x173f('0x5')};function emitEvent(_0x4b0dae){return function(_0x3a0c10,_0x24e7c4,_0x5415ff){TeamEvents[_0x173f('0x6')](_0x4b0dae+':'+_0x3a0c10['id'],_0x3a0c10);TeamEvents[_0x173f('0x6')](_0x4b0dae,_0x3a0c10);_0x5415ff(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0x173f('0x7')](e,emitEvent(event));}}module[_0x173f('0x8')]=TeamEvents; \ No newline at end of file +var _0x4c25=['hasOwnProperty','hook','exports','events','../../mysqldb','save','update'];(function(_0x391f79,_0x514549){var _0x54a741=function(_0x584311){while(--_0x584311){_0x391f79['push'](_0x391f79['shift']());}};_0x54a741(++_0x514549);}(_0x4c25,0x1e6));var _0x54c2=function(_0x39010b,_0x17e844){_0x39010b=_0x39010b-0x0;var _0x3d8797=_0x4c25[_0x39010b];return _0x3d8797;};'use strict';var EventEmitter=require(_0x54c2('0x0'));var Team=require(_0x54c2('0x1'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x54c2('0x2'),'afterUpdate':_0x54c2('0x3'),'afterDestroy':'remove'};function emitEvent(_0x533fc8){return function(_0x46ec75,_0x5da02a,_0x178609){TeamEvents['emit'](_0x533fc8+':'+_0x46ec75['id'],_0x46ec75);TeamEvents['emit'](_0x533fc8,_0x46ec75);_0x178609(null);};}for(var e in events){if(events[_0x54c2('0x4')](e)){var event=events[e];Team[_0x54c2('0x5')](e,emitEvent(event));}}module[_0x54c2('0x6')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index be59969..6757452 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 _0xf95a=['rimraf','exports','Team','teams','lodash','util','../../config/logger','api','bluebird','path'];(function(_0x45385c,_0x840419){var _0x523eb1=function(_0x557e5c){while(--_0x557e5c){_0x45385c['push'](_0x45385c['shift']());}};_0x523eb1(++_0x840419);}(_0xf95a,0x1c6));var _0xaf95=function(_0x2ec291,_0x444d66){_0x2ec291=_0x2ec291-0x0;var _0x128a82=_0xf95a[_0x2ec291];return _0x128a82;};'use strict';var _=require(_0xaf95('0x0'));var util=require(_0xaf95('0x1'));var logger=require(_0xaf95('0x2'))(_0xaf95('0x3'));var moment=require('moment');var BPromise=require(_0xaf95('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaf95('0x5'));var rimraf=require(_0xaf95('0x6'));var config=require('../../config/environment');var attributes=require('./team.attributes');module[_0xaf95('0x7')]=function(_0x115f13,_0x4684a1){return _0x115f13['define'](_0xaf95('0x8'),attributes,{'tableName':_0xaf95('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8923=['moment','bluebird','request-promise','path','rimraf','./team.attributes','exports','define','teams','lodash','api'];(function(_0x3565ed,_0x320d9e){var _0x5ce8b9=function(_0x481120){while(--_0x481120){_0x3565ed['push'](_0x3565ed['shift']());}};_0x5ce8b9(++_0x320d9e);}(_0x8923,0x98));var _0x3892=function(_0x2a6f89,_0x303c02){_0x2a6f89=_0x2a6f89-0x0;var _0x198a39=_0x8923[_0x2a6f89];return _0x198a39;};'use strict';var _=require(_0x3892('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3892('0x1'));var moment=require(_0x3892('0x2'));var BPromise=require(_0x3892('0x3'));var rp=require(_0x3892('0x4'));var fs=require('fs');var path=require(_0x3892('0x5'));var rimraf=require(_0x3892('0x6'));var config=require('../../config/environment');var attributes=require(_0x3892('0x7'));module[_0x3892('0x8')]=function(_0x1b6e9b,_0x2ef0f3){return _0x1b6e9b[_0x3892('0x9')]('Team',attributes,{'tableName':_0x3892('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 4173042..44d1da1 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 _0x75cc=['rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./team.socket','register','request','then','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0xd16b08,_0x4f18ef){var _0x279475=function(_0x5dcfa2){while(--_0x5dcfa2){_0xd16b08['push'](_0xd16b08['shift']());}};_0x279475(++_0x4f18ef);}(_0x75cc,0x1ab));var _0xc75c=function(_0x4584cd,_0x42b19e){_0x4584cd=_0x4584cd-0x0;var _0x13e214=_0x75cc[_0x4584cd];return _0x13e214;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc75c('0x0'));var BPromise=require(_0xc75c('0x1'));var rs=require(_0xc75c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc75c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xc75c('0x4'))(_0xc75c('0x5'));var config=require(_0xc75c('0x6'));var jayson=require(_0xc75c('0x7'));var client=jayson[_0xc75c('0x8')][_0xc75c('0x9')]({'port':0x232a});config[_0xc75c('0xa')]=_['defaults'](config[_0xc75c('0xa')],{'host':_0xc75c('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc75c('0xa')]));require(_0xc75c('0xc'))[_0xc75c('0xd')](socket);function respondWithRpcPromise(_0x557680,_0x1d3859,_0x3c97e1){return new BPromise(function(_0xbd719c,_0x17943b){return client[_0xc75c('0xe')](_0x557680,_0x3c97e1)[_0xc75c('0xf')](function(_0x7dbad2){logger['info'](_0xc75c('0x10'),_0x1d3859,_0xc75c('0x11'));logger[_0xc75c('0x12')](_0xc75c('0x13'),_0x1d3859,_0xc75c('0x11'),JSON[_0xc75c('0x14')](_0x7dbad2));if(_0x7dbad2[_0xc75c('0x15')]){if(_0x7dbad2['error'][_0xc75c('0x16')]===0x1f4){logger[_0xc75c('0x15')](_0xc75c('0x10'),_0x1d3859,_0x7dbad2[_0xc75c('0x15')][_0xc75c('0x17')]);return _0x17943b(_0x7dbad2[_0xc75c('0x15')][_0xc75c('0x17')]);}logger[_0xc75c('0x15')](_0xc75c('0x10'),_0x1d3859,_0x7dbad2[_0xc75c('0x15')][_0xc75c('0x17')]);return _0xbd719c(_0x7dbad2[_0xc75c('0x15')][_0xc75c('0x17')]);}else{logger[_0xc75c('0x18')]('Team,\x20%s,\x20%s',_0x1d3859,'request\x20sent');_0xbd719c(_0x7dbad2[_0xc75c('0x19')][_0xc75c('0x17')]);}})[_0xc75c('0x1a')](function(_0x220fdd){logger[_0xc75c('0x15')](_0xc75c('0x10'),_0x1d3859,_0x220fdd);_0x17943b(_0x220fdd);});});} \ No newline at end of file +var _0x7abc=['error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./team.socket','request','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x129222,_0x5af437){var _0x52245f=function(_0x484889){while(--_0x484889){_0x129222['push'](_0x129222['shift']());}};_0x52245f(++_0x5af437);}(_0x7abc,0x112));var _0xc7ab=function(_0x5afdda,_0x422b72){_0x5afdda=_0x5afdda-0x0;var _0x4a7bd6=_0x7abc[_0x5afdda];return _0x4a7bd6;};'use strict';var _=require(_0xc7ab('0x0'));var util=require('util');var moment=require(_0xc7ab('0x1'));var BPromise=require(_0xc7ab('0x2'));var rs=require(_0xc7ab('0x3'));var fs=require('fs');var Redis=require(_0xc7ab('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc7ab('0x5'));var logger=require(_0xc7ab('0x6'))('rpc');var config=require(_0xc7ab('0x7'));var jayson=require(_0xc7ab('0x8'));var client=jayson[_0xc7ab('0x9')][_0xc7ab('0xa')]({'port':0x232a});config[_0xc7ab('0xb')]=_[_0xc7ab('0xc')](config[_0xc7ab('0xb')],{'host':_0xc7ab('0xd'),'port':0x18eb});var socket=require(_0xc7ab('0xe'))(new Redis(config['redis']));require(_0xc7ab('0xf'))['register'](socket);function respondWithRpcPromise(_0x301802,_0x456b25,_0x4c6077){return new BPromise(function(_0x566170,_0x9322b4){return client[_0xc7ab('0x10')](_0x301802,_0x4c6077)[_0xc7ab('0x11')](function(_0x192c99){logger[_0xc7ab('0x12')](_0xc7ab('0x13'),_0x456b25,_0xc7ab('0x14'));logger[_0xc7ab('0x15')]('Team,\x20%s,\x20%s,\x20%s',_0x456b25,_0xc7ab('0x14'),JSON[_0xc7ab('0x16')](_0x192c99));if(_0x192c99[_0xc7ab('0x17')]){if(_0x192c99[_0xc7ab('0x17')][_0xc7ab('0x18')]===0x1f4){logger[_0xc7ab('0x17')]('Team,\x20%s,\x20%s',_0x456b25,_0x192c99[_0xc7ab('0x17')][_0xc7ab('0x19')]);return _0x9322b4(_0x192c99[_0xc7ab('0x17')][_0xc7ab('0x19')]);}logger[_0xc7ab('0x17')](_0xc7ab('0x13'),_0x456b25,_0x192c99[_0xc7ab('0x17')]['message']);return _0x566170(_0x192c99[_0xc7ab('0x17')][_0xc7ab('0x19')]);}else{logger[_0xc7ab('0x12')](_0xc7ab('0x13'),_0x456b25,'request\x20sent');_0x566170(_0x192c99[_0xc7ab('0x1a')][_0xc7ab('0x19')]);}})['catch'](function(_0x20bf75){logger['error'](_0xc7ab('0x13'),_0x456b25,_0x20bf75);_0x9322b4(_0x20bf75);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index bea778b..29100fc 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 _0x4065=['update','emit','removeListener','length'];(function(_0x1344d6,_0x2181e6){var _0xf45b24=function(_0x2d90c1){while(--_0x2d90c1){_0x1344d6['push'](_0x1344d6['shift']());}};_0xf45b24(++_0x2181e6);}(_0x4065,0xdc));var _0x5406=function(_0x4d03f2,_0x3a7fae){_0x4d03f2=_0x4d03f2-0x0;var _0x229e46=_0x4065[_0x4d03f2];return _0x229e46;};'use strict';var TeamEvents=require('./team.events');var events=['save','remove',_0x5406('0x0')];function createListener(_0x582af0,_0x43096a){return function(_0x46186c){_0x43096a[_0x5406('0x1')](_0x582af0,_0x46186c);};}function removeListener(_0x5dde3e,_0xc5c0b5){return function(){TeamEvents[_0x5406('0x2')](_0x5dde3e,_0xc5c0b5);};}exports['register']=function(_0x1d2a1c){for(var _0x3bf3db=0x0,_0x2a6577=events[_0x5406('0x3')];_0x3bf3db<_0x2a6577;_0x3bf3db++){var _0x44f868=events[_0x3bf3db];var _0x3acd44=createListener('team:'+_0x44f868,_0x1d2a1c);TeamEvents['on'](_0x44f868,_0x3acd44);}}; \ No newline at end of file +var _0xa062=['emit','length','./team.events','save','remove'];(function(_0x4a391e,_0x216b12){var _0x1daf6d=function(_0x5123c6){while(--_0x5123c6){_0x4a391e['push'](_0x4a391e['shift']());}};_0x1daf6d(++_0x216b12);}(_0xa062,0x101));var _0x2a06=function(_0x56f0ee,_0xb898d){_0x56f0ee=_0x56f0ee-0x0;var _0xb8bddb=_0xa062[_0x56f0ee];return _0xb8bddb;};'use strict';var TeamEvents=require(_0x2a06('0x0'));var events=[_0x2a06('0x1'),_0x2a06('0x2'),'update'];function createListener(_0x291578,_0x13a5a6){return function(_0x3b8326){_0x13a5a6[_0x2a06('0x3')](_0x291578,_0x3b8326);};}function removeListener(_0x5e6e85,_0x313241){return function(){TeamEvents['removeListener'](_0x5e6e85,_0x313241);};}exports['register']=function(_0x1376ba){for(var _0x1ba42f=0x0,_0x3626b6=events[_0x2a06('0x4')];_0x1ba42f<_0x3626b6;_0x1ba42f++){var _0x49ad9b=events[_0x1ba42f];var _0x448892=createListener('team:'+_0x49ad9b,_0x1376ba);TeamEvents['on'](_0x49ad9b,_0x448892);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 7ef00fd..34efcab 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 _0xd1da=['sequelize','exports','INTEGER'];(function(_0x187470,_0x32f90b){var _0xe9c0dc=function(_0x265fbd){while(--_0x265fbd){_0x187470['push'](_0x187470['shift']());}};_0xe9c0dc(++_0x32f90b);}(_0xd1da,0x162));var _0xad1d=function(_0xa1e2fd,_0x1c9305){_0xa1e2fd=_0xa1e2fd-0x0;var _0x218880=_0xd1da[_0xa1e2fd];return _0x218880;};'use strict';var Sequelize=require(_0xad1d('0x0'));module[_0xad1d('0x1')]={'TeamId':{'type':Sequelize[_0xad1d('0x2')]},'VoicePrefixId':{'type':Sequelize[_0xad1d('0x2')]}}; \ No newline at end of file +var _0x22a4=['sequelize','exports','INTEGER'];(function(_0x3fc767,_0x2c4eda){var _0x5c3fb4=function(_0xbc00eb){while(--_0xbc00eb){_0x3fc767['push'](_0x3fc767['shift']());}};_0x5c3fb4(++_0x2c4eda);}(_0x22a4,0x1cb));var _0x422a=function(_0x5ddbe7,_0x4ccc26){_0x5ddbe7=_0x5ddbe7-0x0;var _0x4cb016=_0x22a4[_0x5ddbe7];return _0x4cb016;};'use strict';var Sequelize=require(_0x422a('0x0'));module[_0x422a('0x1')]={'TeamId':{'type':Sequelize[_0x422a('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x422a('0x2')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 92214a3..328f08b 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 _0x93e6=['api','bluebird','path','rimraf','../../config/environment','exports','lodash'];(function(_0x79abc4,_0x51afdd){var _0x2c8e64=function(_0x412edd){while(--_0x412edd){_0x79abc4['push'](_0x79abc4['shift']());}};_0x2c8e64(++_0x51afdd);}(_0x93e6,0x11e));var _0x693e=function(_0x3af619,_0x53662){_0x3af619=_0x3af619-0x0;var _0x5d3375=_0x93e6[_0x3af619];return _0x5d3375;};'use strict';var _=require(_0x693e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x693e('0x1'));var moment=require('moment');var BPromise=require(_0x693e('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x693e('0x3'));var rimraf=require(_0x693e('0x4'));var config=require(_0x693e('0x5'));var attributes=require('./teamVoicePrefix.attributes');module[_0x693e('0x6')]=function(_0x388eb6,_0x2569a4){return _0x388eb6['define']('TeamVoicePrefix',attributes,{'tableName':'team_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaa2d=['../../config/environment','./teamVoicePrefix.attributes','exports','define','team_has_voice_prefixes','util','bluebird','request-promise','path'];(function(_0x4c318,_0x33843f){var _0x4f28c7=function(_0x189887){while(--_0x189887){_0x4c318['push'](_0x4c318['shift']());}};_0x4f28c7(++_0x33843f);}(_0xaa2d,0x11c));var _0xdaa2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaa2d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xdaa2('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xdaa2('0x1'));var rp=require(_0xdaa2('0x2'));var fs=require('fs');var path=require(_0xdaa2('0x3'));var rimraf=require('rimraf');var config=require(_0xdaa2('0x4'));var attributes=require(_0xdaa2('0x5'));module[_0xdaa2('0x6')]=function(_0x552169,_0x553363){return _0x552169[_0xdaa2('0x7')]('TeamVoicePrefix',attributes,{'tableName':_0xdaa2('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 72f5bab..b3f61ba 100644 --- a/server/api/teamVoiceQueue/index.js +++ b/server/api/teamVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x458eef,_0x551783){var _0x2fb384=function(_0x28465e){while(--_0x28465e){_0x458eef['push'](_0x458eef['shift']());}};_0x2fb384(++_0x551783);}(_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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x4969d0,_0x4a5788){var _0x754944=function(_0x20f719){while(--_0x20f719){_0x4969d0['push'](_0x4969d0['shift']());}};_0x754944(++_0x4a5788);}(_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/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index ab5d434..9006424 100644 --- a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js +++ b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1229=['exports','INTEGER'];(function(_0x1a4861,_0x510d80){var _0x55c004=function(_0x5c8dd0){while(--_0x5c8dd0){_0x1a4861['push'](_0x1a4861['shift']());}};_0x55c004(++_0x510d80);}(_0x1229,0xac));var _0x9122=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x1229[_0x8c43de];return _0xa6591b;};'use strict';var Sequelize=require('sequelize');module[_0x9122('0x0')]={'penalty':{'type':Sequelize[_0x9122('0x1')],'defaultValue':0x0}}; \ No newline at end of file +'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index 2333c1c..32de25c 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 _0xc5ba=['./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue','team_has_voice_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5bc3b5,_0x486e69){var _0x15eac7=function(_0x48cf03){while(--_0x48cf03){_0x5bc3b5['push'](_0x5bc3b5['shift']());}};_0x15eac7(++_0x486e69);}(_0xc5ba,0xb9));var _0xac5b=function(_0xcf5436,_0x4632c3){_0xcf5436=_0xcf5436-0x0;var _0xc4f5c8=_0xc5ba[_0xcf5436];return _0xc4f5c8;};'use strict';var _=require(_0xac5b('0x0'));var util=require(_0xac5b('0x1'));var logger=require(_0xac5b('0x2'))(_0xac5b('0x3'));var moment=require(_0xac5b('0x4'));var BPromise=require(_0xac5b('0x5'));var rp=require(_0xac5b('0x6'));var fs=require('fs');var path=require(_0xac5b('0x7'));var rimraf=require(_0xac5b('0x8'));var config=require(_0xac5b('0x9'));var attributes=require(_0xac5b('0xa'));module[_0xac5b('0xb')]=function(_0x23cf2f,_0x17fcf3){return _0x23cf2f[_0xac5b('0xc')](_0xac5b('0xd'),attributes,{'tableName':_0xac5b('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x67a2=['define','team_has_voice_queues','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5571be,_0x2a1edd){var _0x351957=function(_0x25f86f){while(--_0x25f86f){_0x5571be['push'](_0x5571be['shift']());}};_0x351957(++_0x2a1edd);}(_0x67a2,0xd3));var _0x267a=function(_0x46ed8d,_0x3455ed){_0x46ed8d=_0x46ed8d-0x0;var _0x8860e3=_0x67a2[_0x46ed8d];return _0x8860e3;};'use strict';var _=require(_0x267a('0x0'));var util=require(_0x267a('0x1'));var logger=require('../../config/logger')(_0x267a('0x2'));var moment=require(_0x267a('0x3'));var BPromise=require(_0x267a('0x4'));var rp=require(_0x267a('0x5'));var fs=require('fs');var path=require(_0x267a('0x6'));var rimraf=require(_0x267a('0x7'));var config=require(_0x267a('0x8'));var attributes=require('./teamVoiceQueue.attributes');module['exports']=function(_0x17090d,_0x3539d5){return _0x17090d[_0x267a('0x9')]('TeamVoiceQueue',attributes,{'tableName':_0x267a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js index 1e76ef6..061b9d7 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 _0xb93f=['catch','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','then','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result'];(function(_0x1d89d0,_0x3f82f2){var _0x559209=function(_0x5ec2f7){while(--_0x5ec2f7){_0x1d89d0['push'](_0x1d89d0['shift']());}};_0x559209(++_0x3f82f2);}(_0xb93f,0x67));var _0xfb93=function(_0x39bc44,_0x1d4373){_0x39bc44=_0x39bc44-0x0;var _0x2916d8=_0xb93f[_0x39bc44];return _0x2916d8;};'use strict';var _=require(_0xfb93('0x0'));var util=require(_0xfb93('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfb93('0x2'));var db=require(_0xfb93('0x3'))['db'];var utils=require(_0xfb93('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xfb93('0x5'));var jayson=require(_0xfb93('0x6'));var client=jayson['client'][_0xfb93('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5118b2,_0x3602d5,_0xd06816){return new BPromise(function(_0x3c23dc,_0x31d7e4){return client['request'](_0x5118b2,_0xd06816)[_0xfb93('0x8')](function(_0x220a4d){logger['info'](_0xfb93('0x9'),_0x3602d5,_0xfb93('0xa'));logger[_0xfb93('0xb')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x3602d5,_0xfb93('0xa'),JSON[_0xfb93('0xc')](_0x220a4d));if(_0x220a4d[_0xfb93('0xd')]){if(_0x220a4d[_0xfb93('0xd')]['code']===0x1f4){logger[_0xfb93('0xd')](_0xfb93('0x9'),_0x3602d5,_0x220a4d[_0xfb93('0xd')][_0xfb93('0xe')]);return _0x31d7e4(_0x220a4d[_0xfb93('0xd')][_0xfb93('0xe')]);}logger[_0xfb93('0xd')]('TeamVoiceQueue,\x20%s,\x20%s',_0x3602d5,_0x220a4d['error']['message']);return _0x3c23dc(_0x220a4d[_0xfb93('0xd')][_0xfb93('0xe')]);}else{logger['info'](_0xfb93('0x9'),_0x3602d5,'request\x20sent');_0x3c23dc(_0x220a4d[_0xfb93('0xf')][_0xfb93('0xe')]);}})[_0xfb93('0x10')](function(_0x4b28a7){logger['error'](_0xfb93('0x9'),_0x3602d5,_0x4b28a7);_0x31d7e4(_0x4b28a7);});});} \ No newline at end of file +var _0x59e5=['../../config/environment','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','debug','request\x20sent','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc'];(function(_0x17723c,_0x1ea81d){var _0x1ffbf3=function(_0x5276cd){while(--_0x5276cd){_0x17723c['push'](_0x17723c['shift']());}};_0x1ffbf3(++_0x1ea81d);}(_0x59e5,0x14d));var _0x559e=function(_0x55e2b2,_0x44fbb5){_0x55e2b2=_0x55e2b2-0x0;var _0x1612be=_0x59e5[_0x55e2b2];return _0x1612be;};'use strict';var _=require(_0x559e('0x0'));var util=require(_0x559e('0x1'));var moment=require(_0x559e('0x2'));var BPromise=require(_0x559e('0x3'));var rs=require(_0x559e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x559e('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x559e('0x6'));var config=require(_0x559e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x559e('0x8')][_0x559e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x391862,_0x24d95d,_0x43dbe8){return new BPromise(function(_0x2cda48,_0x4aa091){return client[_0x559e('0xa')](_0x391862,_0x43dbe8)[_0x559e('0xb')](function(_0x32326a){logger[_0x559e('0xc')](_0x559e('0xd'),_0x24d95d,'request\x20sent');logger[_0x559e('0xe')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x24d95d,_0x559e('0xf'),JSON['stringify'](_0x32326a));if(_0x32326a[_0x559e('0x10')]){if(_0x32326a['error']['code']===0x1f4){logger[_0x559e('0x10')](_0x559e('0xd'),_0x24d95d,_0x32326a[_0x559e('0x10')][_0x559e('0x11')]);return _0x4aa091(_0x32326a[_0x559e('0x10')][_0x559e('0x11')]);}logger[_0x559e('0x10')]('TeamVoiceQueue,\x20%s,\x20%s',_0x24d95d,_0x32326a[_0x559e('0x10')][_0x559e('0x11')]);return _0x2cda48(_0x32326a[_0x559e('0x10')][_0x559e('0x11')]);}else{logger[_0x559e('0xc')]('TeamVoiceQueue,\x20%s,\x20%s',_0x24d95d,_0x559e('0xf'));_0x2cda48(_0x32326a[_0x559e('0x12')][_0x559e('0x11')]);}})[_0x559e('0x13')](function(_0x2aa2bb){logger[_0x559e('0x10')]('TeamVoiceQueue,\x20%s,\x20%s',_0x24d95d,_0x2aa2bb);_0x4aa091(_0x2aa2bb);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 52b3bc6..a889e00 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 _0xf4ce=['create','update','delete','exports','multer','connect-timeout','express','Router','fs-extra','isAuthenticated','index','get','/:id','show'];(function(_0x4f82e0,_0x555487){var _0x3b8c7e=function(_0x1653bb){while(--_0x1653bb){_0x4f82e0['push'](_0x4f82e0['shift']());}};_0x3b8c7e(++_0x555487);}(_0xf4ce,0xf2));var _0xef4c=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xf4ce[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0xef4c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xef4c('0x1'));var express=require(_0xef4c('0x2'));var router=express[_0xef4c('0x3')]();var fs_extra=require(_0xef4c('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./template.controller');router['get']('/',auth[_0xef4c('0x5')](),controller[_0xef4c('0x6')]);router[_0xef4c('0x7')](_0xef4c('0x8'),auth[_0xef4c('0x5')](),controller[_0xef4c('0x9')]);router['post']('/',auth[_0xef4c('0x5')](),controller[_0xef4c('0xa')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xef4c('0xb')]);router[_0xef4c('0xc')](_0xef4c('0x8'),auth[_0xef4c('0x5')](),controller['destroy']);module[_0xef4c('0xd')]=router; \ No newline at end of file +var _0xbb61=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./template.controller','get','isAuthenticated','/:id','post','create','put','delete','destroy','multer'];(function(_0x18ec88,_0x3fb94f){var _0x50c2c2=function(_0x133614){while(--_0x133614){_0x18ec88['push'](_0x18ec88['shift']());}};_0x50c2c2(++_0x3fb94f);}(_0xbb61,0x131));var _0x1bb6=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xbb61[_0x465a0c];return _0x1e202e;};'use strict';var multer=require(_0x1bb6('0x0'));var util=require('util');var path=require(_0x1bb6('0x1'));var timeout=require(_0x1bb6('0x2'));var express=require(_0x1bb6('0x3'));var router=express[_0x1bb6('0x4')]();var fs_extra=require(_0x1bb6('0x5'));var auth=require(_0x1bb6('0x6'));var interaction=require(_0x1bb6('0x7'));var config=require('../../config/environment');var controller=require(_0x1bb6('0x8'));router[_0x1bb6('0x9')]('/',auth[_0x1bb6('0xa')](),controller['index']);router[_0x1bb6('0x9')](_0x1bb6('0xb'),auth[_0x1bb6('0xa')](),controller['show']);router[_0x1bb6('0xc')]('/',auth[_0x1bb6('0xa')](),controller[_0x1bb6('0xd')]);router[_0x1bb6('0xe')](_0x1bb6('0xb'),auth[_0x1bb6('0xa')](),controller['update']);router[_0x1bb6('0xf')](_0x1bb6('0xb'),auth['isAuthenticated'](),controller[_0x1bb6('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 83506db..fb45ec5 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 _0xb56e=['TEXT','sequelize','exports'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0xb56e,0x16c));var _0xeb56=function(_0xa4b77a,_0x657ffa){_0xa4b77a=_0xa4b77a-0x0;var _0x1fa39e=_0xb56e[_0xa4b77a];return _0x1fa39e;};'use strict';var Sequelize=require(_0xeb56('0x0'));module[_0xeb56('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0xeb56('0x2')]}}; \ No newline at end of file +var _0xd506=['TEXT','sequelize','exports','STRING'];(function(_0x8f7cdb,_0x24ad77){var _0x2a1fdb=function(_0x37561c){while(--_0x37561c){_0x8f7cdb['push'](_0x8f7cdb['shift']());}};_0x2a1fdb(++_0x24ad77);}(_0xd506,0x175));var _0x6d50=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0xd506[_0x278e3c];return _0x3e2d9b;};'use strict';var Sequelize=require(_0x6d50('0x0'));module[_0x6d50('0x1')]={'name':{'type':Sequelize[_0x6d50('0x2')]},'description':{'type':Sequelize[_0x6d50('0x2')]},'html':{'type':Sequelize[_0x6d50('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index b8913c5..3e05d3a 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 _0x9289=['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','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/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','save','update','then','destroy','get','Templates','error','stack','name','send','index','map','Template','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','findAll','rows','catch','show','params','options','find'];(function(_0x38023e,_0x473a72){var _0x475351=function(_0x900c7f){while(--_0x900c7f){_0x38023e['push'](_0x38023e['shift']());}};_0x475351(++_0x473a72);}(_0x9289,0xb9));var _0x9928=function(_0x2220e8,_0xda4f58){_0x2220e8=_0x2220e8-0x0;var _0x237bee=_0x9289[_0x2220e8];return _0x237bee;};'use strict';var emlformat=require(_0x9928('0x0'));var rimraf=require(_0x9928('0x1'));var zipdir=require(_0x9928('0x2'));var jsonpatch=require(_0x9928('0x3'));var rp=require('request-promise');var moment=require(_0x9928('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9928('0x5'));var path=require(_0x9928('0x6'));var sox=require(_0x9928('0x7'));var csv=require(_0x9928('0x8'));var ejs=require(_0x9928('0x9'));var fs=require('fs');var fs_extra=require(_0x9928('0xa'));var _=require(_0x9928('0xb'));var squel=require(_0x9928('0xc'));var crypto=require(_0x9928('0xd'));var jsforce=require(_0x9928('0xe'));var deskjs=require(_0x9928('0xf'));var toCsv=require('to-csv');var querystring=require(_0x9928('0x10'));var Papa=require(_0x9928('0x11'));var Redis=require(_0x9928('0x12'));var authService=require(_0x9928('0x13'));var qs=require(_0x9928('0x14'));var as=require(_0x9928('0x15'));var hardwareService=require(_0x9928('0x16'));var logger=require(_0x9928('0x17'))(_0x9928('0x18'));var utils=require('../../config/utils');var config=require(_0x9928('0x19'));var licenseUtil=require(_0x9928('0x1a'));var db=require(_0x9928('0x1b'))['db'];function respondWithStatusCode(_0x31b6cf,_0x309814){_0x309814=_0x309814||0xcc;return function(_0x1c8f4d){if(_0x1c8f4d){return _0x31b6cf[_0x9928('0x1c')](_0x309814);}return _0x31b6cf['status'](_0x309814)[_0x9928('0x1d')]();};}function respondWithResult(_0x5c01f3,_0x2ffb3b){_0x2ffb3b=_0x2ffb3b||0xc8;return function(_0x2a1906){if(_0x2a1906){return _0x5c01f3[_0x9928('0x1e')](_0x2ffb3b)[_0x9928('0x1f')](_0x2a1906);}};}function respondWithFilteredResult(_0x26cff0,_0x1081c9){return function(_0x5ba07f){if(_0x5ba07f){var _0x9c91c7=typeof _0x1081c9['offset']===_0x9928('0x20')&&typeof _0x1081c9[_0x9928('0x21')]==='undefined';var _0x196711=_0x5ba07f[_0x9928('0x22')];var _0x5157e1=_0x9c91c7?0x0:_0x1081c9[_0x9928('0x23')];var _0x5c0e6f=_0x9c91c7?_0x5ba07f[_0x9928('0x22')]:_0x1081c9['offset']+_0x1081c9['limit'];var _0x49df59;if(_0x5c0e6f>=_0x196711){_0x5c0e6f=_0x196711;_0x49df59=0xc8;}else{_0x49df59=0xce;}_0x26cff0[_0x9928('0x1e')](_0x49df59);return _0x26cff0[_0x9928('0x24')](_0x9928('0x25'),_0x5157e1+'-'+_0x5c0e6f+'/'+_0x196711)[_0x9928('0x1f')](_0x5ba07f);}return null;};}function patchUpdates(_0xc4f68b){return function(_0x4f1ac9){try{jsonpatch['apply'](_0x4f1ac9,_0xc4f68b,!![]);}catch(_0x4502f3){return BPromise['reject'](_0x4502f3);}return _0x4f1ac9[_0x9928('0x26')]();};}function saveUpdates(_0x6ec6e,_0x3db825){return function(_0x3acb53){if(_0x3acb53){return _0x3acb53[_0x9928('0x27')](_0x6ec6e)[_0x9928('0x28')](function(_0x1419bb){return _0x1419bb;});}return null;};}function removeEntity(_0x10c4f8,_0x4691cb){return function(_0xc9b9d){if(_0xc9b9d){return _0xc9b9d[_0x9928('0x29')]()[_0x9928('0x28')](function(){var _0x3f3cab=_0xc9b9d[_0x9928('0x2a')]({'plain':!![]});var _0x5f8c96=_0x9928('0x2b');return db['UserProfileResource'][_0x9928('0x29')]({'where':{'type':_0x5f8c96,'resourceId':_0x3f3cab['id']}})['then'](function(){return _0xc9b9d;});})['then'](function(){_0x10c4f8[_0x9928('0x1e')](0xcc)[_0x9928('0x1d')]();});}};}function handleEntityNotFound(_0x2886f0,_0x43b220){return function(_0x79a52f){if(!_0x79a52f){_0x2886f0[_0x9928('0x1c')](0x194);}return _0x79a52f;};}function handleError(_0x15d123,_0x44084c){_0x44084c=_0x44084c||0x1f4;return function(_0x5dd560){logger[_0x9928('0x2c')](_0x5dd560[_0x9928('0x2d')]);if(_0x5dd560[_0x9928('0x2e')]){delete _0x5dd560[_0x9928('0x2e')];}_0x15d123[_0x9928('0x1e')](_0x44084c)[_0x9928('0x2f')](_0x5dd560);};}exports[_0x9928('0x30')]=function(_0x904c0d,_0x3d4a9a){var _0x38bf5b={},_0x25f761={},_0x10f056={'count':0x0,'rows':[]};var _0x30374b=_[_0x9928('0x31')](db[_0x9928('0x32')][_0x9928('0x33')],function(_0x30c86b){return{'name':_0x30c86b[_0x9928('0x34')],'type':_0x30c86b['type'][_0x9928('0x35')]};});_0x25f761[_0x9928('0x36')]=_[_0x9928('0x31')](_0x30374b,'name');_0x25f761[_0x9928('0x37')]=_[_0x9928('0x38')](_0x904c0d['query']);_0x25f761[_0x9928('0x39')]=_['intersection'](_0x25f761[_0x9928('0x36')],_0x25f761[_0x9928('0x37')]);_0x38bf5b[_0x9928('0x3a')]=_[_0x9928('0x3b')](_0x25f761[_0x9928('0x36')],qs[_0x9928('0x3c')](_0x904c0d[_0x9928('0x37')][_0x9928('0x3c')]));_0x38bf5b[_0x9928('0x3a')]=_0x38bf5b[_0x9928('0x3a')][_0x9928('0x3d')]?_0x38bf5b['attributes']:_0x25f761[_0x9928('0x36')];if(!_0x904c0d[_0x9928('0x37')][_0x9928('0x3e')](_0x9928('0x3f'))){_0x38bf5b[_0x9928('0x21')]=qs[_0x9928('0x21')](_0x904c0d[_0x9928('0x37')][_0x9928('0x21')]);_0x38bf5b[_0x9928('0x23')]=qs[_0x9928('0x23')](_0x904c0d[_0x9928('0x37')][_0x9928('0x23')]);}_0x38bf5b[_0x9928('0x40')]=qs[_0x9928('0x41')](_0x904c0d[_0x9928('0x37')][_0x9928('0x41')]);_0x38bf5b[_0x9928('0x42')]=qs[_0x9928('0x39')](_[_0x9928('0x43')](_0x904c0d['query'],_0x25f761[_0x9928('0x39')]),_0x30374b);if(_0x904c0d[_0x9928('0x37')][_0x9928('0x44')]){_0x38bf5b[_0x9928('0x42')]=_[_0x9928('0x45')](_0x38bf5b[_0x9928('0x42')],{'$or':_[_0x9928('0x31')](_0x30374b,function(_0x4c1215){if(_0x4c1215[_0x9928('0x46')]!==_0x9928('0x47')){var _0x26bb1f={};_0x26bb1f[_0x4c1215[_0x9928('0x2e')]]={'$like':'%'+_0x904c0d[_0x9928('0x37')][_0x9928('0x44')]+'%'};return _0x26bb1f;}})});}_0x38bf5b=_[_0x9928('0x45')]({},_0x38bf5b,_0x904c0d['options']);var _0x4c6d12={'where':_0x38bf5b[_0x9928('0x42')]};return db[_0x9928('0x32')][_0x9928('0x22')](_0x4c6d12)[_0x9928('0x28')](function(_0x530db1){_0x10f056[_0x9928('0x22')]=_0x530db1;if(_0x904c0d[_0x9928('0x37')]['includeAll']){_0x38bf5b['include']=[{'all':!![]}];}return db[_0x9928('0x32')][_0x9928('0x48')](_0x38bf5b);})[_0x9928('0x28')](function(_0x271f95){_0x10f056[_0x9928('0x49')]=_0x271f95;return _0x10f056;})[_0x9928('0x28')](respondWithFilteredResult(_0x3d4a9a,_0x38bf5b))[_0x9928('0x4a')](handleError(_0x3d4a9a,null));};exports[_0x9928('0x4b')]=function(_0x446361,_0xeb535a){var _0x3c42eb={'raw':!![],'where':{'id':_0x446361[_0x9928('0x4c')]['id']}},_0x5bbd45={};_0x5bbd45[_0x9928('0x36')]=_[_0x9928('0x38')](db['Template'][_0x9928('0x33')]);_0x5bbd45[_0x9928('0x37')]=_[_0x9928('0x38')](_0x446361['query']);_0x5bbd45['filters']=_[_0x9928('0x3b')](_0x5bbd45['model'],_0x5bbd45[_0x9928('0x37')]);_0x3c42eb[_0x9928('0x3a')]=_['intersection'](_0x5bbd45[_0x9928('0x36')],qs[_0x9928('0x3c')](_0x446361['query'][_0x9928('0x3c')]));_0x3c42eb[_0x9928('0x3a')]=_0x3c42eb['attributes']['length']?_0x3c42eb[_0x9928('0x3a')]:_0x5bbd45[_0x9928('0x36')];if(_0x446361[_0x9928('0x37')]['includeAll']){_0x3c42eb['include']=[{'all':!![]}];}_0x3c42eb=_['merge']({},_0x3c42eb,_0x446361[_0x9928('0x4d')]);return db[_0x9928('0x32')][_0x9928('0x4e')](_0x3c42eb)['then'](handleEntityNotFound(_0xeb535a,null))[_0x9928('0x28')](respondWithResult(_0xeb535a,null))[_0x9928('0x4a')](handleError(_0xeb535a,null));};exports[_0x9928('0x4f')]=function(_0x49a0b5,_0x26755a){return db[_0x9928('0x32')][_0x9928('0x4f')](_0x49a0b5['body'],{})[_0x9928('0x28')](function(_0x361064){var _0x3aa427=_0x49a0b5[_0x9928('0x50')][_0x9928('0x2a')]({'plain':!![]});if(!_0x3aa427)throw new Error(_0x9928('0x51'));if(_0x3aa427[_0x9928('0x52')]===_0x9928('0x50')){var _0xd7e44f=_0x361064[_0x9928('0x2a')]({'plain':!![]});var _0x128eac=_0x9928('0x2b');return db[_0x9928('0x53')][_0x9928('0x4e')]({'where':{'name':_0x128eac,'userProfileId':_0x3aa427[_0x9928('0x54')]},'raw':!![]})[_0x9928('0x28')](function(_0xc04008){if(_0xc04008&&_0xc04008[_0x9928('0x55')]===0x0){return db['UserProfileResource']['create']({'name':_0xd7e44f[_0x9928('0x2e')],'resourceId':_0xd7e44f['id'],'type':_0xc04008[_0x9928('0x2e')],'sectionId':_0xc04008['id']},{})[_0x9928('0x28')](function(){return _0x361064;});}else{return _0x361064;}})[_0x9928('0x4a')](function(_0xd9b6de){logger[_0x9928('0x2c')](_0x9928('0x56'),_0xd9b6de);throw _0xd9b6de;});}return _0x361064;})[_0x9928('0x28')](respondWithResult(_0x26755a,0xc9))[_0x9928('0x4a')](handleError(_0x26755a,null));};exports[_0x9928('0x27')]=function(_0x5eaec2,_0x3098f2){if(_0x5eaec2[_0x9928('0x57')]['id']){delete _0x5eaec2[_0x9928('0x57')]['id'];}return db[_0x9928('0x32')]['find']({'where':{'id':_0x5eaec2[_0x9928('0x4c')]['id']}})[_0x9928('0x28')](handleEntityNotFound(_0x3098f2,null))[_0x9928('0x28')](saveUpdates(_0x5eaec2[_0x9928('0x57')],null))[_0x9928('0x28')](respondWithResult(_0x3098f2,null))[_0x9928('0x4a')](handleError(_0x3098f2,null));};exports[_0x9928('0x29')]=function(_0x4f1ef2,_0x58ec5a){return db['Template']['find']({'where':{'id':_0x4f1ef2[_0x9928('0x4c')]['id']}})['then'](handleEntityNotFound(_0x58ec5a,null))[_0x9928('0x28')](removeEntity(_0x58ec5a,null))[_0x9928('0x4a')](handleError(_0x58ec5a,null));}; \ No newline at end of file +var _0x6c3b=['ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','reject','save','destroy','then','get','Templates','UserProfileResource','error','stack','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','Template','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','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse'];(function(_0x324fee,_0x20e93c){var _0x5dca87=function(_0x49f2cf){while(--_0x49f2cf){_0x324fee['push'](_0x324fee['shift']());}};_0x5dca87(++_0x20e93c);}(_0x6c3b,0x1dd));var _0xb6c3=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x6c3b[_0x28947d];return _0x12d2ee;};'use strict';var emlformat=require(_0xb6c3('0x0'));var rimraf=require(_0xb6c3('0x1'));var zipdir=require(_0xb6c3('0x2'));var jsonpatch=require(_0xb6c3('0x3'));var rp=require('request-promise');var moment=require(_0xb6c3('0x4'));var BPromise=require(_0xb6c3('0x5'));var Mustache=require('mustache');var util=require(_0xb6c3('0x6'));var path=require(_0xb6c3('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb6c3('0x8'));var squel=require(_0xb6c3('0x9'));var crypto=require(_0xb6c3('0xa'));var jsforce=require(_0xb6c3('0xb'));var deskjs=require(_0xb6c3('0xc'));var toCsv=require(_0xb6c3('0xd'));var querystring=require('querystring');var Papa=require(_0xb6c3('0xe'));var Redis=require(_0xb6c3('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xb6c3('0x10'));var as=require(_0xb6c3('0x11'));var hardwareService=require(_0xb6c3('0x12'));var logger=require(_0xb6c3('0x13'))(_0xb6c3('0x14'));var utils=require(_0xb6c3('0x15'));var config=require(_0xb6c3('0x16'));var licenseUtil=require(_0xb6c3('0x17'));var db=require(_0xb6c3('0x18'))['db'];function respondWithStatusCode(_0x2c7983,_0x4f81b5){_0x4f81b5=_0x4f81b5||0xcc;return function(_0xe42e14){if(_0xe42e14){return _0x2c7983[_0xb6c3('0x19')](_0x4f81b5);}return _0x2c7983[_0xb6c3('0x1a')](_0x4f81b5)[_0xb6c3('0x1b')]();};}function respondWithResult(_0x57edff,_0x525f2d){_0x525f2d=_0x525f2d||0xc8;return function(_0x3aea7e){if(_0x3aea7e){return _0x57edff[_0xb6c3('0x1a')](_0x525f2d)[_0xb6c3('0x1c')](_0x3aea7e);}};}function respondWithFilteredResult(_0x299c8d,_0x20be83){return function(_0x4a884b){if(_0x4a884b){var _0x29a581=typeof _0x20be83[_0xb6c3('0x1d')]==='undefined'&&typeof _0x20be83[_0xb6c3('0x1e')]===_0xb6c3('0x1f');var _0x477a1a=_0x4a884b[_0xb6c3('0x20')];var _0x9c6b9c=_0x29a581?0x0:_0x20be83['offset'];var _0x3b22b3=_0x29a581?_0x4a884b[_0xb6c3('0x20')]:_0x20be83[_0xb6c3('0x1d')]+_0x20be83['limit'];var _0x319dd5;if(_0x3b22b3>=_0x477a1a){_0x3b22b3=_0x477a1a;_0x319dd5=0xc8;}else{_0x319dd5=0xce;}_0x299c8d['status'](_0x319dd5);return _0x299c8d[_0xb6c3('0x21')]('Content-Range',_0x9c6b9c+'-'+_0x3b22b3+'/'+_0x477a1a)['json'](_0x4a884b);}return null;};}function patchUpdates(_0xa1cfc1){return function(_0x540a12){try{jsonpatch['apply'](_0x540a12,_0xa1cfc1,!![]);}catch(_0x23ea18){return BPromise[_0xb6c3('0x22')](_0x23ea18);}return _0x540a12[_0xb6c3('0x23')]();};}function saveUpdates(_0xb72bbf,_0x2ef75b){return function(_0x30d30d){if(_0x30d30d){return _0x30d30d['update'](_0xb72bbf)['then'](function(_0xbf0863){return _0xbf0863;});}return null;};}function removeEntity(_0x4cee45,_0x226088){return function(_0xf469c9){if(_0xf469c9){return _0xf469c9[_0xb6c3('0x24')]()[_0xb6c3('0x25')](function(){var _0xce3fec=_0xf469c9[_0xb6c3('0x26')]({'plain':!![]});var _0x2b3cf0=_0xb6c3('0x27');return db[_0xb6c3('0x28')][_0xb6c3('0x24')]({'where':{'type':_0x2b3cf0,'resourceId':_0xce3fec['id']}})[_0xb6c3('0x25')](function(){return _0xf469c9;});})[_0xb6c3('0x25')](function(){_0x4cee45['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x518fa5,_0x1fdf37){return function(_0x37a797){if(!_0x37a797){_0x518fa5[_0xb6c3('0x19')](0x194);}return _0x37a797;};}function handleError(_0x3e009b,_0x14a423){_0x14a423=_0x14a423||0x1f4;return function(_0x23e24d){logger[_0xb6c3('0x29')](_0x23e24d[_0xb6c3('0x2a')]);if(_0x23e24d[_0xb6c3('0x2b')]){delete _0x23e24d['name'];}_0x3e009b['status'](_0x14a423)['send'](_0x23e24d);};}exports['index']=function(_0x4d9aec,_0x22a583){var _0x6288fa={},_0x4e60cc={},_0x1f55be={'count':0x0,'rows':[]};var _0x4b3bcb=_[_0xb6c3('0x2c')](db['Template'][_0xb6c3('0x2d')],function(_0x307fc0){return{'name':_0x307fc0[_0xb6c3('0x2e')],'type':_0x307fc0[_0xb6c3('0x2f')][_0xb6c3('0x30')]};});_0x4e60cc[_0xb6c3('0x31')]=_[_0xb6c3('0x2c')](_0x4b3bcb,_0xb6c3('0x2b'));_0x4e60cc[_0xb6c3('0x32')]=_[_0xb6c3('0x33')](_0x4d9aec[_0xb6c3('0x32')]);_0x4e60cc[_0xb6c3('0x34')]=_['intersection'](_0x4e60cc[_0xb6c3('0x31')],_0x4e60cc['query']);_0x6288fa[_0xb6c3('0x35')]=_[_0xb6c3('0x36')](_0x4e60cc['model'],qs[_0xb6c3('0x37')](_0x4d9aec[_0xb6c3('0x32')][_0xb6c3('0x37')]));_0x6288fa[_0xb6c3('0x35')]=_0x6288fa['attributes']['length']?_0x6288fa[_0xb6c3('0x35')]:_0x4e60cc[_0xb6c3('0x31')];if(!_0x4d9aec['query'][_0xb6c3('0x38')](_0xb6c3('0x39'))){_0x6288fa[_0xb6c3('0x1e')]=qs[_0xb6c3('0x1e')](_0x4d9aec[_0xb6c3('0x32')][_0xb6c3('0x1e')]);_0x6288fa[_0xb6c3('0x1d')]=qs['offset'](_0x4d9aec[_0xb6c3('0x32')][_0xb6c3('0x1d')]);}_0x6288fa['order']=qs[_0xb6c3('0x3a')](_0x4d9aec['query']['sort']);_0x6288fa[_0xb6c3('0x3b')]=qs[_0xb6c3('0x34')](_[_0xb6c3('0x3c')](_0x4d9aec[_0xb6c3('0x32')],_0x4e60cc[_0xb6c3('0x34')]),_0x4b3bcb);if(_0x4d9aec['query'][_0xb6c3('0x3d')]){_0x6288fa[_0xb6c3('0x3b')]=_[_0xb6c3('0x3e')](_0x6288fa[_0xb6c3('0x3b')],{'$or':_['map'](_0x4b3bcb,function(_0x14c6c5){if(_0x14c6c5[_0xb6c3('0x2f')]!==_0xb6c3('0x3f')){var _0x523258={};_0x523258[_0x14c6c5[_0xb6c3('0x2b')]]={'$like':'%'+_0x4d9aec[_0xb6c3('0x32')]['filter']+'%'};return _0x523258;}})});}_0x6288fa=_[_0xb6c3('0x3e')]({},_0x6288fa,_0x4d9aec[_0xb6c3('0x40')]);var _0x40a482={'where':_0x6288fa[_0xb6c3('0x3b')]};return db[_0xb6c3('0x41')]['count'](_0x40a482)['then'](function(_0x40226e){_0x1f55be[_0xb6c3('0x20')]=_0x40226e;if(_0x4d9aec[_0xb6c3('0x32')][_0xb6c3('0x42')]){_0x6288fa[_0xb6c3('0x43')]=[{'all':!![]}];}return db[_0xb6c3('0x41')][_0xb6c3('0x44')](_0x6288fa);})[_0xb6c3('0x25')](function(_0x5a3924){_0x1f55be[_0xb6c3('0x45')]=_0x5a3924;return _0x1f55be;})[_0xb6c3('0x25')](respondWithFilteredResult(_0x22a583,_0x6288fa))[_0xb6c3('0x46')](handleError(_0x22a583,null));};exports[_0xb6c3('0x47')]=function(_0x193e98,_0x22ff5a){var _0xc55729={'raw':!![],'where':{'id':_0x193e98[_0xb6c3('0x48')]['id']}},_0x274298={};_0x274298[_0xb6c3('0x31')]=_[_0xb6c3('0x33')](db[_0xb6c3('0x41')][_0xb6c3('0x2d')]);_0x274298[_0xb6c3('0x32')]=_[_0xb6c3('0x33')](_0x193e98[_0xb6c3('0x32')]);_0x274298['filters']=_[_0xb6c3('0x36')](_0x274298[_0xb6c3('0x31')],_0x274298[_0xb6c3('0x32')]);_0xc55729[_0xb6c3('0x35')]=_['intersection'](_0x274298['model'],qs['fields'](_0x193e98[_0xb6c3('0x32')][_0xb6c3('0x37')]));_0xc55729[_0xb6c3('0x35')]=_0xc55729[_0xb6c3('0x35')]['length']?_0xc55729['attributes']:_0x274298['model'];if(_0x193e98['query'][_0xb6c3('0x42')]){_0xc55729['include']=[{'all':!![]}];}_0xc55729=_[_0xb6c3('0x3e')]({},_0xc55729,_0x193e98[_0xb6c3('0x40')]);return db[_0xb6c3('0x41')][_0xb6c3('0x49')](_0xc55729)[_0xb6c3('0x25')](handleEntityNotFound(_0x22ff5a,null))[_0xb6c3('0x25')](respondWithResult(_0x22ff5a,null))['catch'](handleError(_0x22ff5a,null));};exports[_0xb6c3('0x4a')]=function(_0x1c5044,_0x432e9b){return db['Template'][_0xb6c3('0x4a')](_0x1c5044[_0xb6c3('0x4b')],{})[_0xb6c3('0x25')](function(_0x422bbb){var _0x578daf=_0x1c5044[_0xb6c3('0x4c')][_0xb6c3('0x26')]({'plain':!![]});if(!_0x578daf)throw new Error(_0xb6c3('0x4d'));if(_0x578daf[_0xb6c3('0x4e')]==='user'){var _0x3659c6=_0x422bbb['get']({'plain':!![]});var _0x415967=_0xb6c3('0x27');return db[_0xb6c3('0x4f')][_0xb6c3('0x49')]({'where':{'name':_0x415967,'userProfileId':_0x578daf['userProfileId']},'raw':!![]})[_0xb6c3('0x25')](function(_0x248eb0){if(_0x248eb0&&_0x248eb0[_0xb6c3('0x50')]===0x0){return db[_0xb6c3('0x28')][_0xb6c3('0x4a')]({'name':_0x3659c6[_0xb6c3('0x2b')],'resourceId':_0x3659c6['id'],'type':_0x248eb0[_0xb6c3('0x2b')],'sectionId':_0x248eb0['id']},{})[_0xb6c3('0x25')](function(){return _0x422bbb;});}else{return _0x422bbb;}})[_0xb6c3('0x46')](function(_0x1cde84){logger[_0xb6c3('0x29')](_0xb6c3('0x51'),_0x1cde84);throw _0x1cde84;});}return _0x422bbb;})[_0xb6c3('0x25')](respondWithResult(_0x432e9b,0xc9))[_0xb6c3('0x46')](handleError(_0x432e9b,null));};exports['update']=function(_0x594f1c,_0x5a84fe){if(_0x594f1c[_0xb6c3('0x4b')]['id']){delete _0x594f1c[_0xb6c3('0x4b')]['id'];}return db[_0xb6c3('0x41')][_0xb6c3('0x49')]({'where':{'id':_0x594f1c['params']['id']}})[_0xb6c3('0x25')](handleEntityNotFound(_0x5a84fe,null))['then'](saveUpdates(_0x594f1c[_0xb6c3('0x4b')],null))['then'](respondWithResult(_0x5a84fe,null))['catch'](handleError(_0x5a84fe,null));};exports[_0xb6c3('0x24')]=function(_0x4efed2,_0x5a825e){return db['Template'][_0xb6c3('0x49')]({'where':{'id':_0x4efed2[_0xb6c3('0x48')]['id']}})[_0xb6c3('0x25')](handleEntityNotFound(_0x5a825e,null))['then'](removeEntity(_0x5a825e,null))[_0xb6c3('0x46')](handleError(_0x5a825e,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 294143f..260dcca 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 _0x1ab6=['define','Template','tools_templates','util','api','moment','request-promise','./template.attributes'];(function(_0x59c6ec,_0xeb6ac2){var _0x4d49d6=function(_0x1521d6){while(--_0x1521d6){_0x59c6ec['push'](_0x59c6ec['shift']());}};_0x4d49d6(++_0xeb6ac2);}(_0x1ab6,0xa3));var _0x61ab=function(_0x2b7515,_0x15c51c){_0x2b7515=_0x2b7515-0x0;var _0x430a6d=_0x1ab6[_0x2b7515];return _0x430a6d;};'use strict';var _=require('lodash');var util=require(_0x61ab('0x0'));var logger=require('../../config/logger')(_0x61ab('0x1'));var moment=require(_0x61ab('0x2'));var BPromise=require('bluebird');var rp=require(_0x61ab('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x61ab('0x4'));module['exports']=function(_0x54f2f0,_0x374b87){return _0x54f2f0[_0x61ab('0x5')](_0x61ab('0x6'),attributes,{'tableName':_0x61ab('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a00=['../../config/environment','./template.attributes','define','Template','tools_templates','lodash','api','moment','bluebird','request-promise','rimraf'];(function(_0x618644,_0x24242b){var _0x401623=function(_0x58dcce){while(--_0x58dcce){_0x618644['push'](_0x618644['shift']());}};_0x401623(++_0x24242b);}(_0x7a00,0x1b2));var _0x07a0=function(_0x2873e4,_0x509fad){_0x2873e4=_0x2873e4-0x0;var _0x12820b=_0x7a00[_0x2873e4];return _0x12820b;};'use strict';var _=require(_0x07a0('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x07a0('0x1'));var moment=require(_0x07a0('0x2'));var BPromise=require(_0x07a0('0x3'));var rp=require(_0x07a0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x07a0('0x5'));var config=require(_0x07a0('0x6'));var attributes=require(_0x07a0('0x7'));module['exports']=function(_0x5039f7,_0x5a3368){return _0x5039f7[_0x07a0('0x8')](_0x07a0('0x9'),attributes,{'tableName':_0x07a0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index 0d4f75b..606f1c4 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 _0x3e62=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','debug','Template,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Template,\x20%s,\x20%s','message','result','catch','findAll','options','raw','where','attributes','limit','map','include','model','GetTemplate','lodash','moment'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x3e62,0x17e));var _0x23e6=function(_0x5c7023,_0x485cc7){_0x5c7023=_0x5c7023-0x0;var _0x4e6201=_0x3e62[_0x5c7023];return _0x4e6201;};'use strict';var _=require(_0x23e6('0x0'));var util=require('util');var moment=require(_0x23e6('0x1'));var BPromise=require(_0x23e6('0x2'));var rs=require(_0x23e6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x23e6('0x4'))['db'];var utils=require(_0x23e6('0x5'));var logger=require(_0x23e6('0x6'))(_0x23e6('0x7'));var config=require(_0x23e6('0x8'));var jayson=require(_0x23e6('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5524a1,_0x1399d0,_0x415c6e){return new BPromise(function(_0x6f349f,_0x585b17){return client['request'](_0x5524a1,_0x415c6e)[_0x23e6('0xa')](function(_0x2e6945){logger[_0x23e6('0xb')]('Template,\x20%s,\x20%s',_0x1399d0,'request\x20sent');logger[_0x23e6('0xc')](_0x23e6('0xd'),_0x1399d0,_0x23e6('0xe'),JSON[_0x23e6('0xf')](_0x2e6945));if(_0x2e6945[_0x23e6('0x10')]){if(_0x2e6945[_0x23e6('0x10')][_0x23e6('0x11')]===0x1f4){logger[_0x23e6('0x10')](_0x23e6('0x12'),_0x1399d0,_0x2e6945[_0x23e6('0x10')][_0x23e6('0x13')]);return _0x585b17(_0x2e6945['error'][_0x23e6('0x13')]);}logger[_0x23e6('0x10')](_0x23e6('0x12'),_0x1399d0,_0x2e6945[_0x23e6('0x10')]['message']);return _0x6f349f(_0x2e6945['error'][_0x23e6('0x13')]);}else{logger[_0x23e6('0xb')](_0x23e6('0x12'),_0x1399d0,_0x23e6('0xe'));_0x6f349f(_0x2e6945[_0x23e6('0x14')][_0x23e6('0x13')]);}})[_0x23e6('0x15')](function(_0x5b4abe){logger['error'](_0x23e6('0x12'),_0x1399d0,_0x5b4abe);_0x585b17(_0x5b4abe);});});}exports['GetTemplate']=function(_0x263784){var _0x402ac2=this;return new Promise(function(_0x1eefae,_0x24ad88){return db['Template'][_0x23e6('0x16')]({'raw':_0x263784[_0x23e6('0x17')]?_0x263784['options'][_0x23e6('0x18')]===undefined?!![]:![]:!![],'where':_0x263784[_0x23e6('0x17')]?_0x263784[_0x23e6('0x17')][_0x23e6('0x19')]||null:null,'attributes':_0x263784[_0x23e6('0x17')]?_0x263784[_0x23e6('0x17')][_0x23e6('0x1a')]||null:null,'limit':_0x263784[_0x23e6('0x17')]?_0x263784[_0x23e6('0x17')][_0x23e6('0x1b')]||null:null,'include':_0x263784['options']?_0x263784[_0x23e6('0x17')]['include']?_[_0x23e6('0x1c')](_0x263784['options'][_0x23e6('0x1d')],function(_0x193770){return{'model':db[_0x193770[_0x23e6('0x1e')]],'as':_0x193770['as'],'attributes':_0x193770[_0x23e6('0x1a')],'include':_0x193770[_0x23e6('0x1d')]?_[_0x23e6('0x1c')](_0x193770[_0x23e6('0x1d')],function(_0xfb116d){return{'model':db[_0xfb116d[_0x23e6('0x1e')]],'as':_0xfb116d['as'],'attributes':_0xfb116d[_0x23e6('0x1a')],'include':_0xfb116d[_0x23e6('0x1d')]?_[_0x23e6('0x1c')](_0xfb116d[_0x23e6('0x1d')],function(_0xad8053){return{'model':db[_0xad8053[_0x23e6('0x1e')]],'as':_0xad8053['as'],'attributes':_0xad8053[_0x23e6('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x23e6('0xa')](function(_0x28bfd7){logger[_0x23e6('0xb')](_0x23e6('0x1f'),_0x263784);logger['debug']('GetTemplate',_0x263784,JSON[_0x23e6('0xf')](_0x28bfd7));_0x1eefae(_0x28bfd7);})['catch'](function(_0x55c176){logger[_0x23e6('0x10')](_0x23e6('0x1f'),_0x55c176[_0x23e6('0x13')],_0x263784);_0x24ad88(_0x402ac2['error'](0x1f4,_0x55c176['message']));});});}; \ No newline at end of file +var _0xb616=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','Template','findAll','raw','options','where','limit','map','include','model','attributes','then','GetTemplate','stringify','lodash','util','moment','randomstring'];(function(_0x3ad100,_0x5ecd3b){var _0x3f317f=function(_0x1c8656){while(--_0x1c8656){_0x3ad100['push'](_0x3ad100['shift']());}};_0x3f317f(++_0x5ecd3b);}(_0xb616,0x84));var _0x6b61=function(_0x4af370,_0x158cce){_0x4af370=_0x4af370-0x0;var _0x325f2e=_0xb616[_0x4af370];return _0x325f2e;};'use strict';var _=require(_0x6b61('0x0'));var util=require(_0x6b61('0x1'));var moment=require(_0x6b61('0x2'));var BPromise=require('bluebird');var rs=require(_0x6b61('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6b61('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6b61('0x5'))(_0x6b61('0x6'));var config=require(_0x6b61('0x7'));var jayson=require(_0x6b61('0x8'));var client=jayson[_0x6b61('0x9')][_0x6b61('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc63567,_0x3f74c2,_0x420b40){return new BPromise(function(_0x218ff0,_0x49806d){return client['request'](_0xc63567,_0x420b40)['then'](function(_0x1add82){logger[_0x6b61('0xb')](_0x6b61('0xc'),_0x3f74c2,_0x6b61('0xd'));logger[_0x6b61('0xe')](_0x6b61('0xf'),_0x3f74c2,_0x6b61('0xd'),JSON['stringify'](_0x1add82));if(_0x1add82[_0x6b61('0x10')]){if(_0x1add82[_0x6b61('0x10')][_0x6b61('0x11')]===0x1f4){logger['error'](_0x6b61('0xc'),_0x3f74c2,_0x1add82['error'][_0x6b61('0x12')]);return _0x49806d(_0x1add82[_0x6b61('0x10')][_0x6b61('0x12')]);}logger[_0x6b61('0x10')]('Template,\x20%s,\x20%s',_0x3f74c2,_0x1add82['error'][_0x6b61('0x12')]);return _0x218ff0(_0x1add82['error'][_0x6b61('0x12')]);}else{logger['info'](_0x6b61('0xc'),_0x3f74c2,_0x6b61('0xd'));_0x218ff0(_0x1add82[_0x6b61('0x13')][_0x6b61('0x12')]);}})[_0x6b61('0x14')](function(_0x436799){logger[_0x6b61('0x10')]('Template,\x20%s,\x20%s',_0x3f74c2,_0x436799);_0x49806d(_0x436799);});});}exports['GetTemplate']=function(_0x4fc2b2){var _0x415c87=this;return new Promise(function(_0x5024b0,_0x646715){return db[_0x6b61('0x15')][_0x6b61('0x16')]({'raw':_0x4fc2b2['options']?_0x4fc2b2['options'][_0x6b61('0x17')]===undefined?!![]:![]:!![],'where':_0x4fc2b2[_0x6b61('0x18')]?_0x4fc2b2['options'][_0x6b61('0x19')]||null:null,'attributes':_0x4fc2b2[_0x6b61('0x18')]?_0x4fc2b2[_0x6b61('0x18')]['attributes']||null:null,'limit':_0x4fc2b2[_0x6b61('0x18')]?_0x4fc2b2[_0x6b61('0x18')][_0x6b61('0x1a')]||null:null,'include':_0x4fc2b2['options']?_0x4fc2b2[_0x6b61('0x18')]['include']?_[_0x6b61('0x1b')](_0x4fc2b2[_0x6b61('0x18')][_0x6b61('0x1c')],function(_0x478975){return{'model':db[_0x478975[_0x6b61('0x1d')]],'as':_0x478975['as'],'attributes':_0x478975[_0x6b61('0x1e')],'include':_0x478975[_0x6b61('0x1c')]?_[_0x6b61('0x1b')](_0x478975[_0x6b61('0x1c')],function(_0x5f3d06){return{'model':db[_0x5f3d06[_0x6b61('0x1d')]],'as':_0x5f3d06['as'],'attributes':_0x5f3d06[_0x6b61('0x1e')],'include':_0x5f3d06[_0x6b61('0x1c')]?_[_0x6b61('0x1b')](_0x5f3d06[_0x6b61('0x1c')],function(_0x4273a3){return{'model':db[_0x4273a3[_0x6b61('0x1d')]],'as':_0x4273a3['as'],'attributes':_0x4273a3[_0x6b61('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x6b61('0x1f')](function(_0x38bcea){logger[_0x6b61('0xb')](_0x6b61('0x20'),_0x4fc2b2);logger['debug'](_0x6b61('0x20'),_0x4fc2b2,JSON[_0x6b61('0x21')](_0x38bcea));_0x5024b0(_0x38bcea);})[_0x6b61('0x14')](function(_0x5ab1ea){logger[_0x6b61('0x10')](_0x6b61('0x20'),_0x5ab1ea[_0x6b61('0x12')],_0x4fc2b2);_0x646715(_0x415c87[_0x6b61('0x10')](0x1f4,_0x5ab1ea[_0x6b61('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 69c89b4..d56666b 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 _0x8bd2=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','index','/:id','show','/:id/all_conditions','isAuthenticated','/:id/any_conditions','/:id/actions','getActions','post','addAllCondition','addAnyCondition','addAction','update','delete','destroy','exports','util'];(function(_0x4d3c17,_0x317c47){var _0xe81017=function(_0x498f4a){while(--_0x498f4a){_0x4d3c17['push'](_0x4d3c17['shift']());}};_0xe81017(++_0x317c47);}(_0x8bd2,0x1d3));var _0x28bd=function(_0x879e31,_0x139d02){_0x879e31=_0x879e31-0x0;var _0x3467e8=_0x8bd2[_0x879e31];return _0x3467e8;};'use strict';var multer=require('multer');var util=require(_0x28bd('0x0'));var path=require(_0x28bd('0x1'));var timeout=require(_0x28bd('0x2'));var express=require('express');var router=express[_0x28bd('0x3')]();var fs_extra=require(_0x28bd('0x4'));var auth=require(_0x28bd('0x5'));var interaction=require(_0x28bd('0x6'));var config=require(_0x28bd('0x7'));var controller=require(_0x28bd('0x8'));router[_0x28bd('0x9')]('/',auth['isAuthenticated'](),controller[_0x28bd('0xa')]);router[_0x28bd('0x9')](_0x28bd('0xb'),auth['isAuthenticated'](),controller[_0x28bd('0xc')]);router['get'](_0x28bd('0xd'),auth[_0x28bd('0xe')](),controller['getAllConditions']);router[_0x28bd('0x9')](_0x28bd('0xf'),auth[_0x28bd('0xe')](),controller['getAnyConditions']);router[_0x28bd('0x9')](_0x28bd('0x10'),auth[_0x28bd('0xe')](),controller[_0x28bd('0x11')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x28bd('0x12')](_0x28bd('0xd'),auth[_0x28bd('0xe')](),controller[_0x28bd('0x13')]);router[_0x28bd('0x12')](_0x28bd('0xf'),auth[_0x28bd('0xe')](),controller[_0x28bd('0x14')]);router['post'](_0x28bd('0x10'),auth[_0x28bd('0xe')](),controller[_0x28bd('0x15')]);router['put']('/:id',auth[_0x28bd('0xe')](),controller[_0x28bd('0x16')]);router[_0x28bd('0x17')](_0x28bd('0xb'),auth[_0x28bd('0xe')](),controller[_0x28bd('0x18')]);module[_0x28bd('0x19')]=router; \ No newline at end of file +var _0x64c2=['/:id/any_conditions','/:id/actions','create','post','/:id/all_conditions','addAllCondition','addAction','put','/:id','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','show','getAllConditions'];(function(_0x2f7f3d,_0x12a5f7){var _0x1ece8d=function(_0xabe16a){while(--_0xabe16a){_0x2f7f3d['push'](_0x2f7f3d['shift']());}};_0x1ece8d(++_0x12a5f7);}(_0x64c2,0x178));var _0x264c=function(_0x500be8,_0xae4c2c){_0x500be8=_0x500be8-0x0;var _0xa07997=_0x64c2[_0x500be8];return _0xa07997;};'use strict';var multer=require(_0x264c('0x0'));var util=require('util');var path=require(_0x264c('0x1'));var timeout=require(_0x264c('0x2'));var express=require(_0x264c('0x3'));var router=express[_0x264c('0x4')]();var fs_extra=require(_0x264c('0x5'));var auth=require(_0x264c('0x6'));var interaction=require(_0x264c('0x7'));var config=require(_0x264c('0x8'));var controller=require(_0x264c('0x9'));router[_0x264c('0xa')]('/',auth[_0x264c('0xb')](),controller['index']);router['get']('/:id',auth[_0x264c('0xb')](),controller[_0x264c('0xc')]);router[_0x264c('0xa')]('/:id/all_conditions',auth['isAuthenticated'](),controller[_0x264c('0xd')]);router['get'](_0x264c('0xe'),auth[_0x264c('0xb')](),controller['getAnyConditions']);router['get'](_0x264c('0xf'),auth['isAuthenticated'](),controller['getActions']);router['post']('/',auth[_0x264c('0xb')](),controller[_0x264c('0x10')]);router[_0x264c('0x11')](_0x264c('0x12'),auth['isAuthenticated'](),controller[_0x264c('0x13')]);router['post']('/:id/any_conditions',auth[_0x264c('0xb')](),controller['addAnyCondition']);router['post']('/:id/actions',auth[_0x264c('0xb')](),controller[_0x264c('0x14')]);router[_0x264c('0x15')](_0x264c('0x16'),auth[_0x264c('0xb')](),controller['update']);router[_0x264c('0x17')](_0x264c('0x16'),auth[_0x264c('0xb')](),controller[_0x264c('0x18')]);module[_0x264c('0x19')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 004e7bd..9da2032 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 _0x9178=['sequelize','STRING','BOOLEAN'];(function(_0x58e9bc,_0x31f868){var _0x45df8f=function(_0x490f45){while(--_0x490f45){_0x58e9bc['push'](_0x58e9bc['shift']());}};_0x45df8f(++_0x31f868);}(_0x9178,0xa8));var _0x8917=function(_0x3f2195,_0x5ce83c){_0x3f2195=_0x3f2195-0x0;var _0x26da27=_0x9178[_0x3f2195];return _0x26da27;};'use strict';var Sequelize=require(_0x8917('0x0'));module['exports']={'name':{'type':Sequelize[_0x8917('0x1')]},'channel':{'type':Sequelize[_0x8917('0x1')]},'description':{'type':Sequelize[_0x8917('0x1')]},'status':{'type':Sequelize[_0x8917('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x7a22=['STRING','sequelize'];(function(_0x43dc7e,_0x49a390){var _0x21e12d=function(_0x15cc1a){while(--_0x15cc1a){_0x43dc7e['push'](_0x43dc7e['shift']());}};_0x21e12d(++_0x49a390);}(_0x7a22,0x1cd));var _0x27a2=function(_0x527c9b,_0x352f59){_0x527c9b=_0x527c9b-0x0;var _0x53a8aa=_0x7a22[_0x527c9b];return _0x53a8aa;};'use strict';var Sequelize=require(_0x27a2('0x0'));module['exports']={'name':{'type':Sequelize[_0x27a2('0x1')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x27a2('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index d56cc96..3e17a3e 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 _0x83c9=['path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','get','UserProfileResource','error','name','send','index','map','Trigger','rawAttributes','fieldName','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filters','where','merge','type','VIRTUAL','includeAll','include','findAll','catch','params','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','order','filter','addAction','Action','getActions','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x227427,_0x39a41d){var _0x2f3aef=function(_0x391c69){while(--_0x391c69){_0x227427['push'](_0x227427['shift']());}};_0x2f3aef(++_0x39a41d);}(_0x83c9,0x169));var _0x983c=function(_0x26d034,_0x2c22db){_0x26d034=_0x26d034-0x0;var _0x3015aa=_0x83c9[_0x26d034];return _0x3015aa;};'use strict';var emlformat=require(_0x983c('0x0'));var rimraf=require(_0x983c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x983c('0x2'));var rp=require(_0x983c('0x3'));var moment=require('moment');var BPromise=require(_0x983c('0x4'));var Mustache=require(_0x983c('0x5'));var util=require(_0x983c('0x6'));var path=require(_0x983c('0x7'));var sox=require(_0x983c('0x8'));var csv=require(_0x983c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x983c('0xa'));var _=require(_0x983c('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x983c('0xc'));var deskjs=require(_0x983c('0xd'));var toCsv=require(_0x983c('0x9'));var querystring=require(_0x983c('0xe'));var Papa=require(_0x983c('0xf'));var Redis=require(_0x983c('0x10'));var authService=require(_0x983c('0x11'));var qs=require(_0x983c('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x983c('0x13'))('api');var utils=require(_0x983c('0x14'));var config=require(_0x983c('0x15'));var licenseUtil=require(_0x983c('0x16'));var db=require(_0x983c('0x17'))['db'];function respondWithStatusCode(_0x552d3f,_0x135edf){_0x135edf=_0x135edf||0xcc;return function(_0x10bd82){if(_0x10bd82){return _0x552d3f[_0x983c('0x18')](_0x135edf);}return _0x552d3f[_0x983c('0x19')](_0x135edf)['end']();};}function respondWithResult(_0x44c3fe,_0x48aba5){_0x48aba5=_0x48aba5||0xc8;return function(_0x467c7d){if(_0x467c7d){return _0x44c3fe[_0x983c('0x19')](_0x48aba5)[_0x983c('0x1a')](_0x467c7d);}};}function respondWithFilteredResult(_0x54bff1,_0x17d7a1){return function(_0x12292b){if(_0x12292b){var _0x2eacc7=typeof _0x17d7a1[_0x983c('0x1b')]==='undefined'&&typeof _0x17d7a1[_0x983c('0x1c')]===_0x983c('0x1d');var _0x3267a7=_0x12292b[_0x983c('0x1e')];var _0x44e7af=_0x2eacc7?0x0:_0x17d7a1[_0x983c('0x1b')];var _0x4150a4=_0x2eacc7?_0x12292b['count']:_0x17d7a1[_0x983c('0x1b')]+_0x17d7a1[_0x983c('0x1c')];var _0x43d05c;if(_0x4150a4>=_0x3267a7){_0x4150a4=_0x3267a7;_0x43d05c=0xc8;}else{_0x43d05c=0xce;}_0x54bff1[_0x983c('0x19')](_0x43d05c);return _0x54bff1[_0x983c('0x1f')](_0x983c('0x20'),_0x44e7af+'-'+_0x4150a4+'/'+_0x3267a7)[_0x983c('0x1a')](_0x12292b);}return null;};}function patchUpdates(_0x5e3590){return function(_0x4182f4){try{jsonpatch[_0x983c('0x21')](_0x4182f4,_0x5e3590,!![]);}catch(_0x28400a){return BPromise[_0x983c('0x22')](_0x28400a);}return _0x4182f4[_0x983c('0x23')]();};}function saveUpdates(_0x16b26e,_0x53814c){return function(_0x466fe8){if(_0x466fe8){return _0x466fe8[_0x983c('0x24')](_0x16b26e)['then'](function(_0x2927e2){return _0x2927e2;});}return null;};}function removeEntity(_0x1ff003,_0x33c6f7){return function(_0x35962e){if(_0x35962e){return _0x35962e[_0x983c('0x25')]()[_0x983c('0x26')](function(){var _0x4ce434=_0x35962e[_0x983c('0x27')]({'plain':!![]});var _0xd382bc='Triggers';return db[_0x983c('0x28')][_0x983c('0x25')]({'where':{'type':_0xd382bc,'resourceId':_0x4ce434['id']}})[_0x983c('0x26')](function(){return _0x35962e;});})[_0x983c('0x26')](function(){_0x1ff003['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x708f6,_0x40a504){return function(_0x1de967){if(!_0x1de967){_0x708f6[_0x983c('0x18')](0x194);}return _0x1de967;};}function handleError(_0x571170,_0x13ae24){_0x13ae24=_0x13ae24||0x1f4;return function(_0x569d2f){logger[_0x983c('0x29')](_0x569d2f['stack']);if(_0x569d2f[_0x983c('0x2a')]){delete _0x569d2f['name'];}_0x571170['status'](_0x13ae24)[_0x983c('0x2b')](_0x569d2f);};}exports[_0x983c('0x2c')]=function(_0x467b21,_0x252c8e){var _0x4164f1={},_0x4ff412={},_0x1d5551={'count':0x0,'rows':[]};var _0x434474=_[_0x983c('0x2d')](db[_0x983c('0x2e')][_0x983c('0x2f')],function(_0x2f9328){return{'name':_0x2f9328[_0x983c('0x30')],'type':_0x2f9328['type'][_0x983c('0x31')]};});_0x4ff412[_0x983c('0x32')]=_['map'](_0x434474,_0x983c('0x2a'));_0x4ff412['query']=_[_0x983c('0x33')](_0x467b21['query']);_0x4ff412['filters']=_[_0x983c('0x34')](_0x4ff412[_0x983c('0x32')],_0x4ff412[_0x983c('0x35')]);_0x4164f1[_0x983c('0x36')]=_[_0x983c('0x34')](_0x4ff412['model'],qs[_0x983c('0x37')](_0x467b21[_0x983c('0x35')][_0x983c('0x37')]));_0x4164f1[_0x983c('0x36')]=_0x4164f1[_0x983c('0x36')][_0x983c('0x38')]?_0x4164f1['attributes']:_0x4ff412[_0x983c('0x32')];if(!_0x467b21[_0x983c('0x35')][_0x983c('0x39')](_0x983c('0x3a'))){_0x4164f1[_0x983c('0x1c')]=qs[_0x983c('0x1c')](_0x467b21[_0x983c('0x35')][_0x983c('0x1c')]);_0x4164f1[_0x983c('0x1b')]=qs[_0x983c('0x1b')](_0x467b21[_0x983c('0x35')]['offset']);}_0x4164f1['order']=qs[_0x983c('0x3b')](_0x467b21[_0x983c('0x35')][_0x983c('0x3b')]);_0x4164f1['where']=qs['filters'](_[_0x983c('0x3c')](_0x467b21['query'],_0x4ff412[_0x983c('0x3d')]),_0x434474);if(_0x467b21[_0x983c('0x35')]['filter']){_0x4164f1[_0x983c('0x3e')]=_[_0x983c('0x3f')](_0x4164f1['where'],{'$or':_[_0x983c('0x2d')](_0x434474,function(_0x32bfbf){if(_0x32bfbf[_0x983c('0x40')]!==_0x983c('0x41')){var _0x43e0d2={};_0x43e0d2[_0x32bfbf['name']]={'$like':'%'+_0x467b21[_0x983c('0x35')]['filter']+'%'};return _0x43e0d2;}})});}_0x4164f1=_[_0x983c('0x3f')]({},_0x4164f1,_0x467b21['options']);var _0xa70b3f={'where':_0x4164f1['where']};return db[_0x983c('0x2e')][_0x983c('0x1e')](_0xa70b3f)['then'](function(_0x4eb444){_0x1d5551[_0x983c('0x1e')]=_0x4eb444;if(_0x467b21[_0x983c('0x35')][_0x983c('0x42')]){_0x4164f1[_0x983c('0x43')]=[{'all':!![]}];}return db[_0x983c('0x2e')][_0x983c('0x44')](_0x4164f1);})['then'](function(_0x2a51f3){_0x1d5551['rows']=_0x2a51f3;return _0x1d5551;})[_0x983c('0x26')](respondWithFilteredResult(_0x252c8e,_0x4164f1))[_0x983c('0x45')](handleError(_0x252c8e,null));};exports['show']=function(_0x20971d,_0x1df094){var _0x42e3ae={'raw':![],'where':{'id':_0x20971d[_0x983c('0x46')]['id']}},_0x3047e3={};_0x3047e3['model']=_[_0x983c('0x33')](db['Trigger'][_0x983c('0x2f')]);_0x3047e3[_0x983c('0x35')]=_[_0x983c('0x33')](_0x20971d[_0x983c('0x35')]);_0x3047e3[_0x983c('0x3d')]=_[_0x983c('0x34')](_0x3047e3[_0x983c('0x32')],_0x3047e3[_0x983c('0x35')]);_0x42e3ae[_0x983c('0x36')]=_['intersection'](_0x3047e3['model'],qs[_0x983c('0x37')](_0x20971d[_0x983c('0x35')][_0x983c('0x37')]));_0x42e3ae['attributes']=_0x42e3ae['attributes'][_0x983c('0x38')]?_0x42e3ae[_0x983c('0x36')]:_0x3047e3[_0x983c('0x32')];if(_0x20971d[_0x983c('0x35')][_0x983c('0x42')]){_0x42e3ae[_0x983c('0x43')]=[{'all':!![]}];}_0x42e3ae=_[_0x983c('0x3f')]({},_0x42e3ae,_0x20971d[_0x983c('0x47')]);return db[_0x983c('0x2e')]['find'](_0x42e3ae)[_0x983c('0x26')](handleEntityNotFound(_0x1df094,null))[_0x983c('0x26')](respondWithResult(_0x1df094,null))[_0x983c('0x45')](handleError(_0x1df094,null));};exports[_0x983c('0x48')]=function(_0x25c95b,_0x33fcf6){return db[_0x983c('0x2e')][_0x983c('0x48')](_0x25c95b[_0x983c('0x49')],{})[_0x983c('0x26')](function(_0x3919a0){var _0x596105=_0x25c95b[_0x983c('0x4a')][_0x983c('0x27')]({'plain':!![]});if(!_0x596105)throw new Error(_0x983c('0x4b'));if(_0x596105[_0x983c('0x4c')]===_0x983c('0x4a')){var _0x46865f=_0x3919a0[_0x983c('0x27')]({'plain':!![]});var _0x4972a3='Triggers';return db[_0x983c('0x4d')][_0x983c('0x4e')]({'where':{'name':_0x4972a3,'userProfileId':_0x596105['userProfileId']},'raw':!![]})[_0x983c('0x26')](function(_0x1d3749){if(_0x1d3749&&_0x1d3749[_0x983c('0x4f')]===0x0){return db[_0x983c('0x28')][_0x983c('0x48')]({'name':_0x46865f[_0x983c('0x2a')],'resourceId':_0x46865f['id'],'type':_0x1d3749['name'],'sectionId':_0x1d3749['id']},{})[_0x983c('0x26')](function(){return _0x3919a0;});}else{return _0x3919a0;}})[_0x983c('0x45')](function(_0x405dfd){logger[_0x983c('0x29')](_0x983c('0x50'),_0x405dfd);throw _0x405dfd;});}return _0x3919a0;})[_0x983c('0x26')](respondWithResult(_0x33fcf6,0xc9))[_0x983c('0x45')](handleError(_0x33fcf6,null));};exports[_0x983c('0x24')]=function(_0x580d45,_0x17a8cd){if(_0x580d45['body']['id']){delete _0x580d45[_0x983c('0x49')]['id'];}return db[_0x983c('0x2e')][_0x983c('0x4e')]({'where':{'id':_0x580d45[_0x983c('0x46')]['id']}})[_0x983c('0x26')](handleEntityNotFound(_0x17a8cd,null))['then'](saveUpdates(_0x580d45[_0x983c('0x49')],null))[_0x983c('0x26')](respondWithResult(_0x17a8cd,null))[_0x983c('0x45')](handleError(_0x17a8cd,null));};exports[_0x983c('0x25')]=function(_0x23f262,_0x3d1854){return db['Trigger']['find']({'where':{'id':_0x23f262[_0x983c('0x46')]['id']}})['then'](handleEntityNotFound(_0x3d1854,null))[_0x983c('0x26')](removeEntity(_0x3d1854,null))[_0x983c('0x45')](handleError(_0x3d1854,null));};exports[_0x983c('0x51')]=function(_0x42bfc5,_0x400d1d,_0x49378c){if(_0x42bfc5[_0x983c('0x49')]['id']){delete _0x42bfc5[_0x983c('0x49')]['id'];}return db[_0x983c('0x2e')][_0x983c('0x4e')]({'where':{'id':_0x42bfc5['params']['id']}})['then'](handleEntityNotFound(_0x400d1d,null))[_0x983c('0x26')](function(_0x2c8862){if(_0x2c8862){_0x42bfc5[_0x983c('0x49')]['TriggerAllId']=_0x2c8862['id'];return db[_0x983c('0x52')][_0x983c('0x48')](_0x42bfc5[_0x983c('0x49')]);}})[_0x983c('0x26')](respondWithResult(_0x400d1d,null))[_0x983c('0x45')](handleError(_0x400d1d,null));};exports[_0x983c('0x53')]=function(_0x46736c,_0x29ffc5,_0x4abe57){if(_0x46736c[_0x983c('0x49')]['id']){delete _0x46736c[_0x983c('0x49')]['id'];}return db['Trigger']['find']({'where':{'id':_0x46736c['params']['id']}})[_0x983c('0x26')](handleEntityNotFound(_0x29ffc5,null))[_0x983c('0x26')](function(_0x3d9ba0){if(_0x3d9ba0){_0x46736c[_0x983c('0x49')][_0x983c('0x54')]=_0x3d9ba0['id'];return db['Condition'][_0x983c('0x48')](_0x46736c[_0x983c('0x49')]);}})[_0x983c('0x26')](respondWithResult(_0x29ffc5,null))[_0x983c('0x45')](handleError(_0x29ffc5,null));};exports[_0x983c('0x55')]=function(_0x44c410,_0x296a39,_0x535dfd){var _0x363b75={};var _0x925389={};var _0x4bc0c1;var _0x156784;return db[_0x983c('0x2e')][_0x983c('0x56')]({'where':{'id':_0x44c410['params']['id']}})['then'](handleEntityNotFound(_0x296a39,null))[_0x983c('0x26')](function(_0x3be6f8){if(_0x3be6f8){_0x4bc0c1=_0x3be6f8;_0x925389[_0x983c('0x32')]=_['keys'](db[_0x983c('0x52')]['rawAttributes']);_0x925389[_0x983c('0x35')]=_[_0x983c('0x33')](_0x44c410[_0x983c('0x35')]);_0x925389['filters']=_[_0x983c('0x34')](_0x925389['model'],_0x925389[_0x983c('0x35')]);_0x363b75[_0x983c('0x36')]=_[_0x983c('0x34')](_0x925389['model'],qs[_0x983c('0x37')](_0x44c410['query']['fields']));_0x363b75[_0x983c('0x36')]=_0x363b75['attributes'][_0x983c('0x38')]?_0x363b75[_0x983c('0x36')]:_0x925389[_0x983c('0x32')];_0x363b75[_0x983c('0x57')]=qs[_0x983c('0x3b')](_0x44c410['query']['sort']);_0x363b75[_0x983c('0x3e')]=qs[_0x983c('0x3d')](_[_0x983c('0x3c')](_0x44c410[_0x983c('0x35')],_0x925389['filters']));if(_0x44c410['query'][_0x983c('0x58')]){_0x363b75['where']=_[_0x983c('0x3f')](_0x363b75[_0x983c('0x3e')],{'$or':_[_0x983c('0x2d')](_0x363b75[_0x983c('0x36')],function(_0x3c4eb4){var _0x160a59={};_0x160a59[_0x3c4eb4]={'$like':'%'+_0x44c410[_0x983c('0x35')][_0x983c('0x58')]+'%'};return _0x160a59;})});}_0x363b75=_['merge']({},_0x363b75,_0x44c410[_0x983c('0x47')]);return _0x4bc0c1['getAllConditions'](_0x363b75);}})[_0x983c('0x26')](function(_0x5f9ec4){if(_0x5f9ec4){_0x156784=_0x5f9ec4[_0x983c('0x38')];if(!_0x44c410[_0x983c('0x35')][_0x983c('0x39')](_0x983c('0x3a'))){_0x363b75[_0x983c('0x1c')]=qs[_0x983c('0x1c')](_0x44c410[_0x983c('0x35')][_0x983c('0x1c')]);_0x363b75['offset']=qs[_0x983c('0x1b')](_0x44c410['query']['offset']);}return _0x4bc0c1[_0x983c('0x55')](_0x363b75);}})['then'](function(_0x1bd31e){if(_0x1bd31e){return _0x1bd31e?{'count':_0x156784,'rows':_0x1bd31e}:null;}})[_0x983c('0x26')](respondWithResult(_0x296a39,null))[_0x983c('0x45')](handleError(_0x296a39,null));};exports['getAnyConditions']=function(_0x270971,_0x40f72e,_0x104712){var _0x231cce={};var _0xc35c={};var _0x4815bd;var _0x44ebbc;return db[_0x983c('0x2e')]['findOne']({'where':{'id':_0x270971['params']['id']}})[_0x983c('0x26')](handleEntityNotFound(_0x40f72e,null))[_0x983c('0x26')](function(_0x3bf310){if(_0x3bf310){_0x4815bd=_0x3bf310;_0xc35c[_0x983c('0x32')]=_[_0x983c('0x33')](db['Condition'][_0x983c('0x2f')]);_0xc35c['query']=_[_0x983c('0x33')](_0x270971[_0x983c('0x35')]);_0xc35c['filters']=_['intersection'](_0xc35c['model'],_0xc35c[_0x983c('0x35')]);_0x231cce[_0x983c('0x36')]=_[_0x983c('0x34')](_0xc35c['model'],qs[_0x983c('0x37')](_0x270971['query'][_0x983c('0x37')]));_0x231cce['attributes']=_0x231cce[_0x983c('0x36')][_0x983c('0x38')]?_0x231cce[_0x983c('0x36')]:_0xc35c['model'];_0x231cce[_0x983c('0x57')]=qs['sort'](_0x270971[_0x983c('0x35')][_0x983c('0x3b')]);_0x231cce[_0x983c('0x3e')]=qs[_0x983c('0x3d')](_['pick'](_0x270971['query'],_0xc35c['filters']));if(_0x270971[_0x983c('0x35')][_0x983c('0x58')]){_0x231cce[_0x983c('0x3e')]=_[_0x983c('0x3f')](_0x231cce[_0x983c('0x3e')],{'$or':_[_0x983c('0x2d')](_0x231cce[_0x983c('0x36')],function(_0x3108e3){var _0x2e50c0={};_0x2e50c0[_0x3108e3]={'$like':'%'+_0x270971[_0x983c('0x35')]['filter']+'%'};return _0x2e50c0;})});}_0x231cce=_[_0x983c('0x3f')]({},_0x231cce,_0x270971[_0x983c('0x47')]);return _0x4815bd['getAnyConditions'](_0x231cce);}})['then'](function(_0x550487){if(_0x550487){_0x44ebbc=_0x550487[_0x983c('0x38')];if(!_0x270971[_0x983c('0x35')][_0x983c('0x39')]('nolimit')){_0x231cce[_0x983c('0x1c')]=qs[_0x983c('0x1c')](_0x270971[_0x983c('0x35')][_0x983c('0x1c')]);_0x231cce[_0x983c('0x1b')]=qs[_0x983c('0x1b')](_0x270971[_0x983c('0x35')]['offset']);}return _0x4815bd['getAnyConditions'](_0x231cce);}})['then'](function(_0x39ba59){if(_0x39ba59){return _0x39ba59?{'count':_0x44ebbc,'rows':_0x39ba59}:null;}})['then'](respondWithResult(_0x40f72e,null))['catch'](handleError(_0x40f72e,null));};exports[_0x983c('0x59')]=function(_0x15ae0d,_0x1b6ceb,_0x3bf034){if(_0x15ae0d['body']['id']){delete _0x15ae0d[_0x983c('0x49')]['id'];}return db['Trigger'][_0x983c('0x4e')]({'where':{'id':_0x15ae0d['params']['id']}})['then'](handleEntityNotFound(_0x1b6ceb,null))[_0x983c('0x26')](function(_0x401628){if(_0x401628){_0x15ae0d[_0x983c('0x49')]['TriggerId']=_0x401628['id'];return db[_0x983c('0x5a')][_0x983c('0x48')](_0x15ae0d[_0x983c('0x49')]);}})['then'](respondWithResult(_0x1b6ceb,null))[_0x983c('0x45')](handleError(_0x1b6ceb,null));};exports[_0x983c('0x5b')]=function(_0x366c37,_0x46a36f,_0x1ca9c7){var _0x4f4146={};var _0x3a155a={};var _0x214c3b;var _0x2a48a4;return db[_0x983c('0x2e')]['findOne']({'where':{'id':_0x366c37[_0x983c('0x46')]['id']}})[_0x983c('0x26')](handleEntityNotFound(_0x46a36f,null))[_0x983c('0x26')](function(_0x13852e){if(_0x13852e){_0x214c3b=_0x13852e;_0x3a155a['model']=_[_0x983c('0x33')](db[_0x983c('0x5a')][_0x983c('0x2f')]);_0x3a155a[_0x983c('0x35')]=_['keys'](_0x366c37['query']);_0x3a155a['filters']=_[_0x983c('0x34')](_0x3a155a['model'],_0x3a155a['query']);_0x4f4146[_0x983c('0x36')]=_[_0x983c('0x34')](_0x3a155a['model'],qs[_0x983c('0x37')](_0x366c37[_0x983c('0x35')][_0x983c('0x37')]));_0x4f4146['attributes']=_0x4f4146['attributes'][_0x983c('0x38')]?_0x4f4146[_0x983c('0x36')]:_0x3a155a[_0x983c('0x32')];_0x4f4146['order']=qs[_0x983c('0x3b')](_0x366c37[_0x983c('0x35')][_0x983c('0x3b')]);_0x4f4146[_0x983c('0x3e')]=qs[_0x983c('0x3d')](_[_0x983c('0x3c')](_0x366c37[_0x983c('0x35')],_0x3a155a[_0x983c('0x3d')]));if(_0x366c37[_0x983c('0x35')][_0x983c('0x58')]){_0x4f4146[_0x983c('0x3e')]=_[_0x983c('0x3f')](_0x4f4146[_0x983c('0x3e')],{'$or':_[_0x983c('0x2d')](_0x4f4146[_0x983c('0x36')],function(_0x4a77de){var _0x357000={};_0x357000[_0x4a77de]={'$like':'%'+_0x366c37[_0x983c('0x35')]['filter']+'%'};return _0x357000;})});}_0x4f4146=_[_0x983c('0x3f')]({},_0x4f4146,_0x366c37[_0x983c('0x47')]);return _0x214c3b[_0x983c('0x5b')](_0x4f4146);}})['then'](function(_0x452f15){if(_0x452f15){_0x2a48a4=_0x452f15[_0x983c('0x38')];if(!_0x366c37['query'][_0x983c('0x39')](_0x983c('0x3a'))){_0x4f4146['limit']=qs[_0x983c('0x1c')](_0x366c37[_0x983c('0x35')][_0x983c('0x1c')]);_0x4f4146['offset']=qs[_0x983c('0x1b')](_0x366c37[_0x983c('0x35')][_0x983c('0x1b')]);}return _0x214c3b[_0x983c('0x5b')](_0x4f4146);}})[_0x983c('0x26')](function(_0x564ee6){if(_0x564ee6){return _0x564ee6?{'count':_0x2a48a4,'rows':_0x564ee6}:null;}})['then'](respondWithResult(_0x46a36f,null))[_0x983c('0x45')](handleError(_0x46a36f,null));}; \ No newline at end of file +var _0x86ea=['rows','show','params','options','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','addAnyCondition','TriggerAnyId','Condition','getAllConditions','findOne','rawAttributes','getAnyConditions','addAction','TriggerId','Action','getActions','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','get','Triggers','UserProfileResource','name','send','index','map','Trigger','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll'];(function(_0x2b419e,_0x296a64){var _0x2778a6=function(_0x4c277d){while(--_0x4c277d){_0x2b419e['push'](_0x2b419e['shift']());}};_0x2778a6(++_0x296a64);}(_0x86ea,0x137));var _0xa86e=function(_0x6ef8af,_0x484085){_0x6ef8af=_0x6ef8af-0x0;var _0x1f0a7b=_0x86ea[_0x6ef8af];return _0x1f0a7b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa86e('0x0'));var zipdir=require(_0xa86e('0x1'));var jsonpatch=require(_0xa86e('0x2'));var rp=require(_0xa86e('0x3'));var moment=require('moment');var BPromise=require(_0xa86e('0x4'));var Mustache=require('mustache');var util=require(_0xa86e('0x5'));var path=require(_0xa86e('0x6'));var sox=require(_0xa86e('0x7'));var csv=require(_0xa86e('0x8'));var ejs=require(_0xa86e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa86e('0xa'));var squel=require(_0xa86e('0xb'));var crypto=require(_0xa86e('0xc'));var jsforce=require(_0xa86e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xa86e('0x8'));var querystring=require(_0xa86e('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa86e('0xf'));var qs=require(_0xa86e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa86e('0x11'));var logger=require(_0xa86e('0x12'))('api');var utils=require(_0xa86e('0x13'));var config=require(_0xa86e('0x14'));var licenseUtil=require(_0xa86e('0x15'));var db=require(_0xa86e('0x16'))['db'];function respondWithStatusCode(_0x40f671,_0x5f594b){_0x5f594b=_0x5f594b||0xcc;return function(_0x50431f){if(_0x50431f){return _0x40f671['sendStatus'](_0x5f594b);}return _0x40f671[_0xa86e('0x17')](_0x5f594b)[_0xa86e('0x18')]();};}function respondWithResult(_0x383b65,_0x27348d){_0x27348d=_0x27348d||0xc8;return function(_0x25b935){if(_0x25b935){return _0x383b65[_0xa86e('0x17')](_0x27348d)['json'](_0x25b935);}};}function respondWithFilteredResult(_0x4ed948,_0x312259){return function(_0x4f2e91){if(_0x4f2e91){var _0x13f4ee=typeof _0x312259[_0xa86e('0x19')]===_0xa86e('0x1a')&&typeof _0x312259['limit']===_0xa86e('0x1a');var _0x2cc8de=_0x4f2e91[_0xa86e('0x1b')];var _0x5a5495=_0x13f4ee?0x0:_0x312259[_0xa86e('0x19')];var _0x2970bb=_0x13f4ee?_0x4f2e91[_0xa86e('0x1b')]:_0x312259[_0xa86e('0x19')]+_0x312259[_0xa86e('0x1c')];var _0x5e4da5;if(_0x2970bb>=_0x2cc8de){_0x2970bb=_0x2cc8de;_0x5e4da5=0xc8;}else{_0x5e4da5=0xce;}_0x4ed948[_0xa86e('0x17')](_0x5e4da5);return _0x4ed948[_0xa86e('0x1d')](_0xa86e('0x1e'),_0x5a5495+'-'+_0x2970bb+'/'+_0x2cc8de)[_0xa86e('0x1f')](_0x4f2e91);}return null;};}function patchUpdates(_0x535cf4){return function(_0x1a1df1){try{jsonpatch[_0xa86e('0x20')](_0x1a1df1,_0x535cf4,!![]);}catch(_0x3d0ecf){return BPromise[_0xa86e('0x21')](_0x3d0ecf);}return _0x1a1df1[_0xa86e('0x22')]();};}function saveUpdates(_0x4ead84,_0x122271){return function(_0x40e0a9){if(_0x40e0a9){return _0x40e0a9[_0xa86e('0x23')](_0x4ead84)[_0xa86e('0x24')](function(_0x3463e3){return _0x3463e3;});}return null;};}function removeEntity(_0x206dba,_0xcb66d3){return function(_0x4d8c59){if(_0x4d8c59){return _0x4d8c59[_0xa86e('0x25')]()[_0xa86e('0x24')](function(){var _0x1367d1=_0x4d8c59[_0xa86e('0x26')]({'plain':!![]});var _0x3d32c9=_0xa86e('0x27');return db[_0xa86e('0x28')][_0xa86e('0x25')]({'where':{'type':_0x3d32c9,'resourceId':_0x1367d1['id']}})[_0xa86e('0x24')](function(){return _0x4d8c59;});})[_0xa86e('0x24')](function(){_0x206dba[_0xa86e('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2638c5,_0x3b4a0b){return function(_0x5e8a2f){if(!_0x5e8a2f){_0x2638c5['sendStatus'](0x194);}return _0x5e8a2f;};}function handleError(_0x464e6c,_0x13151a){_0x13151a=_0x13151a||0x1f4;return function(_0x3a98e0){logger['error'](_0x3a98e0['stack']);if(_0x3a98e0[_0xa86e('0x29')]){delete _0x3a98e0[_0xa86e('0x29')];}_0x464e6c[_0xa86e('0x17')](_0x13151a)[_0xa86e('0x2a')](_0x3a98e0);};}exports[_0xa86e('0x2b')]=function(_0x322911,_0x365346){var _0xe84ba={},_0x2f6fa8={},_0x17a036={'count':0x0,'rows':[]};var _0x52a2f0=_[_0xa86e('0x2c')](db[_0xa86e('0x2d')]['rawAttributes'],function(_0x557a54){return{'name':_0x557a54[_0xa86e('0x2e')],'type':_0x557a54[_0xa86e('0x2f')][_0xa86e('0x30')]};});_0x2f6fa8['model']=_['map'](_0x52a2f0,'name');_0x2f6fa8[_0xa86e('0x31')]=_[_0xa86e('0x32')](_0x322911[_0xa86e('0x31')]);_0x2f6fa8[_0xa86e('0x33')]=_[_0xa86e('0x34')](_0x2f6fa8[_0xa86e('0x35')],_0x2f6fa8[_0xa86e('0x31')]);_0xe84ba['attributes']=_[_0xa86e('0x34')](_0x2f6fa8[_0xa86e('0x35')],qs[_0xa86e('0x36')](_0x322911[_0xa86e('0x31')]['fields']));_0xe84ba[_0xa86e('0x37')]=_0xe84ba[_0xa86e('0x37')][_0xa86e('0x38')]?_0xe84ba[_0xa86e('0x37')]:_0x2f6fa8['model'];if(!_0x322911[_0xa86e('0x31')][_0xa86e('0x39')](_0xa86e('0x3a'))){_0xe84ba['limit']=qs['limit'](_0x322911['query'][_0xa86e('0x1c')]);_0xe84ba[_0xa86e('0x19')]=qs[_0xa86e('0x19')](_0x322911['query'][_0xa86e('0x19')]);}_0xe84ba[_0xa86e('0x3b')]=qs[_0xa86e('0x3c')](_0x322911['query']['sort']);_0xe84ba[_0xa86e('0x3d')]=qs[_0xa86e('0x33')](_[_0xa86e('0x3e')](_0x322911[_0xa86e('0x31')],_0x2f6fa8[_0xa86e('0x33')]),_0x52a2f0);if(_0x322911['query'][_0xa86e('0x3f')]){_0xe84ba[_0xa86e('0x3d')]=_['merge'](_0xe84ba[_0xa86e('0x3d')],{'$or':_[_0xa86e('0x2c')](_0x52a2f0,function(_0x3990c8){if(_0x3990c8['type']!==_0xa86e('0x40')){var _0x4735a7={};_0x4735a7[_0x3990c8[_0xa86e('0x29')]]={'$like':'%'+_0x322911[_0xa86e('0x31')][_0xa86e('0x3f')]+'%'};return _0x4735a7;}})});}_0xe84ba=_[_0xa86e('0x41')]({},_0xe84ba,_0x322911['options']);var _0xfde4c4={'where':_0xe84ba[_0xa86e('0x3d')]};return db[_0xa86e('0x2d')]['count'](_0xfde4c4)[_0xa86e('0x24')](function(_0xcc22f7){_0x17a036[_0xa86e('0x1b')]=_0xcc22f7;if(_0x322911['query'][_0xa86e('0x42')]){_0xe84ba[_0xa86e('0x43')]=[{'all':!![]}];}return db['Trigger'][_0xa86e('0x44')](_0xe84ba);})['then'](function(_0x4efdb9){_0x17a036[_0xa86e('0x45')]=_0x4efdb9;return _0x17a036;})[_0xa86e('0x24')](respondWithFilteredResult(_0x365346,_0xe84ba))['catch'](handleError(_0x365346,null));};exports[_0xa86e('0x46')]=function(_0x11a030,_0x29f341){var _0x540b67={'raw':![],'where':{'id':_0x11a030[_0xa86e('0x47')]['id']}},_0x126992={};_0x126992[_0xa86e('0x35')]=_[_0xa86e('0x32')](db[_0xa86e('0x2d')]['rawAttributes']);_0x126992[_0xa86e('0x31')]=_['keys'](_0x11a030['query']);_0x126992[_0xa86e('0x33')]=_[_0xa86e('0x34')](_0x126992['model'],_0x126992[_0xa86e('0x31')]);_0x540b67['attributes']=_[_0xa86e('0x34')](_0x126992[_0xa86e('0x35')],qs[_0xa86e('0x36')](_0x11a030['query'][_0xa86e('0x36')]));_0x540b67['attributes']=_0x540b67[_0xa86e('0x37')][_0xa86e('0x38')]?_0x540b67[_0xa86e('0x37')]:_0x126992[_0xa86e('0x35')];if(_0x11a030['query'][_0xa86e('0x42')]){_0x540b67[_0xa86e('0x43')]=[{'all':!![]}];}_0x540b67=_['merge']({},_0x540b67,_0x11a030[_0xa86e('0x48')]);return db[_0xa86e('0x2d')][_0xa86e('0x49')](_0x540b67)[_0xa86e('0x24')](handleEntityNotFound(_0x29f341,null))[_0xa86e('0x24')](respondWithResult(_0x29f341,null))[_0xa86e('0x4a')](handleError(_0x29f341,null));};exports['create']=function(_0x527951,_0x1fd866){return db[_0xa86e('0x2d')][_0xa86e('0x4b')](_0x527951['body'],{})[_0xa86e('0x24')](function(_0xafe42){var _0x447644=_0x527951[_0xa86e('0x4c')]['get']({'plain':!![]});if(!_0x447644)throw new Error(_0xa86e('0x4d'));if(_0x447644[_0xa86e('0x4e')]===_0xa86e('0x4c')){var _0x5dace9=_0xafe42[_0xa86e('0x26')]({'plain':!![]});var _0x459d06=_0xa86e('0x27');return db[_0xa86e('0x4f')]['find']({'where':{'name':_0x459d06,'userProfileId':_0x447644[_0xa86e('0x50')]},'raw':!![]})[_0xa86e('0x24')](function(_0x2c5ee7){if(_0x2c5ee7&&_0x2c5ee7[_0xa86e('0x51')]===0x0){return db['UserProfileResource']['create']({'name':_0x5dace9[_0xa86e('0x29')],'resourceId':_0x5dace9['id'],'type':_0x2c5ee7[_0xa86e('0x29')],'sectionId':_0x2c5ee7['id']},{})[_0xa86e('0x24')](function(){return _0xafe42;});}else{return _0xafe42;}})[_0xa86e('0x4a')](function(_0xdf4e36){logger['error'](_0xa86e('0x52'),_0xdf4e36);throw _0xdf4e36;});}return _0xafe42;})[_0xa86e('0x24')](respondWithResult(_0x1fd866,0xc9))['catch'](handleError(_0x1fd866,null));};exports[_0xa86e('0x23')]=function(_0x4c3b06,_0x3c61e2){if(_0x4c3b06['body']['id']){delete _0x4c3b06[_0xa86e('0x53')]['id'];}return db[_0xa86e('0x2d')][_0xa86e('0x49')]({'where':{'id':_0x4c3b06['params']['id']}})[_0xa86e('0x24')](handleEntityNotFound(_0x3c61e2,null))[_0xa86e('0x24')](saveUpdates(_0x4c3b06[_0xa86e('0x53')],null))[_0xa86e('0x24')](respondWithResult(_0x3c61e2,null))[_0xa86e('0x4a')](handleError(_0x3c61e2,null));};exports[_0xa86e('0x25')]=function(_0x4b4eb7,_0x179a39){return db[_0xa86e('0x2d')][_0xa86e('0x49')]({'where':{'id':_0x4b4eb7[_0xa86e('0x47')]['id']}})['then'](handleEntityNotFound(_0x179a39,null))[_0xa86e('0x24')](removeEntity(_0x179a39,null))[_0xa86e('0x4a')](handleError(_0x179a39,null));};exports['addAllCondition']=function(_0x5e6d1e,_0x5a9e72,_0x9c6075){if(_0x5e6d1e[_0xa86e('0x53')]['id']){delete _0x5e6d1e[_0xa86e('0x53')]['id'];}return db['Trigger'][_0xa86e('0x49')]({'where':{'id':_0x5e6d1e['params']['id']}})['then'](handleEntityNotFound(_0x5a9e72,null))[_0xa86e('0x24')](function(_0x21a717){if(_0x21a717){_0x5e6d1e[_0xa86e('0x53')]['TriggerAllId']=_0x21a717['id'];return db['Condition']['create'](_0x5e6d1e[_0xa86e('0x53')]);}})['then'](respondWithResult(_0x5a9e72,null))['catch'](handleError(_0x5a9e72,null));};exports[_0xa86e('0x54')]=function(_0x6006d5,_0x196512,_0x43f636){if(_0x6006d5[_0xa86e('0x53')]['id']){delete _0x6006d5[_0xa86e('0x53')]['id'];}return db[_0xa86e('0x2d')][_0xa86e('0x49')]({'where':{'id':_0x6006d5[_0xa86e('0x47')]['id']}})['then'](handleEntityNotFound(_0x196512,null))[_0xa86e('0x24')](function(_0x51c504){if(_0x51c504){_0x6006d5[_0xa86e('0x53')][_0xa86e('0x55')]=_0x51c504['id'];return db[_0xa86e('0x56')]['create'](_0x6006d5['body']);}})[_0xa86e('0x24')](respondWithResult(_0x196512,null))[_0xa86e('0x4a')](handleError(_0x196512,null));};exports[_0xa86e('0x57')]=function(_0x3a4dea,_0x3a5cc5,_0x2d90d7){var _0x4a4908={};var _0x1db697={};var _0x152ecf;var _0x4e7007;return db[_0xa86e('0x2d')][_0xa86e('0x58')]({'where':{'id':_0x3a4dea[_0xa86e('0x47')]['id']}})[_0xa86e('0x24')](handleEntityNotFound(_0x3a5cc5,null))[_0xa86e('0x24')](function(_0x175f40){if(_0x175f40){_0x152ecf=_0x175f40;_0x1db697[_0xa86e('0x35')]=_['keys'](db[_0xa86e('0x56')][_0xa86e('0x59')]);_0x1db697[_0xa86e('0x31')]=_[_0xa86e('0x32')](_0x3a4dea[_0xa86e('0x31')]);_0x1db697[_0xa86e('0x33')]=_[_0xa86e('0x34')](_0x1db697[_0xa86e('0x35')],_0x1db697[_0xa86e('0x31')]);_0x4a4908[_0xa86e('0x37')]=_[_0xa86e('0x34')](_0x1db697['model'],qs[_0xa86e('0x36')](_0x3a4dea[_0xa86e('0x31')][_0xa86e('0x36')]));_0x4a4908[_0xa86e('0x37')]=_0x4a4908['attributes']['length']?_0x4a4908[_0xa86e('0x37')]:_0x1db697[_0xa86e('0x35')];_0x4a4908[_0xa86e('0x3b')]=qs['sort'](_0x3a4dea[_0xa86e('0x31')]['sort']);_0x4a4908[_0xa86e('0x3d')]=qs[_0xa86e('0x33')](_[_0xa86e('0x3e')](_0x3a4dea[_0xa86e('0x31')],_0x1db697[_0xa86e('0x33')]));if(_0x3a4dea['query'][_0xa86e('0x3f')]){_0x4a4908['where']=_[_0xa86e('0x41')](_0x4a4908[_0xa86e('0x3d')],{'$or':_['map'](_0x4a4908['attributes'],function(_0x1c6f8f){var _0x25b13b={};_0x25b13b[_0x1c6f8f]={'$like':'%'+_0x3a4dea[_0xa86e('0x31')][_0xa86e('0x3f')]+'%'};return _0x25b13b;})});}_0x4a4908=_[_0xa86e('0x41')]({},_0x4a4908,_0x3a4dea[_0xa86e('0x48')]);return _0x152ecf['getAllConditions'](_0x4a4908);}})['then'](function(_0x5b5f2a){if(_0x5b5f2a){_0x4e7007=_0x5b5f2a['length'];if(!_0x3a4dea[_0xa86e('0x31')][_0xa86e('0x39')]('nolimit')){_0x4a4908['limit']=qs[_0xa86e('0x1c')](_0x3a4dea['query'][_0xa86e('0x1c')]);_0x4a4908['offset']=qs['offset'](_0x3a4dea[_0xa86e('0x31')][_0xa86e('0x19')]);}return _0x152ecf[_0xa86e('0x57')](_0x4a4908);}})[_0xa86e('0x24')](function(_0x58d133){if(_0x58d133){return _0x58d133?{'count':_0x4e7007,'rows':_0x58d133}:null;}})[_0xa86e('0x24')](respondWithResult(_0x3a5cc5,null))[_0xa86e('0x4a')](handleError(_0x3a5cc5,null));};exports['getAnyConditions']=function(_0x14dea1,_0x1a5e71,_0x2d39dd){var _0x111787={};var _0x1a00be={};var _0x5f0f43;var _0x5b42ee;return db[_0xa86e('0x2d')][_0xa86e('0x58')]({'where':{'id':_0x14dea1[_0xa86e('0x47')]['id']}})[_0xa86e('0x24')](handleEntityNotFound(_0x1a5e71,null))[_0xa86e('0x24')](function(_0x537bd7){if(_0x537bd7){_0x5f0f43=_0x537bd7;_0x1a00be['model']=_['keys'](db[_0xa86e('0x56')]['rawAttributes']);_0x1a00be['query']=_[_0xa86e('0x32')](_0x14dea1['query']);_0x1a00be['filters']=_[_0xa86e('0x34')](_0x1a00be[_0xa86e('0x35')],_0x1a00be[_0xa86e('0x31')]);_0x111787[_0xa86e('0x37')]=_['intersection'](_0x1a00be['model'],qs[_0xa86e('0x36')](_0x14dea1[_0xa86e('0x31')][_0xa86e('0x36')]));_0x111787[_0xa86e('0x37')]=_0x111787[_0xa86e('0x37')][_0xa86e('0x38')]?_0x111787[_0xa86e('0x37')]:_0x1a00be[_0xa86e('0x35')];_0x111787[_0xa86e('0x3b')]=qs[_0xa86e('0x3c')](_0x14dea1[_0xa86e('0x31')][_0xa86e('0x3c')]);_0x111787[_0xa86e('0x3d')]=qs[_0xa86e('0x33')](_['pick'](_0x14dea1['query'],_0x1a00be['filters']));if(_0x14dea1[_0xa86e('0x31')][_0xa86e('0x3f')]){_0x111787[_0xa86e('0x3d')]=_['merge'](_0x111787[_0xa86e('0x3d')],{'$or':_['map'](_0x111787[_0xa86e('0x37')],function(_0x3286c1){var _0x1ea794={};_0x1ea794[_0x3286c1]={'$like':'%'+_0x14dea1[_0xa86e('0x31')][_0xa86e('0x3f')]+'%'};return _0x1ea794;})});}_0x111787=_[_0xa86e('0x41')]({},_0x111787,_0x14dea1[_0xa86e('0x48')]);return _0x5f0f43[_0xa86e('0x5a')](_0x111787);}})[_0xa86e('0x24')](function(_0x4c1597){if(_0x4c1597){_0x5b42ee=_0x4c1597[_0xa86e('0x38')];if(!_0x14dea1[_0xa86e('0x31')]['hasOwnProperty']('nolimit')){_0x111787[_0xa86e('0x1c')]=qs[_0xa86e('0x1c')](_0x14dea1[_0xa86e('0x31')][_0xa86e('0x1c')]);_0x111787['offset']=qs['offset'](_0x14dea1[_0xa86e('0x31')][_0xa86e('0x19')]);}return _0x5f0f43[_0xa86e('0x5a')](_0x111787);}})[_0xa86e('0x24')](function(_0x2611c7){if(_0x2611c7){return _0x2611c7?{'count':_0x5b42ee,'rows':_0x2611c7}:null;}})[_0xa86e('0x24')](respondWithResult(_0x1a5e71,null))['catch'](handleError(_0x1a5e71,null));};exports[_0xa86e('0x5b')]=function(_0x320d2c,_0x45bfd1,_0xbe2505){if(_0x320d2c[_0xa86e('0x53')]['id']){delete _0x320d2c[_0xa86e('0x53')]['id'];}return db[_0xa86e('0x2d')][_0xa86e('0x49')]({'where':{'id':_0x320d2c[_0xa86e('0x47')]['id']}})[_0xa86e('0x24')](handleEntityNotFound(_0x45bfd1,null))[_0xa86e('0x24')](function(_0x536ff3){if(_0x536ff3){_0x320d2c[_0xa86e('0x53')][_0xa86e('0x5c')]=_0x536ff3['id'];return db[_0xa86e('0x5d')]['create'](_0x320d2c[_0xa86e('0x53')]);}})[_0xa86e('0x24')](respondWithResult(_0x45bfd1,null))[_0xa86e('0x4a')](handleError(_0x45bfd1,null));};exports[_0xa86e('0x5e')]=function(_0x32308f,_0x318ff6,_0x55fec1){var _0x4c7861={};var _0x4fb215={};var _0x4a57a9;var _0x1a6e18;return db['Trigger'][_0xa86e('0x58')]({'where':{'id':_0x32308f[_0xa86e('0x47')]['id']}})[_0xa86e('0x24')](handleEntityNotFound(_0x318ff6,null))['then'](function(_0x443e8f){if(_0x443e8f){_0x4a57a9=_0x443e8f;_0x4fb215[_0xa86e('0x35')]=_['keys'](db[_0xa86e('0x5d')][_0xa86e('0x59')]);_0x4fb215[_0xa86e('0x31')]=_['keys'](_0x32308f[_0xa86e('0x31')]);_0x4fb215['filters']=_['intersection'](_0x4fb215['model'],_0x4fb215['query']);_0x4c7861['attributes']=_['intersection'](_0x4fb215['model'],qs[_0xa86e('0x36')](_0x32308f[_0xa86e('0x31')]['fields']));_0x4c7861[_0xa86e('0x37')]=_0x4c7861[_0xa86e('0x37')]['length']?_0x4c7861[_0xa86e('0x37')]:_0x4fb215['model'];_0x4c7861[_0xa86e('0x3b')]=qs[_0xa86e('0x3c')](_0x32308f[_0xa86e('0x31')][_0xa86e('0x3c')]);_0x4c7861[_0xa86e('0x3d')]=qs[_0xa86e('0x33')](_[_0xa86e('0x3e')](_0x32308f['query'],_0x4fb215[_0xa86e('0x33')]));if(_0x32308f['query'][_0xa86e('0x3f')]){_0x4c7861['where']=_[_0xa86e('0x41')](_0x4c7861[_0xa86e('0x3d')],{'$or':_[_0xa86e('0x2c')](_0x4c7861[_0xa86e('0x37')],function(_0x3f0865){var _0x2a06d7={};_0x2a06d7[_0x3f0865]={'$like':'%'+_0x32308f[_0xa86e('0x31')][_0xa86e('0x3f')]+'%'};return _0x2a06d7;})});}_0x4c7861=_['merge']({},_0x4c7861,_0x32308f[_0xa86e('0x48')]);return _0x4a57a9[_0xa86e('0x5e')](_0x4c7861);}})[_0xa86e('0x24')](function(_0xbf3ff3){if(_0xbf3ff3){_0x1a6e18=_0xbf3ff3[_0xa86e('0x38')];if(!_0x32308f[_0xa86e('0x31')][_0xa86e('0x39')]('nolimit')){_0x4c7861[_0xa86e('0x1c')]=qs['limit'](_0x32308f[_0xa86e('0x31')][_0xa86e('0x1c')]);_0x4c7861['offset']=qs['offset'](_0x32308f['query'][_0xa86e('0x19')]);}return _0x4a57a9[_0xa86e('0x5e')](_0x4c7861);}})[_0xa86e('0x24')](function(_0x57f945){if(_0x57f945){return _0x57f945?{'count':_0x1a6e18,'rows':_0x57f945}:null;}})[_0xa86e('0x24')](respondWithResult(_0x318ff6,null))[_0xa86e('0x4a')](handleError(_0x318ff6,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 94930f5..112c8c8 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 _0x4a80=['api','bluebird','request-promise','path','rimraf','../../config/environment','./trigger.attributes','exports','define','tools_triggers','lodash','../../config/logger'];(function(_0x28ac6e,_0x3705eb){var _0x372a24=function(_0x457d06){while(--_0x457d06){_0x28ac6e['push'](_0x28ac6e['shift']());}};_0x372a24(++_0x3705eb);}(_0x4a80,0xbe));var _0x04a8=function(_0x3e41aa,_0x3b5f7e){_0x3e41aa=_0x3e41aa-0x0;var _0x28ab00=_0x4a80[_0x3e41aa];return _0x28ab00;};'use strict';var _=require(_0x04a8('0x0'));var util=require('util');var logger=require(_0x04a8('0x1'))(_0x04a8('0x2'));var moment=require('moment');var BPromise=require(_0x04a8('0x3'));var rp=require(_0x04a8('0x4'));var fs=require('fs');var path=require(_0x04a8('0x5'));var rimraf=require(_0x04a8('0x6'));var config=require(_0x04a8('0x7'));var attributes=require(_0x04a8('0x8'));module[_0x04a8('0x9')]=function(_0x353b43,_0x709eea){return _0x353b43[_0x04a8('0xa')]('Trigger',attributes,{'tableName':_0x04a8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x149c=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./trigger.attributes','exports','Trigger','tools_triggers','lodash'];(function(_0x298558,_0x34356c){var _0x57d194=function(_0x142202){while(--_0x142202){_0x298558['push'](_0x298558['shift']());}};_0x57d194(++_0x34356c);}(_0x149c,0x143));var _0xc149=function(_0x561322,_0x49bb1d){_0x561322=_0x561322-0x0;var _0x1fad82=_0x149c[_0x561322];return _0x1fad82;};'use strict';var _=require(_0xc149('0x0'));var util=require('util');var logger=require(_0xc149('0x1'))(_0xc149('0x2'));var moment=require(_0xc149('0x3'));var BPromise=require('bluebird');var rp=require(_0xc149('0x4'));var fs=require('fs');var path=require(_0xc149('0x5'));var rimraf=require(_0xc149('0x6'));var config=require(_0xc149('0x7'));var attributes=require(_0xc149('0x8'));module[_0xc149('0x9')]=function(_0x3b5e34,_0x5e9b5c){return _0x3b5e34['define'](_0xc149('0xa'),attributes,{'tableName':_0xc149('0xb'),'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 db66798..3485d98 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 _0xdf18=['ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request\x20sent','Trigger,\x20%s,\x20%s,\x20%s','stringify','code','error','Trigger,\x20%s,\x20%s','message','info','result','Trigger','options','raw','limit','include','map','model','attributes','GetTrigger','debug','find','where','then','ShowTrigger','catch','lodash','moment','bluebird','randomstring'];(function(_0x470711,_0x415ae0){var _0x33b3aa=function(_0x4fb7c0){while(--_0x4fb7c0){_0x470711['push'](_0x470711['shift']());}};_0x33b3aa(++_0x415ae0);}(_0xdf18,0x1d8));var _0x8df1=function(_0x4dba0d,_0x92bb78){_0x4dba0d=_0x4dba0d-0x0;var _0x50cf83=_0xdf18[_0x4dba0d];return _0x50cf83;};'use strict';var _=require(_0x8df1('0x0'));var util=require('util');var moment=require(_0x8df1('0x1'));var BPromise=require(_0x8df1('0x2'));var rs=require(_0x8df1('0x3'));var fs=require('fs');var Redis=require(_0x8df1('0x4'));var db=require(_0x8df1('0x5'))['db'];var utils=require(_0x8df1('0x6'));var logger=require('../../config/logger')(_0x8df1('0x7'));var config=require('../../config/environment');var jayson=require(_0x8df1('0x8'));var client=jayson[_0x8df1('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cefc6,_0x4944cd,_0x3c56db){return new BPromise(function(_0x9186aa,_0x36856b){return client['request'](_0x1cefc6,_0x3c56db)['then'](function(_0x1bfa3b){logger['info']('Trigger,\x20%s,\x20%s',_0x4944cd,_0x8df1('0xa'));logger['debug'](_0x8df1('0xb'),_0x4944cd,'request\x20sent',JSON[_0x8df1('0xc')](_0x1bfa3b));if(_0x1bfa3b['error']){if(_0x1bfa3b['error'][_0x8df1('0xd')]===0x1f4){logger[_0x8df1('0xe')](_0x8df1('0xf'),_0x4944cd,_0x1bfa3b[_0x8df1('0xe')][_0x8df1('0x10')]);return _0x36856b(_0x1bfa3b['error'][_0x8df1('0x10')]);}logger[_0x8df1('0xe')](_0x8df1('0xf'),_0x4944cd,_0x1bfa3b['error']['message']);return _0x9186aa(_0x1bfa3b[_0x8df1('0xe')]['message']);}else{logger[_0x8df1('0x11')](_0x8df1('0xf'),_0x4944cd,_0x8df1('0xa'));_0x9186aa(_0x1bfa3b[_0x8df1('0x12')]['message']);}})['catch'](function(_0x2c9b29){logger[_0x8df1('0xe')](_0x8df1('0xf'),_0x4944cd,_0x2c9b29);_0x36856b(_0x2c9b29);});});}exports['GetTrigger']=function(_0x1c7709){var _0x503795=this;return new Promise(function(_0x111cc8,_0x67800c){return db[_0x8df1('0x13')]['findAll']({'raw':_0x1c7709[_0x8df1('0x14')]?_0x1c7709[_0x8df1('0x14')][_0x8df1('0x15')]===undefined?!![]:![]:!![],'where':_0x1c7709[_0x8df1('0x14')]?_0x1c7709[_0x8df1('0x14')]['where']||null:null,'attributes':_0x1c7709[_0x8df1('0x14')]?_0x1c7709[_0x8df1('0x14')]['attributes']||null:null,'limit':_0x1c7709[_0x8df1('0x14')]?_0x1c7709['options'][_0x8df1('0x16')]||null:null,'include':_0x1c7709[_0x8df1('0x14')]?_0x1c7709[_0x8df1('0x14')][_0x8df1('0x17')]?_[_0x8df1('0x18')](_0x1c7709[_0x8df1('0x14')][_0x8df1('0x17')],function(_0x22bd23){return{'model':db[_0x22bd23[_0x8df1('0x19')]],'as':_0x22bd23['as'],'attributes':_0x22bd23['attributes'],'include':_0x22bd23['include']?_[_0x8df1('0x18')](_0x22bd23[_0x8df1('0x17')],function(_0x567367){return{'model':db[_0x567367['model']],'as':_0x567367['as'],'attributes':_0x567367[_0x8df1('0x1a')],'include':_0x567367['include']?_[_0x8df1('0x18')](_0x567367['include'],function(_0x20055b){return{'model':db[_0x20055b[_0x8df1('0x19')]],'as':_0x20055b['as'],'attributes':_0x20055b['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5dc718){logger[_0x8df1('0x11')](_0x8df1('0x1b'),_0x1c7709);logger[_0x8df1('0x1c')](_0x8df1('0x1b'),_0x1c7709,JSON[_0x8df1('0xc')](_0x5dc718));_0x111cc8(_0x5dc718);})['catch'](function(_0x5beb35){logger['error']('GetTrigger',_0x5beb35['message'],_0x1c7709);_0x67800c(_0x503795[_0x8df1('0xe')](0x1f4,_0x5beb35[_0x8df1('0x10')]));});});};exports['ShowTrigger']=function(_0x26c03c){var _0x2e0b41=this;return new Promise(function(_0x259d54,_0x4d50ca){return db[_0x8df1('0x13')][_0x8df1('0x1d')]({'raw':_0x26c03c[_0x8df1('0x14')]?_0x26c03c[_0x8df1('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x26c03c[_0x8df1('0x14')]?_0x26c03c[_0x8df1('0x14')][_0x8df1('0x1e')]||null:null,'attributes':_0x26c03c['options']?_0x26c03c[_0x8df1('0x14')][_0x8df1('0x1a')]||null:null,'include':_0x26c03c['options']?_0x26c03c[_0x8df1('0x14')][_0x8df1('0x17')]?_['map'](_0x26c03c[_0x8df1('0x14')][_0x8df1('0x17')],function(_0x2934cf){return{'model':db[_0x2934cf[_0x8df1('0x19')]],'as':_0x2934cf['as'],'attributes':_0x2934cf[_0x8df1('0x1a')],'include':_0x2934cf[_0x8df1('0x17')]?_['map'](_0x2934cf[_0x8df1('0x17')],function(_0x5ecd81){return{'model':db[_0x5ecd81[_0x8df1('0x19')]],'as':_0x5ecd81['as'],'attributes':_0x5ecd81[_0x8df1('0x1a')],'include':_0x5ecd81[_0x8df1('0x17')]?_[_0x8df1('0x18')](_0x5ecd81[_0x8df1('0x17')],function(_0x369896){return{'model':db[_0x369896[_0x8df1('0x19')]],'as':_0x369896['as'],'attributes':_0x369896[_0x8df1('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8df1('0x1f')](function(_0x293253){logger['info'](_0x8df1('0x20'),_0x26c03c);logger['debug'](_0x8df1('0x20'),_0x26c03c,JSON[_0x8df1('0xc')](_0x293253));_0x259d54(_0x293253);})[_0x8df1('0x21')](function(_0x3d8607){logger[_0x8df1('0xe')](_0x8df1('0x20'),_0x3d8607[_0x8df1('0x10')],_0x26c03c);_0x4d50ca(_0x2e0b41['error'](0x1f4,_0x3d8607[_0x8df1('0x10')]));});});}; \ No newline at end of file +var _0xb816=['request','then','info','Trigger,\x20%s,\x20%s','debug','Trigger,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','GetTrigger','Trigger','findAll','raw','options','where','limit','include','map','attributes','model','catch','ShowTrigger','find','stringify','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x16fc7f,_0x78f66){var _0x4a720a=function(_0x38197b){while(--_0x38197b){_0x16fc7f['push'](_0x16fc7f['shift']());}};_0x4a720a(++_0x78f66);}(_0xb816,0x89));var _0x6b81=function(_0x2246a8,_0x203e80){_0x2246a8=_0x2246a8-0x0;var _0x171534=_0xb816[_0x2246a8];return _0x171534;};'use strict';var _=require(_0x6b81('0x0'));var util=require('util');var moment=require(_0x6b81('0x1'));var BPromise=require(_0x6b81('0x2'));var rs=require(_0x6b81('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6b81('0x4'));var logger=require(_0x6b81('0x5'))(_0x6b81('0x6'));var config=require(_0x6b81('0x7'));var jayson=require(_0x6b81('0x8'));var client=jayson[_0x6b81('0x9')][_0x6b81('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c0ea5,_0x3fa54d,_0x6d2088){return new BPromise(function(_0x1b70bc,_0x3b87b3){return client[_0x6b81('0xb')](_0x4c0ea5,_0x6d2088)[_0x6b81('0xc')](function(_0x22a2a3){logger[_0x6b81('0xd')](_0x6b81('0xe'),_0x3fa54d,'request\x20sent');logger[_0x6b81('0xf')](_0x6b81('0x10'),_0x3fa54d,_0x6b81('0x11'),JSON['stringify'](_0x22a2a3));if(_0x22a2a3[_0x6b81('0x12')]){if(_0x22a2a3[_0x6b81('0x12')][_0x6b81('0x13')]===0x1f4){logger[_0x6b81('0x12')](_0x6b81('0xe'),_0x3fa54d,_0x22a2a3['error'][_0x6b81('0x14')]);return _0x3b87b3(_0x22a2a3[_0x6b81('0x12')][_0x6b81('0x14')]);}logger[_0x6b81('0x12')](_0x6b81('0xe'),_0x3fa54d,_0x22a2a3[_0x6b81('0x12')][_0x6b81('0x14')]);return _0x1b70bc(_0x22a2a3[_0x6b81('0x12')]['message']);}else{logger['info'](_0x6b81('0xe'),_0x3fa54d,'request\x20sent');_0x1b70bc(_0x22a2a3[_0x6b81('0x15')][_0x6b81('0x14')]);}})['catch'](function(_0x56d12b){logger[_0x6b81('0x12')](_0x6b81('0xe'),_0x3fa54d,_0x56d12b);_0x3b87b3(_0x56d12b);});});}exports[_0x6b81('0x16')]=function(_0x57b9ce){var _0x1b10ab=this;return new Promise(function(_0x2270f0,_0x27bbc8){return db[_0x6b81('0x17')][_0x6b81('0x18')]({'raw':_0x57b9ce['options']?_0x57b9ce['options'][_0x6b81('0x19')]===undefined?!![]:![]:!![],'where':_0x57b9ce[_0x6b81('0x1a')]?_0x57b9ce[_0x6b81('0x1a')][_0x6b81('0x1b')]||null:null,'attributes':_0x57b9ce[_0x6b81('0x1a')]?_0x57b9ce[_0x6b81('0x1a')]['attributes']||null:null,'limit':_0x57b9ce[_0x6b81('0x1a')]?_0x57b9ce[_0x6b81('0x1a')][_0x6b81('0x1c')]||null:null,'include':_0x57b9ce[_0x6b81('0x1a')]?_0x57b9ce['options'][_0x6b81('0x1d')]?_[_0x6b81('0x1e')](_0x57b9ce['options'][_0x6b81('0x1d')],function(_0x51b955){return{'model':db[_0x51b955['model']],'as':_0x51b955['as'],'attributes':_0x51b955[_0x6b81('0x1f')],'include':_0x51b955[_0x6b81('0x1d')]?_[_0x6b81('0x1e')](_0x51b955['include'],function(_0x333a7f){return{'model':db[_0x333a7f[_0x6b81('0x20')]],'as':_0x333a7f['as'],'attributes':_0x333a7f[_0x6b81('0x1f')],'include':_0x333a7f[_0x6b81('0x1d')]?_['map'](_0x333a7f[_0x6b81('0x1d')],function(_0x29aaa7){return{'model':db[_0x29aaa7['model']],'as':_0x29aaa7['as'],'attributes':_0x29aaa7[_0x6b81('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x6b81('0xc')](function(_0x318fc6){logger[_0x6b81('0xd')](_0x6b81('0x16'),_0x57b9ce);logger[_0x6b81('0xf')](_0x6b81('0x16'),_0x57b9ce,JSON['stringify'](_0x318fc6));_0x2270f0(_0x318fc6);})[_0x6b81('0x21')](function(_0x31d871){logger[_0x6b81('0x12')](_0x6b81('0x16'),_0x31d871[_0x6b81('0x14')],_0x57b9ce);_0x27bbc8(_0x1b10ab[_0x6b81('0x12')](0x1f4,_0x31d871['message']));});});};exports[_0x6b81('0x22')]=function(_0x3dfbc4){var _0x58810=this;return new Promise(function(_0x570f55,_0x127856){return db[_0x6b81('0x17')][_0x6b81('0x23')]({'raw':_0x3dfbc4['options']?_0x3dfbc4[_0x6b81('0x1a')][_0x6b81('0x19')]===undefined?!![]:![]:!![],'where':_0x3dfbc4['options']?_0x3dfbc4['options'][_0x6b81('0x1b')]||null:null,'attributes':_0x3dfbc4[_0x6b81('0x1a')]?_0x3dfbc4['options'][_0x6b81('0x1f')]||null:null,'include':_0x3dfbc4['options']?_0x3dfbc4[_0x6b81('0x1a')][_0x6b81('0x1d')]?_[_0x6b81('0x1e')](_0x3dfbc4[_0x6b81('0x1a')][_0x6b81('0x1d')],function(_0x2bd232){return{'model':db[_0x2bd232[_0x6b81('0x20')]],'as':_0x2bd232['as'],'attributes':_0x2bd232[_0x6b81('0x1f')],'include':_0x2bd232[_0x6b81('0x1d')]?_[_0x6b81('0x1e')](_0x2bd232[_0x6b81('0x1d')],function(_0x21d3d5){return{'model':db[_0x21d3d5[_0x6b81('0x20')]],'as':_0x21d3d5['as'],'attributes':_0x21d3d5[_0x6b81('0x1f')],'include':_0x21d3d5[_0x6b81('0x1d')]?_['map'](_0x21d3d5[_0x6b81('0x1d')],function(_0x4d66fa){return{'model':db[_0x4d66fa[_0x6b81('0x20')]],'as':_0x4d66fa['as'],'attributes':_0x4d66fa[_0x6b81('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x6b81('0xc')](function(_0x5b7b71){logger[_0x6b81('0xd')]('ShowTrigger',_0x3dfbc4);logger[_0x6b81('0xf')](_0x6b81('0x22'),_0x3dfbc4,JSON[_0x6b81('0x24')](_0x5b7b71));_0x570f55(_0x5b7b71);})['catch'](function(_0x5802e3){logger['error'](_0x6b81('0x22'),_0x5802e3[_0x6b81('0x14')],_0x3dfbc4);_0x127856(_0x58810['error'](0x1f4,_0x5802e3['message']));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index dc0b248..00cab14 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 _0xe908=['./trunk.controller','get','index','/:id','isAuthenticated','create','put','update','delete','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe908,0xf8));var _0x8e90=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xe908[_0x465a0c];return _0x1e202e;};'use strict';var multer=require(_0x8e90('0x0'));var util=require('util');var path=require(_0x8e90('0x1'));var timeout=require('connect-timeout');var express=require(_0x8e90('0x2'));var router=express[_0x8e90('0x3')]();var fs_extra=require(_0x8e90('0x4'));var auth=require(_0x8e90('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8e90('0x6'));var controller=require(_0x8e90('0x7'));router[_0x8e90('0x8')]('/',auth['isAuthenticated'](),controller[_0x8e90('0x9')]);router[_0x8e90('0x8')](_0x8e90('0xa'),auth[_0x8e90('0xb')](),controller['show']);router['post']('/:id/clone',auth[_0x8e90('0xb')](),controller['clone']);router['post']('/',auth[_0x8e90('0xb')](),controller[_0x8e90('0xc')]);router[_0x8e90('0xd')](_0x8e90('0xa'),auth[_0x8e90('0xb')](),controller[_0x8e90('0xe')]);router[_0x8e90('0xf')](_0x8e90('0xa'),auth[_0x8e90('0xb')](),controller['destroy']);module[_0x8e90('0x10')]=router; \ No newline at end of file +var _0xe961=['show','post','/:id/clone','put','update','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./trunk.controller','get','index','/:id','isAuthenticated'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xe961,0x113));var _0x1e96=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xe961[_0x134c2e];return _0x2825db;};'use strict';var multer=require(_0x1e96('0x0'));var util=require(_0x1e96('0x1'));var path=require(_0x1e96('0x2'));var timeout=require(_0x1e96('0x3'));var express=require(_0x1e96('0x4'));var router=express['Router']();var fs_extra=require(_0x1e96('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1e96('0x6'));var config=require(_0x1e96('0x7'));var controller=require(_0x1e96('0x8'));router[_0x1e96('0x9')]('/',auth['isAuthenticated'](),controller[_0x1e96('0xa')]);router[_0x1e96('0x9')](_0x1e96('0xb'),auth[_0x1e96('0xc')](),controller[_0x1e96('0xd')]);router[_0x1e96('0xe')](_0x1e96('0xf'),auth[_0x1e96('0xc')](),controller['clone']);router[_0x1e96('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1e96('0x10')](_0x1e96('0xb'),auth[_0x1e96('0xc')](),controller[_0x1e96('0x11')]);router['delete'](_0x1e96('0xb'),auth['isAuthenticated'](),controller['destroy']);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 fd6afd8..c6e8216 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 _0xfc59=['BOOLEAN','sequelize','exports','STRING','name','ENUM','friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','auto','yes','nonat','update','nat','join','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','refuse','originate','uac','uas','pai','fingerprint','certificate','active','dynamic','update,nonat'];(function(_0x43d11d,_0xccff91){var _0x38cd08=function(_0x131ae2){while(--_0x131ae2){_0x43d11d['push'](_0x43d11d['shift']());}};_0x38cd08(++_0xccff91);}(_0xfc59,0x1cc));var _0x9fc5=function(_0x3b09c7,_0x1584a1){_0x3b09c7=_0x3b09c7-0x0;var _0x3465a7=_0xfc59[_0x3b09c7];return _0x3465a7;};'use strict';var Sequelize=require(_0x9fc5('0x0'));module[_0x9fc5('0x1')]={'name':{'type':Sequelize[_0x9fc5('0x2')],'allowNull':![],'unique':_0x9fc5('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x9fc5('0x4')](_0x9fc5('0x5'),_0x9fc5('0x6'),_0x9fc5('0x7')),'allowNull':![],'defaultValue':_0x9fc5('0x5')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9fc5('0x8')},'callingpres':{'type':Sequelize[_0x9fc5('0x4')](_0x9fc5('0x9'),_0x9fc5('0xa'),'ALLOWED_FAILED_SCREEN',_0x9fc5('0xb'),_0x9fc5('0xc'),_0x9fc5('0xd'),_0x9fc5('0xe'),_0x9fc5('0xf'))},'deny':{'type':Sequelize[_0x9fc5('0x2')]},'permit':{'type':Sequelize[_0x9fc5('0x2')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0x9fc5('0x2')]},'transport':{'type':Sequelize[_0x9fc5('0x2')],'defaultValue':_0x9fc5('0x10'),'set':function(_0x435b06){this[_0x9fc5('0x11')](_0x9fc5('0x12'),_0x435b06?_0x435b06['join'](','):null);},'get':function(){return this[_0x9fc5('0x13')](_0x9fc5('0x12'))?this[_0x9fc5('0x13')]('transport')[_0x9fc5('0x14')](','):null;},'comment':_0x9fc5('0x15')},'dtmfmode':{'type':Sequelize[_0x9fc5('0x4')](_0x9fc5('0x16'),_0x9fc5('0x17'),_0x9fc5('0x18'),'inband',_0x9fc5('0x19')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x9fc5('0x4')](_0x9fc5('0x1a'),'no',_0x9fc5('0x1b'),_0x9fc5('0x1c'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x9fc5('0x4')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x9fc5('0x2')]},'directmediadeny':{'type':Sequelize[_0x9fc5('0x2')]},'nat':{'type':Sequelize['STRING'],'defaultValue':'force_rport,comedia','set':function(_0x1b12f4){this[_0x9fc5('0x11')](_0x9fc5('0x1d'),_0x1b12f4?_0x1b12f4[_0x9fc5('0x1e')](','):null);},'get':function(){return this[_0x9fc5('0x13')](_0x9fc5('0x1d'))?this[_0x9fc5('0x13')]('nat')['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x9fc5('0x2')]},'pickupgroup':{'type':Sequelize[_0x9fc5('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x9fc5('0x2')]},'language':{'type':Sequelize[_0x9fc5('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x9fc5('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x9fc5('0x2')],'defaultValue':_0x9fc5('0x1f')},'allow':{'type':Sequelize[_0x9fc5('0x2')],'allowNull':![],'defaultValue':_0x9fc5('0x20'),'set':function(_0x368912){this[_0x9fc5('0x11')]('allow',_0x368912?_0x368912[_0x9fc5('0x1e')](';'):_0x9fc5('0x20'));},'get':function(){return this[_0x9fc5('0x13')](_0x9fc5('0x21'))?this['getDataValue'](_0x9fc5('0x21'))[_0x9fc5('0x14')](';'):null;},'comment':_0x9fc5('0x22')},'autoframing':{'type':Sequelize['ENUM'](_0x9fc5('0x1a'),'no')},'insecure':{'type':Sequelize[_0x9fc5('0x2')],'defaultValue':_0x9fc5('0x23'),'set':function(_0x23b4c4){this[_0x9fc5('0x11')]('insecure',_0x23b4c4?_0x23b4c4[_0x9fc5('0x1e')](','):null);},'get':function(){return this[_0x9fc5('0x13')](_0x9fc5('0x24'))?this[_0x9fc5('0x13')](_0x9fc5('0x24'))[_0x9fc5('0x14')](','):null;},'comment':_0x9fc5('0x25')},'trustrpid':{'type':Sequelize[_0x9fc5('0x4')](_0x9fc5('0x1a'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x9fc5('0x4')](_0x9fc5('0x1a'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x9fc5('0x4')]('yes','no',_0x9fc5('0x26'))},'promiscredir':{'type':Sequelize[_0x9fc5('0x4')](_0x9fc5('0x1a'),'no')},'useclientcode':{'type':Sequelize[_0x9fc5('0x4')](_0x9fc5('0x1a'),'no')},'accountcode':{'type':Sequelize[_0x9fc5('0x27')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x9fc5('0x2')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x9fc5('0x2')]},'callcounter':{'type':Sequelize[_0x9fc5('0x4')](_0x9fc5('0x1a'),'no'),'defaultValue':_0x9fc5('0x1a')},'busylevel':{'type':Sequelize[_0x9fc5('0x27')](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0x9fc5('0x1a'),'no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0x9fc5('0x1a'),'no')},'allowtransfer':{'type':Sequelize[_0x9fc5('0x4')](_0x9fc5('0x1a'),'no')},'ignoresdpversion':{'type':Sequelize[_0x9fc5('0x4')]('yes','no')},'subscribecontext':{'type':Sequelize[_0x9fc5('0x2')]},'template':{'type':Sequelize[_0x9fc5('0x2')]},'videosupport':{'type':Sequelize[_0x9fc5('0x4')](_0x9fc5('0x1a'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x9fc5('0x27')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM']('yes','no')},'mailbox':{'type':Sequelize[_0x9fc5('0x2')]},'session_timers':{'type':Sequelize['ENUM']('accept',_0x9fc5('0x28'),_0x9fc5('0x29'))},'session_expires':{'type':Sequelize[_0x9fc5('0x27')](0xb)},'session_minse':{'type':Sequelize[_0x9fc5('0x27')](0xb)},'session_refresher':{'type':Sequelize[_0x9fc5('0x4')](_0x9fc5('0x2a'),_0x9fc5('0x2b')),'defaultValue':_0x9fc5('0x2b')},'t38pt_usertpsource':{'type':Sequelize[_0x9fc5('0x2')]},'regexten':{'type':Sequelize[_0x9fc5('0x2')]},'fromdomain':{'type':Sequelize[_0x9fc5('0x2')]},'fromuser':{'type':Sequelize[_0x9fc5('0x2')]},'port':{'type':Sequelize[_0x9fc5('0x27')](0x5)},'qualify':{'type':Sequelize[_0x9fc5('0x4')](_0x9fc5('0x1a'),'no'),'defaultValue':_0x9fc5('0x1a')},'keepalive':{'type':Sequelize[_0x9fc5('0x27')](0xb)},'defaultip':{'type':Sequelize[_0x9fc5('0x2')]},'defaultuser':{'type':Sequelize[_0x9fc5('0x2')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0x9fc5('0x27')](0xb)},'sendrpid':{'type':Sequelize[_0x9fc5('0x4')](_0x9fc5('0x1a'),'no',_0x9fc5('0x2c')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x9fc5('0x2')]},'callbackextension':{'type':Sequelize[_0x9fc5('0x2')]},'timert1':{'type':Sequelize[_0x9fc5('0x27')](0xb)},'timerb':{'type':Sequelize[_0x9fc5('0x27')](0xb)},'qualifyfreq':{'type':Sequelize[_0x9fc5('0x27')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0x9fc5('0x2')]},'contactacl':{'type':Sequelize[_0x9fc5('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0x9fc5('0x2')]},'use_q850_reason':{'type':Sequelize[_0x9fc5('0x2')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0x9fc5('0x4')](_0x9fc5('0x1a'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x9fc5('0x1a'),'no')},'force_avp':{'type':Sequelize[_0x9fc5('0x4')]('yes','no')},'icesupport':{'type':Sequelize[_0x9fc5('0x4')](_0x9fc5('0x1a'),'no')},'dtlsenable':{'type':Sequelize[_0x9fc5('0x4')]('yes','no')},'dtlsverify':{'type':Sequelize[_0x9fc5('0x4')]('yes','no',_0x9fc5('0x2d'),_0x9fc5('0x2e'))},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0x9fc5('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0x9fc5('0x2')]},'dtlscipher':{'type':Sequelize[_0x9fc5('0x2')]},'dtlscafile':{'type':Sequelize[_0x9fc5('0x2')]},'dtlscapath':{'type':Sequelize[_0x9fc5('0x2')]},'dtlssetup':{'type':Sequelize['ENUM'](_0x9fc5('0x2f'),'passive','actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x9fc5('0x2')]},'usereqphone':{'type':Sequelize[_0x9fc5('0x4')](_0x9fc5('0x1a'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x9fc5('0x2')]},'recordofffeature':{'type':Sequelize[_0x9fc5('0x2')]},'call_limit':{'type':Sequelize[_0x9fc5('0x27')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x9fc5('0x4')](_0x9fc5('0x1a'),'no')},'subscribemwi':{'type':Sequelize['ENUM'](_0x9fc5('0x1a'),'no')},'vmexten':{'type':Sequelize[_0x9fc5('0x2')]},'mohinterpret':{'type':Sequelize[_0x9fc5('0x2')]},'mohsuggest':{'type':Sequelize[_0x9fc5('0x2')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9fc5('0x2')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0x9fc5('0x30')},'canreinvite':{'type':Sequelize[_0x9fc5('0x4')]('yes','no',_0x9fc5('0x1b'),_0x9fc5('0x1c'),_0x9fc5('0x31')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0x9fc5('0x2')]},'active':{'type':Sequelize[_0x9fc5('0x32')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x9fc5('0x2')],'defaultValue':'no'}}; \ No newline at end of file +var _0xddfb=['rfc2833','inband','auto','nonat','update','yes','force_rport,comedia','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','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','accept','refuse','originate','uac','uas','pai','fingerprint','certificate','active','passive','actpass','dynamic','BOOLEAN','sequelize','exports','STRING','name','ENUM','friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','join','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'];(function(_0x2466d2,_0x529b06){var _0x3ed4ba=function(_0x348a75){while(--_0x348a75){_0x2466d2['push'](_0x2466d2['shift']());}};_0x3ed4ba(++_0x529b06);}(_0xddfb,0x1d9));var _0xbddf=function(_0x14a514,_0x38e923){_0x14a514=_0x14a514-0x0;var _0x4106b1=_0xddfb[_0x14a514];return _0x4106b1;};'use strict';var Sequelize=require(_0xbddf('0x0'));module[_0xbddf('0x1')]={'name':{'type':Sequelize[_0xbddf('0x2')],'allowNull':![],'unique':_0xbddf('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xbddf('0x4')](_0xbddf('0x5'),_0xbddf('0x6'),_0xbddf('0x7')),'allowNull':![],'defaultValue':_0xbddf('0x5')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xbddf('0x8')},'callingpres':{'type':Sequelize[_0xbddf('0x4')](_0xbddf('0x9'),_0xbddf('0xa'),_0xbddf('0xb'),_0xbddf('0xc'),'PROHIB_NOT_SCREENED',_0xbddf('0xd'),_0xbddf('0xe'),_0xbddf('0xf'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0xbddf('0x2')]},'secret':{'type':Sequelize[_0xbddf('0x2')]},'md5secret':{'type':Sequelize[_0xbddf('0x2')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0xbddf('0x2')],'defaultValue':_0xbddf('0x10'),'set':function(_0x3f5179){this[_0xbddf('0x11')](_0xbddf('0x12'),_0x3f5179?_0x3f5179[_0xbddf('0x13')](','):null);},'get':function(){return this[_0xbddf('0x14')](_0xbddf('0x12'))?this[_0xbddf('0x14')](_0xbddf('0x12'))['split'](','):null;},'comment':_0xbddf('0x15')},'dtmfmode':{'type':Sequelize[_0xbddf('0x4')](_0xbddf('0x16'),'info','shortinfo',_0xbddf('0x17'),_0xbddf('0x18')),'defaultValue':_0xbddf('0x16')},'directmedia':{'type':Sequelize[_0xbddf('0x4')]('yes','no',_0xbddf('0x19'),_0xbddf('0x1a'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xbddf('0x4')](_0xbddf('0x1b'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xbddf('0x2')]},'directmediadeny':{'type':Sequelize[_0xbddf('0x2')]},'nat':{'type':Sequelize['STRING'],'defaultValue':_0xbddf('0x1c'),'set':function(_0x527d6e){this[_0xbddf('0x11')]('nat',_0x527d6e?_0x527d6e['join'](','):null);},'get':function(){return this[_0xbddf('0x14')](_0xbddf('0x1d'))?this[_0xbddf('0x14')](_0xbddf('0x1d'))[_0xbddf('0x1e')](','):null;},'comment':_0xbddf('0x1f')},'callgroup':{'type':Sequelize[_0xbddf('0x2')]},'namedcallgroup':{'type':Sequelize[_0xbddf('0x2')]},'pickupgroup':{'type':Sequelize[_0xbddf('0x2')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xbddf('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xbddf('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xbddf('0x2')],'defaultValue':_0xbddf('0x20')},'allow':{'type':Sequelize[_0xbddf('0x2')],'allowNull':![],'defaultValue':_0xbddf('0x21'),'set':function(_0x370773){this[_0xbddf('0x11')]('allow',_0x370773?_0x370773[_0xbddf('0x13')](';'):_0xbddf('0x21'));},'get':function(){return this[_0xbddf('0x14')](_0xbddf('0x22'))?this[_0xbddf('0x14')](_0xbddf('0x22'))[_0xbddf('0x1e')](';'):null;},'comment':_0xbddf('0x23')},'autoframing':{'type':Sequelize[_0xbddf('0x4')](_0xbddf('0x1b'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0xbddf('0x24'),'set':function(_0x5878a6){this['setDataValue'](_0xbddf('0x25'),_0x5878a6?_0x5878a6[_0xbddf('0x13')](','):null);},'get':function(){return this[_0xbddf('0x14')](_0xbddf('0x25'))?this[_0xbddf('0x14')]('insecure')[_0xbddf('0x1e')](','):null;},'comment':_0xbddf('0x26')},'trustrpid':{'type':Sequelize[_0xbddf('0x4')](_0xbddf('0x1b'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xbddf('0x4')](_0xbddf('0x1b'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xbddf('0x4')](_0xbddf('0x1b'),'no',_0xbddf('0x27'))},'promiscredir':{'type':Sequelize['ENUM'](_0xbddf('0x1b'),'no')},'useclientcode':{'type':Sequelize[_0xbddf('0x4')]('yes','no')},'accountcode':{'type':Sequelize[_0xbddf('0x28')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xbddf('0x2')],'defaultValue':_0xbddf('0x29')},'amaflags':{'type':Sequelize[_0xbddf('0x2')]},'callcounter':{'type':Sequelize[_0xbddf('0x4')](_0xbddf('0x1b'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0xbddf('0x4')](_0xbddf('0x1b'),'no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0xbddf('0x1b'),'no')},'allowtransfer':{'type':Sequelize['ENUM'](_0xbddf('0x1b'),'no')},'ignoresdpversion':{'type':Sequelize[_0xbddf('0x4')]('yes','no')},'subscribecontext':{'type':Sequelize[_0xbddf('0x2')]},'template':{'type':Sequelize[_0xbddf('0x2')]},'videosupport':{'type':Sequelize[_0xbddf('0x4')](_0xbddf('0x1b'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xbddf('0x28')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0xbddf('0x1b'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0xbddf('0x4')](_0xbddf('0x2a'),_0xbddf('0x2b'),_0xbddf('0x2c'))},'session_expires':{'type':Sequelize[_0xbddf('0x28')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0xbddf('0x4')](_0xbddf('0x2d'),'uas'),'defaultValue':_0xbddf('0x2e')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0xbddf('0x2')]},'fromdomain':{'type':Sequelize[_0xbddf('0x2')]},'fromuser':{'type':Sequelize[_0xbddf('0x2')]},'port':{'type':Sequelize[_0xbddf('0x28')](0x5)},'qualify':{'type':Sequelize[_0xbddf('0x4')](_0xbddf('0x1b'),'no'),'defaultValue':_0xbddf('0x1b')},'keepalive':{'type':Sequelize[_0xbddf('0x28')](0xb)},'defaultip':{'type':Sequelize[_0xbddf('0x2')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0xbddf('0x28')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xbddf('0x28')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xbddf('0x28')](0xb)},'sendrpid':{'type':Sequelize[_0xbddf('0x4')](_0xbddf('0x1b'),'no',_0xbddf('0x2f')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize[_0xbddf('0x2')]},'timert1':{'type':Sequelize[_0xbddf('0x28')](0xb)},'timerb':{'type':Sequelize[_0xbddf('0x28')](0xb)},'qualifyfreq':{'type':Sequelize[_0xbddf('0x28')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0xbddf('0x2')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize['ENUM'](_0xbddf('0x1b'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xbddf('0x4')](_0xbddf('0x1b'),'no')},'force_avp':{'type':Sequelize[_0xbddf('0x4')](_0xbddf('0x1b'),'no')},'icesupport':{'type':Sequelize[_0xbddf('0x4')](_0xbddf('0x1b'),'no')},'dtlsenable':{'type':Sequelize[_0xbddf('0x4')]('yes','no')},'dtlsverify':{'type':Sequelize[_0xbddf('0x4')](_0xbddf('0x1b'),'no',_0xbddf('0x30'),_0xbddf('0x31'))},'dtlsrekey':{'type':Sequelize[_0xbddf('0x28')](0xb)},'dtlscertfile':{'type':Sequelize[_0xbddf('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0xbddf('0x2')]},'dtlscipher':{'type':Sequelize[_0xbddf('0x2')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0xbddf('0x2')]},'dtlssetup':{'type':Sequelize['ENUM'](_0xbddf('0x32'),_0xbddf('0x33'),_0xbddf('0x34')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xbddf('0x2')]},'usereqphone':{'type':Sequelize[_0xbddf('0x4')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xbddf('0x2')]},'recordofffeature':{'type':Sequelize[_0xbddf('0x2')]},'call_limit':{'type':Sequelize[_0xbddf('0x28')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xbddf('0x4')]('yes','no')},'subscribemwi':{'type':Sequelize[_0xbddf('0x4')](_0xbddf('0x1b'),'no')},'vmexten':{'type':Sequelize[_0xbddf('0x2')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0xbddf('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING'],'defaultValue':_0xbddf('0x35')},'canreinvite':{'type':Sequelize[_0xbddf('0x4')]('yes','no',_0xbddf('0x19'),'update','update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0xbddf('0x2')]},'otherFields':{'type':Sequelize[_0xbddf('0x2')]},'active':{'type':Sequelize[_0xbddf('0x36')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index ad38ae1..787ce89 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 _0x9bde=['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','../../config/license/util','../../mysqldb','client','request','then','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','get','Trunks','UserProfileResource','destroy','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','offset','order','sort','where','pick','filter','VIRTUAL','merge','Trunk','includeAll','findAll','rows','show','params','fields','include','options','clone','find','omit','createdAt','body','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','server/files/templates/registry.ejs','utf8','render','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','root','server/files/templates/trunk.ejs','writeFileSync','rimraf'];(function(_0xf15036,_0x52e137){var _0x2985dd=function(_0x2d2dca){while(--_0x2d2dca){_0xf15036['push'](_0xf15036['shift']());}};_0x2985dd(++_0x52e137);}(_0x9bde,0xe1));var _0xe9bd=function(_0x14b339,_0x2fb78e){_0x14b339=_0x14b339-0x0;var _0x4e68c1=_0x9bde[_0x14b339];return _0x4e68c1;};'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'];var jayson=require('jayson/promise');var client=jayson[_0xe9bd('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0x220d07,_0x429e88,_0x3435b4,_0x51109f){return new BPromise(function(_0x47ba5e,_0x46a95e){var _0x248818=_0x51109f||client;return _0x248818[_0xe9bd('0x1a')](_0x220d07,_0x3435b4)[_0xe9bd('0x1b')](function(_0x3360bd){logger[_0xe9bd('0x1c')](_0xe9bd('0x1d'),_0x429e88,'request\x20sent');logger[_0xe9bd('0x1e')](_0xe9bd('0x1f'),_0x429e88,_0xe9bd('0x20'),JSON['stringify'](_0x3360bd));if(_0x3360bd[_0xe9bd('0x21')]){if(_0x3360bd[_0xe9bd('0x21')][_0xe9bd('0x22')]===0x1f4){logger[_0xe9bd('0x21')]('Trunk,\x20%s,\x20%s',_0x429e88,_0x3360bd[_0xe9bd('0x21')]['message']);return _0x46a95e(_0x3360bd[_0xe9bd('0x21')]['message']);}logger[_0xe9bd('0x21')](_0xe9bd('0x1d'),_0x429e88,_0x3360bd[_0xe9bd('0x21')][_0xe9bd('0x23')]);return _0x47ba5e(_0x3360bd[_0xe9bd('0x21')][_0xe9bd('0x23')]);}else{logger[_0xe9bd('0x1c')]('Trunk,\x20%s,\x20%s',_0x429e88,_0xe9bd('0x20'));_0x47ba5e(_0x3360bd[_0xe9bd('0x24')]['message']);}})[_0xe9bd('0x25')](function(_0x505c23){logger[_0xe9bd('0x21')](_0xe9bd('0x1d'),_0x429e88,_0x505c23);_0x46a95e(_0x505c23);});});}function respondWithStatusCode(_0x36f8c0,_0xf02209){_0xf02209=_0xf02209||0xcc;return function(_0x5bc4bf){if(_0x5bc4bf){return _0x36f8c0[_0xe9bd('0x26')](_0xf02209);}return _0x36f8c0[_0xe9bd('0x27')](_0xf02209)[_0xe9bd('0x28')]();};}function respondWithResult(_0x39b206,_0x2641be){_0x2641be=_0x2641be||0xc8;return function(_0xb52d45){if(_0xb52d45){return _0x39b206[_0xe9bd('0x27')](_0x2641be)[_0xe9bd('0x29')](_0xb52d45);}};}function respondWithFilteredResult(_0x1ae889,_0x5987af){return function(_0x3c211a){if(_0x3c211a){var _0x38fdfa=typeof _0x5987af['offset']===_0xe9bd('0x2a')&&typeof _0x5987af[_0xe9bd('0x2b')]===_0xe9bd('0x2a');var _0x429055=_0x3c211a[_0xe9bd('0x2c')];var _0x183601=_0x38fdfa?0x0:_0x5987af['offset'];var _0x5b7f1d=_0x38fdfa?_0x3c211a[_0xe9bd('0x2c')]:_0x5987af['offset']+_0x5987af[_0xe9bd('0x2b')];var _0x1f2c0e;if(_0x5b7f1d>=_0x429055){_0x5b7f1d=_0x429055;_0x1f2c0e=0xc8;}else{_0x1f2c0e=0xce;}_0x1ae889[_0xe9bd('0x27')](_0x1f2c0e);return _0x1ae889[_0xe9bd('0x2d')](_0xe9bd('0x2e'),_0x183601+'-'+_0x5b7f1d+'/'+_0x429055)['json'](_0x3c211a);}return null;};}function patchUpdates(_0x4b7bc2){return function(_0x7f2c5){try{jsonpatch[_0xe9bd('0x2f')](_0x7f2c5,_0x4b7bc2,!![]);}catch(_0x3f96a0){return BPromise[_0xe9bd('0x30')](_0x3f96a0);}return _0x7f2c5[_0xe9bd('0x31')]();};}function saveUpdates(_0x1f0f9e,_0x3c31ee){return function(_0x66213a){if(_0x66213a){return _0x66213a[_0xe9bd('0x32')](_0x1f0f9e)['then'](function(_0x426004){return _0x426004;});}return null;};}function removeEntity(_0x81a31f,_0x390a43){return function(_0x5117bc){if(_0x5117bc){return _0x5117bc['destroy']()[_0xe9bd('0x1b')](function(){var _0x2e9593=_0x5117bc[_0xe9bd('0x33')]({'plain':!![]});var _0x3ed60a=_0xe9bd('0x34');return db[_0xe9bd('0x35')][_0xe9bd('0x36')]({'where':{'type':_0x3ed60a,'resourceId':_0x2e9593['id']}})[_0xe9bd('0x1b')](function(){return _0x5117bc;});})[_0xe9bd('0x1b')](function(){_0x81a31f[_0xe9bd('0x27')](0xcc)[_0xe9bd('0x28')]();});}};}function handleEntityNotFound(_0x549dd1,_0x2ad46e){return function(_0x199477){if(!_0x199477){_0x549dd1[_0xe9bd('0x26')](0x194);}return _0x199477;};}function handleError(_0x8ff624,_0x264ba0){_0x264ba0=_0x264ba0||0x1f4;return function(_0x147da5){logger['error'](_0x147da5[_0xe9bd('0x37')]);if(_0x147da5[_0xe9bd('0x38')]){delete _0x147da5['name'];}_0x8ff624[_0xe9bd('0x27')](_0x264ba0)[_0xe9bd('0x39')](_0x147da5);};}exports['index']=function(_0x4b1da0,_0x2785e6){var _0xdf43b9={},_0x4d2f3d={},_0x2d1289={'count':0x0,'rows':[]};var _0x3ea705=_[_0xe9bd('0x3a')](db['Trunk'][_0xe9bd('0x3b')],function(_0x4d1945){return{'name':_0x4d1945[_0xe9bd('0x3c')],'type':_0x4d1945[_0xe9bd('0x3d')][_0xe9bd('0x3e')]};});_0x4d2f3d[_0xe9bd('0x3f')]=_['map'](_0x3ea705,_0xe9bd('0x38'));_0x4d2f3d[_0xe9bd('0x40')]=_[_0xe9bd('0x41')](_0x4b1da0[_0xe9bd('0x40')]);_0x4d2f3d[_0xe9bd('0x42')]=_[_0xe9bd('0x43')](_0x4d2f3d[_0xe9bd('0x3f')],_0x4d2f3d[_0xe9bd('0x40')]);_0xdf43b9[_0xe9bd('0x44')]=_[_0xe9bd('0x43')](_0x4d2f3d['model'],qs['fields'](_0x4b1da0[_0xe9bd('0x40')]['fields']));_0xdf43b9[_0xe9bd('0x44')]=_0xdf43b9[_0xe9bd('0x44')][_0xe9bd('0x45')]?_0xdf43b9['attributes']:_0x4d2f3d[_0xe9bd('0x3f')];if(!_0x4b1da0[_0xe9bd('0x40')][_0xe9bd('0x46')]('nolimit')){_0xdf43b9[_0xe9bd('0x2b')]=qs[_0xe9bd('0x2b')](_0x4b1da0[_0xe9bd('0x40')][_0xe9bd('0x2b')]);_0xdf43b9[_0xe9bd('0x47')]=qs[_0xe9bd('0x47')](_0x4b1da0[_0xe9bd('0x40')][_0xe9bd('0x47')]);}_0xdf43b9[_0xe9bd('0x48')]=qs[_0xe9bd('0x49')](_0x4b1da0[_0xe9bd('0x40')][_0xe9bd('0x49')]);_0xdf43b9[_0xe9bd('0x4a')]=qs[_0xe9bd('0x42')](_[_0xe9bd('0x4b')](_0x4b1da0['query'],_0x4d2f3d['filters']),_0x3ea705);if(_0x4b1da0[_0xe9bd('0x40')][_0xe9bd('0x4c')]){_0xdf43b9[_0xe9bd('0x4a')]=_['merge'](_0xdf43b9['where'],{'$or':_[_0xe9bd('0x3a')](_0x3ea705,function(_0x3f6f22){if(_0x3f6f22[_0xe9bd('0x3d')]!==_0xe9bd('0x4d')){var _0x39fb61={};_0x39fb61[_0x3f6f22[_0xe9bd('0x38')]]={'$like':'%'+_0x4b1da0[_0xe9bd('0x40')]['filter']+'%'};return _0x39fb61;}})});}_0xdf43b9=_[_0xe9bd('0x4e')]({},_0xdf43b9,_0x4b1da0['options']);var _0x36726e={'where':_0xdf43b9[_0xe9bd('0x4a')]};return db[_0xe9bd('0x4f')][_0xe9bd('0x2c')](_0x36726e)[_0xe9bd('0x1b')](function(_0x4b7b67){_0x2d1289[_0xe9bd('0x2c')]=_0x4b7b67;if(_0x4b1da0[_0xe9bd('0x40')][_0xe9bd('0x50')]){_0xdf43b9['include']=[{'all':!![]}];}return db[_0xe9bd('0x4f')][_0xe9bd('0x51')](_0xdf43b9);})[_0xe9bd('0x1b')](function(_0x5a466b){_0x2d1289[_0xe9bd('0x52')]=_0x5a466b;return _0x2d1289;})[_0xe9bd('0x1b')](respondWithFilteredResult(_0x2785e6,_0xdf43b9))[_0xe9bd('0x25')](handleError(_0x2785e6,null));};exports[_0xe9bd('0x53')]=function(_0x1ee09c,_0x579d26){var _0x3f4833={'raw':![],'where':{'id':_0x1ee09c[_0xe9bd('0x54')]['id']}},_0x4b8ff9={};_0x4b8ff9[_0xe9bd('0x3f')]=_[_0xe9bd('0x41')](db[_0xe9bd('0x4f')][_0xe9bd('0x3b')]);_0x4b8ff9['query']=_[_0xe9bd('0x41')](_0x1ee09c['query']);_0x4b8ff9[_0xe9bd('0x42')]=_[_0xe9bd('0x43')](_0x4b8ff9['model'],_0x4b8ff9['query']);_0x3f4833[_0xe9bd('0x44')]=_['intersection'](_0x4b8ff9[_0xe9bd('0x3f')],qs['fields'](_0x1ee09c[_0xe9bd('0x40')][_0xe9bd('0x55')]));_0x3f4833['attributes']=_0x3f4833[_0xe9bd('0x44')]['length']?_0x3f4833[_0xe9bd('0x44')]:_0x4b8ff9[_0xe9bd('0x3f')];if(_0x1ee09c[_0xe9bd('0x40')]['includeAll']){_0x3f4833[_0xe9bd('0x56')]=[{'all':!![]}];}_0x3f4833=_[_0xe9bd('0x4e')]({},_0x3f4833,_0x1ee09c[_0xe9bd('0x57')]);return db[_0xe9bd('0x4f')]['find'](_0x3f4833)['then'](handleEntityNotFound(_0x579d26,null))[_0xe9bd('0x1b')](respondWithResult(_0x579d26,null))['catch'](handleError(_0x579d26,null));};exports[_0xe9bd('0x58')]=function(_0x3c33b8,_0xc7dd2f){var _0xc818b4={'where':{'id':_0x3c33b8[_0xe9bd('0x54')]['id']}},_0x159f68={};_0x159f68[_0xe9bd('0x3f')]=_[_0xe9bd('0x41')](db[_0xe9bd('0x4f')][_0xe9bd('0x3b')]);_0xc818b4[_0xe9bd('0x44')]=_[_0xe9bd('0x43')](_0x159f68['model'],qs['fields'](_0x3c33b8['query'][_0xe9bd('0x55')]));_0xc818b4['attributes']=_0xc818b4[_0xe9bd('0x44')][_0xe9bd('0x45')]?_0xc818b4[_0xe9bd('0x44')]:_0x159f68[_0xe9bd('0x3f')];if(_0x3c33b8[_0xe9bd('0x40')][_0xe9bd('0x50')]){_0xc818b4[_0xe9bd('0x56')]=[{'all':!![]}];}_0xc818b4=_[_0xe9bd('0x4e')]({},_0xc818b4,_0x3c33b8[_0xe9bd('0x57')]);return db['Trunk'][_0xe9bd('0x59')](_0xc818b4)[_0xe9bd('0x1b')](handleEntityNotFound(_0xc7dd2f,null))[_0xe9bd('0x1b')](function(_0x3f848d){if(_0x3f848d){var _0x4d58c1=_0x3f848d[_0xe9bd('0x33')]({'plain':!![]});_0x4d58c1=qs[_0xe9bd('0x5a')](_0x4d58c1,['id',_0xe9bd('0x5b'),'updatedAt']);_0x3c33b8[_0xe9bd('0x5c')]=_[_0xe9bd('0x5a')](_0x3c33b8[_0xe9bd('0x5c')],['id',_0xe9bd('0x5b'),'updatedAt']);return db['Trunk'][_0xe9bd('0x5d')](_[_0xe9bd('0x4e')](_0x4d58c1,_0x3c33b8[_0xe9bd('0x5c')]),{'include':_0x3c33b8[_0xe9bd('0x40')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x305efa){var _0x20855b=_0x3c33b8[_0xe9bd('0x5e')][_0xe9bd('0x33')]({'plain':!![]});if(!_0x20855b)throw new Error(_0xe9bd('0x5f'));if(_0x20855b[_0xe9bd('0x60')]==='user'){var _0x179c8d=_0x305efa['get']({'plain':!![]});var _0x27e07c=_0xe9bd('0x34');return db[_0xe9bd('0x61')][_0xe9bd('0x59')]({'where':{'name':_0x27e07c,'userProfileId':_0x20855b['userProfileId']},'raw':!![]})[_0xe9bd('0x1b')](function(_0x263ad9){if(_0x263ad9&&_0x263ad9[_0xe9bd('0x62')]===0x0){return db['UserProfileResource'][_0xe9bd('0x5d')]({'name':_0x179c8d[_0xe9bd('0x38')],'resourceId':_0x179c8d['id'],'type':_0x263ad9[_0xe9bd('0x38')],'sectionId':_0x263ad9['id']},{})[_0xe9bd('0x1b')](function(){return _0x305efa;});}else{return _0x305efa;}})[_0xe9bd('0x25')](function(_0x16b66c){logger[_0xe9bd('0x21')](_0xe9bd('0x63'),_0x16b66c);throw _0x16b66c;});}return _0x305efa;});}})[_0xe9bd('0x1b')](respondWithResult(_0xc7dd2f,0xc9))[_0xe9bd('0x25')](handleError(_0xc7dd2f,null));};exports[_0xe9bd('0x5d')]=function(_0x37d07a,_0x5d1e4b,_0x3a12e9){var _0x9d0603;return db['Trunk'][_0xe9bd('0x5d')](_0x37d07a[_0xe9bd('0x5c')],{'raw':!![]})['then'](function(_0x561165){_0x9d0603=_0x561165;return db[_0xe9bd('0x4f')][_0xe9bd('0x51')]({'raw':!![]});})['then'](function(_0x4ec8be){var _0x4a6422=fs[_0xe9bd('0x64')](path['join'](config['root'],'server/files/templates/trunk.ejs'),'utf8');var _0x1fc88d=fs[_0xe9bd('0x64')](path[_0xe9bd('0x65')](config['root'],_0xe9bd('0x66')),_0xe9bd('0x67'));var _0x337284=ejs[_0xe9bd('0x68')](_0x4a6422,{'trunks':_0x4ec8be||[]});fs['writeFileSync'](_0xe9bd('0x69'),_0x337284);if(_0x9d0603[_0xe9bd('0x6a')]){var _0x11ebcb=ejs['render'](_0x1fc88d,{'trunks':_0x4ec8be||[]});fs['writeFileSync'](_0xe9bd('0x6b'),_0x11ebcb);}})[_0xe9bd('0x1b')](function(){return respondWithRpcPromise(_0xe9bd('0x6c'),_0xe9bd('0x5d'),{'module':_0xe9bd('0x6d')});})[_0xe9bd('0x1b')](function(){var _0x3fda4c=_0x37d07a[_0xe9bd('0x5e')]['get']({'plain':!![]});if(!_0x3fda4c)throw new Error(_0xe9bd('0x5f'));if(_0x3fda4c[_0xe9bd('0x60')]===_0xe9bd('0x5e')){var _0x3db47a=_0x9d0603[_0xe9bd('0x33')]({'plain':!![]});return db['UserProfileSection'][_0xe9bd('0x59')]({'where':{'name':'Trunks','userProfileId':_0x3fda4c['userProfileId']},'raw':!![]})[_0xe9bd('0x1b')](function(_0x4496e3){if(_0x4496e3&&_0x4496e3['autoAssociation']===0x0){return db[_0xe9bd('0x35')][_0xe9bd('0x5d')]({'name':_0x3db47a[_0xe9bd('0x38')],'resourceId':_0x3db47a['id'],'type':_0x4496e3[_0xe9bd('0x38')],'sectionId':_0x4496e3['id']},{})['then'](function(){return _0x9d0603;});}else{return _0x9d0603;}})[_0xe9bd('0x25')](function(_0x41fb41){logger['error'](_0xe9bd('0x63'),_0x41fb41);throw _0x41fb41;});}return _0x9d0603;})[_0xe9bd('0x1b')](respondWithResult(_0x5d1e4b,0xc9))[_0xe9bd('0x25')](handleError(_0x5d1e4b,null));};exports[_0xe9bd('0x32')]=function(_0x2e63c7,_0x1a36aa,_0x466a89){var _0x5e127b;return db[_0xe9bd('0x4f')][_0xe9bd('0x59')]({'where':{'id':_0x2e63c7[_0xe9bd('0x54')]['id']}})[_0xe9bd('0x1b')](handleEntityNotFound(_0x1a36aa,null))[_0xe9bd('0x1b')](saveUpdates(_0x2e63c7[_0xe9bd('0x5c')],null))[_0xe9bd('0x1b')](function(_0x2adc49){if(_0x2adc49){_0x5e127b=_0x2adc49;return db[_0xe9bd('0x4f')]['findAll']({'raw':!![]});}})[_0xe9bd('0x1b')](function(_0x466952){if(_0x466952){var _0x256890=fs[_0xe9bd('0x64')](path[_0xe9bd('0x65')](config[_0xe9bd('0x6e')],_0xe9bd('0x6f')),'utf8');var _0x18519d=fs[_0xe9bd('0x64')](path['join'](config[_0xe9bd('0x6e')],_0xe9bd('0x66')),_0xe9bd('0x67'));var _0x2083c4=ejs[_0xe9bd('0x68')](_0x256890,{'trunks':_0x466952||[]});fs[_0xe9bd('0x70')](_0xe9bd('0x69'),_0x2083c4);var _0x4f3dc6=ejs['render'](_0x18519d,{'trunks':_0x466952||[]});fs[_0xe9bd('0x70')](_0xe9bd('0x6b'),_0x4f3dc6);return respondWithRpcPromise(_0xe9bd('0x6c'),_0xe9bd('0x32'),{'module':_0xe9bd('0x6d')});}return null;})[_0xe9bd('0x1b')](function(_0x1b46f4){if(_0x1b46f4){return _0x5e127b;}})['then'](respondWithResult(_0x1a36aa,null))[_0xe9bd('0x25')](handleError(_0x1a36aa,null));};exports[_0xe9bd('0x36')]=function(_0x29833b,_0x256862,_0x14cdd5){var _0x74063;return db[_0xe9bd('0x4f')]['find']({'where':{'id':_0x29833b['params']['id']}})['then'](handleEntityNotFound(_0x256862,null))[_0xe9bd('0x1b')](removeEntity(_0x256862,null))['then'](function(){return db['Trunk']['findAll']({'raw':!![]});})[_0xe9bd('0x1b')](function(_0x402ab2){var _0xf170d4=fs[_0xe9bd('0x64')](path[_0xe9bd('0x65')](config[_0xe9bd('0x6e')],_0xe9bd('0x6f')),_0xe9bd('0x67'));var _0x14ec42=fs['readFileSync'](path[_0xe9bd('0x65')](config['root'],_0xe9bd('0x66')),_0xe9bd('0x67'));var _0x22c67f=ejs[_0xe9bd('0x68')](_0xf170d4,{'trunks':_0x402ab2});var _0x416938=ejs['render'](_0x14ec42,{'trunks':_0x402ab2});fs['writeFileSync']('/etc/asterisk/sip_xcally_trunks.conf',_0x22c67f);fs[_0xe9bd('0x70')](_0xe9bd('0x6b'),_0x416938);return respondWithRpcPromise('Reload',_0xe9bd('0x36'),{'module':_0xe9bd('0x6d')});})[_0xe9bd('0x25')](handleError(_0x256862,null));}; \ No newline at end of file +var _0x9957=['clone','includeAll','merge','get','omit','createdAt','updatedAt','body','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findAll','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','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','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','update','destroy','Trunks','stack','name','send','map','Trunk','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','type','filter','options','include','rows','show','params','find'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];var jayson=require(_0x7995('0x1b'));var client=jayson[_0x7995('0x1c')][_0x7995('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x23999f,_0x2bbe7a,_0x4cc004,_0x58f5ad){return new BPromise(function(_0x2b4e94,_0x2233dd){var _0x24b5bb=_0x58f5ad||client;return _0x24b5bb[_0x7995('0x1e')](_0x23999f,_0x4cc004)[_0x7995('0x1f')](function(_0x1a5310){logger[_0x7995('0x20')](_0x7995('0x21'),_0x2bbe7a,'request\x20sent');logger[_0x7995('0x22')]('Trunk,\x20%s,\x20%s,\x20%s',_0x2bbe7a,_0x7995('0x23'),JSON[_0x7995('0x24')](_0x1a5310));if(_0x1a5310[_0x7995('0x25')]){if(_0x1a5310[_0x7995('0x25')][_0x7995('0x26')]===0x1f4){logger[_0x7995('0x25')]('Trunk,\x20%s,\x20%s',_0x2bbe7a,_0x1a5310['error'][_0x7995('0x27')]);return _0x2233dd(_0x1a5310['error']['message']);}logger[_0x7995('0x25')](_0x7995('0x21'),_0x2bbe7a,_0x1a5310['error'][_0x7995('0x27')]);return _0x2b4e94(_0x1a5310['error']['message']);}else{logger[_0x7995('0x20')](_0x7995('0x21'),_0x2bbe7a,_0x7995('0x23'));_0x2b4e94(_0x1a5310[_0x7995('0x28')][_0x7995('0x27')]);}})[_0x7995('0x29')](function(_0x5d40ae){logger[_0x7995('0x25')](_0x7995('0x21'),_0x2bbe7a,_0x5d40ae);_0x2233dd(_0x5d40ae);});});}function respondWithStatusCode(_0x204507,_0x285437){_0x285437=_0x285437||0xcc;return function(_0x563799){if(_0x563799){return _0x204507[_0x7995('0x2a')](_0x285437);}return _0x204507[_0x7995('0x2b')](_0x285437)[_0x7995('0x2c')]();};}function respondWithResult(_0x59405a,_0x39df42){_0x39df42=_0x39df42||0xc8;return function(_0x34e70c){if(_0x34e70c){return _0x59405a[_0x7995('0x2b')](_0x39df42)[_0x7995('0x2d')](_0x34e70c);}};}function respondWithFilteredResult(_0x3a3fcf,_0x2a307e){return function(_0x56691a){if(_0x56691a){var _0x47625f=typeof _0x2a307e['offset']===_0x7995('0x2e')&&typeof _0x2a307e[_0x7995('0x2f')]===_0x7995('0x2e');var _0x132a42=_0x56691a[_0x7995('0x30')];var _0x4b6f99=_0x47625f?0x0:_0x2a307e[_0x7995('0x31')];var _0x514445=_0x47625f?_0x56691a[_0x7995('0x30')]:_0x2a307e[_0x7995('0x31')]+_0x2a307e[_0x7995('0x2f')];var _0x574574;if(_0x514445>=_0x132a42){_0x514445=_0x132a42;_0x574574=0xc8;}else{_0x574574=0xce;}_0x3a3fcf['status'](_0x574574);return _0x3a3fcf['set'](_0x7995('0x32'),_0x4b6f99+'-'+_0x514445+'/'+_0x132a42)[_0x7995('0x2d')](_0x56691a);}return null;};}function patchUpdates(_0x327a81){return function(_0x2b874d){try{jsonpatch[_0x7995('0x33')](_0x2b874d,_0x327a81,!![]);}catch(_0x1ca460){return BPromise['reject'](_0x1ca460);}return _0x2b874d['save']();};}function saveUpdates(_0xfa8f15,_0x5524af){return function(_0x553671){if(_0x553671){return _0x553671[_0x7995('0x34')](_0xfa8f15)[_0x7995('0x1f')](function(_0x1e9fa4){return _0x1e9fa4;});}return null;};}function removeEntity(_0x1f7d27,_0x510841){return function(_0x44309d){if(_0x44309d){return _0x44309d[_0x7995('0x35')]()['then'](function(){var _0x48db25=_0x44309d['get']({'plain':!![]});var _0x45bc5e=_0x7995('0x36');return db['UserProfileResource'][_0x7995('0x35')]({'where':{'type':_0x45bc5e,'resourceId':_0x48db25['id']}})['then'](function(){return _0x44309d;});})[_0x7995('0x1f')](function(){_0x1f7d27[_0x7995('0x2b')](0xcc)[_0x7995('0x2c')]();});}};}function handleEntityNotFound(_0x5014d2,_0x52d76d){return function(_0x36d057){if(!_0x36d057){_0x5014d2['sendStatus'](0x194);}return _0x36d057;};}function handleError(_0x5d2428,_0x3e99cd){_0x3e99cd=_0x3e99cd||0x1f4;return function(_0xe328b1){logger['error'](_0xe328b1[_0x7995('0x37')]);if(_0xe328b1[_0x7995('0x38')]){delete _0xe328b1[_0x7995('0x38')];}_0x5d2428[_0x7995('0x2b')](_0x3e99cd)[_0x7995('0x39')](_0xe328b1);};}exports['index']=function(_0x2d4285,_0x242713){var _0xf612e6={},_0x1d60b8={},_0x4b1541={'count':0x0,'rows':[]};var _0x2be2c0=_[_0x7995('0x3a')](db[_0x7995('0x3b')][_0x7995('0x3c')],function(_0x1f5bee){return{'name':_0x1f5bee[_0x7995('0x3d')],'type':_0x1f5bee['type'][_0x7995('0x3e')]};});_0x1d60b8[_0x7995('0x3f')]=_[_0x7995('0x3a')](_0x2be2c0,_0x7995('0x38'));_0x1d60b8[_0x7995('0x40')]=_[_0x7995('0x41')](_0x2d4285[_0x7995('0x40')]);_0x1d60b8[_0x7995('0x42')]=_[_0x7995('0x43')](_0x1d60b8[_0x7995('0x3f')],_0x1d60b8[_0x7995('0x40')]);_0xf612e6[_0x7995('0x44')]=_[_0x7995('0x43')](_0x1d60b8['model'],qs['fields'](_0x2d4285[_0x7995('0x40')][_0x7995('0x45')]));_0xf612e6['attributes']=_0xf612e6['attributes'][_0x7995('0x46')]?_0xf612e6['attributes']:_0x1d60b8['model'];if(!_0x2d4285[_0x7995('0x40')][_0x7995('0x47')](_0x7995('0x48'))){_0xf612e6['limit']=qs[_0x7995('0x2f')](_0x2d4285['query'][_0x7995('0x2f')]);_0xf612e6['offset']=qs['offset'](_0x2d4285[_0x7995('0x40')][_0x7995('0x31')]);}_0xf612e6[_0x7995('0x49')]=qs[_0x7995('0x4a')](_0x2d4285['query'][_0x7995('0x4a')]);_0xf612e6[_0x7995('0x4b')]=qs[_0x7995('0x42')](_[_0x7995('0x4c')](_0x2d4285['query'],_0x1d60b8['filters']),_0x2be2c0);if(_0x2d4285[_0x7995('0x40')]['filter']){_0xf612e6[_0x7995('0x4b')]=_['merge'](_0xf612e6[_0x7995('0x4b')],{'$or':_['map'](_0x2be2c0,function(_0x1e795e){if(_0x1e795e[_0x7995('0x4d')]!=='VIRTUAL'){var _0x3e9e62={};_0x3e9e62[_0x1e795e[_0x7995('0x38')]]={'$like':'%'+_0x2d4285[_0x7995('0x40')][_0x7995('0x4e')]+'%'};return _0x3e9e62;}})});}_0xf612e6=_['merge']({},_0xf612e6,_0x2d4285[_0x7995('0x4f')]);var _0x3e787d={'where':_0xf612e6[_0x7995('0x4b')]};return db['Trunk'][_0x7995('0x30')](_0x3e787d)[_0x7995('0x1f')](function(_0x511567){_0x4b1541[_0x7995('0x30')]=_0x511567;if(_0x2d4285[_0x7995('0x40')]['includeAll']){_0xf612e6[_0x7995('0x50')]=[{'all':!![]}];}return db[_0x7995('0x3b')]['findAll'](_0xf612e6);})[_0x7995('0x1f')](function(_0x5843ba){_0x4b1541[_0x7995('0x51')]=_0x5843ba;return _0x4b1541;})[_0x7995('0x1f')](respondWithFilteredResult(_0x242713,_0xf612e6))[_0x7995('0x29')](handleError(_0x242713,null));};exports[_0x7995('0x52')]=function(_0xddf537,_0x14b537){var _0x1579b9={'raw':![],'where':{'id':_0xddf537[_0x7995('0x53')]['id']}},_0x4d46bc={};_0x4d46bc[_0x7995('0x3f')]=_[_0x7995('0x41')](db['Trunk'][_0x7995('0x3c')]);_0x4d46bc[_0x7995('0x40')]=_[_0x7995('0x41')](_0xddf537['query']);_0x4d46bc['filters']=_['intersection'](_0x4d46bc[_0x7995('0x3f')],_0x4d46bc[_0x7995('0x40')]);_0x1579b9['attributes']=_[_0x7995('0x43')](_0x4d46bc[_0x7995('0x3f')],qs[_0x7995('0x45')](_0xddf537[_0x7995('0x40')][_0x7995('0x45')]));_0x1579b9['attributes']=_0x1579b9[_0x7995('0x44')]['length']?_0x1579b9[_0x7995('0x44')]:_0x4d46bc[_0x7995('0x3f')];if(_0xddf537[_0x7995('0x40')]['includeAll']){_0x1579b9['include']=[{'all':!![]}];}_0x1579b9=_['merge']({},_0x1579b9,_0xddf537['options']);return db[_0x7995('0x3b')][_0x7995('0x54')](_0x1579b9)[_0x7995('0x1f')](handleEntityNotFound(_0x14b537,null))[_0x7995('0x1f')](respondWithResult(_0x14b537,null))[_0x7995('0x29')](handleError(_0x14b537,null));};exports[_0x7995('0x55')]=function(_0x1f4270,_0xda6ce8){var _0x328671={'where':{'id':_0x1f4270[_0x7995('0x53')]['id']}},_0x17ecd3={};_0x17ecd3[_0x7995('0x3f')]=_[_0x7995('0x41')](db[_0x7995('0x3b')][_0x7995('0x3c')]);_0x328671[_0x7995('0x44')]=_[_0x7995('0x43')](_0x17ecd3[_0x7995('0x3f')],qs[_0x7995('0x45')](_0x1f4270['query'][_0x7995('0x45')]));_0x328671[_0x7995('0x44')]=_0x328671[_0x7995('0x44')][_0x7995('0x46')]?_0x328671['attributes']:_0x17ecd3['model'];if(_0x1f4270[_0x7995('0x40')][_0x7995('0x56')]){_0x328671[_0x7995('0x50')]=[{'all':!![]}];}_0x328671=_[_0x7995('0x57')]({},_0x328671,_0x1f4270['options']);return db[_0x7995('0x3b')][_0x7995('0x54')](_0x328671)[_0x7995('0x1f')](handleEntityNotFound(_0xda6ce8,null))[_0x7995('0x1f')](function(_0x502d43){if(_0x502d43){var _0x5e2d97=_0x502d43[_0x7995('0x58')]({'plain':!![]});_0x5e2d97=qs[_0x7995('0x59')](_0x5e2d97,['id',_0x7995('0x5a'),_0x7995('0x5b')]);_0x1f4270[_0x7995('0x5c')]=_[_0x7995('0x59')](_0x1f4270[_0x7995('0x5c')],['id',_0x7995('0x5a'),_0x7995('0x5b')]);return db['Trunk'][_0x7995('0x5d')](_[_0x7995('0x57')](_0x5e2d97,_0x1f4270[_0x7995('0x5c')]),{'include':_0x1f4270[_0x7995('0x40')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x3053fd){var _0xebb5c8=_0x1f4270['user'][_0x7995('0x58')]({'plain':!![]});if(!_0xebb5c8)throw new Error(_0x7995('0x5e'));if(_0xebb5c8[_0x7995('0x5f')]===_0x7995('0x60')){var _0x32cb04=_0x3053fd['get']({'plain':!![]});var _0x457d09='Trunks';return db[_0x7995('0x61')][_0x7995('0x54')]({'where':{'name':_0x457d09,'userProfileId':_0xebb5c8[_0x7995('0x62')]},'raw':!![]})[_0x7995('0x1f')](function(_0x4388c1){if(_0x4388c1&&_0x4388c1[_0x7995('0x63')]===0x0){return db[_0x7995('0x64')][_0x7995('0x5d')]({'name':_0x32cb04[_0x7995('0x38')],'resourceId':_0x32cb04['id'],'type':_0x4388c1[_0x7995('0x38')],'sectionId':_0x4388c1['id']},{})[_0x7995('0x1f')](function(){return _0x3053fd;});}else{return _0x3053fd;}})[_0x7995('0x29')](function(_0x56eb85){logger[_0x7995('0x25')](_0x7995('0x65'),_0x56eb85);throw _0x56eb85;});}return _0x3053fd;});}})[_0x7995('0x1f')](respondWithResult(_0xda6ce8,0xc9))[_0x7995('0x29')](handleError(_0xda6ce8,null));};exports[_0x7995('0x5d')]=function(_0x54a2e0,_0x4b54f2,_0x268fde){var _0x87e38d;return db[_0x7995('0x3b')][_0x7995('0x5d')](_0x54a2e0['body'],{'raw':!![]})[_0x7995('0x1f')](function(_0x50a12e){_0x87e38d=_0x50a12e;return db['Trunk'][_0x7995('0x66')]({'raw':!![]});})[_0x7995('0x1f')](function(_0x3f0a71){var _0x44bf2b=fs[_0x7995('0x67')](path[_0x7995('0x68')](config[_0x7995('0x69')],_0x7995('0x6a')),_0x7995('0x6b'));var _0x2466df=fs['readFileSync'](path[_0x7995('0x68')](config[_0x7995('0x69')],_0x7995('0x6c')),'utf8');var _0x1fe1cb=ejs[_0x7995('0x6d')](_0x44bf2b,{'trunks':_0x3f0a71||[]});fs[_0x7995('0x6e')](_0x7995('0x6f'),_0x1fe1cb);if(_0x87e38d[_0x7995('0x70')]){var _0x51ab1e=ejs[_0x7995('0x6d')](_0x2466df,{'trunks':_0x3f0a71||[]});fs[_0x7995('0x6e')](_0x7995('0x71'),_0x51ab1e);}})[_0x7995('0x1f')](function(){return respondWithRpcPromise(_0x7995('0x72'),'create',{'module':'chan_sip.so'});})[_0x7995('0x1f')](function(){var _0xfe1105=_0x54a2e0[_0x7995('0x60')][_0x7995('0x58')]({'plain':!![]});if(!_0xfe1105)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xfe1105[_0x7995('0x5f')]===_0x7995('0x60')){var _0x54b955=_0x87e38d['get']({'plain':!![]});return db[_0x7995('0x61')][_0x7995('0x54')]({'where':{'name':'Trunks','userProfileId':_0xfe1105[_0x7995('0x62')]},'raw':!![]})['then'](function(_0x3758f9){if(_0x3758f9&&_0x3758f9[_0x7995('0x63')]===0x0){return db['UserProfileResource']['create']({'name':_0x54b955[_0x7995('0x38')],'resourceId':_0x54b955['id'],'type':_0x3758f9['name'],'sectionId':_0x3758f9['id']},{})[_0x7995('0x1f')](function(){return _0x87e38d;});}else{return _0x87e38d;}})[_0x7995('0x29')](function(_0x3dd197){logger[_0x7995('0x25')](_0x7995('0x65'),_0x3dd197);throw _0x3dd197;});}return _0x87e38d;})[_0x7995('0x1f')](respondWithResult(_0x4b54f2,0xc9))[_0x7995('0x29')](handleError(_0x4b54f2,null));};exports[_0x7995('0x34')]=function(_0x29e0ee,_0x117317,_0x1ab590){var _0x16108c;return db[_0x7995('0x3b')][_0x7995('0x54')]({'where':{'id':_0x29e0ee[_0x7995('0x53')]['id']}})[_0x7995('0x1f')](handleEntityNotFound(_0x117317,null))[_0x7995('0x1f')](saveUpdates(_0x29e0ee[_0x7995('0x5c')],null))[_0x7995('0x1f')](function(_0xa2fc8e){if(_0xa2fc8e){_0x16108c=_0xa2fc8e;return db[_0x7995('0x3b')][_0x7995('0x66')]({'raw':!![]});}})[_0x7995('0x1f')](function(_0x280fbb){if(_0x280fbb){var _0x260ef1=fs[_0x7995('0x67')](path[_0x7995('0x68')](config[_0x7995('0x69')],'server/files/templates/trunk.ejs'),_0x7995('0x6b'));var _0x10f4ca=fs['readFileSync'](path['join'](config[_0x7995('0x69')],_0x7995('0x6c')),_0x7995('0x6b'));var _0x38acda=ejs[_0x7995('0x6d')](_0x260ef1,{'trunks':_0x280fbb||[]});fs[_0x7995('0x6e')]('/etc/asterisk/sip_xcally_trunks.conf',_0x38acda);var _0x2f8a2d=ejs[_0x7995('0x6d')](_0x10f4ca,{'trunks':_0x280fbb||[]});fs[_0x7995('0x6e')](_0x7995('0x71'),_0x2f8a2d);return respondWithRpcPromise(_0x7995('0x72'),_0x7995('0x34'),{'module':_0x7995('0x73')});}return null;})[_0x7995('0x1f')](function(_0x560095){if(_0x560095){return _0x16108c;}})[_0x7995('0x1f')](respondWithResult(_0x117317,null))[_0x7995('0x29')](handleError(_0x117317,null));};exports['destroy']=function(_0x479271,_0xd24c64,_0xf8c2ed){var _0x18e1a2;return db[_0x7995('0x3b')][_0x7995('0x54')]({'where':{'id':_0x479271['params']['id']}})[_0x7995('0x1f')](handleEntityNotFound(_0xd24c64,null))[_0x7995('0x1f')](removeEntity(_0xd24c64,null))['then'](function(){return db[_0x7995('0x3b')][_0x7995('0x66')]({'raw':!![]});})['then'](function(_0x1535a3){var _0x4a5bc5=fs[_0x7995('0x67')](path[_0x7995('0x68')](config[_0x7995('0x69')],_0x7995('0x6a')),_0x7995('0x6b'));var _0x5d16da=fs[_0x7995('0x67')](path[_0x7995('0x68')](config[_0x7995('0x69')],'server/files/templates/registry.ejs'),_0x7995('0x6b'));var _0x3f3434=ejs[_0x7995('0x6d')](_0x4a5bc5,{'trunks':_0x1535a3});var _0x308a26=ejs['render'](_0x5d16da,{'trunks':_0x1535a3});fs[_0x7995('0x6e')](_0x7995('0x6f'),_0x3f3434);fs[_0x7995('0x6e')]('/etc/asterisk/sip_xcally_registers.conf',_0x308a26);return respondWithRpcPromise('Reload',_0x7995('0x35'),{'module':_0x7995('0x73')});})['catch'](handleError(_0xd24c64,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index fdf5231..67f7258 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 _0xfedc=['path','rimraf','../../config/environment','./trunk.attributes','exports','Trunk','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xfedc,0x172));var _0xcfed=function(_0x1f71d8,_0x278518){_0x1f71d8=_0x1f71d8-0x0;var _0x10b045=_0xfedc[_0x1f71d8];return _0x10b045;};'use strict';var _=require(_0xcfed('0x0'));var util=require(_0xcfed('0x1'));var logger=require(_0xcfed('0x2'))(_0xcfed('0x3'));var moment=require(_0xcfed('0x4'));var BPromise=require(_0xcfed('0x5'));var rp=require(_0xcfed('0x6'));var fs=require('fs');var path=require(_0xcfed('0x7'));var rimraf=require(_0xcfed('0x8'));var config=require(_0xcfed('0x9'));var attributes=require(_0xcfed('0xa'));module[_0xcfed('0xb')]=function(_0x32c63b,_0x5e7446){return _0x32c63b['define'](_0xcfed('0xc'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf137=['define','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./trunk.attributes','exports'];(function(_0x2d464f,_0x4f7d6c){var _0x46356e=function(_0x2f777b){while(--_0x2f777b){_0x2d464f['push'](_0x2d464f['shift']());}};_0x46356e(++_0x4f7d6c);}(_0xf137,0x105));var _0x7f13=function(_0x4ed90b,_0x5b8dc5){_0x4ed90b=_0x4ed90b-0x0;var _0x812d6d=_0xf137[_0x4ed90b];return _0x812d6d;};'use strict';var _=require('lodash');var util=require(_0x7f13('0x0'));var logger=require(_0x7f13('0x1'))('api');var moment=require(_0x7f13('0x2'));var BPromise=require('bluebird');var rp=require(_0x7f13('0x3'));var fs=require('fs');var path=require(_0x7f13('0x4'));var rimraf=require(_0x7f13('0x5'));var config=require(_0x7f13('0x6'));var attributes=require(_0x7f13('0x7'));module[_0x7f13('0x8')]=function(_0x255856,_0x258fb7){return _0x255856[_0x7f13('0x9')]('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 f70eb0e..5fe010a 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 _0xfc9d=['message','result','catch','GetTrunk','Trunk','findAll','options','raw','where','attributes','limit','include','map','model','stringify','ShowTrunk','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x2a44f8,_0x5e779d){var _0xfc6cf7=function(_0x2834af){while(--_0x2834af){_0x2a44f8['push'](_0x2a44f8['shift']());}};_0xfc6cf7(++_0x5e779d);}(_0xfc9d,0x15e));var _0xdfc9=function(_0x2f75ce,_0x229bf4){_0x2f75ce=_0x2f75ce-0x0;var _0x5f1f2d=_0xfc9d[_0x2f75ce];return _0x5f1f2d;};'use strict';var _=require(_0xdfc9('0x0'));var util=require(_0xdfc9('0x1'));var moment=require(_0xdfc9('0x2'));var BPromise=require(_0xdfc9('0x3'));var rs=require(_0xdfc9('0x4'));var fs=require('fs');var Redis=require(_0xdfc9('0x5'));var db=require(_0xdfc9('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xdfc9('0x7'))('rpc');var config=require(_0xdfc9('0x8'));var jayson=require(_0xdfc9('0x9'));var client=jayson[_0xdfc9('0xa')][_0xdfc9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2058cf,_0x39049a,_0x4508f8){return new BPromise(function(_0x560c91,_0x6077c7){return client['request'](_0x2058cf,_0x4508f8)[_0xdfc9('0xc')](function(_0x21f5b5){logger[_0xdfc9('0xd')](_0xdfc9('0xe'),_0x39049a,_0xdfc9('0xf'));logger[_0xdfc9('0x10')](_0xdfc9('0x11'),_0x39049a,'request\x20sent',JSON['stringify'](_0x21f5b5));if(_0x21f5b5[_0xdfc9('0x12')]){if(_0x21f5b5[_0xdfc9('0x12')][_0xdfc9('0x13')]===0x1f4){logger['error']('Trunk,\x20%s,\x20%s',_0x39049a,_0x21f5b5[_0xdfc9('0x12')]['message']);return _0x6077c7(_0x21f5b5[_0xdfc9('0x12')]['message']);}logger['error'](_0xdfc9('0xe'),_0x39049a,_0x21f5b5[_0xdfc9('0x12')][_0xdfc9('0x14')]);return _0x560c91(_0x21f5b5[_0xdfc9('0x12')]['message']);}else{logger[_0xdfc9('0xd')]('Trunk,\x20%s,\x20%s',_0x39049a,'request\x20sent');_0x560c91(_0x21f5b5[_0xdfc9('0x15')][_0xdfc9('0x14')]);}})[_0xdfc9('0x16')](function(_0x13631b){logger[_0xdfc9('0x12')]('Trunk,\x20%s,\x20%s',_0x39049a,_0x13631b);_0x6077c7(_0x13631b);});});}exports[_0xdfc9('0x17')]=function(_0x580c18){var _0x18049f=this;return new Promise(function(_0x3bc513,_0x31290b){return db[_0xdfc9('0x18')][_0xdfc9('0x19')]({'raw':_0x580c18[_0xdfc9('0x1a')]?_0x580c18[_0xdfc9('0x1a')][_0xdfc9('0x1b')]===undefined?!![]:![]:!![],'where':_0x580c18[_0xdfc9('0x1a')]?_0x580c18[_0xdfc9('0x1a')][_0xdfc9('0x1c')]||null:null,'attributes':_0x580c18[_0xdfc9('0x1a')]?_0x580c18['options'][_0xdfc9('0x1d')]||null:null,'limit':_0x580c18[_0xdfc9('0x1a')]?_0x580c18[_0xdfc9('0x1a')][_0xdfc9('0x1e')]||null:null,'include':_0x580c18['options']?_0x580c18[_0xdfc9('0x1a')][_0xdfc9('0x1f')]?_[_0xdfc9('0x20')](_0x580c18[_0xdfc9('0x1a')]['include'],function(_0x510004){return{'model':db[_0x510004[_0xdfc9('0x21')]],'as':_0x510004['as'],'attributes':_0x510004[_0xdfc9('0x1d')],'include':_0x510004[_0xdfc9('0x1f')]?_[_0xdfc9('0x20')](_0x510004[_0xdfc9('0x1f')],function(_0x5eec42){return{'model':db[_0x5eec42[_0xdfc9('0x21')]],'as':_0x5eec42['as'],'attributes':_0x5eec42[_0xdfc9('0x1d')],'include':_0x5eec42[_0xdfc9('0x1f')]?_[_0xdfc9('0x20')](_0x5eec42[_0xdfc9('0x1f')],function(_0x32d123){return{'model':db[_0x32d123[_0xdfc9('0x21')]],'as':_0x32d123['as'],'attributes':_0x32d123['attributes']};}):[]};}):[]};}):[]:[]})[_0xdfc9('0xc')](function(_0x17bdfe){logger[_0xdfc9('0xd')]('GetTrunk',_0x580c18);logger['debug'](_0xdfc9('0x17'),_0x580c18,JSON[_0xdfc9('0x22')](_0x17bdfe));_0x3bc513(_0x17bdfe);})[_0xdfc9('0x16')](function(_0x4fe476){logger['error']('GetTrunk',_0x4fe476['message'],_0x580c18);_0x31290b(_0x18049f[_0xdfc9('0x12')](0x1f4,_0x4fe476[_0xdfc9('0x14')]));});});};exports[_0xdfc9('0x23')]=function(_0x384c10){var _0x279dfb=this;return new Promise(function(_0x3b5b4e,_0x5e7553){return db[_0xdfc9('0x18')][_0xdfc9('0x24')]({'raw':_0x384c10[_0xdfc9('0x1a')]?_0x384c10[_0xdfc9('0x1a')][_0xdfc9('0x1b')]===undefined?!![]:![]:!![],'where':_0x384c10[_0xdfc9('0x1a')]?_0x384c10[_0xdfc9('0x1a')][_0xdfc9('0x1c')]||null:null,'attributes':_0x384c10[_0xdfc9('0x1a')]?_0x384c10['options'][_0xdfc9('0x1d')]||null:null,'include':_0x384c10[_0xdfc9('0x1a')]?_0x384c10[_0xdfc9('0x1a')][_0xdfc9('0x1f')]?_[_0xdfc9('0x20')](_0x384c10[_0xdfc9('0x1a')][_0xdfc9('0x1f')],function(_0x35e3e3){return{'model':db[_0x35e3e3['model']],'as':_0x35e3e3['as'],'attributes':_0x35e3e3[_0xdfc9('0x1d')],'include':_0x35e3e3[_0xdfc9('0x1f')]?_[_0xdfc9('0x20')](_0x35e3e3[_0xdfc9('0x1f')],function(_0x34cf91){return{'model':db[_0x34cf91[_0xdfc9('0x21')]],'as':_0x34cf91['as'],'attributes':_0x34cf91[_0xdfc9('0x1d')],'include':_0x34cf91['include']?_[_0xdfc9('0x20')](_0x34cf91[_0xdfc9('0x1f')],function(_0x2a791f){return{'model':db[_0x2a791f['model']],'as':_0x2a791f['as'],'attributes':_0x2a791f[_0xdfc9('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xdfc9('0xc')](function(_0x3d9820){logger[_0xdfc9('0xd')](_0xdfc9('0x23'),_0x384c10);logger[_0xdfc9('0x10')](_0xdfc9('0x23'),_0x384c10,JSON['stringify'](_0x3d9820));_0x3b5b4e(_0x3d9820);})['catch'](function(_0x8a3a8){logger['error'](_0xdfc9('0x23'),_0x8a3a8[_0xdfc9('0x14')],_0x384c10);_0x5e7553(_0x279dfb[_0xdfc9('0x12')](0x1f4,_0x8a3a8[_0xdfc9('0x14')]));});});}; \ No newline at end of file +var _0xf21c=['Trunk,\x20%s,\x20%s','message','result','GetTrunk','Trunk','findAll','options','raw','attributes','limit','include','map','model','catch','ShowTrunk','find','where','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','error','code'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf21c,0x184));var _0xcf21=function(_0x4990d5,_0xe2c486){_0x4990d5=_0x4990d5-0x0;var _0x275e25=_0xf21c[_0x4990d5];return _0x275e25;};'use strict';var _=require(_0xcf21('0x0'));var util=require(_0xcf21('0x1'));var moment=require('moment');var BPromise=require(_0xcf21('0x2'));var rs=require(_0xcf21('0x3'));var fs=require('fs');var Redis=require(_0xcf21('0x4'));var db=require(_0xcf21('0x5'))['db'];var utils=require(_0xcf21('0x6'));var logger=require(_0xcf21('0x7'))(_0xcf21('0x8'));var config=require(_0xcf21('0x9'));var jayson=require(_0xcf21('0xa'));var client=jayson[_0xcf21('0xb')][_0xcf21('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x27e967,_0x52ec84,_0x2fa252){return new BPromise(function(_0x313475,_0x4ae5e2){return client[_0xcf21('0xd')](_0x27e967,_0x2fa252)[_0xcf21('0xe')](function(_0x1e4f52){logger[_0xcf21('0xf')]('Trunk,\x20%s,\x20%s',_0x52ec84,'request\x20sent');logger[_0xcf21('0x10')]('Trunk,\x20%s,\x20%s,\x20%s',_0x52ec84,'request\x20sent',JSON['stringify'](_0x1e4f52));if(_0x1e4f52[_0xcf21('0x11')]){if(_0x1e4f52[_0xcf21('0x11')][_0xcf21('0x12')]===0x1f4){logger[_0xcf21('0x11')](_0xcf21('0x13'),_0x52ec84,_0x1e4f52[_0xcf21('0x11')][_0xcf21('0x14')]);return _0x4ae5e2(_0x1e4f52['error'][_0xcf21('0x14')]);}logger['error']('Trunk,\x20%s,\x20%s',_0x52ec84,_0x1e4f52[_0xcf21('0x11')][_0xcf21('0x14')]);return _0x313475(_0x1e4f52[_0xcf21('0x11')][_0xcf21('0x14')]);}else{logger['info'](_0xcf21('0x13'),_0x52ec84,'request\x20sent');_0x313475(_0x1e4f52[_0xcf21('0x15')]['message']);}})['catch'](function(_0x3c8093){logger[_0xcf21('0x11')](_0xcf21('0x13'),_0x52ec84,_0x3c8093);_0x4ae5e2(_0x3c8093);});});}exports[_0xcf21('0x16')]=function(_0x40ab50){var _0x5eba00=this;return new Promise(function(_0x44d869,_0x173e15){return db[_0xcf21('0x17')][_0xcf21('0x18')]({'raw':_0x40ab50[_0xcf21('0x19')]?_0x40ab50[_0xcf21('0x19')][_0xcf21('0x1a')]===undefined?!![]:![]:!![],'where':_0x40ab50['options']?_0x40ab50[_0xcf21('0x19')]['where']||null:null,'attributes':_0x40ab50[_0xcf21('0x19')]?_0x40ab50[_0xcf21('0x19')][_0xcf21('0x1b')]||null:null,'limit':_0x40ab50['options']?_0x40ab50[_0xcf21('0x19')][_0xcf21('0x1c')]||null:null,'include':_0x40ab50[_0xcf21('0x19')]?_0x40ab50[_0xcf21('0x19')][_0xcf21('0x1d')]?_[_0xcf21('0x1e')](_0x40ab50['options']['include'],function(_0x188b56){return{'model':db[_0x188b56[_0xcf21('0x1f')]],'as':_0x188b56['as'],'attributes':_0x188b56[_0xcf21('0x1b')],'include':_0x188b56[_0xcf21('0x1d')]?_[_0xcf21('0x1e')](_0x188b56[_0xcf21('0x1d')],function(_0x49d7e1){return{'model':db[_0x49d7e1[_0xcf21('0x1f')]],'as':_0x49d7e1['as'],'attributes':_0x49d7e1[_0xcf21('0x1b')],'include':_0x49d7e1[_0xcf21('0x1d')]?_['map'](_0x49d7e1['include'],function(_0x348d56){return{'model':db[_0x348d56[_0xcf21('0x1f')]],'as':_0x348d56['as'],'attributes':_0x348d56['attributes']};}):[]};}):[]};}):[]:[]})[_0xcf21('0xe')](function(_0x5177c4){logger[_0xcf21('0xf')]('GetTrunk',_0x40ab50);logger[_0xcf21('0x10')](_0xcf21('0x16'),_0x40ab50,JSON['stringify'](_0x5177c4));_0x44d869(_0x5177c4);})[_0xcf21('0x20')](function(_0x506974){logger['error'](_0xcf21('0x16'),_0x506974[_0xcf21('0x14')],_0x40ab50);_0x173e15(_0x5eba00[_0xcf21('0x11')](0x1f4,_0x506974[_0xcf21('0x14')]));});});};exports[_0xcf21('0x21')]=function(_0x228749){var _0x583bd4=this;return new Promise(function(_0x3ad8ff,_0x4739bd){return db['Trunk'][_0xcf21('0x22')]({'raw':_0x228749[_0xcf21('0x19')]?_0x228749[_0xcf21('0x19')][_0xcf21('0x1a')]===undefined?!![]:![]:!![],'where':_0x228749['options']?_0x228749[_0xcf21('0x19')][_0xcf21('0x23')]||null:null,'attributes':_0x228749[_0xcf21('0x19')]?_0x228749[_0xcf21('0x19')][_0xcf21('0x1b')]||null:null,'include':_0x228749[_0xcf21('0x19')]?_0x228749[_0xcf21('0x19')]['include']?_[_0xcf21('0x1e')](_0x228749[_0xcf21('0x19')][_0xcf21('0x1d')],function(_0x259ce7){return{'model':db[_0x259ce7[_0xcf21('0x1f')]],'as':_0x259ce7['as'],'attributes':_0x259ce7[_0xcf21('0x1b')],'include':_0x259ce7['include']?_[_0xcf21('0x1e')](_0x259ce7['include'],function(_0xd392d0){return{'model':db[_0xd392d0['model']],'as':_0xd392d0['as'],'attributes':_0xd392d0[_0xcf21('0x1b')],'include':_0xd392d0[_0xcf21('0x1d')]?_[_0xcf21('0x1e')](_0xd392d0[_0xcf21('0x1d')],function(_0x5a7f13){return{'model':db[_0x5a7f13['model']],'as':_0x5a7f13['as'],'attributes':_0x5a7f13[_0xcf21('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x51ae34){logger['info']('ShowTrunk',_0x228749);logger[_0xcf21('0x10')](_0xcf21('0x21'),_0x228749,JSON[_0xcf21('0x24')](_0x51ae34));_0x3ad8ff(_0x51ae34);})['catch'](function(_0x1b0da0){logger[_0xcf21('0x11')]('ShowTrunk',_0x1b0da0[_0xcf21('0x14')],_0x228749);_0x4739bd(_0x583bd4[_0xcf21('0x11')](0x1f4,_0x1b0da0[_0xcf21('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index b37699a..5f96676 100644 --- a/server/api/user-setting/index.js +++ b/server/api/user-setting/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8649=['../../components/auth/service','./user-setting.controller','put','/:id','update','exports','Router'];(function(_0x418397,_0x180f68){var _0x4a7c35=function(_0x53f6a0){while(--_0x53f6a0){_0x418397['push'](_0x418397['shift']());}};_0x4a7c35(++_0x180f68);}(_0x8649,0x76));var _0x9864=function(_0x457cbd,_0x2f6337){_0x457cbd=_0x457cbd-0x0;var _0x406bbe=_0x8649[_0x457cbd];return _0x406bbe;};'use strict';var express=require('express');var router=express[_0x9864('0x0')]();var auth=require(_0x9864('0x1'));var controller=require(_0x9864('0x2'));router[_0x9864('0x3')](_0x9864('0x4'),auth['isAuthenticated'](),controller[_0x9864('0x5')]);module[_0x9864('0x6')]=router; \ No newline at end of file +var _0x012b=['Router','../../components/auth/service','./user-setting.controller','put','/:id','isAuthenticated','update'];(function(_0x1c436d,_0x53d37e){var _0x4529e3=function(_0x55aa48){while(--_0x55aa48){_0x1c436d['push'](_0x1c436d['shift']());}};_0x4529e3(++_0x53d37e);}(_0x012b,0x1ab));var _0xb012=function(_0xc9379,_0x3b91e4){_0xc9379=_0xc9379-0x0;var _0x1b3834=_0x012b[_0xc9379];return _0x1b3834;};'use strict';var express=require('express');var router=express[_0xb012('0x0')]();var auth=require(_0xb012('0x1'));var controller=require(_0xb012('0x2'));router[_0xb012('0x3')](_0xb012('0x4'),auth[_0xb012('0x5')](),controller[_0xb012('0x6')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.attributes.js b/server/api/user-setting/user-setting.attributes.js index ecbe4c5..c9dc427 100644 --- a/server/api/user-setting/user-setting.attributes.js +++ b/server/api/user-setting/user-setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['exports','BOOLEAN','DATE','sequelize','error','warning'];(function(_0x42c62b,_0xc0673c){var _0x204c57=function(_0x5f190f){while(--_0x5f190f){_0x42c62b['push'](_0x42c62b['shift']());}};_0x204c57(++_0xc0673c);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'use strict';var Sequelize=require(_0x0a9e('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x0a9e('0x1'),_0x0a9e('0x2'),'info','debug'];module[_0x0a9e('0x3')]={'clientSideLoggingLevel':{'type':Sequelize['ENUM'](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x0a9e('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0xa9e0=['exports','BOOLEAN','DATE','sequelize','error','warning'];(function(_0x14a33b,_0x374365){var _0x21cce9=function(_0x5785e8){while(--_0x5785e8){_0x14a33b['push'](_0x14a33b['shift']());}};_0x21cce9(++_0x374365);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'use strict';var Sequelize=require(_0x0a9e('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x0a9e('0x1'),_0x0a9e('0x2'),'info','debug'];module[_0x0a9e('0x3')]={'clientSideLoggingLevel':{'type':Sequelize['ENUM'](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x0a9e('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.controller.js b/server/api/user-setting/user-setting.controller.js index ba67de7..ae56069 100644 --- a/server/api/user-setting/user-setting.controller.js +++ b/server/api/user-setting/user-setting.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3eec=['socket.io-emitter','redis','./user-setting.socket','register','localhost','status','json','update','sendStatus','stack','name','send','user','admin','Unauthorized','params','Invalid\x20user\x20setting\x20id','UserSetting','find','then','catch','lodash','ioredis','../../config/logger','api','../../mysqldb'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x3eec,0x1e9));var _0xc3ee=function(_0x413d58,_0x2cfcb8){_0x413d58=_0x413d58-0x0;var _0xbe549a=_0x3eec[_0x413d58];return _0xbe549a;};'use strict';var _=require(_0xc3ee('0x0'));var Redis=require(_0xc3ee('0x1'));var logger=require(_0xc3ee('0x2'))(_0xc3ee('0x3'));var config=require('../../config/environment');var db=require(_0xc3ee('0x4'))['db'];var socket=require(_0xc3ee('0x5'))(new Redis(config[_0xc3ee('0x6')]));require(_0xc3ee('0x7'))[_0xc3ee('0x8')](socket);config[_0xc3ee('0x6')]=_['defaults'](config[_0xc3ee('0x6')],{'host':_0xc3ee('0x9'),'port':0x18eb});function respondWithResult(_0xea4318,_0x2cc750){_0x2cc750=_0x2cc750||0xc8;return function(_0x356374){if(_0x356374){return _0xea4318[_0xc3ee('0xa')](_0x2cc750)[_0xc3ee('0xb')](_0x356374);}};}function saveUpdates(_0x2c9701){return function(_0x6325a3){if(_0x6325a3){return _0x6325a3[_0xc3ee('0xc')](_0x2c9701)['then'](function(_0x523511){return _0x523511;});}return null;};}function handleEntityNotFound(_0x15d756){return function(_0x155e0f){if(!_0x155e0f){_0x15d756[_0xc3ee('0xd')](0x194);}return _0x155e0f;};}function handleError(_0x1a2bea,_0x4f27b5){_0x4f27b5=_0x4f27b5||0x1f4;return function(_0x1c4eac){logger['error'](_0x1c4eac[_0xc3ee('0xe')]);if(_0x1c4eac[_0xc3ee('0xf')]){delete _0x1c4eac['name'];}_0x1a2bea['status'](_0x4f27b5)[_0xc3ee('0x10')](_0x1c4eac);};}exports['update']=function(_0x7ce8a7,_0x535d1a){if(_0x7ce8a7[_0xc3ee('0x11')]['role']!==_0xc3ee('0x12'))throw new Error(_0xc3ee('0x13'));if(isNaN(Number(_0x7ce8a7[_0xc3ee('0x14')]['id'])))throw new Error(_0xc3ee('0x15'));return db[_0xc3ee('0x16')][_0xc3ee('0x17')]({'where':{'id':_0x7ce8a7[_0xc3ee('0x14')]['id']}})['then'](handleEntityNotFound(_0x535d1a,null))[_0xc3ee('0x18')](saveUpdates(_0x7ce8a7['body'],null))[_0xc3ee('0x18')](respondWithResult(_0x535d1a,null))[_0xc3ee('0x19')](handleError(_0x535d1a,null));}; \ No newline at end of file +var _0xee24=['update','sendStatus','error','stack','name','send','admin','Unauthorized','Invalid\x20user\x20setting\x20id','UserSetting','find','params','then','catch','ioredis','../../config/logger','../../config/environment','../../mysqldb','socket.io-emitter','redis','register','defaults','status','json'];(function(_0x1ab965,_0x30b2c1){var _0x2b88d3=function(_0x415416){while(--_0x415416){_0x1ab965['push'](_0x1ab965['shift']());}};_0x2b88d3(++_0x30b2c1);}(_0xee24,0x1a6));var _0x4ee2=function(_0x3f5df4,_0x38ae35){_0x3f5df4=_0x3f5df4-0x0;var _0x484ad9=_0xee24[_0x3f5df4];return _0x484ad9;};'use strict';var _=require('lodash');var Redis=require(_0x4ee2('0x0'));var logger=require(_0x4ee2('0x1'))('api');var config=require(_0x4ee2('0x2'));var db=require(_0x4ee2('0x3'))['db'];var socket=require(_0x4ee2('0x4'))(new Redis(config[_0x4ee2('0x5')]));require('./user-setting.socket')[_0x4ee2('0x6')](socket);config[_0x4ee2('0x5')]=_[_0x4ee2('0x7')](config[_0x4ee2('0x5')],{'host':'localhost','port':0x18eb});function respondWithResult(_0x2e6e11,_0x319d9d){_0x319d9d=_0x319d9d||0xc8;return function(_0xe966eb){if(_0xe966eb){return _0x2e6e11[_0x4ee2('0x8')](_0x319d9d)[_0x4ee2('0x9')](_0xe966eb);}};}function saveUpdates(_0x15f436){return function(_0x32c572){if(_0x32c572){return _0x32c572[_0x4ee2('0xa')](_0x15f436)['then'](function(_0x519e87){return _0x519e87;});}return null;};}function handleEntityNotFound(_0xcf0cbb){return function(_0x38e8ef){if(!_0x38e8ef){_0xcf0cbb[_0x4ee2('0xb')](0x194);}return _0x38e8ef;};}function handleError(_0x2145d5,_0x2363b0){_0x2363b0=_0x2363b0||0x1f4;return function(_0x55204e){logger[_0x4ee2('0xc')](_0x55204e[_0x4ee2('0xd')]);if(_0x55204e[_0x4ee2('0xe')]){delete _0x55204e[_0x4ee2('0xe')];}_0x2145d5['status'](_0x2363b0)[_0x4ee2('0xf')](_0x55204e);};}exports[_0x4ee2('0xa')]=function(_0x665d4d,_0x23c1c9){if(_0x665d4d['user']['role']!==_0x4ee2('0x10'))throw new Error(_0x4ee2('0x11'));if(isNaN(Number(_0x665d4d['params']['id'])))throw new Error(_0x4ee2('0x12'));return db[_0x4ee2('0x13')][_0x4ee2('0x14')]({'where':{'id':_0x665d4d[_0x4ee2('0x15')]['id']}})[_0x4ee2('0x16')](handleEntityNotFound(_0x23c1c9,null))[_0x4ee2('0x16')](saveUpdates(_0x665d4d['body'],null))[_0x4ee2('0x16')](respondWithResult(_0x23c1c9,null))[_0x4ee2('0x17')](handleError(_0x23c1c9,null));}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.events.js b/server/api/user-setting/user-setting.events.js index 38b1234..61f9298 100644 --- a/server/api/user-setting/user-setting.events.js +++ b/server/api/user-setting/user-setting.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1d90=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x2257a6,_0x1f5a37){var _0x418925=function(_0x26a6c6){while(--_0x26a6c6){_0x2257a6['push'](_0x2257a6['shift']());}};_0x418925(++_0x1f5a37);}(_0x1d90,0x102));var _0x01d9=function(_0x11b58d,_0x555c55){_0x11b58d=_0x11b58d-0x0;var _0xc2811b=_0x1d90[_0x11b58d];return _0xc2811b;};'use strict';var EventEmitter=require(_0x01d9('0x0'));var UserSetting=require(_0x01d9('0x1'))['db']['UserSetting'];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x01d9('0x2')](0x0);var events={'afterCreate':_0x01d9('0x3'),'afterUpdate':_0x01d9('0x4'),'afterDestroy':_0x01d9('0x5')};function emitEvent(_0x2ec3f0){return function(_0x20c38a,_0x2477be,_0x301c81){UserSettingEvents[_0x01d9('0x6')](_0x2ec3f0+':'+_0x20c38a['id'],_0x20c38a);UserSettingEvents[_0x01d9('0x6')](_0x2ec3f0,_0x20c38a);_0x301c81(null);};}for(var e in events){if(events[_0x01d9('0x7')](e)){var event=events[e];UserSetting[_0x01d9('0x8')](e,emitEvent(event));}}module[_0x01d9('0x9')]=UserSettingEvents; \ No newline at end of file +var _0x495c=['events','UserSetting','save','update','remove','emit','hook'];(function(_0x145acb,_0x4ece06){var _0x1061d4=function(_0x5efd34){while(--_0x5efd34){_0x145acb['push'](_0x145acb['shift']());}};_0x1061d4(++_0x4ece06);}(_0x495c,0x8c));var _0xc495=function(_0x5db0c5,_0x5519a8){_0x5db0c5=_0x5db0c5-0x0;var _0xf6c590=_0x495c[_0x5db0c5];return _0xf6c590;};'use strict';var EventEmitter=require(_0xc495('0x0'));var UserSetting=require('../../mysqldb')['db'][_0xc495('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc495('0x2'),'afterUpdate':_0xc495('0x3'),'afterDestroy':_0xc495('0x4')};function emitEvent(_0x2b40f1){return function(_0x3c2988,_0x4719b1,_0x530c5a){UserSettingEvents[_0xc495('0x5')](_0x2b40f1+':'+_0x3c2988['id'],_0x3c2988);UserSettingEvents['emit'](_0x2b40f1,_0x3c2988);_0x530c5a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserSetting[_0xc495('0x6')](e,emitEvent(event));}}module['exports']=UserSettingEvents; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.model.js b/server/api/user-setting/user-setting.model.js index fee3a92..5c292dd 100644 --- a/server/api/user-setting/user-setting.model.js +++ b/server/api/user-setting/user-setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5423=['exports','define','UserSetting','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes'];(function(_0x243c74,_0x16c08d){var _0x24d59e=function(_0x29cb65){while(--_0x29cb65){_0x243c74['push'](_0x243c74['shift']());}};_0x24d59e(++_0x16c08d);}(_0x5423,0xe3));var _0x3542=function(_0x1322ae,_0x2bb29e){_0x1322ae=_0x1322ae-0x0;var _0x1048c2=_0x5423[_0x1322ae];return _0x1048c2;};'use strict';var attributes=require(_0x3542('0x0'));module[_0x3542('0x1')]=function(_0x511bd3){return _0x511bd3[_0x3542('0x2')](_0x3542('0x3'),attributes,{'tableName':'user_settings','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xec03e2){if(!_0xec03e2[_0x3542('0x4')])_0xec03e2[_0x3542('0x5')]=null;else if(_0xec03e2[_0x3542('0x5')]===null)_0xec03e2['clientSideLoggingEnabledSince']=new Date();}}});}; \ No newline at end of file +var _0x4899=['./user-setting.attributes','UserSetting','clientSideLoggingEnabled','clientSideLoggingEnabledSince'];(function(_0x334bd6,_0x522ff2){var _0xbb1866=function(_0x462cad){while(--_0x462cad){_0x334bd6['push'](_0x334bd6['shift']());}};_0xbb1866(++_0x522ff2);}(_0x4899,0x74));var _0x9489=function(_0x39f071,_0x1ac1a2){_0x39f071=_0x39f071-0x0;var _0x3baae0=_0x4899[_0x39f071];return _0x3baae0;};'use strict';var attributes=require(_0x9489('0x0'));module['exports']=function(_0x3bf332){return _0x3bf332['define'](_0x9489('0x1'),attributes,{'tableName':'user_settings','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x6a6532){if(!_0x6a6532[_0x9489('0x2')])_0x6a6532[_0x9489('0x3')]=null;else if(_0x6a6532[_0x9489('0x3')]===null)_0x6a6532[_0x9489('0x3')]=new Date();}}});}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.socket.js b/server/api/user-setting/user-setting.socket.js index 5df0c23..1fc5485 100644 --- a/server/api/user-setting/user-setting.socket.js +++ b/server/api/user-setting/user-setting.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xddd4=['./user-setting.events','save','emit','user-setting:update:user-','UserId','register','length'];(function(_0x25acf8,_0x184db7){var _0x47b3e5=function(_0x4d5d3d){while(--_0x4d5d3d){_0x25acf8['push'](_0x25acf8['shift']());}};_0x47b3e5(++_0x184db7);}(_0xddd4,0x93));var _0x4ddd=function(_0x47fd36,_0x41535d){_0x47fd36=_0x47fd36-0x0;var _0x21a0fc=_0xddd4[_0x47fd36];return _0x21a0fc;};'use strict';var UserSettingEvents=require(_0x4ddd('0x0'));var events=[_0x4ddd('0x1'),'remove','update'];function createListener(_0x3287e7,_0x55595a){return function(_0x2f4f43){_0x55595a['emit'](_0x3287e7,_0x2f4f43);if(_0x3287e7==='user-setting:update'){_0x55595a[_0x4ddd('0x2')](_0x4ddd('0x3')+_0x2f4f43[_0x4ddd('0x4')],_0x2f4f43);}};}exports[_0x4ddd('0x5')]=function(_0x7b2aa6){for(var _0x5ca34c=0x0,_0x469b6f=events[_0x4ddd('0x6')];_0x5ca34c<_0x469b6f;_0x5ca34c++){var _0x2a7122=events[_0x5ca34c];var _0x2e6941=createListener('user-setting:'+_0x2a7122,_0x7b2aa6);UserSettingEvents['on'](_0x2a7122,_0x2e6941);}}; \ No newline at end of file +var _0x4207=['update','emit','UserId','register','length','remove'];(function(_0x48beba,_0xf9024c){var _0x153476=function(_0x2fc8fb){while(--_0x2fc8fb){_0x48beba['push'](_0x48beba['shift']());}};_0x153476(++_0xf9024c);}(_0x4207,0xdd));var _0x7420=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x4207[_0x1facfa];return _0x9ec701;};'use strict';var UserSettingEvents=require('./user-setting.events');var events=['save',_0x7420('0x0'),_0x7420('0x1')];function createListener(_0x11a699,_0xe6c046){return function(_0x2eb2c6){_0xe6c046[_0x7420('0x2')](_0x11a699,_0x2eb2c6);if(_0x11a699==='user-setting:update'){_0xe6c046[_0x7420('0x2')]('user-setting:update:user-'+_0x2eb2c6[_0x7420('0x3')],_0x2eb2c6);}};}exports[_0x7420('0x4')]=function(_0x137d70){for(var _0x31f5e2=0x0,_0x3adb15=events[_0x7420('0x5')];_0x31f5e2<_0x3adb15;_0x31f5e2++){var _0x217f2b=events[_0x31f5e2];var _0x36254a=createListener('user-setting:'+_0x217f2b,_0x137d70);UserSettingEvents['on'](_0x217f2b,_0x36254a);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 30695fb..ed6336a 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 _0xe319=['/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getSmsInteractions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','/:id/lists','/:id/agents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/openchannel_accounts','/:id/sms_accounts','getSmsAccounts','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getScheduledCalls','/:id/api_key','getApiKey','post','/:id/contacts','addContacts','create','/create_many','bulkCreate','addQueues','diskStorage','join','format','%s-%s','now','originalname','file','/:id/login','login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','/:id/sms_interactions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','/:id/mail_accounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','/:id/chat_websites','addChatWebsites','addWhatsappAccounts','createApiKey','put','/:id','update','/:id/password','changePassword','delete','removeQueues','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','removeApiKey','multer','express','../../components/auth/service','../../components/interaction/service','./user.controller','get','isAuthenticated','index','/describe','describe','/whoami','whoami','/presence','getPresence','show','getAvatar','/:id/open_tabs','getOpenTabs','/:id/queues','getQueues','/:id/queues_rt','getGroups','/:id/recordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions'];(function(_0x49d19d,_0x245cf5){var _0x4ebef1=function(_0xf0a4e6){while(--_0xf0a4e6){_0x49d19d['push'](_0x49d19d['shift']());}};_0x4ebef1(++_0x245cf5);}(_0xe319,0xc7));var _0x9e31=function(_0x360aed,_0x4a6994){_0x360aed=_0x360aed-0x0;var _0x56fa9c=_0xe319[_0x360aed];return _0x56fa9c;};'use strict';var multer=require(_0x9e31('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9e31('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9e31('0x2'));var interaction=require(_0x9e31('0x3'));var config=require('../../config/environment');var controller=require(_0x9e31('0x4'));router[_0x9e31('0x5')]('/',auth[_0x9e31('0x6')](),controller[_0x9e31('0x7')]);router[_0x9e31('0x5')](_0x9e31('0x8'),auth['isAuthenticated'](),controller[_0x9e31('0x9')]);router[_0x9e31('0x5')](_0x9e31('0xa'),auth[_0x9e31('0x6')](),controller[_0x9e31('0xb')]);router[_0x9e31('0x5')](_0x9e31('0xc'),auth[_0x9e31('0x6')](),controller[_0x9e31('0xd')]);router['get']('/:id',auth[_0x9e31('0x6')](),controller[_0x9e31('0xe')]);router[_0x9e31('0x5')]('/:id/avatar',controller[_0x9e31('0xf')]);router['get'](_0x9e31('0x10'),auth[_0x9e31('0x6')](),controller[_0x9e31('0x11')]);router['get']('/:id/contacts',auth[_0x9e31('0x6')](),controller['getContacts']);router['get'](_0x9e31('0x12'),auth['isAuthenticated'](),controller[_0x9e31('0x13')]);router[_0x9e31('0x5')](_0x9e31('0x14'),auth[_0x9e31('0x6')](),controller['getVoiceQueuesRt']);router[_0x9e31('0x5')]('/:id/groups',auth[_0x9e31('0x6')](),controller[_0x9e31('0x15')]);router[_0x9e31('0x5')](_0x9e31('0x16'),auth[_0x9e31('0x6')](),controller['getRecordings']);router['get'](_0x9e31('0x17'),auth[_0x9e31('0x6')](),controller[_0x9e31('0x18')]);router[_0x9e31('0x5')](_0x9e31('0x19'),auth[_0x9e31('0x6')](),controller[_0x9e31('0x1a')]);router[_0x9e31('0x5')](_0x9e31('0x1b'),auth[_0x9e31('0x6')](),controller[_0x9e31('0x1c')]);router[_0x9e31('0x5')](_0x9e31('0x1d'),auth[_0x9e31('0x6')](),controller['getMailInteractions']);router[_0x9e31('0x5')]('/:id/sms/interactions',auth['isAuthenticated'](),controller[_0x9e31('0x1e')]);router[_0x9e31('0x5')]('/:id/fax/interactions',auth['isAuthenticated'](),controller[_0x9e31('0x1f')]);router['get'](_0x9e31('0x20'),auth[_0x9e31('0x6')](),controller[_0x9e31('0x21')]);router[_0x9e31('0x5')](_0x9e31('0x22'),auth[_0x9e31('0x6')](),controller['getTeams']);router['get'](_0x9e31('0x23'),auth['isAuthenticated'](),controller['getLists']);router[_0x9e31('0x5')](_0x9e31('0x24'),auth[_0x9e31('0x6')](),controller['getAgents']);router[_0x9e31('0x5')](_0x9e31('0x25'),auth[_0x9e31('0x6')](),controller[_0x9e31('0x26')]);router[_0x9e31('0x5')](_0x9e31('0x27'),auth['isAuthenticated'](),controller[_0x9e31('0x28')]);router[_0x9e31('0x5')]('/:id/mail_accounts',auth[_0x9e31('0x6')](),controller['getMailAccounts']);router['get'](_0x9e31('0x29'),auth[_0x9e31('0x6')](),controller['getOpenchannelAccounts']);router[_0x9e31('0x5')](_0x9e31('0x2a'),auth[_0x9e31('0x6')](),controller[_0x9e31('0x2b')]);router[_0x9e31('0x5')]('/:id/chat_websites',auth['isAuthenticated'](),controller[_0x9e31('0x2c')]);router[_0x9e31('0x5')](_0x9e31('0x2d'),auth[_0x9e31('0x6')](),controller[_0x9e31('0x2e')]);router[_0x9e31('0x5')](_0x9e31('0x2f'),auth[_0x9e31('0x6')](),controller['getSquareProjects']);router[_0x9e31('0x5')]('/:id/scheduled_calls',auth['isAuthenticated'](),controller[_0x9e31('0x30')]);router[_0x9e31('0x5')](_0x9e31('0x31'),auth[_0x9e31('0x6')](),controller[_0x9e31('0x32')]);router[_0x9e31('0x33')](_0x9e31('0x34'),auth[_0x9e31('0x6')](),controller[_0x9e31('0x35')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9e31('0x36')]);router['post'](_0x9e31('0x37'),auth[_0x9e31('0x6')](),controller[_0x9e31('0x38')]);router[_0x9e31('0x33')](_0x9e31('0x12'),auth[_0x9e31('0x6')](),controller[_0x9e31('0x39')]);var upload=multer({'storage':multer[_0x9e31('0x3a')]({'destination':function(_0x2a855c,_0xd438f0,_0x111c20){_0x111c20(null,path[_0x9e31('0x3b')](config['root'],'server/files/images/'));},'filename':function(_0x4bb0ca,_0x198568,_0x4aafec){_0x4aafec(null,util[_0x9e31('0x3c')](_0x9e31('0x3d'),Date[_0x9e31('0x3e')](),_0x198568[_0x9e31('0x3f')]));}})});router['post']('/:id/avatar',upload['single'](_0x9e31('0x40')),controller['addAvatar']);router[_0x9e31('0x33')](_0x9e31('0x41'),auth[_0x9e31('0x6')](),controller[_0x9e31('0x42')]);router[_0x9e31('0x33')](_0x9e31('0x43'),auth[_0x9e31('0x6')](),controller[_0x9e31('0x44')]);router[_0x9e31('0x33')](_0x9e31('0x45'),auth[_0x9e31('0x6')](),controller[_0x9e31('0x46')]);router[_0x9e31('0x33')](_0x9e31('0x47'),auth[_0x9e31('0x6')](),controller[_0x9e31('0x48')]);router[_0x9e31('0x33')]('/:id/teams',auth[_0x9e31('0x6')](),controller[_0x9e31('0x49')]);router[_0x9e31('0x33')](_0x9e31('0x4a'),auth['isAuthenticated'](),controller['addChatInteractions']);router[_0x9e31('0x33')](_0x9e31('0x4b'),auth[_0x9e31('0x6')](),controller[_0x9e31('0x4c')]);router[_0x9e31('0x33')](_0x9e31('0x4d'),auth['isAuthenticated'](),controller['addFaxInteractions']);router[_0x9e31('0x33')](_0x9e31('0x4e'),auth[_0x9e31('0x6')](),controller['addSmsInteractions']);router['post'](_0x9e31('0x4f'),auth[_0x9e31('0x6')](),controller[_0x9e31('0x50')]);router[_0x9e31('0x33')](_0x9e31('0x51'),auth[_0x9e31('0x6')](),controller[_0x9e31('0x52')]);router[_0x9e31('0x33')](_0x9e31('0x27'),auth[_0x9e31('0x6')](),controller[_0x9e31('0x53')]);router[_0x9e31('0x33')](_0x9e31('0x54'),auth[_0x9e31('0x6')](),controller[_0x9e31('0x55')]);router['post'](_0x9e31('0x29'),auth[_0x9e31('0x6')](),controller[_0x9e31('0x56')]);router[_0x9e31('0x33')](_0x9e31('0x2a'),auth[_0x9e31('0x6')](),controller[_0x9e31('0x57')]);router[_0x9e31('0x33')](_0x9e31('0x58'),auth[_0x9e31('0x6')](),controller[_0x9e31('0x59')]);router[_0x9e31('0x33')](_0x9e31('0x2d'),auth[_0x9e31('0x6')](),controller[_0x9e31('0x5a')]);router['post']('/:id/square_projects',auth[_0x9e31('0x6')](),controller['addSquareProjects']);router['post'](_0x9e31('0x31'),auth[_0x9e31('0x6')](),controller[_0x9e31('0x5b')]);router[_0x9e31('0x5c')](_0x9e31('0x5d'),auth[_0x9e31('0x6')](),controller[_0x9e31('0x5e')]);router[_0x9e31('0x5c')](_0x9e31('0x5f'),auth[_0x9e31('0x6')](),controller[_0x9e31('0x60')]);router[_0x9e31('0x61')](_0x9e31('0x12'),auth[_0x9e31('0x6')](),controller[_0x9e31('0x62')]);router[_0x9e31('0x61')](_0x9e31('0x22'),auth[_0x9e31('0x6')](),controller['removeTeams']);router[_0x9e31('0x61')]('/:id',auth[_0x9e31('0x6')](),controller[_0x9e31('0x63')]);router['delete'](_0x9e31('0x4a'),auth[_0x9e31('0x6')](),controller[_0x9e31('0x64')]);router['delete']('/:id/mail_interactions',auth[_0x9e31('0x6')](),controller[_0x9e31('0x65')]);router[_0x9e31('0x61')](_0x9e31('0x4d'),auth[_0x9e31('0x6')](),controller[_0x9e31('0x66')]);router[_0x9e31('0x61')](_0x9e31('0x4e'),auth[_0x9e31('0x6')](),controller[_0x9e31('0x67')]);router[_0x9e31('0x61')](_0x9e31('0x4f'),auth[_0x9e31('0x6')](),controller[_0x9e31('0x68')]);router[_0x9e31('0x61')](_0x9e31('0x51'),auth[_0x9e31('0x6')](),controller[_0x9e31('0x69')]);router[_0x9e31('0x61')](_0x9e31('0x27'),auth[_0x9e31('0x6')](),controller[_0x9e31('0x6a')]);router[_0x9e31('0x61')](_0x9e31('0x54'),auth[_0x9e31('0x6')](),controller[_0x9e31('0x6b')]);router['delete']('/:id/openchannel_accounts',auth[_0x9e31('0x6')](),controller[_0x9e31('0x6c')]);router[_0x9e31('0x61')](_0x9e31('0x2a'),auth[_0x9e31('0x6')](),controller['removeSmsAccounts']);router['delete']('/:id/chat_websites',auth[_0x9e31('0x6')](),controller[_0x9e31('0x6d')]);router[_0x9e31('0x61')](_0x9e31('0x2d'),auth[_0x9e31('0x6')](),controller[_0x9e31('0x6e')]);router[_0x9e31('0x61')](_0x9e31('0x2f'),auth[_0x9e31('0x6')](),controller[_0x9e31('0x6f')]);router['delete'](_0x9e31('0x31'),auth[_0x9e31('0x6')](),controller[_0x9e31('0x70')]);module['exports']=router; \ No newline at end of file +var _0x369a=['create','/:id/queues','addQueues','diskStorage','join','root','server/files/images/','format','now','originalname','file','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','/:id/sms_accounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','createApiKey','put','/:id/password','delete','removeQueues','removeTeams','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','/:id/whatsapp_interactions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeChatWebsites','removeWhatsappAccounts','exports','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','describe','/whoami','whoami','/presence','getPresence','/:id','/:id/avatar','getAvatar','getOpenTabs','getContacts','getQueues','getVoiceQueuesRt','getGroups','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','/:id/contacts'];(function(_0x3b660f,_0x45c3db){var _0x187a29=function(_0x11cedf){while(--_0x11cedf){_0x3b660f['push'](_0x3b660f['shift']());}};_0x187a29(++_0x45c3db);}(_0x369a,0x127));var _0xa369=function(_0xa9e5e4,_0x5232ed){_0xa9e5e4=_0xa9e5e4-0x0;var _0x5e373f=_0x369a[_0xa9e5e4];return _0x5e373f;};'use strict';var multer=require(_0xa369('0x0'));var util=require(_0xa369('0x1'));var path=require(_0xa369('0x2'));var timeout=require('connect-timeout');var express=require(_0xa369('0x3'));var router=express['Router']();var fs_extra=require(_0xa369('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa369('0x5'));var config=require(_0xa369('0x6'));var controller=require(_0xa369('0x7'));router[_0xa369('0x8')]('/',auth[_0xa369('0x9')](),controller[_0xa369('0xa')]);router[_0xa369('0x8')](_0xa369('0xb'),auth[_0xa369('0x9')](),controller[_0xa369('0xc')]);router[_0xa369('0x8')](_0xa369('0xd'),auth[_0xa369('0x9')](),controller[_0xa369('0xe')]);router[_0xa369('0x8')](_0xa369('0xf'),auth[_0xa369('0x9')](),controller[_0xa369('0x10')]);router[_0xa369('0x8')](_0xa369('0x11'),auth[_0xa369('0x9')](),controller['show']);router[_0xa369('0x8')](_0xa369('0x12'),controller[_0xa369('0x13')]);router[_0xa369('0x8')]('/:id/open_tabs',auth[_0xa369('0x9')](),controller[_0xa369('0x14')]);router[_0xa369('0x8')]('/:id/contacts',auth[_0xa369('0x9')](),controller[_0xa369('0x15')]);router[_0xa369('0x8')]('/:id/queues',auth[_0xa369('0x9')](),controller[_0xa369('0x16')]);router['get']('/:id/queues_rt',auth[_0xa369('0x9')](),controller[_0xa369('0x17')]);router[_0xa369('0x8')]('/:id/groups',auth[_0xa369('0x9')](),controller[_0xa369('0x18')]);router[_0xa369('0x8')]('/:id/recordings',auth[_0xa369('0x9')](),controller['getRecordings']);router[_0xa369('0x8')](_0xa369('0x19'),auth['isAuthenticated'](),controller[_0xa369('0x1a')]);router[_0xa369('0x8')](_0xa369('0x1b'),auth['isAuthenticated'](),controller[_0xa369('0x1c')]);router[_0xa369('0x8')](_0xa369('0x1d'),auth[_0xa369('0x9')](),controller[_0xa369('0x1e')]);router['get'](_0xa369('0x1f'),auth[_0xa369('0x9')](),controller[_0xa369('0x20')]);router[_0xa369('0x8')](_0xa369('0x21'),auth[_0xa369('0x9')](),controller[_0xa369('0x22')]);router[_0xa369('0x8')](_0xa369('0x23'),auth[_0xa369('0x9')](),controller['getFaxInteractions']);router['get'](_0xa369('0x24'),auth[_0xa369('0x9')](),controller[_0xa369('0x25')]);router[_0xa369('0x8')](_0xa369('0x26'),auth[_0xa369('0x9')](),controller[_0xa369('0x27')]);router[_0xa369('0x8')](_0xa369('0x28'),auth[_0xa369('0x9')](),controller[_0xa369('0x29')]);router['get'](_0xa369('0x2a'),auth['isAuthenticated'](),controller[_0xa369('0x2b')]);router[_0xa369('0x8')]('/:id/prefixes',auth[_0xa369('0x9')](),controller['getVoicePrefixes']);router[_0xa369('0x8')](_0xa369('0x2c'),auth[_0xa369('0x9')](),controller[_0xa369('0x2d')]);router[_0xa369('0x8')](_0xa369('0x2e'),auth[_0xa369('0x9')](),controller[_0xa369('0x2f')]);router[_0xa369('0x8')](_0xa369('0x30'),auth[_0xa369('0x9')](),controller['getOpenchannelAccounts']);router['get']('/:id/sms_accounts',auth[_0xa369('0x9')](),controller[_0xa369('0x31')]);router['get'](_0xa369('0x32'),auth['isAuthenticated'](),controller[_0xa369('0x33')]);router['get'](_0xa369('0x34'),auth[_0xa369('0x9')](),controller[_0xa369('0x35')]);router[_0xa369('0x8')](_0xa369('0x36'),auth['isAuthenticated'](),controller[_0xa369('0x37')]);router[_0xa369('0x8')](_0xa369('0x38'),auth[_0xa369('0x9')](),controller[_0xa369('0x39')]);router[_0xa369('0x8')](_0xa369('0x3a'),auth[_0xa369('0x9')](),controller[_0xa369('0x3b')]);router[_0xa369('0x3c')](_0xa369('0x3d'),auth['isAuthenticated'](),controller['addContacts']);router[_0xa369('0x3c')]('/',auth[_0xa369('0x9')](),controller[_0xa369('0x3e')]);router[_0xa369('0x3c')]('/create_many',auth[_0xa369('0x9')](),controller['bulkCreate']);router[_0xa369('0x3c')](_0xa369('0x3f'),auth[_0xa369('0x9')](),controller[_0xa369('0x40')]);var upload=multer({'storage':multer[_0xa369('0x41')]({'destination':function(_0x708556,_0xbb13b8,_0xc7fe74){_0xc7fe74(null,path[_0xa369('0x42')](config[_0xa369('0x43')],_0xa369('0x44')));},'filename':function(_0x585cfb,_0x8ddaaf,_0x2d08bf){_0x2d08bf(null,util[_0xa369('0x45')]('%s-%s',Date[_0xa369('0x46')](),_0x8ddaaf[_0xa369('0x47')]));}})});router['post'](_0xa369('0x12'),upload['single'](_0xa369('0x48')),controller[_0xa369('0x49')]);router['post'](_0xa369('0x4a'),auth[_0xa369('0x9')](),controller[_0xa369('0x4b')]);router[_0xa369('0x3c')](_0xa369('0x4c'),auth[_0xa369('0x9')](),controller[_0xa369('0x4d')]);router['post'](_0xa369('0x4e'),auth[_0xa369('0x9')](),controller[_0xa369('0x4f')]);router[_0xa369('0x3c')](_0xa369('0x50'),auth[_0xa369('0x9')](),controller[_0xa369('0x51')]);router['post']('/:id/teams',auth[_0xa369('0x9')](),controller[_0xa369('0x52')]);router[_0xa369('0x3c')](_0xa369('0x53'),auth[_0xa369('0x9')](),controller[_0xa369('0x54')]);router[_0xa369('0x3c')](_0xa369('0x55'),auth[_0xa369('0x9')](),controller[_0xa369('0x56')]);router[_0xa369('0x3c')](_0xa369('0x57'),auth[_0xa369('0x9')](),controller[_0xa369('0x58')]);router[_0xa369('0x3c')](_0xa369('0x59'),auth[_0xa369('0x9')](),controller[_0xa369('0x5a')]);router['post'](_0xa369('0x5b'),auth['isAuthenticated'](),controller[_0xa369('0x5c')]);router['post']('/:id/whatsapp_interactions',auth[_0xa369('0x9')](),controller[_0xa369('0x5d')]);router['post'](_0xa369('0x2c'),auth['isAuthenticated'](),controller[_0xa369('0x5e')]);router[_0xa369('0x3c')]('/:id/mail_accounts',auth['isAuthenticated'](),controller[_0xa369('0x5f')]);router[_0xa369('0x3c')](_0xa369('0x30'),auth['isAuthenticated'](),controller[_0xa369('0x60')]);router[_0xa369('0x3c')](_0xa369('0x61'),auth[_0xa369('0x9')](),controller[_0xa369('0x62')]);router[_0xa369('0x3c')](_0xa369('0x32'),auth['isAuthenticated'](),controller[_0xa369('0x63')]);router[_0xa369('0x3c')](_0xa369('0x34'),auth[_0xa369('0x9')](),controller[_0xa369('0x64')]);router[_0xa369('0x3c')](_0xa369('0x36'),auth[_0xa369('0x9')](),controller['addSquareProjects']);router[_0xa369('0x3c')](_0xa369('0x3a'),auth[_0xa369('0x9')](),controller[_0xa369('0x65')]);router[_0xa369('0x66')]('/:id',auth['isAuthenticated'](),controller['update']);router['put'](_0xa369('0x67'),auth[_0xa369('0x9')](),controller['changePassword']);router[_0xa369('0x68')](_0xa369('0x3f'),auth['isAuthenticated'](),controller[_0xa369('0x69')]);router[_0xa369('0x68')](_0xa369('0x26'),auth[_0xa369('0x9')](),controller[_0xa369('0x6a')]);router[_0xa369('0x68')](_0xa369('0x11'),auth[_0xa369('0x9')](),controller['destroy']);router['delete'](_0xa369('0x53'),auth[_0xa369('0x9')](),controller[_0xa369('0x6b')]);router[_0xa369('0x68')]('/:id/mail_interactions',auth[_0xa369('0x9')](),controller[_0xa369('0x6c')]);router[_0xa369('0x68')](_0xa369('0x57'),auth[_0xa369('0x9')](),controller[_0xa369('0x6d')]);router[_0xa369('0x68')](_0xa369('0x59'),auth['isAuthenticated'](),controller[_0xa369('0x6e')]);router[_0xa369('0x68')](_0xa369('0x5b'),auth[_0xa369('0x9')](),controller['removeOpenchannelInteractions']);router['delete'](_0xa369('0x6f'),auth[_0xa369('0x9')](),controller[_0xa369('0x70')]);router[_0xa369('0x68')](_0xa369('0x2c'),auth[_0xa369('0x9')](),controller[_0xa369('0x71')]);router[_0xa369('0x68')]('/:id/mail_accounts',auth[_0xa369('0x9')](),controller[_0xa369('0x72')]);router[_0xa369('0x68')]('/:id/openchannel_accounts',auth['isAuthenticated'](),controller[_0xa369('0x73')]);router[_0xa369('0x68')](_0xa369('0x61'),auth[_0xa369('0x9')](),controller['removeSmsAccounts']);router['delete'](_0xa369('0x32'),auth[_0xa369('0x9')](),controller[_0xa369('0x74')]);router[_0xa369('0x68')](_0xa369('0x34'),auth['isAuthenticated'](),controller[_0xa369('0x75')]);router['delete'](_0xa369('0x36'),auth[_0xa369('0x9')](),controller['removeSquareProjects']);router[_0xa369('0x68')]('/:id/api_key',auth[_0xa369('0x9')](),controller['removeApiKey']);module[_0xa369('0x76')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 3123e8e..5beeb66 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 _0xb367=['DEFAULT\x20PAUSE','DATE','dynamic','ENUM','peer','friend','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','udp','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','join','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','always','refuse','originate','uas','fingerprint','certificate','passive','actpass','get','wss','encryption','avpf','force_avp','icesupport','dtlsverify','dtlscertfile','dtlsprivatekey','rtcp_mux','dtlsenable','dtlssetup','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','TEXT','permissions','map','true','false','screenrecording','blockedAt','loginAttempts','UNSIGNED','moment','util','lodash','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','getDataValue','email','toLowerCase','admin','user','agent','telephone','local','INTEGER','internal','format','BOOLEAN'];(function(_0x3afe18,_0x26922c){var _0x19ed1f=function(_0x1c0660){while(--_0x1c0660){_0x3afe18['push'](_0x3afe18['shift']());}};_0x19ed1f(++_0x26922c);}(_0xb367,0xf1));var _0x7b36=function(_0x11ac64,_0x55cd47){_0x11ac64=_0x11ac64-0x0;var _0x15e739=_0xb367[_0x11ac64];return _0x15e739;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x7b36('0x0'));var util=require(_0x7b36('0x1'));var _=require(_0x7b36('0x2'));module[_0x7b36('0x3')]={'name':{'type':Sequelize[_0x7b36('0x4')],'allowNull':![],'unique':_0x7b36('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x2e589f){this[_0x7b36('0x6')]('name',_0x2e589f);this['setDataValue'](_0x7b36('0x7'),_0x2e589f);},'comment':_0x7b36('0x8')},'fullname':{'type':Sequelize[_0x7b36('0x4')],'allowNull':![],'set':function(_0x2eadda){this[_0x7b36('0x6')](_0x7b36('0x9'),_0x2eadda);this[_0x7b36('0x6')](_0x7b36('0xa'),util['format']('\x22%s\x22\x20<%s>',_0x2eadda,this[_0x7b36('0xb')]('internal')));}},'alias':{'type':Sequelize[_0x7b36('0x4')]},'email':{'type':Sequelize[_0x7b36('0x4')],'allowNull':![],'unique':_0x7b36('0xc'),'validate':{'isEmail':!![]},'set':function(_0x32ea70){if(_0x32ea70){this[_0x7b36('0x6')]('email',_0x32ea70[_0x7b36('0xd')]());}}},'role':{'type':Sequelize['ENUM'](_0x7b36('0xe'),_0x7b36('0xf'),_0x7b36('0x10'),_0x7b36('0x11')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x7b36('0x4')],'defaultValue':_0x7b36('0x12')},'internal':{'type':Sequelize[_0x7b36('0x13')](0xb),'allowNull':![],'unique':_0x7b36('0x14'),'set':function(_0x3e4c11){this[_0x7b36('0x6')](_0x7b36('0x14'),_0x3e4c11);this[_0x7b36('0x6')]('accountcode',_0x3e4c11);this[_0x7b36('0x6')]('callerid',util[_0x7b36('0x15')]('\x22%s\x22\x20<%s>',this[_0x7b36('0xb')](_0x7b36('0x9')),_0x3e4c11));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x7b36('0x4')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize[_0x7b36('0x4')]},'userpic':{'type':Sequelize[_0x7b36('0x4')]},'city':{'type':Sequelize[_0x7b36('0x4')]},'country':{'type':Sequelize[_0x7b36('0x4')]},'online':{'type':Sequelize[_0x7b36('0x16')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0x7b36('0x16')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x7b36('0x16')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x7b36('0x16')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x7b36('0x16')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x7b36('0x16')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x7b36('0x4')],'defaultValue':_0x7b36('0x17')},'lastPauseAt':{'type':Sequelize[_0x7b36('0x18')]},'chatCapacity':{'type':Sequelize[_0x7b36('0x13')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x7b36('0x13')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x7b36('0x13')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x7b36('0x13')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x7b36('0x13')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x7b36('0x16')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x7b36('0x16')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x7b36('0x13')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x7b36('0x16')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x7b36('0x13')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x7b36('0x16')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x7b36('0x16')],'defaultValue':![]},'description':{'type':Sequelize[_0x7b36('0x4')],'allowNull':!![]},'host':{'type':Sequelize[_0x7b36('0x4')],'allowNull':!![],'defaultValue':_0x7b36('0x19')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0x7b36('0x13')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x7b36('0x13')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x7b36('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x7b36('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x7b36('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x7b36('0x13')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x7b36('0x1a')]('friend',_0x7b36('0xf'),_0x7b36('0x1b')),'allowNull':!![],'defaultValue':_0x7b36('0x1c')},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0x7b36('0x1a')]('ALLOWED_NOT_SCREENED',_0x7b36('0x1d'),_0x7b36('0x1e'),'ALLOWED',_0x7b36('0x1f'),_0x7b36('0x20'),'PROHIB_FAILED_SCREEN',_0x7b36('0x21')),'allowNull':!![]},'deny':{'type':Sequelize[_0x7b36('0x4')],'allowNull':!![]},'permit':{'type':Sequelize[_0x7b36('0x4')],'allowNull':!![]},'secret':{'type':Sequelize[_0x7b36('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x7b36('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x7b36('0x22'),'set':function(_0x5e6233){this[_0x7b36('0x6')](_0x7b36('0x23'),_0x5e6233?_0x5e6233['join'](','):null);},'get':function(){return this[_0x7b36('0xb')]('transport')?this['getDataValue'](_0x7b36('0x23'))[_0x7b36('0x24')](','):null;},'comment':_0x7b36('0x25')},'dtmfmode':{'type':Sequelize[_0x7b36('0x1a')](_0x7b36('0x26'),_0x7b36('0x27'),_0x7b36('0x28'),_0x7b36('0x29'),_0x7b36('0x2a')),'allowNull':!![],'defaultValue':_0x7b36('0x26')},'directmedia':{'type':Sequelize[_0x7b36('0x1a')](_0x7b36('0x2b'),'no',_0x7b36('0x2c'),_0x7b36('0x2d'),_0x7b36('0x2e')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x7b36('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x7b36('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0x7b36('0x4')],'allowNull':!![],'defaultValue':_0x7b36('0x2f'),'set':function(_0x10650d){this[_0x7b36('0x6')](_0x7b36('0x30'),_0x10650d?_0x10650d[_0x7b36('0x31')](','):null);},'get':function(){return this[_0x7b36('0xb')](_0x7b36('0x30'))?this['getDataValue'](_0x7b36('0x30'))[_0x7b36('0x24')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x7b36('0x4')]},'namedcallgroup':{'type':Sequelize[_0x7b36('0x4')]},'pickupgroup':{'type':Sequelize[_0x7b36('0x4')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x7b36('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x7b36('0x4')]},'disallow':{'type':Sequelize[_0x7b36('0x4')],'allowNull':![],'defaultValue':_0x7b36('0x32')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x7b36('0x33'),'set':function(_0x546fba){this['setDataValue'](_0x7b36('0x34'),_0x546fba?_0x546fba['join'](';'):_0x7b36('0x33'));},'get':function(){return this['getDataValue'](_0x7b36('0x34'))?this['getDataValue']('allow')[_0x7b36('0x24')](';'):null;},'comment':_0x7b36('0x35')},'autoframing':{'type':Sequelize[_0x7b36('0x1a')](_0x7b36('0x2b'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x7b36('0x4')],'allowNull':!![],'set':function(_0x3a2e7a){this[_0x7b36('0x6')]('insecure',_0x3a2e7a?_0x3a2e7a[_0x7b36('0x31')](','):null);},'get':function(){return this[_0x7b36('0xb')](_0x7b36('0x36'))?this[_0x7b36('0xb')](_0x7b36('0x36'))[_0x7b36('0x24')](','):null;},'comment':_0x7b36('0x37')},'trustrpid':{'type':Sequelize[_0x7b36('0x1a')](_0x7b36('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x7b36('0x1a')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x7b36('0x1a')]('yes','no',_0x7b36('0x38')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x7b36('0x1a')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x7b36('0x1a')](_0x7b36('0x2b'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize[_0x7b36('0x4')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x7b36('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x7b36('0x1a')](_0x7b36('0x2b'),'no'),'allowNull':!![],'defaultValue':_0x7b36('0x2b')},'busylevel':{'type':Sequelize[_0x7b36('0x13')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x7b36('0x1a')](_0x7b36('0x2b'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x7b36('0x1a')](_0x7b36('0x2b'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x7b36('0x1a')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x7b36('0x4')],'allowNull':!![]},'template':{'type':Sequelize[_0x7b36('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x7b36('0x1a')](_0x7b36('0x2b'),'no',_0x7b36('0x39')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x7b36('0x13')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x7b36('0x2b'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x7b36('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM']('accept',_0x7b36('0x3a'),_0x7b36('0x3b')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x7b36('0x13')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x7b36('0x13')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x7b36('0x1a')]('uac',_0x7b36('0x3c')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x7b36('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x7b36('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x7b36('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x7b36('0x1a')]('yes','no'),'allowNull':!![],'defaultValue':_0x7b36('0x2b')},'keepalive':{'type':Sequelize[_0x7b36('0x13')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x7b36('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x7b36('0x13')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x7b36('0x13')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x7b36('0x13')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x7b36('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x7b36('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x7b36('0x13')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x7b36('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x7b36('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x7b36('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x7b36('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x7b36('0x1a')](_0x7b36('0x2b'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x7b36('0x1a')](_0x7b36('0x2b'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x7b36('0x1a')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x7b36('0x1a')](_0x7b36('0x2b'),'no',_0x7b36('0x3d'),_0x7b36('0x3e')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x7b36('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x7b36('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x7b36('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x7b36('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x7b36('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize['ENUM']('active',_0x7b36('0x3f'),_0x7b36('0x40')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x7b36('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x7b36('0x1a')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x7b36('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x7b36('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x7b36('0x1a')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x7b36('0x1a')](_0x7b36('0x2b'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x7b36('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x7b36('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x7b36('0x1a')](_0x7b36('0x2b'),'no',_0x7b36('0x2c'),_0x7b36('0x2d'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x7b36('0x4')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0x7b36('0x18')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize[_0x7b36('0x13')],'defaultValue':0x0,'set':function(_0x44df9d){this[_0x7b36('0x6')]('showWebBar',_0x44df9d);var _0x45fc94=this[_0x7b36('0x41')]({'plain':!![]});switch(_0x44df9d){case 0x0:case 0x1:var _0xb51cd3=_0x45fc94[_0x7b36('0x23')]?_['isArray'](_0x45fc94[_0x7b36('0x23')])?_0x45fc94[_0x7b36('0x23')][_0x7b36('0x31')]():_0x45fc94[_0x7b36('0x23')]:_0x7b36('0x22');if(_0xb51cd3===_0x7b36('0x42')){_0xb51cd3=_0x7b36('0x22');}this[_0x7b36('0x6')]('transport',_0xb51cd3);this[_0x7b36('0x6')](_0x7b36('0x43'),'no');this[_0x7b36('0x6')](_0x7b36('0x44'),null);this[_0x7b36('0x6')](_0x7b36('0x45'),null);this[_0x7b36('0x6')](_0x7b36('0x46'),null);this[_0x7b36('0x6')]('dtlsenable',null);this[_0x7b36('0x6')](_0x7b36('0x47'),null);this[_0x7b36('0x6')]('dtlssetup',null);this['setDataValue'](_0x7b36('0x48'),null);this['setDataValue'](_0x7b36('0x49'),null);this['setDataValue'](_0x7b36('0x4a'),'no');break;case 0x2:this[_0x7b36('0x6')]('transport','wss');this[_0x7b36('0x6')](_0x7b36('0x43'),_0x7b36('0x2b'));this[_0x7b36('0x6')](_0x7b36('0x44'),_0x7b36('0x2b'));this[_0x7b36('0x6')](_0x7b36('0x45'),_0x7b36('0x2b'));this[_0x7b36('0x6')]('icesupport',_0x7b36('0x2b'));this['setDataValue'](_0x7b36('0x4b'),'yes');this['setDataValue']('dtlsverify','no');this[_0x7b36('0x6')](_0x7b36('0x4c'),_0x7b36('0x40'));this['setDataValue']('dtlscertfile',_0x45fc94[_0x7b36('0x48')]||_0x7b36('0x4d'));this[_0x7b36('0x6')]('dtlsprivatekey',_0x45fc94[_0x7b36('0x49')]||_0x7b36('0x4e'));this[_0x7b36('0x6')](_0x7b36('0x4a'),'yes');break;default:}}},'permissions':{'type':Sequelize[_0x7b36('0x4f')],'set':function(_0x272185){this[_0x7b36('0x6')](_0x7b36('0x50'),_0x272185?_0x272185[_0x7b36('0x31')](','):[]);},'get':function(){return this[_0x7b36('0xb')](_0x7b36('0x50'))?_[_0x7b36('0x51')](this[_0x7b36('0xb')](_0x7b36('0x50'))[_0x7b36('0x24')](','),function(_0x2ec178){return parseInt(_0x2ec178,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0x7b36('0x4')]},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0x7b36('0x16')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x7b36('0x16')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x7b36('0x16')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x7b36('0x16')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x7b36('0x16')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x7b36('0x16')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x7b36('0x13')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x7b36('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x7b36('0x1a')](_0x7b36('0x2b'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x7b36('0x16')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize[_0x7b36('0x16')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x7b36('0x16')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue']('phoneBarEnableScreenRecordingByAgent')?this['getDataValue']('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x7b36('0x16')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x7b36('0x16')],'defaultValue':![]},'interface':{'type':Sequelize[_0x7b36('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x7b36('0x16')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x7b36('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x7b36('0x16')],'defaultValue':![],'set':function(_0x3c5ea0){if(typeof _0x3c5ea0==='string'){var _0x52370b=_0x3c5ea0==='1'?!![]:_0x3c5ea0==='0'?![]:_0x3c5ea0===_0x7b36('0x52')?!![]:_0x3c5ea0===_0x7b36('0x53')?![]:![];this[_0x7b36('0x6')](_0x7b36('0x54'),_0x52370b);}else{this[_0x7b36('0x6')](_0x7b36('0x54'),_0x3c5ea0);}}},'blocked':{'type':Sequelize[_0x7b36('0x16')],'defaultValue':![],'set':function(_0x5e98e7){this[_0x7b36('0x6')]('blocked',_0x5e98e7);if(_0x5e98e7===!![]){this['setDataValue'](_0x7b36('0x55'),moment());this['setDataValue'](_0x7b36('0x56'),0x0);}else{this[_0x7b36('0x6')](_0x7b36('0x55'),null);}}},'blockedAt':{'type':Sequelize[_0x7b36('0x18')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x7b36('0x13')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x7b36('0x16')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x7b36('0x16')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x7b36('0x13')](0x5)[_0x7b36('0x57')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x7b36('0x16')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x7b36('0x16')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x7b36('0x16')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x7b36('0x16')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x7b36('0x16')],'defaultValue':![]}}; \ No newline at end of file +var _0x07d4=['friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','transport','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','inband','auto','nonat','outgoing','yes','force_rport,comedia','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','accept','originate','uas','fingerprint','certificate','active','passive','actpass','update,nonat','showWebBar','get','isArray','udp','wss','encryption','avpf','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','rtcp_mux','force_avp','dtlsprivatekey','/etc/pki/tls/private/motion.key','TEXT','permissions','map','VIRTUAL','true','false','screenrecording','blockedAt','UNSIGNED','moment','lodash','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','callerid','format','\x22%s\x22\x20<%s>','internal','email','toLowerCase','ENUM','admin','user','telephone','local','INTEGER','getDataValue','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic'];(function(_0x3e86d8,_0xaf6e5c){var _0x52daf1=function(_0xa867aa){while(--_0xa867aa){_0x3e86d8['push'](_0x3e86d8['shift']());}};_0x52daf1(++_0xaf6e5c);}(_0x07d4,0x147));var _0x407d=function(_0xc72ddf,_0x20c2ac){_0xc72ddf=_0xc72ddf-0x0;var _0x1c3cef=_0x07d4[_0xc72ddf];return _0x1c3cef;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x407d('0x0'));var util=require('util');var _=require(_0x407d('0x1'));module[_0x407d('0x2')]={'name':{'type':Sequelize[_0x407d('0x3')],'allowNull':![],'unique':_0x407d('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x31f57e){this['setDataValue'](_0x407d('0x4'),_0x31f57e);this[_0x407d('0x5')](_0x407d('0x6'),_0x31f57e);},'comment':_0x407d('0x7')},'fullname':{'type':Sequelize[_0x407d('0x3')],'allowNull':![],'set':function(_0xb36f29){this[_0x407d('0x5')]('fullname',_0xb36f29);this[_0x407d('0x5')](_0x407d('0x8'),util[_0x407d('0x9')](_0x407d('0xa'),_0xb36f29,this['getDataValue'](_0x407d('0xb'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x310c15){if(_0x310c15){this[_0x407d('0x5')](_0x407d('0xc'),_0x310c15[_0x407d('0xd')]());}}},'role':{'type':Sequelize[_0x407d('0xe')](_0x407d('0xf'),_0x407d('0x10'),'agent',_0x407d('0x11')),'allowNull':![]},'password':{'type':Sequelize[_0x407d('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x407d('0x3')],'defaultValue':_0x407d('0x12')},'internal':{'type':Sequelize[_0x407d('0x13')](0xb),'allowNull':![],'unique':_0x407d('0xb'),'set':function(_0x5e1a99){this[_0x407d('0x5')]('internal',_0x5e1a99);this['setDataValue']('accountcode',_0x5e1a99);this[_0x407d('0x5')](_0x407d('0x8'),util[_0x407d('0x9')](_0x407d('0xa'),this[_0x407d('0x14')]('fullname'),_0x5e1a99));}},'salt':{'type':Sequelize[_0x407d('0x3')]},'phone':{'type':Sequelize[_0x407d('0x3')]},'mobile':{'type':Sequelize[_0x407d('0x3')]},'address':{'type':Sequelize[_0x407d('0x3')]},'zipcode':{'type':Sequelize[_0x407d('0x3')]},'userpic':{'type':Sequelize[_0x407d('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x407d('0x3')]},'online':{'type':Sequelize[_0x407d('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x407d('0x16')]},'voicePause':{'type':Sequelize[_0x407d('0x15')],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x407d('0x15')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x407d('0x15')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x407d('0x15')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x407d('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x407d('0x3')],'defaultValue':_0x407d('0x17')},'lastPauseAt':{'type':Sequelize[_0x407d('0x16')]},'chatCapacity':{'type':Sequelize[_0x407d('0x13')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x407d('0x13')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x407d('0x13')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x407d('0x13')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x407d('0x13')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x407d('0x15')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x407d('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x407d('0x13')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x407d('0x13')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x407d('0x13')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x407d('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x407d('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x407d('0x15')],'defaultValue':![]},'description':{'type':Sequelize[_0x407d('0x3')],'allowNull':!![]},'host':{'type':Sequelize[_0x407d('0x3')],'allowNull':!![],'defaultValue':_0x407d('0x18')},'ipaddr':{'type':Sequelize[_0x407d('0x3')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x407d('0x13')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x407d('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x407d('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x407d('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x407d('0xe')](_0x407d('0x19'),_0x407d('0x10'),_0x407d('0x1a')),'allowNull':!![],'defaultValue':_0x407d('0x19')},'context':{'type':Sequelize[_0x407d('0x3')],'allowNull':!![],'defaultValue':_0x407d('0x1b')},'callingpres':{'type':Sequelize['ENUM'](_0x407d('0x1c'),_0x407d('0x1d'),_0x407d('0x1e'),_0x407d('0x1f'),'PROHIB_NOT_SCREENED',_0x407d('0x20'),'PROHIB_FAILED_SCREEN','PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x407d('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x407d('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x407d('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x407d('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x407d('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x407d('0x3')],'allowNull':!![],'defaultValue':'udp','set':function(_0x219fcd){this[_0x407d('0x5')](_0x407d('0x21'),_0x219fcd?_0x219fcd[_0x407d('0x22')](','):null);},'get':function(){return this[_0x407d('0x14')]('transport')?this[_0x407d('0x14')]('transport')['split'](','):null;},'comment':_0x407d('0x23')},'dtmfmode':{'type':Sequelize[_0x407d('0xe')](_0x407d('0x24'),_0x407d('0x25'),'shortinfo',_0x407d('0x26'),_0x407d('0x27')),'allowNull':!![],'defaultValue':_0x407d('0x24')},'directmedia':{'type':Sequelize[_0x407d('0xe')]('yes','no',_0x407d('0x28'),'update',_0x407d('0x29')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x407d('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x407d('0x3')],'allowNull':!![]},'nat':{'type':Sequelize[_0x407d('0x3')],'allowNull':!![],'defaultValue':_0x407d('0x2b'),'set':function(_0x2cc440){this['setDataValue']('nat',_0x2cc440?_0x2cc440['join'](','):null);},'get':function(){return this[_0x407d('0x14')]('nat')?this['getDataValue']('nat')['split'](','):null;},'comment':_0x407d('0x2c')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x407d('0x3')]},'pickupgroup':{'type':Sequelize[_0x407d('0x3')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x407d('0x3')]},'disallow':{'type':Sequelize[_0x407d('0x3')],'allowNull':![],'defaultValue':_0x407d('0x2d')},'allow':{'type':Sequelize[_0x407d('0x3')],'allowNull':![],'defaultValue':_0x407d('0x2e'),'set':function(_0x34cdbb){this[_0x407d('0x5')]('allow',_0x34cdbb?_0x34cdbb[_0x407d('0x22')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x407d('0x14')]('allow')?this[_0x407d('0x14')]('allow')['split'](';'):null;},'comment':_0x407d('0x2f')},'autoframing':{'type':Sequelize[_0x407d('0xe')](_0x407d('0x2a'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x407d('0x3')],'allowNull':!![],'set':function(_0x20db2c){this['setDataValue'](_0x407d('0x30'),_0x20db2c?_0x20db2c[_0x407d('0x22')](','):null);},'get':function(){return this[_0x407d('0x14')]('insecure')?this['getDataValue']('insecure')[_0x407d('0x31')](','):null;},'comment':_0x407d('0x32')},'trustrpid':{'type':Sequelize[_0x407d('0xe')](_0x407d('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x407d('0xe')](_0x407d('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x407d('0xe')](_0x407d('0x2a'),'no',_0x407d('0x33')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x407d('0xe')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x407d('0xe')](_0x407d('0x2a'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x407d('0x13')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x407d('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x407d('0x3')],'allowNull':!![],'defaultValue':_0x407d('0x34')},'amaflags':{'type':Sequelize[_0x407d('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x407d('0xe')](_0x407d('0x2a'),'no'),'allowNull':!![],'defaultValue':_0x407d('0x2a')},'busylevel':{'type':Sequelize[_0x407d('0x13')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x407d('0xe')](_0x407d('0x2a'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x407d('0x2a'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x407d('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x407d('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x407d('0xe')]('yes','no',_0x407d('0x35')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x407d('0x13')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x407d('0xe')](_0x407d('0x2a'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x407d('0xe')](_0x407d('0x36'),'refuse',_0x407d('0x37')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x407d('0x13')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x407d('0xe')]('uac',_0x407d('0x38')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x407d('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x407d('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x407d('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x407d('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x407d('0x2a'),'no'),'allowNull':!![],'defaultValue':_0x407d('0x2a')},'keepalive':{'type':Sequelize[_0x407d('0x13')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x407d('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x407d('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x407d('0x13')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x407d('0x13')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x407d('0x13')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x407d('0xe')](_0x407d('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x407d('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x407d('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x407d('0x13')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x407d('0x13')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x407d('0x13')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x407d('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x407d('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x407d('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x407d('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x407d('0x13')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x407d('0xe')](_0x407d('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x407d('0xe')](_0x407d('0x2a'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x407d('0xe')](_0x407d('0x2a'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x407d('0x2a'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x407d('0xe')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x407d('0xe')]('yes','no',_0x407d('0x39'),_0x407d('0x3a')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x407d('0x13')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x407d('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x407d('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x407d('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x407d('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x407d('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x407d('0xe')](_0x407d('0x3b'),_0x407d('0x3c'),_0x407d('0x3d')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0x407d('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x407d('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x407d('0xe')](_0x407d('0x2a'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x407d('0xe')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x407d('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x407d('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x407d('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x407d('0xe')](_0x407d('0x2a'),'no',_0x407d('0x28'),'update',_0x407d('0x3e')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x407d('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0x407d('0x16')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize[_0x407d('0x13')],'defaultValue':0x0,'set':function(_0x5d80f3){this[_0x407d('0x5')](_0x407d('0x3f'),_0x5d80f3);var _0x586912=this[_0x407d('0x40')]({'plain':!![]});switch(_0x5d80f3){case 0x0:case 0x1:var _0x1611b0=_0x586912['transport']?_[_0x407d('0x41')](_0x586912[_0x407d('0x21')])?_0x586912['transport'][_0x407d('0x22')]():_0x586912['transport']:_0x407d('0x42');if(_0x1611b0===_0x407d('0x43')){_0x1611b0='udp';}this[_0x407d('0x5')](_0x407d('0x21'),_0x1611b0);this['setDataValue'](_0x407d('0x44'),'no');this[_0x407d('0x5')](_0x407d('0x45'),null);this[_0x407d('0x5')]('force_avp',null);this[_0x407d('0x5')](_0x407d('0x46'),null);this[_0x407d('0x5')](_0x407d('0x47'),null);this[_0x407d('0x5')](_0x407d('0x48'),null);this[_0x407d('0x5')](_0x407d('0x49'),null);this[_0x407d('0x5')](_0x407d('0x4a'),null);this[_0x407d('0x5')]('dtlsprivatekey',null);this[_0x407d('0x5')](_0x407d('0x4b'),'no');break;case 0x2:this[_0x407d('0x5')]('transport',_0x407d('0x43'));this[_0x407d('0x5')](_0x407d('0x44'),_0x407d('0x2a'));this[_0x407d('0x5')]('avpf',_0x407d('0x2a'));this['setDataValue'](_0x407d('0x4c'),_0x407d('0x2a'));this[_0x407d('0x5')]('icesupport','yes');this[_0x407d('0x5')](_0x407d('0x47'),'yes');this[_0x407d('0x5')](_0x407d('0x48'),'no');this[_0x407d('0x5')](_0x407d('0x49'),'actpass');this[_0x407d('0x5')]('dtlscertfile',_0x586912[_0x407d('0x4a')]||'/etc/pki/tls/certs/motion.crt');this[_0x407d('0x5')](_0x407d('0x4d'),_0x586912[_0x407d('0x4d')]||_0x407d('0x4e'));this[_0x407d('0x5')](_0x407d('0x4b'),'yes');break;default:}}},'permissions':{'type':Sequelize[_0x407d('0x4f')],'set':function(_0x3dbbbe){this[_0x407d('0x5')](_0x407d('0x50'),_0x3dbbbe?_0x3dbbbe[_0x407d('0x22')](','):[]);},'get':function(){return this[_0x407d('0x14')]('permissions')?_[_0x407d('0x51')](this[_0x407d('0x14')](_0x407d('0x50'))[_0x407d('0x31')](','),function(_0x591954){return parseInt(_0x591954,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x407d('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x407d('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x407d('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x407d('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x407d('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x407d('0x15')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x407d('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x407d('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x407d('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x407d('0x13')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x407d('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x407d('0xe')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x407d('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x407d('0x3')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x407d('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x407d('0x52')],'get':function(){return this[_0x407d('0x14')]('phoneBarEnableScreenRecordingByAgent')?this[_0x407d('0x14')]('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x407d('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x407d('0x15')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x407d('0x15')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x407d('0x15')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x407d('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x407d('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x407d('0x15')],'defaultValue':![],'set':function(_0x54ab1a){if(typeof _0x54ab1a==='string'){var _0x31ab17=_0x54ab1a==='1'?!![]:_0x54ab1a==='0'?![]:_0x54ab1a===_0x407d('0x53')?!![]:_0x54ab1a===_0x407d('0x54')?![]:![];this[_0x407d('0x5')]('screenrecording',_0x31ab17);}else{this[_0x407d('0x5')](_0x407d('0x55'),_0x54ab1a);}}},'blocked':{'type':Sequelize[_0x407d('0x15')],'defaultValue':![],'set':function(_0x316bf9){this[_0x407d('0x5')]('blocked',_0x316bf9);if(_0x316bf9===!![]){this['setDataValue']('blockedAt',moment());this[_0x407d('0x5')]('loginAttempts',0x0);}else{this['setDataValue'](_0x407d('0x56'),null);}}},'blockedAt':{'type':Sequelize[_0x407d('0x16')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x407d('0x13')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x407d('0x15')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x407d('0x15')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x407d('0x13')](0x5)[_0x407d('0x57')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x407d('0x15')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x407d('0x15')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x407d('0x15')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x407d('0x15')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x407d('0x15')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 901b414..de49d5f 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 _0x6e8d=['getFaxQueues','Fax','Openchannel','flatten','transaction','addAgent','getDataValue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','removeTeams','Chat','Whatsapp','removeAgent','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','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','addFaxAccounts','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','removeOpenchannelAccounts','SmsAccount','getSmsAccounts','addSmsAccounts','removeSmsAccounts','ChatWebsite','getChatWebsites','addChatWebsites','removeChatWebsites','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','getScheduledCalls','$and','$or','$gt','$lt','$lte','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$overlap','$contains','$contained','CmHopper','firstName','lastName','Contact','dialActive','getApiKey','retrieveApiKey','token','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','iat','nonce','removeApiKey','apiKeyNonce','apiKeyIat','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getPresence','teams','queues','VoiceQueue','lower','col','toString','asc','substring','uniqBy','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','offline','idle','unknown','unavailable','ringing','busy','charAt','toUpperCase','InteractionId','field','ui.createdAt','user_has_','ui.UserId\x20=\x20?','OpenTabs','moment','bluebird','util','path','lodash','squel','jayson/promise','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','socket.io-emitter','redis','./user.socket','register','defaults','localhost','client','http','request','then','info','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','error','User,\x20%s,\x20%s','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','get','Users','user','Agents','agent','Telephones','telephone','filter','ignore','map','value','role','find','name','destroy','stack','send','index','User','rawAttributes','fieldName','type','key','includes','password','getOptions','where','query','includeAll','userSetting','true','attributes','rows','openTabs','chat','dataValues','push','sms','mail','openchannel','whatsapp','all','show','params','model','differenceBy','keys','salt','filters','intersection','fields','length','include','UserSetting','merge','options','fax','catch','body','describe','addContacts','ids','omit','internal','Setting','findById','securePassword','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)','QueryTypes','SELECT','from','voicemail','mailbox','VoiceMail','email','permissions','101','102','113','110','104','105','107','108','109','100','111','114','create','Unauthorized','admin','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','some','each','UserProfileSection','findAll','isEmpty','autoAssociation','changePassword','oldPassword','newPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','passwordHistoryLimit','previousPasswords','validatePasswordHistory','updatePasswordsHistory','channel','online','loginInPause','voicePause','interface','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','Queues','penalty','spread','QueueId','emit','Queue:save','voice','format','SIP/%s','UserVoiceQueueRt','upsert','removeQueues','remove','isArray','Queue:remove','addAvatar','userpic','getAvatar','server/files/images/logos/default_profile.png','download','existsSync','root','server/files/images/','join','getOpenTabs','ChatOpenTabs','createdAt','FAX','OPENCHANNEL','MAIL','SmsOpenTabs','WhatsappOpenTabs','WHATSAPP','concat','getContacts','CmContact','order','sort','pick','hasOwnProperty','CmList','List','Tag','tag','nolimit','getQueues','Queue','getVoiceQueuesRt','getGroups','ChatGroup','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','getOpenchannelInteractions','MailInteraction','SmsInteraction','getFaxInteractions','WhatsappInteraction','getWhatsappInteractions','phone','mobile','LOCAL/%s@from-sip/n','intrf','user:forcelogout','headers','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','LOGIN','PAUSE','MemberReport','LOGININPAUSE','resolve','logout','pause','QueuePause','updateAttributes','mailPause','chatPause','faxPause','openchannelPause','smsPause','whatsapppause','pauseType','lastPauseAt','unpause','manual','%s%s','getTeams','Team','addTeams','setDataValue','Voice','getChatQueues','getMailQueues','Mail','getSmsQueues','Sms','getWhatsappQueues'];(function(_0x344c76,_0x3b32ce){var _0x4a6e58=function(_0x1e22f8){while(--_0x1e22f8){_0x344c76['push'](_0x344c76['shift']());}};_0x4a6e58(++_0x3b32ce);}(_0x6e8d,0x7d));var _0xd6e8=function(_0x555bcc,_0x4cfc40){_0x555bcc=_0x555bcc-0x0;var _0xd09c84=_0x6e8d[_0x555bcc];return _0xd09c84;};'use strict';var moment=require(_0xd6e8('0x0'));var BPromise=require(_0xd6e8('0x1'));var util=require(_0xd6e8('0x2'));var path=require(_0xd6e8('0x3'));var fs=require('fs');var _=require(_0xd6e8('0x4'));var squel=require(_0xd6e8('0x5'));var jayson=require(_0xd6e8('0x6'));var Redis=require('ioredis');var authService=require(_0xd6e8('0x7'));var qs=require(_0xd6e8('0x8'));var logger=require(_0xd6e8('0x9'))(_0xd6e8('0xa'));var utils=require('../../config/utils');var config=require(_0xd6e8('0xb'));var licenseUtil=require(_0xd6e8('0xc'));var db=require(_0xd6e8('0xd'))['db'];var socket=require(_0xd6e8('0xe'))(new Redis(config[_0xd6e8('0xf')]));require(_0xd6e8('0x10'))[_0xd6e8('0x11')](socket);config['redis']=_[_0xd6e8('0x12')](config['redis'],{'host':_0xd6e8('0x13'),'port':0x18eb});var client=jayson[_0xd6e8('0x14')][_0xd6e8('0x15')]({'port':0x232a});var values;function respondWithRpcPromise(_0x4b6ba9,_0x5527e0,_0x5c32ee,_0x5dd10a){return new BPromise(function(_0x1d6122,_0x2a2dcb){var _0x1c43dc=_0x5dd10a||client;return _0x1c43dc[_0xd6e8('0x16')](_0x4b6ba9,_0x5c32ee)[_0xd6e8('0x17')](function(_0x1cb4d4){logger[_0xd6e8('0x18')]('User,\x20%s,\x20%s',_0x5527e0,_0xd6e8('0x19'));logger[_0xd6e8('0x1a')](_0xd6e8('0x1b'),_0x5527e0,_0xd6e8('0x19'),JSON['stringify'](_0x1cb4d4));if(_0x1cb4d4['error']){if(_0x1cb4d4[_0xd6e8('0x1c')]['code']===0x1f4){logger[_0xd6e8('0x1c')](_0xd6e8('0x1d'),_0x5527e0,_0x1cb4d4[_0xd6e8('0x1c')]['message']);return _0x2a2dcb(_0x1cb4d4[_0xd6e8('0x1c')][_0xd6e8('0x1e')]);}logger[_0xd6e8('0x1c')](_0xd6e8('0x1d'),_0x5527e0,_0x1cb4d4['error'][_0xd6e8('0x1e')]);return _0x1d6122(_0x1cb4d4[_0xd6e8('0x1c')][_0xd6e8('0x1e')]);}else{logger[_0xd6e8('0x18')](_0xd6e8('0x1d'),_0x5527e0,_0xd6e8('0x19'));_0x1d6122(_0x1cb4d4[_0xd6e8('0x1f')][_0xd6e8('0x1e')]);}})['catch'](function(_0x13d027){logger[_0xd6e8('0x1c')](_0xd6e8('0x1d'),_0x5527e0,_0x13d027);_0x2a2dcb(_0x13d027);});});}function respondWithStatusCode(_0x5a2fb4,_0x3712cc){_0x3712cc=_0x3712cc||0xcc;return function(_0xfbfd86){if(_0xfbfd86){return _0x5a2fb4[_0xd6e8('0x20')](_0x3712cc);}return _0x5a2fb4[_0xd6e8('0x21')](_0x3712cc)[_0xd6e8('0x22')]();};}function respondWithResult(_0x39d400,_0x17f9fb){_0x17f9fb=_0x17f9fb||0xc8;return function(_0x11330e){if(_0x11330e){return _0x39d400['status'](_0x17f9fb)[_0xd6e8('0x23')](_0x11330e);}};}function respondWithFilteredResult(_0x146dde,_0x2529c2){return function(_0x3d6d78){if(_0x3d6d78){var _0x5297c8=typeof _0x2529c2[_0xd6e8('0x24')]===_0xd6e8('0x25')&&typeof _0x2529c2[_0xd6e8('0x26')]===_0xd6e8('0x25');var _0x4bdadc=_0x3d6d78['count'];var _0x4ae214=_0x5297c8?0x0:_0x2529c2[_0xd6e8('0x24')];var _0x1ea825=_0x5297c8?_0x3d6d78[_0xd6e8('0x27')]:_0x2529c2[_0xd6e8('0x24')]+_0x2529c2[_0xd6e8('0x26')];var _0x4079de;if(_0x1ea825>=_0x4bdadc){_0x1ea825=_0x4bdadc;_0x4079de=0xc8;}else{_0x4079de=0xce;}_0x146dde[_0xd6e8('0x21')](_0x4079de);return _0x146dde[_0xd6e8('0x28')](_0xd6e8('0x29'),_0x4ae214+'-'+_0x1ea825+'/'+_0x4bdadc)[_0xd6e8('0x23')](_0x3d6d78);}return null;};}function saveUpdates(_0xc5ada5){return function(_0x217696){if(_0x217696){return _0x217696[_0xd6e8('0x2a')](_0xc5ada5)['then'](function(_0x371c18){return _0x371c18;});}return null;};}function removeEntity(_0x2ed5ff){return function(_0x52d4ed){if(_0x52d4ed){return _0x52d4ed['destroy']()['then'](function(){var _0x1b418c=_0x52d4ed[_0xd6e8('0x2b')]({'plain':!![]});if(_0x1b418c['role']==='admin')return;var _0x129f1a=[{'name':_0xd6e8('0x2c'),'value':_0xd6e8('0x2d'),'ignore':!![]},{'name':_0xd6e8('0x2e'),'value':_0xd6e8('0x2f'),'ignore':![]},{'name':_0xd6e8('0x30'),'value':_0xd6e8('0x31'),'ignore':![]}];var _0x1530e1=_(_0x129f1a)[_0xd6e8('0x32')](_0xd6e8('0x33'))[_0xd6e8('0x34')](_0xd6e8('0x35'))['value']();if(_['includes'](_0x1530e1,_0x1b418c[_0xd6e8('0x36')])){return;}var _0x5dae0b=_[_0xd6e8('0x37')](_0x129f1a,[_0xd6e8('0x35'),_0x1b418c[_0xd6e8('0x36')]])[_0xd6e8('0x38')];return db['UserProfileResource'][_0xd6e8('0x39')]({'where':{'type':_0x5dae0b,'resourceId':_0x1b418c['id']}})[_0xd6e8('0x17')](function(){return _0x52d4ed;});})[_0xd6e8('0x17')](function(){_0x2ed5ff[_0xd6e8('0x21')](0xcc)[_0xd6e8('0x22')]();});}};}function handleEntityNotFound(_0x8dd2af){return function(_0x49882d){if(!_0x49882d){_0x8dd2af[_0xd6e8('0x20')](0x194);}return _0x49882d;};}function handleError(_0x51166b,_0x3f9686){_0x3f9686=_0x3f9686||0x1f4;return function(_0xd04163){logger[_0xd6e8('0x1c')](_0xd04163[_0xd6e8('0x3a')]);if(_0xd04163[_0xd6e8('0x38')]){delete _0xd04163[_0xd6e8('0x38')];}_0x51166b['status'](_0x3f9686)[_0xd6e8('0x3b')](_0xd04163);};}exports[_0xd6e8('0x3c')]=function(_0x38cad1,_0x380045){var _0x37c182={},_0x4c423a={'count':0x0,'rows':[]};var _0x52c3cf=_(db[_0xd6e8('0x3d')][_0xd6e8('0x3e')])['map'](function(_0x557ef5){return{'name':_0x557ef5[_0xd6e8('0x3f')],'type':_0x557ef5[_0xd6e8('0x40')][_0xd6e8('0x41')]};})['filter'](function(_0x272627){return!_[_0xd6e8('0x42')]([_0xd6e8('0x43'),'salt'],_0x272627[_0xd6e8('0x38')]);})[_0xd6e8('0x35')]();_0x37c182=qs[_0xd6e8('0x44')](_0x52c3cf,_0x38cad1);var _0x10c290={'where':_0x37c182[_0xd6e8('0x45')]};return db[_0xd6e8('0x3d')][_0xd6e8('0x27')](_0x10c290)[_0xd6e8('0x17')](function(_0x1a4c23){_0x4c423a[_0xd6e8('0x27')]=_0x1a4c23;if(_0x38cad1[_0xd6e8('0x46')][_0xd6e8('0x47')]){_0x37c182['include']=[{'all':!![]}];}if(_0x38cad1[_0xd6e8('0x46')][_0xd6e8('0x48')]===_0xd6e8('0x49')){_0x37c182['include']=[{'model':db['UserSetting'],'as':'userSetting'}];}if(!_[_0xd6e8('0x42')](_0x37c182[_0xd6e8('0x4a')],'id')){_0x37c182[_0xd6e8('0x4a')]['push']('id');}return db[_0xd6e8('0x3d')]['findAll'](_0x37c182);})['then'](function(_0x1318ea){_0x4c423a[_0xd6e8('0x4b')]=_0x1318ea;if(_0x38cad1[_0xd6e8('0x46')][_0xd6e8('0x4c')]===_0xd6e8('0x49')){var _0x5c190e=[];for(var _0x375b39=0x0;_0x375b39<_0x4c423a['rows']['length'];_0x375b39++){_0x5c190e['push'](get_open_tabs(_0xd6e8('0x4d'),_0x4c423a['rows'][_0x375b39][_0xd6e8('0x4e')]));_0x5c190e[_0xd6e8('0x4f')](get_open_tabs(_0xd6e8('0x50'),_0x4c423a[_0xd6e8('0x4b')][_0x375b39]['dataValues']));_0x5c190e['push'](get_open_tabs('fax',_0x4c423a[_0xd6e8('0x4b')][_0x375b39]['dataValues']));_0x5c190e[_0xd6e8('0x4f')](get_open_tabs(_0xd6e8('0x51'),_0x4c423a[_0xd6e8('0x4b')][_0x375b39][_0xd6e8('0x4e')]));_0x5c190e['push'](get_open_tabs(_0xd6e8('0x52'),_0x4c423a[_0xd6e8('0x4b')][_0x375b39][_0xd6e8('0x4e')]));_0x5c190e[_0xd6e8('0x4f')](get_open_tabs(_0xd6e8('0x53'),_0x4c423a[_0xd6e8('0x4b')][_0x375b39][_0xd6e8('0x4e')]));}return BPromise[_0xd6e8('0x54')](_0x5c190e)[_0xd6e8('0x17')](function(){return _0x4c423a;});}else{return _0x4c423a;}})[_0xd6e8('0x17')](respondWithFilteredResult(_0x380045,_0x37c182))['catch'](handleError(_0x380045,null));};exports[_0xd6e8('0x55')]=function(_0x2f698e,_0x46a0eb){var _0x2c458b={'raw':![],'where':{'id':_0x2f698e[_0xd6e8('0x56')]['id']}},_0x318925={};_0x318925[_0xd6e8('0x57')]=_[_0xd6e8('0x58')](_[_0xd6e8('0x59')](db[_0xd6e8('0x3d')]['rawAttributes']),['password',_0xd6e8('0x5a')]);_0x318925[_0xd6e8('0x46')]=_['keys'](_0x2f698e[_0xd6e8('0x46')]);_0x318925[_0xd6e8('0x5b')]=_['intersection'](_0x318925[_0xd6e8('0x57')],_0x318925[_0xd6e8('0x46')]);_0x2c458b[_0xd6e8('0x4a')]=_[_0xd6e8('0x5c')](_0x318925[_0xd6e8('0x57')],qs[_0xd6e8('0x5d')](_0x2f698e[_0xd6e8('0x46')]['fields']));_0x2c458b[_0xd6e8('0x4a')]=_0x2c458b[_0xd6e8('0x4a')][_0xd6e8('0x5e')]?_0x2c458b[_0xd6e8('0x4a')]:_0x318925[_0xd6e8('0x57')];if(_0x2f698e[_0xd6e8('0x46')][_0xd6e8('0x47')]){_0x2c458b[_0xd6e8('0x5f')]=[{'all':!![]}];}if(_0x2f698e[_0xd6e8('0x46')][_0xd6e8('0x48')]===_0xd6e8('0x49')){_0x2c458b[_0xd6e8('0x5f')]=[{'model':db[_0xd6e8('0x60')],'as':_0xd6e8('0x48')}];}_0x2c458b=_[_0xd6e8('0x61')]({},_0x2c458b,_0x2f698e[_0xd6e8('0x62')]);if(!_[_0xd6e8('0x42')](_0x2c458b['attributes'],'id')){_0x2c458b[_0xd6e8('0x4a')][_0xd6e8('0x4f')]('id');}return db[_0xd6e8('0x3d')][_0xd6e8('0x37')](_0x2c458b)[_0xd6e8('0x17')](handleEntityNotFound(_0x46a0eb,null))[_0xd6e8('0x17')](function(_0x4d3518){var _0x36a4b3=[];values=_0x4d3518;if(_0x2f698e[_0xd6e8('0x46')][_0xd6e8('0x4c')]==='true'){_0x36a4b3[_0xd6e8('0x4f')](get_open_tabs('chat',_0x4d3518[_0xd6e8('0x4e')]));_0x36a4b3['push'](get_open_tabs(_0xd6e8('0x50'),_0x4d3518[_0xd6e8('0x4e')]));_0x36a4b3[_0xd6e8('0x4f')](get_open_tabs('openchannel',_0x4d3518[_0xd6e8('0x4e')]));_0x36a4b3[_0xd6e8('0x4f')](get_open_tabs(_0xd6e8('0x53'),_0x4d3518[_0xd6e8('0x4e')]));_0x36a4b3['push'](get_open_tabs(_0xd6e8('0x63'),_0x4d3518[_0xd6e8('0x4e')]));_0x36a4b3['push'](get_open_tabs(_0xd6e8('0x51'),_0x4d3518[_0xd6e8('0x4e')]));return BPromise['all'](_0x36a4b3);}else{return values;}})[_0xd6e8('0x17')](function(){return values;})['then'](respondWithResult(_0x46a0eb,null))[_0xd6e8('0x64')](handleError(_0x46a0eb,null));};exports[_0xd6e8('0x2a')]=function(_0x29435e,_0x5994d0){if(_0x29435e['body']['id']){delete _0x29435e['body']['id'];}delete _0x29435e['body'][_0xd6e8('0x36')];return db[_0xd6e8('0x3d')][_0xd6e8('0x37')]({'where':{'id':_0x29435e['params']['id']}})[_0xd6e8('0x17')](handleEntityNotFound(_0x5994d0,null))[_0xd6e8('0x17')](saveUpdates(_0x29435e[_0xd6e8('0x65')],null))[_0xd6e8('0x17')](respondWithResult(_0x5994d0,null))[_0xd6e8('0x64')](handleError(_0x5994d0,null));};exports['describe']=function(_0x5800ae,_0x5b8ab2){return db['User'][_0xd6e8('0x66')]()[_0xd6e8('0x17')](respondWithResult(_0x5b8ab2,null))[_0xd6e8('0x64')](handleError(_0x5b8ab2,null));};exports[_0xd6e8('0x67')]=function(_0xfcd24d,_0x210d17){return db[_0xd6e8('0x3d')][_0xd6e8('0x37')]({'where':{'id':_0xfcd24d['params']['id']}})[_0xd6e8('0x17')](handleEntityNotFound(_0x210d17,null))[_0xd6e8('0x17')](function(_0x373f36){if(_0x373f36){return _0x373f36['addContacts'](_0xfcd24d['body'][_0xd6e8('0x68')],_[_0xd6e8('0x69')](_0xfcd24d[_0xd6e8('0x65')],['ids','id'])||{});}})[_0xd6e8('0x17')](respondWithResult(_0x210d17,null))[_0xd6e8('0x64')](handleError(_0x210d17,null));};function validateUser(_0x30b261){return new BPromise(function(_0x5a5ab8,_0x299737){if(_0x30b261[_0xd6e8('0x6a')])return _0x5a5ab8(_0x30b261);return db[_0xd6e8('0x6b')][_0xd6e8('0x6c')](0x1)[_0xd6e8('0x17')](function(_0x435d2c){if(_0x435d2c[_0xd6e8('0x6d')])authService[_0xd6e8('0x6e')](_0x30b261['password']);db[_0xd6e8('0x3d')][_0xd6e8('0x6f')](_0xd6e8('0x6a'))[_0xd6e8('0x17')](function(_0x22a26c){if(_[_0xd6e8('0x70')](_0x22a26c)){_0x30b261[_0xd6e8('0x6a')]=_0x435d2c[_0xd6e8('0x71')]||0x1;return;}if(_[_0xd6e8('0x70')](_0x435d2c[_0xd6e8('0x71')])||_0x435d2c[_0xd6e8('0x71')]===_0x22a26c){_0x30b261[_0xd6e8('0x6a')]=_0x22a26c+0x1;return;}if(_0x435d2c[_0xd6e8('0x71')]>_0x22a26c){_0x30b261['internal']=_0x435d2c['min_internal'];return;}return db[_0xd6e8('0x72')][_0xd6e8('0x46')](_0xd6e8('0x73'),{'type':db['sequelize'][_0xd6e8('0x74')][_0xd6e8('0x75')]})[_0xd6e8('0x17')](function(_0xfea81f){if(_0xfea81f&&_0xfea81f[_0xd6e8('0x5e')]){for(var _0x5945c7=0x0,_0x1600f2=_0xfea81f[_0xd6e8('0x5e')];_0x5945c7<_0x1600f2&&_[_0xd6e8('0x70')](_0x30b261[_0xd6e8('0x6a')]);_0x5945c7++){if(_0x435d2c[_0xd6e8('0x71')]<=_0xfea81f[_0x5945c7][_0xd6e8('0x76')]){_0x30b261[_0xd6e8('0x6a')]=_0xfea81f[_0x5945c7][_0xd6e8('0x76')];}else if(_0x435d2c[_0xd6e8('0x71')]>_0xfea81f[_0x5945c7][_0xd6e8('0x76')]&&_0x435d2c[_0xd6e8('0x71')]<=_0xfea81f[_0x5945c7]['to']){_0x30b261[_0xd6e8('0x6a')]=_0x435d2c[_0xd6e8('0x71')];}}}if(_[_0xd6e8('0x70')](_0x30b261[_0xd6e8('0x6a')])){_0x30b261['internal']=_0x22a26c+0x1;}return _0x5a5ab8(_0x30b261);});});})['catch'](function(_0x4c3586){_0x299737(_0x4c3586);});});}function updateUser(_0x39cd2c){return new BPromise(function(_0x49a906,_0x3c09bf){try{if(_0x39cd2c[_0xd6e8('0x77')]){_0x39cd2c[_0xd6e8('0x78')]=_0x39cd2c['internal'];_0x39cd2c[_0xd6e8('0x79')]={'mailbox':_0x39cd2c[_0xd6e8('0x6a')],'password':_0x39cd2c[_0xd6e8('0x43')],'fullname':_0x39cd2c['fullname'],'email':_0x39cd2c[_0xd6e8('0x7a')]};}if(_0x39cd2c[_0xd6e8('0x36')]==='agent'){if(!_0x39cd2c[_0xd6e8('0x7b')])_0x39cd2c['permissions']=[_0xd6e8('0x7c'),_0xd6e8('0x7d'),'103',_0xd6e8('0x7e'),_0xd6e8('0x7f'),_0xd6e8('0x80'),_0xd6e8('0x81'),'106',_0xd6e8('0x82'),_0xd6e8('0x83'),_0xd6e8('0x84'),_0xd6e8('0x85'),_0xd6e8('0x86'),_0xd6e8('0x87'),'115'];}_0x49a906(_0x39cd2c);}catch(_0x46cf85){_0x3c09bf(_0x46cf85);}});}exports[_0xd6e8('0x88')]=function(_0x6ef9d6,_0xd33a1b){if(_0x6ef9d6['user'][_0xd6e8('0x36')]===_0xd6e8('0x2f'))throw new Error(_0xd6e8('0x89'));if(_0x6ef9d6[_0xd6e8('0x65')][_0xd6e8('0x36')]===_0xd6e8('0x2d')&&_0x6ef9d6['user'][_0xd6e8('0x36')]!==_0xd6e8('0x8a')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x6ef9d6[_0xd6e8('0x65')][_0xd6e8('0x36')]===_0xd6e8('0x8a')&&_0x6ef9d6[_0xd6e8('0x2d')]['role']!==_0xd6e8('0x8a')){throw new Error(_0xd6e8('0x8b'));}return licenseUtil[_0xd6e8('0x8c')]([_0x6ef9d6[_0xd6e8('0x65')]])[_0xd6e8('0x17')](function(){return validateUser(_0x6ef9d6[_0xd6e8('0x65')]);})['then'](function(_0x2961b0){return updateUser(_0x2961b0)[_0xd6e8('0x17')](function(_0x10055b){if(_0x10055b[_0xd6e8('0x36')]===_0xd6e8('0x8a')){_0x10055b[_0xd6e8('0x8d')]=_0x6ef9d6[_0xd6e8('0x2d')]['settingsEnabled'];delete _0x10055b[_0xd6e8('0x8e')];}return _0x10055b;});})[_0xd6e8('0x17')](function(_0x482960){return db[_0xd6e8('0x3d')][_0xd6e8('0x88')](_0x482960,{'include':[{'model':db[_0xd6e8('0x79')],'as':_0xd6e8('0x79')}]});})[_0xd6e8('0x17')](function(_0x1d040e){if(_0x6ef9d6[_0xd6e8('0x65')][_0xd6e8('0x36')]==='user')return _0x1d040e;if(_0x6ef9d6[_0xd6e8('0x2d')][_0xd6e8('0x36')]!=='user')return _0x1d040e;return db['UserProfileSection'][_0xd6e8('0x37')]({'where':{'name':_0x1d040e['role']===_0xd6e8('0x2f')?_0xd6e8('0x2e'):_0xd6e8('0x30'),'userProfileId':_0x6ef9d6[_0xd6e8('0x2d')][_0xd6e8('0x8e')]},'raw':!![]})[_0xd6e8('0x17')](function(_0x3f1ea7){if(!_0x3f1ea7||_0x3f1ea7['autoAssociation']!=0x0)return _0x1d040e;return db[_0xd6e8('0x8f')][_0xd6e8('0x88')]({'name':_0x1d040e[_0xd6e8('0x38')],'resourceId':_0x1d040e['id'],'type':_0x3f1ea7[_0xd6e8('0x38')],'sectionId':_0x3f1ea7['id']},{})[_0xd6e8('0x17')](function(){return _0x1d040e;});})[_0xd6e8('0x64')](function(_0x177b1f){logger[_0xd6e8('0x1c')](_0xd6e8('0x90'),_0x177b1f);throw _0x177b1f;});})[_0xd6e8('0x17')](respondWithResult(_0xd33a1b,0xc9))['catch'](handleError(_0xd33a1b,null));};exports[_0xd6e8('0x91')]=function(_0x5c97b9,_0x1bf28f){var _0x1bae86=_0x5c97b9[_0xd6e8('0x65')];var _0x313a1b=[];if(_0x5c97b9[_0xd6e8('0x2d')][_0xd6e8('0x36')]==='agent')throw new Error(_0xd6e8('0x89'));if(_['some'](_0x1bae86,[_0xd6e8('0x36'),_0xd6e8('0x2d')])&&_0x5c97b9[_0xd6e8('0x2d')][_0xd6e8('0x36')]!==_0xd6e8('0x8a')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_[_0xd6e8('0x92')](_0x1bae86,['role',_0xd6e8('0x8a')])&&_0x5c97b9['user'][_0xd6e8('0x36')]!==_0xd6e8('0x8a')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil['checkUserLimits'](_0x1bae86)[_0xd6e8('0x17')](function(){return validateUser(_0x1bae86[0x0]);})[_0xd6e8('0x17')](function(){for(var _0x2f612c=0x1;_0x2f612c<_0x1bae86['length'];_0x2f612c++){var _0x415b3a=_0x1bae86[_0x2f612c-0x1][_0xd6e8('0x6a')];if(!_0x1bae86[_0x2f612c][_0xd6e8('0x6a')])_0x1bae86[_0x2f612c]['internal']=_0x415b3a+0x1;_0x313a1b[_0xd6e8('0x4f')](validateUser(_0x1bae86[_0x2f612c]));}return BPromise[_0xd6e8('0x54')](_0x313a1b);})[_0xd6e8('0x17')](function(){_0x313a1b=[];for(var _0x19fe2f=0x0;_0x19fe2f<_0x1bae86[_0xd6e8('0x5e')];_0x19fe2f++){_0x313a1b['push'](updateUser(_0x1bae86[_0x19fe2f]));}return BPromise['all'](_0x313a1b);})['then'](function(){return BPromise[_0xd6e8('0x93')](_0x1bae86,function(_0x320824){return db['User'][_0xd6e8('0x88')](_0x320824,{'include':[{'model':db[_0xd6e8('0x79')],'as':_0xd6e8('0x79')}]})['then'](function(_0x4db5d2){_0x320824['id']=_0x4db5d2['id'];return _0x320824;});});})[_0xd6e8('0x17')](function(_0x1eb80b){if(_0x5c97b9[_0xd6e8('0x65')][_0xd6e8('0x36')]===_0xd6e8('0x2d'))return _0x1eb80b;if(_0x5c97b9[_0xd6e8('0x2d')][_0xd6e8('0x36')]!==_0xd6e8('0x2d'))return _0x1eb80b;var _0x227f4b=_[_0xd6e8('0x92')](_0x1eb80b,function(_0x3dc091){return _0x3dc091[_0xd6e8('0x36')]===_0xd6e8('0x2f')||_0x3dc091[_0xd6e8('0x36')]==='telephone';});if(!_0x227f4b)return _0x1eb80b;return db[_0xd6e8('0x94')][_0xd6e8('0x95')]({'where':{'name':{'$or':[_0xd6e8('0x2e'),_0xd6e8('0x30')]},'userProfileId':_0x5c97b9[_0xd6e8('0x2d')][_0xd6e8('0x8e')]},'raw':!![]})['then'](function(_0x3c43f){if(_[_0xd6e8('0x96')](_0x3c43f)||!_[_0xd6e8('0x92')](_0x3c43f,[_0xd6e8('0x97'),0x0]))return _0x1eb80b;_0x313a1b=[];var _0x28c04a=_(_0x3c43f)['map'](function(_0x1c5461){if(_0x1c5461[_0xd6e8('0x97')]===0x1)return;return _0x1c5461[_0xd6e8('0x38')]==='Agents'?_0xd6e8('0x2f'):'telephone';})['compact']()['value']();for(var _0x396260=0x0;_0x396260<_0x1eb80b[_0xd6e8('0x5e')];_0x396260++){if(!_[_0xd6e8('0x42')](_0x28c04a,_0x1eb80b[_0x396260][_0xd6e8('0x36')]))return;var _0x2092d3=_0x1eb80b[_0x396260][_0xd6e8('0x36')]===_0xd6e8('0x2f')?'Agents':_0xd6e8('0x30');_0x313a1b['push'](db[_0xd6e8('0x8f')][_0xd6e8('0x88')]({'name':_0x1eb80b[_0x396260][_0xd6e8('0x38')],'resourceId':_0x1eb80b[_0x396260]['id'],'type':_0x2092d3,'sectionId':_[_0xd6e8('0x37')](_0x3c43f,[_0xd6e8('0x38'),_0x2092d3])['id']},{}));}return BPromise[_0xd6e8('0x54')](_0x313a1b);});})[_0xd6e8('0x17')](respondWithResult(_0x1bf28f,0xc9))['catch'](handleError(_0x1bf28f,null));};exports[_0xd6e8('0x98')]=function(_0x19e425,_0x1791f4){if(_0x19e425[_0xd6e8('0x65')]['id']){delete _0x19e425['body']['id'];}return db['User'][_0xd6e8('0x37')]({'where':{'id':_0x19e425[_0xd6e8('0x56')]['id']}})['then'](function(_0x1c628e){if(!_0x1c628e)return null;if(_0x1c628e['id']===_0x19e425['user']['id']){if(!_0x19e425['body'][_0xd6e8('0x99')]||!_0x19e425['body'][_0xd6e8('0x9a')]){throw new db[(_0xd6e8('0x9b'))][(_0xd6e8('0x9c'))](_0xd6e8('0x9d'));}if(!_0x1c628e[_0xd6e8('0x9e')](_0x19e425[_0xd6e8('0x65')][_0xd6e8('0x99')])){throw new db['Sequelize'][(_0xd6e8('0x9c'))](_0xd6e8('0x9f'));}if(_0x19e425[_0xd6e8('0x65')][_0xd6e8('0x99')]===_0x19e425['body']['newPassword']){throw new db[(_0xd6e8('0x9b'))][(_0xd6e8('0x9c'))](_0xd6e8('0xa0'));}}else if(_0x19e425[_0xd6e8('0x2d')][_0xd6e8('0x36')]===_0xd6e8('0x8a')){if(!_0x19e425[_0xd6e8('0x65')][_0xd6e8('0x9a')]){throw new db['Sequelize'][(_0xd6e8('0x9c'))](_0xd6e8('0xa1'));}}else if(_0x19e425[_0xd6e8('0x2d')][_0xd6e8('0x36')]===_0xd6e8('0x2d')){if(!_0x19e425[_0xd6e8('0x65')]['newPassword']){throw new db[(_0xd6e8('0x9b'))][(_0xd6e8('0x9c'))](_0xd6e8('0xa1'));}if(_0x1c628e[_0xd6e8('0x36')]!==_0xd6e8('0x2f')){throw new db[(_0xd6e8('0x9b'))]['ValidationError'](_0xd6e8('0x89'));}}else{throw new db[(_0xd6e8('0x9b'))]['ValidationError'](_0xd6e8('0x89'));}return _0x1c628e;})[_0xd6e8('0x17')](handleEntityNotFound(_0x1791f4,null))[_0xd6e8('0x17')](function(_0x46011d){return db[_0xd6e8('0x6b')][_0xd6e8('0xa2')]({'attributes':['id',_0xd6e8('0x6d'),'enforcePasswordHistory',_0xd6e8('0xa3')]})[_0xd6e8('0x17')](function(_0x38647a){if(_0x38647a[_0xd6e8('0x6d')])authService[_0xd6e8('0x6e')](_0x19e425[_0xd6e8('0x65')][_0xd6e8('0x9a')]);if(!_0x38647a['enforcePasswordHistory']||!_0x46011d[_0xd6e8('0xa4')])return _0x46011d;authService[_0xd6e8('0xa5')](_0x19e425[_0xd6e8('0x65')][_0xd6e8('0x9a')],_0x46011d['previousPasswords'],_0x38647a['passwordHistoryLimit']);return _0x46011d;})[_0xd6e8('0x17')](saveUpdates({'password':_0x19e425[_0xd6e8('0x65')][_0xd6e8('0x9a')],'passwordResetAt':_0x19e425[_0xd6e8('0x2d')]['id']==_0x19e425['params']['id']?moment():null,'previousPasswords':authService[_0xd6e8('0xa6')](_0x19e425[_0xd6e8('0x65')][_0xd6e8('0x9a')],_0x46011d[_0xd6e8('0xa4')])},null));})[_0xd6e8('0x17')](respondWithResult(_0x1791f4,null))[_0xd6e8('0x64')](handleError(_0x1791f4,null));};exports['addQueues']=function(_0xa689e1,_0x32452c){var _0x5c3f83=_0xa689e1[_0xd6e8('0x65')][_0xd6e8('0xa7')];return db[_0xd6e8('0x3d')][_0xd6e8('0x37')]({'where':{'id':_0xa689e1[_0xd6e8('0x56')]['id']},'attributes':['id',_0xd6e8('0x38'),_0xd6e8('0x36'),_0xd6e8('0xa8'),_0xd6e8('0xa9'),_0xd6e8('0xaa'),_0xd6e8('0xab')]})[_0xd6e8('0x17')](handleEntityNotFound(_0x32452c,null))['then'](function(_0x4b840a){if(_0x4b840a){if(!utils[_0xd6e8('0xac')](_0x5c3f83)){throw new db['Sequelize'][(_0xd6e8('0x9c'))](_0xd6e8('0xad'));}return _0x4b840a[_0xd6e8('0xae')+_[_0xd6e8('0xaf')](_0x5c3f83[_0xd6e8('0xb0')]())+_0xd6e8('0xb1')](_0xa689e1[_0xd6e8('0x65')][_0xd6e8('0x68')],{'penalty':_0xa689e1[_0xd6e8('0x65')][_0xd6e8('0xb2')]||0x0})[_0xd6e8('0xb3')](function(_0x32266f){for(var _0x8dbc81=0x0;_0x8dbc81<_0xa689e1[_0xd6e8('0x65')]['ids'][_0xd6e8('0x5e')];_0x8dbc81+=0x1){var _0x17045f={'UserId':Number(_0xa689e1['params']['id'])};_0x17045f[_[_0xd6e8('0xaf')](_0x5c3f83['toLowerCase']())+_0xd6e8('0xb4')]=Number(_0xa689e1[_0xd6e8('0x65')][_0xd6e8('0x68')][_0x8dbc81]);socket[_0xd6e8('0xb5')](_0xd6e8('0x2d')+_['capitalize'](_0x5c3f83['toLowerCase']())+_0xd6e8('0xb6'),_0x17045f);}return _0x32266f;})[_0xd6e8('0x17')](function(){if(_0x5c3f83===_0xd6e8('0xb7')){return db['VoiceQueue']['findAll']({'where':{'id':_0xa689e1[_0xd6e8('0x65')]['ids']||[]},'raw':!![],'attributes':['id',_0xd6e8('0x38')]});}})[_0xd6e8('0x17')](function(_0x3bcfee){var _0x169b1d=_0x4b840a['get']({'plain':!![]});var _0x4a8e50=[];if(_0x5c3f83===_0xd6e8('0xb7')&&_0x169b1d[_0xd6e8('0x36')]==='agent'&&_0x169b1d[_0xd6e8('0xa8')]){for(var _0xe8dfc5=0x0;_0xe8dfc5<_0x3bcfee[_0xd6e8('0x5e')];_0xe8dfc5+=0x1){_0x4a8e50[_0xd6e8('0x4f')]({'membername':_0x169b1d[_0xd6e8('0x38')],'UserId':_0x169b1d['id'],'queue_name':_0x3bcfee[_0xe8dfc5]['name'],'VoiceQueueId':_0x3bcfee[_0xe8dfc5]['id'],'interface':_[_0xd6e8('0x70')](_0x169b1d[_0xd6e8('0xab')])?util[_0xd6e8('0xb8')](_0xd6e8('0xb9'),_0x169b1d[_0xd6e8('0x38')]):_0x169b1d[_0xd6e8('0xab')],'paused':_0x169b1d['voicePause']||![],'penalty':_0xa689e1[_0xd6e8('0x65')][_0xd6e8('0xb2')]||0x0});}return BPromise['each'](_0x4a8e50,function(_0x2aa014){return db[_0xd6e8('0xba')][_0xd6e8('0xbb')](_0x2aa014);});}return _0x4b840a;});}})[_0xd6e8('0x17')](respondWithStatusCode(_0x32452c,null))[_0xd6e8('0x64')](handleError(_0x32452c,null));};exports[_0xd6e8('0xbc')]=function(_0x24a71b,_0x44718c){var _0x327520,_0x255c72;return db['User']['find']({'where':{'id':_0x24a71b[_0xd6e8('0x56')]['id']},'attributes':['id',_0xd6e8('0x38'),_0xd6e8('0x36')]})[_0xd6e8('0x17')](handleEntityNotFound(_0x44718c,null))[_0xd6e8('0x17')](function(_0x28a9c7){if(_0x28a9c7){_0x327520=_0x28a9c7;if(!_0x24a71b[_0xd6e8('0x46')][_0xd6e8('0xa7')]||!utils[_0xd6e8('0xac')](_0x24a71b[_0xd6e8('0x46')][_0xd6e8('0xa7')])){throw new db[(_0xd6e8('0x9b'))][(_0xd6e8('0x9c'))](_0xd6e8('0xad'));}return _0x28a9c7[_0xd6e8('0xbd')+_[_0xd6e8('0xaf')](_0x24a71b['query']['channel'][_0xd6e8('0xb0')]())+'Queues'](_0x24a71b[_0xd6e8('0x46')]['ids']);}})[_0xd6e8('0x17')](function(_0x2e507c){if(_[_0xd6e8('0xbe')](_0x24a71b[_0xd6e8('0x46')][_0xd6e8('0x68')])){for(var _0x13cbc7=0x0;_0x13cbc7<_0x24a71b['query'][_0xd6e8('0x68')][_0xd6e8('0x5e')];_0x13cbc7+=0x1){_0x255c72={'UserId':Number(_0x24a71b[_0xd6e8('0x56')]['id'])};_0x255c72[_[_0xd6e8('0xaf')](_0x24a71b[_0xd6e8('0x46')][_0xd6e8('0xa7')]['toLowerCase']())+_0xd6e8('0xb4')]=Number(_0x24a71b[_0xd6e8('0x46')][_0xd6e8('0x68')][_0x13cbc7]);socket[_0xd6e8('0xb5')](_0xd6e8('0x2d')+_[_0xd6e8('0xaf')](_0x24a71b[_0xd6e8('0x46')][_0xd6e8('0xa7')][_0xd6e8('0xb0')]())+_0xd6e8('0xbf'),_0x255c72);}}else{_0x255c72={'UserId':Number(_0x24a71b[_0xd6e8('0x56')]['id'])};_0x255c72[_[_0xd6e8('0xaf')](_0x24a71b[_0xd6e8('0x46')][_0xd6e8('0xa7')][_0xd6e8('0xb0')]())+_0xd6e8('0xb4')]=Number(_0x24a71b['query'][_0xd6e8('0x68')]);socket[_0xd6e8('0xb5')](_0xd6e8('0x2d')+_[_0xd6e8('0xaf')](_0x24a71b[_0xd6e8('0x46')][_0xd6e8('0xa7')][_0xd6e8('0xb0')]())+'Queue:remove',_0x255c72);}return _0x2e507c;})['then'](function(){if(_0x24a71b[_0xd6e8('0x46')]['channel']===_0xd6e8('0xb7')){return db[_0xd6e8('0xba')]['destroy']({'where':{'UserId':_0x24a71b[_0xd6e8('0x56')]['id'],'VoiceQueueId':_0x24a71b[_0xd6e8('0x46')]['ids']},'individualHooks':!![]})['then'](function(){return _0x327520;});}return _0x327520;})[_0xd6e8('0x17')](respondWithStatusCode(_0x44718c,null))[_0xd6e8('0x64')](handleError(_0x44718c,null));};exports[_0xd6e8('0xc0')]=function(_0x3b7688,_0x14bf31){_0x3b7688[_0xd6e8('0x65')][_0xd6e8('0xc1')]=_0x3b7688['file']['filename'];return db[_0xd6e8('0x3d')]['find']({'where':{'id':_0x3b7688['params']['id']}})[_0xd6e8('0x17')](handleEntityNotFound(_0x14bf31,null))[_0xd6e8('0x17')](saveUpdates(_0x3b7688[_0xd6e8('0x65')],null))[_0xd6e8('0x17')](respondWithResult(_0x14bf31,null))['catch'](handleError(_0x14bf31,null));};exports[_0xd6e8('0xc2')]=function(_0x302fcb,_0x4578c5){var _0xaaa51d=path['join'](config['root'],_0xd6e8('0xc3'));return db[_0xd6e8('0x3d')]['find']({'where':{'id':_0x302fcb['params']['id']},'attributes':['id',_0xd6e8('0xc1')],'raw':!![]})['then'](handleEntityNotFound(_0x4578c5,null))['then'](function(_0x731d77){if(_0x731d77){if(_[_0xd6e8('0x70')](_0x731d77[_0xd6e8('0xc1')])){return _0x4578c5[_0xd6e8('0xc4')](_0xaaa51d);}else{if(!fs[_0xd6e8('0xc5')](path['join'](config[_0xd6e8('0xc6')],_0xd6e8('0xc7'),_0x731d77[_0xd6e8('0xc1')]))){return _0x4578c5[_0xd6e8('0xc4')](_0xaaa51d);}return _0x4578c5[_0xd6e8('0xc4')](path[_0xd6e8('0xc8')](config[_0xd6e8('0xc6')],_0xd6e8('0xc7'),_0x731d77['userpic']));}}})[_0xd6e8('0x64')](handleError(_0x4578c5,null));};exports[_0xd6e8('0xc9')]=function(_0x455af1,_0xd02ce1){return db[_0xd6e8('0x3d')][_0xd6e8('0x37')]({'where':{'id':_0x455af1['params']['id']},'attributes':['id']})[_0xd6e8('0x17')](handleEntityNotFound(_0xd02ce1,null))['then'](function(_0x331bcd){var _0x335599=[];values=_0x331bcd[_0xd6e8('0x4e')];_0x335599[_0xd6e8('0x4f')](get_open_tabs(_0xd6e8('0x4d'),_0x331bcd[_0xd6e8('0x4e')]));_0x335599['push'](get_open_tabs(_0xd6e8('0x50'),_0x331bcd[_0xd6e8('0x4e')]));_0x335599[_0xd6e8('0x4f')](get_open_tabs(_0xd6e8('0x52'),_0x331bcd[_0xd6e8('0x4e')]));_0x335599[_0xd6e8('0x4f')](get_open_tabs(_0xd6e8('0x53'),_0x331bcd[_0xd6e8('0x4e')]));_0x335599[_0xd6e8('0x4f')](get_open_tabs(_0xd6e8('0x63'),_0x331bcd[_0xd6e8('0x4e')]));_0x335599[_0xd6e8('0x4f')](get_open_tabs(_0xd6e8('0x51'),_0x331bcd[_0xd6e8('0x4e')]));return BPromise[_0xd6e8('0x54')](_0x335599);})[_0xd6e8('0x17')](function(_0x4ae43d){if(_0x4ae43d){var _0x19b6e5=_[_0xd6e8('0x34')](values[_0xd6e8('0xca')],function(_0xbd6e80){return{'channel':'CHAT','id':_0xbd6e80['id'],'createdAt':_0xbd6e80[_0xd6e8('0xcb')]};});var _0x5306e5=_[_0xd6e8('0x34')](values['FaxOpenTabs'],function(_0x3ab4de){return{'channel':_0xd6e8('0xcc'),'id':_0x3ab4de['id'],'createdAt':_0x3ab4de[_0xd6e8('0xcb')]};});var _0x41b145=_[_0xd6e8('0x34')](values['OpenchannelOpenTabs'],function(_0x4c9a16){return{'channel':_0xd6e8('0xcd'),'id':_0x4c9a16['id'],'createdAt':_0x4c9a16[_0xd6e8('0xcb')]};});var _0x47e753=_['map'](values['MailOpenTabs'],function(_0x2a84c8){return{'channel':_0xd6e8('0xce'),'id':_0x2a84c8['id'],'createdAt':_0x2a84c8[_0xd6e8('0xcb')]};});var _0xa9100c=_[_0xd6e8('0x34')](values[_0xd6e8('0xcf')],function(_0x1ddef1){return{'channel':'SMS','id':_0x1ddef1['id'],'createdAt':_0x1ddef1['createdAt']};});var _0x5eba64=_[_0xd6e8('0x34')](values[_0xd6e8('0xd0')],function(_0xf97700){return{'channel':_0xd6e8('0xd1'),'id':_0xf97700['id'],'createdAt':_0xf97700[_0xd6e8('0xcb')]};});var _0x158c81=_[_0xd6e8('0xd2')](_0x19b6e5,_0x5306e5,_0x41b145,_0x47e753,_0xa9100c,_0x5eba64);var _0x25f239={'count':_0x158c81[_0xd6e8('0x5e')],'rows':_0x158c81};return _0x25f239;}else return null;})[_0xd6e8('0x17')](respondWithResult(_0xd02ce1,null))[_0xd6e8('0x64')](handleError(_0xd02ce1,null));};exports[_0xd6e8('0xd3')]=function(_0xd76eab,_0xf15ac1){var _0x173800={};var _0x4492e0={};var _0x252ae2;var _0x4801f9;return db[_0xd6e8('0x3d')][_0xd6e8('0xa2')]({'where':{'id':_0xd76eab[_0xd6e8('0x56')]['id']}})[_0xd6e8('0x17')](handleEntityNotFound(_0xf15ac1,null))[_0xd6e8('0x17')](function(_0x90cbf7){if(_0x90cbf7){_0x252ae2=_0x90cbf7;_0x4492e0[_0xd6e8('0x57')]=_[_0xd6e8('0x59')](db[_0xd6e8('0xd4')][_0xd6e8('0x3e')]);_0x4492e0[_0xd6e8('0x46')]=_['keys'](_0xd76eab[_0xd6e8('0x46')]);_0x4492e0[_0xd6e8('0x5b')]=_['intersection'](_0x4492e0[_0xd6e8('0x57')],_0x4492e0['query']);_0x173800[_0xd6e8('0x4a')]=_[_0xd6e8('0x5c')](_0x4492e0[_0xd6e8('0x57')],qs[_0xd6e8('0x5d')](_0xd76eab[_0xd6e8('0x46')]['fields']));_0x173800[_0xd6e8('0x4a')]=_0x173800['attributes']['length']?_0x173800[_0xd6e8('0x4a')]:_0x4492e0[_0xd6e8('0x57')];_0x173800[_0xd6e8('0xd5')]=qs[_0xd6e8('0xd6')](_0xd76eab[_0xd6e8('0x46')]['sort']);_0x173800[_0xd6e8('0x45')]=qs[_0xd6e8('0x5b')](_[_0xd6e8('0xd7')](_0xd76eab[_0xd6e8('0x46')],_0x4492e0[_0xd6e8('0x5b')]));if(_0xd76eab['query']['filter']){_0x173800[_0xd6e8('0x45')]=_[_0xd6e8('0x61')](_0x173800[_0xd6e8('0x45')],{'$or':_[_0xd6e8('0x34')](_0x173800[_0xd6e8('0x4a')],function(_0x366144){var _0x2cb0a4={};_0x2cb0a4[_0x366144]={'$like':'%'+_0xd76eab[_0xd6e8('0x46')]['filter']+'%'};return _0x2cb0a4;})});}_0x173800=_[_0xd6e8('0x61')]({},_0x173800,_0xd76eab['options']);return _0x252ae2[_0xd6e8('0xd3')](_0x173800);}})[_0xd6e8('0x17')](function(_0xe37d0e){if(_0xe37d0e){_0x4801f9=_0xe37d0e['length'];if(_0xd76eab[_0xd6e8('0x46')][_0xd6e8('0xd8')](_0xd6e8('0x47'))){_0x173800['include']=[{'model':db[_0xd6e8('0xd9')],'as':_0xd6e8('0xda'),'required':![]},{'model':db[_0xd6e8('0xdb')],'as':'Tags','attributes':['id','name','color'],'where':_0xd76eab[_0xd6e8('0x46')][_0xd6e8('0xdc')]?{'id':_0xd76eab[_0xd6e8('0x46')]['tag']}:undefined,'required':_0xd76eab[_0xd6e8('0x46')][_0xd6e8('0xdc')]?!![]:![]}];}if(!_0xd76eab[_0xd6e8('0x46')]['hasOwnProperty'](_0xd6e8('0xdd'))){_0x173800[_0xd6e8('0x26')]=qs[_0xd6e8('0x26')](_0xd76eab['query'][_0xd6e8('0x26')]);_0x173800[_0xd6e8('0x24')]=qs[_0xd6e8('0x24')](_0xd76eab[_0xd6e8('0x46')][_0xd6e8('0x24')]);}return _0x252ae2[_0xd6e8('0xd3')](_0x173800);}})[_0xd6e8('0x17')](function(_0x107bf0){if(_0x107bf0){return _0x107bf0?{'count':_0x4801f9,'rows':_0x107bf0}:null;}})['then'](respondWithResult(_0xf15ac1,null))[_0xd6e8('0x64')](handleError(_0xf15ac1,null));};exports[_0xd6e8('0xde')]=function(_0x1e7e45,_0x22c225){var _0x55ad8d;var _0x3006f7={};var _0x5140ed;return db[_0xd6e8('0x3d')][_0xd6e8('0xa2')]({'where':{'id':_0x1e7e45[_0xd6e8('0x56')]['id']},'attributes':['id',_0xd6e8('0x38'),_0xd6e8('0x36')]})[_0xd6e8('0x17')](handleEntityNotFound(_0x22c225,null))['then'](function(_0x380fc7){if(!utils[_0xd6e8('0xac')](_0x1e7e45[_0xd6e8('0x46')]['channel'])){throw new db[(_0xd6e8('0x9b'))]['ValidationError'](_0xd6e8('0xad'));}_0x55ad8d=_0x380fc7;var _0xd571a1={};_0xd571a1[_0xd6e8('0x57')]=_['keys'](db[_[_0xd6e8('0xaf')](_0x1e7e45[_0xd6e8('0x46')][_0xd6e8('0xa7')])+_0xd6e8('0xdf')]['rawAttributes']);_0xd571a1[_0xd6e8('0x46')]=_[_0xd6e8('0x59')](_0x1e7e45['query']);_0xd571a1[_0xd6e8('0x5b')]=_[_0xd6e8('0x5c')](_0xd571a1[_0xd6e8('0x57')],_0xd571a1[_0xd6e8('0x46')]);_0x3006f7[_0xd6e8('0x4a')]=_[_0xd6e8('0x5c')](_0xd571a1['model'],qs[_0xd6e8('0x5d')](_0x1e7e45[_0xd6e8('0x46')]['fields']));_0x3006f7[_0xd6e8('0x4a')]=_0x3006f7[_0xd6e8('0x4a')]['length']?_0x3006f7[_0xd6e8('0x4a')]:_0xd571a1[_0xd6e8('0x57')];_0x3006f7['order']=qs[_0xd6e8('0xd6')](_0x1e7e45['query']['sort']);_0x3006f7[_0xd6e8('0x45')]=qs[_0xd6e8('0x5b')](_[_0xd6e8('0xd7')](_0x1e7e45['query'],_0xd571a1[_0xd6e8('0x5b')]));if(_0x1e7e45[_0xd6e8('0x46')][_0xd6e8('0x32')]){_0x3006f7['where']=_[_0xd6e8('0x61')](_0x3006f7[_0xd6e8('0x45')],{'$or':_[_0xd6e8('0x34')](_0x3006f7[_0xd6e8('0x4a')],function(_0x21b217){var _0x189e99={};_0x189e99[_0x21b217]={'$like':'%'+_0x1e7e45[_0xd6e8('0x46')][_0xd6e8('0x32')]+'%'};return _0x189e99;})});}_0x3006f7=_[_0xd6e8('0x61')]({},_0x3006f7,_0x1e7e45[_0xd6e8('0x62')]);switch(_0x55ad8d[_0xd6e8('0x36')]){case'admin':return db[_['capitalize'](_0x1e7e45[_0xd6e8('0x46')][_0xd6e8('0xa7')])+_0xd6e8('0xdf')]['findAll'](_0x3006f7);case _0xd6e8('0x2d'):case _0xd6e8('0x2f'):return _0x55ad8d[_0xd6e8('0x2b')+_[_0xd6e8('0xaf')](_0x1e7e45['query']['channel'])+_0xd6e8('0xb1')](_0x3006f7);default:throw new db[(_0xd6e8('0x9b'))][(_0xd6e8('0x9c'))]('Unknown\x20role');}})[_0xd6e8('0x17')](function(_0x4d4830){_0x5140ed=_0x4d4830['length'];if(!_0x1e7e45[_0xd6e8('0x46')][_0xd6e8('0xd8')](_0xd6e8('0xdd'))){_0x3006f7[_0xd6e8('0x26')]=qs[_0xd6e8('0x26')](_0x1e7e45['query'][_0xd6e8('0x26')]);_0x3006f7[_0xd6e8('0x24')]=qs['offset'](_0x1e7e45[_0xd6e8('0x46')][_0xd6e8('0x24')]);}switch(_0x55ad8d[_0xd6e8('0x36')]){case _0xd6e8('0x8a'):return db[_['capitalize'](_0x1e7e45['query']['channel'])+_0xd6e8('0xdf')][_0xd6e8('0x95')](_0x3006f7);case _0xd6e8('0x2d'):case _0xd6e8('0x2f'):return _0x55ad8d[_0xd6e8('0x2b')+_[_0xd6e8('0xaf')](_0x1e7e45['query']['channel'])+_0xd6e8('0xb1')](_0x3006f7);}})[_0xd6e8('0x17')](function(_0x5b0963){return{'count':_0x5140ed,'rows':_0x5b0963};})['then'](respondWithResult(_0x22c225,null))[_0xd6e8('0x64')](handleError(_0x22c225,null));};exports[_0xd6e8('0xe0')]=function(_0x4da048,_0x34e21b){var _0x376807={};var _0x323faf={};var _0x51f86c;var _0x379240;return db['User'][_0xd6e8('0xa2')]({'where':{'id':_0x4da048[_0xd6e8('0x56')]['id']}})[_0xd6e8('0x17')](handleEntityNotFound(_0x34e21b,null))[_0xd6e8('0x17')](function(_0x6e1ceb){if(_0x6e1ceb){_0x51f86c=_0x6e1ceb;_0x323faf['model']=_['keys'](db['UserVoiceQueueRt'][_0xd6e8('0x3e')]);_0x323faf[_0xd6e8('0x46')]=_['keys'](_0x4da048[_0xd6e8('0x46')]);_0x323faf['filters']=_['intersection'](_0x323faf['model'],_0x323faf[_0xd6e8('0x46')]);_0x376807[_0xd6e8('0x4a')]=_[_0xd6e8('0x5c')](_0x323faf[_0xd6e8('0x57')],qs[_0xd6e8('0x5d')](_0x4da048[_0xd6e8('0x46')]['fields']));_0x376807['attributes']=_0x376807[_0xd6e8('0x4a')]['length']?_0x376807[_0xd6e8('0x4a')]:_0x323faf[_0xd6e8('0x57')];_0x376807[_0xd6e8('0xd5')]=qs['sort'](_0x4da048['query'][_0xd6e8('0xd6')]);_0x376807[_0xd6e8('0x45')]=qs[_0xd6e8('0x5b')](_[_0xd6e8('0xd7')](_0x4da048[_0xd6e8('0x46')],_0x323faf[_0xd6e8('0x5b')]));if(_0x4da048['query'][_0xd6e8('0x32')]){_0x376807['where']=_[_0xd6e8('0x61')](_0x376807[_0xd6e8('0x45')],{'$or':_['map'](_0x376807[_0xd6e8('0x4a')],function(_0x1278cd){var _0x2e3fc4={};_0x2e3fc4[_0x1278cd]={'$like':'%'+_0x4da048[_0xd6e8('0x46')]['filter']+'%'};return _0x2e3fc4;})});}_0x376807=_[_0xd6e8('0x61')]({},_0x376807,_0x4da048[_0xd6e8('0x62')]);return _0x51f86c[_0xd6e8('0xe0')](_0x376807);}})['then'](function(_0x4d2b9c){if(_0x4d2b9c){_0x379240=_0x4d2b9c[_0xd6e8('0x5e')];if(!_0x4da048[_0xd6e8('0x46')][_0xd6e8('0xd8')](_0xd6e8('0xdd'))){_0x376807[_0xd6e8('0x26')]=qs[_0xd6e8('0x26')](_0x4da048['query']['limit']);_0x376807['offset']=qs[_0xd6e8('0x24')](_0x4da048[_0xd6e8('0x46')][_0xd6e8('0x24')]);}return _0x51f86c[_0xd6e8('0xe0')](_0x376807);}})[_0xd6e8('0x17')](function(_0x17ca13){if(_0x17ca13){return _0x17ca13?{'count':_0x379240,'rows':_0x17ca13}:null;}})[_0xd6e8('0x17')](respondWithResult(_0x34e21b,null))[_0xd6e8('0x64')](handleError(_0x34e21b,null));};exports[_0xd6e8('0xe1')]=function(_0x1d200e,_0x1f01f9){var _0x35f10d={};var _0x56b7c9={};var _0x5c3ff9;var _0x3fb171;return db['User'][_0xd6e8('0xa2')]({'where':{'id':_0x1d200e[_0xd6e8('0x56')]['id']}})[_0xd6e8('0x17')](handleEntityNotFound(_0x1f01f9,null))[_0xd6e8('0x17')](function(_0x1ef353){if(_0x1ef353){_0x5c3ff9=_0x1ef353;_0x56b7c9[_0xd6e8('0x57')]=_[_0xd6e8('0x59')](db[_0xd6e8('0xe2')][_0xd6e8('0x3e')]);_0x56b7c9[_0xd6e8('0x46')]=_['keys'](_0x1d200e[_0xd6e8('0x46')]);_0x56b7c9['filters']=_[_0xd6e8('0x5c')](_0x56b7c9[_0xd6e8('0x57')],_0x56b7c9[_0xd6e8('0x46')]);_0x35f10d[_0xd6e8('0x4a')]=_[_0xd6e8('0x5c')](_0x56b7c9['model'],qs['fields'](_0x1d200e[_0xd6e8('0x46')]['fields']));_0x35f10d[_0xd6e8('0x4a')]=_0x35f10d[_0xd6e8('0x4a')][_0xd6e8('0x5e')]?_0x35f10d[_0xd6e8('0x4a')]:_0x56b7c9[_0xd6e8('0x57')];_0x35f10d[_0xd6e8('0xd5')]=qs[_0xd6e8('0xd6')](_0x1d200e[_0xd6e8('0x46')][_0xd6e8('0xd6')]);_0x35f10d[_0xd6e8('0x45')]=qs[_0xd6e8('0x5b')](_['pick'](_0x1d200e[_0xd6e8('0x46')],_0x56b7c9[_0xd6e8('0x5b')]));if(_0x1d200e['query']['filter']){_0x35f10d['where']=_['merge'](_0x35f10d[_0xd6e8('0x45')],{'$or':_[_0xd6e8('0x34')](_0x35f10d['attributes'],function(_0x3278a7){var _0x5da53d={};_0x5da53d[_0x3278a7]={'$like':'%'+_0x1d200e[_0xd6e8('0x46')]['filter']+'%'};return _0x5da53d;})});}_0x35f10d=_[_0xd6e8('0x61')]({},_0x35f10d,_0x1d200e['options']);return _0x5c3ff9[_0xd6e8('0xe1')](_0x35f10d);}})[_0xd6e8('0x17')](function(_0x72ad83){if(_0x72ad83){_0x3fb171=_0x72ad83[_0xd6e8('0x5e')];if(!_0x1d200e[_0xd6e8('0x46')][_0xd6e8('0xd8')](_0xd6e8('0xdd'))){_0x35f10d['limit']=qs[_0xd6e8('0x26')](_0x1d200e[_0xd6e8('0x46')][_0xd6e8('0x26')]);_0x35f10d[_0xd6e8('0x24')]=qs[_0xd6e8('0x24')](_0x1d200e[_0xd6e8('0x46')][_0xd6e8('0x24')]);}return _0x5c3ff9[_0xd6e8('0xe1')](_0x35f10d);}})[_0xd6e8('0x17')](function(_0x49660f){if(_0x49660f){return _0x49660f?{'count':_0x3fb171,'rows':_0x49660f}:null;}})['then'](respondWithResult(_0x1f01f9,null))[_0xd6e8('0x64')](handleError(_0x1f01f9,null));};exports['getRecordings']=function(_0x409805,_0x264006){var _0x22783f={'raw':!![],'where':{}};var _0x5eeeae={};var _0x2539d5={'count':0x0,'rows':[]};return db[_0xd6e8('0x3d')][_0xd6e8('0xa2')]({'where':{'id':_0x409805[_0xd6e8('0x56')]['id']}})[_0xd6e8('0x17')](handleEntityNotFound(_0x264006,null))['then'](function(_0x2002fe){if(_0x2002fe){_0x5eeeae[_0xd6e8('0x57')]=_[_0xd6e8('0x59')](db[_0xd6e8('0xe3')][_0xd6e8('0x3e')]);_0x5eeeae[_0xd6e8('0x46')]=_['keys'](_0x409805[_0xd6e8('0x46')]);_0x5eeeae[_0xd6e8('0x5b')]=_[_0xd6e8('0x5c')](_0x5eeeae[_0xd6e8('0x57')],_0x5eeeae[_0xd6e8('0x46')]);_0x22783f['attributes']=_[_0xd6e8('0x5c')](_0x5eeeae['model'],qs['fields'](_0x409805[_0xd6e8('0x46')][_0xd6e8('0x5d')]));_0x22783f['attributes']=_0x22783f[_0xd6e8('0x4a')][_0xd6e8('0x5e')]?_0x22783f[_0xd6e8('0x4a')]:_0x5eeeae[_0xd6e8('0x57')];if(!_0x409805[_0xd6e8('0x46')][_0xd6e8('0xd8')](_0xd6e8('0xdd'))){_0x22783f[_0xd6e8('0x26')]=qs['limit'](_0x409805[_0xd6e8('0x46')][_0xd6e8('0x26')]);_0x22783f[_0xd6e8('0x24')]=qs[_0xd6e8('0x24')](_0x409805[_0xd6e8('0x46')][_0xd6e8('0x24')]);}_0x22783f[_0xd6e8('0xd5')]=qs['sort'](_0x409805[_0xd6e8('0x46')][_0xd6e8('0xd6')]);_0x22783f['where']=qs[_0xd6e8('0x5b')](_[_0xd6e8('0xd7')](_0x409805[_0xd6e8('0x46')],_0x5eeeae['filters']));_0x22783f['where'][_0xd6e8('0xe4')]=_0x2002fe['id'];if(_0x409805[_0xd6e8('0x46')][_0xd6e8('0x32')]){_0x22783f[_0xd6e8('0x45')]=_[_0xd6e8('0x61')](_0x22783f[_0xd6e8('0x45')],{'$or':_[_0xd6e8('0x34')](_0x22783f[_0xd6e8('0x4a')],function(_0x4d9942){var _0x142b5c={};_0x142b5c[_0x4d9942]={'$like':'%'+_0x409805[_0xd6e8('0x46')]['filter']+'%'};return _0x142b5c;})});}_0x22783f=_[_0xd6e8('0x61')]({},_0x22783f,_0x409805[_0xd6e8('0x62')]);return db['VoiceRecording'][_0xd6e8('0x27')]({'where':_0x22783f['where']})[_0xd6e8('0x17')](function(_0x5ba48e){_0x2539d5[_0xd6e8('0x27')]=_0x5ba48e;if(_0x409805[_0xd6e8('0x46')][_0xd6e8('0x47')]){_0x22783f['include']=[{'all':!![]}];}return db[_0xd6e8('0xe3')][_0xd6e8('0x95')](_0x22783f);})[_0xd6e8('0x17')](function(_0xcfeba1){_0x2539d5[_0xd6e8('0x4b')]=_0xcfeba1;return _0x2539d5;});}})[_0xd6e8('0x17')](respondWithFilteredResult(_0x264006,_0x22783f))['catch'](handleError(_0x264006,null));};exports[_0xd6e8('0xe5')]=function(_0x3b93c2,_0x5d7d43){var _0x1345a9={'raw':!![],'where':{}};var _0xd1e678={};var _0x372c12={'count':0x0,'rows':[]};return db['User']['findOne']({'where':{'id':_0x3b93c2[_0xd6e8('0x56')]['id']}})['then'](handleEntityNotFound(_0x5d7d43,null))[_0xd6e8('0x17')](function(_0x2c0d7b){if(_0x2c0d7b){_0xd1e678[_0xd6e8('0x57')]=_[_0xd6e8('0x59')](db['ScreenRecording']['rawAttributes']);_0xd1e678['query']=_['keys'](_0x3b93c2[_0xd6e8('0x46')]);_0xd1e678[_0xd6e8('0x5b')]=_[_0xd6e8('0x5c')](_0xd1e678[_0xd6e8('0x57')],_0xd1e678[_0xd6e8('0x46')]);_0x1345a9[_0xd6e8('0x4a')]=_[_0xd6e8('0x5c')](_0xd1e678[_0xd6e8('0x57')],qs[_0xd6e8('0x5d')](_0x3b93c2[_0xd6e8('0x46')][_0xd6e8('0x5d')]));_0x1345a9[_0xd6e8('0x4a')]=_0x1345a9['attributes'][_0xd6e8('0x5e')]?_0x1345a9[_0xd6e8('0x4a')]:_0xd1e678[_0xd6e8('0x57')];if(!_0x3b93c2[_0xd6e8('0x46')][_0xd6e8('0xd8')]('nolimit')){_0x1345a9['limit']=qs[_0xd6e8('0x26')](_0x3b93c2[_0xd6e8('0x46')][_0xd6e8('0x26')]);_0x1345a9[_0xd6e8('0x24')]=qs[_0xd6e8('0x24')](_0x3b93c2['query']['offset']);}_0x1345a9['order']=qs[_0xd6e8('0xd6')](_0x3b93c2['query'][_0xd6e8('0xd6')]);_0x1345a9[_0xd6e8('0x45')]=qs[_0xd6e8('0x5b')](_[_0xd6e8('0xd7')](_0x3b93c2['query'],_0xd1e678[_0xd6e8('0x5b')]));_0x1345a9[_0xd6e8('0x45')][_0xd6e8('0xe4')]=_0x2c0d7b['id'];if(_0x3b93c2['query'][_0xd6e8('0x32')]){_0x1345a9[_0xd6e8('0x45')]=_[_0xd6e8('0x61')](_0x1345a9['where'],{'$or':_['map'](_0x1345a9[_0xd6e8('0x4a')],function(_0x1c8b6e){var _0x3e2ff6={};_0x3e2ff6[_0x1c8b6e]={'$like':'%'+_0x3b93c2['query'][_0xd6e8('0x32')]+'%'};return _0x3e2ff6;})});}_0x1345a9=_[_0xd6e8('0x61')]({},_0x1345a9,_0x3b93c2[_0xd6e8('0x62')]);return db['ScreenRecording'][_0xd6e8('0x27')]({'where':_0x1345a9[_0xd6e8('0x45')]})['then'](function(_0x5dbd2f){_0x372c12[_0xd6e8('0x27')]=_0x5dbd2f;if(_0x3b93c2['query'][_0xd6e8('0x47')]){_0x1345a9[_0xd6e8('0x5f')]=[{'all':!![]}];}return db[_0xd6e8('0xe6')][_0xd6e8('0x95')](_0x1345a9);})[_0xd6e8('0x17')](function(_0x3b24a9){_0x372c12[_0xd6e8('0x4b')]=_0x3b24a9;return _0x372c12;});}})[_0xd6e8('0x17')](respondWithFilteredResult(_0x5d7d43,_0x1345a9))[_0xd6e8('0x64')](handleError(_0x5d7d43,null));};exports[_0xd6e8('0xe7')]=function(_0x20ba30,_0x4adb9f){var _0x24a527={};var _0x11838b={};var _0x4fc078;var _0x456ac4;return db[_0xd6e8('0x3d')][_0xd6e8('0xa2')]({'where':{'id':_0x20ba30['params']['id']}})['then'](handleEntityNotFound(_0x4adb9f,null))[_0xd6e8('0x17')](function(_0x1dd42f){if(_0x1dd42f){_0x4fc078=_0x1dd42f;_0x11838b[_0xd6e8('0x57')]=_[_0xd6e8('0x59')](db['ChatInteraction']['rawAttributes']);_0x11838b[_0xd6e8('0x46')]=_[_0xd6e8('0x59')](_0x20ba30['query']);_0x11838b[_0xd6e8('0x5b')]=_[_0xd6e8('0x5c')](_0x11838b[_0xd6e8('0x57')],_0x11838b[_0xd6e8('0x46')]);_0x24a527[_0xd6e8('0x4a')]=_[_0xd6e8('0x5c')](_0x11838b[_0xd6e8('0x57')],qs['fields'](_0x20ba30[_0xd6e8('0x46')][_0xd6e8('0x5d')]));_0x24a527['attributes']=_0x24a527['attributes'][_0xd6e8('0x5e')]?_0x24a527[_0xd6e8('0x4a')]:_0x11838b[_0xd6e8('0x57')];_0x24a527[_0xd6e8('0xd5')]=qs['sort'](_0x20ba30[_0xd6e8('0x46')]['sort']);_0x24a527[_0xd6e8('0x45')]=qs[_0xd6e8('0x5b')](_[_0xd6e8('0xd7')](_0x20ba30[_0xd6e8('0x46')],_0x11838b[_0xd6e8('0x5b')]));if(_0x20ba30[_0xd6e8('0x46')]['filter']){_0x24a527['where']=_[_0xd6e8('0x61')](_0x24a527[_0xd6e8('0x45')],{'$or':_[_0xd6e8('0x34')](_0x24a527[_0xd6e8('0x4a')],function(_0x501e47){var _0x1692e7={};_0x1692e7[_0x501e47]={'$like':'%'+_0x20ba30[_0xd6e8('0x46')][_0xd6e8('0x32')]+'%'};return _0x1692e7;})});}_0x24a527=_[_0xd6e8('0x61')]({},_0x24a527,_0x20ba30[_0xd6e8('0x62')]);return _0x4fc078['getChatInteractions'](_0x24a527);}})[_0xd6e8('0x17')](function(_0x3910fb){if(_0x3910fb){_0x456ac4=_0x3910fb[_0xd6e8('0x5e')];if(!_0x20ba30[_0xd6e8('0x46')][_0xd6e8('0xd8')](_0xd6e8('0xdd'))){_0x24a527[_0xd6e8('0x26')]=qs[_0xd6e8('0x26')](_0x20ba30[_0xd6e8('0x46')]['limit']);_0x24a527[_0xd6e8('0x24')]=qs[_0xd6e8('0x24')](_0x20ba30[_0xd6e8('0x46')][_0xd6e8('0x24')]);}return _0x4fc078[_0xd6e8('0xe7')](_0x24a527);}})['then'](function(_0x2fddd5){if(_0x2fddd5){return _0x2fddd5?{'count':_0x456ac4,'rows':_0x2fddd5}:null;}})[_0xd6e8('0x17')](respondWithResult(_0x4adb9f,null))[_0xd6e8('0x64')](handleError(_0x4adb9f,null));};exports[_0xd6e8('0xe8')]=function(_0x16ce47,_0x138aa2){var _0x545969={};var _0xc109f2={};var _0xcf2cb2;var _0x23b1f4;return db[_0xd6e8('0x3d')]['findOne']({'where':{'id':_0x16ce47[_0xd6e8('0x56')]['id']}})[_0xd6e8('0x17')](handleEntityNotFound(_0x138aa2,null))[_0xd6e8('0x17')](function(_0x166b7e){if(_0x166b7e){_0xcf2cb2=_0x166b7e;_0xc109f2[_0xd6e8('0x57')]=_[_0xd6e8('0x59')](db['OpenchannelInteraction']['rawAttributes']);_0xc109f2[_0xd6e8('0x46')]=_['keys'](_0x16ce47['query']);_0xc109f2[_0xd6e8('0x5b')]=_[_0xd6e8('0x5c')](_0xc109f2[_0xd6e8('0x57')],_0xc109f2['query']);_0x545969['attributes']=_[_0xd6e8('0x5c')](_0xc109f2[_0xd6e8('0x57')],qs['fields'](_0x16ce47[_0xd6e8('0x46')][_0xd6e8('0x5d')]));_0x545969[_0xd6e8('0x4a')]=_0x545969[_0xd6e8('0x4a')][_0xd6e8('0x5e')]?_0x545969[_0xd6e8('0x4a')]:_0xc109f2['model'];_0x545969[_0xd6e8('0xd5')]=qs[_0xd6e8('0xd6')](_0x16ce47[_0xd6e8('0x46')][_0xd6e8('0xd6')]);_0x545969['where']=qs[_0xd6e8('0x5b')](_[_0xd6e8('0xd7')](_0x16ce47[_0xd6e8('0x46')],_0xc109f2[_0xd6e8('0x5b')]));if(_0x16ce47[_0xd6e8('0x46')][_0xd6e8('0x32')]){_0x545969[_0xd6e8('0x45')]=_[_0xd6e8('0x61')](_0x545969[_0xd6e8('0x45')],{'$or':_['map'](_0x545969[_0xd6e8('0x4a')],function(_0x3bd67d){var _0x1da17c={};_0x1da17c[_0x3bd67d]={'$like':'%'+_0x16ce47[_0xd6e8('0x46')][_0xd6e8('0x32')]+'%'};return _0x1da17c;})});}_0x545969=_[_0xd6e8('0x61')]({},_0x545969,_0x16ce47[_0xd6e8('0x62')]);return _0xcf2cb2[_0xd6e8('0xe8')](_0x545969);}})[_0xd6e8('0x17')](function(_0x12ec18){if(_0x12ec18){_0x23b1f4=_0x12ec18[_0xd6e8('0x5e')];if(!_0x16ce47[_0xd6e8('0x46')][_0xd6e8('0xd8')]('nolimit')){_0x545969[_0xd6e8('0x26')]=qs[_0xd6e8('0x26')](_0x16ce47[_0xd6e8('0x46')]['limit']);_0x545969[_0xd6e8('0x24')]=qs[_0xd6e8('0x24')](_0x16ce47[_0xd6e8('0x46')][_0xd6e8('0x24')]);}return _0xcf2cb2[_0xd6e8('0xe8')](_0x545969);}})[_0xd6e8('0x17')](function(_0x1bc300){if(_0x1bc300){return _0x1bc300?{'count':_0x23b1f4,'rows':_0x1bc300}:null;}})['then'](respondWithResult(_0x138aa2,null))[_0xd6e8('0x64')](handleError(_0x138aa2,null));};exports['getMailInteractions']=function(_0x527c60,_0x5a20c1){var _0x7bd909={'raw':!![],'where':{}};var _0x3060e0={};var _0x5a0633={'count':0x0,'rows':[]};return db[_0xd6e8('0x3d')][_0xd6e8('0xa2')]({'where':{'id':_0x527c60[_0xd6e8('0x56')]['id']}})[_0xd6e8('0x17')](handleEntityNotFound(_0x5a20c1,null))[_0xd6e8('0x17')](function(_0x1dba23){if(_0x1dba23){_0x3060e0['model']=_[_0xd6e8('0x59')](db[_0xd6e8('0xe9')][_0xd6e8('0x3e')]);_0x3060e0['query']=_['keys'](_0x527c60['query']);_0x3060e0[_0xd6e8('0x5b')]=_[_0xd6e8('0x5c')](_0x3060e0[_0xd6e8('0x57')],_0x3060e0['query']);_0x7bd909[_0xd6e8('0x4a')]=_[_0xd6e8('0x5c')](_0x3060e0['model'],qs[_0xd6e8('0x5d')](_0x527c60['query']['fields']));_0x7bd909[_0xd6e8('0x4a')]=_0x7bd909[_0xd6e8('0x4a')][_0xd6e8('0x5e')]?_0x7bd909[_0xd6e8('0x4a')]:_0x3060e0[_0xd6e8('0x57')];if(!_0x527c60[_0xd6e8('0x46')][_0xd6e8('0xd8')](_0xd6e8('0xdd'))){_0x7bd909[_0xd6e8('0x26')]=qs[_0xd6e8('0x26')](_0x527c60[_0xd6e8('0x46')][_0xd6e8('0x26')]);_0x7bd909['offset']=qs['offset'](_0x527c60[_0xd6e8('0x46')]['offset']);}_0x7bd909['order']=qs[_0xd6e8('0xd6')](_0x527c60[_0xd6e8('0x46')][_0xd6e8('0xd6')]);_0x7bd909[_0xd6e8('0x45')]=qs[_0xd6e8('0x5b')](_[_0xd6e8('0xd7')](_0x527c60[_0xd6e8('0x46')],_0x3060e0[_0xd6e8('0x5b')]));_0x7bd909[_0xd6e8('0x45')][_0xd6e8('0xe4')]=_0x1dba23['id'];if(_0x527c60[_0xd6e8('0x46')][_0xd6e8('0x32')]){_0x7bd909[_0xd6e8('0x45')]=_['merge'](_0x7bd909['where'],{'$or':_[_0xd6e8('0x34')](_0x7bd909[_0xd6e8('0x4a')],function(_0x521e01){var _0x4e1ce5={};_0x4e1ce5[_0x521e01]={'$like':'%'+_0x527c60['query'][_0xd6e8('0x32')]+'%'};return _0x4e1ce5;})});}_0x7bd909=_[_0xd6e8('0x61')]({},_0x7bd909,_0x527c60[_0xd6e8('0x62')]);return db[_0xd6e8('0xe9')][_0xd6e8('0x27')]({'where':_0x7bd909[_0xd6e8('0x45')]})[_0xd6e8('0x17')](function(_0x2affcc){_0x5a0633['count']=_0x2affcc;if(_0x527c60[_0xd6e8('0x46')][_0xd6e8('0x47')]){_0x7bd909[_0xd6e8('0x5f')]=[{'all':!![]}];}return db[_0xd6e8('0xe9')]['findAll'](_0x7bd909);})[_0xd6e8('0x17')](function(_0x2057ff){_0x5a0633['rows']=_0x2057ff;return _0x5a0633;});}})[_0xd6e8('0x17')](respondWithFilteredResult(_0x5a20c1,_0x7bd909))[_0xd6e8('0x64')](handleError(_0x5a20c1,null));};exports['getSmsInteractions']=function(_0x560a69,_0x56c562){var _0x4954c7={};var _0x16b672={};var _0x167203;var _0x16d570;return db['User'][_0xd6e8('0xa2')]({'where':{'id':_0x560a69['params']['id']}})['then'](handleEntityNotFound(_0x56c562,null))['then'](function(_0x26f68e){if(_0x26f68e){_0x167203=_0x26f68e;_0x16b672[_0xd6e8('0x57')]=_[_0xd6e8('0x59')](db[_0xd6e8('0xea')][_0xd6e8('0x3e')]);_0x16b672['query']=_[_0xd6e8('0x59')](_0x560a69[_0xd6e8('0x46')]);_0x16b672['filters']=_[_0xd6e8('0x5c')](_0x16b672['model'],_0x16b672[_0xd6e8('0x46')]);_0x4954c7['attributes']=_[_0xd6e8('0x5c')](_0x16b672['model'],qs[_0xd6e8('0x5d')](_0x560a69[_0xd6e8('0x46')][_0xd6e8('0x5d')]));_0x4954c7[_0xd6e8('0x4a')]=_0x4954c7[_0xd6e8('0x4a')][_0xd6e8('0x5e')]?_0x4954c7['attributes']:_0x16b672[_0xd6e8('0x57')];_0x4954c7[_0xd6e8('0xd5')]=qs['sort'](_0x560a69[_0xd6e8('0x46')][_0xd6e8('0xd6')]);_0x4954c7['where']=qs[_0xd6e8('0x5b')](_[_0xd6e8('0xd7')](_0x560a69['query'],_0x16b672[_0xd6e8('0x5b')]));if(_0x560a69[_0xd6e8('0x46')]['filter']){_0x4954c7[_0xd6e8('0x45')]=_['merge'](_0x4954c7[_0xd6e8('0x45')],{'$or':_[_0xd6e8('0x34')](_0x4954c7[_0xd6e8('0x4a')],function(_0xf0bb8d){var _0x3b8cb4={};_0x3b8cb4[_0xf0bb8d]={'$like':'%'+_0x560a69[_0xd6e8('0x46')][_0xd6e8('0x32')]+'%'};return _0x3b8cb4;})});}_0x4954c7=_[_0xd6e8('0x61')]({},_0x4954c7,_0x560a69['options']);return _0x167203['getSmsInteractions'](_0x4954c7);}})[_0xd6e8('0x17')](function(_0x41624a){if(_0x41624a){_0x16d570=_0x41624a[_0xd6e8('0x5e')];if(!_0x560a69[_0xd6e8('0x46')][_0xd6e8('0xd8')](_0xd6e8('0xdd'))){_0x4954c7[_0xd6e8('0x26')]=qs[_0xd6e8('0x26')](_0x560a69[_0xd6e8('0x46')][_0xd6e8('0x26')]);_0x4954c7[_0xd6e8('0x24')]=qs['offset'](_0x560a69[_0xd6e8('0x46')]['offset']);}return _0x167203['getSmsInteractions'](_0x4954c7);}})[_0xd6e8('0x17')](function(_0x4c1b1d){if(_0x4c1b1d){return _0x4c1b1d?{'count':_0x16d570,'rows':_0x4c1b1d}:null;}})[_0xd6e8('0x17')](respondWithResult(_0x56c562,null))[_0xd6e8('0x64')](handleError(_0x56c562,null));};exports[_0xd6e8('0xeb')]=function(_0x4b3107,_0x2f66d5){var _0x1446dc={};var _0x4dc114={};var _0x51e989;var _0x5bf7b0;return db['User'][_0xd6e8('0xa2')]({'where':{'id':_0x4b3107[_0xd6e8('0x56')]['id']}})['then'](handleEntityNotFound(_0x2f66d5,null))[_0xd6e8('0x17')](function(_0x1aeb3a){if(_0x1aeb3a){_0x51e989=_0x1aeb3a;_0x4dc114[_0xd6e8('0x57')]=_[_0xd6e8('0x59')](db['FaxInteraction'][_0xd6e8('0x3e')]);_0x4dc114['query']=_['keys'](_0x4b3107['query']);_0x4dc114[_0xd6e8('0x5b')]=_[_0xd6e8('0x5c')](_0x4dc114[_0xd6e8('0x57')],_0x4dc114[_0xd6e8('0x46')]);_0x1446dc[_0xd6e8('0x4a')]=_[_0xd6e8('0x5c')](_0x4dc114[_0xd6e8('0x57')],qs[_0xd6e8('0x5d')](_0x4b3107[_0xd6e8('0x46')][_0xd6e8('0x5d')]));_0x1446dc['attributes']=_0x1446dc['attributes'][_0xd6e8('0x5e')]?_0x1446dc[_0xd6e8('0x4a')]:_0x4dc114[_0xd6e8('0x57')];_0x1446dc['order']=qs[_0xd6e8('0xd6')](_0x4b3107['query'][_0xd6e8('0xd6')]);_0x1446dc['where']=qs['filters'](_[_0xd6e8('0xd7')](_0x4b3107[_0xd6e8('0x46')],_0x4dc114[_0xd6e8('0x5b')]));if(_0x4b3107[_0xd6e8('0x46')][_0xd6e8('0x32')]){_0x1446dc[_0xd6e8('0x45')]=_[_0xd6e8('0x61')](_0x1446dc[_0xd6e8('0x45')],{'$or':_['map'](_0x1446dc[_0xd6e8('0x4a')],function(_0x586601){var _0x48d095={};_0x48d095[_0x586601]={'$like':'%'+_0x4b3107['query'][_0xd6e8('0x32')]+'%'};return _0x48d095;})});}_0x1446dc=_[_0xd6e8('0x61')]({},_0x1446dc,_0x4b3107[_0xd6e8('0x62')]);return _0x51e989[_0xd6e8('0xeb')](_0x1446dc);}})[_0xd6e8('0x17')](function(_0x5293e0){if(_0x5293e0){_0x5bf7b0=_0x5293e0[_0xd6e8('0x5e')];if(!_0x4b3107['query'][_0xd6e8('0xd8')]('nolimit')){_0x1446dc[_0xd6e8('0x26')]=qs['limit'](_0x4b3107[_0xd6e8('0x46')][_0xd6e8('0x26')]);_0x1446dc[_0xd6e8('0x24')]=qs[_0xd6e8('0x24')](_0x4b3107[_0xd6e8('0x46')]['offset']);}return _0x51e989[_0xd6e8('0xeb')](_0x1446dc);}})[_0xd6e8('0x17')](function(_0x1703d7){if(_0x1703d7){return _0x1703d7?{'count':_0x5bf7b0,'rows':_0x1703d7}:null;}})[_0xd6e8('0x17')](respondWithResult(_0x2f66d5,null))['catch'](handleError(_0x2f66d5,null));};exports['getWhatsappInteractions']=function(_0x2e3612,_0x5ad7a6){var _0x21a196={};var _0x5ae873={};var _0x5dfc8d;var _0x1bc94b;return db[_0xd6e8('0x3d')][_0xd6e8('0xa2')]({'where':{'id':_0x2e3612['params']['id']}})[_0xd6e8('0x17')](handleEntityNotFound(_0x5ad7a6,null))['then'](function(_0x3b7619){if(_0x3b7619){_0x5dfc8d=_0x3b7619;_0x5ae873[_0xd6e8('0x57')]=_[_0xd6e8('0x59')](db[_0xd6e8('0xec')]['rawAttributes']);_0x5ae873['query']=_[_0xd6e8('0x59')](_0x2e3612[_0xd6e8('0x46')]);_0x5ae873[_0xd6e8('0x5b')]=_[_0xd6e8('0x5c')](_0x5ae873[_0xd6e8('0x57')],_0x5ae873['query']);_0x21a196[_0xd6e8('0x4a')]=_['intersection'](_0x5ae873[_0xd6e8('0x57')],qs[_0xd6e8('0x5d')](_0x2e3612[_0xd6e8('0x46')]['fields']));_0x21a196[_0xd6e8('0x4a')]=_0x21a196[_0xd6e8('0x4a')][_0xd6e8('0x5e')]?_0x21a196[_0xd6e8('0x4a')]:_0x5ae873[_0xd6e8('0x57')];_0x21a196[_0xd6e8('0xd5')]=qs[_0xd6e8('0xd6')](_0x2e3612[_0xd6e8('0x46')][_0xd6e8('0xd6')]);_0x21a196[_0xd6e8('0x45')]=qs[_0xd6e8('0x5b')](_['pick'](_0x2e3612['query'],_0x5ae873[_0xd6e8('0x5b')]));if(_0x2e3612[_0xd6e8('0x46')][_0xd6e8('0x32')]){_0x21a196[_0xd6e8('0x45')]=_[_0xd6e8('0x61')](_0x21a196['where'],{'$or':_[_0xd6e8('0x34')](_0x21a196[_0xd6e8('0x4a')],function(_0x3ffead){var _0x3aa349={};_0x3aa349[_0x3ffead]={'$like':'%'+_0x2e3612[_0xd6e8('0x46')]['filter']+'%'};return _0x3aa349;})});}_0x21a196=_[_0xd6e8('0x61')]({},_0x21a196,_0x2e3612[_0xd6e8('0x62')]);return _0x5dfc8d[_0xd6e8('0xed')](_0x21a196);}})[_0xd6e8('0x17')](function(_0x1f956a){if(_0x1f956a){_0x1bc94b=_0x1f956a[_0xd6e8('0x5e')];if(!_0x2e3612[_0xd6e8('0x46')]['hasOwnProperty']('nolimit')){_0x21a196['limit']=qs['limit'](_0x2e3612[_0xd6e8('0x46')][_0xd6e8('0x26')]);_0x21a196[_0xd6e8('0x24')]=qs[_0xd6e8('0x24')](_0x2e3612['query'][_0xd6e8('0x24')]);}return _0x5dfc8d[_0xd6e8('0xed')](_0x21a196);}})[_0xd6e8('0x17')](function(_0x306aa3){if(_0x306aa3){return _0x306aa3?{'count':_0x1bc94b,'rows':_0x306aa3}:null;}})['then'](respondWithResult(_0x5ad7a6,null))[_0xd6e8('0x64')](handleError(_0x5ad7a6,null));};exports['login']=function(_0x24474b,_0x3e9ae6,_0x3352b1){var _0x379148;var _0x5cc754;var _0x50793c;var _0x212d90=!_[_0xd6e8('0x70')](_0x24474b[_0xd6e8('0x56')]['id'])?_0x24474b[_0xd6e8('0x56')]['id']:!_[_0xd6e8('0x70')](_0x24474b[_0xd6e8('0x2d')]['id'])?_0x24474b[_0xd6e8('0x2d')]['id']:null;return db[_0xd6e8('0x3d')][_0xd6e8('0x37')]({'where':{'id':_0x212d90,'role':{'$or':[_0xd6e8('0x8a'),'user',_0xd6e8('0x2f')]}},'attributes':['id',_0xd6e8('0x38'),_0xd6e8('0xee'),_0xd6e8('0xef'),_0xd6e8('0x36'),_0xd6e8('0x6a'),_0xd6e8('0xa9')]})[_0xd6e8('0x17')](function(_0x4e0bf3){if(_0x4e0bf3){if(_0x4e0bf3[_0xd6e8('0x36')]===_0xd6e8('0x2f')){_0x379148=_0x4e0bf3;if(_0x24474b[_0xd6e8('0x65')][_0xd6e8('0xab')]){_0x50793c=util[_0xd6e8('0xb8')](_0xd6e8('0xf0'),_0x379148[_0x24474b['body'][_0xd6e8('0xab')]]);}else if(_0x24474b[_0xd6e8('0x65')][_0xd6e8('0xf1')]){_0x50793c=util[_0xd6e8('0xb8')](_0xd6e8('0xb9'),_0x24474b[_0xd6e8('0x65')][_0xd6e8('0xf1')]);}else{_0x50793c=util[_0xd6e8('0xb8')]('SIP/%s',_0x379148[_0xd6e8('0x38')]);}socket['to'](util['format']('user:%s',_0x379148[_0xd6e8('0x38')]))[_0xd6e8('0xb5')](_0xd6e8('0xf2'),{'user':{'id':_0x379148['id'],'name':_0x379148[_0xd6e8('0x38')]},'ip':_0x24474b[_0xd6e8('0xf3')][_0xd6e8('0xf4')]||_0x24474b[_0xd6e8('0xf5')][_0xd6e8('0xf6')]||_0x24474b['socket']['remoteAddress']||_0x24474b[_0xd6e8('0xf5')][_0xd6e8('0xf7')][_0xd6e8('0xf6')]});return db['UserVoiceQueueRt'][_0xd6e8('0x39')]({'where':{'membername':_0x379148[_0xd6e8('0x38')]},'individualHooks':!![]});}}else{throw new db[(_0xd6e8('0x9b'))][(_0xd6e8('0x9c'))](_0xd6e8('0xf8'));}})[_0xd6e8('0x17')](function(){if(_0x379148){return _0x379148[_0xd6e8('0xf9')]({'raw':!![]});}})['then'](function(_0xe7a880){if(_0x379148){var _0x5bf472=[];if(_0xe7a880){_0x5cc754=_0xe7a880;if(_0x5cc754[_0xd6e8('0x5e')]){for(var _0x29c3b8=0x0;_0x29c3b8<_0x5cc754[_0xd6e8('0x5e')];_0x29c3b8++){_0x5bf472[_0xd6e8('0x4f')]({'membername':_0x379148['name'],'UserId':_0x379148['id'],'queue_name':_0x5cc754[_0x29c3b8]['name'],'VoiceQueueId':_0x5cc754[_0x29c3b8]['id'],'interface':_0x50793c,'paused':_0x379148[_0xd6e8('0xa9')]||![],'penalty':_0x5cc754[_0x29c3b8][_0xd6e8('0xfa')]||0x0});}return BPromise[_0xd6e8('0x93')](_0x5bf472,function(_0x810d69){return db['UserVoiceQueueRt'][_0xd6e8('0xbb')](_0x810d69);});}}}})[_0xd6e8('0x17')](function(){if(_0x379148){return db['MemberReport'][_0xd6e8('0x95')]({'where':{'membername':_0x379148['name'],'exitAt':null}});}})[_0xd6e8('0x17')](function(_0x17e648){if(_0x379148){var _0x1189a0=[];_0x17e648[_0xd6e8('0xfb')](function(_0x424b2b){_0x1189a0[_0xd6e8('0x4f')](_0x424b2b[_0xd6e8('0x2a')]({'exitAt':moment()[_0xd6e8('0xb8')](_0xd6e8('0xfc'))}));});return BPromise[_0xd6e8('0x54')](_0x1189a0);}})[_0xd6e8('0x17')](function(){if(_0x379148){var _0x2f253d=[];var _0x64e27a=[];var _0x1ae741=utils[_0xd6e8('0xfd')]();var _0x5c5d70={'membername':_0x379148[_0xd6e8('0x38')],'interface':_0x50793c,'enterAt':moment()[_0xd6e8('0xb8')](_0xd6e8('0xfc')),'role':_0x379148[_0xd6e8('0x36')],'internal':_0x379148[_0xd6e8('0x6a')]};_0x1ae741['forEach'](function(_0x2b1c1b){_0x2f253d[_0xd6e8('0x4f')](_['merge']({'channel':_0x2b1c1b,'type':_0xd6e8('0xfe'),'data1':_0x24474b[_0xd6e8('0x65')]['device'],'data2':_0x50793c},_0x5c5d70));if(_0x379148['loginInPause']){_0x64e27a[_0xd6e8('0x4f')](_[_0xd6e8('0x61')]({'channel':_0x2b1c1b,'type':_0xd6e8('0xff'),'data1':'LOGININPAUSE'},_0x5c5d70));}});return db[_0xd6e8('0x100')]['bulkCreate'](_0x2f253d['concat'](_0x64e27a),{'individualHooks':!![]});}})[_0xd6e8('0x17')](function(){if(_0x379148){return _0x379148['update']({'online':!![],'lastLoginAt':moment()[_0xd6e8('0xb8')](_0xd6e8('0xfc')),'voicePause':_0x379148[_0xd6e8('0xa9')]||![],'mailPause':_0x379148['loginInPause']||![],'chatPause':_0x379148[_0xd6e8('0xa9')]||![],'faxPause':_0x379148[_0xd6e8('0xa9')]||![],'smsPause':_0x379148[_0xd6e8('0xa9')]||![],'openchannelPause':_0x379148[_0xd6e8('0xa9')]||![],'whatsappPause':_0x379148[_0xd6e8('0xa9')]||![],'pauseType':_0x379148[_0xd6e8('0xa9')]?_0xd6e8('0x101'):null,'interface':_0x50793c,'lastPauseAt':moment()[_0xd6e8('0xb8')](_0xd6e8('0xfc'))});}})['then'](function(_0x444bc1){if(_0x24474b['isMiddleware']){return _0x3352b1();}else{return BPromise[_0xd6e8('0x102')](_0x444bc1)['then'](respondWithResult(_0x3e9ae6,null));}})[_0xd6e8('0x64')](handleError(_0x3e9ae6,null));};exports[_0xd6e8('0x103')]=function(_0x22e4ed,_0x2def28){var _0x3b5fbc;return db['User'][_0xd6e8('0x37')]({'where':{'id':_0x22e4ed[_0xd6e8('0x56')]['id'],'role':_0xd6e8('0x2f')},'attributes':['id',_0xd6e8('0x38'),_0xd6e8('0x36')]})[_0xd6e8('0x17')](handleEntityNotFound(_0x2def28,null))[_0xd6e8('0x17')](function(_0x111fd6){if(_0x111fd6){_0x3b5fbc=_0x111fd6;return db['UserVoiceQueueRt'][_0xd6e8('0x39')]({'where':{'membername':_0x3b5fbc['name']},'individualHooks':!![]});}})[_0xd6e8('0x17')](function(){return db[_0xd6e8('0x100')][_0xd6e8('0x95')]({'where':{'membername':_0x3b5fbc['name'],'exitAt':null}});})[_0xd6e8('0x17')](function(_0x547792){var _0x8b6787=[];_0x547792[_0xd6e8('0xfb')](function(_0x228306){_0x8b6787[_0xd6e8('0x4f')](_0x228306[_0xd6e8('0x2a')]({'exitAt':moment()[_0xd6e8('0xb8')](_0xd6e8('0xfc'))}));});return BPromise[_0xd6e8('0x54')](_0x8b6787);})[_0xd6e8('0x17')](function(){return _0x3b5fbc[_0xd6e8('0x2a')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xd6e8('0x17')](respondWithResult(_0x2def28,null))[_0xd6e8('0x64')](handleError(_0x2def28,null));};exports[_0xd6e8('0x104')]=function(_0x5daafd,_0x1f29a9){var _0x5522fd;return db[_0xd6e8('0xba')][_0xd6e8('0x2a')]({'paused':0x1},{'where':{'UserId':_0x5daafd['params']['id']},'individualHooks':!![]})[_0xd6e8('0x17')](function(){return db[_0xd6e8('0x3d')][_0xd6e8('0x37')]({'where':{'id':_0x5daafd[_0xd6e8('0x56')]['id'],'role':_0xd6e8('0x2f')},'attributes':['id','name',_0xd6e8('0x36'),'internal',_0xd6e8('0xab')]});})[_0xd6e8('0x17')](handleEntityNotFound(_0x1f29a9,null))[_0xd6e8('0x17')](function(_0x1cc486){if(_0x1cc486){_0x5522fd=_0x1cc486;return respondWithRpcPromise(_0xd6e8('0x105'),'pause',{'id':_0x5522fd['id'],'name':_0x5522fd[_0xd6e8('0x38')],'pause':!![]});}})[_0xd6e8('0x17')](function(){if(_0x5522fd){return db['MemberReport'][_0xd6e8('0x95')]({'where':{'membername':_0x5522fd[_0xd6e8('0x38')],'type':_0xd6e8('0xff'),'exitAt':null}});}})[_0xd6e8('0x17')](function(_0x1129b9){if(_0x1129b9[_0xd6e8('0x5e')]){var _0x5c5c6a=moment()[_0xd6e8('0xb8')](_0xd6e8('0xfc'));for(var _0x2232d0=0x0,_0x30fb85=_0x1129b9[_0xd6e8('0x5e')];_0x2232d0<_0x30fb85;_0x2232d0++){_0x1129b9[_0x2232d0][_0xd6e8('0x106')]({'exitAt':_0x5c5c6a});}}})['then'](function(){var _0x5b0056=[];var _0x175793=utils[_0xd6e8('0xfd')]();_0x175793[_0xd6e8('0xfb')](function(_0x34e020){_0x5b0056[_0xd6e8('0x4f')]({'channel':_0x34e020,'membername':_0x5522fd[_0xd6e8('0x38')],'interface':_[_0xd6e8('0x70')](_0x5522fd[_0xd6e8('0xab')])?util['format'](_0xd6e8('0xb9'),_0x5522fd[_0xd6e8('0x38')]):_0x5522fd[_0xd6e8('0xab')],'type':_0xd6e8('0xff'),'enterAt':moment()['format'](_0xd6e8('0xfc')),'data1':_0x5daafd[_0xd6e8('0x65')]['type']||'DEFAULT\x20PAUSE','role':_0x5522fd['role'],'internal':_0x5522fd[_0xd6e8('0x6a')]});});return db['MemberReport'][_0xd6e8('0x91')](_0x5b0056,{'individualHooks':!![]});})[_0xd6e8('0x17')](function(){return _0x5522fd[_0xd6e8('0x2a')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x5daafd[_0xd6e8('0x65')]['type']||'DEFAULT\x20PAUSE','lastPauseAt':moment()['format'](_0xd6e8('0xfc'))});})[_0xd6e8('0x17')](respondWithResult(_0x1f29a9,null))[_0xd6e8('0x64')](handleError(_0x1f29a9,null));};exports['unpause']=function(_0x36f7c2,_0x3cd6b5){var _0x30d3be;return db[_0xd6e8('0x3d')][_0xd6e8('0x37')]({'where':{'id':_0x36f7c2[_0xd6e8('0x56')]['id']},'attributes':['id',_0xd6e8('0x38'),_0xd6e8('0x36'),'voicePause',_0xd6e8('0x107'),_0xd6e8('0x108'),_0xd6e8('0x109'),_0xd6e8('0x10a'),_0xd6e8('0x10b'),_0xd6e8('0x10c'),_0xd6e8('0x10d'),_0xd6e8('0x10e')]})[_0xd6e8('0x17')](handleEntityNotFound(_0x3cd6b5,null))['then'](function(_0x48e47e){if(_0x48e47e){_0x30d3be=_0x48e47e;if(_0x36f7c2[_0xd6e8('0x65')]['channel']&&!utils[_0xd6e8('0xac')](_0x36f7c2[_0xd6e8('0x65')][_0xd6e8('0xa7')])){throw new db[(_0xd6e8('0x9b'))]['ValidationError'](_0xd6e8('0xad'));}switch(_0x36f7c2[_0xd6e8('0x65')]['channel']){case _0xd6e8('0xb7'):return respondWithRpcPromise(_0xd6e8('0x105'),_0xd6e8('0x10f'),{'id':_0x30d3be['id'],'name':_0x30d3be['name'],'pause':![]})[_0xd6e8('0x17')](function(){return db['UserVoiceQueueRt']['update']({'paused':0x0},{'where':{'UserId':_0x30d3be['id']},'individualHooks':!![]});})[_0xd6e8('0x17')](function(){return db[_0xd6e8('0x100')]['find']({'where':{'channel':_0x36f7c2['body'][_0xd6e8('0xa7')],'membername':_0x30d3be['name'],'type':_0xd6e8('0xff'),'exitAt':null}});})[_0xd6e8('0x17')](function(_0x387dca){if(_0x387dca){return _0x387dca[_0xd6e8('0x2a')]({'exitAt':moment()[_0xd6e8('0xb8')](_0xd6e8('0xfc')),'data2':'manual'},{'individualHooks':!![]});}return null;})[_0xd6e8('0x17')](function(){return _0x30d3be['update']({'voicePause':![]});});case _0xd6e8('0x51'):case _0xd6e8('0x4d'):case'fax':case'sms':case'whatsapp':case _0xd6e8('0x52'):return db[_0xd6e8('0x100')][_0xd6e8('0x37')]({'where':{'channel':_0x36f7c2[_0xd6e8('0x65')]['channel'],'membername':_0x30d3be['name'],'type':_0xd6e8('0xff'),'exitAt':null}})[_0xd6e8('0x17')](function(_0x1860af){if(_0x1860af){return _0x1860af['update']({'exitAt':moment()['format'](_0xd6e8('0xfc')),'data2':_0xd6e8('0x110')},{'individualHooks':!![]});}return null;})[_0xd6e8('0x17')](function(){var _0x34fe0b={};_[_0xd6e8('0x28')](_0x34fe0b,util[_0xd6e8('0xb8')](_0xd6e8('0x111'),_0x36f7c2[_0xd6e8('0x65')][_0xd6e8('0xa7')],'Pause'),![]);return _0x30d3be['update'](_0x34fe0b);});default:return respondWithRpcPromise(_0xd6e8('0x105'),_0xd6e8('0x10f'),{'id':_0x30d3be['id'],'name':_0x30d3be[_0xd6e8('0x38')],'pause':![]})[_0xd6e8('0x17')](function(){return db['UserVoiceQueueRt']['update']({'paused':0x0},{'where':{'UserId':_0x30d3be['id']}});})[_0xd6e8('0x17')](function(){return db[_0xd6e8('0x100')][_0xd6e8('0x95')]({'where':{'membername':_0x30d3be[_0xd6e8('0x38')],'type':'PAUSE','exitAt':null}});})[_0xd6e8('0x17')](function(_0x3b4110){var _0x2a0bd3=[];_0x3b4110[_0xd6e8('0xfb')](function(_0x1650b6){_0x2a0bd3[_0xd6e8('0x4f')](_0x1650b6[_0xd6e8('0x2a')]({'exitAt':moment()['format'](_0xd6e8('0xfc')),'data2':_0xd6e8('0x110')}));});return BPromise[_0xd6e8('0x54')](_0x2a0bd3);})[_0xd6e8('0x17')](function(){return _0x30d3be['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})['then'](respondWithResult(_0x3cd6b5,null))['catch'](handleError(_0x3cd6b5,null));};exports[_0xd6e8('0x112')]=function(_0x58962c,_0x5d220a){var _0x980070={};var _0x1747aa={};var _0xfa6046;var _0x34087a;return db[_0xd6e8('0x3d')][_0xd6e8('0xa2')]({'where':{'id':_0x58962c['params']['id']}})[_0xd6e8('0x17')](handleEntityNotFound(_0x5d220a,null))['then'](function(_0x2b55e8){if(_0x2b55e8){_0xfa6046=_0x2b55e8;_0x1747aa[_0xd6e8('0x57')]=_[_0xd6e8('0x59')](db[_0xd6e8('0x113')][_0xd6e8('0x3e')]);_0x1747aa[_0xd6e8('0x46')]=_[_0xd6e8('0x59')](_0x58962c[_0xd6e8('0x46')]);_0x1747aa[_0xd6e8('0x5b')]=_[_0xd6e8('0x5c')](_0x1747aa[_0xd6e8('0x57')],_0x1747aa[_0xd6e8('0x46')]);_0x980070['attributes']=_[_0xd6e8('0x5c')](_0x1747aa[_0xd6e8('0x57')],qs[_0xd6e8('0x5d')](_0x58962c[_0xd6e8('0x46')][_0xd6e8('0x5d')]));_0x980070['attributes']=_0x980070[_0xd6e8('0x4a')][_0xd6e8('0x5e')]?_0x980070[_0xd6e8('0x4a')]:_0x1747aa[_0xd6e8('0x57')];_0x980070['order']=qs[_0xd6e8('0xd6')](_0x58962c[_0xd6e8('0x46')]['sort']);_0x980070[_0xd6e8('0x45')]=qs[_0xd6e8('0x5b')](_[_0xd6e8('0xd7')](_0x58962c[_0xd6e8('0x46')],_0x1747aa[_0xd6e8('0x5b')]));if(_0x58962c['query'][_0xd6e8('0x32')]){_0x980070[_0xd6e8('0x45')]=_[_0xd6e8('0x61')](_0x980070[_0xd6e8('0x45')],{'$or':_[_0xd6e8('0x34')](_0x980070[_0xd6e8('0x4a')],function(_0x5c96a6){var _0x5be1a5={};_0x5be1a5[_0x5c96a6]={'$like':'%'+_0x58962c['query'][_0xd6e8('0x32')]+'%'};return _0x5be1a5;})});}_0x980070=_[_0xd6e8('0x61')]({},_0x980070,_0x58962c[_0xd6e8('0x62')]);return _0xfa6046['getTeams'](_0x980070);}})[_0xd6e8('0x17')](function(_0xa7cc1f){if(_0xa7cc1f){_0x34087a=_0xa7cc1f[_0xd6e8('0x5e')];if(!_0x58962c['query'][_0xd6e8('0xd8')]('nolimit')){_0x980070[_0xd6e8('0x26')]=qs['limit'](_0x58962c[_0xd6e8('0x46')][_0xd6e8('0x26')]);_0x980070['offset']=qs['offset'](_0x58962c['query'][_0xd6e8('0x24')]);}return _0xfa6046['getTeams'](_0x980070);}})[_0xd6e8('0x17')](function(_0x5c2d52){if(_0x5c2d52){return _0x5c2d52?{'count':_0x34087a,'rows':_0x5c2d52}:null;}})[_0xd6e8('0x17')](respondWithResult(_0x5d220a,null))[_0xd6e8('0x64')](handleError(_0x5d220a,null));};exports[_0xd6e8('0x114')]=function(_0x21f01f,_0x20b923){return db[_0xd6e8('0x3d')][_0xd6e8('0x37')]({'where':{'id':_0x21f01f[_0xd6e8('0x56')]['id']}})[_0xd6e8('0x17')](handleEntityNotFound(_0x20b923,null))[_0xd6e8('0x17')](function(_0x18d6f7){if(_0x18d6f7){var _0x5ead2e=_0x18d6f7[_0xd6e8('0x2b')]({'plain':!![]});return _0x18d6f7[_0xd6e8('0x114')](_0x21f01f[_0xd6e8('0x65')][_0xd6e8('0x68')],_['omit'](_0x21f01f[_0xd6e8('0x65')],['ids','id'])||{})[_0xd6e8('0x17')](function(){for(var _0x1ce559=0x0;_0x1ce559<_0x21f01f[_0xd6e8('0x65')][_0xd6e8('0x68')]['length'];_0x1ce559++){var _0x1e07f7=[];var _0x1bc267={};db[_0xd6e8('0x113')][_0xd6e8('0xa2')]({'where':{'id':_0x21f01f[_0xd6e8('0x65')][_0xd6e8('0x68')][_0x1ce559]}})[_0xd6e8('0x17')](function(_0x42dec1){_0x1bc267=_0x42dec1[_0xd6e8('0x4e')];_0x1e07f7[_0xd6e8('0x4f')](_0x42dec1[_0xd6e8('0xf9')]()[_0xd6e8('0x17')](function(_0x22d6ff){for(var _0x352d4f=0x0;_0x352d4f<_0x22d6ff[_0xd6e8('0x5e')];_0x352d4f++){_0x22d6ff[_0x352d4f][_0xd6e8('0x115')]('channel',_0xd6e8('0x116'));}return _0x22d6ff;}));_0x1e07f7[_0xd6e8('0x4f')](_0x42dec1[_0xd6e8('0x117')]()['then'](function(_0x2c899d){for(var _0x5b36c5=0x0;_0x5b36c5<_0x2c899d[_0xd6e8('0x5e')];_0x5b36c5++){_0x2c899d[_0x5b36c5][_0xd6e8('0x115')]('channel','Chat');}return _0x2c899d;}));_0x1e07f7[_0xd6e8('0x4f')](_0x42dec1[_0xd6e8('0x118')]()[_0xd6e8('0x17')](function(_0x35880c){for(var _0x297c86=0x0;_0x297c86<_0x35880c['length'];_0x297c86++){_0x35880c[_0x297c86][_0xd6e8('0x115')](_0xd6e8('0xa7'),_0xd6e8('0x119'));}return _0x35880c;}));_0x1e07f7[_0xd6e8('0x4f')](_0x42dec1[_0xd6e8('0x11a')]()['then'](function(_0x54dd62){for(var _0x2565e7=0x0;_0x2565e7<_0x54dd62['length'];_0x2565e7++){_0x54dd62[_0x2565e7][_0xd6e8('0x115')]('channel',_0xd6e8('0x11b'));}return _0x54dd62;}));_0x1e07f7[_0xd6e8('0x4f')](_0x42dec1[_0xd6e8('0x11c')]()[_0xd6e8('0x17')](function(_0x53847b){for(var _0x26c5da=0x0;_0x26c5da<_0x53847b[_0xd6e8('0x5e')];_0x26c5da++){_0x53847b[_0x26c5da]['setDataValue'](_0xd6e8('0xa7'),'Whatsapp');}return _0x53847b;}));_0x1e07f7['push'](_0x42dec1[_0xd6e8('0x11d')]()[_0xd6e8('0x17')](function(_0x58e300){for(var _0x12074d=0x0;_0x12074d<_0x58e300[_0xd6e8('0x5e')];_0x12074d++){_0x58e300[_0x12074d]['setDataValue'](_0xd6e8('0xa7'),_0xd6e8('0x11e'));}return _0x58e300;}));_0x1e07f7['push'](_0x42dec1['getOpenchannelQueues']()[_0xd6e8('0x17')](function(_0x288517){for(var _0x1144b6=0x0;_0x1144b6<_0x288517[_0xd6e8('0x5e')];_0x1144b6++){_0x288517[_0x1144b6][_0xd6e8('0x115')](_0xd6e8('0xa7'),_0xd6e8('0x11f'));}return _0x288517;}));return BPromise['all'](_0x1e07f7);})[_0xd6e8('0x17')](function(_0x38718b){var _0x3c34c3=_[_0xd6e8('0x120')](_0x38718b);_0x1e07f7=[];return db[_0xd6e8('0x72')][_0xd6e8('0x121')](function(_0x25b2ca){for(var _0x4649b9=0x0;_0x4649b9<_0x3c34c3[_0xd6e8('0x5e')];_0x4649b9++){_0x1e07f7[_0xd6e8('0x4f')](_0x3c34c3[_0x4649b9][_0xd6e8('0x122')](_0x5ead2e['id']),{'transaction':_0x25b2ca});}return BPromise['all'](_0x1e07f7)[_0xd6e8('0x17')](function(){if(_0x5ead2e[_0xd6e8('0xa8')]){return BPromise[_0xd6e8('0x93')](_[_0xd6e8('0x32')](_0x3c34c3,function(_0x5dc729){return _0x5dc729['getDataValue'](_0xd6e8('0xa7'))===_0xd6e8('0x116');}),function(_0x4055c4){return db['UserVoiceQueueRt']['upsert']({'membername':_0x5ead2e[_0xd6e8('0x38')],'UserId':_0x5ead2e['id'],'queue_name':_0x4055c4[_0xd6e8('0x38')],'VoiceQueueId':_0x4055c4['id'],'interface':_['isNil'](_0x5ead2e[_0xd6e8('0xab')])?util[_0xd6e8('0xb8')]('SIP/%s',_0x5ead2e[_0xd6e8('0x38')]):_0x5ead2e[_0xd6e8('0xab')],'paused':_0x5ead2e[_0xd6e8('0xaa')]||![],'penalty':_0x5ead2e['penalty']},{'transaction':_0x25b2ca});});}else{return;}})[_0xd6e8('0x17')](function(){for(var _0x5975a0=0x0;_0x5975a0<_0x3c34c3['length'];_0x5975a0++){var _0xd6778a=_0x3c34c3[_0x5975a0][_0xd6e8('0x123')](_0xd6e8('0xa7'));var _0x28ce68=_0xd6778a+_0xd6e8('0xb4');socket['emit'](_0xd6e8('0x2d')+_0xd6778a+_0xd6e8('0xb6'),{'UserId':_0x5ead2e['id'],['queueField']:_0x3c34c3[_0x5975a0]['id']});}});});})[_0xd6e8('0x17')](function(){db[_0xd6e8('0x124')][_0xd6e8('0xa2')]({'where':{'teamId':_0x1bc267['id']}})['then'](function(_0x1f86af){if(_0x1f86af){db[_0xd6e8('0x125')][_0xd6e8('0x88')]({'UserId':_0x21f01f[_0xd6e8('0x56')]['id'],'VoicePrefixId':_0x1f86af[_0xd6e8('0x126')]});}});});}});}})[_0xd6e8('0x17')](respondWithStatusCode(_0x20b923,null))[_0xd6e8('0x64')](handleError(_0x20b923,null));};exports[_0xd6e8('0x127')]=function(_0x25d5d5,_0x27400e){return db[_0xd6e8('0x3d')]['findOne']({'where':{'id':_0x25d5d5[_0xd6e8('0x56')]['id']}})['then'](handleEntityNotFound(_0x27400e,null))[_0xd6e8('0x17')](function(_0x4d9ebf){if(_0x4d9ebf){var _0x14f974=_0x4d9ebf['get']({'plain':!![]});var _0x15f739=_0x25d5d5[_0xd6e8('0x46')]['ids'];return _0x4d9ebf['removeTeams'](_0x15f739)['then'](function(){for(var _0x650654=0x0;_0x650654<_0x15f739['length'];_0x650654++){var _0x19aa8f=[];var _0x39525f={};db[_0xd6e8('0x113')]['findOne']({'where':{'id':_0x15f739[_0x650654]}})[_0xd6e8('0x17')](function(_0x211833){_0x39525f=_0x211833[_0xd6e8('0x4e')];_0x19aa8f[_0xd6e8('0x4f')](_0x211833[_0xd6e8('0xf9')]()[_0xd6e8('0x17')](function(_0x225c0f){for(var _0x47fe8b=0x0;_0x47fe8b<_0x225c0f[_0xd6e8('0x5e')];_0x47fe8b++){_0x225c0f[_0x47fe8b]['setDataValue']('channel',_0xd6e8('0x116'));}return _0x225c0f;}));_0x19aa8f['push'](_0x211833[_0xd6e8('0x117')]()[_0xd6e8('0x17')](function(_0xf5c0ab){for(var _0x1001d8=0x0;_0x1001d8<_0xf5c0ab[_0xd6e8('0x5e')];_0x1001d8++){_0xf5c0ab[_0x1001d8][_0xd6e8('0x115')](_0xd6e8('0xa7'),_0xd6e8('0x128'));}return _0xf5c0ab;}));_0x19aa8f[_0xd6e8('0x4f')](_0x211833[_0xd6e8('0x118')]()['then'](function(_0x213e54){for(var _0x5ac4a9=0x0;_0x5ac4a9<_0x213e54[_0xd6e8('0x5e')];_0x5ac4a9++){_0x213e54[_0x5ac4a9][_0xd6e8('0x115')]('channel',_0xd6e8('0x119'));}return _0x213e54;}));_0x19aa8f['push'](_0x211833[_0xd6e8('0x11a')]()[_0xd6e8('0x17')](function(_0x98f115){for(var _0x4b2137=0x0;_0x4b2137<_0x98f115[_0xd6e8('0x5e')];_0x4b2137++){_0x98f115[_0x4b2137][_0xd6e8('0x115')](_0xd6e8('0xa7'),_0xd6e8('0x11b'));}return _0x98f115;}));_0x19aa8f[_0xd6e8('0x4f')](_0x211833['getWhatsappQueues']()[_0xd6e8('0x17')](function(_0x38af84){for(var _0xa9dd9a=0x0;_0xa9dd9a<_0x38af84[_0xd6e8('0x5e')];_0xa9dd9a++){_0x38af84[_0xa9dd9a][_0xd6e8('0x115')](_0xd6e8('0xa7'),_0xd6e8('0x129'));}return _0x38af84;}));_0x19aa8f[_0xd6e8('0x4f')](_0x211833['getFaxQueues']()[_0xd6e8('0x17')](function(_0x475d79){for(var _0x35c950=0x0;_0x35c950<_0x475d79[_0xd6e8('0x5e')];_0x35c950++){_0x475d79[_0x35c950][_0xd6e8('0x115')](_0xd6e8('0xa7'),_0xd6e8('0x11e'));}return _0x475d79;}));_0x19aa8f['push'](_0x211833['getOpenchannelQueues']()[_0xd6e8('0x17')](function(_0x136fbc){for(var _0x53d21a=0x0;_0x53d21a<_0x136fbc[_0xd6e8('0x5e')];_0x53d21a++){_0x136fbc[_0x53d21a][_0xd6e8('0x115')](_0xd6e8('0xa7'),_0xd6e8('0x11f'));}return _0x136fbc;}));return BPromise[_0xd6e8('0x54')](_0x19aa8f);})[_0xd6e8('0x17')](function(_0x246da9){var _0x9cb1fa=_[_0xd6e8('0x120')](_0x246da9);_0x19aa8f=[];return db[_0xd6e8('0x72')]['transaction'](function(_0x507005){for(var _0x2fb71e=0x0;_0x2fb71e<_0x9cb1fa[_0xd6e8('0x5e')];_0x2fb71e++){_0x19aa8f[_0xd6e8('0x4f')](_0x9cb1fa[_0x2fb71e][_0xd6e8('0x12a')](_0x14f974['id']),{'transaction':_0x507005});}return BPromise[_0xd6e8('0x54')](_0x19aa8f)[_0xd6e8('0x17')](function(){if(_0x14f974[_0xd6e8('0xa8')]){return BPromise[_0xd6e8('0x93')](_['filter'](_0x9cb1fa,function(_0x1dff02){return _0x1dff02[_0xd6e8('0x123')](_0xd6e8('0xa7'))==='Voice';}),function(_0x255411){return db[_0xd6e8('0xba')][_0xd6e8('0x39')]({'where':{'VoiceQueueId':_0x255411['id'],'UserId':_0x14f974['id']},'transaction':_0x507005});});}else{return;}})[_0xd6e8('0x17')](function(){db[_0xd6e8('0x124')]['findOne']({'where':{'teamId':_0x39525f['id']}})[_0xd6e8('0x17')](function(_0x1a782b){if(_0x1a782b){return db[_0xd6e8('0x125')][_0xd6e8('0x39')]({'where':{'UserId':_0x14f974['id'],'VoicePrefixId':_0x1a782b[_0xd6e8('0x4e')][_0xd6e8('0x126')]}});}});})[_0xd6e8('0x17')](function(){for(var _0xdc8865=0x0;_0xdc8865<_0x9cb1fa[_0xd6e8('0x5e')];_0xdc8865++){var _0x5dec8b=_0x9cb1fa[_0xdc8865][_0xd6e8('0x123')]('channel');var _0x42eaae=_0x5dec8b+_0xd6e8('0xb4');socket[_0xd6e8('0xb5')]('user'+_0x5dec8b+_0xd6e8('0xbf'),{'UserId':_0x14f974['id'],['queueField']:_0x9cb1fa[_0xdc8865]['id']});}});});});}});}})[_0xd6e8('0x17')](respondWithStatusCode(_0x27400e,null))[_0xd6e8('0x64')](handleError(_0x27400e,null));};exports[_0xd6e8('0x12b')]=function(_0x504a4c,_0xebb5fe){var _0x4ec18b={};var _0x4908fa={};var _0x292697;var _0x84824f;return db['User'][_0xd6e8('0xa2')]({'where':{'id':_0x504a4c[_0xd6e8('0x56')]['id']}})[_0xd6e8('0x17')](handleEntityNotFound(_0xebb5fe,null))[_0xd6e8('0x17')](function(_0x1ecfa3){if(_0x1ecfa3){_0x292697=_0x1ecfa3;_0x4908fa[_0xd6e8('0x57')]=_[_0xd6e8('0x59')](db['CmList'][_0xd6e8('0x3e')]);_0x4908fa[_0xd6e8('0x46')]=_[_0xd6e8('0x59')](_0x504a4c[_0xd6e8('0x46')]);_0x4908fa[_0xd6e8('0x5b')]=_['intersection'](_0x4908fa['model'],_0x4908fa[_0xd6e8('0x46')]);_0x4ec18b[_0xd6e8('0x4a')]=_[_0xd6e8('0x5c')](_0x4908fa['model'],qs[_0xd6e8('0x5d')](_0x504a4c['query']['fields']));_0x4ec18b['attributes']=_0x4ec18b[_0xd6e8('0x4a')]['length']?_0x4ec18b[_0xd6e8('0x4a')]:_0x4908fa[_0xd6e8('0x57')];_0x4ec18b['order']=qs['sort'](_0x504a4c[_0xd6e8('0x46')][_0xd6e8('0xd6')]);_0x4ec18b[_0xd6e8('0x45')]=qs['filters'](_[_0xd6e8('0xd7')](_0x504a4c[_0xd6e8('0x46')],_0x4908fa['filters']));if(_0x504a4c['query'][_0xd6e8('0x32')]){_0x4ec18b['where']=_['merge'](_0x4ec18b['where'],{'$or':_[_0xd6e8('0x34')](_0x4ec18b[_0xd6e8('0x4a')],function(_0x4f2c88){var _0x482128={};_0x482128[_0x4f2c88]={'$like':'%'+_0x504a4c[_0xd6e8('0x46')][_0xd6e8('0x32')]+'%'};return _0x482128;})});}_0x4ec18b=_[_0xd6e8('0x61')]({},_0x4ec18b,_0x504a4c[_0xd6e8('0x62')]);return _0x292697[_0xd6e8('0x12b')](_0x4ec18b);}})[_0xd6e8('0x17')](function(_0x63edf6){if(_0x63edf6){_0x84824f=_0x63edf6[_0xd6e8('0x5e')];if(!_0x504a4c[_0xd6e8('0x46')][_0xd6e8('0xd8')]('nolimit')){_0x4ec18b[_0xd6e8('0x26')]=qs[_0xd6e8('0x26')](_0x504a4c[_0xd6e8('0x46')][_0xd6e8('0x26')]);_0x4ec18b[_0xd6e8('0x24')]=qs[_0xd6e8('0x24')](_0x504a4c['query'][_0xd6e8('0x24')]);}return _0x292697['getLists'](_0x4ec18b);}})[_0xd6e8('0x17')](function(_0x316d4f){if(_0x316d4f){return _0x316d4f?{'count':_0x84824f,'rows':_0x316d4f}:null;}})[_0xd6e8('0x17')](respondWithResult(_0xebb5fe,null))['catch'](handleError(_0xebb5fe,null));};exports[_0xd6e8('0x12c')]=function(_0x5e9dce,_0x49bb4b){var _0x2346d7={};var _0x440726={};var _0x295bcb;return db[_0xd6e8('0x3d')][_0xd6e8('0xa2')]({'where':{'id':_0x5e9dce['params']['id']}})['then'](handleEntityNotFound(_0x49bb4b,null))['then'](function(_0x24b9d3){if(_0x24b9d3){_0x295bcb=_0x24b9d3;_0x440726['model']=_[_0xd6e8('0x59')](db[_0xd6e8('0x3d')][_0xd6e8('0x3e')]);_0x440726[_0xd6e8('0x46')]=_[_0xd6e8('0x59')](_0x5e9dce[_0xd6e8('0x46')]);_0x440726[_0xd6e8('0x5b')]=_['intersection'](_0x440726[_0xd6e8('0x57')],_0x440726[_0xd6e8('0x46')]);_0x2346d7[_0xd6e8('0x4a')]=_[_0xd6e8('0x5c')](_0x440726['model'],qs[_0xd6e8('0x5d')](_0x5e9dce[_0xd6e8('0x46')][_0xd6e8('0x5d')]));_0x2346d7[_0xd6e8('0x4a')]=_0x2346d7['attributes'][_0xd6e8('0x5e')]?_0x2346d7[_0xd6e8('0x4a')]:_0x440726[_0xd6e8('0x57')];_0x2346d7[_0xd6e8('0xd5')]=qs['sort'](_0x5e9dce[_0xd6e8('0x46')][_0xd6e8('0xd6')]);_0x2346d7[_0xd6e8('0x45')]=qs['filters'](_[_0xd6e8('0xd7')](_0x5e9dce[_0xd6e8('0x46')],_0x440726[_0xd6e8('0x5b')]));if(_0x5e9dce[_0xd6e8('0x46')][_0xd6e8('0x32')]){_0x2346d7[_0xd6e8('0x45')]=_[_0xd6e8('0x61')](_0x2346d7[_0xd6e8('0x45')],{'$or':_[_0xd6e8('0x34')](_0x2346d7['attributes'],function(_0x48bddf){var _0x250baa={};_0x250baa[_0x48bddf]={'$like':'%'+_0x5e9dce[_0xd6e8('0x46')][_0xd6e8('0x32')]+'%'};return _0x250baa;})});}_0x2346d7[_0xd6e8('0x57')]=db[_0xd6e8('0x3d')];_0x2346d7['as']=_0xd6e8('0x2e');_0x2346d7=_['merge']({},_0x2346d7,_0x5e9dce['options']);return _0x295bcb[_0xd6e8('0xf9')]({'include':[_0x2346d7]});}})[_0xd6e8('0x17')](function(_0xd6601f){if(_0xd6601f){var _0x222059={},_0x18c2fe=[];for(var _0x467193=0x0;_0x467193<_0xd6601f[_0xd6e8('0x5e')];_0x467193+=0x1){for(var _0x3f6372=0x0,_0x1546c5;_0x3f6372<_0xd6601f[_0x467193][_0xd6e8('0x2e')][_0xd6e8('0x5e')];_0x3f6372+=0x1){_0x1546c5=_0xd6601f[_0x467193][_0xd6e8('0x2e')][_0x3f6372]['get']({'plain':!![]});_0x222059[_0x1546c5['id']]=_0x1546c5;}}_0x222059=_[_0xd6e8('0x12d')](_0x222059);for(var _0x4b0bff=qs[_0xd6e8('0x24')](_0x5e9dce['query'][_0xd6e8('0x24')]);_0x4b0bff<_0x222059[_0xd6e8('0x5e')]&&_0x18c2fe[_0xd6e8('0x5e')]=_0x58e129){_0x3766cf=_0x58e129;_0x135a04=0xc8;}else{_0x135a04=0xce;}_0x381aec['status'](_0x135a04);return _0x381aec[_0xa839('0x24')]('Content-Range',_0x4ec39c+'-'+_0x3766cf+'/'+_0x58e129)[_0xa839('0x1f')](_0x318eb1);}return null;};}function saveUpdates(_0x4cec4d){return function(_0x588501){if(_0x588501){return _0x588501[_0xa839('0x25')](_0x4cec4d)['then'](function(_0x1e47a1){return _0x1e47a1;});}return null;};}function removeEntity(_0x525b26){return function(_0xe210f9){if(_0xe210f9){return _0xe210f9['destroy']()[_0xa839('0x12')](function(){var _0x3438fe=_0xe210f9[_0xa839('0x26')]({'plain':!![]});if(_0x3438fe[_0xa839('0x27')]===_0xa839('0x28'))return;var _0x26232b=[{'name':_0xa839('0x29'),'value':'user','ignore':!![]},{'name':_0xa839('0x2a'),'value':_0xa839('0x2b'),'ignore':![]},{'name':_0xa839('0x2c'),'value':'telephone','ignore':![]}];var _0x5a0266=_(_0x26232b)[_0xa839('0x2d')](_0xa839('0x2e'))[_0xa839('0x2f')](_0xa839('0x30'))[_0xa839('0x30')]();if(_['includes'](_0x5a0266,_0x3438fe[_0xa839('0x27')])){return;}var _0x4e908f=_[_0xa839('0x31')](_0x26232b,['value',_0x3438fe[_0xa839('0x27')]])['name'];return db[_0xa839('0x32')]['destroy']({'where':{'type':_0x4e908f,'resourceId':_0x3438fe['id']}})[_0xa839('0x12')](function(){return _0xe210f9;});})[_0xa839('0x12')](function(){_0x525b26[_0xa839('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1bfcf9){return function(_0xa6ae7a){if(!_0xa6ae7a){_0x1bfcf9['sendStatus'](0x194);}return _0xa6ae7a;};}function handleError(_0x24764b,_0x9a81ec){_0x9a81ec=_0x9a81ec||0x1f4;return function(_0x5aa13f){logger[_0xa839('0x17')](_0x5aa13f[_0xa839('0x33')]);if(_0x5aa13f[_0xa839('0x34')]){delete _0x5aa13f[_0xa839('0x34')];}_0x24764b[_0xa839('0x1e')](_0x9a81ec)[_0xa839('0x35')](_0x5aa13f);};}exports[_0xa839('0x36')]=function(_0x3bdfa5,_0x12a6ac){var _0x2ab2e9={},_0xbbbc88={'count':0x0,'rows':[]};var _0x7b5fe1=_(db['User'][_0xa839('0x37')])[_0xa839('0x2f')](function(_0x301013){return{'name':_0x301013[_0xa839('0x38')],'type':_0x301013[_0xa839('0x39')][_0xa839('0x3a')]};})[_0xa839('0x2d')](function(_0x2d481b){return!_['includes'](['password',_0xa839('0x3b')],_0x2d481b[_0xa839('0x34')]);})['value']();_0x2ab2e9=qs[_0xa839('0x3c')](_0x7b5fe1,_0x3bdfa5);var _0x407df0={'where':_0x2ab2e9[_0xa839('0x3d')]};return db[_0xa839('0x3e')][_0xa839('0x23')](_0x407df0)['then'](function(_0x32739d){_0xbbbc88[_0xa839('0x23')]=_0x32739d;if(_0x3bdfa5[_0xa839('0x3f')][_0xa839('0x40')]){_0x2ab2e9[_0xa839('0x41')]=[{'all':!![]}];}if(_0x3bdfa5[_0xa839('0x3f')][_0xa839('0x42')]===_0xa839('0x43')){_0x2ab2e9['include']=[{'model':db[_0xa839('0x44')],'as':'userSetting'}];}if(!_[_0xa839('0x45')](_0x2ab2e9[_0xa839('0x46')],'id')){_0x2ab2e9['attributes']['push']('id');}return db[_0xa839('0x3e')][_0xa839('0x47')](_0x2ab2e9);})[_0xa839('0x12')](function(_0x2bceb4){_0xbbbc88[_0xa839('0x48')]=_0x2bceb4;if(_0x3bdfa5[_0xa839('0x3f')][_0xa839('0x49')]===_0xa839('0x43')){var _0x1418a5=[];for(var _0x5b164a=0x0;_0x5b164a<_0xbbbc88[_0xa839('0x48')][_0xa839('0x4a')];_0x5b164a++){_0x1418a5[_0xa839('0x4b')](get_open_tabs('chat',_0xbbbc88[_0xa839('0x48')][_0x5b164a][_0xa839('0x4c')]));_0x1418a5['push'](get_open_tabs('sms',_0xbbbc88[_0xa839('0x48')][_0x5b164a][_0xa839('0x4c')]));_0x1418a5[_0xa839('0x4b')](get_open_tabs(_0xa839('0x4d'),_0xbbbc88['rows'][_0x5b164a][_0xa839('0x4c')]));_0x1418a5[_0xa839('0x4b')](get_open_tabs(_0xa839('0x4e'),_0xbbbc88['rows'][_0x5b164a][_0xa839('0x4c')]));_0x1418a5[_0xa839('0x4b')](get_open_tabs('openchannel',_0xbbbc88[_0xa839('0x48')][_0x5b164a][_0xa839('0x4c')]));_0x1418a5[_0xa839('0x4b')](get_open_tabs('whatsapp',_0xbbbc88[_0xa839('0x48')][_0x5b164a][_0xa839('0x4c')]));}return BPromise[_0xa839('0x4f')](_0x1418a5)['then'](function(){return _0xbbbc88;});}else{return _0xbbbc88;}})[_0xa839('0x12')](respondWithFilteredResult(_0x12a6ac,_0x2ab2e9))[_0xa839('0x1b')](handleError(_0x12a6ac,null));};exports[_0xa839('0x50')]=function(_0x3e40f7,_0x451d0b){var _0x1a6832={'raw':![],'where':{'id':_0x3e40f7['params']['id']}},_0x2dfc94={};_0x2dfc94[_0xa839('0x51')]=_['differenceBy'](_[_0xa839('0x52')](db[_0xa839('0x3e')]['rawAttributes']),[_0xa839('0x53'),'salt']);_0x2dfc94[_0xa839('0x3f')]=_[_0xa839('0x52')](_0x3e40f7[_0xa839('0x3f')]);_0x2dfc94[_0xa839('0x54')]=_[_0xa839('0x55')](_0x2dfc94['model'],_0x2dfc94[_0xa839('0x3f')]);_0x1a6832[_0xa839('0x46')]=_[_0xa839('0x55')](_0x2dfc94[_0xa839('0x51')],qs[_0xa839('0x56')](_0x3e40f7[_0xa839('0x3f')][_0xa839('0x56')]));_0x1a6832[_0xa839('0x46')]=_0x1a6832[_0xa839('0x46')][_0xa839('0x4a')]?_0x1a6832[_0xa839('0x46')]:_0x2dfc94['model'];if(_0x3e40f7[_0xa839('0x3f')][_0xa839('0x40')]){_0x1a6832[_0xa839('0x41')]=[{'all':!![]}];}if(_0x3e40f7['query'][_0xa839('0x42')]===_0xa839('0x43')){_0x1a6832[_0xa839('0x41')]=[{'model':db[_0xa839('0x44')],'as':_0xa839('0x42')}];}_0x1a6832=_[_0xa839('0x57')]({},_0x1a6832,_0x3e40f7['options']);if(!_[_0xa839('0x45')](_0x1a6832[_0xa839('0x46')],'id')){_0x1a6832[_0xa839('0x46')][_0xa839('0x4b')]('id');}return db[_0xa839('0x3e')][_0xa839('0x31')](_0x1a6832)[_0xa839('0x12')](handleEntityNotFound(_0x451d0b,null))[_0xa839('0x12')](function(_0x34c0fa){var _0x44a4a4=[];values=_0x34c0fa;if(_0x3e40f7[_0xa839('0x3f')][_0xa839('0x49')]===_0xa839('0x43')){_0x44a4a4[_0xa839('0x4b')](get_open_tabs(_0xa839('0x58'),_0x34c0fa[_0xa839('0x4c')]));_0x44a4a4[_0xa839('0x4b')](get_open_tabs(_0xa839('0x59'),_0x34c0fa[_0xa839('0x4c')]));_0x44a4a4[_0xa839('0x4b')](get_open_tabs('openchannel',_0x34c0fa[_0xa839('0x4c')]));_0x44a4a4[_0xa839('0x4b')](get_open_tabs(_0xa839('0x5a'),_0x34c0fa['dataValues']));_0x44a4a4[_0xa839('0x4b')](get_open_tabs('fax',_0x34c0fa[_0xa839('0x4c')]));_0x44a4a4[_0xa839('0x4b')](get_open_tabs('mail',_0x34c0fa[_0xa839('0x4c')]));return BPromise['all'](_0x44a4a4);}else{return values;}})[_0xa839('0x12')](function(){return values;})[_0xa839('0x12')](respondWithResult(_0x451d0b,null))[_0xa839('0x1b')](handleError(_0x451d0b,null));};exports[_0xa839('0x25')]=function(_0x2bedef,_0x3e4e00){if(_0x2bedef['body']['id']){delete _0x2bedef[_0xa839('0x5b')]['id'];}delete _0x2bedef[_0xa839('0x5b')][_0xa839('0x27')];return db[_0xa839('0x3e')][_0xa839('0x31')]({'where':{'id':_0x2bedef[_0xa839('0x5c')]['id']}})[_0xa839('0x12')](handleEntityNotFound(_0x3e4e00,null))[_0xa839('0x12')](saveUpdates(_0x2bedef[_0xa839('0x5b')],null))[_0xa839('0x12')](respondWithResult(_0x3e4e00,null))[_0xa839('0x1b')](handleError(_0x3e4e00,null));};exports[_0xa839('0x5d')]=function(_0x5550cb,_0x2fa7a5){return db['User'][_0xa839('0x5d')]()[_0xa839('0x12')](respondWithResult(_0x2fa7a5,null))['catch'](handleError(_0x2fa7a5,null));};exports['addContacts']=function(_0x17cd25,_0x1d8353){return db['User']['find']({'where':{'id':_0x17cd25['params']['id']}})[_0xa839('0x12')](handleEntityNotFound(_0x1d8353,null))[_0xa839('0x12')](function(_0x50acca){if(_0x50acca){return _0x50acca['addContacts'](_0x17cd25[_0xa839('0x5b')]['ids'],_[_0xa839('0x5e')](_0x17cd25[_0xa839('0x5b')],[_0xa839('0x5f'),'id'])||{});}})['then'](respondWithResult(_0x1d8353,null))[_0xa839('0x1b')](handleError(_0x1d8353,null));};function validateUser(_0xbf9ae0){return new BPromise(function(_0x1afece,_0x5a9bbf){if(_0xbf9ae0['internal'])return _0x1afece(_0xbf9ae0);return db[_0xa839('0x60')][_0xa839('0x61')](0x1)[_0xa839('0x12')](function(_0x50f61d){if(_0x50f61d[_0xa839('0x62')])authService[_0xa839('0x63')](_0xbf9ae0[_0xa839('0x53')]);db[_0xa839('0x3e')]['max'](_0xa839('0x64'))[_0xa839('0x12')](function(_0x54e1fa){if(_[_0xa839('0x65')](_0x54e1fa)){_0xbf9ae0[_0xa839('0x64')]=_0x50f61d['min_internal']||0x1;return;}if(_[_0xa839('0x65')](_0x50f61d[_0xa839('0x66')])||_0x50f61d['min_internal']===_0x54e1fa){_0xbf9ae0[_0xa839('0x64')]=_0x54e1fa+0x1;return;}if(_0x50f61d[_0xa839('0x66')]>_0x54e1fa){_0xbf9ae0[_0xa839('0x64')]=_0x50f61d[_0xa839('0x66')];return;}return db[_0xa839('0x67')]['query'](_0xa839('0x68'),{'type':db[_0xa839('0x67')]['QueryTypes'][_0xa839('0x69')]})['then'](function(_0x4d0d31){if(_0x4d0d31&&_0x4d0d31[_0xa839('0x4a')]){for(var _0x5b49cf=0x0,_0x2edc8b=_0x4d0d31[_0xa839('0x4a')];_0x5b49cf<_0x2edc8b&&_[_0xa839('0x65')](_0xbf9ae0[_0xa839('0x64')]);_0x5b49cf++){if(_0x50f61d[_0xa839('0x66')]<=_0x4d0d31[_0x5b49cf]['from']){_0xbf9ae0['internal']=_0x4d0d31[_0x5b49cf][_0xa839('0x6a')];}else if(_0x50f61d[_0xa839('0x66')]>_0x4d0d31[_0x5b49cf][_0xa839('0x6a')]&&_0x50f61d['min_internal']<=_0x4d0d31[_0x5b49cf]['to']){_0xbf9ae0[_0xa839('0x64')]=_0x50f61d[_0xa839('0x66')];}}}if(_[_0xa839('0x65')](_0xbf9ae0['internal'])){_0xbf9ae0['internal']=_0x54e1fa+0x1;}return _0x1afece(_0xbf9ae0);});});})['catch'](function(_0x2acf32){_0x5a9bbf(_0x2acf32);});});}function updateUser(_0x4119d7){return new BPromise(function(_0x4f2e10,_0x5d38d8){try{if(_0x4119d7[_0xa839('0x6b')]){_0x4119d7[_0xa839('0x6c')]=_0x4119d7[_0xa839('0x64')];_0x4119d7[_0xa839('0x6d')]={'mailbox':_0x4119d7[_0xa839('0x64')],'password':_0x4119d7[_0xa839('0x53')],'fullname':_0x4119d7[_0xa839('0x6e')],'email':_0x4119d7['email']};}if(_0x4119d7[_0xa839('0x27')]==='agent'){if(!_0x4119d7[_0xa839('0x6f')])_0x4119d7[_0xa839('0x6f')]=[_0xa839('0x70'),_0xa839('0x71'),_0xa839('0x72'),_0xa839('0x73'),_0xa839('0x74'),_0xa839('0x75'),'105','106',_0xa839('0x76'),_0xa839('0x77'),_0xa839('0x78'),'100',_0xa839('0x79'),_0xa839('0x7a'),_0xa839('0x7b')];}_0x4f2e10(_0x4119d7);}catch(_0xd34e88){_0x5d38d8(_0xd34e88);}});}exports['create']=function(_0x370faf,_0x175e1b){if(_0x370faf[_0xa839('0x7c')]['role']==='agent')throw new Error(_0xa839('0x7d'));if(_0x370faf[_0xa839('0x5b')]['role']===_0xa839('0x7c')&&_0x370faf['user'][_0xa839('0x27')]!==_0xa839('0x28')){throw new Error(_0xa839('0x7e'));}if(_0x370faf[_0xa839('0x5b')][_0xa839('0x27')]==='admin'&&_0x370faf[_0xa839('0x7c')][_0xa839('0x27')]!==_0xa839('0x28')){throw new Error(_0xa839('0x7f'));}return licenseUtil[_0xa839('0x80')]([_0x370faf[_0xa839('0x5b')]])['then'](function(){return validateUser(_0x370faf[_0xa839('0x5b')]);})[_0xa839('0x12')](function(_0x37c32d){return updateUser(_0x37c32d)[_0xa839('0x12')](function(_0x5f5186){if(_0x5f5186[_0xa839('0x27')]===_0xa839('0x28')){_0x5f5186['settingsEnabled']=_0x370faf[_0xa839('0x7c')][_0xa839('0x81')];delete _0x5f5186[_0xa839('0x82')];}return _0x5f5186;});})[_0xa839('0x12')](function(_0x35f7d9){return db[_0xa839('0x3e')]['create'](_0x35f7d9,{'include':[{'model':db[_0xa839('0x6d')],'as':_0xa839('0x6d')}]});})[_0xa839('0x12')](function(_0x3c995d){if(_0x370faf[_0xa839('0x5b')][_0xa839('0x27')]===_0xa839('0x7c'))return _0x3c995d;if(_0x370faf[_0xa839('0x7c')][_0xa839('0x27')]!=='user')return _0x3c995d;return db[_0xa839('0x83')]['find']({'where':{'name':_0x3c995d[_0xa839('0x27')]===_0xa839('0x2b')?_0xa839('0x2a'):_0xa839('0x2c'),'userProfileId':_0x370faf[_0xa839('0x7c')][_0xa839('0x82')]},'raw':!![]})[_0xa839('0x12')](function(_0x1d2c04){if(!_0x1d2c04||_0x1d2c04[_0xa839('0x84')]!=0x0)return _0x3c995d;return db['UserProfileResource']['create']({'name':_0x3c995d[_0xa839('0x34')],'resourceId':_0x3c995d['id'],'type':_0x1d2c04[_0xa839('0x34')],'sectionId':_0x1d2c04['id']},{})[_0xa839('0x12')](function(){return _0x3c995d;});})[_0xa839('0x1b')](function(_0x270bf0){logger[_0xa839('0x17')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x270bf0);throw _0x270bf0;});})[_0xa839('0x12')](respondWithResult(_0x175e1b,0xc9))[_0xa839('0x1b')](handleError(_0x175e1b,null));};exports[_0xa839('0x85')]=function(_0x5c01d6,_0x245bbb){var _0x177cc5=_0x5c01d6[_0xa839('0x5b')];var _0x8767d0=[];if(_0x5c01d6[_0xa839('0x7c')][_0xa839('0x27')]==='agent')throw new Error(_0xa839('0x7d'));if(_[_0xa839('0x86')](_0x177cc5,[_0xa839('0x27'),_0xa839('0x7c')])&&_0x5c01d6[_0xa839('0x7c')][_0xa839('0x27')]!=='admin'){throw new Error(_0xa839('0x7e'));}if(_[_0xa839('0x86')](_0x177cc5,['role','admin'])&&_0x5c01d6[_0xa839('0x7c')][_0xa839('0x27')]!==_0xa839('0x28')){throw new Error(_0xa839('0x87'));}return licenseUtil[_0xa839('0x80')](_0x177cc5)[_0xa839('0x12')](function(){return validateUser(_0x177cc5[0x0]);})[_0xa839('0x12')](function(){for(var _0x18ba08=0x1;_0x18ba08<_0x177cc5['length'];_0x18ba08++){var _0x65ae00=_0x177cc5[_0x18ba08-0x1][_0xa839('0x64')];if(!_0x177cc5[_0x18ba08][_0xa839('0x64')])_0x177cc5[_0x18ba08][_0xa839('0x64')]=_0x65ae00+0x1;_0x8767d0[_0xa839('0x4b')](validateUser(_0x177cc5[_0x18ba08]));}return BPromise[_0xa839('0x4f')](_0x8767d0);})[_0xa839('0x12')](function(){_0x8767d0=[];for(var _0xe8db1b=0x0;_0xe8db1b<_0x177cc5['length'];_0xe8db1b++){_0x8767d0[_0xa839('0x4b')](updateUser(_0x177cc5[_0xe8db1b]));}return BPromise[_0xa839('0x4f')](_0x8767d0);})[_0xa839('0x12')](function(){return BPromise[_0xa839('0x88')](_0x177cc5,function(_0x45ef0d){return db['User'][_0xa839('0x89')](_0x45ef0d,{'include':[{'model':db[_0xa839('0x6d')],'as':'VoiceMail'}]})[_0xa839('0x12')](function(_0x5762f4){_0x45ef0d['id']=_0x5762f4['id'];return _0x45ef0d;});});})[_0xa839('0x12')](function(_0x1acd14){if(_0x5c01d6[_0xa839('0x5b')][_0xa839('0x27')]==='user')return _0x1acd14;if(_0x5c01d6['user'][_0xa839('0x27')]!==_0xa839('0x7c'))return _0x1acd14;var _0x5d4f9a=_['some'](_0x1acd14,function(_0x3b5289){return _0x3b5289[_0xa839('0x27')]===_0xa839('0x2b')||_0x3b5289['role']===_0xa839('0x8a');});if(!_0x5d4f9a)return _0x1acd14;return db[_0xa839('0x83')]['findAll']({'where':{'name':{'$or':[_0xa839('0x2a'),_0xa839('0x2c')]},'userProfileId':_0x5c01d6[_0xa839('0x7c')][_0xa839('0x82')]},'raw':!![]})['then'](function(_0x11283c){if(_[_0xa839('0x8b')](_0x11283c)||!_[_0xa839('0x86')](_0x11283c,[_0xa839('0x84'),0x0]))return _0x1acd14;_0x8767d0=[];var _0x49156a=_(_0x11283c)[_0xa839('0x2f')](function(_0x462063){if(_0x462063[_0xa839('0x84')]===0x1)return;return _0x462063[_0xa839('0x34')]===_0xa839('0x2a')?_0xa839('0x2b'):_0xa839('0x8a');})['compact']()[_0xa839('0x30')]();for(var _0x35d575=0x0;_0x35d575<_0x1acd14[_0xa839('0x4a')];_0x35d575++){if(!_[_0xa839('0x45')](_0x49156a,_0x1acd14[_0x35d575][_0xa839('0x27')]))return;var _0x17a6a2=_0x1acd14[_0x35d575][_0xa839('0x27')]==='agent'?_0xa839('0x2a'):'Telephones';_0x8767d0[_0xa839('0x4b')](db['UserProfileResource'][_0xa839('0x89')]({'name':_0x1acd14[_0x35d575][_0xa839('0x34')],'resourceId':_0x1acd14[_0x35d575]['id'],'type':_0x17a6a2,'sectionId':_['find'](_0x11283c,[_0xa839('0x34'),_0x17a6a2])['id']},{}));}return BPromise[_0xa839('0x4f')](_0x8767d0);});})[_0xa839('0x12')](respondWithResult(_0x245bbb,0xc9))['catch'](handleError(_0x245bbb,null));};exports[_0xa839('0x8c')]=function(_0x55be07,_0x31b536){if(_0x55be07[_0xa839('0x5b')]['id']){delete _0x55be07[_0xa839('0x5b')]['id'];}return db[_0xa839('0x3e')]['find']({'where':{'id':_0x55be07[_0xa839('0x5c')]['id']}})[_0xa839('0x12')](function(_0x1032a5){if(!_0x1032a5)return null;if(_0x1032a5['id']===_0x55be07[_0xa839('0x7c')]['id']){if(!_0x55be07[_0xa839('0x5b')][_0xa839('0x8d')]||!_0x55be07[_0xa839('0x5b')][_0xa839('0x8e')]){throw new db[(_0xa839('0x8f'))][(_0xa839('0x90'))](_0xa839('0x91'));}if(!_0x1032a5['authenticate'](_0x55be07[_0xa839('0x5b')][_0xa839('0x8d')])){throw new db[(_0xa839('0x8f'))][(_0xa839('0x90'))](_0xa839('0x92'));}if(_0x55be07[_0xa839('0x5b')][_0xa839('0x8d')]===_0x55be07[_0xa839('0x5b')][_0xa839('0x8e')]){throw new db[(_0xa839('0x8f'))][(_0xa839('0x90'))](_0xa839('0x93'));}}else if(_0x55be07[_0xa839('0x7c')]['role']===_0xa839('0x28')){if(!_0x55be07[_0xa839('0x5b')][_0xa839('0x8e')]){throw new db[(_0xa839('0x8f'))][(_0xa839('0x90'))](_0xa839('0x94'));}}else if(_0x55be07[_0xa839('0x7c')]['role']===_0xa839('0x7c')){if(!_0x55be07[_0xa839('0x5b')][_0xa839('0x8e')]){throw new db[(_0xa839('0x8f'))][(_0xa839('0x90'))](_0xa839('0x94'));}if(_0x1032a5['role']!==_0xa839('0x2b')){throw new db['Sequelize']['ValidationError'](_0xa839('0x7d'));}}else{throw new db['Sequelize'][(_0xa839('0x90'))](_0xa839('0x7d'));}return _0x1032a5;})['then'](handleEntityNotFound(_0x31b536,null))['then'](function(_0xd8e05d){return db[_0xa839('0x60')]['findOne']({'attributes':['id',_0xa839('0x62'),_0xa839('0x95'),_0xa839('0x96')]})[_0xa839('0x12')](function(_0x28b918){if(_0x28b918[_0xa839('0x62')])authService[_0xa839('0x63')](_0x55be07[_0xa839('0x5b')]['newPassword']);if(!_0x28b918[_0xa839('0x95')]||!_0xd8e05d[_0xa839('0x97')])return _0xd8e05d;authService[_0xa839('0x98')](_0x55be07[_0xa839('0x5b')][_0xa839('0x8e')],_0xd8e05d[_0xa839('0x97')],_0x28b918[_0xa839('0x96')]);return _0xd8e05d;})['then'](saveUpdates({'password':_0x55be07[_0xa839('0x5b')][_0xa839('0x8e')],'passwordResetAt':_0x55be07['user']['id']==_0x55be07[_0xa839('0x5c')]['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x55be07[_0xa839('0x5b')]['newPassword'],_0xd8e05d[_0xa839('0x97')])},null));})[_0xa839('0x12')](respondWithResult(_0x31b536,null))[_0xa839('0x1b')](handleError(_0x31b536,null));};exports['addQueues']=function(_0x3a9588,_0x59bf19){var _0x434ad0=_0x3a9588['body']['channel'];return db[_0xa839('0x3e')][_0xa839('0x31')]({'where':{'id':_0x3a9588[_0xa839('0x5c')]['id']},'attributes':['id',_0xa839('0x34'),'role',_0xa839('0x99'),_0xa839('0x9a'),_0xa839('0x9b'),_0xa839('0x9c')]})[_0xa839('0x12')](handleEntityNotFound(_0x59bf19,null))['then'](function(_0x1ac088){if(_0x1ac088){if(!utils[_0xa839('0x9d')](_0x434ad0)){throw new db[(_0xa839('0x8f'))][(_0xa839('0x90'))](_0xa839('0x9e'));}return _0x1ac088[_0xa839('0x9f')+_['capitalize'](_0x434ad0[_0xa839('0xa0')]())+_0xa839('0xa1')](_0x3a9588[_0xa839('0x5b')]['ids'],{'penalty':_0x3a9588['body'][_0xa839('0xa2')]||0x0})[_0xa839('0xa3')](function(_0x82a890){for(var _0x1b508a=0x0;_0x1b508a<_0x3a9588[_0xa839('0x5b')]['ids']['length'];_0x1b508a+=0x1){var _0x517421={'UserId':Number(_0x3a9588['params']['id'])};_0x517421[_['capitalize'](_0x434ad0[_0xa839('0xa0')]())+_0xa839('0xa4')]=Number(_0x3a9588[_0xa839('0x5b')][_0xa839('0x5f')][_0x1b508a]);socket[_0xa839('0xa5')](_0xa839('0x7c')+_[_0xa839('0xa6')](_0x434ad0[_0xa839('0xa0')]())+_0xa839('0xa7'),_0x517421);}return _0x82a890;})['then'](function(){if(_0x434ad0===_0xa839('0xa8')){return db['VoiceQueue']['findAll']({'where':{'id':_0x3a9588[_0xa839('0x5b')]['ids']||[]},'raw':!![],'attributes':['id',_0xa839('0x34')]});}})[_0xa839('0x12')](function(_0x321c0d){var _0x3ca569=_0x1ac088[_0xa839('0x26')]({'plain':!![]});var _0x18a6eb=[];if(_0x434ad0===_0xa839('0xa8')&&_0x3ca569['role']===_0xa839('0x2b')&&_0x3ca569['online']){for(var _0x1869cb=0x0;_0x1869cb<_0x321c0d[_0xa839('0x4a')];_0x1869cb+=0x1){_0x18a6eb[_0xa839('0x4b')]({'membername':_0x3ca569[_0xa839('0x34')],'UserId':_0x3ca569['id'],'queue_name':_0x321c0d[_0x1869cb]['name'],'VoiceQueueId':_0x321c0d[_0x1869cb]['id'],'interface':_[_0xa839('0x65')](_0x3ca569['interface'])?util[_0xa839('0xa9')]('SIP/%s',_0x3ca569[_0xa839('0x34')]):_0x3ca569[_0xa839('0x9c')],'paused':_0x3ca569['voicePause']||![],'penalty':_0x3a9588[_0xa839('0x5b')][_0xa839('0xa2')]||0x0});}return BPromise['each'](_0x18a6eb,function(_0x5b3834){return db['UserVoiceQueueRt'][_0xa839('0xaa')](_0x5b3834);});}return _0x1ac088;});}})[_0xa839('0x12')](respondWithStatusCode(_0x59bf19,null))[_0xa839('0x1b')](handleError(_0x59bf19,null));};exports['removeQueues']=function(_0x2a57df,_0x2cda84){var _0x379be3,_0x1ed1a5;return db[_0xa839('0x3e')]['find']({'where':{'id':_0x2a57df[_0xa839('0x5c')]['id']},'attributes':['id',_0xa839('0x34'),_0xa839('0x27')]})['then'](handleEntityNotFound(_0x2cda84,null))['then'](function(_0x4cd7ad){if(_0x4cd7ad){_0x379be3=_0x4cd7ad;if(!_0x2a57df[_0xa839('0x3f')]['channel']||!utils[_0xa839('0x9d')](_0x2a57df[_0xa839('0x3f')][_0xa839('0xab')])){throw new db[(_0xa839('0x8f'))]['ValidationError'](_0xa839('0x9e'));}return _0x4cd7ad[_0xa839('0xac')+_[_0xa839('0xa6')](_0x2a57df[_0xa839('0x3f')][_0xa839('0xab')][_0xa839('0xa0')]())+_0xa839('0xa1')](_0x2a57df[_0xa839('0x3f')][_0xa839('0x5f')]);}})[_0xa839('0x12')](function(_0x5c5282){if(_['isArray'](_0x2a57df['query'][_0xa839('0x5f')])){for(var _0x511922=0x0;_0x511922<_0x2a57df[_0xa839('0x3f')]['ids'][_0xa839('0x4a')];_0x511922+=0x1){_0x1ed1a5={'UserId':Number(_0x2a57df['params']['id'])};_0x1ed1a5[_['capitalize'](_0x2a57df[_0xa839('0x3f')][_0xa839('0xab')][_0xa839('0xa0')]())+'QueueId']=Number(_0x2a57df[_0xa839('0x3f')][_0xa839('0x5f')][_0x511922]);socket['emit'](_0xa839('0x7c')+_[_0xa839('0xa6')](_0x2a57df['query'][_0xa839('0xab')][_0xa839('0xa0')]())+_0xa839('0xad'),_0x1ed1a5);}}else{_0x1ed1a5={'UserId':Number(_0x2a57df[_0xa839('0x5c')]['id'])};_0x1ed1a5[_[_0xa839('0xa6')](_0x2a57df[_0xa839('0x3f')]['channel'][_0xa839('0xa0')]())+_0xa839('0xa4')]=Number(_0x2a57df[_0xa839('0x3f')][_0xa839('0x5f')]);socket[_0xa839('0xa5')](_0xa839('0x7c')+_['capitalize'](_0x2a57df[_0xa839('0x3f')][_0xa839('0xab')]['toLowerCase']())+_0xa839('0xad'),_0x1ed1a5);}return _0x5c5282;})['then'](function(){if(_0x2a57df['query'][_0xa839('0xab')]===_0xa839('0xa8')){return db['UserVoiceQueueRt'][_0xa839('0xae')]({'where':{'UserId':_0x2a57df[_0xa839('0x5c')]['id'],'VoiceQueueId':_0x2a57df[_0xa839('0x3f')]['ids']},'individualHooks':!![]})[_0xa839('0x12')](function(){return _0x379be3;});}return _0x379be3;})[_0xa839('0x12')](respondWithStatusCode(_0x2cda84,null))[_0xa839('0x1b')](handleError(_0x2cda84,null));};exports[_0xa839('0xaf')]=function(_0x5bf1f5,_0x14797f){_0x5bf1f5['body'][_0xa839('0xb0')]=_0x5bf1f5[_0xa839('0xb1')][_0xa839('0xb2')];return db['User'][_0xa839('0x31')]({'where':{'id':_0x5bf1f5[_0xa839('0x5c')]['id']}})[_0xa839('0x12')](handleEntityNotFound(_0x14797f,null))[_0xa839('0x12')](saveUpdates(_0x5bf1f5['body'],null))[_0xa839('0x12')](respondWithResult(_0x14797f,null))['catch'](handleError(_0x14797f,null));};exports[_0xa839('0xb3')]=function(_0x94ef28,_0x2c2b36){var _0x1b71da=path[_0xa839('0xb4')](config[_0xa839('0xb5')],'server/files/images/logos/default_profile.png');return db['User'][_0xa839('0x31')]({'where':{'id':_0x94ef28[_0xa839('0x5c')]['id']},'attributes':['id',_0xa839('0xb0')],'raw':!![]})[_0xa839('0x12')](handleEntityNotFound(_0x2c2b36,null))[_0xa839('0x12')](function(_0xc32751){if(_0xc32751){if(_[_0xa839('0x65')](_0xc32751[_0xa839('0xb0')])){return _0x2c2b36[_0xa839('0xb6')](_0x1b71da);}else{if(!fs[_0xa839('0xb7')](path[_0xa839('0xb4')](config[_0xa839('0xb5')],_0xa839('0xb8'),_0xc32751[_0xa839('0xb0')]))){return _0x2c2b36[_0xa839('0xb6')](_0x1b71da);}return _0x2c2b36[_0xa839('0xb6')](path['join'](config[_0xa839('0xb5')],_0xa839('0xb8'),_0xc32751['userpic']));}}})[_0xa839('0x1b')](handleError(_0x2c2b36,null));};exports['getOpenTabs']=function(_0x3b076a,_0x4c9373){return db[_0xa839('0x3e')][_0xa839('0x31')]({'where':{'id':_0x3b076a['params']['id']},'attributes':['id']})[_0xa839('0x12')](handleEntityNotFound(_0x4c9373,null))['then'](function(_0x16b1ee){var _0x11798e=[];values=_0x16b1ee[_0xa839('0x4c')];_0x11798e[_0xa839('0x4b')](get_open_tabs(_0xa839('0x58'),_0x16b1ee[_0xa839('0x4c')]));_0x11798e['push'](get_open_tabs(_0xa839('0x59'),_0x16b1ee['dataValues']));_0x11798e[_0xa839('0x4b')](get_open_tabs(_0xa839('0xb9'),_0x16b1ee[_0xa839('0x4c')]));_0x11798e['push'](get_open_tabs(_0xa839('0x5a'),_0x16b1ee[_0xa839('0x4c')]));_0x11798e['push'](get_open_tabs('fax',_0x16b1ee[_0xa839('0x4c')]));_0x11798e[_0xa839('0x4b')](get_open_tabs(_0xa839('0x4e'),_0x16b1ee['dataValues']));return BPromise[_0xa839('0x4f')](_0x11798e);})[_0xa839('0x12')](function(_0x46bedd){if(_0x46bedd){var _0x66f8f=_[_0xa839('0x2f')](values[_0xa839('0xba')],function(_0x185a6a){return{'channel':_0xa839('0xbb'),'id':_0x185a6a['id'],'createdAt':_0x185a6a['createdAt']};});var _0x141ddd=_[_0xa839('0x2f')](values[_0xa839('0xbc')],function(_0x187445){return{'channel':'FAX','id':_0x187445['id'],'createdAt':_0x187445[_0xa839('0xbd')]};});var _0x5db4ff=_[_0xa839('0x2f')](values['OpenchannelOpenTabs'],function(_0x144148){return{'channel':_0xa839('0xbe'),'id':_0x144148['id'],'createdAt':_0x144148[_0xa839('0xbd')]};});var _0x1d0993=_[_0xa839('0x2f')](values[_0xa839('0xbf')],function(_0x4259e4){return{'channel':_0xa839('0xc0'),'id':_0x4259e4['id'],'createdAt':_0x4259e4[_0xa839('0xbd')]};});var _0x31840b=_[_0xa839('0x2f')](values[_0xa839('0xc1')],function(_0x547a58){return{'channel':_0xa839('0xc2'),'id':_0x547a58['id'],'createdAt':_0x547a58['createdAt']};});var _0x4218ef=_['map'](values['WhatsappOpenTabs'],function(_0x4aa7c9){return{'channel':_0xa839('0xc3'),'id':_0x4aa7c9['id'],'createdAt':_0x4aa7c9[_0xa839('0xbd')]};});var _0x26ba61=_[_0xa839('0xc4')](_0x66f8f,_0x141ddd,_0x5db4ff,_0x1d0993,_0x31840b,_0x4218ef);var _0x535efd={'count':_0x26ba61[_0xa839('0x4a')],'rows':_0x26ba61};return _0x535efd;}else return null;})[_0xa839('0x12')](respondWithResult(_0x4c9373,null))[_0xa839('0x1b')](handleError(_0x4c9373,null));};exports['getContacts']=function(_0x5cffa7,_0x8b03df){var _0x591866={};var _0x5e0944={};var _0x24e2b7;var _0x512eb7;return db[_0xa839('0x3e')][_0xa839('0xc5')]({'where':{'id':_0x5cffa7[_0xa839('0x5c')]['id']}})['then'](handleEntityNotFound(_0x8b03df,null))[_0xa839('0x12')](function(_0x52c4a3){if(_0x52c4a3){_0x24e2b7=_0x52c4a3;_0x5e0944['model']=_[_0xa839('0x52')](db['CmContact'][_0xa839('0x37')]);_0x5e0944[_0xa839('0x3f')]=_[_0xa839('0x52')](_0x5cffa7[_0xa839('0x3f')]);_0x5e0944[_0xa839('0x54')]=_['intersection'](_0x5e0944[_0xa839('0x51')],_0x5e0944[_0xa839('0x3f')]);_0x591866[_0xa839('0x46')]=_['intersection'](_0x5e0944[_0xa839('0x51')],qs[_0xa839('0x56')](_0x5cffa7[_0xa839('0x3f')][_0xa839('0x56')]));_0x591866['attributes']=_0x591866[_0xa839('0x46')][_0xa839('0x4a')]?_0x591866[_0xa839('0x46')]:_0x5e0944[_0xa839('0x51')];_0x591866[_0xa839('0xc6')]=qs[_0xa839('0xc7')](_0x5cffa7[_0xa839('0x3f')][_0xa839('0xc7')]);_0x591866[_0xa839('0x3d')]=qs['filters'](_['pick'](_0x5cffa7['query'],_0x5e0944[_0xa839('0x54')]));if(_0x5cffa7[_0xa839('0x3f')][_0xa839('0x2d')]){_0x591866[_0xa839('0x3d')]=_[_0xa839('0x57')](_0x591866[_0xa839('0x3d')],{'$or':_[_0xa839('0x2f')](_0x591866[_0xa839('0x46')],function(_0x41db5e){var _0x49d44d={};_0x49d44d[_0x41db5e]={'$like':'%'+_0x5cffa7[_0xa839('0x3f')][_0xa839('0x2d')]+'%'};return _0x49d44d;})});}_0x591866=_['merge']({},_0x591866,_0x5cffa7[_0xa839('0xc8')]);return _0x24e2b7[_0xa839('0xc9')](_0x591866);}})[_0xa839('0x12')](function(_0x5e5aea){if(_0x5e5aea){_0x512eb7=_0x5e5aea[_0xa839('0x4a')];if(_0x5cffa7[_0xa839('0x3f')]['hasOwnProperty'](_0xa839('0x40'))){_0x591866[_0xa839('0x41')]=[{'model':db[_0xa839('0xca')],'as':_0xa839('0xcb'),'required':![]},{'model':db[_0xa839('0xcc')],'as':'Tags','attributes':['id',_0xa839('0x34'),_0xa839('0xcd')],'where':_0x5cffa7[_0xa839('0x3f')][_0xa839('0xce')]?{'id':_0x5cffa7[_0xa839('0x3f')][_0xa839('0xce')]}:undefined,'required':_0x5cffa7[_0xa839('0x3f')]['tag']?!![]:![]}];}if(!_0x5cffa7['query'][_0xa839('0xcf')](_0xa839('0xd0'))){_0x591866['limit']=qs[_0xa839('0x22')](_0x5cffa7[_0xa839('0x3f')]['limit']);_0x591866[_0xa839('0x20')]=qs[_0xa839('0x20')](_0x5cffa7[_0xa839('0x3f')][_0xa839('0x20')]);}return _0x24e2b7['getContacts'](_0x591866);}})[_0xa839('0x12')](function(_0x9ad4a9){if(_0x9ad4a9){return _0x9ad4a9?{'count':_0x512eb7,'rows':_0x9ad4a9}:null;}})[_0xa839('0x12')](respondWithResult(_0x8b03df,null))[_0xa839('0x1b')](handleError(_0x8b03df,null));};exports[_0xa839('0xd1')]=function(_0x2cb0ae,_0x231939){var _0x2f8a1f;var _0x2be077={};var _0x332d18;return db[_0xa839('0x3e')][_0xa839('0xc5')]({'where':{'id':_0x2cb0ae[_0xa839('0x5c')]['id']},'attributes':['id',_0xa839('0x34'),_0xa839('0x27')]})[_0xa839('0x12')](handleEntityNotFound(_0x231939,null))[_0xa839('0x12')](function(_0x53d0f5){if(!utils[_0xa839('0x9d')](_0x2cb0ae[_0xa839('0x3f')][_0xa839('0xab')])){throw new db[(_0xa839('0x8f'))][(_0xa839('0x90'))]('Unknown\x20channel');}_0x2f8a1f=_0x53d0f5;var _0x4bd220={};_0x4bd220[_0xa839('0x51')]=_[_0xa839('0x52')](db[_[_0xa839('0xa6')](_0x2cb0ae['query'][_0xa839('0xab')])+_0xa839('0xd2')]['rawAttributes']);_0x4bd220['query']=_[_0xa839('0x52')](_0x2cb0ae[_0xa839('0x3f')]);_0x4bd220['filters']=_[_0xa839('0x55')](_0x4bd220['model'],_0x4bd220['query']);_0x2be077[_0xa839('0x46')]=_[_0xa839('0x55')](_0x4bd220['model'],qs['fields'](_0x2cb0ae[_0xa839('0x3f')][_0xa839('0x56')]));_0x2be077[_0xa839('0x46')]=_0x2be077[_0xa839('0x46')][_0xa839('0x4a')]?_0x2be077[_0xa839('0x46')]:_0x4bd220['model'];_0x2be077[_0xa839('0xc6')]=qs[_0xa839('0xc7')](_0x2cb0ae[_0xa839('0x3f')][_0xa839('0xc7')]);_0x2be077['where']=qs[_0xa839('0x54')](_[_0xa839('0xd3')](_0x2cb0ae[_0xa839('0x3f')],_0x4bd220[_0xa839('0x54')]));if(_0x2cb0ae[_0xa839('0x3f')][_0xa839('0x2d')]){_0x2be077[_0xa839('0x3d')]=_[_0xa839('0x57')](_0x2be077[_0xa839('0x3d')],{'$or':_['map'](_0x2be077[_0xa839('0x46')],function(_0x4a6567){var _0x25837c={};_0x25837c[_0x4a6567]={'$like':'%'+_0x2cb0ae[_0xa839('0x3f')][_0xa839('0x2d')]+'%'};return _0x25837c;})});}_0x2be077=_[_0xa839('0x57')]({},_0x2be077,_0x2cb0ae['options']);switch(_0x2f8a1f[_0xa839('0x27')]){case _0xa839('0x28'):return db[_[_0xa839('0xa6')](_0x2cb0ae[_0xa839('0x3f')][_0xa839('0xab')])+_0xa839('0xd2')]['findAll'](_0x2be077);case _0xa839('0x7c'):case _0xa839('0x2b'):return _0x2f8a1f['get'+_[_0xa839('0xa6')](_0x2cb0ae[_0xa839('0x3f')][_0xa839('0xab')])+_0xa839('0xa1')](_0x2be077);default:throw new db[(_0xa839('0x8f'))][(_0xa839('0x90'))]('Unknown\x20role');}})[_0xa839('0x12')](function(_0x40b4bd){_0x332d18=_0x40b4bd[_0xa839('0x4a')];if(!_0x2cb0ae[_0xa839('0x3f')][_0xa839('0xcf')](_0xa839('0xd0'))){_0x2be077[_0xa839('0x22')]=qs['limit'](_0x2cb0ae['query'][_0xa839('0x22')]);_0x2be077[_0xa839('0x20')]=qs[_0xa839('0x20')](_0x2cb0ae[_0xa839('0x3f')][_0xa839('0x20')]);}switch(_0x2f8a1f[_0xa839('0x27')]){case _0xa839('0x28'):return db[_[_0xa839('0xa6')](_0x2cb0ae[_0xa839('0x3f')][_0xa839('0xab')])+_0xa839('0xd2')][_0xa839('0x47')](_0x2be077);case _0xa839('0x7c'):case'agent':return _0x2f8a1f[_0xa839('0x26')+_[_0xa839('0xa6')](_0x2cb0ae[_0xa839('0x3f')][_0xa839('0xab')])+_0xa839('0xa1')](_0x2be077);}})[_0xa839('0x12')](function(_0x14e7b4){return{'count':_0x332d18,'rows':_0x14e7b4};})[_0xa839('0x12')](respondWithResult(_0x231939,null))[_0xa839('0x1b')](handleError(_0x231939,null));};exports['getVoiceQueuesRt']=function(_0x32202b,_0x31d706){var _0x3f60a1={};var _0x14c54c={};var _0x4532a5;var _0x32d452;return db[_0xa839('0x3e')][_0xa839('0xc5')]({'where':{'id':_0x32202b[_0xa839('0x5c')]['id']}})[_0xa839('0x12')](handleEntityNotFound(_0x31d706,null))[_0xa839('0x12')](function(_0x31d33a){if(_0x31d33a){_0x4532a5=_0x31d33a;_0x14c54c['model']=_[_0xa839('0x52')](db[_0xa839('0xd4')][_0xa839('0x37')]);_0x14c54c[_0xa839('0x3f')]=_[_0xa839('0x52')](_0x32202b[_0xa839('0x3f')]);_0x14c54c[_0xa839('0x54')]=_[_0xa839('0x55')](_0x14c54c[_0xa839('0x51')],_0x14c54c[_0xa839('0x3f')]);_0x3f60a1['attributes']=_[_0xa839('0x55')](_0x14c54c[_0xa839('0x51')],qs['fields'](_0x32202b[_0xa839('0x3f')]['fields']));_0x3f60a1[_0xa839('0x46')]=_0x3f60a1[_0xa839('0x46')]['length']?_0x3f60a1['attributes']:_0x14c54c[_0xa839('0x51')];_0x3f60a1[_0xa839('0xc6')]=qs[_0xa839('0xc7')](_0x32202b[_0xa839('0x3f')][_0xa839('0xc7')]);_0x3f60a1[_0xa839('0x3d')]=qs[_0xa839('0x54')](_[_0xa839('0xd3')](_0x32202b['query'],_0x14c54c[_0xa839('0x54')]));if(_0x32202b[_0xa839('0x3f')][_0xa839('0x2d')]){_0x3f60a1[_0xa839('0x3d')]=_[_0xa839('0x57')](_0x3f60a1['where'],{'$or':_['map'](_0x3f60a1[_0xa839('0x46')],function(_0x370921){var _0x555634={};_0x555634[_0x370921]={'$like':'%'+_0x32202b[_0xa839('0x3f')][_0xa839('0x2d')]+'%'};return _0x555634;})});}_0x3f60a1=_[_0xa839('0x57')]({},_0x3f60a1,_0x32202b['options']);return _0x4532a5[_0xa839('0xd5')](_0x3f60a1);}})[_0xa839('0x12')](function(_0x414438){if(_0x414438){_0x32d452=_0x414438[_0xa839('0x4a')];if(!_0x32202b[_0xa839('0x3f')]['hasOwnProperty'](_0xa839('0xd0'))){_0x3f60a1[_0xa839('0x22')]=qs['limit'](_0x32202b['query'][_0xa839('0x22')]);_0x3f60a1['offset']=qs[_0xa839('0x20')](_0x32202b[_0xa839('0x3f')][_0xa839('0x20')]);}return _0x4532a5['getVoiceQueuesRt'](_0x3f60a1);}})['then'](function(_0x218f62){if(_0x218f62){return _0x218f62?{'count':_0x32d452,'rows':_0x218f62}:null;}})[_0xa839('0x12')](respondWithResult(_0x31d706,null))[_0xa839('0x1b')](handleError(_0x31d706,null));};exports[_0xa839('0xd6')]=function(_0x3216e5,_0x38f5a7){var _0x145308={};var _0x21d512={};var _0xbf0362;var _0x3033cf;return db[_0xa839('0x3e')]['findOne']({'where':{'id':_0x3216e5[_0xa839('0x5c')]['id']}})[_0xa839('0x12')](handleEntityNotFound(_0x38f5a7,null))[_0xa839('0x12')](function(_0x34f23c){if(_0x34f23c){_0xbf0362=_0x34f23c;_0x21d512[_0xa839('0x51')]=_[_0xa839('0x52')](db[_0xa839('0xd7')]['rawAttributes']);_0x21d512[_0xa839('0x3f')]=_[_0xa839('0x52')](_0x3216e5[_0xa839('0x3f')]);_0x21d512['filters']=_[_0xa839('0x55')](_0x21d512[_0xa839('0x51')],_0x21d512[_0xa839('0x3f')]);_0x145308[_0xa839('0x46')]=_['intersection'](_0x21d512[_0xa839('0x51')],qs['fields'](_0x3216e5['query'][_0xa839('0x56')]));_0x145308[_0xa839('0x46')]=_0x145308['attributes'][_0xa839('0x4a')]?_0x145308[_0xa839('0x46')]:_0x21d512['model'];_0x145308[_0xa839('0xc6')]=qs[_0xa839('0xc7')](_0x3216e5[_0xa839('0x3f')][_0xa839('0xc7')]);_0x145308[_0xa839('0x3d')]=qs['filters'](_[_0xa839('0xd3')](_0x3216e5[_0xa839('0x3f')],_0x21d512[_0xa839('0x54')]));if(_0x3216e5[_0xa839('0x3f')]['filter']){_0x145308['where']=_[_0xa839('0x57')](_0x145308['where'],{'$or':_[_0xa839('0x2f')](_0x145308[_0xa839('0x46')],function(_0x5219ff){var _0x5b66dd={};_0x5b66dd[_0x5219ff]={'$like':'%'+_0x3216e5[_0xa839('0x3f')]['filter']+'%'};return _0x5b66dd;})});}_0x145308=_[_0xa839('0x57')]({},_0x145308,_0x3216e5[_0xa839('0xc8')]);return _0xbf0362['getGroups'](_0x145308);}})[_0xa839('0x12')](function(_0xc8baa){if(_0xc8baa){_0x3033cf=_0xc8baa[_0xa839('0x4a')];if(!_0x3216e5[_0xa839('0x3f')]['hasOwnProperty']('nolimit')){_0x145308[_0xa839('0x22')]=qs[_0xa839('0x22')](_0x3216e5[_0xa839('0x3f')][_0xa839('0x22')]);_0x145308[_0xa839('0x20')]=qs[_0xa839('0x20')](_0x3216e5[_0xa839('0x3f')][_0xa839('0x20')]);}return _0xbf0362['getGroups'](_0x145308);}})[_0xa839('0x12')](function(_0x55fc25){if(_0x55fc25){return _0x55fc25?{'count':_0x3033cf,'rows':_0x55fc25}:null;}})['then'](respondWithResult(_0x38f5a7,null))[_0xa839('0x1b')](handleError(_0x38f5a7,null));};exports[_0xa839('0xd8')]=function(_0x2f62aa,_0x3d7db5){var _0x28c98b={'raw':!![],'where':{}};var _0x32a9fb={};var _0x121016={'count':0x0,'rows':[]};return db['User'][_0xa839('0xc5')]({'where':{'id':_0x2f62aa[_0xa839('0x5c')]['id']}})['then'](handleEntityNotFound(_0x3d7db5,null))[_0xa839('0x12')](function(_0x2b6555){if(_0x2b6555){_0x32a9fb['model']=_[_0xa839('0x52')](db['VoiceRecording'][_0xa839('0x37')]);_0x32a9fb['query']=_[_0xa839('0x52')](_0x2f62aa['query']);_0x32a9fb[_0xa839('0x54')]=_[_0xa839('0x55')](_0x32a9fb[_0xa839('0x51')],_0x32a9fb[_0xa839('0x3f')]);_0x28c98b[_0xa839('0x46')]=_[_0xa839('0x55')](_0x32a9fb[_0xa839('0x51')],qs['fields'](_0x2f62aa[_0xa839('0x3f')]['fields']));_0x28c98b[_0xa839('0x46')]=_0x28c98b['attributes'][_0xa839('0x4a')]?_0x28c98b[_0xa839('0x46')]:_0x32a9fb[_0xa839('0x51')];if(!_0x2f62aa[_0xa839('0x3f')][_0xa839('0xcf')](_0xa839('0xd0'))){_0x28c98b[_0xa839('0x22')]=qs[_0xa839('0x22')](_0x2f62aa[_0xa839('0x3f')][_0xa839('0x22')]);_0x28c98b[_0xa839('0x20')]=qs[_0xa839('0x20')](_0x2f62aa[_0xa839('0x3f')]['offset']);}_0x28c98b[_0xa839('0xc6')]=qs[_0xa839('0xc7')](_0x2f62aa[_0xa839('0x3f')]['sort']);_0x28c98b[_0xa839('0x3d')]=qs[_0xa839('0x54')](_[_0xa839('0xd3')](_0x2f62aa['query'],_0x32a9fb[_0xa839('0x54')]));_0x28c98b[_0xa839('0x3d')][_0xa839('0xd9')]=_0x2b6555['id'];if(_0x2f62aa[_0xa839('0x3f')][_0xa839('0x2d')]){_0x28c98b[_0xa839('0x3d')]=_[_0xa839('0x57')](_0x28c98b[_0xa839('0x3d')],{'$or':_[_0xa839('0x2f')](_0x28c98b[_0xa839('0x46')],function(_0x10b1f4){var _0x458b87={};_0x458b87[_0x10b1f4]={'$like':'%'+_0x2f62aa[_0xa839('0x3f')][_0xa839('0x2d')]+'%'};return _0x458b87;})});}_0x28c98b=_[_0xa839('0x57')]({},_0x28c98b,_0x2f62aa[_0xa839('0xc8')]);return db[_0xa839('0xda')][_0xa839('0x23')]({'where':_0x28c98b[_0xa839('0x3d')]})['then'](function(_0x370c3e){_0x121016[_0xa839('0x23')]=_0x370c3e;if(_0x2f62aa[_0xa839('0x3f')]['includeAll']){_0x28c98b[_0xa839('0x41')]=[{'all':!![]}];}return db[_0xa839('0xda')][_0xa839('0x47')](_0x28c98b);})[_0xa839('0x12')](function(_0x1f17ea){_0x121016[_0xa839('0x48')]=_0x1f17ea;return _0x121016;});}})['then'](respondWithFilteredResult(_0x3d7db5,_0x28c98b))[_0xa839('0x1b')](handleError(_0x3d7db5,null));};exports[_0xa839('0xdb')]=function(_0x54aa1f,_0x2845bc){var _0x5ddcff={'raw':!![],'where':{}};var _0x247b1c={};var _0x485e0a={'count':0x0,'rows':[]};return db[_0xa839('0x3e')][_0xa839('0xc5')]({'where':{'id':_0x54aa1f['params']['id']}})[_0xa839('0x12')](handleEntityNotFound(_0x2845bc,null))[_0xa839('0x12')](function(_0x29773a){if(_0x29773a){_0x247b1c[_0xa839('0x51')]=_['keys'](db[_0xa839('0xdc')][_0xa839('0x37')]);_0x247b1c[_0xa839('0x3f')]=_[_0xa839('0x52')](_0x54aa1f[_0xa839('0x3f')]);_0x247b1c[_0xa839('0x54')]=_['intersection'](_0x247b1c[_0xa839('0x51')],_0x247b1c[_0xa839('0x3f')]);_0x5ddcff[_0xa839('0x46')]=_['intersection'](_0x247b1c[_0xa839('0x51')],qs[_0xa839('0x56')](_0x54aa1f['query'][_0xa839('0x56')]));_0x5ddcff[_0xa839('0x46')]=_0x5ddcff[_0xa839('0x46')][_0xa839('0x4a')]?_0x5ddcff[_0xa839('0x46')]:_0x247b1c['model'];if(!_0x54aa1f['query'][_0xa839('0xcf')](_0xa839('0xd0'))){_0x5ddcff[_0xa839('0x22')]=qs[_0xa839('0x22')](_0x54aa1f[_0xa839('0x3f')][_0xa839('0x22')]);_0x5ddcff[_0xa839('0x20')]=qs['offset'](_0x54aa1f[_0xa839('0x3f')][_0xa839('0x20')]);}_0x5ddcff[_0xa839('0xc6')]=qs[_0xa839('0xc7')](_0x54aa1f[_0xa839('0x3f')][_0xa839('0xc7')]);_0x5ddcff[_0xa839('0x3d')]=qs[_0xa839('0x54')](_[_0xa839('0xd3')](_0x54aa1f['query'],_0x247b1c[_0xa839('0x54')]));_0x5ddcff[_0xa839('0x3d')]['UserId']=_0x29773a['id'];if(_0x54aa1f['query'][_0xa839('0x2d')]){_0x5ddcff[_0xa839('0x3d')]=_[_0xa839('0x57')](_0x5ddcff[_0xa839('0x3d')],{'$or':_[_0xa839('0x2f')](_0x5ddcff[_0xa839('0x46')],function(_0x56d658){var _0x5388f7={};_0x5388f7[_0x56d658]={'$like':'%'+_0x54aa1f['query']['filter']+'%'};return _0x5388f7;})});}_0x5ddcff=_[_0xa839('0x57')]({},_0x5ddcff,_0x54aa1f[_0xa839('0xc8')]);return db['ScreenRecording'][_0xa839('0x23')]({'where':_0x5ddcff[_0xa839('0x3d')]})['then'](function(_0x47f99b){_0x485e0a[_0xa839('0x23')]=_0x47f99b;if(_0x54aa1f[_0xa839('0x3f')]['includeAll']){_0x5ddcff[_0xa839('0x41')]=[{'all':!![]}];}return db[_0xa839('0xdc')][_0xa839('0x47')](_0x5ddcff);})['then'](function(_0x48499d){_0x485e0a[_0xa839('0x48')]=_0x48499d;return _0x485e0a;});}})['then'](respondWithFilteredResult(_0x2845bc,_0x5ddcff))['catch'](handleError(_0x2845bc,null));};exports['getChatInteractions']=function(_0x5c8179,_0x42ad99){var _0x464f60={};var _0x5142b5={};var _0x34463a;var _0x2d588f;return db[_0xa839('0x3e')][_0xa839('0xc5')]({'where':{'id':_0x5c8179['params']['id']}})[_0xa839('0x12')](handleEntityNotFound(_0x42ad99,null))[_0xa839('0x12')](function(_0x351e76){if(_0x351e76){_0x34463a=_0x351e76;_0x5142b5[_0xa839('0x51')]=_[_0xa839('0x52')](db[_0xa839('0xdd')][_0xa839('0x37')]);_0x5142b5[_0xa839('0x3f')]=_[_0xa839('0x52')](_0x5c8179[_0xa839('0x3f')]);_0x5142b5['filters']=_[_0xa839('0x55')](_0x5142b5[_0xa839('0x51')],_0x5142b5[_0xa839('0x3f')]);_0x464f60['attributes']=_[_0xa839('0x55')](_0x5142b5['model'],qs[_0xa839('0x56')](_0x5c8179['query'][_0xa839('0x56')]));_0x464f60[_0xa839('0x46')]=_0x464f60[_0xa839('0x46')][_0xa839('0x4a')]?_0x464f60[_0xa839('0x46')]:_0x5142b5['model'];_0x464f60[_0xa839('0xc6')]=qs[_0xa839('0xc7')](_0x5c8179['query'][_0xa839('0xc7')]);_0x464f60[_0xa839('0x3d')]=qs[_0xa839('0x54')](_['pick'](_0x5c8179['query'],_0x5142b5[_0xa839('0x54')]));if(_0x5c8179['query']['filter']){_0x464f60[_0xa839('0x3d')]=_['merge'](_0x464f60[_0xa839('0x3d')],{'$or':_['map'](_0x464f60[_0xa839('0x46')],function(_0x2c2a96){var _0x506ade={};_0x506ade[_0x2c2a96]={'$like':'%'+_0x5c8179['query'][_0xa839('0x2d')]+'%'};return _0x506ade;})});}_0x464f60=_[_0xa839('0x57')]({},_0x464f60,_0x5c8179[_0xa839('0xc8')]);return _0x34463a[_0xa839('0xde')](_0x464f60);}})[_0xa839('0x12')](function(_0x377e9d){if(_0x377e9d){_0x2d588f=_0x377e9d[_0xa839('0x4a')];if(!_0x5c8179[_0xa839('0x3f')][_0xa839('0xcf')](_0xa839('0xd0'))){_0x464f60['limit']=qs[_0xa839('0x22')](_0x5c8179['query'][_0xa839('0x22')]);_0x464f60[_0xa839('0x20')]=qs[_0xa839('0x20')](_0x5c8179[_0xa839('0x3f')][_0xa839('0x20')]);}return _0x34463a[_0xa839('0xde')](_0x464f60);}})['then'](function(_0x53b5f3){if(_0x53b5f3){return _0x53b5f3?{'count':_0x2d588f,'rows':_0x53b5f3}:null;}})['then'](respondWithResult(_0x42ad99,null))['catch'](handleError(_0x42ad99,null));};exports[_0xa839('0xdf')]=function(_0x20fd9c,_0x204707){var _0x43165e={};var _0x53c906={};var _0x11fe5e;var _0x4a4f60;return db['User'][_0xa839('0xc5')]({'where':{'id':_0x20fd9c[_0xa839('0x5c')]['id']}})[_0xa839('0x12')](handleEntityNotFound(_0x204707,null))[_0xa839('0x12')](function(_0xc3ec7d){if(_0xc3ec7d){_0x11fe5e=_0xc3ec7d;_0x53c906[_0xa839('0x51')]=_[_0xa839('0x52')](db[_0xa839('0xe0')][_0xa839('0x37')]);_0x53c906[_0xa839('0x3f')]=_[_0xa839('0x52')](_0x20fd9c[_0xa839('0x3f')]);_0x53c906[_0xa839('0x54')]=_[_0xa839('0x55')](_0x53c906[_0xa839('0x51')],_0x53c906['query']);_0x43165e[_0xa839('0x46')]=_[_0xa839('0x55')](_0x53c906[_0xa839('0x51')],qs[_0xa839('0x56')](_0x20fd9c[_0xa839('0x3f')][_0xa839('0x56')]));_0x43165e[_0xa839('0x46')]=_0x43165e[_0xa839('0x46')][_0xa839('0x4a')]?_0x43165e[_0xa839('0x46')]:_0x53c906['model'];_0x43165e[_0xa839('0xc6')]=qs['sort'](_0x20fd9c[_0xa839('0x3f')]['sort']);_0x43165e[_0xa839('0x3d')]=qs[_0xa839('0x54')](_[_0xa839('0xd3')](_0x20fd9c[_0xa839('0x3f')],_0x53c906[_0xa839('0x54')]));if(_0x20fd9c['query'][_0xa839('0x2d')]){_0x43165e[_0xa839('0x3d')]=_[_0xa839('0x57')](_0x43165e[_0xa839('0x3d')],{'$or':_[_0xa839('0x2f')](_0x43165e[_0xa839('0x46')],function(_0x3d33c0){var _0x2a78e5={};_0x2a78e5[_0x3d33c0]={'$like':'%'+_0x20fd9c[_0xa839('0x3f')][_0xa839('0x2d')]+'%'};return _0x2a78e5;})});}_0x43165e=_[_0xa839('0x57')]({},_0x43165e,_0x20fd9c['options']);return _0x11fe5e[_0xa839('0xdf')](_0x43165e);}})[_0xa839('0x12')](function(_0xf63200){if(_0xf63200){_0x4a4f60=_0xf63200[_0xa839('0x4a')];if(!_0x20fd9c[_0xa839('0x3f')]['hasOwnProperty'](_0xa839('0xd0'))){_0x43165e['limit']=qs['limit'](_0x20fd9c[_0xa839('0x3f')]['limit']);_0x43165e[_0xa839('0x20')]=qs[_0xa839('0x20')](_0x20fd9c[_0xa839('0x3f')][_0xa839('0x20')]);}return _0x11fe5e[_0xa839('0xdf')](_0x43165e);}})[_0xa839('0x12')](function(_0x12d278){if(_0x12d278){return _0x12d278?{'count':_0x4a4f60,'rows':_0x12d278}:null;}})['then'](respondWithResult(_0x204707,null))[_0xa839('0x1b')](handleError(_0x204707,null));};exports[_0xa839('0xe1')]=function(_0x2f05c1,_0x180980){var _0x30871a={'raw':!![],'where':{}};var _0x32b333={};var _0x4316d2={'count':0x0,'rows':[]};return db[_0xa839('0x3e')]['findOne']({'where':{'id':_0x2f05c1[_0xa839('0x5c')]['id']}})[_0xa839('0x12')](handleEntityNotFound(_0x180980,null))[_0xa839('0x12')](function(_0x48b632){if(_0x48b632){_0x32b333['model']=_['keys'](db['MailInteraction'][_0xa839('0x37')]);_0x32b333['query']=_[_0xa839('0x52')](_0x2f05c1[_0xa839('0x3f')]);_0x32b333[_0xa839('0x54')]=_[_0xa839('0x55')](_0x32b333['model'],_0x32b333[_0xa839('0x3f')]);_0x30871a['attributes']=_[_0xa839('0x55')](_0x32b333[_0xa839('0x51')],qs[_0xa839('0x56')](_0x2f05c1['query'][_0xa839('0x56')]));_0x30871a[_0xa839('0x46')]=_0x30871a['attributes'][_0xa839('0x4a')]?_0x30871a[_0xa839('0x46')]:_0x32b333['model'];if(!_0x2f05c1[_0xa839('0x3f')]['hasOwnProperty']('nolimit')){_0x30871a[_0xa839('0x22')]=qs['limit'](_0x2f05c1[_0xa839('0x3f')]['limit']);_0x30871a[_0xa839('0x20')]=qs[_0xa839('0x20')](_0x2f05c1[_0xa839('0x3f')][_0xa839('0x20')]);}_0x30871a[_0xa839('0xc6')]=qs[_0xa839('0xc7')](_0x2f05c1[_0xa839('0x3f')]['sort']);_0x30871a[_0xa839('0x3d')]=qs['filters'](_[_0xa839('0xd3')](_0x2f05c1['query'],_0x32b333[_0xa839('0x54')]));_0x30871a[_0xa839('0x3d')][_0xa839('0xd9')]=_0x48b632['id'];if(_0x2f05c1[_0xa839('0x3f')][_0xa839('0x2d')]){_0x30871a[_0xa839('0x3d')]=_[_0xa839('0x57')](_0x30871a['where'],{'$or':_['map'](_0x30871a[_0xa839('0x46')],function(_0x2f5d98){var _0x1c6c0e={};_0x1c6c0e[_0x2f5d98]={'$like':'%'+_0x2f05c1['query'][_0xa839('0x2d')]+'%'};return _0x1c6c0e;})});}_0x30871a=_[_0xa839('0x57')]({},_0x30871a,_0x2f05c1['options']);return db[_0xa839('0xe2')]['count']({'where':_0x30871a[_0xa839('0x3d')]})[_0xa839('0x12')](function(_0x449f72){_0x4316d2[_0xa839('0x23')]=_0x449f72;if(_0x2f05c1['query'][_0xa839('0x40')]){_0x30871a[_0xa839('0x41')]=[{'all':!![]}];}return db[_0xa839('0xe2')][_0xa839('0x47')](_0x30871a);})[_0xa839('0x12')](function(_0x599f19){_0x4316d2['rows']=_0x599f19;return _0x4316d2;});}})[_0xa839('0x12')](respondWithFilteredResult(_0x180980,_0x30871a))[_0xa839('0x1b')](handleError(_0x180980,null));};exports[_0xa839('0xe3')]=function(_0x475e6f,_0x389a36){var _0x328228={};var _0x521216={};var _0x352e50;var _0x1dc7f0;return db[_0xa839('0x3e')][_0xa839('0xc5')]({'where':{'id':_0x475e6f[_0xa839('0x5c')]['id']}})[_0xa839('0x12')](handleEntityNotFound(_0x389a36,null))['then'](function(_0x2a185f){if(_0x2a185f){_0x352e50=_0x2a185f;_0x521216['model']=_[_0xa839('0x52')](db[_0xa839('0xe4')][_0xa839('0x37')]);_0x521216['query']=_[_0xa839('0x52')](_0x475e6f['query']);_0x521216[_0xa839('0x54')]=_[_0xa839('0x55')](_0x521216['model'],_0x521216[_0xa839('0x3f')]);_0x328228[_0xa839('0x46')]=_[_0xa839('0x55')](_0x521216['model'],qs[_0xa839('0x56')](_0x475e6f[_0xa839('0x3f')][_0xa839('0x56')]));_0x328228['attributes']=_0x328228[_0xa839('0x46')][_0xa839('0x4a')]?_0x328228[_0xa839('0x46')]:_0x521216[_0xa839('0x51')];_0x328228['order']=qs[_0xa839('0xc7')](_0x475e6f[_0xa839('0x3f')][_0xa839('0xc7')]);_0x328228['where']=qs[_0xa839('0x54')](_['pick'](_0x475e6f[_0xa839('0x3f')],_0x521216[_0xa839('0x54')]));if(_0x475e6f[_0xa839('0x3f')][_0xa839('0x2d')]){_0x328228[_0xa839('0x3d')]=_[_0xa839('0x57')](_0x328228['where'],{'$or':_['map'](_0x328228[_0xa839('0x46')],function(_0x457c2d){var _0x24d01d={};_0x24d01d[_0x457c2d]={'$like':'%'+_0x475e6f['query'][_0xa839('0x2d')]+'%'};return _0x24d01d;})});}_0x328228=_[_0xa839('0x57')]({},_0x328228,_0x475e6f[_0xa839('0xc8')]);return _0x352e50[_0xa839('0xe3')](_0x328228);}})[_0xa839('0x12')](function(_0x1665d4){if(_0x1665d4){_0x1dc7f0=_0x1665d4[_0xa839('0x4a')];if(!_0x475e6f[_0xa839('0x3f')]['hasOwnProperty'](_0xa839('0xd0'))){_0x328228[_0xa839('0x22')]=qs[_0xa839('0x22')](_0x475e6f[_0xa839('0x3f')][_0xa839('0x22')]);_0x328228[_0xa839('0x20')]=qs[_0xa839('0x20')](_0x475e6f[_0xa839('0x3f')]['offset']);}return _0x352e50[_0xa839('0xe3')](_0x328228);}})[_0xa839('0x12')](function(_0x5d4405){if(_0x5d4405){return _0x5d4405?{'count':_0x1dc7f0,'rows':_0x5d4405}:null;}})[_0xa839('0x12')](respondWithResult(_0x389a36,null))['catch'](handleError(_0x389a36,null));};exports['getFaxInteractions']=function(_0x2a7eaa,_0x7f79cc){var _0x2b0991={};var _0x3caa39={};var _0x669102;var _0x485c3b;return db[_0xa839('0x3e')]['findOne']({'where':{'id':_0x2a7eaa[_0xa839('0x5c')]['id']}})['then'](handleEntityNotFound(_0x7f79cc,null))[_0xa839('0x12')](function(_0x2f3779){if(_0x2f3779){_0x669102=_0x2f3779;_0x3caa39[_0xa839('0x51')]=_['keys'](db['FaxInteraction']['rawAttributes']);_0x3caa39[_0xa839('0x3f')]=_[_0xa839('0x52')](_0x2a7eaa['query']);_0x3caa39['filters']=_['intersection'](_0x3caa39['model'],_0x3caa39[_0xa839('0x3f')]);_0x2b0991['attributes']=_['intersection'](_0x3caa39[_0xa839('0x51')],qs['fields'](_0x2a7eaa['query'][_0xa839('0x56')]));_0x2b0991[_0xa839('0x46')]=_0x2b0991['attributes'][_0xa839('0x4a')]?_0x2b0991[_0xa839('0x46')]:_0x3caa39[_0xa839('0x51')];_0x2b0991['order']=qs['sort'](_0x2a7eaa['query']['sort']);_0x2b0991[_0xa839('0x3d')]=qs[_0xa839('0x54')](_[_0xa839('0xd3')](_0x2a7eaa['query'],_0x3caa39['filters']));if(_0x2a7eaa[_0xa839('0x3f')]['filter']){_0x2b0991[_0xa839('0x3d')]=_[_0xa839('0x57')](_0x2b0991[_0xa839('0x3d')],{'$or':_[_0xa839('0x2f')](_0x2b0991[_0xa839('0x46')],function(_0x114fe4){var _0xdf39c0={};_0xdf39c0[_0x114fe4]={'$like':'%'+_0x2a7eaa[_0xa839('0x3f')][_0xa839('0x2d')]+'%'};return _0xdf39c0;})});}_0x2b0991=_['merge']({},_0x2b0991,_0x2a7eaa['options']);return _0x669102[_0xa839('0xe5')](_0x2b0991);}})[_0xa839('0x12')](function(_0x1c5824){if(_0x1c5824){_0x485c3b=_0x1c5824['length'];if(!_0x2a7eaa[_0xa839('0x3f')][_0xa839('0xcf')](_0xa839('0xd0'))){_0x2b0991[_0xa839('0x22')]=qs['limit'](_0x2a7eaa[_0xa839('0x3f')][_0xa839('0x22')]);_0x2b0991[_0xa839('0x20')]=qs['offset'](_0x2a7eaa[_0xa839('0x3f')][_0xa839('0x20')]);}return _0x669102['getFaxInteractions'](_0x2b0991);}})[_0xa839('0x12')](function(_0x33e178){if(_0x33e178){return _0x33e178?{'count':_0x485c3b,'rows':_0x33e178}:null;}})['then'](respondWithResult(_0x7f79cc,null))[_0xa839('0x1b')](handleError(_0x7f79cc,null));};exports[_0xa839('0xe6')]=function(_0x1b6d8e,_0x3d4f7d){var _0x37b62e={};var _0x382dba={};var _0x2ba565;var _0x5d0c05;return db[_0xa839('0x3e')][_0xa839('0xc5')]({'where':{'id':_0x1b6d8e[_0xa839('0x5c')]['id']}})[_0xa839('0x12')](handleEntityNotFound(_0x3d4f7d,null))[_0xa839('0x12')](function(_0x4fc732){if(_0x4fc732){_0x2ba565=_0x4fc732;_0x382dba[_0xa839('0x51')]=_[_0xa839('0x52')](db[_0xa839('0xe7')][_0xa839('0x37')]);_0x382dba['query']=_[_0xa839('0x52')](_0x1b6d8e['query']);_0x382dba[_0xa839('0x54')]=_['intersection'](_0x382dba[_0xa839('0x51')],_0x382dba['query']);_0x37b62e[_0xa839('0x46')]=_[_0xa839('0x55')](_0x382dba[_0xa839('0x51')],qs[_0xa839('0x56')](_0x1b6d8e[_0xa839('0x3f')][_0xa839('0x56')]));_0x37b62e[_0xa839('0x46')]=_0x37b62e[_0xa839('0x46')][_0xa839('0x4a')]?_0x37b62e[_0xa839('0x46')]:_0x382dba[_0xa839('0x51')];_0x37b62e[_0xa839('0xc6')]=qs[_0xa839('0xc7')](_0x1b6d8e[_0xa839('0x3f')]['sort']);_0x37b62e[_0xa839('0x3d')]=qs['filters'](_[_0xa839('0xd3')](_0x1b6d8e[_0xa839('0x3f')],_0x382dba['filters']));if(_0x1b6d8e[_0xa839('0x3f')]['filter']){_0x37b62e[_0xa839('0x3d')]=_[_0xa839('0x57')](_0x37b62e[_0xa839('0x3d')],{'$or':_[_0xa839('0x2f')](_0x37b62e[_0xa839('0x46')],function(_0x352d4a){var _0x10d40d={};_0x10d40d[_0x352d4a]={'$like':'%'+_0x1b6d8e[_0xa839('0x3f')][_0xa839('0x2d')]+'%'};return _0x10d40d;})});}_0x37b62e=_['merge']({},_0x37b62e,_0x1b6d8e[_0xa839('0xc8')]);return _0x2ba565['getWhatsappInteractions'](_0x37b62e);}})[_0xa839('0x12')](function(_0x5f3d3b){if(_0x5f3d3b){_0x5d0c05=_0x5f3d3b[_0xa839('0x4a')];if(!_0x1b6d8e[_0xa839('0x3f')][_0xa839('0xcf')](_0xa839('0xd0'))){_0x37b62e[_0xa839('0x22')]=qs[_0xa839('0x22')](_0x1b6d8e[_0xa839('0x3f')]['limit']);_0x37b62e[_0xa839('0x20')]=qs[_0xa839('0x20')](_0x1b6d8e[_0xa839('0x3f')][_0xa839('0x20')]);}return _0x2ba565[_0xa839('0xe6')](_0x37b62e);}})[_0xa839('0x12')](function(_0x2dc8b0){if(_0x2dc8b0){return _0x2dc8b0?{'count':_0x5d0c05,'rows':_0x2dc8b0}:null;}})[_0xa839('0x12')](respondWithResult(_0x3d4f7d,null))[_0xa839('0x1b')](handleError(_0x3d4f7d,null));};exports[_0xa839('0xe8')]=function(_0x2a1144,_0x1dfed3,_0x49e5c7){var _0x3b2cec;var _0x4bf9ea;var _0x2cab31;var _0x4f7b6f=!_[_0xa839('0x65')](_0x2a1144[_0xa839('0x5c')]['id'])?_0x2a1144[_0xa839('0x5c')]['id']:!_[_0xa839('0x65')](_0x2a1144[_0xa839('0x7c')]['id'])?_0x2a1144[_0xa839('0x7c')]['id']:null;return db[_0xa839('0x3e')][_0xa839('0x31')]({'where':{'id':_0x4f7b6f,'role':{'$or':[_0xa839('0x28'),_0xa839('0x7c'),_0xa839('0x2b')]}},'attributes':['id',_0xa839('0x34'),_0xa839('0xe9'),'mobile',_0xa839('0x27'),'internal',_0xa839('0x9a')]})[_0xa839('0x12')](function(_0x5573f7){if(_0x5573f7){if(_0x5573f7[_0xa839('0x27')]==='agent'){_0x3b2cec=_0x5573f7;if(_0x2a1144[_0xa839('0x5b')][_0xa839('0x9c')]){_0x2cab31=util[_0xa839('0xa9')](_0xa839('0xea'),_0x3b2cec[_0x2a1144[_0xa839('0x5b')][_0xa839('0x9c')]]);}else if(_0x2a1144['body']['intrf']){_0x2cab31=util[_0xa839('0xa9')](_0xa839('0xeb'),_0x2a1144[_0xa839('0x5b')][_0xa839('0xec')]);}else{_0x2cab31=util[_0xa839('0xa9')](_0xa839('0xeb'),_0x3b2cec['name']);}socket['to'](util[_0xa839('0xa9')](_0xa839('0xed'),_0x3b2cec[_0xa839('0x34')]))[_0xa839('0xa5')](_0xa839('0xee'),{'user':{'id':_0x3b2cec['id'],'name':_0x3b2cec['name']},'ip':_0x2a1144[_0xa839('0xef')][_0xa839('0xf0')]||_0x2a1144[_0xa839('0xf1')][_0xa839('0xf2')]||_0x2a1144[_0xa839('0xf3')][_0xa839('0xf2')]||_0x2a1144['connection'][_0xa839('0xf3')][_0xa839('0xf2')]});return db[_0xa839('0xd4')][_0xa839('0xae')]({'where':{'membername':_0x3b2cec[_0xa839('0x34')]},'individualHooks':!![]});}}else{throw new db[(_0xa839('0x8f'))][(_0xa839('0x90'))](_0xa839('0xf4'));}})[_0xa839('0x12')](function(){if(_0x3b2cec){return _0x3b2cec[_0xa839('0xf5')]({'raw':!![]});}})[_0xa839('0x12')](function(_0xce4a95){if(_0x3b2cec){var _0x8ea9de=[];if(_0xce4a95){_0x4bf9ea=_0xce4a95;if(_0x4bf9ea['length']){for(var _0x10b8b5=0x0;_0x10b8b5<_0x4bf9ea['length'];_0x10b8b5++){_0x8ea9de[_0xa839('0x4b')]({'membername':_0x3b2cec[_0xa839('0x34')],'UserId':_0x3b2cec['id'],'queue_name':_0x4bf9ea[_0x10b8b5][_0xa839('0x34')],'VoiceQueueId':_0x4bf9ea[_0x10b8b5]['id'],'interface':_0x2cab31,'paused':_0x3b2cec[_0xa839('0x9a')]||![],'penalty':_0x4bf9ea[_0x10b8b5]['UserVoiceQueue.penalty']||0x0});}return BPromise[_0xa839('0x88')](_0x8ea9de,function(_0x5894c9){return db[_0xa839('0xd4')][_0xa839('0xaa')](_0x5894c9);});}}}})[_0xa839('0x12')](function(){if(_0x3b2cec){return db[_0xa839('0xf6')][_0xa839('0x47')]({'where':{'membername':_0x3b2cec[_0xa839('0x34')],'exitAt':null}});}})[_0xa839('0x12')](function(_0x20b4f3){if(_0x3b2cec){var _0x4c5460=[];_0x20b4f3['forEach'](function(_0x230f20){_0x4c5460['push'](_0x230f20['update']({'exitAt':moment()[_0xa839('0xa9')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0xa839('0x4f')](_0x4c5460);}})[_0xa839('0x12')](function(){if(_0x3b2cec){var _0x49249f=[];var _0x2756e2=[];var _0x4d659d=utils[_0xa839('0xf7')]();var _0x43b16b={'membername':_0x3b2cec[_0xa839('0x34')],'interface':_0x2cab31,'enterAt':moment()['format'](_0xa839('0xf8')),'role':_0x3b2cec[_0xa839('0x27')],'internal':_0x3b2cec['internal']};_0x4d659d[_0xa839('0xf9')](function(_0x126a89){_0x49249f[_0xa839('0x4b')](_[_0xa839('0x57')]({'channel':_0x126a89,'type':_0xa839('0xfa'),'data1':_0x2a1144[_0xa839('0x5b')]['device'],'data2':_0x2cab31},_0x43b16b));if(_0x3b2cec[_0xa839('0x9a')]){_0x2756e2[_0xa839('0x4b')](_[_0xa839('0x57')]({'channel':_0x126a89,'type':'PAUSE','data1':_0xa839('0xfb')},_0x43b16b));}});return db['MemberReport'][_0xa839('0x85')](_0x49249f[_0xa839('0xc4')](_0x2756e2),{'individualHooks':!![]});}})['then'](function(){if(_0x3b2cec){return _0x3b2cec['update']({'online':!![],'lastLoginAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x3b2cec[_0xa839('0x9a')]||![],'mailPause':_0x3b2cec[_0xa839('0x9a')]||![],'chatPause':_0x3b2cec[_0xa839('0x9a')]||![],'faxPause':_0x3b2cec[_0xa839('0x9a')]||![],'smsPause':_0x3b2cec[_0xa839('0x9a')]||![],'openchannelPause':_0x3b2cec['loginInPause']||![],'whatsappPause':_0x3b2cec[_0xa839('0x9a')]||![],'pauseType':_0x3b2cec[_0xa839('0x9a')]?'LOGININPAUSE':null,'interface':_0x2cab31,'lastPauseAt':moment()[_0xa839('0xa9')](_0xa839('0xf8'))});}})[_0xa839('0x12')](function(_0x57a48e){if(_0x2a1144['isMiddleware']){return _0x49e5c7();}else{return BPromise['resolve'](_0x57a48e)[_0xa839('0x12')](respondWithResult(_0x1dfed3,null));}})['catch'](handleError(_0x1dfed3,null));};exports[_0xa839('0xfc')]=function(_0x233569,_0x2a3729){var _0x18e23f;return db[_0xa839('0x3e')][_0xa839('0x31')]({'where':{'id':_0x233569[_0xa839('0x5c')]['id'],'role':_0xa839('0x2b')},'attributes':['id','name',_0xa839('0x27')]})[_0xa839('0x12')](handleEntityNotFound(_0x2a3729,null))[_0xa839('0x12')](function(_0x2404c3){if(_0x2404c3){_0x18e23f=_0x2404c3;return db['UserVoiceQueueRt'][_0xa839('0xae')]({'where':{'membername':_0x18e23f[_0xa839('0x34')]},'individualHooks':!![]});}})[_0xa839('0x12')](function(){return db[_0xa839('0xf6')][_0xa839('0x47')]({'where':{'membername':_0x18e23f['name'],'exitAt':null}});})['then'](function(_0x4ff9a1){var _0x100397=[];_0x4ff9a1[_0xa839('0xf9')](function(_0x36b86a){_0x100397[_0xa839('0x4b')](_0x36b86a[_0xa839('0x25')]({'exitAt':moment()[_0xa839('0xa9')](_0xa839('0xf8'))}));});return BPromise[_0xa839('0x4f')](_0x100397);})[_0xa839('0x12')](function(){return _0x18e23f[_0xa839('0x25')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xa839('0x12')](respondWithResult(_0x2a3729,null))[_0xa839('0x1b')](handleError(_0x2a3729,null));};exports[_0xa839('0xfd')]=function(_0xdca50d,_0x2407ca){var _0x3c51e1;return db[_0xa839('0xd4')][_0xa839('0x25')]({'paused':0x1},{'where':{'UserId':_0xdca50d[_0xa839('0x5c')]['id']},'individualHooks':!![]})[_0xa839('0x12')](function(){return db[_0xa839('0x3e')][_0xa839('0x31')]({'where':{'id':_0xdca50d[_0xa839('0x5c')]['id'],'role':_0xa839('0x2b')},'attributes':['id',_0xa839('0x34'),_0xa839('0x27'),_0xa839('0x64'),_0xa839('0x9c')]});})[_0xa839('0x12')](handleEntityNotFound(_0x2407ca,null))[_0xa839('0x12')](function(_0x4e224f){if(_0x4e224f){_0x3c51e1=_0x4e224f;return respondWithRpcPromise(_0xa839('0xfe'),_0xa839('0xfd'),{'id':_0x3c51e1['id'],'name':_0x3c51e1[_0xa839('0x34')],'pause':!![]});}})[_0xa839('0x12')](function(){if(_0x3c51e1){return db[_0xa839('0xf6')][_0xa839('0x47')]({'where':{'membername':_0x3c51e1[_0xa839('0x34')],'type':'PAUSE','exitAt':null}});}})[_0xa839('0x12')](function(_0x96dd1){if(_0x96dd1[_0xa839('0x4a')]){var _0x5543e9=moment()[_0xa839('0xa9')](_0xa839('0xf8'));for(var _0x5978af=0x0,_0x40eff4=_0x96dd1[_0xa839('0x4a')];_0x5978af<_0x40eff4;_0x5978af++){_0x96dd1[_0x5978af][_0xa839('0xff')]({'exitAt':_0x5543e9});}}})[_0xa839('0x12')](function(){var _0x26a994=[];var _0x422f30=utils['getChannels']();_0x422f30['forEach'](function(_0x319857){_0x26a994[_0xa839('0x4b')]({'channel':_0x319857,'membername':_0x3c51e1['name'],'interface':_['isNil'](_0x3c51e1[_0xa839('0x9c')])?util[_0xa839('0xa9')](_0xa839('0xeb'),_0x3c51e1[_0xa839('0x34')]):_0x3c51e1[_0xa839('0x9c')],'type':_0xa839('0x100'),'enterAt':moment()[_0xa839('0xa9')](_0xa839('0xf8')),'data1':_0xdca50d[_0xa839('0x5b')][_0xa839('0x39')]||'DEFAULT\x20PAUSE','role':_0x3c51e1['role'],'internal':_0x3c51e1[_0xa839('0x64')]});});return db[_0xa839('0xf6')][_0xa839('0x85')](_0x26a994,{'individualHooks':!![]});})['then'](function(){return _0x3c51e1[_0xa839('0x25')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0xdca50d[_0xa839('0x5b')][_0xa839('0x39')]||_0xa839('0x101'),'lastPauseAt':moment()[_0xa839('0xa9')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0xa839('0x12')](respondWithResult(_0x2407ca,null))['catch'](handleError(_0x2407ca,null));};exports[_0xa839('0x102')]=function(_0x5348db,_0x26fad7){var _0xc5f1b8;return db[_0xa839('0x3e')][_0xa839('0x31')]({'where':{'id':_0x5348db[_0xa839('0x5c')]['id']},'attributes':['id','name',_0xa839('0x27'),_0xa839('0x9b'),_0xa839('0x103'),_0xa839('0x104'),_0xa839('0x105'),_0xa839('0x106'),_0xa839('0x107'),'whatsapppause','pauseType',_0xa839('0x108')]})[_0xa839('0x12')](handleEntityNotFound(_0x26fad7,null))['then'](function(_0x309653){if(_0x309653){_0xc5f1b8=_0x309653;if(_0x5348db[_0xa839('0x5b')][_0xa839('0xab')]&&!utils[_0xa839('0x9d')](_0x5348db[_0xa839('0x5b')]['channel'])){throw new db['Sequelize'][(_0xa839('0x90'))](_0xa839('0x9e'));}switch(_0x5348db[_0xa839('0x5b')][_0xa839('0xab')]){case _0xa839('0xa8'):return respondWithRpcPromise('QueuePause',_0xa839('0x102'),{'id':_0xc5f1b8['id'],'name':_0xc5f1b8[_0xa839('0x34')],'pause':![]})[_0xa839('0x12')](function(){return db[_0xa839('0xd4')][_0xa839('0x25')]({'paused':0x0},{'where':{'UserId':_0xc5f1b8['id']},'individualHooks':!![]});})[_0xa839('0x12')](function(){return db[_0xa839('0xf6')][_0xa839('0x31')]({'where':{'channel':_0x5348db[_0xa839('0x5b')][_0xa839('0xab')],'membername':_0xc5f1b8[_0xa839('0x34')],'type':_0xa839('0x100'),'exitAt':null}});})[_0xa839('0x12')](function(_0x2493a7){if(_0x2493a7){return _0x2493a7[_0xa839('0x25')]({'exitAt':moment()[_0xa839('0xa9')](_0xa839('0xf8')),'data2':_0xa839('0x109')},{'individualHooks':!![]});}return null;})[_0xa839('0x12')](function(){return _0xc5f1b8[_0xa839('0x25')]({'voicePause':![]});});case'mail':case _0xa839('0x58'):case _0xa839('0x4d'):case _0xa839('0x59'):case _0xa839('0x5a'):case _0xa839('0xb9'):return db[_0xa839('0xf6')][_0xa839('0x31')]({'where':{'channel':_0x5348db[_0xa839('0x5b')]['channel'],'membername':_0xc5f1b8['name'],'type':_0xa839('0x100'),'exitAt':null}})[_0xa839('0x12')](function(_0xd8c9df){if(_0xd8c9df){return _0xd8c9df[_0xa839('0x25')]({'exitAt':moment()['format'](_0xa839('0xf8')),'data2':_0xa839('0x109')},{'individualHooks':!![]});}return null;})[_0xa839('0x12')](function(){var _0x2a5970={};_[_0xa839('0x24')](_0x2a5970,util[_0xa839('0xa9')](_0xa839('0x10a'),_0x5348db[_0xa839('0x5b')][_0xa839('0xab')],_0xa839('0x10b')),![]);return _0xc5f1b8[_0xa839('0x25')](_0x2a5970);});default:return respondWithRpcPromise(_0xa839('0xfe'),_0xa839('0x102'),{'id':_0xc5f1b8['id'],'name':_0xc5f1b8['name'],'pause':![]})[_0xa839('0x12')](function(){return db[_0xa839('0xd4')][_0xa839('0x25')]({'paused':0x0},{'where':{'UserId':_0xc5f1b8['id']}});})['then'](function(){return db['MemberReport'][_0xa839('0x47')]({'where':{'membername':_0xc5f1b8['name'],'type':_0xa839('0x100'),'exitAt':null}});})[_0xa839('0x12')](function(_0x380b46){var _0x37be04=[];_0x380b46['forEach'](function(_0x4d4fee){_0x37be04[_0xa839('0x4b')](_0x4d4fee[_0xa839('0x25')]({'exitAt':moment()[_0xa839('0xa9')](_0xa839('0xf8')),'data2':'manual'}));});return BPromise[_0xa839('0x4f')](_0x37be04);})[_0xa839('0x12')](function(){return _0xc5f1b8['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0xa839('0x12')](respondWithResult(_0x26fad7,null))[_0xa839('0x1b')](handleError(_0x26fad7,null));};exports[_0xa839('0x10c')]=function(_0xe4c9a2,_0x502f4b){var _0x33b74d={};var _0xd75cff={};var _0x518cda;var _0x821c34;return db[_0xa839('0x3e')][_0xa839('0xc5')]({'where':{'id':_0xe4c9a2['params']['id']}})[_0xa839('0x12')](handleEntityNotFound(_0x502f4b,null))[_0xa839('0x12')](function(_0x1c7af7){if(_0x1c7af7){_0x518cda=_0x1c7af7;_0xd75cff['model']=_[_0xa839('0x52')](db[_0xa839('0x10d')][_0xa839('0x37')]);_0xd75cff[_0xa839('0x3f')]=_[_0xa839('0x52')](_0xe4c9a2[_0xa839('0x3f')]);_0xd75cff[_0xa839('0x54')]=_[_0xa839('0x55')](_0xd75cff[_0xa839('0x51')],_0xd75cff[_0xa839('0x3f')]);_0x33b74d[_0xa839('0x46')]=_[_0xa839('0x55')](_0xd75cff[_0xa839('0x51')],qs[_0xa839('0x56')](_0xe4c9a2['query']['fields']));_0x33b74d[_0xa839('0x46')]=_0x33b74d[_0xa839('0x46')][_0xa839('0x4a')]?_0x33b74d[_0xa839('0x46')]:_0xd75cff['model'];_0x33b74d[_0xa839('0xc6')]=qs['sort'](_0xe4c9a2[_0xa839('0x3f')][_0xa839('0xc7')]);_0x33b74d[_0xa839('0x3d')]=qs['filters'](_[_0xa839('0xd3')](_0xe4c9a2[_0xa839('0x3f')],_0xd75cff['filters']));if(_0xe4c9a2['query'][_0xa839('0x2d')]){_0x33b74d[_0xa839('0x3d')]=_[_0xa839('0x57')](_0x33b74d[_0xa839('0x3d')],{'$or':_[_0xa839('0x2f')](_0x33b74d['attributes'],function(_0x5e97aa){var _0x3355f2={};_0x3355f2[_0x5e97aa]={'$like':'%'+_0xe4c9a2[_0xa839('0x3f')][_0xa839('0x2d')]+'%'};return _0x3355f2;})});}_0x33b74d=_[_0xa839('0x57')]({},_0x33b74d,_0xe4c9a2[_0xa839('0xc8')]);return _0x518cda['getTeams'](_0x33b74d);}})[_0xa839('0x12')](function(_0x5c5cdd){if(_0x5c5cdd){_0x821c34=_0x5c5cdd[_0xa839('0x4a')];if(!_0xe4c9a2['query'][_0xa839('0xcf')](_0xa839('0xd0'))){_0x33b74d[_0xa839('0x22')]=qs[_0xa839('0x22')](_0xe4c9a2[_0xa839('0x3f')][_0xa839('0x22')]);_0x33b74d['offset']=qs[_0xa839('0x20')](_0xe4c9a2['query'][_0xa839('0x20')]);}return _0x518cda[_0xa839('0x10c')](_0x33b74d);}})[_0xa839('0x12')](function(_0x4bd5bb){if(_0x4bd5bb){return _0x4bd5bb?{'count':_0x821c34,'rows':_0x4bd5bb}:null;}})[_0xa839('0x12')](respondWithResult(_0x502f4b,null))['catch'](handleError(_0x502f4b,null));};exports['addTeams']=function(_0x2db417,_0x31839b){return db[_0xa839('0x3e')]['find']({'where':{'id':_0x2db417[_0xa839('0x5c')]['id']}})[_0xa839('0x12')](handleEntityNotFound(_0x31839b,null))[_0xa839('0x12')](function(_0x5835c5){if(_0x5835c5){var _0x20ad2e=_0x5835c5[_0xa839('0x26')]({'plain':!![]});return _0x5835c5[_0xa839('0x10e')](_0x2db417[_0xa839('0x5b')][_0xa839('0x5f')],_[_0xa839('0x5e')](_0x2db417[_0xa839('0x5b')],[_0xa839('0x5f'),'id'])||{})[_0xa839('0x12')](function(){for(var _0x19be48=0x0;_0x19be48<_0x2db417['body']['ids'][_0xa839('0x4a')];_0x19be48++){var _0x47be9d=[];var _0x877246={};db[_0xa839('0x10d')][_0xa839('0xc5')]({'where':{'id':_0x2db417[_0xa839('0x5b')][_0xa839('0x5f')][_0x19be48]}})['then'](function(_0x1793a0){_0x877246=_0x1793a0[_0xa839('0x4c')];_0x47be9d[_0xa839('0x4b')](_0x1793a0[_0xa839('0xf5')]()[_0xa839('0x12')](function(_0x121f42){for(var _0x49913a=0x0;_0x49913a<_0x121f42[_0xa839('0x4a')];_0x49913a++){_0x121f42[_0x49913a][_0xa839('0x10f')]('channel',_0xa839('0x110'));}return _0x121f42;}));_0x47be9d[_0xa839('0x4b')](_0x1793a0[_0xa839('0x111')]()[_0xa839('0x12')](function(_0xcb0735){for(var _0x344977=0x0;_0x344977<_0xcb0735[_0xa839('0x4a')];_0x344977++){_0xcb0735[_0x344977][_0xa839('0x10f')]('channel',_0xa839('0x112'));}return _0xcb0735;}));_0x47be9d[_0xa839('0x4b')](_0x1793a0[_0xa839('0x113')]()[_0xa839('0x12')](function(_0x39a2de){for(var _0xe5c158=0x0;_0xe5c158<_0x39a2de[_0xa839('0x4a')];_0xe5c158++){_0x39a2de[_0xe5c158][_0xa839('0x10f')](_0xa839('0xab'),_0xa839('0x114'));}return _0x39a2de;}));_0x47be9d[_0xa839('0x4b')](_0x1793a0[_0xa839('0x115')]()[_0xa839('0x12')](function(_0x10a137){for(var _0x29dad7=0x0;_0x29dad7<_0x10a137[_0xa839('0x4a')];_0x29dad7++){_0x10a137[_0x29dad7][_0xa839('0x10f')](_0xa839('0xab'),'Sms');}return _0x10a137;}));_0x47be9d[_0xa839('0x4b')](_0x1793a0[_0xa839('0x116')]()[_0xa839('0x12')](function(_0x31fac3){for(var _0x4d93b6=0x0;_0x4d93b6<_0x31fac3[_0xa839('0x4a')];_0x4d93b6++){_0x31fac3[_0x4d93b6][_0xa839('0x10f')](_0xa839('0xab'),'Whatsapp');}return _0x31fac3;}));_0x47be9d[_0xa839('0x4b')](_0x1793a0['getFaxQueues']()[_0xa839('0x12')](function(_0x40ddf5){for(var _0x1a6727=0x0;_0x1a6727<_0x40ddf5[_0xa839('0x4a')];_0x1a6727++){_0x40ddf5[_0x1a6727][_0xa839('0x10f')](_0xa839('0xab'),_0xa839('0x117'));}return _0x40ddf5;}));_0x47be9d[_0xa839('0x4b')](_0x1793a0['getOpenchannelQueues']()[_0xa839('0x12')](function(_0x214f3e){for(var _0x2bca38=0x0;_0x2bca38<_0x214f3e[_0xa839('0x4a')];_0x2bca38++){_0x214f3e[_0x2bca38][_0xa839('0x10f')]('channel',_0xa839('0x118'));}return _0x214f3e;}));return BPromise['all'](_0x47be9d);})[_0xa839('0x12')](function(_0x53ce52){var _0x2fd79f=_[_0xa839('0x119')](_0x53ce52);_0x47be9d=[];return db[_0xa839('0x67')][_0xa839('0x11a')](function(_0x13c673){for(var _0x3d3ac5=0x0;_0x3d3ac5<_0x2fd79f[_0xa839('0x4a')];_0x3d3ac5++){_0x47be9d['push'](_0x2fd79f[_0x3d3ac5][_0xa839('0x11b')](_0x20ad2e['id']),{'transaction':_0x13c673});}return BPromise[_0xa839('0x4f')](_0x47be9d)['then'](function(){if(_0x20ad2e['online']){return BPromise['each'](_['filter'](_0x2fd79f,function(_0x2b9129){return _0x2b9129[_0xa839('0x11c')](_0xa839('0xab'))===_0xa839('0x110');}),function(_0x4c6c02){return db[_0xa839('0xd4')][_0xa839('0xaa')]({'membername':_0x20ad2e[_0xa839('0x34')],'UserId':_0x20ad2e['id'],'queue_name':_0x4c6c02[_0xa839('0x34')],'VoiceQueueId':_0x4c6c02['id'],'interface':_['isNil'](_0x20ad2e[_0xa839('0x9c')])?util[_0xa839('0xa9')](_0xa839('0xeb'),_0x20ad2e[_0xa839('0x34')]):_0x20ad2e['interface'],'paused':_0x20ad2e[_0xa839('0x9b')]||![],'penalty':_0x20ad2e['penalty']},{'transaction':_0x13c673});});}else{return;}})[_0xa839('0x12')](function(){for(var _0x215136=0x0;_0x215136<_0x2fd79f[_0xa839('0x4a')];_0x215136++){var _0x49bb3=_0x2fd79f[_0x215136]['getDataValue']('channel');var _0x48cfdd=_0x49bb3+_0xa839('0xa4');socket['emit'](_0xa839('0x7c')+_0x49bb3+_0xa839('0xa7'),{'UserId':_0x20ad2e['id'],['queueField']:_0x2fd79f[_0x215136]['id']});}});});})['then'](function(){db[_0xa839('0x11d')][_0xa839('0xc5')]({'where':{'teamId':_0x877246['id']}})[_0xa839('0x12')](function(_0x42aaf0){if(_0x42aaf0){db[_0xa839('0x11e')][_0xa839('0x89')]({'UserId':_0x2db417[_0xa839('0x5c')]['id'],'VoicePrefixId':_0x42aaf0['VoicePrefixId']});}});});}});}})[_0xa839('0x12')](respondWithStatusCode(_0x31839b,null))[_0xa839('0x1b')](handleError(_0x31839b,null));};exports[_0xa839('0x11f')]=function(_0x30ab88,_0x53791a){return db[_0xa839('0x3e')][_0xa839('0xc5')]({'where':{'id':_0x30ab88[_0xa839('0x5c')]['id']}})[_0xa839('0x12')](handleEntityNotFound(_0x53791a,null))[_0xa839('0x12')](function(_0x32d6e3){if(_0x32d6e3){var _0x56af11=_0x32d6e3['get']({'plain':!![]});var _0x1721f3=_0x30ab88['query'][_0xa839('0x5f')];return _0x32d6e3[_0xa839('0x11f')](_0x1721f3)[_0xa839('0x12')](function(){for(var _0x39c086=0x0;_0x39c086<_0x1721f3['length'];_0x39c086++){var _0x967f0a=[];var _0x253b00={};db[_0xa839('0x10d')]['findOne']({'where':{'id':_0x1721f3[_0x39c086]}})[_0xa839('0x12')](function(_0x343449){_0x253b00=_0x343449[_0xa839('0x4c')];_0x967f0a[_0xa839('0x4b')](_0x343449[_0xa839('0xf5')]()['then'](function(_0xeb4c77){for(var _0x22047b=0x0;_0x22047b<_0xeb4c77[_0xa839('0x4a')];_0x22047b++){_0xeb4c77[_0x22047b]['setDataValue']('channel',_0xa839('0x110'));}return _0xeb4c77;}));_0x967f0a[_0xa839('0x4b')](_0x343449[_0xa839('0x111')]()[_0xa839('0x12')](function(_0xe6f307){for(var _0x5a9a4f=0x0;_0x5a9a4f<_0xe6f307['length'];_0x5a9a4f++){_0xe6f307[_0x5a9a4f]['setDataValue'](_0xa839('0xab'),_0xa839('0x112'));}return _0xe6f307;}));_0x967f0a[_0xa839('0x4b')](_0x343449['getMailQueues']()[_0xa839('0x12')](function(_0x2b460f){for(var _0x45a43c=0x0;_0x45a43c<_0x2b460f[_0xa839('0x4a')];_0x45a43c++){_0x2b460f[_0x45a43c][_0xa839('0x10f')](_0xa839('0xab'),_0xa839('0x114'));}return _0x2b460f;}));_0x967f0a[_0xa839('0x4b')](_0x343449[_0xa839('0x115')]()[_0xa839('0x12')](function(_0x31effe){for(var _0x31bcc0=0x0;_0x31bcc0<_0x31effe['length'];_0x31bcc0++){_0x31effe[_0x31bcc0][_0xa839('0x10f')](_0xa839('0xab'),_0xa839('0x120'));}return _0x31effe;}));_0x967f0a['push'](_0x343449[_0xa839('0x116')]()[_0xa839('0x12')](function(_0x1d49f1){for(var _0x52a19e=0x0;_0x52a19e<_0x1d49f1[_0xa839('0x4a')];_0x52a19e++){_0x1d49f1[_0x52a19e][_0xa839('0x10f')](_0xa839('0xab'),_0xa839('0x121'));}return _0x1d49f1;}));_0x967f0a[_0xa839('0x4b')](_0x343449[_0xa839('0x122')]()[_0xa839('0x12')](function(_0x43a9ae){for(var _0x1a4b3f=0x0;_0x1a4b3f<_0x43a9ae['length'];_0x1a4b3f++){_0x43a9ae[_0x1a4b3f][_0xa839('0x10f')]('channel',_0xa839('0x117'));}return _0x43a9ae;}));_0x967f0a['push'](_0x343449[_0xa839('0x123')]()[_0xa839('0x12')](function(_0x26d406){for(var _0x42d1ba=0x0;_0x42d1ba<_0x26d406[_0xa839('0x4a')];_0x42d1ba++){_0x26d406[_0x42d1ba][_0xa839('0x10f')](_0xa839('0xab'),'Openchannel');}return _0x26d406;}));return BPromise[_0xa839('0x4f')](_0x967f0a);})[_0xa839('0x12')](function(_0x38285e){var _0x546d3e=_[_0xa839('0x119')](_0x38285e);_0x967f0a=[];return db[_0xa839('0x67')][_0xa839('0x11a')](function(_0x3c14ec){for(var _0x26e9eb=0x0;_0x26e9eb<_0x546d3e[_0xa839('0x4a')];_0x26e9eb++){_0x967f0a[_0xa839('0x4b')](_0x546d3e[_0x26e9eb][_0xa839('0x124')](_0x56af11['id']),{'transaction':_0x3c14ec});}return BPromise[_0xa839('0x4f')](_0x967f0a)[_0xa839('0x12')](function(){if(_0x56af11['online']){return BPromise[_0xa839('0x88')](_[_0xa839('0x2d')](_0x546d3e,function(_0x28d830){return _0x28d830['getDataValue']('channel')===_0xa839('0x110');}),function(_0x34fbbd){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x34fbbd['id'],'UserId':_0x56af11['id']},'transaction':_0x3c14ec});});}else{return;}})['then'](function(){db['TeamVoicePrefix'][_0xa839('0xc5')]({'where':{'teamId':_0x253b00['id']}})[_0xa839('0x12')](function(_0xc76d57){if(_0xc76d57){return db['UserVoicePrefix'][_0xa839('0xae')]({'where':{'UserId':_0x56af11['id'],'VoicePrefixId':_0xc76d57[_0xa839('0x4c')][_0xa839('0x125')]}});}});})[_0xa839('0x12')](function(){for(var _0x227518=0x0;_0x227518<_0x546d3e[_0xa839('0x4a')];_0x227518++){var _0x2222c0=_0x546d3e[_0x227518][_0xa839('0x11c')](_0xa839('0xab'));var _0x18856d=_0x2222c0+_0xa839('0xa4');socket[_0xa839('0xa5')]('user'+_0x2222c0+'Queue:remove',{'UserId':_0x56af11['id'],['queueField']:_0x546d3e[_0x227518]['id']});}});});});}});}})['then'](respondWithStatusCode(_0x53791a,null))[_0xa839('0x1b')](handleError(_0x53791a,null));};exports[_0xa839('0x126')]=function(_0x1371fb,_0x25167d){var _0x5ede3f={};var _0x966681={};var _0x1aa6cc;var _0x3f889a;return db[_0xa839('0x3e')]['findOne']({'where':{'id':_0x1371fb['params']['id']}})[_0xa839('0x12')](handleEntityNotFound(_0x25167d,null))['then'](function(_0x1a6596){if(_0x1a6596){_0x1aa6cc=_0x1a6596;_0x966681[_0xa839('0x51')]=_['keys'](db[_0xa839('0xca')]['rawAttributes']);_0x966681[_0xa839('0x3f')]=_[_0xa839('0x52')](_0x1371fb['query']);_0x966681[_0xa839('0x54')]=_['intersection'](_0x966681[_0xa839('0x51')],_0x966681[_0xa839('0x3f')]);_0x5ede3f[_0xa839('0x46')]=_[_0xa839('0x55')](_0x966681[_0xa839('0x51')],qs[_0xa839('0x56')](_0x1371fb[_0xa839('0x3f')]['fields']));_0x5ede3f[_0xa839('0x46')]=_0x5ede3f[_0xa839('0x46')]['length']?_0x5ede3f[_0xa839('0x46')]:_0x966681['model'];_0x5ede3f[_0xa839('0xc6')]=qs[_0xa839('0xc7')](_0x1371fb['query'][_0xa839('0xc7')]);_0x5ede3f[_0xa839('0x3d')]=qs[_0xa839('0x54')](_[_0xa839('0xd3')](_0x1371fb[_0xa839('0x3f')],_0x966681[_0xa839('0x54')]));if(_0x1371fb[_0xa839('0x3f')][_0xa839('0x2d')]){_0x5ede3f[_0xa839('0x3d')]=_[_0xa839('0x57')](_0x5ede3f[_0xa839('0x3d')],{'$or':_[_0xa839('0x2f')](_0x5ede3f[_0xa839('0x46')],function(_0x497add){var _0x168e8c={};_0x168e8c[_0x497add]={'$like':'%'+_0x1371fb[_0xa839('0x3f')]['filter']+'%'};return _0x168e8c;})});}_0x5ede3f=_['merge']({},_0x5ede3f,_0x1371fb[_0xa839('0xc8')]);return _0x1aa6cc['getLists'](_0x5ede3f);}})['then'](function(_0x4abefe){if(_0x4abefe){_0x3f889a=_0x4abefe['length'];if(!_0x1371fb[_0xa839('0x3f')]['hasOwnProperty'](_0xa839('0xd0'))){_0x5ede3f[_0xa839('0x22')]=qs[_0xa839('0x22')](_0x1371fb[_0xa839('0x3f')][_0xa839('0x22')]);_0x5ede3f['offset']=qs['offset'](_0x1371fb[_0xa839('0x3f')][_0xa839('0x20')]);}return _0x1aa6cc[_0xa839('0x126')](_0x5ede3f);}})[_0xa839('0x12')](function(_0x405c57){if(_0x405c57){return _0x405c57?{'count':_0x3f889a,'rows':_0x405c57}:null;}})['then'](respondWithResult(_0x25167d,null))[_0xa839('0x1b')](handleError(_0x25167d,null));};exports[_0xa839('0x127')]=function(_0x1ab85e,_0x1461f0){var _0x4ba89f={};var _0x5d358e={};var _0x5024b7;return db['User'][_0xa839('0xc5')]({'where':{'id':_0x1ab85e[_0xa839('0x5c')]['id']}})[_0xa839('0x12')](handleEntityNotFound(_0x1461f0,null))[_0xa839('0x12')](function(_0x183d12){if(_0x183d12){_0x5024b7=_0x183d12;_0x5d358e[_0xa839('0x51')]=_[_0xa839('0x52')](db[_0xa839('0x3e')][_0xa839('0x37')]);_0x5d358e[_0xa839('0x3f')]=_[_0xa839('0x52')](_0x1ab85e['query']);_0x5d358e['filters']=_[_0xa839('0x55')](_0x5d358e['model'],_0x5d358e[_0xa839('0x3f')]);_0x4ba89f[_0xa839('0x46')]=_[_0xa839('0x55')](_0x5d358e[_0xa839('0x51')],qs[_0xa839('0x56')](_0x1ab85e[_0xa839('0x3f')][_0xa839('0x56')]));_0x4ba89f['attributes']=_0x4ba89f[_0xa839('0x46')]['length']?_0x4ba89f[_0xa839('0x46')]:_0x5d358e[_0xa839('0x51')];_0x4ba89f['order']=qs['sort'](_0x1ab85e[_0xa839('0x3f')][_0xa839('0xc7')]);_0x4ba89f[_0xa839('0x3d')]=qs[_0xa839('0x54')](_['pick'](_0x1ab85e[_0xa839('0x3f')],_0x5d358e['filters']));if(_0x1ab85e['query']['filter']){_0x4ba89f['where']=_[_0xa839('0x57')](_0x4ba89f[_0xa839('0x3d')],{'$or':_[_0xa839('0x2f')](_0x4ba89f[_0xa839('0x46')],function(_0x43357e){var _0x2d412b={};_0x2d412b[_0x43357e]={'$like':'%'+_0x1ab85e[_0xa839('0x3f')][_0xa839('0x2d')]+'%'};return _0x2d412b;})});}_0x4ba89f[_0xa839('0x51')]=db['User'];_0x4ba89f['as']='Agents';_0x4ba89f=_[_0xa839('0x57')]({},_0x4ba89f,_0x1ab85e['options']);return _0x5024b7[_0xa839('0xf5')]({'include':[_0x4ba89f]});}})[_0xa839('0x12')](function(_0x38e6fb){if(_0x38e6fb){var _0xe437dc={},_0x383692=[];for(var _0x1d8a20=0x0;_0x1d8a20<_0x38e6fb[_0xa839('0x4a')];_0x1d8a20+=0x1){for(var _0x43d714=0x0,_0x697305;_0x43d714<_0x38e6fb[_0x1d8a20][_0xa839('0x2a')]['length'];_0x43d714+=0x1){_0x697305=_0x38e6fb[_0x1d8a20][_0xa839('0x2a')][_0x43d714][_0xa839('0x26')]({'plain':!![]});_0xe437dc[_0x697305['id']]=_0x697305;}}_0xe437dc=_['values'](_0xe437dc);for(var _0x377b78=qs['offset'](_0x1ab85e[_0xa839('0x3f')][_0xa839('0x20')]);_0x377b78<_0xe437dc[_0xa839('0x4a')]&&_0x383692['length']=_0x58a86f[_0xc098('0x52')]){throw new Error(_0xc098('0x53'));}})[_0xc098('0x10')](function(){if(_0x117e57){return db[_0xc098('0x2c')][_0xc098('0x4a')]({'where':{'membername':_0x117e57[_0xc098('0x2f')]},'individualHooks':!![]});}})['then'](function(){if(_0x117e57){return _0x117e57['getVoiceQueues']({'raw':!![]});}})['then'](function(_0x13ea18){if(_0x117e57){if(_0x13ea18){var _0x29043a=[];_0x1249b1=_0x13ea18;if(_0x1249b1[_0xc098('0x4b')]){for(var _0x479816=0x0;_0x479816<_0x1249b1[_0xc098('0x4b')];_0x479816++){_0x29043a['push'](db['UserVoiceQueueRt'][_0xc098('0x54')]({'membername':_0x117e57[_0xc098('0x2f')],'UserId':_0x117e57['id'],'queue_name':_0x1249b1[_0x479816]['name'],'VoiceQueueId':_0x1249b1[_0x479816]['id'],'interface':_0x53cefc,'paused':_0x117e57[_0xc098('0x4f')]||![],'penalty':_0x1249b1[_0x479816][_0xc098('0x55')]||0x0}));}return BPromise[_0xc098('0x48')](_0x29043a);}}}})[_0xc098('0x10')](function(){if(_0x117e57){return db[_0xc098('0x2e')][_0xc098('0x1c')]({'where':{'membername':_0x117e57[_0xc098('0x2f')],'exitAt':null}});}})[_0xc098('0x10')](function(_0x58983b){if(_0x117e57){if(_0x58983b&&_0x58983b[_0xc098('0x4b')]){var _0x5d5dfe=[];_0x58983b[_0xc098('0x34')](function(_0x2a3a2a){_0x5d5dfe['push'](_0x2a3a2a[_0xc098('0x2d')]({'exitAt':moment()[_0xc098('0x31')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0xc098('0x48')](_0x5d5dfe);}}})[_0xc098('0x10')](function(_0x3977f3){if(_0x117e57){var _0x401c07=[];var _0xf804f0=[];var _0x39d4ca=utils[_0xc098('0x56')]();var _0x96f121={'membername':_0x117e57['name'],'interface':_0x53cefc,'enterAt':moment()[_0xc098('0x31')](_0xc098('0x32')),'role':_0x117e57['role'],'internal':_0x117e57[_0xc098('0x2b')]};_0x39d4ca[_0xc098('0x34')](function(_0x37e624){_0x401c07[_0xc098('0x35')](_['merge']({'channel':_0x37e624,'type':_0xc098('0x57'),'data1':_0xc098('0x58'),'data2':_0x53cefc},_0x96f121));if(_0x117e57[_0xc098('0x4f')]){_0xf804f0['push'](_[_0xc098('0x59')]({'channel':_0x37e624,'type':_0xc098('0x30'),'data1':_0xc098('0x5a')},_0x96f121));}});return db[_0xc098('0x2e')][_0xc098('0x5b')](_0x401c07[_0xc098('0x5c')](_0xf804f0),{'individualHooks':!![]});}})[_0xc098('0x10')](function(){if(_0x117e57){return _0x117e57[_0xc098('0x2d')]({'online':!![],'lastLoginAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x117e57[_0xc098('0x4f')]||![],'mailPause':_0x117e57[_0xc098('0x4f')]||![],'chatPause':_0x117e57[_0xc098('0x4f')]||![],'faxPause':_0x117e57[_0xc098('0x4f')]||![],'smsPause':_0x117e57[_0xc098('0x4f')]||![],'openchannelPause':_0x117e57[_0xc098('0x4f')]||![],'pauseType':_0x117e57[_0xc098('0x4f')]?_0xc098('0x5a'):null,'lastPauseAt':moment()[_0xc098('0x31')](_0xc098('0x32')),'interface':_0x53cefc});}})[_0xc098('0x10')](function(_0x3f1306){_0x184c44(_0x3f1306);})[_0xc098('0x1a')](function(_0x20ce52){_0x2c672b(_0x3d6b1e['error'](0x1f4,_0x20ce52[_0xc098('0x18')]));});});}; \ No newline at end of file +var _0x6c0b=['LoginUser','phone','loginInPause','SIP/%s','agent','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','UserVoiceQueue.penalty','merge','LOGIN','callysquare','concat','LOGININPAUSE','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./user.socket','request','then','info','User,\x20%s,\x20%s','request\x20sent','error','code','message','User','findAll','options','raw','where','limit','include','model','attributes','GetUser','debug','stringify','catch','find','map','ShowUser','name','role','internal','interface','update','MemberReport','PAUSE','length','format','YYYY-MM-DD\x20HH:mm:ss','getChannels','forEach','push','isNil','type','DEFAULT\x20PAUSE','body','uniqueid','bulkCreate','UnpauseUser','findOne','channel','voice','UserVoiceQueueRt','system','chat','fax','openchannel','whatsapp','set','%s%s','Pause','all','LogoutUser','destroy'];(function(_0x200a05,_0x39ce94){var _0x166a3f=function(_0x4c443c){while(--_0x4c443c){_0x200a05['push'](_0x200a05['shift']());}};_0x166a3f(++_0x39ce94);}(_0x6c0b,0x17c));var _0xb6c0=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x6c0b[_0x40ac5e];return _0x2839d6;};'use strict';var _=require(_0xb6c0('0x0'));var util=require(_0xb6c0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb6c0('0x2'));var fs=require('fs');var Redis=require(_0xb6c0('0x3'));var db=require(_0xb6c0('0x4'))['db'];var utils=require(_0xb6c0('0x5'));var logger=require(_0xb6c0('0x6'))('rpc');var config=require(_0xb6c0('0x7'));var jayson=require(_0xb6c0('0x8'));var client=jayson[_0xb6c0('0x9')][_0xb6c0('0xa')]({'port':0x232a});config[_0xb6c0('0xb')]=_[_0xb6c0('0xc')](config[_0xb6c0('0xb')],{'host':_0xb6c0('0xd'),'port':0x18eb});var socket=require(_0xb6c0('0xe'))(new Redis(config[_0xb6c0('0xb')]));require(_0xb6c0('0xf'))['register'](socket);function respondWithRpcPromise(_0x213999,_0xe3afa0,_0x325999){return new BPromise(function(_0x22adb4,_0x5c3c86){return client[_0xb6c0('0x10')](_0x213999,_0x325999)[_0xb6c0('0x11')](function(_0xd3f530){logger[_0xb6c0('0x12')](_0xb6c0('0x13'),_0xe3afa0,_0xb6c0('0x14'));logger['debug']('User,\x20%s,\x20%s,\x20%s',_0xe3afa0,_0xb6c0('0x14'),JSON['stringify'](_0xd3f530));if(_0xd3f530[_0xb6c0('0x15')]){if(_0xd3f530[_0xb6c0('0x15')][_0xb6c0('0x16')]===0x1f4){logger[_0xb6c0('0x15')](_0xb6c0('0x13'),_0xe3afa0,_0xd3f530[_0xb6c0('0x15')]['message']);return _0x5c3c86(_0xd3f530[_0xb6c0('0x15')][_0xb6c0('0x17')]);}logger[_0xb6c0('0x15')]('User,\x20%s,\x20%s',_0xe3afa0,_0xd3f530[_0xb6c0('0x15')]['message']);return _0x22adb4(_0xd3f530[_0xb6c0('0x15')][_0xb6c0('0x17')]);}else{logger['info'](_0xb6c0('0x13'),_0xe3afa0,_0xb6c0('0x14'));_0x22adb4(_0xd3f530['result'][_0xb6c0('0x17')]);}})['catch'](function(_0x262b1f){logger['error'](_0xb6c0('0x13'),_0xe3afa0,_0x262b1f);_0x5c3c86(_0x262b1f);});});}exports['GetUser']=function(_0x5550e4){var _0x30df04=this;return new Promise(function(_0x5eccd9,_0x44dae5){return db[_0xb6c0('0x18')][_0xb6c0('0x19')]({'raw':_0x5550e4[_0xb6c0('0x1a')]?_0x5550e4['options'][_0xb6c0('0x1b')]===undefined?!![]:![]:!![],'where':_0x5550e4[_0xb6c0('0x1a')]?_0x5550e4[_0xb6c0('0x1a')][_0xb6c0('0x1c')]||null:null,'attributes':_0x5550e4[_0xb6c0('0x1a')]?_0x5550e4['options']['attributes']||null:null,'limit':_0x5550e4['options']?_0x5550e4[_0xb6c0('0x1a')][_0xb6c0('0x1d')]||null:null,'include':_0x5550e4[_0xb6c0('0x1a')]?_0x5550e4['options'][_0xb6c0('0x1e')]?_['map'](_0x5550e4[_0xb6c0('0x1a')][_0xb6c0('0x1e')],function(_0x4b46ab){return{'model':db[_0x4b46ab[_0xb6c0('0x1f')]],'as':_0x4b46ab['as'],'attributes':_0x4b46ab[_0xb6c0('0x20')],'include':_0x4b46ab[_0xb6c0('0x1e')]?_['map'](_0x4b46ab[_0xb6c0('0x1e')],function(_0x506fc0){return{'model':db[_0x506fc0['model']],'as':_0x506fc0['as'],'attributes':_0x506fc0[_0xb6c0('0x20')],'include':_0x506fc0[_0xb6c0('0x1e')]?_['map'](_0x506fc0[_0xb6c0('0x1e')],function(_0x4a0788){return{'model':db[_0x4a0788[_0xb6c0('0x1f')]],'as':_0x4a0788['as'],'attributes':_0x4a0788['attributes']};}):[]};}):[]};}):[]:[]})[_0xb6c0('0x11')](function(_0x2d7aff){logger[_0xb6c0('0x12')](_0xb6c0('0x21'),_0x5550e4);logger[_0xb6c0('0x22')](_0xb6c0('0x21'),_0x5550e4,JSON[_0xb6c0('0x23')](_0x2d7aff));_0x5eccd9(_0x2d7aff);})[_0xb6c0('0x24')](function(_0x495618){logger[_0xb6c0('0x15')]('GetUser',_0x495618['message'],_0x5550e4);_0x44dae5(_0x30df04[_0xb6c0('0x15')](0x1f4,_0x495618[_0xb6c0('0x17')]));});});};exports['ShowUser']=function(_0x34aa13){var _0x52e3ff=this;return new Promise(function(_0x173c51,_0x2cb6a0){return db[_0xb6c0('0x18')][_0xb6c0('0x25')]({'raw':_0x34aa13[_0xb6c0('0x1a')]?_0x34aa13[_0xb6c0('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x34aa13[_0xb6c0('0x1a')]?_0x34aa13[_0xb6c0('0x1a')][_0xb6c0('0x1c')]||null:null,'attributes':_0x34aa13[_0xb6c0('0x1a')]?_0x34aa13['options'][_0xb6c0('0x20')]||null:null,'include':_0x34aa13[_0xb6c0('0x1a')]?_0x34aa13[_0xb6c0('0x1a')][_0xb6c0('0x1e')]?_[_0xb6c0('0x26')](_0x34aa13['options'][_0xb6c0('0x1e')],function(_0x114c44){return{'model':db[_0x114c44[_0xb6c0('0x1f')]],'as':_0x114c44['as'],'attributes':_0x114c44[_0xb6c0('0x20')],'include':_0x114c44[_0xb6c0('0x1e')]?_[_0xb6c0('0x26')](_0x114c44['include'],function(_0x4ad20a){return{'model':db[_0x4ad20a[_0xb6c0('0x1f')]],'as':_0x4ad20a['as'],'attributes':_0x4ad20a['attributes'],'include':_0x4ad20a[_0xb6c0('0x1e')]?_[_0xb6c0('0x26')](_0x4ad20a[_0xb6c0('0x1e')],function(_0xddfc56){return{'model':db[_0xddfc56[_0xb6c0('0x1f')]],'as':_0xddfc56['as'],'attributes':_0xddfc56[_0xb6c0('0x20')]};}):[]};}):[]};}):[]:[]})[_0xb6c0('0x11')](function(_0x2aa534){logger['info']('ShowUser',_0x34aa13);logger['debug'](_0xb6c0('0x27'),_0x34aa13,JSON['stringify'](_0x2aa534));_0x173c51(_0x2aa534);})[_0xb6c0('0x24')](function(_0x5b4c67){logger[_0xb6c0('0x15')]('ShowUser',_0x5b4c67[_0xb6c0('0x17')],_0x34aa13);_0x2cb6a0(_0x52e3ff['error'](0x1f4,_0x5b4c67['message']));});});};exports['PauseUser']=function(_0x28d897){var _0x118022=this;return new Promise(function(_0x14e28b,_0x4e5b54){var _0x2b097d;return db['User'][_0xb6c0('0x25')]({'where':_0x28d897[_0xb6c0('0x1a')][_0xb6c0('0x1c')]||{},'attributes':['id',_0xb6c0('0x28'),_0xb6c0('0x29'),_0xb6c0('0x2a'),_0xb6c0('0x2b')]})['then'](function(_0x2541bc){if(_0x2541bc){_0x2b097d=_0x2541bc;return db['UserVoiceQueueRt'][_0xb6c0('0x2c')]({'paused':0x1},{'where':{'UserId':_0x2b097d['id']},'individualHooks':!![]});}})[_0xb6c0('0x11')](function(){if(_0x2b097d){return db[_0xb6c0('0x2d')][_0xb6c0('0x19')]({'where':{'membername':_0x2b097d[_0xb6c0('0x28')],'type':_0xb6c0('0x2e'),'exitAt':null}});}})[_0xb6c0('0x11')](function(_0x3dcc2a){if(_0x2b097d){if(_0x3dcc2a&&_0x3dcc2a[_0xb6c0('0x2f')]){var _0x31e805=moment()[_0xb6c0('0x30')](_0xb6c0('0x31'));for(var _0x54edf5=0x0,_0x533f48=_0x3dcc2a[_0xb6c0('0x2f')];_0x54edf5<_0x533f48;_0x54edf5++){_0x3dcc2a[_0x54edf5]['updateAttributes']({'exitAt':_0x31e805});}}}})['then'](function(){if(_0x2b097d){var _0xe8a35b=[];var _0x2a11ca=utils[_0xb6c0('0x32')]();_0x2a11ca[_0xb6c0('0x33')](function(_0x2d0ed9){_0xe8a35b[_0xb6c0('0x34')]({'channel':_0x2d0ed9,'membername':_0x2b097d[_0xb6c0('0x28')],'interface':_[_0xb6c0('0x35')](_0x2b097d[_0xb6c0('0x2b')])?util[_0xb6c0('0x30')]('SIP/%s',_0x2b097d['name']):_0x2b097d[_0xb6c0('0x2b')],'type':_0xb6c0('0x2e'),'enterAt':moment()[_0xb6c0('0x30')](_0xb6c0('0x31')),'data1':_0x28d897['body'][_0xb6c0('0x36')]||_0xb6c0('0x37'),'role':_0x2b097d['role'],'internal':_0x2b097d[_0xb6c0('0x2a')],'uniqueid':_0x28d897[_0xb6c0('0x38')][_0xb6c0('0x39')]||null});});return db['MemberReport'][_0xb6c0('0x3a')](_0xe8a35b,{'individualHooks':!![]});}})['then'](function(){if(_0x2b097d){return _0x2b097d['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x28d897[_0xb6c0('0x38')][_0xb6c0('0x36')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0xb6c0('0x30')](_0xb6c0('0x31'))});}})[_0xb6c0('0x11')](function(_0x1a24ef){_0x14e28b(_0x1a24ef);})['catch'](function(_0x2fd626){_0x4e5b54(_0x118022['error'](0x1f4,_0x2fd626[_0xb6c0('0x17')]));});});};exports[_0xb6c0('0x3b')]=function(_0x133d49){var _0x4d9072=this;return new Promise(function(_0x1a1bfb,_0x2162fa){var _0x3cd22d;return db[_0xb6c0('0x18')][_0xb6c0('0x3c')]({'where':_0x133d49['options'][_0xb6c0('0x1c')]||{},'attributes':['id',_0xb6c0('0x28')]})['then'](function(_0xada28e){if(_0xada28e){_0x3cd22d=_0xada28e;if(_0x133d49['body'][_0xb6c0('0x3d')]&&!utils['isValidChannel'](_0x133d49[_0xb6c0('0x38')][_0xb6c0('0x3d')])){throw new Error('Unknown\x20channel');}switch(_0x133d49['body'][_0xb6c0('0x3d')]){case _0xb6c0('0x3e'):return db[_0xb6c0('0x3f')][_0xb6c0('0x2c')]({'paused':0x0},{'where':{'UserId':_0x3cd22d['id']}})[_0xb6c0('0x11')](function(){return db[_0xb6c0('0x2d')]['find']({'where':{'channel':_0x133d49[_0xb6c0('0x38')][_0xb6c0('0x3d')],'membername':_0x3cd22d[_0xb6c0('0x28')],'type':_0xb6c0('0x2e'),'exitAt':null}});})['then'](function(_0x3a17ad){if(_0x3a17ad){return _0x3a17ad[_0xb6c0('0x2c')]({'exitAt':moment()['format'](_0xb6c0('0x31')),'data2':_0xb6c0('0x40')},{'individualHooks':!![]});}return null;})[_0xb6c0('0x11')](function(){return _0x3cd22d['update']({'voicePause':![]});});case'mail':case _0xb6c0('0x41'):case _0xb6c0('0x42'):case'sms':case _0xb6c0('0x43'):case _0xb6c0('0x44'):return db[_0xb6c0('0x2d')][_0xb6c0('0x25')]({'where':{'channel':_0x133d49['body'][_0xb6c0('0x3d')],'membername':_0x3cd22d['name'],'type':_0xb6c0('0x2e'),'exitAt':null}})[_0xb6c0('0x11')](function(_0x40dfd6){return _0x40dfd6[_0xb6c0('0x2c')]({'exitAt':moment()[_0xb6c0('0x30')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xb6c0('0x40')},{'individualHooks':!![]});})['then'](function(){var _0x396d7f={};_[_0xb6c0('0x45')](_0x396d7f,util[_0xb6c0('0x30')](_0xb6c0('0x46'),_0x133d49[_0xb6c0('0x38')]['channel'],_0xb6c0('0x47')),![]);return _0x3cd22d[_0xb6c0('0x2c')](_0x396d7f);});default:return db['UserVoiceQueueRt']['update']({'paused':0x0},{'where':{'UserId':_0x3cd22d['id']}})[_0xb6c0('0x11')](function(){return db[_0xb6c0('0x2d')][_0xb6c0('0x19')]({'where':{'membername':_0x3cd22d['name'],'type':_0xb6c0('0x2e'),'exitAt':null}});})[_0xb6c0('0x11')](function(_0x525806){var _0x41a71d=[];_0x525806[_0xb6c0('0x33')](function(_0x2cda3c){_0x41a71d[_0xb6c0('0x34')](_0x2cda3c['update']({'exitAt':moment()[_0xb6c0('0x30')](_0xb6c0('0x31')),'data2':_0xb6c0('0x40')}));});return BPromise[_0xb6c0('0x48')](_0x41a71d);})[_0xb6c0('0x11')](function(){return _0x3cd22d[_0xb6c0('0x2c')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0xb6c0('0x11')](function(_0x33bfbf){_0x1a1bfb(_0x33bfbf);})['catch'](function(_0x2b166c){_0x2162fa(_0x4d9072[_0xb6c0('0x15')](0x1f4,_0x2b166c[_0xb6c0('0x17')]));});});};exports[_0xb6c0('0x49')]=function(_0x3a9c26){var _0x204863=this;return new Promise(function(_0x5cd21b,_0x441d79){var _0x3b1ecf;return db[_0xb6c0('0x18')]['findOne']({'where':_0x3a9c26[_0xb6c0('0x1a')][_0xb6c0('0x1c')]||{},'attributes':['id',_0xb6c0('0x28')]})[_0xb6c0('0x11')](function(_0x400044){if(_0x400044){_0x3b1ecf=_0x400044;return db[_0xb6c0('0x3f')][_0xb6c0('0x4a')]({'where':{'membername':_0x3b1ecf['name']},'individualHooks':!![]});}})[_0xb6c0('0x11')](function(){if(_0x3b1ecf){return db[_0xb6c0('0x2d')][_0xb6c0('0x19')]({'where':{'membername':_0x3b1ecf[_0xb6c0('0x28')],'exitAt':null}});}})[_0xb6c0('0x11')](function(_0x477a5b){if(_0x3b1ecf){if(_0x477a5b&&_0x477a5b[_0xb6c0('0x2f')]){var _0x37ce80=[];_0x477a5b[_0xb6c0('0x33')](function(_0x58b67d){_0x37ce80[_0xb6c0('0x34')](_0x58b67d[_0xb6c0('0x2c')]({'exitAt':moment()['format'](_0xb6c0('0x31'))}));});return BPromise[_0xb6c0('0x48')](_0x37ce80);}}})[_0xb6c0('0x11')](function(){if(_0x3b1ecf){return _0x3b1ecf[_0xb6c0('0x2c')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xb6c0('0x11')](function(_0x1587e0){_0x5cd21b(_0x1587e0);})[_0xb6c0('0x24')](function(_0x3e8a72){_0x441d79(_0x204863[_0xb6c0('0x15')](0x1f4,_0x3e8a72[_0xb6c0('0x17')]));});});};exports[_0xb6c0('0x4b')]=function(_0x355c33){var _0x497e17=this;return new Promise(function(_0x4ffe9d,_0x5d1ca6){var _0x131823;var _0x3a3fdb;var _0x32ac8d;var _0x1fb0d6;return db[_0xb6c0('0x18')][_0xb6c0('0x3c')]({'where':_0x355c33['options'][_0xb6c0('0x1c')]||{},'attributes':['id',_0xb6c0('0x28'),_0xb6c0('0x29'),'mobile',_0xb6c0('0x4c'),_0xb6c0('0x2a'),_0xb6c0('0x4d'),_0xb6c0('0x2b')]})[_0xb6c0('0x11')](function(_0x3210a4){if(_0x3210a4){_0x131823=_0x3210a4;_0x1fb0d6=_0x355c33[_0xb6c0('0x38')][_0xb6c0('0x2b')]?_0x355c33[_0xb6c0('0x38')][_0xb6c0('0x2b')]:util[_0xb6c0('0x30')](_0xb6c0('0x4e'),_0x131823[_0xb6c0('0x28')]);return db['User']['count']({'where':{'role':_0xb6c0('0x4f'),'online':!![],'id':{'$ne':_0x131823['id']}}});}})[_0xb6c0('0x11')](function(_0x4b4636){if(_0x4b4636){_0x32ac8d=_0x4b4636;return require(_0xb6c0('0x50'))[_0xb6c0('0x51')]();}})[_0xb6c0('0x11')](function(_0x4fcd65){if(_0x4fcd65&&_0x4fcd65[_0xb6c0('0x52')]&&_0x32ac8d>=_0x4fcd65[_0xb6c0('0x52')]){throw new Error(_0xb6c0('0x53'));}})[_0xb6c0('0x11')](function(){if(_0x131823){return db['UserVoiceQueueRt'][_0xb6c0('0x4a')]({'where':{'membername':_0x131823[_0xb6c0('0x28')]},'individualHooks':!![]});}})[_0xb6c0('0x11')](function(){if(_0x131823){return _0x131823[_0xb6c0('0x54')]({'raw':!![]});}})[_0xb6c0('0x11')](function(_0x26c36a){if(_0x131823){if(_0x26c36a){var _0x2711dc=[];_0x3a3fdb=_0x26c36a;if(_0x3a3fdb[_0xb6c0('0x2f')]){for(var _0x33bb40=0x0;_0x33bb40<_0x3a3fdb[_0xb6c0('0x2f')];_0x33bb40++){_0x2711dc[_0xb6c0('0x34')](db[_0xb6c0('0x3f')]['upsert']({'membername':_0x131823[_0xb6c0('0x28')],'UserId':_0x131823['id'],'queue_name':_0x3a3fdb[_0x33bb40][_0xb6c0('0x28')],'VoiceQueueId':_0x3a3fdb[_0x33bb40]['id'],'interface':_0x1fb0d6,'paused':_0x131823[_0xb6c0('0x4d')]||![],'penalty':_0x3a3fdb[_0x33bb40][_0xb6c0('0x55')]||0x0}));}return BPromise[_0xb6c0('0x48')](_0x2711dc);}}}})[_0xb6c0('0x11')](function(){if(_0x131823){return db[_0xb6c0('0x2d')][_0xb6c0('0x19')]({'where':{'membername':_0x131823['name'],'exitAt':null}});}})['then'](function(_0x3de33d){if(_0x131823){if(_0x3de33d&&_0x3de33d[_0xb6c0('0x2f')]){var _0x15bc9b=[];_0x3de33d['forEach'](function(_0x4bf3c8){_0x15bc9b[_0xb6c0('0x34')](_0x4bf3c8[_0xb6c0('0x2c')]({'exitAt':moment()[_0xb6c0('0x30')](_0xb6c0('0x31'))}));});return BPromise[_0xb6c0('0x48')](_0x15bc9b);}}})[_0xb6c0('0x11')](function(_0x4d5571){if(_0x131823){var _0x3309f0=[];var _0x5d9908=[];var _0x403738=utils[_0xb6c0('0x32')]();var _0x2b2978={'membername':_0x131823[_0xb6c0('0x28')],'interface':_0x1fb0d6,'enterAt':moment()[_0xb6c0('0x30')](_0xb6c0('0x31')),'role':_0x131823[_0xb6c0('0x29')],'internal':_0x131823['internal']};_0x403738[_0xb6c0('0x33')](function(_0x5e07ff){_0x3309f0['push'](_[_0xb6c0('0x56')]({'channel':_0x5e07ff,'type':_0xb6c0('0x57'),'data1':_0xb6c0('0x58'),'data2':_0x1fb0d6},_0x2b2978));if(_0x131823['loginInPause']){_0x5d9908[_0xb6c0('0x34')](_['merge']({'channel':_0x5e07ff,'type':_0xb6c0('0x2e'),'data1':'LOGININPAUSE'},_0x2b2978));}});return db['MemberReport'][_0xb6c0('0x3a')](_0x3309f0[_0xb6c0('0x59')](_0x5d9908),{'individualHooks':!![]});}})[_0xb6c0('0x11')](function(){if(_0x131823){return _0x131823[_0xb6c0('0x2c')]({'online':!![],'lastLoginAt':moment()[_0xb6c0('0x30')](_0xb6c0('0x31')),'voicePause':_0x131823[_0xb6c0('0x4d')]||![],'mailPause':_0x131823[_0xb6c0('0x4d')]||![],'chatPause':_0x131823['loginInPause']||![],'faxPause':_0x131823[_0xb6c0('0x4d')]||![],'smsPause':_0x131823['loginInPause']||![],'openchannelPause':_0x131823['loginInPause']||![],'pauseType':_0x131823['loginInPause']?_0xb6c0('0x5a'):null,'lastPauseAt':moment()[_0xb6c0('0x30')](_0xb6c0('0x31')),'interface':_0x1fb0d6});}})[_0xb6c0('0x11')](function(_0x3abcbb){_0x4ffe9d(_0x3abcbb);})['catch'](function(_0x2be7b9){_0x5d1ca6(_0x497e17[_0xb6c0('0x15')](0x1f4,_0x2be7b9[_0xb6c0('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index fdd23c3..753bd90 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 _0x4e9f=['user:','./user.events','save','remove','emit','length'];(function(_0x1177d5,_0x22b649){var _0xc3ddc2=function(_0x43ff95){while(--_0x43ff95){_0x1177d5['push'](_0x1177d5['shift']());}};_0xc3ddc2(++_0x22b649);}(_0x4e9f,0x109));var _0xf4e9=function(_0x147796,_0x234fe6){_0x147796=_0x147796-0x0;var _0xd30d4=_0x4e9f[_0x147796];return _0xd30d4;};'use strict';var UserEvents=require(_0xf4e9('0x0'));var events=[_0xf4e9('0x1'),_0xf4e9('0x2'),'update'];function createListener(_0x2d2a46,_0x1154ef){return function(_0x432459){_0x1154ef[_0xf4e9('0x3')](_0x2d2a46,_0x432459);};}function removeListener(_0x5da84b,_0x58a221){return function(){UserEvents['removeListener'](_0x5da84b,_0x58a221);};}exports['register']=function(_0x235fce){for(var _0x3964e9=0x0,_0x4074a4=events[_0xf4e9('0x4')];_0x3964e9<_0x4074a4;_0x3964e9++){var _0x564781=events[_0x3964e9];var _0x1b8e5c=createListener(_0xf4e9('0x5')+_0x564781,_0x235fce);UserEvents['on'](_0x564781,_0x1b8e5c);}}; \ No newline at end of file +var _0x76ce=['./user.events','save','update','emit','removeListener','length','user:'];(function(_0x1336c0,_0x5b076e){var _0x34631b=function(_0x34340e){while(--_0x34340e){_0x1336c0['push'](_0x1336c0['shift']());}};_0x34631b(++_0x5b076e);}(_0x76ce,0x1b9));var _0xe76c=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x76ce[_0x5ddb1c];return _0x354adc;};'use strict';var UserEvents=require(_0xe76c('0x0'));var events=[_0xe76c('0x1'),'remove',_0xe76c('0x2')];function createListener(_0x2f2b63,_0x1114ec){return function(_0x226ba8){_0x1114ec[_0xe76c('0x3')](_0x2f2b63,_0x226ba8);};}function removeListener(_0x23b6d2,_0x480180){return function(){UserEvents[_0xe76c('0x4')](_0x23b6d2,_0x480180);};}exports['register']=function(_0x1e5d64){for(var _0x11a2d7=0x0,_0x4ab264=events[_0xe76c('0x5')];_0x11a2d7<_0x4ab264;_0x11a2d7++){var _0x3c93de=events[_0x11a2d7];var _0x2933e3=createListener(_0xe76c('0x6')+_0x3c93de,_0x1e5d64);UserEvents['on'](_0x3c93de,_0x2933e3);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 5d978d5..774c8d3 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x3e2014,_0x559db1){var _0x2a5742=function(_0x3d66de){while(--_0x3d66de){_0x3e2014['push'](_0x3e2014['shift']());}};_0x2a5742(++_0x559db1);}(_0xe706,0xa3));var _0x6e70=function(_0x4361b6,_0x29e3fe){_0x4361b6=_0x4361b6-0x0;var _0x477231=_0xe706[_0x4361b6];return _0x477231;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x5364e1,_0x58be7d){var _0x2149b6=function(_0x13b464){while(--_0x13b464){_0x5364e1['push'](_0x5364e1['shift']());}};_0x2149b6(++_0x58be7d);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x243217,_0x522951){_0x243217=_0x243217-0x0;var _0x478029=_0xcb91[_0x243217];return _0x478029;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 8073959..15ebc07 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 _0x5398=['sequelize','exports'];(function(_0x15fb43,_0x3972ae){var _0x38c9a4=function(_0x1b6115){while(--_0x1b6115){_0x15fb43['push'](_0x15fb43['shift']());}};_0x38c9a4(++_0x3972ae);}(_0x5398,0x146));var _0x8539=function(_0x1a39d3,_0x50bbbf){_0x1a39d3=_0x1a39d3-0x0;var _0x2881b5=_0x5398[_0x1a39d3];return _0x2881b5;};'use strict';var Sequelize=require(_0x8539('0x0'));module[_0x8539('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xcb83=['INTEGER','sequelize'];(function(_0x114e3f,_0x56b533){var _0x3b8db2=function(_0x57da79){while(--_0x57da79){_0x114e3f['push'](_0x114e3f['shift']());}};_0x3b8db2(++_0x56b533);}(_0xcb83,0x1c5));var _0x3cb8=function(_0x3e1eb9,_0x5c0aa7){_0x3e1eb9=_0x3e1eb9-0x0;var _0x1f36ca=_0xcb83[_0x3e1eb9];return _0x1f36ca;};'use strict';var Sequelize=require(_0x3cb8('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x3cb8('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index 3bd90b4..9d27d28 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 _0x511a=['../../config/environment','./userChatQueue.attributes','exports','define','util','../../config/logger','bluebird','path'];(function(_0x4cd96,_0x1bcb35){var _0x454914=function(_0x18e7e4){while(--_0x18e7e4){_0x4cd96['push'](_0x4cd96['shift']());}};_0x454914(++_0x1bcb35);}(_0x511a,0x74));var _0xa511=function(_0x1537f9,_0x2a8188){_0x1537f9=_0x1537f9-0x0;var _0x47d95a=_0x511a[_0x1537f9];return _0x47d95a;};'use strict';var _=require('lodash');var util=require(_0xa511('0x0'));var logger=require(_0xa511('0x1'))('api');var moment=require('moment');var BPromise=require(_0xa511('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa511('0x3'));var rimraf=require('rimraf');var config=require(_0xa511('0x4'));var attributes=require(_0xa511('0x5'));module[_0xa511('0x6')]=function(_0x5aec8f,_0x1f207a){return _0x5aec8f[_0xa511('0x7')]('UserChatQueue',attributes,{'tableName':'user_has_chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd73b=['user_has_chat_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./userChatQueue.attributes','define','UserChatQueue'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xd73b,0x91));var _0xbd73=function(_0x35fcb7,_0x3734c0){_0x35fcb7=_0x35fcb7-0x0;var _0x30f28a=_0xd73b[_0x35fcb7];return _0x30f28a;};'use strict';var _=require(_0xbd73('0x0'));var util=require(_0xbd73('0x1'));var logger=require(_0xbd73('0x2'))(_0xbd73('0x3'));var moment=require(_0xbd73('0x4'));var BPromise=require(_0xbd73('0x5'));var rp=require(_0xbd73('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbd73('0x7'));var config=require('../../config/environment');var attributes=require(_0xbd73('0x8'));module['exports']=function(_0x5dcc4a,_0x558bf5){return _0x5dcc4a[_0xbd73('0x9')](_0xbd73('0xa'),attributes,{'tableName':_0xbd73('0xb'),'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 62d6873..bec6568 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 _0xe391=['UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x1de4b8,_0x529b41){var _0x557699=function(_0xb10c18){while(--_0xb10c18){_0x1de4b8['push'](_0x1de4b8['shift']());}};_0x557699(++_0x529b41);}(_0xe391,0x104));var _0x1e39=function(_0x1c6ef2,_0x8d926a){_0x1c6ef2=_0x1c6ef2-0x0;var _0x404b8c=_0xe391[_0x1c6ef2];return _0x404b8c;};'use strict';var _=require('lodash');var util=require(_0x1e39('0x0'));var moment=require(_0x1e39('0x1'));var BPromise=require(_0x1e39('0x2'));var rs=require(_0x1e39('0x3'));var fs=require('fs');var Redis=require(_0x1e39('0x4'));var db=require(_0x1e39('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1e39('0x6'))(_0x1e39('0x7'));var config=require(_0x1e39('0x8'));var jayson=require(_0x1e39('0x9'));var client=jayson[_0x1e39('0xa')][_0x1e39('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x33345f,_0xdaf731,_0x1e3c70){return new BPromise(function(_0x380910,_0x24b3f2){return client[_0x1e39('0xc')](_0x33345f,_0x1e3c70)[_0x1e39('0xd')](function(_0x146615){logger[_0x1e39('0xe')](_0x1e39('0xf'),_0xdaf731,_0x1e39('0x10'));logger[_0x1e39('0x11')](_0x1e39('0x12'),_0xdaf731,_0x1e39('0x10'),JSON[_0x1e39('0x13')](_0x146615));if(_0x146615['error']){if(_0x146615[_0x1e39('0x14')][_0x1e39('0x15')]===0x1f4){logger[_0x1e39('0x14')](_0x1e39('0xf'),_0xdaf731,_0x146615['error'][_0x1e39('0x16')]);return _0x24b3f2(_0x146615[_0x1e39('0x14')][_0x1e39('0x16')]);}logger[_0x1e39('0x14')](_0x1e39('0xf'),_0xdaf731,_0x146615[_0x1e39('0x14')][_0x1e39('0x16')]);return _0x380910(_0x146615[_0x1e39('0x14')]['message']);}else{logger[_0x1e39('0xe')](_0x1e39('0xf'),_0xdaf731,_0x1e39('0x10'));_0x380910(_0x146615[_0x1e39('0x17')][_0x1e39('0x16')]);}})[_0x1e39('0x18')](function(_0x1fdcf4){logger[_0x1e39('0x14')]('UserChatQueue,\x20%s,\x20%s',_0xdaf731,_0x1fdcf4);_0x24b3f2(_0x1fdcf4);});});} \ No newline at end of file +var _0x7ad5=['rpc','../../config/environment','client','http','request','then','UserChatQueue,\x20%s,\x20%s','request\x20sent','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger'];(function(_0x571c00,_0x3ae028){var _0x2887df=function(_0x5ebe70){while(--_0x5ebe70){_0x571c00['push'](_0x571c00['shift']());}};_0x2887df(++_0x3ae028);}(_0x7ad5,0xcb));var _0x57ad=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0x7ad5[_0x38a7ac];return _0x53061a;};'use strict';var _=require(_0x57ad('0x0'));var util=require(_0x57ad('0x1'));var moment=require(_0x57ad('0x2'));var BPromise=require(_0x57ad('0x3'));var rs=require(_0x57ad('0x4'));var fs=require('fs');var Redis=require(_0x57ad('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x57ad('0x6'))(_0x57ad('0x7'));var config=require(_0x57ad('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x57ad('0x9')][_0x57ad('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1a1225,_0x467ea9,_0x3b50a8){return new BPromise(function(_0x5cf80f,_0x5a5c78){return client[_0x57ad('0xb')](_0x1a1225,_0x3b50a8)[_0x57ad('0xc')](function(_0x32dff4){logger['info'](_0x57ad('0xd'),_0x467ea9,_0x57ad('0xe'));logger['debug'](_0x57ad('0xf'),_0x467ea9,_0x57ad('0xe'),JSON[_0x57ad('0x10')](_0x32dff4));if(_0x32dff4[_0x57ad('0x11')]){if(_0x32dff4[_0x57ad('0x11')]['code']===0x1f4){logger[_0x57ad('0x11')]('UserChatQueue,\x20%s,\x20%s',_0x467ea9,_0x32dff4[_0x57ad('0x11')][_0x57ad('0x12')]);return _0x5a5c78(_0x32dff4[_0x57ad('0x11')][_0x57ad('0x12')]);}logger[_0x57ad('0x11')](_0x57ad('0xd'),_0x467ea9,_0x32dff4['error'][_0x57ad('0x12')]);return _0x5cf80f(_0x32dff4[_0x57ad('0x11')][_0x57ad('0x12')]);}else{logger[_0x57ad('0x13')](_0x57ad('0xd'),_0x467ea9,_0x57ad('0xe'));_0x5cf80f(_0x32dff4['result'][_0x57ad('0x12')]);}})[_0x57ad('0x14')](function(_0x52d280){logger[_0x57ad('0x11')]('UserChatQueue,\x20%s,\x20%s',_0x467ea9,_0x52d280);_0x5a5c78(_0x52d280);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index abd2237..ef747ca 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x48cc39,_0x4bbb8c){var _0x155301=function(_0x54f207){while(--_0x54f207){_0x48cc39['push'](_0x48cc39['shift']());}};_0x155301(++_0x4bbb8c);}(_0x70e0,0x17b));var _0x070e=function(_0x57328f,_0x4a772e){_0x57328f=_0x57328f-0x0;var _0x27cb34=_0x70e0[_0x57328f];return _0x27cb34;};'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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x275900,_0x2aeee3){var _0x163f31=function(_0x31427d){while(--_0x31427d){_0x275900['push'](_0x275900['shift']());}};_0x163f31(++_0x2aeee3);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1e9424,_0x191cba){_0x1e9424=_0x1e9424-0x0;var _0x1bd96c=_0xcb91[_0x1e9424];return _0x1bd96c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 1062be0..3082635 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 _0x36fc=['sequelize','INTEGER','STRING'];(function(_0x48b810,_0x173a5e){var _0x23c17d=function(_0x38531e){while(--_0x38531e){_0x48b810['push'](_0x48b810['shift']());}};_0x23c17d(++_0x173a5e);}(_0x36fc,0x1ef));var _0xc36f=function(_0x2f956c,_0x517107){_0x2f956c=_0x2f956c-0x0;var _0xa66ccd=_0x36fc[_0x2f956c];return _0xa66ccd;};'use strict';var Sequelize=require(_0xc36f('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xc36f('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xc36f('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xc36f('0x2')]}}; \ No newline at end of file +var _0xabc5=['INTEGER','STRING'];(function(_0x5bf35e,_0x24dd1b){var _0x533fa1=function(_0x30b4b5){while(--_0x30b4b5){_0x5bf35e['push'](_0x5bf35e['shift']());}};_0x533fa1(++_0x24dd1b);}(_0xabc5,0x182));var _0x5abc=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xabc5[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x5abc('0x0')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x5abc('0x0')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x5abc('0x1')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 39f4688..66f1629 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 _0xb6b4=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes','exports','define','UserFaxQueue','lodash','util'];(function(_0x41ed92,_0x1eedd4){var _0x4a7e3b=function(_0xa0a7e5){while(--_0xa0a7e5){_0x41ed92['push'](_0x41ed92['shift']());}};_0x4a7e3b(++_0x1eedd4);}(_0xb6b4,0x177));var _0x4b6b=function(_0x7ab339,_0x46cad6){_0x7ab339=_0x7ab339-0x0;var _0x1c56e4=_0xb6b4[_0x7ab339];return _0x1c56e4;};'use strict';var _=require(_0x4b6b('0x0'));var util=require(_0x4b6b('0x1'));var logger=require(_0x4b6b('0x2'))('api');var moment=require(_0x4b6b('0x3'));var BPromise=require(_0x4b6b('0x4'));var rp=require(_0x4b6b('0x5'));var fs=require('fs');var path=require(_0x4b6b('0x6'));var rimraf=require(_0x4b6b('0x7'));var config=require(_0x4b6b('0x8'));var attributes=require(_0x4b6b('0x9'));module[_0x4b6b('0xa')]=function(_0x50790b,_0x30ccc0){return _0x50790b[_0x4b6b('0xb')](_0x4b6b('0xc'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x33e6=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','UserFaxQueue','user_has_fax_queues','lodash','util'];(function(_0x3c4886,_0x5ba9ff){var _0x378720=function(_0x1de287){while(--_0x1de287){_0x3c4886['push'](_0x3c4886['shift']());}};_0x378720(++_0x5ba9ff);}(_0x33e6,0x6e));var _0x633e=function(_0x5a308d,_0x3c9361){_0x5a308d=_0x5a308d-0x0;var _0x41a625=_0x33e6[_0x5a308d];return _0x41a625;};'use strict';var _=require(_0x633e('0x0'));var util=require(_0x633e('0x1'));var logger=require(_0x633e('0x2'))(_0x633e('0x3'));var moment=require(_0x633e('0x4'));var BPromise=require(_0x633e('0x5'));var rp=require(_0x633e('0x6'));var fs=require('fs');var path=require(_0x633e('0x7'));var rimraf=require(_0x633e('0x8'));var config=require(_0x633e('0x9'));var attributes=require('./userFaxQueue.attributes');module[_0x633e('0xa')]=function(_0x4ffd99,_0x240cde){return _0x4ffd99[_0x633e('0xb')](_0x633e('0xc'),attributes,{'tableName':_0x633e('0xd'),'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 5a76fec..7899578 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 _0xfa63=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','UserFaxQueue,\x20%s,\x20%s','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfa63,0x187));var _0x3fa6=function(_0x3ab129,_0x2b5b93){_0x3ab129=_0x3ab129-0x0;var _0x12e126=_0xfa63[_0x3ab129];return _0x12e126;};'use strict';var _=require(_0x3fa6('0x0'));var util=require(_0x3fa6('0x1'));var moment=require(_0x3fa6('0x2'));var BPromise=require(_0x3fa6('0x3'));var rs=require(_0x3fa6('0x4'));var fs=require('fs');var Redis=require(_0x3fa6('0x5'));var db=require(_0x3fa6('0x6'))['db'];var utils=require(_0x3fa6('0x7'));var logger=require('../../config/logger')(_0x3fa6('0x8'));var config=require(_0x3fa6('0x9'));var jayson=require(_0x3fa6('0xa'));var client=jayson[_0x3fa6('0xb')][_0x3fa6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x488096,_0x278b63,_0x346655){return new BPromise(function(_0x2491dc,_0x1f158e){return client['request'](_0x488096,_0x346655)[_0x3fa6('0xd')](function(_0x5b726d){logger['info'](_0x3fa6('0xe'),_0x278b63,'request\x20sent');logger[_0x3fa6('0xf')](_0x3fa6('0x10'),_0x278b63,'request\x20sent',JSON[_0x3fa6('0x11')](_0x5b726d));if(_0x5b726d['error']){if(_0x5b726d[_0x3fa6('0x12')]['code']===0x1f4){logger['error'](_0x3fa6('0xe'),_0x278b63,_0x5b726d[_0x3fa6('0x12')][_0x3fa6('0x13')]);return _0x1f158e(_0x5b726d['error']['message']);}logger[_0x3fa6('0x12')](_0x3fa6('0xe'),_0x278b63,_0x5b726d[_0x3fa6('0x12')][_0x3fa6('0x13')]);return _0x2491dc(_0x5b726d[_0x3fa6('0x12')][_0x3fa6('0x13')]);}else{logger[_0x3fa6('0x14')](_0x3fa6('0xe'),_0x278b63,'request\x20sent');_0x2491dc(_0x5b726d[_0x3fa6('0x15')][_0x3fa6('0x13')]);}})[_0x3fa6('0x16')](function(_0x36ed55){logger['error'](_0x3fa6('0xe'),_0x278b63,_0x36ed55);_0x1f158e(_0x36ed55);});});} \ No newline at end of file +var _0x08fa=['moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x90652c,_0x1f9a91){var _0x37c89c=function(_0xe3b66){while(--_0xe3b66){_0x90652c['push'](_0x90652c['shift']());}};_0x37c89c(++_0x1f9a91);}(_0x08fa,0x71));var _0xa08f=function(_0x3f5859,_0x3cc9f0){_0x3f5859=_0x3f5859-0x0;var _0x1af979=_0x08fa[_0x3f5859];return _0x1af979;};'use strict';var _=require(_0xa08f('0x0'));var util=require(_0xa08f('0x1'));var moment=require(_0xa08f('0x2'));var BPromise=require(_0xa08f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa08f('0x4'))['db'];var utils=require(_0xa08f('0x5'));var logger=require(_0xa08f('0x6'))(_0xa08f('0x7'));var config=require(_0xa08f('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa08f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x14e8d7,_0x47d7d8,_0x227f41){return new BPromise(function(_0x1d1418,_0x5b822b){return client[_0xa08f('0xa')](_0x14e8d7,_0x227f41)[_0xa08f('0xb')](function(_0x5af647){logger[_0xa08f('0xc')](_0xa08f('0xd'),_0x47d7d8,_0xa08f('0xe'));logger[_0xa08f('0xf')](_0xa08f('0x10'),_0x47d7d8,_0xa08f('0xe'),JSON[_0xa08f('0x11')](_0x5af647));if(_0x5af647[_0xa08f('0x12')]){if(_0x5af647[_0xa08f('0x12')][_0xa08f('0x13')]===0x1f4){logger[_0xa08f('0x12')](_0xa08f('0xd'),_0x47d7d8,_0x5af647[_0xa08f('0x12')][_0xa08f('0x14')]);return _0x5b822b(_0x5af647[_0xa08f('0x12')]['message']);}logger[_0xa08f('0x12')](_0xa08f('0xd'),_0x47d7d8,_0x5af647['error'][_0xa08f('0x14')]);return _0x1d1418(_0x5af647[_0xa08f('0x12')][_0xa08f('0x14')]);}else{logger[_0xa08f('0xc')](_0xa08f('0xd'),_0x47d7d8,'request\x20sent');_0x1d1418(_0x5af647[_0xa08f('0x15')][_0xa08f('0x14')]);}})[_0xa08f('0x16')](function(_0x574d8d){logger[_0xa08f('0x12')](_0xa08f('0xd'),_0x47d7d8,_0x574d8d);_0x5b822b(_0x574d8d);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index c03fd8d..e5cbe67 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x21df86,_0x572ce5){var _0x9897df=function(_0x3107eb){while(--_0x3107eb){_0x21df86['push'](_0x21df86['shift']());}};_0x9897df(++_0x572ce5);}(_0x70e0,0x17b));var _0x070e=function(_0x57fc08,_0x5ef248){_0x57fc08=_0x57fc08-0x0;var _0x55836f=_0x70e0[_0x57fc08];return _0x55836f;};'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(_0x528d33,_0x146c37){var _0x2df1d7=function(_0x52e177){while(--_0x52e177){_0x528d33['push'](_0x528d33['shift']());}};_0x2df1d7(++_0x146c37);}(_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/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 9d0325c..d7ce4a1 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 _0x9512=['exports','INTEGER','sequelize'];(function(_0x425867,_0x31ff8d){var _0x5a88df=function(_0x2818f7){while(--_0x2818f7){_0x425867['push'](_0x425867['shift']());}};_0x5a88df(++_0x31ff8d);}(_0x9512,0x1ac));var _0x2951=function(_0x7babd9,_0x1d1f5e){_0x7babd9=_0x7babd9-0x0;var _0x394174=_0x9512[_0x7babd9];return _0x394174;};'use strict';var Sequelize=require(_0x2951('0x0'));module[_0x2951('0x1')]={'penalty':{'type':Sequelize[_0x2951('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xaf73=['exports','INTEGER','sequelize'];(function(_0x3c5660,_0x5ccfac){var _0x4acfb0=function(_0x59cc35){while(--_0x59cc35){_0x3c5660['push'](_0x3c5660['shift']());}};_0x4acfb0(++_0x5ccfac);}(_0xaf73,0x19d));var _0x3af7=function(_0x2dcfb1,_0x451d51){_0x2dcfb1=_0x2dcfb1-0x0;var _0x5c81a9=_0xaf73[_0x2dcfb1];return _0x5c81a9;};'use strict';var Sequelize=require(_0x3af7('0x0'));module[_0x3af7('0x1')]={'penalty':{'type':Sequelize[_0x3af7('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index 941495c..aec6088 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 _0x6268=['../../config/environment','define','UserMailQueue','user_has_mail_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x542fc9,_0x19be0f){var _0x14f212=function(_0x13fa7a){while(--_0x13fa7a){_0x542fc9['push'](_0x542fc9['shift']());}};_0x14f212(++_0x19be0f);}(_0x6268,0x94));var _0x8626=function(_0x3dd238,_0x3f8be8){_0x3dd238=_0x3dd238-0x0;var _0x55e77b=_0x6268[_0x3dd238];return _0x55e77b;};'use strict';var _=require(_0x8626('0x0'));var util=require(_0x8626('0x1'));var logger=require(_0x8626('0x2'))(_0x8626('0x3'));var moment=require('moment');var BPromise=require(_0x8626('0x4'));var rp=require(_0x8626('0x5'));var fs=require('fs');var path=require(_0x8626('0x6'));var rimraf=require(_0x8626('0x7'));var config=require(_0x8626('0x8'));var attributes=require('./userMailQueue.attributes');module['exports']=function(_0x1365b4,_0x1d6ea9){return _0x1365b4[_0x8626('0x9')](_0x8626('0xa'),attributes,{'tableName':_0x8626('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4ed6=['./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','lodash','../../config/logger','moment','path','rimraf','../../config/environment'];(function(_0x1d457e,_0x22f9a9){var _0x332b9d=function(_0x368991){while(--_0x368991){_0x1d457e['push'](_0x1d457e['shift']());}};_0x332b9d(++_0x22f9a9);}(_0x4ed6,0x17b));var _0x64ed=function(_0x137cc5,_0x38a822){_0x137cc5=_0x137cc5-0x0;var _0x5a09ad=_0x4ed6[_0x137cc5];return _0x5a09ad;};'use strict';var _=require(_0x64ed('0x0'));var util=require('util');var logger=require(_0x64ed('0x1'))('api');var moment=require(_0x64ed('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x64ed('0x3'));var rimraf=require(_0x64ed('0x4'));var config=require(_0x64ed('0x5'));var attributes=require(_0x64ed('0x6'));module[_0x64ed('0x7')]=function(_0x5ad97f,_0x594d24){return _0x5ad97f[_0x64ed('0x8')](_0x64ed('0x9'),attributes,{'tableName':_0x64ed('0xa'),'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 a037421..dabd21a 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 _0x008c=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','UserMailQueue,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x008c,0x188));var _0xc008=function(_0x16e6db,_0x2e5a01){_0x16e6db=_0x16e6db-0x0;var _0x5a9151=_0x008c[_0x16e6db];return _0x5a9151;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var moment=require(_0xc008('0x2'));var BPromise=require(_0xc008('0x3'));var rs=require(_0xc008('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc008('0x5'))['db'];var utils=require(_0xc008('0x6'));var logger=require(_0xc008('0x7'))(_0xc008('0x8'));var config=require(_0xc008('0x9'));var jayson=require(_0xc008('0xa'));var client=jayson[_0xc008('0xb')][_0xc008('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x9c8cb2,_0x4af530,_0x428fa9){return new BPromise(function(_0x5aa09b,_0x30be38){return client['request'](_0x9c8cb2,_0x428fa9)['then'](function(_0x27830d){logger[_0xc008('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,'request\x20sent');logger['debug'](_0xc008('0xe'),_0x4af530,_0xc008('0xf'),JSON['stringify'](_0x27830d));if(_0x27830d[_0xc008('0x10')]){if(_0x27830d[_0xc008('0x10')][_0xc008('0x11')]===0x1f4){logger[_0xc008('0x10')](_0xc008('0x12'),_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x30be38(_0x27830d['error']['message']);}logger[_0xc008('0x10')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x5aa09b(_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);}else{logger[_0xc008('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,'request\x20sent');_0x5aa09b(_0x27830d['result'][_0xc008('0x13')]);}})[_0xc008('0x14')](function(_0x3cafe3){logger[_0xc008('0x10')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,_0x3cafe3);_0x30be38(_0x3cafe3);});});} \ No newline at end of file +var _0x00bb=['stringify','error','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','request','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s'];(function(_0x127e78,_0x4d97e8){var _0x36ef7e=function(_0x535130){while(--_0x535130){_0x127e78['push'](_0x127e78['shift']());}};_0x36ef7e(++_0x4d97e8);}(_0x00bb,0x1d8));var _0xb00b=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x00bb[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var moment=require(_0xb00b('0x2'));var BPromise=require('bluebird');var rs=require(_0xb00b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb00b('0x4'))['db'];var utils=require(_0xb00b('0x5'));var logger=require('../../config/logger')(_0xb00b('0x6'));var config=require(_0xb00b('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x36e363,_0xf737d0,_0x41dfc9){return new BPromise(function(_0x37f07d,_0xfa4181){return client[_0xb00b('0x8')](_0x36e363,_0x41dfc9)['then'](function(_0x51d12b){logger[_0xb00b('0x9')](_0xb00b('0xa'),_0xf737d0,_0xb00b('0xb'));logger[_0xb00b('0xc')](_0xb00b('0xd'),_0xf737d0,'request\x20sent',JSON[_0xb00b('0xe')](_0x51d12b));if(_0x51d12b['error']){if(_0x51d12b['error']['code']===0x1f4){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);return _0xfa4181(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}logger['error'](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')]['message']);return _0x37f07d(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}else{logger['info']('UserMailQueue,\x20%s,\x20%s',_0xf737d0,_0xb00b('0xb'));_0x37f07d(_0x51d12b['result']['message']);}})[_0xb00b('0x11')](function(_0x638443){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x638443);_0xfa4181(_0x638443);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index e2c4abb..a289a68 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 _0x2b5c=['exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./userNotification.controller'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0x2b5c,0x1c3));var _0xc2b5=function(_0x2612dd,_0x1b3ed){_0x2612dd=_0x2612dd-0x0;var _0x15af02=_0x2b5c[_0x2612dd];return _0x15af02;};'use strict';var multer=require(_0xc2b5('0x0'));var util=require(_0xc2b5('0x1'));var path=require(_0xc2b5('0x2'));var timeout=require('connect-timeout');var express=require(_0xc2b5('0x3'));var router=express[_0xc2b5('0x4')]();var fs_extra=require(_0xc2b5('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc2b5('0x6'));var config=require(_0xc2b5('0x7'));var controller=require(_0xc2b5('0x8'));router['post']('/',auth['isAuthenticated'](),controller['sendUserNotification']);module[_0xc2b5('0x9')]=router; \ No newline at end of file +var _0x11a2=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','post','sendUserNotification','exports','multer','util','path','connect-timeout','express'];(function(_0x1f1bfd,_0x54afa0){var _0x1c5e3a=function(_0x57da33){while(--_0x57da33){_0x1f1bfd['push'](_0x1f1bfd['shift']());}};_0x1c5e3a(++_0x54afa0);}(_0x11a2,0x67));var _0x211a=function(_0x3c32ae,_0xe3458f){_0x3c32ae=_0x3c32ae-0x0;var _0x16fb7a=_0x11a2[_0x3c32ae];return _0x16fb7a;};'use strict';var multer=require(_0x211a('0x0'));var util=require(_0x211a('0x1'));var path=require(_0x211a('0x2'));var timeout=require(_0x211a('0x3'));var express=require(_0x211a('0x4'));var router=express['Router']();var fs_extra=require(_0x211a('0x5'));var auth=require(_0x211a('0x6'));var interaction=require(_0x211a('0x7'));var config=require(_0x211a('0x8'));var controller=require('./userNotification.controller');router[_0x211a('0x9')]('/',auth['isAuthenticated'](),controller[_0x211a('0xa')]);module[_0x211a('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 77e7b7c..c4e3b23 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 _0x3e03=['STRING','BOOLEAN','exports','TEXT'];(function(_0x22a37a,_0x56c975){var _0x35a731=function(_0x590012){while(--_0x590012){_0x22a37a['push'](_0x22a37a['shift']());}};_0x35a731(++_0x56c975);}(_0x3e03,0x12a));var _0x33e0=function(_0xd09668,_0x1435b2){_0xd09668=_0xd09668-0x0;var _0x68726=_0x3e03[_0xd09668];return _0x68726;};'use strict';var Sequelize=require('sequelize');module[_0x33e0('0x0')]={'body':{'type':Sequelize[_0x33e0('0x1')]},'senderName':{'type':Sequelize[_0x33e0('0x2')]},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize[_0x33e0('0x2')]},'beep':{'type':Sequelize[_0x33e0('0x3')]}}; \ No newline at end of file +var _0x5058=['sequelize','TEXT','STRING','BOOLEAN'];(function(_0x5adc9b,_0x885273){var _0x17b697=function(_0x417304){while(--_0x417304){_0x5adc9b['push'](_0x5adc9b['shift']());}};_0x17b697(++_0x885273);}(_0x5058,0xa8));var _0x8505=function(_0x590851,_0x496bee){_0x590851=_0x590851-0x0;var _0x3b0115=_0x5058[_0x590851];return _0x3b0115;};'use strict';var Sequelize=require(_0x8505('0x0'));module['exports']={'body':{'type':Sequelize[_0x8505('0x1')]},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize[_0x8505('0x2')]},'beep':{'type':Sequelize[_0x8505('0x3')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 3fcf5f7..d7dec25 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 _0xa55e=['openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','user','some','includes','model','toLowerCase','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','then','recipientsId','sequelize','transaction','UserNotification','create','forEach','emit','userNotification:send','catch','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','User','union','ids','queue','replace','Queue','all','getAgents','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','end','error','stack','name','send','sendUserNotification','body','hasOwnProperty','text','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','Invalid\x20\x27recipients\x27\x20object','chatqueue','mailqueue'];(function(_0x540041,_0x388ca0){var _0x5a4898=function(_0x18a165){while(--_0x18a165){_0x540041['push'](_0x540041['shift']());}};_0x5a4898(++_0x388ca0);}(_0xa55e,0x94));var _0xea55=function(_0x44cbde,_0x2bcb1b){_0x44cbde=_0x44cbde-0x0;var _0x27c329=_0xa55e[_0x44cbde];return _0x27c329;};'use strict';var emlformat=require(_0xea55('0x0'));var rimraf=require(_0xea55('0x1'));var zipdir=require(_0xea55('0x2'));var jsonpatch=require(_0xea55('0x3'));var rp=require(_0xea55('0x4'));var moment=require(_0xea55('0x5'));var BPromise=require(_0xea55('0x6'));var Mustache=require(_0xea55('0x7'));var util=require('util');var path=require(_0xea55('0x8'));var sox=require(_0xea55('0x9'));var csv=require(_0xea55('0xa'));var ejs=require(_0xea55('0xb'));var fs=require('fs');var fs_extra=require(_0xea55('0xc'));var _=require(_0xea55('0xd'));var squel=require(_0xea55('0xe'));var crypto=require(_0xea55('0xf'));var jsforce=require(_0xea55('0x10'));var deskjs=require(_0xea55('0x11'));var toCsv=require('to-csv');var querystring=require(_0xea55('0x12'));var Papa=require(_0xea55('0x13'));var Redis=require(_0xea55('0x14'));var authService=require(_0xea55('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0xea55('0x16'));var hardwareService=require(_0xea55('0x17'));var logger=require(_0xea55('0x18'))(_0xea55('0x19'));var utils=require(_0xea55('0x1a'));var config=require(_0xea55('0x1b'));var licenseUtil=require(_0xea55('0x1c'));var db=require(_0xea55('0x1d'))['db'];config['redis']=_[_0xea55('0x1e')](config[_0xea55('0x1f')],{'host':_0xea55('0x20'),'port':0x18eb});var socket=require(_0xea55('0x21'))(new Redis(config[_0xea55('0x1f')]));require('./userNotification.socket')[_0xea55('0x22')](socket);function respondWithStatusCode(_0x472245,_0x2a61ee){_0x2a61ee=_0x2a61ee||0xcc;return function(_0x53cabd){if(_0x53cabd){return _0x472245[_0xea55('0x23')](_0x2a61ee);}return _0x472245[_0xea55('0x24')](_0x2a61ee)['end']();};}function respondWithResult(_0x5992a0,_0x1014da){_0x1014da=_0x1014da||0xc8;return function(_0x44fef2){if(_0x44fef2){return _0x5992a0[_0xea55('0x24')](_0x1014da)[_0xea55('0x25')](_0x44fef2);}};}function respondWithFilteredResult(_0x4145aa,_0x244178){return function(_0x39f351){if(_0x39f351){var _0x7e39dd=typeof _0x244178[_0xea55('0x26')]===_0xea55('0x27')&&typeof _0x244178[_0xea55('0x28')]===_0xea55('0x27');var _0x244209=_0x39f351[_0xea55('0x29')];var _0x3e87cf=_0x7e39dd?0x0:_0x244178[_0xea55('0x26')];var _0x58c16a=_0x7e39dd?_0x39f351['count']:_0x244178['offset']+_0x244178[_0xea55('0x28')];var _0x35d203;if(_0x58c16a>=_0x244209){_0x58c16a=_0x244209;_0x35d203=0xc8;}else{_0x35d203=0xce;}_0x4145aa[_0xea55('0x24')](_0x35d203);return _0x4145aa[_0xea55('0x2a')](_0xea55('0x2b'),_0x3e87cf+'-'+_0x58c16a+'/'+_0x244209)[_0xea55('0x25')](_0x39f351);}return null;};}function patchUpdates(_0x1bbcfd){return function(_0x442d3a){try{jsonpatch['apply'](_0x442d3a,_0x1bbcfd,!![]);}catch(_0x315a93){return BPromise[_0xea55('0x2c')](_0x315a93);}return _0x442d3a[_0xea55('0x2d')]();};}function saveUpdates(_0x1db05d,_0x18d46d){return function(_0x3104af){if(_0x3104af){return _0x3104af[_0xea55('0x2e')](_0x1db05d)['then'](function(_0x44478f){return _0x44478f;});}return null;};}function removeEntity(_0x2350cc,_0x5f1241){return function(_0xc95329){if(_0xc95329){return _0xc95329[_0xea55('0x2f')]()['then'](function(){_0x2350cc[_0xea55('0x24')](0xcc)[_0xea55('0x30')]();});}};}function handleEntityNotFound(_0x3235f3,_0x26d0c4){return function(_0x1b22f0){if(!_0x1b22f0){_0x3235f3[_0xea55('0x23')](0x194);}return _0x1b22f0;};}function handleError(_0x124332,_0x5ce9f5){_0x5ce9f5=_0x5ce9f5||0x1f4;return function(_0x401c63){logger[_0xea55('0x31')](_0x401c63[_0xea55('0x32')]);if(_0x401c63[_0xea55('0x33')]){delete _0x401c63[_0xea55('0x33')];}_0x124332['status'](_0x5ce9f5)[_0xea55('0x34')](_0x401c63);};}exports[_0xea55('0x35')]=function(_0x35723f,_0x42d8b2,_0x3a99e7){if(!_0x35723f[_0xea55('0x36')][_0xea55('0x37')](_0xea55('0x38'))&&!_0x35723f[_0xea55('0x36')][_0xea55('0x37')](_0xea55('0x39'))){throw new db[(_0xea55('0x3a'))][(_0xea55('0x3b'))](_0xea55('0x3c'));}else{if(_0x35723f['body'][_0xea55('0x37')]('TemplateId')&&!_0x35723f[_0xea55('0x36')][_0xea55('0x37')](_0xea55('0x3d'))){throw new db[(_0xea55('0x3a'))]['ValidationError'](_0xea55('0x3e'));}if(!_0x35723f[_0xea55('0x36')][_0xea55('0x37')](_0xea55('0x3f'))){throw new db['Sequelize']['ValidationError'](_0xea55('0x40'));}else{try{var _0x1c4976=JSON['parse'](_0x35723f[_0xea55('0x36')]['recipients']);}catch(_0x42c73a){logger[_0xea55('0x31')](_0x42c73a);throw new db[(_0xea55('0x3a'))][(_0xea55('0x3b'))](_0xea55('0x41'));}var _0x1f5a74=[_0xea55('0x42'),'faxqueue',_0xea55('0x43'),_0xea55('0x44'),_0xea55('0x45'),_0xea55('0x46'),_0xea55('0x47'),_0xea55('0x48'),_0xea55('0x49')];if(_[_0xea55('0x4a')](_0x1c4976,function(_0x404c98){return!_[_0xea55('0x4b')](_0x1f5a74,_0x404c98[_0xea55('0x4c')][_0xea55('0x4d')]());})){throw new db[(_0xea55('0x3a'))]['ValidationError']('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x3fab6e={};_0x3fab6e['senderName']=_0x35723f[_0xea55('0x36')][_0xea55('0x37')](_0xea55('0x4e'))?_0x35723f['body']['senderName']:_0x35723f[_0xea55('0x49')][_0xea55('0x4f')];_0x3fab6e[_0xea55('0x50')]=_[_0xea55('0x51')](_0x35723f[_0xea55('0x36')][_0xea55('0x50')])?null:_0x35723f[_0xea55('0x36')][_0xea55('0x50')];_0x3fab6e[_0xea55('0x52')]=_0x35723f[_0xea55('0x36')][_0xea55('0x52')]||![];_0x3fab6e[_0xea55('0x53')]=_0x35723f[_0xea55('0x49')]['id'];return getContent(_0x35723f[_0xea55('0x36')])['then'](function(_0x1e3438){_0x3fab6e[_0xea55('0x36')]=_0x1e3438;return getRecipients(_0x1c4976);})[_0xea55('0x54')](function(_0x1e210c){_0x3fab6e[_0xea55('0x55')]=_['sortBy'](_0x1e210c)['join'](',');return db[_0xea55('0x56')][_0xea55('0x57')](function(_0x4a7ee1){return db[_0xea55('0x58')][_0xea55('0x59')](_0x3fab6e,{'raw':!![],'transaction':_0x4a7ee1})[_0xea55('0x54')](function(_0x316436){var _0x2a1811={'sender':_0x3fab6e[_0xea55('0x4e')],'description':_0x3fab6e[_0xea55('0x50')],'content':_0x3fab6e[_0xea55('0x36')],'beep':_0x3fab6e[_0xea55('0x52')]};_0x1e210c[_0xea55('0x5a')](function(_0xb0236e){_0x2a1811['recipient']=_0xb0236e;socket[_0xea55('0x5b')](_0xea55('0x5c'),_0x2a1811);});return _0x316436;});});})[_0xea55('0x54')](respondWithResult(_0x42d8b2,0xc9))[_0xea55('0x5d')](handleError(_0x42d8b2,null));};function getContent(_0x487d7c){return new BPromise(function(_0x2ebe01,_0x5ae8c9){if(_0x487d7c[_0xea55('0x38')]){_0x2ebe01(_0x487d7c['text']);return;}return db['Template'][_0xea55('0x5e')]({'attributes':[_0xea55('0x5f')],'where':{'id':_0x487d7c[_0xea55('0x39')]},'raw':!![]})[_0xea55('0x54')](function(_0x1e09e6){if(!_0x1e09e6)throw new db[(_0xea55('0x3a'))][(_0xea55('0x3b'))](_0xea55('0x60'));var _0x3403ce=Mustache[_0xea55('0x61')](_0x1e09e6['html'],_0x487d7c[_0xea55('0x3d')]);_0x2ebe01(_0x3403ce);})[_0xea55('0x5d')](function(_0x1829fb){_0x5ae8c9(_0x1829fb);});});}function getRecipients(_0xf24a36){return new BPromise(function(_0x12d20d,_0x31ea43){var _0x2ba99b=[];var _0x5aac35=[];_0xf24a36[_0xea55('0x5a')](function(_0x300f16){var _0x4c4395=_[_0xea55('0x62')](_0x300f16[_0xea55('0x4c')][_0xea55('0x4d')]());if(_0x4c4395===_0xea55('0x63')){_0x2ba99b=_[_0xea55('0x64')](_0x2ba99b,_0x300f16[_0xea55('0x65')]);}else{if(_[_0xea55('0x4b')](_0x4c4395,_0xea55('0x66')))_0x4c4395=_0x4c4395[_0xea55('0x67')](_0xea55('0x66'),_0xea55('0x68'));_0x300f16[_0xea55('0x65')][_0xea55('0x5a')](function(_0x51467c){_0x5aac35['push'](getAgents(_0x4c4395,_0x51467c));});}});return BPromise[_0xea55('0x69')](_0x5aac35)['then'](function(_0x19a39b){_0x2ba99b=_['union'](_0x2ba99b,_['flatten'](_0x19a39b));_0x12d20d(_0x2ba99b);})[_0xea55('0x5d')](function(_0x1be653){_0x31ea43(_0x1be653);});});}function getAgents(_0x38714f,_0x4e213b){return new BPromise(function(_0x2640f6,_0x203ceb){return db[_0x38714f][_0xea55('0x5e')]({'where':{'id':_0x4e213b}})[_0xea55('0x54')](function(_0x469af0){return _0x469af0[_0xea55('0x6a')]({'attributes':['id'],'raw':!![]})[_0xea55('0x54')](function(_0x5bc854){var _0x49a85e=_[_0xea55('0x6b')](_0x5bc854,'id');_0x2640f6(_0x49a85e);});})[_0xea55('0x5d')](function(_0x5078f0){_0x203ceb(_0x5078f0);});});} \ No newline at end of file +var _0xa8c5=['body','hasOwnProperty','text','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','chatqueue','faxqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','user','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','beep','SenderId','sortBy','join','sequelize','UserNotification','create','forEach','recipient','catch','Template','findOne','Invalid\x20\x27TemplateId\x27\x20parameter','render','html','startCase','union','replace','queue','Queue','ids','push','all','getAgents','map','eml-format','rimraf','fast-json-patch','moment','bluebird','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','sendStatus','stack','name','send','sendUserNotification'];(function(_0x27a0cc,_0x58979b){var _0x491de6=function(_0x312ae2){while(--_0x312ae2){_0x27a0cc['push'](_0x27a0cc['shift']());}};_0x491de6(++_0x58979b);}(_0xa8c5,0x160));var _0x5a8c=function(_0x4f02ac,_0x5b385e){_0x4f02ac=_0x4f02ac-0x0;var _0x463598=_0xa8c5[_0x4f02ac];return _0x463598;};'use strict';var emlformat=require(_0x5a8c('0x0'));var rimraf=require(_0x5a8c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5a8c('0x2'));var rp=require('request-promise');var moment=require(_0x5a8c('0x3'));var BPromise=require(_0x5a8c('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5a8c('0x5'));var sox=require('sox');var csv=require(_0x5a8c('0x6'));var ejs=require(_0x5a8c('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5a8c('0x8'));var squel=require(_0x5a8c('0x9'));var crypto=require(_0x5a8c('0xa'));var jsforce=require(_0x5a8c('0xb'));var deskjs=require(_0x5a8c('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5a8c('0xd'));var Papa=require(_0x5a8c('0xe'));var Redis=require(_0x5a8c('0xf'));var authService=require(_0x5a8c('0x10'));var qs=require(_0x5a8c('0x11'));var as=require(_0x5a8c('0x12'));var hardwareService=require(_0x5a8c('0x13'));var logger=require('../../config/logger')(_0x5a8c('0x14'));var utils=require('../../config/utils');var config=require(_0x5a8c('0x15'));var licenseUtil=require(_0x5a8c('0x16'));var db=require(_0x5a8c('0x17'))['db'];config[_0x5a8c('0x18')]=_[_0x5a8c('0x19')](config[_0x5a8c('0x18')],{'host':_0x5a8c('0x1a'),'port':0x18eb});var socket=require(_0x5a8c('0x1b'))(new Redis(config[_0x5a8c('0x18')]));require(_0x5a8c('0x1c'))[_0x5a8c('0x1d')](socket);function respondWithStatusCode(_0x42cba8,_0x5a984f){_0x5a984f=_0x5a984f||0xcc;return function(_0x5b728d){if(_0x5b728d){return _0x42cba8['sendStatus'](_0x5a984f);}return _0x42cba8[_0x5a8c('0x1e')](_0x5a984f)[_0x5a8c('0x1f')]();};}function respondWithResult(_0x4209ae,_0x537d6c){_0x537d6c=_0x537d6c||0xc8;return function(_0x2605ca){if(_0x2605ca){return _0x4209ae[_0x5a8c('0x1e')](_0x537d6c)[_0x5a8c('0x20')](_0x2605ca);}};}function respondWithFilteredResult(_0x2f87d1,_0x42a41d){return function(_0x4a0fdf){if(_0x4a0fdf){var _0x32bcc3=typeof _0x42a41d[_0x5a8c('0x21')]==='undefined'&&typeof _0x42a41d[_0x5a8c('0x22')]===_0x5a8c('0x23');var _0x38fda8=_0x4a0fdf[_0x5a8c('0x24')];var _0x10ff26=_0x32bcc3?0x0:_0x42a41d[_0x5a8c('0x21')];var _0xef722f=_0x32bcc3?_0x4a0fdf[_0x5a8c('0x24')]:_0x42a41d['offset']+_0x42a41d[_0x5a8c('0x22')];var _0x2d62b7;if(_0xef722f>=_0x38fda8){_0xef722f=_0x38fda8;_0x2d62b7=0xc8;}else{_0x2d62b7=0xce;}_0x2f87d1[_0x5a8c('0x1e')](_0x2d62b7);return _0x2f87d1[_0x5a8c('0x25')](_0x5a8c('0x26'),_0x10ff26+'-'+_0xef722f+'/'+_0x38fda8)[_0x5a8c('0x20')](_0x4a0fdf);}return null;};}function patchUpdates(_0x122fe5){return function(_0x5a1620){try{jsonpatch[_0x5a8c('0x27')](_0x5a1620,_0x122fe5,!![]);}catch(_0x251b11){return BPromise['reject'](_0x251b11);}return _0x5a1620[_0x5a8c('0x28')]();};}function saveUpdates(_0x759585,_0x1143de){return function(_0x36fe57){if(_0x36fe57){return _0x36fe57[_0x5a8c('0x29')](_0x759585)[_0x5a8c('0x2a')](function(_0x18bf05){return _0x18bf05;});}return null;};}function removeEntity(_0x5570a6,_0x51c1cc){return function(_0x218437){if(_0x218437){return _0x218437['destroy']()[_0x5a8c('0x2a')](function(){_0x5570a6[_0x5a8c('0x1e')](0xcc)[_0x5a8c('0x1f')]();});}};}function handleEntityNotFound(_0x3c7052,_0x52f1bb){return function(_0xbe2e71){if(!_0xbe2e71){_0x3c7052[_0x5a8c('0x2b')](0x194);}return _0xbe2e71;};}function handleError(_0x2cd1e4,_0x3b0684){_0x3b0684=_0x3b0684||0x1f4;return function(_0x5c4b0d){logger['error'](_0x5c4b0d[_0x5a8c('0x2c')]);if(_0x5c4b0d[_0x5a8c('0x2d')]){delete _0x5c4b0d[_0x5a8c('0x2d')];}_0x2cd1e4[_0x5a8c('0x1e')](_0x3b0684)[_0x5a8c('0x2e')](_0x5c4b0d);};}exports[_0x5a8c('0x2f')]=function(_0x1cf736,_0x393005,_0x3674e8){if(!_0x1cf736[_0x5a8c('0x30')][_0x5a8c('0x31')](_0x5a8c('0x32'))&&!_0x1cf736[_0x5a8c('0x30')][_0x5a8c('0x31')](_0x5a8c('0x33'))){throw new db[(_0x5a8c('0x34'))][(_0x5a8c('0x35'))](_0x5a8c('0x36'));}else{if(_0x1cf736[_0x5a8c('0x30')]['hasOwnProperty'](_0x5a8c('0x33'))&&!_0x1cf736['body'][_0x5a8c('0x31')]('view')){throw new db[(_0x5a8c('0x34'))][(_0x5a8c('0x35'))](_0x5a8c('0x37'));}if(!_0x1cf736[_0x5a8c('0x30')][_0x5a8c('0x31')](_0x5a8c('0x38'))){throw new db[(_0x5a8c('0x34'))][(_0x5a8c('0x35'))](_0x5a8c('0x39'));}else{try{var _0x426075=JSON[_0x5a8c('0x3a')](_0x1cf736[_0x5a8c('0x30')][_0x5a8c('0x38')]);}catch(_0x3b5129){logger['error'](_0x3b5129);throw new db[(_0x5a8c('0x34'))][(_0x5a8c('0x35'))]('Invalid\x20\x27recipients\x27\x20object');}var _0xc0bb41=[_0x5a8c('0x3b'),_0x5a8c('0x3c'),'mailqueue',_0x5a8c('0x3d'),_0x5a8c('0x3e'),_0x5a8c('0x3f'),_0x5a8c('0x40'),_0x5a8c('0x41'),_0x5a8c('0x42')];if(_[_0x5a8c('0x43')](_0x426075,function(_0x2f5daf){return!_[_0x5a8c('0x44')](_0xc0bb41,_0x2f5daf[_0x5a8c('0x45')][_0x5a8c('0x46')]());})){throw new db[(_0x5a8c('0x34'))][(_0x5a8c('0x35'))](_0x5a8c('0x47'));}}}var _0x4b86d8={};_0x4b86d8[_0x5a8c('0x48')]=_0x1cf736['body']['hasOwnProperty']('senderName')?_0x1cf736[_0x5a8c('0x30')][_0x5a8c('0x48')]:_0x1cf736['user'][_0x5a8c('0x49')];_0x4b86d8[_0x5a8c('0x4a')]=_['isEmpty'](_0x1cf736['body'][_0x5a8c('0x4a')])?null:_0x1cf736[_0x5a8c('0x30')][_0x5a8c('0x4a')];_0x4b86d8['beep']=_0x1cf736['body'][_0x5a8c('0x4b')]||![];_0x4b86d8[_0x5a8c('0x4c')]=_0x1cf736[_0x5a8c('0x42')]['id'];return getContent(_0x1cf736[_0x5a8c('0x30')])['then'](function(_0x234f74){_0x4b86d8[_0x5a8c('0x30')]=_0x234f74;return getRecipients(_0x426075);})[_0x5a8c('0x2a')](function(_0x336283){_0x4b86d8['recipientsId']=_[_0x5a8c('0x4d')](_0x336283)[_0x5a8c('0x4e')](',');return db[_0x5a8c('0x4f')]['transaction'](function(_0x5c716f){return db[_0x5a8c('0x50')][_0x5a8c('0x51')](_0x4b86d8,{'raw':!![],'transaction':_0x5c716f})['then'](function(_0x38a0be){var _0x2ab9a0={'sender':_0x4b86d8[_0x5a8c('0x48')],'description':_0x4b86d8[_0x5a8c('0x4a')],'content':_0x4b86d8[_0x5a8c('0x30')],'beep':_0x4b86d8[_0x5a8c('0x4b')]};_0x336283[_0x5a8c('0x52')](function(_0x6f708){_0x2ab9a0[_0x5a8c('0x53')]=_0x6f708;socket['emit']('userNotification:send',_0x2ab9a0);});return _0x38a0be;});});})[_0x5a8c('0x2a')](respondWithResult(_0x393005,0xc9))[_0x5a8c('0x54')](handleError(_0x393005,null));};function getContent(_0x120aae){return new BPromise(function(_0x417b67,_0x5d3f17){if(_0x120aae[_0x5a8c('0x32')]){_0x417b67(_0x120aae[_0x5a8c('0x32')]);return;}return db[_0x5a8c('0x55')][_0x5a8c('0x56')]({'attributes':['html'],'where':{'id':_0x120aae[_0x5a8c('0x33')]},'raw':!![]})[_0x5a8c('0x2a')](function(_0x4d10ae){if(!_0x4d10ae)throw new db[(_0x5a8c('0x34'))]['ValidationError'](_0x5a8c('0x57'));var _0x4e0541=Mustache[_0x5a8c('0x58')](_0x4d10ae[_0x5a8c('0x59')],_0x120aae['view']);_0x417b67(_0x4e0541);})['catch'](function(_0x26dc2a){_0x5d3f17(_0x26dc2a);});});}function getRecipients(_0x966e91){return new BPromise(function(_0x3e4203,_0x170a13){var _0x30de51=[];var _0x56bf98=[];_0x966e91[_0x5a8c('0x52')](function(_0x1b4286){var _0x4fd6af=_[_0x5a8c('0x5a')](_0x1b4286[_0x5a8c('0x45')][_0x5a8c('0x46')]());if(_0x4fd6af==='User'){_0x30de51=_[_0x5a8c('0x5b')](_0x30de51,_0x1b4286['ids']);}else{if(_[_0x5a8c('0x44')](_0x4fd6af,'queue'))_0x4fd6af=_0x4fd6af[_0x5a8c('0x5c')](_0x5a8c('0x5d'),_0x5a8c('0x5e'));_0x1b4286[_0x5a8c('0x5f')]['forEach'](function(_0x1f737d){_0x56bf98[_0x5a8c('0x60')](getAgents(_0x4fd6af,_0x1f737d));});}});return BPromise[_0x5a8c('0x61')](_0x56bf98)[_0x5a8c('0x2a')](function(_0x5ce27b){_0x30de51=_[_0x5a8c('0x5b')](_0x30de51,_['flatten'](_0x5ce27b));_0x3e4203(_0x30de51);})[_0x5a8c('0x54')](function(_0x308dd2){_0x170a13(_0x308dd2);});});}function getAgents(_0x314c45,_0x31983b){return new BPromise(function(_0x3d564a,_0xc8bde9){return db[_0x314c45][_0x5a8c('0x56')]({'where':{'id':_0x31983b}})[_0x5a8c('0x2a')](function(_0x36741a){return _0x36741a[_0x5a8c('0x62')]({'attributes':['id'],'raw':!![]})[_0x5a8c('0x2a')](function(_0x2c68c8){var _0x58a084=_[_0x5a8c('0x63')](_0x2c68c8,'id');_0x3d564a(_0x58a084);});})['catch'](function(_0xacfd2f){_0xc8bde9(_0xacfd2f);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 8e49942..e6cde18 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 _0xc280=['../../mysqldb','UserNotification','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x499b6e,_0x503e38){var _0x3f35f1=function(_0x38ec5a){while(--_0x38ec5a){_0x499b6e['push'](_0x499b6e['shift']());}};_0x3f35f1(++_0x503e38);}(_0xc280,0xdb));var _0x0c28=function(_0x430c88,_0x586985){_0x430c88=_0x430c88-0x0;var _0x1a8724=_0xc280[_0x430c88];return _0x1a8724;};'use strict';var EventEmitter=require(_0x0c28('0x0'));var UserNotification=require(_0x0c28('0x1'))['db'][_0x0c28('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x0c28('0x3')](0x0);var events={'afterCreate':_0x0c28('0x4'),'afterUpdate':_0x0c28('0x5'),'afterDestroy':_0x0c28('0x6')};function emitEvent(_0x1e0320){return function(_0x509db3,_0x24afab,_0x105386){UserNotificationEvents[_0x0c28('0x7')](_0x1e0320+':'+_0x509db3['id'],_0x509db3);UserNotificationEvents[_0x0c28('0x7')](_0x1e0320,_0x509db3);_0x105386(null);};}for(var e in events){if(events[_0x0c28('0x8')](e)){var event=events[e];UserNotification[_0x0c28('0x9')](e,emitEvent(event));}}module[_0x0c28('0xa')]=UserNotificationEvents; \ No newline at end of file +var _0x0908=['../../mysqldb','UserNotification','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x371a63,_0x5b88bf){var _0x3b1490=function(_0x1a6618){while(--_0x1a6618){_0x371a63['push'](_0x371a63['shift']());}};_0x3b1490(++_0x5b88bf);}(_0x0908,0x135));var _0x8090=function(_0x13bb19,_0x14b00e){_0x13bb19=_0x13bb19-0x0;var _0x5c3024=_0x0908[_0x13bb19];return _0x5c3024;};'use strict';var EventEmitter=require(_0x8090('0x0'));var UserNotification=require(_0x8090('0x1'))['db'][_0x8090('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x8090('0x3')](0x0);var events={'afterCreate':_0x8090('0x4'),'afterUpdate':_0x8090('0x5'),'afterDestroy':'remove'};function emitEvent(_0x51d633){return function(_0x118312,_0x39cf32,_0x3abb30){UserNotificationEvents[_0x8090('0x6')](_0x51d633+':'+_0x118312['id'],_0x118312);UserNotificationEvents[_0x8090('0x6')](_0x51d633,_0x118312);_0x3abb30(null);};}for(var e in events){if(events[_0x8090('0x7')](e)){var event=events[e];UserNotification[_0x8090('0x8')](e,emitEvent(event));}}module[_0x8090('0x9')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 5b9aab6..04f5add 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 _0x791e=['exports','userNotifications','utf8mb4','util','api','moment','bluebird','path','rimraf','../../config/environment','./userNotification.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x791e,0x1d1));var _0xe791=function(_0x3540f8,_0x2a9c23){_0x3540f8=_0x3540f8-0x0;var _0x79166a=_0x791e[_0x3540f8];return _0x79166a;};'use strict';var _=require('lodash');var util=require(_0xe791('0x0'));var logger=require('../../config/logger')(_0xe791('0x1'));var moment=require(_0xe791('0x2'));var BPromise=require(_0xe791('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe791('0x4'));var rimraf=require(_0xe791('0x5'));var config=require(_0xe791('0x6'));var attributes=require(_0xe791('0x7'));module[_0xe791('0x8')]=function(_0x19bde9,_0x4227b1){return _0x19bde9['define']('UserNotification',attributes,{'tableName':_0xe791('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe791('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x8a75=['exports','define','UserNotification','userNotifications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userNotification.attributes'];(function(_0x4a1c01,_0x1b7c73){var _0x367d8c=function(_0x5f1167){while(--_0x5f1167){_0x4a1c01['push'](_0x4a1c01['shift']());}};_0x367d8c(++_0x1b7c73);}(_0x8a75,0x175));var _0x58a7=function(_0x45588f,_0x2e098a){_0x45588f=_0x45588f-0x0;var _0x550641=_0x8a75[_0x45588f];return _0x550641;};'use strict';var _=require(_0x58a7('0x0'));var util=require(_0x58a7('0x1'));var logger=require(_0x58a7('0x2'))(_0x58a7('0x3'));var moment=require(_0x58a7('0x4'));var BPromise=require(_0x58a7('0x5'));var rp=require(_0x58a7('0x6'));var fs=require('fs');var path=require(_0x58a7('0x7'));var rimraf=require(_0x58a7('0x8'));var config=require(_0x58a7('0x9'));var attributes=require(_0x58a7('0xa'));module[_0x58a7('0xb')]=function(_0x23e20e,_0x465beb){return _0x23e20e[_0x58a7('0xc')](_0x58a7('0xd'),attributes,{'tableName':_0x58a7('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x58a7('0xf')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 7d1a5db..741f7c6 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 _0x8e38=['moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','./userNotification.socket','register','info','UserNotification,\x20%s,\x20%s','UserNotification,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','util'];(function(_0x1f4375,_0x3a895a){var _0xaca331=function(_0x8fff6e){while(--_0x8fff6e){_0x1f4375['push'](_0x1f4375['shift']());}};_0xaca331(++_0x3a895a);}(_0x8e38,0x76));var _0x88e3=function(_0x4ac42b,_0x228b9a){_0x4ac42b=_0x4ac42b-0x0;var _0x284aa5=_0x8e38[_0x4ac42b];return _0x284aa5;};'use strict';var _=require(_0x88e3('0x0'));var util=require(_0x88e3('0x1'));var moment=require(_0x88e3('0x2'));var BPromise=require('bluebird');var rs=require(_0x88e3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x88e3('0x4'))['db'];var utils=require(_0x88e3('0x5'));var logger=require(_0x88e3('0x6'))(_0x88e3('0x7'));var config=require('../../config/environment');var jayson=require(_0x88e3('0x8'));var client=jayson[_0x88e3('0x9')][_0x88e3('0xa')]({'port':0x232a});config[_0x88e3('0xb')]=_[_0x88e3('0xc')](config[_0x88e3('0xb')],{'host':_0x88e3('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x88e3('0xb')]));require(_0x88e3('0xe'))[_0x88e3('0xf')](socket);function respondWithRpcPromise(_0x188aff,_0x55da9c,_0xdb3e9e){return new BPromise(function(_0x4de7c3,_0x47723a){return client['request'](_0x188aff,_0xdb3e9e)['then'](function(_0x303385){logger[_0x88e3('0x10')](_0x88e3('0x11'),_0x55da9c,'request\x20sent');logger['debug'](_0x88e3('0x12'),_0x55da9c,_0x88e3('0x13'),JSON[_0x88e3('0x14')](_0x303385));if(_0x303385['error']){if(_0x303385['error']['code']===0x1f4){logger[_0x88e3('0x15')](_0x88e3('0x11'),_0x55da9c,_0x303385['error'][_0x88e3('0x16')]);return _0x47723a(_0x303385[_0x88e3('0x15')]['message']);}logger[_0x88e3('0x15')](_0x88e3('0x11'),_0x55da9c,_0x303385[_0x88e3('0x15')][_0x88e3('0x16')]);return _0x4de7c3(_0x303385[_0x88e3('0x15')]['message']);}else{logger['info'](_0x88e3('0x11'),_0x55da9c,_0x88e3('0x13'));_0x4de7c3(_0x303385['result'][_0x88e3('0x16')]);}})[_0x88e3('0x17')](function(_0x427a06){logger['error']('UserNotification,\x20%s,\x20%s',_0x55da9c,_0x427a06);_0x47723a(_0x427a06);});});} \ No newline at end of file +var _0xe28c=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','request','then','info','request\x20sent','UserNotification,\x20%s,\x20%s,\x20%s','error','code','message','UserNotification,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird'];(function(_0x70d6e5,_0x273802){var _0x5dbb1f=function(_0x2e0e35){while(--_0x2e0e35){_0x70d6e5['push'](_0x70d6e5['shift']());}};_0x5dbb1f(++_0x273802);}(_0xe28c,0xdc));var _0xce28=function(_0x218fdc,_0x3b552b){_0x218fdc=_0x218fdc-0x0;var _0x54f74e=_0xe28c[_0x218fdc];return _0x54f74e;};'use strict';var _=require(_0xce28('0x0'));var util=require(_0xce28('0x1'));var moment=require(_0xce28('0x2'));var BPromise=require(_0xce28('0x3'));var rs=require(_0xce28('0x4'));var fs=require('fs');var Redis=require(_0xce28('0x5'));var db=require(_0xce28('0x6'))['db'];var utils=require(_0xce28('0x7'));var logger=require(_0xce28('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xce28('0x9'));var client=jayson['client'][_0xce28('0xa')]({'port':0x232a});config[_0xce28('0xb')]=_[_0xce28('0xc')](config[_0xce28('0xb')],{'host':_0xce28('0xd'),'port':0x18eb});var socket=require(_0xce28('0xe'))(new Redis(config[_0xce28('0xb')]));require(_0xce28('0xf'))[_0xce28('0x10')](socket);function respondWithRpcPromise(_0xa37e8,_0x4f873d,_0x197c1e){return new BPromise(function(_0x40c3c1,_0x5a7ff4){return client[_0xce28('0x11')](_0xa37e8,_0x197c1e)[_0xce28('0x12')](function(_0x4d7256){logger[_0xce28('0x13')]('UserNotification,\x20%s,\x20%s',_0x4f873d,_0xce28('0x14'));logger['debug'](_0xce28('0x15'),_0x4f873d,'request\x20sent',JSON['stringify'](_0x4d7256));if(_0x4d7256[_0xce28('0x16')]){if(_0x4d7256[_0xce28('0x16')][_0xce28('0x17')]===0x1f4){logger[_0xce28('0x16')]('UserNotification,\x20%s,\x20%s',_0x4f873d,_0x4d7256[_0xce28('0x16')][_0xce28('0x18')]);return _0x5a7ff4(_0x4d7256[_0xce28('0x16')][_0xce28('0x18')]);}logger[_0xce28('0x16')]('UserNotification,\x20%s,\x20%s',_0x4f873d,_0x4d7256[_0xce28('0x16')]['message']);return _0x40c3c1(_0x4d7256[_0xce28('0x16')][_0xce28('0x18')]);}else{logger[_0xce28('0x13')](_0xce28('0x19'),_0x4f873d,_0xce28('0x14'));_0x40c3c1(_0x4d7256[_0xce28('0x1a')][_0xce28('0x18')]);}})[_0xce28('0x1b')](function(_0x3a2ec0){logger[_0xce28('0x16')]('UserNotification,\x20%s,\x20%s',_0x4f873d,_0x3a2ec0);_0x5a7ff4(_0x3a2ec0);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 8853696..99b89ef 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 _0xbc6f=['length','userNotification:','./userNotification.events','save','update','emit','removeListener'];(function(_0x3bf04a,_0x56ed90){var _0x241e4b=function(_0x105e52){while(--_0x105e52){_0x3bf04a['push'](_0x3bf04a['shift']());}};_0x241e4b(++_0x56ed90);}(_0xbc6f,0xdb));var _0xfbc6=function(_0x2ac2de,_0x109a1e){_0x2ac2de=_0x2ac2de-0x0;var _0xf453a1=_0xbc6f[_0x2ac2de];return _0xf453a1;};'use strict';var UserNotificationEvents=require(_0xfbc6('0x0'));var events=[_0xfbc6('0x1'),'remove',_0xfbc6('0x2')];function createListener(_0x32173b,_0x324385){return function(_0x59bc61){_0x324385[_0xfbc6('0x3')](_0x32173b,_0x59bc61);};}function removeListener(_0x25eca3,_0x354fc9){return function(){UserNotificationEvents[_0xfbc6('0x4')](_0x25eca3,_0x354fc9);};}exports['register']=function(_0x2b1cd0){for(var _0x13d224=0x0,_0x156f30=events[_0xfbc6('0x5')];_0x13d224<_0x156f30;_0x13d224++){var _0x45926d=events[_0x13d224];var _0x88131e=createListener(_0xfbc6('0x6')+_0x45926d,_0x2b1cd0);UserNotificationEvents['on'](_0x45926d,_0x88131e);}}; \ No newline at end of file +var _0x8621=['save','remove','update','emit','register','length','userNotification:','./userNotification.events'];(function(_0x5c1409,_0x4ccf5f){var _0x365b46=function(_0x325850){while(--_0x325850){_0x5c1409['push'](_0x5c1409['shift']());}};_0x365b46(++_0x4ccf5f);}(_0x8621,0x67));var _0x1862=function(_0x131146,_0x59df09){_0x131146=_0x131146-0x0;var _0x384b4e=_0x8621[_0x131146];return _0x384b4e;};'use strict';var UserNotificationEvents=require(_0x1862('0x0'));var events=[_0x1862('0x1'),_0x1862('0x2'),_0x1862('0x3')];function createListener(_0x5077b8,_0xb24766){return function(_0x3e3e37){_0xb24766[_0x1862('0x4')](_0x5077b8,_0x3e3e37);};}function removeListener(_0x1cb058,_0x57b021){return function(){UserNotificationEvents['removeListener'](_0x1cb058,_0x57b021);};}exports[_0x1862('0x5')]=function(_0x3338e5){for(var _0xbaaa27=0x0,_0x2ac3a1=events[_0x1862('0x6')];_0xbaaa27<_0x2ac3a1;_0xbaaa27++){var _0x15d9b2=events[_0xbaaa27];var _0x205691=createListener(_0x1862('0x7')+_0x15d9b2,_0x3338e5);UserNotificationEvents['on'](_0x15d9b2,_0x205691);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index a914f50..f230a21 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x28bc83,_0xf9c54e){var _0x5af40f=function(_0x45a17c){while(--_0x45a17c){_0x28bc83['push'](_0x28bc83['shift']());}};_0x5af40f(++_0xf9c54e);}(_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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x4f7b0f,_0x244c69){var _0x3f4b0b=function(_0x5bb915){while(--_0x5bb915){_0x4f7b0f['push'](_0x4f7b0f['shift']());}};_0x3f4b0b(++_0x244c69);}(_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 02dfd8c..43d04be 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 _0x7c92=['exports','INTEGER'];(function(_0x3e95bc,_0x275ae3){var _0x46727d=function(_0x1c1e49){while(--_0x1c1e49){_0x3e95bc['push'](_0x3e95bc['shift']());}};_0x46727d(++_0x275ae3);}(_0x7c92,0x110));var _0x27c9=function(_0x4b0bad,_0x38ad61){_0x4b0bad=_0x4b0bad-0x0;var _0x15ed0d=_0x7c92[_0x4b0bad];return _0x15ed0d;};'use strict';var Sequelize=require('sequelize');module[_0x27c9('0x0')]={'penalty':{'type':Sequelize[_0x27c9('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa027=['INTEGER','sequelize'];(function(_0x419f68,_0x59fbed){var _0x3cd361=function(_0x403abd){while(--_0x403abd){_0x419f68['push'](_0x419f68['shift']());}};_0x3cd361(++_0x59fbed);}(_0xa027,0x1dd));var _0x7a02=function(_0x3218fc,_0x49bfd9){_0x3218fc=_0x3218fc-0x0;var _0x5543ca=_0xa027[_0x3218fc];return _0x5543ca;};'use strict';var Sequelize=require(_0x7a02('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x7a02('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index a27226f..5172bd5 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 _0xd24f=['lodash','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues'];(function(_0x5dc831,_0x1eea09){var _0x4cbdcf=function(_0x59135a){while(--_0x59135a){_0x5dc831['push'](_0x5dc831['shift']());}};_0x4cbdcf(++_0x1eea09);}(_0xd24f,0xe4));var _0xfd24=function(_0x2af353,_0x418430){_0x2af353=_0x2af353-0x0;var _0x3f3f4e=_0xd24f[_0x2af353];return _0x3f3f4e;};'use strict';var _=require(_0xfd24('0x0'));var util=require('util');var logger=require(_0xfd24('0x1'))('api');var moment=require('moment');var BPromise=require(_0xfd24('0x2'));var rp=require(_0xfd24('0x3'));var fs=require('fs');var path=require(_0xfd24('0x4'));var rimraf=require(_0xfd24('0x5'));var config=require(_0xfd24('0x6'));var attributes=require(_0xfd24('0x7'));module[_0xfd24('0x8')]=function(_0x53b17a,_0x1b445b){return _0x53b17a[_0xfd24('0x9')](_0xfd24('0xa'),attributes,{'tableName':_0xfd24('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd0b1=['bluebird','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','define','UserOpenchannelQueue','lodash','moment'];(function(_0x462042,_0x524279){var _0x585608=function(_0x3811df){while(--_0x3811df){_0x462042['push'](_0x462042['shift']());}};_0x585608(++_0x524279);}(_0xd0b1,0x1b6));var _0x1d0b=function(_0x20ac15,_0x48a061){_0x20ac15=_0x20ac15-0x0;var _0xb1389a=_0xd0b1[_0x20ac15];return _0xb1389a;};'use strict';var _=require(_0x1d0b('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x1d0b('0x1'));var BPromise=require(_0x1d0b('0x2'));var rp=require(_0x1d0b('0x3'));var fs=require('fs');var path=require(_0x1d0b('0x4'));var rimraf=require(_0x1d0b('0x5'));var config=require(_0x1d0b('0x6'));var attributes=require(_0x1d0b('0x7'));module['exports']=function(_0x277e8c,_0x2e46b7){return _0x277e8c[_0x1d0b('0x8')](_0x1d0b('0x9'),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 18241c9..c8787f5 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 _0x2832=['jayson/promise','client','request','then','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','../../config/environment'];(function(_0xdbd4f7,_0x4e3bdd){var _0x5c3f9d=function(_0xa7a35a){while(--_0xa7a35a){_0xdbd4f7['push'](_0xdbd4f7['shift']());}};_0x5c3f9d(++_0x4e3bdd);}(_0x2832,0x11f));var _0x2283=function(_0x50d278,_0x5336fe){_0x50d278=_0x50d278-0x0;var _0x4a128a=_0x2832[_0x50d278];return _0x4a128a;};'use strict';var _=require(_0x2283('0x0'));var util=require(_0x2283('0x1'));var moment=require(_0x2283('0x2'));var BPromise=require(_0x2283('0x3'));var rs=require(_0x2283('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2283('0x5'))('rpc');var config=require(_0x2283('0x6'));var jayson=require(_0x2283('0x7'));var client=jayson[_0x2283('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f0eb8,_0x4e624c,_0x5df1af){return new BPromise(function(_0x146e5c,_0x4b2d1f){return client[_0x2283('0x9')](_0x1f0eb8,_0x5df1af)[_0x2283('0xa')](function(_0x1776a8){logger['info'](_0x2283('0xb'),_0x4e624c,_0x2283('0xc'));logger[_0x2283('0xd')](_0x2283('0xe'),_0x4e624c,_0x2283('0xc'),JSON[_0x2283('0xf')](_0x1776a8));if(_0x1776a8[_0x2283('0x10')]){if(_0x1776a8[_0x2283('0x10')][_0x2283('0x11')]===0x1f4){logger[_0x2283('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x4e624c,_0x1776a8[_0x2283('0x10')][_0x2283('0x12')]);return _0x4b2d1f(_0x1776a8[_0x2283('0x10')][_0x2283('0x12')]);}logger[_0x2283('0x10')](_0x2283('0xb'),_0x4e624c,_0x1776a8['error'][_0x2283('0x12')]);return _0x146e5c(_0x1776a8[_0x2283('0x10')]['message']);}else{logger[_0x2283('0x13')](_0x2283('0xb'),_0x4e624c,'request\x20sent');_0x146e5c(_0x1776a8['result'][_0x2283('0x12')]);}})[_0x2283('0x14')](function(_0x1c1c84){logger[_0x2283('0x10')](_0x2283('0xb'),_0x4e624c,_0x1c1c84);_0x4b2d1f(_0x1c1c84);});});} \ No newline at end of file +var _0x4df9=['../../config/environment','jayson/promise','client','http','then','info','UserOpenchannelQueue,\x20%s,\x20%s','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x2ad186,_0x4ab629){var _0x663a67=function(_0xdfaa11){while(--_0xdfaa11){_0x2ad186['push'](_0x2ad186['shift']());}};_0x663a67(++_0x4ab629);}(_0x4df9,0x122));var _0x94df=function(_0x20eb70,_0x12472f){_0x20eb70=_0x20eb70-0x0;var _0x47c7d3=_0x4df9[_0x20eb70];return _0x47c7d3;};'use strict';var _=require(_0x94df('0x0'));var util=require(_0x94df('0x1'));var moment=require(_0x94df('0x2'));var BPromise=require(_0x94df('0x3'));var rs=require(_0x94df('0x4'));var fs=require('fs');var Redis=require(_0x94df('0x5'));var db=require(_0x94df('0x6'))['db'];var utils=require(_0x94df('0x7'));var logger=require(_0x94df('0x8'))(_0x94df('0x9'));var config=require(_0x94df('0xa'));var jayson=require(_0x94df('0xb'));var client=jayson[_0x94df('0xc')][_0x94df('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x58b2e1,_0x5645e0,_0x2af272){return new BPromise(function(_0xc76780,_0x1b6f51){return client['request'](_0x58b2e1,_0x2af272)[_0x94df('0xe')](function(_0x14b499){logger[_0x94df('0xf')](_0x94df('0x10'),_0x5645e0,'request\x20sent');logger[_0x94df('0x11')](_0x94df('0x12'),_0x5645e0,_0x94df('0x13'),JSON['stringify'](_0x14b499));if(_0x14b499[_0x94df('0x14')]){if(_0x14b499[_0x94df('0x14')][_0x94df('0x15')]===0x1f4){logger['error'](_0x94df('0x10'),_0x5645e0,_0x14b499[_0x94df('0x14')][_0x94df('0x16')]);return _0x1b6f51(_0x14b499[_0x94df('0x14')][_0x94df('0x16')]);}logger[_0x94df('0x14')](_0x94df('0x10'),_0x5645e0,_0x14b499[_0x94df('0x14')][_0x94df('0x16')]);return _0xc76780(_0x14b499[_0x94df('0x14')][_0x94df('0x16')]);}else{logger['info']('UserOpenchannelQueue,\x20%s,\x20%s',_0x5645e0,_0x94df('0x13'));_0xc76780(_0x14b499[_0x94df('0x17')]['message']);}})[_0x94df('0x18')](function(_0x5c9c12){logger[_0x94df('0x14')](_0x94df('0x10'),_0x5645e0,_0x5c9c12);_0x1b6f51(_0x5c9c12);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 026c997..33e3b47 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 _0x462c=['/:id/sections','getSections','/:id/resources','getResources','post','create','clone','put','/:id','update','delete','removeSections','removeResources','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe','describe','show'];(function(_0x24259d,_0x64a194){var _0x5a701=function(_0x204516){while(--_0x204516){_0x24259d['push'](_0x24259d['shift']());}};_0x5a701(++_0x64a194);}(_0x462c,0x188));var _0xc462=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x462c[_0x126558];return _0x1f6d14;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc462('0x0'));var timeout=require(_0xc462('0x1'));var express=require('express');var router=express[_0xc462('0x2')]();var fs_extra=require(_0xc462('0x3'));var auth=require(_0xc462('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc462('0x5'));var controller=require(_0xc462('0x6'));router[_0xc462('0x7')]('/',auth[_0xc462('0x8')](),controller[_0xc462('0x9')]);router[_0xc462('0x7')](_0xc462('0xa'),auth['isAuthenticated'](),controller[_0xc462('0xb')]);router[_0xc462('0x7')]('/:id',auth[_0xc462('0x8')](),controller[_0xc462('0xc')]);router[_0xc462('0x7')](_0xc462('0xd'),auth[_0xc462('0x8')](),controller[_0xc462('0xe')]);router[_0xc462('0x7')](_0xc462('0xf'),auth['isAuthenticated'](),controller[_0xc462('0x10')]);router[_0xc462('0x11')]('/',auth[_0xc462('0x8')](),controller[_0xc462('0x12')]);router[_0xc462('0x11')]('/:id/clone',auth[_0xc462('0x8')](),controller[_0xc462('0x13')]);router['post']('/:id/sections',auth[_0xc462('0x8')](),controller['addSections']);router[_0xc462('0x11')](_0xc462('0xf'),auth[_0xc462('0x8')](),controller['addResources']);router[_0xc462('0x14')](_0xc462('0x15'),auth['isAuthenticated'](),controller[_0xc462('0x16')]);router['delete']('/:id',auth[_0xc462('0x8')](),controller['destroy']);router[_0xc462('0x17')](_0xc462('0xd'),auth[_0xc462('0x8')](),controller[_0xc462('0x18')]);router[_0xc462('0x17')]('/:id/resources',auth[_0xc462('0x8')](),controller[_0xc462('0x19')]);module[_0xc462('0x1a')]=router; \ No newline at end of file +var _0x203e=['removeSections','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','/describe','describe','/:id','/:id/sections','getSections','post','create','/:id/clone','clone','addSections','/:id/resources','addResources','put','update','delete','destroy'];(function(_0x1cfe51,_0x568eff){var _0x380a44=function(_0x546688){while(--_0x546688){_0x1cfe51['push'](_0x1cfe51['shift']());}};_0x380a44(++_0x568eff);}(_0x203e,0x8d));var _0xe203=function(_0x48edbf,_0x26b619){_0x48edbf=_0x48edbf-0x0;var _0x4a2b22=_0x203e[_0x48edbf];return _0x4a2b22;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe203('0x0'));var timeout=require(_0xe203('0x1'));var express=require(_0xe203('0x2'));var router=express[_0xe203('0x3')]();var fs_extra=require(_0xe203('0x4'));var auth=require(_0xe203('0x5'));var interaction=require(_0xe203('0x6'));var config=require(_0xe203('0x7'));var controller=require(_0xe203('0x8'));router[_0xe203('0x9')]('/',auth[_0xe203('0xa')](),controller['index']);router[_0xe203('0x9')](_0xe203('0xb'),auth[_0xe203('0xa')](),controller[_0xe203('0xc')]);router[_0xe203('0x9')](_0xe203('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xe203('0x9')](_0xe203('0xe'),auth[_0xe203('0xa')](),controller[_0xe203('0xf')]);router[_0xe203('0x9')]('/:id/resources',auth[_0xe203('0xa')](),controller['getResources']);router[_0xe203('0x10')]('/',auth[_0xe203('0xa')](),controller[_0xe203('0x11')]);router[_0xe203('0x10')](_0xe203('0x12'),auth[_0xe203('0xa')](),controller[_0xe203('0x13')]);router[_0xe203('0x10')]('/:id/sections',auth[_0xe203('0xa')](),controller[_0xe203('0x14')]);router[_0xe203('0x10')](_0xe203('0x15'),auth[_0xe203('0xa')](),controller[_0xe203('0x16')]);router[_0xe203('0x17')](_0xe203('0xd'),auth['isAuthenticated'](),controller[_0xe203('0x18')]);router[_0xe203('0x19')](_0xe203('0xd'),auth[_0xe203('0xa')](),controller[_0xe203('0x1a')]);router[_0xe203('0x19')]('/:id/sections',auth[_0xe203('0xa')](),controller[_0xe203('0x1b')]);router[_0xe203('0x19')](_0xe203('0x15'),auth[_0xe203('0xa')](),controller['removeResources']);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 06f41b4..1f55f89 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 _0x6baa=['BOOLEAN','sequelize','exports','STRING','name','setDataValue','join','getDataValue','crudPermissions','split'];(function(_0x2b6482,_0x95e8a8){var _0x53e68f=function(_0x544be1){while(--_0x544be1){_0x2b6482['push'](_0x2b6482['shift']());}};_0x53e68f(++_0x95e8a8);}(_0x6baa,0xe7));var _0xa6ba=function(_0x12840f,_0x29feb2){_0x12840f=_0x12840f-0x0;var _0xf8f00=_0x6baa[_0x12840f];return _0xf8f00;};'use strict';var Sequelize=require(_0xa6ba('0x0'));module[_0xa6ba('0x1')]={'name':{'type':Sequelize[_0xa6ba('0x2')],'allowNull':![],'unique':_0xa6ba('0x3')},'crudPermissions':{'type':Sequelize[_0xa6ba('0x2')],'set':function(_0x4fc9c7){this[_0xa6ba('0x4')]('crudPermissions',_0x4fc9c7?_0x4fc9c7[_0xa6ba('0x5')](''):[]);},'get':function(){return this[_0xa6ba('0x6')](_0xa6ba('0x7'))?this[_0xa6ba('0x6')]('crudPermissions')[_0xa6ba('0x8')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xa6ba('0x9')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xa6ba('0x9')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xa6ba('0x9')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xa6ba('0x9')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xa6ba('0x9')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xa6ba('0x9')],'defaultValue':!![]}}; \ No newline at end of file +var _0xfa86=['split','BOOLEAN','sequelize','exports','STRING','name','setDataValue','crudPermissions','getDataValue'];(function(_0x429948,_0x1a6851){var _0x35d5d1=function(_0x574853){while(--_0x574853){_0x429948['push'](_0x429948['shift']());}};_0x35d5d1(++_0x1a6851);}(_0xfa86,0x89));var _0x6fa8=function(_0xfa634c,_0x414e0e){_0xfa634c=_0xfa634c-0x0;var _0x73e478=_0xfa86[_0xfa634c];return _0x73e478;};'use strict';var Sequelize=require(_0x6fa8('0x0'));module[_0x6fa8('0x1')]={'name':{'type':Sequelize[_0x6fa8('0x2')],'allowNull':![],'unique':_0x6fa8('0x3')},'crudPermissions':{'type':Sequelize[_0x6fa8('0x2')],'set':function(_0x877e09){this[_0x6fa8('0x4')](_0x6fa8('0x5'),_0x877e09?_0x877e09['join'](''):[]);},'get':function(){return this['getDataValue'](_0x6fa8('0x5'))?this[_0x6fa8('0x6')](_0x6fa8('0x5'))[_0x6fa8('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x6fa8('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x6fa8('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x6fa8('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x6fa8('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index d0775b2..3678a40 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 _0x16a2=['Resources','describe','addSections','push','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','Dashboard','forEach','Plugin','addResources','bulkCreate','removeResources','getResources','section','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./userProfile.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','stack','name','send','index','map','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','filter','VIRTUAL','merge','options','UserProfile','then','includeAll','include','rows','catch','show','params','find','create','body','rawAttributes','get','omit','updatedAt','crudPermissions','createdAt','sequelize','transaction','UserProfileSection','findAll','each','autoAssociation','UserProfileResource','sectionId','userProfileId'];(function(_0x434e50,_0x4ed139){var _0x377d0d=function(_0x3f5aa2){while(--_0x3f5aa2){_0x434e50['push'](_0x434e50['shift']());}};_0x377d0d(++_0x4ed139);}(_0x16a2,0x1d0));var _0x216a=function(_0x586fa2,_0x1a45bc){_0x586fa2=_0x586fa2-0x0;var _0x515be9=_0x16a2[_0x586fa2];return _0x515be9;};'use strict';var emlformat=require(_0x216a('0x0'));var rimraf=require(_0x216a('0x1'));var zipdir=require(_0x216a('0x2'));var jsonpatch=require(_0x216a('0x3'));var rp=require(_0x216a('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x216a('0x5'));var util=require(_0x216a('0x6'));var path=require(_0x216a('0x7'));var sox=require(_0x216a('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x216a('0x9'));var _=require(_0x216a('0xa'));var squel=require(_0x216a('0xb'));var crypto=require('crypto');var jsforce=require(_0x216a('0xc'));var deskjs=require(_0x216a('0xd'));var toCsv=require(_0x216a('0xe'));var querystring=require(_0x216a('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x216a('0x10'));var qs=require(_0x216a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x216a('0x12'));var logger=require(_0x216a('0x13'))(_0x216a('0x14'));var utils=require(_0x216a('0x15'));var config=require(_0x216a('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x216a('0x17'))['db'];config[_0x216a('0x18')]=_['defaults'](config[_0x216a('0x18')],{'host':_0x216a('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x216a('0x18')]));require(_0x216a('0x1a'))['register'](socket);function respondWithStatusCode(_0x117b1e,_0x5c41f2){_0x5c41f2=_0x5c41f2||0xcc;return function(_0x8802c6){if(_0x8802c6){return _0x117b1e[_0x216a('0x1b')](_0x5c41f2);}return _0x117b1e[_0x216a('0x1c')](_0x5c41f2)[_0x216a('0x1d')]();};}function respondWithResult(_0x4dedd0,_0x46f19d){_0x46f19d=_0x46f19d||0xc8;return function(_0x263c8e){if(_0x263c8e){return _0x4dedd0['status'](_0x46f19d)[_0x216a('0x1e')](_0x263c8e);}};}function respondWithFilteredResult(_0x56debf,_0x2e7acf){return function(_0x577624){if(_0x577624){var _0x35f178=typeof _0x2e7acf[_0x216a('0x1f')]===_0x216a('0x20')&&typeof _0x2e7acf[_0x216a('0x21')]===_0x216a('0x20');var _0x5bb15b=_0x577624[_0x216a('0x22')];var _0x17aec6=_0x35f178?0x0:_0x2e7acf[_0x216a('0x1f')];var _0x3bccf7=_0x35f178?_0x577624['count']:_0x2e7acf[_0x216a('0x1f')]+_0x2e7acf[_0x216a('0x21')];var _0x418ab9;if(_0x3bccf7>=_0x5bb15b){_0x3bccf7=_0x5bb15b;_0x418ab9=0xc8;}else{_0x418ab9=0xce;}_0x56debf[_0x216a('0x1c')](_0x418ab9);return _0x56debf[_0x216a('0x23')](_0x216a('0x24'),_0x17aec6+'-'+_0x3bccf7+'/'+_0x5bb15b)[_0x216a('0x1e')](_0x577624);}return null;};}function patchUpdates(_0x12f60b){return function(_0x11d375){try{jsonpatch[_0x216a('0x25')](_0x11d375,_0x12f60b,!![]);}catch(_0x457253){return BPromise['reject'](_0x457253);}return _0x11d375[_0x216a('0x26')]();};}function saveUpdates(_0x5cf17c,_0x3b0480){return function(_0x3ebc8d){if(_0x3ebc8d){return _0x3ebc8d[_0x216a('0x27')](_0x5cf17c)['then'](function(_0x23b673){return _0x23b673;});}return null;};}function removeEntity(_0x55a0d6,_0x36a07a){return function(_0x495422){if(_0x495422){return _0x495422[_0x216a('0x28')]()['then'](function(){_0x55a0d6[_0x216a('0x1c')](0xcc)[_0x216a('0x1d')]();});}};}function handleEntityNotFound(_0x566950,_0x23fe29){return function(_0x16004b){if(!_0x16004b){_0x566950[_0x216a('0x1b')](0x194);}return _0x16004b;};}function handleError(_0x26565c,_0xb02c4){_0xb02c4=_0xb02c4||0x1f4;return function(_0x530c76){logger['error'](_0x530c76[_0x216a('0x29')]);if(_0x530c76['name']){delete _0x530c76[_0x216a('0x2a')];}_0x26565c['status'](_0xb02c4)[_0x216a('0x2b')](_0x530c76);};}exports[_0x216a('0x2c')]=function(_0x2879dc,_0x3ea1dc){var _0x41b2e3={},_0x54d46e={},_0x2eaec2={'count':0x0,'rows':[]};var _0x50ed2c=_[_0x216a('0x2d')](db['UserProfile']['rawAttributes'],function(_0x51ac97){return{'name':_0x51ac97[_0x216a('0x2e')],'type':_0x51ac97[_0x216a('0x2f')][_0x216a('0x30')]};});_0x54d46e[_0x216a('0x31')]=_[_0x216a('0x2d')](_0x50ed2c,'name');_0x54d46e[_0x216a('0x32')]=_[_0x216a('0x33')](_0x2879dc[_0x216a('0x32')]);_0x54d46e['filters']=_[_0x216a('0x34')](_0x54d46e[_0x216a('0x31')],_0x54d46e[_0x216a('0x32')]);_0x41b2e3[_0x216a('0x35')]=_['intersection'](_0x54d46e[_0x216a('0x31')],qs[_0x216a('0x36')](_0x2879dc[_0x216a('0x32')][_0x216a('0x36')]));_0x41b2e3[_0x216a('0x35')]=_0x41b2e3[_0x216a('0x35')][_0x216a('0x37')]?_0x41b2e3['attributes']:_0x54d46e[_0x216a('0x31')];if(!_0x2879dc[_0x216a('0x32')]['hasOwnProperty'](_0x216a('0x38'))){_0x41b2e3[_0x216a('0x21')]=qs['limit'](_0x2879dc[_0x216a('0x32')][_0x216a('0x21')]);_0x41b2e3[_0x216a('0x1f')]=qs[_0x216a('0x1f')](_0x2879dc[_0x216a('0x32')]['offset']);}_0x41b2e3['order']=qs[_0x216a('0x39')](_0x2879dc[_0x216a('0x32')][_0x216a('0x39')]);_0x41b2e3[_0x216a('0x3a')]=qs[_0x216a('0x3b')](_[_0x216a('0x3c')](_0x2879dc['query'],_0x54d46e[_0x216a('0x3b')]),_0x50ed2c);if(_0x2879dc['query'][_0x216a('0x3d')]){_0x41b2e3[_0x216a('0x3a')]=_['merge'](_0x41b2e3[_0x216a('0x3a')],{'$or':_[_0x216a('0x2d')](_0x50ed2c,function(_0x1b7309){if(_0x1b7309[_0x216a('0x2f')]!==_0x216a('0x3e')){var _0x4a68df={};_0x4a68df[_0x1b7309[_0x216a('0x2a')]]={'$like':'%'+_0x2879dc[_0x216a('0x32')][_0x216a('0x3d')]+'%'};return _0x4a68df;}})});}_0x41b2e3=_[_0x216a('0x3f')]({},_0x41b2e3,_0x2879dc[_0x216a('0x40')]);var _0x513281={'where':_0x41b2e3[_0x216a('0x3a')]};return db[_0x216a('0x41')]['count'](_0x513281)[_0x216a('0x42')](function(_0x4c858a){_0x2eaec2['count']=_0x4c858a;if(_0x2879dc[_0x216a('0x32')][_0x216a('0x43')]){_0x41b2e3[_0x216a('0x44')]=[{'all':!![]}];}return db['UserProfile']['findAll'](_0x41b2e3);})[_0x216a('0x42')](function(_0x189d32){_0x2eaec2[_0x216a('0x45')]=_0x189d32;return _0x2eaec2;})[_0x216a('0x42')](respondWithFilteredResult(_0x3ea1dc,_0x41b2e3))[_0x216a('0x46')](handleError(_0x3ea1dc,null));};exports[_0x216a('0x47')]=function(_0x117921,_0x2f1415){var _0x38bfba={'raw':![],'where':{'id':_0x117921[_0x216a('0x48')]['id']}},_0x3b9949={};_0x3b9949['model']=_[_0x216a('0x33')](db[_0x216a('0x41')]['rawAttributes']);_0x3b9949[_0x216a('0x32')]=_[_0x216a('0x33')](_0x117921['query']);_0x3b9949[_0x216a('0x3b')]=_[_0x216a('0x34')](_0x3b9949[_0x216a('0x31')],_0x3b9949[_0x216a('0x32')]);_0x38bfba[_0x216a('0x35')]=_[_0x216a('0x34')](_0x3b9949[_0x216a('0x31')],qs[_0x216a('0x36')](_0x117921[_0x216a('0x32')]['fields']));_0x38bfba[_0x216a('0x35')]=_0x38bfba[_0x216a('0x35')][_0x216a('0x37')]?_0x38bfba[_0x216a('0x35')]:_0x3b9949[_0x216a('0x31')];if(_0x117921[_0x216a('0x32')][_0x216a('0x43')]){_0x38bfba[_0x216a('0x44')]=[{'all':!![]}];}_0x38bfba=_['merge']({},_0x38bfba,_0x117921['options']);return db[_0x216a('0x41')][_0x216a('0x49')](_0x38bfba)[_0x216a('0x42')](handleEntityNotFound(_0x2f1415,null))['then'](respondWithResult(_0x2f1415,null))['catch'](handleError(_0x2f1415,null));};exports[_0x216a('0x4a')]=function(_0x3f41f2,_0x31b8ba){return db[_0x216a('0x41')][_0x216a('0x4a')](_0x3f41f2[_0x216a('0x4b')],{})[_0x216a('0x42')](respondWithResult(_0x31b8ba,0xc9))[_0x216a('0x46')](handleError(_0x31b8ba,null));};exports['clone']=function(_0x56487b,_0x46caaf){var _0x1635aa={'where':{'id':_0x56487b[_0x216a('0x48')]['id']}},_0x5088cf={};_0x5088cf[_0x216a('0x31')]=_['keys'](db[_0x216a('0x41')][_0x216a('0x4c')]);_0x1635aa['attributes']=_[_0x216a('0x34')](_0x5088cf[_0x216a('0x31')],qs[_0x216a('0x36')](_0x56487b[_0x216a('0x32')][_0x216a('0x36')]));_0x1635aa[_0x216a('0x35')]=_0x1635aa[_0x216a('0x35')][_0x216a('0x37')]?_0x1635aa[_0x216a('0x35')]:_0x5088cf[_0x216a('0x31')];if(_0x56487b[_0x216a('0x32')][_0x216a('0x43')]){_0x1635aa['include']=[{'all':!![]}];}_0x1635aa=_['merge']({},_0x1635aa,_0x56487b[_0x216a('0x40')]);return db[_0x216a('0x41')][_0x216a('0x49')](_0x1635aa)[_0x216a('0x42')](handleEntityNotFound(_0x46caaf,null))['then'](function(_0x18fc95){if(_0x18fc95){var _0x4efa34=_0x18fc95[_0x216a('0x4d')]({'plain':!![]});_0x4efa34=qs[_0x216a('0x4e')](_0x4efa34,['id','createdAt',_0x216a('0x4f'),_0x216a('0x50')]);_0x56487b[_0x216a('0x4b')]=_[_0x216a('0x4e')](_0x56487b[_0x216a('0x4b')],['id',_0x216a('0x51'),_0x216a('0x4f')]);return db[_0x216a('0x52')][_0x216a('0x53')](function(_0x437ae5){return db[_0x216a('0x41')][_0x216a('0x4a')](_[_0x216a('0x3f')](_0x4efa34,_0x56487b['body']),{'include':_0x56487b[_0x216a('0x32')][_0x216a('0x43')]?[{'all':!![]}]:undefined,'transaction':_0x437ae5})['then'](function(_0x5c4993){var _0x5b6d81=_0x5c4993['get']({'plain':!![]});return db[_0x216a('0x54')][_0x216a('0x55')]({'where':{'userProfileId':_0x56487b[_0x216a('0x48')]['id']},'raw':!![]})[_0x216a('0x42')](function(_0x542b7d){if(_0x542b7d){return BPromise[_0x216a('0x56')](_0x542b7d,function(_0xfc00e6){return new BPromise(function(_0xafd74b,_0x4c76fa){if(_0xfc00e6[_0x216a('0x57')]===null||_0xfc00e6[_0x216a('0x57')]===0x1)_0xafd74b(null);return db[_0x216a('0x58')][_0x216a('0x55')]({'where':{'sectionId':_0xfc00e6['id']},'raw':!![]})[_0x216a('0x42')](function(_0x9a63a7){var _0x1f16d6=_['map'](_0x9a63a7,function(_0x5dec32){return qs[_0x216a('0x4e')](_0x5dec32,['id','createdAt','updatedAt',_0x216a('0x59')]);});_0xafd74b(_0x1f16d6);})[_0x216a('0x46')](function(_0x190bb6){_0x4c76fa(_0x190bb6);});})[_0x216a('0x42')](function(_0x49cbc3){var _0xc9da0f=qs[_0x216a('0x4e')](_0xfc00e6,['id',_0x216a('0x51'),_0x216a('0x4f')]);_0xc9da0f[_0x216a('0x5a')]=_0x5b6d81['id'];if(_0x49cbc3)_0xc9da0f['Resources']=_0x49cbc3;return _0xc9da0f;})[_0x216a('0x42')](function(_0x159b02){return db[_0x216a('0x54')][_0x216a('0x4a')](_0x159b02,{'include':[{'model':db[_0x216a('0x58')],'as':_0x216a('0x5b')}],'raw':!![],'transaction':_0x437ae5});});})['then'](function(){return _0x5b6d81;});}});});});}})[_0x216a('0x42')](respondWithResult(_0x46caaf,0xc9))['catch'](handleError(_0x46caaf,null));};exports[_0x216a('0x27')]=function(_0x1c7e9b,_0x59028d){if(_0x1c7e9b[_0x216a('0x4b')]['id']){delete _0x1c7e9b['body']['id'];}return db[_0x216a('0x41')][_0x216a('0x49')]({'where':{'id':_0x1c7e9b[_0x216a('0x48')]['id']}})['then'](handleEntityNotFound(_0x59028d,null))[_0x216a('0x42')](saveUpdates(_0x1c7e9b[_0x216a('0x4b')],null))[_0x216a('0x42')](respondWithResult(_0x59028d,null))[_0x216a('0x46')](handleError(_0x59028d,null));};exports['destroy']=function(_0x5b3842,_0x1cf263){return db['UserProfile'][_0x216a('0x49')]({'where':{'id':_0x5b3842[_0x216a('0x48')]['id']}})[_0x216a('0x42')](handleEntityNotFound(_0x1cf263,null))['then'](removeEntity(_0x1cf263,null))['catch'](handleError(_0x1cf263,null));};exports['describe']=function(_0x5c109b,_0xd9e15d){return db[_0x216a('0x41')][_0x216a('0x5c')]()[_0x216a('0x42')](respondWithResult(_0xd9e15d,null))[_0x216a('0x46')](handleError(_0xd9e15d,null));};exports[_0x216a('0x5d')]=function(_0x260ada,_0x3aa096){var _0x5ec531=_0x260ada['body'];return db['UserProfile'][_0x216a('0x49')]({'where':{'id':_0x260ada[_0x216a('0x48')]['id']}})[_0x216a('0x42')](handleEntityNotFound(_0x3aa096,null))[_0x216a('0x42')](function(_0x30a076){if(_0x30a076){return db[_0x216a('0x52')][_0x216a('0x53')](function(_0x56df56){return db[_0x216a('0x54')][_0x216a('0x28')]({'where':{'userProfileId':_0x260ada[_0x216a('0x48')]['id'],'sectionId':_[_0x216a('0x2d')](_0x5ec531,function(_0x3cbebd){return _0x3cbebd[_0x216a('0x59')];})},'transaction':_0x56df56})[_0x216a('0x42')](function(){var _0x52550f=_[_0x216a('0x2d')](_0x5ec531,function(_0x42e239){_0x42e239[_0x216a('0x5a')]=_0x260ada['params']['id'];return _0x42e239;});var _0x5d1346=[];return BPromise[_0x216a('0x56')](_0x52550f,function(_0x5da2cd){return db[_0x216a('0x54')][_0x216a('0x4a')](_0x5da2cd,{'include':[{'model':db[_0x216a('0x58')],'as':_0x216a('0x5b')}],'raw':!![],'transaction':_0x56df56})[_0x216a('0x42')](function(_0x2718db){_0x5d1346[_0x216a('0x5e')](_0x2718db[_0x216a('0x4d')]({'plain':!![]}));});})[_0x216a('0x42')](function(){return _0x5d1346;});});});}})['then'](function(_0x553f2b){return _0x553f2b;})[_0x216a('0x42')](respondWithResult(_0x3aa096,null))[_0x216a('0x46')](handleError(_0x3aa096,null));};exports[_0x216a('0x5f')]=function(_0x3a8126,_0x5b3337){var _0x114434;return db[_0x216a('0x41')][_0x216a('0x49')]({'where':{'id':_0x3a8126[_0x216a('0x48')]['id']},'attributes':['id',_0x216a('0x2a')]})[_0x216a('0x42')](handleEntityNotFound(_0x5b3337,null))['then'](function(_0xefa09c){if(_0xefa09c){_0x114434=_0xefa09c;return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x3a8126[_0x216a('0x48')]['id'],'sectionId':_0x3a8126['query'][_0x216a('0x60')]}});}})[_0x216a('0x42')](function(){return _0x114434;})[_0x216a('0x42')](respondWithStatusCode(_0x5b3337,null))[_0x216a('0x46')](handleError(_0x5b3337,null));};exports[_0x216a('0x61')]=function(_0x400036,_0x3fdc0d){var _0x328460=[];var _0x44eb51=[];return db['UserProfileSection'][_0x216a('0x55')]({'where':{'userProfileId':_0x400036[_0x216a('0x48')]['id']},'raw':!![]})['then'](function(_0xaf5c0f){_0x328460=_[_0x216a('0x3d')](_0xaf5c0f,function(_0x38f826){return _0x38f826[_0x216a('0x62')]===0x1||_[_0x216a('0x63')]([0x3eb,0x709],_0x38f826[_0x216a('0x59')]);});if(!_[_0x216a('0x64')](_0x328460)){return _['map'](_0x328460,function(_0x28abac){return _0x28abac[_0x216a('0x59')];});}else{return;}})['then'](function(_0x403145){if(_0x403145)_0x44eb51=_0x403145;if(_[_0x216a('0x63')](_0x44eb51,0x64)){var _0x5c4cb1=_[_0x216a('0x49')](_0x328460,{'sectionId':0x64});return hasDefaultDashboard(_0x5c4cb1)[_0x216a('0x42')](function(_0x36738d){return _[_0x216a('0x2d')](_0x328460,function(_0x2b144e){if(_0x2b144e[_0x216a('0x59')]===0x64){_0x2b144e['subsections']=_0x36738d;}return _0x2b144e;});});}else{return;}})[_0x216a('0x42')](function(_0x424fde){if(_0x424fde)_0x328460=_0x424fde;if(_[_0x216a('0x63')](_0x44eb51,0x3eb)){var _0x828758=_['find'](_0x328460,{'sectionId':0x3eb});return getCustomDashboards(_0x828758)[_0x216a('0x42')](function(_0xe5182d){return _[_0x216a('0x2d')](_0x328460,function(_0x18a234){if(_0x828758[_0x216a('0x62')]){if(_0x18a234[_0x216a('0x59')]===0x3eb){_0x18a234[_0x216a('0x65')]=_0xe5182d;}}else{if(_0x18a234[_0x216a('0x59')]===0x64){_0x18a234[_0x216a('0x65')]=_0xe5182d;}}return _0x18a234;});});}else{return;}})[_0x216a('0x42')](function(_0x1879d2){if(_0x1879d2)_0x328460=_0x1879d2;if(_[_0x216a('0x63')](_0x44eb51,0x709)){var _0xb73be7=_[_0x216a('0x49')](_0x328460,{'sectionId':0x709});return getPlugins(_0xb73be7)['then'](function(_0x2433c6){if(_0xb73be7[_0x216a('0x62')]){return _[_0x216a('0x2d')](_0x328460,function(_0x207127){if(_0x207127[_0x216a('0x59')]===0x709){_0x207127[_0x216a('0x65')]=_0x2433c6;}return _0x207127;});}else{var _0x21a83b={'sectionId':0x76c,'enabled':0x1,'subsections':_0x2433c6};var _0x3ba401=_[_0x216a('0x2d')](_0x328460);_0x3ba401[_0x216a('0x5e')](_0x21a83b);return _0x3ba401;}});}else{return;}})[_0x216a('0x42')](function(_0x5a63e3){if(_0x5a63e3)_0x328460=_0x5a63e3;return _[_0x216a('0x3d')](_0x328460,[_0x216a('0x62'),0x1]);})[_0x216a('0x42')](respondWithResult(_0x3fdc0d,null))[_0x216a('0x46')](handleError(_0x3fdc0d,null));};function hasDefaultDashboard(_0x3e69c0){var _0x4fe984=[0x65];return new BPromise(function(_0x50e0b8,_0x1d776f){try{if(_0x3e69c0[_0x216a('0x57')]){_0x50e0b8(_0x4fe984);}else{return db[_0x216a('0x58')]['findOne']({'where':{'sectionId':_0x3e69c0['id']},'raw':!![]})[_0x216a('0x42')](function(_0x5b49a1){_0x5b49a1?_0x50e0b8(_0x4fe984):_0x50e0b8();});}}catch(_0x341717){_0x1d776f(_0x341717);}});}function getCustomDashboards(_0x373fc0){var _0x56e284=[];return new BPromise(function(_0x52df2e,_0x419cf6){try{if(_0x373fc0[_0x216a('0x57')]){return db[_0x216a('0x66')][_0x216a('0x55')]({'raw':!![]})[_0x216a('0x42')](function(_0x5e9b15){_0x5e9b15[_0x216a('0x67')](function(_0x4d5b5f){_0x56e284[_0x216a('0x5e')](_0x4d5b5f['id']+0x1869f);});_0x52df2e(_0x56e284);});}else{return db[_0x216a('0x58')]['findAll']({'where':{'sectionId':_0x373fc0['id']},'raw':!![]})['then'](function(_0x16ad29){_0x16ad29[_0x216a('0x67')](function(_0x538754){_0x56e284[_0x216a('0x5e')](_0x538754['resourceId']+0x1869f);});_0x52df2e(_0x56e284);});}}catch(_0x1df37e){_0x419cf6(_0x1df37e);}});}function getPlugins(_0xc3e887){var _0x37ccc3=[];return new BPromise(function(_0x58d268,_0x55cafb){try{if(_0xc3e887[_0x216a('0x57')]){return db[_0x216a('0x68')]['findAll']({'raw':!![]})['then'](function(_0x29d4b3){_0x29d4b3['forEach'](function(_0x1494ae){_0x37ccc3[_0x216a('0x5e')](_0x1494ae['id']+0x15b38);});_0x58d268(_0x37ccc3);});}else{return db[_0x216a('0x58')][_0x216a('0x55')]({'where':{'sectionId':_0xc3e887['id']},'raw':!![]})['then'](function(_0x5a2629){_0x5a2629[_0x216a('0x67')](function(_0xe3f6b7){_0x37ccc3[_0x216a('0x5e')](_0xe3f6b7['resourceId']+0x15b38);});_0x58d268(_0x37ccc3);});}}catch(_0x495116){_0x55cafb(_0x495116);}});}exports[_0x216a('0x69')]=function(_0x152162,_0x546805){return db[_0x216a('0x41')][_0x216a('0x49')]({'where':{'id':_0x152162[_0x216a('0x48')]['id']}})[_0x216a('0x42')](handleEntityNotFound(_0x546805,null))[_0x216a('0x42')](function(_0x43ef19){if(_0x43ef19){return db[_0x216a('0x52')][_0x216a('0x53')](function(_0x1f4a4f){return db[_0x216a('0x54')][_0x216a('0x55')]({'where':{'userProfileId':_0x152162[_0x216a('0x48')]['id']},'attributes':['id'],'raw':!![]})[_0x216a('0x42')](function(_0x5e576b){if(_0x5e576b){return db[_0x216a('0x54')][_0x216a('0x28')]({'where':{'userProfileId':_0x152162[_0x216a('0x48')]['id'],'id':_[_0x216a('0x2d')](_0x5e576b,function(_0x51af9f){return _0x51af9f['id'];})},'transaction':_0x1f4a4f});}})[_0x216a('0x42')](function(_0x11c04c){var _0x2b754b=_[_0x216a('0x2d')](_0x152162[_0x216a('0x4b')],function(_0x36001c){_0x36001c[_0x216a('0x5a')]=_0x152162[_0x216a('0x48')]['id'];return _0x36001c;});return db['UserProfileSection'][_0x216a('0x6a')](_0x2b754b,{'raw':!![],'transaction':_0x1f4a4f});})[_0x216a('0x42')](function(_0x428379){var _0x34b174=_[_0x216a('0x3d')](_['map'](_0x428379,function(_0xff67be){return _0xff67be['get']({'plain':!![]});}),{'includeAll':![]});if(_0x34b174){return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x152162['params']['id'],'sectionId':_[_0x216a('0x2d')](_0x34b174,function(_0x4215e9){return _0x4215e9[_0x216a('0x59')];})},'attributes':['id',_0x216a('0x59')],'raw':!![]})['then'](function(_0x8746bd){var _0x87b2a5=_[_0x216a('0x2d')](_0x152162[_0x216a('0x4b')],function(_0x3a8b1a){_0x3a8b1a[_0x216a('0x5a')]=_0x152162[_0x216a('0x48')]['id'];return _0x3a8b1a;});return db[_0x216a('0x58')][_0x216a('0x6a')](_0x87b2a5,{'raw':!![],'transaction':_0x1f4a4f});});}})[_0x216a('0x46')](handleError(_0x546805,null));});}})[_0x216a('0x42')](function(_0x50ec45){var _0x55e9b4=_[_0x216a('0x2d')](_0x50ec45,function(_0x3d6472){return _0x3d6472[_0x216a('0x4d')]({'plain':!![]});});})['then'](respondWithResult(_0x546805,null))[_0x216a('0x46')](handleError(_0x546805,null));};exports[_0x216a('0x6b')]=function(_0x590d03,_0x183d89,_0x3e4829){return db[_0x216a('0x41')][_0x216a('0x49')]({'where':{'id':_0x590d03[_0x216a('0x48')]['id']}})[_0x216a('0x42')](handleEntityNotFound(_0x183d89,null))['then'](function(_0x381ba2){if(_0x381ba2){return _0x381ba2[_0x216a('0x6b')](_0x590d03[_0x216a('0x32')][_0x216a('0x60')]);}})[_0x216a('0x42')](respondWithStatusCode(_0x183d89,null))[_0x216a('0x46')](handleError(_0x183d89,null));};exports[_0x216a('0x6c')]=function(_0x5c8623,_0x2e94fe){var _0x2f5152={};if(!_0x5c8623[_0x216a('0x32')][_0x216a('0x6d')])throw new Error('Missing\x20section\x20parameter');if(!_0x5c8623[_0x216a('0x32')][_0x216a('0x6e')]('nolimit')){_0x2f5152[_0x216a('0x21')]=qs['limit'](_0x5c8623[_0x216a('0x32')][_0x216a('0x21')]);_0x2f5152[_0x216a('0x1f')]=qs[_0x216a('0x1f')](_0x5c8623[_0x216a('0x32')]['offset']);}return db[_0x216a('0x41')][_0x216a('0x49')]({'where':{'id':_0x5c8623[_0x216a('0x48')]['id']}})['then'](function(_0x170af9){if(!_0x170af9)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x5c8623[_0x216a('0x48')]['id']);return db[_0x216a('0x41')][_0x216a('0x6c')](_0x5c8623);})[_0x216a('0x42')](respondWithFilteredResult(_0x2e94fe,_0x2f5152))[_0x216a('0x46')](handleError(_0x2e94fe,null));}; \ No newline at end of file +var _0x9264=['rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','filter','then','include','findAll','rows','catch','show','includeAll','find','create','clone','params','options','get','omit','createdAt','body','updatedAt','sequelize','each','autoAssociation','sectionId','Resources','UserProfileSection','UserProfileResource','destroy','describe','addSections','transaction','userProfileId','push','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','findOne','Dashboard','forEach','Plugin','addResources','bulkCreate','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','path','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','error','name','send','index','map','UserProfile'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x9264,0xb1));var _0x4926=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9264[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x4926('0x0'));var rimraf=require(_0x4926('0x1'));var zipdir=require(_0x4926('0x2'));var jsonpatch=require(_0x4926('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4926('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4926('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4926('0x6'));var _=require(_0x4926('0x7'));var squel=require('squel');var crypto=require(_0x4926('0x8'));var jsforce=require(_0x4926('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x4926('0xa'));var querystring=require(_0x4926('0xb'));var Papa=require(_0x4926('0xc'));var Redis=require('ioredis');var authService=require(_0x4926('0xd'));var qs=require(_0x4926('0xe'));var as=require(_0x4926('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4926('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x4926('0x11'));var licenseUtil=require(_0x4926('0x12'));var db=require(_0x4926('0x13'))['db'];config['redis']=_[_0x4926('0x14')](config[_0x4926('0x15')],{'host':_0x4926('0x16'),'port':0x18eb});var socket=require(_0x4926('0x17'))(new Redis(config[_0x4926('0x15')]));require(_0x4926('0x18'))[_0x4926('0x19')](socket);function respondWithStatusCode(_0x1a280b,_0x21503d){_0x21503d=_0x21503d||0xcc;return function(_0x7782aa){if(_0x7782aa){return _0x1a280b[_0x4926('0x1a')](_0x21503d);}return _0x1a280b[_0x4926('0x1b')](_0x21503d)[_0x4926('0x1c')]();};}function respondWithResult(_0x1ac74f,_0x55b957){_0x55b957=_0x55b957||0xc8;return function(_0x1703ed){if(_0x1703ed){return _0x1ac74f[_0x4926('0x1b')](_0x55b957)[_0x4926('0x1d')](_0x1703ed);}};}function respondWithFilteredResult(_0x5736dd,_0x4d2cd3){return function(_0x1dd78e){if(_0x1dd78e){var _0x5630a8=typeof _0x4d2cd3[_0x4926('0x1e')]===_0x4926('0x1f')&&typeof _0x4d2cd3['limit']===_0x4926('0x1f');var _0x49461e=_0x1dd78e[_0x4926('0x20')];var _0x3d3fbc=_0x5630a8?0x0:_0x4d2cd3[_0x4926('0x1e')];var _0x2d6239=_0x5630a8?_0x1dd78e['count']:_0x4d2cd3['offset']+_0x4d2cd3[_0x4926('0x21')];var _0x588c7a;if(_0x2d6239>=_0x49461e){_0x2d6239=_0x49461e;_0x588c7a=0xc8;}else{_0x588c7a=0xce;}_0x5736dd['status'](_0x588c7a);return _0x5736dd[_0x4926('0x22')](_0x4926('0x23'),_0x3d3fbc+'-'+_0x2d6239+'/'+_0x49461e)['json'](_0x1dd78e);}return null;};}function patchUpdates(_0xfd1095){return function(_0x4792ac){try{jsonpatch[_0x4926('0x24')](_0x4792ac,_0xfd1095,!![]);}catch(_0x55e459){return BPromise[_0x4926('0x25')](_0x55e459);}return _0x4792ac[_0x4926('0x26')]();};}function saveUpdates(_0x2df18c,_0x44eb88){return function(_0x585b91){if(_0x585b91){return _0x585b91['update'](_0x2df18c)['then'](function(_0x1c02e7){return _0x1c02e7;});}return null;};}function removeEntity(_0xbfbe1b,_0x43c077){return function(_0x2519a2){if(_0x2519a2){return _0x2519a2['destroy']()['then'](function(){_0xbfbe1b['status'](0xcc)[_0x4926('0x1c')]();});}};}function handleEntityNotFound(_0x273f4b,_0x18f56d){return function(_0x4adb87){if(!_0x4adb87){_0x273f4b['sendStatus'](0x194);}return _0x4adb87;};}function handleError(_0x50004f,_0x37701c){_0x37701c=_0x37701c||0x1f4;return function(_0x3f06a3){logger[_0x4926('0x27')](_0x3f06a3['stack']);if(_0x3f06a3[_0x4926('0x28')]){delete _0x3f06a3[_0x4926('0x28')];}_0x50004f[_0x4926('0x1b')](_0x37701c)[_0x4926('0x29')](_0x3f06a3);};}exports[_0x4926('0x2a')]=function(_0x14cc3a,_0x5a44a9){var _0x39ad37={},_0x717a1a={},_0x32a6c2={'count':0x0,'rows':[]};var _0x14d8b8=_[_0x4926('0x2b')](db[_0x4926('0x2c')][_0x4926('0x2d')],function(_0x50ea49){return{'name':_0x50ea49[_0x4926('0x2e')],'type':_0x50ea49[_0x4926('0x2f')]['key']};});_0x717a1a[_0x4926('0x30')]=_[_0x4926('0x2b')](_0x14d8b8,_0x4926('0x28'));_0x717a1a[_0x4926('0x31')]=_[_0x4926('0x32')](_0x14cc3a[_0x4926('0x31')]);_0x717a1a[_0x4926('0x33')]=_[_0x4926('0x34')](_0x717a1a[_0x4926('0x30')],_0x717a1a[_0x4926('0x31')]);_0x39ad37[_0x4926('0x35')]=_[_0x4926('0x34')](_0x717a1a[_0x4926('0x30')],qs[_0x4926('0x36')](_0x14cc3a['query'][_0x4926('0x36')]));_0x39ad37[_0x4926('0x35')]=_0x39ad37[_0x4926('0x35')][_0x4926('0x37')]?_0x39ad37['attributes']:_0x717a1a[_0x4926('0x30')];if(!_0x14cc3a[_0x4926('0x31')][_0x4926('0x38')](_0x4926('0x39'))){_0x39ad37[_0x4926('0x21')]=qs['limit'](_0x14cc3a[_0x4926('0x31')][_0x4926('0x21')]);_0x39ad37[_0x4926('0x1e')]=qs['offset'](_0x14cc3a[_0x4926('0x31')][_0x4926('0x1e')]);}_0x39ad37[_0x4926('0x3a')]=qs[_0x4926('0x3b')](_0x14cc3a[_0x4926('0x31')][_0x4926('0x3b')]);_0x39ad37['where']=qs[_0x4926('0x33')](_[_0x4926('0x3c')](_0x14cc3a[_0x4926('0x31')],_0x717a1a[_0x4926('0x33')]),_0x14d8b8);if(_0x14cc3a[_0x4926('0x31')]['filter']){_0x39ad37[_0x4926('0x3d')]=_[_0x4926('0x3e')](_0x39ad37[_0x4926('0x3d')],{'$or':_[_0x4926('0x2b')](_0x14d8b8,function(_0x4ea503){if(_0x4ea503['type']!=='VIRTUAL'){var _0x2e74d9={};_0x2e74d9[_0x4ea503[_0x4926('0x28')]]={'$like':'%'+_0x14cc3a[_0x4926('0x31')][_0x4926('0x3f')]+'%'};return _0x2e74d9;}})});}_0x39ad37=_[_0x4926('0x3e')]({},_0x39ad37,_0x14cc3a['options']);var _0x5a8f61={'where':_0x39ad37['where']};return db['UserProfile'][_0x4926('0x20')](_0x5a8f61)[_0x4926('0x40')](function(_0x4380da){_0x32a6c2[_0x4926('0x20')]=_0x4380da;if(_0x14cc3a[_0x4926('0x31')]['includeAll']){_0x39ad37[_0x4926('0x41')]=[{'all':!![]}];}return db[_0x4926('0x2c')][_0x4926('0x42')](_0x39ad37);})[_0x4926('0x40')](function(_0x437800){_0x32a6c2[_0x4926('0x43')]=_0x437800;return _0x32a6c2;})[_0x4926('0x40')](respondWithFilteredResult(_0x5a44a9,_0x39ad37))[_0x4926('0x44')](handleError(_0x5a44a9,null));};exports[_0x4926('0x45')]=function(_0x39329b,_0x51427e){var _0x571efa={'raw':![],'where':{'id':_0x39329b['params']['id']}},_0x3428be={};_0x3428be[_0x4926('0x30')]=_[_0x4926('0x32')](db[_0x4926('0x2c')]['rawAttributes']);_0x3428be[_0x4926('0x31')]=_[_0x4926('0x32')](_0x39329b[_0x4926('0x31')]);_0x3428be[_0x4926('0x33')]=_[_0x4926('0x34')](_0x3428be[_0x4926('0x30')],_0x3428be[_0x4926('0x31')]);_0x571efa[_0x4926('0x35')]=_[_0x4926('0x34')](_0x3428be[_0x4926('0x30')],qs[_0x4926('0x36')](_0x39329b[_0x4926('0x31')][_0x4926('0x36')]));_0x571efa[_0x4926('0x35')]=_0x571efa[_0x4926('0x35')]['length']?_0x571efa[_0x4926('0x35')]:_0x3428be[_0x4926('0x30')];if(_0x39329b['query'][_0x4926('0x46')]){_0x571efa[_0x4926('0x41')]=[{'all':!![]}];}_0x571efa=_[_0x4926('0x3e')]({},_0x571efa,_0x39329b['options']);return db[_0x4926('0x2c')][_0x4926('0x47')](_0x571efa)[_0x4926('0x40')](handleEntityNotFound(_0x51427e,null))[_0x4926('0x40')](respondWithResult(_0x51427e,null))[_0x4926('0x44')](handleError(_0x51427e,null));};exports[_0x4926('0x48')]=function(_0x43764f,_0x12a89b){return db['UserProfile'][_0x4926('0x48')](_0x43764f['body'],{})['then'](respondWithResult(_0x12a89b,0xc9))[_0x4926('0x44')](handleError(_0x12a89b,null));};exports[_0x4926('0x49')]=function(_0x50d4b4,_0x3afe71){var _0x3ef8ec={'where':{'id':_0x50d4b4[_0x4926('0x4a')]['id']}},_0x37877f={};_0x37877f[_0x4926('0x30')]=_[_0x4926('0x32')](db['UserProfile']['rawAttributes']);_0x3ef8ec['attributes']=_['intersection'](_0x37877f[_0x4926('0x30')],qs[_0x4926('0x36')](_0x50d4b4[_0x4926('0x31')][_0x4926('0x36')]));_0x3ef8ec[_0x4926('0x35')]=_0x3ef8ec[_0x4926('0x35')]['length']?_0x3ef8ec[_0x4926('0x35')]:_0x37877f[_0x4926('0x30')];if(_0x50d4b4['query'][_0x4926('0x46')]){_0x3ef8ec[_0x4926('0x41')]=[{'all':!![]}];}_0x3ef8ec=_['merge']({},_0x3ef8ec,_0x50d4b4[_0x4926('0x4b')]);return db[_0x4926('0x2c')]['find'](_0x3ef8ec)[_0x4926('0x40')](handleEntityNotFound(_0x3afe71,null))['then'](function(_0x1b0b43){if(_0x1b0b43){var _0x691972=_0x1b0b43[_0x4926('0x4c')]({'plain':!![]});_0x691972=qs[_0x4926('0x4d')](_0x691972,['id',_0x4926('0x4e'),'updatedAt','crudPermissions']);_0x50d4b4[_0x4926('0x4f')]=_[_0x4926('0x4d')](_0x50d4b4['body'],['id',_0x4926('0x4e'),_0x4926('0x50')]);return db[_0x4926('0x51')]['transaction'](function(_0x22e537){return db[_0x4926('0x2c')][_0x4926('0x48')](_[_0x4926('0x3e')](_0x691972,_0x50d4b4['body']),{'include':_0x50d4b4['query']['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x22e537})[_0x4926('0x40')](function(_0x391087){var _0x2efca4=_0x391087[_0x4926('0x4c')]({'plain':!![]});return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x50d4b4['params']['id']},'raw':!![]})[_0x4926('0x40')](function(_0x113907){if(_0x113907){return BPromise[_0x4926('0x52')](_0x113907,function(_0x41e090){return new BPromise(function(_0x39c072,_0x5ad039){if(_0x41e090[_0x4926('0x53')]===null||_0x41e090[_0x4926('0x53')]===0x1)_0x39c072(null);return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x41e090['id']},'raw':!![]})[_0x4926('0x40')](function(_0x27ef63){var _0x165d08=_[_0x4926('0x2b')](_0x27ef63,function(_0x48a4ec){return qs['omit'](_0x48a4ec,['id','createdAt',_0x4926('0x50'),_0x4926('0x54')]);});_0x39c072(_0x165d08);})[_0x4926('0x44')](function(_0x55b39b){_0x5ad039(_0x55b39b);});})[_0x4926('0x40')](function(_0x538665){var _0x1696c9=qs[_0x4926('0x4d')](_0x41e090,['id','createdAt',_0x4926('0x50')]);_0x1696c9['userProfileId']=_0x2efca4['id'];if(_0x538665)_0x1696c9[_0x4926('0x55')]=_0x538665;return _0x1696c9;})[_0x4926('0x40')](function(_0x4ebdb8){return db[_0x4926('0x56')][_0x4926('0x48')](_0x4ebdb8,{'include':[{'model':db[_0x4926('0x57')],'as':_0x4926('0x55')}],'raw':!![],'transaction':_0x22e537});});})['then'](function(){return _0x2efca4;});}});});});}})[_0x4926('0x40')](respondWithResult(_0x3afe71,0xc9))[_0x4926('0x44')](handleError(_0x3afe71,null));};exports['update']=function(_0x7ed5fc,_0x155726){if(_0x7ed5fc[_0x4926('0x4f')]['id']){delete _0x7ed5fc[_0x4926('0x4f')]['id'];}return db['UserProfile'][_0x4926('0x47')]({'where':{'id':_0x7ed5fc[_0x4926('0x4a')]['id']}})[_0x4926('0x40')](handleEntityNotFound(_0x155726,null))[_0x4926('0x40')](saveUpdates(_0x7ed5fc['body'],null))[_0x4926('0x40')](respondWithResult(_0x155726,null))[_0x4926('0x44')](handleError(_0x155726,null));};exports[_0x4926('0x58')]=function(_0x4b8873,_0x59df25){return db[_0x4926('0x2c')][_0x4926('0x47')]({'where':{'id':_0x4b8873[_0x4926('0x4a')]['id']}})['then'](handleEntityNotFound(_0x59df25,null))[_0x4926('0x40')](removeEntity(_0x59df25,null))[_0x4926('0x44')](handleError(_0x59df25,null));};exports[_0x4926('0x59')]=function(_0x3180ae,_0x328380){return db[_0x4926('0x2c')][_0x4926('0x59')]()['then'](respondWithResult(_0x328380,null))[_0x4926('0x44')](handleError(_0x328380,null));};exports[_0x4926('0x5a')]=function(_0x17a414,_0x21207f){var _0x5321cc=_0x17a414[_0x4926('0x4f')];return db[_0x4926('0x2c')][_0x4926('0x47')]({'where':{'id':_0x17a414[_0x4926('0x4a')]['id']}})[_0x4926('0x40')](handleEntityNotFound(_0x21207f,null))['then'](function(_0x8f68cf){if(_0x8f68cf){return db['sequelize'][_0x4926('0x5b')](function(_0x129405){return db[_0x4926('0x56')][_0x4926('0x58')]({'where':{'userProfileId':_0x17a414['params']['id'],'sectionId':_[_0x4926('0x2b')](_0x5321cc,function(_0x5854ae){return _0x5854ae['sectionId'];})},'transaction':_0x129405})[_0x4926('0x40')](function(){var _0x2f60f0=_[_0x4926('0x2b')](_0x5321cc,function(_0x28b118){_0x28b118[_0x4926('0x5c')]=_0x17a414[_0x4926('0x4a')]['id'];return _0x28b118;});var _0x564e51=[];return BPromise[_0x4926('0x52')](_0x2f60f0,function(_0x25a345){return db[_0x4926('0x56')][_0x4926('0x48')](_0x25a345,{'include':[{'model':db['UserProfileResource'],'as':_0x4926('0x55')}],'raw':!![],'transaction':_0x129405})[_0x4926('0x40')](function(_0x1de139){_0x564e51[_0x4926('0x5d')](_0x1de139[_0x4926('0x4c')]({'plain':!![]}));});})['then'](function(){return _0x564e51;});});});}})['then'](function(_0x388370){return _0x388370;})[_0x4926('0x40')](respondWithResult(_0x21207f,null))[_0x4926('0x44')](handleError(_0x21207f,null));};exports[_0x4926('0x5e')]=function(_0x522b61,_0x1fad14){var _0x3d788b;return db[_0x4926('0x2c')][_0x4926('0x47')]({'where':{'id':_0x522b61[_0x4926('0x4a')]['id']},'attributes':['id',_0x4926('0x28')]})[_0x4926('0x40')](handleEntityNotFound(_0x1fad14,null))[_0x4926('0x40')](function(_0x36a782){if(_0x36a782){_0x3d788b=_0x36a782;return db[_0x4926('0x56')][_0x4926('0x58')]({'where':{'userProfileId':_0x522b61[_0x4926('0x4a')]['id'],'sectionId':_0x522b61[_0x4926('0x31')][_0x4926('0x5f')]}});}})[_0x4926('0x40')](function(){return _0x3d788b;})[_0x4926('0x40')](respondWithStatusCode(_0x1fad14,null))[_0x4926('0x44')](handleError(_0x1fad14,null));};exports[_0x4926('0x60')]=function(_0x4ae357,_0x2889c1){var _0x30bb83=[];var _0x3f9198=[];return db['UserProfileSection'][_0x4926('0x42')]({'where':{'userProfileId':_0x4ae357[_0x4926('0x4a')]['id']},'raw':!![]})[_0x4926('0x40')](function(_0x152dbf){_0x30bb83=_[_0x4926('0x3f')](_0x152dbf,function(_0x18aa37){return _0x18aa37[_0x4926('0x61')]===0x1||_[_0x4926('0x62')]([0x3eb,0x709],_0x18aa37[_0x4926('0x54')]);});if(!_[_0x4926('0x63')](_0x30bb83)){return _[_0x4926('0x2b')](_0x30bb83,function(_0x45d7c3){return _0x45d7c3['sectionId'];});}else{return;}})['then'](function(_0x162d9c){if(_0x162d9c)_0x3f9198=_0x162d9c;if(_['includes'](_0x3f9198,0x64)){var _0x140eba=_[_0x4926('0x47')](_0x30bb83,{'sectionId':0x64});return hasDefaultDashboard(_0x140eba)['then'](function(_0x3818e4){return _[_0x4926('0x2b')](_0x30bb83,function(_0x246db8){if(_0x246db8[_0x4926('0x54')]===0x64){_0x246db8[_0x4926('0x64')]=_0x3818e4;}return _0x246db8;});});}else{return;}})['then'](function(_0x50141a){if(_0x50141a)_0x30bb83=_0x50141a;if(_[_0x4926('0x62')](_0x3f9198,0x3eb)){var _0x1314b7=_[_0x4926('0x47')](_0x30bb83,{'sectionId':0x3eb});return getCustomDashboards(_0x1314b7)['then'](function(_0x16fe37){return _['map'](_0x30bb83,function(_0x28385a){if(_0x1314b7[_0x4926('0x61')]){if(_0x28385a[_0x4926('0x54')]===0x3eb){_0x28385a[_0x4926('0x64')]=_0x16fe37;}}else{if(_0x28385a[_0x4926('0x54')]===0x64){_0x28385a[_0x4926('0x64')]=_0x16fe37;}}return _0x28385a;});});}else{return;}})[_0x4926('0x40')](function(_0x4d6b56){if(_0x4d6b56)_0x30bb83=_0x4d6b56;if(_[_0x4926('0x62')](_0x3f9198,0x709)){var _0x3ae52e=_[_0x4926('0x47')](_0x30bb83,{'sectionId':0x709});return getPlugins(_0x3ae52e)['then'](function(_0x8d3b96){if(_0x3ae52e[_0x4926('0x61')]){return _[_0x4926('0x2b')](_0x30bb83,function(_0x49fb63){if(_0x49fb63[_0x4926('0x54')]===0x709){_0x49fb63[_0x4926('0x64')]=_0x8d3b96;}return _0x49fb63;});}else{var _0x35690d={'sectionId':0x76c,'enabled':0x1,'subsections':_0x8d3b96};var _0xecac48=_[_0x4926('0x2b')](_0x30bb83);_0xecac48[_0x4926('0x5d')](_0x35690d);return _0xecac48;}});}else{return;}})['then'](function(_0x345922){if(_0x345922)_0x30bb83=_0x345922;return _[_0x4926('0x3f')](_0x30bb83,[_0x4926('0x61'),0x1]);})[_0x4926('0x40')](respondWithResult(_0x2889c1,null))[_0x4926('0x44')](handleError(_0x2889c1,null));};function hasDefaultDashboard(_0x20a068){var _0x3e4da9=[0x65];return new BPromise(function(_0x3ba12b,_0x5bae2b){try{if(_0x20a068[_0x4926('0x53')]){_0x3ba12b(_0x3e4da9);}else{return db['UserProfileResource'][_0x4926('0x65')]({'where':{'sectionId':_0x20a068['id']},'raw':!![]})['then'](function(_0x2c9f29){_0x2c9f29?_0x3ba12b(_0x3e4da9):_0x3ba12b();});}}catch(_0x2d5590){_0x5bae2b(_0x2d5590);}});}function getCustomDashboards(_0x1b01d3){var _0x1d8424=[];return new BPromise(function(_0x2458a5,_0x2aedb7){try{if(_0x1b01d3[_0x4926('0x53')]){return db[_0x4926('0x66')]['findAll']({'raw':!![]})[_0x4926('0x40')](function(_0x48230a){_0x48230a['forEach'](function(_0x2f524c){_0x1d8424[_0x4926('0x5d')](_0x2f524c['id']+0x1869f);});_0x2458a5(_0x1d8424);});}else{return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x1b01d3['id']},'raw':!![]})['then'](function(_0x5d7c70){_0x5d7c70[_0x4926('0x67')](function(_0x1edfe3){_0x1d8424[_0x4926('0x5d')](_0x1edfe3['resourceId']+0x1869f);});_0x2458a5(_0x1d8424);});}}catch(_0x4011d7){_0x2aedb7(_0x4011d7);}});}function getPlugins(_0x5d6aa0){var _0x2290db=[];return new BPromise(function(_0x4dd23b,_0x2c62e7){try{if(_0x5d6aa0[_0x4926('0x53')]){return db[_0x4926('0x68')][_0x4926('0x42')]({'raw':!![]})[_0x4926('0x40')](function(_0x5a3bcf){_0x5a3bcf[_0x4926('0x67')](function(_0x1ecf6e){_0x2290db[_0x4926('0x5d')](_0x1ecf6e['id']+0x15b38);});_0x4dd23b(_0x2290db);});}else{return db[_0x4926('0x57')][_0x4926('0x42')]({'where':{'sectionId':_0x5d6aa0['id']},'raw':!![]})['then'](function(_0x5bf140){_0x5bf140[_0x4926('0x67')](function(_0x26c5d3){_0x2290db['push'](_0x26c5d3['resourceId']+0x15b38);});_0x4dd23b(_0x2290db);});}}catch(_0x2d4d46){_0x2c62e7(_0x2d4d46);}});}exports[_0x4926('0x69')]=function(_0x3f2f37,_0x5d1adb){return db['UserProfile'][_0x4926('0x47')]({'where':{'id':_0x3f2f37['params']['id']}})[_0x4926('0x40')](handleEntityNotFound(_0x5d1adb,null))[_0x4926('0x40')](function(_0x182039){if(_0x182039){return db[_0x4926('0x51')]['transaction'](function(_0x12d9a3){return db[_0x4926('0x56')][_0x4926('0x42')]({'where':{'userProfileId':_0x3f2f37[_0x4926('0x4a')]['id']},'attributes':['id'],'raw':!![]})[_0x4926('0x40')](function(_0xa4950e){if(_0xa4950e){return db[_0x4926('0x56')][_0x4926('0x58')]({'where':{'userProfileId':_0x3f2f37['params']['id'],'id':_[_0x4926('0x2b')](_0xa4950e,function(_0x1b78b7){return _0x1b78b7['id'];})},'transaction':_0x12d9a3});}})[_0x4926('0x40')](function(_0x1e7ce2){var _0x5a3146=_[_0x4926('0x2b')](_0x3f2f37[_0x4926('0x4f')],function(_0x3068cb){_0x3068cb['userProfileId']=_0x3f2f37['params']['id'];return _0x3068cb;});return db[_0x4926('0x56')]['bulkCreate'](_0x5a3146,{'raw':!![],'transaction':_0x12d9a3});})[_0x4926('0x40')](function(_0x5d8516){var _0x3a0a1a=_[_0x4926('0x3f')](_[_0x4926('0x2b')](_0x5d8516,function(_0x10072b){return _0x10072b[_0x4926('0x4c')]({'plain':!![]});}),{'includeAll':![]});if(_0x3a0a1a){return db[_0x4926('0x56')][_0x4926('0x42')]({'where':{'userProfileId':_0x3f2f37['params']['id'],'sectionId':_[_0x4926('0x2b')](_0x3a0a1a,function(_0xde230e){return _0xde230e['sectionId'];})},'attributes':['id',_0x4926('0x54')],'raw':!![]})['then'](function(_0x108f2c){var _0x296a0c=_[_0x4926('0x2b')](_0x3f2f37[_0x4926('0x4f')],function(_0x4bfc3a){_0x4bfc3a[_0x4926('0x5c')]=_0x3f2f37[_0x4926('0x4a')]['id'];return _0x4bfc3a;});return db[_0x4926('0x57')][_0x4926('0x6a')](_0x296a0c,{'raw':!![],'transaction':_0x12d9a3});});}})[_0x4926('0x44')](handleError(_0x5d1adb,null));});}})[_0x4926('0x40')](function(_0x574517){var _0x23e99c=_[_0x4926('0x2b')](_0x574517,function(_0x556a78){return _0x556a78['get']({'plain':!![]});});})[_0x4926('0x40')](respondWithResult(_0x5d1adb,null))['catch'](handleError(_0x5d1adb,null));};exports['removeResources']=function(_0xaa7b6d,_0x28309e,_0x23c770){return db[_0x4926('0x2c')]['find']({'where':{'id':_0xaa7b6d[_0x4926('0x4a')]['id']}})['then'](handleEntityNotFound(_0x28309e,null))['then'](function(_0x96341a){if(_0x96341a){return _0x96341a['removeResources'](_0xaa7b6d[_0x4926('0x31')][_0x4926('0x5f')]);}})[_0x4926('0x40')](respondWithStatusCode(_0x28309e,null))[_0x4926('0x44')](handleError(_0x28309e,null));};exports[_0x4926('0x6b')]=function(_0x452fe9,_0x5426b8){var _0x41085d={};if(!_0x452fe9[_0x4926('0x31')][_0x4926('0x6c')])throw new Error(_0x4926('0x6d'));if(!_0x452fe9[_0x4926('0x31')][_0x4926('0x38')](_0x4926('0x39'))){_0x41085d['limit']=qs['limit'](_0x452fe9['query'][_0x4926('0x21')]);_0x41085d[_0x4926('0x1e')]=qs[_0x4926('0x1e')](_0x452fe9[_0x4926('0x31')][_0x4926('0x1e')]);}return db[_0x4926('0x2c')][_0x4926('0x47')]({'where':{'id':_0x452fe9[_0x4926('0x4a')]['id']}})[_0x4926('0x40')](function(_0x2d0387){if(!_0x2d0387)throw new Error(_0x4926('0x6e')+_0x452fe9[_0x4926('0x4a')]['id']);return db['UserProfile']['getResources'](_0x452fe9);})[_0x4926('0x40')](respondWithFilteredResult(_0x5426b8,_0x41085d))[_0x4926('0x44')](handleError(_0x5426b8,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 2cad00a..364c722 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 _0x5ff9=['../../mysqldb','setMaxListeners','save','emit','hasOwnProperty','exports','events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5ff9,0xa0));var _0x95ff=function(_0x7f6fdf,_0x285285){_0x7f6fdf=_0x7f6fdf-0x0;var _0x1f469d=_0x5ff9[_0x7f6fdf];return _0x1f469d;};'use strict';var EventEmitter=require(_0x95ff('0x0'));var UserProfile=require(_0x95ff('0x1'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x95ff('0x2')](0x0);var events={'afterCreate':_0x95ff('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3d1ce4){return function(_0x58eb5d,_0x5b1bee,_0x174f9d){UserProfileEvents[_0x95ff('0x4')](_0x3d1ce4+':'+_0x58eb5d['id'],_0x58eb5d);UserProfileEvents['emit'](_0x3d1ce4,_0x58eb5d);_0x174f9d(null);};}for(var e in events){if(events[_0x95ff('0x5')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0x95ff('0x6')]=UserProfileEvents; \ No newline at end of file +var _0xe928=['exports','events','../../mysqldb','UserProfile','save','remove','emit','hasOwnProperty','hook'];(function(_0x213508,_0x5f3ff0){var _0x1b0363=function(_0x19bb1f){while(--_0x19bb1f){_0x213508['push'](_0x213508['shift']());}};_0x1b0363(++_0x5f3ff0);}(_0xe928,0x145));var _0x8e92=function(_0x41b85a,_0x38d97f){_0x41b85a=_0x41b85a-0x0;var _0x1f7b14=_0xe928[_0x41b85a];return _0x1f7b14;};'use strict';var EventEmitter=require(_0x8e92('0x0'));var UserProfile=require(_0x8e92('0x1'))['db'][_0x8e92('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8e92('0x3'),'afterUpdate':'update','afterDestroy':_0x8e92('0x4')};function emitEvent(_0x44fc50){return function(_0x1b9cbe,_0x1f6ce2,_0x59de3d){UserProfileEvents[_0x8e92('0x5')](_0x44fc50+':'+_0x1b9cbe['id'],_0x1b9cbe);UserProfileEvents['emit'](_0x44fc50,_0x1b9cbe);_0x59de3d(null);};}for(var e in events){if(events[_0x8e92('0x6')](e)){var event=events[e];UserProfile[_0x8e92('0x7')](e,emitEvent(event));}}module[_0x8e92('0x8')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 55aa3cb..43ed6d8 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 _0xf79a=['faxaccounts','FaxAccount','internalroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','User','agent','Telephones','role','queue','VoiceQueue','inbound','QueueCampaigns','VoiceMusicOnHold','VoiceChanSpy','voiceprefixes','ivrcampaigns','Campaign','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','openchannelaccounts','OpenchannelAccount','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','voicequeues','VoiceQueues','users','agents','telephones','Users','admin','user','ZendeskAccount','salesforceaccounts','freshdeskaccounts','FreshdeskAccount','SugarcrmAccount','deskaccounts','zohoaccounts','ZohoAccount','cannedanswers','CannedAnswer','Disposition','customdashboards','Dashboard','intervals','Interval','Pause','scheduler','Schedule','sounds','tags','Tag','Template','triggers','Trigger','Trunk','variables','Variable','extractedreports','Reports','reportId','AnalyticMetric','charAt','slice','QueryTypes','select','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','where','query','toString','UserProfile','user_profiles','raw','section','mergeResources','Invalid\x20section\x20\x27','push','UserProfileSection','find','params','all','ignore','isEmpty','union','length','rawAttributes','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','offset','pick','merge','key','VIRTUAL','foreignKey','forEach','autoAssociation','includeAll','reportType','default','DefaultReports','count','rows','include','Tags','color','tag','ThroughTags','openTabs','true','chat','sms','fax','mail','openchannel','whatsapp','dataValues','lodash','./userProfile.attributes','../../components/parsers/qs','exports','models','filter','field','value','then','associatedResources','map','catch','model','findAll','name','resolve','UserProfileResource','AnalyticExtractedReport','type','resourceId','toLowerCase','squareprojects','childModel','SquareProject','odbc','SquareRecording','parentSections','SquareProjects','projectName','projects','contacts','CmContact','Lists','ListId','lists','companies','CmCompany','globalcustomfields','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue'];(function(_0x3ae5e8,_0x4eb175){var _0x3b2b91=function(_0x3ff308){while(--_0x3ff308){_0x3ae5e8['push'](_0x3ae5e8['shift']());}};_0x3b2b91(++_0x4eb175);}(_0xf79a,0x14c));var _0xaf79=function(_0x2cbb3f,_0x3cd395){_0x2cbb3f=_0x2cbb3f-0x0;var _0x1bcbaa=_0xf79a[_0x2cbb3f];return _0x1bcbaa;};'use strict';var _=require(_0xaf79('0x0'));var attributes=require(_0xaf79('0x1'));var qs=require(_0xaf79('0x2'));var squel=require('squel');module[_0xaf79('0x3')]=function(_0x3dfabc){var _0x1baaad=_0x3dfabc[_0xaf79('0x4')];function _0x141e95(_0x8fb88f,_0x25df80){return new Promise(function(_0x841f53,_0x2e54bd){if(!_0x25df80)return _0x841f53(null);var _0x54f773=_0x25df80[_0xaf79('0x5')]?{[_0x25df80[_0xaf79('0x5')][_0xaf79('0x6')]]:_0x25df80[_0xaf79('0x5')][_0xaf79('0x7')]}:undefined;return _0x1baaad[_0x8fb88f]['findAll']({'where':_0x54f773,'raw':!![]})[_0xaf79('0x8')](function(_0x55f9eb){_0x25df80[_0xaf79('0x9')]=_[_0xaf79('0xa')](_0x55f9eb,'id');_0x841f53(_0x25df80);})[_0xaf79('0xb')](function(_0x257b9d){_0x2e54bd(_0x257b9d);});});}function _0x332aa7(_0x5e5542,_0x1fd867){return new Promise(function(_0x1dedf0,_0x2d0aa4){var _0x50b9bf=_0x5e5542['filter']?{[_0x5e5542[_0xaf79('0x5')][_0xaf79('0x6')]]:_0x5e5542['filter']['value']}:undefined;return _0x1baaad[_0x5e5542[_0xaf79('0xc')]][_0xaf79('0xd')]({'where':_0x50b9bf,'raw':!![]})[_0xaf79('0x8')](function(_0x5d1127){_0x1fd867[_0xaf79('0x9')]=_[_0xaf79('0xa')](_0x5d1127,function(_0xbd7bd1){return _0xbd7bd1[_0xaf79('0xe')];});_0x1dedf0(_0x1fd867);})[_0xaf79('0xb')](function(_0x17c9aa){_0x2d0aa4(_0x17c9aa);});});}function _0x1ccd95(_0x2f5708,_0xfb0115,_0x4d1589){if(!_0xfb0115)return Promise[_0xaf79('0xf')](null);return new Promise(function(_0x45e2b8,_0x173294){return _0x1baaad[_0xaf79('0x10')][_0xaf79('0xd')]({'where':{'sectionId':_0xfb0115['id']},'raw':!![]})['then'](function(_0x20925b){if(_0x2f5708['field']&&_0x2f5708[_0xaf79('0x6')]!=='id'){_0xfb0115[_0xaf79('0x9')]=_['map'](_0x20925b,function(_0x27b31e){return _0x27b31e[_0x2f5708[_0xaf79('0x6')]];});}else{if(_0x4d1589===_0xaf79('0x11')){_0xfb0115['associatedResources']=_[_0xaf79('0xa')](_0x20925b,function(_0x264cd2){return{'id':_0x264cd2['resourceId'],'type':_0x264cd2[_0xaf79('0x12')]};});}else{_0xfb0115[_0xaf79('0x9')]=_['map'](_0x20925b,function(_0x592c0c){return _0x592c0c[_0xaf79('0x13')];});}}_0x45e2b8(_0xfb0115);})['catch'](function(_0x5ee750){_0x173294(_0x5ee750);});});}function _0x31768b(_0x13990d,_0x5453ef){var _0x5668c2={'parentSections':[]};switch(_0x13990d[_0xaf79('0x14')]()){case _0xaf79('0x15'):_0x5668c2[_0xaf79('0x16')]=_0xaf79('0x17');break;case _0xaf79('0x18'):_0x5668c2[_0xaf79('0x16')]='SquareOdbc';break;case'squarerecordings':_0x5668c2['childModel']=_0xaf79('0x19');_0x5668c2[_0xaf79('0x1a')]=[{'name':_0xaf79('0x1b'),'field':_0xaf79('0xe'),'foreignKey':_0xaf79('0x1c')}];break;case _0xaf79('0x1d'):_0x5668c2[_0xaf79('0x16')]='JscriptyProject';break;case _0xaf79('0x1e'):_0x5668c2[_0xaf79('0x16')]=_0xaf79('0x1f');_0x5668c2['parentSections']=[{'name':_0xaf79('0x20'),'field':'id','foreignKey':_0xaf79('0x21')}];break;case _0xaf79('0x22'):_0x5668c2[_0xaf79('0x16')]='CmList';break;case _0xaf79('0x23'):_0x5668c2[_0xaf79('0x16')]=_0xaf79('0x24');break;case _0xaf79('0x25'):_0x5668c2[_0xaf79('0x16')]='CmCustomField';break;case _0xaf79('0x26'):_0x5668c2[_0xaf79('0x16')]=_0xaf79('0x27');break;case _0xaf79('0x28'):_0x5668c2['childModel']=_0xaf79('0x29');break;case _0xaf79('0x2a'):_0x5668c2['childModel']=_0xaf79('0x2b');break;case _0xaf79('0x2c'):_0x5668c2[_0xaf79('0x16')]=_0xaf79('0x2d');break;case'inboundroutes':case _0xaf79('0x2e'):case'outboundroutes':_0x5668c2['childModel']=_0xaf79('0x2f');break;case _0xaf79('0x30'):_0x5668c2[_0xaf79('0x16')]=_0xaf79('0x31');break;case _0xaf79('0x32'):_0x5668c2[_0xaf79('0x16')]=_0xaf79('0x33');break;case _0xaf79('0x34'):_0x5668c2[_0xaf79('0x16')]=_0xaf79('0x35');_0x5668c2[_0xaf79('0x1a')]=[{'name':_0xaf79('0x36'),'field':'name','foreignKey':_0xaf79('0x37'),'model':_0xaf79('0x38'),'filter':{'field':'role','value':[_0xaf79('0x39')]}},{'name':_0xaf79('0x3a'),'field':_0xaf79('0xe'),'foreignKey':_0xaf79('0x37'),'model':_0xaf79('0x38'),'filter':{'field':_0xaf79('0x3b'),'value':['telephone']}},{'name':'VoiceQueues','field':_0xaf79('0xe'),'foreignKey':_0xaf79('0x3c'),'model':_0xaf79('0x3d'),'filter':{'field':_0xaf79('0x12'),'value':[_0xaf79('0x3e')]}},{'name':_0xaf79('0x3f'),'field':'name','foreignKey':_0xaf79('0x3c'),'model':'VoiceQueue','filter':{'field':'type','value':['outbound']}}];break;case'musiconholds':_0x5668c2[_0xaf79('0x16')]=_0xaf79('0x40');break;case'chanspies':_0x5668c2[_0xaf79('0x16')]=_0xaf79('0x41');break;case _0xaf79('0x42'):_0x5668c2[_0xaf79('0x16')]='VoicePrefix';break;case _0xaf79('0x43'):_0x5668c2[_0xaf79('0x16')]=_0xaf79('0x44');break;case'mailqueues':_0x5668c2[_0xaf79('0x16')]=_0xaf79('0x45');break;case _0xaf79('0x46'):_0x5668c2[_0xaf79('0x16')]=_0xaf79('0x47');break;case _0xaf79('0x48'):_0x5668c2[_0xaf79('0x16')]=_0xaf79('0x49');break;case _0xaf79('0x4a'):_0x5668c2[_0xaf79('0x16')]='OpenchannelQueue';break;case _0xaf79('0x4b'):_0x5668c2[_0xaf79('0x16')]=_0xaf79('0x4c');break;case'smsqueues':_0x5668c2[_0xaf79('0x16')]='SmsQueue';break;case _0xaf79('0x4d'):_0x5668c2[_0xaf79('0x16')]=_0xaf79('0x4e');break;case _0xaf79('0x4f'):_0x5668c2[_0xaf79('0x16')]=_0xaf79('0x50');break;case _0xaf79('0x51'):_0x5668c2['childModel']=_0xaf79('0x52');break;case _0xaf79('0x53'):_0x5668c2['childModel']='Team';break;case _0xaf79('0x54'):case'queuecampaigns':_0x5668c2['childModel']=_0xaf79('0x3d');if(_0x5453ef){_0x5668c2['parentSections']=[{'name':_0xaf79('0x55')},{'name':_0xaf79('0x3f')}];}break;case _0xaf79('0x56'):case _0xaf79('0x57'):case _0xaf79('0x58'):_0x5668c2[_0xaf79('0x16')]=_0xaf79('0x38');if(_0x5453ef){_0x5668c2[_0xaf79('0x1a')]=[{'name':_0xaf79('0x59'),'filter':{'field':_0xaf79('0x3b'),'value':[_0xaf79('0x5a'),_0xaf79('0x5b')]},'ignore':!![]},{'name':_0xaf79('0x36')},{'name':_0xaf79('0x3a')}];}break;case'zendeskaccounts':_0x5668c2[_0xaf79('0x16')]=_0xaf79('0x5c');break;case _0xaf79('0x5d'):_0x5668c2[_0xaf79('0x16')]='SalesforceAccount';break;case _0xaf79('0x5e'):_0x5668c2['childModel']=_0xaf79('0x5f');break;case'sugarcrmaccounts':_0x5668c2[_0xaf79('0x16')]=_0xaf79('0x60');break;case _0xaf79('0x61'):_0x5668c2[_0xaf79('0x16')]='DeskAccount';break;case _0xaf79('0x62'):_0x5668c2[_0xaf79('0x16')]=_0xaf79('0x63');break;case'vtigeraccounts':_0x5668c2['childModel']='User';break;case _0xaf79('0x64'):_0x5668c2['childModel']=_0xaf79('0x65');break;case'dispositions':_0x5668c2[_0xaf79('0x16')]=_0xaf79('0x66');break;case _0xaf79('0x67'):_0x5668c2['childModel']=_0xaf79('0x68');break;case _0xaf79('0x69'):_0x5668c2[_0xaf79('0x16')]=_0xaf79('0x6a');break;case'pauses':_0x5668c2[_0xaf79('0x16')]=_0xaf79('0x6b');break;case _0xaf79('0x6c'):_0x5668c2[_0xaf79('0x16')]=_0xaf79('0x6d');break;case _0xaf79('0x6e'):_0x5668c2[_0xaf79('0x16')]='Sound';break;case _0xaf79('0x6f'):_0x5668c2[_0xaf79('0x16')]=_0xaf79('0x70');break;case'templates':_0x5668c2[_0xaf79('0x16')]=_0xaf79('0x71');break;case _0xaf79('0x72'):_0x5668c2[_0xaf79('0x16')]=_0xaf79('0x73');break;case'trunks':_0x5668c2['childModel']=_0xaf79('0x74');break;case _0xaf79('0x75'):_0x5668c2[_0xaf79('0x16')]=_0xaf79('0x76');break;case'plugins':_0x5668c2[_0xaf79('0x16')]='Plugin';break;case _0xaf79('0x77'):_0x5668c2[_0xaf79('0x16')]=_0xaf79('0x11');_0x5668c2[_0xaf79('0x1a')]=[{'name':_0xaf79('0x78'),'field':'id','foreignKey':_0xaf79('0x79')}];break;case'metrics':_0x5668c2['childModel']=_0xaf79('0x7a');break;}return _0x5668c2;}function _0xd5e195(_0x1e1a18,_0x501ed4){var _0x456080=_0x1e1a18[_0xaf79('0x7b')](0x0)['toUpperCase']()+_0x1e1a18[_0xaf79('0x7c')](0x1);var _0x107369={'type':_0x1baaad['Sequelize'][_0xaf79('0x7d')]['SELECT'],'raw':!![]};return new Promise(function(_0x142281,_0x41fa64){var _0x160031=squel[_0xaf79('0x7e')]()[_0xaf79('0x6')](_0xaf79('0x7f')+_0x456080+_0xaf79('0x80'),'id')[_0xaf79('0x6')](_0xaf79('0x81'))[_0xaf79('0x82')](_0xaf79('0x83')+_0x1e1a18+_0xaf79('0x84'),'ui')[_0xaf79('0x85')]('ui.UserId\x20=\x20?',_0x501ed4['id']);return _0x1baaad['sequelize'][_0xaf79('0x86')](_0x160031[_0xaf79('0x87')](),_0x107369)[_0xaf79('0x8')](function(_0x2857fa){_0x501ed4[_0x456080+'OpenTabs']=_0x2857fa;_0x142281(_0x2857fa);})[_0xaf79('0xb')](function(_0x213b3a){_0x41fa64(_0x213b3a);});});}return _0x3dfabc['define'](_0xaf79('0x88'),attributes,{'tableName':_0xaf79('0x89'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x6de90){var _0x97e643={'raw':_0x6de90[_0xaf79('0x86')][_0xaf79('0x8a')],'where':{}};var _0x4db96b={};var _0x2bdad1={'count':0x0,'rows':[]};var _0x5ddd05=_0x6de90['query'][_0xaf79('0x8b')];var _0x567b18=_0x6de90[_0xaf79('0x86')][_0xaf79('0x8c')]||![];var _0x14bf1f=_0x31768b(_0x5ddd05,_0x567b18);if(!_0x14bf1f[_0xaf79('0x16')])throw new Error(_0xaf79('0x8d')+_0x5ddd05+'\x27');var _0x293f38=[{'name':_0x5ddd05}];if(!_['isEmpty'](_0x14bf1f[_0xaf79('0x1a')]))_0x293f38=_0x14bf1f[_0xaf79('0x1a')];var _0x171616=[];for(var _0x3d2f1d=0x0;_0x3d2f1d<_0x293f38['length'];_0x3d2f1d++){_0x171616[_0xaf79('0x8e')](_0x1baaad[_0xaf79('0x8f')][_0xaf79('0x90')]({'where':{'userProfileId':_0x6de90[_0xaf79('0x91')]['id'],'name':_0x293f38[_0x3d2f1d][_0xaf79('0xe')]},'raw':!![]}));}return Promise[_0xaf79('0x92')](_0x171616)[_0xaf79('0x8')](function(_0x14fd13){var _0x24a93e=_[_0xaf79('0x5')](_0x14fd13,function(_0x4b8408){return _0x4b8408?_0x4b8408:undefined;});var _0x300efd=_['filter'](_0x293f38,[_0xaf79('0x93'),!![]]);var _0x3da73b=_[_0xaf79('0x94')](_0x24a93e)&&_[_0xaf79('0x94')](_0x300efd)?null:_[_0xaf79('0x95')](_0x300efd,_0x24a93e);if(!_0x3da73b)return null;var _0x485488=[];for(var _0x353ac6=0x0;_0x353ac6<_0x3da73b[_0xaf79('0x96')];_0x353ac6++){var _0x3b3473=_[_0xaf79('0x90')](_0x293f38,function(_0x22d46a){return _0x3da73b[_0x353ac6]?_0x22d46a[_0xaf79('0xe')]===_0x3da73b[_0x353ac6][_0xaf79('0xe')]:null;});if(_0x3b3473){if(_0x3da73b[_0x353ac6][_0xaf79('0x93')]){_0x485488[_0xaf79('0x8e')](_0x141e95(_0x14bf1f[_0xaf79('0x16')],_0x3da73b[_0x353ac6]));}else{if(!_0x3da73b[_0x353ac6]['autoAssociation']){_0x485488[_0xaf79('0x8e')](_0x1ccd95(_0x3b3473,_0x3da73b[_0x353ac6],_0x14bf1f[_0xaf79('0x16')]));}else{if(_0x3b3473[_0xaf79('0xc')]){_0x485488['push'](_0x332aa7(_0x3b3473,_0x3da73b[_0x353ac6]));}}}}}return Promise[_0xaf79('0x92')](_0x485488);})['then'](function(_0x1c8db3){var _0x364cab=_0x1c8db3;var _0x1c0462=null;if(_0x364cab){_0x1c0462=_0x364cab[_0xaf79('0x96')]===0x1?_0x364cab[0x0]:null;}if(!_0x1c0462&&!_0x364cab)return _0x2bdad1;var _0x262e3f=_0x1baaad[_0x14bf1f[_0xaf79('0x16')]][_0xaf79('0x97')];_0x4db96b[_0xaf79('0xc')]=_[_0xaf79('0x98')](_0x262e3f);_0x4db96b[_0xaf79('0x86')]=_[_0xaf79('0x98')](_0x6de90[_0xaf79('0x86')]);_0x4db96b[_0xaf79('0x99')]=_[_0xaf79('0x9a')](_0x4db96b['model'],_0x4db96b[_0xaf79('0x86')]);_0x97e643['attributes']=_[_0xaf79('0x9a')](_0x4db96b[_0xaf79('0xc')],qs[_0xaf79('0x9b')](_0x6de90[_0xaf79('0x86')][_0xaf79('0x9b')]));_0x97e643[_0xaf79('0x9c')]=_0x97e643[_0xaf79('0x9c')]['length']?_0x97e643['attributes']:_0x4db96b[_0xaf79('0xc')];if(!_0x6de90['query'][_0xaf79('0x9d')](_0xaf79('0x9e'))){_0x97e643['limit']=qs[_0xaf79('0x9f')](_0x6de90[_0xaf79('0x86')][_0xaf79('0x9f')]);_0x97e643['offset']=qs[_0xaf79('0xa0')](_0x6de90[_0xaf79('0x86')][_0xaf79('0xa0')]);}_0x97e643['order']=qs['sort'](_0x6de90[_0xaf79('0x86')]['sort']);_0x97e643[_0xaf79('0x85')]=qs[_0xaf79('0x99')](_[_0xaf79('0xa1')](_0x6de90['query'],_0x4db96b['filters']));if(_0x6de90[_0xaf79('0x86')][_0xaf79('0x5')]){_0x97e643[_0xaf79('0x85')]=_[_0xaf79('0xa2')](_0x97e643[_0xaf79('0x85')],{'$or':_['map'](_0x262e3f,function(_0x35b0ee){if(_0x35b0ee[_0xaf79('0x12')][_0xaf79('0xa3')]!==_0xaf79('0xa4')){var _0x734014={};_0x734014[_0x35b0ee['field']]={'$like':'%'+_0x6de90[_0xaf79('0x86')][_0xaf79('0x5')]+'%'};return _0x734014;}})});}var _0x31995a=[];var _0x17ef1a=null;var _0x1e2e28={};if(_0x1c0462){_0x17ef1a=_[_0xaf79('0x90')](_0x293f38,[_0xaf79('0xe'),_0x1c0462[_0xaf79('0xe')]]);if(_0x17ef1a[_0xaf79('0x6')]){_0x1e2e28={};if(_0x14bf1f[_0xaf79('0x16')]===_0xaf79('0x11')){_0x1e2e28[_0x17ef1a['foreignKey']]=_['map'](_0x1c0462[_0xaf79('0x9')],'id');}else{_0x1e2e28[_0x17ef1a['foreignKey']]=_0x1c0462[_0xaf79('0x9')];}_0x31995a[_0xaf79('0x8e')](_0x1e2e28);}else{_0x97e643[_0xaf79('0x85')]['id']=_0x1c0462['associatedResources'];}}else{for(var _0x214776=0x0;_0x214776<_0x364cab[_0xaf79('0x96')];_0x214776++){_0x17ef1a=_['find'](_0x293f38,[_0xaf79('0xe'),_0x364cab[_0x214776][_0xaf79('0xe')]]);if(_0x17ef1a[_0xaf79('0x6')]){_0x1e2e28={};_0x1e2e28[_0x17ef1a[_0xaf79('0xa5')]]=_0x364cab[_0x214776][_0xaf79('0x9')];_0x31995a[_0xaf79('0x8e')](_0x1e2e28);}else{if(!_0x97e643['where']['id'])_0x97e643[_0xaf79('0x85')]['id']=[];_0x364cab[_0x214776]['associatedResources'][_0xaf79('0xa6')](function(_0x2bb754){_0x97e643[_0xaf79('0x85')]['id']['push'](_0x2bb754);});}}}if(!_[_0xaf79('0x94')](_0x31995a)){_0x97e643['where']=_[_0xaf79('0xa2')](_0x97e643[_0xaf79('0x85')],{'$and':{'$or':_0x31995a}});}_0x97e643=_[_0xaf79('0xa2')]({},_0x97e643,_0x6de90['options']);if(_0x1c0462&&!_0x1c0462[_0xaf79('0xa7')]&&_0x14bf1f[_0xaf79('0x16')]===_0xaf79('0x11')){if(_0x6de90[_0xaf79('0x86')][_0xaf79('0xa8')]){_0x97e643['include']=[{'all':!![]}];}return _0x1baaad[_0x14bf1f['childModel']]['findAll'](_0x97e643)[_0xaf79('0x8')](function(_0x7a3727){var _0x227057=[];_0x7a3727[_0xaf79('0xa6')](function(_0x26f59e){var _0x3d8663;switch(_0x26f59e[_0xaf79('0xa9')]){case _0xaf79('0xaa'):_0x3d8663=_['find'](_0x1c0462['associatedResources'],function(_0x5bcd3f){return _0x5bcd3f['id']===_0x26f59e[_0xaf79('0x79')]&&_0x5bcd3f[_0xaf79('0x12')]===_0xaf79('0xab');});break;case'custom':_0x3d8663=_[_0xaf79('0x90')](_0x1c0462[_0xaf79('0x9')],function(_0x31387d){return _0x31387d['id']===_0x26f59e[_0xaf79('0x79')]&&_0x31387d[_0xaf79('0x12')]==='CustomReports';});break;}if(_0x3d8663)_0x227057[_0xaf79('0x8e')](_0x26f59e);});_0x2bdad1[_0xaf79('0xac')]=_0x227057[_0xaf79('0x96')];_0x2bdad1[_0xaf79('0xad')]=_0x227057;return _0x2bdad1;});}else{return _0x1baaad[_0x14bf1f[_0xaf79('0x16')]]['count']({'where':_0x97e643[_0xaf79('0x85')]})[_0xaf79('0x8')](function(_0x31af2f){_0x2bdad1[_0xaf79('0xac')]=_0x31af2f;if(_0x6de90[_0xaf79('0x86')]['includeAll']){if(_0x14bf1f[_0xaf79('0x16')]==='CmContact'){_0x97e643[_0xaf79('0xae')]=[{'model':_0x1baaad[_0xaf79('0x70')],'as':_0xaf79('0xaf'),'attributes':['id','name',_0xaf79('0xb0')],'required':_0x6de90['query'][_0xaf79('0xb1')]?!![]:![]},{'model':_0x1baaad[_0xaf79('0x70')],'as':_0xaf79('0xb2'),'attributes':['id','name',_0xaf79('0xb0')],'through':_0x6de90['query'][_0xaf79('0xb1')]?{'attributes':[],'where':{'TagId':_0x6de90[_0xaf79('0x86')][_0xaf79('0xb1')]||undefined}}:{},'required':_0x6de90[_0xaf79('0x86')][_0xaf79('0xb1')]?!![]:![]}];}else{_0x97e643[_0xaf79('0xae')]=[{'all':!![]}];}}return _0x1baaad[_0x14bf1f['childModel']][_0xaf79('0xd')](_0x97e643);})[_0xaf79('0x8')](function(_0x52ccaa){_0x2bdad1[_0xaf79('0xad')]=_0x52ccaa;if(_0x5ddd05===_0xaf79('0x36')&&_0x6de90[_0xaf79('0x86')][_0xaf79('0xb3')]===_0xaf79('0xb4')){var _0x1024c4=[];for(var _0x355866=0x0;_0x355866<_0x2bdad1['rows'][_0xaf79('0x96')];_0x355866++){_0x1024c4[_0xaf79('0x8e')](_0xd5e195(_0xaf79('0xb5'),_0x2bdad1[_0xaf79('0xad')][_0x355866]['dataValues']));_0x1024c4['push'](_0xd5e195(_0xaf79('0xb6'),_0x2bdad1[_0xaf79('0xad')][_0x355866]['dataValues']));_0x1024c4[_0xaf79('0x8e')](_0xd5e195(_0xaf79('0xb7'),_0x2bdad1[_0xaf79('0xad')][_0x355866]['dataValues']));_0x1024c4[_0xaf79('0x8e')](_0xd5e195(_0xaf79('0xb8'),_0x2bdad1['rows'][_0x355866]['dataValues']));_0x1024c4[_0xaf79('0x8e')](_0xd5e195(_0xaf79('0xb9'),_0x2bdad1[_0xaf79('0xad')][_0x355866]['dataValues']));_0x1024c4[_0xaf79('0x8e')](_0xd5e195(_0xaf79('0xba'),_0x2bdad1['rows'][_0x355866][_0xaf79('0xbb')]));}return Promise[_0xaf79('0x92')](_0x1024c4)['then'](function(){return _0x2bdad1;});}return _0x2bdad1;});}});}}});}; \ No newline at end of file +var _0x0ddb=['params','all','isEmpty','union','ignore','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','offset','order','sort','where','key','VIRTUAL','foreignKey','merge','options','autoAssociation','includeAll','reportType','default','DefaultReports','custom','CustomReports','rows','count','include','Tags','color','tag','ThroughTags','openTabs','true','sms','dataValues','fax','mail','openchannel','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','squel','models','filter','field','value','findAll','then','map','catch','model','associatedResources','name','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','type','squareprojects','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','projects','contacts','CmContact','Lists','ListId','lists','CmList','companies','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','voicerecordings','VoiceRecording','Agents','membername','User','role','agent','Telephones','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','outbound','musiconholds','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappaccounts','teams','queuecampaigns','users','agents','admin','user','zendeskaccounts','ZendeskAccount','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','vtigeraccounts','cannedanswers','CannedAnswer','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','Pause','scheduler','Schedule','sounds','Sound','tags','Tag','templates','Template','triggers','trunks','Trunk','variables','plugins','Plugin','extractedreports','reportId','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','SELECT','select','ui.','InteractionId','from','user_has_','_interactions','ui.UserId\x20=\x20?','sequelize','query','toString','define','UserProfile','user_profiles','section','mergeResources','Invalid\x20section\x20\x27','length','push','UserProfileSection','find'];(function(_0x2160a9,_0x3cbd9e){var _0xa88cf7=function(_0x51ab6f){while(--_0x51ab6f){_0x2160a9['push'](_0x2160a9['shift']());}};_0xa88cf7(++_0x3cbd9e);}(_0x0ddb,0x1c4));var _0xb0dd=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0ddb[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xb0dd('0x0'));var attributes=require(_0xb0dd('0x1'));var qs=require(_0xb0dd('0x2'));var squel=require(_0xb0dd('0x3'));module['exports']=function(_0x27b74b){var _0x45e621=_0x27b74b[_0xb0dd('0x4')];function _0xf2994f(_0x4adc31,_0x3e9496){return new Promise(function(_0xa73b90,_0x3d9946){if(!_0x3e9496)return _0xa73b90(null);var _0x25bc68=_0x3e9496[_0xb0dd('0x5')]?{[_0x3e9496['filter'][_0xb0dd('0x6')]]:_0x3e9496[_0xb0dd('0x5')][_0xb0dd('0x7')]}:undefined;return _0x45e621[_0x4adc31][_0xb0dd('0x8')]({'where':_0x25bc68,'raw':!![]})[_0xb0dd('0x9')](function(_0x1ecb30){_0x3e9496['associatedResources']=_[_0xb0dd('0xa')](_0x1ecb30,'id');_0xa73b90(_0x3e9496);})[_0xb0dd('0xb')](function(_0x34177b){_0x3d9946(_0x34177b);});});}function _0x40a42b(_0x2f5359,_0x974e59){return new Promise(function(_0x48ef49,_0x8e990b){var _0x2126be=_0x2f5359[_0xb0dd('0x5')]?{[_0x2f5359[_0xb0dd('0x5')][_0xb0dd('0x6')]]:_0x2f5359['filter'][_0xb0dd('0x7')]}:undefined;return _0x45e621[_0x2f5359[_0xb0dd('0xc')]][_0xb0dd('0x8')]({'where':_0x2126be,'raw':!![]})[_0xb0dd('0x9')](function(_0x6be0fd){_0x974e59[_0xb0dd('0xd')]=_['map'](_0x6be0fd,function(_0x1e8849){return _0x1e8849[_0xb0dd('0xe')];});_0x48ef49(_0x974e59);})['catch'](function(_0x4013e4){_0x8e990b(_0x4013e4);});});}function _0xcf44b7(_0x5b8628,_0x57fd10,_0x57d42f){if(!_0x57fd10)return Promise[_0xb0dd('0xf')](null);return new Promise(function(_0x1bf6b5,_0x488dfa){return _0x45e621[_0xb0dd('0x10')][_0xb0dd('0x8')]({'where':{'sectionId':_0x57fd10['id']},'raw':!![]})['then'](function(_0x341f61){if(_0x5b8628[_0xb0dd('0x6')]&&_0x5b8628[_0xb0dd('0x6')]!=='id'){_0x57fd10[_0xb0dd('0xd')]=_[_0xb0dd('0xa')](_0x341f61,function(_0x381942){return _0x381942[_0x5b8628[_0xb0dd('0x6')]];});}else{if(_0x57d42f===_0xb0dd('0x11')){_0x57fd10[_0xb0dd('0xd')]=_[_0xb0dd('0xa')](_0x341f61,function(_0x36b46f){return{'id':_0x36b46f[_0xb0dd('0x12')],'type':_0x36b46f[_0xb0dd('0x13')]};});}else{_0x57fd10[_0xb0dd('0xd')]=_[_0xb0dd('0xa')](_0x341f61,function(_0xbcd36c){return _0xbcd36c['resourceId'];});}}_0x1bf6b5(_0x57fd10);})[_0xb0dd('0xb')](function(_0x2a656c){_0x488dfa(_0x2a656c);});});}function _0x79dc49(_0x5a237e,_0x392414){var _0x379be3={'parentSections':[]};switch(_0x5a237e['toLowerCase']()){case _0xb0dd('0x14'):_0x379be3[_0xb0dd('0x15')]=_0xb0dd('0x16');break;case _0xb0dd('0x17'):_0x379be3[_0xb0dd('0x15')]=_0xb0dd('0x18');break;case _0xb0dd('0x19'):_0x379be3[_0xb0dd('0x15')]=_0xb0dd('0x1a');_0x379be3[_0xb0dd('0x1b')]=[{'name':_0xb0dd('0x1c'),'field':_0xb0dd('0xe'),'foreignKey':_0xb0dd('0x1d')}];break;case _0xb0dd('0x1e'):_0x379be3[_0xb0dd('0x15')]='JscriptyProject';break;case _0xb0dd('0x1f'):_0x379be3['childModel']=_0xb0dd('0x20');_0x379be3[_0xb0dd('0x1b')]=[{'name':_0xb0dd('0x21'),'field':'id','foreignKey':_0xb0dd('0x22')}];break;case _0xb0dd('0x23'):_0x379be3['childModel']=_0xb0dd('0x24');break;case _0xb0dd('0x25'):_0x379be3[_0xb0dd('0x15')]='CmCompany';break;case _0xb0dd('0x26'):_0x379be3[_0xb0dd('0x15')]=_0xb0dd('0x27');break;case _0xb0dd('0x28'):_0x379be3[_0xb0dd('0x15')]=_0xb0dd('0x29');break;case _0xb0dd('0x2a'):_0x379be3['childModel']=_0xb0dd('0x2b');break;case _0xb0dd('0x2c'):_0x379be3[_0xb0dd('0x15')]=_0xb0dd('0x2d');break;case _0xb0dd('0x2e'):_0x379be3['childModel']=_0xb0dd('0x2f');break;case _0xb0dd('0x30'):case _0xb0dd('0x31'):case _0xb0dd('0x32'):_0x379be3['childModel']=_0xb0dd('0x33');break;case _0xb0dd('0x34'):_0x379be3[_0xb0dd('0x15')]=_0xb0dd('0x35');break;case _0xb0dd('0x36'):_0x379be3[_0xb0dd('0x15')]='VoiceMail';break;case _0xb0dd('0x37'):_0x379be3[_0xb0dd('0x15')]=_0xb0dd('0x38');_0x379be3[_0xb0dd('0x1b')]=[{'name':_0xb0dd('0x39'),'field':_0xb0dd('0xe'),'foreignKey':_0xb0dd('0x3a'),'model':_0xb0dd('0x3b'),'filter':{'field':_0xb0dd('0x3c'),'value':[_0xb0dd('0x3d')]}},{'name':_0xb0dd('0x3e'),'field':'name','foreignKey':_0xb0dd('0x3a'),'model':_0xb0dd('0x3b'),'filter':{'field':_0xb0dd('0x3c'),'value':[_0xb0dd('0x3f')]}},{'name':_0xb0dd('0x40'),'field':_0xb0dd('0xe'),'foreignKey':_0xb0dd('0x41'),'model':_0xb0dd('0x42'),'filter':{'field':_0xb0dd('0x13'),'value':[_0xb0dd('0x43')]}},{'name':_0xb0dd('0x44'),'field':_0xb0dd('0xe'),'foreignKey':_0xb0dd('0x41'),'model':'VoiceQueue','filter':{'field':_0xb0dd('0x13'),'value':[_0xb0dd('0x45')]}}];break;case _0xb0dd('0x46'):_0x379be3[_0xb0dd('0x15')]='VoiceMusicOnHold';break;case _0xb0dd('0x47'):_0x379be3[_0xb0dd('0x15')]=_0xb0dd('0x48');break;case _0xb0dd('0x49'):_0x379be3[_0xb0dd('0x15')]=_0xb0dd('0x4a');break;case _0xb0dd('0x4b'):_0x379be3[_0xb0dd('0x15')]=_0xb0dd('0x4c');break;case _0xb0dd('0x4d'):_0x379be3[_0xb0dd('0x15')]=_0xb0dd('0x4e');break;case _0xb0dd('0x4f'):_0x379be3[_0xb0dd('0x15')]=_0xb0dd('0x50');break;case _0xb0dd('0x51'):_0x379be3[_0xb0dd('0x15')]=_0xb0dd('0x52');break;case _0xb0dd('0x53'):_0x379be3[_0xb0dd('0x15')]=_0xb0dd('0x54');break;case _0xb0dd('0x55'):_0x379be3[_0xb0dd('0x15')]=_0xb0dd('0x56');break;case _0xb0dd('0x57'):_0x379be3[_0xb0dd('0x15')]=_0xb0dd('0x58');break;case _0xb0dd('0x59'):_0x379be3[_0xb0dd('0x15')]=_0xb0dd('0x5a');break;case'whatsappqueues':_0x379be3[_0xb0dd('0x15')]='WhatsappQueue';break;case _0xb0dd('0x5b'):_0x379be3['childModel']='WhatsappAccount';break;case _0xb0dd('0x5c'):_0x379be3[_0xb0dd('0x15')]='Team';break;case'voicequeues':case _0xb0dd('0x5d'):_0x379be3[_0xb0dd('0x15')]=_0xb0dd('0x42');if(_0x392414){_0x379be3[_0xb0dd('0x1b')]=[{'name':_0xb0dd('0x40')},{'name':_0xb0dd('0x44')}];}break;case _0xb0dd('0x5e'):case _0xb0dd('0x5f'):case'telephones':_0x379be3['childModel']=_0xb0dd('0x3b');if(_0x392414){_0x379be3[_0xb0dd('0x1b')]=[{'name':'Users','filter':{'field':_0xb0dd('0x3c'),'value':[_0xb0dd('0x60'),_0xb0dd('0x61')]},'ignore':!![]},{'name':_0xb0dd('0x39')},{'name':_0xb0dd('0x3e')}];}break;case _0xb0dd('0x62'):_0x379be3[_0xb0dd('0x15')]=_0xb0dd('0x63');break;case'salesforceaccounts':_0x379be3[_0xb0dd('0x15')]=_0xb0dd('0x64');break;case _0xb0dd('0x65'):_0x379be3[_0xb0dd('0x15')]=_0xb0dd('0x66');break;case _0xb0dd('0x67'):_0x379be3[_0xb0dd('0x15')]=_0xb0dd('0x68');break;case _0xb0dd('0x69'):_0x379be3[_0xb0dd('0x15')]=_0xb0dd('0x6a');break;case _0xb0dd('0x6b'):_0x379be3['childModel']='ZohoAccount';break;case _0xb0dd('0x6c'):_0x379be3[_0xb0dd('0x15')]='User';break;case _0xb0dd('0x6d'):_0x379be3[_0xb0dd('0x15')]=_0xb0dd('0x6e');break;case'dispositions':_0x379be3[_0xb0dd('0x15')]=_0xb0dd('0x6f');break;case _0xb0dd('0x70'):_0x379be3[_0xb0dd('0x15')]=_0xb0dd('0x71');break;case _0xb0dd('0x72'):_0x379be3[_0xb0dd('0x15')]=_0xb0dd('0x73');break;case _0xb0dd('0x74'):_0x379be3[_0xb0dd('0x15')]=_0xb0dd('0x75');break;case _0xb0dd('0x76'):_0x379be3[_0xb0dd('0x15')]=_0xb0dd('0x77');break;case _0xb0dd('0x78'):_0x379be3[_0xb0dd('0x15')]=_0xb0dd('0x79');break;case _0xb0dd('0x7a'):_0x379be3[_0xb0dd('0x15')]=_0xb0dd('0x7b');break;case _0xb0dd('0x7c'):_0x379be3[_0xb0dd('0x15')]=_0xb0dd('0x7d');break;case _0xb0dd('0x7e'):_0x379be3[_0xb0dd('0x15')]='Trigger';break;case _0xb0dd('0x7f'):_0x379be3[_0xb0dd('0x15')]=_0xb0dd('0x80');break;case _0xb0dd('0x81'):_0x379be3[_0xb0dd('0x15')]='Variable';break;case _0xb0dd('0x82'):_0x379be3['childModel']=_0xb0dd('0x83');break;case _0xb0dd('0x84'):_0x379be3[_0xb0dd('0x15')]=_0xb0dd('0x11');_0x379be3[_0xb0dd('0x1b')]=[{'name':'Reports','field':'id','foreignKey':_0xb0dd('0x85')}];break;case'metrics':_0x379be3[_0xb0dd('0x15')]=_0xb0dd('0x86');break;}return _0x379be3;}function _0x21a3c5(_0x1e1153,_0x13b2dd){var _0x48de6b=_0x1e1153[_0xb0dd('0x87')](0x0)[_0xb0dd('0x88')]()+_0x1e1153[_0xb0dd('0x89')](0x1);var _0x2c65e6={'type':_0x45e621[_0xb0dd('0x8a')]['QueryTypes'][_0xb0dd('0x8b')],'raw':!![]};return new Promise(function(_0x41472b,_0x1c4857){var _0x406070=squel[_0xb0dd('0x8c')]()[_0xb0dd('0x6')](_0xb0dd('0x8d')+_0x48de6b+_0xb0dd('0x8e'),'id')[_0xb0dd('0x6')]('ui.createdAt')[_0xb0dd('0x8f')](_0xb0dd('0x90')+_0x1e1153+_0xb0dd('0x91'),'ui')['where'](_0xb0dd('0x92'),_0x13b2dd['id']);return _0x45e621[_0xb0dd('0x93')][_0xb0dd('0x94')](_0x406070[_0xb0dd('0x95')](),_0x2c65e6)[_0xb0dd('0x9')](function(_0x44686b){_0x13b2dd[_0x48de6b+'OpenTabs']=_0x44686b;_0x41472b(_0x44686b);})[_0xb0dd('0xb')](function(_0x464955){_0x1c4857(_0x464955);});});}return _0x27b74b[_0xb0dd('0x96')](_0xb0dd('0x97'),attributes,{'tableName':_0xb0dd('0x98'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x18102e){var _0x14a7a3={'raw':_0x18102e['query']['raw'],'where':{}};var _0x4b8aad={};var _0x388db0={'count':0x0,'rows':[]};var _0xaa6dd=_0x18102e[_0xb0dd('0x94')][_0xb0dd('0x99')];var _0xffe26f=_0x18102e[_0xb0dd('0x94')][_0xb0dd('0x9a')]||![];var _0x2f4dbd=_0x79dc49(_0xaa6dd,_0xffe26f);if(!_0x2f4dbd[_0xb0dd('0x15')])throw new Error(_0xb0dd('0x9b')+_0xaa6dd+'\x27');var _0x66b705=[{'name':_0xaa6dd}];if(!_['isEmpty'](_0x2f4dbd['parentSections']))_0x66b705=_0x2f4dbd['parentSections'];var _0xf63714=[];for(var _0x4c79e5=0x0;_0x4c79e5<_0x66b705[_0xb0dd('0x9c')];_0x4c79e5++){_0xf63714[_0xb0dd('0x9d')](_0x45e621[_0xb0dd('0x9e')][_0xb0dd('0x9f')]({'where':{'userProfileId':_0x18102e[_0xb0dd('0xa0')]['id'],'name':_0x66b705[_0x4c79e5][_0xb0dd('0xe')]},'raw':!![]}));}return Promise[_0xb0dd('0xa1')](_0xf63714)[_0xb0dd('0x9')](function(_0x31c8bc){var _0x55fd64=_[_0xb0dd('0x5')](_0x31c8bc,function(_0x39bf14){return _0x39bf14?_0x39bf14:undefined;});var _0x4cc59c=_[_0xb0dd('0x5')](_0x66b705,['ignore',!![]]);var _0x45fc74=_[_0xb0dd('0xa2')](_0x55fd64)&&_[_0xb0dd('0xa2')](_0x4cc59c)?null:_[_0xb0dd('0xa3')](_0x4cc59c,_0x55fd64);if(!_0x45fc74)return null;var _0x59b3c7=[];for(var _0x1e9c1=0x0;_0x1e9c1<_0x45fc74[_0xb0dd('0x9c')];_0x1e9c1++){var _0x3d7ccd=_[_0xb0dd('0x9f')](_0x66b705,function(_0x344622){return _0x45fc74[_0x1e9c1]?_0x344622[_0xb0dd('0xe')]===_0x45fc74[_0x1e9c1][_0xb0dd('0xe')]:null;});if(_0x3d7ccd){if(_0x45fc74[_0x1e9c1][_0xb0dd('0xa4')]){_0x59b3c7[_0xb0dd('0x9d')](_0xf2994f(_0x2f4dbd[_0xb0dd('0x15')],_0x45fc74[_0x1e9c1]));}else{if(!_0x45fc74[_0x1e9c1]['autoAssociation']){_0x59b3c7[_0xb0dd('0x9d')](_0xcf44b7(_0x3d7ccd,_0x45fc74[_0x1e9c1],_0x2f4dbd[_0xb0dd('0x15')]));}else{if(_0x3d7ccd[_0xb0dd('0xc')]){_0x59b3c7['push'](_0x40a42b(_0x3d7ccd,_0x45fc74[_0x1e9c1]));}}}}}return Promise['all'](_0x59b3c7);})[_0xb0dd('0x9')](function(_0x492bd2){var _0x541a80=_0x492bd2;var _0x530e42=null;if(_0x541a80){_0x530e42=_0x541a80['length']===0x1?_0x541a80[0x0]:null;}if(!_0x530e42&&!_0x541a80)return _0x388db0;var _0x3441ec=_0x45e621[_0x2f4dbd[_0xb0dd('0x15')]][_0xb0dd('0xa5')];_0x4b8aad[_0xb0dd('0xc')]=_['keys'](_0x3441ec);_0x4b8aad['query']=_[_0xb0dd('0xa6')](_0x18102e['query']);_0x4b8aad[_0xb0dd('0xa7')]=_[_0xb0dd('0xa8')](_0x4b8aad[_0xb0dd('0xc')],_0x4b8aad[_0xb0dd('0x94')]);_0x14a7a3[_0xb0dd('0xa9')]=_[_0xb0dd('0xa8')](_0x4b8aad['model'],qs['fields'](_0x18102e[_0xb0dd('0x94')][_0xb0dd('0xaa')]));_0x14a7a3[_0xb0dd('0xa9')]=_0x14a7a3[_0xb0dd('0xa9')][_0xb0dd('0x9c')]?_0x14a7a3['attributes']:_0x4b8aad[_0xb0dd('0xc')];if(!_0x18102e[_0xb0dd('0x94')][_0xb0dd('0xab')]('nolimit')){_0x14a7a3['limit']=qs[_0xb0dd('0xac')](_0x18102e['query'][_0xb0dd('0xac')]);_0x14a7a3[_0xb0dd('0xad')]=qs['offset'](_0x18102e[_0xb0dd('0x94')][_0xb0dd('0xad')]);}_0x14a7a3[_0xb0dd('0xae')]=qs[_0xb0dd('0xaf')](_0x18102e[_0xb0dd('0x94')]['sort']);_0x14a7a3[_0xb0dd('0xb0')]=qs[_0xb0dd('0xa7')](_['pick'](_0x18102e[_0xb0dd('0x94')],_0x4b8aad[_0xb0dd('0xa7')]));if(_0x18102e[_0xb0dd('0x94')][_0xb0dd('0x5')]){_0x14a7a3['where']=_['merge'](_0x14a7a3[_0xb0dd('0xb0')],{'$or':_[_0xb0dd('0xa')](_0x3441ec,function(_0x56d1cc){if(_0x56d1cc[_0xb0dd('0x13')][_0xb0dd('0xb1')]!==_0xb0dd('0xb2')){var _0x3f55c7={};_0x3f55c7[_0x56d1cc[_0xb0dd('0x6')]]={'$like':'%'+_0x18102e[_0xb0dd('0x94')][_0xb0dd('0x5')]+'%'};return _0x3f55c7;}})});}var _0x3e285f=[];var _0x4d03aa=null;var _0x5cd3ef={};if(_0x530e42){_0x4d03aa=_[_0xb0dd('0x9f')](_0x66b705,[_0xb0dd('0xe'),_0x530e42[_0xb0dd('0xe')]]);if(_0x4d03aa[_0xb0dd('0x6')]){_0x5cd3ef={};if(_0x2f4dbd[_0xb0dd('0x15')]===_0xb0dd('0x11')){_0x5cd3ef[_0x4d03aa[_0xb0dd('0xb3')]]=_[_0xb0dd('0xa')](_0x530e42['associatedResources'],'id');}else{_0x5cd3ef[_0x4d03aa[_0xb0dd('0xb3')]]=_0x530e42[_0xb0dd('0xd')];}_0x3e285f['push'](_0x5cd3ef);}else{_0x14a7a3[_0xb0dd('0xb0')]['id']=_0x530e42[_0xb0dd('0xd')];}}else{for(var _0x2c8c55=0x0;_0x2c8c55<_0x541a80[_0xb0dd('0x9c')];_0x2c8c55++){_0x4d03aa=_[_0xb0dd('0x9f')](_0x66b705,[_0xb0dd('0xe'),_0x541a80[_0x2c8c55][_0xb0dd('0xe')]]);if(_0x4d03aa[_0xb0dd('0x6')]){_0x5cd3ef={};_0x5cd3ef[_0x4d03aa[_0xb0dd('0xb3')]]=_0x541a80[_0x2c8c55][_0xb0dd('0xd')];_0x3e285f[_0xb0dd('0x9d')](_0x5cd3ef);}else{if(!_0x14a7a3[_0xb0dd('0xb0')]['id'])_0x14a7a3[_0xb0dd('0xb0')]['id']=[];_0x541a80[_0x2c8c55][_0xb0dd('0xd')]['forEach'](function(_0x3c63d7){_0x14a7a3[_0xb0dd('0xb0')]['id']['push'](_0x3c63d7);});}}}if(!_[_0xb0dd('0xa2')](_0x3e285f)){_0x14a7a3[_0xb0dd('0xb0')]=_[_0xb0dd('0xb4')](_0x14a7a3[_0xb0dd('0xb0')],{'$and':{'$or':_0x3e285f}});}_0x14a7a3=_[_0xb0dd('0xb4')]({},_0x14a7a3,_0x18102e[_0xb0dd('0xb5')]);if(_0x530e42&&!_0x530e42[_0xb0dd('0xb6')]&&_0x2f4dbd[_0xb0dd('0x15')]===_0xb0dd('0x11')){if(_0x18102e['query'][_0xb0dd('0xb7')]){_0x14a7a3['include']=[{'all':!![]}];}return _0x45e621[_0x2f4dbd['childModel']][_0xb0dd('0x8')](_0x14a7a3)[_0xb0dd('0x9')](function(_0x1e3e66){var _0x14950e=[];_0x1e3e66['forEach'](function(_0x21165c){var _0x243be5;switch(_0x21165c[_0xb0dd('0xb8')]){case _0xb0dd('0xb9'):_0x243be5=_[_0xb0dd('0x9f')](_0x530e42[_0xb0dd('0xd')],function(_0x3d61b9){return _0x3d61b9['id']===_0x21165c[_0xb0dd('0x85')]&&_0x3d61b9[_0xb0dd('0x13')]===_0xb0dd('0xba');});break;case _0xb0dd('0xbb'):_0x243be5=_[_0xb0dd('0x9f')](_0x530e42[_0xb0dd('0xd')],function(_0x13927a){return _0x13927a['id']===_0x21165c[_0xb0dd('0x85')]&&_0x13927a[_0xb0dd('0x13')]===_0xb0dd('0xbc');});break;}if(_0x243be5)_0x14950e[_0xb0dd('0x9d')](_0x21165c);});_0x388db0['count']=_0x14950e['length'];_0x388db0[_0xb0dd('0xbd')]=_0x14950e;return _0x388db0;});}else{return _0x45e621[_0x2f4dbd[_0xb0dd('0x15')]][_0xb0dd('0xbe')]({'where':_0x14a7a3[_0xb0dd('0xb0')]})['then'](function(_0x5edc03){_0x388db0[_0xb0dd('0xbe')]=_0x5edc03;if(_0x18102e[_0xb0dd('0x94')]['includeAll']){if(_0x2f4dbd[_0xb0dd('0x15')]==='CmContact'){_0x14a7a3[_0xb0dd('0xbf')]=[{'model':_0x45e621[_0xb0dd('0x7b')],'as':_0xb0dd('0xc0'),'attributes':['id','name',_0xb0dd('0xc1')],'required':_0x18102e[_0xb0dd('0x94')][_0xb0dd('0xc2')]?!![]:![]},{'model':_0x45e621[_0xb0dd('0x7b')],'as':_0xb0dd('0xc3'),'attributes':['id',_0xb0dd('0xe'),_0xb0dd('0xc1')],'through':_0x18102e['query'][_0xb0dd('0xc2')]?{'attributes':[],'where':{'TagId':_0x18102e[_0xb0dd('0x94')]['tag']||undefined}}:{},'required':_0x18102e[_0xb0dd('0x94')]['tag']?!![]:![]}];}else{_0x14a7a3[_0xb0dd('0xbf')]=[{'all':!![]}];}}return _0x45e621[_0x2f4dbd[_0xb0dd('0x15')]][_0xb0dd('0x8')](_0x14a7a3);})['then'](function(_0x2b0187){_0x388db0[_0xb0dd('0xbd')]=_0x2b0187;if(_0xaa6dd===_0xb0dd('0x39')&&_0x18102e[_0xb0dd('0x94')][_0xb0dd('0xc4')]===_0xb0dd('0xc5')){var _0x45bca2=[];for(var _0x25d7f1=0x0;_0x25d7f1<_0x388db0[_0xb0dd('0xbd')][_0xb0dd('0x9c')];_0x25d7f1++){_0x45bca2[_0xb0dd('0x9d')](_0x21a3c5('chat',_0x388db0[_0xb0dd('0xbd')][_0x25d7f1]['dataValues']));_0x45bca2[_0xb0dd('0x9d')](_0x21a3c5(_0xb0dd('0xc6'),_0x388db0[_0xb0dd('0xbd')][_0x25d7f1][_0xb0dd('0xc7')]));_0x45bca2['push'](_0x21a3c5(_0xb0dd('0xc8'),_0x388db0[_0xb0dd('0xbd')][_0x25d7f1][_0xb0dd('0xc7')]));_0x45bca2[_0xb0dd('0x9d')](_0x21a3c5(_0xb0dd('0xc9'),_0x388db0['rows'][_0x25d7f1][_0xb0dd('0xc7')]));_0x45bca2[_0xb0dd('0x9d')](_0x21a3c5(_0xb0dd('0xca'),_0x388db0[_0xb0dd('0xbd')][_0x25d7f1]['dataValues']));_0x45bca2['push'](_0x21a3c5(_0xb0dd('0xcb'),_0x388db0[_0xb0dd('0xbd')][_0x25d7f1][_0xb0dd('0xc7')]));}return Promise['all'](_0x45bca2)[_0xb0dd('0x9')](function(){return _0x388db0;});}return _0x388db0;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 87ce3b0..bd1114a 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 _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(_0xc45cce,_0x100222){var _0x56c536=function(_0x5e9f4e){while(--_0x5e9f4e){_0xc45cce['push'](_0xc45cce['shift']());}};_0x56c536(++_0x100222);}(_0xaafc,0x176));var _0xcaaf=function(_0x1a440f,_0x4ae43f){_0x1a440f=_0x1a440f-0x0;var _0x1bf6c9=_0xaafc[_0x1a440f];return _0x1bf6c9;};'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 +var _0x103f=['register','info','request\x20sent','stringify','error','code','UserProfile,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userProfile.socket'];(function(_0x4c0692,_0x47fc15){var _0x293e50=function(_0x9278af){while(--_0x9278af){_0x4c0692['push'](_0x4c0692['shift']());}};_0x293e50(++_0x47fc15);}(_0x103f,0x13e));var _0xf103=function(_0x4d9328,_0x2ee0c6){_0x4d9328=_0x4d9328-0x0;var _0x27c75a=_0x103f[_0x4d9328];return _0x27c75a;};'use strict';var _=require(_0xf103('0x0'));var util=require(_0xf103('0x1'));var moment=require(_0xf103('0x2'));var BPromise=require(_0xf103('0x3'));var rs=require(_0xf103('0x4'));var fs=require('fs');var Redis=require(_0xf103('0x5'));var db=require(_0xf103('0x6'))['db'];var utils=require(_0xf103('0x7'));var logger=require(_0xf103('0x8'))(_0xf103('0x9'));var config=require('../../config/environment');var jayson=require(_0xf103('0xa'));var client=jayson[_0xf103('0xb')][_0xf103('0xc')]({'port':0x232a});config[_0xf103('0xd')]=_[_0xf103('0xe')](config[_0xf103('0xd')],{'host':_0xf103('0xf'),'port':0x18eb});var socket=require(_0xf103('0x10'))(new Redis(config[_0xf103('0xd')]));require(_0xf103('0x11'))[_0xf103('0x12')](socket);function respondWithRpcPromise(_0x267ec4,_0x47b71b,_0x228805){return new BPromise(function(_0x532559,_0x2aa8fd){return client['request'](_0x267ec4,_0x228805)['then'](function(_0xb3a849){logger[_0xf103('0x13')]('UserProfile,\x20%s,\x20%s',_0x47b71b,_0xf103('0x14'));logger['debug']('UserProfile,\x20%s,\x20%s,\x20%s',_0x47b71b,'request\x20sent',JSON[_0xf103('0x15')](_0xb3a849));if(_0xb3a849['error']){if(_0xb3a849[_0xf103('0x16')][_0xf103('0x17')]===0x1f4){logger['error'](_0xf103('0x18'),_0x47b71b,_0xb3a849[_0xf103('0x16')]['message']);return _0x2aa8fd(_0xb3a849[_0xf103('0x16')][_0xf103('0x19')]);}logger['error'](_0xf103('0x18'),_0x47b71b,_0xb3a849['error']['message']);return _0x532559(_0xb3a849[_0xf103('0x16')][_0xf103('0x19')]);}else{logger[_0xf103('0x13')](_0xf103('0x18'),_0x47b71b,_0xf103('0x14'));_0x532559(_0xb3a849[_0xf103('0x1a')]['message']);}})[_0xf103('0x1b')](function(_0x338a44){logger['error'](_0xf103('0x18'),_0x47b71b,_0x338a44);_0x2aa8fd(_0x338a44);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index d01187b..0944526 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 _0xdf98=['./userProfile.events','save','remove','removeListener','length'];(function(_0x4f2d12,_0x5aedd1){var _0x1cc876=function(_0x47c141){while(--_0x47c141){_0x4f2d12['push'](_0x4f2d12['shift']());}};_0x1cc876(++_0x5aedd1);}(_0xdf98,0x127));var _0x8df9=function(_0x375ccf,_0x14964c){_0x375ccf=_0x375ccf-0x0;var _0x1507e8=_0xdf98[_0x375ccf];return _0x1507e8;};'use strict';var UserProfileEvents=require(_0x8df9('0x0'));var events=[_0x8df9('0x1'),_0x8df9('0x2'),'update'];function createListener(_0x432d85,_0x27004e){return function(_0x20fad6){_0x27004e['emit'](_0x432d85,_0x20fad6);};}function removeListener(_0x406611,_0x42d81d){return function(){UserProfileEvents[_0x8df9('0x3')](_0x406611,_0x42d81d);};}exports['register']=function(_0x573267){for(var _0x46d7d3=0x0,_0x5552c7=events[_0x8df9('0x4')];_0x46d7d3<_0x5552c7;_0x46d7d3++){var _0x6fd7b9=events[_0x46d7d3];var _0x3f744f=createListener('userProfile:'+_0x6fd7b9,_0x573267);UserProfileEvents['on'](_0x6fd7b9,_0x3f744f);}}; \ No newline at end of file +var _0xbac2=['./userProfile.events','save','remove','update','emit','removeListener','register','length'];(function(_0x37263d,_0x515ebd){var _0x3c11f6=function(_0x108985){while(--_0x108985){_0x37263d['push'](_0x37263d['shift']());}};_0x3c11f6(++_0x515ebd);}(_0xbac2,0x68));var _0x2bac=function(_0x7b484,_0x195ad4){_0x7b484=_0x7b484-0x0;var _0x2ae1cf=_0xbac2[_0x7b484];return _0x2ae1cf;};'use strict';var UserProfileEvents=require(_0x2bac('0x0'));var events=[_0x2bac('0x1'),_0x2bac('0x2'),_0x2bac('0x3')];function createListener(_0x4fbabd,_0x4f68e5){return function(_0x4f0393){_0x4f68e5[_0x2bac('0x4')](_0x4fbabd,_0x4f0393);};}function removeListener(_0x43aee0,_0x2877b8){return function(){UserProfileEvents[_0x2bac('0x5')](_0x43aee0,_0x2877b8);};}exports[_0x2bac('0x6')]=function(_0x594d9d){for(var _0x3591ac=0x0,_0x209055=events[_0x2bac('0x7')];_0x3591ac<_0x209055;_0x3591ac++){var _0x5b735f=events[_0x3591ac];var _0x5cd8a9=createListener('userProfile:'+_0x5b735f,_0x594d9d);UserProfileEvents['on'](_0x5b735f,_0x5cd8a9);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 0c2a67e..774b055 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 _0x2642=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','/describe','isAuthenticated','describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express'];(function(_0x8dc04d,_0xaa7559){var _0x2f5f28=function(_0xdd2d1d){while(--_0xdd2d1d){_0x8dc04d['push'](_0x8dc04d['shift']());}};_0x2f5f28(++_0xaa7559);}(_0x2642,0x80));var _0x2264=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x2642[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x2264('0x0'));var util=require(_0x2264('0x1'));var path=require('path');var timeout=require(_0x2264('0x2'));var express=require(_0x2264('0x3'));var router=express[_0x2264('0x4')]();var fs_extra=require(_0x2264('0x5'));var auth=require(_0x2264('0x6'));var interaction=require(_0x2264('0x7'));var config=require(_0x2264('0x8'));var controller=require(_0x2264('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x2264('0xa')](_0x2264('0xb'),auth[_0x2264('0xc')](),controller[_0x2264('0xd')]);router[_0x2264('0xa')](_0x2264('0xe'),auth[_0x2264('0xc')](),controller['show']);router[_0x2264('0xf')]('/',auth[_0x2264('0xc')](),controller[_0x2264('0x10')]);router[_0x2264('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x2264('0x12')]);router[_0x2264('0x13')](_0x2264('0xe'),auth[_0x2264('0xc')](),controller[_0x2264('0x14')]);module[_0x2264('0x15')]=router; \ No newline at end of file +var _0xa4d0=['put','update','delete','destroy','exports','multer','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfileResource.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create'];(function(_0xf168d3,_0x43dcfc){var _0x17fb54=function(_0x3d9674){while(--_0x3d9674){_0xf168d3['push'](_0xf168d3['shift']());}};_0x17fb54(++_0x43dcfc);}(_0xa4d0,0x8a));var _0x0a4d=function(_0x57bd33,_0x46821f){_0x57bd33=_0x57bd33-0x0;var _0x509c48=_0xa4d0[_0x57bd33];return _0x509c48;};'use strict';var multer=require(_0x0a4d('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a4d('0x1')]();var fs_extra=require(_0x0a4d('0x2'));var auth=require(_0x0a4d('0x3'));var interaction=require(_0x0a4d('0x4'));var config=require('../../config/environment');var controller=require(_0x0a4d('0x5'));router[_0x0a4d('0x6')]('/',auth[_0x0a4d('0x7')](),controller[_0x0a4d('0x8')]);router[_0x0a4d('0x6')](_0x0a4d('0x9'),auth[_0x0a4d('0x7')](),controller[_0x0a4d('0xa')]);router[_0x0a4d('0x6')](_0x0a4d('0xb'),auth[_0x0a4d('0x7')](),controller['show']);router[_0x0a4d('0xc')]('/',auth['isAuthenticated'](),controller[_0x0a4d('0xd')]);router[_0x0a4d('0xe')](_0x0a4d('0xb'),auth['isAuthenticated'](),controller[_0x0a4d('0xf')]);router[_0x0a4d('0x10')](_0x0a4d('0xb'),auth[_0x0a4d('0x7')](),controller[_0x0a4d('0x11')]);module[_0x0a4d('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 064e7eb..c1c17de 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 _0x436b=['STRING'];(function(_0x3f4819,_0x4cf509){var _0x100290=function(_0x1485af){while(--_0x1485af){_0x3f4819['push'](_0x3f4819['shift']());}};_0x100290(++_0x4cf509);}(_0x436b,0x19d));var _0xb436=function(_0x509af6,_0x348740){_0x509af6=_0x509af6-0x0;var _0x54edde=_0x436b[_0x509af6];return _0x54edde;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xb436('0x0')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0xb436('0x0')],'allowNull':![]}}; \ No newline at end of file +var _0x1c68=['STRING','INTEGER','sequelize','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1c68,0x13e));var _0x81c6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1c68[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x81c6('0x0'));module[_0x81c6('0x1')]={'name':{'type':Sequelize[_0x81c6('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x81c6('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x81c6('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index b390bf7..4fc16dc 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 _0x781d=['sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','destroy','then','error','name','send','index','map','UserProfileResource','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','nolimit','order','where','filters','filter','merge','VIRTUAL','includeAll','catch','show','params','rawAttributes','options','body','find','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x781d,0x14a));var _0xd781=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x781d[_0x2d7f0e];return _0x110b07;};'use strict';var emlformat=require(_0xd781('0x0'));var rimraf=require(_0xd781('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd781('0x2'));var moment=require(_0xd781('0x3'));var BPromise=require(_0xd781('0x4'));var Mustache=require(_0xd781('0x5'));var util=require(_0xd781('0x6'));var path=require(_0xd781('0x7'));var sox=require(_0xd781('0x8'));var csv=require(_0xd781('0x9'));var ejs=require(_0xd781('0xa'));var fs=require('fs');var fs_extra=require(_0xd781('0xb'));var _=require('lodash');var squel=require(_0xd781('0xc'));var crypto=require(_0xd781('0xd'));var jsforce=require(_0xd781('0xe'));var deskjs=require(_0xd781('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd781('0x10'));var Papa=require('papaparse');var Redis=require(_0xd781('0x11'));var authService=require(_0xd781('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd781('0x13'));var hardwareService=require(_0xd781('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xd781('0x15'));var config=require(_0xd781('0x16'));var licenseUtil=require(_0xd781('0x17'));var db=require(_0xd781('0x18'))['db'];function respondWithStatusCode(_0xbea78b,_0x1f2f1e){_0x1f2f1e=_0x1f2f1e||0xcc;return function(_0xc7758f){if(_0xc7758f){return _0xbea78b[_0xd781('0x19')](_0x1f2f1e);}return _0xbea78b[_0xd781('0x1a')](_0x1f2f1e)[_0xd781('0x1b')]();};}function respondWithResult(_0xd454e7,_0x587953){_0x587953=_0x587953||0xc8;return function(_0x477bdc){if(_0x477bdc){return _0xd454e7[_0xd781('0x1a')](_0x587953)['json'](_0x477bdc);}};}function respondWithFilteredResult(_0x3a1f48,_0x48bffc){return function(_0x294e5a){if(_0x294e5a){var _0x22d787=typeof _0x48bffc[_0xd781('0x1c')]===_0xd781('0x1d')&&typeof _0x48bffc[_0xd781('0x1e')]===_0xd781('0x1d');var _0x501b0d=_0x294e5a['count'];var _0x1407fc=_0x22d787?0x0:_0x48bffc[_0xd781('0x1c')];var _0x395d9c=_0x22d787?_0x294e5a[_0xd781('0x1f')]:_0x48bffc[_0xd781('0x1c')]+_0x48bffc[_0xd781('0x1e')];var _0x260aa8;if(_0x395d9c>=_0x501b0d){_0x395d9c=_0x501b0d;_0x260aa8=0xc8;}else{_0x260aa8=0xce;}_0x3a1f48[_0xd781('0x1a')](_0x260aa8);return _0x3a1f48['set'](_0xd781('0x20'),_0x1407fc+'-'+_0x395d9c+'/'+_0x501b0d)[_0xd781('0x21')](_0x294e5a);}return null;};}function patchUpdates(_0x1036d3){return function(_0x103758){try{jsonpatch[_0xd781('0x22')](_0x103758,_0x1036d3,!![]);}catch(_0x274665){return BPromise[_0xd781('0x23')](_0x274665);}return _0x103758['save']();};}function saveUpdates(_0xe0c65f,_0x4e2c56){return function(_0x567fdf){if(_0x567fdf){return _0x567fdf[_0xd781('0x24')](_0xe0c65f)['then'](function(_0x175ba6){return _0x175ba6;});}return null;};}function removeEntity(_0x101480,_0x395087){return function(_0x31bf57){if(_0x31bf57){return _0x31bf57[_0xd781('0x25')]()[_0xd781('0x26')](function(){_0x101480[_0xd781('0x1a')](0xcc)[_0xd781('0x1b')]();});}};}function handleEntityNotFound(_0x10940b,_0x5662db){return function(_0x529ca1){if(!_0x529ca1){_0x10940b[_0xd781('0x19')](0x194);}return _0x529ca1;};}function handleError(_0x849587,_0xdad0b1){_0xdad0b1=_0xdad0b1||0x1f4;return function(_0x57b41e){logger[_0xd781('0x27')](_0x57b41e['stack']);if(_0x57b41e['name']){delete _0x57b41e[_0xd781('0x28')];}_0x849587['status'](_0xdad0b1)[_0xd781('0x29')](_0x57b41e);};}exports[_0xd781('0x2a')]=function(_0x5c3848,_0x5b6b9d){var _0x43cc74={},_0x5b0464={},_0x296a0b={'count':0x0,'rows':[]};var _0x4a3bd3=_[_0xd781('0x2b')](db[_0xd781('0x2c')]['rawAttributes'],function(_0x54521e){return{'name':_0x54521e[_0xd781('0x2d')],'type':_0x54521e[_0xd781('0x2e')][_0xd781('0x2f')]};});_0x5b0464['model']=_['map'](_0x4a3bd3,_0xd781('0x28'));_0x5b0464[_0xd781('0x30')]=_[_0xd781('0x31')](_0x5c3848['query']);_0x5b0464['filters']=_[_0xd781('0x32')](_0x5b0464[_0xd781('0x33')],_0x5b0464['query']);_0x43cc74[_0xd781('0x34')]=_[_0xd781('0x32')](_0x5b0464['model'],qs[_0xd781('0x35')](_0x5c3848[_0xd781('0x30')][_0xd781('0x35')]));_0x43cc74[_0xd781('0x34')]=_0x43cc74['attributes'][_0xd781('0x36')]?_0x43cc74[_0xd781('0x34')]:_0x5b0464[_0xd781('0x33')];if(!_0x5c3848[_0xd781('0x30')]['hasOwnProperty'](_0xd781('0x37'))){_0x43cc74[_0xd781('0x1e')]=qs['limit'](_0x5c3848[_0xd781('0x30')]['limit']);_0x43cc74[_0xd781('0x1c')]=qs[_0xd781('0x1c')](_0x5c3848['query'][_0xd781('0x1c')]);}_0x43cc74[_0xd781('0x38')]=qs['sort'](_0x5c3848[_0xd781('0x30')]['sort']);_0x43cc74[_0xd781('0x39')]=qs[_0xd781('0x3a')](_['pick'](_0x5c3848[_0xd781('0x30')],_0x5b0464[_0xd781('0x3a')]),_0x4a3bd3);if(_0x5c3848['query'][_0xd781('0x3b')]){_0x43cc74[_0xd781('0x39')]=_[_0xd781('0x3c')](_0x43cc74['where'],{'$or':_[_0xd781('0x2b')](_0x4a3bd3,function(_0x22b94e){if(_0x22b94e[_0xd781('0x2e')]!==_0xd781('0x3d')){var _0x2e8218={};_0x2e8218[_0x22b94e[_0xd781('0x28')]]={'$like':'%'+_0x5c3848[_0xd781('0x30')][_0xd781('0x3b')]+'%'};return _0x2e8218;}})});}_0x43cc74=_[_0xd781('0x3c')]({},_0x43cc74,_0x5c3848['options']);var _0x2a60d6={'where':_0x43cc74['where']};return db[_0xd781('0x2c')][_0xd781('0x1f')](_0x2a60d6)['then'](function(_0x1a5833){_0x296a0b[_0xd781('0x1f')]=_0x1a5833;if(_0x5c3848[_0xd781('0x30')][_0xd781('0x3e')]){_0x43cc74['include']=[{'all':!![]}];}return db[_0xd781('0x2c')]['findAll'](_0x43cc74);})[_0xd781('0x26')](function(_0xcdaacf){_0x296a0b['rows']=_0xcdaacf;return _0x296a0b;})['then'](respondWithFilteredResult(_0x5b6b9d,_0x43cc74))[_0xd781('0x3f')](handleError(_0x5b6b9d,null));};exports[_0xd781('0x40')]=function(_0x15b49d,_0x23bbab){var _0x53aba6={'raw':![],'where':{'id':_0x15b49d[_0xd781('0x41')]['id']}},_0x46e7f6={};_0x46e7f6['model']=_['keys'](db[_0xd781('0x2c')][_0xd781('0x42')]);_0x46e7f6[_0xd781('0x30')]=_['keys'](_0x15b49d['query']);_0x46e7f6[_0xd781('0x3a')]=_[_0xd781('0x32')](_0x46e7f6[_0xd781('0x33')],_0x46e7f6[_0xd781('0x30')]);_0x53aba6[_0xd781('0x34')]=_[_0xd781('0x32')](_0x46e7f6['model'],qs['fields'](_0x15b49d[_0xd781('0x30')][_0xd781('0x35')]));_0x53aba6[_0xd781('0x34')]=_0x53aba6[_0xd781('0x34')][_0xd781('0x36')]?_0x53aba6['attributes']:_0x46e7f6[_0xd781('0x33')];if(_0x15b49d[_0xd781('0x30')][_0xd781('0x3e')]){_0x53aba6['include']=[{'all':!![]}];}_0x53aba6=_[_0xd781('0x3c')]({},_0x53aba6,_0x15b49d[_0xd781('0x43')]);return db[_0xd781('0x2c')]['find'](_0x53aba6)[_0xd781('0x26')](handleEntityNotFound(_0x23bbab,null))[_0xd781('0x26')](respondWithResult(_0x23bbab,null))['catch'](handleError(_0x23bbab,null));};exports['create']=function(_0x13a907,_0x16d16e){return db[_0xd781('0x2c')]['create'](_0x13a907[_0xd781('0x44')],{})[_0xd781('0x26')](respondWithResult(_0x16d16e,0xc9))[_0xd781('0x3f')](handleError(_0x16d16e,null));};exports[_0xd781('0x24')]=function(_0x336d30,_0x3828ad){if(_0x336d30[_0xd781('0x44')]['id']){delete _0x336d30['body']['id'];}return db[_0xd781('0x2c')][_0xd781('0x45')]({'where':{'id':_0x336d30[_0xd781('0x41')]['id']}})['then'](handleEntityNotFound(_0x3828ad,null))[_0xd781('0x26')](saveUpdates(_0x336d30[_0xd781('0x44')],null))['then'](respondWithResult(_0x3828ad,null))[_0xd781('0x3f')](handleError(_0x3828ad,null));};exports[_0xd781('0x25')]=function(_0x41caac,_0x207546){return db[_0xd781('0x2c')]['find']({'where':{'id':_0x41caac[_0xd781('0x41')]['id']}})['then'](handleEntityNotFound(_0x207546,null))[_0xd781('0x26')](removeEntity(_0x207546,null))['catch'](handleError(_0x207546,null));};exports[_0xd781('0x46')]=function(_0x17a46e,_0x4f9e37){return db[_0xd781('0x2c')]['describe']()['then'](respondWithResult(_0x4f9e37,null))['catch'](handleError(_0x4f9e37,null));}; \ No newline at end of file +var _0xc2c7=['merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','keys','find','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','destroy','then','error','name','send','index','map','UserProfileResource','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where'];(function(_0x37752b,_0x1e5730){var _0x3f0cab=function(_0x1445ab){while(--_0x1445ab){_0x37752b['push'](_0x37752b['shift']());}};_0x3f0cab(++_0x1e5730);}(_0xc2c7,0x134));var _0x7c2c=function(_0x118949,_0x2451e3){_0x118949=_0x118949-0x0;var _0x3fd61f=_0xc2c7[_0x118949];return _0x3fd61f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7c2c('0x0'));var zipdir=require(_0x7c2c('0x1'));var jsonpatch=require(_0x7c2c('0x2'));var rp=require(_0x7c2c('0x3'));var moment=require(_0x7c2c('0x4'));var BPromise=require(_0x7c2c('0x5'));var Mustache=require(_0x7c2c('0x6'));var util=require(_0x7c2c('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x7c2c('0x8'));var ejs=require(_0x7c2c('0x9'));var fs=require('fs');var fs_extra=require(_0x7c2c('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7c2c('0xb'));var deskjs=require(_0x7c2c('0xc'));var toCsv=require(_0x7c2c('0x8'));var querystring=require(_0x7c2c('0xd'));var Papa=require(_0x7c2c('0xe'));var Redis=require('ioredis');var authService=require(_0x7c2c('0xf'));var qs=require(_0x7c2c('0x10'));var as=require(_0x7c2c('0x11'));var hardwareService=require(_0x7c2c('0x12'));var logger=require(_0x7c2c('0x13'))(_0x7c2c('0x14'));var utils=require(_0x7c2c('0x15'));var config=require(_0x7c2c('0x16'));var licenseUtil=require(_0x7c2c('0x17'));var db=require(_0x7c2c('0x18'))['db'];function respondWithStatusCode(_0xae8441,_0x45847d){_0x45847d=_0x45847d||0xcc;return function(_0x68398a){if(_0x68398a){return _0xae8441[_0x7c2c('0x19')](_0x45847d);}return _0xae8441[_0x7c2c('0x1a')](_0x45847d)[_0x7c2c('0x1b')]();};}function respondWithResult(_0x4c4aaf,_0x5b5729){_0x5b5729=_0x5b5729||0xc8;return function(_0x102778){if(_0x102778){return _0x4c4aaf[_0x7c2c('0x1a')](_0x5b5729)[_0x7c2c('0x1c')](_0x102778);}};}function respondWithFilteredResult(_0x5ae94f,_0x11424c){return function(_0x206ecd){if(_0x206ecd){var _0x5e55e0=typeof _0x11424c[_0x7c2c('0x1d')]==='undefined'&&typeof _0x11424c[_0x7c2c('0x1e')]==='undefined';var _0x342ea2=_0x206ecd[_0x7c2c('0x1f')];var _0x14453f=_0x5e55e0?0x0:_0x11424c[_0x7c2c('0x1d')];var _0x17df4a=_0x5e55e0?_0x206ecd[_0x7c2c('0x1f')]:_0x11424c[_0x7c2c('0x1d')]+_0x11424c[_0x7c2c('0x1e')];var _0x2d356e;if(_0x17df4a>=_0x342ea2){_0x17df4a=_0x342ea2;_0x2d356e=0xc8;}else{_0x2d356e=0xce;}_0x5ae94f[_0x7c2c('0x1a')](_0x2d356e);return _0x5ae94f[_0x7c2c('0x20')](_0x7c2c('0x21'),_0x14453f+'-'+_0x17df4a+'/'+_0x342ea2)['json'](_0x206ecd);}return null;};}function patchUpdates(_0x1c5491){return function(_0x4adb62){try{jsonpatch['apply'](_0x4adb62,_0x1c5491,!![]);}catch(_0x15ae33){return BPromise[_0x7c2c('0x22')](_0x15ae33);}return _0x4adb62[_0x7c2c('0x23')]();};}function saveUpdates(_0x38ae30,_0x41552f){return function(_0x1883b5){if(_0x1883b5){return _0x1883b5[_0x7c2c('0x24')](_0x38ae30)['then'](function(_0x10c356){return _0x10c356;});}return null;};}function removeEntity(_0x4dedd8,_0x302c93){return function(_0x57f510){if(_0x57f510){return _0x57f510[_0x7c2c('0x25')]()[_0x7c2c('0x26')](function(){_0x4dedd8[_0x7c2c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d6ec7,_0x31a50c){return function(_0x30c53e){if(!_0x30c53e){_0x4d6ec7[_0x7c2c('0x19')](0x194);}return _0x30c53e;};}function handleError(_0x150690,_0x31d8f3){_0x31d8f3=_0x31d8f3||0x1f4;return function(_0xa8e145){logger[_0x7c2c('0x27')](_0xa8e145['stack']);if(_0xa8e145[_0x7c2c('0x28')]){delete _0xa8e145[_0x7c2c('0x28')];}_0x150690[_0x7c2c('0x1a')](_0x31d8f3)[_0x7c2c('0x29')](_0xa8e145);};}exports[_0x7c2c('0x2a')]=function(_0x1f8846,_0xf2bfd1){var _0x26f472={},_0xa040ff={},_0x5769ec={'count':0x0,'rows':[]};var _0x465ad6=_[_0x7c2c('0x2b')](db[_0x7c2c('0x2c')][_0x7c2c('0x2d')],function(_0x53ad23){return{'name':_0x53ad23[_0x7c2c('0x2e')],'type':_0x53ad23[_0x7c2c('0x2f')][_0x7c2c('0x30')]};});_0xa040ff[_0x7c2c('0x31')]=_[_0x7c2c('0x2b')](_0x465ad6,_0x7c2c('0x28'));_0xa040ff[_0x7c2c('0x32')]=_['keys'](_0x1f8846[_0x7c2c('0x32')]);_0xa040ff[_0x7c2c('0x33')]=_[_0x7c2c('0x34')](_0xa040ff[_0x7c2c('0x31')],_0xa040ff[_0x7c2c('0x32')]);_0x26f472['attributes']=_['intersection'](_0xa040ff[_0x7c2c('0x31')],qs['fields'](_0x1f8846['query'][_0x7c2c('0x35')]));_0x26f472[_0x7c2c('0x36')]=_0x26f472[_0x7c2c('0x36')][_0x7c2c('0x37')]?_0x26f472['attributes']:_0xa040ff[_0x7c2c('0x31')];if(!_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x38')](_0x7c2c('0x39'))){_0x26f472[_0x7c2c('0x1e')]=qs[_0x7c2c('0x1e')](_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x1e')]);_0x26f472[_0x7c2c('0x1d')]=qs[_0x7c2c('0x1d')](_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x1d')]);}_0x26f472[_0x7c2c('0x3a')]=qs['sort'](_0x1f8846['query'][_0x7c2c('0x3b')]);_0x26f472['where']=qs['filters'](_['pick'](_0x1f8846[_0x7c2c('0x32')],_0xa040ff[_0x7c2c('0x33')]),_0x465ad6);if(_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x3c')]){_0x26f472[_0x7c2c('0x3d')]=_[_0x7c2c('0x3e')](_0x26f472[_0x7c2c('0x3d')],{'$or':_[_0x7c2c('0x2b')](_0x465ad6,function(_0x2b6520){if(_0x2b6520[_0x7c2c('0x2f')]!==_0x7c2c('0x3f')){var _0x58696a={};_0x58696a[_0x2b6520['name']]={'$like':'%'+_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x3c')]+'%'};return _0x58696a;}})});}_0x26f472=_[_0x7c2c('0x3e')]({},_0x26f472,_0x1f8846[_0x7c2c('0x40')]);var _0x5e8c96={'where':_0x26f472[_0x7c2c('0x3d')]};return db[_0x7c2c('0x2c')][_0x7c2c('0x1f')](_0x5e8c96)[_0x7c2c('0x26')](function(_0x18e288){_0x5769ec[_0x7c2c('0x1f')]=_0x18e288;if(_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x41')]){_0x26f472[_0x7c2c('0x42')]=[{'all':!![]}];}return db['UserProfileResource'][_0x7c2c('0x43')](_0x26f472);})['then'](function(_0x2c3f40){_0x5769ec[_0x7c2c('0x44')]=_0x2c3f40;return _0x5769ec;})['then'](respondWithFilteredResult(_0xf2bfd1,_0x26f472))[_0x7c2c('0x45')](handleError(_0xf2bfd1,null));};exports['show']=function(_0x3014fb,_0x33b2be){var _0x9b9813={'raw':![],'where':{'id':_0x3014fb['params']['id']}},_0x26351e={};_0x26351e[_0x7c2c('0x31')]=_['keys'](db['UserProfileResource'][_0x7c2c('0x2d')]);_0x26351e[_0x7c2c('0x32')]=_[_0x7c2c('0x46')](_0x3014fb['query']);_0x26351e[_0x7c2c('0x33')]=_[_0x7c2c('0x34')](_0x26351e['model'],_0x26351e[_0x7c2c('0x32')]);_0x9b9813['attributes']=_[_0x7c2c('0x34')](_0x26351e[_0x7c2c('0x31')],qs['fields'](_0x3014fb['query'][_0x7c2c('0x35')]));_0x9b9813[_0x7c2c('0x36')]=_0x9b9813['attributes'][_0x7c2c('0x37')]?_0x9b9813['attributes']:_0x26351e['model'];if(_0x3014fb[_0x7c2c('0x32')][_0x7c2c('0x41')]){_0x9b9813[_0x7c2c('0x42')]=[{'all':!![]}];}_0x9b9813=_[_0x7c2c('0x3e')]({},_0x9b9813,_0x3014fb[_0x7c2c('0x40')]);return db[_0x7c2c('0x2c')][_0x7c2c('0x47')](_0x9b9813)[_0x7c2c('0x26')](handleEntityNotFound(_0x33b2be,null))[_0x7c2c('0x26')](respondWithResult(_0x33b2be,null))['catch'](handleError(_0x33b2be,null));};exports['create']=function(_0xeb067b,_0x3091bd){return db[_0x7c2c('0x2c')]['create'](_0xeb067b['body'],{})[_0x7c2c('0x26')](respondWithResult(_0x3091bd,0xc9))[_0x7c2c('0x45')](handleError(_0x3091bd,null));};exports[_0x7c2c('0x24')]=function(_0x2b79d5,_0x5f3de8){if(_0x2b79d5['body']['id']){delete _0x2b79d5['body']['id'];}return db[_0x7c2c('0x2c')][_0x7c2c('0x47')]({'where':{'id':_0x2b79d5[_0x7c2c('0x48')]['id']}})[_0x7c2c('0x26')](handleEntityNotFound(_0x5f3de8,null))[_0x7c2c('0x26')](saveUpdates(_0x2b79d5['body'],null))[_0x7c2c('0x26')](respondWithResult(_0x5f3de8,null))[_0x7c2c('0x45')](handleError(_0x5f3de8,null));};exports['destroy']=function(_0x19621a,_0x56e09d){return db[_0x7c2c('0x2c')][_0x7c2c('0x47')]({'where':{'id':_0x19621a[_0x7c2c('0x48')]['id']}})['then'](handleEntityNotFound(_0x56e09d,null))['then'](removeEntity(_0x56e09d,null))[_0x7c2c('0x45')](handleError(_0x56e09d,null));};exports['describe']=function(_0x13e0bf,_0x11d337){return db['UserProfileResource'][_0x7c2c('0x49')]()[_0x7c2c('0x26')](respondWithResult(_0x11d337,null))['catch'](handleError(_0x11d337,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 0dcf04a..0e0ab69 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 _0xe726=['../../config/environment','./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources','compositeIndex','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0xc31da9,_0x5ba046){var _0x3323d9=function(_0x502ab8){while(--_0x502ab8){_0xc31da9['push'](_0xc31da9['shift']());}};_0x3323d9(++_0x5ba046);}(_0xe726,0xb7));var _0x6e72=function(_0x1e073a,_0x18028c){_0x1e073a=_0x1e073a-0x0;var _0x2a877d=_0xe726[_0x1e073a];return _0x2a877d;};'use strict';var _=require(_0x6e72('0x0'));var util=require(_0x6e72('0x1'));var logger=require(_0x6e72('0x2'))(_0x6e72('0x3'));var moment=require(_0x6e72('0x4'));var BPromise=require(_0x6e72('0x5'));var rp=require(_0x6e72('0x6'));var fs=require('fs');var path=require(_0x6e72('0x7'));var rimraf=require(_0x6e72('0x8'));var config=require(_0x6e72('0x9'));var attributes=require(_0x6e72('0xa'));module[_0x6e72('0xb')]=function(_0x38603e,_0x4243c0){return _0x38603e[_0x6e72('0xc')](_0x6e72('0xd'),attributes,{'tableName':_0x6e72('0xe'),'paranoid':![],'indexes':[{'name':_0x6e72('0xf'),'fields':['resourceId','sectionId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x9584=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources','lodash','../../config/logger','api'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x9584,0x115));var _0x4958=function(_0x5c62af,_0x211b85){_0x5c62af=_0x5c62af-0x0;var _0x1608d1=_0x9584[_0x5c62af];return _0x1608d1;};'use strict';var _=require(_0x4958('0x0'));var util=require('util');var logger=require(_0x4958('0x1'))(_0x4958('0x2'));var moment=require(_0x4958('0x3'));var BPromise=require(_0x4958('0x4'));var rp=require(_0x4958('0x5'));var fs=require('fs');var path=require(_0x4958('0x6'));var rimraf=require(_0x4958('0x7'));var config=require(_0x4958('0x8'));var attributes=require(_0x4958('0x9'));module[_0x4958('0xa')]=function(_0x2898f3,_0x4c26e4){return _0x2898f3[_0x4958('0xb')](_0x4958('0xc'),attributes,{'tableName':_0x4958('0xd'),'paranoid':![],'indexes':[{'name':'compositeIndex','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 d0aebcd..6242693 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 _0xd88d=['debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','UserProfileResource,\x20%s,\x20%s','request\x20sent'];(function(_0x17b9f3,_0x2d4d46){var _0x539941=function(_0x45a99c){while(--_0x45a99c){_0x17b9f3['push'](_0x17b9f3['shift']());}};_0x539941(++_0x2d4d46);}(_0xd88d,0x158));var _0xdd88=function(_0x25b746,_0x5d0267){_0x25b746=_0x25b746-0x0;var _0x4a2712=_0xd88d[_0x25b746];return _0x4a2712;};'use strict';var _=require(_0xdd88('0x0'));var util=require(_0xdd88('0x1'));var moment=require(_0xdd88('0x2'));var BPromise=require(_0xdd88('0x3'));var rs=require(_0xdd88('0x4'));var fs=require('fs');var Redis=require(_0xdd88('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdd88('0x6'));var logger=require(_0xdd88('0x7'))(_0xdd88('0x8'));var config=require(_0xdd88('0x9'));var jayson=require(_0xdd88('0xa'));var client=jayson['client'][_0xdd88('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x451acf,_0x43fc52,_0x4f901f){return new BPromise(function(_0x1b92cc,_0xcc8a53){return client[_0xdd88('0xc')](_0x451acf,_0x4f901f)['then'](function(_0xe3deb5){logger[_0xdd88('0xd')](_0xdd88('0xe'),_0x43fc52,_0xdd88('0xf'));logger[_0xdd88('0x10')](_0xdd88('0x11'),_0x43fc52,_0xdd88('0xf'),JSON[_0xdd88('0x12')](_0xe3deb5));if(_0xe3deb5[_0xdd88('0x13')]){if(_0xe3deb5[_0xdd88('0x13')][_0xdd88('0x14')]===0x1f4){logger['error'](_0xdd88('0xe'),_0x43fc52,_0xe3deb5['error']['message']);return _0xcc8a53(_0xe3deb5[_0xdd88('0x13')]['message']);}logger[_0xdd88('0x13')]('UserProfileResource,\x20%s,\x20%s',_0x43fc52,_0xe3deb5[_0xdd88('0x13')][_0xdd88('0x15')]);return _0x1b92cc(_0xe3deb5[_0xdd88('0x13')][_0xdd88('0x15')]);}else{logger['info'](_0xdd88('0xe'),_0x43fc52,_0xdd88('0xf'));_0x1b92cc(_0xe3deb5[_0xdd88('0x16')][_0xdd88('0x15')]);}})[_0xdd88('0x17')](function(_0x51101c){logger['error']('UserProfileResource,\x20%s,\x20%s',_0x43fc52,_0x51101c);_0xcc8a53(_0x51101c);});});} \ No newline at end of file +var _0xe1b5=['error','code','message','result','catch','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','UserProfileResource,\x20%s,\x20%s','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe1b5,0xc2));var _0x5e1b=function(_0xbb4c6f,_0x4cc9d2){_0xbb4c6f=_0xbb4c6f-0x0;var _0x4cc20c=_0xe1b5[_0xbb4c6f];return _0x4cc20c;};'use strict';var _=require('lodash');var util=require(_0x5e1b('0x0'));var moment=require(_0x5e1b('0x1'));var BPromise=require(_0x5e1b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5e1b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5e1b('0x4'));var logger=require(_0x5e1b('0x5'))(_0x5e1b('0x6'));var config=require(_0x5e1b('0x7'));var jayson=require(_0x5e1b('0x8'));var client=jayson[_0x5e1b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x516377,_0x217f5f,_0x5323e4){return new BPromise(function(_0x25a6ee,_0x150ec3){return client['request'](_0x516377,_0x5323e4)['then'](function(_0x222736){logger[_0x5e1b('0xa')](_0x5e1b('0xb'),_0x217f5f,'request\x20sent');logger[_0x5e1b('0xc')](_0x5e1b('0xd'),_0x217f5f,_0x5e1b('0xe'),JSON[_0x5e1b('0xf')](_0x222736));if(_0x222736['error']){if(_0x222736[_0x5e1b('0x10')][_0x5e1b('0x11')]===0x1f4){logger[_0x5e1b('0x10')]('UserProfileResource,\x20%s,\x20%s',_0x217f5f,_0x222736['error'][_0x5e1b('0x12')]);return _0x150ec3(_0x222736['error'][_0x5e1b('0x12')]);}logger[_0x5e1b('0x10')](_0x5e1b('0xb'),_0x217f5f,_0x222736[_0x5e1b('0x10')]['message']);return _0x25a6ee(_0x222736[_0x5e1b('0x10')]['message']);}else{logger[_0x5e1b('0xa')]('UserProfileResource,\x20%s,\x20%s',_0x217f5f,_0x5e1b('0xe'));_0x25a6ee(_0x222736[_0x5e1b('0x13')]['message']);}})[_0x5e1b('0x14')](function(_0x16db54){logger['error'](_0x5e1b('0xb'),_0x217f5f,_0x16db54);_0x150ec3(_0x16db54);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 38ba4a6..370241e 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 _0xd8df=['describe','/:id','show','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','get','isAuthenticated','index','/describe'];(function(_0x19c780,_0x400e30){var _0x2a8139=function(_0x2f548c){while(--_0x2f548c){_0x19c780['push'](_0x19c780['shift']());}};_0x2a8139(++_0x400e30);}(_0xd8df,0x67));var _0xfd8d=function(_0xbce1fe,_0x2a6cb6){_0xbce1fe=_0xbce1fe-0x0;var _0x7d1eb9=_0xd8df[_0xbce1fe];return _0x7d1eb9;};'use strict';var multer=require(_0xfd8d('0x0'));var util=require(_0xfd8d('0x1'));var path=require(_0xfd8d('0x2'));var timeout=require(_0xfd8d('0x3'));var express=require(_0xfd8d('0x4'));var router=express[_0xfd8d('0x5')]();var fs_extra=require(_0xfd8d('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./userProfileSection.controller');router[_0xfd8d('0x7')]('/',auth[_0xfd8d('0x8')](),controller[_0xfd8d('0x9')]);router[_0xfd8d('0x7')](_0xfd8d('0xa'),auth[_0xfd8d('0x8')](),controller[_0xfd8d('0xb')]);router[_0xfd8d('0x7')](_0xfd8d('0xc'),auth[_0xfd8d('0x8')](),controller[_0xfd8d('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xfd8d('0xe')]);router[_0xfd8d('0xf')](_0xfd8d('0xc'),auth[_0xfd8d('0x8')](),controller['update']);router[_0xfd8d('0x10')](_0xfd8d('0xc'),auth[_0xfd8d('0x8')](),controller[_0xfd8d('0x11')]);module[_0xfd8d('0x12')]=router; \ No newline at end of file +var _0x61df=['index','/describe','describe','show','create','update','delete','/:id','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x134974,_0x3b450b){var _0x28c53f=function(_0x2b5c93){while(--_0x2b5c93){_0x134974['push'](_0x134974['shift']());}};_0x28c53f(++_0x3b450b);}(_0x61df,0x199));var _0xf61d=function(_0x562beb,_0x5de96c){_0x562beb=_0x562beb-0x0;var _0xf449d=_0x61df[_0x562beb];return _0xf449d;};'use strict';var multer=require(_0xf61d('0x0'));var util=require('util');var path=require(_0xf61d('0x1'));var timeout=require(_0xf61d('0x2'));var express=require(_0xf61d('0x3'));var router=express[_0xf61d('0x4')]();var fs_extra=require(_0xf61d('0x5'));var auth=require(_0xf61d('0x6'));var interaction=require(_0xf61d('0x7'));var config=require(_0xf61d('0x8'));var controller=require('./userProfileSection.controller');router[_0xf61d('0x9')]('/',auth[_0xf61d('0xa')](),controller[_0xf61d('0xb')]);router['get'](_0xf61d('0xc'),auth['isAuthenticated'](),controller[_0xf61d('0xd')]);router[_0xf61d('0x9')]('/:id',auth[_0xf61d('0xa')](),controller[_0xf61d('0xe')]);router['post']('/',auth[_0xf61d('0xa')](),controller[_0xf61d('0xf')]);router['put']('/:id',auth[_0xf61d('0xa')](),controller[_0xf61d('0x10')]);router[_0xf61d('0x11')](_0xf61d('0x12'),auth[_0xf61d('0xa')](),controller[_0xf61d('0x13')]);module[_0xf61d('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 ac7ac52..ebf219e 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 _0x373d=['STRING','INTEGER','BOOLEAN','setDataValue','getDataValue','crudPermissions','sequelize'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x373d,0x1e2));var _0xd373=function(_0x12ddd3,_0x175755){_0x12ddd3=_0x12ddd3-0x0;var _0x116185=_0x373d[_0x12ddd3];return _0x116185;};'use strict';var Sequelize=require(_0xd373('0x0'));module['exports']={'name':{'type':Sequelize[_0xd373('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0xd373('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xd373('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0xd373('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xd373('0x1')],'set':function(_0x547fca){this[_0xd373('0x4')]('crudPermissions',_0x547fca?_0x547fca['join'](''):[]);},'get':function(){return this[_0xd373('0x5')](_0xd373('0x6'))?this[_0xd373('0x5')](_0xd373('0x6'))['split'](''):[];}}}; \ No newline at end of file +var _0x7d25=['INTEGER','BOOLEAN','getDataValue','crudPermissions','split','exports','STRING'];(function(_0x1b98b4,_0xb1826a){var _0x448bb3=function(_0x15ac17){while(--_0x15ac17){_0x1b98b4['push'](_0x1b98b4['shift']());}};_0x448bb3(++_0xb1826a);}(_0x7d25,0x8a));var _0x57d2=function(_0x36ed3c,_0x44a00a){_0x36ed3c=_0x36ed3c-0x0;var _0x52a2e0=_0x7d25[_0x36ed3c];return _0x52a2e0;};'use strict';var Sequelize=require('sequelize');module[_0x57d2('0x0')]={'name':{'type':Sequelize[_0x57d2('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0x57d2('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x57d2('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0x57d2('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x57d2('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x57d2('0x1')],'set':function(_0x5c1baa){this['setDataValue']('crudPermissions',_0x5c1baa?_0x5c1baa['join'](''):[]);},'get':function(){return this[_0x57d2('0x4')]('crudPermissions')?this[_0x57d2('0x4')](_0x57d2('0x5'))[_0x57d2('0x6')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index e065bf0..6214a6d 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 _0x7ee8=['../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','map','UserProfileSection','rawAttributes','type','model','query','keys','filters','intersection','attributes','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x265628,_0x397fdd){var _0x30dc6e=function(_0x42be15){while(--_0x42be15){_0x265628['push'](_0x265628['shift']());}};_0x30dc6e(++_0x397fdd);}(_0x7ee8,0xcd));var _0x87ee=function(_0x38d6e8,_0x21c3b9){_0x38d6e8=_0x38d6e8-0x0;var _0x37e27f=_0x7ee8[_0x38d6e8];return _0x37e27f;};'use strict';var emlformat=require(_0x87ee('0x0'));var rimraf=require(_0x87ee('0x1'));var zipdir=require(_0x87ee('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x87ee('0x3'));var moment=require(_0x87ee('0x4'));var BPromise=require(_0x87ee('0x5'));var Mustache=require(_0x87ee('0x6'));var util=require(_0x87ee('0x7'));var path=require(_0x87ee('0x8'));var sox=require(_0x87ee('0x9'));var csv=require('to-csv');var ejs=require(_0x87ee('0xa'));var fs=require('fs');var fs_extra=require(_0x87ee('0xb'));var _=require(_0x87ee('0xc'));var squel=require(_0x87ee('0xd'));var crypto=require(_0x87ee('0xe'));var jsforce=require(_0x87ee('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x87ee('0x10'));var querystring=require(_0x87ee('0x11'));var Papa=require(_0x87ee('0x12'));var Redis=require(_0x87ee('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x87ee('0x14'));var as=require(_0x87ee('0x15'));var hardwareService=require(_0x87ee('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x87ee('0x17'));var config=require(_0x87ee('0x18'));var licenseUtil=require(_0x87ee('0x19'));var db=require(_0x87ee('0x1a'))['db'];function respondWithStatusCode(_0x5807df,_0x32c563){_0x32c563=_0x32c563||0xcc;return function(_0x4eb9e0){if(_0x4eb9e0){return _0x5807df[_0x87ee('0x1b')](_0x32c563);}return _0x5807df[_0x87ee('0x1c')](_0x32c563)[_0x87ee('0x1d')]();};}function respondWithResult(_0x33a0fa,_0x422923){_0x422923=_0x422923||0xc8;return function(_0x5431bd){if(_0x5431bd){return _0x33a0fa[_0x87ee('0x1c')](_0x422923)['json'](_0x5431bd);}};}function respondWithFilteredResult(_0x40dcef,_0x1fbf9b){return function(_0x3c1bd4){if(_0x3c1bd4){var _0xc9e9f5=typeof _0x1fbf9b[_0x87ee('0x1e')]===_0x87ee('0x1f')&&typeof _0x1fbf9b[_0x87ee('0x20')]===_0x87ee('0x1f');var _0x5551d8=_0x3c1bd4[_0x87ee('0x21')];var _0x33435a=_0xc9e9f5?0x0:_0x1fbf9b[_0x87ee('0x1e')];var _0x474b8f=_0xc9e9f5?_0x3c1bd4[_0x87ee('0x21')]:_0x1fbf9b['offset']+_0x1fbf9b[_0x87ee('0x20')];var _0x535520;if(_0x474b8f>=_0x5551d8){_0x474b8f=_0x5551d8;_0x535520=0xc8;}else{_0x535520=0xce;}_0x40dcef[_0x87ee('0x1c')](_0x535520);return _0x40dcef[_0x87ee('0x22')](_0x87ee('0x23'),_0x33435a+'-'+_0x474b8f+'/'+_0x5551d8)[_0x87ee('0x24')](_0x3c1bd4);}return null;};}function patchUpdates(_0x4f966e){return function(_0x4757a5){try{jsonpatch[_0x87ee('0x25')](_0x4757a5,_0x4f966e,!![]);}catch(_0x3fe0f1){return BPromise[_0x87ee('0x26')](_0x3fe0f1);}return _0x4757a5[_0x87ee('0x27')]();};}function saveUpdates(_0x22ea24,_0x4231de){return function(_0x53cd42){if(_0x53cd42){return _0x53cd42[_0x87ee('0x28')](_0x22ea24)[_0x87ee('0x29')](function(_0x36d3c6){return _0x36d3c6;});}return null;};}function removeEntity(_0x484a73,_0x4b6f31){return function(_0x5ac28b){if(_0x5ac28b){return _0x5ac28b['destroy']()[_0x87ee('0x29')](function(){_0x484a73[_0x87ee('0x1c')](0xcc)[_0x87ee('0x1d')]();});}};}function handleEntityNotFound(_0x4eb011,_0x1d03f8){return function(_0x2e69ca){if(!_0x2e69ca){_0x4eb011[_0x87ee('0x1b')](0x194);}return _0x2e69ca;};}function handleError(_0x160566,_0x2d08f6){_0x2d08f6=_0x2d08f6||0x1f4;return function(_0x1c1a9c){logger[_0x87ee('0x2a')](_0x1c1a9c[_0x87ee('0x2b')]);if(_0x1c1a9c[_0x87ee('0x2c')]){delete _0x1c1a9c['name'];}_0x160566[_0x87ee('0x1c')](_0x2d08f6)[_0x87ee('0x2d')](_0x1c1a9c);};}exports[_0x87ee('0x2e')]=function(_0x2a17ff,_0x4e5b0f){var _0x5bbc10={},_0x2c24a2={},_0x474b9e={'count':0x0,'rows':[]};var _0x2d08a8=_[_0x87ee('0x2f')](db[_0x87ee('0x30')][_0x87ee('0x31')],function(_0x50c67d){return{'name':_0x50c67d['fieldName'],'type':_0x50c67d[_0x87ee('0x32')]['key']};});_0x2c24a2[_0x87ee('0x33')]=_['map'](_0x2d08a8,'name');_0x2c24a2[_0x87ee('0x34')]=_[_0x87ee('0x35')](_0x2a17ff[_0x87ee('0x34')]);_0x2c24a2[_0x87ee('0x36')]=_[_0x87ee('0x37')](_0x2c24a2['model'],_0x2c24a2[_0x87ee('0x34')]);_0x5bbc10['attributes']=_['intersection'](_0x2c24a2['model'],qs['fields'](_0x2a17ff[_0x87ee('0x34')]['fields']));_0x5bbc10[_0x87ee('0x38')]=_0x5bbc10[_0x87ee('0x38')]['length']?_0x5bbc10[_0x87ee('0x38')]:_0x2c24a2[_0x87ee('0x33')];if(!_0x2a17ff[_0x87ee('0x34')]['hasOwnProperty'](_0x87ee('0x39'))){_0x5bbc10['limit']=qs['limit'](_0x2a17ff[_0x87ee('0x34')][_0x87ee('0x20')]);_0x5bbc10[_0x87ee('0x1e')]=qs[_0x87ee('0x1e')](_0x2a17ff[_0x87ee('0x34')]['offset']);}_0x5bbc10['order']=qs[_0x87ee('0x3a')](_0x2a17ff['query']['sort']);_0x5bbc10['where']=qs[_0x87ee('0x36')](_[_0x87ee('0x3b')](_0x2a17ff['query'],_0x2c24a2[_0x87ee('0x36')]),_0x2d08a8);if(_0x2a17ff[_0x87ee('0x34')][_0x87ee('0x3c')]){_0x5bbc10[_0x87ee('0x3d')]=_['merge'](_0x5bbc10[_0x87ee('0x3d')],{'$or':_[_0x87ee('0x2f')](_0x2d08a8,function(_0x511c7f){if(_0x511c7f['type']!==_0x87ee('0x3e')){var _0x805069={};_0x805069[_0x511c7f[_0x87ee('0x2c')]]={'$like':'%'+_0x2a17ff[_0x87ee('0x34')][_0x87ee('0x3c')]+'%'};return _0x805069;}})});}_0x5bbc10=_[_0x87ee('0x3f')]({},_0x5bbc10,_0x2a17ff[_0x87ee('0x40')]);var _0x4f95cd={'where':_0x5bbc10[_0x87ee('0x3d')]};return db[_0x87ee('0x30')][_0x87ee('0x21')](_0x4f95cd)[_0x87ee('0x29')](function(_0x3fd380){_0x474b9e['count']=_0x3fd380;if(_0x2a17ff[_0x87ee('0x34')][_0x87ee('0x41')]){_0x5bbc10[_0x87ee('0x42')]=[{'all':!![]}];}return db[_0x87ee('0x30')][_0x87ee('0x43')](_0x5bbc10);})['then'](function(_0x5ec477){_0x474b9e[_0x87ee('0x44')]=_0x5ec477;return _0x474b9e;})['then'](respondWithFilteredResult(_0x4e5b0f,_0x5bbc10))[_0x87ee('0x45')](handleError(_0x4e5b0f,null));};exports[_0x87ee('0x46')]=function(_0x3fdeb8,_0x58e323){var _0x59e4a7={'raw':![],'where':{'id':_0x3fdeb8[_0x87ee('0x47')]['id']}},_0x2e249a={};_0x2e249a[_0x87ee('0x33')]=_[_0x87ee('0x35')](db['UserProfileSection'][_0x87ee('0x31')]);_0x2e249a[_0x87ee('0x34')]=_[_0x87ee('0x35')](_0x3fdeb8[_0x87ee('0x34')]);_0x2e249a[_0x87ee('0x36')]=_['intersection'](_0x2e249a['model'],_0x2e249a[_0x87ee('0x34')]);_0x59e4a7['attributes']=_[_0x87ee('0x37')](_0x2e249a[_0x87ee('0x33')],qs[_0x87ee('0x48')](_0x3fdeb8['query'][_0x87ee('0x48')]));_0x59e4a7[_0x87ee('0x38')]=_0x59e4a7['attributes']['length']?_0x59e4a7['attributes']:_0x2e249a['model'];if(_0x3fdeb8[_0x87ee('0x34')][_0x87ee('0x41')]){_0x59e4a7[_0x87ee('0x42')]=[{'all':!![]}];}_0x59e4a7=_[_0x87ee('0x3f')]({},_0x59e4a7,_0x3fdeb8['options']);return db[_0x87ee('0x30')][_0x87ee('0x49')](_0x59e4a7)[_0x87ee('0x29')](handleEntityNotFound(_0x58e323,null))[_0x87ee('0x29')](respondWithResult(_0x58e323,null))[_0x87ee('0x45')](handleError(_0x58e323,null));};exports[_0x87ee('0x4a')]=function(_0x5a671b,_0x153516){return db['UserProfileSection'][_0x87ee('0x4a')](_0x5a671b['body'],{})[_0x87ee('0x29')](respondWithResult(_0x153516,0xc9))['catch'](handleError(_0x153516,null));};exports[_0x87ee('0x28')]=function(_0x2c8506,_0x30cfcd){if(_0x2c8506[_0x87ee('0x4b')]['id']){delete _0x2c8506[_0x87ee('0x4b')]['id'];}return db['UserProfileSection'][_0x87ee('0x49')]({'where':{'id':_0x2c8506[_0x87ee('0x47')]['id']}})[_0x87ee('0x29')](handleEntityNotFound(_0x30cfcd,null))[_0x87ee('0x29')](saveUpdates(_0x2c8506[_0x87ee('0x4b')],null))[_0x87ee('0x29')](respondWithResult(_0x30cfcd,null))[_0x87ee('0x45')](handleError(_0x30cfcd,null));};exports[_0x87ee('0x4c')]=function(_0x4f9363,_0x315419){return db[_0x87ee('0x30')][_0x87ee('0x49')]({'where':{'id':_0x4f9363[_0x87ee('0x47')]['id']}})[_0x87ee('0x29')](handleEntityNotFound(_0x315419,null))[_0x87ee('0x29')](removeEntity(_0x315419,null))[_0x87ee('0x45')](handleError(_0x315419,null));};exports['describe']=function(_0x45c1ca,_0x2047f1){return db[_0x87ee('0x30')]['describe']()['then'](respondWithResult(_0x2047f1,null))[_0x87ee('0x45')](handleError(_0x2047f1,null));}; \ No newline at end of file +var _0x6f9f=['fields','length','nolimit','order','sort','where','filters','pick','type','VIRTUAL','filter','merge','options','then','includeAll','include','rows','catch','show','intersection','find','create','body','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','offset','undefined','limit','count','json','apply','reject','save','update','destroy','error','stack','name','send','index','map','UserProfileSection','rawAttributes','fieldName','key','model','query','keys','attributes'];(function(_0x2ce8b6,_0xf7c246){var _0x35b697=function(_0x2c7569){while(--_0x2c7569){_0x2ce8b6['push'](_0x2ce8b6['shift']());}};_0x35b697(++_0xf7c246);}(_0x6f9f,0x140));var _0xf6f9=function(_0x492dcc,_0x36d0dd){_0x492dcc=_0x492dcc-0x0;var _0x387c79=_0x6f9f[_0x492dcc];return _0x387c79;};'use strict';var emlformat=require(_0xf6f9('0x0'));var rimraf=require(_0xf6f9('0x1'));var zipdir=require(_0xf6f9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf6f9('0x3'));var moment=require(_0xf6f9('0x4'));var BPromise=require(_0xf6f9('0x5'));var Mustache=require(_0xf6f9('0x6'));var util=require(_0xf6f9('0x7'));var path=require(_0xf6f9('0x8'));var sox=require(_0xf6f9('0x9'));var csv=require(_0xf6f9('0xa'));var ejs=require(_0xf6f9('0xb'));var fs=require('fs');var fs_extra=require(_0xf6f9('0xc'));var _=require(_0xf6f9('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf6f9('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xf6f9('0xa'));var querystring=require('querystring');var Papa=require(_0xf6f9('0xf'));var Redis=require(_0xf6f9('0x10'));var authService=require(_0xf6f9('0x11'));var qs=require(_0xf6f9('0x12'));var as=require(_0xf6f9('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf6f9('0x14'))('api');var utils=require(_0xf6f9('0x15'));var config=require(_0xf6f9('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f69cc,_0x1e62e1){_0x1e62e1=_0x1e62e1||0xcc;return function(_0x596194){if(_0x596194){return _0x1f69cc[_0xf6f9('0x17')](_0x1e62e1);}return _0x1f69cc[_0xf6f9('0x18')](_0x1e62e1)[_0xf6f9('0x19')]();};}function respondWithResult(_0x24a3e6,_0x663d2d){_0x663d2d=_0x663d2d||0xc8;return function(_0x2e0218){if(_0x2e0218){return _0x24a3e6[_0xf6f9('0x18')](_0x663d2d)['json'](_0x2e0218);}};}function respondWithFilteredResult(_0x5817d3,_0x2c1499){return function(_0x30f511){if(_0x30f511){var _0x1af042=typeof _0x2c1499[_0xf6f9('0x1a')]===_0xf6f9('0x1b')&&typeof _0x2c1499[_0xf6f9('0x1c')]===_0xf6f9('0x1b');var _0x1d6b14=_0x30f511[_0xf6f9('0x1d')];var _0x5bc2e4=_0x1af042?0x0:_0x2c1499['offset'];var _0xefc342=_0x1af042?_0x30f511[_0xf6f9('0x1d')]:_0x2c1499[_0xf6f9('0x1a')]+_0x2c1499['limit'];var _0x2752f0;if(_0xefc342>=_0x1d6b14){_0xefc342=_0x1d6b14;_0x2752f0=0xc8;}else{_0x2752f0=0xce;}_0x5817d3['status'](_0x2752f0);return _0x5817d3['set']('Content-Range',_0x5bc2e4+'-'+_0xefc342+'/'+_0x1d6b14)[_0xf6f9('0x1e')](_0x30f511);}return null;};}function patchUpdates(_0x5619ce){return function(_0x385ade){try{jsonpatch[_0xf6f9('0x1f')](_0x385ade,_0x5619ce,!![]);}catch(_0x194a00){return BPromise[_0xf6f9('0x20')](_0x194a00);}return _0x385ade[_0xf6f9('0x21')]();};}function saveUpdates(_0x1d8428,_0x29f8ae){return function(_0x4bee52){if(_0x4bee52){return _0x4bee52[_0xf6f9('0x22')](_0x1d8428)['then'](function(_0x313935){return _0x313935;});}return null;};}function removeEntity(_0x1c1532,_0x575e5c){return function(_0x17170a){if(_0x17170a){return _0x17170a[_0xf6f9('0x23')]()['then'](function(){_0x1c1532[_0xf6f9('0x18')](0xcc)[_0xf6f9('0x19')]();});}};}function handleEntityNotFound(_0x326900,_0x42a226){return function(_0x45d9a0){if(!_0x45d9a0){_0x326900[_0xf6f9('0x17')](0x194);}return _0x45d9a0;};}function handleError(_0x84fa85,_0x1c882b){_0x1c882b=_0x1c882b||0x1f4;return function(_0x4a8d52){logger[_0xf6f9('0x24')](_0x4a8d52[_0xf6f9('0x25')]);if(_0x4a8d52['name']){delete _0x4a8d52[_0xf6f9('0x26')];}_0x84fa85[_0xf6f9('0x18')](_0x1c882b)[_0xf6f9('0x27')](_0x4a8d52);};}exports[_0xf6f9('0x28')]=function(_0x2b033a,_0x158d9c){var _0x1a648e={},_0x51c5ac={},_0x442e28={'count':0x0,'rows':[]};var _0x5f2a29=_[_0xf6f9('0x29')](db[_0xf6f9('0x2a')][_0xf6f9('0x2b')],function(_0x80075a){return{'name':_0x80075a[_0xf6f9('0x2c')],'type':_0x80075a['type'][_0xf6f9('0x2d')]};});_0x51c5ac[_0xf6f9('0x2e')]=_[_0xf6f9('0x29')](_0x5f2a29,_0xf6f9('0x26'));_0x51c5ac[_0xf6f9('0x2f')]=_[_0xf6f9('0x30')](_0x2b033a[_0xf6f9('0x2f')]);_0x51c5ac['filters']=_['intersection'](_0x51c5ac[_0xf6f9('0x2e')],_0x51c5ac[_0xf6f9('0x2f')]);_0x1a648e[_0xf6f9('0x31')]=_['intersection'](_0x51c5ac[_0xf6f9('0x2e')],qs[_0xf6f9('0x32')](_0x2b033a[_0xf6f9('0x2f')][_0xf6f9('0x32')]));_0x1a648e[_0xf6f9('0x31')]=_0x1a648e[_0xf6f9('0x31')][_0xf6f9('0x33')]?_0x1a648e[_0xf6f9('0x31')]:_0x51c5ac['model'];if(!_0x2b033a[_0xf6f9('0x2f')]['hasOwnProperty'](_0xf6f9('0x34'))){_0x1a648e[_0xf6f9('0x1c')]=qs[_0xf6f9('0x1c')](_0x2b033a[_0xf6f9('0x2f')][_0xf6f9('0x1c')]);_0x1a648e['offset']=qs[_0xf6f9('0x1a')](_0x2b033a[_0xf6f9('0x2f')][_0xf6f9('0x1a')]);}_0x1a648e[_0xf6f9('0x35')]=qs[_0xf6f9('0x36')](_0x2b033a[_0xf6f9('0x2f')]['sort']);_0x1a648e[_0xf6f9('0x37')]=qs[_0xf6f9('0x38')](_[_0xf6f9('0x39')](_0x2b033a['query'],_0x51c5ac['filters']),_0x5f2a29);if(_0x2b033a['query']['filter']){_0x1a648e[_0xf6f9('0x37')]=_['merge'](_0x1a648e[_0xf6f9('0x37')],{'$or':_[_0xf6f9('0x29')](_0x5f2a29,function(_0x1c9d95){if(_0x1c9d95[_0xf6f9('0x3a')]!==_0xf6f9('0x3b')){var _0x2b0a36={};_0x2b0a36[_0x1c9d95[_0xf6f9('0x26')]]={'$like':'%'+_0x2b033a[_0xf6f9('0x2f')][_0xf6f9('0x3c')]+'%'};return _0x2b0a36;}})});}_0x1a648e=_[_0xf6f9('0x3d')]({},_0x1a648e,_0x2b033a[_0xf6f9('0x3e')]);var _0x410483={'where':_0x1a648e['where']};return db[_0xf6f9('0x2a')]['count'](_0x410483)[_0xf6f9('0x3f')](function(_0x3d1c30){_0x442e28['count']=_0x3d1c30;if(_0x2b033a[_0xf6f9('0x2f')][_0xf6f9('0x40')]){_0x1a648e[_0xf6f9('0x41')]=[{'all':!![]}];}return db[_0xf6f9('0x2a')]['findAll'](_0x1a648e);})[_0xf6f9('0x3f')](function(_0x8709c3){_0x442e28[_0xf6f9('0x42')]=_0x8709c3;return _0x442e28;})[_0xf6f9('0x3f')](respondWithFilteredResult(_0x158d9c,_0x1a648e))[_0xf6f9('0x43')](handleError(_0x158d9c,null));};exports[_0xf6f9('0x44')]=function(_0x105c94,_0x370aa7){var _0x44664d={'raw':![],'where':{'id':_0x105c94['params']['id']}},_0x407f22={};_0x407f22[_0xf6f9('0x2e')]=_['keys'](db[_0xf6f9('0x2a')][_0xf6f9('0x2b')]);_0x407f22['query']=_['keys'](_0x105c94['query']);_0x407f22[_0xf6f9('0x38')]=_['intersection'](_0x407f22[_0xf6f9('0x2e')],_0x407f22[_0xf6f9('0x2f')]);_0x44664d['attributes']=_[_0xf6f9('0x45')](_0x407f22['model'],qs['fields'](_0x105c94[_0xf6f9('0x2f')][_0xf6f9('0x32')]));_0x44664d[_0xf6f9('0x31')]=_0x44664d[_0xf6f9('0x31')][_0xf6f9('0x33')]?_0x44664d[_0xf6f9('0x31')]:_0x407f22[_0xf6f9('0x2e')];if(_0x105c94[_0xf6f9('0x2f')][_0xf6f9('0x40')]){_0x44664d[_0xf6f9('0x41')]=[{'all':!![]}];}_0x44664d=_[_0xf6f9('0x3d')]({},_0x44664d,_0x105c94['options']);return db[_0xf6f9('0x2a')][_0xf6f9('0x46')](_0x44664d)[_0xf6f9('0x3f')](handleEntityNotFound(_0x370aa7,null))[_0xf6f9('0x3f')](respondWithResult(_0x370aa7,null))[_0xf6f9('0x43')](handleError(_0x370aa7,null));};exports[_0xf6f9('0x47')]=function(_0xe5d078,_0x4e8917){return db[_0xf6f9('0x2a')][_0xf6f9('0x47')](_0xe5d078[_0xf6f9('0x48')],{})[_0xf6f9('0x3f')](respondWithResult(_0x4e8917,0xc9))[_0xf6f9('0x43')](handleError(_0x4e8917,null));};exports[_0xf6f9('0x22')]=function(_0x42d826,_0x114fa2){if(_0x42d826['body']['id']){delete _0x42d826[_0xf6f9('0x48')]['id'];}return db['UserProfileSection']['find']({'where':{'id':_0x42d826['params']['id']}})['then'](handleEntityNotFound(_0x114fa2,null))[_0xf6f9('0x3f')](saveUpdates(_0x42d826[_0xf6f9('0x48')],null))[_0xf6f9('0x3f')](respondWithResult(_0x114fa2,null))[_0xf6f9('0x43')](handleError(_0x114fa2,null));};exports[_0xf6f9('0x23')]=function(_0x425589,_0x1bdedc){return db[_0xf6f9('0x2a')][_0xf6f9('0x46')]({'where':{'id':_0x425589[_0xf6f9('0x49')]['id']}})[_0xf6f9('0x3f')](handleEntityNotFound(_0x1bdedc,null))['then'](removeEntity(_0x1bdedc,null))[_0xf6f9('0x43')](handleError(_0x1bdedc,null));};exports['describe']=function(_0x2ad7ca,_0xf50a38){return db[_0xf6f9('0x2a')]['describe']()[_0xf6f9('0x3f')](respondWithResult(_0xf50a38,null))['catch'](handleError(_0xf50a38,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 1601836..06d6dc5 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 _0xcec6=['define','UserProfileSection','user_profile_has_sections','sectionId','userProfileId','lodash','api','moment','bluebird','path','rimraf','../../config/environment','./userProfileSection.attributes'];(function(_0x514663,_0x2035b4){var _0x5eee78=function(_0x580582){while(--_0x580582){_0x514663['push'](_0x514663['shift']());}};_0x5eee78(++_0x2035b4);}(_0xcec6,0x87));var _0x6cec=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xcec6[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x6cec('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6cec('0x1'));var moment=require(_0x6cec('0x2'));var BPromise=require(_0x6cec('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6cec('0x4'));var rimraf=require(_0x6cec('0x5'));var config=require(_0x6cec('0x6'));var attributes=require(_0x6cec('0x7'));module['exports']=function(_0x58a20d,_0x3aba01){return _0x58a20d[_0x6cec('0x8')](_0x6cec('0x9'),attributes,{'tableName':_0x6cec('0xa'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x6cec('0xb'),_0x6cec('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x67a2=['sectionId','userProfileId','util','../../config/logger','api','moment','bluebird','path','./userProfileSection.attributes','UserProfileSection','compositeIndex'];(function(_0x46bf9d,_0x21ed66){var _0x284efb=function(_0x322ba7){while(--_0x322ba7){_0x46bf9d['push'](_0x46bf9d['shift']());}};_0x284efb(++_0x21ed66);}(_0x67a2,0xf4));var _0x267a=function(_0xf7091,_0x5b78fd){_0xf7091=_0xf7091-0x0;var _0x206619=_0x67a2[_0xf7091];return _0x206619;};'use strict';var _=require('lodash');var util=require(_0x267a('0x0'));var logger=require(_0x267a('0x1'))(_0x267a('0x2'));var moment=require(_0x267a('0x3'));var BPromise=require(_0x267a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x267a('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x267a('0x6'));module['exports']=function(_0x34523b,_0x538b16){return _0x34523b['define'](_0x267a('0x7'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0x267a('0x8'),'fields':[_0x267a('0x9'),_0x267a('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index e1480a3..dcd1334 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 _0x029f=['lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x029f,0x7e));var _0xf029=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x029f[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0xf029('0x0'));var util=require(_0xf029('0x1'));var moment=require(_0xf029('0x2'));var BPromise=require('bluebird');var rs=require(_0xf029('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf029('0x4'))['db'];var utils=require(_0xf029('0x5'));var logger=require('../../config/logger')(_0xf029('0x6'));var config=require(_0xf029('0x7'));var jayson=require(_0xf029('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5a3a1a,_0x39e9d4,_0x5c02ff){return new BPromise(function(_0x4b5c3d,_0x229a76){return client[_0xf029('0x9')](_0x5a3a1a,_0x5c02ff)[_0xf029('0xa')](function(_0xbbdc31){logger['info'](_0xf029('0xb'),_0x39e9d4,_0xf029('0xc'));logger[_0xf029('0xd')](_0xf029('0xe'),_0x39e9d4,'request\x20sent',JSON[_0xf029('0xf')](_0xbbdc31));if(_0xbbdc31[_0xf029('0x10')]){if(_0xbbdc31[_0xf029('0x10')][_0xf029('0x11')]===0x1f4){logger[_0xf029('0x10')](_0xf029('0xb'),_0x39e9d4,_0xbbdc31[_0xf029('0x10')][_0xf029('0x12')]);return _0x229a76(_0xbbdc31[_0xf029('0x10')][_0xf029('0x12')]);}logger[_0xf029('0x10')](_0xf029('0xb'),_0x39e9d4,_0xbbdc31['error'][_0xf029('0x12')]);return _0x4b5c3d(_0xbbdc31['error'][_0xf029('0x12')]);}else{logger[_0xf029('0x13')](_0xf029('0xb'),_0x39e9d4,_0xf029('0xc'));_0x4b5c3d(_0xbbdc31['result'][_0xf029('0x12')]);}})[_0xf029('0x14')](function(_0x35f112){logger[_0xf029('0x10')](_0xf029('0xb'),_0x39e9d4,_0x35f112);_0x229a76(_0x35f112);});});} \ No newline at end of file +var _0x2c1b=['jayson/promise','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x2c1b,0x186));var _0xb2c1=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x2c1b[_0xfae23b];return _0x200640;};'use strict';var _=require(_0xb2c1('0x0'));var util=require(_0xb2c1('0x1'));var moment=require(_0xb2c1('0x2'));var BPromise=require(_0xb2c1('0x3'));var rs=require(_0xb2c1('0x4'));var fs=require('fs');var Redis=require(_0xb2c1('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb2c1('0x6'));var logger=require(_0xb2c1('0x7'))(_0xb2c1('0x8'));var config=require(_0xb2c1('0x9'));var jayson=require(_0xb2c1('0xa'));var client=jayson['client'][_0xb2c1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x42dd86,_0xf384e9,_0x33c59a){return new BPromise(function(_0x178e32,_0x4d1ddb){return client[_0xb2c1('0xc')](_0x42dd86,_0x33c59a)[_0xb2c1('0xd')](function(_0x537472){logger[_0xb2c1('0xe')](_0xb2c1('0xf'),_0xf384e9,_0xb2c1('0x10'));logger[_0xb2c1('0x11')](_0xb2c1('0x12'),_0xf384e9,'request\x20sent',JSON[_0xb2c1('0x13')](_0x537472));if(_0x537472[_0xb2c1('0x14')]){if(_0x537472[_0xb2c1('0x14')][_0xb2c1('0x15')]===0x1f4){logger['error'](_0xb2c1('0xf'),_0xf384e9,_0x537472[_0xb2c1('0x14')][_0xb2c1('0x16')]);return _0x4d1ddb(_0x537472[_0xb2c1('0x14')][_0xb2c1('0x16')]);}logger['error'](_0xb2c1('0xf'),_0xf384e9,_0x537472[_0xb2c1('0x14')][_0xb2c1('0x16')]);return _0x178e32(_0x537472[_0xb2c1('0x14')][_0xb2c1('0x16')]);}else{logger['info'](_0xb2c1('0xf'),_0xf384e9,_0xb2c1('0x10'));_0x178e32(_0x537472[_0xb2c1('0x17')][_0xb2c1('0x16')]);}})[_0xb2c1('0x18')](function(_0x39eff2){logger[_0xb2c1('0x14')](_0xb2c1('0xf'),_0xf384e9,_0x39eff2);_0x4d1ddb(_0x39eff2);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 7dd009f..1642af8 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x15e241,_0x3f788f){var _0x4bc336=function(_0x57338a){while(--_0x57338a){_0x15e241['push'](_0x15e241['shift']());}};_0x4bc336(++_0x3f788f);}(_0xe706,0xa3));var _0x6e70=function(_0x4c10fe,_0x19e0b2){_0x4c10fe=_0x4c10fe-0x0;var _0x5d4ffe=_0xe706[_0x4c10fe];return _0x5d4ffe;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x36560f,_0x3c978b){var _0x3aa1ed=function(_0x553a5c){while(--_0x553a5c){_0x36560f['push'](_0x36560f['shift']());}};_0x3aa1ed(++_0x3c978b);}(_0x70e0,0x17b));var _0x070e=function(_0x48f93d,_0x4b5878){_0x48f93d=_0x48f93d-0x0;var _0x4241c5=_0x70e0[_0x48f93d];return _0x4241c5;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index d0a0ac5..71eadb8 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 _0x0463=['sequelize','exports','INTEGER'];(function(_0x2b708f,_0x23e8e2){var _0x4848a3=function(_0x4bc4c8){while(--_0x4bc4c8){_0x2b708f['push'](_0x2b708f['shift']());}};_0x4848a3(++_0x23e8e2);}(_0x0463,0x144));var _0x3046=function(_0x278465,_0x1e593c){_0x278465=_0x278465-0x0;var _0x1a0ff5=_0x0463[_0x278465];return _0x1a0ff5;};'use strict';var Sequelize=require(_0x3046('0x0'));module[_0x3046('0x1')]={'penalty':{'type':Sequelize[_0x3046('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x99ce=['sequelize','INTEGER'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x99ce,0x168));var _0xe99c=function(_0x2fe383,_0x4ca01b){_0x2fe383=_0x2fe383-0x0;var _0x496a15=_0x99ce[_0x2fe383];return _0x496a15;};'use strict';var Sequelize=require(_0xe99c('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xe99c('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 00e85da..99257a6 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 _0xcaaf=['define','UserSmsQueue','user_has_sms_queues','lodash','../../config/logger','bluebird','request-promise','rimraf','exports'];(function(_0x5f4618,_0x202705){var _0x4c8c0e=function(_0x22dd3d){while(--_0x22dd3d){_0x5f4618['push'](_0x5f4618['shift']());}};_0x4c8c0e(++_0x202705);}(_0xcaaf,0x66));var _0xfcaa=function(_0x109d6c,_0x2433f5){_0x109d6c=_0x109d6c-0x0;var _0x467aad=_0xcaaf[_0x109d6c];return _0x467aad;};'use strict';var _=require(_0xfcaa('0x0'));var util=require('util');var logger=require(_0xfcaa('0x1'))('api');var moment=require('moment');var BPromise=require(_0xfcaa('0x2'));var rp=require(_0xfcaa('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfcaa('0x4'));var config=require('../../config/environment');var attributes=require('./userSmsQueue.attributes');module[_0xfcaa('0x5')]=function(_0x83f91d,_0x146224){return _0x83f91d[_0xfcaa('0x6')](_0xfcaa('0x7'),attributes,{'tableName':_0xfcaa('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2581=['request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','api','moment'];(function(_0x49abbc,_0x11e51e){var _0x2278c1=function(_0x2c6e7c){while(--_0x2c6e7c){_0x49abbc['push'](_0x49abbc['shift']());}};_0x2278c1(++_0x11e51e);}(_0x2581,0xcb));var _0x1258=function(_0x530f7f,_0x2462bb){_0x530f7f=_0x530f7f-0x0;var _0x3b6c42=_0x2581[_0x530f7f];return _0x3b6c42;};'use strict';var _=require(_0x1258('0x0'));var util=require(_0x1258('0x1'));var logger=require(_0x1258('0x2'))(_0x1258('0x3'));var moment=require(_0x1258('0x4'));var BPromise=require('bluebird');var rp=require(_0x1258('0x5'));var fs=require('fs');var path=require(_0x1258('0x6'));var rimraf=require(_0x1258('0x7'));var config=require(_0x1258('0x8'));var attributes=require(_0x1258('0x9'));module[_0x1258('0xa')]=function(_0x16c926,_0x2aeafc){return _0x16c926['define'](_0x1258('0xb'),attributes,{'tableName':_0x1258('0xc'),'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 708ded3..d2c30bb 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 _0xcb2e=['info','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','stringify','error','code','UserSmsQueue,\x20%s,\x20%s','message'];(function(_0x1f8114,_0x554a20){var _0x1d62fd=function(_0x4ccac2){while(--_0x4ccac2){_0x1f8114['push'](_0x1f8114['shift']());}};_0x1d62fd(++_0x554a20);}(_0xcb2e,0x18f));var _0xecb2=function(_0x479d60,_0x53a732){_0x479d60=_0x479d60-0x0;var _0x4edd48=_0xcb2e[_0x479d60];return _0x4edd48;};'use strict';var _=require('lodash');var util=require(_0xecb2('0x0'));var moment=require(_0xecb2('0x1'));var BPromise=require(_0xecb2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xecb2('0x3'));var db=require(_0xecb2('0x4'))['db'];var utils=require(_0xecb2('0x5'));var logger=require(_0xecb2('0x6'))('rpc');var config=require(_0xecb2('0x7'));var jayson=require(_0xecb2('0x8'));var client=jayson[_0xecb2('0x9')][_0xecb2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbf6dc5,_0x36cd91,_0x3e2509){return new BPromise(function(_0x50963a,_0x2baf55){return client[_0xecb2('0xb')](_0xbf6dc5,_0x3e2509)['then'](function(_0x4bd7a8){logger['info']('UserSmsQueue,\x20%s,\x20%s',_0x36cd91,_0xecb2('0xc'));logger[_0xecb2('0xd')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x36cd91,_0xecb2('0xc'),JSON[_0xecb2('0xe')](_0x4bd7a8));if(_0x4bd7a8[_0xecb2('0xf')]){if(_0x4bd7a8[_0xecb2('0xf')][_0xecb2('0x10')]===0x1f4){logger[_0xecb2('0xf')](_0xecb2('0x11'),_0x36cd91,_0x4bd7a8[_0xecb2('0xf')]['message']);return _0x2baf55(_0x4bd7a8[_0xecb2('0xf')][_0xecb2('0x12')]);}logger[_0xecb2('0xf')](_0xecb2('0x11'),_0x36cd91,_0x4bd7a8[_0xecb2('0xf')][_0xecb2('0x12')]);return _0x50963a(_0x4bd7a8[_0xecb2('0xf')]['message']);}else{logger[_0xecb2('0x13')]('UserSmsQueue,\x20%s,\x20%s',_0x36cd91,_0xecb2('0xc'));_0x50963a(_0x4bd7a8[_0xecb2('0x14')][_0xecb2('0x12')]);}})[_0xecb2('0x15')](function(_0x43a815){logger['error'](_0xecb2('0x11'),_0x36cd91,_0x43a815);_0x2baf55(_0x43a815);});});} \ No newline at end of file +var _0x9641=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','moment','bluebird'];(function(_0x403c8d,_0x5e3825){var _0x4ca60d=function(_0x9326c1){while(--_0x9326c1){_0x403c8d['push'](_0x403c8d['shift']());}};_0x4ca60d(++_0x5e3825);}(_0x9641,0xcc));var _0x1964=function(_0x10998a,_0x4d820d){_0x10998a=_0x10998a-0x0;var _0x461f05=_0x9641[_0x10998a];return _0x461f05;};'use strict';var _=require(_0x1964('0x0'));var util=require('util');var moment=require(_0x1964('0x1'));var BPromise=require(_0x1964('0x2'));var rs=require(_0x1964('0x3'));var fs=require('fs');var Redis=require(_0x1964('0x4'));var db=require(_0x1964('0x5'))['db'];var utils=require(_0x1964('0x6'));var logger=require(_0x1964('0x7'))(_0x1964('0x8'));var config=require(_0x1964('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1964('0xa')][_0x1964('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xc2bdad,_0x57005a,_0x2ecfb0){return new BPromise(function(_0x4afd91,_0x5478ed){return client[_0x1964('0xc')](_0xc2bdad,_0x2ecfb0)[_0x1964('0xd')](function(_0xaff78f){logger[_0x1964('0xe')](_0x1964('0xf'),_0x57005a,_0x1964('0x10'));logger[_0x1964('0x11')](_0x1964('0x12'),_0x57005a,'request\x20sent',JSON[_0x1964('0x13')](_0xaff78f));if(_0xaff78f['error']){if(_0xaff78f[_0x1964('0x14')]['code']===0x1f4){logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x57005a,_0xaff78f[_0x1964('0x14')][_0x1964('0x15')]);return _0x5478ed(_0xaff78f['error']['message']);}logger[_0x1964('0x14')]('UserSmsQueue,\x20%s,\x20%s',_0x57005a,_0xaff78f[_0x1964('0x14')][_0x1964('0x15')]);return _0x4afd91(_0xaff78f[_0x1964('0x14')][_0x1964('0x15')]);}else{logger[_0x1964('0xe')](_0x1964('0xf'),_0x57005a,'request\x20sent');_0x4afd91(_0xaff78f[_0x1964('0x16')][_0x1964('0x15')]);}})['catch'](function(_0x460cfb){logger[_0x1964('0x14')]('UserSmsQueue,\x20%s,\x20%s',_0x57005a,_0x460cfb);_0x5478ed(_0x460cfb);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 14bae4f..aff8ca2 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 _0xa951=['INTEGER','sequelize'];(function(_0x3396cd,_0x4047f0){var _0x2d6b4a=function(_0x389663){while(--_0x389663){_0x3396cd['push'](_0x3396cd['shift']());}};_0x2d6b4a(++_0x4047f0);}(_0xa951,0x103));var _0x1a95=function(_0x393e8d,_0x3b9b61){_0x393e8d=_0x393e8d-0x0;var _0xece09=_0xa951[_0x393e8d];return _0xece09;};'use strict';var Sequelize=require(_0x1a95('0x0'));module['exports']={'UserId':{'type':Sequelize[_0x1a95('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x1a95('0x1')]}}; \ No newline at end of file +var _0x6bd2=['exports','INTEGER','sequelize'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0x6bd2,0x179));var _0x26bd=function(_0x1f5e39,_0x5968ca){_0x1f5e39=_0x1f5e39-0x0;var _0x4baa06=_0x6bd2[_0x1f5e39];return _0x4baa06;};'use strict';var Sequelize=require(_0x26bd('0x0'));module[_0x26bd('0x1')]={'UserId':{'type':Sequelize[_0x26bd('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x26bd('0x2')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 971f02f..4cf618d 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(_0xc65332,_0x11744f){var _0x4e2519=function(_0x2e997c){while(--_0x2e997c){_0xc65332['push'](_0xc65332['shift']());}};_0x4e2519(++_0x11744f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'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(_0x1f36fd,_0x5855e6){var _0x2585f8=function(_0xfce11e){while(--_0xfce11e){_0x1f36fd['push'](_0x1f36fd['shift']());}};_0x2585f8(++_0x5855e6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'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 8456c7c..2701df8 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(_0x309dea,_0x102688){var _0x42a668=function(_0x583e0e){while(--_0x583e0e){_0x309dea['push'](_0x309dea['shift']());}};_0x42a668(++_0x102688);}(_0x70e0,0x17b));var _0x070e=function(_0x1e6c52,_0xc59bb1){_0x1e6c52=_0x1e6c52-0x0;var _0x27b2a9=_0x70e0[_0x1e6c52];return _0x27b2a9;};'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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x2382b7,_0x271ef2){var _0x4ea157=function(_0x13209c){while(--_0x13209c){_0x2382b7['push'](_0x2382b7['shift']());}};_0x4ea157(++_0x271ef2);}(_0x9c44,0x178));var _0x49c4=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x9c44[_0x53ccf2];return _0x5a2964;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index de67ba6..d1cc3a1 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 _0x6be8=['sequelize','INTEGER'];(function(_0x5d9942,_0x5cb366){var _0x3f35ce=function(_0x57e52c){while(--_0x57e52c){_0x5d9942['push'](_0x5d9942['shift']());}};_0x3f35ce(++_0x5cb366);}(_0x6be8,0x76));var _0x86be=function(_0x6f9e6c,_0x5ef730){_0x6f9e6c=_0x6f9e6c-0x0;var _0x20a1a0=_0x6be8[_0x6f9e6c];return _0x20a1a0;};'use strict';var Sequelize=require(_0x86be('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x86be('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2929=['INTEGER','sequelize','exports'];(function(_0x4a69e7,_0x54b749){var _0x3934fe=function(_0x4640b6){while(--_0x4640b6){_0x4a69e7['push'](_0x4a69e7['shift']());}};_0x3934fe(++_0x54b749);}(_0x2929,0x1ab));var _0x9292=function(_0x310fc2,_0x2e697f){_0x310fc2=_0x310fc2-0x0;var _0x54d4d1=_0x2929[_0x310fc2];return _0x54d4d1;};'use strict';var Sequelize=require(_0x9292('0x0'));module[_0x9292('0x1')]={'penalty':{'type':Sequelize[_0x9292('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 872961e..3e2daf4 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 _0x92ab=['./userVoiceQueue.attributes','UserVoiceQueue','user_has_voice_queues','lodash','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x92ab,0x193));var _0xb92a=function(_0x5e0ec0,_0x2aabeb){_0x5e0ec0=_0x5e0ec0-0x0;var _0x301430=_0x92ab[_0x5e0ec0];return _0x301430;};'use strict';var _=require(_0xb92a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb92a('0x1'));var moment=require(_0xb92a('0x2'));var BPromise=require('bluebird');var rp=require(_0xb92a('0x3'));var fs=require('fs');var path=require(_0xb92a('0x4'));var rimraf=require(_0xb92a('0x5'));var config=require(_0xb92a('0x6'));var attributes=require(_0xb92a('0x7'));module['exports']=function(_0x15a645,_0x11acba){return _0x15a645['define'](_0xb92a('0x8'),attributes,{'tableName':_0xb92a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x16b1=['lodash','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./userVoiceQueue.attributes','define','UserVoiceQueue','user_has_voice_queues'];(function(_0x45880d,_0x1c67e3){var _0x35547d=function(_0x321a10){while(--_0x321a10){_0x45880d['push'](_0x45880d['shift']());}};_0x35547d(++_0x1c67e3);}(_0x16b1,0x1ce));var _0x116b=function(_0x2297b0,_0x37d08d){_0x2297b0=_0x2297b0-0x0;var _0x589bb4=_0x16b1[_0x2297b0];return _0x589bb4;};'use strict';var _=require(_0x116b('0x0'));var util=require(_0x116b('0x1'));var logger=require(_0x116b('0x2'))('api');var moment=require(_0x116b('0x3'));var BPromise=require('bluebird');var rp=require(_0x116b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x116b('0x5'));var config=require(_0x116b('0x6'));var attributes=require(_0x116b('0x7'));module['exports']=function(_0x4ec72a,_0x5aa228){return _0x4ec72a[_0x116b('0x8')](_0x116b('0x9'),attributes,{'tableName':_0x116b('0xa'),'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 6f3b441..7e71845 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 _0x65e2=['bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','moment'];(function(_0x328bd3,_0x9cf5a5){var _0x458149=function(_0x3f60d9){while(--_0x3f60d9){_0x328bd3['push'](_0x328bd3['shift']());}};_0x458149(++_0x9cf5a5);}(_0x65e2,0x14e));var _0x265e=function(_0x3f0654,_0x567937){_0x3f0654=_0x3f0654-0x0;var _0x3f8a13=_0x65e2[_0x3f0654];return _0x3f8a13;};'use strict';var _=require(_0x265e('0x0'));var util=require('util');var moment=require(_0x265e('0x1'));var BPromise=require(_0x265e('0x2'));var rs=require(_0x265e('0x3'));var fs=require('fs');var Redis=require(_0x265e('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x265e('0x5'))(_0x265e('0x6'));var config=require('../../config/environment');var jayson=require(_0x265e('0x7'));var client=jayson[_0x265e('0x8')][_0x265e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x99b079,_0x2d1e1e,_0x35a7c9){return new BPromise(function(_0x1ba327,_0x1fc720){return client[_0x265e('0xa')](_0x99b079,_0x35a7c9)[_0x265e('0xb')](function(_0x274473){logger[_0x265e('0xc')](_0x265e('0xd'),_0x2d1e1e,'request\x20sent');logger[_0x265e('0xe')](_0x265e('0xf'),_0x2d1e1e,_0x265e('0x10'),JSON[_0x265e('0x11')](_0x274473));if(_0x274473[_0x265e('0x12')]){if(_0x274473[_0x265e('0x12')]['code']===0x1f4){logger[_0x265e('0x12')](_0x265e('0xd'),_0x2d1e1e,_0x274473['error'][_0x265e('0x13')]);return _0x1fc720(_0x274473[_0x265e('0x12')]['message']);}logger[_0x265e('0x12')](_0x265e('0xd'),_0x2d1e1e,_0x274473[_0x265e('0x12')][_0x265e('0x13')]);return _0x1ba327(_0x274473[_0x265e('0x12')][_0x265e('0x13')]);}else{logger[_0x265e('0xc')]('UserVoiceQueue,\x20%s,\x20%s',_0x2d1e1e,_0x265e('0x10'));_0x1ba327(_0x274473['result']['message']);}})[_0x265e('0x14')](function(_0x1d833e){logger[_0x265e('0x12')](_0x265e('0xd'),_0x2d1e1e,_0x1d833e);_0x1fc720(_0x1d833e);});});} \ No newline at end of file +var _0x2c04=['http','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x593d81,_0x209492){var _0x3b67a9=function(_0x5f2e2b){while(--_0x5f2e2b){_0x593d81['push'](_0x593d81['shift']());}};_0x3b67a9(++_0x209492);}(_0x2c04,0x6f));var _0x42c0=function(_0x1ab72f,_0x6293bc){_0x1ab72f=_0x1ab72f-0x0;var _0x418ed5=_0x2c04[_0x1ab72f];return _0x418ed5;};'use strict';var _=require('lodash');var util=require(_0x42c0('0x0'));var moment=require('moment');var BPromise=require(_0x42c0('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x42c0('0x2'));var db=require(_0x42c0('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x42c0('0x4'))(_0x42c0('0x5'));var config=require(_0x42c0('0x6'));var jayson=require(_0x42c0('0x7'));var client=jayson[_0x42c0('0x8')][_0x42c0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3b1bbd,_0x54c57c,_0x5e35af){return new BPromise(function(_0x57e95c,_0x19cc00){return client['request'](_0x3b1bbd,_0x5e35af)['then'](function(_0x43512c){logger[_0x42c0('0xa')](_0x42c0('0xb'),_0x54c57c,_0x42c0('0xc'));logger[_0x42c0('0xd')](_0x42c0('0xe'),_0x54c57c,_0x42c0('0xc'),JSON[_0x42c0('0xf')](_0x43512c));if(_0x43512c[_0x42c0('0x10')]){if(_0x43512c[_0x42c0('0x10')][_0x42c0('0x11')]===0x1f4){logger[_0x42c0('0x10')](_0x42c0('0xb'),_0x54c57c,_0x43512c[_0x42c0('0x10')][_0x42c0('0x12')]);return _0x19cc00(_0x43512c[_0x42c0('0x10')][_0x42c0('0x12')]);}logger[_0x42c0('0x10')](_0x42c0('0xb'),_0x54c57c,_0x43512c['error'][_0x42c0('0x12')]);return _0x57e95c(_0x43512c['error'][_0x42c0('0x12')]);}else{logger[_0x42c0('0xa')](_0x42c0('0xb'),_0x54c57c,'request\x20sent');_0x57e95c(_0x43512c[_0x42c0('0x13')]['message']);}})['catch'](function(_0x4140a3){logger[_0x42c0('0x10')](_0x42c0('0xb'),_0x54c57c,_0x4140a3);_0x19cc00(_0x4140a3);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 64ad959..d4a7dc1 100644 --- a/server/api/userVoiceQueueRt/index.js +++ b/server/api/userVoiceQueueRt/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x128e0a,_0xe36b56){var _0x595a97=function(_0x1ab3bb){while(--_0x1ab3bb){_0x128e0a['push'](_0x128e0a['shift']());}};_0x595a97(++_0xe36b56);}(_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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x1af731,_0x232428){var _0x2f963d=function(_0x312eb4){while(--_0x312eb4){_0x1af731['push'](_0x1af731['shift']());}};_0x2f963d(++_0x232428);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 36c2fb6..50264bb 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 _0xf583=['INTEGER','STRING','queue_interface','sequelize','exports','Required\x20by\x20Asterisk'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0xf583,0x111));var _0x3f58=function(_0x1bc0ae,_0x439dfe){_0x1bc0ae=_0x1bc0ae-0x0;var _0x501104=_0xf583[_0x1bc0ae];return _0x501104;};'use strict';var Sequelize=require(_0x3f58('0x0'));module[_0x3f58('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0x3f58('0x2')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0x3f58('0x3')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x3f58('0x4')],'allowNull':![],'unique':_0x3f58('0x5'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0x3f58('0x3')],'allowNull':![]},'interface':{'type':Sequelize[_0x3f58('0x4')],'allowNull':![],'unique':_0x3f58('0x5'),'comment':_0x3f58('0x2')},'penalty':{'type':Sequelize[_0x3f58('0x3')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0x3f58('0x3')](0xb),'defaultValue':0x0,'comment':_0x3f58('0x2')}}; \ No newline at end of file +var _0xaaf1=['queue_interface','exports','INTEGER','Required\x20by\x20Asterisk','STRING'];(function(_0x2d0b84,_0x34682d){var _0x8d0088=function(_0x25a584){while(--_0x25a584){_0x2d0b84['push'](_0x2d0b84['shift']());}};_0x8d0088(++_0x34682d);}(_0xaaf1,0x173));var _0x1aaf=function(_0x30731e,_0x5e6095){_0x30731e=_0x30731e-0x0;var _0x2bb6b6=_0xaaf1[_0x30731e];return _0x2bb6b6;};'use strict';var Sequelize=require('sequelize');module[_0x1aaf('0x0')]={'uniqueid':{'type':Sequelize[_0x1aaf('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x1aaf('0x2')},'membername':{'type':Sequelize[_0x1aaf('0x3')],'allowNull':![],'comment':_0x1aaf('0x2')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0x1aaf('0x3')],'allowNull':![],'unique':_0x1aaf('0x4'),'comment':_0x1aaf('0x2')},'VoiceQueueId':{'type':Sequelize[_0x1aaf('0x1')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':'queue_interface','comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0x1aaf('0x1')](0xb),'defaultValue':0x0,'comment':_0x1aaf('0x2')},'paused':{'type':Sequelize[_0x1aaf('0x1')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 4804772..a9d33ac 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 _0xc5ea=['save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xc5ea,0x1aa));var _0xac5e=function(_0xcd3e25,_0x3778c5){_0xcd3e25=_0xcd3e25-0x0;var _0x7164ce=_0xc5ea[_0xcd3e25];return _0x7164ce;};'use strict';var EventEmitter=require(_0xac5e('0x0'));var UserVoiceQueueRt=require(_0xac5e('0x1'))['db'][_0xac5e('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xac5e('0x3')](0x0);var events={'afterCreate':_0xac5e('0x4'),'afterUpdate':_0xac5e('0x5'),'afterDestroy':_0xac5e('0x6')};function emitEvent(_0x541e3){return function(_0x171dcb,_0x1c7036,_0x374bd3){UserVoiceQueueRtEvents['emit'](_0x541e3+':'+_0x171dcb['id'],_0x171dcb);UserVoiceQueueRtEvents[_0xac5e('0x7')](_0x541e3,_0x171dcb);_0x374bd3(null);};}for(var e in events){if(events[_0xac5e('0x8')](e)){var event=events[e];UserVoiceQueueRt[_0xac5e('0x9')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x03e6=['hasOwnProperty','hook','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save','remove','emit'];(function(_0x2b92cc,_0x1de3a6){var _0xb1d68=function(_0x5c2225){while(--_0x5c2225){_0x2b92cc['push'](_0x2b92cc['shift']());}};_0xb1d68(++_0x1de3a6);}(_0x03e6,0xd1));var _0x603e=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x03e6[_0x3ab51d];return _0x29a04e;};'use strict';var EventEmitter=require(_0x603e('0x0'));var UserVoiceQueueRt=require(_0x603e('0x1'))['db'][_0x603e('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x603e('0x3')](0x0);var events={'afterCreate':_0x603e('0x4'),'afterUpdate':'update','afterDestroy':_0x603e('0x5')};function emitEvent(_0x13c3b3){return function(_0x4dabd7,_0x58e675,_0x37669c){UserVoiceQueueRtEvents[_0x603e('0x6')](_0x13c3b3+':'+_0x4dabd7['id'],_0x4dabd7);UserVoiceQueueRtEvents[_0x603e('0x6')](_0x13c3b3,_0x4dabd7);_0x37669c(null);};}for(var e in events){if(events[_0x603e('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0x603e('0x8')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 29900e8..378bb76 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 _0x822f=['user_has_voice_queues_rt','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','UserVoiceQueueRt'];(function(_0x273bf8,_0x38888a){var _0x10e784=function(_0x13a2f5){while(--_0x13a2f5){_0x273bf8['push'](_0x273bf8['shift']());}};_0x10e784(++_0x38888a);}(_0x822f,0xa9));var _0xf822=function(_0x32f2dd,_0x13a687){_0x32f2dd=_0x32f2dd-0x0;var _0x2f017=_0x822f[_0x32f2dd];return _0x2f017;};'use strict';var _=require(_0xf822('0x0'));var util=require('util');var logger=require(_0xf822('0x1'))(_0xf822('0x2'));var moment=require(_0xf822('0x3'));var BPromise=require(_0xf822('0x4'));var rp=require(_0xf822('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf822('0x6'));var config=require(_0xf822('0x7'));var attributes=require('./userVoiceQueueRt.attributes');module[_0xf822('0x8')]=function(_0x576131,_0x25efe9){return _0x576131[_0xf822('0x9')](_0xf822('0xa'),attributes,{'tableName':_0xf822('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x37f7=['../../config/environment','./userVoiceQueueRt.attributes','exports','user_has_voice_queues_rt','util','moment','bluebird','request-promise','rimraf'];(function(_0x5e4d07,_0x3cadfb){var _0x2758c8=function(_0x56737e){while(--_0x56737e){_0x5e4d07['push'](_0x5e4d07['shift']());}};_0x2758c8(++_0x3cadfb);}(_0x37f7,0x1ea));var _0x737f=function(_0x18133d,_0xc9cbed){_0x18133d=_0x18133d-0x0;var _0x20ccfe=_0x37f7[_0x18133d];return _0x20ccfe;};'use strict';var _=require('lodash');var util=require(_0x737f('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x737f('0x1'));var BPromise=require(_0x737f('0x2'));var rp=require(_0x737f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x737f('0x4'));var config=require(_0x737f('0x5'));var attributes=require(_0x737f('0x6'));module[_0x737f('0x7')]=function(_0x10d2cf,_0x4d6088){return _0x10d2cf['define']('UserVoiceQueueRt',attributes,{'tableName':_0x737f('0x8'),'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 f194b3d..5f836fe 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 _0xceb2=['message','result','GetVoiceQueueRtPauses','options','raw','where','sequelize','COUNT','literal','outboundQueuePauses','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','defaults','redis','./userVoiceQueueRt.socket','register','request','then','info','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','UserVoiceQueueRt,\x20%s,\x20%s'];(function(_0x135b01,_0x575e88){var _0x3d0a78=function(_0x44f90d){while(--_0x44f90d){_0x135b01['push'](_0x135b01['shift']());}};_0x3d0a78(++_0x575e88);}(_0xceb2,0x181));var _0x2ceb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xceb2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2ceb('0x0'));var util=require(_0x2ceb('0x1'));var moment=require('moment');var BPromise=require(_0x2ceb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2ceb('0x3'));var db=require(_0x2ceb('0x4'))['db'];var utils=require(_0x2ceb('0x5'));var logger=require(_0x2ceb('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2ceb('0x7'));var client=jayson[_0x2ceb('0x8')][_0x2ceb('0x9')]({'port':0x232a});config['redis']=_[_0x2ceb('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2ceb('0xb')]));require(_0x2ceb('0xc'))[_0x2ceb('0xd')](socket);function respondWithRpcPromise(_0x1c6492,_0x40cfc0,_0x3647dd){return new BPromise(function(_0x271b51,_0x1edffa){return client[_0x2ceb('0xe')](_0x1c6492,_0x3647dd)[_0x2ceb('0xf')](function(_0x266d94){logger[_0x2ceb('0x10')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x40cfc0,_0x2ceb('0x11'));logger[_0x2ceb('0x12')](_0x2ceb('0x13'),_0x40cfc0,_0x2ceb('0x11'),JSON[_0x2ceb('0x14')](_0x266d94));if(_0x266d94['error']){if(_0x266d94['error']['code']===0x1f4){logger[_0x2ceb('0x15')](_0x2ceb('0x16'),_0x40cfc0,_0x266d94[_0x2ceb('0x15')]['message']);return _0x1edffa(_0x266d94['error'][_0x2ceb('0x17')]);}logger[_0x2ceb('0x15')](_0x2ceb('0x16'),_0x40cfc0,_0x266d94[_0x2ceb('0x15')]['message']);return _0x271b51(_0x266d94['error'][_0x2ceb('0x17')]);}else{logger['info'](_0x2ceb('0x16'),_0x40cfc0,'request\x20sent');_0x271b51(_0x266d94[_0x2ceb('0x18')][_0x2ceb('0x17')]);}})['catch'](function(_0x330efa){logger[_0x2ceb('0x15')](_0x2ceb('0x16'),_0x40cfc0,_0x330efa);_0x1edffa(_0x330efa);});});}exports[_0x2ceb('0x19')]=function(_0x4442f2){var _0x3e9179=this;return new Promise(function(_0x2532ec,_0x4bd854){return db['UserVoiceQueueRt']['findAll']({'raw':_0x4442f2['options']?_0x4442f2[_0x2ceb('0x1a')][_0x2ceb('0x1b')]===undefined?!![]:![]:!![],'where':_0x4442f2['options']?_0x4442f2['options'][_0x2ceb('0x1c')]||null:null,'attributes':[[db[_0x2ceb('0x1d')]['fn'](_0x2ceb('0x1e'),db[_0x2ceb('0x1d')]['fn']('IF',db[_0x2ceb('0x1d')][_0x2ceb('0x1f')]('`paused`\x20=\x201,\x201,\x20null'))),_0x2ceb('0x20')]]})[_0x2ceb('0xf')](function(_0x31beca){logger[_0x2ceb('0x10')](_0x2ceb('0x19'),_0x4442f2);logger[_0x2ceb('0x12')](_0x2ceb('0x19'),_0x4442f2,JSON[_0x2ceb('0x14')](_0x31beca));_0x2532ec(_0x31beca);})[_0x2ceb('0x21')](function(_0x4a2fde){logger[_0x2ceb('0x15')]('GetVoiceQueueRtPauses',_0x4a2fde[_0x2ceb('0x17')],_0x4442f2);_0x4bd854(_0x3e9179[_0x2ceb('0x15')](0x1f4,_0x4a2fde[_0x2ceb('0x17')]));});});}; \ No newline at end of file +var _0xf861=['options','raw','where','COUNT','sequelize','outboundQueuePauses','catch','GetVoiceQueueRtPauses','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','request','then','info','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','UserVoiceQueueRt,\x20%s,\x20%s','message','result','UserVoiceQueueRt','findAll'];(function(_0x505901,_0x2a2c68){var _0x139541=function(_0x22c2eb){while(--_0x22c2eb){_0x505901['push'](_0x505901['shift']());}};_0x139541(++_0x2a2c68);}(_0xf861,0xa0));var _0x1f86=function(_0x5cffc3,_0x3b4609){_0x5cffc3=_0x5cffc3-0x0;var _0x2fa33d=_0xf861[_0x5cffc3];return _0x2fa33d;};'use strict';var _=require('lodash');var util=require(_0x1f86('0x0'));var moment=require(_0x1f86('0x1'));var BPromise=require('bluebird');var rs=require(_0x1f86('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1f86('0x3'))['db'];var utils=require(_0x1f86('0x4'));var logger=require(_0x1f86('0x5'))(_0x1f86('0x6'));var config=require(_0x1f86('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1f86('0x8')][_0x1f86('0x9')]({'port':0x232a});config[_0x1f86('0xa')]=_[_0x1f86('0xb')](config[_0x1f86('0xa')],{'host':_0x1f86('0xc'),'port':0x18eb});var socket=require(_0x1f86('0xd'))(new Redis(config[_0x1f86('0xa')]));require(_0x1f86('0xe'))[_0x1f86('0xf')](socket);function respondWithRpcPromise(_0x40897a,_0x12b8b0,_0x4282ba){return new BPromise(function(_0x5c8034,_0x14e7a5){return client[_0x1f86('0x10')](_0x40897a,_0x4282ba)[_0x1f86('0x11')](function(_0x56a9d5){logger[_0x1f86('0x12')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x12b8b0,'request\x20sent');logger[_0x1f86('0x13')](_0x1f86('0x14'),_0x12b8b0,_0x1f86('0x15'),JSON[_0x1f86('0x16')](_0x56a9d5));if(_0x56a9d5[_0x1f86('0x17')]){if(_0x56a9d5[_0x1f86('0x17')][_0x1f86('0x18')]===0x1f4){logger[_0x1f86('0x17')](_0x1f86('0x19'),_0x12b8b0,_0x56a9d5['error']['message']);return _0x14e7a5(_0x56a9d5[_0x1f86('0x17')]['message']);}logger[_0x1f86('0x17')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x12b8b0,_0x56a9d5['error'][_0x1f86('0x1a')]);return _0x5c8034(_0x56a9d5[_0x1f86('0x17')][_0x1f86('0x1a')]);}else{logger['info']('UserVoiceQueueRt,\x20%s,\x20%s',_0x12b8b0,_0x1f86('0x15'));_0x5c8034(_0x56a9d5[_0x1f86('0x1b')][_0x1f86('0x1a')]);}})['catch'](function(_0x2a0456){logger['error'](_0x1f86('0x19'),_0x12b8b0,_0x2a0456);_0x14e7a5(_0x2a0456);});});}exports['GetVoiceQueueRtPauses']=function(_0x3f6aa7){var _0x14a74b=this;return new Promise(function(_0x37b667,_0x52da90){return db[_0x1f86('0x1c')][_0x1f86('0x1d')]({'raw':_0x3f6aa7['options']?_0x3f6aa7[_0x1f86('0x1e')][_0x1f86('0x1f')]===undefined?!![]:![]:!![],'where':_0x3f6aa7['options']?_0x3f6aa7[_0x1f86('0x1e')][_0x1f86('0x20')]||null:null,'attributes':[[db['sequelize']['fn'](_0x1f86('0x21'),db[_0x1f86('0x22')]['fn']('IF',db[_0x1f86('0x22')]['literal']('`paused`\x20=\x201,\x201,\x20null'))),_0x1f86('0x23')]]})[_0x1f86('0x11')](function(_0x579a84){logger['info']('GetVoiceQueueRtPauses',_0x3f6aa7);logger['debug']('GetVoiceQueueRtPauses',_0x3f6aa7,JSON[_0x1f86('0x16')](_0x579a84));_0x37b667(_0x579a84);})[_0x1f86('0x24')](function(_0x4b48ac){logger[_0x1f86('0x17')](_0x1f86('0x25'),_0x4b48ac[_0x1f86('0x1a')],_0x3f6aa7);_0x52da90(_0x14a74b[_0x1f86('0x17')](0x1f4,_0x4b48ac[_0x1f86('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 7c77bda..614bf5b 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 _0xfa9f=['save','remove','update','emit','removeListener','length','userVoiceQueueRt:'];(function(_0x5c80e0,_0x2fd6e2){var _0x276cc9=function(_0x49ee7e){while(--_0x49ee7e){_0x5c80e0['push'](_0x5c80e0['shift']());}};_0x276cc9(++_0x2fd6e2);}(_0xfa9f,0x93));var _0xffa9=function(_0x22b70f,_0x4c853f){_0x22b70f=_0x22b70f-0x0;var _0x100985=_0xfa9f[_0x22b70f];return _0x100985;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0xffa9('0x0'),_0xffa9('0x1'),_0xffa9('0x2')];function createListener(_0x29abd2,_0x3e69f8){return function(_0x492e53){_0x3e69f8[_0xffa9('0x3')](_0x29abd2,_0x492e53);};}function removeListener(_0x5bed37,_0x2f8db9){return function(){UserVoiceQueueRtEvents[_0xffa9('0x4')](_0x5bed37,_0x2f8db9);};}exports['register']=function(_0xf1a9c6){for(var _0x4fb309=0x0,_0x4948c0=events[_0xffa9('0x5')];_0x4fb309<_0x4948c0;_0x4fb309++){var _0x1fe931=events[_0x4fb309];var _0x249501=createListener(_0xffa9('0x6')+_0x1fe931,_0xf1a9c6);UserVoiceQueueRtEvents['on'](_0x1fe931,_0x249501);}}; \ No newline at end of file +var _0x7da7=['save','remove','register','userVoiceQueueRt:','./userVoiceQueueRt.events'];(function(_0x1eaae0,_0x4411a3){var _0xd17a7b=function(_0x2bf73c){while(--_0x2bf73c){_0x1eaae0['push'](_0x1eaae0['shift']());}};_0xd17a7b(++_0x4411a3);}(_0x7da7,0x10d));var _0x77da=function(_0x1cfc39,_0x1d3913){_0x1cfc39=_0x1cfc39-0x0;var _0x957a28=_0x7da7[_0x1cfc39];return _0x957a28;};'use strict';var UserVoiceQueueRtEvents=require(_0x77da('0x0'));var events=[_0x77da('0x1'),_0x77da('0x2'),'update'];function createListener(_0x59892b,_0x37667b){return function(_0xaaefb1){_0x37667b['emit'](_0x59892b,_0xaaefb1);};}function removeListener(_0x3a9fa6,_0x37b3d9){return function(){UserVoiceQueueRtEvents['removeListener'](_0x3a9fa6,_0x37b3d9);};}exports[_0x77da('0x3')]=function(_0xc54a12){for(var _0x47da81=0x0,_0x30afe0=events['length'];_0x47da81<_0x30afe0;_0x47da81++){var _0x1191de=events[_0x47da81];var _0x13992e=createListener(_0x77da('0x4')+_0x1191de,_0xc54a12);UserVoiceQueueRtEvents['on'](_0x1191de,_0x13992e);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 3002fbd..176154b 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x1ac05d,_0x449e91){var _0xd578=function(_0x4aa576){while(--_0x4aa576){_0x1ac05d['push'](_0x1ac05d['shift']());}};_0xd578(++_0x449e91);}(_0x70e0,0x17b));var _0x070e=function(_0x528887,_0x1b5b37){_0x528887=_0x528887-0x0;var _0xdd9cdc=_0x70e0[_0x528887];return _0xdd9cdc;};'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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x543dd1,_0xbd4273){var _0x2078d8=function(_0x24a970){while(--_0x24a970){_0x543dd1['push'](_0x543dd1['shift']());}};_0x2078d8(++_0xbd4273);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x420b24,_0x382adc){_0x420b24=_0x420b24-0x0;var _0x4da552=_0xcb91[_0x420b24];return _0x4da552;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index da91877..192c9bc 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 _0x12f1=['INTEGER','sequelize'];(function(_0x5907fd,_0x3cef95){var _0xd8f7db=function(_0x417636){while(--_0x417636){_0x5907fd['push'](_0x5907fd['shift']());}};_0xd8f7db(++_0x3cef95);}(_0x12f1,0x151));var _0x112f=function(_0x1ff92d,_0x3bfdeb){_0x1ff92d=_0x1ff92d-0x0;var _0x129a98=_0x12f1[_0x1ff92d];return _0x129a98;};'use strict';var Sequelize=require(_0x112f('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x112f('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xcd69=['INTEGER'];(function(_0x4ded65,_0xc8d7c1){var _0x5864fb=function(_0x40df9d){while(--_0x40df9d){_0x4ded65['push'](_0x4ded65['shift']());}};_0x5864fb(++_0xc8d7c1);}(_0xcd69,0x16b));var _0x9cd6=function(_0x2adbeb,_0x5581be){_0x2adbeb=_0x2adbeb-0x0;var _0x5e18a6=_0xcd69[_0x2adbeb];return _0x5e18a6;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x9cd6('0x0')],'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 e7d0b5a..4988843 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 _0x98ab=['UserWhatsappQueue','user_has_whatsapp_queues','util','api','moment','request-promise','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','define'];(function(_0xf55307,_0x1635a9){var _0x5c700b=function(_0x40c8bc){while(--_0x40c8bc){_0xf55307['push'](_0xf55307['shift']());}};_0x5c700b(++_0x1635a9);}(_0x98ab,0x16d));var _0xb98a=function(_0x4f47c0,_0x192781){_0x4f47c0=_0x4f47c0-0x0;var _0x4247bf=_0x98ab[_0x4f47c0];return _0x4247bf;};'use strict';var _=require('lodash');var util=require(_0xb98a('0x0'));var logger=require('../../config/logger')(_0xb98a('0x1'));var moment=require(_0xb98a('0x2'));var BPromise=require('bluebird');var rp=require(_0xb98a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb98a('0x4'));var config=require(_0xb98a('0x5'));var attributes=require(_0xb98a('0x6'));module[_0xb98a('0x7')]=function(_0x2e208c,_0x45a741){return _0x2e208c[_0xb98a('0x8')](_0xb98a('0x9'),attributes,{'tableName':_0xb98a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe193=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','lodash'];(function(_0x3fb498,_0x31bf0c){var _0x2a6ef7=function(_0x180ab7){while(--_0x180ab7){_0x3fb498['push'](_0x3fb498['shift']());}};_0x2a6ef7(++_0x31bf0c);}(_0xe193,0x133));var _0x3e19=function(_0x257c1e,_0x4eec82){_0x257c1e=_0x257c1e-0x0;var _0x213ce6=_0xe193[_0x257c1e];return _0x213ce6;};'use strict';var _=require(_0x3e19('0x0'));var util=require(_0x3e19('0x1'));var logger=require(_0x3e19('0x2'))(_0x3e19('0x3'));var moment=require(_0x3e19('0x4'));var BPromise=require(_0x3e19('0x5'));var rp=require(_0x3e19('0x6'));var fs=require('fs');var path=require(_0x3e19('0x7'));var rimraf=require(_0x3e19('0x8'));var config=require(_0x3e19('0x9'));var attributes=require(_0x3e19('0xa'));module[_0x3e19('0xb')]=function(_0x327fdc,_0x2624b6){return _0x327fdc[_0x3e19('0xc')](_0x3e19('0xd'),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 889ada5..3c9c419 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 _0x4545=['../../config/logger','rpc','../../config/environment','client','http','request','then','UserWhatsappQueue,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils'];(function(_0x20f256,_0x2f58ec){var _0x5ced25=function(_0x15a4c4){while(--_0x15a4c4){_0x20f256['push'](_0x20f256['shift']());}};_0x5ced25(++_0x2f58ec);}(_0x4545,0x15f));var _0x5454=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x4545[_0x27af45];return _0x18df21;};'use strict';var _=require(_0x5454('0x0'));var util=require(_0x5454('0x1'));var moment=require(_0x5454('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5454('0x3'));var db=require(_0x5454('0x4'))['db'];var utils=require(_0x5454('0x5'));var logger=require(_0x5454('0x6'))(_0x5454('0x7'));var config=require(_0x5454('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5454('0x9')][_0x5454('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ba325,_0x27559a,_0x1d2be4){return new BPromise(function(_0x2bcc1e,_0x1fdba7){return client[_0x5454('0xb')](_0x3ba325,_0x1d2be4)[_0x5454('0xc')](function(_0x135644){logger['info'](_0x5454('0xd'),_0x27559a,'request\x20sent');logger['debug']('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x27559a,'request\x20sent',JSON[_0x5454('0xe')](_0x135644));if(_0x135644[_0x5454('0xf')]){if(_0x135644[_0x5454('0xf')][_0x5454('0x10')]===0x1f4){logger[_0x5454('0xf')](_0x5454('0xd'),_0x27559a,_0x135644[_0x5454('0xf')][_0x5454('0x11')]);return _0x1fdba7(_0x135644[_0x5454('0xf')][_0x5454('0x11')]);}logger['error'](_0x5454('0xd'),_0x27559a,_0x135644[_0x5454('0xf')][_0x5454('0x11')]);return _0x2bcc1e(_0x135644['error'][_0x5454('0x11')]);}else{logger[_0x5454('0x12')](_0x5454('0xd'),_0x27559a,'request\x20sent');_0x2bcc1e(_0x135644[_0x5454('0x13')][_0x5454('0x11')]);}})[_0x5454('0x14')](function(_0x177617){logger[_0x5454('0xf')](_0x5454('0xd'),_0x27559a,_0x177617);_0x1fdba7(_0x177617);});});} \ No newline at end of file +var _0xdeb3=['client','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment'];(function(_0x452d3b,_0x34add5){var _0x46bf97=function(_0x379070){while(--_0x379070){_0x452d3b['push'](_0x452d3b['shift']());}};_0x46bf97(++_0x34add5);}(_0xdeb3,0xa3));var _0x3deb=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xdeb3[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x3deb('0x0'));var util=require(_0x3deb('0x1'));var moment=require('moment');var BPromise=require(_0x3deb('0x2'));var rs=require(_0x3deb('0x3'));var fs=require('fs');var Redis=require(_0x3deb('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3deb('0x5'))(_0x3deb('0x6'));var config=require(_0x3deb('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3deb('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x159227,_0x121d03,_0x1be482){return new BPromise(function(_0x2efdd0,_0x127c0e){return client[_0x3deb('0x9')](_0x159227,_0x1be482)[_0x3deb('0xa')](function(_0x76db1){logger[_0x3deb('0xb')](_0x3deb('0xc'),_0x121d03,_0x3deb('0xd'));logger[_0x3deb('0xe')]('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x121d03,_0x3deb('0xd'),JSON[_0x3deb('0xf')](_0x76db1));if(_0x76db1[_0x3deb('0x10')]){if(_0x76db1[_0x3deb('0x10')]['code']===0x1f4){logger[_0x3deb('0x10')](_0x3deb('0xc'),_0x121d03,_0x76db1[_0x3deb('0x10')][_0x3deb('0x11')]);return _0x127c0e(_0x76db1[_0x3deb('0x10')][_0x3deb('0x11')]);}logger[_0x3deb('0x10')](_0x3deb('0xc'),_0x121d03,_0x76db1[_0x3deb('0x10')][_0x3deb('0x11')]);return _0x2efdd0(_0x76db1[_0x3deb('0x10')][_0x3deb('0x11')]);}else{logger[_0x3deb('0xb')](_0x3deb('0xc'),_0x121d03,_0x3deb('0xd'));_0x2efdd0(_0x76db1[_0x3deb('0x12')][_0x3deb('0x11')]);}})['catch'](function(_0x2877b4){logger[_0x3deb('0x10')](_0x3deb('0xc'),_0x121d03,_0x2877b4);_0x127c0e(_0x2877b4);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index d1e0bd4..09acb86 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 _0xf041=['delete','exports','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','isAuthenticated','get','/:id','show','create','put','update'];(function(_0x4b973d,_0x54b57f){var _0x44e3de=function(_0x46c877){while(--_0x46c877){_0x4b973d['push'](_0x4b973d['shift']());}};_0x44e3de(++_0x54b57f);}(_0xf041,0x15b));var _0x1f04=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf041[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1f04('0x0'));var timeout=require(_0x1f04('0x1'));var express=require(_0x1f04('0x2'));var router=express[_0x1f04('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1f04('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1f04('0x5'));var controller=require('./variable.controller');router['get']('/',auth[_0x1f04('0x6')](),controller['index']);router[_0x1f04('0x7')](_0x1f04('0x8'),auth[_0x1f04('0x6')](),controller[_0x1f04('0x9')]);router['post']('/',auth[_0x1f04('0x6')](),controller[_0x1f04('0xa')]);router[_0x1f04('0xb')](_0x1f04('0x8'),auth[_0x1f04('0x6')](),controller[_0x1f04('0xc')]);router[_0x1f04('0xd')](_0x1f04('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0x1f04('0xe')]=router; \ No newline at end of file +var _0x4b8a=['get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller'];(function(_0x48ed98,_0x22c3f4){var _0x37057f=function(_0x5d60a4){while(--_0x5d60a4){_0x48ed98['push'](_0x48ed98['shift']());}};_0x37057f(++_0x22c3f4);}(_0x4b8a,0xd3));var _0xa4b8=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x4b8a[_0x167cc1];return _0x10bc4b;};'use strict';var multer=require('multer');var util=require(_0xa4b8('0x0'));var path=require('path');var timeout=require(_0xa4b8('0x1'));var express=require(_0xa4b8('0x2'));var router=express[_0xa4b8('0x3')]();var fs_extra=require(_0xa4b8('0x4'));var auth=require(_0xa4b8('0x5'));var interaction=require(_0xa4b8('0x6'));var config=require(_0xa4b8('0x7'));var controller=require(_0xa4b8('0x8'));router[_0xa4b8('0x9')]('/',auth[_0xa4b8('0xa')](),controller[_0xa4b8('0xb')]);router[_0xa4b8('0x9')](_0xa4b8('0xc'),auth[_0xa4b8('0xa')](),controller['show']);router[_0xa4b8('0xd')]('/',auth[_0xa4b8('0xa')](),controller[_0xa4b8('0xe')]);router[_0xa4b8('0xf')](_0xa4b8('0xc'),auth[_0xa4b8('0xa')](),controller[_0xa4b8('0x10')]);router[_0xa4b8('0x11')](_0xa4b8('0xc'),auth[_0xa4b8('0xa')](),controller[_0xa4b8('0x12')]);module[_0xa4b8('0x13')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index efa25c8..c06eaa9 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 _0xfc90=['exports','STRING','name','sequelize'];(function(_0x52542c,_0x1f9526){var _0x12c8f0=function(_0x7c4434){while(--_0x7c4434){_0x52542c['push'](_0x52542c['shift']());}};_0x12c8f0(++_0x1f9526);}(_0xfc90,0x17b));var _0x0fc9=function(_0x1d5008,_0x3aebdd){_0x1d5008=_0x1d5008-0x0;var _0x1ca041=_0xfc90[_0x1d5008];return _0x1ca041;};'use strict';var Sequelize=require(_0x0fc9('0x0'));module[_0x0fc9('0x1')]={'name':{'type':Sequelize[_0x0fc9('0x2')],'unique':_0x0fc9('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x0fc9('0x2')]}}; \ No newline at end of file +var _0x758d=['sequelize','exports'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x758d,0xc0));var _0xd758=function(_0x44fc13,_0x2389ae){_0x44fc13=_0x44fc13-0x0;var _0xacb8a2=_0x758d[_0x44fc13];return _0xacb8a2;};'use strict';var Sequelize=require(_0xd758('0x0'));module[_0xd758('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 2163f7c..3d22b8f 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 _0x47b9=['query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','Variable','includeAll','rows','show','params','keys','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Variables','UserProfileSection','find','userProfileId','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','send','index','rawAttributes','type','key','model','map'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0x47b9,0x16c));var _0x947b=function(_0x1b51ea,_0x394fd9){_0x1b51ea=_0x1b51ea-0x0;var _0x18bbdc=_0x47b9[_0x1b51ea];return _0x18bbdc;};'use strict';var emlformat=require(_0x947b('0x0'));var rimraf=require(_0x947b('0x1'));var zipdir=require(_0x947b('0x2'));var jsonpatch=require(_0x947b('0x3'));var rp=require(_0x947b('0x4'));var moment=require(_0x947b('0x5'));var BPromise=require(_0x947b('0x6'));var Mustache=require(_0x947b('0x7'));var util=require(_0x947b('0x8'));var path=require(_0x947b('0x9'));var sox=require('sox');var csv=require(_0x947b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x947b('0xb'));var squel=require(_0x947b('0xc'));var crypto=require(_0x947b('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x947b('0xe'));var Papa=require(_0x947b('0xf'));var Redis=require(_0x947b('0x10'));var authService=require(_0x947b('0x11'));var qs=require(_0x947b('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x947b('0x13'))(_0x947b('0x14'));var utils=require('../../config/utils');var config=require(_0x947b('0x15'));var licenseUtil=require(_0x947b('0x16'));var db=require(_0x947b('0x17'))['db'];function respondWithStatusCode(_0x25c0f7,_0x2ecc8b){_0x2ecc8b=_0x2ecc8b||0xcc;return function(_0x28254e){if(_0x28254e){return _0x25c0f7['sendStatus'](_0x2ecc8b);}return _0x25c0f7[_0x947b('0x18')](_0x2ecc8b)[_0x947b('0x19')]();};}function respondWithResult(_0x5bd382,_0x6308a5){_0x6308a5=_0x6308a5||0xc8;return function(_0x2a4399){if(_0x2a4399){return _0x5bd382[_0x947b('0x18')](_0x6308a5)['json'](_0x2a4399);}};}function respondWithFilteredResult(_0x511f4c,_0x13ac0e){return function(_0xf0ded5){if(_0xf0ded5){var _0x254529=typeof _0x13ac0e[_0x947b('0x1a')]===_0x947b('0x1b')&&typeof _0x13ac0e[_0x947b('0x1c')]===_0x947b('0x1b');var _0x50ab6e=_0xf0ded5[_0x947b('0x1d')];var _0x4d2272=_0x254529?0x0:_0x13ac0e['offset'];var _0x1b519f=_0x254529?_0xf0ded5['count']:_0x13ac0e[_0x947b('0x1a')]+_0x13ac0e[_0x947b('0x1c')];var _0x4ab67c;if(_0x1b519f>=_0x50ab6e){_0x1b519f=_0x50ab6e;_0x4ab67c=0xc8;}else{_0x4ab67c=0xce;}_0x511f4c[_0x947b('0x18')](_0x4ab67c);return _0x511f4c[_0x947b('0x1e')](_0x947b('0x1f'),_0x4d2272+'-'+_0x1b519f+'/'+_0x50ab6e)[_0x947b('0x20')](_0xf0ded5);}return null;};}function patchUpdates(_0x3a06dc){return function(_0x2aa395){try{jsonpatch[_0x947b('0x21')](_0x2aa395,_0x3a06dc,!![]);}catch(_0x4d968f){return BPromise['reject'](_0x4d968f);}return _0x2aa395[_0x947b('0x22')]();};}function saveUpdates(_0x47ad82,_0x2173dc){return function(_0x19fd43){if(_0x19fd43){return _0x19fd43[_0x947b('0x23')](_0x47ad82)[_0x947b('0x24')](function(_0x1604bc){return _0x1604bc;});}return null;};}function removeEntity(_0xb99581,_0x4d94aa){return function(_0x4f3c24){if(_0x4f3c24){return _0x4f3c24[_0x947b('0x25')]()[_0x947b('0x24')](function(){var _0x1ac1c6=_0x4f3c24[_0x947b('0x26')]({'plain':!![]});var _0x5d988c='Variables';return db[_0x947b('0x27')][_0x947b('0x25')]({'where':{'type':_0x5d988c,'resourceId':_0x1ac1c6['id']}})[_0x947b('0x24')](function(){return _0x4f3c24;});})[_0x947b('0x24')](function(){_0xb99581[_0x947b('0x18')](0xcc)[_0x947b('0x19')]();});}};}function handleEntityNotFound(_0x3d102d,_0x3bcc61){return function(_0x183337){if(!_0x183337){_0x3d102d[_0x947b('0x28')](0x194);}return _0x183337;};}function handleError(_0x174f30,_0xc1a165){_0xc1a165=_0xc1a165||0x1f4;return function(_0x3f91b1){logger[_0x947b('0x29')](_0x3f91b1[_0x947b('0x2a')]);if(_0x3f91b1['name']){delete _0x3f91b1[_0x947b('0x2b')];}_0x174f30['status'](_0xc1a165)[_0x947b('0x2c')](_0x3f91b1);};}exports[_0x947b('0x2d')]=function(_0x23a019,_0x2f4b69){var _0x5ad92c={},_0x41d622={},_0x4fb0b0={'count':0x0,'rows':[]};var _0x4697f6=_['map'](db['Variable'][_0x947b('0x2e')],function(_0x74bf2c){return{'name':_0x74bf2c['fieldName'],'type':_0x74bf2c[_0x947b('0x2f')][_0x947b('0x30')]};});_0x41d622[_0x947b('0x31')]=_[_0x947b('0x32')](_0x4697f6,_0x947b('0x2b'));_0x41d622[_0x947b('0x33')]=_['keys'](_0x23a019[_0x947b('0x33')]);_0x41d622[_0x947b('0x34')]=_[_0x947b('0x35')](_0x41d622[_0x947b('0x31')],_0x41d622['query']);_0x5ad92c[_0x947b('0x36')]=_[_0x947b('0x35')](_0x41d622[_0x947b('0x31')],qs[_0x947b('0x37')](_0x23a019[_0x947b('0x33')][_0x947b('0x37')]));_0x5ad92c[_0x947b('0x36')]=_0x5ad92c[_0x947b('0x36')][_0x947b('0x38')]?_0x5ad92c['attributes']:_0x41d622[_0x947b('0x31')];if(!_0x23a019['query'][_0x947b('0x39')]('nolimit')){_0x5ad92c[_0x947b('0x1c')]=qs[_0x947b('0x1c')](_0x23a019[_0x947b('0x33')]['limit']);_0x5ad92c[_0x947b('0x1a')]=qs['offset'](_0x23a019[_0x947b('0x33')][_0x947b('0x1a')]);}_0x5ad92c[_0x947b('0x3a')]=qs[_0x947b('0x3b')](_0x23a019['query']['sort']);_0x5ad92c[_0x947b('0x3c')]=qs[_0x947b('0x34')](_[_0x947b('0x3d')](_0x23a019['query'],_0x41d622[_0x947b('0x34')]),_0x4697f6);if(_0x23a019['query'][_0x947b('0x3e')]){_0x5ad92c[_0x947b('0x3c')]=_[_0x947b('0x3f')](_0x5ad92c[_0x947b('0x3c')],{'$or':_['map'](_0x4697f6,function(_0x317b15){if(_0x317b15['type']!==_0x947b('0x40')){var _0x25be53={};_0x25be53[_0x317b15[_0x947b('0x2b')]]={'$like':'%'+_0x23a019[_0x947b('0x33')][_0x947b('0x3e')]+'%'};return _0x25be53;}})});}_0x5ad92c=_['merge']({},_0x5ad92c,_0x23a019[_0x947b('0x41')]);var _0x21e0d9={'where':_0x5ad92c[_0x947b('0x3c')]};return db[_0x947b('0x42')][_0x947b('0x1d')](_0x21e0d9)['then'](function(_0xc3aa10){_0x4fb0b0['count']=_0xc3aa10;if(_0x23a019[_0x947b('0x33')][_0x947b('0x43')]){_0x5ad92c['include']=[{'all':!![]}];}return db[_0x947b('0x42')]['findAll'](_0x5ad92c);})[_0x947b('0x24')](function(_0x19840c){_0x4fb0b0[_0x947b('0x44')]=_0x19840c;return _0x4fb0b0;})[_0x947b('0x24')](respondWithFilteredResult(_0x2f4b69,_0x5ad92c))['catch'](handleError(_0x2f4b69,null));};exports[_0x947b('0x45')]=function(_0x531918,_0x14697e){var _0x49eb45={'raw':!![],'where':{'id':_0x531918[_0x947b('0x46')]['id']}},_0x363a24={};_0x363a24[_0x947b('0x31')]=_[_0x947b('0x47')](db[_0x947b('0x42')][_0x947b('0x2e')]);_0x363a24['query']=_['keys'](_0x531918[_0x947b('0x33')]);_0x363a24[_0x947b('0x34')]=_[_0x947b('0x35')](_0x363a24['model'],_0x363a24[_0x947b('0x33')]);_0x49eb45[_0x947b('0x36')]=_[_0x947b('0x35')](_0x363a24['model'],qs[_0x947b('0x37')](_0x531918[_0x947b('0x33')][_0x947b('0x37')]));_0x49eb45[_0x947b('0x36')]=_0x49eb45[_0x947b('0x36')][_0x947b('0x38')]?_0x49eb45[_0x947b('0x36')]:_0x363a24[_0x947b('0x31')];if(_0x531918[_0x947b('0x33')]['includeAll']){_0x49eb45['include']=[{'all':!![]}];}_0x49eb45=_['merge']({},_0x49eb45,_0x531918[_0x947b('0x41')]);return db[_0x947b('0x42')]['find'](_0x49eb45)['then'](handleEntityNotFound(_0x14697e,null))[_0x947b('0x24')](respondWithResult(_0x14697e,null))['catch'](handleError(_0x14697e,null));};exports[_0x947b('0x48')]=function(_0x492280,_0x4d8d4d){return db[_0x947b('0x42')]['create'](_0x492280['body'],{})[_0x947b('0x24')](function(_0x285f5b){var _0x375917=_0x492280[_0x947b('0x49')][_0x947b('0x26')]({'plain':!![]});if(!_0x375917)throw new Error(_0x947b('0x4a'));if(_0x375917[_0x947b('0x4b')]===_0x947b('0x49')){var _0x4b84dd=_0x285f5b[_0x947b('0x26')]({'plain':!![]});var _0x3398e3=_0x947b('0x4c');return db[_0x947b('0x4d')][_0x947b('0x4e')]({'where':{'name':_0x3398e3,'userProfileId':_0x375917[_0x947b('0x4f')]},'raw':!![]})[_0x947b('0x24')](function(_0x49e963){if(_0x49e963&&_0x49e963['autoAssociation']===0x0){return db[_0x947b('0x27')][_0x947b('0x48')]({'name':_0x4b84dd[_0x947b('0x2b')],'resourceId':_0x4b84dd['id'],'type':_0x49e963['name'],'sectionId':_0x49e963['id']},{})[_0x947b('0x24')](function(){return _0x285f5b;});}else{return _0x285f5b;}})[_0x947b('0x50')](function(_0x26d8bd){logger[_0x947b('0x29')](_0x947b('0x51'),_0x26d8bd);throw _0x26d8bd;});}return _0x285f5b;})[_0x947b('0x24')](respondWithResult(_0x4d8d4d,0xc9))[_0x947b('0x50')](handleError(_0x4d8d4d,null));};exports[_0x947b('0x23')]=function(_0x2bbd82,_0x18195a){if(_0x2bbd82[_0x947b('0x52')]['id']){delete _0x2bbd82[_0x947b('0x52')]['id'];}return db[_0x947b('0x42')][_0x947b('0x4e')]({'where':{'id':_0x2bbd82[_0x947b('0x46')]['id']}})[_0x947b('0x24')](handleEntityNotFound(_0x18195a,null))['then'](saveUpdates(_0x2bbd82[_0x947b('0x52')],null))[_0x947b('0x24')](respondWithResult(_0x18195a,null))['catch'](handleError(_0x18195a,null));};exports[_0x947b('0x25')]=function(_0x3f287f,_0x478dc3){return db['Variable']['find']({'where':{'id':_0x3f287f['params']['id']}})[_0x947b('0x24')](handleEntityNotFound(_0x478dc3,null))[_0x947b('0x24')](removeEntity(_0x478dc3,null))['catch'](handleError(_0x478dc3,null));}; \ No newline at end of file +var _0xb24e=['VIRTUAL','options','where','includeAll','include','rows','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','destroy','then','get','UserProfileResource','name','send','index','map','Variable','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filter','merge'];(function(_0x4b57d3,_0x28c3b7){var _0x3953f9=function(_0x5ec705){while(--_0x5ec705){_0x4b57d3['push'](_0x4b57d3['shift']());}};_0x3953f9(++_0x28c3b7);}(_0xb24e,0xb5));var _0xeb24=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xb24e[_0x42cae2];return _0x5f256f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeb24('0x0'));var zipdir=require(_0xeb24('0x1'));var jsonpatch=require(_0xeb24('0x2'));var rp=require(_0xeb24('0x3'));var moment=require(_0xeb24('0x4'));var BPromise=require(_0xeb24('0x5'));var Mustache=require(_0xeb24('0x6'));var util=require(_0xeb24('0x7'));var path=require(_0xeb24('0x8'));var sox=require(_0xeb24('0x9'));var csv=require(_0xeb24('0xa'));var ejs=require(_0xeb24('0xb'));var fs=require('fs');var fs_extra=require(_0xeb24('0xc'));var _=require(_0xeb24('0xd'));var squel=require(_0xeb24('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xeb24('0xf'));var toCsv=require(_0xeb24('0xa'));var querystring=require(_0xeb24('0x10'));var Papa=require(_0xeb24('0x11'));var Redis=require(_0xeb24('0x12'));var authService=require(_0xeb24('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xeb24('0x14'));var hardwareService=require(_0xeb24('0x15'));var logger=require(_0xeb24('0x16'))('api');var utils=require(_0xeb24('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xeb24('0x18'))['db'];function respondWithStatusCode(_0x1073cb,_0x29680a){_0x29680a=_0x29680a||0xcc;return function(_0x55d1de){if(_0x55d1de){return _0x1073cb[_0xeb24('0x19')](_0x29680a);}return _0x1073cb[_0xeb24('0x1a')](_0x29680a)[_0xeb24('0x1b')]();};}function respondWithResult(_0x2dc0f6,_0x44c855){_0x44c855=_0x44c855||0xc8;return function(_0x30c991){if(_0x30c991){return _0x2dc0f6['status'](_0x44c855)[_0xeb24('0x1c')](_0x30c991);}};}function respondWithFilteredResult(_0xf9ad5e,_0x8327ea){return function(_0x5d3ecd){if(_0x5d3ecd){var _0x95621=typeof _0x8327ea[_0xeb24('0x1d')]===_0xeb24('0x1e')&&typeof _0x8327ea[_0xeb24('0x1f')]===_0xeb24('0x1e');var _0x13652f=_0x5d3ecd[_0xeb24('0x20')];var _0x4ca617=_0x95621?0x0:_0x8327ea['offset'];var _0x3bd967=_0x95621?_0x5d3ecd[_0xeb24('0x20')]:_0x8327ea[_0xeb24('0x1d')]+_0x8327ea[_0xeb24('0x1f')];var _0x1827cf;if(_0x3bd967>=_0x13652f){_0x3bd967=_0x13652f;_0x1827cf=0xc8;}else{_0x1827cf=0xce;}_0xf9ad5e[_0xeb24('0x1a')](_0x1827cf);return _0xf9ad5e[_0xeb24('0x21')]('Content-Range',_0x4ca617+'-'+_0x3bd967+'/'+_0x13652f)[_0xeb24('0x1c')](_0x5d3ecd);}return null;};}function patchUpdates(_0x68e177){return function(_0x10bb5d){try{jsonpatch[_0xeb24('0x22')](_0x10bb5d,_0x68e177,!![]);}catch(_0x3e67a8){return BPromise[_0xeb24('0x23')](_0x3e67a8);}return _0x10bb5d['save']();};}function saveUpdates(_0x51b7bf,_0x4777cb){return function(_0x3aba1d){if(_0x3aba1d){return _0x3aba1d[_0xeb24('0x24')](_0x51b7bf)['then'](function(_0x16cdb0){return _0x16cdb0;});}return null;};}function removeEntity(_0x41dbe6,_0x1d1844){return function(_0x1cc957){if(_0x1cc957){return _0x1cc957[_0xeb24('0x25')]()[_0xeb24('0x26')](function(){var _0x43e990=_0x1cc957[_0xeb24('0x27')]({'plain':!![]});var _0x7a9141='Variables';return db[_0xeb24('0x28')]['destroy']({'where':{'type':_0x7a9141,'resourceId':_0x43e990['id']}})[_0xeb24('0x26')](function(){return _0x1cc957;});})[_0xeb24('0x26')](function(){_0x41dbe6[_0xeb24('0x1a')](0xcc)[_0xeb24('0x1b')]();});}};}function handleEntityNotFound(_0x1ff6f7,_0x2e9ccf){return function(_0x291759){if(!_0x291759){_0x1ff6f7['sendStatus'](0x194);}return _0x291759;};}function handleError(_0x5bfee0,_0x28536){_0x28536=_0x28536||0x1f4;return function(_0x5f1fc3){logger['error'](_0x5f1fc3['stack']);if(_0x5f1fc3[_0xeb24('0x29')]){delete _0x5f1fc3[_0xeb24('0x29')];}_0x5bfee0[_0xeb24('0x1a')](_0x28536)[_0xeb24('0x2a')](_0x5f1fc3);};}exports[_0xeb24('0x2b')]=function(_0x265561,_0xdb9cba){var _0x23fc26={},_0x27a7cb={},_0x417b5e={'count':0x0,'rows':[]};var _0x22b9c2=_[_0xeb24('0x2c')](db[_0xeb24('0x2d')][_0xeb24('0x2e')],function(_0x18ecc9){return{'name':_0x18ecc9[_0xeb24('0x2f')],'type':_0x18ecc9[_0xeb24('0x30')]['key']};});_0x27a7cb[_0xeb24('0x31')]=_[_0xeb24('0x2c')](_0x22b9c2,_0xeb24('0x29'));_0x27a7cb['query']=_[_0xeb24('0x32')](_0x265561[_0xeb24('0x33')]);_0x27a7cb[_0xeb24('0x34')]=_[_0xeb24('0x35')](_0x27a7cb[_0xeb24('0x31')],_0x27a7cb[_0xeb24('0x33')]);_0x23fc26[_0xeb24('0x36')]=_[_0xeb24('0x35')](_0x27a7cb[_0xeb24('0x31')],qs[_0xeb24('0x37')](_0x265561[_0xeb24('0x33')]['fields']));_0x23fc26[_0xeb24('0x36')]=_0x23fc26['attributes'][_0xeb24('0x38')]?_0x23fc26[_0xeb24('0x36')]:_0x27a7cb[_0xeb24('0x31')];if(!_0x265561[_0xeb24('0x33')][_0xeb24('0x39')]('nolimit')){_0x23fc26[_0xeb24('0x1f')]=qs['limit'](_0x265561[_0xeb24('0x33')]['limit']);_0x23fc26[_0xeb24('0x1d')]=qs[_0xeb24('0x1d')](_0x265561[_0xeb24('0x33')][_0xeb24('0x1d')]);}_0x23fc26['order']=qs[_0xeb24('0x3a')](_0x265561['query']['sort']);_0x23fc26['where']=qs[_0xeb24('0x34')](_[_0xeb24('0x3b')](_0x265561[_0xeb24('0x33')],_0x27a7cb[_0xeb24('0x34')]),_0x22b9c2);if(_0x265561['query'][_0xeb24('0x3c')]){_0x23fc26['where']=_[_0xeb24('0x3d')](_0x23fc26['where'],{'$or':_[_0xeb24('0x2c')](_0x22b9c2,function(_0x3cce6e){if(_0x3cce6e[_0xeb24('0x30')]!==_0xeb24('0x3e')){var _0x3555ed={};_0x3555ed[_0x3cce6e[_0xeb24('0x29')]]={'$like':'%'+_0x265561[_0xeb24('0x33')][_0xeb24('0x3c')]+'%'};return _0x3555ed;}})});}_0x23fc26=_['merge']({},_0x23fc26,_0x265561[_0xeb24('0x3f')]);var _0x196a67={'where':_0x23fc26[_0xeb24('0x40')]};return db['Variable'][_0xeb24('0x20')](_0x196a67)[_0xeb24('0x26')](function(_0x1fd175){_0x417b5e[_0xeb24('0x20')]=_0x1fd175;if(_0x265561[_0xeb24('0x33')][_0xeb24('0x41')]){_0x23fc26[_0xeb24('0x42')]=[{'all':!![]}];}return db[_0xeb24('0x2d')]['findAll'](_0x23fc26);})[_0xeb24('0x26')](function(_0x5285d9){_0x417b5e[_0xeb24('0x43')]=_0x5285d9;return _0x417b5e;})[_0xeb24('0x26')](respondWithFilteredResult(_0xdb9cba,_0x23fc26))[_0xeb24('0x44')](handleError(_0xdb9cba,null));};exports[_0xeb24('0x45')]=function(_0x271a0c,_0x146542){var _0xb0473a={'raw':!![],'where':{'id':_0x271a0c[_0xeb24('0x46')]['id']}},_0x3cb5e={};_0x3cb5e[_0xeb24('0x31')]=_[_0xeb24('0x32')](db[_0xeb24('0x2d')]['rawAttributes']);_0x3cb5e['query']=_[_0xeb24('0x32')](_0x271a0c[_0xeb24('0x33')]);_0x3cb5e['filters']=_[_0xeb24('0x35')](_0x3cb5e['model'],_0x3cb5e['query']);_0xb0473a[_0xeb24('0x36')]=_[_0xeb24('0x35')](_0x3cb5e[_0xeb24('0x31')],qs[_0xeb24('0x37')](_0x271a0c['query'][_0xeb24('0x37')]));_0xb0473a[_0xeb24('0x36')]=_0xb0473a[_0xeb24('0x36')]['length']?_0xb0473a[_0xeb24('0x36')]:_0x3cb5e[_0xeb24('0x31')];if(_0x271a0c[_0xeb24('0x33')][_0xeb24('0x41')]){_0xb0473a['include']=[{'all':!![]}];}_0xb0473a=_[_0xeb24('0x3d')]({},_0xb0473a,_0x271a0c[_0xeb24('0x3f')]);return db[_0xeb24('0x2d')]['find'](_0xb0473a)[_0xeb24('0x26')](handleEntityNotFound(_0x146542,null))[_0xeb24('0x26')](respondWithResult(_0x146542,null))[_0xeb24('0x44')](handleError(_0x146542,null));};exports[_0xeb24('0x47')]=function(_0x5c9dd8,_0x383cd2){return db[_0xeb24('0x2d')][_0xeb24('0x47')](_0x5c9dd8[_0xeb24('0x48')],{})['then'](function(_0x27afbb){var _0x447626=_0x5c9dd8[_0xeb24('0x49')][_0xeb24('0x27')]({'plain':!![]});if(!_0x447626)throw new Error(_0xeb24('0x4a'));if(_0x447626[_0xeb24('0x4b')]===_0xeb24('0x49')){var _0x5c84ac=_0x27afbb[_0xeb24('0x27')]({'plain':!![]});var _0x4b912f='Variables';return db[_0xeb24('0x4c')][_0xeb24('0x4d')]({'where':{'name':_0x4b912f,'userProfileId':_0x447626[_0xeb24('0x4e')]},'raw':!![]})[_0xeb24('0x26')](function(_0x24742f){if(_0x24742f&&_0x24742f['autoAssociation']===0x0){return db[_0xeb24('0x28')][_0xeb24('0x47')]({'name':_0x5c84ac[_0xeb24('0x29')],'resourceId':_0x5c84ac['id'],'type':_0x24742f['name'],'sectionId':_0x24742f['id']},{})[_0xeb24('0x26')](function(){return _0x27afbb;});}else{return _0x27afbb;}})[_0xeb24('0x44')](function(_0x45264c){logger[_0xeb24('0x4f')](_0xeb24('0x50'),_0x45264c);throw _0x45264c;});}return _0x27afbb;})['then'](respondWithResult(_0x383cd2,0xc9))[_0xeb24('0x44')](handleError(_0x383cd2,null));};exports[_0xeb24('0x24')]=function(_0x313141,_0x192886){if(_0x313141[_0xeb24('0x48')]['id']){delete _0x313141[_0xeb24('0x48')]['id'];}return db[_0xeb24('0x2d')][_0xeb24('0x4d')]({'where':{'id':_0x313141[_0xeb24('0x46')]['id']}})[_0xeb24('0x26')](handleEntityNotFound(_0x192886,null))[_0xeb24('0x26')](saveUpdates(_0x313141[_0xeb24('0x48')],null))[_0xeb24('0x26')](respondWithResult(_0x192886,null))[_0xeb24('0x44')](handleError(_0x192886,null));};exports[_0xeb24('0x25')]=function(_0x467c30,_0x239320){return db[_0xeb24('0x2d')][_0xeb24('0x4d')]({'where':{'id':_0x467c30['params']['id']}})[_0xeb24('0x26')](handleEntityNotFound(_0x239320,null))[_0xeb24('0x26')](removeEntity(_0x239320,null))[_0xeb24('0x44')](handleError(_0x239320,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 1a491ca..68ac09b 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 _0x15b3=['bluebird','request-promise','path','rimraf','../../config/environment','./variable.attributes','exports','define','Variable','../../config/logger','api','moment'];(function(_0x39017c,_0x15f210){var _0x584624=function(_0x48afe4){while(--_0x48afe4){_0x39017c['push'](_0x39017c['shift']());}};_0x584624(++_0x15f210);}(_0x15b3,0x81));var _0x315b=function(_0x436b34,_0x35d237){_0x436b34=_0x436b34-0x0;var _0x409f6b=_0x15b3[_0x436b34];return _0x409f6b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x315b('0x0'))(_0x315b('0x1'));var moment=require(_0x315b('0x2'));var BPromise=require(_0x315b('0x3'));var rp=require(_0x315b('0x4'));var fs=require('fs');var path=require(_0x315b('0x5'));var rimraf=require(_0x315b('0x6'));var config=require(_0x315b('0x7'));var attributes=require(_0x315b('0x8'));module[_0x315b('0x9')]=function(_0x2b2ede,_0xa2fd82){return _0x2b2ede[_0x315b('0xa')](_0x315b('0xb'),attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x07b3=['../../config/logger','request-promise','rimraf','../../config/environment','./variable.attributes','exports','define','Variable','util'];(function(_0x19106c,_0x22da38){var _0xbe5a82=function(_0x45d112){while(--_0x45d112){_0x19106c['push'](_0x19106c['shift']());}};_0xbe5a82(++_0x22da38);}(_0x07b3,0xb3));var _0x307b=function(_0x14eda7,_0x5393c6){_0x14eda7=_0x14eda7-0x0;var _0x26e9e5=_0x07b3[_0x14eda7];return _0x26e9e5;};'use strict';var _=require('lodash');var util=require(_0x307b('0x0'));var logger=require(_0x307b('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x307b('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x307b('0x3'));var config=require(_0x307b('0x4'));var attributes=require(_0x307b('0x5'));module[_0x307b('0x6')]=function(_0x40a49d,_0xbd598a){return _0x40a49d[_0x307b('0x7')](_0x307b('0x8'),attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/variable/variable.rpc.js b/server/api/variable/variable.rpc.js index 42164b8..b364aae 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 _0xe14b=['ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','Variable,\x20%s,\x20%s','Variable,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','ShowVariable','Variable','find','options','raw','where','attributes','map','include','model','stringify','lodash','util','randomstring'];(function(_0x3408b2,_0x41cee5){var _0x244f81=function(_0x4d7e51){while(--_0x4d7e51){_0x3408b2['push'](_0x3408b2['shift']());}};_0x244f81(++_0x41cee5);}(_0xe14b,0x93));var _0xbe14=function(_0x2cd832,_0x6a0705){_0x2cd832=_0x2cd832-0x0;var _0x4f052e=_0xe14b[_0x2cd832];return _0x4f052e;};'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);});});}exports[_0xbe14('0x13')]=function(_0x29ab73){var _0x17ae86=this;return new Promise(function(_0x5ea1f8,_0x137ee5){return db[_0xbe14('0x14')][_0xbe14('0x15')]({'raw':_0x29ab73[_0xbe14('0x16')]?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x17')]===undefined?!![]:![]:!![],'where':_0x29ab73['options']?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x18')]||null:null,'attributes':_0x29ab73[_0xbe14('0x16')]?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x19')]||null:null,'include':_0x29ab73['options']?_0x29ab73[_0xbe14('0x16')]['include']?_[_0xbe14('0x1a')](_0x29ab73['options'][_0xbe14('0x1b')],function(_0x4a25fa){return{'model':db[_0x4a25fa[_0xbe14('0x1c')]],'as':_0x4a25fa['as'],'attributes':_0x4a25fa[_0xbe14('0x19')],'include':_0x4a25fa['include']?_[_0xbe14('0x1a')](_0x4a25fa['include'],function(_0x4587a8){return{'model':db[_0x4587a8['model']],'as':_0x4587a8['as'],'attributes':_0x4587a8[_0xbe14('0x19')],'include':_0x4587a8[_0xbe14('0x1b')]?_[_0xbe14('0x1a')](_0x4587a8[_0xbe14('0x1b')],function(_0x15ef02){return{'model':db[_0x15ef02[_0xbe14('0x1c')]],'as':_0x15ef02['as'],'attributes':_0x15ef02['attributes']};}):[]};}):[]};}):[]:[]})[_0xbe14('0x9')](function(_0x1ba46a){logger[_0xbe14('0xa')](_0xbe14('0x13'),_0x29ab73);logger['debug'](_0xbe14('0x13'),_0x29ab73,JSON[_0xbe14('0x1d')](_0x1ba46a));_0x5ea1f8(_0x1ba46a);})['catch'](function(_0x3c3613){logger[_0xbe14('0xe')](_0xbe14('0x13'),_0x3c3613[_0xbe14('0x10')],_0x29ab73);_0x137ee5(_0x17ae86[_0xbe14('0xe')](0x1f4,_0x3c3613[_0xbe14('0x10')]));});});}; \ No newline at end of file +var _0xabce=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ShowVariable','Variable','find','options','attributes','map','include','model','catch','lodash','util'];(function(_0x2c245d,_0x13cad5){var _0x3a1c63=function(_0x36a316){while(--_0x36a316){_0x2c245d['push'](_0x2c245d['shift']());}};_0x3a1c63(++_0x13cad5);}(_0xabce,0x103));var _0xeabc=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xabce[_0x25bea7];return _0x175952;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Variable,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});}exports[_0xeabc('0x14')]=function(_0x58a3c0){var _0x16f08b=this;return new Promise(function(_0x31dd53,_0x31f52a){return db[_0xeabc('0x15')][_0xeabc('0x16')]({'raw':_0x58a3c0['options']?_0x58a3c0[_0xeabc('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')]['where']||null:null,'attributes':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')][_0xeabc('0x18')]||null:null,'include':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')]['include']?_[_0xeabc('0x19')](_0x58a3c0[_0xeabc('0x17')][_0xeabc('0x1a')],function(_0x5bdd57){return{'model':db[_0x5bdd57[_0xeabc('0x1b')]],'as':_0x5bdd57['as'],'attributes':_0x5bdd57[_0xeabc('0x18')],'include':_0x5bdd57[_0xeabc('0x1a')]?_[_0xeabc('0x19')](_0x5bdd57['include'],function(_0x109e1d){return{'model':db[_0x109e1d['model']],'as':_0x109e1d['as'],'attributes':_0x109e1d[_0xeabc('0x18')],'include':_0x109e1d['include']?_[_0xeabc('0x19')](_0x109e1d[_0xeabc('0x1a')],function(_0x269621){return{'model':db[_0x269621[_0xeabc('0x1b')]],'as':_0x269621['as'],'attributes':_0x269621[_0xeabc('0x18')]};}):[]};}):[]};}):[]:[]})[_0xeabc('0x9')](function(_0x131722){logger['info']('ShowVariable',_0x58a3c0);logger[_0xeabc('0xd')]('ShowVariable',_0x58a3c0,JSON[_0xeabc('0xf')](_0x131722));_0x31dd53(_0x131722);})[_0xeabc('0x1c')](function(_0x48fb52){logger[_0xeabc('0x10')](_0xeabc('0x14'),_0x48fb52[_0xeabc('0x12')],_0x58a3c0);_0x31f52a(_0x16f08b[_0xeabc('0x10')](0x1f4,_0x48fb52[_0xeabc('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 90a2070..2c7321a 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 _0x3f9e=['exports','express','Router','../../components/auth/service','./version.controller','index','get','/fetch','isAuthenticated','canUpdate','fetch','reset','/pull','pull','/restart','restart','/migrations','migrations'];(function(_0x2c5744,_0x5ccf85){var _0x4ebbf6=function(_0x1835ff){while(--_0x1835ff){_0x2c5744['push'](_0x2c5744['shift']());}};_0x4ebbf6(++_0x5ccf85);}(_0x3f9e,0x19f));var _0xe3f9=function(_0x419fa1,_0x580e54){_0x419fa1=_0x419fa1-0x0;var _0x3f5ebf=_0x3f9e[_0x419fa1];return _0x3f5ebf;};'use strict';var express=require(_0xe3f9('0x0'));var router=express[_0xe3f9('0x1')]();var auth=require(_0xe3f9('0x2'));var controller=require(_0xe3f9('0x3'));router['get']('/',controller[_0xe3f9('0x4')]);router[_0xe3f9('0x5')](_0xe3f9('0x6'),auth[_0xe3f9('0x7')](),auth[_0xe3f9('0x8')](),controller[_0xe3f9('0x9')]);router[_0xe3f9('0x5')]('/reset',auth[_0xe3f9('0x7')](),auth[_0xe3f9('0x8')](),controller[_0xe3f9('0xa')]);router[_0xe3f9('0x5')](_0xe3f9('0xb'),auth['isAuthenticated'](),auth[_0xe3f9('0x8')](),controller[_0xe3f9('0xc')]);router[_0xe3f9('0x5')](_0xe3f9('0xd'),auth['isAuthenticated'](),controller[_0xe3f9('0xe')]);router[_0xe3f9('0x5')](_0xe3f9('0xf'),controller[_0xe3f9('0x10')]);module[_0xe3f9('0x11')]=router; \ No newline at end of file +var _0x3be5=['express','Router','./version.controller','index','get','isAuthenticated','canUpdate','fetch','reset','/restart','restart','/migrations','migrations','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3be5,0x70));var _0x53be=function(_0x4a7ec1,_0x2cdf53){_0x4a7ec1=_0x4a7ec1-0x0;var _0x435410=_0x3be5[_0x4a7ec1];return _0x435410;};'use strict';var express=require(_0x53be('0x0'));var router=express[_0x53be('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x53be('0x2'));router['get']('/',controller[_0x53be('0x3')]);router[_0x53be('0x4')]('/fetch',auth[_0x53be('0x5')](),auth[_0x53be('0x6')](),controller[_0x53be('0x7')]);router[_0x53be('0x4')]('/reset',auth[_0x53be('0x5')](),auth[_0x53be('0x6')](),controller[_0x53be('0x8')]);router['get']('/pull',auth[_0x53be('0x5')](),auth[_0x53be('0x6')](),controller['pull']);router[_0x53be('0x4')](_0x53be('0x9'),auth[_0x53be('0x5')](),controller[_0x53be('0xa')]);router[_0x53be('0x4')](_0x53be('0xb'),controller[_0x53be('0xc')]);module[_0x53be('0xd')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 0c2bbc9..646f267 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 _0xbb0e=['pull','npm\x20install\x20--production','restart','motion2','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','join','server','length','replace','push','sort','sequelize','Migration','getQueryInterface','migrations','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','child_process','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','simple-git','root','index','exports','query','fetch','tags','latest','2.0.0','status','json','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0xbb0e,0xe1));var _0xebb0=function(_0x3012b8,_0x73547b){_0x3012b8=_0x3012b8-0x0;var _0x2c02f3=_0xbb0e[_0x3012b8];return _0x2c02f3;};'use strict';var Umzug=require(_0xebb0('0x0'));var path=require(_0xebb0('0x1'));var fs=require('fs');var _=require(_0xebb0('0x2'));var pkginfo=require(_0xebb0('0x3'))(module,_0xebb0('0x4'));var compareVersions=require('compare-versions');var exec=require(_0xebb0('0x5'))['exec'];var db=require(_0xebb0('0x6'))['db'];var config=require(_0xebb0('0x7'));var pm2=require(_0xebb0('0x8'));var logger=require(_0xebb0('0x9'))('update');var git=require(_0xebb0('0xa'))(config[_0xebb0('0xb')]);exports[_0xebb0('0xc')]=function(_0x3f36a0,_0x5d5682){var _0x502f35={'current':module[_0xebb0('0xd')][_0xebb0('0x4')],'phonebar':0x2};if(_0x3f36a0[_0xebb0('0xe')]&&_0x3f36a0[_0xebb0('0xe')]['latest']){return git[_0xebb0('0xf')]()[_0xebb0('0x10')](function(_0x92cd5f,_0x407a2a){_0x502f35[_0xebb0('0x11')]=(_0x92cd5f?module[_0xebb0('0xd')][_0xebb0('0x4')]:_0x407a2a[_0xebb0('0x11')])||_0xebb0('0x12');return _0x5d5682[_0xebb0('0x13')](0xc8)[_0xebb0('0x14')](_0x502f35);});}else{return _0x5d5682[_0xebb0('0x13')](0xc8)[_0xebb0('0x14')](_0x502f35);}};exports['fetch']=function(_0x3c26a3,_0x158149){return git[_0xebb0('0xf')](['origin','master'],function(_0x2c5d3e){if(_0x2c5d3e){logger[_0xebb0('0x15')](_0x2c5d3e);return _0x158149['status'](0x1f4)['json'](_0x2c5d3e);}logger[_0xebb0('0x16')](_0xebb0('0x17'));return _0x158149['status'](0xc8)[_0xebb0('0x14')]({'output':_0xebb0('0x18')});});};exports[_0xebb0('0x19')]=function(_0x192e91,_0x2ebc13){return git['reset']([_0xebb0('0x1a'),_0xebb0('0x1b')],function(_0x123161){if(_0x123161){logger[_0xebb0('0x15')](_0x123161);return _0x2ebc13[_0xebb0('0x13')](0x1f4)[_0xebb0('0x14')](_0x123161);}logger[_0xebb0('0x16')](_0xebb0('0x1c'));return _0x2ebc13[_0xebb0('0x13')](0xc8)[_0xebb0('0x14')]({'output':_0xebb0('0x1d')});});};exports[_0xebb0('0x1e')]=function(_0x9e9b33,_0x374f64){exec(_0xebb0('0x1f'),function(_0x56ca74,_0x17f144,_0xd5091d){logger[_0xebb0('0x16')](_0x17f144);logger[_0xebb0('0x16')](_0xd5091d);if(_0x56ca74){logger[_0xebb0('0x15')](_0x56ca74);return _0x374f64[_0xebb0('0x13')](0x1f4)[_0xebb0('0x14')](_0x56ca74);}return _0x374f64[_0xebb0('0x13')](0xc8)['json']({'output':_0x17f144});});};exports[_0xebb0('0x20')]=function(_0x260f1d,_0x34da37){return pm2[_0xebb0('0x20')](_0xebb0('0x21'))['then'](function(_0x18fed9){logger[_0xebb0('0x16')]('pm2\x20restart\x20motion\x20%s',_0x18fed9);return _0x34da37[_0xebb0('0x13')](0xc8)[_0xebb0('0x14')]({'output':_0xebb0('0x22')});})[_0xebb0('0x23')](function(_0x2fb917){logger[_0xebb0('0x15')](_0x2fb917);return _0x34da37[_0xebb0('0x13')](0x1f4)[_0xebb0('0x14')](_0x2fb917);});};exports['migrations']=function(_0x20b8d3,_0x848df0){var _0x2cf082=fs['readdirSync'](path[_0xebb0('0x24')](config[_0xebb0('0xb')],_0xebb0('0x25'),'migrations'));var _0x417069=[];for(var _0x2769f6=0x0;_0x2769f6<_0x2cf082[_0xebb0('0x26')];_0x2769f6++){var _0x21cbc2=_0x2cf082[_0x2769f6][_0xebb0('0x27')]('.js','');if(compareVersions(module[_0xebb0('0xd')][_0xebb0('0x4')],_0x21cbc2)===-0x1){_0x417069[_0xebb0('0x28')](_0x21cbc2);}}if(_0x417069[_0xebb0('0x26')]){var _0x549862=_0x417069[_0xebb0('0x29')](compareVersions);var _0x120918=new Umzug({'storage':_0xebb0('0x2a'),'storageOptions':{'model':db['Migration'],'modelName':_0xebb0('0x2b'),'columnName':_0xebb0('0x4')},'migrations':{'params':[db[_0xebb0('0x2a')][_0xebb0('0x2c')](),db[_0xebb0('0x2a')]['constructor'],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path[_0xebb0('0x24')](config[_0xebb0('0xb')],_0xebb0('0x25'),_0xebb0('0x2d')),'pattern':/\.js$/}});_0x120918['up']({'migrations':_[_0xebb0('0x2e')](_0x549862,function(_0x278fa7){return _0x278fa7+'.js';})})['then'](function(){return _0x848df0[_0xebb0('0x13')](0xc8)[_0xebb0('0x14')]({'output':_0xebb0('0x2f')+module[_0xebb0('0xd')][_0xebb0('0x4')]+_0xebb0('0x30')+_['last'](_0x549862),'migrations':_[_0xebb0('0x24')](_0x549862)});})['catch'](function(_0x3f53da){if(_0x3f53da instanceof db[_0xebb0('0x2a')][_0xebb0('0x31')]){return _0x848df0['status'](0xc8)[_0xebb0('0x14')]({'output':_0xebb0('0x32')});}else{return _0x848df0[_0xebb0('0x13')](0x1f4)['json'](_0x3f53da);}});}else{return _0x848df0[_0xebb0('0x13')](0xc8)[_0xebb0('0x14')]({'output':_0xebb0('0x32')});}}; \ No newline at end of file +var _0x08b1=['then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','readdirSync','join','server','length','.js','Migration','sequelize','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','Database\x20migrated\x20successfully\x20from\x20version\x20','last','Database\x20already\x20up-to-date','umzug','lodash','version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','update','root','index','exports','query','fetch','tags','latest','2.0.0','status','json','master','info','git\x20fetch','git\x20fetch\x20origin\x20master','--hard','FETCH_HEAD','error','pull','npm\x20install\x20--production','restart','motion2'];(function(_0x1920b8,_0x213500){var _0x117472=function(_0x1af808){while(--_0x1af808){_0x1920b8['push'](_0x1920b8['shift']());}};_0x117472(++_0x213500);}(_0x08b1,0xa1));var _0x108b=function(_0x258af8,_0x99e22e){_0x258af8=_0x258af8-0x0;var _0x4c41f2=_0x08b1[_0x258af8];return _0x4c41f2;};'use strict';var Umzug=require(_0x108b('0x0'));var path=require('path');var fs=require('fs');var _=require(_0x108b('0x1'));var pkginfo=require('pkginfo')(module,_0x108b('0x2'));var compareVersions=require(_0x108b('0x3'));var exec=require(_0x108b('0x4'))[_0x108b('0x5')];var db=require(_0x108b('0x6'))['db'];var config=require(_0x108b('0x7'));var pm2=require(_0x108b('0x8'));var logger=require('../../config/logger')(_0x108b('0x9'));var git=require('simple-git')(config[_0x108b('0xa')]);exports[_0x108b('0xb')]=function(_0x36e64f,_0x12d65f){var _0xf1436f={'current':module[_0x108b('0xc')]['version'],'phonebar':0x2};if(_0x36e64f[_0x108b('0xd')]&&_0x36e64f[_0x108b('0xd')]['latest']){return git[_0x108b('0xe')]()[_0x108b('0xf')](function(_0x4e0b04,_0x4e01fb){_0xf1436f[_0x108b('0x10')]=(_0x4e0b04?module[_0x108b('0xc')][_0x108b('0x2')]:_0x4e01fb[_0x108b('0x10')])||_0x108b('0x11');return _0x12d65f[_0x108b('0x12')](0xc8)[_0x108b('0x13')](_0xf1436f);});}else{return _0x12d65f[_0x108b('0x12')](0xc8)[_0x108b('0x13')](_0xf1436f);}};exports[_0x108b('0xe')]=function(_0x438a84,_0x403035){return git['fetch'](['origin',_0x108b('0x14')],function(_0x3ad7ee){if(_0x3ad7ee){logger['error'](_0x3ad7ee);return _0x403035[_0x108b('0x12')](0x1f4)['json'](_0x3ad7ee);}logger[_0x108b('0x15')](_0x108b('0x16'));return _0x403035[_0x108b('0x12')](0xc8)['json']({'output':_0x108b('0x17')});});};exports['reset']=function(_0x3cc1df,_0x2d8db0){return git['reset']([_0x108b('0x18'),_0x108b('0x19')],function(_0x21f819){if(_0x21f819){logger[_0x108b('0x1a')](_0x21f819);return _0x2d8db0[_0x108b('0x12')](0x1f4)['json'](_0x21f819);}logger[_0x108b('0x15')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x2d8db0[_0x108b('0x12')](0xc8)[_0x108b('0x13')]({'output':'git\x20reset\x20--hard'});});};exports[_0x108b('0x1b')]=function(_0x42638b,_0x58fffa){exec(_0x108b('0x1c'),function(_0x2d8a6a,_0x490eed,_0x39d46f){logger['info'](_0x490eed);logger['info'](_0x39d46f);if(_0x2d8a6a){logger[_0x108b('0x1a')](_0x2d8a6a);return _0x58fffa[_0x108b('0x12')](0x1f4)[_0x108b('0x13')](_0x2d8a6a);}return _0x58fffa[_0x108b('0x12')](0xc8)[_0x108b('0x13')]({'output':_0x490eed});});};exports[_0x108b('0x1d')]=function(_0x33d8ee,_0x38020f){return pm2[_0x108b('0x1d')](_0x108b('0x1e'))[_0x108b('0x1f')](function(_0x4e1c0e){logger[_0x108b('0x15')](_0x108b('0x20'),_0x4e1c0e);return _0x38020f['status'](0xc8)['json']({'output':_0x108b('0x21')});})['catch'](function(_0x493a7e){logger['error'](_0x493a7e);return _0x38020f['status'](0x1f4)[_0x108b('0x13')](_0x493a7e);});};exports[_0x108b('0x22')]=function(_0x5cf69c,_0x59c1fc){var _0x2f9f8f=fs[_0x108b('0x23')](path[_0x108b('0x24')](config[_0x108b('0xa')],_0x108b('0x25'),_0x108b('0x22')));var _0xbef14a=[];for(var _0x44e565=0x0;_0x44e565<_0x2f9f8f[_0x108b('0x26')];_0x44e565++){var _0x738f7e=_0x2f9f8f[_0x44e565]['replace'](_0x108b('0x27'),'');if(compareVersions(module[_0x108b('0xc')][_0x108b('0x2')],_0x738f7e)===-0x1){_0xbef14a['push'](_0x738f7e);}}if(_0xbef14a[_0x108b('0x26')]){var _0x1129cf=_0xbef14a['sort'](compareVersions);var _0x37b530=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0x108b('0x28')],'modelName':_0x108b('0x28'),'columnName':'version'},'migrations':{'params':[db[_0x108b('0x29')][_0x108b('0x2a')](),db[_0x108b('0x29')][_0x108b('0x2b')],function(){throw new Error(_0x108b('0x2c'));}],'path':path['join'](config[_0x108b('0xa')],_0x108b('0x25'),_0x108b('0x22')),'pattern':/\.js$/}});_0x37b530['up']({'migrations':_['map'](_0x1129cf,function(_0x322519){return _0x322519+_0x108b('0x27');})})[_0x108b('0x1f')](function(){return _0x59c1fc['status'](0xc8)[_0x108b('0x13')]({'output':_0x108b('0x2d')+module[_0x108b('0xc')][_0x108b('0x2')]+'\x20to\x20'+_[_0x108b('0x2e')](_0x1129cf),'migrations':_[_0x108b('0x24')](_0x1129cf)});})['catch'](function(_0x147adf){if(_0x147adf instanceof db['sequelize']['UniqueConstraintError']){return _0x59c1fc[_0x108b('0x12')](0xc8)[_0x108b('0x13')]({'output':_0x108b('0x2f')});}else{return _0x59c1fc['status'](0x1f4)[_0x108b('0x13')](_0x147adf);}});}else{return _0x59c1fc[_0x108b('0x12')](0xc8)[_0x108b('0x13')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 823b33f..57512c5 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 _0x4098=['./voiceAgentReport.controller','get','isAuthenticated','index','/describe','describe','show','post','put','/:id','update','delete','destroy','multer','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x3ccd24,_0x4994e6){var _0x1aad39=function(_0x3f66c7){while(--_0x3f66c7){_0x3ccd24['push'](_0x3ccd24['shift']());}};_0x1aad39(++_0x4994e6);}(_0x4098,0xe5));var _0x8409=function(_0x3505b2,_0x1a9bc2){_0x3505b2=_0x3505b2-0x0;var _0x5af888=_0x4098[_0x3505b2];return _0x5af888;};'use strict';var multer=require(_0x8409('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8409('0x1')]();var fs_extra=require(_0x8409('0x2'));var auth=require(_0x8409('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x8409('0x4'));var controller=require(_0x8409('0x5'));router[_0x8409('0x6')]('/',auth[_0x8409('0x7')](),controller[_0x8409('0x8')]);router[_0x8409('0x6')](_0x8409('0x9'),auth[_0x8409('0x7')](),controller[_0x8409('0xa')]);router[_0x8409('0x6')]('/:id',auth[_0x8409('0x7')](),controller[_0x8409('0xb')]);router[_0x8409('0xc')]('/',auth[_0x8409('0x7')](),controller['create']);router[_0x8409('0xd')](_0x8409('0xe'),auth[_0x8409('0x7')](),controller[_0x8409('0xf')]);router[_0x8409('0x10')]('/:id',auth[_0x8409('0x7')](),controller[_0x8409('0x11')]);module['exports']=router; \ No newline at end of file +var _0x7834=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','create','put','delete','destroy'];(function(_0xa4883d,_0x2cdb21){var _0x4aed63=function(_0x19f28c){while(--_0x19f28c){_0xa4883d['push'](_0xa4883d['shift']());}};_0x4aed63(++_0x2cdb21);}(_0x7834,0x1dc));var _0x4783=function(_0x299a98,_0x578011){_0x299a98=_0x299a98-0x0;var _0x6fd85a=_0x7834[_0x299a98];return _0x6fd85a;};'use strict';var multer=require(_0x4783('0x0'));var util=require(_0x4783('0x1'));var path=require(_0x4783('0x2'));var timeout=require(_0x4783('0x3'));var express=require('express');var router=express[_0x4783('0x4')]();var fs_extra=require(_0x4783('0x5'));var auth=require(_0x4783('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4783('0x7'));var controller=require('./voiceAgentReport.controller');router['get']('/',auth[_0x4783('0x8')](),controller[_0x4783('0x9')]);router[_0x4783('0xa')]('/describe',auth[_0x4783('0x8')](),controller[_0x4783('0xb')]);router['get'](_0x4783('0xc'),auth[_0x4783('0x8')](),controller[_0x4783('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4783('0xe')]);router[_0x4783('0xf')](_0x4783('0xc'),auth[_0x4783('0x8')](),controller['update']);router[_0x4783('0x10')](_0x4783('0xc'),auth[_0x4783('0x8')](),controller[_0x4783('0x11')]);module[_0x4783('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index ad55c4e..7a8dda7 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 _0x8227=['BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','exports','STRING','DATE','INTEGER'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x8227,0x146));var _0x7822=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8227[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module[_0x7822('0x0')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x7822('0x1')]},'calleridnum':{'type':Sequelize[_0x7822('0x1')]},'calleridname':{'type':Sequelize[_0x7822('0x1')]},'queue':{'type':Sequelize[_0x7822('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x7822('0x1')]},'agentcalledAt':{'type':Sequelize[_0x7822('0x2')]},'agentconnectAt':{'type':Sequelize[_0x7822('0x2')]},'agentcompleteAt':{'type':Sequelize[_0x7822('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0x7822('0x2')]},'agentdumpAt':{'type':Sequelize[_0x7822('0x2')]},'holdtime':{'type':Sequelize[_0x7822('0x3')]},'agentcomplete':{'type':Sequelize[_0x7822('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x7822('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x7822('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x7822('0x3')]},'reason':{'type':Sequelize[_0x7822('0x1')]},'lastevent':{'type':Sequelize[_0x7822('0x1')]},'channel':{'type':Sequelize[_0x7822('0x1')]},'channelstate':{'type':Sequelize[_0x7822('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x7822('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x7822('0x1')]},'context':{'type':Sequelize[_0x7822('0x1')]},'exten':{'type':Sequelize[_0x7822('0x1')]},'priority':{'type':Sequelize[_0x7822('0x1')]},'destchannel':{'type':Sequelize[_0x7822('0x1')]},'destchannelstate':{'type':Sequelize[_0x7822('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x7822('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x7822('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x7822('0x1')]},'destaccountcode':{'type':Sequelize[_0x7822('0x1')]},'destcontext':{'type':Sequelize[_0x7822('0x1')]},'destexten':{'type':Sequelize[_0x7822('0x1')]},'destpriority':{'type':Sequelize[_0x7822('0x1')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0x7822('0x1')]},'transfer':{'type':Sequelize[_0x7822('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x7822('0x1')],'comment':_0x7822('0x5')},'transferexten':{'type':Sequelize[_0x7822('0x1')]},'transferuniqueid':{'type':Sequelize[_0x7822('0x1')]},'agententerreason':{'type':Sequelize[_0x7822('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4910=['exports','STRING','DATE','INTEGER','BOOLEAN','sequelize'];(function(_0x4ddffb,_0xcc3cfe){var _0x5b6772=function(_0x3a6a30){while(--_0x3a6a30){_0x4ddffb['push'](_0x4ddffb['shift']());}};_0x5b6772(++_0xcc3cfe);}(_0x4910,0x1d9));var _0x0491=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x4910[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require(_0x0491('0x0'));module[_0x0491('0x1')]={'type':{'type':Sequelize[_0x0491('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x0491('0x2')]},'calleridname':{'type':Sequelize[_0x0491('0x2')]},'queue':{'type':Sequelize[_0x0491('0x2')]},'interface':{'type':Sequelize[_0x0491('0x2')]},'membername':{'type':Sequelize[_0x0491('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x0491('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x0491('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x0491('0x3')]},'agentdumpAt':{'type':Sequelize[_0x0491('0x3')]},'holdtime':{'type':Sequelize[_0x0491('0x4')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x0491('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x0491('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x0491('0x4')]},'agentacw':{'type':Sequelize[_0x0491('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x0491('0x4')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0x0491('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x0491('0x4')]},'channelstatedesc':{'type':Sequelize[_0x0491('0x2')]},'connectedlinenum':{'type':Sequelize[_0x0491('0x2')]},'connectedlinename':{'type':Sequelize[_0x0491('0x2')]},'language':{'type':Sequelize[_0x0491('0x2')]},'accountcode':{'type':Sequelize[_0x0491('0x2')]},'context':{'type':Sequelize[_0x0491('0x2')]},'exten':{'type':Sequelize[_0x0491('0x2')]},'priority':{'type':Sequelize[_0x0491('0x2')]},'destchannel':{'type':Sequelize[_0x0491('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x0491('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x0491('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x0491('0x2')]},'destaccountcode':{'type':Sequelize[_0x0491('0x2')]},'destcontext':{'type':Sequelize[_0x0491('0x2')]},'destexten':{'type':Sequelize[_0x0491('0x2')]},'destpriority':{'type':Sequelize[_0x0491('0x2')]},'destuniqueid':{'type':Sequelize[_0x0491('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x0491('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x0491('0x2')]},'transfer':{'type':Sequelize[_0x0491('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x0491('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x0491('0x2')]},'transferuniqueid':{'type':Sequelize[_0x0491('0x2')]},'agententerreason':{'type':Sequelize[_0x0491('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index 2ed22f9..8767d52 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(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'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(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'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 d3984b2..9fb3743 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 _0x979e=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','VoiceAgentReport','report_agent','uniqueid','destuniqueid'];(function(_0x3f4027,_0x221cbb){var _0x4aea2e=function(_0x29bcbb){while(--_0x29bcbb){_0x3f4027['push'](_0x3f4027['shift']());}};_0x4aea2e(++_0x221cbb);}(_0x979e,0x195));var _0xe979=function(_0x5fafc0,_0xff0ffe){_0x5fafc0=_0x5fafc0-0x0;var _0x19c51b=_0x979e[_0x5fafc0];return _0x19c51b;};'use strict';var _=require(_0xe979('0x0'));var util=require(_0xe979('0x1'));var logger=require(_0xe979('0x2'))(_0xe979('0x3'));var moment=require('moment');var BPromise=require(_0xe979('0x4'));var rp=require(_0xe979('0x5'));var fs=require('fs');var path=require(_0xe979('0x6'));var rimraf=require(_0xe979('0x7'));var config=require(_0xe979('0x8'));var attributes=require('./voiceAgentReport.attributes');module[_0xe979('0x9')]=function(_0x580e20,_0x1a0d35){return _0x580e20[_0xe979('0xa')](_0xe979('0xb'),attributes,{'tableName':_0xe979('0xc'),'paranoid':![],'indexes':[{'fields':[_0xe979('0xd'),_0xe979('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5075=['report_agent','uniqueid','destuniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceAgentReport.attributes','define'];(function(_0xac0de1,_0x12d3d9){var _0x1c1995=function(_0x3f96e8){while(--_0x3f96e8){_0xac0de1['push'](_0xac0de1['shift']());}};_0x1c1995(++_0x12d3d9);}(_0x5075,0x73));var _0x5507=function(_0x14102c,_0x1cb214){_0x14102c=_0x14102c-0x0;var _0x13297b=_0x5075[_0x14102c];return _0x13297b;};'use strict';var _=require(_0x5507('0x0'));var util=require(_0x5507('0x1'));var logger=require(_0x5507('0x2'))(_0x5507('0x3'));var moment=require(_0x5507('0x4'));var BPromise=require(_0x5507('0x5'));var rp=require(_0x5507('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5507('0x7'));var config=require(_0x5507('0x8'));var attributes=require(_0x5507('0x9'));module['exports']=function(_0x5b6d7f,_0x2cd9ee){return _0x5b6d7f[_0x5507('0xa')]('VoiceAgentReport',attributes,{'tableName':_0x5507('0xb'),'paranoid':![],'indexes':[{'fields':[_0x5507('0xc'),_0x5507('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 2071d42..01b5042 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 _0x0687=['debug','request\x20sent','stringify','error','VoiceAgentReport,\x20%s,\x20%s','message','result','CreateVoiceAgentReport','VoiceAgentReport','options','raw','then','UpdateVoiceAgentReport','update','body','where','attributes','limit','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x6c1bd9,_0x3462b6){var _0x48eb4d=function(_0x4de0df){while(--_0x4de0df){_0x6c1bd9['push'](_0x6c1bd9['shift']());}};_0x48eb4d(++_0x3462b6);}(_0x0687,0x113));var _0x7068=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0687[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x7068('0x0'));var moment=require(_0x7068('0x1'));var BPromise=require(_0x7068('0x2'));var rs=require(_0x7068('0x3'));var fs=require('fs');var Redis=require(_0x7068('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7068('0x5'));var logger=require(_0x7068('0x6'))('rpc');var config=require(_0x7068('0x7'));var jayson=require(_0x7068('0x8'));var client=jayson[_0x7068('0x9')][_0x7068('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x20156e,_0x19981a,_0xb7a4e9){return new BPromise(function(_0x58c062,_0x1f92a1){return client[_0x7068('0xb')](_0x20156e,_0xb7a4e9)['then'](function(_0x50273d){logger[_0x7068('0xc')]('VoiceAgentReport,\x20%s,\x20%s',_0x19981a,'request\x20sent');logger[_0x7068('0xd')]('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x19981a,_0x7068('0xe'),JSON[_0x7068('0xf')](_0x50273d));if(_0x50273d['error']){if(_0x50273d['error']['code']===0x1f4){logger[_0x7068('0x10')](_0x7068('0x11'),_0x19981a,_0x50273d[_0x7068('0x10')][_0x7068('0x12')]);return _0x1f92a1(_0x50273d[_0x7068('0x10')]['message']);}logger[_0x7068('0x10')](_0x7068('0x11'),_0x19981a,_0x50273d[_0x7068('0x10')]['message']);return _0x58c062(_0x50273d[_0x7068('0x10')][_0x7068('0x12')]);}else{logger[_0x7068('0xc')]('VoiceAgentReport,\x20%s,\x20%s',_0x19981a,_0x7068('0xe'));_0x58c062(_0x50273d[_0x7068('0x13')][_0x7068('0x12')]);}})['catch'](function(_0x1992e0){logger['error'](_0x7068('0x11'),_0x19981a,_0x1992e0);_0x1f92a1(_0x1992e0);});});}exports[_0x7068('0x14')]=function(_0x195f7d){var _0x24b3bf=this;return new Promise(function(_0x2fd9eb,_0x2757ce){return db[_0x7068('0x15')]['create'](_0x195f7d['body'],{'raw':_0x195f7d[_0x7068('0x16')]?_0x195f7d['options'][_0x7068('0x17')]===undefined?!![]:![]:!![]})[_0x7068('0x18')](function(_0xc75f96){logger['info']('CreateVoiceAgentReport',_0x195f7d);logger[_0x7068('0xd')](_0x7068('0x14'),_0x195f7d,JSON[_0x7068('0xf')](_0xc75f96));_0x2fd9eb(_0xc75f96);})['catch'](function(_0x27b4a2){logger[_0x7068('0x10')](_0x7068('0x14'),_0x27b4a2[_0x7068('0x12')],_0x195f7d);_0x2757ce(_0x24b3bf[_0x7068('0x10')](0x1f4,_0x27b4a2[_0x7068('0x12')]));});});};exports[_0x7068('0x19')]=function(_0x2da988){var _0x546726=this;return new Promise(function(_0x29c8d7,_0x53ab89){return db[_0x7068('0x15')][_0x7068('0x1a')](_0x2da988[_0x7068('0x1b')],{'raw':_0x2da988[_0x7068('0x16')]?_0x2da988[_0x7068('0x16')][_0x7068('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2da988[_0x7068('0x16')]?_0x2da988[_0x7068('0x16')][_0x7068('0x1c')]||null:null,'attributes':_0x2da988[_0x7068('0x16')]?_0x2da988[_0x7068('0x16')][_0x7068('0x1d')]||null:null,'limit':_0x2da988['options']?_0x2da988[_0x7068('0x16')][_0x7068('0x1e')]||null:null})[_0x7068('0x18')](function(_0x428029){logger[_0x7068('0xc')](_0x7068('0x19'),_0x2da988);logger[_0x7068('0xd')](_0x7068('0x19'),_0x2da988,JSON['stringify'](_0x428029));_0x29c8d7(_0x428029);})[_0x7068('0x1f')](function(_0x1cfcc8){logger[_0x7068('0x10')](_0x7068('0x19'),_0x1cfcc8['message'],_0x2da988);_0x53ab89(_0x546726[_0x7068('0x10')](0x1f4,_0x1cfcc8[_0x7068('0x12')]));});});}; \ No newline at end of file +var _0xdb73=['stringify','error','code','VoiceAgentReport,\x20%s,\x20%s','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','body','options','raw','then','UpdateVoiceAgentReport','update','where','lodash','util','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0xdb73,0x14f));var _0x3db7=function(_0x211897,_0x5f0ab7){_0x211897=_0x211897-0x0;var _0xbec8a7=_0xdb73[_0x211897];return _0xbec8a7;};'use strict';var _=require(_0x3db7('0x0'));var util=require(_0x3db7('0x1'));var moment=require('moment');var BPromise=require(_0x3db7('0x2'));var rs=require(_0x3db7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3db7('0x4'));var logger=require('../../config/logger')(_0x3db7('0x5'));var config=require(_0x3db7('0x6'));var jayson=require(_0x3db7('0x7'));var client=jayson['client'][_0x3db7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x187318,_0x3dbf8f,_0x560f6c){return new BPromise(function(_0x3f19e3,_0x54c450){return client[_0x3db7('0x9')](_0x187318,_0x560f6c)['then'](function(_0x32884f){logger[_0x3db7('0xa')]('VoiceAgentReport,\x20%s,\x20%s',_0x3dbf8f,_0x3db7('0xb'));logger[_0x3db7('0xc')]('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x3dbf8f,_0x3db7('0xb'),JSON[_0x3db7('0xd')](_0x32884f));if(_0x32884f[_0x3db7('0xe')]){if(_0x32884f[_0x3db7('0xe')][_0x3db7('0xf')]===0x1f4){logger[_0x3db7('0xe')](_0x3db7('0x10'),_0x3dbf8f,_0x32884f[_0x3db7('0xe')]['message']);return _0x54c450(_0x32884f[_0x3db7('0xe')][_0x3db7('0x11')]);}logger[_0x3db7('0xe')]('VoiceAgentReport,\x20%s,\x20%s',_0x3dbf8f,_0x32884f[_0x3db7('0xe')][_0x3db7('0x11')]);return _0x3f19e3(_0x32884f[_0x3db7('0xe')][_0x3db7('0x11')]);}else{logger[_0x3db7('0xa')](_0x3db7('0x10'),_0x3dbf8f,_0x3db7('0xb'));_0x3f19e3(_0x32884f[_0x3db7('0x12')][_0x3db7('0x11')]);}})[_0x3db7('0x13')](function(_0x120ba){logger[_0x3db7('0xe')](_0x3db7('0x10'),_0x3dbf8f,_0x120ba);_0x54c450(_0x120ba);});});}exports[_0x3db7('0x14')]=function(_0x18c873){var _0x1d6c55=this;return new Promise(function(_0x256085,_0x4cbfc2){return db[_0x3db7('0x15')]['create'](_0x18c873[_0x3db7('0x16')],{'raw':_0x18c873['options']?_0x18c873[_0x3db7('0x17')][_0x3db7('0x18')]===undefined?!![]:![]:!![]})[_0x3db7('0x19')](function(_0x39543a){logger['info'](_0x3db7('0x14'),_0x18c873);logger[_0x3db7('0xc')](_0x3db7('0x14'),_0x18c873,JSON[_0x3db7('0xd')](_0x39543a));_0x256085(_0x39543a);})['catch'](function(_0x4e02b7){logger[_0x3db7('0xe')](_0x3db7('0x14'),_0x4e02b7[_0x3db7('0x11')],_0x18c873);_0x4cbfc2(_0x1d6c55[_0x3db7('0xe')](0x1f4,_0x4e02b7[_0x3db7('0x11')]));});});};exports[_0x3db7('0x1a')]=function(_0x450947){var _0x309c2c=this;return new Promise(function(_0x46c0dd,_0xbf696e){return db[_0x3db7('0x15')][_0x3db7('0x1b')](_0x450947['body'],{'raw':_0x450947[_0x3db7('0x17')]?_0x450947[_0x3db7('0x17')][_0x3db7('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x450947[_0x3db7('0x17')]?_0x450947[_0x3db7('0x17')][_0x3db7('0x1c')]||null:null,'attributes':_0x450947['options']?_0x450947[_0x3db7('0x17')]['attributes']||null:null,'limit':_0x450947[_0x3db7('0x17')]?_0x450947[_0x3db7('0x17')]['limit']||null:null})[_0x3db7('0x19')](function(_0x114644){logger[_0x3db7('0xa')](_0x3db7('0x1a'),_0x450947);logger[_0x3db7('0xc')](_0x3db7('0x1a'),_0x450947,JSON[_0x3db7('0xd')](_0x114644));_0x46c0dd(_0x114644);})[_0x3db7('0x13')](function(_0x1e34f0){logger[_0x3db7('0xe')]('UpdateVoiceAgentReport',_0x1e34f0[_0x3db7('0x11')],_0x450947);_0xbf696e(_0x309c2c[_0x3db7('0xe')](0x1f4,_0x1e34f0[_0x3db7('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index d9ae5da..026bb8a 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 _0xd13e=['update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./voiceCallReport.controller','get','/describe','isAuthenticated','describe','/:id','show','post','create','put'];(function(_0x575c75,_0x120aa9){var _0x436370=function(_0x235a5a){while(--_0x235a5a){_0x575c75['push'](_0x575c75['shift']());}};_0x436370(++_0x120aa9);}(_0xd13e,0x193));var _0xed13=function(_0x4c42c3,_0x28fcde){_0x4c42c3=_0x4c42c3-0x0;var _0x2f3510=_0xd13e[_0x4c42c3];return _0x2f3510;};'use strict';var multer=require(_0xed13('0x0'));var util=require(_0xed13('0x1'));var path=require(_0xed13('0x2'));var timeout=require(_0xed13('0x3'));var express=require('express');var router=express[_0xed13('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xed13('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xed13('0x6'));var controller=require(_0xed13('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xed13('0x8')](_0xed13('0x9'),auth[_0xed13('0xa')](),controller[_0xed13('0xb')]);router[_0xed13('0x8')](_0xed13('0xc'),auth[_0xed13('0xa')](),controller[_0xed13('0xd')]);router[_0xed13('0xe')]('/',auth['isAuthenticated'](),controller[_0xed13('0xf')]);router[_0xed13('0x10')](_0xed13('0xc'),auth[_0xed13('0xa')](),controller[_0xed13('0x11')]);router['delete'](_0xed13('0xc'),auth[_0xed13('0xa')](),controller[_0xed13('0x12')]);module[_0xed13('0x13')]=router; \ No newline at end of file +var _0xe0ae=['exports','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./voiceCallReport.controller','index','get','/describe','isAuthenticated','show','post','put','/:id','update'];(function(_0x5f0f89,_0x481b0e){var _0x2bdf9c=function(_0x3e5e00){while(--_0x3e5e00){_0x5f0f89['push'](_0x5f0f89['shift']());}};_0x2bdf9c(++_0x481b0e);}(_0xe0ae,0xa1));var _0xee0a=function(_0x58fbb0,_0xe497b5){_0x58fbb0=_0x58fbb0-0x0;var _0x1783d2=_0xe0ae[_0x58fbb0];return _0x1783d2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xee0a('0x0'));var timeout=require(_0xee0a('0x1'));var express=require('express');var router=express[_0xee0a('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xee0a('0x3'));var interaction=require(_0xee0a('0x4'));var config=require('../../config/environment');var controller=require(_0xee0a('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xee0a('0x6')]);router[_0xee0a('0x7')](_0xee0a('0x8'),auth[_0xee0a('0x9')](),controller['describe']);router[_0xee0a('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xee0a('0xa')]);router[_0xee0a('0xb')]('/',auth[_0xee0a('0x9')](),controller['create']);router[_0xee0a('0xc')](_0xee0a('0xd'),auth['isAuthenticated'](),controller[_0xee0a('0xe')]);router['delete'](_0xee0a('0xd'),auth[_0xee0a('0x9')](),controller['destroy']);module[_0xee0a('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 7c21e2c..a2af6e0 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 _0xfb71=['sequelize','exports','STRING','ENUM','inbound','inbound-fax','outbound-fax','dialer','TEXT','DATE','INTEGER'];(function(_0x3bcba4,_0xaa7d1){var _0x269e3a=function(_0x2b2070){while(--_0x2b2070){_0x3bcba4['push'](_0x3bcba4['shift']());}};_0x269e3a(++_0xaa7d1);}(_0xfb71,0x1ef));var _0x1fb7=function(_0x3122d7,_0x585e77){_0x3122d7=_0x3122d7-0x0;var _0x3a206c=_0xfb71[_0x3122d7];return _0x3a206c;};'use strict';var Sequelize=require(_0x1fb7('0x0'));module[_0x1fb7('0x1')]={'uniqueid':{'type':Sequelize[_0x1fb7('0x2')]},'type':{'type':Sequelize[_0x1fb7('0x3')](_0x1fb7('0x4'),'internal','outbound',_0x1fb7('0x5'),_0x1fb7('0x6'),_0x1fb7('0x7'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x1fb7('0x2')]},'source':{'type':Sequelize[_0x1fb7('0x2')]},'destination':{'type':Sequelize[_0x1fb7('0x2')]},'destinationcontext':{'type':Sequelize[_0x1fb7('0x2')]},'callerid':{'type':Sequelize[_0x1fb7('0x2')]},'channel':{'type':Sequelize[_0x1fb7('0x2')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x1fb7('0x2')]},'lastdata':{'type':Sequelize[_0x1fb7('0x8')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x1fb7('0x9')]},'answertime':{'type':Sequelize[_0x1fb7('0x9')]},'endtime':{'type':Sequelize[_0x1fb7('0x9')]},'duration':{'type':Sequelize[_0x1fb7('0xa')]},'billableseconds':{'type':Sequelize[_0x1fb7('0xa')]},'mohtime':{'type':Sequelize[_0x1fb7('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x1fb7('0x2')]},'userDisposition':{'type':Sequelize[_0x1fb7('0x2')]},'userSecondDisposition':{'type':Sequelize[_0x1fb7('0x2')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x1fb7('0x2')]},'prefix':{'type':Sequelize[_0x1fb7('0x2')]},'routeid':{'type':Sequelize[_0x1fb7('0xa')]},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xdb35=['sequelize','exports','inbound','internal','outbound','outbound-fax','dialer','STRING','TEXT','DATE','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb35,0x8f));var _0x5db3=function(_0x22089b,_0x2e9648){_0x22089b=_0x22089b-0x0;var _0x403a74=_0xdb35[_0x22089b];return _0x403a74;};'use strict';var Sequelize=require(_0x5db3('0x0'));module[_0x5db3('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x5db3('0x2'),_0x5db3('0x3'),_0x5db3('0x4'),'inbound-fax',_0x5db3('0x5'),_0x5db3('0x6'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x5db3('0x7')]},'source':{'type':Sequelize[_0x5db3('0x7')]},'destination':{'type':Sequelize[_0x5db3('0x7')]},'destinationcontext':{'type':Sequelize[_0x5db3('0x7')]},'callerid':{'type':Sequelize[_0x5db3('0x7')]},'channel':{'type':Sequelize[_0x5db3('0x7')]},'destinationchannel':{'type':Sequelize[_0x5db3('0x7')]},'lastapplication':{'type':Sequelize[_0x5db3('0x7')]},'lastdata':{'type':Sequelize[_0x5db3('0x8')]},'starttime':{'type':Sequelize[_0x5db3('0x9')]},'systemanswertime':{'type':Sequelize[_0x5db3('0x9')]},'answertime':{'type':Sequelize[_0x5db3('0x9')]},'endtime':{'type':Sequelize[_0x5db3('0x9')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x5db3('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x5db3('0x7')]},'amaflags':{'type':Sequelize[_0x5db3('0x7')]},'userfield':{'type':Sequelize[_0x5db3('0x7')]},'userDisposition':{'type':Sequelize[_0x5db3('0x7')]},'userSecondDisposition':{'type':Sequelize[_0x5db3('0x7')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x5db3('0x7')]},'prefix':{'type':Sequelize[_0x5db3('0x7')]},'routeid':{'type':Sequelize[_0x5db3('0xa')]},'sipcallid':{'type':Sequelize[_0x5db3('0x7')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 2133fa4..20c9f04 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 _0xb10b=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','VIRTUAL','filter','merge','options','VoiceCallReport','includeAll','include','alias','User','rows','show','find','create','body','catch','params','describe','uniqueid','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce'];(function(_0x1c5f3f,_0x3280cf){var _0x4a94fe=function(_0x45b817){while(--_0x45b817){_0x1c5f3f['push'](_0x1c5f3f['shift']());}};_0x4a94fe(++_0x3280cf);}(_0xb10b,0x12a));var _0xbb10=function(_0x2a4d07,_0x3664aa){_0x2a4d07=_0x2a4d07-0x0;var _0x3d0203=_0xb10b[_0x2a4d07];return _0x3d0203;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var jsonpatch=require(_0xbb10('0x2'));var rp=require(_0xbb10('0x3'));var moment=require('moment');var BPromise=require(_0xbb10('0x4'));var Mustache=require(_0xbb10('0x5'));var util=require(_0xbb10('0x6'));var path=require(_0xbb10('0x7'));var sox=require(_0xbb10('0x8'));var csv=require(_0xbb10('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb10('0xa'));var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0x9'));var querystring=require(_0xbb10('0xf'));var Papa=require(_0xbb10('0x10'));var Redis=require(_0xbb10('0x11'));var authService=require(_0xbb10('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x13'));var logger=require(_0xbb10('0x14'))(_0xbb10('0x15'));var utils=require('../../config/utils');var config=require(_0xbb10('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbb10('0x17'))['db'];function respondWithStatusCode(_0x916a32,_0x285009){_0x285009=_0x285009||0xcc;return function(_0x193a27){if(_0x193a27){return _0x916a32[_0xbb10('0x18')](_0x285009);}return _0x916a32[_0xbb10('0x19')](_0x285009)['end']();};}function respondWithResult(_0x26e021,_0x42d7e4){_0x42d7e4=_0x42d7e4||0xc8;return function(_0x45b9d6){if(_0x45b9d6){return _0x26e021[_0xbb10('0x19')](_0x42d7e4)[_0xbb10('0x1a')](_0x45b9d6);}};}function respondWithFilteredResult(_0x2f2ebf,_0x24a57b){return function(_0x36b5e8){if(_0x36b5e8){var _0x3e26f4=typeof _0x24a57b[_0xbb10('0x1b')]==='undefined'&&typeof _0x24a57b[_0xbb10('0x1c')]===_0xbb10('0x1d');var _0x133ac2=_0x36b5e8[_0xbb10('0x1e')];var _0x378da8=_0x3e26f4?0x0:_0x24a57b[_0xbb10('0x1b')];var _0x575cca=_0x3e26f4?_0x36b5e8[_0xbb10('0x1e')]:_0x24a57b[_0xbb10('0x1b')]+_0x24a57b[_0xbb10('0x1c')];var _0x48b6e9;if(_0x575cca>=_0x133ac2){_0x575cca=_0x133ac2;_0x48b6e9=0xc8;}else{_0x48b6e9=0xce;}_0x2f2ebf[_0xbb10('0x19')](_0x48b6e9);return _0x2f2ebf[_0xbb10('0x1f')](_0xbb10('0x20'),_0x378da8+'-'+_0x575cca+'/'+_0x133ac2)[_0xbb10('0x1a')](_0x36b5e8);}return null;};}function patchUpdates(_0xdf237d){return function(_0x44e563){try{jsonpatch['apply'](_0x44e563,_0xdf237d,!![]);}catch(_0x12f888){return BPromise[_0xbb10('0x21')](_0x12f888);}return _0x44e563['save']();};}function saveUpdates(_0x4c4b0d,_0x8e2b97){return function(_0x311abe){if(_0x311abe){return _0x311abe[_0xbb10('0x22')](_0x4c4b0d)[_0xbb10('0x23')](function(_0x445761){return _0x445761;});}return null;};}function removeEntity(_0x1824b7,_0x407cb4){return function(_0x436104){if(_0x436104){return _0x436104[_0xbb10('0x24')]()[_0xbb10('0x23')](function(){_0x1824b7[_0xbb10('0x19')](0xcc)[_0xbb10('0x25')]();});}};}function handleEntityNotFound(_0x537898,_0x4fedac){return function(_0x4fb5e0){if(!_0x4fb5e0){_0x537898[_0xbb10('0x18')](0x194);}return _0x4fb5e0;};}function handleError(_0x3c5ae7,_0x2c89b9){_0x2c89b9=_0x2c89b9||0x1f4;return function(_0x4e25ff){logger[_0xbb10('0x26')](_0x4e25ff[_0xbb10('0x27')]);if(_0x4e25ff[_0xbb10('0x28')]){delete _0x4e25ff[_0xbb10('0x28')];}_0x3c5ae7[_0xbb10('0x19')](_0x2c89b9)[_0xbb10('0x29')](_0x4e25ff);};}exports[_0xbb10('0x2a')]=function(_0x4aabb9,_0x3796c7){var _0x21ac54={},_0xfc3595={},_0x2e0249={'count':0x0,'rows':[]};var _0x1d30aa=_[_0xbb10('0x2b')](db['VoiceCallReport'][_0xbb10('0x2c')],function(_0x4ee02e){return{'name':_0x4ee02e[_0xbb10('0x2d')],'type':_0x4ee02e['type'][_0xbb10('0x2e')]};});_0xfc3595[_0xbb10('0x2f')]=_[_0xbb10('0x2b')](_0x1d30aa,'name');_0xfc3595['query']=_[_0xbb10('0x30')](_0x4aabb9[_0xbb10('0x31')]);_0xfc3595['filters']=_[_0xbb10('0x32')](_0xfc3595[_0xbb10('0x2f')],_0xfc3595[_0xbb10('0x31')]);_0x21ac54[_0xbb10('0x33')]=_[_0xbb10('0x32')](_0xfc3595[_0xbb10('0x2f')],qs[_0xbb10('0x34')](_0x4aabb9['query'][_0xbb10('0x34')]));_0x21ac54[_0xbb10('0x33')]=_0x21ac54[_0xbb10('0x33')][_0xbb10('0x35')]?_0x21ac54[_0xbb10('0x33')]:_0xfc3595[_0xbb10('0x2f')];if(!_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x36')](_0xbb10('0x37'))){_0x21ac54['limit']=qs[_0xbb10('0x1c')](_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x1c')]);_0x21ac54[_0xbb10('0x1b')]=qs['offset'](_0x4aabb9[_0xbb10('0x31')]['offset']);}_0x21ac54['order']=qs[_0xbb10('0x38')](_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x38')]);_0x21ac54[_0xbb10('0x39')]=qs[_0xbb10('0x3a')](_[_0xbb10('0x3b')](_0x4aabb9['query'],_0xfc3595[_0xbb10('0x3a')]),_0x1d30aa);if(_0x4aabb9[_0xbb10('0x31')]['filter']){_0x21ac54['where']=_['merge'](_0x21ac54[_0xbb10('0x39')],{'$or':_[_0xbb10('0x2b')](_0x1d30aa,function(_0x2b658a){if(_0x2b658a['type']!==_0xbb10('0x3c')){var _0x3e8538={};_0x3e8538[_0x2b658a[_0xbb10('0x28')]]={'$like':'%'+_0x4aabb9['query'][_0xbb10('0x3d')]+'%'};return _0x3e8538;}})});}_0x21ac54=_[_0xbb10('0x3e')]({},_0x21ac54,_0x4aabb9[_0xbb10('0x3f')]);var _0x446f49={'where':_0x21ac54['where']};return db[_0xbb10('0x40')][_0xbb10('0x1e')](_0x446f49)['then'](function(_0xe2040f){_0x2e0249[_0xbb10('0x1e')]=_0xe2040f;if(_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x41')]){_0x21ac54[_0xbb10('0x42')]=[{'attributes':['id',_0xbb10('0x28'),'fullname',_0xbb10('0x43')],'model':db[_0xbb10('0x44')],'as':_0xbb10('0x44')}];}return db[_0xbb10('0x40')]['findAll'](_0x21ac54);})[_0xbb10('0x23')](function(_0x331751){_0x2e0249[_0xbb10('0x45')]=_0x331751;return _0x2e0249;})[_0xbb10('0x23')](respondWithFilteredResult(_0x3796c7,_0x21ac54))['catch'](handleError(_0x3796c7,null));};exports[_0xbb10('0x46')]=function(_0x202c60,_0x54ac18){var _0x5d9a4f={'raw':!![],'where':{'id':_0x202c60['params']['id']}},_0x38d78f={};_0x38d78f[_0xbb10('0x2f')]=_[_0xbb10('0x30')](db['VoiceCallReport'][_0xbb10('0x2c')]);_0x38d78f[_0xbb10('0x31')]=_[_0xbb10('0x30')](_0x202c60['query']);_0x38d78f[_0xbb10('0x3a')]=_[_0xbb10('0x32')](_0x38d78f[_0xbb10('0x2f')],_0x38d78f[_0xbb10('0x31')]);_0x5d9a4f[_0xbb10('0x33')]=_[_0xbb10('0x32')](_0x38d78f[_0xbb10('0x2f')],qs[_0xbb10('0x34')](_0x202c60[_0xbb10('0x31')][_0xbb10('0x34')]));_0x5d9a4f[_0xbb10('0x33')]=_0x5d9a4f[_0xbb10('0x33')]['length']?_0x5d9a4f[_0xbb10('0x33')]:_0x38d78f[_0xbb10('0x2f')];if(_0x202c60['query'][_0xbb10('0x41')]){_0x5d9a4f[_0xbb10('0x42')]=[{'all':!![]}];}_0x5d9a4f=_[_0xbb10('0x3e')]({},_0x5d9a4f,_0x202c60[_0xbb10('0x3f')]);return db[_0xbb10('0x40')][_0xbb10('0x47')](_0x5d9a4f)[_0xbb10('0x23')](handleEntityNotFound(_0x54ac18,null))['then'](respondWithResult(_0x54ac18,null))['catch'](handleError(_0x54ac18,null));};exports[_0xbb10('0x48')]=function(_0x76a208,_0x2b12bd){return db['VoiceCallReport']['create'](_0x76a208[_0xbb10('0x49')],{})[_0xbb10('0x23')](respondWithResult(_0x2b12bd,0xc9))[_0xbb10('0x4a')](handleError(_0x2b12bd,null));};exports[_0xbb10('0x24')]=function(_0x10159b,_0x22b315){return db[_0xbb10('0x40')][_0xbb10('0x47')]({'where':{'id':_0x10159b[_0xbb10('0x4b')]['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x22b315,null))['then'](removeEntity(_0x22b315,null))['catch'](handleError(_0x22b315,null));};exports[_0xbb10('0x4c')]=function(_0x467dba,_0x36ab7d){return db[_0xbb10('0x40')][_0xbb10('0x4c')]()[_0xbb10('0x23')](respondWithResult(_0x36ab7d,null))[_0xbb10('0x4a')](handleError(_0x36ab7d,null));};exports[_0xbb10('0x22')]=function(_0x1c0d8f,_0x1214f7){if(_0x1c0d8f[_0xbb10('0x49')][_0xbb10('0x4d')]){delete _0x1c0d8f[_0xbb10('0x49')][_0xbb10('0x4d')];}return db[_0xbb10('0x40')]['find']({'where':{'uniqueid':_0x1c0d8f[_0xbb10('0x4b')]['id'],'UserId':{'$or':[null,_0x1c0d8f['user']['id']]}}})[_0xbb10('0x23')](handleEntityNotFound(_0x1214f7,null))[_0xbb10('0x23')](saveUpdates(_0x1c0d8f[_0xbb10('0x49')],null))[_0xbb10('0x23')](respondWithResult(_0x1214f7,null))[_0xbb10('0x4a')](handleError(_0x1214f7,null));}; \ No newline at end of file +var _0x2032=['../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','options','alias','User','rows','catch','show','params','keys','rawAttributes','includeAll','include','create','body','find','describe','uniqueid','user','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2032,0xd9));var _0x2203=function(_0x378ff3,_0x32d642){_0x378ff3=_0x378ff3-0x0;var _0x5a04a6=_0x2032[_0x378ff3];return _0x5a04a6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2203('0x0'));var zipdir=require(_0x2203('0x1'));var jsonpatch=require(_0x2203('0x2'));var rp=require('request-promise');var moment=require(_0x2203('0x3'));var BPromise=require(_0x2203('0x4'));var Mustache=require('mustache');var util=require(_0x2203('0x5'));var path=require(_0x2203('0x6'));var sox=require(_0x2203('0x7'));var csv=require(_0x2203('0x8'));var ejs=require(_0x2203('0x9'));var fs=require('fs');var fs_extra=require(_0x2203('0xa'));var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2203('0x14'))('api');var utils=require(_0x2203('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2203('0x16'));var db=require(_0x2203('0x17'))['db'];function respondWithStatusCode(_0x4b9376,_0x583bc7){_0x583bc7=_0x583bc7||0xcc;return function(_0x585c76){if(_0x585c76){return _0x4b9376['sendStatus'](_0x583bc7);}return _0x4b9376['status'](_0x583bc7)[_0x2203('0x18')]();};}function respondWithResult(_0x538b30,_0x592e47){_0x592e47=_0x592e47||0xc8;return function(_0x21a3af){if(_0x21a3af){return _0x538b30[_0x2203('0x19')](_0x592e47)[_0x2203('0x1a')](_0x21a3af);}};}function respondWithFilteredResult(_0x41af85,_0x226209){return function(_0x3fe0a8){if(_0x3fe0a8){var _0x2c36e6=typeof _0x226209[_0x2203('0x1b')]===_0x2203('0x1c')&&typeof _0x226209[_0x2203('0x1d')]==='undefined';var _0x280eda=_0x3fe0a8[_0x2203('0x1e')];var _0x4893ff=_0x2c36e6?0x0:_0x226209[_0x2203('0x1b')];var _0x8906e1=_0x2c36e6?_0x3fe0a8['count']:_0x226209[_0x2203('0x1b')]+_0x226209['limit'];var _0x2904ba;if(_0x8906e1>=_0x280eda){_0x8906e1=_0x280eda;_0x2904ba=0xc8;}else{_0x2904ba=0xce;}_0x41af85[_0x2203('0x19')](_0x2904ba);return _0x41af85[_0x2203('0x1f')](_0x2203('0x20'),_0x4893ff+'-'+_0x8906e1+'/'+_0x280eda)[_0x2203('0x1a')](_0x3fe0a8);}return null;};}function patchUpdates(_0x449039){return function(_0x538c23){try{jsonpatch[_0x2203('0x21')](_0x538c23,_0x449039,!![]);}catch(_0x50822b){return BPromise['reject'](_0x50822b);}return _0x538c23[_0x2203('0x22')]();};}function saveUpdates(_0x496d82,_0x3b8ef9){return function(_0x5bfe61){if(_0x5bfe61){return _0x5bfe61['update'](_0x496d82)[_0x2203('0x23')](function(_0x5e29cd){return _0x5e29cd;});}return null;};}function removeEntity(_0x5c8da9,_0x226374){return function(_0x2718f5){if(_0x2718f5){return _0x2718f5[_0x2203('0x24')]()[_0x2203('0x23')](function(){_0x5c8da9[_0x2203('0x19')](0xcc)[_0x2203('0x18')]();});}};}function handleEntityNotFound(_0x49c12,_0x250349){return function(_0x576378){if(!_0x576378){_0x49c12[_0x2203('0x25')](0x194);}return _0x576378;};}function handleError(_0x36b958,_0x39a11a){_0x39a11a=_0x39a11a||0x1f4;return function(_0x5f11bf){logger[_0x2203('0x26')](_0x5f11bf[_0x2203('0x27')]);if(_0x5f11bf['name']){delete _0x5f11bf[_0x2203('0x28')];}_0x36b958[_0x2203('0x19')](_0x39a11a)[_0x2203('0x29')](_0x5f11bf);};}exports[_0x2203('0x2a')]=function(_0x28ae02,_0x1df508){var _0x9c53f={},_0x5a95c1={},_0x34b8ba={'count':0x0,'rows':[]};var _0x616ed8=_[_0x2203('0x2b')](db[_0x2203('0x2c')]['rawAttributes'],function(_0x3a8e23){return{'name':_0x3a8e23[_0x2203('0x2d')],'type':_0x3a8e23[_0x2203('0x2e')][_0x2203('0x2f')]};});_0x5a95c1['model']=_[_0x2203('0x2b')](_0x616ed8,_0x2203('0x28'));_0x5a95c1['query']=_['keys'](_0x28ae02[_0x2203('0x30')]);_0x5a95c1['filters']=_['intersection'](_0x5a95c1[_0x2203('0x31')],_0x5a95c1[_0x2203('0x30')]);_0x9c53f[_0x2203('0x32')]=_[_0x2203('0x33')](_0x5a95c1[_0x2203('0x31')],qs['fields'](_0x28ae02[_0x2203('0x30')][_0x2203('0x34')]));_0x9c53f['attributes']=_0x9c53f[_0x2203('0x32')][_0x2203('0x35')]?_0x9c53f[_0x2203('0x32')]:_0x5a95c1[_0x2203('0x31')];if(!_0x28ae02[_0x2203('0x30')][_0x2203('0x36')](_0x2203('0x37'))){_0x9c53f[_0x2203('0x1d')]=qs[_0x2203('0x1d')](_0x28ae02['query'][_0x2203('0x1d')]);_0x9c53f[_0x2203('0x1b')]=qs['offset'](_0x28ae02['query'][_0x2203('0x1b')]);}_0x9c53f['order']=qs[_0x2203('0x38')](_0x28ae02[_0x2203('0x30')][_0x2203('0x38')]);_0x9c53f['where']=qs['filters'](_[_0x2203('0x39')](_0x28ae02['query'],_0x5a95c1[_0x2203('0x3a')]),_0x616ed8);if(_0x28ae02['query'][_0x2203('0x3b')]){_0x9c53f['where']=_[_0x2203('0x3c')](_0x9c53f[_0x2203('0x3d')],{'$or':_[_0x2203('0x2b')](_0x616ed8,function(_0x40a793){if(_0x40a793[_0x2203('0x2e')]!=='VIRTUAL'){var _0x5f1561={};_0x5f1561[_0x40a793['name']]={'$like':'%'+_0x28ae02[_0x2203('0x30')][_0x2203('0x3b')]+'%'};return _0x5f1561;}})});}_0x9c53f=_[_0x2203('0x3c')]({},_0x9c53f,_0x28ae02[_0x2203('0x3e')]);var _0x3283fb={'where':_0x9c53f[_0x2203('0x3d')]};return db[_0x2203('0x2c')]['count'](_0x3283fb)[_0x2203('0x23')](function(_0x1b12c3){_0x34b8ba[_0x2203('0x1e')]=_0x1b12c3;if(_0x28ae02[_0x2203('0x30')]['includeAll']){_0x9c53f['include']=[{'attributes':['id',_0x2203('0x28'),'fullname',_0x2203('0x3f')],'model':db[_0x2203('0x40')],'as':_0x2203('0x40')}];}return db['VoiceCallReport']['findAll'](_0x9c53f);})[_0x2203('0x23')](function(_0x3739f6){_0x34b8ba[_0x2203('0x41')]=_0x3739f6;return _0x34b8ba;})[_0x2203('0x23')](respondWithFilteredResult(_0x1df508,_0x9c53f))[_0x2203('0x42')](handleError(_0x1df508,null));};exports[_0x2203('0x43')]=function(_0x5cd573,_0x15d3b6){var _0x165a3f={'raw':!![],'where':{'id':_0x5cd573[_0x2203('0x44')]['id']}},_0x3a866c={};_0x3a866c[_0x2203('0x31')]=_[_0x2203('0x45')](db[_0x2203('0x2c')][_0x2203('0x46')]);_0x3a866c[_0x2203('0x30')]=_[_0x2203('0x45')](_0x5cd573['query']);_0x3a866c[_0x2203('0x3a')]=_[_0x2203('0x33')](_0x3a866c[_0x2203('0x31')],_0x3a866c[_0x2203('0x30')]);_0x165a3f['attributes']=_['intersection'](_0x3a866c[_0x2203('0x31')],qs['fields'](_0x5cd573[_0x2203('0x30')][_0x2203('0x34')]));_0x165a3f[_0x2203('0x32')]=_0x165a3f[_0x2203('0x32')]['length']?_0x165a3f[_0x2203('0x32')]:_0x3a866c[_0x2203('0x31')];if(_0x5cd573['query'][_0x2203('0x47')]){_0x165a3f[_0x2203('0x48')]=[{'all':!![]}];}_0x165a3f=_[_0x2203('0x3c')]({},_0x165a3f,_0x5cd573[_0x2203('0x3e')]);return db['VoiceCallReport']['find'](_0x165a3f)[_0x2203('0x23')](handleEntityNotFound(_0x15d3b6,null))['then'](respondWithResult(_0x15d3b6,null))['catch'](handleError(_0x15d3b6,null));};exports[_0x2203('0x49')]=function(_0x33b7b5,_0x1a2665){return db['VoiceCallReport']['create'](_0x33b7b5[_0x2203('0x4a')],{})[_0x2203('0x23')](respondWithResult(_0x1a2665,0xc9))[_0x2203('0x42')](handleError(_0x1a2665,null));};exports[_0x2203('0x24')]=function(_0x225b0e,_0x21fd78){return db['VoiceCallReport'][_0x2203('0x4b')]({'where':{'id':_0x225b0e['params']['id']}})[_0x2203('0x23')](handleEntityNotFound(_0x21fd78,null))[_0x2203('0x23')](removeEntity(_0x21fd78,null))[_0x2203('0x42')](handleError(_0x21fd78,null));};exports[_0x2203('0x4c')]=function(_0x58b9bb,_0x506795){return db[_0x2203('0x2c')][_0x2203('0x4c')]()[_0x2203('0x23')](respondWithResult(_0x506795,null))[_0x2203('0x42')](handleError(_0x506795,null));};exports['update']=function(_0x4de47a,_0x49999a){if(_0x4de47a[_0x2203('0x4a')][_0x2203('0x4d')]){delete _0x4de47a['body'][_0x2203('0x4d')];}return db[_0x2203('0x2c')]['find']({'where':{'uniqueid':_0x4de47a[_0x2203('0x44')]['id'],'UserId':{'$or':[null,_0x4de47a[_0x2203('0x4e')]['id']]}}})[_0x2203('0x23')](handleEntityNotFound(_0x49999a,null))[_0x2203('0x23')](saveUpdates(_0x4de47a['body'],null))[_0x2203('0x23')](respondWithResult(_0x49999a,null))['catch'](handleError(_0x49999a,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index d416011..25f04b9 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 _0xce92=['path','exports','define','VoiceCallReport','report_call','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2aecb2,_0x343312){var _0x3ebb80=function(_0x19fab3){while(--_0x19fab3){_0x2aecb2['push'](_0x2aecb2['shift']());}};_0x3ebb80(++_0x343312);}(_0xce92,0x186));var _0x2ce9=function(_0x2d2006,_0x2d27b3){_0x2d2006=_0x2d2006-0x0;var _0x442661=_0xce92[_0x2d2006];return _0x442661;};'use strict';var _=require(_0x2ce9('0x0'));var util=require('util');var logger=require(_0x2ce9('0x1'))(_0x2ce9('0x2'));var moment=require(_0x2ce9('0x3'));var BPromise=require(_0x2ce9('0x4'));var rp=require(_0x2ce9('0x5'));var fs=require('fs');var path=require(_0x2ce9('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./voiceCallReport.attributes');module[_0x2ce9('0x7')]=function(_0x52ae15,_0x2024b4){return _0x52ae15[_0x2ce9('0x8')](_0x2ce9('0x9'),attributes,{'tableName':_0x2ce9('0xa'),'paranoid':![],'indexes':[{'fields':[_0x2ce9('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5265=['exports','VoiceCallReport','report_call','uniqueid','lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./voiceCallReport.attributes'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x5265,0x10c));var _0x5526=function(_0x243d70,_0x366107){_0x243d70=_0x243d70-0x0;var _0x2a45e4=_0x5265[_0x243d70];return _0x2a45e4;};'use strict';var _=require(_0x5526('0x0'));var util=require(_0x5526('0x1'));var logger=require(_0x5526('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5526('0x3'));var rp=require(_0x5526('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5526('0x5'));var config=require(_0x5526('0x6'));var attributes=require(_0x5526('0x7'));module[_0x5526('0x8')]=function(_0x1b8f04,_0x8a91de){return _0x1b8f04['define'](_0x5526('0x9'),attributes,{'tableName':_0x5526('0xa'),'paranoid':![],'indexes':[{'fields':[_0x5526('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 4d0409a..c30f3ea 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 _0xad01=['create','body','then','stringify','UpdateVoiceCallReport','update','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request\x20sent','VoiceCallReport,\x20%s,\x20%s,\x20%s','code','error','VoiceCallReport,\x20%s,\x20%s','message','info','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','attributes','limit','include','map','model','debug','CreateVoiceCallReport'];(function(_0x14e8f4,_0x3d052a){var _0x3d8914=function(_0x3772ae){while(--_0x3772ae){_0x14e8f4['push'](_0x14e8f4['shift']());}};_0x3d8914(++_0x3d052a);}(_0xad01,0x7f));var _0x1ad0=function(_0x158ff0,_0x3409ba){_0x158ff0=_0x158ff0-0x0;var _0x5864e5=_0xad01[_0x158ff0];return _0x5864e5;};'use strict';var _=require(_0x1ad0('0x0'));var util=require(_0x1ad0('0x1'));var moment=require(_0x1ad0('0x2'));var BPromise=require(_0x1ad0('0x3'));var rs=require(_0x1ad0('0x4'));var fs=require('fs');var Redis=require(_0x1ad0('0x5'));var db=require(_0x1ad0('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1ad0('0x7'))('rpc');var config=require(_0x1ad0('0x8'));var jayson=require(_0x1ad0('0x9'));var client=jayson[_0x1ad0('0xa')][_0x1ad0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4d041c,_0x543e09,_0x266d4d){return new BPromise(function(_0x4e545f,_0x39ae98){return client['request'](_0x4d041c,_0x266d4d)['then'](function(_0x32971f){logger['info']('VoiceCallReport,\x20%s,\x20%s',_0x543e09,_0x1ad0('0xc'));logger['debug'](_0x1ad0('0xd'),_0x543e09,'request\x20sent',JSON['stringify'](_0x32971f));if(_0x32971f['error']){if(_0x32971f['error'][_0x1ad0('0xe')]===0x1f4){logger[_0x1ad0('0xf')](_0x1ad0('0x10'),_0x543e09,_0x32971f[_0x1ad0('0xf')][_0x1ad0('0x11')]);return _0x39ae98(_0x32971f['error'][_0x1ad0('0x11')]);}logger[_0x1ad0('0xf')]('VoiceCallReport,\x20%s,\x20%s',_0x543e09,_0x32971f['error'][_0x1ad0('0x11')]);return _0x4e545f(_0x32971f['error'][_0x1ad0('0x11')]);}else{logger[_0x1ad0('0x12')](_0x1ad0('0x10'),_0x543e09,'request\x20sent');_0x4e545f(_0x32971f[_0x1ad0('0x13')]['message']);}})[_0x1ad0('0x14')](function(_0x45e49b){logger[_0x1ad0('0xf')](_0x1ad0('0x10'),_0x543e09,_0x45e49b);_0x39ae98(_0x45e49b);});});}exports[_0x1ad0('0x15')]=function(_0x22bb2d){var _0x405ef1=this;return new Promise(function(_0x9a4101,_0x396ff0){return db[_0x1ad0('0x16')][_0x1ad0('0x17')]({'raw':_0x22bb2d[_0x1ad0('0x18')]?_0x22bb2d['options'][_0x1ad0('0x19')]===undefined?!![]:![]:!![],'where':_0x22bb2d[_0x1ad0('0x18')]?_0x22bb2d['options']['where']||null:null,'attributes':_0x22bb2d[_0x1ad0('0x18')]?_0x22bb2d[_0x1ad0('0x18')][_0x1ad0('0x1a')]||null:null,'limit':_0x22bb2d[_0x1ad0('0x18')]?_0x22bb2d[_0x1ad0('0x18')][_0x1ad0('0x1b')]||null:null,'include':_0x22bb2d['options']?_0x22bb2d[_0x1ad0('0x18')][_0x1ad0('0x1c')]?_[_0x1ad0('0x1d')](_0x22bb2d[_0x1ad0('0x18')][_0x1ad0('0x1c')],function(_0x1d5e55){return{'model':db[_0x1d5e55['model']],'as':_0x1d5e55['as'],'attributes':_0x1d5e55['attributes'],'include':_0x1d5e55[_0x1ad0('0x1c')]?_[_0x1ad0('0x1d')](_0x1d5e55['include'],function(_0xc9f953){return{'model':db[_0xc9f953[_0x1ad0('0x1e')]],'as':_0xc9f953['as'],'attributes':_0xc9f953[_0x1ad0('0x1a')],'include':_0xc9f953['include']?_[_0x1ad0('0x1d')](_0xc9f953[_0x1ad0('0x1c')],function(_0xfbc9ae){return{'model':db[_0xfbc9ae['model']],'as':_0xfbc9ae['as'],'attributes':_0xfbc9ae[_0x1ad0('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5c6f77){logger[_0x1ad0('0x12')](_0x1ad0('0x15'),_0x22bb2d);logger[_0x1ad0('0x1f')](_0x1ad0('0x15'),_0x22bb2d,JSON['stringify'](_0x5c6f77));_0x9a4101(_0x5c6f77);})['catch'](function(_0x4bf787){logger['error'](_0x1ad0('0x15'),_0x4bf787['message'],_0x22bb2d);_0x396ff0(_0x405ef1[_0x1ad0('0xf')](0x1f4,_0x4bf787['message']));});});};exports[_0x1ad0('0x20')]=function(_0x3d8dcf){var _0xe38a62=this;return new Promise(function(_0x534252,_0x1ad6db){return db['VoiceCallReport'][_0x1ad0('0x21')](_0x3d8dcf[_0x1ad0('0x22')],{'raw':_0x3d8dcf[_0x1ad0('0x18')]?_0x3d8dcf[_0x1ad0('0x18')][_0x1ad0('0x19')]===undefined?!![]:![]:!![]})[_0x1ad0('0x23')](function(_0x5d5608){logger['info'](_0x1ad0('0x20'),_0x3d8dcf);logger[_0x1ad0('0x1f')]('CreateVoiceCallReport',_0x3d8dcf,JSON[_0x1ad0('0x24')](_0x5d5608));_0x534252(_0x5d5608);})['catch'](function(_0x31c147){logger[_0x1ad0('0xf')](_0x1ad0('0x20'),_0x31c147['message'],_0x3d8dcf);_0x1ad6db(_0xe38a62[_0x1ad0('0xf')](0x1f4,_0x31c147['message']));});});};exports[_0x1ad0('0x25')]=function(_0x1d24be){var _0x5d397c=this;return new Promise(function(_0x3fcae5,_0x3ec329){return db[_0x1ad0('0x16')][_0x1ad0('0x26')](_0x1d24be[_0x1ad0('0x22')],{'raw':_0x1d24be[_0x1ad0('0x18')]?_0x1d24be[_0x1ad0('0x18')][_0x1ad0('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d24be[_0x1ad0('0x18')]?_0x1d24be[_0x1ad0('0x18')][_0x1ad0('0x27')]||null:null,'attributes':_0x1d24be[_0x1ad0('0x18')]?_0x1d24be[_0x1ad0('0x18')][_0x1ad0('0x1a')]||null:null,'limit':_0x1d24be['options']?_0x1d24be[_0x1ad0('0x18')][_0x1ad0('0x1b')]||null:null})[_0x1ad0('0x23')](function(_0x543ead){logger[_0x1ad0('0x12')]('UpdateVoiceCallReport',_0x1d24be);logger[_0x1ad0('0x1f')]('UpdateVoiceCallReport',_0x1d24be,JSON['stringify'](_0x543ead));_0x3fcae5(_0x543ead);})[_0x1ad0('0x14')](function(_0x3b9d6e){logger['error']('UpdateVoiceCallReport',_0x3b9d6e[_0x1ad0('0x11')],_0x1d24be);_0x3ec329(_0x5d397c[_0x1ad0('0xf')](0x1f4,_0x3b9d6e[_0x1ad0('0x11')]));});});}; \ No newline at end of file +var _0x6a55=['info','catch','GetVoiceCallReport','VoiceCallReport','options','raw','limit','include','map','model','attributes','CreateVoiceCallReport','body','UpdateVoiceCallReport','where','util','moment','bluebird','randomstring','rpc','../../config/environment','client','http','then','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x46be87,_0x362bac){var _0x3a3fec=function(_0x5dce29){while(--_0x5dce29){_0x46be87['push'](_0x46be87['shift']());}};_0x3a3fec(++_0x362bac);}(_0x6a55,0x1ef));var _0x56a5=function(_0x4de9e8,_0x565ffa){_0x4de9e8=_0x4de9e8-0x0;var _0x4db0de=_0x6a55[_0x4de9e8];return _0x4db0de;};'use strict';var _=require('lodash');var util=require(_0x56a5('0x0'));var moment=require(_0x56a5('0x1'));var BPromise=require(_0x56a5('0x2'));var rs=require(_0x56a5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x56a5('0x4'));var config=require(_0x56a5('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x56a5('0x6')][_0x56a5('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4d7090,_0x45d394,_0x3cd17c){return new BPromise(function(_0x5ded4c,_0x418e6a){return client['request'](_0x4d7090,_0x3cd17c)[_0x56a5('0x8')](function(_0x467437){logger['info'](_0x56a5('0x9'),_0x45d394,_0x56a5('0xa'));logger[_0x56a5('0xb')](_0x56a5('0xc'),_0x45d394,_0x56a5('0xa'),JSON[_0x56a5('0xd')](_0x467437));if(_0x467437[_0x56a5('0xe')]){if(_0x467437[_0x56a5('0xe')][_0x56a5('0xf')]===0x1f4){logger[_0x56a5('0xe')](_0x56a5('0x9'),_0x45d394,_0x467437[_0x56a5('0xe')][_0x56a5('0x10')]);return _0x418e6a(_0x467437['error']['message']);}logger[_0x56a5('0xe')](_0x56a5('0x9'),_0x45d394,_0x467437['error']['message']);return _0x5ded4c(_0x467437[_0x56a5('0xe')][_0x56a5('0x10')]);}else{logger[_0x56a5('0x11')]('VoiceCallReport,\x20%s,\x20%s',_0x45d394,_0x56a5('0xa'));_0x5ded4c(_0x467437['result']['message']);}})[_0x56a5('0x12')](function(_0x353ff1){logger[_0x56a5('0xe')](_0x56a5('0x9'),_0x45d394,_0x353ff1);_0x418e6a(_0x353ff1);});});}exports[_0x56a5('0x13')]=function(_0x5413ac){var _0x22b355=this;return new Promise(function(_0x244ca7,_0x3410c6){return db[_0x56a5('0x14')]['findAll']({'raw':_0x5413ac[_0x56a5('0x15')]?_0x5413ac[_0x56a5('0x15')][_0x56a5('0x16')]===undefined?!![]:![]:!![],'where':_0x5413ac[_0x56a5('0x15')]?_0x5413ac[_0x56a5('0x15')]['where']||null:null,'attributes':_0x5413ac[_0x56a5('0x15')]?_0x5413ac[_0x56a5('0x15')]['attributes']||null:null,'limit':_0x5413ac[_0x56a5('0x15')]?_0x5413ac[_0x56a5('0x15')][_0x56a5('0x17')]||null:null,'include':_0x5413ac[_0x56a5('0x15')]?_0x5413ac[_0x56a5('0x15')][_0x56a5('0x18')]?_[_0x56a5('0x19')](_0x5413ac[_0x56a5('0x15')]['include'],function(_0x45a8fd){return{'model':db[_0x45a8fd[_0x56a5('0x1a')]],'as':_0x45a8fd['as'],'attributes':_0x45a8fd[_0x56a5('0x1b')],'include':_0x45a8fd['include']?_[_0x56a5('0x19')](_0x45a8fd[_0x56a5('0x18')],function(_0x393f30){return{'model':db[_0x393f30['model']],'as':_0x393f30['as'],'attributes':_0x393f30[_0x56a5('0x1b')],'include':_0x393f30[_0x56a5('0x18')]?_['map'](_0x393f30['include'],function(_0x15e2f2){return{'model':db[_0x15e2f2[_0x56a5('0x1a')]],'as':_0x15e2f2['as'],'attributes':_0x15e2f2[_0x56a5('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x56a5('0x8')](function(_0x7b543d){logger[_0x56a5('0x11')](_0x56a5('0x13'),_0x5413ac);logger['debug'](_0x56a5('0x13'),_0x5413ac,JSON[_0x56a5('0xd')](_0x7b543d));_0x244ca7(_0x7b543d);})[_0x56a5('0x12')](function(_0x321ff2){logger[_0x56a5('0xe')]('GetVoiceCallReport',_0x321ff2[_0x56a5('0x10')],_0x5413ac);_0x3410c6(_0x22b355['error'](0x1f4,_0x321ff2[_0x56a5('0x10')]));});});};exports[_0x56a5('0x1c')]=function(_0x225fed){var _0x50e084=this;return new Promise(function(_0x33af3f,_0x167349){return db[_0x56a5('0x14')]['create'](_0x225fed[_0x56a5('0x1d')],{'raw':_0x225fed[_0x56a5('0x15')]?_0x225fed[_0x56a5('0x15')]['raw']===undefined?!![]:![]:!![]})[_0x56a5('0x8')](function(_0x3d7273){logger[_0x56a5('0x11')](_0x56a5('0x1c'),_0x225fed);logger['debug']('CreateVoiceCallReport',_0x225fed,JSON['stringify'](_0x3d7273));_0x33af3f(_0x3d7273);})['catch'](function(_0x38e50b){logger[_0x56a5('0xe')](_0x56a5('0x1c'),_0x38e50b[_0x56a5('0x10')],_0x225fed);_0x167349(_0x50e084[_0x56a5('0xe')](0x1f4,_0x38e50b['message']));});});};exports[_0x56a5('0x1e')]=function(_0x3f6565){var _0x17f583=this;return new Promise(function(_0x4a4d40,_0x4f828e){return db[_0x56a5('0x14')]['update'](_0x3f6565[_0x56a5('0x1d')],{'raw':_0x3f6565[_0x56a5('0x15')]?_0x3f6565[_0x56a5('0x15')][_0x56a5('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f6565['options']?_0x3f6565[_0x56a5('0x15')][_0x56a5('0x1f')]||null:null,'attributes':_0x3f6565[_0x56a5('0x15')]?_0x3f6565[_0x56a5('0x15')][_0x56a5('0x1b')]||null:null,'limit':_0x3f6565[_0x56a5('0x15')]?_0x3f6565[_0x56a5('0x15')][_0x56a5('0x17')]||null:null})[_0x56a5('0x8')](function(_0x1f01f3){logger[_0x56a5('0x11')](_0x56a5('0x1e'),_0x3f6565);logger[_0x56a5('0xb')]('UpdateVoiceCallReport',_0x3f6565,JSON[_0x56a5('0xd')](_0x1f01f3));_0x4a4d40(_0x1f01f3);})['catch'](function(_0x1cfe59){logger[_0x56a5('0xe')](_0x56a5('0x1e'),_0x1cfe59[_0x56a5('0x10')],_0x3f6565);_0x4f828e(_0x17f583[_0x56a5('0xe')](0x1f4,_0x1cfe59['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index bf59d9a..7fedfac 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 _0xd96f=['get','isAuthenticated','index','/:id','show','create','put','update','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceChanSpy.controller'];(function(_0x455d9c,_0x9490ab){var _0x14f50c=function(_0x16f799){while(--_0x16f799){_0x455d9c['push'](_0x455d9c['shift']());}};_0x14f50c(++_0x9490ab);}(_0xd96f,0x1d9));var _0xfd96=function(_0x515013,_0x331ccc){_0x515013=_0x515013-0x0;var _0x48ba47=_0xd96f[_0x515013];return _0x48ba47;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfd96('0x0'));var timeout=require(_0xfd96('0x1'));var express=require('express');var router=express[_0xfd96('0x2')]();var fs_extra=require(_0xfd96('0x3'));var auth=require(_0xfd96('0x4'));var interaction=require(_0xfd96('0x5'));var config=require('../../config/environment');var controller=require(_0xfd96('0x6'));router[_0xfd96('0x7')]('/',auth[_0xfd96('0x8')](),controller[_0xfd96('0x9')]);router[_0xfd96('0x7')](_0xfd96('0xa'),auth[_0xfd96('0x8')](),controller[_0xfd96('0xb')]);router['post']('/',auth[_0xfd96('0x8')](),controller[_0xfd96('0xc')]);router[_0xfd96('0xd')]('/:id',auth[_0xfd96('0x8')](),controller[_0xfd96('0xe')]);router['delete'](_0xfd96('0xa'),auth[_0xfd96('0x8')](),controller['destroy']);module[_0xfd96('0xf')]=router; \ No newline at end of file +var _0x5a9b=['exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','create','update','delete','destroy'];(function(_0x50bcab,_0x5aa654){var _0x5adb47=function(_0xdd0cf1){while(--_0xdd0cf1){_0x50bcab['push'](_0x50bcab['shift']());}};_0x5adb47(++_0x5aa654);}(_0x5a9b,0x188));var _0xb5a9=function(_0x595b1b,_0x2c4b52){_0x595b1b=_0x595b1b-0x0;var _0x19bdac=_0x5a9b[_0x595b1b];return _0x19bdac;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb5a9('0x0'));var timeout=require(_0xb5a9('0x1'));var express=require(_0xb5a9('0x2'));var router=express['Router']();var fs_extra=require(_0xb5a9('0x3'));var auth=require(_0xb5a9('0x4'));var interaction=require(_0xb5a9('0x5'));var config=require(_0xb5a9('0x6'));var controller=require('./voiceChanSpy.controller');router[_0xb5a9('0x7')]('/',auth[_0xb5a9('0x8')](),controller[_0xb5a9('0x9')]);router[_0xb5a9('0x7')](_0xb5a9('0xa'),auth[_0xb5a9('0x8')](),controller[_0xb5a9('0xb')]);router['post']('/',auth[_0xb5a9('0x8')](),controller[_0xb5a9('0xc')]);router['put'](_0xb5a9('0xa'),auth['isAuthenticated'](),controller[_0xb5a9('0xd')]);router[_0xb5a9('0xe')]('/:id',auth[_0xb5a9('0x8')](),controller[_0xb5a9('0xf')]);module[_0xb5a9('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 81fc6b8..4b5ce3e 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 _0xb964=['setDataValue','options','join','getDataValue','split','BOOLEAN','sequelize','exports','STRING','name'];(function(_0xe3bbea,_0x3ae4d3){var _0x18713d=function(_0x453117){while(--_0x453117){_0xe3bbea['push'](_0xe3bbea['shift']());}};_0x18713d(++_0x3ae4d3);}(_0xb964,0xec));var _0x4b96=function(_0x465858,_0x273fc9){_0x465858=_0x465858-0x0;var _0x42526f=_0xb964[_0x465858];return _0x42526f;};'use strict';var Sequelize=require(_0x4b96('0x0'));module[_0x4b96('0x1')]={'name':{'type':Sequelize[_0x4b96('0x2')]},'prefix':{'type':Sequelize[_0x4b96('0x2')],'unique':_0x4b96('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0x4b96('0x2')],'set':function(_0x162a4e){this[_0x4b96('0x4')](_0x4b96('0x5'),_0x162a4e?_0x162a4e[_0x4b96('0x6')](''):[]);},'get':function(){return this[_0x4b96('0x7')](_0x4b96('0x5'))?this[_0x4b96('0x7')](_0x4b96('0x5'))[_0x4b96('0x8')](''):[];}},'auth':{'type':Sequelize[_0x4b96('0x9')],'defaultValue':![]},'password':{'type':Sequelize[_0x4b96('0x2')]},'record':{'type':Sequelize[_0x4b96('0x9')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x4b96('0x2')]},'description':{'type':Sequelize[_0x4b96('0x2')]}}; \ No newline at end of file +var _0xacdb=['join','getDataValue','options','split','BOOLEAN','exports','STRING','name','setDataValue'];(function(_0x9b7a64,_0x38d4a8){var _0x33fd98=function(_0x15c82b){while(--_0x15c82b){_0x9b7a64['push'](_0x9b7a64['shift']());}};_0x33fd98(++_0x38d4a8);}(_0xacdb,0x101));var _0xbacd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xacdb[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xbacd('0x0')]={'name':{'type':Sequelize[_0xbacd('0x1')]},'prefix':{'type':Sequelize[_0xbacd('0x1')],'unique':_0xbacd('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0xbacd('0x1')],'set':function(_0x3c5f7){this[_0xbacd('0x3')]('options',_0x3c5f7?_0x3c5f7[_0xbacd('0x4')](''):[]);},'get':function(){return this[_0xbacd('0x5')](_0xbacd('0x6'))?this[_0xbacd('0x5')]('options')[_0xbacd('0x7')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0xbacd('0x1')]},'record':{'type':Sequelize[_0xbacd('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xbacd('0x1')]},'description':{'type':Sequelize[_0xbacd('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 21a0a70..13d1223 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 _0xbf1a=['update','get','ChanSpies','UserProfileResource','then','error','name','send','VoiceChanSpy','rawAttributes','fieldName','key','model','map','keys','filters','query','attributes','intersection','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','show','params','find','create','body','user','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','reject','save'];(function(_0x47408e,_0x481428){var _0x1636bc=function(_0x2fe7a6){while(--_0x2fe7a6){_0x47408e['push'](_0x47408e['shift']());}};_0x1636bc(++_0x481428);}(_0xbf1a,0x7c));var _0xabf1=function(_0x40ff03,_0x3a73f2){_0x40ff03=_0x40ff03-0x0;var _0x46b16=_0xbf1a[_0x40ff03];return _0x46b16;};'use strict';var emlformat=require(_0xabf1('0x0'));var rimraf=require(_0xabf1('0x1'));var zipdir=require(_0xabf1('0x2'));var jsonpatch=require(_0xabf1('0x3'));var rp=require(_0xabf1('0x4'));var moment=require('moment');var BPromise=require(_0xabf1('0x5'));var Mustache=require('mustache');var util=require(_0xabf1('0x6'));var path=require(_0xabf1('0x7'));var sox=require(_0xabf1('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xabf1('0x9'));var _=require('lodash');var squel=require(_0xabf1('0xa'));var crypto=require(_0xabf1('0xb'));var jsforce=require(_0xabf1('0xc'));var deskjs=require(_0xabf1('0xd'));var toCsv=require(_0xabf1('0xe'));var querystring=require(_0xabf1('0xf'));var Papa=require('papaparse');var Redis=require(_0xabf1('0x10'));var authService=require(_0xabf1('0x11'));var qs=require(_0xabf1('0x12'));var as=require(_0xabf1('0x13'));var hardwareService=require(_0xabf1('0x14'));var logger=require(_0xabf1('0x15'))('api');var utils=require(_0xabf1('0x16'));var config=require(_0xabf1('0x17'));var licenseUtil=require(_0xabf1('0x18'));var db=require(_0xabf1('0x19'))['db'];function respondWithStatusCode(_0x3e1738,_0x1186b7){_0x1186b7=_0x1186b7||0xcc;return function(_0x27ade4){if(_0x27ade4){return _0x3e1738[_0xabf1('0x1a')](_0x1186b7);}return _0x3e1738[_0xabf1('0x1b')](_0x1186b7)[_0xabf1('0x1c')]();};}function respondWithResult(_0x4cb7f7,_0x783976){_0x783976=_0x783976||0xc8;return function(_0xcbe7da){if(_0xcbe7da){return _0x4cb7f7[_0xabf1('0x1b')](_0x783976)['json'](_0xcbe7da);}};}function respondWithFilteredResult(_0x293110,_0x3dd81a){return function(_0x719d3e){if(_0x719d3e){var _0x3537e4=typeof _0x3dd81a['offset']===_0xabf1('0x1d')&&typeof _0x3dd81a['limit']===_0xabf1('0x1d');var _0x23093b=_0x719d3e[_0xabf1('0x1e')];var _0x363c21=_0x3537e4?0x0:_0x3dd81a[_0xabf1('0x1f')];var _0xd5dc16=_0x3537e4?_0x719d3e[_0xabf1('0x1e')]:_0x3dd81a[_0xabf1('0x1f')]+_0x3dd81a[_0xabf1('0x20')];var _0x18f315;if(_0xd5dc16>=_0x23093b){_0xd5dc16=_0x23093b;_0x18f315=0xc8;}else{_0x18f315=0xce;}_0x293110[_0xabf1('0x1b')](_0x18f315);return _0x293110[_0xabf1('0x21')](_0xabf1('0x22'),_0x363c21+'-'+_0xd5dc16+'/'+_0x23093b)[_0xabf1('0x23')](_0x719d3e);}return null;};}function patchUpdates(_0x367d7e){return function(_0x5a0413){try{jsonpatch['apply'](_0x5a0413,_0x367d7e,!![]);}catch(_0xa715e7){return BPromise[_0xabf1('0x24')](_0xa715e7);}return _0x5a0413[_0xabf1('0x25')]();};}function saveUpdates(_0x53e531,_0x216862){return function(_0x3fbce0){if(_0x3fbce0){return _0x3fbce0[_0xabf1('0x26')](_0x53e531)['then'](function(_0xb16c27){return _0xb16c27;});}return null;};}function removeEntity(_0x57fea6,_0x30fac8){return function(_0x551401){if(_0x551401){return _0x551401['destroy']()['then'](function(){var _0x29d5bf=_0x551401[_0xabf1('0x27')]({'plain':!![]});var _0x4939cd=_0xabf1('0x28');return db[_0xabf1('0x29')]['destroy']({'where':{'type':_0x4939cd,'resourceId':_0x29d5bf['id']}})['then'](function(){return _0x551401;});})[_0xabf1('0x2a')](function(){_0x57fea6[_0xabf1('0x1b')](0xcc)[_0xabf1('0x1c')]();});}};}function handleEntityNotFound(_0x420590,_0x136a1d){return function(_0x555593){if(!_0x555593){_0x420590[_0xabf1('0x1a')](0x194);}return _0x555593;};}function handleError(_0x51cab0,_0x315b40){_0x315b40=_0x315b40||0x1f4;return function(_0x5ddf0d){logger[_0xabf1('0x2b')](_0x5ddf0d['stack']);if(_0x5ddf0d[_0xabf1('0x2c')]){delete _0x5ddf0d[_0xabf1('0x2c')];}_0x51cab0[_0xabf1('0x1b')](_0x315b40)[_0xabf1('0x2d')](_0x5ddf0d);};}exports['index']=function(_0x2e3b6c,_0x45b960){var _0x4d3dd7={},_0xe9a38d={},_0x4d9208={'count':0x0,'rows':[]};var _0x5e3be3=_['map'](db[_0xabf1('0x2e')][_0xabf1('0x2f')],function(_0x1d0f54){return{'name':_0x1d0f54[_0xabf1('0x30')],'type':_0x1d0f54['type'][_0xabf1('0x31')]};});_0xe9a38d[_0xabf1('0x32')]=_[_0xabf1('0x33')](_0x5e3be3,_0xabf1('0x2c'));_0xe9a38d['query']=_[_0xabf1('0x34')](_0x2e3b6c['query']);_0xe9a38d[_0xabf1('0x35')]=_['intersection'](_0xe9a38d['model'],_0xe9a38d[_0xabf1('0x36')]);_0x4d3dd7[_0xabf1('0x37')]=_[_0xabf1('0x38')](_0xe9a38d[_0xabf1('0x32')],qs[_0xabf1('0x39')](_0x2e3b6c[_0xabf1('0x36')][_0xabf1('0x39')]));_0x4d3dd7[_0xabf1('0x37')]=_0x4d3dd7['attributes'][_0xabf1('0x3a')]?_0x4d3dd7[_0xabf1('0x37')]:_0xe9a38d['model'];if(!_0x2e3b6c['query']['hasOwnProperty'](_0xabf1('0x3b'))){_0x4d3dd7['limit']=qs[_0xabf1('0x20')](_0x2e3b6c[_0xabf1('0x36')][_0xabf1('0x20')]);_0x4d3dd7[_0xabf1('0x1f')]=qs['offset'](_0x2e3b6c[_0xabf1('0x36')]['offset']);}_0x4d3dd7[_0xabf1('0x3c')]=qs[_0xabf1('0x3d')](_0x2e3b6c[_0xabf1('0x36')][_0xabf1('0x3d')]);_0x4d3dd7['where']=qs[_0xabf1('0x35')](_[_0xabf1('0x3e')](_0x2e3b6c[_0xabf1('0x36')],_0xe9a38d[_0xabf1('0x35')]),_0x5e3be3);if(_0x2e3b6c[_0xabf1('0x36')][_0xabf1('0x3f')]){_0x4d3dd7[_0xabf1('0x40')]=_[_0xabf1('0x41')](_0x4d3dd7[_0xabf1('0x40')],{'$or':_[_0xabf1('0x33')](_0x5e3be3,function(_0x520916){if(_0x520916['type']!==_0xabf1('0x42')){var _0x7c5288={};_0x7c5288[_0x520916[_0xabf1('0x2c')]]={'$like':'%'+_0x2e3b6c[_0xabf1('0x36')][_0xabf1('0x3f')]+'%'};return _0x7c5288;}})});}_0x4d3dd7=_['merge']({},_0x4d3dd7,_0x2e3b6c[_0xabf1('0x43')]);var _0x4e8ac7={'where':_0x4d3dd7[_0xabf1('0x40')]};return db[_0xabf1('0x2e')][_0xabf1('0x1e')](_0x4e8ac7)[_0xabf1('0x2a')](function(_0x304f52){_0x4d9208[_0xabf1('0x1e')]=_0x304f52;if(_0x2e3b6c['query']['includeAll']){_0x4d3dd7[_0xabf1('0x44')]=[{'all':!![]}];}return db['VoiceChanSpy'][_0xabf1('0x45')](_0x4d3dd7);})[_0xabf1('0x2a')](function(_0x14368a){_0x4d9208[_0xabf1('0x46')]=_0x14368a;return _0x4d9208;})[_0xabf1('0x2a')](respondWithFilteredResult(_0x45b960,_0x4d3dd7))['catch'](handleError(_0x45b960,null));};exports[_0xabf1('0x47')]=function(_0x4375c2,_0x529308){var _0x379d8a={'raw':![],'where':{'id':_0x4375c2[_0xabf1('0x48')]['id']}},_0x3f969e={};_0x3f969e[_0xabf1('0x32')]=_['keys'](db[_0xabf1('0x2e')]['rawAttributes']);_0x3f969e[_0xabf1('0x36')]=_[_0xabf1('0x34')](_0x4375c2[_0xabf1('0x36')]);_0x3f969e['filters']=_[_0xabf1('0x38')](_0x3f969e[_0xabf1('0x32')],_0x3f969e['query']);_0x379d8a['attributes']=_[_0xabf1('0x38')](_0x3f969e[_0xabf1('0x32')],qs[_0xabf1('0x39')](_0x4375c2['query']['fields']));_0x379d8a['attributes']=_0x379d8a[_0xabf1('0x37')][_0xabf1('0x3a')]?_0x379d8a[_0xabf1('0x37')]:_0x3f969e[_0xabf1('0x32')];if(_0x4375c2['query']['includeAll']){_0x379d8a[_0xabf1('0x44')]=[{'all':!![]}];}_0x379d8a=_[_0xabf1('0x41')]({},_0x379d8a,_0x4375c2[_0xabf1('0x43')]);return db['VoiceChanSpy'][_0xabf1('0x49')](_0x379d8a)[_0xabf1('0x2a')](handleEntityNotFound(_0x529308,null))['then'](respondWithResult(_0x529308,null))['catch'](handleError(_0x529308,null));};exports['create']=function(_0x5b12e9,_0x4771b5){return db[_0xabf1('0x2e')][_0xabf1('0x4a')](_0x5b12e9[_0xabf1('0x4b')],{})[_0xabf1('0x2a')](function(_0x4677a9){var _0x2346cb=_0x5b12e9[_0xabf1('0x4c')][_0xabf1('0x27')]({'plain':!![]});if(!_0x2346cb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2346cb['role']==='user'){var _0x5d0859=_0x4677a9[_0xabf1('0x27')]({'plain':!![]});var _0x565122=_0xabf1('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x565122,'userProfileId':_0x2346cb['userProfileId']},'raw':!![]})['then'](function(_0x439c33){if(_0x439c33&&_0x439c33[_0xabf1('0x4d')]===0x0){return db[_0xabf1('0x29')][_0xabf1('0x4a')]({'name':_0x5d0859['name'],'resourceId':_0x5d0859['id'],'type':_0x439c33[_0xabf1('0x2c')],'sectionId':_0x439c33['id']},{})[_0xabf1('0x2a')](function(){return _0x4677a9;});}else{return _0x4677a9;}})[_0xabf1('0x4e')](function(_0x40210b){logger[_0xabf1('0x2b')](_0xabf1('0x4f'),_0x40210b);throw _0x40210b;});}return _0x4677a9;})[_0xabf1('0x2a')](respondWithResult(_0x4771b5,0xc9))['catch'](handleError(_0x4771b5,null));};exports[_0xabf1('0x26')]=function(_0x192d92,_0x1f1219){if(_0x192d92['body']['id']){delete _0x192d92['body']['id'];}return db[_0xabf1('0x2e')][_0xabf1('0x49')]({'where':{'id':_0x192d92['params']['id']}})['then'](handleEntityNotFound(_0x1f1219,null))[_0xabf1('0x2a')](saveUpdates(_0x192d92[_0xabf1('0x4b')],null))[_0xabf1('0x2a')](respondWithResult(_0x1f1219,null))[_0xabf1('0x4e')](handleError(_0x1f1219,null));};exports[_0xabf1('0x50')]=function(_0xf0bf7d,_0xbac2c9){return db[_0xabf1('0x2e')]['find']({'where':{'id':_0xf0bf7d['params']['id']}})['then'](handleEntityNotFound(_0xbac2c9,null))['then'](removeEntity(_0xbac2c9,null))[_0xabf1('0x4e')](handleError(_0xbac2c9,null));}; \ No newline at end of file +var _0x6282=['intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChanSpies','UserProfileSection','userProfileId','UserProfileResource','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','end','status','offset','undefined','count','limit','json','apply','reject','save','update','then','destroy','get','sendStatus','name','send','map','VoiceChanSpy','rawAttributes','fieldName','type','key','model','query','keys'];(function(_0x58a51f,_0x46f355){var _0x7663a2=function(_0x296c67){while(--_0x296c67){_0x58a51f['push'](_0x58a51f['shift']());}};_0x7663a2(++_0x46f355);}(_0x6282,0x76));var _0x2628=function(_0x47bc60,_0xd72b8c){_0x47bc60=_0x47bc60-0x0;var _0x3949ea=_0x6282[_0x47bc60];return _0x3949ea;};'use strict';var emlformat=require(_0x2628('0x0'));var rimraf=require(_0x2628('0x1'));var zipdir=require(_0x2628('0x2'));var jsonpatch=require(_0x2628('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2628('0x4'));var Mustache=require(_0x2628('0x5'));var util=require('util');var path=require(_0x2628('0x6'));var sox=require(_0x2628('0x7'));var csv=require(_0x2628('0x8'));var ejs=require(_0x2628('0x9'));var fs=require('fs');var fs_extra=require(_0x2628('0xa'));var _=require('lodash');var squel=require(_0x2628('0xb'));var crypto=require(_0x2628('0xc'));var jsforce=require(_0x2628('0xd'));var deskjs=require(_0x2628('0xe'));var toCsv=require(_0x2628('0x8'));var querystring=require(_0x2628('0xf'));var Papa=require(_0x2628('0x10'));var Redis=require(_0x2628('0x11'));var authService=require(_0x2628('0x12'));var qs=require(_0x2628('0x13'));var as=require(_0x2628('0x14'));var hardwareService=require(_0x2628('0x15'));var logger=require(_0x2628('0x16'))(_0x2628('0x17'));var utils=require(_0x2628('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2628('0x19'))['db'];function respondWithStatusCode(_0x123b61,_0x340152){_0x340152=_0x340152||0xcc;return function(_0x3440a0){if(_0x3440a0){return _0x123b61['sendStatus'](_0x340152);}return _0x123b61['status'](_0x340152)[_0x2628('0x1a')]();};}function respondWithResult(_0x465a6f,_0x4d2cfb){_0x4d2cfb=_0x4d2cfb||0xc8;return function(_0x2395fe){if(_0x2395fe){return _0x465a6f[_0x2628('0x1b')](_0x4d2cfb)['json'](_0x2395fe);}};}function respondWithFilteredResult(_0x645884,_0x16e67a){return function(_0x457163){if(_0x457163){var _0x4f418d=typeof _0x16e67a[_0x2628('0x1c')]===_0x2628('0x1d')&&typeof _0x16e67a['limit']===_0x2628('0x1d');var _0x4c2a10=_0x457163[_0x2628('0x1e')];var _0x374501=_0x4f418d?0x0:_0x16e67a['offset'];var _0x2a6bed=_0x4f418d?_0x457163[_0x2628('0x1e')]:_0x16e67a['offset']+_0x16e67a[_0x2628('0x1f')];var _0x532d6d;if(_0x2a6bed>=_0x4c2a10){_0x2a6bed=_0x4c2a10;_0x532d6d=0xc8;}else{_0x532d6d=0xce;}_0x645884[_0x2628('0x1b')](_0x532d6d);return _0x645884['set']('Content-Range',_0x374501+'-'+_0x2a6bed+'/'+_0x4c2a10)[_0x2628('0x20')](_0x457163);}return null;};}function patchUpdates(_0xd4cec){return function(_0x31c1e6){try{jsonpatch[_0x2628('0x21')](_0x31c1e6,_0xd4cec,!![]);}catch(_0x1640b2){return BPromise[_0x2628('0x22')](_0x1640b2);}return _0x31c1e6[_0x2628('0x23')]();};}function saveUpdates(_0x41c2ba,_0x1746fe){return function(_0x57a799){if(_0x57a799){return _0x57a799[_0x2628('0x24')](_0x41c2ba)[_0x2628('0x25')](function(_0x91e79c){return _0x91e79c;});}return null;};}function removeEntity(_0x3904cb,_0x1abc7e){return function(_0x4bae60){if(_0x4bae60){return _0x4bae60[_0x2628('0x26')]()[_0x2628('0x25')](function(){var _0xa1ec75=_0x4bae60[_0x2628('0x27')]({'plain':!![]});var _0x6070fd='ChanSpies';return db['UserProfileResource'][_0x2628('0x26')]({'where':{'type':_0x6070fd,'resourceId':_0xa1ec75['id']}})[_0x2628('0x25')](function(){return _0x4bae60;});})[_0x2628('0x25')](function(){_0x3904cb[_0x2628('0x1b')](0xcc)[_0x2628('0x1a')]();});}};}function handleEntityNotFound(_0x571711,_0x433265){return function(_0x6146b0){if(!_0x6146b0){_0x571711[_0x2628('0x28')](0x194);}return _0x6146b0;};}function handleError(_0x1df2d8,_0x2c27fe){_0x2c27fe=_0x2c27fe||0x1f4;return function(_0x118e75){logger['error'](_0x118e75['stack']);if(_0x118e75[_0x2628('0x29')]){delete _0x118e75[_0x2628('0x29')];}_0x1df2d8[_0x2628('0x1b')](_0x2c27fe)[_0x2628('0x2a')](_0x118e75);};}exports['index']=function(_0x17bc01,_0x292e24){var _0x1174cd={},_0x32e089={},_0x4b5938={'count':0x0,'rows':[]};var _0x2a9cf0=_[_0x2628('0x2b')](db[_0x2628('0x2c')][_0x2628('0x2d')],function(_0x515f29){return{'name':_0x515f29[_0x2628('0x2e')],'type':_0x515f29[_0x2628('0x2f')][_0x2628('0x30')]};});_0x32e089[_0x2628('0x31')]=_[_0x2628('0x2b')](_0x2a9cf0,_0x2628('0x29'));_0x32e089[_0x2628('0x32')]=_[_0x2628('0x33')](_0x17bc01[_0x2628('0x32')]);_0x32e089['filters']=_[_0x2628('0x34')](_0x32e089[_0x2628('0x31')],_0x32e089[_0x2628('0x32')]);_0x1174cd[_0x2628('0x35')]=_[_0x2628('0x34')](_0x32e089['model'],qs['fields'](_0x17bc01[_0x2628('0x32')][_0x2628('0x36')]));_0x1174cd[_0x2628('0x35')]=_0x1174cd['attributes'][_0x2628('0x37')]?_0x1174cd[_0x2628('0x35')]:_0x32e089[_0x2628('0x31')];if(!_0x17bc01['query'][_0x2628('0x38')](_0x2628('0x39'))){_0x1174cd[_0x2628('0x1f')]=qs['limit'](_0x17bc01['query']['limit']);_0x1174cd['offset']=qs[_0x2628('0x1c')](_0x17bc01[_0x2628('0x32')][_0x2628('0x1c')]);}_0x1174cd['order']=qs[_0x2628('0x3a')](_0x17bc01[_0x2628('0x32')][_0x2628('0x3a')]);_0x1174cd['where']=qs[_0x2628('0x3b')](_[_0x2628('0x3c')](_0x17bc01[_0x2628('0x32')],_0x32e089[_0x2628('0x3b')]),_0x2a9cf0);if(_0x17bc01[_0x2628('0x32')][_0x2628('0x3d')]){_0x1174cd[_0x2628('0x3e')]=_['merge'](_0x1174cd[_0x2628('0x3e')],{'$or':_[_0x2628('0x2b')](_0x2a9cf0,function(_0x3e6467){if(_0x3e6467[_0x2628('0x2f')]!==_0x2628('0x3f')){var _0x2bc23f={};_0x2bc23f[_0x3e6467['name']]={'$like':'%'+_0x17bc01[_0x2628('0x32')]['filter']+'%'};return _0x2bc23f;}})});}_0x1174cd=_[_0x2628('0x40')]({},_0x1174cd,_0x17bc01[_0x2628('0x41')]);var _0x3a88f9={'where':_0x1174cd[_0x2628('0x3e')]};return db[_0x2628('0x2c')]['count'](_0x3a88f9)[_0x2628('0x25')](function(_0x5caec7){_0x4b5938['count']=_0x5caec7;if(_0x17bc01[_0x2628('0x32')][_0x2628('0x42')]){_0x1174cd[_0x2628('0x43')]=[{'all':!![]}];}return db[_0x2628('0x2c')][_0x2628('0x44')](_0x1174cd);})['then'](function(_0x116ffb){_0x4b5938[_0x2628('0x45')]=_0x116ffb;return _0x4b5938;})[_0x2628('0x25')](respondWithFilteredResult(_0x292e24,_0x1174cd))[_0x2628('0x46')](handleError(_0x292e24,null));};exports[_0x2628('0x47')]=function(_0x549701,_0x4665e8){var _0x4aa420={'raw':![],'where':{'id':_0x549701[_0x2628('0x48')]['id']}},_0x39b67d={};_0x39b67d[_0x2628('0x31')]=_[_0x2628('0x33')](db['VoiceChanSpy']['rawAttributes']);_0x39b67d[_0x2628('0x32')]=_[_0x2628('0x33')](_0x549701['query']);_0x39b67d[_0x2628('0x3b')]=_[_0x2628('0x34')](_0x39b67d[_0x2628('0x31')],_0x39b67d[_0x2628('0x32')]);_0x4aa420['attributes']=_[_0x2628('0x34')](_0x39b67d[_0x2628('0x31')],qs[_0x2628('0x36')](_0x549701[_0x2628('0x32')][_0x2628('0x36')]));_0x4aa420[_0x2628('0x35')]=_0x4aa420[_0x2628('0x35')][_0x2628('0x37')]?_0x4aa420['attributes']:_0x39b67d[_0x2628('0x31')];if(_0x549701['query'][_0x2628('0x42')]){_0x4aa420['include']=[{'all':!![]}];}_0x4aa420=_[_0x2628('0x40')]({},_0x4aa420,_0x549701[_0x2628('0x41')]);return db[_0x2628('0x2c')][_0x2628('0x49')](_0x4aa420)[_0x2628('0x25')](handleEntityNotFound(_0x4665e8,null))['then'](respondWithResult(_0x4665e8,null))[_0x2628('0x46')](handleError(_0x4665e8,null));};exports['create']=function(_0x2cb756,_0x3a7bd7){return db[_0x2628('0x2c')]['create'](_0x2cb756[_0x2628('0x4a')],{})[_0x2628('0x25')](function(_0x547268){var _0x199721=_0x2cb756[_0x2628('0x4b')][_0x2628('0x27')]({'plain':!![]});if(!_0x199721)throw new Error(_0x2628('0x4c'));if(_0x199721[_0x2628('0x4d')]==='user'){var _0x405e07=_0x547268['get']({'plain':!![]});var _0x307ab6=_0x2628('0x4e');return db[_0x2628('0x4f')][_0x2628('0x49')]({'where':{'name':_0x307ab6,'userProfileId':_0x199721[_0x2628('0x50')]},'raw':!![]})[_0x2628('0x25')](function(_0x3a3528){if(_0x3a3528&&_0x3a3528['autoAssociation']===0x0){return db[_0x2628('0x51')][_0x2628('0x52')]({'name':_0x405e07[_0x2628('0x29')],'resourceId':_0x405e07['id'],'type':_0x3a3528[_0x2628('0x29')],'sectionId':_0x3a3528['id']},{})[_0x2628('0x25')](function(){return _0x547268;});}else{return _0x547268;}})[_0x2628('0x46')](function(_0x1aa06a){logger[_0x2628('0x53')](_0x2628('0x54'),_0x1aa06a);throw _0x1aa06a;});}return _0x547268;})['then'](respondWithResult(_0x3a7bd7,0xc9))['catch'](handleError(_0x3a7bd7,null));};exports[_0x2628('0x24')]=function(_0x95a61a,_0x13d49c){if(_0x95a61a[_0x2628('0x4a')]['id']){delete _0x95a61a[_0x2628('0x4a')]['id'];}return db['VoiceChanSpy']['find']({'where':{'id':_0x95a61a[_0x2628('0x48')]['id']}})['then'](handleEntityNotFound(_0x13d49c,null))[_0x2628('0x25')](saveUpdates(_0x95a61a[_0x2628('0x4a')],null))[_0x2628('0x25')](respondWithResult(_0x13d49c,null))[_0x2628('0x46')](handleError(_0x13d49c,null));};exports[_0x2628('0x26')]=function(_0x2e677,_0x158831){return db[_0x2628('0x2c')][_0x2628('0x49')]({'where':{'id':_0x2e677[_0x2628('0x48')]['id']}})[_0x2628('0x25')](handleEntityNotFound(_0x158831,null))[_0x2628('0x25')](removeEntity(_0x158831,null))[_0x2628('0x46')](handleError(_0x158831,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index bbf2440..e5387d2 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 _0x613d=['merge','Set','CDR(type)=%s','chanspy','record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','length','concat','internal','User','findAll','agent','catch','models','define','VoiceChanSpy','voice_chanspy','then','VoiceExtension','bulkCreate','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','system','push'];(function(_0x117276,_0x2c725e){var _0x51b05f=function(_0x3c933c){while(--_0x3c933c){_0x117276['push'](_0x117276['shift']());}};_0x51b05f(++_0x2c725e);}(_0x613d,0x76));var _0xd613=function(_0xb12603,_0x142505){_0xb12603=_0xb12603-0x0;var _0x2bdc24=_0x613d[_0xb12603];return _0x2bdc24;};'use strict';var _=require(_0xd613('0x0'));var util=require(_0xd613('0x1'));var BPromise=require(_0xd613('0x2'));var attributes=require(_0xd613('0x3'));var getUserApplications=function(_0x3c43db,_0x221a64,_0x3f7375){var _0x210133=0x1;var _0x15eb3f=[];var _0x1c7af2={'context':_0x221a64[_0xd613('0x4')]||_0xd613('0x5'),'exten':util[_0xd613('0x6')](_0xd613('0x7'),_0x3c43db[_0xd613('0x8')],_0x3f7375),'type':_0xd613('0x9'),'isApp':![],'ChanSpyId':_0x3c43db['id'],'UserId':_0x221a64['id']};_0x15eb3f[_0xd613('0xa')](_[_0xd613('0xb')]({'app':_0xd613('0xc'),'appdata':util[_0xd613('0x6')](_0xd613('0xd'),_0xd613('0xe')),'priority':_0x210133++},_0x1c7af2));if(_0x3c43db[_0xd613('0xf')]){_0x15eb3f[_0xd613('0xa')](_[_0xd613('0xb')]({'app':_0xd613('0x10'),'appdata':util[_0xd613('0x6')](_0xd613('0x11'),_0x3c43db[_0xd613('0x12')]),'priority':_0x210133++},_0x1c7af2));}if(_0x3c43db[_0xd613('0x13')]){_0x15eb3f['push'](_[_0xd613('0xb')]({'app':_0xd613('0x14'),'appdata':_0x3c43db[_0xd613('0x15')],'priority':_0x210133++},_0x1c7af2));}_0x15eb3f[_0xd613('0xa')](_['merge']({'app':_0xd613('0x16'),'appdata':util[_0xd613('0x6')](_0xd613('0x17'),_0x221a64[_0xd613('0x18')],_0x3c43db['options']?_0x3c43db[_0xd613('0x19')][_0xd613('0x1a')](''):''),'priority':_0x210133++},_0x1c7af2));if(_0x3c43db[_0xd613('0xf')]){_0x15eb3f[_0xd613('0xa')](_[_0xd613('0xb')]({'app':_0xd613('0x1b'),'priority':_0x210133++},_0x1c7af2));}return _0x15eb3f;};var getChanSpyApplications=function(_0x5942a6,_0x3470ad){var _0x5cdd77=[];for(var _0x4ca388=0x0,_0x4112e6=0x1;_0x4ca388<_0x3470ad[_0xd613('0x1c')];_0x4ca388++,_0x4112e6=0x1){_0x5cdd77=_0x5cdd77[_0xd613('0x1d')](getUserApplications(_0x5942a6,_0x3470ad[_0x4ca388],_0x3470ad[_0x4ca388][_0xd613('0x1e')]));if(_0x3470ad[_0x4ca388]['internal']!=_0x3470ad[_0x4ca388][_0xd613('0x18')]){_0x5cdd77=_0x5cdd77['concat'](getUserApplications(_0x5942a6,_0x3470ad[_0x4ca388],_0x3470ad[_0x4ca388][_0xd613('0x18')]));}}return _0x5cdd77;};var getChanSpyPromise=function(_0x41dfe8,_0x11fb41){return new BPromise(function(_0x5248a9,_0x18fe6e){return _0x41dfe8[_0xd613('0x1f')][_0xd613('0x20')]({'attributes':['id','name',_0xd613('0x1e')],'where':{'role':_0xd613('0x21'),'chanspy':!![]},'raw':!![]})['then'](function(_0x988d66){if(_0x988d66){return _0x5248a9(getChanSpyApplications(_0x11fb41,_0x988d66));}return _0x5248a9([]);})[_0xd613('0x22')](function(_0x55f8fb){_0x18fe6e(_0x55f8fb);});});};module['exports']=function(_0x3fed93,_0x55083a){var _0x3394c3=_0x3fed93[_0xd613('0x23')];return _0x3fed93[_0xd613('0x24')](_0xd613('0x25'),attributes,{'tableName':_0xd613('0x26'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4eda8b,_0x31f0d6,_0x1de304){return getChanSpyPromise(_0x3394c3,_0x4eda8b)[_0xd613('0x27')](function(_0x844827){if(_0x844827&&_0x844827[_0xd613('0x1c')]){return _0x3394c3[_0xd613('0x28')][_0xd613('0x29')](_0x844827);}})[_0xd613('0x27')](function(){_0x1de304();})['catch'](function(_0xe13e31){_0x1de304(_0xe13e31);});},'afterUpdate':function(_0x527140,_0x3288dc,_0x418b50){return _0x3394c3[_0xd613('0x28')][_0xd613('0x2a')]({'where':{'ChanSpyId':_0x527140['id']}})[_0xd613('0x27')](function(){return getChanSpyPromise(_0x3394c3,_0x527140);})[_0xd613('0x27')](function(_0x1bd8d2){if(_0x1bd8d2&&_0x1bd8d2[_0xd613('0x1c')]){return _0x3394c3['VoiceExtension'][_0xd613('0x29')](_0x1bd8d2);}})[_0xd613('0x27')](function(){_0x418b50();})[_0xd613('0x22')](function(_0x13c7c6){_0x418b50(_0x13c7c6);});},'afterDestroy':function(_0x44753e,_0x4ec84a,_0x22f0a8){return _0x3394c3[_0xd613('0x28')][_0xd613('0x2a')]({'where':{'ChanSpyId':_0x44753e['id']}})[_0xd613('0x27')](function(){_0x22f0a8();})['catch'](function(_0x2dcfb1){_0x22f0a8(_0x2dcfb1);});}}});}; \ No newline at end of file +var _0x7ce8=['define','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','destroy','lodash','bluebird','from-sip','format','%s%s','prefix','system','push','merge','Set','CDR(type)=%s','chanspy','record','${UNIQUEID}.%s,a','Authenticate','ChanSpy','SIP/%s,%s','name','options','StopMixMonitor','length','concat','internal','User','findAll','agent','then','catch','models'];(function(_0x61df2c,_0x14e454){var _0x4e97c3=function(_0x196808){while(--_0x196808){_0x61df2c['push'](_0x61df2c['shift']());}};_0x4e97c3(++_0x14e454);}(_0x7ce8,0x164));var _0x87ce=function(_0x326e79,_0x33dc91){_0x326e79=_0x326e79-0x0;var _0x37eb89=_0x7ce8[_0x326e79];return _0x37eb89;};'use strict';var _=require(_0x87ce('0x0'));var util=require('util');var BPromise=require(_0x87ce('0x1'));var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x38b51f,_0x2b113a,_0x5baa34){var _0x392ef9=0x1;var _0x4cdb75=[];var _0x4cfd8f={'context':_0x2b113a['context']||_0x87ce('0x2'),'exten':util[_0x87ce('0x3')](_0x87ce('0x4'),_0x38b51f[_0x87ce('0x5')],_0x5baa34),'type':_0x87ce('0x6'),'isApp':![],'ChanSpyId':_0x38b51f['id'],'UserId':_0x2b113a['id']};_0x4cdb75[_0x87ce('0x7')](_[_0x87ce('0x8')]({'app':_0x87ce('0x9'),'appdata':util[_0x87ce('0x3')](_0x87ce('0xa'),_0x87ce('0xb')),'priority':_0x392ef9++},_0x4cfd8f));if(_0x38b51f[_0x87ce('0xc')]){_0x4cdb75[_0x87ce('0x7')](_[_0x87ce('0x8')]({'app':'MixMonitor','appdata':util[_0x87ce('0x3')](_0x87ce('0xd'),_0x38b51f['recordingFormat']),'priority':_0x392ef9++},_0x4cfd8f));}if(_0x38b51f['auth']){_0x4cdb75[_0x87ce('0x7')](_[_0x87ce('0x8')]({'app':_0x87ce('0xe'),'appdata':_0x38b51f['password'],'priority':_0x392ef9++},_0x4cfd8f));}_0x4cdb75[_0x87ce('0x7')](_['merge']({'app':_0x87ce('0xf'),'appdata':util[_0x87ce('0x3')](_0x87ce('0x10'),_0x2b113a[_0x87ce('0x11')],_0x38b51f[_0x87ce('0x12')]?_0x38b51f['options']['join'](''):''),'priority':_0x392ef9++},_0x4cfd8f));if(_0x38b51f['record']){_0x4cdb75[_0x87ce('0x7')](_['merge']({'app':_0x87ce('0x13'),'priority':_0x392ef9++},_0x4cfd8f));}return _0x4cdb75;};var getChanSpyApplications=function(_0x6ac170,_0x4901cc){var _0x2f3cc1=[];for(var _0x200769=0x0,_0xc15f45=0x1;_0x200769<_0x4901cc[_0x87ce('0x14')];_0x200769++,_0xc15f45=0x1){_0x2f3cc1=_0x2f3cc1[_0x87ce('0x15')](getUserApplications(_0x6ac170,_0x4901cc[_0x200769],_0x4901cc[_0x200769][_0x87ce('0x16')]));if(_0x4901cc[_0x200769][_0x87ce('0x16')]!=_0x4901cc[_0x200769][_0x87ce('0x11')]){_0x2f3cc1=_0x2f3cc1[_0x87ce('0x15')](getUserApplications(_0x6ac170,_0x4901cc[_0x200769],_0x4901cc[_0x200769][_0x87ce('0x11')]));}}return _0x2f3cc1;};var getChanSpyPromise=function(_0x5d6c5c,_0x2a5610){return new BPromise(function(_0x101c38,_0xb47c7f){return _0x5d6c5c[_0x87ce('0x17')][_0x87ce('0x18')]({'attributes':['id',_0x87ce('0x11'),_0x87ce('0x16')],'where':{'role':_0x87ce('0x19'),'chanspy':!![]},'raw':!![]})[_0x87ce('0x1a')](function(_0x2103fd){if(_0x2103fd){return _0x101c38(getChanSpyApplications(_0x2a5610,_0x2103fd));}return _0x101c38([]);})[_0x87ce('0x1b')](function(_0x1b3423){_0xb47c7f(_0x1b3423);});});};module['exports']=function(_0x2dfabe,_0x1ca69f){var _0x1af03c=_0x2dfabe[_0x87ce('0x1c')];return _0x2dfabe[_0x87ce('0x1d')](_0x87ce('0x1e'),attributes,{'tableName':_0x87ce('0x1f'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3fc2d8,_0x188e0c,_0x16036e){return getChanSpyPromise(_0x1af03c,_0x3fc2d8)[_0x87ce('0x1a')](function(_0x25e327){if(_0x25e327&&_0x25e327['length']){return _0x1af03c[_0x87ce('0x20')][_0x87ce('0x21')](_0x25e327);}})[_0x87ce('0x1a')](function(){_0x16036e();})[_0x87ce('0x1b')](function(_0x53b642){_0x16036e(_0x53b642);});},'afterUpdate':function(_0xd718fb,_0x513209,_0x2b088a){return _0x1af03c[_0x87ce('0x20')][_0x87ce('0x22')]({'where':{'ChanSpyId':_0xd718fb['id']}})[_0x87ce('0x1a')](function(){return getChanSpyPromise(_0x1af03c,_0xd718fb);})[_0x87ce('0x1a')](function(_0x479ee1){if(_0x479ee1&&_0x479ee1[_0x87ce('0x14')]){return _0x1af03c['VoiceExtension']['bulkCreate'](_0x479ee1);}})['then'](function(){_0x2b088a();})[_0x87ce('0x1b')](function(_0x4ab878){_0x2b088a(_0x4ab878);});},'afterDestroy':function(_0x4884fc,_0x499a7c,_0x325203){return _0x1af03c['VoiceExtension']['destroy']({'where':{'ChanSpyId':_0x4884fc['id']}})[_0x87ce('0x1a')](function(){_0x325203();})[_0x87ce('0x1b')](function(_0x26f1c2){_0x325203(_0x26f1c2);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 6e9ce23..3f243d3 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 _0x91a7=['message','VoiceChanSpy,\x20%s,\x20%s','catch','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','stringify','error','code'];(function(_0x298bb1,_0x1f5213){var _0x477643=function(_0x3c30ef){while(--_0x3c30ef){_0x298bb1['push'](_0x298bb1['shift']());}};_0x477643(++_0x1f5213);}(_0x91a7,0xe7));var _0x791a=function(_0x184c04,_0x3579ff){_0x184c04=_0x184c04-0x0;var _0x2a91d6=_0x91a7[_0x184c04];return _0x2a91d6;};'use strict';var _=require('lodash');var util=require(_0x791a('0x0'));var moment=require(_0x791a('0x1'));var BPromise=require(_0x791a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x791a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x791a('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x791a('0x5'));var jayson=require(_0x791a('0x6'));var client=jayson['client'][_0x791a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5db6db,_0x33baac,_0x159e24){return new BPromise(function(_0x5aa10a,_0x1a32b4){return client[_0x791a('0x8')](_0x5db6db,_0x159e24)[_0x791a('0x9')](function(_0x80ff65){logger[_0x791a('0xa')]('VoiceChanSpy,\x20%s,\x20%s',_0x33baac,_0x791a('0xb'));logger[_0x791a('0xc')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x33baac,_0x791a('0xb'),JSON[_0x791a('0xd')](_0x80ff65));if(_0x80ff65[_0x791a('0xe')]){if(_0x80ff65[_0x791a('0xe')][_0x791a('0xf')]===0x1f4){logger[_0x791a('0xe')]('VoiceChanSpy,\x20%s,\x20%s',_0x33baac,_0x80ff65['error'][_0x791a('0x10')]);return _0x1a32b4(_0x80ff65[_0x791a('0xe')]['message']);}logger[_0x791a('0xe')](_0x791a('0x11'),_0x33baac,_0x80ff65['error'][_0x791a('0x10')]);return _0x5aa10a(_0x80ff65[_0x791a('0xe')][_0x791a('0x10')]);}else{logger[_0x791a('0xa')]('VoiceChanSpy,\x20%s,\x20%s',_0x33baac,_0x791a('0xb'));_0x5aa10a(_0x80ff65['result'][_0x791a('0x10')]);}})[_0x791a('0x12')](function(_0x49ae3e){logger[_0x791a('0xe')]('VoiceChanSpy,\x20%s,\x20%s',_0x33baac,_0x49ae3e);_0x1a32b4(_0x49ae3e);});});} \ No newline at end of file +var _0x5eb1=['../../config/environment','jayson/promise','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x5eb1,0x7c));var _0x15eb=function(_0x1d5714,_0x2fa5f4){_0x1d5714=_0x1d5714-0x0;var _0x1b620e=_0x5eb1[_0x1d5714];return _0x1b620e;};'use strict';var _=require('lodash');var util=require(_0x15eb('0x0'));var moment=require(_0x15eb('0x1'));var BPromise=require(_0x15eb('0x2'));var rs=require(_0x15eb('0x3'));var fs=require('fs');var Redis=require(_0x15eb('0x4'));var db=require(_0x15eb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x15eb('0x6'))(_0x15eb('0x7'));var config=require(_0x15eb('0x8'));var jayson=require(_0x15eb('0x9'));var client=jayson['client'][_0x15eb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x212692,_0x594f54,_0xe4d8ce){return new BPromise(function(_0x160879,_0x730b12){return client[_0x15eb('0xb')](_0x212692,_0xe4d8ce)[_0x15eb('0xc')](function(_0x2ad2c1){logger[_0x15eb('0xd')](_0x15eb('0xe'),_0x594f54,_0x15eb('0xf'));logger[_0x15eb('0x10')](_0x15eb('0x11'),_0x594f54,_0x15eb('0xf'),JSON[_0x15eb('0x12')](_0x2ad2c1));if(_0x2ad2c1['error']){if(_0x2ad2c1[_0x15eb('0x13')]['code']===0x1f4){logger['error']('VoiceChanSpy,\x20%s,\x20%s',_0x594f54,_0x2ad2c1[_0x15eb('0x13')][_0x15eb('0x14')]);return _0x730b12(_0x2ad2c1[_0x15eb('0x13')][_0x15eb('0x14')]);}logger['error'](_0x15eb('0xe'),_0x594f54,_0x2ad2c1[_0x15eb('0x13')][_0x15eb('0x14')]);return _0x160879(_0x2ad2c1[_0x15eb('0x13')]['message']);}else{logger['info']('VoiceChanSpy,\x20%s,\x20%s',_0x594f54,'request\x20sent');_0x160879(_0x2ad2c1[_0x15eb('0x15')]['message']);}})['catch'](function(_0x3a78e9){logger['error'](_0x15eb('0xe'),_0x594f54,_0x3a78e9);_0x730b12(_0x3a78e9);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index dc6fe43..ca9ca8b 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 _0x4952=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','isAuthenticated','index','/:id','create','update','delete','destroy','exports'];(function(_0x327040,_0x6f7206){var _0x201070=function(_0x33f64d){while(--_0x33f64d){_0x327040['push'](_0x327040['shift']());}};_0x201070(++_0x6f7206);}(_0x4952,0x187));var _0x2495=function(_0x4d40dd,_0x39592b){_0x4d40dd=_0x4d40dd-0x0;var _0x1c51f2=_0x4952[_0x4d40dd];return _0x1c51f2;};'use strict';var multer=require('multer');var util=require(_0x2495('0x0'));var path=require(_0x2495('0x1'));var timeout=require(_0x2495('0x2'));var express=require(_0x2495('0x3'));var router=express[_0x2495('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2495('0x5'));var interaction=require(_0x2495('0x6'));var config=require(_0x2495('0x7'));var controller=require(_0x2495('0x8'));router['get']('/',auth[_0x2495('0x9')](),controller[_0x2495('0xa')]);router['get'](_0x2495('0xb'),auth[_0x2495('0x9')](),controller['show']);router['post']('/',auth[_0x2495('0x9')](),controller[_0x2495('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x2495('0xd')]);router[_0x2495('0xe')](_0x2495('0xb'),auth[_0x2495('0x9')](),controller[_0x2495('0xf')]);module[_0x2495('0x10')]=router; \ No newline at end of file +var _0x95d9=['util','connect-timeout','express','Router','../../components/interaction/service','get','isAuthenticated','index','/:id','show','put','update','destroy','multer'];(function(_0x56138f,_0x1e9ebb){var _0x1acaf7=function(_0x48690d){while(--_0x48690d){_0x56138f['push'](_0x56138f['shift']());}};_0x1acaf7(++_0x1e9ebb);}(_0x95d9,0x1e9));var _0x995d=function(_0x34843e,_0x4c4224){_0x34843e=_0x34843e-0x0;var _0x598f7f=_0x95d9[_0x34843e];return _0x598f7f;};'use strict';var multer=require(_0x995d('0x0'));var util=require(_0x995d('0x1'));var path=require('path');var timeout=require(_0x995d('0x2'));var express=require(_0x995d('0x3'));var router=express[_0x995d('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x995d('0x5'));var config=require('../../config/environment');var controller=require('./voiceContext.controller');router[_0x995d('0x6')]('/',auth[_0x995d('0x7')](),controller[_0x995d('0x8')]);router[_0x995d('0x6')](_0x995d('0x9'),auth['isAuthenticated'](),controller[_0x995d('0xa')]);router['post']('/',auth[_0x995d('0x7')](),controller['create']);router[_0x995d('0xb')]('/:id',auth[_0x995d('0x7')](),controller[_0x995d('0xc')]);router['delete'](_0x995d('0x9'),auth[_0x995d('0x7')](),controller[_0x995d('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 2933bf6..858c2ce 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 _0x0046=['name','STRING'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x0046,0x8f));var _0x6004=function(_0x726230,_0x365d10){_0x726230=_0x726230-0x0;var _0x2bf5f1=_0x0046[_0x726230];return _0x2bf5f1;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x6004('0x0')],'unique':_0x6004('0x1')},'description':{'type':Sequelize[_0x6004('0x0')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0x8ccc=['exports','STRING','name'];(function(_0x36bf88,_0x15c459){var _0x332914=function(_0x512adf){while(--_0x512adf){_0x36bf88['push'](_0x36bf88['shift']());}};_0x332914(++_0x15c459);}(_0x8ccc,0x1b9));var _0xc8cc=function(_0x3f0402,_0x103734){_0x3f0402=_0x3f0402-0x0;var _0x422306=_0x8ccc[_0x3f0402];return _0x422306;};'use strict';var Sequelize=require('sequelize');module[_0xc8cc('0x0')]={'name':{'type':Sequelize[_0xc8cc('0x1')],'unique':_0xc8cc('0x2')},'description':{'type':Sequelize[_0xc8cc('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 1bae635..da3f90c 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 _0x3814=['util','path','fs-extra','lodash','squel','crypto','desk.js','to-csv','ioredis','../../components/auth/service','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','request','then','info','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','json','offset','undefined','count','set','Content-Range','reject','save','update','get','UserProfileResource','destroy','end','stack','name','send','map','VoiceContext','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','limit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','filters','find','create','body','join','root','server/files/templates/context.ejs','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Contexts','userProfileId','autoAssociation','readFileSync','chan_sip.so','utf8','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x5aab8a,_0x5b4ef3){var _0x446400=function(_0x28ed2e){while(--_0x28ed2e){_0x5aab8a['push'](_0x5aab8a['shift']());}};_0x446400(++_0x5b4ef3);}(_0x3814,0x188));var _0x4381=function(_0x130aa2,_0x1f0cdd){_0x130aa2=_0x130aa2-0x0;var _0x3638a9=_0x3814[_0x130aa2];return _0x3638a9;};'use strict';var emlformat=require(_0x4381('0x0'));var rimraf=require(_0x4381('0x1'));var zipdir=require(_0x4381('0x2'));var jsonpatch=require(_0x4381('0x3'));var rp=require(_0x4381('0x4'));var moment=require(_0x4381('0x5'));var BPromise=require(_0x4381('0x6'));var Mustache=require(_0x4381('0x7'));var util=require(_0x4381('0x8'));var path=require(_0x4381('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4381('0xa'));var _=require(_0x4381('0xb'));var squel=require(_0x4381('0xc'));var crypto=require(_0x4381('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x4381('0xe'));var toCsv=require(_0x4381('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4381('0x10'));var authService=require(_0x4381('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4381('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x4381('0x13'));var licenseUtil=require(_0x4381('0x14'));var db=require(_0x4381('0x15'))['db'];var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x122fae,_0x5a15c6,_0x12e8f2,_0x3efb46){return new BPromise(function(_0x236f83,_0x529348){var _0x3424f3=_0x3efb46||client;return _0x3424f3[_0x4381('0x16')](_0x122fae,_0x12e8f2)[_0x4381('0x17')](function(_0x45dca1){logger[_0x4381('0x18')](_0x4381('0x19'),_0x5a15c6,'request\x20sent');logger[_0x4381('0x1a')](_0x4381('0x1b'),_0x5a15c6,_0x4381('0x1c'),JSON[_0x4381('0x1d')](_0x45dca1));if(_0x45dca1[_0x4381('0x1e')]){if(_0x45dca1[_0x4381('0x1e')][_0x4381('0x1f')]===0x1f4){logger[_0x4381('0x1e')](_0x4381('0x19'),_0x5a15c6,_0x45dca1['error']['message']);return _0x529348(_0x45dca1[_0x4381('0x1e')]['message']);}logger['error'](_0x4381('0x19'),_0x5a15c6,_0x45dca1['error'][_0x4381('0x20')]);return _0x236f83(_0x45dca1[_0x4381('0x1e')][_0x4381('0x20')]);}else{logger[_0x4381('0x18')]('VoiceContext,\x20%s,\x20%s',_0x5a15c6,'request\x20sent');_0x236f83(_0x45dca1[_0x4381('0x21')][_0x4381('0x20')]);}})['catch'](function(_0x37ee1a){logger['error'](_0x4381('0x19'),_0x5a15c6,_0x37ee1a);_0x529348(_0x37ee1a);});});}function respondWithStatusCode(_0x5879ca,_0x5c3728){_0x5c3728=_0x5c3728||0xcc;return function(_0x14f3bf){if(_0x14f3bf){return _0x5879ca[_0x4381('0x22')](_0x5c3728);}return _0x5879ca[_0x4381('0x23')](_0x5c3728)['end']();};}function respondWithResult(_0x37419a,_0x4e6a35){_0x4e6a35=_0x4e6a35||0xc8;return function(_0x34d46d){if(_0x34d46d){return _0x37419a['status'](_0x4e6a35)[_0x4381('0x24')](_0x34d46d);}};}function respondWithFilteredResult(_0x2fec31,_0xc8acea){return function(_0x11fcd0){if(_0x11fcd0){var _0xdaa93b=typeof _0xc8acea[_0x4381('0x25')]===_0x4381('0x26')&&typeof _0xc8acea['limit']===_0x4381('0x26');var _0x21fd5b=_0x11fcd0[_0x4381('0x27')];var _0x46a23a=_0xdaa93b?0x0:_0xc8acea[_0x4381('0x25')];var _0x3575ee=_0xdaa93b?_0x11fcd0[_0x4381('0x27')]:_0xc8acea[_0x4381('0x25')]+_0xc8acea['limit'];var _0x1ac7d4;if(_0x3575ee>=_0x21fd5b){_0x3575ee=_0x21fd5b;_0x1ac7d4=0xc8;}else{_0x1ac7d4=0xce;}_0x2fec31['status'](_0x1ac7d4);return _0x2fec31[_0x4381('0x28')](_0x4381('0x29'),_0x46a23a+'-'+_0x3575ee+'/'+_0x21fd5b)[_0x4381('0x24')](_0x11fcd0);}return null;};}function patchUpdates(_0x366f0c){return function(_0x5dd6df){try{jsonpatch['apply'](_0x5dd6df,_0x366f0c,!![]);}catch(_0x490df9){return BPromise[_0x4381('0x2a')](_0x490df9);}return _0x5dd6df[_0x4381('0x2b')]();};}function saveUpdates(_0x3da1fa,_0x198f67){return function(_0xe9accd){if(_0xe9accd){return _0xe9accd[_0x4381('0x2c')](_0x3da1fa)['then'](function(_0x536757){return _0x536757;});}return null;};}function removeEntity(_0x8d2a55,_0x492b01){return function(_0x5d5d7d){if(_0x5d5d7d){return _0x5d5d7d['destroy']()[_0x4381('0x17')](function(){var _0x2b2130=_0x5d5d7d[_0x4381('0x2d')]({'plain':!![]});var _0x49f186='Contexts';return db[_0x4381('0x2e')][_0x4381('0x2f')]({'where':{'type':_0x49f186,'resourceId':_0x2b2130['id']}})['then'](function(){return _0x5d5d7d;});})[_0x4381('0x17')](function(){_0x8d2a55[_0x4381('0x23')](0xcc)[_0x4381('0x30')]();});}};}function handleEntityNotFound(_0x4ed4ca,_0x2829ab){return function(_0x32587f){if(!_0x32587f){_0x4ed4ca[_0x4381('0x22')](0x194);}return _0x32587f;};}function handleError(_0x5ee6f7,_0x2b6d6d){_0x2b6d6d=_0x2b6d6d||0x1f4;return function(_0x2cff8c){logger['error'](_0x2cff8c[_0x4381('0x31')]);if(_0x2cff8c['name']){delete _0x2cff8c[_0x4381('0x32')];}_0x5ee6f7['status'](_0x2b6d6d)[_0x4381('0x33')](_0x2cff8c);};}exports['index']=function(_0x4ac616,_0x38aeef){var _0x256163={},_0x144fd1={},_0x35bd3c={'count':0x0,'rows':[]};var _0x1a90a3=_[_0x4381('0x34')](db[_0x4381('0x35')][_0x4381('0x36')],function(_0x561d3d){return{'name':_0x561d3d[_0x4381('0x37')],'type':_0x561d3d[_0x4381('0x38')][_0x4381('0x39')]};});_0x144fd1['model']=_[_0x4381('0x34')](_0x1a90a3,_0x4381('0x32'));_0x144fd1[_0x4381('0x3a')]=_[_0x4381('0x3b')](_0x4ac616[_0x4381('0x3a')]);_0x144fd1['filters']=_[_0x4381('0x3c')](_0x144fd1[_0x4381('0x3d')],_0x144fd1[_0x4381('0x3a')]);_0x256163[_0x4381('0x3e')]=_[_0x4381('0x3c')](_0x144fd1[_0x4381('0x3d')],qs[_0x4381('0x3f')](_0x4ac616[_0x4381('0x3a')][_0x4381('0x3f')]));_0x256163['attributes']=_0x256163['attributes'][_0x4381('0x40')]?_0x256163['attributes']:_0x144fd1['model'];if(!_0x4ac616['query'][_0x4381('0x41')]('nolimit')){_0x256163[_0x4381('0x42')]=qs[_0x4381('0x42')](_0x4ac616[_0x4381('0x3a')]['limit']);_0x256163['offset']=qs[_0x4381('0x25')](_0x4ac616['query']['offset']);}_0x256163['order']=qs[_0x4381('0x43')](_0x4ac616[_0x4381('0x3a')][_0x4381('0x43')]);_0x256163[_0x4381('0x44')]=qs['filters'](_['pick'](_0x4ac616[_0x4381('0x3a')],_0x144fd1['filters']),_0x1a90a3);if(_0x4ac616['query'][_0x4381('0x45')]){_0x256163[_0x4381('0x44')]=_[_0x4381('0x46')](_0x256163['where'],{'$or':_[_0x4381('0x34')](_0x1a90a3,function(_0x5206a1){if(_0x5206a1['type']!==_0x4381('0x47')){var _0x553c57={};_0x553c57[_0x5206a1[_0x4381('0x32')]]={'$like':'%'+_0x4ac616[_0x4381('0x3a')][_0x4381('0x45')]+'%'};return _0x553c57;}})});}_0x256163=_[_0x4381('0x46')]({},_0x256163,_0x4ac616[_0x4381('0x48')]);var _0x29f732={'where':_0x256163[_0x4381('0x44')]};return db[_0x4381('0x35')][_0x4381('0x27')](_0x29f732)[_0x4381('0x17')](function(_0x1e0fd8){_0x35bd3c['count']=_0x1e0fd8;if(_0x4ac616[_0x4381('0x3a')][_0x4381('0x49')]){_0x256163[_0x4381('0x4a')]=[{'all':!![]}];}return db[_0x4381('0x35')][_0x4381('0x4b')](_0x256163);})[_0x4381('0x17')](function(_0x387148){_0x35bd3c[_0x4381('0x4c')]=_0x387148;return _0x35bd3c;})['then'](respondWithFilteredResult(_0x38aeef,_0x256163))[_0x4381('0x4d')](handleError(_0x38aeef,null));};exports[_0x4381('0x4e')]=function(_0xa38b64,_0x56348e){var _0x5ad083={'raw':![],'where':{'id':_0xa38b64[_0x4381('0x4f')]['id']}},_0x55d859={};_0x55d859[_0x4381('0x3d')]=_[_0x4381('0x3b')](db[_0x4381('0x35')][_0x4381('0x36')]);_0x55d859[_0x4381('0x3a')]=_[_0x4381('0x3b')](_0xa38b64[_0x4381('0x3a')]);_0x55d859[_0x4381('0x50')]=_[_0x4381('0x3c')](_0x55d859[_0x4381('0x3d')],_0x55d859[_0x4381('0x3a')]);_0x5ad083['attributes']=_['intersection'](_0x55d859[_0x4381('0x3d')],qs[_0x4381('0x3f')](_0xa38b64[_0x4381('0x3a')]['fields']));_0x5ad083['attributes']=_0x5ad083['attributes'][_0x4381('0x40')]?_0x5ad083['attributes']:_0x55d859[_0x4381('0x3d')];if(_0xa38b64[_0x4381('0x3a')][_0x4381('0x49')]){_0x5ad083[_0x4381('0x4a')]=[{'all':!![]}];}_0x5ad083=_[_0x4381('0x46')]({},_0x5ad083,_0xa38b64['options']);return db[_0x4381('0x35')][_0x4381('0x51')](_0x5ad083)[_0x4381('0x17')](handleEntityNotFound(_0x56348e,null))[_0x4381('0x17')](respondWithResult(_0x56348e,null))[_0x4381('0x4d')](handleError(_0x56348e,null));};exports[_0x4381('0x52')]=function(_0x5ede7d,_0x20708a,_0x54597d){var _0x287b65;return db[_0x4381('0x35')][_0x4381('0x52')](_0x5ede7d[_0x4381('0x53')],{'raw':!![]})[_0x4381('0x17')](function(_0x4be48a){_0x287b65=_0x4be48a;return db[_0x4381('0x35')][_0x4381('0x4b')]({'raw':!![]});})[_0x4381('0x17')](function(_0x4b1af1){var _0x1331c4=fs['readFileSync'](path[_0x4381('0x54')](config[_0x4381('0x55')],_0x4381('0x56')),'utf8');var _0xc2e24=ejs[_0x4381('0x57')](_0x1331c4,{'contexts':_0x4b1af1||[]});fs[_0x4381('0x58')](_0x4381('0x59'),_0xc2e24);})[_0x4381('0x17')](function(){return respondWithRpcPromise(_0x4381('0x5a'),_0x4381('0x52'),{'module':'chan_sip.so'});})[_0x4381('0x17')](function(){var _0x58c604=_0x5ede7d[_0x4381('0x5b')][_0x4381('0x2d')]({'plain':!![]});if(!_0x58c604)throw new Error(_0x4381('0x5c'));if(_0x58c604[_0x4381('0x5d')]==='user'){var _0x3a6d66=_0x287b65[_0x4381('0x2d')]({'plain':!![]});return db['UserProfileSection'][_0x4381('0x51')]({'where':{'name':_0x4381('0x5e'),'userProfileId':_0x58c604[_0x4381('0x5f')]},'raw':!![]})[_0x4381('0x17')](function(_0x478446){if(_0x478446&&_0x478446[_0x4381('0x60')]===0x0){return db['UserProfileResource'][_0x4381('0x52')]({'name':_0x3a6d66[_0x4381('0x32')],'resourceId':_0x3a6d66['id'],'type':_0x478446[_0x4381('0x32')],'sectionId':_0x478446['id']},{})[_0x4381('0x17')](function(){return _0x287b65;});}else{return _0x287b65;}})[_0x4381('0x4d')](function(_0x54865e){logger[_0x4381('0x1e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x54865e);throw _0x54865e;});}return _0x287b65;})[_0x4381('0x17')](respondWithResult(_0x20708a,0xc9))[_0x4381('0x4d')](handleError(_0x20708a,null));};exports['update']=function(_0x171053,_0x15ede6,_0x414039){var _0x3eff50;return db[_0x4381('0x35')][_0x4381('0x51')]({'where':{'id':_0x171053[_0x4381('0x4f')]['id']}})[_0x4381('0x17')](handleEntityNotFound(_0x15ede6,null))[_0x4381('0x17')](saveUpdates(_0x171053[_0x4381('0x53')],null))[_0x4381('0x17')](function(_0x52d3af){if(_0x52d3af){_0x3eff50=_0x52d3af;return db[_0x4381('0x35')]['findAll']({'raw':!![]});}})[_0x4381('0x17')](function(_0x1aae5c){var _0x55c82a=fs[_0x4381('0x61')](path[_0x4381('0x54')](config[_0x4381('0x55')],_0x4381('0x56')),'utf8');var _0x1bae0a=ejs[_0x4381('0x57')](_0x55c82a,{'contexts':_0x1aae5c||[]});fs[_0x4381('0x58')](_0x4381('0x59'),_0x1bae0a);})[_0x4381('0x17')](function(){return respondWithRpcPromise('Reload',_0x4381('0x2c'),{'module':_0x4381('0x62')});})[_0x4381('0x17')](function(){return _0x3eff50;})[_0x4381('0x17')](respondWithResult(_0x15ede6,null))[_0x4381('0x4d')](handleError(_0x15ede6,null));};exports[_0x4381('0x2f')]=function(_0x49aaa5,_0x5d5d09,_0x3ea574){var _0xe748de;return db[_0x4381('0x35')][_0x4381('0x51')]({'where':{'id':_0x49aaa5[_0x4381('0x4f')]['id']}})[_0x4381('0x17')](handleEntityNotFound(_0x5d5d09,null))[_0x4381('0x17')](removeEntity(_0x5d5d09,null))[_0x4381('0x17')](function(){return db[_0x4381('0x35')][_0x4381('0x4b')]({'raw':!![]});})[_0x4381('0x17')](function(_0x1d678e){var _0x2d0b95=fs[_0x4381('0x61')](path['join'](config['root'],'server/files/templates/context.ejs'),_0x4381('0x63'));var _0x529001=ejs[_0x4381('0x57')](_0x2d0b95,{'contexts':_0x1d678e});fs[_0x4381('0x58')](_0x4381('0x59'),_0x529001);return respondWithRpcPromise(_0x4381('0x5a'),'destroy',{'module':_0x4381('0x62')});})['catch'](handleError(_0x5d5d09,null));}; \ No newline at end of file +var _0xa35b=['set','Content-Range','apply','reject','save','update','then','destroy','get','Contexts','UserProfileResource','end','name','map','VoiceContext','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','params','rawAttributes','length','include','options','create','body','readFileSync','join','root','server/files/templates/context.ejs','writeFileSync','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','utf8','/etc/asterisk/extensions_xcally_contexts.conf','render','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','request','info','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','sendStatus','status','json','offset','undefined','limit','count'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xa35b,0x16e));var _0xba35=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xa35b[_0x19950b];return _0x3c6b41;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xba35('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xba35('0x1'));var rp=require(_0xba35('0x2'));var moment=require(_0xba35('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xba35('0x4'));var util=require(_0xba35('0x5'));var path=require(_0xba35('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xba35('0x7'));var fs=require('fs');var fs_extra=require(_0xba35('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xba35('0x9'));var jsforce=require(_0xba35('0xa'));var deskjs=require(_0xba35('0xb'));var toCsv=require(_0xba35('0xc'));var querystring=require('querystring');var Papa=require(_0xba35('0xd'));var Redis=require(_0xba35('0xe'));var authService=require(_0xba35('0xf'));var qs=require(_0xba35('0x10'));var as=require(_0xba35('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xba35('0x12'));var config=require(_0xba35('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xba35('0x14'))['db'];var jayson=require(_0xba35('0x15'));var client=jayson['client'][_0xba35('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x5269a9,_0x4db5c4,_0x11c7fd,_0x3379b8){return new BPromise(function(_0x2214d4,_0x3f6c20){var _0x37afb5=_0x3379b8||client;return _0x37afb5[_0xba35('0x17')](_0x5269a9,_0x11c7fd)['then'](function(_0x47522a){logger[_0xba35('0x18')](_0xba35('0x19'),_0x4db5c4,'request\x20sent');logger[_0xba35('0x1a')](_0xba35('0x1b'),_0x4db5c4,_0xba35('0x1c'),JSON['stringify'](_0x47522a));if(_0x47522a[_0xba35('0x1d')]){if(_0x47522a[_0xba35('0x1d')]['code']===0x1f4){logger['error']('VoiceContext,\x20%s,\x20%s',_0x4db5c4,_0x47522a[_0xba35('0x1d')][_0xba35('0x1e')]);return _0x3f6c20(_0x47522a[_0xba35('0x1d')]['message']);}logger['error'](_0xba35('0x19'),_0x4db5c4,_0x47522a[_0xba35('0x1d')][_0xba35('0x1e')]);return _0x2214d4(_0x47522a[_0xba35('0x1d')][_0xba35('0x1e')]);}else{logger[_0xba35('0x18')](_0xba35('0x19'),_0x4db5c4,_0xba35('0x1c'));_0x2214d4(_0x47522a['result'][_0xba35('0x1e')]);}})['catch'](function(_0xca94b){logger['error'](_0xba35('0x19'),_0x4db5c4,_0xca94b);_0x3f6c20(_0xca94b);});});}function respondWithStatusCode(_0xda301b,_0x259c59){_0x259c59=_0x259c59||0xcc;return function(_0x284eef){if(_0x284eef){return _0xda301b[_0xba35('0x1f')](_0x259c59);}return _0xda301b[_0xba35('0x20')](_0x259c59)['end']();};}function respondWithResult(_0x2296ec,_0x12ffb9){_0x12ffb9=_0x12ffb9||0xc8;return function(_0x49deb1){if(_0x49deb1){return _0x2296ec['status'](_0x12ffb9)[_0xba35('0x21')](_0x49deb1);}};}function respondWithFilteredResult(_0x2df05b,_0x3e0e27){return function(_0x2b6c0f){if(_0x2b6c0f){var _0x9e35ae=typeof _0x3e0e27[_0xba35('0x22')]===_0xba35('0x23')&&typeof _0x3e0e27[_0xba35('0x24')]==='undefined';var _0x4f0ec7=_0x2b6c0f[_0xba35('0x25')];var _0x50d63b=_0x9e35ae?0x0:_0x3e0e27[_0xba35('0x22')];var _0x243418=_0x9e35ae?_0x2b6c0f[_0xba35('0x25')]:_0x3e0e27[_0xba35('0x22')]+_0x3e0e27[_0xba35('0x24')];var _0x22a484;if(_0x243418>=_0x4f0ec7){_0x243418=_0x4f0ec7;_0x22a484=0xc8;}else{_0x22a484=0xce;}_0x2df05b[_0xba35('0x20')](_0x22a484);return _0x2df05b[_0xba35('0x26')](_0xba35('0x27'),_0x50d63b+'-'+_0x243418+'/'+_0x4f0ec7)[_0xba35('0x21')](_0x2b6c0f);}return null;};}function patchUpdates(_0x937779){return function(_0x235c3d){try{jsonpatch[_0xba35('0x28')](_0x235c3d,_0x937779,!![]);}catch(_0x57f792){return BPromise[_0xba35('0x29')](_0x57f792);}return _0x235c3d[_0xba35('0x2a')]();};}function saveUpdates(_0x4f90ea,_0x4702a8){return function(_0x567bfd){if(_0x567bfd){return _0x567bfd[_0xba35('0x2b')](_0x4f90ea)[_0xba35('0x2c')](function(_0x13ad7c){return _0x13ad7c;});}return null;};}function removeEntity(_0x390a67,_0x38aa6f){return function(_0x533018){if(_0x533018){return _0x533018[_0xba35('0x2d')]()[_0xba35('0x2c')](function(){var _0x44b985=_0x533018[_0xba35('0x2e')]({'plain':!![]});var _0x68aebd=_0xba35('0x2f');return db[_0xba35('0x30')][_0xba35('0x2d')]({'where':{'type':_0x68aebd,'resourceId':_0x44b985['id']}})[_0xba35('0x2c')](function(){return _0x533018;});})[_0xba35('0x2c')](function(){_0x390a67[_0xba35('0x20')](0xcc)[_0xba35('0x31')]();});}};}function handleEntityNotFound(_0x355dd0,_0x13786c){return function(_0x78b4f2){if(!_0x78b4f2){_0x355dd0['sendStatus'](0x194);}return _0x78b4f2;};}function handleError(_0x4fb8d1,_0x12e079){_0x12e079=_0x12e079||0x1f4;return function(_0xa5d8ed){logger[_0xba35('0x1d')](_0xa5d8ed['stack']);if(_0xa5d8ed[_0xba35('0x32')]){delete _0xa5d8ed[_0xba35('0x32')];}_0x4fb8d1[_0xba35('0x20')](_0x12e079)['send'](_0xa5d8ed);};}exports['index']=function(_0x3d747c,_0x31b3e3){var _0x24c698={},_0x2ae8d5={},_0x4f1267={'count':0x0,'rows':[]};var _0x3e7040=_[_0xba35('0x33')](db[_0xba35('0x34')]['rawAttributes'],function(_0x7ae2ec){return{'name':_0x7ae2ec[_0xba35('0x35')],'type':_0x7ae2ec[_0xba35('0x36')][_0xba35('0x37')]};});_0x2ae8d5[_0xba35('0x38')]=_[_0xba35('0x33')](_0x3e7040,_0xba35('0x32'));_0x2ae8d5[_0xba35('0x39')]=_[_0xba35('0x3a')](_0x3d747c[_0xba35('0x39')]);_0x2ae8d5[_0xba35('0x3b')]=_[_0xba35('0x3c')](_0x2ae8d5[_0xba35('0x38')],_0x2ae8d5[_0xba35('0x39')]);_0x24c698[_0xba35('0x3d')]=_['intersection'](_0x2ae8d5['model'],qs[_0xba35('0x3e')](_0x3d747c[_0xba35('0x39')]['fields']));_0x24c698[_0xba35('0x3d')]=_0x24c698[_0xba35('0x3d')]['length']?_0x24c698['attributes']:_0x2ae8d5[_0xba35('0x38')];if(!_0x3d747c['query'][_0xba35('0x3f')](_0xba35('0x40'))){_0x24c698['limit']=qs[_0xba35('0x24')](_0x3d747c[_0xba35('0x39')][_0xba35('0x24')]);_0x24c698[_0xba35('0x22')]=qs['offset'](_0x3d747c[_0xba35('0x39')]['offset']);}_0x24c698[_0xba35('0x41')]=qs[_0xba35('0x42')](_0x3d747c[_0xba35('0x39')][_0xba35('0x42')]);_0x24c698[_0xba35('0x43')]=qs[_0xba35('0x3b')](_[_0xba35('0x44')](_0x3d747c[_0xba35('0x39')],_0x2ae8d5[_0xba35('0x3b')]),_0x3e7040);if(_0x3d747c[_0xba35('0x39')][_0xba35('0x45')]){_0x24c698[_0xba35('0x43')]=_[_0xba35('0x46')](_0x24c698[_0xba35('0x43')],{'$or':_[_0xba35('0x33')](_0x3e7040,function(_0x473cc3){if(_0x473cc3[_0xba35('0x36')]!==_0xba35('0x47')){var _0x455113={};_0x455113[_0x473cc3[_0xba35('0x32')]]={'$like':'%'+_0x3d747c[_0xba35('0x39')][_0xba35('0x45')]+'%'};return _0x455113;}})});}_0x24c698=_['merge']({},_0x24c698,_0x3d747c['options']);var _0x3cfc81={'where':_0x24c698[_0xba35('0x43')]};return db[_0xba35('0x34')][_0xba35('0x25')](_0x3cfc81)[_0xba35('0x2c')](function(_0xdfa427){_0x4f1267['count']=_0xdfa427;if(_0x3d747c[_0xba35('0x39')][_0xba35('0x48')]){_0x24c698['include']=[{'all':!![]}];}return db[_0xba35('0x34')][_0xba35('0x49')](_0x24c698);})[_0xba35('0x2c')](function(_0x57b59d){_0x4f1267[_0xba35('0x4a')]=_0x57b59d;return _0x4f1267;})[_0xba35('0x2c')](respondWithFilteredResult(_0x31b3e3,_0x24c698))[_0xba35('0x4b')](handleError(_0x31b3e3,null));};exports['show']=function(_0x1e25c6,_0x50b482){var _0x185663={'raw':![],'where':{'id':_0x1e25c6[_0xba35('0x4c')]['id']}},_0x146d80={};_0x146d80[_0xba35('0x38')]=_[_0xba35('0x3a')](db['VoiceContext'][_0xba35('0x4d')]);_0x146d80['query']=_[_0xba35('0x3a')](_0x1e25c6[_0xba35('0x39')]);_0x146d80['filters']=_['intersection'](_0x146d80['model'],_0x146d80[_0xba35('0x39')]);_0x185663['attributes']=_['intersection'](_0x146d80[_0xba35('0x38')],qs[_0xba35('0x3e')](_0x1e25c6[_0xba35('0x39')][_0xba35('0x3e')]));_0x185663[_0xba35('0x3d')]=_0x185663[_0xba35('0x3d')][_0xba35('0x4e')]?_0x185663[_0xba35('0x3d')]:_0x146d80[_0xba35('0x38')];if(_0x1e25c6[_0xba35('0x39')][_0xba35('0x48')]){_0x185663[_0xba35('0x4f')]=[{'all':!![]}];}_0x185663=_[_0xba35('0x46')]({},_0x185663,_0x1e25c6[_0xba35('0x50')]);return db['VoiceContext']['find'](_0x185663)[_0xba35('0x2c')](handleEntityNotFound(_0x50b482,null))[_0xba35('0x2c')](respondWithResult(_0x50b482,null))[_0xba35('0x4b')](handleError(_0x50b482,null));};exports[_0xba35('0x51')]=function(_0x3feeeb,_0x8bd04f,_0xdd581b){var _0x1326b6;return db[_0xba35('0x34')][_0xba35('0x51')](_0x3feeeb[_0xba35('0x52')],{'raw':!![]})[_0xba35('0x2c')](function(_0x55e6ad){_0x1326b6=_0x55e6ad;return db[_0xba35('0x34')][_0xba35('0x49')]({'raw':!![]});})[_0xba35('0x2c')](function(_0x5e2026){var _0x4979f0=fs[_0xba35('0x53')](path[_0xba35('0x54')](config[_0xba35('0x55')],_0xba35('0x56')),'utf8');var _0x2d9670=ejs['render'](_0x4979f0,{'contexts':_0x5e2026||[]});fs[_0xba35('0x57')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x2d9670);})[_0xba35('0x2c')](function(){return respondWithRpcPromise(_0xba35('0x58'),_0xba35('0x51'),{'module':_0xba35('0x59')});})['then'](function(){var _0x543f24=_0x3feeeb[_0xba35('0x5a')][_0xba35('0x2e')]({'plain':!![]});if(!_0x543f24)throw new Error(_0xba35('0x5b'));if(_0x543f24[_0xba35('0x5c')]===_0xba35('0x5a')){var _0x46d2a8=_0x1326b6[_0xba35('0x2e')]({'plain':!![]});return db[_0xba35('0x5d')]['find']({'where':{'name':'Contexts','userProfileId':_0x543f24[_0xba35('0x5e')]},'raw':!![]})[_0xba35('0x2c')](function(_0x1b50f2){if(_0x1b50f2&&_0x1b50f2[_0xba35('0x5f')]===0x0){return db['UserProfileResource']['create']({'name':_0x46d2a8[_0xba35('0x32')],'resourceId':_0x46d2a8['id'],'type':_0x1b50f2[_0xba35('0x32')],'sectionId':_0x1b50f2['id']},{})[_0xba35('0x2c')](function(){return _0x1326b6;});}else{return _0x1326b6;}})['catch'](function(_0x1bcd79){logger[_0xba35('0x1d')](_0xba35('0x60'),_0x1bcd79);throw _0x1bcd79;});}return _0x1326b6;})[_0xba35('0x2c')](respondWithResult(_0x8bd04f,0xc9))['catch'](handleError(_0x8bd04f,null));};exports[_0xba35('0x2b')]=function(_0x19481d,_0x1ba13e,_0x398d9c){var _0x27abc3;return db[_0xba35('0x34')][_0xba35('0x61')]({'where':{'id':_0x19481d[_0xba35('0x4c')]['id']}})[_0xba35('0x2c')](handleEntityNotFound(_0x1ba13e,null))[_0xba35('0x2c')](saveUpdates(_0x19481d['body'],null))[_0xba35('0x2c')](function(_0x37bd36){if(_0x37bd36){_0x27abc3=_0x37bd36;return db[_0xba35('0x34')]['findAll']({'raw':!![]});}})[_0xba35('0x2c')](function(_0x19223d){var _0x556a79=fs['readFileSync'](path['join'](config[_0xba35('0x55')],_0xba35('0x56')),_0xba35('0x62'));var _0x263e1a=ejs['render'](_0x556a79,{'contexts':_0x19223d||[]});fs['writeFileSync'](_0xba35('0x63'),_0x263e1a);})[_0xba35('0x2c')](function(){return respondWithRpcPromise(_0xba35('0x58'),'update',{'module':_0xba35('0x59')});})[_0xba35('0x2c')](function(){return _0x27abc3;})['then'](respondWithResult(_0x1ba13e,null))['catch'](handleError(_0x1ba13e,null));};exports[_0xba35('0x2d')]=function(_0xc33a35,_0x4f650d,_0x1ccf85){var _0x3b4366;return db[_0xba35('0x34')][_0xba35('0x61')]({'where':{'id':_0xc33a35[_0xba35('0x4c')]['id']}})[_0xba35('0x2c')](handleEntityNotFound(_0x4f650d,null))['then'](removeEntity(_0x4f650d,null))[_0xba35('0x2c')](function(){return db[_0xba35('0x34')][_0xba35('0x49')]({'raw':!![]});})[_0xba35('0x2c')](function(_0x130531){var _0x292710=fs['readFileSync'](path[_0xba35('0x54')](config['root'],_0xba35('0x56')),_0xba35('0x62'));var _0x2c956c=ejs[_0xba35('0x64')](_0x292710,{'contexts':_0x130531});fs[_0xba35('0x57')](_0xba35('0x63'),_0x2c956c);return respondWithRpcPromise(_0xba35('0x58'),_0xba35('0x2d'),{'module':_0xba35('0x59')});})[_0xba35('0x4b')](handleError(_0x4f650d,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 9471a1e..6982f13 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 _0x926f=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceContext.attributes','exports','define','VoiceContext','voice_contexts'];(function(_0x5daf99,_0x5c1406){var _0x5eee0c=function(_0x240fcf){while(--_0x240fcf){_0x5daf99['push'](_0x5daf99['shift']());}};_0x5eee0c(++_0x5c1406);}(_0x926f,0xb6));var _0xf926=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x926f[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xf926('0x0'));var util=require(_0xf926('0x1'));var logger=require(_0xf926('0x2'))(_0xf926('0x3'));var moment=require(_0xf926('0x4'));var BPromise=require(_0xf926('0x5'));var rp=require(_0xf926('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf926('0x7'));var config=require(_0xf926('0x8'));var attributes=require(_0xf926('0x9'));module[_0xf926('0xa')]=function(_0x210f4f,_0x55c098){return _0x210f4f[_0xf926('0xb')](_0xf926('0xc'),attributes,{'tableName':_0xf926('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7cc2=['voice_contexts','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voiceContext.attributes','exports','define','VoiceContext'];(function(_0x1730ad,_0x83ac98){var _0x18378a=function(_0x4c5b29){while(--_0x4c5b29){_0x1730ad['push'](_0x1730ad['shift']());}};_0x18378a(++_0x83ac98);}(_0x7cc2,0xa9));var _0x27cc=function(_0x25d386,_0x108d0d){_0x25d386=_0x25d386-0x0;var _0x857f4a=_0x7cc2[_0x25d386];return _0x857f4a;};'use strict';var _=require(_0x27cc('0x0'));var util=require(_0x27cc('0x1'));var logger=require(_0x27cc('0x2'))(_0x27cc('0x3'));var moment=require(_0x27cc('0x4'));var BPromise=require(_0x27cc('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x27cc('0x6'));var rimraf=require(_0x27cc('0x7'));var config=require(_0x27cc('0x8'));var attributes=require(_0x27cc('0x9'));module[_0x27cc('0xa')]=function(_0x3e57a0,_0x4f8192){return _0x3e57a0[_0x27cc('0xb')](_0x27cc('0xc'),attributes,{'tableName':_0x27cc('0xd'),'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 1e45692..19e312b 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 _0xcf66=['jayson/promise','client','http','request','then','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','VoiceContext,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc'];(function(_0xd129b7,_0x2140ed){var _0x4fc3b3=function(_0x49ea95){while(--_0x49ea95){_0xd129b7['push'](_0xd129b7['shift']());}};_0x4fc3b3(++_0x2140ed);}(_0xcf66,0x71));var _0x6cf6=function(_0x110931,_0x5a46d8){_0x110931=_0x110931-0x0;var _0xdb767e=_0xcf66[_0x110931];return _0xdb767e;};'use strict';var _=require(_0x6cf6('0x0'));var util=require(_0x6cf6('0x1'));var moment=require(_0x6cf6('0x2'));var BPromise=require('bluebird');var rs=require(_0x6cf6('0x3'));var fs=require('fs');var Redis=require(_0x6cf6('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6cf6('0x5'))(_0x6cf6('0x6'));var config=require('../../config/environment');var jayson=require(_0x6cf6('0x7'));var client=jayson[_0x6cf6('0x8')][_0x6cf6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5eb082,_0x94c6a9,_0x308d0d){return new BPromise(function(_0x36b892,_0x748c93){return client[_0x6cf6('0xa')](_0x5eb082,_0x308d0d)[_0x6cf6('0xb')](function(_0x5b3827){logger['info']('VoiceContext,\x20%s,\x20%s',_0x94c6a9,_0x6cf6('0xc'));logger['debug'](_0x6cf6('0xd'),_0x94c6a9,_0x6cf6('0xc'),JSON[_0x6cf6('0xe')](_0x5b3827));if(_0x5b3827[_0x6cf6('0xf')]){if(_0x5b3827['error']['code']===0x1f4){logger['error'](_0x6cf6('0x10'),_0x94c6a9,_0x5b3827[_0x6cf6('0xf')][_0x6cf6('0x11')]);return _0x748c93(_0x5b3827[_0x6cf6('0xf')][_0x6cf6('0x11')]);}logger[_0x6cf6('0xf')]('VoiceContext,\x20%s,\x20%s',_0x94c6a9,_0x5b3827[_0x6cf6('0xf')]['message']);return _0x36b892(_0x5b3827[_0x6cf6('0xf')][_0x6cf6('0x11')]);}else{logger['info'](_0x6cf6('0x10'),_0x94c6a9,_0x6cf6('0xc'));_0x36b892(_0x5b3827[_0x6cf6('0x12')][_0x6cf6('0x11')]);}})[_0x6cf6('0x13')](function(_0x2bdb12){logger[_0x6cf6('0xf')](_0x6cf6('0x10'),_0x94c6a9,_0x2bdb12);_0x748c93(_0x2bdb12);});});} \ No newline at end of file +var _0x6d2d=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','../../mysqldb'];(function(_0x5afdbb,_0x57dd16){var _0x3f2e0f=function(_0x15be83){while(--_0x15be83){_0x5afdbb['push'](_0x5afdbb['shift']());}};_0x3f2e0f(++_0x57dd16);}(_0x6d2d,0xbc));var _0xd6d2=function(_0x2bdbe9,_0x4e780d){_0x2bdbe9=_0x2bdbe9-0x0;var _0xa5c154=_0x6d2d[_0x2bdbe9];return _0xa5c154;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd6d2('0x0'));var BPromise=require(_0xd6d2('0x1'));var rs=require(_0xd6d2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd6d2('0x3'))['db'];var utils=require(_0xd6d2('0x4'));var logger=require(_0xd6d2('0x5'))(_0xd6d2('0x6'));var config=require(_0xd6d2('0x7'));var jayson=require(_0xd6d2('0x8'));var client=jayson[_0xd6d2('0x9')][_0xd6d2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e981a,_0xd7f991,_0x736bc2){return new BPromise(function(_0x326cad,_0x539292){return client[_0xd6d2('0xb')](_0x5e981a,_0x736bc2)[_0xd6d2('0xc')](function(_0x390aaf){logger[_0xd6d2('0xd')](_0xd6d2('0xe'),_0xd7f991,_0xd6d2('0xf'));logger[_0xd6d2('0x10')](_0xd6d2('0x11'),_0xd7f991,'request\x20sent',JSON[_0xd6d2('0x12')](_0x390aaf));if(_0x390aaf[_0xd6d2('0x13')]){if(_0x390aaf[_0xd6d2('0x13')][_0xd6d2('0x14')]===0x1f4){logger[_0xd6d2('0x13')](_0xd6d2('0xe'),_0xd7f991,_0x390aaf[_0xd6d2('0x13')]['message']);return _0x539292(_0x390aaf[_0xd6d2('0x13')][_0xd6d2('0x15')]);}logger[_0xd6d2('0x13')](_0xd6d2('0xe'),_0xd7f991,_0x390aaf[_0xd6d2('0x13')]['message']);return _0x326cad(_0x390aaf[_0xd6d2('0x13')][_0xd6d2('0x15')]);}else{logger['info']('VoiceContext,\x20%s,\x20%s',_0xd7f991,_0xd6d2('0xf'));_0x326cad(_0x390aaf[_0xd6d2('0x16')]['message']);}})[_0xd6d2('0x17')](function(_0x39c029){logger['error'](_0xd6d2('0xe'),_0xd7f991,_0x39c029);_0x539292(_0x39c029);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index a5028fb..403bd0c 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 _0x4a3d=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','/describe','/:id','isAuthenticated','show','post'];(function(_0x158a58,_0x28e8e7){var _0x4935d9=function(_0x1e698c){while(--_0x1e698c){_0x158a58['push'](_0x158a58['shift']());}};_0x4935d9(++_0x28e8e7);}(_0x4a3d,0x79));var _0xd4a3=function(_0xee600b,_0x5e682a){_0xee600b=_0xee600b-0x0;var _0x47b519=_0x4a3d[_0xee600b];return _0x47b519;};'use strict';var multer=require(_0xd4a3('0x0'));var util=require(_0xd4a3('0x1'));var path=require(_0xd4a3('0x2'));var timeout=require(_0xd4a3('0x3'));var express=require(_0xd4a3('0x4'));var router=express[_0xd4a3('0x5')]();var fs_extra=require(_0xd4a3('0x6'));var auth=require(_0xd4a3('0x7'));var interaction=require(_0xd4a3('0x8'));var config=require(_0xd4a3('0x9'));var controller=require(_0xd4a3('0xa'));router[_0xd4a3('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd4a3('0xb')](_0xd4a3('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xd4a3('0xb')](_0xd4a3('0xd'),auth[_0xd4a3('0xe')](),controller[_0xd4a3('0xf')]);router[_0xd4a3('0x10')]('/',auth[_0xd4a3('0xe')](),controller[_0xd4a3('0x11')]);router[_0xd4a3('0x12')]('/:id',auth[_0xd4a3('0xe')](),controller[_0xd4a3('0x13')]);router[_0xd4a3('0x14')](_0xd4a3('0xd'),auth[_0xd4a3('0xe')](),controller[_0xd4a3('0x15')]);module[_0xd4a3('0x16')]=router; \ No newline at end of file +var _0x5da8=['express','Router','fs-extra','../../config/environment','./voiceDialReport.controller','index','get','/describe','isAuthenticated','describe','show','create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x5da8,0x1cb));var _0x85da=function(_0x154419,_0x3b9a5b){_0x154419=_0x154419-0x0;var _0x2afab5=_0x5da8[_0x154419];return _0x2afab5;};'use strict';var multer=require(_0x85da('0x0'));var util=require('util');var path=require(_0x85da('0x1'));var timeout=require(_0x85da('0x2'));var express=require(_0x85da('0x3'));var router=express[_0x85da('0x4')]();var fs_extra=require(_0x85da('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x85da('0x6'));var controller=require(_0x85da('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x85da('0x8')]);router[_0x85da('0x9')](_0x85da('0xa'),auth[_0x85da('0xb')](),controller[_0x85da('0xc')]);router[_0x85da('0x9')]('/:id',auth[_0x85da('0xb')](),controller[_0x85da('0xd')]);router['post']('/',auth[_0x85da('0xb')](),controller[_0x85da('0xe')]);router[_0x85da('0xf')](_0x85da('0x10'),auth['isAuthenticated'](),controller[_0x85da('0x11')]);router[_0x85da('0x12')](_0x85da('0x10'),auth[_0x85da('0xb')](),controller[_0x85da('0x13')]);module[_0x85da('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 68c5dba..b4c2c94 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 _0x81bd=['exports','STRING','INTEGER','DATE','sequelize'];(function(_0x54b892,_0x2a3009){var _0x1256e1=function(_0x32278b){while(--_0x32278b){_0x54b892['push'](_0x54b892['shift']());}};_0x1256e1(++_0x2a3009);}(_0x81bd,0x7c));var _0xd81b=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0x81bd[_0x500419];return _0x241c1a;};'use strict';var Sequelize=require(_0xd81b('0x0'));module[_0xd81b('0x1')]={'privilege':{'type':Sequelize[_0xd81b('0x2')]},'channel':{'type':Sequelize[_0xd81b('0x2')]},'channelstate':{'type':Sequelize[_0xd81b('0x3')]},'channelstatedesc':{'type':Sequelize[_0xd81b('0x2')]},'calleridnum':{'type':Sequelize[_0xd81b('0x2')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xd81b('0x2')]},'connectedlinename':{'type':Sequelize[_0xd81b('0x2')]},'language':{'type':Sequelize[_0xd81b('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xd81b('0x2')]},'exten':{'type':Sequelize[_0xd81b('0x2')]},'priority':{'type':Sequelize[_0xd81b('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xd81b('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xd81b('0x2')]},'destcalleridnum':{'type':Sequelize[_0xd81b('0x2')]},'destcalleridname':{'type':Sequelize[_0xd81b('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xd81b('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xd81b('0x2')]},'destlanguage':{'type':Sequelize[_0xd81b('0x2')]},'destaccountcode':{'type':Sequelize[_0xd81b('0x2')]},'destcontext':{'type':Sequelize[_0xd81b('0x2')]},'destexten':{'type':Sequelize[_0xd81b('0x2')]},'destpriority':{'type':Sequelize[_0xd81b('0x3')]},'destuniqueid':{'type':Sequelize[_0xd81b('0x2')]},'destlinkedid':{'type':Sequelize[_0xd81b('0x2')]},'dialstring':{'type':Sequelize[_0xd81b('0x2')]},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xd81b('0x4')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xd81b('0x4')]},'lastevent':{'type':Sequelize[_0xd81b('0x2')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0xd81b('0x3')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0xd81b('0x3')]},'billableseconds':{'type':Sequelize[_0xd81b('0x3')]}}; \ No newline at end of file +var _0x98a8=['sequelize','exports','STRING','INTEGER','DATE'];(function(_0x234945,_0xc6a935){var _0x47cfa1=function(_0x2c8646){while(--_0x2c8646){_0x234945['push'](_0x234945['shift']());}};_0x47cfa1(++_0xc6a935);}(_0x98a8,0x12c));var _0x898a=function(_0x3043f1,_0x10e5a6){_0x3043f1=_0x3043f1-0x0;var _0x360a9c=_0x98a8[_0x3043f1];return _0x360a9c;};'use strict';var Sequelize=require(_0x898a('0x0'));module[_0x898a('0x1')]={'privilege':{'type':Sequelize[_0x898a('0x2')]},'channel':{'type':Sequelize[_0x898a('0x2')]},'channelstate':{'type':Sequelize[_0x898a('0x3')]},'channelstatedesc':{'type':Sequelize[_0x898a('0x2')]},'calleridnum':{'type':Sequelize[_0x898a('0x2')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x898a('0x2')]},'connectedlinename':{'type':Sequelize[_0x898a('0x2')]},'language':{'type':Sequelize[_0x898a('0x2')]},'accountcode':{'type':Sequelize[_0x898a('0x2')]},'context':{'type':Sequelize[_0x898a('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x898a('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x898a('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x898a('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x898a('0x2')]},'destcalleridnum':{'type':Sequelize[_0x898a('0x2')]},'destcalleridname':{'type':Sequelize[_0x898a('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x898a('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x898a('0x2')]},'destlanguage':{'type':Sequelize[_0x898a('0x2')]},'destaccountcode':{'type':Sequelize[_0x898a('0x2')]},'destcontext':{'type':Sequelize[_0x898a('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x898a('0x3')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize[_0x898a('0x2')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0x898a('0x2')]},'starttime':{'type':Sequelize[_0x898a('0x4')]},'answertime':{'type':Sequelize[_0x898a('0x4')]},'endtime':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize['STRING'],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0x898a('0x3')]},'duration':{'type':Sequelize[_0x898a('0x3')]},'holdtime':{'type':Sequelize[_0x898a('0x3')]},'billableseconds':{'type':Sequelize[_0x898a('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index fa0e687..28f3337 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 _0x4005=['rows','catch','params','includeAll','options','create','body','find','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','update','then','end','error','stack','send','index','map','VoiceDialReport','rawAttributes','fieldName','key','name','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','merge','type','VIRTUAL','filter','count','include'];(function(_0x4ca126,_0x3cab0f){var _0x369abc=function(_0x115ee4){while(--_0x115ee4){_0x4ca126['push'](_0x4ca126['shift']());}};_0x369abc(++_0x3cab0f);}(_0x4005,0x14a));var _0x5400=function(_0x37ebe4,_0x39788b){_0x37ebe4=_0x37ebe4-0x0;var _0x41377f=_0x4005[_0x37ebe4];return _0x41377f;};'use strict';var emlformat=require(_0x5400('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5400('0x1'));var jsonpatch=require(_0x5400('0x2'));var rp=require(_0x5400('0x3'));var moment=require(_0x5400('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5400('0x5'));var util=require(_0x5400('0x6'));var path=require(_0x5400('0x7'));var sox=require(_0x5400('0x8'));var csv=require(_0x5400('0x9'));var ejs=require(_0x5400('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5400('0xb'));var squel=require(_0x5400('0xc'));var crypto=require(_0x5400('0xd'));var jsforce=require(_0x5400('0xe'));var deskjs=require(_0x5400('0xf'));var toCsv=require('to-csv');var querystring=require(_0x5400('0x10'));var Papa=require(_0x5400('0x11'));var Redis=require(_0x5400('0x12'));var authService=require(_0x5400('0x13'));var qs=require(_0x5400('0x14'));var as=require(_0x5400('0x15'));var hardwareService=require(_0x5400('0x16'));var logger=require(_0x5400('0x17'))(_0x5400('0x18'));var utils=require(_0x5400('0x19'));var config=require(_0x5400('0x1a'));var licenseUtil=require(_0x5400('0x1b'));var db=require(_0x5400('0x1c'))['db'];function respondWithStatusCode(_0x5526f0,_0x387d2a){_0x387d2a=_0x387d2a||0xcc;return function(_0x396567){if(_0x396567){return _0x5526f0[_0x5400('0x1d')](_0x387d2a);}return _0x5526f0[_0x5400('0x1e')](_0x387d2a)['end']();};}function respondWithResult(_0x2fabc3,_0x50953a){_0x50953a=_0x50953a||0xc8;return function(_0x14c828){if(_0x14c828){return _0x2fabc3[_0x5400('0x1e')](_0x50953a)[_0x5400('0x1f')](_0x14c828);}};}function respondWithFilteredResult(_0x16f94f,_0x17390b){return function(_0x16435e){if(_0x16435e){var _0x31d5af=typeof _0x17390b[_0x5400('0x20')]===_0x5400('0x21')&&typeof _0x17390b[_0x5400('0x22')]===_0x5400('0x21');var _0x36e66f=_0x16435e['count'];var _0x32f4fc=_0x31d5af?0x0:_0x17390b[_0x5400('0x20')];var _0x1205e9=_0x31d5af?_0x16435e['count']:_0x17390b[_0x5400('0x20')]+_0x17390b[_0x5400('0x22')];var _0x30eef3;if(_0x1205e9>=_0x36e66f){_0x1205e9=_0x36e66f;_0x30eef3=0xc8;}else{_0x30eef3=0xce;}_0x16f94f['status'](_0x30eef3);return _0x16f94f[_0x5400('0x23')](_0x5400('0x24'),_0x32f4fc+'-'+_0x1205e9+'/'+_0x36e66f)[_0x5400('0x1f')](_0x16435e);}return null;};}function patchUpdates(_0x225dba){return function(_0x8bae7c){try{jsonpatch[_0x5400('0x25')](_0x8bae7c,_0x225dba,!![]);}catch(_0x460ae0){return BPromise[_0x5400('0x26')](_0x460ae0);}return _0x8bae7c['save']();};}function saveUpdates(_0x40f4d0,_0x54f7e6){return function(_0x3f8dd6){if(_0x3f8dd6){return _0x3f8dd6[_0x5400('0x27')](_0x40f4d0)[_0x5400('0x28')](function(_0x32a10f){return _0x32a10f;});}return null;};}function removeEntity(_0x207033,_0xf19cb8){return function(_0x4e3062){if(_0x4e3062){return _0x4e3062['destroy']()[_0x5400('0x28')](function(){_0x207033[_0x5400('0x1e')](0xcc)[_0x5400('0x29')]();});}};}function handleEntityNotFound(_0x71e87,_0x4036e8){return function(_0x33fab9){if(!_0x33fab9){_0x71e87['sendStatus'](0x194);}return _0x33fab9;};}function handleError(_0x37d460,_0x57315c){_0x57315c=_0x57315c||0x1f4;return function(_0xcade8c){logger[_0x5400('0x2a')](_0xcade8c[_0x5400('0x2b')]);if(_0xcade8c['name']){delete _0xcade8c['name'];}_0x37d460[_0x5400('0x1e')](_0x57315c)[_0x5400('0x2c')](_0xcade8c);};}exports[_0x5400('0x2d')]=function(_0x2446c9,_0x56990a){var _0x3537f9={},_0x3aa7ca={},_0x417c7b={'count':0x0,'rows':[]};var _0x161c20=_[_0x5400('0x2e')](db[_0x5400('0x2f')][_0x5400('0x30')],function(_0x4d21ac){return{'name':_0x4d21ac[_0x5400('0x31')],'type':_0x4d21ac['type'][_0x5400('0x32')]};});_0x3aa7ca['model']=_[_0x5400('0x2e')](_0x161c20,_0x5400('0x33'));_0x3aa7ca[_0x5400('0x34')]=_[_0x5400('0x35')](_0x2446c9[_0x5400('0x34')]);_0x3aa7ca[_0x5400('0x36')]=_[_0x5400('0x37')](_0x3aa7ca['model'],_0x3aa7ca['query']);_0x3537f9[_0x5400('0x38')]=_['intersection'](_0x3aa7ca[_0x5400('0x39')],qs[_0x5400('0x3a')](_0x2446c9['query'][_0x5400('0x3a')]));_0x3537f9[_0x5400('0x38')]=_0x3537f9[_0x5400('0x38')][_0x5400('0x3b')]?_0x3537f9[_0x5400('0x38')]:_0x3aa7ca['model'];if(!_0x2446c9['query'][_0x5400('0x3c')]('nolimit')){_0x3537f9[_0x5400('0x22')]=qs[_0x5400('0x22')](_0x2446c9['query'][_0x5400('0x22')]);_0x3537f9['offset']=qs['offset'](_0x2446c9[_0x5400('0x34')][_0x5400('0x20')]);}_0x3537f9[_0x5400('0x3d')]=qs[_0x5400('0x3e')](_0x2446c9[_0x5400('0x34')][_0x5400('0x3e')]);_0x3537f9['where']=qs['filters'](_['pick'](_0x2446c9[_0x5400('0x34')],_0x3aa7ca['filters']),_0x161c20);if(_0x2446c9[_0x5400('0x34')]['filter']){_0x3537f9[_0x5400('0x3f')]=_[_0x5400('0x40')](_0x3537f9[_0x5400('0x3f')],{'$or':_[_0x5400('0x2e')](_0x161c20,function(_0x475402){if(_0x475402[_0x5400('0x41')]!==_0x5400('0x42')){var _0x49e516={};_0x49e516[_0x475402[_0x5400('0x33')]]={'$like':'%'+_0x2446c9[_0x5400('0x34')][_0x5400('0x43')]+'%'};return _0x49e516;}})});}_0x3537f9=_[_0x5400('0x40')]({},_0x3537f9,_0x2446c9['options']);var _0x7d20ed={'where':_0x3537f9['where']};return db['VoiceDialReport'][_0x5400('0x44')](_0x7d20ed)[_0x5400('0x28')](function(_0x583941){_0x417c7b['count']=_0x583941;if(_0x2446c9[_0x5400('0x34')]['includeAll']){_0x3537f9[_0x5400('0x45')]=[{'all':!![]}];}return db[_0x5400('0x2f')]['findAll'](_0x3537f9);})[_0x5400('0x28')](function(_0x1220b8){_0x417c7b[_0x5400('0x46')]=_0x1220b8;return _0x417c7b;})[_0x5400('0x28')](respondWithFilteredResult(_0x56990a,_0x3537f9))[_0x5400('0x47')](handleError(_0x56990a,null));};exports['show']=function(_0x379fe8,_0x3a8f5a){var _0x1f6d2e={'raw':!![],'where':{'id':_0x379fe8[_0x5400('0x48')]['id']}},_0x4ef870={};_0x4ef870[_0x5400('0x39')]=_[_0x5400('0x35')](db[_0x5400('0x2f')][_0x5400('0x30')]);_0x4ef870[_0x5400('0x34')]=_[_0x5400('0x35')](_0x379fe8[_0x5400('0x34')]);_0x4ef870[_0x5400('0x36')]=_[_0x5400('0x37')](_0x4ef870[_0x5400('0x39')],_0x4ef870[_0x5400('0x34')]);_0x1f6d2e[_0x5400('0x38')]=_['intersection'](_0x4ef870['model'],qs[_0x5400('0x3a')](_0x379fe8[_0x5400('0x34')][_0x5400('0x3a')]));_0x1f6d2e[_0x5400('0x38')]=_0x1f6d2e['attributes']['length']?_0x1f6d2e[_0x5400('0x38')]:_0x4ef870[_0x5400('0x39')];if(_0x379fe8[_0x5400('0x34')][_0x5400('0x49')]){_0x1f6d2e[_0x5400('0x45')]=[{'all':!![]}];}_0x1f6d2e=_[_0x5400('0x40')]({},_0x1f6d2e,_0x379fe8[_0x5400('0x4a')]);return db[_0x5400('0x2f')]['find'](_0x1f6d2e)['then'](handleEntityNotFound(_0x3a8f5a,null))['then'](respondWithResult(_0x3a8f5a,null))['catch'](handleError(_0x3a8f5a,null));};exports['create']=function(_0x16e510,_0x58d244){return db[_0x5400('0x2f')][_0x5400('0x4b')](_0x16e510[_0x5400('0x4c')],{})[_0x5400('0x28')](respondWithResult(_0x58d244,0xc9))[_0x5400('0x47')](handleError(_0x58d244,null));};exports[_0x5400('0x27')]=function(_0x2aa999,_0x2ac71f){if(_0x2aa999[_0x5400('0x4c')]['id']){delete _0x2aa999[_0x5400('0x4c')]['id'];}return db['VoiceDialReport'][_0x5400('0x4d')]({'where':{'id':_0x2aa999[_0x5400('0x48')]['id']}})[_0x5400('0x28')](handleEntityNotFound(_0x2ac71f,null))[_0x5400('0x28')](saveUpdates(_0x2aa999[_0x5400('0x4c')],null))[_0x5400('0x28')](respondWithResult(_0x2ac71f,null))['catch'](handleError(_0x2ac71f,null));};exports[_0x5400('0x4e')]=function(_0x30d95c,_0x1e9da8){return db[_0x5400('0x2f')]['find']({'where':{'id':_0x30d95c[_0x5400('0x48')]['id']}})[_0x5400('0x28')](handleEntityNotFound(_0x1e9da8,null))['then'](removeEntity(_0x1e9da8,null))[_0x5400('0x47')](handleError(_0x1e9da8,null));};exports['describe']=function(_0x503c3e,_0x4ed620){return db[_0x5400('0x2f')][_0x5400('0x4f')]()['then'](respondWithResult(_0x4ed620,null))[_0x5400('0x47')](handleError(_0x4ed620,null));}; \ No newline at end of file +var _0x3112=['fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','save','update','then','stack','name','send','index','map','VoiceDialReport','rawAttributes','fieldName','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','type','merge','options','includeAll','include','rows','catch','params','find','create','body','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs'];(function(_0x27e811,_0x20137c){var _0x1627fa=function(_0x4498ca){while(--_0x4498ca){_0x27e811['push'](_0x27e811['shift']());}};_0x1627fa(++_0x20137c);}(_0x3112,0x123));var _0x2311=function(_0x12d417,_0x3c6b61){_0x12d417=_0x12d417-0x0;var _0x4f43dc=_0x3112[_0x12d417];return _0x4f43dc;};'use strict';var emlformat=require(_0x2311('0x0'));var rimraf=require(_0x2311('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2311('0x2'));var rp=require(_0x2311('0x3'));var moment=require('moment');var BPromise=require(_0x2311('0x4'));var Mustache=require(_0x2311('0x5'));var util=require(_0x2311('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x2311('0x7'));var ejs=require(_0x2311('0x8'));var fs=require('fs');var fs_extra=require(_0x2311('0x9'));var _=require(_0x2311('0xa'));var squel=require(_0x2311('0xb'));var crypto=require('crypto');var jsforce=require(_0x2311('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x2311('0x7'));var querystring=require(_0x2311('0xd'));var Papa=require(_0x2311('0xe'));var Redis=require(_0x2311('0xf'));var authService=require(_0x2311('0x10'));var qs=require(_0x2311('0x11'));var as=require(_0x2311('0x12'));var hardwareService=require(_0x2311('0x13'));var logger=require(_0x2311('0x14'))(_0x2311('0x15'));var utils=require(_0x2311('0x16'));var config=require(_0x2311('0x17'));var licenseUtil=require(_0x2311('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe7ba63,_0x2ce726){_0x2ce726=_0x2ce726||0xcc;return function(_0x406f82){if(_0x406f82){return _0xe7ba63[_0x2311('0x19')](_0x2ce726);}return _0xe7ba63[_0x2311('0x1a')](_0x2ce726)[_0x2311('0x1b')]();};}function respondWithResult(_0x515352,_0x5a9211){_0x5a9211=_0x5a9211||0xc8;return function(_0x5dfeb1){if(_0x5dfeb1){return _0x515352['status'](_0x5a9211)['json'](_0x5dfeb1);}};}function respondWithFilteredResult(_0x9c02f7,_0x938fad){return function(_0x4599da){if(_0x4599da){var _0x12adba=typeof _0x938fad[_0x2311('0x1c')]===_0x2311('0x1d')&&typeof _0x938fad['limit']==='undefined';var _0x263b31=_0x4599da['count'];var _0x144489=_0x12adba?0x0:_0x938fad[_0x2311('0x1c')];var _0x207f5e=_0x12adba?_0x4599da[_0x2311('0x1e')]:_0x938fad['offset']+_0x938fad['limit'];var _0x100327;if(_0x207f5e>=_0x263b31){_0x207f5e=_0x263b31;_0x100327=0xc8;}else{_0x100327=0xce;}_0x9c02f7[_0x2311('0x1a')](_0x100327);return _0x9c02f7[_0x2311('0x1f')](_0x2311('0x20'),_0x144489+'-'+_0x207f5e+'/'+_0x263b31)[_0x2311('0x21')](_0x4599da);}return null;};}function patchUpdates(_0x1a9137){return function(_0x1e0d36){try{jsonpatch['apply'](_0x1e0d36,_0x1a9137,!![]);}catch(_0x13e26f){return BPromise['reject'](_0x13e26f);}return _0x1e0d36[_0x2311('0x22')]();};}function saveUpdates(_0x58c04a,_0x596cd3){return function(_0x9550a6){if(_0x9550a6){return _0x9550a6[_0x2311('0x23')](_0x58c04a)[_0x2311('0x24')](function(_0x4b6b05){return _0x4b6b05;});}return null;};}function removeEntity(_0x1e8812,_0x49e809){return function(_0x5d2686){if(_0x5d2686){return _0x5d2686['destroy']()[_0x2311('0x24')](function(){_0x1e8812[_0x2311('0x1a')](0xcc)[_0x2311('0x1b')]();});}};}function handleEntityNotFound(_0x3bd5d2,_0x242ec2){return function(_0xfe58ee){if(!_0xfe58ee){_0x3bd5d2[_0x2311('0x19')](0x194);}return _0xfe58ee;};}function handleError(_0x681740,_0x2ba1c2){_0x2ba1c2=_0x2ba1c2||0x1f4;return function(_0x1489f1){logger['error'](_0x1489f1[_0x2311('0x25')]);if(_0x1489f1['name']){delete _0x1489f1[_0x2311('0x26')];}_0x681740[_0x2311('0x1a')](_0x2ba1c2)[_0x2311('0x27')](_0x1489f1);};}exports[_0x2311('0x28')]=function(_0x348344,_0x5c588e){var _0xe274e1={},_0x550cb5={},_0x1106c8={'count':0x0,'rows':[]};var _0x575c2d=_[_0x2311('0x29')](db[_0x2311('0x2a')][_0x2311('0x2b')],function(_0x1dfd24){return{'name':_0x1dfd24[_0x2311('0x2c')],'type':_0x1dfd24['type'][_0x2311('0x2d')]};});_0x550cb5['model']=_[_0x2311('0x29')](_0x575c2d,_0x2311('0x26'));_0x550cb5[_0x2311('0x2e')]=_[_0x2311('0x2f')](_0x348344[_0x2311('0x2e')]);_0x550cb5['filters']=_[_0x2311('0x30')](_0x550cb5[_0x2311('0x31')],_0x550cb5[_0x2311('0x2e')]);_0xe274e1[_0x2311('0x32')]=_['intersection'](_0x550cb5['model'],qs[_0x2311('0x33')](_0x348344['query'][_0x2311('0x33')]));_0xe274e1[_0x2311('0x32')]=_0xe274e1[_0x2311('0x32')][_0x2311('0x34')]?_0xe274e1[_0x2311('0x32')]:_0x550cb5[_0x2311('0x31')];if(!_0x348344[_0x2311('0x2e')][_0x2311('0x35')](_0x2311('0x36'))){_0xe274e1['limit']=qs[_0x2311('0x37')](_0x348344[_0x2311('0x2e')][_0x2311('0x37')]);_0xe274e1[_0x2311('0x1c')]=qs['offset'](_0x348344[_0x2311('0x2e')]['offset']);}_0xe274e1[_0x2311('0x38')]=qs[_0x2311('0x39')](_0x348344[_0x2311('0x2e')]['sort']);_0xe274e1[_0x2311('0x3a')]=qs[_0x2311('0x3b')](_[_0x2311('0x3c')](_0x348344[_0x2311('0x2e')],_0x550cb5['filters']),_0x575c2d);if(_0x348344[_0x2311('0x2e')][_0x2311('0x3d')]){_0xe274e1[_0x2311('0x3a')]=_['merge'](_0xe274e1[_0x2311('0x3a')],{'$or':_[_0x2311('0x29')](_0x575c2d,function(_0x521067){if(_0x521067[_0x2311('0x3e')]!=='VIRTUAL'){var _0x1d9d3e={};_0x1d9d3e[_0x521067['name']]={'$like':'%'+_0x348344[_0x2311('0x2e')][_0x2311('0x3d')]+'%'};return _0x1d9d3e;}})});}_0xe274e1=_[_0x2311('0x3f')]({},_0xe274e1,_0x348344[_0x2311('0x40')]);var _0x3d521e={'where':_0xe274e1[_0x2311('0x3a')]};return db[_0x2311('0x2a')][_0x2311('0x1e')](_0x3d521e)[_0x2311('0x24')](function(_0x2ad38a){_0x1106c8['count']=_0x2ad38a;if(_0x348344[_0x2311('0x2e')][_0x2311('0x41')]){_0xe274e1[_0x2311('0x42')]=[{'all':!![]}];}return db[_0x2311('0x2a')]['findAll'](_0xe274e1);})[_0x2311('0x24')](function(_0x38811a){_0x1106c8[_0x2311('0x43')]=_0x38811a;return _0x1106c8;})[_0x2311('0x24')](respondWithFilteredResult(_0x5c588e,_0xe274e1))[_0x2311('0x44')](handleError(_0x5c588e,null));};exports['show']=function(_0x4c2517,_0x377cd0){var _0x487486={'raw':!![],'where':{'id':_0x4c2517[_0x2311('0x45')]['id']}},_0x4388f0={};_0x4388f0['model']=_[_0x2311('0x2f')](db[_0x2311('0x2a')][_0x2311('0x2b')]);_0x4388f0['query']=_[_0x2311('0x2f')](_0x4c2517[_0x2311('0x2e')]);_0x4388f0[_0x2311('0x3b')]=_[_0x2311('0x30')](_0x4388f0['model'],_0x4388f0[_0x2311('0x2e')]);_0x487486[_0x2311('0x32')]=_[_0x2311('0x30')](_0x4388f0['model'],qs[_0x2311('0x33')](_0x4c2517[_0x2311('0x2e')]['fields']));_0x487486[_0x2311('0x32')]=_0x487486[_0x2311('0x32')][_0x2311('0x34')]?_0x487486[_0x2311('0x32')]:_0x4388f0['model'];if(_0x4c2517['query'][_0x2311('0x41')]){_0x487486['include']=[{'all':!![]}];}_0x487486=_[_0x2311('0x3f')]({},_0x487486,_0x4c2517['options']);return db[_0x2311('0x2a')][_0x2311('0x46')](_0x487486)[_0x2311('0x24')](handleEntityNotFound(_0x377cd0,null))[_0x2311('0x24')](respondWithResult(_0x377cd0,null))[_0x2311('0x44')](handleError(_0x377cd0,null));};exports['create']=function(_0x490b47,_0x49a2f6){return db[_0x2311('0x2a')][_0x2311('0x47')](_0x490b47[_0x2311('0x48')],{})[_0x2311('0x24')](respondWithResult(_0x49a2f6,0xc9))[_0x2311('0x44')](handleError(_0x49a2f6,null));};exports[_0x2311('0x23')]=function(_0x2ff670,_0x380937){if(_0x2ff670[_0x2311('0x48')]['id']){delete _0x2ff670['body']['id'];}return db[_0x2311('0x2a')]['find']({'where':{'id':_0x2ff670['params']['id']}})[_0x2311('0x24')](handleEntityNotFound(_0x380937,null))[_0x2311('0x24')](saveUpdates(_0x2ff670[_0x2311('0x48')],null))['then'](respondWithResult(_0x380937,null))['catch'](handleError(_0x380937,null));};exports[_0x2311('0x49')]=function(_0x1d143f,_0x3951e0){return db[_0x2311('0x2a')][_0x2311('0x46')]({'where':{'id':_0x1d143f['params']['id']}})[_0x2311('0x24')](handleEntityNotFound(_0x3951e0,null))[_0x2311('0x24')](removeEntity(_0x3951e0,null))[_0x2311('0x44')](handleError(_0x3951e0,null));};exports[_0x2311('0x4a')]=function(_0x2ef837,_0xc5f8fb){return db[_0x2311('0x2a')]['describe']()['then'](respondWithResult(_0xc5f8fb,null))['catch'](handleError(_0xc5f8fb,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 2d90c57..64f6437 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 _0x65c7=['../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./voiceDialReport.attributes','exports','VoiceDialReport','report_dial','uniqueid','util'];(function(_0x3e8270,_0x293590){var _0x1ccde9=function(_0x213490){while(--_0x213490){_0x3e8270['push'](_0x3e8270['shift']());}};_0x1ccde9(++_0x293590);}(_0x65c7,0x137));var _0x765c=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x65c7[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require(_0x765c('0x0'));var logger=require(_0x765c('0x1'))(_0x765c('0x2'));var moment=require(_0x765c('0x3'));var BPromise=require('bluebird');var rp=require(_0x765c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x765c('0x5'));var config=require(_0x765c('0x6'));var attributes=require(_0x765c('0x7'));module[_0x765c('0x8')]=function(_0x3a127b,_0x87e37f){return _0x3a127b['define'](_0x765c('0x9'),attributes,{'tableName':_0x765c('0xa'),'paranoid':![],'indexes':[{'fields':[_0x765c('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0a25=['./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','uniqueid','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x37fc62,_0x5120f9){var _0x58109b=function(_0x2a16a4){while(--_0x2a16a4){_0x37fc62['push'](_0x37fc62['shift']());}};_0x58109b(++_0x5120f9);}(_0x0a25,0x68));var _0x50a2=function(_0x320f22,_0x488293){_0x320f22=_0x320f22-0x0;var _0x281311=_0x0a25[_0x320f22];return _0x281311;};'use strict';var _=require(_0x50a2('0x0'));var util=require(_0x50a2('0x1'));var logger=require('../../config/logger')(_0x50a2('0x2'));var moment=require(_0x50a2('0x3'));var BPromise=require('bluebird');var rp=require(_0x50a2('0x4'));var fs=require('fs');var path=require(_0x50a2('0x5'));var rimraf=require(_0x50a2('0x6'));var config=require(_0x50a2('0x7'));var attributes=require(_0x50a2('0x8'));module[_0x50a2('0x9')]=function(_0x33fef7,_0x8b6ba4){return _0x33fef7[_0x50a2('0xa')](_0x50a2('0xb'),attributes,{'tableName':_0x50a2('0xc'),'paranoid':![],'indexes':[{'fields':[_0x50a2('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 2d88828..0972575 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 _0xbacd=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','error','VoiceDialReport,\x20%s,\x20%s','message','result','CreateVoiceDialReport','VoiceDialReport','create','options','raw','stringify','catch','UpdateVoiceDialReport','update','body','attributes','limit','lodash','util','bluebird','randomstring','ioredis'];(function(_0xba32bb,_0x451331){var _0x14eb0d=function(_0x4062be){while(--_0x4062be){_0xba32bb['push'](_0xba32bb['shift']());}};_0x14eb0d(++_0x451331);}(_0xbacd,0x103));var _0xdbac=function(_0x3b37e9,_0x4fb60){_0x3b37e9=_0x3b37e9-0x0;var _0x381481=_0xbacd[_0x3b37e9];return _0x381481;};'use strict';var _=require(_0xdbac('0x0'));var util=require(_0xdbac('0x1'));var moment=require('moment');var BPromise=require(_0xdbac('0x2'));var rs=require(_0xdbac('0x3'));var fs=require('fs');var Redis=require(_0xdbac('0x4'));var db=require(_0xdbac('0x5'))['db'];var utils=require(_0xdbac('0x6'));var logger=require(_0xdbac('0x7'))(_0xdbac('0x8'));var config=require('../../config/environment');var jayson=require(_0xdbac('0x9'));var client=jayson[_0xdbac('0xa')][_0xdbac('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x62d381,_0xfcffa1,_0x1ba50a){return new BPromise(function(_0x277a8a,_0x5d6446){return client['request'](_0x62d381,_0x1ba50a)[_0xdbac('0xc')](function(_0x1e4bef){logger[_0xdbac('0xd')]('VoiceDialReport,\x20%s,\x20%s',_0xfcffa1,_0xdbac('0xe'));logger[_0xdbac('0xf')](_0xdbac('0x10'),_0xfcffa1,_0xdbac('0xe'),JSON['stringify'](_0x1e4bef));if(_0x1e4bef['error']){if(_0x1e4bef[_0xdbac('0x11')]['code']===0x1f4){logger['error'](_0xdbac('0x12'),_0xfcffa1,_0x1e4bef[_0xdbac('0x11')][_0xdbac('0x13')]);return _0x5d6446(_0x1e4bef[_0xdbac('0x11')][_0xdbac('0x13')]);}logger[_0xdbac('0x11')](_0xdbac('0x12'),_0xfcffa1,_0x1e4bef[_0xdbac('0x11')][_0xdbac('0x13')]);return _0x277a8a(_0x1e4bef['error'][_0xdbac('0x13')]);}else{logger[_0xdbac('0xd')](_0xdbac('0x12'),_0xfcffa1,_0xdbac('0xe'));_0x277a8a(_0x1e4bef[_0xdbac('0x14')][_0xdbac('0x13')]);}})['catch'](function(_0x15c951){logger['error'](_0xdbac('0x12'),_0xfcffa1,_0x15c951);_0x5d6446(_0x15c951);});});}exports[_0xdbac('0x15')]=function(_0x1061b9){var _0x2be56c=this;return new Promise(function(_0x25d02b,_0x56f80d){return db[_0xdbac('0x16')][_0xdbac('0x17')](_0x1061b9['body'],{'raw':_0x1061b9[_0xdbac('0x18')]?_0x1061b9[_0xdbac('0x18')][_0xdbac('0x19')]===undefined?!![]:![]:!![]})[_0xdbac('0xc')](function(_0x5e0ca2){logger['info']('CreateVoiceDialReport',_0x1061b9);logger['debug'](_0xdbac('0x15'),_0x1061b9,JSON[_0xdbac('0x1a')](_0x5e0ca2));_0x25d02b(_0x5e0ca2);})[_0xdbac('0x1b')](function(_0x91f8db){logger[_0xdbac('0x11')](_0xdbac('0x15'),_0x91f8db[_0xdbac('0x13')],_0x1061b9);_0x56f80d(_0x2be56c[_0xdbac('0x11')](0x1f4,_0x91f8db[_0xdbac('0x13')]));});});};exports[_0xdbac('0x1c')]=function(_0x71122b){var _0x2a0e89=this;return new Promise(function(_0xe9754c,_0x241c0d){return db[_0xdbac('0x16')][_0xdbac('0x1d')](_0x71122b[_0xdbac('0x1e')],{'raw':_0x71122b[_0xdbac('0x18')]?_0x71122b['options'][_0xdbac('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x71122b[_0xdbac('0x18')]?_0x71122b['options']['where']||null:null,'attributes':_0x71122b[_0xdbac('0x18')]?_0x71122b['options'][_0xdbac('0x1f')]||null:null,'limit':_0x71122b[_0xdbac('0x18')]?_0x71122b[_0xdbac('0x18')][_0xdbac('0x20')]||null:null})[_0xdbac('0xc')](function(_0x423469){logger[_0xdbac('0xd')](_0xdbac('0x1c'),_0x71122b);logger[_0xdbac('0xf')](_0xdbac('0x1c'),_0x71122b,JSON[_0xdbac('0x1a')](_0x423469));_0xe9754c(_0x423469);})[_0xdbac('0x1b')](function(_0x27d471){logger[_0xdbac('0x11')](_0xdbac('0x1c'),_0x27d471['message'],_0x71122b);_0x241c0d(_0x2a0e89['error'](0x1f4,_0x27d471['message']));});});}; \ No newline at end of file +var _0x5b45=['then','VoiceDialReport','update','where','attributes','limit','UpdateVoiceDialReport','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','info','VoiceDialReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','CreateVoiceDialReport','create','body','options','raw'];(function(_0x3d85cc,_0x68aa5e){var _0xb342b=function(_0x185746){while(--_0x185746){_0x3d85cc['push'](_0x3d85cc['shift']());}};_0xb342b(++_0x68aa5e);}(_0x5b45,0x147));var _0x55b4=function(_0x39e283,_0x247e6b){_0x39e283=_0x39e283-0x0;var _0x7de89f=_0x5b45[_0x39e283];return _0x7de89f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x55b4('0x0'));var BPromise=require(_0x55b4('0x1'));var rs=require(_0x55b4('0x2'));var fs=require('fs');var Redis=require(_0x55b4('0x3'));var db=require(_0x55b4('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x55b4('0x5'))(_0x55b4('0x6'));var config=require(_0x55b4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x55b4('0x8')][_0x55b4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x42a7e6,_0x436078,_0x1c2d5d){return new BPromise(function(_0x4d0b9a,_0x1faa79){return client[_0x55b4('0xa')](_0x42a7e6,_0x1c2d5d)['then'](function(_0x21877b){logger[_0x55b4('0xb')](_0x55b4('0xc'),_0x436078,'request\x20sent');logger[_0x55b4('0xd')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x436078,_0x55b4('0xe'),JSON[_0x55b4('0xf')](_0x21877b));if(_0x21877b['error']){if(_0x21877b[_0x55b4('0x10')]['code']===0x1f4){logger[_0x55b4('0x10')](_0x55b4('0xc'),_0x436078,_0x21877b[_0x55b4('0x10')]['message']);return _0x1faa79(_0x21877b[_0x55b4('0x10')][_0x55b4('0x11')]);}logger[_0x55b4('0x10')](_0x55b4('0xc'),_0x436078,_0x21877b['error'][_0x55b4('0x11')]);return _0x4d0b9a(_0x21877b[_0x55b4('0x10')][_0x55b4('0x11')]);}else{logger['info'](_0x55b4('0xc'),_0x436078,_0x55b4('0xe'));_0x4d0b9a(_0x21877b[_0x55b4('0x12')]['message']);}})[_0x55b4('0x13')](function(_0x4eab1c){logger[_0x55b4('0x10')](_0x55b4('0xc'),_0x436078,_0x4eab1c);_0x1faa79(_0x4eab1c);});});}exports[_0x55b4('0x14')]=function(_0x492ea9){var _0x3c77da=this;return new Promise(function(_0x3fe9de,_0x58ee1c){return db['VoiceDialReport'][_0x55b4('0x15')](_0x492ea9[_0x55b4('0x16')],{'raw':_0x492ea9[_0x55b4('0x17')]?_0x492ea9[_0x55b4('0x17')][_0x55b4('0x18')]===undefined?!![]:![]:!![]})[_0x55b4('0x19')](function(_0x5dfa35){logger[_0x55b4('0xb')]('CreateVoiceDialReport',_0x492ea9);logger['debug'](_0x55b4('0x14'),_0x492ea9,JSON[_0x55b4('0xf')](_0x5dfa35));_0x3fe9de(_0x5dfa35);})[_0x55b4('0x13')](function(_0x3aa7dd){logger[_0x55b4('0x10')](_0x55b4('0x14'),_0x3aa7dd[_0x55b4('0x11')],_0x492ea9);_0x58ee1c(_0x3c77da[_0x55b4('0x10')](0x1f4,_0x3aa7dd['message']));});});};exports['UpdateVoiceDialReport']=function(_0x5608c7){var _0x77fc1b=this;return new Promise(function(_0x265025,_0x4dc1a2){return db[_0x55b4('0x1a')][_0x55b4('0x1b')](_0x5608c7[_0x55b4('0x16')],{'raw':_0x5608c7[_0x55b4('0x17')]?_0x5608c7['options'][_0x55b4('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5608c7[_0x55b4('0x17')]?_0x5608c7[_0x55b4('0x17')][_0x55b4('0x1c')]||null:null,'attributes':_0x5608c7[_0x55b4('0x17')]?_0x5608c7[_0x55b4('0x17')][_0x55b4('0x1d')]||null:null,'limit':_0x5608c7[_0x55b4('0x17')]?_0x5608c7[_0x55b4('0x17')][_0x55b4('0x1e')]||null:null})['then'](function(_0x5c9129){logger[_0x55b4('0xb')](_0x55b4('0x1f'),_0x5608c7);logger[_0x55b4('0xd')](_0x55b4('0x1f'),_0x5608c7,JSON[_0x55b4('0xf')](_0x5c9129));_0x265025(_0x5c9129);})[_0x55b4('0x13')](function(_0x56f046){logger['error'](_0x55b4('0x1f'),_0x56f046[_0x55b4('0x11')],_0x5608c7);_0x4dc1a2(_0x77fc1b[_0x55b4('0x10')](0x1f4,_0x56f046[_0x55b4('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 0107403..4459db8 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 _0x0fe9=['../../config/environment','get','isAuthenticated','create','post','/:id/applications','addApplications','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3f5415,_0x281c73){var _0x1892d9=function(_0x224867){while(--_0x224867){_0x3f5415['push'](_0x3f5415['shift']());}};_0x1892d9(++_0x281c73);}(_0x0fe9,0x19c));var _0x90fe=function(_0x1e56bd,_0x42e6a2){_0x1e56bd=_0x1e56bd-0x0;var _0x35aded=_0x0fe9[_0x1e56bd];return _0x35aded;};'use strict';var multer=require(_0x90fe('0x0'));var util=require(_0x90fe('0x1'));var path=require(_0x90fe('0x2'));var timeout=require(_0x90fe('0x3'));var express=require('express');var router=express[_0x90fe('0x4')]();var fs_extra=require(_0x90fe('0x5'));var auth=require(_0x90fe('0x6'));var interaction=require(_0x90fe('0x7'));var config=require(_0x90fe('0x8'));var controller=require('./voiceExtension.controller');router[_0x90fe('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0x90fe('0xa')](),controller['show']);router['post']('/',auth[_0x90fe('0xa')](),controller[_0x90fe('0xb')]);router[_0x90fe('0xc')](_0x90fe('0xd'),auth[_0x90fe('0xa')](),controller[_0x90fe('0xe')]);router[_0x90fe('0xf')](_0x90fe('0x10'),auth[_0x90fe('0xa')](),controller[_0x90fe('0x11')]);router[_0x90fe('0x12')](_0x90fe('0x10'),auth[_0x90fe('0xa')](),controller[_0x90fe('0x13')]);module[_0x90fe('0x14')]=router; \ No newline at end of file +var _0x8798=['update','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','show','post','create','/:id/applications','addApplications','put','/:id'];(function(_0x5a7b07,_0x2c211d){var _0x44a6c8=function(_0x3b70d0){while(--_0x3b70d0){_0x5a7b07['push'](_0x5a7b07['shift']());}};_0x44a6c8(++_0x2c211d);}(_0x8798,0x1bb));var _0x8879=function(_0x448acf,_0x258f08){_0x448acf=_0x448acf-0x0;var _0x4766f0=_0x8798[_0x448acf];return _0x4766f0;};'use strict';var multer=require(_0x8879('0x0'));var util=require(_0x8879('0x1'));var path=require('path');var timeout=require(_0x8879('0x2'));var express=require(_0x8879('0x3'));var router=express['Router']();var fs_extra=require(_0x8879('0x4'));var auth=require(_0x8879('0x5'));var interaction=require(_0x8879('0x6'));var config=require(_0x8879('0x7'));var controller=require(_0x8879('0x8'));router[_0x8879('0x9')]('/',auth[_0x8879('0xa')](),controller[_0x8879('0xb')]);router[_0x8879('0x9')]('/:id',auth[_0x8879('0xa')](),controller[_0x8879('0xc')]);router[_0x8879('0xd')]('/',auth[_0x8879('0xa')](),controller[_0x8879('0xe')]);router[_0x8879('0xd')](_0x8879('0xf'),auth[_0x8879('0xa')](),controller[_0x8879('0x10')]);router[_0x8879('0x11')](_0x8879('0x12'),auth[_0x8879('0xa')](),controller[_0x8879('0x13')]);router['delete'](_0x8879('0x12'),auth[_0x8879('0xa')](),controller[_0x8879('0x14')]);module[_0x8879('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 03fb01d..8b2687d 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 _0xeece=['inbound-fax','outbound-fax','system','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','sequelize','exports','STRING','compositeIndex','NoOp','ENUM','inbound','outbound'];(function(_0x504d0e,_0x56b84b){var _0x5f408a=function(_0x396c76){while(--_0x396c76){_0x504d0e['push'](_0x504d0e['shift']());}};_0x5f408a(++_0x56b84b);}(_0xeece,0x1a1));var _0xeeec=function(_0x3f415c,_0x310f72){_0x3f415c=_0x3f415c-0x0;var _0x8f2df8=_0xeece[_0x3f415c];return _0x8f2df8;};'use strict';var Sequelize=require(_0xeeec('0x0'));module[_0xeeec('0x1')]={'context':{'type':Sequelize[_0xeeec('0x2')],'allowNull':![],'unique':_0xeeec('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xeeec('0x3')},'priority':{'type':Sequelize[_0xeeec('0x2')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0xeeec('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xeeec('0x2')],'allowNull':![],'defaultValue':_0xeeec('0x4')},'appdata':{'type':Sequelize[_0xeeec('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xeeec('0x5')](_0xeeec('0x6'),_0xeeec('0x7'),'internal',_0xeeec('0x8'),_0xeeec('0x9'),_0xeeec('0xa'),'any'),'allowNull':![]},'description':{'type':Sequelize[_0xeeec('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xeeec('0xb')},'IntervalId':{'type':Sequelize[_0xeeec('0xc')]},'isApp':{'type':Sequelize[_0xeeec('0xd')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xeeec('0x2')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xeeec('0xc')]},'recordingFormat':{'type':Sequelize[_0xeeec('0x2')],'defaultValue':_0xeeec('0xe')},'answer':{'type':Sequelize[_0xeeec('0xd')],'defaultValue':!![]},'name':{'type':Sequelize[_0xeeec('0xf')],'get':function(_0x57c13c){return this[_0xeeec('0x10')]('exten');}},'alias':{'type':Sequelize[_0xeeec('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x9326=['any','*,*,*,*','BOOLEAN','VIRTUAL','getDataValue','exten','sequelize','exports','compositeIndex','STRING','inbound','outbound','internal','inbound-fax','outbound-fax','system'];(function(_0x117994,_0x46bbbb){var _0x40814a=function(_0x5e88ca){while(--_0x5e88ca){_0x117994['push'](_0x117994['shift']());}};_0x40814a(++_0x46bbbb);}(_0x9326,0x186));var _0x6932=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x9326[_0x3ff085];return _0x2b68c3;};'use strict';var Sequelize=require(_0x6932('0x0'));module[_0x6932('0x1')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x6932('0x2')},'priority':{'type':Sequelize[_0x6932('0x3')],'allowNull':![],'defaultValue':'1','unique':_0x6932('0x2')},'tag':{'type':Sequelize[_0x6932('0x3')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x6932('0x3')],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x6932('0x4'),_0x6932('0x5'),_0x6932('0x6'),_0x6932('0x7'),_0x6932('0x8'),_0x6932('0x9'),_0x6932('0xa')),'allowNull':![]},'description':{'type':Sequelize[_0x6932('0x3')]},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6932('0xb')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0x6932('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x6932('0x3')],'defaultValue':null},'callerID':{'type':Sequelize[_0x6932('0x3')],'allowNull':!![]},'record':{'type':Sequelize[_0x6932('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0x6932('0x3')],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x6932('0xc')],'defaultValue':!![]},'name':{'type':Sequelize[_0x6932('0xd')],'get':function(_0x446479){return this[_0x6932('0xe')](_0x6932('0xf'));}},'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 d17fa5f..9a93a83 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 _0x945f=['sendStatus','error','stack','index','VoiceExtension','rawAttributes','fieldName','model','query','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filters','filter','merge','options','includeAll','include','rows','catch','show','params','keys','find','create','startsWith','body','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','OutboundRoutes','outbound','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','description','recordingFormat','cutdigits','mandatoryDisposition','addApplications','transaction','sequelize','READ_COMMITTED','findOne','isApp','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','send','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','status','end','json','offset','limit','undefined','count','set','Content-Range','destroy','then','get','InboundRoutes','inbound','InternalRoutes','internal','map','value','includes','type','name','UserProfileResource'];(function(_0x392195,_0x3f84e8){var _0x2cd2a4=function(_0x21376b){while(--_0x21376b){_0x392195['push'](_0x392195['shift']());}};_0x2cd2a4(++_0x3f84e8);}(_0x945f,0x93));var _0xf945=function(_0x4c05c0,_0x271d45){_0x4c05c0=_0x4c05c0-0x0;var _0x43a1d4=_0x945f[_0x4c05c0];return _0x43a1d4;};'use strict';var _=require(_0xf945('0x0'));var Redis=require(_0xf945('0x1'));var qs=require(_0xf945('0x2'));var logger=require(_0xf945('0x3'))(_0xf945('0x4'));var config=require(_0xf945('0x5'));var db=require(_0xf945('0x6'))['db'];config[_0xf945('0x7')]=_[_0xf945('0x8')](config['redis'],{'host':_0xf945('0x9'),'port':0x18eb});var socket=require(_0xf945('0xa'))(new Redis(config['redis']));require(_0xf945('0xb'))[_0xf945('0xc')](socket);function respondWithStatusCode(_0x2940e7,_0x7c4a2f){_0x7c4a2f=_0x7c4a2f||0xcc;return function(_0x1b6bb3){if(_0x1b6bb3){return _0x2940e7['sendStatus'](_0x7c4a2f);}return _0x2940e7[_0xf945('0xd')](_0x7c4a2f)[_0xf945('0xe')]();};}function respondWithResult(_0x298536,_0x347a07){_0x347a07=_0x347a07||0xc8;return function(_0x34ad06){if(_0x34ad06){return _0x298536['status'](_0x347a07)[_0xf945('0xf')](_0x34ad06);}};}function respondWithFilteredResult(_0x1695ea,_0x1ed5fa){return function(_0x9958e2){if(_0x9958e2){var _0x57a59b=typeof _0x1ed5fa[_0xf945('0x10')]==='undefined'&&typeof _0x1ed5fa[_0xf945('0x11')]===_0xf945('0x12');var _0x4a7061=_0x9958e2[_0xf945('0x13')];var _0x5a21ee=_0x57a59b?0x0:_0x1ed5fa[_0xf945('0x10')];var _0x2a9cde=_0x57a59b?_0x9958e2['count']:_0x1ed5fa['offset']+_0x1ed5fa[_0xf945('0x11')];var _0x177796;if(_0x2a9cde>=_0x4a7061){_0x2a9cde=_0x4a7061;_0x177796=0xc8;}else{_0x177796=0xce;}_0x1695ea[_0xf945('0xd')](_0x177796);return _0x1695ea[_0xf945('0x14')](_0xf945('0x15'),_0x5a21ee+'-'+_0x2a9cde+'/'+_0x4a7061)[_0xf945('0xf')](_0x9958e2);}return null;};}function removeEntity(_0xaedc36){return function(_0x496fba){if(_0x496fba){return _0x496fba[_0xf945('0x16')]()[_0xf945('0x17')](function(){var _0x25d096=_0x496fba[_0xf945('0x18')]({'plain':!![]});var _0x39ad72=[{'name':_0xf945('0x19'),'value':_0xf945('0x1a'),'ignore':![]},{'name':'OutboundRoutes','value':'outbound','ignore':![]},{'name':_0xf945('0x1b'),'value':_0xf945('0x1c'),'ignore':![]}];var _0x1934c5=_(_0x39ad72)['filter']('ignore')[_0xf945('0x1d')](_0xf945('0x1e'))[_0xf945('0x1e')]();if(_[_0xf945('0x1f')](_0x1934c5,_0x25d096[_0xf945('0x20')])){return;}var _0x5cf2f7=_['find'](_0x39ad72,[_0xf945('0x1e'),_0x25d096[_0xf945('0x20')]])[_0xf945('0x21')];return db[_0xf945('0x22')][_0xf945('0x16')]({'where':{'type':_0x5cf2f7,'resourceId':_0x25d096['id']}})[_0xf945('0x17')](function(){return _0x496fba;});})[_0xf945('0x17')](function(){_0xaedc36[_0xf945('0xd')](0xcc)[_0xf945('0xe')]();});}};}function handleEntityNotFound(_0x57de52){return function(_0x1d76ca){if(!_0x1d76ca){_0x57de52[_0xf945('0x23')](0x194);}return _0x1d76ca;};}function handleError(_0x4679e2,_0x5cafd2){_0x5cafd2=_0x5cafd2||0x1f4;return function(_0x415d0e){logger[_0xf945('0x24')](_0x415d0e[_0xf945('0x25')]);if(_0x415d0e['name']){delete _0x415d0e[_0xf945('0x21')];}_0x4679e2[_0xf945('0xd')](_0x5cafd2)['send'](_0x415d0e);};}exports[_0xf945('0x26')]=function(_0x57091b,_0x223a88){var _0x373643={},_0x2b8f87={},_0x972860={'count':0x0,'rows':[]};var _0x3f432c=_['map'](db[_0xf945('0x27')][_0xf945('0x28')],function(_0x423596){return{'name':_0x423596[_0xf945('0x29')],'type':_0x423596[_0xf945('0x20')]['key']};});_0x2b8f87[_0xf945('0x2a')]=_['map'](_0x3f432c,_0xf945('0x21'));_0x2b8f87['query']=_['keys'](_0x57091b[_0xf945('0x2b')]);_0x2b8f87['filters']=_[_0xf945('0x2c')](_0x2b8f87['model'],_0x2b8f87['query']);_0x373643[_0xf945('0x2d')]=_[_0xf945('0x2c')](_0x2b8f87[_0xf945('0x2a')],qs[_0xf945('0x2e')](_0x57091b[_0xf945('0x2b')][_0xf945('0x2e')]));_0x373643[_0xf945('0x2d')]=_0x373643[_0xf945('0x2d')][_0xf945('0x2f')]?_0x373643[_0xf945('0x2d')]:_0x2b8f87[_0xf945('0x2a')];if(!_0x57091b[_0xf945('0x2b')][_0xf945('0x30')]('nolimit')){_0x373643['limit']=qs[_0xf945('0x11')](_0x57091b[_0xf945('0x2b')]['limit']);_0x373643[_0xf945('0x10')]=qs[_0xf945('0x10')](_0x57091b['query'][_0xf945('0x10')]);}_0x373643['order']=qs['sort'](_0x57091b[_0xf945('0x2b')][_0xf945('0x31')]);_0x373643[_0xf945('0x32')]=qs['filters'](_[_0xf945('0x33')](_0x57091b[_0xf945('0x2b')],_0x2b8f87[_0xf945('0x34')]),_0x3f432c);if(_0x57091b['query'][_0xf945('0x35')]){_0x373643[_0xf945('0x32')]=_[_0xf945('0x36')](_0x373643[_0xf945('0x32')],{'$or':_[_0xf945('0x1d')](_0x3f432c,function(_0x11dc79){if(_0x11dc79[_0xf945('0x20')]!=='VIRTUAL'){var _0x1d6665={};_0x1d6665[_0x11dc79[_0xf945('0x21')]]={'$like':'%'+_0x57091b[_0xf945('0x2b')][_0xf945('0x35')]+'%'};return _0x1d6665;}})});}_0x373643=_[_0xf945('0x36')]({},_0x373643,_0x57091b[_0xf945('0x37')]);var _0x315fef={'where':_0x373643['where']};return db['VoiceExtension'][_0xf945('0x13')](_0x315fef)[_0xf945('0x17')](function(_0x4fa5fc){_0x972860[_0xf945('0x13')]=_0x4fa5fc;if(_0x57091b[_0xf945('0x2b')][_0xf945('0x38')]){_0x373643[_0xf945('0x39')]=[{'all':!![]}];}return db[_0xf945('0x27')]['findAll'](_0x373643);})['then'](function(_0x3d0c69){_0x972860[_0xf945('0x3a')]=_0x3d0c69;return _0x972860;})['then'](respondWithFilteredResult(_0x223a88,_0x373643))[_0xf945('0x3b')](handleError(_0x223a88,null));};exports[_0xf945('0x3c')]=function(_0x21f12d,_0x35b813){var _0x49dd6b={'raw':![],'where':{'id':_0x21f12d[_0xf945('0x3d')]['id']}},_0x41ae2f={};_0x41ae2f[_0xf945('0x2a')]=_[_0xf945('0x3e')](db[_0xf945('0x27')][_0xf945('0x28')]);_0x41ae2f[_0xf945('0x2b')]=_[_0xf945('0x3e')](_0x21f12d[_0xf945('0x2b')]);_0x41ae2f[_0xf945('0x34')]=_[_0xf945('0x2c')](_0x41ae2f[_0xf945('0x2a')],_0x41ae2f['query']);_0x49dd6b[_0xf945('0x2d')]=_[_0xf945('0x2c')](_0x41ae2f[_0xf945('0x2a')],qs[_0xf945('0x2e')](_0x21f12d[_0xf945('0x2b')][_0xf945('0x2e')]));_0x49dd6b[_0xf945('0x2d')]=_0x49dd6b[_0xf945('0x2d')][_0xf945('0x2f')]?_0x49dd6b['attributes']:_0x41ae2f['model'];if(_0x21f12d[_0xf945('0x2b')][_0xf945('0x38')]){_0x49dd6b['include']=[{'all':!![]}];}_0x49dd6b=_[_0xf945('0x36')]({},_0x49dd6b,_0x21f12d[_0xf945('0x37')]);return db[_0xf945('0x27')][_0xf945('0x3f')](_0x49dd6b)['then'](handleEntityNotFound(_0x35b813,null))[_0xf945('0x17')](respondWithResult(_0x35b813,null))[_0xf945('0x3b')](handleError(_0x35b813,null));};exports[_0xf945('0x16')]=function(_0x48edd6,_0x1fa449){return db[_0xf945('0x27')][_0xf945('0x3f')]({'where':{'id':_0x48edd6[_0xf945('0x3d')]['id']}})[_0xf945('0x17')](handleEntityNotFound(_0x1fa449,null))['then'](removeEntity(_0x1fa449,null))[_0xf945('0x3b')](handleError(_0x1fa449,null));};exports[_0xf945('0x40')]=function(_0x3bbab6,_0x47bc4f){if(_0x3bbab6['body'][_0xf945('0x20')]==='outbound'&&!_[_0xf945('0x41')](_0x3bbab6[_0xf945('0x42')]['exten'],'_')){_0x3bbab6['body'][_0xf945('0x43')]='_'[_0xf945('0x44')](_0x3bbab6[_0xf945('0x42')][_0xf945('0x43')]);}return db[_0xf945('0x27')][_0xf945('0x40')](_0x3bbab6[_0xf945('0x42')],{'raw':![]})[_0xf945('0x17')](function(_0x88fc6b){var _0x3139f1=_0x3bbab6[_0xf945('0x45')]['get']({'plain':!![]});if(!_0x3139f1)throw new Error(_0xf945('0x46'));if(_0x3139f1['role']===_0xf945('0x45')){var _0x172900=_0x88fc6b[_0xf945('0x18')]({'plain':!![]});var _0x1aed2d=[{'name':'InboundRoutes','value':_0xf945('0x1a')},{'name':_0xf945('0x47'),'value':_0xf945('0x48')},{'name':_0xf945('0x1b'),'value':'internal'}];var _0x58bc72=_[_0xf945('0x3f')](_0x1aed2d,['value',_0x172900[_0xf945('0x20')]])[_0xf945('0x21')];return db['UserProfileSection'][_0xf945('0x3f')]({'where':{'name':_0x58bc72,'userProfileId':_0x3139f1['userProfileId']},'raw':!![]})['then'](function(_0x2f4783){if(_0x2f4783&&_0x2f4783['autoAssociation']===0x0){return db['UserProfileResource'][_0xf945('0x40')]({'name':_0x172900['name'],'resourceId':_0x172900['id'],'type':_0x2f4783['name'],'sectionId':_0x2f4783['id']},{})[_0xf945('0x17')](function(){return _0x88fc6b;});}else{return _0x88fc6b;}})['catch'](function(_0x1c3258){logger[_0xf945('0x24')](_0xf945('0x49'),_0x1c3258);throw _0x1c3258;});}return _0x88fc6b;})[_0xf945('0x17')](respondWithResult(_0x47bc4f,0xc9))[_0xf945('0x3b')](handleError(_0x47bc4f,null));};exports['update']=function(_0x53d7e6,_0x275e05){if(_0x53d7e6['body']['id']){delete _0x53d7e6[_0xf945('0x42')]['id'];}return db['VoiceExtension']['find']({'where':{'id':_0x53d7e6[_0xf945('0x3d')]['id']}})[_0xf945('0x17')](handleEntityNotFound(_0x275e05,null))[_0xf945('0x17')](function(_0x257d19){if(_0x257d19){return db['VoiceExtension']['update'](_[_0xf945('0x33')](_0x53d7e6['body'],[_0xf945('0x43'),_0xf945('0x4a'),_0xf945('0x4b'),_0xf945('0x4c'),_0xf945('0x4d'),_0xf945('0x4e'),'alias']),{'where':{'context':_0x257d19[_0xf945('0x4a')],'exten':_0x257d19[_0xf945('0x43')]},'individualHooks':!![]})['then'](function(_0x2458db){return _0x2458db;});}return null;})[_0xf945('0x17')](respondWithStatusCode(_0x275e05,null))['catch'](handleError(_0x275e05,null));};exports[_0xf945('0x4f')]=function(_0x495dd9,_0x7f2ca8){var _0x47040d=_0x495dd9['params']['id'];var _0x989343=_0x495dd9[_0xf945('0x42')];var _0x1a575b=0xc8;var _0x45e9a0=null;return db['sequelize'][_0xf945('0x50')]({'isolationLevel':db[_0xf945('0x51')]['Transaction']['ISOLATION_LEVELS'][_0xf945('0x52')]},function(_0x499505){return db['VoiceExtension'][_0xf945('0x53')]({'where':{'id':_0x47040d},'transaction':_0x499505})[_0xf945('0x17')](function(_0x6839d9){if(_0x6839d9){return db[_0xf945('0x27')][_0xf945('0x16')]({'where':{'VoiceExtensionId':_0x47040d},'transaction':_0x499505})[_0xf945('0x17')](function(){var _0xd94a7e=_['map'](_0x989343,function(_0x56dc96){_0x56dc96['VoiceExtensionId']=_0x47040d;_0x56dc96[_0xf945('0x54')]=!![];return _0x56dc96;});return _0x6839d9[_0xf945('0x55')](_0xd94a7e);})[_0xf945('0x17')](function(_0x4e56ab){return db['VoiceExtension'][_0xf945('0x56')](_0x4e56ab,{'transaction':_0x499505});});}else{_0x1a575b=0x194;_0x45e9a0=[];}});})['then'](function(){if(_0x1a575b!==0x194){return db[_0xf945('0x27')][_0xf945('0x57')]({'where':{'isApp':!![],'VoiceExtensionId':_0x47040d},'order':_0xf945('0x58')})[_0xf945('0x17')](function(_0x2e8e4b){_0x45e9a0=_0x2e8e4b;});}})[_0xf945('0x3b')](function(_0xb85088){_0x1a575b=0x1f4;logger['error'](_0xb85088[_0xf945('0x25')]);if(_0xb85088[_0xf945('0x21')]){delete _0xb85088[_0xf945('0x21')];}_0x45e9a0=_0xb85088;})[_0xf945('0x59')](function(){if(_0x45e9a0===null){_0x7f2ca8[_0xf945('0x23')](_0x1a575b);}else{if(_0x1a575b===0x1f4){_0x7f2ca8[_0xf945('0xd')](_0x1a575b)[_0xf945('0x5a')](_0x45e9a0);}else{_0x7f2ca8['status'](_0x1a575b)[_0xf945('0xf')](_0x45e9a0);}}});}; \ No newline at end of file +var _0x7a69=['finally','lodash','../../components/parsers/qs','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./voiceExtension.socket','register','sendStatus','end','status','json','undefined','count','limit','set','then','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','map','value','UserProfileResource','destroy','error','stack','name','send','index','VoiceExtension','rawAttributes','fieldName','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','pick','filters','where','options','includeAll','include','findAll','rows','catch','show','params','merge','find','create','startsWith','body','exten','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','type','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','description','recordingFormat','mandatoryDisposition','alias','sequelize','transaction','Transaction','ISOLATION_LEVELS','isApp','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)'];(function(_0x46dfaf,_0xead751){var _0x96581f=function(_0x51228b){while(--_0x51228b){_0x46dfaf['push'](_0x46dfaf['shift']());}};_0x96581f(++_0xead751);}(_0x7a69,0xb3));var _0x97a6=function(_0xae000b,_0x446647){_0xae000b=_0xae000b-0x0;var _0x4ee784=_0x7a69[_0xae000b];return _0x4ee784;};'use strict';var _=require(_0x97a6('0x0'));var Redis=require('ioredis');var qs=require(_0x97a6('0x1'));var logger=require('../../config/logger')('api');var config=require(_0x97a6('0x2'));var db=require(_0x97a6('0x3'))['db'];config[_0x97a6('0x4')]=_[_0x97a6('0x5')](config[_0x97a6('0x4')],{'host':'localhost','port':0x18eb});var socket=require(_0x97a6('0x6'))(new Redis(config[_0x97a6('0x4')]));require(_0x97a6('0x7'))[_0x97a6('0x8')](socket);function respondWithStatusCode(_0x1e3124,_0x395f77){_0x395f77=_0x395f77||0xcc;return function(_0x253c05){if(_0x253c05){return _0x1e3124[_0x97a6('0x9')](_0x395f77);}return _0x1e3124['status'](_0x395f77)[_0x97a6('0xa')]();};}function respondWithResult(_0x29a3c7,_0x1672bd){_0x1672bd=_0x1672bd||0xc8;return function(_0x3110c7){if(_0x3110c7){return _0x29a3c7[_0x97a6('0xb')](_0x1672bd)[_0x97a6('0xc')](_0x3110c7);}};}function respondWithFilteredResult(_0x520091,_0x104179){return function(_0x418a0c){if(_0x418a0c){var _0x527a3b=typeof _0x104179['offset']==='undefined'&&typeof _0x104179['limit']===_0x97a6('0xd');var _0x4449c8=_0x418a0c[_0x97a6('0xe')];var _0x56a2a5=_0x527a3b?0x0:_0x104179['offset'];var _0x3bc8d2=_0x527a3b?_0x418a0c[_0x97a6('0xe')]:_0x104179['offset']+_0x104179[_0x97a6('0xf')];var _0x6e3bcd;if(_0x3bc8d2>=_0x4449c8){_0x3bc8d2=_0x4449c8;_0x6e3bcd=0xc8;}else{_0x6e3bcd=0xce;}_0x520091[_0x97a6('0xb')](_0x6e3bcd);return _0x520091[_0x97a6('0x10')]('Content-Range',_0x56a2a5+'-'+_0x3bc8d2+'/'+_0x4449c8)[_0x97a6('0xc')](_0x418a0c);}return null;};}function removeEntity(_0x515736){return function(_0x5e783d){if(_0x5e783d){return _0x5e783d['destroy']()[_0x97a6('0x11')](function(){var _0x5a9316=_0x5e783d[_0x97a6('0x12')]({'plain':!![]});var _0x38da87=[{'name':_0x97a6('0x13'),'value':_0x97a6('0x14'),'ignore':![]},{'name':_0x97a6('0x15'),'value':_0x97a6('0x16'),'ignore':![]},{'name':_0x97a6('0x17'),'value':_0x97a6('0x18'),'ignore':![]}];var _0x26d7c3=_(_0x38da87)[_0x97a6('0x19')](_0x97a6('0x1a'))[_0x97a6('0x1b')](_0x97a6('0x1c'))['value']();if(_['includes'](_0x26d7c3,_0x5a9316['type'])){return;}var _0x357b1c=_['find'](_0x38da87,[_0x97a6('0x1c'),_0x5a9316['type']])['name'];return db[_0x97a6('0x1d')][_0x97a6('0x1e')]({'where':{'type':_0x357b1c,'resourceId':_0x5a9316['id']}})[_0x97a6('0x11')](function(){return _0x5e783d;});})['then'](function(){_0x515736[_0x97a6('0xb')](0xcc)[_0x97a6('0xa')]();});}};}function handleEntityNotFound(_0x53f76b){return function(_0x222cbe){if(!_0x222cbe){_0x53f76b[_0x97a6('0x9')](0x194);}return _0x222cbe;};}function handleError(_0x464b5f,_0x1e3081){_0x1e3081=_0x1e3081||0x1f4;return function(_0x3c71b6){logger[_0x97a6('0x1f')](_0x3c71b6[_0x97a6('0x20')]);if(_0x3c71b6[_0x97a6('0x21')]){delete _0x3c71b6['name'];}_0x464b5f[_0x97a6('0xb')](_0x1e3081)[_0x97a6('0x22')](_0x3c71b6);};}exports[_0x97a6('0x23')]=function(_0x2419da,_0x2333c0){var _0x4a5e11={},_0x3a8a44={},_0x3b5527={'count':0x0,'rows':[]};var _0x4dec93=_['map'](db[_0x97a6('0x24')][_0x97a6('0x25')],function(_0x2c7da4){return{'name':_0x2c7da4[_0x97a6('0x26')],'type':_0x2c7da4['type']['key']};});_0x3a8a44['model']=_['map'](_0x4dec93,_0x97a6('0x21'));_0x3a8a44[_0x97a6('0x27')]=_['keys'](_0x2419da['query']);_0x3a8a44['filters']=_[_0x97a6('0x28')](_0x3a8a44[_0x97a6('0x29')],_0x3a8a44['query']);_0x4a5e11[_0x97a6('0x2a')]=_[_0x97a6('0x28')](_0x3a8a44[_0x97a6('0x29')],qs[_0x97a6('0x2b')](_0x2419da['query']['fields']));_0x4a5e11[_0x97a6('0x2a')]=_0x4a5e11[_0x97a6('0x2a')][_0x97a6('0x2c')]?_0x4a5e11['attributes']:_0x3a8a44[_0x97a6('0x29')];if(!_0x2419da['query'][_0x97a6('0x2d')](_0x97a6('0x2e'))){_0x4a5e11['limit']=qs[_0x97a6('0xf')](_0x2419da[_0x97a6('0x27')][_0x97a6('0xf')]);_0x4a5e11[_0x97a6('0x2f')]=qs[_0x97a6('0x2f')](_0x2419da[_0x97a6('0x27')][_0x97a6('0x2f')]);}_0x4a5e11[_0x97a6('0x30')]=qs[_0x97a6('0x31')](_0x2419da['query'][_0x97a6('0x31')]);_0x4a5e11['where']=qs['filters'](_[_0x97a6('0x32')](_0x2419da[_0x97a6('0x27')],_0x3a8a44[_0x97a6('0x33')]),_0x4dec93);if(_0x2419da[_0x97a6('0x27')][_0x97a6('0x19')]){_0x4a5e11[_0x97a6('0x34')]=_['merge'](_0x4a5e11[_0x97a6('0x34')],{'$or':_[_0x97a6('0x1b')](_0x4dec93,function(_0x36d1f7){if(_0x36d1f7['type']!=='VIRTUAL'){var _0x35b572={};_0x35b572[_0x36d1f7[_0x97a6('0x21')]]={'$like':'%'+_0x2419da['query']['filter']+'%'};return _0x35b572;}})});}_0x4a5e11=_['merge']({},_0x4a5e11,_0x2419da[_0x97a6('0x35')]);var _0xe7aae8={'where':_0x4a5e11[_0x97a6('0x34')]};return db[_0x97a6('0x24')][_0x97a6('0xe')](_0xe7aae8)[_0x97a6('0x11')](function(_0x563ebe){_0x3b5527['count']=_0x563ebe;if(_0x2419da[_0x97a6('0x27')][_0x97a6('0x36')]){_0x4a5e11[_0x97a6('0x37')]=[{'all':!![]}];}return db[_0x97a6('0x24')][_0x97a6('0x38')](_0x4a5e11);})[_0x97a6('0x11')](function(_0x232dbc){_0x3b5527[_0x97a6('0x39')]=_0x232dbc;return _0x3b5527;})[_0x97a6('0x11')](respondWithFilteredResult(_0x2333c0,_0x4a5e11))[_0x97a6('0x3a')](handleError(_0x2333c0,null));};exports[_0x97a6('0x3b')]=function(_0x5717dc,_0x31a15b){var _0x50a244={'raw':![],'where':{'id':_0x5717dc[_0x97a6('0x3c')]['id']}},_0x1fff9c={};_0x1fff9c['model']=_['keys'](db[_0x97a6('0x24')][_0x97a6('0x25')]);_0x1fff9c['query']=_['keys'](_0x5717dc[_0x97a6('0x27')]);_0x1fff9c['filters']=_[_0x97a6('0x28')](_0x1fff9c[_0x97a6('0x29')],_0x1fff9c[_0x97a6('0x27')]);_0x50a244[_0x97a6('0x2a')]=_['intersection'](_0x1fff9c[_0x97a6('0x29')],qs[_0x97a6('0x2b')](_0x5717dc[_0x97a6('0x27')][_0x97a6('0x2b')]));_0x50a244['attributes']=_0x50a244[_0x97a6('0x2a')][_0x97a6('0x2c')]?_0x50a244[_0x97a6('0x2a')]:_0x1fff9c[_0x97a6('0x29')];if(_0x5717dc['query'][_0x97a6('0x36')]){_0x50a244[_0x97a6('0x37')]=[{'all':!![]}];}_0x50a244=_[_0x97a6('0x3d')]({},_0x50a244,_0x5717dc[_0x97a6('0x35')]);return db[_0x97a6('0x24')][_0x97a6('0x3e')](_0x50a244)[_0x97a6('0x11')](handleEntityNotFound(_0x31a15b,null))[_0x97a6('0x11')](respondWithResult(_0x31a15b,null))[_0x97a6('0x3a')](handleError(_0x31a15b,null));};exports[_0x97a6('0x1e')]=function(_0x3e633c,_0x3d968e){return db['VoiceExtension'][_0x97a6('0x3e')]({'where':{'id':_0x3e633c[_0x97a6('0x3c')]['id']}})['then'](handleEntityNotFound(_0x3d968e,null))['then'](removeEntity(_0x3d968e,null))['catch'](handleError(_0x3d968e,null));};exports[_0x97a6('0x3f')]=function(_0x3102a9,_0x4f01bd){if(_0x3102a9['body']['type']===_0x97a6('0x16')&&!_[_0x97a6('0x40')](_0x3102a9[_0x97a6('0x41')][_0x97a6('0x42')],'_')){_0x3102a9[_0x97a6('0x41')]['exten']='_'['concat'](_0x3102a9['body'][_0x97a6('0x42')]);}return db[_0x97a6('0x24')][_0x97a6('0x3f')](_0x3102a9['body'],{'raw':![]})[_0x97a6('0x11')](function(_0x56961b){var _0x353f30=_0x3102a9[_0x97a6('0x43')]['get']({'plain':!![]});if(!_0x353f30)throw new Error(_0x97a6('0x44'));if(_0x353f30['role']===_0x97a6('0x43')){var _0x24526c=_0x56961b[_0x97a6('0x12')]({'plain':!![]});var _0x2048f8=[{'name':_0x97a6('0x13'),'value':_0x97a6('0x14')},{'name':_0x97a6('0x15'),'value':_0x97a6('0x16')},{'name':_0x97a6('0x17'),'value':'internal'}];var _0x4618e3=_[_0x97a6('0x3e')](_0x2048f8,['value',_0x24526c[_0x97a6('0x45')]])[_0x97a6('0x21')];return db[_0x97a6('0x46')]['find']({'where':{'name':_0x4618e3,'userProfileId':_0x353f30[_0x97a6('0x47')]},'raw':!![]})['then'](function(_0x344c70){if(_0x344c70&&_0x344c70[_0x97a6('0x48')]===0x0){return db[_0x97a6('0x1d')][_0x97a6('0x3f')]({'name':_0x24526c[_0x97a6('0x21')],'resourceId':_0x24526c['id'],'type':_0x344c70[_0x97a6('0x21')],'sectionId':_0x344c70['id']},{})[_0x97a6('0x11')](function(){return _0x56961b;});}else{return _0x56961b;}})[_0x97a6('0x3a')](function(_0x446deb){logger[_0x97a6('0x1f')](_0x97a6('0x49'),_0x446deb);throw _0x446deb;});}return _0x56961b;})[_0x97a6('0x11')](respondWithResult(_0x4f01bd,0xc9))[_0x97a6('0x3a')](handleError(_0x4f01bd,null));};exports[_0x97a6('0x4a')]=function(_0x2008a3,_0x4aeb1c){if(_0x2008a3['body']['id']){delete _0x2008a3[_0x97a6('0x41')]['id'];}return db[_0x97a6('0x24')][_0x97a6('0x3e')]({'where':{'id':_0x2008a3[_0x97a6('0x3c')]['id']}})[_0x97a6('0x11')](handleEntityNotFound(_0x4aeb1c,null))[_0x97a6('0x11')](function(_0xe92025){if(_0xe92025){return db[_0x97a6('0x24')]['update'](_[_0x97a6('0x32')](_0x2008a3[_0x97a6('0x41')],[_0x97a6('0x42'),'context',_0x97a6('0x4b'),_0x97a6('0x4c'),'cutdigits',_0x97a6('0x4d'),_0x97a6('0x4e')]),{'where':{'context':_0xe92025['context'],'exten':_0xe92025[_0x97a6('0x42')]},'individualHooks':!![]})['then'](function(_0x5f1d7d){return _0x5f1d7d;});}return null;})[_0x97a6('0x11')](respondWithStatusCode(_0x4aeb1c,null))[_0x97a6('0x3a')](handleError(_0x4aeb1c,null));};exports['addApplications']=function(_0x51df59,_0x568344){var _0x371d49=_0x51df59[_0x97a6('0x3c')]['id'];var _0x3f2275=_0x51df59[_0x97a6('0x41')];var _0x5595b7=0xc8;var _0x6e107b=null;return db[_0x97a6('0x4f')][_0x97a6('0x50')]({'isolationLevel':db[_0x97a6('0x4f')][_0x97a6('0x51')][_0x97a6('0x52')]['READ_COMMITTED']},function(_0x2bcc81){return db[_0x97a6('0x24')]['findOne']({'where':{'id':_0x371d49},'transaction':_0x2bcc81})[_0x97a6('0x11')](function(_0x4067f7){if(_0x4067f7){return db[_0x97a6('0x24')][_0x97a6('0x1e')]({'where':{'VoiceExtensionId':_0x371d49},'transaction':_0x2bcc81})['then'](function(){var _0x539f47=_[_0x97a6('0x1b')](_0x3f2275,function(_0x486167){_0x486167['VoiceExtensionId']=_0x371d49;_0x486167[_0x97a6('0x53')]=!![];return _0x486167;});return _0x4067f7[_0x97a6('0x54')](_0x539f47);})[_0x97a6('0x11')](function(_0x1e7687){return db[_0x97a6('0x24')][_0x97a6('0x55')](_0x1e7687,{'transaction':_0x2bcc81});});}else{_0x5595b7=0x194;_0x6e107b=[];}});})[_0x97a6('0x11')](function(){if(_0x5595b7!==0x194){return db['VoiceExtension'][_0x97a6('0x56')]({'where':{'isApp':!![],'VoiceExtensionId':_0x371d49},'order':_0x97a6('0x57')})[_0x97a6('0x11')](function(_0x19671e){_0x6e107b=_0x19671e;});}})[_0x97a6('0x3a')](function(_0x226639){_0x5595b7=0x1f4;logger[_0x97a6('0x1f')](_0x226639['stack']);if(_0x226639['name']){delete _0x226639['name'];}_0x6e107b=_0x226639;})[_0x97a6('0x58')](function(){if(_0x6e107b===null){_0x568344[_0x97a6('0x9')](_0x5595b7);}else{if(_0x5595b7===0x1f4){_0x568344[_0x97a6('0xb')](_0x5595b7)['send'](_0x6e107b);}else{_0x568344[_0x97a6('0xb')](_0x5595b7)[_0x97a6('0xc')](_0x6e107b);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 2cc8747..0371672 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 _0xb29b=['remove','emit','hook','../../mysqldb','VoiceExtension','setMaxListeners','save','update'];(function(_0x19c13f,_0x17b479){var _0x1be51b=function(_0x3708a0){while(--_0x3708a0){_0x19c13f['push'](_0x19c13f['shift']());}};_0x1be51b(++_0x17b479);}(_0xb29b,0x1cb));var _0xbb29=function(_0x288af2,_0x2b86b5){_0x288af2=_0x288af2-0x0;var _0x5871d3=_0xb29b[_0x288af2];return _0x5871d3;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0xbb29('0x0'))['db'][_0xbb29('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xbb29('0x2')](0x0);var events={'afterCreate':_0xbb29('0x3'),'afterUpdate':_0xbb29('0x4'),'afterDestroy':_0xbb29('0x5')};function emitEvent(_0x20b317){return function(_0x327a94,_0x5b0093,_0x1c9c88){VoiceExtensionEvents[_0xbb29('0x6')](_0x20b317+':'+_0x327a94['id'],_0x327a94);VoiceExtensionEvents[_0xbb29('0x6')](_0x20b317,_0x327a94);_0x1c9c88(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0xbb29('0x7')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file +var _0x2a4b=['hasOwnProperty','hook','exports','events','../../mysqldb','VoiceExtension','setMaxListeners','save','update','emit'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x2a4b,0x99));var _0xb2a4=function(_0x249641,_0x24c9ac){_0x249641=_0x249641-0x0;var _0xe9bacf=_0x2a4b[_0x249641];return _0xe9bacf;};'use strict';var EventEmitter=require(_0xb2a4('0x0'));var VoiceExtension=require(_0xb2a4('0x1'))['db'][_0xb2a4('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xb2a4('0x3')](0x0);var events={'afterCreate':_0xb2a4('0x4'),'afterUpdate':_0xb2a4('0x5'),'afterDestroy':'remove'};function emitEvent(_0x53297b){return function(_0xa27f76,_0x2e9521,_0x3035dd){VoiceExtensionEvents[_0xb2a4('0x6')](_0x53297b+':'+_0xa27f76['id'],_0xa27f76);VoiceExtensionEvents[_0xb2a4('0x6')](_0x53297b,_0xa27f76);_0x3035dd(null);};}for(var e in events){if(events[_0xb2a4('0x7')](e)){var event=events[e];VoiceExtension[_0xb2a4('0x8')](e,emitEvent(event));}}module[_0xb2a4('0x9')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 6c17f8e..56034cd 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 _0x82a7=['get','Hangup','./voiceExtension.attributes','exports','models','type','Set','CDR(type)=','context','exten','alias','No\x20alias\x20set','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','NoOp','CDR(routeAlias)=','cutdigits','${EXTEN:','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','timeout','length','name','trunk','param','split','phone','prefix','${EXTEN}','SIP','join','options','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','interval','IntervalId','then','intervals','toLowerCase','tag','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','playback','includes','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice',',${EXTEN},','outboundDial','appdata','last','priority','define','VoiceExtension','voice_extensions'];(function(_0x56ec52,_0x35e3c3){var _0x324eb2=function(_0x38a417){while(--_0x38a417){_0x56ec52['push'](_0x56ec52['shift']());}};_0x324eb2(++_0x35e3c3);}(_0x82a7,0x1c4));var _0x782a=function(_0x211541,_0x4d483e){_0x211541=_0x211541-0x0;var _0xa36e54=_0x82a7[_0x211541];return _0xa36e54;};'use strict';var _=require('lodash');var attributes=require(_0x782a('0x0'));module[_0x782a('0x1')]=function(_0x1e39e4){var _0x2844de=_0x1e39e4[_0x782a('0x2')];function _0x3dc9c7(_0x4d030b){var _0x1f0a98=0x2;var _0x2511cb=[{'type':_0x4d030b[_0x782a('0x3')],'app':_0x782a('0x4'),'appdata':_0x782a('0x5')+_0x4d030b[_0x782a('0x3')],'context':_0x4d030b[_0x782a('0x6')],'exten':_0x4d030b[_0x782a('0x7')],'priority':_0x1f0a98++,'VoiceExtensionId':_0x4d030b['id']},{'type':_0x4d030b[_0x782a('0x3')],'app':_0x4d030b['alias']?_0x782a('0x4'):'NoOp','appdata':_0x4d030b[_0x782a('0x8')]?'CDR(routeAlias)='+_0x4d030b['alias']:_0x782a('0x9'),'context':_0x4d030b['context'],'exten':_0x4d030b[_0x782a('0x7')],'priority':_0x1f0a98++,'VoiceExtensionId':_0x4d030b['id']}];if(_0x4d030b[_0x782a('0x3')]==='inbound'){_0x2511cb[_0x782a('0xa')]({'type':'inbound','app':_0x782a('0x4'),'appdata':_0x782a('0xb')+_0x4d030b['id'],'context':_0x4d030b[_0x782a('0x6')],'exten':_0x4d030b[_0x782a('0x7')],'priority':_0x1f0a98++,'VoiceExtensionId':_0x4d030b['id']});}_0x2511cb[_0x782a('0xa')]({'type':_0x4d030b[_0x782a('0x3')],'app':_0x782a('0x4'),'appdata':_0x782a('0xc'),'context':_0x4d030b[_0x782a('0x6')],'exten':_0x4d030b[_0x782a('0x7')],'priority':_0x1f0a98++,'VoiceExtensionId':_0x4d030b['id']},{'type':_0x4d030b[_0x782a('0x3')],'app':_0x782a('0x4'),'appdata':_0x782a('0xd'),'context':_0x4d030b[_0x782a('0x6')],'exten':_0x4d030b['exten'],'priority':_0x1f0a98++,'VoiceExtensionId':_0x4d030b['id']},{'type':_0x4d030b['type'],'app':_0x782a('0x4'),'appdata':_0x782a('0xe'),'context':_0x4d030b[_0x782a('0x6')],'exten':_0x4d030b[_0x782a('0x7')],'priority':_0x1f0a98++,'VoiceExtensionId':_0x4d030b['id']});return _0x2511cb;}function _0x2774a2(_0x27eb96){var _0x322001=0x2;var _0x4f3fa8=[{'type':'outbound','app':'Set','appdata':'CDR(type)=outbound','context':_0x27eb96[_0x782a('0x6')],'exten':_0x27eb96[_0x782a('0x7')],'priority':_0x322001++,'VoiceExtensionId':_0x27eb96['id']},{'type':_0x782a('0xf'),'app':_0x27eb96[_0x782a('0x8')]?_0x782a('0x4'):_0x782a('0x10'),'appdata':_0x27eb96[_0x782a('0x8')]?_0x782a('0x11')+_0x27eb96['alias']:_0x782a('0x9'),'context':_0x27eb96[_0x782a('0x6')],'exten':_0x27eb96[_0x782a('0x7')],'priority':_0x322001++,'VoiceExtensionId':_0x27eb96['id']},{'type':'outbound','app':_0x782a('0x4'),'appdata':'CDR(destination)='+(_0x27eb96[_0x782a('0x12')]?_0x782a('0x13')+_0x27eb96[_0x782a('0x12')]+'}':'${EXTEN}'),'context':_0x27eb96[_0x782a('0x6')],'exten':_0x27eb96[_0x782a('0x7')],'priority':_0x322001++,'VoiceExtensionId':_0x27eb96['id']},{'type':_0x782a('0xf'),'app':_0x782a('0x4'),'appdata':_0x782a('0xb')+_0x27eb96['id'],'context':_0x27eb96['context'],'exten':_0x27eb96[_0x782a('0x7')],'priority':_0x322001++,'VoiceExtensionId':_0x27eb96['id']},{'type':_0x782a('0xf'),'app':_0x782a('0x14'),'appdata':_0x782a('0x15')+(_0x322001+0x2)+_0x782a('0x16')+(_0x322001+0x1)+')','context':_0x27eb96[_0x782a('0x6')],'exten':_0x27eb96['exten'],'priority':_0x322001++,'VoiceExtensionId':_0x27eb96['id']},{'type':_0x782a('0xf'),'app':_0x782a('0x4'),'appdata':_0x27eb96[_0x782a('0x12')]?'CDR(prefix)=${EXTEN:0:'+_0x27eb96[_0x782a('0x12')]+'}':_0x782a('0x17'),'context':_0x27eb96['context'],'exten':_0x27eb96[_0x782a('0x7')],'priority':_0x322001++,'VoiceExtensionId':_0x27eb96['id']},{'type':'outbound','app':_0x782a('0x4'),'appdata':_0x782a('0xc'),'context':_0x27eb96['context'],'exten':_0x27eb96[_0x782a('0x7')],'priority':_0x322001++,'VoiceExtensionId':_0x27eb96['id']},{'type':_0x782a('0xf'),'app':_0x782a('0x4'),'appdata':_0x782a('0xd'),'context':_0x27eb96[_0x782a('0x6')],'exten':_0x27eb96[_0x782a('0x7')],'priority':_0x322001++,'VoiceExtensionId':_0x27eb96['id']},{'type':_0x782a('0xf'),'app':_0x782a('0x4'),'appdata':_0x782a('0xe'),'context':_0x27eb96[_0x782a('0x6')],'exten':_0x27eb96['exten'],'priority':_0x322001++,'VoiceExtensionId':_0x27eb96['id']},{'type':_0x782a('0xf'),'app':_0x782a('0x4'),'appdata':_0x782a('0x18')+_0x27eb96['id'],'context':_0x27eb96[_0x782a('0x6')],'exten':_0x27eb96[_0x782a('0x7')],'priority':_0x322001++,'VoiceExtensionId':_0x27eb96['id']}];if(_0x27eb96[_0x782a('0x19')](_0x782a('0x1a'))&&_0x27eb96[_0x782a('0x1a')]!==_0x782a('0x1b')){_0x4f3fa8[_0x782a('0xa')]({'type':_0x782a('0xf'),'app':_0x782a('0x4'),'appdata':_0x782a('0x1c'),'context':_0x27eb96[_0x782a('0x6')],'exten':_0x27eb96[_0x782a('0x7')],'priority':_0x322001++,'VoiceExtensionId':_0x27eb96['id']},{'type':'outbound','app':'Set','appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x27eb96[_0x782a('0x1a')]||'wav','context':_0x27eb96[_0x782a('0x6')],'exten':_0x27eb96[_0x782a('0x7')],'priority':_0x322001++,'VoiceExtensionId':_0x27eb96['id']});}return _0x4f3fa8;}function _0x22ef19(_0x217026,_0x21fa03){var _0x2db270=[{'name':'trunk','param':0x0},{'name':_0x782a('0x1d'),'param':0x1},{'name':'options','param':0x2},{'name':'url','param':0x3}];var _0x56cd30={};var _0x284986=_0x21fa03['split'](',');var _0x1d2708=[];for(var _0x49e9b7=0x0;_0x49e9b7<_0x2db270[_0x782a('0x1e')];_0x49e9b7++){switch(_0x2db270[_0x49e9b7][_0x782a('0x1f')]){case'trunk':_0x56cd30[_0x782a('0x20')]=_0x284986[_0x2db270[_0x49e9b7][_0x782a('0x21')]][_0x782a('0x22')]('/')[0x1];_0x56cd30[_0x782a('0x23')]=_0x284986[_0x2db270[_0x49e9b7][_0x782a('0x21')]][_0x782a('0x22')]('/')[0x2];_0x56cd30[_0x782a('0x24')]=_0x56cd30[_0x782a('0x23')]?_0x56cd30['phone'][_0x782a('0x22')]('$')[0x0]:undefined;_0x56cd30[_0x782a('0x23')]=_0x217026[_0x782a('0x12')]?(_0x56cd30[_0x782a('0x24')]||'')+'${EXTEN:'+_0x217026[_0x782a('0x12')]+'}':(_0x56cd30[_0x782a('0x24')]||'')+_0x782a('0x25');_0x1d2708[_0x2db270[_0x49e9b7][_0x782a('0x21')]]=[_0x782a('0x26'),_0x56cd30['trunk'],_0x56cd30['phone']][_0x782a('0x27')]('/');break;case'options':_0x56cd30[_0x782a('0x28')]=_0x284986[_0x2db270[_0x49e9b7][_0x782a('0x21')]];if(_0x217026[_0x782a('0x1a')]!==_0x782a('0x1b')){if(_0x56cd30[_0x782a('0x28')][_0x782a('0x29')](_0x782a('0x2a'))<0x0){_0x56cd30[_0x782a('0x28')]+='U(xcally-mixmonitor-context)';}}else{_0x56cd30[_0x782a('0x28')]=_0x56cd30[_0x782a('0x28')][_0x782a('0x2b')](_0x782a('0x2a'),'');}_0x1d2708[_0x2db270[_0x49e9b7]['param']]=_0x56cd30[_0x782a('0x28')];break;default:_0x1d2708[_0x2db270[_0x49e9b7][_0x782a('0x21')]]=_0x284986[_0x2db270[_0x49e9b7][_0x782a('0x21')]];}}return _0x1d2708[_0x782a('0x27')](',');}function _0x594008(_0x4d1f75,_0x4a953,_0x3e9202){return new Promise(function(_0x5519d0,_0x373747){var _0x4a6207=[];if(_[_0x782a('0x2c')](_0x4a953))return _0x5519d0(_0x4a6207);_0x2844de[_0x782a('0x2d')]['findAll']({'attributes':['id',_0x782a('0x2e'),_0x782a('0x2f')],'raw':!![]})[_0x782a('0x30')](function(_0x5100a6){for(var _0x155ee3=0x0,_0x1f0d6d=0x0;_0x155ee3<_0x4a953['length'];_0x155ee3++,_0x1f0d6d=0x0){var _0x2ab9ef=_0x4a953[_0x155ee3];var _0x1e95b3=[];var _0x2fbb42=[];delete _0x2ab9ef['id'];if(_0x2ab9ef[_0x782a('0x2e')]!=='*,*,*,*'){_0x2ab9ef[_0x782a('0x31')]=[_0x2ab9ef['interval']];}else{_0x2ab9ef[_0x782a('0x31')]=_0x2ab9ef['IntervalId']?_['map'](_['filter'](_0x5100a6,{'IntervalId':_0x2ab9ef['IntervalId']}),'interval'):[];}_0x2ab9ef['context']=_0x4d1f75[_0x782a('0x6')];_0x2ab9ef[_0x782a('0x7')]=_0x4d1f75['exten'];if(_0x2ab9ef['type'])_0x2ab9ef[_0x782a('0x3')]=_0x2ab9ef['type'][_0x782a('0x32')]();if(_0x4d1f75[_0x782a('0x3')]===_0x782a('0xf')){if(_0x2ab9ef[_0x782a('0x19')](_0x782a('0x33'))&&_0x2ab9ef['tag']&&_0x2ab9ef['tag']!=='--'){_0x1e95b3[_0x782a('0xa')]({'type':_0x2ab9ef[_0x782a('0x3')]['toLowerCase'](),'app':_0x782a('0x4'),'appdata':'CDR(tag)='+_0x2ab9ef[_0x782a('0x33')],'context':_0x4d1f75[_0x782a('0x6')],'exten':_0x4d1f75['exten'],'priority':_0x2ab9ef[_0x782a('0x31')][_0x782a('0x1e')]+_0x3e9202+_0x1f0d6d++,'VoiceExtensionId':_0x4d1f75['id']});}_0x1e95b3[_0x782a('0xa')]({'type':_0x2ab9ef[_0x782a('0x3')]['toLowerCase'](),'app':_0x782a('0x14'),'appdata':_0x782a('0x34')+(_0x2ab9ef[_0x782a('0x35')]?_0x782a('0x36')+_0x2ab9ef[_0x782a('0x35')]+')':_0x782a('0x37')),'context':_0x4d1f75[_0x782a('0x6')],'exten':_0x4d1f75[_0x782a('0x7')],'priority':_0x2ab9ef['intervals']['length']+_0x3e9202+_0x1f0d6d++,'VoiceExtensionId':_0x4d1f75['id']});}else{if(_0x2ab9ef['hasOwnProperty'](_0x782a('0x38'))){if([_0x782a('0x39'),_0x782a('0x3a')][_0x782a('0x3b')](_0x2ab9ef['app'][_0x782a('0x32')]())&&_0x2ab9ef['appType']!==_0x782a('0x3c')){if(_0x2ab9ef['answer']){_0x1e95b3[_0x782a('0xa')]({'type':_0x2ab9ef['type'][_0x782a('0x32')](),'app':'ExecIf','appdata':_0x782a('0x3d'),'context':_0x4d1f75['context'],'exten':_0x4d1f75[_0x782a('0x7')],'priority':_0x2ab9ef[_0x782a('0x31')]['length']+_0x3e9202+_0x1f0d6d++,'VoiceExtensionId':_0x4d1f75['id']});_0x1e95b3[_0x782a('0xa')]({'type':_0x2ab9ef[_0x782a('0x3')][_0x782a('0x32')](),'app':_0x782a('0x4'),'appdata':_0x782a('0x3e'),'context':_0x4d1f75['context'],'exten':_0x4d1f75[_0x782a('0x7')],'priority':_0x2ab9ef['intervals']['length']+_0x3e9202+_0x1f0d6d++,'VoiceExtensionId':_0x4d1f75['id']});}else{_0x1e95b3[_0x782a('0xa')]({'type':_0x2ab9ef[_0x782a('0x3')][_0x782a('0x32')](),'app':_0x782a('0x14'),'appdata':_0x782a('0x3f'),'context':_0x4d1f75[_0x782a('0x6')],'exten':_0x4d1f75[_0x782a('0x7')],'priority':_0x2ab9ef[_0x782a('0x31')][_0x782a('0x1e')]+_0x3e9202+_0x1f0d6d++,'VoiceExtensionId':_0x4d1f75['id']});_0x1e95b3['push']({'type':_0x2ab9ef[_0x782a('0x3')]['toLowerCase'](),'app':_0x782a('0x4'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x4d1f75['context'],'exten':_0x4d1f75[_0x782a('0x7')],'priority':_0x2ab9ef[_0x782a('0x31')]['length']+_0x3e9202+_0x1f0d6d++,'VoiceExtensionId':_0x4d1f75['id']});}}}}for(var _0x1b2dd5=0x0;_0x1b2dd5<_0x2ab9ef['intervals']['length'];_0x1b2dd5++){var _0x4fd464=_0x3e9202+_0x2ab9ef[_0x782a('0x31')]['length'];var _0x47d015=_0x1b2dd5===_0x2ab9ef[_0x782a('0x31')][_0x782a('0x1e')]-0x1?_0x3e9202+_0x1e95b3[_0x782a('0x1e')]+_0x2fbb42[_0x782a('0x1e')]+0x2:_0x3e9202+_0x1b2dd5+0x1;_0x1e95b3[_0x782a('0x40')](_0x1b2dd5,0x0,{'type':_0x4d1f75[_0x782a('0x3')],'app':'GotoIfTime','appdata':_0x2ab9ef[_0x782a('0x31')][_0x1b2dd5]+'?'+_0x4d1f75['context']+',${EXTEN},'+_0x4fd464+':'+_0x4d1f75[_0x782a('0x6')]+_0x782a('0x41')+_0x47d015,'exten':_0x4d1f75[_0x782a('0x7')],'context':_0x4d1f75[_0x782a('0x6')],'priority':_0x3e9202+_0x1b2dd5,'VoiceExtensionId':_0x4d1f75['id']});}if(_0x2ab9ef['appType']===_0x782a('0x42'))_0x2ab9ef[_0x782a('0x43')]=_0x22ef19(_0x4d1f75,_0x2ab9ef[_0x782a('0x43')]);_0x2ab9ef['priority']=_0x1e95b3['length']?_[_0x782a('0x44')](_0x1e95b3)['priority']+0x1:_0x3e9202;_0x4a6207=_['concat'](_0x4a6207,_0x1e95b3,[_0x2ab9ef],_0x2fbb42);_0x3e9202=_[_0x782a('0x44')](_0x4a6207)[_0x782a('0x45')]+0x1;}return _0x5519d0(_0x4a6207);})['catch'](function(_0x1ef879){_0x373747(_0x1ef879);});});}return _0x1e39e4[_0x782a('0x46')](_0x782a('0x47'),attributes,{'tableName':_0x782a('0x48'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x3f9ad7){var _0x5110c2=this[_0x782a('0x49')]({'plain':!![]});var _0x2f61a0=_0x5110c2[_0x782a('0x3')]===_0x782a('0xf')?_0x2774a2(_0x5110c2):_0x3dc9c7(_0x5110c2);return _0x594008(_0x5110c2,_0x3f9ad7,_[_0x782a('0x44')](_0x2f61a0)[_0x782a('0x45')]+0x1)[_0x782a('0x30')](function(_0x61b5f6){var _0x53816=_['concat'](_0x2f61a0,_0x61b5f6);_0x53816['push']({'type':_0x5110c2[_0x782a('0x3')],'app':_0x782a('0x4a'),'exten':_0x5110c2[_0x782a('0x7')],'context':_0x5110c2[_0x782a('0x6')],'priority':_[_0x782a('0x44')](_0x53816)[_0x782a('0x45')]+0x1,'VoiceExtensionId':_0x5110c2['id']});return _0x53816;});}}});}; \ No newline at end of file +var _0xb91a=['Set','CDR(type)=','context','alias','CDR(routeAlias)=','No\x20alias\x20set','exten','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','NoOp','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','XCALLY-MOTION-PROGRESS=0','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','url','split','length','param','phone','prefix','SIP','join','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','interval','IntervalId','then','intervals','map','filter','toLowerCase','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','playback','includes','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','concat','catch','define','voice_extensions','get','lodash','./voiceExtension.attributes','exports','models','type'];(function(_0x214c2b,_0x19e223){var _0x3f9e48=function(_0x2a6dd3){while(--_0x2a6dd3){_0x214c2b['push'](_0x214c2b['shift']());}};_0x3f9e48(++_0x19e223);}(_0xb91a,0xf4));var _0xab91=function(_0x546d02,_0x21e300){_0x546d02=_0x546d02-0x0;var _0x4e18ca=_0xb91a[_0x546d02];return _0x4e18ca;};'use strict';var _=require(_0xab91('0x0'));var attributes=require(_0xab91('0x1'));module[_0xab91('0x2')]=function(_0x5dcf46){var _0x59b921=_0x5dcf46[_0xab91('0x3')];function _0x37cd1e(_0xb312db){var _0x439eb2=0x2;var _0x1afca9=[{'type':_0xb312db[_0xab91('0x4')],'app':_0xab91('0x5'),'appdata':_0xab91('0x6')+_0xb312db[_0xab91('0x4')],'context':_0xb312db[_0xab91('0x7')],'exten':_0xb312db['exten'],'priority':_0x439eb2++,'VoiceExtensionId':_0xb312db['id']},{'type':_0xb312db[_0xab91('0x4')],'app':_0xb312db[_0xab91('0x8')]?'Set':'NoOp','appdata':_0xb312db['alias']?_0xab91('0x9')+_0xb312db[_0xab91('0x8')]:_0xab91('0xa'),'context':_0xb312db[_0xab91('0x7')],'exten':_0xb312db[_0xab91('0xb')],'priority':_0x439eb2++,'VoiceExtensionId':_0xb312db['id']}];if(_0xb312db[_0xab91('0x4')]===_0xab91('0xc')){_0x1afca9[_0xab91('0xd')]({'type':_0xab91('0xc'),'app':_0xab91('0x5'),'appdata':_0xab91('0xe')+_0xb312db['id'],'context':_0xb312db[_0xab91('0x7')],'exten':_0xb312db[_0xab91('0xb')],'priority':_0x439eb2++,'VoiceExtensionId':_0xb312db['id']});}_0x1afca9['push']({'type':_0xb312db['type'],'app':_0xab91('0x5'),'appdata':_0xab91('0xf'),'context':_0xb312db[_0xab91('0x7')],'exten':_0xb312db[_0xab91('0xb')],'priority':_0x439eb2++,'VoiceExtensionId':_0xb312db['id']},{'type':_0xb312db[_0xab91('0x4')],'app':_0xab91('0x5'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0xb312db['context'],'exten':_0xb312db[_0xab91('0xb')],'priority':_0x439eb2++,'VoiceExtensionId':_0xb312db['id']},{'type':_0xb312db[_0xab91('0x4')],'app':_0xab91('0x5'),'appdata':_0xab91('0x10'),'context':_0xb312db[_0xab91('0x7')],'exten':_0xb312db[_0xab91('0xb')],'priority':_0x439eb2++,'VoiceExtensionId':_0xb312db['id']});return _0x1afca9;}function _0x27b7d1(_0x3fc294){var _0x499daf=0x2;var _0x557c36=[{'type':_0xab91('0x11'),'app':'Set','appdata':_0xab91('0x12'),'context':_0x3fc294[_0xab91('0x7')],'exten':_0x3fc294[_0xab91('0xb')],'priority':_0x499daf++,'VoiceExtensionId':_0x3fc294['id']},{'type':'outbound','app':_0x3fc294[_0xab91('0x8')]?'Set':_0xab91('0x13'),'appdata':_0x3fc294['alias']?'CDR(routeAlias)='+_0x3fc294[_0xab91('0x8')]:'No\x20alias\x20set','context':_0x3fc294[_0xab91('0x7')],'exten':_0x3fc294[_0xab91('0xb')],'priority':_0x499daf++,'VoiceExtensionId':_0x3fc294['id']},{'type':_0xab91('0x11'),'app':'Set','appdata':_0xab91('0x14')+(_0x3fc294[_0xab91('0x15')]?_0xab91('0x16')+_0x3fc294[_0xab91('0x15')]+'}':_0xab91('0x17')),'context':_0x3fc294[_0xab91('0x7')],'exten':_0x3fc294[_0xab91('0xb')],'priority':_0x499daf++,'VoiceExtensionId':_0x3fc294['id']},{'type':'outbound','app':'Set','appdata':_0xab91('0xe')+_0x3fc294['id'],'context':_0x3fc294['context'],'exten':_0x3fc294['exten'],'priority':_0x499daf++,'VoiceExtensionId':_0x3fc294['id']},{'type':_0xab91('0x11'),'app':_0xab91('0x18'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x499daf+0x2)+_0xab91('0x19')+(_0x499daf+0x1)+')','context':_0x3fc294['context'],'exten':_0x3fc294[_0xab91('0xb')],'priority':_0x499daf++,'VoiceExtensionId':_0x3fc294['id']},{'type':_0xab91('0x11'),'app':'Set','appdata':_0x3fc294[_0xab91('0x15')]?_0xab91('0x1a')+_0x3fc294[_0xab91('0x15')]+'}':_0xab91('0x1b'),'context':_0x3fc294[_0xab91('0x7')],'exten':_0x3fc294[_0xab91('0xb')],'priority':_0x499daf++,'VoiceExtensionId':_0x3fc294['id']},{'type':'outbound','app':_0xab91('0x5'),'appdata':_0xab91('0xf'),'context':_0x3fc294[_0xab91('0x7')],'exten':_0x3fc294[_0xab91('0xb')],'priority':_0x499daf++,'VoiceExtensionId':_0x3fc294['id']},{'type':_0xab91('0x11'),'app':_0xab91('0x5'),'appdata':_0xab91('0x1c'),'context':_0x3fc294[_0xab91('0x7')],'exten':_0x3fc294['exten'],'priority':_0x499daf++,'VoiceExtensionId':_0x3fc294['id']},{'type':_0xab91('0x11'),'app':_0xab91('0x5'),'appdata':_0xab91('0x10'),'context':_0x3fc294[_0xab91('0x7')],'exten':_0x3fc294[_0xab91('0xb')],'priority':_0x499daf++,'VoiceExtensionId':_0x3fc294['id']},{'type':_0xab91('0x11'),'app':'Set','appdata':_0xab91('0x1d')+_0x3fc294['id'],'context':_0x3fc294[_0xab91('0x7')],'exten':_0x3fc294[_0xab91('0xb')],'priority':_0x499daf++,'VoiceExtensionId':_0x3fc294['id']}];if(_0x3fc294[_0xab91('0x1e')]('recordingFormat')&&_0x3fc294[_0xab91('0x1f')]!==_0xab91('0x20')){_0x557c36[_0xab91('0xd')]({'type':'outbound','app':_0xab91('0x5'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x3fc294[_0xab91('0x7')],'exten':_0x3fc294[_0xab91('0xb')],'priority':_0x499daf++,'VoiceExtensionId':_0x3fc294['id']},{'type':'outbound','app':_0xab91('0x5'),'appdata':_0xab91('0x21')+_0x3fc294[_0xab91('0x1f')]||_0xab91('0x22'),'context':_0x3fc294[_0xab91('0x7')],'exten':_0x3fc294[_0xab91('0xb')],'priority':_0x499daf++,'VoiceExtensionId':_0x3fc294['id']});}return _0x557c36;}function _0x15d2dd(_0x576bbc,_0x584702){var _0x17e5bd=[{'name':_0xab91('0x23'),'param':0x0},{'name':_0xab91('0x24'),'param':0x1},{'name':_0xab91('0x25'),'param':0x2},{'name':_0xab91('0x26'),'param':0x3}];var _0xca2753={};var _0xa783c=_0x584702[_0xab91('0x27')](',');var _0x4787f0=[];for(var _0x286c6d=0x0;_0x286c6d<_0x17e5bd[_0xab91('0x28')];_0x286c6d++){switch(_0x17e5bd[_0x286c6d]['name']){case _0xab91('0x23'):_0xca2753['trunk']=_0xa783c[_0x17e5bd[_0x286c6d][_0xab91('0x29')]][_0xab91('0x27')]('/')[0x1];_0xca2753[_0xab91('0x2a')]=_0xa783c[_0x17e5bd[_0x286c6d][_0xab91('0x29')]]['split']('/')[0x2];_0xca2753['prefix']=_0xca2753['phone']?_0xca2753[_0xab91('0x2a')][_0xab91('0x27')]('$')[0x0]:undefined;_0xca2753['phone']=_0x576bbc[_0xab91('0x15')]?(_0xca2753[_0xab91('0x2b')]||'')+_0xab91('0x16')+_0x576bbc[_0xab91('0x15')]+'}':(_0xca2753[_0xab91('0x2b')]||'')+_0xab91('0x17');_0x4787f0[_0x17e5bd[_0x286c6d][_0xab91('0x29')]]=[_0xab91('0x2c'),_0xca2753[_0xab91('0x23')],_0xca2753[_0xab91('0x2a')]][_0xab91('0x2d')]('/');break;case _0xab91('0x25'):_0xca2753['options']=_0xa783c[_0x17e5bd[_0x286c6d][_0xab91('0x29')]];if(_0x576bbc[_0xab91('0x1f')]!==_0xab91('0x20')){if(_0xca2753[_0xab91('0x25')][_0xab91('0x2e')](_0xab91('0x2f'))<0x0){_0xca2753['options']+=_0xab91('0x2f');}}else{_0xca2753['options']=_0xca2753[_0xab91('0x25')][_0xab91('0x30')](_0xab91('0x2f'),'');}_0x4787f0[_0x17e5bd[_0x286c6d][_0xab91('0x29')]]=_0xca2753[_0xab91('0x25')];break;default:_0x4787f0[_0x17e5bd[_0x286c6d][_0xab91('0x29')]]=_0xa783c[_0x17e5bd[_0x286c6d][_0xab91('0x29')]];}}return _0x4787f0[_0xab91('0x2d')](',');}function _0x43fd94(_0x88e0ce,_0x4493a8,_0x9caf1a){return new Promise(function(_0x1aea21,_0x2ff56a){var _0x15341a=[];if(_[_0xab91('0x31')](_0x4493a8))return _0x1aea21(_0x15341a);_0x59b921[_0xab91('0x32')]['findAll']({'attributes':['id',_0xab91('0x33'),_0xab91('0x34')],'raw':!![]})[_0xab91('0x35')](function(_0x4a28bf){for(var _0x218c72=0x0,_0x69c8bc=0x0;_0x218c72<_0x4493a8['length'];_0x218c72++,_0x69c8bc=0x0){var _0x426dea=_0x4493a8[_0x218c72];var _0x1c9449=[];var _0x1732df=[];delete _0x426dea['id'];if(_0x426dea[_0xab91('0x33')]!=='*,*,*,*'){_0x426dea[_0xab91('0x36')]=[_0x426dea['interval']];}else{_0x426dea[_0xab91('0x36')]=_0x426dea['IntervalId']?_[_0xab91('0x37')](_[_0xab91('0x38')](_0x4a28bf,{'IntervalId':_0x426dea[_0xab91('0x34')]}),_0xab91('0x33')):[];}_0x426dea['context']=_0x88e0ce['context'];_0x426dea[_0xab91('0xb')]=_0x88e0ce['exten'];if(_0x426dea['type'])_0x426dea[_0xab91('0x4')]=_0x426dea[_0xab91('0x4')][_0xab91('0x39')]();if(_0x88e0ce['type']===_0xab91('0x11')){if(_0x426dea['hasOwnProperty']('tag')&&_0x426dea[_0xab91('0x3a')]&&_0x426dea[_0xab91('0x3a')]!=='--'){_0x1c9449['push']({'type':_0x426dea[_0xab91('0x4')]['toLowerCase'](),'app':_0xab91('0x5'),'appdata':_0xab91('0x3b')+_0x426dea[_0xab91('0x3a')],'context':_0x88e0ce['context'],'exten':_0x88e0ce[_0xab91('0xb')],'priority':_0x426dea[_0xab91('0x36')][_0xab91('0x28')]+_0x9caf1a+_0x69c8bc++,'VoiceExtensionId':_0x88e0ce['id']});}_0x1c9449[_0xab91('0xd')]({'type':_0x426dea[_0xab91('0x4')][_0xab91('0x39')](),'app':_0xab91('0x18'),'appdata':_0xab91('0x3c')+(_0x426dea[_0xab91('0x3d')]?_0xab91('0x3e')+_0x426dea[_0xab91('0x3d')]+')':_0xab91('0x3f')),'context':_0x88e0ce['context'],'exten':_0x88e0ce['exten'],'priority':_0x426dea[_0xab91('0x36')]['length']+_0x9caf1a+_0x69c8bc++,'VoiceExtensionId':_0x88e0ce['id']});}else{if(_0x426dea[_0xab91('0x1e')](_0xab91('0x40'))){if(['queue',_0xab91('0x41')][_0xab91('0x42')](_0x426dea[_0xab91('0x43')][_0xab91('0x39')]())&&_0x426dea[_0xab91('0x44')]!==_0xab91('0x45')){if(_0x426dea[_0xab91('0x40')]){_0x1c9449[_0xab91('0xd')]({'type':_0x426dea[_0xab91('0x4')][_0xab91('0x39')](),'app':_0xab91('0x18'),'appdata':_0xab91('0x46'),'context':_0x88e0ce[_0xab91('0x7')],'exten':_0x88e0ce[_0xab91('0xb')],'priority':_0x426dea[_0xab91('0x36')][_0xab91('0x28')]+_0x9caf1a+_0x69c8bc++,'VoiceExtensionId':_0x88e0ce['id']});_0x1c9449['push']({'type':_0x426dea[_0xab91('0x4')][_0xab91('0x39')](),'app':_0xab91('0x5'),'appdata':_0xab91('0x47'),'context':_0x88e0ce[_0xab91('0x7')],'exten':_0x88e0ce[_0xab91('0xb')],'priority':_0x426dea[_0xab91('0x36')]['length']+_0x9caf1a+_0x69c8bc++,'VoiceExtensionId':_0x88e0ce['id']});}else{_0x1c9449[_0xab91('0xd')]({'type':_0x426dea[_0xab91('0x4')][_0xab91('0x39')](),'app':_0xab91('0x18'),'appdata':_0xab91('0x48'),'context':_0x88e0ce[_0xab91('0x7')],'exten':_0x88e0ce[_0xab91('0xb')],'priority':_0x426dea[_0xab91('0x36')][_0xab91('0x28')]+_0x9caf1a+_0x69c8bc++,'VoiceExtensionId':_0x88e0ce['id']});_0x1c9449[_0xab91('0xd')]({'type':_0x426dea[_0xab91('0x4')][_0xab91('0x39')](),'app':_0xab91('0x5'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x88e0ce[_0xab91('0x7')],'exten':_0x88e0ce[_0xab91('0xb')],'priority':_0x426dea['intervals'][_0xab91('0x28')]+_0x9caf1a+_0x69c8bc++,'VoiceExtensionId':_0x88e0ce['id']});}}}}for(var _0x357e30=0x0;_0x357e30<_0x426dea[_0xab91('0x36')]['length'];_0x357e30++){var _0xc2f88c=_0x9caf1a+_0x426dea['intervals']['length'];var _0xc0632=_0x357e30===_0x426dea[_0xab91('0x36')][_0xab91('0x28')]-0x1?_0x9caf1a+_0x1c9449[_0xab91('0x28')]+_0x1732df[_0xab91('0x28')]+0x2:_0x9caf1a+_0x357e30+0x1;_0x1c9449['splice'](_0x357e30,0x0,{'type':_0x88e0ce[_0xab91('0x4')],'app':_0xab91('0x49'),'appdata':_0x426dea['intervals'][_0x357e30]+'?'+_0x88e0ce[_0xab91('0x7')]+_0xab91('0x4a')+_0xc2f88c+':'+_0x88e0ce[_0xab91('0x7')]+_0xab91('0x4a')+_0xc0632,'exten':_0x88e0ce[_0xab91('0xb')],'context':_0x88e0ce[_0xab91('0x7')],'priority':_0x9caf1a+_0x357e30,'VoiceExtensionId':_0x88e0ce['id']});}if(_0x426dea[_0xab91('0x44')]===_0xab91('0x4b'))_0x426dea[_0xab91('0x4c')]=_0x15d2dd(_0x88e0ce,_0x426dea[_0xab91('0x4c')]);_0x426dea[_0xab91('0x4d')]=_0x1c9449[_0xab91('0x28')]?_['last'](_0x1c9449)['priority']+0x1:_0x9caf1a;_0x15341a=_[_0xab91('0x4e')](_0x15341a,_0x1c9449,[_0x426dea],_0x1732df);_0x9caf1a=_['last'](_0x15341a)[_0xab91('0x4d')]+0x1;}return _0x1aea21(_0x15341a);})[_0xab91('0x4f')](function(_0xcdf879){_0x2ff56a(_0xcdf879);});});}return _0x5dcf46[_0xab91('0x50')]('VoiceExtension',attributes,{'tableName':_0xab91('0x51'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x250c86){var _0x744959=this[_0xab91('0x52')]({'plain':!![]});var _0x2c088c=_0x744959[_0xab91('0x4')]===_0xab91('0x11')?_0x27b7d1(_0x744959):_0x37cd1e(_0x744959);return _0x43fd94(_0x744959,_0x250c86,_['last'](_0x2c088c)[_0xab91('0x4d')]+0x1)[_0xab91('0x35')](function(_0x36d6f9){var _0x14ccbe=_[_0xab91('0x4e')](_0x2c088c,_0x36d6f9);_0x14ccbe['push']({'type':_0x744959[_0xab91('0x4')],'app':'Hangup','exten':_0x744959[_0xab91('0xb')],'context':_0x744959[_0xab91('0x7')],'priority':_['last'](_0x14ccbe)['priority']+0x1,'VoiceExtensionId':_0x744959['id']});return _0x14ccbe;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 3cc43f4..347ed7b 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 _0x2cd0=['register','request','info','VoiceExtension,\x20%s,\x20%s','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','GetVoiceExtension','VoiceExtension','findAll','options','raw','attributes','limit','include','map','model','then','debug','catch','lodash','util','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./voiceExtension.socket'];(function(_0x346f68,_0xb45d9d){var _0x2d1803=function(_0x3e5b6a){while(--_0x3e5b6a){_0x346f68['push'](_0x346f68['shift']());}};_0x2d1803(++_0xb45d9d);}(_0x2cd0,0x8a));var _0x02cd=function(_0x4456a2,_0x376ff2){_0x4456a2=_0x4456a2-0x0;var _0xf36b56=_0x2cd0[_0x4456a2];return _0xf36b56;};'use strict';var _=require(_0x02cd('0x0'));var util=require(_0x02cd('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x02cd('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x02cd('0x3'));var logger=require(_0x02cd('0x4'))(_0x02cd('0x5'));var config=require(_0x02cd('0x6'));var jayson=require(_0x02cd('0x7'));var client=jayson[_0x02cd('0x8')][_0x02cd('0x9')]({'port':0x232a});config[_0x02cd('0xa')]=_[_0x02cd('0xb')](config[_0x02cd('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x02cd('0xc'))(new Redis(config[_0x02cd('0xa')]));require(_0x02cd('0xd'))[_0x02cd('0xe')](socket);function respondWithRpcPromise(_0x45cc20,_0xd0cc56,_0x18dfe0){return new BPromise(function(_0x2364c3,_0x15a488){return client[_0x02cd('0xf')](_0x45cc20,_0x18dfe0)['then'](function(_0x59f017){logger[_0x02cd('0x10')](_0x02cd('0x11'),_0xd0cc56,'request\x20sent');logger['debug'](_0x02cd('0x12'),_0xd0cc56,'request\x20sent',JSON[_0x02cd('0x13')](_0x59f017));if(_0x59f017[_0x02cd('0x14')]){if(_0x59f017[_0x02cd('0x14')][_0x02cd('0x15')]===0x1f4){logger[_0x02cd('0x14')](_0x02cd('0x11'),_0xd0cc56,_0x59f017['error']['message']);return _0x15a488(_0x59f017[_0x02cd('0x14')][_0x02cd('0x16')]);}logger[_0x02cd('0x14')](_0x02cd('0x11'),_0xd0cc56,_0x59f017[_0x02cd('0x14')]['message']);return _0x2364c3(_0x59f017[_0x02cd('0x14')]['message']);}else{logger['info'](_0x02cd('0x11'),_0xd0cc56,_0x02cd('0x17'));_0x2364c3(_0x59f017[_0x02cd('0x18')][_0x02cd('0x16')]);}})['catch'](function(_0x341ace){logger['error'](_0x02cd('0x11'),_0xd0cc56,_0x341ace);_0x15a488(_0x341ace);});});}exports[_0x02cd('0x19')]=function(_0x332688){var _0x20b7ea=this;return new Promise(function(_0x3edee6,_0x1f51b1){return db[_0x02cd('0x1a')][_0x02cd('0x1b')]({'raw':_0x332688[_0x02cd('0x1c')]?_0x332688[_0x02cd('0x1c')][_0x02cd('0x1d')]===undefined?!![]:![]:!![],'where':_0x332688[_0x02cd('0x1c')]?_0x332688[_0x02cd('0x1c')]['where']||null:null,'attributes':_0x332688[_0x02cd('0x1c')]?_0x332688['options'][_0x02cd('0x1e')]||null:null,'limit':_0x332688[_0x02cd('0x1c')]?_0x332688['options'][_0x02cd('0x1f')]||null:null,'include':_0x332688[_0x02cd('0x1c')]?_0x332688['options'][_0x02cd('0x20')]?_[_0x02cd('0x21')](_0x332688[_0x02cd('0x1c')][_0x02cd('0x20')],function(_0x5d2fc1){return{'model':db[_0x5d2fc1[_0x02cd('0x22')]],'as':_0x5d2fc1['as'],'attributes':_0x5d2fc1[_0x02cd('0x1e')],'include':_0x5d2fc1[_0x02cd('0x20')]?_[_0x02cd('0x21')](_0x5d2fc1[_0x02cd('0x20')],function(_0x2762ba){return{'model':db[_0x2762ba[_0x02cd('0x22')]],'as':_0x2762ba['as'],'attributes':_0x2762ba[_0x02cd('0x1e')],'include':_0x2762ba[_0x02cd('0x20')]?_[_0x02cd('0x21')](_0x2762ba['include'],function(_0x139d7f){return{'model':db[_0x139d7f[_0x02cd('0x22')]],'as':_0x139d7f['as'],'attributes':_0x139d7f[_0x02cd('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x02cd('0x23')](function(_0x212b7d){logger[_0x02cd('0x10')](_0x02cd('0x19'),_0x332688);logger[_0x02cd('0x24')](_0x02cd('0x19'),_0x332688,JSON['stringify'](_0x212b7d));_0x3edee6(_0x212b7d);})[_0x02cd('0x25')](function(_0xbe10e8){logger[_0x02cd('0x14')](_0x02cd('0x19'),_0xbe10e8[_0x02cd('0x16')],_0x332688);_0x1f51b1(_0x20b7ea[_0x02cd('0x14')](0x1f4,_0xbe10e8['message']));});});}; \ No newline at end of file +var _0xce68=['model','map','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','register','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','limit','include'];(function(_0x5b0dc0,_0x5c586a){var _0x442d3c=function(_0x340de2){while(--_0x340de2){_0x5b0dc0['push'](_0x5b0dc0['shift']());}};_0x442d3c(++_0x5c586a);}(_0xce68,0x10c));var _0x8ce6=function(_0x2f805e,_0xfdce45){_0x2f805e=_0x2f805e-0x0;var _0x4081c9=_0xce68[_0x2f805e];return _0x4081c9;};'use strict';var _=require(_0x8ce6('0x0'));var util=require('util');var moment=require(_0x8ce6('0x1'));var BPromise=require(_0x8ce6('0x2'));var rs=require(_0x8ce6('0x3'));var fs=require('fs');var Redis=require(_0x8ce6('0x4'));var db=require(_0x8ce6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8ce6('0x6'))(_0x8ce6('0x7'));var config=require(_0x8ce6('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8ce6('0x9')][_0x8ce6('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x8ce6('0xb')],{'host':_0x8ce6('0xc'),'port':0x18eb});var socket=require(_0x8ce6('0xd'))(new Redis(config[_0x8ce6('0xb')]));require('./voiceExtension.socket')[_0x8ce6('0xe')](socket);function respondWithRpcPromise(_0x188e3c,_0x41618c,_0x3ef3d6){return new BPromise(function(_0x385973,_0xce7cb8){return client[_0x8ce6('0xf')](_0x188e3c,_0x3ef3d6)[_0x8ce6('0x10')](function(_0x442f4e){logger[_0x8ce6('0x11')](_0x8ce6('0x12'),_0x41618c,_0x8ce6('0x13'));logger[_0x8ce6('0x14')](_0x8ce6('0x15'),_0x41618c,_0x8ce6('0x13'),JSON[_0x8ce6('0x16')](_0x442f4e));if(_0x442f4e[_0x8ce6('0x17')]){if(_0x442f4e[_0x8ce6('0x17')]['code']===0x1f4){logger[_0x8ce6('0x17')]('VoiceExtension,\x20%s,\x20%s',_0x41618c,_0x442f4e[_0x8ce6('0x17')][_0x8ce6('0x18')]);return _0xce7cb8(_0x442f4e[_0x8ce6('0x17')][_0x8ce6('0x18')]);}logger[_0x8ce6('0x17')](_0x8ce6('0x12'),_0x41618c,_0x442f4e[_0x8ce6('0x17')][_0x8ce6('0x18')]);return _0x385973(_0x442f4e[_0x8ce6('0x17')][_0x8ce6('0x18')]);}else{logger['info'](_0x8ce6('0x12'),_0x41618c,'request\x20sent');_0x385973(_0x442f4e[_0x8ce6('0x19')][_0x8ce6('0x18')]);}})[_0x8ce6('0x1a')](function(_0x50e2f7){logger['error'](_0x8ce6('0x12'),_0x41618c,_0x50e2f7);_0xce7cb8(_0x50e2f7);});});}exports[_0x8ce6('0x1b')]=function(_0x4eb0df){var _0x1876eb=this;return new Promise(function(_0x1b2602,_0x444cba){return db[_0x8ce6('0x1c')][_0x8ce6('0x1d')]({'raw':_0x4eb0df[_0x8ce6('0x1e')]?_0x4eb0df[_0x8ce6('0x1e')][_0x8ce6('0x1f')]===undefined?!![]:![]:!![],'where':_0x4eb0df[_0x8ce6('0x1e')]?_0x4eb0df[_0x8ce6('0x1e')][_0x8ce6('0x20')]||null:null,'attributes':_0x4eb0df[_0x8ce6('0x1e')]?_0x4eb0df['options'][_0x8ce6('0x21')]||null:null,'limit':_0x4eb0df['options']?_0x4eb0df[_0x8ce6('0x1e')][_0x8ce6('0x22')]||null:null,'include':_0x4eb0df[_0x8ce6('0x1e')]?_0x4eb0df['options']['include']?_['map'](_0x4eb0df['options'][_0x8ce6('0x23')],function(_0x1e95cb){return{'model':db[_0x1e95cb[_0x8ce6('0x24')]],'as':_0x1e95cb['as'],'attributes':_0x1e95cb[_0x8ce6('0x21')],'include':_0x1e95cb[_0x8ce6('0x23')]?_[_0x8ce6('0x25')](_0x1e95cb['include'],function(_0x5656ab){return{'model':db[_0x5656ab[_0x8ce6('0x24')]],'as':_0x5656ab['as'],'attributes':_0x5656ab[_0x8ce6('0x21')],'include':_0x5656ab[_0x8ce6('0x23')]?_[_0x8ce6('0x25')](_0x5656ab[_0x8ce6('0x23')],function(_0x10a3f9){return{'model':db[_0x10a3f9['model']],'as':_0x10a3f9['as'],'attributes':_0x10a3f9['attributes']};}):[]};}):[]};}):[]:[]})[_0x8ce6('0x10')](function(_0xb35316){logger[_0x8ce6('0x11')]('GetVoiceExtension',_0x4eb0df);logger[_0x8ce6('0x14')](_0x8ce6('0x1b'),_0x4eb0df,JSON[_0x8ce6('0x16')](_0xb35316));_0x1b2602(_0xb35316);})[_0x8ce6('0x1a')](function(_0x4ae8a2){logger[_0x8ce6('0x17')](_0x8ce6('0x1b'),_0x4ae8a2['message'],_0x4eb0df);_0x444cba(_0x1876eb['error'](0x1f4,_0x4ae8a2[_0x8ce6('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 64b2aa3..9049915 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 _0x5fc3=['./voiceExtension.events','save','update','emit','removeListener','register','voiceExtension:'];(function(_0xeba907,_0x48670c){var _0x2f4776=function(_0x209390){while(--_0x209390){_0xeba907['push'](_0xeba907['shift']());}};_0x2f4776(++_0x48670c);}(_0x5fc3,0xa8));var _0x35fc=function(_0x2bf466,_0x4929a5){_0x2bf466=_0x2bf466-0x0;var _0x856885=_0x5fc3[_0x2bf466];return _0x856885;};'use strict';var VoiceExtensionEvents=require(_0x35fc('0x0'));var events=[_0x35fc('0x1'),'remove',_0x35fc('0x2')];function createListener(_0x2ac6da,_0x196bc2){return function(_0x91d024){_0x196bc2[_0x35fc('0x3')](_0x2ac6da,_0x91d024);};}function removeListener(_0x5e75e6,_0x2d1404){return function(){VoiceExtensionEvents[_0x35fc('0x4')](_0x5e75e6,_0x2d1404);};}exports[_0x35fc('0x5')]=function(_0x5b85ad){for(var _0x5754be=0x0,_0x19a0d1=events['length'];_0x5754be<_0x19a0d1;_0x5754be++){var _0x16e153=events[_0x5754be];var _0x27524f=createListener(_0x35fc('0x6')+_0x16e153,_0x5b85ad);VoiceExtensionEvents['on'](_0x16e153,_0x27524f);}}; \ No newline at end of file +var _0x5fc3=['./voiceExtension.events','save','update','emit','removeListener','register','voiceExtension:'];(function(_0x1d0a86,_0x424fd6){var _0x33d85b=function(_0xa548e9){while(--_0xa548e9){_0x1d0a86['push'](_0x1d0a86['shift']());}};_0x33d85b(++_0x424fd6);}(_0x5fc3,0xa8));var _0x35fc=function(_0x1c289a,_0x277fe7){_0x1c289a=_0x1c289a-0x0;var _0x28d68e=_0x5fc3[_0x1c289a];return _0x28d68e;};'use strict';var VoiceExtensionEvents=require(_0x35fc('0x0'));var events=[_0x35fc('0x1'),'remove',_0x35fc('0x2')];function createListener(_0x2ac6da,_0x196bc2){return function(_0x91d024){_0x196bc2[_0x35fc('0x3')](_0x2ac6da,_0x91d024);};}function removeListener(_0x5e75e6,_0x2d1404){return function(){VoiceExtensionEvents[_0x35fc('0x4')](_0x5e75e6,_0x2d1404);};}exports[_0x35fc('0x5')]=function(_0x5b85ad){for(var _0x5754be=0x0,_0x19a0d1=events['length'];_0x5754be<_0x19a0d1;_0x5754be++){var _0x16e153=events[_0x5754be];var _0x27524f=createListener(_0x35fc('0x6')+_0x16e153,_0x5b85ad);VoiceExtensionEvents['on'](_0x16e153,_0x27524f);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index a9af659..f5051ba 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 _0x326f=['multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','/:id','show','getMessages','post','create','put','delete','exports'];(function(_0x2993e4,_0x2af2db){var _0x4167b5=function(_0x2150a5){while(--_0x2150a5){_0x2993e4['push'](_0x2993e4['shift']());}};_0x4167b5(++_0x2af2db);}(_0x326f,0xd1));var _0xf326=function(_0x3279ac,_0x9c0657){_0x3279ac=_0x3279ac-0x0;var _0x2b52b0=_0x326f[_0x3279ac];return _0x2b52b0;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var fs_extra=require(_0xf326('0x4'));var auth=require(_0xf326('0x5'));var interaction=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var controller=require(_0xf326('0x8'));router[_0xf326('0x9')]('/',auth[_0xf326('0xa')](),controller['index']);router[_0xf326('0x9')](_0xf326('0xb'),auth[_0xf326('0xa')](),controller[_0xf326('0xc')]);router['get']('/:id/messages',auth['isAuthenticated'](),controller[_0xf326('0xd')]);router[_0xf326('0xe')]('/',auth[_0xf326('0xa')](),controller[_0xf326('0xf')]);router[_0xf326('0x10')]('/:id',auth[_0xf326('0xa')](),controller['update']);router[_0xf326('0x11')]('/:id',auth[_0xf326('0xa')](),controller['destroy']);module[_0xf326('0x12')]=router; \ No newline at end of file +var _0x6d11=['put','update','delete','destroy','multer','util','path','express','fs-extra','../../components/auth/service','./voiceMail.controller','get','isAuthenticated','index','/:id','getMessages','post'];(function(_0x3bb45b,_0x2dcc0b){var _0x513162=function(_0x46f44b){while(--_0x46f44b){_0x3bb45b['push'](_0x3bb45b['shift']());}};_0x513162(++_0x2dcc0b);}(_0x6d11,0xbf));var _0x16d1=function(_0x31fe6d,_0x495827){_0x31fe6d=_0x31fe6d-0x0;var _0x5e8b58=_0x6d11[_0x31fe6d];return _0x5e8b58;};'use strict';var multer=require(_0x16d1('0x0'));var util=require(_0x16d1('0x1'));var path=require(_0x16d1('0x2'));var timeout=require('connect-timeout');var express=require(_0x16d1('0x3'));var router=express['Router']();var fs_extra=require(_0x16d1('0x4'));var auth=require(_0x16d1('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x16d1('0x6'));router[_0x16d1('0x7')]('/',auth[_0x16d1('0x8')](),controller[_0x16d1('0x9')]);router[_0x16d1('0x7')](_0x16d1('0xa'),auth[_0x16d1('0x8')](),controller['show']);router['get']('/:id/messages',auth[_0x16d1('0x8')](),controller[_0x16d1('0xb')]);router[_0x16d1('0xc')]('/',auth[_0x16d1('0x8')](),controller['create']);router[_0x16d1('0xd')](_0x16d1('0xa'),auth[_0x16d1('0x8')](),controller[_0x16d1('0xe')]);router[_0x16d1('0xf')](_0x16d1('0xa'),auth[_0x16d1('0x8')](),controller[_0x16d1('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index c9f0321..ec953c2 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 _0x47b1=['TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','exports','STRING','contest_mailbox','setDataValue','email','string','trim','central','ENUM','yes'];(function(_0x397d79,_0x11c0fb){var _0x2928dc=function(_0x3e6b7b){while(--_0x3e6b7b){_0x397d79['push'](_0x397d79['shift']());}};_0x2928dc(++_0x11c0fb);}(_0x47b1,0xbc));var _0x147b=function(_0x1edb88,_0x29dcf4){_0x1edb88=_0x1edb88-0x0;var _0x3bfbdd=_0x47b1[_0x1edb88];return _0x3bfbdd;};'use strict';var Sequelize=require('sequelize');module[_0x147b('0x0')]={'customer_id':{'type':Sequelize[_0x147b('0x1')]},'context':{'type':Sequelize['STRING'],'defaultValue':'from-voicemail','unique':_0x147b('0x2')},'mailbox':{'type':Sequelize[_0x147b('0x1')],'defaultValue':'','allowNull':![],'unique':_0x147b('0x2')},'password':{'type':Sequelize[_0x147b('0x1')]},'fullname':{'type':Sequelize[_0x147b('0x1')]},'email':{'type':Sequelize[_0x147b('0x1')],'validate':{'isEmail':!![]},'set':function(_0x45382d){this[_0x147b('0x3')](_0x147b('0x4'),typeof _0x45382d===_0x147b('0x5')&&_0x45382d[_0x147b('0x6')]()?_0x45382d[_0x147b('0x6')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0x147b('0x1')],'defaultValue':_0x147b('0x7')},'attach':{'type':Sequelize[_0x147b('0x8')](_0x147b('0x9'),'no'),'defaultValue':_0x147b('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0x147b('0x8')]('yes','no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0x147b('0x1')]},'callback':{'type':Sequelize[_0x147b('0x1')]},'review':{'type':Sequelize[_0x147b('0x8')](_0x147b('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x147b('0x8')](_0x147b('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x147b('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x147b('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x147b('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x147b('0x8')](_0x147b('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x147b('0x8')]('yes','no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0x147b('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x147b('0x8')](_0x147b('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x147b('0x8')](_0x147b('0x9'),'no'),'defaultValue':_0x147b('0x9'),'allowNull':![]},'stamp':{'type':_0x147b('0xb')},'emailsubject':{'type':Sequelize[_0x147b('0x1')]},'emailbody':{'type':Sequelize[_0x147b('0x1')]},'maxsecs':{'type':Sequelize[_0x147b('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x147b('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x147b('0xd')],'get':function(){return this[_0x147b('0xe')](_0x147b('0xf'))+_0x147b('0x10')+this[_0x147b('0xe')](_0x147b('0x11'));}}}; \ No newline at end of file +var _0xce38=['INTEGER','VIRTUAL','fullname','getDataValue','mailbox','sequelize','exports','STRING','contest_mailbox','setDataValue','email','string','trim','central','ENUM','yes','TIMESTAMP'];(function(_0x54d5ae,_0x30e48c){var _0x474508=function(_0x17c2a9){while(--_0x17c2a9){_0x54d5ae['push'](_0x54d5ae['shift']());}};_0x474508(++_0x30e48c);}(_0xce38,0xc0));var _0x8ce3=function(_0x948e6c,_0x21ba9c){_0x948e6c=_0x948e6c-0x0;var _0x1302c5=_0xce38[_0x948e6c];return _0x1302c5;};'use strict';var Sequelize=require(_0x8ce3('0x0'));module[_0x8ce3('0x1')]={'customer_id':{'type':Sequelize[_0x8ce3('0x2')]},'context':{'type':Sequelize[_0x8ce3('0x2')],'defaultValue':'from-voicemail','unique':_0x8ce3('0x3')},'mailbox':{'type':Sequelize[_0x8ce3('0x2')],'defaultValue':'','allowNull':![],'unique':_0x8ce3('0x3')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0x8ce3('0x2')]},'email':{'type':Sequelize[_0x8ce3('0x2')],'validate':{'isEmail':!![]},'set':function(_0x572201){this[_0x8ce3('0x4')](_0x8ce3('0x5'),typeof _0x572201===_0x8ce3('0x6')&&_0x572201[_0x8ce3('0x7')]()?_0x572201[_0x8ce3('0x7')]():null);}},'pager':{'type':Sequelize[_0x8ce3('0x2')]},'tz':{'type':Sequelize[_0x8ce3('0x2')],'defaultValue':_0x8ce3('0x8')},'attach':{'type':Sequelize[_0x8ce3('0x9')](_0x8ce3('0xa'),'no'),'defaultValue':_0x8ce3('0xa'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0x8ce3('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0x8ce3('0x2')]},'callback':{'type':Sequelize[_0x8ce3('0x2')]},'review':{'type':Sequelize[_0x8ce3('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x8ce3('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x8ce3('0x9')](_0x8ce3('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x8ce3('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x8ce3('0x9')](_0x8ce3('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x8ce3('0x9')](_0x8ce3('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x8ce3('0x9')](_0x8ce3('0xa'),'no'),'defaultValue':_0x8ce3('0xa'),'allowNull':![]},'forcename':{'type':Sequelize[_0x8ce3('0x9')](_0x8ce3('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x8ce3('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x8ce3('0x9')](_0x8ce3('0xa'),'no'),'defaultValue':_0x8ce3('0xa'),'allowNull':![]},'stamp':{'type':_0x8ce3('0xb')},'emailsubject':{'type':Sequelize[_0x8ce3('0x2')]},'emailbody':{'type':Sequelize[_0x8ce3('0x2')]},'maxsecs':{'type':Sequelize[_0x8ce3('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x8ce3('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x8ce3('0xd')],'get':function(){return this['getDataValue'](_0x8ce3('0xe'))+'\x20-\x20'+this[_0x8ce3('0xf')](_0x8ce3('0x10'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index efa094d..43500b8 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 _0x0102=['rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','keys','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','getMessages','findOne','VoiceMailMessage','mailbox','findAndCountAll','rimraf','zip-dir','fast-json-patch','request-promise','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','reject','save','get','Voicemails','destroy','then','sendStatus','stack','name','send','index','VoiceMail'];(function(_0xd8186c,_0xbde792){var _0x5448fb=function(_0x3f9ccd){while(--_0x3f9ccd){_0xd8186c['push'](_0xd8186c['shift']());}};_0x5448fb(++_0xbde792);}(_0x0102,0x186));var _0x2010=function(_0x5e720a,_0x4afb01){_0x5e720a=_0x5e720a-0x0;var _0xfb0232=_0x0102[_0x5e720a];return _0xfb0232;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2010('0x0'));var zipdir=require(_0x2010('0x1'));var jsonpatch=require(_0x2010('0x2'));var rp=require(_0x2010('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x2010('0x4'));var csv=require(_0x2010('0x5'));var ejs=require(_0x2010('0x6'));var fs=require('fs');var fs_extra=require(_0x2010('0x7'));var _=require('lodash');var squel=require(_0x2010('0x8'));var crypto=require('crypto');var jsforce=require(_0x2010('0x9'));var deskjs=require(_0x2010('0xa'));var toCsv=require('to-csv');var querystring=require(_0x2010('0xb'));var Papa=require(_0x2010('0xc'));var Redis=require(_0x2010('0xd'));var authService=require(_0x2010('0xe'));var qs=require(_0x2010('0xf'));var as=require(_0x2010('0x10'));var hardwareService=require(_0x2010('0x11'));var logger=require(_0x2010('0x12'))(_0x2010('0x13'));var utils=require(_0x2010('0x14'));var config=require(_0x2010('0x15'));var licenseUtil=require(_0x2010('0x16'));var db=require(_0x2010('0x17'))['db'];function respondWithStatusCode(_0x3f307c,_0x3e8624){_0x3e8624=_0x3e8624||0xcc;return function(_0x388991){if(_0x388991){return _0x3f307c['sendStatus'](_0x3e8624);}return _0x3f307c['status'](_0x3e8624)[_0x2010('0x18')]();};}function respondWithResult(_0x385720,_0x2e8ec2){_0x2e8ec2=_0x2e8ec2||0xc8;return function(_0x10b587){if(_0x10b587){return _0x385720[_0x2010('0x19')](_0x2e8ec2)[_0x2010('0x1a')](_0x10b587);}};}function respondWithFilteredResult(_0x517ff4,_0x3195fa){return function(_0x136418){if(_0x136418){var _0x5ad412=typeof _0x3195fa[_0x2010('0x1b')]===_0x2010('0x1c')&&typeof _0x3195fa[_0x2010('0x1d')]===_0x2010('0x1c');var _0x2d0bf2=_0x136418[_0x2010('0x1e')];var _0x83cd35=_0x5ad412?0x0:_0x3195fa[_0x2010('0x1b')];var _0x309477=_0x5ad412?_0x136418['count']:_0x3195fa['offset']+_0x3195fa[_0x2010('0x1d')];var _0x38a15a;if(_0x309477>=_0x2d0bf2){_0x309477=_0x2d0bf2;_0x38a15a=0xc8;}else{_0x38a15a=0xce;}_0x517ff4[_0x2010('0x19')](_0x38a15a);return _0x517ff4[_0x2010('0x1f')]('Content-Range',_0x83cd35+'-'+_0x309477+'/'+_0x2d0bf2)['json'](_0x136418);}return null;};}function patchUpdates(_0x22c252){return function(_0x171e45){try{jsonpatch[_0x2010('0x20')](_0x171e45,_0x22c252,!![]);}catch(_0x26facc){return BPromise[_0x2010('0x21')](_0x26facc);}return _0x171e45[_0x2010('0x22')]();};}function saveUpdates(_0x4f621c,_0x3db13d){return function(_0x1cfa57){if(_0x1cfa57){return _0x1cfa57['update'](_0x4f621c)['then'](function(_0x50aecc){return _0x50aecc;});}return null;};}function removeEntity(_0x424453,_0x574719){return function(_0x277dcc){if(_0x277dcc){return _0x277dcc['destroy']()['then'](function(){var _0xdb57be=_0x277dcc[_0x2010('0x23')]({'plain':!![]});var _0x52b4fe=_0x2010('0x24');return db['UserProfileResource'][_0x2010('0x25')]({'where':{'type':_0x52b4fe,'resourceId':_0xdb57be['id']}})[_0x2010('0x26')](function(){return _0x277dcc;});})[_0x2010('0x26')](function(){_0x424453[_0x2010('0x19')](0xcc)[_0x2010('0x18')]();});}};}function handleEntityNotFound(_0x2f63bb,_0x981b65){return function(_0x3eb4dc){if(!_0x3eb4dc){_0x2f63bb[_0x2010('0x27')](0x194);}return _0x3eb4dc;};}function handleError(_0x103460,_0x122ee3){_0x122ee3=_0x122ee3||0x1f4;return function(_0x2ebdbb){logger['error'](_0x2ebdbb[_0x2010('0x28')]);if(_0x2ebdbb['name']){delete _0x2ebdbb[_0x2010('0x29')];}_0x103460[_0x2010('0x19')](_0x122ee3)[_0x2010('0x2a')](_0x2ebdbb);};}exports[_0x2010('0x2b')]=function(_0x564a64,_0x554f66){var _0x136d5f={},_0x48d9f2={},_0x2839f2={'count':0x0,'rows':[]};var _0x1d5d7a=_['map'](db[_0x2010('0x2c')][_0x2010('0x2d')],function(_0x2b1ff7){return{'name':_0x2b1ff7[_0x2010('0x2e')],'type':_0x2b1ff7[_0x2010('0x2f')]['key']};});_0x48d9f2[_0x2010('0x30')]=_[_0x2010('0x31')](_0x1d5d7a,_0x2010('0x29'));_0x48d9f2['query']=_['keys'](_0x564a64[_0x2010('0x32')]);_0x48d9f2[_0x2010('0x33')]=_[_0x2010('0x34')](_0x48d9f2['model'],_0x48d9f2['query']);_0x136d5f[_0x2010('0x35')]=_[_0x2010('0x34')](_0x48d9f2[_0x2010('0x30')],qs[_0x2010('0x36')](_0x564a64[_0x2010('0x32')]['fields']));_0x136d5f['attributes']=_0x136d5f['attributes'][_0x2010('0x37')]?_0x136d5f[_0x2010('0x35')]:_0x48d9f2[_0x2010('0x30')];if(!_0x564a64['query'][_0x2010('0x38')](_0x2010('0x39'))){_0x136d5f[_0x2010('0x1d')]=qs[_0x2010('0x1d')](_0x564a64['query'][_0x2010('0x1d')]);_0x136d5f[_0x2010('0x1b')]=qs[_0x2010('0x1b')](_0x564a64['query'][_0x2010('0x1b')]);}_0x136d5f['order']=qs[_0x2010('0x3a')](_0x564a64[_0x2010('0x32')][_0x2010('0x3a')]);_0x136d5f[_0x2010('0x3b')]=qs[_0x2010('0x33')](_[_0x2010('0x3c')](_0x564a64['query'],_0x48d9f2[_0x2010('0x33')]),_0x1d5d7a);if(_0x564a64['query'][_0x2010('0x3d')]){_0x136d5f[_0x2010('0x3b')]=_[_0x2010('0x3e')](_0x136d5f[_0x2010('0x3b')],{'$or':_[_0x2010('0x31')](_0x1d5d7a,function(_0x1f053c){if(_0x1f053c[_0x2010('0x2f')]!==_0x2010('0x3f')){var _0x2fcaef={};_0x2fcaef[_0x1f053c[_0x2010('0x29')]]={'$like':'%'+_0x564a64[_0x2010('0x32')][_0x2010('0x3d')]+'%'};return _0x2fcaef;}})});}_0x136d5f=_[_0x2010('0x3e')]({},_0x136d5f,_0x564a64[_0x2010('0x40')]);var _0x4b6251={'where':_0x136d5f['where']};return db[_0x2010('0x2c')][_0x2010('0x1e')](_0x4b6251)[_0x2010('0x26')](function(_0x35d631){_0x2839f2[_0x2010('0x1e')]=_0x35d631;if(_0x564a64[_0x2010('0x32')][_0x2010('0x41')]){_0x136d5f['include']=[{'all':!![]}];}return db[_0x2010('0x2c')]['findAll'](_0x136d5f);})[_0x2010('0x26')](function(_0x3ff496){_0x2839f2[_0x2010('0x42')]=_0x3ff496;return _0x2839f2;})[_0x2010('0x26')](respondWithFilteredResult(_0x554f66,_0x136d5f))[_0x2010('0x43')](handleError(_0x554f66,null));};exports['show']=function(_0x364338,_0x71eb35){var _0x3dd83c={'raw':!![],'where':{'id':_0x364338['params']['id']}},_0x41b3b5={};_0x41b3b5[_0x2010('0x30')]=_['keys'](db['VoiceMail']['rawAttributes']);_0x41b3b5[_0x2010('0x32')]=_[_0x2010('0x44')](_0x364338[_0x2010('0x32')]);_0x41b3b5[_0x2010('0x33')]=_[_0x2010('0x34')](_0x41b3b5[_0x2010('0x30')],_0x41b3b5['query']);_0x3dd83c[_0x2010('0x35')]=_[_0x2010('0x34')](_0x41b3b5[_0x2010('0x30')],qs['fields'](_0x364338['query'][_0x2010('0x36')]));_0x3dd83c['attributes']=_0x3dd83c[_0x2010('0x35')][_0x2010('0x37')]?_0x3dd83c[_0x2010('0x35')]:_0x41b3b5[_0x2010('0x30')];if(_0x364338['query'][_0x2010('0x41')]){_0x3dd83c[_0x2010('0x45')]=[{'all':!![]}];}_0x3dd83c=_[_0x2010('0x3e')]({},_0x3dd83c,_0x364338[_0x2010('0x40')]);return db[_0x2010('0x2c')][_0x2010('0x46')](_0x3dd83c)['then'](handleEntityNotFound(_0x71eb35,null))[_0x2010('0x26')](respondWithResult(_0x71eb35,null))[_0x2010('0x43')](handleError(_0x71eb35,null));};exports[_0x2010('0x47')]=function(_0x4dc0cf,_0x30e5d0){return db[_0x2010('0x2c')]['create'](_0x4dc0cf[_0x2010('0x48')],{})[_0x2010('0x26')](function(_0x110791){var _0x242274=_0x4dc0cf[_0x2010('0x49')][_0x2010('0x23')]({'plain':!![]});if(!_0x242274)throw new Error(_0x2010('0x4a'));if(_0x242274[_0x2010('0x4b')]==='user'){var _0x5258b9=_0x110791[_0x2010('0x23')]({'plain':!![]});var _0xe1721f='Voicemails';return db[_0x2010('0x4c')][_0x2010('0x46')]({'where':{'name':_0xe1721f,'userProfileId':_0x242274[_0x2010('0x4d')]},'raw':!![]})[_0x2010('0x26')](function(_0x1f1a59){if(_0x1f1a59&&_0x1f1a59['autoAssociation']===0x0){return db['UserProfileResource'][_0x2010('0x47')]({'name':_0x5258b9[_0x2010('0x29')],'resourceId':_0x5258b9['id'],'type':_0x1f1a59[_0x2010('0x29')],'sectionId':_0x1f1a59['id']},{})[_0x2010('0x26')](function(){return _0x110791;});}else{return _0x110791;}})[_0x2010('0x43')](function(_0x2d8164){logger[_0x2010('0x4e')](_0x2010('0x4f'),_0x2d8164);throw _0x2d8164;});}return _0x110791;})[_0x2010('0x26')](respondWithResult(_0x30e5d0,0xc9))[_0x2010('0x43')](handleError(_0x30e5d0,null));};exports[_0x2010('0x50')]=function(_0x5313b5,_0x24421a){if(_0x5313b5[_0x2010('0x48')]['id']){delete _0x5313b5['body']['id'];}return db[_0x2010('0x2c')][_0x2010('0x46')]({'where':{'id':_0x5313b5[_0x2010('0x51')]['id']}})[_0x2010('0x26')](handleEntityNotFound(_0x24421a,null))[_0x2010('0x26')](saveUpdates(_0x5313b5[_0x2010('0x48')],null))[_0x2010('0x26')](respondWithResult(_0x24421a,null))[_0x2010('0x43')](handleError(_0x24421a,null));};exports[_0x2010('0x25')]=function(_0x2dbc2c,_0x1c0b2d){return db[_0x2010('0x2c')][_0x2010('0x46')]({'where':{'id':_0x2dbc2c[_0x2010('0x51')]['id']}})[_0x2010('0x26')](handleEntityNotFound(_0x1c0b2d,null))[_0x2010('0x26')](removeEntity(_0x1c0b2d,null))[_0x2010('0x43')](handleError(_0x1c0b2d,null));};exports[_0x2010('0x52')]=function(_0x2d7765,_0x6f8565,_0x21ee87){return db[_0x2010('0x2c')][_0x2010('0x53')]({'where':{'id':_0x2d7765['params']['id']}})[_0x2010('0x26')](handleEntityNotFound(_0x6f8565,null))['then'](function(_0x5253d5){var _0x1225d7;var _0x13f33d={},_0x4fb5d5={};_0x4fb5d5[_0x2010('0x30')]=_[_0x2010('0x44')](db[_0x2010('0x54')][_0x2010('0x2d')]);_0x4fb5d5['query']=_[_0x2010('0x44')](_0x2d7765[_0x2010('0x32')]);_0x4fb5d5[_0x2010('0x33')]=_[_0x2010('0x34')](_0x4fb5d5['model'],_0x4fb5d5[_0x2010('0x32')]);_0x13f33d['attributes']=_[_0x2010('0x34')](_0x4fb5d5[_0x2010('0x30')],qs[_0x2010('0x36')](_0x2d7765[_0x2010('0x32')]['fields']));_0x13f33d['attributes']=_0x13f33d[_0x2010('0x35')][_0x2010('0x37')]?_0x13f33d['attributes']:_0x4fb5d5['model'];if(!_0x2d7765[_0x2010('0x32')][_0x2010('0x38')](_0x2010('0x39'))){_0x13f33d[_0x2010('0x1d')]=qs['limit'](_0x2d7765[_0x2010('0x32')]['limit']);_0x13f33d[_0x2010('0x1b')]=qs[_0x2010('0x1b')](_0x2d7765[_0x2010('0x32')][_0x2010('0x1b')]);}_0x13f33d['order']=qs[_0x2010('0x3a')](_0x2d7765[_0x2010('0x32')]['sort']);_0x13f33d[_0x2010('0x3b')]=qs[_0x2010('0x33')](_[_0x2010('0x3c')](_0x2d7765[_0x2010('0x32')],_0x4fb5d5[_0x2010('0x33')]));if(_0x2d7765[_0x2010('0x32')][_0x2010('0x3d')]){_0x13f33d[_0x2010('0x3b')]=_[_0x2010('0x3e')](_0x13f33d[_0x2010('0x3b')],{'$or':_[_0x2010('0x31')](_0x13f33d[_0x2010('0x35')],function(_0x4ebdca){var _0x3ca7b3={};_0x3ca7b3[_0x4ebdca]={'$like':'%'+_0x2d7765[_0x2010('0x32')][_0x2010('0x3d')]+'%'};return _0x3ca7b3;})});}_0x13f33d['where']=_['merge'](_0x13f33d[_0x2010('0x3b')],{'mailboxuser':_0x5253d5[_0x2010('0x55')]});_0x13f33d=_[_0x2010('0x3e')]({},_0x13f33d,_0x2d7765[_0x2010('0x40')]);return db[_0x2010('0x54')][_0x2010('0x56')](_0x13f33d)['then'](respondWithFilteredResult(_0x6f8565,_0x13f33d));})[_0x2010('0x43')](handleError(_0x6f8565,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(_0x35de72,_0x5e48a5){var _0x4f91e5=function(_0x52ad13){while(--_0x52ad13){_0x35de72['push'](_0x35de72['shift']());}};_0x4f91e5(++_0x5e48a5);}(_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 0509015..70dde41 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 _0xd9b5=['exports','VoiceMail','voice_voicemail','mailbox_context','mailbox','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./voiceMail.attributes'];(function(_0x3132e8,_0x499a0e){var _0x43eb8c=function(_0x2321e1){while(--_0x2321e1){_0x3132e8['push'](_0x3132e8['shift']());}};_0x43eb8c(++_0x499a0e);}(_0xd9b5,0x91));var _0x5d9b=function(_0x34e07a,_0x459810){_0x34e07a=_0x34e07a-0x0;var _0x2816d0=_0xd9b5[_0x34e07a];return _0x2816d0;};'use strict';var _=require(_0x5d9b('0x0'));var util=require(_0x5d9b('0x1'));var logger=require(_0x5d9b('0x2'))(_0x5d9b('0x3'));var moment=require(_0x5d9b('0x4'));var BPromise=require('bluebird');var rp=require(_0x5d9b('0x5'));var fs=require('fs');var path=require(_0x5d9b('0x6'));var rimraf=require(_0x5d9b('0x7'));var config=require('../../config/environment');var attributes=require(_0x5d9b('0x8'));module[_0x5d9b('0x9')]=function(_0xea99ed,_0x1d4bb0){return _0xea99ed['define'](_0x5d9b('0xa'),attributes,{'tableName':_0x5d9b('0xb'),'paranoid':![],'indexes':[{'name':_0x5d9b('0xc'),'fields':[_0x5d9b('0xd'),'context']}],'timestamps':!![]});}; \ No newline at end of file +var _0x2802=['moment','bluebird','rimraf','../../config/environment','define','VoiceMail','mailbox','context','lodash','../../config/logger','api'];(function(_0x9c0a83,_0x30431e){var _0x1c8b7c=function(_0x1559b4){while(--_0x1559b4){_0x9c0a83['push'](_0x9c0a83['shift']());}};_0x1c8b7c(++_0x30431e);}(_0x2802,0x76));var _0x2280=function(_0x2b9e8a,_0x7b21d4){_0x2b9e8a=_0x2b9e8a-0x0;var _0x520e67=_0x2802[_0x2b9e8a];return _0x520e67;};'use strict';var _=require(_0x2280('0x0'));var util=require('util');var logger=require(_0x2280('0x1'))(_0x2280('0x2'));var moment=require(_0x2280('0x3'));var BPromise=require(_0x2280('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2280('0x5'));var config=require(_0x2280('0x6'));var attributes=require('./voiceMail.attributes');module['exports']=function(_0x226a13,_0x333c72){return _0x226a13[_0x2280('0x7')](_0x2280('0x8'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x2280('0x9'),_0x2280('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 5fc21ae..8495ad1 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 _0x9197=['message','VoiceMail,\x20%s,\x20%s','result','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','error'];(function(_0x37eae7,_0x5d27bb){var _0x51b227=function(_0x23a90a){while(--_0x23a90a){_0x37eae7['push'](_0x37eae7['shift']());}};_0x51b227(++_0x5d27bb);}(_0x9197,0x13e));var _0x7919=function(_0x2120a0,_0xd955dc){_0x2120a0=_0x2120a0-0x0;var _0x62cb6c=_0x9197[_0x2120a0];return _0x62cb6c;};'use strict';var _=require(_0x7919('0x0'));var util=require(_0x7919('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7919('0x2'));var fs=require('fs');var Redis=require(_0x7919('0x3'));var db=require(_0x7919('0x4'))['db'];var utils=require(_0x7919('0x5'));var logger=require(_0x7919('0x6'))(_0x7919('0x7'));var config=require('../../config/environment');var jayson=require(_0x7919('0x8'));var client=jayson[_0x7919('0x9')][_0x7919('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x9631fb,_0x2650fc,_0x78647f){return new BPromise(function(_0x50382b,_0x538f36){return client[_0x7919('0xb')](_0x9631fb,_0x78647f)[_0x7919('0xc')](function(_0x5e9041){logger[_0x7919('0xd')]('VoiceMail,\x20%s,\x20%s',_0x2650fc,_0x7919('0xe'));logger[_0x7919('0xf')](_0x7919('0x10'),_0x2650fc,_0x7919('0xe'),JSON['stringify'](_0x5e9041));if(_0x5e9041[_0x7919('0x11')]){if(_0x5e9041[_0x7919('0x11')]['code']===0x1f4){logger[_0x7919('0x11')]('VoiceMail,\x20%s,\x20%s',_0x2650fc,_0x5e9041[_0x7919('0x11')][_0x7919('0x12')]);return _0x538f36(_0x5e9041['error'][_0x7919('0x12')]);}logger[_0x7919('0x11')](_0x7919('0x13'),_0x2650fc,_0x5e9041[_0x7919('0x11')]['message']);return _0x50382b(_0x5e9041[_0x7919('0x11')]['message']);}else{logger['info'](_0x7919('0x13'),_0x2650fc,_0x7919('0xe'));_0x50382b(_0x5e9041[_0x7919('0x14')][_0x7919('0x12')]);}})['catch'](function(_0x2d5b2e){logger[_0x7919('0x11')](_0x7919('0x13'),_0x2650fc,_0x2d5b2e);_0x538f36(_0x2d5b2e);});});} \ No newline at end of file +var _0xe7bb=['error','code','VoiceMail,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','request\x20sent','debug','stringify'];(function(_0x5d71a0,_0x3d7016){var _0x562b8c=function(_0x16b1ca){while(--_0x16b1ca){_0x5d71a0['push'](_0x5d71a0['shift']());}};_0x562b8c(++_0x3d7016);}(_0xe7bb,0xd5));var _0xbe7b=function(_0x41e8b9,_0x2c237c){_0x41e8b9=_0x41e8b9-0x0;var _0x185f18=_0xe7bb[_0x41e8b9];return _0x185f18;};'use strict';var _=require(_0xbe7b('0x0'));var util=require(_0xbe7b('0x1'));var moment=require(_0xbe7b('0x2'));var BPromise=require(_0xbe7b('0x3'));var rs=require(_0xbe7b('0x4'));var fs=require('fs');var Redis=require(_0xbe7b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe7b('0x6'));var logger=require(_0xbe7b('0x7'))(_0xbe7b('0x8'));var config=require('../../config/environment');var jayson=require(_0xbe7b('0x9'));var client=jayson[_0xbe7b('0xa')][_0xbe7b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x31c3cb,_0x12fa53,_0x4df12f){return new BPromise(function(_0x310e58,_0x184c37){return client[_0xbe7b('0xc')](_0x31c3cb,_0x4df12f)['then'](function(_0x274df1){logger[_0xbe7b('0xd')]('VoiceMail,\x20%s,\x20%s',_0x12fa53,_0xbe7b('0xe'));logger[_0xbe7b('0xf')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x12fa53,_0xbe7b('0xe'),JSON[_0xbe7b('0x10')](_0x274df1));if(_0x274df1[_0xbe7b('0x11')]){if(_0x274df1[_0xbe7b('0x11')][_0xbe7b('0x12')]===0x1f4){logger[_0xbe7b('0x11')](_0xbe7b('0x13'),_0x12fa53,_0x274df1[_0xbe7b('0x11')]['message']);return _0x184c37(_0x274df1[_0xbe7b('0x11')][_0xbe7b('0x14')]);}logger[_0xbe7b('0x11')](_0xbe7b('0x13'),_0x12fa53,_0x274df1[_0xbe7b('0x11')]['message']);return _0x310e58(_0x274df1[_0xbe7b('0x11')]['message']);}else{logger[_0xbe7b('0xd')](_0xbe7b('0x13'),_0x12fa53,'request\x20sent');_0x310e58(_0x274df1[_0xbe7b('0x15')][_0xbe7b('0x14')]);}})[_0xbe7b('0x16')](function(_0x1c07b){logger[_0xbe7b('0x11')](_0xbe7b('0x13'),_0x12fa53,_0x1c07b);_0x184c37(_0x1c07b);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 2ef1c7f..8493084 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 _0x4d3c=['update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4d3c,0x14e));var _0xc4d3=function(_0x526eb9,_0xa3bf6c){_0x526eb9=_0x526eb9-0x0;var _0xe2c0f1=_0x4d3c[_0x526eb9];return _0xe2c0f1;};'use strict';var multer=require(_0xc4d3('0x0'));var util=require(_0xc4d3('0x1'));var path=require(_0xc4d3('0x2'));var timeout=require(_0xc4d3('0x3'));var express=require('express');var router=express[_0xc4d3('0x4')]();var fs_extra=require(_0xc4d3('0x5'));var auth=require(_0xc4d3('0x6'));var interaction=require(_0xc4d3('0x7'));var config=require('../../config/environment');var controller=require('./voiceMailMessage.controller');router[_0xc4d3('0x8')]('/',auth[_0xc4d3('0x9')](),controller[_0xc4d3('0xa')]);router[_0xc4d3('0x8')](_0xc4d3('0xb'),auth['isAuthenticated'](),controller[_0xc4d3('0xc')]);router[_0xc4d3('0x8')](_0xc4d3('0xd'),auth[_0xc4d3('0x9')](),controller[_0xc4d3('0xe')]);router[_0xc4d3('0xf')]('/',auth['isAuthenticated'](),controller[_0xc4d3('0x10')]);router[_0xc4d3('0x11')]('/:id',auth[_0xc4d3('0x9')](),controller[_0xc4d3('0x12')]);router[_0xc4d3('0x13')]('/:id',auth[_0xc4d3('0x9')](),controller[_0xc4d3('0x14')]);module[_0xc4d3('0x15')]=router; \ No newline at end of file +var _0x8e35=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','/:id/download','download','post','create','put','update','delete','destroy','exports','util'];(function(_0x57ebed,_0xfac0ac){var _0x3a0874=function(_0x271491){while(--_0x271491){_0x57ebed['push'](_0x57ebed['shift']());}};_0x3a0874(++_0xfac0ac);}(_0x8e35,0x8b));var _0x58e3=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x8e35[_0x21a9d9];return _0x46adce;};'use strict';var multer=require('multer');var util=require(_0x58e3('0x0'));var path=require('path');var timeout=require(_0x58e3('0x1'));var express=require('express');var router=express[_0x58e3('0x2')]();var fs_extra=require(_0x58e3('0x3'));var auth=require(_0x58e3('0x4'));var interaction=require(_0x58e3('0x5'));var config=require(_0x58e3('0x6'));var controller=require(_0x58e3('0x7'));router[_0x58e3('0x8')]('/',auth[_0x58e3('0x9')](),controller[_0x58e3('0xa')]);router[_0x58e3('0x8')]('/:id',auth[_0x58e3('0x9')](),controller['show']);router[_0x58e3('0x8')](_0x58e3('0xb'),auth['isAuthenticated'](),controller[_0x58e3('0xc')]);router[_0x58e3('0xd')]('/',auth[_0x58e3('0x9')](),controller[_0x58e3('0xe')]);router[_0x58e3('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x58e3('0x10')]);router[_0x58e3('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x58e3('0x12')]);module[_0x58e3('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 7d958db..c77b225 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 _0x2868=['BLOB','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','VIRTUAL','getDataValue','INTEGER','STRING'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x2868,0x80));var _0x8286=function(_0x208d99,_0x4701d1){_0x208d99=_0x208d99-0x0;var _0x579e56=_0x2868[_0x208d99];return _0x579e56;};'use strict';var Sequelize=require(_0x8286('0x0'));module['exports']={'name':{'type':Sequelize[_0x8286('0x1')],'get':function(_0xfd026a){return this[_0x8286('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x8286('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x8286('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0x8286('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x8286('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0x8286('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0x8286('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0x8286('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x8286('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x8286('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0x8286('0x5')]('long'),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0x8286('0x4')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize['literal'](_0x8286('0x6'))}}; \ No newline at end of file +var _0x12c7=['literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','VIRTUAL','INTEGER','STRING','BLOB','long','TIMESTAMP'];(function(_0x1653bf,_0x43083b){var _0xe57166=function(_0x2cc1f0){while(--_0x2cc1f0){_0x1653bf['push'](_0x1653bf['shift']());}};_0xe57166(++_0x43083b);}(_0x12c7,0x14c));var _0x712c=function(_0x24ba59,_0x19178b){_0x24ba59=_0x24ba59-0x0;var _0x2f473c=_0x12c7[_0x24ba59];return _0x2f473c;};'use strict';var Sequelize=require(_0x712c('0x0'));module[_0x712c('0x1')]={'name':{'type':Sequelize[_0x712c('0x2')],'get':function(_0x10ec88){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0x712c('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x712c('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0x712c('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0x712c('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0x712c('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x712c('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0x712c('0x5')](_0x712c('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0x712c('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0x712c('0x7'),'defaultValue':Sequelize[_0x712c('0x8')](_0x712c('0x9'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 44e8826..7ef8b4d 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 _0x59c5=['end','stack','name','send','VoiceMailMessage','rawAttributes','fieldName','type','key','model','differenceBy','map','keys','query','filters','intersection','attributes','length','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','catch','show','params','fields','create','body','update','find','download','recording','msg_id','Sequelize','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','set','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','Content-Range','apply','reject','save','then','destroy'];(function(_0x13af42,_0x2bacc6){var _0x588344=function(_0x10595a){while(--_0x10595a){_0x13af42['push'](_0x13af42['shift']());}};_0x588344(++_0x2bacc6);}(_0x59c5,0x134));var _0x559c=function(_0x8485ba,_0x3c72d3){_0x8485ba=_0x8485ba-0x0;var _0x26dca3=_0x59c5[_0x8485ba];return _0x26dca3;};'use strict';var emlformat=require(_0x559c('0x0'));var rimraf=require(_0x559c('0x1'));var zipdir=require(_0x559c('0x2'));var jsonpatch=require(_0x559c('0x3'));var rp=require(_0x559c('0x4'));var moment=require(_0x559c('0x5'));var BPromise=require(_0x559c('0x6'));var Mustache=require(_0x559c('0x7'));var util=require('util');var path=require('path');var sox=require(_0x559c('0x8'));var csv=require('to-csv');var ejs=require(_0x559c('0x9'));var fs=require('fs');var fs_extra=require(_0x559c('0xa'));var _=require(_0x559c('0xb'));var squel=require('squel');var crypto=require(_0x559c('0xc'));var jsforce=require(_0x559c('0xd'));var deskjs=require(_0x559c('0xe'));var toCsv=require(_0x559c('0xf'));var querystring=require(_0x559c('0x10'));var Papa=require(_0x559c('0x11'));var Redis=require(_0x559c('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x559c('0x13'));var as=require(_0x559c('0x14'));var hardwareService=require(_0x559c('0x15'));var logger=require(_0x559c('0x16'))(_0x559c('0x17'));var utils=require('../../config/utils');var config=require(_0x559c('0x18'));var licenseUtil=require(_0x559c('0x19'));var db=require(_0x559c('0x1a'))['db'];function respondWithStatusCode(_0x92929f,_0x410cdb){_0x410cdb=_0x410cdb||0xcc;return function(_0x5c823){if(_0x5c823){return _0x92929f[_0x559c('0x1b')](_0x410cdb);}return _0x92929f[_0x559c('0x1c')](_0x410cdb)['end']();};}function respondWithResult(_0x26ca33,_0x4b8a34){_0x4b8a34=_0x4b8a34||0xc8;return function(_0xc58f65){if(_0xc58f65){return _0x26ca33['status'](_0x4b8a34)[_0x559c('0x1d')](_0xc58f65);}};}function respondWithFilteredResult(_0x16703b,_0xb9cc4e){return function(_0x483eb9){if(_0x483eb9){var _0x2bcc57=typeof _0xb9cc4e['offset']===_0x559c('0x1e')&&typeof _0xb9cc4e['limit']===_0x559c('0x1e');var _0x59875d=_0x483eb9[_0x559c('0x1f')];var _0x30dfae=_0x2bcc57?0x0:_0xb9cc4e[_0x559c('0x20')];var _0x5a8152=_0x2bcc57?_0x483eb9[_0x559c('0x1f')]:_0xb9cc4e['offset']+_0xb9cc4e[_0x559c('0x21')];var _0xfa049b;if(_0x5a8152>=_0x59875d){_0x5a8152=_0x59875d;_0xfa049b=0xc8;}else{_0xfa049b=0xce;}_0x16703b['status'](_0xfa049b);return _0x16703b['set'](_0x559c('0x22'),_0x30dfae+'-'+_0x5a8152+'/'+_0x59875d)[_0x559c('0x1d')](_0x483eb9);}return null;};}function patchUpdates(_0xeaf7a1){return function(_0x3bd904){try{jsonpatch[_0x559c('0x23')](_0x3bd904,_0xeaf7a1,!![]);}catch(_0x2e376d){return BPromise[_0x559c('0x24')](_0x2e376d);}return _0x3bd904[_0x559c('0x25')]();};}function saveUpdates(_0x11f8f1,_0xd6b5f2){return function(_0x1e33de){if(_0x1e33de){return _0x1e33de['update'](_0x11f8f1)[_0x559c('0x26')](function(_0x17c98f){return _0x17c98f;});}return null;};}function removeEntity(_0x11d54d,_0x4d703c){return function(_0x25edff){if(_0x25edff){return _0x25edff[_0x559c('0x27')]()[_0x559c('0x26')](function(){_0x11d54d[_0x559c('0x1c')](0xcc)[_0x559c('0x28')]();});}};}function handleEntityNotFound(_0x571443,_0xcf9b1d){return function(_0x595539){if(!_0x595539){_0x571443[_0x559c('0x1b')](0x194);}return _0x595539;};}function handleError(_0x434e7a,_0x58e48e){_0x58e48e=_0x58e48e||0x1f4;return function(_0x208430){logger['error'](_0x208430[_0x559c('0x29')]);if(_0x208430[_0x559c('0x2a')]){delete _0x208430[_0x559c('0x2a')];}_0x434e7a[_0x559c('0x1c')](_0x58e48e)[_0x559c('0x2b')](_0x208430);};}exports['index']=function(_0x22b0be,_0x214198){var _0x526aea={},_0x140443={},_0x152abb={'count':0x0,'rows':[]};var _0x45e6e9=_['map'](db[_0x559c('0x2c')][_0x559c('0x2d')],function(_0x193c96){return{'name':_0x193c96[_0x559c('0x2e')],'type':_0x193c96[_0x559c('0x2f')][_0x559c('0x30')]};});_0x140443[_0x559c('0x31')]=_[_0x559c('0x32')](_[_0x559c('0x33')](_0x45e6e9,_0x559c('0x2a')),[_0x559c('0x2a')]);_0x140443['query']=_[_0x559c('0x34')](_0x22b0be[_0x559c('0x35')]);_0x140443[_0x559c('0x36')]=_[_0x559c('0x37')](_0x140443['model'],_0x140443[_0x559c('0x35')]);_0x526aea[_0x559c('0x38')]=_[_0x559c('0x37')](_0x140443[_0x559c('0x31')],qs['fields'](_0x22b0be[_0x559c('0x35')]['fields']));_0x526aea[_0x559c('0x38')]=_0x526aea[_0x559c('0x38')][_0x559c('0x39')]?_0x526aea[_0x559c('0x38')]:_0x140443[_0x559c('0x31')];if(!_0x22b0be[_0x559c('0x35')]['hasOwnProperty'](_0x559c('0x3a'))){_0x526aea[_0x559c('0x21')]=qs['limit'](_0x22b0be[_0x559c('0x35')][_0x559c('0x21')]);_0x526aea[_0x559c('0x20')]=qs['offset'](_0x22b0be[_0x559c('0x35')][_0x559c('0x20')]);}_0x526aea[_0x559c('0x3b')]=qs[_0x559c('0x3c')](_0x22b0be[_0x559c('0x35')][_0x559c('0x3c')]);_0x526aea[_0x559c('0x3d')]=qs['filters'](_[_0x559c('0x3e')](_0x22b0be[_0x559c('0x35')],_0x140443['filters']),_0x45e6e9);if(_0x22b0be[_0x559c('0x35')][_0x559c('0x3f')]){_0x526aea[_0x559c('0x3d')]=_[_0x559c('0x40')](_0x526aea['where'],{'$or':_[_0x559c('0x33')](_0x45e6e9,function(_0x5736f9){if(_0x5736f9['type']!=='VIRTUAL'){var _0x476c00={};_0x476c00[_0x5736f9[_0x559c('0x2a')]]={'$like':'%'+_0x22b0be[_0x559c('0x35')]['filter']+'%'};return _0x476c00;}})});}_0x526aea=_[_0x559c('0x40')]({},_0x526aea,_0x22b0be[_0x559c('0x41')]);var _0x1fcfdc={'where':_0x526aea[_0x559c('0x3d')]};return db[_0x559c('0x2c')][_0x559c('0x1f')](_0x1fcfdc)[_0x559c('0x26')](function(_0x2a094d){_0x152abb[_0x559c('0x1f')]=_0x2a094d;if(_0x22b0be['query']['includeAll']){_0x526aea[_0x559c('0x42')]=[{'all':!![]}];}return db[_0x559c('0x2c')][_0x559c('0x43')](_0x526aea);})[_0x559c('0x26')](function(_0x15afd2){_0x152abb['rows']=_0x15afd2;return _0x152abb;})[_0x559c('0x26')](respondWithFilteredResult(_0x214198,_0x526aea))[_0x559c('0x44')](handleError(_0x214198,null));};exports[_0x559c('0x45')]=function(_0x27bd58,_0x4f9141){var _0x44c3e2={'raw':!![],'where':{'id':_0x27bd58[_0x559c('0x46')]['id']}},_0x5c4900={};_0x5c4900[_0x559c('0x31')]=_[_0x559c('0x34')](db[_0x559c('0x2c')][_0x559c('0x2d')]);_0x5c4900[_0x559c('0x35')]=_[_0x559c('0x34')](_0x27bd58[_0x559c('0x35')]);_0x5c4900[_0x559c('0x36')]=_[_0x559c('0x37')](_0x5c4900[_0x559c('0x31')],_0x5c4900[_0x559c('0x35')]);_0x44c3e2[_0x559c('0x38')]=_[_0x559c('0x37')](_0x5c4900[_0x559c('0x31')],qs[_0x559c('0x47')](_0x27bd58[_0x559c('0x35')][_0x559c('0x47')]));_0x44c3e2[_0x559c('0x38')]=_0x44c3e2['attributes'][_0x559c('0x39')]?_0x44c3e2['attributes']:_0x5c4900[_0x559c('0x31')];if(_0x27bd58[_0x559c('0x35')]['includeAll']){_0x44c3e2[_0x559c('0x42')]=[{'all':!![]}];}_0x44c3e2=_[_0x559c('0x40')]({},_0x44c3e2,_0x27bd58[_0x559c('0x41')]);return db[_0x559c('0x2c')]['find'](_0x44c3e2)[_0x559c('0x26')](handleEntityNotFound(_0x4f9141,null))[_0x559c('0x26')](respondWithResult(_0x4f9141,null))[_0x559c('0x44')](handleError(_0x4f9141,null));};exports[_0x559c('0x48')]=function(_0xede129,_0x10d4c9){return db[_0x559c('0x2c')][_0x559c('0x48')](_0xede129[_0x559c('0x49')],{})[_0x559c('0x26')](respondWithResult(_0x10d4c9,0xc9))[_0x559c('0x44')](handleError(_0x10d4c9,null));};exports[_0x559c('0x4a')]=function(_0x482f28,_0x3f11b9){if(_0x482f28[_0x559c('0x49')]['id']){delete _0x482f28[_0x559c('0x49')]['id'];}return db[_0x559c('0x2c')]['find']({'where':{'id':_0x482f28['params']['id']}})[_0x559c('0x26')](handleEntityNotFound(_0x3f11b9,null))[_0x559c('0x26')](saveUpdates(_0x482f28[_0x559c('0x49')],null))['then'](respondWithResult(_0x3f11b9,null))[_0x559c('0x44')](handleError(_0x3f11b9,null));};exports['destroy']=function(_0x143925,_0x260718){return db[_0x559c('0x2c')][_0x559c('0x4b')]({'where':{'id':_0x143925['params']['id']}})[_0x559c('0x26')](handleEntityNotFound(_0x260718,null))[_0x559c('0x26')](removeEntity(_0x260718,null))[_0x559c('0x44')](handleError(_0x260718,null));};exports[_0x559c('0x4c')]=function(_0x557cf0,_0x5741fe,_0x4e6783){return db[_0x559c('0x2c')][_0x559c('0x4b')]({'where':{'id':_0x557cf0['params']['id']},'attributes':['id',_0x559c('0x4d'),_0x559c('0x4e')]})[_0x559c('0x26')](handleEntityNotFound(_0x5741fe,null))[_0x559c('0x26')](function(_0x8b13e1){if(_0x8b13e1){if(!_0x8b13e1['recording']){throw new db[(_0x559c('0x4f'))]['ValidationError'](_0x559c('0x50'));}var _0x33b75e={'Content-Type':_0x559c('0x51'),'Content-Disposition':_0x559c('0x52')};if(_0x8b13e1[_0x559c('0x4e')]){_0x33b75e[_0x559c('0x53')]=_0x559c('0x54')+_0x8b13e1['msg_id']+_0x559c('0x55');}_0x5741fe[_0x559c('0x56')](_0x33b75e);return _0x5741fe['send'](new Buffer(_0x8b13e1[_0x559c('0x4d')]));}})[_0x559c('0x44')](handleError(_0x5741fe,null));}; \ No newline at end of file +var _0x2afd=['destroy','error','stack','name','send','index','VoiceMailMessage','rawAttributes','fieldName','type','differenceBy','map','query','keys','intersection','model','attributes','length','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','fields','includeAll','find','create','body','download','recording','msg_id','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','.wav\x22','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','apply','save','then'];(function(_0x36e631,_0x42a36a){var _0x3b0ff3=function(_0x11302e){while(--_0x11302e){_0x36e631['push'](_0x36e631['shift']());}};_0x3b0ff3(++_0x42a36a);}(_0x2afd,0x1d9));var _0xd2af=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x2afd[_0x3ab51d];return _0x29a04e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd2af('0x0'));var zipdir=require(_0xd2af('0x1'));var jsonpatch=require(_0xd2af('0x2'));var rp=require(_0xd2af('0x3'));var moment=require(_0xd2af('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd2af('0x5'));var util=require(_0xd2af('0x6'));var path=require(_0xd2af('0x7'));var sox=require(_0xd2af('0x8'));var csv=require(_0xd2af('0x9'));var ejs=require(_0xd2af('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd2af('0xb'));var squel=require(_0xd2af('0xc'));var crypto=require(_0xd2af('0xd'));var jsforce=require(_0xd2af('0xe'));var deskjs=require(_0xd2af('0xf'));var toCsv=require(_0xd2af('0x9'));var querystring=require('querystring');var Papa=require(_0xd2af('0x10'));var Redis=require('ioredis');var authService=require(_0xd2af('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xd2af('0x12'));var hardwareService=require(_0xd2af('0x13'));var logger=require('../../config/logger')(_0xd2af('0x14'));var utils=require(_0xd2af('0x15'));var config=require(_0xd2af('0x16'));var licenseUtil=require(_0xd2af('0x17'));var db=require(_0xd2af('0x18'))['db'];function respondWithStatusCode(_0x4e5ebb,_0x3dce61){_0x3dce61=_0x3dce61||0xcc;return function(_0x2c52cf){if(_0x2c52cf){return _0x4e5ebb[_0xd2af('0x19')](_0x3dce61);}return _0x4e5ebb['status'](_0x3dce61)[_0xd2af('0x1a')]();};}function respondWithResult(_0x5d5da8,_0x410d94){_0x410d94=_0x410d94||0xc8;return function(_0x470f63){if(_0x470f63){return _0x5d5da8[_0xd2af('0x1b')](_0x410d94)[_0xd2af('0x1c')](_0x470f63);}};}function respondWithFilteredResult(_0x596835,_0x515540){return function(_0x5b2c06){if(_0x5b2c06){var _0xa3d719=typeof _0x515540[_0xd2af('0x1d')]==='undefined'&&typeof _0x515540[_0xd2af('0x1e')]===_0xd2af('0x1f');var _0x1a6e97=_0x5b2c06[_0xd2af('0x20')];var _0xa45f24=_0xa3d719?0x0:_0x515540[_0xd2af('0x1d')];var _0x3b4f67=_0xa3d719?_0x5b2c06[_0xd2af('0x20')]:_0x515540[_0xd2af('0x1d')]+_0x515540[_0xd2af('0x1e')];var _0x3192a9;if(_0x3b4f67>=_0x1a6e97){_0x3b4f67=_0x1a6e97;_0x3192a9=0xc8;}else{_0x3192a9=0xce;}_0x596835[_0xd2af('0x1b')](_0x3192a9);return _0x596835[_0xd2af('0x21')]('Content-Range',_0xa45f24+'-'+_0x3b4f67+'/'+_0x1a6e97)[_0xd2af('0x1c')](_0x5b2c06);}return null;};}function patchUpdates(_0x4c8e1b){return function(_0x59dcfa){try{jsonpatch[_0xd2af('0x22')](_0x59dcfa,_0x4c8e1b,!![]);}catch(_0x1d68d0){return BPromise['reject'](_0x1d68d0);}return _0x59dcfa[_0xd2af('0x23')]();};}function saveUpdates(_0x9d0243,_0x1d9d67){return function(_0x437292){if(_0x437292){return _0x437292['update'](_0x9d0243)[_0xd2af('0x24')](function(_0x49f050){return _0x49f050;});}return null;};}function removeEntity(_0x20e98f,_0x34799a){return function(_0xfa825e){if(_0xfa825e){return _0xfa825e[_0xd2af('0x25')]()['then'](function(){_0x20e98f[_0xd2af('0x1b')](0xcc)[_0xd2af('0x1a')]();});}};}function handleEntityNotFound(_0x12c41b,_0x272b1c){return function(_0x4b6396){if(!_0x4b6396){_0x12c41b['sendStatus'](0x194);}return _0x4b6396;};}function handleError(_0x5874b2,_0x335e56){_0x335e56=_0x335e56||0x1f4;return function(_0x4f7adb){logger[_0xd2af('0x26')](_0x4f7adb[_0xd2af('0x27')]);if(_0x4f7adb[_0xd2af('0x28')]){delete _0x4f7adb['name'];}_0x5874b2[_0xd2af('0x1b')](_0x335e56)[_0xd2af('0x29')](_0x4f7adb);};}exports[_0xd2af('0x2a')]=function(_0xd32a19,_0x4b9a68){var _0x3a6cdd={},_0x10f9c9={},_0x530bad={'count':0x0,'rows':[]};var _0x36d780=_['map'](db[_0xd2af('0x2b')][_0xd2af('0x2c')],function(_0x3d05a7){return{'name':_0x3d05a7[_0xd2af('0x2d')],'type':_0x3d05a7[_0xd2af('0x2e')]['key']};});_0x10f9c9['model']=_[_0xd2af('0x2f')](_[_0xd2af('0x30')](_0x36d780,_0xd2af('0x28')),['name']);_0x10f9c9[_0xd2af('0x31')]=_[_0xd2af('0x32')](_0xd32a19[_0xd2af('0x31')]);_0x10f9c9['filters']=_[_0xd2af('0x33')](_0x10f9c9[_0xd2af('0x34')],_0x10f9c9[_0xd2af('0x31')]);_0x3a6cdd[_0xd2af('0x35')]=_[_0xd2af('0x33')](_0x10f9c9[_0xd2af('0x34')],qs['fields'](_0xd32a19[_0xd2af('0x31')]['fields']));_0x3a6cdd['attributes']=_0x3a6cdd['attributes'][_0xd2af('0x36')]?_0x3a6cdd[_0xd2af('0x35')]:_0x10f9c9[_0xd2af('0x34')];if(!_0xd32a19[_0xd2af('0x31')]['hasOwnProperty'](_0xd2af('0x37'))){_0x3a6cdd['limit']=qs[_0xd2af('0x1e')](_0xd32a19[_0xd2af('0x31')][_0xd2af('0x1e')]);_0x3a6cdd[_0xd2af('0x1d')]=qs[_0xd2af('0x1d')](_0xd32a19[_0xd2af('0x31')][_0xd2af('0x1d')]);}_0x3a6cdd[_0xd2af('0x38')]=qs[_0xd2af('0x39')](_0xd32a19['query']['sort']);_0x3a6cdd['where']=qs[_0xd2af('0x3a')](_[_0xd2af('0x3b')](_0xd32a19[_0xd2af('0x31')],_0x10f9c9[_0xd2af('0x3a')]),_0x36d780);if(_0xd32a19[_0xd2af('0x31')][_0xd2af('0x3c')]){_0x3a6cdd[_0xd2af('0x3d')]=_['merge'](_0x3a6cdd[_0xd2af('0x3d')],{'$or':_['map'](_0x36d780,function(_0x4b5932){if(_0x4b5932[_0xd2af('0x2e')]!==_0xd2af('0x3e')){var _0xe4d90c={};_0xe4d90c[_0x4b5932[_0xd2af('0x28')]]={'$like':'%'+_0xd32a19[_0xd2af('0x31')][_0xd2af('0x3c')]+'%'};return _0xe4d90c;}})});}_0x3a6cdd=_[_0xd2af('0x3f')]({},_0x3a6cdd,_0xd32a19[_0xd2af('0x40')]);var _0x261550={'where':_0x3a6cdd[_0xd2af('0x3d')]};return db['VoiceMailMessage'][_0xd2af('0x20')](_0x261550)['then'](function(_0x381a00){_0x530bad[_0xd2af('0x20')]=_0x381a00;if(_0xd32a19[_0xd2af('0x31')]['includeAll']){_0x3a6cdd[_0xd2af('0x41')]=[{'all':!![]}];}return db[_0xd2af('0x2b')][_0xd2af('0x42')](_0x3a6cdd);})[_0xd2af('0x24')](function(_0x3add96){_0x530bad[_0xd2af('0x43')]=_0x3add96;return _0x530bad;})['then'](respondWithFilteredResult(_0x4b9a68,_0x3a6cdd))[_0xd2af('0x44')](handleError(_0x4b9a68,null));};exports[_0xd2af('0x45')]=function(_0x123c8c,_0x44eed0){var _0x518252={'raw':!![],'where':{'id':_0x123c8c[_0xd2af('0x46')]['id']}},_0x120a2a={};_0x120a2a[_0xd2af('0x34')]=_['keys'](db[_0xd2af('0x2b')][_0xd2af('0x2c')]);_0x120a2a['query']=_['keys'](_0x123c8c['query']);_0x120a2a['filters']=_[_0xd2af('0x33')](_0x120a2a[_0xd2af('0x34')],_0x120a2a[_0xd2af('0x31')]);_0x518252[_0xd2af('0x35')]=_[_0xd2af('0x33')](_0x120a2a[_0xd2af('0x34')],qs['fields'](_0x123c8c['query'][_0xd2af('0x47')]));_0x518252['attributes']=_0x518252['attributes'][_0xd2af('0x36')]?_0x518252[_0xd2af('0x35')]:_0x120a2a['model'];if(_0x123c8c[_0xd2af('0x31')][_0xd2af('0x48')]){_0x518252[_0xd2af('0x41')]=[{'all':!![]}];}_0x518252=_['merge']({},_0x518252,_0x123c8c[_0xd2af('0x40')]);return db[_0xd2af('0x2b')][_0xd2af('0x49')](_0x518252)[_0xd2af('0x24')](handleEntityNotFound(_0x44eed0,null))[_0xd2af('0x24')](respondWithResult(_0x44eed0,null))['catch'](handleError(_0x44eed0,null));};exports[_0xd2af('0x4a')]=function(_0x47acf7,_0x731828){return db[_0xd2af('0x2b')][_0xd2af('0x4a')](_0x47acf7[_0xd2af('0x4b')],{})[_0xd2af('0x24')](respondWithResult(_0x731828,0xc9))['catch'](handleError(_0x731828,null));};exports['update']=function(_0xe67904,_0x5e823f){if(_0xe67904[_0xd2af('0x4b')]['id']){delete _0xe67904[_0xd2af('0x4b')]['id'];}return db[_0xd2af('0x2b')][_0xd2af('0x49')]({'where':{'id':_0xe67904[_0xd2af('0x46')]['id']}})[_0xd2af('0x24')](handleEntityNotFound(_0x5e823f,null))[_0xd2af('0x24')](saveUpdates(_0xe67904[_0xd2af('0x4b')],null))[_0xd2af('0x24')](respondWithResult(_0x5e823f,null))[_0xd2af('0x44')](handleError(_0x5e823f,null));};exports[_0xd2af('0x25')]=function(_0x5c824f,_0x3de068){return db['VoiceMailMessage']['find']({'where':{'id':_0x5c824f[_0xd2af('0x46')]['id']}})['then'](handleEntityNotFound(_0x3de068,null))['then'](removeEntity(_0x3de068,null))['catch'](handleError(_0x3de068,null));};exports[_0xd2af('0x4c')]=function(_0x5338dc,_0x3f32ba,_0x2834ba){return db[_0xd2af('0x2b')][_0xd2af('0x49')]({'where':{'id':_0x5338dc[_0xd2af('0x46')]['id']},'attributes':['id',_0xd2af('0x4d'),_0xd2af('0x4e')]})[_0xd2af('0x24')](handleEntityNotFound(_0x3f32ba,null))[_0xd2af('0x24')](function(_0x2c677c){if(_0x2c677c){if(!_0x2c677c[_0xd2af('0x4d')]){throw new db['Sequelize'][(_0xd2af('0x4f'))](_0xd2af('0x50'));}var _0x2c1522={'Content-Type':_0xd2af('0x51'),'Content-Disposition':_0xd2af('0x52')};if(_0x2c677c[_0xd2af('0x4e')]){_0x2c1522[_0xd2af('0x53')]='attachment;\x20filename=\x22'+_0x2c677c['msg_id']+_0xd2af('0x54');}_0x3f32ba['set'](_0x2c1522);return _0x3f32ba['send'](new Buffer(_0x2c677c['recording']));}})['catch'](handleError(_0x3f32ba,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index b021f5d..fd8ec5f 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 _0x4c63=['dir','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','voice_voicemail_messages'];(function(_0x4819c3,_0x36732d){var _0x3c6537=function(_0x493b90){while(--_0x493b90){_0x4819c3['push'](_0x4819c3['shift']());}};_0x3c6537(++_0x36732d);}(_0x4c63,0x1b4));var _0x34c6=function(_0x5bdbfc,_0x168fe8){_0x5bdbfc=_0x5bdbfc-0x0;var _0x26c68e=_0x4c63[_0x5bdbfc];return _0x26c68e;};'use strict';var _=require(_0x34c6('0x0'));var util=require(_0x34c6('0x1'));var logger=require(_0x34c6('0x2'))(_0x34c6('0x3'));var moment=require(_0x34c6('0x4'));var BPromise=require(_0x34c6('0x5'));var rp=require(_0x34c6('0x6'));var fs=require('fs');var path=require(_0x34c6('0x7'));var rimraf=require('rimraf');var config=require(_0x34c6('0x8'));var attributes=require(_0x34c6('0x9'));module[_0x34c6('0xa')]=function(_0xb35164,_0x1e2f99){return _0xb35164[_0x34c6('0xb')](_0x34c6('0xc'),attributes,{'tableName':_0x34c6('0xd'),'paranoid':![],'indexes':[{'name':_0x34c6('0xe'),'fields':[_0x34c6('0xe')]}],'timestamps':![]});}; \ No newline at end of file +var _0x8333=['./voiceMailMessage.attributes','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','../../config/logger','moment','request-promise','../../config/environment'];(function(_0x3cff95,_0x461dac){var _0x38065d=function(_0x24dc16){while(--_0x24dc16){_0x3cff95['push'](_0x3cff95['shift']());}};_0x38065d(++_0x461dac);}(_0x8333,0x68));var _0x3833=function(_0x4bb1ab,_0x4a6ad4){_0x4bb1ab=_0x4bb1ab-0x0;var _0x332ef1=_0x8333[_0x4bb1ab];return _0x332ef1;};'use strict';var _=require(_0x3833('0x0'));var util=require(_0x3833('0x1'));var logger=require(_0x3833('0x2'))('api');var moment=require(_0x3833('0x3'));var BPromise=require('bluebird');var rp=require(_0x3833('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3833('0x5'));var attributes=require(_0x3833('0x6'));module['exports']=function(_0x63df59,_0x429132){return _0x63df59[_0x3833('0x7')](_0x3833('0x8'),attributes,{'tableName':_0x3833('0x9'),'paranoid':![],'indexes':[{'name':'dir','fields':[_0x3833('0xa')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index b707e24..4dc452a 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 _0x4d3c=['code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','request','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2140b1,_0x406293){var _0x2d161e=function(_0x4f4162){while(--_0x4f4162){_0x2140b1['push'](_0x2140b1['shift']());}};_0x2d161e(++_0x406293);}(_0x4d3c,0x16c));var _0xc4d3=function(_0x31cef4,_0x40f9cc){_0x31cef4=_0x31cef4-0x0;var _0x247289=_0x4d3c[_0x31cef4];return _0x247289;};'use strict';var _=require('lodash');var util=require(_0xc4d3('0x0'));var moment=require(_0xc4d3('0x1'));var BPromise=require(_0xc4d3('0x2'));var rs=require(_0xc4d3('0x3'));var fs=require('fs');var Redis=require(_0xc4d3('0x4'));var db=require(_0xc4d3('0x5'))['db'];var utils=require(_0xc4d3('0x6'));var logger=require(_0xc4d3('0x7'))(_0xc4d3('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2bfc3f,_0x1906d5,_0x308b9a){return new BPromise(function(_0x672ddd,_0x1638e3){return client[_0xc4d3('0x9')](_0x2bfc3f,_0x308b9a)['then'](function(_0x22a1ed){logger[_0xc4d3('0xa')](_0xc4d3('0xb'),_0x1906d5,_0xc4d3('0xc'));logger['debug'](_0xc4d3('0xd'),_0x1906d5,'request\x20sent',JSON[_0xc4d3('0xe')](_0x22a1ed));if(_0x22a1ed[_0xc4d3('0xf')]){if(_0x22a1ed[_0xc4d3('0xf')][_0xc4d3('0x10')]===0x1f4){logger[_0xc4d3('0xf')]('VoiceMailMessage,\x20%s,\x20%s',_0x1906d5,_0x22a1ed[_0xc4d3('0xf')][_0xc4d3('0x11')]);return _0x1638e3(_0x22a1ed['error'][_0xc4d3('0x11')]);}logger['error'](_0xc4d3('0xb'),_0x1906d5,_0x22a1ed[_0xc4d3('0xf')][_0xc4d3('0x11')]);return _0x672ddd(_0x22a1ed[_0xc4d3('0xf')][_0xc4d3('0x11')]);}else{logger[_0xc4d3('0xa')](_0xc4d3('0xb'),_0x1906d5,_0xc4d3('0xc'));_0x672ddd(_0x22a1ed[_0xc4d3('0x12')][_0xc4d3('0x11')]);}})[_0xc4d3('0x13')](function(_0x134338){logger[_0xc4d3('0xf')](_0xc4d3('0xb'),_0x1906d5,_0x134338);_0x1638e3(_0x134338);});});} \ No newline at end of file +var _0x94fd=['rpc','../../config/environment','client','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xdf7745,_0x4b5707){var _0x4125ef=function(_0x43b943){while(--_0x43b943){_0xdf7745['push'](_0xdf7745['shift']());}};_0x4125ef(++_0x4b5707);}(_0x94fd,0x1d5));var _0xd94f=function(_0x5f4328,_0x17d4fc){_0x5f4328=_0x5f4328-0x0;var _0x17788c=_0x94fd[_0x5f4328];return _0x17788c;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xd94f('0x0'));var rs=require(_0xd94f('0x1'));var fs=require('fs');var Redis=require(_0xd94f('0x2'));var db=require(_0xd94f('0x3'))['db'];var utils=require(_0xd94f('0x4'));var logger=require(_0xd94f('0x5'))(_0xd94f('0x6'));var config=require(_0xd94f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd94f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe30fb5,_0x3d2627,_0x649e8f){return new BPromise(function(_0x3e1254,_0x4879aa){return client['request'](_0xe30fb5,_0x649e8f)[_0xd94f('0x9')](function(_0x247f49){logger[_0xd94f('0xa')](_0xd94f('0xb'),_0x3d2627,_0xd94f('0xc'));logger[_0xd94f('0xd')](_0xd94f('0xe'),_0x3d2627,'request\x20sent',JSON['stringify'](_0x247f49));if(_0x247f49[_0xd94f('0xf')]){if(_0x247f49['error']['code']===0x1f4){logger[_0xd94f('0xf')]('VoiceMailMessage,\x20%s,\x20%s',_0x3d2627,_0x247f49[_0xd94f('0xf')][_0xd94f('0x10')]);return _0x4879aa(_0x247f49[_0xd94f('0xf')][_0xd94f('0x10')]);}logger[_0xd94f('0xf')](_0xd94f('0xb'),_0x3d2627,_0x247f49[_0xd94f('0xf')][_0xd94f('0x10')]);return _0x3e1254(_0x247f49['error'][_0xd94f('0x10')]);}else{logger[_0xd94f('0xa')](_0xd94f('0xb'),_0x3d2627,'request\x20sent');_0x3e1254(_0x247f49[_0xd94f('0x11')][_0xd94f('0x10')]);}})[_0xd94f('0x12')](function(_0x25e929){logger[_0xd94f('0xf')](_0xd94f('0xb'),_0x3d2627,_0x25e929);_0x4879aa(_0x25e929);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 9c94927..59825d8 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 _0xd767=['create','/:id/sounds','addSound','put','update','delete','/:id','destroy','/:id/sounds/:id2','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','isAuthenticated','index','get','getSounds','post'];(function(_0x46b6a6,_0x58a0e3){var _0x235dcd=function(_0x206bca){while(--_0x206bca){_0x46b6a6['push'](_0x46b6a6['shift']());}};_0x235dcd(++_0x58a0e3);}(_0xd767,0xfb));var _0x7d76=function(_0x3c2757,_0x4dda3c){_0x3c2757=_0x3c2757-0x0;var _0x27d38b=_0xd767[_0x3c2757];return _0x27d38b;};'use strict';var multer=require(_0x7d76('0x0'));var util=require('util');var path=require(_0x7d76('0x1'));var timeout=require(_0x7d76('0x2'));var express=require('express');var router=express[_0x7d76('0x3')]();var fs_extra=require(_0x7d76('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7d76('0x5'));var config=require(_0x7d76('0x6'));var controller=require(_0x7d76('0x7'));router['get']('/',auth[_0x7d76('0x8')](),controller[_0x7d76('0x9')]);router[_0x7d76('0xa')]('/:id',auth[_0x7d76('0x8')](),controller['show']);router[_0x7d76('0xa')]('/:id/sounds',auth['isAuthenticated'](),controller[_0x7d76('0xb')]);router[_0x7d76('0xc')]('/',auth[_0x7d76('0x8')](),controller[_0x7d76('0xd')]);router[_0x7d76('0xc')](_0x7d76('0xe'),auth[_0x7d76('0x8')](),controller[_0x7d76('0xf')]);router[_0x7d76('0x10')]('/:id',auth[_0x7d76('0x8')](),controller[_0x7d76('0x11')]);router[_0x7d76('0x12')](_0x7d76('0x13'),auth[_0x7d76('0x8')](),controller[_0x7d76('0x14')]);router[_0x7d76('0x12')](_0x7d76('0x15'),auth[_0x7d76('0x8')](),controller['removeSound']);module['exports']=router; \ No newline at end of file +var _0x97b3=['get','show','/:id/sounds','getSounds','post','create','addSound','put','update','delete','/:id','destroy','/:id/sounds/:id2','removeSound','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./voiceMusicOnHold.controller','isAuthenticated','index'];(function(_0x4eab61,_0x1a6e6d){var _0x342426=function(_0xc6338a){while(--_0xc6338a){_0x4eab61['push'](_0x4eab61['shift']());}};_0x342426(++_0x1a6e6d);}(_0x97b3,0x186));var _0x397b=function(_0x20b9fc,_0x5dab92){_0x20b9fc=_0x20b9fc-0x0;var _0x511a2b=_0x97b3[_0x20b9fc];return _0x511a2b;};'use strict';var multer=require(_0x397b('0x0'));var util=require(_0x397b('0x1'));var path=require(_0x397b('0x2'));var timeout=require(_0x397b('0x3'));var express=require(_0x397b('0x4'));var router=express[_0x397b('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x397b('0x6'));var config=require('../../config/environment');var controller=require(_0x397b('0x7'));router['get']('/',auth[_0x397b('0x8')](),controller[_0x397b('0x9')]);router[_0x397b('0xa')]('/:id',auth[_0x397b('0x8')](),controller[_0x397b('0xb')]);router[_0x397b('0xa')](_0x397b('0xc'),auth[_0x397b('0x8')](),controller[_0x397b('0xd')]);router[_0x397b('0xe')]('/',auth[_0x397b('0x8')](),controller[_0x397b('0xf')]);router[_0x397b('0xe')](_0x397b('0xc'),auth[_0x397b('0x8')](),controller[_0x397b('0x10')]);router[_0x397b('0x11')]('/:id',auth[_0x397b('0x8')](),controller[_0x397b('0x12')]);router[_0x397b('0x13')](_0x397b('0x14'),auth['isAuthenticated'](),controller[_0x397b('0x15')]);router[_0x397b('0x13')](_0x397b('0x16'),auth[_0x397b('0x8')](),controller[_0x397b('0x17')]);module[_0x397b('0x18')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 6c30670..7ce8b02 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 _0x26c5=['BOOLEAN','sequelize','exports','STRING','name','custom','files','mp3nb','quietmp3nb','quietmp3','TIMESTAMP'];(function(_0x2775a4,_0x3c9afa){var _0x40267c=function(_0x5a3788){while(--_0x5a3788){_0x2775a4['push'](_0x2775a4['shift']());}};_0x40267c(++_0x3c9afa);}(_0x26c5,0x11f));var _0x526c=function(_0x4f77a2,_0x4df36a){_0x4f77a2=_0x4f77a2-0x0;var _0x5e21a9=_0x26c5[_0x4f77a2];return _0x5e21a9;};'use strict';var Sequelize=require(_0x526c('0x0'));module[_0x526c('0x1')]={'name':{'type':Sequelize[_0x526c('0x2')],'allowNull':![],'unique':_0x526c('0x3')},'mode':{'type':Sequelize['ENUM'](_0x526c('0x4'),_0x526c('0x5'),_0x526c('0x6'),_0x526c('0x7'),_0x526c('0x8'),'mp3'),'allowNull':!![],'defaultValue':_0x526c('0x5')},'directory':{'type':Sequelize[_0x526c('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x526c('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x526c('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x526c('0x2')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0x526c('0x2')],'allowNull':!![]},'stamp':{'type':_0x526c('0x9')},'defaultEntry':{'type':Sequelize[_0x526c('0xa')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7bc0=['mp3nb','quietmp3nb','quietmp3','mp3','alpha','exports','STRING','name','ENUM','custom','files'];(function(_0x13be17,_0xe29ea9){var _0xd09870=function(_0x299fca){while(--_0x299fca){_0x13be17['push'](_0x13be17['shift']());}};_0xd09870(++_0xe29ea9);}(_0x7bc0,0x14f));var _0x07bc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7bc0[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x07bc('0x0')]={'name':{'type':Sequelize[_0x07bc('0x1')],'allowNull':![],'unique':_0x07bc('0x2')},'mode':{'type':Sequelize[_0x07bc('0x3')](_0x07bc('0x4'),_0x07bc('0x5'),_0x07bc('0x6'),_0x07bc('0x7'),_0x07bc('0x8'),_0x07bc('0x9')),'allowNull':!![],'defaultValue':_0x07bc('0x5')},'directory':{'type':Sequelize[_0x07bc('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0x07bc('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0x07bc('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0x07bc('0x1')],'allowNull':!![],'defaultValue':_0x07bc('0xa')},'format':{'type':Sequelize[_0x07bc('0x1')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index 418800e..5dcdf56 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 _0xdfb4=['set','Content-Range','apply','reject','save','then','destroy','get','MusicOnHolds','UserProfileResource','stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','length','find','update','body','params','create','sequelize','mode','files','directory','join','root','server/files/moh','0777','user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','transaction','forEach','unlinkSync','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','converted_format','server/files/sounds/converted','format','%s.%s','basename','extname','symlinkSync','removeSound','id2','getSounds','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset'];(function(_0xca2355,_0x547c4f){var _0x408db3=function(_0xe2e88b){while(--_0xe2e88b){_0xca2355['push'](_0xca2355['shift']());}};_0x408db3(++_0x547c4f);}(_0xdfb4,0x1b3));var _0x4dfb=function(_0x27fa52,_0x347642){_0x27fa52=_0x27fa52-0x0;var _0x332b19=_0xdfb4[_0x27fa52];return _0x332b19;};'use strict';var emlformat=require(_0x4dfb('0x0'));var rimraf=require(_0x4dfb('0x1'));var zipdir=require(_0x4dfb('0x2'));var jsonpatch=require(_0x4dfb('0x3'));var rp=require(_0x4dfb('0x4'));var moment=require(_0x4dfb('0x5'));var BPromise=require(_0x4dfb('0x6'));var Mustache=require('mustache');var util=require(_0x4dfb('0x7'));var path=require(_0x4dfb('0x8'));var sox=require(_0x4dfb('0x9'));var csv=require('to-csv');var ejs=require(_0x4dfb('0xa'));var fs=require('fs');var fs_extra=require(_0x4dfb('0xb'));var _=require(_0x4dfb('0xc'));var squel=require('squel');var crypto=require(_0x4dfb('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x4dfb('0xe'));var toCsv=require(_0x4dfb('0xf'));var querystring=require(_0x4dfb('0x10'));var Papa=require(_0x4dfb('0x11'));var Redis=require('ioredis');var authService=require(_0x4dfb('0x12'));var qs=require(_0x4dfb('0x13'));var as=require(_0x4dfb('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4dfb('0x15'));var utils=require('../../config/utils');var config=require(_0x4dfb('0x16'));var licenseUtil=require(_0x4dfb('0x17'));var db=require(_0x4dfb('0x18'))['db'];function respondWithStatusCode(_0x588d83,_0x13a1a0){_0x13a1a0=_0x13a1a0||0xcc;return function(_0x4a0c7d){if(_0x4a0c7d){return _0x588d83[_0x4dfb('0x19')](_0x13a1a0);}return _0x588d83[_0x4dfb('0x1a')](_0x13a1a0)[_0x4dfb('0x1b')]();};}function respondWithResult(_0x2c5ac4,_0x2ef1fa){_0x2ef1fa=_0x2ef1fa||0xc8;return function(_0x3ed12d){if(_0x3ed12d){return _0x2c5ac4[_0x4dfb('0x1a')](_0x2ef1fa)[_0x4dfb('0x1c')](_0x3ed12d);}};}function respondWithFilteredResult(_0x9594b8,_0x2f667a){return function(_0x610b41){if(_0x610b41){var _0x561a94=typeof _0x2f667a['offset']==='undefined'&&typeof _0x2f667a[_0x4dfb('0x1d')]===_0x4dfb('0x1e');var _0x4a2038=_0x610b41[_0x4dfb('0x1f')];var _0x76a677=_0x561a94?0x0:_0x2f667a[_0x4dfb('0x20')];var _0x6ade4d=_0x561a94?_0x610b41[_0x4dfb('0x1f')]:_0x2f667a[_0x4dfb('0x20')]+_0x2f667a['limit'];var _0x22f440;if(_0x6ade4d>=_0x4a2038){_0x6ade4d=_0x4a2038;_0x22f440=0xc8;}else{_0x22f440=0xce;}_0x9594b8[_0x4dfb('0x1a')](_0x22f440);return _0x9594b8[_0x4dfb('0x21')](_0x4dfb('0x22'),_0x76a677+'-'+_0x6ade4d+'/'+_0x4a2038)['json'](_0x610b41);}return null;};}function patchUpdates(_0x3aa143){return function(_0x28db38){try{jsonpatch[_0x4dfb('0x23')](_0x28db38,_0x3aa143,!![]);}catch(_0x3d3a19){return BPromise[_0x4dfb('0x24')](_0x3d3a19);}return _0x28db38[_0x4dfb('0x25')]();};}function saveUpdates(_0x149a2e,_0xe7e089){return function(_0x465b53){if(_0x465b53){return _0x465b53['update'](_0x149a2e)[_0x4dfb('0x26')](function(_0x201f43){return _0x201f43;});}return null;};}function removeEntity(_0x1a7c63,_0x30b891){return function(_0x35491a){if(_0x35491a){return _0x35491a[_0x4dfb('0x27')]()[_0x4dfb('0x26')](function(){var _0x1e63de=_0x35491a[_0x4dfb('0x28')]({'plain':!![]});var _0x2b78cc=_0x4dfb('0x29');return db[_0x4dfb('0x2a')][_0x4dfb('0x27')]({'where':{'type':_0x2b78cc,'resourceId':_0x1e63de['id']}})[_0x4dfb('0x26')](function(){return _0x35491a;});})[_0x4dfb('0x26')](function(){_0x1a7c63['status'](0xcc)[_0x4dfb('0x1b')]();});}};}function handleEntityNotFound(_0x217bf8,_0x239744){return function(_0x30f4b7){if(!_0x30f4b7){_0x217bf8[_0x4dfb('0x19')](0x194);}return _0x30f4b7;};}function handleError(_0x43a059,_0x16a33e){_0x16a33e=_0x16a33e||0x1f4;return function(_0x3152d7){logger['error'](_0x3152d7[_0x4dfb('0x2b')]);if(_0x3152d7[_0x4dfb('0x2c')]){delete _0x3152d7['name'];}_0x43a059['status'](_0x16a33e)[_0x4dfb('0x2d')](_0x3152d7);};}exports[_0x4dfb('0x2e')]=function(_0x448186,_0x4bc746){var _0x4f9389={},_0x551dfa={},_0x50cc82={'count':0x0,'rows':[]};var _0x2aa84e=_[_0x4dfb('0x2f')](db[_0x4dfb('0x30')][_0x4dfb('0x31')],function(_0x51e090){return{'name':_0x51e090['fieldName'],'type':_0x51e090[_0x4dfb('0x32')][_0x4dfb('0x33')]};});_0x551dfa[_0x4dfb('0x34')]=_[_0x4dfb('0x2f')](_0x2aa84e,'name');_0x551dfa['query']=_[_0x4dfb('0x35')](_0x448186[_0x4dfb('0x36')]);_0x551dfa[_0x4dfb('0x37')]=_[_0x4dfb('0x38')](_0x551dfa['model'],_0x551dfa[_0x4dfb('0x36')]);_0x4f9389[_0x4dfb('0x39')]=_['intersection'](_0x551dfa[_0x4dfb('0x34')],qs[_0x4dfb('0x3a')](_0x448186[_0x4dfb('0x36')][_0x4dfb('0x3a')]));_0x4f9389['attributes']=_0x4f9389[_0x4dfb('0x39')]['length']?_0x4f9389[_0x4dfb('0x39')]:_0x551dfa['model'];if(!_0x448186[_0x4dfb('0x36')][_0x4dfb('0x3b')](_0x4dfb('0x3c'))){_0x4f9389[_0x4dfb('0x1d')]=qs[_0x4dfb('0x1d')](_0x448186[_0x4dfb('0x36')][_0x4dfb('0x1d')]);_0x4f9389[_0x4dfb('0x20')]=qs[_0x4dfb('0x20')](_0x448186[_0x4dfb('0x36')][_0x4dfb('0x20')]);}_0x4f9389[_0x4dfb('0x3d')]=qs[_0x4dfb('0x3e')](_0x448186['query'][_0x4dfb('0x3e')]);delete _0x448186[_0x4dfb('0x36')][_0x4dfb('0x3e')];_0x4f9389[_0x4dfb('0x3f')]=qs[_0x4dfb('0x37')](_[_0x4dfb('0x40')](_0x448186['query'],_0x551dfa[_0x4dfb('0x37')]),_0x2aa84e);if(_0x448186[_0x4dfb('0x36')][_0x4dfb('0x41')]){_0x4f9389['where']=_[_0x4dfb('0x42')](_0x4f9389['where'],{'$or':_['map'](_0x2aa84e,function(_0x3bfab1){if(_0x3bfab1['type']!==_0x4dfb('0x43')){var _0x5e7139={};_0x5e7139[_0x3bfab1[_0x4dfb('0x2c')]]={'$like':'%'+_0x448186[_0x4dfb('0x36')][_0x4dfb('0x41')]+'%'};return _0x5e7139;}})});}_0x4f9389=_[_0x4dfb('0x42')]({},_0x4f9389,_0x448186[_0x4dfb('0x44')]);var _0x1243e9={'where':_0x4f9389[_0x4dfb('0x3f')]};return db[_0x4dfb('0x30')][_0x4dfb('0x1f')](_0x1243e9)['then'](function(_0x4f845e){_0x50cc82[_0x4dfb('0x1f')]=_0x4f845e;if(_0x448186[_0x4dfb('0x36')][_0x4dfb('0x45')]){_0x4f9389[_0x4dfb('0x46')]=[{'all':!![]}];}return db[_0x4dfb('0x30')][_0x4dfb('0x47')](_0x4f9389);})[_0x4dfb('0x26')](function(_0x21160f){_0x50cc82[_0x4dfb('0x48')]=_0x21160f;return _0x50cc82;})[_0x4dfb('0x26')](respondWithFilteredResult(_0x4bc746,_0x4f9389))[_0x4dfb('0x49')](handleError(_0x4bc746,null));};exports[_0x4dfb('0x4a')]=function(_0x2143bb,_0x426611){var _0x526b48={'raw':![],'where':{'id':_0x2143bb['params']['id']}},_0x37a1cd={};_0x37a1cd[_0x4dfb('0x34')]=_['keys'](db[_0x4dfb('0x30')][_0x4dfb('0x31')]);_0x37a1cd[_0x4dfb('0x36')]=_['keys'](_0x2143bb[_0x4dfb('0x36')]);_0x37a1cd[_0x4dfb('0x37')]=_[_0x4dfb('0x38')](_0x37a1cd[_0x4dfb('0x34')],_0x37a1cd[_0x4dfb('0x36')]);_0x526b48['attributes']=_['intersection'](_0x37a1cd[_0x4dfb('0x34')],qs[_0x4dfb('0x3a')](_0x2143bb[_0x4dfb('0x36')][_0x4dfb('0x3a')]));_0x526b48[_0x4dfb('0x39')]=_0x526b48[_0x4dfb('0x39')][_0x4dfb('0x4b')]?_0x526b48['attributes']:_0x37a1cd[_0x4dfb('0x34')];if(_0x2143bb[_0x4dfb('0x36')][_0x4dfb('0x45')]){_0x526b48[_0x4dfb('0x46')]=[{'all':!![]}];}_0x526b48=_[_0x4dfb('0x42')]({},_0x526b48,_0x2143bb[_0x4dfb('0x44')]);return db[_0x4dfb('0x30')][_0x4dfb('0x4c')](_0x526b48)[_0x4dfb('0x26')](handleEntityNotFound(_0x426611,null))[_0x4dfb('0x26')](respondWithResult(_0x426611,null))[_0x4dfb('0x49')](handleError(_0x426611,null));};exports[_0x4dfb('0x4d')]=function(_0x307221,_0x2bfefd){if(_0x307221[_0x4dfb('0x4e')]['id']){delete _0x307221[_0x4dfb('0x4e')]['id'];}return db[_0x4dfb('0x30')][_0x4dfb('0x4c')]({'where':{'id':_0x307221[_0x4dfb('0x4f')]['id']}})[_0x4dfb('0x26')](handleEntityNotFound(_0x2bfefd,null))[_0x4dfb('0x26')](saveUpdates(_0x307221[_0x4dfb('0x4e')],null))[_0x4dfb('0x26')](respondWithResult(_0x2bfefd,null))['catch'](handleError(_0x2bfefd,null));};exports[_0x4dfb('0x50')]=function(_0x147c3a,_0x39e126,_0x3af70f){return db[_0x4dfb('0x51')]['transaction'](function(_0x2c1b9c){if(_0x147c3a[_0x4dfb('0x4e')][_0x4dfb('0x52')]===_0x4dfb('0x53')){_0x147c3a[_0x4dfb('0x4e')][_0x4dfb('0x54')]=path[_0x4dfb('0x55')](config[_0x4dfb('0x56')],_0x4dfb('0x57'),_0x147c3a[_0x4dfb('0x4e')][_0x4dfb('0x2c')]);}return db[_0x4dfb('0x30')][_0x4dfb('0x50')](_0x147c3a[_0x4dfb('0x4e')],{'transaction':_0x2c1b9c})[_0x4dfb('0x26')](function(_0x54d6a6){if(_0x147c3a[_0x4dfb('0x4e')]['mode']===_0x4dfb('0x53')){fs['mkdirSync'](_0x54d6a6[_0x4dfb('0x54')],parseInt(_0x4dfb('0x58'),0x8));}var _0x52f221=_0x147c3a[_0x4dfb('0x59')]['get']({'plain':!![]});if(!_0x52f221)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x52f221[_0x4dfb('0x5a')]==='user'){var _0x3c5fe0=_0x54d6a6[_0x4dfb('0x28')]({'plain':!![]});return db[_0x4dfb('0x5b')][_0x4dfb('0x4c')]({'where':{'name':_0x4dfb('0x29'),'userProfileId':_0x52f221[_0x4dfb('0x5c')]},'raw':!![]})[_0x4dfb('0x26')](function(_0x3a5d8d){if(_0x3a5d8d&&_0x3a5d8d[_0x4dfb('0x5d')]===0x0){return db[_0x4dfb('0x2a')][_0x4dfb('0x50')]({'name':_0x3c5fe0[_0x4dfb('0x2c')],'resourceId':_0x3c5fe0['id'],'type':_0x3a5d8d[_0x4dfb('0x2c')],'sectionId':_0x3a5d8d['id']},{})[_0x4dfb('0x26')](function(){return _0x54d6a6;});}else{return _0x54d6a6;}})['catch'](function(_0xa967e7){logger[_0x4dfb('0x5e')](_0x4dfb('0x5f'),_0xa967e7);});}return _0x54d6a6;});})[_0x4dfb('0x26')](respondWithResult(_0x39e126,0xc9))['catch'](handleError(_0x39e126,null));};exports['destroy']=function(_0x213816,_0x5764dc,_0x34e5c8){var _0x1f6879;return db[_0x4dfb('0x30')]['find']({'where':{'id':_0x213816[_0x4dfb('0x4f')]['id']}})[_0x4dfb('0x26')](function(_0x37670e){if(_0x37670e){return db[_0x4dfb('0x51')][_0x4dfb('0x60')](function(_0x32e85c){return _0x37670e[_0x4dfb('0x27')]({'transaction':_0x32e85c,'raw':!![]})[_0x4dfb('0x26')](function(_0x41b8f3){if(_0x41b8f3[_0x4dfb('0x54')]){fs['readdirSync'](_0x41b8f3[_0x4dfb('0x54')])[_0x4dfb('0x61')](function(_0x14420e){fs[_0x4dfb('0x62')](path[_0x4dfb('0x55')](_0x41b8f3[_0x4dfb('0x54')],_0x14420e));});fs[_0x4dfb('0x63')](_0x41b8f3[_0x4dfb('0x54')]);}return _0x41b8f3;});})[_0x4dfb('0x49')](function(_0x45b258){throw new db[(_0x4dfb('0x64'))][(_0x4dfb('0x65'))](_0x45b258[_0x4dfb('0x66')]);});}})[_0x4dfb('0x26')](handleEntityNotFound(_0x5764dc,null))['then'](removeEntity(_0x5764dc,null))['catch'](handleError(_0x5764dc,null));};exports[_0x4dfb('0x67')]=function(_0xd9ae98,_0x288c4b,_0x570ed4){return db[_0x4dfb('0x51')][_0x4dfb('0x60')](function(_0x3f90ee){var _0x5dc503;return db[_0x4dfb('0x30')]['find']({'where':{'id':_0xd9ae98['params']['id']}})[_0x4dfb('0x26')](function(_0xb0fbc9){if(_0xb0fbc9){_0x5dc503=_0xb0fbc9;return _0xb0fbc9[_0x4dfb('0x67')](_0xd9ae98['body']['id'],{'transaction':_0x3f90ee});}})[_0x4dfb('0x26')](function(_0x55d528){if(_0x55d528){return db[_0x4dfb('0x68')][_0x4dfb('0x69')]({'where':{'id':_0xd9ae98[_0x4dfb('0x4e')]['id']},'attributes':['id',_0x4dfb('0x2c'),_0x4dfb('0x6a'),_0x4dfb('0x6b'),'createdAt'],'raw':!![]});}})['then'](function(_0x35aef1){if(_0x35aef1){var _0x83ccf3=path[_0x4dfb('0x55')](config['root'],_0x4dfb('0x6c'),util[_0x4dfb('0x6d')](_0x4dfb('0x6e'),path[_0x4dfb('0x6f')](_0x35aef1[_0x4dfb('0x6a')],path[_0x4dfb('0x70')](_0x35aef1[_0x4dfb('0x6a')])),_0x35aef1[_0x4dfb('0x6b')]));var _0x4a4e9f=path[_0x4dfb('0x55')](config[_0x4dfb('0x56')],_0x4dfb('0x57'),_0x5dc503[_0x4dfb('0x2c')],util['format'](_0x4dfb('0x6e'),_0x35aef1['name'],_0x35aef1[_0x4dfb('0x6b')]));fs[_0x4dfb('0x71')](_0x83ccf3,_0x4a4e9f);return _0x35aef1;}})[_0x4dfb('0x49')](function(_0x5999a3){throw new db[(_0x4dfb('0x64'))][(_0x4dfb('0x65'))](_0x5999a3[_0x4dfb('0x66')]);});})['then'](handleEntityNotFound(_0x288c4b,null))['then'](respondWithResult(_0x288c4b,0xc9))[_0x4dfb('0x49')](handleError(_0x288c4b,null));};exports[_0x4dfb('0x72')]=function(_0x19d159,_0x9ef345,_0x1e08d2){return db[_0x4dfb('0x51')][_0x4dfb('0x60')](function(_0x1c0ae1){var _0x4478fd;return db[_0x4dfb('0x30')][_0x4dfb('0x69')]({'where':{'id':_0x19d159[_0x4dfb('0x4f')]['id']}})[_0x4dfb('0x26')](handleEntityNotFound(_0x9ef345,null))[_0x4dfb('0x26')](function(_0x2816ad){if(_0x2816ad){_0x4478fd=_0x2816ad;return _0x2816ad[_0x4dfb('0x72')](_0x19d159[_0x4dfb('0x4f')][_0x4dfb('0x73')]);}})['then'](function(_0x66bb3a){if(_0x66bb3a){return db['Sound']['findOne']({'where':{'id':_0x19d159[_0x4dfb('0x4f')]['id2']},'attributes':['id','name',_0x4dfb('0x6a'),_0x4dfb('0x6b'),'createdAt'],'raw':!![]});}})[_0x4dfb('0x26')](function(_0x309cb8){if(_0x309cb8){fs[_0x4dfb('0x62')](path['join'](_0x4478fd[_0x4dfb('0x54')],util[_0x4dfb('0x6d')](_0x4dfb('0x6e'),_0x309cb8[_0x4dfb('0x2c')],_0x309cb8[_0x4dfb('0x6b')])));return _0x309cb8;}})['catch'](function(_0x4383d3){throw new db['Sequelize']['ValidationError'](_0x4383d3['message']);});})['then'](handleEntityNotFound(_0x9ef345,null))[_0x4dfb('0x26')](respondWithStatusCode(_0x9ef345,0xcc))[_0x4dfb('0x49')](handleError(_0x9ef345,null));};exports[_0x4dfb('0x74')]=function(_0x86c9af,_0x29a3a2,_0x1c71b3){var _0x5610e3={};var _0x417f92={};var _0x1a23d6;var _0x45fad8;return db[_0x4dfb('0x30')]['findOne']({'where':{'id':_0x86c9af['params']['id']}})['then'](handleEntityNotFound(_0x29a3a2,null))[_0x4dfb('0x26')](function(_0x43611e){if(_0x43611e){_0x1a23d6=_0x43611e;_0x417f92[_0x4dfb('0x34')]=_['keys'](db[_0x4dfb('0x68')]['rawAttributes']);_0x417f92[_0x4dfb('0x36')]=_[_0x4dfb('0x35')](_0x86c9af[_0x4dfb('0x36')]);_0x417f92[_0x4dfb('0x37')]=_[_0x4dfb('0x38')](_0x417f92['model'],_0x417f92['query']);_0x5610e3['attributes']=_[_0x4dfb('0x38')](_0x417f92[_0x4dfb('0x34')],qs[_0x4dfb('0x3a')](_0x86c9af[_0x4dfb('0x36')][_0x4dfb('0x3a')]));_0x5610e3['attributes']=_0x5610e3['attributes'][_0x4dfb('0x4b')]?_0x5610e3[_0x4dfb('0x39')]:_0x417f92[_0x4dfb('0x34')];_0x5610e3[_0x4dfb('0x3d')]=qs[_0x4dfb('0x3e')](_0x86c9af[_0x4dfb('0x36')][_0x4dfb('0x3e')]);_0x5610e3[_0x4dfb('0x3f')]=qs[_0x4dfb('0x37')](_[_0x4dfb('0x40')](_0x86c9af['query'],_0x417f92['filters']));if(_0x86c9af[_0x4dfb('0x36')][_0x4dfb('0x41')]){_0x5610e3[_0x4dfb('0x3f')]=_[_0x4dfb('0x42')](_0x5610e3['where'],{'$or':_['map'](_0x5610e3['attributes'],function(_0xdc947c){var _0x558e72={};_0x558e72[_0xdc947c]={'$like':'%'+_0x86c9af[_0x4dfb('0x36')][_0x4dfb('0x41')]+'%'};return _0x558e72;})});}_0x5610e3=_[_0x4dfb('0x42')]({},_0x5610e3,_0x86c9af[_0x4dfb('0x44')]);return _0x1a23d6[_0x4dfb('0x74')](_0x5610e3);}})[_0x4dfb('0x26')](function(_0x6b8e8b){if(_0x6b8e8b){_0x45fad8=_0x6b8e8b[_0x4dfb('0x4b')];if(!_0x86c9af['query']['hasOwnProperty'](_0x4dfb('0x3c'))){_0x5610e3[_0x4dfb('0x1d')]=qs[_0x4dfb('0x1d')](_0x86c9af[_0x4dfb('0x36')]['limit']);_0x5610e3[_0x4dfb('0x20')]=qs[_0x4dfb('0x20')](_0x86c9af[_0x4dfb('0x36')][_0x4dfb('0x20')]);}return _0x1a23d6[_0x4dfb('0x74')](_0x5610e3);}})[_0x4dfb('0x26')](function(_0x4a6e82){if(_0x4a6e82){return _0x4a6e82?{'count':_0x45fad8,'rows':_0x4a6e82}:null;}})[_0x4dfb('0x26')](respondWithResult(_0x29a3a2,null))[_0x4dfb('0x49')](handleError(_0x29a3a2,null));}; \ No newline at end of file +var _0xe231=['files','mkdirSync','directory','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','MusicOnHolds','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','sequelize','readdirSync','forEach','unlinkSync','rmdirSync','ValidationError','message','addSound','Sound','findOne','save_name','createdAt','server/files/sounds/converted','format','%s.%s','extname','converted_format','Sequelize','removeSound','id2','getSounds','fields','order','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','type','VIRTUAL','count','includeAll','include','params','find','catch','body','create','transaction','mode','join','root','server/files/moh'];(function(_0x124edd,_0xca2e2d){var _0x22d6d5=function(_0x245306){while(--_0x245306){_0x124edd['push'](_0x124edd['shift']());}};_0x22d6d5(++_0xca2e2d);}(_0xe231,0x16d));var _0x1e23=function(_0x488b85,_0x10ec23){_0x488b85=_0x488b85-0x0;var _0x59d07d=_0xe231[_0x488b85];return _0x59d07d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1e23('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1e23('0x1'));var rp=require(_0x1e23('0x2'));var moment=require(_0x1e23('0x3'));var BPromise=require(_0x1e23('0x4'));var Mustache=require(_0x1e23('0x5'));var util=require(_0x1e23('0x6'));var path=require(_0x1e23('0x7'));var sox=require('sox');var csv=require(_0x1e23('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1e23('0x9'));var _=require(_0x1e23('0xa'));var squel=require(_0x1e23('0xb'));var crypto=require(_0x1e23('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1e23('0xd'));var toCsv=require('to-csv');var querystring=require(_0x1e23('0xe'));var Papa=require('papaparse');var Redis=require(_0x1e23('0xf'));var authService=require(_0x1e23('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x1e23('0x11'));var hardwareService=require(_0x1e23('0x12'));var logger=require(_0x1e23('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x1e23('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x1e23('0x15'))['db'];function respondWithStatusCode(_0x4d236a,_0x5a7e26){_0x5a7e26=_0x5a7e26||0xcc;return function(_0x47c22b){if(_0x47c22b){return _0x4d236a[_0x1e23('0x16')](_0x5a7e26);}return _0x4d236a[_0x1e23('0x17')](_0x5a7e26)[_0x1e23('0x18')]();};}function respondWithResult(_0x31ab8a,_0xcb3151){_0xcb3151=_0xcb3151||0xc8;return function(_0x556a2b){if(_0x556a2b){return _0x31ab8a[_0x1e23('0x17')](_0xcb3151)[_0x1e23('0x19')](_0x556a2b);}};}function respondWithFilteredResult(_0x4e3e2e,_0x49b678){return function(_0x2dae83){if(_0x2dae83){var _0x48bf07=typeof _0x49b678[_0x1e23('0x1a')]===_0x1e23('0x1b')&&typeof _0x49b678[_0x1e23('0x1c')]===_0x1e23('0x1b');var _0x1ec05a=_0x2dae83['count'];var _0x33acb9=_0x48bf07?0x0:_0x49b678[_0x1e23('0x1a')];var _0x252d7d=_0x48bf07?_0x2dae83['count']:_0x49b678['offset']+_0x49b678['limit'];var _0x478c92;if(_0x252d7d>=_0x1ec05a){_0x252d7d=_0x1ec05a;_0x478c92=0xc8;}else{_0x478c92=0xce;}_0x4e3e2e[_0x1e23('0x17')](_0x478c92);return _0x4e3e2e[_0x1e23('0x1d')](_0x1e23('0x1e'),_0x33acb9+'-'+_0x252d7d+'/'+_0x1ec05a)[_0x1e23('0x19')](_0x2dae83);}return null;};}function patchUpdates(_0x367467){return function(_0x35721e){try{jsonpatch[_0x1e23('0x1f')](_0x35721e,_0x367467,!![]);}catch(_0x3b87b5){return BPromise[_0x1e23('0x20')](_0x3b87b5);}return _0x35721e[_0x1e23('0x21')]();};}function saveUpdates(_0xbad20e,_0x562988){return function(_0x3d7525){if(_0x3d7525){return _0x3d7525[_0x1e23('0x22')](_0xbad20e)[_0x1e23('0x23')](function(_0x3ab8c4){return _0x3ab8c4;});}return null;};}function removeEntity(_0x57552b,_0x55c905){return function(_0x11f678){if(_0x11f678){return _0x11f678[_0x1e23('0x24')]()[_0x1e23('0x23')](function(){var _0x117d37=_0x11f678[_0x1e23('0x25')]({'plain':!![]});var _0x4eb0b2='MusicOnHolds';return db['UserProfileResource'][_0x1e23('0x24')]({'where':{'type':_0x4eb0b2,'resourceId':_0x117d37['id']}})[_0x1e23('0x23')](function(){return _0x11f678;});})[_0x1e23('0x23')](function(){_0x57552b[_0x1e23('0x17')](0xcc)[_0x1e23('0x18')]();});}};}function handleEntityNotFound(_0x3f526b,_0x18992e){return function(_0x2d4f26){if(!_0x2d4f26){_0x3f526b[_0x1e23('0x16')](0x194);}return _0x2d4f26;};}function handleError(_0x380997,_0x152469){_0x152469=_0x152469||0x1f4;return function(_0x2bcd3e){logger['error'](_0x2bcd3e[_0x1e23('0x26')]);if(_0x2bcd3e['name']){delete _0x2bcd3e[_0x1e23('0x27')];}_0x380997['status'](_0x152469)[_0x1e23('0x28')](_0x2bcd3e);};}exports[_0x1e23('0x29')]=function(_0x2131bd,_0x2281bc){var _0x1cd7dd={},_0x11db90={},_0x1384da={'count':0x0,'rows':[]};var _0x4833b8=_[_0x1e23('0x2a')](db[_0x1e23('0x2b')][_0x1e23('0x2c')],function(_0xaf0e65){return{'name':_0xaf0e65[_0x1e23('0x2d')],'type':_0xaf0e65['type'][_0x1e23('0x2e')]};});_0x11db90[_0x1e23('0x2f')]=_['map'](_0x4833b8,_0x1e23('0x27'));_0x11db90[_0x1e23('0x30')]=_[_0x1e23('0x31')](_0x2131bd[_0x1e23('0x30')]);_0x11db90[_0x1e23('0x32')]=_[_0x1e23('0x33')](_0x11db90[_0x1e23('0x2f')],_0x11db90[_0x1e23('0x30')]);_0x1cd7dd['attributes']=_[_0x1e23('0x33')](_0x11db90[_0x1e23('0x2f')],qs['fields'](_0x2131bd[_0x1e23('0x30')]['fields']));_0x1cd7dd['attributes']=_0x1cd7dd[_0x1e23('0x34')][_0x1e23('0x35')]?_0x1cd7dd[_0x1e23('0x34')]:_0x11db90[_0x1e23('0x2f')];if(!_0x2131bd[_0x1e23('0x30')][_0x1e23('0x36')](_0x1e23('0x37'))){_0x1cd7dd[_0x1e23('0x1c')]=qs[_0x1e23('0x1c')](_0x2131bd[_0x1e23('0x30')][_0x1e23('0x1c')]);_0x1cd7dd[_0x1e23('0x1a')]=qs[_0x1e23('0x1a')](_0x2131bd['query']['offset']);}_0x1cd7dd['order']=qs['sort'](_0x2131bd['query'][_0x1e23('0x38')]);delete _0x2131bd[_0x1e23('0x30')]['sort'];_0x1cd7dd[_0x1e23('0x39')]=qs[_0x1e23('0x32')](_['pick'](_0x2131bd[_0x1e23('0x30')],_0x11db90['filters']),_0x4833b8);if(_0x2131bd[_0x1e23('0x30')][_0x1e23('0x3a')]){_0x1cd7dd['where']=_[_0x1e23('0x3b')](_0x1cd7dd['where'],{'$or':_[_0x1e23('0x2a')](_0x4833b8,function(_0xd9b9c8){if(_0xd9b9c8[_0x1e23('0x3c')]!==_0x1e23('0x3d')){var _0x53105d={};_0x53105d[_0xd9b9c8['name']]={'$like':'%'+_0x2131bd['query'][_0x1e23('0x3a')]+'%'};return _0x53105d;}})});}_0x1cd7dd=_[_0x1e23('0x3b')]({},_0x1cd7dd,_0x2131bd['options']);var _0xe8d1ef={'where':_0x1cd7dd[_0x1e23('0x39')]};return db['VoiceMusicOnHold'][_0x1e23('0x3e')](_0xe8d1ef)['then'](function(_0x48180b){_0x1384da['count']=_0x48180b;if(_0x2131bd[_0x1e23('0x30')][_0x1e23('0x3f')]){_0x1cd7dd[_0x1e23('0x40')]=[{'all':!![]}];}return db[_0x1e23('0x2b')]['findAll'](_0x1cd7dd);})[_0x1e23('0x23')](function(_0x429d01){_0x1384da['rows']=_0x429d01;return _0x1384da;})['then'](respondWithFilteredResult(_0x2281bc,_0x1cd7dd))['catch'](handleError(_0x2281bc,null));};exports['show']=function(_0x243ae6,_0x154368){var _0x5b902f={'raw':![],'where':{'id':_0x243ae6[_0x1e23('0x41')]['id']}},_0x55e381={};_0x55e381['model']=_['keys'](db[_0x1e23('0x2b')][_0x1e23('0x2c')]);_0x55e381[_0x1e23('0x30')]=_[_0x1e23('0x31')](_0x243ae6['query']);_0x55e381[_0x1e23('0x32')]=_[_0x1e23('0x33')](_0x55e381[_0x1e23('0x2f')],_0x55e381[_0x1e23('0x30')]);_0x5b902f[_0x1e23('0x34')]=_[_0x1e23('0x33')](_0x55e381[_0x1e23('0x2f')],qs['fields'](_0x243ae6['query']['fields']));_0x5b902f[_0x1e23('0x34')]=_0x5b902f[_0x1e23('0x34')]['length']?_0x5b902f['attributes']:_0x55e381[_0x1e23('0x2f')];if(_0x243ae6[_0x1e23('0x30')][_0x1e23('0x3f')]){_0x5b902f[_0x1e23('0x40')]=[{'all':!![]}];}_0x5b902f=_[_0x1e23('0x3b')]({},_0x5b902f,_0x243ae6['options']);return db[_0x1e23('0x2b')][_0x1e23('0x42')](_0x5b902f)[_0x1e23('0x23')](handleEntityNotFound(_0x154368,null))[_0x1e23('0x23')](respondWithResult(_0x154368,null))[_0x1e23('0x43')](handleError(_0x154368,null));};exports[_0x1e23('0x22')]=function(_0x3247d2,_0x2e6c01){if(_0x3247d2[_0x1e23('0x44')]['id']){delete _0x3247d2[_0x1e23('0x44')]['id'];}return db[_0x1e23('0x2b')][_0x1e23('0x42')]({'where':{'id':_0x3247d2['params']['id']}})[_0x1e23('0x23')](handleEntityNotFound(_0x2e6c01,null))['then'](saveUpdates(_0x3247d2[_0x1e23('0x44')],null))[_0x1e23('0x23')](respondWithResult(_0x2e6c01,null))[_0x1e23('0x43')](handleError(_0x2e6c01,null));};exports[_0x1e23('0x45')]=function(_0xdfe0cf,_0x189c91,_0x263b3f){return db['sequelize'][_0x1e23('0x46')](function(_0x5c64e1){if(_0xdfe0cf[_0x1e23('0x44')][_0x1e23('0x47')]==='files'){_0xdfe0cf['body']['directory']=path[_0x1e23('0x48')](config[_0x1e23('0x49')],_0x1e23('0x4a'),_0xdfe0cf[_0x1e23('0x44')][_0x1e23('0x27')]);}return db[_0x1e23('0x2b')]['create'](_0xdfe0cf[_0x1e23('0x44')],{'transaction':_0x5c64e1})['then'](function(_0x3c2723){if(_0xdfe0cf['body'][_0x1e23('0x47')]===_0x1e23('0x4b')){fs[_0x1e23('0x4c')](_0x3c2723[_0x1e23('0x4d')],parseInt(_0x1e23('0x4e'),0x8));}var _0x356b69=_0xdfe0cf[_0x1e23('0x4f')][_0x1e23('0x25')]({'plain':!![]});if(!_0x356b69)throw new Error(_0x1e23('0x50'));if(_0x356b69[_0x1e23('0x51')]===_0x1e23('0x4f')){var _0x4dfaed=_0x3c2723['get']({'plain':!![]});return db[_0x1e23('0x52')]['find']({'where':{'name':_0x1e23('0x53'),'userProfileId':_0x356b69[_0x1e23('0x54')]},'raw':!![]})[_0x1e23('0x23')](function(_0x4c52c6){if(_0x4c52c6&&_0x4c52c6[_0x1e23('0x55')]===0x0){return db['UserProfileResource']['create']({'name':_0x4dfaed[_0x1e23('0x27')],'resourceId':_0x4dfaed['id'],'type':_0x4c52c6[_0x1e23('0x27')],'sectionId':_0x4c52c6['id']},{})[_0x1e23('0x23')](function(){return _0x3c2723;});}else{return _0x3c2723;}})[_0x1e23('0x43')](function(_0x4d2b61){logger['error'](_0x1e23('0x56'),_0x4d2b61);});}return _0x3c2723;});})[_0x1e23('0x23')](respondWithResult(_0x189c91,0xc9))[_0x1e23('0x43')](handleError(_0x189c91,null));};exports[_0x1e23('0x24')]=function(_0x42b60c,_0x646145,_0x8c4739){var _0x286a7a;return db[_0x1e23('0x2b')][_0x1e23('0x42')]({'where':{'id':_0x42b60c[_0x1e23('0x41')]['id']}})[_0x1e23('0x23')](function(_0x3ad978){if(_0x3ad978){return db[_0x1e23('0x57')][_0x1e23('0x46')](function(_0xba2d2c){return _0x3ad978['destroy']({'transaction':_0xba2d2c,'raw':!![]})['then'](function(_0x52f114){if(_0x52f114[_0x1e23('0x4d')]){fs[_0x1e23('0x58')](_0x52f114[_0x1e23('0x4d')])[_0x1e23('0x59')](function(_0x129af8){fs[_0x1e23('0x5a')](path[_0x1e23('0x48')](_0x52f114[_0x1e23('0x4d')],_0x129af8));});fs[_0x1e23('0x5b')](_0x52f114['directory']);}return _0x52f114;});})['catch'](function(_0x53ca97){throw new db['Sequelize'][(_0x1e23('0x5c'))](_0x53ca97[_0x1e23('0x5d')]);});}})[_0x1e23('0x23')](handleEntityNotFound(_0x646145,null))[_0x1e23('0x23')](removeEntity(_0x646145,null))['catch'](handleError(_0x646145,null));};exports[_0x1e23('0x5e')]=function(_0x2ce66e,_0x5b1d0f,_0x42f73a){return db[_0x1e23('0x57')]['transaction'](function(_0x1c1881){var _0xd130db;return db[_0x1e23('0x2b')]['find']({'where':{'id':_0x2ce66e[_0x1e23('0x41')]['id']}})['then'](function(_0x5475b4){if(_0x5475b4){_0xd130db=_0x5475b4;return _0x5475b4[_0x1e23('0x5e')](_0x2ce66e['body']['id'],{'transaction':_0x1c1881});}})[_0x1e23('0x23')](function(_0x704d22){if(_0x704d22){return db[_0x1e23('0x5f')][_0x1e23('0x60')]({'where':{'id':_0x2ce66e[_0x1e23('0x44')]['id']},'attributes':['id',_0x1e23('0x27'),_0x1e23('0x61'),'converted_format',_0x1e23('0x62')],'raw':!![]});}})[_0x1e23('0x23')](function(_0x924d08){if(_0x924d08){var _0x186183=path[_0x1e23('0x48')](config[_0x1e23('0x49')],_0x1e23('0x63'),util[_0x1e23('0x64')](_0x1e23('0x65'),path['basename'](_0x924d08[_0x1e23('0x61')],path[_0x1e23('0x66')](_0x924d08[_0x1e23('0x61')])),_0x924d08[_0x1e23('0x67')]));var _0x566d8b=path[_0x1e23('0x48')](config[_0x1e23('0x49')],_0x1e23('0x4a'),_0xd130db[_0x1e23('0x27')],util[_0x1e23('0x64')](_0x1e23('0x65'),_0x924d08[_0x1e23('0x27')],_0x924d08[_0x1e23('0x67')]));fs['symlinkSync'](_0x186183,_0x566d8b);return _0x924d08;}})['catch'](function(_0x1861fe){throw new db[(_0x1e23('0x68'))][(_0x1e23('0x5c'))](_0x1861fe[_0x1e23('0x5d')]);});})['then'](handleEntityNotFound(_0x5b1d0f,null))[_0x1e23('0x23')](respondWithResult(_0x5b1d0f,0xc9))[_0x1e23('0x43')](handleError(_0x5b1d0f,null));};exports[_0x1e23('0x69')]=function(_0x4acf18,_0x4ecc9f,_0x3597c4){return db['sequelize'][_0x1e23('0x46')](function(_0x920533){var _0x389ad4;return db[_0x1e23('0x2b')]['findOne']({'where':{'id':_0x4acf18[_0x1e23('0x41')]['id']}})[_0x1e23('0x23')](handleEntityNotFound(_0x4ecc9f,null))[_0x1e23('0x23')](function(_0x46f76f){if(_0x46f76f){_0x389ad4=_0x46f76f;return _0x46f76f[_0x1e23('0x69')](_0x4acf18['params'][_0x1e23('0x6a')]);}})[_0x1e23('0x23')](function(_0x261653){if(_0x261653){return db[_0x1e23('0x5f')][_0x1e23('0x60')]({'where':{'id':_0x4acf18[_0x1e23('0x41')]['id2']},'attributes':['id',_0x1e23('0x27'),_0x1e23('0x61'),'converted_format',_0x1e23('0x62')],'raw':!![]});}})[_0x1e23('0x23')](function(_0x22f13d){if(_0x22f13d){fs[_0x1e23('0x5a')](path[_0x1e23('0x48')](_0x389ad4[_0x1e23('0x4d')],util[_0x1e23('0x64')](_0x1e23('0x65'),_0x22f13d[_0x1e23('0x27')],_0x22f13d[_0x1e23('0x67')])));return _0x22f13d;}})[_0x1e23('0x43')](function(_0x267736){throw new db[(_0x1e23('0x68'))][(_0x1e23('0x5c'))](_0x267736[_0x1e23('0x5d')]);});})[_0x1e23('0x23')](handleEntityNotFound(_0x4ecc9f,null))[_0x1e23('0x23')](respondWithStatusCode(_0x4ecc9f,0xcc))[_0x1e23('0x43')](handleError(_0x4ecc9f,null));};exports[_0x1e23('0x6b')]=function(_0x5a3f16,_0x14e764,_0x4bb0cb){var _0x488846={};var _0x59832e={};var _0x557bf1;var _0x253b55;return db[_0x1e23('0x2b')][_0x1e23('0x60')]({'where':{'id':_0x5a3f16[_0x1e23('0x41')]['id']}})['then'](handleEntityNotFound(_0x14e764,null))[_0x1e23('0x23')](function(_0x7326d4){if(_0x7326d4){_0x557bf1=_0x7326d4;_0x59832e[_0x1e23('0x2f')]=_['keys'](db['Sound']['rawAttributes']);_0x59832e[_0x1e23('0x30')]=_[_0x1e23('0x31')](_0x5a3f16[_0x1e23('0x30')]);_0x59832e[_0x1e23('0x32')]=_['intersection'](_0x59832e[_0x1e23('0x2f')],_0x59832e[_0x1e23('0x30')]);_0x488846['attributes']=_[_0x1e23('0x33')](_0x59832e[_0x1e23('0x2f')],qs['fields'](_0x5a3f16[_0x1e23('0x30')][_0x1e23('0x6c')]));_0x488846[_0x1e23('0x34')]=_0x488846[_0x1e23('0x34')]['length']?_0x488846[_0x1e23('0x34')]:_0x59832e[_0x1e23('0x2f')];_0x488846[_0x1e23('0x6d')]=qs[_0x1e23('0x38')](_0x5a3f16[_0x1e23('0x30')]['sort']);_0x488846['where']=qs[_0x1e23('0x32')](_['pick'](_0x5a3f16['query'],_0x59832e[_0x1e23('0x32')]));if(_0x5a3f16[_0x1e23('0x30')][_0x1e23('0x3a')]){_0x488846[_0x1e23('0x39')]=_[_0x1e23('0x3b')](_0x488846[_0x1e23('0x39')],{'$or':_[_0x1e23('0x2a')](_0x488846[_0x1e23('0x34')],function(_0x21b79a){var _0x4be192={};_0x4be192[_0x21b79a]={'$like':'%'+_0x5a3f16['query'][_0x1e23('0x3a')]+'%'};return _0x4be192;})});}_0x488846=_[_0x1e23('0x3b')]({},_0x488846,_0x5a3f16['options']);return _0x557bf1[_0x1e23('0x6b')](_0x488846);}})[_0x1e23('0x23')](function(_0x3f4874){if(_0x3f4874){_0x253b55=_0x3f4874[_0x1e23('0x35')];if(!_0x5a3f16[_0x1e23('0x30')][_0x1e23('0x36')]('nolimit')){_0x488846['limit']=qs[_0x1e23('0x1c')](_0x5a3f16[_0x1e23('0x30')]['limit']);_0x488846[_0x1e23('0x1a')]=qs[_0x1e23('0x1a')](_0x5a3f16['query']['offset']);}return _0x557bf1[_0x1e23('0x6b')](_0x488846);}})[_0x1e23('0x23')](function(_0xc3113f){if(_0xc3113f){return _0xc3113f?{'count':_0x253b55,'rows':_0xc3113f}:null;}})[_0x1e23('0x23')](respondWithResult(_0x14e764,null))[_0x1e23('0x43')](handleError(_0x14e764,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 41200e3..3ab8562 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 _0x7da8=['bluebird','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','util','../../config/logger','api','moment'];(function(_0x49f0bf,_0x2d7338){var _0x3aec47=function(_0x4feb86){while(--_0x4feb86){_0x49f0bf['push'](_0x49f0bf['shift']());}};_0x3aec47(++_0x2d7338);}(_0x7da8,0x127));var _0x87da=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x7da8[_0x2b4411];return _0x8e41ef;};'use strict';var _=require('lodash');var util=require(_0x87da('0x0'));var logger=require(_0x87da('0x1'))(_0x87da('0x2'));var moment=require(_0x87da('0x3'));var BPromise=require(_0x87da('0x4'));var rp=require(_0x87da('0x5'));var fs=require('fs');var path=require(_0x87da('0x6'));var rimraf=require(_0x87da('0x7'));var config=require(_0x87da('0x8'));var attributes=require(_0x87da('0x9'));module[_0x87da('0xa')]=function(_0x2e17f8,_0x108fa7){return _0x2e17f8[_0x87da('0xb')](_0x87da('0xc'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7f88=['../../config/environment','./voiceMusicOnHold.attributes','exports','VoiceMusicOnHold','voice_musiconhold','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x45318a,_0x57852a){var _0x1caadf=function(_0x548ae3){while(--_0x548ae3){_0x45318a['push'](_0x45318a['shift']());}};_0x1caadf(++_0x57852a);}(_0x7f88,0x130));var _0x87f8=function(_0x2f655b,_0x3bd91b){_0x2f655b=_0x2f655b-0x0;var _0xf1d8da=_0x7f88[_0x2f655b];return _0xf1d8da;};'use strict';var _=require(_0x87f8('0x0'));var util=require('util');var logger=require(_0x87f8('0x1'))(_0x87f8('0x2'));var moment=require(_0x87f8('0x3'));var BPromise=require(_0x87f8('0x4'));var rp=require(_0x87f8('0x5'));var fs=require('fs');var path=require(_0x87f8('0x6'));var rimraf=require(_0x87f8('0x7'));var config=require(_0x87f8('0x8'));var attributes=require(_0x87f8('0x9'));module[_0x87f8('0xa')]=function(_0x40650c,_0x2e8a4f){return _0x40650c['define'](_0x87f8('0xb'),attributes,{'tableName':_0x87f8('0xc'),'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 c3130cb..7dab635 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s'];(function(_0x3f82bb,_0x1944c2){var _0xaea81a=function(_0x4616d0){while(--_0x4616d0){_0x3f82bb['push'](_0x3f82bb['shift']());}};_0xaea81a(++_0x1944c2);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x14fad0,_0x278d75){_0x14fad0=_0x14fad0-0x0;var _0x5c665f=_0xcb91[_0x14fad0];return _0x5c665f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file +var _0xa9e0=['http','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3d245b,_0x58bea6){var _0x13d680=function(_0x1c8cd1){while(--_0x1c8cd1){_0x3d245b['push'](_0x3d245b['shift']());}};_0x13d680(++_0x58bea6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'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/voicePrefix/index.js b/server/api/voicePrefix/index.js index b65798b..8f0f996 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 _0xd4c5=['removeTeams','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/users','getTeams','post','addAgents','/:id/teams','addTeams','put','update','delete','destroy','removeAgents'];(function(_0xc3e2ac,_0x184cde){var _0x62e8c=function(_0x24c7d5){while(--_0x24c7d5){_0xc3e2ac['push'](_0xc3e2ac['shift']());}};_0x62e8c(++_0x184cde);}(_0xd4c5,0x1d2));var _0x5d4c=function(_0x321d7c,_0x116466){_0x321d7c=_0x321d7c-0x0;var _0x5f474d=_0xd4c5[_0x321d7c];return _0x5f474d;};'use strict';var multer=require(_0x5d4c('0x0'));var util=require(_0x5d4c('0x1'));var path=require(_0x5d4c('0x2'));var timeout=require('connect-timeout');var express=require(_0x5d4c('0x3'));var router=express[_0x5d4c('0x4')]();var fs_extra=require(_0x5d4c('0x5'));var auth=require(_0x5d4c('0x6'));var interaction=require(_0x5d4c('0x7'));var config=require(_0x5d4c('0x8'));var controller=require('./voicePrefix.controller');router[_0x5d4c('0x9')]('/',auth[_0x5d4c('0xa')](),controller[_0x5d4c('0xb')]);router[_0x5d4c('0x9')](_0x5d4c('0xc'),auth[_0x5d4c('0xa')](),controller[_0x5d4c('0xd')]);router[_0x5d4c('0x9')](_0x5d4c('0xe'),auth[_0x5d4c('0xa')](),controller[_0x5d4c('0xf')]);router[_0x5d4c('0x9')](_0x5d4c('0x10'),auth[_0x5d4c('0xa')](),controller['getAgents']);router[_0x5d4c('0x9')]('/:id/teams',auth[_0x5d4c('0xa')](),controller[_0x5d4c('0x11')]);router[_0x5d4c('0x12')]('/',auth[_0x5d4c('0xa')](),controller['create']);router[_0x5d4c('0x12')](_0x5d4c('0x10'),auth[_0x5d4c('0xa')](),controller[_0x5d4c('0x13')]);router['post'](_0x5d4c('0x14'),auth[_0x5d4c('0xa')](),controller[_0x5d4c('0x15')]);router[_0x5d4c('0x16')](_0x5d4c('0xe'),auth[_0x5d4c('0xa')](),controller[_0x5d4c('0x17')]);router[_0x5d4c('0x18')](_0x5d4c('0xe'),auth['isAuthenticated'](),controller[_0x5d4c('0x19')]);router[_0x5d4c('0x18')](_0x5d4c('0x10'),auth[_0x5d4c('0xa')](),controller[_0x5d4c('0x1a')]);router['delete'](_0x5d4c('0x14'),auth[_0x5d4c('0xa')](),controller[_0x5d4c('0x1b')]);module[_0x5d4c('0x1c')]=router; \ No newline at end of file +var _0xf2ca=['/:id/users','getAgents','getTeams','post','create','addAgents','/:id/teams','addTeams','put','update','delete','destroy','removeAgents','removeTeams','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show'];(function(_0x149083,_0x4047b6){var _0x4dc74e=function(_0x1211f9){while(--_0x1211f9){_0x149083['push'](_0x149083['shift']());}};_0x4dc74e(++_0x4047b6);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x311666,_0x17b07d){_0x311666=_0x311666-0x0;var _0x2bc692=_0xf2ca[_0x311666];return _0x2bc692;};'use strict';var multer=require(_0xaf2c('0x0'));var util=require(_0xaf2c('0x1'));var path=require(_0xaf2c('0x2'));var timeout=require('connect-timeout');var express=require(_0xaf2c('0x3'));var router=express[_0xaf2c('0x4')]();var fs_extra=require(_0xaf2c('0x5'));var auth=require(_0xaf2c('0x6'));var interaction=require(_0xaf2c('0x7'));var config=require(_0xaf2c('0x8'));var controller=require('./voicePrefix.controller');router[_0xaf2c('0x9')]('/',auth[_0xaf2c('0xa')](),controller[_0xaf2c('0xb')]);router[_0xaf2c('0x9')]('/describe',auth[_0xaf2c('0xa')](),controller[_0xaf2c('0xc')]);router['get'](_0xaf2c('0xd'),auth['isAuthenticated'](),controller[_0xaf2c('0xe')]);router['get'](_0xaf2c('0xf'),auth[_0xaf2c('0xa')](),controller[_0xaf2c('0x10')]);router[_0xaf2c('0x9')]('/:id/teams',auth['isAuthenticated'](),controller[_0xaf2c('0x11')]);router[_0xaf2c('0x12')]('/',auth[_0xaf2c('0xa')](),controller[_0xaf2c('0x13')]);router[_0xaf2c('0x12')]('/:id/users',auth['isAuthenticated'](),controller[_0xaf2c('0x14')]);router[_0xaf2c('0x12')](_0xaf2c('0x15'),auth[_0xaf2c('0xa')](),controller[_0xaf2c('0x16')]);router[_0xaf2c('0x17')](_0xaf2c('0xd'),auth[_0xaf2c('0xa')](),controller[_0xaf2c('0x18')]);router[_0xaf2c('0x19')](_0xaf2c('0xd'),auth[_0xaf2c('0xa')](),controller[_0xaf2c('0x1a')]);router[_0xaf2c('0x19')](_0xaf2c('0xf'),auth['isAuthenticated'](),controller[_0xaf2c('0x1b')]);router['delete'](_0xaf2c('0x15'),auth[_0xaf2c('0xa')](),controller[_0xaf2c('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 8b3ad3c..9b543c6 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 _0x04b7=['system-','getDataValue','sequelize','exports','STRING','name','VIRTUAL'];(function(_0x403211,_0xa7ad5b){var _0x4721e4=function(_0x443b2f){while(--_0x443b2f){_0x403211['push'](_0x403211['shift']());}};_0x4721e4(++_0xa7ad5b);}(_0x04b7,0x160));var _0x704b=function(_0x1ee2ae,_0x17c0eb){_0x1ee2ae=_0x1ee2ae-0x0;var _0x1780e5=_0x04b7[_0x1ee2ae];return _0x1780e5;};'use strict';var Sequelize=require(_0x704b('0x0'));module[_0x704b('0x1')]={'name':{'type':Sequelize[_0x704b('0x2')],'allowNull':![],'unique':_0x704b('0x3')},'prefix':{'type':Sequelize[_0x704b('0x4')],'get':function(_0x3d9f9d){return _0x704b('0x5')+this[_0x704b('0x6')]('name')+'-';}},'description':{'type':Sequelize[_0x704b('0x2')]},'callerIdAll':{'type':Sequelize[_0x704b('0x2')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x65a0=['name','VIRTUAL','system-','getDataValue','sequelize','exports','STRING'];(function(_0x239790,_0x39c001){var _0x381946=function(_0x3ba508){while(--_0x3ba508){_0x239790['push'](_0x239790['shift']());}};_0x381946(++_0x39c001);}(_0x65a0,0x9e));var _0x065a=function(_0x2152ab,_0x133b74){_0x2152ab=_0x2152ab-0x0;var _0xdd6173=_0x65a0[_0x2152ab];return _0xdd6173;};'use strict';var Sequelize=require(_0x065a('0x0'));module[_0x065a('0x1')]={'name':{'type':Sequelize[_0x065a('0x2')],'allowNull':![],'unique':_0x065a('0x3')},'prefix':{'type':Sequelize[_0x065a('0x4')],'get':function(_0x2f4aa7){return _0x065a('0x5')+this[_0x065a('0x6')](_0x065a('0x3'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0x065a('0x2')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 15f2095..10e6013 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 _0xbbbc=['filters','filter','merge','options','VoicePrefix','includeAll','include','findAll','rows','catch','show','params','find','describe','create','sequelize','transaction','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','VoicePrefixes','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','exten','system','priority','NoOp','Voice\x20Prefix','VoicePrefixId','Extensions\x20creation\x20failed','prefix','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','context','${EXTEN:','charAt','system-','update','findById','addAgents','ids','omit','body','emit','userVoicePrefix:save','removeAgents','isArray','findOne','pick','getAgents','Team','getTeams','hasOwnProperty','addTeams','Agents','online','interface','flatMap','each','TeamVoicePrefix','findOrCreate','forEach','removeTeams','field','from','join','user_has_teams','VoicePrefixId\x20=\x20?','clone','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','userVoicePrefix:remove','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','register','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','then','get','UserProfileResource','destroy','status','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','where'];(function(_0x337e61,_0x4feda1){var _0x31792d=function(_0x28a1aa){while(--_0x28a1aa){_0x337e61['push'](_0x337e61['shift']());}};_0x31792d(++_0x4feda1);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x47b233,_0x503e71){_0x47b233=_0x47b233-0x0;var _0xe827c1=_0xbbbc[_0x47b233];return _0xe827c1;};'use strict';var emlformat=require(_0xcbbb('0x0'));var rimraf=require(_0xcbbb('0x1'));var zipdir=require(_0xcbbb('0x2'));var jsonpatch=require(_0xcbbb('0x3'));var rp=require(_0xcbbb('0x4'));var moment=require(_0xcbbb('0x5'));var BPromise=require(_0xcbbb('0x6'));var Mustache=require('mustache');var util=require(_0xcbbb('0x7'));var path=require(_0xcbbb('0x8'));var sox=require(_0xcbbb('0x9'));var csv=require(_0xcbbb('0xa'));var ejs=require(_0xcbbb('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcbbb('0xc'));var squel=require(_0xcbbb('0xd'));var crypto=require(_0xcbbb('0xe'));var jsforce=require(_0xcbbb('0xf'));var deskjs=require(_0xcbbb('0x10'));var toCsv=require(_0xcbbb('0xa'));var querystring=require(_0xcbbb('0x11'));var Papa=require('papaparse');var Redis=require(_0xcbbb('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xcbbb('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcbbb('0x14'))('api');var utils=require(_0xcbbb('0x15'));var config=require(_0xcbbb('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xcbbb('0x17'))['db'];config['redis']=_[_0xcbbb('0x18')](config['redis'],{'host':_0xcbbb('0x19'),'port':0x18eb});var socket=require(_0xcbbb('0x1a'))(new Redis(config[_0xcbbb('0x1b')]));require('./voicePrefix.socket')[_0xcbbb('0x1c')](socket);function respondWithStatusCode(_0x3ff767,_0x8a325c){_0x8a325c=_0x8a325c||0xcc;return function(_0x273e13){if(_0x273e13){return _0x3ff767['sendStatus'](_0x8a325c);}return _0x3ff767['status'](_0x8a325c)[_0xcbbb('0x1d')]();};}function respondWithResult(_0x30297d,_0xf76038){_0xf76038=_0xf76038||0xc8;return function(_0x188698){if(_0x188698){return _0x30297d['status'](_0xf76038)[_0xcbbb('0x1e')](_0x188698);}};}function respondWithFilteredResult(_0x4ff973,_0x1fbfb1){return function(_0x3436af){if(_0x3436af){var _0x3572bb=typeof _0x1fbfb1['offset']==='undefined'&&typeof _0x1fbfb1['limit']===_0xcbbb('0x1f');var _0x3ae91b=_0x3436af[_0xcbbb('0x20')];var _0x25e92f=_0x3572bb?0x0:_0x1fbfb1[_0xcbbb('0x21')];var _0x1cca90=_0x3572bb?_0x3436af[_0xcbbb('0x20')]:_0x1fbfb1[_0xcbbb('0x21')]+_0x1fbfb1[_0xcbbb('0x22')];var _0x2d4335;if(_0x1cca90>=_0x3ae91b){_0x1cca90=_0x3ae91b;_0x2d4335=0xc8;}else{_0x2d4335=0xce;}_0x4ff973['status'](_0x2d4335);return _0x4ff973[_0xcbbb('0x23')](_0xcbbb('0x24'),_0x25e92f+'-'+_0x1cca90+'/'+_0x3ae91b)[_0xcbbb('0x1e')](_0x3436af);}return null;};}function patchUpdates(_0x42aaf1){return function(_0x258d1f){try{jsonpatch[_0xcbbb('0x25')](_0x258d1f,_0x42aaf1,!![]);}catch(_0x297eae){return BPromise[_0xcbbb('0x26')](_0x297eae);}return _0x258d1f[_0xcbbb('0x27')]();};}function saveUpdates(_0x5e3970,_0xf39ddd){return function(_0x4490c1){if(_0x4490c1){return _0x4490c1['update'](_0x5e3970)[_0xcbbb('0x28')](function(_0x4ffa80){return _0x4ffa80;});}return null;};}function removeEntity(_0x48dfc4,_0x575d56){return function(_0x32e070){if(_0x32e070){return _0x32e070['destroy']()['then'](function(){var _0x5499a1=_0x32e070[_0xcbbb('0x29')]({'plain':!![]});var _0x55e1d8='VoicePrefixes';return db[_0xcbbb('0x2a')][_0xcbbb('0x2b')]({'where':{'type':_0x55e1d8,'resourceId':_0x5499a1['id']}})[_0xcbbb('0x28')](function(){return _0x32e070;});})[_0xcbbb('0x28')](function(){_0x48dfc4[_0xcbbb('0x2c')](0xcc)[_0xcbbb('0x1d')]();});}};}function handleEntityNotFound(_0x3d4c0d,_0x1c986d){return function(_0x2a023f){if(!_0x2a023f){_0x3d4c0d[_0xcbbb('0x2d')](0x194);}return _0x2a023f;};}function handleError(_0x1c2ac9,_0xeb8cd8){_0xeb8cd8=_0xeb8cd8||0x1f4;return function(_0xfa973b){logger[_0xcbbb('0x2e')](_0xfa973b[_0xcbbb('0x2f')]);if(_0xfa973b[_0xcbbb('0x30')]){delete _0xfa973b[_0xcbbb('0x30')];}_0x1c2ac9[_0xcbbb('0x2c')](_0xeb8cd8)['send'](_0xfa973b);};}exports[_0xcbbb('0x31')]=function(_0x203a34,_0x5332f9){var _0xec2761={},_0x539dcf={},_0x2d37d3={'count':0x0,'rows':[]};var _0x1fb05e=_[_0xcbbb('0x32')](db['VoicePrefix'][_0xcbbb('0x33')],function(_0xa4743b){return{'name':_0xa4743b[_0xcbbb('0x34')],'type':_0xa4743b[_0xcbbb('0x35')][_0xcbbb('0x36')]};});_0x539dcf[_0xcbbb('0x37')]=_[_0xcbbb('0x32')](_0x1fb05e,_0xcbbb('0x30'));_0x539dcf[_0xcbbb('0x38')]=_[_0xcbbb('0x39')](_0x203a34['query']);_0x539dcf['filters']=_['intersection'](_0x539dcf['model'],_0x539dcf[_0xcbbb('0x38')]);_0xec2761[_0xcbbb('0x3a')]=_[_0xcbbb('0x3b')](_0x539dcf[_0xcbbb('0x37')],qs[_0xcbbb('0x3c')](_0x203a34[_0xcbbb('0x38')][_0xcbbb('0x3c')]));_0xec2761[_0xcbbb('0x3a')]=_0xec2761[_0xcbbb('0x3a')][_0xcbbb('0x3d')]?_0xec2761[_0xcbbb('0x3a')]:_0x539dcf[_0xcbbb('0x37')];if(!_0x203a34['query']['hasOwnProperty'](_0xcbbb('0x3e'))){_0xec2761['limit']=qs['limit'](_0x203a34['query'][_0xcbbb('0x22')]);_0xec2761[_0xcbbb('0x21')]=qs[_0xcbbb('0x21')](_0x203a34[_0xcbbb('0x38')][_0xcbbb('0x21')]);}_0xec2761[_0xcbbb('0x3f')]=qs[_0xcbbb('0x40')](_0x203a34[_0xcbbb('0x38')][_0xcbbb('0x40')]);_0xec2761[_0xcbbb('0x41')]=qs[_0xcbbb('0x42')](_['pick'](_0x203a34[_0xcbbb('0x38')],_0x539dcf['filters']),_0x1fb05e);if(_0x203a34[_0xcbbb('0x38')][_0xcbbb('0x43')]){_0xec2761[_0xcbbb('0x41')]=_[_0xcbbb('0x44')](_0xec2761[_0xcbbb('0x41')],{'$or':_[_0xcbbb('0x32')](_0x1fb05e,function(_0x5651fd){if(_0x5651fd['type']!=='VIRTUAL'){var _0xda1973={};_0xda1973[_0x5651fd[_0xcbbb('0x30')]]={'$like':'%'+_0x203a34[_0xcbbb('0x38')][_0xcbbb('0x43')]+'%'};return _0xda1973;}})});}_0xec2761=_[_0xcbbb('0x44')]({},_0xec2761,_0x203a34[_0xcbbb('0x45')]);var _0x2b45ee={'where':_0xec2761['where']};return db[_0xcbbb('0x46')][_0xcbbb('0x20')](_0x2b45ee)['then'](function(_0x15b3bc){_0x2d37d3[_0xcbbb('0x20')]=_0x15b3bc;if(_0x203a34[_0xcbbb('0x38')][_0xcbbb('0x47')]){_0xec2761[_0xcbbb('0x48')]=[{'all':!![]}];}return db['VoicePrefix'][_0xcbbb('0x49')](_0xec2761);})['then'](function(_0x520448){_0x2d37d3[_0xcbbb('0x4a')]=_0x520448;return _0x2d37d3;})[_0xcbbb('0x28')](respondWithFilteredResult(_0x5332f9,_0xec2761))[_0xcbbb('0x4b')](handleError(_0x5332f9,null));};exports[_0xcbbb('0x4c')]=function(_0xb5391d,_0x406e1c){var _0x2040bf={'raw':![],'where':{'id':_0xb5391d[_0xcbbb('0x4d')]['id']}},_0x3ba75e={};_0x3ba75e[_0xcbbb('0x37')]=_[_0xcbbb('0x39')](db[_0xcbbb('0x46')][_0xcbbb('0x33')]);_0x3ba75e[_0xcbbb('0x38')]=_['keys'](_0xb5391d[_0xcbbb('0x38')]);_0x3ba75e[_0xcbbb('0x42')]=_[_0xcbbb('0x3b')](_0x3ba75e[_0xcbbb('0x37')],_0x3ba75e['query']);_0x2040bf['attributes']=_['intersection'](_0x3ba75e[_0xcbbb('0x37')],qs[_0xcbbb('0x3c')](_0xb5391d[_0xcbbb('0x38')][_0xcbbb('0x3c')]));_0x2040bf[_0xcbbb('0x3a')]=_0x2040bf[_0xcbbb('0x3a')][_0xcbbb('0x3d')]?_0x2040bf['attributes']:_0x3ba75e[_0xcbbb('0x37')];if(_0xb5391d[_0xcbbb('0x38')][_0xcbbb('0x47')]){_0x2040bf[_0xcbbb('0x48')]=[{'all':!![]}];}_0x2040bf=_['merge']({},_0x2040bf,_0xb5391d[_0xcbbb('0x45')]);return db[_0xcbbb('0x46')][_0xcbbb('0x4e')](_0x2040bf)[_0xcbbb('0x28')](handleEntityNotFound(_0x406e1c,null))['then'](respondWithResult(_0x406e1c,null))['catch'](handleError(_0x406e1c,null));};exports[_0xcbbb('0x2b')]=function(_0x421137,_0x3dc052){return db['VoicePrefix']['find']({'where':{'id':_0x421137['params']['id']}})[_0xcbbb('0x28')](handleEntityNotFound(_0x3dc052,null))[_0xcbbb('0x28')](removeEntity(_0x3dc052,null))['catch'](handleError(_0x3dc052,null));};exports[_0xcbbb('0x4f')]=function(_0x35bb94,_0x2dc313){return db[_0xcbbb('0x46')]['describe']()[_0xcbbb('0x28')](respondWithResult(_0x2dc313,null))[_0xcbbb('0x4b')](handleError(_0x2dc313,null));};exports[_0xcbbb('0x50')]=function(_0x3526f5,_0xb267da){var _0x3679f4;return db[_0xcbbb('0x51')][_0xcbbb('0x52')](function(_0x2d3990){return db[_0xcbbb('0x46')][_0xcbbb('0x50')](_0x3526f5['body'],{'transaction':_0x2d3990})['then'](function(_0x3fb0bd){_0x3679f4=_0x3fb0bd[_0xcbbb('0x29')]({'plain':!![]});return db[_0xcbbb('0x53')]['find']({'where':{'id':_0x3679f4[_0xcbbb('0x54')]},'raw':!![]})['then'](function(_0x2a9958){return createVoicePrefixExtensions(_0x3679f4,_0x2a9958,_0x2d3990);});});})[_0xcbbb('0x28')](function(){var _0x317633=_0x3526f5[_0xcbbb('0x55')][_0xcbbb('0x29')]({'plain':!![]});if(!_0x317633)throw new Error(_0xcbbb('0x56'));if(_0x317633['role']==='user'){var _0x4cc098=_0x3679f4;return db[_0xcbbb('0x57')][_0xcbbb('0x4e')]({'where':{'name':_0xcbbb('0x58'),'userProfileId':_0x317633[_0xcbbb('0x59')]},'raw':!![]})[_0xcbbb('0x28')](function(_0x30bc24){if(_0x30bc24&&_0x30bc24[_0xcbbb('0x5a')]===0x0){return db[_0xcbbb('0x2a')][_0xcbbb('0x50')]({'name':_0x4cc098[_0xcbbb('0x30')],'resourceId':_0x4cc098['id'],'type':_0x30bc24[_0xcbbb('0x30')],'sectionId':_0x30bc24['id']},{})[_0xcbbb('0x28')](function(){return _0x3679f4;});}else{return _0x3679f4;}})[_0xcbbb('0x4b')](function(_0x48d295){logger[_0xcbbb('0x2e')](_0xcbbb('0x5b'),_0x48d295);throw _0x48d295;});}return _0x3679f4;})[_0xcbbb('0x28')](respondWithResult(_0xb267da,null))['catch'](handleError(_0xb267da,null));};function Extension(_0x17d714,_0x1dbf9b,_0x5501d5,_0x26f0e6){this['context']=_0xcbbb('0x5c');this[_0xcbbb('0x5d')]=_0x17d714;this['app']=_0x5501d5;this[_0xcbbb('0x35')]=_0xcbbb('0x5e');this['description']='Voice\x20Prefix\x20Extension';this[_0xcbbb('0x5f')]=_0x1dbf9b;this['appdata']=_0x26f0e6;}function createVoicePrefixExtensions(_0x411bc6,_0x4c56fe,_0xb68922){return new BPromise(function(_0x3849d8,_0x20aaa9){var _0x4b4bb7=new Extension(formatPrefixName(_0x411bc6['prefix']),0x1,_0xcbbb('0x60'),_0xcbbb('0x61'));_0x4b4bb7['VoicePrefixId']=_0x411bc6['id'];return db[_0xcbbb('0x53')][_0xcbbb('0x50')](_0x4b4bb7,{'transaction':_0xb68922})[_0xcbbb('0x28')](function(_0x556e48){var _0xe347c6=_0x556e48[_0xcbbb('0x29')]({'plain':!![]});var _0x12ef00=_[_0xcbbb('0x32')](addVoicePrefixExtensions(_0x411bc6,_0x4c56fe),function(_0xf13e52){_0xf13e52[_0xcbbb('0x54')]=_0xe347c6['id'];_0xf13e52[_0xcbbb('0x62')]=_0x411bc6['id'];return _0xf13e52;});return db['VoiceExtension']['bulkCreate'](_0x12ef00,{'transaction':_0xb68922})[_0xcbbb('0x28')](function(_0x2469e5){if(!_0x2469e5){return _0x20aaa9(_0xcbbb('0x63'));}else{return _0x3849d8(_0x2469e5);}})[_0xcbbb('0x4b')](function(_0x4bc7cc){return _0x20aaa9(_0x4bc7cc);});});;});};function addVoicePrefixExtensions(_0x5c6bf7,_0x3781df){var _0x4f6529=[];var _0x5ea915=formatPrefixName(_0x5c6bf7[_0xcbbb('0x64')]);_0x4f6529[_0xcbbb('0x65')](new Extension(_0x5ea915,0x2,_0xcbbb('0x66'),_0xcbbb('0x67')+_0x5c6bf7[_0xcbbb('0x30')]));if(_0x5c6bf7[_0xcbbb('0x68')]){_0x4f6529[_0xcbbb('0x65')](new Extension(_0x5ea915,0x3,'Set',_0xcbbb('0x69')+_0x5c6bf7['callerIdAll']));}else{_0x4f6529[_0xcbbb('0x65')](new Extension(_0x5ea915,0x3,'NoOp',_0xcbbb('0x6a')));}_0x4f6529[_0xcbbb('0x65')](new Extension(_0x5ea915,0x4,_0xcbbb('0x6b'),_0x3781df[_0xcbbb('0x6c')]+','+_0xcbbb('0x6d')+(0x8+_0x5c6bf7[_0xcbbb('0x30')][_0xcbbb('0x3d')])+'}'+','+0x1));return _0x4f6529;}function formatPrefixName(_0x619340){var _0x4ff7db='_';for(var _0x57d776=0x0;_0x57d776<_0x619340[_0xcbbb('0x3d')];_0x57d776++){if(_0x619340[_0xcbbb('0x6e')](_0x57d776)=='-'){_0x4ff7db+=_0x619340[_0xcbbb('0x6e')](_0x57d776);}else{_0x4ff7db+='['+_0x619340[_0xcbbb('0x6e')](_0x57d776)+']';}}_0x4ff7db+='.';return _0x4ff7db;}exports['update']=function(_0x583c33,_0x590fc6,_0x6060d){var _0x2f0db8=_0x583c33['body'];_0x2f0db8[_0xcbbb('0x64')]=_0xcbbb('0x6f')+_0x2f0db8['name']+'-';return db[_0xcbbb('0x51')][_0xcbbb('0x52')](function(_0x4e2198){return db[_0xcbbb('0x46')][_0xcbbb('0x70')](_0x2f0db8,{'where':{'id':_0x2f0db8['id']},'transaction':_0x4e2198})[_0xcbbb('0x28')](function(){return db['VoiceExtension']['destroy']({'where':{'VoicePrefixId':_0x2f0db8['id']},'transaction':_0x4e2198})[_0xcbbb('0x28')](function(){return db[_0xcbbb('0x53')][_0xcbbb('0x4e')]({'where':{'id':_0x2f0db8['VoiceExtensionId']},'raw':!![]})['then'](function(_0x128d79){return createVoicePrefixExtensions(_0x2f0db8,_0x128d79,_0x4e2198);});});});})[_0xcbbb('0x28')](function(){return db[_0xcbbb('0x46')][_0xcbbb('0x71')](_0x2f0db8['id']);})[_0xcbbb('0x28')](respondWithResult(_0x590fc6,null))[_0xcbbb('0x4b')](handleError(_0x590fc6,null));};exports[_0xcbbb('0x72')]=function(_0x194b4b,_0x3e401d,_0x305344){return db[_0xcbbb('0x46')]['find']({'where':{'id':_0x194b4b[_0xcbbb('0x4d')]['id']}})[_0xcbbb('0x28')](handleEntityNotFound(_0x3e401d,null))[_0xcbbb('0x28')](function(_0x3ad059){if(_0x3ad059){return _0x3ad059[_0xcbbb('0x72')](_0x194b4b['body'][_0xcbbb('0x73')],_[_0xcbbb('0x74')](_0x194b4b[_0xcbbb('0x75')],[_0xcbbb('0x73'),'id'])||{})['spread'](function(_0x264c34){for(var _0x22de60=0x0;_0x22de60<_0x194b4b[_0xcbbb('0x75')]['ids']['length'];_0x22de60+=0x1){socket[_0xcbbb('0x76')](_0xcbbb('0x77'),{'UserId':Number(_0x194b4b[_0xcbbb('0x75')][_0xcbbb('0x73')][_0x22de60]),'VoicePrefixId':Number(_0x194b4b['params']['id'])});}return _0x264c34;});}})[_0xcbbb('0x28')](respondWithResult(_0x3e401d,null))[_0xcbbb('0x4b')](handleError(_0x3e401d,null));};exports[_0xcbbb('0x78')]=function(_0x349674,_0x42a9d3,_0x5706e6){return db['VoicePrefix'][_0xcbbb('0x4e')]({'where':{'id':_0x349674[_0xcbbb('0x4d')]['id']}})[_0xcbbb('0x28')](handleEntityNotFound(_0x42a9d3,null))[_0xcbbb('0x28')](function(_0x14eaec){if(_0x14eaec){return _0x14eaec[_0xcbbb('0x78')](_0x349674['query'][_0xcbbb('0x73')])[_0xcbbb('0x28')](function(){if(_[_0xcbbb('0x79')](_0x349674[_0xcbbb('0x38')][_0xcbbb('0x73')])){for(var _0x2b1277=0x0;_0x2b1277<_0x349674[_0xcbbb('0x38')]['ids']['length'];_0x2b1277+=0x1){socket[_0xcbbb('0x76')]('userVoicePrefix:remove',{'UserId':Number(_0x349674['query'][_0xcbbb('0x73')][_0x2b1277]),'VoicePrefixId':Number(_0x349674['params']['id'])});}}else{socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x349674[_0xcbbb('0x38')]['ids']),'VoicePrefixId':Number(_0x349674[_0xcbbb('0x4d')]['id'])});}});}})['then'](respondWithStatusCode(_0x42a9d3,null))['catch'](handleError(_0x42a9d3,null));};exports['getAgents']=function(_0x4de2dd,_0x1c9dd2,_0x14c60b){var _0x56b09b={};var _0x4bb903={};var _0x130f91;var _0x1bffe9;return db['VoicePrefix'][_0xcbbb('0x7a')]({'where':{'id':_0x4de2dd[_0xcbbb('0x4d')]['id']}})[_0xcbbb('0x28')](handleEntityNotFound(_0x1c9dd2,null))[_0xcbbb('0x28')](function(_0x24b949){if(_0x24b949){_0x130f91=_0x24b949;_0x4bb903[_0xcbbb('0x37')]=_[_0xcbbb('0x39')](db['User'][_0xcbbb('0x33')]);_0x4bb903[_0xcbbb('0x38')]=_['keys'](_0x4de2dd[_0xcbbb('0x38')]);_0x4bb903[_0xcbbb('0x42')]=_[_0xcbbb('0x3b')](_0x4bb903[_0xcbbb('0x37')],_0x4bb903[_0xcbbb('0x38')]);_0x56b09b[_0xcbbb('0x3a')]=_['intersection'](_0x4bb903['model'],qs[_0xcbbb('0x3c')](_0x4de2dd[_0xcbbb('0x38')][_0xcbbb('0x3c')]));_0x56b09b[_0xcbbb('0x3a')]=_0x56b09b[_0xcbbb('0x3a')]['length']?_0x56b09b[_0xcbbb('0x3a')]:_0x4bb903[_0xcbbb('0x37')];_0x56b09b[_0xcbbb('0x3f')]=qs[_0xcbbb('0x40')](_0x4de2dd[_0xcbbb('0x38')][_0xcbbb('0x40')]);_0x56b09b[_0xcbbb('0x41')]=qs[_0xcbbb('0x42')](_[_0xcbbb('0x7b')](_0x4de2dd[_0xcbbb('0x38')],_0x4bb903[_0xcbbb('0x42')]));if(_0x4de2dd['query']['filter']){_0x56b09b[_0xcbbb('0x41')]=_[_0xcbbb('0x44')](_0x56b09b[_0xcbbb('0x41')],{'$or':_[_0xcbbb('0x32')](_0x56b09b[_0xcbbb('0x3a')],function(_0x4a964b){var _0x1d7b6b={};_0x1d7b6b[_0x4a964b]={'$like':'%'+_0x4de2dd[_0xcbbb('0x38')]['filter']+'%'};return _0x1d7b6b;})});}_0x56b09b=_['merge']({},_0x56b09b,_0x4de2dd[_0xcbbb('0x45')]);return _0x130f91['getAgents'](_0x56b09b);}})[_0xcbbb('0x28')](function(_0x1a5dd3){if(_0x1a5dd3){_0x1bffe9=_0x1a5dd3[_0xcbbb('0x3d')];if(!_0x4de2dd[_0xcbbb('0x38')]['hasOwnProperty']('nolimit')){_0x56b09b[_0xcbbb('0x22')]=qs[_0xcbbb('0x22')](_0x4de2dd['query'][_0xcbbb('0x22')]);_0x56b09b[_0xcbbb('0x21')]=qs[_0xcbbb('0x21')](_0x4de2dd[_0xcbbb('0x38')][_0xcbbb('0x21')]);}return _0x130f91[_0xcbbb('0x7c')](_0x56b09b);}})[_0xcbbb('0x28')](function(_0x49f482){if(_0x49f482){return _0x49f482?{'count':_0x1bffe9,'rows':_0x49f482}:null;}})[_0xcbbb('0x28')](respondWithResult(_0x1c9dd2,null))[_0xcbbb('0x4b')](handleError(_0x1c9dd2,null));};exports['getTeams']=function(_0x10667e,_0x549d6c,_0x7a604f){var _0x10f932={};var _0x736484={};var _0x369b6f;var _0x4dc485;return db[_0xcbbb('0x46')][_0xcbbb('0x7a')]({'where':{'id':_0x10667e[_0xcbbb('0x4d')]['id']}})[_0xcbbb('0x28')](handleEntityNotFound(_0x549d6c,null))[_0xcbbb('0x28')](function(_0x4a5a59){if(_0x4a5a59){_0x369b6f=_0x4a5a59;_0x736484['model']=_[_0xcbbb('0x39')](db[_0xcbbb('0x7d')][_0xcbbb('0x33')]);_0x736484[_0xcbbb('0x38')]=_[_0xcbbb('0x39')](_0x10667e['query']);_0x736484['filters']=_[_0xcbbb('0x3b')](_0x736484[_0xcbbb('0x37')],_0x736484[_0xcbbb('0x38')]);_0x10f932[_0xcbbb('0x3a')]=_[_0xcbbb('0x3b')](_0x736484['model'],qs[_0xcbbb('0x3c')](_0x10667e[_0xcbbb('0x38')][_0xcbbb('0x3c')]));_0x10f932['attributes']=_0x10f932[_0xcbbb('0x3a')][_0xcbbb('0x3d')]?_0x10f932[_0xcbbb('0x3a')]:_0x736484[_0xcbbb('0x37')];_0x10f932[_0xcbbb('0x3f')]=qs[_0xcbbb('0x40')](_0x10667e[_0xcbbb('0x38')][_0xcbbb('0x40')]);_0x10f932['where']=qs[_0xcbbb('0x42')](_['pick'](_0x10667e['query'],_0x736484['filters']));if(_0x10667e[_0xcbbb('0x38')]['filter']){_0x10f932[_0xcbbb('0x41')]=_[_0xcbbb('0x44')](_0x10f932['where'],{'$or':_[_0xcbbb('0x32')](_0x10f932[_0xcbbb('0x3a')],function(_0x4bf0b3){var _0x4314d3={};_0x4314d3[_0x4bf0b3]={'$like':'%'+_0x10667e[_0xcbbb('0x38')][_0xcbbb('0x43')]+'%'};return _0x4314d3;})});}_0x10f932=_['merge']({},_0x10f932,_0x10667e[_0xcbbb('0x45')]);return _0x369b6f[_0xcbbb('0x7e')](_0x10f932);}})[_0xcbbb('0x28')](function(_0x2da472){if(_0x2da472){_0x4dc485=_0x2da472[_0xcbbb('0x3d')];if(!_0x10667e[_0xcbbb('0x38')][_0xcbbb('0x7f')](_0xcbbb('0x3e'))){_0x10f932[_0xcbbb('0x22')]=qs['limit'](_0x10667e[_0xcbbb('0x38')][_0xcbbb('0x22')]);_0x10f932[_0xcbbb('0x21')]=qs['offset'](_0x10667e['query'][_0xcbbb('0x21')]);}return _0x369b6f['getTeams'](_0x10f932);}})[_0xcbbb('0x28')](function(_0x198899){if(_0x198899){return _0x198899?{'count':_0x4dc485,'rows':_0x198899}:null;}})['then'](respondWithResult(_0x549d6c,null))[_0xcbbb('0x4b')](handleError(_0x549d6c,null));};exports[_0xcbbb('0x80')]=function(_0x59d833,_0x39951f,_0x283bc8){var _0x2754d1=_0x59d833[_0xcbbb('0x75')][_0xcbbb('0x73')];var _0x458b66;return db['Team'][_0xcbbb('0x49')]({'where':{'id':_0x2754d1},'attributes':['id'],'include':[{'model':db['User'],'as':_0xcbbb('0x81'),'attributes':['id',_0xcbbb('0x30'),_0xcbbb('0x82'),'voicePause',_0xcbbb('0x83')],'raw':!![]}]})['then'](function(_0x32993d){if(_0x32993d){_0x458b66=_0x32993d;var _0x962f3f=_[_0xcbbb('0x84')](_0x32993d,function(_0x55ca6b){var _0x287b25=_0x55ca6b['get']({'plain':!![]});return _0x287b25[_0xcbbb('0x81')];});return db[_0xcbbb('0x46')][_0xcbbb('0x4e')]({'where':{'id':_0x59d833[_0xcbbb('0x4d')]['id']}})['then'](function(_0x16991b){return db['sequelize'][_0xcbbb('0x52')](function(_0xd01dff){return _0x16991b[_0xcbbb('0x80')](_0x2754d1,{'transaction':_0xd01dff})[_0xcbbb('0x28')](function(){return BPromise[_0xcbbb('0x85')](_0x458b66,function(_0x3ab011){return db[_0xcbbb('0x86')]['upsert']({'TeamId':_0x3ab011['id'],'VoicePrefixId':_0x59d833[_0xcbbb('0x4d')]['id']},{'transaction':_0xd01dff});});})[_0xcbbb('0x28')](function(){return BPromise[_0xcbbb('0x85')](_0x962f3f,function(_0x354314){return db['UserVoicePrefix'][_0xcbbb('0x87')]({'where':{'UserId':_0x354314['id'],'VoicePrefixId':_0x59d833[_0xcbbb('0x4d')]['id']},'transaction':_0xd01dff});});})[_0xcbbb('0x28')](function(){_0x962f3f[_0xcbbb('0x88')](function(_0x3fc8da){socket[_0xcbbb('0x76')]('userVoicePrefix:save',{'UserId':_0x3fc8da['id'],'VoicePrefixId':_0x16991b['id']});});});});});}})[_0xcbbb('0x28')](respondWithStatusCode(_0x39951f,null))[_0xcbbb('0x4b')](handleError(_0x39951f,null));};exports[_0xcbbb('0x89')]=function(_0x23bda8,_0x233c44,_0x26545e){return db[_0xcbbb('0x7d')][_0xcbbb('0x49')]({'where':{'id':_0x23bda8['query'][_0xcbbb('0x73')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xcbbb('0x81'),'attributes':['id'],'raw':!![]}]})[_0xcbbb('0x28')](handleEntityNotFound(_0x233c44,null))[_0xcbbb('0x28')](function(_0x510bc9){var _0x1ce1c4=_[_0xcbbb('0x32')](_0x510bc9,'id');var _0x7fc4ea=[];var _0xde4f2b=[];var _0xabe61=squel['select']();_0xabe61[_0xcbbb('0x8a')]('tq.TeamId')[_0xcbbb('0x8b')]('team_has_voice_prefixes','tq')[_0xcbbb('0x8c')](_0xcbbb('0x8d'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xcbbb('0x41')](_0xcbbb('0x8e'),_0x23bda8[_0xcbbb('0x4d')]['id']);for(var _0x3a3e73=0x0;_0x3a3e73<_0x510bc9[_0xcbbb('0x3d')];_0x3a3e73+=0x1){let _0x517af0=_0x510bc9[_0x3a3e73];for(var _0x4312c3=0x0;_0x4312c3<_0x517af0[_0xcbbb('0x81')][_0xcbbb('0x3d')];_0x4312c3+=0x1){let _0x1b34ac=_0x517af0[_0xcbbb('0x81')][_0x4312c3];var _0x402d10=_0xabe61[_0xcbbb('0x8f')]();_0x402d10[_0xcbbb('0x41')]('ut.UserId\x20=\x20?',_0x1b34ac['id']);_0xde4f2b['push'](db[_0xcbbb('0x51')]['query'](_0x402d10[_0xcbbb('0x90')](),{'type':db[_0xcbbb('0x51')][_0xcbbb('0x91')][_0xcbbb('0x92')]})[_0xcbbb('0x28')](function(_0x2129d8){if(_0x2129d8[_0xcbbb('0x3d')]===0x1){return _0x1b34ac['id'];}else{var _0x274e33=_[_0xcbbb('0x93')](_[_0xcbbb('0x32')](_0x2129d8,_0xcbbb('0x94')),function(_0x1c8981){return _[_0xcbbb('0x95')](_0x1ce1c4,_0x1c8981);});if(_0x274e33){return _0x1b34ac['id'];}}}));}}return BPromise[_0xcbbb('0x96')](_0xde4f2b)[_0xcbbb('0x28')](function(_0x4bcb5d){_0x7fc4ea=_(_0x7fc4ea)[_0xcbbb('0x97')](_0x4bcb5d)[_0xcbbb('0x98')]()[_0xcbbb('0x99')]();return db[_0xcbbb('0x46')]['find']({'where':{'id':_0x23bda8[_0xcbbb('0x4d')]['id']}})[_0xcbbb('0x28')](function(_0x40fc06){return db[_0xcbbb('0x51')][_0xcbbb('0x52')](function(_0x357810){return _0x40fc06['removeTeams'](_0x23bda8[_0xcbbb('0x38')][_0xcbbb('0x73')],{'transaction':_0x357810})['then'](function(){if(!_[_0xcbbb('0x9a')](_0x7fc4ea)){return _0x40fc06[_0xcbbb('0x78')](_0x7fc4ea,{'transaction':_0x357810});}})[_0xcbbb('0x28')](function(){_0x7fc4ea[_0xcbbb('0x88')](function(_0x49e6e1){socket['emit'](_0xcbbb('0x9b'),{'UserId':_0x49e6e1,'VoicePrefixId':_0x40fc06['id']});});});});});});})[_0xcbbb('0x28')](respondWithStatusCode(_0x233c44,null))[_0xcbbb('0x4b')](handleError(_0x233c44,null));}; \ No newline at end of file +var _0x9582=['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','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','VoicePrefixes','UserProfileResource','end','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','VoicePrefix','include','rows','catch','show','params','keys','includeAll','find','describe','sequelize','create','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','context','from-sip','exten','app','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','goto','${EXTEN:','charAt','transaction','findById','addAgents','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','hasOwnProperty','getTeams','Team','addTeams','findAll','Agents','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','removeTeams','select','field','join','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','TeamId','includes','isEmpty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util'];(function(_0x4d8056,_0x3c25f9){var _0x2f22a3=function(_0x578000){while(--_0x578000){_0x4d8056['push'](_0x4d8056['shift']());}};_0x2f22a3(++_0x3c25f9);}(_0x9582,0x95));var _0x2958=function(_0x20f4de,_0x5eb739){_0x20f4de=_0x20f4de-0x0;var _0x36c1d5=_0x9582[_0x20f4de];return _0x36c1d5;};'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'];config[_0x2958('0x19')]=_[_0x2958('0x1a')](config[_0x2958('0x19')],{'host':_0x2958('0x1b'),'port':0x18eb});var socket=require(_0x2958('0x1c'))(new Redis(config[_0x2958('0x19')]));require('./voicePrefix.socket')[_0x2958('0x1d')](socket);function respondWithStatusCode(_0x2e12d4,_0x4f2a1b){_0x4f2a1b=_0x4f2a1b||0xcc;return function(_0x4c762e){if(_0x4c762e){return _0x2e12d4[_0x2958('0x1e')](_0x4f2a1b);}return _0x2e12d4[_0x2958('0x1f')](_0x4f2a1b)['end']();};}function respondWithResult(_0x3bef50,_0x544563){_0x544563=_0x544563||0xc8;return function(_0x5c3ac3){if(_0x5c3ac3){return _0x3bef50[_0x2958('0x1f')](_0x544563)[_0x2958('0x20')](_0x5c3ac3);}};}function respondWithFilteredResult(_0x55e261,_0x54ef76){return function(_0x28a92c){if(_0x28a92c){var _0x160949=typeof _0x54ef76[_0x2958('0x21')]===_0x2958('0x22')&&typeof _0x54ef76[_0x2958('0x23')]==='undefined';var _0x19a614=_0x28a92c[_0x2958('0x24')];var _0x1a12fa=_0x160949?0x0:_0x54ef76['offset'];var _0x1e77eb=_0x160949?_0x28a92c['count']:_0x54ef76[_0x2958('0x21')]+_0x54ef76['limit'];var _0x5eaf36;if(_0x1e77eb>=_0x19a614){_0x1e77eb=_0x19a614;_0x5eaf36=0xc8;}else{_0x5eaf36=0xce;}_0x55e261[_0x2958('0x1f')](_0x5eaf36);return _0x55e261[_0x2958('0x25')](_0x2958('0x26'),_0x1a12fa+'-'+_0x1e77eb+'/'+_0x19a614)[_0x2958('0x20')](_0x28a92c);}return null;};}function patchUpdates(_0x2202f8){return function(_0x412e42){try{jsonpatch[_0x2958('0x27')](_0x412e42,_0x2202f8,!![]);}catch(_0x2b9818){return BPromise[_0x2958('0x28')](_0x2b9818);}return _0x412e42[_0x2958('0x29')]();};}function saveUpdates(_0xaf5547,_0xd58ae1){return function(_0x119242){if(_0x119242){return _0x119242[_0x2958('0x2a')](_0xaf5547)[_0x2958('0x2b')](function(_0x4f811a){return _0x4f811a;});}return null;};}function removeEntity(_0x574df5,_0x3c1155){return function(_0x33c5b0){if(_0x33c5b0){return _0x33c5b0[_0x2958('0x2c')]()[_0x2958('0x2b')](function(){var _0x52bd32=_0x33c5b0[_0x2958('0x2d')]({'plain':!![]});var _0x57ae96=_0x2958('0x2e');return db[_0x2958('0x2f')][_0x2958('0x2c')]({'where':{'type':_0x57ae96,'resourceId':_0x52bd32['id']}})[_0x2958('0x2b')](function(){return _0x33c5b0;});})[_0x2958('0x2b')](function(){_0x574df5[_0x2958('0x1f')](0xcc)[_0x2958('0x30')]();});}};}function handleEntityNotFound(_0x5d1dfc,_0x21b919){return function(_0x5053d0){if(!_0x5053d0){_0x5d1dfc['sendStatus'](0x194);}return _0x5053d0;};}function handleError(_0x28ee09,_0x15bab3){_0x15bab3=_0x15bab3||0x1f4;return function(_0x973486){logger[_0x2958('0x31')](_0x973486[_0x2958('0x32')]);if(_0x973486[_0x2958('0x33')]){delete _0x973486[_0x2958('0x33')];}_0x28ee09[_0x2958('0x1f')](_0x15bab3)['send'](_0x973486);};}exports[_0x2958('0x34')]=function(_0x32e366,_0x5f34d4){var _0x430484={},_0x5ed343={},_0x380e1d={'count':0x0,'rows':[]};var _0x56d9fd=_[_0x2958('0x35')](db['VoicePrefix'][_0x2958('0x36')],function(_0x2e2a0b){return{'name':_0x2e2a0b[_0x2958('0x37')],'type':_0x2e2a0b[_0x2958('0x38')][_0x2958('0x39')]};});_0x5ed343[_0x2958('0x3a')]=_[_0x2958('0x35')](_0x56d9fd,_0x2958('0x33'));_0x5ed343[_0x2958('0x3b')]=_['keys'](_0x32e366[_0x2958('0x3b')]);_0x5ed343['filters']=_[_0x2958('0x3c')](_0x5ed343['model'],_0x5ed343[_0x2958('0x3b')]);_0x430484[_0x2958('0x3d')]=_[_0x2958('0x3c')](_0x5ed343[_0x2958('0x3a')],qs[_0x2958('0x3e')](_0x32e366[_0x2958('0x3b')][_0x2958('0x3e')]));_0x430484[_0x2958('0x3d')]=_0x430484[_0x2958('0x3d')][_0x2958('0x3f')]?_0x430484[_0x2958('0x3d')]:_0x5ed343[_0x2958('0x3a')];if(!_0x32e366[_0x2958('0x3b')]['hasOwnProperty'](_0x2958('0x40'))){_0x430484[_0x2958('0x23')]=qs[_0x2958('0x23')](_0x32e366[_0x2958('0x3b')]['limit']);_0x430484[_0x2958('0x21')]=qs[_0x2958('0x21')](_0x32e366[_0x2958('0x3b')][_0x2958('0x21')]);}_0x430484[_0x2958('0x41')]=qs[_0x2958('0x42')](_0x32e366[_0x2958('0x3b')][_0x2958('0x42')]);_0x430484[_0x2958('0x43')]=qs[_0x2958('0x44')](_[_0x2958('0x45')](_0x32e366[_0x2958('0x3b')],_0x5ed343[_0x2958('0x44')]),_0x56d9fd);if(_0x32e366['query'][_0x2958('0x46')]){_0x430484[_0x2958('0x43')]=_['merge'](_0x430484['where'],{'$or':_[_0x2958('0x35')](_0x56d9fd,function(_0x265055){if(_0x265055[_0x2958('0x38')]!==_0x2958('0x47')){var _0x3ec87a={};_0x3ec87a[_0x265055[_0x2958('0x33')]]={'$like':'%'+_0x32e366[_0x2958('0x3b')][_0x2958('0x46')]+'%'};return _0x3ec87a;}})});}_0x430484=_[_0x2958('0x48')]({},_0x430484,_0x32e366[_0x2958('0x49')]);var _0x16aae8={'where':_0x430484[_0x2958('0x43')]};return db[_0x2958('0x4a')]['count'](_0x16aae8)[_0x2958('0x2b')](function(_0x112256){_0x380e1d[_0x2958('0x24')]=_0x112256;if(_0x32e366[_0x2958('0x3b')]['includeAll']){_0x430484[_0x2958('0x4b')]=[{'all':!![]}];}return db['VoicePrefix']['findAll'](_0x430484);})[_0x2958('0x2b')](function(_0x35993f){_0x380e1d[_0x2958('0x4c')]=_0x35993f;return _0x380e1d;})[_0x2958('0x2b')](respondWithFilteredResult(_0x5f34d4,_0x430484))[_0x2958('0x4d')](handleError(_0x5f34d4,null));};exports[_0x2958('0x4e')]=function(_0x52d40e,_0x17e8d6){var _0x4fb27a={'raw':![],'where':{'id':_0x52d40e[_0x2958('0x4f')]['id']}},_0x488f49={};_0x488f49['model']=_[_0x2958('0x50')](db[_0x2958('0x4a')][_0x2958('0x36')]);_0x488f49[_0x2958('0x3b')]=_[_0x2958('0x50')](_0x52d40e[_0x2958('0x3b')]);_0x488f49[_0x2958('0x44')]=_[_0x2958('0x3c')](_0x488f49['model'],_0x488f49[_0x2958('0x3b')]);_0x4fb27a[_0x2958('0x3d')]=_[_0x2958('0x3c')](_0x488f49[_0x2958('0x3a')],qs['fields'](_0x52d40e[_0x2958('0x3b')][_0x2958('0x3e')]));_0x4fb27a['attributes']=_0x4fb27a[_0x2958('0x3d')][_0x2958('0x3f')]?_0x4fb27a[_0x2958('0x3d')]:_0x488f49[_0x2958('0x3a')];if(_0x52d40e[_0x2958('0x3b')][_0x2958('0x51')]){_0x4fb27a['include']=[{'all':!![]}];}_0x4fb27a=_[_0x2958('0x48')]({},_0x4fb27a,_0x52d40e[_0x2958('0x49')]);return db[_0x2958('0x4a')][_0x2958('0x52')](_0x4fb27a)[_0x2958('0x2b')](handleEntityNotFound(_0x17e8d6,null))[_0x2958('0x2b')](respondWithResult(_0x17e8d6,null))[_0x2958('0x4d')](handleError(_0x17e8d6,null));};exports[_0x2958('0x2c')]=function(_0x2e0fc7,_0x329652){return db[_0x2958('0x4a')][_0x2958('0x52')]({'where':{'id':_0x2e0fc7[_0x2958('0x4f')]['id']}})[_0x2958('0x2b')](handleEntityNotFound(_0x329652,null))[_0x2958('0x2b')](removeEntity(_0x329652,null))[_0x2958('0x4d')](handleError(_0x329652,null));};exports[_0x2958('0x53')]=function(_0x4889b6,_0xa1073b){return db['VoicePrefix'][_0x2958('0x53')]()[_0x2958('0x2b')](respondWithResult(_0xa1073b,null))[_0x2958('0x4d')](handleError(_0xa1073b,null));};exports['create']=function(_0x497a30,_0x39cc25){var _0x394c29;return db[_0x2958('0x54')]['transaction'](function(_0x524562){return db[_0x2958('0x4a')][_0x2958('0x55')](_0x497a30[_0x2958('0x56')],{'transaction':_0x524562})[_0x2958('0x2b')](function(_0x4347c0){_0x394c29=_0x4347c0[_0x2958('0x2d')]({'plain':!![]});return db[_0x2958('0x57')][_0x2958('0x52')]({'where':{'id':_0x394c29[_0x2958('0x58')]},'raw':!![]})['then'](function(_0x30c739){return createVoicePrefixExtensions(_0x394c29,_0x30c739,_0x524562);});});})[_0x2958('0x2b')](function(){var _0x5671d1=_0x497a30[_0x2958('0x59')][_0x2958('0x2d')]({'plain':!![]});if(!_0x5671d1)throw new Error(_0x2958('0x5a'));if(_0x5671d1[_0x2958('0x5b')]===_0x2958('0x59')){var _0x16d927=_0x394c29;return db['UserProfileSection'][_0x2958('0x52')]({'where':{'name':_0x2958('0x2e'),'userProfileId':_0x5671d1[_0x2958('0x5c')]},'raw':!![]})['then'](function(_0x595738){if(_0x595738&&_0x595738[_0x2958('0x5d')]===0x0){return db['UserProfileResource'][_0x2958('0x55')]({'name':_0x16d927['name'],'resourceId':_0x16d927['id'],'type':_0x595738[_0x2958('0x33')],'sectionId':_0x595738['id']},{})[_0x2958('0x2b')](function(){return _0x394c29;});}else{return _0x394c29;}})[_0x2958('0x4d')](function(_0x474f6b){logger[_0x2958('0x31')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x474f6b);throw _0x474f6b;});}return _0x394c29;})['then'](respondWithResult(_0x39cc25,null))[_0x2958('0x4d')](handleError(_0x39cc25,null));};function Extension(_0x3e11eb,_0xfa171d,_0x51bf4c,_0x55676f){this[_0x2958('0x5e')]=_0x2958('0x5f');this[_0x2958('0x60')]=_0x3e11eb;this[_0x2958('0x61')]=_0x51bf4c;this[_0x2958('0x38')]=_0x2958('0x62');this[_0x2958('0x63')]=_0x2958('0x64');this[_0x2958('0x65')]=_0xfa171d;this[_0x2958('0x66')]=_0x55676f;}function createVoicePrefixExtensions(_0x2de03a,_0x2bef16,_0x3cc345){return new BPromise(function(_0x49d190,_0x3a4ad9){var _0x8c7203=new Extension(formatPrefixName(_0x2de03a[_0x2958('0x67')]),0x1,_0x2958('0x68'),_0x2958('0x69'));_0x8c7203[_0x2958('0x6a')]=_0x2de03a['id'];return db[_0x2958('0x57')][_0x2958('0x55')](_0x8c7203,{'transaction':_0x3cc345})[_0x2958('0x2b')](function(_0x4dd3de){var _0x2269e1=_0x4dd3de['get']({'plain':!![]});var _0x196901=_[_0x2958('0x35')](addVoicePrefixExtensions(_0x2de03a,_0x2bef16),function(_0x31a596){_0x31a596['VoiceExtensionId']=_0x2269e1['id'];_0x31a596['VoicePrefixId']=_0x2de03a['id'];return _0x31a596;});return db['VoiceExtension'][_0x2958('0x6b')](_0x196901,{'transaction':_0x3cc345})[_0x2958('0x2b')](function(_0x4c1516){if(!_0x4c1516){return _0x3a4ad9(_0x2958('0x6c'));}else{return _0x49d190(_0x4c1516);}})[_0x2958('0x4d')](function(_0xb2fe28){return _0x3a4ad9(_0xb2fe28);});});;});};function addVoicePrefixExtensions(_0x32a216,_0x13f850){var _0x538298=[];var _0x55da00=formatPrefixName(_0x32a216[_0x2958('0x67')]);_0x538298[_0x2958('0x6d')](new Extension(_0x55da00,0x2,_0x2958('0x6e'),_0x2958('0x6f')+_0x32a216['name']));if(_0x32a216[_0x2958('0x70')]){_0x538298[_0x2958('0x6d')](new Extension(_0x55da00,0x3,_0x2958('0x6e'),_0x2958('0x71')+_0x32a216['callerIdAll']));}else{_0x538298['push'](new Extension(_0x55da00,0x3,'NoOp','No\x20callerid\x20available'));}_0x538298[_0x2958('0x6d')](new Extension(_0x55da00,0x4,_0x2958('0x72'),_0x13f850['context']+','+_0x2958('0x73')+(0x8+_0x32a216[_0x2958('0x33')][_0x2958('0x3f')])+'}'+','+0x1));return _0x538298;}function formatPrefixName(_0x234d7f){var _0x1eefb5='_';for(var _0x41ab26=0x0;_0x41ab26<_0x234d7f['length'];_0x41ab26++){if(_0x234d7f[_0x2958('0x74')](_0x41ab26)=='-'){_0x1eefb5+=_0x234d7f[_0x2958('0x74')](_0x41ab26);}else{_0x1eefb5+='['+_0x234d7f[_0x2958('0x74')](_0x41ab26)+']';}}_0x1eefb5+='.';return _0x1eefb5;}exports['update']=function(_0xd61e21,_0x566123,_0x546721){var _0x584429=_0xd61e21['body'];_0x584429[_0x2958('0x67')]='system-'+_0x584429[_0x2958('0x33')]+'-';return db[_0x2958('0x54')][_0x2958('0x75')](function(_0x41ead9){return db[_0x2958('0x4a')][_0x2958('0x2a')](_0x584429,{'where':{'id':_0x584429['id']},'transaction':_0x41ead9})['then'](function(){return db[_0x2958('0x57')][_0x2958('0x2c')]({'where':{'VoicePrefixId':_0x584429['id']},'transaction':_0x41ead9})[_0x2958('0x2b')](function(){return db[_0x2958('0x57')][_0x2958('0x52')]({'where':{'id':_0x584429[_0x2958('0x58')]},'raw':!![]})[_0x2958('0x2b')](function(_0x3674b3){return createVoicePrefixExtensions(_0x584429,_0x3674b3,_0x41ead9);});});});})[_0x2958('0x2b')](function(){return db[_0x2958('0x4a')][_0x2958('0x76')](_0x584429['id']);})[_0x2958('0x2b')](respondWithResult(_0x566123,null))[_0x2958('0x4d')](handleError(_0x566123,null));};exports[_0x2958('0x77')]=function(_0x1a2cf2,_0x2136fe,_0x19b819){return db[_0x2958('0x4a')][_0x2958('0x52')]({'where':{'id':_0x1a2cf2[_0x2958('0x4f')]['id']}})[_0x2958('0x2b')](handleEntityNotFound(_0x2136fe,null))['then'](function(_0x831f42){if(_0x831f42){return _0x831f42[_0x2958('0x77')](_0x1a2cf2[_0x2958('0x56')][_0x2958('0x78')],_[_0x2958('0x79')](_0x1a2cf2['body'],[_0x2958('0x78'),'id'])||{})[_0x2958('0x7a')](function(_0x214b51){for(var _0x1a9f51=0x0;_0x1a9f51<_0x1a2cf2[_0x2958('0x56')][_0x2958('0x78')][_0x2958('0x3f')];_0x1a9f51+=0x1){socket[_0x2958('0x7b')](_0x2958('0x7c'),{'UserId':Number(_0x1a2cf2[_0x2958('0x56')][_0x2958('0x78')][_0x1a9f51]),'VoicePrefixId':Number(_0x1a2cf2[_0x2958('0x4f')]['id'])});}return _0x214b51;});}})[_0x2958('0x2b')](respondWithResult(_0x2136fe,null))[_0x2958('0x4d')](handleError(_0x2136fe,null));};exports[_0x2958('0x7d')]=function(_0x33e4b5,_0x3c7a19,_0x80a4db){return db[_0x2958('0x4a')][_0x2958('0x52')]({'where':{'id':_0x33e4b5[_0x2958('0x4f')]['id']}})[_0x2958('0x2b')](handleEntityNotFound(_0x3c7a19,null))[_0x2958('0x2b')](function(_0x2a3c34){if(_0x2a3c34){return _0x2a3c34['removeAgents'](_0x33e4b5[_0x2958('0x3b')][_0x2958('0x78')])[_0x2958('0x2b')](function(){if(_[_0x2958('0x7e')](_0x33e4b5[_0x2958('0x3b')][_0x2958('0x78')])){for(var _0x1d0bfd=0x0;_0x1d0bfd<_0x33e4b5[_0x2958('0x3b')][_0x2958('0x78')][_0x2958('0x3f')];_0x1d0bfd+=0x1){socket[_0x2958('0x7b')](_0x2958('0x7f'),{'UserId':Number(_0x33e4b5['query'][_0x2958('0x78')][_0x1d0bfd]),'VoicePrefixId':Number(_0x33e4b5[_0x2958('0x4f')]['id'])});}}else{socket[_0x2958('0x7b')](_0x2958('0x7f'),{'UserId':Number(_0x33e4b5[_0x2958('0x3b')][_0x2958('0x78')]),'VoicePrefixId':Number(_0x33e4b5['params']['id'])});}});}})[_0x2958('0x2b')](respondWithStatusCode(_0x3c7a19,null))[_0x2958('0x4d')](handleError(_0x3c7a19,null));};exports[_0x2958('0x80')]=function(_0xe483b9,_0x2b7e0e,_0x558b10){var _0x158c43={};var _0x5be9e={};var _0x2f3f81;var _0x171717;return db[_0x2958('0x4a')][_0x2958('0x81')]({'where':{'id':_0xe483b9[_0x2958('0x4f')]['id']}})[_0x2958('0x2b')](handleEntityNotFound(_0x2b7e0e,null))[_0x2958('0x2b')](function(_0x4739b0){if(_0x4739b0){_0x2f3f81=_0x4739b0;_0x5be9e[_0x2958('0x3a')]=_['keys'](db[_0x2958('0x82')][_0x2958('0x36')]);_0x5be9e['query']=_['keys'](_0xe483b9[_0x2958('0x3b')]);_0x5be9e[_0x2958('0x44')]=_['intersection'](_0x5be9e[_0x2958('0x3a')],_0x5be9e[_0x2958('0x3b')]);_0x158c43[_0x2958('0x3d')]=_['intersection'](_0x5be9e[_0x2958('0x3a')],qs[_0x2958('0x3e')](_0xe483b9[_0x2958('0x3b')][_0x2958('0x3e')]));_0x158c43[_0x2958('0x3d')]=_0x158c43[_0x2958('0x3d')]['length']?_0x158c43[_0x2958('0x3d')]:_0x5be9e[_0x2958('0x3a')];_0x158c43[_0x2958('0x41')]=qs[_0x2958('0x42')](_0xe483b9['query']['sort']);_0x158c43['where']=qs[_0x2958('0x44')](_['pick'](_0xe483b9[_0x2958('0x3b')],_0x5be9e['filters']));if(_0xe483b9['query'][_0x2958('0x46')]){_0x158c43[_0x2958('0x43')]=_['merge'](_0x158c43[_0x2958('0x43')],{'$or':_[_0x2958('0x35')](_0x158c43[_0x2958('0x3d')],function(_0x2aa634){var _0x37b94a={};_0x37b94a[_0x2aa634]={'$like':'%'+_0xe483b9['query'][_0x2958('0x46')]+'%'};return _0x37b94a;})});}_0x158c43=_[_0x2958('0x48')]({},_0x158c43,_0xe483b9[_0x2958('0x49')]);return _0x2f3f81[_0x2958('0x80')](_0x158c43);}})[_0x2958('0x2b')](function(_0x17b2bf){if(_0x17b2bf){_0x171717=_0x17b2bf[_0x2958('0x3f')];if(!_0xe483b9[_0x2958('0x3b')][_0x2958('0x83')]('nolimit')){_0x158c43[_0x2958('0x23')]=qs[_0x2958('0x23')](_0xe483b9[_0x2958('0x3b')]['limit']);_0x158c43[_0x2958('0x21')]=qs[_0x2958('0x21')](_0xe483b9[_0x2958('0x3b')][_0x2958('0x21')]);}return _0x2f3f81[_0x2958('0x80')](_0x158c43);}})[_0x2958('0x2b')](function(_0xb41929){if(_0xb41929){return _0xb41929?{'count':_0x171717,'rows':_0xb41929}:null;}})[_0x2958('0x2b')](respondWithResult(_0x2b7e0e,null))[_0x2958('0x4d')](handleError(_0x2b7e0e,null));};exports[_0x2958('0x84')]=function(_0x57db70,_0x3077ef,_0x5d9ad0){var _0x57ae87={};var _0x2f279a={};var _0x445e57;var _0x561ecc;return db['VoicePrefix']['findOne']({'where':{'id':_0x57db70[_0x2958('0x4f')]['id']}})[_0x2958('0x2b')](handleEntityNotFound(_0x3077ef,null))['then'](function(_0x3876cb){if(_0x3876cb){_0x445e57=_0x3876cb;_0x2f279a[_0x2958('0x3a')]=_[_0x2958('0x50')](db[_0x2958('0x85')][_0x2958('0x36')]);_0x2f279a[_0x2958('0x3b')]=_[_0x2958('0x50')](_0x57db70['query']);_0x2f279a[_0x2958('0x44')]=_[_0x2958('0x3c')](_0x2f279a[_0x2958('0x3a')],_0x2f279a[_0x2958('0x3b')]);_0x57ae87[_0x2958('0x3d')]=_[_0x2958('0x3c')](_0x2f279a[_0x2958('0x3a')],qs[_0x2958('0x3e')](_0x57db70[_0x2958('0x3b')][_0x2958('0x3e')]));_0x57ae87['attributes']=_0x57ae87['attributes'][_0x2958('0x3f')]?_0x57ae87['attributes']:_0x2f279a[_0x2958('0x3a')];_0x57ae87[_0x2958('0x41')]=qs[_0x2958('0x42')](_0x57db70[_0x2958('0x3b')][_0x2958('0x42')]);_0x57ae87[_0x2958('0x43')]=qs[_0x2958('0x44')](_['pick'](_0x57db70[_0x2958('0x3b')],_0x2f279a[_0x2958('0x44')]));if(_0x57db70[_0x2958('0x3b')][_0x2958('0x46')]){_0x57ae87[_0x2958('0x43')]=_['merge'](_0x57ae87[_0x2958('0x43')],{'$or':_[_0x2958('0x35')](_0x57ae87[_0x2958('0x3d')],function(_0x533243){var _0x12ffd1={};_0x12ffd1[_0x533243]={'$like':'%'+_0x57db70[_0x2958('0x3b')][_0x2958('0x46')]+'%'};return _0x12ffd1;})});}_0x57ae87=_[_0x2958('0x48')]({},_0x57ae87,_0x57db70[_0x2958('0x49')]);return _0x445e57[_0x2958('0x84')](_0x57ae87);}})['then'](function(_0x5f4622){if(_0x5f4622){_0x561ecc=_0x5f4622[_0x2958('0x3f')];if(!_0x57db70[_0x2958('0x3b')][_0x2958('0x83')]('nolimit')){_0x57ae87[_0x2958('0x23')]=qs['limit'](_0x57db70[_0x2958('0x3b')][_0x2958('0x23')]);_0x57ae87[_0x2958('0x21')]=qs['offset'](_0x57db70[_0x2958('0x3b')][_0x2958('0x21')]);}return _0x445e57[_0x2958('0x84')](_0x57ae87);}})[_0x2958('0x2b')](function(_0x49bd35){if(_0x49bd35){return _0x49bd35?{'count':_0x561ecc,'rows':_0x49bd35}:null;}})['then'](respondWithResult(_0x3077ef,null))[_0x2958('0x4d')](handleError(_0x3077ef,null));};exports[_0x2958('0x86')]=function(_0x118318,_0x39d235,_0x3eeedf){var _0x498e07=_0x118318[_0x2958('0x56')][_0x2958('0x78')];var _0x1437a7;return db[_0x2958('0x85')][_0x2958('0x87')]({'where':{'id':_0x498e07},'attributes':['id'],'include':[{'model':db[_0x2958('0x82')],'as':_0x2958('0x88'),'attributes':['id',_0x2958('0x33'),'online','voicePause','interface'],'raw':!![]}]})[_0x2958('0x2b')](function(_0x45fcc5){if(_0x45fcc5){_0x1437a7=_0x45fcc5;var _0x3d4314=_['flatMap'](_0x45fcc5,function(_0x413447){var _0x42c8b0=_0x413447[_0x2958('0x2d')]({'plain':!![]});return _0x42c8b0['Agents'];});return db['VoicePrefix']['find']({'where':{'id':_0x118318[_0x2958('0x4f')]['id']}})[_0x2958('0x2b')](function(_0x36c52a){return db[_0x2958('0x54')][_0x2958('0x75')](function(_0x43b9ec){return _0x36c52a['addTeams'](_0x498e07,{'transaction':_0x43b9ec})[_0x2958('0x2b')](function(){return BPromise[_0x2958('0x89')](_0x1437a7,function(_0x9b8367){return db[_0x2958('0x8a')][_0x2958('0x8b')]({'TeamId':_0x9b8367['id'],'VoicePrefixId':_0x118318[_0x2958('0x4f')]['id']},{'transaction':_0x43b9ec});});})['then'](function(){return BPromise['each'](_0x3d4314,function(_0x38a789){return db[_0x2958('0x8c')][_0x2958('0x8d')]({'where':{'UserId':_0x38a789['id'],'VoicePrefixId':_0x118318[_0x2958('0x4f')]['id']},'transaction':_0x43b9ec});});})[_0x2958('0x2b')](function(){_0x3d4314[_0x2958('0x8e')](function(_0x1ec753){socket[_0x2958('0x7b')]('userVoicePrefix:save',{'UserId':_0x1ec753['id'],'VoicePrefixId':_0x36c52a['id']});});});});});}})[_0x2958('0x2b')](respondWithStatusCode(_0x39d235,null))[_0x2958('0x4d')](handleError(_0x39d235,null));};exports[_0x2958('0x8f')]=function(_0x6f44ca,_0x1ddda5,_0x2f5a39){return db[_0x2958('0x85')][_0x2958('0x87')]({'where':{'id':_0x6f44ca['query'][_0x2958('0x78')]},'attributes':['id'],'include':[{'model':db[_0x2958('0x82')],'as':_0x2958('0x88'),'attributes':['id'],'raw':!![]}]})[_0x2958('0x2b')](handleEntityNotFound(_0x1ddda5,null))[_0x2958('0x2b')](function(_0x1c926e){var _0x245a12=_['map'](_0x1c926e,'id');var _0x270846=[];var _0x1d0d0d=[];var _0xc3b770=squel[_0x2958('0x90')]();_0xc3b770[_0x2958('0x91')]('tq.TeamId')['from']('team_has_voice_prefixes','tq')[_0x2958('0x92')]('user_has_teams','ut',_0x2958('0x93'))[_0x2958('0x43')](_0x2958('0x94'),_0x6f44ca['params']['id']);for(var _0x56c6a3=0x0;_0x56c6a3<_0x1c926e[_0x2958('0x3f')];_0x56c6a3+=0x1){let _0x1fd536=_0x1c926e[_0x56c6a3];for(var _0x3fbe11=0x0;_0x3fbe11<_0x1fd536[_0x2958('0x88')][_0x2958('0x3f')];_0x3fbe11+=0x1){let _0x21c020=_0x1fd536[_0x2958('0x88')][_0x3fbe11];var _0x89b78c=_0xc3b770[_0x2958('0x95')]();_0x89b78c[_0x2958('0x43')](_0x2958('0x96'),_0x21c020['id']);_0x1d0d0d[_0x2958('0x6d')](db[_0x2958('0x54')][_0x2958('0x3b')](_0x89b78c[_0x2958('0x97')](),{'type':db[_0x2958('0x54')][_0x2958('0x98')][_0x2958('0x99')]})[_0x2958('0x2b')](function(_0x729aaf){if(_0x729aaf[_0x2958('0x3f')]===0x1){return _0x21c020['id'];}else{var _0x362837=_['every'](_[_0x2958('0x35')](_0x729aaf,_0x2958('0x9a')),function(_0x33af4f){return _[_0x2958('0x9b')](_0x245a12,_0x33af4f);});if(_0x362837){return _0x21c020['id'];}}}));}}return BPromise['all'](_0x1d0d0d)[_0x2958('0x2b')](function(_0x119ff3){_0x270846=_(_0x270846)['union'](_0x119ff3)['compact']()['value']();return db[_0x2958('0x4a')]['find']({'where':{'id':_0x6f44ca[_0x2958('0x4f')]['id']}})[_0x2958('0x2b')](function(_0x26c52f){return db['sequelize'][_0x2958('0x75')](function(_0x2355a0){return _0x26c52f[_0x2958('0x8f')](_0x6f44ca[_0x2958('0x3b')][_0x2958('0x78')],{'transaction':_0x2355a0})[_0x2958('0x2b')](function(){if(!_[_0x2958('0x9c')](_0x270846)){return _0x26c52f[_0x2958('0x7d')](_0x270846,{'transaction':_0x2355a0});}})['then'](function(){_0x270846['forEach'](function(_0x1c5d40){socket[_0x2958('0x7b')](_0x2958('0x7f'),{'UserId':_0x1c5d40,'VoicePrefixId':_0x26c52f['id']});});});});});});})[_0x2958('0x2b')](respondWithStatusCode(_0x1ddda5,null))[_0x2958('0x4d')](handleError(_0x1ddda5,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 0f62599..b7e81ba 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 _0x32cb=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoicePrefix','setMaxListeners','save'];(function(_0x512986,_0xa31647){var _0x25fd7c=function(_0x55855c){while(--_0x55855c){_0x512986['push'](_0x512986['shift']());}};_0x25fd7c(++_0xa31647);}(_0x32cb,0x11d));var _0xb32c=function(_0x93ad11,_0x5d12ba){_0x93ad11=_0x93ad11-0x0;var _0x37c69a=_0x32cb[_0x93ad11];return _0x37c69a;};'use strict';var EventEmitter=require(_0xb32c('0x0'));var VoicePrefix=require(_0xb32c('0x1'))['db'][_0xb32c('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xb32c('0x3')](0x0);var events={'afterCreate':_0xb32c('0x4'),'afterUpdate':'update','afterDestroy':_0xb32c('0x5')};function emitEvent(_0x13e06d){return function(_0x9d08f6,_0x3ad4a0,_0x130dc9){VoicePrefixEvents[_0xb32c('0x6')](_0x13e06d+':'+_0x9d08f6['id'],_0x9d08f6);VoicePrefixEvents[_0xb32c('0x6')](_0x13e06d,_0x9d08f6);_0x130dc9(null);};}for(var e in events){if(events[_0xb32c('0x7')](e)){var event=events[e];VoicePrefix[_0xb32c('0x8')](e,emitEvent(event));}}module[_0xb32c('0x9')]=VoicePrefixEvents; \ No newline at end of file +var _0x5114=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x1972f4,_0x1231ff){var _0x42159b=function(_0x1f9d6f){while(--_0x1f9d6f){_0x1972f4['push'](_0x1972f4['shift']());}};_0x42159b(++_0x1231ff);}(_0x5114,0xc7));var _0x4511=function(_0x36d03c,_0x35b8c9){_0x36d03c=_0x36d03c-0x0;var _0x3ae972=_0x5114[_0x36d03c];return _0x3ae972;};'use strict';var EventEmitter=require(_0x4511('0x0'));var VoicePrefix=require(_0x4511('0x1'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x4511('0x2')](0x0);var events={'afterCreate':_0x4511('0x3'),'afterUpdate':_0x4511('0x4'),'afterDestroy':_0x4511('0x5')};function emitEvent(_0x215a14){return function(_0x36b52c,_0x1995f6,_0x58d9d7){VoicePrefixEvents[_0x4511('0x6')](_0x215a14+':'+_0x36b52c['id'],_0x36b52c);VoicePrefixEvents[_0x4511('0x6')](_0x215a14,_0x36b52c);_0x58d9d7(null);};}for(var e in events){if(events[_0x4511('0x7')](e)){var event=events[e];VoicePrefix[_0x4511('0x8')](e,emitEvent(event));}}module[_0x4511('0x9')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 24000e3..e993568 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 _0x05fa=['VoicePrefix','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x05fa,0x1e1));var _0xa05f=function(_0x29e0eb,_0x9acb52){_0x29e0eb=_0x29e0eb-0x0;var _0x597d2d=_0x05fa[_0x29e0eb];return _0x597d2d;};'use strict';var _=require(_0xa05f('0x0'));var util=require(_0xa05f('0x1'));var logger=require(_0xa05f('0x2'))(_0xa05f('0x3'));var moment=require(_0xa05f('0x4'));var BPromise=require(_0xa05f('0x5'));var rp=require(_0xa05f('0x6'));var fs=require('fs');var path=require(_0xa05f('0x7'));var rimraf=require(_0xa05f('0x8'));var config=require('../../config/environment');var attributes=require('./voicePrefix.attributes');module[_0xa05f('0x9')]=function(_0x2a3b55,_0x442955){return _0x2a3b55[_0xa05f('0xa')](_0xa05f('0xb'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf5b0=['../../config/logger','api','moment','request-promise','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes'];(function(_0x48accc,_0x3142e9){var _0x460cc4=function(_0x4af897){while(--_0x4af897){_0x48accc['push'](_0x48accc['shift']());}};_0x460cc4(++_0x3142e9);}(_0xf5b0,0x1cc));var _0x0f5b=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0xf5b0[_0x279d37];return _0x530173;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0f5b('0x0'))(_0x0f5b('0x1'));var moment=require(_0x0f5b('0x2'));var BPromise=require('bluebird');var rp=require(_0x0f5b('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0f5b('0x4'));var attributes=require(_0x0f5b('0x5'));module[_0x0f5b('0x6')]=function(_0x25631d,_0x4951e1){return _0x25631d[_0x0f5b('0x7')](_0x0f5b('0x8'),attributes,{'tableName':_0x0f5b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index 6f428b5..ec2f67a 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 _0x81c6=['VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./voicePrefix.socket','request','then'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x81c6,0x1d5));var _0x681c=function(_0x3241f3,_0x537340){_0x3241f3=_0x3241f3-0x0;var _0x29ac16=_0x81c6[_0x3241f3];return _0x29ac16;};'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});config[_0x681c('0x8')]=_[_0x681c('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x681c('0xa'))(new Redis(config[_0x681c('0x8')]));require(_0x681c('0xb'))['register'](socket);function respondWithRpcPromise(_0x4f0228,_0x3e3770,_0x4ff60b){return new BPromise(function(_0x82b6ad,_0x83927a){return client[_0x681c('0xc')](_0x4f0228,_0x4ff60b)[_0x681c('0xd')](function(_0x48dc05){logger['info'](_0x681c('0xe'),_0x3e3770,_0x681c('0xf'));logger[_0x681c('0x10')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x3e3770,_0x681c('0xf'),JSON['stringify'](_0x48dc05));if(_0x48dc05[_0x681c('0x11')]){if(_0x48dc05['error'][_0x681c('0x12')]===0x1f4){logger[_0x681c('0x11')](_0x681c('0xe'),_0x3e3770,_0x48dc05[_0x681c('0x11')][_0x681c('0x13')]);return _0x83927a(_0x48dc05[_0x681c('0x11')]['message']);}logger[_0x681c('0x11')](_0x681c('0xe'),_0x3e3770,_0x48dc05[_0x681c('0x11')][_0x681c('0x13')]);return _0x82b6ad(_0x48dc05[_0x681c('0x11')][_0x681c('0x13')]);}else{logger['info'](_0x681c('0xe'),_0x3e3770,_0x681c('0xf'));_0x82b6ad(_0x48dc05[_0x681c('0x14')][_0x681c('0x13')]);}})['catch'](function(_0x22e608){logger[_0x681c('0x11')]('VoicePrefix,\x20%s,\x20%s',_0x3e3770,_0x22e608);_0x83927a(_0x22e608);});});} \ No newline at end of file +var _0x38b2=['message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./voicePrefix.socket','register','request','then','info','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','code','error','VoicePrefix,\x20%s,\x20%s'];(function(_0x112a82,_0xa2eae3){var _0xf1aaea=function(_0x58b2bf){while(--_0x58b2bf){_0x112a82['push'](_0x112a82['shift']());}};_0xf1aaea(++_0xa2eae3);}(_0x38b2,0xf6));var _0x238b=function(_0x4aba2c,_0x3c3229){_0x4aba2c=_0x4aba2c-0x0;var _0x15c4c8=_0x38b2[_0x4aba2c];return _0x15c4c8;};'use strict';var _=require(_0x238b('0x0'));var util=require(_0x238b('0x1'));var moment=require(_0x238b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x238b('0x3'));var db=require(_0x238b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x238b('0x5'))('rpc');var config=require(_0x238b('0x6'));var jayson=require(_0x238b('0x7'));var client=jayson[_0x238b('0x8')][_0x238b('0x9')]({'port':0x232a});config['redis']=_[_0x238b('0xa')](config[_0x238b('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x238b('0xc'))(new Redis(config[_0x238b('0xb')]));require(_0x238b('0xd'))[_0x238b('0xe')](socket);function respondWithRpcPromise(_0x19afcf,_0x17f674,_0x1b7bf4){return new BPromise(function(_0x4df7d6,_0x137ad2){return client[_0x238b('0xf')](_0x19afcf,_0x1b7bf4)[_0x238b('0x10')](function(_0x40762f){logger[_0x238b('0x11')]('VoicePrefix,\x20%s,\x20%s',_0x17f674,_0x238b('0x12'));logger[_0x238b('0x13')](_0x238b('0x14'),_0x17f674,_0x238b('0x12'),JSON['stringify'](_0x40762f));if(_0x40762f['error']){if(_0x40762f['error'][_0x238b('0x15')]===0x1f4){logger[_0x238b('0x16')](_0x238b('0x17'),_0x17f674,_0x40762f[_0x238b('0x16')][_0x238b('0x18')]);return _0x137ad2(_0x40762f[_0x238b('0x16')][_0x238b('0x18')]);}logger[_0x238b('0x16')]('VoicePrefix,\x20%s,\x20%s',_0x17f674,_0x40762f[_0x238b('0x16')]['message']);return _0x4df7d6(_0x40762f[_0x238b('0x16')]['message']);}else{logger[_0x238b('0x11')]('VoicePrefix,\x20%s,\x20%s',_0x17f674,_0x238b('0x12'));_0x4df7d6(_0x40762f[_0x238b('0x19')][_0x238b('0x18')]);}})[_0x238b('0x1a')](function(_0x30d14){logger[_0x238b('0x16')]('VoicePrefix,\x20%s,\x20%s',_0x17f674,_0x30d14);_0x137ad2(_0x30d14);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 8b54f15..bcdfb53 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 _0x96cc=['./voicePrefix.events','remove','emit','removeListener','register','length','voicePrefix:'];(function(_0x346738,_0x1920d8){var _0x445181=function(_0xda7d6d){while(--_0xda7d6d){_0x346738['push'](_0x346738['shift']());}};_0x445181(++_0x1920d8);}(_0x96cc,0x16c));var _0xc96c=function(_0x42b02a,_0x544374){_0x42b02a=_0x42b02a-0x0;var _0x4d815c=_0x96cc[_0x42b02a];return _0x4d815c;};'use strict';var VoicePrefixEvents=require(_0xc96c('0x0'));var events=['save',_0xc96c('0x1'),'update'];function createListener(_0x30bf8a,_0x3e7a95){return function(_0x107043){_0x3e7a95[_0xc96c('0x2')](_0x30bf8a,_0x107043);};}function removeListener(_0x71140d,_0x29b6f1){return function(){VoicePrefixEvents[_0xc96c('0x3')](_0x71140d,_0x29b6f1);};}exports[_0xc96c('0x4')]=function(_0x3b7f45){for(var _0x5142cd=0x0,_0x10b411=events[_0xc96c('0x5')];_0x5142cd<_0x10b411;_0x5142cd++){var _0x408afb=events[_0x5142cd];var _0x86c1a8=createListener(_0xc96c('0x6')+_0x408afb,_0x3b7f45);VoicePrefixEvents['on'](_0x408afb,_0x86c1a8);}}; \ No newline at end of file +var _0x2ceb=['save','update','emit','removeListener','register','voicePrefix:','./voicePrefix.events'];(function(_0x18988d,_0x4d2ffe){var _0x3783af=function(_0x19b62d){while(--_0x19b62d){_0x18988d['push'](_0x18988d['shift']());}};_0x3783af(++_0x4d2ffe);}(_0x2ceb,0x110));var _0xb2ce=function(_0x2fcf7a,_0x202d2b){_0x2fcf7a=_0x2fcf7a-0x0;var _0x2492dc=_0x2ceb[_0x2fcf7a];return _0x2492dc;};'use strict';var VoicePrefixEvents=require(_0xb2ce('0x0'));var events=[_0xb2ce('0x1'),'remove',_0xb2ce('0x2')];function createListener(_0x1bca5d,_0xc03973){return function(_0x1dbb1e){_0xc03973[_0xb2ce('0x3')](_0x1bca5d,_0x1dbb1e);};}function removeListener(_0x35242f,_0x58daad){return function(){VoicePrefixEvents[_0xb2ce('0x4')](_0x35242f,_0x58daad);};}exports[_0xb2ce('0x5')]=function(_0x550455){for(var _0x479153=0x0,_0x3dfaee=events['length'];_0x479153<_0x3dfaee;_0x479153++){var _0x39120a=events[_0x479153];var _0x9fb07c=createListener(_0xb2ce('0x6')+_0x39120a,_0x550455);VoicePrefixEvents['on'](_0x39120a,_0x9fb07c);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index e3dd306..39c31cf 100644 --- a/server/api/voiceQueue/index.js +++ b/server/api/voiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x4787ce,_0x3f2423){var _0x19432e=function(_0x1a0ce8){while(--_0x1a0ce8){_0x4787ce['push'](_0x4787ce['shift']());}};_0x19432e(++_0x3f2423);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router; \ No newline at end of file +var _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0x58418a,_0x3d9f06){var _0x2716bf=function(_0x36fcfd){while(--_0x36fcfd){_0x58418a['push'](_0x58418a['shift']());}};_0x2716bf(++_0x3d9f06);}(_0xb10b,0x12a));var _0xbb10=function(_0x70c97a,_0xd4d263){_0x70c97a=_0x70c97a-0x0;var _0x5cb362=_0xb10b[_0x70c97a];return _0x5cb362;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 672bda1..890546c 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 _0x760d=['UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','agentBusyFactor','dropRate','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','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)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#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','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','ENUM','inbound','outbound','default','ringall','leastrecent','fewestcalls','random','rrmemory','linear','wrandom','rrordered','getDataValue','dialMethod','strategy','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','setDataValue','periodic_announce','split','joinempty','join','leavewhenempty','BOOLEAN','wrapuptime','Active/Disactive\x20Campaign','preview'];(function(_0x1bce3b,_0x5c2e60){var _0x268859=function(_0xa0ecc8){while(--_0xa0ecc8){_0x1bce3b['push'](_0x1bce3b['shift']());}};_0x268859(++_0x5c2e60);}(_0x760d,0x77));var _0xd760=function(_0x2e3acf,_0x39e3b0){_0x2e3acf=_0x2e3acf-0x0;var _0x168e7e=_0x760d[_0x2e3acf];return _0x168e7e;};'use strict';var Sequelize=require(_0xd760('0x0'));module['exports']={'name':{'type':Sequelize[_0xd760('0x1')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xd760('0x2')](_0xd760('0x3'),_0xd760('0x4')),'allowNull':![],'defaultValue':_0xd760('0x3')},'musiconhold':{'type':Sequelize[_0xd760('0x1')],'defaultValue':_0xd760('0x5')},'announce':{'type':Sequelize[_0xd760('0x1')],'defaultValue':''},'strategy':{'type':Sequelize[_0xd760('0x2')]('rr',_0xd760('0x6'),_0xd760('0x7'),_0xd760('0x8'),_0xd760('0x9'),_0xd760('0xa'),_0xd760('0xb'),_0xd760('0xc'),_0xd760('0xd')),'allowNull':![],'defaultValue':_0xd760('0x6'),'set':function(_0x3a1fd5){this['setDataValue']('strategy',_0x3a1fd5?_0x3a1fd5:_0xd760('0xa'));},'get':function(){var _0x26b958=this['getDataValue']('type');var _0x24b15f=this[_0xd760('0xe')](_0xd760('0xf'));var _0x18ff1=this[_0xd760('0xe')](_0xd760('0x10'));if(_0x26b958===_0xd760('0x3')){return _0x18ff1;}if(_0x24b15f===_0xd760('0x11')&&_0x18ff1===_0xd760('0xa')||_0x24b15f===_0xd760('0x11')&&_0x18ff1===_0xd760('0x12')){return _0x18ff1;}if(_0x24b15f===_0xd760('0x13')||_0x24b15f===_0xd760('0x14')||_0x24b15f===_0xd760('0x15')){return _0x18ff1;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xd760('0x16')](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xd760('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0xd760('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xd760('0x16')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xd760('0x2')](_0xd760('0x17'),'no'),'defaultValue':_0xd760('0x17')},'autopause':{'type':Sequelize['ENUM'](_0xd760('0x17'),'no',_0xd760('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0xd760('0x2')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xd760('0x2')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xd760('0x16')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xd760('0x2')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xd760('0x2')](_0xd760('0x17'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xd760('0x2')](_0xd760('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xd760('0x2')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xd760('0x1')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xd760('0x16')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xd760('0x16')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xd760('0x2')](_0xd760('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xd760('0x2')]('yes','no'),'defaultValue':_0xd760('0x17')},'announce_holdtime':{'type':Sequelize[_0xd760('0x2')](_0xd760('0x17'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xd760('0x1')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xd760('0x2')](_0xd760('0x17'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0xd760('0x2')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xd760('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xd760('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xd760('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xd760('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xd760('0x1')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xd760('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xd760('0x1')]},'queue_quantity1':{'type':Sequelize[_0xd760('0x1')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0xd760('0x1')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x40e4ac){this[_0xd760('0x19')](_0xd760('0x1a'),_0x40e4ac?_0x40e4ac['join'](','):[]);},'get':function(){return this[_0xd760('0xe')](_0xd760('0x1a'))?this['getDataValue']('periodic_announce')[_0xd760('0x1b')](','):[];}},'joinempty':{'type':Sequelize[_0xd760('0x1')],'defaultValue':_0xd760('0x17'),'set':function(_0x56ad51){this[_0xd760('0x19')]('joinempty',_0x56ad51?_0x56ad51['join'](','):undefined);},'get':function(){return this['getDataValue'](_0xd760('0x1c'))?this[_0xd760('0xe')](_0xd760('0x1c'))[_0xd760('0x1b')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xd760('0x1')],'defaultValue':'no','set':function(_0x5ccbf5){this[_0xd760('0x19')]('leavewhenempty',_0x5ccbf5?_0x5ccbf5[_0xd760('0x1d')](','):undefined);},'get':function(){return this['getDataValue'](_0xd760('0x1e'))?this[_0xd760('0xe')]('leavewhenempty')['split'](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0xd760('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xd760('0x2')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xd760('0x16')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xd760('0x2')](_0xd760('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0xd760('0x1f')],'defaultValue':0x0,'set':function(_0x597b9f){this[_0xd760('0x19')]('acw',_0x597b9f);if(_0x597b9f){if(this[_0xd760('0xe')](_0xd760('0x20'))<0x2){this['setDataValue']('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0xd760('0x16')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xd760('0x1f')],'defaultValue':0x0,'comment':_0xd760('0x21')},'dialMethod':{'type':Sequelize[_0xd760('0x2')](_0xd760('0x22'),'progressive','power',_0xd760('0x14'),_0xd760('0x11')),'defaultValue':_0xd760('0x13'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize[_0xd760('0x16')](0x4)[_0xd760('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xd760('0x24')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xd760('0x25')},'dialPowerLevel':{'type':Sequelize[_0xd760('0x26')](0x2)[_0xd760('0x23')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0xd760('0x2')](_0xd760('0x27'),_0xd760('0x28')),'defaultValue':_0xd760('0x28'),'comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xd760('0x26')](0x2)[_0xd760('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize[_0xd760('0x16')](0x3)[_0xd760('0x23')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xd760('0x29')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xd760('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xd760('0x16')](0x3)[_0xd760('0x23')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd760('0x2a')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':'tTxX','comment':_0xd760('0x2b')},'dialQueueTimeout':{'type':Sequelize[_0xd760('0x16')](0x3)[_0xd760('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd760('0x2c')},'dialQueueProject':{'type':Sequelize[_0xd760('0x1')],'comment':_0xd760('0x2d')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd760('0x2e')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xd760('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd760('0x2f')},'dialBusyMaxRetry':{'type':Sequelize[_0xd760('0x16')](0x3)[_0xd760('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xd760('0x16')](0x5)[_0xd760('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xd760('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xd760('0x16')](0x5)[_0xd760('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xd760('0x16')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xd760('0x1')],'defaultValue':_0xd760('0x30')},'dialPrefix':{'type':Sequelize[_0xd760('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xd760('0x2')](_0xd760('0x31'),_0xd760('0x32'),_0xd760('0x33')),'defaultValue':_0xd760('0x31')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xd760('0x34')},'dialAMDInitialSilence':{'type':Sequelize[_0xd760('0x16')](0x9)[_0xd760('0x23')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xd760('0x16')](0x9)[_0xd760('0x23')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xd760('0x35')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xd760('0x16')](0x9)[_0xd760('0x23')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xd760('0x36')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xd760('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd760('0x37')},'dialAMDMinWordLength':{'type':Sequelize[_0xd760('0x16')](0x9)[_0xd760('0x23')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xd760('0x38')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xd760('0x16')](0x9)[_0xd760('0x23')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xd760('0x39')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xd760('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xd760('0x3a')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xd760('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd760('0x3b')},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)[_0xd760('0x23')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xd760('0x3c')},'dialRecallInQueue':{'type':Sequelize[_0xd760('0x1f')],'defaultValue':0x0,'comment':_0xd760('0x3d')},'dialOrderByScheduledAt':{'type':Sequelize[_0xd760('0x2')](_0xd760('0x3e'),'ASC'),'defaultValue':_0xd760('0x3e')},'dialQueueProject2':{'type':Sequelize[_0xd760('0x1')],'comment':_0xd760('0x2d')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xd760('0x16')](0x3)[_0xd760('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd760('0x3f')},'dialCutDigit':{'type':Sequelize[_0xd760('0x16')](0x3)[_0xd760('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd760('0x40')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd760('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd760('0x41')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd760('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xd760('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd760('0x42')},'dialDropRetryFrequency':{'type':Sequelize[_0xd760('0x16')](0x5)[_0xd760('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd760('0x43')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xd760('0x16')](0x3)[_0xd760('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd760('0x44')},'dialMachineMaxRetry':{'type':Sequelize[_0xd760('0x16')](0x3)[_0xd760('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd760('0x45')},'dialMachineRetryFrequency':{'type':Sequelize[_0xd760('0x16')](0x5)[_0xd760('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd760('0x46')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd760('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd760('0x47')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd760('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd760('0x48')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd760('0x16')],'allowNull':!![],'comment':_0xd760('0x49')},'mandatoryDisposition':{'type':Sequelize[_0xd760('0x1f')],'defaultValue':![],'comment':_0xd760('0x4a'),'set':function(_0x250025){if(!_0x250025)this[_0xd760('0x19')](_0xd760('0x4b'),null);this['setDataValue'](_0xd760('0x4c'),_0x250025);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xd760('0x16')](0x3)[_0xd760('0x23')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xd760('0x16')](0x3)[_0xd760('0x23')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0xd760('0x1f')],'defaultValue':!![]},'dialPreviewRecallmeReminder':{'type':Sequelize[_0xd760('0x1f')],'defaultValue':![]}}; \ No newline at end of file +var _0xc246=['booked','roundrobin','progressive','predictive','INTEGER','yes','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','preview','power','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','always','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','STRING','ENUM','inbound','outbound','default','ringall','leastrecent','fewestcalls','random','rrmemory','linear','wrandom','rrordered','setDataValue','strategy','getDataValue','dialMethod'];(function(_0x335682,_0x44ec4a){var _0x3e13f1=function(_0x47f9b4){while(--_0x47f9b4){_0x335682['push'](_0x335682['shift']());}};_0x3e13f1(++_0x44ec4a);}(_0xc246,0x1bd));var _0x6c24=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc246[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x6c24('0x0')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x6c24('0x1')](_0x6c24('0x2'),_0x6c24('0x3')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0x6c24('0x4')},'announce':{'type':Sequelize[_0x6c24('0x0')],'defaultValue':''},'strategy':{'type':Sequelize[_0x6c24('0x1')]('rr',_0x6c24('0x5'),_0x6c24('0x6'),_0x6c24('0x7'),_0x6c24('0x8'),_0x6c24('0x9'),_0x6c24('0xa'),_0x6c24('0xb'),_0x6c24('0xc')),'allowNull':![],'defaultValue':'ringall','set':function(_0xfc2eb9){this[_0x6c24('0xd')](_0x6c24('0xe'),_0xfc2eb9?_0xfc2eb9:'rrmemory');},'get':function(){var _0x464e5c=this[_0x6c24('0xf')]('type');var _0x14b94a=this[_0x6c24('0xf')](_0x6c24('0x10'));var _0x445f01=this['getDataValue'](_0x6c24('0xe'));if(_0x464e5c==='inbound'){return _0x445f01;}if(_0x14b94a===_0x6c24('0x11')&&_0x445f01===_0x6c24('0x9')||_0x14b94a===_0x6c24('0x11')&&_0x445f01===_0x6c24('0x12')){return _0x445f01;}if(_0x14b94a===_0x6c24('0x13')||_0x14b94a===_0x6c24('0x14')||_0x14b94a==='power'){return _0x445f01;}return null;}},'servicelevel':{'type':Sequelize[_0x6c24('0x15')](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x6c24('0x15')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x6c24('0x0')]},'weight':{'type':Sequelize[_0x6c24('0x15')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x6c24('0x15')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x6c24('0x1')](_0x6c24('0x16'),'no'),'defaultValue':_0x6c24('0x16')},'autopause':{'type':Sequelize[_0x6c24('0x1')](_0x6c24('0x16'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x6c24('0x15')](0xb)},'autopausebusy':{'type':Sequelize[_0x6c24('0x1')](_0x6c24('0x16'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0x6c24('0x16'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x6c24('0x1')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x6c24('0x1')](_0x6c24('0x16'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x6c24('0x1')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x6c24('0x1')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x6c24('0x0')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x6c24('0x15')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x6c24('0x15')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x6c24('0x15')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x6c24('0x1')](_0x6c24('0x16'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x6c24('0x1')](_0x6c24('0x16'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0x6c24('0x1')](_0x6c24('0x16'),'no',_0x6c24('0x17')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x6c24('0x0')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0x6c24('0x16'),'no')},'announce_position_limit':{'type':Sequelize[_0x6c24('0x15')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x6c24('0x1')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x6c24('0x0')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x6c24('0x0')]},'queue_youarenext':{'type':Sequelize[_0x6c24('0x0')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x6c24('0x0')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x6c24('0x0')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x6c24('0x0')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x6c24('0x0')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x6c24('0x0')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x6c24('0x0')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x6c24('0x0')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x6c24('0x0')]},'queue_quantity1':{'type':Sequelize[_0x6c24('0x0')]},'queue_quantity2':{'type':Sequelize[_0x6c24('0x0')]},'queue_periodic_announce':{'type':Sequelize[_0x6c24('0x0')]},'queue_less_than':{'type':Sequelize[_0x6c24('0x0')]},'periodic_announce':{'type':Sequelize[_0x6c24('0x18')],'set':function(_0xccf0be){this['setDataValue'](_0x6c24('0x19'),_0xccf0be?_0xccf0be[_0x6c24('0x1a')](','):[]);},'get':function(){return this[_0x6c24('0xf')](_0x6c24('0x19'))?this[_0x6c24('0xf')](_0x6c24('0x19'))[_0x6c24('0x1b')](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0x6c24('0x16'),'set':function(_0x21ac01){this[_0x6c24('0xd')](_0x6c24('0x1c'),_0x21ac01?_0x21ac01[_0x6c24('0x1a')](','):undefined);},'get':function(){return this[_0x6c24('0xf')](_0x6c24('0x1c'))?this['getDataValue'](_0x6c24('0x1c'))[_0x6c24('0x1b')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x6c24('0x0')],'defaultValue':'no','set':function(_0x5cad0d){this[_0x6c24('0xd')](_0x6c24('0x1d'),_0x5cad0d?_0x5cad0d[_0x6c24('0x1a')](','):undefined);},'get':function(){return this[_0x6c24('0xf')]('leavewhenempty')?this['getDataValue']('leavewhenempty')[_0x6c24('0x1b')](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0x6c24('0x16'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x6c24('0x1')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x6c24('0x15')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x6c24('0x1')](_0x6c24('0x16'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6c24('0x0')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x54597c){this['setDataValue']('acw',_0x54597c);if(_0x54597c){if(this[_0x6c24('0xf')](_0x6c24('0x1e'))<0x2){this[_0x6c24('0xd')](_0x6c24('0x1e'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x6c24('0x15')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x6c24('0x1f')],'defaultValue':0x0,'comment':_0x6c24('0x20')},'dialMethod':{'type':Sequelize[_0x6c24('0x1')](_0x6c24('0x21'),_0x6c24('0x13'),_0x6c24('0x22'),_0x6c24('0x14'),'booked'),'defaultValue':_0x6c24('0x13'),'comment':_0x6c24('0x23')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0x6c24('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0x6c24('0x15')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x6c24('0x25')},'dialPowerLevel':{'type':Sequelize[_0x6c24('0x26')](0x2)[_0x6c24('0x24')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0x6c24('0x1')](_0x6c24('0x27'),_0x6c24('0x28')),'defaultValue':_0x6c24('0x28'),'comment':_0x6c24('0x29')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x6c24('0x26')](0x2)[_0x6c24('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x6c24('0x2a')},'dialPredictiveInterval':{'type':Sequelize[_0x6c24('0x15')](0x3)[_0x6c24('0x24')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x6c24('0x15')](0x3)[_0x6c24('0x24')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0x6c24('0x0')],'defaultValue':'tTxX','comment':_0x6c24('0x2b')},'dialQueueTimeout':{'type':Sequelize[_0x6c24('0x15')](0x3)[_0x6c24('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6c24('0x2c')},'dialQueueProject':{'type':Sequelize[_0x6c24('0x0')],'comment':_0x6c24('0x2d')},'dialCongestionMaxRetry':{'type':Sequelize[_0x6c24('0x15')](0x3)[_0x6c24('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x6c24('0x15')](0x5)[_0x6c24('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6c24('0x2e')},'dialBusyMaxRetry':{'type':Sequelize[_0x6c24('0x15')](0x3)[_0x6c24('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6c24('0x2f')},'dialBusyRetryFrequency':{'type':Sequelize[_0x6c24('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6c24('0x30')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x6c24('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x6c24('0x31')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x6c24('0x15')](0x5)[_0x6c24('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6c24('0x32')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x6c24('0x33')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x6c24('0x0')],'defaultValue':_0x6c24('0x34')},'dialPrefix':{'type':Sequelize[_0x6c24('0x0')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x6c24('0x1')]('always',_0x6c24('0x35'),'onlyIfOpen'),'defaultValue':_0x6c24('0x36')},'dialAMDActive':{'type':Sequelize[_0x6c24('0x1f')],'defaultValue':0x0,'comment':_0x6c24('0x37')},'dialAMDInitialSilence':{'type':Sequelize[_0x6c24('0x15')](0x9)[_0x6c24('0x24')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x6c24('0x15')](0x9)[_0x6c24('0x24')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x6c24('0x38')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x6c24('0x15')](0x9)[_0x6c24('0x24')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x6c24('0x39')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x6c24('0x15')](0x9)[_0x6c24('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x6c24('0x3a')},'dialAMDMinWordLength':{'type':Sequelize[_0x6c24('0x15')](0x9)[_0x6c24('0x24')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x6c24('0x24')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x6c24('0x3b')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x6c24('0x15')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x6c24('0x3c')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x6c24('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x6c24('0x3d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x6c24('0x15')](0x9)[_0x6c24('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x6c24('0x3e')},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)[_0x6c24('0x24')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x6c24('0x3f')},'dialRecallInQueue':{'type':Sequelize[_0x6c24('0x1f')],'defaultValue':0x0,'comment':_0x6c24('0x40')},'dialOrderByScheduledAt':{'type':Sequelize[_0x6c24('0x1')](_0x6c24('0x41'),'ASC'),'defaultValue':_0x6c24('0x41')},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0x6c24('0x2d')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x6c24('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x6c24('0x15')](0x3)[_0x6c24('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x6c24('0x42')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x6c24('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x6c24('0x43')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x6c24('0x15')](0x3)[_0x6c24('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6c24('0x44')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x6c24('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x6c24('0x15')](0x3)[_0x6c24('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6c24('0x45')},'dialDropRetryFrequency':{'type':Sequelize[_0x6c24('0x15')](0x5)[_0x6c24('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x6c24('0x15')](0x3)[_0x6c24('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6c24('0x46')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x6c24('0x15')](0x5)[_0x6c24('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6c24('0x47')},'dialMachineMaxRetry':{'type':Sequelize[_0x6c24('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x6c24('0x15')](0x5)[_0x6c24('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6c24('0x48')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x6c24('0x15')](0x3)[_0x6c24('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6c24('0x49')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x6c24('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6c24('0x15')],'allowNull':!![],'comment':_0x6c24('0x4a')},'mandatoryDisposition':{'type':Sequelize[_0x6c24('0x1f')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x10f35a){if(!_0x10f35a)this[_0x6c24('0xd')](_0x6c24('0x4b'),null);this['setDataValue'](_0x6c24('0x4c'),_0x10f35a);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x6c24('0x24')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x6c24('0x1f')],'defaultValue':!![]},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x6c24('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 260c28f..ca0af56 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 _0x1b5d=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','value','includes','type','find','name','UserProfileResource','error','stack','send','index','map','VoiceQueue','rawAttributes','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','options','includeAll','rows','catch','show','include','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','createdAt','updatedAt','body','omit','role','UserProfileSection','userProfileId','getHoppers','findOne','CmHopper','nolimit','VoiceQueueId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','findAll','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','online','voicePause','interface','flatMap','forEach','penalty','sequelize','each','TeamVoiceQueue','upsert','UserVoiceQueueRt','format','SIP/%s','emit','userVoiceQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','isEmpty','userVoiceQueue:remove','addAgents','spread','removeAgents','isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','NOW()','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x5a7112,_0x1f9492){var _0x3147f7=function(_0x4d2329){while(--_0x4d2329){_0x5a7112['push'](_0x5a7112['shift']());}};_0x3147f7(++_0x1f9492);}(_0x1b5d,0x160));var _0xd1b5=function(_0x483295,_0x59f963){_0x483295=_0x483295-0x0;var _0x399ec2=_0x1b5d[_0x483295];return _0x399ec2;};'use strict';var emlformat=require(_0xd1b5('0x0'));var rimraf=require(_0xd1b5('0x1'));var zipdir=require(_0xd1b5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd1b5('0x3'));var BPromise=require(_0xd1b5('0x4'));var Mustache=require(_0xd1b5('0x5'));var util=require(_0xd1b5('0x6'));var path=require(_0xd1b5('0x7'));var sox=require(_0xd1b5('0x8'));var csv=require(_0xd1b5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd1b5('0xa'));var squel=require(_0xd1b5('0xb'));var crypto=require(_0xd1b5('0xc'));var jsforce=require(_0xd1b5('0xd'));var deskjs=require(_0xd1b5('0xe'));var toCsv=require(_0xd1b5('0x9'));var querystring=require(_0xd1b5('0xf'));var Papa=require(_0xd1b5('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd1b5('0x11'));var as=require(_0xd1b5('0x12'));var hardwareService=require(_0xd1b5('0x13'));var logger=require('../../config/logger')(_0xd1b5('0x14'));var utils=require(_0xd1b5('0x15'));var config=require(_0xd1b5('0x16'));var licenseUtil=require(_0xd1b5('0x17'));var db=require(_0xd1b5('0x18'))['db'];config[_0xd1b5('0x19')]=_[_0xd1b5('0x1a')](config[_0xd1b5('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xd1b5('0x1b'))(new Redis(config[_0xd1b5('0x19')]));require('./voiceQueue.socket')[_0xd1b5('0x1c')](socket);function respondWithStatusCode(_0x455fd1,_0x14927e){_0x14927e=_0x14927e||0xcc;return function(_0xd07241){if(_0xd07241){return _0x455fd1['sendStatus'](_0x14927e);}return _0x455fd1[_0xd1b5('0x1d')](_0x14927e)['end']();};}function respondWithResult(_0x45c2f1,_0x11b3ec){_0x11b3ec=_0x11b3ec||0xc8;return function(_0x3e2445){if(_0x3e2445){return _0x45c2f1['status'](_0x11b3ec)['json'](_0x3e2445);}};}function respondWithFilteredResult(_0x4510ac,_0x420a50){return function(_0x49f384){if(_0x49f384){var _0x4539e0=typeof _0x420a50[_0xd1b5('0x1e')]===_0xd1b5('0x1f')&&typeof _0x420a50[_0xd1b5('0x20')]===_0xd1b5('0x1f');var _0x2c51b5=_0x49f384[_0xd1b5('0x21')];var _0x9399a9=_0x4539e0?0x0:_0x420a50['offset'];var _0x5d218a=_0x4539e0?_0x49f384[_0xd1b5('0x21')]:_0x420a50[_0xd1b5('0x1e')]+_0x420a50[_0xd1b5('0x20')];var _0x5c6d0e;if(_0x5d218a>=_0x2c51b5){_0x5d218a=_0x2c51b5;_0x5c6d0e=0xc8;}else{_0x5c6d0e=0xce;}_0x4510ac[_0xd1b5('0x1d')](_0x5c6d0e);return _0x4510ac[_0xd1b5('0x22')](_0xd1b5('0x23'),_0x9399a9+'-'+_0x5d218a+'/'+_0x2c51b5)[_0xd1b5('0x24')](_0x49f384);}return null;};}function patchUpdates(_0x572a5d){return function(_0x340665){try{jsonpatch[_0xd1b5('0x25')](_0x340665,_0x572a5d,!![]);}catch(_0x1b5d8d){return BPromise['reject'](_0x1b5d8d);}return _0x340665[_0xd1b5('0x26')]();};}function saveUpdates(_0x3c74fd,_0x37f1a8){return function(_0x589e76){if(_0x589e76){return _0x589e76[_0xd1b5('0x27')](_0x3c74fd)[_0xd1b5('0x28')](function(_0x2be3de){return _0x2be3de;});}return null;};}function removeEntity(_0x35aa60,_0x1e3cb3){return function(_0x96077d){if(_0x96077d){return _0x96077d[_0xd1b5('0x29')]()['then'](function(){var _0x1ff2a3=_0x96077d['get']({'plain':!![]});var _0x394252=[{'name':_0xd1b5('0x2a'),'value':_0xd1b5('0x2b'),'ignore':![]},{'name':_0xd1b5('0x2c'),'value':_0xd1b5('0x2d'),'ignore':![]}];var _0x499213=_(_0x394252)[_0xd1b5('0x2e')](_0xd1b5('0x2f'))['map'](_0xd1b5('0x30'))[_0xd1b5('0x30')]();if(_[_0xd1b5('0x31')](_0x499213,_0x1ff2a3[_0xd1b5('0x32')])){return;}var _0x404b84=_[_0xd1b5('0x33')](_0x394252,[_0xd1b5('0x30'),_0x1ff2a3[_0xd1b5('0x32')]])[_0xd1b5('0x34')];return db[_0xd1b5('0x35')][_0xd1b5('0x29')]({'where':{'type':_0x404b84,'resourceId':_0x1ff2a3['id']}})[_0xd1b5('0x28')](function(){return _0x96077d;});})[_0xd1b5('0x28')](function(){_0x35aa60['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1feb8b,_0x1f0f52){return function(_0x97947f){if(!_0x97947f){_0x1feb8b['sendStatus'](0x194);}return _0x97947f;};}function handleError(_0x221abe,_0x36a6e7){_0x36a6e7=_0x36a6e7||0x1f4;return function(_0x1dc716){logger[_0xd1b5('0x36')](_0x1dc716[_0xd1b5('0x37')]);if(_0x1dc716['name']){delete _0x1dc716[_0xd1b5('0x34')];}_0x221abe[_0xd1b5('0x1d')](_0x36a6e7)[_0xd1b5('0x38')](_0x1dc716);};}exports[_0xd1b5('0x39')]=function(_0xa18ade,_0xc5da5b){var _0x3421f3={},_0x24e33e={},_0x4891b8={'count':0x0,'rows':[]};var _0x309eb4=_[_0xd1b5('0x3a')](db[_0xd1b5('0x3b')][_0xd1b5('0x3c')],function(_0x83b865){return{'name':_0x83b865['fieldName'],'type':_0x83b865[_0xd1b5('0x32')][_0xd1b5('0x3d')]};});_0x24e33e['model']=_[_0xd1b5('0x3a')](_0x309eb4,_0xd1b5('0x34'));_0x24e33e[_0xd1b5('0x3e')]=_[_0xd1b5('0x3f')](_0xa18ade['query']);_0x24e33e[_0xd1b5('0x40')]=_[_0xd1b5('0x41')](_0x24e33e[_0xd1b5('0x42')],_0x24e33e[_0xd1b5('0x3e')]);_0x3421f3[_0xd1b5('0x43')]=_[_0xd1b5('0x41')](_0x24e33e[_0xd1b5('0x42')],qs['fields'](_0xa18ade[_0xd1b5('0x3e')][_0xd1b5('0x44')]));_0x3421f3[_0xd1b5('0x43')]=_0x3421f3[_0xd1b5('0x43')][_0xd1b5('0x45')]?_0x3421f3[_0xd1b5('0x43')]:_0x24e33e['model'];if(!_0xa18ade['query'][_0xd1b5('0x46')]('nolimit')){_0x3421f3[_0xd1b5('0x20')]=qs[_0xd1b5('0x20')](_0xa18ade[_0xd1b5('0x3e')][_0xd1b5('0x20')]);_0x3421f3[_0xd1b5('0x1e')]=qs[_0xd1b5('0x1e')](_0xa18ade[_0xd1b5('0x3e')][_0xd1b5('0x1e')]);}_0x3421f3[_0xd1b5('0x47')]=qs['sort'](_0xa18ade[_0xd1b5('0x3e')][_0xd1b5('0x48')]);_0x3421f3[_0xd1b5('0x49')]=qs['filters'](_[_0xd1b5('0x4a')](_0xa18ade[_0xd1b5('0x3e')],_0x24e33e[_0xd1b5('0x40')]),_0x309eb4);if(_0xa18ade[_0xd1b5('0x3e')][_0xd1b5('0x2e')]){_0x3421f3['where']=_[_0xd1b5('0x4b')](_0x3421f3[_0xd1b5('0x49')],{'$or':_[_0xd1b5('0x3a')](_0x309eb4,function(_0x5758f5){if(_0x5758f5[_0xd1b5('0x32')]!==_0xd1b5('0x4c')){var _0x48ce00={};_0x48ce00[_0x5758f5['name']]={'$like':'%'+_0xa18ade[_0xd1b5('0x3e')][_0xd1b5('0x2e')]+'%'};return _0x48ce00;}})});}_0x3421f3=_[_0xd1b5('0x4b')]({},_0x3421f3,_0xa18ade[_0xd1b5('0x4d')]);var _0x15e395={'where':_0x3421f3[_0xd1b5('0x49')]};return db['VoiceQueue']['count'](_0x15e395)[_0xd1b5('0x28')](function(_0x4aad02){_0x4891b8[_0xd1b5('0x21')]=_0x4aad02;if(_0xa18ade[_0xd1b5('0x3e')][_0xd1b5('0x4e')]){_0x3421f3['include']=[{'all':!![]}];}return db[_0xd1b5('0x3b')]['findAll'](_0x3421f3);})[_0xd1b5('0x28')](function(_0x11052c){_0x4891b8[_0xd1b5('0x4f')]=_0x11052c;return _0x4891b8;})[_0xd1b5('0x28')](respondWithFilteredResult(_0xc5da5b,_0x3421f3))[_0xd1b5('0x50')](handleError(_0xc5da5b,null));};exports[_0xd1b5('0x51')]=function(_0x2d4830,_0x3a97af){var _0x360b10={'raw':![],'where':{'id':_0x2d4830['params']['id']}},_0x293411={};_0x293411[_0xd1b5('0x42')]=_[_0xd1b5('0x3f')](db[_0xd1b5('0x3b')]['rawAttributes']);_0x293411[_0xd1b5('0x3e')]=_[_0xd1b5('0x3f')](_0x2d4830[_0xd1b5('0x3e')]);_0x293411['filters']=_[_0xd1b5('0x41')](_0x293411[_0xd1b5('0x42')],_0x293411[_0xd1b5('0x3e')]);_0x360b10[_0xd1b5('0x43')]=_[_0xd1b5('0x41')](_0x293411[_0xd1b5('0x42')],qs[_0xd1b5('0x44')](_0x2d4830[_0xd1b5('0x3e')]['fields']));_0x360b10[_0xd1b5('0x43')]=_0x360b10['attributes'][_0xd1b5('0x45')]?_0x360b10[_0xd1b5('0x43')]:_0x293411[_0xd1b5('0x42')];if(_0x2d4830[_0xd1b5('0x3e')][_0xd1b5('0x4e')]){_0x360b10[_0xd1b5('0x52')]=[{'all':!![]}];}_0x360b10=_[_0xd1b5('0x4b')]({},_0x360b10,_0x2d4830['options']);return db[_0xd1b5('0x3b')][_0xd1b5('0x33')](_0x360b10)[_0xd1b5('0x28')](handleEntityNotFound(_0x3a97af,null))['then'](respondWithResult(_0x3a97af,null))[_0xd1b5('0x50')](handleError(_0x3a97af,null));};exports[_0xd1b5('0x53')]=function(_0x32838c,_0x397904){return db[_0xd1b5('0x3b')][_0xd1b5('0x53')](_0x32838c['body'],{})[_0xd1b5('0x28')](function(_0x4a733c){var _0x10ba17=_0x32838c[_0xd1b5('0x54')][_0xd1b5('0x55')]({'plain':!![]});if(!_0x10ba17)throw new Error(_0xd1b5('0x56'));if(_0x10ba17['role']===_0xd1b5('0x54')){var _0x59a1b9=_0x4a733c['get']({'plain':!![]});var _0x35f800=[{'name':'VoiceQueues','value':_0xd1b5('0x2b')},{'name':'QueueCampaigns','value':_0xd1b5('0x2d')}];var _0x48ea61=_[_0xd1b5('0x33')](_0x35f800,[_0xd1b5('0x30'),_0x59a1b9[_0xd1b5('0x32')]])[_0xd1b5('0x34')];return db['UserProfileSection'][_0xd1b5('0x33')]({'where':{'name':_0x48ea61,'userProfileId':_0x10ba17['userProfileId']},'raw':!![]})[_0xd1b5('0x28')](function(_0x18871c){if(_0x18871c&&_0x18871c[_0xd1b5('0x57')]===0x0){return db[_0xd1b5('0x35')][_0xd1b5('0x53')]({'name':_0x59a1b9[_0xd1b5('0x34')],'resourceId':_0x59a1b9['id'],'type':_0x18871c['name'],'sectionId':_0x18871c['id']},{})[_0xd1b5('0x28')](function(){return _0x4a733c;});}else{return _0x4a733c;}})[_0xd1b5('0x50')](function(_0x41e4e1){logger['error'](_0xd1b5('0x58'),_0x41e4e1);throw _0x41e4e1;});}return _0x4a733c;})[_0xd1b5('0x28')](respondWithResult(_0x397904,0xc9))[_0xd1b5('0x50')](handleError(_0x397904,null));};exports[_0xd1b5('0x59')]=function(_0x1ba34a,_0x25da00){var _0x2d6064={'where':{'id':_0x1ba34a[_0xd1b5('0x5a')]['id']}},_0x505be2={};_0x505be2[_0xd1b5('0x42')]=_['keys'](db[_0xd1b5('0x3b')][_0xd1b5('0x3c')]);_0x2d6064['attributes']=_[_0xd1b5('0x41')](_0x505be2['model'],qs[_0xd1b5('0x44')](_0x1ba34a[_0xd1b5('0x3e')][_0xd1b5('0x44')]));_0x2d6064[_0xd1b5('0x43')]=_0x2d6064[_0xd1b5('0x43')][_0xd1b5('0x45')]?_0x2d6064[_0xd1b5('0x43')]:_0x505be2[_0xd1b5('0x42')];if(_0x1ba34a[_0xd1b5('0x3e')][_0xd1b5('0x4e')]){_0x2d6064[_0xd1b5('0x52')]=[{'all':!![]}];}_0x2d6064=_[_0xd1b5('0x4b')]({},_0x2d6064,_0x1ba34a[_0xd1b5('0x4d')]);return db['VoiceQueue'][_0xd1b5('0x33')](_0x2d6064)['then'](handleEntityNotFound(_0x25da00,null))['then'](function(_0x4a2c46){if(_0x4a2c46){var _0x4fc4da=_0x4a2c46['get']({'plain':!![]});_0x4fc4da=qs['omit'](_0x4fc4da,['id',_0xd1b5('0x5b'),_0xd1b5('0x5c')]);_0x1ba34a[_0xd1b5('0x5d')]=_[_0xd1b5('0x5e')](_0x1ba34a[_0xd1b5('0x5d')],['id',_0xd1b5('0x5b'),_0xd1b5('0x5c')]);return db[_0xd1b5('0x3b')][_0xd1b5('0x53')](_[_0xd1b5('0x4b')](_0x4fc4da,_0x1ba34a[_0xd1b5('0x5d')]),{'include':_0x1ba34a[_0xd1b5('0x3e')][_0xd1b5('0x4e')]?[{'all':!![]}]:undefined})['then'](function(_0x3fbc34){var _0x5dfc5e=_0x1ba34a['user'][_0xd1b5('0x55')]({'plain':!![]});if(!_0x5dfc5e)throw new Error(_0xd1b5('0x56'));if(_0x5dfc5e[_0xd1b5('0x5f')]==='user'){var _0x11e635=_0x3fbc34[_0xd1b5('0x55')]({'plain':!![]});var _0x17f60b=[{'name':_0xd1b5('0x2a'),'value':'inbound'},{'name':_0xd1b5('0x2c'),'value':'outbound'}];var _0x1cda44=_[_0xd1b5('0x33')](_0x17f60b,[_0xd1b5('0x30'),_0x11e635[_0xd1b5('0x32')]])['name'];return db[_0xd1b5('0x60')][_0xd1b5('0x33')]({'where':{'name':_0x1cda44,'userProfileId':_0x5dfc5e[_0xd1b5('0x61')]},'raw':!![]})['then'](function(_0x3e88d8){if(_0x3e88d8&&_0x3e88d8['autoAssociation']===0x0){return db[_0xd1b5('0x35')]['create']({'name':_0x11e635[_0xd1b5('0x34')],'resourceId':_0x11e635['id'],'type':_0x3e88d8[_0xd1b5('0x34')],'sectionId':_0x3e88d8['id']},{})[_0xd1b5('0x28')](function(){return _0x3fbc34;});}else{return _0x3fbc34;}})[_0xd1b5('0x50')](function(_0x459850){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x459850);throw _0x459850;});}return _0x3fbc34;});}})[_0xd1b5('0x28')](respondWithResult(_0x25da00,0xc9))[_0xd1b5('0x50')](handleError(_0x25da00,null));};exports[_0xd1b5('0x27')]=function(_0x44ce63,_0x5bca2d){if(_0x44ce63['body']['id']){delete _0x44ce63['body']['id'];}return db[_0xd1b5('0x3b')][_0xd1b5('0x33')]({'where':{'id':_0x44ce63[_0xd1b5('0x5a')]['id']}})[_0xd1b5('0x28')](handleEntityNotFound(_0x5bca2d,null))['then'](saveUpdates(_0x44ce63[_0xd1b5('0x5d')],null))[_0xd1b5('0x28')](respondWithResult(_0x5bca2d,null))[_0xd1b5('0x50')](handleError(_0x5bca2d,null));};exports[_0xd1b5('0x29')]=function(_0x42037f,_0x1b8c13){return db[_0xd1b5('0x3b')][_0xd1b5('0x33')]({'where':{'id':_0x42037f['params']['id']}})['then'](handleEntityNotFound(_0x1b8c13,null))[_0xd1b5('0x28')](removeEntity(_0x1b8c13,null))['catch'](handleError(_0x1b8c13,null));};exports[_0xd1b5('0x62')]=function(_0x52631c,_0x5bc3a6,_0x41a96d){var _0x2d16a4={'raw':![],'where':{}};var _0x18fcde={};var _0x1ac275={'count':0x0,'rows':[]};return db[_0xd1b5('0x3b')][_0xd1b5('0x63')]({'where':{'id':_0x52631c[_0xd1b5('0x5a')]['id']}})[_0xd1b5('0x28')](handleEntityNotFound(_0x5bc3a6,null))[_0xd1b5('0x28')](function(_0x59b959){if(_0x59b959){_0x18fcde[_0xd1b5('0x42')]=_['keys'](db[_0xd1b5('0x64')][_0xd1b5('0x3c')]);_0x18fcde[_0xd1b5('0x3e')]=_[_0xd1b5('0x3f')](_0x52631c[_0xd1b5('0x3e')]);_0x18fcde[_0xd1b5('0x40')]=_[_0xd1b5('0x41')](_0x18fcde[_0xd1b5('0x42')],_0x18fcde[_0xd1b5('0x3e')]);_0x2d16a4[_0xd1b5('0x43')]=_[_0xd1b5('0x41')](_0x18fcde['model'],qs[_0xd1b5('0x44')](_0x52631c[_0xd1b5('0x3e')]['fields']));_0x2d16a4['attributes']=_0x2d16a4['attributes'][_0xd1b5('0x45')]?_0x2d16a4['attributes']:_0x18fcde[_0xd1b5('0x42')];if(!_0x52631c['query']['hasOwnProperty'](_0xd1b5('0x65'))){_0x2d16a4[_0xd1b5('0x20')]=qs[_0xd1b5('0x20')](_0x52631c[_0xd1b5('0x3e')][_0xd1b5('0x20')]);_0x2d16a4[_0xd1b5('0x1e')]=qs[_0xd1b5('0x1e')](_0x52631c[_0xd1b5('0x3e')][_0xd1b5('0x1e')]);}_0x2d16a4[_0xd1b5('0x47')]=qs[_0xd1b5('0x48')](_0x52631c[_0xd1b5('0x3e')][_0xd1b5('0x48')]);_0x2d16a4[_0xd1b5('0x49')]=qs[_0xd1b5('0x40')](_[_0xd1b5('0x4a')](_0x52631c[_0xd1b5('0x3e')],_0x18fcde[_0xd1b5('0x40')]));_0x2d16a4[_0xd1b5('0x49')][_0xd1b5('0x66')]=_0x59b959['id'];if(_0x52631c[_0xd1b5('0x3e')]['filter']){_0x2d16a4['where']=_[_0xd1b5('0x4b')](_0x2d16a4['where'],{'$or':_[_0xd1b5('0x3a')](_0x2d16a4[_0xd1b5('0x43')],function(_0x120e37){var _0x526a6a={};_0x526a6a[_0x120e37]={'$like':'%'+_0x52631c[_0xd1b5('0x3e')][_0xd1b5('0x2e')]+'%'};return _0x526a6a;})});}_0x2d16a4=_[_0xd1b5('0x4b')]({},_0x2d16a4,_0x52631c[_0xd1b5('0x4d')]);return db['CmHopper'][_0xd1b5('0x21')]({'where':_0x2d16a4[_0xd1b5('0x49')]})[_0xd1b5('0x28')](function(_0x5eafd2){_0x1ac275['count']=_0x5eafd2;if(_0x52631c[_0xd1b5('0x3e')]['includeAll']){_0x2d16a4[_0xd1b5('0x52')]=[{'all':!![]}];}return db[_0xd1b5('0x64')]['findAll'](_0x2d16a4);})[_0xd1b5('0x28')](function(_0x1c212e){_0x1ac275[_0xd1b5('0x4f')]=_0x1c212e;return _0x1ac275;});}})[_0xd1b5('0x28')](respondWithFilteredResult(_0x5bc3a6,_0x2d16a4))[_0xd1b5('0x50')](handleError(_0x5bc3a6,null));};exports[_0xd1b5('0x67')]=function(_0x4128ef,_0x4a4a27,_0x145d5d){var _0x2014f1={'raw':!![],'where':{}};var _0x13b0fe={};var _0x1d3d16={'count':0x0,'rows':[]};return db[_0xd1b5('0x3b')][_0xd1b5('0x63')]({'where':{'id':_0x4128ef[_0xd1b5('0x5a')]['id']}})[_0xd1b5('0x28')](handleEntityNotFound(_0x4a4a27,null))[_0xd1b5('0x28')](function(_0x33fc43){if(_0x33fc43){_0x13b0fe[_0xd1b5('0x42')]=_[_0xd1b5('0x3f')](db[_0xd1b5('0x68')]['rawAttributes']);_0x13b0fe[_0xd1b5('0x3e')]=_[_0xd1b5('0x3f')](_0x4128ef[_0xd1b5('0x3e')]);_0x13b0fe[_0xd1b5('0x40')]=_[_0xd1b5('0x41')](_0x13b0fe['model'],_0x13b0fe[_0xd1b5('0x3e')]);_0x2014f1[_0xd1b5('0x43')]=_['intersection'](_0x13b0fe[_0xd1b5('0x42')],qs[_0xd1b5('0x44')](_0x4128ef[_0xd1b5('0x3e')][_0xd1b5('0x44')]));_0x2014f1[_0xd1b5('0x43')]=_0x2014f1[_0xd1b5('0x43')][_0xd1b5('0x45')]?_0x2014f1[_0xd1b5('0x43')]:_0x13b0fe[_0xd1b5('0x42')];if(!_0x4128ef[_0xd1b5('0x3e')]['hasOwnProperty']('nolimit')){_0x2014f1[_0xd1b5('0x20')]=qs[_0xd1b5('0x20')](_0x4128ef[_0xd1b5('0x3e')][_0xd1b5('0x20')]);_0x2014f1[_0xd1b5('0x1e')]=qs['offset'](_0x4128ef['query'][_0xd1b5('0x1e')]);}_0x2014f1['order']=qs[_0xd1b5('0x48')](_0x4128ef['query']['sort']);_0x2014f1['where']=qs[_0xd1b5('0x40')](_[_0xd1b5('0x4a')](_0x4128ef[_0xd1b5('0x3e')],_0x13b0fe[_0xd1b5('0x40')]));_0x2014f1[_0xd1b5('0x49')][_0xd1b5('0x66')]=_0x33fc43['id'];if(_0x4128ef[_0xd1b5('0x3e')]['filter']){_0x2014f1[_0xd1b5('0x49')]=_[_0xd1b5('0x4b')](_0x2014f1['where'],{'$or':_[_0xd1b5('0x3a')](_0x2014f1[_0xd1b5('0x43')],function(_0x266975){var _0x4dafb4={};_0x4dafb4[_0x266975]={'$like':'%'+_0x4128ef['query'][_0xd1b5('0x2e')]+'%'};return _0x4dafb4;})});}_0x2014f1=_[_0xd1b5('0x4b')]({},_0x2014f1,_0x4128ef[_0xd1b5('0x4d')]);return db[_0xd1b5('0x68')][_0xd1b5('0x21')]({'where':_0x2014f1[_0xd1b5('0x49')]})[_0xd1b5('0x28')](function(_0x30766a){_0x1d3d16[_0xd1b5('0x21')]=_0x30766a;if(_0x4128ef['query']['includeAll']){_0x2014f1[_0xd1b5('0x52')]=[{'all':!![]}];}return db[_0xd1b5('0x68')]['findAll'](_0x2014f1);})[_0xd1b5('0x28')](function(_0x30f77f){_0x1d3d16[_0xd1b5('0x4f')]=_0x30f77f;return _0x1d3d16;});}})['then'](respondWithFilteredResult(_0x4a4a27,_0x2014f1))[_0xd1b5('0x50')](handleError(_0x4a4a27,null));};exports[_0xd1b5('0x69')]=function(_0x11fc45,_0x21c091,_0xa35ec2){var _0x5af7f7={'raw':!![],'where':{}};var _0x5a43c4={};var _0x4272aa={'count':0x0,'rows':[]};return db[_0xd1b5('0x3b')][_0xd1b5('0x63')]({'where':{'id':_0x11fc45[_0xd1b5('0x5a')]['id']}})['then'](handleEntityNotFound(_0x21c091,null))[_0xd1b5('0x28')](function(_0x43b547){if(_0x43b547){_0x5a43c4['model']=_[_0xd1b5('0x3f')](db[_0xd1b5('0x6a')][_0xd1b5('0x3c')]);_0x5a43c4[_0xd1b5('0x3e')]=_['keys'](_0x11fc45[_0xd1b5('0x3e')]);_0x5a43c4[_0xd1b5('0x40')]=_[_0xd1b5('0x41')](_0x5a43c4[_0xd1b5('0x42')],_0x5a43c4[_0xd1b5('0x3e')]);_0x5af7f7[_0xd1b5('0x43')]=_[_0xd1b5('0x41')](_0x5a43c4['model'],qs[_0xd1b5('0x44')](_0x11fc45['query']['fields']));_0x5af7f7[_0xd1b5('0x43')]=_0x5af7f7[_0xd1b5('0x43')][_0xd1b5('0x45')]?_0x5af7f7[_0xd1b5('0x43')]:_0x5a43c4[_0xd1b5('0x42')];if(!_0x11fc45['query']['hasOwnProperty']('nolimit')){_0x5af7f7[_0xd1b5('0x20')]=qs[_0xd1b5('0x20')](_0x11fc45[_0xd1b5('0x3e')][_0xd1b5('0x20')]);_0x5af7f7[_0xd1b5('0x1e')]=qs[_0xd1b5('0x1e')](_0x11fc45['query'][_0xd1b5('0x1e')]);}_0x5af7f7[_0xd1b5('0x47')]=qs[_0xd1b5('0x48')](_0x11fc45[_0xd1b5('0x3e')][_0xd1b5('0x48')]);_0x5af7f7[_0xd1b5('0x49')]=qs['filters'](_['pick'](_0x11fc45[_0xd1b5('0x3e')],_0x5a43c4[_0xd1b5('0x40')]));_0x5af7f7['where'][_0xd1b5('0x66')]=_0x43b547['id'];if(_0x11fc45[_0xd1b5('0x3e')][_0xd1b5('0x2e')]){_0x5af7f7[_0xd1b5('0x49')]=_[_0xd1b5('0x4b')](_0x5af7f7[_0xd1b5('0x49')],{'$or':_[_0xd1b5('0x3a')](_0x5af7f7[_0xd1b5('0x43')],function(_0x3d63c5){var _0xaa3b9a={};_0xaa3b9a[_0x3d63c5]={'$like':'%'+_0x11fc45[_0xd1b5('0x3e')][_0xd1b5('0x2e')]+'%'};return _0xaa3b9a;})});}_0x5af7f7=_[_0xd1b5('0x4b')]({},_0x5af7f7,_0x11fc45[_0xd1b5('0x4d')]);return db[_0xd1b5('0x6a')][_0xd1b5('0x21')]({'where':_0x5af7f7['where']})[_0xd1b5('0x28')](function(_0x3e6d9e){_0x4272aa[_0xd1b5('0x21')]=_0x3e6d9e;if(_0x11fc45['query']['includeAll']){_0x5af7f7[_0xd1b5('0x52')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xd1b5('0x6b')](_0x5af7f7);})[_0xd1b5('0x28')](function(_0x369578){_0x4272aa[_0xd1b5('0x4f')]=_0x369578;return _0x4272aa;});}})[_0xd1b5('0x28')](respondWithFilteredResult(_0x21c091,_0x5af7f7))[_0xd1b5('0x50')](handleError(_0x21c091,null));};exports[_0xd1b5('0x6c')]=function(_0x4c5a99,_0x55ffd4,_0x251b91){var _0x124831={'raw':!![],'where':{}};var _0x431c09={};var _0x34864c={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xd1b5('0x63')]({'where':{'id':_0x4c5a99['params']['id']}})[_0xd1b5('0x28')](handleEntityNotFound(_0x55ffd4,null))['then'](function(_0x310c82){if(_0x310c82){_0x431c09['model']=_['keys'](db[_0xd1b5('0x6d')][_0xd1b5('0x3c')]);_0x431c09[_0xd1b5('0x3e')]=_[_0xd1b5('0x3f')](_0x4c5a99[_0xd1b5('0x3e')]);_0x431c09['filters']=_[_0xd1b5('0x41')](_0x431c09[_0xd1b5('0x42')],_0x431c09[_0xd1b5('0x3e')]);_0x124831[_0xd1b5('0x43')]=_[_0xd1b5('0x41')](_0x431c09[_0xd1b5('0x42')],qs['fields'](_0x4c5a99['query'][_0xd1b5('0x44')]));_0x124831[_0xd1b5('0x43')]=_0x124831[_0xd1b5('0x43')][_0xd1b5('0x45')]?_0x124831[_0xd1b5('0x43')]:_0x431c09[_0xd1b5('0x42')];if(!_0x4c5a99[_0xd1b5('0x3e')][_0xd1b5('0x46')]('nolimit')){_0x124831[_0xd1b5('0x20')]=qs[_0xd1b5('0x20')](_0x4c5a99[_0xd1b5('0x3e')][_0xd1b5('0x20')]);_0x124831['offset']=qs[_0xd1b5('0x1e')](_0x4c5a99[_0xd1b5('0x3e')][_0xd1b5('0x1e')]);}_0x124831['order']=qs['sort'](_0x4c5a99[_0xd1b5('0x3e')]['sort']);_0x124831[_0xd1b5('0x49')]=qs[_0xd1b5('0x40')](_[_0xd1b5('0x4a')](_0x4c5a99['query'],_0x431c09['filters']));_0x124831[_0xd1b5('0x49')][_0xd1b5('0x66')]=_0x310c82['id'];if(_0x4c5a99[_0xd1b5('0x3e')][_0xd1b5('0x2e')]){_0x124831[_0xd1b5('0x49')]=_[_0xd1b5('0x4b')](_0x124831[_0xd1b5('0x49')],{'$or':_[_0xd1b5('0x3a')](_0x124831[_0xd1b5('0x43')],function(_0x3f18ee){var _0x39b7de={};_0x39b7de[_0x3f18ee]={'$like':'%'+_0x4c5a99['query'][_0xd1b5('0x2e')]+'%'};return _0x39b7de;})});}_0x124831=_[_0xd1b5('0x4b')]({},_0x124831,_0x4c5a99[_0xd1b5('0x4d')]);return db[_0xd1b5('0x6d')][_0xd1b5('0x21')]({'where':_0x124831[_0xd1b5('0x49')]})[_0xd1b5('0x28')](function(_0x1a1a32){_0x34864c[_0xd1b5('0x21')]=_0x1a1a32;if(_0x4c5a99[_0xd1b5('0x3e')][_0xd1b5('0x4e')]){_0x124831[_0xd1b5('0x52')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xd1b5('0x6b')](_0x124831);})[_0xd1b5('0x28')](function(_0x3f7d0e){_0x34864c[_0xd1b5('0x4f')]=_0x3f7d0e;return _0x34864c;});}})[_0xd1b5('0x28')](respondWithFilteredResult(_0x55ffd4,_0x124831))[_0xd1b5('0x50')](handleError(_0x55ffd4,null));};exports[_0xd1b5('0x6e')]=function(_0xc24ecd,_0xac08b6,_0x1c0b67){var _0x404809={};var _0x148513={};var _0x44ccee;var _0x2ad29b;return db['VoiceQueue'][_0xd1b5('0x63')]({'where':{'id':_0xc24ecd[_0xd1b5('0x5a')]['id']}})[_0xd1b5('0x28')](handleEntityNotFound(_0xac08b6,null))[_0xd1b5('0x28')](function(_0x82a052){if(_0x82a052){_0x44ccee=_0x82a052;_0x148513[_0xd1b5('0x42')]=_[_0xd1b5('0x3f')](db[_0xd1b5('0x6f')]['rawAttributes']);_0x148513['query']=_['keys'](_0xc24ecd[_0xd1b5('0x3e')]);_0x148513['filters']=_[_0xd1b5('0x41')](_0x148513[_0xd1b5('0x42')],_0x148513[_0xd1b5('0x3e')]);_0x404809['attributes']=_[_0xd1b5('0x41')](_0x148513[_0xd1b5('0x42')],qs[_0xd1b5('0x44')](_0xc24ecd[_0xd1b5('0x3e')]['fields']));_0x404809[_0xd1b5('0x43')]=_0x404809[_0xd1b5('0x43')][_0xd1b5('0x45')]?_0x404809[_0xd1b5('0x43')]:_0x148513[_0xd1b5('0x42')];_0x404809[_0xd1b5('0x47')]=qs[_0xd1b5('0x48')](_0xc24ecd['query']['sort']);_0x404809[_0xd1b5('0x49')]=qs[_0xd1b5('0x40')](_[_0xd1b5('0x4a')](_0xc24ecd['query'],_0x148513[_0xd1b5('0x40')]));if(_0xc24ecd[_0xd1b5('0x3e')][_0xd1b5('0x2e')]){_0x404809[_0xd1b5('0x49')]=_['merge'](_0x404809['where'],{'$or':_[_0xd1b5('0x3a')](_0x404809[_0xd1b5('0x43')],function(_0x3944c2){var _0x19415d={};_0x19415d[_0x3944c2]={'$like':'%'+_0xc24ecd[_0xd1b5('0x3e')][_0xd1b5('0x2e')]+'%'};return _0x19415d;})});}_0x404809=_[_0xd1b5('0x4b')]({},_0x404809,_0xc24ecd[_0xd1b5('0x4d')]);return _0x44ccee[_0xd1b5('0x6e')](_0x404809);}})[_0xd1b5('0x28')](function(_0x4a87de){if(_0x4a87de){_0x2ad29b=_0x4a87de['length'];if(!_0xc24ecd[_0xd1b5('0x3e')]['hasOwnProperty'](_0xd1b5('0x65'))){_0x404809[_0xd1b5('0x20')]=qs[_0xd1b5('0x20')](_0xc24ecd[_0xd1b5('0x3e')][_0xd1b5('0x20')]);_0x404809['offset']=qs['offset'](_0xc24ecd['query'][_0xd1b5('0x1e')]);}return _0x44ccee[_0xd1b5('0x6e')](_0x404809);}})['then'](function(_0x44f1b4){if(_0x44f1b4){return _0x44f1b4?{'count':_0x2ad29b,'rows':_0x44f1b4}:null;}})[_0xd1b5('0x28')](respondWithResult(_0xac08b6,null))['catch'](handleError(_0xac08b6,null));};exports[_0xd1b5('0x70')]=function(_0x3be90c,_0x30805e,_0x1c37b3){var _0x1c5869=_0x3be90c['body'][_0xd1b5('0x71')];var _0x229d2b=_['map'](_0x1c5869,'id');return db[_0xd1b5('0x6f')][_0xd1b5('0x6b')]({'where':{'id':_0x229d2b},'attributes':['id'],'include':[{'model':db[_0xd1b5('0x72')],'as':_0xd1b5('0x73'),'attributes':['id',_0xd1b5('0x34'),_0xd1b5('0x74'),_0xd1b5('0x75'),_0xd1b5('0x76')],'raw':!![]}]})[_0xd1b5('0x28')](function(_0x441de4){if(_0x441de4){var _0x3232d9=_[_0xd1b5('0x77')](_0x441de4,function(_0x3f1f15){var _0x489c76=_0x3f1f15[_0xd1b5('0x55')]({'plain':!![]});_0x489c76[_0xd1b5('0x73')][_0xd1b5('0x78')](function(_0x4f90c7){_0x4f90c7[_0xd1b5('0x79')]=_['find'](_0x1c5869,{'id':_0x489c76['id']})[_0xd1b5('0x79')];});return _0x489c76['Agents'];});return db[_0xd1b5('0x3b')][_0xd1b5('0x33')]({'where':{'id':_0x3be90c[_0xd1b5('0x5a')]['id']}})[_0xd1b5('0x28')](function(_0x3236e5){return db[_0xd1b5('0x7a')]['transaction'](function(_0x4ca23b){return _0x3236e5['addTeams'](_0x229d2b,{'transaction':_0x4ca23b})['then'](function(){return BPromise[_0xd1b5('0x7b')](_0x1c5869,function(_0x3c370b){return db[_0xd1b5('0x7c')][_0xd1b5('0x7d')]({'TeamId':_0x3c370b['id'],'VoiceQueueId':_0x3be90c[_0xd1b5('0x5a')]['id'],'penalty':_0x3c370b[_0xd1b5('0x79')]},{'transaction':_0x4ca23b});});})[_0xd1b5('0x28')](function(){return BPromise[_0xd1b5('0x7b')](_0x3232d9,function(_0x32ef10){return db['UserVoiceQueue']['findOrCreate']({'where':{'UserId':_0x32ef10['id'],'VoiceQueueId':_0x3be90c[_0xd1b5('0x5a')]['id']},'defaults':{'penalty':_0x32ef10[_0xd1b5('0x79')]},'transaction':_0x4ca23b});});})[_0xd1b5('0x28')](function(){return BPromise[_0xd1b5('0x7b')](_[_0xd1b5('0x2e')](_0x3232d9,{'online':!![]}),function(_0x1c86cf){return db[_0xd1b5('0x7e')][_0xd1b5('0x7d')]({'membername':_0x1c86cf[_0xd1b5('0x34')],'UserId':_0x1c86cf['id'],'queue_name':_0x3236e5[_0xd1b5('0x34')],'VoiceQueueId':_0x3236e5['id'],'interface':_['isNil'](_0x1c86cf[_0xd1b5('0x76')])?util[_0xd1b5('0x7f')](_0xd1b5('0x80'),_0x1c86cf[_0xd1b5('0x34')]):_0x1c86cf[_0xd1b5('0x76')],'paused':_0x1c86cf[_0xd1b5('0x75')]||![],'penalty':_0x1c86cf[_0xd1b5('0x79')]},{'transaction':_0x4ca23b});});})[_0xd1b5('0x28')](function(){_0x3232d9[_0xd1b5('0x78')](function(_0x3d9dea){socket[_0xd1b5('0x81')](_0xd1b5('0x82'),{'UserId':_0x3d9dea['id'],'VoiceQueueId':_0x3236e5['id']});});});});});}})[_0xd1b5('0x28')](respondWithStatusCode(_0x30805e,null))[_0xd1b5('0x50')](handleError(_0x30805e,null));};exports[_0xd1b5('0x83')]=function(_0x393e04,_0x4f1066,_0x3fa3bb){return db[_0xd1b5('0x6f')]['findAll']({'where':{'id':_0x393e04['query'][_0xd1b5('0x84')]},'attributes':['id'],'include':[{'model':db[_0xd1b5('0x72')],'as':_0xd1b5('0x73'),'attributes':['id'],'raw':!![]}]})[_0xd1b5('0x28')](handleEntityNotFound(_0x4f1066,null))['then'](function(_0x1c03e6){var _0x5a3091=_['map'](_0x1c03e6,'id');var _0x43ff66=[];var _0x427016=[];var _0x46db68=squel[_0xd1b5('0x85')]();_0x46db68[_0xd1b5('0x86')](_0xd1b5('0x87'))[_0xd1b5('0x88')](_0xd1b5('0x89'),'tq')[_0xd1b5('0x8a')](_0xd1b5('0x8b'),'ut',_0xd1b5('0x8c'))[_0xd1b5('0x49')](_0xd1b5('0x8d'),_0x393e04[_0xd1b5('0x5a')]['id']);for(var _0x259606=0x0;_0x259606<_0x1c03e6['length'];_0x259606+=0x1){let _0x24a050=_0x1c03e6[_0x259606];for(var _0xe19ef0=0x0;_0xe19ef0<_0x24a050['Agents'][_0xd1b5('0x45')];_0xe19ef0+=0x1){let _0x4e285a=_0x24a050['Agents'][_0xe19ef0];var _0x3d52f0=_0x46db68[_0xd1b5('0x59')]();_0x3d52f0[_0xd1b5('0x49')]('ut.UserId\x20=\x20?',_0x4e285a['id']);_0x427016[_0xd1b5('0x8e')](db[_0xd1b5('0x7a')][_0xd1b5('0x3e')](_0x3d52f0[_0xd1b5('0x8f')](),{'type':db[_0xd1b5('0x7a')][_0xd1b5('0x90')][_0xd1b5('0x91')]})['then'](function(_0x53d8e6){if(_0x53d8e6['length']===0x1){return _0x4e285a['id'];}else{var _0x67d5d9=_[_0xd1b5('0x92')](_[_0xd1b5('0x3a')](_0x53d8e6,_0xd1b5('0x93')),function(_0x52cf37){return _[_0xd1b5('0x31')](_0x5a3091,_0x52cf37);});if(_0x67d5d9){return _0x4e285a['id'];}}}));}}return BPromise[_0xd1b5('0x94')](_0x427016)[_0xd1b5('0x28')](function(_0x62c9a1){_0x43ff66=_(_0x43ff66)[_0xd1b5('0x95')](_0x62c9a1)[_0xd1b5('0x96')]()[_0xd1b5('0x30')]();return db[_0xd1b5('0x3b')][_0xd1b5('0x33')]({'where':{'id':_0x393e04[_0xd1b5('0x5a')]['id']}})[_0xd1b5('0x28')](function(_0x46ead7){return db[_0xd1b5('0x7a')]['transaction'](function(_0x4bfae1){return _0x46ead7[_0xd1b5('0x83')](_0x393e04[_0xd1b5('0x3e')]['ids'],{'transaction':_0x4bfae1})[_0xd1b5('0x28')](function(){if(!_[_0xd1b5('0x97')](_0x43ff66)){return _0x46ead7['removeAgents'](_0x43ff66,{'transaction':_0x4bfae1})[_0xd1b5('0x28')](function(){return db[_0xd1b5('0x7e')][_0xd1b5('0x29')]({'where':{'VoiceQueueId':_0x393e04[_0xd1b5('0x5a')]['id'],'UserId':_0x43ff66},'transaction':_0x4bfae1});});}})[_0xd1b5('0x28')](function(){_0x43ff66[_0xd1b5('0x78')](function(_0x1a8ca7){socket[_0xd1b5('0x81')](_0xd1b5('0x98'),{'UserId':_0x1a8ca7,'VoiceQueueId':_0x46ead7['id']});});});});});});})[_0xd1b5('0x28')](respondWithStatusCode(_0x4f1066,null))[_0xd1b5('0x50')](handleError(_0x4f1066,null));};exports[_0xd1b5('0x99')]=function(_0x549498,_0x2e3540,_0x2a2014){var _0xb8e6cf,_0x180397;return db['VoiceQueue']['find']({'where':{'id':_0x549498[_0xd1b5('0x5a')]['id']}})[_0xd1b5('0x28')](handleEntityNotFound(_0x2e3540,null))[_0xd1b5('0x28')](function(_0x14d313){if(_0x14d313){_0x180397=_0x14d313;return _0x14d313['addAgents'](_0x549498[_0xd1b5('0x5d')][_0xd1b5('0x84')],_[_0xd1b5('0x5e')](_0x549498[_0xd1b5('0x5d')],['ids','id'])||{})[_0xd1b5('0x9a')](function(_0x313904){for(var _0x4509b6=0x0;_0x4509b6<_0x549498['body']['ids'][_0xd1b5('0x45')];_0x4509b6+=0x1){socket[_0xd1b5('0x81')](_0xd1b5('0x82'),{'UserId':Number(_0x549498['body'][_0xd1b5('0x84')][_0x4509b6]),'VoiceQueueId':Number(_0x549498[_0xd1b5('0x5a')]['id'])});}return _0x313904;});}})[_0xd1b5('0x28')](function(_0x4687e4){_0xb8e6cf=_0x4687e4||[];if(_0x180397){return db[_0xd1b5('0x72')][_0xd1b5('0x6b')]({'where':{'id':_0x549498[_0xd1b5('0x5d')][_0xd1b5('0x84')]},'attributes':['id',_0xd1b5('0x34'),_0xd1b5('0x74'),'voicePause',_0xd1b5('0x76')],'raw':!![]});}})[_0xd1b5('0x28')](function(_0x257311){if(!_['isEmpty'](_0x257311)){var _0xa998e4=[];for(var _0x15e2fc=0x0;_0x15e2fc<_0x257311['length'];_0x15e2fc++){if(_0x257311[_0x15e2fc][_0xd1b5('0x74')]){_0xa998e4[_0xd1b5('0x8e')](db[_0xd1b5('0x7e')][_0xd1b5('0x7d')]({'membername':_0x257311[_0x15e2fc][_0xd1b5('0x34')],'UserId':_0x257311[_0x15e2fc]['id'],'queue_name':_0x180397['name'],'VoiceQueueId':_0x180397['id'],'interface':_['isNil'](_0x257311[_0x15e2fc]['interface'])?util['format'](_0xd1b5('0x80'),_0x257311[_0x15e2fc][_0xd1b5('0x34')]):_0x257311[_0x15e2fc][_0xd1b5('0x76')],'paused':_0x257311[_0x15e2fc][_0xd1b5('0x75')]||![],'penalty':_0x549498[_0xd1b5('0x5d')][_0xd1b5('0x79')]||0x0}));}}return BPromise[_0xd1b5('0x94')](_0xa998e4);}})[_0xd1b5('0x28')](function(){return _0xb8e6cf;})[_0xd1b5('0x28')](respondWithResult(_0x2e3540,null))['catch'](handleError(_0x2e3540,null));};exports['removeAgents']=function(_0x196007,_0x5f496d,_0x2e1af0){return db[_0xd1b5('0x3b')][_0xd1b5('0x33')]({'where':{'id':_0x196007[_0xd1b5('0x5a')]['id']}})[_0xd1b5('0x28')](handleEntityNotFound(_0x5f496d,null))[_0xd1b5('0x28')](function(_0x2a2db8){if(_0x2a2db8){return _0x2a2db8[_0xd1b5('0x9b')](_0x196007[_0xd1b5('0x3e')][_0xd1b5('0x84')])[_0xd1b5('0x28')](function(){if(_[_0xd1b5('0x9c')](_0x196007[_0xd1b5('0x3e')][_0xd1b5('0x84')])){for(var _0x26fecc=0x0;_0x26fecc<_0x196007['query'][_0xd1b5('0x84')][_0xd1b5('0x45')];_0x26fecc+=0x1){socket[_0xd1b5('0x81')]('userVoiceQueue:remove',{'UserId':Number(_0x196007[_0xd1b5('0x3e')][_0xd1b5('0x84')][_0x26fecc]),'VoiceQueueId':Number(_0x196007['params']['id'])});}}else{socket[_0xd1b5('0x81')]('userVoiceQueue:remove',{'UserId':Number(_0x196007['query']['ids']),'VoiceQueueId':Number(_0x196007['params']['id'])});}});}})[_0xd1b5('0x28')](function(_0xeed2cc){return db[_0xd1b5('0x7e')][_0xd1b5('0x29')]({'where':{'VoiceQueueId':_0x196007[_0xd1b5('0x5a')]['id'],'UserId':_0x196007[_0xd1b5('0x3e')][_0xd1b5('0x84')]}})['then'](function(){return _0xeed2cc;});})['then'](respondWithStatusCode(_0x5f496d,null))['catch'](handleError(_0x5f496d,null));};exports['getAgents']=function(_0x1464a8,_0x21a148,_0x51cf2d){var _0x29fbaf={};var _0x466a8b={};var _0x3cd9c0;var _0x10dcf4;return db[_0xd1b5('0x3b')]['findOne']({'where':{'id':_0x1464a8[_0xd1b5('0x5a')]['id']}})[_0xd1b5('0x28')](handleEntityNotFound(_0x21a148,null))[_0xd1b5('0x28')](function(_0x3e0266){if(_0x3e0266){_0x3cd9c0=_0x3e0266;_0x466a8b[_0xd1b5('0x42')]=_[_0xd1b5('0x3f')](db['User'][_0xd1b5('0x3c')]);_0x466a8b[_0xd1b5('0x3e')]=_[_0xd1b5('0x3f')](_0x1464a8[_0xd1b5('0x3e')]);_0x466a8b[_0xd1b5('0x40')]=_[_0xd1b5('0x41')](_0x466a8b[_0xd1b5('0x42')],_0x466a8b['query']);_0x29fbaf[_0xd1b5('0x43')]=_[_0xd1b5('0x41')](_0x466a8b[_0xd1b5('0x42')],qs[_0xd1b5('0x44')](_0x1464a8[_0xd1b5('0x3e')]['fields']));_0x29fbaf[_0xd1b5('0x43')]=_0x29fbaf['attributes']['length']?_0x29fbaf[_0xd1b5('0x43')]:_0x466a8b[_0xd1b5('0x42')];_0x29fbaf[_0xd1b5('0x47')]=qs[_0xd1b5('0x48')](_0x1464a8['query'][_0xd1b5('0x48')]);_0x29fbaf[_0xd1b5('0x49')]=qs['filters'](_[_0xd1b5('0x4a')](_0x1464a8[_0xd1b5('0x3e')],_0x466a8b[_0xd1b5('0x40')]));if(_0x1464a8[_0xd1b5('0x3e')][_0xd1b5('0x2e')]){_0x29fbaf[_0xd1b5('0x49')]=_[_0xd1b5('0x4b')](_0x29fbaf[_0xd1b5('0x49')],{'$or':_[_0xd1b5('0x3a')](_0x29fbaf['attributes'],function(_0x3b2778){var _0x3a37f2={};_0x3a37f2[_0x3b2778]={'$like':'%'+_0x1464a8[_0xd1b5('0x3e')][_0xd1b5('0x2e')]+'%'};return _0x3a37f2;})});}_0x29fbaf=_[_0xd1b5('0x4b')]({},_0x29fbaf,_0x1464a8[_0xd1b5('0x4d')]);return _0x3cd9c0[_0xd1b5('0x9d')](_0x29fbaf);}})[_0xd1b5('0x28')](function(_0x6036fd){if(_0x6036fd){_0x10dcf4=_0x6036fd[_0xd1b5('0x45')];if(!_0x1464a8[_0xd1b5('0x3e')]['hasOwnProperty'](_0xd1b5('0x65'))){_0x29fbaf['limit']=qs[_0xd1b5('0x20')](_0x1464a8[_0xd1b5('0x3e')][_0xd1b5('0x20')]);_0x29fbaf[_0xd1b5('0x1e')]=qs[_0xd1b5('0x1e')](_0x1464a8['query'][_0xd1b5('0x1e')]);}return _0x3cd9c0[_0xd1b5('0x9d')](_0x29fbaf);}})['then'](function(_0x19e3c7){if(_0x19e3c7){return _0x19e3c7?{'count':_0x10dcf4,'rows':_0x19e3c7}:null;}})[_0xd1b5('0x28')](respondWithResult(_0x21a148,null))['catch'](handleError(_0x21a148,null));};exports[_0xd1b5('0x9e')]=function(_0x56c781,_0x3b4869,_0x2e63b2){var _0x127c94={};var _0x2b9bb3={};var _0x345398;var _0xe6d48c;return db[_0xd1b5('0x3b')][_0xd1b5('0x63')]({'where':{'id':_0x56c781['params']['id']}})[_0xd1b5('0x28')](handleEntityNotFound(_0x3b4869,null))[_0xd1b5('0x28')](function(_0x3b3377){if(_0x3b3377){_0x345398=_0x3b3377;_0x2b9bb3[_0xd1b5('0x42')]=_[_0xd1b5('0x3f')](db['UserVoiceQueueRt'][_0xd1b5('0x3c')]);_0x2b9bb3[_0xd1b5('0x3e')]=_[_0xd1b5('0x3f')](_0x56c781[_0xd1b5('0x3e')]);_0x2b9bb3[_0xd1b5('0x40')]=_[_0xd1b5('0x41')](_0x2b9bb3[_0xd1b5('0x42')],_0x2b9bb3['query']);_0x127c94[_0xd1b5('0x43')]=_[_0xd1b5('0x41')](_0x2b9bb3[_0xd1b5('0x42')],qs[_0xd1b5('0x44')](_0x56c781[_0xd1b5('0x3e')][_0xd1b5('0x44')]));_0x127c94[_0xd1b5('0x43')]=_0x127c94[_0xd1b5('0x43')]['length']?_0x127c94[_0xd1b5('0x43')]:_0x2b9bb3[_0xd1b5('0x42')];_0x127c94[_0xd1b5('0x47')]=qs['sort'](_0x56c781[_0xd1b5('0x3e')][_0xd1b5('0x48')]);_0x127c94[_0xd1b5('0x49')]=qs['filters'](_[_0xd1b5('0x4a')](_0x56c781['query'],_0x2b9bb3[_0xd1b5('0x40')]));if(_0x56c781[_0xd1b5('0x3e')][_0xd1b5('0x2e')]){_0x127c94[_0xd1b5('0x49')]=_[_0xd1b5('0x4b')](_0x127c94[_0xd1b5('0x49')],{'$or':_[_0xd1b5('0x3a')](_0x127c94[_0xd1b5('0x43')],function(_0x1abb25){var _0x1a780b={};_0x1a780b[_0x1abb25]={'$like':'%'+_0x56c781[_0xd1b5('0x3e')][_0xd1b5('0x2e')]+'%'};return _0x1a780b;})});}_0x127c94=_[_0xd1b5('0x4b')]({},_0x127c94,_0x56c781[_0xd1b5('0x4d')]);return _0x345398[_0xd1b5('0x9e')](_0x127c94);}})[_0xd1b5('0x28')](function(_0x125e97){if(_0x125e97){_0xe6d48c=_0x125e97[_0xd1b5('0x45')];if(!_0x56c781[_0xd1b5('0x3e')][_0xd1b5('0x46')]('nolimit')){_0x127c94[_0xd1b5('0x20')]=qs['limit'](_0x56c781[_0xd1b5('0x3e')]['limit']);_0x127c94[_0xd1b5('0x1e')]=qs[_0xd1b5('0x1e')](_0x56c781[_0xd1b5('0x3e')][_0xd1b5('0x1e')]);}return _0x345398[_0xd1b5('0x9e')](_0x127c94);}})['then'](function(_0x4d7c7a){return _0x4d7c7a?{'count':_0xe6d48c,'rows':_0x4d7c7a}:null;})[_0xd1b5('0x28')](respondWithResult(_0x3b4869,null))[_0xd1b5('0x50')](handleError(_0x3b4869,null));};exports[_0xd1b5('0x9f')]=function(_0x2e41a6,_0x1159b1,_0x50398f){var _0x22dc09={};var _0x71648d={};var _0x1eb5f9;var _0x17300b;return db[_0xd1b5('0x3b')][_0xd1b5('0x63')]({'where':{'id':_0x2e41a6[_0xd1b5('0x5a')]['id']}})['then'](handleEntityNotFound(_0x1159b1,null))[_0xd1b5('0x28')](function(_0x556eb5){if(_0x556eb5){_0x1eb5f9=_0x556eb5;_0x71648d['model']=_['keys'](db[_0xd1b5('0xa0')][_0xd1b5('0x3c')]);_0x71648d[_0xd1b5('0x3e')]=_['keys'](_0x2e41a6[_0xd1b5('0x3e')]);_0x71648d[_0xd1b5('0x40')]=_[_0xd1b5('0x41')](_0x71648d[_0xd1b5('0x42')],_0x71648d[_0xd1b5('0x3e')]);_0x22dc09[_0xd1b5('0x43')]=_[_0xd1b5('0x41')](_0x71648d[_0xd1b5('0x42')],qs[_0xd1b5('0x44')](_0x2e41a6[_0xd1b5('0x3e')][_0xd1b5('0x44')]));_0x22dc09[_0xd1b5('0x43')]=_0x22dc09[_0xd1b5('0x43')][_0xd1b5('0x45')]?_0x22dc09[_0xd1b5('0x43')]:_0x71648d['model'];_0x22dc09[_0xd1b5('0x47')]=qs[_0xd1b5('0x48')](_0x2e41a6[_0xd1b5('0x3e')][_0xd1b5('0x48')]);_0x22dc09['where']=qs['filters'](_['pick'](_0x2e41a6['query'],_0x71648d[_0xd1b5('0x40')]));if(_0x2e41a6[_0xd1b5('0x3e')]['filter']){_0x22dc09[_0xd1b5('0x49')]=_[_0xd1b5('0x4b')](_0x22dc09[_0xd1b5('0x49')],{'$or':_['map'](_0x22dc09[_0xd1b5('0x43')],function(_0x470ac7){var _0x2b5201={};_0x2b5201[_0x470ac7]={'$like':'%'+_0x2e41a6['query'][_0xd1b5('0x2e')]+'%'};return _0x2b5201;})});}_0x22dc09=_[_0xd1b5('0x4b')]({},_0x22dc09,_0x2e41a6[_0xd1b5('0x4d')]);return _0x1eb5f9['getLists'](_0x22dc09);}})[_0xd1b5('0x28')](function(_0x4710bc){if(_0x4710bc){_0x17300b=_0x4710bc['length'];if(!_0x2e41a6[_0xd1b5('0x3e')][_0xd1b5('0x46')](_0xd1b5('0x65'))){_0x22dc09[_0xd1b5('0x20')]=qs[_0xd1b5('0x20')](_0x2e41a6[_0xd1b5('0x3e')][_0xd1b5('0x20')]);_0x22dc09['offset']=qs[_0xd1b5('0x1e')](_0x2e41a6['query'][_0xd1b5('0x1e')]);}return _0x1eb5f9[_0xd1b5('0x9f')](_0x22dc09);}})[_0xd1b5('0x28')](function(_0x5d73ca){if(_0x5d73ca){return _0x5d73ca?{'count':_0x17300b,'rows':_0x5d73ca}:null;}})[_0xd1b5('0x28')](respondWithResult(_0x1159b1,null))[_0xd1b5('0x50')](handleError(_0x1159b1,null));};exports[_0xd1b5('0xa1')]=function(_0x5054ef,_0x166f0a,_0x55edc3){var _0x2b2d8a,_0xd4567a;return db[_0xd1b5('0x3b')][_0xd1b5('0x33')]({'where':{'id':_0x5054ef[_0xd1b5('0x5a')]['id']}})[_0xd1b5('0x28')](handleEntityNotFound(_0x166f0a,null))[_0xd1b5('0x28')](function(_0x12b8a3){if(_0x12b8a3){_0xd4567a=_0x12b8a3;return _0x12b8a3[_0xd1b5('0xa1')](_0x5054ef[_0xd1b5('0x5d')][_0xd1b5('0x84')],_[_0xd1b5('0x5e')](_0x5054ef[_0xd1b5('0x5d')],[_0xd1b5('0x84'),'id'])||{});}return null;})[_0xd1b5('0x9a')](function(_0x238908){var _0xec392;_0x2b2d8a=_0x238908||[];var _0xf2fd7c=[];if(_0x238908){for(var _0x519abe=0x0;_0x519abe<_0x238908[_0xd1b5('0x45')];_0x519abe+=0x1){var _0x2ad49d=_0x238908[_0x519abe][_0xd1b5('0x55')]({'plain':!![]});_0xd4567a['dialCheckDuplicateType']=_0x5054ef['body'][_0xd1b5('0xa2')]?_0x5054ef[_0xd1b5('0x5d')]['dialCheckDuplicateType']:_0xd4567a[_0xd1b5('0xa2')];switch(_0xd4567a['dialCheckDuplicateType']){case _0xd1b5('0xa3'):_0xec392=squel['insert']()[_0xd1b5('0xa4')](_0xd1b5('0xa5'))[_0xd1b5('0xa6')]([_0xd1b5('0xa7'),_0xd1b5('0xa8'),_0xd1b5('0xa9'),_0xd1b5('0xaa'),'VoiceQueueId','createdAt','updatedAt'],squel[_0xd1b5('0x85')]()[_0xd1b5('0x86')](_0xd1b5('0xa7'),_0xd1b5('0xa7'))[_0xd1b5('0x86')](_0xd1b5('0xab'),_0xd1b5('0xa8'))['field']('id','ContactId')['field'](_0x2ad49d[_0xd1b5('0xac')]['toString'](),_0xd1b5('0xaa'))['field'](_0x5054ef[_0xd1b5('0x5a')]['id'][_0xd1b5('0x8f')](),_0xd1b5('0x66'))['field']('NOW()',_0xd1b5('0x5b'))[_0xd1b5('0x86')](_0xd1b5('0xab'),_0xd1b5('0x5c'))['from'](_0xd1b5('0xad'))['where'](_0xd1b5('0xae'))[_0xd1b5('0x49')](_0xd1b5('0xaf'),_0x2ad49d[_0xd1b5('0xac')][_0xd1b5('0x8f')]())[_0xd1b5('0x49')](_0xd1b5('0xb0'))[_0xd1b5('0x49')](_0xd1b5('0xb1'),squel[_0xd1b5('0x85')]()[_0xd1b5('0x86')]('COALESCE(calleridnum,\x27\x27)')['from'](_0xd1b5('0xb2'))[_0xd1b5('0x49')](_0xd1b5('0x8d'),_0x5054ef[_0xd1b5('0x5a')]['id'][_0xd1b5('0x8f')]()))[_0xd1b5('0x49')](_0xd1b5('0xb1'),squel[_0xd1b5('0x85')]()['field'](_0xd1b5('0xb3'))[_0xd1b5('0x88')]('cm_hopper')[_0xd1b5('0x49')](_0xd1b5('0x8d'),_0x5054ef[_0xd1b5('0x5a')]['id'][_0xd1b5('0x8f')]())))[_0xd1b5('0x8f')]();break;case _0xd1b5('0xb4'):_0xec392=squel['insert']()['into'](_0xd1b5('0xa5'))[_0xd1b5('0xa6')]([_0xd1b5('0xa7'),'scheduledAt','ContactId',_0xd1b5('0xaa'),'VoiceQueueId',_0xd1b5('0x5b'),_0xd1b5('0x5c')],squel[_0xd1b5('0x85')]()[_0xd1b5('0x86')]('phone',_0xd1b5('0xa7'))['field'](_0xd1b5('0xab'),_0xd1b5('0xa8'))['field']('id',_0xd1b5('0xa9'))['field'](_0x2ad49d[_0xd1b5('0xac')][_0xd1b5('0x8f')](),_0xd1b5('0xaa'))[_0xd1b5('0x86')](_0x5054ef[_0xd1b5('0x5a')]['id'][_0xd1b5('0x8f')](),'VoiceQueueId')[_0xd1b5('0x86')](_0xd1b5('0xab'),_0xd1b5('0x5b'))[_0xd1b5('0x86')](_0xd1b5('0xab'),_0xd1b5('0x5c'))[_0xd1b5('0x88')]('cm_contacts')[_0xd1b5('0x49')](_0xd1b5('0xae'))[_0xd1b5('0x49')]('ListId\x20=\x20?',_0x2ad49d[_0xd1b5('0xac')]['toString']())['where']('phone\x20IS\x20NOT\x20NULL')[_0xd1b5('0x49')](_0xd1b5('0xb1'),squel[_0xd1b5('0x85')]()['field'](_0xd1b5('0xb3'))[_0xd1b5('0x88')](_0xd1b5('0xa5'))[_0xd1b5('0x49')](_0xd1b5('0x8d'),_0x5054ef['params']['id'][_0xd1b5('0x8f')]())))[_0xd1b5('0x8f')]();break;default:_0xec392=squel[_0xd1b5('0xb5')]()[_0xd1b5('0xa4')](_0xd1b5('0xa5'))[_0xd1b5('0xa6')]([_0xd1b5('0xa7'),_0xd1b5('0xa8'),_0xd1b5('0xa9'),_0xd1b5('0xaa'),'VoiceQueueId',_0xd1b5('0x5b'),_0xd1b5('0x5c')],squel[_0xd1b5('0x85')]()[_0xd1b5('0x86')]('phone','phone')[_0xd1b5('0x86')](_0xd1b5('0xab'),_0xd1b5('0xa8'))[_0xd1b5('0x86')]('id',_0xd1b5('0xa9'))[_0xd1b5('0x86')](_0x2ad49d[_0xd1b5('0xac')][_0xd1b5('0x8f')](),_0xd1b5('0xaa'))[_0xd1b5('0x86')](_0x5054ef[_0xd1b5('0x5a')]['id'][_0xd1b5('0x8f')](),_0xd1b5('0x66'))[_0xd1b5('0x86')](_0xd1b5('0xab'),_0xd1b5('0x5b'))['field'](_0xd1b5('0xab'),_0xd1b5('0x5c'))[_0xd1b5('0x88')](_0xd1b5('0xad'))[_0xd1b5('0x49')](_0xd1b5('0xae'))['where'](_0xd1b5('0xaf'),_0x2ad49d[_0xd1b5('0xac')][_0xd1b5('0x8f')]())[_0xd1b5('0x49')](_0xd1b5('0xb0')))['toString']();}_0xf2fd7c[_0xd1b5('0x8e')](db[_0xd1b5('0x7a')][_0xd1b5('0x3e')](_0xec392));}return BPromise[_0xd1b5('0x94')](_0xf2fd7c);}})[_0xd1b5('0x28')](function(){return _0x2b2d8a;})['then'](respondWithResult(_0x166f0a,null))[_0xd1b5('0x50')](handleError(_0x166f0a,null));};exports['removeLists']=function(_0x399a08,_0x493f26,_0x2cf82f){return db[_0xd1b5('0x3b')][_0xd1b5('0x33')]({'where':{'id':_0x399a08[_0xd1b5('0x5a')]['id']}})[_0xd1b5('0x28')](handleEntityNotFound(_0x493f26,null))[_0xd1b5('0x28')](function(_0x3c6137){if(_0x3c6137){return _0x3c6137['removeLists'](_0x399a08[_0xd1b5('0x3e')][_0xd1b5('0x84')]);}})[_0xd1b5('0x28')](function(_0x1cc5bc){if(_0x1cc5bc){return db[_0xd1b5('0x64')]['destroy']({'where':{'ListId':_0x399a08[_0xd1b5('0x3e')][_0xd1b5('0x84')],'VoiceQueueId':_0x399a08[_0xd1b5('0x5a')]['id']}})['then'](function(){return _0x1cc5bc;});}})['then'](respondWithStatusCode(_0x493f26,null))['catch'](handleError(_0x493f26,null));};exports[_0xd1b5('0xb6')]=function(_0x9e0de3,_0x1a4f61,_0x137386){var _0x18eb16={};var _0x37e01f={};var _0x45a97e;var _0x56c3ec;return db[_0xd1b5('0x3b')][_0xd1b5('0x63')]({'where':{'id':_0x9e0de3['params']['id']}})[_0xd1b5('0x28')](handleEntityNotFound(_0x1a4f61,null))[_0xd1b5('0x28')](function(_0x42fdb4){if(_0x42fdb4){_0x45a97e=_0x42fdb4;_0x37e01f[_0xd1b5('0x42')]=_[_0xd1b5('0x3f')](db['CmList']['rawAttributes']);_0x37e01f[_0xd1b5('0x3e')]=_[_0xd1b5('0x3f')](_0x9e0de3['query']);_0x37e01f[_0xd1b5('0x40')]=_[_0xd1b5('0x41')](_0x37e01f[_0xd1b5('0x42')],_0x37e01f[_0xd1b5('0x3e')]);_0x18eb16[_0xd1b5('0x43')]=_[_0xd1b5('0x41')](_0x37e01f[_0xd1b5('0x42')],qs[_0xd1b5('0x44')](_0x9e0de3[_0xd1b5('0x3e')][_0xd1b5('0x44')]));_0x18eb16[_0xd1b5('0x43')]=_0x18eb16['attributes'][_0xd1b5('0x45')]?_0x18eb16[_0xd1b5('0x43')]:_0x37e01f[_0xd1b5('0x42')];_0x18eb16['order']=qs['sort'](_0x9e0de3[_0xd1b5('0x3e')]['sort']);_0x18eb16['where']=qs[_0xd1b5('0x40')](_[_0xd1b5('0x4a')](_0x9e0de3['query'],_0x37e01f[_0xd1b5('0x40')]));if(_0x9e0de3[_0xd1b5('0x3e')][_0xd1b5('0x2e')]){_0x18eb16[_0xd1b5('0x49')]=_[_0xd1b5('0x4b')](_0x18eb16[_0xd1b5('0x49')],{'$or':_['map'](_0x18eb16['attributes'],function(_0x374be5){var _0x4cb6f2={};_0x4cb6f2[_0x374be5]={'$like':'%'+_0x9e0de3['query']['filter']+'%'};return _0x4cb6f2;})});}_0x18eb16=_[_0xd1b5('0x4b')]({},_0x18eb16,_0x9e0de3[_0xd1b5('0x4d')]);return _0x45a97e[_0xd1b5('0xb6')](_0x18eb16);}})[_0xd1b5('0x28')](function(_0x5c3c89){if(_0x5c3c89){_0x56c3ec=_0x5c3c89[_0xd1b5('0x45')];if(!_0x9e0de3[_0xd1b5('0x3e')]['hasOwnProperty'](_0xd1b5('0x65'))){_0x18eb16[_0xd1b5('0x20')]=qs[_0xd1b5('0x20')](_0x9e0de3['query'][_0xd1b5('0x20')]);_0x18eb16['offset']=qs[_0xd1b5('0x1e')](_0x9e0de3['query']['offset']);}return _0x45a97e[_0xd1b5('0xb6')](_0x18eb16);}})[_0xd1b5('0x28')](function(_0x157eb4){if(_0x157eb4){return _0x157eb4?{'count':_0x56c3ec,'rows':_0x157eb4}:null;}})[_0xd1b5('0x28')](respondWithResult(_0x1a4f61,null))[_0xd1b5('0x50')](handleError(_0x1a4f61,null));};exports[_0xd1b5('0xb7')]=function(_0x24e655,_0x1f3f71,_0x556048){var _0x2f3ff2,_0xcd214a;return db[_0xd1b5('0x3b')]['find']({'where':{'id':_0x24e655[_0xd1b5('0x5a')]['id']}})[_0xd1b5('0x28')](handleEntityNotFound(_0x1f3f71,null))[_0xd1b5('0x28')](function(_0x291ca7){if(_0x291ca7){_0xcd214a=_0x291ca7;return _0x291ca7[_0xd1b5('0xb7')](_0x24e655[_0xd1b5('0x5d')][_0xd1b5('0x84')],_[_0xd1b5('0x5e')](_0x24e655[_0xd1b5('0x5d')],[_0xd1b5('0x84'),'id'])||{});}return null;})[_0xd1b5('0x9a')](function(_0x577745){var _0x2db39f;_0x2f3ff2=_0x577745||[];var _0x33b19e=[];if(_0x577745){for(var _0x5ba7fa=0x0;_0x5ba7fa<_0x577745['length'];_0x5ba7fa+=0x1){var _0x2a9e42=_0x577745[_0x5ba7fa][_0xd1b5('0x55')]({'plain':!![]});_0x2db39f=squel[_0xd1b5('0xb5')]()['into'](_0xd1b5('0xb8'))['fromQuery']([_0xd1b5('0xa7'),_0xd1b5('0xa9'),_0xd1b5('0xaa'),_0xd1b5('0x66'),'createdAt',_0xd1b5('0x5c')],squel[_0xd1b5('0x85')]()[_0xd1b5('0x86')](_0xd1b5('0xa7'),_0xd1b5('0xa7'))[_0xd1b5('0x86')]('id',_0xd1b5('0xa9'))[_0xd1b5('0x86')](_0x2a9e42[_0xd1b5('0xac')]['toString'](),_0xd1b5('0xaa'))[_0xd1b5('0x86')](_0x24e655['params']['id']['toString'](),_0xd1b5('0x66'))[_0xd1b5('0x86')](_0xd1b5('0xab'),_0xd1b5('0x5b'))[_0xd1b5('0x86')](_0xd1b5('0xab'),_0xd1b5('0x5c'))[_0xd1b5('0x88')](_0xd1b5('0xad'))['where']('deletedAt\x20IS\x20NULL')[_0xd1b5('0x49')](_0xd1b5('0xaf'),_0x2a9e42[_0xd1b5('0xac')][_0xd1b5('0x8f')]())[_0xd1b5('0x49')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x33b19e[_0xd1b5('0x8e')](db[_0xd1b5('0x7a')]['query'](_0x2db39f));}return BPromise[_0xd1b5('0x94')](_0x33b19e);}})['then'](function(){return _0x2f3ff2;})['then'](respondWithResult(_0x1f3f71,null))[_0xd1b5('0x50')](handleError(_0x1f3f71,null));};exports[_0xd1b5('0xb9')]=function(_0x4644e5,_0x5d07e5,_0x90e62f){return db['VoiceQueue']['find']({'where':{'id':_0x4644e5['params']['id']}})[_0xd1b5('0x28')](handleEntityNotFound(_0x5d07e5,null))[_0xd1b5('0x28')](function(_0x594941){if(_0x594941){return _0x594941[_0xd1b5('0xb9')](_0x4644e5[_0xd1b5('0x3e')][_0xd1b5('0x84')]);}})[_0xd1b5('0x28')](function(_0x505543){if(_0x505543){return db[_0xd1b5('0x6d')][_0xd1b5('0x29')]({'where':{'ListId':_0x4644e5['query'][_0xd1b5('0x84')],'VoiceQueueId':_0x4644e5[_0xd1b5('0x5a')]['id']}})[_0xd1b5('0x28')](function(){return _0x505543;});}})[_0xd1b5('0x28')](respondWithStatusCode(_0x5d07e5,null))[_0xd1b5('0x50')](handleError(_0x5d07e5,null));}; \ No newline at end of file +var _0xc131=['pick','VoiceQueueId','findAll','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','Team','getTeams','teams','User','online','voicePause','flatMap','forEach','penalty','Agents','transaction','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','interface','SIP/%s','emit','select','tq.TeamId','from','team_has_voice_queues','clone','push','sequelize','QueryTypes','TeamId','all','compact','ids','isEmpty','removeAgents','addAgents','spread','format','userVoiceQueue:remove','getAgents','getMembers','getLists','addLists','dialCheckDuplicateType','insert','into','fromQuery','phone','scheduledAt','ListId','field','NOW()','ContactId','CmListId','toString','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','cm_hopper_final','VoiceQueueId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','cm_hopper','phone\x20IS\x20NOT\x20NULL','cm_contacts','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','sendStatus','status','end','offset','limit','undefined','count','set','apply','save','update','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','map','value','includes','type','UserProfileResource','error','stack','name','VoiceQueue','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','includeAll','include','rows','catch','show','params','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','body','outbound','userProfileId','findOne','CmHopper'];(function(_0x20f89e,_0x1419f0){var _0x5888db=function(_0x20eb98){while(--_0x20eb98){_0x20f89e['push'](_0x20f89e['shift']());}};_0x5888db(++_0x1419f0);}(_0xc131,0x1b5));var _0x1c13=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xc131[_0xfae23b];return _0x200640;};'use strict';var emlformat=require(_0x1c13('0x0'));var rimraf=require(_0x1c13('0x1'));var zipdir=require(_0x1c13('0x2'));var jsonpatch=require(_0x1c13('0x3'));var rp=require(_0x1c13('0x4'));var moment=require(_0x1c13('0x5'));var BPromise=require(_0x1c13('0x6'));var Mustache=require(_0x1c13('0x7'));var util=require('util');var path=require('path');var sox=require(_0x1c13('0x8'));var csv=require(_0x1c13('0x9'));var ejs=require(_0x1c13('0xa'));var fs=require('fs');var fs_extra=require(_0x1c13('0xb'));var _=require(_0x1c13('0xc'));var squel=require(_0x1c13('0xd'));var crypto=require(_0x1c13('0xe'));var jsforce=require(_0x1c13('0xf'));var deskjs=require(_0x1c13('0x10'));var toCsv=require(_0x1c13('0x9'));var querystring=require('querystring');var Papa=require(_0x1c13('0x11'));var Redis=require(_0x1c13('0x12'));var authService=require(_0x1c13('0x13'));var qs=require(_0x1c13('0x14'));var as=require(_0x1c13('0x15'));var hardwareService=require(_0x1c13('0x16'));var logger=require(_0x1c13('0x17'))(_0x1c13('0x18'));var utils=require(_0x1c13('0x19'));var config=require(_0x1c13('0x1a'));var licenseUtil=require(_0x1c13('0x1b'));var db=require(_0x1c13('0x1c'))['db'];config[_0x1c13('0x1d')]=_[_0x1c13('0x1e')](config[_0x1c13('0x1d')],{'host':_0x1c13('0x1f'),'port':0x18eb});var socket=require(_0x1c13('0x20'))(new Redis(config[_0x1c13('0x1d')]));require(_0x1c13('0x21'))['register'](socket);function respondWithStatusCode(_0x3e6ccb,_0x2e9d2d){_0x2e9d2d=_0x2e9d2d||0xcc;return function(_0x1f9adc){if(_0x1f9adc){return _0x3e6ccb[_0x1c13('0x22')](_0x2e9d2d);}return _0x3e6ccb[_0x1c13('0x23')](_0x2e9d2d)[_0x1c13('0x24')]();};}function respondWithResult(_0x267f83,_0x2b17d1){_0x2b17d1=_0x2b17d1||0xc8;return function(_0x12eade){if(_0x12eade){return _0x267f83[_0x1c13('0x23')](_0x2b17d1)['json'](_0x12eade);}};}function respondWithFilteredResult(_0x55fc8a,_0x277325){return function(_0x194e28){if(_0x194e28){var _0x5b0fe6=typeof _0x277325[_0x1c13('0x25')]==='undefined'&&typeof _0x277325[_0x1c13('0x26')]===_0x1c13('0x27');var _0x1ad106=_0x194e28['count'];var _0x31ccf1=_0x5b0fe6?0x0:_0x277325[_0x1c13('0x25')];var _0x464ee3=_0x5b0fe6?_0x194e28[_0x1c13('0x28')]:_0x277325[_0x1c13('0x25')]+_0x277325['limit'];var _0x4b7694;if(_0x464ee3>=_0x1ad106){_0x464ee3=_0x1ad106;_0x4b7694=0xc8;}else{_0x4b7694=0xce;}_0x55fc8a[_0x1c13('0x23')](_0x4b7694);return _0x55fc8a[_0x1c13('0x29')]('Content-Range',_0x31ccf1+'-'+_0x464ee3+'/'+_0x1ad106)['json'](_0x194e28);}return null;};}function patchUpdates(_0x37c266){return function(_0x2e46f9){try{jsonpatch[_0x1c13('0x2a')](_0x2e46f9,_0x37c266,!![]);}catch(_0x41b15a){return BPromise['reject'](_0x41b15a);}return _0x2e46f9[_0x1c13('0x2b')]();};}function saveUpdates(_0x1b42b5,_0x4a927e){return function(_0x14148f){if(_0x14148f){return _0x14148f[_0x1c13('0x2c')](_0x1b42b5)[_0x1c13('0x2d')](function(_0x5056f4){return _0x5056f4;});}return null;};}function removeEntity(_0xc9d8c4,_0x38b367){return function(_0x522f2b){if(_0x522f2b){return _0x522f2b[_0x1c13('0x2e')]()['then'](function(){var _0x3bcc09=_0x522f2b[_0x1c13('0x2f')]({'plain':!![]});var _0x389ed2=[{'name':_0x1c13('0x30'),'value':_0x1c13('0x31'),'ignore':![]},{'name':_0x1c13('0x32'),'value':'outbound','ignore':![]}];var _0x1fd7f3=_(_0x389ed2)['filter']('ignore')[_0x1c13('0x33')](_0x1c13('0x34'))[_0x1c13('0x34')]();if(_[_0x1c13('0x35')](_0x1fd7f3,_0x3bcc09[_0x1c13('0x36')])){return;}var _0x530a0a=_['find'](_0x389ed2,[_0x1c13('0x34'),_0x3bcc09['type']])['name'];return db[_0x1c13('0x37')]['destroy']({'where':{'type':_0x530a0a,'resourceId':_0x3bcc09['id']}})[_0x1c13('0x2d')](function(){return _0x522f2b;});})['then'](function(){_0xc9d8c4['status'](0xcc)[_0x1c13('0x24')]();});}};}function handleEntityNotFound(_0x470973,_0xd009a){return function(_0x41f718){if(!_0x41f718){_0x470973[_0x1c13('0x22')](0x194);}return _0x41f718;};}function handleError(_0x4f0ff3,_0xfbb0c1){_0xfbb0c1=_0xfbb0c1||0x1f4;return function(_0x46db90){logger[_0x1c13('0x38')](_0x46db90[_0x1c13('0x39')]);if(_0x46db90[_0x1c13('0x3a')]){delete _0x46db90['name'];}_0x4f0ff3[_0x1c13('0x23')](_0xfbb0c1)['send'](_0x46db90);};}exports['index']=function(_0x149513,_0x13bcb8){var _0x598a0b={},_0xa78320={},_0x2001c3={'count':0x0,'rows':[]};var _0x183368=_['map'](db[_0x1c13('0x3b')][_0x1c13('0x3c')],function(_0x2420ca){return{'name':_0x2420ca[_0x1c13('0x3d')],'type':_0x2420ca[_0x1c13('0x36')][_0x1c13('0x3e')]};});_0xa78320[_0x1c13('0x3f')]=_['map'](_0x183368,_0x1c13('0x3a'));_0xa78320['query']=_[_0x1c13('0x40')](_0x149513[_0x1c13('0x41')]);_0xa78320[_0x1c13('0x42')]=_[_0x1c13('0x43')](_0xa78320['model'],_0xa78320[_0x1c13('0x41')]);_0x598a0b[_0x1c13('0x44')]=_[_0x1c13('0x43')](_0xa78320[_0x1c13('0x3f')],qs[_0x1c13('0x45')](_0x149513[_0x1c13('0x41')][_0x1c13('0x45')]));_0x598a0b[_0x1c13('0x44')]=_0x598a0b[_0x1c13('0x44')][_0x1c13('0x46')]?_0x598a0b[_0x1c13('0x44')]:_0xa78320['model'];if(!_0x149513[_0x1c13('0x41')][_0x1c13('0x47')](_0x1c13('0x48'))){_0x598a0b[_0x1c13('0x26')]=qs[_0x1c13('0x26')](_0x149513[_0x1c13('0x41')][_0x1c13('0x26')]);_0x598a0b[_0x1c13('0x25')]=qs['offset'](_0x149513[_0x1c13('0x41')][_0x1c13('0x25')]);}_0x598a0b[_0x1c13('0x49')]=qs[_0x1c13('0x4a')](_0x149513[_0x1c13('0x41')][_0x1c13('0x4a')]);_0x598a0b['where']=qs[_0x1c13('0x42')](_['pick'](_0x149513['query'],_0xa78320[_0x1c13('0x42')]),_0x183368);if(_0x149513['query'][_0x1c13('0x4b')]){_0x598a0b['where']=_[_0x1c13('0x4c')](_0x598a0b['where'],{'$or':_[_0x1c13('0x33')](_0x183368,function(_0x165db6){if(_0x165db6['type']!=='VIRTUAL'){var _0x4ad0be={};_0x4ad0be[_0x165db6[_0x1c13('0x3a')]]={'$like':'%'+_0x149513['query']['filter']+'%'};return _0x4ad0be;}})});}_0x598a0b=_[_0x1c13('0x4c')]({},_0x598a0b,_0x149513['options']);var _0x35e5ea={'where':_0x598a0b[_0x1c13('0x4d')]};return db[_0x1c13('0x3b')][_0x1c13('0x28')](_0x35e5ea)['then'](function(_0x420472){_0x2001c3[_0x1c13('0x28')]=_0x420472;if(_0x149513['query'][_0x1c13('0x4e')]){_0x598a0b[_0x1c13('0x4f')]=[{'all':!![]}];}return db[_0x1c13('0x3b')]['findAll'](_0x598a0b);})[_0x1c13('0x2d')](function(_0x2ddecc){_0x2001c3[_0x1c13('0x50')]=_0x2ddecc;return _0x2001c3;})[_0x1c13('0x2d')](respondWithFilteredResult(_0x13bcb8,_0x598a0b))[_0x1c13('0x51')](handleError(_0x13bcb8,null));};exports[_0x1c13('0x52')]=function(_0x28daae,_0x140a82){var _0x14dfbc={'raw':![],'where':{'id':_0x28daae[_0x1c13('0x53')]['id']}},_0x5ec730={};_0x5ec730['model']=_['keys'](db[_0x1c13('0x3b')][_0x1c13('0x3c')]);_0x5ec730[_0x1c13('0x41')]=_['keys'](_0x28daae[_0x1c13('0x41')]);_0x5ec730['filters']=_['intersection'](_0x5ec730[_0x1c13('0x3f')],_0x5ec730['query']);_0x14dfbc[_0x1c13('0x44')]=_[_0x1c13('0x43')](_0x5ec730['model'],qs[_0x1c13('0x45')](_0x28daae['query']['fields']));_0x14dfbc[_0x1c13('0x44')]=_0x14dfbc[_0x1c13('0x44')][_0x1c13('0x46')]?_0x14dfbc[_0x1c13('0x44')]:_0x5ec730[_0x1c13('0x3f')];if(_0x28daae[_0x1c13('0x41')][_0x1c13('0x4e')]){_0x14dfbc[_0x1c13('0x4f')]=[{'all':!![]}];}_0x14dfbc=_[_0x1c13('0x4c')]({},_0x14dfbc,_0x28daae[_0x1c13('0x54')]);return db[_0x1c13('0x3b')][_0x1c13('0x55')](_0x14dfbc)['then'](handleEntityNotFound(_0x140a82,null))[_0x1c13('0x2d')](respondWithResult(_0x140a82,null))[_0x1c13('0x51')](handleError(_0x140a82,null));};exports[_0x1c13('0x56')]=function(_0x365261,_0x5360ab){return db[_0x1c13('0x3b')]['create'](_0x365261['body'],{})[_0x1c13('0x2d')](function(_0xe9821c){var _0x783832=_0x365261[_0x1c13('0x57')][_0x1c13('0x2f')]({'plain':!![]});if(!_0x783832)throw new Error(_0x1c13('0x58'));if(_0x783832[_0x1c13('0x59')]===_0x1c13('0x57')){var _0x4994b7=_0xe9821c[_0x1c13('0x2f')]({'plain':!![]});var _0x4dabba=[{'name':'VoiceQueues','value':_0x1c13('0x31')},{'name':_0x1c13('0x32'),'value':'outbound'}];var _0x9d9637=_[_0x1c13('0x55')](_0x4dabba,[_0x1c13('0x34'),_0x4994b7[_0x1c13('0x36')]])['name'];return db[_0x1c13('0x5a')]['find']({'where':{'name':_0x9d9637,'userProfileId':_0x783832['userProfileId']},'raw':!![]})[_0x1c13('0x2d')](function(_0x1b0b29){if(_0x1b0b29&&_0x1b0b29['autoAssociation']===0x0){return db[_0x1c13('0x37')][_0x1c13('0x56')]({'name':_0x4994b7['name'],'resourceId':_0x4994b7['id'],'type':_0x1b0b29[_0x1c13('0x3a')],'sectionId':_0x1b0b29['id']},{})[_0x1c13('0x2d')](function(){return _0xe9821c;});}else{return _0xe9821c;}})[_0x1c13('0x51')](function(_0x30c7db){logger[_0x1c13('0x38')](_0x1c13('0x5b'),_0x30c7db);throw _0x30c7db;});}return _0xe9821c;})['then'](respondWithResult(_0x5360ab,0xc9))['catch'](handleError(_0x5360ab,null));};exports['clone']=function(_0x4b942c,_0xb86ba5){var _0x262911={'where':{'id':_0x4b942c[_0x1c13('0x53')]['id']}},_0x59c32e={};_0x59c32e[_0x1c13('0x3f')]=_[_0x1c13('0x40')](db[_0x1c13('0x3b')][_0x1c13('0x3c')]);_0x262911[_0x1c13('0x44')]=_[_0x1c13('0x43')](_0x59c32e[_0x1c13('0x3f')],qs['fields'](_0x4b942c['query'][_0x1c13('0x45')]));_0x262911[_0x1c13('0x44')]=_0x262911[_0x1c13('0x44')][_0x1c13('0x46')]?_0x262911['attributes']:_0x59c32e[_0x1c13('0x3f')];if(_0x4b942c[_0x1c13('0x41')]['includeAll']){_0x262911[_0x1c13('0x4f')]=[{'all':!![]}];}_0x262911=_[_0x1c13('0x4c')]({},_0x262911,_0x4b942c[_0x1c13('0x54')]);return db['VoiceQueue'][_0x1c13('0x55')](_0x262911)['then'](handleEntityNotFound(_0xb86ba5,null))['then'](function(_0x2b861d){if(_0x2b861d){var _0x17abfd=_0x2b861d[_0x1c13('0x2f')]({'plain':!![]});_0x17abfd=qs[_0x1c13('0x5c')](_0x17abfd,['id',_0x1c13('0x5d'),_0x1c13('0x5e')]);_0x4b942c[_0x1c13('0x5f')]=_[_0x1c13('0x5c')](_0x4b942c['body'],['id',_0x1c13('0x5d'),'updatedAt']);return db[_0x1c13('0x3b')][_0x1c13('0x56')](_['merge'](_0x17abfd,_0x4b942c[_0x1c13('0x5f')]),{'include':_0x4b942c['query']['includeAll']?[{'all':!![]}]:undefined})[_0x1c13('0x2d')](function(_0x409d0c){var _0x101cf4=_0x4b942c[_0x1c13('0x57')][_0x1c13('0x2f')]({'plain':!![]});if(!_0x101cf4)throw new Error(_0x1c13('0x58'));if(_0x101cf4[_0x1c13('0x59')]===_0x1c13('0x57')){var _0xb28eb0=_0x409d0c[_0x1c13('0x2f')]({'plain':!![]});var _0x314fe2=[{'name':_0x1c13('0x30'),'value':_0x1c13('0x31')},{'name':_0x1c13('0x32'),'value':_0x1c13('0x60')}];var _0x34837c=_['find'](_0x314fe2,[_0x1c13('0x34'),_0xb28eb0['type']])[_0x1c13('0x3a')];return db['UserProfileSection']['find']({'where':{'name':_0x34837c,'userProfileId':_0x101cf4[_0x1c13('0x61')]},'raw':!![]})['then'](function(_0x287b2){if(_0x287b2&&_0x287b2['autoAssociation']===0x0){return db['UserProfileResource'][_0x1c13('0x56')]({'name':_0xb28eb0['name'],'resourceId':_0xb28eb0['id'],'type':_0x287b2[_0x1c13('0x3a')],'sectionId':_0x287b2['id']},{})[_0x1c13('0x2d')](function(){return _0x409d0c;});}else{return _0x409d0c;}})[_0x1c13('0x51')](function(_0x74e7b7){logger[_0x1c13('0x38')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x74e7b7);throw _0x74e7b7;});}return _0x409d0c;});}})[_0x1c13('0x2d')](respondWithResult(_0xb86ba5,0xc9))[_0x1c13('0x51')](handleError(_0xb86ba5,null));};exports['update']=function(_0x359d54,_0x43e8c1){if(_0x359d54[_0x1c13('0x5f')]['id']){delete _0x359d54[_0x1c13('0x5f')]['id'];}return db[_0x1c13('0x3b')][_0x1c13('0x55')]({'where':{'id':_0x359d54['params']['id']}})[_0x1c13('0x2d')](handleEntityNotFound(_0x43e8c1,null))[_0x1c13('0x2d')](saveUpdates(_0x359d54['body'],null))[_0x1c13('0x2d')](respondWithResult(_0x43e8c1,null))[_0x1c13('0x51')](handleError(_0x43e8c1,null));};exports[_0x1c13('0x2e')]=function(_0x13f4c8,_0x10ea13){return db[_0x1c13('0x3b')][_0x1c13('0x55')]({'where':{'id':_0x13f4c8[_0x1c13('0x53')]['id']}})[_0x1c13('0x2d')](handleEntityNotFound(_0x10ea13,null))['then'](removeEntity(_0x10ea13,null))[_0x1c13('0x51')](handleError(_0x10ea13,null));};exports['getHoppers']=function(_0x5c52ad,_0x139adb,_0x297912){var _0x14d4c7={'raw':![],'where':{}};var _0x28478e={};var _0x2069a8={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x1c13('0x62')]({'where':{'id':_0x5c52ad[_0x1c13('0x53')]['id']}})[_0x1c13('0x2d')](handleEntityNotFound(_0x139adb,null))['then'](function(_0x20aaaa){if(_0x20aaaa){_0x28478e[_0x1c13('0x3f')]=_['keys'](db[_0x1c13('0x63')][_0x1c13('0x3c')]);_0x28478e[_0x1c13('0x41')]=_[_0x1c13('0x40')](_0x5c52ad[_0x1c13('0x41')]);_0x28478e['filters']=_[_0x1c13('0x43')](_0x28478e[_0x1c13('0x3f')],_0x28478e[_0x1c13('0x41')]);_0x14d4c7[_0x1c13('0x44')]=_[_0x1c13('0x43')](_0x28478e['model'],qs[_0x1c13('0x45')](_0x5c52ad[_0x1c13('0x41')][_0x1c13('0x45')]));_0x14d4c7[_0x1c13('0x44')]=_0x14d4c7[_0x1c13('0x44')][_0x1c13('0x46')]?_0x14d4c7[_0x1c13('0x44')]:_0x28478e[_0x1c13('0x3f')];if(!_0x5c52ad[_0x1c13('0x41')][_0x1c13('0x47')](_0x1c13('0x48'))){_0x14d4c7[_0x1c13('0x26')]=qs[_0x1c13('0x26')](_0x5c52ad['query'][_0x1c13('0x26')]);_0x14d4c7['offset']=qs[_0x1c13('0x25')](_0x5c52ad[_0x1c13('0x41')][_0x1c13('0x25')]);}_0x14d4c7[_0x1c13('0x49')]=qs[_0x1c13('0x4a')](_0x5c52ad[_0x1c13('0x41')][_0x1c13('0x4a')]);_0x14d4c7[_0x1c13('0x4d')]=qs[_0x1c13('0x42')](_[_0x1c13('0x64')](_0x5c52ad['query'],_0x28478e[_0x1c13('0x42')]));_0x14d4c7['where'][_0x1c13('0x65')]=_0x20aaaa['id'];if(_0x5c52ad[_0x1c13('0x41')][_0x1c13('0x4b')]){_0x14d4c7[_0x1c13('0x4d')]=_['merge'](_0x14d4c7['where'],{'$or':_[_0x1c13('0x33')](_0x14d4c7['attributes'],function(_0x5204b4){var _0x1d5681={};_0x1d5681[_0x5204b4]={'$like':'%'+_0x5c52ad[_0x1c13('0x41')][_0x1c13('0x4b')]+'%'};return _0x1d5681;})});}_0x14d4c7=_[_0x1c13('0x4c')]({},_0x14d4c7,_0x5c52ad[_0x1c13('0x54')]);return db[_0x1c13('0x63')][_0x1c13('0x28')]({'where':_0x14d4c7[_0x1c13('0x4d')]})[_0x1c13('0x2d')](function(_0x128f46){_0x2069a8[_0x1c13('0x28')]=_0x128f46;if(_0x5c52ad[_0x1c13('0x41')][_0x1c13('0x4e')]){_0x14d4c7[_0x1c13('0x4f')]=[{'all':!![]}];}return db[_0x1c13('0x63')][_0x1c13('0x66')](_0x14d4c7);})[_0x1c13('0x2d')](function(_0x1b2719){_0x2069a8[_0x1c13('0x50')]=_0x1b2719;return _0x2069a8;});}})[_0x1c13('0x2d')](respondWithFilteredResult(_0x139adb,_0x14d4c7))[_0x1c13('0x51')](handleError(_0x139adb,null));};exports[_0x1c13('0x67')]=function(_0x5b165f,_0x2ef9cd,_0x43f31f){var _0x4cb581={'raw':!![],'where':{}};var _0x2d2ab6={};var _0x2bdc8b={'count':0x0,'rows':[]};return db[_0x1c13('0x3b')][_0x1c13('0x62')]({'where':{'id':_0x5b165f[_0x1c13('0x53')]['id']}})[_0x1c13('0x2d')](handleEntityNotFound(_0x2ef9cd,null))[_0x1c13('0x2d')](function(_0x943425){if(_0x943425){_0x2d2ab6[_0x1c13('0x3f')]=_['keys'](db['CmHopperHistory']['rawAttributes']);_0x2d2ab6['query']=_[_0x1c13('0x40')](_0x5b165f[_0x1c13('0x41')]);_0x2d2ab6[_0x1c13('0x42')]=_[_0x1c13('0x43')](_0x2d2ab6[_0x1c13('0x3f')],_0x2d2ab6[_0x1c13('0x41')]);_0x4cb581[_0x1c13('0x44')]=_[_0x1c13('0x43')](_0x2d2ab6[_0x1c13('0x3f')],qs['fields'](_0x5b165f[_0x1c13('0x41')][_0x1c13('0x45')]));_0x4cb581[_0x1c13('0x44')]=_0x4cb581[_0x1c13('0x44')][_0x1c13('0x46')]?_0x4cb581[_0x1c13('0x44')]:_0x2d2ab6[_0x1c13('0x3f')];if(!_0x5b165f['query'][_0x1c13('0x47')]('nolimit')){_0x4cb581[_0x1c13('0x26')]=qs[_0x1c13('0x26')](_0x5b165f[_0x1c13('0x41')][_0x1c13('0x26')]);_0x4cb581[_0x1c13('0x25')]=qs[_0x1c13('0x25')](_0x5b165f[_0x1c13('0x41')][_0x1c13('0x25')]);}_0x4cb581[_0x1c13('0x49')]=qs[_0x1c13('0x4a')](_0x5b165f['query'][_0x1c13('0x4a')]);_0x4cb581[_0x1c13('0x4d')]=qs[_0x1c13('0x42')](_[_0x1c13('0x64')](_0x5b165f[_0x1c13('0x41')],_0x2d2ab6[_0x1c13('0x42')]));_0x4cb581[_0x1c13('0x4d')][_0x1c13('0x65')]=_0x943425['id'];if(_0x5b165f[_0x1c13('0x41')][_0x1c13('0x4b')]){_0x4cb581[_0x1c13('0x4d')]=_[_0x1c13('0x4c')](_0x4cb581[_0x1c13('0x4d')],{'$or':_[_0x1c13('0x33')](_0x4cb581[_0x1c13('0x44')],function(_0x77f7a9){var _0x16b6c0={};_0x16b6c0[_0x77f7a9]={'$like':'%'+_0x5b165f[_0x1c13('0x41')][_0x1c13('0x4b')]+'%'};return _0x16b6c0;})});}_0x4cb581=_['merge']({},_0x4cb581,_0x5b165f[_0x1c13('0x54')]);return db[_0x1c13('0x68')][_0x1c13('0x28')]({'where':_0x4cb581[_0x1c13('0x4d')]})[_0x1c13('0x2d')](function(_0x3fb950){_0x2bdc8b[_0x1c13('0x28')]=_0x3fb950;if(_0x5b165f[_0x1c13('0x41')]['includeAll']){_0x4cb581[_0x1c13('0x4f')]=[{'all':!![]}];}return db[_0x1c13('0x68')][_0x1c13('0x66')](_0x4cb581);})['then'](function(_0x257f4a){_0x2bdc8b[_0x1c13('0x50')]=_0x257f4a;return _0x2bdc8b;});}})[_0x1c13('0x2d')](respondWithFilteredResult(_0x2ef9cd,_0x4cb581))[_0x1c13('0x51')](handleError(_0x2ef9cd,null));};exports[_0x1c13('0x69')]=function(_0x99a6f9,_0x3b49df,_0x2dd30f){var _0x40c5b6={'raw':!![],'where':{}};var _0x1a7621={};var _0x1a998f={'count':0x0,'rows':[]};return db[_0x1c13('0x3b')][_0x1c13('0x62')]({'where':{'id':_0x99a6f9[_0x1c13('0x53')]['id']}})[_0x1c13('0x2d')](handleEntityNotFound(_0x3b49df,null))[_0x1c13('0x2d')](function(_0x384366){if(_0x384366){_0x1a7621[_0x1c13('0x3f')]=_['keys'](db[_0x1c13('0x6a')][_0x1c13('0x3c')]);_0x1a7621['query']=_[_0x1c13('0x40')](_0x99a6f9[_0x1c13('0x41')]);_0x1a7621['filters']=_[_0x1c13('0x43')](_0x1a7621[_0x1c13('0x3f')],_0x1a7621[_0x1c13('0x41')]);_0x40c5b6[_0x1c13('0x44')]=_[_0x1c13('0x43')](_0x1a7621[_0x1c13('0x3f')],qs[_0x1c13('0x45')](_0x99a6f9['query'][_0x1c13('0x45')]));_0x40c5b6['attributes']=_0x40c5b6[_0x1c13('0x44')][_0x1c13('0x46')]?_0x40c5b6['attributes']:_0x1a7621[_0x1c13('0x3f')];if(!_0x99a6f9[_0x1c13('0x41')][_0x1c13('0x47')](_0x1c13('0x48'))){_0x40c5b6['limit']=qs[_0x1c13('0x26')](_0x99a6f9[_0x1c13('0x41')][_0x1c13('0x26')]);_0x40c5b6[_0x1c13('0x25')]=qs['offset'](_0x99a6f9[_0x1c13('0x41')]['offset']);}_0x40c5b6['order']=qs[_0x1c13('0x4a')](_0x99a6f9[_0x1c13('0x41')]['sort']);_0x40c5b6[_0x1c13('0x4d')]=qs[_0x1c13('0x42')](_[_0x1c13('0x64')](_0x99a6f9[_0x1c13('0x41')],_0x1a7621['filters']));_0x40c5b6[_0x1c13('0x4d')][_0x1c13('0x65')]=_0x384366['id'];if(_0x99a6f9[_0x1c13('0x41')][_0x1c13('0x4b')]){_0x40c5b6[_0x1c13('0x4d')]=_[_0x1c13('0x4c')](_0x40c5b6[_0x1c13('0x4d')],{'$or':_[_0x1c13('0x33')](_0x40c5b6[_0x1c13('0x44')],function(_0x5ee4d5){var _0x481fd4={};_0x481fd4[_0x5ee4d5]={'$like':'%'+_0x99a6f9['query'][_0x1c13('0x4b')]+'%'};return _0x481fd4;})});}_0x40c5b6=_[_0x1c13('0x4c')]({},_0x40c5b6,_0x99a6f9[_0x1c13('0x54')]);return db[_0x1c13('0x6a')][_0x1c13('0x28')]({'where':_0x40c5b6[_0x1c13('0x4d')]})[_0x1c13('0x2d')](function(_0x3a7e3b){_0x1a998f['count']=_0x3a7e3b;if(_0x99a6f9[_0x1c13('0x41')]['includeAll']){_0x40c5b6[_0x1c13('0x4f')]=[{'all':!![]}];}return db[_0x1c13('0x6a')]['findAll'](_0x40c5b6);})[_0x1c13('0x2d')](function(_0xa190e5){_0x1a998f[_0x1c13('0x50')]=_0xa190e5;return _0x1a998f;});}})[_0x1c13('0x2d')](respondWithFilteredResult(_0x3b49df,_0x40c5b6))['catch'](handleError(_0x3b49df,null));};exports[_0x1c13('0x6b')]=function(_0x404135,_0x5a9f22,_0xf408cc){var _0x17e329={'raw':!![],'where':{}};var _0x299d08={};var _0x41754a={'count':0x0,'rows':[]};return db[_0x1c13('0x3b')]['findOne']({'where':{'id':_0x404135[_0x1c13('0x53')]['id']}})[_0x1c13('0x2d')](handleEntityNotFound(_0x5a9f22,null))[_0x1c13('0x2d')](function(_0x2b612c){if(_0x2b612c){_0x299d08[_0x1c13('0x3f')]=_[_0x1c13('0x40')](db[_0x1c13('0x6c')][_0x1c13('0x3c')]);_0x299d08['query']=_[_0x1c13('0x40')](_0x404135['query']);_0x299d08[_0x1c13('0x42')]=_[_0x1c13('0x43')](_0x299d08[_0x1c13('0x3f')],_0x299d08[_0x1c13('0x41')]);_0x17e329[_0x1c13('0x44')]=_['intersection'](_0x299d08[_0x1c13('0x3f')],qs[_0x1c13('0x45')](_0x404135[_0x1c13('0x41')][_0x1c13('0x45')]));_0x17e329['attributes']=_0x17e329[_0x1c13('0x44')][_0x1c13('0x46')]?_0x17e329[_0x1c13('0x44')]:_0x299d08[_0x1c13('0x3f')];if(!_0x404135[_0x1c13('0x41')][_0x1c13('0x47')](_0x1c13('0x48'))){_0x17e329[_0x1c13('0x26')]=qs['limit'](_0x404135[_0x1c13('0x41')]['limit']);_0x17e329[_0x1c13('0x25')]=qs[_0x1c13('0x25')](_0x404135[_0x1c13('0x41')][_0x1c13('0x25')]);}_0x17e329[_0x1c13('0x49')]=qs['sort'](_0x404135[_0x1c13('0x41')][_0x1c13('0x4a')]);_0x17e329[_0x1c13('0x4d')]=qs[_0x1c13('0x42')](_[_0x1c13('0x64')](_0x404135[_0x1c13('0x41')],_0x299d08[_0x1c13('0x42')]));_0x17e329[_0x1c13('0x4d')][_0x1c13('0x65')]=_0x2b612c['id'];if(_0x404135[_0x1c13('0x41')][_0x1c13('0x4b')]){_0x17e329[_0x1c13('0x4d')]=_[_0x1c13('0x4c')](_0x17e329[_0x1c13('0x4d')],{'$or':_[_0x1c13('0x33')](_0x17e329[_0x1c13('0x44')],function(_0x5e74cf){var _0x3898e6={};_0x3898e6[_0x5e74cf]={'$like':'%'+_0x404135[_0x1c13('0x41')]['filter']+'%'};return _0x3898e6;})});}_0x17e329=_[_0x1c13('0x4c')]({},_0x17e329,_0x404135[_0x1c13('0x54')]);return db[_0x1c13('0x6c')][_0x1c13('0x28')]({'where':_0x17e329['where']})[_0x1c13('0x2d')](function(_0x324605){_0x41754a['count']=_0x324605;if(_0x404135[_0x1c13('0x41')][_0x1c13('0x4e')]){_0x17e329[_0x1c13('0x4f')]=[{'all':!![]}];}return db[_0x1c13('0x6c')][_0x1c13('0x66')](_0x17e329);})[_0x1c13('0x2d')](function(_0x324dad){_0x41754a['rows']=_0x324dad;return _0x41754a;});}})['then'](respondWithFilteredResult(_0x5a9f22,_0x17e329))[_0x1c13('0x51')](handleError(_0x5a9f22,null));};exports['getTeams']=function(_0x10cc00,_0xdedb29,_0x533fff){var _0x108b40={};var _0x3c5320={};var _0x46358b;var _0x152fa4;return db['VoiceQueue'][_0x1c13('0x62')]({'where':{'id':_0x10cc00[_0x1c13('0x53')]['id']}})[_0x1c13('0x2d')](handleEntityNotFound(_0xdedb29,null))[_0x1c13('0x2d')](function(_0x4f47e9){if(_0x4f47e9){_0x46358b=_0x4f47e9;_0x3c5320[_0x1c13('0x3f')]=_['keys'](db[_0x1c13('0x6d')]['rawAttributes']);_0x3c5320[_0x1c13('0x41')]=_[_0x1c13('0x40')](_0x10cc00[_0x1c13('0x41')]);_0x3c5320[_0x1c13('0x42')]=_[_0x1c13('0x43')](_0x3c5320[_0x1c13('0x3f')],_0x3c5320[_0x1c13('0x41')]);_0x108b40[_0x1c13('0x44')]=_['intersection'](_0x3c5320[_0x1c13('0x3f')],qs['fields'](_0x10cc00[_0x1c13('0x41')][_0x1c13('0x45')]));_0x108b40[_0x1c13('0x44')]=_0x108b40[_0x1c13('0x44')][_0x1c13('0x46')]?_0x108b40['attributes']:_0x3c5320[_0x1c13('0x3f')];_0x108b40[_0x1c13('0x49')]=qs[_0x1c13('0x4a')](_0x10cc00['query']['sort']);_0x108b40[_0x1c13('0x4d')]=qs[_0x1c13('0x42')](_['pick'](_0x10cc00['query'],_0x3c5320[_0x1c13('0x42')]));if(_0x10cc00[_0x1c13('0x41')][_0x1c13('0x4b')]){_0x108b40[_0x1c13('0x4d')]=_[_0x1c13('0x4c')](_0x108b40[_0x1c13('0x4d')],{'$or':_[_0x1c13('0x33')](_0x108b40['attributes'],function(_0x31b511){var _0x5f3c5d={};_0x5f3c5d[_0x31b511]={'$like':'%'+_0x10cc00['query'][_0x1c13('0x4b')]+'%'};return _0x5f3c5d;})});}_0x108b40=_['merge']({},_0x108b40,_0x10cc00['options']);return _0x46358b[_0x1c13('0x6e')](_0x108b40);}})[_0x1c13('0x2d')](function(_0x2b5d7a){if(_0x2b5d7a){_0x152fa4=_0x2b5d7a['length'];if(!_0x10cc00[_0x1c13('0x41')][_0x1c13('0x47')](_0x1c13('0x48'))){_0x108b40[_0x1c13('0x26')]=qs['limit'](_0x10cc00[_0x1c13('0x41')][_0x1c13('0x26')]);_0x108b40[_0x1c13('0x25')]=qs[_0x1c13('0x25')](_0x10cc00['query']['offset']);}return _0x46358b[_0x1c13('0x6e')](_0x108b40);}})[_0x1c13('0x2d')](function(_0x3d3b68){if(_0x3d3b68){return _0x3d3b68?{'count':_0x152fa4,'rows':_0x3d3b68}:null;}})[_0x1c13('0x2d')](respondWithResult(_0xdedb29,null))[_0x1c13('0x51')](handleError(_0xdedb29,null));};exports['addTeams']=function(_0xce58a3,_0x4ac6d4,_0x583326){var _0x5768b7=_0xce58a3[_0x1c13('0x5f')][_0x1c13('0x6f')];var _0x21be75=_[_0x1c13('0x33')](_0x5768b7,'id');return db[_0x1c13('0x6d')]['findAll']({'where':{'id':_0x21be75},'attributes':['id'],'include':[{'model':db[_0x1c13('0x70')],'as':'Agents','attributes':['id',_0x1c13('0x3a'),_0x1c13('0x71'),_0x1c13('0x72'),'interface'],'raw':!![]}]})[_0x1c13('0x2d')](function(_0x3a159c){if(_0x3a159c){var _0x31b93b=_[_0x1c13('0x73')](_0x3a159c,function(_0x27a42c){var _0x5029eb=_0x27a42c[_0x1c13('0x2f')]({'plain':!![]});_0x5029eb['Agents'][_0x1c13('0x74')](function(_0x5b54eb){_0x5b54eb[_0x1c13('0x75')]=_[_0x1c13('0x55')](_0x5768b7,{'id':_0x5029eb['id']})[_0x1c13('0x75')];});return _0x5029eb[_0x1c13('0x76')];});return db[_0x1c13('0x3b')]['find']({'where':{'id':_0xce58a3[_0x1c13('0x53')]['id']}})[_0x1c13('0x2d')](function(_0x367c6b){return db['sequelize'][_0x1c13('0x77')](function(_0x3130ed){return _0x367c6b['addTeams'](_0x21be75,{'transaction':_0x3130ed})[_0x1c13('0x2d')](function(){return BPromise[_0x1c13('0x78')](_0x5768b7,function(_0x59c53f){return db[_0x1c13('0x79')][_0x1c13('0x7a')]({'TeamId':_0x59c53f['id'],'VoiceQueueId':_0xce58a3[_0x1c13('0x53')]['id'],'penalty':_0x59c53f['penalty']},{'transaction':_0x3130ed});});})[_0x1c13('0x2d')](function(){return BPromise[_0x1c13('0x78')](_0x31b93b,function(_0x2889aa){return db[_0x1c13('0x7b')][_0x1c13('0x7c')]({'where':{'UserId':_0x2889aa['id'],'VoiceQueueId':_0xce58a3[_0x1c13('0x53')]['id']},'defaults':{'penalty':_0x2889aa[_0x1c13('0x75')]},'transaction':_0x3130ed});});})['then'](function(){return BPromise[_0x1c13('0x78')](_['filter'](_0x31b93b,{'online':!![]}),function(_0x1835d8){return db[_0x1c13('0x7d')][_0x1c13('0x7a')]({'membername':_0x1835d8[_0x1c13('0x3a')],'UserId':_0x1835d8['id'],'queue_name':_0x367c6b[_0x1c13('0x3a')],'VoiceQueueId':_0x367c6b['id'],'interface':_[_0x1c13('0x7e')](_0x1835d8[_0x1c13('0x7f')])?util['format'](_0x1c13('0x80'),_0x1835d8[_0x1c13('0x3a')]):_0x1835d8['interface'],'paused':_0x1835d8[_0x1c13('0x72')]||![],'penalty':_0x1835d8[_0x1c13('0x75')]},{'transaction':_0x3130ed});});})['then'](function(){_0x31b93b[_0x1c13('0x74')](function(_0x37e39c){socket[_0x1c13('0x81')]('userVoiceQueue:save',{'UserId':_0x37e39c['id'],'VoiceQueueId':_0x367c6b['id']});});});});});}})[_0x1c13('0x2d')](respondWithStatusCode(_0x4ac6d4,null))[_0x1c13('0x51')](handleError(_0x4ac6d4,null));};exports['removeTeams']=function(_0x43c80d,_0x1c34a6,_0x2f917e){return db[_0x1c13('0x6d')][_0x1c13('0x66')]({'where':{'id':_0x43c80d[_0x1c13('0x41')]['ids']},'attributes':['id'],'include':[{'model':db[_0x1c13('0x70')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1c34a6,null))[_0x1c13('0x2d')](function(_0x579e40){var _0x343228=_[_0x1c13('0x33')](_0x579e40,'id');var _0x4e17ed=[];var _0x481e03=[];var _0x363f58=squel[_0x1c13('0x82')]();_0x363f58['field'](_0x1c13('0x83'))[_0x1c13('0x84')](_0x1c13('0x85'),'tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x1c13('0x4d')]('VoiceQueueId\x20=\x20?',_0x43c80d['params']['id']);for(var _0x5b3e81=0x0;_0x5b3e81<_0x579e40['length'];_0x5b3e81+=0x1){let _0x202e54=_0x579e40[_0x5b3e81];for(var _0x34f443=0x0;_0x34f443<_0x202e54[_0x1c13('0x76')][_0x1c13('0x46')];_0x34f443+=0x1){let _0x348533=_0x202e54[_0x1c13('0x76')][_0x34f443];var _0xeaeac0=_0x363f58[_0x1c13('0x86')]();_0xeaeac0[_0x1c13('0x4d')]('ut.UserId\x20=\x20?',_0x348533['id']);_0x481e03[_0x1c13('0x87')](db['sequelize'][_0x1c13('0x41')](_0xeaeac0['toString'](),{'type':db[_0x1c13('0x88')][_0x1c13('0x89')]['SELECT']})[_0x1c13('0x2d')](function(_0x333f00){if(_0x333f00[_0x1c13('0x46')]===0x1){return _0x348533['id'];}else{var _0x205022=_['every'](_['map'](_0x333f00,_0x1c13('0x8a')),function(_0x65cba4){return _[_0x1c13('0x35')](_0x343228,_0x65cba4);});if(_0x205022){return _0x348533['id'];}}}));}}return BPromise[_0x1c13('0x8b')](_0x481e03)[_0x1c13('0x2d')](function(_0x97678e){_0x4e17ed=_(_0x4e17ed)['union'](_0x97678e)[_0x1c13('0x8c')]()[_0x1c13('0x34')]();return db[_0x1c13('0x3b')][_0x1c13('0x55')]({'where':{'id':_0x43c80d[_0x1c13('0x53')]['id']}})[_0x1c13('0x2d')](function(_0x10536c){return db[_0x1c13('0x88')][_0x1c13('0x77')](function(_0x10f8b4){return _0x10536c['removeTeams'](_0x43c80d[_0x1c13('0x41')][_0x1c13('0x8d')],{'transaction':_0x10f8b4})['then'](function(){if(!_[_0x1c13('0x8e')](_0x4e17ed)){return _0x10536c[_0x1c13('0x8f')](_0x4e17ed,{'transaction':_0x10f8b4})[_0x1c13('0x2d')](function(){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x43c80d[_0x1c13('0x53')]['id'],'UserId':_0x4e17ed},'transaction':_0x10f8b4});});}})['then'](function(){_0x4e17ed['forEach'](function(_0x3b501e){socket['emit']('userVoiceQueue:remove',{'UserId':_0x3b501e,'VoiceQueueId':_0x10536c['id']});});});});});});})[_0x1c13('0x2d')](respondWithStatusCode(_0x1c34a6,null))[_0x1c13('0x51')](handleError(_0x1c34a6,null));};exports[_0x1c13('0x90')]=function(_0x277e0f,_0x529b5f,_0x4a5e4c){var _0xc2b6f0,_0x20ac3a;return db[_0x1c13('0x3b')][_0x1c13('0x55')]({'where':{'id':_0x277e0f[_0x1c13('0x53')]['id']}})['then'](handleEntityNotFound(_0x529b5f,null))['then'](function(_0x35db7c){if(_0x35db7c){_0x20ac3a=_0x35db7c;return _0x35db7c[_0x1c13('0x90')](_0x277e0f[_0x1c13('0x5f')][_0x1c13('0x8d')],_['omit'](_0x277e0f['body'],[_0x1c13('0x8d'),'id'])||{})[_0x1c13('0x91')](function(_0x3f8bc4){for(var _0x3f6966=0x0;_0x3f6966<_0x277e0f[_0x1c13('0x5f')][_0x1c13('0x8d')][_0x1c13('0x46')];_0x3f6966+=0x1){socket[_0x1c13('0x81')]('userVoiceQueue:save',{'UserId':Number(_0x277e0f[_0x1c13('0x5f')]['ids'][_0x3f6966]),'VoiceQueueId':Number(_0x277e0f[_0x1c13('0x53')]['id'])});}return _0x3f8bc4;});}})['then'](function(_0x10d256){_0xc2b6f0=_0x10d256||[];if(_0x20ac3a){return db['User'][_0x1c13('0x66')]({'where':{'id':_0x277e0f[_0x1c13('0x5f')][_0x1c13('0x8d')]},'attributes':['id',_0x1c13('0x3a'),_0x1c13('0x71'),_0x1c13('0x72'),'interface'],'raw':!![]});}})[_0x1c13('0x2d')](function(_0x427d77){if(!_['isEmpty'](_0x427d77)){var _0x2b8c76=[];for(var _0x3763ec=0x0;_0x3763ec<_0x427d77[_0x1c13('0x46')];_0x3763ec++){if(_0x427d77[_0x3763ec]['online']){_0x2b8c76['push'](db['UserVoiceQueueRt'][_0x1c13('0x7a')]({'membername':_0x427d77[_0x3763ec]['name'],'UserId':_0x427d77[_0x3763ec]['id'],'queue_name':_0x20ac3a[_0x1c13('0x3a')],'VoiceQueueId':_0x20ac3a['id'],'interface':_[_0x1c13('0x7e')](_0x427d77[_0x3763ec][_0x1c13('0x7f')])?util[_0x1c13('0x92')](_0x1c13('0x80'),_0x427d77[_0x3763ec][_0x1c13('0x3a')]):_0x427d77[_0x3763ec][_0x1c13('0x7f')],'paused':_0x427d77[_0x3763ec]['voicePause']||![],'penalty':_0x277e0f['body']['penalty']||0x0}));}}return BPromise[_0x1c13('0x8b')](_0x2b8c76);}})[_0x1c13('0x2d')](function(){return _0xc2b6f0;})[_0x1c13('0x2d')](respondWithResult(_0x529b5f,null))[_0x1c13('0x51')](handleError(_0x529b5f,null));};exports[_0x1c13('0x8f')]=function(_0x472c2c,_0xeb8f3a,_0x38f272){return db[_0x1c13('0x3b')]['find']({'where':{'id':_0x472c2c[_0x1c13('0x53')]['id']}})[_0x1c13('0x2d')](handleEntityNotFound(_0xeb8f3a,null))[_0x1c13('0x2d')](function(_0x484dd7){if(_0x484dd7){return _0x484dd7[_0x1c13('0x8f')](_0x472c2c[_0x1c13('0x41')][_0x1c13('0x8d')])[_0x1c13('0x2d')](function(){if(_['isArray'](_0x472c2c[_0x1c13('0x41')]['ids'])){for(var _0x5e5483=0x0;_0x5e5483<_0x472c2c[_0x1c13('0x41')][_0x1c13('0x8d')][_0x1c13('0x46')];_0x5e5483+=0x1){socket[_0x1c13('0x81')](_0x1c13('0x93'),{'UserId':Number(_0x472c2c[_0x1c13('0x41')][_0x1c13('0x8d')][_0x5e5483]),'VoiceQueueId':Number(_0x472c2c[_0x1c13('0x53')]['id'])});}}else{socket[_0x1c13('0x81')](_0x1c13('0x93'),{'UserId':Number(_0x472c2c[_0x1c13('0x41')]['ids']),'VoiceQueueId':Number(_0x472c2c[_0x1c13('0x53')]['id'])});}});}})[_0x1c13('0x2d')](function(_0x470594){return db[_0x1c13('0x7d')][_0x1c13('0x2e')]({'where':{'VoiceQueueId':_0x472c2c[_0x1c13('0x53')]['id'],'UserId':_0x472c2c[_0x1c13('0x41')][_0x1c13('0x8d')]}})[_0x1c13('0x2d')](function(){return _0x470594;});})['then'](respondWithStatusCode(_0xeb8f3a,null))['catch'](handleError(_0xeb8f3a,null));};exports[_0x1c13('0x94')]=function(_0x30a6d4,_0x710c8e,_0x30a28f){var _0x4822a4={};var _0x528d1b={};var _0x11ac8a;var _0x20ec68;return db[_0x1c13('0x3b')][_0x1c13('0x62')]({'where':{'id':_0x30a6d4['params']['id']}})['then'](handleEntityNotFound(_0x710c8e,null))[_0x1c13('0x2d')](function(_0x1e2ee2){if(_0x1e2ee2){_0x11ac8a=_0x1e2ee2;_0x528d1b[_0x1c13('0x3f')]=_[_0x1c13('0x40')](db[_0x1c13('0x70')][_0x1c13('0x3c')]);_0x528d1b[_0x1c13('0x41')]=_['keys'](_0x30a6d4['query']);_0x528d1b[_0x1c13('0x42')]=_[_0x1c13('0x43')](_0x528d1b['model'],_0x528d1b[_0x1c13('0x41')]);_0x4822a4[_0x1c13('0x44')]=_[_0x1c13('0x43')](_0x528d1b[_0x1c13('0x3f')],qs[_0x1c13('0x45')](_0x30a6d4[_0x1c13('0x41')]['fields']));_0x4822a4[_0x1c13('0x44')]=_0x4822a4[_0x1c13('0x44')][_0x1c13('0x46')]?_0x4822a4[_0x1c13('0x44')]:_0x528d1b[_0x1c13('0x3f')];_0x4822a4['order']=qs[_0x1c13('0x4a')](_0x30a6d4[_0x1c13('0x41')]['sort']);_0x4822a4[_0x1c13('0x4d')]=qs[_0x1c13('0x42')](_['pick'](_0x30a6d4['query'],_0x528d1b[_0x1c13('0x42')]));if(_0x30a6d4[_0x1c13('0x41')]['filter']){_0x4822a4[_0x1c13('0x4d')]=_[_0x1c13('0x4c')](_0x4822a4[_0x1c13('0x4d')],{'$or':_[_0x1c13('0x33')](_0x4822a4['attributes'],function(_0x1b18b1){var _0x100bb4={};_0x100bb4[_0x1b18b1]={'$like':'%'+_0x30a6d4[_0x1c13('0x41')][_0x1c13('0x4b')]+'%'};return _0x100bb4;})});}_0x4822a4=_[_0x1c13('0x4c')]({},_0x4822a4,_0x30a6d4[_0x1c13('0x54')]);return _0x11ac8a['getAgents'](_0x4822a4);}})[_0x1c13('0x2d')](function(_0x467092){if(_0x467092){_0x20ec68=_0x467092[_0x1c13('0x46')];if(!_0x30a6d4[_0x1c13('0x41')][_0x1c13('0x47')]('nolimit')){_0x4822a4[_0x1c13('0x26')]=qs[_0x1c13('0x26')](_0x30a6d4['query'][_0x1c13('0x26')]);_0x4822a4[_0x1c13('0x25')]=qs[_0x1c13('0x25')](_0x30a6d4[_0x1c13('0x41')][_0x1c13('0x25')]);}return _0x11ac8a[_0x1c13('0x94')](_0x4822a4);}})[_0x1c13('0x2d')](function(_0x4fa788){if(_0x4fa788){return _0x4fa788?{'count':_0x20ec68,'rows':_0x4fa788}:null;}})[_0x1c13('0x2d')](respondWithResult(_0x710c8e,null))[_0x1c13('0x51')](handleError(_0x710c8e,null));};exports[_0x1c13('0x95')]=function(_0x139c17,_0x1b35f4,_0x101c27){var _0x56e7fe={};var _0x277c01={};var _0x41f298;var _0x3c6db4;return db[_0x1c13('0x3b')][_0x1c13('0x62')]({'where':{'id':_0x139c17[_0x1c13('0x53')]['id']}})[_0x1c13('0x2d')](handleEntityNotFound(_0x1b35f4,null))[_0x1c13('0x2d')](function(_0x20860d){if(_0x20860d){_0x41f298=_0x20860d;_0x277c01[_0x1c13('0x3f')]=_[_0x1c13('0x40')](db[_0x1c13('0x7d')][_0x1c13('0x3c')]);_0x277c01['query']=_[_0x1c13('0x40')](_0x139c17['query']);_0x277c01[_0x1c13('0x42')]=_[_0x1c13('0x43')](_0x277c01[_0x1c13('0x3f')],_0x277c01[_0x1c13('0x41')]);_0x56e7fe[_0x1c13('0x44')]=_[_0x1c13('0x43')](_0x277c01[_0x1c13('0x3f')],qs['fields'](_0x139c17[_0x1c13('0x41')][_0x1c13('0x45')]));_0x56e7fe[_0x1c13('0x44')]=_0x56e7fe[_0x1c13('0x44')][_0x1c13('0x46')]?_0x56e7fe[_0x1c13('0x44')]:_0x277c01[_0x1c13('0x3f')];_0x56e7fe[_0x1c13('0x49')]=qs[_0x1c13('0x4a')](_0x139c17[_0x1c13('0x41')]['sort']);_0x56e7fe[_0x1c13('0x4d')]=qs[_0x1c13('0x42')](_[_0x1c13('0x64')](_0x139c17['query'],_0x277c01[_0x1c13('0x42')]));if(_0x139c17[_0x1c13('0x41')]['filter']){_0x56e7fe['where']=_[_0x1c13('0x4c')](_0x56e7fe['where'],{'$or':_[_0x1c13('0x33')](_0x56e7fe[_0x1c13('0x44')],function(_0x1a34e2){var _0x1a54f8={};_0x1a54f8[_0x1a34e2]={'$like':'%'+_0x139c17['query'][_0x1c13('0x4b')]+'%'};return _0x1a54f8;})});}_0x56e7fe=_[_0x1c13('0x4c')]({},_0x56e7fe,_0x139c17[_0x1c13('0x54')]);return _0x41f298[_0x1c13('0x95')](_0x56e7fe);}})[_0x1c13('0x2d')](function(_0x273a29){if(_0x273a29){_0x3c6db4=_0x273a29[_0x1c13('0x46')];if(!_0x139c17[_0x1c13('0x41')][_0x1c13('0x47')](_0x1c13('0x48'))){_0x56e7fe[_0x1c13('0x26')]=qs['limit'](_0x139c17[_0x1c13('0x41')]['limit']);_0x56e7fe[_0x1c13('0x25')]=qs[_0x1c13('0x25')](_0x139c17[_0x1c13('0x41')][_0x1c13('0x25')]);}return _0x41f298[_0x1c13('0x95')](_0x56e7fe);}})[_0x1c13('0x2d')](function(_0x247c08){return _0x247c08?{'count':_0x3c6db4,'rows':_0x247c08}:null;})['then'](respondWithResult(_0x1b35f4,null))[_0x1c13('0x51')](handleError(_0x1b35f4,null));};exports[_0x1c13('0x96')]=function(_0x240c8e,_0x997e05,_0x106bef){var _0x334e62={};var _0x40d59d={};var _0xe53c11;var _0x3737ab;return db['VoiceQueue'][_0x1c13('0x62')]({'where':{'id':_0x240c8e[_0x1c13('0x53')]['id']}})[_0x1c13('0x2d')](handleEntityNotFound(_0x997e05,null))[_0x1c13('0x2d')](function(_0x4b0276){if(_0x4b0276){_0xe53c11=_0x4b0276;_0x40d59d[_0x1c13('0x3f')]=_['keys'](db['CmList'][_0x1c13('0x3c')]);_0x40d59d[_0x1c13('0x41')]=_[_0x1c13('0x40')](_0x240c8e[_0x1c13('0x41')]);_0x40d59d[_0x1c13('0x42')]=_['intersection'](_0x40d59d[_0x1c13('0x3f')],_0x40d59d[_0x1c13('0x41')]);_0x334e62[_0x1c13('0x44')]=_['intersection'](_0x40d59d[_0x1c13('0x3f')],qs[_0x1c13('0x45')](_0x240c8e['query'][_0x1c13('0x45')]));_0x334e62[_0x1c13('0x44')]=_0x334e62[_0x1c13('0x44')][_0x1c13('0x46')]?_0x334e62[_0x1c13('0x44')]:_0x40d59d[_0x1c13('0x3f')];_0x334e62[_0x1c13('0x49')]=qs[_0x1c13('0x4a')](_0x240c8e[_0x1c13('0x41')][_0x1c13('0x4a')]);_0x334e62[_0x1c13('0x4d')]=qs[_0x1c13('0x42')](_[_0x1c13('0x64')](_0x240c8e[_0x1c13('0x41')],_0x40d59d[_0x1c13('0x42')]));if(_0x240c8e[_0x1c13('0x41')][_0x1c13('0x4b')]){_0x334e62[_0x1c13('0x4d')]=_[_0x1c13('0x4c')](_0x334e62[_0x1c13('0x4d')],{'$or':_[_0x1c13('0x33')](_0x334e62['attributes'],function(_0x2eadb5){var _0x1eda44={};_0x1eda44[_0x2eadb5]={'$like':'%'+_0x240c8e[_0x1c13('0x41')][_0x1c13('0x4b')]+'%'};return _0x1eda44;})});}_0x334e62=_['merge']({},_0x334e62,_0x240c8e[_0x1c13('0x54')]);return _0xe53c11[_0x1c13('0x96')](_0x334e62);}})[_0x1c13('0x2d')](function(_0x1f1165){if(_0x1f1165){_0x3737ab=_0x1f1165[_0x1c13('0x46')];if(!_0x240c8e[_0x1c13('0x41')]['hasOwnProperty'](_0x1c13('0x48'))){_0x334e62[_0x1c13('0x26')]=qs[_0x1c13('0x26')](_0x240c8e[_0x1c13('0x41')]['limit']);_0x334e62[_0x1c13('0x25')]=qs[_0x1c13('0x25')](_0x240c8e['query'][_0x1c13('0x25')]);}return _0xe53c11[_0x1c13('0x96')](_0x334e62);}})[_0x1c13('0x2d')](function(_0x29517e){if(_0x29517e){return _0x29517e?{'count':_0x3737ab,'rows':_0x29517e}:null;}})[_0x1c13('0x2d')](respondWithResult(_0x997e05,null))[_0x1c13('0x51')](handleError(_0x997e05,null));};exports[_0x1c13('0x97')]=function(_0x371247,_0x549deb,_0x156947){var _0x55317e,_0x54a1b3;return db['VoiceQueue'][_0x1c13('0x55')]({'where':{'id':_0x371247[_0x1c13('0x53')]['id']}})[_0x1c13('0x2d')](handleEntityNotFound(_0x549deb,null))[_0x1c13('0x2d')](function(_0x169456){if(_0x169456){_0x54a1b3=_0x169456;return _0x169456[_0x1c13('0x97')](_0x371247[_0x1c13('0x5f')][_0x1c13('0x8d')],_[_0x1c13('0x5c')](_0x371247[_0x1c13('0x5f')],[_0x1c13('0x8d'),'id'])||{});}return null;})[_0x1c13('0x91')](function(_0x5f1f8d){var _0x35966d;_0x55317e=_0x5f1f8d||[];var _0x1c521c=[];if(_0x5f1f8d){for(var _0x1ecdf5=0x0;_0x1ecdf5<_0x5f1f8d['length'];_0x1ecdf5+=0x1){var _0x23ac17=_0x5f1f8d[_0x1ecdf5]['get']({'plain':!![]});_0x54a1b3[_0x1c13('0x98')]=_0x371247['body'][_0x1c13('0x98')]?_0x371247['body'][_0x1c13('0x98')]:_0x54a1b3[_0x1c13('0x98')];switch(_0x54a1b3[_0x1c13('0x98')]){case'always':_0x35966d=squel[_0x1c13('0x99')]()[_0x1c13('0x9a')]('cm_hopper')[_0x1c13('0x9b')]([_0x1c13('0x9c'),_0x1c13('0x9d'),'ContactId',_0x1c13('0x9e'),_0x1c13('0x65'),'createdAt',_0x1c13('0x5e')],squel[_0x1c13('0x82')]()[_0x1c13('0x9f')](_0x1c13('0x9c'),'phone')['field'](_0x1c13('0xa0'),'scheduledAt')[_0x1c13('0x9f')]('id',_0x1c13('0xa1'))[_0x1c13('0x9f')](_0x23ac17[_0x1c13('0xa2')][_0x1c13('0xa3')](),_0x1c13('0x9e'))['field'](_0x371247[_0x1c13('0x53')]['id'][_0x1c13('0xa3')](),'VoiceQueueId')[_0x1c13('0x9f')](_0x1c13('0xa0'),'createdAt')[_0x1c13('0x9f')](_0x1c13('0xa0'),_0x1c13('0x5e'))['from']('cm_contacts')[_0x1c13('0x4d')](_0x1c13('0xa4'))[_0x1c13('0x4d')](_0x1c13('0xa5'),_0x23ac17[_0x1c13('0xa2')][_0x1c13('0xa3')]())[_0x1c13('0x4d')]('phone\x20IS\x20NOT\x20NULL')[_0x1c13('0x4d')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x1c13('0x9f')]('COALESCE(calleridnum,\x27\x27)')[_0x1c13('0x84')](_0x1c13('0xa6'))[_0x1c13('0x4d')](_0x1c13('0xa7'),_0x371247['params']['id'][_0x1c13('0xa3')]()))['where'](_0x1c13('0xa8'),squel[_0x1c13('0x82')]()[_0x1c13('0x9f')](_0x1c13('0xa9'))[_0x1c13('0x84')](_0x1c13('0xaa'))['where'](_0x1c13('0xa7'),_0x371247[_0x1c13('0x53')]['id'][_0x1c13('0xa3')]())))['toString']();break;case'onlyIfOpen':_0x35966d=squel[_0x1c13('0x99')]()[_0x1c13('0x9a')](_0x1c13('0xaa'))['fromQuery']([_0x1c13('0x9c'),'scheduledAt',_0x1c13('0xa1'),_0x1c13('0x9e'),_0x1c13('0x65'),'createdAt',_0x1c13('0x5e')],squel[_0x1c13('0x82')]()['field']('phone',_0x1c13('0x9c'))[_0x1c13('0x9f')](_0x1c13('0xa0'),'scheduledAt')[_0x1c13('0x9f')]('id',_0x1c13('0xa1'))['field'](_0x23ac17[_0x1c13('0xa2')][_0x1c13('0xa3')](),_0x1c13('0x9e'))[_0x1c13('0x9f')](_0x371247[_0x1c13('0x53')]['id'][_0x1c13('0xa3')](),_0x1c13('0x65'))['field'](_0x1c13('0xa0'),_0x1c13('0x5d'))[_0x1c13('0x9f')]('NOW()',_0x1c13('0x5e'))['from']('cm_contacts')['where'](_0x1c13('0xa4'))['where'](_0x1c13('0xa5'),_0x23ac17['CmListId'][_0x1c13('0xa3')]())[_0x1c13('0x4d')](_0x1c13('0xab'))[_0x1c13('0x4d')](_0x1c13('0xa8'),squel[_0x1c13('0x82')]()['field']('COALESCE(phone,\x27\x27)')[_0x1c13('0x84')](_0x1c13('0xaa'))['where'](_0x1c13('0xa7'),_0x371247[_0x1c13('0x53')]['id'][_0x1c13('0xa3')]())))[_0x1c13('0xa3')]();break;default:_0x35966d=squel[_0x1c13('0x99')]()[_0x1c13('0x9a')](_0x1c13('0xaa'))[_0x1c13('0x9b')]([_0x1c13('0x9c'),_0x1c13('0x9d'),_0x1c13('0xa1'),_0x1c13('0x9e'),_0x1c13('0x65'),_0x1c13('0x5d'),'updatedAt'],squel['select']()[_0x1c13('0x9f')]('phone',_0x1c13('0x9c'))[_0x1c13('0x9f')](_0x1c13('0xa0'),_0x1c13('0x9d'))['field']('id',_0x1c13('0xa1'))[_0x1c13('0x9f')](_0x23ac17['CmListId'][_0x1c13('0xa3')](),'ListId')[_0x1c13('0x9f')](_0x371247['params']['id'][_0x1c13('0xa3')](),_0x1c13('0x65'))[_0x1c13('0x9f')](_0x1c13('0xa0'),_0x1c13('0x5d'))[_0x1c13('0x9f')](_0x1c13('0xa0'),_0x1c13('0x5e'))[_0x1c13('0x84')](_0x1c13('0xac'))[_0x1c13('0x4d')](_0x1c13('0xa4'))['where'](_0x1c13('0xa5'),_0x23ac17[_0x1c13('0xa2')][_0x1c13('0xa3')]())['where'](_0x1c13('0xab')))[_0x1c13('0xa3')]();}_0x1c521c[_0x1c13('0x87')](db[_0x1c13('0x88')]['query'](_0x35966d));}return BPromise['all'](_0x1c521c);}})[_0x1c13('0x2d')](function(){return _0x55317e;})[_0x1c13('0x2d')](respondWithResult(_0x549deb,null))[_0x1c13('0x51')](handleError(_0x549deb,null));};exports[_0x1c13('0xad')]=function(_0x2e021,_0x5cb52b,_0x4b54fb){return db[_0x1c13('0x3b')][_0x1c13('0x55')]({'where':{'id':_0x2e021[_0x1c13('0x53')]['id']}})[_0x1c13('0x2d')](handleEntityNotFound(_0x5cb52b,null))[_0x1c13('0x2d')](function(_0xa2edaa){if(_0xa2edaa){return _0xa2edaa[_0x1c13('0xad')](_0x2e021[_0x1c13('0x41')][_0x1c13('0x8d')]);}})[_0x1c13('0x2d')](function(_0x51e3a5){if(_0x51e3a5){return db[_0x1c13('0x63')][_0x1c13('0x2e')]({'where':{'ListId':_0x2e021[_0x1c13('0x41')][_0x1c13('0x8d')],'VoiceQueueId':_0x2e021[_0x1c13('0x53')]['id']}})[_0x1c13('0x2d')](function(){return _0x51e3a5;});}})['then'](respondWithStatusCode(_0x5cb52b,null))[_0x1c13('0x51')](handleError(_0x5cb52b,null));};exports[_0x1c13('0xae')]=function(_0x4b5630,_0x27141b,_0x46d774){var _0x3045f6={};var _0x2edeba={};var _0x29fb67;var _0x671035;return db[_0x1c13('0x3b')][_0x1c13('0x62')]({'where':{'id':_0x4b5630['params']['id']}})[_0x1c13('0x2d')](handleEntityNotFound(_0x27141b,null))[_0x1c13('0x2d')](function(_0x3862e4){if(_0x3862e4){_0x29fb67=_0x3862e4;_0x2edeba['model']=_[_0x1c13('0x40')](db[_0x1c13('0xaf')]['rawAttributes']);_0x2edeba[_0x1c13('0x41')]=_['keys'](_0x4b5630[_0x1c13('0x41')]);_0x2edeba[_0x1c13('0x42')]=_[_0x1c13('0x43')](_0x2edeba[_0x1c13('0x3f')],_0x2edeba[_0x1c13('0x41')]);_0x3045f6[_0x1c13('0x44')]=_[_0x1c13('0x43')](_0x2edeba[_0x1c13('0x3f')],qs[_0x1c13('0x45')](_0x4b5630[_0x1c13('0x41')][_0x1c13('0x45')]));_0x3045f6[_0x1c13('0x44')]=_0x3045f6['attributes'][_0x1c13('0x46')]?_0x3045f6[_0x1c13('0x44')]:_0x2edeba['model'];_0x3045f6[_0x1c13('0x49')]=qs[_0x1c13('0x4a')](_0x4b5630[_0x1c13('0x41')]['sort']);_0x3045f6[_0x1c13('0x4d')]=qs[_0x1c13('0x42')](_[_0x1c13('0x64')](_0x4b5630[_0x1c13('0x41')],_0x2edeba[_0x1c13('0x42')]));if(_0x4b5630['query']['filter']){_0x3045f6['where']=_['merge'](_0x3045f6['where'],{'$or':_['map'](_0x3045f6['attributes'],function(_0x1a0e12){var _0x27e8b4={};_0x27e8b4[_0x1a0e12]={'$like':'%'+_0x4b5630[_0x1c13('0x41')][_0x1c13('0x4b')]+'%'};return _0x27e8b4;})});}_0x3045f6=_[_0x1c13('0x4c')]({},_0x3045f6,_0x4b5630[_0x1c13('0x54')]);return _0x29fb67[_0x1c13('0xae')](_0x3045f6);}})[_0x1c13('0x2d')](function(_0x786ecd){if(_0x786ecd){_0x671035=_0x786ecd[_0x1c13('0x46')];if(!_0x4b5630['query'][_0x1c13('0x47')]('nolimit')){_0x3045f6[_0x1c13('0x26')]=qs['limit'](_0x4b5630[_0x1c13('0x41')]['limit']);_0x3045f6[_0x1c13('0x25')]=qs[_0x1c13('0x25')](_0x4b5630[_0x1c13('0x41')][_0x1c13('0x25')]);}return _0x29fb67[_0x1c13('0xae')](_0x3045f6);}})[_0x1c13('0x2d')](function(_0x5b89d3){if(_0x5b89d3){return _0x5b89d3?{'count':_0x671035,'rows':_0x5b89d3}:null;}})['then'](respondWithResult(_0x27141b,null))['catch'](handleError(_0x27141b,null));};exports[_0x1c13('0xb0')]=function(_0x208c94,_0x13b90e,_0x3aa3ac){var _0x499019,_0x2df6c1;return db[_0x1c13('0x3b')]['find']({'where':{'id':_0x208c94[_0x1c13('0x53')]['id']}})[_0x1c13('0x2d')](handleEntityNotFound(_0x13b90e,null))[_0x1c13('0x2d')](function(_0x197dca){if(_0x197dca){_0x2df6c1=_0x197dca;return _0x197dca[_0x1c13('0xb0')](_0x208c94[_0x1c13('0x5f')][_0x1c13('0x8d')],_[_0x1c13('0x5c')](_0x208c94[_0x1c13('0x5f')],['ids','id'])||{});}return null;})['spread'](function(_0x150c55){var _0x22e116;_0x499019=_0x150c55||[];var _0x521d19=[];if(_0x150c55){for(var _0x1f0f39=0x0;_0x1f0f39<_0x150c55[_0x1c13('0x46')];_0x1f0f39+=0x1){var _0x5b91f3=_0x150c55[_0x1f0f39][_0x1c13('0x2f')]({'plain':!![]});_0x22e116=squel[_0x1c13('0x99')]()[_0x1c13('0x9a')](_0x1c13('0xb1'))['fromQuery']([_0x1c13('0x9c'),_0x1c13('0xa1'),_0x1c13('0x9e'),_0x1c13('0x65'),_0x1c13('0x5d'),'updatedAt'],squel[_0x1c13('0x82')]()['field'](_0x1c13('0x9c'),_0x1c13('0x9c'))[_0x1c13('0x9f')]('id',_0x1c13('0xa1'))['field'](_0x5b91f3[_0x1c13('0xa2')][_0x1c13('0xa3')](),'ListId')[_0x1c13('0x9f')](_0x208c94[_0x1c13('0x53')]['id'][_0x1c13('0xa3')](),_0x1c13('0x65'))[_0x1c13('0x9f')]('NOW()',_0x1c13('0x5d'))[_0x1c13('0x9f')](_0x1c13('0xa0'),_0x1c13('0x5e'))['from'](_0x1c13('0xac'))['where']('deletedAt\x20IS\x20NULL')[_0x1c13('0x4d')](_0x1c13('0xa5'),_0x5b91f3[_0x1c13('0xa2')][_0x1c13('0xa3')]())[_0x1c13('0x4d')](_0x1c13('0xab')))[_0x1c13('0xa3')]();_0x521d19[_0x1c13('0x87')](db[_0x1c13('0x88')][_0x1c13('0x41')](_0x22e116));}return BPromise['all'](_0x521d19);}})['then'](function(){return _0x499019;})['then'](respondWithResult(_0x13b90e,null))[_0x1c13('0x51')](handleError(_0x13b90e,null));};exports[_0x1c13('0xb2')]=function(_0x234795,_0x3dd8e3,_0x12265d){return db[_0x1c13('0x3b')][_0x1c13('0x55')]({'where':{'id':_0x234795[_0x1c13('0x53')]['id']}})[_0x1c13('0x2d')](handleEntityNotFound(_0x3dd8e3,null))[_0x1c13('0x2d')](function(_0x2a80a9){if(_0x2a80a9){return _0x2a80a9[_0x1c13('0xb2')](_0x234795[_0x1c13('0x41')][_0x1c13('0x8d')]);}})['then'](function(_0x4c2b23){if(_0x4c2b23){return db['CmHopperBlack'][_0x1c13('0x2e')]({'where':{'ListId':_0x234795[_0x1c13('0x41')][_0x1c13('0x8d')],'VoiceQueueId':_0x234795[_0x1c13('0x53')]['id']}})[_0x1c13('0x2d')](function(){return _0x4c2b23;});}})[_0x1c13('0x2d')](respondWithStatusCode(_0x3dd8e3,null))[_0x1c13('0x51')](handleError(_0x3dd8e3,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 8a55c4f..d930950 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 _0x4eb6=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','VoiceQueue'];(function(_0x892d18,_0x903215){var _0x194c07=function(_0x1e342b){while(--_0x1e342b){_0x892d18['push'](_0x892d18['shift']());}};_0x194c07(++_0x903215);}(_0x4eb6,0x9d));var _0x64eb=function(_0x160c4c,_0x317d2b){_0x160c4c=_0x160c4c-0x0;var _0x37f1cf=_0x4eb6[_0x160c4c];return _0x37f1cf;};'use strict';var EventEmitter=require(_0x64eb('0x0'));var VoiceQueue=require(_0x64eb('0x1'))['db'][_0x64eb('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x64eb('0x3')](0x0);var events={'afterCreate':_0x64eb('0x4'),'afterUpdate':_0x64eb('0x5'),'afterDestroy':_0x64eb('0x6')};function emitEvent(_0x2fbc7b){return function(_0x238339,_0x3d3fa5,_0x931760){VoiceQueueEvents['emit'](_0x2fbc7b+':'+_0x238339['id'],_0x238339);VoiceQueueEvents[_0x64eb('0x7')](_0x2fbc7b,_0x238339);_0x931760(null);};}for(var e in events){if(events[_0x64eb('0x8')](e)){var event=events[e];VoiceQueue[_0x64eb('0x9')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file +var _0xbdaa=['emit','hook','events','../../mysqldb','VoiceQueue','setMaxListeners','update','remove'];(function(_0x53a316,_0xf26b8f){var _0x37c0df=function(_0x1220b0){while(--_0x1220b0){_0x53a316['push'](_0x53a316['shift']());}};_0x37c0df(++_0xf26b8f);}(_0xbdaa,0xe2));var _0xabda=function(_0x5ea66a,_0x56b324){_0x5ea66a=_0x5ea66a-0x0;var _0x4481be=_0xbdaa[_0x5ea66a];return _0x4481be;};'use strict';var EventEmitter=require(_0xabda('0x0'));var VoiceQueue=require(_0xabda('0x1'))['db'][_0xabda('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xabda('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xabda('0x4'),'afterDestroy':_0xabda('0x5')};function emitEvent(_0x1a4a36){return function(_0x1de1ec,_0x32a9fa,_0x1e3c98){VoiceQueueEvents[_0xabda('0x6')](_0x1a4a36+':'+_0x1de1ec['id'],_0x1de1ec);VoiceQueueEvents['emit'](_0x1a4a36,_0x1de1ec);_0x1e3c98(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0xabda('0x7')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 373944e..39e83e3 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 _0x34e8=['voice_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports','VoiceQueue'];(function(_0x3ae229,_0x3529f4){var _0x15f641=function(_0x2a3485){while(--_0x2a3485){_0x3ae229['push'](_0x3ae229['shift']());}};_0x15f641(++_0x3529f4);}(_0x34e8,0x12c));var _0x834e=function(_0x2cdc4b,_0x2e2fa6){_0x2cdc4b=_0x2cdc4b-0x0;var _0x2e30a4=_0x34e8[_0x2cdc4b];return _0x2e30a4;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./voiceQueue.attributes','exports','define','VoiceQueue','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x36241b,_0x13639a){var _0x121377=function(_0x2a916d){while(--_0x2a916d){_0x36241b['push'](_0x36241b['shift']());}};_0x121377(++_0x13639a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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':'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 df50c76..b764718 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 _0x6ee9=['error','code','message','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes','include','map','model','stringify','ShowVoiceQueue','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6ee9,0x150));var _0x96ee=function(_0x47e59b,_0x598969){_0x47e59b=_0x47e59b-0x0;var _0x4cf443=_0x6ee9[_0x47e59b];return _0x4cf443;};'use strict';var _=require(_0x96ee('0x0'));var util=require(_0x96ee('0x1'));var moment=require(_0x96ee('0x2'));var BPromise=require('bluebird');var rs=require(_0x96ee('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x96ee('0x4'))['db'];var utils=require(_0x96ee('0x5'));var logger=require(_0x96ee('0x6'))(_0x96ee('0x7'));var config=require(_0x96ee('0x8'));var jayson=require(_0x96ee('0x9'));var client=jayson[_0x96ee('0xa')][_0x96ee('0xb')]({'port':0x232a});config[_0x96ee('0xc')]=_[_0x96ee('0xd')](config[_0x96ee('0xc')],{'host':_0x96ee('0xe'),'port':0x18eb});var socket=require(_0x96ee('0xf'))(new Redis(config[_0x96ee('0xc')]));require('./voiceQueue.socket')[_0x96ee('0x10')](socket);function respondWithRpcPromise(_0x4a3e09,_0x9f9553,_0x298cf0){return new BPromise(function(_0x1c6f35,_0x12899d){return client[_0x96ee('0x11')](_0x4a3e09,_0x298cf0)[_0x96ee('0x12')](function(_0x107a4a){logger[_0x96ee('0x13')](_0x96ee('0x14'),_0x9f9553,_0x96ee('0x15'));logger[_0x96ee('0x16')](_0x96ee('0x17'),_0x9f9553,'request\x20sent',JSON['stringify'](_0x107a4a));if(_0x107a4a[_0x96ee('0x18')]){if(_0x107a4a[_0x96ee('0x18')][_0x96ee('0x19')]===0x1f4){logger['error'](_0x96ee('0x14'),_0x9f9553,_0x107a4a[_0x96ee('0x18')][_0x96ee('0x1a')]);return _0x12899d(_0x107a4a[_0x96ee('0x18')][_0x96ee('0x1a')]);}logger[_0x96ee('0x18')]('VoiceQueue,\x20%s,\x20%s',_0x9f9553,_0x107a4a[_0x96ee('0x18')][_0x96ee('0x1a')]);return _0x1c6f35(_0x107a4a['error'][_0x96ee('0x1a')]);}else{logger[_0x96ee('0x13')](_0x96ee('0x14'),_0x9f9553,_0x96ee('0x15'));_0x1c6f35(_0x107a4a['result']['message']);}})[_0x96ee('0x1b')](function(_0x410663){logger['error'](_0x96ee('0x14'),_0x9f9553,_0x410663);_0x12899d(_0x410663);});});}exports[_0x96ee('0x1c')]=function(_0x4e0aa4){var _0x229a3d=this;return new Promise(function(_0x845763,_0x3636a9){return db[_0x96ee('0x1d')][_0x96ee('0x1e')]({'raw':_0x4e0aa4[_0x96ee('0x1f')]?_0x4e0aa4[_0x96ee('0x1f')][_0x96ee('0x20')]===undefined?!![]:![]:!![],'where':_0x4e0aa4[_0x96ee('0x1f')]?_0x4e0aa4['options'][_0x96ee('0x21')]||null:null,'attributes':_0x4e0aa4['options']?_0x4e0aa4[_0x96ee('0x1f')][_0x96ee('0x22')]||null:null,'limit':_0x4e0aa4[_0x96ee('0x1f')]?_0x4e0aa4['options']['limit']||null:null,'include':_0x4e0aa4[_0x96ee('0x1f')]?_0x4e0aa4[_0x96ee('0x1f')][_0x96ee('0x23')]?_[_0x96ee('0x24')](_0x4e0aa4['options'][_0x96ee('0x23')],function(_0x1fe20b){return{'model':db[_0x1fe20b[_0x96ee('0x25')]],'as':_0x1fe20b['as'],'attributes':_0x1fe20b[_0x96ee('0x22')],'include':_0x1fe20b['include']?_[_0x96ee('0x24')](_0x1fe20b[_0x96ee('0x23')],function(_0x1e2da1){return{'model':db[_0x1e2da1[_0x96ee('0x25')]],'as':_0x1e2da1['as'],'attributes':_0x1e2da1['attributes'],'include':_0x1e2da1[_0x96ee('0x23')]?_[_0x96ee('0x24')](_0x1e2da1[_0x96ee('0x23')],function(_0x210bc5){return{'model':db[_0x210bc5[_0x96ee('0x25')]],'as':_0x210bc5['as'],'attributes':_0x210bc5[_0x96ee('0x22')]};}):[]};}):[]};}):[]:[]})[_0x96ee('0x12')](function(_0x555b14){logger['info'](_0x96ee('0x1c'),_0x4e0aa4);logger['debug'](_0x96ee('0x1c'),_0x4e0aa4,JSON[_0x96ee('0x26')](_0x555b14));_0x845763(_0x555b14);})[_0x96ee('0x1b')](function(_0x77f39b){logger['error'](_0x96ee('0x1c'),_0x77f39b[_0x96ee('0x1a')],_0x4e0aa4);_0x3636a9(_0x229a3d['error'](0x1f4,_0x77f39b[_0x96ee('0x1a')]));});});};exports[_0x96ee('0x27')]=function(_0x408b74){var _0x16b739=this;return new Promise(function(_0x11ebaf,_0x19f815){return db[_0x96ee('0x1d')]['find']({'raw':_0x408b74['options']?_0x408b74[_0x96ee('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x408b74[_0x96ee('0x1f')]?_0x408b74[_0x96ee('0x1f')][_0x96ee('0x21')]||null:null,'attributes':_0x408b74[_0x96ee('0x1f')]?_0x408b74[_0x96ee('0x1f')][_0x96ee('0x22')]||null:null,'include':_0x408b74[_0x96ee('0x1f')]?_0x408b74[_0x96ee('0x1f')][_0x96ee('0x23')]?_['map'](_0x408b74[_0x96ee('0x1f')][_0x96ee('0x23')],function(_0x337965){return{'model':db[_0x337965['model']],'as':_0x337965['as'],'attributes':_0x337965[_0x96ee('0x22')],'include':_0x337965['include']?_['map'](_0x337965[_0x96ee('0x23')],function(_0x3cd1e0){return{'model':db[_0x3cd1e0['model']],'as':_0x3cd1e0['as'],'attributes':_0x3cd1e0[_0x96ee('0x22')],'include':_0x3cd1e0[_0x96ee('0x23')]?_[_0x96ee('0x24')](_0x3cd1e0[_0x96ee('0x23')],function(_0x30cd02){return{'model':db[_0x30cd02[_0x96ee('0x25')]],'as':_0x30cd02['as'],'attributes':_0x30cd02[_0x96ee('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1f255f){logger[_0x96ee('0x13')]('ShowVoiceQueue',_0x408b74);logger['debug'](_0x96ee('0x27'),_0x408b74,JSON[_0x96ee('0x26')](_0x1f255f));_0x11ebaf(_0x1f255f);})[_0x96ee('0x1b')](function(_0x3ba4f4){logger[_0x96ee('0x18')]('ShowVoiceQueue',_0x3ba4f4['message'],_0x408b74);_0x19f815(_0x16b739[_0x96ee('0x18')](0x1f4,_0x3ba4f4['message']));});});}; \ No newline at end of file +var _0x1c0a=['rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./voiceQueue.socket','register','request','then','VoiceQueue,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','limit','include','map','model','attributes','info','stringify','ShowVoiceQueue','find','lodash','util','ioredis','../../config/utils','../../config/logger'];(function(_0x3ca9d5,_0x338953){var _0x522c84=function(_0x1ccd18){while(--_0x1ccd18){_0x3ca9d5['push'](_0x3ca9d5['shift']());}};_0x522c84(++_0x338953);}(_0x1c0a,0x113));var _0xa1c0=function(_0x5832cc,_0x3e3607){_0x5832cc=_0x5832cc-0x0;var _0x22d8a3=_0x1c0a[_0x5832cc];return _0x22d8a3;};'use strict';var _=require(_0xa1c0('0x0'));var util=require(_0xa1c0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa1c0('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xa1c0('0x3'));var logger=require(_0xa1c0('0x4'))(_0xa1c0('0x5'));var config=require(_0xa1c0('0x6'));var jayson=require(_0xa1c0('0x7'));var client=jayson[_0xa1c0('0x8')][_0xa1c0('0x9')]({'port':0x232a});config[_0xa1c0('0xa')]=_[_0xa1c0('0xb')](config[_0xa1c0('0xa')],{'host':_0xa1c0('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa1c0('0xd'))[_0xa1c0('0xe')](socket);function respondWithRpcPromise(_0xe61616,_0x5f3de9,_0x126aa2){return new BPromise(function(_0x1be01b,_0x3a5482){return client[_0xa1c0('0xf')](_0xe61616,_0x126aa2)[_0xa1c0('0x10')](function(_0x243c1c){logger['info'](_0xa1c0('0x11'),_0x5f3de9,'request\x20sent');logger[_0xa1c0('0x12')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x5f3de9,_0xa1c0('0x13'),JSON['stringify'](_0x243c1c));if(_0x243c1c[_0xa1c0('0x14')]){if(_0x243c1c['error'][_0xa1c0('0x15')]===0x1f4){logger[_0xa1c0('0x14')](_0xa1c0('0x11'),_0x5f3de9,_0x243c1c[_0xa1c0('0x14')][_0xa1c0('0x16')]);return _0x3a5482(_0x243c1c['error']['message']);}logger[_0xa1c0('0x14')](_0xa1c0('0x11'),_0x5f3de9,_0x243c1c[_0xa1c0('0x14')]['message']);return _0x1be01b(_0x243c1c['error'][_0xa1c0('0x16')]);}else{logger['info'](_0xa1c0('0x11'),_0x5f3de9,_0xa1c0('0x13'));_0x1be01b(_0x243c1c[_0xa1c0('0x17')][_0xa1c0('0x16')]);}})[_0xa1c0('0x18')](function(_0x52afc4){logger[_0xa1c0('0x14')]('VoiceQueue,\x20%s,\x20%s',_0x5f3de9,_0x52afc4);_0x3a5482(_0x52afc4);});});}exports[_0xa1c0('0x19')]=function(_0x56cf0b){var _0x2591d0=this;return new Promise(function(_0x2fc4ec,_0xdf70db){return db[_0xa1c0('0x1a')][_0xa1c0('0x1b')]({'raw':_0x56cf0b[_0xa1c0('0x1c')]?_0x56cf0b[_0xa1c0('0x1c')][_0xa1c0('0x1d')]===undefined?!![]:![]:!![],'where':_0x56cf0b[_0xa1c0('0x1c')]?_0x56cf0b[_0xa1c0('0x1c')][_0xa1c0('0x1e')]||null:null,'attributes':_0x56cf0b[_0xa1c0('0x1c')]?_0x56cf0b[_0xa1c0('0x1c')]['attributes']||null:null,'limit':_0x56cf0b[_0xa1c0('0x1c')]?_0x56cf0b['options'][_0xa1c0('0x1f')]||null:null,'include':_0x56cf0b[_0xa1c0('0x1c')]?_0x56cf0b['options'][_0xa1c0('0x20')]?_[_0xa1c0('0x21')](_0x56cf0b[_0xa1c0('0x1c')][_0xa1c0('0x20')],function(_0x618508){return{'model':db[_0x618508[_0xa1c0('0x22')]],'as':_0x618508['as'],'attributes':_0x618508[_0xa1c0('0x23')],'include':_0x618508[_0xa1c0('0x20')]?_['map'](_0x618508[_0xa1c0('0x20')],function(_0x3fe153){return{'model':db[_0x3fe153['model']],'as':_0x3fe153['as'],'attributes':_0x3fe153[_0xa1c0('0x23')],'include':_0x3fe153['include']?_[_0xa1c0('0x21')](_0x3fe153[_0xa1c0('0x20')],function(_0x3977a8){return{'model':db[_0x3977a8[_0xa1c0('0x22')]],'as':_0x3977a8['as'],'attributes':_0x3977a8['attributes']};}):[]};}):[]};}):[]:[]})[_0xa1c0('0x10')](function(_0x2a339f){logger[_0xa1c0('0x24')](_0xa1c0('0x19'),_0x56cf0b);logger[_0xa1c0('0x12')](_0xa1c0('0x19'),_0x56cf0b,JSON[_0xa1c0('0x25')](_0x2a339f));_0x2fc4ec(_0x2a339f);})['catch'](function(_0x106b44){logger['error']('GetVoiceQueue',_0x106b44[_0xa1c0('0x16')],_0x56cf0b);_0xdf70db(_0x2591d0[_0xa1c0('0x14')](0x1f4,_0x106b44['message']));});});};exports[_0xa1c0('0x26')]=function(_0x56f73d){var _0x599327=this;return new Promise(function(_0x1e964a,_0x17a885){return db[_0xa1c0('0x1a')][_0xa1c0('0x27')]({'raw':_0x56f73d['options']?_0x56f73d[_0xa1c0('0x1c')][_0xa1c0('0x1d')]===undefined?!![]:![]:!![],'where':_0x56f73d[_0xa1c0('0x1c')]?_0x56f73d[_0xa1c0('0x1c')][_0xa1c0('0x1e')]||null:null,'attributes':_0x56f73d[_0xa1c0('0x1c')]?_0x56f73d[_0xa1c0('0x1c')]['attributes']||null:null,'include':_0x56f73d[_0xa1c0('0x1c')]?_0x56f73d[_0xa1c0('0x1c')]['include']?_[_0xa1c0('0x21')](_0x56f73d[_0xa1c0('0x1c')][_0xa1c0('0x20')],function(_0x360da1){return{'model':db[_0x360da1[_0xa1c0('0x22')]],'as':_0x360da1['as'],'attributes':_0x360da1[_0xa1c0('0x23')],'include':_0x360da1[_0xa1c0('0x20')]?_['map'](_0x360da1[_0xa1c0('0x20')],function(_0x6d87dd){return{'model':db[_0x6d87dd[_0xa1c0('0x22')]],'as':_0x6d87dd['as'],'attributes':_0x6d87dd['attributes'],'include':_0x6d87dd[_0xa1c0('0x20')]?_[_0xa1c0('0x21')](_0x6d87dd[_0xa1c0('0x20')],function(_0x86ca89){return{'model':db[_0x86ca89[_0xa1c0('0x22')]],'as':_0x86ca89['as'],'attributes':_0x86ca89['attributes']};}):[]};}):[]};}):[]:[]})[_0xa1c0('0x10')](function(_0x6562f6){logger['info'](_0xa1c0('0x26'),_0x56f73d);logger[_0xa1c0('0x12')](_0xa1c0('0x26'),_0x56f73d,JSON[_0xa1c0('0x25')](_0x6562f6));_0x1e964a(_0x6562f6);})[_0xa1c0('0x18')](function(_0x594abd){logger['error'](_0xa1c0('0x26'),_0x594abd[_0xa1c0('0x16')],_0x56f73d);_0x17a885(_0x599327[_0xa1c0('0x14')](0x1f4,_0x594abd['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 6aaec2c..e4701dd 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 _0x989c=['emit','removeListener','register','length','voiceQueue:','./voiceQueue.events','save','remove','update'];(function(_0x580238,_0x2adec2){var _0x3d5608=function(_0x281c35){while(--_0x281c35){_0x580238['push'](_0x580238['shift']());}};_0x3d5608(++_0x2adec2);}(_0x989c,0x17f));var _0xc989=function(_0x2878b4,_0x1e5020){_0x2878b4=_0x2878b4-0x0;var _0x491938=_0x989c[_0x2878b4];return _0x491938;};'use strict';var VoiceQueueEvents=require(_0xc989('0x0'));var events=[_0xc989('0x1'),_0xc989('0x2'),_0xc989('0x3')];function createListener(_0x2cf6cd,_0x17f919){return function(_0x11ff55){_0x17f919[_0xc989('0x4')](_0x2cf6cd,_0x11ff55);};}function removeListener(_0x370009,_0x4673ea){return function(){VoiceQueueEvents[_0xc989('0x5')](_0x370009,_0x4673ea);};}exports[_0xc989('0x6')]=function(_0x2b3ed2){for(var _0x5b6d18=0x0,_0x1b1420=events[_0xc989('0x7')];_0x5b6d18<_0x1b1420;_0x5b6d18++){var _0x1d4f09=events[_0x5b6d18];var _0x12806d=createListener(_0xc989('0x8')+_0x1d4f09,_0x2b3ed2);VoiceQueueEvents['on'](_0x1d4f09,_0x12806d);}}; \ No newline at end of file +var _0xe9e5=['register','length','voiceQueue:','save','remove','update','emit','removeListener'];(function(_0x5a0950,_0x38e796){var _0x52b631=function(_0x1cfcab){while(--_0x1cfcab){_0x5a0950['push'](_0x5a0950['shift']());}};_0x52b631(++_0x38e796);}(_0xe9e5,0x183));var _0x5e9e=function(_0x12feb2,_0x3b22a3){_0x12feb2=_0x12feb2-0x0;var _0x45fe1f=_0xe9e5[_0x12feb2];return _0x45fe1f;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0x5e9e('0x0'),_0x5e9e('0x1'),_0x5e9e('0x2')];function createListener(_0x3f37be,_0x152f10){return function(_0x58dfac){_0x152f10[_0x5e9e('0x3')](_0x3f37be,_0x58dfac);};}function removeListener(_0x135f04,_0x3ba0f2){return function(){VoiceQueueEvents[_0x5e9e('0x4')](_0x135f04,_0x3ba0f2);};}exports[_0x5e9e('0x5')]=function(_0x5c720f){for(var _0x1b867e=0x0,_0x62a4ba=events[_0x5e9e('0x6')];_0x1b867e<_0x62a4ba;_0x1b867e++){var _0x3982f2=events[_0x1b867e];var _0x3c607d=createListener(_0x5e9e('0x7')+_0x3982f2,_0x5c720f);VoiceQueueEvents['on'](_0x3982f2,_0x3c607d);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 50eb3e3..d02abde 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 _0x69cd=['fs-extra','../../components/auth/service','../../config/environment','./voiceQueueReport.controller','isAuthenticated','index','get','describe','/index','getVoiceQueuesReport','/:id','show','destroy','exports','util','connect-timeout','express'];(function(_0x30dc0e,_0x44622d){var _0x2e2d7b=function(_0xc3de62){while(--_0xc3de62){_0x30dc0e['push'](_0x30dc0e['shift']());}};_0x2e2d7b(++_0x44622d);}(_0x69cd,0xb8));var _0xd69c=function(_0x5f25b3,_0x35481a){_0x5f25b3=_0x5f25b3-0x0;var _0x4ab9bf=_0x69cd[_0x5f25b3];return _0x4ab9bf;};'use strict';var multer=require('multer');var util=require(_0xd69c('0x0'));var path=require('path');var timeout=require(_0xd69c('0x1'));var express=require(_0xd69c('0x2'));var router=express['Router']();var fs_extra=require(_0xd69c('0x3'));var auth=require(_0xd69c('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xd69c('0x5'));var controller=require(_0xd69c('0x6'));router['get']('/',auth[_0xd69c('0x7')](),controller[_0xd69c('0x8')]);router[_0xd69c('0x9')]('/describe',auth[_0xd69c('0x7')](),controller[_0xd69c('0xa')]);router[_0xd69c('0x9')](_0xd69c('0xb'),auth['isAuthenticated'](),controller[_0xd69c('0xc')]);router[_0xd69c('0x9')](_0xd69c('0xd'),auth['isAuthenticated'](),controller[_0xd69c('0xe')]);router['post']('/',auth[_0xd69c('0x7')](),controller['create']);router['put'](_0xd69c('0xd'),auth[_0xd69c('0x7')](),controller['update']);router['delete'](_0xd69c('0xd'),auth[_0xd69c('0x7')](),controller[_0xd69c('0xf')]);module[_0xd69c('0x10')]=router; \ No newline at end of file +var _0xe005=['../../config/environment','./voiceQueueReport.controller','isAuthenticated','index','/describe','describe','/index','getVoiceQueuesReport','get','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x566599,_0x1cc824){var _0x2d6cf1=function(_0x2cfa78){while(--_0x2cfa78){_0x566599['push'](_0x566599['shift']());}};_0x2d6cf1(++_0x1cc824);}(_0xe005,0x17a));var _0x5e00=function(_0x5ad58e,_0xa4b2e1){_0x5ad58e=_0x5ad58e-0x0;var _0x1c953b=_0xe005[_0x5ad58e];return _0x1c953b;};'use strict';var multer=require(_0x5e00('0x0'));var util=require(_0x5e00('0x1'));var path=require(_0x5e00('0x2'));var timeout=require(_0x5e00('0x3'));var express=require('express');var router=express[_0x5e00('0x4')]();var fs_extra=require(_0x5e00('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5e00('0x6'));var controller=require(_0x5e00('0x7'));router['get']('/',auth[_0x5e00('0x8')](),controller[_0x5e00('0x9')]);router['get'](_0x5e00('0xa'),auth['isAuthenticated'](),controller[_0x5e00('0xb')]);router['get'](_0x5e00('0xc'),auth[_0x5e00('0x8')](),controller[_0x5e00('0xd')]);router[_0x5e00('0xe')]('/:id',auth[_0x5e00('0x8')](),controller[_0x5e00('0xf')]);router[_0x5e00('0x10')]('/',auth['isAuthenticated'](),controller[_0x5e00('0x11')]);router[_0x5e00('0x12')](_0x5e00('0x13'),auth[_0x5e00('0x8')](),controller[_0x5e00('0x14')]);router[_0x5e00('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x5e00('0x16')]);module[_0x5e00('0x17')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index b83e4fa..f5317da 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 _0x19c1=['format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','queuecallerjoinAt'];(function(_0x838519,_0x36361d){var _0x45f5bb=function(_0x2aa6dd){while(--_0x2aa6dd){_0x838519['push'](_0x838519['shift']());}};_0x45f5bb(++_0x36361d);}(_0x19c1,0xbb));var _0x119c=function(_0x57f7c8,_0x39efe3){_0x57f7c8=_0x57f7c8-0x0;var _0x2c9e17=_0x19c1[_0x57f7c8];return _0x2c9e17;};'use strict';var Sequelize=require(_0x119c('0x0'));var moment=require('moment');module[_0x119c('0x1')]={'type':{'type':Sequelize[_0x119c('0x2')]},'uniqueid':{'type':Sequelize[_0x119c('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x119c('0x2')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0x119c('0x3')],'set':function(_0x102330){var _0x55c418=moment(_0x102330);var _0x50f51d=moment(this['getDataValue'](_0x119c('0x4')))[_0x119c('0x5')](_0x119c('0x6'));var _0x52c91e=_0x55c418[_0x119c('0x7')](_0x50f51d,_0x119c('0x8'));this[_0x119c('0x9')](_0x119c('0xa'),_0x102330);this[_0x119c('0x9')](_0x119c('0xb'),_0x52c91e||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0x119c('0xc')]},'queuecallerabandon':{'type':Sequelize[_0x119c('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0x119c('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x119c('0x3')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x119c('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0x119c('0x2')],'comment':_0x119c('0xe')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0x119c('0x2')]},'connectedlinenum':{'type':Sequelize[_0x119c('0x2')]},'connectedlinename':{'type':Sequelize[_0x119c('0x2')]},'accountcode':{'type':Sequelize[_0x119c('0x2')]},'context':{'type':Sequelize[_0x119c('0x2')]},'exten':{'type':Sequelize[_0x119c('0x2')]},'priority':{'type':Sequelize[_0x119c('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x119c('0x2')]},'transfer':{'type':Sequelize[_0x119c('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x119c('0x2')],'comment':_0x119c('0xf')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x119c('0x2')]},'secondDisposition':{'type':Sequelize[_0x119c('0x2')]},'thirdDisposition':{'type':Sequelize[_0x119c('0x2')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xfac4=['holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','STRING','DATE','getDataValue','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','diff','queuecallerleaveAt','setDataValue'];(function(_0x25d0c9,_0x56d564){var _0x3f2cea=function(_0x4bf6bf){while(--_0x4bf6bf){_0x25d0c9['push'](_0x25d0c9['shift']());}};_0x3f2cea(++_0x56d564);}(_0xfac4,0x7d));var _0x4fac=function(_0x20f2c5,_0x4f55b6){_0x20f2c5=_0x20f2c5-0x0;var _0x60bd02=_0xfac4[_0x20f2c5];return _0x60bd02;};'use strict';var Sequelize=require(_0x4fac('0x0'));var moment=require(_0x4fac('0x1'));module['exports']={'type':{'type':Sequelize[_0x4fac('0x2')]},'uniqueid':{'type':Sequelize[_0x4fac('0x2')]},'calleridnum':{'type':Sequelize[_0x4fac('0x2')]},'calleridname':{'type':Sequelize[_0x4fac('0x2')]},'queue':{'type':Sequelize[_0x4fac('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x4fac('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x4fac('0x3')],'set':function(_0x4ac0d7){var _0x41e318=moment(_0x4ac0d7);var _0x24e62c=moment(this[_0x4fac('0x4')](_0x4fac('0x5')))['format'](_0x4fac('0x6'));var _0x285f4a=_0x41e318[_0x4fac('0x7')](_0x24e62c,'seconds');this['setDataValue'](_0x4fac('0x8'),_0x4ac0d7);this[_0x4fac('0x9')](_0x4fac('0xa'),_0x285f4a||null);}},'position':{'type':Sequelize[_0x4fac('0xb')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0x4fac('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x4fac('0x3')]},'queuecallercomplete':{'type':Sequelize[_0x4fac('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x4fac('0x3')]},'queuecallerexit':{'type':Sequelize[_0x4fac('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x4fac('0x3')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0x4fac('0xd')},'originalposition':{'type':Sequelize[_0x4fac('0xb')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x4fac('0x2')]},'connectedlinename':{'type':Sequelize[_0x4fac('0x2')]},'accountcode':{'type':Sequelize[_0x4fac('0x2')]},'context':{'type':Sequelize[_0x4fac('0x2')]},'exten':{'type':Sequelize[_0x4fac('0x2')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0x4fac('0xb')]},'mohtime':{'type':Sequelize[_0x4fac('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x4fac('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x4fac('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x4fac('0x2')],'comment':_0x4fac('0xe')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x4fac('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x4fac('0x2')]},'thirdDisposition':{'type':Sequelize[_0x4fac('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0x4fac('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 0b8ef37..57540d0 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 _0x1085=['pick','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','status','offset','undefined','limit','count','set','json','apply','reject','save','destroy','then','end','sendStatus','stack','name','send','map','VoiceQueueReport','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','find','create','body','update','describe','getVoiceQueuesReport','order'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x1085,0xfd));var _0x5108=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1085[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x5108('0x0'));var rimraf=require(_0x5108('0x1'));var zipdir=require(_0x5108('0x2'));var jsonpatch=require(_0x5108('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5108('0x4'));var util=require(_0x5108('0x5'));var path=require(_0x5108('0x6'));var sox=require(_0x5108('0x7'));var csv=require(_0x5108('0x8'));var ejs=require(_0x5108('0x9'));var fs=require('fs');var fs_extra=require(_0x5108('0xa'));var _=require(_0x5108('0xb'));var squel=require(_0x5108('0xc'));var crypto=require(_0x5108('0xd'));var jsforce=require(_0x5108('0xe'));var deskjs=require(_0x5108('0xf'));var toCsv=require('to-csv');var querystring=require(_0x5108('0x10'));var Papa=require(_0x5108('0x11'));var Redis=require(_0x5108('0x12'));var authService=require(_0x5108('0x13'));var qs=require(_0x5108('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5108('0x15'));var logger=require(_0x5108('0x16'))(_0x5108('0x17'));var utils=require(_0x5108('0x18'));var config=require(_0x5108('0x19'));var licenseUtil=require(_0x5108('0x1a'));var db=require(_0x5108('0x1b'))['db'];config['redis']=_[_0x5108('0x1c')](config[_0x5108('0x1d')],{'host':_0x5108('0x1e'),'port':0x18eb});var socket=require(_0x5108('0x1f'))(new Redis(config[_0x5108('0x1d')]));require('./voiceQueueReport.socket')['register'](socket);function respondWithStatusCode(_0x2a2a24,_0x37ef8f){_0x37ef8f=_0x37ef8f||0xcc;return function(_0x24ae88){if(_0x24ae88){return _0x2a2a24['sendStatus'](_0x37ef8f);}return _0x2a2a24['status'](_0x37ef8f)['end']();};}function respondWithResult(_0x4b71b9,_0x2a08fc){_0x2a08fc=_0x2a08fc||0xc8;return function(_0xe135ba){if(_0xe135ba){return _0x4b71b9[_0x5108('0x20')](_0x2a08fc)['json'](_0xe135ba);}};}function respondWithFilteredResult(_0x460e18,_0x473e43){return function(_0x10cb4a){if(_0x10cb4a){var _0x5aab67=typeof _0x473e43[_0x5108('0x21')]===_0x5108('0x22')&&typeof _0x473e43[_0x5108('0x23')]===_0x5108('0x22');var _0x545514=_0x10cb4a[_0x5108('0x24')];var _0x4490cd=_0x5aab67?0x0:_0x473e43[_0x5108('0x21')];var _0x560c48=_0x5aab67?_0x10cb4a[_0x5108('0x24')]:_0x473e43[_0x5108('0x21')]+_0x473e43[_0x5108('0x23')];var _0x4cbdf1;if(_0x560c48>=_0x545514){_0x560c48=_0x545514;_0x4cbdf1=0xc8;}else{_0x4cbdf1=0xce;}_0x460e18[_0x5108('0x20')](_0x4cbdf1);return _0x460e18[_0x5108('0x25')]('Content-Range',_0x4490cd+'-'+_0x560c48+'/'+_0x545514)[_0x5108('0x26')](_0x10cb4a);}return null;};}function patchUpdates(_0x5d231a){return function(_0x1c59a4){try{jsonpatch[_0x5108('0x27')](_0x1c59a4,_0x5d231a,!![]);}catch(_0xeb3ed){return BPromise[_0x5108('0x28')](_0xeb3ed);}return _0x1c59a4[_0x5108('0x29')]();};}function saveUpdates(_0x4df5ab,_0x586b2a){return function(_0x57285e){if(_0x57285e){return _0x57285e['update'](_0x4df5ab)['then'](function(_0x32d2c9){return _0x32d2c9;});}return null;};}function removeEntity(_0x1801cb,_0x33cc28){return function(_0x562ad7){if(_0x562ad7){return _0x562ad7[_0x5108('0x2a')]()[_0x5108('0x2b')](function(){_0x1801cb['status'](0xcc)[_0x5108('0x2c')]();});}};}function handleEntityNotFound(_0xfc1a4b,_0x4d6e22){return function(_0x28ee21){if(!_0x28ee21){_0xfc1a4b[_0x5108('0x2d')](0x194);}return _0x28ee21;};}function handleError(_0x5edf82,_0x380f37){_0x380f37=_0x380f37||0x1f4;return function(_0x22a564){logger['error'](_0x22a564[_0x5108('0x2e')]);if(_0x22a564['name']){delete _0x22a564[_0x5108('0x2f')];}_0x5edf82[_0x5108('0x20')](_0x380f37)[_0x5108('0x30')](_0x22a564);};}exports['index']=function(_0x2cf86d,_0x1165c0){var _0x4b1da4={},_0x3f7c14={},_0x62e362={'count':0x0,'rows':[]};var _0x53c776=_[_0x5108('0x31')](db[_0x5108('0x32')][_0x5108('0x33')],function(_0x2617dc){return{'name':_0x2617dc[_0x5108('0x34')],'type':_0x2617dc[_0x5108('0x35')]['key']};});_0x3f7c14[_0x5108('0x36')]=_[_0x5108('0x31')](_0x53c776,'name');_0x3f7c14[_0x5108('0x37')]=_[_0x5108('0x38')](_0x2cf86d[_0x5108('0x37')]);_0x3f7c14['filters']=_[_0x5108('0x39')](_0x3f7c14['model'],_0x3f7c14[_0x5108('0x37')]);_0x4b1da4[_0x5108('0x3a')]=_[_0x5108('0x39')](_0x3f7c14[_0x5108('0x36')],qs[_0x5108('0x3b')](_0x2cf86d[_0x5108('0x37')][_0x5108('0x3b')]));_0x4b1da4[_0x5108('0x3a')]=_0x4b1da4[_0x5108('0x3a')][_0x5108('0x3c')]?_0x4b1da4[_0x5108('0x3a')]:_0x3f7c14['model'];if(!_0x2cf86d[_0x5108('0x37')][_0x5108('0x3d')](_0x5108('0x3e'))){_0x4b1da4[_0x5108('0x23')]=qs[_0x5108('0x23')](_0x2cf86d[_0x5108('0x37')]['limit']);_0x4b1da4[_0x5108('0x21')]=qs[_0x5108('0x21')](_0x2cf86d[_0x5108('0x37')][_0x5108('0x21')]);}_0x4b1da4['order']=qs['sort'](_0x2cf86d[_0x5108('0x37')][_0x5108('0x3f')]);_0x4b1da4[_0x5108('0x40')]=qs[_0x5108('0x41')](_['pick'](_0x2cf86d[_0x5108('0x37')],_0x3f7c14[_0x5108('0x41')]),_0x53c776);if(_0x2cf86d[_0x5108('0x37')][_0x5108('0x42')]){_0x4b1da4[_0x5108('0x40')]=_['merge'](_0x4b1da4['where'],{'$or':_['map'](_0x53c776,function(_0x135c3){if(_0x135c3[_0x5108('0x35')]!==_0x5108('0x43')){var _0x14ac9d={};_0x14ac9d[_0x135c3[_0x5108('0x2f')]]={'$like':'%'+_0x2cf86d[_0x5108('0x37')][_0x5108('0x42')]+'%'};return _0x14ac9d;}})});}_0x4b1da4=_[_0x5108('0x44')]({},_0x4b1da4,_0x2cf86d[_0x5108('0x45')]);var _0x4a2c8c={'where':_0x4b1da4[_0x5108('0x40')]};return db[_0x5108('0x32')]['count'](_0x4a2c8c)[_0x5108('0x2b')](function(_0xf5f8ef){_0x62e362[_0x5108('0x24')]=_0xf5f8ef;if(_0x2cf86d[_0x5108('0x37')][_0x5108('0x46')]){_0x4b1da4[_0x5108('0x47')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x5108('0x48')](_0x4b1da4);})['then'](function(_0x33929e){_0x62e362['rows']=_0x33929e;return _0x62e362;})['then'](respondWithFilteredResult(_0x1165c0,_0x4b1da4))[_0x5108('0x49')](handleError(_0x1165c0,null));};exports[_0x5108('0x4a')]=function(_0x29e191,_0x3fbb67){var _0x64acea={'raw':![],'where':{'id':_0x29e191[_0x5108('0x4b')]['id']}},_0x247594={};_0x247594[_0x5108('0x36')]=_[_0x5108('0x38')](db[_0x5108('0x32')][_0x5108('0x33')]);_0x247594[_0x5108('0x37')]=_[_0x5108('0x38')](_0x29e191[_0x5108('0x37')]);_0x247594[_0x5108('0x41')]=_[_0x5108('0x39')](_0x247594['model'],_0x247594[_0x5108('0x37')]);_0x64acea[_0x5108('0x3a')]=_[_0x5108('0x39')](_0x247594[_0x5108('0x36')],qs['fields'](_0x29e191[_0x5108('0x37')][_0x5108('0x3b')]));_0x64acea[_0x5108('0x3a')]=_0x64acea[_0x5108('0x3a')][_0x5108('0x3c')]?_0x64acea['attributes']:_0x247594['model'];if(_0x29e191['query'][_0x5108('0x46')]){_0x64acea[_0x5108('0x47')]=[{'all':!![]}];}_0x64acea=_[_0x5108('0x44')]({},_0x64acea,_0x29e191[_0x5108('0x45')]);return db[_0x5108('0x32')][_0x5108('0x4c')](_0x64acea)[_0x5108('0x2b')](handleEntityNotFound(_0x3fbb67,null))[_0x5108('0x2b')](respondWithResult(_0x3fbb67,null))['catch'](handleError(_0x3fbb67,null));};exports[_0x5108('0x4d')]=function(_0x5528e8,_0x1862c8){return db['VoiceQueueReport']['create'](_0x5528e8[_0x5108('0x4e')],{})[_0x5108('0x2b')](respondWithResult(_0x1862c8,0xc9))[_0x5108('0x49')](handleError(_0x1862c8,null));};exports[_0x5108('0x4f')]=function(_0x5efc87,_0x5d4826){if(_0x5efc87[_0x5108('0x4e')]['id']){delete _0x5efc87[_0x5108('0x4e')]['id'];}return db[_0x5108('0x32')][_0x5108('0x4c')]({'where':{'id':_0x5efc87[_0x5108('0x4b')]['id']}})[_0x5108('0x2b')](handleEntityNotFound(_0x5d4826,null))[_0x5108('0x2b')](saveUpdates(_0x5efc87[_0x5108('0x4e')],null))['then'](respondWithResult(_0x5d4826,null))[_0x5108('0x49')](handleError(_0x5d4826,null));};exports['destroy']=function(_0x4b55b2,_0x2754ad){return db[_0x5108('0x32')][_0x5108('0x4c')]({'where':{'id':_0x4b55b2[_0x5108('0x4b')]['id']}})[_0x5108('0x2b')](handleEntityNotFound(_0x2754ad,null))[_0x5108('0x2b')](removeEntity(_0x2754ad,null))[_0x5108('0x49')](handleError(_0x2754ad,null));};exports['describe']=function(_0xc8e333,_0x33027e){return db[_0x5108('0x32')][_0x5108('0x50')]()[_0x5108('0x2b')](respondWithResult(_0x33027e,null))['catch'](handleError(_0x33027e,null));};exports[_0x5108('0x51')]=function(_0x33bac4,_0x3415cc){var _0xe286db={},_0xbdf95f={},_0x4a2837={'count':0x0,'rows':[]};_0xbdf95f[_0x5108('0x36')]=_[_0x5108('0x38')](db[_0x5108('0x32')][_0x5108('0x33')]);_0xbdf95f[_0x5108('0x37')]=_[_0x5108('0x38')](_0x33bac4[_0x5108('0x37')]);_0xbdf95f['filters']=_['intersection'](_0xbdf95f[_0x5108('0x36')],_0xbdf95f['query']);_0xe286db[_0x5108('0x3a')]=_[_0x5108('0x39')](_0xbdf95f[_0x5108('0x36')],qs['fields'](_0x33bac4['query'][_0x5108('0x3b')]));_0xe286db[_0x5108('0x3a')]=_0xe286db[_0x5108('0x3a')][_0x5108('0x3c')]?_0xe286db[_0x5108('0x3a')]:_0xbdf95f[_0x5108('0x36')];if(!_0x33bac4['query'][_0x5108('0x3d')](_0x5108('0x3e'))){_0xe286db[_0x5108('0x23')]=qs[_0x5108('0x23')](_0x33bac4[_0x5108('0x37')][_0x5108('0x23')]);_0xe286db[_0x5108('0x21')]=qs['offset'](_0x33bac4[_0x5108('0x37')][_0x5108('0x21')]);}_0xe286db[_0x5108('0x52')]=qs[_0x5108('0x3f')](_0x33bac4[_0x5108('0x37')]['sort']);_0xe286db[_0x5108('0x40')]=qs[_0x5108('0x41')](_[_0x5108('0x53')](_0x33bac4[_0x5108('0x37')],_0xbdf95f[_0x5108('0x41')]));if(_0x33bac4[_0x5108('0x37')][_0x5108('0x42')]){_0xe286db[_0x5108('0x40')]=_[_0x5108('0x44')](_0xe286db[_0x5108('0x40')],{'$or':_[_0x5108('0x31')](_0xe286db[_0x5108('0x3a')],function(_0x4de77a){var _0x43a2e4={};_0x43a2e4[_0x4de77a]={'$like':'%'+_0x33bac4[_0x5108('0x37')][_0x5108('0x42')]+'%'};return _0x43a2e4;})});}_0xe286db=_[_0x5108('0x44')]({},_0xe286db,_0x33bac4[_0x5108('0x45')]);var _0x3aee99={'where':_0xe286db[_0x5108('0x40')]};return db['VoiceQueueReport'][_0x5108('0x24')](_0x3aee99)[_0x5108('0x2b')](function(_0x18d539){_0x4a2837[_0x5108('0x24')]=_0x18d539;if(_0x33bac4['query'][_0x5108('0x46')]){_0xe286db['include']=[{'all':!![]}];}return db[_0x5108('0x32')][_0x5108('0x48')](_0xe286db);})[_0x5108('0x2b')](function(_0x4b541f){_0x4a2837['rows']=_0x4b541f;return _0x4a2837;})[_0x5108('0x2b')](respondWithFilteredResult(_0x3415cc,_0xe286db,_0x5108('0x51')))[_0x5108('0x49')](handleError(_0x3415cc,null,_0x5108('0x51')));}; \ No newline at end of file +var _0x4d3c=['fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','VoiceQueueReport','then','includeAll','findAll','rows','catch','params','rawAttributes','include','find','create','body','describe','getVoiceQueuesReport','map','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','destroy','error','name','send','index','fieldName','type','key','model','query','keys','filters','intersection','attributes'];(function(_0x910b9d,_0x541f20){var _0x1f1d3a=function(_0x40eb63){while(--_0x40eb63){_0x910b9d['push'](_0x910b9d['shift']());}};_0x1f1d3a(++_0x541f20);}(_0x4d3c,0x11d));var _0xc4d3=function(_0x3d03df,_0x239c7c){_0x3d03df=_0x3d03df-0x0;var _0xd97a15=_0x4d3c[_0x3d03df];return _0xd97a15;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc4d3('0x0'));var jsonpatch=require(_0xc4d3('0x1'));var rp=require(_0xc4d3('0x2'));var moment=require(_0xc4d3('0x3'));var BPromise=require(_0xc4d3('0x4'));var Mustache=require(_0xc4d3('0x5'));var util=require(_0xc4d3('0x6'));var path=require(_0xc4d3('0x7'));var sox=require(_0xc4d3('0x8'));var csv=require(_0xc4d3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc4d3('0xa'));var squel=require('squel');var crypto=require(_0xc4d3('0xb'));var jsforce=require(_0xc4d3('0xc'));var deskjs=require(_0xc4d3('0xd'));var toCsv=require(_0xc4d3('0x9'));var querystring=require(_0xc4d3('0xe'));var Papa=require(_0xc4d3('0xf'));var Redis=require(_0xc4d3('0x10'));var authService=require(_0xc4d3('0x11'));var qs=require(_0xc4d3('0x12'));var as=require(_0xc4d3('0x13'));var hardwareService=require(_0xc4d3('0x14'));var logger=require(_0xc4d3('0x15'))(_0xc4d3('0x16'));var utils=require(_0xc4d3('0x17'));var config=require(_0xc4d3('0x18'));var licenseUtil=require(_0xc4d3('0x19'));var db=require(_0xc4d3('0x1a'))['db'];config[_0xc4d3('0x1b')]=_[_0xc4d3('0x1c')](config[_0xc4d3('0x1b')],{'host':_0xc4d3('0x1d'),'port':0x18eb});var socket=require(_0xc4d3('0x1e'))(new Redis(config[_0xc4d3('0x1b')]));require(_0xc4d3('0x1f'))['register'](socket);function respondWithStatusCode(_0x7a28f3,_0x35669e){_0x35669e=_0x35669e||0xcc;return function(_0x302170){if(_0x302170){return _0x7a28f3[_0xc4d3('0x20')](_0x35669e);}return _0x7a28f3[_0xc4d3('0x21')](_0x35669e)[_0xc4d3('0x22')]();};}function respondWithResult(_0x5aa1f1,_0x3022e4){_0x3022e4=_0x3022e4||0xc8;return function(_0x1e503b){if(_0x1e503b){return _0x5aa1f1[_0xc4d3('0x21')](_0x3022e4)[_0xc4d3('0x23')](_0x1e503b);}};}function respondWithFilteredResult(_0x3803c2,_0x5d384f){return function(_0x2940a3){if(_0x2940a3){var _0x294baf=typeof _0x5d384f['offset']===_0xc4d3('0x24')&&typeof _0x5d384f[_0xc4d3('0x25')]==='undefined';var _0x30f60f=_0x2940a3[_0xc4d3('0x26')];var _0x5098e4=_0x294baf?0x0:_0x5d384f[_0xc4d3('0x27')];var _0x310314=_0x294baf?_0x2940a3['count']:_0x5d384f[_0xc4d3('0x27')]+_0x5d384f[_0xc4d3('0x25')];var _0xd76559;if(_0x310314>=_0x30f60f){_0x310314=_0x30f60f;_0xd76559=0xc8;}else{_0xd76559=0xce;}_0x3803c2['status'](_0xd76559);return _0x3803c2[_0xc4d3('0x28')](_0xc4d3('0x29'),_0x5098e4+'-'+_0x310314+'/'+_0x30f60f)[_0xc4d3('0x23')](_0x2940a3);}return null;};}function patchUpdates(_0x19ece6){return function(_0x194f64){try{jsonpatch[_0xc4d3('0x2a')](_0x194f64,_0x19ece6,!![]);}catch(_0x2fb29c){return BPromise['reject'](_0x2fb29c);}return _0x194f64[_0xc4d3('0x2b')]();};}function saveUpdates(_0x4a498,_0x2fb000){return function(_0x4dc125){if(_0x4dc125){return _0x4dc125[_0xc4d3('0x2c')](_0x4a498)['then'](function(_0x188110){return _0x188110;});}return null;};}function removeEntity(_0x3e7e8a,_0x25db5a){return function(_0x1f351e){if(_0x1f351e){return _0x1f351e[_0xc4d3('0x2d')]()['then'](function(){_0x3e7e8a[_0xc4d3('0x21')](0xcc)[_0xc4d3('0x22')]();});}};}function handleEntityNotFound(_0x3519f3,_0x1fafc1){return function(_0x1ad755){if(!_0x1ad755){_0x3519f3[_0xc4d3('0x20')](0x194);}return _0x1ad755;};}function handleError(_0x5f3234,_0x5ba227){_0x5ba227=_0x5ba227||0x1f4;return function(_0x548b3f){logger[_0xc4d3('0x2e')](_0x548b3f['stack']);if(_0x548b3f[_0xc4d3('0x2f')]){delete _0x548b3f[_0xc4d3('0x2f')];}_0x5f3234[_0xc4d3('0x21')](_0x5ba227)[_0xc4d3('0x30')](_0x548b3f);};}exports[_0xc4d3('0x31')]=function(_0x48eee6,_0x5f594e){var _0x59b696={},_0x5db789={},_0x5f29ae={'count':0x0,'rows':[]};var _0x54dbb8=_['map'](db['VoiceQueueReport']['rawAttributes'],function(_0xd6d3d){return{'name':_0xd6d3d[_0xc4d3('0x32')],'type':_0xd6d3d[_0xc4d3('0x33')][_0xc4d3('0x34')]};});_0x5db789[_0xc4d3('0x35')]=_['map'](_0x54dbb8,_0xc4d3('0x2f'));_0x5db789[_0xc4d3('0x36')]=_[_0xc4d3('0x37')](_0x48eee6[_0xc4d3('0x36')]);_0x5db789[_0xc4d3('0x38')]=_[_0xc4d3('0x39')](_0x5db789[_0xc4d3('0x35')],_0x5db789['query']);_0x59b696[_0xc4d3('0x3a')]=_[_0xc4d3('0x39')](_0x5db789['model'],qs[_0xc4d3('0x3b')](_0x48eee6[_0xc4d3('0x36')][_0xc4d3('0x3b')]));_0x59b696[_0xc4d3('0x3a')]=_0x59b696[_0xc4d3('0x3a')][_0xc4d3('0x3c')]?_0x59b696['attributes']:_0x5db789[_0xc4d3('0x35')];if(!_0x48eee6[_0xc4d3('0x36')][_0xc4d3('0x3d')](_0xc4d3('0x3e'))){_0x59b696[_0xc4d3('0x25')]=qs[_0xc4d3('0x25')](_0x48eee6[_0xc4d3('0x36')][_0xc4d3('0x25')]);_0x59b696[_0xc4d3('0x27')]=qs['offset'](_0x48eee6[_0xc4d3('0x36')][_0xc4d3('0x27')]);}_0x59b696[_0xc4d3('0x3f')]=qs['sort'](_0x48eee6[_0xc4d3('0x36')][_0xc4d3('0x40')]);_0x59b696['where']=qs[_0xc4d3('0x38')](_[_0xc4d3('0x41')](_0x48eee6[_0xc4d3('0x36')],_0x5db789[_0xc4d3('0x38')]),_0x54dbb8);if(_0x48eee6[_0xc4d3('0x36')][_0xc4d3('0x42')]){_0x59b696[_0xc4d3('0x43')]=_['merge'](_0x59b696[_0xc4d3('0x43')],{'$or':_['map'](_0x54dbb8,function(_0x354bc0){if(_0x354bc0[_0xc4d3('0x33')]!==_0xc4d3('0x44')){var _0x2fe8b1={};_0x2fe8b1[_0x354bc0[_0xc4d3('0x2f')]]={'$like':'%'+_0x48eee6[_0xc4d3('0x36')][_0xc4d3('0x42')]+'%'};return _0x2fe8b1;}})});}_0x59b696=_[_0xc4d3('0x45')]({},_0x59b696,_0x48eee6[_0xc4d3('0x46')]);var _0x289e2b={'where':_0x59b696['where']};return db[_0xc4d3('0x47')]['count'](_0x289e2b)[_0xc4d3('0x48')](function(_0x143a35){_0x5f29ae[_0xc4d3('0x26')]=_0x143a35;if(_0x48eee6[_0xc4d3('0x36')][_0xc4d3('0x49')]){_0x59b696['include']=[{'all':!![]}];}return db[_0xc4d3('0x47')][_0xc4d3('0x4a')](_0x59b696);})[_0xc4d3('0x48')](function(_0xd91e9f){_0x5f29ae[_0xc4d3('0x4b')]=_0xd91e9f;return _0x5f29ae;})[_0xc4d3('0x48')](respondWithFilteredResult(_0x5f594e,_0x59b696))[_0xc4d3('0x4c')](handleError(_0x5f594e,null));};exports['show']=function(_0x3b208f,_0x4c3f5c){var _0x53a28d={'raw':![],'where':{'id':_0x3b208f[_0xc4d3('0x4d')]['id']}},_0x215bab={};_0x215bab[_0xc4d3('0x35')]=_[_0xc4d3('0x37')](db['VoiceQueueReport'][_0xc4d3('0x4e')]);_0x215bab[_0xc4d3('0x36')]=_[_0xc4d3('0x37')](_0x3b208f[_0xc4d3('0x36')]);_0x215bab[_0xc4d3('0x38')]=_[_0xc4d3('0x39')](_0x215bab[_0xc4d3('0x35')],_0x215bab['query']);_0x53a28d['attributes']=_[_0xc4d3('0x39')](_0x215bab[_0xc4d3('0x35')],qs['fields'](_0x3b208f[_0xc4d3('0x36')][_0xc4d3('0x3b')]));_0x53a28d[_0xc4d3('0x3a')]=_0x53a28d['attributes'][_0xc4d3('0x3c')]?_0x53a28d[_0xc4d3('0x3a')]:_0x215bab['model'];if(_0x3b208f[_0xc4d3('0x36')]['includeAll']){_0x53a28d[_0xc4d3('0x4f')]=[{'all':!![]}];}_0x53a28d=_[_0xc4d3('0x45')]({},_0x53a28d,_0x3b208f[_0xc4d3('0x46')]);return db[_0xc4d3('0x47')][_0xc4d3('0x50')](_0x53a28d)['then'](handleEntityNotFound(_0x4c3f5c,null))[_0xc4d3('0x48')](respondWithResult(_0x4c3f5c,null))[_0xc4d3('0x4c')](handleError(_0x4c3f5c,null));};exports[_0xc4d3('0x51')]=function(_0x1e312d,_0x2dc866){return db[_0xc4d3('0x47')][_0xc4d3('0x51')](_0x1e312d[_0xc4d3('0x52')],{})[_0xc4d3('0x48')](respondWithResult(_0x2dc866,0xc9))[_0xc4d3('0x4c')](handleError(_0x2dc866,null));};exports[_0xc4d3('0x2c')]=function(_0x5370f2,_0x153682){if(_0x5370f2[_0xc4d3('0x52')]['id']){delete _0x5370f2[_0xc4d3('0x52')]['id'];}return db[_0xc4d3('0x47')][_0xc4d3('0x50')]({'where':{'id':_0x5370f2[_0xc4d3('0x4d')]['id']}})[_0xc4d3('0x48')](handleEntityNotFound(_0x153682,null))[_0xc4d3('0x48')](saveUpdates(_0x5370f2[_0xc4d3('0x52')],null))[_0xc4d3('0x48')](respondWithResult(_0x153682,null))[_0xc4d3('0x4c')](handleError(_0x153682,null));};exports[_0xc4d3('0x2d')]=function(_0x402494,_0x2d70ee){return db['VoiceQueueReport'][_0xc4d3('0x50')]({'where':{'id':_0x402494[_0xc4d3('0x4d')]['id']}})[_0xc4d3('0x48')](handleEntityNotFound(_0x2d70ee,null))[_0xc4d3('0x48')](removeEntity(_0x2d70ee,null))[_0xc4d3('0x4c')](handleError(_0x2d70ee,null));};exports['describe']=function(_0x350a88,_0x49644b){return db['VoiceQueueReport'][_0xc4d3('0x53')]()[_0xc4d3('0x48')](respondWithResult(_0x49644b,null))[_0xc4d3('0x4c')](handleError(_0x49644b,null));};exports[_0xc4d3('0x54')]=function(_0x52ad91,_0x33f07){var _0x5d3e94={},_0x4c3131={},_0x374727={'count':0x0,'rows':[]};_0x4c3131[_0xc4d3('0x35')]=_[_0xc4d3('0x37')](db[_0xc4d3('0x47')][_0xc4d3('0x4e')]);_0x4c3131['query']=_[_0xc4d3('0x37')](_0x52ad91[_0xc4d3('0x36')]);_0x4c3131[_0xc4d3('0x38')]=_['intersection'](_0x4c3131[_0xc4d3('0x35')],_0x4c3131[_0xc4d3('0x36')]);_0x5d3e94[_0xc4d3('0x3a')]=_[_0xc4d3('0x39')](_0x4c3131[_0xc4d3('0x35')],qs['fields'](_0x52ad91[_0xc4d3('0x36')][_0xc4d3('0x3b')]));_0x5d3e94[_0xc4d3('0x3a')]=_0x5d3e94[_0xc4d3('0x3a')][_0xc4d3('0x3c')]?_0x5d3e94[_0xc4d3('0x3a')]:_0x4c3131['model'];if(!_0x52ad91[_0xc4d3('0x36')][_0xc4d3('0x3d')]('nolimit')){_0x5d3e94['limit']=qs['limit'](_0x52ad91['query'][_0xc4d3('0x25')]);_0x5d3e94['offset']=qs[_0xc4d3('0x27')](_0x52ad91[_0xc4d3('0x36')][_0xc4d3('0x27')]);}_0x5d3e94['order']=qs[_0xc4d3('0x40')](_0x52ad91[_0xc4d3('0x36')]['sort']);_0x5d3e94[_0xc4d3('0x43')]=qs['filters'](_['pick'](_0x52ad91[_0xc4d3('0x36')],_0x4c3131['filters']));if(_0x52ad91[_0xc4d3('0x36')]['filter']){_0x5d3e94[_0xc4d3('0x43')]=_['merge'](_0x5d3e94['where'],{'$or':_[_0xc4d3('0x55')](_0x5d3e94['attributes'],function(_0x24343b){var _0x573a51={};_0x573a51[_0x24343b]={'$like':'%'+_0x52ad91[_0xc4d3('0x36')]['filter']+'%'};return _0x573a51;})});}_0x5d3e94=_[_0xc4d3('0x45')]({},_0x5d3e94,_0x52ad91[_0xc4d3('0x46')]);var _0x598696={'where':_0x5d3e94[_0xc4d3('0x43')]};return db[_0xc4d3('0x47')][_0xc4d3('0x26')](_0x598696)[_0xc4d3('0x48')](function(_0x22e3c8){_0x374727[_0xc4d3('0x26')]=_0x22e3c8;if(_0x52ad91[_0xc4d3('0x36')]['includeAll']){_0x5d3e94[_0xc4d3('0x4f')]=[{'all':!![]}];}return db[_0xc4d3('0x47')][_0xc4d3('0x4a')](_0x5d3e94);})[_0xc4d3('0x48')](function(_0x7f2dc1){_0x374727[_0xc4d3('0x4b')]=_0x7f2dc1;return _0x374727;})[_0xc4d3('0x48')](respondWithFilteredResult(_0x33f07,_0x5d3e94,_0xc4d3('0x54')))[_0xc4d3('0x4c')](handleError(_0x33f07,null,_0xc4d3('0x54')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 504aad9..394ed4c 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 _0xa749=['emit','hasOwnProperty','hook','exports','../../mysqldb','VoiceQueueReport','setMaxListeners','update','remove'];(function(_0x1122a2,_0x5652cb){var _0x43f720=function(_0x30fc80){while(--_0x30fc80){_0x1122a2['push'](_0x1122a2['shift']());}};_0x43f720(++_0x5652cb);}(_0xa749,0x148));var _0x9a74=function(_0x85e8ec,_0x504c0e){_0x85e8ec=_0x85e8ec-0x0;var _0x4209c7=_0xa749[_0x85e8ec];return _0x4209c7;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require(_0x9a74('0x0'))['db'][_0x9a74('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x9a74('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9a74('0x3'),'afterDestroy':_0x9a74('0x4')};function emitEvent(_0x150b09){return function(_0x5c2774,_0x3b31e8,_0x36570c){VoiceQueueReportEvents[_0x9a74('0x5')](_0x150b09+':'+_0x5c2774['id'],_0x5c2774);VoiceQueueReportEvents[_0x9a74('0x5')](_0x150b09,_0x5c2774);_0x36570c(null);};}for(var e in events){if(events[_0x9a74('0x6')](e)){var event=events[e];VoiceQueueReport[_0x9a74('0x7')](e,emitEvent(event));}}module[_0x9a74('0x8')]=VoiceQueueReportEvents; \ No newline at end of file +var _0xaba9=['exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners','save','remove','emit','hook'];(function(_0x4672cc,_0x2eb60b){var _0x221e92=function(_0x9f44b9){while(--_0x9f44b9){_0x4672cc['push'](_0x4672cc['shift']());}};_0x221e92(++_0x2eb60b);}(_0xaba9,0xfd));var _0x9aba=function(_0x27a526,_0x3f0efb){_0x27a526=_0x27a526-0x0;var _0x23afbb=_0xaba9[_0x27a526];return _0x23afbb;};'use strict';var EventEmitter=require(_0x9aba('0x0'));var VoiceQueueReport=require(_0x9aba('0x1'))['db'][_0x9aba('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x9aba('0x3')](0x0);var events={'afterCreate':_0x9aba('0x4'),'afterUpdate':'update','afterDestroy':_0x9aba('0x5')};function emitEvent(_0x17439d){return function(_0x19d84e,_0x54957c,_0x8038d5){VoiceQueueReportEvents[_0x9aba('0x6')](_0x17439d+':'+_0x19d84e['id'],_0x19d84e);VoiceQueueReportEvents[_0x9aba('0x6')](_0x17439d,_0x19d84e);_0x8038d5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0x9aba('0x7')](e,emitEvent(event));}}module[_0x9aba('0x8')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 86de342..43318d5 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 _0xf364=['report_queue','uniqueid','calleridnum','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','define','VoiceQueueReport'];(function(_0x294b45,_0x4e56ed){var _0x1d80c9=function(_0xbcfa67){while(--_0xbcfa67){_0x294b45['push'](_0x294b45['shift']());}};_0x1d80c9(++_0x4e56ed);}(_0xf364,0x78));var _0x4f36=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xf364[_0x47a7d0];return _0xb9bd08;};'use strict';var _=require(_0x4f36('0x0'));var util=require('util');var logger=require(_0x4f36('0x1'))(_0x4f36('0x2'));var moment=require(_0x4f36('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4f36('0x4'));var rimraf=require(_0x4f36('0x5'));var config=require(_0x4f36('0x6'));var attributes=require('./voiceQueueReport.attributes');module[_0x4f36('0x7')]=function(_0x1de3ca,_0x38700d){return _0x1de3ca[_0x4f36('0x8')](_0x4f36('0x9'),attributes,{'tableName':_0x4f36('0xa'),'paranoid':![],'indexes':[{'fields':[_0x4f36('0xb')]},{'fields':[_0x4f36('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbf48=['exports','define','VoiceQueueReport','calleridnum','lodash','api','moment','bluebird','request-promise'];(function(_0x3811da,_0x122831){var _0x23a0dc=function(_0xbb19a5){while(--_0xbb19a5){_0x3811da['push'](_0x3811da['shift']());}};_0x23a0dc(++_0x122831);}(_0xbf48,0x1c6));var _0x8bf4=function(_0x4c80e7,_0x4cf2d3){_0x4c80e7=_0x4c80e7-0x0;var _0x483b8e=_0xbf48[_0x4c80e7];return _0x483b8e;};'use strict';var _=require(_0x8bf4('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8bf4('0x1'));var moment=require(_0x8bf4('0x2'));var BPromise=require(_0x8bf4('0x3'));var rp=require(_0x8bf4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./voiceQueueReport.attributes');module[_0x8bf4('0x5')]=function(_0x1ecdba,_0x1be869){return _0x1ecdba[_0x8bf4('0x6')](_0x8bf4('0x7'),attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0x8bf4('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 97a392d..4bac859 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 _0x6b90=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','request','then','request\x20sent','debug','stringify','error','code','VoiceQueueReport,\x20%s,\x20%s','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','options','raw','where','limit','include','map','model','attributes','CreateVoiceQueueReport','create','body','info','UpdateVoiceQueueReport','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x43d16c,_0x2b5447){var _0x208cce=function(_0x371720){while(--_0x371720){_0x43d16c['push'](_0x43d16c['shift']());}};_0x208cce(++_0x2b5447);}(_0x6b90,0x16b));var _0x06b9=function(_0x4befae,_0x55b079){_0x4befae=_0x4befae-0x0;var _0x76c573=_0x6b90[_0x4befae];return _0x76c573;};'use strict';var _=require(_0x06b9('0x0'));var util=require(_0x06b9('0x1'));var moment=require(_0x06b9('0x2'));var BPromise=require(_0x06b9('0x3'));var rs=require(_0x06b9('0x4'));var fs=require('fs');var Redis=require(_0x06b9('0x5'));var db=require(_0x06b9('0x6'))['db'];var utils=require(_0x06b9('0x7'));var logger=require(_0x06b9('0x8'))('rpc');var config=require(_0x06b9('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x06b9('0xa')]({'port':0x232a});config[_0x06b9('0xb')]=_[_0x06b9('0xc')](config[_0x06b9('0xb')],{'host':_0x06b9('0xd'),'port':0x18eb});var socket=require(_0x06b9('0xe'))(new Redis(config[_0x06b9('0xb')]));require('./voiceQueueReport.socket')['register'](socket);function respondWithRpcPromise(_0x54e16a,_0x34f5df,_0x234f3d){return new BPromise(function(_0x4a96eb,_0x4fa8f2){return client[_0x06b9('0xf')](_0x54e16a,_0x234f3d)[_0x06b9('0x10')](function(_0x25c5a5){logger['info']('VoiceQueueReport,\x20%s,\x20%s',_0x34f5df,_0x06b9('0x11'));logger[_0x06b9('0x12')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x34f5df,'request\x20sent',JSON[_0x06b9('0x13')](_0x25c5a5));if(_0x25c5a5['error']){if(_0x25c5a5[_0x06b9('0x14')][_0x06b9('0x15')]===0x1f4){logger[_0x06b9('0x14')](_0x06b9('0x16'),_0x34f5df,_0x25c5a5[_0x06b9('0x14')][_0x06b9('0x17')]);return _0x4fa8f2(_0x25c5a5[_0x06b9('0x14')][_0x06b9('0x17')]);}logger[_0x06b9('0x14')](_0x06b9('0x16'),_0x34f5df,_0x25c5a5['error'][_0x06b9('0x17')]);return _0x4a96eb(_0x25c5a5[_0x06b9('0x14')][_0x06b9('0x17')]);}else{logger['info']('VoiceQueueReport,\x20%s,\x20%s',_0x34f5df,'request\x20sent');_0x4a96eb(_0x25c5a5[_0x06b9('0x18')][_0x06b9('0x17')]);}})[_0x06b9('0x19')](function(_0x35196a){logger[_0x06b9('0x14')](_0x06b9('0x16'),_0x34f5df,_0x35196a);_0x4fa8f2(_0x35196a);});});}exports[_0x06b9('0x1a')]=function(_0x36ff35){var _0x40447a=this;return new Promise(function(_0x4a06f5,_0xb74904){return db[_0x06b9('0x1b')]['findAll']({'raw':_0x36ff35['options']?_0x36ff35[_0x06b9('0x1c')][_0x06b9('0x1d')]===undefined?!![]:![]:!![],'where':_0x36ff35[_0x06b9('0x1c')]?_0x36ff35[_0x06b9('0x1c')][_0x06b9('0x1e')]||null:null,'attributes':_0x36ff35[_0x06b9('0x1c')]?_0x36ff35[_0x06b9('0x1c')]['attributes']||null:null,'limit':_0x36ff35[_0x06b9('0x1c')]?_0x36ff35[_0x06b9('0x1c')][_0x06b9('0x1f')]||null:null,'include':_0x36ff35[_0x06b9('0x1c')]?_0x36ff35[_0x06b9('0x1c')][_0x06b9('0x20')]?_[_0x06b9('0x21')](_0x36ff35[_0x06b9('0x1c')]['include'],function(_0x491c57){return{'model':db[_0x491c57[_0x06b9('0x22')]],'as':_0x491c57['as'],'attributes':_0x491c57[_0x06b9('0x23')],'include':_0x491c57[_0x06b9('0x20')]?_[_0x06b9('0x21')](_0x491c57['include'],function(_0x1b0a1e){return{'model':db[_0x1b0a1e[_0x06b9('0x22')]],'as':_0x1b0a1e['as'],'attributes':_0x1b0a1e[_0x06b9('0x23')],'include':_0x1b0a1e[_0x06b9('0x20')]?_[_0x06b9('0x21')](_0x1b0a1e[_0x06b9('0x20')],function(_0x27434f){return{'model':db[_0x27434f[_0x06b9('0x22')]],'as':_0x27434f['as'],'attributes':_0x27434f[_0x06b9('0x23')]};}):[]};}):[]};}):[]:[]})[_0x06b9('0x10')](function(_0x3a85b5){logger['info'](_0x06b9('0x1a'),_0x36ff35);logger[_0x06b9('0x12')](_0x06b9('0x1a'),_0x36ff35,JSON[_0x06b9('0x13')](_0x3a85b5));_0x4a06f5(_0x3a85b5);})[_0x06b9('0x19')](function(_0x107925){logger[_0x06b9('0x14')](_0x06b9('0x1a'),_0x107925[_0x06b9('0x17')],_0x36ff35);_0xb74904(_0x40447a[_0x06b9('0x14')](0x1f4,_0x107925[_0x06b9('0x17')]));});});};exports[_0x06b9('0x24')]=function(_0x5514fc){var _0x1b2564=this;return new Promise(function(_0x5ac2b2,_0x2f9cf1){return db[_0x06b9('0x1b')][_0x06b9('0x25')](_0x5514fc[_0x06b9('0x26')],{'raw':_0x5514fc[_0x06b9('0x1c')]?_0x5514fc[_0x06b9('0x1c')][_0x06b9('0x1d')]===undefined?!![]:![]:!![]})[_0x06b9('0x10')](function(_0x37eb65){logger[_0x06b9('0x27')]('CreateVoiceQueueReport',_0x5514fc);logger[_0x06b9('0x12')](_0x06b9('0x24'),_0x5514fc,JSON[_0x06b9('0x13')](_0x37eb65));_0x5ac2b2(_0x37eb65);})['catch'](function(_0x1682f0){logger[_0x06b9('0x14')](_0x06b9('0x24'),_0x1682f0[_0x06b9('0x17')],_0x5514fc);_0x2f9cf1(_0x1b2564[_0x06b9('0x14')](0x1f4,_0x1682f0['message']));});});};exports[_0x06b9('0x28')]=function(_0x31c609){var _0x399ed7=this;return new Promise(function(_0x457915,_0x4032c6){return db[_0x06b9('0x1b')]['update'](_0x31c609[_0x06b9('0x26')],{'raw':_0x31c609[_0x06b9('0x1c')]?_0x31c609['options'][_0x06b9('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x31c609[_0x06b9('0x1c')]?_0x31c609[_0x06b9('0x1c')][_0x06b9('0x1e')]||null:null,'attributes':_0x31c609[_0x06b9('0x1c')]?_0x31c609[_0x06b9('0x1c')][_0x06b9('0x23')]||null:null,'limit':_0x31c609[_0x06b9('0x1c')]?_0x31c609[_0x06b9('0x1c')][_0x06b9('0x1f')]||null:null})[_0x06b9('0x10')](function(_0x5961f5){logger[_0x06b9('0x27')]('UpdateVoiceQueueReport',_0x31c609);logger['debug'](_0x06b9('0x28'),_0x31c609,JSON[_0x06b9('0x13')](_0x5961f5));_0x457915(_0x5961f5);})[_0x06b9('0x19')](function(_0x309041){logger[_0x06b9('0x14')](_0x06b9('0x28'),_0x309041[_0x06b9('0x17')],_0x31c609);_0x4032c6(_0x399ed7[_0x06b9('0x14')](0x1f4,_0x309041['message']));});});}; \ No newline at end of file +var _0x97d5=['jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','VoiceQueueReport','options','attributes','include','map','model','GetVoiceQueueReport','CreateVoiceQueueReport','create','body','raw','UpdateVoiceQueueReport','update','where','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x16e5a8,_0x2e211f){var _0x50180b=function(_0x38ddb9){while(--_0x38ddb9){_0x16e5a8['push'](_0x16e5a8['shift']());}};_0x50180b(++_0x2e211f);}(_0x97d5,0x78));var _0x597d=function(_0x11caa3,_0x7f2ae6){_0x11caa3=_0x11caa3-0x0;var _0x4fb170=_0x97d5[_0x11caa3];return _0x4fb170;};'use strict';var _=require(_0x597d('0x0'));var util=require(_0x597d('0x1'));var moment=require('moment');var BPromise=require(_0x597d('0x2'));var rs=require(_0x597d('0x3'));var fs=require('fs');var Redis=require(_0x597d('0x4'));var db=require(_0x597d('0x5'))['db'];var utils=require(_0x597d('0x6'));var logger=require(_0x597d('0x7'))('rpc');var config=require(_0x597d('0x8'));var jayson=require(_0x597d('0x9'));var client=jayson[_0x597d('0xa')]['http']({'port':0x232a});config[_0x597d('0xb')]=_[_0x597d('0xc')](config[_0x597d('0xb')],{'host':_0x597d('0xd'),'port':0x18eb});var socket=require(_0x597d('0xe'))(new Redis(config[_0x597d('0xb')]));require('./voiceQueueReport.socket')[_0x597d('0xf')](socket);function respondWithRpcPromise(_0x4f4b04,_0xb2d87,_0x17a3ba){return new BPromise(function(_0x32122d,_0x279642){return client[_0x597d('0x10')](_0x4f4b04,_0x17a3ba)[_0x597d('0x11')](function(_0x167ca6){logger[_0x597d('0x12')](_0x597d('0x13'),_0xb2d87,'request\x20sent');logger[_0x597d('0x14')](_0x597d('0x15'),_0xb2d87,_0x597d('0x16'),JSON[_0x597d('0x17')](_0x167ca6));if(_0x167ca6[_0x597d('0x18')]){if(_0x167ca6[_0x597d('0x18')][_0x597d('0x19')]===0x1f4){logger[_0x597d('0x18')]('VoiceQueueReport,\x20%s,\x20%s',_0xb2d87,_0x167ca6[_0x597d('0x18')][_0x597d('0x1a')]);return _0x279642(_0x167ca6[_0x597d('0x18')][_0x597d('0x1a')]);}logger[_0x597d('0x18')]('VoiceQueueReport,\x20%s,\x20%s',_0xb2d87,_0x167ca6[_0x597d('0x18')][_0x597d('0x1a')]);return _0x32122d(_0x167ca6[_0x597d('0x18')][_0x597d('0x1a')]);}else{logger[_0x597d('0x12')](_0x597d('0x13'),_0xb2d87,'request\x20sent');_0x32122d(_0x167ca6[_0x597d('0x1b')]['message']);}})[_0x597d('0x1c')](function(_0x40e553){logger[_0x597d('0x18')](_0x597d('0x13'),_0xb2d87,_0x40e553);_0x279642(_0x40e553);});});}exports['GetVoiceQueueReport']=function(_0x5ae89b){var _0x16b02a=this;return new Promise(function(_0x3a6924,_0x1215cd){return db[_0x597d('0x1d')]['findAll']({'raw':_0x5ae89b[_0x597d('0x1e')]?_0x5ae89b[_0x597d('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x5ae89b['options']?_0x5ae89b['options']['where']||null:null,'attributes':_0x5ae89b[_0x597d('0x1e')]?_0x5ae89b['options'][_0x597d('0x1f')]||null:null,'limit':_0x5ae89b[_0x597d('0x1e')]?_0x5ae89b[_0x597d('0x1e')]['limit']||null:null,'include':_0x5ae89b[_0x597d('0x1e')]?_0x5ae89b[_0x597d('0x1e')][_0x597d('0x20')]?_[_0x597d('0x21')](_0x5ae89b[_0x597d('0x1e')]['include'],function(_0x5dc020){return{'model':db[_0x5dc020[_0x597d('0x22')]],'as':_0x5dc020['as'],'attributes':_0x5dc020[_0x597d('0x1f')],'include':_0x5dc020[_0x597d('0x20')]?_['map'](_0x5dc020[_0x597d('0x20')],function(_0x28a714){return{'model':db[_0x28a714[_0x597d('0x22')]],'as':_0x28a714['as'],'attributes':_0x28a714['attributes'],'include':_0x28a714[_0x597d('0x20')]?_[_0x597d('0x21')](_0x28a714['include'],function(_0x45a139){return{'model':db[_0x45a139[_0x597d('0x22')]],'as':_0x45a139['as'],'attributes':_0x45a139[_0x597d('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x597d('0x11')](function(_0x27c9aa){logger['info'](_0x597d('0x23'),_0x5ae89b);logger[_0x597d('0x14')](_0x597d('0x23'),_0x5ae89b,JSON[_0x597d('0x17')](_0x27c9aa));_0x3a6924(_0x27c9aa);})['catch'](function(_0x67a168){logger['error'](_0x597d('0x23'),_0x67a168[_0x597d('0x1a')],_0x5ae89b);_0x1215cd(_0x16b02a[_0x597d('0x18')](0x1f4,_0x67a168['message']));});});};exports[_0x597d('0x24')]=function(_0x441b95){var _0x30ed24=this;return new Promise(function(_0x21c8c4,_0x362941){return db['VoiceQueueReport'][_0x597d('0x25')](_0x441b95[_0x597d('0x26')],{'raw':_0x441b95[_0x597d('0x1e')]?_0x441b95[_0x597d('0x1e')][_0x597d('0x27')]===undefined?!![]:![]:!![]})[_0x597d('0x11')](function(_0x52bfc3){logger[_0x597d('0x12')](_0x597d('0x24'),_0x441b95);logger[_0x597d('0x14')]('CreateVoiceQueueReport',_0x441b95,JSON['stringify'](_0x52bfc3));_0x21c8c4(_0x52bfc3);})['catch'](function(_0x2b4e85){logger[_0x597d('0x18')](_0x597d('0x24'),_0x2b4e85['message'],_0x441b95);_0x362941(_0x30ed24['error'](0x1f4,_0x2b4e85[_0x597d('0x1a')]));});});};exports[_0x597d('0x28')]=function(_0x29253f){var _0x2ee96f=this;return new Promise(function(_0x24a55b,_0x4d2abb){return db[_0x597d('0x1d')][_0x597d('0x29')](_0x29253f['body'],{'raw':_0x29253f[_0x597d('0x1e')]?_0x29253f['options'][_0x597d('0x27')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x29253f[_0x597d('0x1e')]?_0x29253f['options'][_0x597d('0x2a')]||null:null,'attributes':_0x29253f[_0x597d('0x1e')]?_0x29253f[_0x597d('0x1e')]['attributes']||null:null,'limit':_0x29253f[_0x597d('0x1e')]?_0x29253f[_0x597d('0x1e')]['limit']||null:null})[_0x597d('0x11')](function(_0x12aae0){logger['info'](_0x597d('0x28'),_0x29253f);logger['debug'](_0x597d('0x28'),_0x29253f,JSON[_0x597d('0x17')](_0x12aae0));_0x24a55b(_0x12aae0);})[_0x597d('0x1c')](function(_0x228fa0){logger[_0x597d('0x18')]('UpdateVoiceQueueReport',_0x228fa0[_0x597d('0x1a')],_0x29253f);_0x4d2abb(_0x2ee96f[_0x597d('0x18')](0x1f4,_0x228fa0['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index b798370..54f495a 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 _0xa4c2=['voiceQueueReport:','./voiceQueueReport.events','remove','removeListener','register','length'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xa4c2,0xc1));var _0x2a4c=function(_0x4f5ed0,_0x1c3162){_0x4f5ed0=_0x4f5ed0-0x0;var _0x181800=_0xa4c2[_0x4f5ed0];return _0x181800;};'use strict';var VoiceQueueReportEvents=require(_0x2a4c('0x0'));var events=['save',_0x2a4c('0x1'),'update'];function createListener(_0x44c6d6,_0x1ffde5){return function(_0x4aebbe){_0x1ffde5['emit'](_0x44c6d6,_0x4aebbe);};}function removeListener(_0x1e27e9,_0x558ef7){return function(){VoiceQueueReportEvents[_0x2a4c('0x2')](_0x1e27e9,_0x558ef7);};}exports[_0x2a4c('0x3')]=function(_0x5141d6){for(var _0x259803=0x0,_0x3d2511=events[_0x2a4c('0x4')];_0x259803<_0x3d2511;_0x259803++){var _0x41dfad=events[_0x259803];var _0x1f86e5=createListener(_0x2a4c('0x5')+_0x41dfad,_0x5141d6);VoiceQueueReportEvents['on'](_0x41dfad,_0x1f86e5);}}; \ No newline at end of file +var _0x3f5b=['update','register','length','voiceQueueReport:','./voiceQueueReport.events','save','remove'];(function(_0x15edc4,_0x3d3d50){var _0x2bbc1d=function(_0x827d53){while(--_0x827d53){_0x15edc4['push'](_0x15edc4['shift']());}};_0x2bbc1d(++_0x3d3d50);}(_0x3f5b,0x18c));var _0xb3f5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3f5b[_0x3dd15e];return _0x231fd0;};'use strict';var VoiceQueueReportEvents=require(_0xb3f5('0x0'));var events=[_0xb3f5('0x1'),_0xb3f5('0x2'),_0xb3f5('0x3')];function createListener(_0x3eade3,_0x1c05c7){return function(_0x182ab7){_0x1c05c7['emit'](_0x3eade3,_0x182ab7);};}function removeListener(_0x5ddfb8,_0x405d8f){return function(){VoiceQueueReportEvents['removeListener'](_0x5ddfb8,_0x405d8f);};}exports[_0xb3f5('0x4')]=function(_0x4dec33){for(var _0x2de90e=0x0,_0x53dff8=events[_0xb3f5('0x5')];_0x2de90e<_0x53dff8;_0x2de90e++){var _0x391bb2=events[_0x2de90e];var _0x1f6ed8=createListener(_0xb3f5('0x6')+_0x391bb2,_0x4dec33);VoiceQueueReportEvents['on'](_0x391bb2,_0x1f6ed8);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 3c26e7c..14c0380 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 _0xca46=['get','isAuthenticated','index','/:id','show','post','put','delete','destroy','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x29cc96,_0x39d612){var _0xd403ae=function(_0x104054){while(--_0x104054){_0x29cc96['push'](_0x29cc96['shift']());}};_0xd403ae(++_0x39d612);}(_0xca46,0xa9));var _0x6ca4=function(_0x303c07,_0x282df4){_0x303c07=_0x303c07-0x0;var _0x7f1f6=_0xca46[_0x303c07];return _0x7f1f6;};'use strict';var multer=require('multer');var util=require(_0x6ca4('0x0'));var path=require('path');var timeout=require(_0x6ca4('0x1'));var express=require('express');var router=express[_0x6ca4('0x2')]();var fs_extra=require(_0x6ca4('0x3'));var auth=require(_0x6ca4('0x4'));var interaction=require(_0x6ca4('0x5'));var config=require(_0x6ca4('0x6'));var controller=require('./voiceQueuesLog.controller');router[_0x6ca4('0x7')]('/',auth[_0x6ca4('0x8')](),controller[_0x6ca4('0x9')]);router[_0x6ca4('0x7')](_0x6ca4('0xa'),auth['isAuthenticated'](),controller[_0x6ca4('0xb')]);router[_0x6ca4('0xc')]('/',auth[_0x6ca4('0x8')](),controller['create']);router[_0x6ca4('0xd')](_0x6ca4('0xa'),auth[_0x6ca4('0x8')](),controller['update']);router[_0x6ca4('0xe')]('/:id',auth[_0x6ca4('0x8')](),controller[_0x6ca4('0xf')]);module['exports']=router; \ No newline at end of file +var _0x0b1a=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','create','update','delete','exports','multer','util'];(function(_0x4fc0fe,_0x5afd28){var _0x36a7ef=function(_0x300c88){while(--_0x300c88){_0x4fc0fe['push'](_0x4fc0fe['shift']());}};_0x36a7ef(++_0x5afd28);}(_0x0b1a,0x10c));var _0xa0b1=function(_0x1f2e48,_0x26e5ff){_0x1f2e48=_0x1f2e48-0x0;var _0x54b02d=_0x0b1a[_0x1f2e48];return _0x54b02d;};'use strict';var multer=require(_0xa0b1('0x0'));var util=require(_0xa0b1('0x1'));var path=require(_0xa0b1('0x2'));var timeout=require(_0xa0b1('0x3'));var express=require(_0xa0b1('0x4'));var router=express[_0xa0b1('0x5')]();var fs_extra=require(_0xa0b1('0x6'));var auth=require(_0xa0b1('0x7'));var interaction=require(_0xa0b1('0x8'));var config=require(_0xa0b1('0x9'));var controller=require('./voiceQueuesLog.controller');router['get']('/',auth[_0xa0b1('0xa')](),controller[_0xa0b1('0xb')]);router[_0xa0b1('0xc')](_0xa0b1('0xd'),auth[_0xa0b1('0xa')](),controller['show']);router['post']('/',auth[_0xa0b1('0xa')](),controller[_0xa0b1('0xe')]);router['put'](_0xa0b1('0xd'),auth[_0xa0b1('0xa')](),controller[_0xa0b1('0xf')]);router[_0xa0b1('0x10')](_0xa0b1('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xa0b1('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 5995626..9f08872 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 _0x6ffc=['DATE','format','YYYY-MM-DD\x20HH:mm:ss','moment','STRING'];(function(_0x170640,_0x2e2bfa){var _0x471075=function(_0x3a5f33){while(--_0x3a5f33){_0x170640['push'](_0x170640['shift']());}};_0x471075(++_0x2e2bfa);}(_0x6ffc,0x12a));var _0xc6ff=function(_0x2a9461,_0x25ecf8){_0x2a9461=_0x2a9461-0x0;var _0x15b1f0=_0x6ffc[_0x2a9461];return _0x15b1f0;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xc6ff('0x0'));module['exports']={'time':{'type':Sequelize[_0xc6ff('0x1')]},'callid':{'type':Sequelize[_0xc6ff('0x1')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xc6ff('0x1')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xc6ff('0x1')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xc6ff('0x1')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xc6ff('0x1')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xc6ff('0x1')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xc6ff('0x1')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xc6ff('0x1')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xc6ff('0x1')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xc6ff('0x2')],'allowNull':![],'defaultValue':moment()[_0xc6ff('0x3')](_0xc6ff('0x4'))}}; \ No newline at end of file +var _0x0eb2=['exports','STRING','DATE','YYYY-MM-DD\x20HH:mm:ss','sequelize'];(function(_0x1a595a,_0x263824){var _0x33f008=function(_0x1e2f9c){while(--_0x1e2f9c){_0x1a595a['push'](_0x1a595a['shift']());}};_0x33f008(++_0x263824);}(_0x0eb2,0x11c));var _0x20eb=function(_0x129259,_0x3c39ec){_0x129259=_0x129259-0x0;var _0x110f34=_0x0eb2[_0x129259];return _0x110f34;};'use strict';var Sequelize=require(_0x20eb('0x0'));var moment=require('moment');module[_0x20eb('0x1')]={'time':{'type':Sequelize[_0x20eb('0x2')]},'callid':{'type':Sequelize[_0x20eb('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x20eb('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x20eb('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x20eb('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x20eb('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x20eb('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x20eb('0x3')],'allowNull':![],'defaultValue':moment()['format'](_0x20eb('0x4'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 1ea98e3..b230afd 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 _0xb0c6=['end','json','offset','undefined','limit','count','set','reject','then','destroy','error','stack','name','send','index','map','VoiceQueuesLog','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x2c7c15,_0x1248b6){var _0x22682e=function(_0x4ff2aa){while(--_0x4ff2aa){_0x2c7c15['push'](_0x2c7c15['shift']());}};_0x22682e(++_0x1248b6);}(_0xb0c6,0x1b7));var _0x6b0c=function(_0x5bb5b3,_0x576761){_0x5bb5b3=_0x5bb5b3-0x0;var _0x2435fc=_0xb0c6[_0x5bb5b3];return _0x2435fc;};'use strict';var emlformat=require(_0x6b0c('0x0'));var rimraf=require(_0x6b0c('0x1'));var zipdir=require(_0x6b0c('0x2'));var jsonpatch=require(_0x6b0c('0x3'));var rp=require(_0x6b0c('0x4'));var moment=require(_0x6b0c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6b0c('0x6'));var util=require('util');var path=require(_0x6b0c('0x7'));var sox=require(_0x6b0c('0x8'));var csv=require(_0x6b0c('0x9'));var ejs=require(_0x6b0c('0xa'));var fs=require('fs');var fs_extra=require(_0x6b0c('0xb'));var _=require(_0x6b0c('0xc'));var squel=require('squel');var crypto=require(_0x6b0c('0xd'));var jsforce=require(_0x6b0c('0xe'));var deskjs=require(_0x6b0c('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6b0c('0x10'));var Redis=require(_0x6b0c('0x11'));var authService=require(_0x6b0c('0x12'));var qs=require(_0x6b0c('0x13'));var as=require(_0x6b0c('0x14'));var hardwareService=require(_0x6b0c('0x15'));var logger=require(_0x6b0c('0x16'))('api');var utils=require(_0x6b0c('0x17'));var config=require(_0x6b0c('0x18'));var licenseUtil=require(_0x6b0c('0x19'));var db=require(_0x6b0c('0x1a'))['db'];function respondWithStatusCode(_0xe5efd,_0x1cb1de){_0x1cb1de=_0x1cb1de||0xcc;return function(_0x3ec49a){if(_0x3ec49a){return _0xe5efd[_0x6b0c('0x1b')](_0x1cb1de);}return _0xe5efd[_0x6b0c('0x1c')](_0x1cb1de)[_0x6b0c('0x1d')]();};}function respondWithResult(_0x5e72b5,_0x416604){_0x416604=_0x416604||0xc8;return function(_0x49c888){if(_0x49c888){return _0x5e72b5[_0x6b0c('0x1c')](_0x416604)[_0x6b0c('0x1e')](_0x49c888);}};}function respondWithFilteredResult(_0x4b8834,_0x1820e7){return function(_0x560e50){if(_0x560e50){var _0x490e6c=typeof _0x1820e7[_0x6b0c('0x1f')]===_0x6b0c('0x20')&&typeof _0x1820e7[_0x6b0c('0x21')]===_0x6b0c('0x20');var _0x7bdf96=_0x560e50[_0x6b0c('0x22')];var _0x21d4d5=_0x490e6c?0x0:_0x1820e7[_0x6b0c('0x1f')];var _0x1834db=_0x490e6c?_0x560e50['count']:_0x1820e7[_0x6b0c('0x1f')]+_0x1820e7[_0x6b0c('0x21')];var _0x7b0d9;if(_0x1834db>=_0x7bdf96){_0x1834db=_0x7bdf96;_0x7b0d9=0xc8;}else{_0x7b0d9=0xce;}_0x4b8834[_0x6b0c('0x1c')](_0x7b0d9);return _0x4b8834[_0x6b0c('0x23')]('Content-Range',_0x21d4d5+'-'+_0x1834db+'/'+_0x7bdf96)[_0x6b0c('0x1e')](_0x560e50);}return null;};}function patchUpdates(_0x301656){return function(_0x2d8ef){try{jsonpatch['apply'](_0x2d8ef,_0x301656,!![]);}catch(_0x2eb5f2){return BPromise[_0x6b0c('0x24')](_0x2eb5f2);}return _0x2d8ef['save']();};}function saveUpdates(_0x3d2f07,_0x1a2d00){return function(_0x2d3883){if(_0x2d3883){return _0x2d3883['update'](_0x3d2f07)[_0x6b0c('0x25')](function(_0x3b6963){return _0x3b6963;});}return null;};}function removeEntity(_0x504d32,_0x13b211){return function(_0x3f4f29){if(_0x3f4f29){return _0x3f4f29[_0x6b0c('0x26')]()['then'](function(){_0x504d32['status'](0xcc)[_0x6b0c('0x1d')]();});}};}function handleEntityNotFound(_0x454f73,_0x4a4ef7){return function(_0xe451e3){if(!_0xe451e3){_0x454f73[_0x6b0c('0x1b')](0x194);}return _0xe451e3;};}function handleError(_0x31a55b,_0x20e7c9){_0x20e7c9=_0x20e7c9||0x1f4;return function(_0x5ad6b6){logger[_0x6b0c('0x27')](_0x5ad6b6[_0x6b0c('0x28')]);if(_0x5ad6b6[_0x6b0c('0x29')]){delete _0x5ad6b6[_0x6b0c('0x29')];}_0x31a55b[_0x6b0c('0x1c')](_0x20e7c9)[_0x6b0c('0x2a')](_0x5ad6b6);};}exports[_0x6b0c('0x2b')]=function(_0x31fcd0,_0x3a5a4a){var _0x338082={},_0x3345d7={},_0x3ef758={'count':0x0,'rows':[]};var _0x43b0bb=_[_0x6b0c('0x2c')](db[_0x6b0c('0x2d')]['rawAttributes'],function(_0x1329d4){return{'name':_0x1329d4[_0x6b0c('0x2e')],'type':_0x1329d4[_0x6b0c('0x2f')][_0x6b0c('0x30')]};});_0x3345d7[_0x6b0c('0x31')]=_[_0x6b0c('0x2c')](_0x43b0bb,_0x6b0c('0x29'));_0x3345d7[_0x6b0c('0x32')]=_[_0x6b0c('0x33')](_0x31fcd0[_0x6b0c('0x32')]);_0x3345d7[_0x6b0c('0x34')]=_[_0x6b0c('0x35')](_0x3345d7[_0x6b0c('0x31')],_0x3345d7[_0x6b0c('0x32')]);_0x338082[_0x6b0c('0x36')]=_[_0x6b0c('0x35')](_0x3345d7[_0x6b0c('0x31')],qs[_0x6b0c('0x37')](_0x31fcd0['query'][_0x6b0c('0x37')]));_0x338082[_0x6b0c('0x36')]=_0x338082[_0x6b0c('0x36')][_0x6b0c('0x38')]?_0x338082['attributes']:_0x3345d7[_0x6b0c('0x31')];if(!_0x31fcd0['query']['hasOwnProperty'](_0x6b0c('0x39'))){_0x338082[_0x6b0c('0x21')]=qs[_0x6b0c('0x21')](_0x31fcd0[_0x6b0c('0x32')][_0x6b0c('0x21')]);_0x338082['offset']=qs[_0x6b0c('0x1f')](_0x31fcd0[_0x6b0c('0x32')]['offset']);}_0x338082[_0x6b0c('0x3a')]=qs[_0x6b0c('0x3b')](_0x31fcd0[_0x6b0c('0x32')]['sort']);_0x338082[_0x6b0c('0x3c')]=qs[_0x6b0c('0x34')](_[_0x6b0c('0x3d')](_0x31fcd0['query'],_0x3345d7[_0x6b0c('0x34')]),_0x43b0bb);if(_0x31fcd0[_0x6b0c('0x32')][_0x6b0c('0x3e')]){_0x338082['where']=_['merge'](_0x338082[_0x6b0c('0x3c')],{'$or':_['map'](_0x43b0bb,function(_0x130059){if(_0x130059[_0x6b0c('0x2f')]!==_0x6b0c('0x3f')){var _0x21c6a0={};_0x21c6a0[_0x130059[_0x6b0c('0x29')]]={'$like':'%'+_0x31fcd0[_0x6b0c('0x32')][_0x6b0c('0x3e')]+'%'};return _0x21c6a0;}})});}_0x338082=_[_0x6b0c('0x40')]({},_0x338082,_0x31fcd0[_0x6b0c('0x41')]);var _0x1b329b={'where':_0x338082[_0x6b0c('0x3c')]};return db[_0x6b0c('0x2d')][_0x6b0c('0x22')](_0x1b329b)[_0x6b0c('0x25')](function(_0x1f56f8){_0x3ef758['count']=_0x1f56f8;if(_0x31fcd0['query'][_0x6b0c('0x42')]){_0x338082[_0x6b0c('0x43')]=[{'all':!![]}];}return db['VoiceQueuesLog'][_0x6b0c('0x44')](_0x338082);})['then'](function(_0x331db4){_0x3ef758[_0x6b0c('0x45')]=_0x331db4;return _0x3ef758;})[_0x6b0c('0x25')](respondWithFilteredResult(_0x3a5a4a,_0x338082))[_0x6b0c('0x46')](handleError(_0x3a5a4a,null));};exports[_0x6b0c('0x47')]=function(_0x283d45,_0x584a21){var _0x56f7fb={'raw':!![],'where':{'id':_0x283d45[_0x6b0c('0x48')]['id']}},_0x5ae0a0={};_0x5ae0a0['model']=_[_0x6b0c('0x33')](db['VoiceQueuesLog'][_0x6b0c('0x49')]);_0x5ae0a0['query']=_[_0x6b0c('0x33')](_0x283d45[_0x6b0c('0x32')]);_0x5ae0a0[_0x6b0c('0x34')]=_[_0x6b0c('0x35')](_0x5ae0a0[_0x6b0c('0x31')],_0x5ae0a0[_0x6b0c('0x32')]);_0x56f7fb['attributes']=_[_0x6b0c('0x35')](_0x5ae0a0[_0x6b0c('0x31')],qs['fields'](_0x283d45[_0x6b0c('0x32')][_0x6b0c('0x37')]));_0x56f7fb['attributes']=_0x56f7fb[_0x6b0c('0x36')][_0x6b0c('0x38')]?_0x56f7fb[_0x6b0c('0x36')]:_0x5ae0a0['model'];if(_0x283d45[_0x6b0c('0x32')][_0x6b0c('0x42')]){_0x56f7fb[_0x6b0c('0x43')]=[{'all':!![]}];}_0x56f7fb=_[_0x6b0c('0x40')]({},_0x56f7fb,_0x283d45[_0x6b0c('0x41')]);return db['VoiceQueuesLog'][_0x6b0c('0x4a')](_0x56f7fb)[_0x6b0c('0x25')](handleEntityNotFound(_0x584a21,null))['then'](respondWithResult(_0x584a21,null))[_0x6b0c('0x46')](handleError(_0x584a21,null));};exports[_0x6b0c('0x4b')]=function(_0x4aa5ec,_0x49ac56){return db[_0x6b0c('0x2d')]['create'](_0x4aa5ec[_0x6b0c('0x4c')],{})['then'](respondWithResult(_0x49ac56,0xc9))[_0x6b0c('0x46')](handleError(_0x49ac56,null));};exports[_0x6b0c('0x4d')]=function(_0x3e05c5,_0x139768){if(_0x3e05c5['body']['id']){delete _0x3e05c5[_0x6b0c('0x4c')]['id'];}return db[_0x6b0c('0x2d')][_0x6b0c('0x4a')]({'where':{'id':_0x3e05c5[_0x6b0c('0x48')]['id']}})['then'](handleEntityNotFound(_0x139768,null))['then'](saveUpdates(_0x3e05c5['body'],null))[_0x6b0c('0x25')](respondWithResult(_0x139768,null))[_0x6b0c('0x46')](handleError(_0x139768,null));};exports['destroy']=function(_0x305319,_0x3a4d37){return db[_0x6b0c('0x2d')][_0x6b0c('0x4a')]({'where':{'id':_0x305319[_0x6b0c('0x48')]['id']}})[_0x6b0c('0x25')](handleEntityNotFound(_0x3a4d37,null))['then'](removeEntity(_0x3a4d37,null))[_0x6b0c('0x46')](handleError(_0x3a4d37,null));}; \ No newline at end of file +var _0x106e=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','then','include','findAll','rows','catch','show','params','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','destroy','sendStatus','error','stack','name','send','index','map','VoiceQueuesLog','rawAttributes','fieldName','type','key','model','query','keys'];(function(_0x42d1f8,_0x22e529){var _0x40d234=function(_0xd59b57){while(--_0xd59b57){_0x42d1f8['push'](_0x42d1f8['shift']());}};_0x40d234(++_0x22e529);}(_0x106e,0x1e7));var _0xe106=function(_0x1ff46c,_0x300970){_0x1ff46c=_0x1ff46c-0x0;var _0x8c72e=_0x106e[_0x1ff46c];return _0x8c72e;};'use strict';var emlformat=require(_0xe106('0x0'));var rimraf=require(_0xe106('0x1'));var zipdir=require(_0xe106('0x2'));var jsonpatch=require(_0xe106('0x3'));var rp=require(_0xe106('0x4'));var moment=require(_0xe106('0x5'));var BPromise=require(_0xe106('0x6'));var Mustache=require(_0xe106('0x7'));var util=require(_0xe106('0x8'));var path=require(_0xe106('0x9'));var sox=require('sox');var csv=require(_0xe106('0xa'));var ejs=require(_0xe106('0xb'));var fs=require('fs');var fs_extra=require(_0xe106('0xc'));var _=require('lodash');var squel=require(_0xe106('0xd'));var crypto=require('crypto');var jsforce=require(_0xe106('0xe'));var deskjs=require(_0xe106('0xf'));var toCsv=require(_0xe106('0xa'));var querystring=require('querystring');var Papa=require(_0xe106('0x10'));var Redis=require(_0xe106('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe106('0x12'));var hardwareService=require(_0xe106('0x13'));var logger=require('../../config/logger')(_0xe106('0x14'));var utils=require('../../config/utils');var config=require(_0xe106('0x15'));var licenseUtil=require(_0xe106('0x16'));var db=require(_0xe106('0x17'))['db'];function respondWithStatusCode(_0x27c898,_0x37b3db){_0x37b3db=_0x37b3db||0xcc;return function(_0x10341e){if(_0x10341e){return _0x27c898['sendStatus'](_0x37b3db);}return _0x27c898['status'](_0x37b3db)[_0xe106('0x18')]();};}function respondWithResult(_0x5ca52a,_0x291d3f){_0x291d3f=_0x291d3f||0xc8;return function(_0x2e3e8f){if(_0x2e3e8f){return _0x5ca52a[_0xe106('0x19')](_0x291d3f)['json'](_0x2e3e8f);}};}function respondWithFilteredResult(_0x539bed,_0x222b5c){return function(_0x1baf37){if(_0x1baf37){var _0x1cdd1c=typeof _0x222b5c[_0xe106('0x1a')]==='undefined'&&typeof _0x222b5c['limit']===_0xe106('0x1b');var _0x1a4822=_0x1baf37[_0xe106('0x1c')];var _0x589036=_0x1cdd1c?0x0:_0x222b5c[_0xe106('0x1a')];var _0x5ea4b4=_0x1cdd1c?_0x1baf37['count']:_0x222b5c[_0xe106('0x1a')]+_0x222b5c[_0xe106('0x1d')];var _0xff08e4;if(_0x5ea4b4>=_0x1a4822){_0x5ea4b4=_0x1a4822;_0xff08e4=0xc8;}else{_0xff08e4=0xce;}_0x539bed['status'](_0xff08e4);return _0x539bed[_0xe106('0x1e')](_0xe106('0x1f'),_0x589036+'-'+_0x5ea4b4+'/'+_0x1a4822)[_0xe106('0x20')](_0x1baf37);}return null;};}function patchUpdates(_0x1d2bee){return function(_0x5722ef){try{jsonpatch[_0xe106('0x21')](_0x5722ef,_0x1d2bee,!![]);}catch(_0x4903b){return BPromise[_0xe106('0x22')](_0x4903b);}return _0x5722ef[_0xe106('0x23')]();};}function saveUpdates(_0x2c4bbe,_0x26f713){return function(_0xcede91){if(_0xcede91){return _0xcede91['update'](_0x2c4bbe)['then'](function(_0x596120){return _0x596120;});}return null;};}function removeEntity(_0x32e654,_0xbdba4e){return function(_0x413779){if(_0x413779){return _0x413779[_0xe106('0x24')]()['then'](function(){_0x32e654[_0xe106('0x19')](0xcc)[_0xe106('0x18')]();});}};}function handleEntityNotFound(_0x40e118,_0x442e9c){return function(_0x3c4415){if(!_0x3c4415){_0x40e118[_0xe106('0x25')](0x194);}return _0x3c4415;};}function handleError(_0xc45bcc,_0x2cf9e2){_0x2cf9e2=_0x2cf9e2||0x1f4;return function(_0x93f1b4){logger[_0xe106('0x26')](_0x93f1b4[_0xe106('0x27')]);if(_0x93f1b4[_0xe106('0x28')]){delete _0x93f1b4[_0xe106('0x28')];}_0xc45bcc['status'](_0x2cf9e2)[_0xe106('0x29')](_0x93f1b4);};}exports[_0xe106('0x2a')]=function(_0x10cbc4,_0x2bcd7b){var _0x57f4ab={},_0x234d0b={},_0x5d2776={'count':0x0,'rows':[]};var _0x1c1773=_[_0xe106('0x2b')](db[_0xe106('0x2c')][_0xe106('0x2d')],function(_0x2789b7){return{'name':_0x2789b7[_0xe106('0x2e')],'type':_0x2789b7[_0xe106('0x2f')][_0xe106('0x30')]};});_0x234d0b[_0xe106('0x31')]=_[_0xe106('0x2b')](_0x1c1773,_0xe106('0x28'));_0x234d0b[_0xe106('0x32')]=_[_0xe106('0x33')](_0x10cbc4[_0xe106('0x32')]);_0x234d0b[_0xe106('0x34')]=_[_0xe106('0x35')](_0x234d0b[_0xe106('0x31')],_0x234d0b['query']);_0x57f4ab[_0xe106('0x36')]=_[_0xe106('0x35')](_0x234d0b[_0xe106('0x31')],qs['fields'](_0x10cbc4[_0xe106('0x32')][_0xe106('0x37')]));_0x57f4ab[_0xe106('0x36')]=_0x57f4ab[_0xe106('0x36')][_0xe106('0x38')]?_0x57f4ab['attributes']:_0x234d0b[_0xe106('0x31')];if(!_0x10cbc4[_0xe106('0x32')][_0xe106('0x39')](_0xe106('0x3a'))){_0x57f4ab[_0xe106('0x1d')]=qs[_0xe106('0x1d')](_0x10cbc4[_0xe106('0x32')][_0xe106('0x1d')]);_0x57f4ab[_0xe106('0x1a')]=qs[_0xe106('0x1a')](_0x10cbc4['query'][_0xe106('0x1a')]);}_0x57f4ab[_0xe106('0x3b')]=qs[_0xe106('0x3c')](_0x10cbc4[_0xe106('0x32')][_0xe106('0x3c')]);_0x57f4ab[_0xe106('0x3d')]=qs['filters'](_[_0xe106('0x3e')](_0x10cbc4['query'],_0x234d0b['filters']),_0x1c1773);if(_0x10cbc4[_0xe106('0x32')][_0xe106('0x3f')]){_0x57f4ab['where']=_[_0xe106('0x40')](_0x57f4ab['where'],{'$or':_[_0xe106('0x2b')](_0x1c1773,function(_0x3dc35c){if(_0x3dc35c[_0xe106('0x2f')]!=='VIRTUAL'){var _0x2b9ccc={};_0x2b9ccc[_0x3dc35c[_0xe106('0x28')]]={'$like':'%'+_0x10cbc4[_0xe106('0x32')][_0xe106('0x3f')]+'%'};return _0x2b9ccc;}})});}_0x57f4ab=_['merge']({},_0x57f4ab,_0x10cbc4[_0xe106('0x41')]);var _0x376fb1={'where':_0x57f4ab[_0xe106('0x3d')]};return db[_0xe106('0x2c')][_0xe106('0x1c')](_0x376fb1)[_0xe106('0x42')](function(_0x4b7939){_0x5d2776[_0xe106('0x1c')]=_0x4b7939;if(_0x10cbc4[_0xe106('0x32')]['includeAll']){_0x57f4ab[_0xe106('0x43')]=[{'all':!![]}];}return db[_0xe106('0x2c')][_0xe106('0x44')](_0x57f4ab);})[_0xe106('0x42')](function(_0x3750a9){_0x5d2776[_0xe106('0x45')]=_0x3750a9;return _0x5d2776;})[_0xe106('0x42')](respondWithFilteredResult(_0x2bcd7b,_0x57f4ab))[_0xe106('0x46')](handleError(_0x2bcd7b,null));};exports[_0xe106('0x47')]=function(_0x345944,_0x5d3f7c){var _0x2b863e={'raw':!![],'where':{'id':_0x345944[_0xe106('0x48')]['id']}},_0x1c90e1={};_0x1c90e1[_0xe106('0x31')]=_[_0xe106('0x33')](db[_0xe106('0x2c')]['rawAttributes']);_0x1c90e1[_0xe106('0x32')]=_['keys'](_0x345944[_0xe106('0x32')]);_0x1c90e1[_0xe106('0x34')]=_[_0xe106('0x35')](_0x1c90e1[_0xe106('0x31')],_0x1c90e1[_0xe106('0x32')]);_0x2b863e[_0xe106('0x36')]=_[_0xe106('0x35')](_0x1c90e1[_0xe106('0x31')],qs['fields'](_0x345944[_0xe106('0x32')][_0xe106('0x37')]));_0x2b863e[_0xe106('0x36')]=_0x2b863e[_0xe106('0x36')][_0xe106('0x38')]?_0x2b863e[_0xe106('0x36')]:_0x1c90e1['model'];if(_0x345944[_0xe106('0x32')][_0xe106('0x49')]){_0x2b863e['include']=[{'all':!![]}];}_0x2b863e=_['merge']({},_0x2b863e,_0x345944[_0xe106('0x41')]);return db['VoiceQueuesLog'][_0xe106('0x4a')](_0x2b863e)[_0xe106('0x42')](handleEntityNotFound(_0x5d3f7c,null))[_0xe106('0x42')](respondWithResult(_0x5d3f7c,null))[_0xe106('0x46')](handleError(_0x5d3f7c,null));};exports['create']=function(_0x3d0413,_0x285d0b){return db[_0xe106('0x2c')][_0xe106('0x4b')](_0x3d0413[_0xe106('0x4c')],{})[_0xe106('0x42')](respondWithResult(_0x285d0b,0xc9))[_0xe106('0x46')](handleError(_0x285d0b,null));};exports['update']=function(_0x459868,_0x2ec410){if(_0x459868[_0xe106('0x4c')]['id']){delete _0x459868[_0xe106('0x4c')]['id'];}return db[_0xe106('0x2c')][_0xe106('0x4a')]({'where':{'id':_0x459868[_0xe106('0x48')]['id']}})[_0xe106('0x42')](handleEntityNotFound(_0x2ec410,null))[_0xe106('0x42')](saveUpdates(_0x459868[_0xe106('0x4c')],null))['then'](respondWithResult(_0x2ec410,null))[_0xe106('0x46')](handleError(_0x2ec410,null));};exports[_0xe106('0x24')]=function(_0x1795ba,_0x277f96){return db['VoiceQueuesLog']['find']({'where':{'id':_0x1795ba[_0xe106('0x48')]['id']}})[_0xe106('0x42')](handleEntityNotFound(_0x277f96,null))[_0xe106('0x42')](removeEntity(_0x277f96,null))[_0xe106('0x46')](handleError(_0x277f96,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 36dbc49..13edf9b 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 _0xe10b=['request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','voice_queues_log','event_dtm','../../config/logger','api','moment','bluebird'];(function(_0x46f3bd,_0x58ed30){var _0x364a73=function(_0x259f5a){while(--_0x259f5a){_0x46f3bd['push'](_0x46f3bd['shift']());}};_0x364a73(++_0x58ed30);}(_0xe10b,0x98));var _0xbe10=function(_0x3e3b32,_0x2c8501){_0x3e3b32=_0x3e3b32-0x0;var _0x28f618=_0xe10b[_0x3e3b32];return _0x28f618;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xbe10('0x0'))(_0xbe10('0x1'));var moment=require(_0xbe10('0x2'));var BPromise=require(_0xbe10('0x3'));var rp=require(_0xbe10('0x4'));var fs=require('fs');var path=require(_0xbe10('0x5'));var rimraf=require(_0xbe10('0x6'));var config=require(_0xbe10('0x7'));var attributes=require(_0xbe10('0x8'));module[_0xbe10('0x9')]=function(_0x23abaf,_0x17c9e8){return _0x23abaf['define']('VoiceQueuesLog',attributes,{'tableName':_0xbe10('0xa'),'paranoid':![],'indexes':[{'name':_0xbe10('0xb'),'fields':['event','dtm']}],'timestamps':![]});}; \ No newline at end of file +var _0x8bad=['event_dtm','event','dtm','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log'];(function(_0x3a73bc,_0x550aef){var _0x32891b=function(_0x20b4cb){while(--_0x20b4cb){_0x3a73bc['push'](_0x3a73bc['shift']());}};_0x32891b(++_0x550aef);}(_0x8bad,0x124));var _0xd8ba=function(_0x53415f,_0x154aa2){_0x53415f=_0x53415f-0x0;var _0x4db811=_0x8bad[_0x53415f];return _0x4db811;};'use strict';var _=require(_0xd8ba('0x0'));var util=require(_0xd8ba('0x1'));var logger=require(_0xd8ba('0x2'))(_0xd8ba('0x3'));var moment=require(_0xd8ba('0x4'));var BPromise=require(_0xd8ba('0x5'));var rp=require(_0xd8ba('0x6'));var fs=require('fs');var path=require(_0xd8ba('0x7'));var rimraf=require(_0xd8ba('0x8'));var config=require('../../config/environment');var attributes=require(_0xd8ba('0x9'));module[_0xd8ba('0xa')]=function(_0x426828,_0x493ff8){return _0x426828[_0xd8ba('0xb')](_0xd8ba('0xc'),attributes,{'tableName':_0xd8ba('0xd'),'paranoid':![],'indexes':[{'name':_0xd8ba('0xe'),'fields':[_0xd8ba('0xf'),_0xd8ba('0x10')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 73e9400..bfe53f2 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 _0x98dc=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','lodash','util','moment','bluebird'];(function(_0x36403c,_0x1888c7){var _0x4299b7=function(_0x467666){while(--_0x467666){_0x36403c['push'](_0x36403c['shift']());}};_0x4299b7(++_0x1888c7);}(_0x98dc,0x18c));var _0xc98d=function(_0x3ba0f7,_0x308749){_0x3ba0f7=_0x3ba0f7-0x0;var _0x21c874=_0x98dc[_0x3ba0f7];return _0x21c874;};'use strict';var _=require(_0xc98d('0x0'));var util=require(_0xc98d('0x1'));var moment=require(_0xc98d('0x2'));var BPromise=require(_0xc98d('0x3'));var rs=require(_0xc98d('0x4'));var fs=require('fs');var Redis=require(_0xc98d('0x5'));var db=require(_0xc98d('0x6'))['db'];var utils=require(_0xc98d('0x7'));var logger=require(_0xc98d('0x8'))('rpc');var config=require(_0xc98d('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc98d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x40b93a,_0x999b29,_0x40fe3){return new BPromise(function(_0x3f4488,_0x5058d6){return client[_0xc98d('0xb')](_0x40b93a,_0x40fe3)['then'](function(_0x4df8f4){logger[_0xc98d('0xc')](_0xc98d('0xd'),_0x999b29,_0xc98d('0xe'));logger[_0xc98d('0xf')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x999b29,_0xc98d('0xe'),JSON[_0xc98d('0x10')](_0x4df8f4));if(_0x4df8f4[_0xc98d('0x11')]){if(_0x4df8f4[_0xc98d('0x11')]['code']===0x1f4){logger[_0xc98d('0x11')](_0xc98d('0xd'),_0x999b29,_0x4df8f4['error'][_0xc98d('0x12')]);return _0x5058d6(_0x4df8f4[_0xc98d('0x11')][_0xc98d('0x12')]);}logger[_0xc98d('0x11')](_0xc98d('0xd'),_0x999b29,_0x4df8f4['error'][_0xc98d('0x12')]);return _0x3f4488(_0x4df8f4[_0xc98d('0x11')][_0xc98d('0x12')]);}else{logger['info'](_0xc98d('0xd'),_0x999b29,_0xc98d('0xe'));_0x3f4488(_0x4df8f4['result']['message']);}})[_0xc98d('0x13')](function(_0x36310a){logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x999b29,_0x36310a);_0x5058d6(_0x36310a);});});} \ No newline at end of file +var _0x1978=['request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x50676b,_0x5bfbcf){var _0x56e1f9=function(_0x31ca40){while(--_0x31ca40){_0x50676b['push'](_0x50676b['shift']());}};_0x56e1f9(++_0x5bfbcf);}(_0x1978,0x174));var _0x8197=function(_0x18df63,_0x18c67b){_0x18df63=_0x18df63-0x0;var _0x312ce6=_0x1978[_0x18df63];return _0x312ce6;};'use strict';var _=require('lodash');var util=require(_0x8197('0x0'));var moment=require(_0x8197('0x1'));var BPromise=require(_0x8197('0x2'));var rs=require(_0x8197('0x3'));var fs=require('fs');var Redis=require(_0x8197('0x4'));var db=require(_0x8197('0x5'))['db'];var utils=require(_0x8197('0x6'));var logger=require(_0x8197('0x7'))(_0x8197('0x8'));var config=require(_0x8197('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8197('0xa')][_0x8197('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x117bf1,_0x374969,_0x3e8799){return new BPromise(function(_0x1bc265,_0x108379){return client[_0x8197('0xc')](_0x117bf1,_0x3e8799)[_0x8197('0xd')](function(_0x3fd8ee){logger[_0x8197('0xe')](_0x8197('0xf'),_0x374969,_0x8197('0x10'));logger[_0x8197('0x11')](_0x8197('0x12'),_0x374969,'request\x20sent',JSON[_0x8197('0x13')](_0x3fd8ee));if(_0x3fd8ee[_0x8197('0x14')]){if(_0x3fd8ee[_0x8197('0x14')][_0x8197('0x15')]===0x1f4){logger[_0x8197('0x14')](_0x8197('0xf'),_0x374969,_0x3fd8ee['error']['message']);return _0x108379(_0x3fd8ee[_0x8197('0x14')][_0x8197('0x16')]);}logger[_0x8197('0x14')](_0x8197('0xf'),_0x374969,_0x3fd8ee[_0x8197('0x14')]['message']);return _0x1bc265(_0x3fd8ee[_0x8197('0x14')]['message']);}else{logger[_0x8197('0xe')]('VoiceQueuesLog,\x20%s,\x20%s',_0x374969,_0x8197('0x10'));_0x1bc265(_0x3fd8ee['result'][_0x8197('0x16')]);}})[_0x8197('0x17')](function(_0x56fd37){logger[_0x8197('0x14')]('VoiceQueuesLog,\x20%s,\x20%s',_0x374969,_0x56fd37);_0x108379(_0x56fd37);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 00a14a7..c701278 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 _0x29e3=['runTranscribe','put','update','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','isAuthenticated','describe','/:id','show','/:id/download','download','/:id/downloads','/:id/transcribe','downloadTranscribe','post','create'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x29e3,0xcd));var _0x329e=function(_0xdb7b7e,_0x64c490){_0xdb7b7e=_0xdb7b7e-0x0;var _0x3b9e10=_0x29e3[_0xdb7b7e];return _0x3b9e10;};'use strict';var multer=require(_0x329e('0x0'));var util=require('util');var path=require(_0x329e('0x1'));var timeout=require(_0x329e('0x2'));var express=require(_0x329e('0x3'));var router=express['Router']();var fs_extra=require(_0x329e('0x4'));var auth=require(_0x329e('0x5'));var interaction=require(_0x329e('0x6'));var config=require('../../config/environment');var controller=require('./voiceRecording.controller');router[_0x329e('0x7')]('/',auth['isAuthenticated'](),controller[_0x329e('0x8')]);router[_0x329e('0x7')]('/describe',auth[_0x329e('0x9')](),controller[_0x329e('0xa')]);router[_0x329e('0x7')](_0x329e('0xb'),auth[_0x329e('0x9')](),controller[_0x329e('0xc')]);router['get'](_0x329e('0xd'),auth[_0x329e('0x9')](),controller[_0x329e('0xe')]);router[_0x329e('0x7')](_0x329e('0xf'),controller['downloads']);router['get'](_0x329e('0x10'),auth[_0x329e('0x9')](),controller[_0x329e('0x11')]);router[_0x329e('0x12')]('/',auth[_0x329e('0x9')](),controller[_0x329e('0x13')]);router[_0x329e('0x12')]('/:id/transcribe',auth[_0x329e('0x9')](),controller[_0x329e('0x14')]);router[_0x329e('0x15')](_0x329e('0xb'),auth[_0x329e('0x9')](),controller[_0x329e('0x16')]);router[_0x329e('0x17')]('/:id',auth[_0x329e('0x9')](),controller['destroy']);module[_0x329e('0x18')]=router; \ No newline at end of file +var _0xe5e3=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','index','get','/describe','isAuthenticated','describe','/:id','show','/:id/download','/:id/downloads','downloads','/:id/transcribe','post','create','runTranscribe','update','exports','multer'];(function(_0xce0da6,_0x11268f){var _0x562b9c=function(_0x49a7dd){while(--_0x49a7dd){_0xce0da6['push'](_0xce0da6['shift']());}};_0x562b9c(++_0x11268f);}(_0xe5e3,0x7c));var _0x3e5e=function(_0x51a4b0,_0x1505a6){_0x51a4b0=_0x51a4b0-0x0;var _0x1d64b0=_0xe5e3[_0x51a4b0];return _0x1d64b0;};'use strict';var multer=require(_0x3e5e('0x0'));var util=require(_0x3e5e('0x1'));var path=require(_0x3e5e('0x2'));var timeout=require(_0x3e5e('0x3'));var express=require('express');var router=express[_0x3e5e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3e5e('0x5'));var interaction=require(_0x3e5e('0x6'));var config=require(_0x3e5e('0x7'));var controller=require(_0x3e5e('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x3e5e('0x9')]);router[_0x3e5e('0xa')](_0x3e5e('0xb'),auth[_0x3e5e('0xc')](),controller[_0x3e5e('0xd')]);router['get'](_0x3e5e('0xe'),auth[_0x3e5e('0xc')](),controller[_0x3e5e('0xf')]);router[_0x3e5e('0xa')](_0x3e5e('0x10'),auth[_0x3e5e('0xc')](),controller['download']);router[_0x3e5e('0xa')](_0x3e5e('0x11'),controller[_0x3e5e('0x12')]);router['get'](_0x3e5e('0x13'),auth[_0x3e5e('0xc')](),controller['downloadTranscribe']);router[_0x3e5e('0x14')]('/',auth[_0x3e5e('0xc')](),controller[_0x3e5e('0x15')]);router[_0x3e5e('0x14')]('/:id/transcribe',auth[_0x3e5e('0xc')](),controller[_0x3e5e('0x16')]);router['put'](_0x3e5e('0xe'),auth[_0x3e5e('0xc')](),controller[_0x3e5e('0x17')]);router['delete'](_0x3e5e('0xe'),auth[_0x3e5e('0xc')](),controller['destroy']);module[_0x3e5e('0x18')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 5ac2157..541a940 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(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}}; \ No newline at end of file +var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'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 9d3d938..7536d7e 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 _0x821e=['undefined','limit','count','offset','set','Content-Range','apply','reject','save','destroy','then','error','name','index','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','VoiceRecording','include','show','length','includeAll','find','catch','create','update','body','params','describe','download','../../components/encryptor','uniqueid','value','format','existsSync','decryptFile','secrets','recording','ValidationError','VoiceRecording\x20not\x20found','filename','extname','message','send','Not\x20found','downloads','sequelize','MD5','col','token','push','$and','%s.cypher','Sequelize','unlink','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','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)','bucket','location','Location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','runSentiment','sentiment','language','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','data1','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','Transcript\x20not\x20available','eml-format','zip-dir','fast-json-patch','bluebird','util','path','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','aws-sdk','uuid/v4','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json'];(function(_0x1d9a52,_0x21c9e3){var _0xf12f69=function(_0x4bd04c){while(--_0x4bd04c){_0x1d9a52['push'](_0x1d9a52['shift']());}};_0xf12f69(++_0x21c9e3);}(_0x821e,0x7c));var _0xe821=function(_0x3ceb54,_0x5bddfd){_0x3ceb54=_0x3ceb54-0x0;var _0x26d8a6=_0x821e[_0x3ceb54];return _0x26d8a6;};'use strict';var emlformat=require(_0xe821('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe821('0x1'));var jsonpatch=require(_0xe821('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe821('0x3'));var Mustache=require('mustache');var util=require(_0xe821('0x4'));var path=require(_0xe821('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe821('0x6'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xe821('0x7'));var jsforce=require(_0xe821('0x8'));var deskjs=require(_0xe821('0x9'));var toCsv=require(_0xe821('0xa'));var querystring=require(_0xe821('0xb'));var Papa=require(_0xe821('0xc'));var AWS=require(_0xe821('0xd'));var uuidv4=require(_0xe821('0xe'));var Redis=require(_0xe821('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe821('0x10'));var as=require(_0xe821('0x11'));var hardwareService=require(_0xe821('0x12'));var logger=require(_0xe821('0x13'))(_0xe821('0x14'));var utils=require(_0xe821('0x15'));var config=require(_0xe821('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe821('0x17'))['db'];function respondWithStatusCode(_0x5c6fdd,_0x506a88){_0x506a88=_0x506a88||0xcc;return function(_0x2feb91){if(_0x2feb91){return _0x5c6fdd[_0xe821('0x18')](_0x506a88);}return _0x5c6fdd[_0xe821('0x19')](_0x506a88)[_0xe821('0x1a')]();};}function respondWithResult(_0x50eafc,_0x469bb7){_0x469bb7=_0x469bb7||0xc8;return function(_0xac87fe){if(_0xac87fe){return _0x50eafc[_0xe821('0x19')](_0x469bb7)[_0xe821('0x1b')](_0xac87fe);}};}function respondWithFilteredResult(_0x3a1156,_0x148319){return function(_0x2ede28){if(_0x2ede28){var _0x382578=typeof _0x148319['offset']===_0xe821('0x1c')&&typeof _0x148319[_0xe821('0x1d')]==='undefined';var _0x10df07=_0x2ede28[_0xe821('0x1e')];var _0x1f9277=_0x382578?0x0:_0x148319[_0xe821('0x1f')];var _0x40f9fa=_0x382578?_0x2ede28[_0xe821('0x1e')]:_0x148319['offset']+_0x148319[_0xe821('0x1d')];var _0x4bf8fa;if(_0x40f9fa>=_0x10df07){_0x40f9fa=_0x10df07;_0x4bf8fa=0xc8;}else{_0x4bf8fa=0xce;}_0x3a1156['status'](_0x4bf8fa);return _0x3a1156[_0xe821('0x20')](_0xe821('0x21'),_0x1f9277+'-'+_0x40f9fa+'/'+_0x10df07)[_0xe821('0x1b')](_0x2ede28);}return null;};}function patchUpdates(_0x537617){return function(_0x1bc941){try{jsonpatch[_0xe821('0x22')](_0x1bc941,_0x537617,!![]);}catch(_0x5dd71c){return BPromise[_0xe821('0x23')](_0x5dd71c);}return _0x1bc941[_0xe821('0x24')]();};}function saveUpdates(_0x3474d9,_0x15c2ec){return function(_0x27dd97){if(_0x27dd97){return _0x27dd97['update'](_0x3474d9)['then'](function(_0x4f3ac3){return _0x4f3ac3;});}return null;};}function removeEntity(_0x2087ea,_0x551260){return function(_0x18b3d4){if(_0x18b3d4){return _0x18b3d4[_0xe821('0x25')]()[_0xe821('0x26')](function(){_0x2087ea[_0xe821('0x19')](0xcc)[_0xe821('0x1a')]();});}};}function handleEntityNotFound(_0x48644e,_0x2b5b25){return function(_0x203b64){if(!_0x203b64){_0x48644e['sendStatus'](0x194);}return _0x203b64;};}function handleError(_0x215bda,_0x25668b){_0x25668b=_0x25668b||0x1f4;return function(_0x359f41){logger[_0xe821('0x27')](_0x359f41['stack']);if(_0x359f41[_0xe821('0x28')]){delete _0x359f41['name'];}_0x215bda[_0xe821('0x19')](_0x25668b)['send'](_0x359f41);};}exports[_0xe821('0x29')]=function(_0x1c9f48,_0x306936){var _0x2ea1a1={},_0x124d96={},_0x500d51={'count':0x0,'rows':[]};var _0x540271=_['map'](db['VoiceRecording'][_0xe821('0x2a')],function(_0x15e1af){return{'name':_0x15e1af[_0xe821('0x2b')],'type':_0x15e1af[_0xe821('0x2c')][_0xe821('0x2d')]};});_0x124d96['model']=_['differenceBy'](_[_0xe821('0x2e')](_0x540271,_0xe821('0x28')),['format']);_0x124d96[_0xe821('0x2f')]=_[_0xe821('0x30')](_0x1c9f48['query']);_0x124d96[_0xe821('0x31')]=_[_0xe821('0x32')](_0x124d96[_0xe821('0x33')],_0x124d96[_0xe821('0x2f')]);_0x2ea1a1[_0xe821('0x34')]=_[_0xe821('0x32')](_0x124d96[_0xe821('0x33')],qs[_0xe821('0x35')](_0x1c9f48['query']['fields']));_0x2ea1a1[_0xe821('0x34')]=_0x2ea1a1[_0xe821('0x34')]['length']?_0x2ea1a1[_0xe821('0x34')]:_0x124d96[_0xe821('0x33')];if(!_0x1c9f48[_0xe821('0x2f')][_0xe821('0x36')](_0xe821('0x37'))){_0x2ea1a1[_0xe821('0x1d')]=qs[_0xe821('0x1d')](_0x1c9f48['query'][_0xe821('0x1d')]);_0x2ea1a1[_0xe821('0x1f')]=qs[_0xe821('0x1f')](_0x1c9f48['query'][_0xe821('0x1f')]);}_0x2ea1a1['order']=qs[_0xe821('0x38')](_0x1c9f48['query'][_0xe821('0x38')]);_0x2ea1a1[_0xe821('0x39')]=qs[_0xe821('0x31')](_[_0xe821('0x3a')](_0x1c9f48[_0xe821('0x2f')],_0x124d96['filters']),_0x540271);if(_0x1c9f48[_0xe821('0x2f')][_0xe821('0x3b')]){_0x2ea1a1[_0xe821('0x39')]=_['merge'](_0x2ea1a1[_0xe821('0x39')],{'$or':_[_0xe821('0x2e')](_0x540271,function(_0x259f25){if(_0x259f25['type']!==_0xe821('0x3c')){var _0x132ef7={};_0x132ef7[_0x259f25[_0xe821('0x28')]]={'$like':'%'+_0x1c9f48['query'][_0xe821('0x3b')]+'%'};return _0x132ef7;}})});}_0x2ea1a1=_[_0xe821('0x3d')]({},_0x2ea1a1,_0x1c9f48[_0xe821('0x3e')]);var _0x18603d={'where':_0x2ea1a1[_0xe821('0x39')]};return db[_0xe821('0x3f')][_0xe821('0x1e')](_0x18603d)[_0xe821('0x26')](function(_0x1d6e8f){_0x500d51[_0xe821('0x1e')]=_0x1d6e8f;if(_0x1c9f48[_0xe821('0x2f')]['includeAll']){_0x2ea1a1[_0xe821('0x40')]=[{'all':!![]}];}return db[_0xe821('0x3f')]['findAll'](_0x2ea1a1);})[_0xe821('0x26')](function(_0xba043){_0x500d51['rows']=_0xba043;return _0x500d51;})[_0xe821('0x26')](respondWithFilteredResult(_0x306936,_0x2ea1a1))['catch'](handleError(_0x306936,null));};exports[_0xe821('0x41')]=function(_0x5cb447,_0xe21938){var _0x240530={'raw':![],'where':{'id':_0x5cb447['params']['id']}},_0xdea3f7={};_0xdea3f7['model']=_[_0xe821('0x30')](db[_0xe821('0x3f')][_0xe821('0x2a')]);_0xdea3f7[_0xe821('0x2f')]=_[_0xe821('0x30')](_0x5cb447[_0xe821('0x2f')]);_0xdea3f7[_0xe821('0x31')]=_['intersection'](_0xdea3f7[_0xe821('0x33')],_0xdea3f7[_0xe821('0x2f')]);_0x240530['attributes']=_[_0xe821('0x32')](_0xdea3f7['model'],qs[_0xe821('0x35')](_0x5cb447[_0xe821('0x2f')][_0xe821('0x35')]));_0x240530[_0xe821('0x34')]=_0x240530[_0xe821('0x34')][_0xe821('0x42')]?_0x240530[_0xe821('0x34')]:_0xdea3f7[_0xe821('0x33')];if(_0x5cb447[_0xe821('0x2f')][_0xe821('0x43')]){_0x240530[_0xe821('0x40')]=[{'all':!![]}];}_0x240530=_[_0xe821('0x3d')]({},_0x240530,_0x5cb447['options']);return db[_0xe821('0x3f')][_0xe821('0x44')](_0x240530)['then'](handleEntityNotFound(_0xe21938,null))['then'](respondWithResult(_0xe21938,null))[_0xe821('0x45')](handleError(_0xe21938,null));};exports[_0xe821('0x46')]=function(_0x4cddd4,_0x30ab57){return db[_0xe821('0x3f')][_0xe821('0x46')](_0x4cddd4['body'],{})[_0xe821('0x26')](respondWithResult(_0x30ab57,0xc9))[_0xe821('0x45')](handleError(_0x30ab57,null));};exports[_0xe821('0x47')]=function(_0x44736e,_0x3f9e4d){if(_0x44736e['body']['id']){delete _0x44736e[_0xe821('0x48')]['id'];}return db[_0xe821('0x3f')][_0xe821('0x44')]({'where':{'id':_0x44736e[_0xe821('0x49')]['id']}})[_0xe821('0x26')](handleEntityNotFound(_0x3f9e4d,null))[_0xe821('0x26')](saveUpdates(_0x44736e[_0xe821('0x48')],null))[_0xe821('0x26')](respondWithResult(_0x3f9e4d,null))[_0xe821('0x45')](handleError(_0x3f9e4d,null));};exports['describe']=function(_0x1d4911,_0x4a8f31){return db[_0xe821('0x3f')][_0xe821('0x4a')]()[_0xe821('0x26')](respondWithResult(_0x4a8f31,null))['catch'](handleError(_0x4a8f31,null));};exports[_0xe821('0x4b')]=function(_0x5aa67c,_0x4acd70,_0x2661b7){var _0x1154ac=require(_0xe821('0x4c'));var _0x1c85e8=![];var _0x16df17={};if(_0x5aa67c['query'][_0xe821('0x2c')]&&_0x5aa67c['query'][_0xe821('0x2c')]===_0xe821('0x4d')){_0x16df17['uniqueid']=_0x5aa67c['params']['id'];}else{_0x16df17['id']=_0x5aa67c[_0xe821('0x49')]['id'];}return db[_0xe821('0x3f')][_0xe821('0x44')]({'where':_0x16df17,'attributes':['id','value'],'raw':!![]})[_0xe821('0x26')](handleEntityNotFound(_0x4acd70,null))['then'](function(_0x1de02e){if(_0x1de02e){var _0x1f4956=_0x1de02e[_0xe821('0x4e')];var _0x5ba925=util[_0xe821('0x4f')]('%s.cypher',_0x1f4956);if(fs[_0xe821('0x50')](_0x5ba925)){_0x1c85e8=!![];return _0x1154ac[_0xe821('0x51')](_0x5ba925,_0x1f4956,config[_0xe821('0x52')][_0xe821('0x53')])['then'](function(){return _0x1de02e;});}return _0x1de02e;}})[_0xe821('0x26')](function(_0x47e0e9){if(_0x47e0e9){var _0x140790=_0x47e0e9['value'];if(!fs[_0xe821('0x50')](_0x140790)){throw new db['Sequelize'][(_0xe821('0x54'))](_0xe821('0x55'));}if(_0x47e0e9[_0xe821('0x56')]){return _0x4acd70[_0xe821('0x4b')](_0x140790,_0x47e0e9[_0xe821('0x56')]+path[_0xe821('0x57')](_0x140790),function(){if(_0x1c85e8){fs['unlink'](_0x140790);}});}else{return _0x4acd70[_0xe821('0x4b')](_0x140790,function(_0x7760d2){if(_0x1c85e8){fs['unlink'](_0x140790);}});}}})[_0xe821('0x45')](function(_0x17e7fe){if(_0x17e7fe[_0xe821('0x58')]===_0xe821('0x55')){_0x4acd70[_0xe821('0x19')](0x194)[_0xe821('0x59')](_0xe821('0x5a'));}else{return handleError(_0x4acd70,null);}});};exports[_0xe821('0x5b')]=function(_0x58b3c0,_0x318c73,_0x58cfb2){var _0x3a529a=require(_0xe821('0x4c'));var _0x54e0ff=![];var _0x6f4556={'$and':[db[_0xe821('0x5c')][_0xe821('0x39')](db[_0xe821('0x5c')]['fn'](_0xe821('0x5d'),db[_0xe821('0x5c')][_0xe821('0x5e')](_0xe821('0x4d'))),_0x58b3c0[_0xe821('0x2f')][_0xe821('0x5f')])]};if(_0x58b3c0['query'][_0xe821('0x2c')]&&_0x58b3c0[_0xe821('0x2f')][_0xe821('0x2c')]===_0xe821('0x4d')){_0x6f4556['$and'][_0xe821('0x60')]({'uniqueid':_0x58b3c0[_0xe821('0x49')]['id']});}else{_0x6f4556[_0xe821('0x61')][_0xe821('0x60')]({'id':_0x58b3c0['params']['id']});}return db[_0xe821('0x3f')][_0xe821('0x44')]({'where':_0x6f4556,'attributes':['id',_0xe821('0x4e')],'raw':!![]})[_0xe821('0x26')](handleEntityNotFound(_0x318c73,null))[_0xe821('0x26')](function(_0x5cc1f4){if(_0x5cc1f4){var _0x51bff0=util['format'](_0xe821('0x62'),_0x5cc1f4[_0xe821('0x4e')]);if(fs[_0xe821('0x50')](_0x51bff0)){_0x54e0ff=!![];return _0x3a529a[_0xe821('0x51')](_0x51bff0,_0x5cc1f4[_0xe821('0x4e')],config[_0xe821('0x52')][_0xe821('0x53')])[_0xe821('0x26')](function(){return _0x5cc1f4;});}return _0x5cc1f4;}})[_0xe821('0x26')](function(_0x52a7d0){if(_0x52a7d0){if(!fs['existsSync'](_0x52a7d0[_0xe821('0x4e')])){throw new db[(_0xe821('0x63'))][(_0xe821('0x54'))](_0xe821('0x55'));}if(_0x52a7d0[_0xe821('0x56')]){return _0x318c73[_0xe821('0x4b')](_0x52a7d0[_0xe821('0x4e')],_0x52a7d0[_0xe821('0x56')]+path[_0xe821('0x57')](_0x52a7d0[_0xe821('0x4e')]),function(){if(_0x54e0ff){fs[_0xe821('0x64')](_0x52a7d0[_0xe821('0x4e')]);}});}else{return _0x318c73['download'](_0x52a7d0['value'],function(_0x41fcca){if(_0x54e0ff){fs['unlink'](_0x52a7d0['value']);}});}}})['catch'](handleError(_0x318c73,null));};exports['destroy']=function(_0x59dfb5,_0x567f37){return db[_0xe821('0x3f')]['find']({'where':{'id':_0x59dfb5['params']['id']}})[_0xe821('0x26')](function(_0x2494b0){if(_[_0xe821('0x65')](_0x2494b0)){throw new ReferenceError(_0xe821('0x66'));}return _0x2494b0;})[_0xe821('0x26')](function(_0x4e4aea){var _0x2cb108=_0x4e4aea[_0xe821('0x4e')];logger['info'](_0xe821('0x67'),_0x2cb108);if(!_[_0xe821('0x65')](_0x4e4aea[_0xe821('0x4e')])&&fs['existsSync'](_0x2cb108)){logger[_0xe821('0x68')](_0xe821('0x69')+_0x2cb108+_0xe821('0x6a'));fs[_0xe821('0x6b')](_0x2cb108);}_0x2cb108=_0x2cb108+_0xe821('0x6c');if(!_[_0xe821('0x65')](_0x4e4aea[_0xe821('0x4e')])&&fs[_0xe821('0x50')](_0x2cb108)){logger['info'](_0xe821('0x69')+_0x2cb108+_0xe821('0x6a'));fs['unlinkSync'](_0x2cb108);}return _0x4e4aea;})['then'](function(_0x15d923){if(!_0x15d923)throw new InternalError();return _0x15d923[_0xe821('0x25')]();})[_0xe821('0x26')](function(){_0x567f37['status'](0xcc)['end']();})[_0xe821('0x45')](handleError(_0x567f37,null));};function getBucketslist(_0x25f942,_0x2dff40,_0x1bcaad){return new Promise(function(_0x530777,_0x4050be){var _0x18623e=new AWS['S3']({'accessKeyId':_0x2dff40,'secretAccessKey':_0x25f942,'region':_0x1bcaad});_0x18623e[_0xe821('0x6d')]({},function(_0x20d4b8,_0x190b55){if(_0x20d4b8){return _0x4050be(_0x20d4b8);}else{return _0x530777(_0x190b55);}});});}function createBucket(_0x25066a,_0x2170b1,_0x17ff64,_0x2655b1){return new Promise(function(_0x15065a,_0x3534c1){var _0x1f0303=new AWS['S3']({'accessKeyId':_0x2170b1,'secretAccessKey':_0x25066a,'region':_0x17ff64});_0x1f0303[_0xe821('0x6e')]({'Bucket':_0x2655b1},function(_0x404750,_0x4643db){if(_0x404750){return _0x3534c1(_0x404750);}else{return _0x15065a(_0x4643db);}});});}function uploadFile(_0xe56347,_0x4b1fde,_0x434a12,_0x4b513c,_0x2ac7b6,_0x1d33ce){return new Promise(function(_0x936b87,_0x483b9f){var _0x37f527=new AWS['S3']({'accessKeyId':_0x4b1fde,'secretAccessKey':_0xe56347,'region':_0x434a12});_0x37f527[_0xe821('0x6f')]({'Bucket':_0x4b513c,'Key':_0x2ac7b6,'Body':_0x1d33ce},function(_0x246e10,_0x4877b4){if(_0x246e10){return _0x483b9f(_0x246e10);}else{return _0x936b87(_0x4877b4);}});});}function startTranscribe(_0x401d01,_0xa86e35,_0x18b6b2,_0x1647cc,_0x421095,_0x59aa57){return new Promise(function(_0x587245,_0x25eca0){var _0x55dd87=new AWS[(_0xe821('0x70'))]({'accessKeyId':_0xa86e35,'secretAccessKey':_0x401d01,'region':_0x18b6b2});_0x55dd87['startTranscriptionJob']({'TranscriptionJobName':_0x1647cc,'LanguageCode':_0x421095,'Media':{'MediaFileUri':_0x59aa57}},function(_0x1f2a07,_0x486653){if(_0x1f2a07){return _0x25eca0(_0x1f2a07);}else{return _0x587245(_0x486653);}});});}function transcribe(_0x3ba6a3,_0x395fdd,_0x3bbbe0,_0x2ca618,_0x2f593b,_0x2c5f0d,_0x4c9900){return new Promise(function(_0x1f7e29,_0xbff9b){var _0xbd38eb={};logger[_0xe821('0x68')](util[_0xe821('0x4f')](_0xe821('0x71'),_0x3ba6a3,_0x2f593b));return uploadFile(_0x395fdd,_0x3bbbe0,_0x2ca618,_0x2f593b,path[_0xe821('0x72')](_0x2c5f0d),fs[_0xe821('0x73')](_0x2c5f0d))[_0xe821('0x26')](function(_0x57118d){logger['info'](util[_0xe821('0x4f')](_0xe821('0x74'),_0x3ba6a3,_0x2f593b,_0x57118d['Location']));_0xbd38eb[_0xe821('0x75')]=_0x57118d['Bucket'];_0xbd38eb[_0xe821('0x76')]=_0x57118d[_0xe821('0x77')];logger['info'](util[_0xe821('0x4f')](_0xe821('0x78'),_0x3ba6a3));return startTranscribe(_0x395fdd,_0x3bbbe0,_0x2ca618,uuidv4(),_0x4c9900,_0x57118d[_0xe821('0x77')]);})[_0xe821('0x26')](function(_0x57c9b6){logger[_0xe821('0x68')](util[_0xe821('0x4f')](_0xe821('0x79'),_0x3ba6a3,_0x57c9b6[_0xe821('0x7a')][_0xe821('0x7b')]));_0xbd38eb[_0xe821('0x7c')]=_0x57c9b6['TranscriptionJob'][_0xe821('0x7b')];_0xbd38eb[_0xe821('0x7d')]=_0x57c9b6['TranscriptionJob']['TranscriptionJobStatus'];return _0x1f7e29(_0xbd38eb);})['catch'](function(_0x1d3839){return _0xbff9b(_0x1d3839);});});}exports[_0xe821('0x7e')]=function(_0x9f21ed,_0x239b62,_0x11adcb){var _0x425ca5;var _0x26c70f;var _0x240702;var _0x17184d=require(_0xe821('0x4c'));return db[_0xe821('0x3f')][_0xe821('0x7f')]({'where':{'id':_0x9f21ed[_0xe821('0x49')]['id']}})[_0xe821('0x26')](function(_0x1db3f4){if(_0x1db3f4){var _0x293f3d=util['format']('%s.cypher',_0x1db3f4[_0xe821('0x4e')]);if(fs[_0xe821('0x50')](_0x293f3d)){cypher=!![];return _0x17184d[_0xe821('0x51')](_0x293f3d,_0x1db3f4[_0xe821('0x4e')],config['secrets'][_0xe821('0x53')])[_0xe821('0x26')](function(){return _0x1db3f4;});}return _0x1db3f4;}})[_0xe821('0x26')](function(_0xe2fb37){if(!_0xe2fb37){throw new db[(_0xe821('0x63'))][(_0xe821('0x54'))](_0xe821('0x80'));}_0x26c70f=_0xe2fb37;return db[_0xe821('0x81')][_0xe821('0x7f')]({'where':{'id':0x1}});})[_0xe821('0x26')](handleEntityNotFound(_0x239b62,null))['then'](function(_0xb39d2d){if(_0xb39d2d){_0x425ca5=_0xb39d2d;if(!_0x425ca5['transcribe']||!_0x425ca5[_0xe821('0x82')]||!_0x425ca5[_0xe821('0x83')]||!_0x425ca5['language']||!_0x425ca5[_0xe821('0x75')]){throw new db[(_0xe821('0x63'))][(_0xe821('0x54'))](_0xe821('0x84'));}if(_0x9f21ed['body'][_0xe821('0x85')]&&(!_0x425ca5[_0xe821('0x86')]||!_0x425ca5['sentimentAccountId']||!_0x425ca5['sentimentRegion']||!_0x425ca5[_0xe821('0x87')]||!_0x425ca5[_0xe821('0x75')])){throw new db[(_0xe821('0x63'))][(_0xe821('0x54'))](_0xe821('0x88'));}return db[_0xe821('0x89')][_0xe821('0x7f')]({'where':{'id':_0x425ca5[_0xe821('0x82')]}});}})[_0xe821('0x26')](function(_0x329cc8){if(!_0x329cc8){throw new db[(_0xe821('0x63'))][(_0xe821('0x54'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x329cc8['data1']||!_0x329cc8[_0xe821('0x8a')]){throw new db[(_0xe821('0x63'))][(_0xe821('0x54'))]('Cloud\x20Provider\x20not\x20configured');}_0x240702=_0x329cc8;return getBucketslist(_0x240702['data1'],_0x240702['data2'],_0x425ca5[_0xe821('0x83')]);})[_0xe821('0x26')](function(_0x161f98){if(_0x161f98&&_0x161f98[_0xe821('0x8b')]){var _0x1ca977=_[_0xe821('0x44')](_0x161f98[_0xe821('0x8b')],function(_0x53b92c){return _0x53b92c[_0xe821('0x8c')]===_0x425ca5[_0xe821('0x75')];});if(!_0x1ca977){logger[_0xe821('0x68')](util[_0xe821('0x4f')](_0xe821('0x8d'),_0x9f21ed[_0xe821('0x49')]['id'],_0x425ca5[_0xe821('0x75')]));return createBucket(_0x240702[_0xe821('0x8e')],_0x240702[_0xe821('0x8a')],_0x425ca5[_0xe821('0x83')],_0x425ca5[_0xe821('0x75')]);}logger['info'](util[_0xe821('0x4f')](_0xe821('0x8f'),_0x9f21ed[_0xe821('0x49')]['id'],_0x425ca5[_0xe821('0x75')]));return;}})[_0xe821('0x26')](function(_0x5ef70b){if(_0x26c70f[_0xe821('0x7d')]==='NEW'){return transcribe(_0x9f21ed[_0xe821('0x49')]['id'],_0x240702[_0xe821('0x8e')],_0x240702[_0xe821('0x8a')],_0x425ca5[_0xe821('0x83')],_0x425ca5['bucket'],_0x26c70f[_0xe821('0x4e')],_0x425ca5[_0xe821('0x87')]);}else{logger[_0xe821('0x68')](util[_0xe821('0x4f')](_0xe821('0x90'),_0x9f21ed[_0xe821('0x49')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0xe821('0x26')](function(_0x30152f){if(_0x30152f){_0x30152f['tempSentiment']=_0x9f21ed[_0xe821('0x48')][_0xe821('0x85')];return _0x26c70f[_0xe821('0x91')](_0x30152f);}})[_0xe821('0x26')](respondWithResult(_0x239b62,null))[_0xe821('0x45')](handleError(_0x239b62,null));};function writeFile(_0x391774,_0x106efc){return new Promise(function(_0x3aab02,_0xeb48dd){fs[_0xe821('0x92')](_0x106efc,_0x391774,function(_0xc35d43,_0x2cc6d1){if(_0xc35d43){return _0xeb48dd(_0xc35d43);}else{return _0x3aab02(_0x2cc6d1);}});});}exports[_0xe821('0x93')]=function(_0x4dab0c,_0x17a405,_0x58c2cb){return db[_0xe821('0x3f')][_0xe821('0x7f')]({'where':{'id':_0x4dab0c[_0xe821('0x49')]['id']}})[_0xe821('0x26')](handleEntityNotFound(_0x17a405))[_0xe821('0x26')](function(_0xf7db02){if(_0xf7db02&&_0xf7db02[_0xe821('0x94')]){var _0x47ea59=_0xf7db02['fileText'];var _0x1a7ae5=config[_0xe821('0x95')]+_0xe821('0x96')+_0xf7db02['id']+'.txt';if(fs[_0xe821('0x50')](_0x1a7ae5)){return _0x1a7ae5;}return writeFile(_0x47ea59,_0x1a7ae5)['then'](function(){return _0x1a7ae5;});}else{throw new db[(_0xe821('0x63'))][(_0xe821('0x54'))](_0xe821('0x97'));}})[_0xe821('0x26')](function(_0x31a23d){return _0x17a405[_0xe821('0x4b')](_0x31a23d);})['catch'](handleError(_0x17a405));}; \ No newline at end of file +var _0xd65e=['path','sox','ejs','squel','crypto','querystring','papaparse','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','reject','save','update','then','stack','name','map','VoiceRecording','rawAttributes','fieldName','type','differenceBy','format','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','keys','create','body','find','params','describe','download','../../components/encryptor','uniqueid','value','decryptFile','recording','existsSync','ValidationError','VoiceRecording\x20not\x20found','filename','unlink','message','send','Not\x20found','sequelize','MD5','token','$and','push','%s.cypher','Sequelize','extname','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','.cypher','File:\x20\x22','unlinkSync','destroy','createBucket','upload','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','TranscriptionJob','TranscriptionJobName','transcribeStatus','TranscriptionJobStatus','runTranscribe','secrets','Voice\x20Recording\x20not\x20found','Setting','findOne','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','Sentiment\x20Analysis\x20not\x20configured','Cloud\x20Provider\x20not\x20available','data2','data1','Buckets','Name','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','writeFile','downloadTranscribe','fileText','/server/files/transcribes/transcribe_','.txt','eml-format','rimraf','zip-dir','moment','bluebird','util'];(function(_0x528ae7,_0x165fbd){var _0x3af904=function(_0x4e7cba){while(--_0x4e7cba){_0x528ae7['push'](_0x528ae7['shift']());}};_0x3af904(++_0x165fbd);}(_0xd65e,0x120));var _0xed65=function(_0x26513f,_0x14e99c){_0x26513f=_0x26513f-0x0;var _0x107540=_0xd65e[_0x26513f];return _0x107540;};'use strict';var emlformat=require(_0xed65('0x0'));var rimraf=require(_0xed65('0x1'));var zipdir=require(_0xed65('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xed65('0x3'));var BPromise=require(_0xed65('0x4'));var Mustache=require('mustache');var util=require(_0xed65('0x5'));var path=require(_0xed65('0x6'));var sox=require(_0xed65('0x7'));var csv=require('to-csv');var ejs=require(_0xed65('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xed65('0x9'));var crypto=require(_0xed65('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xed65('0xb'));var Papa=require(_0xed65('0xc'));var AWS=require(_0xed65('0xd'));var uuidv4=require(_0xed65('0xe'));var Redis=require(_0xed65('0xf'));var authService=require(_0xed65('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xed65('0x11'));var hardwareService=require(_0xed65('0x12'));var logger=require(_0xed65('0x13'))(_0xed65('0x14'));var utils=require(_0xed65('0x15'));var config=require(_0xed65('0x16'));var licenseUtil=require(_0xed65('0x17'));var db=require(_0xed65('0x18'))['db'];function respondWithStatusCode(_0x58cb2d,_0x2ba24e){_0x2ba24e=_0x2ba24e||0xcc;return function(_0x5bb11d){if(_0x5bb11d){return _0x58cb2d[_0xed65('0x19')](_0x2ba24e);}return _0x58cb2d[_0xed65('0x1a')](_0x2ba24e)[_0xed65('0x1b')]();};}function respondWithResult(_0x213dea,_0x3e663a){_0x3e663a=_0x3e663a||0xc8;return function(_0x3f8d56){if(_0x3f8d56){return _0x213dea[_0xed65('0x1a')](_0x3e663a)['json'](_0x3f8d56);}};}function respondWithFilteredResult(_0x266fb7,_0x5e5396){return function(_0x3befed){if(_0x3befed){var _0x15bcaf=typeof _0x5e5396['offset']===_0xed65('0x1c')&&typeof _0x5e5396['limit']===_0xed65('0x1c');var _0x104458=_0x3befed[_0xed65('0x1d')];var _0xd41577=_0x15bcaf?0x0:_0x5e5396[_0xed65('0x1e')];var _0x12f3e1=_0x15bcaf?_0x3befed[_0xed65('0x1d')]:_0x5e5396[_0xed65('0x1e')]+_0x5e5396[_0xed65('0x1f')];var _0x5ecd37;if(_0x12f3e1>=_0x104458){_0x12f3e1=_0x104458;_0x5ecd37=0xc8;}else{_0x5ecd37=0xce;}_0x266fb7[_0xed65('0x1a')](_0x5ecd37);return _0x266fb7[_0xed65('0x20')](_0xed65('0x21'),_0xd41577+'-'+_0x12f3e1+'/'+_0x104458)[_0xed65('0x22')](_0x3befed);}return null;};}function patchUpdates(_0x56e411){return function(_0x196160){try{jsonpatch['apply'](_0x196160,_0x56e411,!![]);}catch(_0x45c947){return BPromise[_0xed65('0x23')](_0x45c947);}return _0x196160[_0xed65('0x24')]();};}function saveUpdates(_0x534dd4,_0x11af30){return function(_0xa9cb38){if(_0xa9cb38){return _0xa9cb38[_0xed65('0x25')](_0x534dd4)[_0xed65('0x26')](function(_0x354253){return _0x354253;});}return null;};}function removeEntity(_0x349cfc,_0x46c057){return function(_0x2016e4){if(_0x2016e4){return _0x2016e4['destroy']()[_0xed65('0x26')](function(){_0x349cfc[_0xed65('0x1a')](0xcc)[_0xed65('0x1b')]();});}};}function handleEntityNotFound(_0x11f5bf,_0x6bcdb3){return function(_0x5d4589){if(!_0x5d4589){_0x11f5bf['sendStatus'](0x194);}return _0x5d4589;};}function handleError(_0x1511d9,_0x433534){_0x433534=_0x433534||0x1f4;return function(_0x3f3482){logger['error'](_0x3f3482[_0xed65('0x27')]);if(_0x3f3482['name']){delete _0x3f3482[_0xed65('0x28')];}_0x1511d9[_0xed65('0x1a')](_0x433534)['send'](_0x3f3482);};}exports['index']=function(_0x2282c4,_0x37b780){var _0x38d3bb={},_0x2f9eaa={},_0xbb1e6f={'count':0x0,'rows':[]};var _0x59c9f9=_[_0xed65('0x29')](db[_0xed65('0x2a')][_0xed65('0x2b')],function(_0x1318f2){return{'name':_0x1318f2[_0xed65('0x2c')],'type':_0x1318f2[_0xed65('0x2d')]['key']};});_0x2f9eaa['model']=_[_0xed65('0x2e')](_[_0xed65('0x29')](_0x59c9f9,_0xed65('0x28')),[_0xed65('0x2f')]);_0x2f9eaa[_0xed65('0x30')]=_['keys'](_0x2282c4[_0xed65('0x30')]);_0x2f9eaa[_0xed65('0x31')]=_[_0xed65('0x32')](_0x2f9eaa[_0xed65('0x33')],_0x2f9eaa[_0xed65('0x30')]);_0x38d3bb[_0xed65('0x34')]=_[_0xed65('0x32')](_0x2f9eaa[_0xed65('0x33')],qs[_0xed65('0x35')](_0x2282c4[_0xed65('0x30')]['fields']));_0x38d3bb[_0xed65('0x34')]=_0x38d3bb[_0xed65('0x34')][_0xed65('0x36')]?_0x38d3bb[_0xed65('0x34')]:_0x2f9eaa[_0xed65('0x33')];if(!_0x2282c4['query']['hasOwnProperty'](_0xed65('0x37'))){_0x38d3bb['limit']=qs[_0xed65('0x1f')](_0x2282c4[_0xed65('0x30')][_0xed65('0x1f')]);_0x38d3bb['offset']=qs[_0xed65('0x1e')](_0x2282c4[_0xed65('0x30')][_0xed65('0x1e')]);}_0x38d3bb[_0xed65('0x38')]=qs[_0xed65('0x39')](_0x2282c4[_0xed65('0x30')]['sort']);_0x38d3bb[_0xed65('0x3a')]=qs[_0xed65('0x31')](_[_0xed65('0x3b')](_0x2282c4[_0xed65('0x30')],_0x2f9eaa[_0xed65('0x31')]),_0x59c9f9);if(_0x2282c4[_0xed65('0x30')]['filter']){_0x38d3bb[_0xed65('0x3a')]=_[_0xed65('0x3c')](_0x38d3bb['where'],{'$or':_['map'](_0x59c9f9,function(_0x21bac2){if(_0x21bac2['type']!==_0xed65('0x3d')){var _0x4fa2b4={};_0x4fa2b4[_0x21bac2[_0xed65('0x28')]]={'$like':'%'+_0x2282c4[_0xed65('0x30')][_0xed65('0x3e')]+'%'};return _0x4fa2b4;}})});}_0x38d3bb=_[_0xed65('0x3c')]({},_0x38d3bb,_0x2282c4[_0xed65('0x3f')]);var _0x366b00={'where':_0x38d3bb['where']};return db['VoiceRecording'][_0xed65('0x1d')](_0x366b00)[_0xed65('0x26')](function(_0x3c9813){_0xbb1e6f['count']=_0x3c9813;if(_0x2282c4[_0xed65('0x30')][_0xed65('0x40')]){_0x38d3bb[_0xed65('0x41')]=[{'all':!![]}];}return db[_0xed65('0x2a')][_0xed65('0x42')](_0x38d3bb);})[_0xed65('0x26')](function(_0xb3ea40){_0xbb1e6f[_0xed65('0x43')]=_0xb3ea40;return _0xbb1e6f;})['then'](respondWithFilteredResult(_0x37b780,_0x38d3bb))[_0xed65('0x44')](handleError(_0x37b780,null));};exports[_0xed65('0x45')]=function(_0x458b5e,_0x122763){var _0x9810a7={'raw':![],'where':{'id':_0x458b5e['params']['id']}},_0x266116={};_0x266116[_0xed65('0x33')]=_[_0xed65('0x46')](db[_0xed65('0x2a')][_0xed65('0x2b')]);_0x266116[_0xed65('0x30')]=_[_0xed65('0x46')](_0x458b5e[_0xed65('0x30')]);_0x266116['filters']=_['intersection'](_0x266116[_0xed65('0x33')],_0x266116[_0xed65('0x30')]);_0x9810a7['attributes']=_['intersection'](_0x266116[_0xed65('0x33')],qs[_0xed65('0x35')](_0x458b5e[_0xed65('0x30')][_0xed65('0x35')]));_0x9810a7['attributes']=_0x9810a7['attributes']['length']?_0x9810a7[_0xed65('0x34')]:_0x266116['model'];if(_0x458b5e[_0xed65('0x30')][_0xed65('0x40')]){_0x9810a7[_0xed65('0x41')]=[{'all':!![]}];}_0x9810a7=_[_0xed65('0x3c')]({},_0x9810a7,_0x458b5e[_0xed65('0x3f')]);return db['VoiceRecording']['find'](_0x9810a7)[_0xed65('0x26')](handleEntityNotFound(_0x122763,null))[_0xed65('0x26')](respondWithResult(_0x122763,null))[_0xed65('0x44')](handleError(_0x122763,null));};exports['create']=function(_0x2631f6,_0x3f5575){return db['VoiceRecording'][_0xed65('0x47')](_0x2631f6[_0xed65('0x48')],{})[_0xed65('0x26')](respondWithResult(_0x3f5575,0xc9))['catch'](handleError(_0x3f5575,null));};exports[_0xed65('0x25')]=function(_0x19b1bd,_0x2b7fd7){if(_0x19b1bd['body']['id']){delete _0x19b1bd[_0xed65('0x48')]['id'];}return db[_0xed65('0x2a')][_0xed65('0x49')]({'where':{'id':_0x19b1bd[_0xed65('0x4a')]['id']}})[_0xed65('0x26')](handleEntityNotFound(_0x2b7fd7,null))['then'](saveUpdates(_0x19b1bd[_0xed65('0x48')],null))[_0xed65('0x26')](respondWithResult(_0x2b7fd7,null))['catch'](handleError(_0x2b7fd7,null));};exports[_0xed65('0x4b')]=function(_0x1d185e,_0x61b33f){return db['VoiceRecording'][_0xed65('0x4b')]()[_0xed65('0x26')](respondWithResult(_0x61b33f,null))[_0xed65('0x44')](handleError(_0x61b33f,null));};exports[_0xed65('0x4c')]=function(_0x26e836,_0xe9a499,_0x1307a6){var _0xa88d11=require(_0xed65('0x4d'));var _0x12e2ec=![];var _0x2b590d={};if(_0x26e836[_0xed65('0x30')][_0xed65('0x2d')]&&_0x26e836[_0xed65('0x30')][_0xed65('0x2d')]===_0xed65('0x4e')){_0x2b590d['uniqueid']=_0x26e836[_0xed65('0x4a')]['id'];}else{_0x2b590d['id']=_0x26e836[_0xed65('0x4a')]['id'];}return db[_0xed65('0x2a')][_0xed65('0x49')]({'where':_0x2b590d,'attributes':['id',_0xed65('0x4f')],'raw':!![]})[_0xed65('0x26')](handleEntityNotFound(_0xe9a499,null))[_0xed65('0x26')](function(_0x3f4913){if(_0x3f4913){var _0xa8a66d=_0x3f4913['value'];var _0x27bf94=util[_0xed65('0x2f')]('%s.cypher',_0xa8a66d);if(fs['existsSync'](_0x27bf94)){_0x12e2ec=!![];return _0xa88d11[_0xed65('0x50')](_0x27bf94,_0xa8a66d,config['secrets'][_0xed65('0x51')])[_0xed65('0x26')](function(){return _0x3f4913;});}return _0x3f4913;}})[_0xed65('0x26')](function(_0x3108ec){if(_0x3108ec){var _0x52d75f=_0x3108ec[_0xed65('0x4f')];if(!fs[_0xed65('0x52')](_0x52d75f)){throw new db['Sequelize'][(_0xed65('0x53'))](_0xed65('0x54'));}if(_0x3108ec[_0xed65('0x55')]){return _0xe9a499[_0xed65('0x4c')](_0x52d75f,_0x3108ec[_0xed65('0x55')]+path['extname'](_0x52d75f),function(){if(_0x12e2ec){fs[_0xed65('0x56')](_0x52d75f);}});}else{return _0xe9a499[_0xed65('0x4c')](_0x52d75f,function(_0x4f06e1){if(_0x12e2ec){fs[_0xed65('0x56')](_0x52d75f);}});}}})[_0xed65('0x44')](function(_0x48b4d5){if(_0x48b4d5[_0xed65('0x57')]===_0xed65('0x54')){_0xe9a499[_0xed65('0x1a')](0x194)[_0xed65('0x58')](_0xed65('0x59'));}else{return handleError(_0xe9a499,null);}});};exports['downloads']=function(_0x2191d5,_0x9e69fe,_0x13fe6b){var _0x1829a4=require(_0xed65('0x4d'));var _0x2f641a=![];var _0x343fcd={'$and':[db[_0xed65('0x5a')][_0xed65('0x3a')](db[_0xed65('0x5a')]['fn'](_0xed65('0x5b'),db['sequelize']['col'](_0xed65('0x4e'))),_0x2191d5[_0xed65('0x30')][_0xed65('0x5c')])]};if(_0x2191d5[_0xed65('0x30')][_0xed65('0x2d')]&&_0x2191d5['query']['type']===_0xed65('0x4e')){_0x343fcd[_0xed65('0x5d')][_0xed65('0x5e')]({'uniqueid':_0x2191d5[_0xed65('0x4a')]['id']});}else{_0x343fcd[_0xed65('0x5d')][_0xed65('0x5e')]({'id':_0x2191d5[_0xed65('0x4a')]['id']});}return db['VoiceRecording'][_0xed65('0x49')]({'where':_0x343fcd,'attributes':['id',_0xed65('0x4f')],'raw':!![]})[_0xed65('0x26')](handleEntityNotFound(_0x9e69fe,null))[_0xed65('0x26')](function(_0x460178){if(_0x460178){var _0x5c396f=util[_0xed65('0x2f')](_0xed65('0x5f'),_0x460178[_0xed65('0x4f')]);if(fs[_0xed65('0x52')](_0x5c396f)){_0x2f641a=!![];return _0x1829a4['decryptFile'](_0x5c396f,_0x460178[_0xed65('0x4f')],config['secrets']['recording'])[_0xed65('0x26')](function(){return _0x460178;});}return _0x460178;}})[_0xed65('0x26')](function(_0x5164e2){if(_0x5164e2){if(!fs[_0xed65('0x52')](_0x5164e2[_0xed65('0x4f')])){throw new db[(_0xed65('0x60'))][(_0xed65('0x53'))](_0xed65('0x54'));}if(_0x5164e2[_0xed65('0x55')]){return _0x9e69fe['download'](_0x5164e2[_0xed65('0x4f')],_0x5164e2[_0xed65('0x55')]+path[_0xed65('0x61')](_0x5164e2[_0xed65('0x4f')]),function(){if(_0x2f641a){fs[_0xed65('0x56')](_0x5164e2[_0xed65('0x4f')]);}});}else{return _0x9e69fe[_0xed65('0x4c')](_0x5164e2['value'],function(_0x52657c){if(_0x2f641a){fs['unlink'](_0x5164e2[_0xed65('0x4f')]);}});}}})['catch'](handleError(_0x9e69fe,null));};exports['destroy']=function(_0x5dee5a,_0x35e293){return db[_0xed65('0x2a')][_0xed65('0x49')]({'where':{'id':_0x5dee5a[_0xed65('0x4a')]['id']}})[_0xed65('0x26')](function(_0x5c16ed){if(_[_0xed65('0x62')](_0x5c16ed)){throw new ReferenceError(_0xed65('0x63'));}return _0x5c16ed;})[_0xed65('0x26')](function(_0x36ccd9){var _0x2476e7=_0x36ccd9[_0xed65('0x4f')];logger[_0xed65('0x64')](_0xed65('0x65'),_0x2476e7);if(!_[_0xed65('0x62')](_0x36ccd9['value'])&&fs['existsSync'](_0x2476e7)){logger[_0xed65('0x64')]('File:\x20\x22'+_0x2476e7+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x2476e7);}_0x2476e7=_0x2476e7+_0xed65('0x66');if(!_['isNil'](_0x36ccd9[_0xed65('0x4f')])&&fs[_0xed65('0x52')](_0x2476e7)){logger[_0xed65('0x64')](_0xed65('0x67')+_0x2476e7+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xed65('0x68')](_0x2476e7);}return _0x36ccd9;})[_0xed65('0x26')](function(_0x24624b){if(!_0x24624b)throw new InternalError();return _0x24624b[_0xed65('0x69')]();})[_0xed65('0x26')](function(){_0x35e293[_0xed65('0x1a')](0xcc)['end']();})[_0xed65('0x44')](handleError(_0x35e293,null));};function getBucketslist(_0x628cac,_0x19f4cb,_0x1848a9){return new Promise(function(_0x1a97b2,_0x1fbeb7){var _0x331bd7=new AWS['S3']({'accessKeyId':_0x19f4cb,'secretAccessKey':_0x628cac,'region':_0x1848a9});_0x331bd7['listBuckets']({},function(_0x304f1b,_0xf2b314){if(_0x304f1b){return _0x1fbeb7(_0x304f1b);}else{return _0x1a97b2(_0xf2b314);}});});}function createBucket(_0x31ffd7,_0x554d5e,_0x2dcaf8,_0x54637d){return new Promise(function(_0xb86e34,_0x3b4b0f){var _0x44ca3a=new AWS['S3']({'accessKeyId':_0x554d5e,'secretAccessKey':_0x31ffd7,'region':_0x2dcaf8});_0x44ca3a[_0xed65('0x6a')]({'Bucket':_0x54637d},function(_0x9567f,_0x25ede5){if(_0x9567f){return _0x3b4b0f(_0x9567f);}else{return _0xb86e34(_0x25ede5);}});});}function uploadFile(_0x5d5b72,_0x1f108c,_0x2672a7,_0x4389c0,_0x50cff4,_0x32ff46){return new Promise(function(_0x21a586,_0x26cd77){var _0x18b9b6=new AWS['S3']({'accessKeyId':_0x1f108c,'secretAccessKey':_0x5d5b72,'region':_0x2672a7});_0x18b9b6[_0xed65('0x6b')]({'Bucket':_0x4389c0,'Key':_0x50cff4,'Body':_0x32ff46},function(_0x3d9cd6,_0xaffeb2){if(_0x3d9cd6){return _0x26cd77(_0x3d9cd6);}else{return _0x21a586(_0xaffeb2);}});});}function startTranscribe(_0x326a1f,_0xbdddc9,_0x39e016,_0x1d91ea,_0x35f9dc,_0xc2c00d){return new Promise(function(_0x21f8f0,_0x204a52){var _0xd855d3=new AWS['TranscribeService']({'accessKeyId':_0xbdddc9,'secretAccessKey':_0x326a1f,'region':_0x39e016});_0xd855d3['startTranscriptionJob']({'TranscriptionJobName':_0x1d91ea,'LanguageCode':_0x35f9dc,'Media':{'MediaFileUri':_0xc2c00d}},function(_0x25f6e7,_0x290ae3){if(_0x25f6e7){return _0x204a52(_0x25f6e7);}else{return _0x21f8f0(_0x290ae3);}});});}function transcribe(_0x5b6a69,_0x2856f0,_0x34e6b7,_0x26571e,_0x322542,_0x5aea90,_0x471037){return new Promise(function(_0x517cc4,_0x25617f){var _0x42f927={};logger[_0xed65('0x64')](util[_0xed65('0x2f')](_0xed65('0x6c'),_0x5b6a69,_0x322542));return uploadFile(_0x2856f0,_0x34e6b7,_0x26571e,_0x322542,path['basename'](_0x5aea90),fs['readFileSync'](_0x5aea90))[_0xed65('0x26')](function(_0x4aac93){logger[_0xed65('0x64')](util[_0xed65('0x2f')](_0xed65('0x6d'),_0x5b6a69,_0x322542,_0x4aac93[_0xed65('0x6e')]));_0x42f927[_0xed65('0x6f')]=_0x4aac93[_0xed65('0x70')];_0x42f927[_0xed65('0x71')]=_0x4aac93[_0xed65('0x6e')];logger[_0xed65('0x64')](util[_0xed65('0x2f')](_0xed65('0x72'),_0x5b6a69));return startTranscribe(_0x2856f0,_0x34e6b7,_0x26571e,uuidv4(),_0x471037,_0x4aac93[_0xed65('0x6e')]);})[_0xed65('0x26')](function(_0x537201){logger[_0xed65('0x64')](util[_0xed65('0x2f')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x5b6a69,_0x537201[_0xed65('0x73')]['TranscriptionJobName']));_0x42f927['transcribeName']=_0x537201[_0xed65('0x73')][_0xed65('0x74')];_0x42f927[_0xed65('0x75')]=_0x537201['TranscriptionJob'][_0xed65('0x76')];return _0x517cc4(_0x42f927);})[_0xed65('0x44')](function(_0x4b1e53){return _0x25617f(_0x4b1e53);});});}exports[_0xed65('0x77')]=function(_0x14867f,_0x2fe11a,_0x3350ae){var _0x2c19da;var _0x3e3af1;var _0x179972;var _0x34d010=require(_0xed65('0x4d'));return db[_0xed65('0x2a')]['findOne']({'where':{'id':_0x14867f[_0xed65('0x4a')]['id']}})['then'](function(_0x4f897d){if(_0x4f897d){var _0x114997=util[_0xed65('0x2f')](_0xed65('0x5f'),_0x4f897d[_0xed65('0x4f')]);if(fs[_0xed65('0x52')](_0x114997)){cypher=!![];return _0x34d010[_0xed65('0x50')](_0x114997,_0x4f897d[_0xed65('0x4f')],config[_0xed65('0x78')][_0xed65('0x51')])[_0xed65('0x26')](function(){return _0x4f897d;});}return _0x4f897d;}})[_0xed65('0x26')](function(_0x44bc11){if(!_0x44bc11){throw new db[(_0xed65('0x60'))][(_0xed65('0x53'))](_0xed65('0x79'));}_0x3e3af1=_0x44bc11;return db[_0xed65('0x7a')][_0xed65('0x7b')]({'where':{'id':0x1}});})[_0xed65('0x26')](handleEntityNotFound(_0x2fe11a,null))[_0xed65('0x26')](function(_0x1c179e){if(_0x1c179e){_0x2c19da=_0x1c179e;if(!_0x2c19da[_0xed65('0x7c')]||!_0x2c19da[_0xed65('0x7d')]||!_0x2c19da[_0xed65('0x7e')]||!_0x2c19da[_0xed65('0x7f')]||!_0x2c19da[_0xed65('0x6f')]){throw new db[(_0xed65('0x60'))][(_0xed65('0x53'))](_0xed65('0x80'));}if(_0x14867f[_0xed65('0x48')][_0xed65('0x81')]&&(!_0x2c19da[_0xed65('0x82')]||!_0x2c19da[_0xed65('0x83')]||!_0x2c19da['sentimentRegion']||!_0x2c19da[_0xed65('0x7f')]||!_0x2c19da[_0xed65('0x6f')])){throw new db['Sequelize']['ValidationError'](_0xed65('0x84'));}return db['CloudProvider'][_0xed65('0x7b')]({'where':{'id':_0x2c19da[_0xed65('0x7d')]}});}})['then'](function(_0x457a0e){if(!_0x457a0e){throw new db['Sequelize'][(_0xed65('0x53'))](_0xed65('0x85'));}if(!_0x457a0e['data1']||!_0x457a0e[_0xed65('0x86')]){throw new db['Sequelize'][(_0xed65('0x53'))]('Cloud\x20Provider\x20not\x20configured');}_0x179972=_0x457a0e;return getBucketslist(_0x179972[_0xed65('0x87')],_0x179972['data2'],_0x2c19da[_0xed65('0x7e')]);})[_0xed65('0x26')](function(_0x5cff5d){if(_0x5cff5d&&_0x5cff5d[_0xed65('0x88')]){var _0x24e4f6=_[_0xed65('0x49')](_0x5cff5d[_0xed65('0x88')],function(_0x24e541){return _0x24e541[_0xed65('0x89')]===_0x2c19da['bucket'];});if(!_0x24e4f6){logger[_0xed65('0x64')](util[_0xed65('0x2f')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x14867f[_0xed65('0x4a')]['id'],_0x2c19da[_0xed65('0x6f')]));return createBucket(_0x179972['data1'],_0x179972[_0xed65('0x86')],_0x2c19da['transcribeRegion'],_0x2c19da['bucket']);}logger[_0xed65('0x64')](util[_0xed65('0x2f')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x14867f[_0xed65('0x4a')]['id'],_0x2c19da[_0xed65('0x6f')]));return;}})[_0xed65('0x26')](function(_0x19c029){if(_0x3e3af1[_0xed65('0x75')]===_0xed65('0x8a')){return transcribe(_0x14867f[_0xed65('0x4a')]['id'],_0x179972[_0xed65('0x87')],_0x179972[_0xed65('0x86')],_0x2c19da['transcribeRegion'],_0x2c19da[_0xed65('0x6f')],_0x3e3af1[_0xed65('0x4f')],_0x2c19da[_0xed65('0x7f')]);}else{logger[_0xed65('0x64')](util[_0xed65('0x2f')](_0xed65('0x8b'),_0x14867f[_0xed65('0x4a')]['id']));return{'transcribeStatus':_0xed65('0x8c')};}})[_0xed65('0x26')](function(_0x49e53f){if(_0x49e53f){_0x49e53f[_0xed65('0x8d')]=_0x14867f[_0xed65('0x48')]['runSentiment'];return _0x3e3af1['updateAttributes'](_0x49e53f);}})['then'](respondWithResult(_0x2fe11a,null))[_0xed65('0x44')](handleError(_0x2fe11a,null));};function writeFile(_0x19f457,_0x1f99aa){return new Promise(function(_0x537b13,_0x5376ec){fs[_0xed65('0x8e')](_0x1f99aa,_0x19f457,function(_0x3fc708,_0x4b0edc){if(_0x3fc708){return _0x5376ec(_0x3fc708);}else{return _0x537b13(_0x4b0edc);}});});}exports[_0xed65('0x8f')]=function(_0x19efe4,_0x361d3f,_0x26995e){return db[_0xed65('0x2a')][_0xed65('0x7b')]({'where':{'id':_0x19efe4[_0xed65('0x4a')]['id']}})[_0xed65('0x26')](handleEntityNotFound(_0x361d3f))[_0xed65('0x26')](function(_0x284e4a){if(_0x284e4a&&_0x284e4a[_0xed65('0x90')]){var _0x4d8eba=_0x284e4a[_0xed65('0x90')];var _0x2b2b5b=config['root']+_0xed65('0x91')+_0x284e4a['id']+_0xed65('0x92');if(fs[_0xed65('0x52')](_0x2b2b5b)){return _0x2b2b5b;}return writeFile(_0x4d8eba,_0x2b2b5b)[_0xed65('0x26')](function(){return _0x2b2b5b;});}else{throw new db[(_0xed65('0x60'))]['ValidationError']('Transcript\x20not\x20available');}})['then'](function(_0x5bc317){return _0x361d3f[_0xed65('0x4c')](_0x5bc317);})[_0xed65('0x44')](handleError(_0x361d3f));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 11c4eb9..6d2f3ac 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 _0xa9e2=['./voiceRecording.attributes','exports','VoiceRecording','voice_recordings','uniqueid','util','../../config/logger','request-promise','rimraf','../../config/environment'];(function(_0x294552,_0x561083){var _0x492e7a=function(_0x2e4be9){while(--_0x2e4be9){_0x294552['push'](_0x294552['shift']());}};_0x492e7a(++_0x561083);}(_0xa9e2,0x1e5));var _0x2a9e=function(_0x11793e,_0x111a3c){_0x11793e=_0x11793e-0x0;var _0x39c977=_0xa9e2[_0x11793e];return _0x39c977;};'use strict';var _=require('lodash');var util=require(_0x2a9e('0x0'));var logger=require(_0x2a9e('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2a9e('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2a9e('0x3'));var config=require(_0x2a9e('0x4'));var attributes=require(_0x2a9e('0x5'));module[_0x2a9e('0x6')]=function(_0x1129e8,_0x260776){return _0x1129e8['define'](_0x2a9e('0x7'),attributes,{'tableName':_0x2a9e('0x8'),'paranoid':![],'indexes':[{'name':_0x2a9e('0x9'),'fields':[_0x2a9e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf0ea=['request-promise','path','rimraf','./voiceRecording.attributes','define','voice_recordings','util','bluebird'];(function(_0x2b4d48,_0x157951){var _0x29a7ff=function(_0x5aa687){while(--_0x5aa687){_0x2b4d48['push'](_0x2b4d48['shift']());}};_0x29a7ff(++_0x157951);}(_0xf0ea,0x10e));var _0xaf0e=function(_0xf6783d,_0x5cadc8){_0xf6783d=_0xf6783d-0x0;var _0x1978c6=_0xf0ea[_0xf6783d];return _0x1978c6;};'use strict';var _=require('lodash');var util=require(_0xaf0e('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xaf0e('0x1'));var rp=require(_0xaf0e('0x2'));var fs=require('fs');var path=require(_0xaf0e('0x3'));var rimraf=require(_0xaf0e('0x4'));var config=require('../../config/environment');var attributes=require(_0xaf0e('0x5'));module['exports']=function(_0x272f88,_0x3f71bb){return _0x272f88[_0xaf0e('0x6')]('VoiceRecording',attributes,{'tableName':_0xaf0e('0x7'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 8e8c588..79d6338 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 _0x3d04=['result','VoiceRecording','body','options','raw','where','attributes','limit','UpdateVoiceRecording','debug','catch','CreateVoiceRecording','Setting','findOne','callRecordingEncryption','format','%s.cypher','value','encryptFile','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','stringify','error','VoiceRecording,\x20%s,\x20%s','message','info'];(function(_0x51bb38,_0x4e57a0){var _0x51c09b=function(_0x3321e2){while(--_0x3321e2){_0x51bb38['push'](_0x51bb38['shift']());}};_0x51c09b(++_0x4e57a0);}(_0x3d04,0xbe));var _0x43d0=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3d04[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x43d0('0x0'));var util=require(_0x43d0('0x1'));var moment=require(_0x43d0('0x2'));var BPromise=require(_0x43d0('0x3'));var rs=require(_0x43d0('0x4'));var fs=require('fs');var Redis=require(_0x43d0('0x5'));var db=require(_0x43d0('0x6'))['db'];var utils=require(_0x43d0('0x7'));var logger=require('../../config/logger')(_0x43d0('0x8'));var config=require(_0x43d0('0x9'));var jayson=require(_0x43d0('0xa'));var client=jayson[_0x43d0('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x484271,_0x50919e,_0x5efb95){return new BPromise(function(_0x457550,_0x3344d3){return client[_0x43d0('0xc')](_0x484271,_0x5efb95)[_0x43d0('0xd')](function(_0x44a763){logger['info']('VoiceRecording,\x20%s,\x20%s',_0x50919e,_0x43d0('0xe'));logger['debug']('VoiceRecording,\x20%s,\x20%s,\x20%s',_0x50919e,_0x43d0('0xe'),JSON[_0x43d0('0xf')](_0x44a763));if(_0x44a763[_0x43d0('0x10')]){if(_0x44a763[_0x43d0('0x10')]['code']===0x1f4){logger[_0x43d0('0x10')](_0x43d0('0x11'),_0x50919e,_0x44a763['error'][_0x43d0('0x12')]);return _0x3344d3(_0x44a763[_0x43d0('0x10')][_0x43d0('0x12')]);}logger['error'](_0x43d0('0x11'),_0x50919e,_0x44a763[_0x43d0('0x10')][_0x43d0('0x12')]);return _0x457550(_0x44a763['error'][_0x43d0('0x12')]);}else{logger[_0x43d0('0x13')](_0x43d0('0x11'),_0x50919e,_0x43d0('0xe'));_0x457550(_0x44a763[_0x43d0('0x14')]['message']);}})['catch'](function(_0x1e91a7){logger[_0x43d0('0x10')](_0x43d0('0x11'),_0x50919e,_0x1e91a7);_0x3344d3(_0x1e91a7);});});}exports['UpdateVoiceRecording']=function(_0x2c641e){var _0x532402=this;return new Promise(function(_0x2c9d06,_0x468ca2){return db[_0x43d0('0x15')]['update'](_0x2c641e[_0x43d0('0x16')],{'raw':_0x2c641e[_0x43d0('0x17')]?_0x2c641e['options'][_0x43d0('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c641e[_0x43d0('0x17')]?_0x2c641e[_0x43d0('0x17')][_0x43d0('0x19')]||null:null,'attributes':_0x2c641e[_0x43d0('0x17')]?_0x2c641e[_0x43d0('0x17')][_0x43d0('0x1a')]||null:null,'limit':_0x2c641e[_0x43d0('0x17')]?_0x2c641e[_0x43d0('0x17')][_0x43d0('0x1b')]||null:null})[_0x43d0('0xd')](function(_0x19d2ff){logger[_0x43d0('0x13')](_0x43d0('0x1c'),_0x2c641e);logger[_0x43d0('0x1d')]('UpdateVoiceRecording',_0x2c641e,JSON[_0x43d0('0xf')](_0x19d2ff));_0x2c9d06(_0x19d2ff);})[_0x43d0('0x1e')](function(_0x509041){logger[_0x43d0('0x10')]('UpdateVoiceRecording',_0x509041[_0x43d0('0x12')],_0x2c641e);_0x468ca2(_0x532402[_0x43d0('0x10')](0x1f4,_0x509041['message']));});});};exports[_0x43d0('0x1f')]=function(_0x238c64){var _0x5ac4c0=this;return new Promise(function(_0x12df30,_0x4692bc){var _0x22ae3c=require('../../components/encryptor');var _0x447725;return db[_0x43d0('0x20')][_0x43d0('0x21')]({'attributes':['id',_0x43d0('0x22')],'where':{'id':0x1},'raw':!![]})[_0x43d0('0xd')](function(_0x440ecb){_0x447725=_0x440ecb;return db[_0x43d0('0x15')]['create'](_0x238c64[_0x43d0('0x16')]);})[_0x43d0('0xd')](function(_0x6bc471){if(_0x447725['callRecordingEncryption']&&fs['existsSync'](_0x6bc471['value'])){var _0x3c1ea3=util[_0x43d0('0x23')](_0x43d0('0x24'),_0x6bc471[_0x43d0('0x25')]);return _0x22ae3c[_0x43d0('0x26')](_0x6bc471[_0x43d0('0x25')],_0x3c1ea3,config['secrets'][_0x43d0('0x27')])[_0x43d0('0xd')](function(){fs[_0x43d0('0x28')](_0x6bc471[_0x43d0('0x25')]);logger[_0x43d0('0x13')](_0x43d0('0x29'));return _0x6bc471;});}return _0x6bc471;})[_0x43d0('0xd')](function(_0x1bdd74){logger[_0x43d0('0x13')](_0x43d0('0x1f'),_0x238c64);logger[_0x43d0('0x1d')]('CreateVoiceRecording',_0x238c64,JSON[_0x43d0('0xf')](_0x1bdd74));_0x12df30(_0x1bdd74);})[_0x43d0('0x1e')](function(_0x45ec78){logger[_0x43d0('0x10')]('CreateVoiceRecording',_0x45ec78[_0x43d0('0x12')],_0x238c64);_0x4692bc(_0x5ac4c0['error'](0x1f4,_0x45ec78[_0x43d0('0x12')]));});});}; \ No newline at end of file +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(_0x3b5250,_0x7a0b2c){var _0xc844a1=function(_0x2fbc98){while(--_0x2fbc98){_0x3b5250['push'](_0x3b5250['shift']());}};_0xc844a1(++_0x7a0b2c);}(_0xef0f,0x168));var _0xfef0=function(_0xedea6a,_0x23fa84){_0xedea6a=_0xedea6a-0x0;var _0x3bc2f8=_0xef0f[_0xedea6a];return _0x3bc2f8;};'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 diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index e0f15e1..778018e 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 _0x8c94=['/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','isAuthenticated','index','get','/describe'];(function(_0x166d93,_0x301f09){var _0xba708=function(_0x349bf7){while(--_0x349bf7){_0x166d93['push'](_0x166d93['shift']());}};_0xba708(++_0x301f09);}(_0x8c94,0xb0));var _0x48c9=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x8c94[_0x2d7f0e];return _0x110b07;};'use strict';var multer=require(_0x48c9('0x0'));var util=require(_0x48c9('0x1'));var path=require(_0x48c9('0x2'));var timeout=require(_0x48c9('0x3'));var express=require('express');var router=express[_0x48c9('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x48c9('0x5'));var interaction=require(_0x48c9('0x6'));var config=require(_0x48c9('0x7'));var controller=require(_0x48c9('0x8'));router['get']('/',auth[_0x48c9('0x9')](),controller[_0x48c9('0xa')]);router[_0x48c9('0xb')](_0x48c9('0xc'),auth[_0x48c9('0x9')](),controller['describe']);router[_0x48c9('0xb')](_0x48c9('0xd'),auth[_0x48c9('0x9')](),controller[_0x48c9('0xe')]);router[_0x48c9('0xf')]('/',auth[_0x48c9('0x9')](),controller[_0x48c9('0x10')]);router[_0x48c9('0x11')](_0x48c9('0xd'),auth['isAuthenticated'](),controller[_0x48c9('0x12')]);router[_0x48c9('0x13')](_0x48c9('0xd'),auth[_0x48c9('0x9')](),controller[_0x48c9('0x14')]);module['exports']=router; \ No newline at end of file +var _0x3724=['exports','multer','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3724,0xdd));var _0x4372=function(_0x22431e,_0x5af0a3){_0x22431e=_0x22431e-0x0;var _0xd978e9=_0x3724[_0x22431e];return _0xd978e9;};'use strict';var multer=require(_0x4372('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4372('0x1'));var express=require(_0x4372('0x2'));var router=express[_0x4372('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4372('0x4'));var config=require(_0x4372('0x5'));var controller=require(_0x4372('0x6'));router[_0x4372('0x7')]('/',auth[_0x4372('0x8')](),controller[_0x4372('0x9')]);router[_0x4372('0x7')](_0x4372('0xa'),auth[_0x4372('0x8')](),controller[_0x4372('0xb')]);router['get'](_0x4372('0xc'),auth[_0x4372('0x8')](),controller[_0x4372('0xd')]);router[_0x4372('0xe')]('/',auth[_0x4372('0x8')](),controller[_0x4372('0xf')]);router[_0x4372('0x10')](_0x4372('0xc'),auth[_0x4372('0x8')](),controller[_0x4372('0x11')]);router[_0x4372('0x12')](_0x4372('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x4372('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 920cb16..cee71dd 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 _0x1390=['ENUM','blind','attended','STRING','sequelize','moment','exports'];(function(_0x485c9f,_0x399a20){var _0x2ba76e=function(_0x3598d4){while(--_0x3598d4){_0x485c9f['push'](_0x485c9f['shift']());}};_0x2ba76e(++_0x399a20);}(_0x1390,0x170));var _0x0139=function(_0x4ededb,_0x15766a){_0x4ededb=_0x4ededb-0x0;var _0xa5ed05=_0x1390[_0x4ededb];return _0xa5ed05;};'use strict';var Sequelize=require(_0x0139('0x0'));var moment=require(_0x0139('0x1'));module[_0x0139('0x2')]={'type':{'type':Sequelize[_0x0139('0x3')](_0x0139('0x4'),_0x0139('0x5'))},'result':{'type':Sequelize[_0x0139('0x6')]},'transfererchannel':{'type':Sequelize[_0x0139('0x6')]},'transferercalleridnum':{'type':Sequelize[_0x0139('0x6')]},'transferercalleridname':{'type':Sequelize[_0x0139('0x6')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0x0139('0x6')]},'transfererexten':{'type':Sequelize[_0x0139('0x6')]},'transfererlinkedid':{'type':Sequelize[_0x0139('0x6')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0x0139('0x6')]},'transfereecalleridname':{'type':Sequelize[_0x0139('0x6')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x0139('0x6')]},'transfereeconnectedlinename':{'type':Sequelize[_0x0139('0x6')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0x0139('0x6')]},'transfereeexten':{'type':Sequelize[_0x0139('0x6')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0x0139('0x3')]('Yes','No')},'context':{'type':Sequelize[_0x0139('0x6')]},'extension':{'type':Sequelize[_0x0139('0x6')]}}; \ No newline at end of file +var _0x49a5=['STRING','sequelize','moment','ENUM'];(function(_0x5c38c4,_0x16dbaf){var _0x25102f=function(_0x371d58){while(--_0x371d58){_0x5c38c4['push'](_0x5c38c4['shift']());}};_0x25102f(++_0x16dbaf);}(_0x49a5,0x1d9));var _0x549a=function(_0x1b9fbd,_0x3648c6){_0x1b9fbd=_0x1b9fbd-0x0;var _0x1eb8d0=_0x49a5[_0x1b9fbd];return _0x1eb8d0;};'use strict';var Sequelize=require(_0x549a('0x0'));var moment=require(_0x549a('0x1'));module['exports']={'type':{'type':Sequelize[_0x549a('0x2')]('blind','attended')},'result':{'type':Sequelize[_0x549a('0x3')]},'transfererchannel':{'type':Sequelize[_0x549a('0x3')]},'transferercalleridnum':{'type':Sequelize[_0x549a('0x3')]},'transferercalleridname':{'type':Sequelize[_0x549a('0x3')]},'transfererconnectedlinenum':{'type':Sequelize[_0x549a('0x3')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0x549a('0x3')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0x549a('0x3')]},'transfererlinkedid':{'type':Sequelize[_0x549a('0x3')]},'transfereechannel':{'type':Sequelize[_0x549a('0x3')]},'transfereecalleridnum':{'type':Sequelize[_0x549a('0x3')]},'transfereecalleridname':{'type':Sequelize[_0x549a('0x3')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x549a('0x3')]},'transfereeconnectedlinename':{'type':Sequelize[_0x549a('0x3')]},'transfereeaccountcode':{'type':Sequelize[_0x549a('0x3')]},'transfereecontext':{'type':Sequelize[_0x549a('0x3')]},'transfereeexten':{'type':Sequelize[_0x549a('0x3')]},'transfereelinkedid':{'type':Sequelize[_0x549a('0x3')]},'isexternal':{'type':Sequelize[_0x549a('0x2')]('Yes','No')},'context':{'type':Sequelize[_0x549a('0x3')]},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 1b6fd49..b3088de 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 _0xd0e6=['key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','catch','show','params','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','undefined','limit','offset','Content-Range','apply','reject','update','then','error','stack','name','status','send','index','map','VoiceTransferReport','rawAttributes','fieldName','type'];(function(_0xa27c7a,_0x48f38a){var _0x538b47=function(_0x173969){while(--_0x173969){_0xa27c7a['push'](_0xa27c7a['shift']());}};_0x538b47(++_0x48f38a);}(_0xd0e6,0xb3));var _0x6d0e=function(_0x2dd324,_0x2d0881){_0x2dd324=_0x2dd324-0x0;var _0x33bc5c=_0xd0e6[_0x2dd324];return _0x33bc5c;};'use strict';var emlformat=require(_0x6d0e('0x0'));var rimraf=require(_0x6d0e('0x1'));var zipdir=require(_0x6d0e('0x2'));var jsonpatch=require(_0x6d0e('0x3'));var rp=require('request-promise');var moment=require(_0x6d0e('0x4'));var BPromise=require(_0x6d0e('0x5'));var Mustache=require(_0x6d0e('0x6'));var util=require('util');var path=require(_0x6d0e('0x7'));var sox=require(_0x6d0e('0x8'));var csv=require(_0x6d0e('0x9'));var ejs=require(_0x6d0e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6d0e('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6d0e('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6d0e('0x9'));var querystring=require('querystring');var Papa=require(_0x6d0e('0xd'));var Redis=require(_0x6d0e('0xe'));var authService=require(_0x6d0e('0xf'));var qs=require(_0x6d0e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6d0e('0x11'));var logger=require(_0x6d0e('0x12'))(_0x6d0e('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6d0e('0x14'));var db=require(_0x6d0e('0x15'))['db'];function respondWithStatusCode(_0x31c522,_0x325796){_0x325796=_0x325796||0xcc;return function(_0x4a6b0d){if(_0x4a6b0d){return _0x31c522[_0x6d0e('0x16')](_0x325796);}return _0x31c522['status'](_0x325796)[_0x6d0e('0x17')]();};}function respondWithResult(_0x5403fa,_0x1f76c9){_0x1f76c9=_0x1f76c9||0xc8;return function(_0x44a90e){if(_0x44a90e){return _0x5403fa['status'](_0x1f76c9)['json'](_0x44a90e);}};}function respondWithFilteredResult(_0x19a83d,_0x8b1daf){return function(_0x1c996e){if(_0x1c996e){var _0xe8fa1f=typeof _0x8b1daf['offset']===_0x6d0e('0x18')&&typeof _0x8b1daf[_0x6d0e('0x19')]===_0x6d0e('0x18');var _0x234f72=_0x1c996e['count'];var _0x507cdc=_0xe8fa1f?0x0:_0x8b1daf[_0x6d0e('0x1a')];var _0x297315=_0xe8fa1f?_0x1c996e['count']:_0x8b1daf[_0x6d0e('0x1a')]+_0x8b1daf['limit'];var _0x22b1df;if(_0x297315>=_0x234f72){_0x297315=_0x234f72;_0x22b1df=0xc8;}else{_0x22b1df=0xce;}_0x19a83d['status'](_0x22b1df);return _0x19a83d['set'](_0x6d0e('0x1b'),_0x507cdc+'-'+_0x297315+'/'+_0x234f72)['json'](_0x1c996e);}return null;};}function patchUpdates(_0xd88560){return function(_0x21b121){try{jsonpatch[_0x6d0e('0x1c')](_0x21b121,_0xd88560,!![]);}catch(_0x10235c){return BPromise[_0x6d0e('0x1d')](_0x10235c);}return _0x21b121['save']();};}function saveUpdates(_0x1eacf2,_0x6a4da1){return function(_0x5ac91f){if(_0x5ac91f){return _0x5ac91f[_0x6d0e('0x1e')](_0x1eacf2)[_0x6d0e('0x1f')](function(_0x55178d){return _0x55178d;});}return null;};}function removeEntity(_0x35a177,_0xd4cbe9){return function(_0x4325cd){if(_0x4325cd){return _0x4325cd['destroy']()[_0x6d0e('0x1f')](function(){_0x35a177['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c4ae9,_0x567ab9){return function(_0xb93e46){if(!_0xb93e46){_0x2c4ae9[_0x6d0e('0x16')](0x194);}return _0xb93e46;};}function handleError(_0x3f60cf,_0x54e012){_0x54e012=_0x54e012||0x1f4;return function(_0x5649c3){logger[_0x6d0e('0x20')](_0x5649c3[_0x6d0e('0x21')]);if(_0x5649c3[_0x6d0e('0x22')]){delete _0x5649c3['name'];}_0x3f60cf[_0x6d0e('0x23')](_0x54e012)[_0x6d0e('0x24')](_0x5649c3);};}exports[_0x6d0e('0x25')]=function(_0xfd504b,_0x14c80f){var _0xce49ca={},_0x25c271={},_0x58e8d2={'count':0x0,'rows':[]};var _0x56288c=_[_0x6d0e('0x26')](db[_0x6d0e('0x27')][_0x6d0e('0x28')],function(_0x545246){return{'name':_0x545246[_0x6d0e('0x29')],'type':_0x545246[_0x6d0e('0x2a')][_0x6d0e('0x2b')]};});_0x25c271[_0x6d0e('0x2c')]=_[_0x6d0e('0x26')](_0x56288c,_0x6d0e('0x22'));_0x25c271[_0x6d0e('0x2d')]=_[_0x6d0e('0x2e')](_0xfd504b[_0x6d0e('0x2d')]);_0x25c271[_0x6d0e('0x2f')]=_[_0x6d0e('0x30')](_0x25c271[_0x6d0e('0x2c')],_0x25c271[_0x6d0e('0x2d')]);_0xce49ca['attributes']=_[_0x6d0e('0x30')](_0x25c271['model'],qs[_0x6d0e('0x31')](_0xfd504b[_0x6d0e('0x2d')][_0x6d0e('0x31')]));_0xce49ca[_0x6d0e('0x32')]=_0xce49ca[_0x6d0e('0x32')][_0x6d0e('0x33')]?_0xce49ca['attributes']:_0x25c271[_0x6d0e('0x2c')];if(!_0xfd504b[_0x6d0e('0x2d')][_0x6d0e('0x34')](_0x6d0e('0x35'))){_0xce49ca[_0x6d0e('0x19')]=qs[_0x6d0e('0x19')](_0xfd504b[_0x6d0e('0x2d')]['limit']);_0xce49ca[_0x6d0e('0x1a')]=qs[_0x6d0e('0x1a')](_0xfd504b[_0x6d0e('0x2d')][_0x6d0e('0x1a')]);}_0xce49ca[_0x6d0e('0x36')]=qs[_0x6d0e('0x37')](_0xfd504b[_0x6d0e('0x2d')][_0x6d0e('0x37')]);_0xce49ca[_0x6d0e('0x38')]=qs[_0x6d0e('0x2f')](_[_0x6d0e('0x39')](_0xfd504b[_0x6d0e('0x2d')],_0x25c271[_0x6d0e('0x2f')]),_0x56288c);if(_0xfd504b['query'][_0x6d0e('0x3a')]){_0xce49ca[_0x6d0e('0x38')]=_[_0x6d0e('0x3b')](_0xce49ca[_0x6d0e('0x38')],{'$or':_[_0x6d0e('0x26')](_0x56288c,function(_0x1868fb){if(_0x1868fb[_0x6d0e('0x2a')]!==_0x6d0e('0x3c')){var _0x4832eb={};_0x4832eb[_0x1868fb['name']]={'$like':'%'+_0xfd504b[_0x6d0e('0x2d')][_0x6d0e('0x3a')]+'%'};return _0x4832eb;}})});}_0xce49ca=_['merge']({},_0xce49ca,_0xfd504b[_0x6d0e('0x3d')]);var _0x57978d={'where':_0xce49ca[_0x6d0e('0x38')]};return db[_0x6d0e('0x27')][_0x6d0e('0x3e')](_0x57978d)[_0x6d0e('0x1f')](function(_0x4abe97){_0x58e8d2[_0x6d0e('0x3e')]=_0x4abe97;if(_0xfd504b[_0x6d0e('0x2d')][_0x6d0e('0x3f')]){_0xce49ca[_0x6d0e('0x40')]=[{'all':!![]}];}return db[_0x6d0e('0x27')][_0x6d0e('0x41')](_0xce49ca);})[_0x6d0e('0x1f')](function(_0x49c5de){_0x58e8d2['rows']=_0x49c5de;return _0x58e8d2;})[_0x6d0e('0x1f')](respondWithFilteredResult(_0x14c80f,_0xce49ca))[_0x6d0e('0x42')](handleError(_0x14c80f,null));};exports[_0x6d0e('0x43')]=function(_0x567eed,_0x22bd10){var _0x5831fb={'raw':!![],'where':{'id':_0x567eed[_0x6d0e('0x44')]['id']}},_0x52c796={};_0x52c796[_0x6d0e('0x2c')]=_[_0x6d0e('0x2e')](db[_0x6d0e('0x27')]['rawAttributes']);_0x52c796[_0x6d0e('0x2d')]=_[_0x6d0e('0x2e')](_0x567eed['query']);_0x52c796[_0x6d0e('0x2f')]=_[_0x6d0e('0x30')](_0x52c796[_0x6d0e('0x2c')],_0x52c796[_0x6d0e('0x2d')]);_0x5831fb[_0x6d0e('0x32')]=_['intersection'](_0x52c796['model'],qs[_0x6d0e('0x31')](_0x567eed[_0x6d0e('0x2d')][_0x6d0e('0x31')]));_0x5831fb[_0x6d0e('0x32')]=_0x5831fb[_0x6d0e('0x32')][_0x6d0e('0x33')]?_0x5831fb[_0x6d0e('0x32')]:_0x52c796['model'];if(_0x567eed[_0x6d0e('0x2d')][_0x6d0e('0x3f')]){_0x5831fb[_0x6d0e('0x40')]=[{'all':!![]}];}_0x5831fb=_[_0x6d0e('0x3b')]({},_0x5831fb,_0x567eed[_0x6d0e('0x3d')]);return db[_0x6d0e('0x27')]['find'](_0x5831fb)[_0x6d0e('0x1f')](handleEntityNotFound(_0x22bd10,null))['then'](respondWithResult(_0x22bd10,null))['catch'](handleError(_0x22bd10,null));};exports[_0x6d0e('0x45')]=function(_0x91ab2e,_0x45c85d){return db[_0x6d0e('0x27')][_0x6d0e('0x45')](_0x91ab2e[_0x6d0e('0x46')],{})[_0x6d0e('0x1f')](respondWithResult(_0x45c85d,0xc9))[_0x6d0e('0x42')](handleError(_0x45c85d,null));};exports[_0x6d0e('0x1e')]=function(_0x15a942,_0x1d6a42){if(_0x15a942[_0x6d0e('0x46')]['id']){delete _0x15a942[_0x6d0e('0x46')]['id'];}return db[_0x6d0e('0x27')][_0x6d0e('0x47')]({'where':{'id':_0x15a942[_0x6d0e('0x44')]['id']}})['then'](handleEntityNotFound(_0x1d6a42,null))[_0x6d0e('0x1f')](saveUpdates(_0x15a942[_0x6d0e('0x46')],null))[_0x6d0e('0x1f')](respondWithResult(_0x1d6a42,null))[_0x6d0e('0x42')](handleError(_0x1d6a42,null));};exports[_0x6d0e('0x48')]=function(_0x864429,_0x146004){return db[_0x6d0e('0x27')][_0x6d0e('0x47')]({'where':{'id':_0x864429[_0x6d0e('0x44')]['id']}})['then'](handleEntityNotFound(_0x146004,null))[_0x6d0e('0x1f')](removeEntity(_0x146004,null))['catch'](handleError(_0x146004,null));};exports[_0x6d0e('0x49')]=function(_0x1bffe8,_0x111338){return db[_0x6d0e('0x27')][_0x6d0e('0x49')]()[_0x6d0e('0x1f')](respondWithResult(_0x111338,null))[_0x6d0e('0x42')](handleError(_0x111338,null));}; \ No newline at end of file +var _0xa93b=['type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','update','describe','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','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','status','offset','undefined','count','limit','set','json','reject','save','then','destroy','end','sendStatus','error','stack','name','index','map','VoiceTransferReport','rawAttributes','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter'];(function(_0x9c92c9,_0x55a6ab){var _0x542351=function(_0x4c532c){while(--_0x4c532c){_0x9c92c9['push'](_0x9c92c9['shift']());}};_0x542351(++_0x55a6ab);}(_0xa93b,0x1dd));var _0xba93=function(_0x4ff85a,_0x116929){_0x4ff85a=_0x4ff85a-0x0;var _0x1f3c85=_0xa93b[_0x4ff85a];return _0x1f3c85;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xba93('0x0'));var zipdir=require(_0xba93('0x1'));var jsonpatch=require(_0xba93('0x2'));var rp=require(_0xba93('0x3'));var moment=require(_0xba93('0x4'));var BPromise=require(_0xba93('0x5'));var Mustache=require(_0xba93('0x6'));var util=require(_0xba93('0x7'));var path=require(_0xba93('0x8'));var sox=require(_0xba93('0x9'));var csv=require(_0xba93('0xa'));var ejs=require(_0xba93('0xb'));var fs=require('fs');var fs_extra=require(_0xba93('0xc'));var _=require(_0xba93('0xd'));var squel=require(_0xba93('0xe'));var crypto=require(_0xba93('0xf'));var jsforce=require(_0xba93('0x10'));var deskjs=require(_0xba93('0x11'));var toCsv=require(_0xba93('0xa'));var querystring=require('querystring');var Papa=require(_0xba93('0x12'));var Redis=require(_0xba93('0x13'));var authService=require(_0xba93('0x14'));var qs=require(_0xba93('0x15'));var as=require(_0xba93('0x16'));var hardwareService=require(_0xba93('0x17'));var logger=require('../../config/logger')(_0xba93('0x18'));var utils=require(_0xba93('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xba93('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5257e9,_0x9e188d){_0x9e188d=_0x9e188d||0xcc;return function(_0xaca657){if(_0xaca657){return _0x5257e9['sendStatus'](_0x9e188d);}return _0x5257e9['status'](_0x9e188d)['end']();};}function respondWithResult(_0x404093,_0x5add80){_0x5add80=_0x5add80||0xc8;return function(_0x16497b){if(_0x16497b){return _0x404093[_0xba93('0x1b')](_0x5add80)['json'](_0x16497b);}};}function respondWithFilteredResult(_0x3cd8a6,_0x2f0bfd){return function(_0x2330d6){if(_0x2330d6){var _0x1dcbc6=typeof _0x2f0bfd[_0xba93('0x1c')]===_0xba93('0x1d')&&typeof _0x2f0bfd['limit']==='undefined';var _0x29cae4=_0x2330d6[_0xba93('0x1e')];var _0x2aefc8=_0x1dcbc6?0x0:_0x2f0bfd['offset'];var _0xeea0ef=_0x1dcbc6?_0x2330d6[_0xba93('0x1e')]:_0x2f0bfd[_0xba93('0x1c')]+_0x2f0bfd[_0xba93('0x1f')];var _0x30143d;if(_0xeea0ef>=_0x29cae4){_0xeea0ef=_0x29cae4;_0x30143d=0xc8;}else{_0x30143d=0xce;}_0x3cd8a6[_0xba93('0x1b')](_0x30143d);return _0x3cd8a6[_0xba93('0x20')]('Content-Range',_0x2aefc8+'-'+_0xeea0ef+'/'+_0x29cae4)[_0xba93('0x21')](_0x2330d6);}return null;};}function patchUpdates(_0x5581d1){return function(_0x8ea849){try{jsonpatch['apply'](_0x8ea849,_0x5581d1,!![]);}catch(_0x149fab){return BPromise[_0xba93('0x22')](_0x149fab);}return _0x8ea849[_0xba93('0x23')]();};}function saveUpdates(_0x49f11b,_0x26648d){return function(_0xf2c4cd){if(_0xf2c4cd){return _0xf2c4cd['update'](_0x49f11b)[_0xba93('0x24')](function(_0x4c3a40){return _0x4c3a40;});}return null;};}function removeEntity(_0x20eb7b,_0x51b079){return function(_0x58c6b9){if(_0x58c6b9){return _0x58c6b9[_0xba93('0x25')]()[_0xba93('0x24')](function(){_0x20eb7b[_0xba93('0x1b')](0xcc)[_0xba93('0x26')]();});}};}function handleEntityNotFound(_0x4451be,_0x47c8c7){return function(_0x3dbf4a){if(!_0x3dbf4a){_0x4451be[_0xba93('0x27')](0x194);}return _0x3dbf4a;};}function handleError(_0x233b57,_0x165213){_0x165213=_0x165213||0x1f4;return function(_0x515e83){logger[_0xba93('0x28')](_0x515e83[_0xba93('0x29')]);if(_0x515e83['name']){delete _0x515e83[_0xba93('0x2a')];}_0x233b57[_0xba93('0x1b')](_0x165213)['send'](_0x515e83);};}exports[_0xba93('0x2b')]=function(_0x55e3c9,_0x14b0cb){var _0x3a60ef={},_0x385723={},_0x5e7477={'count':0x0,'rows':[]};var _0x54e6d4=_[_0xba93('0x2c')](db[_0xba93('0x2d')][_0xba93('0x2e')],function(_0x3f3789){return{'name':_0x3f3789['fieldName'],'type':_0x3f3789['type'][_0xba93('0x2f')]};});_0x385723[_0xba93('0x30')]=_[_0xba93('0x2c')](_0x54e6d4,_0xba93('0x2a'));_0x385723['query']=_[_0xba93('0x31')](_0x55e3c9[_0xba93('0x32')]);_0x385723[_0xba93('0x33')]=_['intersection'](_0x385723['model'],_0x385723[_0xba93('0x32')]);_0x3a60ef[_0xba93('0x34')]=_[_0xba93('0x35')](_0x385723[_0xba93('0x30')],qs['fields'](_0x55e3c9['query'][_0xba93('0x36')]));_0x3a60ef[_0xba93('0x34')]=_0x3a60ef[_0xba93('0x34')][_0xba93('0x37')]?_0x3a60ef[_0xba93('0x34')]:_0x385723[_0xba93('0x30')];if(!_0x55e3c9[_0xba93('0x32')][_0xba93('0x38')](_0xba93('0x39'))){_0x3a60ef[_0xba93('0x1f')]=qs[_0xba93('0x1f')](_0x55e3c9[_0xba93('0x32')][_0xba93('0x1f')]);_0x3a60ef[_0xba93('0x1c')]=qs[_0xba93('0x1c')](_0x55e3c9[_0xba93('0x32')]['offset']);}_0x3a60ef['order']=qs[_0xba93('0x3a')](_0x55e3c9[_0xba93('0x32')][_0xba93('0x3a')]);_0x3a60ef[_0xba93('0x3b')]=qs['filters'](_[_0xba93('0x3c')](_0x55e3c9[_0xba93('0x32')],_0x385723[_0xba93('0x33')]),_0x54e6d4);if(_0x55e3c9['query'][_0xba93('0x3d')]){_0x3a60ef[_0xba93('0x3b')]=_['merge'](_0x3a60ef[_0xba93('0x3b')],{'$or':_[_0xba93('0x2c')](_0x54e6d4,function(_0x379a3a){if(_0x379a3a[_0xba93('0x3e')]!==_0xba93('0x3f')){var _0x3ba93d={};_0x3ba93d[_0x379a3a[_0xba93('0x2a')]]={'$like':'%'+_0x55e3c9['query']['filter']+'%'};return _0x3ba93d;}})});}_0x3a60ef=_['merge']({},_0x3a60ef,_0x55e3c9['options']);var _0x2027a2={'where':_0x3a60ef[_0xba93('0x3b')]};return db[_0xba93('0x2d')][_0xba93('0x1e')](_0x2027a2)[_0xba93('0x24')](function(_0x4b8c49){_0x5e7477['count']=_0x4b8c49;if(_0x55e3c9[_0xba93('0x32')][_0xba93('0x40')]){_0x3a60ef[_0xba93('0x41')]=[{'all':!![]}];}return db[_0xba93('0x2d')][_0xba93('0x42')](_0x3a60ef);})[_0xba93('0x24')](function(_0x54837f){_0x5e7477[_0xba93('0x43')]=_0x54837f;return _0x5e7477;})[_0xba93('0x24')](respondWithFilteredResult(_0x14b0cb,_0x3a60ef))[_0xba93('0x44')](handleError(_0x14b0cb,null));};exports[_0xba93('0x45')]=function(_0x1754c0,_0x1538e8){var _0xcfefd0={'raw':!![],'where':{'id':_0x1754c0[_0xba93('0x46')]['id']}},_0x4315f0={};_0x4315f0[_0xba93('0x30')]=_[_0xba93('0x31')](db[_0xba93('0x2d')][_0xba93('0x2e')]);_0x4315f0['query']=_['keys'](_0x1754c0[_0xba93('0x32')]);_0x4315f0[_0xba93('0x33')]=_['intersection'](_0x4315f0['model'],_0x4315f0[_0xba93('0x32')]);_0xcfefd0[_0xba93('0x34')]=_[_0xba93('0x35')](_0x4315f0[_0xba93('0x30')],qs['fields'](_0x1754c0['query']['fields']));_0xcfefd0[_0xba93('0x34')]=_0xcfefd0['attributes']['length']?_0xcfefd0['attributes']:_0x4315f0['model'];if(_0x1754c0[_0xba93('0x32')]['includeAll']){_0xcfefd0[_0xba93('0x41')]=[{'all':!![]}];}_0xcfefd0=_[_0xba93('0x47')]({},_0xcfefd0,_0x1754c0['options']);return db['VoiceTransferReport'][_0xba93('0x48')](_0xcfefd0)[_0xba93('0x24')](handleEntityNotFound(_0x1538e8,null))['then'](respondWithResult(_0x1538e8,null))[_0xba93('0x44')](handleError(_0x1538e8,null));};exports[_0xba93('0x49')]=function(_0x1ff820,_0x324391){return db[_0xba93('0x2d')]['create'](_0x1ff820[_0xba93('0x4a')],{})['then'](respondWithResult(_0x324391,0xc9))[_0xba93('0x44')](handleError(_0x324391,null));};exports[_0xba93('0x4b')]=function(_0x204dd3,_0x3c0c37){if(_0x204dd3[_0xba93('0x4a')]['id']){delete _0x204dd3[_0xba93('0x4a')]['id'];}return db['VoiceTransferReport'][_0xba93('0x48')]({'where':{'id':_0x204dd3[_0xba93('0x46')]['id']}})['then'](handleEntityNotFound(_0x3c0c37,null))[_0xba93('0x24')](saveUpdates(_0x204dd3[_0xba93('0x4a')],null))[_0xba93('0x24')](respondWithResult(_0x3c0c37,null))[_0xba93('0x44')](handleError(_0x3c0c37,null));};exports[_0xba93('0x25')]=function(_0x1c1b64,_0x1d6ebc){return db[_0xba93('0x2d')]['find']({'where':{'id':_0x1c1b64[_0xba93('0x46')]['id']}})[_0xba93('0x24')](handleEntityNotFound(_0x1d6ebc,null))[_0xba93('0x24')](removeEntity(_0x1d6ebc,null))[_0xba93('0x44')](handleError(_0x1d6ebc,null));};exports[_0xba93('0x4c')]=function(_0x37b814,_0x40d7a9){return db[_0xba93('0x2d')][_0xba93('0x4c')]()[_0xba93('0x24')](respondWithResult(_0x40d7a9,null))['catch'](handleError(_0x40d7a9,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 2d3cc9e..18f69c0 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 _0xca8f=['lodash','util','../../config/logger','api','moment','request-promise','../../config/environment','./voiceTransferReport.attributes','define','VoiceTransferReport','report_call_transfer'];(function(_0x2f3d1d,_0x28129e){var _0x89c489=function(_0x25b497){while(--_0x25b497){_0x2f3d1d['push'](_0x2f3d1d['shift']());}};_0x89c489(++_0x28129e);}(_0xca8f,0x113));var _0xfca8=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0xca8f[_0x4fde08];return _0x12e725;};'use strict';var _=require(_0xfca8('0x0'));var util=require(_0xfca8('0x1'));var logger=require(_0xfca8('0x2'))(_0xfca8('0x3'));var moment=require(_0xfca8('0x4'));var BPromise=require('bluebird');var rp=require(_0xfca8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xfca8('0x6'));var attributes=require(_0xfca8('0x7'));module['exports']=function(_0x5aaf89,_0x3d2230){return _0x5aaf89[_0xfca8('0x8')](_0xfca8('0x9'),attributes,{'tableName':_0xfca8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7daf=['VoiceTransferReport','report_call_transfer','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./voiceTransferReport.attributes','define'];(function(_0x255dcd,_0x45bee0){var _0x285e36=function(_0x8eee97){while(--_0x8eee97){_0x255dcd['push'](_0x255dcd['shift']());}};_0x285e36(++_0x45bee0);}(_0x7daf,0x1d6));var _0xf7da=function(_0x1903aa,_0x343458){_0x1903aa=_0x1903aa-0x0;var _0x51fe28=_0x7daf[_0x1903aa];return _0x51fe28;};'use strict';var _=require(_0xf7da('0x0'));var util=require(_0xf7da('0x1'));var logger=require(_0xf7da('0x2'))(_0xf7da('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf7da('0x4'));var fs=require('fs');var path=require(_0xf7da('0x5'));var rimraf=require(_0xf7da('0x6'));var config=require(_0xf7da('0x7'));var attributes=require(_0xf7da('0x8'));module['exports']=function(_0x320755,_0xfdc216){return _0x320755[_0xf7da('0x9')](_0xf7da('0xa'),attributes,{'tableName':_0xf7da('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 95aa417..7ba2acf 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 _0x4501=['body','options','raw','stringify','catch','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','then','info','debug','error','code','VoiceTransferReport,\x20%s,\x20%s','message','result','CreateVoiceTransferReport','VoiceTransferReport','create'];(function(_0x400b2b,_0x4b81ea){var _0x2dd26c=function(_0x50dd8f){while(--_0x50dd8f){_0x400b2b['push'](_0x400b2b['shift']());}};_0x2dd26c(++_0x4b81ea);}(_0x4501,0x6d));var _0x1450=function(_0x11cd18,_0xdd14d6){_0x11cd18=_0x11cd18-0x0;var _0x54f6b2=_0x4501[_0x11cd18];return _0x54f6b2;};'use strict';var _=require('lodash');var util=require(_0x1450('0x0'));var moment=require('moment');var BPromise=require(_0x1450('0x1'));var rs=require(_0x1450('0x2'));var fs=require('fs');var Redis=require(_0x1450('0x3'));var db=require(_0x1450('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1450('0x5'));var config=require('../../config/environment');var jayson=require(_0x1450('0x6'));var client=jayson[_0x1450('0x7')][_0x1450('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x371865,_0xa87477,_0x3a88a5){return new BPromise(function(_0x20895a,_0x2ab7c2){return client[_0x1450('0x9')](_0x371865,_0x3a88a5)[_0x1450('0xa')](function(_0x201af5){logger[_0x1450('0xb')]('VoiceTransferReport,\x20%s,\x20%s',_0xa87477,'request\x20sent');logger[_0x1450('0xc')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0xa87477,'request\x20sent',JSON['stringify'](_0x201af5));if(_0x201af5[_0x1450('0xd')]){if(_0x201af5[_0x1450('0xd')][_0x1450('0xe')]===0x1f4){logger['error'](_0x1450('0xf'),_0xa87477,_0x201af5['error'][_0x1450('0x10')]);return _0x2ab7c2(_0x201af5[_0x1450('0xd')][_0x1450('0x10')]);}logger[_0x1450('0xd')](_0x1450('0xf'),_0xa87477,_0x201af5[_0x1450('0xd')][_0x1450('0x10')]);return _0x20895a(_0x201af5['error'][_0x1450('0x10')]);}else{logger[_0x1450('0xb')](_0x1450('0xf'),_0xa87477,'request\x20sent');_0x20895a(_0x201af5[_0x1450('0x11')][_0x1450('0x10')]);}})['catch'](function(_0x420e9b){logger[_0x1450('0xd')](_0x1450('0xf'),_0xa87477,_0x420e9b);_0x2ab7c2(_0x420e9b);});});}exports[_0x1450('0x12')]=function(_0xcdc80c){var _0xc04d73=this;return new Promise(function(_0x3669ed,_0x2de2fd){return db[_0x1450('0x13')][_0x1450('0x14')](_0xcdc80c[_0x1450('0x15')],{'raw':_0xcdc80c[_0x1450('0x16')]?_0xcdc80c[_0x1450('0x16')][_0x1450('0x17')]===undefined?!![]:![]:!![]})[_0x1450('0xa')](function(_0xe1f367){logger[_0x1450('0xb')](_0x1450('0x12'),_0xcdc80c);logger[_0x1450('0xc')](_0x1450('0x12'),_0xcdc80c,JSON[_0x1450('0x18')](_0xe1f367));_0x3669ed(_0xe1f367);})[_0x1450('0x19')](function(_0x5573b7){logger[_0x1450('0xd')](_0x1450('0x12'),_0x5573b7[_0x1450('0x10')],_0xcdc80c);_0x2de2fd(_0xc04d73['error'](0x1f4,_0x5573b7[_0x1450('0x10')]));});});}; \ No newline at end of file +var _0xe339=['create','body','options','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','CreateVoiceTransferReport'];(function(_0x45cd59,_0x5be7c0){var _0x39541a=function(_0xab724a){while(--_0xab724a){_0x45cd59['push'](_0x45cd59['shift']());}};_0x39541a(++_0x5be7c0);}(_0xe339,0x8d));var _0x9e33=function(_0x28cddc,_0x1be16d){_0x28cddc=_0x28cddc-0x0;var _0x5ce855=_0xe339[_0x28cddc];return _0x5ce855;};'use strict';var _=require('lodash');var util=require(_0x9e33('0x0'));var moment=require('moment');var BPromise=require(_0x9e33('0x1'));var rs=require(_0x9e33('0x2'));var fs=require('fs');var Redis=require(_0x9e33('0x3'));var db=require(_0x9e33('0x4'))['db'];var utils=require(_0x9e33('0x5'));var logger=require(_0x9e33('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9e33('0x7'));var client=jayson[_0x9e33('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b5ab3,_0x273e2d,_0x2d0d60){return new BPromise(function(_0x1c1209,_0x25a74b){return client[_0x9e33('0x9')](_0x5b5ab3,_0x2d0d60)['then'](function(_0x18326b){logger[_0x9e33('0xa')](_0x9e33('0xb'),_0x273e2d,_0x9e33('0xc'));logger[_0x9e33('0xd')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x273e2d,_0x9e33('0xc'),JSON['stringify'](_0x18326b));if(_0x18326b['error']){if(_0x18326b[_0x9e33('0xe')][_0x9e33('0xf')]===0x1f4){logger[_0x9e33('0xe')]('VoiceTransferReport,\x20%s,\x20%s',_0x273e2d,_0x18326b[_0x9e33('0xe')][_0x9e33('0x10')]);return _0x25a74b(_0x18326b[_0x9e33('0xe')][_0x9e33('0x10')]);}logger['error'](_0x9e33('0xb'),_0x273e2d,_0x18326b[_0x9e33('0xe')]['message']);return _0x1c1209(_0x18326b[_0x9e33('0xe')]['message']);}else{logger[_0x9e33('0xa')]('VoiceTransferReport,\x20%s,\x20%s',_0x273e2d,_0x9e33('0xc'));_0x1c1209(_0x18326b[_0x9e33('0x11')][_0x9e33('0x10')]);}})[_0x9e33('0x12')](function(_0x3d29f8){logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x273e2d,_0x3d29f8);_0x25a74b(_0x3d29f8);});});}exports[_0x9e33('0x13')]=function(_0x3d505){var _0x1e91f2=this;return new Promise(function(_0x338979,_0x20373b){return db['VoiceTransferReport'][_0x9e33('0x14')](_0x3d505[_0x9e33('0x15')],{'raw':_0x3d505[_0x9e33('0x16')]?_0x3d505[_0x9e33('0x16')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x25d502){logger[_0x9e33('0xa')](_0x9e33('0x13'),_0x3d505);logger[_0x9e33('0xd')]('CreateVoiceTransferReport',_0x3d505,JSON['stringify'](_0x25d502));_0x338979(_0x25d502);})[_0x9e33('0x12')](function(_0x2e4a5b){logger[_0x9e33('0xe')]('CreateVoiceTransferReport',_0x2e4a5b['message'],_0x3d505);_0x20373b(_0x1e91f2[_0x9e33('0xe')](0x1f4,_0x2e4a5b['message']));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 6b534f4..8dddf08 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 _0x91a7=['/originate','isWebrtcLicence','/hangup','isAuthenticated','hangup','/answer','answer','post','/hold','/unhold','unhold','/calls','/transfer','transfer','exports','Router','../../components/auth/service','./webbar.controller'];(function(_0x4a450a,_0x54d42f){var _0x28baf9=function(_0x5cb70a){while(--_0x5cb70a){_0x4a450a['push'](_0x4a450a['shift']());}};_0x28baf9(++_0x54d42f);}(_0x91a7,0xe7));var _0x791a=function(_0x29c6bd,_0xf4af22){_0x29c6bd=_0x29c6bd-0x0;var _0x520948=_0x91a7[_0x29c6bd];return _0x520948;};'use strict';var express=require('express');var router=express[_0x791a('0x0')]();var auth=require(_0x791a('0x1'));var controller=require(_0x791a('0x2'));router['post'](_0x791a('0x3'),auth['isAuthenticated'](),auth[_0x791a('0x4')](),controller['originate']);router['post'](_0x791a('0x5'),auth[_0x791a('0x6')](),auth['isWebrtcLicence'](),controller[_0x791a('0x7')]);router['post'](_0x791a('0x8'),auth[_0x791a('0x6')](),auth['isWebrtcLicence'](),controller[_0x791a('0x9')]);router[_0x791a('0xa')](_0x791a('0xb'),auth[_0x791a('0x6')](),auth[_0x791a('0x4')](),controller['hold']);router[_0x791a('0xa')](_0x791a('0xc'),auth['isAuthenticated'](),auth[_0x791a('0x4')](),controller[_0x791a('0xd')]);router[_0x791a('0xa')](_0x791a('0xe'),auth[_0x791a('0x6')](),auth[_0x791a('0x4')](),controller['calls']);router['post'](_0x791a('0xf'),auth[_0x791a('0x6')](),auth['isWebrtcLicence'](),controller[_0x791a('0x10')]);module[_0x791a('0x11')]=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(_0x144353,_0x2605bd){var _0xe9c540=function(_0x206334){while(--_0x206334){_0x144353['push'](_0x144353['shift']());}};_0xe9c540(++_0x2605bd);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x3ea74e,_0x3a7ce4){_0x3ea74e=_0x3ea74e-0x0;var _0x587e9a=_0x6f0d[_0x3ea74e];return _0x587e9a;};'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 e2cbee5..494a479 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 _0xb07f=['hold','hold\x20fired:','user:%s','webbar:hold','hold\x20executed!','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','rows','conference','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','util','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','redis','defaults','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','string','callNumber\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','log','handleError:','stack','name','send','status','NotFound','request','then','error','message','result','catch','User','agent','VoiceChannels','all','filter','UserId','length','\x20not\x20found!','originate\x20fired:','body','json','userId','callNumber','callerId','entityFound:','format','webbar:originate','hangup','hangup\x20fired:','sessionId','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','answer\x20executed!'];(function(_0x8c1005,_0x1f3f16){var _0x175354=function(_0xd0e9c4){while(--_0xd0e9c4){_0x8c1005['push'](_0x8c1005['shift']());}};_0x175354(++_0x1f3f16);}(_0xb07f,0x109));var _0xfb07=function(_0x2ab52c,_0x575679){_0x2ab52c=_0x2ab52c-0x0;var _0x1d8f19=_0xb07f[_0x2ab52c];return _0x1d8f19;};'use strict';var path=require(_0xfb07('0x0'));var fs=require('fs');var _=require(_0xfb07('0x1'));var db=require(_0xfb07('0x2'))['db'];var config=require(_0xfb07('0x3'));var util=require(_0xfb07('0x4'));var BPromise=require(_0xfb07('0x5'));var jayson=require(_0xfb07('0x6'));var amiClient=jayson[_0xfb07('0x7')][_0xfb07('0x8')]({'port':0x232a});var logger=require(_0xfb07('0x9'))(_0xfb07('0xa'));var Redis=require('ioredis');config[_0xfb07('0xb')]=_[_0xfb07('0xc')](config[_0xfb07('0xb')],{'host':_0xfb07('0xd'),'port':0x18eb});var io=require(_0xfb07('0xe'))(new Redis(config[_0xfb07('0xb')]));var Schema=require(_0xfb07('0xf'));var originateValidation=new Schema({'userId':{'type':_0xfb07('0x10'),'required':[!![],_0xfb07('0x11')]},'callNumber':{'type':_0xfb07('0x12'),'required':[!![],_0xfb07('0x13')]},'callerId':{'type':_0xfb07('0x12')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xfb07('0x12'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xfb07('0x10'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xfb07('0x12'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xfb07('0x10'),'required':[!![],_0xfb07('0x11')]},'sessionId':{'type':_0xfb07('0x12'),'required':[!![],_0xfb07('0x14')]},'transferNumber':{'type':_0xfb07('0x12'),'required':[!![],_0xfb07('0x15')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0xfb07('0x11')]},'sessionId':{'type':_0xfb07('0x12'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xfb07('0x10'),'required':[!![],_0xfb07('0x11')]},'sessionId':{'type':_0xfb07('0x12'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xfb07('0x10'),'required':[!![],_0xfb07('0x11')]}});var conferenceValidation=new Schema({'userId':{'type':_0xfb07('0x10'),'required':[!![],_0xfb07('0x11')]}});function emit(_0x6a14e0,_0x3dde76,_0x1cfc43){logger[_0xfb07('0x16')](_0x6a14e0,_0x3dde76,JSON[_0xfb07('0x17')](_0x1cfc43));io['to'](_0x6a14e0)['emit'](_0x3dde76,_0x1cfc43);}function handleError(_0x57fc39){return function(_0x3e747e){console[_0xfb07('0x18')](_0xfb07('0x19'),_0x3e747e,_0x3e747e instanceof RangeError);logger['error'](_0x3e747e[_0xfb07('0x1a')]);if(_0x3e747e instanceof RangeError){if(_0x3e747e[_0xfb07('0x1b')]){delete _0x3e747e['name'];}_0x57fc39['status'](0x194)[_0xfb07('0x1c')](_0x3e747e);}else{if(_0x3e747e[_0xfb07('0x1b')]){delete _0x3e747e[_0xfb07('0x1b')];}_0x57fc39[_0xfb07('0x1d')](0x1f4)[_0xfb07('0x1c')](_0x3e747e);}};}function checkError(){return function(_0x323bec){if(!_0x323bec){throw new RangeError(_0xfb07('0x1e'));}return _0x323bec;};}function respondWithRpcPromise(_0x23c2be,_0x19ad99){return new BPromise(function(_0x578bb2,_0x45806a){var _0x56d0c4=amiClient;return _0x56d0c4[_0xfb07('0x1f')](_0x23c2be,_0x19ad99)[_0xfb07('0x20')](function(_0x428c85){if(_0x428c85[_0xfb07('0x21')]){if(_0x428c85[_0xfb07('0x21')]['code']===0x1f4){return _0x45806a(_0x428c85[_0xfb07('0x21')][_0xfb07('0x22')]);}return _0x578bb2(_0x428c85[_0xfb07('0x21')][_0xfb07('0x22')]);}else{_0x578bb2(_0x428c85[_0xfb07('0x23')]);}})[_0xfb07('0x24')](function(_0x531346){_0x45806a(_0x531346);});});}function getAgent(_0x36d6f3){return db[_0xfb07('0x25')]['findOne']({'where':{'id':_0x36d6f3,'role':_0xfb07('0x26')}})[_0xfb07('0x20')](checkError());}function getAgentCheckSession(_0xe813a7,_0x149ac0){return new BPromise(function(_0x46927a,_0x2b0650){var _0x20f01a=respondWithRpcPromise(_0xfb07('0x27'));var _0x95f1d=getAgent(_0xe813a7);Promise[_0xfb07('0x28')]([_0x20f01a,_0x95f1d])[_0xfb07('0x20')](function(_0x49b06e){var _0x217932=_0x49b06e[0x0];var _0x1e4cb8=_0x49b06e[0x1];var _0x36787a=_[_0xfb07('0x29')](_0x217932['rows'],function(_0x46d57e){return _0x46d57e[_0xfb07('0x2a')]==_0x1e4cb8['id']&&_0x46d57e['sessionId']==_0x149ac0;});if(_0x36787a[_0xfb07('0x2b')]==0x1){_0x46927a(_0x1e4cb8);}else{_0x2b0650(new RangeError('sessionId\x20'+_0x149ac0+_0xfb07('0x2c')));}});});}exports['originate']=function(_0x56b48c,_0x4a8d4c){logger[_0xfb07('0x16')](_0xfb07('0x2d'),_0x56b48c[_0xfb07('0x2e')]);var _0x4452d7=originateValidation[_0xfb07('0xf')](_0x56b48c[_0xfb07('0x2e')]);if(_0x4452d7['length']>0x0){return _0x4a8d4c['status'](0x190)[_0xfb07('0x2f')](_0x4452d7);}var _0x1cccdd=_0x56b48c[_0xfb07('0x2e')][_0xfb07('0x30')];var _0x5e28cd=_0x56b48c['body'][_0xfb07('0x31')];var _0x3e0d11=_0x56b48c[_0xfb07('0x2e')][_0xfb07('0x32')];var _0x4d06f5=_0x56b48c[_0xfb07('0x2e')]['callbackUrl'];return getAgent(_0x1cccdd)['then'](function(_0x4a5055){logger[_0xfb07('0x16')](_0xfb07('0x33'),_0x4a5055[_0xfb07('0x1b')]);emit(util[_0xfb07('0x34')]('user:%s',_0x4a5055['name']),_0xfb07('0x35'),{'callNumber':_0x5e28cd,'callerId':_0x3e0d11,'callbackUrl':_0x4d06f5});return _0x4a8d4c[_0xfb07('0x1d')](0xc8)['json']({'error':![],'message':'originate\x20executed!'});})['catch'](handleError(_0x4a8d4c));};exports[_0xfb07('0x36')]=function(_0x10cd8b,_0x55de52){logger['info'](_0xfb07('0x37'),_0x10cd8b[_0xfb07('0x2e')]);var _0x18c41f=hangupValidation[_0xfb07('0xf')](_0x10cd8b[_0xfb07('0x2e')]);if(_0x18c41f['length']>0x0){return _0x55de52[_0xfb07('0x1d')](0x190)[_0xfb07('0x2f')](_0x18c41f);}var _0xac769b=_0x10cd8b[_0xfb07('0x2e')]['userId'];var _0x4ab5dd=_0x10cd8b[_0xfb07('0x2e')][_0xfb07('0x38')];return getAgent(_0xac769b)[_0xfb07('0x20')](function(_0xc5df59){logger[_0xfb07('0x16')](_0xfb07('0x33'),_0xc5df59[_0xfb07('0x1b')]);emit(util['format']('user:%s',_0xc5df59[_0xfb07('0x1b')]),_0xfb07('0x39'),{'sessionId':_0x4ab5dd});return _0x55de52['status'](0xc8)['json']({'error':![],'message':_0xfb07('0x3a')});})[_0xfb07('0x24')](handleError(_0x55de52));};exports[_0xfb07('0x3b')]=function(_0x48c179,_0x479e61){logger[_0xfb07('0x16')](_0xfb07('0x3c'),_0x48c179[_0xfb07('0x2e')]);var _0x123e3d=answerValidation[_0xfb07('0xf')](_0x48c179[_0xfb07('0x2e')]);if(_0x123e3d[_0xfb07('0x2b')]>0x0){return _0x479e61[_0xfb07('0x1d')](0x190)[_0xfb07('0x2f')](_0x123e3d);}var _0x492f1b=_0x48c179[_0xfb07('0x2e')][_0xfb07('0x30')];var _0x3d6372=_0x48c179[_0xfb07('0x2e')][_0xfb07('0x38')];return getAgent(_0x492f1b)[_0xfb07('0x20')](function(_0x4cb228){logger[_0xfb07('0x16')](_0xfb07('0x33'),_0x4cb228[_0xfb07('0x1b')]);emit(util['format']('user:%s',_0x4cb228[_0xfb07('0x1b')]),_0xfb07('0x3d'),{'sessionId':_0x3d6372});return _0x479e61['status'](0xc8)[_0xfb07('0x2f')]({'error':![],'message':_0xfb07('0x3e')});})[_0xfb07('0x24')](handleError(_0x479e61));};exports[_0xfb07('0x3f')]=function(_0x44568c,_0x567958){logger['info'](_0xfb07('0x40'),_0x44568c[_0xfb07('0x2e')]);var _0x38354c=holdValidation[_0xfb07('0xf')](_0x44568c[_0xfb07('0x2e')]);if(_0x38354c[_0xfb07('0x2b')]>0x0){return _0x567958[_0xfb07('0x1d')](0x190)[_0xfb07('0x2f')](_0x38354c);}var _0x186987=_0x44568c[_0xfb07('0x2e')]['userId'];var _0x5b304d=_0x44568c['body'][_0xfb07('0x38')];return getAgent(_0x186987)['then'](function(_0x2397f8){logger[_0xfb07('0x16')](_0xfb07('0x33'),_0x2397f8[_0xfb07('0x1b')]);emit(util[_0xfb07('0x34')](_0xfb07('0x41'),_0x2397f8['name']),_0xfb07('0x42'),{'sessionId':_0x5b304d});return _0x567958[_0xfb07('0x1d')](0xc8)[_0xfb07('0x2f')]({'error':![],'message':_0xfb07('0x43')});})[_0xfb07('0x24')](handleError(_0x567958));};exports['unhold']=function(_0x3cfb89,_0x3b85f7){logger[_0xfb07('0x16')](_0xfb07('0x44'),_0x3cfb89[_0xfb07('0x2e')]);var _0x5179c2=unholdValidation[_0xfb07('0xf')](_0x3cfb89[_0xfb07('0x2e')]);if(_0x5179c2[_0xfb07('0x2b')]>0x0){return _0x3b85f7[_0xfb07('0x1d')](0x190)[_0xfb07('0x2f')](_0x5179c2);}var _0x529936=_0x3cfb89[_0xfb07('0x2e')][_0xfb07('0x30')];var _0x26a7b7=_0x3cfb89[_0xfb07('0x2e')]['sessionId'];return getAgent(_0x529936)[_0xfb07('0x20')](function(_0x204469){logger[_0xfb07('0x16')](_0xfb07('0x33'),_0x204469[_0xfb07('0x1b')]);emit(util[_0xfb07('0x34')](_0xfb07('0x41'),_0x204469[_0xfb07('0x1b')]),_0xfb07('0x45'),{'sessionId':_0x26a7b7});return _0x3b85f7[_0xfb07('0x1d')](0xc8)['json']({'error':![],'message':_0xfb07('0x46')});})['catch'](handleError(_0x3b85f7));};exports[_0xfb07('0x47')]=function(_0xfcaeb7,_0x22fa5c){logger[_0xfb07('0x16')](_0xfb07('0x48'),_0x22fa5c[_0xfb07('0x2e')]);var _0x1c76af=callsValidation['validate'](_0xfcaeb7['body']);if(_0x1c76af['length']>0x0){return _0x22fa5c[_0xfb07('0x1d')](0x190)[_0xfb07('0x2f')](_0x1c76af);}var _0x44d1a1=_0xfcaeb7['body'][_0xfb07('0x30')];var _0x4ef1a4=respondWithRpcPromise(_0xfb07('0x27'));var _0x29e4be=getAgent(_0x44d1a1);return Promise['all']([_0x4ef1a4,_0x29e4be])[_0xfb07('0x20')](function(_0x2f9f0f){var _0x18d0de=_0x2f9f0f[0x0];var _0xc122ae=_0x2f9f0f[0x1];var _0x294dc8=_[_0xfb07('0x29')](_0x18d0de[_0xfb07('0x49')],function(_0x18ae74){return _0x18ae74[_0xfb07('0x2a')]==_0xc122ae['id'];});return _0x22fa5c[_0xfb07('0x1d')](0xc8)[_0xfb07('0x2f')]({'count':_0x294dc8[_0xfb07('0x2b')],'rows':_0x294dc8});})[_0xfb07('0x24')](handleError(_0x22fa5c));};exports[_0xfb07('0x4a')]=function(_0x5387ce,_0x275aba){logger[_0xfb07('0x16')]('conference\x20fired:',_0x5387ce['body']);var _0xb5bf41=conferenceValidation[_0xfb07('0xf')](_0x5387ce[_0xfb07('0x2e')]);if(_0xb5bf41['length']>0x0){return _0x275aba[_0xfb07('0x1d')](0x190)['json'](_0xb5bf41);}var _0x4e323f=_0x5387ce['body']['userId'];return getAgent(_0x4e323f)[_0xfb07('0x20')](function(_0x237117){logger[_0xfb07('0x16')](_0xfb07('0x33'),_0x237117[_0xfb07('0x1b')]);emit(util[_0xfb07('0x34')](_0xfb07('0x41'),_0x237117['name']),_0xfb07('0x4b'));return _0x275aba[_0xfb07('0x1d')](0xc8)[_0xfb07('0x2f')]({'error':![],'message':_0xfb07('0x4c')});})[_0xfb07('0x24')](handleError(_0x275aba));};exports[_0xfb07('0x4d')]=function(_0x268d88,_0x238492){logger['info'](_0xfb07('0x4e'),_0x268d88[_0xfb07('0x2e')]);var _0x3831bf=transferValidation[_0xfb07('0xf')](_0x268d88[_0xfb07('0x2e')]);if(_0x3831bf['length']>0x0){return _0x238492['status'](0x190)[_0xfb07('0x2f')](_0x3831bf);}var _0x231247=_0x268d88['body'][_0xfb07('0x30')];var _0x311c6d=_0x268d88[_0xfb07('0x2e')][_0xfb07('0x38')];var _0x127392=_0x268d88[_0xfb07('0x2e')][_0xfb07('0x4f')];return getAgent(_0x231247)['then'](function(_0x4c1238){logger[_0xfb07('0x16')]('entityFound:',_0x4c1238[_0xfb07('0x1b')]);emit(util[_0xfb07('0x34')](_0xfb07('0x41'),_0x4c1238[_0xfb07('0x1b')]),_0xfb07('0x50'),{'sessionId':_0x311c6d,'transferNumber':_0x127392});return _0x238492[_0xfb07('0x1d')](0xc8)[_0xfb07('0x2f')]({'error':![],'message':_0xfb07('0x51')});})[_0xfb07('0x24')](handleError(_0x238492));}; \ No newline at end of file +var _0x2f68=['conference\x20fired:','conference\x20executed!','transferNumber','webbar:transfer','lodash','../../mysqldb','../../config/environment','util','jayson/promise','http','../../config/logger','ioredis','redis','localhost','validate','number','userId\x20is\x20required','callNumber\x20is\x20required','string','transferNumber\x20is\x20required','info','stringify','emit','log','handleError:','error','stack','name','status','send','NotFound','request','message','result','catch','User','agent','then','all','filter','rows','UserId','sessionId','length','sessionId\x20','originate','originate\x20fired:','body','json','userId','callNumber','callerId','callbackUrl','entityFound:','format','user:%s','webbar:originate','hangup','hangup\x20fired:','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','unhold\x20executed!','calls\x20fired:','VoiceChannels','conference'];(function(_0x4e50b6,_0x724a09){var _0x3558cf=function(_0x401e6d){while(--_0x401e6d){_0x4e50b6['push'](_0x4e50b6['shift']());}};_0x3558cf(++_0x724a09);}(_0x2f68,0x9a));var _0x82f6=function(_0xb96774,_0x80aba4){_0xb96774=_0xb96774-0x0;var _0x334a2d=_0x2f68[_0xb96774];return _0x334a2d;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0x82f6('0x0'));var db=require(_0x82f6('0x1'))['db'];var config=require(_0x82f6('0x2'));var util=require(_0x82f6('0x3'));var BPromise=require('bluebird');var jayson=require(_0x82f6('0x4'));var amiClient=jayson['client'][_0x82f6('0x5')]({'port':0x232a});var logger=require(_0x82f6('0x6'))('webbarapi');var Redis=require(_0x82f6('0x7'));config[_0x82f6('0x8')]=_['defaults'](config['redis'],{'host':_0x82f6('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Schema=require(_0x82f6('0xa'));var originateValidation=new Schema({'userId':{'type':_0x82f6('0xb'),'required':[!![],_0x82f6('0xc')]},'callNumber':{'type':'string','required':[!![],_0x82f6('0xd')]},'callerId':{'type':_0x82f6('0xe')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0x82f6('0xb'),'required':[!![],_0x82f6('0xc')]},'sessionId':{'type':_0x82f6('0xe'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x82f6('0xb'),'required':[!![],_0x82f6('0xc')]},'sessionId':{'type':_0x82f6('0xe'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0x82f6('0xc')]},'sessionId':{'type':_0x82f6('0xe'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0x82f6('0xe'),'required':[!![],_0x82f6('0xf')]}});var holdValidation=new Schema({'userId':{'type':_0x82f6('0xb'),'required':[!![],_0x82f6('0xc')]},'sessionId':{'type':_0x82f6('0xe'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x82f6('0xb'),'required':[!![],_0x82f6('0xc')]},'sessionId':{'type':_0x82f6('0xe'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x82f6('0xb'),'required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0x82f6('0xb'),'required':[!![],'userId\x20is\x20required']}});function emit(_0x249222,_0x1d0263,_0x31b4fb){logger[_0x82f6('0x10')](_0x249222,_0x1d0263,JSON[_0x82f6('0x11')](_0x31b4fb));io['to'](_0x249222)[_0x82f6('0x12')](_0x1d0263,_0x31b4fb);}function handleError(_0x326378){return function(_0xcbc95f){console[_0x82f6('0x13')](_0x82f6('0x14'),_0xcbc95f,_0xcbc95f instanceof RangeError);logger[_0x82f6('0x15')](_0xcbc95f[_0x82f6('0x16')]);if(_0xcbc95f instanceof RangeError){if(_0xcbc95f[_0x82f6('0x17')]){delete _0xcbc95f[_0x82f6('0x17')];}_0x326378[_0x82f6('0x18')](0x194)['send'](_0xcbc95f);}else{if(_0xcbc95f[_0x82f6('0x17')]){delete _0xcbc95f[_0x82f6('0x17')];}_0x326378['status'](0x1f4)[_0x82f6('0x19')](_0xcbc95f);}};}function checkError(){return function(_0x4b9f0){if(!_0x4b9f0){throw new RangeError(_0x82f6('0x1a'));}return _0x4b9f0;};}function respondWithRpcPromise(_0x25cae6,_0x4bfeb8){return new BPromise(function(_0xdc4dea,_0x4beccf){var _0x8668bb=amiClient;return _0x8668bb[_0x82f6('0x1b')](_0x25cae6,_0x4bfeb8)['then'](function(_0x516deb){if(_0x516deb[_0x82f6('0x15')]){if(_0x516deb[_0x82f6('0x15')]['code']===0x1f4){return _0x4beccf(_0x516deb['error'][_0x82f6('0x1c')]);}return _0xdc4dea(_0x516deb[_0x82f6('0x15')]['message']);}else{_0xdc4dea(_0x516deb[_0x82f6('0x1d')]);}})[_0x82f6('0x1e')](function(_0x5037f8){_0x4beccf(_0x5037f8);});});}function getAgent(_0x57ac0d){return db[_0x82f6('0x1f')]['findOne']({'where':{'id':_0x57ac0d,'role':_0x82f6('0x20')}})[_0x82f6('0x21')](checkError());}function getAgentCheckSession(_0x54ce11,_0x3795ef){return new BPromise(function(_0x15c9b7,_0x33ef08){var _0x1125a0=respondWithRpcPromise('VoiceChannels');var _0x40a071=getAgent(_0x54ce11);Promise[_0x82f6('0x22')]([_0x1125a0,_0x40a071])[_0x82f6('0x21')](function(_0x400137){var _0x271c28=_0x400137[0x0];var _0x328707=_0x400137[0x1];var _0x27e473=_[_0x82f6('0x23')](_0x271c28[_0x82f6('0x24')],function(_0x402449){return _0x402449[_0x82f6('0x25')]==_0x328707['id']&&_0x402449[_0x82f6('0x26')]==_0x3795ef;});if(_0x27e473[_0x82f6('0x27')]==0x1){_0x15c9b7(_0x328707);}else{_0x33ef08(new RangeError(_0x82f6('0x28')+_0x3795ef+'\x20not\x20found!'));}});});}exports[_0x82f6('0x29')]=function(_0x2c764f,_0x418f34){logger['info'](_0x82f6('0x2a'),_0x2c764f[_0x82f6('0x2b')]);var _0x831131=originateValidation[_0x82f6('0xa')](_0x2c764f[_0x82f6('0x2b')]);if(_0x831131[_0x82f6('0x27')]>0x0){return _0x418f34[_0x82f6('0x18')](0x190)[_0x82f6('0x2c')](_0x831131);}var _0x4756ee=_0x2c764f[_0x82f6('0x2b')][_0x82f6('0x2d')];var _0x31df71=_0x2c764f[_0x82f6('0x2b')][_0x82f6('0x2e')];var _0x4c45a4=_0x2c764f[_0x82f6('0x2b')][_0x82f6('0x2f')];var _0x1c6ce4=_0x2c764f[_0x82f6('0x2b')][_0x82f6('0x30')];return getAgent(_0x4756ee)[_0x82f6('0x21')](function(_0x34c2f1){logger[_0x82f6('0x10')](_0x82f6('0x31'),_0x34c2f1[_0x82f6('0x17')]);emit(util[_0x82f6('0x32')](_0x82f6('0x33'),_0x34c2f1[_0x82f6('0x17')]),_0x82f6('0x34'),{'callNumber':_0x31df71,'callerId':_0x4c45a4,'callbackUrl':_0x1c6ce4});return _0x418f34['status'](0xc8)[_0x82f6('0x2c')]({'error':![],'message':'originate\x20executed!'});})['catch'](handleError(_0x418f34));};exports[_0x82f6('0x35')]=function(_0x18c81e,_0x5e8828){logger[_0x82f6('0x10')](_0x82f6('0x36'),_0x18c81e[_0x82f6('0x2b')]);var _0x56e5f1=hangupValidation[_0x82f6('0xa')](_0x18c81e['body']);if(_0x56e5f1[_0x82f6('0x27')]>0x0){return _0x5e8828['status'](0x190)[_0x82f6('0x2c')](_0x56e5f1);}var _0x47ef9e=_0x18c81e[_0x82f6('0x2b')][_0x82f6('0x2d')];var _0x5ad42c=_0x18c81e[_0x82f6('0x2b')][_0x82f6('0x26')];return getAgent(_0x47ef9e)[_0x82f6('0x21')](function(_0x43dcd1){logger['info'](_0x82f6('0x31'),_0x43dcd1[_0x82f6('0x17')]);emit(util[_0x82f6('0x32')](_0x82f6('0x33'),_0x43dcd1['name']),_0x82f6('0x37'),{'sessionId':_0x5ad42c});return _0x5e8828[_0x82f6('0x18')](0xc8)['json']({'error':![],'message':_0x82f6('0x38')});})[_0x82f6('0x1e')](handleError(_0x5e8828));};exports[_0x82f6('0x39')]=function(_0x23662f,_0xc3e250){logger['info'](_0x82f6('0x3a'),_0x23662f['body']);var _0x139614=answerValidation[_0x82f6('0xa')](_0x23662f[_0x82f6('0x2b')]);if(_0x139614[_0x82f6('0x27')]>0x0){return _0xc3e250[_0x82f6('0x18')](0x190)[_0x82f6('0x2c')](_0x139614);}var _0x43fefc=_0x23662f['body'][_0x82f6('0x2d')];var _0x297cda=_0x23662f[_0x82f6('0x2b')][_0x82f6('0x26')];return getAgent(_0x43fefc)['then'](function(_0x408dce){logger['info'](_0x82f6('0x31'),_0x408dce[_0x82f6('0x17')]);emit(util[_0x82f6('0x32')](_0x82f6('0x33'),_0x408dce[_0x82f6('0x17')]),_0x82f6('0x3b'),{'sessionId':_0x297cda});return _0xc3e250['status'](0xc8)[_0x82f6('0x2c')]({'error':![],'message':_0x82f6('0x3c')});})[_0x82f6('0x1e')](handleError(_0xc3e250));};exports[_0x82f6('0x3d')]=function(_0x10ae6e,_0x95c1fa){logger[_0x82f6('0x10')](_0x82f6('0x3e'),_0x10ae6e['body']);var _0x43b92e=holdValidation[_0x82f6('0xa')](_0x10ae6e['body']);if(_0x43b92e[_0x82f6('0x27')]>0x0){return _0x95c1fa['status'](0x190)[_0x82f6('0x2c')](_0x43b92e);}var _0x5e3321=_0x10ae6e[_0x82f6('0x2b')][_0x82f6('0x2d')];var _0xbcc26b=_0x10ae6e[_0x82f6('0x2b')][_0x82f6('0x26')];return getAgent(_0x5e3321)[_0x82f6('0x21')](function(_0x53f7d4){logger[_0x82f6('0x10')](_0x82f6('0x31'),_0x53f7d4['name']);emit(util['format'](_0x82f6('0x33'),_0x53f7d4[_0x82f6('0x17')]),_0x82f6('0x3f'),{'sessionId':_0xbcc26b});return _0x95c1fa['status'](0xc8)[_0x82f6('0x2c')]({'error':![],'message':_0x82f6('0x40')});})[_0x82f6('0x1e')](handleError(_0x95c1fa));};exports[_0x82f6('0x41')]=function(_0x4e9e13,_0x495400){logger[_0x82f6('0x10')](_0x82f6('0x42'),_0x4e9e13[_0x82f6('0x2b')]);var _0x5231bb=unholdValidation[_0x82f6('0xa')](_0x4e9e13[_0x82f6('0x2b')]);if(_0x5231bb['length']>0x0){return _0x495400['status'](0x190)['json'](_0x5231bb);}var _0x2e6b03=_0x4e9e13['body'][_0x82f6('0x2d')];var _0x57c023=_0x4e9e13[_0x82f6('0x2b')]['sessionId'];return getAgent(_0x2e6b03)[_0x82f6('0x21')](function(_0x58f89b){logger[_0x82f6('0x10')](_0x82f6('0x31'),_0x58f89b[_0x82f6('0x17')]);emit(util[_0x82f6('0x32')](_0x82f6('0x33'),_0x58f89b[_0x82f6('0x17')]),'webbar:unhold',{'sessionId':_0x57c023});return _0x495400[_0x82f6('0x18')](0xc8)[_0x82f6('0x2c')]({'error':![],'message':_0x82f6('0x43')});})['catch'](handleError(_0x495400));};exports['calls']=function(_0x13406f,_0x81e595){logger[_0x82f6('0x10')](_0x82f6('0x44'),_0x81e595['body']);var _0x2c1c0e=callsValidation[_0x82f6('0xa')](_0x13406f[_0x82f6('0x2b')]);if(_0x2c1c0e['length']>0x0){return _0x81e595['status'](0x190)['json'](_0x2c1c0e);}var _0x44218c=_0x13406f[_0x82f6('0x2b')][_0x82f6('0x2d')];var _0x59176d=respondWithRpcPromise(_0x82f6('0x45'));var _0x26c1d8=getAgent(_0x44218c);return Promise[_0x82f6('0x22')]([_0x59176d,_0x26c1d8])[_0x82f6('0x21')](function(_0x51791c){var _0x255da2=_0x51791c[0x0];var _0x94aed4=_0x51791c[0x1];var _0x12a5b9=_[_0x82f6('0x23')](_0x255da2['rows'],function(_0x53c715){return _0x53c715[_0x82f6('0x25')]==_0x94aed4['id'];});return _0x81e595[_0x82f6('0x18')](0xc8)['json']({'count':_0x12a5b9[_0x82f6('0x27')],'rows':_0x12a5b9});})[_0x82f6('0x1e')](handleError(_0x81e595));};exports[_0x82f6('0x46')]=function(_0x5b3aaa,_0x32fa83){logger[_0x82f6('0x10')](_0x82f6('0x47'),_0x5b3aaa[_0x82f6('0x2b')]);var _0x169aa3=conferenceValidation[_0x82f6('0xa')](_0x5b3aaa['body']);if(_0x169aa3[_0x82f6('0x27')]>0x0){return _0x32fa83[_0x82f6('0x18')](0x190)[_0x82f6('0x2c')](_0x169aa3);}var _0x2d57e3=_0x5b3aaa[_0x82f6('0x2b')]['userId'];return getAgent(_0x2d57e3)[_0x82f6('0x21')](function(_0x3cc579){logger[_0x82f6('0x10')](_0x82f6('0x31'),_0x3cc579[_0x82f6('0x17')]);emit(util[_0x82f6('0x32')](_0x82f6('0x33'),_0x3cc579[_0x82f6('0x17')]),'webbar:conference');return _0x32fa83[_0x82f6('0x18')](0xc8)['json']({'error':![],'message':_0x82f6('0x48')});})[_0x82f6('0x1e')](handleError(_0x32fa83));};exports['transfer']=function(_0x843458,_0x32e43d){logger[_0x82f6('0x10')]('transfer\x20fired:',_0x843458['body']);var _0x140dcd=transferValidation[_0x82f6('0xa')](_0x843458['body']);if(_0x140dcd['length']>0x0){return _0x32e43d[_0x82f6('0x18')](0x190)[_0x82f6('0x2c')](_0x140dcd);}var _0x1c37d2=_0x843458[_0x82f6('0x2b')][_0x82f6('0x2d')];var _0x11581c=_0x843458[_0x82f6('0x2b')][_0x82f6('0x26')];var _0x2d0d7c=_0x843458[_0x82f6('0x2b')][_0x82f6('0x49')];return getAgent(_0x1c37d2)[_0x82f6('0x21')](function(_0x53d931){logger[_0x82f6('0x10')](_0x82f6('0x31'),_0x53d931[_0x82f6('0x17')]);emit(util[_0x82f6('0x32')](_0x82f6('0x33'),_0x53d931['name']),_0x82f6('0x4a'),{'sessionId':_0x11581c,'transferNumber':_0x2d0d7c});return _0x32e43d[_0x82f6('0x18')](0xc8)[_0x82f6('0x2c')]({'error':![],'message':'transfer\x20executed!'});})[_0x82f6('0x1e')](handleError(_0x32e43d));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index bfe67f7..6f88b8c 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 _0x9536=['getAnswers','/:id/users','getAgents','/:id/applications','getApplications','post','create','addDisposition','addAnswer','addApplications','/:id/notify','notify','send','put','delete','destroy','removeAgents','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers'];(function(_0x4785b0,_0x6daccd){var _0x43ff71=function(_0x324531){while(--_0x324531){_0x4785b0['push'](_0x4785b0['shift']());}};_0x43ff71(++_0x6daccd);}(_0x9536,0x179));var _0x6953=function(_0x172ed7,_0x3d08fd){_0x172ed7=_0x172ed7-0x0;var _0xfa8f61=_0x9536[_0x172ed7];return _0xfa8f61;};'use strict';var multer=require(_0x6953('0x0'));var util=require(_0x6953('0x1'));var path=require(_0x6953('0x2'));var timeout=require(_0x6953('0x3'));var express=require('express');var router=express[_0x6953('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6953('0x5'));var interaction=require(_0x6953('0x6'));var config=require(_0x6953('0x7'));var controller=require(_0x6953('0x8'));router[_0x6953('0x9')]('/',auth['isAuthenticated'](),controller[_0x6953('0xa')]);router[_0x6953('0x9')](_0x6953('0xb'),auth[_0x6953('0xc')](),controller[_0x6953('0xd')]);router['get'](_0x6953('0xe'),auth[_0x6953('0xc')](),controller[_0x6953('0xf')]);router['get'](_0x6953('0x10'),auth[_0x6953('0xc')](),controller[_0x6953('0x11')]);router[_0x6953('0x9')](_0x6953('0x12'),auth[_0x6953('0xc')](),controller[_0x6953('0x13')]);router[_0x6953('0x9')](_0x6953('0x14'),auth['isAuthenticated'](),controller[_0x6953('0x15')]);router['get'](_0x6953('0x16'),auth[_0x6953('0xc')](),controller[_0x6953('0x17')]);router[_0x6953('0x18')]('/',auth[_0x6953('0xc')](),controller[_0x6953('0x19')]);router[_0x6953('0x18')](_0x6953('0x10'),auth[_0x6953('0xc')](),controller[_0x6953('0x1a')]);router[_0x6953('0x18')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x6953('0x1b')]);router[_0x6953('0x18')](_0x6953('0x14'),auth[_0x6953('0xc')](),controller['addAgents']);router[_0x6953('0x18')](_0x6953('0x16'),auth['isAuthenticated'](),controller[_0x6953('0x1c')]);router[_0x6953('0x18')](_0x6953('0x1d'),controller[_0x6953('0x1e')]);router[_0x6953('0x18')]('/:id/send',auth[_0x6953('0xc')](),controller[_0x6953('0x1f')]);router[_0x6953('0x20')](_0x6953('0xe'),auth[_0x6953('0xc')](),controller['update']);router[_0x6953('0x21')](_0x6953('0xe'),auth['isAuthenticated'](),controller[_0x6953('0x22')]);router[_0x6953('0x21')](_0x6953('0x10'),auth[_0x6953('0xc')](),controller['removeDispositions']);router[_0x6953('0x21')](_0x6953('0x12'),auth[_0x6953('0xc')](),controller['removeAnswers']);router['delete']('/:id/users',auth[_0x6953('0xc')](),controller[_0x6953('0x23')]);module['exports']=router; \ No newline at end of file +var _0xb016=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/users','getApplications','addAnswer','post','addAgents','/:id/applications','addApplications','/:id/notify','notify','/:id/send','send','put','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','express','fs-extra','../../components/auth/service'];(function(_0x1fa83a,_0x58a936){var _0xd42f12=function(_0x41026c){while(--_0x41026c){_0x1fa83a['push'](_0x1fa83a['shift']());}};_0xd42f12(++_0x58a936);}(_0xb016,0x159));var _0x6b01=function(_0x1e326b,_0xf17681){_0x1e326b=_0x1e326b-0x0;var _0xc49112=_0xb016[_0x1e326b];return _0xc49112;};'use strict';var multer=require(_0x6b01('0x0'));var util=require(_0x6b01('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6b01('0x2'));var router=express['Router']();var fs_extra=require(_0x6b01('0x3'));var auth=require(_0x6b01('0x4'));var interaction=require(_0x6b01('0x5'));var config=require(_0x6b01('0x6'));var controller=require('./whatsappAccount.controller');router[_0x6b01('0x7')]('/',auth[_0x6b01('0x8')](),controller[_0x6b01('0x9')]);router['get']('/describe',auth[_0x6b01('0x8')](),controller[_0x6b01('0xa')]);router['get']('/:id',auth[_0x6b01('0x8')](),controller[_0x6b01('0xb')]);router[_0x6b01('0x7')](_0x6b01('0xc'),auth[_0x6b01('0x8')](),controller['getDispositions']);router['get'](_0x6b01('0xd'),auth[_0x6b01('0x8')](),controller[_0x6b01('0xe')]);router['get'](_0x6b01('0xf'),auth['isAuthenticated'](),controller['getAgents']);router[_0x6b01('0x7')]('/:id/applications',auth[_0x6b01('0x8')](),controller[_0x6b01('0x10')]);router['post']('/',auth[_0x6b01('0x8')](),controller['create']);router['post']('/:id/dispositions',auth[_0x6b01('0x8')](),controller['addDisposition']);router['post'](_0x6b01('0xd'),auth[_0x6b01('0x8')](),controller[_0x6b01('0x11')]);router[_0x6b01('0x12')](_0x6b01('0xf'),auth[_0x6b01('0x8')](),controller[_0x6b01('0x13')]);router[_0x6b01('0x12')](_0x6b01('0x14'),auth[_0x6b01('0x8')](),controller[_0x6b01('0x15')]);router['post'](_0x6b01('0x16'),controller[_0x6b01('0x17')]);router[_0x6b01('0x12')](_0x6b01('0x18'),auth[_0x6b01('0x8')](),controller[_0x6b01('0x19')]);router[_0x6b01('0x1a')](_0x6b01('0x1b'),auth['isAuthenticated'](),controller[_0x6b01('0x1c')]);router[_0x6b01('0x1d')](_0x6b01('0x1b'),auth[_0x6b01('0x8')](),controller[_0x6b01('0x1e')]);router[_0x6b01('0x1d')](_0x6b01('0xc'),auth['isAuthenticated'](),controller[_0x6b01('0x1f')]);router[_0x6b01('0x1d')](_0x6b01('0xd'),auth['isAuthenticated'](),controller[_0x6b01('0x20')]);router[_0x6b01('0x1d')](_0x6b01('0xf'),auth[_0x6b01('0x8')](),controller[_0x6b01('0x21')]);module[_0x6b01('0x22')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 3a6dde6..f3478a3 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 _0xf7e4=['name','generate','twilio','sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','STRING'];(function(_0x4938f6,_0x791533){var _0x5227f3=function(_0x112b24){while(--_0x112b24){_0x4938f6['push'](_0x4938f6['shift']());}};_0x5227f3(++_0x791533);}(_0xf7e4,0xac));var _0x4f7e=function(_0x1c7238,_0x73cfec){_0x1c7238=_0x1c7238-0x0;var _0x54da8a=_0xf7e4[_0x1c7238];return _0x54da8a;};'use strict';var Sequelize=require(_0x4f7e('0x0'));var rs=require(_0x4f7e('0x1'));module[_0x4f7e('0x2')]={'name':{'type':Sequelize[_0x4f7e('0x3')],'unique':_0x4f7e('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x4f7e('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x4f7e('0x3')],'defaultValue':function(){return rs[_0x4f7e('0x5')]();}},'phone':{'type':Sequelize[_0x4f7e('0x3')]},'type':{'type':Sequelize['ENUM'](_0x4f7e('0x6'),_0x4f7e('0x7'))},'accountSid':{'type':Sequelize[_0x4f7e('0x3')]},'baseUrl':{'type':Sequelize[_0x4f7e('0x3')]},'authToken':{'type':Sequelize[_0x4f7e('0x3')]},'notificationTemplate':{'type':Sequelize[_0x4f7e('0x8')],'defaultValue':function(){return _0x4f7e('0x9');}},'notificationSound':{'type':Sequelize[_0x4f7e('0xa')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x4f7e('0xa')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x4f7e('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4f7e('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4f7e('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4f7e('0xb')],'comment':_0x4f7e('0xc')},'mandatoryDisposition':{'type':Sequelize[_0x4f7e('0xa')],'defaultValue':![],'comment':_0x4f7e('0xd'),'set':function(_0xe51dc2){if(!_0xe51dc2){this[_0x4f7e('0xe')]('mandatoryDispositionPauseId',null);}this[_0x4f7e('0xe')](_0x4f7e('0xf'),_0xe51dc2);}},'description':{'type':Sequelize[_0x4f7e('0x3')]}}; \ No newline at end of file +var _0x2b40=['STRING','generate','sinch','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2b40,0x8d));var _0x02b4=function(_0x11c780,_0x30248f){_0x11c780=_0x11c780-0x0;var _0x55e66d=_0x2b40[_0x11c780];return _0x55e66d;};'use strict';var Sequelize=require(_0x02b4('0x0'));var rs=require(_0x02b4('0x1'));module['exports']={'name':{'type':Sequelize[_0x02b4('0x2')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x02b4('0x2')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x02b4('0x3')]();}},'phone':{'type':Sequelize[_0x02b4('0x2')]},'type':{'type':Sequelize['ENUM']('twilio',_0x02b4('0x4'))},'accountSid':{'type':Sequelize[_0x02b4('0x2')]},'baseUrl':{'type':Sequelize[_0x02b4('0x2')]},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x02b4('0x5');}},'notificationSound':{'type':Sequelize[_0x02b4('0x6')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x02b4('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x02b4('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x02b4('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x02b4('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x02b4('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x02b4('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x02b4('0x7')],'comment':_0x02b4('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x02b4('0x6')],'defaultValue':![],'comment':_0x02b4('0x9'),'set':function(_0x2624e4){if(!_0x2624e4){this[_0x02b4('0xa')](_0x02b4('0xb'),null);}this['setDataValue'](_0x02b4('0xc'),_0x2624e4);}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index cec0abe..4dac9f7 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 _0xe07e=['AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s','entity\x20found','debug','Content-Type','text/xml','to\x20is\x20mandatory','CmList','List','DESC','user','out','dataValues','Messages','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','defaults','redis','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','end','json','offset','undefined','limit','count','set','apply','update','destroy','WhatsappAccounts','UserProfileResource','stack','name','index','mandatoryDispositionPause','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','map','options','WhatsappAccount','includeAll','include','findAll','show','params','find','create','body','get','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Pause','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','hasOwnProperty','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addAgents','omit','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','sendStatus','send','getApplications','notify','whatsapp','account','statuses','state','WhatsappMessage','timestamp','message_id','orderBy','Applications','asc','ValidationError','difference','updatedAt','createdAt','CompanyId','ListId','mobile','twilio','From','replace','whatsapp:','messageId','MessageSid','sinch','notifications','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','Sequelize','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmContact','Contacts','list','contact','WhatsappInteraction','spread','interaction','created','autoclose','applications','push','unmanaged','*,*,*,*','ContactId'];(function(_0x557bf4,_0x1f8dad){var _0x2916e2=function(_0x4fef9b){while(--_0x4fef9b){_0x557bf4['push'](_0x557bf4['shift']());}};_0x2916e2(++_0x1f8dad);}(_0xe07e,0x19a));var _0xee07=function(_0x1b4002,_0x5b4094){_0x1b4002=_0x1b4002-0x0;var _0x1716f3=_0xe07e[_0x1b4002];return _0x1716f3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xee07('0x0'));var jsonpatch=require(_0xee07('0x1'));var rp=require(_0xee07('0x2'));var moment=require(_0xee07('0x3'));var BPromise=require(_0xee07('0x4'));var Mustache=require(_0xee07('0x5'));var util=require('util');var path=require('path');var sox=require(_0xee07('0x6'));var csv=require(_0xee07('0x7'));var ejs=require(_0xee07('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xee07('0x9'));var squel=require(_0xee07('0xa'));var crypto=require(_0xee07('0xb'));var jsforce=require(_0xee07('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xee07('0xd'));var Papa=require(_0xee07('0xe'));var Redis=require(_0xee07('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xee07('0x10'));var logger=require(_0xee07('0x11'))(_0xee07('0x12'));var utils=require(_0xee07('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xee07('0x14'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xee07('0x15')](config[_0xee07('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xee07('0x17'))(new Redis(config[_0xee07('0x16')]));require(_0xee07('0x18'))[_0xee07('0x19')](socket);var jayson=require(_0xee07('0x1a'));var client=jayson[_0xee07('0x1b')]['http']({'port':0x232c});function respondWithRpcPromise(_0x10d323,_0x40d763,_0x19025e,_0x2da536){return new BPromise(function(_0x56e38f,_0x172c00){var _0x141e52=_0x2da536||client;return _0x141e52['request'](_0x10d323,_0x19025e)[_0xee07('0x1c')](function(_0x19ad06){logger[_0xee07('0x1d')](_0xee07('0x1e'),_0x40d763,_0xee07('0x1f'));logger['debug']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x40d763,_0xee07('0x1f'),JSON[_0xee07('0x20')](_0x19ad06));if(_0x19ad06[_0xee07('0x21')]){if(_0x19ad06['error'][_0xee07('0x22')]===0x1f4){logger[_0xee07('0x21')](_0xee07('0x1e'),_0x40d763,_0x19ad06[_0xee07('0x21')][_0xee07('0x23')]);return _0x172c00(_0x19ad06[_0xee07('0x21')][_0xee07('0x23')]);}logger[_0xee07('0x21')](_0xee07('0x1e'),_0x40d763,_0x19ad06[_0xee07('0x21')][_0xee07('0x23')]);return _0x56e38f(_0x19ad06[_0xee07('0x21')][_0xee07('0x23')]);}else{logger[_0xee07('0x1d')]('WhatsappAccount,\x20%s,\x20%s',_0x40d763,'request\x20sent');_0x56e38f(_0x19ad06[_0xee07('0x24')][_0xee07('0x23')]);}})[_0xee07('0x25')](function(_0x45f67e){logger[_0xee07('0x21')](_0xee07('0x1e'),_0x40d763,_0x45f67e);_0x172c00(_0x45f67e);});});}function respondWithStatusCode(_0x11ef95,_0x236ee6){_0x236ee6=_0x236ee6||0xcc;return function(_0x562a6a){if(_0x562a6a){return _0x11ef95['sendStatus'](_0x236ee6);}return _0x11ef95[_0xee07('0x26')](_0x236ee6)[_0xee07('0x27')]();};}function respondWithResult(_0x236374,_0x187c80){_0x187c80=_0x187c80||0xc8;return function(_0x41b154){if(_0x41b154){return _0x236374[_0xee07('0x26')](_0x187c80)[_0xee07('0x28')](_0x41b154);}};}function respondWithFilteredResult(_0x33d7af,_0x528f9e){return function(_0x26e74f){if(_0x26e74f){var _0x3fe293=typeof _0x528f9e[_0xee07('0x29')]===_0xee07('0x2a')&&typeof _0x528f9e[_0xee07('0x2b')]===_0xee07('0x2a');var _0x4e2cfd=_0x26e74f[_0xee07('0x2c')];var _0x3bda3c=_0x3fe293?0x0:_0x528f9e[_0xee07('0x29')];var _0xaa7a46=_0x3fe293?_0x26e74f[_0xee07('0x2c')]:_0x528f9e[_0xee07('0x29')]+_0x528f9e[_0xee07('0x2b')];var _0x16f94b;if(_0xaa7a46>=_0x4e2cfd){_0xaa7a46=_0x4e2cfd;_0x16f94b=0xc8;}else{_0x16f94b=0xce;}_0x33d7af[_0xee07('0x26')](_0x16f94b);return _0x33d7af[_0xee07('0x2d')]('Content-Range',_0x3bda3c+'-'+_0xaa7a46+'/'+_0x4e2cfd)[_0xee07('0x28')](_0x26e74f);}return null;};}function patchUpdates(_0x153ff6){return function(_0x5c3044){try{jsonpatch[_0xee07('0x2e')](_0x5c3044,_0x153ff6,!![]);}catch(_0x25c160){return BPromise['reject'](_0x25c160);}return _0x5c3044['save']();};}function saveUpdates(_0x2408a8,_0x159f83){return function(_0x4f15d8){if(_0x4f15d8){return _0x4f15d8[_0xee07('0x2f')](_0x2408a8)['then'](function(_0x475921){return _0x475921;});}return null;};}function removeEntity(_0x311040,_0x4a4a04){return function(_0x3f0c1b){if(_0x3f0c1b){return _0x3f0c1b[_0xee07('0x30')]()[_0xee07('0x1c')](function(){var _0x578ed5=_0x3f0c1b['get']({'plain':!![]});var _0x5c272b=_0xee07('0x31');return db[_0xee07('0x32')][_0xee07('0x30')]({'where':{'type':_0x5c272b,'resourceId':_0x578ed5['id']}})[_0xee07('0x1c')](function(){return _0x3f0c1b;});})[_0xee07('0x1c')](function(){_0x311040[_0xee07('0x26')](0xcc)[_0xee07('0x27')]();});}};}function handleEntityNotFound(_0x5119fa,_0x3f163a){return function(_0x4379d5){if(!_0x4379d5){_0x5119fa['sendStatus'](0x194);}return _0x4379d5;};}function handleError(_0x559940,_0x307d1b){_0x307d1b=_0x307d1b||0x1f4;return function(_0x6dac4f){logger[_0xee07('0x21')](_0x6dac4f[_0xee07('0x33')]);if(_0x6dac4f['name']){delete _0x6dac4f[_0xee07('0x34')];}_0x559940[_0xee07('0x26')](_0x307d1b)['send'](_0x6dac4f);};}exports[_0xee07('0x35')]=function(_0x1064ec,_0x3e8a73){var _0x5e8d5a={'include':[{'model':db['Pause'],'as':_0xee07('0x36')}]},_0x303d68={},_0x2ee986={'count':0x0,'rows':[]};var _0x2a5d49=_['map'](db['WhatsappAccount'][_0xee07('0x37')],function(_0xf1c280){return{'name':_0xf1c280['fieldName'],'type':_0xf1c280[_0xee07('0x38')][_0xee07('0x39')]};});_0x303d68[_0xee07('0x3a')]=_['map'](_0x2a5d49,_0xee07('0x34'));_0x303d68[_0xee07('0x3b')]=_[_0xee07('0x3c')](_0x1064ec['query']);_0x303d68[_0xee07('0x3d')]=_[_0xee07('0x3e')](_0x303d68[_0xee07('0x3a')],_0x303d68['query']);_0x5e8d5a[_0xee07('0x3f')]=_['intersection'](_0x303d68[_0xee07('0x3a')],qs[_0xee07('0x40')](_0x1064ec[_0xee07('0x3b')][_0xee07('0x40')]));_0x5e8d5a[_0xee07('0x3f')]=_0x5e8d5a[_0xee07('0x3f')][_0xee07('0x41')]?_0x5e8d5a[_0xee07('0x3f')]:_0x303d68[_0xee07('0x3a')];if(!_0x1064ec[_0xee07('0x3b')]['hasOwnProperty'](_0xee07('0x42'))){_0x5e8d5a[_0xee07('0x2b')]=qs['limit'](_0x1064ec['query'][_0xee07('0x2b')]);_0x5e8d5a['offset']=qs[_0xee07('0x29')](_0x1064ec[_0xee07('0x3b')][_0xee07('0x29')]);}_0x5e8d5a[_0xee07('0x43')]=qs[_0xee07('0x44')](_0x1064ec['query'][_0xee07('0x44')]);_0x5e8d5a[_0xee07('0x45')]=qs[_0xee07('0x3d')](_[_0xee07('0x46')](_0x1064ec[_0xee07('0x3b')],_0x303d68[_0xee07('0x3d')]),_0x2a5d49);if(_0x1064ec[_0xee07('0x3b')][_0xee07('0x47')]){_0x5e8d5a[_0xee07('0x45')]=_[_0xee07('0x48')](_0x5e8d5a[_0xee07('0x45')],{'$or':_[_0xee07('0x49')](_0x2a5d49,function(_0x134bd5){if(_0x134bd5[_0xee07('0x38')]!=='VIRTUAL'){var _0x49b086={};_0x49b086[_0x134bd5[_0xee07('0x34')]]={'$like':'%'+_0x1064ec[_0xee07('0x3b')][_0xee07('0x47')]+'%'};return _0x49b086;}})});}_0x5e8d5a=_[_0xee07('0x48')]({},_0x5e8d5a,_0x1064ec[_0xee07('0x4a')]);var _0x383903={'where':_0x5e8d5a[_0xee07('0x45')]};return db[_0xee07('0x4b')]['count'](_0x383903)[_0xee07('0x1c')](function(_0xda8f81){_0x2ee986[_0xee07('0x2c')]=_0xda8f81;if(_0x1064ec[_0xee07('0x3b')][_0xee07('0x4c')]){_0x5e8d5a[_0xee07('0x4d')]=[{'all':!![]}];}return db[_0xee07('0x4b')][_0xee07('0x4e')](_0x5e8d5a);})[_0xee07('0x1c')](function(_0xaca1f3){_0x2ee986['rows']=_0xaca1f3;return _0x2ee986;})[_0xee07('0x1c')](respondWithFilteredResult(_0x3e8a73,_0x5e8d5a))['catch'](handleError(_0x3e8a73,null));};exports[_0xee07('0x4f')]=function(_0x5bc3c1,_0x4eeecb){var _0x551fe6={'raw':![],'where':{'id':_0x5bc3c1[_0xee07('0x50')]['id']},'include':[{'model':db['Pause'],'as':_0xee07('0x36')}]},_0x3f835b={};_0x3f835b['model']=_[_0xee07('0x3c')](db[_0xee07('0x4b')][_0xee07('0x37')]);_0x3f835b[_0xee07('0x3b')]=_[_0xee07('0x3c')](_0x5bc3c1[_0xee07('0x3b')]);_0x3f835b[_0xee07('0x3d')]=_[_0xee07('0x3e')](_0x3f835b[_0xee07('0x3a')],_0x3f835b['query']);_0x551fe6[_0xee07('0x3f')]=_['intersection'](_0x3f835b['model'],qs[_0xee07('0x40')](_0x5bc3c1[_0xee07('0x3b')][_0xee07('0x40')]));_0x551fe6[_0xee07('0x3f')]=_0x551fe6[_0xee07('0x3f')][_0xee07('0x41')]?_0x551fe6[_0xee07('0x3f')]:_0x3f835b['model'];if(_0x5bc3c1[_0xee07('0x3b')][_0xee07('0x4c')]){_0x551fe6[_0xee07('0x4d')]=[{'all':!![]}];}_0x551fe6=_[_0xee07('0x48')]({},_0x551fe6,_0x5bc3c1['options']);return db[_0xee07('0x4b')][_0xee07('0x51')](_0x551fe6)[_0xee07('0x1c')](handleEntityNotFound(_0x4eeecb,null))['then'](respondWithResult(_0x4eeecb,null))['catch'](handleError(_0x4eeecb,null));};exports[_0xee07('0x52')]=function(_0x56f490,_0xe5a6b8){return db[_0xee07('0x4b')][_0xee07('0x52')](_0x56f490[_0xee07('0x53')],{})[_0xee07('0x1c')](function(_0x2e0073){var _0x151f69=_0x56f490['user'][_0xee07('0x54')]({'plain':!![]});if(!_0x151f69)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x151f69[_0xee07('0x55')]==='user'){var _0x2131be=_0x2e0073['get']({'plain':!![]});var _0x4e7c1c=_0xee07('0x31');return db[_0xee07('0x56')]['find']({'where':{'name':_0x4e7c1c,'userProfileId':_0x151f69[_0xee07('0x57')]},'raw':!![]})[_0xee07('0x1c')](function(_0x3a7461){if(_0x3a7461&&_0x3a7461[_0xee07('0x58')]===0x0){return db[_0xee07('0x32')][_0xee07('0x52')]({'name':_0x2131be[_0xee07('0x34')],'resourceId':_0x2131be['id'],'type':_0x3a7461[_0xee07('0x34')],'sectionId':_0x3a7461['id']},{})[_0xee07('0x1c')](function(){return _0x2e0073;});}else{return _0x2e0073;}})[_0xee07('0x25')](function(_0x36f27e){logger[_0xee07('0x21')](_0xee07('0x59'),_0x36f27e);throw _0x36f27e;});}return _0x2e0073;})[_0xee07('0x1c')](respondWithResult(_0xe5a6b8,0xc9))[_0xee07('0x25')](handleError(_0xe5a6b8,null));};exports[_0xee07('0x2f')]=function(_0x5d0483,_0x552223){if(_0x5d0483[_0xee07('0x53')]['id']){delete _0x5d0483[_0xee07('0x53')]['id'];}return db['WhatsappAccount'][_0xee07('0x51')]({'where':{'id':_0x5d0483[_0xee07('0x50')]['id']},'include':[{'model':db[_0xee07('0x5a')],'as':_0xee07('0x36')}]})['then'](handleEntityNotFound(_0x552223,null))[_0xee07('0x1c')](saveUpdates(_0x5d0483[_0xee07('0x53')],null))[_0xee07('0x1c')](respondWithResult(_0x552223,null))[_0xee07('0x25')](handleError(_0x552223,null));};exports[_0xee07('0x30')]=function(_0x331db8,_0x2eae0d){return db['WhatsappAccount']['find']({'where':{'id':_0x331db8['params']['id']}})['then'](handleEntityNotFound(_0x2eae0d,null))[_0xee07('0x1c')](removeEntity(_0x2eae0d,null))[_0xee07('0x25')](handleError(_0x2eae0d,null));};exports[_0xee07('0x5b')]=function(_0x1cd923,_0x172890){return db['WhatsappAccount'][_0xee07('0x5b')]()[_0xee07('0x1c')](respondWithResult(_0x172890,null))[_0xee07('0x25')](handleError(_0x172890,null));};exports[_0xee07('0x5c')]=function(_0x493538,_0x25c3d8,_0x4417b6){if(_0x493538[_0xee07('0x53')]['id']){delete _0x493538[_0xee07('0x53')]['id'];}return db[_0xee07('0x4b')][_0xee07('0x51')]({'where':{'id':_0x493538[_0xee07('0x50')]['id']}})[_0xee07('0x1c')](handleEntityNotFound(_0x25c3d8,null))[_0xee07('0x1c')](function(_0x14fcee){if(_0x14fcee){_0x493538['body'][_0xee07('0x5d')]=_0x14fcee['id'];return db[_0xee07('0x5e')][_0xee07('0x52')](_0x493538[_0xee07('0x53')]);}})['then'](respondWithResult(_0x25c3d8,null))[_0xee07('0x25')](handleError(_0x25c3d8,null));};exports[_0xee07('0x5f')]=function(_0x2f9628,_0x4b2ea1,_0x119633){var _0x51cc5b={'raw':![],'where':{}};var _0x4f6a44={};var _0x23cf49={'count':0x0,'rows':[]};return db[_0xee07('0x4b')][_0xee07('0x60')]({'where':{'id':_0x2f9628['params']['id']}})[_0xee07('0x1c')](handleEntityNotFound(_0x4b2ea1,null))[_0xee07('0x1c')](function(_0x3020e1){if(_0x3020e1){_0x4f6a44[_0xee07('0x3a')]=_['keys'](db[_0xee07('0x5e')][_0xee07('0x37')]);_0x4f6a44[_0xee07('0x3b')]=_[_0xee07('0x3c')](_0x2f9628['query']);_0x4f6a44[_0xee07('0x3d')]=_[_0xee07('0x3e')](_0x4f6a44[_0xee07('0x3a')],_0x4f6a44[_0xee07('0x3b')]);_0x51cc5b[_0xee07('0x3f')]=_[_0xee07('0x3e')](_0x4f6a44[_0xee07('0x3a')],qs[_0xee07('0x40')](_0x2f9628[_0xee07('0x3b')]['fields']));_0x51cc5b[_0xee07('0x3f')]=_0x51cc5b[_0xee07('0x3f')]['length']?_0x51cc5b[_0xee07('0x3f')]:_0x4f6a44[_0xee07('0x3a')];if(!_0x2f9628[_0xee07('0x3b')][_0xee07('0x61')](_0xee07('0x42'))){_0x51cc5b[_0xee07('0x2b')]=qs[_0xee07('0x2b')](_0x2f9628[_0xee07('0x3b')][_0xee07('0x2b')]);_0x51cc5b[_0xee07('0x29')]=qs['offset'](_0x2f9628[_0xee07('0x3b')][_0xee07('0x29')]);}_0x51cc5b[_0xee07('0x43')]=qs['sort'](_0x2f9628[_0xee07('0x3b')][_0xee07('0x44')]);_0x51cc5b[_0xee07('0x45')]=qs[_0xee07('0x3d')](_[_0xee07('0x46')](_0x2f9628['query'],_0x4f6a44['filters']));_0x51cc5b[_0xee07('0x45')]['WhatsappAccountId']=_0x3020e1['id'];if(_0x2f9628[_0xee07('0x3b')][_0xee07('0x47')]){_0x51cc5b[_0xee07('0x45')]=_[_0xee07('0x48')](_0x51cc5b[_0xee07('0x45')],{'$or':_[_0xee07('0x49')](_0x51cc5b['attributes'],function(_0x404d1a){var _0x231f38={};_0x231f38[_0x404d1a]={'$like':'%'+_0x2f9628[_0xee07('0x3b')][_0xee07('0x47')]+'%'};return _0x231f38;})});}_0x51cc5b=_[_0xee07('0x48')]({},_0x51cc5b,_0x2f9628[_0xee07('0x4a')]);return db[_0xee07('0x5e')][_0xee07('0x2c')]({'where':_0x51cc5b['where']})['then'](function(_0x289226){_0x23cf49[_0xee07('0x2c')]=_0x289226;if(_0x2f9628[_0xee07('0x3b')][_0xee07('0x4c')]){_0x51cc5b['include']=[{'all':!![]}];}return db[_0xee07('0x5e')][_0xee07('0x4e')](_0x51cc5b);})[_0xee07('0x1c')](function(_0x48cf45){_0x23cf49[_0xee07('0x62')]=_0x48cf45;return _0x23cf49;});}})[_0xee07('0x1c')](respondWithFilteredResult(_0x4b2ea1,_0x51cc5b))['catch'](handleError(_0x4b2ea1,null));};exports['removeDispositions']=function(_0x13438e,_0x58f05c,_0x5b2d84){return db['WhatsappAccount'][_0xee07('0x51')]({'where':{'id':_0x13438e[_0xee07('0x50')]['id']}})[_0xee07('0x1c')](handleEntityNotFound(_0x58f05c,null))[_0xee07('0x1c')](function(_0x4881ea){if(_0x4881ea){return _0x4881ea[_0xee07('0x63')](_0x13438e[_0xee07('0x3b')][_0xee07('0x64')]);}})[_0xee07('0x1c')](respondWithStatusCode(_0x58f05c,null))[_0xee07('0x25')](handleError(_0x58f05c,null));};exports[_0xee07('0x65')]=function(_0x14fd2f,_0x1ce498,_0x4b61cc){if(_0x14fd2f[_0xee07('0x53')]['id']){delete _0x14fd2f[_0xee07('0x53')]['id'];}return db[_0xee07('0x4b')]['find']({'where':{'id':_0x14fd2f['params']['id']}})[_0xee07('0x1c')](handleEntityNotFound(_0x1ce498,null))[_0xee07('0x1c')](function(_0x59e955){if(_0x59e955){_0x14fd2f[_0xee07('0x53')][_0xee07('0x5d')]=_0x59e955['id'];return db[_0xee07('0x66')][_0xee07('0x52')](_0x14fd2f[_0xee07('0x53')]);}})[_0xee07('0x1c')](respondWithResult(_0x1ce498,null))[_0xee07('0x25')](handleError(_0x1ce498,null));};exports[_0xee07('0x67')]=function(_0x2ba589,_0x4da60a,_0x3a01c9){var _0x54e0bc={'raw':![],'where':{}};var _0x419b80={};var _0x52ccea={'count':0x0,'rows':[]};return db[_0xee07('0x4b')][_0xee07('0x60')]({'where':{'id':_0x2ba589['params']['id']}})['then'](handleEntityNotFound(_0x4da60a,null))[_0xee07('0x1c')](function(_0x372fec){if(_0x372fec){_0x419b80[_0xee07('0x3a')]=_['keys'](db['CannedAnswer'][_0xee07('0x37')]);_0x419b80['query']=_['keys'](_0x2ba589['query']);_0x419b80['filters']=_[_0xee07('0x3e')](_0x419b80[_0xee07('0x3a')],_0x419b80[_0xee07('0x3b')]);_0x54e0bc[_0xee07('0x3f')]=_[_0xee07('0x3e')](_0x419b80['model'],qs[_0xee07('0x40')](_0x2ba589[_0xee07('0x3b')][_0xee07('0x40')]));_0x54e0bc['attributes']=_0x54e0bc[_0xee07('0x3f')][_0xee07('0x41')]?_0x54e0bc[_0xee07('0x3f')]:_0x419b80[_0xee07('0x3a')];if(!_0x2ba589['query']['hasOwnProperty'](_0xee07('0x42'))){_0x54e0bc['limit']=qs[_0xee07('0x2b')](_0x2ba589[_0xee07('0x3b')][_0xee07('0x2b')]);_0x54e0bc[_0xee07('0x29')]=qs[_0xee07('0x29')](_0x2ba589[_0xee07('0x3b')][_0xee07('0x29')]);}_0x54e0bc['order']=qs[_0xee07('0x44')](_0x2ba589[_0xee07('0x3b')]['sort']);_0x54e0bc[_0xee07('0x45')]=qs['filters'](_[_0xee07('0x46')](_0x2ba589[_0xee07('0x3b')],_0x419b80[_0xee07('0x3d')]));_0x54e0bc[_0xee07('0x45')][_0xee07('0x5d')]=_0x372fec['id'];if(_0x2ba589['query']['filter']){_0x54e0bc['where']=_['merge'](_0x54e0bc[_0xee07('0x45')],{'$or':_[_0xee07('0x49')](_0x54e0bc[_0xee07('0x3f')],function(_0x2a6a27){var _0x4f1089={};_0x4f1089[_0x2a6a27]={'$like':'%'+_0x2ba589[_0xee07('0x3b')][_0xee07('0x47')]+'%'};return _0x4f1089;})});}_0x54e0bc=_[_0xee07('0x48')]({},_0x54e0bc,_0x2ba589['options']);return db[_0xee07('0x66')]['count']({'where':_0x54e0bc[_0xee07('0x45')]})[_0xee07('0x1c')](function(_0x19b49c){_0x52ccea[_0xee07('0x2c')]=_0x19b49c;if(_0x2ba589['query'][_0xee07('0x4c')]){_0x54e0bc[_0xee07('0x4d')]=[{'all':!![]}];}return db['CannedAnswer'][_0xee07('0x4e')](_0x54e0bc);})['then'](function(_0x193ffd){_0x52ccea[_0xee07('0x62')]=_0x193ffd;return _0x52ccea;});}})['then'](respondWithFilteredResult(_0x4da60a,_0x54e0bc))[_0xee07('0x25')](handleError(_0x4da60a,null));};exports[_0xee07('0x68')]=function(_0x133d80,_0x5a7f3e,_0x21781b){return db[_0xee07('0x4b')][_0xee07('0x51')]({'where':{'id':_0x133d80[_0xee07('0x50')]['id']}})['then'](handleEntityNotFound(_0x5a7f3e,null))[_0xee07('0x1c')](function(_0x37ee1b){if(_0x37ee1b){return _0x37ee1b[_0xee07('0x68')](_0x133d80[_0xee07('0x3b')][_0xee07('0x64')]);}})['then'](respondWithStatusCode(_0x5a7f3e,null))[_0xee07('0x25')](handleError(_0x5a7f3e,null));};exports['addAgents']=function(_0x468584,_0x577e95,_0x4e41d9){return db[_0xee07('0x4b')][_0xee07('0x51')]({'where':{'id':_0x468584['params']['id']}})[_0xee07('0x1c')](handleEntityNotFound(_0x577e95,null))[_0xee07('0x1c')](function(_0x3b124c){if(_0x3b124c){return _0x3b124c[_0xee07('0x69')](_0x468584[_0xee07('0x53')][_0xee07('0x64')],_[_0xee07('0x6a')](_0x468584[_0xee07('0x53')],[_0xee07('0x64'),'id'])||{})['spread'](function(_0x563ac6){for(var _0xb9fb5d=0x0;_0xb9fb5d<_0x468584[_0xee07('0x53')][_0xee07('0x64')][_0xee07('0x41')];_0xb9fb5d+=0x1){socket[_0xee07('0x6b')](_0xee07('0x6c'),{'UserId':Number(_0x468584[_0xee07('0x53')]['ids'][_0xb9fb5d]),'WhatsappAccountId':Number(_0x468584[_0xee07('0x50')]['id'])});}return _0x563ac6;});}})['then'](respondWithResult(_0x577e95,null))[_0xee07('0x25')](handleError(_0x577e95,null));};exports[_0xee07('0x6d')]=function(_0x31abd6,_0x594d46,_0x264613){return db[_0xee07('0x4b')]['find']({'where':{'id':_0x31abd6[_0xee07('0x50')]['id']}})[_0xee07('0x1c')](handleEntityNotFound(_0x594d46,null))[_0xee07('0x1c')](function(_0x381932){if(_0x381932){return _0x381932['removeAgents'](_0x31abd6[_0xee07('0x3b')][_0xee07('0x64')])[_0xee07('0x1c')](function(){if(_[_0xee07('0x6e')](_0x31abd6[_0xee07('0x3b')]['ids'])){for(var _0x5122a1=0x0;_0x5122a1<_0x31abd6[_0xee07('0x3b')][_0xee07('0x64')]['length'];_0x5122a1+=0x1){socket['emit'](_0xee07('0x6f'),{'UserId':Number(_0x31abd6[_0xee07('0x3b')][_0xee07('0x64')][_0x5122a1]),'WhatsappAccountId':Number(_0x31abd6[_0xee07('0x50')]['id'])});}}else{socket[_0xee07('0x6b')]('userWhatsappAccount:remove',{'UserId':Number(_0x31abd6['query'][_0xee07('0x64')]),'WhatsappAccountId':Number(_0x31abd6[_0xee07('0x50')]['id'])});}});}})[_0xee07('0x1c')](respondWithStatusCode(_0x594d46,null))[_0xee07('0x25')](handleError(_0x594d46,null));};exports[_0xee07('0x70')]=function(_0x276102,_0x28ec9d,_0x5045df){var _0x43812d={};var _0x266f52={};var _0xc382ce;var _0x4bc9e8;return db[_0xee07('0x4b')]['findOne']({'where':{'id':_0x276102[_0xee07('0x50')]['id']}})['then'](handleEntityNotFound(_0x28ec9d,null))['then'](function(_0x45da57){if(_0x45da57){_0xc382ce=_0x45da57;_0x266f52[_0xee07('0x3a')]=_[_0xee07('0x3c')](db['User']['rawAttributes']);_0x266f52[_0xee07('0x3b')]=_[_0xee07('0x3c')](_0x276102[_0xee07('0x3b')]);_0x266f52['filters']=_[_0xee07('0x3e')](_0x266f52[_0xee07('0x3a')],_0x266f52[_0xee07('0x3b')]);_0x43812d['attributes']=_[_0xee07('0x3e')](_0x266f52[_0xee07('0x3a')],qs[_0xee07('0x40')](_0x276102[_0xee07('0x3b')][_0xee07('0x40')]));_0x43812d['attributes']=_0x43812d[_0xee07('0x3f')][_0xee07('0x41')]?_0x43812d['attributes']:_0x266f52[_0xee07('0x3a')];_0x43812d[_0xee07('0x43')]=qs[_0xee07('0x44')](_0x276102['query'][_0xee07('0x44')]);_0x43812d['where']=qs[_0xee07('0x3d')](_[_0xee07('0x46')](_0x276102['query'],_0x266f52[_0xee07('0x3d')]));if(_0x276102['query'][_0xee07('0x47')]){_0x43812d[_0xee07('0x45')]=_['merge'](_0x43812d['where'],{'$or':_['map'](_0x43812d[_0xee07('0x3f')],function(_0x16b321){var _0x572e15={};_0x572e15[_0x16b321]={'$like':'%'+_0x276102[_0xee07('0x3b')][_0xee07('0x47')]+'%'};return _0x572e15;})});}_0x43812d=_[_0xee07('0x48')]({},_0x43812d,_0x276102[_0xee07('0x4a')]);return _0xc382ce[_0xee07('0x70')](_0x43812d);}})[_0xee07('0x1c')](function(_0x45e730){if(_0x45e730){_0x4bc9e8=_0x45e730[_0xee07('0x41')];if(!_0x276102[_0xee07('0x3b')][_0xee07('0x61')]('nolimit')){_0x43812d[_0xee07('0x2b')]=qs[_0xee07('0x2b')](_0x276102[_0xee07('0x3b')]['limit']);_0x43812d[_0xee07('0x29')]=qs[_0xee07('0x29')](_0x276102['query']['offset']);}return _0xc382ce[_0xee07('0x70')](_0x43812d);}})[_0xee07('0x1c')](function(_0x396ac1){if(_0x396ac1){return _0x396ac1?{'count':_0x4bc9e8,'rows':_0x396ac1}:null;}})[_0xee07('0x1c')](respondWithResult(_0x28ec9d,null))[_0xee07('0x25')](handleError(_0x28ec9d,null));};exports[_0xee07('0x71')]=function(_0x59a582,_0x11f669){var _0x3a77b5=_0x59a582[_0xee07('0x50')]['id'];var _0x86df86=_0x59a582['body'];var _0x3885d9=0xc8;var _0x549059=null;return db[_0xee07('0x72')]['transaction']({'isolationLevel':db[_0xee07('0x72')][_0xee07('0x73')][_0xee07('0x74')][_0xee07('0x75')]},function(_0xf71272){return db[_0xee07('0x4b')]['findOne']({'where':{'id':_0x3a77b5},'transaction':_0xf71272})['then'](function(_0x1235fc){if(_0x1235fc){return db[_0xee07('0x76')][_0xee07('0x30')]({'where':{'WhatsappAccountId':_0x3a77b5},'transaction':_0xf71272})['then'](function(){var _0x1cca62=_['map'](_0x86df86,function(_0x27d106){_0x27d106[_0xee07('0x5d')]=_0x3a77b5;return _0x27d106;});return db[_0xee07('0x76')][_0xee07('0x77')](_0x1cca62,{'transaction':_0xf71272});});}else{_0x3885d9=0x194;_0x549059=[];}});})['then'](function(){if(_0x3885d9!==0x194){return db[_0xee07('0x76')][_0xee07('0x78')]({'where':{'WhatsappAccountId':_0x3a77b5},'order':_0xee07('0x79')})[_0xee07('0x1c')](function(_0x2560fb){_0x549059=_0x2560fb;});}})[_0xee07('0x25')](function(_0x1b65b4){_0x3885d9=0x1f4;logger[_0xee07('0x21')](_0x1b65b4['stack']);if(_0x1b65b4[_0xee07('0x34')]){delete _0x1b65b4[_0xee07('0x34')];}_0x549059=_0x1b65b4;})['finally'](function(){if(_0x549059===null){_0x11f669[_0xee07('0x7a')](_0x3885d9);}else{if(_0x3885d9===0x1f4){_0x11f669[_0xee07('0x26')](_0x3885d9)[_0xee07('0x7b')](_0x549059);}else{_0x11f669[_0xee07('0x26')](_0x3885d9)[_0xee07('0x28')](_0x549059);}}});};exports[_0xee07('0x7c')]=function(_0x58aa5b,_0x2cb82b,_0x5b7e70){var _0xd6612b={};var _0xb7d9d7={};var _0x344e04;var _0x2abefa;return db['WhatsappAccount']['findOne']({'where':{'id':_0x58aa5b[_0xee07('0x50')]['id']}})['then'](handleEntityNotFound(_0x2cb82b,null))[_0xee07('0x1c')](function(_0x3d8698){if(_0x3d8698){_0x344e04=_0x3d8698;_0xb7d9d7[_0xee07('0x3a')]=_['keys'](db[_0xee07('0x76')][_0xee07('0x37')]);_0xb7d9d7[_0xee07('0x3b')]=_[_0xee07('0x3c')](_0x58aa5b[_0xee07('0x3b')]);_0xb7d9d7[_0xee07('0x3d')]=_[_0xee07('0x3e')](_0xb7d9d7[_0xee07('0x3a')],_0xb7d9d7['query']);_0xd6612b[_0xee07('0x3f')]=_[_0xee07('0x3e')](_0xb7d9d7[_0xee07('0x3a')],qs[_0xee07('0x40')](_0x58aa5b['query'][_0xee07('0x40')]));_0xd6612b[_0xee07('0x3f')]=_0xd6612b[_0xee07('0x3f')]['length']?_0xd6612b[_0xee07('0x3f')]:_0xb7d9d7['model'];_0xd6612b[_0xee07('0x43')]=qs[_0xee07('0x44')](_0x58aa5b[_0xee07('0x3b')][_0xee07('0x44')]);_0xd6612b[_0xee07('0x45')]=qs[_0xee07('0x3d')](_[_0xee07('0x46')](_0x58aa5b[_0xee07('0x3b')],_0xb7d9d7['filters']));if(_0x58aa5b[_0xee07('0x3b')]['filter']){_0xd6612b[_0xee07('0x45')]=_[_0xee07('0x48')](_0xd6612b['where'],{'$or':_[_0xee07('0x49')](_0xd6612b[_0xee07('0x3f')],function(_0x2f2541){var _0x12887e={};_0x12887e[_0x2f2541]={'$like':'%'+_0x58aa5b[_0xee07('0x3b')][_0xee07('0x47')]+'%'};return _0x12887e;})});}_0xd6612b=_[_0xee07('0x48')]({},_0xd6612b,_0x58aa5b[_0xee07('0x4a')]);return _0x344e04[_0xee07('0x7c')](_0xd6612b);}})['then'](function(_0x33cd09){if(_0x33cd09){_0x2abefa=_0x33cd09[_0xee07('0x41')];if(!_0x58aa5b[_0xee07('0x3b')]['hasOwnProperty']('nolimit')){_0xd6612b[_0xee07('0x2b')]=qs[_0xee07('0x2b')](_0x58aa5b[_0xee07('0x3b')][_0xee07('0x2b')]);_0xd6612b[_0xee07('0x29')]=qs[_0xee07('0x29')](_0x58aa5b[_0xee07('0x3b')][_0xee07('0x29')]);}return _0x344e04['getApplications'](_0xd6612b);}})[_0xee07('0x1c')](function(_0x3ef05a){if(_0x3ef05a){return _0x3ef05a?{'count':_0x2abefa,'rows':_0x3ef05a}:null;}})[_0xee07('0x1c')](respondWithResult(_0x2cb82b,null))[_0xee07('0x25')](handleError(_0x2cb82b,null));};exports[_0xee07('0x7d')]=function(_0x125d3c,_0x44a23c,_0x4b5991){var _0x4c986f={'channel':_0xee07('0x7e')};var _0x29e818=[];var _0x43ab39=[];var _0x486da={};return db[_0xee07('0x4b')][_0xee07('0x51')]({'where':{'id':_0x125d3c[_0xee07('0x50')]['id']},'include':[{'model':db[_0xee07('0x76')],'as':'Applications'}]})[_0xee07('0x1c')](handleEntityNotFound(_0x44a23c,null))['then'](function(_0xf10a6a){_0x4c986f[_0xee07('0x7f')]=_0xf10a6a;if(_0x4c986f[_0xee07('0x7f')]&&_0x4c986f[_0xee07('0x7f')]['type']==='sinch'&&_0x125d3c[_0xee07('0x53')][_0xee07('0x80')]){if(_0x125d3c[_0xee07('0x53')][_0xee07('0x80')][_0xee07('0x41')]===0x0)return;if(_0x125d3c[_0xee07('0x53')]['statuses'][0x0][_0xee07('0x81')]!=='read')return;return db[_0xee07('0x82')][_0xee07('0x2f')]({'read':!![],'readAt':_0x125d3c[_0xee07('0x53')][_0xee07('0x80')][0x0][_0xee07('0x83')]},{'where':{'messageId':_0x125d3c[_0xee07('0x53')][_0xee07('0x80')][0x0][_0xee07('0x84')]},'individualHooks':!![]})['then'](function(_0x337fcc){return _0x44a23c[_0xee07('0x26')](0xc8)[_0xee07('0x28')](_0x337fcc);});}_0x4c986f['applications']=_[_0xee07('0x85')](_0xf10a6a[_0xee07('0x86')],[_0xee07('0x79')],[_0xee07('0x87')]);if(_0x4c986f['account']['Applications']){delete _0x4c986f['account'][_0xee07('0x86')];}return db['CmContact'][_0xee07('0x5b')]()['then'](function(_0x1c4491){if(!_0x1c4491){throw new db['Sequelize'][(_0xee07('0x88'))]('no\x20available\x20attributes');}_0x29e818=_[_0xee07('0x89')](_[_0xee07('0x3c')](_0x1c4491),['createdAt',_0xee07('0x8a')]);_0x43ab39=_[_0xee07('0x89')](_[_0xee07('0x3c')](_0x1c4491),[_0xee07('0x8b'),_0xee07('0x8a'),_0xee07('0x8c'),_0xee07('0x8d')]);_0x4c986f[_0xee07('0x53')]={'mapKey':_0xee07('0x8e')};if(_0x4c986f['account']&&_0x4c986f[_0xee07('0x7f')][_0xee07('0x38')]===_0xee07('0x8f')){_0x4c986f['body']['from']=_0x125d3c[_0xee07('0x53')][_0xee07('0x90')][_0xee07('0x91')](_0xee07('0x92'),'');_0x4c986f[_0xee07('0x53')]['body']=_0x125d3c[_0xee07('0x53')]['Body'];_0x4c986f[_0xee07('0x53')][_0xee07('0x93')]=_0x125d3c[_0xee07('0x53')][_0xee07('0x94')];}if(_0x4c986f[_0xee07('0x7f')]&&_0x4c986f['account'][_0xee07('0x38')]===_0xee07('0x95')){_0x4c986f[_0xee07('0x53')]['from']=_0x125d3c[_0xee07('0x53')]['notifications'][0x0]['from'];_0x4c986f[_0xee07('0x53')][_0xee07('0x53')]=_0x125d3c[_0xee07('0x53')]['notifications'][0x0]['message']['body'];_0x4c986f[_0xee07('0x53')]['messageId']=_0x125d3c[_0xee07('0x53')][_0xee07('0x96')][0x0][_0xee07('0x84')];}if(_0x4c986f['body']['id']){delete _0x4c986f[_0xee07('0x53')]['id'];}if(_[_0xee07('0x97')](_0x4c986f['body']['from'])){throw new db['Sequelize']['ValidationError']('from\x20is\x20mandatory');}if(_[_0xee07('0x97')](_0x4c986f['body'][_0xee07('0x53')])||_0x4c986f['body'][_0xee07('0x53')]===''){throw new db['Sequelize'][(_0xee07('0x88'))](_0xee07('0x98'));}if(_[_0xee07('0x97')](_0x4c986f[_0xee07('0x53')][_0xee07('0x99')])){throw new db['Sequelize'][(_0xee07('0x88'))](_0xee07('0x9a')+_0x43ab39);}if(!_['includes'](_0x43ab39,_0x4c986f[_0xee07('0x53')][_0xee07('0x99')])){throw new db[(_0xee07('0x9b'))]['ValidationError'](_0xee07('0x9c')+_0x43ab39);}_0x486da[_0x4c986f[_0xee07('0x53')][_0xee07('0x99')]]=_0x4c986f[_0xee07('0x53')][_0xee07('0x9d')];return db['CmList']['find']({'where':{'id':_0x4c986f[_0xee07('0x7f')][_0xee07('0x8d')]},'include':[{'model':db[_0xee07('0x9e')],'as':_0xee07('0x9f'),'where':_0x486da,'limit':0x1,'order':[['updatedAt','DESC']]}]});})[_0xee07('0x1c')](handleEntityNotFound(_0x44a23c,null))[_0xee07('0x1c')](function(_0x5a1eec){if(_0x5a1eec){_0x4c986f[_0xee07('0xa0')]=_[_0xee07('0x6a')](_0x5a1eec,[_0xee07('0x9f')]);if(_0x5a1eec[_0xee07('0x9f')][_0xee07('0x41')]){return _0x5a1eec[_0xee07('0x9f')][0x0];}var _0x112e39=_[_0xee07('0x15')](_0x4c986f[_0xee07('0x53')],{'firstName':_0x4c986f[_0xee07('0x53')]['from'],'ListId':_0x5a1eec['id']});_0x112e39[_0x4c986f[_0xee07('0x53')][_0xee07('0x99')]]=_0x4c986f[_0xee07('0x53')][_0xee07('0x9d')];return db[_0xee07('0x9e')][_0xee07('0x52')](_0x112e39,{'fields':_0x29e818,'raw':!![]});}})[_0xee07('0x1c')](handleEntityNotFound(_0x44a23c,null))[_0xee07('0x1c')](function(_0x323857){if(_0x323857){_0x4c986f[_0xee07('0xa1')]=_0x323857;var _0x4cfb76={'ContactId':_0x323857['id'],'phone':_0x4c986f[_0xee07('0x53')][_0xee07('0x9d')],'WhatsappAccountId':_0x125d3c[_0xee07('0x50')]['id']};var _0x4bbd12={'ContactId':_0x323857['id'],'WhatsappAccountId':_0x125d3c['params']['id'],'closed':![]};return db[_0xee07('0xa2')][_0xee07('0x51')]({'where':_0x4bbd12})[_0xee07('0x1c')](function(_0x4e57a7){if(_0x4e57a7){return[_0x4e57a7,![]];}return db['WhatsappInteraction'][_0xee07('0x52')](_0x4cfb76)['then'](function(_0x1e8cc0){return[_0x1e8cc0,!![]];});});}})[_0xee07('0xa3')](function(_0x1f5e9a,_0x366d88){_0x4c986f[_0xee07('0xa4')]=_0x1f5e9a[_0xee07('0x54')]({'plain':!![]});_0x4c986f[_0xee07('0xa4')][_0xee07('0xa5')]=![];if(_0x366d88){if(_0x4c986f[_0xee07('0x7f')][_0xee07('0xa6')]){_0x4c986f[_0xee07('0xa7')][_0xee07('0xa8')]({'id':0x0,'priority':_0x4c986f[_0xee07('0xa7')][_0xee07('0x41')]+0x1,'app':'close','appdata':_0xee07('0xa9'),'interval':_0xee07('0xaa')});}_0x4c986f[_0xee07('0xa4')]['created']=!![];}return db[_0xee07('0x82')]['create']({'phone':_0x4c986f[_0xee07('0x53')][_0xee07('0x9d')],'messageId':_0x4c986f[_0xee07('0x53')][_0xee07('0x93')],'body':_0x4c986f['body']['body'],'WhatsappAccountId':_0x125d3c[_0xee07('0x50')]['id'],'WhatsappInteractionId':_0x1f5e9a['id'],'direction':'in','ContactId':_0x1f5e9a[_0xee07('0xab')],'AttachmentId':_0x4c986f[_0xee07('0x53')][_0xee07('0xac')]});})[_0xee07('0x1c')](function(_0xb562e6){_0x4c986f[_0xee07('0x23')]=_0xb562e6;if(_0x4c986f[_0xee07('0xa4')]['UserId']){return db[_0xee07('0xad')]['find']({'attributes':['id','name'],'where':{'id':_0x4c986f[_0xee07('0xa4')][_0xee07('0xae')]}})[_0xee07('0x1c')](function(_0x5c38b1){if(_0x5c38b1){_0x4c986f['applications'][_0xee07('0xaf')]({'id':0x0,'priority':0x0,'app':_0xee07('0xb0'),'appdata':_0x5c38b1[_0xee07('0x34')]+','+(_0x4c986f[_0xee07('0x7f')][_0xee07('0xb1')]||0xa),'interval':_0xee07('0xaa')});}return respondWithRpcPromise(_0xee07('0xb2'),_0xee07('0xb3'),_0x4c986f);});}return respondWithRpcPromise(_0xee07('0xb2'),_0xee07('0xb3'),_0x4c986f);})[_0xee07('0x1c')](function(_0x5e1d19){if(_0x5e1d19){var _0x27133b=0xc8;var _0x3e6c11=_0xee07('0xb4');logger['info'](_0xee07('0xb5'),_0x3e6c11,_0x27133b,_0xee07('0xb6'));logger[_0xee07('0xb7')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x3e6c11,_0x27133b,'entity\x20found',JSON[_0xee07('0x20')](_0x5e1d19));if(_0x4c986f[_0xee07('0x7f')][_0xee07('0x38')]===_0xee07('0x8f')){return _0x44a23c['status'](_0x27133b)[_0xee07('0x2d')](_0xee07('0xb8'),_0xee07('0xb9'))[_0xee07('0x7b')]('\x0a');}else{return _0x44a23c[_0xee07('0x26')](_0x27133b)[_0xee07('0x28')](_0x5e1d19);}}});})[_0xee07('0x25')](handleError(_0x44a23c,null));};exports['send']=function(_0x1ec4f9,_0x34a78d,_0x46c9ee){var _0x2389ce,_0x48e450,_0x157e1b;if(_[_0xee07('0x97')](_0x1ec4f9[_0xee07('0x53')]['body'])||_0x1ec4f9['body'][_0xee07('0x53')]===''){throw new db['Sequelize'][(_0xee07('0x88'))](_0xee07('0x98'));}if(_[_0xee07('0x97')](_0x1ec4f9['body']['to'])){throw new db[(_0xee07('0x9b'))][(_0xee07('0x88'))](_0xee07('0xba'));}_0x2389ce=_0x1ec4f9[_0xee07('0x53')]['to'];return db[_0xee07('0x4b')][_0xee07('0x51')]({'where':{'id':_0x1ec4f9[_0xee07('0x50')]['id']},'include':[{'model':db[_0xee07('0xbb')],'as':_0xee07('0xbc'),'include':[{'model':db[_0xee07('0x9e')],'as':_0xee07('0x9f'),'where':{'mobile':_0x2389ce},'limit':0x1,'order':[[_0xee07('0x8a'),_0xee07('0xbd')]]}]}]})[_0xee07('0x1c')](handleEntityNotFound(_0x34a78d,null))[_0xee07('0x1c')](function(_0x2c9a3f){if(_0x2c9a3f&&_0x2c9a3f[_0xee07('0xbc')]){_0x48e450=_0x2c9a3f[_0xee07('0x54')]({'plain':!![]});if(_0x48e450[_0xee07('0xbc')]&&_0x48e450[_0xee07('0xbc')][_0xee07('0x9f')][_0xee07('0x41')]){return _0x48e450['List'][_0xee07('0x9f')][0x0];}return db['CmContact'][_0xee07('0x52')](_[_0xee07('0x15')](_0x1ec4f9[_0xee07('0x53')],{'firstName':_0x2389ce,'mobile':_0x2389ce,'phone':_0x2389ce,'ListId':_0x48e450['ListId']}));}})[_0xee07('0x1c')](handleEntityNotFound(_0x34a78d,null))[_0xee07('0x1c')](function(_0x4a7896){if(_0x4a7896){_0x157e1b=_0x4a7896;return db[_0xee07('0xa2')][_0xee07('0x51')]({'where':{'ContactId':_0x157e1b['id'],'closed':![],'WhatsappAccountId':_0x48e450['id']}})[_0xee07('0x1c')](function(_0x5251bb){if(_0x5251bb){return[_0x5251bb,![]];}return db['WhatsappInteraction'][_0xee07('0x52')]({'UserId':_0x1ec4f9[_0xee07('0xbe')]['id'],'ContactId':_0x157e1b['id'],'WhatsappAccountId':_0x48e450['id'],'phone':_0x2389ce,'firstMsgDirection':_0xee07('0xbf'),'Messages':[_[_0xee07('0x48')](_0x1ec4f9[_0xee07('0x53')],{'read':![],'body':_0x1ec4f9[_0xee07('0x53')][_0xee07('0x53')],'phone':_0x2389ce,'WhatsappAccountId':_0x48e450['id'],'UserId':_0x1ec4f9[_0xee07('0xbe')]['id'],'ContactId':_0x157e1b['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':'Messages'}]})['then'](function(_0x46dcc9){return[_0x46dcc9,!![]];});});}})[_0xee07('0xa3')](function(_0x5c2b47,_0x18460b){if(_0x18460b){return _0x5c2b47;}return db['WhatsappMessage'][_0xee07('0x52')](_[_0xee07('0x48')](_0x1ec4f9[_0xee07('0x53')],{'read':![],'body':_0x1ec4f9[_0xee07('0x53')]['body'],'phone':_0x2389ce,'WhatsappAccountId':_0x48e450['id'],'WhatsappInteractionId':_0x5c2b47['id'],'UserId':_0x1ec4f9[_0xee07('0xbe')]['id'],'ContactId':_0x157e1b['id']}))[_0xee07('0x1c')](function(_0x141367){_0x5c2b47[_0xee07('0xc0')][_0xee07('0xc1')]=[];_0x5c2b47[_0xee07('0xc0')]['Messages'][_0xee07('0xa8')](_0x141367[_0xee07('0xc0')]);return _0x5c2b47;});})[_0xee07('0x1c')](respondWithResult(_0x34a78d,null))[_0xee07('0x25')](handleError(_0x34a78d,null));}; \ No newline at end of file +var _0x37d0=['fields','length','nolimit','order','sort','filter','where','merge','include','findAll','rows','show','params','Pause','keys','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','hasOwnProperty','pick','options','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addAgents','omit','removeAgents','isArray','userWhatsappAccount:remove','emit','getAgents','User','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','findAndCountAll','priority','finally','getApplications','notify','whatsapp','Applications','account','sinch','statuses','read','WhatsappMessage','timestamp','message_id','orderBy','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','from','From','replace','whatsapp:','Body','messageId','MessageSid','notifications','isNil','Sequelize','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','ListId','CmContact','list','Contacts','contact','WhatsappInteraction','spread','interaction','autoclose','applications','push','unmanaged','*,*,*,*','created','ContactId','AttachmentId','UserId','unshift','waitForTheAssignedAgent','receiveMessage','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','twilio','set','text/xml','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','defaults','out','Messages','dataValues','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','../../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','./whatsappAccount.socket','register','jayson/promise','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','json','undefined','limit','count','offset','status','Content-Range','apply','reject','update','destroy','get','WhatsappAccounts','end','name','send','index','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','type','model','query','filters','intersection','attributes'];(function(_0x142bce,_0x4ab376){var _0x2be233=function(_0x203742){while(--_0x203742){_0x142bce['push'](_0x142bce['shift']());}};_0x2be233(++_0x4ab376);}(_0x37d0,0x7c));var _0x037d=function(_0x4f8a06,_0x444ab8){_0x4f8a06=_0x4f8a06-0x0;var _0x12d125=_0x37d0[_0x4f8a06];return _0x12d125;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x037d('0x0'));var zipdir=require(_0x037d('0x1'));var jsonpatch=require(_0x037d('0x2'));var rp=require('request-promise');var moment=require(_0x037d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x037d('0x4'));var util=require(_0x037d('0x5'));var path=require(_0x037d('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x037d('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x037d('0x8'));var squel=require(_0x037d('0x9'));var crypto=require(_0x037d('0xa'));var jsforce=require(_0x037d('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x037d('0xc'));var querystring=require(_0x037d('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x037d('0xe'));var qs=require(_0x037d('0xf'));var as=require(_0x037d('0x10'));var hardwareService=require(_0x037d('0x11'));var logger=require(_0x037d('0x12'))(_0x037d('0x13'));var utils=require(_0x037d('0x14'));var config=require(_0x037d('0x15'));var licenseUtil=require(_0x037d('0x16'));var db=require(_0x037d('0x17'))['db'];config[_0x037d('0x18')]=_['defaults'](config[_0x037d('0x18')],{'host':_0x037d('0x19'),'port':0x18eb});var socket=require(_0x037d('0x1a'))(new Redis(config['redis']));require(_0x037d('0x1b'))[_0x037d('0x1c')](socket);var jayson=require(_0x037d('0x1d'));var client=jayson['client'][_0x037d('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x298e45,_0x45d162,_0x1ee768,_0x555fe1){return new BPromise(function(_0x5e8006,_0x372f04){var _0x5ba2b4=_0x555fe1||client;return _0x5ba2b4[_0x037d('0x1f')](_0x298e45,_0x1ee768)[_0x037d('0x20')](function(_0x35026c){logger[_0x037d('0x21')](_0x037d('0x22'),_0x45d162,_0x037d('0x23'));logger['debug'](_0x037d('0x24'),_0x45d162,'request\x20sent',JSON[_0x037d('0x25')](_0x35026c));if(_0x35026c[_0x037d('0x26')]){if(_0x35026c['error'][_0x037d('0x27')]===0x1f4){logger['error'](_0x037d('0x22'),_0x45d162,_0x35026c[_0x037d('0x26')][_0x037d('0x28')]);return _0x372f04(_0x35026c[_0x037d('0x26')][_0x037d('0x28')]);}logger[_0x037d('0x26')]('WhatsappAccount,\x20%s,\x20%s',_0x45d162,_0x35026c[_0x037d('0x26')][_0x037d('0x28')]);return _0x5e8006(_0x35026c[_0x037d('0x26')][_0x037d('0x28')]);}else{logger['info'](_0x037d('0x22'),_0x45d162,_0x037d('0x23'));_0x5e8006(_0x35026c[_0x037d('0x29')][_0x037d('0x28')]);}})[_0x037d('0x2a')](function(_0x1952cb){logger[_0x037d('0x26')]('WhatsappAccount,\x20%s,\x20%s',_0x45d162,_0x1952cb);_0x372f04(_0x1952cb);});});}function respondWithStatusCode(_0x1fdcc5,_0x2d0b99){_0x2d0b99=_0x2d0b99||0xcc;return function(_0xa01b7d){if(_0xa01b7d){return _0x1fdcc5[_0x037d('0x2b')](_0x2d0b99);}return _0x1fdcc5['status'](_0x2d0b99)['end']();};}function respondWithResult(_0x844c5b,_0x48653d){_0x48653d=_0x48653d||0xc8;return function(_0x35a2fb){if(_0x35a2fb){return _0x844c5b['status'](_0x48653d)[_0x037d('0x2c')](_0x35a2fb);}};}function respondWithFilteredResult(_0x589437,_0x19ab96){return function(_0x1d4fe3){if(_0x1d4fe3){var _0x22f176=typeof _0x19ab96['offset']===_0x037d('0x2d')&&typeof _0x19ab96[_0x037d('0x2e')]==='undefined';var _0x4935ab=_0x1d4fe3[_0x037d('0x2f')];var _0x4a1752=_0x22f176?0x0:_0x19ab96[_0x037d('0x30')];var _0x2ee7f2=_0x22f176?_0x1d4fe3[_0x037d('0x2f')]:_0x19ab96['offset']+_0x19ab96[_0x037d('0x2e')];var _0x39b639;if(_0x2ee7f2>=_0x4935ab){_0x2ee7f2=_0x4935ab;_0x39b639=0xc8;}else{_0x39b639=0xce;}_0x589437[_0x037d('0x31')](_0x39b639);return _0x589437['set'](_0x037d('0x32'),_0x4a1752+'-'+_0x2ee7f2+'/'+_0x4935ab)['json'](_0x1d4fe3);}return null;};}function patchUpdates(_0x25e0bc){return function(_0x4c3501){try{jsonpatch[_0x037d('0x33')](_0x4c3501,_0x25e0bc,!![]);}catch(_0x6cccef){return BPromise[_0x037d('0x34')](_0x6cccef);}return _0x4c3501['save']();};}function saveUpdates(_0x3b1e70,_0x39432d){return function(_0x4bb1ab){if(_0x4bb1ab){return _0x4bb1ab[_0x037d('0x35')](_0x3b1e70)[_0x037d('0x20')](function(_0x3616d1){return _0x3616d1;});}return null;};}function removeEntity(_0x2144c4,_0x1dfee9){return function(_0x512eae){if(_0x512eae){return _0x512eae[_0x037d('0x36')]()[_0x037d('0x20')](function(){var _0x242d45=_0x512eae[_0x037d('0x37')]({'plain':!![]});var _0x41f5f0=_0x037d('0x38');return db['UserProfileResource'][_0x037d('0x36')]({'where':{'type':_0x41f5f0,'resourceId':_0x242d45['id']}})[_0x037d('0x20')](function(){return _0x512eae;});})[_0x037d('0x20')](function(){_0x2144c4[_0x037d('0x31')](0xcc)[_0x037d('0x39')]();});}};}function handleEntityNotFound(_0x32dde0,_0x5f02c5){return function(_0xbb0af8){if(!_0xbb0af8){_0x32dde0[_0x037d('0x2b')](0x194);}return _0xbb0af8;};}function handleError(_0xa00b02,_0x68608d){_0x68608d=_0x68608d||0x1f4;return function(_0x10e973){logger[_0x037d('0x26')](_0x10e973['stack']);if(_0x10e973['name']){delete _0x10e973[_0x037d('0x3a')];}_0xa00b02[_0x037d('0x31')](_0x68608d)[_0x037d('0x3b')](_0x10e973);};}exports[_0x037d('0x3c')]=function(_0x1124dd,_0x1b4198){var _0x2a044f={'include':[{'model':db['Pause'],'as':_0x037d('0x3d')}]},_0x50273a={},_0x528f61={'count':0x0,'rows':[]};var _0x450f45=_[_0x037d('0x3e')](db[_0x037d('0x3f')][_0x037d('0x40')],function(_0x218b6f){return{'name':_0x218b6f[_0x037d('0x41')],'type':_0x218b6f[_0x037d('0x42')]['key']};});_0x50273a[_0x037d('0x43')]=_['map'](_0x450f45,_0x037d('0x3a'));_0x50273a[_0x037d('0x44')]=_['keys'](_0x1124dd['query']);_0x50273a[_0x037d('0x45')]=_[_0x037d('0x46')](_0x50273a[_0x037d('0x43')],_0x50273a[_0x037d('0x44')]);_0x2a044f[_0x037d('0x47')]=_[_0x037d('0x46')](_0x50273a['model'],qs['fields'](_0x1124dd[_0x037d('0x44')][_0x037d('0x48')]));_0x2a044f['attributes']=_0x2a044f[_0x037d('0x47')][_0x037d('0x49')]?_0x2a044f[_0x037d('0x47')]:_0x50273a[_0x037d('0x43')];if(!_0x1124dd['query']['hasOwnProperty'](_0x037d('0x4a'))){_0x2a044f[_0x037d('0x2e')]=qs['limit'](_0x1124dd[_0x037d('0x44')][_0x037d('0x2e')]);_0x2a044f[_0x037d('0x30')]=qs[_0x037d('0x30')](_0x1124dd[_0x037d('0x44')][_0x037d('0x30')]);}_0x2a044f[_0x037d('0x4b')]=qs[_0x037d('0x4c')](_0x1124dd[_0x037d('0x44')]['sort']);_0x2a044f['where']=qs[_0x037d('0x45')](_['pick'](_0x1124dd['query'],_0x50273a[_0x037d('0x45')]),_0x450f45);if(_0x1124dd[_0x037d('0x44')][_0x037d('0x4d')]){_0x2a044f[_0x037d('0x4e')]=_[_0x037d('0x4f')](_0x2a044f[_0x037d('0x4e')],{'$or':_[_0x037d('0x3e')](_0x450f45,function(_0x17e8da){if(_0x17e8da[_0x037d('0x42')]!=='VIRTUAL'){var _0x3fe0ed={};_0x3fe0ed[_0x17e8da[_0x037d('0x3a')]]={'$like':'%'+_0x1124dd[_0x037d('0x44')]['filter']+'%'};return _0x3fe0ed;}})});}_0x2a044f=_[_0x037d('0x4f')]({},_0x2a044f,_0x1124dd['options']);var _0x54a045={'where':_0x2a044f[_0x037d('0x4e')]};return db[_0x037d('0x3f')][_0x037d('0x2f')](_0x54a045)[_0x037d('0x20')](function(_0x2d26a9){_0x528f61['count']=_0x2d26a9;if(_0x1124dd[_0x037d('0x44')]['includeAll']){_0x2a044f[_0x037d('0x50')]=[{'all':!![]}];}return db[_0x037d('0x3f')][_0x037d('0x51')](_0x2a044f);})[_0x037d('0x20')](function(_0x171315){_0x528f61[_0x037d('0x52')]=_0x171315;return _0x528f61;})[_0x037d('0x20')](respondWithFilteredResult(_0x1b4198,_0x2a044f))[_0x037d('0x2a')](handleError(_0x1b4198,null));};exports[_0x037d('0x53')]=function(_0x20ea2d,_0x3c1bb6){var _0x5ca22e={'raw':![],'where':{'id':_0x20ea2d[_0x037d('0x54')]['id']},'include':[{'model':db[_0x037d('0x55')],'as':_0x037d('0x3d')}]},_0x5141bd={};_0x5141bd[_0x037d('0x43')]=_[_0x037d('0x56')](db[_0x037d('0x3f')]['rawAttributes']);_0x5141bd[_0x037d('0x44')]=_[_0x037d('0x56')](_0x20ea2d['query']);_0x5141bd[_0x037d('0x45')]=_[_0x037d('0x46')](_0x5141bd[_0x037d('0x43')],_0x5141bd[_0x037d('0x44')]);_0x5ca22e[_0x037d('0x47')]=_[_0x037d('0x46')](_0x5141bd[_0x037d('0x43')],qs['fields'](_0x20ea2d[_0x037d('0x44')][_0x037d('0x48')]));_0x5ca22e[_0x037d('0x47')]=_0x5ca22e[_0x037d('0x47')][_0x037d('0x49')]?_0x5ca22e[_0x037d('0x47')]:_0x5141bd[_0x037d('0x43')];if(_0x20ea2d[_0x037d('0x44')][_0x037d('0x57')]){_0x5ca22e[_0x037d('0x50')]=[{'all':!![]}];}_0x5ca22e=_[_0x037d('0x4f')]({},_0x5ca22e,_0x20ea2d['options']);return db[_0x037d('0x3f')][_0x037d('0x58')](_0x5ca22e)[_0x037d('0x20')](handleEntityNotFound(_0x3c1bb6,null))['then'](respondWithResult(_0x3c1bb6,null))[_0x037d('0x2a')](handleError(_0x3c1bb6,null));};exports[_0x037d('0x59')]=function(_0x1e8e11,_0x2a284a){return db[_0x037d('0x3f')][_0x037d('0x59')](_0x1e8e11[_0x037d('0x5a')],{})[_0x037d('0x20')](function(_0x4e3cc3){var _0x315bc4=_0x1e8e11[_0x037d('0x5b')][_0x037d('0x37')]({'plain':!![]});if(!_0x315bc4)throw new Error(_0x037d('0x5c'));if(_0x315bc4['role']===_0x037d('0x5b')){var _0x400122=_0x4e3cc3[_0x037d('0x37')]({'plain':!![]});var _0x5d128a=_0x037d('0x38');return db[_0x037d('0x5d')][_0x037d('0x58')]({'where':{'name':_0x5d128a,'userProfileId':_0x315bc4[_0x037d('0x5e')]},'raw':!![]})['then'](function(_0x4284d1){if(_0x4284d1&&_0x4284d1['autoAssociation']===0x0){return db[_0x037d('0x5f')][_0x037d('0x59')]({'name':_0x400122[_0x037d('0x3a')],'resourceId':_0x400122['id'],'type':_0x4284d1['name'],'sectionId':_0x4284d1['id']},{})[_0x037d('0x20')](function(){return _0x4e3cc3;});}else{return _0x4e3cc3;}})['catch'](function(_0x546fbe){logger[_0x037d('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x546fbe);throw _0x546fbe;});}return _0x4e3cc3;})['then'](respondWithResult(_0x2a284a,0xc9))['catch'](handleError(_0x2a284a,null));};exports[_0x037d('0x35')]=function(_0x53ab65,_0x204b27){if(_0x53ab65['body']['id']){delete _0x53ab65[_0x037d('0x5a')]['id'];}return db[_0x037d('0x3f')][_0x037d('0x58')]({'where':{'id':_0x53ab65[_0x037d('0x54')]['id']},'include':[{'model':db[_0x037d('0x55')],'as':_0x037d('0x3d')}]})[_0x037d('0x20')](handleEntityNotFound(_0x204b27,null))[_0x037d('0x20')](saveUpdates(_0x53ab65['body'],null))[_0x037d('0x20')](respondWithResult(_0x204b27,null))[_0x037d('0x2a')](handleError(_0x204b27,null));};exports[_0x037d('0x36')]=function(_0x2d8483,_0x40131a){return db['WhatsappAccount'][_0x037d('0x58')]({'where':{'id':_0x2d8483[_0x037d('0x54')]['id']}})[_0x037d('0x20')](handleEntityNotFound(_0x40131a,null))[_0x037d('0x20')](removeEntity(_0x40131a,null))[_0x037d('0x2a')](handleError(_0x40131a,null));};exports[_0x037d('0x60')]=function(_0x152b44,_0x31a750){return db[_0x037d('0x3f')]['describe']()['then'](respondWithResult(_0x31a750,null))['catch'](handleError(_0x31a750,null));};exports[_0x037d('0x61')]=function(_0x2a0db0,_0x4c18a3,_0x37125e){if(_0x2a0db0[_0x037d('0x5a')]['id']){delete _0x2a0db0[_0x037d('0x5a')]['id'];}return db['WhatsappAccount'][_0x037d('0x58')]({'where':{'id':_0x2a0db0['params']['id']}})['then'](handleEntityNotFound(_0x4c18a3,null))[_0x037d('0x20')](function(_0x1a6fe5){if(_0x1a6fe5){_0x2a0db0[_0x037d('0x5a')][_0x037d('0x62')]=_0x1a6fe5['id'];return db[_0x037d('0x63')][_0x037d('0x59')](_0x2a0db0[_0x037d('0x5a')]);}})[_0x037d('0x20')](respondWithResult(_0x4c18a3,null))[_0x037d('0x2a')](handleError(_0x4c18a3,null));};exports[_0x037d('0x64')]=function(_0x3fb1ee,_0x55d719,_0x390047){var _0x2ab5c9={'raw':![],'where':{}};var _0x1d0f1a={};var _0x1e507a={'count':0x0,'rows':[]};return db[_0x037d('0x3f')][_0x037d('0x65')]({'where':{'id':_0x3fb1ee['params']['id']}})[_0x037d('0x20')](handleEntityNotFound(_0x55d719,null))[_0x037d('0x20')](function(_0x3ef1e2){if(_0x3ef1e2){_0x1d0f1a[_0x037d('0x43')]=_[_0x037d('0x56')](db['Disposition']['rawAttributes']);_0x1d0f1a[_0x037d('0x44')]=_[_0x037d('0x56')](_0x3fb1ee[_0x037d('0x44')]);_0x1d0f1a[_0x037d('0x45')]=_[_0x037d('0x46')](_0x1d0f1a[_0x037d('0x43')],_0x1d0f1a['query']);_0x2ab5c9['attributes']=_[_0x037d('0x46')](_0x1d0f1a[_0x037d('0x43')],qs[_0x037d('0x48')](_0x3fb1ee[_0x037d('0x44')][_0x037d('0x48')]));_0x2ab5c9['attributes']=_0x2ab5c9[_0x037d('0x47')][_0x037d('0x49')]?_0x2ab5c9['attributes']:_0x1d0f1a['model'];if(!_0x3fb1ee[_0x037d('0x44')][_0x037d('0x66')](_0x037d('0x4a'))){_0x2ab5c9[_0x037d('0x2e')]=qs['limit'](_0x3fb1ee['query'][_0x037d('0x2e')]);_0x2ab5c9[_0x037d('0x30')]=qs[_0x037d('0x30')](_0x3fb1ee[_0x037d('0x44')][_0x037d('0x30')]);}_0x2ab5c9[_0x037d('0x4b')]=qs['sort'](_0x3fb1ee[_0x037d('0x44')][_0x037d('0x4c')]);_0x2ab5c9[_0x037d('0x4e')]=qs[_0x037d('0x45')](_[_0x037d('0x67')](_0x3fb1ee[_0x037d('0x44')],_0x1d0f1a['filters']));_0x2ab5c9[_0x037d('0x4e')][_0x037d('0x62')]=_0x3ef1e2['id'];if(_0x3fb1ee[_0x037d('0x44')][_0x037d('0x4d')]){_0x2ab5c9[_0x037d('0x4e')]=_[_0x037d('0x4f')](_0x2ab5c9['where'],{'$or':_[_0x037d('0x3e')](_0x2ab5c9[_0x037d('0x47')],function(_0x42d1b3){var _0x4333f8={};_0x4333f8[_0x42d1b3]={'$like':'%'+_0x3fb1ee[_0x037d('0x44')][_0x037d('0x4d')]+'%'};return _0x4333f8;})});}_0x2ab5c9=_[_0x037d('0x4f')]({},_0x2ab5c9,_0x3fb1ee[_0x037d('0x68')]);return db[_0x037d('0x63')][_0x037d('0x2f')]({'where':_0x2ab5c9[_0x037d('0x4e')]})[_0x037d('0x20')](function(_0x35cb7e){_0x1e507a[_0x037d('0x2f')]=_0x35cb7e;if(_0x3fb1ee['query']['includeAll']){_0x2ab5c9[_0x037d('0x50')]=[{'all':!![]}];}return db['Disposition'][_0x037d('0x51')](_0x2ab5c9);})[_0x037d('0x20')](function(_0x8a7b81){_0x1e507a['rows']=_0x8a7b81;return _0x1e507a;});}})[_0x037d('0x20')](respondWithFilteredResult(_0x55d719,_0x2ab5c9))['catch'](handleError(_0x55d719,null));};exports['removeDispositions']=function(_0x5a2a2b,_0x282dfa,_0x30fea9){return db[_0x037d('0x3f')]['find']({'where':{'id':_0x5a2a2b[_0x037d('0x54')]['id']}})[_0x037d('0x20')](handleEntityNotFound(_0x282dfa,null))[_0x037d('0x20')](function(_0x448068){if(_0x448068){return _0x448068[_0x037d('0x69')](_0x5a2a2b[_0x037d('0x44')][_0x037d('0x6a')]);}})[_0x037d('0x20')](respondWithStatusCode(_0x282dfa,null))[_0x037d('0x2a')](handleError(_0x282dfa,null));};exports[_0x037d('0x6b')]=function(_0x580c4f,_0x210972,_0x4a8770){if(_0x580c4f[_0x037d('0x5a')]['id']){delete _0x580c4f[_0x037d('0x5a')]['id'];}return db[_0x037d('0x3f')][_0x037d('0x58')]({'where':{'id':_0x580c4f[_0x037d('0x54')]['id']}})[_0x037d('0x20')](handleEntityNotFound(_0x210972,null))[_0x037d('0x20')](function(_0x3bdb4c){if(_0x3bdb4c){_0x580c4f[_0x037d('0x5a')][_0x037d('0x62')]=_0x3bdb4c['id'];return db[_0x037d('0x6c')]['create'](_0x580c4f[_0x037d('0x5a')]);}})[_0x037d('0x20')](respondWithResult(_0x210972,null))[_0x037d('0x2a')](handleError(_0x210972,null));};exports[_0x037d('0x6d')]=function(_0x5a5dc6,_0x38c051,_0x5ce4fb){var _0x1c8538={'raw':![],'where':{}};var _0x1680c2={};var _0x22919c={'count':0x0,'rows':[]};return db[_0x037d('0x3f')][_0x037d('0x65')]({'where':{'id':_0x5a5dc6[_0x037d('0x54')]['id']}})[_0x037d('0x20')](handleEntityNotFound(_0x38c051,null))[_0x037d('0x20')](function(_0x558741){if(_0x558741){_0x1680c2[_0x037d('0x43')]=_[_0x037d('0x56')](db[_0x037d('0x6c')]['rawAttributes']);_0x1680c2[_0x037d('0x44')]=_['keys'](_0x5a5dc6['query']);_0x1680c2[_0x037d('0x45')]=_[_0x037d('0x46')](_0x1680c2[_0x037d('0x43')],_0x1680c2[_0x037d('0x44')]);_0x1c8538['attributes']=_[_0x037d('0x46')](_0x1680c2['model'],qs['fields'](_0x5a5dc6[_0x037d('0x44')][_0x037d('0x48')]));_0x1c8538[_0x037d('0x47')]=_0x1c8538[_0x037d('0x47')]['length']?_0x1c8538[_0x037d('0x47')]:_0x1680c2[_0x037d('0x43')];if(!_0x5a5dc6[_0x037d('0x44')]['hasOwnProperty'](_0x037d('0x4a'))){_0x1c8538['limit']=qs['limit'](_0x5a5dc6[_0x037d('0x44')][_0x037d('0x2e')]);_0x1c8538['offset']=qs['offset'](_0x5a5dc6[_0x037d('0x44')][_0x037d('0x30')]);}_0x1c8538[_0x037d('0x4b')]=qs[_0x037d('0x4c')](_0x5a5dc6[_0x037d('0x44')][_0x037d('0x4c')]);_0x1c8538['where']=qs[_0x037d('0x45')](_[_0x037d('0x67')](_0x5a5dc6[_0x037d('0x44')],_0x1680c2[_0x037d('0x45')]));_0x1c8538['where'][_0x037d('0x62')]=_0x558741['id'];if(_0x5a5dc6[_0x037d('0x44')][_0x037d('0x4d')]){_0x1c8538[_0x037d('0x4e')]=_[_0x037d('0x4f')](_0x1c8538[_0x037d('0x4e')],{'$or':_[_0x037d('0x3e')](_0x1c8538[_0x037d('0x47')],function(_0x509706){var _0x430b5c={};_0x430b5c[_0x509706]={'$like':'%'+_0x5a5dc6[_0x037d('0x44')][_0x037d('0x4d')]+'%'};return _0x430b5c;})});}_0x1c8538=_[_0x037d('0x4f')]({},_0x1c8538,_0x5a5dc6[_0x037d('0x68')]);return db['CannedAnswer'][_0x037d('0x2f')]({'where':_0x1c8538[_0x037d('0x4e')]})['then'](function(_0x42bc65){_0x22919c[_0x037d('0x2f')]=_0x42bc65;if(_0x5a5dc6[_0x037d('0x44')][_0x037d('0x57')]){_0x1c8538[_0x037d('0x50')]=[{'all':!![]}];}return db[_0x037d('0x6c')][_0x037d('0x51')](_0x1c8538);})[_0x037d('0x20')](function(_0x264bb7){_0x22919c[_0x037d('0x52')]=_0x264bb7;return _0x22919c;});}})[_0x037d('0x20')](respondWithFilteredResult(_0x38c051,_0x1c8538))[_0x037d('0x2a')](handleError(_0x38c051,null));};exports['removeAnswers']=function(_0x2816de,_0x514c93,_0x11746d){return db['WhatsappAccount']['find']({'where':{'id':_0x2816de[_0x037d('0x54')]['id']}})[_0x037d('0x20')](handleEntityNotFound(_0x514c93,null))[_0x037d('0x20')](function(_0x2f57be){if(_0x2f57be){return _0x2f57be[_0x037d('0x6e')](_0x2816de[_0x037d('0x44')][_0x037d('0x6a')]);}})[_0x037d('0x20')](respondWithStatusCode(_0x514c93,null))[_0x037d('0x2a')](handleError(_0x514c93,null));};exports['addAgents']=function(_0x1209e0,_0x45eea7,_0x38f29f){return db[_0x037d('0x3f')]['find']({'where':{'id':_0x1209e0[_0x037d('0x54')]['id']}})['then'](handleEntityNotFound(_0x45eea7,null))[_0x037d('0x20')](function(_0x1bfe1b){if(_0x1bfe1b){return _0x1bfe1b[_0x037d('0x6f')](_0x1209e0[_0x037d('0x5a')]['ids'],_[_0x037d('0x70')](_0x1209e0['body'],[_0x037d('0x6a'),'id'])||{})['spread'](function(_0x240acc){for(var _0x4a244f=0x0;_0x4a244f<_0x1209e0[_0x037d('0x5a')][_0x037d('0x6a')][_0x037d('0x49')];_0x4a244f+=0x1){socket['emit']('userWhatsappAccount:save',{'UserId':Number(_0x1209e0[_0x037d('0x5a')][_0x037d('0x6a')][_0x4a244f]),'WhatsappAccountId':Number(_0x1209e0[_0x037d('0x54')]['id'])});}return _0x240acc;});}})[_0x037d('0x20')](respondWithResult(_0x45eea7,null))[_0x037d('0x2a')](handleError(_0x45eea7,null));};exports[_0x037d('0x71')]=function(_0x41662c,_0x37efaf,_0x35a8c2){return db['WhatsappAccount']['find']({'where':{'id':_0x41662c['params']['id']}})[_0x037d('0x20')](handleEntityNotFound(_0x37efaf,null))[_0x037d('0x20')](function(_0x52ccb1){if(_0x52ccb1){return _0x52ccb1[_0x037d('0x71')](_0x41662c[_0x037d('0x44')][_0x037d('0x6a')])[_0x037d('0x20')](function(){if(_[_0x037d('0x72')](_0x41662c['query']['ids'])){for(var _0x53554e=0x0;_0x53554e<_0x41662c[_0x037d('0x44')][_0x037d('0x6a')][_0x037d('0x49')];_0x53554e+=0x1){socket['emit'](_0x037d('0x73'),{'UserId':Number(_0x41662c[_0x037d('0x44')]['ids'][_0x53554e]),'WhatsappAccountId':Number(_0x41662c['params']['id'])});}}else{socket[_0x037d('0x74')](_0x037d('0x73'),{'UserId':Number(_0x41662c['query'][_0x037d('0x6a')]),'WhatsappAccountId':Number(_0x41662c['params']['id'])});}});}})['then'](respondWithStatusCode(_0x37efaf,null))[_0x037d('0x2a')](handleError(_0x37efaf,null));};exports[_0x037d('0x75')]=function(_0x89d00f,_0x5f01e5,_0x26e4a0){var _0x47a1d3={};var _0x50b273={};var _0x1a85e2;var _0x3bd861;return db[_0x037d('0x3f')][_0x037d('0x65')]({'where':{'id':_0x89d00f[_0x037d('0x54')]['id']}})['then'](handleEntityNotFound(_0x5f01e5,null))[_0x037d('0x20')](function(_0x5c253d){if(_0x5c253d){_0x1a85e2=_0x5c253d;_0x50b273[_0x037d('0x43')]=_[_0x037d('0x56')](db[_0x037d('0x76')][_0x037d('0x40')]);_0x50b273[_0x037d('0x44')]=_['keys'](_0x89d00f[_0x037d('0x44')]);_0x50b273[_0x037d('0x45')]=_[_0x037d('0x46')](_0x50b273[_0x037d('0x43')],_0x50b273[_0x037d('0x44')]);_0x47a1d3[_0x037d('0x47')]=_[_0x037d('0x46')](_0x50b273[_0x037d('0x43')],qs[_0x037d('0x48')](_0x89d00f[_0x037d('0x44')][_0x037d('0x48')]));_0x47a1d3[_0x037d('0x47')]=_0x47a1d3['attributes'][_0x037d('0x49')]?_0x47a1d3[_0x037d('0x47')]:_0x50b273['model'];_0x47a1d3[_0x037d('0x4b')]=qs[_0x037d('0x4c')](_0x89d00f[_0x037d('0x44')][_0x037d('0x4c')]);_0x47a1d3[_0x037d('0x4e')]=qs[_0x037d('0x45')](_[_0x037d('0x67')](_0x89d00f[_0x037d('0x44')],_0x50b273[_0x037d('0x45')]));if(_0x89d00f[_0x037d('0x44')][_0x037d('0x4d')]){_0x47a1d3[_0x037d('0x4e')]=_['merge'](_0x47a1d3[_0x037d('0x4e')],{'$or':_[_0x037d('0x3e')](_0x47a1d3['attributes'],function(_0x29658){var _0x24189c={};_0x24189c[_0x29658]={'$like':'%'+_0x89d00f[_0x037d('0x44')]['filter']+'%'};return _0x24189c;})});}_0x47a1d3=_[_0x037d('0x4f')]({},_0x47a1d3,_0x89d00f[_0x037d('0x68')]);return _0x1a85e2['getAgents'](_0x47a1d3);}})[_0x037d('0x20')](function(_0x28f11f){if(_0x28f11f){_0x3bd861=_0x28f11f['length'];if(!_0x89d00f['query'][_0x037d('0x66')](_0x037d('0x4a'))){_0x47a1d3[_0x037d('0x2e')]=qs[_0x037d('0x2e')](_0x89d00f[_0x037d('0x44')]['limit']);_0x47a1d3[_0x037d('0x30')]=qs['offset'](_0x89d00f[_0x037d('0x44')]['offset']);}return _0x1a85e2[_0x037d('0x75')](_0x47a1d3);}})[_0x037d('0x20')](function(_0x21fc29){if(_0x21fc29){return _0x21fc29?{'count':_0x3bd861,'rows':_0x21fc29}:null;}})[_0x037d('0x20')](respondWithResult(_0x5f01e5,null))[_0x037d('0x2a')](handleError(_0x5f01e5,null));};exports[_0x037d('0x77')]=function(_0x12b08e,_0x4a3763){var _0x23f218=_0x12b08e['params']['id'];var _0x508617=_0x12b08e[_0x037d('0x5a')];var _0x14cfa8=0xc8;var _0xcf8c83=null;return db[_0x037d('0x78')][_0x037d('0x79')]({'isolationLevel':db[_0x037d('0x78')][_0x037d('0x7a')][_0x037d('0x7b')][_0x037d('0x7c')]},function(_0x3ddcf2){return db[_0x037d('0x3f')][_0x037d('0x65')]({'where':{'id':_0x23f218},'transaction':_0x3ddcf2})[_0x037d('0x20')](function(_0x19f542){if(_0x19f542){return db[_0x037d('0x7d')]['destroy']({'where':{'WhatsappAccountId':_0x23f218},'transaction':_0x3ddcf2})[_0x037d('0x20')](function(){var _0x4cd6ac=_[_0x037d('0x3e')](_0x508617,function(_0x129cdc){_0x129cdc[_0x037d('0x62')]=_0x23f218;return _0x129cdc;});return db[_0x037d('0x7d')]['bulkCreate'](_0x4cd6ac,{'transaction':_0x3ddcf2});});}else{_0x14cfa8=0x194;_0xcf8c83=[];}});})[_0x037d('0x20')](function(){if(_0x14cfa8!==0x194){return db['WhatsappApplication'][_0x037d('0x7e')]({'where':{'WhatsappAccountId':_0x23f218},'order':_0x037d('0x7f')})['then'](function(_0x141bf6){_0xcf8c83=_0x141bf6;});}})['catch'](function(_0x45d777){_0x14cfa8=0x1f4;logger[_0x037d('0x26')](_0x45d777['stack']);if(_0x45d777[_0x037d('0x3a')]){delete _0x45d777[_0x037d('0x3a')];}_0xcf8c83=_0x45d777;})[_0x037d('0x80')](function(){if(_0xcf8c83===null){_0x4a3763[_0x037d('0x2b')](_0x14cfa8);}else{if(_0x14cfa8===0x1f4){_0x4a3763['status'](_0x14cfa8)[_0x037d('0x3b')](_0xcf8c83);}else{_0x4a3763[_0x037d('0x31')](_0x14cfa8)[_0x037d('0x2c')](_0xcf8c83);}}});};exports['getApplications']=function(_0xd6e0f4,_0x346782,_0x1e1302){var _0x253552={};var _0x389fe0={};var _0x5836f5;var _0x160d1c;return db[_0x037d('0x3f')][_0x037d('0x65')]({'where':{'id':_0xd6e0f4[_0x037d('0x54')]['id']}})[_0x037d('0x20')](handleEntityNotFound(_0x346782,null))[_0x037d('0x20')](function(_0x26e9c4){if(_0x26e9c4){_0x5836f5=_0x26e9c4;_0x389fe0[_0x037d('0x43')]=_['keys'](db['WhatsappApplication']['rawAttributes']);_0x389fe0[_0x037d('0x44')]=_[_0x037d('0x56')](_0xd6e0f4[_0x037d('0x44')]);_0x389fe0[_0x037d('0x45')]=_[_0x037d('0x46')](_0x389fe0[_0x037d('0x43')],_0x389fe0[_0x037d('0x44')]);_0x253552['attributes']=_[_0x037d('0x46')](_0x389fe0[_0x037d('0x43')],qs['fields'](_0xd6e0f4['query']['fields']));_0x253552[_0x037d('0x47')]=_0x253552[_0x037d('0x47')][_0x037d('0x49')]?_0x253552[_0x037d('0x47')]:_0x389fe0['model'];_0x253552[_0x037d('0x4b')]=qs[_0x037d('0x4c')](_0xd6e0f4[_0x037d('0x44')][_0x037d('0x4c')]);_0x253552[_0x037d('0x4e')]=qs[_0x037d('0x45')](_['pick'](_0xd6e0f4['query'],_0x389fe0[_0x037d('0x45')]));if(_0xd6e0f4['query'][_0x037d('0x4d')]){_0x253552[_0x037d('0x4e')]=_[_0x037d('0x4f')](_0x253552['where'],{'$or':_[_0x037d('0x3e')](_0x253552[_0x037d('0x47')],function(_0x3b342b){var _0x15eaa9={};_0x15eaa9[_0x3b342b]={'$like':'%'+_0xd6e0f4[_0x037d('0x44')][_0x037d('0x4d')]+'%'};return _0x15eaa9;})});}_0x253552=_[_0x037d('0x4f')]({},_0x253552,_0xd6e0f4[_0x037d('0x68')]);return _0x5836f5[_0x037d('0x81')](_0x253552);}})[_0x037d('0x20')](function(_0x12fb30){if(_0x12fb30){_0x160d1c=_0x12fb30[_0x037d('0x49')];if(!_0xd6e0f4[_0x037d('0x44')][_0x037d('0x66')]('nolimit')){_0x253552['limit']=qs[_0x037d('0x2e')](_0xd6e0f4['query']['limit']);_0x253552['offset']=qs['offset'](_0xd6e0f4[_0x037d('0x44')][_0x037d('0x30')]);}return _0x5836f5[_0x037d('0x81')](_0x253552);}})['then'](function(_0x29d28d){if(_0x29d28d){return _0x29d28d?{'count':_0x160d1c,'rows':_0x29d28d}:null;}})[_0x037d('0x20')](respondWithResult(_0x346782,null))['catch'](handleError(_0x346782,null));};exports[_0x037d('0x82')]=function(_0x1af481,_0x30e98b,_0xafec04){var _0x22318e={'channel':_0x037d('0x83')};var _0xf03cfc=[];var _0x4d3ef5=[];var _0x212385={};return db[_0x037d('0x3f')]['find']({'where':{'id':_0x1af481[_0x037d('0x54')]['id']},'include':[{'model':db[_0x037d('0x7d')],'as':_0x037d('0x84')}]})[_0x037d('0x20')](handleEntityNotFound(_0x30e98b,null))[_0x037d('0x20')](function(_0x1187a2){_0x22318e[_0x037d('0x85')]=_0x1187a2;if(_0x22318e[_0x037d('0x85')]&&_0x22318e[_0x037d('0x85')][_0x037d('0x42')]===_0x037d('0x86')&&_0x1af481['body'][_0x037d('0x87')]){if(_0x1af481[_0x037d('0x5a')][_0x037d('0x87')][_0x037d('0x49')]===0x0)return;if(_0x1af481['body'][_0x037d('0x87')][0x0]['state']!==_0x037d('0x88'))return;return db[_0x037d('0x89')][_0x037d('0x35')]({'read':!![],'readAt':_0x1af481[_0x037d('0x5a')][_0x037d('0x87')][0x0][_0x037d('0x8a')]},{'where':{'messageId':_0x1af481[_0x037d('0x5a')][_0x037d('0x87')][0x0][_0x037d('0x8b')]},'individualHooks':!![]})[_0x037d('0x20')](function(_0x1e929e){return _0x30e98b[_0x037d('0x31')](0xc8)[_0x037d('0x2c')](_0x1e929e);});}_0x22318e['applications']=_[_0x037d('0x8c')](_0x1187a2[_0x037d('0x84')],[_0x037d('0x7f')],['asc']);if(_0x22318e[_0x037d('0x85')][_0x037d('0x84')]){delete _0x22318e['account'][_0x037d('0x84')];}return db['CmContact'][_0x037d('0x60')]()[_0x037d('0x20')](function(_0x169ae5){if(!_0x169ae5){throw new db['Sequelize'][(_0x037d('0x8d'))](_0x037d('0x8e'));}_0xf03cfc=_[_0x037d('0x8f')](_['keys'](_0x169ae5),['createdAt',_0x037d('0x90')]);_0x4d3ef5=_['difference'](_[_0x037d('0x56')](_0x169ae5),[_0x037d('0x91'),_0x037d('0x90'),_0x037d('0x92'),'ListId']);_0x22318e['body']={'mapKey':'mobile'};if(_0x22318e[_0x037d('0x85')]&&_0x22318e['account'][_0x037d('0x42')]==='twilio'){_0x22318e[_0x037d('0x5a')][_0x037d('0x93')]=_0x1af481['body'][_0x037d('0x94')][_0x037d('0x95')](_0x037d('0x96'),'');_0x22318e[_0x037d('0x5a')][_0x037d('0x5a')]=_0x1af481[_0x037d('0x5a')][_0x037d('0x97')];_0x22318e[_0x037d('0x5a')][_0x037d('0x98')]=_0x1af481['body'][_0x037d('0x99')];}if(_0x22318e[_0x037d('0x85')]&&_0x22318e[_0x037d('0x85')][_0x037d('0x42')]===_0x037d('0x86')){_0x22318e[_0x037d('0x5a')][_0x037d('0x93')]=_0x1af481[_0x037d('0x5a')][_0x037d('0x9a')][0x0][_0x037d('0x93')];_0x22318e[_0x037d('0x5a')][_0x037d('0x5a')]=_0x1af481[_0x037d('0x5a')][_0x037d('0x9a')][0x0]['message'][_0x037d('0x5a')];_0x22318e[_0x037d('0x5a')][_0x037d('0x98')]=_0x1af481['body'][_0x037d('0x9a')][0x0][_0x037d('0x8b')];}if(_0x22318e['body']['id']){delete _0x22318e['body']['id'];}if(_[_0x037d('0x9b')](_0x22318e[_0x037d('0x5a')][_0x037d('0x93')])){throw new db[(_0x037d('0x9c'))]['ValidationError'](_0x037d('0x9d'));}if(_[_0x037d('0x9b')](_0x22318e[_0x037d('0x5a')][_0x037d('0x5a')])||_0x22318e[_0x037d('0x5a')][_0x037d('0x5a')]===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x037d('0x9b')](_0x22318e[_0x037d('0x5a')][_0x037d('0x9e')])){throw new db[(_0x037d('0x9c'))][(_0x037d('0x8d'))](_0x037d('0x9f')+_0x4d3ef5);}if(!_[_0x037d('0xa0')](_0x4d3ef5,_0x22318e[_0x037d('0x5a')][_0x037d('0x9e')])){throw new db[(_0x037d('0x9c'))][(_0x037d('0x8d'))](_0x037d('0xa1')+_0x4d3ef5);}_0x212385[_0x22318e[_0x037d('0x5a')][_0x037d('0x9e')]]=_0x22318e[_0x037d('0x5a')][_0x037d('0x93')];return db[_0x037d('0xa2')][_0x037d('0x58')]({'where':{'id':_0x22318e[_0x037d('0x85')][_0x037d('0xa3')]},'include':[{'model':db[_0x037d('0xa4')],'as':'Contacts','where':_0x212385,'limit':0x1,'order':[[_0x037d('0x90'),'DESC']]}]});})[_0x037d('0x20')](handleEntityNotFound(_0x30e98b,null))[_0x037d('0x20')](function(_0x2fc1b3){if(_0x2fc1b3){_0x22318e[_0x037d('0xa5')]=_['omit'](_0x2fc1b3,[_0x037d('0xa6')]);if(_0x2fc1b3[_0x037d('0xa6')]['length']){return _0x2fc1b3[_0x037d('0xa6')][0x0];}var _0x2d5294=_['defaults'](_0x22318e[_0x037d('0x5a')],{'firstName':_0x22318e[_0x037d('0x5a')][_0x037d('0x93')],'ListId':_0x2fc1b3['id']});_0x2d5294[_0x22318e['body'][_0x037d('0x9e')]]=_0x22318e[_0x037d('0x5a')][_0x037d('0x93')];return db['CmContact'][_0x037d('0x59')](_0x2d5294,{'fields':_0xf03cfc,'raw':!![]});}})[_0x037d('0x20')](handleEntityNotFound(_0x30e98b,null))[_0x037d('0x20')](function(_0x5e03f4){if(_0x5e03f4){_0x22318e[_0x037d('0xa7')]=_0x5e03f4;var _0x1ecd69={'ContactId':_0x5e03f4['id'],'phone':_0x22318e[_0x037d('0x5a')][_0x037d('0x93')],'WhatsappAccountId':_0x1af481[_0x037d('0x54')]['id']};var _0x23e7e6={'ContactId':_0x5e03f4['id'],'WhatsappAccountId':_0x1af481[_0x037d('0x54')]['id'],'closed':![]};return db['WhatsappInteraction'][_0x037d('0x58')]({'where':_0x23e7e6})[_0x037d('0x20')](function(_0x120426){if(_0x120426){return[_0x120426,![]];}return db[_0x037d('0xa8')]['create'](_0x1ecd69)[_0x037d('0x20')](function(_0x1756fa){return[_0x1756fa,!![]];});});}})[_0x037d('0xa9')](function(_0x305b18,_0x51567c){_0x22318e[_0x037d('0xaa')]=_0x305b18[_0x037d('0x37')]({'plain':!![]});_0x22318e[_0x037d('0xaa')]['created']=![];if(_0x51567c){if(_0x22318e[_0x037d('0x85')][_0x037d('0xab')]){_0x22318e[_0x037d('0xac')][_0x037d('0xad')]({'id':0x0,'priority':_0x22318e[_0x037d('0xac')][_0x037d('0x49')]+0x1,'app':'close','appdata':_0x037d('0xae'),'interval':_0x037d('0xaf')});}_0x22318e['interaction'][_0x037d('0xb0')]=!![];}return db['WhatsappMessage']['create']({'phone':_0x22318e['body']['from'],'messageId':_0x22318e['body'][_0x037d('0x98')],'body':_0x22318e['body'][_0x037d('0x5a')],'WhatsappAccountId':_0x1af481[_0x037d('0x54')]['id'],'WhatsappInteractionId':_0x305b18['id'],'direction':'in','ContactId':_0x305b18[_0x037d('0xb1')],'AttachmentId':_0x22318e['body'][_0x037d('0xb2')]});})['then'](function(_0x309c6b){_0x22318e[_0x037d('0x28')]=_0x309c6b;if(_0x22318e[_0x037d('0xaa')][_0x037d('0xb3')]){return db[_0x037d('0x76')]['find']({'attributes':['id',_0x037d('0x3a')],'where':{'id':_0x22318e[_0x037d('0xaa')][_0x037d('0xb3')]}})[_0x037d('0x20')](function(_0x90c1e6){if(_0x90c1e6){_0x22318e['applications'][_0x037d('0xb4')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x90c1e6[_0x037d('0x3a')]+','+(_0x22318e[_0x037d('0x85')][_0x037d('0xb5')]||0xa),'interval':_0x037d('0xaf')});}return respondWithRpcPromise('Start','startRouting',_0x22318e);});}return respondWithRpcPromise('Start','startRouting',_0x22318e);})['then'](function(_0x329d30){if(_0x329d30){var _0x12e2a2=0xc8;var _0x462a72=_0x037d('0xb6');logger[_0x037d('0x21')](_0x037d('0x24'),_0x462a72,_0x12e2a2,'entity\x20found');logger[_0x037d('0xb7')](_0x037d('0xb8'),_0x462a72,_0x12e2a2,_0x037d('0xb9'),JSON['stringify'](_0x329d30));if(_0x22318e[_0x037d('0x85')][_0x037d('0x42')]===_0x037d('0xba')){return _0x30e98b[_0x037d('0x31')](_0x12e2a2)[_0x037d('0xbb')]('Content-Type',_0x037d('0xbc'))['send']('\x0a');}else{return _0x30e98b[_0x037d('0x31')](_0x12e2a2)[_0x037d('0x2c')](_0x329d30);}}});})[_0x037d('0x2a')](handleError(_0x30e98b,null));};exports[_0x037d('0x3b')]=function(_0x46bbee,_0x70f183,_0x49ccf3){var _0x56d3e0,_0x27153d,_0x5d3a9c;if(_[_0x037d('0x9b')](_0x46bbee['body'][_0x037d('0x5a')])||_0x46bbee[_0x037d('0x5a')][_0x037d('0x5a')]===''){throw new db[(_0x037d('0x9c'))][(_0x037d('0x8d'))](_0x037d('0xbd'));}if(_['isNil'](_0x46bbee[_0x037d('0x5a')]['to'])){throw new db[(_0x037d('0x9c'))]['ValidationError'](_0x037d('0xbe'));}_0x56d3e0=_0x46bbee[_0x037d('0x5a')]['to'];return db[_0x037d('0x3f')][_0x037d('0x58')]({'where':{'id':_0x46bbee['params']['id']},'include':[{'model':db[_0x037d('0xa2')],'as':_0x037d('0xbf'),'include':[{'model':db['CmContact'],'as':_0x037d('0xa6'),'where':{'mobile':_0x56d3e0},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0x037d('0x20')](handleEntityNotFound(_0x70f183,null))[_0x037d('0x20')](function(_0x3c71e8){if(_0x3c71e8&&_0x3c71e8[_0x037d('0xbf')]){_0x27153d=_0x3c71e8[_0x037d('0x37')]({'plain':!![]});if(_0x27153d['List']&&_0x27153d[_0x037d('0xbf')]['Contacts']['length']){return _0x27153d[_0x037d('0xbf')][_0x037d('0xa6')][0x0];}return db[_0x037d('0xa4')][_0x037d('0x59')](_[_0x037d('0xc0')](_0x46bbee[_0x037d('0x5a')],{'firstName':_0x56d3e0,'mobile':_0x56d3e0,'phone':_0x56d3e0,'ListId':_0x27153d[_0x037d('0xa3')]}));}})[_0x037d('0x20')](handleEntityNotFound(_0x70f183,null))[_0x037d('0x20')](function(_0xae5018){if(_0xae5018){_0x5d3a9c=_0xae5018;return db[_0x037d('0xa8')][_0x037d('0x58')]({'where':{'ContactId':_0x5d3a9c['id'],'closed':![],'WhatsappAccountId':_0x27153d['id']}})[_0x037d('0x20')](function(_0x5bf072){if(_0x5bf072){return[_0x5bf072,![]];}return db[_0x037d('0xa8')]['create']({'UserId':_0x46bbee[_0x037d('0x5b')]['id'],'ContactId':_0x5d3a9c['id'],'WhatsappAccountId':_0x27153d['id'],'phone':_0x56d3e0,'firstMsgDirection':_0x037d('0xc1'),'Messages':[_[_0x037d('0x4f')](_0x46bbee['body'],{'read':![],'body':_0x46bbee[_0x037d('0x5a')]['body'],'phone':_0x56d3e0,'WhatsappAccountId':_0x27153d['id'],'UserId':_0x46bbee['user']['id'],'ContactId':_0x5d3a9c['id']})]},{'include':[{'model':db[_0x037d('0x89')],'as':'Messages'}]})[_0x037d('0x20')](function(_0x232734){return[_0x232734,!![]];});});}})[_0x037d('0xa9')](function(_0x31693b,_0x20cd20){if(_0x20cd20){return _0x31693b;}return db[_0x037d('0x89')][_0x037d('0x59')](_[_0x037d('0x4f')](_0x46bbee[_0x037d('0x5a')],{'read':![],'body':_0x46bbee[_0x037d('0x5a')][_0x037d('0x5a')],'phone':_0x56d3e0,'WhatsappAccountId':_0x27153d['id'],'WhatsappInteractionId':_0x31693b['id'],'UserId':_0x46bbee[_0x037d('0x5b')]['id'],'ContactId':_0x5d3a9c['id']}))[_0x037d('0x20')](function(_0x4e1324){_0x31693b['dataValues'][_0x037d('0xc2')]=[];_0x31693b[_0x037d('0xc3')][_0x037d('0xc2')][_0x037d('0xad')](_0x4e1324[_0x037d('0xc3')]);return _0x31693b;});})['then'](respondWithResult(_0x70f183,null))[_0x037d('0x2a')](handleError(_0x70f183,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index b511178..259c7d6 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 _0x87cc=['hook','exports','../../mysqldb','WhatsappAccount','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x21e0e6,_0x5dfe8a){var _0x580daf=function(_0x36a21b){while(--_0x36a21b){_0x21e0e6['push'](_0x21e0e6['shift']());}};_0x580daf(++_0x5dfe8a);}(_0x87cc,0x146));var _0xc87c=function(_0x353950,_0x590b09){_0x353950=_0x353950-0x0;var _0x2f87e1=_0x87cc[_0x353950];return _0x2f87e1;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0xc87c('0x0'))['db'][_0xc87c('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xc87c('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc87c('0x3'),'afterDestroy':_0xc87c('0x4')};function emitEvent(_0x413677){return function(_0x5ed244,_0x2b0217,_0x5b7349){WhatsappAccountEvents['emit'](_0x413677+':'+_0x5ed244['id'],_0x5ed244);WhatsappAccountEvents[_0xc87c('0x5')](_0x413677,_0x5ed244);_0x5b7349(null);};}for(var e in events){if(events[_0xc87c('0x6')](e)){var event=events[e];WhatsappAccount[_0xc87c('0x7')](e,emitEvent(event));}}module[_0xc87c('0x8')]=WhatsappAccountEvents; \ No newline at end of file +var _0xcc7e=['hasOwnProperty','hook','exports','events','WhatsappAccount','setMaxListeners','save','update','remove','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcc7e,0x71));var _0xecc7=function(_0x227372,_0xd4b5f6){_0x227372=_0x227372-0x0;var _0x4e4bf5=_0xcc7e[_0x227372];return _0x4e4bf5;};'use strict';var EventEmitter=require(_0xecc7('0x0'));var WhatsappAccount=require('../../mysqldb')['db'][_0xecc7('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xecc7('0x2')](0x0);var events={'afterCreate':_0xecc7('0x3'),'afterUpdate':_0xecc7('0x4'),'afterDestroy':_0xecc7('0x5')};function emitEvent(_0x5d14a7){return function(_0x402829,_0x5b4fd3,_0x5020f1){WhatsappAccountEvents[_0xecc7('0x6')](_0x5d14a7+':'+_0x402829['id'],_0x402829);WhatsappAccountEvents[_0xecc7('0x6')](_0x5d14a7,_0x402829);_0x5020f1(null);};}for(var e in events){if(events[_0xecc7('0x7')](e)){var event=events[e];WhatsappAccount[_0xecc7('0x8')](e,emitEvent(event));}}module[_0xecc7('0x9')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 052e0f4..610dc00 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 _0xe9a7=['../../config/environment','./whatsappAccount.attributes','exports','define','WhatsappAccount','whatsapp_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x1b2ea2,_0x19c7a1){var _0x40f25c=function(_0x2d74cd){while(--_0x2d74cd){_0x1b2ea2['push'](_0x1b2ea2['shift']());}};_0x40f25c(++_0x19c7a1);}(_0xe9a7,0xca));var _0x7e9a=function(_0x1558ab,_0x39d1de){_0x1558ab=_0x1558ab-0x0;var _0x53b64a=_0xe9a7[_0x1558ab];return _0x53b64a;};'use strict';var _=require(_0x7e9a('0x0'));var util=require(_0x7e9a('0x1'));var logger=require(_0x7e9a('0x2'))(_0x7e9a('0x3'));var moment=require(_0x7e9a('0x4'));var BPromise=require(_0x7e9a('0x5'));var rp=require(_0x7e9a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7e9a('0x7'));var config=require(_0x7e9a('0x8'));var attributes=require(_0x7e9a('0x9'));module[_0x7e9a('0xa')]=function(_0x362648,_0x418023){return _0x362648[_0x7e9a('0xb')](_0x7e9a('0xc'),attributes,{'tableName':_0x7e9a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9efa=['WhatsappAccount','whatsapp_accounts','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./whatsappAccount.attributes','exports','define'];(function(_0x1a3cc7,_0x2900e3){var _0x338438=function(_0x5a4872){while(--_0x5a4872){_0x1a3cc7['push'](_0x1a3cc7['shift']());}};_0x338438(++_0x2900e3);}(_0x9efa,0x188));var _0xa9ef=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x9efa[_0x2be8c2];return _0x97f531;};'use strict';var _=require(_0xa9ef('0x0'));var util=require('util');var logger=require(_0xa9ef('0x1'))(_0xa9ef('0x2'));var moment=require(_0xa9ef('0x3'));var BPromise=require(_0xa9ef('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa9ef('0x5'));var rimraf=require(_0xa9ef('0x6'));var config=require(_0xa9ef('0x7'));var attributes=require(_0xa9ef('0x8'));module[_0xa9ef('0x9')]=function(_0x441037,_0x417155){return _0x441037[_0xa9ef('0xa')](_0xa9ef('0xb'),attributes,{'tableName':_0xa9ef('0xc'),'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 3cad162..d44c856 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 _0xdc7b=['include','map','model','then','debug','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','./whatsappAccount.socket','register','info','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','result','ShowWhatsappAccount','options','raw','where','attributes'];(function(_0x284bc3,_0x22dffe){var _0x41ac81=function(_0x47031f){while(--_0x47031f){_0x284bc3['push'](_0x284bc3['shift']());}};_0x41ac81(++_0x22dffe);}(_0xdc7b,0x153));var _0xbdc7=function(_0x326c2a,_0x12ed32){_0x326c2a=_0x326c2a-0x0;var _0x386496=_0xdc7b[_0x326c2a];return _0x386496;};'use strict';var _=require(_0xbdc7('0x0'));var util=require(_0xbdc7('0x1'));var moment=require(_0xbdc7('0x2'));var BPromise=require(_0xbdc7('0x3'));var rs=require(_0xbdc7('0x4'));var fs=require('fs');var Redis=require(_0xbdc7('0x5'));var db=require(_0xbdc7('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xbdc7('0x7'))(_0xbdc7('0x8'));var config=require(_0xbdc7('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xbdc7('0xa')][_0xbdc7('0xb')]({'port':0x232a});config[_0xbdc7('0xc')]=_[_0xbdc7('0xd')](config[_0xbdc7('0xc')],{'host':_0xbdc7('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbdc7('0xc')]));require(_0xbdc7('0xf'))[_0xbdc7('0x10')](socket);function respondWithRpcPromise(_0x35d4e2,_0x42db4b,_0x3074bf){return new BPromise(function(_0x54a9f3,_0x466d56){return client['request'](_0x35d4e2,_0x3074bf)['then'](function(_0x2e6b23){logger[_0xbdc7('0x11')]('WhatsappAccount,\x20%s,\x20%s',_0x42db4b,_0xbdc7('0x12'));logger['debug'](_0xbdc7('0x13'),_0x42db4b,_0xbdc7('0x12'),JSON[_0xbdc7('0x14')](_0x2e6b23));if(_0x2e6b23[_0xbdc7('0x15')]){if(_0x2e6b23[_0xbdc7('0x15')][_0xbdc7('0x16')]===0x1f4){logger['error'](_0xbdc7('0x17'),_0x42db4b,_0x2e6b23[_0xbdc7('0x15')][_0xbdc7('0x18')]);return _0x466d56(_0x2e6b23[_0xbdc7('0x15')][_0xbdc7('0x18')]);}logger[_0xbdc7('0x15')](_0xbdc7('0x17'),_0x42db4b,_0x2e6b23['error'][_0xbdc7('0x18')]);return _0x54a9f3(_0x2e6b23[_0xbdc7('0x15')][_0xbdc7('0x18')]);}else{logger['info'](_0xbdc7('0x17'),_0x42db4b,'request\x20sent');_0x54a9f3(_0x2e6b23[_0xbdc7('0x19')]['message']);}})['catch'](function(_0x226346){logger[_0xbdc7('0x15')](_0xbdc7('0x17'),_0x42db4b,_0x226346);_0x466d56(_0x226346);});});}exports[_0xbdc7('0x1a')]=function(_0x163c6e){var _0x57883d=this;return new Promise(function(_0x55f825,_0x56b9cc){return db['WhatsappAccount']['find']({'raw':_0x163c6e[_0xbdc7('0x1b')]?_0x163c6e[_0xbdc7('0x1b')][_0xbdc7('0x1c')]===undefined?!![]:![]:!![],'where':_0x163c6e['options']?_0x163c6e['options'][_0xbdc7('0x1d')]||null:null,'attributes':_0x163c6e['options']?_0x163c6e[_0xbdc7('0x1b')][_0xbdc7('0x1e')]||null:null,'include':_0x163c6e[_0xbdc7('0x1b')]?_0x163c6e[_0xbdc7('0x1b')][_0xbdc7('0x1f')]?_[_0xbdc7('0x20')](_0x163c6e[_0xbdc7('0x1b')]['include'],function(_0x57fda6){return{'model':db[_0x57fda6[_0xbdc7('0x21')]],'as':_0x57fda6['as'],'attributes':_0x57fda6[_0xbdc7('0x1e')],'include':_0x57fda6[_0xbdc7('0x1f')]?_[_0xbdc7('0x20')](_0x57fda6[_0xbdc7('0x1f')],function(_0x19d3cf){return{'model':db[_0x19d3cf[_0xbdc7('0x21')]],'as':_0x19d3cf['as'],'attributes':_0x19d3cf['attributes'],'include':_0x19d3cf[_0xbdc7('0x1f')]?_[_0xbdc7('0x20')](_0x19d3cf['include'],function(_0x3326e9){return{'model':db[_0x3326e9[_0xbdc7('0x21')]],'as':_0x3326e9['as'],'attributes':_0x3326e9[_0xbdc7('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xbdc7('0x22')](function(_0xad09d8){logger[_0xbdc7('0x11')](_0xbdc7('0x1a'),_0x163c6e);logger[_0xbdc7('0x23')](_0xbdc7('0x1a'),_0x163c6e,JSON[_0xbdc7('0x14')](_0xad09d8));_0x55f825(_0xad09d8);})[_0xbdc7('0x24')](function(_0x2ff8e3){logger[_0xbdc7('0x15')]('ShowWhatsappAccount',_0x2ff8e3['message'],_0x163c6e);_0x56b9cc(_0x57883d[_0xbdc7('0x15')](0x1f4,_0x2ff8e3[_0xbdc7('0x18')]));});});}; \ No newline at end of file +var _0x54f3=['../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','then','info','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','WhatsappAccount,\x20%s,\x20%s','message','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','raw','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x149980,_0xeb67c8){var _0x3aacce=function(_0x276700){while(--_0x276700){_0x149980['push'](_0x149980['shift']());}};_0x3aacce(++_0xeb67c8);}(_0x54f3,0xdb));var _0x354f=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x54f3[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x354f('0x0'));var util=require(_0x354f('0x1'));var moment=require(_0x354f('0x2'));var BPromise=require(_0x354f('0x3'));var rs=require(_0x354f('0x4'));var fs=require('fs');var Redis=require(_0x354f('0x5'));var db=require(_0x354f('0x6'))['db'];var utils=require(_0x354f('0x7'));var logger=require('../../config/logger')(_0x354f('0x8'));var config=require(_0x354f('0x9'));var jayson=require(_0x354f('0xa'));var client=jayson['client'][_0x354f('0xb')]({'port':0x232a});config[_0x354f('0xc')]=_['defaults'](config[_0x354f('0xc')],{'host':_0x354f('0xd'),'port':0x18eb});var socket=require(_0x354f('0xe'))(new Redis(config[_0x354f('0xc')]));require(_0x354f('0xf'))[_0x354f('0x10')](socket);function respondWithRpcPromise(_0x29b31c,_0x4cfe49,_0x20f070){return new BPromise(function(_0x271e3a,_0x316a87){return client[_0x354f('0x11')](_0x29b31c,_0x20f070)[_0x354f('0x12')](function(_0x36c831){logger[_0x354f('0x13')]('WhatsappAccount,\x20%s,\x20%s',_0x4cfe49,_0x354f('0x14'));logger[_0x354f('0x15')](_0x354f('0x16'),_0x4cfe49,_0x354f('0x14'),JSON['stringify'](_0x36c831));if(_0x36c831[_0x354f('0x17')]){if(_0x36c831[_0x354f('0x17')]['code']===0x1f4){logger[_0x354f('0x17')](_0x354f('0x18'),_0x4cfe49,_0x36c831[_0x354f('0x17')][_0x354f('0x19')]);return _0x316a87(_0x36c831[_0x354f('0x17')]['message']);}logger[_0x354f('0x17')](_0x354f('0x18'),_0x4cfe49,_0x36c831[_0x354f('0x17')]['message']);return _0x271e3a(_0x36c831[_0x354f('0x17')][_0x354f('0x19')]);}else{logger['info'](_0x354f('0x18'),_0x4cfe49,_0x354f('0x14'));_0x271e3a(_0x36c831[_0x354f('0x1a')][_0x354f('0x19')]);}})[_0x354f('0x1b')](function(_0x5f296d){logger['error'](_0x354f('0x18'),_0x4cfe49,_0x5f296d);_0x316a87(_0x5f296d);});});}exports[_0x354f('0x1c')]=function(_0x2f49f7){var _0x3d8db0=this;return new Promise(function(_0x3a7395,_0xeb7eba){return db[_0x354f('0x1d')][_0x354f('0x1e')]({'raw':_0x2f49f7[_0x354f('0x1f')]?_0x2f49f7[_0x354f('0x1f')][_0x354f('0x20')]===undefined?!![]:![]:!![],'where':_0x2f49f7[_0x354f('0x1f')]?_0x2f49f7[_0x354f('0x1f')][_0x354f('0x21')]||null:null,'attributes':_0x2f49f7[_0x354f('0x1f')]?_0x2f49f7[_0x354f('0x1f')][_0x354f('0x22')]||null:null,'include':_0x2f49f7[_0x354f('0x1f')]?_0x2f49f7[_0x354f('0x1f')][_0x354f('0x23')]?_[_0x354f('0x24')](_0x2f49f7[_0x354f('0x1f')][_0x354f('0x23')],function(_0x19443e){return{'model':db[_0x19443e['model']],'as':_0x19443e['as'],'attributes':_0x19443e[_0x354f('0x22')],'include':_0x19443e[_0x354f('0x23')]?_['map'](_0x19443e[_0x354f('0x23')],function(_0x40427b){return{'model':db[_0x40427b[_0x354f('0x25')]],'as':_0x40427b['as'],'attributes':_0x40427b[_0x354f('0x22')],'include':_0x40427b[_0x354f('0x23')]?_[_0x354f('0x24')](_0x40427b[_0x354f('0x23')],function(_0x3a0ea4){return{'model':db[_0x3a0ea4['model']],'as':_0x3a0ea4['as'],'attributes':_0x3a0ea4[_0x354f('0x22')]};}):[]};}):[]};}):[]:[]})[_0x354f('0x12')](function(_0x20f5e0){logger[_0x354f('0x13')](_0x354f('0x1c'),_0x2f49f7);logger['debug'](_0x354f('0x1c'),_0x2f49f7,JSON['stringify'](_0x20f5e0));_0x3a7395(_0x20f5e0);})['catch'](function(_0xf221ea){logger[_0x354f('0x17')](_0x354f('0x1c'),_0xf221ea['message'],_0x2f49f7);_0xeb7eba(_0x3d8db0['error'](0x1f4,_0xf221ea[_0x354f('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 94514db..3655ff1 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 _0xb2f1=['remove','update','emit','removeListener','register','length','whatsappAccount:','./whatsappAccount.events','save'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xb2f1,0x115));var _0x1b2f=function(_0x2d9996,_0x9f3bc0){_0x2d9996=_0x2d9996-0x0;var _0x20da3c=_0xb2f1[_0x2d9996];return _0x20da3c;};'use strict';var WhatsappAccountEvents=require(_0x1b2f('0x0'));var events=[_0x1b2f('0x1'),_0x1b2f('0x2'),_0x1b2f('0x3')];function createListener(_0x5c2fad,_0x531b2b){return function(_0x3522ca){_0x531b2b[_0x1b2f('0x4')](_0x5c2fad,_0x3522ca);};}function removeListener(_0xa04827,_0x1864af){return function(){WhatsappAccountEvents[_0x1b2f('0x5')](_0xa04827,_0x1864af);};}exports[_0x1b2f('0x6')]=function(_0x7425f9){for(var _0x37f00c=0x0,_0x68ce39=events[_0x1b2f('0x7')];_0x37f00c<_0x68ce39;_0x37f00c++){var _0x2dfe14=events[_0x37f00c];var _0x45680d=createListener(_0x1b2f('0x8')+_0x2dfe14,_0x7425f9);WhatsappAccountEvents['on'](_0x2dfe14,_0x45680d);}}; \ No newline at end of file +var _0x0a2b=['whatsappAccount:','./whatsappAccount.events','save','remove','update','removeListener','length'];(function(_0x273efe,_0x1af253){var _0x163b9e=function(_0x59db63){while(--_0x59db63){_0x273efe['push'](_0x273efe['shift']());}};_0x163b9e(++_0x1af253);}(_0x0a2b,0x19e));var _0xb0a2=function(_0x22e47a,_0x4ea10c){_0x22e47a=_0x22e47a-0x0;var _0x15a12a=_0x0a2b[_0x22e47a];return _0x15a12a;};'use strict';var WhatsappAccountEvents=require(_0xb0a2('0x0'));var events=[_0xb0a2('0x1'),_0xb0a2('0x2'),_0xb0a2('0x3')];function createListener(_0x4f4e78,_0x2c50b7){return function(_0x310343){_0x2c50b7['emit'](_0x4f4e78,_0x310343);};}function removeListener(_0x102e50,_0x1782c9){return function(){WhatsappAccountEvents[_0xb0a2('0x4')](_0x102e50,_0x1782c9);};}exports['register']=function(_0x5e938e){for(var _0x4dbb38=0x0,_0x2610f0=events[_0xb0a2('0x5')];_0x4dbb38<_0x2610f0;_0x4dbb38++){var _0x8b4ceb=events[_0x4dbb38];var _0x42b0d0=createListener(_0xb0a2('0x6')+_0x8b4ceb,_0x5e938e);WhatsappAccountEvents['on'](_0x8b4ceb,_0x42b0d0);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 3ccb3c2..e5461f3 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 _0x013c=['isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get'];(function(_0x53092d,_0x33f1ca){var _0xfb4bf=function(_0xfccc83){while(--_0xfccc83){_0x53092d['push'](_0x53092d['shift']());}};_0xfb4bf(++_0x33f1ca);}(_0x013c,0x160));var _0xc013=function(_0x41e8c4,_0x30d9ff){_0x41e8c4=_0x41e8c4-0x0;var _0x54ffbe=_0x013c[_0x41e8c4];return _0x54ffbe;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc013('0x0'));var timeout=require(_0xc013('0x1'));var express=require(_0xc013('0x2'));var router=express[_0xc013('0x3')]();var fs_extra=require(_0xc013('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc013('0x5'));var config=require(_0xc013('0x6'));var controller=require(_0xc013('0x7'));router[_0xc013('0x8')]('/',auth[_0xc013('0x9')](),controller[_0xc013('0xa')]);router[_0xc013('0x8')](_0xc013('0xb'),auth[_0xc013('0x9')](),controller[_0xc013('0xc')]);router[_0xc013('0xd')]('/',auth[_0xc013('0x9')](),controller[_0xc013('0xe')]);router[_0xc013('0xf')](_0xc013('0xb'),auth[_0xc013('0x9')](),controller['update']);router[_0xc013('0x10')](_0xc013('0xb'),auth[_0xc013('0x9')](),controller[_0xc013('0x11')]);module[_0xc013('0x12')]=router; \ No newline at end of file +var _0x35c3=['path','connect-timeout','Router','fs-extra','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer','util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x35c3,0x166));var _0x335c=function(_0x2fa9d8,_0x23c7ae){_0x2fa9d8=_0x2fa9d8-0x0;var _0x5cab9e=_0x35c3[_0x2fa9d8];return _0x5cab9e;};'use strict';var multer=require(_0x335c('0x0'));var util=require(_0x335c('0x1'));var path=require(_0x335c('0x2'));var timeout=require(_0x335c('0x3'));var express=require('express');var router=express[_0x335c('0x4')]();var fs_extra=require(_0x335c('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x335c('0x6'));var controller=require(_0x335c('0x7'));router[_0x335c('0x8')]('/',auth[_0x335c('0x9')](),controller[_0x335c('0xa')]);router['get'](_0x335c('0xb'),auth[_0x335c('0x9')](),controller[_0x335c('0xc')]);router[_0x335c('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x335c('0xe')](_0x335c('0xb'),auth[_0x335c('0x9')](),controller[_0x335c('0xf')]);router[_0x335c('0x10')](_0x335c('0xb'),auth[_0x335c('0x9')](),controller['destroy']);module[_0x335c('0x11')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 1a76936..12c2fd3 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 _0x6699=['INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize','exports'];(function(_0x897bb5,_0x4a8ce9){var _0x1b3382=function(_0x2248dd){while(--_0x2248dd){_0x897bb5['push'](_0x897bb5['shift']());}};_0x1b3382(++_0x4a8ce9);}(_0x6699,0x15c));var _0x9669=function(_0x5cef7b,_0x170c97){_0x5cef7b=_0x5cef7b-0x0;var _0x8c58f3=_0x6699[_0x5cef7b];return _0x8c58f3;};'use strict';var Sequelize=require(_0x9669('0x0'));module[_0x9669('0x1')]={'priority':{'type':Sequelize[_0x9669('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x9669('0x3')],'allowNull':![],'defaultValue':_0x9669('0x4')},'appdata':{'type':Sequelize[_0x9669('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x9669('0x3')],'defaultValue':_0x9669('0x6')}}; \ No newline at end of file +var _0xaff3=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0xaf7ac9,_0x1cb7e3){var _0x5b1f10=function(_0x221622){while(--_0x221622){_0xaf7ac9['push'](_0xaf7ac9['shift']());}};_0x5b1f10(++_0x1cb7e3);}(_0xaff3,0x134));var _0x3aff=function(_0x46cc40,_0x38d97b){_0x46cc40=_0x46cc40-0x0;var _0x283759=_0xaff3[_0x46cc40];return _0x283759;};'use strict';var Sequelize=require(_0x3aff('0x0'));module[_0x3aff('0x1')]={'priority':{'type':Sequelize[_0x3aff('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x3aff('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x3aff('0x4')]()},'description':{'type':Sequelize[_0x3aff('0x3')]},'interval':{'type':Sequelize[_0x3aff('0x3')],'defaultValue':_0x3aff('0x5')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 33b02f5..8320f2c 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 _0x5324=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','sendStatus','error','stack','name','send','map','WhatsappApplication','rawAttributes','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','sort','where','filters','pick','filter','type','merge','findAll','rows','catch','includeAll','find','create','body','destroy','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x4f6af5,_0x3ae5e5){var _0xe43436=function(_0x307878){while(--_0x307878){_0x4f6af5['push'](_0x4f6af5['shift']());}};_0xe43436(++_0x3ae5e5);}(_0x5324,0x154));var _0x4532=function(_0x221369,_0x77d2b2){_0x221369=_0x221369-0x0;var _0x5e21de=_0x5324[_0x221369];return _0x5e21de;};'use strict';var emlformat=require(_0x4532('0x0'));var rimraf=require(_0x4532('0x1'));var zipdir=require(_0x4532('0x2'));var jsonpatch=require(_0x4532('0x3'));var rp=require('request-promise');var moment=require(_0x4532('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4532('0x5'));var util=require(_0x4532('0x6'));var path=require(_0x4532('0x7'));var sox=require(_0x4532('0x8'));var csv=require(_0x4532('0x9'));var ejs=require(_0x4532('0xa'));var fs=require('fs');var fs_extra=require(_0x4532('0xb'));var _=require(_0x4532('0xc'));var squel=require('squel');var crypto=require(_0x4532('0xd'));var jsforce=require(_0x4532('0xe'));var deskjs=require(_0x4532('0xf'));var toCsv=require(_0x4532('0x9'));var querystring=require(_0x4532('0x10'));var Papa=require(_0x4532('0x11'));var Redis=require(_0x4532('0x12'));var authService=require(_0x4532('0x13'));var qs=require(_0x4532('0x14'));var as=require(_0x4532('0x15'));var hardwareService=require(_0x4532('0x16'));var logger=require(_0x4532('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x4532('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x4532('0x19'))['db'];function respondWithStatusCode(_0x2b0540,_0x26b91f){_0x26b91f=_0x26b91f||0xcc;return function(_0x3faaeb){if(_0x3faaeb){return _0x2b0540['sendStatus'](_0x26b91f);}return _0x2b0540[_0x4532('0x1a')](_0x26b91f)[_0x4532('0x1b')]();};}function respondWithResult(_0x39acf3,_0x2e0b21){_0x2e0b21=_0x2e0b21||0xc8;return function(_0x19eaf3){if(_0x19eaf3){return _0x39acf3['status'](_0x2e0b21)['json'](_0x19eaf3);}};}function respondWithFilteredResult(_0x52166a,_0x38cd2a){return function(_0x19ea01){if(_0x19ea01){var _0x2dedca=typeof _0x38cd2a[_0x4532('0x1c')]===_0x4532('0x1d')&&typeof _0x38cd2a[_0x4532('0x1e')]===_0x4532('0x1d');var _0x4036b6=_0x19ea01[_0x4532('0x1f')];var _0x4db2a1=_0x2dedca?0x0:_0x38cd2a[_0x4532('0x1c')];var _0x469c5a=_0x2dedca?_0x19ea01[_0x4532('0x1f')]:_0x38cd2a['offset']+_0x38cd2a[_0x4532('0x1e')];var _0x3734e3;if(_0x469c5a>=_0x4036b6){_0x469c5a=_0x4036b6;_0x3734e3=0xc8;}else{_0x3734e3=0xce;}_0x52166a['status'](_0x3734e3);return _0x52166a[_0x4532('0x20')](_0x4532('0x21'),_0x4db2a1+'-'+_0x469c5a+'/'+_0x4036b6)[_0x4532('0x22')](_0x19ea01);}return null;};}function patchUpdates(_0x41a7f7){return function(_0x3f677b){try{jsonpatch[_0x4532('0x23')](_0x3f677b,_0x41a7f7,!![]);}catch(_0x6a669f){return BPromise[_0x4532('0x24')](_0x6a669f);}return _0x3f677b['save']();};}function saveUpdates(_0x94b670,_0x46dc73){return function(_0x481c26){if(_0x481c26){return _0x481c26[_0x4532('0x25')](_0x94b670)[_0x4532('0x26')](function(_0x472d0d){return _0x472d0d;});}return null;};}function removeEntity(_0xed85b1,_0x4fd4bd){return function(_0xbf825a){if(_0xbf825a){return _0xbf825a['destroy']()[_0x4532('0x26')](function(){_0xed85b1[_0x4532('0x1a')](0xcc)[_0x4532('0x1b')]();});}};}function handleEntityNotFound(_0x12ee78,_0x40e42f){return function(_0x278b04){if(!_0x278b04){_0x12ee78[_0x4532('0x27')](0x194);}return _0x278b04;};}function handleError(_0x309865,_0x4a386a){_0x4a386a=_0x4a386a||0x1f4;return function(_0x4b804b){logger[_0x4532('0x28')](_0x4b804b[_0x4532('0x29')]);if(_0x4b804b[_0x4532('0x2a')]){delete _0x4b804b[_0x4532('0x2a')];}_0x309865[_0x4532('0x1a')](_0x4a386a)[_0x4532('0x2b')](_0x4b804b);};}exports['index']=function(_0x3de0ee,_0x239e85){var _0x11d163={},_0x16836c={},_0xd6feb9={'count':0x0,'rows':[]};var _0x485a3f=_[_0x4532('0x2c')](db[_0x4532('0x2d')][_0x4532('0x2e')],function(_0x523f96){return{'name':_0x523f96['fieldName'],'type':_0x523f96['type'][_0x4532('0x2f')]};});_0x16836c[_0x4532('0x30')]=_[_0x4532('0x2c')](_0x485a3f,_0x4532('0x2a'));_0x16836c[_0x4532('0x31')]=_[_0x4532('0x32')](_0x3de0ee[_0x4532('0x31')]);_0x16836c['filters']=_['intersection'](_0x16836c[_0x4532('0x30')],_0x16836c[_0x4532('0x31')]);_0x11d163['attributes']=_[_0x4532('0x33')](_0x16836c[_0x4532('0x30')],qs[_0x4532('0x34')](_0x3de0ee[_0x4532('0x31')][_0x4532('0x34')]));_0x11d163[_0x4532('0x35')]=_0x11d163[_0x4532('0x35')][_0x4532('0x36')]?_0x11d163['attributes']:_0x16836c['model'];if(!_0x3de0ee[_0x4532('0x31')][_0x4532('0x37')]('nolimit')){_0x11d163[_0x4532('0x1e')]=qs[_0x4532('0x1e')](_0x3de0ee[_0x4532('0x31')][_0x4532('0x1e')]);_0x11d163['offset']=qs[_0x4532('0x1c')](_0x3de0ee['query'][_0x4532('0x1c')]);}_0x11d163['order']=qs[_0x4532('0x38')](_0x3de0ee[_0x4532('0x31')][_0x4532('0x38')]);_0x11d163[_0x4532('0x39')]=qs[_0x4532('0x3a')](_[_0x4532('0x3b')](_0x3de0ee[_0x4532('0x31')],_0x16836c[_0x4532('0x3a')]),_0x485a3f);if(_0x3de0ee[_0x4532('0x31')][_0x4532('0x3c')]){_0x11d163[_0x4532('0x39')]=_['merge'](_0x11d163[_0x4532('0x39')],{'$or':_['map'](_0x485a3f,function(_0x493fc4){if(_0x493fc4[_0x4532('0x3d')]!=='VIRTUAL'){var _0x421033={};_0x421033[_0x493fc4[_0x4532('0x2a')]]={'$like':'%'+_0x3de0ee[_0x4532('0x31')][_0x4532('0x3c')]+'%'};return _0x421033;}})});}_0x11d163=_[_0x4532('0x3e')]({},_0x11d163,_0x3de0ee['options']);var _0x51e813={'where':_0x11d163[_0x4532('0x39')]};return db[_0x4532('0x2d')]['count'](_0x51e813)[_0x4532('0x26')](function(_0x4c50ee){_0xd6feb9[_0x4532('0x1f')]=_0x4c50ee;if(_0x3de0ee[_0x4532('0x31')]['includeAll']){_0x11d163['include']=[{'all':!![]}];}return db[_0x4532('0x2d')][_0x4532('0x3f')](_0x11d163);})[_0x4532('0x26')](function(_0x56f3d6){_0xd6feb9[_0x4532('0x40')]=_0x56f3d6;return _0xd6feb9;})[_0x4532('0x26')](respondWithFilteredResult(_0x239e85,_0x11d163))[_0x4532('0x41')](handleError(_0x239e85,null));};exports['show']=function(_0x5cca1a,_0x3d8398){var _0x5c401a={'raw':!![],'where':{'id':_0x5cca1a['params']['id']}},_0x2b39c8={};_0x2b39c8[_0x4532('0x30')]=_[_0x4532('0x32')](db[_0x4532('0x2d')][_0x4532('0x2e')]);_0x2b39c8['query']=_['keys'](_0x5cca1a[_0x4532('0x31')]);_0x2b39c8[_0x4532('0x3a')]=_[_0x4532('0x33')](_0x2b39c8[_0x4532('0x30')],_0x2b39c8['query']);_0x5c401a[_0x4532('0x35')]=_[_0x4532('0x33')](_0x2b39c8[_0x4532('0x30')],qs[_0x4532('0x34')](_0x5cca1a[_0x4532('0x31')]['fields']));_0x5c401a[_0x4532('0x35')]=_0x5c401a[_0x4532('0x35')][_0x4532('0x36')]?_0x5c401a[_0x4532('0x35')]:_0x2b39c8[_0x4532('0x30')];if(_0x5cca1a[_0x4532('0x31')][_0x4532('0x42')]){_0x5c401a['include']=[{'all':!![]}];}_0x5c401a=_[_0x4532('0x3e')]({},_0x5c401a,_0x5cca1a['options']);return db['WhatsappApplication'][_0x4532('0x43')](_0x5c401a)[_0x4532('0x26')](handleEntityNotFound(_0x3d8398,null))['then'](respondWithResult(_0x3d8398,null))['catch'](handleError(_0x3d8398,null));};exports[_0x4532('0x44')]=function(_0x4dfc6f,_0x1447d4){return db[_0x4532('0x2d')][_0x4532('0x44')](_0x4dfc6f[_0x4532('0x45')],{})[_0x4532('0x26')](respondWithResult(_0x1447d4,0xc9))['catch'](handleError(_0x1447d4,null));};exports[_0x4532('0x25')]=function(_0x388583,_0x31501d){if(_0x388583['body']['id']){delete _0x388583[_0x4532('0x45')]['id'];}return db['WhatsappApplication'][_0x4532('0x43')]({'where':{'id':_0x388583['params']['id']}})[_0x4532('0x26')](handleEntityNotFound(_0x31501d,null))[_0x4532('0x26')](saveUpdates(_0x388583[_0x4532('0x45')],null))[_0x4532('0x26')](respondWithResult(_0x31501d,null))[_0x4532('0x41')](handleError(_0x31501d,null));};exports[_0x4532('0x46')]=function(_0x237000,_0x4ac4d4){return db[_0x4532('0x2d')][_0x4532('0x43')]({'where':{'id':_0x237000[_0x4532('0x47')]['id']}})[_0x4532('0x26')](handleEntityNotFound(_0x4ac4d4,null))[_0x4532('0x26')](removeEntity(_0x4ac4d4,null))[_0x4532('0x41')](handleError(_0x4ac4d4,null));}; \ No newline at end of file +var _0x4d68=['json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','then','error','name','send','map','WhatsappApplication','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','includeAll','findAll','rows','catch','params','include','options','find','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status'];(function(_0x96fcd0,_0x99426a){var _0xea9b42=function(_0x6b1961){while(--_0x6b1961){_0x96fcd0['push'](_0x96fcd0['shift']());}};_0xea9b42(++_0x99426a);}(_0x4d68,0x1c3));var _0x84d6=function(_0x203d64,_0x1ec79c){_0x203d64=_0x203d64-0x0;var _0x462ab3=_0x4d68[_0x203d64];return _0x462ab3;};'use strict';var emlformat=require(_0x84d6('0x0'));var rimraf=require(_0x84d6('0x1'));var zipdir=require(_0x84d6('0x2'));var jsonpatch=require(_0x84d6('0x3'));var rp=require(_0x84d6('0x4'));var moment=require(_0x84d6('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x84d6('0x6'));var util=require('util');var path=require(_0x84d6('0x7'));var sox=require('sox');var csv=require(_0x84d6('0x8'));var ejs=require(_0x84d6('0x9'));var fs=require('fs');var fs_extra=require(_0x84d6('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x84d6('0xb'));var jsforce=require(_0x84d6('0xc'));var deskjs=require(_0x84d6('0xd'));var toCsv=require(_0x84d6('0x8'));var querystring=require('querystring');var Papa=require(_0x84d6('0xe'));var Redis=require('ioredis');var authService=require(_0x84d6('0xf'));var qs=require(_0x84d6('0x10'));var as=require(_0x84d6('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x84d6('0x12'));var utils=require('../../config/utils');var config=require(_0x84d6('0x13'));var licenseUtil=require(_0x84d6('0x14'));var db=require(_0x84d6('0x15'))['db'];function respondWithStatusCode(_0x19e7a9,_0x203c54){_0x203c54=_0x203c54||0xcc;return function(_0x506edc){if(_0x506edc){return _0x19e7a9[_0x84d6('0x16')](_0x203c54);}return _0x19e7a9['status'](_0x203c54)[_0x84d6('0x17')]();};}function respondWithResult(_0x2e6340,_0x1a5d62){_0x1a5d62=_0x1a5d62||0xc8;return function(_0x44b065){if(_0x44b065){return _0x2e6340[_0x84d6('0x18')](_0x1a5d62)[_0x84d6('0x19')](_0x44b065);}};}function respondWithFilteredResult(_0x957ae6,_0x4f39f0){return function(_0x10646e){if(_0x10646e){var _0x41e128=typeof _0x4f39f0[_0x84d6('0x1a')]===_0x84d6('0x1b')&&typeof _0x4f39f0[_0x84d6('0x1c')]==='undefined';var _0x1dd975=_0x10646e[_0x84d6('0x1d')];var _0x579aa8=_0x41e128?0x0:_0x4f39f0[_0x84d6('0x1a')];var _0x47a884=_0x41e128?_0x10646e[_0x84d6('0x1d')]:_0x4f39f0[_0x84d6('0x1a')]+_0x4f39f0[_0x84d6('0x1c')];var _0x2cbfb5;if(_0x47a884>=_0x1dd975){_0x47a884=_0x1dd975;_0x2cbfb5=0xc8;}else{_0x2cbfb5=0xce;}_0x957ae6[_0x84d6('0x18')](_0x2cbfb5);return _0x957ae6['set'](_0x84d6('0x1e'),_0x579aa8+'-'+_0x47a884+'/'+_0x1dd975)[_0x84d6('0x19')](_0x10646e);}return null;};}function patchUpdates(_0x50ec59){return function(_0x4e4634){try{jsonpatch[_0x84d6('0x1f')](_0x4e4634,_0x50ec59,!![]);}catch(_0x5ebfcb){return BPromise['reject'](_0x5ebfcb);}return _0x4e4634[_0x84d6('0x20')]();};}function saveUpdates(_0x256787,_0x24c8fb){return function(_0x576510){if(_0x576510){return _0x576510[_0x84d6('0x21')](_0x256787)['then'](function(_0x5deb1f){return _0x5deb1f;});}return null;};}function removeEntity(_0x26e753,_0x1b86f2){return function(_0x596b7d){if(_0x596b7d){return _0x596b7d[_0x84d6('0x22')]()[_0x84d6('0x23')](function(){_0x26e753[_0x84d6('0x18')](0xcc)[_0x84d6('0x17')]();});}};}function handleEntityNotFound(_0x5deaa5,_0x282fbb){return function(_0x5d9284){if(!_0x5d9284){_0x5deaa5[_0x84d6('0x16')](0x194);}return _0x5d9284;};}function handleError(_0x19b6aa,_0x548ba5){_0x548ba5=_0x548ba5||0x1f4;return function(_0x500a81){logger[_0x84d6('0x24')](_0x500a81['stack']);if(_0x500a81['name']){delete _0x500a81[_0x84d6('0x25')];}_0x19b6aa['status'](_0x548ba5)[_0x84d6('0x26')](_0x500a81);};}exports['index']=function(_0x773fd0,_0x2c76e2){var _0x329926={},_0x37adf9={},_0x7c0074={'count':0x0,'rows':[]};var _0x125a2a=_[_0x84d6('0x27')](db[_0x84d6('0x28')][_0x84d6('0x29')],function(_0x1ebff2){return{'name':_0x1ebff2[_0x84d6('0x2a')],'type':_0x1ebff2[_0x84d6('0x2b')]['key']};});_0x37adf9[_0x84d6('0x2c')]=_[_0x84d6('0x27')](_0x125a2a,_0x84d6('0x25'));_0x37adf9[_0x84d6('0x2d')]=_[_0x84d6('0x2e')](_0x773fd0[_0x84d6('0x2d')]);_0x37adf9[_0x84d6('0x2f')]=_[_0x84d6('0x30')](_0x37adf9['model'],_0x37adf9[_0x84d6('0x2d')]);_0x329926['attributes']=_[_0x84d6('0x30')](_0x37adf9[_0x84d6('0x2c')],qs['fields'](_0x773fd0[_0x84d6('0x2d')][_0x84d6('0x31')]));_0x329926['attributes']=_0x329926[_0x84d6('0x32')][_0x84d6('0x33')]?_0x329926[_0x84d6('0x32')]:_0x37adf9[_0x84d6('0x2c')];if(!_0x773fd0[_0x84d6('0x2d')]['hasOwnProperty'](_0x84d6('0x34'))){_0x329926[_0x84d6('0x1c')]=qs[_0x84d6('0x1c')](_0x773fd0['query'][_0x84d6('0x1c')]);_0x329926['offset']=qs[_0x84d6('0x1a')](_0x773fd0['query']['offset']);}_0x329926[_0x84d6('0x35')]=qs[_0x84d6('0x36')](_0x773fd0[_0x84d6('0x2d')]['sort']);_0x329926[_0x84d6('0x37')]=qs[_0x84d6('0x2f')](_[_0x84d6('0x38')](_0x773fd0['query'],_0x37adf9['filters']),_0x125a2a);if(_0x773fd0['query'][_0x84d6('0x39')]){_0x329926[_0x84d6('0x37')]=_[_0x84d6('0x3a')](_0x329926[_0x84d6('0x37')],{'$or':_[_0x84d6('0x27')](_0x125a2a,function(_0x3b1dd2){if(_0x3b1dd2['type']!=='VIRTUAL'){var _0x30836a={};_0x30836a[_0x3b1dd2[_0x84d6('0x25')]]={'$like':'%'+_0x773fd0[_0x84d6('0x2d')][_0x84d6('0x39')]+'%'};return _0x30836a;}})});}_0x329926=_[_0x84d6('0x3a')]({},_0x329926,_0x773fd0['options']);var _0x59ea9b={'where':_0x329926['where']};return db[_0x84d6('0x28')]['count'](_0x59ea9b)[_0x84d6('0x23')](function(_0x25dccd){_0x7c0074['count']=_0x25dccd;if(_0x773fd0[_0x84d6('0x2d')][_0x84d6('0x3b')]){_0x329926['include']=[{'all':!![]}];}return db[_0x84d6('0x28')][_0x84d6('0x3c')](_0x329926);})[_0x84d6('0x23')](function(_0x4596c6){_0x7c0074[_0x84d6('0x3d')]=_0x4596c6;return _0x7c0074;})['then'](respondWithFilteredResult(_0x2c76e2,_0x329926))[_0x84d6('0x3e')](handleError(_0x2c76e2,null));};exports['show']=function(_0x1165f9,_0x1930af){var _0x95c924={'raw':!![],'where':{'id':_0x1165f9[_0x84d6('0x3f')]['id']}},_0x56ff93={};_0x56ff93[_0x84d6('0x2c')]=_[_0x84d6('0x2e')](db[_0x84d6('0x28')][_0x84d6('0x29')]);_0x56ff93[_0x84d6('0x2d')]=_['keys'](_0x1165f9[_0x84d6('0x2d')]);_0x56ff93['filters']=_['intersection'](_0x56ff93['model'],_0x56ff93[_0x84d6('0x2d')]);_0x95c924['attributes']=_['intersection'](_0x56ff93[_0x84d6('0x2c')],qs[_0x84d6('0x31')](_0x1165f9['query'][_0x84d6('0x31')]));_0x95c924[_0x84d6('0x32')]=_0x95c924[_0x84d6('0x32')][_0x84d6('0x33')]?_0x95c924[_0x84d6('0x32')]:_0x56ff93[_0x84d6('0x2c')];if(_0x1165f9['query']['includeAll']){_0x95c924[_0x84d6('0x40')]=[{'all':!![]}];}_0x95c924=_[_0x84d6('0x3a')]({},_0x95c924,_0x1165f9[_0x84d6('0x41')]);return db[_0x84d6('0x28')][_0x84d6('0x42')](_0x95c924)[_0x84d6('0x23')](handleEntityNotFound(_0x1930af,null))[_0x84d6('0x23')](respondWithResult(_0x1930af,null))['catch'](handleError(_0x1930af,null));};exports['create']=function(_0x1adbdc,_0x5a42fb){return db[_0x84d6('0x28')]['create'](_0x1adbdc[_0x84d6('0x43')],{})[_0x84d6('0x23')](respondWithResult(_0x5a42fb,0xc9))[_0x84d6('0x3e')](handleError(_0x5a42fb,null));};exports[_0x84d6('0x21')]=function(_0x4e4d67,_0x1aae95){if(_0x4e4d67['body']['id']){delete _0x4e4d67[_0x84d6('0x43')]['id'];}return db[_0x84d6('0x28')][_0x84d6('0x42')]({'where':{'id':_0x4e4d67['params']['id']}})['then'](handleEntityNotFound(_0x1aae95,null))[_0x84d6('0x23')](saveUpdates(_0x4e4d67['body'],null))['then'](respondWithResult(_0x1aae95,null))['catch'](handleError(_0x1aae95,null));};exports['destroy']=function(_0x5704cb,_0x12ea8b){return db['WhatsappApplication'][_0x84d6('0x42')]({'where':{'id':_0x5704cb[_0x84d6('0x3f')]['id']}})[_0x84d6('0x23')](handleEntityNotFound(_0x12ea8b,null))[_0x84d6('0x23')](removeEntity(_0x12ea8b,null))[_0x84d6('0x3e')](handleError(_0x12ea8b,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 69419f9..79230de 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 _0xeb5d=['../../config/logger','api','moment','path','rimraf','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','util'];(function(_0x56f2bd,_0x4539b9){var _0x1a3de4=function(_0x2e2629){while(--_0x2e2629){_0x56f2bd['push'](_0x56f2bd['shift']());}};_0x1a3de4(++_0x4539b9);}(_0xeb5d,0x16b));var _0xdeb5=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xeb5d[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require('lodash');var util=require(_0xdeb5('0x0'));var logger=require(_0xdeb5('0x1'))(_0xdeb5('0x2'));var moment=require(_0xdeb5('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdeb5('0x4'));var rimraf=require(_0xdeb5('0x5'));var config=require('../../config/environment');var attributes=require(_0xdeb5('0x6'));module[_0xdeb5('0x7')]=function(_0x164ecb,_0x33af72){return _0x164ecb[_0xdeb5('0x8')](_0xdeb5('0x9'),attributes,{'tableName':_0xdeb5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdeb5('0xb'),'collate':_0xdeb5('0xc')});}; \ No newline at end of file +var _0xfa2b=['exports','define','WhatsappApplication','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xfa2b,0x1b7));var _0xbfa2=function(_0x593237,_0xf756ba){_0x593237=_0x593237-0x0;var _0x5e3313=_0xfa2b[_0x593237];return _0x5e3313;};'use strict';var _=require(_0xbfa2('0x0'));var util=require(_0xbfa2('0x1'));var logger=require(_0xbfa2('0x2'))(_0xbfa2('0x3'));var moment=require(_0xbfa2('0x4'));var BPromise=require(_0xbfa2('0x5'));var rp=require(_0xbfa2('0x6'));var fs=require('fs');var path=require(_0xbfa2('0x7'));var rimraf=require(_0xbfa2('0x8'));var config=require(_0xbfa2('0x9'));var attributes=require(_0xbfa2('0xa'));module[_0xbfa2('0xb')]=function(_0x12d71e,_0x237a99){return _0x12d71e[_0xbfa2('0xc')](_0xbfa2('0xd'),attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbfa2('0xe'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 28e08f4..b903694 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 _0x81bd=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x138293,_0x197e7f){var _0x34c4a2=function(_0x20192b){while(--_0x20192b){_0x138293['push'](_0x138293['shift']());}};_0x34c4a2(++_0x197e7f);}(_0x81bd,0x7c));var _0xd81b=function(_0x46e82f,_0x8ff37e){_0x46e82f=_0x46e82f-0x0;var _0x14323c=_0x81bd[_0x46e82f];return _0x14323c;};'use strict';var _=require(_0xd81b('0x0'));var util=require(_0xd81b('0x1'));var moment=require(_0xd81b('0x2'));var BPromise=require(_0xd81b('0x3'));var rs=require(_0xd81b('0x4'));var fs=require('fs');var Redis=require(_0xd81b('0x5'));var db=require(_0xd81b('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd81b('0x7'))(_0xd81b('0x8'));var config=require(_0xd81b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd81b('0xa')][_0xd81b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f3f2c,_0x562084,_0x5e14e8){return new BPromise(function(_0xa4cf97,_0x5468d5){return client[_0xd81b('0xc')](_0x1f3f2c,_0x5e14e8)[_0xd81b('0xd')](function(_0x3420a7){logger[_0xd81b('0xe')](_0xd81b('0xf'),_0x562084,_0xd81b('0x10'));logger[_0xd81b('0x11')](_0xd81b('0x12'),_0x562084,_0xd81b('0x10'),JSON[_0xd81b('0x13')](_0x3420a7));if(_0x3420a7[_0xd81b('0x14')]){if(_0x3420a7[_0xd81b('0x14')][_0xd81b('0x15')]===0x1f4){logger['error'](_0xd81b('0xf'),_0x562084,_0x3420a7['error'][_0xd81b('0x16')]);return _0x5468d5(_0x3420a7[_0xd81b('0x14')]['message']);}logger[_0xd81b('0x14')]('WhatsappApplication,\x20%s,\x20%s',_0x562084,_0x3420a7[_0xd81b('0x14')][_0xd81b('0x16')]);return _0xa4cf97(_0x3420a7[_0xd81b('0x14')][_0xd81b('0x16')]);}else{logger[_0xd81b('0xe')]('WhatsappApplication,\x20%s,\x20%s',_0x562084,_0xd81b('0x10'));_0xa4cf97(_0x3420a7[_0xd81b('0x17')]['message']);}})[_0xd81b('0x18')](function(_0x26df61){logger[_0xd81b('0x14')](_0xd81b('0xf'),_0x562084,_0x26df61);_0x5468d5(_0x26df61);});});} \ No newline at end of file +var _0x9c44=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','code','error','message','WhatsappApplication,\x20%s,\x20%s','info','result','catch','moment','bluebird'];(function(_0x5490e0,_0x209f15){var _0x5dc5fb=function(_0x2393b1){while(--_0x2393b1){_0x5490e0['push'](_0x5490e0['shift']());}};_0x5dc5fb(++_0x209f15);}(_0x9c44,0x178));var _0x49c4=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x9c44[_0x465a0c];return _0x1e202e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69bc41,_0x2c4e2e,_0x436234){return new BPromise(function(_0x511d53,_0x11c586){return client[_0x49c4('0x9')](_0x69bc41,_0x436234)[_0x49c4('0xa')](function(_0x4487ca){logger['info']('WhatsappApplication,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'),JSON[_0x49c4('0xd')](_0x4487ca));if(_0x4487ca['error']){if(_0x4487ca['error'][_0x49c4('0xe')]===0x1f4){logger[_0x49c4('0xf')]('WhatsappApplication,\x20%s,\x20%s',_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x11c586(_0x4487ca['error'][_0x49c4('0x10')]);}logger[_0x49c4('0xf')](_0x49c4('0x11'),_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x511d53(_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);}else{logger[_0x49c4('0x12')]('WhatsappApplication,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index e327f1e..4f2ea9d 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 _0x1115=['get','show','download','post','create','/:id/messages','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe'];(function(_0x4aa2c9,_0x3c74e5){var _0x212e33=function(_0x20f06a){while(--_0x20f06a){_0x4aa2c9['push'](_0x4aa2c9['shift']());}};_0x212e33(++_0x3c74e5);}(_0x1115,0x1b6));var _0x5111=function(_0x51e045,_0x5db996){_0x51e045=_0x51e045-0x0;var _0x1610d5=_0x1115[_0x51e045];return _0x1610d5;};'use strict';var multer=require('multer');var util=require(_0x5111('0x0'));var path=require(_0x5111('0x1'));var timeout=require(_0x5111('0x2'));var express=require(_0x5111('0x3'));var router=express[_0x5111('0x4')]();var fs_extra=require(_0x5111('0x5'));var auth=require(_0x5111('0x6'));var interaction=require(_0x5111('0x7'));var config=require(_0x5111('0x8'));var controller=require('./whatsappInteraction.controller');router['get']('/',auth[_0x5111('0x9')](),controller[_0x5111('0xa')]);router['get'](_0x5111('0xb'),auth[_0x5111('0x9')](),controller['describe']);router[_0x5111('0xc')]('/:id',auth[_0x5111('0x9')](),controller[_0x5111('0xd')]);router['get']('/:id/messages',auth[_0x5111('0x9')](),controller['getMessages']);router[_0x5111('0xc')]('/:id/download',auth[_0x5111('0x9')](),controller[_0x5111('0xe')]);router[_0x5111('0xf')]('/',auth[_0x5111('0x9')](),controller[_0x5111('0x10')]);router[_0x5111('0xf')](_0x5111('0x11'),auth[_0x5111('0x9')](),controller[_0x5111('0x12')]);router[_0x5111('0xf')](_0x5111('0x13'),auth[_0x5111('0x9')](),interaction[_0x5111('0x14')](_0x5111('0x15'),_0x5111('0x16')),controller[_0x5111('0x17')]);router[_0x5111('0x18')](_0x5111('0x19'),auth['isAuthenticated'](),interaction[_0x5111('0x14')]('whatsapp','whatsappinteraction:update'),controller[_0x5111('0x1a')]);router[_0x5111('0x1b')](_0x5111('0x19'),auth['isAuthenticated'](),interaction[_0x5111('0x14')](_0x5111('0x15'),'whatsappinteraction:destroy'),controller[_0x5111('0x1c')]);router[_0x5111('0x1b')](_0x5111('0x13'),auth[_0x5111('0x9')](),controller['removeTags']);module[_0x5111('0x1d')]=router; \ No newline at end of file +var _0xfc17=['create','/:id/messages','addMessage','/:id/tags','whatsapp','whatsappinteraction:addtags','addTags','put','/:id','tracked','whatsappinteraction:update','update','destroy','delete','removeTags','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','isAuthenticated','index','get','/describe','describe','show','/:id/download','download','post'];(function(_0x1292a0,_0xb4c065){var _0x4b6ae9=function(_0x32a1e5){while(--_0x32a1e5){_0x1292a0['push'](_0x1292a0['shift']());}};_0x4b6ae9(++_0xb4c065);}(_0xfc17,0x1b4));var _0x7fc1=function(_0x5c715d,_0x1775c5){_0x5c715d=_0x5c715d-0x0;var _0x4c1a68=_0xfc17[_0x5c715d];return _0x4c1a68;};'use strict';var multer=require(_0x7fc1('0x0'));var util=require(_0x7fc1('0x1'));var path=require(_0x7fc1('0x2'));var timeout=require(_0x7fc1('0x3'));var express=require('express');var router=express[_0x7fc1('0x4')]();var fs_extra=require(_0x7fc1('0x5'));var auth=require(_0x7fc1('0x6'));var interaction=require(_0x7fc1('0x7'));var config=require(_0x7fc1('0x8'));var controller=require(_0x7fc1('0x9'));router['get']('/',auth[_0x7fc1('0xa')](),controller[_0x7fc1('0xb')]);router[_0x7fc1('0xc')](_0x7fc1('0xd'),auth[_0x7fc1('0xa')](),controller[_0x7fc1('0xe')]);router[_0x7fc1('0xc')]('/:id',auth[_0x7fc1('0xa')](),controller[_0x7fc1('0xf')]);router[_0x7fc1('0xc')]('/:id/messages',auth[_0x7fc1('0xa')](),controller['getMessages']);router['get'](_0x7fc1('0x10'),auth[_0x7fc1('0xa')](),controller[_0x7fc1('0x11')]);router[_0x7fc1('0x12')]('/',auth[_0x7fc1('0xa')](),controller[_0x7fc1('0x13')]);router[_0x7fc1('0x12')](_0x7fc1('0x14'),auth[_0x7fc1('0xa')](),controller[_0x7fc1('0x15')]);router[_0x7fc1('0x12')](_0x7fc1('0x16'),auth['isAuthenticated'](),interaction['tracked'](_0x7fc1('0x17'),_0x7fc1('0x18')),controller[_0x7fc1('0x19')]);router[_0x7fc1('0x1a')](_0x7fc1('0x1b'),auth[_0x7fc1('0xa')](),interaction[_0x7fc1('0x1c')](_0x7fc1('0x17'),_0x7fc1('0x1d')),controller[_0x7fc1('0x1e')]);router['delete'](_0x7fc1('0x1b'),auth['isAuthenticated'](),interaction[_0x7fc1('0x1c')](_0x7fc1('0x17'),'whatsappinteraction:destroy'),controller[_0x7fc1('0x1f')]);router[_0x7fc1('0x20')]('/:id/tags',auth[_0x7fc1('0xa')](),controller[_0x7fc1('0x21')]);module[_0x7fc1('0x22')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 02bf409..e0328ca 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 _0x8ba0=['moment','exports','BOOLEAN','DATE','STRING','ENUM','out','sequelize'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x8ba0,0x1c7));var _0x08ba=function(_0x2d80af,_0x5d16ff){_0x2d80af=_0x2d80af-0x0;var _0x441e11=_0x8ba0[_0x2d80af];return _0x441e11;};'use strict';var Sequelize=require(_0x08ba('0x0'));var moment=require(_0x08ba('0x1'));module[_0x08ba('0x2')]={'closed':{'type':Sequelize[_0x08ba('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x08ba('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x08ba('0x5')]},'note':{'type':Sequelize[_0x08ba('0x5')]},'phone':{'type':Sequelize[_0x08ba('0x5')]},'read1stAt':{'type':Sequelize[_0x08ba('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x08ba('0x6')]('in',_0x08ba('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x08ba('0x6')]('in',_0x08ba('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x08ba('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xbcba=['DATE','STRING','ENUM','out','sequelize','moment','BOOLEAN'];(function(_0x348652,_0x1ab849){var _0x18a9ea=function(_0x3fd540){while(--_0x3fd540){_0x348652['push'](_0x348652['shift']());}};_0x18a9ea(++_0x1ab849);}(_0xbcba,0x6d));var _0xabcb=function(_0x5eca14,_0x4a9fc7){_0x5eca14=_0x5eca14-0x0;var _0x3d2fbc=_0xbcba[_0x5eca14];return _0x3d2fbc;};'use strict';var Sequelize=require(_0xabcb('0x0'));var moment=require(_0xabcb('0x1'));module['exports']={'closed':{'type':Sequelize[_0xabcb('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xabcb('0x3')]},'disposition':{'type':Sequelize[_0xabcb('0x4')]},'secondDisposition':{'type':Sequelize[_0xabcb('0x4')]},'thirdDisposition':{'type':Sequelize[_0xabcb('0x4')]},'note':{'type':Sequelize[_0xabcb('0x4')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xabcb('0x5')]('in',_0xabcb('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xabcb('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xabcb('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index d816c51..aacbe49 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 _0x4991=['createWriteStream','out','System','lastName','direction','views','downloadInteraction.ejs','transcript-','Whatsapp','createPdfFromHTML','log','err','unlinkSync','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../mysqldb','redis','defaults','localhost','./whatsappInteraction.socket','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','Users','map','fullname','TagIds','Tags','split','forEach','push','catch','waiting','talking','answered','unmanaged','UserId','closed','total','index','WhatsappInteraction','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','select','field','color','tools_tags','u.fullname','from','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','whatsapp_accounts','whatsapp_messages','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','sqlOperator','conditions','unreadMessages','value','having','`\x20>\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','find','ContactId','buildExpression','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','body','some','compact','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','parse','$gte','$lte','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','getFullTextValue','i.id','Sequelize','QueryTypes','SELECT','clone','DESC','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','agent','sequelize','toString','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.firstName','Contact.firstName','Contact.lastName','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','all','rows','params','options','create','addMessage','ids','findOne','WhatsappMessage','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','include','findAll','addTags','setTags','spread','emit','whatsappInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','transcript-%d-%s.zip','CmContact','firstName','attachments','Attachment','Messages','secret','WhatsappAccount','Account','Owner','get','mkdirSync','createdAt','closedAt','disposition','basename','existsSync','createReadStream','pipe'];(function(_0x371ff7,_0x2d7222){var _0x318124=function(_0x150cdd){while(--_0x150cdd){_0x371ff7['push'](_0x371ff7['shift']());}};_0x318124(++_0x2d7222);}(_0x4991,0xf7));var _0x1499=function(_0x14db1e,_0x118e49){_0x14db1e=_0x14db1e-0x0;var _0x4fe0d9=_0x4991[_0x14db1e];return _0x4fe0d9;};'use strict';var emlformat=require(_0x1499('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1499('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1499('0x2'));var moment=require(_0x1499('0x3'));var BPromise=require(_0x1499('0x4'));var Mustache=require(_0x1499('0x5'));var util=require(_0x1499('0x6'));var path=require(_0x1499('0x7'));var sox=require(_0x1499('0x8'));var csv=require(_0x1499('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1499('0xa'));var _=require(_0x1499('0xb'));var squel=require(_0x1499('0xc'));var crypto=require(_0x1499('0xd'));var jsforce=require(_0x1499('0xe'));var deskjs=require(_0x1499('0xf'));var toCsv=require(_0x1499('0x9'));var querystring=require(_0x1499('0x10'));var Papa=require('papaparse');var Redis=require(_0x1499('0x11'));var authService=require(_0x1499('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1499('0x13'));var pdf=require(_0x1499('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1499('0x15'))(_0x1499('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1499('0x17'))['db'];config[_0x1499('0x18')]=_[_0x1499('0x19')](config[_0x1499('0x18')],{'host':_0x1499('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x1499('0x1b'))['register'](socket);function respondWithStatusCode(_0x37d99e,_0x12cde0){_0x12cde0=_0x12cde0||0xcc;return function(_0x308318){if(_0x308318){return _0x37d99e[_0x1499('0x1c')](_0x12cde0);}return _0x37d99e['status'](_0x12cde0)[_0x1499('0x1d')]();};}function respondWithResult(_0x373f57,_0x592c27){_0x592c27=_0x592c27||0xc8;return function(_0x25164c){if(_0x25164c){return _0x373f57[_0x1499('0x1e')](_0x592c27)[_0x1499('0x1f')](_0x25164c);}};}function respondWithFilteredResult(_0xc92272,_0x1e45a9){return function(_0x27e533){if(_0x27e533){var _0x5b9859=typeof _0x1e45a9['offset']==='undefined'&&typeof _0x1e45a9[_0x1499('0x20')]===_0x1499('0x21');var _0x4a4e28=_0x27e533[_0x1499('0x22')];var _0x3c13a1=_0x5b9859?0x0:_0x1e45a9[_0x1499('0x23')];var _0x18e4a6=_0x5b9859?_0x27e533[_0x1499('0x22')]:_0x1e45a9[_0x1499('0x23')]+_0x1e45a9[_0x1499('0x20')];var _0x253439;if(_0x18e4a6>=_0x4a4e28){_0x18e4a6=_0x4a4e28;_0x253439=0xc8;}else{_0x253439=0xce;}_0xc92272[_0x1499('0x1e')](_0x253439);return _0xc92272[_0x1499('0x24')](_0x1499('0x25'),_0x3c13a1+'-'+_0x18e4a6+'/'+_0x4a4e28)[_0x1499('0x1f')](_0x27e533);}return null;};}function patchUpdates(_0x223f4c){return function(_0x3b73f6){try{jsonpatch[_0x1499('0x26')](_0x3b73f6,_0x223f4c,!![]);}catch(_0x1e2c51){return BPromise[_0x1499('0x27')](_0x1e2c51);}return _0x3b73f6['save']();};}function saveUpdates(_0x258e9c,_0xc79f69){return function(_0x30f014){if(_0x30f014){return _0x30f014[_0x1499('0x28')](_0x258e9c)[_0x1499('0x29')](function(_0x16d036){return _0x16d036;});}return null;};}function removeEntity(_0x54f3c2,_0x501c0d){return function(_0x12739b){if(_0x12739b){return _0x12739b[_0x1499('0x2a')]()[_0x1499('0x29')](function(){_0x54f3c2[_0x1499('0x1e')](0xcc)[_0x1499('0x1d')]();});}};}function handleEntityNotFound(_0x525d6f,_0x3e5ed1){return function(_0x573b51){if(!_0x573b51){_0x525d6f['sendStatus'](0x194);}return _0x573b51;};}function handleError(_0x516f29,_0x21d204){_0x21d204=_0x21d204||0x1f4;return function(_0x103efa){logger[_0x1499('0x2b')](_0x103efa[_0x1499('0x2c')]);if(_0x103efa[_0x1499('0x2d')]){delete _0x103efa[_0x1499('0x2d')];}_0x516f29[_0x1499('0x1e')](_0x21d204)['send'](_0x103efa);};}function getInteractionUsers(_0x180171,_0x1a2c99){return new BPromise(function(_0x39995b,_0x5b59ea){try{if(_0x1a2c99[_0x180171['id']]){_0x180171[_0x1499('0x2e')]=_[_0x1499('0x2f')](_0x1a2c99[_0x180171['id']],function(_0x5d4cb1){return{'id':_0x5d4cb1['id'],'fullname':_0x5d4cb1[_0x1499('0x30')]};});}}catch(_0x72ad){_0x5b59ea(_0x72ad);}_0x39995b(_0x180171);});}function getInteractionTags(_0x497efd,_0x464c5a){return new BPromise(function(_0x2eda80,_0x15cc57){try{if(_0x497efd[_0x1499('0x31')]){_0x497efd[_0x1499('0x32')]=[];_0x497efd[_0x1499('0x31')][_0x1499('0x33')](',')[_0x1499('0x34')](function(_0x11767f){_0x497efd[_0x1499('0x32')][_0x1499('0x35')](_0x464c5a[_0x11767f]);});}delete _0x497efd[_0x1499('0x31')];}catch(_0xdd10ad){_0x15cc57(_0xdd10ad);}_0x2eda80(_0x497efd);});}function updateWhatsappInteraction(_0x3f4c1a,_0x2764ba,_0x197afc){return new BPromise(function(_0x417dd1,_0x32cd10){return getInteractionUsers(_0x3f4c1a,_0x197afc)[_0x1499('0x29')](function(_0x29e89e){return getInteractionTags(_0x29e89e,_0x2764ba);})['then'](function(_0x3348bc){return getStateInteraction(_0x3348bc);})[_0x1499('0x29')](function(_0x45685c){_0x417dd1(_0x45685c);})[_0x1499('0x36')](function(_0x31251c){_0x32cd10(_0x31251c);});});}function getStateInteraction(_0x136002){return new BPromise(function(_0x351ed3){_0x136002[_0x1499('0x37')]=0x0;_0x136002[_0x1499('0x38')]=0x0;_0x136002[_0x1499('0x39')]=0x0;_0x136002[_0x1499('0x3a')]=0x0;_0x136002['total']=0x0;if(!_0x136002['closed']&&!_0x136002[_0x1499('0x3b')]){_0x136002['waiting']+=0x1;}if(!_0x136002[_0x1499('0x3c')]&&_0x136002['UserId']){_0x136002[_0x1499('0x38')]+=0x1;if(_0x136002[_0x1499('0x37')]){_0x136002[_0x1499('0x37')]-=0x1;}}if(_0x136002[_0x1499('0x3c')]&&_0x136002['UserId']){_0x136002[_0x1499('0x39')]+=0x1;if(_0x136002['talking']){_0x136002[_0x1499('0x38')]-=0x1;}}if(_0x136002[_0x1499('0x3c')]&&!_0x136002[_0x1499('0x3b')]){_0x136002[_0x1499('0x3a')]+=0x1;if(_0x136002['waiting']){_0x136002[_0x1499('0x37')]-=0x1;}}_0x136002[_0x1499('0x3d')]+=0x1;_0x351ed3(_0x136002);});}exports[_0x1499('0x3e')]=function(_0x3b67a7,_0x5c5835){var _0x3fac62={},_0x4cc411={},_0x3770b5={'count':0x0,'rows':[]};var _0x38f449=_[_0x1499('0x2f')](db[_0x1499('0x3f')][_0x1499('0x40')],function(_0x374e11){return{'name':_0x374e11[_0x1499('0x41')],'type':_0x374e11[_0x1499('0x42')][_0x1499('0x43')]};});_0x4cc411[_0x1499('0x44')]=_['map'](_0x38f449,_0x1499('0x2d'));_0x4cc411['query']=_[_0x1499('0x45')](_0x3b67a7[_0x1499('0x46')]);_0x4cc411['filters']=_[_0x1499('0x47')](_0x4cc411[_0x1499('0x44')],_0x4cc411[_0x1499('0x46')]);_0x3fac62[_0x1499('0x48')]=_[_0x1499('0x47')](_0x4cc411['model'],qs['fields'](_0x3b67a7[_0x1499('0x46')][_0x1499('0x49')]));_0x3fac62['attributes']=_0x3fac62[_0x1499('0x48')][_0x1499('0x4a')]?_0x3fac62['attributes']:_0x4cc411['model'];if(!_0x3b67a7[_0x1499('0x46')][_0x1499('0x4b')](_0x1499('0x4c'))){_0x3fac62['limit']=qs[_0x1499('0x20')](_0x3b67a7[_0x1499('0x46')][_0x1499('0x20')]);_0x3fac62[_0x1499('0x23')]=qs['offset'](_0x3b67a7[_0x1499('0x46')][_0x1499('0x23')]);}_0x3fac62[_0x1499('0x4d')]=qs[_0x1499('0x4e')](_0x3b67a7['query'][_0x1499('0x4e')]);_0x3fac62[_0x1499('0x4f')]=qs[_0x1499('0x50')](_['pick'](_0x3b67a7['query'],_0x4cc411[_0x1499('0x50')]),_0x38f449);var _0x491777=[];var _0x7fa101=squel[_0x1499('0x51')]()[_0x1499('0x52')]('id')[_0x1499('0x52')](_0x1499('0x2d'))[_0x1499('0x52')](_0x1499('0x53'))['from'](_0x1499('0x54'));var _0x4c81db=squel[_0x1499('0x51')]()[_0x1499('0x52')]('u.id')[_0x1499('0x52')](_0x1499('0x55'))[_0x1499('0x52')]('ui.WhatsappInteractionId')[_0x1499('0x56')](_0x1499('0x57'),'ui')[_0x1499('0x58')](_0x1499('0x59'),'u',_0x1499('0x5a'));var _0x11aafe=squel[_0x1499('0x51')]()[_0x1499('0x56')](_0x1499('0x5b'),'i')[_0x1499('0x58')]('cm_contacts','c',_0x1499('0x5c'))[_0x1499('0x58')](_0x1499('0x59'),'o','o.id\x20=\x20i.UserId')[_0x1499('0x58')](_0x1499('0x5d'),'a','a.id\x20=\x20i.WhatsappAccountId')[_0x1499('0x58')](_0x1499('0x5e'),'me','me.WhatsappInteractionId\x20=\x20i.id')[_0x1499('0x58')](_0x1499('0x5f'),'it',_0x1499('0x60'))[_0x1499('0x58')](_0x1499('0x54'),'t',_0x1499('0x61'));var _0x10450f=squel['expr']();var _0x21653a=[];var _0x2a9f23=squel[_0x1499('0x62')]();var _0x175b8d;if(_0x3b67a7['query']['search']){_0x175b8d=as[_0x1499('0x63')](_0x3b67a7[_0x1499('0x46')]['search']);var _0x3c3a20=_0x175b8d[_0x1499('0x64')];for(var _0xf09b4c=0x0;_0xf09b4c<_0x175b8d['conditions']['length'];_0xf09b4c++){var _0x5b09a5=_0x175b8d[_0x1499('0x65')][_0xf09b4c];var _0x1f39f3='i';var _0x2d1c32=_['find'](_0x38f449,[_0x1499('0x2d'),_0x5b09a5['field']]);if(!_0x2d1c32){switch(_0x5b09a5[_0x1499('0x52')]){case _0x1499('0x66'):if(_0x5b09a5[_0x1499('0x67')]==0x1){_0x11aafe[_0x1499('0x68')]('`'+_0x5b09a5['field']+'`\x20=\x200');}else{_0x11aafe['having']('`'+_0x5b09a5[_0x1499('0x52')]+_0x1499('0x69'));}break;case _0x1499('0x6a'):if(_0x5b09a5[_0x1499('0x6b')]==='$substring'){if(_0x5b09a5[_0x1499('0x67')][_0x1499('0x33')]('\x20')['length']>0x1){_0x10450f[_0x3c3a20](_0x1499('0x6c'),qs['getFullTextValue'](_0x5b09a5[_0x1499('0x67')]),null);}else{var _0x3122a7='%'+_0x5b09a5[_0x1499('0x67')]+'%';_0x10450f[_0x3c3a20]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x3122a7,_0x3122a7,_0x3122a7);}}else{_0x2d1c32=_[_0x1499('0x6d')](_0x38f449,[_0x1499('0x2d'),_0x1499('0x6e')]);_0x5b09a5['field']=_0x1499('0x6e');_0x41a528=as[_0x1499('0x6f')](_0x1f39f3,_0x2d1c32[_0x1499('0x42')],_0x5b09a5);_0x10450f[_0x3c3a20](_0x41a528['text'],_0x41a528[_0x1499('0x67')][_0x1499('0x70')],_0x41a528[_0x1499('0x67')][_0x1499('0x1d')]);}break;case _0x1499('0x71'):var _0x96a0ed=_0x5b09a5['value'][_0x1499('0x33')](',')[_0x1499('0x2f')](function(_0x4d6165){return Number(_0x4d6165);});_0x96a0ed[_0x1499('0x34')](function(_0x258555){_0x2a9f23['or'](_0x1499('0x72'),'%,'+_0x258555+',%');});_0x21653a=_[_0x1499('0x73')](_0x21653a,_0x96a0ed);break;case _0x1499('0x74'):if(_0x5b09a5[_0x1499('0x6b')]==='$substring'){_0x10450f[_0x3c3a20](_0x1499('0x75'),'%'+_0x5b09a5[_0x1499('0x67')]+'%',null);}else{_0x2d1c32=_[_0x1499('0x6d')](_0x38f449,['name',_0x1499('0x3b')]);_0x5b09a5[_0x1499('0x52')]='UserId';_0x41a528=as[_0x1499('0x6f')](_0x1f39f3,_0x2d1c32[_0x1499('0x42')],_0x5b09a5);_0x10450f[_0x3c3a20](_0x41a528[_0x1499('0x76')],_0x41a528[_0x1499('0x67')][_0x1499('0x70')],_0x41a528['value']['end']);}break;case _0x1499('0x77'):_0x41a528=as['buildExpression']('me',null,_0x5b09a5);_0x10450f[_0x3c3a20](_0x41a528['text'],_0x41a528[_0x1499('0x67')][_0x1499('0x70')],_0x41a528['value'][_0x1499('0x1d')]);break;}}else{var _0x41a528=as[_0x1499('0x6f')](_0x1f39f3,_0x2d1c32['type'],_0x5b09a5);_0x10450f[_0x3c3a20](_0x41a528['text'],_0x41a528[_0x1499('0x67')][_0x1499('0x70')],_0x41a528[_0x1499('0x67')][_0x1499('0x1d')]);}}}else{var _0x2fc244=_(_0x3b67a7['query'])[_0x1499('0x45')]()[_0x1499('0x2f')](function(_0x57bb71){return _[_0x1499('0x78')](_0x38f449,[_0x1499('0x2d'),_0x57bb71])?_0x57bb71:undefined;})[_0x1499('0x79')]()['value']();if(!_[_0x1499('0x7a')](_0x2fc244)){_0x2fc244[_0x1499('0x34')](function(_0x1ee6fe){if(_0x1ee6fe===_0x1499('0x7b')){_0x11aafe['where'](_0x1499('0x7c'),[][_0x1499('0x7d')](_0x3b67a7[_0x1499('0x46')][_0x1ee6fe]));}else if(_0x1ee6fe==='createdAt'){var _0x377ba4=JSON[_0x1499('0x7e')](_0x3b67a7[_0x1499('0x46')][_0x1ee6fe])[_0x1499('0x7f')];var _0x199516=JSON[_0x1499('0x7e')](_0x3b67a7['query'][_0x1ee6fe])[_0x1499('0x80')];_0x11aafe['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x377ba4,_0x199516);}else{if(_0x3b67a7[_0x1499('0x46')][_0x1ee6fe]===_0x1499('0x81')){_0x11aafe[_0x1499('0x4f')]('i.'+_0x1ee6fe+'\x20IS\x20NULL');}else{_0x11aafe['where']('i.'+_0x1ee6fe+_0x1499('0x82'),_0x3b67a7[_0x1499('0x46')][_0x1ee6fe]);}}});}if(_0x3b67a7['query'][_0x1499('0x83')]){if(_0x3b67a7[_0x1499('0x46')][_0x1499('0x83')]==0x1){_0x11aafe[_0x1499('0x68')](_0x1499('0x84'));}else{_0x11aafe[_0x1499('0x68')](_0x1499('0x85'));}}if(_0x3b67a7['query'][_0x1499('0x86')]){_0x21653a=_[_0x1499('0x87')](_0x3b67a7['query'][_0x1499('0x86')])?_0x3b67a7['query'][_0x1499('0x86')]:new Array(_0x3b67a7[_0x1499('0x46')][_0x1499('0x86')]);_0x21653a[_0x1499('0x34')](function(_0x5e8a06){_0x2a9f23['or'](_0x1499('0x72'),'%,'+_0x5e8a06+',%');});}if(_0x3b67a7['query'][_0x1499('0x88')]){var _0x482da0=_0x3b67a7[_0x1499('0x46')][_0x1499('0x88')][_0x1499('0x89')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x1499('0x8a')](_0x482da0)){_0x10450f['or'](_0x1499('0x8b'),_0x482da0+'%')['or']('i.phone\x20LIKE\x20?',_0x482da0+'%');}else{_0x10450f['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x1499('0x8c')](_0x482da0))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x482da0+'%');}}}_0x11aafe[_0x1499('0x4f')](_0x10450f);_0x11aafe['group'](_0x1499('0x8d'));var _0x4e8798={'type':db[_0x1499('0x8e')][_0x1499('0x8f')][_0x1499('0x90')],'raw':!![]};var _0x1c8a8a=_0x11aafe[_0x1499('0x91')]();_0x1c8a8a[_0x1499('0x52')](_0x1499('0x8d'));_0x1c8a8a[_0x1499('0x52')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x1499('0x66'));if(_0x3fac62[_0x1499('0x4d')]){_0x3fac62[_0x1499('0x4d')]['forEach'](function(_0x408399){var _0x428312=_0x408399[0x0]==='contactName'?_0x408399[0x0]:'i.'+_0x408399[0x0];_0x11aafe[_0x1499('0x4d')](_0x428312,_0x408399[0x1]===_0x1499('0x92')?![]:!![]);});}if(!_[_0x1499('0x7a')](_0x21653a)){_0x11aafe[_0x1499('0x68')](_0x2a9f23);_0x1c8a8a[_0x1499('0x4f')]('t.id\x20IN\x20?',_0x21653a);}BPromise[_0x1499('0x93')]()['then'](function(){if(!_0x175b8d){if(_0x3b67a7['query'][_0x1499('0x7b')])return;_0x1c8a8a[_0x1499('0x4f')](_0x1499('0x94'));_0x11aafe[_0x1499('0x4f')](_0x1499('0x94'));return;}if(_0x3b67a7[_0x1499('0x95')][_0x1499('0x96')]!=='agent')return;return _0x3b67a7['user'][_0x1499('0x97')]({'attributes':['id'],'raw':!![]})[_0x1499('0x29')](function(_0x511c3c){if(_[_0x1499('0x7a')](_0x511c3c)){_0x1c8a8a['where'](_0x1499('0x98'));_0x11aafe['where'](_0x1499('0x98'));}else{_0x1c8a8a['where'](_0x1499('0x7c'),_['map'](_0x511c3c,'id'));_0x11aafe[_0x1499('0x4f')](_0x1499('0x7c'),_['map'](_0x511c3c,'id'));}});})[_0x1499('0x29')](function(){if(_0x3b67a7[_0x1499('0x95')]['role']===_0x1499('0x99')&&!_0x175b8d&&!_0x3b67a7[_0x1499('0x46')][_0x1499('0x7b')])return[];return db[_0x1499('0x9a')][_0x1499('0x46')](_0x1c8a8a[_0x1499('0x9b')](),_0x4e8798);})[_0x1499('0x29')](function(_0x5e95ca){_0x3770b5[_0x1499('0x22')]=_0x5e95ca[_0x1499('0x4a')];if(_0x3770b5['count']===0x0)return[];return db[_0x1499('0x9a')][_0x1499('0x46')](_0x7fa101['toString'](),_0x4e8798)[_0x1499('0x29')](function(_0x2d6a31){_0x491777=_['keyBy'](_0x2d6a31,'id');_0x4e8798=_[_0x1499('0x9c')](_0x4e8798,{'model':db[_0x1499('0x3f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3b67a7[_0x1499('0x46')][_0x1499('0x49')]){_0x3fac62[_0x1499('0x48')][_0x1499('0x34')](function(_0x1f4794){_0x11aafe[_0x1499('0x52')]('i.'+_0x1f4794);});}else{_0x11aafe['field'](_0x1499('0x9d'),_0x1499('0x66'));_0x11aafe[_0x1499('0x52')](_0x1499('0x9e'),_0x1499('0x9f'));_0x11aafe[_0x1499('0x52')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0x11aafe['field'](_0x1499('0xa0'),_0x1499('0xa1'));_0x11aafe[_0x1499('0x52')](_0x1499('0xa2'));_0x11aafe[_0x1499('0x52')](_0x1499('0xa3'),_0x1499('0xa4'));_0x11aafe[_0x1499('0x52')]('c.lastName',_0x1499('0xa5'));_0x11aafe[_0x1499('0x52')]('c.email','Contact.email');_0x11aafe[_0x1499('0x52')]('c.phone','Contact.phone');_0x11aafe['field'](_0x1499('0xa6'),_0x1499('0xa7'));_0x11aafe[_0x1499('0x52')](_0x1499('0xa8'),_0x1499('0xa9'));_0x11aafe['field']('o.fullname',_0x1499('0xaa'));_0x11aafe[_0x1499('0x52')](_0x1499('0xab'),'Owner.internal');_0x11aafe[_0x1499('0x52')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x3fac62[_0x1499('0x20')])_0x11aafe['limit'](_0x3fac62[_0x1499('0x20')]);if(_0x3fac62['offset'])_0x11aafe[_0x1499('0x23')](_0x3fac62['offset']);return db[_0x1499('0x9a')][_0x1499('0x46')](_0x11aafe['toString'](),_0x4e8798);})[_0x1499('0x29')](function(_0x5c0452){if(_0x5c0452[_0x1499('0x4a')]>0x0)_0x4c81db[_0x1499('0x4f')](_0x1499('0xac'),_[_0x1499('0x2f')](_0x5c0452,'id'));return db[_0x1499('0x9a')][_0x1499('0x46')](_0x4c81db[_0x1499('0x9b')](),_0x4e8798)[_0x1499('0x29')](function(_0x14a97d){var _0x9d41a6=_[_0x1499('0xad')](_0x14a97d,_0x1499('0xae'));var _0x2949af=[];_0x5c0452['forEach'](function(_0x1f0fde){_0x2949af[_0x1499('0x35')](updateWhatsappInteraction(_0x1f0fde,_0x491777,_0x9d41a6));});return BPromise[_0x1499('0xaf')](_0x2949af);});});})[_0x1499('0x29')](function(_0x4f6a5e){_0x3770b5[_0x1499('0xb0')]=_0x4f6a5e;return _0x3770b5;})[_0x1499('0x29')](respondWithFilteredResult(_0x5c5835,_0x3fac62))['catch'](handleError(_0x5c5835,null));};exports['show']=function(_0x13f203,_0x1fbf21){var _0x2d4e5a={'raw':![],'where':{'id':_0x13f203[_0x1499('0xb1')]['id']}},_0x17f528={};_0x17f528[_0x1499('0x44')]=_[_0x1499('0x45')](db[_0x1499('0x3f')][_0x1499('0x40')]);_0x17f528[_0x1499('0x46')]=_['keys'](_0x13f203['query']);_0x17f528['filters']=_[_0x1499('0x47')](_0x17f528[_0x1499('0x44')],_0x17f528[_0x1499('0x46')]);_0x2d4e5a[_0x1499('0x48')]=_[_0x1499('0x47')](_0x17f528[_0x1499('0x44')],qs['fields'](_0x13f203[_0x1499('0x46')][_0x1499('0x49')]));_0x2d4e5a[_0x1499('0x48')]=_0x2d4e5a['attributes']['length']?_0x2d4e5a[_0x1499('0x48')]:_0x17f528[_0x1499('0x44')];if(_0x13f203['query']['includeAll']){_0x2d4e5a['include']=[{'all':!![]}];}_0x2d4e5a=_[_0x1499('0x9c')]({},_0x2d4e5a,_0x13f203[_0x1499('0xb2')]);return db['WhatsappInteraction'][_0x1499('0x6d')](_0x2d4e5a)[_0x1499('0x29')](handleEntityNotFound(_0x1fbf21,null))[_0x1499('0x29')](respondWithResult(_0x1fbf21,null))[_0x1499('0x36')](handleError(_0x1fbf21,null));};exports[_0x1499('0xb3')]=function(_0x512cb6,_0x4f9bb1){return db['WhatsappInteraction']['create'](_0x512cb6[_0x1499('0x77')],{})[_0x1499('0x29')](respondWithResult(_0x4f9bb1,0xc9))[_0x1499('0x36')](handleError(_0x4f9bb1,null));};exports['update']=function(_0x50b927,_0x479936){if(_0x50b927[_0x1499('0x77')]['id']){delete _0x50b927[_0x1499('0x77')]['id'];}return db[_0x1499('0x3f')][_0x1499('0x6d')]({'where':{'id':_0x50b927[_0x1499('0xb1')]['id']}})[_0x1499('0x29')](handleEntityNotFound(_0x479936,null))[_0x1499('0x29')](saveUpdates(_0x50b927[_0x1499('0x77')],null))[_0x1499('0x29')](respondWithResult(_0x479936,null))['catch'](handleError(_0x479936,null));};exports[_0x1499('0x2a')]=function(_0x4d896d,_0x358ee6){return db[_0x1499('0x3f')][_0x1499('0x6d')]({'where':{'id':_0x4d896d[_0x1499('0xb1')]['id']}})[_0x1499('0x29')](handleEntityNotFound(_0x358ee6,null))[_0x1499('0x29')](removeEntity(_0x358ee6,null))[_0x1499('0x36')](handleError(_0x358ee6,null));};exports['describe']=function(_0x56507a,_0x32ec2e){return db[_0x1499('0x3f')]['describe']()[_0x1499('0x29')](respondWithResult(_0x32ec2e,null))[_0x1499('0x36')](handleError(_0x32ec2e,null));};exports[_0x1499('0xb4')]=function(_0x56fb96,_0x4fffd3,_0xa0e494){return db['WhatsappMessage'][_0x1499('0x6d')]({'where':{'id':_0x56fb96[_0x1499('0xb1')]['id']}})[_0x1499('0x29')](handleEntityNotFound(_0x4fffd3,null))['then'](function(_0x583666){if(_0x583666){return _0x583666['addMessage'](_0x56fb96[_0x1499('0x77')][_0x1499('0xb5')],_['omit'](_0x56fb96[_0x1499('0x77')],['ids','id'])||{});}})['then'](respondWithResult(_0x4fffd3,null))[_0x1499('0x36')](handleError(_0x4fffd3,null));};exports['getMessages']=function(_0x580222,_0x52de11,_0x2e39ac){var _0x4a9e81={'raw':![],'where':{}};var _0x316881={};var _0x1897af={'count':0x0,'rows':[]};return db[_0x1499('0x3f')][_0x1499('0xb6')]({'where':{'id':_0x580222[_0x1499('0xb1')]['id']}})['then'](handleEntityNotFound(_0x52de11,null))[_0x1499('0x29')](function(_0x6fca53){if(_0x6fca53){_0x316881[_0x1499('0x44')]=_['keys'](db[_0x1499('0xb7')][_0x1499('0x40')]);_0x316881[_0x1499('0x46')]=_[_0x1499('0x45')](_0x580222[_0x1499('0x46')]);_0x316881[_0x1499('0x50')]=_[_0x1499('0x47')](_0x316881[_0x1499('0x44')],_0x316881['query']);_0x4a9e81[_0x1499('0x48')]=_[_0x1499('0x47')](_0x316881[_0x1499('0x44')],qs['fields'](_0x580222[_0x1499('0x46')][_0x1499('0x49')]));_0x4a9e81[_0x1499('0x48')]=_0x4a9e81[_0x1499('0x48')][_0x1499('0x4a')]?_0x4a9e81[_0x1499('0x48')]:_0x316881['model'];if(!_0x580222[_0x1499('0x46')][_0x1499('0x4b')]('nolimit')){_0x4a9e81[_0x1499('0x20')]=qs[_0x1499('0x20')](_0x580222[_0x1499('0x46')]['limit']);_0x4a9e81['offset']=qs[_0x1499('0x23')](_0x580222[_0x1499('0x46')][_0x1499('0x23')]);}_0x4a9e81[_0x1499('0x4d')]=qs[_0x1499('0x4e')](_0x580222[_0x1499('0x46')][_0x1499('0x4e')]);_0x4a9e81[_0x1499('0x4f')]=qs['filters'](_['pick'](_0x580222['query'],_0x316881[_0x1499('0x50')]));_0x4a9e81[_0x1499('0x4f')]['WhatsappInteractionId']=_0x6fca53['id'];if(_0x580222[_0x1499('0x46')]['filter']){_0x4a9e81[_0x1499('0x4f')]=_[_0x1499('0x9c')](_0x4a9e81['where'],{'$or':_[_0x1499('0x2f')](_0x4a9e81[_0x1499('0x48')],function(_0xf9e791){var _0x4e3bf3={};_0x4e3bf3[_0xf9e791]={'$like':'%'+_0x580222[_0x1499('0x46')][_0x1499('0x88')]+'%'};return _0x4e3bf3;})});}if(_0x580222[_0x1499('0x46')][_0x1499('0x7f')]){var _0x3da005=_0x580222[_0x1499('0x46')][_0x1499('0x7f')][_0x1499('0x33')](',');var _0x22d5f5={};_0x22d5f5[_0x3da005[0x0]]={'$gte':moment(_0x3da005[0x1])[_0x1499('0xb8')](_0x1499('0xb9'))};_0x4a9e81[_0x1499('0x4f')]=_[_0x1499('0x9c')](_0x4a9e81[_0x1499('0x4f')],_0x22d5f5);}_0x4a9e81=_[_0x1499('0x9c')]({},_0x4a9e81,_0x580222[_0x1499('0xb2')]);return db['WhatsappMessage'][_0x1499('0x22')]({'where':_0x4a9e81[_0x1499('0x4f')]})[_0x1499('0x29')](function(_0x9c2620){_0x1897af[_0x1499('0x22')]=_0x9c2620;if(_0x580222[_0x1499('0x46')][_0x1499('0xba')]){_0x4a9e81[_0x1499('0xbb')]=[{'all':!![]}];}return db[_0x1499('0xb7')][_0x1499('0xbc')](_0x4a9e81);})[_0x1499('0x29')](function(_0xc13b1b){_0x1897af[_0x1499('0xb0')]=_0xc13b1b;return _0x1897af;});}})['then'](respondWithFilteredResult(_0x52de11,_0x4a9e81))[_0x1499('0x36')](handleError(_0x52de11,null));};exports[_0x1499('0xbd')]=function(_0x88b620,_0x4f9f1a,_0x3ad0bf){return db[_0x1499('0x3f')][_0x1499('0x6d')]({'where':{'id':_0x88b620[_0x1499('0xb1')]['id']}})[_0x1499('0x29')](handleEntityNotFound(_0x4f9f1a,null))[_0x1499('0x29')](function(_0x753435){if(_0x753435){return _0x753435[_0x1499('0xbe')](_0x88b620['body'][_0x1499('0xb5')],_['omit'](_0x88b620[_0x1499('0x77')],[_0x1499('0xb5'),'id'])||{})[_0x1499('0xbf')](function(){return db[_0x1499('0x71')]['findAll']({'attributes':['id',_0x1499('0x2d'),_0x1499('0x53')],'where':{'id':_0x88b620['body'][_0x1499('0xb5')]}});})['then'](function(_0x4e3f4d){socket[_0x1499('0xc0')](_0x1499('0xc1'),{'id':Number(_0x88b620[_0x1499('0xb1')]['id']),'tags':_0x4e3f4d||[]});return{'id':Number(_0x88b620[_0x1499('0xb1')]['id']),'tags':_0x4e3f4d||[]};});}})['then'](respondWithResult(_0x4f9f1a,null))[_0x1499('0x36')](handleError(_0x4f9f1a,null));};exports[_0x1499('0xc2')]=function(_0x2e00ae,_0x821029,_0x39a45b){return db[_0x1499('0x3f')][_0x1499('0x6d')]({'where':{'id':_0x2e00ae[_0x1499('0xb1')]['id']}})['then'](handleEntityNotFound(_0x821029,null))[_0x1499('0x29')](function(_0x3bc903){if(_0x3bc903){return _0x3bc903['removeTags'](_0x2e00ae['query'][_0x1499('0xb5')]);}})[_0x1499('0x29')](respondWithStatusCode(_0x821029,null))[_0x1499('0x36')](handleError(_0x821029,null));};exports[_0x1499('0xc3')]=function(_0x27e3d5,_0x3bf326){var _0xd77467=moment()[_0x1499('0xc4')]()[_0x1499('0x9b')]();var _0xea4c8f=path[_0x1499('0xc5')](config[_0x1499('0xc6')],_0x1499('0xc7'),_0x1499('0xc8'),_0x1499('0xc9'));var _0x5c4e09=path[_0x1499('0xc5')](config[_0x1499('0xc6')],_0x1499('0xc7'),_0x1499('0xc8'),'attachments');var _0x55737a=path[_0x1499('0xc5')](_0xea4c8f,_0xd77467);var _0x50dd3d=util[_0x1499('0xb8')](_0x1499('0xca'),_0x27e3d5[_0x1499('0xb1')]['id'],_0xd77467);var _0x3a7a82=path[_0x1499('0xc5')](_0xea4c8f,_0x50dd3d);var _0x54195f=[];_0x54195f[_0x1499('0x35')]({'model':db['User'],'as':_0x1499('0x74'),'attributes':['id',_0x1499('0x30')],'raw':!![]});_0x54195f['push']({'model':db[_0x1499('0xcb')],'as':_0x1499('0x6a'),'attributes':['id',_0x1499('0xcc'),'lastName'],'raw':!![]});if(_0x27e3d5[_0x1499('0x46')][_0x1499('0xcd')]){_0x54195f['push']({'model':db[_0x1499('0xce')],'as':_0x1499('0xce'),'raw':!![]});}var _0x37fe53=[{'model':db['WhatsappMessage'],'as':_0x1499('0xcf'),'attributes':['id','body','createdAt','direction',_0x1499('0xd0'),_0x1499('0x83')],'include':_0x54195f}];_0x37fe53[_0x1499('0x35')]({'model':db[_0x1499('0xd1')],'as':_0x1499('0xd2'),'attributes':['id','name']});_0x37fe53[_0x1499('0x35')]({'model':db[_0x1499('0x74')],'as':_0x1499('0xd3'),'attributes':['id','fullname']});return db[_0x1499('0x3f')]['find']({'where':{'id':_0x27e3d5[_0x1499('0xb1')]['id']},'include':_0x37fe53})[_0x1499('0x29')](handleEntityNotFound(_0x3bf326,null))['then'](function(_0x423490){if(_0x423490){var _0x5d5def=_0x423490[_0x1499('0xd4')]({'plain':!![]});fs[_0x1499('0xd5')](_0x55737a);var _0x2f201e={'channel':'Whatsapp','account':_0x5d5def['Account'][_0x1499('0x2d')],'agent':_0x5d5def['Owner']?_0x5d5def[_0x1499('0xd3')][_0x1499('0x30')]:'N.A.','createdAt':moment(_0x5d5def[_0x1499('0xd6')])[_0x1499('0xb8')](_0x1499('0xb9'))[_0x1499('0x9b')](),'closedAt':_0x5d5def['closed']?moment(_0x5d5def[_0x1499('0xd7')])[_0x1499('0xb8')](_0x1499('0xb9'))[_0x1499('0x9b')]():'','disposition':_0x5d5def[_0x1499('0xd8')],'messages':_(_0x5d5def[_0x1499('0xcf')])[_0x1499('0x88')]({'secret':![]})[_0x1499('0x2f')](function(_0x4f23f3){if(_0x4f23f3[_0x1499('0xce')]){var _0x1575f8=path[_0x1499('0xc5')](_0x5c4e09,_0x4f23f3['Attachment'][_0x1499('0xd9')]);if(fs[_0x1499('0xda')](_0x1575f8)){fs[_0x1499('0xdb')](_0x1575f8)[_0x1499('0xdc')](fs[_0x1499('0xdd')](path['join'](_0x55737a,_0x4f23f3['Attachment'][_0x1499('0xd9')])));}}return{'date':moment(_0x4f23f3[_0x1499('0xd6')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x1499('0x9b')](),'sender':_0x4f23f3['direction']===_0x1499('0xde')?_0x4f23f3[_0x1499('0x74')]?_0x4f23f3[_0x1499('0x74')][_0x1499('0x30')]:_0x1499('0xdf'):_0x4f23f3['Contact'][_0x1499('0xcc')]+(_0x4f23f3['Contact'][_0x1499('0xe0')]?'\x20'+_0x4f23f3[_0x1499('0x6a')][_0x1499('0xe0')]:''),'body':_0x4f23f3['Attachment']?_0x4f23f3[_0x1499('0xce')][_0x1499('0xd9')]:_0x4f23f3['body'],'direction':_0x4f23f3[_0x1499('0xe1')]==='out'?'A':'C','secret':_0x4f23f3[_0x1499('0xd0')],'read':_0x4f23f3[_0x1499('0x83')],'attachment':_0x4f23f3[_0x1499('0xce')]};})[_0x1499('0x67')]()};return ejs['renderFile'](path[_0x1499('0xc5')](config[_0x1499('0xc6')],'server',_0x1499('0xe2'),_0x1499('0xe3')),{'interaction':_0x2f201e})['then'](function(_0x4a2873){var _0x122242=path['join'](_0x55737a,_0x1499('0xe4')+_0x5d5def['id']+'-'+_0xd77467+'.pdf');var _0xffc748={'path':_0x122242,'channel':_0x1499('0xe5'),'interactionId':_0x5d5def['id']};return pdf[_0x1499('0xe6')](_0x4a2873,_0xffc748);})[_0x1499('0x29')](function(){return new BPromise(function(_0x158c0b,_0x148a4b){zipdir(_0x55737a,{'saveTo':_0x3a7a82},function(_0x1216d7,_0xb99a7a){if(_0x1216d7)return _0x148a4b(_0x1216d7);return _0x158c0b(_0xb99a7a);});})[_0x1499('0x29')](function(){return new BPromise(function(_0x454f48,_0x4e6c88){rimraf(_0x55737a,function(_0x1e793c){if(_0x1e793c)_0x4e6c88(_0x1e793c);return _0x454f48();});});})['then'](function(){return _0x3bf326[_0x1499('0xc3')](_0x3a7a82,_0x50dd3d,function(_0x2237f3){if(_0x2237f3){console[_0x1499('0xe7')](_0x1499('0xe8'),_0x2237f3);}else{fs[_0x1499('0xe9')](_0x3a7a82);}});});});}else{return _0x3bf326['sendStatus'](0xc8);}})[_0x1499('0x36')](handleError(_0x3bf326,null));}; \ No newline at end of file +var _0x8969=['toString','keyBy','merge','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','WhatsappInteractionId','rows','catch','show','includeAll','options','destroy','params','describe','addMessage','WhatsappMessage','ids','getMessages','findOne','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','spread','emit','whatsappInteractionTags:save','removeTags','download','unix','join','server','files','tmp','attachments','transcript-%d-%s.zip','CmContact','Attachment','Messages','direction','Account','Owner','Whatsapp','N.A.','closedAt','createReadStream','pipe','createWriteStream','basename','out','System','lastName','secret','root','views','transcript-','createPdfFromHTML','log','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','end','json','offset','limit','undefined','count','status','set','Content-Range','apply','update','then','error','stack','name','send','fullname','TagIds','Tags','split','forEach','push','waiting','talking','answered','unmanaged','total','closed','UserId','map','WhatsappInteraction','rawAttributes','fieldName','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','select','field','color','tools_tags','u.id','ui.WhatsappInteractionId','from','user_has_whatsapp_interactions','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','left_join','a.id\x20=\x20i.WhatsappAccountId','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','value','`\x20=\x200','`\x20>\x200','Contact','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','type','start','body','compact','WhatsappAccountId','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','having','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','Sequelize','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','isEmpty','resolve','user','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','i.WhatsappAccountId\x20IN\x20?','sequelize'];(function(_0x2ca33a,_0x3b354f){var _0x5b1094=function(_0x3f8ccc){while(--_0x3f8ccc){_0x2ca33a['push'](_0x2ca33a['shift']());}};_0x5b1094(++_0x3b354f);}(_0x8969,0x130));var _0x9896=function(_0x3c0d65,_0x4ad5df){_0x3c0d65=_0x3c0d65-0x0;var _0x5cf8e0=_0x8969[_0x3c0d65];return _0x5cf8e0;};'use strict';var emlformat=require(_0x9896('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9896('0x1'));var jsonpatch=require(_0x9896('0x2'));var rp=require(_0x9896('0x3'));var moment=require(_0x9896('0x4'));var BPromise=require(_0x9896('0x5'));var Mustache=require(_0x9896('0x6'));var util=require(_0x9896('0x7'));var path=require('path');var sox=require(_0x9896('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9896('0x9'));var _=require(_0x9896('0xa'));var squel=require(_0x9896('0xb'));var crypto=require('crypto');var jsforce=require(_0x9896('0xc'));var deskjs=require(_0x9896('0xd'));var toCsv=require(_0x9896('0xe'));var querystring=require('querystring');var Papa=require(_0x9896('0xf'));var Redis=require(_0x9896('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9896('0x11'));var as=require(_0x9896('0x12'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x9896('0x13'));var logger=require(_0x9896('0x14'))(_0x9896('0x15'));var utils=require(_0x9896('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x9896('0x17')]=_[_0x9896('0x18')](config[_0x9896('0x17')],{'host':_0x9896('0x19'),'port':0x18eb});var socket=require(_0x9896('0x1a'))(new Redis(config[_0x9896('0x17')]));require(_0x9896('0x1b'))[_0x9896('0x1c')](socket);function respondWithStatusCode(_0x38846b,_0x29952c){_0x29952c=_0x29952c||0xcc;return function(_0x51dce3){if(_0x51dce3){return _0x38846b[_0x9896('0x1d')](_0x29952c);}return _0x38846b['status'](_0x29952c)[_0x9896('0x1e')]();};}function respondWithResult(_0x12c503,_0x2d0d7e){_0x2d0d7e=_0x2d0d7e||0xc8;return function(_0x42ccee){if(_0x42ccee){return _0x12c503['status'](_0x2d0d7e)[_0x9896('0x1f')](_0x42ccee);}};}function respondWithFilteredResult(_0x692ded,_0x3f8061){return function(_0x23bb00){if(_0x23bb00){var _0x4f79dc=typeof _0x3f8061[_0x9896('0x20')]==='undefined'&&typeof _0x3f8061[_0x9896('0x21')]===_0x9896('0x22');var _0x596a3f=_0x23bb00[_0x9896('0x23')];var _0x21806c=_0x4f79dc?0x0:_0x3f8061[_0x9896('0x20')];var _0x3038fd=_0x4f79dc?_0x23bb00[_0x9896('0x23')]:_0x3f8061[_0x9896('0x20')]+_0x3f8061['limit'];var _0x18ff6e;if(_0x3038fd>=_0x596a3f){_0x3038fd=_0x596a3f;_0x18ff6e=0xc8;}else{_0x18ff6e=0xce;}_0x692ded[_0x9896('0x24')](_0x18ff6e);return _0x692ded[_0x9896('0x25')](_0x9896('0x26'),_0x21806c+'-'+_0x3038fd+'/'+_0x596a3f)[_0x9896('0x1f')](_0x23bb00);}return null;};}function patchUpdates(_0x511054){return function(_0x98af06){try{jsonpatch[_0x9896('0x27')](_0x98af06,_0x511054,!![]);}catch(_0x173eb6){return BPromise['reject'](_0x173eb6);}return _0x98af06['save']();};}function saveUpdates(_0x1d188b,_0x5a3515){return function(_0x2627c9){if(_0x2627c9){return _0x2627c9[_0x9896('0x28')](_0x1d188b)[_0x9896('0x29')](function(_0x50f060){return _0x50f060;});}return null;};}function removeEntity(_0x5b7592,_0x5bf457){return function(_0x39a2d0){if(_0x39a2d0){return _0x39a2d0['destroy']()[_0x9896('0x29')](function(){_0x5b7592[_0x9896('0x24')](0xcc)[_0x9896('0x1e')]();});}};}function handleEntityNotFound(_0x1a6c92,_0x3b9ee2){return function(_0xa316c){if(!_0xa316c){_0x1a6c92[_0x9896('0x1d')](0x194);}return _0xa316c;};}function handleError(_0x8a2f76,_0xb2ce2e){_0xb2ce2e=_0xb2ce2e||0x1f4;return function(_0x3102db){logger[_0x9896('0x2a')](_0x3102db[_0x9896('0x2b')]);if(_0x3102db[_0x9896('0x2c')]){delete _0x3102db[_0x9896('0x2c')];}_0x8a2f76[_0x9896('0x24')](_0xb2ce2e)[_0x9896('0x2d')](_0x3102db);};}function getInteractionUsers(_0x485393,_0x24df7d){return new BPromise(function(_0x503ead,_0x238e99){try{if(_0x24df7d[_0x485393['id']]){_0x485393['Users']=_['map'](_0x24df7d[_0x485393['id']],function(_0x435667){return{'id':_0x435667['id'],'fullname':_0x435667[_0x9896('0x2e')]};});}}catch(_0x54728c){_0x238e99(_0x54728c);}_0x503ead(_0x485393);});}function getInteractionTags(_0x31cd49,_0x3ba2a5){return new BPromise(function(_0x195114,_0x54d472){try{if(_0x31cd49[_0x9896('0x2f')]){_0x31cd49[_0x9896('0x30')]=[];_0x31cd49['TagIds'][_0x9896('0x31')](',')[_0x9896('0x32')](function(_0x303b22){_0x31cd49[_0x9896('0x30')][_0x9896('0x33')](_0x3ba2a5[_0x303b22]);});}delete _0x31cd49[_0x9896('0x2f')];}catch(_0x13bfc1){_0x54d472(_0x13bfc1);}_0x195114(_0x31cd49);});}function updateWhatsappInteraction(_0x1d593b,_0x2428ec,_0x29f007){return new BPromise(function(_0xc4d2c2,_0x441af2){return getInteractionUsers(_0x1d593b,_0x29f007)['then'](function(_0x441048){return getInteractionTags(_0x441048,_0x2428ec);})[_0x9896('0x29')](function(_0x35e460){return getStateInteraction(_0x35e460);})[_0x9896('0x29')](function(_0x289517){_0xc4d2c2(_0x289517);})['catch'](function(_0x1fa679){_0x441af2(_0x1fa679);});});}function getStateInteraction(_0x2c63b4){return new BPromise(function(_0x23e1a4){_0x2c63b4[_0x9896('0x34')]=0x0;_0x2c63b4[_0x9896('0x35')]=0x0;_0x2c63b4[_0x9896('0x36')]=0x0;_0x2c63b4[_0x9896('0x37')]=0x0;_0x2c63b4[_0x9896('0x38')]=0x0;if(!_0x2c63b4[_0x9896('0x39')]&&!_0x2c63b4[_0x9896('0x3a')]){_0x2c63b4[_0x9896('0x34')]+=0x1;}if(!_0x2c63b4[_0x9896('0x39')]&&_0x2c63b4[_0x9896('0x3a')]){_0x2c63b4['talking']+=0x1;if(_0x2c63b4[_0x9896('0x34')]){_0x2c63b4['waiting']-=0x1;}}if(_0x2c63b4['closed']&&_0x2c63b4['UserId']){_0x2c63b4[_0x9896('0x36')]+=0x1;if(_0x2c63b4[_0x9896('0x35')]){_0x2c63b4[_0x9896('0x35')]-=0x1;}}if(_0x2c63b4[_0x9896('0x39')]&&!_0x2c63b4[_0x9896('0x3a')]){_0x2c63b4[_0x9896('0x37')]+=0x1;if(_0x2c63b4[_0x9896('0x34')]){_0x2c63b4[_0x9896('0x34')]-=0x1;}}_0x2c63b4[_0x9896('0x38')]+=0x1;_0x23e1a4(_0x2c63b4);});}exports['index']=function(_0x2663b0,_0x417cf1){var _0x158524={},_0x14f372={},_0x3df2a9={'count':0x0,'rows':[]};var _0x4079c3=_[_0x9896('0x3b')](db[_0x9896('0x3c')][_0x9896('0x3d')],function(_0x1e302a){return{'name':_0x1e302a[_0x9896('0x3e')],'type':_0x1e302a['type']['key']};});_0x14f372[_0x9896('0x3f')]=_[_0x9896('0x3b')](_0x4079c3,_0x9896('0x2c'));_0x14f372['query']=_[_0x9896('0x40')](_0x2663b0[_0x9896('0x41')]);_0x14f372['filters']=_[_0x9896('0x42')](_0x14f372[_0x9896('0x3f')],_0x14f372['query']);_0x158524[_0x9896('0x43')]=_[_0x9896('0x42')](_0x14f372[_0x9896('0x3f')],qs['fields'](_0x2663b0[_0x9896('0x41')][_0x9896('0x44')]));_0x158524[_0x9896('0x43')]=_0x158524['attributes'][_0x9896('0x45')]?_0x158524[_0x9896('0x43')]:_0x14f372['model'];if(!_0x2663b0['query'][_0x9896('0x46')](_0x9896('0x47'))){_0x158524[_0x9896('0x21')]=qs[_0x9896('0x21')](_0x2663b0[_0x9896('0x41')][_0x9896('0x21')]);_0x158524[_0x9896('0x20')]=qs[_0x9896('0x20')](_0x2663b0[_0x9896('0x41')][_0x9896('0x20')]);}_0x158524[_0x9896('0x48')]=qs[_0x9896('0x49')](_0x2663b0['query']['sort']);_0x158524[_0x9896('0x4a')]=qs[_0x9896('0x4b')](_[_0x9896('0x4c')](_0x2663b0[_0x9896('0x41')],_0x14f372[_0x9896('0x4b')]),_0x4079c3);var _0x4332f0=[];var _0x1f2aa5=squel[_0x9896('0x4d')]()[_0x9896('0x4e')]('id')[_0x9896('0x4e')](_0x9896('0x2c'))[_0x9896('0x4e')](_0x9896('0x4f'))['from'](_0x9896('0x50'));var _0x291bd2=squel[_0x9896('0x4d')]()[_0x9896('0x4e')](_0x9896('0x51'))['field']('u.fullname')['field'](_0x9896('0x52'))[_0x9896('0x53')](_0x9896('0x54'),'ui')['left_join'](_0x9896('0x55'),'u',_0x9896('0x56'));var _0x3bc8a1=squel[_0x9896('0x4d')]()[_0x9896('0x53')](_0x9896('0x57'),'i')['left_join']('cm_contacts','c',_0x9896('0x58'))['left_join'](_0x9896('0x55'),'o',_0x9896('0x59'))[_0x9896('0x5a')]('whatsapp_accounts','a',_0x9896('0x5b'))[_0x9896('0x5a')]('whatsapp_messages','me',_0x9896('0x5c'))[_0x9896('0x5a')](_0x9896('0x5d'),'it','it.WhatsappInteractionId\x20=\x20i.id')[_0x9896('0x5a')]('tools_tags','t',_0x9896('0x5e'));var _0x1cb72f=squel[_0x9896('0x5f')]();var _0x5ee04e=[];var _0x1d268e=squel[_0x9896('0x5f')]();var _0x3e4157;if(_0x2663b0['query'][_0x9896('0x60')]){_0x3e4157=as[_0x9896('0x61')](_0x2663b0[_0x9896('0x41')]['search']);var _0x456dfb=_0x3e4157[_0x9896('0x62')];for(var _0x229bc4=0x0;_0x229bc4<_0x3e4157[_0x9896('0x63')]['length'];_0x229bc4++){var _0x2888d7=_0x3e4157[_0x9896('0x63')][_0x229bc4];var _0x50bf88='i';var _0x3cb135=_['find'](_0x4079c3,[_0x9896('0x2c'),_0x2888d7[_0x9896('0x4e')]]);if(!_0x3cb135){switch(_0x2888d7['field']){case _0x9896('0x64'):if(_0x2888d7[_0x9896('0x65')]==0x1){_0x3bc8a1['having']('`'+_0x2888d7[_0x9896('0x4e')]+_0x9896('0x66'));}else{_0x3bc8a1['having']('`'+_0x2888d7[_0x9896('0x4e')]+_0x9896('0x67'));}break;case _0x9896('0x68'):if(_0x2888d7['operator']==='$substring'){if(_0x2888d7[_0x9896('0x65')][_0x9896('0x31')]('\x20')[_0x9896('0x45')]>0x1){_0x1cb72f[_0x456dfb]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x9896('0x69')](_0x2888d7[_0x9896('0x65')]),null);}else{var _0x3508c6='%'+_0x2888d7[_0x9896('0x65')]+'%';_0x1cb72f[_0x456dfb](_0x9896('0x6a'),_0x3508c6,_0x3508c6,_0x3508c6);}}else{_0x3cb135=_[_0x9896('0x6b')](_0x4079c3,[_0x9896('0x2c'),_0x9896('0x6c')]);_0x2888d7[_0x9896('0x4e')]=_0x9896('0x6c');_0x2a9471=as[_0x9896('0x6d')](_0x50bf88,_0x3cb135['type'],_0x2888d7);_0x1cb72f[_0x456dfb](_0x2a9471[_0x9896('0x6e')],_0x2a9471[_0x9896('0x65')]['start'],_0x2a9471[_0x9896('0x65')][_0x9896('0x1e')]);}break;case _0x9896('0x6f'):var _0x513851=_0x2888d7[_0x9896('0x65')]['split'](',')[_0x9896('0x3b')](function(_0x5b1fb3){return Number(_0x5b1fb3);});_0x513851[_0x9896('0x32')](function(_0x448e78){_0x1d268e['or'](_0x9896('0x70'),'%,'+_0x448e78+',%');});_0x5ee04e=_[_0x9896('0x71')](_0x5ee04e,_0x513851);break;case _0x9896('0x72'):if(_0x2888d7[_0x9896('0x73')]==='$substring'){_0x1cb72f[_0x456dfb](_0x9896('0x74'),'%'+_0x2888d7[_0x9896('0x65')]+'%',null);}else{_0x3cb135=_[_0x9896('0x6b')](_0x4079c3,[_0x9896('0x2c'),_0x9896('0x3a')]);_0x2888d7[_0x9896('0x4e')]='UserId';_0x2a9471=as['buildExpression'](_0x50bf88,_0x3cb135[_0x9896('0x75')],_0x2888d7);_0x1cb72f[_0x456dfb](_0x2a9471[_0x9896('0x6e')],_0x2a9471[_0x9896('0x65')][_0x9896('0x76')],_0x2a9471[_0x9896('0x65')][_0x9896('0x1e')]);}break;case _0x9896('0x77'):_0x2a9471=as[_0x9896('0x6d')]('me',null,_0x2888d7);_0x1cb72f[_0x456dfb](_0x2a9471[_0x9896('0x6e')],_0x2a9471[_0x9896('0x65')][_0x9896('0x76')],_0x2a9471[_0x9896('0x65')][_0x9896('0x1e')]);break;}}else{var _0x2a9471=as[_0x9896('0x6d')](_0x50bf88,_0x3cb135[_0x9896('0x75')],_0x2888d7);_0x1cb72f[_0x456dfb](_0x2a9471[_0x9896('0x6e')],_0x2a9471[_0x9896('0x65')][_0x9896('0x76')],_0x2a9471['value'][_0x9896('0x1e')]);}}}else{var _0x2c19f8=_(_0x2663b0['query'])[_0x9896('0x40')]()[_0x9896('0x3b')](function(_0x188fd3){return _['some'](_0x4079c3,[_0x9896('0x2c'),_0x188fd3])?_0x188fd3:undefined;})[_0x9896('0x78')]()['value']();if(!_['isEmpty'](_0x2c19f8)){_0x2c19f8[_0x9896('0x32')](function(_0x35b6b0){if(_0x35b6b0===_0x9896('0x79')){_0x3bc8a1['where']('i.WhatsappAccountId\x20IN\x20?',[][_0x9896('0x7a')](_0x2663b0[_0x9896('0x41')][_0x35b6b0]));}else if(_0x35b6b0===_0x9896('0x7b')){var _0x58d8a8=JSON[_0x9896('0x7c')](_0x2663b0[_0x9896('0x41')][_0x35b6b0])['$gte'];var _0x5a2a35=JSON['parse'](_0x2663b0[_0x9896('0x41')][_0x35b6b0])[_0x9896('0x7d')];_0x3bc8a1[_0x9896('0x4a')](_0x9896('0x7e'),_0x58d8a8,_0x5a2a35);}else{if(_0x2663b0[_0x9896('0x41')][_0x35b6b0]===_0x9896('0x7f')){_0x3bc8a1[_0x9896('0x4a')]('i.'+_0x35b6b0+_0x9896('0x80'));}else{_0x3bc8a1[_0x9896('0x4a')]('i.'+_0x35b6b0+_0x9896('0x81'),_0x2663b0['query'][_0x35b6b0]);}}});}if(_0x2663b0[_0x9896('0x41')][_0x9896('0x82')]){if(_0x2663b0[_0x9896('0x41')][_0x9896('0x82')]==0x1){_0x3bc8a1[_0x9896('0x83')](_0x9896('0x84'));}else{_0x3bc8a1['having'](_0x9896('0x85'));}}if(_0x2663b0[_0x9896('0x41')]['tag']){_0x5ee04e=_['isArray'](_0x2663b0['query'][_0x9896('0x86')])?_0x2663b0[_0x9896('0x41')]['tag']:new Array(_0x2663b0[_0x9896('0x41')][_0x9896('0x86')]);_0x5ee04e[_0x9896('0x32')](function(_0x25a455){_0x1d268e['or'](_0x9896('0x70'),'%,'+_0x25a455+',%');});}if(_0x2663b0[_0x9896('0x41')][_0x9896('0x87')]){var _0x117519=_0x2663b0[_0x9896('0x41')]['filter']['replace']('\x5c','\x5c\x5c')[_0x9896('0x88')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x117519)){_0x1cb72f['or']('i.id\x20LIKE\x20?',_0x117519+'%')['or'](_0x9896('0x89'),_0x117519+'%');}else{_0x1cb72f['or'](_0x9896('0x8a'),qs[_0x9896('0x69')](_0x117519))['or'](_0x9896('0x8b'),_0x117519+'%');}}}_0x3bc8a1[_0x9896('0x4a')](_0x1cb72f);_0x3bc8a1['group']('i.id');var _0x125cc7={'type':db[_0x9896('0x8c')][_0x9896('0x8d')][_0x9896('0x8e')],'raw':!![]};var _0x25ee5d=_0x3bc8a1[_0x9896('0x8f')]();_0x25ee5d[_0x9896('0x4e')](_0x9896('0x90'));_0x25ee5d[_0x9896('0x4e')](_0x9896('0x91'),_0x9896('0x64'));if(_0x158524[_0x9896('0x48')]){_0x158524[_0x9896('0x48')][_0x9896('0x32')](function(_0x3a4395){var _0x532efa=_0x3a4395[0x0]===_0x9896('0x92')?_0x3a4395[0x0]:'i.'+_0x3a4395[0x0];_0x3bc8a1['order'](_0x532efa,_0x3a4395[0x1]==='DESC'?![]:!![]);});}if(!_[_0x9896('0x93')](_0x5ee04e)){_0x3bc8a1[_0x9896('0x83')](_0x1d268e);_0x25ee5d[_0x9896('0x4a')]('t.id\x20IN\x20?',_0x5ee04e);}BPromise[_0x9896('0x94')]()['then'](function(){if(!_0x3e4157){if(_0x2663b0[_0x9896('0x41')][_0x9896('0x79')])return;_0x25ee5d[_0x9896('0x4a')]('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');_0x3bc8a1[_0x9896('0x4a')]('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x2663b0[_0x9896('0x95')][_0x9896('0x96')]!==_0x9896('0x97'))return;return _0x2663b0[_0x9896('0x95')][_0x9896('0x98')]({'attributes':['id'],'raw':!![]})[_0x9896('0x29')](function(_0x5bd7a1){if(_['isEmpty'](_0x5bd7a1)){_0x25ee5d[_0x9896('0x4a')](_0x9896('0x99'));_0x3bc8a1[_0x9896('0x4a')]('i.WhatsappAccountId\x20IS\x20NULL');}else{_0x25ee5d['where'](_0x9896('0x9a'),_[_0x9896('0x3b')](_0x5bd7a1,'id'));_0x3bc8a1[_0x9896('0x4a')](_0x9896('0x9a'),_[_0x9896('0x3b')](_0x5bd7a1,'id'));}});})[_0x9896('0x29')](function(){if(_0x2663b0['user']['role']===_0x9896('0x97')&&!_0x3e4157&&!_0x2663b0[_0x9896('0x41')][_0x9896('0x79')])return[];return db[_0x9896('0x9b')][_0x9896('0x41')](_0x25ee5d[_0x9896('0x9c')](),_0x125cc7);})[_0x9896('0x29')](function(_0x5d2e33){_0x3df2a9[_0x9896('0x23')]=_0x5d2e33[_0x9896('0x45')];if(_0x3df2a9[_0x9896('0x23')]===0x0)return[];return db[_0x9896('0x9b')][_0x9896('0x41')](_0x1f2aa5['toString'](),_0x125cc7)['then'](function(_0x3bf714){_0x4332f0=_[_0x9896('0x9d')](_0x3bf714,'id');_0x125cc7=_[_0x9896('0x9e')](_0x125cc7,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2663b0['query'][_0x9896('0x44')]){_0x158524[_0x9896('0x43')][_0x9896('0x32')](function(_0x4e3d15){_0x3bc8a1[_0x9896('0x4e')]('i.'+_0x4e3d15);});}else{_0x3bc8a1['field'](_0x9896('0x91'),'unreadMessages');_0x3bc8a1['field'](_0x9896('0x9f'),'Account.key');_0x3bc8a1[_0x9896('0x4e')](_0x9896('0xa0'),_0x9896('0xa1'));_0x3bc8a1['field'](_0x9896('0xa2'),_0x9896('0x92'));_0x3bc8a1[_0x9896('0x4e')]('i.*');_0x3bc8a1[_0x9896('0x4e')](_0x9896('0xa3'),_0x9896('0xa4'));_0x3bc8a1[_0x9896('0x4e')](_0x9896('0xa5'),'Contact.lastName');_0x3bc8a1['field'](_0x9896('0xa6'),_0x9896('0xa7'));_0x3bc8a1[_0x9896('0x4e')](_0x9896('0xa8'),_0x9896('0xa9'));_0x3bc8a1[_0x9896('0x4e')]('c.mobile',_0x9896('0xaa'));_0x3bc8a1[_0x9896('0x4e')]('c.fax',_0x9896('0xab'));_0x3bc8a1['field']('o.fullname',_0x9896('0xac'));_0x3bc8a1[_0x9896('0x4e')](_0x9896('0xad'),_0x9896('0xae'));_0x3bc8a1['field'](_0x9896('0xaf'),_0x9896('0x2f'));}if(_0x158524['limit'])_0x3bc8a1[_0x9896('0x21')](_0x158524[_0x9896('0x21')]);if(_0x158524[_0x9896('0x20')])_0x3bc8a1['offset'](_0x158524[_0x9896('0x20')]);return db[_0x9896('0x9b')][_0x9896('0x41')](_0x3bc8a1[_0x9896('0x9c')](),_0x125cc7);})[_0x9896('0x29')](function(_0x4f1e59){if(_0x4f1e59['length']>0x0)_0x291bd2[_0x9896('0x4a')]('ui.WhatsappInteractionId\x20IN\x20?',_['map'](_0x4f1e59,'id'));return db['sequelize']['query'](_0x291bd2[_0x9896('0x9c')](),_0x125cc7)['then'](function(_0x1a7a55){var _0x319094=_[_0x9896('0xb0')](_0x1a7a55,_0x9896('0xb1'));var _0x48bd73=[];_0x4f1e59[_0x9896('0x32')](function(_0x11e0c3){_0x48bd73[_0x9896('0x33')](updateWhatsappInteraction(_0x11e0c3,_0x4332f0,_0x319094));});return BPromise['all'](_0x48bd73);});});})['then'](function(_0x216e7e){_0x3df2a9[_0x9896('0xb2')]=_0x216e7e;return _0x3df2a9;})[_0x9896('0x29')](respondWithFilteredResult(_0x417cf1,_0x158524))[_0x9896('0xb3')](handleError(_0x417cf1,null));};exports[_0x9896('0xb4')]=function(_0x532dd7,_0x2af964){var _0x2fb6ef={'raw':![],'where':{'id':_0x532dd7['params']['id']}},_0x518931={};_0x518931['model']=_[_0x9896('0x40')](db['WhatsappInteraction']['rawAttributes']);_0x518931['query']=_[_0x9896('0x40')](_0x532dd7[_0x9896('0x41')]);_0x518931[_0x9896('0x4b')]=_[_0x9896('0x42')](_0x518931[_0x9896('0x3f')],_0x518931[_0x9896('0x41')]);_0x2fb6ef[_0x9896('0x43')]=_[_0x9896('0x42')](_0x518931[_0x9896('0x3f')],qs[_0x9896('0x44')](_0x532dd7[_0x9896('0x41')][_0x9896('0x44')]));_0x2fb6ef[_0x9896('0x43')]=_0x2fb6ef[_0x9896('0x43')][_0x9896('0x45')]?_0x2fb6ef[_0x9896('0x43')]:_0x518931[_0x9896('0x3f')];if(_0x532dd7['query'][_0x9896('0xb5')]){_0x2fb6ef['include']=[{'all':!![]}];}_0x2fb6ef=_['merge']({},_0x2fb6ef,_0x532dd7[_0x9896('0xb6')]);return db['WhatsappInteraction'][_0x9896('0x6b')](_0x2fb6ef)[_0x9896('0x29')](handleEntityNotFound(_0x2af964,null))[_0x9896('0x29')](respondWithResult(_0x2af964,null))[_0x9896('0xb3')](handleError(_0x2af964,null));};exports['create']=function(_0x51550c,_0x5e878b){return db[_0x9896('0x3c')]['create'](_0x51550c[_0x9896('0x77')],{})[_0x9896('0x29')](respondWithResult(_0x5e878b,0xc9))['catch'](handleError(_0x5e878b,null));};exports[_0x9896('0x28')]=function(_0x3fedb8,_0x508c06){if(_0x3fedb8[_0x9896('0x77')]['id']){delete _0x3fedb8[_0x9896('0x77')]['id'];}return db[_0x9896('0x3c')][_0x9896('0x6b')]({'where':{'id':_0x3fedb8['params']['id']}})[_0x9896('0x29')](handleEntityNotFound(_0x508c06,null))[_0x9896('0x29')](saveUpdates(_0x3fedb8[_0x9896('0x77')],null))[_0x9896('0x29')](respondWithResult(_0x508c06,null))[_0x9896('0xb3')](handleError(_0x508c06,null));};exports[_0x9896('0xb7')]=function(_0xa60517,_0x3f5a8c){return db[_0x9896('0x3c')][_0x9896('0x6b')]({'where':{'id':_0xa60517[_0x9896('0xb8')]['id']}})[_0x9896('0x29')](handleEntityNotFound(_0x3f5a8c,null))[_0x9896('0x29')](removeEntity(_0x3f5a8c,null))[_0x9896('0xb3')](handleError(_0x3f5a8c,null));};exports[_0x9896('0xb9')]=function(_0x2e80c2,_0x39c61c){return db[_0x9896('0x3c')]['describe']()[_0x9896('0x29')](respondWithResult(_0x39c61c,null))[_0x9896('0xb3')](handleError(_0x39c61c,null));};exports[_0x9896('0xba')]=function(_0x5f116e,_0x29a1ef,_0x4ccbb2){return db[_0x9896('0xbb')][_0x9896('0x6b')]({'where':{'id':_0x5f116e[_0x9896('0xb8')]['id']}})[_0x9896('0x29')](handleEntityNotFound(_0x29a1ef,null))[_0x9896('0x29')](function(_0x3559bf){if(_0x3559bf){return _0x3559bf['addMessage'](_0x5f116e['body']['ids'],_['omit'](_0x5f116e[_0x9896('0x77')],[_0x9896('0xbc'),'id'])||{});}})[_0x9896('0x29')](respondWithResult(_0x29a1ef,null))[_0x9896('0xb3')](handleError(_0x29a1ef,null));};exports[_0x9896('0xbd')]=function(_0x1b12a8,_0x9f3f73,_0x2c7be7){var _0x37a648={'raw':![],'where':{}};var _0x4e9f05={};var _0x5018f9={'count':0x0,'rows':[]};return db[_0x9896('0x3c')][_0x9896('0xbe')]({'where':{'id':_0x1b12a8['params']['id']}})[_0x9896('0x29')](handleEntityNotFound(_0x9f3f73,null))[_0x9896('0x29')](function(_0x38f937){if(_0x38f937){_0x4e9f05['model']=_['keys'](db[_0x9896('0xbb')]['rawAttributes']);_0x4e9f05[_0x9896('0x41')]=_[_0x9896('0x40')](_0x1b12a8[_0x9896('0x41')]);_0x4e9f05[_0x9896('0x4b')]=_[_0x9896('0x42')](_0x4e9f05[_0x9896('0x3f')],_0x4e9f05[_0x9896('0x41')]);_0x37a648[_0x9896('0x43')]=_[_0x9896('0x42')](_0x4e9f05[_0x9896('0x3f')],qs[_0x9896('0x44')](_0x1b12a8['query']['fields']));_0x37a648[_0x9896('0x43')]=_0x37a648[_0x9896('0x43')]['length']?_0x37a648[_0x9896('0x43')]:_0x4e9f05[_0x9896('0x3f')];if(!_0x1b12a8[_0x9896('0x41')][_0x9896('0x46')]('nolimit')){_0x37a648[_0x9896('0x21')]=qs['limit'](_0x1b12a8[_0x9896('0x41')][_0x9896('0x21')]);_0x37a648[_0x9896('0x20')]=qs['offset'](_0x1b12a8[_0x9896('0x41')][_0x9896('0x20')]);}_0x37a648[_0x9896('0x48')]=qs[_0x9896('0x49')](_0x1b12a8['query']['sort']);_0x37a648[_0x9896('0x4a')]=qs[_0x9896('0x4b')](_[_0x9896('0x4c')](_0x1b12a8[_0x9896('0x41')],_0x4e9f05[_0x9896('0x4b')]));_0x37a648[_0x9896('0x4a')][_0x9896('0xb1')]=_0x38f937['id'];if(_0x1b12a8[_0x9896('0x41')][_0x9896('0x87')]){_0x37a648[_0x9896('0x4a')]=_[_0x9896('0x9e')](_0x37a648['where'],{'$or':_[_0x9896('0x3b')](_0x37a648[_0x9896('0x43')],function(_0x34ac54){var _0x18a306={};_0x18a306[_0x34ac54]={'$like':'%'+_0x1b12a8['query']['filter']+'%'};return _0x18a306;})});}if(_0x1b12a8[_0x9896('0x41')][_0x9896('0xbf')]){var _0x5dd620=_0x1b12a8[_0x9896('0x41')][_0x9896('0xbf')][_0x9896('0x31')](',');var _0x308f37={};_0x308f37[_0x5dd620[0x0]]={'$gte':moment(_0x5dd620[0x1])[_0x9896('0xc0')](_0x9896('0xc1'))};_0x37a648[_0x9896('0x4a')]=_[_0x9896('0x9e')](_0x37a648[_0x9896('0x4a')],_0x308f37);}_0x37a648=_[_0x9896('0x9e')]({},_0x37a648,_0x1b12a8['options']);return db[_0x9896('0xbb')][_0x9896('0x23')]({'where':_0x37a648[_0x9896('0x4a')]})[_0x9896('0x29')](function(_0x204906){_0x5018f9['count']=_0x204906;if(_0x1b12a8['query']['includeAll']){_0x37a648['include']=[{'all':!![]}];}return db[_0x9896('0xbb')][_0x9896('0xc2')](_0x37a648);})[_0x9896('0x29')](function(_0x481432){_0x5018f9[_0x9896('0xb2')]=_0x481432;return _0x5018f9;});}})[_0x9896('0x29')](respondWithFilteredResult(_0x9f3f73,_0x37a648))['catch'](handleError(_0x9f3f73,null));};exports['addTags']=function(_0x3a9b54,_0x2d7221,_0xddf6d2){return db['WhatsappInteraction'][_0x9896('0x6b')]({'where':{'id':_0x3a9b54[_0x9896('0xb8')]['id']}})[_0x9896('0x29')](handleEntityNotFound(_0x2d7221,null))[_0x9896('0x29')](function(_0x43d907){if(_0x43d907){return _0x43d907['setTags'](_0x3a9b54[_0x9896('0x77')][_0x9896('0xbc')],_['omit'](_0x3a9b54[_0x9896('0x77')],[_0x9896('0xbc'),'id'])||{})[_0x9896('0xc3')](function(){return db['Tag'][_0x9896('0xc2')]({'attributes':['id',_0x9896('0x2c'),'color'],'where':{'id':_0x3a9b54['body'][_0x9896('0xbc')]}});})[_0x9896('0x29')](function(_0x4d03f7){socket[_0x9896('0xc4')](_0x9896('0xc5'),{'id':Number(_0x3a9b54[_0x9896('0xb8')]['id']),'tags':_0x4d03f7||[]});return{'id':Number(_0x3a9b54['params']['id']),'tags':_0x4d03f7||[]};});}})[_0x9896('0x29')](respondWithResult(_0x2d7221,null))[_0x9896('0xb3')](handleError(_0x2d7221,null));};exports[_0x9896('0xc6')]=function(_0x503fdf,_0xd726cd,_0x12cdc0){return db[_0x9896('0x3c')][_0x9896('0x6b')]({'where':{'id':_0x503fdf[_0x9896('0xb8')]['id']}})[_0x9896('0x29')](handleEntityNotFound(_0xd726cd,null))[_0x9896('0x29')](function(_0x4f4126){if(_0x4f4126){return _0x4f4126[_0x9896('0xc6')](_0x503fdf[_0x9896('0x41')][_0x9896('0xbc')]);}})[_0x9896('0x29')](respondWithStatusCode(_0xd726cd,null))['catch'](handleError(_0xd726cd,null));};exports[_0x9896('0xc7')]=function(_0x4f854b,_0x5a17ec){var _0x1c61b0=moment()[_0x9896('0xc8')]()[_0x9896('0x9c')]();var _0x2b4c74=path[_0x9896('0xc9')](config['root'],_0x9896('0xca'),_0x9896('0xcb'),_0x9896('0xcc'));var _0x2a6839=path['join'](config['root'],'server','files',_0x9896('0xcd'));var _0x282f69=path[_0x9896('0xc9')](_0x2b4c74,_0x1c61b0);var _0x2cb34d=util['format'](_0x9896('0xce'),_0x4f854b['params']['id'],_0x1c61b0);var _0x3e545b=path[_0x9896('0xc9')](_0x2b4c74,_0x2cb34d);var _0x49ccbd=[];_0x49ccbd[_0x9896('0x33')]({'model':db[_0x9896('0x72')],'as':_0x9896('0x72'),'attributes':['id',_0x9896('0x2e')],'raw':!![]});_0x49ccbd[_0x9896('0x33')]({'model':db[_0x9896('0xcf')],'as':_0x9896('0x68'),'attributes':['id','firstName','lastName'],'raw':!![]});if(_0x4f854b[_0x9896('0x41')][_0x9896('0xcd')]){_0x49ccbd[_0x9896('0x33')]({'model':db[_0x9896('0xd0')],'as':_0x9896('0xd0'),'raw':!![]});}var _0x33a84d=[{'model':db[_0x9896('0xbb')],'as':_0x9896('0xd1'),'attributes':['id',_0x9896('0x77'),_0x9896('0x7b'),_0x9896('0xd2'),'secret',_0x9896('0x82')],'include':_0x49ccbd}];_0x33a84d[_0x9896('0x33')]({'model':db['WhatsappAccount'],'as':_0x9896('0xd3'),'attributes':['id',_0x9896('0x2c')]});_0x33a84d['push']({'model':db[_0x9896('0x72')],'as':_0x9896('0xd4'),'attributes':['id',_0x9896('0x2e')]});return db[_0x9896('0x3c')][_0x9896('0x6b')]({'where':{'id':_0x4f854b[_0x9896('0xb8')]['id']},'include':_0x33a84d})[_0x9896('0x29')](handleEntityNotFound(_0x5a17ec,null))[_0x9896('0x29')](function(_0x4eb763){if(_0x4eb763){var _0xcec0b9=_0x4eb763['get']({'plain':!![]});fs['mkdirSync'](_0x282f69);var _0x4ec12e={'channel':_0x9896('0xd5'),'account':_0xcec0b9[_0x9896('0xd3')][_0x9896('0x2c')],'agent':_0xcec0b9['Owner']?_0xcec0b9[_0x9896('0xd4')]['fullname']:_0x9896('0xd6'),'createdAt':moment(_0xcec0b9[_0x9896('0x7b')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0xcec0b9[_0x9896('0x39')]?moment(_0xcec0b9[_0x9896('0xd7')])[_0x9896('0xc0')]('YYYY-MM-DD\x20HH:mm:ss')[_0x9896('0x9c')]():'','disposition':_0xcec0b9['disposition'],'messages':_(_0xcec0b9[_0x9896('0xd1')])[_0x9896('0x87')]({'secret':![]})['map'](function(_0x58c56b){if(_0x58c56b['Attachment']){var _0x2571a7=path[_0x9896('0xc9')](_0x2a6839,_0x58c56b[_0x9896('0xd0')]['basename']);if(fs['existsSync'](_0x2571a7)){fs[_0x9896('0xd8')](_0x2571a7)[_0x9896('0xd9')](fs[_0x9896('0xda')](path['join'](_0x282f69,_0x58c56b['Attachment'][_0x9896('0xdb')])));}}return{'date':moment(_0x58c56b[_0x9896('0x7b')])[_0x9896('0xc0')](_0x9896('0xc1'))[_0x9896('0x9c')](),'sender':_0x58c56b['direction']===_0x9896('0xdc')?_0x58c56b[_0x9896('0x72')]?_0x58c56b[_0x9896('0x72')][_0x9896('0x2e')]:_0x9896('0xdd'):_0x58c56b[_0x9896('0x68')]['firstName']+(_0x58c56b[_0x9896('0x68')]['lastName']?'\x20'+_0x58c56b['Contact'][_0x9896('0xde')]:''),'body':_0x58c56b[_0x9896('0xd0')]?_0x58c56b[_0x9896('0xd0')][_0x9896('0xdb')]:_0x58c56b[_0x9896('0x77')],'direction':_0x58c56b[_0x9896('0xd2')]===_0x9896('0xdc')?'A':'C','secret':_0x58c56b[_0x9896('0xdf')],'read':_0x58c56b[_0x9896('0x82')],'attachment':_0x58c56b['Attachment']};})[_0x9896('0x65')]()};return ejs['renderFile'](path[_0x9896('0xc9')](config[_0x9896('0xe0')],_0x9896('0xca'),_0x9896('0xe1'),'downloadInteraction.ejs'),{'interaction':_0x4ec12e})[_0x9896('0x29')](function(_0x97ab07){var _0x4eddc4=path['join'](_0x282f69,_0x9896('0xe2')+_0xcec0b9['id']+'-'+_0x1c61b0+'.pdf');var _0x3e502a={'path':_0x4eddc4,'channel':_0x9896('0xd5'),'interactionId':_0xcec0b9['id']};return pdf[_0x9896('0xe3')](_0x97ab07,_0x3e502a);})['then'](function(){return new BPromise(function(_0x54b371,_0x4584ff){zipdir(_0x282f69,{'saveTo':_0x3e545b},function(_0x252bea,_0x300ccf){if(_0x252bea)return _0x4584ff(_0x252bea);return _0x54b371(_0x300ccf);});})[_0x9896('0x29')](function(){return new BPromise(function(_0x500bc3,_0x2e6038){rimraf(_0x282f69,function(_0x3416fc){if(_0x3416fc)_0x2e6038(_0x3416fc);return _0x500bc3();});});})[_0x9896('0x29')](function(){return _0x5a17ec['download'](_0x3e545b,_0x2cb34d,function(_0x5a5119){if(_0x5a5119){console[_0x9896('0xe4')]('err',_0x5a5119);}else{fs[_0x9896('0xe5')](_0x3e545b);}});});});}else{return _0x5a17ec[_0x9896('0x1d')](0xc8);}})['catch'](handleError(_0x5a17ec,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 948ced1..2f8c1ed 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 _0x24e9=['events','WhatsappInteraction','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','remove','getUsers','then','map','findAll','setDataValue','unreadMessages','emit','catch','hasOwnProperty','hook','exports'];(function(_0x71e0db,_0x5ca642){var _0x15ba8b=function(_0x196c2f){while(--_0x196c2f){_0x71e0db['push'](_0x71e0db['shift']());}};_0x15ba8b(++_0x5ca642);}(_0x24e9,0x85));var _0x924e=function(_0x1992f1,_0x5c61f0){_0x1992f1=_0x1992f1-0x0;var _0x413dfe=_0x24e9[_0x1992f1];return _0x413dfe;};'use strict';var EventEmitter=require(_0x924e('0x0'));var WhatsappInteraction=require('../../mysqldb')['db'][_0x924e('0x1')];var WhatsappMessage=require(_0x924e('0x2'))['db'][_0x924e('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x924e('0x4')](0x0);var events={'afterCreate':_0x924e('0x5'),'afterUpdate':_0x924e('0x6'),'afterDestroy':_0x924e('0x7')};function emitEvent(_0x1564ff){return function(_0x4ecdb9,_0x18346f,_0x31f0c3){_0x4ecdb9[_0x924e('0x8')]({'attributes':['id'],'raw':!![]})[_0x924e('0x9')](function(_0xdcafe0){_0x4ecdb9['setDataValue']('Users',_0xdcafe0[_0x924e('0xa')](function(_0x1604a8){return{'id':_0x1604a8['id']};}));return WhatsappMessage[_0x924e('0xb')]({'where':{'WhatsappInteractionId':_0x4ecdb9['id'],'direction':'in','read':![]},'raw':!![]});})[_0x924e('0x9')](function(_0x576c1c){_0x4ecdb9[_0x924e('0xc')](_0x924e('0xd'),_0x576c1c['length']);WhatsappInteractionEvents[_0x924e('0xe')](_0x1564ff+':'+_0x4ecdb9['id'],_0x4ecdb9);WhatsappInteractionEvents['emit'](_0x1564ff,_0x4ecdb9);_0x31f0c3(null);})[_0x924e('0xf')](_0x31f0c3(null));};}for(var e in events){if(events[_0x924e('0x10')](e)){var event=events[e];WhatsappInteraction[_0x924e('0x11')](e,emitEvent(event));}}module[_0x924e('0x12')]=WhatsappInteractionEvents; \ No newline at end of file +var _0xc686=['save','update','remove','getUsers','then','setDataValue','Users','findAll','unreadMessages','length','emit','hasOwnProperty','hook','WhatsappInteraction','WhatsappMessage'];(function(_0x21de89,_0x367053){var _0x290b7e=function(_0x540704){while(--_0x540704){_0x21de89['push'](_0x21de89['shift']());}};_0x290b7e(++_0x367053);}(_0xc686,0x148));var _0x6c68=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xc686[_0x4709c0];return _0x13348b;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require('../../mysqldb')['db'][_0x6c68('0x0')];var WhatsappMessage=require('../../mysqldb')['db'][_0x6c68('0x1')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6c68('0x2'),'afterUpdate':_0x6c68('0x3'),'afterDestroy':_0x6c68('0x4')};function emitEvent(_0x434bb0){return function(_0x248375,_0x24898f,_0x1c1b02){_0x248375[_0x6c68('0x5')]({'attributes':['id'],'raw':!![]})[_0x6c68('0x6')](function(_0x1e88b0){_0x248375[_0x6c68('0x7')](_0x6c68('0x8'),_0x1e88b0['map'](function(_0x303a45){return{'id':_0x303a45['id']};}));return WhatsappMessage[_0x6c68('0x9')]({'where':{'WhatsappInteractionId':_0x248375['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x3988d7){_0x248375['setDataValue'](_0x6c68('0xa'),_0x3988d7[_0x6c68('0xb')]);WhatsappInteractionEvents['emit'](_0x434bb0+':'+_0x248375['id'],_0x248375);WhatsappInteractionEvents[_0x6c68('0xc')](_0x434bb0,_0x248375);_0x1c1b02(null);})['catch'](_0x1c1b02(null));};}for(var e in events){if(events[_0x6c68('0xd')](e)){var event=events[e];WhatsappInteraction[_0x6c68('0xe')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index f724f43..db1d5c1 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 _0x8742=['./whatsappInteraction.attributes','exports','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','path','rimraf','../../config/environment'];(function(_0x4a56a6,_0x5b81b2){var _0x4b7217=function(_0x19e522){while(--_0x19e522){_0x4a56a6['push'](_0x4a56a6['shift']());}};_0x4b7217(++_0x5b81b2);}(_0x8742,0xe9));var _0x2874=function(_0x415273,_0x2034a3){_0x415273=_0x415273-0x0;var _0x1eba2c=_0x8742[_0x415273];return _0x1eba2c;};'use strict';var _=require(_0x2874('0x0'));var util=require(_0x2874('0x1'));var logger=require(_0x2874('0x2'))('api');var moment=require(_0x2874('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2874('0x4'));var rimraf=require(_0x2874('0x5'));var config=require(_0x2874('0x6'));var attributes=require(_0x2874('0x7'));module[_0x2874('0x8')]=function(_0x28fdb7,_0xb3ba8){return _0x28fdb7['define'](_0x2874('0x9'),attributes,{'tableName':_0x2874('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x56730c,_0x317517,_0x23f55b){if(_0x56730c[_0x2874('0xb')](_0x2874('0xc'))){_0x56730c[_0x2874('0xd')]=moment()[_0x2874('0xe')](_0x2874('0xf'));}_0x23f55b(null,_0x56730c);}}});}; \ No newline at end of file +var _0x01b5=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./whatsappInteraction.attributes','define','whatsapp_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x01b5,0xca));var _0x501b=function(_0x459399,_0x488ed8){_0x459399=_0x459399-0x0;var _0x3cb0a9=_0x01b5[_0x459399];return _0x3cb0a9;};'use strict';var _=require(_0x501b('0x0'));var util=require(_0x501b('0x1'));var logger=require(_0x501b('0x2'))(_0x501b('0x3'));var moment=require(_0x501b('0x4'));var BPromise=require(_0x501b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x501b('0x6'));var rimraf=require(_0x501b('0x7'));var config=require(_0x501b('0x8'));var attributes=require(_0x501b('0x9'));module['exports']=function(_0x8c2468,_0x145a74){return _0x8c2468[_0x501b('0xa')]('WhatsappInteraction',attributes,{'tableName':_0x501b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2df165,_0x15c4f4,_0x4c0526){if(_0x2df165[_0x501b('0xc')](_0x501b('0xd'))){_0x2df165[_0x501b('0xe')]=moment()[_0x501b('0xf')](_0x501b('0x10'));}_0x4c0526(null,_0x2df165);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 3cff768..432dc8b 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 _0xbfcf=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','./whatsappInteraction.socket','request','then','info','request\x20sent','debug','stringify','error','code','WhatsappInteraction,\x20%s,\x20%s','message','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','options','where','limit','AddTagsToWhatsappInteraction','find','body','ids','omit','AddTags','lodash','util','moment'];(function(_0x4692a1,_0x41f54f){var _0x128700=function(_0x2661dc){while(--_0x2661dc){_0x4692a1['push'](_0x4692a1['shift']());}};_0x128700(++_0x41f54f);}(_0xbfcf,0x15c));var _0xfbfc=function(_0x297c55,_0x34fa75){_0x297c55=_0x297c55-0x0;var _0x120389=_0xbfcf[_0x297c55];return _0x120389;};'use strict';var _=require(_0xfbfc('0x0'));var util=require(_0xfbfc('0x1'));var moment=require(_0xfbfc('0x2'));var BPromise=require(_0xfbfc('0x3'));var rs=require(_0xfbfc('0x4'));var fs=require('fs');var Redis=require(_0xfbfc('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xfbfc('0x6'));var logger=require(_0xfbfc('0x7'))(_0xfbfc('0x8'));var config=require(_0xfbfc('0x9'));var jayson=require(_0xfbfc('0xa'));var client=jayson[_0xfbfc('0xb')][_0xfbfc('0xc')]({'port':0x232a});config['redis']=_[_0xfbfc('0xd')](config[_0xfbfc('0xe')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfbfc('0xe')]));require(_0xfbfc('0xf'))['register'](socket);function respondWithRpcPromise(_0x20d7f9,_0x3a951e,_0xf8cd20){return new BPromise(function(_0x14a66a,_0x5d43e1){return client[_0xfbfc('0x10')](_0x20d7f9,_0xf8cd20)[_0xfbfc('0x11')](function(_0x1133a9){logger[_0xfbfc('0x12')]('WhatsappInteraction,\x20%s,\x20%s',_0x3a951e,_0xfbfc('0x13'));logger[_0xfbfc('0x14')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x3a951e,'request\x20sent',JSON[_0xfbfc('0x15')](_0x1133a9));if(_0x1133a9[_0xfbfc('0x16')]){if(_0x1133a9['error'][_0xfbfc('0x17')]===0x1f4){logger[_0xfbfc('0x16')](_0xfbfc('0x18'),_0x3a951e,_0x1133a9['error']['message']);return _0x5d43e1(_0x1133a9[_0xfbfc('0x16')]['message']);}logger['error'](_0xfbfc('0x18'),_0x3a951e,_0x1133a9[_0xfbfc('0x16')][_0xfbfc('0x19')]);return _0x14a66a(_0x1133a9[_0xfbfc('0x16')][_0xfbfc('0x19')]);}else{logger['info']('WhatsappInteraction,\x20%s,\x20%s',_0x3a951e,_0xfbfc('0x13'));_0x14a66a(_0x1133a9['result']['message']);}})[_0xfbfc('0x1a')](function(_0x848276){logger[_0xfbfc('0x16')](_0xfbfc('0x18'),_0x3a951e,_0x848276);_0x5d43e1(_0x848276);});});}exports[_0xfbfc('0x1b')]=function(_0x24b946){var _0x249585=this;return new Promise(function(_0x111d64,_0x493024){return db[_0xfbfc('0x1c')][_0xfbfc('0x1d')](_0x24b946['body'],{'raw':_0x24b946['options']?_0x24b946[_0xfbfc('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24b946['options']?_0x24b946[_0xfbfc('0x1e')][_0xfbfc('0x1f')]||null:null,'attributes':_0x24b946[_0xfbfc('0x1e')]?_0x24b946[_0xfbfc('0x1e')]['attributes']||null:null,'limit':_0x24b946['options']?_0x24b946[_0xfbfc('0x1e')][_0xfbfc('0x20')]||null:null})[_0xfbfc('0x11')](function(_0x317545){logger[_0xfbfc('0x12')](_0xfbfc('0x1b'),_0x24b946);logger['debug']('UpdateWhatsappInteraction',_0x24b946,JSON[_0xfbfc('0x15')](_0x317545));_0x111d64(_0x317545);})[_0xfbfc('0x1a')](function(_0x51b327){logger[_0xfbfc('0x16')]('UpdateWhatsappInteraction',_0x51b327[_0xfbfc('0x19')],_0x24b946);_0x493024(_0x249585[_0xfbfc('0x16')](0x1f4,_0x51b327['message']));});});};exports[_0xfbfc('0x21')]=function(_0x3edbf8){return new Promise(function(_0xc77d14,_0xb30ef1){return db[_0xfbfc('0x1c')][_0xfbfc('0x22')]({'where':_0x3edbf8['options']?_0x3edbf8['options'][_0xfbfc('0x1f')]||null:null})[_0xfbfc('0x11')](function(_0x5f02cc){if(_0x5f02cc){return _0x5f02cc['addTags'](_0x3edbf8[_0xfbfc('0x23')][_0xfbfc('0x24')],_[_0xfbfc('0x25')](_0x3edbf8[_0xfbfc('0x23')],[_0xfbfc('0x24'),'id'])||{});}})['spread'](function(_0x17ed4e){logger[_0xfbfc('0x12')](_0xfbfc('0x26'),_0x3edbf8);logger[_0xfbfc('0x14')]('AddTags',_0x3edbf8,JSON['stringify'](_0x17ed4e));_0xc77d14(_0x17ed4e);})['catch'](function(_0x5dd69d){logger[_0xfbfc('0x16')](_0xfbfc('0x26'),_0x5dd69d[_0xfbfc('0x19')],_0x3edbf8);_0xb30ef1(_this['error'](0x1f4,_0x5dd69d['message']));});});}; \ No newline at end of file +var _0xd2ee=['redis','defaults','localhost','./whatsappInteraction.socket','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','catch','UpdateWhatsappInteraction','body','options','raw','where','attributes','stringify','WhatsappInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x1252be,_0x591036){var _0x4412a1=function(_0x511429){while(--_0x511429){_0x1252be['push'](_0x1252be['shift']());}};_0x4412a1(++_0x591036);}(_0xd2ee,0x1e1));var _0xed2e=function(_0x90402,_0x1ed6d8){_0x90402=_0x90402-0x0;var _0x29cdff=_0xd2ee[_0x90402];return _0x29cdff;};'use strict';var _=require(_0xed2e('0x0'));var util=require(_0xed2e('0x1'));var moment=require(_0xed2e('0x2'));var BPromise=require(_0xed2e('0x3'));var rs=require(_0xed2e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xed2e('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xed2e('0x6'));var config=require(_0xed2e('0x7'));var jayson=require(_0xed2e('0x8'));var client=jayson[_0xed2e('0x9')][_0xed2e('0xa')]({'port':0x232a});config[_0xed2e('0xb')]=_[_0xed2e('0xc')](config[_0xed2e('0xb')],{'host':_0xed2e('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xed2e('0xb')]));require(_0xed2e('0xe'))[_0xed2e('0xf')](socket);function respondWithRpcPromise(_0x7f685,_0x247df1,_0x5826f9){return new BPromise(function(_0x5a1e77,_0x8509f8){return client[_0xed2e('0x10')](_0x7f685,_0x5826f9)[_0xed2e('0x11')](function(_0xc16d22){logger[_0xed2e('0x12')](_0xed2e('0x13'),_0x247df1,'request\x20sent');logger[_0xed2e('0x14')](_0xed2e('0x15'),_0x247df1,'request\x20sent',JSON['stringify'](_0xc16d22));if(_0xc16d22['error']){if(_0xc16d22[_0xed2e('0x16')][_0xed2e('0x17')]===0x1f4){logger[_0xed2e('0x16')]('WhatsappInteraction,\x20%s,\x20%s',_0x247df1,_0xc16d22['error'][_0xed2e('0x18')]);return _0x8509f8(_0xc16d22[_0xed2e('0x16')]['message']);}logger[_0xed2e('0x16')](_0xed2e('0x13'),_0x247df1,_0xc16d22[_0xed2e('0x16')][_0xed2e('0x18')]);return _0x5a1e77(_0xc16d22['error']['message']);}else{logger[_0xed2e('0x12')](_0xed2e('0x13'),_0x247df1,_0xed2e('0x19'));_0x5a1e77(_0xc16d22['result'][_0xed2e('0x18')]);}})[_0xed2e('0x1a')](function(_0x2a1e53){logger['error'](_0xed2e('0x13'),_0x247df1,_0x2a1e53);_0x8509f8(_0x2a1e53);});});}exports[_0xed2e('0x1b')]=function(_0x1bbec3){var _0x37eb45=this;return new Promise(function(_0x42ed98,_0x2578da){return db['WhatsappInteraction']['update'](_0x1bbec3[_0xed2e('0x1c')],{'raw':_0x1bbec3[_0xed2e('0x1d')]?_0x1bbec3[_0xed2e('0x1d')][_0xed2e('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1bbec3['options']?_0x1bbec3[_0xed2e('0x1d')][_0xed2e('0x1f')]||null:null,'attributes':_0x1bbec3[_0xed2e('0x1d')]?_0x1bbec3[_0xed2e('0x1d')][_0xed2e('0x20')]||null:null,'limit':_0x1bbec3[_0xed2e('0x1d')]?_0x1bbec3[_0xed2e('0x1d')]['limit']||null:null})[_0xed2e('0x11')](function(_0x1cb766){logger['info']('UpdateWhatsappInteraction',_0x1bbec3);logger[_0xed2e('0x14')](_0xed2e('0x1b'),_0x1bbec3,JSON[_0xed2e('0x21')](_0x1cb766));_0x42ed98(_0x1cb766);})['catch'](function(_0x597311){logger['error'](_0xed2e('0x1b'),_0x597311[_0xed2e('0x18')],_0x1bbec3);_0x2578da(_0x37eb45['error'](0x1f4,_0x597311[_0xed2e('0x18')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x271465){return new Promise(function(_0x20c14d,_0x27c5a1){return db[_0xed2e('0x22')][_0xed2e('0x23')]({'where':_0x271465[_0xed2e('0x1d')]?_0x271465['options'][_0xed2e('0x1f')]||null:null})[_0xed2e('0x11')](function(_0x540560){if(_0x540560){return _0x540560[_0xed2e('0x24')](_0x271465['body'][_0xed2e('0x25')],_[_0xed2e('0x26')](_0x271465[_0xed2e('0x1c')],[_0xed2e('0x25'),'id'])||{});}})[_0xed2e('0x27')](function(_0x29ad9c){logger['info']('AddTags',_0x271465);logger[_0xed2e('0x14')](_0xed2e('0x28'),_0x271465,JSON['stringify'](_0x29ad9c));_0x20c14d(_0x29ad9c);})['catch'](function(_0x126ba3){logger['error'](_0xed2e('0x28'),_0x126ba3['message'],_0x271465);_0x27c5a1(_this[_0xed2e('0x16')](0x1f4,_0x126ba3[_0xed2e('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 332b41d..eef0193 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 _0x59e7=['register','length','whatsappInteraction:','./whatsappInteraction.events','remove','update','emit','removeListener'];(function(_0x1233d2,_0x5416f4){var _0x22759e=function(_0xb516aa){while(--_0xb516aa){_0x1233d2['push'](_0x1233d2['shift']());}};_0x22759e(++_0x5416f4);}(_0x59e7,0xab));var _0x759e=function(_0x71ac01,_0x4d0e8b){_0x71ac01=_0x71ac01-0x0;var _0xab725d=_0x59e7[_0x71ac01];return _0xab725d;};'use strict';var WhatsappInteractionEvents=require(_0x759e('0x0'));var events=['save',_0x759e('0x1'),_0x759e('0x2')];function createListener(_0x4e7062,_0x5055a4){return function(_0x3bec9b){_0x5055a4[_0x759e('0x3')](_0x4e7062,_0x3bec9b);};}function removeListener(_0xf88253,_0x47595d){return function(){WhatsappInteractionEvents[_0x759e('0x4')](_0xf88253,_0x47595d);};}exports[_0x759e('0x5')]=function(_0x1dd9e7){for(var _0x98aa81=0x0,_0x1fd2ea=events[_0x759e('0x6')];_0x98aa81<_0x1fd2ea;_0x98aa81++){var _0x1d022a=events[_0x98aa81];var _0xd9074=createListener(_0x759e('0x7')+_0x1d022a,_0x1dd9e7);WhatsappInteractionEvents['on'](_0x1d022a,_0xd9074);}}; \ No newline at end of file +var _0xd57f=['emit','removeListener','register','save','remove','update'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd57f,0x171));var _0xfd57=function(_0x5c33b1,_0x11a279){_0x5c33b1=_0x5c33b1-0x0;var _0x451c53=_0xd57f[_0x5c33b1];return _0x451c53;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=[_0xfd57('0x0'),_0xfd57('0x1'),_0xfd57('0x2')];function createListener(_0x374f8e,_0x108ea9){return function(_0x59ff83){_0x108ea9[_0xfd57('0x3')](_0x374f8e,_0x59ff83);};}function removeListener(_0x3ebe32,_0xcaf3fa){return function(){WhatsappInteractionEvents[_0xfd57('0x4')](_0x3ebe32,_0xcaf3fa);};}exports[_0xfd57('0x5')]=function(_0x45c015){for(var _0x3e3318=0x0,_0x3ab5dc=events['length'];_0x3e3318<_0x3ab5dc;_0x3e3318++){var _0x52888b=events[_0x3e3318];var _0x47236d=createListener('whatsappInteraction:'+_0x52888b,_0x45c015);WhatsappInteractionEvents['on'](_0x52888b,_0x47236d);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 90e24cb..dc02bd3 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 _0x90db=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','tracked','whatsappmessage:create','post','/:id/status','put','/:id/accept','accept','/:id/reject','delete','exports','multer'];(function(_0x297eea,_0x5060be){var _0x1c42d2=function(_0x3afff4){while(--_0x3afff4){_0x297eea['push'](_0x297eea['shift']());}};_0x1c42d2(++_0x5060be);}(_0x90db,0x107));var _0xb90d=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0x90db[_0x47a7d0];return _0xb9bd08;};'use strict';var multer=require(_0xb90d('0x0'));var util=require(_0xb90d('0x1'));var path=require(_0xb90d('0x2'));var timeout=require(_0xb90d('0x3'));var express=require(_0xb90d('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb90d('0x5'));var interaction=require(_0xb90d('0x6'));var config=require(_0xb90d('0x7'));var controller=require('./whatsappMessage.controller');router['get']('/',auth[_0xb90d('0x8')](),controller[_0xb90d('0x9')]);router[_0xb90d('0xa')]('/describe',auth['isAuthenticated'](),controller[_0xb90d('0xb')]);router['get'](_0xb90d('0xc'),auth[_0xb90d('0x8')](),controller[_0xb90d('0xd')]);router['post']('/',auth[_0xb90d('0x8')](),interaction[_0xb90d('0xe')]('whatsapp',_0xb90d('0xf')),controller['create']);router[_0xb90d('0x10')](_0xb90d('0x11'),controller['status']);router[_0xb90d('0x12')](_0xb90d('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xb90d('0x12')](_0xb90d('0x13'),auth[_0xb90d('0x8')](),controller[_0xb90d('0x14')]);router['put'](_0xb90d('0x15'),auth[_0xb90d('0x8')](),controller['reject']);router[_0xb90d('0x16')](_0xb90d('0xc'),auth[_0xb90d('0x8')](),controller['destroy']);module[_0xb90d('0x17')]=router; \ No newline at end of file +var _0x735b=['reject','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','describe','show','tracked','whatsapp','whatsappmessage:create','create','post','/:id/status','status','put','/:id','/:id/accept','accept'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x735b,0x197));var _0xb735=function(_0x3f933d,_0x46473e){_0x3f933d=_0x3f933d-0x0;var _0x3c424a=_0x735b[_0x3f933d];return _0x3c424a;};'use strict';var multer=require(_0xb735('0x0'));var util=require(_0xb735('0x1'));var path=require(_0xb735('0x2'));var timeout=require(_0xb735('0x3'));var express=require(_0xb735('0x4'));var router=express[_0xb735('0x5')]();var fs_extra=require(_0xb735('0x6'));var auth=require(_0xb735('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xb735('0x8'));var controller=require(_0xb735('0x9'));router[_0xb735('0xa')]('/',auth[_0xb735('0xb')](),controller['index']);router[_0xb735('0xa')]('/describe',auth[_0xb735('0xb')](),controller[_0xb735('0xc')]);router[_0xb735('0xa')]('/:id',auth[_0xb735('0xb')](),controller[_0xb735('0xd')]);router['post']('/',auth[_0xb735('0xb')](),interaction[_0xb735('0xe')](_0xb735('0xf'),_0xb735('0x10')),controller[_0xb735('0x11')]);router[_0xb735('0x12')](_0xb735('0x13'),controller[_0xb735('0x14')]);router[_0xb735('0x15')](_0xb735('0x16'),auth[_0xb735('0xb')](),controller['update']);router[_0xb735('0x15')](_0xb735('0x17'),auth[_0xb735('0xb')](),controller[_0xb735('0x18')]);router['put']('/:id/reject',auth[_0xb735('0xb')](),controller[_0xb735('0x19')]);router['delete'](_0xb735('0x16'),auth[_0xb735('0xb')](),controller['destroy']);module[_0xb735('0x1a')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index fdac64c..8d53094 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 _0xd7ed=['exports','TEXT','medium','BOOLEAN','ENUM','out','STRING','DATE'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xd7ed,0x1a8));var _0xdd7e=function(_0x4eafed,_0x26e2bc){_0x4eafed=_0x4eafed-0x0;var _0x159c85=_0xd7ed[_0x4eafed];return _0x159c85;};'use strict';var Sequelize=require('sequelize');module[_0xdd7e('0x0')]={'body':{'type':Sequelize[_0xdd7e('0x1')](_0xdd7e('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xdd7e('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xdd7e('0x4')]('in',_0xdd7e('0x5')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xdd7e('0x6')](0xbe)},'phone':{'type':Sequelize[_0xdd7e('0x6')]},'readAt':{'type':Sequelize[_0xdd7e('0x7')]},'secret':{'type':Sequelize[_0xdd7e('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xdd7e('0x6')]},'providerResponse':{'type':Sequelize[_0xdd7e('0x1')]}}; \ No newline at end of file +var _0x9137=['DATE','exports','TEXT','BOOLEAN','out','STRING'];(function(_0x162fb6,_0x23da0d){var _0x10d3b0=function(_0x381a21){while(--_0x381a21){_0x162fb6['push'](_0x162fb6['shift']());}};_0x10d3b0(++_0x23da0d);}(_0x9137,0x15d));var _0x7913=function(_0x5011f5,_0x92181b){_0x5011f5=_0x5011f5-0x0;var _0x2b0e3f=_0x9137[_0x5011f5];return _0x2b0e3f;};'use strict';var Sequelize=require('sequelize');module[_0x7913('0x0')]={'body':{'type':Sequelize[_0x7913('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x7913('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x7913('0x3')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x7913('0x4')](0xbe)},'phone':{'type':Sequelize[_0x7913('0x4')]},'readAt':{'type':Sequelize[_0x7913('0x5')]},'secret':{'type':Sequelize[_0x7913('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'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 6573454..df3ab42 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 _0x6dca=['sequelize','Sequelize','QueryTypes','SELECT','contact','User','manual','interface','format','SIP/%s','channel','motionChannel','EventManager','acceptmessage','whatsapp','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','fullname','email','internal','rejectmessage','WhatsappAccount','WhatsappAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','redis','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','request','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','end','stack','name','send','index','map','WhatsappMessage','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','create','body','find','describe','whatsapp-interactions','accept','read','UserId','agent','get','WhatsappInteraction','WhatsappInteractionId','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','user','stringify','null','AcceptMessage','acceptMessage','ContactId'];(function(_0x3bee55,_0x4e25c8){var _0x5649d2=function(_0x13d730){while(--_0x13d730){_0x3bee55['push'](_0x3bee55['shift']());}};_0x5649d2(++_0x4e25c8);}(_0x6dca,0x1c8));var _0xa6dc=function(_0x2d5bc0,_0x4ca98e){_0x2d5bc0=_0x2d5bc0-0x0;var _0x1841c3=_0x6dca[_0x2d5bc0];return _0x1841c3;};'use strict';var emlformat=require(_0xa6dc('0x0'));var rimraf=require(_0xa6dc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa6dc('0x2'));var rp=require('request-promise');var moment=require(_0xa6dc('0x3'));var BPromise=require(_0xa6dc('0x4'));var Mustache=require(_0xa6dc('0x5'));var util=require(_0xa6dc('0x6'));var path=require(_0xa6dc('0x7'));var sox=require(_0xa6dc('0x8'));var csv=require(_0xa6dc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa6dc('0xa'));var crypto=require(_0xa6dc('0xb'));var jsforce=require(_0xa6dc('0xc'));var deskjs=require(_0xa6dc('0xd'));var toCsv=require(_0xa6dc('0x9'));var querystring=require(_0xa6dc('0xe'));var Papa=require(_0xa6dc('0xf'));var Redis=require(_0xa6dc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa6dc('0x11'));var as=require(_0xa6dc('0x12'));var hardwareService=require(_0xa6dc('0x13'));var logger=require(_0xa6dc('0x14'))(_0xa6dc('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa6dc('0x16'));var db=require('../../mysqldb')['db'];config[_0xa6dc('0x17')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa6dc('0x18'))(new Redis(config['redis']));require(_0xa6dc('0x19'))[_0xa6dc('0x1a')](socket);var jayson=require(_0xa6dc('0x1b'));var client=jayson[_0xa6dc('0x1c')]['http']({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5aa29d,_0x1855b1,_0x4a3fe0,_0x37ab11){return new BPromise(function(_0x2ada2c,_0x494e40){var _0x3ceb15=_0x37ab11||client;return _0x3ceb15[_0xa6dc('0x1d')](_0x5aa29d,_0x4a3fe0)[_0xa6dc('0x1e')](function(_0x205b24){logger['info'](_0xa6dc('0x1f'),_0x1855b1,_0xa6dc('0x20'));logger[_0xa6dc('0x21')](_0xa6dc('0x22'),_0x1855b1,'request\x20sent',JSON['stringify'](_0x205b24));if(_0x205b24[_0xa6dc('0x23')]){if(_0x205b24['error']['code']===0x1f4){logger[_0xa6dc('0x23')](_0xa6dc('0x1f'),_0x1855b1,_0x205b24[_0xa6dc('0x23')]['message']);return _0x494e40(_0x205b24[_0xa6dc('0x23')][_0xa6dc('0x24')]);}logger[_0xa6dc('0x23')]('WhatsappMessage,\x20%s,\x20%s',_0x1855b1,_0x205b24[_0xa6dc('0x23')]['message']);return _0x2ada2c(_0x205b24[_0xa6dc('0x23')]['message']);}else{logger[_0xa6dc('0x25')]('WhatsappMessage,\x20%s,\x20%s',_0x1855b1,_0xa6dc('0x20'));_0x2ada2c(_0x205b24[_0xa6dc('0x26')][_0xa6dc('0x24')]);}})[_0xa6dc('0x27')](function(_0x25519e){logger[_0xa6dc('0x23')](_0xa6dc('0x1f'),_0x1855b1,_0x25519e);_0x494e40(_0x25519e);});});}function respondWithStatusCode(_0x102822,_0x45f74b){_0x45f74b=_0x45f74b||0xcc;return function(_0x69c55){if(_0x69c55){return _0x102822[_0xa6dc('0x28')](_0x45f74b);}return _0x102822['status'](_0x45f74b)['end']();};}function respondWithResult(_0x3e9f5f,_0xa902f3){_0xa902f3=_0xa902f3||0xc8;return function(_0x4167a0){if(_0x4167a0){return _0x3e9f5f[_0xa6dc('0x29')](_0xa902f3)[_0xa6dc('0x2a')](_0x4167a0);}};}function respondWithFilteredResult(_0x33cfbf,_0x2cd1e0){return function(_0x172a63){if(_0x172a63){var _0x2c8003=typeof _0x2cd1e0[_0xa6dc('0x2b')]===_0xa6dc('0x2c')&&typeof _0x2cd1e0[_0xa6dc('0x2d')]===_0xa6dc('0x2c');var _0x5de7dd=_0x172a63[_0xa6dc('0x2e')];var _0x6cc72e=_0x2c8003?0x0:_0x2cd1e0[_0xa6dc('0x2b')];var _0x41efa5=_0x2c8003?_0x172a63['count']:_0x2cd1e0['offset']+_0x2cd1e0[_0xa6dc('0x2d')];var _0x1c439b;if(_0x41efa5>=_0x5de7dd){_0x41efa5=_0x5de7dd;_0x1c439b=0xc8;}else{_0x1c439b=0xce;}_0x33cfbf[_0xa6dc('0x29')](_0x1c439b);return _0x33cfbf['set'](_0xa6dc('0x2f'),_0x6cc72e+'-'+_0x41efa5+'/'+_0x5de7dd)['json'](_0x172a63);}return null;};}function patchUpdates(_0x17f05e){return function(_0x136080){try{jsonpatch[_0xa6dc('0x30')](_0x136080,_0x17f05e,!![]);}catch(_0x56980a){return BPromise[_0xa6dc('0x31')](_0x56980a);}return _0x136080[_0xa6dc('0x32')]();};}function saveUpdates(_0x1b7f09,_0x42d1a1){return function(_0x1f422a){if(_0x1f422a){return _0x1f422a[_0xa6dc('0x33')](_0x1b7f09)['then'](function(_0x325f45){return _0x325f45;});}return null;};}function removeEntity(_0x144efa,_0xdffa1){return function(_0x3c52dc){if(_0x3c52dc){return _0x3c52dc[_0xa6dc('0x34')]()['then'](function(){_0x144efa[_0xa6dc('0x29')](0xcc)[_0xa6dc('0x35')]();});}};}function handleEntityNotFound(_0x5683ee,_0x576d05){return function(_0x4ffad6){if(!_0x4ffad6){_0x5683ee[_0xa6dc('0x28')](0x194);}return _0x4ffad6;};}function handleError(_0x119d4c,_0x5c6f92){_0x5c6f92=_0x5c6f92||0x1f4;return function(_0x35c6e2){logger[_0xa6dc('0x23')](_0x35c6e2[_0xa6dc('0x36')]);if(_0x35c6e2['name']){delete _0x35c6e2[_0xa6dc('0x37')];}_0x119d4c[_0xa6dc('0x29')](_0x5c6f92)[_0xa6dc('0x38')](_0x35c6e2);};}exports[_0xa6dc('0x39')]=function(_0x70e9ee,_0x56b376){var _0x517552={},_0x2d0497={},_0xd06008={'count':0x0,'rows':[]};var _0x12d385=_[_0xa6dc('0x3a')](db[_0xa6dc('0x3b')][_0xa6dc('0x3c')],function(_0x58dbc1){return{'name':_0x58dbc1['fieldName'],'type':_0x58dbc1[_0xa6dc('0x3d')][_0xa6dc('0x3e')]};});_0x2d0497[_0xa6dc('0x3f')]=_['map'](_0x12d385,_0xa6dc('0x37'));_0x2d0497[_0xa6dc('0x40')]=_[_0xa6dc('0x41')](_0x70e9ee[_0xa6dc('0x40')]);_0x2d0497[_0xa6dc('0x42')]=_['intersection'](_0x2d0497[_0xa6dc('0x3f')],_0x2d0497[_0xa6dc('0x40')]);_0x517552['attributes']=_[_0xa6dc('0x43')](_0x2d0497[_0xa6dc('0x3f')],qs[_0xa6dc('0x44')](_0x70e9ee[_0xa6dc('0x40')][_0xa6dc('0x44')]));_0x517552[_0xa6dc('0x45')]=_0x517552['attributes'][_0xa6dc('0x46')]?_0x517552[_0xa6dc('0x45')]:_0x2d0497[_0xa6dc('0x3f')];if(!_0x70e9ee[_0xa6dc('0x40')][_0xa6dc('0x47')](_0xa6dc('0x48'))){_0x517552['limit']=qs[_0xa6dc('0x2d')](_0x70e9ee[_0xa6dc('0x40')]['limit']);_0x517552['offset']=qs[_0xa6dc('0x2b')](_0x70e9ee['query'][_0xa6dc('0x2b')]);}_0x517552[_0xa6dc('0x49')]=qs[_0xa6dc('0x4a')](_0x70e9ee[_0xa6dc('0x40')][_0xa6dc('0x4a')]);_0x517552[_0xa6dc('0x4b')]=qs['filters'](_[_0xa6dc('0x4c')](_0x70e9ee[_0xa6dc('0x40')],_0x2d0497[_0xa6dc('0x42')]),_0x12d385);if(_0x70e9ee[_0xa6dc('0x40')][_0xa6dc('0x4d')]){_0x517552[_0xa6dc('0x4b')]=_[_0xa6dc('0x4e')](_0x517552['where'],{'$or':_[_0xa6dc('0x3a')](_0x12d385,function(_0x597d54){if(_0x597d54[_0xa6dc('0x3d')]!==_0xa6dc('0x4f')){var _0x2d16db={};_0x2d16db[_0x597d54['name']]={'$like':'%'+_0x70e9ee[_0xa6dc('0x40')][_0xa6dc('0x4d')]+'%'};return _0x2d16db;}})});}_0x517552=_[_0xa6dc('0x4e')]({},_0x517552,_0x70e9ee[_0xa6dc('0x50')]);var _0x4d4c77={'where':_0x517552[_0xa6dc('0x4b')]};return db[_0xa6dc('0x3b')][_0xa6dc('0x2e')](_0x4d4c77)[_0xa6dc('0x1e')](function(_0x7fdbbd){_0xd06008[_0xa6dc('0x2e')]=_0x7fdbbd;if(_0x70e9ee[_0xa6dc('0x40')][_0xa6dc('0x51')]){_0x517552[_0xa6dc('0x52')]=[{'all':!![]}];}return db[_0xa6dc('0x3b')][_0xa6dc('0x53')](_0x517552);})['then'](function(_0x27296f){_0xd06008[_0xa6dc('0x54')]=_0x27296f;return _0xd06008;})['then'](respondWithFilteredResult(_0x56b376,_0x517552))[_0xa6dc('0x27')](handleError(_0x56b376,null));};exports[_0xa6dc('0x55')]=function(_0x2f6889,_0x146958){var _0x357882={'raw':!![],'where':{'id':_0x2f6889[_0xa6dc('0x56')]['id']}},_0x5b935e={};_0x5b935e[_0xa6dc('0x3f')]=_[_0xa6dc('0x41')](db['WhatsappMessage'][_0xa6dc('0x3c')]);_0x5b935e[_0xa6dc('0x40')]=_[_0xa6dc('0x41')](_0x2f6889['query']);_0x5b935e['filters']=_['intersection'](_0x5b935e['model'],_0x5b935e[_0xa6dc('0x40')]);_0x357882[_0xa6dc('0x45')]=_[_0xa6dc('0x43')](_0x5b935e[_0xa6dc('0x3f')],qs[_0xa6dc('0x44')](_0x2f6889['query'][_0xa6dc('0x44')]));_0x357882[_0xa6dc('0x45')]=_0x357882[_0xa6dc('0x45')][_0xa6dc('0x46')]?_0x357882['attributes']:_0x5b935e[_0xa6dc('0x3f')];if(_0x2f6889['query'][_0xa6dc('0x51')]){_0x357882['include']=[{'all':!![]}];}_0x357882=_['merge']({},_0x357882,_0x2f6889[_0xa6dc('0x50')]);return db[_0xa6dc('0x3b')]['find'](_0x357882)[_0xa6dc('0x1e')](handleEntityNotFound(_0x146958,null))[_0xa6dc('0x1e')](respondWithResult(_0x146958,null))[_0xa6dc('0x27')](handleError(_0x146958,null));};exports[_0xa6dc('0x57')]=function(_0x1b0450,_0x417afd){return db[_0xa6dc('0x3b')]['create'](_0x1b0450[_0xa6dc('0x58')],{})[_0xa6dc('0x1e')](respondWithResult(_0x417afd,0xc9))[_0xa6dc('0x27')](handleError(_0x417afd,null));};exports['update']=function(_0x3b0007,_0x2805df){if(_0x3b0007[_0xa6dc('0x58')]['id']){delete _0x3b0007['body']['id'];}return db['WhatsappMessage'][_0xa6dc('0x59')]({'where':{'id':_0x3b0007['params']['id']}})[_0xa6dc('0x1e')](handleEntityNotFound(_0x2805df,null))[_0xa6dc('0x1e')](saveUpdates(_0x3b0007[_0xa6dc('0x58')],null))[_0xa6dc('0x1e')](respondWithResult(_0x2805df,null))[_0xa6dc('0x27')](handleError(_0x2805df,null));};exports[_0xa6dc('0x34')]=function(_0xd23ede,_0x1cccbd){return db[_0xa6dc('0x3b')][_0xa6dc('0x59')]({'where':{'id':_0xd23ede[_0xa6dc('0x56')]['id']}})[_0xa6dc('0x1e')](handleEntityNotFound(_0x1cccbd,null))['then'](removeEntity(_0x1cccbd,null))['catch'](handleError(_0x1cccbd,null));};exports[_0xa6dc('0x5a')]=function(_0x3ebb10,_0x2312f5){return db['WhatsappMessage'][_0xa6dc('0x5a')]()['then'](respondWithResult(_0x2312f5,null))[_0xa6dc('0x27')](handleError(_0x2312f5,null));};var interaction_log=require(_0xa6dc('0x14'))(_0xa6dc('0x5b'));exports[_0xa6dc('0x5c')]=function(_0x189b68,_0x12825d,_0x51e96a){var _0x1b8978={'agent':{},'channel':'whatsapp'};if(_0x189b68['body']['id']){delete _0x189b68[_0xa6dc('0x58')]['id'];}_0x189b68[_0xa6dc('0x58')][_0xa6dc('0x5d')]=!![];_0x189b68[_0xa6dc('0x58')]['readAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x189b68['body'][_0xa6dc('0x5e')]=_0x189b68[_0xa6dc('0x58')][_0xa6dc('0x5e')]||_0x189b68['user']['id'];_0x1b8978[_0xa6dc('0x5f')]['id']=_0x189b68[_0xa6dc('0x58')][_0xa6dc('0x5e')];return db[_0xa6dc('0x3b')][_0xa6dc('0x59')]({'where':{'id':_0x189b68['params']['id'],'UserId':null}})[_0xa6dc('0x1e')](handleEntityNotFound(_0x12825d,null))[_0xa6dc('0x1e')](saveUpdates(_0x189b68[_0xa6dc('0x58')],null))[_0xa6dc('0x1e')](function(_0x4169b8){if(_0x4169b8){_0x1b8978[_0xa6dc('0x24')]=_0x4169b8[_0xa6dc('0x60')]({'plain':!![]});return db[_0xa6dc('0x61')][_0xa6dc('0x59')]({'where':{'id':_0x4169b8[_0xa6dc('0x62')]}});}return null;})[_0xa6dc('0x1e')](handleEntityNotFound(_0x12825d,null))[_0xa6dc('0x1e')](function(_0x46c874){if(_0x46c874){return _0x46c874['update']({'UserId':_0x189b68[_0xa6dc('0x58')]['UserId'],'read1stAt':_['isNil'](_0x46c874[_0xa6dc('0x63')])?moment()['format'](_0xa6dc('0x64')):undefined});}return null;})['then'](function(_0x3f13a9){if(_0x3f13a9){_0x1b8978[_0xa6dc('0x65')]=_0x3f13a9[_0xa6dc('0x60')]({'plain':!![]});interaction_log[_0xa6dc('0x25')]('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x189b68[_0xa6dc('0x66')]['id'],_0x189b68['user'][_0xa6dc('0x37')],_0x189b68['user']['role'],_0x1b8978['interaction']['id'],_0x189b68[_0xa6dc('0x58')]?JSON[_0xa6dc('0x67')](_0x189b68[_0xa6dc('0x58')]):_0xa6dc('0x68'));return respondWithRpcPromise(_0xa6dc('0x69'),_0xa6dc('0x6a'),_0x1b8978);}return null;})[_0xa6dc('0x1e')](function(_0x51fb59){var _0x352c47='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x51fb59[_0xa6dc('0x24')][_0xa6dc('0x6b')];return db[_0xa6dc('0x6c')][_0xa6dc('0x40')](_0x352c47,{'type':db[_0xa6dc('0x6d')][_0xa6dc('0x6e')][_0xa6dc('0x6f')],'raw':!![]})[_0xa6dc('0x1e')](function(_0x113e70){return _0x113e70;});})['then'](function(_0x100adc){if(_0x100adc){_0x1b8978[_0xa6dc('0x24')][_0xa6dc('0x70')]=_0x100adc[0x0];if(!_0x189b68[_0xa6dc('0x58')]['UserId'])return;return db[_0xa6dc('0x71')][_0xa6dc('0x59')]({'where':{'id':_0x189b68[_0xa6dc('0x58')][_0xa6dc('0x5e')],'role':_0xa6dc('0x5f')},'attributes':['id',_0xa6dc('0x37'),'fullname','email','internal'],'raw':!![]});}return null;})[_0xa6dc('0x1e')](function(_0x1ed15f){if(!_0x1ed15f)return null;_0x1b8978[_0xa6dc('0x24')][_0xa6dc('0x5f')]=_0x1ed15f;return _0x1b8978;})[_0xa6dc('0x1e')](function(_0x38fdc6){if(_0x38fdc6){if(_0x189b68[_0xa6dc('0x58')][_0xa6dc('0x72')]){_0x1b8978[_0xa6dc('0x24')][_0xa6dc('0x73')]=util[_0xa6dc('0x74')](_0xa6dc('0x75'),_0x189b68[_0xa6dc('0x66')][_0xa6dc('0x37')]);_0x1b8978[_0xa6dc('0x24')][_0xa6dc('0x76')]=_0x1b8978[_0xa6dc('0x76')];_0x1b8978[_0xa6dc('0x24')][_0xa6dc('0x77')]=_0x1b8978[_0xa6dc('0x76')];_0x1b8978['message']['event']=_0xa6dc('0x5c');return respondWithRpcPromise(_0xa6dc('0x78'),_0xa6dc('0x78'),{'event':_0xa6dc('0x79'),'message':_0x1b8978[_0xa6dc('0x24')]},client9002)[_0xa6dc('0x1e')](function(){return _0x1b8978;});}return _0x1b8978;}return null;})[_0xa6dc('0x1e')](respondWithResult(_0x12825d,null))[_0xa6dc('0x27')](handleError(_0x12825d,null));};var interaction_log=require(_0xa6dc('0x14'))('whatsapp-interactions');exports[_0xa6dc('0x31')]=function(_0x2cc7b7,_0xe7cddc,_0x34cf5b){var _0x41886e={'agent':{},'channel':_0xa6dc('0x7a')};if(_0x2cc7b7['body']['id']){delete _0x2cc7b7[_0xa6dc('0x58')]['id'];}_0x2cc7b7[_0xa6dc('0x58')]['UserId']=_0x2cc7b7[_0xa6dc('0x58')][_0xa6dc('0x5e')]||_0x2cc7b7['user']['id'];_0x41886e[_0xa6dc('0x5f')]['id']=_0x2cc7b7[_0xa6dc('0x58')][_0xa6dc('0x5e')];return db[_0xa6dc('0x3b')]['find']({'where':{'id':_0x2cc7b7[_0xa6dc('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0xe7cddc,null))[_0xa6dc('0x1e')](function(_0x493ce5){if(_0x493ce5){_0x41886e[_0xa6dc('0x24')]=_0x493ce5['get']({'plain':!![]});return db['WhatsappInteraction']['find']({'where':{'id':_0x493ce5[_0xa6dc('0x62')]}});}return null;})[_0xa6dc('0x1e')](handleEntityNotFound(_0xe7cddc,null))[_0xa6dc('0x1e')](function(_0x3f875f){if(_0x3f875f){_0x41886e[_0xa6dc('0x65')]=_0x3f875f['get']({'plain':!![]});interaction_log['info'](_0xa6dc('0x7b'),_0x2cc7b7[_0xa6dc('0x66')]['id'],_0x2cc7b7[_0xa6dc('0x66')][_0xa6dc('0x37')],_0x2cc7b7[_0xa6dc('0x66')][_0xa6dc('0x7c')],_0x41886e[_0xa6dc('0x65')]['id'],_0x2cc7b7[_0xa6dc('0x58')]?JSON[_0xa6dc('0x67')](_0x2cc7b7[_0xa6dc('0x58')]):'null');return respondWithRpcPromise(_0xa6dc('0x7d'),_0xa6dc('0x7e'),_0x41886e);}return null;})[_0xa6dc('0x1e')](function(_0x2df7f2){var _0x1af1fc=_0xa6dc('0x7f')+_0x2df7f2[_0xa6dc('0x24')][_0xa6dc('0x6b')];return db['sequelize']['query'](_0x1af1fc,{'type':db['Sequelize'][_0xa6dc('0x6e')][_0xa6dc('0x6f')],'raw':!![]})[_0xa6dc('0x1e')](function(_0x3c5f7){return _0x3c5f7;});})[_0xa6dc('0x1e')](function(_0x2b4bde){if(_0x2b4bde){_0x41886e[_0xa6dc('0x24')][_0xa6dc('0x70')]=_0x2b4bde[0x0];if(!_0x2cc7b7[_0xa6dc('0x58')][_0xa6dc('0x5e')])return;return db[_0xa6dc('0x71')][_0xa6dc('0x59')]({'where':{'id':_0x2cc7b7[_0xa6dc('0x58')][_0xa6dc('0x5e')],'role':_0xa6dc('0x5f')},'attributes':['id','name',_0xa6dc('0x80'),_0xa6dc('0x81'),_0xa6dc('0x82')],'raw':!![]});}return null;})['then'](function(_0x1b33e4){if(!_0x1b33e4)return null;_0x41886e[_0xa6dc('0x24')][_0xa6dc('0x5f')]=_0x1b33e4;return _0x41886e;})['then'](function(_0x524a4d){if(_0x524a4d){_0x524a4d['message']['interface']=util['format'](_0xa6dc('0x75'),_0x2cc7b7[_0xa6dc('0x66')][_0xa6dc('0x37')]);_0x524a4d['message'][_0xa6dc('0x76')]=_0x41886e[_0xa6dc('0x76')];_0x524a4d['message'][_0xa6dc('0x77')]=_0x41886e[_0xa6dc('0x76')];_0x524a4d[_0xa6dc('0x24')]['event']=_0xa6dc('0x31');respondWithRpcPromise(_0xa6dc('0x78'),_0xa6dc('0x78'),{'event':_0xa6dc('0x83'),'message':_0x524a4d[_0xa6dc('0x24')]},client9002);return _0x41886e;}return null;})[_0xa6dc('0x1e')](respondWithResult(_0xe7cddc,null))[_0xa6dc('0x27')](handleError(_0xe7cddc,null));};exports[_0xa6dc('0x29')]=function(_0x487816,_0x168138,_0x32bec7){if(_0x487816[_0xa6dc('0x58')]['id']){delete _0x487816[_0xa6dc('0x58')]['id'];}var _0x3ca7e2;return db[_0xa6dc('0x3b')][_0xa6dc('0x59')]({'where':{'id':_0x487816['params']['id']}})[_0xa6dc('0x1e')](handleEntityNotFound(_0x168138,null))[_0xa6dc('0x1e')](function(_0x25eb68){if(_0x25eb68){_0x3ca7e2=_0x25eb68;return db[_0xa6dc('0x84')][_0xa6dc('0x59')]({'where':{'id':_0x25eb68[_0xa6dc('0x85')]}});}})[_0xa6dc('0x1e')](handleEntityNotFound(_0x168138,null))[_0xa6dc('0x1e')](function(_0x1046f){if(_0x1046f){logger[_0xa6dc('0x21')]('WhatsppMessage,\x20%s,\x20%s,\x20%s',_0xa6dc('0x29'),_0xa6dc('0x86'),_0x1046f[_0xa6dc('0x3d')],util[_0xa6dc('0x87')](_0x487816['body'],{'showHidden':![],'depth':null}));switch(_0x1046f['type']){case _0xa6dc('0x88'):if(_0x487816[_0xa6dc('0x58')][_0xa6dc('0x89')]&&_0x487816[_0xa6dc('0x58')][_0xa6dc('0x89')]===_0x3ca7e2[_0xa6dc('0x8a')]&&_0x487816['body'][_0xa6dc('0x8b')]&&_0x487816[_0xa6dc('0x58')]['MessageStatus']===_0xa6dc('0x5d')){return _0x3ca7e2[_0xa6dc('0x33')]({'read':!![]});}else{logger[_0xa6dc('0x23')](_0xa6dc('0x8c'),_0xa6dc('0x29'),_0xa6dc('0x88'),util[_0xa6dc('0x87')](_0x487816[_0xa6dc('0x58')],{'showHidden':![],'depth':null}));}break;}return _0x3ca7e2;}})[_0xa6dc('0x1e')](respondWithResult(_0x168138,null))[_0xa6dc('0x27')](handleError(_0x168138,null));}; \ No newline at end of file +var _0xc7bd=['attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','VIRTUAL','options','WhatsappMessage','includeAll','include','findAll','catch','show','params','length','find','create','body','destroy','describe','whatsapp-interactions','accept','whatsapp','read','readAt','format','UserId','user','agent','get','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','[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','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','WhatsappInteraction','WhatsappInteractionId','RejectMessage','rejectMessage','rejectmessage','WhatsappAccount','debug','WhatsppMessage,\x20%s,\x20%s,\x20%s','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','twilio','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','http','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','status','end','offset','undefined','limit','count','json','reject','save','update','sendStatus','stack','name','send','index','fieldName','type','key','model','query','keys','filters','intersection'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xc7bd,0x15b));var _0xdc7b=function(_0x6bfb72,_0x436579){_0x6bfb72=_0x6bfb72-0x0;var _0x32dd81=_0xc7bd[_0x6bfb72];return _0x32dd81;};'use strict';var emlformat=require(_0xdc7b('0x0'));var rimraf=require(_0xdc7b('0x1'));var zipdir=require(_0xdc7b('0x2'));var jsonpatch=require(_0xdc7b('0x3'));var rp=require(_0xdc7b('0x4'));var moment=require(_0xdc7b('0x5'));var BPromise=require(_0xdc7b('0x6'));var Mustache=require(_0xdc7b('0x7'));var util=require(_0xdc7b('0x8'));var path=require('path');var sox=require(_0xdc7b('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdc7b('0xa'));var squel=require(_0xdc7b('0xb'));var crypto=require(_0xdc7b('0xc'));var jsforce=require(_0xdc7b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xdc7b('0xe'));var querystring=require(_0xdc7b('0xf'));var Papa=require(_0xdc7b('0x10'));var Redis=require(_0xdc7b('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xdc7b('0x12'));var as=require(_0xdc7b('0x13'));var hardwareService=require(_0xdc7b('0x14'));var logger=require(_0xdc7b('0x15'))('api');var utils=require(_0xdc7b('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xdc7b('0x17'));var db=require(_0xdc7b('0x18'))['db'];config[_0xdc7b('0x19')]=_[_0xdc7b('0x1a')](config['redis'],{'host':_0xdc7b('0x1b'),'port':0x18eb});var socket=require(_0xdc7b('0x1c'))(new Redis(config['redis']));require('./whatsappMessage.socket')[_0xdc7b('0x1d')](socket);var jayson=require(_0xdc7b('0x1e'));var client=jayson['client'][_0xdc7b('0x1f')]({'port':0x232c});var client9002=jayson['client'][_0xdc7b('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x370f18,_0x5c2283,_0x116847,_0x6f4584){return new BPromise(function(_0x13fe1c,_0x5544d7){var _0x4c94c5=_0x6f4584||client;return _0x4c94c5['request'](_0x370f18,_0x116847)[_0xdc7b('0x20')](function(_0x3dea6d){logger['info'](_0xdc7b('0x21'),_0x5c2283,_0xdc7b('0x22'));logger['debug'](_0xdc7b('0x23'),_0x5c2283,_0xdc7b('0x22'),JSON['stringify'](_0x3dea6d));if(_0x3dea6d[_0xdc7b('0x24')]){if(_0x3dea6d[_0xdc7b('0x24')][_0xdc7b('0x25')]===0x1f4){logger[_0xdc7b('0x24')](_0xdc7b('0x21'),_0x5c2283,_0x3dea6d[_0xdc7b('0x24')]['message']);return _0x5544d7(_0x3dea6d[_0xdc7b('0x24')]['message']);}logger[_0xdc7b('0x24')](_0xdc7b('0x21'),_0x5c2283,_0x3dea6d[_0xdc7b('0x24')][_0xdc7b('0x26')]);return _0x13fe1c(_0x3dea6d[_0xdc7b('0x24')][_0xdc7b('0x26')]);}else{logger[_0xdc7b('0x27')](_0xdc7b('0x21'),_0x5c2283,_0xdc7b('0x22'));_0x13fe1c(_0x3dea6d[_0xdc7b('0x28')][_0xdc7b('0x26')]);}})['catch'](function(_0x10a8c2){logger[_0xdc7b('0x24')]('WhatsappMessage,\x20%s,\x20%s',_0x5c2283,_0x10a8c2);_0x5544d7(_0x10a8c2);});});}function respondWithStatusCode(_0x28331d,_0x75b210){_0x75b210=_0x75b210||0xcc;return function(_0x11dfa6){if(_0x11dfa6){return _0x28331d['sendStatus'](_0x75b210);}return _0x28331d[_0xdc7b('0x29')](_0x75b210)[_0xdc7b('0x2a')]();};}function respondWithResult(_0x4db851,_0x4d8d9b){_0x4d8d9b=_0x4d8d9b||0xc8;return function(_0x18555b){if(_0x18555b){return _0x4db851[_0xdc7b('0x29')](_0x4d8d9b)['json'](_0x18555b);}};}function respondWithFilteredResult(_0x3b1004,_0x21fc08){return function(_0x36d22a){if(_0x36d22a){var _0xcdb2e2=typeof _0x21fc08[_0xdc7b('0x2b')]===_0xdc7b('0x2c')&&typeof _0x21fc08[_0xdc7b('0x2d')]===_0xdc7b('0x2c');var _0x2704b1=_0x36d22a[_0xdc7b('0x2e')];var _0x389dff=_0xcdb2e2?0x0:_0x21fc08['offset'];var _0xa96095=_0xcdb2e2?_0x36d22a[_0xdc7b('0x2e')]:_0x21fc08['offset']+_0x21fc08[_0xdc7b('0x2d')];var _0x52955e;if(_0xa96095>=_0x2704b1){_0xa96095=_0x2704b1;_0x52955e=0xc8;}else{_0x52955e=0xce;}_0x3b1004[_0xdc7b('0x29')](_0x52955e);return _0x3b1004['set']('Content-Range',_0x389dff+'-'+_0xa96095+'/'+_0x2704b1)[_0xdc7b('0x2f')](_0x36d22a);}return null;};}function patchUpdates(_0x1d3512){return function(_0x5af24d){try{jsonpatch['apply'](_0x5af24d,_0x1d3512,!![]);}catch(_0x32efdf){return BPromise[_0xdc7b('0x30')](_0x32efdf);}return _0x5af24d[_0xdc7b('0x31')]();};}function saveUpdates(_0x1fbe44,_0x1bb157){return function(_0x27dd0a){if(_0x27dd0a){return _0x27dd0a[_0xdc7b('0x32')](_0x1fbe44)[_0xdc7b('0x20')](function(_0x56791f){return _0x56791f;});}return null;};}function removeEntity(_0x4c76e3,_0x18404c){return function(_0x5c3c9b){if(_0x5c3c9b){return _0x5c3c9b['destroy']()[_0xdc7b('0x20')](function(){_0x4c76e3['status'](0xcc)[_0xdc7b('0x2a')]();});}};}function handleEntityNotFound(_0x48f229,_0x2c5146){return function(_0x2d6855){if(!_0x2d6855){_0x48f229[_0xdc7b('0x33')](0x194);}return _0x2d6855;};}function handleError(_0x2632d8,_0x592128){_0x592128=_0x592128||0x1f4;return function(_0x2ce58e){logger[_0xdc7b('0x24')](_0x2ce58e[_0xdc7b('0x34')]);if(_0x2ce58e[_0xdc7b('0x35')]){delete _0x2ce58e[_0xdc7b('0x35')];}_0x2632d8[_0xdc7b('0x29')](_0x592128)[_0xdc7b('0x36')](_0x2ce58e);};}exports[_0xdc7b('0x37')]=function(_0x5740cb,_0x505bb5){var _0x51a597={},_0x1f8cbd={},_0x314b86={'count':0x0,'rows':[]};var _0x8c9251=_['map'](db['WhatsappMessage']['rawAttributes'],function(_0x31c9e5){return{'name':_0x31c9e5[_0xdc7b('0x38')],'type':_0x31c9e5[_0xdc7b('0x39')][_0xdc7b('0x3a')]};});_0x1f8cbd[_0xdc7b('0x3b')]=_['map'](_0x8c9251,_0xdc7b('0x35'));_0x1f8cbd[_0xdc7b('0x3c')]=_[_0xdc7b('0x3d')](_0x5740cb[_0xdc7b('0x3c')]);_0x1f8cbd[_0xdc7b('0x3e')]=_[_0xdc7b('0x3f')](_0x1f8cbd[_0xdc7b('0x3b')],_0x1f8cbd['query']);_0x51a597[_0xdc7b('0x40')]=_[_0xdc7b('0x3f')](_0x1f8cbd['model'],qs['fields'](_0x5740cb[_0xdc7b('0x3c')][_0xdc7b('0x41')]));_0x51a597[_0xdc7b('0x40')]=_0x51a597[_0xdc7b('0x40')]['length']?_0x51a597[_0xdc7b('0x40')]:_0x1f8cbd[_0xdc7b('0x3b')];if(!_0x5740cb[_0xdc7b('0x3c')][_0xdc7b('0x42')](_0xdc7b('0x43'))){_0x51a597[_0xdc7b('0x2d')]=qs[_0xdc7b('0x2d')](_0x5740cb[_0xdc7b('0x3c')]['limit']);_0x51a597[_0xdc7b('0x2b')]=qs['offset'](_0x5740cb[_0xdc7b('0x3c')]['offset']);}_0x51a597[_0xdc7b('0x44')]=qs[_0xdc7b('0x45')](_0x5740cb[_0xdc7b('0x3c')][_0xdc7b('0x45')]);_0x51a597[_0xdc7b('0x46')]=qs[_0xdc7b('0x3e')](_['pick'](_0x5740cb['query'],_0x1f8cbd[_0xdc7b('0x3e')]),_0x8c9251);if(_0x5740cb['query'][_0xdc7b('0x47')]){_0x51a597['where']=_[_0xdc7b('0x48')](_0x51a597[_0xdc7b('0x46')],{'$or':_[_0xdc7b('0x49')](_0x8c9251,function(_0x4d16a5){if(_0x4d16a5[_0xdc7b('0x39')]!==_0xdc7b('0x4a')){var _0x15684d={};_0x15684d[_0x4d16a5[_0xdc7b('0x35')]]={'$like':'%'+_0x5740cb[_0xdc7b('0x3c')]['filter']+'%'};return _0x15684d;}})});}_0x51a597=_['merge']({},_0x51a597,_0x5740cb[_0xdc7b('0x4b')]);var _0x5073a8={'where':_0x51a597[_0xdc7b('0x46')]};return db[_0xdc7b('0x4c')][_0xdc7b('0x2e')](_0x5073a8)['then'](function(_0x3e5438){_0x314b86[_0xdc7b('0x2e')]=_0x3e5438;if(_0x5740cb[_0xdc7b('0x3c')][_0xdc7b('0x4d')]){_0x51a597[_0xdc7b('0x4e')]=[{'all':!![]}];}return db['WhatsappMessage'][_0xdc7b('0x4f')](_0x51a597);})[_0xdc7b('0x20')](function(_0x57317e){_0x314b86['rows']=_0x57317e;return _0x314b86;})['then'](respondWithFilteredResult(_0x505bb5,_0x51a597))[_0xdc7b('0x50')](handleError(_0x505bb5,null));};exports[_0xdc7b('0x51')]=function(_0x4c159f,_0x199241){var _0x184af4={'raw':!![],'where':{'id':_0x4c159f[_0xdc7b('0x52')]['id']}},_0x38e722={};_0x38e722['model']=_[_0xdc7b('0x3d')](db[_0xdc7b('0x4c')]['rawAttributes']);_0x38e722['query']=_[_0xdc7b('0x3d')](_0x4c159f[_0xdc7b('0x3c')]);_0x38e722[_0xdc7b('0x3e')]=_['intersection'](_0x38e722[_0xdc7b('0x3b')],_0x38e722[_0xdc7b('0x3c')]);_0x184af4[_0xdc7b('0x40')]=_[_0xdc7b('0x3f')](_0x38e722[_0xdc7b('0x3b')],qs[_0xdc7b('0x41')](_0x4c159f[_0xdc7b('0x3c')][_0xdc7b('0x41')]));_0x184af4['attributes']=_0x184af4[_0xdc7b('0x40')][_0xdc7b('0x53')]?_0x184af4[_0xdc7b('0x40')]:_0x38e722[_0xdc7b('0x3b')];if(_0x4c159f['query'][_0xdc7b('0x4d')]){_0x184af4['include']=[{'all':!![]}];}_0x184af4=_[_0xdc7b('0x48')]({},_0x184af4,_0x4c159f[_0xdc7b('0x4b')]);return db[_0xdc7b('0x4c')][_0xdc7b('0x54')](_0x184af4)[_0xdc7b('0x20')](handleEntityNotFound(_0x199241,null))[_0xdc7b('0x20')](respondWithResult(_0x199241,null))['catch'](handleError(_0x199241,null));};exports['create']=function(_0x54958b,_0x332ec1){return db[_0xdc7b('0x4c')][_0xdc7b('0x55')](_0x54958b['body'],{})[_0xdc7b('0x20')](respondWithResult(_0x332ec1,0xc9))[_0xdc7b('0x50')](handleError(_0x332ec1,null));};exports[_0xdc7b('0x32')]=function(_0x5a2941,_0x4b066f){if(_0x5a2941['body']['id']){delete _0x5a2941[_0xdc7b('0x56')]['id'];}return db[_0xdc7b('0x4c')][_0xdc7b('0x54')]({'where':{'id':_0x5a2941[_0xdc7b('0x52')]['id']}})[_0xdc7b('0x20')](handleEntityNotFound(_0x4b066f,null))[_0xdc7b('0x20')](saveUpdates(_0x5a2941[_0xdc7b('0x56')],null))[_0xdc7b('0x20')](respondWithResult(_0x4b066f,null))[_0xdc7b('0x50')](handleError(_0x4b066f,null));};exports[_0xdc7b('0x57')]=function(_0x113b46,_0x245a85){return db[_0xdc7b('0x4c')][_0xdc7b('0x54')]({'where':{'id':_0x113b46['params']['id']}})[_0xdc7b('0x20')](handleEntityNotFound(_0x245a85,null))[_0xdc7b('0x20')](removeEntity(_0x245a85,null))['catch'](handleError(_0x245a85,null));};exports[_0xdc7b('0x58')]=function(_0x38189b,_0x99b0c5){return db[_0xdc7b('0x4c')]['describe']()['then'](respondWithResult(_0x99b0c5,null))[_0xdc7b('0x50')](handleError(_0x99b0c5,null));};var interaction_log=require('../../config/logger')(_0xdc7b('0x59'));exports[_0xdc7b('0x5a')]=function(_0x5488dc,_0x5826f5,_0x20d55f){var _0x211201={'agent':{},'channel':_0xdc7b('0x5b')};if(_0x5488dc['body']['id']){delete _0x5488dc[_0xdc7b('0x56')]['id'];}_0x5488dc[_0xdc7b('0x56')][_0xdc7b('0x5c')]=!![];_0x5488dc[_0xdc7b('0x56')][_0xdc7b('0x5d')]=moment()[_0xdc7b('0x5e')]('YYYY-MM-DD\x20HH:mm:ss');_0x5488dc[_0xdc7b('0x56')][_0xdc7b('0x5f')]=_0x5488dc[_0xdc7b('0x56')]['UserId']||_0x5488dc[_0xdc7b('0x60')]['id'];_0x211201[_0xdc7b('0x61')]['id']=_0x5488dc[_0xdc7b('0x56')]['UserId'];return db[_0xdc7b('0x4c')]['find']({'where':{'id':_0x5488dc['params']['id'],'UserId':null}})[_0xdc7b('0x20')](handleEntityNotFound(_0x5826f5,null))['then'](saveUpdates(_0x5488dc[_0xdc7b('0x56')],null))[_0xdc7b('0x20')](function(_0x5a1c8d){if(_0x5a1c8d){_0x211201[_0xdc7b('0x26')]=_0x5a1c8d[_0xdc7b('0x62')]({'plain':!![]});return db['WhatsappInteraction']['find']({'where':{'id':_0x5a1c8d['WhatsappInteractionId']}});}return null;})[_0xdc7b('0x20')](handleEntityNotFound(_0x5826f5,null))[_0xdc7b('0x20')](function(_0x280419){if(_0x280419){return _0x280419[_0xdc7b('0x32')]({'UserId':_0x5488dc[_0xdc7b('0x56')][_0xdc7b('0x5f')],'read1stAt':_[_0xdc7b('0x63')](_0x280419[_0xdc7b('0x64')])?moment()[_0xdc7b('0x5e')](_0xdc7b('0x65')):undefined});}return null;})[_0xdc7b('0x20')](function(_0x5e64c5){if(_0x5e64c5){_0x211201['interaction']=_0x5e64c5[_0xdc7b('0x62')]({'plain':!![]});interaction_log[_0xdc7b('0x27')](_0xdc7b('0x66'),_0x5488dc[_0xdc7b('0x60')]['id'],_0x5488dc[_0xdc7b('0x60')][_0xdc7b('0x35')],_0x5488dc[_0xdc7b('0x60')][_0xdc7b('0x67')],_0x211201['interaction']['id'],_0x5488dc[_0xdc7b('0x56')]?JSON[_0xdc7b('0x68')](_0x5488dc['body']):_0xdc7b('0x69'));return respondWithRpcPromise('AcceptMessage',_0xdc7b('0x6a'),_0x211201);}return null;})[_0xdc7b('0x20')](function(_0x1fdb5b){var _0x13adec=_0xdc7b('0x6b')+_0x1fdb5b['message'][_0xdc7b('0x6c')];return db[_0xdc7b('0x6d')][_0xdc7b('0x3c')](_0x13adec,{'type':db[_0xdc7b('0x6e')][_0xdc7b('0x6f')][_0xdc7b('0x70')],'raw':!![]})[_0xdc7b('0x20')](function(_0x3b9d0c){return _0x3b9d0c;});})[_0xdc7b('0x20')](function(_0x307317){if(_0x307317){_0x211201['message'][_0xdc7b('0x71')]=_0x307317[0x0];if(!_0x5488dc[_0xdc7b('0x56')][_0xdc7b('0x5f')])return;return db[_0xdc7b('0x72')][_0xdc7b('0x54')]({'where':{'id':_0x5488dc['body'][_0xdc7b('0x5f')],'role':_0xdc7b('0x61')},'attributes':['id',_0xdc7b('0x35'),_0xdc7b('0x73'),_0xdc7b('0x74'),_0xdc7b('0x75')],'raw':!![]});}return null;})[_0xdc7b('0x20')](function(_0x58bae8){if(!_0x58bae8)return null;_0x211201[_0xdc7b('0x26')][_0xdc7b('0x61')]=_0x58bae8;return _0x211201;})[_0xdc7b('0x20')](function(_0xc9752d){if(_0xc9752d){if(_0x5488dc[_0xdc7b('0x56')]['manual']){_0x211201[_0xdc7b('0x26')][_0xdc7b('0x76')]=util[_0xdc7b('0x5e')](_0xdc7b('0x77'),_0x5488dc['user'][_0xdc7b('0x35')]);_0x211201[_0xdc7b('0x26')]['channel']=_0x211201[_0xdc7b('0x78')];_0x211201[_0xdc7b('0x26')][_0xdc7b('0x79')]=_0x211201['channel'];_0x211201[_0xdc7b('0x26')][_0xdc7b('0x7a')]=_0xdc7b('0x5a');return respondWithRpcPromise(_0xdc7b('0x7b'),_0xdc7b('0x7b'),{'event':_0xdc7b('0x7c'),'message':_0x211201[_0xdc7b('0x26')]},client9002)[_0xdc7b('0x20')](function(){return _0x211201;});}return _0x211201;}return null;})[_0xdc7b('0x20')](respondWithResult(_0x5826f5,null))[_0xdc7b('0x50')](handleError(_0x5826f5,null));};var interaction_log=require(_0xdc7b('0x15'))(_0xdc7b('0x59'));exports[_0xdc7b('0x30')]=function(_0x188b12,_0x25ce14,_0x105758){var _0x5530da={'agent':{},'channel':_0xdc7b('0x5b')};if(_0x188b12[_0xdc7b('0x56')]['id']){delete _0x188b12[_0xdc7b('0x56')]['id'];}_0x188b12[_0xdc7b('0x56')][_0xdc7b('0x5f')]=_0x188b12[_0xdc7b('0x56')][_0xdc7b('0x5f')]||_0x188b12[_0xdc7b('0x60')]['id'];_0x5530da['agent']['id']=_0x188b12[_0xdc7b('0x56')][_0xdc7b('0x5f')];return db[_0xdc7b('0x4c')][_0xdc7b('0x54')]({'where':{'id':_0x188b12[_0xdc7b('0x52')]['id'],'UserId':null}})[_0xdc7b('0x20')](handleEntityNotFound(_0x25ce14,null))[_0xdc7b('0x20')](function(_0x4b9273){if(_0x4b9273){_0x5530da[_0xdc7b('0x26')]=_0x4b9273[_0xdc7b('0x62')]({'plain':!![]});return db[_0xdc7b('0x7d')]['find']({'where':{'id':_0x4b9273[_0xdc7b('0x7e')]}});}return null;})['then'](handleEntityNotFound(_0x25ce14,null))[_0xdc7b('0x20')](function(_0x23bcae){if(_0x23bcae){_0x5530da['interaction']=_0x23bcae[_0xdc7b('0x62')]({'plain':!![]});interaction_log[_0xdc7b('0x27')]('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x188b12[_0xdc7b('0x60')]['id'],_0x188b12['user'][_0xdc7b('0x35')],_0x188b12[_0xdc7b('0x60')]['role'],_0x5530da['interaction']['id'],_0x188b12[_0xdc7b('0x56')]?JSON[_0xdc7b('0x68')](_0x188b12[_0xdc7b('0x56')]):_0xdc7b('0x69'));return respondWithRpcPromise(_0xdc7b('0x7f'),_0xdc7b('0x80'),_0x5530da);}return null;})[_0xdc7b('0x20')](function(_0x455604){var _0x376eef=_0xdc7b('0x6b')+_0x455604['message'][_0xdc7b('0x6c')];return db[_0xdc7b('0x6d')][_0xdc7b('0x3c')](_0x376eef,{'type':db[_0xdc7b('0x6e')][_0xdc7b('0x6f')][_0xdc7b('0x70')],'raw':!![]})['then'](function(_0x478633){return _0x478633;});})[_0xdc7b('0x20')](function(_0x21d7e7){if(_0x21d7e7){_0x5530da['message'][_0xdc7b('0x71')]=_0x21d7e7[0x0];if(!_0x188b12[_0xdc7b('0x56')][_0xdc7b('0x5f')])return;return db[_0xdc7b('0x72')]['find']({'where':{'id':_0x188b12['body'][_0xdc7b('0x5f')],'role':_0xdc7b('0x61')},'attributes':['id','name',_0xdc7b('0x73'),_0xdc7b('0x74'),'internal'],'raw':!![]});}return null;})[_0xdc7b('0x20')](function(_0x36694c){if(!_0x36694c)return null;_0x5530da['message'][_0xdc7b('0x61')]=_0x36694c;return _0x5530da;})['then'](function(_0x1106b4){if(_0x1106b4){_0x1106b4[_0xdc7b('0x26')][_0xdc7b('0x76')]=util[_0xdc7b('0x5e')](_0xdc7b('0x77'),_0x188b12['user']['name']);_0x1106b4[_0xdc7b('0x26')][_0xdc7b('0x78')]=_0x5530da['channel'];_0x1106b4['message'][_0xdc7b('0x79')]=_0x5530da[_0xdc7b('0x78')];_0x1106b4[_0xdc7b('0x26')][_0xdc7b('0x7a')]=_0xdc7b('0x30');respondWithRpcPromise(_0xdc7b('0x7b'),_0xdc7b('0x7b'),{'event':_0xdc7b('0x81'),'message':_0x1106b4[_0xdc7b('0x26')]},client9002);return _0x5530da;}return null;})[_0xdc7b('0x20')](respondWithResult(_0x25ce14,null))[_0xdc7b('0x50')](handleError(_0x25ce14,null));};exports[_0xdc7b('0x29')]=function(_0x4d0797,_0x34d289,_0x12aad7){if(_0x4d0797['body']['id']){delete _0x4d0797['body']['id'];}var _0xf34272;return db[_0xdc7b('0x4c')][_0xdc7b('0x54')]({'where':{'id':_0x4d0797[_0xdc7b('0x52')]['id']}})['then'](handleEntityNotFound(_0x34d289,null))['then'](function(_0x555736){if(_0x555736){_0xf34272=_0x555736;return db[_0xdc7b('0x82')][_0xdc7b('0x54')]({'where':{'id':_0x555736['WhatsappAccountId']}});}})['then'](handleEntityNotFound(_0x34d289,null))[_0xdc7b('0x20')](function(_0x458157){if(_0x458157){logger[_0xdc7b('0x83')](_0xdc7b('0x84'),'status','received\x20delivery\x20report\x20from',_0x458157['type'],util['inspect'](_0x4d0797[_0xdc7b('0x56')],{'showHidden':![],'depth':null}));switch(_0x458157['type']){case'twilio':if(_0x4d0797[_0xdc7b('0x56')]['MessageSid']&&_0x4d0797[_0xdc7b('0x56')]['MessageSid']===_0xf34272[_0xdc7b('0x85')]&&_0x4d0797[_0xdc7b('0x56')][_0xdc7b('0x86')]&&_0x4d0797['body'][_0xdc7b('0x86')]==='read'){return _0xf34272[_0xdc7b('0x32')]({'read':!![]});}else{logger[_0xdc7b('0x24')](_0xdc7b('0x87'),_0xdc7b('0x29'),_0xdc7b('0x88'),util['inspect'](_0x4d0797[_0xdc7b('0x56')],{'showHidden':![],'depth':null}));}break;}return _0xf34272;}})[_0xdc7b('0x20')](respondWithResult(_0x34d289,null))['catch'](handleError(_0x34d289,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index abf6c51..87a9935 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 _0x80ed=['remove','emit','hasOwnProperty','exports','events','WhatsappMessage','setMaxListeners','save'];(function(_0x5cb9fb,_0x2d5c2d){var _0x414c1f=function(_0x513845){while(--_0x513845){_0x5cb9fb['push'](_0x5cb9fb['shift']());}};_0x414c1f(++_0x2d5c2d);}(_0x80ed,0x11c));var _0xd80e=function(_0x4d7cb1,_0x3c1948){_0x4d7cb1=_0x4d7cb1-0x0;var _0x3cf19b=_0x80ed[_0x4d7cb1];return _0x3cf19b;};'use strict';var EventEmitter=require(_0xd80e('0x0'));var WhatsappMessage=require('../../mysqldb')['db'][_0xd80e('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xd80e('0x2')](0x0);var events={'afterCreate':_0xd80e('0x3'),'afterUpdate':'update','afterDestroy':_0xd80e('0x4')};function emitEvent(_0x46876f){return function(_0x2b742b,_0x3413d4,_0x5ae6c6){WhatsappMessageEvents[_0xd80e('0x5')](_0x46876f+':'+_0x2b742b['id'],_0x2b742b);WhatsappMessageEvents[_0xd80e('0x5')](_0x46876f,_0x2b742b);_0x5ae6c6(null);};}for(var e in events){if(events[_0xd80e('0x6')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0xd80e('0x7')]=WhatsappMessageEvents; \ No newline at end of file +var _0x36ee=['WhatsappMessage','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x36ee,0xe8));var _0xe36e=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x36ee[_0x3bf83f];return _0x22c4a9;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require('../../mysqldb')['db'][_0xe36e('0x0')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe36e('0x1'),'afterUpdate':_0xe36e('0x2'),'afterDestroy':_0xe36e('0x3')};function emitEvent(_0xe3bee0){return function(_0x567a84,_0x1118af,_0x29e692){WhatsappMessageEvents[_0xe36e('0x4')](_0xe3bee0+':'+_0x567a84['id'],_0x567a84);WhatsappMessageEvents[_0xe36e('0x4')](_0xe3bee0,_0x567a84);_0x29e692(null);};}for(var e in events){if(events[_0xe36e('0x5')](e)){var event=events[e];WhatsappMessage[_0xe36e('0x6')](e,emitEvent(event));}}module[_0xe36e('0x7')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 21386f2..454e17f 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 _0x32a6=['get','direction','toLowerCase','secret','UserId','findOne','WhatsappInteractionId','update','createdAt','error','WhatsappAccount','find','WhatsappAccountId','then','type','twilio','accountSid','authToken','messages','body','whatsapp:','phone','remote','/api/whatsapp/messages/','token','sid','catch','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','baseUrl','text','POST','Bearer\x20','application/json','statuses','message_id','WhatsappMessage,\x20%s','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise','node-fetch','rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','whatsapp_messages','messageId','fti_whatsapp_messages','FULLTEXT','models'];(function(_0x245ac5,_0x4215f1){var _0x437858=function(_0x3f121b){while(--_0x3f121b){_0x245ac5['push'](_0x245ac5['shift']());}};_0x437858(++_0x4215f1);}(_0x32a6,0x108));var _0x632a=function(_0x3ae7b7,_0x469102){_0x3ae7b7=_0x3ae7b7-0x0;var _0x550b35=_0x32a6[_0x3ae7b7];return _0x550b35;};'use strict';var _=require(_0x632a('0x0'));var util=require('util');var logger=require(_0x632a('0x1'))(_0x632a('0x2'));var moment=require('moment');var BPromise=require(_0x632a('0x3'));var rp=require(_0x632a('0x4'));var fetch=require(_0x632a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x632a('0x6'));var config=require(_0x632a('0x7'));var attributes=require(_0x632a('0x8'));module[_0x632a('0x9')]=function(_0x13c7c7,_0x9fce04){return _0x13c7c7[_0x632a('0xa')]('WhatsappMessage',attributes,{'tableName':_0x632a('0xb'),'paranoid':![],'indexes':[{'name':_0x632a('0xc'),'fields':[_0x632a('0xc')]},{'name':_0x632a('0xd'),'fields':['body'],'type':_0x632a('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4500c3,_0x43755b,_0x53396d){var _0x7bfc79=_0x13c7c7[_0x632a('0xf')];var _0x44d7a1=_0x4500c3[_0x632a('0x10')]({'plain':!![]});if(_0x44d7a1[_0x632a('0x11')][_0x632a('0x12')]()==='in'||_0x44d7a1[_0x632a('0x11')]['toLowerCase']()==='out'&&!_0x44d7a1[_0x632a('0x13')]&&!_['isNil'](_0x44d7a1[_0x632a('0x14')])){_0x7bfc79['WhatsappInteraction'][_0x632a('0x15')]({'where':{'id':_0x44d7a1[_0x632a('0x16')]}})['then'](function(_0x2a2ab1){if(_0x2a2ab1){_0x2a2ab1[_0x632a('0x17')]({'lastMsgAt':_0x44d7a1[_0x632a('0x18')],'lastMsgDirection':_0x44d7a1[_0x632a('0x11')]['toLowerCase']()});}})['catch'](function(_0x839728){console[_0x632a('0x19')](_0x839728);});}if(_0x44d7a1['direction']==='out'&&!_0x44d7a1[_0x632a('0x13')]){var _0x35ec23;_0x7bfc79[_0x632a('0x1a')][_0x632a('0x1b')]({'where':{'id':_0x44d7a1[_0x632a('0x1c')]},'raw':!![]})[_0x632a('0x1d')](function(_0x432ea2){_0x35ec23=_0x432ea2;if(_0x35ec23&&_0x35ec23[_0x632a('0x1e')]){switch(_0x35ec23['type']){case _0x632a('0x1f'):var _0x301705=require(_0x632a('0x1f'));if(_0x35ec23[_0x632a('0x20')]&&_0x35ec23[_0x632a('0x21')]&&_0x35ec23['phone']){var _0x144b9c=new _0x301705(_0x35ec23[_0x632a('0x20')],_0x35ec23[_0x632a('0x21')]);_0x144b9c[_0x632a('0x22')]['create']({'body':_0x44d7a1[_0x632a('0x23')],'to':'whatsapp:'+_0x44d7a1['phone'],'from':_0x632a('0x24')+_0x35ec23[_0x632a('0x25')],'statusCallback':_0x35ec23[_0x632a('0x26')]+_0x632a('0x27')+_0x44d7a1['id']+'/status?token='+_0x35ec23[_0x632a('0x28')]})['then'](function(_0x1ad596){if(_0x1ad596['sid']){return _0x4500c3['update']({'messageId':_0x1ad596[_0x632a('0x29')]});}})[_0x632a('0x2a')](function(_0x3274c8){logger[_0x632a('0x19')]('WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x632a('0x1f'),util['inspect'](_0x3274c8,{'showHidden':![],'depth':null}));});}else{logger['error']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x632a('0x2b'),_0x632a('0x1f'),_0x632a('0x2c'));}break;case'sinch':var _0x264837=_0x35ec23[_0x632a('0x20')];var _0x1fc0d5=_0x35ec23[_0x632a('0x21')];var _0x2e9329=_0x35ec23[_0x632a('0x2d')]+'/whatsapp/v1/'+_0x264837+'/messages/';var _0x5014b6={'to':[_0x44d7a1[_0x632a('0x25')]],'message':{'type':_0x632a('0x2e'),'text':_0x44d7a1[_0x632a('0x23')]}};var _0x1fb803={'method':_0x632a('0x2f'),'uri':_0x2e9329,'headers':{'Authorization':_0x632a('0x30')+_0x1fc0d5,'Content-Type':_0x632a('0x31')},'body':_0x5014b6,'json':!![]};rp(_0x1fb803)[_0x632a('0x1d')](function(_0x59b514){if(_0x59b514[_0x632a('0x32')][0x0][_0x632a('0x33')]){return _0x4500c3['update']({'messageId':_0x59b514['statuses'][0x0]['message_id']});}})['catch'](function(_0x2f5626){logger['err'](_0x632a('0x34'),_0x2f5626);});break;}}})[_0x632a('0x35')](function(){_0x53396d();});}else{_0x53396d();}}},'charset':_0x632a('0x36'),'collate':_0x632a('0x37')});}; \ No newline at end of file +var _0x8e73=['out','secret','isNil','WhatsappInteraction','WhatsappInteractionId','then','update','createdAt','catch','error','WhatsappAccount','WhatsappAccountId','type','twilio','accountSid','authToken','phone','body','whatsapp:','remote','/api/whatsapp/messages/','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','/messages/','text','POST','Bearer\x20','message_id','statuses','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','node-fetch','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','whatsapp_messages','messageId','FULLTEXT','models','get','direction','toLowerCase'];(function(_0x69b201,_0x44bd9d){var _0x3d9916=function(_0x186dd2){while(--_0x186dd2){_0x69b201['push'](_0x69b201['shift']());}};_0x3d9916(++_0x44bd9d);}(_0x8e73,0x113));var _0x38e7=function(_0x3e5e6e,_0x128c9c){_0x3e5e6e=_0x3e5e6e-0x0;var _0x57fd71=_0x8e73[_0x3e5e6e];return _0x57fd71;};'use strict';var _=require(_0x38e7('0x0'));var util=require(_0x38e7('0x1'));var logger=require('../../config/logger')(_0x38e7('0x2'));var moment=require(_0x38e7('0x3'));var BPromise=require(_0x38e7('0x4'));var rp=require('request-promise');var fetch=require(_0x38e7('0x5'));var fs=require('fs');var path=require(_0x38e7('0x6'));var rimraf=require(_0x38e7('0x7'));var config=require(_0x38e7('0x8'));var attributes=require(_0x38e7('0x9'));module[_0x38e7('0xa')]=function(_0x375b79,_0x4567d0){return _0x375b79[_0x38e7('0xb')](_0x38e7('0xc'),attributes,{'tableName':_0x38e7('0xd'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x38e7('0xe')]},{'name':'fti_whatsapp_messages','fields':['body'],'type':_0x38e7('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x394988,_0x2ca634,_0x3e801a){var _0x21ea2f=_0x375b79[_0x38e7('0x10')];var _0x15772b=_0x394988[_0x38e7('0x11')]({'plain':!![]});if(_0x15772b[_0x38e7('0x12')][_0x38e7('0x13')]()==='in'||_0x15772b[_0x38e7('0x12')][_0x38e7('0x13')]()===_0x38e7('0x14')&&!_0x15772b[_0x38e7('0x15')]&&!_[_0x38e7('0x16')](_0x15772b['UserId'])){_0x21ea2f[_0x38e7('0x17')]['findOne']({'where':{'id':_0x15772b[_0x38e7('0x18')]}})[_0x38e7('0x19')](function(_0x4f53c6){if(_0x4f53c6){_0x4f53c6[_0x38e7('0x1a')]({'lastMsgAt':_0x15772b[_0x38e7('0x1b')],'lastMsgDirection':_0x15772b[_0x38e7('0x12')][_0x38e7('0x13')]()});}})[_0x38e7('0x1c')](function(_0x44e2d7){console[_0x38e7('0x1d')](_0x44e2d7);});}if(_0x15772b[_0x38e7('0x12')]===_0x38e7('0x14')&&!_0x15772b[_0x38e7('0x15')]){var _0x4ca1b4;_0x21ea2f[_0x38e7('0x1e')]['find']({'where':{'id':_0x15772b[_0x38e7('0x1f')]},'raw':!![]})[_0x38e7('0x19')](function(_0x3f13a2){_0x4ca1b4=_0x3f13a2;if(_0x4ca1b4&&_0x4ca1b4['type']){switch(_0x4ca1b4[_0x38e7('0x20')]){case _0x38e7('0x21'):var _0x26ce25=require(_0x38e7('0x21'));if(_0x4ca1b4[_0x38e7('0x22')]&&_0x4ca1b4[_0x38e7('0x23')]&&_0x4ca1b4[_0x38e7('0x24')]){var _0x4e4e42=new _0x26ce25(_0x4ca1b4[_0x38e7('0x22')],_0x4ca1b4[_0x38e7('0x23')]);_0x4e4e42['messages']['create']({'body':_0x15772b[_0x38e7('0x25')],'to':_0x38e7('0x26')+_0x15772b[_0x38e7('0x24')],'from':_0x38e7('0x26')+_0x4ca1b4[_0x38e7('0x24')],'statusCallback':_0x4ca1b4[_0x38e7('0x27')]+_0x38e7('0x28')+_0x15772b['id']+'/status?token='+_0x4ca1b4[_0x38e7('0x29')]})[_0x38e7('0x19')](function(_0x2d4068){if(_0x2d4068[_0x38e7('0x2a')]){return _0x394988[_0x38e7('0x1a')]({'messageId':_0x2d4068[_0x38e7('0x2a')]});}})[_0x38e7('0x1c')](function(_0x57d158){logger[_0x38e7('0x1d')](_0x38e7('0x2b'),'afterCreate',_0x38e7('0x21'),util[_0x38e7('0x2c')](_0x57d158,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x38e7('0x2b'),_0x38e7('0x2d'),_0x38e7('0x21'),_0x38e7('0x2e'));}break;case _0x38e7('0x2f'):var _0x107f0d=_0x4ca1b4[_0x38e7('0x22')];var _0x4b5ce3=_0x4ca1b4[_0x38e7('0x23')];var _0x3167e9=_0x4ca1b4[_0x38e7('0x30')]+_0x38e7('0x31')+_0x107f0d+_0x38e7('0x32');var _0x383b02={'to':[_0x15772b[_0x38e7('0x24')]],'message':{'type':_0x38e7('0x33'),'text':_0x15772b[_0x38e7('0x25')]}};var _0x12b7ee={'method':_0x38e7('0x34'),'uri':_0x3167e9,'headers':{'Authorization':_0x38e7('0x35')+_0x4b5ce3,'Content-Type':'application/json'},'body':_0x383b02,'json':!![]};rp(_0x12b7ee)['then'](function(_0x2817a4){if(_0x2817a4['statuses'][0x0][_0x38e7('0x36')]){return _0x394988[_0x38e7('0x1a')]({'messageId':_0x2817a4[_0x38e7('0x37')][0x0][_0x38e7('0x36')]});}})[_0x38e7('0x1c')](function(_0x3ae9cc){logger['err']('WhatsappMessage,\x20%s',_0x3ae9cc);});break;}}})[_0x38e7('0x38')](function(){_0x3e801a();});}else{_0x3e801a();}}},'charset':_0x38e7('0x39'),'collate':_0x38e7('0x3a')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 327d262..890cfc5 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 _0x30af=['client','http','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','request','then','info','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','catch','WhatsappMessage','create','options','raw','CreateWhatsappMessage','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x574d54,_0x187d38){var _0x4db68f=function(_0x5f0093){while(--_0x5f0093){_0x574d54['push'](_0x574d54['shift']());}};_0x4db68f(++_0x187d38);}(_0x30af,0xc2));var _0xf30a=function(_0x899a7b,_0x47f3fe){_0x899a7b=_0x899a7b-0x0;var _0x501574=_0x30af[_0x899a7b];return _0x501574;};'use strict';var _=require(_0xf30a('0x0'));var util=require(_0xf30a('0x1'));var moment=require(_0xf30a('0x2'));var BPromise=require(_0xf30a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf30a('0x4'));var db=require(_0xf30a('0x5'))['db'];var utils=require(_0xf30a('0x6'));var logger=require(_0xf30a('0x7'))(_0xf30a('0x8'));var config=require(_0xf30a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf30a('0xa')][_0xf30a('0xb')]({'port':0x232a});config[_0xf30a('0xc')]=_[_0xf30a('0xd')](config[_0xf30a('0xc')],{'host':_0xf30a('0xe'),'port':0x18eb});var socket=require(_0xf30a('0xf'))(new Redis(config[_0xf30a('0xc')]));require(_0xf30a('0x10'))['register'](socket);function respondWithRpcPromise(_0x31f140,_0x2421e2,_0x5473c8){return new BPromise(function(_0x56c55e,_0x4730a3){return client[_0xf30a('0x11')](_0x31f140,_0x5473c8)[_0xf30a('0x12')](function(_0x4bb768){logger[_0xf30a('0x13')]('WhatsappMessage,\x20%s,\x20%s',_0x2421e2,_0xf30a('0x14'));logger['debug'](_0xf30a('0x15'),_0x2421e2,_0xf30a('0x14'),JSON[_0xf30a('0x16')](_0x4bb768));if(_0x4bb768[_0xf30a('0x17')]){if(_0x4bb768['error'][_0xf30a('0x18')]===0x1f4){logger[_0xf30a('0x17')](_0xf30a('0x19'),_0x2421e2,_0x4bb768[_0xf30a('0x17')][_0xf30a('0x1a')]);return _0x4730a3(_0x4bb768[_0xf30a('0x17')]['message']);}logger[_0xf30a('0x17')](_0xf30a('0x19'),_0x2421e2,_0x4bb768[_0xf30a('0x17')]['message']);return _0x56c55e(_0x4bb768['error'][_0xf30a('0x1a')]);}else{logger[_0xf30a('0x13')](_0xf30a('0x19'),_0x2421e2,_0xf30a('0x14'));_0x56c55e(_0x4bb768['result']['message']);}})[_0xf30a('0x1b')](function(_0x43020b){logger[_0xf30a('0x17')](_0xf30a('0x19'),_0x2421e2,_0x43020b);_0x4730a3(_0x43020b);});});}exports['CreateWhatsappMessage']=function(_0x27c9fd){var _0x29d5cc=this;return new Promise(function(_0x1c14e1,_0x1f3bca){return db[_0xf30a('0x1c')][_0xf30a('0x1d')](_0x27c9fd['body'],{'raw':_0x27c9fd[_0xf30a('0x1e')]?_0x27c9fd[_0xf30a('0x1e')][_0xf30a('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x59a7b2){logger['info'](_0xf30a('0x20'),_0x27c9fd);logger[_0xf30a('0x21')](_0xf30a('0x20'),_0x27c9fd,JSON[_0xf30a('0x16')](_0x59a7b2));_0x1c14e1(_0x59a7b2);})[_0xf30a('0x1b')](function(_0x3cc39a){logger['error'](_0xf30a('0x20'),_0x3cc39a[_0xf30a('0x1a')],_0x27c9fd);_0x1f3bca(_0x29d5cc[_0xf30a('0x17')](0x1f4,_0x3cc39a[_0xf30a('0x1a')]));});});}; \ No newline at end of file +var _0xe784=['body','options','raw','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./whatsappMessage.socket','register','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','CreateWhatsappMessage','WhatsappMessage','create'];(function(_0x389c38,_0x92188d){var _0x23933e=function(_0x317193){while(--_0x317193){_0x389c38['push'](_0x389c38['shift']());}};_0x23933e(++_0x92188d);}(_0xe784,0x158));var _0x4e78=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xe784[_0x32f7d7];return _0x133d09;};'use strict';var _=require(_0x4e78('0x0'));var util=require(_0x4e78('0x1'));var moment=require(_0x4e78('0x2'));var BPromise=require('bluebird');var rs=require(_0x4e78('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4e78('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4e78('0x5'))(_0x4e78('0x6'));var config=require(_0x4e78('0x7'));var jayson=require(_0x4e78('0x8'));var client=jayson[_0x4e78('0x9')][_0x4e78('0xa')]({'port':0x232a});config['redis']=_[_0x4e78('0xb')](config[_0x4e78('0xc')],{'host':_0x4e78('0xd'),'port':0x18eb});var socket=require(_0x4e78('0xe'))(new Redis(config[_0x4e78('0xc')]));require(_0x4e78('0xf'))[_0x4e78('0x10')](socket);function respondWithRpcPromise(_0x1a8b47,_0x2a33fc,_0x2b16cb){return new BPromise(function(_0xb5e44b,_0x3091ce){return client[_0x4e78('0x11')](_0x1a8b47,_0x2b16cb)[_0x4e78('0x12')](function(_0x324154){logger[_0x4e78('0x13')](_0x4e78('0x14'),_0x2a33fc,_0x4e78('0x15'));logger[_0x4e78('0x16')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x2a33fc,_0x4e78('0x15'),JSON[_0x4e78('0x17')](_0x324154));if(_0x324154[_0x4e78('0x18')]){if(_0x324154[_0x4e78('0x18')]['code']===0x1f4){logger[_0x4e78('0x18')]('WhatsappMessage,\x20%s,\x20%s',_0x2a33fc,_0x324154[_0x4e78('0x18')][_0x4e78('0x19')]);return _0x3091ce(_0x324154['error'][_0x4e78('0x19')]);}logger[_0x4e78('0x18')]('WhatsappMessage,\x20%s,\x20%s',_0x2a33fc,_0x324154[_0x4e78('0x18')][_0x4e78('0x19')]);return _0xb5e44b(_0x324154['error']['message']);}else{logger[_0x4e78('0x13')]('WhatsappMessage,\x20%s,\x20%s',_0x2a33fc,'request\x20sent');_0xb5e44b(_0x324154[_0x4e78('0x1a')][_0x4e78('0x19')]);}})['catch'](function(_0x85038d){logger[_0x4e78('0x18')](_0x4e78('0x14'),_0x2a33fc,_0x85038d);_0x3091ce(_0x85038d);});});}exports[_0x4e78('0x1b')]=function(_0x2351fe){var _0x5f0a60=this;return new Promise(function(_0x2ba216,_0x3b1a7d){return db[_0x4e78('0x1c')][_0x4e78('0x1d')](_0x2351fe[_0x4e78('0x1e')],{'raw':_0x2351fe[_0x4e78('0x1f')]?_0x2351fe[_0x4e78('0x1f')][_0x4e78('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x2900d2){logger[_0x4e78('0x13')](_0x4e78('0x1b'),_0x2351fe);logger[_0x4e78('0x16')](_0x4e78('0x1b'),_0x2351fe,JSON['stringify'](_0x2900d2));_0x2ba216(_0x2900d2);})[_0x4e78('0x21')](function(_0x2a4c51){logger[_0x4e78('0x18')](_0x4e78('0x1b'),_0x2a4c51[_0x4e78('0x19')],_0x2351fe);_0x3b1a7d(_0x5f0a60[_0x4e78('0x18')](0x1f4,_0x2a4c51[_0x4e78('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index c3c4bec..e689844 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 _0x007a=['./whatsappMessage.events','remove','removeListener','register','whatsappMessage:'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x007a,0xff));var _0xa007=function(_0x621bee,_0x58f8c0){_0x621bee=_0x621bee-0x0;var _0x3076c8=_0x007a[_0x621bee];return _0x3076c8;};'use strict';var WhatsappMessageEvents=require(_0xa007('0x0'));var events=['save',_0xa007('0x1'),'update'];function createListener(_0xbdb8f3,_0x11192c){return function(_0x20b718){_0x11192c['emit'](_0xbdb8f3,_0x20b718);};}function removeListener(_0x17c367,_0x22034d){return function(){WhatsappMessageEvents[_0xa007('0x2')](_0x17c367,_0x22034d);};}exports[_0xa007('0x3')]=function(_0x336d2d){for(var _0x1911c5=0x0,_0x1e62ab=events['length'];_0x1911c5<_0x1e62ab;_0x1911c5++){var _0xae82fb=events[_0x1911c5];var _0x205d06=createListener(_0xa007('0x4')+_0xae82fb,_0x336d2d);WhatsappMessageEvents['on'](_0xae82fb,_0x205d06);}}; \ No newline at end of file +var _0x0b99=['whatsappMessage:','update','emit','removeListener','register'];(function(_0x46df0c,_0x24caaf){var _0x759ae9=function(_0x628aa){while(--_0x628aa){_0x46df0c['push'](_0x46df0c['shift']());}};_0x759ae9(++_0x24caaf);}(_0x0b99,0x178));var _0x90b9=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0b99[_0x14add3];return _0x4a174f;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=['save','remove',_0x90b9('0x0')];function createListener(_0x5b7621,_0x59affc){return function(_0x2cb1e9){_0x59affc[_0x90b9('0x1')](_0x5b7621,_0x2cb1e9);};}function removeListener(_0xb2b76f,_0x3e054d){return function(){WhatsappMessageEvents[_0x90b9('0x2')](_0xb2b76f,_0x3e054d);};}exports[_0x90b9('0x3')]=function(_0x1086c2){for(var _0x5e4eb3=0x0,_0x27e6d6=events['length'];_0x5e4eb3<_0x27e6d6;_0x5e4eb3++){var _0xc4181d=events[_0x5e4eb3];var _0x1b9f5d=createListener(_0x90b9('0x4')+_0xc4181d,_0x1086c2);WhatsappMessageEvents['on'](_0xc4181d,_0x1b9f5d);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index d8e87f4..e6b80fc 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 _0x6efd=['/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','/:id/teams','addAgents','put','/:id','delete','destroy','removeTeams','removeAgents','exports','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index'];(function(_0x4d7d33,_0x575510){var _0x19407b=function(_0x24a723){while(--_0x24a723){_0x4d7d33['push'](_0x4d7d33['shift']());}};_0x19407b(++_0x575510);}(_0x6efd,0x87));var _0xd6ef=function(_0x3aed37,_0x36c588){_0x3aed37=_0x3aed37-0x0;var _0x32bb4f=_0x6efd[_0x3aed37];return _0x32bb4f;};'use strict';var multer=require('multer');var util=require(_0xd6ef('0x0'));var path=require('path');var timeout=require(_0xd6ef('0x1'));var express=require('express');var router=express[_0xd6ef('0x2')]();var fs_extra=require(_0xd6ef('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xd6ef('0x4'));var config=require(_0xd6ef('0x5'));var controller=require(_0xd6ef('0x6'));router[_0xd6ef('0x7')]('/',auth[_0xd6ef('0x8')](),controller[_0xd6ef('0x9')]);router[_0xd6ef('0x7')](_0xd6ef('0xa'),auth[_0xd6ef('0x8')](),controller[_0xd6ef('0xb')]);router[_0xd6ef('0x7')]('/:id',auth[_0xd6ef('0x8')](),controller[_0xd6ef('0xc')]);router[_0xd6ef('0x7')](_0xd6ef('0xd'),auth[_0xd6ef('0x8')](),controller[_0xd6ef('0xe')]);router[_0xd6ef('0x7')]('/:id/teams',auth[_0xd6ef('0x8')](),controller[_0xd6ef('0xf')]);router[_0xd6ef('0x7')](_0xd6ef('0x10'),auth['isAuthenticated'](),controller[_0xd6ef('0x11')]);router[_0xd6ef('0x12')]('/',auth['isAuthenticated'](),controller[_0xd6ef('0x13')]);router['post'](_0xd6ef('0x14'),auth[_0xd6ef('0x8')](),controller['addTeams']);router[_0xd6ef('0x12')]('/:id/users',auth[_0xd6ef('0x8')](),controller[_0xd6ef('0x15')]);router[_0xd6ef('0x16')](_0xd6ef('0x17'),auth[_0xd6ef('0x8')](),controller['update']);router[_0xd6ef('0x18')](_0xd6ef('0x17'),auth['isAuthenticated'](),controller[_0xd6ef('0x19')]);router[_0xd6ef('0x18')](_0xd6ef('0x14'),auth[_0xd6ef('0x8')](),controller[_0xd6ef('0x1a')]);router[_0xd6ef('0x18')](_0xd6ef('0x10'),auth['isAuthenticated'](),controller[_0xd6ef('0x1b')]);module[_0xd6ef('0x1c')]=router; \ No newline at end of file +var _0xa84a=['../../config/environment','./whatsappQueue.controller','get','index','/describe','/:id','show','/:id/members','isAuthenticated','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','update','delete','destroy','removeTeams','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x2b0f81,_0x3917f0){var _0x5ce74c=function(_0x12dc0d){while(--_0x12dc0d){_0x2b0f81['push'](_0x2b0f81['shift']());}};_0x5ce74c(++_0x3917f0);}(_0xa84a,0xa7));var _0xaa84=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xa84a[_0x126558];return _0x1f6d14;};'use strict';var multer=require('multer');var util=require(_0xaa84('0x0'));var path=require(_0xaa84('0x1'));var timeout=require(_0xaa84('0x2'));var express=require(_0xaa84('0x3'));var router=express[_0xaa84('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xaa84('0x5'));var interaction=require(_0xaa84('0x6'));var config=require(_0xaa84('0x7'));var controller=require(_0xaa84('0x8'));router[_0xaa84('0x9')]('/',auth['isAuthenticated'](),controller[_0xaa84('0xa')]);router[_0xaa84('0x9')](_0xaa84('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xaa84('0xc'),auth['isAuthenticated'](),controller[_0xaa84('0xd')]);router[_0xaa84('0x9')](_0xaa84('0xe'),auth[_0xaa84('0xf')](),controller[_0xaa84('0x10')]);router[_0xaa84('0x9')](_0xaa84('0x11'),auth[_0xaa84('0xf')](),controller[_0xaa84('0x12')]);router[_0xaa84('0x9')](_0xaa84('0x13'),auth['isAuthenticated'](),controller[_0xaa84('0x14')]);router[_0xaa84('0x15')]('/',auth[_0xaa84('0xf')](),controller[_0xaa84('0x16')]);router[_0xaa84('0x15')](_0xaa84('0x11'),auth[_0xaa84('0xf')](),controller[_0xaa84('0x17')]);router[_0xaa84('0x15')]('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router['put']('/:id',auth['isAuthenticated'](),controller[_0xaa84('0x18')]);router[_0xaa84('0x19')](_0xaa84('0xc'),auth[_0xaa84('0xf')](),controller[_0xaa84('0x1a')]);router[_0xaa84('0x19')](_0xaa84('0x11'),auth['isAuthenticated'](),controller[_0xaa84('0x1b')]);router[_0xaa84('0x19')](_0xaa84('0x13'),auth[_0xaa84('0xf')](),controller['removeAgents']);module[_0xaa84('0x1c')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index bbb589b..946cdb0 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 _0xf822=['beepall','sequelize','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x174d8b,_0x30ed1c){var _0x2d271d=function(_0x425dac){while(--_0x425dac){_0x174d8b['push'](_0x174d8b['shift']());}};_0x2d271d(++_0x30ed1c);}(_0xf822,0x19e));var _0x2f82=function(_0x4afe2b,_0x566ab0){_0x4afe2b=_0x4afe2b-0x0;var _0x557a9b=_0xf822[_0x4afe2b];return _0x557a9b;};'use strict';var Sequelize=require(_0x2f82('0x0'));module['exports']={'name':{'type':Sequelize[_0x2f82('0x1')],'unique':_0x2f82('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x2f82('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2f82('0x4')](_0x2f82('0x5'),_0x2f82('0x6'),'roundrobin')},'description':{'type':Sequelize[_0x2f82('0x1')]}}; \ No newline at end of file +var _0x83f1=['STRING','name','INTEGER','beepall','roundrobin','sequelize','exports'];(function(_0x2b2f7a,_0x3cbeec){var _0x12c70c=function(_0x29e6cf){while(--_0x29e6cf){_0x2b2f7a['push'](_0x2b2f7a['shift']());}};_0x12c70c(++_0x3cbeec);}(_0x83f1,0x1cc));var _0x183f=function(_0x558afa,_0x2167e3){_0x558afa=_0x558afa-0x0;var _0x32b438=_0x83f1[_0x558afa];return _0x32b438;};'use strict';var Sequelize=require(_0x183f('0x0'));module[_0x183f('0x1')]={'name':{'type':Sequelize[_0x183f('0x2')],'unique':_0x183f('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x183f('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x183f('0x5'),_0x183f('0x6'))},'description':{'type':Sequelize[_0x183f('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index eab04b1..cdf93c7 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 _0xf5d9=['QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','isArray','getAgents','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','WhatsappQueues','UserProfileResource','name','index','map','WhatsappQueue','fieldName','key','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserWhatsappQueue','rawAttributes','sort','WhatsappQueueId','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','ids','Agents','online','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','select','field','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString'];(function(_0x361801,_0x993729){var _0x174182=function(_0x13094a){while(--_0x13094a){_0x361801['push'](_0x361801['shift']());}};_0x174182(++_0x993729);}(_0xf5d9,0x1c4));var _0x9f5d=function(_0x243217,_0x522951){_0x243217=_0x243217-0x0;var _0x478029=_0xf5d9[_0x243217];return _0x478029;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9f5d('0x0'));var zipdir=require(_0x9f5d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9f5d('0x2'));var moment=require(_0x9f5d('0x3'));var BPromise=require(_0x9f5d('0x4'));var Mustache=require(_0x9f5d('0x5'));var util=require('util');var path=require(_0x9f5d('0x6'));var sox=require(_0x9f5d('0x7'));var csv=require(_0x9f5d('0x8'));var ejs=require(_0x9f5d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9f5d('0xa'));var squel=require(_0x9f5d('0xb'));var crypto=require(_0x9f5d('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9f5d('0xd'));var Redis=require(_0x9f5d('0xe'));var authService=require(_0x9f5d('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9f5d('0x10'));var logger=require(_0x9f5d('0x11'))(_0x9f5d('0x12'));var utils=require(_0x9f5d('0x13'));var config=require(_0x9f5d('0x14'));var licenseUtil=require(_0x9f5d('0x15'));var db=require(_0x9f5d('0x16'))['db'];config[_0x9f5d('0x17')]=_[_0x9f5d('0x18')](config['redis'],{'host':_0x9f5d('0x19'),'port':0x18eb});var socket=require(_0x9f5d('0x1a'))(new Redis(config[_0x9f5d('0x17')]));require(_0x9f5d('0x1b'))['register'](socket);function respondWithStatusCode(_0x415581,_0x2d61a1){_0x2d61a1=_0x2d61a1||0xcc;return function(_0x4ffa1e){if(_0x4ffa1e){return _0x415581[_0x9f5d('0x1c')](_0x2d61a1);}return _0x415581['status'](_0x2d61a1)[_0x9f5d('0x1d')]();};}function respondWithResult(_0x58a571,_0x135de0){_0x135de0=_0x135de0||0xc8;return function(_0x547150){if(_0x547150){return _0x58a571[_0x9f5d('0x1e')](_0x135de0)[_0x9f5d('0x1f')](_0x547150);}};}function respondWithFilteredResult(_0x1770d6,_0x418f97){return function(_0x246486){if(_0x246486){var _0x1b09a8=typeof _0x418f97[_0x9f5d('0x20')]===_0x9f5d('0x21')&&typeof _0x418f97[_0x9f5d('0x22')]===_0x9f5d('0x21');var _0x2d97e0=_0x246486[_0x9f5d('0x23')];var _0x104c7b=_0x1b09a8?0x0:_0x418f97[_0x9f5d('0x20')];var _0x5c923d=_0x1b09a8?_0x246486[_0x9f5d('0x23')]:_0x418f97[_0x9f5d('0x20')]+_0x418f97[_0x9f5d('0x22')];var _0x17d34b;if(_0x5c923d>=_0x2d97e0){_0x5c923d=_0x2d97e0;_0x17d34b=0xc8;}else{_0x17d34b=0xce;}_0x1770d6[_0x9f5d('0x1e')](_0x17d34b);return _0x1770d6['set'](_0x9f5d('0x24'),_0x104c7b+'-'+_0x5c923d+'/'+_0x2d97e0)[_0x9f5d('0x1f')](_0x246486);}return null;};}function patchUpdates(_0x5cbfb5){return function(_0x3c713c){try{jsonpatch[_0x9f5d('0x25')](_0x3c713c,_0x5cbfb5,!![]);}catch(_0x452c84){return BPromise[_0x9f5d('0x26')](_0x452c84);}return _0x3c713c[_0x9f5d('0x27')]();};}function saveUpdates(_0x208adf,_0x3578e8){return function(_0x432862){if(_0x432862){return _0x432862[_0x9f5d('0x28')](_0x208adf)[_0x9f5d('0x29')](function(_0x3c1ed6){return _0x3c1ed6;});}return null;};}function removeEntity(_0x40a0aa,_0x250461){return function(_0xd3eb75){if(_0xd3eb75){return _0xd3eb75[_0x9f5d('0x2a')]()[_0x9f5d('0x29')](function(){var _0x1aca36=_0xd3eb75[_0x9f5d('0x2b')]({'plain':!![]});var _0x30a9df=_0x9f5d('0x2c');return db[_0x9f5d('0x2d')][_0x9f5d('0x2a')]({'where':{'type':_0x30a9df,'resourceId':_0x1aca36['id']}})[_0x9f5d('0x29')](function(){return _0xd3eb75;});})['then'](function(){_0x40a0aa[_0x9f5d('0x1e')](0xcc)[_0x9f5d('0x1d')]();});}};}function handleEntityNotFound(_0x2b3704,_0xe75205){return function(_0x16f746){if(!_0x16f746){_0x2b3704['sendStatus'](0x194);}return _0x16f746;};}function handleError(_0x2ef8a2,_0x232b7e){_0x232b7e=_0x232b7e||0x1f4;return function(_0x314814){logger['error'](_0x314814['stack']);if(_0x314814[_0x9f5d('0x2e')]){delete _0x314814[_0x9f5d('0x2e')];}_0x2ef8a2[_0x9f5d('0x1e')](_0x232b7e)['send'](_0x314814);};}exports[_0x9f5d('0x2f')]=function(_0x658591,_0x6d8a33){var _0x5dec7c={},_0x266d68={},_0x48203f={'count':0x0,'rows':[]};var _0x23f4c9=_[_0x9f5d('0x30')](db[_0x9f5d('0x31')]['rawAttributes'],function(_0x3766d1){return{'name':_0x3766d1[_0x9f5d('0x32')],'type':_0x3766d1['type'][_0x9f5d('0x33')]};});_0x266d68[_0x9f5d('0x34')]=_[_0x9f5d('0x30')](_0x23f4c9,'name');_0x266d68['query']=_[_0x9f5d('0x35')](_0x658591['query']);_0x266d68[_0x9f5d('0x36')]=_[_0x9f5d('0x37')](_0x266d68[_0x9f5d('0x34')],_0x266d68[_0x9f5d('0x38')]);_0x5dec7c[_0x9f5d('0x39')]=_[_0x9f5d('0x37')](_0x266d68[_0x9f5d('0x34')],qs['fields'](_0x658591[_0x9f5d('0x38')][_0x9f5d('0x3a')]));_0x5dec7c[_0x9f5d('0x39')]=_0x5dec7c[_0x9f5d('0x39')]['length']?_0x5dec7c['attributes']:_0x266d68['model'];if(!_0x658591[_0x9f5d('0x38')][_0x9f5d('0x3b')](_0x9f5d('0x3c'))){_0x5dec7c[_0x9f5d('0x22')]=qs[_0x9f5d('0x22')](_0x658591[_0x9f5d('0x38')]['limit']);_0x5dec7c[_0x9f5d('0x20')]=qs[_0x9f5d('0x20')](_0x658591['query']['offset']);}_0x5dec7c[_0x9f5d('0x3d')]=qs['sort'](_0x658591['query']['sort']);_0x5dec7c[_0x9f5d('0x3e')]=qs['filters'](_[_0x9f5d('0x3f')](_0x658591[_0x9f5d('0x38')],_0x266d68[_0x9f5d('0x36')]),_0x23f4c9);if(_0x658591[_0x9f5d('0x38')][_0x9f5d('0x40')]){_0x5dec7c[_0x9f5d('0x3e')]=_[_0x9f5d('0x41')](_0x5dec7c[_0x9f5d('0x3e')],{'$or':_['map'](_0x23f4c9,function(_0xf896c3){if(_0xf896c3['type']!==_0x9f5d('0x42')){var _0xa1d5ee={};_0xa1d5ee[_0xf896c3[_0x9f5d('0x2e')]]={'$like':'%'+_0x658591['query'][_0x9f5d('0x40')]+'%'};return _0xa1d5ee;}})});}_0x5dec7c=_[_0x9f5d('0x41')]({},_0x5dec7c,_0x658591[_0x9f5d('0x43')]);var _0x483081={'where':_0x5dec7c[_0x9f5d('0x3e')]};return db[_0x9f5d('0x31')][_0x9f5d('0x23')](_0x483081)[_0x9f5d('0x29')](function(_0x3ca3cd){_0x48203f[_0x9f5d('0x23')]=_0x3ca3cd;if(_0x658591[_0x9f5d('0x38')][_0x9f5d('0x44')]){_0x5dec7c[_0x9f5d('0x45')]=[{'all':!![]}];}return db['WhatsappQueue'][_0x9f5d('0x46')](_0x5dec7c);})[_0x9f5d('0x29')](function(_0x58891c){_0x48203f[_0x9f5d('0x47')]=_0x58891c;return _0x48203f;})[_0x9f5d('0x29')](respondWithFilteredResult(_0x6d8a33,_0x5dec7c))[_0x9f5d('0x48')](handleError(_0x6d8a33,null));};exports[_0x9f5d('0x49')]=function(_0x6c002d,_0x15d186){var _0x1826e1={'raw':!![],'where':{'id':_0x6c002d[_0x9f5d('0x4a')]['id']}},_0xf94992={};_0xf94992[_0x9f5d('0x34')]=_[_0x9f5d('0x35')](db[_0x9f5d('0x31')]['rawAttributes']);_0xf94992[_0x9f5d('0x38')]=_[_0x9f5d('0x35')](_0x6c002d[_0x9f5d('0x38')]);_0xf94992[_0x9f5d('0x36')]=_[_0x9f5d('0x37')](_0xf94992['model'],_0xf94992[_0x9f5d('0x38')]);_0x1826e1['attributes']=_[_0x9f5d('0x37')](_0xf94992['model'],qs['fields'](_0x6c002d['query'][_0x9f5d('0x3a')]));_0x1826e1[_0x9f5d('0x39')]=_0x1826e1[_0x9f5d('0x39')][_0x9f5d('0x4b')]?_0x1826e1['attributes']:_0xf94992[_0x9f5d('0x34')];if(_0x6c002d[_0x9f5d('0x38')]['includeAll']){_0x1826e1['include']=[{'all':!![]}];}_0x1826e1=_[_0x9f5d('0x41')]({},_0x1826e1,_0x6c002d[_0x9f5d('0x43')]);return db[_0x9f5d('0x31')][_0x9f5d('0x4c')](_0x1826e1)['then'](handleEntityNotFound(_0x15d186,null))['then'](respondWithResult(_0x15d186,null))[_0x9f5d('0x48')](handleError(_0x15d186,null));};exports['create']=function(_0x340a41,_0x27b5e1){return db[_0x9f5d('0x31')][_0x9f5d('0x4d')](_0x340a41[_0x9f5d('0x4e')],{})[_0x9f5d('0x29')](function(_0x2c6779){var _0x135bfd=_0x340a41[_0x9f5d('0x4f')][_0x9f5d('0x2b')]({'plain':!![]});if(!_0x135bfd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x135bfd[_0x9f5d('0x50')]==='user'){var _0x3c65b9=_0x2c6779['get']({'plain':!![]});var _0x29a483='WhatsappQueues';return db[_0x9f5d('0x51')][_0x9f5d('0x4c')]({'where':{'name':_0x29a483,'userProfileId':_0x135bfd[_0x9f5d('0x52')]},'raw':!![]})['then'](function(_0x20a62d){if(_0x20a62d&&_0x20a62d[_0x9f5d('0x53')]===0x0){return db['UserProfileResource']['create']({'name':_0x3c65b9[_0x9f5d('0x2e')],'resourceId':_0x3c65b9['id'],'type':_0x20a62d[_0x9f5d('0x2e')],'sectionId':_0x20a62d['id']},{})[_0x9f5d('0x29')](function(){return _0x2c6779;});}else{return _0x2c6779;}})[_0x9f5d('0x48')](function(_0xcbbd31){logger[_0x9f5d('0x54')](_0x9f5d('0x55'),_0xcbbd31);throw _0xcbbd31;});}return _0x2c6779;})[_0x9f5d('0x29')](respondWithResult(_0x27b5e1,0xc9))[_0x9f5d('0x48')](handleError(_0x27b5e1,null));};exports[_0x9f5d('0x28')]=function(_0x1eb2d5,_0x524e4a){if(_0x1eb2d5['body']['id']){delete _0x1eb2d5[_0x9f5d('0x4e')]['id'];}return db[_0x9f5d('0x31')][_0x9f5d('0x4c')]({'where':{'id':_0x1eb2d5[_0x9f5d('0x4a')]['id']}})[_0x9f5d('0x29')](handleEntityNotFound(_0x524e4a,null))['then'](saveUpdates(_0x1eb2d5[_0x9f5d('0x4e')],null))[_0x9f5d('0x29')](respondWithResult(_0x524e4a,null))[_0x9f5d('0x48')](handleError(_0x524e4a,null));};exports['destroy']=function(_0x514d19,_0x5ca8fe){return db[_0x9f5d('0x31')][_0x9f5d('0x4c')]({'where':{'id':_0x514d19[_0x9f5d('0x4a')]['id']}})[_0x9f5d('0x29')](handleEntityNotFound(_0x5ca8fe,null))[_0x9f5d('0x29')](removeEntity(_0x5ca8fe,null))['catch'](handleError(_0x5ca8fe,null));};exports[_0x9f5d('0x56')]=function(_0x3ab54a,_0x29818d){return db[_0x9f5d('0x31')][_0x9f5d('0x56')]()['then'](respondWithResult(_0x29818d,null))[_0x9f5d('0x48')](handleError(_0x29818d,null));};exports['getMembers']=function(_0x1be6e7,_0x52f77e,_0x372e28){var _0xb0d1b0={'raw':!![],'where':{}},_0x5e10ef={},_0x17ed54;return db[_0x9f5d('0x31')][_0x9f5d('0x57')]({'where':{'id':_0x1be6e7[_0x9f5d('0x4a')]['id']}})[_0x9f5d('0x29')](handleEntityNotFound(_0x52f77e,null))[_0x9f5d('0x29')](function(_0x465413){if(_0x465413){_0x17ed54=_0x465413[_0x9f5d('0x2b')]({'plain':!![]});_0x5e10ef[_0x9f5d('0x34')]=_['keys'](db[_0x9f5d('0x58')][_0x9f5d('0x59')]);_0x5e10ef[_0x9f5d('0x38')]=_[_0x9f5d('0x35')](_0x1be6e7[_0x9f5d('0x38')]);_0x5e10ef[_0x9f5d('0x36')]=_[_0x9f5d('0x37')](_0x5e10ef[_0x9f5d('0x34')],_0x5e10ef[_0x9f5d('0x38')]);_0xb0d1b0['attributes']=_[_0x9f5d('0x37')](_0x5e10ef[_0x9f5d('0x34')],qs[_0x9f5d('0x3a')](_0x1be6e7[_0x9f5d('0x38')]['fields']));_0xb0d1b0[_0x9f5d('0x39')]=_0xb0d1b0[_0x9f5d('0x39')][_0x9f5d('0x4b')]?_0xb0d1b0['attributes']:_0x5e10ef[_0x9f5d('0x34')];if(!_0x1be6e7[_0x9f5d('0x38')][_0x9f5d('0x3b')](_0x9f5d('0x3c'))){_0xb0d1b0[_0x9f5d('0x22')]=qs[_0x9f5d('0x22')](_0x1be6e7[_0x9f5d('0x38')][_0x9f5d('0x22')]);_0xb0d1b0[_0x9f5d('0x20')]=qs[_0x9f5d('0x20')](_0x1be6e7[_0x9f5d('0x38')]['offset']);}_0xb0d1b0['order']=qs['sort'](_0x1be6e7[_0x9f5d('0x38')][_0x9f5d('0x5a')]);_0xb0d1b0[_0x9f5d('0x3e')]=qs[_0x9f5d('0x36')](_['pick'](_0x1be6e7[_0x9f5d('0x38')],_0x5e10ef[_0x9f5d('0x36')]));_0xb0d1b0[_0x9f5d('0x3e')][_0x9f5d('0x5b')]=_0x465413['id'];if(_0x1be6e7[_0x9f5d('0x38')]['filter']){_0xb0d1b0[_0x9f5d('0x3e')]=_['merge'](_0xb0d1b0[_0x9f5d('0x3e')],{'$or':_[_0x9f5d('0x30')](_0xb0d1b0[_0x9f5d('0x39')],function(_0x3754e0){var _0x27dcae={};_0x27dcae[_0x3754e0]={'$like':'%'+_0x1be6e7[_0x9f5d('0x38')]['filter']+'%'};return _0x27dcae;})});}_0xb0d1b0=_[_0x9f5d('0x41')]({},_0xb0d1b0,_0x1be6e7['options']);return db[_0x9f5d('0x58')][_0x9f5d('0x46')](_0xb0d1b0);}})[_0x9f5d('0x29')](function(_0x24a5c8){if(_0x24a5c8){return db[_0x9f5d('0x5c')][_0x9f5d('0x5d')]({'where':{'id':_[_0x9f5d('0x30')](_0x24a5c8,_0x9f5d('0x5e')),'role':_0x9f5d('0x5f')},'attributes':['id',_0x9f5d('0x2e'),_0x9f5d('0x60'),_0x9f5d('0x61'),_0x9f5d('0x62')]});}})['then'](function(_0x27e16f){if(_0x27e16f){return{'count':_0x27e16f[_0x9f5d('0x23')],'rows':_[_0x9f5d('0x30')](_0x27e16f[_0x9f5d('0x47')],function(_0x15d597){return{'membername':_0x15d597['name'],'UserId':_0x15d597['id'],'queue_name':_0x17ed54[_0x9f5d('0x2e')],'WhatsappQueueId':_0x17ed54['id'],'interface':util[_0x9f5d('0x63')](_0x9f5d('0x64'),_0x9f5d('0x65'),_0x15d597[_0x9f5d('0x2e')]),'penalty':0x0,'paused':_0x15d597[_0x9f5d('0x60')],'createdAt':_0x15d597[_0x9f5d('0x62')],'updatedAt':_0x15d597['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x9f5d('0x29')](respondWithFilteredResult(_0x52f77e,_0xb0d1b0))[_0x9f5d('0x48')](handleError(_0x52f77e,null));};exports[_0x9f5d('0x66')]=function(_0x11deee,_0x5329e6,_0x2ea129){var _0x24bf2f={};var _0x5012e2={};var _0x16dddd;var _0x3210a5;return db[_0x9f5d('0x31')]['findOne']({'where':{'id':_0x11deee[_0x9f5d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5329e6,null))['then'](function(_0x302b88){if(_0x302b88){_0x16dddd=_0x302b88;_0x5012e2[_0x9f5d('0x34')]=_['keys'](db[_0x9f5d('0x67')][_0x9f5d('0x59')]);_0x5012e2[_0x9f5d('0x38')]=_['keys'](_0x11deee[_0x9f5d('0x38')]);_0x5012e2[_0x9f5d('0x36')]=_[_0x9f5d('0x37')](_0x5012e2[_0x9f5d('0x34')],_0x5012e2['query']);_0x24bf2f[_0x9f5d('0x39')]=_[_0x9f5d('0x37')](_0x5012e2[_0x9f5d('0x34')],qs[_0x9f5d('0x3a')](_0x11deee[_0x9f5d('0x38')][_0x9f5d('0x3a')]));_0x24bf2f['attributes']=_0x24bf2f[_0x9f5d('0x39')][_0x9f5d('0x4b')]?_0x24bf2f['attributes']:_0x5012e2[_0x9f5d('0x34')];_0x24bf2f[_0x9f5d('0x3d')]=qs['sort'](_0x11deee[_0x9f5d('0x38')][_0x9f5d('0x5a')]);_0x24bf2f[_0x9f5d('0x3e')]=qs[_0x9f5d('0x36')](_['pick'](_0x11deee['query'],_0x5012e2[_0x9f5d('0x36')]));if(_0x11deee['query'][_0x9f5d('0x40')]){_0x24bf2f['where']=_[_0x9f5d('0x41')](_0x24bf2f[_0x9f5d('0x3e')],{'$or':_[_0x9f5d('0x30')](_0x24bf2f[_0x9f5d('0x39')],function(_0x14377c){var _0x3f9696={};_0x3f9696[_0x14377c]={'$like':'%'+_0x11deee['query'][_0x9f5d('0x40')]+'%'};return _0x3f9696;})});}_0x24bf2f=_[_0x9f5d('0x41')]({},_0x24bf2f,_0x11deee[_0x9f5d('0x43')]);return _0x16dddd[_0x9f5d('0x66')](_0x24bf2f);}})['then'](function(_0x1323e0){if(_0x1323e0){_0x3210a5=_0x1323e0[_0x9f5d('0x4b')];if(!_0x11deee[_0x9f5d('0x38')][_0x9f5d('0x3b')](_0x9f5d('0x3c'))){_0x24bf2f[_0x9f5d('0x22')]=qs[_0x9f5d('0x22')](_0x11deee[_0x9f5d('0x38')][_0x9f5d('0x22')]);_0x24bf2f[_0x9f5d('0x20')]=qs[_0x9f5d('0x20')](_0x11deee['query']['offset']);}return _0x16dddd[_0x9f5d('0x66')](_0x24bf2f);}})['then'](function(_0x3b244f){if(_0x3b244f){return _0x3b244f?{'count':_0x3210a5,'rows':_0x3b244f}:null;}})[_0x9f5d('0x29')](respondWithResult(_0x5329e6,null))[_0x9f5d('0x48')](handleError(_0x5329e6,null));};exports['addTeams']=function(_0x334991,_0x533374,_0x52f3b7){var _0x4ada38=_0x334991[_0x9f5d('0x4e')][_0x9f5d('0x68')];return db[_0x9f5d('0x67')][_0x9f5d('0x46')]({'where':{'id':_0x4ada38},'attributes':['id'],'include':[{'model':db[_0x9f5d('0x5c')],'as':_0x9f5d('0x69'),'attributes':['id',_0x9f5d('0x2e'),_0x9f5d('0x6a'),'voicePause',_0x9f5d('0x6b')],'raw':!![]}]})[_0x9f5d('0x29')](function(_0x391816){if(_0x391816){var _0x522fbc=_[_0x9f5d('0x6c')](_0x391816,function(_0xbfa4eb){var _0x2b827e=_0xbfa4eb['get']({'plain':!![]});return _0x2b827e[_0x9f5d('0x69')];});return db[_0x9f5d('0x31')][_0x9f5d('0x4c')]({'where':{'id':_0x334991[_0x9f5d('0x4a')]['id']}})[_0x9f5d('0x29')](function(_0x165d85){return db[_0x9f5d('0x6d')][_0x9f5d('0x6e')](function(_0x444ea2){return _0x165d85['addTeams'](_0x4ada38,{'transaction':_0x444ea2})[_0x9f5d('0x29')](function(){return BPromise[_0x9f5d('0x6f')](_0x522fbc,function(_0x351488){return db[_0x9f5d('0x58')][_0x9f5d('0x70')]({'where':{'UserId':_0x351488['id'],'WhatsappQueueId':_0x334991[_0x9f5d('0x4a')]['id']},'transaction':_0x444ea2});});})[_0x9f5d('0x29')](function(){_0x522fbc[_0x9f5d('0x71')](function(_0x1cc047){socket[_0x9f5d('0x72')](_0x9f5d('0x73'),{'UserId':_0x1cc047['id'],'WhatsappQueueId':_0x165d85['id']});});});});});}})[_0x9f5d('0x29')](respondWithStatusCode(_0x533374,null))[_0x9f5d('0x48')](handleError(_0x533374,null));};exports[_0x9f5d('0x74')]=function(_0x47830e,_0x5d474f,_0x537cb7){return db['Team'][_0x9f5d('0x46')]({'where':{'id':_0x47830e[_0x9f5d('0x38')][_0x9f5d('0x68')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x5d474f,null))['then'](function(_0x452b79){var _0x32a29f=_[_0x9f5d('0x30')](_0x452b79,'id');var _0xc6f52=[];var _0x52a369=[];var _0x442d4c=squel[_0x9f5d('0x75')]();_0x442d4c[_0x9f5d('0x76')]('tq.TeamId')['from'](_0x9f5d('0x77'),'tq')[_0x9f5d('0x78')](_0x9f5d('0x79'),'ut',_0x9f5d('0x7a'))['where'](_0x9f5d('0x7b'),_0x47830e[_0x9f5d('0x4a')]['id']);for(var _0x1b725b=0x0;_0x1b725b<_0x452b79['length'];_0x1b725b+=0x1){let _0x552e21=_0x452b79[_0x1b725b];for(var _0x28d91c=0x0;_0x28d91c<_0x552e21[_0x9f5d('0x69')][_0x9f5d('0x4b')];_0x28d91c+=0x1){let _0x5b06c2=_0x552e21[_0x9f5d('0x69')][_0x28d91c];var _0x92cc93=_0x442d4c[_0x9f5d('0x7c')]();_0x92cc93[_0x9f5d('0x3e')](_0x9f5d('0x7d'),_0x5b06c2['id']);_0x52a369[_0x9f5d('0x7e')](db[_0x9f5d('0x6d')]['query'](_0x92cc93[_0x9f5d('0x7f')](),{'type':db[_0x9f5d('0x6d')][_0x9f5d('0x80')][_0x9f5d('0x81')]})['then'](function(_0x486026){if(_0x486026[_0x9f5d('0x4b')]===0x1){return _0x5b06c2['id'];}else{var _0x194e99=_[_0x9f5d('0x82')](_[_0x9f5d('0x30')](_0x486026,_0x9f5d('0x83')),function(_0x36082b){return _[_0x9f5d('0x84')](_0x32a29f,_0x36082b);});if(_0x194e99){return _0x5b06c2['id'];}}}));}}return BPromise[_0x9f5d('0x85')](_0x52a369)[_0x9f5d('0x29')](function(_0x3f3e43){_0xc6f52=_(_0xc6f52)[_0x9f5d('0x86')](_0x3f3e43)[_0x9f5d('0x87')]()[_0x9f5d('0x88')]();return db[_0x9f5d('0x31')][_0x9f5d('0x4c')]({'where':{'id':_0x47830e[_0x9f5d('0x4a')]['id']}})[_0x9f5d('0x29')](function(_0x158137){return db['sequelize'][_0x9f5d('0x6e')](function(_0x39c43c){return _0x158137[_0x9f5d('0x74')](_0x47830e[_0x9f5d('0x38')][_0x9f5d('0x68')],{'transaction':_0x39c43c})['then'](function(){if(!_[_0x9f5d('0x89')](_0xc6f52)){return _0x158137[_0x9f5d('0x8a')](_0xc6f52,{'transaction':_0x39c43c});}})[_0x9f5d('0x29')](function(){_0xc6f52[_0x9f5d('0x71')](function(_0x517c1f){socket['emit'](_0x9f5d('0x8b'),{'UserId':_0x517c1f,'WhatsappQueueId':_0x158137['id']});});});});});});})[_0x9f5d('0x29')](respondWithStatusCode(_0x5d474f,null))[_0x9f5d('0x48')](handleError(_0x5d474f,null));};exports[_0x9f5d('0x8c')]=function(_0x559250,_0x5ef745,_0x3cd236){return db[_0x9f5d('0x31')][_0x9f5d('0x4c')]({'where':{'id':_0x559250[_0x9f5d('0x4a')]['id']}})[_0x9f5d('0x29')](handleEntityNotFound(_0x5ef745,null))['then'](function(_0x5602db){if(_0x5602db){return _0x5602db[_0x9f5d('0x8c')](_0x559250[_0x9f5d('0x4e')][_0x9f5d('0x68')],_[_0x9f5d('0x8d')](_0x559250[_0x9f5d('0x4e')],[_0x9f5d('0x68'),'id'])||{})[_0x9f5d('0x8e')](function(_0x1ac566){for(var _0x32d066=0x0;_0x32d066<_0x559250[_0x9f5d('0x4e')][_0x9f5d('0x68')][_0x9f5d('0x4b')];_0x32d066+=0x1){socket[_0x9f5d('0x72')]('userWhatsappQueue:save',{'UserId':Number(_0x559250['body'][_0x9f5d('0x68')][_0x32d066]),'WhatsappQueueId':Number(_0x559250['params']['id'])});}return _0x1ac566;});}})[_0x9f5d('0x29')](respondWithResult(_0x5ef745,null))[_0x9f5d('0x48')](handleError(_0x5ef745,null));};exports[_0x9f5d('0x8a')]=function(_0x13646e,_0x2df806,_0x349343){return db[_0x9f5d('0x31')]['find']({'where':{'id':_0x13646e[_0x9f5d('0x4a')]['id']}})[_0x9f5d('0x29')](handleEntityNotFound(_0x2df806,null))['then'](function(_0x395b72){if(_0x395b72){return _0x395b72[_0x9f5d('0x8a')](_0x13646e[_0x9f5d('0x38')][_0x9f5d('0x68')])[_0x9f5d('0x29')](function(){if(_[_0x9f5d('0x8f')](_0x13646e[_0x9f5d('0x38')]['ids'])){for(var _0x51137e=0x0;_0x51137e<_0x13646e[_0x9f5d('0x38')][_0x9f5d('0x68')]['length'];_0x51137e+=0x1){socket['emit'](_0x9f5d('0x8b'),{'UserId':Number(_0x13646e[_0x9f5d('0x38')][_0x9f5d('0x68')][_0x51137e]),'WhatsappQueueId':Number(_0x13646e[_0x9f5d('0x4a')]['id'])});}}else{socket['emit'](_0x9f5d('0x8b'),{'UserId':Number(_0x13646e[_0x9f5d('0x38')][_0x9f5d('0x68')]),'WhatsappQueueId':Number(_0x13646e[_0x9f5d('0x4a')]['id'])});}});}})[_0x9f5d('0x29')](respondWithStatusCode(_0x2df806,null))[_0x9f5d('0x48')](handleError(_0x2df806,null));};exports[_0x9f5d('0x90')]=function(_0x2fdc7d,_0x58c099,_0x2a804b){var _0xd6a5fe={};var _0x3ffa14={};var _0x44a11f;var _0x2f5f4f;return db[_0x9f5d('0x31')][_0x9f5d('0x57')]({'where':{'id':_0x2fdc7d[_0x9f5d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x58c099,null))[_0x9f5d('0x29')](function(_0xe67a72){if(_0xe67a72){_0x44a11f=_0xe67a72;_0x3ffa14['model']=_[_0x9f5d('0x35')](db[_0x9f5d('0x5c')][_0x9f5d('0x59')]);_0x3ffa14[_0x9f5d('0x38')]=_['keys'](_0x2fdc7d['query']);_0x3ffa14[_0x9f5d('0x36')]=_[_0x9f5d('0x37')](_0x3ffa14[_0x9f5d('0x34')],_0x3ffa14[_0x9f5d('0x38')]);_0xd6a5fe['attributes']=_['intersection'](_0x3ffa14[_0x9f5d('0x34')],qs[_0x9f5d('0x3a')](_0x2fdc7d['query'][_0x9f5d('0x3a')]));_0xd6a5fe[_0x9f5d('0x39')]=_0xd6a5fe[_0x9f5d('0x39')][_0x9f5d('0x4b')]?_0xd6a5fe[_0x9f5d('0x39')]:_0x3ffa14['model'];_0xd6a5fe[_0x9f5d('0x3d')]=qs['sort'](_0x2fdc7d[_0x9f5d('0x38')][_0x9f5d('0x5a')]);_0xd6a5fe[_0x9f5d('0x3e')]=qs[_0x9f5d('0x36')](_[_0x9f5d('0x3f')](_0x2fdc7d[_0x9f5d('0x38')],_0x3ffa14['filters']));if(_0x2fdc7d['query'][_0x9f5d('0x40')]){_0xd6a5fe['where']=_[_0x9f5d('0x41')](_0xd6a5fe[_0x9f5d('0x3e')],{'$or':_[_0x9f5d('0x30')](_0xd6a5fe[_0x9f5d('0x39')],function(_0x5c2144){var _0xf53a54={};_0xf53a54[_0x5c2144]={'$like':'%'+_0x2fdc7d[_0x9f5d('0x38')][_0x9f5d('0x40')]+'%'};return _0xf53a54;})});}_0xd6a5fe=_[_0x9f5d('0x41')]({},_0xd6a5fe,_0x2fdc7d[_0x9f5d('0x43')]);return _0x44a11f[_0x9f5d('0x90')](_0xd6a5fe);}})[_0x9f5d('0x29')](function(_0xe2c6df){if(_0xe2c6df){_0x2f5f4f=_0xe2c6df[_0x9f5d('0x4b')];if(!_0x2fdc7d[_0x9f5d('0x38')]['hasOwnProperty'](_0x9f5d('0x3c'))){_0xd6a5fe[_0x9f5d('0x22')]=qs[_0x9f5d('0x22')](_0x2fdc7d[_0x9f5d('0x38')][_0x9f5d('0x22')]);_0xd6a5fe[_0x9f5d('0x20')]=qs['offset'](_0x2fdc7d[_0x9f5d('0x38')][_0x9f5d('0x20')]);}return _0x44a11f[_0x9f5d('0x90')](_0xd6a5fe);}})[_0x9f5d('0x29')](function(_0x199de4){if(_0x199de4){return _0x199de4?{'count':_0x2f5f4f,'rows':_0x199de4}:null;}})[_0x9f5d('0x29')](respondWithResult(_0x58c099,null))['catch'](handleError(_0x58c099,null));}; \ No newline at end of file +var _0x15dd=['QueryTypes','SELECT','every','includes','compact','value','removeAgents','addAgents','spread','isArray','userWhatsappQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','get','WhatsappQueues','UserProfileResource','error','stack','name','send','map','WhatsappQueue','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','include','findAll','rows','catch','show','params','keys','rawAttributes','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','WhatsappQueueId','UserWhatsappQueue','findAndCountAll','UserId','agent','updatedAt','format','%s/%s','SIP','createdAt','getTeams','Team','addTeams','ids','User','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','field','from','team_has_whatsapp_queues','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString'];(function(_0x375e6,_0x2648f7){var _0xa290d8=function(_0x1fe89e){while(--_0x1fe89e){_0x375e6['push'](_0x375e6['shift']());}};_0xa290d8(++_0x2648f7);}(_0x15dd,0x98));var _0xd15d=function(_0x3fa813,_0x295ac7){_0x3fa813=_0x3fa813-0x0;var _0x3cbab1=_0x15dd[_0x3fa813];return _0x3cbab1;};'use strict';var emlformat=require(_0xd15d('0x0'));var rimraf=require(_0xd15d('0x1'));var zipdir=require(_0xd15d('0x2'));var jsonpatch=require(_0xd15d('0x3'));var rp=require(_0xd15d('0x4'));var moment=require(_0xd15d('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd15d('0x6'));var path=require(_0xd15d('0x7'));var sox=require(_0xd15d('0x8'));var csv=require(_0xd15d('0x9'));var ejs=require(_0xd15d('0xa'));var fs=require('fs');var fs_extra=require(_0xd15d('0xb'));var _=require(_0xd15d('0xc'));var squel=require(_0xd15d('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd15d('0xe'));var toCsv=require(_0xd15d('0x9'));var querystring=require(_0xd15d('0xf'));var Papa=require(_0xd15d('0x10'));var Redis=require(_0xd15d('0x11'));var authService=require(_0xd15d('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd15d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd15d('0x14'));var utils=require(_0xd15d('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd15d('0x16'));var db=require('../../mysqldb')['db'];config[_0xd15d('0x17')]=_[_0xd15d('0x18')](config['redis'],{'host':_0xd15d('0x19'),'port':0x18eb});var socket=require(_0xd15d('0x1a'))(new Redis(config[_0xd15d('0x17')]));require(_0xd15d('0x1b'))['register'](socket);function respondWithStatusCode(_0xfd2257,_0x484c3a){_0x484c3a=_0x484c3a||0xcc;return function(_0x5eddc3){if(_0x5eddc3){return _0xfd2257[_0xd15d('0x1c')](_0x484c3a);}return _0xfd2257[_0xd15d('0x1d')](_0x484c3a)[_0xd15d('0x1e')]();};}function respondWithResult(_0x595a06,_0x567808){_0x567808=_0x567808||0xc8;return function(_0x546417){if(_0x546417){return _0x595a06[_0xd15d('0x1d')](_0x567808)['json'](_0x546417);}};}function respondWithFilteredResult(_0x6ec724,_0x1f5418){return function(_0x350297){if(_0x350297){var _0x1ad2a3=typeof _0x1f5418[_0xd15d('0x1f')]===_0xd15d('0x20')&&typeof _0x1f5418[_0xd15d('0x21')]===_0xd15d('0x20');var _0x2e92f0=_0x350297[_0xd15d('0x22')];var _0x4d73bb=_0x1ad2a3?0x0:_0x1f5418[_0xd15d('0x1f')];var _0x201c07=_0x1ad2a3?_0x350297[_0xd15d('0x22')]:_0x1f5418[_0xd15d('0x1f')]+_0x1f5418[_0xd15d('0x21')];var _0x12c57a;if(_0x201c07>=_0x2e92f0){_0x201c07=_0x2e92f0;_0x12c57a=0xc8;}else{_0x12c57a=0xce;}_0x6ec724[_0xd15d('0x1d')](_0x12c57a);return _0x6ec724[_0xd15d('0x23')](_0xd15d('0x24'),_0x4d73bb+'-'+_0x201c07+'/'+_0x2e92f0)[_0xd15d('0x25')](_0x350297);}return null;};}function patchUpdates(_0x364928){return function(_0x2e726f){try{jsonpatch[_0xd15d('0x26')](_0x2e726f,_0x364928,!![]);}catch(_0x373267){return BPromise['reject'](_0x373267);}return _0x2e726f[_0xd15d('0x27')]();};}function saveUpdates(_0x3f9569,_0x270eaf){return function(_0x269d57){if(_0x269d57){return _0x269d57[_0xd15d('0x28')](_0x3f9569)[_0xd15d('0x29')](function(_0x14ed64){return _0x14ed64;});}return null;};}function removeEntity(_0x96950f,_0x29bd2d){return function(_0x5f2b14){if(_0x5f2b14){return _0x5f2b14[_0xd15d('0x2a')]()[_0xd15d('0x29')](function(){var _0x5bfe6d=_0x5f2b14[_0xd15d('0x2b')]({'plain':!![]});var _0x3aab5b=_0xd15d('0x2c');return db[_0xd15d('0x2d')][_0xd15d('0x2a')]({'where':{'type':_0x3aab5b,'resourceId':_0x5bfe6d['id']}})[_0xd15d('0x29')](function(){return _0x5f2b14;});})['then'](function(){_0x96950f['status'](0xcc)[_0xd15d('0x1e')]();});}};}function handleEntityNotFound(_0x240b26,_0x3af15d){return function(_0x2946d7){if(!_0x2946d7){_0x240b26[_0xd15d('0x1c')](0x194);}return _0x2946d7;};}function handleError(_0x3cf177,_0x1b1f5f){_0x1b1f5f=_0x1b1f5f||0x1f4;return function(_0x4439fd){logger[_0xd15d('0x2e')](_0x4439fd[_0xd15d('0x2f')]);if(_0x4439fd[_0xd15d('0x30')]){delete _0x4439fd[_0xd15d('0x30')];}_0x3cf177[_0xd15d('0x1d')](_0x1b1f5f)[_0xd15d('0x31')](_0x4439fd);};}exports['index']=function(_0x44e6ce,_0x1ec7d1){var _0x5ce83d={},_0x5e535a={},_0x32740b={'count':0x0,'rows':[]};var _0x5315cb=_[_0xd15d('0x32')](db[_0xd15d('0x33')]['rawAttributes'],function(_0x1efccb){return{'name':_0x1efccb['fieldName'],'type':_0x1efccb[_0xd15d('0x34')][_0xd15d('0x35')]};});_0x5e535a[_0xd15d('0x36')]=_[_0xd15d('0x32')](_0x5315cb,_0xd15d('0x30'));_0x5e535a[_0xd15d('0x37')]=_['keys'](_0x44e6ce[_0xd15d('0x37')]);_0x5e535a[_0xd15d('0x38')]=_[_0xd15d('0x39')](_0x5e535a['model'],_0x5e535a[_0xd15d('0x37')]);_0x5ce83d[_0xd15d('0x3a')]=_[_0xd15d('0x39')](_0x5e535a[_0xd15d('0x36')],qs[_0xd15d('0x3b')](_0x44e6ce[_0xd15d('0x37')][_0xd15d('0x3b')]));_0x5ce83d['attributes']=_0x5ce83d[_0xd15d('0x3a')][_0xd15d('0x3c')]?_0x5ce83d[_0xd15d('0x3a')]:_0x5e535a[_0xd15d('0x36')];if(!_0x44e6ce[_0xd15d('0x37')][_0xd15d('0x3d')](_0xd15d('0x3e'))){_0x5ce83d[_0xd15d('0x21')]=qs[_0xd15d('0x21')](_0x44e6ce[_0xd15d('0x37')][_0xd15d('0x21')]);_0x5ce83d[_0xd15d('0x1f')]=qs[_0xd15d('0x1f')](_0x44e6ce[_0xd15d('0x37')][_0xd15d('0x1f')]);}_0x5ce83d[_0xd15d('0x3f')]=qs[_0xd15d('0x40')](_0x44e6ce['query']['sort']);_0x5ce83d[_0xd15d('0x41')]=qs[_0xd15d('0x38')](_[_0xd15d('0x42')](_0x44e6ce[_0xd15d('0x37')],_0x5e535a[_0xd15d('0x38')]),_0x5315cb);if(_0x44e6ce[_0xd15d('0x37')]['filter']){_0x5ce83d[_0xd15d('0x41')]=_[_0xd15d('0x43')](_0x5ce83d[_0xd15d('0x41')],{'$or':_[_0xd15d('0x32')](_0x5315cb,function(_0x4c63af){if(_0x4c63af[_0xd15d('0x34')]!=='VIRTUAL'){var _0x246326={};_0x246326[_0x4c63af[_0xd15d('0x30')]]={'$like':'%'+_0x44e6ce[_0xd15d('0x37')][_0xd15d('0x44')]+'%'};return _0x246326;}})});}_0x5ce83d=_[_0xd15d('0x43')]({},_0x5ce83d,_0x44e6ce['options']);var _0x2bf27b={'where':_0x5ce83d['where']};return db[_0xd15d('0x33')][_0xd15d('0x22')](_0x2bf27b)[_0xd15d('0x29')](function(_0x9cefb9){_0x32740b['count']=_0x9cefb9;if(_0x44e6ce[_0xd15d('0x37')]['includeAll']){_0x5ce83d[_0xd15d('0x45')]=[{'all':!![]}];}return db[_0xd15d('0x33')][_0xd15d('0x46')](_0x5ce83d);})[_0xd15d('0x29')](function(_0x984d2f){_0x32740b[_0xd15d('0x47')]=_0x984d2f;return _0x32740b;})[_0xd15d('0x29')](respondWithFilteredResult(_0x1ec7d1,_0x5ce83d))[_0xd15d('0x48')](handleError(_0x1ec7d1,null));};exports[_0xd15d('0x49')]=function(_0x4d20cc,_0x3a5da8){var _0x2bc403={'raw':!![],'where':{'id':_0x4d20cc[_0xd15d('0x4a')]['id']}},_0x2ccb6f={};_0x2ccb6f[_0xd15d('0x36')]=_[_0xd15d('0x4b')](db[_0xd15d('0x33')][_0xd15d('0x4c')]);_0x2ccb6f[_0xd15d('0x37')]=_[_0xd15d('0x4b')](_0x4d20cc[_0xd15d('0x37')]);_0x2ccb6f['filters']=_['intersection'](_0x2ccb6f[_0xd15d('0x36')],_0x2ccb6f[_0xd15d('0x37')]);_0x2bc403[_0xd15d('0x3a')]=_[_0xd15d('0x39')](_0x2ccb6f[_0xd15d('0x36')],qs[_0xd15d('0x3b')](_0x4d20cc[_0xd15d('0x37')][_0xd15d('0x3b')]));_0x2bc403[_0xd15d('0x3a')]=_0x2bc403[_0xd15d('0x3a')][_0xd15d('0x3c')]?_0x2bc403[_0xd15d('0x3a')]:_0x2ccb6f[_0xd15d('0x36')];if(_0x4d20cc[_0xd15d('0x37')][_0xd15d('0x4d')]){_0x2bc403[_0xd15d('0x45')]=[{'all':!![]}];}_0x2bc403=_[_0xd15d('0x43')]({},_0x2bc403,_0x4d20cc[_0xd15d('0x4e')]);return db[_0xd15d('0x33')][_0xd15d('0x4f')](_0x2bc403)['then'](handleEntityNotFound(_0x3a5da8,null))['then'](respondWithResult(_0x3a5da8,null))[_0xd15d('0x48')](handleError(_0x3a5da8,null));};exports['create']=function(_0x3a7043,_0x1ec9b1){return db['WhatsappQueue'][_0xd15d('0x50')](_0x3a7043[_0xd15d('0x51')],{})[_0xd15d('0x29')](function(_0x3078c2){var _0x209888=_0x3a7043[_0xd15d('0x52')][_0xd15d('0x2b')]({'plain':!![]});if(!_0x209888)throw new Error(_0xd15d('0x53'));if(_0x209888['role']===_0xd15d('0x52')){var _0x58bb1a=_0x3078c2[_0xd15d('0x2b')]({'plain':!![]});var _0x1315e1=_0xd15d('0x2c');return db[_0xd15d('0x54')][_0xd15d('0x4f')]({'where':{'name':_0x1315e1,'userProfileId':_0x209888[_0xd15d('0x55')]},'raw':!![]})['then'](function(_0x53d2bf){if(_0x53d2bf&&_0x53d2bf[_0xd15d('0x56')]===0x0){return db['UserProfileResource'][_0xd15d('0x50')]({'name':_0x58bb1a[_0xd15d('0x30')],'resourceId':_0x58bb1a['id'],'type':_0x53d2bf[_0xd15d('0x30')],'sectionId':_0x53d2bf['id']},{})['then'](function(){return _0x3078c2;});}else{return _0x3078c2;}})['catch'](function(_0x110fe4){logger[_0xd15d('0x2e')](_0xd15d('0x57'),_0x110fe4);throw _0x110fe4;});}return _0x3078c2;})[_0xd15d('0x29')](respondWithResult(_0x1ec9b1,0xc9))[_0xd15d('0x48')](handleError(_0x1ec9b1,null));};exports['update']=function(_0x75eb4e,_0x131f19){if(_0x75eb4e[_0xd15d('0x51')]['id']){delete _0x75eb4e[_0xd15d('0x51')]['id'];}return db[_0xd15d('0x33')]['find']({'where':{'id':_0x75eb4e['params']['id']}})['then'](handleEntityNotFound(_0x131f19,null))['then'](saveUpdates(_0x75eb4e[_0xd15d('0x51')],null))['then'](respondWithResult(_0x131f19,null))[_0xd15d('0x48')](handleError(_0x131f19,null));};exports[_0xd15d('0x2a')]=function(_0x569fba,_0x180505){return db[_0xd15d('0x33')][_0xd15d('0x4f')]({'where':{'id':_0x569fba[_0xd15d('0x4a')]['id']}})[_0xd15d('0x29')](handleEntityNotFound(_0x180505,null))['then'](removeEntity(_0x180505,null))[_0xd15d('0x48')](handleError(_0x180505,null));};exports[_0xd15d('0x58')]=function(_0x5c60ab,_0x343fa3){return db[_0xd15d('0x33')]['describe']()[_0xd15d('0x29')](respondWithResult(_0x343fa3,null))[_0xd15d('0x48')](handleError(_0x343fa3,null));};exports[_0xd15d('0x59')]=function(_0x5c3d5d,_0x446185,_0x5af4d3){var _0x2c988b={'raw':!![],'where':{}},_0x127638={},_0x33560f;return db[_0xd15d('0x33')][_0xd15d('0x5a')]({'where':{'id':_0x5c3d5d[_0xd15d('0x4a')]['id']}})[_0xd15d('0x29')](handleEntityNotFound(_0x446185,null))[_0xd15d('0x29')](function(_0x4dbb2d){if(_0x4dbb2d){_0x33560f=_0x4dbb2d[_0xd15d('0x2b')]({'plain':!![]});_0x127638[_0xd15d('0x36')]=_[_0xd15d('0x4b')](db['UserWhatsappQueue']['rawAttributes']);_0x127638['query']=_[_0xd15d('0x4b')](_0x5c3d5d[_0xd15d('0x37')]);_0x127638[_0xd15d('0x38')]=_[_0xd15d('0x39')](_0x127638[_0xd15d('0x36')],_0x127638[_0xd15d('0x37')]);_0x2c988b[_0xd15d('0x3a')]=_['intersection'](_0x127638[_0xd15d('0x36')],qs[_0xd15d('0x3b')](_0x5c3d5d['query'][_0xd15d('0x3b')]));_0x2c988b[_0xd15d('0x3a')]=_0x2c988b[_0xd15d('0x3a')][_0xd15d('0x3c')]?_0x2c988b[_0xd15d('0x3a')]:_0x127638[_0xd15d('0x36')];if(!_0x5c3d5d[_0xd15d('0x37')]['hasOwnProperty'](_0xd15d('0x3e'))){_0x2c988b[_0xd15d('0x21')]=qs[_0xd15d('0x21')](_0x5c3d5d['query'][_0xd15d('0x21')]);_0x2c988b[_0xd15d('0x1f')]=qs[_0xd15d('0x1f')](_0x5c3d5d[_0xd15d('0x37')]['offset']);}_0x2c988b['order']=qs[_0xd15d('0x40')](_0x5c3d5d[_0xd15d('0x37')][_0xd15d('0x40')]);_0x2c988b[_0xd15d('0x41')]=qs['filters'](_['pick'](_0x5c3d5d[_0xd15d('0x37')],_0x127638[_0xd15d('0x38')]));_0x2c988b['where'][_0xd15d('0x5b')]=_0x4dbb2d['id'];if(_0x5c3d5d['query'][_0xd15d('0x44')]){_0x2c988b[_0xd15d('0x41')]=_[_0xd15d('0x43')](_0x2c988b['where'],{'$or':_[_0xd15d('0x32')](_0x2c988b[_0xd15d('0x3a')],function(_0x4eb902){var _0x246010={};_0x246010[_0x4eb902]={'$like':'%'+_0x5c3d5d['query']['filter']+'%'};return _0x246010;})});}_0x2c988b=_[_0xd15d('0x43')]({},_0x2c988b,_0x5c3d5d[_0xd15d('0x4e')]);return db[_0xd15d('0x5c')][_0xd15d('0x46')](_0x2c988b);}})['then'](function(_0x1fd6a3){if(_0x1fd6a3){return db['User'][_0xd15d('0x5d')]({'where':{'id':_[_0xd15d('0x32')](_0x1fd6a3,_0xd15d('0x5e')),'role':_0xd15d('0x5f')},'attributes':['id',_0xd15d('0x30'),'whatsappPause',_0xd15d('0x60'),'createdAt']});}})[_0xd15d('0x29')](function(_0x5b7dd5){if(_0x5b7dd5){return{'count':_0x5b7dd5[_0xd15d('0x22')],'rows':_[_0xd15d('0x32')](_0x5b7dd5[_0xd15d('0x47')],function(_0x5b784a){return{'membername':_0x5b784a[_0xd15d('0x30')],'UserId':_0x5b784a['id'],'queue_name':_0x33560f[_0xd15d('0x30')],'WhatsappQueueId':_0x33560f['id'],'interface':util[_0xd15d('0x61')](_0xd15d('0x62'),_0xd15d('0x63'),_0x5b784a[_0xd15d('0x30')]),'penalty':0x0,'paused':_0x5b784a['whatsappPause'],'createdAt':_0x5b784a[_0xd15d('0x64')],'updatedAt':_0x5b784a[_0xd15d('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x446185,_0x2c988b))[_0xd15d('0x48')](handleError(_0x446185,null));};exports[_0xd15d('0x65')]=function(_0x4a7d51,_0x544330,_0x5c38be){var _0xed4a4b={};var _0x13ad88={};var _0x2e3d0a;var _0x3055c8;return db[_0xd15d('0x33')][_0xd15d('0x5a')]({'where':{'id':_0x4a7d51[_0xd15d('0x4a')]['id']}})[_0xd15d('0x29')](handleEntityNotFound(_0x544330,null))[_0xd15d('0x29')](function(_0x3fe27d){if(_0x3fe27d){_0x2e3d0a=_0x3fe27d;_0x13ad88[_0xd15d('0x36')]=_[_0xd15d('0x4b')](db[_0xd15d('0x66')]['rawAttributes']);_0x13ad88[_0xd15d('0x37')]=_['keys'](_0x4a7d51[_0xd15d('0x37')]);_0x13ad88[_0xd15d('0x38')]=_[_0xd15d('0x39')](_0x13ad88[_0xd15d('0x36')],_0x13ad88['query']);_0xed4a4b[_0xd15d('0x3a')]=_[_0xd15d('0x39')](_0x13ad88[_0xd15d('0x36')],qs['fields'](_0x4a7d51[_0xd15d('0x37')][_0xd15d('0x3b')]));_0xed4a4b['attributes']=_0xed4a4b[_0xd15d('0x3a')][_0xd15d('0x3c')]?_0xed4a4b[_0xd15d('0x3a')]:_0x13ad88[_0xd15d('0x36')];_0xed4a4b['order']=qs[_0xd15d('0x40')](_0x4a7d51['query'][_0xd15d('0x40')]);_0xed4a4b[_0xd15d('0x41')]=qs['filters'](_['pick'](_0x4a7d51[_0xd15d('0x37')],_0x13ad88['filters']));if(_0x4a7d51[_0xd15d('0x37')][_0xd15d('0x44')]){_0xed4a4b['where']=_[_0xd15d('0x43')](_0xed4a4b['where'],{'$or':_['map'](_0xed4a4b[_0xd15d('0x3a')],function(_0x1043c8){var _0x1d301b={};_0x1d301b[_0x1043c8]={'$like':'%'+_0x4a7d51['query'][_0xd15d('0x44')]+'%'};return _0x1d301b;})});}_0xed4a4b=_['merge']({},_0xed4a4b,_0x4a7d51[_0xd15d('0x4e')]);return _0x2e3d0a[_0xd15d('0x65')](_0xed4a4b);}})[_0xd15d('0x29')](function(_0x6d4b9c){if(_0x6d4b9c){_0x3055c8=_0x6d4b9c[_0xd15d('0x3c')];if(!_0x4a7d51[_0xd15d('0x37')][_0xd15d('0x3d')](_0xd15d('0x3e'))){_0xed4a4b[_0xd15d('0x21')]=qs['limit'](_0x4a7d51[_0xd15d('0x37')]['limit']);_0xed4a4b[_0xd15d('0x1f')]=qs[_0xd15d('0x1f')](_0x4a7d51[_0xd15d('0x37')]['offset']);}return _0x2e3d0a[_0xd15d('0x65')](_0xed4a4b);}})[_0xd15d('0x29')](function(_0x1bb39d){if(_0x1bb39d){return _0x1bb39d?{'count':_0x3055c8,'rows':_0x1bb39d}:null;}})['then'](respondWithResult(_0x544330,null))[_0xd15d('0x48')](handleError(_0x544330,null));};exports[_0xd15d('0x67')]=function(_0x4ccf15,_0x36f8fd,_0x5d5caf){var _0x2b4190=_0x4ccf15[_0xd15d('0x51')][_0xd15d('0x68')];return db[_0xd15d('0x66')][_0xd15d('0x46')]({'where':{'id':_0x2b4190},'attributes':['id'],'include':[{'model':db[_0xd15d('0x69')],'as':_0xd15d('0x6a'),'attributes':['id','name',_0xd15d('0x6b'),_0xd15d('0x6c'),_0xd15d('0x6d')],'raw':!![]}]})[_0xd15d('0x29')](function(_0x6b9070){if(_0x6b9070){var _0x44fc47=_[_0xd15d('0x6e')](_0x6b9070,function(_0x563e3f){var _0x3762f3=_0x563e3f[_0xd15d('0x2b')]({'plain':!![]});return _0x3762f3[_0xd15d('0x6a')];});return db['WhatsappQueue'][_0xd15d('0x4f')]({'where':{'id':_0x4ccf15[_0xd15d('0x4a')]['id']}})[_0xd15d('0x29')](function(_0x1f19fe){return db[_0xd15d('0x6f')][_0xd15d('0x70')](function(_0x266a8e){return _0x1f19fe[_0xd15d('0x67')](_0x2b4190,{'transaction':_0x266a8e})[_0xd15d('0x29')](function(){return BPromise[_0xd15d('0x71')](_0x44fc47,function(_0x5c755c){return db[_0xd15d('0x5c')][_0xd15d('0x72')]({'where':{'UserId':_0x5c755c['id'],'WhatsappQueueId':_0x4ccf15[_0xd15d('0x4a')]['id']},'transaction':_0x266a8e});});})['then'](function(){_0x44fc47[_0xd15d('0x73')](function(_0x38de6e){socket[_0xd15d('0x74')](_0xd15d('0x75'),{'UserId':_0x38de6e['id'],'WhatsappQueueId':_0x1f19fe['id']});});});});});}})[_0xd15d('0x29')](respondWithStatusCode(_0x36f8fd,null))[_0xd15d('0x48')](handleError(_0x36f8fd,null));};exports[_0xd15d('0x76')]=function(_0x550f3d,_0x49ea3a,_0x2ef85e){return db['Team'][_0xd15d('0x46')]({'where':{'id':_0x550f3d[_0xd15d('0x37')][_0xd15d('0x68')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xd15d('0x29')](handleEntityNotFound(_0x49ea3a,null))[_0xd15d('0x29')](function(_0x36c461){var _0x1f0b7c=_['map'](_0x36c461,'id');var _0x130c05=[];var _0x53a7b4=[];var _0x57b337=squel['select']();_0x57b337[_0xd15d('0x77')]('tq.TeamId')[_0xd15d('0x78')](_0xd15d('0x79'),'tq')['join']('user_has_teams','ut',_0xd15d('0x7a'))['where'](_0xd15d('0x7b'),_0x550f3d[_0xd15d('0x4a')]['id']);for(var _0x47128e=0x0;_0x47128e<_0x36c461[_0xd15d('0x3c')];_0x47128e+=0x1){let _0x4e1942=_0x36c461[_0x47128e];for(var _0x2ff6b1=0x0;_0x2ff6b1<_0x4e1942[_0xd15d('0x6a')][_0xd15d('0x3c')];_0x2ff6b1+=0x1){let _0x209b29=_0x4e1942['Agents'][_0x2ff6b1];var _0x591c54=_0x57b337[_0xd15d('0x7c')]();_0x591c54[_0xd15d('0x41')](_0xd15d('0x7d'),_0x209b29['id']);_0x53a7b4[_0xd15d('0x7e')](db[_0xd15d('0x6f')][_0xd15d('0x37')](_0x591c54[_0xd15d('0x7f')](),{'type':db[_0xd15d('0x6f')][_0xd15d('0x80')][_0xd15d('0x81')]})[_0xd15d('0x29')](function(_0x4b2291){if(_0x4b2291[_0xd15d('0x3c')]===0x1){return _0x209b29['id'];}else{var _0x53cad3=_[_0xd15d('0x82')](_[_0xd15d('0x32')](_0x4b2291,'TeamId'),function(_0x4dfa4b){return _[_0xd15d('0x83')](_0x1f0b7c,_0x4dfa4b);});if(_0x53cad3){return _0x209b29['id'];}}}));}}return BPromise['all'](_0x53a7b4)[_0xd15d('0x29')](function(_0x24b545){_0x130c05=_(_0x130c05)['union'](_0x24b545)[_0xd15d('0x84')]()[_0xd15d('0x85')]();return db[_0xd15d('0x33')][_0xd15d('0x4f')]({'where':{'id':_0x550f3d[_0xd15d('0x4a')]['id']}})[_0xd15d('0x29')](function(_0x5d4648){return db[_0xd15d('0x6f')]['transaction'](function(_0x5d0442){return _0x5d4648[_0xd15d('0x76')](_0x550f3d[_0xd15d('0x37')][_0xd15d('0x68')],{'transaction':_0x5d0442})[_0xd15d('0x29')](function(){if(!_['isEmpty'](_0x130c05)){return _0x5d4648[_0xd15d('0x86')](_0x130c05,{'transaction':_0x5d0442});}})[_0xd15d('0x29')](function(){_0x130c05[_0xd15d('0x73')](function(_0x54ade9){socket[_0xd15d('0x74')]('userWhatsappQueue:remove',{'UserId':_0x54ade9,'WhatsappQueueId':_0x5d4648['id']});});});});});});})[_0xd15d('0x29')](respondWithStatusCode(_0x49ea3a,null))[_0xd15d('0x48')](handleError(_0x49ea3a,null));};exports[_0xd15d('0x87')]=function(_0x2f2a0b,_0x1708b4,_0x5dbfb9){return db[_0xd15d('0x33')][_0xd15d('0x4f')]({'where':{'id':_0x2f2a0b[_0xd15d('0x4a')]['id']}})[_0xd15d('0x29')](handleEntityNotFound(_0x1708b4,null))['then'](function(_0x5d33e1){if(_0x5d33e1){return _0x5d33e1[_0xd15d('0x87')](_0x2f2a0b[_0xd15d('0x51')][_0xd15d('0x68')],_['omit'](_0x2f2a0b[_0xd15d('0x51')],[_0xd15d('0x68'),'id'])||{})[_0xd15d('0x88')](function(_0x3636e0){for(var _0x563d0b=0x0;_0x563d0b<_0x2f2a0b[_0xd15d('0x51')][_0xd15d('0x68')][_0xd15d('0x3c')];_0x563d0b+=0x1){socket['emit'](_0xd15d('0x75'),{'UserId':Number(_0x2f2a0b[_0xd15d('0x51')]['ids'][_0x563d0b]),'WhatsappQueueId':Number(_0x2f2a0b['params']['id'])});}return _0x3636e0;});}})[_0xd15d('0x29')](respondWithResult(_0x1708b4,null))[_0xd15d('0x48')](handleError(_0x1708b4,null));};exports[_0xd15d('0x86')]=function(_0x42214e,_0x5e272d,_0x5cd50b){return db[_0xd15d('0x33')][_0xd15d('0x4f')]({'where':{'id':_0x42214e[_0xd15d('0x4a')]['id']}})[_0xd15d('0x29')](handleEntityNotFound(_0x5e272d,null))[_0xd15d('0x29')](function(_0x4c0ab5){if(_0x4c0ab5){return _0x4c0ab5[_0xd15d('0x86')](_0x42214e[_0xd15d('0x37')]['ids'])[_0xd15d('0x29')](function(){if(_[_0xd15d('0x89')](_0x42214e[_0xd15d('0x37')]['ids'])){for(var _0x1c886e=0x0;_0x1c886e<_0x42214e[_0xd15d('0x37')][_0xd15d('0x68')][_0xd15d('0x3c')];_0x1c886e+=0x1){socket['emit'](_0xd15d('0x8a'),{'UserId':Number(_0x42214e['query']['ids'][_0x1c886e]),'WhatsappQueueId':Number(_0x42214e[_0xd15d('0x4a')]['id'])});}}else{socket[_0xd15d('0x74')](_0xd15d('0x8a'),{'UserId':Number(_0x42214e['query'][_0xd15d('0x68')]),'WhatsappQueueId':Number(_0x42214e[_0xd15d('0x4a')]['id'])});}});}})[_0xd15d('0x29')](respondWithStatusCode(_0x5e272d,null))[_0xd15d('0x48')](handleError(_0x5e272d,null));};exports[_0xd15d('0x8b')]=function(_0x2b4a6a,_0x5d7b3f,_0x300734){var _0x53fb41={};var _0x3bba82={};var _0x310a5a;var _0x5b924c;return db[_0xd15d('0x33')][_0xd15d('0x5a')]({'where':{'id':_0x2b4a6a['params']['id']}})[_0xd15d('0x29')](handleEntityNotFound(_0x5d7b3f,null))[_0xd15d('0x29')](function(_0x55a1b3){if(_0x55a1b3){_0x310a5a=_0x55a1b3;_0x3bba82[_0xd15d('0x36')]=_[_0xd15d('0x4b')](db['User']['rawAttributes']);_0x3bba82['query']=_[_0xd15d('0x4b')](_0x2b4a6a[_0xd15d('0x37')]);_0x3bba82[_0xd15d('0x38')]=_[_0xd15d('0x39')](_0x3bba82[_0xd15d('0x36')],_0x3bba82['query']);_0x53fb41['attributes']=_['intersection'](_0x3bba82['model'],qs[_0xd15d('0x3b')](_0x2b4a6a[_0xd15d('0x37')]['fields']));_0x53fb41['attributes']=_0x53fb41[_0xd15d('0x3a')]['length']?_0x53fb41[_0xd15d('0x3a')]:_0x3bba82[_0xd15d('0x36')];_0x53fb41[_0xd15d('0x3f')]=qs[_0xd15d('0x40')](_0x2b4a6a[_0xd15d('0x37')][_0xd15d('0x40')]);_0x53fb41[_0xd15d('0x41')]=qs['filters'](_[_0xd15d('0x42')](_0x2b4a6a[_0xd15d('0x37')],_0x3bba82[_0xd15d('0x38')]));if(_0x2b4a6a[_0xd15d('0x37')]['filter']){_0x53fb41['where']=_['merge'](_0x53fb41[_0xd15d('0x41')],{'$or':_[_0xd15d('0x32')](_0x53fb41[_0xd15d('0x3a')],function(_0xa6d4f0){var _0xc5239e={};_0xc5239e[_0xa6d4f0]={'$like':'%'+_0x2b4a6a[_0xd15d('0x37')][_0xd15d('0x44')]+'%'};return _0xc5239e;})});}_0x53fb41=_[_0xd15d('0x43')]({},_0x53fb41,_0x2b4a6a[_0xd15d('0x4e')]);return _0x310a5a['getAgents'](_0x53fb41);}})[_0xd15d('0x29')](function(_0x1eb871){if(_0x1eb871){_0x5b924c=_0x1eb871[_0xd15d('0x3c')];if(!_0x2b4a6a[_0xd15d('0x37')][_0xd15d('0x3d')](_0xd15d('0x3e'))){_0x53fb41['limit']=qs[_0xd15d('0x21')](_0x2b4a6a['query'][_0xd15d('0x21')]);_0x53fb41[_0xd15d('0x1f')]=qs[_0xd15d('0x1f')](_0x2b4a6a[_0xd15d('0x37')][_0xd15d('0x1f')]);}return _0x310a5a[_0xd15d('0x8b')](_0x53fb41);}})['then'](function(_0x519bca){if(_0x519bca){return _0x519bca?{'count':_0x5b924c,'rows':_0x519bca}:null;}})[_0xd15d('0x29')](respondWithResult(_0x5d7b3f,null))[_0xd15d('0x48')](handleError(_0x5d7b3f,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index a0a4fbf..bd49c95 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 _0xb3c6=['WhatsappQueue','setMaxListeners','save','remove','emit','hook','../../mysqldb'];(function(_0x5cf3d0,_0x2ba0ad){var _0x65a75b=function(_0x4d6ca7){while(--_0x4d6ca7){_0x5cf3d0['push'](_0x5cf3d0['shift']());}};_0x65a75b(++_0x2ba0ad);}(_0xb3c6,0xdf));var _0x6b3c=function(_0x3e7b59,_0x14a4cd){_0x3e7b59=_0x3e7b59-0x0;var _0x4bd64a=_0xb3c6[_0x3e7b59];return _0x4bd64a;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0x6b3c('0x0'))['db'][_0x6b3c('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x6b3c('0x2')](0x0);var events={'afterCreate':_0x6b3c('0x3'),'afterUpdate':'update','afterDestroy':_0x6b3c('0x4')};function emitEvent(_0x1da936){return function(_0x52e44d,_0x2868e5,_0x1dc0cc){WhatsappQueueEvents[_0x6b3c('0x5')](_0x1da936+':'+_0x52e44d['id'],_0x52e44d);WhatsappQueueEvents[_0x6b3c('0x5')](_0x1da936,_0x52e44d);_0x1dc0cc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0x6b3c('0x6')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file +var _0x416f=['exports','events','../../mysqldb','WhatsappQueue','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0x416f,0xb5));var _0xf416=function(_0x21f11b,_0x10f3e6){_0x21f11b=_0x21f11b-0x0;var _0x86eb4a=_0x416f[_0x21f11b];return _0x86eb4a;};'use strict';var EventEmitter=require(_0xf416('0x0'));var WhatsappQueue=require(_0xf416('0x1'))['db'][_0xf416('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf416('0x3'),'afterUpdate':_0xf416('0x4'),'afterDestroy':_0xf416('0x5')};function emitEvent(_0x3855d6){return function(_0x5aa943,_0xb58178,_0x32aa53){WhatsappQueueEvents[_0xf416('0x6')](_0x3855d6+':'+_0x5aa943['id'],_0x5aa943);WhatsappQueueEvents[_0xf416('0x6')](_0x3855d6,_0x5aa943);_0x32aa53(null);};}for(var e in events){if(events[_0xf416('0x7')](e)){var event=events[e];WhatsappQueue[_0xf416('0x8')](e,emitEvent(event));}}module[_0xf416('0x9')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 2a26ad0..6f0440a 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 _0x02f8=['exports','define','WhatsappQueue','whatsapp_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./whatsappQueue.attributes'];(function(_0x5933f9,_0x419885){var _0x3b8d39=function(_0x308de1){while(--_0x308de1){_0x5933f9['push'](_0x5933f9['shift']());}};_0x3b8d39(++_0x419885);}(_0x02f8,0x1b6));var _0x802f=function(_0x24507a,_0x58e59b){_0x24507a=_0x24507a-0x0;var _0x20ed6a=_0x02f8[_0x24507a];return _0x20ed6a;};'use strict';var _=require(_0x802f('0x0'));var util=require(_0x802f('0x1'));var logger=require(_0x802f('0x2'))(_0x802f('0x3'));var moment=require(_0x802f('0x4'));var BPromise=require(_0x802f('0x5'));var rp=require(_0x802f('0x6'));var fs=require('fs');var path=require(_0x802f('0x7'));var rimraf=require(_0x802f('0x8'));var config=require('../../config/environment');var attributes=require(_0x802f('0x9'));module[_0x802f('0xa')]=function(_0x3bd2d0,_0x394a43){return _0x3bd2d0[_0x802f('0xb')](_0x802f('0xc'),attributes,{'tableName':_0x802f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x992c=['moment','bluebird','request-promise','rimraf','../../config/environment','./whatsappQueue.attributes','WhatsappQueue','whatsapp_queues','util','../../config/logger'];(function(_0x4e4f02,_0x10b33e){var _0x34eb13=function(_0x4ce3db){while(--_0x4ce3db){_0x4e4f02['push'](_0x4e4f02['shift']());}};_0x34eb13(++_0x10b33e);}(_0x992c,0xbc));var _0xc992=function(_0x5abdfd,_0x1aa77d){_0x5abdfd=_0x5abdfd-0x0;var _0x39a6ab=_0x992c[_0x5abdfd];return _0x39a6ab;};'use strict';var _=require('lodash');var util=require(_0xc992('0x0'));var logger=require(_0xc992('0x1'))('api');var moment=require(_0xc992('0x2'));var BPromise=require(_0xc992('0x3'));var rp=require(_0xc992('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc992('0x5'));var config=require(_0xc992('0x6'));var attributes=require(_0xc992('0x7'));module['exports']=function(_0x1e8c5d,_0xd52f5f){return _0x1e8c5d['define'](_0xc992('0x8'),attributes,{'tableName':_0xc992('0x9'),'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 e97ea76..fc748e3 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 _0xc878=['info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','error','message','result','catch','GetWhatsappQueue','findAll','options','raw','where','limit','map','include','model','attributes','then','debug','stringify','WhatsappQueue','ShowWhatsappQueue','lodash','util','moment','bluebird','../../config/utils','../../config/logger','jayson/promise','client','http','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','request'];(function(_0x49e444,_0x1afd8f){var _0x3d578e=function(_0x204e74){while(--_0x204e74){_0x49e444['push'](_0x49e444['shift']());}};_0x3d578e(++_0x1afd8f);}(_0xc878,0x188));var _0x8c87=function(_0x1bd323,_0x1c16ab){_0x1bd323=_0x1bd323-0x0;var _0x13097b=_0xc878[_0x1bd323];return _0x13097b;};'use strict';var _=require(_0x8c87('0x0'));var util=require(_0x8c87('0x1'));var moment=require(_0x8c87('0x2'));var BPromise=require(_0x8c87('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8c87('0x4'));var logger=require(_0x8c87('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8c87('0x6'));var client=jayson[_0x8c87('0x7')][_0x8c87('0x8')]({'port':0x232a});config[_0x8c87('0x9')]=_['defaults'](config[_0x8c87('0x9')],{'host':_0x8c87('0xa'),'port':0x18eb});var socket=require(_0x8c87('0xb'))(new Redis(config['redis']));require(_0x8c87('0xc'))[_0x8c87('0xd')](socket);function respondWithRpcPromise(_0x14602d,_0x3b292c,_0xbf2e8c){return new BPromise(function(_0x5cabac,_0x199e93){return client[_0x8c87('0xe')](_0x14602d,_0xbf2e8c)['then'](function(_0x156c6c){logger[_0x8c87('0xf')](_0x8c87('0x10'),_0x3b292c,'request\x20sent');logger['debug']('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x3b292c,_0x8c87('0x11'),JSON['stringify'](_0x156c6c));if(_0x156c6c[_0x8c87('0x12')]){if(_0x156c6c[_0x8c87('0x12')]['code']===0x1f4){logger['error'](_0x8c87('0x10'),_0x3b292c,_0x156c6c[_0x8c87('0x12')]['message']);return _0x199e93(_0x156c6c['error'][_0x8c87('0x13')]);}logger[_0x8c87('0x12')](_0x8c87('0x10'),_0x3b292c,_0x156c6c[_0x8c87('0x12')][_0x8c87('0x13')]);return _0x5cabac(_0x156c6c[_0x8c87('0x12')][_0x8c87('0x13')]);}else{logger[_0x8c87('0xf')]('WhatsappQueue,\x20%s,\x20%s',_0x3b292c,'request\x20sent');_0x5cabac(_0x156c6c[_0x8c87('0x14')][_0x8c87('0x13')]);}})[_0x8c87('0x15')](function(_0x2a75d0){logger[_0x8c87('0x12')](_0x8c87('0x10'),_0x3b292c,_0x2a75d0);_0x199e93(_0x2a75d0);});});}exports[_0x8c87('0x16')]=function(_0x298a14){var _0x142506=this;return new Promise(function(_0x3bef57,_0x30332b){return db['WhatsappQueue'][_0x8c87('0x17')]({'raw':_0x298a14[_0x8c87('0x18')]?_0x298a14['options'][_0x8c87('0x19')]===undefined?!![]:![]:!![],'where':_0x298a14['options']?_0x298a14[_0x8c87('0x18')][_0x8c87('0x1a')]||null:null,'attributes':_0x298a14[_0x8c87('0x18')]?_0x298a14[_0x8c87('0x18')]['attributes']||null:null,'limit':_0x298a14[_0x8c87('0x18')]?_0x298a14[_0x8c87('0x18')][_0x8c87('0x1b')]||null:null,'include':_0x298a14[_0x8c87('0x18')]?_0x298a14[_0x8c87('0x18')]['include']?_[_0x8c87('0x1c')](_0x298a14[_0x8c87('0x18')][_0x8c87('0x1d')],function(_0x28c8f7){return{'model':db[_0x28c8f7[_0x8c87('0x1e')]],'as':_0x28c8f7['as'],'attributes':_0x28c8f7[_0x8c87('0x1f')],'include':_0x28c8f7[_0x8c87('0x1d')]?_[_0x8c87('0x1c')](_0x28c8f7[_0x8c87('0x1d')],function(_0x23caf0){return{'model':db[_0x23caf0[_0x8c87('0x1e')]],'as':_0x23caf0['as'],'attributes':_0x23caf0[_0x8c87('0x1f')],'include':_0x23caf0[_0x8c87('0x1d')]?_[_0x8c87('0x1c')](_0x23caf0['include'],function(_0x3481ea){return{'model':db[_0x3481ea[_0x8c87('0x1e')]],'as':_0x3481ea['as'],'attributes':_0x3481ea[_0x8c87('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x8c87('0x20')](function(_0x133bef){logger[_0x8c87('0xf')](_0x8c87('0x16'),_0x298a14);logger[_0x8c87('0x21')](_0x8c87('0x16'),_0x298a14,JSON[_0x8c87('0x22')](_0x133bef));_0x3bef57(_0x133bef);})[_0x8c87('0x15')](function(_0x2334fb){logger[_0x8c87('0x12')](_0x8c87('0x16'),_0x2334fb['message'],_0x298a14);_0x30332b(_0x142506[_0x8c87('0x12')](0x1f4,_0x2334fb[_0x8c87('0x13')]));});});};exports['ShowWhatsappQueue']=function(_0x6e2ad8){var _0x4babf4=this;return new Promise(function(_0x22a047,_0xf1f781){return db[_0x8c87('0x23')]['find']({'raw':_0x6e2ad8[_0x8c87('0x18')]?_0x6e2ad8[_0x8c87('0x18')][_0x8c87('0x19')]===undefined?!![]:![]:!![],'where':_0x6e2ad8[_0x8c87('0x18')]?_0x6e2ad8[_0x8c87('0x18')][_0x8c87('0x1a')]||null:null,'attributes':_0x6e2ad8[_0x8c87('0x18')]?_0x6e2ad8[_0x8c87('0x18')]['attributes']||null:null,'include':_0x6e2ad8[_0x8c87('0x18')]?_0x6e2ad8[_0x8c87('0x18')][_0x8c87('0x1d')]?_[_0x8c87('0x1c')](_0x6e2ad8[_0x8c87('0x18')]['include'],function(_0x4f8d73){return{'model':db[_0x4f8d73[_0x8c87('0x1e')]],'as':_0x4f8d73['as'],'attributes':_0x4f8d73[_0x8c87('0x1f')],'include':_0x4f8d73['include']?_[_0x8c87('0x1c')](_0x4f8d73[_0x8c87('0x1d')],function(_0xaa06e){return{'model':db[_0xaa06e[_0x8c87('0x1e')]],'as':_0xaa06e['as'],'attributes':_0xaa06e['attributes'],'include':_0xaa06e[_0x8c87('0x1d')]?_[_0x8c87('0x1c')](_0xaa06e[_0x8c87('0x1d')],function(_0x5f25e1){return{'model':db[_0x5f25e1[_0x8c87('0x1e')]],'as':_0x5f25e1['as'],'attributes':_0x5f25e1['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x500613){logger[_0x8c87('0xf')]('ShowWhatsappQueue',_0x6e2ad8);logger[_0x8c87('0x21')]('ShowWhatsappQueue',_0x6e2ad8,JSON[_0x8c87('0x22')](_0x500613));_0x22a047(_0x500613);})['catch'](function(_0x53fa40){logger[_0x8c87('0x12')](_0x8c87('0x24'),_0x53fa40[_0x8c87('0x13')],_0x6e2ad8);_0xf1f781(_0x4babf4['error'](0x1f4,_0x53fa40[_0x8c87('0x13')]));});});}; \ No newline at end of file +var _0xc704=['jayson/promise','client','http','redis','localhost','socket.io-emitter','request','info','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','WhatsappQueue,\x20%s,\x20%s','result','catch','WhatsappQueue','findAll','options','where','attributes','limit','include','map','model','then','GetWhatsappQueue','find','ShowWhatsappQueue','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment'];(function(_0x193fae,_0x41ab89){var _0x4bbeea=function(_0x4487f1){while(--_0x4487f1){_0x193fae['push'](_0x193fae['shift']());}};_0x4bbeea(++_0x41ab89);}(_0xc704,0x1c1));var _0x4c70=function(_0x260217,_0x5bd57b){_0x260217=_0x260217-0x0;var _0x281bf4=_0xc704[_0x260217];return _0x281bf4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4c70('0x0'));var BPromise=require(_0x4c70('0x1'));var rs=require(_0x4c70('0x2'));var fs=require('fs');var Redis=require(_0x4c70('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4c70('0x4'))(_0x4c70('0x5'));var config=require(_0x4c70('0x6'));var jayson=require(_0x4c70('0x7'));var client=jayson[_0x4c70('0x8')][_0x4c70('0x9')]({'port':0x232a});config[_0x4c70('0xa')]=_['defaults'](config['redis'],{'host':_0x4c70('0xb'),'port':0x18eb});var socket=require(_0x4c70('0xc'))(new Redis(config[_0x4c70('0xa')]));require('./whatsappQueue.socket')['register'](socket);function respondWithRpcPromise(_0x896915,_0x242007,_0x5c1013){return new BPromise(function(_0xdd38a6,_0x4730b3){return client[_0x4c70('0xd')](_0x896915,_0x5c1013)['then'](function(_0x3343e5){logger[_0x4c70('0xe')]('WhatsappQueue,\x20%s,\x20%s',_0x242007,_0x4c70('0xf'));logger[_0x4c70('0x10')](_0x4c70('0x11'),_0x242007,'request\x20sent',JSON[_0x4c70('0x12')](_0x3343e5));if(_0x3343e5['error']){if(_0x3343e5['error'][_0x4c70('0x13')]===0x1f4){logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x242007,_0x3343e5[_0x4c70('0x14')][_0x4c70('0x15')]);return _0x4730b3(_0x3343e5['error'][_0x4c70('0x15')]);}logger[_0x4c70('0x14')](_0x4c70('0x16'),_0x242007,_0x3343e5[_0x4c70('0x14')]['message']);return _0xdd38a6(_0x3343e5[_0x4c70('0x14')][_0x4c70('0x15')]);}else{logger[_0x4c70('0xe')]('WhatsappQueue,\x20%s,\x20%s',_0x242007,_0x4c70('0xf'));_0xdd38a6(_0x3343e5[_0x4c70('0x17')][_0x4c70('0x15')]);}})[_0x4c70('0x18')](function(_0x26fa4d){logger['error'](_0x4c70('0x16'),_0x242007,_0x26fa4d);_0x4730b3(_0x26fa4d);});});}exports['GetWhatsappQueue']=function(_0xa52391){var _0x16158d=this;return new Promise(function(_0x51c9be,_0x12af3f){return db[_0x4c70('0x19')][_0x4c70('0x1a')]({'raw':_0xa52391[_0x4c70('0x1b')]?_0xa52391['options']['raw']===undefined?!![]:![]:!![],'where':_0xa52391[_0x4c70('0x1b')]?_0xa52391[_0x4c70('0x1b')][_0x4c70('0x1c')]||null:null,'attributes':_0xa52391[_0x4c70('0x1b')]?_0xa52391[_0x4c70('0x1b')][_0x4c70('0x1d')]||null:null,'limit':_0xa52391[_0x4c70('0x1b')]?_0xa52391['options'][_0x4c70('0x1e')]||null:null,'include':_0xa52391['options']?_0xa52391[_0x4c70('0x1b')][_0x4c70('0x1f')]?_['map'](_0xa52391[_0x4c70('0x1b')]['include'],function(_0x48a437){return{'model':db[_0x48a437['model']],'as':_0x48a437['as'],'attributes':_0x48a437[_0x4c70('0x1d')],'include':_0x48a437[_0x4c70('0x1f')]?_[_0x4c70('0x20')](_0x48a437['include'],function(_0x165213){return{'model':db[_0x165213[_0x4c70('0x21')]],'as':_0x165213['as'],'attributes':_0x165213[_0x4c70('0x1d')],'include':_0x165213[_0x4c70('0x1f')]?_[_0x4c70('0x20')](_0x165213[_0x4c70('0x1f')],function(_0x54157d){return{'model':db[_0x54157d[_0x4c70('0x21')]],'as':_0x54157d['as'],'attributes':_0x54157d['attributes']};}):[]};}):[]};}):[]:[]})[_0x4c70('0x22')](function(_0x1f8ba7){logger[_0x4c70('0xe')](_0x4c70('0x23'),_0xa52391);logger[_0x4c70('0x10')](_0x4c70('0x23'),_0xa52391,JSON['stringify'](_0x1f8ba7));_0x51c9be(_0x1f8ba7);})[_0x4c70('0x18')](function(_0x554985){logger[_0x4c70('0x14')](_0x4c70('0x23'),_0x554985[_0x4c70('0x15')],_0xa52391);_0x12af3f(_0x16158d['error'](0x1f4,_0x554985['message']));});});};exports['ShowWhatsappQueue']=function(_0x38600d){var _0x3acb40=this;return new Promise(function(_0x2ed19f,_0x8b9b4f){return db[_0x4c70('0x19')][_0x4c70('0x24')]({'raw':_0x38600d['options']?_0x38600d['options']['raw']===undefined?!![]:![]:!![],'where':_0x38600d[_0x4c70('0x1b')]?_0x38600d[_0x4c70('0x1b')]['where']||null:null,'attributes':_0x38600d[_0x4c70('0x1b')]?_0x38600d[_0x4c70('0x1b')][_0x4c70('0x1d')]||null:null,'include':_0x38600d[_0x4c70('0x1b')]?_0x38600d[_0x4c70('0x1b')]['include']?_[_0x4c70('0x20')](_0x38600d[_0x4c70('0x1b')]['include'],function(_0x1dbb84){return{'model':db[_0x1dbb84[_0x4c70('0x21')]],'as':_0x1dbb84['as'],'attributes':_0x1dbb84[_0x4c70('0x1d')],'include':_0x1dbb84[_0x4c70('0x1f')]?_['map'](_0x1dbb84[_0x4c70('0x1f')],function(_0x2a0a63){return{'model':db[_0x2a0a63[_0x4c70('0x21')]],'as':_0x2a0a63['as'],'attributes':_0x2a0a63[_0x4c70('0x1d')],'include':_0x2a0a63[_0x4c70('0x1f')]?_[_0x4c70('0x20')](_0x2a0a63['include'],function(_0x6bf24c){return{'model':db[_0x6bf24c[_0x4c70('0x21')]],'as':_0x6bf24c['as'],'attributes':_0x6bf24c[_0x4c70('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x194402){logger[_0x4c70('0xe')](_0x4c70('0x25'),_0x38600d);logger[_0x4c70('0x10')](_0x4c70('0x25'),_0x38600d,JSON[_0x4c70('0x12')](_0x194402));_0x2ed19f(_0x194402);})[_0x4c70('0x18')](function(_0x1fa167){logger[_0x4c70('0x14')](_0x4c70('0x25'),_0x1fa167['message'],_0x38600d);_0x8b9b4f(_0x3acb40[_0x4c70('0x14')](0x1f4,_0x1fa167[_0x4c70('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index c9402e7..47cb4d6 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 _0xacb7=['remove','update','register','length','./whatsappQueue.events','save'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xacb7,0x11e));var _0x7acb=function(_0x3c7419,_0x46b3e6){_0x3c7419=_0x3c7419-0x0;var _0x36db54=_0xacb7[_0x3c7419];return _0x36db54;};'use strict';var WhatsappQueueEvents=require(_0x7acb('0x0'));var events=[_0x7acb('0x1'),_0x7acb('0x2'),_0x7acb('0x3')];function createListener(_0x13f4da,_0x3f0842){return function(_0x58f0f1){_0x3f0842['emit'](_0x13f4da,_0x58f0f1);};}function removeListener(_0x4e8ab9,_0x5e8663){return function(){WhatsappQueueEvents['removeListener'](_0x4e8ab9,_0x5e8663);};}exports[_0x7acb('0x4')]=function(_0x2d4629){for(var _0x22c966=0x0,_0x368a42=events[_0x7acb('0x5')];_0x22c966<_0x368a42;_0x22c966++){var _0x5494a9=events[_0x22c966];var _0x1950e2=createListener('whatsappQueue:'+_0x5494a9,_0x2d4629);WhatsappQueueEvents['on'](_0x5494a9,_0x1950e2);}}; \ No newline at end of file +var _0x0334=['update','emit','whatsappQueue:','save','remove'];(function(_0x471e4b,_0x143da7){var _0x67ef2f=function(_0x5301dc){while(--_0x5301dc){_0x471e4b['push'](_0x471e4b['shift']());}};_0x67ef2f(++_0x143da7);}(_0x0334,0x166));var _0x4033=function(_0xb99061,_0x297e4b){_0xb99061=_0xb99061-0x0;var _0xfa27e2=_0x0334[_0xb99061];return _0xfa27e2;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0x4033('0x0'),_0x4033('0x1'),_0x4033('0x2')];function createListener(_0x41c65d,_0x37f9f3){return function(_0x322c1e){_0x37f9f3[_0x4033('0x3')](_0x41c65d,_0x322c1e);};}function removeListener(_0x2d1c43,_0x23632e){return function(){WhatsappQueueEvents['removeListener'](_0x2d1c43,_0x23632e);};}exports['register']=function(_0x2d7140){for(var _0xf1a4bf=0x0,_0x592cbc=events['length'];_0xf1a4bf<_0x592cbc;_0xf1a4bf++){var _0xdecd01=events[_0xf1a4bf];var _0x3d22b8=createListener(_0x4033('0x4')+_0xdecd01,_0x2d7140);WhatsappQueueEvents['on'](_0xdecd01,_0x3d22b8);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index ff1944f..4f534bf 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 _0x7841=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','update','destroy','path'];(function(_0x274e0e,_0x3aace4){var _0x4ca356=function(_0x59e7a3){while(--_0x59e7a3){_0x274e0e['push'](_0x274e0e['shift']());}};_0x4ca356(++_0x3aace4);}(_0x7841,0x185));var _0x1784=function(_0x505b9d,_0x14bcf4){_0x505b9d=_0x505b9d-0x0;var _0x491990=_0x7841[_0x505b9d];return _0x491990;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1784('0x0'));var timeout=require('connect-timeout');var express=require(_0x1784('0x1'));var router=express[_0x1784('0x2')]();var fs_extra=require(_0x1784('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x1784('0x4'));var config=require(_0x1784('0x5'));var controller=require(_0x1784('0x6'));router[_0x1784('0x7')]('/',auth[_0x1784('0x8')](),controller['index']);router[_0x1784('0x7')](_0x1784('0x9'),auth[_0x1784('0x8')](),controller[_0x1784('0xa')]);router[_0x1784('0x7')](_0x1784('0xb'),auth[_0x1784('0x8')](),controller[_0x1784('0xc')]);router['post']('/',auth[_0x1784('0x8')](),controller['create']);router['put'](_0x1784('0xb'),auth[_0x1784('0x8')](),controller[_0x1784('0xd')]);router['delete'](_0x1784('0xb'),auth['isAuthenticated'](),controller[_0x1784('0xe')]);module['exports']=router; \ No newline at end of file +var _0x4d65=['../../config/environment','./whatsappQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','update','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x54470e,_0x261fc7){var _0x1dd28d=function(_0x5ce4db){while(--_0x5ce4db){_0x54470e['push'](_0x54470e['shift']());}};_0x1dd28d(++_0x261fc7);}(_0x4d65,0x13d));var _0x54d6=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0x4d65[_0x138f59];return _0x3d114d;};'use strict';var multer=require(_0x54d6('0x0'));var util=require(_0x54d6('0x1'));var path=require(_0x54d6('0x2'));var timeout=require(_0x54d6('0x3'));var express=require('express');var router=express[_0x54d6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x54d6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x54d6('0x6'));var controller=require(_0x54d6('0x7'));router[_0x54d6('0x8')]('/',auth['isAuthenticated'](),controller[_0x54d6('0x9')]);router[_0x54d6('0x8')](_0x54d6('0xa'),auth[_0x54d6('0xb')](),controller[_0x54d6('0xc')]);router[_0x54d6('0x8')](_0x54d6('0xd'),auth[_0x54d6('0xb')](),controller[_0x54d6('0xe')]);router[_0x54d6('0xf')]('/',auth['isAuthenticated'](),controller[_0x54d6('0x10')]);router['put'](_0x54d6('0xd'),auth[_0x54d6('0xb')](),controller[_0x54d6('0x11')]);router['delete']('/:id',auth[_0x54d6('0xb')](),controller[_0x54d6('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index b508ed3..5285dbc 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(_0x217a5e,_0x36511e){var _0x484c2=function(_0x36641a){while(--_0x36641a){_0x217a5e['push'](_0x217a5e['shift']());}};_0x484c2(++_0x36511e);}(_0x7a54,0x106));var _0x47a5=function(_0x3b9f41,_0x853b77){_0x3b9f41=_0x3b9f41-0x0;var _0x4362ab=_0x7a54[_0x3b9f41];return _0x4362ab;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file +var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x18d6d1,_0x15e814){var _0x3ee37b=function(_0x340ddf){while(--_0x340ddf){_0x18d6d1['push'](_0x18d6d1['shift']());}};_0x3ee37b(++_0x15e814);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index dd806d4..d39c213 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 _0x0bb5=['attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','merge','where','VIRTUAL','options','findAll','show','params','rawAttributes','includeAll','include','find','catch','create','body','update','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','destroy','end','name','send','index','map','WhatsappQueueReport','fieldName','type','key','model','query','keys','filters','intersection'];(function(_0x417645,_0x5c3b55){var _0x3386a2=function(_0x2e13ca){while(--_0x2e13ca){_0x417645['push'](_0x417645['shift']());}};_0x3386a2(++_0x5c3b55);}(_0x0bb5,0x148));var _0x50bb=function(_0x5db124,_0x38ec4e){_0x5db124=_0x5db124-0x0;var _0x2f74f4=_0x0bb5[_0x5db124];return _0x2f74f4;};'use strict';var emlformat=require(_0x50bb('0x0'));var rimraf=require(_0x50bb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x50bb('0x2'));var moment=require(_0x50bb('0x3'));var BPromise=require(_0x50bb('0x4'));var Mustache=require(_0x50bb('0x5'));var util=require(_0x50bb('0x6'));var path=require(_0x50bb('0x7'));var sox=require(_0x50bb('0x8'));var csv=require(_0x50bb('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x50bb('0xa'));var squel=require(_0x50bb('0xb'));var crypto=require(_0x50bb('0xc'));var jsforce=require(_0x50bb('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x50bb('0xe'));var Papa=require(_0x50bb('0xf'));var Redis=require(_0x50bb('0x10'));var authService=require(_0x50bb('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x50bb('0x12'));var hardwareService=require(_0x50bb('0x13'));var logger=require(_0x50bb('0x14'))(_0x50bb('0x15'));var utils=require(_0x50bb('0x16'));var config=require(_0x50bb('0x17'));var licenseUtil=require(_0x50bb('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x226370,_0x58837d){_0x58837d=_0x58837d||0xcc;return function(_0x283f04){if(_0x283f04){return _0x226370[_0x50bb('0x19')](_0x58837d);}return _0x226370[_0x50bb('0x1a')](_0x58837d)['end']();};}function respondWithResult(_0x17007f,_0x309986){_0x309986=_0x309986||0xc8;return function(_0x3094f2){if(_0x3094f2){return _0x17007f['status'](_0x309986)[_0x50bb('0x1b')](_0x3094f2);}};}function respondWithFilteredResult(_0x5e8478,_0x21befa){return function(_0x3e1a51){if(_0x3e1a51){var _0x253073=typeof _0x21befa[_0x50bb('0x1c')]===_0x50bb('0x1d')&&typeof _0x21befa['limit']===_0x50bb('0x1d');var _0x174065=_0x3e1a51['count'];var _0x24ba19=_0x253073?0x0:_0x21befa['offset'];var _0x301f61=_0x253073?_0x3e1a51[_0x50bb('0x1e')]:_0x21befa['offset']+_0x21befa['limit'];var _0x43465b;if(_0x301f61>=_0x174065){_0x301f61=_0x174065;_0x43465b=0xc8;}else{_0x43465b=0xce;}_0x5e8478[_0x50bb('0x1a')](_0x43465b);return _0x5e8478[_0x50bb('0x1f')](_0x50bb('0x20'),_0x24ba19+'-'+_0x301f61+'/'+_0x174065)['json'](_0x3e1a51);}return null;};}function patchUpdates(_0x19dc5d){return function(_0x32bfc3){try{jsonpatch[_0x50bb('0x21')](_0x32bfc3,_0x19dc5d,!![]);}catch(_0x597e95){return BPromise[_0x50bb('0x22')](_0x597e95);}return _0x32bfc3[_0x50bb('0x23')]();};}function saveUpdates(_0x1344ec,_0x4825f8){return function(_0x1dbba2){if(_0x1dbba2){return _0x1dbba2['update'](_0x1344ec)[_0x50bb('0x24')](function(_0x3391da){return _0x3391da;});}return null;};}function removeEntity(_0x1a2a0b,_0x2ee87a){return function(_0x846311){if(_0x846311){return _0x846311[_0x50bb('0x25')]()['then'](function(){_0x1a2a0b[_0x50bb('0x1a')](0xcc)[_0x50bb('0x26')]();});}};}function handleEntityNotFound(_0x284a76,_0x3462c1){return function(_0x5234d7){if(!_0x5234d7){_0x284a76[_0x50bb('0x19')](0x194);}return _0x5234d7;};}function handleError(_0x4d38f7,_0x55e87b){_0x55e87b=_0x55e87b||0x1f4;return function(_0x2befd9){logger['error'](_0x2befd9['stack']);if(_0x2befd9[_0x50bb('0x27')]){delete _0x2befd9[_0x50bb('0x27')];}_0x4d38f7[_0x50bb('0x1a')](_0x55e87b)[_0x50bb('0x28')](_0x2befd9);};}exports[_0x50bb('0x29')]=function(_0x269479,_0x41a8ad){var _0x41d479={},_0x4f7514={},_0x44ce86={'count':0x0,'rows':[]};var _0x461cf3=_[_0x50bb('0x2a')](db[_0x50bb('0x2b')]['rawAttributes'],function(_0x13dc3c){return{'name':_0x13dc3c[_0x50bb('0x2c')],'type':_0x13dc3c[_0x50bb('0x2d')][_0x50bb('0x2e')]};});_0x4f7514[_0x50bb('0x2f')]=_[_0x50bb('0x2a')](_0x461cf3,_0x50bb('0x27'));_0x4f7514[_0x50bb('0x30')]=_[_0x50bb('0x31')](_0x269479[_0x50bb('0x30')]);_0x4f7514[_0x50bb('0x32')]=_[_0x50bb('0x33')](_0x4f7514['model'],_0x4f7514[_0x50bb('0x30')]);_0x41d479[_0x50bb('0x34')]=_[_0x50bb('0x33')](_0x4f7514[_0x50bb('0x2f')],qs[_0x50bb('0x35')](_0x269479[_0x50bb('0x30')][_0x50bb('0x35')]));_0x41d479[_0x50bb('0x34')]=_0x41d479[_0x50bb('0x34')][_0x50bb('0x36')]?_0x41d479[_0x50bb('0x34')]:_0x4f7514['model'];if(!_0x269479[_0x50bb('0x30')][_0x50bb('0x37')](_0x50bb('0x38'))){_0x41d479[_0x50bb('0x39')]=qs[_0x50bb('0x39')](_0x269479[_0x50bb('0x30')]['limit']);_0x41d479['offset']=qs[_0x50bb('0x1c')](_0x269479['query'][_0x50bb('0x1c')]);}_0x41d479[_0x50bb('0x3a')]=qs[_0x50bb('0x3b')](_0x269479[_0x50bb('0x30')][_0x50bb('0x3b')]);_0x41d479['where']=qs[_0x50bb('0x32')](_['pick'](_0x269479[_0x50bb('0x30')],_0x4f7514[_0x50bb('0x32')]),_0x461cf3);if(_0x269479[_0x50bb('0x30')]['filter']){_0x41d479['where']=_[_0x50bb('0x3c')](_0x41d479[_0x50bb('0x3d')],{'$or':_[_0x50bb('0x2a')](_0x461cf3,function(_0x21a180){if(_0x21a180['type']!==_0x50bb('0x3e')){var _0x4b75dc={};_0x4b75dc[_0x21a180['name']]={'$like':'%'+_0x269479[_0x50bb('0x30')]['filter']+'%'};return _0x4b75dc;}})});}_0x41d479=_[_0x50bb('0x3c')]({},_0x41d479,_0x269479[_0x50bb('0x3f')]);var _0x1ef231={'where':_0x41d479[_0x50bb('0x3d')]};return db[_0x50bb('0x2b')][_0x50bb('0x1e')](_0x1ef231)[_0x50bb('0x24')](function(_0x1cf782){_0x44ce86[_0x50bb('0x1e')]=_0x1cf782;if(_0x269479[_0x50bb('0x30')]['includeAll']){_0x41d479['include']=[{'all':!![]}];}return db[_0x50bb('0x2b')][_0x50bb('0x40')](_0x41d479);})[_0x50bb('0x24')](function(_0x1d929d){_0x44ce86['rows']=_0x1d929d;return _0x44ce86;})[_0x50bb('0x24')](respondWithFilteredResult(_0x41a8ad,_0x41d479))['catch'](handleError(_0x41a8ad,null));};exports[_0x50bb('0x41')]=function(_0x473a4c,_0x379944){var _0x40748d={'raw':!![],'where':{'id':_0x473a4c[_0x50bb('0x42')]['id']}},_0x1c438b={};_0x1c438b[_0x50bb('0x2f')]=_[_0x50bb('0x31')](db[_0x50bb('0x2b')][_0x50bb('0x43')]);_0x1c438b[_0x50bb('0x30')]=_[_0x50bb('0x31')](_0x473a4c[_0x50bb('0x30')]);_0x1c438b[_0x50bb('0x32')]=_[_0x50bb('0x33')](_0x1c438b[_0x50bb('0x2f')],_0x1c438b['query']);_0x40748d[_0x50bb('0x34')]=_['intersection'](_0x1c438b[_0x50bb('0x2f')],qs[_0x50bb('0x35')](_0x473a4c[_0x50bb('0x30')][_0x50bb('0x35')]));_0x40748d[_0x50bb('0x34')]=_0x40748d[_0x50bb('0x34')][_0x50bb('0x36')]?_0x40748d[_0x50bb('0x34')]:_0x1c438b[_0x50bb('0x2f')];if(_0x473a4c[_0x50bb('0x30')][_0x50bb('0x44')]){_0x40748d[_0x50bb('0x45')]=[{'all':!![]}];}_0x40748d=_[_0x50bb('0x3c')]({},_0x40748d,_0x473a4c[_0x50bb('0x3f')]);return db['WhatsappQueueReport'][_0x50bb('0x46')](_0x40748d)['then'](handleEntityNotFound(_0x379944,null))[_0x50bb('0x24')](respondWithResult(_0x379944,null))[_0x50bb('0x47')](handleError(_0x379944,null));};exports[_0x50bb('0x48')]=function(_0x35b440,_0x650e91){return db[_0x50bb('0x2b')][_0x50bb('0x48')](_0x35b440[_0x50bb('0x49')],{})['then'](respondWithResult(_0x650e91,0xc9))[_0x50bb('0x47')](handleError(_0x650e91,null));};exports[_0x50bb('0x4a')]=function(_0xf52a22,_0x13afe2){if(_0xf52a22[_0x50bb('0x49')]['id']){delete _0xf52a22['body']['id'];}return db[_0x50bb('0x2b')][_0x50bb('0x46')]({'where':{'id':_0xf52a22[_0x50bb('0x42')]['id']}})[_0x50bb('0x24')](handleEntityNotFound(_0x13afe2,null))[_0x50bb('0x24')](saveUpdates(_0xf52a22['body'],null))['then'](respondWithResult(_0x13afe2,null))[_0x50bb('0x47')](handleError(_0x13afe2,null));};exports['destroy']=function(_0x357d08,_0x57ee0e){return db[_0x50bb('0x2b')][_0x50bb('0x46')]({'where':{'id':_0x357d08[_0x50bb('0x42')]['id']}})['then'](handleEntityNotFound(_0x57ee0e,null))[_0x50bb('0x24')](removeEntity(_0x57ee0e,null))[_0x50bb('0x47')](handleError(_0x57ee0e,null));};exports['describe']=function(_0x184147,_0x1dff6a){return db[_0x50bb('0x2b')][_0x50bb('0x4b')]()['then'](respondWithResult(_0x1dff6a,null))[_0x50bb('0x47')](handleError(_0x1dff6a,null));}; \ No newline at end of file +var _0x4cf8=['limit','order','sort','where','pick','VIRTUAL','filter','options','includeAll','findAll','rows','show','merge','find','create','body','params','catch','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','WhatsappQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit'];(function(_0x2b6453,_0xbaeaf){var _0x3fa2dc=function(_0x5225a1){while(--_0x5225a1){_0x2b6453['push'](_0x2b6453['shift']());}};_0x3fa2dc(++_0xbaeaf);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x4dae00,_0x15b194){_0x4dae00=_0x4dae00-0x0;var _0x16bf42=_0x4cf8[_0x4dae00];return _0x16bf42;};'use strict';var emlformat=require(_0x84cf('0x0'));var rimraf=require(_0x84cf('0x1'));var zipdir=require(_0x84cf('0x2'));var jsonpatch=require(_0x84cf('0x3'));var rp=require(_0x84cf('0x4'));var moment=require(_0x84cf('0x5'));var BPromise=require(_0x84cf('0x6'));var Mustache=require(_0x84cf('0x7'));var util=require(_0x84cf('0x8'));var path=require(_0x84cf('0x9'));var sox=require(_0x84cf('0xa'));var csv=require(_0x84cf('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x84cf('0xc'));var squel=require('squel');var crypto=require(_0x84cf('0xd'));var jsforce=require(_0x84cf('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x84cf('0xb'));var querystring=require(_0x84cf('0xf'));var Papa=require('papaparse');var Redis=require(_0x84cf('0x10'));var authService=require(_0x84cf('0x11'));var qs=require(_0x84cf('0x12'));var as=require(_0x84cf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x84cf('0x14'))(_0x84cf('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x84cf('0x16'));var db=require(_0x84cf('0x17'))['db'];function respondWithStatusCode(_0x35f852,_0x33f83e){_0x33f83e=_0x33f83e||0xcc;return function(_0x172d04){if(_0x172d04){return _0x35f852[_0x84cf('0x18')](_0x33f83e);}return _0x35f852[_0x84cf('0x19')](_0x33f83e)[_0x84cf('0x1a')]();};}function respondWithResult(_0xced48,_0x250a19){_0x250a19=_0x250a19||0xc8;return function(_0x2fc41f){if(_0x2fc41f){return _0xced48[_0x84cf('0x19')](_0x250a19)[_0x84cf('0x1b')](_0x2fc41f);}};}function respondWithFilteredResult(_0x20e79c,_0x27261b){return function(_0x167c3e){if(_0x167c3e){var _0x464e70=typeof _0x27261b[_0x84cf('0x1c')]===_0x84cf('0x1d')&&typeof _0x27261b['limit']===_0x84cf('0x1d');var _0x5d6a93=_0x167c3e[_0x84cf('0x1e')];var _0x1abe2d=_0x464e70?0x0:_0x27261b[_0x84cf('0x1c')];var _0x13ba16=_0x464e70?_0x167c3e[_0x84cf('0x1e')]:_0x27261b['offset']+_0x27261b['limit'];var _0x42d6d4;if(_0x13ba16>=_0x5d6a93){_0x13ba16=_0x5d6a93;_0x42d6d4=0xc8;}else{_0x42d6d4=0xce;}_0x20e79c[_0x84cf('0x19')](_0x42d6d4);return _0x20e79c[_0x84cf('0x1f')](_0x84cf('0x20'),_0x1abe2d+'-'+_0x13ba16+'/'+_0x5d6a93)[_0x84cf('0x1b')](_0x167c3e);}return null;};}function patchUpdates(_0x5dda3f){return function(_0x39a37b){try{jsonpatch[_0x84cf('0x21')](_0x39a37b,_0x5dda3f,!![]);}catch(_0x3ca1be){return BPromise[_0x84cf('0x22')](_0x3ca1be);}return _0x39a37b[_0x84cf('0x23')]();};}function saveUpdates(_0x54405a,_0x42fa45){return function(_0x160f86){if(_0x160f86){return _0x160f86[_0x84cf('0x24')](_0x54405a)[_0x84cf('0x25')](function(_0x3e5e94){return _0x3e5e94;});}return null;};}function removeEntity(_0x29e9e1,_0x7feb4){return function(_0x4c9d1c){if(_0x4c9d1c){return _0x4c9d1c[_0x84cf('0x26')]()[_0x84cf('0x25')](function(){_0x29e9e1[_0x84cf('0x19')](0xcc)[_0x84cf('0x1a')]();});}};}function handleEntityNotFound(_0x1d220a,_0x44d4bf){return function(_0x3c7eda){if(!_0x3c7eda){_0x1d220a[_0x84cf('0x18')](0x194);}return _0x3c7eda;};}function handleError(_0x401aa4,_0x6797c0){_0x6797c0=_0x6797c0||0x1f4;return function(_0x5179c1){logger[_0x84cf('0x27')](_0x5179c1[_0x84cf('0x28')]);if(_0x5179c1[_0x84cf('0x29')]){delete _0x5179c1[_0x84cf('0x29')];}_0x401aa4['status'](_0x6797c0)[_0x84cf('0x2a')](_0x5179c1);};}exports['index']=function(_0x29455e,_0x4092fd){var _0x43b41b={},_0xc15298={},_0x51adcf={'count':0x0,'rows':[]};var _0x20de4b=_[_0x84cf('0x2b')](db[_0x84cf('0x2c')][_0x84cf('0x2d')],function(_0xb4fc5a){return{'name':_0xb4fc5a[_0x84cf('0x2e')],'type':_0xb4fc5a[_0x84cf('0x2f')][_0x84cf('0x30')]};});_0xc15298[_0x84cf('0x31')]=_['map'](_0x20de4b,'name');_0xc15298[_0x84cf('0x32')]=_[_0x84cf('0x33')](_0x29455e[_0x84cf('0x32')]);_0xc15298[_0x84cf('0x34')]=_[_0x84cf('0x35')](_0xc15298[_0x84cf('0x31')],_0xc15298[_0x84cf('0x32')]);_0x43b41b[_0x84cf('0x36')]=_['intersection'](_0xc15298[_0x84cf('0x31')],qs[_0x84cf('0x37')](_0x29455e['query'][_0x84cf('0x37')]));_0x43b41b['attributes']=_0x43b41b[_0x84cf('0x36')][_0x84cf('0x38')]?_0x43b41b[_0x84cf('0x36')]:_0xc15298[_0x84cf('0x31')];if(!_0x29455e[_0x84cf('0x32')]['hasOwnProperty'](_0x84cf('0x39'))){_0x43b41b['limit']=qs['limit'](_0x29455e[_0x84cf('0x32')][_0x84cf('0x3a')]);_0x43b41b['offset']=qs[_0x84cf('0x1c')](_0x29455e[_0x84cf('0x32')][_0x84cf('0x1c')]);}_0x43b41b[_0x84cf('0x3b')]=qs[_0x84cf('0x3c')](_0x29455e[_0x84cf('0x32')]['sort']);_0x43b41b[_0x84cf('0x3d')]=qs[_0x84cf('0x34')](_[_0x84cf('0x3e')](_0x29455e[_0x84cf('0x32')],_0xc15298[_0x84cf('0x34')]),_0x20de4b);if(_0x29455e[_0x84cf('0x32')]['filter']){_0x43b41b[_0x84cf('0x3d')]=_['merge'](_0x43b41b[_0x84cf('0x3d')],{'$or':_[_0x84cf('0x2b')](_0x20de4b,function(_0x3fa39a){if(_0x3fa39a[_0x84cf('0x2f')]!==_0x84cf('0x3f')){var _0x3897b0={};_0x3897b0[_0x3fa39a[_0x84cf('0x29')]]={'$like':'%'+_0x29455e[_0x84cf('0x32')][_0x84cf('0x40')]+'%'};return _0x3897b0;}})});}_0x43b41b=_['merge']({},_0x43b41b,_0x29455e[_0x84cf('0x41')]);var _0x516928={'where':_0x43b41b[_0x84cf('0x3d')]};return db[_0x84cf('0x2c')]['count'](_0x516928)[_0x84cf('0x25')](function(_0x531410){_0x51adcf[_0x84cf('0x1e')]=_0x531410;if(_0x29455e['query'][_0x84cf('0x42')]){_0x43b41b['include']=[{'all':!![]}];}return db[_0x84cf('0x2c')][_0x84cf('0x43')](_0x43b41b);})['then'](function(_0x847ce9){_0x51adcf[_0x84cf('0x44')]=_0x847ce9;return _0x51adcf;})[_0x84cf('0x25')](respondWithFilteredResult(_0x4092fd,_0x43b41b))['catch'](handleError(_0x4092fd,null));};exports[_0x84cf('0x45')]=function(_0x5f1b8e,_0x1c84e0){var _0x58b539={'raw':!![],'where':{'id':_0x5f1b8e['params']['id']}},_0x56b0e5={};_0x56b0e5[_0x84cf('0x31')]=_[_0x84cf('0x33')](db['WhatsappQueueReport'][_0x84cf('0x2d')]);_0x56b0e5['query']=_[_0x84cf('0x33')](_0x5f1b8e[_0x84cf('0x32')]);_0x56b0e5['filters']=_[_0x84cf('0x35')](_0x56b0e5['model'],_0x56b0e5[_0x84cf('0x32')]);_0x58b539['attributes']=_['intersection'](_0x56b0e5['model'],qs['fields'](_0x5f1b8e['query']['fields']));_0x58b539['attributes']=_0x58b539[_0x84cf('0x36')][_0x84cf('0x38')]?_0x58b539[_0x84cf('0x36')]:_0x56b0e5[_0x84cf('0x31')];if(_0x5f1b8e['query'][_0x84cf('0x42')]){_0x58b539['include']=[{'all':!![]}];}_0x58b539=_[_0x84cf('0x46')]({},_0x58b539,_0x5f1b8e[_0x84cf('0x41')]);return db[_0x84cf('0x2c')][_0x84cf('0x47')](_0x58b539)[_0x84cf('0x25')](handleEntityNotFound(_0x1c84e0,null))[_0x84cf('0x25')](respondWithResult(_0x1c84e0,null))['catch'](handleError(_0x1c84e0,null));};exports[_0x84cf('0x48')]=function(_0x2732bf,_0x4a4cf7){return db[_0x84cf('0x2c')][_0x84cf('0x48')](_0x2732bf[_0x84cf('0x49')],{})['then'](respondWithResult(_0x4a4cf7,0xc9))['catch'](handleError(_0x4a4cf7,null));};exports['update']=function(_0x1cf3f6,_0x104421){if(_0x1cf3f6[_0x84cf('0x49')]['id']){delete _0x1cf3f6[_0x84cf('0x49')]['id'];}return db[_0x84cf('0x2c')][_0x84cf('0x47')]({'where':{'id':_0x1cf3f6['params']['id']}})[_0x84cf('0x25')](handleEntityNotFound(_0x104421,null))['then'](saveUpdates(_0x1cf3f6[_0x84cf('0x49')],null))['then'](respondWithResult(_0x104421,null))['catch'](handleError(_0x104421,null));};exports[_0x84cf('0x26')]=function(_0xb1c3a8,_0x426df1){return db['WhatsappQueueReport']['find']({'where':{'id':_0xb1c3a8[_0x84cf('0x4a')]['id']}})[_0x84cf('0x25')](handleEntityNotFound(_0x426df1,null))[_0x84cf('0x25')](removeEntity(_0x426df1,null))[_0x84cf('0x4b')](handleError(_0x426df1,null));};exports[_0x84cf('0x4c')]=function(_0x4c2025,_0xcfe28f){return db[_0x84cf('0x2c')]['describe']()[_0x84cf('0x25')](respondWithResult(_0xcfe28f,null))['catch'](handleError(_0xcfe28f,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 7a2979e..dd08608 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 _0x795e=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','define','report_whatsapp_queue','lodash'];(function(_0x4c6d6f,_0x291557){var _0x2d4478=function(_0x106946){while(--_0x106946){_0x4c6d6f['push'](_0x4c6d6f['shift']());}};_0x2d4478(++_0x291557);}(_0x795e,0xe3));var _0xe795=function(_0x493bdf,_0x390870){_0x493bdf=_0x493bdf-0x0;var _0x466e3a=_0x795e[_0x493bdf];return _0x466e3a;};'use strict';var _=require(_0xe795('0x0'));var util=require(_0xe795('0x1'));var logger=require('../../config/logger')(_0xe795('0x2'));var moment=require(_0xe795('0x3'));var BPromise=require(_0xe795('0x4'));var rp=require(_0xe795('0x5'));var fs=require('fs');var path=require(_0xe795('0x6'));var rimraf=require(_0xe795('0x7'));var config=require(_0xe795('0x8'));var attributes=require(_0xe795('0x9'));module['exports']=function(_0x2bbafa,_0x544d3e){return _0x2bbafa[_0xe795('0xa')]('WhatsappQueueReport',attributes,{'tableName':_0xe795('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x8a3c=['exports','define','uniqueid','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x271fb0,_0x2fd26a){var _0x5bf342=function(_0x491d8b){while(--_0x491d8b){_0x271fb0['push'](_0x271fb0['shift']());}};_0x5bf342(++_0x2fd26a);}(_0x8a3c,0x1bc));var _0xc8a3=function(_0x1d4391,_0x16b6ca){_0x1d4391=_0x1d4391-0x0;var _0x51ddfb=_0x8a3c[_0x1d4391];return _0x51ddfb;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xc8a3('0x0'));var BPromise=require(_0xc8a3('0x1'));var rp=require(_0xc8a3('0x2'));var fs=require('fs');var path=require(_0xc8a3('0x3'));var rimraf=require(_0xc8a3('0x4'));var config=require(_0xc8a3('0x5'));var attributes=require('./whatsappQueueReport.attributes');module[_0xc8a3('0x6')]=function(_0x20c095,_0xc15a25){return _0x20c095[_0xc8a3('0x7')]('WhatsappQueueReport',attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0xc8a3('0x8'),'fields':[_0xc8a3('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 90de976..5981957 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 _0xac1e=['message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','body','options','raw','UpdateWhatsappQueueReport','where','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x19add0,_0x4f9463){var _0xc68315=function(_0x131d81){while(--_0x131d81){_0x19add0['push'](_0x19add0['shift']());}};_0xc68315(++_0x4f9463);}(_0xac1e,0xb1));var _0xeac1=function(_0x22149c,_0x13c8ab){_0x22149c=_0x22149c-0x0;var _0x15f67c=_0xac1e[_0x22149c];return _0x15f67c;};'use strict';var _=require('lodash');var util=require(_0xeac1('0x0'));var moment=require(_0xeac1('0x1'));var BPromise=require(_0xeac1('0x2'));var rs=require(_0xeac1('0x3'));var fs=require('fs');var Redis=require(_0xeac1('0x4'));var db=require(_0xeac1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xeac1('0x6'))('rpc');var config=require(_0xeac1('0x7'));var jayson=require(_0xeac1('0x8'));var client=jayson[_0xeac1('0x9')][_0xeac1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b972a,_0x2e0a35,_0x30e951){return new BPromise(function(_0x504634,_0x35c030){return client[_0xeac1('0xb')](_0x2b972a,_0x30e951)[_0xeac1('0xc')](function(_0x173772){logger[_0xeac1('0xd')](_0xeac1('0xe'),_0x2e0a35,'request\x20sent');logger[_0xeac1('0xf')](_0xeac1('0x10'),_0x2e0a35,_0xeac1('0x11'),JSON[_0xeac1('0x12')](_0x173772));if(_0x173772[_0xeac1('0x13')]){if(_0x173772['error'][_0xeac1('0x14')]===0x1f4){logger[_0xeac1('0x13')]('WhatsappQueueReport,\x20%s,\x20%s',_0x2e0a35,_0x173772[_0xeac1('0x13')][_0xeac1('0x15')]);return _0x35c030(_0x173772['error'][_0xeac1('0x15')]);}logger[_0xeac1('0x13')](_0xeac1('0xe'),_0x2e0a35,_0x173772[_0xeac1('0x13')][_0xeac1('0x15')]);return _0x504634(_0x173772[_0xeac1('0x13')]['message']);}else{logger[_0xeac1('0xd')]('WhatsappQueueReport,\x20%s,\x20%s',_0x2e0a35,_0xeac1('0x11'));_0x504634(_0x173772[_0xeac1('0x16')][_0xeac1('0x15')]);}})[_0xeac1('0x17')](function(_0x4c52e9){logger[_0xeac1('0x13')](_0xeac1('0xe'),_0x2e0a35,_0x4c52e9);_0x35c030(_0x4c52e9);});});}exports[_0xeac1('0x18')]=function(_0x50a6a1){var _0x2e1731=this;return new Promise(function(_0x113954,_0x219847){return db[_0xeac1('0x19')]['create'](_0x50a6a1[_0xeac1('0x1a')],{'raw':_0x50a6a1[_0xeac1('0x1b')]?_0x50a6a1[_0xeac1('0x1b')][_0xeac1('0x1c')]===undefined?!![]:![]:!![]})[_0xeac1('0xc')](function(_0x1971f8){logger[_0xeac1('0xd')]('CreateWhatsappQueueReport',_0x50a6a1);logger['debug'](_0xeac1('0x18'),_0x50a6a1,JSON[_0xeac1('0x12')](_0x1971f8));_0x113954(_0x1971f8);})[_0xeac1('0x17')](function(_0x475c7d){logger[_0xeac1('0x13')](_0xeac1('0x18'),_0x475c7d[_0xeac1('0x15')],_0x50a6a1);_0x219847(_0x2e1731[_0xeac1('0x13')](0x1f4,_0x475c7d[_0xeac1('0x15')]));});});};exports[_0xeac1('0x1d')]=function(_0x183468){var _0x581f40=this;return new Promise(function(_0x11abba,_0x8f1ef){return db['WhatsappQueueReport']['update'](_0x183468[_0xeac1('0x1a')],{'raw':_0x183468[_0xeac1('0x1b')]?_0x183468[_0xeac1('0x1b')][_0xeac1('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x183468[_0xeac1('0x1b')]?_0x183468[_0xeac1('0x1b')][_0xeac1('0x1e')]||null:null,'attributes':_0x183468['options']?_0x183468[_0xeac1('0x1b')][_0xeac1('0x1f')]||null:null,'limit':_0x183468[_0xeac1('0x1b')]?_0x183468[_0xeac1('0x1b')][_0xeac1('0x20')]||null:null})['then'](function(_0x32ddf){logger[_0xeac1('0xd')]('UpdateWhatsappQueueReport',_0x183468);logger[_0xeac1('0xf')](_0xeac1('0x1d'),_0x183468,JSON['stringify'](_0x32ddf));_0x11abba(_0x32ddf);})[_0xeac1('0x17')](function(_0x5d6f3b){logger[_0xeac1('0x13')](_0xeac1('0x1d'),_0x5d6f3b[_0xeac1('0x15')],_0x183468);_0x8f1ef(_0x581f40[_0xeac1('0x13')](0x1f4,_0x5d6f3b[_0xeac1('0x15')]));});});}; \ No newline at end of file +var _0xbc02=['WhatsappQueueReport,\x20%s,\x20%s','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreateWhatsappQueueReport','body','options','raw','stringify','UpdateWhatsappQueueReport','WhatsappQueueReport','update','attributes','limit','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0xbc02,0x15d));var _0x2bc0=function(_0x417e0a,_0x446db8){_0x417e0a=_0x417e0a-0x0;var _0x223dab=_0xbc02[_0x417e0a];return _0x223dab;};'use strict';var _=require(_0x2bc0('0x0'));var util=require(_0x2bc0('0x1'));var moment=require(_0x2bc0('0x2'));var BPromise=require(_0x2bc0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2bc0('0x4'));var logger=require(_0x2bc0('0x5'))(_0x2bc0('0x6'));var config=require(_0x2bc0('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2bc0('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x154170,_0xdd2d4,_0x17bbce){return new BPromise(function(_0x866b5b,_0xe86058){return client['request'](_0x154170,_0x17bbce)[_0x2bc0('0x9')](function(_0x6a77d6){logger[_0x2bc0('0xa')](_0x2bc0('0xb'),_0xdd2d4,'request\x20sent');logger[_0x2bc0('0xc')](_0x2bc0('0xd'),_0xdd2d4,_0x2bc0('0xe'),JSON['stringify'](_0x6a77d6));if(_0x6a77d6[_0x2bc0('0xf')]){if(_0x6a77d6['error'][_0x2bc0('0x10')]===0x1f4){logger[_0x2bc0('0xf')](_0x2bc0('0xb'),_0xdd2d4,_0x6a77d6['error'][_0x2bc0('0x11')]);return _0xe86058(_0x6a77d6[_0x2bc0('0xf')]['message']);}logger[_0x2bc0('0xf')](_0x2bc0('0xb'),_0xdd2d4,_0x6a77d6[_0x2bc0('0xf')][_0x2bc0('0x11')]);return _0x866b5b(_0x6a77d6[_0x2bc0('0xf')]['message']);}else{logger[_0x2bc0('0xa')](_0x2bc0('0xb'),_0xdd2d4,_0x2bc0('0xe'));_0x866b5b(_0x6a77d6[_0x2bc0('0x12')][_0x2bc0('0x11')]);}})[_0x2bc0('0x13')](function(_0x4a0fc1){logger['error'](_0x2bc0('0xb'),_0xdd2d4,_0x4a0fc1);_0xe86058(_0x4a0fc1);});});}exports[_0x2bc0('0x14')]=function(_0x2f22d6){var _0x38e5e7=this;return new Promise(function(_0x492909,_0x2c3075){return db['WhatsappQueueReport']['create'](_0x2f22d6[_0x2bc0('0x15')],{'raw':_0x2f22d6[_0x2bc0('0x16')]?_0x2f22d6[_0x2bc0('0x16')][_0x2bc0('0x17')]===undefined?!![]:![]:!![]})[_0x2bc0('0x9')](function(_0x38c93c){logger[_0x2bc0('0xa')](_0x2bc0('0x14'),_0x2f22d6);logger[_0x2bc0('0xc')](_0x2bc0('0x14'),_0x2f22d6,JSON[_0x2bc0('0x18')](_0x38c93c));_0x492909(_0x38c93c);})[_0x2bc0('0x13')](function(_0xaca083){logger[_0x2bc0('0xf')]('CreateWhatsappQueueReport',_0xaca083[_0x2bc0('0x11')],_0x2f22d6);_0x2c3075(_0x38e5e7['error'](0x1f4,_0xaca083[_0x2bc0('0x11')]));});});};exports[_0x2bc0('0x19')]=function(_0x5b609a){var _0x1faf0f=this;return new Promise(function(_0x432100,_0x2e2c59){return db[_0x2bc0('0x1a')][_0x2bc0('0x1b')](_0x5b609a[_0x2bc0('0x15')],{'raw':_0x5b609a[_0x2bc0('0x16')]?_0x5b609a['options'][_0x2bc0('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5b609a['options']?_0x5b609a['options']['where']||null:null,'attributes':_0x5b609a[_0x2bc0('0x16')]?_0x5b609a['options'][_0x2bc0('0x1c')]||null:null,'limit':_0x5b609a['options']?_0x5b609a[_0x2bc0('0x16')][_0x2bc0('0x1d')]||null:null})[_0x2bc0('0x9')](function(_0x2b54b4){logger[_0x2bc0('0xa')](_0x2bc0('0x19'),_0x5b609a);logger[_0x2bc0('0xc')]('UpdateWhatsappQueueReport',_0x5b609a,JSON[_0x2bc0('0x18')](_0x2b54b4));_0x432100(_0x2b54b4);})['catch'](function(_0x2a6226){logger[_0x2bc0('0xf')]('UpdateWhatsappQueueReport',_0x2a6226[_0x2bc0('0x11')],_0x5b609a);_0x2e2c59(_0x1faf0f[_0x2bc0('0xf')](0x1f4,_0x2a6226[_0x2bc0('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index d12e73c..2ad34e2 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 _0xfcef=['exports','multer','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','isAuthenticated','index','get','describe','/:id','post','create','put','update','delete','destroy'];(function(_0x1adda4,_0x537884){var _0x4f9025=function(_0x1b82eb){while(--_0x1b82eb){_0x1adda4['push'](_0x1adda4['shift']());}};_0x4f9025(++_0x537884);}(_0xfcef,0x190));var _0xffce=function(_0x43a1bd,_0x381580){_0x43a1bd=_0x43a1bd-0x0;var _0x31207f=_0xfcef[_0x43a1bd];return _0x31207f;};'use strict';var multer=require(_0xffce('0x0'));var util=require('util');var path=require(_0xffce('0x1'));var timeout=require(_0xffce('0x2'));var express=require(_0xffce('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xffce('0x4'));var config=require(_0xffce('0x5'));var controller=require(_0xffce('0x6'));router['get']('/',auth[_0xffce('0x7')](),controller[_0xffce('0x8')]);router[_0xffce('0x9')]('/describe',auth[_0xffce('0x7')](),controller[_0xffce('0xa')]);router[_0xffce('0x9')](_0xffce('0xb'),auth[_0xffce('0x7')](),controller['show']);router[_0xffce('0xc')]('/',auth['isAuthenticated'](),controller[_0xffce('0xd')]);router[_0xffce('0xe')](_0xffce('0xb'),auth[_0xffce('0x7')](),controller[_0xffce('0xf')]);router[_0xffce('0x10')](_0xffce('0xb'),auth[_0xffce('0x7')](),controller[_0xffce('0x11')]);module[_0xffce('0x12')]=router; \ No newline at end of file +var _0x03ba=['/describe','isAuthenticated','describe','show','create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index'];(function(_0x5c3c0b,_0x4ee35e){var _0x52ecd2=function(_0x3cf575){while(--_0x3cf575){_0x5c3c0b['push'](_0x5c3c0b['shift']());}};_0x52ecd2(++_0x4ee35e);}(_0x03ba,0x1d6));var _0xa03b=function(_0x37e0a2,_0xb06852){_0x37e0a2=_0x37e0a2-0x0;var _0x20a396=_0x03ba[_0x37e0a2];return _0x20a396;};'use strict';var multer=require(_0xa03b('0x0'));var util=require(_0xa03b('0x1'));var path=require(_0xa03b('0x2'));var timeout=require(_0xa03b('0x3'));var express=require(_0xa03b('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa03b('0x5'));var interaction=require(_0xa03b('0x6'));var config=require(_0xa03b('0x7'));var controller=require('./whatsappTransferReport.controller');router[_0xa03b('0x8')]('/',auth['isAuthenticated'](),controller[_0xa03b('0x9')]);router[_0xa03b('0x8')](_0xa03b('0xa'),auth[_0xa03b('0xb')](),controller[_0xa03b('0xc')]);router[_0xa03b('0x8')]('/:id',auth[_0xa03b('0xb')](),controller[_0xa03b('0xd')]);router['post']('/',auth[_0xa03b('0xb')](),controller[_0xa03b('0xe')]);router[_0xa03b('0xf')](_0xa03b('0x10'),auth[_0xa03b('0xb')](),controller[_0xa03b('0x11')]);router['delete'](_0xa03b('0x10'),auth[_0xa03b('0xb')](),controller[_0xa03b('0x12')]);module[_0xa03b('0x13')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index d7f07cb..1e8f99e 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 _0xa846=['ENUM','account','agent','queue','exports','STRING'];(function(_0x5737e3,_0x56228c){var _0x206724=function(_0x2ab91d){while(--_0x2ab91d){_0x5737e3['push'](_0x5737e3['shift']());}};_0x206724(++_0x56228c);}(_0xa846,0x70));var _0x6a84=function(_0x22e976,_0x3a9adb){_0x22e976=_0x22e976-0x0;var _0x41037d=_0xa846[_0x22e976];return _0x41037d;};'use strict';var Sequelize=require('sequelize');module[_0x6a84('0x0')]={'uniqueid':{'type':Sequelize[_0x6a84('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x6a84('0x2')](_0x6a84('0x3'),_0x6a84('0x4'),_0x6a84('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x8a5c=['STRING','ENUM','account','agent','queue','DATE','sequelize','exports'];(function(_0x51c865,_0x12a096){var _0x100cab=function(_0x53094e){while(--_0x53094e){_0x51c865['push'](_0x51c865['shift']());}};_0x100cab(++_0x12a096);}(_0x8a5c,0x136));var _0xc8a5=function(_0x223b1d,_0x3c76cf){_0x223b1d=_0x223b1d-0x0;var _0x551626=_0x8a5c[_0x223b1d];return _0x551626;};'use strict';var Sequelize=require(_0xc8a5('0x0'));module[_0xc8a5('0x1')]={'uniqueid':{'type':Sequelize[_0xc8a5('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xc8a5('0x3')](_0xc8a5('0x4'),_0xc8a5('0x5'),_0xc8a5('0x6')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xc8a5('0x7')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 6dc1b47..a2e3cb9 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 _0xa775=['end','json','offset','limit','undefined','count','status','reject','save','then','error','stack','name','index','map','WhatsappTransferReport','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','describe','eml-format','zip-dir','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x4eb343,_0x3d098a){var _0x2016e7=function(_0x4a910e){while(--_0x4a910e){_0x4eb343['push'](_0x4eb343['shift']());}};_0x2016e7(++_0x3d098a);}(_0xa775,0xf6));var _0x5a77=function(_0xcf3012,_0x4face6){_0xcf3012=_0xcf3012-0x0;var _0xcdd88c=_0xa775[_0xcf3012];return _0xcdd88c;};'use strict';var emlformat=require(_0x5a77('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5a77('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5a77('0x2'));var BPromise=require(_0x5a77('0x3'));var Mustache=require(_0x5a77('0x4'));var util=require(_0x5a77('0x5'));var path=require('path');var sox=require(_0x5a77('0x6'));var csv=require(_0x5a77('0x7'));var ejs=require(_0x5a77('0x8'));var fs=require('fs');var fs_extra=require(_0x5a77('0x9'));var _=require(_0x5a77('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5a77('0x7'));var querystring=require(_0x5a77('0xb'));var Papa=require(_0x5a77('0xc'));var Redis=require(_0x5a77('0xd'));var authService=require(_0x5a77('0xe'));var qs=require(_0x5a77('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5a77('0x10'));var logger=require(_0x5a77('0x11'))('api');var utils=require(_0x5a77('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x5a77('0x13'));var db=require(_0x5a77('0x14'))['db'];function respondWithStatusCode(_0x1767cf,_0x1c6431){_0x1c6431=_0x1c6431||0xcc;return function(_0x39efe1){if(_0x39efe1){return _0x1767cf[_0x5a77('0x15')](_0x1c6431);}return _0x1767cf['status'](_0x1c6431)[_0x5a77('0x16')]();};}function respondWithResult(_0x426dca,_0x1bce83){_0x1bce83=_0x1bce83||0xc8;return function(_0x20c918){if(_0x20c918){return _0x426dca['status'](_0x1bce83)[_0x5a77('0x17')](_0x20c918);}};}function respondWithFilteredResult(_0x371a14,_0x4fcc0c){return function(_0x8eafae){if(_0x8eafae){var _0x263dfc=typeof _0x4fcc0c[_0x5a77('0x18')]==='undefined'&&typeof _0x4fcc0c[_0x5a77('0x19')]===_0x5a77('0x1a');var _0x1e5737=_0x8eafae[_0x5a77('0x1b')];var _0x5628e2=_0x263dfc?0x0:_0x4fcc0c[_0x5a77('0x18')];var _0x53c754=_0x263dfc?_0x8eafae[_0x5a77('0x1b')]:_0x4fcc0c[_0x5a77('0x18')]+_0x4fcc0c[_0x5a77('0x19')];var _0x1ee993;if(_0x53c754>=_0x1e5737){_0x53c754=_0x1e5737;_0x1ee993=0xc8;}else{_0x1ee993=0xce;}_0x371a14[_0x5a77('0x1c')](_0x1ee993);return _0x371a14['set']('Content-Range',_0x5628e2+'-'+_0x53c754+'/'+_0x1e5737)[_0x5a77('0x17')](_0x8eafae);}return null;};}function patchUpdates(_0x2271c3){return function(_0x1ff5ec){try{jsonpatch['apply'](_0x1ff5ec,_0x2271c3,!![]);}catch(_0x47b333){return BPromise[_0x5a77('0x1d')](_0x47b333);}return _0x1ff5ec[_0x5a77('0x1e')]();};}function saveUpdates(_0x22a9d5,_0x3a4c3b){return function(_0x204a96){if(_0x204a96){return _0x204a96['update'](_0x22a9d5)[_0x5a77('0x1f')](function(_0x3dc430){return _0x3dc430;});}return null;};}function removeEntity(_0x5db7a2,_0x2439d4){return function(_0x179589){if(_0x179589){return _0x179589['destroy']()[_0x5a77('0x1f')](function(){_0x5db7a2[_0x5a77('0x1c')](0xcc)[_0x5a77('0x16')]();});}};}function handleEntityNotFound(_0x49d0d9,_0x24e89d){return function(_0x3fc1c2){if(!_0x3fc1c2){_0x49d0d9[_0x5a77('0x15')](0x194);}return _0x3fc1c2;};}function handleError(_0x1aa032,_0x2b8a3e){_0x2b8a3e=_0x2b8a3e||0x1f4;return function(_0x2cdb03){logger[_0x5a77('0x20')](_0x2cdb03[_0x5a77('0x21')]);if(_0x2cdb03[_0x5a77('0x22')]){delete _0x2cdb03[_0x5a77('0x22')];}_0x1aa032[_0x5a77('0x1c')](_0x2b8a3e)['send'](_0x2cdb03);};}exports[_0x5a77('0x23')]=function(_0x45119e,_0x1dd0b5){var _0x54d317={},_0x48e547={},_0x5dadc7={'count':0x0,'rows':[]};var _0x4cbf4e=_[_0x5a77('0x24')](db[_0x5a77('0x25')]['rawAttributes'],function(_0xfbeef3){return{'name':_0xfbeef3['fieldName'],'type':_0xfbeef3[_0x5a77('0x26')][_0x5a77('0x27')]};});_0x48e547['model']=_['map'](_0x4cbf4e,_0x5a77('0x22'));_0x48e547[_0x5a77('0x28')]=_[_0x5a77('0x29')](_0x45119e[_0x5a77('0x28')]);_0x48e547[_0x5a77('0x2a')]=_[_0x5a77('0x2b')](_0x48e547[_0x5a77('0x2c')],_0x48e547[_0x5a77('0x28')]);_0x54d317['attributes']=_[_0x5a77('0x2b')](_0x48e547[_0x5a77('0x2c')],qs[_0x5a77('0x2d')](_0x45119e['query'][_0x5a77('0x2d')]));_0x54d317[_0x5a77('0x2e')]=_0x54d317['attributes'][_0x5a77('0x2f')]?_0x54d317[_0x5a77('0x2e')]:_0x48e547[_0x5a77('0x2c')];if(!_0x45119e['query'][_0x5a77('0x30')]('nolimit')){_0x54d317[_0x5a77('0x19')]=qs['limit'](_0x45119e[_0x5a77('0x28')][_0x5a77('0x19')]);_0x54d317[_0x5a77('0x18')]=qs[_0x5a77('0x18')](_0x45119e['query'][_0x5a77('0x18')]);}_0x54d317[_0x5a77('0x31')]=qs['sort'](_0x45119e['query']['sort']);_0x54d317['where']=qs[_0x5a77('0x2a')](_[_0x5a77('0x32')](_0x45119e['query'],_0x48e547[_0x5a77('0x2a')]),_0x4cbf4e);if(_0x45119e[_0x5a77('0x28')][_0x5a77('0x33')]){_0x54d317[_0x5a77('0x34')]=_[_0x5a77('0x35')](_0x54d317[_0x5a77('0x34')],{'$or':_[_0x5a77('0x24')](_0x4cbf4e,function(_0x887e8c){if(_0x887e8c[_0x5a77('0x26')]!==_0x5a77('0x36')){var _0x42d4eb={};_0x42d4eb[_0x887e8c[_0x5a77('0x22')]]={'$like':'%'+_0x45119e[_0x5a77('0x28')][_0x5a77('0x33')]+'%'};return _0x42d4eb;}})});}_0x54d317=_[_0x5a77('0x35')]({},_0x54d317,_0x45119e[_0x5a77('0x37')]);var _0x4d8ce9={'where':_0x54d317[_0x5a77('0x34')]};return db[_0x5a77('0x25')][_0x5a77('0x1b')](_0x4d8ce9)['then'](function(_0x1eb4d6){_0x5dadc7[_0x5a77('0x1b')]=_0x1eb4d6;if(_0x45119e[_0x5a77('0x28')][_0x5a77('0x38')]){_0x54d317[_0x5a77('0x39')]=[{'all':!![]}];}return db[_0x5a77('0x25')][_0x5a77('0x3a')](_0x54d317);})[_0x5a77('0x1f')](function(_0xf52b83){_0x5dadc7[_0x5a77('0x3b')]=_0xf52b83;return _0x5dadc7;})['then'](respondWithFilteredResult(_0x1dd0b5,_0x54d317))[_0x5a77('0x3c')](handleError(_0x1dd0b5,null));};exports['show']=function(_0x4269f0,_0x38c6e3){var _0xda875={'raw':!![],'where':{'id':_0x4269f0[_0x5a77('0x3d')]['id']}},_0x27a450={};_0x27a450[_0x5a77('0x2c')]=_['keys'](db['WhatsappTransferReport'][_0x5a77('0x3e')]);_0x27a450[_0x5a77('0x28')]=_['keys'](_0x4269f0['query']);_0x27a450[_0x5a77('0x2a')]=_[_0x5a77('0x2b')](_0x27a450[_0x5a77('0x2c')],_0x27a450[_0x5a77('0x28')]);_0xda875[_0x5a77('0x2e')]=_['intersection'](_0x27a450[_0x5a77('0x2c')],qs[_0x5a77('0x2d')](_0x4269f0[_0x5a77('0x28')][_0x5a77('0x2d')]));_0xda875['attributes']=_0xda875[_0x5a77('0x2e')][_0x5a77('0x2f')]?_0xda875[_0x5a77('0x2e')]:_0x27a450['model'];if(_0x4269f0['query'][_0x5a77('0x38')]){_0xda875['include']=[{'all':!![]}];}_0xda875=_[_0x5a77('0x35')]({},_0xda875,_0x4269f0[_0x5a77('0x37')]);return db[_0x5a77('0x25')][_0x5a77('0x3f')](_0xda875)[_0x5a77('0x1f')](handleEntityNotFound(_0x38c6e3,null))[_0x5a77('0x1f')](respondWithResult(_0x38c6e3,null))[_0x5a77('0x3c')](handleError(_0x38c6e3,null));};exports[_0x5a77('0x40')]=function(_0x35a252,_0x1a15d0){return db[_0x5a77('0x25')]['create'](_0x35a252[_0x5a77('0x41')],{})[_0x5a77('0x1f')](respondWithResult(_0x1a15d0,0xc9))[_0x5a77('0x3c')](handleError(_0x1a15d0,null));};exports['update']=function(_0x3ec766,_0x3db645){if(_0x3ec766[_0x5a77('0x41')]['id']){delete _0x3ec766['body']['id'];}return db[_0x5a77('0x25')]['find']({'where':{'id':_0x3ec766[_0x5a77('0x3d')]['id']}})[_0x5a77('0x1f')](handleEntityNotFound(_0x3db645,null))[_0x5a77('0x1f')](saveUpdates(_0x3ec766[_0x5a77('0x41')],null))[_0x5a77('0x1f')](respondWithResult(_0x3db645,null))[_0x5a77('0x3c')](handleError(_0x3db645,null));};exports['destroy']=function(_0x244c6e,_0x3f3efe){return db[_0x5a77('0x25')][_0x5a77('0x3f')]({'where':{'id':_0x244c6e[_0x5a77('0x3d')]['id']}})[_0x5a77('0x1f')](handleEntityNotFound(_0x3f3efe,null))[_0x5a77('0x1f')](removeEntity(_0x3f3efe,null))[_0x5a77('0x3c')](handleError(_0x3f3efe,null));};exports[_0x5a77('0x42')]=function(_0x54e094,_0x27a3ff){return db[_0x5a77('0x25')][_0x5a77('0x42')]()[_0x5a77('0x1f')](respondWithResult(_0x27a3ff,null))['catch'](handleError(_0x27a3ff,null));}; \ No newline at end of file +var _0x15f7=['params','intersection','options','catch','create','body','update','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','reject','save','then','destroy','error','name','index','WhatsappTransferReport','rawAttributes','fieldName','model','map','query','keys','filters','attributes','fields','length','nolimit','sort','where','pick','filter','type','VIRTUAL','merge','includeAll','include','findAll','rows'];(function(_0x8d65b,_0x534629){var _0x8af56a=function(_0x128c6f){while(--_0x128c6f){_0x8d65b['push'](_0x8d65b['shift']());}};_0x8af56a(++_0x534629);}(_0x15f7,0xe4));var _0x715f=function(_0x23c217,_0x3aee12){_0x23c217=_0x23c217-0x0;var _0x53fcf8=_0x15f7[_0x23c217];return _0x53fcf8;};'use strict';var emlformat=require(_0x715f('0x0'));var rimraf=require(_0x715f('0x1'));var zipdir=require(_0x715f('0x2'));var jsonpatch=require(_0x715f('0x3'));var rp=require(_0x715f('0x4'));var moment=require(_0x715f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x715f('0x6'));var util=require(_0x715f('0x7'));var path=require(_0x715f('0x8'));var sox=require(_0x715f('0x9'));var csv=require('to-csv');var ejs=require(_0x715f('0xa'));var fs=require('fs');var fs_extra=require(_0x715f('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x715f('0xc'));var jsforce=require(_0x715f('0xd'));var deskjs=require(_0x715f('0xe'));var toCsv=require(_0x715f('0xf'));var querystring=require(_0x715f('0x10'));var Papa=require('papaparse');var Redis=require(_0x715f('0x11'));var authService=require(_0x715f('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x715f('0x13'));var logger=require(_0x715f('0x14'))(_0x715f('0x15'));var utils=require(_0x715f('0x16'));var config=require(_0x715f('0x17'));var licenseUtil=require(_0x715f('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b3b88,_0x1903c6){_0x1903c6=_0x1903c6||0xcc;return function(_0x316f7d){if(_0x316f7d){return _0x1b3b88[_0x715f('0x19')](_0x1903c6);}return _0x1b3b88[_0x715f('0x1a')](_0x1903c6)[_0x715f('0x1b')]();};}function respondWithResult(_0x480ec3,_0x49eab1){_0x49eab1=_0x49eab1||0xc8;return function(_0x14f9ba){if(_0x14f9ba){return _0x480ec3[_0x715f('0x1a')](_0x49eab1)['json'](_0x14f9ba);}};}function respondWithFilteredResult(_0x445c00,_0x1e70bc){return function(_0x13a0a3){if(_0x13a0a3){var _0x3252e8=typeof _0x1e70bc['offset']===_0x715f('0x1c')&&typeof _0x1e70bc[_0x715f('0x1d')]==='undefined';var _0x37d653=_0x13a0a3[_0x715f('0x1e')];var _0x3fee87=_0x3252e8?0x0:_0x1e70bc[_0x715f('0x1f')];var _0xed90d2=_0x3252e8?_0x13a0a3[_0x715f('0x1e')]:_0x1e70bc[_0x715f('0x1f')]+_0x1e70bc[_0x715f('0x1d')];var _0x48283a;if(_0xed90d2>=_0x37d653){_0xed90d2=_0x37d653;_0x48283a=0xc8;}else{_0x48283a=0xce;}_0x445c00[_0x715f('0x1a')](_0x48283a);return _0x445c00[_0x715f('0x20')](_0x715f('0x21'),_0x3fee87+'-'+_0xed90d2+'/'+_0x37d653)['json'](_0x13a0a3);}return null;};}function patchUpdates(_0x3d794e){return function(_0x2bc4ec){try{jsonpatch['apply'](_0x2bc4ec,_0x3d794e,!![]);}catch(_0x5d725e){return BPromise[_0x715f('0x22')](_0x5d725e);}return _0x2bc4ec[_0x715f('0x23')]();};}function saveUpdates(_0x2baa78,_0x3e2893){return function(_0x615c0f){if(_0x615c0f){return _0x615c0f['update'](_0x2baa78)[_0x715f('0x24')](function(_0x2fd052){return _0x2fd052;});}return null;};}function removeEntity(_0x2f20ef,_0x243397){return function(_0x550ece){if(_0x550ece){return _0x550ece[_0x715f('0x25')]()['then'](function(){_0x2f20ef[_0x715f('0x1a')](0xcc)[_0x715f('0x1b')]();});}};}function handleEntityNotFound(_0x36f277,_0x3217da){return function(_0x495ac4){if(!_0x495ac4){_0x36f277['sendStatus'](0x194);}return _0x495ac4;};}function handleError(_0x57f819,_0x114995){_0x114995=_0x114995||0x1f4;return function(_0x40b34d){logger[_0x715f('0x26')](_0x40b34d['stack']);if(_0x40b34d[_0x715f('0x27')]){delete _0x40b34d['name'];}_0x57f819[_0x715f('0x1a')](_0x114995)['send'](_0x40b34d);};}exports[_0x715f('0x28')]=function(_0x31d32b,_0x5a4c7f){var _0x5d4185={},_0x497471={},_0x30d5d9={'count':0x0,'rows':[]};var _0x3bc4dc=_['map'](db[_0x715f('0x29')][_0x715f('0x2a')],function(_0x49cf6e){return{'name':_0x49cf6e[_0x715f('0x2b')],'type':_0x49cf6e['type']['key']};});_0x497471[_0x715f('0x2c')]=_[_0x715f('0x2d')](_0x3bc4dc,'name');_0x497471[_0x715f('0x2e')]=_[_0x715f('0x2f')](_0x31d32b[_0x715f('0x2e')]);_0x497471[_0x715f('0x30')]=_['intersection'](_0x497471[_0x715f('0x2c')],_0x497471[_0x715f('0x2e')]);_0x5d4185[_0x715f('0x31')]=_['intersection'](_0x497471[_0x715f('0x2c')],qs[_0x715f('0x32')](_0x31d32b[_0x715f('0x2e')][_0x715f('0x32')]));_0x5d4185[_0x715f('0x31')]=_0x5d4185[_0x715f('0x31')][_0x715f('0x33')]?_0x5d4185[_0x715f('0x31')]:_0x497471['model'];if(!_0x31d32b[_0x715f('0x2e')]['hasOwnProperty'](_0x715f('0x34'))){_0x5d4185['limit']=qs[_0x715f('0x1d')](_0x31d32b[_0x715f('0x2e')]['limit']);_0x5d4185[_0x715f('0x1f')]=qs[_0x715f('0x1f')](_0x31d32b['query'][_0x715f('0x1f')]);}_0x5d4185['order']=qs[_0x715f('0x35')](_0x31d32b[_0x715f('0x2e')]['sort']);_0x5d4185[_0x715f('0x36')]=qs[_0x715f('0x30')](_[_0x715f('0x37')](_0x31d32b[_0x715f('0x2e')],_0x497471[_0x715f('0x30')]),_0x3bc4dc);if(_0x31d32b[_0x715f('0x2e')][_0x715f('0x38')]){_0x5d4185[_0x715f('0x36')]=_['merge'](_0x5d4185[_0x715f('0x36')],{'$or':_[_0x715f('0x2d')](_0x3bc4dc,function(_0x3c5291){if(_0x3c5291[_0x715f('0x39')]!==_0x715f('0x3a')){var _0x285ac0={};_0x285ac0[_0x3c5291[_0x715f('0x27')]]={'$like':'%'+_0x31d32b['query'][_0x715f('0x38')]+'%'};return _0x285ac0;}})});}_0x5d4185=_[_0x715f('0x3b')]({},_0x5d4185,_0x31d32b['options']);var _0x5e944f={'where':_0x5d4185['where']};return db[_0x715f('0x29')][_0x715f('0x1e')](_0x5e944f)['then'](function(_0x6e499b){_0x30d5d9[_0x715f('0x1e')]=_0x6e499b;if(_0x31d32b[_0x715f('0x2e')][_0x715f('0x3c')]){_0x5d4185[_0x715f('0x3d')]=[{'all':!![]}];}return db[_0x715f('0x29')][_0x715f('0x3e')](_0x5d4185);})[_0x715f('0x24')](function(_0x2416fd){_0x30d5d9[_0x715f('0x3f')]=_0x2416fd;return _0x30d5d9;})[_0x715f('0x24')](respondWithFilteredResult(_0x5a4c7f,_0x5d4185))['catch'](handleError(_0x5a4c7f,null));};exports['show']=function(_0x5d8af1,_0x56429c){var _0x1cd548={'raw':!![],'where':{'id':_0x5d8af1[_0x715f('0x40')]['id']}},_0xb8495d={};_0xb8495d[_0x715f('0x2c')]=_[_0x715f('0x2f')](db['WhatsappTransferReport'][_0x715f('0x2a')]);_0xb8495d[_0x715f('0x2e')]=_[_0x715f('0x2f')](_0x5d8af1['query']);_0xb8495d[_0x715f('0x30')]=_[_0x715f('0x41')](_0xb8495d['model'],_0xb8495d[_0x715f('0x2e')]);_0x1cd548[_0x715f('0x31')]=_[_0x715f('0x41')](_0xb8495d[_0x715f('0x2c')],qs[_0x715f('0x32')](_0x5d8af1[_0x715f('0x2e')][_0x715f('0x32')]));_0x1cd548[_0x715f('0x31')]=_0x1cd548[_0x715f('0x31')][_0x715f('0x33')]?_0x1cd548['attributes']:_0xb8495d[_0x715f('0x2c')];if(_0x5d8af1[_0x715f('0x2e')]['includeAll']){_0x1cd548[_0x715f('0x3d')]=[{'all':!![]}];}_0x1cd548=_[_0x715f('0x3b')]({},_0x1cd548,_0x5d8af1[_0x715f('0x42')]);return db[_0x715f('0x29')]['find'](_0x1cd548)[_0x715f('0x24')](handleEntityNotFound(_0x56429c,null))[_0x715f('0x24')](respondWithResult(_0x56429c,null))[_0x715f('0x43')](handleError(_0x56429c,null));};exports[_0x715f('0x44')]=function(_0x32a38f,_0x39048c){return db[_0x715f('0x29')][_0x715f('0x44')](_0x32a38f[_0x715f('0x45')],{})[_0x715f('0x24')](respondWithResult(_0x39048c,0xc9))[_0x715f('0x43')](handleError(_0x39048c,null));};exports[_0x715f('0x46')]=function(_0xd869bc,_0x299157){if(_0xd869bc['body']['id']){delete _0xd869bc['body']['id'];}return db[_0x715f('0x29')][_0x715f('0x47')]({'where':{'id':_0xd869bc[_0x715f('0x40')]['id']}})[_0x715f('0x24')](handleEntityNotFound(_0x299157,null))[_0x715f('0x24')](saveUpdates(_0xd869bc['body'],null))[_0x715f('0x24')](respondWithResult(_0x299157,null))[_0x715f('0x43')](handleError(_0x299157,null));};exports['destroy']=function(_0x1a297b,_0x4fbab0){return db[_0x715f('0x29')][_0x715f('0x47')]({'where':{'id':_0x1a297b[_0x715f('0x40')]['id']}})[_0x715f('0x24')](handleEntityNotFound(_0x4fbab0,null))[_0x715f('0x24')](removeEntity(_0x4fbab0,null))[_0x715f('0x43')](handleError(_0x4fbab0,null));};exports[_0x715f('0x48')]=function(_0x410db3,_0x41be6e){return db[_0x715f('0x29')][_0x715f('0x48')]()['then'](respondWithResult(_0x41be6e,null))[_0x715f('0x43')](handleError(_0x41be6e,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 0ab619d..5ff4708 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 _0x6ba8=['uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./whatsappTransferReport.attributes','define'];(function(_0x1c1a23,_0x3c2672){var _0x2da98c=function(_0x174da9){while(--_0x174da9){_0x1c1a23['push'](_0x1c1a23['shift']());}};_0x2da98c(++_0x3c2672);}(_0x6ba8,0x1ae));var _0x86ba=function(_0x191fc1,_0x5055b6){_0x191fc1=_0x191fc1-0x0;var _0x4b0db9=_0x6ba8[_0x191fc1];return _0x4b0db9;};'use strict';var _=require(_0x86ba('0x0'));var util=require(_0x86ba('0x1'));var logger=require(_0x86ba('0x2'))('api');var moment=require(_0x86ba('0x3'));var BPromise=require(_0x86ba('0x4'));var rp=require(_0x86ba('0x5'));var fs=require('fs');var path=require(_0x86ba('0x6'));var rimraf=require('rimraf');var config=require(_0x86ba('0x7'));var attributes=require(_0x86ba('0x8'));module['exports']=function(_0x1e6803,_0x20ecf1){return _0x1e6803[_0x86ba('0x9')]('WhatsappTransferReport',attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0x86ba('0xa'),'fields':[_0x86ba('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x080e=['exports','WhatsappTransferReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappTransferReport.attributes'];(function(_0x16629d,_0x492375){var _0x56ccee=function(_0xa982b7){while(--_0xa982b7){_0x16629d['push'](_0x16629d['shift']());}};_0x56ccee(++_0x492375);}(_0x080e,0x199));var _0xe080=function(_0x3fbc6a,_0x1f1133){_0x3fbc6a=_0x3fbc6a-0x0;var _0x524a7c=_0x080e[_0x3fbc6a];return _0x524a7c;};'use strict';var _=require(_0xe080('0x0'));var util=require(_0xe080('0x1'));var logger=require(_0xe080('0x2'))(_0xe080('0x3'));var moment=require(_0xe080('0x4'));var BPromise=require(_0xe080('0x5'));var rp=require(_0xe080('0x6'));var fs=require('fs');var path=require(_0xe080('0x7'));var rimraf=require(_0xe080('0x8'));var config=require(_0xe080('0x9'));var attributes=require(_0xe080('0xa'));module[_0xe080('0xb')]=function(_0x49e285,_0x46f847){return _0x49e285['define'](_0xe080('0xc'),attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0xe080('0xd'),'fields':[_0xe080('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 8460cbc..bc82be7 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 _0x44b2=['code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x50a635,_0x158de3){var _0x15fcdf=function(_0x16342e){while(--_0x16342e){_0x50a635['push'](_0x50a635['shift']());}};_0x15fcdf(++_0x158de3);}(_0x44b2,0x12f));var _0x244b=function(_0x83c716,_0x25152d){_0x83c716=_0x83c716-0x0;var _0xab9893=_0x44b2[_0x83c716];return _0xab9893;};'use strict';var _=require('lodash');var util=require(_0x244b('0x0'));var moment=require(_0x244b('0x1'));var BPromise=require('bluebird');var rs=require(_0x244b('0x2'));var fs=require('fs');var Redis=require(_0x244b('0x3'));var db=require(_0x244b('0x4'))['db'];var utils=require(_0x244b('0x5'));var logger=require(_0x244b('0x6'))(_0x244b('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x244b('0x8')][_0x244b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3a92e2,_0x3387b6,_0x1c0c4d){return new BPromise(function(_0x4df6a1,_0x3223cd){return client[_0x244b('0xa')](_0x3a92e2,_0x1c0c4d)[_0x244b('0xb')](function(_0xf33aed){logger[_0x244b('0xc')](_0x244b('0xd'),_0x3387b6,_0x244b('0xe'));logger[_0x244b('0xf')](_0x244b('0x10'),_0x3387b6,_0x244b('0xe'),JSON[_0x244b('0x11')](_0xf33aed));if(_0xf33aed['error']){if(_0xf33aed[_0x244b('0x12')][_0x244b('0x13')]===0x1f4){logger[_0x244b('0x12')](_0x244b('0xd'),_0x3387b6,_0xf33aed[_0x244b('0x12')][_0x244b('0x14')]);return _0x3223cd(_0xf33aed[_0x244b('0x12')][_0x244b('0x14')]);}logger[_0x244b('0x12')](_0x244b('0xd'),_0x3387b6,_0xf33aed[_0x244b('0x12')][_0x244b('0x14')]);return _0x4df6a1(_0xf33aed[_0x244b('0x12')]['message']);}else{logger[_0x244b('0xc')]('WhatsappTransferReport,\x20%s,\x20%s',_0x3387b6,_0x244b('0xe'));_0x4df6a1(_0xf33aed[_0x244b('0x15')]['message']);}})[_0x244b('0x16')](function(_0x44ea9a){logger[_0x244b('0x12')]('WhatsappTransferReport,\x20%s,\x20%s',_0x3387b6,_0x44ea9a);_0x3223cd(_0x44ea9a);});});} \ No newline at end of file +var _0x678a=['request\x20sent','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0xc69383,_0x1f255f){var _0x1abdfa=function(_0xbd5596){while(--_0xbd5596){_0xc69383['push'](_0xc69383['shift']());}};_0x1abdfa(++_0x1f255f);}(_0x678a,0xde));var _0xa678=function(_0x4182f3,_0x47c36f){_0x4182f3=_0x4182f3-0x0;var _0x1c0301=_0x678a[_0x4182f3];return _0x1c0301;};'use strict';var _=require('lodash');var util=require(_0xa678('0x0'));var moment=require(_0xa678('0x1'));var BPromise=require(_0xa678('0x2'));var rs=require(_0xa678('0x3'));var fs=require('fs');var Redis=require(_0xa678('0x4'));var db=require(_0xa678('0x5'))['db'];var utils=require(_0xa678('0x6'));var logger=require(_0xa678('0x7'))(_0xa678('0x8'));var config=require(_0xa678('0x9'));var jayson=require(_0xa678('0xa'));var client=jayson['client'][_0xa678('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x520dbb,_0x2c603d,_0x5a07fb){return new BPromise(function(_0x3dbc71,_0x2d2f8b){return client[_0xa678('0xc')](_0x520dbb,_0x5a07fb)[_0xa678('0xd')](function(_0x5d6aef){logger[_0xa678('0xe')](_0xa678('0xf'),_0x2c603d,'request\x20sent');logger[_0xa678('0x10')](_0xa678('0x11'),_0x2c603d,_0xa678('0x12'),JSON[_0xa678('0x13')](_0x5d6aef));if(_0x5d6aef[_0xa678('0x14')]){if(_0x5d6aef[_0xa678('0x14')][_0xa678('0x15')]===0x1f4){logger[_0xa678('0x14')]('WhatsappTransferReport,\x20%s,\x20%s',_0x2c603d,_0x5d6aef['error'][_0xa678('0x16')]);return _0x2d2f8b(_0x5d6aef[_0xa678('0x14')][_0xa678('0x16')]);}logger['error'](_0xa678('0xf'),_0x2c603d,_0x5d6aef[_0xa678('0x14')]['message']);return _0x3dbc71(_0x5d6aef[_0xa678('0x14')][_0xa678('0x16')]);}else{logger[_0xa678('0xe')](_0xa678('0xf'),_0x2c603d,_0xa678('0x12'));_0x3dbc71(_0x5d6aef['result'][_0xa678('0x16')]);}})[_0xa678('0x17')](function(_0x467f6c){logger[_0xa678('0x14')](_0xa678('0xf'),_0x2c603d,_0x467f6c);_0x2d2f8b(_0x467f6c);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 997749f..71ca258 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa992=['lodash','./mysqldb','./config/seedDB','./config/license','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sync','then','seedDB','default','listen','info','start','exitCode','number','map','name','Online\x20apps:','online','join','Offline\x20apps:','filter','status','None','log','App\x20Ready!','catch','exit'];(function(_0x185ed2,_0xb1564a){var _0x11d850=function(_0xfecc87){while(--_0xfecc87){_0x185ed2['push'](_0x185ed2['shift']());}};_0x11d850(++_0xb1564a);}(_0xa992,0x18c));var _0x2a99=function(_0x6c4cb3,_0x5955ba){_0x6c4cb3=_0x6c4cb3-0x0;var _0x27adc9=_0xa992[_0x6c4cb3];return _0x27adc9;};'use strict';var _=require(_0x2a99('0x0'));var db=require(_0x2a99('0x1'))['db'];var seedDb=require(_0x2a99('0x2'));var checkLicense=require(_0x2a99('0x3'));var rpc=require('./rpc');var config=require(_0x2a99('0x4'));var logger=require(_0x2a99('0x5'))(_0x2a99('0x6'));var pm2=require(_0x2a99('0x7'));var pm2Config=require(_0x2a99('0x8'));var schedule=require(_0x2a99('0x9'));var chat=require(_0x2a99('0xa'));var whatsapp=require(_0x2a99('0xb'));var transcribe=require(_0x2a99('0xc'));var provider=require(_0x2a99('0xd'));function main(){return db['sequelize'][_0x2a99('0xe')]()[_0x2a99('0xf')](function(){if(config[_0x2a99('0x10')]){return seedDb[_0x2a99('0x11')]();}})[_0x2a99('0xf')](function(){return checkLicense[_0x2a99('0x11')]();})[_0x2a99('0xf')](function(){return rpc[_0x2a99('0x12')]();})[_0x2a99('0xf')](function(_0x1e30f4){logger[_0x2a99('0x13')](_0x1e30f4);return chat['start']();})['then'](function(){return whatsapp[_0x2a99('0x14')]();})[_0x2a99('0xf')](function(){return schedule[_0x2a99('0x14')]();})[_0x2a99('0xf')](function(){return transcribe[_0x2a99('0x14')]();})[_0x2a99('0xf')](function(){return provider['start']();})[_0x2a99('0xf')](function(_0x1f0e4c){logger[_0x2a99('0x13')](_0x1f0e4c);return pm2[_0x2a99('0x14')](pm2Config);})[_0x2a99('0xf')](function(_0x5f2cfa){var _0x2ad1c9=_0x5f2cfa['filter'](function(_0x5cbe7b){return typeof _0x5cbe7b[_0x2a99('0x15')]===_0x2a99('0x16')&&_0x5cbe7b[_0x2a99('0x15')]>=0x0;});if(_0x2ad1c9['length']>0x0){throw new Error(_0x2ad1c9['length']+'\x20processes\x20failed\x20at\x20startup:\x20'+_[_0x2a99('0x17')](_0x2ad1c9,function(_0x4346c4){return'\x22'+_0x4346c4['pm2_env'][_0x2a99('0x18')]+'\x22';}));}logger[_0x2a99('0x13')](_0x2a99('0x19'),_[_0x2a99('0x17')](_['filter'](_0x5f2cfa,{'status':_0x2a99('0x1a')}),_0x2a99('0x18'))[_0x2a99('0x1b')]());logger[_0x2a99('0x13')](_0x2a99('0x1c'),_['map'](_[_0x2a99('0x1d')](_0x5f2cfa,function(_0x281efc){return _0x281efc[_0x2a99('0x1e')]!==_0x2a99('0x1a');}),_0x2a99('0x18'))[_0x2a99('0x1b')]()||_0x2a99('0x1f'));console[_0x2a99('0x20')](_0x2a99('0x21'));})[_0x2a99('0x22')](function(_0x4a99fe){console[_0x2a99('0x20')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error!',_0x4a99fe);logger['error']('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x4a99fe);process[_0x2a99('0x23')](0x1);});}main(); \ No newline at end of file +var _0x3dd6=['online','join','status','None','log','App\x20Ready!','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','./config/license','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/schedule','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','sync','seedDB','default','then','info','start','filter','exitCode','length','map','pm2_env','name','Online\x20apps:'];(function(_0x459820,_0x50202a){var _0x1d0c05=function(_0x3fb2ce){while(--_0x3fb2ce){_0x459820['push'](_0x459820['shift']());}};_0x1d0c05(++_0x50202a);}(_0x3dd6,0xcf));var _0x63dd=function(_0x22b98c,_0x3cc5dc){_0x22b98c=_0x22b98c-0x0;var _0x5e846e=_0x3dd6[_0x22b98c];return _0x5e846e;};'use strict';var _=require('lodash');var db=require('./mysqldb')['db'];var seedDb=require('./config/seedDB');var checkLicense=require(_0x63dd('0x0'));var rpc=require(_0x63dd('0x1'));var config=require(_0x63dd('0x2'));var logger=require(_0x63dd('0x3'))(_0x63dd('0x4'));var pm2=require(_0x63dd('0x5'));var pm2Config=require('./config/pm2/config');var schedule=require(_0x63dd('0x6'));var chat=require('./config/schedule/chat');var whatsapp=require(_0x63dd('0x7'));var transcribe=require(_0x63dd('0x8'));var provider=require(_0x63dd('0x9'));function main(){return db[_0x63dd('0xa')][_0x63dd('0xb')]()['then'](function(){if(config[_0x63dd('0xc')]){return seedDb[_0x63dd('0xd')]();}})[_0x63dd('0xe')](function(){return checkLicense[_0x63dd('0xd')]();})['then'](function(){return rpc['listen']();})[_0x63dd('0xe')](function(_0x1508c4){logger[_0x63dd('0xf')](_0x1508c4);return chat[_0x63dd('0x10')]();})[_0x63dd('0xe')](function(){return whatsapp['start']();})[_0x63dd('0xe')](function(){return schedule[_0x63dd('0x10')]();})[_0x63dd('0xe')](function(){return transcribe[_0x63dd('0x10')]();})['then'](function(){return provider[_0x63dd('0x10')]();})[_0x63dd('0xe')](function(_0x3ed4ea){logger[_0x63dd('0xf')](_0x3ed4ea);return pm2[_0x63dd('0x10')](pm2Config);})[_0x63dd('0xe')](function(_0x56c030){var _0x5b2f9f=_0x56c030[_0x63dd('0x11')](function(_0xa6ffcf){return typeof _0xa6ffcf[_0x63dd('0x12')]==='number'&&_0xa6ffcf[_0x63dd('0x12')]>=0x0;});if(_0x5b2f9f[_0x63dd('0x13')]>0x0){throw new Error(_0x5b2f9f[_0x63dd('0x13')]+'\x20processes\x20failed\x20at\x20startup:\x20'+_[_0x63dd('0x14')](_0x5b2f9f,function(_0x368f85){return'\x22'+_0x368f85[_0x63dd('0x15')][_0x63dd('0x16')]+'\x22';}));}logger[_0x63dd('0xf')](_0x63dd('0x17'),_[_0x63dd('0x14')](_[_0x63dd('0x11')](_0x56c030,{'status':_0x63dd('0x18')}),_0x63dd('0x16'))[_0x63dd('0x19')]());logger[_0x63dd('0xf')]('Offline\x20apps:',_[_0x63dd('0x14')](_['filter'](_0x56c030,function(_0x466dac){return _0x466dac[_0x63dd('0x1a')]!==_0x63dd('0x18');}),'name')[_0x63dd('0x19')]()||_0x63dd('0x1b'));console[_0x63dd('0x1c')](_0x63dd('0x1d'));})[_0x63dd('0x1e')](function(_0x147928){console[_0x63dd('0x1c')](_0x63dd('0x1f'),_0x147928);logger[_0x63dd('0x20')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x147928);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 24dddb6..dc9dc95 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 _0x7910=['isMiddleware','signToken','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','role','motion.token','/dashboards/general','send','retrieveApiKey','isNil','apiKeyNonce','generateApiKey','apiKeyIat','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split','toLowerCase','format','Sequelize','length','splice','encryptString','promisify','sign','secret','payload','options','verify','randomBytes','toString','floor','now','HS512','../../config/license/util','../encryptor','express-jwt','composable-middleware','basic-auth','crypto','bluebird','util','moment','secrets','session','fullname','internal','email','userpic','permissions','voicePause','chatPause','mailPause','faxPause','pauseType','lastLoginAt','lastPauseAt','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','isAuthenticated','user','findOne','closed','disposition','status','unmanaged','Unmanaged.','Forbidden.','catch','use','headers','authorization','Basic','find','name','then','authenticate','pass','json','Wrong\x20credentials.','startsWith','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','User','sub','Setting','allowedLoginAttempts','blockDuration','isEqual','nonce','Invalid\x20API\x20access\x20key','blocked','add','minutes','User\x20not\x20found.','User\x20object\x20not\x20found.','getLicense','update','Forbidden','isWebrtcLicence','webrtc'];(function(_0x4f4d19,_0x574245){var _0x27a258=function(_0x38da3e){while(--_0x38da3e){_0x4f4d19['push'](_0x4f4d19['shift']());}};_0x27a258(++_0x574245);}(_0x7910,0x19e));var _0x0791=function(_0x30a31e,_0x31f766){_0x30a31e=_0x30a31e-0x0;var _0x170879=_0x7910[_0x30a31e];return _0x170879;};'use strict';var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var hardwareConf=require('../../config/license/hardware');var licenseUtil=require(_0x0791('0x0'));var encryptor=require(_0x0791('0x1'));var _=require('lodash');var jwt=require('jsonwebtoken');var expressJwt=require(_0x0791('0x2'));var compose=require(_0x0791('0x3'));var basicAuth=require(_0x0791('0x4'));var crypto=require(_0x0791('0x5'));var BPromise=require(_0x0791('0x6'));var util=require(_0x0791('0x7'));var moment=require(_0x0791('0x8'));var validateJwt=expressJwt({'secret':config[_0x0791('0x9')][_0x0791('0xa')]});var userAttributes=['id','role',_0x0791('0xb'),'name',_0x0791('0xc'),_0x0791('0xd'),_0x0791('0xe'),_0x0791('0xf'),'md5secret',_0x0791('0x10'),_0x0791('0x11'),_0x0791('0x12'),_0x0791('0x13'),'smsPause','openchannelPause',_0x0791('0x14'),'showWebBar',_0x0791('0x15'),_0x0791('0x16'),'crudPermissions',_0x0791('0x17'),_0x0791('0x18'),_0x0791('0x19'),_0x0791('0x1a'),_0x0791('0x1b'),'phoneBarDnd',_0x0791('0x1c'),'phoneBarEnableDtmfTone',_0x0791('0x1d'),_0x0791('0x1e'),_0x0791('0x1f'),_0x0791('0x20'),_0x0791('0x21'),_0x0791('0x22'),_0x0791('0x23'),_0x0791('0x24'),_0x0791('0x25'),_0x0791('0x26'),_0x0791('0x27'),_0x0791('0x28'),_0x0791('0x29'),_0x0791('0x2a'),_0x0791('0x2b'),_0x0791('0x2c')];exports['isChatInteractionAuthorized']=function(){return this[_0x0791('0x2d')](!![])['use'](function(_0x273861,_0x29e456,_0x129b52){if(_0x273861[_0x0791('0x2e')]){_0x129b52();}else{return db['ChatInteraction'][_0x0791('0x2f')]({'where':{'id':_0x273861['params']['id']},'attributes':['id',_0x0791('0x30'),_0x0791('0x31')],'raw':!![]})['then'](function(_0x30b151){if(_0x30b151&&_0x30b151[_0x0791('0x30')]){return _0x29e456[_0x0791('0x32')](_0x30b151[_0x0791('0x31')]==='unmanaged'?0x195:0x193)['json']({'message':_0x30b151[_0x0791('0x31')]===_0x0791('0x33')?_0x0791('0x34'):_0x0791('0x35')});}else{_0x129b52();}})[_0x0791('0x36')](function(_0x434163){_0x129b52(_0x434163);});}});};exports[_0x0791('0x2d')]=function isAuthenticated(_0x5e8962){return compose()[_0x0791('0x37')](function(_0x38a983,_0x39309a,_0x4cc096){var _0x3f8abe;if(_0x38a983[_0x0791('0x38')]['authorization']){if(_['startsWith'](_0x38a983[_0x0791('0x38')][_0x0791('0x39')],_0x0791('0x3a'))){var _0x25a864=basicAuth(_0x38a983);db['User'][_0x0791('0x3b')]({'where':{'name':_0x25a864[_0x0791('0x3c')]}})[_0x0791('0x3d')](function(_0xc852d3){if(!_0xc852d3||!_0xc852d3[_0x0791('0x3e')](_0x25a864[_0x0791('0x3f')])){return _0x39309a['status'](0x191)[_0x0791('0x40')]({'message':_0x0791('0x41')});}_0x38a983['user']={'id':_0xc852d3['id']};_0x4cc096();})[_0x0791('0x36')](function(_0x44e0cd){_0x4cc096(_0x44e0cd);});}else if(_[_0x0791('0x42')](_0x38a983[_0x0791('0x38')][_0x0791('0x39')],_0x0791('0x43'))){validateJwt(_0x38a983,_0x39309a,_0x4cc096);}else{if(_0x5e8962){_0x4cc096();}else{return _0x39309a['status'](0x193)[_0x0791('0x40')]({'message':_0x0791('0x44')});}}}else if(_0x38a983[_0x0791('0x45')][_0x0791('0x46')]){try{var _0x453262={'audience':hardwareConf[_0x0791('0x47')](),'issuer':hardwareConf[_0x0791('0x47')]()};verifyJwt(_0x38a983[_0x0791('0x45')][_0x0791('0x46')],_0x453262)[_0x0791('0x3d')](function(_0x5c69af){return db[_0x0791('0x48')][_0x0791('0x3b')]({'where':{'id':_0x5c69af[_0x0791('0x49')]}})[_0x0791('0x3d')](function(_0x173c27){_0x3f8abe=_0x173c27;return db[_0x0791('0x4a')]['findOne']({'where':{'id':0x1},'attributes':[_0x0791('0x4b'),_0x0791('0x4c')],'raw':!![]});})[_0x0791('0x3d')](function(_0x4efc87){if(!_0x3f8abe||!_[_0x0791('0x4d')](_0x3f8abe['apiKeyNonce'],_0x5c69af[_0x0791('0x4e')])){return _0x39309a[_0x0791('0x32')](0x191)[_0x0791('0x40')]({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x3f8abe['disabled']){return _0x39309a['status'](0x191)[_0x0791('0x40')]({'message':_0x0791('0x4f')});}if(_0x3f8abe[_0x0791('0x50')]){if(_0x4efc87[_0x0791('0x4c')]>0x0){if(moment(_0x3f8abe['blockedAt'])[_0x0791('0x51')](_0x4efc87[_0x0791('0x4c')],_0x0791('0x52'))>moment()){return _0x39309a[_0x0791('0x32')](0x191)[_0x0791('0x40')]({'message':_0x0791('0x4f')});}}else{return _0x39309a[_0x0791('0x32')](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});}}_0x38a983[_0x0791('0x2e')]={'id':_0x3f8abe['id']};_0x4cc096();});})[_0x0791('0x36')](function(){return _0x39309a[_0x0791('0x32')](0x191)[_0x0791('0x40')]({'message':_0x0791('0x4f')});});}catch(_0x5054b5){_0x4cc096(_0x5054b5);}}else if(_0x5e8962){_0x4cc096();}else{return _0x39309a['status'](0x193)[_0x0791('0x40')]({'message':_0x0791('0x44')});}})[_0x0791('0x37')](function(_0x4f142a,_0x319f48,_0x11313e){if(_0x4f142a['user']){db[_0x0791('0x48')]['find']({'where':{'id':_0x4f142a[_0x0791('0x2e')]['id']},'attributes':userAttributes})[_0x0791('0x3d')](function(_0x49cb66){if(!_0x49cb66){return _0x319f48[_0x0791('0x32')](0x194)[_0x0791('0x40')]({'message':_0x0791('0x53')});}_0x4f142a[_0x0791('0x2e')]=_0x49cb66;_0x11313e();})['catch'](function(_0x1c5efe){_0x11313e(_0x1c5efe);});}else if(_0x5e8962){_0x11313e();}else{return _0x319f48['status'](0x194)[_0x0791('0x40')]({'message':_0x0791('0x54')});}});};exports['canUpdate']=function canUpdate(){return compose()[_0x0791('0x37')](function(_0x197edb,_0x435d07,_0x28c8d2){return licenseUtil[_0x0791('0x55')]()[_0x0791('0x3d')](function(_0x89047d){if(_0x89047d[_0x0791('0x56')]){_0x28c8d2();}else{return _0x435d07[_0x0791('0x32')](0x193)['json']({'message':_0x0791('0x57')});}})['catch'](function(_0x18f674){_0x28c8d2(_0x18f674);});});};exports[_0x0791('0x58')]=function isWebrtcLicence(){return compose()['use'](function(_0x123332,_0x5437a8,_0x5f51c1){return licenseUtil[_0x0791('0x55')]()[_0x0791('0x3d')](function(_0x643b12){if(_0x643b12[_0x0791('0x59')]){_0x5f51c1();}else{return _0x5437a8[_0x0791('0x32')](0x193)[_0x0791('0x40')]({'message':_0x0791('0x57')});}})['catch'](function(_0x1d9a24){_0x5f51c1(_0x1d9a24);});});};exports['isMiddleware']=function(_0x27a50b,_0x521634,_0x48eef8){_0x27a50b[_0x0791('0x5a')]=!![];return _0x48eef8();};exports[_0x0791('0x5b')]=function signToken(_0x45239c){return signJwt(_0x45239c);};exports['setTokenCookie']=function(_0x3a2b13,_0x5cebe9){if(!_0x3a2b13[_0x0791('0x2e')]){return _0x5cebe9['status'](0x194)['json']({'message':_0x0791('0x5c')});}var _0x5f23cd={'payload':{'id':_0x3a2b13[_0x0791('0x2e')]['id'],'role':_0x3a2b13['user'][_0x0791('0x5d')]},'options':{'expiresIn':0x15180}};return signJwt(_0x5f23cd)[_0x0791('0x3d')](function(_0x4e967a){_0x5cebe9['cookie'](_0x0791('0x5e'),_0x4e967a);_0x5cebe9['redirect'](_0x0791('0x5f'));})[_0x0791('0x36')](function(_0x10d02f){return _0x5cebe9[_0x0791('0x32')](0x1f4)[_0x0791('0x60')](_0x10d02f);});};exports[_0x0791('0x61')]=function(_0x343fec){if(_[_0x0791('0x62')](_0x343fec[_0x0791('0x63')])||_[_0x0791('0x62')](_0x343fec['apiKeyIat'])){return null;}else{return createJwt(_0x343fec);}};exports[_0x0791('0x64')]=function(_0x31d505){_0x31d505['apiKeyNonce']=generateNonce();_0x31d505[_0x0791('0x65')]=generateIssuedAt();return createJwt(_0x31d505);};exports['regenerateApiKey']=function(_0x3cf192,_0x3e9e35){var _0x5ed56b=_0x3cf192[_0x0791('0x45')]['apikey'];if(_0x5ed56b){var _0x1a099b={'nonce':_0x3e9e35[_0x0791('0x63')],'iat':_0x3e9e35[_0x0791('0x65')],'audience':hardwareConf[_0x0791('0x47')](),'issuer':hardwareConf[_0x0791('0x47')]()};return verifyJwt(_0x5ed56b,_0x1a099b)[_0x0791('0x3d')](function(){return generateApiKey(_0x3e9e35);});}else{throw{'message':_0x0791('0x66')};}};exports['validatePasswordPattern']=function(_0xbbe779){var _0x51f681=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x51f681[_0x0791('0x67')](_0xbbe779))throw new db['Sequelize'][(_0x0791('0x68'))](_0x0791('0x69'));return;};exports[_0x0791('0x6a')]=function(_0x5b990f,_0x2997bc,_0x8531a0){var _0x1dd29b=encryptor[_0x0791('0x6b')](_0x2997bc)[_0x0791('0x6c')](',');for(var _0x4a78ba=0x0;_0x4a78ba<_0x8531a0;_0x4a78ba++){if(!_0x1dd29b[_0x4a78ba])break;if(_0x5b990f[_0x0791('0x6d')]()===_0x1dd29b[_0x4a78ba]['toLowerCase']()){var _0x253886=util[_0x0791('0x6e')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x8531a0);if(_0x8531a0===0x1){_0x253886='The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.';}throw new db[(_0x0791('0x6f'))][(_0x0791('0x68'))](_0x253886);}}return;};exports['updatePasswordsHistory']=function(_0x529665,_0x496b3d){var _0x133ca5=_0x496b3d?encryptor[_0x0791('0x6b')](_0x496b3d)['split'](','):[];if(_0x133ca5[_0x0791('0x70')]===0x5){_0x133ca5[_0x0791('0x71')](-0x1,0x1);}_0x133ca5['unshift'](_0x529665);return encryptor[_0x0791('0x72')](_0x133ca5['join'](','));};function signJwt(_0x5ed9aa){var _0x33c08b=BPromise[_0x0791('0x73')](jwt[_0x0791('0x74')],{'context':jwt});var _0x46d7e1=_0x5ed9aa[_0x0791('0x75')]||config[_0x0791('0x9')]['session'];return new BPromise(function(_0x4b3f31,_0x121eb4){_0x33c08b(_0x5ed9aa[_0x0791('0x76')],_0x46d7e1,_0x5ed9aa[_0x0791('0x77')])['then'](function(_0x42fe0f){_0x4b3f31(_0x42fe0f);})[_0x0791('0x36')](function(_0x1d691a){_0x121eb4(_0x1d691a);});});}function verifyJwt(_0x27e91e,_0x2c9623,_0x514f86){var _0x1f2f6c=BPromise[_0x0791('0x73')](jwt[_0x0791('0x78')],{'context':jwt});var _0x4c0563=_0x514f86||config[_0x0791('0x9')][_0x0791('0xa')];return new BPromise(function(_0x130530,_0x44be61){_0x1f2f6c(_0x27e91e,_0x4c0563,_0x2c9623)['then'](function(_0x1b380b){_0x130530(_0x1b380b);})['catch'](function(_0x5de364){_0x44be61(_0x5de364);});});}function generateNonce(){return crypto[_0x0791('0x79')](0x10)[_0x0791('0x7a')]('hex');}function generateIssuedAt(){return Math[_0x0791('0x7b')](Date[_0x0791('0x7c')]()/0x3e8)[_0x0791('0x7a')]();}function createJwt(_0x1d3cfe){var _0x2e186f={'payload':{'iat':_0x1d3cfe[_0x0791('0x65')],'nonce':_0x1d3cfe[_0x0791('0x63')]},'options':{'algorithm':_0x0791('0x7d'),'subject':_0x1d3cfe['id'][_0x0791('0x7a')](),'issuer':hardwareConf[_0x0791('0x47')](),'audience':hardwareConf[_0x0791('0x47')]()}};return signJwt(_0x2e186f)[_0x0791('0x3d')](function(_0x5eee0d){return{'iat':_0x1d3cfe[_0x0791('0x65')],'nonce':_0x1d3cfe[_0x0791('0x63')],'token':_0x5eee0d};});} \ No newline at end of file +var _0xd52d=['getUuid','sub','Setting','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockDuration','blockedAt','add','minutes','user','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','webrtc','isMiddleware','signToken','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','validatePasswordHistory','decryptString','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','updatePasswordsHistory','split','length','unshift','encryptString','join','promisify','sign','secret','verify','session','randomBytes','toString','floor','HS512','../../config/environment','../../config/license/hardware','../encryptor','express-jwt','composable-middleware','basic-auth','crypto','bluebird','util','moment','secrets','role','fullname','name','internal','email','userpic','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','userProfileId','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','ignorePauseForPreviewCalls','selectRecallMeCampaign','isChatInteractionAuthorized','isAuthenticated','ChatInteraction','findOne','closed','then','status','disposition','unmanaged','json','Unmanaged.','catch','use','headers','authorization','User','find','authenticate','pass','Wrong\x20credentials.','startsWith','Bearer','Unknown\x20authorization\x20format','query','apikey'];(function(_0x57d213,_0x47ec3b){var _0x5b9d7d=function(_0x141612){while(--_0x141612){_0x57d213['push'](_0x57d213['shift']());}};_0x5b9d7d(++_0x47ec3b);}(_0xd52d,0x1c7));var _0xdd52=function(_0x17a345,_0x3badfd){_0x17a345=_0x17a345-0x0;var _0x59a3a8=_0xd52d[_0x17a345];return _0x59a3a8;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0xdd52('0x0'));var hardwareConf=require(_0xdd52('0x1'));var licenseUtil=require('../../config/license/util');var encryptor=require(_0xdd52('0x2'));var _=require('lodash');var jwt=require('jsonwebtoken');var expressJwt=require(_0xdd52('0x3'));var compose=require(_0xdd52('0x4'));var basicAuth=require(_0xdd52('0x5'));var crypto=require(_0xdd52('0x6'));var BPromise=require(_0xdd52('0x7'));var util=require(_0xdd52('0x8'));var moment=require(_0xdd52('0x9'));var validateJwt=expressJwt({'secret':config[_0xdd52('0xa')]['session']});var userAttributes=['id',_0xdd52('0xb'),_0xdd52('0xc'),_0xdd52('0xd'),_0xdd52('0xe'),_0xdd52('0xf'),_0xdd52('0x10'),_0xdd52('0x11'),_0xdd52('0x12'),_0xdd52('0x13'),_0xdd52('0x14'),_0xdd52('0x15'),_0xdd52('0x16'),_0xdd52('0x17'),'openchannelPause',_0xdd52('0x18'),_0xdd52('0x19'),_0xdd52('0x1a'),_0xdd52('0x1b'),_0xdd52('0x1c'),_0xdd52('0x1d'),'passwordResetAt',_0xdd52('0x1e'),_0xdd52('0x1f'),_0xdd52('0x20'),'phoneBarDnd',_0xdd52('0x21'),_0xdd52('0x22'),_0xdd52('0x23'),_0xdd52('0x24'),_0xdd52('0x25'),_0xdd52('0x26'),_0xdd52('0x27'),_0xdd52('0x28'),'interface',_0xdd52('0x29'),'privacyEnabled',_0xdd52('0x2a'),_0xdd52('0x2b'),_0xdd52('0x2c'),_0xdd52('0x2d'),'downloadAttachments',_0xdd52('0x2e'),_0xdd52('0x2f')];exports[_0xdd52('0x30')]=function(){return this[_0xdd52('0x31')](!![])['use'](function(_0xb81a36,_0x4d8a9c,_0x305cab){if(_0xb81a36['user']){_0x305cab();}else{return db[_0xdd52('0x32')][_0xdd52('0x33')]({'where':{'id':_0xb81a36['params']['id']},'attributes':['id',_0xdd52('0x34'),'disposition'],'raw':!![]})[_0xdd52('0x35')](function(_0x59a041){if(_0x59a041&&_0x59a041[_0xdd52('0x34')]){return _0x4d8a9c[_0xdd52('0x36')](_0x59a041[_0xdd52('0x37')]===_0xdd52('0x38')?0x195:0x193)[_0xdd52('0x39')]({'message':_0x59a041[_0xdd52('0x37')]===_0xdd52('0x38')?_0xdd52('0x3a'):'Forbidden.'});}else{_0x305cab();}})[_0xdd52('0x3b')](function(_0xe8a5bc){_0x305cab(_0xe8a5bc);});}});};exports['isAuthenticated']=function isAuthenticated(_0x1156cc){return compose()[_0xdd52('0x3c')](function(_0x43ef06,_0x2f2dfa,_0x4ee66d){var _0x41c7e5;if(_0x43ef06[_0xdd52('0x3d')][_0xdd52('0x3e')]){if(_['startsWith'](_0x43ef06['headers'][_0xdd52('0x3e')],'Basic')){var _0x38b4ae=basicAuth(_0x43ef06);db[_0xdd52('0x3f')][_0xdd52('0x40')]({'where':{'name':_0x38b4ae['name']}})['then'](function(_0x2a0a2d){if(!_0x2a0a2d||!_0x2a0a2d[_0xdd52('0x41')](_0x38b4ae[_0xdd52('0x42')])){return _0x2f2dfa['status'](0x191)['json']({'message':_0xdd52('0x43')});}_0x43ef06['user']={'id':_0x2a0a2d['id']};_0x4ee66d();})[_0xdd52('0x3b')](function(_0x271353){_0x4ee66d(_0x271353);});}else if(_[_0xdd52('0x44')](_0x43ef06[_0xdd52('0x3d')][_0xdd52('0x3e')],_0xdd52('0x45'))){validateJwt(_0x43ef06,_0x2f2dfa,_0x4ee66d);}else{if(_0x1156cc){_0x4ee66d();}else{return _0x2f2dfa[_0xdd52('0x36')](0x193)[_0xdd52('0x39')]({'message':_0xdd52('0x46')});}}}else if(_0x43ef06[_0xdd52('0x47')][_0xdd52('0x48')]){try{var _0x3b2707={'audience':hardwareConf[_0xdd52('0x49')](),'issuer':hardwareConf[_0xdd52('0x49')]()};verifyJwt(_0x43ef06[_0xdd52('0x47')][_0xdd52('0x48')],_0x3b2707)[_0xdd52('0x35')](function(_0xe0844f){return db[_0xdd52('0x3f')][_0xdd52('0x40')]({'where':{'id':_0xe0844f[_0xdd52('0x4a')]}})['then'](function(_0x84ffc){_0x41c7e5=_0x84ffc;return db[_0xdd52('0x4b')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]});})[_0xdd52('0x35')](function(_0x10d053){if(!_0x41c7e5||!_[_0xdd52('0x4c')](_0x41c7e5[_0xdd52('0x4d')],_0xe0844f[_0xdd52('0x4e')])){return _0x2f2dfa[_0xdd52('0x36')](0x191)[_0xdd52('0x39')]({'message':_0xdd52('0x4f')});}if(_0x41c7e5[_0xdd52('0x50')]){return _0x2f2dfa[_0xdd52('0x36')](0x191)['json']({'message':_0xdd52('0x51')});}if(_0x41c7e5[_0xdd52('0x52')]){if(_0x10d053[_0xdd52('0x53')]>0x0){if(moment(_0x41c7e5[_0xdd52('0x54')])[_0xdd52('0x55')](_0x10d053[_0xdd52('0x53')],_0xdd52('0x56'))>moment()){return _0x2f2dfa[_0xdd52('0x36')](0x191)[_0xdd52('0x39')]({'message':_0xdd52('0x51')});}}else{return _0x2f2dfa[_0xdd52('0x36')](0x191)[_0xdd52('0x39')]({'message':_0xdd52('0x51')});}}_0x43ef06[_0xdd52('0x57')]={'id':_0x41c7e5['id']};_0x4ee66d();});})[_0xdd52('0x3b')](function(){return _0x2f2dfa[_0xdd52('0x36')](0x191)[_0xdd52('0x39')]({'message':_0xdd52('0x51')});});}catch(_0x8ba51){_0x4ee66d(_0x8ba51);}}else if(_0x1156cc){_0x4ee66d();}else{return _0x2f2dfa[_0xdd52('0x36')](0x193)[_0xdd52('0x39')]({'message':'Unknown\x20authorization\x20format'});}})['use'](function(_0x28c4fd,_0x30b258,_0x1462b0){if(_0x28c4fd[_0xdd52('0x57')]){db[_0xdd52('0x3f')][_0xdd52('0x40')]({'where':{'id':_0x28c4fd[_0xdd52('0x57')]['id']},'attributes':userAttributes})[_0xdd52('0x35')](function(_0x3eccab){if(!_0x3eccab){return _0x30b258[_0xdd52('0x36')](0x194)['json']({'message':_0xdd52('0x58')});}_0x28c4fd[_0xdd52('0x57')]=_0x3eccab;_0x1462b0();})[_0xdd52('0x3b')](function(_0x4a61b4){_0x1462b0(_0x4a61b4);});}else if(_0x1156cc){_0x1462b0();}else{return _0x30b258[_0xdd52('0x36')](0x194)[_0xdd52('0x39')]({'message':_0xdd52('0x59')});}});};exports[_0xdd52('0x5a')]=function canUpdate(){return compose()[_0xdd52('0x3c')](function(_0x23d3af,_0x492ab9,_0x45f895){return licenseUtil[_0xdd52('0x5b')]()[_0xdd52('0x35')](function(_0x4cac5c){if(_0x4cac5c[_0xdd52('0x5c')]){_0x45f895();}else{return _0x492ab9[_0xdd52('0x36')](0x193)['json']({'message':_0xdd52('0x5d')});}})['catch'](function(_0x3621f1){_0x45f895(_0x3621f1);});});};exports['isWebrtcLicence']=function isWebrtcLicence(){return compose()['use'](function(_0x5eea6c,_0x14fb80,_0x232d60){return licenseUtil[_0xdd52('0x5b')]()[_0xdd52('0x35')](function(_0x396ce1){if(_0x396ce1[_0xdd52('0x5e')]){_0x232d60();}else{return _0x14fb80['status'](0x193)[_0xdd52('0x39')]({'message':_0xdd52('0x5d')});}})[_0xdd52('0x3b')](function(_0x5cf288){_0x232d60(_0x5cf288);});});};exports[_0xdd52('0x5f')]=function(_0x42b030,_0x3ad59b,_0x36358f){_0x42b030['isMiddleware']=!![];return _0x36358f();};exports[_0xdd52('0x60')]=function signToken(_0x160c48){return signJwt(_0x160c48);};exports['setTokenCookie']=function(_0x299def,_0x233445){if(!_0x299def[_0xdd52('0x57')]){return _0x233445['status'](0x194)['json']({'message':_0xdd52('0x61')});}var _0x36e8e1={'payload':{'id':_0x299def[_0xdd52('0x57')]['id'],'role':_0x299def['user'][_0xdd52('0xb')]},'options':{'expiresIn':0x15180}};return signJwt(_0x36e8e1)['then'](function(_0xd150d){_0x233445[_0xdd52('0x62')](_0xdd52('0x63'),_0xd150d);_0x233445['redirect']('/dashboards/general');})[_0xdd52('0x3b')](function(_0x4f567c){return _0x233445[_0xdd52('0x36')](0x1f4)[_0xdd52('0x64')](_0x4f567c);});};exports[_0xdd52('0x65')]=function(_0x45e052){if(_[_0xdd52('0x66')](_0x45e052[_0xdd52('0x4d')])||_['isNil'](_0x45e052[_0xdd52('0x67')])){return null;}else{return createJwt(_0x45e052);}};exports[_0xdd52('0x68')]=function(_0x1553e0){_0x1553e0[_0xdd52('0x4d')]=generateNonce();_0x1553e0['apiKeyIat']=generateIssuedAt();return createJwt(_0x1553e0);};exports[_0xdd52('0x69')]=function(_0x43faa4,_0x3ce5d0){var _0x5e1bf8=_0x43faa4[_0xdd52('0x47')][_0xdd52('0x48')];if(_0x5e1bf8){var _0x19bc88={'nonce':_0x3ce5d0[_0xdd52('0x4d')],'iat':_0x3ce5d0[_0xdd52('0x67')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xdd52('0x49')]()};return verifyJwt(_0x5e1bf8,_0x19bc88)[_0xdd52('0x35')](function(){return generateApiKey(_0x3ce5d0);});}else{throw{'message':_0xdd52('0x6a')};}};exports[_0xdd52('0x6b')]=function(_0x3e0ab1){var _0x5510e4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x5510e4[_0xdd52('0x6c')](_0x3e0ab1))throw new db[(_0xdd52('0x6d'))]['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');return;};exports[_0xdd52('0x6e')]=function(_0x5cb9ad,_0x2bbfdd,_0x255394){var _0x5773e1=encryptor[_0xdd52('0x6f')](_0x2bbfdd)['split'](',');for(var _0x540591=0x0;_0x540591<_0x255394;_0x540591++){if(!_0x5773e1[_0x540591])break;if(_0x5cb9ad['toLowerCase']()===_0x5773e1[_0x540591][_0xdd52('0x70')]()){var _0x3dd962=util[_0xdd52('0x71')](_0xdd52('0x72'),_0x255394);if(_0x255394===0x1){_0x3dd962=_0xdd52('0x73');}throw new db['Sequelize'][(_0xdd52('0x74'))](_0x3dd962);}}return;};exports[_0xdd52('0x75')]=function(_0x1bf35e,_0x1f6511){var _0x33fbfd=_0x1f6511?encryptor[_0xdd52('0x6f')](_0x1f6511)[_0xdd52('0x76')](','):[];if(_0x33fbfd[_0xdd52('0x77')]===0x5){_0x33fbfd['splice'](-0x1,0x1);}_0x33fbfd[_0xdd52('0x78')](_0x1bf35e);return encryptor[_0xdd52('0x79')](_0x33fbfd[_0xdd52('0x7a')](','));};function signJwt(_0x205856){var _0x16974f=BPromise[_0xdd52('0x7b')](jwt[_0xdd52('0x7c')],{'context':jwt});var _0x43edca=_0x205856[_0xdd52('0x7d')]||config[_0xdd52('0xa')]['session'];return new BPromise(function(_0x23abec,_0x4a032f){_0x16974f(_0x205856['payload'],_0x43edca,_0x205856['options'])[_0xdd52('0x35')](function(_0x38d806){_0x23abec(_0x38d806);})['catch'](function(_0x5c6daf){_0x4a032f(_0x5c6daf);});});}function verifyJwt(_0xb483d2,_0x3fa5bc,_0x1e3b6e){var _0x4726d7=BPromise[_0xdd52('0x7b')](jwt[_0xdd52('0x7e')],{'context':jwt});var _0x3de886=_0x1e3b6e||config[_0xdd52('0xa')][_0xdd52('0x7f')];return new BPromise(function(_0x32e5f0,_0x53247e){_0x4726d7(_0xb483d2,_0x3de886,_0x3fa5bc)['then'](function(_0x5de757){_0x32e5f0(_0x5de757);})[_0xdd52('0x3b')](function(_0x674ac5){_0x53247e(_0x674ac5);});});}function generateNonce(){return crypto[_0xdd52('0x80')](0x10)[_0xdd52('0x81')]('hex');}function generateIssuedAt(){return Math[_0xdd52('0x82')](Date['now']()/0x3e8)[_0xdd52('0x81')]();}function createJwt(_0x2dfd7e){var _0x125967={'payload':{'iat':_0x2dfd7e[_0xdd52('0x67')],'nonce':_0x2dfd7e[_0xdd52('0x4d')]},'options':{'algorithm':_0xdd52('0x83'),'subject':_0x2dfd7e['id'][_0xdd52('0x81')](),'issuer':hardwareConf[_0xdd52('0x49')](),'audience':hardwareConf[_0xdd52('0x49')]()}};return signJwt(_0x125967)[_0xdd52('0x35')](function(_0x5c5e47){return{'iat':_0x2dfd7e[_0xdd52('0x67')],'nonce':_0x2dfd7e[_0xdd52('0x4d')],'token':_0x5c5e47};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 82bc1d9..f3568f6 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 _0x0bdb=['utf8','base64','decryptString','secret','createDecipher','bluebird','../../config/environment','app','aes192','encrypt','algorithm','join','error','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createWriteStream','createCipher','data','update','binary','write','end','final','unlink','decryptFile','createReadStream','close','encryptString'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0bdb,0x1b7));var _0xb0bd=function(_0x638638,_0x34585e){_0x638638=_0x638638-0x0;var _0x3651ee=_0x0bdb[_0x638638];return _0x3651ee;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0xb0bd('0x0'));var _=require('lodash');var config=require(_0xb0bd('0x1'));var logger=require('../../config/logger')(_0xb0bd('0x2'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets']['session'],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':_0xb0bd('0x3')};if(config[_0xb0bd('0x4')]&&config['encrypt'][_0xb0bd('0x5')]){var isSupported=isAlgorithmSupported(config[_0xb0bd('0x4')]['algorithm']);if(isSupported){fileOptions[_0xb0bd('0x5')]=config['encrypt'][_0xb0bd('0x5')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xb0bd('0x6')](',\x20');logger[_0xb0bd('0x7')](config['encrypt'][_0xb0bd('0x5')],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x345147){return AES_SUPPORTED_RX['test'](_0x345147);}function getSupportedCiphers(){return crypto[_0xb0bd('0x8')]()[_0xb0bd('0x9')](isASupportedCipher);}function isAlgorithmSupported(_0x3be91c){return getSupportedCiphers()[_0xb0bd('0xa')](_0x3be91c)>-0x1;}function combineOptions(_0x3958e9){var _0x1bc03b={};for(var _0x1eed95 in fileOptions){if(fileOptions[_0xb0bd('0xb')](_0x1eed95)){_0x1bc03b[_0x1eed95]=fileOptions[_0x1eed95];}}if(_0x3958e9){for(var _0x4ca9c3 in _0x3958e9){if(_0x3958e9[_0xb0bd('0xb')](_0x4ca9c3)){_0x1bc03b[_0x4ca9c3]=_0x3958e9[_0x4ca9c3];}}}return _0x1bc03b;}exports[_0xb0bd('0xc')]=function(_0x2b18ac,_0x3dd1ff,_0x3670d3,_0x47dd6c){return new BPromise(function(_0x2a1c2a,_0x44cc5e){_0x47dd6c=combineOptions(_0x47dd6c);var _0x4f1f8f=new Buffer(_0x3670d3);var _0xedfcae=fs['createReadStream'](_0x2b18ac);var _0x21d254=fs[_0xb0bd('0xd')](_0x3dd1ff);var _0x4a0f3e=crypto[_0xb0bd('0xe')](_0x47dd6c['algorithm'],_0x4f1f8f);_0xedfcae['on'](_0xb0bd('0xf'),function(_0x3c954c){var _0x1cff24=new Buffer(_0x4a0f3e[_0xb0bd('0x10')](_0x3c954c),_0xb0bd('0x11'));_0x21d254[_0xb0bd('0x12')](_0x1cff24);});_0xedfcae['on'](_0xb0bd('0x13'),function(){try{var _0xe806c=new Buffer(_0x4a0f3e[_0xb0bd('0x14')](_0xb0bd('0x11')),_0xb0bd('0x11'));_0x21d254['write'](_0xe806c);_0x21d254[_0xb0bd('0x13')]();_0x21d254['on']('close',function(){return _0x2a1c2a(_0x3dd1ff);});}catch(_0x504ab2){fs[_0xb0bd('0x15')](_0x3dd1ff);return _0x44cc5e(_0x504ab2);}});});};exports[_0xb0bd('0x16')]=function(_0x25c849,_0x1818ad,_0x464373,_0x829a1d){return new BPromise(function(_0x4182d5,_0x1e8140){_0x829a1d=combineOptions(_0x829a1d);var _0x1f47dd=new Buffer(_0x464373);var _0x3d8a9b=fs[_0xb0bd('0x17')](_0x25c849);var _0x5b0b93=fs['createWriteStream'](_0x1818ad);var _0x3688fa=crypto['createDecipher'](_0x829a1d[_0xb0bd('0x5')],_0x1f47dd);_0x3d8a9b['on'](_0xb0bd('0xf'),function(_0x13529c){var _0xe73944=new Buffer(_0x3688fa[_0xb0bd('0x10')](_0x13529c),'binary');_0x5b0b93['write'](_0xe73944);});_0x3d8a9b['on']('end',function(){try{var _0x22ca69=new Buffer(_0x3688fa[_0xb0bd('0x14')]('binary'),_0xb0bd('0x11'));_0x5b0b93[_0xb0bd('0x12')](_0x22ca69);_0x5b0b93[_0xb0bd('0x13')]();_0x5b0b93['on'](_0xb0bd('0x18'),function(){return _0x4182d5(_0x1818ad);});}catch(_0xb45ba2){fs[_0xb0bd('0x15')](_0x1818ad);return _0x1e8140(_0xb45ba2);}});});};exports[_0xb0bd('0x19')]=function(_0x95ed6a,_0x3501f3,_0x142ace){var _0x4d12f4=_0x142ace||stringOptions[_0xb0bd('0x5')];var _0x5f21a0=_0x3501f3||stringOptions['secret'];var _0xc28a92=crypto[_0xb0bd('0xe')](_0x4d12f4,_0x5f21a0);var _0x1c8d52=_0xc28a92[_0xb0bd('0x10')](_0x95ed6a,_0xb0bd('0x1a'),_0xb0bd('0x1b'));_0x1c8d52+=_0xc28a92['final'](_0xb0bd('0x1b'));return _0x1c8d52;};exports[_0xb0bd('0x1c')]=function(_0x6f870d,_0x23f831,_0x420e5b){var _0x309155=_0x420e5b||stringOptions[_0xb0bd('0x5')];var _0x24b1cc=_0x23f831||stringOptions[_0xb0bd('0x1d')];var _0x2c575c=crypto[_0xb0bd('0x1e')](_0x309155,_0x24b1cc);var _0x40fbfc=_0x2c575c[_0xb0bd('0x10')](_0x6f870d,'base64','utf8');_0x40fbfc+=_0x2c575c['final'](_0xb0bd('0x1a'));return _0x40fbfc;}; \ No newline at end of file +var _0xd869=['base64','secret','lodash','../../config/environment','../../config/logger','secrets','session','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','getCiphers','indexOf','hasOwnProperty','createReadStream','createWriteStream','createCipher','update','write','end','final','binary','close','unlink','decryptFile','createDecipher','utf8'];(function(_0x4c3de5,_0x15b3f3){var _0x29d297=function(_0x597076){while(--_0x597076){_0x4c3de5['push'](_0x4c3de5['shift']());}};_0x29d297(++_0x15b3f3);}(_0xd869,0x17b));var _0x9d86=function(_0xa3e0f7,_0x1b06db){_0xa3e0f7=_0xa3e0f7-0x0;var _0x4ce604=_0xd869[_0xa3e0f7];return _0x4ce604;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require('bluebird');var _=require(_0x9d86('0x0'));var config=require(_0x9d86('0x1'));var logger=require(_0x9d86('0x2'))('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x9d86('0x3')][_0x9d86('0x4')],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':_0x9d86('0x5')};if(config[_0x9d86('0x6')]&&config[_0x9d86('0x6')]['algorithm']){var isSupported=isAlgorithmSupported(config[_0x9d86('0x6')]['algorithm']);if(isSupported){fileOptions[_0x9d86('0x7')]=config[_0x9d86('0x6')][_0x9d86('0x7')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x9d86('0x8')](',\x20');logger[_0x9d86('0x9')](config[_0x9d86('0x6')][_0x9d86('0x7')],_0x9d86('0xa'),supportedAlgorithms);}}function isASupportedCipher(_0x507688){return AES_SUPPORTED_RX['test'](_0x507688);}function getSupportedCiphers(){return crypto[_0x9d86('0xb')]()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x97582d){return getSupportedCiphers()[_0x9d86('0xc')](_0x97582d)>-0x1;}function combineOptions(_0x4ccbb9){var _0x19e0fc={};for(var _0x2425ae in fileOptions){if(fileOptions[_0x9d86('0xd')](_0x2425ae)){_0x19e0fc[_0x2425ae]=fileOptions[_0x2425ae];}}if(_0x4ccbb9){for(var _0x5d9bd7 in _0x4ccbb9){if(_0x4ccbb9[_0x9d86('0xd')](_0x5d9bd7)){_0x19e0fc[_0x5d9bd7]=_0x4ccbb9[_0x5d9bd7];}}}return _0x19e0fc;}exports['encryptFile']=function(_0x397a55,_0x54b3f1,_0x193ef5,_0x4b1369){return new BPromise(function(_0x2f85f6,_0x57065c){_0x4b1369=combineOptions(_0x4b1369);var _0x1347af=new Buffer(_0x193ef5);var _0x2440de=fs[_0x9d86('0xe')](_0x397a55);var _0x16a413=fs[_0x9d86('0xf')](_0x54b3f1);var _0x13d4d1=crypto[_0x9d86('0x10')](_0x4b1369['algorithm'],_0x1347af);_0x2440de['on']('data',function(_0x455de3){var _0x570115=new Buffer(_0x13d4d1[_0x9d86('0x11')](_0x455de3),'binary');_0x16a413[_0x9d86('0x12')](_0x570115);});_0x2440de['on'](_0x9d86('0x13'),function(){try{var _0xae2da2=new Buffer(_0x13d4d1[_0x9d86('0x14')](_0x9d86('0x15')),'binary');_0x16a413[_0x9d86('0x12')](_0xae2da2);_0x16a413[_0x9d86('0x13')]();_0x16a413['on'](_0x9d86('0x16'),function(){return _0x2f85f6(_0x54b3f1);});}catch(_0xf48248){fs[_0x9d86('0x17')](_0x54b3f1);return _0x57065c(_0xf48248);}});});};exports[_0x9d86('0x18')]=function(_0x2cefc7,_0x386ce5,_0x43523a,_0x4b8e76){return new BPromise(function(_0x52bb36,_0x29330d){_0x4b8e76=combineOptions(_0x4b8e76);var _0x19c6a0=new Buffer(_0x43523a);var _0xa38b44=fs[_0x9d86('0xe')](_0x2cefc7);var _0x27eaf5=fs[_0x9d86('0xf')](_0x386ce5);var _0x360bfa=crypto[_0x9d86('0x19')](_0x4b8e76['algorithm'],_0x19c6a0);_0xa38b44['on']('data',function(_0x3954d3){var _0x17230c=new Buffer(_0x360bfa[_0x9d86('0x11')](_0x3954d3),'binary');_0x27eaf5[_0x9d86('0x12')](_0x17230c);});_0xa38b44['on'](_0x9d86('0x13'),function(){try{var _0x26c19b=new Buffer(_0x360bfa[_0x9d86('0x14')]('binary'),'binary');_0x27eaf5['write'](_0x26c19b);_0x27eaf5[_0x9d86('0x13')]();_0x27eaf5['on'](_0x9d86('0x16'),function(){return _0x52bb36(_0x386ce5);});}catch(_0x4948ec){fs[_0x9d86('0x17')](_0x386ce5);return _0x29330d(_0x4948ec);}});});};exports['encryptString']=function(_0x323581,_0x535b4a,_0x4dee2c){var _0x3aab31=_0x4dee2c||stringOptions[_0x9d86('0x7')];var _0x5968b4=_0x535b4a||stringOptions['secret'];var _0x47d249=crypto[_0x9d86('0x10')](_0x3aab31,_0x5968b4);var _0x179be0=_0x47d249[_0x9d86('0x11')](_0x323581,_0x9d86('0x1a'),_0x9d86('0x1b'));_0x179be0+=_0x47d249['final'](_0x9d86('0x1b'));return _0x179be0;};exports['decryptString']=function(_0x23522d,_0x502a55,_0x39e659){var _0x58e21d=_0x39e659||stringOptions[_0x9d86('0x7')];var _0x2f551f=_0x502a55||stringOptions[_0x9d86('0x1c')];var _0x2fe7f9=crypto[_0x9d86('0x19')](_0x58e21d,_0x2f551f);var _0x1806de=_0x2fe7f9[_0x9d86('0x11')](_0x23522d,_0x9d86('0x1b'),_0x9d86('0x1a'));_0x1806de+=_0x2fe7f9[_0x9d86('0x14')](_0x9d86('0x1a'));return _0x1806de;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 01a50cb..abee645 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 _0xb19a=['lodash','bluebird','rimraf','../../mysqldb','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','find','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','range','isInteger','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','push','dirname','basename','.csv','length','mkdirSync','join','csv','%s.%s','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','exit','util'];(function(_0x23b106,_0x50acec){var _0x3c88e5=function(_0x1fcb42){while(--_0x1fcb42){_0x23b106['push'](_0x23b106['shift']());}};_0x3c88e5(++_0x50acec);}(_0xb19a,0x17f));var _0xab19=function(_0x1b5a8d,_0x371270){_0x1b5a8d=_0x1b5a8d-0x0;var _0x436018=_0xb19a[_0x1b5a8d];return _0x436018;};'use strict';var util=require(_0xab19('0x0'));var path=require('path');var _=require(_0xab19('0x1'));var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0xab19('0x2'));var zipdir=require('zip-dir');var rimraf=require(_0xab19('0x3'));var db=require(_0xab19('0x4'))['db'];var dbH=require(_0xab19('0x4'))['dbH'];var logger=require(_0xab19('0x5'))(_0xab19('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0xab19('0x7')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xab19('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x57d36e,_0x37e133){var _0xe932fd={'status':_0x57d36e};var _0x224f8f={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x37e133){_0xe932fd[_0xab19('0x8')]=_0x37e133;}return db[_0xab19('0x9')][_0xab19('0xa')](_0xe932fd,_0x224f8f);}function main(){var _0x5503c0=0x1388;var _0x29eb43;logger[_0xab19('0xb')](util[_0xab19('0xc')](_0xab19('0xd'),EXTRACTED_REPORT_ID,_0xab19('0xe')));return db['Setting'][_0xab19('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xab19('0x10'),_0xab19('0x11')]})[_0xab19('0x12')](function(_0x112799){if(_0x112799){_0x29eb43=_0x112799;_0x5503c0=_0x29eb43[_0xab19('0x11')]||0x1388;}})['then'](function(){return dbH[_0xab19('0x13')][_0xab19('0x14')](util[_0xab19('0xc')](_0xab19('0x15'),QUERY),{'type':dbH[_0xab19('0x13')][_0xab19('0x16')][_0xab19('0x17')]});})[_0xab19('0x12')](function(_0x4d0def){if(!_0x4d0def[0x0][_0xab19('0x18')]){return analyticExtractedReport(_0xab19('0x19'));}var _0x5cabc7=[];var _0x704d59=0x0;if(_0x29eb43[_0xab19('0x10')]){if(_0x4d0def&&_0x4d0def['length']){var _0x430214=_[_0xab19('0x1a')](_0x4d0def[0x0][_0xab19('0x18')]/_0x5503c0);var _0x187b48=Number[_0xab19('0x1b')](_0x4d0def[0x0][_0xab19('0x18')]/_0x5503c0)?_0x4d0def[0x0][_0xab19('0x18')]%_0x5503c0:0x0;_0x430214[_0xab19('0x1c')](function(_0x34196e){if(_0x34196e>0x0){_0x704d59+=_0x5503c0;}_0x5cabc7['push'](dbH[_0xab19('0x13')][_0xab19('0x14')](util[_0xab19('0xc')](_0xab19('0x1d'),QUERY,_0x5503c0,_0x704d59),{'type':dbH[_0xab19('0x13')][_0xab19('0x16')][_0xab19('0x17')]}));});if(_0x187b48>0x0){_0x704d59+=_0x5503c0;_0x5cabc7[_0xab19('0x1e')](dbH[_0xab19('0x13')]['query'](util[_0xab19('0xc')](_0xab19('0x1d'),QUERY,_0x187b48,_0x704d59),{'type':dbH[_0xab19('0x13')]['QueryTypes'][_0xab19('0x17')]}));}}}else{_0x5cabc7[_0xab19('0x1e')](dbH[_0xab19('0x13')][_0xab19('0x14')](QUERY,{'type':dbH[_0xab19('0x13')][_0xab19('0x16')][_0xab19('0x17')]}));}var _0x3e3723=path[_0xab19('0x1f')](PATH);var _0xee2b38=path[_0xab19('0x20')](PATH,_0xab19('0x21'));var _0x42dce0=_0x29eb43[_0xab19('0x10')]&&_0x5cabc7[_0xab19('0x22')]>0x1;var _0xfe49bf=[];if(!fs['existsSync'](path['join'](_0x3e3723,_0xee2b38))&&_0x42dce0){fs[_0xab19('0x23')](path[_0xab19('0x24')](_0x3e3723,_0xee2b38));}return BPromise['each'](_0x5cabc7,function(_0x1be523){_0xfe49bf['push'](_0x1be523);})[_0xab19('0x12')](function(){for(var _0x5f5b54=0x0;_0x5f5b54<_0xfe49bf[_0xab19('0x22')];_0x5f5b54+=0x1){var _0x59381f;var _0x2f9a35=_0xfe49bf[_0x5f5b54];if(_0x42dce0){_0x59381f=path[_0xab19('0x24')](_0x3e3723,_0xee2b38,util['format']('%s%d.%s',_0xee2b38,_0x5f5b54,'csv'));}else{_0x59381f=path[_0xab19('0x24')](_0x3e3723,util[_0xab19('0xc')]('%s.%s',_0xee2b38,_0xab19('0x25')));}fs['writeFileSync'](_0x59381f,csv(_0x2f9a35));}})[_0xab19('0x12')](function(){if(_0x42dce0){return new Promise(function(_0xacbf6e){zipdir(path['join'](_0x3e3723,_0xee2b38),{'saveTo':path[_0xab19('0x24')](_0x3e3723,util['format'](_0xab19('0x26'),_0xee2b38,'zip'))},function(_0x4ae3e9,_0x2890ab){rimraf(path['join'](_0x3e3723,_0xee2b38),function(){});_0xacbf6e(_0xab19('0x27'));});});}})[_0xab19('0x12')](function(){logger[_0xab19('0xb')](util[_0xab19('0xc')](_0xab19('0x28'),EXTRACTED_REPORT_ID,_0xab19('0xe')));return analyticExtractedReport(_0xab19('0x29'),_0x42dce0?util[_0xab19('0xc')](_0xab19('0x26'),_0xee2b38,_0x42dce0?_0xab19('0x2a'):_0xab19('0x25')):null);});})[_0xab19('0x2b')](function(_0x25656e){logger[_0xab19('0xb')](util[_0xab19('0xc')](_0xab19('0x2c'),EXTRACTED_REPORT_ID,'CSV'),util['inspect'](_0x25656e,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xab19('0x2d'));})[_0xab19('0x2e')](function(){process[_0xab19('0x2f')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xccef=['CSV','Completed','inspect','Failed','finally','exit','to-csv','bluebird','rimraf','../../mysqldb','dbH','argv','update','info','format','Setting','find','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','Empty','range','num','isInteger','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','push','dirname','basename','length','existsSync','join','each','csv','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xccef,0x180));var _0xfcce=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xccef[_0x502c7d];return _0x30b7ed;};'use strict';var util=require('util');var path=require('path');var _=require('lodash');var csv=require(_0xfcce('0x0'));var fs=require('fs');var BPromise=require(_0xfcce('0x1'));var zipdir=require('zip-dir');var rimraf=require(_0xfcce('0x2'));var db=require(_0xfcce('0x3'))['db'];var dbH=require(_0xfcce('0x3'))[_0xfcce('0x4')];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xfcce('0x5')][0x2]);var QUERY=process[_0xfcce('0x5')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x358279,_0x24c64d){var _0x49dda4={'status':_0x358279};var _0x48737d={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x24c64d){_0x49dda4['savename']=_0x24c64d;}return db['AnalyticExtractedReport'][_0xfcce('0x6')](_0x49dda4,_0x48737d);}function main(){var _0x8cae53=0x1388;var _0x296d75;logger[_0xfcce('0x7')](util[_0xfcce('0x8')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'CSV'));return db[_0xfcce('0x9')][_0xfcce('0xa')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xfcce('0xb'),_0xfcce('0xc')]})[_0xfcce('0xd')](function(_0x3f160d){if(_0x3f160d){_0x296d75=_0x3f160d;_0x8cae53=_0x296d75[_0xfcce('0xc')]||0x1388;}})[_0xfcce('0xd')](function(){return dbH[_0xfcce('0xe')][_0xfcce('0xf')](util[_0xfcce('0x8')](_0xfcce('0x10'),QUERY),{'type':dbH[_0xfcce('0xe')][_0xfcce('0x11')][_0xfcce('0x12')]});})['then'](function(_0x51eebc){if(!_0x51eebc[0x0]['num']){return analyticExtractedReport(_0xfcce('0x13'));}var _0x4c43d8=[];var _0x28ee4d=0x0;if(_0x296d75['split']){if(_0x51eebc&&_0x51eebc['length']){var _0x463674=_[_0xfcce('0x14')](_0x51eebc[0x0][_0xfcce('0x15')]/_0x8cae53);var _0x1bcfed=Number[_0xfcce('0x16')](_0x51eebc[0x0][_0xfcce('0x15')]/_0x8cae53)?_0x51eebc[0x0][_0xfcce('0x15')]%_0x8cae53:0x0;_0x463674[_0xfcce('0x17')](function(_0x2314c7){if(_0x2314c7>0x0){_0x28ee4d+=_0x8cae53;}_0x4c43d8['push'](dbH['sequelize'][_0xfcce('0xf')](util['format'](_0xfcce('0x18'),QUERY,_0x8cae53,_0x28ee4d),{'type':dbH[_0xfcce('0xe')][_0xfcce('0x11')][_0xfcce('0x12')]}));});if(_0x1bcfed>0x0){_0x28ee4d+=_0x8cae53;_0x4c43d8['push'](dbH[_0xfcce('0xe')][_0xfcce('0xf')](util[_0xfcce('0x8')](_0xfcce('0x18'),QUERY,_0x1bcfed,_0x28ee4d),{'type':dbH[_0xfcce('0xe')][_0xfcce('0x11')][_0xfcce('0x12')]}));}}}else{_0x4c43d8[_0xfcce('0x19')](dbH[_0xfcce('0xe')][_0xfcce('0xf')](QUERY,{'type':dbH[_0xfcce('0xe')][_0xfcce('0x11')][_0xfcce('0x12')]}));}var _0x2f670b=path[_0xfcce('0x1a')](PATH);var _0x4faeb9=path[_0xfcce('0x1b')](PATH,'.csv');var _0x25e753=_0x296d75[_0xfcce('0xb')]&&_0x4c43d8[_0xfcce('0x1c')]>0x1;var _0x512ba4=[];if(!fs[_0xfcce('0x1d')](path[_0xfcce('0x1e')](_0x2f670b,_0x4faeb9))&&_0x25e753){fs['mkdirSync'](path[_0xfcce('0x1e')](_0x2f670b,_0x4faeb9));}return BPromise[_0xfcce('0x1f')](_0x4c43d8,function(_0x39c97b){_0x512ba4['push'](_0x39c97b);})[_0xfcce('0xd')](function(){for(var _0x14464a=0x0;_0x14464a<_0x512ba4[_0xfcce('0x1c')];_0x14464a+=0x1){var _0x4f1361;var _0x37036e=_0x512ba4[_0x14464a];if(_0x25e753){_0x4f1361=path[_0xfcce('0x1e')](_0x2f670b,_0x4faeb9,util[_0xfcce('0x8')]('%s%d.%s',_0x4faeb9,_0x14464a,_0xfcce('0x20')));}else{_0x4f1361=path['join'](_0x2f670b,util['format']('%s.%s',_0x4faeb9,_0xfcce('0x20')));}fs['writeFileSync'](_0x4f1361,csv(_0x37036e));}})[_0xfcce('0xd')](function(){if(_0x25e753){return new Promise(function(_0x3ac4af){zipdir(path[_0xfcce('0x1e')](_0x2f670b,_0x4faeb9),{'saveTo':path[_0xfcce('0x1e')](_0x2f670b,util['format'](_0xfcce('0x21'),_0x4faeb9,_0xfcce('0x22')))},function(_0x5d41f6,_0x265ae9){rimraf(path[_0xfcce('0x1e')](_0x2f670b,_0x4faeb9),function(){});_0x3ac4af('zip\x20finished');});});}})['then'](function(){logger[_0xfcce('0x7')](util['format'](_0xfcce('0x23'),EXTRACTED_REPORT_ID,_0xfcce('0x24')));return analyticExtractedReport(_0xfcce('0x25'),_0x25e753?util[_0xfcce('0x8')](_0xfcce('0x21'),_0x4faeb9,_0x25e753?_0xfcce('0x22'):_0xfcce('0x20')):null);});})['catch'](function(_0x343f42){logger[_0xfcce('0x7')](util[_0xfcce('0x8')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xfcce('0x24')),util[_0xfcce('0x26')](_0x343f42,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xfcce('0x27'));})[_0xfcce('0x28')](function(){process[_0xfcce('0x29')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 7acb04f..2bce7ba 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 _0x1688=['header','before','margin','landscape','\x20/\x20','Arial','right','num','Empty','splitSizePdf','then','split','range','isInteger','sequelize','QueryTypes','SELECT','query','dirname','basename','.pdf','existsSync','join','mkdirSync','createPdfKitDocument','%s%d.%s','%s.%s','all','zip','zip\x20finished','info','PDF','Completed','pdf','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','/fonts/arial-regular.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','footer','pipe','createWriteStream','finish','end','createPdfFromHTML','catch','util','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','window','bluebird','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','map','tableHeader','pick','toString','fill','length','auto','body','chunk','keys','forEach','push','format','name'];(function(_0x4226d6,_0x3864ca){var _0x19655b=function(_0x1d43a1){while(--_0x1d43a1){_0x4226d6['push'](_0x4226d6['shift']());}};_0x19655b(++_0x3864ca);}(_0x1688,0xe3));var _0x8168=function(_0x2ed8c8,_0x3a867e){_0x2ed8c8=_0x2ed8c8-0x0;var _0xad96c9=_0x1688[_0x2ed8c8];return _0xad96c9;};'use strict';var _=require('lodash');var fs=require('fs');var util=require(_0x8168('0x0'));var path=require(_0x8168('0x1'));var moment=require(_0x8168('0x2'));var htmlToPdfmake=require(_0x8168('0x3'));var PdfPrinter=require(_0x8168('0x4'));var zipdir=require(_0x8168('0x5'));var rimraf=require(_0x8168('0x6'));var JSDOM=require(_0x8168('0x7'))['JSDOM'];var window=new JSDOM('')[_0x8168('0x8')];var BPromise=require(_0x8168('0x9'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x8168('0xa')];var logger=require(_0x8168('0xb'))(_0x8168('0xc'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x8168('0xd')][0x3];var PATH=process[_0x8168('0xd')][0x4];var NAME=process[_0x8168('0xd')][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x284eed,_0x39ff66){var _0xae0945={'status':_0x284eed};var _0x4e2506={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x39ff66){_0xae0945[_0x8168('0xe')]=_0x39ff66;}return db[_0x8168('0xf')][_0x8168('0x10')](_0xae0945,_0x4e2506);}function getHeaders(_0xfedc05){return _[_0x8168('0x11')](_0xfedc05,function(_0x3bdf79){return{'text':_0x3bdf79,'style':_0x8168('0x12')};});}function getRows(_0x57cec3,_0x46f57a){return _[_0x8168('0x11')](_0x46f57a,function(_0x4cda17){return _(_0x4cda17)[_0x8168('0x13')](_0x57cec3)['map'](function(_0x3996e0){return _0x3996e0?_[_0x8168('0x14')](_0x3996e0):'';})['value']();});}function createTable(_0x1e9dbe,_0x3ed604){var _0x1b4cab={'widths':_[_0x8168('0x15')](Array(_0x1e9dbe[_0x8168('0x16')]),0x91),'heights':function(_0x4ebb6a){return _0x4ebb6a===0x0?_0x8168('0x17'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x1819a1=getHeaders(_0x1e9dbe);_0x1b4cab[_0x8168('0x18')]['push'](_0x1819a1);var _0x1f7bf0=getRows(_0x1e9dbe,_0x3ed604);_0x1b4cab[_0x8168('0x18')]=_0x1b4cab[_0x8168('0x18')]['concat'](_0x1f7bf0);return _0x1b4cab;}function createTables(_0x466132){var _0x47f6a3=[];var _0x45fa80=_[_0x8168('0x19')](Object[_0x8168('0x1a')](_0x466132[0x0]),0x5);_0x45fa80[_0x8168('0x1b')](function(_0x3195e0){_0x47f6a3[_0x8168('0x1c')](createTable(_0x3195e0,_0x466132));});return _0x47f6a3;}function getPDFDocDefinition(_0x2be558){var _0x522456=util[_0x8168('0x1d')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT[_0x8168('0x1e')],moment(EXTRACTED_REPORT['startDate'])[_0x8168('0x1d')](FORMAT),moment(EXTRACTED_REPORT['endDate'])[_0x8168('0x1d')](FORMAT));var _0x2bbc51=[];for(var _0x5a1d64=0x0;_0x5a1d64<_0x2be558[_0x8168('0x16')];_0x5a1d64++){var _0x3b3257=[];if(_0x5a1d64===0x0){_0x3b3257[_0x8168('0x1c')]({'text':_0x522456,'style':_0x8168('0x1f')});}var _0x5ad360={'table':_0x2be558[_0x5a1d64]};if(_0x5a1d64>0x0){_0x5ad360['pageBreak']=_0x8168('0x20');_0x5ad360[_0x8168('0x21')]=[0x0,0x46,0x0,0x0];}_0x3b3257[_0x8168('0x1c')](_0x5ad360);_0x2bbc51[_0x8168('0x1c')](_0x3b3257);}return{'pageSize':'A4','pageOrientation':_0x8168('0x22'),'content':_0x2bbc51,'footer':function(_0x59a7f0,_0x33a1b3){return{'text':_0x59a7f0[_0x8168('0x14')]()+_0x8168('0x23')+_0x33a1b3,'style':'footer'};},'defaultStyle':{'font':_0x8168('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':_0x8168('0x25'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x302fb3){var _0x2de95f=0x1388;var _0x37d943;if(!_0x302fb3[0x0][_0x8168('0x26')]){return analyticExtractedReport(_0x8168('0x27'));}return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x8168('0x28')]})['then'](function(_0x486a08){if(_0x486a08){_0x37d943=_0x486a08;_0x2de95f=_0x37d943[_0x8168('0x28')]||0x3e8;}})[_0x8168('0x29')](function(){var _0x32de9c=[];var _0x363e73=0x0;if(_0x37d943[_0x8168('0x2a')]){if(_0x302fb3&&_0x302fb3[_0x8168('0x16')]){var _0x5cae57=_[_0x8168('0x2b')](_0x302fb3[0x0]['num']/_0x2de95f);var _0x1e9dbc=Number[_0x8168('0x2c')](_0x302fb3[0x0][_0x8168('0x26')]/_0x2de95f)?_0x302fb3[0x0]['num']%_0x2de95f:0x0;_0x5cae57[_0x8168('0x1b')](function(_0x3f7950){if(_0x3f7950>0x0){_0x363e73+=_0x2de95f;}_0x32de9c[_0x8168('0x1c')](dbH[_0x8168('0x2d')]['query'](util[_0x8168('0x1d')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x2de95f,_0x363e73),{'type':dbH[_0x8168('0x2d')][_0x8168('0x2e')][_0x8168('0x2f')]}));});if(_0x1e9dbc>0x0){_0x363e73+=_0x2de95f;_0x32de9c[_0x8168('0x1c')](dbH[_0x8168('0x2d')][_0x8168('0x30')](util[_0x8168('0x1d')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x1e9dbc,_0x363e73),{'type':dbH['sequelize'][_0x8168('0x2e')][_0x8168('0x2f')]}));}}}else{_0x32de9c[_0x8168('0x1c')](dbH[_0x8168('0x2d')][_0x8168('0x30')](QUERY,{'type':dbH[_0x8168('0x2d')][_0x8168('0x2e')][_0x8168('0x2f')]}));}var _0x520fc1=path[_0x8168('0x31')](PATH);var _0x22e19e=path[_0x8168('0x32')](PATH,_0x8168('0x33'));var _0x51fd44=_0x37d943[_0x8168('0x2a')]&&_0x32de9c[_0x8168('0x16')]>0x1;var _0x37a1a3=[];if(!fs[_0x8168('0x34')](path[_0x8168('0x35')](_0x520fc1,_0x22e19e))&&_0x51fd44){fs[_0x8168('0x36')](path[_0x8168('0x35')](_0x520fc1,_0x22e19e));}return BPromise['each'](_0x32de9c,function(_0x4186ed){_0x37a1a3['push'](_0x4186ed);})['then'](function(){var _0x2b742b=[];for(var _0x2b18bf=0x0;_0x2b18bf<_0x37a1a3[_0x8168('0x16')];_0x2b18bf+=0x1){var _0x1b371a=_0x37a1a3[_0x2b18bf];var _0x423202=createTables(_['flatten'](_0x1b371a));var _0xe19520;var _0x4b324f=getPDFDocDefinition(_0x423202);var _0x3894f7=getPDFPrinter();var _0x2afa22=_0x3894f7[_0x8168('0x37')](_0x4b324f);if(_0x51fd44){_0xe19520=path[_0x8168('0x35')](_0x520fc1,_0x22e19e,util[_0x8168('0x1d')](_0x8168('0x38'),_0x22e19e,_0x2b18bf,'pdf'));}else{_0xe19520=path[_0x8168('0x35')](_0x520fc1,util['format'](_0x8168('0x39'),_0x22e19e,'pdf'));}_0x2b742b['push'](writePDFDocument(_0x2afa22,_0xe19520));}return Promise[_0x8168('0x3a')](_0x2b742b);})[_0x8168('0x29')](function(){if(_0x51fd44){return new Promise(function(_0x1a2a11){zipdir(path['join'](_0x520fc1,_0x22e19e),{'saveTo':path[_0x8168('0x35')](_0x520fc1,util[_0x8168('0x1d')](_0x8168('0x39'),_0x22e19e,_0x8168('0x3b')))},function(){rimraf(path[_0x8168('0x35')](_0x520fc1,_0x22e19e),function(){});_0x1a2a11(_0x8168('0x3c'));});});}})[_0x8168('0x29')](function(){if(!_0x51fd44)return;rimraf(path[_0x8168('0x35')](_0x520fc1,_0x22e19e),function(){});})[_0x8168('0x29')](function(){logger[_0x8168('0x3d')](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x8168('0x3e')));return analyticExtractedReport(_0x8168('0x3f'),_0x51fd44?util[_0x8168('0x1d')](_0x8168('0x39'),_0x22e19e,_0x51fd44?'zip':_0x8168('0x40')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util[_0x8168('0x1d')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x8168('0x3e')));return db['AnalyticExtractedReport']['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x43690f){EXTRACTED_REPORT=_0x43690f;return dbH[_0x8168('0x2d')][_0x8168('0x30')](util[_0x8168('0x1d')](_0x8168('0x41'),QUERY),{'type':dbH[_0x8168('0x2d')][_0x8168('0x2e')][_0x8168('0x2f')]});})[_0x8168('0x29')](extractReport)['catch'](function(_0x32c66f){logger[_0x8168('0x3d')](util[_0x8168('0x1d')](_0x8168('0x42'),EXTRACTED_REPORT_ID,_0x8168('0x3e')),util[_0x8168('0x43')](_0x32c66f,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x8168('0x44'));})[_0x8168('0x45')](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x4a2286=new PdfPrinter({'Arial':{'normal':__dirname+_0x8168('0x46'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0x8168('0x47'),'bolditalics':__dirname+_0x8168('0x48')}});return _0x4a2286;}function getPDFDocDefinitionFromHTML(_0x118c44,_0x148282){var _0x3a7cd0=util[_0x8168('0x1d')](_0x8168('0x49'),_0x148282[_0x8168('0x4a')],_0x148282['interactionId']);var _0x31f366=moment()['format'](_0x8168('0x4b'))[_0x8168('0x14')]();var _0x4490c2=htmlToPdfmake(_0x118c44,{'window':window,'tableAutoSize':!![]});return{'content':[_0x4490c2],'defaultStyle':{'font':_0x8168('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x8168('0x4c'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x8168('0x4c')}},'header':function(){return[{'text':_0x8168('0x4d'),'style':_0x8168('0x1f')}];},'footer':function(_0x100662,_0x3f660e){return[{'text':util[_0x8168('0x1d')](_0x8168('0x4e'),_0x3a7cd0,_0x100662,_0x3f660e,_0x31f366),'style':_0x8168('0x4f')}];}};}function writePDFDocument(_0x506aad,_0x180efd){return new Promise(function(_0x387ff4,_0x145ce6){var _0x51bdd9=_0x506aad[_0x8168('0x50')](fs[_0x8168('0x51')](_0x180efd));_0x51bdd9['on'](_0x8168('0x52'),function(){_0x387ff4('finish');});_0x51bdd9['on']('error',function(_0x387b1a){_0x145ce6(_0x387b1a);});_0x506aad[_0x8168('0x53')]();});}exports[_0x8168('0x54')]=function(_0x3163ba,_0x856b25){var _0x54cd17=getPDFPrinter();var _0x448c42=getPDFDocDefinitionFromHTML(_0x3163ba,_0x856b25);var _0x2302f1=_0x54cd17['createPdfKitDocument'](_0x448c42);return writePDFDocument(_0x2302f1,_0x856b25['path'])[_0x8168('0x55')](function(_0x1eeeb3){throw _0x1eeeb3;});}; \ No newline at end of file +var _0x817b=['flatten','createPdfKitDocument','pdf','%s.%s','all','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','createPdfFromHTML','util','path','moment','pdfmake/src/printer','zip-dir','jsdom','JSDOM','window','bluebird','../../mysqldb','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','AnalyticExtractedReport','update','map','value','fill','length','auto','body','push','concat','keys','forEach','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','endDate','format','header','pageBreak','before','margin','landscape','toString','\x20/\x20','footer','Arial','black','right','find','split','splitSizePdf','then','range','num','isInteger','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','query','dirname','.pdf','existsSync','join','mkdirSync','each'];(function(_0x5d542c,_0x3bddd8){var _0x10157c=function(_0x2ed750){while(--_0x2ed750){_0x5d542c['push'](_0x5d542c['shift']());}};_0x10157c(++_0x3bddd8);}(_0x817b,0xd4));var _0xb817=function(_0x38a1a2,_0x5aed07){_0x38a1a2=_0x38a1a2-0x0;var _0x3ce37a=_0x817b[_0x38a1a2];return _0x3ce37a;};'use strict';var _=require('lodash');var fs=require('fs');var util=require(_0xb817('0x0'));var path=require(_0xb817('0x1'));var moment=require(_0xb817('0x2'));var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0xb817('0x3'));var zipdir=require(_0xb817('0x4'));var rimraf=require('rimraf');var JSDOM=require(_0xb817('0x5'))[_0xb817('0x6')];var window=new JSDOM('')[_0xb817('0x7')];var BPromise=require(_0xb817('0x8'));var db=require(_0xb817('0x9'))['db'];var dbH=require(_0xb817('0x9'))['dbH'];var logger=require('../../config/logger')(_0xb817('0xa'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xb817('0xb')][0x3];var PATH=process[_0xb817('0xb')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0xb817('0xc');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x5c01db,_0x426fd3){var _0x449655={'status':_0x5c01db};var _0x400bf9={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x426fd3){_0x449655['savename']=_0x426fd3;}return db[_0xb817('0xd')][_0xb817('0xe')](_0x449655,_0x400bf9);}function getHeaders(_0x3f1a27){return _[_0xb817('0xf')](_0x3f1a27,function(_0x4b28a7){return{'text':_0x4b28a7,'style':'tableHeader'};});}function getRows(_0x55e4b5,_0x3f90fe){return _['map'](_0x3f90fe,function(_0x2a54e7){return _(_0x2a54e7)['pick'](_0x55e4b5)[_0xb817('0xf')](function(_0x34f513){return _0x34f513?_['toString'](_0x34f513):'';})[_0xb817('0x10')]();});}function createTable(_0x5dbf8f,_0x515f42){var _0x9c3521={'widths':_[_0xb817('0x11')](Array(_0x5dbf8f[_0xb817('0x12')]),0x91),'heights':function(_0x14f495){return _0x14f495===0x0?_0xb817('0x13'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x3223ca=getHeaders(_0x5dbf8f);_0x9c3521[_0xb817('0x14')][_0xb817('0x15')](_0x3223ca);var _0xb6eae1=getRows(_0x5dbf8f,_0x515f42);_0x9c3521['body']=_0x9c3521[_0xb817('0x14')][_0xb817('0x16')](_0xb6eae1);return _0x9c3521;}function createTables(_0xc2c28d){var _0x41c1b2=[];var _0x5eb9c0=_['chunk'](Object[_0xb817('0x17')](_0xc2c28d[0x0]),0x5);_0x5eb9c0[_0xb817('0x18')](function(_0x5b0fbc){_0x41c1b2['push'](createTable(_0x5b0fbc,_0xc2c28d));});return _0x41c1b2;}function getPDFDocDefinition(_0x1eff0f){var _0x2e3b14=util['format'](_0xb817('0x19'),NAME,EXTRACTED_REPORT[_0xb817('0x1a')],moment(EXTRACTED_REPORT['startDate'])['format'](FORMAT),moment(EXTRACTED_REPORT[_0xb817('0x1b')])[_0xb817('0x1c')](FORMAT));var _0x44307d=[];for(var _0x1cf357=0x0;_0x1cf357<_0x1eff0f[_0xb817('0x12')];_0x1cf357++){var _0x53f22c=[];if(_0x1cf357===0x0){_0x53f22c[_0xb817('0x15')]({'text':_0x2e3b14,'style':_0xb817('0x1d')});}var _0x449211={'table':_0x1eff0f[_0x1cf357]};if(_0x1cf357>0x0){_0x449211[_0xb817('0x1e')]=_0xb817('0x1f');_0x449211[_0xb817('0x20')]=[0x0,0x46,0x0,0x0];}_0x53f22c[_0xb817('0x15')](_0x449211);_0x44307d[_0xb817('0x15')](_0x53f22c);}return{'pageSize':'A4','pageOrientation':_0xb817('0x21'),'content':_0x44307d,'footer':function(_0x29f7ff,_0x563cc6){return{'text':_0x29f7ff[_0xb817('0x22')]()+_0xb817('0x23')+_0x563cc6,'style':_0xb817('0x24')};},'defaultStyle':{'font':_0xb817('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xb817('0x26')},'footer':{'alignment':_0xb817('0x27'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x4d4938){var _0x592842=0x1388;var _0x48e45c;if(!_0x4d4938[0x0]['num']){return analyticExtractedReport('Empty');}return db['Setting'][_0xb817('0x28')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xb817('0x29'),_0xb817('0x2a')]})['then'](function(_0x4bac74){if(_0x4bac74){_0x48e45c=_0x4bac74;_0x592842=_0x48e45c[_0xb817('0x2a')]||0x3e8;}})[_0xb817('0x2b')](function(){var _0x2573a2=[];var _0x2ffa5d=0x0;if(_0x48e45c[_0xb817('0x29')]){if(_0x4d4938&&_0x4d4938['length']){var _0xef8ef3=_[_0xb817('0x2c')](_0x4d4938[0x0][_0xb817('0x2d')]/_0x592842);var _0x5a531e=Number[_0xb817('0x2e')](_0x4d4938[0x0][_0xb817('0x2d')]/_0x592842)?_0x4d4938[0x0][_0xb817('0x2d')]%_0x592842:0x0;_0xef8ef3[_0xb817('0x18')](function(_0x560075){if(_0x560075>0x0){_0x2ffa5d+=_0x592842;}_0x2573a2['push'](dbH[_0xb817('0x2f')]['query'](util[_0xb817('0x1c')](_0xb817('0x30'),QUERY,_0x592842,_0x2ffa5d),{'type':dbH['sequelize'][_0xb817('0x31')][_0xb817('0x32')]}));});if(_0x5a531e>0x0){_0x2ffa5d+=_0x592842;_0x2573a2[_0xb817('0x15')](dbH[_0xb817('0x2f')][_0xb817('0x33')](util[_0xb817('0x1c')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x5a531e,_0x2ffa5d),{'type':dbH[_0xb817('0x2f')][_0xb817('0x31')]['SELECT']}));}}}else{_0x2573a2[_0xb817('0x15')](dbH[_0xb817('0x2f')][_0xb817('0x33')](QUERY,{'type':dbH[_0xb817('0x2f')]['QueryTypes'][_0xb817('0x32')]}));}var _0x1a5b5b=path[_0xb817('0x34')](PATH);var _0x2fbd66=path['basename'](PATH,_0xb817('0x35'));var _0x53aeac=_0x48e45c[_0xb817('0x29')]&&_0x2573a2[_0xb817('0x12')]>0x1;var _0x2aea24=[];if(!fs[_0xb817('0x36')](path[_0xb817('0x37')](_0x1a5b5b,_0x2fbd66))&&_0x53aeac){fs[_0xb817('0x38')](path[_0xb817('0x37')](_0x1a5b5b,_0x2fbd66));}return BPromise[_0xb817('0x39')](_0x2573a2,function(_0x3d6ad3){_0x2aea24[_0xb817('0x15')](_0x3d6ad3);})[_0xb817('0x2b')](function(){var _0x3f0737=[];for(var _0x2abf76=0x0;_0x2abf76<_0x2aea24[_0xb817('0x12')];_0x2abf76+=0x1){var _0x5a7a0f=_0x2aea24[_0x2abf76];var _0x3718e5=createTables(_[_0xb817('0x3a')](_0x5a7a0f));var _0x4739c7;var _0x269cf6=getPDFDocDefinition(_0x3718e5);var _0x4e1739=getPDFPrinter();var _0x1b0a5a=_0x4e1739[_0xb817('0x3b')](_0x269cf6);if(_0x53aeac){_0x4739c7=path[_0xb817('0x37')](_0x1a5b5b,_0x2fbd66,util[_0xb817('0x1c')]('%s%d.%s',_0x2fbd66,_0x2abf76,_0xb817('0x3c')));}else{_0x4739c7=path[_0xb817('0x37')](_0x1a5b5b,util['format'](_0xb817('0x3d'),_0x2fbd66,_0xb817('0x3c')));}_0x3f0737[_0xb817('0x15')](writePDFDocument(_0x1b0a5a,_0x4739c7));}return Promise[_0xb817('0x3e')](_0x3f0737);})['then'](function(){if(_0x53aeac){return new Promise(function(_0x5d58a0){zipdir(path[_0xb817('0x37')](_0x1a5b5b,_0x2fbd66),{'saveTo':path['join'](_0x1a5b5b,util[_0xb817('0x1c')](_0xb817('0x3d'),_0x2fbd66,_0xb817('0x3f')))},function(){rimraf(path[_0xb817('0x37')](_0x1a5b5b,_0x2fbd66),function(){});_0x5d58a0(_0xb817('0x40'));});});}})[_0xb817('0x2b')](function(){if(!_0x53aeac)return;rimraf(path[_0xb817('0x37')](_0x1a5b5b,_0x2fbd66),function(){});})[_0xb817('0x2b')](function(){logger[_0xb817('0x41')](util[_0xb817('0x1c')](_0xb817('0x42'),EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport(_0xb817('0x43'),_0x53aeac?util[_0xb817('0x1c')](_0xb817('0x3d'),_0x2fbd66,_0x53aeac?_0xb817('0x3f'):_0xb817('0x3c')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xb817('0x41')](util['format'](_0xb817('0x44'),EXTRACTED_REPORT_ID,_0xb817('0x45')));return db['AnalyticExtractedReport']['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0xb817('0x2b')](function(_0x156388){EXTRACTED_REPORT=_0x156388;return dbH['sequelize']['query'](util['format']('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH['sequelize']['QueryTypes'][_0xb817('0x32')]});})[_0xb817('0x2b')](extractReport)[_0xb817('0x46')](function(_0x35c809){logger[_0xb817('0x41')](util[_0xb817('0x1c')](_0xb817('0x47'),EXTRACTED_REPORT_ID,_0xb817('0x45')),util[_0xb817('0x48')](_0x35c809,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xb817('0x49')](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x33510f=new PdfPrinter({'Arial':{'normal':__dirname+_0xb817('0x4a'),'bold':__dirname+_0xb817('0x4b'),'italics':__dirname+_0xb817('0x4c'),'bolditalics':__dirname+_0xb817('0x4d')}});return _0x33510f;}function getPDFDocDefinitionFromHTML(_0x10790c,_0x307385){var _0x4b420a=util[_0xb817('0x1c')](_0xb817('0x4e'),_0x307385[_0xb817('0x4f')],_0x307385[_0xb817('0x50')]);var _0x133d99=moment()[_0xb817('0x1c')](_0xb817('0x51'))['toString']();var _0xa393e8=htmlToPdfmake(_0x10790c,{'window':window,'tableAutoSize':!![]});return{'content':[_0xa393e8],'defaultStyle':{'font':_0xb817('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xb817('0x52'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xb817('0x52')}},'header':function(){return[{'text':_0xb817('0x53'),'style':_0xb817('0x1d')}];},'footer':function(_0x421a16,_0xc081a0){return[{'text':util[_0xb817('0x1c')](_0xb817('0x54'),_0x4b420a,_0x421a16,_0xc081a0,_0x133d99),'style':_0xb817('0x24')}];}};}function writePDFDocument(_0x5e70af,_0x33df07){return new Promise(function(_0x260b3c,_0x18ebfe){var _0x5d4d36=_0x5e70af[_0xb817('0x55')](fs[_0xb817('0x56')](_0x33df07));_0x5d4d36['on'](_0xb817('0x57'),function(){_0x260b3c(_0xb817('0x57'));});_0x5d4d36['on'](_0xb817('0x58'),function(_0x3a2006){_0x18ebfe(_0x3a2006);});_0x5e70af['end']();});}exports[_0xb817('0x59')]=function(_0x3f2dfb,_0x3709b9){var _0x1ec477=getPDFPrinter();var _0x57e321=getPDFDocDefinitionFromHTML(_0x3f2dfb,_0x3709b9);var _0x3a7211=_0x1ec477['createPdfKitDocument'](_0x57e321);return writePDFDocument(_0x3a7211,_0x3709b9['path'])[_0xb817('0x46')](function(_0x29803a){throw _0x29803a;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 8ad7bea..54dbf85 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 _0x77b5=['each','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','inspect','exit','path','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','find','split','splitSizeXlsx','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','num','Empty','length','isInteger','forEach','push','format','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','.xlsx','join','mkdirSync'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x77b5,0x107));var _0x577b=function(_0x197ed8,_0x11c538){_0x197ed8=_0x197ed8-0x0;var _0x3e0263=_0x77b5[_0x197ed8];return _0x3e0263;};'use strict';var util=require('util');var path=require(_0x577b('0x0'));var _=require(_0x577b('0x1'));var fs=require('fs');var json2xls=require(_0x577b('0x2'));var BPromise=require(_0x577b('0x3'));var zipdir=require(_0x577b('0x4'));var rimraf=require(_0x577b('0x5'));var db=require(_0x577b('0x6'))['db'];var dbH=require(_0x577b('0x6'))[_0x577b('0x7')];var logger=require(_0x577b('0x8'))(_0x577b('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x577b('0xa')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x577b('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x59b340,_0x32b301){var _0x1cee86={'status':_0x59b340};var _0x1c0401={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x32b301){_0x1cee86[_0x577b('0xb')]=_0x32b301;}return db['AnalyticExtractedReport'][_0x577b('0xc')](_0x1cee86,_0x1c0401);}function main(){var _0x505e7d=0x1388;var _0x48832f;logger[_0x577b('0xd')](util['format'](_0x577b('0xe'),EXTRACTED_REPORT_ID,_0x577b('0xf')));return db['Setting'][_0x577b('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x577b('0x11'),_0x577b('0x12')]})[_0x577b('0x13')](function(_0x3188e4){if(_0x3188e4){_0x48832f=_0x3188e4;_0x505e7d=_0x48832f[_0x577b('0x12')]||0x1388;}})['then'](function(){return dbH['sequelize'][_0x577b('0x14')](util['format'](_0x577b('0x15'),QUERY),{'type':dbH[_0x577b('0x16')][_0x577b('0x17')][_0x577b('0x18')]});})[_0x577b('0x13')](function(_0x69ecc2){if(!_0x69ecc2[0x0][_0x577b('0x19')]){return analyticExtractedReport(_0x577b('0x1a'));}var _0xb6e114=[];var _0x10d6bb=0x0;if(_0x48832f[_0x577b('0x11')]){if(_0x69ecc2&&_0x69ecc2[_0x577b('0x1b')]){var _0x7a1054=_['range'](_0x69ecc2[0x0][_0x577b('0x19')]/_0x505e7d);var _0x1902e0=Number[_0x577b('0x1c')](_0x69ecc2[0x0][_0x577b('0x19')]/_0x505e7d)?_0x69ecc2[0x0][_0x577b('0x19')]%_0x505e7d:0x0;_0x7a1054[_0x577b('0x1d')](function(_0x255910){if(_0x255910>0x0){_0x10d6bb+=_0x505e7d;}_0xb6e114[_0x577b('0x1e')](dbH[_0x577b('0x16')][_0x577b('0x14')](util[_0x577b('0x1f')](_0x577b('0x20'),QUERY,_0x505e7d,_0x10d6bb),{'type':dbH[_0x577b('0x16')][_0x577b('0x17')][_0x577b('0x18')]}));});if(_0x1902e0>0x0){_0x10d6bb+=_0x505e7d;_0xb6e114[_0x577b('0x1e')](dbH[_0x577b('0x16')][_0x577b('0x14')](util['format'](_0x577b('0x20'),QUERY,_0x1902e0,_0x10d6bb),{'type':dbH[_0x577b('0x16')][_0x577b('0x17')][_0x577b('0x18')]}));}}}else{_0xb6e114[_0x577b('0x1e')](dbH[_0x577b('0x16')][_0x577b('0x14')](QUERY,{'type':dbH[_0x577b('0x16')][_0x577b('0x17')][_0x577b('0x18')]}));}var _0xa30104=path[_0x577b('0x21')](PATH);var _0x125d04=path['basename'](PATH,_0x577b('0x22'));var _0x57f3bc=_0x48832f['split']&&_0xb6e114[_0x577b('0x1b')]>0x1;var _0xe873be=[];if(!fs['existsSync'](path[_0x577b('0x23')](_0xa30104,_0x125d04))&&_0x57f3bc){fs[_0x577b('0x24')](path[_0x577b('0x23')](_0xa30104,_0x125d04));}return BPromise[_0x577b('0x25')](_0xb6e114,function(_0xfb87c0){_0xe873be[_0x577b('0x1e')](_0xfb87c0);})[_0x577b('0x13')](function(){for(var _0x420cde=0x0;_0x420cde<_0xe873be[_0x577b('0x1b')];_0x420cde+=0x1){var _0x926776;var _0x581786=_0xe873be[_0x420cde];if(_0x57f3bc){_0x926776=path[_0x577b('0x23')](_0xa30104,_0x125d04,util['format'](_0x577b('0x26'),_0x125d04,_0x420cde,_0x577b('0x27')));}else{_0x926776=path[_0x577b('0x23')](_0xa30104,util[_0x577b('0x1f')](_0x577b('0x28'),_0x125d04,_0x577b('0x27')));}fs[_0x577b('0x29')](_0x926776,json2xls(_0x581786),_0x577b('0x2a'));}})['then'](function(){if(_0x57f3bc){return new Promise(function(_0x1d32ad){zipdir(path['join'](_0xa30104,_0x125d04),{'saveTo':path['join'](_0xa30104,util['format'](_0x577b('0x28'),_0x125d04,_0x577b('0x2b')))},function(_0xa87118,_0x55dbc5){rimraf(path[_0x577b('0x23')](_0xa30104,_0x125d04),function(){});_0x1d32ad(_0x577b('0x2c'));});});}})['then'](function(){logger['info'](util['format'](_0x577b('0x2d'),EXTRACTED_REPORT_ID,_0x577b('0xf')));return analyticExtractedReport(_0x577b('0x2e'),_0x57f3bc?util[_0x577b('0x1f')]('%s.%s',_0x125d04,_0x57f3bc?_0x577b('0x2b'):_0x577b('0x27')):null);});})[_0x577b('0x2f')](function(_0x1dfba4){logger[_0x577b('0xd')](util[_0x577b('0x1f')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'XLSX'),util[_0x577b('0x30')](_0x1dfba4,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})['finally'](function(){process[_0x577b('0x31')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xc600=['then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','range','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','format','dirname','basename','.xlsx','join','mkdirSync','%s%d.%s','%s.%s','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','xlsx','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','lodash','json2xls','bluebird','zip-dir','../../mysqldb','dbH','argv','savename','AnalyticExtractedReport','update','info','XLSX','Setting','find','split','splitSizeXlsx'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc600,0x11a));var _0x0c60=function(_0x2f029a,_0x2005aa){_0x2f029a=_0x2f029a-0x0;var _0x4ac44d=_0xc600[_0x2f029a];return _0x4ac44d;};'use strict';var util=require(_0x0c60('0x0'));var path=require(_0x0c60('0x1'));var _=require(_0x0c60('0x2'));var fs=require('fs');var json2xls=require(_0x0c60('0x3'));var BPromise=require(_0x0c60('0x4'));var zipdir=require(_0x0c60('0x5'));var rimraf=require('rimraf');var db=require(_0x0c60('0x6'))['db'];var dbH=require(_0x0c60('0x6'))[_0x0c60('0x7')];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x0c60('0x8')][0x2]);var QUERY=process[_0x0c60('0x8')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2de496,_0x31342d){var _0x3d55ef={'status':_0x2de496};var _0x14d2cb={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x31342d){_0x3d55ef[_0x0c60('0x9')]=_0x31342d;}return db[_0x0c60('0xa')][_0x0c60('0xb')](_0x3d55ef,_0x14d2cb);}function main(){var _0x547629=0x1388;var _0x25cf3b;logger[_0x0c60('0xc')](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x0c60('0xd')));return db[_0x0c60('0xe')][_0x0c60('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x0c60('0x10'),_0x0c60('0x11')]})[_0x0c60('0x12')](function(_0x6f923c){if(_0x6f923c){_0x25cf3b=_0x6f923c;_0x547629=_0x25cf3b[_0x0c60('0x11')]||0x1388;}})['then'](function(){return dbH[_0x0c60('0x13')][_0x0c60('0x14')](util['format'](_0x0c60('0x15'),QUERY),{'type':dbH[_0x0c60('0x13')][_0x0c60('0x16')][_0x0c60('0x17')]});})[_0x0c60('0x12')](function(_0x29108d){if(!_0x29108d[0x0][_0x0c60('0x18')]){return analyticExtractedReport(_0x0c60('0x19'));}var _0x57355d=[];var _0x51a73b=0x0;if(_0x25cf3b[_0x0c60('0x10')]){if(_0x29108d&&_0x29108d[_0x0c60('0x1a')]){var _0x350198=_[_0x0c60('0x1b')](_0x29108d[0x0][_0x0c60('0x18')]/_0x547629);var _0x4d3c23=Number['isInteger'](_0x29108d[0x0][_0x0c60('0x18')]/_0x547629)?_0x29108d[0x0][_0x0c60('0x18')]%_0x547629:0x0;_0x350198[_0x0c60('0x1c')](function(_0x455573){if(_0x455573>0x0){_0x51a73b+=_0x547629;}_0x57355d[_0x0c60('0x1d')](dbH[_0x0c60('0x13')][_0x0c60('0x14')](util['format'](_0x0c60('0x1e'),QUERY,_0x547629,_0x51a73b),{'type':dbH[_0x0c60('0x13')]['QueryTypes']['SELECT']}));});if(_0x4d3c23>0x0){_0x51a73b+=_0x547629;_0x57355d['push'](dbH[_0x0c60('0x13')]['query'](util[_0x0c60('0x1f')](_0x0c60('0x1e'),QUERY,_0x4d3c23,_0x51a73b),{'type':dbH[_0x0c60('0x13')][_0x0c60('0x16')][_0x0c60('0x17')]}));}}}else{_0x57355d[_0x0c60('0x1d')](dbH[_0x0c60('0x13')][_0x0c60('0x14')](QUERY,{'type':dbH[_0x0c60('0x13')][_0x0c60('0x16')][_0x0c60('0x17')]}));}var _0x94719=path[_0x0c60('0x20')](PATH);var _0x14ffbe=path[_0x0c60('0x21')](PATH,_0x0c60('0x22'));var _0x3c5ad9=_0x25cf3b[_0x0c60('0x10')]&&_0x57355d[_0x0c60('0x1a')]>0x1;var _0x46bde2=[];if(!fs['existsSync'](path[_0x0c60('0x23')](_0x94719,_0x14ffbe))&&_0x3c5ad9){fs[_0x0c60('0x24')](path[_0x0c60('0x23')](_0x94719,_0x14ffbe));}return BPromise['each'](_0x57355d,function(_0xd75015){_0x46bde2[_0x0c60('0x1d')](_0xd75015);})[_0x0c60('0x12')](function(){for(var _0x5b7a08=0x0;_0x5b7a08<_0x46bde2['length'];_0x5b7a08+=0x1){var _0x5729fe;var _0x52b796=_0x46bde2[_0x5b7a08];if(_0x3c5ad9){_0x5729fe=path[_0x0c60('0x23')](_0x94719,_0x14ffbe,util[_0x0c60('0x1f')](_0x0c60('0x25'),_0x14ffbe,_0x5b7a08,'xlsx'));}else{_0x5729fe=path[_0x0c60('0x23')](_0x94719,util[_0x0c60('0x1f')](_0x0c60('0x26'),_0x14ffbe,'xlsx'));}fs[_0x0c60('0x27')](_0x5729fe,json2xls(_0x52b796),'binary');}})[_0x0c60('0x12')](function(){if(_0x3c5ad9){return new Promise(function(_0x11f2e3){zipdir(path[_0x0c60('0x23')](_0x94719,_0x14ffbe),{'saveTo':path[_0x0c60('0x23')](_0x94719,util[_0x0c60('0x1f')]('%s.%s',_0x14ffbe,_0x0c60('0x28')))},function(_0x343cb8,_0x27404f){rimraf(path[_0x0c60('0x23')](_0x94719,_0x14ffbe),function(){});_0x11f2e3(_0x0c60('0x29'));});});}})[_0x0c60('0x12')](function(){logger[_0x0c60('0xc')](util['format'](_0x0c60('0x2a'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0x0c60('0x2b'),_0x3c5ad9?util['format'](_0x0c60('0x26'),_0x14ffbe,_0x3c5ad9?'zip':_0x0c60('0x2c')):null);});})['catch'](function(_0x572b1c){logger[_0x0c60('0xc')](util[_0x0c60('0x1f')](_0x0c60('0x2d'),EXTRACTED_REPORT_ID,_0x0c60('0xd')),util[_0x0c60('0x2e')](_0x572b1c,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x0c60('0x2f'));})[_0x0c60('0x30')](function(){process[_0x0c60('0x31')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index b2fd3f8..d45a8a9 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 _0xc9a4=['context','VoiceExtensionId','type','inbound','push','outbound','extension','CDR(destination)=','${EXTEN:','cutdigits','${EXTEN}','CDR(routeid)=','ExecIf','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','recordingFormat','none','wav','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','length','toLowerCase','updatedAt','interval','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','answer','indexOf','app','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','last','concat','Hangup','destroy','bulkCreate','error','rewrite','lodash','util','models','then','intervals','VoiceExtension','findAll','IntervalId','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','queue','playback','hasOwnProperty','priority','extensions','find','Set','format','CDR(type)=%s'];(function(_0x8414fc,_0x4f4b62){var _0xf3fcdb=function(_0x3c0b6b){while(--_0x3c0b6b){_0x8414fc['push'](_0x8414fc['shift']());}};_0xf3fcdb(++_0x4f4b62);}(_0xc9a4,0x70));var _0x4c9a=function(_0x47f089,_0x3eeb82){_0x47f089=_0x47f089-0x0;var _0x125715=_0xc9a4[_0x47f089];return _0x125715;};'use strict';var _=require(_0x4c9a('0x0'));var util=require(_0x4c9a('0x1'));function rewrite(_0x2bcfdc,_0xa10587){var _0x2bdff7=this;return _0x2bcfdc[_0x4c9a('0x2')]['Interval']['findAll']({'raw':!![]})[_0x4c9a('0x3')](function(_0x275c38){_0x2bdff7[_0x4c9a('0x4')]=_0x275c38;return _0x2bcfdc[_0x4c9a('0x2')][_0x4c9a('0x5')][_0x4c9a('0x6')]({'where':{'IntervalId':_0xa10587[_0x4c9a('0x7')]},'raw':!![]});})['then'](function(_0x436581){return _0x2bcfdc[_0x4c9a('0x2')][_0x4c9a('0x5')][_0x4c9a('0x6')]({'where':{'exten':{'$in':_[_0x4c9a('0x8')](_[_0x4c9a('0x9')](_0x436581,_0x4c9a('0xa')))}},'order':[{'raw':_0x4c9a('0xb')}],'raw':!![]});})[_0x4c9a('0x3')](function(_0x30e8ae){var _0x525ad8=_[_0x4c9a('0xc')](_0x30e8ae,{'priority':'1'});var _0x551962=_[_0x4c9a('0xc')](_0x30e8ae,{'isApp':0x1});var _0x2839e6=_['groupBy'](_0x551962,_0x4c9a('0xa'));var _0x1f51fc=[_0x4c9a('0xd'),_0x4c9a('0xe')];var _0x2084cc=[];var _0x108901=[];for(var _0x3ea9aa in _0x2839e6){if(_0x2839e6[_0x4c9a('0xf')](_0x3ea9aa)){_0x2bdff7[_0x4c9a('0x10')]=0x2;_0x2bdff7[_0x4c9a('0x11')]=[];_0x2bdff7['extension']=_[_0x4c9a('0x12')](_0x525ad8,{'exten':_0x2839e6[_0x3ea9aa][0x0][_0x4c9a('0xa')]});_0x2bdff7[_0x4c9a('0x11')]['push']({'type':_0x2839e6[_0x3ea9aa][0x0]['type'],'app':_0x4c9a('0x13'),'appdata':util[_0x4c9a('0x14')](_0x4c9a('0x15'),_0x2839e6[_0x3ea9aa][0x0]['type']),'context':_0x2839e6[_0x3ea9aa][0x0][_0x4c9a('0x16')],'exten':_0x2839e6[_0x3ea9aa][0x0][_0x4c9a('0xa')],'priority':_0x2bdff7[_0x4c9a('0x10')]++,'VoiceExtensionId':_0x2839e6[_0x3ea9aa][0x0][_0x4c9a('0x17')]});if(_0x2839e6[_0x3ea9aa][0x0][_0x4c9a('0x18')]===_0x4c9a('0x19')){_0x2bdff7[_0x4c9a('0x11')][_0x4c9a('0x1a')]({'type':_0x2839e6[_0x3ea9aa][0x0]['type'],'app':'Set','appdata':'CDR(routeid)='+_0x2839e6[_0x3ea9aa][0x0]['VoiceExtensionId'],'context':_0x2839e6[_0x3ea9aa][0x0][_0x4c9a('0x16')],'exten':_0x2839e6[_0x3ea9aa][0x0][_0x4c9a('0xa')],'priority':_0x2bdff7[_0x4c9a('0x10')]++,'VoiceExtensionId':_0x2839e6[_0x3ea9aa][0x0][_0x4c9a('0x17')]});}else if(_0x2839e6[_0x3ea9aa][0x0][_0x4c9a('0x18')]===_0x4c9a('0x1b')){if(_0x2bdff7[_0x4c9a('0x1c')]){_0x2bdff7[_0x4c9a('0x11')][_0x4c9a('0x1a')]({'type':_0x2839e6[_0x3ea9aa][0x0]['type'],'app':_0x4c9a('0x13'),'appdata':_0x4c9a('0x1d')+(_0x2bdff7['extension']['cutdigits']?_0x4c9a('0x1e')+_0x2bdff7['extension'][_0x4c9a('0x1f')]+'}':_0x4c9a('0x20')),'context':_0x2839e6[_0x3ea9aa][0x0][_0x4c9a('0x16')],'exten':_0x2839e6[_0x3ea9aa][0x0][_0x4c9a('0xa')],'priority':_0x2bdff7['priority']++,'VoiceExtensionId':_0x2839e6[_0x3ea9aa][0x0][_0x4c9a('0x17')]});}_0x2bdff7[_0x4c9a('0x11')][_0x4c9a('0x1a')]({'type':_0x2839e6[_0x3ea9aa][0x0][_0x4c9a('0x18')],'app':_0x4c9a('0x13'),'appdata':_0x4c9a('0x21')+_0x2839e6[_0x3ea9aa][0x0][_0x4c9a('0x17')],'context':_0x2839e6[_0x3ea9aa][0x0][_0x4c9a('0x16')],'exten':_0x2839e6[_0x3ea9aa][0x0]['exten'],'priority':_0x2bdff7[_0x4c9a('0x10')]++,'VoiceExtensionId':_0x2839e6[_0x3ea9aa][0x0]['VoiceExtensionId']});var _0x3acc9a=_0x2bdff7[_0x4c9a('0x10')]++;_0x2bdff7[_0x4c9a('0x11')]['push']({'type':_0x2839e6[_0x3ea9aa][0x0][_0x4c9a('0x18')],'app':_0x4c9a('0x22'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x3acc9a+0x2)+'):Goto('+(_0x3acc9a+0x1)+')','context':_0x2839e6[_0x3ea9aa][0x0]['context'],'exten':_0x2839e6[_0x3ea9aa][0x0][_0x4c9a('0xa')],'priority':_0x3acc9a,'VoiceExtensionId':_0x2839e6[_0x3ea9aa][0x0]['VoiceExtensionId']});if(_0x2bdff7[_0x4c9a('0x1c')]){_0x2bdff7[_0x4c9a('0x11')][_0x4c9a('0x1a')]({'type':_0x2839e6[_0x3ea9aa][0x0]['type'],'app':_0x4c9a('0x13'),'appdata':_0x2bdff7[_0x4c9a('0x1c')][_0x4c9a('0x1f')]?_0x4c9a('0x23')+_0x2bdff7[_0x4c9a('0x1c')][_0x4c9a('0x1f')]+'}':_0x4c9a('0x24'),'context':_0x2839e6[_0x3ea9aa][0x0][_0x4c9a('0x16')],'exten':_0x2839e6[_0x3ea9aa][0x0][_0x4c9a('0xa')],'priority':_0x2bdff7[_0x4c9a('0x10')]++,'VoiceExtensionId':_0x2839e6[_0x3ea9aa][0x0]['VoiceExtensionId']});}_0x2bdff7[_0x4c9a('0x11')]['push']({'type':_0x2839e6[_0x3ea9aa][0x0][_0x4c9a('0x18')],'app':_0x4c9a('0x13'),'appdata':'outboundrouteid='+_0x2839e6[_0x3ea9aa][0x0]['VoiceExtensionId'],'context':_0x2839e6[_0x3ea9aa][0x0][_0x4c9a('0x16')],'exten':_0x2839e6[_0x3ea9aa][0x0][_0x4c9a('0xa')],'priority':_0x2bdff7[_0x4c9a('0x10')]++,'VoiceExtensionId':_0x2839e6[_0x3ea9aa][0x0][_0x4c9a('0x17')]});if(_0x2bdff7[_0x4c9a('0x1c')]&&_0x2bdff7['extension']['hasOwnProperty'](_0x4c9a('0x25'))&&_0x2bdff7[_0x4c9a('0x1c')][_0x4c9a('0x25')]!==_0x4c9a('0x26')){_0x2bdff7[_0x4c9a('0x11')][_0x4c9a('0x1a')]({'type':_0x2839e6[_0x3ea9aa][0x0]['type'],'app':_0x4c9a('0x13'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x2839e6[_0x3ea9aa][0x0]['context'],'exten':_0x2839e6[_0x3ea9aa][0x0][_0x4c9a('0xa')],'priority':_0x2bdff7[_0x4c9a('0x10')]++,'VoiceExtensionId':_0x2839e6[_0x3ea9aa][0x0]['VoiceExtensionId']});_0x2bdff7[_0x4c9a('0x11')][_0x4c9a('0x1a')]({'type':_0x2839e6[_0x3ea9aa][0x0]['type'],'app':'Set','appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x2bdff7[_0x4c9a('0x1c')][_0x4c9a('0x25')]||_0x4c9a('0x27'),'context':_0x2839e6[_0x3ea9aa][0x0][_0x4c9a('0x16')],'exten':_0x2839e6[_0x3ea9aa][0x0]['exten'],'priority':_0x2bdff7[_0x4c9a('0x10')]++,'VoiceExtensionId':_0x2839e6[_0x3ea9aa][0x0][_0x4c9a('0x17')]});}}_0x2bdff7[_0x4c9a('0x11')][_0x4c9a('0x1a')]({'type':_0x2839e6[_0x3ea9aa][0x0]['type'],'app':_0x4c9a('0x13'),'appdata':_0x4c9a('0x28'),'context':_0x2839e6[_0x3ea9aa][0x0][_0x4c9a('0x16')],'exten':_0x2839e6[_0x3ea9aa][0x0][_0x4c9a('0xa')],'priority':_0x2bdff7[_0x4c9a('0x10')]++,'VoiceExtensionId':_0x2839e6[_0x3ea9aa][0x0][_0x4c9a('0x17')]});_0x2bdff7['extensions'][_0x4c9a('0x1a')]({'type':_0x2839e6[_0x3ea9aa][0x0]['type'],'app':_0x4c9a('0x13'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x2839e6[_0x3ea9aa][0x0][_0x4c9a('0x16')],'exten':_0x2839e6[_0x3ea9aa][0x0][_0x4c9a('0xa')],'priority':_0x2bdff7['priority']++,'VoiceExtensionId':_0x2839e6[_0x3ea9aa][0x0][_0x4c9a('0x17')]});_0x2bdff7[_0x4c9a('0x11')]['push']({'type':_0x2839e6[_0x3ea9aa][0x0][_0x4c9a('0x18')],'app':_0x4c9a('0x13'),'appdata':_0x4c9a('0x29'),'context':_0x2839e6[_0x3ea9aa][0x0][_0x4c9a('0x16')],'exten':_0x2839e6[_0x3ea9aa][0x0][_0x4c9a('0xa')],'priority':_0x2bdff7[_0x4c9a('0x10')]++,'VoiceExtensionId':_0x2839e6[_0x3ea9aa][0x0]['VoiceExtensionId']});for(var _0x517684=0x0,_0x2f5fd6=0x0;_0x517684<_0x2839e6[_0x3ea9aa][_0x4c9a('0x2a')];_0x517684+=0x1,_0x2f5fd6=0x0){var _0x102bfa=_0x2839e6[_0x3ea9aa][_0x517684];if(_0x102bfa[_0x4c9a('0x18')]){_0x102bfa[_0x4c9a('0x18')]=_0x102bfa[_0x4c9a('0x18')][_0x4c9a('0x2b')]();}var _0x317223=[];var _0x1ae82e=[];delete _0x102bfa['id'];delete _0x102bfa['createdAt'];delete _0x102bfa[_0x4c9a('0x2c')];var _0x2e7617=_0x102bfa[_0x4c9a('0x2d')]!=='*,*,*,*'?[_0x102bfa['interval']]:_0x102bfa['IntervalId']?_[_0x4c9a('0x9')](_['filter'](_0x2bdff7[_0x4c9a('0x4')],{'IntervalId':_0x102bfa['IntervalId']}),_0x4c9a('0x2d')):[];if(_0x102bfa['hasOwnProperty'](_0x4c9a('0x2e'))){if(_0x102bfa[_0x4c9a('0x2e')]&&_0x102bfa[_0x4c9a('0x2e')]!=='--'){_0x317223['push']({'type':_0x102bfa[_0x4c9a('0x18')],'app':_0x4c9a('0x13'),'appdata':_0x4c9a('0x2f')+_0x102bfa[_0x4c9a('0x2e')],'context':_0x102bfa[_0x4c9a('0x16')],'exten':_0x102bfa[_0x4c9a('0xa')],'priority':_0x2e7617[_0x4c9a('0x2a')]+_0x2bdff7[_0x4c9a('0x10')]+_0x2f5fd6++,'VoiceExtensionId':_0x102bfa[_0x4c9a('0x17')]});}}if(_0x102bfa[_0x4c9a('0x18')]===_0x4c9a('0x1b')&&_0x102bfa[_0x4c9a('0xf')](_0x4c9a('0x30'))){if(_0x102bfa[_0x4c9a('0x30')]){_0x317223[_0x4c9a('0x1a')]({'type':_0x102bfa[_0x4c9a('0x18')],'app':_0x4c9a('0x22'),'appdata':_0x4c9a('0x31')+_0x102bfa[_0x4c9a('0x30')]+')','context':_0x102bfa[_0x4c9a('0x16')],'exten':_0x102bfa[_0x4c9a('0xa')],'priority':_0x2e7617['length']+_0x2bdff7[_0x4c9a('0x10')]+_0x2f5fd6++,'VoiceExtensionId':_0x102bfa[_0x4c9a('0x17')]});}else{_0x317223['push']({'type':_0x102bfa[_0x4c9a('0x18')],'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x102bfa['context'],'exten':_0x102bfa[_0x4c9a('0xa')],'priority':_0x2e7617[_0x4c9a('0x2a')]+_0x2bdff7[_0x4c9a('0x10')]+_0x2f5fd6++,'VoiceExtensionId':_0x102bfa['VoiceExtensionId']});}}if(_0x102bfa['hasOwnProperty'](_0x4c9a('0x32'))){if(_0x1f51fc[_0x4c9a('0x33')](_0x102bfa[_0x4c9a('0x34')][_0x4c9a('0x2b')]())>=0x0&&_0x102bfa[_0x4c9a('0x35')]!=='custom'){if(_0x102bfa[_0x4c9a('0x32')]){_0x317223['push']({'type':_0x102bfa[_0x4c9a('0x18')],'app':_0x4c9a('0x22'),'appdata':_0x4c9a('0x36'),'context':_0x102bfa[_0x4c9a('0x16')],'exten':_0x102bfa[_0x4c9a('0xa')],'priority':_0x2e7617[_0x4c9a('0x2a')]+_0x2bdff7[_0x4c9a('0x10')]+_0x2f5fd6++,'VoiceExtensionId':_0x102bfa[_0x4c9a('0x17')]});_0x317223[_0x4c9a('0x1a')]({'type':_0x102bfa[_0x4c9a('0x18')],'app':_0x4c9a('0x13'),'appdata':_0x4c9a('0x37'),'context':_0x102bfa['context'],'exten':_0x102bfa[_0x4c9a('0xa')],'priority':_0x2e7617[_0x4c9a('0x2a')]+_0x2bdff7[_0x4c9a('0x10')]+_0x2f5fd6++,'VoiceExtensionId':_0x102bfa[_0x4c9a('0x17')]});}else{_0x317223['push']({'type':_0x102bfa[_0x4c9a('0x18')],'app':_0x4c9a('0x22'),'appdata':_0x4c9a('0x38'),'context':_0x102bfa['context'],'exten':_0x102bfa['exten'],'priority':_0x2e7617[_0x4c9a('0x2a')]+_0x2bdff7[_0x4c9a('0x10')]+_0x2f5fd6++,'VoiceExtensionId':_0x102bfa['VoiceExtensionId']});_0x317223[_0x4c9a('0x1a')]({'type':_0x102bfa[_0x4c9a('0x18')],'app':_0x4c9a('0x13'),'appdata':_0x4c9a('0x39'),'context':_0x102bfa['context'],'exten':_0x102bfa[_0x4c9a('0xa')],'priority':_0x2e7617[_0x4c9a('0x2a')]+_0x2bdff7[_0x4c9a('0x10')]+_0x2f5fd6++,'VoiceExtensionId':_0x102bfa[_0x4c9a('0x17')]});}}}for(var _0x6bb884=0x0;_0x6bb884<_0x2e7617[_0x4c9a('0x2a')];_0x6bb884+=0x1){var _0x28a6e7=_0x2bdff7[_0x4c9a('0x10')]+_0x2e7617[_0x4c9a('0x2a')];var _0x236681=_0x6bb884===_0x2e7617[_0x4c9a('0x2a')]-0x1?_0x2bdff7[_0x4c9a('0x10')]+_0x317223[_0x4c9a('0x2a')]+_0x1ae82e['length']+0x2:_0x2bdff7['priority']+_0x6bb884+0x1;_0x317223[_0x4c9a('0x3a')](_0x6bb884,0x0,{'type':_0x102bfa[_0x4c9a('0x18')],'app':'GotoIfTime','appdata':_0x2e7617[_0x6bb884]+'?'+_0x102bfa['context']+_0x4c9a('0x3b')+_0x28a6e7+':'+_0x102bfa['context']+_0x4c9a('0x3b')+_0x236681,'exten':_0x102bfa[_0x4c9a('0xa')],'context':_0x102bfa['context'],'priority':_0x2bdff7[_0x4c9a('0x10')]+_0x6bb884,'VoiceExtensionId':_0x2839e6[_0x3ea9aa][0x0]['VoiceExtensionId']});}_0x102bfa[_0x4c9a('0x10')]=_0x317223[_0x4c9a('0x2a')]?_[_0x4c9a('0x3c')](_0x317223)['priority']+0x1:_0x2bdff7[_0x4c9a('0x10')];_0x2bdff7['priority']=(_0x1ae82e[_0x4c9a('0x2a')]?_[_0x4c9a('0x3c')](_0x1ae82e)['priority']:_0x102bfa['priority'])+0x1;_0x2bdff7[_0x4c9a('0x11')]=_[_0x4c9a('0x3d')](_0x2bdff7[_0x4c9a('0x11')],_0x317223,[_0x102bfa],_0x1ae82e);}_0x2bdff7[_0x4c9a('0x11')][_0x4c9a('0x1a')]({'type':_0x2839e6[_0x3ea9aa][0x0][_0x4c9a('0x18')],'app':_0x4c9a('0x3e'),'exten':_0x2839e6[_0x3ea9aa][0x0][_0x4c9a('0xa')],'context':_0x2839e6[_0x3ea9aa][0x0][_0x4c9a('0x16')],'priority':_0x2bdff7[_0x4c9a('0x10')],'VoiceExtensionId':_0x2839e6[_0x3ea9aa][0x0][_0x4c9a('0x17')]});_0x2084cc['push'](_0x2839e6[_0x3ea9aa][0x0][_0x4c9a('0x17')]);_0x108901=_[_0x4c9a('0x3d')](_0x108901,_0x2bdff7[_0x4c9a('0x11')]);}}return _0x2bcfdc['transaction'](function(_0xce66a6){return _0x2bcfdc['models'][_0x4c9a('0x5')][_0x4c9a('0x3f')]({'where':{'VoiceExtensionId':{'$in':_0x2084cc}},'transaction':_0xce66a6})['then'](function(_0x55bbf9){return _0x2bcfdc[_0x4c9a('0x2')][_0x4c9a('0x5')][_0x4c9a('0x40')](_['sortBy'](_0x108901,'priority'),{'transaction':_0xce66a6});});});})['catch'](function(_0x5f4fac){console[_0x4c9a('0x41')](_0x5f4fac);});}exports[_0x4c9a('0x42')]=rewrite; \ No newline at end of file +var _0x6e73=['toLowerCase','createdAt','updatedAt','interval','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','last','concat','transaction','bulkCreate','sortBy','catch','error','rewrite','lodash','models','findAll','then','intervals','VoiceExtension','IntervalId','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','priority','extension','find','extensions','push','type','Set','format','context','VoiceExtensionId','inbound','CDR(routeid)=','outbound','${EXTEN:','cutdigits','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length'];(function(_0x1cbf75,_0x5af501){var _0x4118ae=function(_0x117990){while(--_0x117990){_0x1cbf75['push'](_0x1cbf75['shift']());}};_0x4118ae(++_0x5af501);}(_0x6e73,0xa5));var _0x36e7=function(_0x46ecc2,_0x30a00a){_0x46ecc2=_0x46ecc2-0x0;var _0x54a297=_0x6e73[_0x46ecc2];return _0x54a297;};'use strict';var _=require(_0x36e7('0x0'));var util=require('util');function rewrite(_0x2ad896,_0x136872){var _0x5048cf=this;return _0x2ad896[_0x36e7('0x1')]['Interval'][_0x36e7('0x2')]({'raw':!![]})[_0x36e7('0x3')](function(_0x584d32){_0x5048cf[_0x36e7('0x4')]=_0x584d32;return _0x2ad896[_0x36e7('0x1')][_0x36e7('0x5')]['findAll']({'where':{'IntervalId':_0x136872[_0x36e7('0x6')]},'raw':!![]});})[_0x36e7('0x3')](function(_0x355c51){return _0x2ad896[_0x36e7('0x1')][_0x36e7('0x5')][_0x36e7('0x2')]({'where':{'exten':{'$in':_[_0x36e7('0x7')](_[_0x36e7('0x8')](_0x355c51,_0x36e7('0x9')))}},'order':[{'raw':_0x36e7('0xa')}],'raw':!![]});})[_0x36e7('0x3')](function(_0x1385b0){var _0x2c6a95=_[_0x36e7('0xb')](_0x1385b0,{'priority':'1'});var _0x5ed5fa=_[_0x36e7('0xb')](_0x1385b0,{'isApp':0x1});var _0x20f8d2=_[_0x36e7('0xc')](_0x5ed5fa,_0x36e7('0x9'));var _0x5933d0=[_0x36e7('0xd'),_0x36e7('0xe')];var _0x29b39f=[];var _0x7e087=[];for(var _0x1eff3c in _0x20f8d2){if(_0x20f8d2[_0x36e7('0xf')](_0x1eff3c)){_0x5048cf[_0x36e7('0x10')]=0x2;_0x5048cf['extensions']=[];_0x5048cf[_0x36e7('0x11')]=_[_0x36e7('0x12')](_0x2c6a95,{'exten':_0x20f8d2[_0x1eff3c][0x0][_0x36e7('0x9')]});_0x5048cf[_0x36e7('0x13')][_0x36e7('0x14')]({'type':_0x20f8d2[_0x1eff3c][0x0][_0x36e7('0x15')],'app':_0x36e7('0x16'),'appdata':util[_0x36e7('0x17')]('CDR(type)=%s',_0x20f8d2[_0x1eff3c][0x0][_0x36e7('0x15')]),'context':_0x20f8d2[_0x1eff3c][0x0][_0x36e7('0x18')],'exten':_0x20f8d2[_0x1eff3c][0x0][_0x36e7('0x9')],'priority':_0x5048cf['priority']++,'VoiceExtensionId':_0x20f8d2[_0x1eff3c][0x0][_0x36e7('0x19')]});if(_0x20f8d2[_0x1eff3c][0x0][_0x36e7('0x15')]===_0x36e7('0x1a')){_0x5048cf[_0x36e7('0x13')][_0x36e7('0x14')]({'type':_0x20f8d2[_0x1eff3c][0x0][_0x36e7('0x15')],'app':_0x36e7('0x16'),'appdata':_0x36e7('0x1b')+_0x20f8d2[_0x1eff3c][0x0][_0x36e7('0x19')],'context':_0x20f8d2[_0x1eff3c][0x0][_0x36e7('0x18')],'exten':_0x20f8d2[_0x1eff3c][0x0][_0x36e7('0x9')],'priority':_0x5048cf[_0x36e7('0x10')]++,'VoiceExtensionId':_0x20f8d2[_0x1eff3c][0x0]['VoiceExtensionId']});}else if(_0x20f8d2[_0x1eff3c][0x0][_0x36e7('0x15')]===_0x36e7('0x1c')){if(_0x5048cf['extension']){_0x5048cf[_0x36e7('0x13')][_0x36e7('0x14')]({'type':_0x20f8d2[_0x1eff3c][0x0][_0x36e7('0x15')],'app':'Set','appdata':'CDR(destination)='+(_0x5048cf[_0x36e7('0x11')]['cutdigits']?_0x36e7('0x1d')+_0x5048cf[_0x36e7('0x11')][_0x36e7('0x1e')]+'}':'${EXTEN}'),'context':_0x20f8d2[_0x1eff3c][0x0][_0x36e7('0x18')],'exten':_0x20f8d2[_0x1eff3c][0x0][_0x36e7('0x9')],'priority':_0x5048cf[_0x36e7('0x10')]++,'VoiceExtensionId':_0x20f8d2[_0x1eff3c][0x0]['VoiceExtensionId']});}_0x5048cf[_0x36e7('0x13')][_0x36e7('0x14')]({'type':_0x20f8d2[_0x1eff3c][0x0][_0x36e7('0x15')],'app':_0x36e7('0x16'),'appdata':_0x36e7('0x1b')+_0x20f8d2[_0x1eff3c][0x0][_0x36e7('0x19')],'context':_0x20f8d2[_0x1eff3c][0x0][_0x36e7('0x18')],'exten':_0x20f8d2[_0x1eff3c][0x0][_0x36e7('0x9')],'priority':_0x5048cf[_0x36e7('0x10')]++,'VoiceExtensionId':_0x20f8d2[_0x1eff3c][0x0]['VoiceExtensionId']});var _0x21ea31=_0x5048cf[_0x36e7('0x10')]++;_0x5048cf[_0x36e7('0x13')][_0x36e7('0x14')]({'type':_0x20f8d2[_0x1eff3c][0x0][_0x36e7('0x15')],'app':_0x36e7('0x1f'),'appdata':_0x36e7('0x20')+(_0x21ea31+0x2)+_0x36e7('0x21')+(_0x21ea31+0x1)+')','context':_0x20f8d2[_0x1eff3c][0x0][_0x36e7('0x18')],'exten':_0x20f8d2[_0x1eff3c][0x0][_0x36e7('0x9')],'priority':_0x21ea31,'VoiceExtensionId':_0x20f8d2[_0x1eff3c][0x0][_0x36e7('0x19')]});if(_0x5048cf['extension']){_0x5048cf[_0x36e7('0x13')][_0x36e7('0x14')]({'type':_0x20f8d2[_0x1eff3c][0x0][_0x36e7('0x15')],'app':_0x36e7('0x16'),'appdata':_0x5048cf[_0x36e7('0x11')][_0x36e7('0x1e')]?_0x36e7('0x22')+_0x5048cf['extension'][_0x36e7('0x1e')]+'}':_0x36e7('0x23'),'context':_0x20f8d2[_0x1eff3c][0x0]['context'],'exten':_0x20f8d2[_0x1eff3c][0x0][_0x36e7('0x9')],'priority':_0x5048cf[_0x36e7('0x10')]++,'VoiceExtensionId':_0x20f8d2[_0x1eff3c][0x0][_0x36e7('0x19')]});}_0x5048cf[_0x36e7('0x13')][_0x36e7('0x14')]({'type':_0x20f8d2[_0x1eff3c][0x0][_0x36e7('0x15')],'app':_0x36e7('0x16'),'appdata':_0x36e7('0x24')+_0x20f8d2[_0x1eff3c][0x0][_0x36e7('0x19')],'context':_0x20f8d2[_0x1eff3c][0x0]['context'],'exten':_0x20f8d2[_0x1eff3c][0x0][_0x36e7('0x9')],'priority':_0x5048cf[_0x36e7('0x10')]++,'VoiceExtensionId':_0x20f8d2[_0x1eff3c][0x0][_0x36e7('0x19')]});if(_0x5048cf[_0x36e7('0x11')]&&_0x5048cf['extension'][_0x36e7('0xf')](_0x36e7('0x25'))&&_0x5048cf[_0x36e7('0x11')]['recordingFormat']!=='none'){_0x5048cf[_0x36e7('0x13')]['push']({'type':_0x20f8d2[_0x1eff3c][0x0]['type'],'app':'Set','appdata':_0x36e7('0x26'),'context':_0x20f8d2[_0x1eff3c][0x0][_0x36e7('0x18')],'exten':_0x20f8d2[_0x1eff3c][0x0]['exten'],'priority':_0x5048cf[_0x36e7('0x10')]++,'VoiceExtensionId':_0x20f8d2[_0x1eff3c][0x0][_0x36e7('0x19')]});_0x5048cf[_0x36e7('0x13')][_0x36e7('0x14')]({'type':_0x20f8d2[_0x1eff3c][0x0][_0x36e7('0x15')],'app':_0x36e7('0x16'),'appdata':_0x36e7('0x27')+_0x5048cf['extension'][_0x36e7('0x25')]||_0x36e7('0x28'),'context':_0x20f8d2[_0x1eff3c][0x0][_0x36e7('0x18')],'exten':_0x20f8d2[_0x1eff3c][0x0][_0x36e7('0x9')],'priority':_0x5048cf[_0x36e7('0x10')]++,'VoiceExtensionId':_0x20f8d2[_0x1eff3c][0x0][_0x36e7('0x19')]});}}_0x5048cf[_0x36e7('0x13')]['push']({'type':_0x20f8d2[_0x1eff3c][0x0][_0x36e7('0x15')],'app':_0x36e7('0x16'),'appdata':_0x36e7('0x29'),'context':_0x20f8d2[_0x1eff3c][0x0][_0x36e7('0x18')],'exten':_0x20f8d2[_0x1eff3c][0x0]['exten'],'priority':_0x5048cf[_0x36e7('0x10')]++,'VoiceExtensionId':_0x20f8d2[_0x1eff3c][0x0][_0x36e7('0x19')]});_0x5048cf['extensions'][_0x36e7('0x14')]({'type':_0x20f8d2[_0x1eff3c][0x0]['type'],'app':'Set','appdata':_0x36e7('0x2a'),'context':_0x20f8d2[_0x1eff3c][0x0][_0x36e7('0x18')],'exten':_0x20f8d2[_0x1eff3c][0x0][_0x36e7('0x9')],'priority':_0x5048cf[_0x36e7('0x10')]++,'VoiceExtensionId':_0x20f8d2[_0x1eff3c][0x0]['VoiceExtensionId']});_0x5048cf['extensions'][_0x36e7('0x14')]({'type':_0x20f8d2[_0x1eff3c][0x0][_0x36e7('0x15')],'app':_0x36e7('0x16'),'appdata':_0x36e7('0x2b'),'context':_0x20f8d2[_0x1eff3c][0x0]['context'],'exten':_0x20f8d2[_0x1eff3c][0x0]['exten'],'priority':_0x5048cf['priority']++,'VoiceExtensionId':_0x20f8d2[_0x1eff3c][0x0]['VoiceExtensionId']});for(var _0x4a00b1=0x0,_0x357a2c=0x0;_0x4a00b1<_0x20f8d2[_0x1eff3c][_0x36e7('0x2c')];_0x4a00b1+=0x1,_0x357a2c=0x0){var _0x1e88ab=_0x20f8d2[_0x1eff3c][_0x4a00b1];if(_0x1e88ab[_0x36e7('0x15')]){_0x1e88ab['type']=_0x1e88ab[_0x36e7('0x15')][_0x36e7('0x2d')]();}var _0x2a782d=[];var _0x2f8c59=[];delete _0x1e88ab['id'];delete _0x1e88ab[_0x36e7('0x2e')];delete _0x1e88ab[_0x36e7('0x2f')];var _0x94bc02=_0x1e88ab[_0x36e7('0x30')]!=='*,*,*,*'?[_0x1e88ab[_0x36e7('0x30')]]:_0x1e88ab[_0x36e7('0x6')]?_['map'](_[_0x36e7('0xb')](_0x5048cf[_0x36e7('0x4')],{'IntervalId':_0x1e88ab[_0x36e7('0x6')]}),'interval'):[];if(_0x1e88ab[_0x36e7('0xf')](_0x36e7('0x31'))){if(_0x1e88ab[_0x36e7('0x31')]&&_0x1e88ab[_0x36e7('0x31')]!=='--'){_0x2a782d['push']({'type':_0x1e88ab[_0x36e7('0x15')],'app':_0x36e7('0x16'),'appdata':_0x36e7('0x32')+_0x1e88ab['tag'],'context':_0x1e88ab[_0x36e7('0x18')],'exten':_0x1e88ab['exten'],'priority':_0x94bc02[_0x36e7('0x2c')]+_0x5048cf['priority']+_0x357a2c++,'VoiceExtensionId':_0x1e88ab[_0x36e7('0x19')]});}}if(_0x1e88ab['type']===_0x36e7('0x1c')&&_0x1e88ab[_0x36e7('0xf')]('callerID')){if(_0x1e88ab[_0x36e7('0x33')]){_0x2a782d[_0x36e7('0x14')]({'type':_0x1e88ab[_0x36e7('0x15')],'app':_0x36e7('0x1f'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x1e88ab[_0x36e7('0x33')]+')','context':_0x1e88ab[_0x36e7('0x18')],'exten':_0x1e88ab['exten'],'priority':_0x94bc02['length']+_0x5048cf[_0x36e7('0x10')]+_0x357a2c++,'VoiceExtensionId':_0x1e88ab[_0x36e7('0x19')]});}else{_0x2a782d[_0x36e7('0x14')]({'type':_0x1e88ab['type'],'app':_0x36e7('0x1f'),'appdata':_0x36e7('0x34'),'context':_0x1e88ab[_0x36e7('0x18')],'exten':_0x1e88ab['exten'],'priority':_0x94bc02[_0x36e7('0x2c')]+_0x5048cf['priority']+_0x357a2c++,'VoiceExtensionId':_0x1e88ab[_0x36e7('0x19')]});}}if(_0x1e88ab['hasOwnProperty'](_0x36e7('0x35'))){if(_0x5933d0[_0x36e7('0x36')](_0x1e88ab[_0x36e7('0x37')]['toLowerCase']())>=0x0&&_0x1e88ab['appType']!==_0x36e7('0x38')){if(_0x1e88ab[_0x36e7('0x35')]){_0x2a782d[_0x36e7('0x14')]({'type':_0x1e88ab[_0x36e7('0x15')],'app':'ExecIf','appdata':_0x36e7('0x39'),'context':_0x1e88ab[_0x36e7('0x18')],'exten':_0x1e88ab['exten'],'priority':_0x94bc02['length']+_0x5048cf[_0x36e7('0x10')]+_0x357a2c++,'VoiceExtensionId':_0x1e88ab[_0x36e7('0x19')]});_0x2a782d['push']({'type':_0x1e88ab[_0x36e7('0x15')],'app':_0x36e7('0x16'),'appdata':_0x36e7('0x3a'),'context':_0x1e88ab[_0x36e7('0x18')],'exten':_0x1e88ab[_0x36e7('0x9')],'priority':_0x94bc02[_0x36e7('0x2c')]+_0x5048cf[_0x36e7('0x10')]+_0x357a2c++,'VoiceExtensionId':_0x1e88ab[_0x36e7('0x19')]});}else{_0x2a782d[_0x36e7('0x14')]({'type':_0x1e88ab['type'],'app':_0x36e7('0x1f'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x1e88ab[_0x36e7('0x18')],'exten':_0x1e88ab['exten'],'priority':_0x94bc02[_0x36e7('0x2c')]+_0x5048cf['priority']+_0x357a2c++,'VoiceExtensionId':_0x1e88ab['VoiceExtensionId']});_0x2a782d[_0x36e7('0x14')]({'type':_0x1e88ab[_0x36e7('0x15')],'app':_0x36e7('0x16'),'appdata':_0x36e7('0x3b'),'context':_0x1e88ab[_0x36e7('0x18')],'exten':_0x1e88ab['exten'],'priority':_0x94bc02[_0x36e7('0x2c')]+_0x5048cf['priority']+_0x357a2c++,'VoiceExtensionId':_0x1e88ab[_0x36e7('0x19')]});}}}for(var _0xa80026=0x0;_0xa80026<_0x94bc02[_0x36e7('0x2c')];_0xa80026+=0x1){var _0x5e9f73=_0x5048cf['priority']+_0x94bc02[_0x36e7('0x2c')];var _0x2df169=_0xa80026===_0x94bc02[_0x36e7('0x2c')]-0x1?_0x5048cf[_0x36e7('0x10')]+_0x2a782d[_0x36e7('0x2c')]+_0x2f8c59[_0x36e7('0x2c')]+0x2:_0x5048cf['priority']+_0xa80026+0x1;_0x2a782d[_0x36e7('0x3c')](_0xa80026,0x0,{'type':_0x1e88ab['type'],'app':'GotoIfTime','appdata':_0x94bc02[_0xa80026]+'?'+_0x1e88ab[_0x36e7('0x18')]+',${EXTEN},'+_0x5e9f73+':'+_0x1e88ab[_0x36e7('0x18')]+_0x36e7('0x3d')+_0x2df169,'exten':_0x1e88ab['exten'],'context':_0x1e88ab[_0x36e7('0x18')],'priority':_0x5048cf[_0x36e7('0x10')]+_0xa80026,'VoiceExtensionId':_0x20f8d2[_0x1eff3c][0x0][_0x36e7('0x19')]});}_0x1e88ab[_0x36e7('0x10')]=_0x2a782d['length']?_[_0x36e7('0x3e')](_0x2a782d)[_0x36e7('0x10')]+0x1:_0x5048cf[_0x36e7('0x10')];_0x5048cf[_0x36e7('0x10')]=(_0x2f8c59[_0x36e7('0x2c')]?_[_0x36e7('0x3e')](_0x2f8c59)[_0x36e7('0x10')]:_0x1e88ab[_0x36e7('0x10')])+0x1;_0x5048cf['extensions']=_[_0x36e7('0x3f')](_0x5048cf[_0x36e7('0x13')],_0x2a782d,[_0x1e88ab],_0x2f8c59);}_0x5048cf[_0x36e7('0x13')][_0x36e7('0x14')]({'type':_0x20f8d2[_0x1eff3c][0x0][_0x36e7('0x15')],'app':'Hangup','exten':_0x20f8d2[_0x1eff3c][0x0][_0x36e7('0x9')],'context':_0x20f8d2[_0x1eff3c][0x0][_0x36e7('0x18')],'priority':_0x5048cf[_0x36e7('0x10')],'VoiceExtensionId':_0x20f8d2[_0x1eff3c][0x0][_0x36e7('0x19')]});_0x29b39f['push'](_0x20f8d2[_0x1eff3c][0x0]['VoiceExtensionId']);_0x7e087=_[_0x36e7('0x3f')](_0x7e087,_0x5048cf[_0x36e7('0x13')]);}}return _0x2ad896[_0x36e7('0x40')](function(_0x1bbefd){return _0x2ad896[_0x36e7('0x1')][_0x36e7('0x5')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x29b39f}},'transaction':_0x1bbefd})[_0x36e7('0x3')](function(_0x38faef){return _0x2ad896['models'][_0x36e7('0x5')][_0x36e7('0x41')](_[_0x36e7('0x42')](_0x7e087,'priority'),{'transaction':_0x1bbefd});});});})[_0x36e7('0x43')](function(_0x4744be){console[_0x36e7('0x44')](_0x4744be);});}exports[_0x36e7('0x45')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 25497de..8e67911 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 _0xccb1=['field','NOW()','ContactId','toString','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','\x20=\x20?','scheduledAt','updatedAt','id\x20IN\x20?','str','calleridnum','insert','VoiceQueue','findAll','CmList','Lists','then','get','dialCheckDuplicateType','query','VoiceQueueId','sequelize','outbound','BlackLists','all','always','onlyIfOpen','CampaignId','Campaign','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','resume','resolve','contact:csv_','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','info','parse','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','papaparse','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','undefined','argv','Missing\x20filepath\x20parameter!','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','map','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','length','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','checkHopper','into','cm_hopper','fromQuery','createdAt'];(function(_0x51bcff,_0x177aa7){var _0x43a2b8=function(_0x3de5e2){while(--_0x3de5e2){_0x51bcff['push'](_0x51bcff['shift']());}};_0x43a2b8(++_0x177aa7);}(_0xccb1,0x189));var _0x1ccb=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xccb1[_0xf50820];return _0x2a9b10;};'use strict';var BPromise=require(_0x1ccb('0x0'));var util=require(_0x1ccb('0x1'));var _=require(_0x1ccb('0x2'));var fs=require('fs');var squel=require(_0x1ccb('0x3'));var Papa=require(_0x1ccb('0x4'));var Redis=require('ioredis');var db=require(_0x1ccb('0x5'))['db'];var config=require(_0x1ccb('0x6'));var logger=require(_0x1ccb('0x7'))(_0x1ccb('0x8'));config['redis']=_['defaults'](config[_0x1ccb('0x9')],{'host':_0x1ccb('0xa'),'port':0x18eb});var socket=require(_0x1ccb('0xb'))(new Redis(config[_0x1ccb('0x9')]));require(_0x1ccb('0xc'))[_0x1ccb('0xd')](socket);try{if(!process['argv'][0x2]||process['argv'][0x2]===_0x1ccb('0xe')||process[_0x1ccb('0xf')][0x2]==='null'){throw new Error(_0x1ccb('0x10'));}var FILEPATH=process[_0x1ccb('0xf')][0x2];if(!process[_0x1ccb('0xf')][0x3]||process[_0x1ccb('0xf')][0x3]===_0x1ccb('0xe')||process[_0x1ccb('0xf')][0x3]===_0x1ccb('0x11')||!process[_0x1ccb('0xf')][0x4]||process[_0x1ccb('0xf')][0x4]==='undefined'||process['argv'][0x4]===_0x1ccb('0x11')){throw new Error(_0x1ccb('0x12'));}var FIELDS=_[_0x1ccb('0x13')](process[_0x1ccb('0xf')][0x3][_0x1ccb('0x14')](','),process['argv'][0x4][_0x1ccb('0x14')](','));if(!process[_0x1ccb('0xf')][0x5]||process[_0x1ccb('0xf')][0x5]==='undefined'||process[_0x1ccb('0xf')][0x5]===_0x1ccb('0x11')){throw new Error(_0x1ccb('0x15'));}var LISTID=process[_0x1ccb('0xf')][0x5];var COMPANYID=process[_0x1ccb('0xf')][0x6]&&process['argv'][0x6]!=='undefined'&&process[_0x1ccb('0xf')][0x6]!==_0x1ccb('0x11')?process[_0x1ccb('0xf')][0x6]:null;var DUPLICATES=process[_0x1ccb('0xf')][0x7]&&process['argv'][0x7]!==_0x1ccb('0xe')&&process[_0x1ccb('0xf')][0x7]!=='null'?process['argv'][0x7]:null;if(!process['argv'][0x8]||process[_0x1ccb('0xf')][0x8]==='undefined'||process[_0x1ccb('0xf')][0x8]==='null'){throw new Error(_0x1ccb('0x16'));}var SOCKET_TIMESTAMP=process[_0x1ccb('0xf')][0x8];}catch(_0x31e7ab){logger[_0x1ccb('0x17')](_0x31e7ab);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(_0x290fb3,_0x2fef0b,_0x7f63ec,_0x4f520b){var _0xf35230={'message':_0x2fef0b};_0xf35230[_0x290fb3]=!![];if(_0x7f63ec){_0xf35230[_0x1ccb('0x18')]=_0x7f63ec;}if(_0x4f520b){_0xf35230[_0x1ccb('0x19')]=_0x4f520b;}return _0xf35230;}function isEmail(_0x47fb7b){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))*$/[_0x1ccb('0x1a')](_0x47fb7b);}function checkRow(_0x2a50ac,_0x52b74c,_0x1214b9){return new BPromise(function(_0x5ba436,_0x3a5cf3){if(_[_0x1ccb('0x1b')](_0x2a50ac)){return _0x3a5cf3(handleCheckRowError(_0x1ccb('0x17'),_0x1ccb('0x1c'),null,_0x1214b9));}if(_0x2a50ac[_0x1ccb('0x1d')]&&_0x2a50ac['errors']['length']){var _0x352e48=_[_0x1ccb('0x1e')](_0x2a50ac[_0x1ccb('0x1d')],_0x1ccb('0x1f'))[_0x1ccb('0x20')](';');return _0x3a5cf3(handleCheckRowError('error',_0x352e48,null,_0x1214b9));}var _0x39f4b5={};for(var _0x40e1d0 in FIELDS){if(FIELDS[_0x1ccb('0x21')](_0x40e1d0)&&FIELDS[_0x40e1d0]){_0x39f4b5[_0x40e1d0]=_0x2a50ac[_0x1ccb('0x22')][0x0][FIELDS[_0x40e1d0]]||_0x2a50ac[_0x1ccb('0x22')][0x0]['\ufeff'+FIELDS[_0x40e1d0]];}}if(!_0x39f4b5[_0x1ccb('0x23')]){return _0x3a5cf3(handleCheckRowError(_0x1ccb('0x17'),_0x1ccb('0x24'),null,_0x1214b9));}if(!_0x39f4b5[_0x1ccb('0x25')]){return _0x3a5cf3(handleCheckRowError(_0x1ccb('0x17'),'phone\x20not\x20specified!',null,_0x1214b9));}if(_0x39f4b5[_0x1ccb('0x26')]){var _0x4a209f=moment(_0x39f4b5['birthDate'],_0x1ccb('0x27'));if(!_0x4a209f[_0x1ccb('0x28')]()){return _0x3a5cf3(handleCheckRowError('error',_0x1ccb('0x29'),null,_0x1214b9));}}if(_0x39f4b5[_0x1ccb('0x2a')]){if(!isEmail(_0x39f4b5[_0x1ccb('0x2a')])){return _0x3a5cf3(handleCheckRowError(_0x1ccb('0x17'),_0x1ccb('0x2b'),null,_0x1214b9));}}_0x39f4b5[_0x1ccb('0x2c')]=LISTID;_0x39f4b5[_0x1ccb('0x2d')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x1ccb('0x2e')]&&_0x52b74c){var _0x16ad8e={};for(var _0xa6b990=0x0,_0x19e277=DUPLICATES[_0x1ccb('0x2e')];_0xa6b990<_0x19e277;_0xa6b990+=0x1){_0x16ad8e[DUPLICATES[_0xa6b990]]=_0x39f4b5[DUPLICATES[_0xa6b990]];}var _0x2f5426=_[_0x1ccb('0x2f')](_0x52b74c,_0x16ad8e);if(_0x2f5426){return _0x3a5cf3(handleCheckRowError(_0x1ccb('0x30'),_0x1ccb('0x31'),_0x2f5426,_0x1214b9));}}return db[_0x1ccb('0x32')][_0x1ccb('0x33')](_0x39f4b5,{'raw':!![],'hooks':![],'fields':_[_0x1ccb('0x34')](_0x39f4b5)})['then'](function(_0x5a6faf){if(DUPLICATES&&DUPLICATES[_0x1ccb('0x2e')]&&_0x52b74c){_0x52b74c[_0x1ccb('0x35')](_[_0x1ccb('0x36')](_0x39f4b5,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x5a6faf['id'];return _0x5ba436();})[_0x1ccb('0x37')](function(_0x196585){return _0x3a5cf3(handleCheckRowError(_0x1ccb('0x17'),_0x1ccb('0x38')+(_0x196585[_0x1ccb('0x1f')]||JSON[_0x1ccb('0x39')](_0x196585)),null,_0x1214b9));});});}function checkHopper(){function _0x3cc610(){return function(_0x251309){logger[_0x1ccb('0x17')]('cmContact',_0x1ccb('0x3a'),util['inspect'](_0x251309,{'showHidden':![],'depth':null}));};}var _0x471580=function(_0x13fa5f,_0x36b524){var _0x3826e6=squel['insert']()[_0x1ccb('0x3b')](_0x1ccb('0x3c'))[_0x1ccb('0x3d')](['phone','scheduledAt','ContactId',_0x1ccb('0x2c'),_0x36b524,_0x1ccb('0x3e'),'updatedAt'],squel['select']()[_0x1ccb('0x3f')](_0x1ccb('0x25'),_0x1ccb('0x25'))[_0x1ccb('0x3f')](_0x1ccb('0x40'),'scheduledAt')[_0x1ccb('0x3f')]('id',_0x1ccb('0x41'))[_0x1ccb('0x3f')](LISTID[_0x1ccb('0x42')](),_0x1ccb('0x2c'))[_0x1ccb('0x3f')](_0x13fa5f['id'][_0x1ccb('0x42')](),_0x36b524)[_0x1ccb('0x3f')](_0x1ccb('0x40'),_0x1ccb('0x3e'))[_0x1ccb('0x3f')]('NOW()','updatedAt')[_0x1ccb('0x43')](_0x1ccb('0x44'))[_0x1ccb('0x45')](_0x1ccb('0x46'))[_0x1ccb('0x45')](_0x1ccb('0x47'),LISTID[_0x1ccb('0x42')]())['where'](_0x1ccb('0x48'))[_0x1ccb('0x45')](_0x1ccb('0x49'),squel[_0x1ccb('0x4a')]()[_0x1ccb('0x3f')]('phone')[_0x1ccb('0x43')](_0x1ccb('0x3c'))[_0x1ccb('0x45')](_0x36b524+_0x1ccb('0x4b'),_0x13fa5f['id'][_0x1ccb('0x42')]())))[_0x1ccb('0x42')]();return _0x3826e6;};var _0x372b79=function(_0x52b1ac,_0x2ecbf6){var _0x23bf61=squel['insert']()[_0x1ccb('0x3b')](_0x1ccb('0x3c'))[_0x1ccb('0x3d')]([_0x1ccb('0x25'),_0x1ccb('0x4c'),_0x1ccb('0x41'),'ListId',_0x2ecbf6,_0x1ccb('0x3e'),_0x1ccb('0x4d')],squel[_0x1ccb('0x4a')]()[_0x1ccb('0x3f')](_0x1ccb('0x25'),_0x1ccb('0x25'))['field'](_0x1ccb('0x40'),'scheduledAt')[_0x1ccb('0x3f')]('id',_0x1ccb('0x41'))[_0x1ccb('0x3f')](LISTID[_0x1ccb('0x42')](),'ListId')[_0x1ccb('0x3f')](_0x52b1ac['id'][_0x1ccb('0x42')](),_0x2ecbf6)[_0x1ccb('0x3f')]('NOW()',_0x1ccb('0x3e'))[_0x1ccb('0x3f')](_0x1ccb('0x40'),_0x1ccb('0x4d'))[_0x1ccb('0x43')]('cm_contacts')[_0x1ccb('0x45')]('deletedAt\x20IS\x20NULL')['where'](_0x1ccb('0x47'),LISTID['toString']())['where'](_0x1ccb('0x4e'),squel[_0x1ccb('0x4f')](hopperContacts))['where'](_0x1ccb('0x48'))[_0x1ccb('0x45')](_0x1ccb('0x49'),squel[_0x1ccb('0x4a')]()[_0x1ccb('0x3f')](_0x1ccb('0x50'))[_0x1ccb('0x43')]('cm_hopper_final')[_0x1ccb('0x45')](_0x2ecbf6+_0x1ccb('0x4b'),_0x52b1ac['id']['toString']()))['where'](_0x1ccb('0x49'),squel[_0x1ccb('0x4a')]()[_0x1ccb('0x3f')](_0x1ccb('0x25'))['from'](_0x1ccb('0x3c'))[_0x1ccb('0x45')](_0x2ecbf6+_0x1ccb('0x4b'),_0x52b1ac['id'][_0x1ccb('0x42')]())))[_0x1ccb('0x42')]();return _0x23bf61;};function _0x13cfc0(_0x221bd6,_0x30f30e){var _0x2e0aea=squel[_0x1ccb('0x51')]()[_0x1ccb('0x3b')](_0x1ccb('0x3c'))[_0x1ccb('0x3d')]([_0x1ccb('0x25'),_0x1ccb('0x4c'),_0x1ccb('0x41'),_0x1ccb('0x2c'),_0x30f30e,_0x1ccb('0x3e'),'updatedAt'],squel[_0x1ccb('0x4a')]()[_0x1ccb('0x3f')](_0x1ccb('0x25'),'phone')['field'](_0x1ccb('0x40'),_0x1ccb('0x4c'))[_0x1ccb('0x3f')]('id',_0x1ccb('0x41'))[_0x1ccb('0x3f')](LISTID['toString'](),_0x1ccb('0x2c'))[_0x1ccb('0x3f')](_0x221bd6['id'][_0x1ccb('0x42')](),_0x30f30e)[_0x1ccb('0x3f')](_0x1ccb('0x40'),'createdAt')[_0x1ccb('0x3f')](_0x1ccb('0x40'),_0x1ccb('0x4d'))[_0x1ccb('0x43')](_0x1ccb('0x44'))['where']('deletedAt\x20IS\x20NULL')[_0x1ccb('0x45')]('ListId\x20=\x20?',LISTID[_0x1ccb('0x42')]())[_0x1ccb('0x45')]('id\x20IN\x20?',squel[_0x1ccb('0x4f')](hopperContacts))['where'](_0x1ccb('0x48')))[_0x1ccb('0x42')]();return _0x2e0aea;}function _0x53617d(_0x2531db,_0x5ad8b3){var _0x3e6522=squel[_0x1ccb('0x51')]()['into']('cm_hopper_black')[_0x1ccb('0x3d')]([_0x1ccb('0x25'),_0x1ccb('0x41'),_0x1ccb('0x2c'),_0x5ad8b3,'createdAt',_0x1ccb('0x4d')],squel[_0x1ccb('0x4a')]()['field'](_0x1ccb('0x25'),'phone')[_0x1ccb('0x3f')]('id',_0x1ccb('0x41'))[_0x1ccb('0x3f')](LISTID[_0x1ccb('0x42')](),_0x1ccb('0x2c'))[_0x1ccb('0x3f')](_0x2531db['id']['toString'](),_0x5ad8b3)['field'](_0x1ccb('0x40'),_0x1ccb('0x3e'))[_0x1ccb('0x3f')](_0x1ccb('0x40'),_0x1ccb('0x4d'))[_0x1ccb('0x43')](_0x1ccb('0x44'))[_0x1ccb('0x45')](_0x1ccb('0x46'))[_0x1ccb('0x45')](_0x1ccb('0x47'),LISTID[_0x1ccb('0x42')]())[_0x1ccb('0x45')](_0x1ccb('0x4e'),squel['str'](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))[_0x1ccb('0x42')]();return _0x3e6522;}return db[_0x1ccb('0x52')][_0x1ccb('0x53')]({'where':{'type':'outbound'},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x1ccb('0x54')],'as':_0x1ccb('0x55'),'where':{'id':LISTID}}]})[_0x1ccb('0x56')](function(_0x175a54){var _0x23341e=[];if(_0x175a54){var _0x2c5300;for(var _0x526a09=0x0,_0x17c931;_0x526a09<_0x175a54[_0x1ccb('0x2e')];_0x526a09+=0x1){_0x17c931=_0x175a54[_0x526a09][_0x1ccb('0x57')]({'plain':!![]});switch(_0x17c931[_0x1ccb('0x58')]){case'always':_0x23341e[_0x1ccb('0x35')](db['sequelize'][_0x1ccb('0x59')](_0x372b79(_0x17c931,_0x1ccb('0x5a')))[_0x1ccb('0x56')](function(){})[_0x1ccb('0x37')](_0x3cc610()));break;case'onlyIfOpen':_0x23341e[_0x1ccb('0x35')](db[_0x1ccb('0x5b')][_0x1ccb('0x59')](_0x471580(_0x17c931,_0x1ccb('0x5a')))[_0x1ccb('0x56')](function(){})[_0x1ccb('0x37')](_0x3cc610()));break;default:_0x23341e[_0x1ccb('0x35')](db[_0x1ccb('0x5b')][_0x1ccb('0x59')](_0x13cfc0(_0x17c931,'VoiceQueueId'))[_0x1ccb('0x56')](function(){})['catch'](_0x3cc610()));}}}return _0x23341e;})['all']()[_0x1ccb('0x56')](function(){return db[_0x1ccb('0x52')]['findAll']({'where':{'type':_0x1ccb('0x5c')},'attributes':['id'],'include':[{'model':db[_0x1ccb('0x54')],'as':_0x1ccb('0x5d'),'where':{'id':LISTID}}]})[_0x1ccb('0x56')](function(_0x40ce64){var _0x1b58f8=[];if(_0x40ce64){var _0x2ae89d;for(var _0x254061=0x0,_0x149452;_0x254061<_0x40ce64[_0x1ccb('0x2e')];_0x254061+=0x1){_0x149452=_0x40ce64[_0x254061][_0x1ccb('0x57')]({'plain':!![]});_0x1b58f8[_0x1ccb('0x35')](db['sequelize'][_0x1ccb('0x59')](_0x53617d(_0x149452,_0x1ccb('0x5a')))['then'](function(){})[_0x1ccb('0x37')](_0x3cc610()));}}return _0x1b58f8;})[_0x1ccb('0x5e')]();})[_0x1ccb('0x56')](function(){return db['Campaign'][_0x1ccb('0x53')]({'attributes':['id',_0x1ccb('0x58')],'include':[{'model':db[_0x1ccb('0x54')],'as':'Lists','where':{'id':LISTID}}]})['then'](function(_0xea3f26){var _0xdd6ff5=[];if(_0xea3f26){for(var _0x555aed=0x0,_0x2e6f49;_0x555aed<_0xea3f26[_0x1ccb('0x2e')];_0x555aed+=0x1){_0x2e6f49=_0xea3f26[_0x555aed]['get']({'plain':!![]});switch(_0x2e6f49[_0x1ccb('0x58')]){case _0x1ccb('0x5f'):_0xdd6ff5['push'](db[_0x1ccb('0x5b')][_0x1ccb('0x59')](_0x372b79(_0x2e6f49,'CampaignId'))[_0x1ccb('0x56')](function(){})[_0x1ccb('0x37')](_0x3cc610()));break;case _0x1ccb('0x60'):_0xdd6ff5[_0x1ccb('0x35')](db[_0x1ccb('0x5b')][_0x1ccb('0x59')](_0x471580(_0x2e6f49,_0x1ccb('0x61')))['then'](function(){})[_0x1ccb('0x37')](_0x3cc610()));break;default:_0xdd6ff5[_0x1ccb('0x35')](db['sequelize'][_0x1ccb('0x59')](_0x13cfc0(_0x2e6f49,'CampaignId'))[_0x1ccb('0x56')](function(){})[_0x1ccb('0x37')](_0x3cc610()));}}}return _0xdd6ff5;})[_0x1ccb('0x5e')]();})[_0x1ccb('0x56')](function(){return db[_0x1ccb('0x62')][_0x1ccb('0x53')]({'attributes':['id'],'include':[{'model':db[_0x1ccb('0x54')],'as':_0x1ccb('0x5d'),'where':{'id':LISTID}}]})[_0x1ccb('0x56')](function(_0x378a0f){var _0x2259bd=[];if(_0x378a0f){for(var _0x1cc5ef=0x0,_0x423d61;_0x1cc5ef<_0x378a0f[_0x1ccb('0x2e')];_0x1cc5ef+=0x1){_0x423d61=_0x378a0f[_0x1cc5ef][_0x1ccb('0x57')]({'plain':!![]});_0x2259bd[_0x1ccb('0x35')](db[_0x1ccb('0x5b')][_0x1ccb('0x59')](_0x53617d(_0x423d61,_0x1ccb('0x61')))[_0x1ccb('0x56')](function(){})[_0x1ccb('0x37')](_0x3cc610()));}}return _0x2259bd;})[_0x1ccb('0x5e')]();})[_0x1ccb('0x37')](function(_0xea9f7a){logger['error'](_0x1ccb('0x63'),_0x1ccb('0x64'),_0xea9f7a[_0x1ccb('0x1f')]);});}var processPromises=function(_0x4c9080){return BPromise['all'](promises)[_0x1ccb('0x56')](function(_0x5a0998){})[_0x1ccb('0x37')](function(_0x5956f3){logger['error'](_0x1ccb('0x65'),JSON[_0x1ccb('0x39')](_0x5956f3));})[_0x1ccb('0x66')](function(){socket[_0x1ccb('0x67')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x4c9080){return _0x4c9080[_0x1ccb('0x68')]();}});};var endCsv=function(){return BPromise[_0x1ccb('0x69')]()[_0x1ccb('0x56')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0x1ccb('0x67')](_0x1ccb('0x6a')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x1ccb('0x6b')](FILEPATH);}catch(_0xd9059c){logger['error'](_0x1ccb('0x6c'),JSON[_0x1ccb('0x39')](_0xd9059c));}finally{process[_0x1ccb('0x6d')](0x0);}});};process['on']('SIGINT',function(){logger[_0x1ccb('0x6e')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise['resolve']()[_0x1ccb('0x56')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x1ccb('0x14')](',');return db[_0x1ccb('0x32')][_0x1ccb('0x53')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x1ccb('0x56')](function(_0x1bb08f){var _0x4bc861=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x1ccb('0x6f')](_0x4bc861,{'header':!![],'skipEmptyLines':!![],'step':function(_0x1be978,_0x5945d7){total+=0x1;var _0x4fc312=total;promises[_0x1ccb('0x35')](checkRow(_0x1be978,_0x1bb08f,_0x4fc312)[_0x1ccb('0x56')](function(){success+=0x1;})['catch'](function(_0x24f0c9){if(_0x24f0c9[_0x1ccb('0x17')]){errors+=0x1;delete _0x24f0c9['error'];}else if(_0x24f0c9[_0x1ccb('0x30')]){duplicates+=0x1;delete _0x24f0c9['duplicate'];}rows[_0x1ccb('0x35')](_0x24f0c9);}));if(total%0xc8===0x0){_0x5945d7['pause']();return processPromises(_0x5945d7);}},'complete':function(){return processPromises()[_0x1ccb('0x56')](function(){logger[_0x1ccb('0x6e')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x40067e,_0x49c5e7){logger[_0x1ccb('0x6e')](_0x1ccb('0x70'),JSON[_0x1ccb('0x39')](_0x40067e));endCsv();}});})[_0x1ccb('0x37')](function(_0x60976d){logger[_0x1ccb('0x17')](_0x1ccb('0x71'),JSON['stringify'](_0x60976d));});}main(); \ No newline at end of file +var _0x1d21=['papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','redis','defaults','localhost','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','test','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','message','join','hasOwnProperty','data','firstName','phone','phone\x20not\x20specified!','birthDate','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate','CmContact','keys','then','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','insert','into','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?','cm_hopper','phone\x20NOT\x20IN\x20(?)','calleridnum','cm_hopper_final','id\x20IN\x20?','str','cm_hopper_black','VoiceQueue','findAll','outbound','Lists','get','push','sequelize','query','VoiceQueueId','CmList','BlackLists','all','Campaign','dialCheckDuplicateType','CampaignId','onlyIfOpen','cmContact,\x20%s,\x20%s','finally','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util'];(function(_0xce24cb,_0x350546){var _0x50f4f9=function(_0x5f5884){while(--_0x5f5884){_0xce24cb['push'](_0xce24cb['shift']());}};_0x50f4f9(++_0x350546);}(_0x1d21,0x6b));var _0x11d2=function(_0x946518,_0x22816f){_0x946518=_0x946518-0x0;var _0x909b69=_0x1d21[_0x946518];return _0x909b69;};'use strict';var BPromise=require(_0x11d2('0x0'));var util=require(_0x11d2('0x1'));var _=require('lodash');var fs=require('fs');var squel=require('squel');var Papa=require(_0x11d2('0x2'));var Redis=require(_0x11d2('0x3'));var db=require(_0x11d2('0x4'))['db'];var config=require(_0x11d2('0x5'));var logger=require(_0x11d2('0x6'))('api');config[_0x11d2('0x7')]=_[_0x11d2('0x8')](config[_0x11d2('0x7')],{'host':_0x11d2('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x11d2('0xa'))[_0x11d2('0xb')](socket);try{if(!process['argv'][0x2]||process[_0x11d2('0xc')][0x2]===_0x11d2('0xd')||process[_0x11d2('0xc')][0x2]===_0x11d2('0xe')){throw new Error(_0x11d2('0xf'));}var FILEPATH=process[_0x11d2('0xc')][0x2];if(!process[_0x11d2('0xc')][0x3]||process[_0x11d2('0xc')][0x3]===_0x11d2('0xd')||process[_0x11d2('0xc')][0x3]===_0x11d2('0xe')||!process[_0x11d2('0xc')][0x4]||process[_0x11d2('0xc')][0x4]===_0x11d2('0xd')||process[_0x11d2('0xc')][0x4]===_0x11d2('0xe')){throw new Error(_0x11d2('0x10'));}var FIELDS=_[_0x11d2('0x11')](process[_0x11d2('0xc')][0x3][_0x11d2('0x12')](','),process[_0x11d2('0xc')][0x4][_0x11d2('0x12')](','));if(!process[_0x11d2('0xc')][0x5]||process[_0x11d2('0xc')][0x5]===_0x11d2('0xd')||process[_0x11d2('0xc')][0x5]===_0x11d2('0xe')){throw new Error(_0x11d2('0x13'));}var LISTID=process[_0x11d2('0xc')][0x5];var COMPANYID=process[_0x11d2('0xc')][0x6]&&process[_0x11d2('0xc')][0x6]!==_0x11d2('0xd')&&process[_0x11d2('0xc')][0x6]!==_0x11d2('0xe')?process[_0x11d2('0xc')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0x11d2('0xc')][0x7]!==_0x11d2('0xd')&&process[_0x11d2('0xc')][0x7]!==_0x11d2('0xe')?process['argv'][0x7]:null;if(!process['argv'][0x8]||process['argv'][0x8]==='undefined'||process[_0x11d2('0xc')][0x8]===_0x11d2('0xe')){throw new Error(_0x11d2('0x14'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x4573b2){logger[_0x11d2('0x15')](_0x4573b2);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(_0x497136,_0x3c5dd2,_0x35d1aa,_0x47a28f){var _0x3b832c={'message':_0x3c5dd2};_0x3b832c[_0x497136]=!![];if(_0x35d1aa){_0x3b832c[_0x11d2('0x16')]=_0x35d1aa;}if(_0x47a28f){_0x3b832c['index']=_0x47a28f;}return _0x3b832c;}function isEmail(_0x5cb7ad){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))*$/[_0x11d2('0x17')](_0x5cb7ad);}function checkRow(_0x36061a,_0x10bf96,_0x4dbfa1){return new BPromise(function(_0x18fbff,_0x932ad7){if(_['isNil'](_0x36061a)){return _0x932ad7(handleCheckRowError(_0x11d2('0x15'),_0x11d2('0x18'),null,_0x4dbfa1));}if(_0x36061a[_0x11d2('0x19')]&&_0x36061a[_0x11d2('0x19')][_0x11d2('0x1a')]){var _0x1a5f78=_['map'](_0x36061a['errors'],_0x11d2('0x1b'))[_0x11d2('0x1c')](';');return _0x932ad7(handleCheckRowError('error',_0x1a5f78,null,_0x4dbfa1));}var _0x229c7c={};for(var _0x5e1e0e in FIELDS){if(FIELDS[_0x11d2('0x1d')](_0x5e1e0e)&&FIELDS[_0x5e1e0e]){_0x229c7c[_0x5e1e0e]=_0x36061a[_0x11d2('0x1e')][0x0][FIELDS[_0x5e1e0e]]||_0x36061a[_0x11d2('0x1e')][0x0]['\ufeff'+FIELDS[_0x5e1e0e]];}}if(!_0x229c7c[_0x11d2('0x1f')]){return _0x932ad7(handleCheckRowError('error','firstName\x20not\x20specified!',null,_0x4dbfa1));}if(!_0x229c7c[_0x11d2('0x20')]){return _0x932ad7(handleCheckRowError(_0x11d2('0x15'),_0x11d2('0x21'),null,_0x4dbfa1));}if(_0x229c7c[_0x11d2('0x22')]){var _0x180eb2=moment(_0x229c7c[_0x11d2('0x22')],'YYYY-MM-DD');if(!_0x180eb2['isValid']()){return _0x932ad7(handleCheckRowError('error',_0x11d2('0x23'),null,_0x4dbfa1));}}if(_0x229c7c[_0x11d2('0x24')]){if(!isEmail(_0x229c7c['email'])){return _0x932ad7(handleCheckRowError(_0x11d2('0x15'),_0x11d2('0x25'),null,_0x4dbfa1));}}_0x229c7c[_0x11d2('0x26')]=LISTID;_0x229c7c[_0x11d2('0x27')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x10bf96){var _0x4eaf2b={};for(var _0x16c48a=0x0,_0x4845d5=DUPLICATES[_0x11d2('0x1a')];_0x16c48a<_0x4845d5;_0x16c48a+=0x1){_0x4eaf2b[DUPLICATES[_0x16c48a]]=_0x229c7c[DUPLICATES[_0x16c48a]];}var _0x27fd1d=_[_0x11d2('0x28')](_0x10bf96,_0x4eaf2b);if(_0x27fd1d){return _0x932ad7(handleCheckRowError(_0x11d2('0x29'),'Duplicate\x20Contact',_0x27fd1d,_0x4dbfa1));}}return db[_0x11d2('0x2a')]['create'](_0x229c7c,{'raw':!![],'hooks':![],'fields':_[_0x11d2('0x2b')](_0x229c7c)})[_0x11d2('0x2c')](function(_0x61dbee){if(DUPLICATES&&DUPLICATES[_0x11d2('0x1a')]&&_0x10bf96){_0x10bf96['push'](_['pick'](_0x229c7c,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x61dbee['id'];return _0x18fbff();})[_0x11d2('0x2d')](function(_0x6ae264){return _0x932ad7(handleCheckRowError('error',_0x11d2('0x2e')+(_0x6ae264[_0x11d2('0x1b')]||JSON[_0x11d2('0x2f')](_0x6ae264)),null,_0x4dbfa1));});});}function checkHopper(){function _0x29f1cd(){return function(_0x3c40cc){logger[_0x11d2('0x15')](_0x11d2('0x30'),_0x11d2('0x31'),util[_0x11d2('0x32')](_0x3c40cc,{'showHidden':![],'depth':null}));};}var _0x76b21=function(_0x2a888c,_0x27ca73){var _0x474914=squel[_0x11d2('0x33')]()[_0x11d2('0x34')]('cm_hopper')[_0x11d2('0x35')]([_0x11d2('0x20'),_0x11d2('0x36'),_0x11d2('0x37'),_0x11d2('0x26'),_0x27ca73,_0x11d2('0x38'),_0x11d2('0x39')],squel[_0x11d2('0x3a')]()[_0x11d2('0x3b')](_0x11d2('0x20'),_0x11d2('0x20'))[_0x11d2('0x3b')](_0x11d2('0x3c'),_0x11d2('0x36'))['field']('id',_0x11d2('0x37'))[_0x11d2('0x3b')](LISTID[_0x11d2('0x3d')](),_0x11d2('0x26'))[_0x11d2('0x3b')](_0x2a888c['id'][_0x11d2('0x3d')](),_0x27ca73)[_0x11d2('0x3b')](_0x11d2('0x3c'),_0x11d2('0x38'))['field'](_0x11d2('0x3c'),_0x11d2('0x39'))[_0x11d2('0x3e')](_0x11d2('0x3f'))[_0x11d2('0x40')](_0x11d2('0x41'))['where'](_0x11d2('0x42'),LISTID[_0x11d2('0x3d')]())['where'](_0x11d2('0x43'))[_0x11d2('0x40')]('phone\x20NOT\x20IN\x20(?)',squel[_0x11d2('0x3a')]()[_0x11d2('0x3b')]('phone')[_0x11d2('0x3e')]('cm_hopper')[_0x11d2('0x40')](_0x27ca73+_0x11d2('0x44'),_0x2a888c['id']['toString']())))[_0x11d2('0x3d')]();return _0x474914;};var _0x1bd764=function(_0x1a04b7,_0x5845aa){var _0xaa0200=squel[_0x11d2('0x33')]()[_0x11d2('0x34')](_0x11d2('0x45'))[_0x11d2('0x35')]([_0x11d2('0x20'),_0x11d2('0x36'),_0x11d2('0x37'),_0x11d2('0x26'),_0x5845aa,'createdAt',_0x11d2('0x39')],squel[_0x11d2('0x3a')]()['field']('phone',_0x11d2('0x20'))['field'](_0x11d2('0x3c'),_0x11d2('0x36'))[_0x11d2('0x3b')]('id',_0x11d2('0x37'))[_0x11d2('0x3b')](LISTID[_0x11d2('0x3d')](),'ListId')[_0x11d2('0x3b')](_0x1a04b7['id'][_0x11d2('0x3d')](),_0x5845aa)[_0x11d2('0x3b')](_0x11d2('0x3c'),_0x11d2('0x38'))[_0x11d2('0x3b')]('NOW()',_0x11d2('0x39'))['from']('cm_contacts')['where'](_0x11d2('0x41'))[_0x11d2('0x40')]('ListId\x20=\x20?',LISTID[_0x11d2('0x3d')]())['where']('id\x20IN\x20?',squel['str'](hopperContacts))['where'](_0x11d2('0x43'))[_0x11d2('0x40')](_0x11d2('0x46'),squel[_0x11d2('0x3a')]()[_0x11d2('0x3b')](_0x11d2('0x47'))['from'](_0x11d2('0x48'))['where'](_0x5845aa+'\x20=\x20?',_0x1a04b7['id'][_0x11d2('0x3d')]()))['where'](_0x11d2('0x46'),squel['select']()[_0x11d2('0x3b')]('phone')[_0x11d2('0x3e')](_0x11d2('0x45'))[_0x11d2('0x40')](_0x5845aa+_0x11d2('0x44'),_0x1a04b7['id'][_0x11d2('0x3d')]())))[_0x11d2('0x3d')]();return _0xaa0200;};function _0x443c3d(_0x21af31,_0x19cbd2){var _0x5c9489=squel[_0x11d2('0x33')]()['into'](_0x11d2('0x45'))[_0x11d2('0x35')]([_0x11d2('0x20'),_0x11d2('0x36'),_0x11d2('0x37'),_0x11d2('0x26'),_0x19cbd2,_0x11d2('0x38'),_0x11d2('0x39')],squel[_0x11d2('0x3a')]()['field'](_0x11d2('0x20'),_0x11d2('0x20'))[_0x11d2('0x3b')](_0x11d2('0x3c'),_0x11d2('0x36'))[_0x11d2('0x3b')]('id','ContactId')['field'](LISTID[_0x11d2('0x3d')](),_0x11d2('0x26'))[_0x11d2('0x3b')](_0x21af31['id']['toString'](),_0x19cbd2)[_0x11d2('0x3b')](_0x11d2('0x3c'),_0x11d2('0x38'))['field']('NOW()','updatedAt')['from']('cm_contacts')[_0x11d2('0x40')](_0x11d2('0x41'))['where'](_0x11d2('0x42'),LISTID['toString']())[_0x11d2('0x40')](_0x11d2('0x49'),squel[_0x11d2('0x4a')](hopperContacts))[_0x11d2('0x40')](_0x11d2('0x43')))[_0x11d2('0x3d')]();return _0x5c9489;}function _0x4f7f25(_0x5cf9ea,_0x44918b){var _0x24c411=squel[_0x11d2('0x33')]()[_0x11d2('0x34')](_0x11d2('0x4b'))[_0x11d2('0x35')]([_0x11d2('0x20'),_0x11d2('0x37'),'ListId',_0x44918b,_0x11d2('0x38'),_0x11d2('0x39')],squel['select']()[_0x11d2('0x3b')]('phone',_0x11d2('0x20'))[_0x11d2('0x3b')]('id',_0x11d2('0x37'))[_0x11d2('0x3b')](LISTID[_0x11d2('0x3d')](),_0x11d2('0x26'))[_0x11d2('0x3b')](_0x5cf9ea['id']['toString'](),_0x44918b)[_0x11d2('0x3b')](_0x11d2('0x3c'),_0x11d2('0x38'))[_0x11d2('0x3b')](_0x11d2('0x3c'),'updatedAt')['from']('cm_contacts')[_0x11d2('0x40')](_0x11d2('0x41'))['where'](_0x11d2('0x42'),LISTID[_0x11d2('0x3d')]())[_0x11d2('0x40')](_0x11d2('0x49'),squel[_0x11d2('0x4a')](hopperContacts))[_0x11d2('0x40')](_0x11d2('0x43')))[_0x11d2('0x3d')]();return _0x24c411;}return db[_0x11d2('0x4c')][_0x11d2('0x4d')]({'where':{'type':_0x11d2('0x4e')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db['CmList'],'as':_0x11d2('0x4f'),'where':{'id':LISTID}}]})[_0x11d2('0x2c')](function(_0x4fa01e){var _0x33382c=[];if(_0x4fa01e){var _0x4fca60;for(var _0x37c6c5=0x0,_0x306fac;_0x37c6c5<_0x4fa01e['length'];_0x37c6c5+=0x1){_0x306fac=_0x4fa01e[_0x37c6c5][_0x11d2('0x50')]({'plain':!![]});switch(_0x306fac['dialCheckDuplicateType']){case'always':_0x33382c[_0x11d2('0x51')](db[_0x11d2('0x52')][_0x11d2('0x53')](_0x1bd764(_0x306fac,_0x11d2('0x54')))[_0x11d2('0x2c')](function(){})[_0x11d2('0x2d')](_0x29f1cd()));break;case'onlyIfOpen':_0x33382c['push'](db[_0x11d2('0x52')][_0x11d2('0x53')](_0x76b21(_0x306fac,_0x11d2('0x54')))[_0x11d2('0x2c')](function(){})['catch'](_0x29f1cd()));break;default:_0x33382c['push'](db['sequelize']['query'](_0x443c3d(_0x306fac,'VoiceQueueId'))[_0x11d2('0x2c')](function(){})[_0x11d2('0x2d')](_0x29f1cd()));}}}return _0x33382c;})['all']()[_0x11d2('0x2c')](function(){return db['VoiceQueue'][_0x11d2('0x4d')]({'where':{'type':_0x11d2('0x4e')},'attributes':['id'],'include':[{'model':db[_0x11d2('0x55')],'as':_0x11d2('0x56'),'where':{'id':LISTID}}]})[_0x11d2('0x2c')](function(_0xef65b6){var _0x27795e=[];if(_0xef65b6){var _0x22ac4c;for(var _0x303ed7=0x0,_0x133ad6;_0x303ed7<_0xef65b6[_0x11d2('0x1a')];_0x303ed7+=0x1){_0x133ad6=_0xef65b6[_0x303ed7][_0x11d2('0x50')]({'plain':!![]});_0x27795e['push'](db[_0x11d2('0x52')][_0x11d2('0x53')](_0x4f7f25(_0x133ad6,'VoiceQueueId'))[_0x11d2('0x2c')](function(){})[_0x11d2('0x2d')](_0x29f1cd()));}}return _0x27795e;})[_0x11d2('0x57')]();})[_0x11d2('0x2c')](function(){return db[_0x11d2('0x58')][_0x11d2('0x4d')]({'attributes':['id',_0x11d2('0x59')],'include':[{'model':db[_0x11d2('0x55')],'as':_0x11d2('0x4f'),'where':{'id':LISTID}}]})[_0x11d2('0x2c')](function(_0x541901){var _0x24ebd3=[];if(_0x541901){for(var _0x405a80=0x0,_0x3bb92e;_0x405a80<_0x541901[_0x11d2('0x1a')];_0x405a80+=0x1){_0x3bb92e=_0x541901[_0x405a80][_0x11d2('0x50')]({'plain':!![]});switch(_0x3bb92e['dialCheckDuplicateType']){case'always':_0x24ebd3[_0x11d2('0x51')](db[_0x11d2('0x52')][_0x11d2('0x53')](_0x1bd764(_0x3bb92e,_0x11d2('0x5a')))[_0x11d2('0x2c')](function(){})[_0x11d2('0x2d')](_0x29f1cd()));break;case _0x11d2('0x5b'):_0x24ebd3[_0x11d2('0x51')](db[_0x11d2('0x52')][_0x11d2('0x53')](_0x76b21(_0x3bb92e,'CampaignId'))[_0x11d2('0x2c')](function(){})[_0x11d2('0x2d')](_0x29f1cd()));break;default:_0x24ebd3['push'](db[_0x11d2('0x52')]['query'](_0x443c3d(_0x3bb92e,_0x11d2('0x5a')))[_0x11d2('0x2c')](function(){})[_0x11d2('0x2d')](_0x29f1cd()));}}}return _0x24ebd3;})[_0x11d2('0x57')]();})['then'](function(){return db['Campaign'][_0x11d2('0x4d')]({'attributes':['id'],'include':[{'model':db[_0x11d2('0x55')],'as':_0x11d2('0x56'),'where':{'id':LISTID}}]})[_0x11d2('0x2c')](function(_0x1a8fe6){var _0x3e7502=[];if(_0x1a8fe6){for(var _0x181aaf=0x0,_0x5231ca;_0x181aaf<_0x1a8fe6[_0x11d2('0x1a')];_0x181aaf+=0x1){_0x5231ca=_0x1a8fe6[_0x181aaf]['get']({'plain':!![]});_0x3e7502[_0x11d2('0x51')](db[_0x11d2('0x52')][_0x11d2('0x53')](_0x4f7f25(_0x5231ca,_0x11d2('0x5a')))['then'](function(){})['catch'](_0x29f1cd()));}}return _0x3e7502;})['all']();})[_0x11d2('0x2d')](function(_0xe94d46){logger['error'](_0x11d2('0x5c'),'generalCheckHopper',_0xe94d46[_0x11d2('0x1b')]);});}var processPromises=function(_0x272e5c){return BPromise[_0x11d2('0x57')](promises)[_0x11d2('0x2c')](function(_0x2124f7){})[_0x11d2('0x2d')](function(_0x39a5ad){logger['error']('Error\x20processing\x20rows\x20block:',JSON[_0x11d2('0x2f')](_0x39a5ad));})[_0x11d2('0x5d')](function(){socket[_0x11d2('0x5e')](_0x11d2('0x5f')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x272e5c){return _0x272e5c[_0x11d2('0x60')]();}});};var endCsv=function(){return BPromise[_0x11d2('0x61')]()[_0x11d2('0x2c')](function(){if(hopperContacts){return checkHopper();}})[_0x11d2('0x2c')](function(){socket['emit'](_0x11d2('0x5f')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x11d2('0x62')](FILEPATH);}catch(_0x4c13cd){logger[_0x11d2('0x15')](_0x11d2('0x63'),JSON['stringify'](_0x4c13cd));}finally{process[_0x11d2('0x64')](0x0);}});};process['on']('SIGINT',function(){logger[_0x11d2('0x65')](_0x11d2('0x66'));endCsv();});function main(){return BPromise[_0x11d2('0x61')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0x11d2('0x2a')][_0x11d2('0x4d')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x11d2('0x2c')](function(_0x1097af){var _0x3382be=fs[_0x11d2('0x67')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x11d2('0x68')](_0x3382be,{'header':!![],'skipEmptyLines':!![],'step':function(_0x484692,_0x2420c9){total+=0x1;var _0xe08892=total;promises[_0x11d2('0x51')](checkRow(_0x484692,_0x1097af,_0xe08892)[_0x11d2('0x2c')](function(){success+=0x1;})[_0x11d2('0x2d')](function(_0x554d2f){if(_0x554d2f[_0x11d2('0x15')]){errors+=0x1;delete _0x554d2f['error'];}else if(_0x554d2f[_0x11d2('0x29')]){duplicates+=0x1;delete _0x554d2f[_0x11d2('0x29')];}rows[_0x11d2('0x51')](_0x554d2f);}));if(total%0xc8===0x0){_0x2420c9[_0x11d2('0x69')]();return processPromises(_0x2420c9);}},'complete':function(){return processPromises()[_0x11d2('0x2c')](function(){logger['info'](_0x11d2('0x6a'));endCsv();});},'error':function(_0x5c6ba9,_0x243d1d){logger[_0x11d2('0x65')](_0x11d2('0x6b'),JSON[_0x11d2('0x2f')](_0x5c6ba9));endCsv();}});})[_0x11d2('0x2d')](function(_0x3a5e9e){logger['error'](_0x11d2('0x6c'),JSON[_0x11d2('0x2f')](_0x3a5e9e));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 939c915..b30695a 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 _0xbf7f=['cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','cm_hopper_black','ListId\x20=\x20?','\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','ListId','UserId','\x22onlyIfOpen\x22','concat','CompanyId','id\x20IN\x20?','MIN(id)','group','info','Received\x20SIGINT','error','message','exit','errors','push','code','sequelize','query','catch','campaigns','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','spread','all','voice_queues.id','voice_queues','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','then','timezones','dialTimezone','set','offset','main','stringify','send','binding','socket_timestamp','root','server/files/tmp','.csv','keys','writeFileSync','parse','createReadStream','data','length','rows','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','email','email\x20wrong\x20format','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','isNil','utcOffset','firstName','\x20not\x20specified','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','CREATE\x20TABLE\x20','each','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','VoiceQueueId','voice_queues_has_cm_blacklists','CampaignId','campaigns_has_cm_blacklists','finish','affectedRows','unlink','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','phone','scheduledat','ContactId','createdAt','updatedAt','priority','recallme','fields','cm_contacts'];(function(_0x23f206,_0x573c48){var _0x3e31d4=function(_0x53c869){while(--_0x53c869){_0x23f206['push'](_0x23f206['shift']());}};_0x3e31d4(++_0x573c48);}(_0xbf7f,0x1b1));var _0xfbf7=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0xbf7f[_0x3ff085];return _0x2b68c3;};'use strict';var fs=require('fs');var path=require(_0xfbf7('0x0'));var _=require(_0xfbf7('0x1'));var Papa=require(_0xfbf7('0x2'));var util=require(_0xfbf7('0x3'));var BPromise=require(_0xfbf7('0x4'));var moment=require(_0xfbf7('0x5'));var squel=require(_0xfbf7('0x6'));var Redis=require('ioredis');var db=require(_0xfbf7('0x7'))['db'];var config=require(_0xfbf7('0x8'));var shared=require(_0xfbf7('0x9'));var logger=require(_0xfbf7('0xa'))('import');config[_0xfbf7('0xb')]=_[_0xfbf7('0xc')](config['redis'],{'host':_0xfbf7('0xd'),'port':0x18eb});var socket=require(_0xfbf7('0xe'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0xfbf7('0xf')](_0xfbf7('0x10'));function isEmail(_0x3b35a8){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))*$/[_0xfbf7('0x11')](_0x3b35a8);}function selectNotIn(_0x319982,_0x1a2efa,_0x444e57,_0x276eb9,_0x418fd2){return squel[_0xfbf7('0x12')]()[_0xfbf7('0x13')]('phone')[_0xfbf7('0x14')](_0x276eb9)[_0xfbf7('0x15')](_0x1a2efa,null,_0x1a2efa+_0xfbf7('0x16')+_0x276eb9+'.'+_0x444e57)[_0xfbf7('0x17')](_0x276eb9+'.'+_0x444e57+_0xfbf7('0x18')+_0x319982+'.'+_0x444e57)[_0xfbf7('0x17')](_0x1a2efa+_0xfbf7('0x19')+_0x418fd2[_0xfbf7('0x15')]()+')');}function insertCmHopper(_0x52677e,_0x2df2b3,_0x1ab60f,_0x42541d,_0x5df6a1){var _0x3fc771=[_0xfbf7('0x1a'),_0xfbf7('0x1b'),_0xfbf7('0x1c'),_0xfbf7('0x1d'),_0x2df2b3+'.'+_0x42541d,_0xfbf7('0x1e'),_0xfbf7('0x1f'),_0xfbf7('0x20'),_0xfbf7('0x21'),'\x22'+_0x5df6a1+'\x22'];return squel[_0xfbf7('0x22')]()[_0xfbf7('0x23')](_0xfbf7('0x24'))[_0xfbf7('0x25')]([_0xfbf7('0x26'),_0xfbf7('0x27'),_0xfbf7('0x28'),'ListId',_0x42541d,_0xfbf7('0x29'),_0xfbf7('0x2a'),_0xfbf7('0x2b'),'UserId',_0xfbf7('0x2c')],squel[_0xfbf7('0x12')]()[_0xfbf7('0x2d')](_0x3fc771)['from'](_0x2df2b3)[_0xfbf7('0x15')](_0xfbf7('0x2e'),null,_0xfbf7('0x2f')+_0x2df2b3+_0xfbf7('0x30'))[_0xfbf7('0x15')](_0x1ab60f,null,_0x1ab60f+_0xfbf7('0x16')+_0x2df2b3+'.'+_0x42541d)[_0xfbf7('0x17')](_0x2df2b3+_0xfbf7('0x31'),_0x52677e)[_0xfbf7('0x17')](_0xfbf7('0x32'),NOW)[_0xfbf7('0x17')](_0xfbf7('0x33'),selectNotIn(_0x2df2b3,_0x1ab60f,_0x42541d,'cm_hopper',['\x22always\x22','\x22onlyIfOpen\x22']))[_0xfbf7('0x17')](_0xfbf7('0x33'),selectNotIn(_0x2df2b3,_0x1ab60f,_0x42541d,_0xfbf7('0x24'),[_0xfbf7('0x34')])))[_0xfbf7('0x35')]();}function insertCmHopperBlack(_0x2c88ac,_0x4d1680,_0x579054,_0xe2b56c){var _0x11a6ae=[_0xfbf7('0x1a'),_0xfbf7('0x1c'),_0xfbf7('0x1d'),_0x4d1680+'.'+_0xe2b56c,'cm_contacts.createdAt',_0xfbf7('0x1f')];return squel['insert']()[_0xfbf7('0x23')](_0xfbf7('0x36'))[_0xfbf7('0x25')]([_0xfbf7('0x26'),_0xfbf7('0x28'),'ListId',_0xe2b56c,'createdAt',_0xfbf7('0x2a')],squel[_0xfbf7('0x12')]()['fields'](_0x11a6ae)[_0xfbf7('0x14')](_0x4d1680)[_0xfbf7('0x15')](_0xfbf7('0x2e'),null,_0xfbf7('0x2f')+_0x4d1680+_0xfbf7('0x30'))[_0xfbf7('0x15')](_0x579054,null,_0x579054+_0xfbf7('0x16')+_0x4d1680+'.'+_0xe2b56c)['where'](_0x4d1680+'.CmListId\x20=\x20?',_0x2c88ac)['where'](_0xfbf7('0x32'),NOW)['where'](_0xfbf7('0x33'),squel[_0xfbf7('0x12')]()['field'](_0xfbf7('0x26'))['from'](_0xfbf7('0x36'))['where'](_0xfbf7('0x37'),_0x2c88ac)[_0xfbf7('0x17')](_0xe2b56c+_0xfbf7('0x38'),_0x4d1680+'.'+_0xe2b56c)))[_0xfbf7('0x35')]();}function insertTzCmHopper(_0x563ba6,_0x34173f,_0x44d967,_0x25f65b,_0x210374,_0x43a146){var _0x3f95a6=['cm_contacts.phone',_0xfbf7('0x39')+_0x43a146+_0xfbf7('0x3a'),_0xfbf7('0x1c'),'cm_contacts.ListId',_0x34173f+'.'+_0x25f65b,_0xfbf7('0x1e'),_0xfbf7('0x1f'),_0xfbf7('0x20'),'cm_contacts.UserId','\x22'+_0x210374+'\x22'];var _0x42475e=squel[_0xfbf7('0x22')]()[_0xfbf7('0x23')](_0xfbf7('0x24'))[_0xfbf7('0x25')](['phone',_0xfbf7('0x27'),_0xfbf7('0x28'),_0xfbf7('0x3b'),_0x25f65b,_0xfbf7('0x29'),_0xfbf7('0x2a'),_0xfbf7('0x2b'),_0xfbf7('0x3c'),_0xfbf7('0x2c')],squel[_0xfbf7('0x12')]()[_0xfbf7('0x2d')](_0x3f95a6)['from'](_0x34173f)[_0xfbf7('0x15')](_0xfbf7('0x2e'),null,_0xfbf7('0x2f')+_0x34173f+_0xfbf7('0x30'))[_0xfbf7('0x15')](_0x44d967,null,_0x44d967+_0xfbf7('0x16')+_0x34173f+'.'+_0x25f65b)[_0xfbf7('0x15')](_0x43a146,null,_0x43a146+_0xfbf7('0x16')+_0x34173f+'.'+_0x25f65b)[_0xfbf7('0x17')](_0x34173f+'.CmListId\x20=\x20?',_0x563ba6)[_0xfbf7('0x17')](_0xfbf7('0x32'),NOW)[_0xfbf7('0x17')](_0xfbf7('0x33'),selectNotIn(_0x34173f,_0x44d967,_0x25f65b,_0xfbf7('0x24'),['\x22always\x22',_0xfbf7('0x3d')]))['where'](_0xfbf7('0x33'),selectNotIn(_0x34173f,_0x44d967,_0x25f65b,_0xfbf7('0x24'),[_0xfbf7('0x34')])))['toString']();return _0x42475e;}function insertTzCmHopperBlack(_0x1a9308,_0x546053,_0x35c5f8,_0x42c357){var _0x4b6eec=[_0xfbf7('0x1a'),_0xfbf7('0x1c'),'cm_contacts.ListId',_0x546053+'.'+_0x42c357,_0xfbf7('0x1e'),'cm_contacts.updatedAt'];return squel[_0xfbf7('0x22')]()[_0xfbf7('0x23')](_0xfbf7('0x36'))['fromQuery'](['phone',_0xfbf7('0x28'),'ListId',_0x42c357,_0xfbf7('0x29'),'updatedAt'],squel['select']()[_0xfbf7('0x2d')](_0x4b6eec)[_0xfbf7('0x14')](_0x546053)['join']('cm_contacts',null,_0xfbf7('0x2f')+_0x546053+_0xfbf7('0x30'))[_0xfbf7('0x15')](_0x35c5f8,null,_0x35c5f8+_0xfbf7('0x16')+_0x546053+'.'+_0x42c357)[_0xfbf7('0x17')](_0x546053+_0xfbf7('0x31'),_0x1a9308)[_0xfbf7('0x17')](_0xfbf7('0x32'),NOW)['where'](_0xfbf7('0x33'),squel[_0xfbf7('0x12')]()[_0xfbf7('0x13')](_0xfbf7('0x26'))['from']('cm_hopper_black')[_0xfbf7('0x17')]('ListId\x20=\x20?',_0x1a9308)[_0xfbf7('0x17')](_0x42c357+'\x20=\x20?',_0x546053+'.'+_0x42c357)))[_0xfbf7('0x35')]();}function insertCmContact(_0x6b267c,_0x23f8e5,_0x4f4f66,_0x3e4833){var _0x1868b2=_[_0xfbf7('0x3e')](_['keys'](_0x3e4833),['ListId',_0xfbf7('0x3f'),_0xfbf7('0x29'),'updatedAt']);return squel[_0xfbf7('0x22')]()[_0xfbf7('0x23')](_0xfbf7('0x2e'))[_0xfbf7('0x25')](_0x1868b2,squel[_0xfbf7('0x12')]()[_0xfbf7('0x2d')](_0x1868b2)[_0xfbf7('0x14')](_0x23f8e5)[_0xfbf7('0x17')]('('+_0x4f4f66[_0xfbf7('0x15')](',')+')\x20NOT\x20IN\x20?',squel[_0xfbf7('0x12')]()[_0xfbf7('0x2d')](_0x4f4f66)[_0xfbf7('0x14')]('cm_contacts')[_0xfbf7('0x17')](_0xfbf7('0x37'),_0x6b267c)[_0xfbf7('0x17')]('deletedAt\x20IS\x20NULL'))[_0xfbf7('0x17')](_0xfbf7('0x40'),squel[_0xfbf7('0x12')]()[_0xfbf7('0x13')](_0xfbf7('0x41'),'min_id')[_0xfbf7('0x14')](_0x23f8e5)[_0xfbf7('0x42')](_0x4f4f66['join'](','))))[_0xfbf7('0x35')]();}function handleStop(){logger[_0xfbf7('0x43')](_0xfbf7('0x44'));stopped=!![];}function handleUncaughtException(_0x497212){logger[_0xfbf7('0x45')](_0x497212[_0xfbf7('0x46')]);process[_0xfbf7('0x47')](0x1);}function handleError(_0x104e0e,_0x564fe9){stats[_0xfbf7('0x48')][_0xfbf7('0x49')]({'name':_0x564fe9[_0xfbf7('0x4a')],'message':_0x564fe9[_0xfbf7('0x46')],'row':_0x104e0e});}function handleQuery(_0x13f2a1){logger['info'](_0x13f2a1);return db[_0xfbf7('0x4b')][_0xfbf7('0x4c')](_0x13f2a1)['spread'](function(_0x20f0f8){results['push'](_0x20f0f8);})[_0xfbf7('0x4d')](function(_0x2db2b9){logger[_0xfbf7('0x45')](_0x2db2b9[_0xfbf7('0x46')]);});}function updateTzCampaigns(_0x5ed5eb){return new Promise(function(_0x1f2eb8,_0x59180d){var _0x5dca77=squel[_0xfbf7('0x12')]()[_0xfbf7('0x2d')](['campaigns.id','campaigns.dialTimezone'])['from'](_0xfbf7('0x4e'))[_0xfbf7('0x15')](_0xfbf7('0x4f'),null,_0xfbf7('0x50'))[_0xfbf7('0x17')](_0xfbf7('0x51')+_0x5ed5eb);db['sequelize'][_0xfbf7('0x4c')](_0x5dca77[_0xfbf7('0x35')]())[_0xfbf7('0x52')](function(_0x143fd4){var _0x3d4b99=[];for(var _0x409191=0x0;_0x409191<_0x143fd4['length'];_0x409191++){_0x3d4b99[_0xfbf7('0x49')](getTimezoneData(_0x143fd4[_0x409191],tmp_campaigns));}BPromise[_0xfbf7('0x53')](_0x3d4b99)['then'](function(){_0x1f2eb8({'val':0x1});});})[_0xfbf7('0x4d')](function(_0x4bf752){logger[_0xfbf7('0x45')](_0x4bf752[_0xfbf7('0x46')]);_0x1f2eb8({'val':0x0});});});}function updateTzVoiceQueues(_0x22b2e4){return new Promise(function(_0xfeb108,_0x2bb34b){var _0x4df1a1=squel[_0xfbf7('0x12')]()[_0xfbf7('0x2d')]([_0xfbf7('0x54'),'voice_queues.dialTimezone'])[_0xfbf7('0x14')](_0xfbf7('0x55'))[_0xfbf7('0x15')](_0xfbf7('0x56'),null,_0xfbf7('0x57'))[_0xfbf7('0x17')](_0xfbf7('0x58')+_0x22b2e4);db['sequelize'][_0xfbf7('0x4c')](_0x4df1a1[_0xfbf7('0x35')]())[_0xfbf7('0x52')](function(_0x4b291d){var _0x126a93=[];for(var _0x94b02c=0x0;_0x94b02c<_0x4b291d['length'];_0x94b02c++){_0x126a93[_0xfbf7('0x49')](getTimezoneData(_0x4b291d[_0x94b02c],tmp_voice_queues));}BPromise[_0xfbf7('0x53')](_0x126a93)[_0xfbf7('0x59')](function(){_0xfeb108({'val':0x1});});})[_0xfbf7('0x4d')](function(_0x533bea){logger['error'](_0x533bea[_0xfbf7('0x46')]);_0xfeb108({'val':0x0});});});}function getTimezoneData(_0x40ba7f,_0x37ae85){return new Promise(function(_0x53c7fe,_0x1997ce){var _0x130c64=shared[_0xfbf7('0x5a')];var _0xd71522=_0x130c64[_0x40ba7f[_0xfbf7('0x5b')]];if(_['isNil'](_0xd71522)){_0x53c7fe({'ret':0x1});}else{var _0x55554f=_0xd71522['utcOffset'];var _0x1aef27=squel[_0xfbf7('0x22')]()[_0xfbf7('0x23')](_0x37ae85)[_0xfbf7('0x5c')]('id',_0x40ba7f['id'])[_0xfbf7('0x5c')](_0xfbf7('0x5d'),_0x55554f)[_0xfbf7('0x5c')](_0xfbf7('0x5b'),_0x40ba7f[_0xfbf7('0x5b')])[_0xfbf7('0x35')]();return db['sequelize'][_0xfbf7('0x4c')](_0x1aef27)[_0xfbf7('0x52')](function(_0x51868a){_0x53c7fe({'ret':0x1});})['catch'](function(_0x472f24){logger[_0xfbf7('0x45')](_0x472f24[_0xfbf7('0x46')]);_0x1997ce({'ret':0x1});});}});}function handleTZQuery(_0x49b5c6){logger['info'](_0x49b5c6);return db[_0xfbf7('0x4b')][_0xfbf7('0x4c')](_0x49b5c6)[_0xfbf7('0x52')](function(_0x4c34b6){})[_0xfbf7('0x4d')](function(_0x3e263f){logger[_0xfbf7('0x45')](_0x3e263f[_0xfbf7('0x46')]);});}function main(_0x1c3c12,_0x267f69,_0x40c0cb,_0x323c9c){logger[_0xfbf7('0x43')](_0xfbf7('0x5e'),_0x1c3c12,JSON[_0xfbf7('0x5f')](_0x267f69));process[_0xfbf7('0x60')]('start');var _0xe9d12b=_0x267f69[_0xfbf7('0x61')];var _0x13b750=_0x267f69[_0xfbf7('0x62')];var _0x3e7110=path[_0xfbf7('0x15')](config[_0xfbf7('0x63')],_0xfbf7('0x64'),_0x13b750+_0xfbf7('0x65'));hasTZ=_[_0xfbf7('0x66')](_0xe9d12b)['includes'](_0xfbf7('0x5b'));var _0x39f34c=_[_0xfbf7('0x66')](_0xe9d12b)[_0xfbf7('0x15')]();logger['info']('header',_0x39f34c);if(hasTZ)_0x39f34c+=',utcOffset';fs[_0xfbf7('0x67')](_0x3e7110,_0x39f34c+'\x0a');Papa[_0xfbf7('0x68')](fs[_0xfbf7('0x69')](_0x1c3c12),{'header':!![],'skipEmptyLines':!![],'step':function(_0x27659a,_0x17751c){try{for(var _0x3aaf83=0x0,_0x48e1ae=[];_0x3aaf83<_0x27659a[_0xfbf7('0x6a')][_0xfbf7('0x6b')];_0x3aaf83++){stats[_0xfbf7('0x6c')]+=0x1;if(_0x27659a['errors'][_0x3aaf83]){handleError(_0x27659a['data'][_0x3aaf83],_0x27659a[_0xfbf7('0x48')][_0x3aaf83]);}else{var _0x5a41bf=[];for(var _0x584cc7 in _0xe9d12b){if(_0xe9d12b['hasOwnProperty'](_0x584cc7)){if(_0x27659a[_0xfbf7('0x6a')][_0x3aaf83][_0xe9d12b[_0x584cc7]]){var _0x3bf0ba=_[_0xfbf7('0x6d')](_0x27659a[_0xfbf7('0x6a')][_0x3aaf83][_0xe9d12b[_0x584cc7]][_0xfbf7('0x6e')](/"/g,'\x27'));switch(_0x584cc7){case _0xfbf7('0x27'):var _0x56dfb1=moment(_0x3bf0ba,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x56dfb1[_0xfbf7('0x6f')]()){_0x48e1ae[_0xfbf7('0x49')]('\x22'+_0x3bf0ba+'\x22');}else{_0x5a41bf['push'](_0xfbf7('0x70'));}break;case'priority':var _0xc705b5=parseInt(_0x3bf0ba);_0x3bf0ba=_[_0xfbf7('0x71')](_0xc705b5)||_0xc705b5<0x0||_0xc705b5>0x4?_0x323c9c?0x3:0x2:_0xc705b5;_0x48e1ae[_0xfbf7('0x49')]('\x22'+_0x3bf0ba+'\x22');break;case _0xfbf7('0x3c'):var _0x5ca721=parseInt(_0x3bf0ba);if(_[_0xfbf7('0x72')](_0x5ca721)&&_['includes'](_0x40c0cb,_0x5ca721)){_0x48e1ae[_0xfbf7('0x49')]('\x22'+_0x5ca721+'\x22');}else{_0x5a41bf[_0xfbf7('0x49')]('agent\x20not\x20exists');}break;case _0xfbf7('0x73'):if(isEmail(_0x3bf0ba)){_0x48e1ae[_0xfbf7('0x49')]('\x22'+_0x3bf0ba+'\x22');}else{_0x5a41bf['push'](_0xfbf7('0x74'));}break;case'dateOfBirth':var _0x1fcd85=moment(_0x3bf0ba,'YYYY-MM-DD',!![]);if(_0x1fcd85[_0xfbf7('0x6f')]()){_0x48e1ae[_0xfbf7('0x49')]('\x22'+_0x3bf0ba+'\x22');}else{_0x5a41bf[_0xfbf7('0x49')](_0xfbf7('0x75'));}break;case'dialTimezone':var _0xbd189d=shared['timezones'];var _0x10d709=_0xbd189d[_0x3bf0ba];if(!_[_0xfbf7('0x76')](_0x10d709)){var _0x56637c=_0x10d709[_0xfbf7('0x77')];_0x48e1ae[_0xfbf7('0x49')]('\x22'+_0x3bf0ba+'\x22');_0x48e1ae[_0xfbf7('0x49')]('\x22'+_0x56637c+'\x22');}break;default:_0x48e1ae[_0xfbf7('0x49')]('\x22'+_0x3bf0ba+'\x22');}}else{switch(_0x584cc7){case _0xfbf7('0x78'):case _0xfbf7('0x26'):_0x5a41bf[_0xfbf7('0x49')](_0x584cc7+_0xfbf7('0x79'));break;default:_0x48e1ae[_0xfbf7('0x49')]('\x22\x22');}}}}if(_0x5a41bf['length']){handleError(_0x27659a[_0xfbf7('0x6a')][_0x3aaf83],{'code':_0xfbf7('0x7a'),'message':_0x5a41bf[_0xfbf7('0x15')]()});}else{fs[_0xfbf7('0x7b')](_0x3e7110,_0x48e1ae[_0xfbf7('0x15')]()+'\x0a');}_0x48e1ae=[];}if(!(stats[_0xfbf7('0x6c')]%0xc8)){socket[_0xfbf7('0x7c')](_0xfbf7('0x7d')+_0x13b750,stats);stats[_0xfbf7('0x48')]=[];}}if(stopped){logger[_0xfbf7('0x43')](_0xfbf7('0x7e'));_0x17751c[_0xfbf7('0x7f')]();}}catch(_0x4d27a3){handleError(_0x27659a['data'][_0x3aaf83],{'code':_0xfbf7('0x80'),'message':_0x4d27a3[_0xfbf7('0x46')]});logger[_0xfbf7('0x45')](_0xfbf7('0x81'),_0x4d27a3[_0xfbf7('0x46')]);}},'complete':function(){try{var _0x28d32a=[];var _0x2d2875=[];var _0x4af6f2=_0xfbf7('0x2e');if(_0x267f69['duplicates']&&_0x267f69[_0xfbf7('0x82')][_0xfbf7('0x6b')]){_0x4af6f2=_0xfbf7('0x83')+_0x13b750;_0x28d32a[_0xfbf7('0x49')]('CREATE\x20TABLE\x20'+_0x4af6f2+_0xfbf7('0x84'));}tmp_campaigns=_0xfbf7('0x85')+_0x13b750;tmp_voice_queues=_0xfbf7('0x86')+_0x13b750;_0x2d2875['push']('CREATE\x20TABLE\x20'+tmp_campaigns+_0xfbf7('0x87'));_0x2d2875['push'](_0xfbf7('0x88')+tmp_voice_queues+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');BPromise[_0xfbf7('0x89')](_0x2d2875,handleTZQuery)['then'](function(_0x49ccb2){updateTzCampaigns(_0x267f69[_0xfbf7('0x3b')])[_0xfbf7('0x59')](function(_0x201cdd){updateTzVoiceQueues(_0x267f69[_0xfbf7('0x3b')])['then'](function(_0x526476){var _0x5e7d8c=util['format'](_0xfbf7('0x8a'),_0x3e7110,_0x4af6f2,_0x39f34c,_0x267f69[_0xfbf7('0x3b')],_0x267f69[_0xfbf7('0x3f')]||null,NOW,NOW);if(_[_0xfbf7('0x76')](_0xe9d12b['scheduledat'])){_0x5e7d8c+=_0xfbf7('0x8b');}_0x28d32a[_0xfbf7('0x49')](_0x5e7d8c);if(_0x267f69[_0xfbf7('0x82')]&&_0x267f69[_0xfbf7('0x82')][_0xfbf7('0x6b')]){_0x28d32a[_0xfbf7('0x49')](insertCmContact(_0x267f69[_0xfbf7('0x3b')],_0x4af6f2,_0x267f69[_0xfbf7('0x82')],_0xe9d12b));_0x28d32a[_0xfbf7('0x49')](_0xfbf7('0x8c')+_0x4af6f2+';');}if(hasTZ){_0x28d32a[_0xfbf7('0x49')](insertTzCmHopper(_0x267f69[_0xfbf7('0x3b')],_0xfbf7('0x56'),_0xfbf7('0x55'),_0xfbf7('0x8d'),_0x323c9c,tmp_voice_queues));_0x28d32a[_0xfbf7('0x49')](insertTzCmHopperBlack(_0x267f69['ListId'],_0xfbf7('0x8e'),_0xfbf7('0x55'),_0xfbf7('0x8d')));_0x28d32a['push'](insertTzCmHopper(_0x267f69['ListId'],'campaigns_has_cm_lists',_0xfbf7('0x4e'),_0xfbf7('0x8f'),_0x323c9c,tmp_campaigns));_0x28d32a[_0xfbf7('0x49')](insertTzCmHopperBlack(_0x267f69[_0xfbf7('0x3b')],_0xfbf7('0x90'),_0xfbf7('0x4e'),_0xfbf7('0x8f')));}else{_0x28d32a[_0xfbf7('0x49')](insertCmHopper(_0x267f69['ListId'],_0xfbf7('0x56'),_0xfbf7('0x55'),_0xfbf7('0x8d'),_0x323c9c));_0x28d32a[_0xfbf7('0x49')](insertCmHopperBlack(_0x267f69[_0xfbf7('0x3b')],_0xfbf7('0x8e'),_0xfbf7('0x55'),_0xfbf7('0x8d')));_0x28d32a[_0xfbf7('0x49')](insertCmHopper(_0x267f69[_0xfbf7('0x3b')],_0xfbf7('0x4f'),_0xfbf7('0x4e'),'CampaignId',_0x323c9c));_0x28d32a[_0xfbf7('0x49')](insertCmHopperBlack(_0x267f69[_0xfbf7('0x3b')],'campaigns_has_cm_blacklists',_0xfbf7('0x4e'),'CampaignId'));}_0x28d32a['push'](_0xfbf7('0x8c')+tmp_campaigns+';');_0x28d32a[_0xfbf7('0x49')]('DROP\x20TABLE\x20'+tmp_voice_queues+';');BPromise[_0xfbf7('0x89')](_0x28d32a,handleQuery)['then'](function(_0x5cbab5){stats[_0xfbf7('0x91')]=!![];stats[_0xfbf7('0x92')]=_0x267f69['duplicates']&&_0x267f69['duplicates'][_0xfbf7('0x6b')]?results[0x2][_0xfbf7('0x92')]:results[0x0][_0xfbf7('0x92')];socket[_0xfbf7('0x7c')](_0xfbf7('0x7d')+_0x13b750,stats);fs[_0xfbf7('0x93')](_0x1c3c12);fs[_0xfbf7('0x93')](_0x3e7110);process[_0xfbf7('0x47')](0x0);})[_0xfbf7('0x4d')](function(_0x17da19){logger[_0xfbf7('0x45')](_0x17da19[_0xfbf7('0x46')]);process[_0xfbf7('0x47')](0x1);});});});});}catch(_0x633652){logger['error']('complete',_0x633652[_0xfbf7('0x46')]);process['exit'](0x1);}},'error':function(_0x1233fa,_0x4dcfa2,_0x46de82,_0x295482){throw new Error(_0x295482);}});}function validate(){if(process[_0xfbf7('0x94')]&&process[_0xfbf7('0x94')][_0xfbf7('0x6b')]<0x4){throw new Error(_0xfbf7('0x95'));}var _0x388e87=path[_0xfbf7('0x15')](config[_0xfbf7('0x63')],_0xfbf7('0x64'),process['argv'][0x2]);if(!fs[_0xfbf7('0x96')](_0x388e87)){throw new Error(_0xfbf7('0x97'));}var _0x7ae470={};try{_0x7ae470=JSON[_0xfbf7('0x68')](process[_0xfbf7('0x94')][0x3]);if(!_0x7ae470[_0xfbf7('0x61')]){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0x7ae470[_0xfbf7('0x61')]['phone']){throw new Error(_0xfbf7('0x98'));}if(!_0x7ae470['binding'][_0xfbf7('0x78')]){throw new Error(_0xfbf7('0x99'));}var _0x2d8724=0x0;if(_0x7ae470[_0xfbf7('0x61')][_0xfbf7('0x3c')]){_0x2d8724=0x1;}if(!_0x7ae470['ListId']){throw new Error(_0xfbf7('0x9a'));}}catch(_0x52096e){throw new Error(_0xfbf7('0x9b'));}var _0x5d32cd=[];try{_0x5d32cd=_[_0xfbf7('0x9c')](JSON['parse'](process['argv'][0x4]),'id');}catch(_0x10e6eb){logger[_0xfbf7('0x43')](_0xfbf7('0x9d'));}main(_0x388e87,_0x7ae470,_0x5d32cd,_0x2d8724);}validate();process['on'](_0xfbf7('0x9e'),handleStop);process['on'](_0xfbf7('0x9f'),handleUncaughtException); \ No newline at end of file +var _0xc0bf=['SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','format','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','DROP\x20TABLE\x20','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns','CampaignId','campaigns_has_cm_blacklists','finish','affectedRows','unlink','exit','complete','argv','root','existsSync','file\x20doesn\x27t\x20exists','binding','ListId\x20is\x20mandatory','uncaughtException','papaparse','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','defaults','redis','localhost','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','select','field','phone','join','where','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','insert','into','fromQuery','scheduledat','ContactId','ListId','updatedAt','priority','UserId','recallme','fields','from','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_hopper_black','createdAt','\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.UserId','.id\x20=\x20','cm_contacts','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','deletedAt\x20IS\x20NULL','MIN(id)','min_id','group','info','Received\x20SIGINT','error','errors','push','message','sequelize','spread','catch','campaigns.dialTimezone','campaigns_has_cm_lists','campaigns_has_cm_lists.CmListId=','query','length','all','then','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','dialTimezone','isNil','set','offset','main','stringify','start','socket_timestamp','server/files/tmp','includes',',utcOffset','parse','rows','hasOwnProperty','data','trim','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','isValid','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','timezones','utcOffset','firstName','\x20not\x20specified','SystemRow','appendFileSync','contact:import:','Abort\x20parser','abort'];(function(_0x35dba6,_0x53624e){var _0x10c50b=function(_0x141082){while(--_0x141082){_0x35dba6['push'](_0x35dba6['shift']());}};_0x10c50b(++_0x53624e);}(_0xc0bf,0xb4));var _0xfc0b=function(_0x41f4ae,_0x58f9cd){_0x41f4ae=_0x41f4ae-0x0;var _0x244093=_0xc0bf[_0x41f4ae];return _0x244093;};'use strict';var fs=require('fs');var path=require('path');var _=require('lodash');var Papa=require(_0xfc0b('0x0'));var util=require('util');var BPromise=require(_0xfc0b('0x1'));var moment=require(_0xfc0b('0x2'));var squel=require(_0xfc0b('0x3'));var Redis=require(_0xfc0b('0x4'));var db=require(_0xfc0b('0x5'))['db'];var config=require(_0xfc0b('0x6'));var shared=require(_0xfc0b('0x7'));var logger=require(_0xfc0b('0x8'))('import');config['redis']=_[_0xfc0b('0x9')](config[_0xfc0b('0xa')],{'host':_0xfc0b('0xb'),'port':0x18eb});var socket=require(_0xfc0b('0xc'))(new Redis(config[_0xfc0b('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()['format'](_0xfc0b('0xd'));function isEmail(_0x4afdeb){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'](_0x4afdeb);}function selectNotIn(_0x56b4fc,_0x1a2554,_0x5d5b2b,_0x4e27ea,_0x69b036){return squel[_0xfc0b('0xe')]()[_0xfc0b('0xf')](_0xfc0b('0x10'))['from'](_0x4e27ea)[_0xfc0b('0x11')](_0x1a2554,null,_0x1a2554+'.id\x20=\x20'+_0x4e27ea+'.'+_0x5d5b2b)[_0xfc0b('0x12')](_0x4e27ea+'.'+_0x5d5b2b+'\x20=\x20'+_0x56b4fc+'.'+_0x5d5b2b)[_0xfc0b('0x12')](_0x1a2554+'.dialCheckDuplicateType\x20IN\x20('+_0x69b036['join']()+')');}function insertCmHopper(_0x2aac80,_0x80cde9,_0xc0b5dc,_0x569ea1,_0x54b4fe){var _0x1c951b=[_0xfc0b('0x13'),_0xfc0b('0x14'),_0xfc0b('0x15'),_0xfc0b('0x16'),_0x80cde9+'.'+_0x569ea1,_0xfc0b('0x17'),_0xfc0b('0x18'),_0xfc0b('0x19'),'cm_contacts.UserId','\x22'+_0x54b4fe+'\x22'];return squel[_0xfc0b('0x1a')]()[_0xfc0b('0x1b')]('cm_hopper')[_0xfc0b('0x1c')]([_0xfc0b('0x10'),_0xfc0b('0x1d'),_0xfc0b('0x1e'),_0xfc0b('0x1f'),_0x569ea1,'createdAt',_0xfc0b('0x20'),_0xfc0b('0x21'),_0xfc0b('0x22'),_0xfc0b('0x23')],squel[_0xfc0b('0xe')]()[_0xfc0b('0x24')](_0x1c951b)[_0xfc0b('0x25')](_0x80cde9)[_0xfc0b('0x11')]('cm_contacts',null,_0xfc0b('0x26')+_0x80cde9+_0xfc0b('0x27'))[_0xfc0b('0x11')](_0xc0b5dc,null,_0xc0b5dc+'.id\x20=\x20'+_0x80cde9+'.'+_0x569ea1)[_0xfc0b('0x12')](_0x80cde9+_0xfc0b('0x28'),_0x2aac80)[_0xfc0b('0x12')](_0xfc0b('0x29'),NOW)['where'](_0xfc0b('0x2a'),selectNotIn(_0x80cde9,_0xc0b5dc,_0x569ea1,_0xfc0b('0x2b'),[_0xfc0b('0x2c'),_0xfc0b('0x2d')]))[_0xfc0b('0x12')](_0xfc0b('0x2a'),selectNotIn(_0x80cde9,_0xc0b5dc,_0x569ea1,_0xfc0b('0x2b'),[_0xfc0b('0x2c')])))[_0xfc0b('0x2e')]();}function insertCmHopperBlack(_0x2442ca,_0xbd82df,_0x3142e7,_0x28faf1){var _0xbda1a1=[_0xfc0b('0x13'),_0xfc0b('0x15'),_0xfc0b('0x16'),_0xbd82df+'.'+_0x28faf1,_0xfc0b('0x17'),_0xfc0b('0x18')];return squel[_0xfc0b('0x1a')]()[_0xfc0b('0x1b')](_0xfc0b('0x2f'))[_0xfc0b('0x1c')]([_0xfc0b('0x10'),'ContactId',_0xfc0b('0x1f'),_0x28faf1,_0xfc0b('0x30'),_0xfc0b('0x20')],squel[_0xfc0b('0xe')]()[_0xfc0b('0x24')](_0xbda1a1)[_0xfc0b('0x25')](_0xbd82df)[_0xfc0b('0x11')]('cm_contacts',null,_0xfc0b('0x26')+_0xbd82df+_0xfc0b('0x27'))[_0xfc0b('0x11')](_0x3142e7,null,_0x3142e7+'.id\x20=\x20'+_0xbd82df+'.'+_0x28faf1)[_0xfc0b('0x12')](_0xbd82df+_0xfc0b('0x28'),_0x2442ca)['where'](_0xfc0b('0x29'),NOW)[_0xfc0b('0x12')](_0xfc0b('0x2a'),squel[_0xfc0b('0xe')]()[_0xfc0b('0xf')](_0xfc0b('0x10'))['from'](_0xfc0b('0x2f'))[_0xfc0b('0x12')]('ListId\x20=\x20?',_0x2442ca)[_0xfc0b('0x12')](_0x28faf1+_0xfc0b('0x31'),_0xbd82df+'.'+_0x28faf1)))[_0xfc0b('0x2e')]();}function insertTzCmHopper(_0x415953,_0x5cd648,_0x57725b,_0x138616,_0x23481b,_0x1d44a2){var _0x318b8f=[_0xfc0b('0x13'),_0xfc0b('0x32')+_0x1d44a2+_0xfc0b('0x33'),_0xfc0b('0x15'),'cm_contacts.ListId',_0x5cd648+'.'+_0x138616,'cm_contacts.createdAt',_0xfc0b('0x18'),_0xfc0b('0x19'),_0xfc0b('0x34'),'\x22'+_0x23481b+'\x22'];var _0x5f0627=squel['insert']()[_0xfc0b('0x1b')](_0xfc0b('0x2b'))[_0xfc0b('0x1c')]([_0xfc0b('0x10'),_0xfc0b('0x1d'),_0xfc0b('0x1e'),_0xfc0b('0x1f'),_0x138616,_0xfc0b('0x30'),'updatedAt',_0xfc0b('0x21'),_0xfc0b('0x22'),'recallme'],squel[_0xfc0b('0xe')]()['fields'](_0x318b8f)[_0xfc0b('0x25')](_0x5cd648)[_0xfc0b('0x11')]('cm_contacts',null,_0xfc0b('0x26')+_0x5cd648+'.CmListId')[_0xfc0b('0x11')](_0x57725b,null,_0x57725b+_0xfc0b('0x35')+_0x5cd648+'.'+_0x138616)['join'](_0x1d44a2,null,_0x1d44a2+_0xfc0b('0x35')+_0x5cd648+'.'+_0x138616)[_0xfc0b('0x12')](_0x5cd648+'.CmListId\x20=\x20?',_0x415953)[_0xfc0b('0x12')](_0xfc0b('0x29'),NOW)[_0xfc0b('0x12')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x5cd648,_0x57725b,_0x138616,'cm_hopper',[_0xfc0b('0x2c'),_0xfc0b('0x2d')]))[_0xfc0b('0x12')](_0xfc0b('0x2a'),selectNotIn(_0x5cd648,_0x57725b,_0x138616,'cm_hopper',[_0xfc0b('0x2c')])))[_0xfc0b('0x2e')]();return _0x5f0627;}function insertTzCmHopperBlack(_0x744793,_0xc2e244,_0x584786,_0x3e31f6){var _0x1c5c15=[_0xfc0b('0x13'),'cm_contacts.id',_0xfc0b('0x16'),_0xc2e244+'.'+_0x3e31f6,_0xfc0b('0x17'),_0xfc0b('0x18')];return squel[_0xfc0b('0x1a')]()[_0xfc0b('0x1b')](_0xfc0b('0x2f'))[_0xfc0b('0x1c')]([_0xfc0b('0x10'),'ContactId',_0xfc0b('0x1f'),_0x3e31f6,_0xfc0b('0x30'),'updatedAt'],squel[_0xfc0b('0xe')]()['fields'](_0x1c5c15)[_0xfc0b('0x25')](_0xc2e244)[_0xfc0b('0x11')](_0xfc0b('0x36'),null,_0xfc0b('0x26')+_0xc2e244+'.CmListId')[_0xfc0b('0x11')](_0x584786,null,_0x584786+_0xfc0b('0x35')+_0xc2e244+'.'+_0x3e31f6)[_0xfc0b('0x12')](_0xc2e244+_0xfc0b('0x28'),_0x744793)[_0xfc0b('0x12')](_0xfc0b('0x29'),NOW)[_0xfc0b('0x12')](_0xfc0b('0x2a'),squel[_0xfc0b('0xe')]()[_0xfc0b('0xf')](_0xfc0b('0x10'))['from'](_0xfc0b('0x2f'))[_0xfc0b('0x12')]('ListId\x20=\x20?',_0x744793)['where'](_0x3e31f6+_0xfc0b('0x31'),_0xc2e244+'.'+_0x3e31f6)))[_0xfc0b('0x2e')]();}function insertCmContact(_0x2dfa64,_0xf76da2,_0x40d077,_0x5e24b7){var _0x35d695=_[_0xfc0b('0x37')](_[_0xfc0b('0x38')](_0x5e24b7),[_0xfc0b('0x1f'),_0xfc0b('0x39'),_0xfc0b('0x30'),'updatedAt']);return squel[_0xfc0b('0x1a')]()[_0xfc0b('0x1b')](_0xfc0b('0x36'))[_0xfc0b('0x1c')](_0x35d695,squel[_0xfc0b('0xe')]()[_0xfc0b('0x24')](_0x35d695)[_0xfc0b('0x25')](_0xf76da2)[_0xfc0b('0x12')]('('+_0x40d077[_0xfc0b('0x11')](',')+_0xfc0b('0x3a'),squel[_0xfc0b('0xe')]()[_0xfc0b('0x24')](_0x40d077)[_0xfc0b('0x25')]('cm_contacts')['where'](_0xfc0b('0x3b'),_0x2dfa64)[_0xfc0b('0x12')](_0xfc0b('0x3c')))['where']('id\x20IN\x20?',squel['select']()[_0xfc0b('0xf')](_0xfc0b('0x3d'),_0xfc0b('0x3e'))[_0xfc0b('0x25')](_0xf76da2)[_0xfc0b('0x3f')](_0x40d077[_0xfc0b('0x11')](','))))[_0xfc0b('0x2e')]();}function handleStop(){logger[_0xfc0b('0x40')](_0xfc0b('0x41'));stopped=!![];}function handleUncaughtException(_0x1e4df3){logger[_0xfc0b('0x42')](_0x1e4df3['message']);process['exit'](0x1);}function handleError(_0x11d4db,_0x209cc1){stats[_0xfc0b('0x43')][_0xfc0b('0x44')]({'name':_0x209cc1['code'],'message':_0x209cc1[_0xfc0b('0x45')],'row':_0x11d4db});}function handleQuery(_0x18ccda){logger['info'](_0x18ccda);return db[_0xfc0b('0x46')]['query'](_0x18ccda)[_0xfc0b('0x47')](function(_0x2b3c87){results[_0xfc0b('0x44')](_0x2b3c87);})[_0xfc0b('0x48')](function(_0x40833c){logger[_0xfc0b('0x42')](_0x40833c[_0xfc0b('0x45')]);});}function updateTzCampaigns(_0x27dd7d){return new Promise(function(_0x2f1f3b,_0x9fdb58){var _0x1eef39=squel[_0xfc0b('0xe')]()[_0xfc0b('0x24')](['campaigns.id',_0xfc0b('0x49')])[_0xfc0b('0x25')]('campaigns')['join'](_0xfc0b('0x4a'),null,'campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId')['where'](_0xfc0b('0x4b')+_0x27dd7d);db[_0xfc0b('0x46')][_0xfc0b('0x4c')](_0x1eef39[_0xfc0b('0x2e')]())[_0xfc0b('0x47')](function(_0x522c7a){var _0x14951f=[];for(var _0x45048e=0x0;_0x45048e<_0x522c7a[_0xfc0b('0x4d')];_0x45048e++){_0x14951f['push'](getTimezoneData(_0x522c7a[_0x45048e],tmp_campaigns));}BPromise[_0xfc0b('0x4e')](_0x14951f)[_0xfc0b('0x4f')](function(){_0x2f1f3b({'val':0x1});});})['catch'](function(_0x29d2cb){logger[_0xfc0b('0x42')](_0x29d2cb[_0xfc0b('0x45')]);_0x2f1f3b({'val':0x0});});});}function updateTzVoiceQueues(_0x336f4d){return new Promise(function(_0x3057ae,_0x5cf531){var _0x1e3a89=squel[_0xfc0b('0xe')]()[_0xfc0b('0x24')]([_0xfc0b('0x50'),_0xfc0b('0x51')])['from'](_0xfc0b('0x52'))[_0xfc0b('0x11')](_0xfc0b('0x53'),null,_0xfc0b('0x54'))[_0xfc0b('0x12')](_0xfc0b('0x55')+_0x336f4d);db[_0xfc0b('0x46')][_0xfc0b('0x4c')](_0x1e3a89['toString']())['spread'](function(_0x3569ed){var _0x1d2667=[];for(var _0x5ac6a9=0x0;_0x5ac6a9<_0x3569ed['length'];_0x5ac6a9++){_0x1d2667[_0xfc0b('0x44')](getTimezoneData(_0x3569ed[_0x5ac6a9],tmp_voice_queues));}BPromise[_0xfc0b('0x4e')](_0x1d2667)[_0xfc0b('0x4f')](function(){_0x3057ae({'val':0x1});});})[_0xfc0b('0x48')](function(_0x567685){logger['error'](_0x567685[_0xfc0b('0x45')]);_0x3057ae({'val':0x0});});});}function getTimezoneData(_0x2ae39f,_0x45944c){return new Promise(function(_0x88e659,_0x2125b5){var _0x43d12f=shared['timezones'];var _0x726a43=_0x43d12f[_0x2ae39f[_0xfc0b('0x56')]];if(_[_0xfc0b('0x57')](_0x726a43)){_0x88e659({'ret':0x1});}else{var _0x192d1b=_0x726a43['utcOffset'];var _0x28b1a8=squel[_0xfc0b('0x1a')]()[_0xfc0b('0x1b')](_0x45944c)[_0xfc0b('0x58')]('id',_0x2ae39f['id'])[_0xfc0b('0x58')](_0xfc0b('0x59'),_0x192d1b)['set'](_0xfc0b('0x56'),_0x2ae39f[_0xfc0b('0x56')])['toString']();return db[_0xfc0b('0x46')][_0xfc0b('0x4c')](_0x28b1a8)['spread'](function(_0xa412b8){_0x88e659({'ret':0x1});})[_0xfc0b('0x48')](function(_0x33469b){logger[_0xfc0b('0x42')](_0x33469b[_0xfc0b('0x45')]);_0x2125b5({'ret':0x1});});}});}function handleTZQuery(_0x147369){logger[_0xfc0b('0x40')](_0x147369);return db[_0xfc0b('0x46')][_0xfc0b('0x4c')](_0x147369)[_0xfc0b('0x47')](function(_0x27a779){})[_0xfc0b('0x48')](function(_0x1d12ce){logger[_0xfc0b('0x42')](_0x1d12ce['message']);});}function main(_0x47da07,_0xfb0088,_0x5b80e8,_0x594cf0){logger[_0xfc0b('0x40')](_0xfc0b('0x5a'),_0x47da07,JSON[_0xfc0b('0x5b')](_0xfb0088));process['send'](_0xfc0b('0x5c'));var _0xa01109=_0xfb0088['binding'];var _0x162116=_0xfb0088[_0xfc0b('0x5d')];var _0x406dac=path['join'](config['root'],_0xfc0b('0x5e'),_0x162116+'.csv');hasTZ=_[_0xfc0b('0x38')](_0xa01109)[_0xfc0b('0x5f')]('dialTimezone');var _0x39ed39=_['keys'](_0xa01109)[_0xfc0b('0x11')]();logger[_0xfc0b('0x40')]('header',_0x39ed39);if(hasTZ)_0x39ed39+=_0xfc0b('0x60');fs['writeFileSync'](_0x406dac,_0x39ed39+'\x0a');Papa[_0xfc0b('0x61')](fs['createReadStream'](_0x47da07),{'header':!![],'skipEmptyLines':!![],'step':function(_0x1fb6f2,_0x511f7c){try{for(var _0x50eda3=0x0,_0x16ceae=[];_0x50eda3<_0x1fb6f2['data']['length'];_0x50eda3++){stats[_0xfc0b('0x62')]+=0x1;if(_0x1fb6f2[_0xfc0b('0x43')][_0x50eda3]){handleError(_0x1fb6f2['data'][_0x50eda3],_0x1fb6f2[_0xfc0b('0x43')][_0x50eda3]);}else{var _0x34533f=[];for(var _0x7a20a9 in _0xa01109){if(_0xa01109[_0xfc0b('0x63')](_0x7a20a9)){if(_0x1fb6f2[_0xfc0b('0x64')][_0x50eda3][_0xa01109[_0x7a20a9]]){var _0x1c3369=_[_0xfc0b('0x65')](_0x1fb6f2['data'][_0x50eda3][_0xa01109[_0x7a20a9]]['replace'](/"/g,'\x27'));switch(_0x7a20a9){case _0xfc0b('0x1d'):var _0x589a22=moment(_0x1c3369,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x589a22['isValid']()){_0x16ceae[_0xfc0b('0x44')]('\x22'+_0x1c3369+'\x22');}else{_0x34533f[_0xfc0b('0x44')](_0xfc0b('0x66'));}break;case _0xfc0b('0x21'):var _0x3f5839=parseInt(_0x1c3369);_0x1c3369=_[_0xfc0b('0x67')](_0x3f5839)||_0x3f5839<0x0||_0x3f5839>0x4?_0x594cf0?0x3:0x2:_0x3f5839;_0x16ceae['push']('\x22'+_0x1c3369+'\x22');break;case _0xfc0b('0x22'):var _0x11a665=parseInt(_0x1c3369);if(_['isNumber'](_0x11a665)&&_['includes'](_0x5b80e8,_0x11a665)){_0x16ceae[_0xfc0b('0x44')]('\x22'+_0x11a665+'\x22');}else{_0x34533f['push'](_0xfc0b('0x68'));}break;case _0xfc0b('0x69'):if(isEmail(_0x1c3369)){_0x16ceae[_0xfc0b('0x44')]('\x22'+_0x1c3369+'\x22');}else{_0x34533f[_0xfc0b('0x44')](_0xfc0b('0x6a'));}break;case _0xfc0b('0x6b'):var _0xded079=moment(_0x1c3369,_0xfc0b('0x6c'),!![]);if(_0xded079[_0xfc0b('0x6d')]()){_0x16ceae[_0xfc0b('0x44')]('\x22'+_0x1c3369+'\x22');}else{_0x34533f['push'](_0xfc0b('0x6e'));}break;case _0xfc0b('0x56'):var _0x2ed011=shared[_0xfc0b('0x6f')];var _0x3fef47=_0x2ed011[_0x1c3369];if(!_[_0xfc0b('0x57')](_0x3fef47)){var _0x10a13c=_0x3fef47[_0xfc0b('0x70')];_0x16ceae[_0xfc0b('0x44')]('\x22'+_0x1c3369+'\x22');_0x16ceae[_0xfc0b('0x44')]('\x22'+_0x10a13c+'\x22');}break;default:_0x16ceae['push']('\x22'+_0x1c3369+'\x22');}}else{switch(_0x7a20a9){case _0xfc0b('0x71'):case _0xfc0b('0x10'):_0x34533f[_0xfc0b('0x44')](_0x7a20a9+_0xfc0b('0x72'));break;default:_0x16ceae[_0xfc0b('0x44')]('\x22\x22');}}}}if(_0x34533f[_0xfc0b('0x4d')]){handleError(_0x1fb6f2[_0xfc0b('0x64')][_0x50eda3],{'code':_0xfc0b('0x73'),'message':_0x34533f[_0xfc0b('0x11')]()});}else{fs[_0xfc0b('0x74')](_0x406dac,_0x16ceae[_0xfc0b('0x11')]()+'\x0a');}_0x16ceae=[];}if(!(stats['rows']%0xc8)){socket['emit'](_0xfc0b('0x75')+_0x162116,stats);stats[_0xfc0b('0x43')]=[];}}if(stopped){logger[_0xfc0b('0x40')](_0xfc0b('0x76'));_0x511f7c[_0xfc0b('0x77')]();}}catch(_0x2a62ea){handleError(_0x1fb6f2[_0xfc0b('0x64')][_0x50eda3],{'code':_0xfc0b('0x78'),'message':_0x2a62ea[_0xfc0b('0x45')]});logger[_0xfc0b('0x42')](_0xfc0b('0x79'),_0x2a62ea[_0xfc0b('0x45')]);}},'complete':function(){try{var _0x21c7ab=[];var _0x45b6db=[];var _0x55f934=_0xfc0b('0x36');if(_0xfb0088[_0xfc0b('0x7a')]&&_0xfb0088[_0xfc0b('0x7a')][_0xfc0b('0x4d')]){_0x55f934=_0xfc0b('0x7b')+_0x162116;_0x21c7ab[_0xfc0b('0x44')](_0xfc0b('0x7c')+_0x55f934+_0xfc0b('0x7d'));}tmp_campaigns=_0xfc0b('0x7e')+_0x162116;tmp_voice_queues=_0xfc0b('0x7f')+_0x162116;_0x45b6db[_0xfc0b('0x44')]('CREATE\x20TABLE\x20'+tmp_campaigns+_0xfc0b('0x80'));_0x45b6db[_0xfc0b('0x44')](_0xfc0b('0x7c')+tmp_voice_queues+_0xfc0b('0x80'));BPromise[_0xfc0b('0x81')](_0x45b6db,handleTZQuery)[_0xfc0b('0x4f')](function(_0x2e2a0b){updateTzCampaigns(_0xfb0088[_0xfc0b('0x1f')])['then'](function(_0x57b3fe){updateTzVoiceQueues(_0xfb0088[_0xfc0b('0x1f')])[_0xfc0b('0x4f')](function(_0x14279a){var _0xb28d0c=util[_0xfc0b('0x82')](_0xfc0b('0x83'),_0x406dac,_0x55f934,_0x39ed39,_0xfb0088['ListId'],_0xfb0088[_0xfc0b('0x39')]||null,NOW,NOW);if(_[_0xfc0b('0x57')](_0xa01109[_0xfc0b('0x1d')])){_0xb28d0c+=',\x20scheduledAt\x20=\x20NOW()';}_0x21c7ab['push'](_0xb28d0c);if(_0xfb0088[_0xfc0b('0x7a')]&&_0xfb0088[_0xfc0b('0x7a')]['length']){_0x21c7ab['push'](insertCmContact(_0xfb0088['ListId'],_0x55f934,_0xfb0088[_0xfc0b('0x7a')],_0xa01109));_0x21c7ab[_0xfc0b('0x44')](_0xfc0b('0x84')+_0x55f934+';');}if(hasTZ){_0x21c7ab[_0xfc0b('0x44')](insertTzCmHopper(_0xfb0088['ListId'],_0xfc0b('0x53'),'voice_queues',_0xfc0b('0x85'),_0x594cf0,tmp_voice_queues));_0x21c7ab[_0xfc0b('0x44')](insertTzCmHopperBlack(_0xfb0088[_0xfc0b('0x1f')],_0xfc0b('0x86'),_0xfc0b('0x52'),_0xfc0b('0x85')));_0x21c7ab[_0xfc0b('0x44')](insertTzCmHopper(_0xfb0088['ListId'],'campaigns_has_cm_lists',_0xfc0b('0x87'),_0xfc0b('0x88'),_0x594cf0,tmp_campaigns));_0x21c7ab[_0xfc0b('0x44')](insertTzCmHopperBlack(_0xfb0088[_0xfc0b('0x1f')],'campaigns_has_cm_blacklists',_0xfc0b('0x87'),'CampaignId'));}else{_0x21c7ab[_0xfc0b('0x44')](insertCmHopper(_0xfb0088[_0xfc0b('0x1f')],_0xfc0b('0x53'),_0xfc0b('0x52'),_0xfc0b('0x85'),_0x594cf0));_0x21c7ab[_0xfc0b('0x44')](insertCmHopperBlack(_0xfb0088[_0xfc0b('0x1f')],_0xfc0b('0x86'),_0xfc0b('0x52'),_0xfc0b('0x85')));_0x21c7ab['push'](insertCmHopper(_0xfb0088[_0xfc0b('0x1f')],'campaigns_has_cm_lists','campaigns',_0xfc0b('0x88'),_0x594cf0));_0x21c7ab[_0xfc0b('0x44')](insertCmHopperBlack(_0xfb0088['ListId'],_0xfc0b('0x89'),_0xfc0b('0x87'),_0xfc0b('0x88')));}_0x21c7ab[_0xfc0b('0x44')]('DROP\x20TABLE\x20'+tmp_campaigns+';');_0x21c7ab[_0xfc0b('0x44')]('DROP\x20TABLE\x20'+tmp_voice_queues+';');BPromise[_0xfc0b('0x81')](_0x21c7ab,handleQuery)[_0xfc0b('0x4f')](function(_0x48a23a){stats[_0xfc0b('0x8a')]=!![];stats[_0xfc0b('0x8b')]=_0xfb0088[_0xfc0b('0x7a')]&&_0xfb0088[_0xfc0b('0x7a')]['length']?results[0x2][_0xfc0b('0x8b')]:results[0x0][_0xfc0b('0x8b')];socket['emit']('contact:import:'+_0x162116,stats);fs[_0xfc0b('0x8c')](_0x47da07);fs[_0xfc0b('0x8c')](_0x406dac);process[_0xfc0b('0x8d')](0x0);})[_0xfc0b('0x48')](function(_0x3b1d96){logger['error'](_0x3b1d96[_0xfc0b('0x45')]);process['exit'](0x1);});});});});}catch(_0x1d97f8){logger[_0xfc0b('0x42')](_0xfc0b('0x8e'),_0x1d97f8[_0xfc0b('0x45')]);process[_0xfc0b('0x8d')](0x1);}},'error':function(_0x3947d9,_0x421c01,_0x4b75a0,_0xa315d2){throw new Error(_0xa315d2);}});}function validate(){if(process[_0xfc0b('0x8f')]&&process[_0xfc0b('0x8f')][_0xfc0b('0x4d')]<0x4){throw new Error('arguments\x20\x20\x20');}var _0x42b71f=path['join'](config[_0xfc0b('0x90')],'server/files/tmp',process['argv'][0x2]);if(!fs[_0xfc0b('0x91')](_0x42b71f)){throw new Error(_0xfc0b('0x92'));}var _0xb62cc7={};try{_0xb62cc7=JSON[_0xfc0b('0x61')](process[_0xfc0b('0x8f')][0x3]);if(!_0xb62cc7[_0xfc0b('0x93')]){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0xb62cc7[_0xfc0b('0x93')]['phone']){throw new Error('phone\x20is\x20mandatory');}if(!_0xb62cc7[_0xfc0b('0x93')]['firstName']){throw new Error('firstName\x20is\x20mandatory');}var _0x3f26cd=0x0;if(_0xb62cc7[_0xfc0b('0x93')]['UserId']){_0x3f26cd=0x1;}if(!_0xb62cc7[_0xfc0b('0x1f')]){throw new Error(_0xfc0b('0x94'));}}catch(_0x349885){throw new Error('body\x20id\x20mandatory');}var _0x201fc3=[];try{_0x201fc3=_['map'](JSON['parse'](process[_0xfc0b('0x8f')][0x4]),'id');}catch(_0x43bd96){logger['info']('No\x20agent\x20available');}main(_0x42b71f,_0xb62cc7,_0x201fc3,_0x3f26cd);}validate();process['on']('SIGINT',handleStop);process['on'](_0xfc0b('0x95'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index d5bec95..0cf2aa0 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 _0x92c8=['UniqueId','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','membername','Duration','duration','string','toLowerCase','voice','push','variable','queue','calleridnum','outbound','Outbound\x20Call','destcalleridnum','getDescriptions','inbound','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','Call\x20To','destexten'];(function(_0x44a08e,_0x58d871){var _0x284fac=function(_0x1ae40f){while(--_0x1ae40f){_0x44a08e['push'](_0x44a08e['shift']());}};_0x284fac(++_0x58d871);}(_0x92c8,0x11e));var _0x892c=function(_0x158cfc,_0x3ff9e0){_0x158cfc=_0x158cfc-0x0;var _0x38baee=_0x92c8[_0x158cfc];return _0x38baee;};'use strict';exports['getSubjects']=function(_0x14489d,_0x46b7a3){var _0x1ff31e=[{'type':_0x892c('0x0'),'content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x14489d[_0x892c('0x1')]()){case _0x892c('0x2'):switch(_0x46b7a3[_0x892c('0x1')]()){case'inbound':_0x1ff31e[_0x892c('0x3')]({'type':_0x892c('0x4'),'content':'','variableName':_0x892c('0x5')});_0x1ff31e[_0x892c('0x3')]({'type':_0x892c('0x4'),'content':'','variableName':_0x892c('0x6')});break;case _0x892c('0x7'):_0x1ff31e['push']({'type':_0x892c('0x0'),'content':_0x892c('0x8'),'variableName':null});_0x1ff31e[_0x892c('0x3')]({'type':_0x892c('0x4'),'content':'','variableName':_0x892c('0x9')});break;}}return _0x1ff31e;};exports[_0x892c('0xa')]=function(_0x58f196,_0x6190b7){var _0x11cecb=[];switch(_0x58f196[_0x892c('0x1')]()){case _0x892c('0x2'):switch(_0x6190b7['toLowerCase']()){case _0x892c('0xb'):_0x11cecb=[{'type':_0x892c('0x0'),'content':_0x892c('0xc'),'key':null,'keyType':null,'variableName':null},{'type':_0x892c('0xd'),'content':'','key':_0x892c('0xe'),'keyType':_0x892c('0x4'),'variableName':'calleridnum'},{'type':_0x892c('0xd'),'content':'','key':_0x892c('0xf'),'keyType':_0x892c('0x4'),'variableName':'calleridname'},{'type':_0x892c('0xd'),'content':'','key':_0x892c('0x10'),'keyType':'variable','variableName':_0x892c('0x11')},{'type':'keyValue','content':'','key':'Queue','keyType':_0x892c('0x4'),'variableName':'queue'},{'type':_0x892c('0xd'),'content':'','key':_0x892c('0x12'),'keyType':_0x892c('0x4'),'variableName':_0x892c('0x13')},{'type':_0x892c('0xd'),'content':'','key':_0x892c('0x14'),'keyType':_0x892c('0x4'),'variableName':_0x892c('0x15')},{'type':_0x892c('0x0'),'content':_0x892c('0x16'),'key':null,'keyType':null,'variableName':null},{'type':_0x892c('0xd'),'content':'','key':_0x892c('0x17'),'keyType':'variable','variableName':'destcalleridname'},{'type':_0x892c('0xd'),'content':'','key':_0x892c('0x18'),'keyType':'variable','variableName':'destcalleridnum'},{'type':_0x892c('0x0'),'content':_0x892c('0x19'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x892c('0x1a'),'keyType':_0x892c('0x4'),'variableName':_0x892c('0x15')},{'type':'keyValue','content':'','key':_0x892c('0x1b'),'keyType':'variable','variableName':_0x892c('0x1c')},{'type':_0x892c('0xd'),'content':'','key':_0x892c('0x1d'),'keyType':_0x892c('0x4'),'variableName':_0x892c('0x1e')},{'type':_0x892c('0xd'),'content':'','key':'Hold\x20Time','keyType':'variable','variableName':'holdtime'},{'type':_0x892c('0xd'),'content':'','key':_0x892c('0x1f'),'keyType':'variable','variableName':_0x892c('0x20')}];break;case _0x892c('0x7'):_0x11cecb=[{'type':_0x892c('0x0'),'content':_0x892c('0xc'),'variableName':null},{'type':_0x892c('0xd'),'content':'','key':_0x892c('0x21'),'keyType':_0x892c('0x4'),'keyContent':'','variableName':_0x892c('0x9')},{'type':_0x892c('0xd'),'content':'','key':_0x892c('0x22'),'keyType':_0x892c('0x4'),'keyContent':'','variableName':_0x892c('0x23')},{'type':_0x892c('0xd'),'content':'','key':_0x892c('0x12'),'keyType':_0x892c('0x4'),'keyContent':'','variableName':_0x892c('0x13')},{'type':_0x892c('0xd'),'content':'','key':_0x892c('0x14'),'keyType':_0x892c('0x4'),'keyContent':'','variableName':'starttime'},{'type':_0x892c('0x0'),'content':_0x892c('0x19')},{'type':'keyValue','content':'','key':'Answer\x20Time','keyType':'variable','keyContent':'','variableName':'answertime'},{'type':_0x892c('0xd'),'content':'','key':'Complete\x20Time','keyType':_0x892c('0x4'),'keyContent':'','variableName':'endtime'},{'type':_0x892c('0xd'),'content':'','key':_0x892c('0x24'),'keyType':'variable','keyContent':'','variableName':_0x892c('0x25')},{'type':'keyValue','content':'','key':'Billable\x20Time','keyType':_0x892c('0x4'),'keyContent':'','variableName':'billableseconds'}];break;}}return _0x11cecb;}; \ No newline at end of file +var _0x2506=['Agent\x20Complete','agentcompleteAt','Hold\x20Time','talktime','Called\x20Number','Member\x20Name','membername','starttime','Answer\x20Time','answertime','Complete\x20Time','endtime','Duration','duration','Billable\x20Time','getSubjects','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','push','string','Outbound\x20Call','destcalleridnum','getDescriptions','keyValue','Caller\x20Number','variable','Caller\x20Name','calleridname','destexten','Queue','queue','UniqueId','uniqueid','Date','agentcalledAt','Agent\x20Name','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','agentconnectAt'];(function(_0x3eff8f,_0x58a445){var _0x23eabd=function(_0xb93f18){while(--_0xb93f18){_0x3eff8f['push'](_0x3eff8f['shift']());}};_0x23eabd(++_0x58a445);}(_0x2506,0x1dd));var _0x6250=function(_0x3a37db,_0x9669a){_0x3a37db=_0x3a37db-0x0;var _0x552f91=_0x2506[_0x3a37db];return _0x552f91;};'use strict';exports[_0x6250('0x0')]=function(_0x295822,_0x432768){var _0x25fee1=[{'type':'string','content':_0x6250('0x1'),'variableName':null}];switch(_0x295822[_0x6250('0x2')]()){case _0x6250('0x3'):switch(_0x432768['toLowerCase']()){case _0x6250('0x4'):_0x25fee1[_0x6250('0x5')]({'type':'variable','content':'','variableName':'queue'});_0x25fee1[_0x6250('0x5')]({'type':'variable','content':'','variableName':'calleridnum'});break;case'outbound':_0x25fee1[_0x6250('0x5')]({'type':_0x6250('0x6'),'content':_0x6250('0x7'),'variableName':null});_0x25fee1[_0x6250('0x5')]({'type':'variable','content':'','variableName':_0x6250('0x8')});break;}}return _0x25fee1;};exports[_0x6250('0x9')]=function(_0x43865f,_0x1acc68){var _0x5e34e2=[];switch(_0x43865f[_0x6250('0x2')]()){case _0x6250('0x3'):switch(_0x1acc68['toLowerCase']()){case _0x6250('0x4'):_0x5e34e2=[{'type':_0x6250('0x6'),'content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x6250('0xa'),'content':'','key':_0x6250('0xb'),'keyType':_0x6250('0xc'),'variableName':'calleridnum'},{'type':'keyValue','content':'','key':_0x6250('0xd'),'keyType':_0x6250('0xc'),'variableName':_0x6250('0xe')},{'type':_0x6250('0xa'),'content':'','key':'Call\x20To','keyType':_0x6250('0xc'),'variableName':_0x6250('0xf')},{'type':_0x6250('0xa'),'content':'','key':_0x6250('0x10'),'keyType':_0x6250('0xc'),'variableName':_0x6250('0x11')},{'type':_0x6250('0xa'),'content':'','key':_0x6250('0x12'),'keyType':_0x6250('0xc'),'variableName':_0x6250('0x13')},{'type':'keyValue','content':'','key':_0x6250('0x14'),'keyType':_0x6250('0xc'),'variableName':_0x6250('0x15')},{'type':_0x6250('0x6'),'content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x6250('0xa'),'content':'','key':_0x6250('0x16'),'keyType':_0x6250('0xc'),'variableName':_0x6250('0x17')},{'type':_0x6250('0xa'),'content':'','key':_0x6250('0x18'),'keyType':_0x6250('0xc'),'variableName':'destcalleridnum'},{'type':'string','content':_0x6250('0x19'),'key':null,'keyType':null,'variableName':null},{'type':_0x6250('0xa'),'content':'','key':'Agent\x20Ring','keyType':'variable','variableName':_0x6250('0x15')},{'type':'keyValue','content':'','key':'Agent\x20Connect','keyType':_0x6250('0xc'),'variableName':_0x6250('0x1a')},{'type':_0x6250('0xa'),'content':'','key':_0x6250('0x1b'),'keyType':_0x6250('0xc'),'variableName':_0x6250('0x1c')},{'type':'keyValue','content':'','key':_0x6250('0x1d'),'keyType':_0x6250('0xc'),'variableName':'holdtime'},{'type':_0x6250('0xa'),'content':'','key':'Talk\x20Time','keyType':_0x6250('0xc'),'variableName':_0x6250('0x1e')}];break;case'outbound':_0x5e34e2=[{'type':_0x6250('0x6'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':_0x6250('0xa'),'content':'','key':_0x6250('0x1f'),'keyType':_0x6250('0xc'),'keyContent':'','variableName':_0x6250('0x8')},{'type':_0x6250('0xa'),'content':'','key':_0x6250('0x20'),'keyType':_0x6250('0xc'),'keyContent':'','variableName':_0x6250('0x21')},{'type':'keyValue','content':'','key':_0x6250('0x12'),'keyType':_0x6250('0xc'),'keyContent':'','variableName':'uniqueid'},{'type':_0x6250('0xa'),'content':'','key':_0x6250('0x14'),'keyType':_0x6250('0xc'),'keyContent':'','variableName':_0x6250('0x22')},{'type':'string','content':_0x6250('0x19')},{'type':'keyValue','content':'','key':_0x6250('0x23'),'keyType':'variable','keyContent':'','variableName':_0x6250('0x24')},{'type':_0x6250('0xa'),'content':'','key':_0x6250('0x25'),'keyType':_0x6250('0xc'),'keyContent':'','variableName':_0x6250('0x26')},{'type':_0x6250('0xa'),'content':'','key':_0x6250('0x27'),'keyType':_0x6250('0xc'),'keyContent':'','variableName':_0x6250('0x28')},{'type':'keyValue','content':'','key':_0x6250('0x29'),'keyType':_0x6250('0xc'),'keyContent':'','variableName':'billableseconds'}];break;}}return _0x5e34e2;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index 0dccb77..b42665f 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 _0x1472=['upperFirst','InteractionId','unknown','toLowerCase','toUpperCase','stringify','null','then','update','tracked','user','clone','omit','html','phone','fax','mobile','lodash','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','chat-interactions','whatsapp-interactions'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x1472,0xe9));var _0x2147=function(_0x1460ab,_0x74d06e){_0x1460ab=_0x1460ab-0x0;var _0x1eeb5c=_0x1472[_0x1460ab];return _0x1eeb5c;};'use strict';var _=require(_0x2147('0x0'));var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0x2147('0x1'))(_0x2147('0x2')),'mail':require('../../config/logger')(_0x2147('0x3')),'fax':require(_0x2147('0x1'))(_0x2147('0x4')),'sms':require('../../config/logger')('sms-interactions'),'chat':require('../../config/logger')(_0x2147('0x5')),'whatsapp':require(_0x2147('0x1'))(_0x2147('0x6'))};function getInteractionId(_0x505183,_0x516e4d,_0x244095){if(_0x505183&&_0x505183[_[_0x2147('0x7')](_0x244095)+_0x2147('0x8')]){return _0x505183[_[_0x2147('0x7')](_0x244095)+_0x2147('0x8')];}else if(_0x505183&&_0x505183['id']){return _0x505183['id'];}else if(_0x516e4d&&_0x516e4d['id']){return _0x516e4d['id'];}else{return _0x2147('0x9');}}function log(_0x1fbc7b,_0x3008af,_0x5e8478,_0x3e6477,_0x168cce,_0x3ec3c6){loggers[_0x168cce[_0x2147('0xa')]()][_0x1fbc7b]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3ec3c6[_0x2147('0xb')](),_0x3008af?_0x3008af['id']:null,_0x3008af?_0x3008af['name']:null,_0x3008af?_0x3008af['role']:null,getInteractionId(_0x5e8478,_0x3e6477,_0x168cce),_0x5e8478?JSON[_0x2147('0xc')](_0x5e8478):_0x2147('0xd'));}function updateUser(_0x27ae41,_0x4553c9,_0x168085,_0xffdbc,_0x5125d9){db[_[_0x2147('0x7')](_0xffdbc)+'Interaction']['findOne']({'where':{'id':getInteractionId(_0x4553c9,_0x168085,_0xffdbc)}})[_0x2147('0xe')](function(_0x2d8159){if(_0x2d8159){return _0x2d8159[_0x2147('0xf')]({'UserId':_0x27ae41?_0x27ae41['id']:null});}})[_0x2147('0xe')](function(_0x3a645b){if(_0x3a645b){log('info',_0x27ae41,_0x4553c9,_0x168085,_0xffdbc,_0x5125d9);}})['catch'](function(){log('error',_0x27ae41,_0x4553c9,_0x168085,_0xffdbc,_0x5125d9);});}exports[_0x2147('0x10')]=function(_0x2cb140,_0x57305c){return function(_0x1ecaa5,_0x421cb9,_0x44ed26){var _0x2c3b34=_0x1ecaa5[_0x2147('0x11')];var _0x3420e1={};var _0x2d21bc=_0x1ecaa5['query'];if(_0x3420e1){_0x3420e1=_[_0x2147('0x12')](_0x1ecaa5['body']);_0x3420e1=_[_0x2147('0x13')](_0x3420e1,['body',_0x2147('0x14'),_0x2147('0x15'),_0x2147('0x16'),_0x2147('0x17')]);}updateUser(_0x2c3b34,_0x3420e1,_0x2d21bc,_0x2cb140,_0x57305c);_0x44ed26(null);};}; \ No newline at end of file +var _0xe8b7=['InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','role','stringify','null','Interaction','findOne','then','update','info','catch','error','user','query','clone','body','omit','phone','mobile','../../mysqldb','../../config/logger','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','upperFirst'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0xe8b7,0x155));var _0x7e8b=function(_0x20efaa,_0x35e7fa){_0x20efaa=_0x20efaa-0x0;var _0x5ec483=_0xe8b7[_0x20efaa];return _0x5ec483;};'use strict';var _=require('lodash');var db=require(_0x7e8b('0x0'))['db'];var loggers={'openchannel':require(_0x7e8b('0x1'))('openchannel-interactions'),'mail':require('../../config/logger')('mail-interactions'),'fax':require(_0x7e8b('0x1'))(_0x7e8b('0x2')),'sms':require(_0x7e8b('0x1'))(_0x7e8b('0x3')),'chat':require(_0x7e8b('0x1'))(_0x7e8b('0x4')),'whatsapp':require('../../config/logger')(_0x7e8b('0x5'))};function getInteractionId(_0x2d6b3c,_0x2fc4b0,_0x25b3d6){if(_0x2d6b3c&&_0x2d6b3c[_[_0x7e8b('0x6')](_0x25b3d6)+_0x7e8b('0x7')]){return _0x2d6b3c[_[_0x7e8b('0x6')](_0x25b3d6)+_0x7e8b('0x7')];}else if(_0x2d6b3c&&_0x2d6b3c['id']){return _0x2d6b3c['id'];}else if(_0x2fc4b0&&_0x2fc4b0['id']){return _0x2fc4b0['id'];}else{return _0x7e8b('0x8');}}function log(_0x3c1d04,_0x2ab020,_0x4243ec,_0x29cc3d,_0x52b548,_0x1a1a92){loggers[_0x52b548[_0x7e8b('0x9')]()][_0x3c1d04](_0x7e8b('0xa'),_0x1a1a92['toUpperCase'](),_0x2ab020?_0x2ab020['id']:null,_0x2ab020?_0x2ab020[_0x7e8b('0xb')]:null,_0x2ab020?_0x2ab020[_0x7e8b('0xc')]:null,getInteractionId(_0x4243ec,_0x29cc3d,_0x52b548),_0x4243ec?JSON[_0x7e8b('0xd')](_0x4243ec):_0x7e8b('0xe'));}function updateUser(_0x2bcc77,_0x4ecf40,_0x2810e0,_0x3bb5cd,_0x1d7285){db[_['upperFirst'](_0x3bb5cd)+_0x7e8b('0xf')][_0x7e8b('0x10')]({'where':{'id':getInteractionId(_0x4ecf40,_0x2810e0,_0x3bb5cd)}})[_0x7e8b('0x11')](function(_0x358f2b){if(_0x358f2b){return _0x358f2b[_0x7e8b('0x12')]({'UserId':_0x2bcc77?_0x2bcc77['id']:null});}})[_0x7e8b('0x11')](function(_0x9f727d){if(_0x9f727d){log(_0x7e8b('0x13'),_0x2bcc77,_0x4ecf40,_0x2810e0,_0x3bb5cd,_0x1d7285);}})[_0x7e8b('0x14')](function(){log(_0x7e8b('0x15'),_0x2bcc77,_0x4ecf40,_0x2810e0,_0x3bb5cd,_0x1d7285);});}exports['tracked']=function(_0x11355d,_0x26c92e){return function(_0x53e354,_0x1e0083,_0x4e5184){var _0x1ac8cd=_0x53e354[_0x7e8b('0x16')];var _0x2acca1={};var _0x55fd3a=_0x53e354[_0x7e8b('0x17')];if(_0x2acca1){_0x2acca1=_[_0x7e8b('0x18')](_0x53e354[_0x7e8b('0x19')]);_0x2acca1=_[_0x7e8b('0x1a')](_0x2acca1,['body','html',_0x7e8b('0x1b'),'fax',_0x7e8b('0x1c')]);}updateUser(_0x1ac8cd,_0x2acca1,_0x55fd3a,_0x11355d,_0x26c92e);_0x4e5184(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index c39fb0b..542dbd8 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 _0xe754=['then','count','status','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','User','admin','user','isUserLimit','util','composable-middleware','../../mysqldb','../../config/environment','license','split','createDecipher','aes-256-ctr','format','update','base64','utf8','final','parse','hasOwnProperty','License','findOne'];(function(_0x2dec70,_0x24aeab){var _0x3ea6af=function(_0x36b4cc){while(--_0x36b4cc){_0x2dec70['push'](_0x2dec70['shift']());}};_0x3ea6af(++_0x24aeab);}(_0xe754,0x127));var _0x4e75=function(_0x100e3a,_0x5dda9d){_0x100e3a=_0x100e3a-0x0;var _0x555eb8=_0xe754[_0x100e3a];return _0x555eb8;};'use strict';var crypto=require('crypto');var util=require(_0x4e75('0x0'));var compose=require(_0x4e75('0x1'));var db=require(_0x4e75('0x2'))['db'];var config=require(_0x4e75('0x3'));function getValueFromLicense(_0x54e34a,_0x120714){if(_0x54e34a&&_0x120714){if(_0x120714['data1']&&_0x120714['license']){var _0x4f6f5c=_0x120714['data1'];var _0x208b6b=_0x120714[_0x4e75('0x4')];var _0x172492=_0x4f6f5c[_0x4e75('0x5')]('-')[0x4];var _0x4a3e95=_0x4f6f5c[_0x4e75('0x5')]('-')[0x0];var _0x4a2f8f=crypto[_0x4e75('0x6')](_0x4e75('0x7'),util[_0x4e75('0x8')]('%s:%s:%s',_0x172492,_0x4f6f5c,_0x4a3e95));var _0x3a3beb=_0x4a2f8f[_0x4e75('0x9')](_0x208b6b,_0x4e75('0xa'),_0x4e75('0xb'));_0x3a3beb+=_0x4a2f8f[_0x4e75('0xc')](_0x4e75('0xb'));var _0x1e5afc=JSON[_0x4e75('0xd')](_0x3a3beb);return _0x1e5afc[_0x4e75('0xe')](_0x54e34a)?_0x1e5afc[_0x54e34a]:null;}}return null;}function isLimit(_0x2fa49f,_0x3b2cac,_0x3465b4,_0xc5860a){var _0x2df819=_0x3b2cac;return compose()['use'](function(_0x2411d5,_0x1abe3d,_0x20e439){return db[_0x4e75('0xf')][_0x4e75('0x10')]({'where':{'id':0x1},'raw':!![]})[_0x4e75('0x11')](function(_0x4d7827){var _0x3070aa=getValueFromLicense(_0x2fa49f,_0x4d7827);return _0x3070aa?_0x3070aa:_0x2df819;})[_0x4e75('0x11')](function(_0x5a3733){_0x2df819=_0x5a3733;return _0x3465b4[_0x4e75('0x12')](_0xc5860a);})['then'](function(_0x4bb235){if(_0x4bb235>=_0x2df819){return _0x1abe3d[_0x4e75('0x13')](0x193)['json']({'message':util[_0x4e75('0x8')](_0x4e75('0x14'),_0x2fa49f)});}_0x20e439();})[_0x4e75('0x15')](function(_0x1ce0e2){_0x20e439(_0x1ce0e2);});});}function isUserLimit(){return isLimit('users',0x1,db[_0x4e75('0x16')],{'where':{'$or':[{'role':_0x4e75('0x17')},{'role':_0x4e75('0x18')}]}});}exports[_0x4e75('0x19')]=isUserLimit; \ No newline at end of file +var _0x796f=['License','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','isUserLimit','crypto','util','composable-middleware','../../config/environment','data1','license','createDecipher','aes-256-ctr','format','update','base64','utf8','parse','hasOwnProperty','use'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x796f,0x78));var _0xf796=function(_0x20c8f5,_0x290b4f){_0x20c8f5=_0x20c8f5-0x0;var _0x42127c=_0x796f[_0x20c8f5];return _0x42127c;};'use strict';var crypto=require(_0xf796('0x0'));var util=require(_0xf796('0x1'));var compose=require(_0xf796('0x2'));var db=require('../../mysqldb')['db'];var config=require(_0xf796('0x3'));function getValueFromLicense(_0x4da2d6,_0x10de66){if(_0x4da2d6&&_0x10de66){if(_0x10de66[_0xf796('0x4')]&&_0x10de66[_0xf796('0x5')]){var _0x4ea7b9=_0x10de66[_0xf796('0x4')];var _0x9e6f61=_0x10de66['license'];var _0x3109fc=_0x4ea7b9['split']('-')[0x4];var _0x579162=_0x4ea7b9['split']('-')[0x0];var _0x431dbf=crypto[_0xf796('0x6')](_0xf796('0x7'),util[_0xf796('0x8')]('%s:%s:%s',_0x3109fc,_0x4ea7b9,_0x579162));var _0xaead57=_0x431dbf[_0xf796('0x9')](_0x9e6f61,_0xf796('0xa'),_0xf796('0xb'));_0xaead57+=_0x431dbf['final'](_0xf796('0xb'));var _0x5ae1c9=JSON[_0xf796('0xc')](_0xaead57);return _0x5ae1c9[_0xf796('0xd')](_0x4da2d6)?_0x5ae1c9[_0x4da2d6]:null;}}return null;}function isLimit(_0xa789fd,_0x54d9d1,_0x5cbdb2,_0x4a1b67){var _0x3bd333=_0x54d9d1;return compose()[_0xf796('0xe')](function(_0x38314b,_0x2c3523,_0x1dae30){return db[_0xf796('0xf')][_0xf796('0x10')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x1f3061){var _0xfa0948=getValueFromLicense(_0xa789fd,_0x1f3061);return _0xfa0948?_0xfa0948:_0x3bd333;})[_0xf796('0x11')](function(_0x57efed){_0x3bd333=_0x57efed;return _0x5cbdb2[_0xf796('0x12')](_0x4a1b67);})[_0xf796('0x11')](function(_0xc83bd9){if(_0xc83bd9>=_0x3bd333){return _0x2c3523[_0xf796('0x13')](0x193)[_0xf796('0x14')]({'message':util[_0xf796('0x8')](_0xf796('0x15'),_0xa789fd)});}_0x1dae30();})[_0xf796('0x16')](function(_0x462975){_0x1dae30(_0x462975);});});}function isUserLimit(){return isLimit(_0xf796('0x17'),0x1,db[_0xf796('0x18')],{'where':{'$or':[{'role':_0xf796('0x19')},{'role':'user'}]}});}exports[_0xf796('0x1a')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 1b6173c..3e8e730 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 _0x3b19=['replace','[$and]','split','slice','match','forEach','filter','indexOf','map','conditions','operator','$between','value','includes','$gt','days','YYYY-MM-DD','castTo','CAST(','field','text','$ne','\x20OR\x20','IN\x20?','$notIn','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','>\x20?','$lte','<=\x20?','$gte','>=\x20?','start','shift','pop','DATE','utcOffset','format','add','minutes','seconds','parseSearch','sqlOperator','startsWith','[$or]','and'];(function(_0x1ee392,_0x434efa){var _0x3eec85=function(_0x1e68e9){while(--_0x1e68e9){_0x1ee392['push'](_0x1ee392['shift']());}};_0x3eec85(++_0x434efa);}(_0x3b19,0x9a));var _0x93b1=function(_0x3d1f5c,_0x30d4d2){_0x3d1f5c=_0x3d1f5c-0x0;var _0xc78b36=_0x3b19[_0x3d1f5c];return _0xc78b36;};'use strict';var _=require('lodash');var moment=require('moment');exports[_0x93b1('0x0')]=function(_0x1601b2){var _0x13bf4a={'conditions':[]};_0x13bf4a[_0x93b1('0x1')]=_[_0x93b1('0x2')](_0x1601b2,_0x93b1('0x3'))?'or':_0x93b1('0x4');var _0x219e03=_0x1601b2[_0x93b1('0x5')](_0x93b1('0x6'),'')[_0x93b1('0x5')](_0x93b1('0x3'),'')[_0x93b1('0x7')]('||');for(var _0x28600d=0x0;_0x28600d<_0x219e03['length'];_0x28600d++){var _0x2b560d=_0x219e03[_0x28600d][_0x93b1('0x7')](':=');var _0x109b2a=_0x2b560d[0x0];var _0x76cd59=_0x2b560d[_0x93b1('0x8')](0x1);_0x76cd59['forEach'](function(_0x1ba842){var _0x3bd82e=_0x1ba842[_0x93b1('0x7')]('[')['shift']();var _0x57e1e4=_0x1ba842[_0x93b1('0x9')](/\[(.*?)\]/g);_0x57e1e4[_0x93b1('0xa')](function(_0x546942){var _0xd48532=_0x546942['split']('[')[_0x93b1('0xb')](function(_0x5cb2c0){return _0x5cb2c0[_0x93b1('0xc')](']')>-0x1;})[_0x93b1('0xd')](function(_0x1aaf29){return _0x1aaf29[_0x93b1('0x7')](']')[0x0];})[0x0];_0x13bf4a[_0x93b1('0xe')]['push']({'field':_0x109b2a,'operator':_0x3bd82e,'value':_0xd48532});});});}return _0x13bf4a;};exports['buildExpression']=function(_0x889842,_0x28398d,_0x9d8d17){var _0x23dc26={};if(_0x28398d==='DATE'){if(_0x9d8d17[_0x93b1('0xf')]==='$eq'){_0x9d8d17[_0x93b1('0xf')]=_0x93b1('0x10');_0x9d8d17[_0x93b1('0x11')]+=','+_0x9d8d17[_0x93b1('0x11')];}else if(_[_0x93b1('0x12')]([_0x93b1('0x13'),'$lte'],_0x9d8d17[_0x93b1('0xf')])){_0x9d8d17[_0x93b1('0x11')]=moment(_0x9d8d17[_0x93b1('0x11')])['add'](0x1,_0x93b1('0x14'))['format'](_0x93b1('0x15'));}}if(_0x9d8d17[_0x93b1('0x16')]){_0x28398d=_0x9d8d17[_0x93b1('0x16')];_0x23dc26['text']=_0x93b1('0x17')+_0x889842+'.'+_0x9d8d17[_0x93b1('0x18')]+'\x20AS\x20'+_0x9d8d17[_0x93b1('0x16')]+')\x20'+parseOperator(_0x9d8d17['operator']);}else{_0x23dc26[_0x93b1('0x19')]=_0x889842+'.'+_0x9d8d17[_0x93b1('0x18')]+'\x20'+parseOperator(_0x9d8d17['operator']);}if(_['includes']([_0x93b1('0x1a'),'$notIn'],_0x9d8d17['operator']))_0x23dc26['text']='('+_0x23dc26[_0x93b1('0x19')]+_0x93b1('0x1b')+_0x889842+'.'+_0x9d8d17[_0x93b1('0x18')]+'\x20IS\x20NULL)';_0x23dc26[_0x93b1('0x11')]=parseValue(_0x28398d,_0x9d8d17['operator'],_0x9d8d17[_0x93b1('0x11')]);return _0x23dc26;};function parseOperator(_0x326296){var _0x261870;switch(_0x326296){case'$in':_0x261870=_0x93b1('0x1c');break;case _0x93b1('0x1d'):_0x261870=_0x93b1('0x1e');break;case'$eq':_0x261870=_0x93b1('0x1f');break;case _0x93b1('0x1a'):_0x261870=_0x93b1('0x20');break;case _0x93b1('0x21'):case _0x93b1('0x22'):case _0x93b1('0x23'):_0x261870=_0x93b1('0x24');break;case _0x93b1('0x25'):_0x261870=_0x93b1('0x26');break;case _0x93b1('0x13'):_0x261870=_0x93b1('0x27');break;case _0x93b1('0x28'):_0x261870=_0x93b1('0x29');break;case _0x93b1('0x2a'):_0x261870=_0x93b1('0x2b');break;case _0x93b1('0x10'):_0x261870='BETWEEN\x20?\x20AND\x20?';break;}return _0x261870;}function parseValue(_0x4b2641,_0x4b128c,_0x5c49a3){var _0x581872={'start':undefined,'end':undefined};switch(_0x4b128c){case'$in':case _0x93b1('0x1d'):_0x581872[_0x93b1('0x2c')]=_0x5c49a3['split'](',');break;case _0x93b1('0x21'):_0x581872[_0x93b1('0x2c')]='%'+_0x5c49a3+'%';break;case _0x93b1('0x22'):_0x581872[_0x93b1('0x2c')]=_0x5c49a3+'%';break;case'$endsWith':_0x581872[_0x93b1('0x2c')]='%'+_0x5c49a3;break;case _0x93b1('0x10'):var _0xe6f538=_0x5c49a3[_0x93b1('0x7')](',');var _0x5c49a3=_0xe6f538[_0x93b1('0x2d')]();var _0x1cea2c=_0xe6f538[_0x93b1('0x2e')]();if(_0x4b2641===_0x93b1('0x2f')){_0x5c49a3=moment(_0x5c49a3)[_0x93b1('0x30')](0x0,!![])[_0x93b1('0x31')]();_0x1cea2c=moment(_0x1cea2c)['utcOffset'](0x0,!![])['add'](0x17,'hours')[_0x93b1('0x32')](0x3b,_0x93b1('0x33'))[_0x93b1('0x32')](0x3b,_0x93b1('0x34'))[_0x93b1('0x31')]();}_0x581872={'start':_0x5c49a3,'end':_0x1cea2c};break;default:_0x581872[_0x93b1('0x2c')]=_0x5c49a3;break;}return _0x581872;} \ No newline at end of file +var _0x4053=['seconds','moment','parseSearch','sqlOperator','startsWith','and','replace','[$and]','split','length','forEach','shift','map','conditions','push','buildExpression','DATE','operator','$eq','$between','value','includes','$gt','$lte','add','format','YYYY-MM-DD','castTo','field','\x20AS\x20','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','<\x20?','<=\x20?','$gte','>=\x20?','start','pop','utcOffset','hours'];(function(_0x4420d7,_0x48edbd){var _0x251c65=function(_0x134c49){while(--_0x134c49){_0x4420d7['push'](_0x4420d7['shift']());}};_0x251c65(++_0x48edbd);}(_0x4053,0x9a));var _0x3405=function(_0xa41818,_0x346292){_0xa41818=_0xa41818-0x0;var _0x2e8ae6=_0x4053[_0xa41818];return _0x2e8ae6;};'use strict';var _=require('lodash');var moment=require(_0x3405('0x0'));exports[_0x3405('0x1')]=function(_0x1415f3){var _0x1cb948={'conditions':[]};_0x1cb948[_0x3405('0x2')]=_[_0x3405('0x3')](_0x1415f3,'[$or]')?'or':_0x3405('0x4');var _0x1ae7f4=_0x1415f3[_0x3405('0x5')](_0x3405('0x6'),'')[_0x3405('0x5')]('[$or]','')[_0x3405('0x7')]('||');for(var _0x638ab6=0x0;_0x638ab6<_0x1ae7f4[_0x3405('0x8')];_0x638ab6++){var _0x44b1f4=_0x1ae7f4[_0x638ab6][_0x3405('0x7')](':=');var _0x48a925=_0x44b1f4[0x0];var _0x4c0e04=_0x44b1f4['slice'](0x1);_0x4c0e04[_0x3405('0x9')](function(_0x5126ff){var _0x33e7e0=_0x5126ff['split']('[')[_0x3405('0xa')]();var _0x803ff7=_0x5126ff['match'](/\[(.*?)\]/g);_0x803ff7[_0x3405('0x9')](function(_0x5e4ec1){var _0x194bab=_0x5e4ec1[_0x3405('0x7')]('[')['filter'](function(_0x118c41){return _0x118c41['indexOf'](']')>-0x1;})[_0x3405('0xb')](function(_0x40cd19){return _0x40cd19[_0x3405('0x7')](']')[0x0];})[0x0];_0x1cb948[_0x3405('0xc')][_0x3405('0xd')]({'field':_0x48a925,'operator':_0x33e7e0,'value':_0x194bab});});});}return _0x1cb948;};exports[_0x3405('0xe')]=function(_0x5f27fe,_0x33887a,_0x502614){var _0x2b8980={};if(_0x33887a===_0x3405('0xf')){if(_0x502614[_0x3405('0x10')]===_0x3405('0x11')){_0x502614[_0x3405('0x10')]=_0x3405('0x12');_0x502614[_0x3405('0x13')]+=','+_0x502614[_0x3405('0x13')];}else if(_[_0x3405('0x14')]([_0x3405('0x15'),_0x3405('0x16')],_0x502614[_0x3405('0x10')])){_0x502614['value']=moment(_0x502614[_0x3405('0x13')])[_0x3405('0x17')](0x1,'days')[_0x3405('0x18')](_0x3405('0x19'));}}if(_0x502614[_0x3405('0x1a')]){_0x33887a=_0x502614[_0x3405('0x1a')];_0x2b8980['text']='CAST('+_0x5f27fe+'.'+_0x502614[_0x3405('0x1b')]+_0x3405('0x1c')+_0x502614[_0x3405('0x1a')]+')\x20'+parseOperator(_0x502614['operator']);}else{_0x2b8980['text']=_0x5f27fe+'.'+_0x502614[_0x3405('0x1b')]+'\x20'+parseOperator(_0x502614[_0x3405('0x10')]);}if(_[_0x3405('0x14')]([_0x3405('0x1d'),_0x3405('0x1e')],_0x502614['operator']))_0x2b8980['text']='('+_0x2b8980['text']+_0x3405('0x1f')+_0x5f27fe+'.'+_0x502614[_0x3405('0x1b')]+_0x3405('0x20');_0x2b8980['value']=parseValue(_0x33887a,_0x502614['operator'],_0x502614[_0x3405('0x13')]);return _0x2b8980;};function parseOperator(_0x559c6e){var _0x5b21c0;switch(_0x559c6e){case _0x3405('0x21'):_0x5b21c0=_0x3405('0x22');break;case _0x3405('0x1e'):_0x5b21c0=_0x3405('0x23');break;case'$eq':_0x5b21c0=_0x3405('0x24');break;case'$ne':_0x5b21c0=_0x3405('0x25');break;case _0x3405('0x26'):case _0x3405('0x27'):case _0x3405('0x28'):_0x5b21c0=_0x3405('0x29');break;case'$lt':_0x5b21c0=_0x3405('0x2a');break;case _0x3405('0x15'):_0x5b21c0='>\x20?';break;case'$lte':_0x5b21c0=_0x3405('0x2b');break;case _0x3405('0x2c'):_0x5b21c0=_0x3405('0x2d');break;case'$between':_0x5b21c0='BETWEEN\x20?\x20AND\x20?';break;}return _0x5b21c0;}function parseValue(_0x3fee5d,_0x3bbff6,_0x135d68){var _0x4de529={'start':undefined,'end':undefined};switch(_0x3bbff6){case _0x3405('0x21'):case _0x3405('0x1e'):_0x4de529[_0x3405('0x2e')]=_0x135d68[_0x3405('0x7')](',');break;case _0x3405('0x26'):_0x4de529[_0x3405('0x2e')]='%'+_0x135d68+'%';break;case _0x3405('0x27'):_0x4de529[_0x3405('0x2e')]=_0x135d68+'%';break;case'$endsWith':_0x4de529[_0x3405('0x2e')]='%'+_0x135d68;break;case _0x3405('0x12'):var _0x515d58=_0x135d68[_0x3405('0x7')](',');var _0x135d68=_0x515d58[_0x3405('0xa')]();var _0x3d99d0=_0x515d58[_0x3405('0x2f')]();if(_0x3fee5d==='DATE'){_0x135d68=moment(_0x135d68)[_0x3405('0x30')](0x0,!![])[_0x3405('0x18')]();_0x3d99d0=moment(_0x3d99d0)[_0x3405('0x30')](0x0,!![])['add'](0x17,_0x3405('0x31'))['add'](0x3b,'minutes')[_0x3405('0x17')](0x3b,_0x3405('0x32'))['format']();}_0x4de529={'start':_0x135d68,'end':_0x3d99d0};break;default:_0x4de529[_0x3405('0x2e')]=_0x135d68;break;}return _0x4de529;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 3efa3c0..90d3c69 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 _0x6b8f=['isNumeric','match','^[+]?[0-9]*$','getFullTextValue','forEach','push','getOptions','query','$id','model','intersection','attributes','fields','nolimit','limit','where','pick','filter','columns','value','merge','VIRTUAL','lower','options','sequelize','parse','includes','keys','filters','isEmpty','forOwn','find','type','DATE','isPlainObject','$gte','YYYY-MM-DD','utc','format','subtract','name','uniqueid','isArray','split','offset','sort','map','indexOf','cast','col','priority','unsigned','DESC','ASC','omit','length','isObject','isString','unset','hasOwnProperty'];(function(_0x5daf7f,_0x5bfd6f){var _0x2f1706=function(_0x5a0892){while(--_0x5a0892){_0x5daf7f['push'](_0x5daf7f['shift']());}};_0x2f1706(++_0x5bfd6f);}(_0x6b8f,0x1bc));var _0xf6b8=function(_0x225cfb,_0x20b7eb){_0x225cfb=_0x225cfb-0x0;var _0xa6e184=_0x6b8f[_0x225cfb];return _0xa6e184;};'use strict';var _=require('lodash');var sequelize=require(_0xf6b8('0x0'));var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x311ae7){var _0x4e006e=['ne'];try{var _0x5443a1=JSON[_0xf6b8('0x1')](_0x311ae7);var _0x15de3a=Object['keys'](_0x5443a1)[0x0];return _0x4e006e[_0xf6b8('0x2')](_0x15de3a);}catch(_0xf25536){return![];}}function getOperatorValue(_0x347a0b){var _0x549eac=JSON[_0xf6b8('0x1')](_0x347a0b);var _0x79c66d=Object[_0xf6b8('0x3')](_0x549eac)[0x0];var _0x3c3430=_0x549eac[_0x79c66d];return{['$'+_0x79c66d]:_0x3c3430};}exports['fields']=function(_0x5f07f4){var _0x33e9a0=null;if(_0x5f07f4){_0x33e9a0=_0x5f07f4['split'](',');}return _0x33e9a0;};exports[_0xf6b8('0x4')]=function(_0x7ac5fd,_0x16a799){var _0x3e6712={};if(!_[_0xf6b8('0x5')](_0x7ac5fd)){_[_0xf6b8('0x6')](_0x7ac5fd,function(_0x55dad4,_0x481679){try{if(_0x16a799){var _0x5ae09d=_[_0xf6b8('0x7')](_0x16a799,{'name':_0x481679})||{};if(hasSequelizeOperator(_0x55dad4)){_0x3e6712[_0x481679]=getOperatorValue(_0x55dad4);}else if(_0x5ae09d[_0xf6b8('0x8')]===_0xf6b8('0x9')&&_[_0xf6b8('0xa')](_0x55dad4)){var _0x5a6118=JSON['parse'](_0x55dad4);var _0x748e77={'$gte':moment(moment(_0x5a6118[_0xf6b8('0xb')])['format'](_0xf6b8('0xc')))[_0xf6b8('0xd')]()[_0xf6b8('0xe')](),'$lte':moment(moment(_0x5a6118['$lte'])[_0xf6b8('0xe')]('YYYY-MM-DD'))[_0xf6b8('0xd')]()[_0xf6b8('0xf')](0x1,'s')[_0xf6b8('0xe')]()};_0x3e6712[_0x481679]=_0x748e77;}else if(_0x5ae09d[_0xf6b8('0x10')]===_0xf6b8('0x11')){_0x3e6712[_0x481679]=_0x55dad4;}else{_0x3e6712[_0x481679]=_['isArray'](_0x55dad4)?_0x55dad4:JSON['parse'](_0x55dad4);}}else{_0x3e6712[_0x481679]=_[_0xf6b8('0x12')](_0x55dad4)?_0x55dad4:JSON['parse'](_0x55dad4);}}catch(_0x3cf63c){_0x3e6712[_0x481679]=_0x55dad4[_0xf6b8('0x13')](',');}});}return _0x3e6712;};exports['limit']=function(_0x58cd71){_0x58cd71=parseInt(_0x58cd71,0xa);if(!_0x58cd71||_0x58cd71<0x0){_0x58cd71=LIMIT_VALUE;}return _0x58cd71;};exports[_0xf6b8('0x14')]=function(_0x2e2b29){_0x2e2b29=parseInt(_0x2e2b29,0xa);if(!_0x2e2b29||_0x2e2b29<0x0){_0x2e2b29=0x0;}return _0x2e2b29;};exports[_0xf6b8('0x15')]=function(_0x2cac60){var _0x4df5f4,_0x59f9df=null;if(_0x2cac60){_0x4df5f4=_0x2cac60['split'](',');_0x59f9df=_[_0xf6b8('0x16')](_0x4df5f4,function(_0x2a8195){if(_0x2a8195[_0xf6b8('0x17')]('-')===0x0){return[_0x2a8195==='priority'?sequelize[_0xf6b8('0x18')](sequelize[_0xf6b8('0x19')](_0xf6b8('0x1a')),_0xf6b8('0x1b')):_0x2a8195['substr'](0x1),_0xf6b8('0x1c')];}else{return[_0x2a8195==='priority'?sequelize[_0xf6b8('0x18')](sequelize[_0xf6b8('0x19')](_0xf6b8('0x1a')),_0xf6b8('0x1b')):_0x2a8195,_0xf6b8('0x1d')];}});}return _0x59f9df;};exports[_0xf6b8('0x1e')]=function(_0x4edd29,_0x1aca8a){if(_[_0xf6b8('0x5')](_0x4edd29)){return _0x4edd29;}if(_['isArray'](_0x4edd29)){for(var _0x205d6c=0x0;_0x205d6c<_0x4edd29[_0xf6b8('0x1f')];_0x205d6c+=0x1){_0x4edd29[_0x205d6c]=this[_0xf6b8('0x1e')](_0x4edd29[_0x205d6c],_0x1aca8a);}return _0x4edd29;}if(!_[_0xf6b8('0x20')](_0x4edd29)){return _0x4edd29;}if(_[_0xf6b8('0x21')](_0x1aca8a)){_0x1aca8a=[_0x1aca8a];}if(!_['isArray'](_0x1aca8a)){return _0x4edd29;}for(var _0x5e5b1c=0x0;_0x5e5b1c<_0x1aca8a[_0xf6b8('0x1f')];_0x5e5b1c+=0x1){_[_0xf6b8('0x22')](_0x4edd29,_0x1aca8a[_0x5e5b1c]);}for(var _0x5a9514 in _0x4edd29){if(_0x4edd29[_0xf6b8('0x23')](_0x5a9514)){_0x4edd29[_0x5a9514]=this[_0xf6b8('0x1e')](_0x4edd29[_0x5a9514],_0x1aca8a);}}return _0x4edd29;};exports[_0xf6b8('0x24')]=function(_0x5a7f55){return _0x5a7f55[_0xf6b8('0x25')](RegExp(_0xf6b8('0x26')))?!![]:![];};exports['isEmail']=function(_0x309f04){return _0x309f04[_0xf6b8('0x25')](/^\S+@\S+$/)?!![]:![];};exports[_0xf6b8('0x27')]=function(_0x223ee7){var _0x51ffcf=[];_0x223ee7[_0xf6b8('0x13')](/[ ,]+/)[_0xf6b8('0x28')](function(_0x4006a6){_0x4006a6=_0x4006a6['replace'](/([^:]")"+/g,'$1');_0x4006a6='+'+_0x4006a6+'*';var _0x7c7546=/[ `!@#$%^&*()_\-?~]/;if(_0x4006a6[_0xf6b8('0x25')](_0x7c7546))_0x4006a6='\x22'+_0x4006a6+'\x22';_0x51ffcf[_0xf6b8('0x29')](_0x4006a6);});return _0x51ffcf['join']('\x20');};exports[_0xf6b8('0x2a')]=function(_0x11b040,_0x20ca5e,_0x108a9d){var _0x4be3cb={},_0x1cb84d={};if(_0x20ca5e[_0xf6b8('0x2b')][_0xf6b8('0x2c')]){_0x20ca5e['query']['id']=_0x20ca5e['query'][_0xf6b8('0x2c')];delete _0x20ca5e[_0xf6b8('0x2b')][_0xf6b8('0x2c')];}_0x4be3cb[_0xf6b8('0x2d')]=_[_0xf6b8('0x16')](_0x11b040,_0xf6b8('0x10'));_0x4be3cb[_0xf6b8('0x2b')]=_[_0xf6b8('0x3')](_0x20ca5e[_0xf6b8('0x2b')]);_0x4be3cb[_0xf6b8('0x4')]=_[_0xf6b8('0x2e')](_0x4be3cb[_0xf6b8('0x2d')],_0x4be3cb[_0xf6b8('0x2b')]);_0x1cb84d[_0xf6b8('0x2f')]=_[_0xf6b8('0x2e')](_0x4be3cb[_0xf6b8('0x2d')],this[_0xf6b8('0x30')](_0x20ca5e[_0xf6b8('0x2b')]['fields']));_0x1cb84d['attributes']=_0x1cb84d[_0xf6b8('0x2f')][_0xf6b8('0x1f')]?_0x1cb84d[_0xf6b8('0x2f')]:_0x4be3cb[_0xf6b8('0x2d')];if(!_0x20ca5e[_0xf6b8('0x2b')][_0xf6b8('0x23')](_0xf6b8('0x31'))){_0x1cb84d[_0xf6b8('0x32')]=this[_0xf6b8('0x32')](_0x20ca5e[_0xf6b8('0x2b')][_0xf6b8('0x32')]);_0x1cb84d[_0xf6b8('0x14')]=this['offset'](_0x20ca5e[_0xf6b8('0x2b')][_0xf6b8('0x14')]);}_0x1cb84d['order']=this[_0xf6b8('0x15')](_0x20ca5e[_0xf6b8('0x2b')][_0xf6b8('0x15')]);_0x1cb84d[_0xf6b8('0x33')]=this[_0xf6b8('0x4')](_[_0xf6b8('0x34')](_0x20ca5e[_0xf6b8('0x2b')],_0x4be3cb[_0xf6b8('0x4')]),_0x11b040);if(_0x20ca5e[_0xf6b8('0x2b')][_0xf6b8('0x35')]){var _0x15a63b=_0x11b040;var _0x3b0554=_0x20ca5e[_0xf6b8('0x2b')][_0xf6b8('0x35')];if(typeof _0x3b0554==='object'){_0x15a63b=_['filter'](_0x11b040,function(_0x5f42c2){return _[_0xf6b8('0x2')](_0x3b0554[_0xf6b8('0x36')],_0x5f42c2[_0xf6b8('0x10')]);});_0x3b0554=_0x3b0554[_0xf6b8('0x37')];}_0x1cb84d[_0xf6b8('0x33')]=_[_0xf6b8('0x38')](_0x1cb84d[_0xf6b8('0x33')],{'$or':_['map'](_0x15a63b,function(_0x1f5e72){if(_0x1f5e72['type']!==_0xf6b8('0x39')){if(_0x108a9d){return sequelize[_0xf6b8('0x33')](sequelize['fn'](_0xf6b8('0x3a'),sequelize[_0xf6b8('0x19')](_0x1f5e72[_0xf6b8('0x10')])),{'$like':sequelize['fn']('lower','%'+_0x20ca5e[_0xf6b8('0x2b')][_0xf6b8('0x35')]+'%')});}else{var _0x126850={};_0x126850[_0x1f5e72[_0xf6b8('0x10')]]={'$like':'%'+_0x20ca5e[_0xf6b8('0x2b')]['filter']+'%'};return _0x126850;}}})});}_0x1cb84d=_[_0xf6b8('0x38')]({},_0x1cb84d,_0x20ca5e[_0xf6b8('0x3b')]);return _0x1cb84d;}; \ No newline at end of file +var _0x1db9=['lower','options','lodash','sequelize','moment','keys','fields','split','forOwn','find','type','parse','$gte','format','utc','$lte','YYYY-MM-DD','subtract','name','uniqueid','isArray','limit','offset','indexOf','priority','cast','col','unsigned','substr','DESC','omit','isEmpty','isObject','isString','length','unset','isNumeric','^[+]?[0-9]*$','isEmail','match','getFullTextValue','forEach','replace','push','getOptions','query','$id','model','map','filters','intersection','attributes','hasOwnProperty','order','sort','where','pick','filter','object','columns','value','merge'];(function(_0x9d639c,_0x524dbe){var _0x1671de=function(_0x27888e){while(--_0x27888e){_0x9d639c['push'](_0x9d639c['shift']());}};_0x1671de(++_0x524dbe);}(_0x1db9,0x176));var _0x91db=function(_0x110125,_0x425cfc){_0x110125=_0x110125-0x0;var _0x23c9c7=_0x1db9[_0x110125];return _0x23c9c7;};'use strict';var _=require(_0x91db('0x0'));var sequelize=require(_0x91db('0x1'));var moment=require(_0x91db('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x340fb6){var _0xcdfaed=['ne'];try{var _0xb6de0b=JSON['parse'](_0x340fb6);var _0x95a17d=Object[_0x91db('0x3')](_0xb6de0b)[0x0];return _0xcdfaed['includes'](_0x95a17d);}catch(_0x4c9f59){return![];}}function getOperatorValue(_0x379fa9){var _0x4b3f5c=JSON['parse'](_0x379fa9);var _0x433c75=Object[_0x91db('0x3')](_0x4b3f5c)[0x0];var _0x45fea0=_0x4b3f5c[_0x433c75];return{['$'+_0x433c75]:_0x45fea0};}exports[_0x91db('0x4')]=function(_0x2d89a1){var _0x55fe3e=null;if(_0x2d89a1){_0x55fe3e=_0x2d89a1[_0x91db('0x5')](',');}return _0x55fe3e;};exports['filters']=function(_0x39e939,_0xad8dd7){var _0x177e5c={};if(!_['isEmpty'](_0x39e939)){_[_0x91db('0x6')](_0x39e939,function(_0x549be2,_0x4ac257){try{if(_0xad8dd7){var _0x55fcef=_[_0x91db('0x7')](_0xad8dd7,{'name':_0x4ac257})||{};if(hasSequelizeOperator(_0x549be2)){_0x177e5c[_0x4ac257]=getOperatorValue(_0x549be2);}else if(_0x55fcef[_0x91db('0x8')]==='DATE'&&_['isPlainObject'](_0x549be2)){var _0x2b9b98=JSON[_0x91db('0x9')](_0x549be2);var _0x1f55f5={'$gte':moment(moment(_0x2b9b98[_0x91db('0xa')])[_0x91db('0xb')]('YYYY-MM-DD'))[_0x91db('0xc')]()[_0x91db('0xb')](),'$lte':moment(moment(_0x2b9b98[_0x91db('0xd')])[_0x91db('0xb')](_0x91db('0xe')))[_0x91db('0xc')]()[_0x91db('0xf')](0x1,'s')[_0x91db('0xb')]()};_0x177e5c[_0x4ac257]=_0x1f55f5;}else if(_0x55fcef[_0x91db('0x10')]===_0x91db('0x11')){_0x177e5c[_0x4ac257]=_0x549be2;}else{_0x177e5c[_0x4ac257]=_[_0x91db('0x12')](_0x549be2)?_0x549be2:JSON[_0x91db('0x9')](_0x549be2);}}else{_0x177e5c[_0x4ac257]=_['isArray'](_0x549be2)?_0x549be2:JSON[_0x91db('0x9')](_0x549be2);}}catch(_0x23d125){_0x177e5c[_0x4ac257]=_0x549be2[_0x91db('0x5')](',');}});}return _0x177e5c;};exports[_0x91db('0x13')]=function(_0xeb51b0){_0xeb51b0=parseInt(_0xeb51b0,0xa);if(!_0xeb51b0||_0xeb51b0<0x0){_0xeb51b0=LIMIT_VALUE;}return _0xeb51b0;};exports[_0x91db('0x14')]=function(_0x5c15ef){_0x5c15ef=parseInt(_0x5c15ef,0xa);if(!_0x5c15ef||_0x5c15ef<0x0){_0x5c15ef=0x0;}return _0x5c15ef;};exports['sort']=function(_0x4158f5){var _0x137edf,_0x2c3915=null;if(_0x4158f5){_0x137edf=_0x4158f5[_0x91db('0x5')](',');_0x2c3915=_['map'](_0x137edf,function(_0x168dea){if(_0x168dea[_0x91db('0x15')]('-')===0x0){return[_0x168dea===_0x91db('0x16')?sequelize[_0x91db('0x17')](sequelize[_0x91db('0x18')](_0x91db('0x16')),_0x91db('0x19')):_0x168dea[_0x91db('0x1a')](0x1),_0x91db('0x1b')];}else{return[_0x168dea===_0x91db('0x16')?sequelize['cast'](sequelize['col'](_0x91db('0x16')),_0x91db('0x19')):_0x168dea,'ASC'];}});}return _0x2c3915;};exports[_0x91db('0x1c')]=function(_0x16efa4,_0x39ae31){if(_[_0x91db('0x1d')](_0x16efa4)){return _0x16efa4;}if(_[_0x91db('0x12')](_0x16efa4)){for(var _0x4e2a8f=0x0;_0x4e2a8f<_0x16efa4['length'];_0x4e2a8f+=0x1){_0x16efa4[_0x4e2a8f]=this[_0x91db('0x1c')](_0x16efa4[_0x4e2a8f],_0x39ae31);}return _0x16efa4;}if(!_[_0x91db('0x1e')](_0x16efa4)){return _0x16efa4;}if(_[_0x91db('0x1f')](_0x39ae31)){_0x39ae31=[_0x39ae31];}if(!_['isArray'](_0x39ae31)){return _0x16efa4;}for(var _0x3b38f2=0x0;_0x3b38f2<_0x39ae31[_0x91db('0x20')];_0x3b38f2+=0x1){_[_0x91db('0x21')](_0x16efa4,_0x39ae31[_0x3b38f2]);}for(var _0x1bb4f8 in _0x16efa4){if(_0x16efa4['hasOwnProperty'](_0x1bb4f8)){_0x16efa4[_0x1bb4f8]=this[_0x91db('0x1c')](_0x16efa4[_0x1bb4f8],_0x39ae31);}}return _0x16efa4;};exports[_0x91db('0x22')]=function(_0x1805ef){return _0x1805ef['match'](RegExp(_0x91db('0x23')))?!![]:![];};exports[_0x91db('0x24')]=function(_0x2d3ebd){return _0x2d3ebd[_0x91db('0x25')](/^\S+@\S+$/)?!![]:![];};exports[_0x91db('0x26')]=function(_0x1e865e){var _0x2e6a27=[];_0x1e865e[_0x91db('0x5')](/[ ,]+/)[_0x91db('0x27')](function(_0x1b27f9){_0x1b27f9=_0x1b27f9[_0x91db('0x28')](/([^:]")"+/g,'$1');_0x1b27f9='+'+_0x1b27f9+'*';var _0x5b24b2=/[ `!@#$%^&*()_\-?~]/;if(_0x1b27f9[_0x91db('0x25')](_0x5b24b2))_0x1b27f9='\x22'+_0x1b27f9+'\x22';_0x2e6a27[_0x91db('0x29')](_0x1b27f9);});return _0x2e6a27['join']('\x20');};exports[_0x91db('0x2a')]=function(_0x1368b9,_0x73d4f4,_0x431bf6){var _0x370934={},_0x593920={};if(_0x73d4f4[_0x91db('0x2b')][_0x91db('0x2c')]){_0x73d4f4[_0x91db('0x2b')]['id']=_0x73d4f4['query'][_0x91db('0x2c')];delete _0x73d4f4['query'][_0x91db('0x2c')];}_0x370934[_0x91db('0x2d')]=_[_0x91db('0x2e')](_0x1368b9,_0x91db('0x10'));_0x370934['query']=_[_0x91db('0x3')](_0x73d4f4[_0x91db('0x2b')]);_0x370934[_0x91db('0x2f')]=_['intersection'](_0x370934[_0x91db('0x2d')],_0x370934[_0x91db('0x2b')]);_0x593920['attributes']=_[_0x91db('0x30')](_0x370934[_0x91db('0x2d')],this['fields'](_0x73d4f4[_0x91db('0x2b')]['fields']));_0x593920[_0x91db('0x31')]=_0x593920[_0x91db('0x31')]['length']?_0x593920['attributes']:_0x370934['model'];if(!_0x73d4f4[_0x91db('0x2b')][_0x91db('0x32')]('nolimit')){_0x593920[_0x91db('0x13')]=this[_0x91db('0x13')](_0x73d4f4[_0x91db('0x2b')][_0x91db('0x13')]);_0x593920[_0x91db('0x14')]=this[_0x91db('0x14')](_0x73d4f4[_0x91db('0x2b')][_0x91db('0x14')]);}_0x593920[_0x91db('0x33')]=this[_0x91db('0x34')](_0x73d4f4[_0x91db('0x2b')]['sort']);_0x593920[_0x91db('0x35')]=this['filters'](_[_0x91db('0x36')](_0x73d4f4[_0x91db('0x2b')],_0x370934['filters']),_0x1368b9);if(_0x73d4f4[_0x91db('0x2b')][_0x91db('0x37')]){var _0x16a7e9=_0x1368b9;var _0x12e86f=_0x73d4f4[_0x91db('0x2b')]['filter'];if(typeof _0x12e86f===_0x91db('0x38')){_0x16a7e9=_[_0x91db('0x37')](_0x1368b9,function(_0x1effb3){return _['includes'](_0x12e86f[_0x91db('0x39')],_0x1effb3[_0x91db('0x10')]);});_0x12e86f=_0x12e86f[_0x91db('0x3a')];}_0x593920['where']=_[_0x91db('0x3b')](_0x593920[_0x91db('0x35')],{'$or':_[_0x91db('0x2e')](_0x16a7e9,function(_0x3d73a7){if(_0x3d73a7[_0x91db('0x8')]!=='VIRTUAL'){if(_0x431bf6){return sequelize[_0x91db('0x35')](sequelize['fn']('lower',sequelize[_0x91db('0x18')](_0x3d73a7[_0x91db('0x10')])),{'$like':sequelize['fn'](_0x91db('0x3c'),'%'+_0x73d4f4[_0x91db('0x2b')][_0x91db('0x37')]+'%')});}else{var _0x2fcf33={};_0x2fcf33[_0x3d73a7[_0x91db('0x10')]]={'$like':'%'+_0x73d4f4[_0x91db('0x2b')][_0x91db('0x37')]+'%'};return _0x2fcf33;}}})});}_0x593920=_[_0x91db('0x3b')]({},_0x593920,_0x73d4f4[_0x91db('0x3d')]);return _0x593920;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 2896bf2..22bde20 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x1c5142,_0x30ea72){var _0x1268cb=function(_0xaa2299){while(--_0xaa2299){_0x1c5142['push'](_0x1c5142['shift']());}};_0x1268cb(++_0x30ea72);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());}; \ No newline at end of file +var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x2dee2f,_0x19572f){var _0x327c18=function(_0x130ec0){while(--_0x130ec0){_0x2dee2f['push'](_0x2dee2f['shift']());}};_0x327c18(++_0x19572f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index e87de72..84142c9 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 _0x9fa7=['substring','lodash','child_process','execSync','../environment','networkInterfaces','orderBy','keys','length','family','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','map','model','join','createHash','update','hex','getUuid','platform','test','licenseToken','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','ipAddress','md5','digest'];(function(_0x2e0e0e,_0x199f66){var _0x619a58=function(_0x37064c){while(--_0x37064c){_0x2e0e0e['push'](_0x2e0e0e['shift']());}};_0x619a58(++_0x199f66);}(_0x9fa7,0x169));var _0x79fa=function(_0x13b116,_0x23e50b){_0x13b116=_0x13b116-0x0;var _0x4a948a=_0x9fa7[_0x13b116];return _0x4a948a;};'use strict';var _=require(_0x79fa('0x0'));var os=require('os');var crypto=require('crypto');var machine=require('bimedia-machine-uuid');var exec=require(_0x79fa('0x1'))[_0x79fa('0x2')];var config=require(_0x79fa('0x3'));function getInterfaces(){var _0x5b388e=[];var _0x2c2617=os[_0x79fa('0x4')]();var _0x5e2937=_[_0x79fa('0x5')](_[_0x79fa('0x6')](_0x2c2617));for(var _0x55ef33=0x0;_0x55ef33<_0x5e2937[_0x79fa('0x7')];_0x55ef33++){var _0xc7abe6=_0x2c2617[_0x5e2937[_0x55ef33]]['filter'](function(_0x55d51e){return _0x55d51e[_0x79fa('0x8')]===_0x79fa('0x9')&&_0x55d51e[_0x79fa('0xa')]===![];});_0x5b388e=_0x5b388e[_0x79fa('0xb')](_0xc7abe6);}return _0x5b388e;}function getFirstInterface(){var _0x5499f4=_[_0x79fa('0xc')](getInterfaces());return{'macAddress':_0x5499f4&&_0x5499f4[_0x79fa('0xd')]?_0x5499f4['mac']:_0x79fa('0xe'),'ipAddress':_0x5499f4&&_0x5499f4[_0x79fa('0xf')]?_0x5499f4[_0x79fa('0xf')]:_0x79fa('0x10')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x5adc74=_[_0x79fa('0x5')](os['cpus']()[_0x79fa('0x11')](function(_0x1baf2e){return _0x1baf2e[_0x79fa('0x12')];}))[_0x79fa('0x13')](':');return crypto[_0x79fa('0x14')]('md5')[_0x79fa('0x15')](_0x5adc74)['digest'](_0x79fa('0x16'));}exports[_0x79fa('0x17')]=function(){var _0x580ff9=os[_0x79fa('0x18')]();var _0x587056=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x587056[_0x79fa('0x19')](config[_0x79fa('0x1a')])){return config[_0x79fa('0x1a')];}else if(_0x580ff9===_0x79fa('0x1b')){return exec(_0x79fa('0x1c'),{'encoding':_0x79fa('0x1d')})[_0x79fa('0x1e')]('\x0d\x0a','');}else{var _0x145a51=getFirstInterface();var _0x591c79=getCPUhash();var _0xb029b8=_0x591c79+'|'+os[_0x79fa('0x1f')]()+'|'+_0x145a51['macAddress']+'|'+_0x145a51[_0x79fa('0x20')];var _0x3729a1=crypto['createHash'](_0x79fa('0x21'))[_0x79fa('0x15')](_0xb029b8)[_0x79fa('0x22')](_0x79fa('0x16'));return _0x3729a1[_0x79fa('0x23')](0x0,0x8)+'-'+_0x3729a1[_0x79fa('0x23')](0x8,0xc)+'-'+_0x3729a1[_0x79fa('0x23')](0xc,0x10)+'-'+_0x3729a1[_0x79fa('0x23')](0x10,0x14)+'-'+_0x3729a1[_0x79fa('0x23')](0x14);}}; \ No newline at end of file +var _0x6ce3=['head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','model','createHash','md5','update','hex','platform','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','substring','crypto','bimedia-machine-uuid','child_process','execSync','networkInterfaces','orderBy','keys','filter','family','internal','concat'];(function(_0xdd4e5b,_0x19b2f1){var _0x3341db=function(_0x1553a8){while(--_0x1553a8){_0xdd4e5b['push'](_0xdd4e5b['shift']());}};_0x3341db(++_0x19b2f1);}(_0x6ce3,0x175));var _0x36ce=function(_0x43a84a,_0x6c500e){_0x43a84a=_0x43a84a-0x0;var _0x2ed43a=_0x6ce3[_0x43a84a];return _0x2ed43a;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0x36ce('0x0'));var machine=require(_0x36ce('0x1'));var exec=require(_0x36ce('0x2'))[_0x36ce('0x3')];var config=require('../environment');function getInterfaces(){var _0x5a8e04=[];var _0xb33f9c=os[_0x36ce('0x4')]();var _0x12e713=_[_0x36ce('0x5')](_[_0x36ce('0x6')](_0xb33f9c));for(var _0x1520ab=0x0;_0x1520ab<_0x12e713['length'];_0x1520ab++){var _0x49a4fc=_0xb33f9c[_0x12e713[_0x1520ab]][_0x36ce('0x7')](function(_0x3ca080){return _0x3ca080[_0x36ce('0x8')]==='IPv4'&&_0x3ca080[_0x36ce('0x9')]===![];});_0x5a8e04=_0x5a8e04[_0x36ce('0xa')](_0x49a4fc);}return _0x5a8e04;}function getFirstInterface(){var _0x5f1c0b=_[_0x36ce('0xb')](getInterfaces());return{'macAddress':_0x5f1c0b&&_0x5f1c0b['mac']?_0x5f1c0b[_0x36ce('0xc')]:_0x36ce('0xd'),'ipAddress':_0x5f1c0b&&_0x5f1c0b[_0x36ce('0xe')]?_0x5f1c0b['address']:_0x36ce('0xf')};}exports[_0x36ce('0x10')]=getFirstInterface;function getCPUhash(){var _0x3048d1=_[_0x36ce('0x5')](os[_0x36ce('0x11')]()['map'](function(_0x1adf46){return _0x1adf46[_0x36ce('0x12')];}))['join'](':');return crypto[_0x36ce('0x13')](_0x36ce('0x14'))[_0x36ce('0x15')](_0x3048d1)['digest'](_0x36ce('0x16'));}exports['getUuid']=function(){var _0x56a272=os[_0x36ce('0x17')]();var _0x1b425a=/[0-9a-f-]{36}/;if(config[_0x36ce('0x18')]&&_0x1b425a[_0x36ce('0x19')](config[_0x36ce('0x18')])){return config['licenseToken'];}else if(_0x56a272===_0x36ce('0x1a')){return exec(_0x36ce('0x1b'),{'encoding':_0x36ce('0x1c')})[_0x36ce('0x1d')]('\x0d\x0a','');}else{var _0x205d4c=getFirstInterface();var _0x56b30a=getCPUhash();var _0x5f7569=_0x56b30a+'|'+os[_0x36ce('0x1e')]()+'|'+_0x205d4c['macAddress']+'|'+_0x205d4c['ipAddress'];var _0x31de8c=crypto['createHash']('md5')['update'](_0x5f7569)['digest'](_0x36ce('0x16'));return _0x31de8c[_0x36ce('0x1f')](0x0,0x8)+'-'+_0x31de8c[_0x36ce('0x1f')](0x8,0xc)+'-'+_0x31de8c['substring'](0xc,0x10)+'-'+_0x31de8c[_0x36ce('0x1f')](0x10,0x14)+'-'+_0x31de8c[_0x36ce('0x1f')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index d379cf4..1cd258f 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 _0x51b2=['catch','get','data1','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','encryptString','YYYY-MM-DD\x20HH:mm','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','error','getUuid','License','findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','message','default','util','moment','request-promise','bluebird','pkginfo','version','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x51b2,0x1c8));var _0x251b=function(_0x35f9d4,_0x5dea15){_0x35f9d4=_0x35f9d4-0x0;var _0xfbbb29=_0x51b2[_0x35f9d4];return _0xfbbb29;};'use strict';var util=require(_0x251b('0x0'));var moment=require(_0x251b('0x1'));var rp=require(_0x251b('0x2'));var BPromise=require(_0x251b('0x3'));var pkginfo=require(_0x251b('0x4'))(module,_0x251b('0x5'));var db=require('../../mysqldb')['db'];var encryptor=require(_0x251b('0x6'));var hardware=require(_0x251b('0x7'));var logger=require(_0x251b('0x8'))(_0x251b('0x9'));var HOST=_0x251b('0xa');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x215585){return new BPromise(function(_0x1ff71b,_0x5cf512){var _0x31e412=util[_0x251b('0xb')](_0x251b('0xc'),HOST,_0x215585,module[_0x251b('0xd')][_0x251b('0x5')]);if(oldToken){_0x31e412=util[_0x251b('0xb')](_0x251b('0xe'),HOST,_0x215585,module['exports']['version'],oldToken);}var _0x46792f={'uri':_0x31e412,'method':_0x251b('0xf'),'timeout':0xea60,'json':!![]};return rp(_0x46792f)[_0x251b('0x10')](function(_0x2b02ff){_0x1ff71b(_0x2b02ff);})[_0x251b('0x11')](function(_0x59ddea){_0x5cf512(_0x59ddea);});});}function manageLicense(_0x35cb1c,_0x47e9e9){var _0x5554dd=_0x47e9e9[_0x251b('0x12')]({'plain':!![]});if(!isOldTokenSent&&_0x5554dd[_0x251b('0x13')]!==_0x35cb1c&&!_0x5554dd[_0x251b('0x14')]){oldToken=_0x5554dd['data1'];}httpRequest(_0x35cb1c)[_0x251b('0x10')](function(_0x17ae4f){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x17ae4f['active']){isOldTokenSent=![];if(!_0x5554dd[_0x251b('0x9')]&&_0x5554dd[_0x251b('0x9')]!=_0x17ae4f['license']||_0x5554dd[_0x251b('0x9')]&&_0x5554dd['data2']){logger[_0x251b('0x15')](_0x251b('0x16'));}if(_0x5554dd[_0x251b('0x9')]&&!_0x5554dd['data2']&&_0x5554dd['license']!=_0x17ae4f[_0x251b('0x9')]){logger['info'](_0x251b('0x17'));}if(_0x5554dd[_0x251b('0x9')]&&!_0x5554dd[_0x251b('0x14')]&&_0x5554dd[_0x251b('0x9')]==_0x17ae4f[_0x251b('0x9')]){return _0x47e9e9;}return _0x47e9e9[_0x251b('0x18')]({'data1':_0x35cb1c,'data2':null,'license':_0x17ae4f['license']});}else{if(_0x17ae4f[_0x251b('0x9')]||_0x5554dd['license']){if(!_0x5554dd[_0x251b('0x14')]){if(_0x5554dd[_0x251b('0x13')]==_0x35cb1c){GRAY_PERIOD_REASON='Disabled';logger[_0x251b('0x15')](_0x251b('0x19'));}else{GRAY_PERIOD_REASON=_0x251b('0x1a');logger['info'](_0x251b('0x1b'),_0x5554dd[_0x251b('0x13')],_0x35cb1c);}logger['info'](_0x251b('0x1c'),GRAY_PERIOD_REASON[_0x251b('0x1d')](),moment()[_0x251b('0xb')]('YYYY-MM-DD\x20HH:mm'));return _0x47e9e9['update']({'data2':encryptor[_0x251b('0x1e')](moment()['format'](_0x251b('0x1f')))});}else{if(moment()[_0x251b('0x20')](encryptor[_0x251b('0x21')](_0x5554dd[_0x251b('0x14')]),_0x251b('0x22'))>DAYS){logger[_0x251b('0x15')](_0x251b('0x23'),moment()['format'](_0x251b('0x1f')));isOldTokenSent=![];return _0x47e9e9[_0x251b('0x18')]({'data1':_0x35cb1c,'data2':null,'license':null});}}}else{if(_0x5554dd[_0x251b('0x13')]!=_0x35cb1c){logger[_0x251b('0x15')](_0x251b('0x1b'),_0x5554dd[_0x251b('0x13')],_0x35cb1c);return _0x47e9e9['update']({'data1':_0x35cb1c,'data2':null,'license':null});}}}return _0x47e9e9;})[_0x251b('0x10')](function(_0x3fccae){_0x47e9e9=_0x3fccae;})['catch'](function(_0x38cfd6){logger[_0x251b('0x24')](_0x38cfd6['message']);})['finally'](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x47e9e9);},TIME);});}function defaultLicense(){var _0xdadace=hardware[_0x251b('0x25')]();if(_0xdadace){return db[_0x251b('0x26')][_0x251b('0x27')]({'where':{'id':0x1},'defaults':{'data1':_0xdadace}})['spread'](function(_0x3481d2,_0x6b762e){logger[_0x251b('0x15')](_0x251b('0x28'),_0xdadace);manageLicense(_0xdadace,_0x3481d2);})['catch'](function(_0x4e27ff){logger[_0x251b('0x24')](_0x4e27ff[_0x251b('0x29')]);});}}exports[_0x251b('0x2a')]=defaultLicense; \ No newline at end of file +var _0x719b=['moment','request-promise','bluebird','pkginfo','version','../../mysqldb','./hardware','../logger','https://www.xcallymotion.com','%s/api/servers/%s/check?version=%s','exports','then','catch','get','data1','data2','active','license','info','Disabled','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','update','encryptString','format','diff','decryptString','days','getUuid','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','error','message'];(function(_0x129f74,_0x3d64d8){var _0x1cf683=function(_0x232179){while(--_0x232179){_0x129f74['push'](_0x129f74['shift']());}};_0x1cf683(++_0x3d64d8);}(_0x719b,0x181));var _0xb719=function(_0x3c283d,_0x257db4){_0x3c283d=_0x3c283d-0x0;var _0x532c2a=_0x719b[_0x3c283d];return _0x532c2a;};'use strict';var util=require('util');var moment=require(_0xb719('0x0'));var rp=require(_0xb719('0x1'));var BPromise=require(_0xb719('0x2'));var pkginfo=require(_0xb719('0x3'))(module,_0xb719('0x4'));var db=require(_0xb719('0x5'))['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0xb719('0x6'));var logger=require(_0xb719('0x7'))('license');var HOST=_0xb719('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x492243){return new BPromise(function(_0x1741d0,_0x4c6330){var _0x21a3fd=util['format'](_0xb719('0x9'),HOST,_0x492243,module[_0xb719('0xa')][_0xb719('0x4')]);if(oldToken){_0x21a3fd=util['format']('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x492243,module[_0xb719('0xa')][_0xb719('0x4')],oldToken);}var _0x2f3a75={'uri':_0x21a3fd,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x2f3a75)[_0xb719('0xb')](function(_0x1bfb92){_0x1741d0(_0x1bfb92);})[_0xb719('0xc')](function(_0x3ca102){_0x4c6330(_0x3ca102);});});}function manageLicense(_0x2e9788,_0x5156ab){var _0xabf601=_0x5156ab[_0xb719('0xd')]({'plain':!![]});if(!isOldTokenSent&&_0xabf601[_0xb719('0xe')]!==_0x2e9788&&!_0xabf601[_0xb719('0xf')]){oldToken=_0xabf601[_0xb719('0xe')];}httpRequest(_0x2e9788)[_0xb719('0xb')](function(_0x3c19c4){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x3c19c4[_0xb719('0x10')]){isOldTokenSent=![];if(!_0xabf601['license']&&_0xabf601['license']!=_0x3c19c4[_0xb719('0x11')]||_0xabf601[_0xb719('0x11')]&&_0xabf601[_0xb719('0xf')]){logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0xabf601[_0xb719('0x11')]&&!_0xabf601[_0xb719('0xf')]&&_0xabf601['license']!=_0x3c19c4[_0xb719('0x11')]){logger[_0xb719('0x12')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0xabf601[_0xb719('0x11')]&&!_0xabf601[_0xb719('0xf')]&&_0xabf601['license']==_0x3c19c4['license']){return _0x5156ab;}return _0x5156ab['update']({'data1':_0x2e9788,'data2':null,'license':_0x3c19c4[_0xb719('0x11')]});}else{if(_0x3c19c4['license']||_0xabf601['license']){if(!_0xabf601[_0xb719('0xf')]){if(_0xabf601[_0xb719('0xe')]==_0x2e9788){GRAY_PERIOD_REASON=_0xb719('0x13');logger[_0xb719('0x12')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0xb719('0x14');logger[_0xb719('0x12')](_0xb719('0x15'),_0xabf601['data1'],_0x2e9788);}logger[_0xb719('0x12')](_0xb719('0x16'),GRAY_PERIOD_REASON['toUpperCase'](),moment()['format'](_0xb719('0x17')));return _0x5156ab[_0xb719('0x18')]({'data2':encryptor[_0xb719('0x19')](moment()[_0xb719('0x1a')](_0xb719('0x17')))});}else{if(moment()[_0xb719('0x1b')](encryptor[_0xb719('0x1c')](_0xabf601[_0xb719('0xf')]),_0xb719('0x1d'))>DAYS){logger[_0xb719('0x12')]('DEMO\x20START\x20AT\x20%s',moment()[_0xb719('0x1a')](_0xb719('0x17')));isOldTokenSent=![];return _0x5156ab[_0xb719('0x18')]({'data1':_0x2e9788,'data2':null,'license':null});}}}else{if(_0xabf601[_0xb719('0xe')]!=_0x2e9788){logger[_0xb719('0x12')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0xabf601[_0xb719('0xe')],_0x2e9788);return _0x5156ab[_0xb719('0x18')]({'data1':_0x2e9788,'data2':null,'license':null});}}}return _0x5156ab;})[_0xb719('0xb')](function(_0xcf0bef){_0x5156ab=_0xcf0bef;})[_0xb719('0xc')](function(_0x5f1b8d){logger['error'](_0x5f1b8d['message']);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0xb719('0x1e')](),_0x5156ab);},TIME);});}function defaultLicense(){var _0x2e03a6=hardware[_0xb719('0x1e')]();if(_0x2e03a6){return db['License']['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x2e03a6}})[_0xb719('0x1f')](function(_0x38902f,_0x1a20b3){logger['info'](_0xb719('0x20'),_0x2e03a6);manageLicense(_0x2e03a6,_0x38902f);})['catch'](function(_0x4dbd44){logger[_0xb719('0x21')](_0x4dbd44[_0xb719('0x22')]);});}}exports['default']=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index c33585b..df50c40 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 _0x6ab7=['add','days','grayReason','changed','disabled','message','role','sequelize','COUNT','count','admin','telephone','users','telephones','catch','user','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','moment','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','find','defaults','then','isEmpty','License\x20key\x20value\x20not\x20found','data1','data2','split','decryptString','format','%s:%s:%s','parse','uuid','machineUuid','gray'];(function(_0x34d7b3,_0x19f97b){var _0x2e919e=function(_0x26f9d5){while(--_0x26f9d5){_0x34d7b3['push'](_0x34d7b3['shift']());}};_0x2e919e(++_0x19f97b);}(_0x6ab7,0x8e));var _0x76ab=function(_0x2354f2,_0xfd77c6){_0x2354f2=_0x2354f2-0x0;var _0x234886=_0x6ab7[_0x2354f2];return _0x234886;};'use strict';var util=require(_0x76ab('0x0'));var _=require('lodash');var moment=require(_0x76ab('0x1'));var BPromise=require('bluebird');var hardware=require('./hardware');var encryptor=require(_0x76ab('0x2'));var db=require(_0x76ab('0x3'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x76ab('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x76ab('0x5'),'machineUuid':hardware[_0x76ab('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x76ab('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0x76ab('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x42cba2){return new BPromise(function(_0x4c0563,_0x23c529){return db['License'][_0x76ab('0x7')](_[_0x76ab('0x8')](_0x42cba2,{'raw':!![],'where':{'id':0x1}}))[_0x76ab('0x9')](function(_0x2a0d9e){return checkLicense(_0x2a0d9e,null);})[_0x76ab('0x9')](function(_0x2dc9d9){_0x4c0563(_0x2dc9d9);return;})['catch'](function(_0x1ac60b){_0x23c529(_0x1ac60b);});});}function checkLicense(_0x31149d,_0x9fae8b){if(!_0x31149d){demoLicense['uuid']=_0x31149d['data1'];return demoLicense;}try{var _0x1e2744=_0x9fae8b||_0x31149d['license'];if(_[_0x76ab('0xa')](_0x1e2744)){throw new Error(_0x76ab('0xb'));}var _0x24c035=_0x31149d[_0x76ab('0xc')];var _0x14a636=_0x31149d[_0x76ab('0xd')];var _0x354ca5=_0x24c035[_0x76ab('0xe')]('-')[0x4];var _0x99114d=_0x24c035[_0x76ab('0xe')]('-')[0x0];var _0x1bb7f9=encryptor[_0x76ab('0xf')](_0x1e2744,util[_0x76ab('0x10')](_0x76ab('0x11'),_0x354ca5,_0x24c035,_0x99114d));var _0x27edc8=JSON[_0x76ab('0x12')](_0x1bb7f9);_0x27edc8['demo']=![];_0x27edc8[_0x76ab('0x13')]=_0x24c035;_0x27edc8[_0x76ab('0x14')]=hardware[_0x76ab('0x6')]();if(_0x14a636){var _0x332d6c=encryptor[_0x76ab('0xf')](_0x14a636);_0x27edc8[_0x76ab('0x15')]=_0x332d6c;_0x27edc8['deadline']=moment(_0x332d6c)[_0x76ab('0x16')](0x7,_0x76ab('0x17'))[_0x76ab('0x10')]();_0x27edc8[_0x76ab('0x18')]=_0x27edc8[_0x76ab('0x13')]!=_0x27edc8[_0x76ab('0x14')]?_0x76ab('0x19'):_0x76ab('0x1a');}return _0x27edc8;}catch(_0x3c8d8a){breakingLicense[_0x76ab('0x13')]=_0x31149d['data1'];breakingLicense[_0x76ab('0x1b')]=_0x3c8d8a[_0x76ab('0x1b')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x3ff9ce,_0x2a62ed){getLicense()['then'](function(_0x1d1645){return db['User']['findAll']({'attributes':[_0x76ab('0x1c'),[db[_0x76ab('0x1d')]['fn'](_0x76ab('0x1e'),db['sequelize']['col']('role')),_0x76ab('0x1f')]],'group':_0x76ab('0x1c'),'where':{'role':{'$or':[_0x76ab('0x20'),'user',_0x76ab('0x21')]}},'raw':!![]})['then'](function(_0x2803b2){var _0x2134d1={'user':_0x1d1645[_0x76ab('0x22')]||0x0,'telephone':_0x1d1645[_0x76ab('0x23')]||0x0};_0x2803b2['forEach'](function(_0x366d92){var _0x1eaea1=_0x366d92['role']===_0x76ab('0x20')?'user':_0x366d92[_0x76ab('0x1c')];_0x2134d1[_0x1eaea1]-=_0x366d92['count'];if(_0x2134d1[_0x1eaea1]<0x0)_0x2134d1[_0x1eaea1]=0x0;});_0x3ff9ce(_0x2134d1);return;});})[_0x76ab('0x24')](function(_0x2cead1){_0x2a62ed(_0x2cead1);});});}function checkUserLimits(_0x2e41a3){return new BPromise(function(_0x5efbec,_0x3ab08c){getLimits()[_0x76ab('0x9')](function(_0x13ea1b){var _0x1e264d=_['pick'](_['countBy'](_0x2e41a3,_0x76ab('0x1c')),[_0x76ab('0x20'),_0x76ab('0x25'),'telephone']);var _0x4522a4=(_0x1e264d['admin']||0x0)+(_0x1e264d[_0x76ab('0x25')]||0x0);var _0x152351=_0x1e264d[_0x76ab('0x21')]||0x0;if(_0x4522a4>_0x13ea1b['user'])return _0x3ab08c(_0x76ab('0x26'));if(_0x152351>_0x13ea1b[_0x76ab('0x21')])return _0x3ab08c(_0x76ab('0x27'));return _0x5efbec();})[_0x76ab('0x24')](function(_0x5c56d3){_0x3ab08c(_0x5c56d3);});});}module[_0x76ab('0x28')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x0895=['./hardware','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','License','find','defaults','then','catch','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','%s:%s:%s','parse','demo','uuid','decryptString','gray','deadline','changed','disabled','User','findAll','sequelize','COUNT','col','role','count','admin','user','users','telephones','forEach','countBy','telephone','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','bluebird'];(function(_0x59e6f9,_0x23238c){var _0x915003=function(_0x36e582){while(--_0x36e582){_0x59e6f9['push'](_0x59e6f9['shift']());}};_0x915003(++_0x23238c);}(_0x0895,0xdd));var _0x5089=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0895[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x5089('0x0'));var _=require(_0x5089('0x1'));var moment=require(_0x5089('0x2'));var BPromise=require(_0x5089('0x3'));var hardware=require(_0x5089('0x4'));var encryptor=require('../../components/encryptor');var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x5089('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x5089('0x6'),'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':'Breaking\x20license','machineUuid':hardware[_0x5089('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x2c2cfb){return new BPromise(function(_0x828b12,_0x44cbca){return db[_0x5089('0x8')][_0x5089('0x9')](_[_0x5089('0xa')](_0x2c2cfb,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x5b8722){return checkLicense(_0x5b8722,null);})[_0x5089('0xb')](function(_0x584745){_0x828b12(_0x584745);return;})[_0x5089('0xc')](function(_0xe803d2){_0x44cbca(_0xe803d2);});});}function checkLicense(_0x4017ce,_0x2b8c95){if(!_0x4017ce){demoLicense['uuid']=_0x4017ce[_0x5089('0xd')];return demoLicense;}try{var _0x1609ec=_0x2b8c95||_0x4017ce[_0x5089('0xe')];if(_[_0x5089('0xf')](_0x1609ec)){throw new Error(_0x5089('0x10'));}var _0x56b5e5=_0x4017ce[_0x5089('0xd')];var _0xc4eb62=_0x4017ce[_0x5089('0x11')];var _0x21d196=_0x56b5e5[_0x5089('0x12')]('-')[0x4];var _0x2b6525=_0x56b5e5[_0x5089('0x12')]('-')[0x0];var _0x1461fe=encryptor['decryptString'](_0x1609ec,util['format'](_0x5089('0x13'),_0x21d196,_0x56b5e5,_0x2b6525));var _0xc4bc8d=JSON[_0x5089('0x14')](_0x1461fe);_0xc4bc8d[_0x5089('0x15')]=![];_0xc4bc8d[_0x5089('0x16')]=_0x56b5e5;_0xc4bc8d['machineUuid']=hardware[_0x5089('0x7')]();if(_0xc4eb62){var _0x3cab93=encryptor[_0x5089('0x17')](_0xc4eb62);_0xc4bc8d[_0x5089('0x18')]=_0x3cab93;_0xc4bc8d[_0x5089('0x19')]=moment(_0x3cab93)['add'](0x7,'days')['format']();_0xc4bc8d['grayReason']=_0xc4bc8d['uuid']!=_0xc4bc8d['machineUuid']?_0x5089('0x1a'):_0x5089('0x1b');}return _0xc4bc8d;}catch(_0x479a4c){breakingLicense[_0x5089('0x16')]=_0x4017ce[_0x5089('0xd')];breakingLicense['message']=_0x479a4c['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x1fd570,_0x5ac8e2){getLicense()[_0x5089('0xb')](function(_0x403247){return db[_0x5089('0x1c')][_0x5089('0x1d')]({'attributes':['role',[db[_0x5089('0x1e')]['fn'](_0x5089('0x1f'),db[_0x5089('0x1e')][_0x5089('0x20')](_0x5089('0x21'))),_0x5089('0x22')]],'group':_0x5089('0x21'),'where':{'role':{'$or':[_0x5089('0x23'),_0x5089('0x24'),'telephone']}},'raw':!![]})[_0x5089('0xb')](function(_0x49d730){var _0xbf301c={'user':_0x403247[_0x5089('0x25')]||0x0,'telephone':_0x403247[_0x5089('0x26')]||0x0};_0x49d730[_0x5089('0x27')](function(_0xe7808f){var _0x58bcd3=_0xe7808f['role']==='admin'?_0x5089('0x24'):_0xe7808f[_0x5089('0x21')];_0xbf301c[_0x58bcd3]-=_0xe7808f[_0x5089('0x22')];if(_0xbf301c[_0x58bcd3]<0x0)_0xbf301c[_0x58bcd3]=0x0;});_0x1fd570(_0xbf301c);return;});})['catch'](function(_0xbd9e1e){_0x5ac8e2(_0xbd9e1e);});});}function checkUserLimits(_0x279fe3){return new BPromise(function(_0x29f02b,_0x54f42c){getLimits()[_0x5089('0xb')](function(_0x3aad4a){var _0x4d1397=_['pick'](_[_0x5089('0x28')](_0x279fe3,_0x5089('0x21')),[_0x5089('0x23'),'user',_0x5089('0x29')]);var _0x21b45b=(_0x4d1397['admin']||0x0)+(_0x4d1397['user']||0x0);var _0x206192=_0x4d1397[_0x5089('0x29')]||0x0;if(_0x21b45b>_0x3aad4a['user'])return _0x54f42c(_0x5089('0x2a'));if(_0x206192>_0x3aad4a[_0x5089('0x29')])return _0x54f42c(_0x5089('0x2b'));return _0x29f02b();})['catch'](function(_0x2a1f1e){_0x54f42c(_0x2a1f1e);});});}module[_0x5089('0x2c')]={'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 7478c31..5479a46 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 _0xb78e=['secret','exports','http://localhost:9000','app-id'];(function(_0x2cde2a,_0x4325c4){var _0x110f55=function(_0x4927f5){while(--_0x4927f5){_0x2cde2a['push'](_0x2cde2a['shift']());}};_0x110f55(++_0x4325c4);}(_0xb78e,0x1c9));var _0xeb78=function(_0xc62a68,_0x43867c){_0xc62a68=_0xc62a68-0x0;var _0x2f6ed2=_0xb78e[_0xc62a68];return _0x2f6ed2;};'use strict';module[_0xeb78('0x0')]={'DOMAIN':_0xeb78('0x1'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0xeb78('0x2'),'GOOGLE_SECRET':_0xeb78('0x3'),'DEBUG':''}; \ No newline at end of file +var _0x1c9a=['myappanuglar-secret','secret','exports'];(function(_0x274ce2,_0x110e5c){var _0x25b499=function(_0x6a68b){while(--_0x6a68b){_0x274ce2['push'](_0x274ce2['shift']());}};_0x25b499(++_0x110e5c);}(_0x1c9a,0x98));var _0xa1c9=function(_0x505fe4,_0x530f62){_0x505fe4=_0x505fe4-0x0;var _0x6c244c=_0x1c9a[_0x505fe4];return _0x6c244c;};'use strict';module[_0xa1c9('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0xa1c9('0x1'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0xa1c9('0x2'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index cf36b1b..3ba69f1 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x46df=['fileLogger','exports','../utils/loggers'];(function(_0x4c0b73,_0xdee80a){var _0x38e5d7=function(_0x5c1308){while(--_0x5c1308){_0x4c0b73['push'](_0x4c0b73['shift']());}};_0x38e5d7(++_0xdee80a);}(_0x46df,0x107));var _0xf46d=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x46df[_0x297fd3];return _0x2af381;};'use strict';var fileLogger=require(_0xf46d('0x0'))[_0xf46d('0x1')];module[_0xf46d('0x2')]=fileLogger; \ No newline at end of file +var _0x1fb8=['exports','../utils/loggers','fileLogger'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x1fb8,0x13c));var _0x81fb=function(_0x3340c8,_0x3d67d7){_0x3340c8=_0x3340c8-0x0;var _0x30ca8a=_0x1fb8[_0x3340c8];return _0x30ca8a;};'use strict';var fileLogger=require(_0x81fb('0x0'))[_0x81fb('0x1')];module[_0x81fb('0x2')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index f720659..af8d7dc 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 _0xbf76=['../../services/express/index.js','join','../../services/ami/index.js','../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js','../../services/xdr/index.js','exports','express'];(function(_0x1fa82c,_0x41866b){var _0x156cd6=function(_0x2bdd55){while(--_0x2bdd55){_0x1fa82c['push'](_0x1fa82c['shift']());}};_0x156cd6(++_0x41866b);}(_0xbf76,0x107));var _0x6bf7=function(_0x419f13,_0x10358c){_0x419f13=_0x419f13-0x0;var _0x30f536=_0xbf76[_0x419f13];return _0x30f536;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':_0x6bf7('0x0'),'script':path['join'](__dirname,_0x6bf7('0x1'))},{'name':'ami','script':path[_0x6bf7('0x2')](__dirname,_0x6bf7('0x3'))},{'name':'agi','script':path[_0x6bf7('0x2')](__dirname,_0x6bf7('0x4'))},{'name':_0x6bf7('0x5'),'script':path[_0x6bf7('0x2')](__dirname,_0x6bf7('0x6'))},{'name':_0x6bf7('0x7'),'script':path[_0x6bf7('0x2')](__dirname,_0x6bf7('0x8'))},{'name':'xdr','script':path[_0x6bf7('0x2')](__dirname,_0x6bf7('0x9'))}]};module[_0x6bf7('0xa')]=config; \ No newline at end of file +var _0xe8ce=['../../services/express/index.js','../../services/ami/index.js','agi','email','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','express','join'];(function(_0x3a3b6a,_0x51e1e5){var _0x2c5061=function(_0x563d7f){while(--_0x563d7f){_0x3a3b6a['push'](_0x3a3b6a['shift']());}};_0x2c5061(++_0x51e1e5);}(_0xe8ce,0xb2));var _0xee8c=function(_0x596404,_0x240159){_0x596404=_0x596404-0x0;var _0x560063=_0xe8ce[_0x596404];return _0x560063;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':_0xee8c('0x0'),'script':path[_0xee8c('0x1')](__dirname,_0xee8c('0x2'))},{'name':'ami','script':path[_0xee8c('0x1')](__dirname,_0xee8c('0x3'))},{'name':_0xee8c('0x4'),'script':path[_0xee8c('0x1')](__dirname,'../../services/agi/index.js')},{'name':_0xee8c('0x5'),'script':path[_0xee8c('0x1')](__dirname,'../../services/email/index.js')},{'name':_0xee8c('0x6'),'script':path['join'](__dirname,_0xee8c('0x7'))},{'name':_0xee8c('0x8'),'script':path[_0xee8c('0x1')](__dirname,_0xee8c('0x9'))}]};module['exports']=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index bd2ec07..9ce21d9 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 _0x5101=['disconnect','stop','restart','list','describe','delete','dump','saved','./config','connect','connected','start','then'];(function(_0x3081c7,_0x4dae35){var _0x50f807=function(_0x149947){while(--_0x149947){_0x3081c7['push'](_0x3081c7['shift']());}};_0x50f807(++_0x4dae35);}(_0x5101,0x140));var _0x1510=function(_0x15b480,_0x32dfc0){_0x15b480=_0x15b480-0x0;var _0x383d5c=_0x5101[_0x15b480];return _0x383d5c;};'use strict';var pm2=require('pm2');var BPromise=require('bluebird');var config=require(_0x1510('0x0'));function connect(){return new BPromise(function(_0x49453b,_0x4a4df6){return pm2[_0x1510('0x1')](function(_0x36a66c){if(_0x36a66c){return _0x4a4df6(_0x36a66c);}return _0x49453b(_0x1510('0x2'));});});};exports[_0x1510('0x3')]=function(_0x5dba48){return connect()[_0x1510('0x4')](function(){return new BPromise(function(_0x439fc8,_0x1e8296){return pm2[_0x1510('0x3')](_0x5dba48,function(_0x2225cd,_0x2bcee5){if(_0x2225cd){return _0x1e8296(_0x2225cd);}pm2[_0x1510('0x5')]();return _0x439fc8(_0x2bcee5);});});});};exports[_0x1510('0x6')]=function(_0x4c26c7){return connect()['then'](function(){return new BPromise(function(_0x14da5c,_0x39d530){return pm2[_0x1510('0x6')](_0x4c26c7,function(_0x255522,_0x19bd2c){if(_0x255522){return _0x39d530(_0x255522);}pm2[_0x1510('0x5')]();return _0x14da5c(_0x19bd2c);});});});};exports[_0x1510('0x7')]=function(_0x159806){return connect()['then'](function(){return new BPromise(function(_0x17f581,_0x162700){return pm2[_0x1510('0x7')](_0x159806,function(_0x106418,_0x17b01d){if(_0x106418){return _0x162700(_0x106418);}pm2[_0x1510('0x5')]();return _0x17f581(_0x17b01d);});});});};exports[_0x1510('0x8')]=function(){return connect()[_0x1510('0x4')](function(){return new BPromise(function(_0x485127,_0x57e6d2){return pm2[_0x1510('0x8')](function(_0x3eb239,_0x35cfa4){if(_0x3eb239){return _0x57e6d2(_0x3eb239);}pm2['disconnect']();return _0x485127(_0x35cfa4);});});});};exports[_0x1510('0x9')]=function(_0x5b79c5){return connect()[_0x1510('0x4')](function(){return new BPromise(function(_0x194dea,_0x1c21e3){return pm2['describe'](_0x5b79c5,function(_0x55b03c,_0x203bff){if(_0x55b03c){return _0x1c21e3(_0x55b03c);}pm2[_0x1510('0x5')]();return _0x194dea(_0x203bff);});});});};exports[_0x1510('0xa')]=function(_0x4ef87b){return connect()[_0x1510('0x4')](function(){return new BPromise(function(_0x28c4b8,_0x4eb2a5){return pm2[_0x1510('0xa')](_0x4ef87b,function(_0x469861,_0x5d14c8){if(_0x469861){return _0x4eb2a5(_0x469861);}pm2[_0x1510('0x5')]();return _0x28c4b8(_0x5d14c8);});});});};exports['dump']=function(){return connect()['then'](function(){return new BPromise(function(_0x461b89,_0xf83bff){return pm2[_0x1510('0xb')](function(_0x38fc89){if(_0x38fc89){return _0xf83bff(_0x38fc89);}return _0x461b89(_0x1510('0xc'));});});});}; \ No newline at end of file +var _0x58aa=['delete','dump','saved','pm2','bluebird','./config','connect','connected','then','start','disconnect','stop','restart','list','describe'];(function(_0xa7984c,_0x3b130c){var _0x3c6957=function(_0x2bd603){while(--_0x2bd603){_0xa7984c['push'](_0xa7984c['shift']());}};_0x3c6957(++_0x3b130c);}(_0x58aa,0xf3));var _0xa58a=function(_0x10484f,_0x124a1c){_0x10484f=_0x10484f-0x0;var _0x4f9b2b=_0x58aa[_0x10484f];return _0x4f9b2b;};'use strict';var pm2=require(_0xa58a('0x0'));var BPromise=require(_0xa58a('0x1'));var config=require(_0xa58a('0x2'));function connect(){return new BPromise(function(_0x38743e,_0x1388de){return pm2[_0xa58a('0x3')](function(_0x176061){if(_0x176061){return _0x1388de(_0x176061);}return _0x38743e(_0xa58a('0x4'));});});};exports['start']=function(_0x451b2a){return connect()[_0xa58a('0x5')](function(){return new BPromise(function(_0x570f22,_0x2988b3){return pm2[_0xa58a('0x6')](_0x451b2a,function(_0x32eae7,_0x493642){if(_0x32eae7){return _0x2988b3(_0x32eae7);}pm2[_0xa58a('0x7')]();return _0x570f22(_0x493642);});});});};exports['stop']=function(_0x255922){return connect()[_0xa58a('0x5')](function(){return new BPromise(function(_0x250ded,_0x346b0d){return pm2[_0xa58a('0x8')](_0x255922,function(_0x5b7942,_0x5aab6e){if(_0x5b7942){return _0x346b0d(_0x5b7942);}pm2['disconnect']();return _0x250ded(_0x5aab6e);});});});};exports[_0xa58a('0x9')]=function(_0x3ded17){return connect()[_0xa58a('0x5')](function(){return new BPromise(function(_0x5e9fdc,_0x50f4a1){return pm2[_0xa58a('0x9')](_0x3ded17,function(_0x85edf6,_0x3e15ec){if(_0x85edf6){return _0x50f4a1(_0x85edf6);}pm2[_0xa58a('0x7')]();return _0x5e9fdc(_0x3e15ec);});});});};exports[_0xa58a('0xa')]=function(){return connect()['then'](function(){return new BPromise(function(_0x30e2e8,_0x2f0757){return pm2[_0xa58a('0xa')](function(_0x5ad6e5,_0x2b5cdd){if(_0x5ad6e5){return _0x2f0757(_0x5ad6e5);}pm2[_0xa58a('0x7')]();return _0x30e2e8(_0x2b5cdd);});});});};exports[_0xa58a('0xb')]=function(_0x4aedca){return connect()['then'](function(){return new BPromise(function(_0x2ef3f1,_0xd0ec0e){return pm2[_0xa58a('0xb')](_0x4aedca,function(_0x19ffbe,_0x3b32c1){if(_0x19ffbe){return _0xd0ec0e(_0x19ffbe);}pm2[_0xa58a('0x7')]();return _0x2ef3f1(_0x3b32c1);});});});};exports[_0xa58a('0xc')]=function(_0x11010e){return connect()[_0xa58a('0x5')](function(){return new BPromise(function(_0x3b60ed,_0x8e3a59){return pm2[_0xa58a('0xc')](_0x11010e,function(_0x2c5eb2,_0x10e5f0){if(_0x2c5eb2){return _0x8e3a59(_0x2c5eb2);}pm2[_0xa58a('0x7')]();return _0x3b60ed(_0x10e5f0);});});});};exports[_0xa58a('0xd')]=function(){return connect()['then'](function(){return new BPromise(function(_0x595c29,_0x37256b){return pm2['dump'](function(_0x52ce59){if(_0x52ce59){return _0x37256b(_0x52ce59);}return _0x595c29(_0xa58a('0xe'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index f827a99..5383b30 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 _0xc35f=['then','chatTimeout','ChatInteraction','lastMsgAt','minutes','length','info','[CHAT]\x20Interactions\x20to\x20close:','join','update','system','format','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','start','moment','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','socket.io-emitter','Setting'];(function(_0x60df74,_0x458e29){var _0x5ee872=function(_0x356888){while(--_0x356888){_0x60df74['push'](_0x60df74['shift']());}};_0x5ee872(++_0x458e29);}(_0xc35f,0x1ee));var _0xfc35=function(_0x5190b7,_0x316467){_0x5190b7=_0x5190b7-0x0;var _0x150498=_0xc35f[_0x5190b7];return _0x150498;};'use strict';var _=require('lodash');var moment=require(_0xfc35('0x0'));var Redis=require('ioredis');var util=require(_0xfc35('0x1'));var config=require(_0xfc35('0x2'));var db=require(_0xfc35('0x3'))['db'];var logger=require(_0xfc35('0x4'))(_0xfc35('0x5'));config[_0xfc35('0x6')]=_[_0xfc35('0x7')](config[_0xfc35('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xfc35('0x8'))(new Redis(config[_0xfc35('0x6')]));function closeInteractions(){var _0x461329=0x0;var _0x12ea60=[];return db[_0xfc35('0x9')]['find']({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0xfc35('0xa')](function(_0x586116){_0x461329=_0x586116[_0xfc35('0xb')];if(_0x461329){return db[_0xfc35('0xc')]['findAll']({'raw':!![],'attributes':['id',_0xfc35('0xd')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x586116[_0xfc35('0xb')],_0xfc35('0xe'))}}});}else{return[];}})[_0xfc35('0xa')](function(_0x4f47fd){if(_0x4f47fd&&_0x4f47fd[_0xfc35('0xf')]){_0x12ea60=_['map'](_0x4f47fd||[],'id');logger[_0xfc35('0x10')](_0xfc35('0x11'),_0x12ea60[_0xfc35('0x12')]());return db[_0xfc35('0xc')][_0xfc35('0x13')]({'closeReason':_0xfc35('0x14'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0xfc35('0x15')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x12ea60}});}})['then'](function(){if(_0x12ea60&&_0x12ea60['length']){logger[_0xfc35('0x10')](_0xfc35('0x16'),_0x12ea60['join']());for(var _0x2f7f2d=0x0;_0x2f7f2d<_0x12ea60['length'];_0x2f7f2d++){io['emit'](_0xfc35('0x17'),{'id':_0x12ea60[_0x2f7f2d],'closed':!![]});}}})[_0xfc35('0x18')](function(_0x16befd){logger[_0xfc35('0x19')](_0xfc35('0x1a'),_0x16befd?util['inspect'](_0x16befd,{'showHidden':![],'depth':null}):'');});}exports[_0xfc35('0x1b')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x94f0=['map','info','[CHAT]\x20Interactions\x20to\x20close:','join','update','system','format','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','chatInteraction:update','catch','error','inspect','start','lodash','moment','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','socket.io-emitter','Setting','find','chatTimeout','then','findAll','lastMsgAt','subtract','length'];(function(_0x43f9d0,_0x33977c){var _0x49491d=function(_0xadb850){while(--_0xadb850){_0x43f9d0['push'](_0x43f9d0['shift']());}};_0x49491d(++_0x33977c);}(_0x94f0,0xae));var _0x094f=function(_0x2b306a,_0x4f347f){_0x2b306a=_0x2b306a-0x0;var _0x404dd2=_0x94f0[_0x2b306a];return _0x404dd2;};'use strict';var _=require(_0x094f('0x0'));var moment=require(_0x094f('0x1'));var Redis=require('ioredis');var util=require(_0x094f('0x2'));var config=require(_0x094f('0x3'));var db=require(_0x094f('0x4'))['db'];var logger=require(_0x094f('0x5'))(_0x094f('0x6'));config[_0x094f('0x7')]=_[_0x094f('0x8')](config[_0x094f('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x094f('0x9'))(new Redis(config[_0x094f('0x7')]));function closeInteractions(){var _0x26a9cf=0x0;var _0x4a9d62=[];return db[_0x094f('0xa')][_0x094f('0xb')]({'raw':!![],'attributes':['id',_0x094f('0xc')],'where':{'id':0x1}})[_0x094f('0xd')](function(_0x20d556){_0x26a9cf=_0x20d556[_0x094f('0xc')];if(_0x26a9cf){return db['ChatInteraction'][_0x094f('0xe')]({'raw':!![],'attributes':['id',_0x094f('0xf')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x094f('0x10')](_0x20d556['chatTimeout'],'minutes')}}});}else{return[];}})[_0x094f('0xd')](function(_0x222da0){if(_0x222da0&&_0x222da0[_0x094f('0x11')]){_0x4a9d62=_[_0x094f('0x12')](_0x222da0||[],'id');logger[_0x094f('0x13')](_0x094f('0x14'),_0x4a9d62[_0x094f('0x15')]());return db['ChatInteraction'][_0x094f('0x16')]({'closeReason':_0x094f('0x17'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x094f('0x18')](_0x094f('0x19'))},{'where':{'id':_0x4a9d62}});}})[_0x094f('0xd')](function(){if(_0x4a9d62&&_0x4a9d62[_0x094f('0x11')]){logger[_0x094f('0x13')](_0x094f('0x1a'),_0x4a9d62['join']());for(var _0x1a4087=0x0;_0x1a4087<_0x4a9d62['length'];_0x1a4087++){io['emit'](_0x094f('0x1b'),{'id':_0x4a9d62[_0x1a4087],'closed':!![]});}}})[_0x094f('0x1c')](function(_0x162f1e){logger[_0x094f('0x1d')]('[CHAT]\x20Error\x20closing\x20interactions',_0x162f1e?util[_0x094f('0x1e')](_0x162f1e,{'showHidden':![],'depth':null}):'');});}exports[_0x094f('0x1f')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/cloud-provider.js b/server/config/schedule/cloud-provider.js index a7be470..5aca44f 100644 --- a/server/config/schedule/cloud-provider.js +++ b/server/config/schedule/cloud-provider.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf1fd=['startAllRefreshIntervals'];(function(_0x41df56,_0x5264d5){var _0x4c4d6e=function(_0x4d7775){while(--_0x4d7775){_0x41df56['push'](_0x41df56['shift']());}};_0x4c4d6e(++_0x5264d5);}(_0xf1fd,0x175));var _0xdf1f=function(_0x137f1d,_0x173f64){_0x137f1d=_0x137f1d-0x0;var _0x2188ab=_0xf1fd[_0x137f1d];return _0x2188ab;};'use strict';function start(){var _0x4cb244=require('../../api/cloudProvider/cloudProvider.oauth.js');return _0x4cb244[_0xdf1f('0x0')]();}module['exports']={'intervals':{},'start':start}; \ No newline at end of file +var _0x5278=['exports'];(function(_0x2ee044,_0x42b15b){var _0x12fe6b=function(_0x33a90d){while(--_0x33a90d){_0x2ee044['push'](_0x2ee044['shift']());}};_0x12fe6b(++_0x42b15b);}(_0x5278,0x9c));var _0x8527=function(_0x49d41c,_0x2bdc35){_0x49d41c=_0x49d41c-0x0;var _0xb64c5f=_0x5278[_0x49d41c];return _0xb64c5f;};'use strict';function start(){var _0x5108f8=require('../../api/cloudProvider/cloudProvider.oauth.js');return _0x5108f8['startAllRefreshIntervals']();}module[_0x8527('0x0')]={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 4946ac7..b7f1dce 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 _0x51e9=['email','Smtp','service','MailAccount','host','port','secure','authentication','auth','user','pass','format','\x22%s\x22\x20<%s>','Report\x20%s\x20last\x20%s\x20%s','name','subtractUnit','join','%s.%s','basename','extname','zip','existsSync','status','Sent','attachments','message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','email\x20sent','catch','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','subtractNumber','YYYY-MM-DD\x20HH:mm:ss','output','exec\x20defaul\x20report\x20id:%s','DefaultReportId','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','jobs','toString','keyBy','length','stop','deleteJob','delete\x20cron','toRun','index','my\x20id','resolve','run\x20job','cron','active','startAt','endAt','add','start','add\x20cron','exists','stop\x20cron','isBetween','update','update\x20cron','run','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info'];(function(_0x59cb1c,_0x161ddd){var _0x384da7=function(_0x20f3f8){while(--_0x20f3f8){_0x59cb1c['push'](_0x59cb1c['shift']());}};_0x384da7(++_0x161ddd);}(_0x51e9,0x15c));var _0x951e=function(_0x535cb3,_0x5d56a0){_0x535cb3=_0x535cb3-0x0;var _0x359bdf=_0x51e9[_0x535cb3];return _0x359bdf;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0x951e('0x0'));var _=require(_0x951e('0x1'));var moment=require(_0x951e('0x2'));var CronJobManager=require(_0x951e('0x3'));var jayson=require(_0x951e('0x4'));var BPromise=require(_0x951e('0x5'));var logger=require(_0x951e('0x6'))(_0x951e('0x7'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0x951e('0x8'));var client=jayson[_0x951e('0x9')][_0x951e('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0xa83f91,_0x5a635c){return function(){logger[_0x951e('0xb')]('Try\x20to\x20send\x20a\x20mail\x20to',_0xa83f91[_0x951e('0xc')]);var _0x3be1db=!![];var _0xde38f1={'tls':{'rejectUnauthorized':![]}};if(_0xa83f91['MailAccount'][_0x951e('0xd')][_0x951e('0xe')]){_0xde38f1[_0x951e('0xe')]=_0xa83f91[_0x951e('0xf')]['Smtp'][_0x951e('0xe')];}else{_0xde38f1[_0x951e('0x10')]=_0xa83f91['MailAccount'][_0x951e('0xd')]['host'];_0xde38f1['port']=_0xa83f91[_0x951e('0xf')][_0x951e('0xd')][_0x951e('0x11')];_0xde38f1[_0x951e('0x12')]=_0xa83f91['MailAccount']['Smtp']['secure'];}if(_0xa83f91[_0x951e('0xf')][_0x951e('0xd')][_0x951e('0x13')]){_0xde38f1[_0x951e('0x14')]={'user':_0xa83f91[_0x951e('0xf')]['Smtp'][_0x951e('0x15')],'pass':_0xa83f91['MailAccount'][_0x951e('0xd')][_0x951e('0x16')]};}var _0xf24448={'account':_0xde38f1,'message':{'from':util[_0x951e('0x17')](_0x951e('0x18'),_0xa83f91[_0x951e('0xf')]['name'],_0xa83f91['MailAccount'][_0x951e('0xc')]||_0xa83f91[_0x951e('0xf')][_0x951e('0xd')][_0x951e('0x15')]),'to':_0xa83f91[_0x951e('0xc')],'cc':_0xa83f91['cc'],'bcc':_0xa83f91['bcc'],'subject':util[_0x951e('0x17')](_0x951e('0x19'),_0x5a635c[_0x951e('0x1a')],_0xa83f91['subtractNumber'],_0xa83f91[_0x951e('0x1b')])}};var _0x3ba49b=path[_0x951e('0x1c')](__dirname,'../../files/reports');var _0x857015=_0x5a635c['savename'];var _0x54f8c3=util[_0x951e('0x17')](_0x951e('0x1d'),path[_0x951e('0x1e')](_0x5a635c['savename'],path[_0x951e('0x1f')](_0x5a635c['savename'])),_0x951e('0x20'));var _0xf6bd89=path[_0x951e('0x1c')](_0x3ba49b,_0x857015);var _0x83b815=path[_0x951e('0x1c')](_0x3ba49b,_0x54f8c3);if(fs[_0x951e('0x21')](_0xf6bd89)){_0x5a635c[_0x951e('0x22')]=_0x951e('0x23');_0xf24448['message'][_0x951e('0x24')]=[{'filename':_0x857015,'path':_0xf6bd89}];_0xf24448[_0x951e('0x25')][_0x951e('0x26')]=util[_0x951e('0x17')](_0x951e('0x27'),JSON[_0x951e('0x28')](_0x5a635c,null,0x2));}else if(fs[_0x951e('0x21')](_0x83b815)){_0x5a635c['status']=_0x951e('0x23');_0xf24448[_0x951e('0x25')]['attachments']=[{'filename':_0x54f8c3,'path':_0x83b815}];}else{_0xf24448[_0x951e('0x25')]['text']=_0x951e('0x29');if(!_0xa83f91[_0x951e('0x2a')]){_0x3be1db=![];logger[_0x951e('0xb')](_0x951e('0x2b'));}}if(_0x3be1db){return client[_0x951e('0x2c')](_0x951e('0x2d'),_0xf24448)[_0x951e('0x2e')](function(_0x58da38){if(_0x58da38[_0x951e('0x2f')]){return logger[_0x951e('0x2f')](_0x951e('0x30'),JSON[_0x951e('0x28')](_0x58da38));}return logger[_0x951e('0xb')](_0x951e('0x31'));})[_0x951e('0x32')](function(_0x892e36){return logger[_0x951e('0x2f')]('error\x20mail',JSON['stringify'](_0x892e36));});}};}function handleError(){return function(_0x315ae5){return logger['error'](JSON[_0x951e('0x28')](_0x315ae5));};}function handleResult(_0x428f1d){return function(_0x14a494){logger[_0x951e('0xb')]('data',JSON['stringify'](_0x14a494));if(_0x428f1d[_0x951e('0xf')]&&_0x428f1d[_0x951e('0xf')]['Smtp']&&!_[_0x951e('0x33')](_0x428f1d[_0x951e('0xc')])){setTimeout(handleSendEmail(_0x428f1d,_0x14a494),0x3c*0x3e8);}};}function handleJob(_0x2745dc){return function(){try{if(_[_0x951e('0x33')](_0x2745dc['subtractNumber'])){return logger[_0x951e('0xb')](_0x951e('0x34'));}if(_['isNil'](_0x2745dc['subtractUnit'])){return logger[_0x951e('0xb')](_0x951e('0x35'));}var _0x1e9b8b={'startDate':moment()[_0x951e('0x36')](_0x2745dc[_0x951e('0x37')],_0x2745dc[_0x951e('0x1b')])['format'](_0x951e('0x38')),'endDate':moment()[_0x951e('0x17')](_0x951e('0x38')),'type':'scheduled','output':_0x2745dc[_0x951e('0x39')],'name':_0x2745dc[_0x951e('0x1a')]};if(!_[_0x951e('0x33')](_0x2745dc['DefaultReportId'])){logger[_0x951e('0xb')](_0x951e('0x3a'),_0x2745dc[_0x951e('0x3b')]);return analyticDefaultReportController[_0x951e('0x3c')]({'id':_0x2745dc['DefaultReportId']},_0x1e9b8b)['then'](handleResult(_0x2745dc))['catch'](handleError());}if(!_['isNil'](_0x2745dc[_0x951e('0x3d')])){logger[_0x951e('0xb')](_0x951e('0x3e'),_0x2745dc[_0x951e('0x3d')]);return analyticCustomReportController[_0x951e('0x3c')]({'id':_0x2745dc['CustomReportId']},_0x1e9b8b)[_0x951e('0x2e')](handleResult(_0x2745dc))['catch'](handleError());}}catch(_0x3c253f){logger[_0x951e('0x2f')](JSON[_0x951e('0x28')](_0x3c253f));}return logger[_0x951e('0xb')](_0x951e('0x3f'));};}function getJobs(_0x1a11f){var _0x3430c6={};if(_0x1a11f){_0x3430c6['id']=_0x1a11f;}return db[_0x951e('0x40')]['findAll']({'where':_0x3430c6,'include':[{'model':db[_0x951e('0xf')],'attributes':['id',_0x951e('0x1a'),_0x951e('0xc')],'include':[{'model':db['MailServerOut'],'as':_0x951e('0xd')}]}]})['then'](function(_0x37644d){var _0x16137b=_['keys'](manager[_0x951e('0x41')]);var _0x4ecd9b=_['map'](_0x37644d,function(_0x2c1b3f){return _0x2c1b3f['id'][_0x951e('0x42')]();});var _0x3fe770=_[_0x951e('0x43')](_0x37644d,function(_0x27a760){return _0x27a760['id']['toString']();});var _0xa8eb3d=_0x1a11f?_0x4ecd9b:_['difference'](_0x4ecd9b,_0x16137b);var _0x4d4b5f=_['intersection'](_0x4ecd9b,_0x16137b);var _0x53464d=_['difference'](_0x16137b,_0x4ecd9b);var _0xc67d20;var _0x5e0136;for(_0xc67d20=0x0;_0xc67d20<_0x53464d[_0x951e('0x44')]&&!_0x1a11f;_0xc67d20+=0x1){_0x5e0136=_0x53464d[_0xc67d20][_0x951e('0x42')]();if(manager['exists'](_0x5e0136)){manager[_0x951e('0x45')](_0x5e0136);manager[_0x951e('0x46')](_0x5e0136);logger[_0x951e('0xb')](_0x951e('0x47'),_0x5e0136);}}logger[_0x951e('0xb')](_0x951e('0x48'),JSON[_0x951e('0x28')](_0xa8eb3d));for(_0xc67d20=0x0;_0xc67d20<_0xa8eb3d[_0x951e('0x44')];_0xc67d20+=0x1){_0x5e0136=_0xa8eb3d[_0xc67d20][_0x951e('0x42')]();logger[_0x951e('0xb')](_0x951e('0x49'),_0x5e0136);if(_0x1a11f){logger[_0x951e('0xb')](_0x951e('0x4a'),_0x1a11f);logger[_0x951e('0xb')](JSON['stringify'](_0x3fe770[_0x5e0136]));BPromise[_0x951e('0x4b')]()[_0x951e('0x2e')](handleJob(_0x3fe770[_0x5e0136]));logger['info'](_0x951e('0x4c'),_0x3fe770[_0x5e0136][_0x951e('0x1a')],_0x3fe770[_0x5e0136][_0x951e('0x4d')]);}else if(_0x3fe770[_0x5e0136]['cron']&&_0x3fe770[_0x5e0136][_0x951e('0x4e')]&&moment()['isBetween'](_0x3fe770[_0x5e0136][_0x951e('0x4f')],_0x3fe770[_0x5e0136][_0x951e('0x50')])){manager[_0x951e('0x51')](_0x5e0136,_0x3fe770[_0x5e0136][_0x951e('0x4d')],handleJob(_0x3fe770[_0x5e0136]));manager[_0x951e('0x52')](_0x5e0136);logger[_0x951e('0xb')](_0x951e('0x53'),_0x3fe770[_0x5e0136]['name'],_0x3fe770[_0x5e0136][_0x951e('0x4d')]);}else if(manager[_0x951e('0x54')](_0x5e0136)){manager[_0x951e('0x45')](_0x5e0136);manager[_0x951e('0x46')](_0x5e0136);logger[_0x951e('0xb')](_0x951e('0x55'),_0x3fe770[_0x5e0136][_0x951e('0x1a')],_0x3fe770[_0x5e0136]['cron']);}}for(_0xc67d20=0x0,_0x5e0136;_0xc67d20<_0x4d4b5f['length']&&!_0x1a11f;_0xc67d20+=0x1){_0x5e0136=_0x4d4b5f[_0xc67d20][_0x951e('0x42')]();if(manager['exists'](_0x5e0136)){if(_0x3fe770[_0x5e0136]['cron']&&_0x3fe770[_0x5e0136][_0x951e('0x4e')]&&moment()[_0x951e('0x56')](_0x3fe770[_0x5e0136][_0x951e('0x4f')],_0x3fe770[_0x5e0136]['endAt'])){manager[_0x951e('0x57')](_0x5e0136,_0x3fe770[_0x5e0136][_0x951e('0x4d')],handleJob(_0x3fe770[_0x5e0136]));logger[_0x951e('0xb')](_0x951e('0x58'),_0x3fe770[_0x5e0136][_0x951e('0x1a')],_0x3fe770[_0x5e0136][_0x951e('0x4d')]);}else{manager['stop'](_0x5e0136);manager[_0x951e('0x46')](_0x5e0136);logger[_0x951e('0xb')](_0x951e('0x55'),_0x3fe770[_0x5e0136][_0x951e('0x1a')],_0x3fe770[_0x5e0136][_0x951e('0x4d')]);}}}})[_0x951e('0x32')](function(_0x12d6ff){logger[_0x951e('0x2f')](JSON[_0x951e('0x28')](_0x12d6ff));});}exports[_0x951e('0x59')]=function(_0x27f35c){return getJobs(_0x27f35c);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0xd69e=['email\x20sent','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','catch','CustomReportId','exec\x20custom\x20report\x20id:%s','findAll','MailServerOut','keys','jobs','map','toString','keyBy','difference','intersection','length','exists','deleteJob','delete\x20cron','toRun','index','my\x20id','resolve','run\x20job','cron','startAt','start','add\x20cron','stop','active','isBetween','endAt','update','update\x20cron','stop\x20cron','util','path','moment','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','http','info','Try\x20to\x20send\x20a\x20mail\x20to','MailAccount','Smtp','host','port','secure','auth','user','pass','format','\x22%s\x22\x20<%s>','name','email','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','%s.%s','basename','zip','existsSync','Sent','message','attachments','text','stringify','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','empty\x20file,\x20email\x20not\x20sent','request','then','error','error\x20mail'];(function(_0x394c87,_0x1d7a31){var _0x1254c8=function(_0x42b6c4){while(--_0x42b6c4){_0x394c87['push'](_0x394c87['shift']());}};_0x1254c8(++_0x1d7a31);}(_0xd69e,0xe2));var _0xed69=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0xd69e[_0x40220a];return _0x3903cc;};'use strict';var fs=require('fs');var util=require(_0xed69('0x0'));var path=require(_0xed69('0x1'));var _=require('lodash');var moment=require(_0xed69('0x2'));var CronJobManager=require(_0xed69('0x3'));var jayson=require(_0xed69('0x4'));var BPromise=require(_0xed69('0x5'));var logger=require(_0xed69('0x6'))(_0xed69('0x7'));var db=require(_0xed69('0x8'))['db'];var analyticCustomReportController=require(_0xed69('0x9'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson['client'][_0xed69('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x150542,_0x36c59d){return function(){logger[_0xed69('0xb')](_0xed69('0xc'),_0x150542['email']);var _0x531b59=!![];var _0x1b6116={'tls':{'rejectUnauthorized':![]}};if(_0x150542[_0xed69('0xd')][_0xed69('0xe')]['service']){_0x1b6116['service']=_0x150542[_0xed69('0xd')][_0xed69('0xe')]['service'];}else{_0x1b6116[_0xed69('0xf')]=_0x150542[_0xed69('0xd')]['Smtp'][_0xed69('0xf')];_0x1b6116[_0xed69('0x10')]=_0x150542[_0xed69('0xd')][_0xed69('0xe')][_0xed69('0x10')];_0x1b6116[_0xed69('0x11')]=_0x150542[_0xed69('0xd')][_0xed69('0xe')][_0xed69('0x11')];}if(_0x150542['MailAccount'][_0xed69('0xe')]['authentication']){_0x1b6116[_0xed69('0x12')]={'user':_0x150542[_0xed69('0xd')]['Smtp'][_0xed69('0x13')],'pass':_0x150542['MailAccount']['Smtp'][_0xed69('0x14')]};}var _0x191d9a={'account':_0x1b6116,'message':{'from':util[_0xed69('0x15')](_0xed69('0x16'),_0x150542[_0xed69('0xd')][_0xed69('0x17')],_0x150542[_0xed69('0xd')]['email']||_0x150542[_0xed69('0xd')]['Smtp'][_0xed69('0x13')]),'to':_0x150542[_0xed69('0x18')],'cc':_0x150542['cc'],'bcc':_0x150542[_0xed69('0x19')],'subject':util[_0xed69('0x15')](_0xed69('0x1a'),_0x36c59d['name'],_0x150542[_0xed69('0x1b')],_0x150542[_0xed69('0x1c')])}};var _0x1cd167=path[_0xed69('0x1d')](__dirname,_0xed69('0x1e'));var _0x48f5a3=_0x36c59d[_0xed69('0x1f')];var _0xe2cc8e=util[_0xed69('0x15')](_0xed69('0x20'),path[_0xed69('0x21')](_0x36c59d[_0xed69('0x1f')],path['extname'](_0x36c59d[_0xed69('0x1f')])),_0xed69('0x22'));var _0x22fe39=path['join'](_0x1cd167,_0x48f5a3);var _0x17971e=path[_0xed69('0x1d')](_0x1cd167,_0xe2cc8e);if(fs[_0xed69('0x23')](_0x22fe39)){_0x36c59d['status']=_0xed69('0x24');_0x191d9a[_0xed69('0x25')][_0xed69('0x26')]=[{'filename':_0x48f5a3,'path':_0x22fe39}];_0x191d9a[_0xed69('0x25')][_0xed69('0x27')]=util['format']('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON[_0xed69('0x28')](_0x36c59d,null,0x2));}else if(fs['existsSync'](_0x17971e)){_0x36c59d['status']='Sent';_0x191d9a[_0xed69('0x25')][_0xed69('0x26')]=[{'filename':_0xe2cc8e,'path':_0x17971e}];}else{_0x191d9a[_0xed69('0x25')][_0xed69('0x27')]=_0xed69('0x29');if(!_0x150542['sendIfEmpty']){_0x531b59=![];logger[_0xed69('0xb')](_0xed69('0x2a'));}}if(_0x531b59){return client[_0xed69('0x2b')]('SendMail',_0x191d9a)[_0xed69('0x2c')](function(_0x4623cf){if(_0x4623cf[_0xed69('0x2d')]){return logger[_0xed69('0x2d')](_0xed69('0x2e'),JSON['stringify'](_0x4623cf));}return logger[_0xed69('0xb')](_0xed69('0x2f'));})['catch'](function(_0x36e51a){return logger[_0xed69('0x2d')](_0xed69('0x2e'),JSON[_0xed69('0x28')](_0x36e51a));});}};}function handleError(){return function(_0x2ba461){return logger[_0xed69('0x2d')](JSON[_0xed69('0x28')](_0x2ba461));};}function handleResult(_0x9f65b8){return function(_0x3564ed){logger[_0xed69('0xb')](_0xed69('0x30'),JSON[_0xed69('0x28')](_0x3564ed));if(_0x9f65b8[_0xed69('0xd')]&&_0x9f65b8[_0xed69('0xd')][_0xed69('0xe')]&&!_[_0xed69('0x31')](_0x9f65b8[_0xed69('0x18')])){setTimeout(handleSendEmail(_0x9f65b8,_0x3564ed),0x3c*0x3e8);}};}function handleJob(_0x183020){return function(){try{if(_[_0xed69('0x31')](_0x183020[_0xed69('0x1b')])){return logger[_0xed69('0xb')](_0xed69('0x32'));}if(_[_0xed69('0x31')](_0x183020['subtractUnit'])){return logger[_0xed69('0xb')](_0xed69('0x33'));}var _0x53939e={'startDate':moment()[_0xed69('0x34')](_0x183020[_0xed69('0x1b')],_0x183020[_0xed69('0x1c')])[_0xed69('0x15')](_0xed69('0x35')),'endDate':moment()[_0xed69('0x15')](_0xed69('0x35')),'type':_0xed69('0x36'),'output':_0x183020[_0xed69('0x37')],'name':_0x183020['name']};if(!_[_0xed69('0x31')](_0x183020[_0xed69('0x38')])){logger[_0xed69('0xb')](_0xed69('0x39'),_0x183020[_0xed69('0x38')]);return analyticDefaultReportController[_0xed69('0x3a')]({'id':_0x183020[_0xed69('0x38')]},_0x53939e)[_0xed69('0x2c')](handleResult(_0x183020))[_0xed69('0x3b')](handleError());}if(!_[_0xed69('0x31')](_0x183020[_0xed69('0x3c')])){logger[_0xed69('0xb')](_0xed69('0x3d'),_0x183020[_0xed69('0x3c')]);return analyticCustomReportController['runReport']({'id':_0x183020[_0xed69('0x3c')]},_0x53939e)[_0xed69('0x2c')](handleResult(_0x183020))['catch'](handleError());}}catch(_0x41a734){logger['error'](JSON[_0xed69('0x28')](_0x41a734));}return logger[_0xed69('0xb')]('no\x20report\x20id');};}function getJobs(_0x2e81bd){var _0x416606={};if(_0x2e81bd){_0x416606['id']=_0x2e81bd;}return db['Schedule'][_0xed69('0x3e')]({'where':_0x416606,'include':[{'model':db['MailAccount'],'attributes':['id',_0xed69('0x17'),_0xed69('0x18')],'include':[{'model':db[_0xed69('0x3f')],'as':_0xed69('0xe')}]}]})[_0xed69('0x2c')](function(_0xeb4d9b){var _0x5c03d6=_[_0xed69('0x40')](manager[_0xed69('0x41')]);var _0xd3eb71=_[_0xed69('0x42')](_0xeb4d9b,function(_0x35b077){return _0x35b077['id'][_0xed69('0x43')]();});var _0x4f3108=_[_0xed69('0x44')](_0xeb4d9b,function(_0x2f342e){return _0x2f342e['id'][_0xed69('0x43')]();});var _0x3be4a9=_0x2e81bd?_0xd3eb71:_[_0xed69('0x45')](_0xd3eb71,_0x5c03d6);var _0x401ce4=_[_0xed69('0x46')](_0xd3eb71,_0x5c03d6);var _0x1e830d=_[_0xed69('0x45')](_0x5c03d6,_0xd3eb71);var _0x8bb6c;var _0x186f3b;for(_0x8bb6c=0x0;_0x8bb6c<_0x1e830d[_0xed69('0x47')]&&!_0x2e81bd;_0x8bb6c+=0x1){_0x186f3b=_0x1e830d[_0x8bb6c][_0xed69('0x43')]();if(manager[_0xed69('0x48')](_0x186f3b)){manager['stop'](_0x186f3b);manager[_0xed69('0x49')](_0x186f3b);logger[_0xed69('0xb')](_0xed69('0x4a'),_0x186f3b);}}logger[_0xed69('0xb')](_0xed69('0x4b'),JSON[_0xed69('0x28')](_0x3be4a9));for(_0x8bb6c=0x0;_0x8bb6c<_0x3be4a9[_0xed69('0x47')];_0x8bb6c+=0x1){_0x186f3b=_0x3be4a9[_0x8bb6c][_0xed69('0x43')]();logger[_0xed69('0xb')](_0xed69('0x4c'),_0x186f3b);if(_0x2e81bd){logger['info'](_0xed69('0x4d'),_0x2e81bd);logger[_0xed69('0xb')](JSON[_0xed69('0x28')](_0x4f3108[_0x186f3b]));BPromise[_0xed69('0x4e')]()[_0xed69('0x2c')](handleJob(_0x4f3108[_0x186f3b]));logger['info'](_0xed69('0x4f'),_0x4f3108[_0x186f3b][_0xed69('0x17')],_0x4f3108[_0x186f3b][_0xed69('0x50')]);}else if(_0x4f3108[_0x186f3b][_0xed69('0x50')]&&_0x4f3108[_0x186f3b]['active']&&moment()['isBetween'](_0x4f3108[_0x186f3b][_0xed69('0x51')],_0x4f3108[_0x186f3b]['endAt'])){manager['add'](_0x186f3b,_0x4f3108[_0x186f3b][_0xed69('0x50')],handleJob(_0x4f3108[_0x186f3b]));manager[_0xed69('0x52')](_0x186f3b);logger[_0xed69('0xb')](_0xed69('0x53'),_0x4f3108[_0x186f3b][_0xed69('0x17')],_0x4f3108[_0x186f3b][_0xed69('0x50')]);}else if(manager[_0xed69('0x48')](_0x186f3b)){manager[_0xed69('0x54')](_0x186f3b);manager[_0xed69('0x49')](_0x186f3b);logger['info']('stop\x20cron',_0x4f3108[_0x186f3b][_0xed69('0x17')],_0x4f3108[_0x186f3b][_0xed69('0x50')]);}}for(_0x8bb6c=0x0,_0x186f3b;_0x8bb6c<_0x401ce4[_0xed69('0x47')]&&!_0x2e81bd;_0x8bb6c+=0x1){_0x186f3b=_0x401ce4[_0x8bb6c][_0xed69('0x43')]();if(manager[_0xed69('0x48')](_0x186f3b)){if(_0x4f3108[_0x186f3b][_0xed69('0x50')]&&_0x4f3108[_0x186f3b][_0xed69('0x55')]&&moment()[_0xed69('0x56')](_0x4f3108[_0x186f3b][_0xed69('0x51')],_0x4f3108[_0x186f3b][_0xed69('0x57')])){manager[_0xed69('0x58')](_0x186f3b,_0x4f3108[_0x186f3b][_0xed69('0x50')],handleJob(_0x4f3108[_0x186f3b]));logger[_0xed69('0xb')](_0xed69('0x59'),_0x4f3108[_0x186f3b]['name'],_0x4f3108[_0x186f3b]['cron']);}else{manager['stop'](_0x186f3b);manager[_0xed69('0x49')](_0x186f3b);logger[_0xed69('0xb')](_0xed69('0x5a'),_0x4f3108[_0x186f3b]['name'],_0x4f3108[_0x186f3b]['cron']);}}}})[_0xed69('0x3b')](function(_0x5e23ad){logger['error'](JSON['stringify'](_0x5e23ad));});}exports['run']=function(_0x170b2f){return getJobs(_0x170b2f);};exports[_0xed69('0x52')]=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 59a0736..4ce3a34 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 _0x8efc=['transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','Sequelize','ValidationError','sentimentAccountId','language','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','sentimentRegion','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','SentimentScore','Positive','Mixed','Neutral','FAILED','FailureReason','resolve','tempSentiment','sentiment','Sentiment','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','bucket','transcribeAccountId','push','all','inspect','aws-sdk','request-promise','util','bluebird','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','[RECORDING:%d]\x20Get\x20transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length'];(function(_0x515629,_0x47a7bc){var _0x47b07d=function(_0xe3fa73){while(--_0xe3fa73){_0x515629['push'](_0x515629['shift']());}};_0x47b07d(++_0x47a7bc);}(_0x8efc,0xb3));var _0xc8ef=function(_0x4206f5,_0x21f338){_0x4206f5=_0x4206f5-0x0;var _0xa29cf3=_0x8efc[_0x4206f5];return _0xa29cf3;};var _=require('lodash');var AWS=require(_0xc8ef('0x0'));var rp=require(_0xc8ef('0x1'));var util=require(_0xc8ef('0x2'));var BPromise=require(_0xc8ef('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0xc8ef('0x4'))(_0xc8ef('0x5'));function getTranscriptionJob(_0x33b9c9,_0x50d1f6,_0x2910b5,_0x3c6189){return new Promise(function(_0x1cd466,_0x13b433){var _0x576ff9=new AWS[(_0xc8ef('0x6'))]({'accessKeyId':_0x50d1f6,'secretAccessKey':_0x33b9c9,'region':_0x2910b5});_0x576ff9[_0xc8ef('0x7')]({'TranscriptionJobName':_0x3c6189},function(_0x1c8931,_0x489778){if(_0x1c8931){return _0x13b433(_0x1c8931);}else{return _0x1cd466(_0x489778);}});});}function sentiment(_0x11f3ba,_0x443ee3,_0x1a9a5f,_0xcc3c21,_0x56cfb1){return new Promise(function(_0x315d93,_0x574588){var _0x45dbd3=new AWS[(_0xc8ef('0x8'))]({'accessKeyId':_0x443ee3,'secretAccessKey':_0x11f3ba,'region':_0x1a9a5f});_0x45dbd3[_0xc8ef('0x9')]({'Text':_0xcc3c21,'LanguageCode':_0x56cfb1[_0xc8ef('0xa')](0x0,0x2)},function(_0xa76b59,_0x44d7da){if(_0xa76b59){return _0x574588(_0xa76b59);}else{return _0x315d93(_0x44d7da);}});});}function checkTranscribeJob(_0x18213f,_0x1c6744,_0xb90ed0){var _0x15669b;return new BPromise(function(_0x3e7c04,_0x1207d8){logger[_0xc8ef('0xb')](util[_0xc8ef('0xc')](_0xc8ef('0xd'),_0x18213f['id'],_0x18213f[_0xc8ef('0xe')]));return getTranscriptionJob(_0xb90ed0[_0xc8ef('0xf')],_0xb90ed0[_0xc8ef('0x10')],_0x1c6744[_0xc8ef('0x11')],_0x18213f[_0xc8ef('0xe')])[_0xc8ef('0x12')](function(_0x45eb4b){logger['info'](util[_0xc8ef('0xc')](_0xc8ef('0x13'),_0x18213f['id'],_0x18213f[_0xc8ef('0xe')],_0x45eb4b[_0xc8ef('0x14')][_0xc8ef('0x15')]));if(!_0x18213f[_0xc8ef('0x16')]){switch(_0x45eb4b[_0xc8ef('0x14')][_0xc8ef('0x15')]){case _0xc8ef('0x17'):var _0x3591c={'transcribeStatus':_0x45eb4b['TranscriptionJob'][_0xc8ef('0x15')],'fileUri':_0x45eb4b['TranscriptionJob'][_0xc8ef('0x18')]['TranscriptFileUri']};logger[_0xc8ef('0xb')](util['format'](_0xc8ef('0x19'),_0x18213f['id']));return rp({'uri':_0x45eb4b[_0xc8ef('0x14')][_0xc8ef('0x18')][_0xc8ef('0x1a')],'json':!![]})[_0xc8ef('0x12')](function(_0x4c57e3){logger[_0xc8ef('0xb')](util[_0xc8ef('0xc')](_0xc8ef('0x1b'),_0x18213f['id']));if(_0x4c57e3&&_0x4c57e3['results']&&_0x4c57e3[_0xc8ef('0x1c')]['transcripts']&&_0x4c57e3['results']['transcripts']['length']){_0x3591c[_0xc8ef('0x16')]='';for(var _0x128556=0x0;_0x128556<_0x4c57e3[_0xc8ef('0x1c')][_0xc8ef('0x1d')][_0xc8ef('0x1e')];_0x128556++){_0x3591c[_0xc8ef('0x16')]+=_0x4c57e3[_0xc8ef('0x1c')][_0xc8ef('0x1d')][_0x128556][_0xc8ef('0x1f')]+'';}}return _0x18213f[_0xc8ef('0x20')](_0x3591c);})[_0xc8ef('0x12')](function(){logger[_0xc8ef('0xb')](util[_0xc8ef('0xc')](_0xc8ef('0x21'),_0x18213f['id']));if(!_0x18213f['tempSentiment']){throw new db[(_0xc8ef('0x22'))][(_0xc8ef('0x23'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x1c6744['sentiment']||!_0x1c6744[_0xc8ef('0x24')]||!_0x1c6744['sentimentRegion']||!_0x1c6744[_0xc8ef('0x25')]||!_0x1c6744['bucket']){throw new db[(_0xc8ef('0x22'))]['ValidationError'](_0xc8ef('0x26'));}if(!_0x3591c[_0xc8ef('0x16')]){throw new Error('Transcript\x20not\x20available');}if(_0x1c6744['sentimentAccountId']===_0xb90ed0['id']){return _0xb90ed0;}else{return db[_0xc8ef('0x27')][_0xc8ef('0x28')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0xc8ef('0x12')](function(_0x3bde31){if(!_0x3bde31){throw new db[(_0xc8ef('0x22'))][(_0xc8ef('0x23'))](_0xc8ef('0x29'));}if(!_0x3bde31[_0xc8ef('0xf')]||!_0x3bde31[_0xc8ef('0x10')]){throw new db[(_0xc8ef('0x22'))][(_0xc8ef('0x23'))](_0xc8ef('0x2a'));}_0x15669b=_0x3bde31;logger[_0xc8ef('0xb')](util[_0xc8ef('0xc')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x18213f['id']));return sentiment(_0x15669b[_0xc8ef('0xf')],_0x15669b[_0xc8ef('0x10')],_0x1c6744[_0xc8ef('0x2b')],_0x3591c[_0xc8ef('0x16')],_0x1c6744['language']);})[_0xc8ef('0x12')](function(_0x1890de){logger['info'](util[_0xc8ef('0xc')](_0xc8ef('0x2c'),_0x18213f['id']));return _0x18213f['update']({'sentiment':_0x1890de['Sentiment'],'sPositive':_0x1890de[_0xc8ef('0x2d')][_0xc8ef('0x2e')],'sNegative':_0x1890de[_0xc8ef('0x2d')]['Negative'],'sMixed':_0x1890de['SentimentScore'][_0xc8ef('0x2f')],'sNeutral':_0x1890de[_0xc8ef('0x2d')][_0xc8ef('0x30')]});})[_0xc8ef('0x12')](function(){logger[_0xc8ef('0xb')](util['format'](_0xc8ef('0x21'),_0x18213f['id']));_0x3e7c04();});case _0xc8ef('0x31'):return _0x18213f[_0xc8ef('0x20')]({'transcribeStatus':_0xc8ef('0x31'),'failureReason':_0x45eb4b[_0xc8ef('0x14')][_0xc8ef('0x32')]})['then'](function(){logger[_0xc8ef('0xb')](util[_0xc8ef('0xc')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x18213f['id']));_0x3e7c04();});default:logger['info'](util['format']('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x18213f['id']));break;}}else{return BPromise[_0xc8ef('0x33')]()['then'](function(){if(!_0x18213f[_0xc8ef('0x34')]){throw new db[(_0xc8ef('0x22'))][(_0xc8ef('0x23'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x1c6744[_0xc8ef('0x35')]||!_0x1c6744[_0xc8ef('0x24')]||!_0x1c6744[_0xc8ef('0x2b')]||!_0x1c6744[_0xc8ef('0x25')]||!_0x1c6744['bucket']){throw new db[(_0xc8ef('0x22'))][(_0xc8ef('0x23'))](_0xc8ef('0x26'));}if(!_0x18213f[_0xc8ef('0x16')]){throw new Error('Transcript\x20not\x20available');}if(_0x1c6744['sentimentAccountId']===_0xb90ed0['id']){return _0xb90ed0;}else{return db[_0xc8ef('0x27')][_0xc8ef('0x28')]({'where':{'id':_settings[_0xc8ef('0x24')]}});}})[_0xc8ef('0x12')](function(_0x351109){if(!_0x351109){throw new db['Sequelize']['ValidationError'](_0xc8ef('0x29'));}if(!_0x351109['data1']||!_0x351109[_0xc8ef('0x10')]){throw new db[(_0xc8ef('0x22'))][(_0xc8ef('0x23'))]('Cloud\x20Provider\x20not\x20configured');}_0x15669b=_0x351109;logger[_0xc8ef('0xb')](util[_0xc8ef('0xc')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x18213f['id']));return sentiment(_0x15669b[_0xc8ef('0xf')],_0x15669b['data2'],_0x1c6744[_0xc8ef('0x2b')],_0x18213f[_0xc8ef('0x16')],_0x1c6744[_0xc8ef('0x25')]);})['then'](function(_0x5b1ef1){logger['info'](util[_0xc8ef('0xc')](_0xc8ef('0x2c'),_0x18213f['id']));return _0x18213f[_0xc8ef('0x20')]({'sentiment':_0x5b1ef1[_0xc8ef('0x36')],'sPositive':_0x5b1ef1[_0xc8ef('0x2d')][_0xc8ef('0x2e')],'sNegative':_0x5b1ef1[_0xc8ef('0x2d')]['Negative'],'sMixed':_0x5b1ef1['SentimentScore'][_0xc8ef('0x2f')],'sNeutral':_0x5b1ef1[_0xc8ef('0x2d')][_0xc8ef('0x30')],'transcribeStatus':_0xc8ef('0x17')});})[_0xc8ef('0x12')](function(){logger['info'](util[_0xc8ef('0xc')](_0xc8ef('0x21'),_0x18213f['id']));_0x3e7c04();});}})[_0xc8ef('0x37')](function(_0xc932df){if(_0xc932df){if(!_0xc932df['name']||_0xc932df[_0xc8ef('0x38')]!==_0xc8ef('0x39')){logger[_0xc8ef('0x3a')](util['format'](_0xc8ef('0x3b'),_0x18213f['id']),util['inspect'](_0xc932df,{'showHidden':![],'depth':null}));}}_0x3e7c04();});});}function checkTranscribe(){var _0x7e5c5a;var _0x52eac7;var _0x3dbb7a;return db[_0xc8ef('0x3c')][_0xc8ef('0x3d')]({'where':{'transcribeStatus':_0xc8ef('0x3e')}})[_0xc8ef('0x12')](function(_0x3e0398){if(!_0x3e0398||!_0x3e0398[_0xc8ef('0x1e')]){throw new db[(_0xc8ef('0x22'))]['ValidationError'](_0xc8ef('0x3f'));}_0x7e5c5a=_0x3e0398;return db[_0xc8ef('0x40')]['findOne']({'where':{'id':0x1}});})['then'](function(_0xe997a){if(!_0xe997a){throw new db['Sequelize'][(_0xc8ef('0x23'))]('Settings\x20not\x20available');}_0x52eac7=_0xe997a;if(!_0x52eac7[_0xc8ef('0x5')]||!_0x52eac7['transcribeAccountId']||!_0x52eac7[_0xc8ef('0x11')]||!_0x52eac7[_0xc8ef('0x25')]||!_0x52eac7[_0xc8ef('0x41')]){throw new db[(_0xc8ef('0x22'))][(_0xc8ef('0x23'))]('Transcribe\x20not\x20configured');}return db[_0xc8ef('0x27')][_0xc8ef('0x28')]({'where':{'id':_0x52eac7[_0xc8ef('0x42')]}});})[_0xc8ef('0x12')](function(_0x1b460a){if(!_0x1b460a){throw new db[(_0xc8ef('0x22'))]['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x1b460a[_0xc8ef('0xf')]||!_0x1b460a[_0xc8ef('0x10')]){throw new db['Sequelize']['ValidationError'](_0xc8ef('0x2a'));}_0x3dbb7a=_0x1b460a;var _0x1cfab1=[];_0x7e5c5a['forEach'](function(_0x479742){_0x1cfab1[_0xc8ef('0x43')](checkTranscribeJob(_0x479742,_0x52eac7,_0x3dbb7a));});return BPromise[_0xc8ef('0x44')](_0x1cfab1);})[_0xc8ef('0x37')](function(_0xb58103){if(_0xb58103){if(!_0xb58103[_0xc8ef('0x38')]||_0xb58103['name']!==_0xc8ef('0x39')){logger[_0xc8ef('0x3a')](util[_0xc8ef('0x45')](_0xb58103,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0xdac7=['data2','Negative','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Transcribe\x20not\x20configured','transcribeAccountId','forEach','push','all','inspect','start','lodash','aws-sdk','../../mysqldb','../../config/logger','transcribe','TranscribeService','Comprehend','detectSentiment','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','transcribeRegion','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJobStatus','TranscriptionJob','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','fileText','transcript','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','then','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Mixed','Neutral','update','FailureReason','resolve','bucket','Transcript\x20not\x20available'];(function(_0x2e9e17,_0x22ae96){var _0xb33267=function(_0x4c4ec6){while(--_0x4c4ec6){_0x2e9e17['push'](_0x2e9e17['shift']());}};_0xb33267(++_0x22ae96);}(_0xdac7,0x180));var _0x7dac=function(_0x4d53b1,_0x5ea570){_0x4d53b1=_0x4d53b1-0x0;var _0x56a24b=_0xdac7[_0x4d53b1];return _0x56a24b;};var _=require(_0x7dac('0x0'));var AWS=require(_0x7dac('0x1'));var rp=require('request-promise');var util=require('util');var BPromise=require('bluebird');var db=require(_0x7dac('0x2'))['db'];var logger=require(_0x7dac('0x3'))(_0x7dac('0x4'));function getTranscriptionJob(_0x3c4806,_0x56d2ac,_0x4f55eb,_0x4987d1){return new Promise(function(_0x17a05f,_0x2557ee){var _0x505705=new AWS[(_0x7dac('0x5'))]({'accessKeyId':_0x56d2ac,'secretAccessKey':_0x3c4806,'region':_0x4f55eb});_0x505705['getTranscriptionJob']({'TranscriptionJobName':_0x4987d1},function(_0x3b319f,_0x5ccf75){if(_0x3b319f){return _0x2557ee(_0x3b319f);}else{return _0x17a05f(_0x5ccf75);}});});}function sentiment(_0x8746d9,_0x19eaa4,_0x45fbdc,_0x43f23f,_0x11b680){return new Promise(function(_0x2b552f,_0x27eb87){var _0x41e0db=new AWS[(_0x7dac('0x6'))]({'accessKeyId':_0x19eaa4,'secretAccessKey':_0x8746d9,'region':_0x45fbdc});_0x41e0db[_0x7dac('0x7')]({'Text':_0x43f23f,'LanguageCode':_0x11b680['substring'](0x0,0x2)},function(_0x4e3a47,_0x4d4625){if(_0x4e3a47){return _0x27eb87(_0x4e3a47);}else{return _0x2b552f(_0x4d4625);}});});}function checkTranscribeJob(_0x28f4bc,_0x5dd35a,_0x42fbe3){var _0x4e5e65;return new BPromise(function(_0x2413ee,_0x22e197){logger[_0x7dac('0x8')](util[_0x7dac('0x9')](_0x7dac('0xa'),_0x28f4bc['id'],_0x28f4bc[_0x7dac('0xb')]));return getTranscriptionJob(_0x42fbe3[_0x7dac('0xc')],_0x42fbe3['data2'],_0x5dd35a[_0x7dac('0xd')],_0x28f4bc['transcribeName'])['then'](function(_0x218a2a){logger[_0x7dac('0x8')](util[_0x7dac('0x9')](_0x7dac('0xe'),_0x28f4bc['id'],_0x28f4bc[_0x7dac('0xb')],_0x218a2a['TranscriptionJob'][_0x7dac('0xf')]));if(!_0x28f4bc['fileText']){switch(_0x218a2a[_0x7dac('0x10')][_0x7dac('0xf')]){case _0x7dac('0x11'):var _0x1ddde7={'transcribeStatus':_0x218a2a[_0x7dac('0x10')][_0x7dac('0xf')],'fileUri':_0x218a2a[_0x7dac('0x10')][_0x7dac('0x12')][_0x7dac('0x13')]};logger[_0x7dac('0x8')](util[_0x7dac('0x9')](_0x7dac('0x14'),_0x28f4bc['id']));return rp({'uri':_0x218a2a[_0x7dac('0x10')][_0x7dac('0x12')]['TranscriptFileUri'],'json':!![]})['then'](function(_0x12cd84){logger['info'](util[_0x7dac('0x9')](_0x7dac('0x15'),_0x28f4bc['id']));if(_0x12cd84&&_0x12cd84['results']&&_0x12cd84[_0x7dac('0x16')][_0x7dac('0x17')]&&_0x12cd84['results'][_0x7dac('0x17')][_0x7dac('0x18')]){_0x1ddde7[_0x7dac('0x19')]='';for(var _0x179881=0x0;_0x179881<_0x12cd84[_0x7dac('0x16')][_0x7dac('0x17')][_0x7dac('0x18')];_0x179881++){_0x1ddde7['fileText']+=_0x12cd84[_0x7dac('0x16')][_0x7dac('0x17')][_0x179881][_0x7dac('0x1a')]+'';}}return _0x28f4bc['update'](_0x1ddde7);})['then'](function(){logger[_0x7dac('0x8')](util[_0x7dac('0x9')](_0x7dac('0x1b'),_0x28f4bc['id']));if(!_0x28f4bc[_0x7dac('0x1c')]){throw new db[(_0x7dac('0x1d'))][(_0x7dac('0x1e'))](_0x7dac('0x1f'));}if(!_0x5dd35a[_0x7dac('0x20')]||!_0x5dd35a[_0x7dac('0x21')]||!_0x5dd35a[_0x7dac('0x22')]||!_0x5dd35a[_0x7dac('0x23')]||!_0x5dd35a['bucket']){throw new db['Sequelize'][(_0x7dac('0x1e'))](_0x7dac('0x24'));}if(!_0x1ddde7[_0x7dac('0x19')]){throw new Error('Transcript\x20not\x20available');}if(_0x5dd35a[_0x7dac('0x21')]===_0x42fbe3['id']){return _0x42fbe3;}else{return db[_0x7dac('0x25')][_0x7dac('0x26')]({'where':{'id':_settings[_0x7dac('0x21')]}});}})['then'](function(_0x282e3d){if(!_0x282e3d){throw new db['Sequelize'][(_0x7dac('0x1e'))](_0x7dac('0x27'));}if(!_0x282e3d[_0x7dac('0xc')]||!_0x282e3d['data2']){throw new db[(_0x7dac('0x1d'))][(_0x7dac('0x1e'))](_0x7dac('0x28'));}_0x4e5e65=_0x282e3d;logger[_0x7dac('0x8')](util[_0x7dac('0x9')](_0x7dac('0x29'),_0x28f4bc['id']));return sentiment(_0x4e5e65['data1'],_0x4e5e65['data2'],_0x5dd35a['sentimentRegion'],_0x1ddde7[_0x7dac('0x19')],_0x5dd35a[_0x7dac('0x23')]);})[_0x7dac('0x2a')](function(_0x4ec055){logger[_0x7dac('0x8')](util[_0x7dac('0x9')](_0x7dac('0x2b'),_0x28f4bc['id']));return _0x28f4bc['update']({'sentiment':_0x4ec055[_0x7dac('0x2c')],'sPositive':_0x4ec055[_0x7dac('0x2d')][_0x7dac('0x2e')],'sNegative':_0x4ec055[_0x7dac('0x2d')]['Negative'],'sMixed':_0x4ec055[_0x7dac('0x2d')][_0x7dac('0x2f')],'sNeutral':_0x4ec055[_0x7dac('0x2d')][_0x7dac('0x30')]});})[_0x7dac('0x2a')](function(){logger[_0x7dac('0x8')](util['format'](_0x7dac('0x1b'),_0x28f4bc['id']));_0x2413ee();});case'FAILED':return _0x28f4bc[_0x7dac('0x31')]({'transcribeStatus':'FAILED','failureReason':_0x218a2a[_0x7dac('0x10')][_0x7dac('0x32')]})[_0x7dac('0x2a')](function(){logger[_0x7dac('0x8')](util[_0x7dac('0x9')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x28f4bc['id']));_0x2413ee();});default:logger['info'](util[_0x7dac('0x9')]('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x28f4bc['id']));break;}}else{return BPromise[_0x7dac('0x33')]()[_0x7dac('0x2a')](function(){if(!_0x28f4bc[_0x7dac('0x1c')]){throw new db[(_0x7dac('0x1d'))][(_0x7dac('0x1e'))](_0x7dac('0x1f'));}if(!_0x5dd35a['sentiment']||!_0x5dd35a['sentimentAccountId']||!_0x5dd35a[_0x7dac('0x22')]||!_0x5dd35a[_0x7dac('0x23')]||!_0x5dd35a[_0x7dac('0x34')]){throw new db[(_0x7dac('0x1d'))][(_0x7dac('0x1e'))](_0x7dac('0x24'));}if(!_0x28f4bc['fileText']){throw new Error(_0x7dac('0x35'));}if(_0x5dd35a[_0x7dac('0x21')]===_0x42fbe3['id']){return _0x42fbe3;}else{return db[_0x7dac('0x25')][_0x7dac('0x26')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0x7dac('0x2a')](function(_0x53e093){if(!_0x53e093){throw new db[(_0x7dac('0x1d'))][(_0x7dac('0x1e'))](_0x7dac('0x27'));}if(!_0x53e093[_0x7dac('0xc')]||!_0x53e093[_0x7dac('0x36')]){throw new db[(_0x7dac('0x1d'))]['ValidationError'](_0x7dac('0x28'));}_0x4e5e65=_0x53e093;logger[_0x7dac('0x8')](util[_0x7dac('0x9')](_0x7dac('0x29'),_0x28f4bc['id']));return sentiment(_0x4e5e65[_0x7dac('0xc')],_0x4e5e65[_0x7dac('0x36')],_0x5dd35a[_0x7dac('0x22')],_0x28f4bc[_0x7dac('0x19')],_0x5dd35a[_0x7dac('0x23')]);})[_0x7dac('0x2a')](function(_0x378bb5){logger['info'](util['format'](_0x7dac('0x2b'),_0x28f4bc['id']));return _0x28f4bc[_0x7dac('0x31')]({'sentiment':_0x378bb5['Sentiment'],'sPositive':_0x378bb5[_0x7dac('0x2d')][_0x7dac('0x2e')],'sNegative':_0x378bb5[_0x7dac('0x2d')][_0x7dac('0x37')],'sMixed':_0x378bb5[_0x7dac('0x2d')]['Mixed'],'sNeutral':_0x378bb5[_0x7dac('0x2d')][_0x7dac('0x30')],'transcribeStatus':'COMPLETED'});})[_0x7dac('0x2a')](function(){logger[_0x7dac('0x8')](util['format'](_0x7dac('0x1b'),_0x28f4bc['id']));_0x2413ee();});}})[_0x7dac('0x38')](function(_0x1d860b){if(_0x1d860b){if(!_0x1d860b[_0x7dac('0x39')]||_0x1d860b[_0x7dac('0x39')]!==_0x7dac('0x3a')){logger[_0x7dac('0x3b')](util[_0x7dac('0x9')](_0x7dac('0x3c'),_0x28f4bc['id']),util['inspect'](_0x1d860b,{'showHidden':![],'depth':null}));}}_0x2413ee();});});}function checkTranscribe(){var _0x2d2c8b;var _0xe61204;var _0x49804d;return db[_0x7dac('0x3d')][_0x7dac('0x3e')]({'where':{'transcribeStatus':_0x7dac('0x3f')}})[_0x7dac('0x2a')](function(_0x3cd7a9){if(!_0x3cd7a9||!_0x3cd7a9[_0x7dac('0x18')]){throw new db[(_0x7dac('0x1d'))][(_0x7dac('0x1e'))](_0x7dac('0x40'));}_0x2d2c8b=_0x3cd7a9;return db[_0x7dac('0x41')][_0x7dac('0x26')]({'where':{'id':0x1}});})[_0x7dac('0x2a')](function(_0x1da157){if(!_0x1da157){throw new db[(_0x7dac('0x1d'))][(_0x7dac('0x1e'))]('Settings\x20not\x20available');}_0xe61204=_0x1da157;if(!_0xe61204[_0x7dac('0x4')]||!_0xe61204['transcribeAccountId']||!_0xe61204[_0x7dac('0xd')]||!_0xe61204[_0x7dac('0x23')]||!_0xe61204['bucket']){throw new db[(_0x7dac('0x1d'))][(_0x7dac('0x1e'))](_0x7dac('0x42'));}return db['CloudProvider'][_0x7dac('0x26')]({'where':{'id':_0xe61204[_0x7dac('0x43')]}});})[_0x7dac('0x2a')](function(_0x33909c){if(!_0x33909c){throw new db[(_0x7dac('0x1d'))]['ValidationError'](_0x7dac('0x27'));}if(!_0x33909c[_0x7dac('0xc')]||!_0x33909c['data2']){throw new db[(_0x7dac('0x1d'))][(_0x7dac('0x1e'))](_0x7dac('0x28'));}_0x49804d=_0x33909c;var _0x5cd59c=[];_0x2d2c8b[_0x7dac('0x44')](function(_0x1d7739){_0x5cd59c[_0x7dac('0x45')](checkTranscribeJob(_0x1d7739,_0xe61204,_0x49804d));});return BPromise[_0x7dac('0x46')](_0x5cd59c);})[_0x7dac('0x38')](function(_0x3b71fb){if(_0x3b71fb){if(!_0x3b71fb[_0x7dac('0x39')]||_0x3b71fb['name']!=='SequelizeValidationError'){logger['error'](util[_0x7dac('0x47')](_0x3b71fb,{'showHidden':![],'depth':null}));}}});}exports[_0x7dac('0x48')]=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 b822dcc..5a8a406 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 _0xb835=['../../mysqldb','../logger','schedule','redis','localhost','socket.io-emitter','WhatsappInteraction','subtract','hours','then','length','map','[WHATSAPP]\x20Interactions\x20to\x20close:','update','timeout','format','YYYY-MM-DD\x20HH:mm:ss','info','join','emit','whatsappInteraction:update','catch','error','inspect','start','lodash','moment','ioredis','util','../../config/environment'];(function(_0x4e1d2d,_0x5a44e1){var _0x520f96=function(_0x432d2d){while(--_0x432d2d){_0x4e1d2d['push'](_0x4e1d2d['shift']());}};_0x520f96(++_0x5a44e1);}(_0xb835,0xcd));var _0x5b83=function(_0x40ced3,_0x54b6e5){_0x40ced3=_0x40ced3-0x0;var _0x78a9ec=_0xb835[_0x40ced3];return _0x78a9ec;};'use strict';var _=require(_0x5b83('0x0'));var moment=require(_0x5b83('0x1'));var Redis=require(_0x5b83('0x2'));var util=require(_0x5b83('0x3'));var config=require(_0x5b83('0x4'));var db=require(_0x5b83('0x5'))['db'];var logger=require(_0x5b83('0x6'))(_0x5b83('0x7'));config[_0x5b83('0x8')]=_['defaults'](config['redis'],{'host':_0x5b83('0x9'),'port':0x18eb});var io=require(_0x5b83('0xa'))(new Redis(config['redis']));function closeInteractions(){var _0x42119b=[];return db[_0x5b83('0xb')]['findAll']({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x5b83('0xc')](0x18,_0x5b83('0xd'))}}})[_0x5b83('0xe')](function(_0x333220){if(_0x333220&&_0x333220[_0x5b83('0xf')]){_0x42119b=_[_0x5b83('0x10')](_0x333220||[],'id');logger['info'](_0x5b83('0x11'),_0x42119b['join']());return db[_0x5b83('0xb')][_0x5b83('0x12')]({'closeReason':'system','disposition':_0x5b83('0x13'),'closed':!![],'closedAt':moment()[_0x5b83('0x14')](_0x5b83('0x15'))},{'where':{'id':_0x42119b}});}})[_0x5b83('0xe')](function(){if(_0x42119b&&_0x42119b[_0x5b83('0xf')]){logger[_0x5b83('0x16')]('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x42119b[_0x5b83('0x17')]());for(var _0x2a8f2a=0x0;_0x2a8f2a<_0x42119b[_0x5b83('0xf')];_0x2a8f2a++){io[_0x5b83('0x18')](_0x5b83('0x19'),{'id':_0x42119b[_0x2a8f2a],'closed':!![]});}}})[_0x5b83('0x1a')](function(_0x425c99){logger[_0x5b83('0x1b')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x425c99?util[_0x5b83('0x1c')](_0x425c99,{'showHidden':![],'depth':null}):'');});}exports[_0x5b83('0x1d')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x7e14=['lastMsgAt','subtract','hours','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','lodash','moment','ioredis','util','../../config/environment','../logger','schedule','redis','defaults','socket.io-emitter','WhatsappInteraction','findAll'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7e14,0x174));var _0x47e1=function(_0x31dc6b,_0x404b0d){_0x31dc6b=_0x31dc6b-0x0;var _0x162f8c=_0x7e14[_0x31dc6b];return _0x162f8c;};'use strict';var _=require(_0x47e1('0x0'));var moment=require(_0x47e1('0x1'));var Redis=require(_0x47e1('0x2'));var util=require(_0x47e1('0x3'));var config=require(_0x47e1('0x4'));var db=require('../../mysqldb')['db'];var logger=require(_0x47e1('0x5'))(_0x47e1('0x6'));config[_0x47e1('0x7')]=_[_0x47e1('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x47e1('0x9'))(new Redis(config[_0x47e1('0x7')]));function closeInteractions(){var _0x196b2b=[];return db[_0x47e1('0xa')][_0x47e1('0xb')]({'raw':!![],'attributes':['id',_0x47e1('0xc')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x47e1('0xd')](0x18,_0x47e1('0xe'))}}})[_0x47e1('0xf')](function(_0x244b45){if(_0x244b45&&_0x244b45[_0x47e1('0x10')]){_0x196b2b=_[_0x47e1('0x11')](_0x244b45||[],'id');logger[_0x47e1('0x12')](_0x47e1('0x13'),_0x196b2b[_0x47e1('0x14')]());return db[_0x47e1('0xa')][_0x47e1('0x15')]({'closeReason':_0x47e1('0x16'),'disposition':_0x47e1('0x17'),'closed':!![],'closedAt':moment()['format'](_0x47e1('0x18'))},{'where':{'id':_0x196b2b}});}})[_0x47e1('0xf')](function(){if(_0x196b2b&&_0x196b2b[_0x47e1('0x10')]){logger[_0x47e1('0x12')](_0x47e1('0x19'),_0x196b2b[_0x47e1('0x14')]());for(var _0x1006cb=0x0;_0x1006cb<_0x196b2b['length'];_0x1006cb++){io[_0x47e1('0x1a')](_0x47e1('0x1b'),{'id':_0x196b2b[_0x1006cb],'closed':!![]});}}})[_0x47e1('0x1c')](function(_0x369a12){logger[_0x47e1('0x1d')](_0x47e1('0x1e'),_0x369a12?util[_0x47e1('0x1f')](_0x369a12,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index be03f7a..b163f5e 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2c63=['CmHopper','bulkCreate','log','hopper1','contacts2','hopper2','util','../mysqldb','Biondo','innocenzo.biondo','push','now','Innocenzo','@xcally.com','CmContact','destroy','then','finished\x20populating'];(function(_0x4fbde2,_0x364951){var _0x2bce29=function(_0x3a97c9){while(--_0x3a97c9){_0x4fbde2['push'](_0x4fbde2['shift']());}};_0x2bce29(++_0x364951);}(_0x2c63,0x15c));var _0x32c6=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x2c63[_0x465a0c];return _0x1e202e;};'use strict';var util=require(_0x32c6('0x0'));var db=require(_0x32c6('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x32c6('0x2')+i,'phone':0xf879fb460+i,'email':_0x32c6('0x3')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x32c6('0x4')]({'id':i,'active':![],'scheduledat':Date[_0x32c6('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x32c6('0x5')](),'updatedAt':Date[_0x32c6('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x32c6('0x4')]({'id':i,'firstName':_0x32c6('0x6')+i,'lastName':_0x32c6('0x2')+i,'phone':0xf879fb460+i,'email':_0x32c6('0x3')+i+_0x32c6('0x7')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x32c6('0x5')](),'updatedAt':Date['now']()});}db[_0x32c6('0x8')][_0x32c6('0x9')]({'where':{}})['then'](function(){return db[_0x32c6('0x8')]['bulkCreate'](contacts);})[_0x32c6('0xa')](function(){console['log'](_0x32c6('0xb'),'contacts1');return db[_0x32c6('0xc')][_0x32c6('0x9')]({'where':{}});})[_0x32c6('0xa')](function(){return db['CmHopper'][_0x32c6('0xd')](hopper);})[_0x32c6('0xa')](function(){console[_0x32c6('0xe')]('finished\x20populating',_0x32c6('0xf'));return db[_0x32c6('0x8')][_0x32c6('0xd')](contacts2);})[_0x32c6('0xa')](function(){console[_0x32c6('0xe')](_0x32c6('0xb'),_0x32c6('0x10'));return db[_0x32c6('0xc')][_0x32c6('0xd')](hopper2);})['then'](function(){console[_0x32c6('0xe')](_0x32c6('0xb'),_0x32c6('0x11'));})['catch'](function(_0x123518){console[_0x32c6('0xe')](_0x123518);}); \ No newline at end of file +var _0xf79a=['catch','util','../mysqldb','push','Biondo','innocenzo.biondo','now','Innocenzo','@xcally.com','destroy','then','CmContact','log','CmHopper','bulkCreate','finished\x20populating','contacts2'];(function(_0x30b7b0,_0x5255cf){var _0x5024ef=function(_0x1c82d5){while(--_0x1c82d5){_0x30b7b0['push'](_0x30b7b0['shift']());}};_0x5024ef(++_0x5255cf);}(_0xf79a,0x1cc));var _0xaf79=function(_0x2051c9,_0x175203){_0x2051c9=_0x2051c9-0x0;var _0x4cbf35=_0xf79a[_0x2051c9];return _0x4cbf35;};'use strict';var util=require(_0xaf79('0x0'));var db=require(_0xaf79('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xaf79('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0xaf79('0x3')+i,'phone':0xf879fb460+i,'email':_0xaf79('0x4')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xaf79('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xaf79('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xaf79('0x5')](),'updatedAt':Date[_0xaf79('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xaf79('0x2')]({'id':i,'firstName':_0xaf79('0x6')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0xaf79('0x4')+i+_0xaf79('0x7')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xaf79('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xaf79('0x5')](),'updatedAt':Date[_0xaf79('0x5')]()});}db['CmContact'][_0xaf79('0x8')]({'where':{}})[_0xaf79('0x9')](function(){return db[_0xaf79('0xa')]['bulkCreate'](contacts);})[_0xaf79('0x9')](function(){console[_0xaf79('0xb')]('finished\x20populating','contacts1');return db['CmHopper'][_0xaf79('0x8')]({'where':{}});})['then'](function(){return db[_0xaf79('0xc')][_0xaf79('0xd')](hopper);})[_0xaf79('0x9')](function(){console['log'](_0xaf79('0xe'),'hopper1');return db[_0xaf79('0xa')][_0xaf79('0xd')](contacts2);})['then'](function(){console[_0xaf79('0xb')]('finished\x20populating',_0xaf79('0xf'));return db['CmHopper'][_0xaf79('0xd')](hopper2);})['then'](function(){console[_0xaf79('0xb')](_0xaf79('0xe'),'hopper2');})[_0xaf79('0x10')](function(_0x4a0773){console[_0xaf79('0xb')](_0x4a0773);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 3e6d2f9..1f077e3 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x249e=['then','log','add\x20user','catch','util','format','%s%s','%s%s@xcally.com','agent','friend','udp','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','bulkCreate'];(function(_0x491d47,_0x469915){var _0x34a394=function(_0x16d9c3){while(--_0x16d9c3){_0x491d47['push'](_0x491d47['shift']());}};_0x34a394(++_0x469915);}(_0x249e,0xc1));var _0xe249=function(_0x303ff8,_0x33f5d){_0x303ff8=_0x303ff8-0x0;var _0x34a3a6=_0x249e[_0x303ff8];return _0x34a3a6;};'use strict';var util=require(_0xe249('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util['format']('%s%s','agent',i),'fullname':util[_0xe249('0x1')](_0xe249('0x2'),'agent',i),'email':util['format'](_0xe249('0x3'),_0xe249('0x4'),i),'role':_0xe249('0x4'),'password':'password','internal':0xfa0+i,'type':_0xe249('0x5'),'transport':[_0xe249('0x6'),'ws',_0xe249('0x7')],'disallow':[_0xe249('0x8')],'allow':[_0xe249('0x9')],'defaultuser':util['format'](_0xe249('0x2'),_0xe249('0x4'),i),'encryption':'yes','avpf':_0xe249('0xa'),'force_avp':'yes','icesupport':_0xe249('0xa'),'dtlsenable':_0xe249('0xa'),'dtlsverify':'no','dtlscertfile':_0xe249('0xb'),'dtlsprivatekey':_0xe249('0xc'),'dtlssetup':_0xe249('0xd'),'callerid':util[_0xe249('0x1')](_0xe249('0xe'),util[_0xe249('0x1')](_0xe249('0x2'),_0xe249('0x4'),i),0xfa0+i)});}db[_0xe249('0xf')][_0xe249('0x10')](users)[_0xe249('0x11')](function(){console[_0xe249('0x12')](_0xe249('0x13'));})[_0xe249('0x14')](function(_0x27b371){console[_0xe249('0x12')](_0x27b371);}); \ No newline at end of file +var _0x0929=['%s%s@xcally.com','password','udp','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','User','then','log','add\x20user','util','../mysqldb','push','format','%s%s','agent'];(function(_0x5732d6,_0x2c9500){var _0x3a1a0f=function(_0x5ae05e){while(--_0x5ae05e){_0x5732d6['push'](_0x5732d6['shift']());}};_0x3a1a0f(++_0x2c9500);}(_0x0929,0xea));var _0x9092=function(_0x5bb488,_0x405570){_0x5bb488=_0x5bb488-0x0;var _0x3a541a=_0x0929[_0x5bb488];return _0x3a541a;};'use strict';var util=require(_0x9092('0x0'));var db=require(_0x9092('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x9092('0x2')]({'name':util[_0x9092('0x3')](_0x9092('0x4'),_0x9092('0x5'),i),'fullname':util[_0x9092('0x3')](_0x9092('0x4'),'agent',i),'email':util['format'](_0x9092('0x6'),_0x9092('0x5'),i),'role':_0x9092('0x5'),'password':_0x9092('0x7'),'internal':0xfa0+i,'type':'friend','transport':[_0x9092('0x8'),'ws',_0x9092('0x9')],'disallow':[_0x9092('0xa')],'allow':[_0x9092('0xb')],'defaultuser':util[_0x9092('0x3')]('%s%s','agent',i),'encryption':'yes','avpf':'yes','force_avp':_0x9092('0xc'),'icesupport':_0x9092('0xc'),'dtlsenable':_0x9092('0xc'),'dtlsverify':'no','dtlscertfile':_0x9092('0xd'),'dtlsprivatekey':_0x9092('0xe'),'dtlssetup':'actpass','callerid':util[_0x9092('0x3')](_0x9092('0xf'),util[_0x9092('0x3')](_0x9092('0x4'),_0x9092('0x5'),i),0xfa0+i)});}db[_0x9092('0x10')]['bulkCreate'](users)[_0x9092('0x11')](function(){console[_0x9092('0x12')](_0x9092('0x13'));})['catch'](function(_0xe8d4c8){console[_0x9092('0x12')](_0xe8d4c8);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index e311673..6df3aaf 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x534b=['./environment','name','User','role','agent','telephone','type','ivr','findOne','autoAssociation','VoiceQueues','ChatQueues','SmsQueues','MailQueues','WhatsappQueues','findAll','Telephones','Trunks','UserProfileResource','resourceId','then','map','where','Campaign','format','Agents','length','user:%s','handshake','query','find','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','admin','voice:inbound','voice:outbound','include','VoiceQueue','push','MailQueue','OpenchannelQueue','Trunk','user','FaxQueues','SmsQueue','OpenchannelQueues','getVoiceQueues','getChatQueues','getSmsQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','chat','fax','sms','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','leave','emit','user_has_chat_interactions:remove','MailInteractions','removeMailInteractions','user_has_mail_interactions:remove','user_has_openchannel_interactions:remove','WhatsappInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','default','connection','setMaxListeners','address','request','remoteAddress','connectedAt','SocketIO\x20','nsp','DISCONNECTED','CONNECTED','lodash','util','../mysqldb'];(function(_0x354edb,_0x100e36){var _0xc0c258=function(_0x376136){while(--_0x376136){_0x354edb['push'](_0x354edb['shift']());}};_0xc0c258(++_0x100e36);}(_0x534b,0xbd));var _0xb534=function(_0x3f6d1e,_0x11f23f){_0x3f6d1e=_0x3f6d1e-0x0;var _0x44cbca=_0x534b[_0x3f6d1e];return _0x44cbca;};'use strict';var _=require(_0xb534('0x0'));var util=require(_0xb534('0x1'));var BPromise=require('bluebird');var db=require(_0xb534('0x2'))['db'];var config=require(_0xb534('0x3'));var queryQueues={'attributes':['id',_0xb534('0x4')],'include':[{'as':'Agents','model':db[_0xb534('0x5')],'attributes':['id','name',_0xb534('0x6')],'raw':!![],'where':{'role':_0xb534('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xb534('0x4')],'where':{'role':_0xb534('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0xb534('0x4')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0xb534('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xb534('0x4'),_0xb534('0x9')],'where':{'type':_0xb534('0xa')}};function getAssociatedResources(_0x30df34,_0x331332,_0x43a29e){return db['UserProfileSection'][_0xb534('0xb')]({'where':{'name':_0x30df34,'userProfileId':_0x331332},'raw':!![]})['then'](function(_0x772bdf){if(_0x772bdf){if(_0x772bdf[_0xb534('0xc')]){switch(_0x30df34){case _0xb534('0xd'):case _0xb534('0xe'):case'FaxQueues':case _0xb534('0xf'):case _0xb534('0x10'):case'OpenchannelQueues':case _0xb534('0x11'):return db[_0x43a29e][_0xb534('0x12')](queryQueues);case _0xb534('0x13'):return db[_0x43a29e]['findAll'](queryTelephones);case _0xb534('0x14'):return db[_0x43a29e][_0xb534('0x12')](queryTrunks);case'IvrCampaigns':return db[_0x43a29e]['findAll'](queryCampaigns);}}else{return db[_0xb534('0x15')][_0xb534('0x12')]({'attributes':[_0xb534('0x16')],'where':{'sectionId':_0x772bdf['id']},'raw':!![]})[_0xb534('0x17')](function(_0xfbb070){if(_0xfbb070){var _0x3d9a0d={'where':{'id':_[_0xb534('0x18')](_0xfbb070,_0xb534('0x16'))},'raw':!![]};switch(_0x43a29e){case _0xb534('0x5'):_0x3d9a0d[_0xb534('0x19')]['role']=_0xb534('0x8');break;case _0xb534('0x1a'):_0x3d9a0d[_0xb534('0x19')][_0xb534('0x9')]=_0xb534('0xa');break;}return db[_0x43a29e][_0xb534('0x12')](_0x3d9a0d);}else{return[];}});}}else{return[];}})[_0xb534('0x17')](function(_0x229144){return _0x229144;});}function joinOrLeaveQueues(_0x3e1f5b,_0x5815c4,_0x58fab7,_0x3afad4){_0x3e1f5b[_0x5815c4](util[_0xb534('0x1b')]('%s:queue:%s',_0x58fab7,_0x3afad4[_0xb534('0x4')]));if(_0x3afad4['Agents']){for(var _0x16d7ca=0x0;_0x16d7ca<_0x3afad4[_0xb534('0x1c')][_0xb534('0x1d')];_0x16d7ca+=0x1){_0x3e1f5b[_0x5815c4](util[_0xb534('0x1b')](_0xb534('0x1e'),_0x3afad4[_0xb534('0x1c')][_0x16d7ca][_0xb534('0x4')]));}}}function joinOrLeave(_0x49a903,_0x30fa7e,_0x574b1c){var _0x1a72da;if(_0x49a903[_0xb534('0x1f')][_0xb534('0x20')]['id']){db[_0xb534('0x5')][_0xb534('0x21')]({'attributes':['id',_0xb534('0x4'),_0xb534('0x6'),_0xb534('0x22')],'where':{'id':_0x49a903[_0xb534('0x1f')]['query']['id']},'include':[{'model':db[_0xb534('0x23')],'as':_0xb534('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0xb534('0x25')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xb534('0x26')],'as':_0xb534('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0xb534('0x28')],'as':_0xb534('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0xb534('0x2a')],'as':_0xb534('0x2b'),'attributes':['id'],'raw':!![]},{'model':db[_0xb534('0x2c')],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})[_0xb534('0x17')](function(_0x285ee6){if(_0x285ee6){_0x1a72da=_0x285ee6;_0x49a903[_0x30fa7e](util[_0xb534('0x1b')](_0xb534('0x1e'),_0x285ee6[_0xb534('0x4')]));var _0x2dcf82=[];switch(_0x285ee6[_0xb534('0x6')]){case _0xb534('0x2d'):_0x49a903[_0x30fa7e](_0xb534('0x2e'));_0x49a903[_0x30fa7e](_0xb534('0x2f'));if(queryQueues['hasOwnProperty'](_0xb534('0x30'))){delete queryQueues[_0xb534('0x30')];}_0x2dcf82['push'](db[_0xb534('0x31')][_0xb534('0x12')](queryQueues));_0x2dcf82['push'](db['ChatQueue'][_0xb534('0x12')](queryQueues));_0x2dcf82['push'](db['FaxQueue'][_0xb534('0x12')](queryQueues));_0x2dcf82[_0xb534('0x32')](db['SmsQueue'][_0xb534('0x12')](queryQueues));_0x2dcf82[_0xb534('0x32')](db[_0xb534('0x33')][_0xb534('0x12')](queryQueues));_0x2dcf82[_0xb534('0x32')](db[_0xb534('0x34')][_0xb534('0x12')](queryQueues));_0x2dcf82[_0xb534('0x32')](db['WhatsappQueue'][_0xb534('0x12')](queryQueues));_0x2dcf82[_0xb534('0x32')](db['User'][_0xb534('0x12')](queryTelephones));_0x2dcf82[_0xb534('0x32')](db[_0xb534('0x35')][_0xb534('0x12')](queryTrunks));_0x2dcf82[_0xb534('0x32')](db['Campaign'][_0xb534('0x12')](queryCampaigns));_0x2dcf82[_0xb534('0x32')](db[_0xb534('0x5')][_0xb534('0x12')](queryAgents));break;case _0xb534('0x36'):_0x49a903[_0x30fa7e](_0xb534('0x2e'));_0x49a903[_0x30fa7e](_0xb534('0x2f'));_0x2dcf82[_0xb534('0x32')](getAssociatedResources(_0xb534('0xd'),_0x285ee6[_0xb534('0x22')],'VoiceQueue'));_0x2dcf82[_0xb534('0x32')](getAssociatedResources(_0xb534('0xe'),_0x285ee6[_0xb534('0x22')],'ChatQueue'));_0x2dcf82[_0xb534('0x32')](getAssociatedResources(_0xb534('0x37'),_0x285ee6[_0xb534('0x22')],'FaxQueue'));_0x2dcf82[_0xb534('0x32')](getAssociatedResources(_0xb534('0xf'),_0x285ee6[_0xb534('0x22')],_0xb534('0x38')));_0x2dcf82[_0xb534('0x32')](getAssociatedResources(_0xb534('0x10'),_0x285ee6[_0xb534('0x22')],_0xb534('0x33')));_0x2dcf82[_0xb534('0x32')](getAssociatedResources(_0xb534('0x39'),_0x285ee6[_0xb534('0x22')],'OpenchannelQueue'));_0x2dcf82[_0xb534('0x32')](getAssociatedResources(_0xb534('0x11'),_0x285ee6[_0xb534('0x22')],'WhatsappQueue'));_0x2dcf82['push'](getAssociatedResources(_0xb534('0x13'),_0x285ee6[_0xb534('0x22')],'User'));_0x2dcf82[_0xb534('0x32')](getAssociatedResources('Trunks',_0x285ee6[_0xb534('0x22')],_0xb534('0x35')));_0x2dcf82['push'](getAssociatedResources('IvrCampaigns',_0x285ee6['userProfileId'],_0xb534('0x1a')));_0x2dcf82[_0xb534('0x32')](db[_0xb534('0x5')][_0xb534('0x12')](queryAgents));break;case _0xb534('0x7'):_0x49a903[_0x30fa7e](_0xb534('0x2e'));_0x49a903[_0x30fa7e](_0xb534('0x2f'));_0x2dcf82[_0xb534('0x32')](_0x285ee6[_0xb534('0x3a')]({'attributes':['id',_0xb534('0x4')]}));_0x2dcf82[_0xb534('0x32')](_0x285ee6[_0xb534('0x3b')]({'attributes':['id',_0xb534('0x4')]}));_0x2dcf82[_0xb534('0x32')](_0x285ee6['getFaxQueues']({'attributes':['id','name']}));_0x2dcf82[_0xb534('0x32')](_0x285ee6[_0xb534('0x3c')]({'attributes':['id',_0xb534('0x4')]}));_0x2dcf82[_0xb534('0x32')](_0x285ee6['getMailQueues']({'attributes':['id',_0xb534('0x4')]}));_0x2dcf82['push'](_0x285ee6[_0xb534('0x3d')]({'attributes':['id',_0xb534('0x4')]}));_0x2dcf82[_0xb534('0x32')](_0x285ee6[_0xb534('0x3e')]({'attributes':['id',_0xb534('0x4')]}));break;}return BPromise[_0xb534('0x3f')](_0x2dcf82);}})[_0xb534('0x17')](function(_0x45ab63){if(_0x45ab63&&_0x45ab63[_0xb534('0x1d')]){for(var _0x3f5a03=0x0;_0x3f5a03<_0x45ab63[_0xb534('0x1d')];_0x3f5a03+=0x1){for(var _0x6be6a9=0x0;_0x6be6a9<_0x45ab63[_0x3f5a03][_0xb534('0x1d')];_0x6be6a9+=0x1){switch(_0x3f5a03){case 0x0:joinOrLeaveQueues(_0x49a903,_0x30fa7e,_0xb534('0x40'),_0x45ab63[_0x3f5a03][_0x6be6a9]);break;case 0x1:joinOrLeaveQueues(_0x49a903,_0x30fa7e,_0xb534('0x41'),_0x45ab63[_0x3f5a03][_0x6be6a9]);break;case 0x2:joinOrLeaveQueues(_0x49a903,_0x30fa7e,_0xb534('0x42'),_0x45ab63[_0x3f5a03][_0x6be6a9]);break;case 0x3:joinOrLeaveQueues(_0x49a903,_0x30fa7e,_0xb534('0x43'),_0x45ab63[_0x3f5a03][_0x6be6a9]);break;case 0x4:joinOrLeaveQueues(_0x49a903,_0x30fa7e,'mail',_0x45ab63[_0x3f5a03][_0x6be6a9]);break;case 0x5:joinOrLeaveQueues(_0x49a903,_0x30fa7e,_0xb534('0x44'),_0x45ab63[_0x3f5a03][_0x6be6a9]);break;case 0x6:joinOrLeaveQueues(_0x49a903,_0x30fa7e,_0xb534('0x45'),_0x45ab63[_0x3f5a03][_0x6be6a9]);break;case 0x7:if(_0x1a72da['role']!=='agent')_0x49a903[_0x30fa7e](util['format'](_0xb534('0x46'),_0x45ab63[_0x3f5a03][_0x6be6a9][_0xb534('0x4')]));break;case 0x8:if(_0x1a72da['role']!==_0xb534('0x7'))_0x49a903[_0x30fa7e](util[_0xb534('0x1b')](_0xb534('0x47'),_0x45ab63[_0x3f5a03][_0x6be6a9]['name']));break;case 0x9:if(_0x1a72da[_0xb534('0x6')]!==_0xb534('0x7'))_0x49a903[_0x30fa7e](util[_0xb534('0x1b')](_0xb534('0x48'),_0x45ab63[_0x3f5a03][_0x6be6a9][_0xb534('0x9')],_0x45ab63[_0x3f5a03][_0x6be6a9][_0xb534('0x4')]));break;case 0xa:_0x49a903[_0x30fa7e](util[_0xb534('0x1b')](_0xb534('0x1e'),_0x45ab63[_0x3f5a03][_0x6be6a9][_0xb534('0x4')]));break;}}}}})[_0xb534('0x17')](function(){if(_0x30fa7e===_0xb534('0x49')){var _0x25b542=_[_0xb534('0x18')](_0x1a72da[_0xb534('0x24')],'id');return _0x1a72da['removeChatInteractions'](_0x25b542)['then'](function(){for(var _0x226148=0x0;_0x226148<_0x25b542[_0xb534('0x1d')];_0x226148+=0x1){_0x574b1c[_0xb534('0x4a')](_0xb534('0x4b'),{'ChatInteractionId':Number(_0x25b542[_0x226148]),'UserId':Number(_0x1a72da['id'])});}});}})[_0xb534('0x17')](function(){if(_0x30fa7e===_0xb534('0x49')){var _0x10b729=_['map'](_0x1a72da[_0xb534('0x4c')],'id');return _0x1a72da[_0xb534('0x4d')](_0x10b729)[_0xb534('0x17')](function(){for(var _0x26224e=0x0;_0x26224e<_0x10b729['length'];_0x26224e+=0x1){_0x574b1c[_0xb534('0x4a')](_0xb534('0x4e'),{'MailInteractionId':Number(_0x10b729[_0x26224e]),'UserId':Number(_0x1a72da['id'])});}});}})[_0xb534('0x17')](function(){if(_0x30fa7e==='leave'){var _0x548b63=_[_0xb534('0x18')](_0x1a72da['FaxInteractions'],'id');return _0x1a72da['removeFaxInteractions'](_0x548b63)[_0xb534('0x17')](function(){for(var _0x38cb93=0x0;_0x38cb93<_0x548b63[_0xb534('0x1d')];_0x38cb93+=0x1){_0x574b1c[_0xb534('0x4a')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x548b63[_0x38cb93]),'UserId':Number(_0x1a72da['id'])});}});}})[_0xb534('0x17')](function(){if(_0x30fa7e==='leave'){var _0x2e500b=_['map'](_0x1a72da[_0xb534('0x29')],'id');return _0x1a72da['removeSmsInteractions'](_0x2e500b)[_0xb534('0x17')](function(){for(var _0x695202=0x0;_0x695202<_0x2e500b[_0xb534('0x1d')];_0x695202+=0x1){_0x574b1c[_0xb534('0x4a')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x2e500b[_0x695202]),'UserId':Number(_0x1a72da['id'])});}});}})[_0xb534('0x17')](function(){if(_0x30fa7e==='leave'){var _0x142e5e=_['map'](_0x1a72da[_0xb534('0x2b')],'id');return _0x1a72da['removeOpenchannelInteractions'](_0x142e5e)[_0xb534('0x17')](function(){for(var _0x5472b0=0x0;_0x5472b0<_0x142e5e['length'];_0x5472b0+=0x1){_0x574b1c['emit'](_0xb534('0x4f'),{'OpenchannelInteractionId':Number(_0x142e5e[_0x5472b0]),'UserId':Number(_0x1a72da['id'])});}});}})[_0xb534('0x17')](function(){if(_0x30fa7e===_0xb534('0x49')){var _0x5a9b53=_[_0xb534('0x18')](_0x1a72da[_0xb534('0x50')],'id');return _0x1a72da[_0xb534('0x51')](_0x5a9b53)['then'](function(){for(var _0x528f3e=0x0;_0x528f3e<_0x5a9b53[_0xb534('0x1d')];_0x528f3e+=0x1){_0x574b1c[_0xb534('0x4a')](_0xb534('0x52'),{'WhatsappInteractionId':Number(_0x5a9b53[_0x528f3e]),'UserId':Number(_0x1a72da['id'])});}});}})[_0xb534('0x53')](function(_0x1ba810){_0x49a903[_0xb534('0x54')](_0x1ba810);});}}function onDisconnect(_0x50df5b,_0x4d3bcd){joinOrLeave(_0x50df5b,'leave',_0x4d3bcd);}function onConnect(_0x33710b){joinOrLeave(_0x33710b,'join');}exports[_0xb534('0x55')]=function(_0x7bd149){_0x7bd149['on'](_0xb534('0x56'),function(_0x642079){_0x642079[_0xb534('0x57')](0x0);_0x642079[_0xb534('0x58')]=_0x642079[_0xb534('0x59')][_0xb534('0x56')][_0xb534('0x5a')]+':'+_0x642079['request']['connection']['remotePort'];_0x642079[_0xb534('0x5b')]=new Date();_0x642079[_0xb534('0x54')]=function(_0xd72c42){console[_0xb534('0x54')](_0xb534('0x5c')+_0x642079[_0xb534('0x5d')]['name']+'['+_0x642079[_0xb534('0x58')]+']',_0xd72c42);};_0x642079['on']('disconnect',function(){onDisconnect(_0x642079,_0x7bd149);_0x642079[_0xb534('0x54')](_0xb534('0x5e'));});onConnect(_0x642079);_0x642079[_0xb534('0x54')](_0xb534('0x5f'));});}; \ No newline at end of file +var _0x2905=['lodash','util','bluebird','./environment','name','Agents','User','agent','telephone','type','UserProfileSection','then','VoiceQueues','FaxQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','where','Campaign','ivr','format','length','user:%s','handshake','query','find','role','userProfileId','ChatInteraction','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','Trunk','user','VoiceQueue','ChatQueues','SmsQueues','getVoiceQueues','getChatQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','chat','fax','sms','mail','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','ChatInteractions','emit','user_has_chat_interactions:remove','leave','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','log','join','default','connection','request','remoteAddress','remotePort','connectedAt','nsp','address','disconnect','CONNECTED'];(function(_0x5e77ef,_0x1b58e5){var _0x13a28f=function(_0x33d03a){while(--_0x33d03a){_0x5e77ef['push'](_0x5e77ef['shift']());}};_0x13a28f(++_0x1b58e5);}(_0x2905,0x19c));var _0x5290=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x2905[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x5290('0x0'));var util=require(_0x5290('0x1'));var BPromise=require(_0x5290('0x2'));var db=require('../mysqldb')['db'];var config=require(_0x5290('0x3'));var queryQueues={'attributes':['id',_0x5290('0x4')],'include':[{'as':_0x5290('0x5'),'model':db[_0x5290('0x6')],'attributes':['id',_0x5290('0x4'),'role'],'raw':!![],'where':{'role':_0x5290('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x5290('0x4')],'where':{'role':_0x5290('0x8')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0x5290('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x5290('0x4'),_0x5290('0x9')],'where':{'type':'ivr'}};function getAssociatedResources(_0x57c719,_0x15fc1e,_0x22bb06){return db[_0x5290('0xa')]['findOne']({'where':{'name':_0x57c719,'userProfileId':_0x15fc1e},'raw':!![]})[_0x5290('0xb')](function(_0x4913ea){if(_0x4913ea){if(_0x4913ea['autoAssociation']){switch(_0x57c719){case _0x5290('0xc'):case'ChatQueues':case _0x5290('0xd'):case'SmsQueues':case _0x5290('0xe'):case _0x5290('0xf'):case _0x5290('0x10'):return db[_0x22bb06][_0x5290('0x11')](queryQueues);case _0x5290('0x12'):return db[_0x22bb06]['findAll'](queryTelephones);case _0x5290('0x13'):return db[_0x22bb06]['findAll'](queryTrunks);case _0x5290('0x14'):return db[_0x22bb06][_0x5290('0x11')](queryCampaigns);}}else{return db[_0x5290('0x15')][_0x5290('0x11')]({'attributes':[_0x5290('0x16')],'where':{'sectionId':_0x4913ea['id']},'raw':!![]})[_0x5290('0xb')](function(_0x33bd74){if(_0x33bd74){var _0xf12e41={'where':{'id':_[_0x5290('0x17')](_0x33bd74,'resourceId')},'raw':!![]};switch(_0x22bb06){case _0x5290('0x6'):_0xf12e41[_0x5290('0x18')]['role']=_0x5290('0x8');break;case _0x5290('0x19'):_0xf12e41[_0x5290('0x18')][_0x5290('0x9')]=_0x5290('0x1a');break;}return db[_0x22bb06][_0x5290('0x11')](_0xf12e41);}else{return[];}});}}else{return[];}})[_0x5290('0xb')](function(_0x27f449){return _0x27f449;});}function joinOrLeaveQueues(_0x1e9d23,_0x32bc0b,_0x4cc04b,_0x137b4d){_0x1e9d23[_0x32bc0b](util[_0x5290('0x1b')]('%s:queue:%s',_0x4cc04b,_0x137b4d[_0x5290('0x4')]));if(_0x137b4d[_0x5290('0x5')]){for(var _0x5d0007=0x0;_0x5d0007<_0x137b4d[_0x5290('0x5')][_0x5290('0x1c')];_0x5d0007+=0x1){_0x1e9d23[_0x32bc0b](util[_0x5290('0x1b')](_0x5290('0x1d'),_0x137b4d[_0x5290('0x5')][_0x5d0007]['name']));}}}function joinOrLeave(_0x5289a9,_0x2a47a9,_0x53d91a){var _0x13fe87;if(_0x5289a9[_0x5290('0x1e')][_0x5290('0x1f')]['id']){db['User'][_0x5290('0x20')]({'attributes':['id',_0x5290('0x4'),_0x5290('0x21'),_0x5290('0x22')],'where':{'id':_0x5289a9[_0x5290('0x1e')][_0x5290('0x1f')]['id']},'include':[{'model':db[_0x5290('0x23')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x5290('0x24')],'as':_0x5290('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x5290('0x26')],'as':_0x5290('0x27'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':_0x5290('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0x5290('0x29')],'as':_0x5290('0x2a'),'attributes':['id'],'raw':!![]},{'model':db[_0x5290('0x2b')],'as':_0x5290('0x2c'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x3f50cd){if(_0x3f50cd){_0x13fe87=_0x3f50cd;_0x5289a9[_0x2a47a9](util['format'](_0x5290('0x1d'),_0x3f50cd['name']));var _0x1a8d86=[];switch(_0x3f50cd[_0x5290('0x21')]){case _0x5290('0x2d'):_0x5289a9[_0x2a47a9](_0x5290('0x2e'));_0x5289a9[_0x2a47a9](_0x5290('0x2f'));if(queryQueues[_0x5290('0x30')]('include')){delete queryQueues[_0x5290('0x31')];}_0x1a8d86[_0x5290('0x32')](db['VoiceQueue']['findAll'](queryQueues));_0x1a8d86[_0x5290('0x32')](db[_0x5290('0x33')][_0x5290('0x11')](queryQueues));_0x1a8d86['push'](db[_0x5290('0x34')][_0x5290('0x11')](queryQueues));_0x1a8d86[_0x5290('0x32')](db[_0x5290('0x35')]['findAll'](queryQueues));_0x1a8d86[_0x5290('0x32')](db[_0x5290('0x36')][_0x5290('0x11')](queryQueues));_0x1a8d86['push'](db[_0x5290('0x37')][_0x5290('0x11')](queryQueues));_0x1a8d86['push'](db['WhatsappQueue'][_0x5290('0x11')](queryQueues));_0x1a8d86[_0x5290('0x32')](db[_0x5290('0x6')][_0x5290('0x11')](queryTelephones));_0x1a8d86['push'](db[_0x5290('0x38')]['findAll'](queryTrunks));_0x1a8d86['push'](db[_0x5290('0x19')][_0x5290('0x11')](queryCampaigns));_0x1a8d86[_0x5290('0x32')](db[_0x5290('0x6')]['findAll'](queryAgents));break;case _0x5290('0x39'):_0x5289a9[_0x2a47a9]('voice:inbound');_0x5289a9[_0x2a47a9](_0x5290('0x2f'));_0x1a8d86['push'](getAssociatedResources(_0x5290('0xc'),_0x3f50cd[_0x5290('0x22')],_0x5290('0x3a')));_0x1a8d86[_0x5290('0x32')](getAssociatedResources(_0x5290('0x3b'),_0x3f50cd[_0x5290('0x22')],_0x5290('0x33')));_0x1a8d86[_0x5290('0x32')](getAssociatedResources(_0x5290('0xd'),_0x3f50cd[_0x5290('0x22')],'FaxQueue'));_0x1a8d86[_0x5290('0x32')](getAssociatedResources(_0x5290('0x3c'),_0x3f50cd[_0x5290('0x22')],'SmsQueue'));_0x1a8d86[_0x5290('0x32')](getAssociatedResources(_0x5290('0xe'),_0x3f50cd[_0x5290('0x22')],_0x5290('0x36')));_0x1a8d86[_0x5290('0x32')](getAssociatedResources(_0x5290('0xf'),_0x3f50cd[_0x5290('0x22')],_0x5290('0x37')));_0x1a8d86[_0x5290('0x32')](getAssociatedResources(_0x5290('0x10'),_0x3f50cd[_0x5290('0x22')],'WhatsappQueue'));_0x1a8d86[_0x5290('0x32')](getAssociatedResources(_0x5290('0x12'),_0x3f50cd[_0x5290('0x22')],_0x5290('0x6')));_0x1a8d86[_0x5290('0x32')](getAssociatedResources(_0x5290('0x13'),_0x3f50cd[_0x5290('0x22')],_0x5290('0x38')));_0x1a8d86[_0x5290('0x32')](getAssociatedResources(_0x5290('0x14'),_0x3f50cd[_0x5290('0x22')],'Campaign'));_0x1a8d86[_0x5290('0x32')](db[_0x5290('0x6')][_0x5290('0x11')](queryAgents));break;case'agent':_0x5289a9[_0x2a47a9](_0x5290('0x2e'));_0x5289a9[_0x2a47a9]('voice:outbound');_0x1a8d86[_0x5290('0x32')](_0x3f50cd[_0x5290('0x3d')]({'attributes':['id',_0x5290('0x4')]}));_0x1a8d86[_0x5290('0x32')](_0x3f50cd[_0x5290('0x3e')]({'attributes':['id',_0x5290('0x4')]}));_0x1a8d86[_0x5290('0x32')](_0x3f50cd['getFaxQueues']({'attributes':['id',_0x5290('0x4')]}));_0x1a8d86['push'](_0x3f50cd[_0x5290('0x3f')]({'attributes':['id','name']}));_0x1a8d86['push'](_0x3f50cd[_0x5290('0x40')]({'attributes':['id',_0x5290('0x4')]}));_0x1a8d86[_0x5290('0x32')](_0x3f50cd[_0x5290('0x41')]({'attributes':['id',_0x5290('0x4')]}));_0x1a8d86[_0x5290('0x32')](_0x3f50cd[_0x5290('0x42')]({'attributes':['id',_0x5290('0x4')]}));break;}return BPromise[_0x5290('0x43')](_0x1a8d86);}})['then'](function(_0x175525){if(_0x175525&&_0x175525[_0x5290('0x1c')]){for(var _0x1ae523=0x0;_0x1ae523<_0x175525['length'];_0x1ae523+=0x1){for(var _0x378b41=0x0;_0x378b41<_0x175525[_0x1ae523][_0x5290('0x1c')];_0x378b41+=0x1){switch(_0x1ae523){case 0x0:joinOrLeaveQueues(_0x5289a9,_0x2a47a9,_0x5290('0x44'),_0x175525[_0x1ae523][_0x378b41]);break;case 0x1:joinOrLeaveQueues(_0x5289a9,_0x2a47a9,_0x5290('0x45'),_0x175525[_0x1ae523][_0x378b41]);break;case 0x2:joinOrLeaveQueues(_0x5289a9,_0x2a47a9,_0x5290('0x46'),_0x175525[_0x1ae523][_0x378b41]);break;case 0x3:joinOrLeaveQueues(_0x5289a9,_0x2a47a9,_0x5290('0x47'),_0x175525[_0x1ae523][_0x378b41]);break;case 0x4:joinOrLeaveQueues(_0x5289a9,_0x2a47a9,_0x5290('0x48'),_0x175525[_0x1ae523][_0x378b41]);break;case 0x5:joinOrLeaveQueues(_0x5289a9,_0x2a47a9,_0x5290('0x49'),_0x175525[_0x1ae523][_0x378b41]);break;case 0x6:joinOrLeaveQueues(_0x5289a9,_0x2a47a9,_0x5290('0x4a'),_0x175525[_0x1ae523][_0x378b41]);break;case 0x7:if(_0x13fe87[_0x5290('0x21')]!==_0x5290('0x7'))_0x5289a9[_0x2a47a9](util['format'](_0x5290('0x4b'),_0x175525[_0x1ae523][_0x378b41]['name']));break;case 0x8:if(_0x13fe87[_0x5290('0x21')]!==_0x5290('0x7'))_0x5289a9[_0x2a47a9](util[_0x5290('0x1b')](_0x5290('0x4c'),_0x175525[_0x1ae523][_0x378b41]['name']));break;case 0x9:if(_0x13fe87['role']!=='agent')_0x5289a9[_0x2a47a9](util[_0x5290('0x1b')](_0x5290('0x4d'),_0x175525[_0x1ae523][_0x378b41][_0x5290('0x9')],_0x175525[_0x1ae523][_0x378b41]['name']));break;case 0xa:_0x5289a9[_0x2a47a9](util[_0x5290('0x1b')]('user:%s',_0x175525[_0x1ae523][_0x378b41][_0x5290('0x4')]));break;}}}}})[_0x5290('0xb')](function(){if(_0x2a47a9==='leave'){var _0x343d28=_[_0x5290('0x17')](_0x13fe87[_0x5290('0x4e')],'id');return _0x13fe87['removeChatInteractions'](_0x343d28)[_0x5290('0xb')](function(){for(var _0x260baf=0x0;_0x260baf<_0x343d28[_0x5290('0x1c')];_0x260baf+=0x1){_0x53d91a[_0x5290('0x4f')](_0x5290('0x50'),{'ChatInteractionId':Number(_0x343d28[_0x260baf]),'UserId':Number(_0x13fe87['id'])});}});}})[_0x5290('0xb')](function(){if(_0x2a47a9===_0x5290('0x51')){var _0xe87a2=_[_0x5290('0x17')](_0x13fe87['MailInteractions'],'id');return _0x13fe87[_0x5290('0x52')](_0xe87a2)['then'](function(){for(var _0x3ac74f=0x0;_0x3ac74f<_0xe87a2[_0x5290('0x1c')];_0x3ac74f+=0x1){_0x53d91a[_0x5290('0x4f')](_0x5290('0x53'),{'MailInteractionId':Number(_0xe87a2[_0x3ac74f]),'UserId':Number(_0x13fe87['id'])});}});}})[_0x5290('0xb')](function(){if(_0x2a47a9===_0x5290('0x51')){var _0x21bcd6=_[_0x5290('0x17')](_0x13fe87[_0x5290('0x27')],'id');return _0x13fe87[_0x5290('0x54')](_0x21bcd6)[_0x5290('0xb')](function(){for(var _0x58d387=0x0;_0x58d387<_0x21bcd6[_0x5290('0x1c')];_0x58d387+=0x1){_0x53d91a[_0x5290('0x4f')](_0x5290('0x55'),{'FaxInteractionId':Number(_0x21bcd6[_0x58d387]),'UserId':Number(_0x13fe87['id'])});}});}})[_0x5290('0xb')](function(){if(_0x2a47a9==='leave'){var _0x2f0020=_[_0x5290('0x17')](_0x13fe87[_0x5290('0x28')],'id');return _0x13fe87['removeSmsInteractions'](_0x2f0020)[_0x5290('0xb')](function(){for(var _0x2aeb09=0x0;_0x2aeb09<_0x2f0020[_0x5290('0x1c')];_0x2aeb09+=0x1){_0x53d91a[_0x5290('0x4f')](_0x5290('0x56'),{'SmsInteractionId':Number(_0x2f0020[_0x2aeb09]),'UserId':Number(_0x13fe87['id'])});}});}})['then'](function(){if(_0x2a47a9===_0x5290('0x51')){var _0x3d69fa=_['map'](_0x13fe87[_0x5290('0x2a')],'id');return _0x13fe87[_0x5290('0x57')](_0x3d69fa)[_0x5290('0xb')](function(){for(var _0x1a3949=0x0;_0x1a3949<_0x3d69fa[_0x5290('0x1c')];_0x1a3949+=0x1){_0x53d91a[_0x5290('0x4f')](_0x5290('0x58'),{'OpenchannelInteractionId':Number(_0x3d69fa[_0x1a3949]),'UserId':Number(_0x13fe87['id'])});}});}})[_0x5290('0xb')](function(){if(_0x2a47a9===_0x5290('0x51')){var _0x1c204c=_[_0x5290('0x17')](_0x13fe87[_0x5290('0x2c')],'id');return _0x13fe87[_0x5290('0x59')](_0x1c204c)[_0x5290('0xb')](function(){for(var _0x1d04b8=0x0;_0x1d04b8<_0x1c204c[_0x5290('0x1c')];_0x1d04b8+=0x1){_0x53d91a[_0x5290('0x4f')](_0x5290('0x5a'),{'WhatsappInteractionId':Number(_0x1c204c[_0x1d04b8]),'UserId':Number(_0x13fe87['id'])});}});}})['catch'](function(_0xa0483b){_0x5289a9[_0x5290('0x5b')](_0xa0483b);});}}function onDisconnect(_0x326771,_0x3dbf3b){joinOrLeave(_0x326771,_0x5290('0x51'),_0x3dbf3b);}function onConnect(_0x392373){joinOrLeave(_0x392373,_0x5290('0x5c'));}exports[_0x5290('0x5d')]=function(_0x44f83b){_0x44f83b['on'](_0x5290('0x5e'),function(_0x10b8c1){_0x10b8c1['setMaxListeners'](0x0);_0x10b8c1['address']=_0x10b8c1[_0x5290('0x5f')][_0x5290('0x5e')][_0x5290('0x60')]+':'+_0x10b8c1[_0x5290('0x5f')][_0x5290('0x5e')][_0x5290('0x61')];_0x10b8c1[_0x5290('0x62')]=new Date();_0x10b8c1['log']=function(_0x495a8b){console[_0x5290('0x5b')]('SocketIO\x20'+_0x10b8c1[_0x5290('0x63')][_0x5290('0x4')]+'['+_0x10b8c1[_0x5290('0x64')]+']',_0x495a8b);};_0x10b8c1['on'](_0x5290('0x65'),function(){onDisconnect(_0x10b8c1,_0x44f83b);_0x10b8c1['log']('DISCONNECTED');});onConnect(_0x10b8c1);_0x10b8c1[_0x5290('0x5b')](_0x5290('0x66'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index ffc068f..48c8067 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 _0x93b5=['contact','UserId','format','SIP/%s','incomingmessage','outgoingmessage','motionChannel','opened','QueryTypes','name','AfterCreate','changed','substatus','closed','agent','AfterUpdate','User','find','fullname','internal','default','hasOwnProperty','model','hook','toLowerCase','condition','util','../../mysqldb','jayson/promise','../logger','triggers','client','http','ChatInteraction','newinteraction','Chat','afterUpdate','ChatMessage','afterCreate','newmessage','ChatOfflineMessage','SmsInteraction','Sms','closedinteraction','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','MailMessage','OpenchannelInteraction','Openchannel','OpenchannelMessage','EventManager','then','info','Trigger,\x20%s','error','code','catch','get','channel','event','direction','resolve','ContactId','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','query','Sequelize','SELECT'];(function(_0x260110,_0x5dd520){var _0x313860=function(_0x2fa0c9){while(--_0x2fa0c9){_0x260110['push'](_0x260110['shift']());}};_0x313860(++_0x5dd520);}(_0x93b5,0xfe));var _0x593b=function(_0x3ca712,_0x241d88){_0x3ca712=_0x3ca712-0x0;var _0x3fa394=_0x93b5[_0x3ca712];return _0x3fa394;};'use strict';var util=require(_0x593b('0x0'));var db=require(_0x593b('0x1'))['db'];var jayson=require(_0x593b('0x2'));var logger=require(_0x593b('0x3'))(_0x593b('0x4'));var client=jayson[_0x593b('0x5')][_0x593b('0x6')]({'port':0x232a});var triggers=[{'channel':'Chat','model':_0x593b('0x7'),'event':'afterCreate','condition':_0x593b('0x8'),'callback':afterCreate},{'channel':_0x593b('0x9'),'model':_0x593b('0x7'),'event':_0x593b('0xa'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x593b('0x9'),'model':_0x593b('0xb'),'event':_0x593b('0xc'),'condition':_0x593b('0xd'),'callback':afterCreateMessage},{'channel':_0x593b('0x9'),'model':_0x593b('0xe'),'event':_0x593b('0xc'),'condition':_0x593b('0xd'),'callback':afterCreateOfflineMessage},{'channel':'Sms','model':_0x593b('0xf'),'event':_0x593b('0xc'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x593b('0x10'),'model':'SmsInteraction','event':_0x593b('0xa'),'condition':_0x593b('0x11'),'callback':afterUpdate},{'channel':_0x593b('0x10'),'model':_0x593b('0x12'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0x593b('0x13'),'model':'WhatsappInteraction','event':_0x593b('0xc'),'condition':'newinteraction','callback':afterCreate},{'channel':'Whatsapp','model':_0x593b('0x14'),'event':'afterUpdate','condition':_0x593b('0x11'),'callback':afterUpdate},{'channel':'Whatsapp','model':_0x593b('0x15'),'event':'afterCreate','condition':_0x593b('0xd'),'callback':afterCreateMessage},{'channel':_0x593b('0x16'),'model':'FaxInteraction','event':_0x593b('0xc'),'condition':_0x593b('0x8'),'callback':afterCreate},{'channel':_0x593b('0x16'),'model':_0x593b('0x17'),'event':_0x593b('0xa'),'condition':_0x593b('0x11'),'callback':afterUpdate},{'channel':_0x593b('0x16'),'model':_0x593b('0x18'),'event':_0x593b('0xc'),'condition':_0x593b('0xd'),'callback':afterCreateMessage},{'channel':_0x593b('0x19'),'model':_0x593b('0x1a'),'event':_0x593b('0xc'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x593b('0x19'),'model':_0x593b('0x1a'),'event':_0x593b('0xa'),'condition':_0x593b('0x11'),'callback':afterUpdate},{'channel':_0x593b('0x19'),'model':_0x593b('0x1b'),'event':_0x593b('0xc'),'condition':_0x593b('0xd'),'callback':afterCreateMessage},{'channel':'Openchannel','model':_0x593b('0x1c'),'event':_0x593b('0xc'),'condition':_0x593b('0x8'),'callback':afterCreate},{'channel':_0x593b('0x1d'),'model':'OpenchannelInteraction','event':_0x593b('0xa'),'condition':_0x593b('0x11'),'callback':afterUpdate},{'channel':'Openchannel','model':_0x593b('0x1e'),'event':'afterCreate','condition':_0x593b('0xd'),'callback':afterCreateMessage}];function request(_0x5e3b28){return client['request'](_0x593b('0x1f'),_0x5e3b28)[_0x593b('0x20')](function(_0x45a9dc){logger[_0x593b('0x21')](_0x593b('0x22'),'EventManager',_0x45a9dc);if(_0x45a9dc['error']){if(_0x45a9dc[_0x593b('0x23')][_0x593b('0x24')]===0x1f4){logger[_0x593b('0x23')](_0x593b('0x22'),'EventManager',_0x45a9dc[_0x593b('0x23')]);}}})[_0x593b('0x25')](function(_0x2c3326){logger['error'](_0x593b('0x22'),_0x593b('0x1f'),_0x2c3326);});}function afterCreateMessage(_0x3aecb7){return function(_0x2adcbc){_0x2adcbc=_0x2adcbc[_0x593b('0x26')]({'plain':!![]});_0x2adcbc[_0x593b('0x27')]=_0x3aecb7;_0x2adcbc['motionChannel']=_0x3aecb7;_0x2adcbc[_0x593b('0x28')]=_0x2adcbc[_0x593b('0x29')];Promise[_0x593b('0x2a')]()[_0x593b('0x20')](function(){if(typeof _0x2adcbc[_0x593b('0x2b')]===_0x593b('0x2c'))return null;var _0x3b47b9=_0x593b('0x2d')+_0x2adcbc[_0x593b('0x2b')];return db[_0x593b('0x2e')][_0x593b('0x2f')](_0x3b47b9,{'type':db[_0x593b('0x30')]['QueryTypes'][_0x593b('0x31')],'raw':!![]});})[_0x593b('0x20')](function(_0x430280){if(_0x430280){_0x2adcbc[_0x593b('0x32')]=_0x430280[0x0];}if(typeof _0x2adcbc['UserId']===_0x593b('0x2c'))return;return getAgent(_0x2adcbc[_0x593b('0x33')]);})['then'](function(_0x52a9c5){if(_0x52a9c5){_0x2adcbc['interface']=util[_0x593b('0x34')](_0x593b('0x35'),_0x52a9c5['name']);_0x2adcbc['agent']=_0x52a9c5;_0x2adcbc['channel']=_0x3aecb7;return request({'event':_0x593b('0x36'),'message':_0x2adcbc});}else{return request({'event':_0x593b('0x37'),'message':_0x2adcbc});}})[_0x593b('0x25')](function(_0x5bc622){logger['error'](_0x593b('0x22'),'AfterCreateMessage',_0x5bc622);});};}function afterCreateOfflineMessage(_0x23bb1a){return function(_0x5a5ec0){_0x5a5ec0=_0x5a5ec0[_0x593b('0x26')]({'plain':!![]});_0x5a5ec0[_0x593b('0x27')]=_0x23bb1a;_0x5a5ec0[_0x593b('0x38')]=_0x23bb1a;_0x5a5ec0[_0x593b('0x28')]='offlineMessage';return request({'event':_0x5a5ec0[_0x593b('0x28')],'message':_0x5a5ec0});};}function afterCreate(_0x270713,_0x4006a1){return function(_0xcd2ee9){_0xcd2ee9=_0xcd2ee9[_0x593b('0x26')]({'plain':!![]});_0xcd2ee9['channel']=_0x270713;_0xcd2ee9[_0x593b('0x38')]=_0x270713;_0xcd2ee9[_0x593b('0x28')]=_0x593b('0x39');Promise['resolve']()[_0x593b('0x20')](function(){var _0x6bbf84=_0x593b('0x2d')+_0xcd2ee9[_0x593b('0x2b')];return db[_0x593b('0x2e')]['query'](_0x6bbf84,{'type':db[_0x593b('0x30')][_0x593b('0x3a')][_0x593b('0x31')],'raw':!![]});})['then'](function(_0x3f14ac){if(_0x3f14ac){_0xcd2ee9[_0x593b('0x32')]=_0x3f14ac[0x0];}if(typeof _0xcd2ee9[_0x593b('0x33')]===_0x593b('0x2c'))return;return getAgent(_0xcd2ee9[_0x593b('0x33')]);})[_0x593b('0x20')](function(_0x27d009){if(_0x27d009){_0xcd2ee9['interface']=util[_0x593b('0x34')](_0x593b('0x35'),_0x27d009[_0x593b('0x3b')]);_0xcd2ee9['agent']=_0x27d009;}return request({'event':_0x4006a1,'message':_0xcd2ee9});})[_0x593b('0x25')](function(_0x1ad9b8){logger['error'](_0x593b('0x22'),_0x593b('0x3c'),_0x1ad9b8);});};}function afterUpdate(_0x1c2c9e){return function(_0x27bfdc){var _0x5bacd3=_0x27bfdc[_0x593b('0x3d')]('closed')&&_0x27bfdc['closed'];var _0xe9df9b=_0x27bfdc[_0x593b('0x3d')](_0x593b('0x3e'));if(_0x5bacd3||_0xe9df9b){var _0x150027=_0x5bacd3?'closedinteraction':_0x593b('0x3e');var _0x987b54=_0x27bfdc[_0x593b('0x26')]({'plain':!![]});_0x987b54[_0x593b('0x27')]=_0x1c2c9e;_0x987b54['motionChannel']=_0x1c2c9e;_0x987b54['event']=_0x5bacd3?_0x593b('0x3f'):_0x593b('0x3e');var _0x26535f=_0x593b('0x2d')+_0x987b54[_0x593b('0x2b')];return db[_0x593b('0x2e')][_0x593b('0x2f')](_0x26535f,{'type':db['Sequelize'][_0x593b('0x3a')][_0x593b('0x31')],'raw':!![]})[_0x593b('0x20')](function(_0x355d3c){if(_0x355d3c){_0x987b54[_0x593b('0x32')]=_0x355d3c[0x0];}if(typeof _0x987b54[_0x593b('0x33')]===_0x593b('0x2c'))return;return getAgent(_0x987b54[_0x593b('0x33')]);})['then'](function(_0x3cecf4){if(_0x3cecf4){_0x987b54['interface']=util[_0x593b('0x34')]('SIP/%s',_0x3cecf4[_0x593b('0x3b')]);_0x987b54[_0x593b('0x40')]=_0x3cecf4;}return request({'event':_0x150027,'message':_0x987b54});})[_0x593b('0x25')](function(_0x402398){logger[_0x593b('0x23')](_0x593b('0x22'),_0x593b('0x41'),_0x402398);});}};}function getAgent(_0x42b462){return db[_0x593b('0x42')][_0x593b('0x43')]({'where':{'id':_0x42b462},'attributes':['id',_0x593b('0x3b'),_0x593b('0x44'),'email',_0x593b('0x45')],'raw':!![]})[_0x593b('0x20')](function(_0xf64b75){return _0xf64b75;});}exports[_0x593b('0x46')]=function(){for(var _0x17d4fd=0x0;_0x17d4fd=_0x49d53f[_0xba27('0x14')]){throw Error(_0xba27('0x15'));}_0x29a633(_0x292720);})['catch'](function(_0x471aa0){_0x20b336(_0x471aa0);});});}; \ No newline at end of file +var _0x591b=['whatsapp','openchannel','isValidChannel','toLowerCase','clearBlockUser','updateAttributes','getLicense','role','agent','count','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird','../mysqldb','./license/util','voice','chat','fax','sms'];(function(_0x16e4ae,_0x292ad2){var _0x478f50=function(_0x1806b5){while(--_0x1806b5){_0x16e4ae['push'](_0x16e4ae['shift']());}};_0x478f50(++_0x292ad2);}(_0x591b,0x12c));var _0xb591=function(_0x447d20,_0x208a8f){_0x447d20=_0x447d20-0x0;var _0x3f7537=_0x591b[_0x447d20];return _0x3f7537;};'use strict';var _=require(_0xb591('0x0'));var BPromise=require(_0xb591('0x1'));var db=require(_0xb591('0x2'))['db'];var util=require(_0xb591('0x3'));var channels=[_0xb591('0x4'),'mail',_0xb591('0x5'),_0xb591('0x6'),_0xb591('0x7'),_0xb591('0x8'),_0xb591('0x9')];exports['getChannels']=function(){return channels;};exports[_0xb591('0xa')]=function(_0x43486){_0x43486=_0x43486[_0xb591('0xb')]();return _['includes'](channels,_0x43486);};exports[_0xb591('0xc')]=function(_0x2791ea,_0x42e61d,_0x171d35,_0x254ccc){var _0x5aecc6={'loginAttempts':_0x42e61d,'blocked':_0x171d35};if(!_['isUndefined'](_0x254ccc)){_0x5aecc6['blockedAt']=_0x254ccc;}return _0x2791ea[_0xb591('0xd')](_0x5aecc6);};exports[_0xb591('0xe')]=function(_0x653643){return new BPromise(function(_0x27887a,_0xaa1e24){var _0x370b53=0x0;if(_0x653643[_0xb591('0xf')]!==_0xb591('0x10')){_0x27887a(_0x653643);}db['User'][_0xb591('0x11')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x653643['id']}}})['then'](function(_0x4b6ffe){_0x370b53=_0x4b6ffe;return util['getLicense']();})[_0xb591('0x12')](function(_0x9114e1){if(_0x9114e1&&_0x9114e1[_0xb591('0x13')]&&_0x370b53>=_0x9114e1['agents']){throw Error(_0xb591('0x14'));}_0x27887a(_0x653643);})[_0xb591('0x15')](function(_0x4c6c02){_0xaa1e24(_0x4c6c02);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index d13cb88..c5bd9c6 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaf3a=['status','json','send','404'];(function(_0x33c79f,_0x155496){var _0x2a4e7e=function(_0xe8535a){while(--_0xe8535a){_0x33c79f['push'](_0x33c79f['shift']());}};_0x2a4e7e(++_0x155496);}(_0xaf3a,0xef));var _0xaaf3=function(_0x537c37,_0x536e74){_0x537c37=_0x537c37-0x0;var _0x241f84=_0xaf3a[_0x537c37];return _0x241f84;};'use strict';module['exports'][0x194]=function pageNotFound(_0x54f31c,_0x2eb713){var _0x585109=_0xaaf3('0x0');var _0x1b488c=0x194;var _0x464c4a={'status':_0x1b488c};_0x2eb713['status'](_0x464c4a['status']);_0x2eb713['render'](_0x585109,{},function(_0x1aa3cd,_0x583fd2){if(_0x1aa3cd){return _0x2eb713['status'](_0x464c4a[_0xaaf3('0x1')])[_0xaaf3('0x2')](_0x464c4a);}_0x2eb713[_0xaaf3('0x3')](_0x583fd2);});}; \ No newline at end of file +var _0x854f=['send','exports','404','status','render','json'];(function(_0x4d07cc,_0x587613){var _0x42de3b=function(_0x201f78){while(--_0x201f78){_0x4d07cc['push'](_0x4d07cc['shift']());}};_0x42de3b(++_0x587613);}(_0x854f,0xc1));var _0xf854=function(_0x354958,_0x266f8d){_0x354958=_0x354958-0x0;var _0xb36e7=_0x854f[_0x354958];return _0xb36e7;};'use strict';module[_0xf854('0x0')][0x194]=function pageNotFound(_0x9502db,_0x30b6be){var _0x26c15e=_0xf854('0x1');var _0x268da2=0x194;var _0x58bb93={'status':_0x268da2};_0x30b6be[_0xf854('0x2')](_0x58bb93['status']);_0x30b6be[_0xf854('0x3')](_0x26c15e,{},function(_0x1d96f3,_0x1b350f){if(_0x1d96f3){return _0x30b6be[_0xf854('0x2')](_0x58bb93['status'])[_0xf854('0x4')](_0x58bb93);}_0x30b6be[_0xf854('0x5')](_0x1b350f);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index ce30d4b..b9c96c9 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x14e4=['CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','../api/user-setting/user-setting.model','User','hasOne','cascade','UserId','hasMany','VoiceExtension','Extensions','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteractions','MailInteraction','MailInteractions','WhatsappInteractions','UserNotification','UserNotifications','SenderId','belongsTo','UserProfile','userProfileId','belongsToMany','CmContact','Contacts','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','UserVoiceQueue','VoicePrefixes','MailQueues','ChatQueues','UserChatQueue','FaxQueues','SmsQueue','SmsQueues','UserSmsQueue','OpenchannelQueues','WhatsappQueues','CmList','ChatWebsite','ChatWebsites','user_has_chat_websites','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','SmsAccounts','user_has_sms_accounts','WhatsappAccount','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','Applications','Sounds','UserVoiceQueueRt','VoiceQueueId','HopperFinals','HopperHistories','HopperBlacks','JscriptySessions','TrunkBackup','Interval','mandatoryDispositionPause','Agents','Teams','BlackLists','mailboxuser','mailbox','QueueCalls','uniqueid','AgentReports','Contact','CloudProviderId','MailAccountId','restrict','Imap','Interactions','ListId','TemplateId','team_has_mail_queues','Messages','MailInteractionId','Account','ContactId','Owner','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachments','ChatWebsiteId','ChatOfflineMessageId','IntervalId','List','Items','Dispositions','FaxAccountId','Exntensions','FaxMessage','mandatoryDispositionPauseId','TagId','fax_interaction_has_tags','FaxInteractionId','Interaction','AttachmentId','team_has_fax_queues','Answers','SmsAccountId','sms_interaction_has_tags','user_has_sms_interactions','SmsInteractionId','team_has_sms_queues','OpenchannelAccountId','user_has_openchannel_accounts','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ChatInteraction','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroup','ChatInternalMessage','ChatGroupId','Members','chat_group_has_users','CmCompany','CompanyId','Hoppers','Company','cm_user_has_contacts','cm_contact_has_tags','OwnerId','CampaignId','OneAll','AutomationAllId','Condition','Any','Actions','AutomationId','ParentId','Intervals','ChatApplications','FaxApplications','DefaultReportId','CustomReportId','Mohs','moh_has_sounds','WhatsappInteraction','whatsapp_interaction_has_tags','Trigger','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','AnalyticFieldReport','Fields','MetricId','Subjects','Descriptions','DescriptionId','AccountId','Subject','SubjectId','Description','Field','VariableId','Configurations','FieldId','int_desk_configuration_has_tags','ZendeskField','FreshdeskAccount','int_freshdesk_configuration_has_tags','ServicenowConfiguration','Dynamics365Configuration','FreshsalesField','FromId','ToId','SessionId','JscriptyProject','ProjectId','team_has_whatsapp_queues','TrunkId','SquareProjectId','MailTransferReport','FromMailAccountId','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToMailAccountId','ToAccount','ChatTransferReport','FromAccount','ToChatQueueId','ToQueue','ToChatWebsiteId','FaxTransferReport','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','CmCustomField','Queues','voice_queues_has_cm_lists','UserProfileSections','WhatsappAccountId','WhatsappInteractionId','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','UserSetting','user','Smtp','exports','../config/environment','sequelize','lodash','jstz','determine','defaultsDeep','xC@LL1234','127.0.0.1','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','motion2','xcall','mysql','database','password','options','username','import','VoiceChanSpy','VoiceContext','../api/voiceContext/voiceContext.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','../api/mailInteraction/mailInteraction.model','MailMessage','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','../api/cmContact/cmContact.model','CmHopper','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','Disposition','../api/disposition/disposition.model','../api/condition/condition.model','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','Tag','../api/tag/tag.model','Template','../api/template/template.model','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','AnalyticExtractedReport','AnalyticMetric','../api/analyticMetric/analyticMetric.model','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','SalesforceField','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','../api/intFreshsalesField/intFreshsalesField.model','../api/integration/integration.model','Network','../api/network/network.model','ChatQueueReport','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userNotification/userNotification.model','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model'];(function(_0x56f02a,_0xa5d71c){var _0x471088=function(_0x5497fe){while(--_0x5497fe){_0x56f02a['push'](_0x56f02a['shift']());}};_0x471088(++_0xa5d71c);}(_0x14e4,0xf5));var _0x414e=function(_0x3834e6,_0x3716eb){_0x3834e6=_0x3834e6-0x0;var _0x4d50e4=_0x14e4[_0x3834e6];return _0x4d50e4;};'use strict';var config=require(_0x414e('0x0'));var Sequelize=require(_0x414e('0x1'));var _=require(_0x414e('0x2'));var jstz=require(_0x414e('0x3'));var timezone=jstz[_0x414e('0x4')]();config['sequelize']=_[_0x414e('0x5')](config[_0x414e('0x1')],{'database':'motion2','username':'xcall','password':_0x414e('0x6'),'options':{'host':_0x414e('0x7'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x414e('0x8')},'logging':![],'timezone':timezone[_0x414e('0x9')](),'define':{'charset':_0x414e('0xa'),'collate':_0x414e('0xb')}}});config[_0x414e('0xc')]=_[_0x414e('0x5')](config['sequelizeHistory'],{'database':_0x414e('0xd'),'username':_0x414e('0xe'),'password':_0x414e('0x6'),'options':{'host':_0x414e('0x7'),'port':0xcea,'dialect':_0x414e('0xf'),'dialectOptions':{'charset':_0x414e('0x8')},'logging':![],'timezone':timezone[_0x414e('0x9')](),'define':{'charset':'utf8','collate':_0x414e('0xb')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x414e('0x1')][_0x414e('0x10')],config[_0x414e('0x1')]['username'],config[_0x414e('0x1')][_0x414e('0x11')],config[_0x414e('0x1')][_0x414e('0x12')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x414e('0xc')][_0x414e('0x10')],config['sequelizeHistory'][_0x414e('0x13')],config[_0x414e('0xc')]['password'],config[_0x414e('0xc')][_0x414e('0x12')])};db['User']=db[_0x414e('0x1')][_0x414e('0x14')]('../api/user/user.model');db[_0x414e('0x15')]=db[_0x414e('0x1')][_0x414e('0x14')]('../api/voiceChanSpy/voiceChanSpy.model');db[_0x414e('0x16')]=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0x17'));db['VoiceExtension']=db['sequelize'][_0x414e('0x14')]('../api/voiceExtension/voiceExtension.model');db[_0x414e('0x18')]=db[_0x414e('0x1')]['import'](_0x414e('0x19'));db[_0x414e('0x1a')]=db['sequelize'][_0x414e('0x14')](_0x414e('0x1b'));db[_0x414e('0x1c')]=db['sequelize'][_0x414e('0x14')](_0x414e('0x1d'));db[_0x414e('0x1e')]=db['sequelize']['import'](_0x414e('0x1f'));db[_0x414e('0x20')]=db[_0x414e('0x1')]['import'](_0x414e('0x21'));db[_0x414e('0x22')]=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0x23'));db[_0x414e('0x24')]=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0x25'));db[_0x414e('0x26')]=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0x27'));db[_0x414e('0x28')]=db['sequelize'][_0x414e('0x14')]('../api/voiceAgentReport/voiceAgentReport.model');db[_0x414e('0x29')]=db['sequelize'][_0x414e('0x14')](_0x414e('0x2a'));db[_0x414e('0x2b')]=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0x2c'));db[_0x414e('0x2d')]=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0x2e'));db[_0x414e('0x2f')]=db['sequelize'][_0x414e('0x14')](_0x414e('0x30'));db['UserVoiceQueueRt']=db[_0x414e('0x1')]['import']('../api/userVoiceQueueRt/userVoiceQueueRt.model');db['UserVoiceQueue']=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0x31'));db['UserChatQueue']=db[_0x414e('0x1')]['import'](_0x414e('0x32'));db[_0x414e('0x33')]=db[_0x414e('0x1')]['import'](_0x414e('0x34'));db[_0x414e('0x35')]=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0x36'));db['UserSmsQueue']=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0x37'));db[_0x414e('0x38')]=db[_0x414e('0x1')]['import'](_0x414e('0x39'));db['UserWhatsappQueue']=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0x3a'));db[_0x414e('0x3b')]=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0x3c'));db[_0x414e('0x3d')]=db['sequelize'][_0x414e('0x14')](_0x414e('0x3e'));db[_0x414e('0x3f')]=db['sequelize'][_0x414e('0x14')]('../api/mailAccount/mailAccount.model');db[_0x414e('0x40')]=db[_0x414e('0x1')]['import'](_0x414e('0x41'));db[_0x414e('0x42')]=db[_0x414e('0x1')]['import'](_0x414e('0x43'));db['MailInteraction']=db[_0x414e('0x1')]['import'](_0x414e('0x44'));db[_0x414e('0x45')]=db['sequelize']['import']('../api/mailMessage/mailMessage.model');db[_0x414e('0x46')]=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0x47'));db[_0x414e('0x48')]=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0x49'));db[_0x414e('0x4a')]=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0x4b'));db[_0x414e('0x4c')]=db['sequelize']['import'](_0x414e('0x4d'));db[_0x414e('0x4e')]=db[_0x414e('0x1')]['import'](_0x414e('0x4f'));db[_0x414e('0x50')]=db[_0x414e('0x1')]['import'](_0x414e('0x51'));db[_0x414e('0x52')]=db[_0x414e('0x1')]['import']('../api/faxInteraction/faxInteraction.model');db['FaxMessage']=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0x53'));db[_0x414e('0x54')]=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0x55'));db[_0x414e('0x56')]=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0x57'));db[_0x414e('0x58')]=db['sequelize'][_0x414e('0x14')](_0x414e('0x59'));db[_0x414e('0x5a')]=db['sequelize'][_0x414e('0x14')](_0x414e('0x5b'));db[_0x414e('0x5c')]=db[_0x414e('0x1')]['import'](_0x414e('0x5d'));db[_0x414e('0x5e')]=db[_0x414e('0x1')]['import'](_0x414e('0x5f'));db['SmsQueue']=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0x60'));db[_0x414e('0x61')]=db['sequelize']['import'](_0x414e('0x62'));db[_0x414e('0x63')]=db[_0x414e('0x1')]['import'](_0x414e('0x64'));db[_0x414e('0x65')]=db[_0x414e('0x1')]['import'](_0x414e('0x66'));db[_0x414e('0x67')]=db[_0x414e('0x1')]['import'](_0x414e('0x68'));db[_0x414e('0x69')]=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0x6a'));db['ChatWebsite']=db['sequelize'][_0x414e('0x14')](_0x414e('0x6b'));db[_0x414e('0x6c')]=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0x6d'));db[_0x414e('0x6e')]=db[_0x414e('0x1')][_0x414e('0x14')]('../api/chatApplication/chatApplication.model');db['ChatInteraction']=db[_0x414e('0x1')][_0x414e('0x14')]('../api/chatInteraction/chatInteraction.model');db[_0x414e('0x6f')]=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0x70'));db[_0x414e('0x71')]=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0x72'));db[_0x414e('0x73')]=db['sequelize'][_0x414e('0x14')]('../api/chatQueue/chatQueue.model');db['ChatGroup']=db[_0x414e('0x1')][_0x414e('0x14')]('../api/chatGroup/chatGroup.model');db[_0x414e('0x74')]=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0x75'));db['CmCompany']=db['sequelize'][_0x414e('0x14')]('../api/cmCompany/cmCompany.model');db['CmContact']=db[_0x414e('0x1')]['import'](_0x414e('0x76'));db[_0x414e('0x77')]=db[_0x414e('0x1')][_0x414e('0x14')]('../api/cmHopper/cmHopper.model');db[_0x414e('0x78')]=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0x79'));db[_0x414e('0x7a')]=db[_0x414e('0x1')]['import'](_0x414e('0x7b'));db[_0x414e('0x7c')]=db['sequelize'][_0x414e('0x14')](_0x414e('0x7d'));db[_0x414e('0x7e')]=db['sequelize'][_0x414e('0x14')](_0x414e('0x7f'));db['CmCustomField']=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0x80'));db[_0x414e('0x81')]=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0x82'));db[_0x414e('0x83')]=db[_0x414e('0x1')]['import'](_0x414e('0x84'));db[_0x414e('0x85')]=db['sequelize']['import']('../api/cannedAnswer/cannedAnswer.model');db[_0x414e('0x86')]=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0x87'));db['Condition']=db[_0x414e('0x1')]['import'](_0x414e('0x88'));db['Interval']=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0x89'));db[_0x414e('0x8a')]=db['sequelize'][_0x414e('0x14')](_0x414e('0x8b'));db[_0x414e('0x8c')]=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0x8d'));db['VoiceQueuesLog']=db[_0x414e('0x1')]['import'](_0x414e('0x8e'));db[_0x414e('0x8f')]=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0x90'));db[_0x414e('0x91')]=db[_0x414e('0x1')][_0x414e('0x14')]('../api/sound/sound.model');db[_0x414e('0x92')]=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0x93'));db[_0x414e('0x94')]=db[_0x414e('0x1')]['import'](_0x414e('0x95'));db['Trigger']=db[_0x414e('0x1')]['import'](_0x414e('0x96'));db[_0x414e('0x97')]=db['sequelize'][_0x414e('0x14')](_0x414e('0x98'));db[_0x414e('0x99')]=db['sequelize'][_0x414e('0x14')]('../api/integration/integration.model');db[_0x414e('0x9a')]=db['sequelize'][_0x414e('0x14')](_0x414e('0x9b'));db[_0x414e('0x9c')]=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0x9d'));db[_0x414e('0x9e')]=db[_0x414e('0x1')][_0x414e('0x14')]('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0x414e('0x9f')]=db[_0x414e('0x1')][_0x414e('0x14')]('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0x414e('0xa0')]=db['sequelize']['import'](_0x414e('0xa1'));db['AnalyticFieldReport']=db['sequelize'][_0x414e('0x14')](_0x414e('0xa2'));db[_0x414e('0xa3')]=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0xa4'));db[_0x414e('0xa5')]=db['sequelize']['import'](_0x414e('0xa6'));db[_0x414e('0xa7')]=db[_0x414e('0x1')][_0x414e('0x14')]('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db[_0x414e('0xa8')]=db[_0x414e('0x1')]['import']('../api/intSalesforceField/intSalesforceField.model');db[_0x414e('0xa9')]=db[_0x414e('0x1')][_0x414e('0x14')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x414e('0xaa')]=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0xab'));db[_0x414e('0xac')]=db[_0x414e('0x1')]['import'](_0x414e('0xad'));db[_0x414e('0xae')]=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0xaf'));db[_0x414e('0xb0')]=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0xb1'));db[_0x414e('0xb2')]=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0xb3'));db[_0x414e('0xb4')]=db['sequelize']['import'](_0x414e('0xb5'));db[_0x414e('0xb6')]=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0xb7'));db[_0x414e('0xb8')]=db['sequelize'][_0x414e('0x14')](_0x414e('0xb9'));db[_0x414e('0xba')]=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0xbb'));db[_0x414e('0xbc')]=db[_0x414e('0x1')]['import'](_0x414e('0xbd'));db['ZendeskField']=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0xbe'));db['FreshdeskAccount']=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0xbf'));db[_0x414e('0xc0')]=db['sequelize'][_0x414e('0x14')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0x414e('0xc1')]=db['sequelize'][_0x414e('0x14')](_0x414e('0xc2'));db[_0x414e('0xc3')]=db['sequelize'][_0x414e('0x14')](_0x414e('0xc4'));db[_0x414e('0xc5')]=db['sequelize'][_0x414e('0x14')](_0x414e('0xc6'));db[_0x414e('0xc7')]=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0xc8'));db[_0x414e('0xc9')]=db[_0x414e('0x1')]['import'](_0x414e('0xca'));db['ServicenowConfiguration']=db[_0x414e('0x1')][_0x414e('0x14')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0x414e('0xcb')]=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0xcc'));db[_0x414e('0xcd')]=db['sequelize'][_0x414e('0x14')](_0x414e('0xce'));db['Dynamics365Configuration']=db[_0x414e('0x1')]['import'](_0x414e('0xcf'));db[_0x414e('0xd0')]=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0xd1'));db[_0x414e('0xd2')]=db['sequelize'][_0x414e('0x14')]('../api/intFreshsalesAccount/intFreshsalesAccount.model');db[_0x414e('0xd3')]=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0xd4'));db['FreshsalesField']=db[_0x414e('0x1')]['import'](_0x414e('0xd5'));db[_0x414e('0x99')]=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0xd6'));db[_0x414e('0xd7')]=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0xd8'));db[_0x414e('0xd9')]=db[_0x414e('0x1')][_0x414e('0x14')]('../api/chatQueueReport/chatQueueReport.model');db['ChatInternalMessage']=db[_0x414e('0x1')]['import'](_0x414e('0xda'));db[_0x414e('0xdb')]=db['sequelize'][_0x414e('0x14')](_0x414e('0xdc'));db[_0x414e('0xdd')]=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0xde'));db[_0x414e('0xdf')]=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0xe0'));db[_0x414e('0xe1')]=db['sequelize']['import'](_0x414e('0xe2'));db[_0x414e('0xe3')]=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0xe4'));db[_0x414e('0xe5')]=db[_0x414e('0x1')][_0x414e('0x14')]('../api/squareReportDetail/squareReportDetail.model');db['JscriptyProject']=db['sequelize'][_0x414e('0x14')](_0x414e('0xe6'));db[_0x414e('0xe7')]=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0xe8'));db[_0x414e('0xe9')]=db[_0x414e('0x1')][_0x414e('0x14')]('../api/squareOdbc/squareOdbc.model');db[_0x414e('0xea')]=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0xeb'));db[_0x414e('0xec')]=db['sequelize']['import'](_0x414e('0xed'));db[_0x414e('0xee')]=db['sequelize'][_0x414e('0x14')](_0x414e('0xef'));db[_0x414e('0xf0')]=db[_0x414e('0x1')][_0x414e('0x14')]('../api/team/team.model');db[_0x414e('0xf1')]=db['sequelize']['import'](_0x414e('0xf2'));db[_0x414e('0xf3')]=db['sequelize'][_0x414e('0x14')](_0x414e('0xf4'));db[_0x414e('0xf5')]=db['sequelize']['import']('../api/migration/migration.model');db[_0x414e('0xf6')]=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0xf7'));db[_0x414e('0xf8')]=db[_0x414e('0x1')]['import'](_0x414e('0xf9'));db['MailTransferReport']=db['sequelize'][_0x414e('0x14')]('../api/mailTransferReport/mailTransferReport.model');db['ChatTransferReport']=db['sequelize'][_0x414e('0x14')]('../api/chatTransferReport/chatTransferReport.model');db['FaxTransferReport']=db['sequelize'][_0x414e('0x14')](_0x414e('0xfa'));db[_0x414e('0xfb')]=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0xfc'));db[_0x414e('0xfd')]=db[_0x414e('0x1')][_0x414e('0x14')]('../api/smsTransferReport/smsTransferReport.model');db['CmList']=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0xfe'));db[_0x414e('0xff')]=db['sequelize']['import'](_0x414e('0x100'));db['UserProfile']=db[_0x414e('0x1')]['import'](_0x414e('0x101'));db[_0x414e('0x102')]=db['sequelize'][_0x414e('0x14')](_0x414e('0x103'));db[_0x414e('0x104')]=db['sequelize'][_0x414e('0x14')]('../api/userProfileResource/userProfileResource.model');db['UserNotification']=db['sequelize'][_0x414e('0x14')](_0x414e('0x105'));db['WhatsappAccount']=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0x106'));db[_0x414e('0x107')]=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0x108'));db['WhatsappInteraction']=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0x109'));db[_0x414e('0x10a')]=db['sequelize']['import'](_0x414e('0x10b'));db[_0x414e('0x10c')]=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0x10d'));db[_0x414e('0x10e')]=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0x10f'));db[_0x414e('0x110')]=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0x111'));db[_0x414e('0x112')]=db['sequelize'][_0x414e('0x14')](_0x414e('0x113'));db[_0x414e('0x114')]=db['sequelize'][_0x414e('0x14')](_0x414e('0x115'));db[_0x414e('0x116')]=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0x117'));db[_0x414e('0x118')]=db[_0x414e('0x1')][_0x414e('0x14')](_0x414e('0x119'));db['UserSetting']=db['sequelize'][_0x414e('0x14')](_0x414e('0x11a'));db[_0x414e('0x11b')][_0x414e('0x11c')](db[_0x414e('0x20')],{'as':_0x414e('0x20'),'onDelete':_0x414e('0x11d'),'foreignKey':_0x414e('0x11e')});db[_0x414e('0x11b')][_0x414e('0x11c')](db['UserSetting'],{'as':'userSetting','onDelete':_0x414e('0x11d'),'foreignKey':_0x414e('0x11e')});db[_0x414e('0x11b')][_0x414e('0x11f')](db[_0x414e('0x1c')],{'as':'Recordings','foreignKey':_0x414e('0x11e')});db['User'][_0x414e('0x11f')](db['UserVoiceQueueRt'],{'as':'VoiceQueuesRt','foreignKey':'UserId'});db[_0x414e('0x11b')][_0x414e('0x11f')](db[_0x414e('0x120')],{'as':_0x414e('0x121'),'onDelete':'cascade','hooks':!![]});db['User'][_0x414e('0x11f')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0x414e('0x11e')});db['User']['hasMany'](db[_0x414e('0x7c')],{'as':_0x414e('0x122'),'foreignKey':_0x414e('0x11e')});db[_0x414e('0x11b')][_0x414e('0x11f')](db[_0x414e('0x7e')],{'as':_0x414e('0x7e'),'foreignKey':_0x414e('0x11e')});db[_0x414e('0x11b')]['hasMany'](db[_0x414e('0x65')],{'as':_0x414e('0x123'),'foreignKey':_0x414e('0x11e')});db[_0x414e('0x11b')][_0x414e('0x11f')](db['ChatInteraction'],{'as':_0x414e('0x124'),'foreignKey':_0x414e('0x11e')});db[_0x414e('0x11b')][_0x414e('0x11f')](db[_0x414e('0x5c')],{'as':_0x414e('0x125'),'foreignKey':_0x414e('0x11e')});db[_0x414e('0x11b')]['hasMany'](db['FaxInteraction'],{'as':_0x414e('0x126'),'foreignKey':_0x414e('0x11e')});db[_0x414e('0x11b')][_0x414e('0x11f')](db[_0x414e('0x127')],{'as':_0x414e('0x128'),'foreignKey':_0x414e('0x11e')});db[_0x414e('0x11b')][_0x414e('0x11f')](db['WhatsappInteraction'],{'as':_0x414e('0x129'),'foreignKey':_0x414e('0x11e')});db[_0x414e('0x11b')][_0x414e('0x11f')](db[_0x414e('0x12a')],{'as':_0x414e('0x12b'),'foreignKey':_0x414e('0x12c')});db[_0x414e('0x11b')][_0x414e('0x12d')](db[_0x414e('0x12e')],{'as':_0x414e('0x12e'),'foreignKey':_0x414e('0x12f')});db[_0x414e('0x11b')][_0x414e('0x130')](db['ChatGroup'],{'as':'Groups','through':'chat_group_has_users'});db[_0x414e('0x11b')][_0x414e('0x130')](db[_0x414e('0x131')],{'as':_0x414e('0x132'),'through':'cm_user_has_contacts'});db[_0x414e('0x11b')]['belongsToMany'](db['CmList'],{'as':_0x414e('0x133'),'through':_0x414e('0x134')});db[_0x414e('0x11b')][_0x414e('0x130')](db[_0x414e('0xf0')],{'through':_0x414e('0x135')});db[_0x414e('0x11b')][_0x414e('0x130')](db[_0x414e('0x127')],{'as':'MailInteractions','through':_0x414e('0x136')});db[_0x414e('0x11b')][_0x414e('0x130')](db['ChatInteraction'],{'as':_0x414e('0x124'),'through':_0x414e('0x137')});db[_0x414e('0x11b')]['belongsToMany'](db[_0x414e('0x52')],{'as':_0x414e('0x126'),'through':_0x414e('0x138')});db['User']['belongsToMany'](db[_0x414e('0x5c')],{'as':_0x414e('0x125'),'through':'user_has_sms_interactions'});db[_0x414e('0x11b')]['belongsToMany'](db[_0x414e('0x65')],{'as':_0x414e('0x123'),'through':_0x414e('0x139')});db[_0x414e('0x11b')]['belongsToMany'](db['WhatsappInteraction'],{'as':'WhatsappInteractions','through':_0x414e('0x13a')});db[_0x414e('0x11b')][_0x414e('0x130')](db[_0x414e('0x1a')],{'as':_0x414e('0x13b'),'through':_0x414e('0x13c'),'required':![]});db[_0x414e('0x11b')][_0x414e('0x130')](db['VoicePrefix'],{'as':_0x414e('0x13d'),'through':_0x414e('0x118'),'required':![]});db[_0x414e('0x11b')][_0x414e('0x130')](db[_0x414e('0x40')],{'as':_0x414e('0x13e'),'through':_0x414e('0x33'),'required':![]});db[_0x414e('0x11b')][_0x414e('0x130')](db['ChatQueue'],{'as':_0x414e('0x13f'),'through':_0x414e('0x140'),'required':![],'hooks':!![]});db['User'][_0x414e('0x130')](db[_0x414e('0x54')],{'as':_0x414e('0x141'),'through':_0x414e('0x35'),'required':![]});db[_0x414e('0x11b')][_0x414e('0x130')](db[_0x414e('0x142')],{'as':_0x414e('0x143'),'through':_0x414e('0x144'),'required':![]});db['User']['belongsToMany'](db[_0x414e('0x69')],{'as':_0x414e('0x145'),'through':'UserOpenchannelQueue','required':![]});db[_0x414e('0x11b')]['belongsToMany'](db[_0x414e('0x110')],{'as':_0x414e('0x146'),'through':'UserWhatsappQueue','required':![]});db[_0x414e('0x11b')][_0x414e('0x130')](db[_0x414e('0x147')],{'through':'cm_user_has_lists'});db[_0x414e('0x11b')]['belongsToMany'](db[_0x414e('0x148')],{'as':_0x414e('0x149'),'through':_0x414e('0x14a')});db[_0x414e('0x11b')]['belongsToMany'](db['FaxAccount'],{'as':'FaxAccounts','through':_0x414e('0x14b')});db[_0x414e('0x11b')][_0x414e('0x130')](db['MailAccount'],{'as':_0x414e('0x14c'),'through':_0x414e('0x14d')});db['User'][_0x414e('0x130')](db['OpenchannelAccount'],{'as':_0x414e('0x14e'),'through':'user_has_openchannel_accounts'});db['User'][_0x414e('0x130')](db[_0x414e('0x58')],{'as':_0x414e('0x14f'),'through':_0x414e('0x150')});db[_0x414e('0x11b')][_0x414e('0x130')](db[_0x414e('0x151')],{'as':_0x414e('0x152'),'through':_0x414e('0x153')});db[_0x414e('0x11b')][_0x414e('0x130')](db[_0x414e('0xea')],{'as':_0x414e('0x154'),'through':_0x414e('0x155')});db[_0x414e('0x15')]['hasMany'](db[_0x414e('0x120')],{'as':_0x414e('0x156'),'onDelete':'cascade','foreignKey':_0x414e('0x157')});db[_0x414e('0x16')][_0x414e('0x11f')](db[_0x414e('0x120')],{'onDelete':'cascade'});db[_0x414e('0x120')]['hasMany'](db[_0x414e('0x120')],{'as':_0x414e('0x158'),'onDelete':_0x414e('0x11d')});db[_0x414e('0x18')][_0x414e('0x130')](db[_0x414e('0x91')],{'as':_0x414e('0x159'),'through':'moh_has_sounds'});db[_0x414e('0x1a')][_0x414e('0x11f')](db[_0x414e('0x15a')],{'as':'Members','foreignKey':_0x414e('0x15b')});db[_0x414e('0x1a')][_0x414e('0x11f')](db['CmHopper'],{'as':'Hoppers','foreignKey':'VoiceQueueId'});db['VoiceQueue']['hasMany'](db[_0x414e('0x7a')],{'as':_0x414e('0x15c'),'foreignKey':_0x414e('0x15b')});db['VoiceQueue'][_0x414e('0x11f')](db['CmHopperHistory'],{'as':_0x414e('0x15d'),'foreignKey':_0x414e('0x15b')});db[_0x414e('0x1a')][_0x414e('0x11f')](db[_0x414e('0x7e')],{'as':_0x414e('0x7e'),'foreignKey':_0x414e('0x15b')});db['VoiceQueue']['hasMany'](db['CmHopperBlack'],{'as':_0x414e('0x15e'),'foreignKey':_0x414e('0x15b')});db[_0x414e('0x1a')]['hasMany'](db[_0x414e('0xdf')],{'as':_0x414e('0x15f'),'foreignKey':_0x414e('0x15b')});db[_0x414e('0x1a')][_0x414e('0x12d')](db[_0x414e('0x2d')],{'as':_0x414e('0x2d'),'foreignKey':'TrunkId'});db[_0x414e('0x1a')][_0x414e('0x12d')](db[_0x414e('0x2d')],{'as':_0x414e('0x160'),'foreignKey':'TrunkBackupId'});db[_0x414e('0x1a')][_0x414e('0x12d')](db[_0x414e('0x161')],{'as':_0x414e('0x161'),'foreignKey':'IntervalId'});db[_0x414e('0x1a')][_0x414e('0x12d')](db[_0x414e('0x8a')],{'as':_0x414e('0x162'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x414e('0x1a')][_0x414e('0x130')](db[_0x414e('0x147')],{'as':_0x414e('0x133'),'through':'voice_queues_has_cm_lists'});db['VoiceQueue'][_0x414e('0x130')](db[_0x414e('0x11b')],{'as':_0x414e('0x163'),'through':_0x414e('0x13c')});db[_0x414e('0x1a')]['belongsToMany'](db[_0x414e('0xf0')],{'as':_0x414e('0x164'),'through':_0x414e('0x114')});db[_0x414e('0x1a')][_0x414e('0x130')](db['CmList'],{'as':_0x414e('0x165'),'through':'voice_queues_has_cm_blacklists'});db[_0x414e('0x1c')][_0x414e('0x12d')](db[_0x414e('0x11b')],{'as':'User','foreignKey':_0x414e('0x11e')});db[_0x414e('0x1e')][_0x414e('0x12d')](db['User'],{'as':'User','foreignKey':_0x414e('0x11e')});db[_0x414e('0x20')][_0x414e('0x11f')](db[_0x414e('0x22')],{'as':'Messages','onDelete':_0x414e('0x11d'),'foreignKey':_0x414e('0x166'),'sourceKey':_0x414e('0x167')});db[_0x414e('0x22')][_0x414e('0x12d')](db[_0x414e('0x20')],{'foreignKey':_0x414e('0x166'),'targetKey':_0x414e('0x167')});db[_0x414e('0x24')]['hasMany'](db[_0x414e('0x29')],{'as':_0x414e('0x168'),'foreignKey':_0x414e('0x169'),'constraints':![]});db['VoiceCallReport'][_0x414e('0x11f')](db[_0x414e('0x28')],{'as':_0x414e('0x16a'),'foreignKey':_0x414e('0x169'),'constraints':![]});db[_0x414e('0x24')][_0x414e('0x12d')](db['User'],{'as':_0x414e('0x11b'),'foreignKey':_0x414e('0x11e')});db['VoiceCallReport'][_0x414e('0x12d')](db['CmContact'],{'as':_0x414e('0x16b'),'foreignKey':'ContactId'});db['MailServerIn'][_0x414e('0x12d')](db['MailAccount'],{'as':'MailAccount','foreignKey':'MailAccountId'});db[_0x414e('0x3b')][_0x414e('0x12d')](db[_0x414e('0x112')],{'as':'CloudProvider','foreignKey':_0x414e('0x16c'),'onDelete':'restrict'});db[_0x414e('0x3d')]['belongsTo'](db[_0x414e('0x3f')],{'as':_0x414e('0x3f'),'foreignKey':_0x414e('0x16d')});db[_0x414e('0x3d')][_0x414e('0x12d')](db[_0x414e('0x112')],{'as':_0x414e('0x112'),'foreignKey':_0x414e('0x16c'),'onDelete':_0x414e('0x16e')});db[_0x414e('0x3f')]['hasOne'](db[_0x414e('0x3b')],{'as':_0x414e('0x16f'),'onDelete':_0x414e('0x11d')});db[_0x414e('0x3f')][_0x414e('0x11c')](db[_0x414e('0x3d')],{'as':'Smtp','onDelete':_0x414e('0x11d')});db[_0x414e('0x3f')]['hasMany'](db['Disposition'],{'as':'Dispositions','foreignKey':_0x414e('0x16d'),'onDelete':_0x414e('0x11d')});db['MailAccount'][_0x414e('0x11f')](db[_0x414e('0x85')],{'as':'Answers','foreignKey':_0x414e('0x16d')});db['MailAccount'][_0x414e('0x11f')](db[_0x414e('0x45')],{'as':'Messages','foreignKey':'MailAccountId'});db[_0x414e('0x3f')][_0x414e('0x11f')](db[_0x414e('0x127')],{'as':_0x414e('0x170')});db[_0x414e('0x3f')][_0x414e('0x11f')](db[_0x414e('0x46')],{'as':_0x414e('0x158')});db['MailAccount'][_0x414e('0x12d')](db[_0x414e('0x147')],{'as':'List','foreignKey':_0x414e('0x171')});db['MailAccount'][_0x414e('0x12d')](db[_0x414e('0x94')],{'as':_0x414e('0x94'),'foreignKey':_0x414e('0x172')});db[_0x414e('0x3f')][_0x414e('0x12d')](db[_0x414e('0x8a')],{'as':_0x414e('0x162'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x414e('0x3f')][_0x414e('0x130')](db['User'],{'as':_0x414e('0x163'),'through':_0x414e('0x14d')});db['MailQueue'][_0x414e('0x130')](db['User'],{'as':_0x414e('0x163'),'through':_0x414e('0x33')});db[_0x414e('0x40')]['belongsToMany'](db[_0x414e('0xf0')],{'through':_0x414e('0x173'),'as':'Teams'});db[_0x414e('0x127')][_0x414e('0x11f')](db['MailMessage'],{'as':_0x414e('0x174'),'onDelete':_0x414e('0x11d'),'foreignKey':_0x414e('0x175')});db[_0x414e('0x127')]['belongsTo'](db['MailAccount'],{'as':_0x414e('0x176'),'foreignKey':'MailAccountId'});db[_0x414e('0x127')][_0x414e('0x12d')](db[_0x414e('0x131')],{'as':_0x414e('0x16b'),'foreignKey':_0x414e('0x177')});db['MailInteraction'][_0x414e('0x12d')](db[_0x414e('0x11b')],{'as':_0x414e('0x178'),'foreignKey':_0x414e('0x11e')});db[_0x414e('0x127')][_0x414e('0x130')](db[_0x414e('0x92')],{'through':_0x414e('0x179'),'as':_0x414e('0x17a')});db[_0x414e('0x127')]['belongsToMany'](db[_0x414e('0x92')],{'through':_0x414e('0x179'),'as':_0x414e('0x17b')});db[_0x414e('0x127')][_0x414e('0x130')](db[_0x414e('0x11b')],{'as':_0x414e('0x17c'),'through':_0x414e('0x136'),'foreignKey':_0x414e('0x175')});db[_0x414e('0x45')][_0x414e('0x11f')](db[_0x414e('0xf6')],{'as':_0x414e('0x17d'),'onDelete':'cascade'});db[_0x414e('0x45')][_0x414e('0x12d')](db['User'],{'as':_0x414e('0x11b')});db[_0x414e('0x45')][_0x414e('0x12d')](db[_0x414e('0x131')],{'onDelete':_0x414e('0x11d'),'as':'Contact'});db[_0x414e('0x45')][_0x414e('0x12d')](db[_0x414e('0x127')],{'as':'Interaction','foreignKey':_0x414e('0x175')});db[_0x414e('0x45')][_0x414e('0x12d')](db[_0x414e('0x3f')],{'as':_0x414e('0x176'),'foreignKey':_0x414e('0x16d')});db['MailMessage']['belongsTo'](db[_0x414e('0x148')],{'as':_0x414e('0x148'),'foreignKey':_0x414e('0x17e')});db[_0x414e('0x45')]['belongsTo'](db['ChatOfflineMessage'],{'as':'ChatOfflineMessage','foreignKey':_0x414e('0x17f')});db[_0x414e('0x46')][_0x414e('0x12d')](db[_0x414e('0x11b')],{'onDelete':_0x414e('0x16e')});db[_0x414e('0x46')]['belongsTo'](db[_0x414e('0x40')],{'onDelete':_0x414e('0x16e')});db[_0x414e('0x46')][_0x414e('0x12d')](db[_0x414e('0x3f')],{'onDelete':_0x414e('0x16e')});db[_0x414e('0x46')]['belongsTo'](db[_0x414e('0x161')],{'onDelete':'restrict','foreignKey':_0x414e('0x180')});db[_0x414e('0x46')][_0x414e('0x12d')](db[_0x414e('0x92')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0x414e('0x48')]['belongsTo'](db[_0x414e('0x3f')],{});db[_0x414e('0x48')]['belongsTo'](db[_0x414e('0x147')],{'as':_0x414e('0x181'),'foreignKey':'ListId'});db[_0x414e('0x48')]['belongsTo'](db[_0x414e('0x131')],{'as':_0x414e('0x16b'),'foreignKey':_0x414e('0x177')});db['MailQueueReport'][_0x414e('0x12d')](db[_0x414e('0x127')],{});db[_0x414e('0x48')]['belongsTo'](db[_0x414e('0x45')],{});db[_0x414e('0x48')][_0x414e('0x12d')](db[_0x414e('0x11b')],{});db['MailQueueReport'][_0x414e('0x12d')](db[_0x414e('0x40')],{});db[_0x414e('0x4a')][_0x414e('0x11f')](db[_0x414e('0x4c')],{'as':_0x414e('0x182'),'onDelete':'cascade'});db[_0x414e('0x4e')]['hasMany'](db[_0x414e('0x86')],{'as':_0x414e('0x183'),'foreignKey':'FaxAccountId','onDelete':_0x414e('0x11d')});db['FaxAccount'][_0x414e('0x11f')](db[_0x414e('0x85')],{'as':'Answers','foreignKey':_0x414e('0x184')});db[_0x414e('0x4e')][_0x414e('0x11f')](db[_0x414e('0x52')],{'as':_0x414e('0x170')});db[_0x414e('0x4e')][_0x414e('0x11f')](db[_0x414e('0x50')],{'as':_0x414e('0x158')});db[_0x414e('0x4e')][_0x414e('0x11f')](db[_0x414e('0x120')],{'as':_0x414e('0x185'),'onDelete':'cascade'});db[_0x414e('0x4e')][_0x414e('0x11f')](db[_0x414e('0x186')],{'as':'Messages'});db[_0x414e('0x4e')][_0x414e('0x12d')](db[_0x414e('0x2d')],{'as':_0x414e('0x2d')});db['FaxAccount'][_0x414e('0x12d')](db[_0x414e('0x147')],{'as':_0x414e('0x181'),'foreignKey':'ListId'});db[_0x414e('0x4e')][_0x414e('0x12d')](db[_0x414e('0x8a')],{'as':_0x414e('0x162'),'foreignKey':_0x414e('0x187')});db[_0x414e('0x4e')]['belongsToMany'](db[_0x414e('0x11b')],{'as':_0x414e('0x163'),'through':_0x414e('0x14b')});db['FaxApplication']['belongsTo'](db['User'],{'onDelete':'restrict'});db[_0x414e('0x50')][_0x414e('0x12d')](db[_0x414e('0x54')],{'onDelete':_0x414e('0x16e')});db[_0x414e('0x50')][_0x414e('0x12d')](db[_0x414e('0x4e')],{'onDelete':_0x414e('0x16e')});db[_0x414e('0x50')]['belongsTo'](db[_0x414e('0x92')],{'onDelete':'restrict','foreignKey':_0x414e('0x188')});db['FaxInteraction']['hasMany'](db[_0x414e('0x186')],{'as':_0x414e('0x174'),'onDelete':_0x414e('0x11d'),'foreignKey':'FaxInteractionId'});db[_0x414e('0x52')][_0x414e('0x12d')](db[_0x414e('0x4e')],{'as':'Account','foreignKey':_0x414e('0x184')});db[_0x414e('0x52')][_0x414e('0x12d')](db[_0x414e('0x131')],{'as':_0x414e('0x16b'),'foreignKey':_0x414e('0x177')});db[_0x414e('0x52')][_0x414e('0x12d')](db[_0x414e('0x11b')],{'as':_0x414e('0x178'),'foreignKey':_0x414e('0x11e')});db['FaxInteraction'][_0x414e('0x130')](db[_0x414e('0x92')],{'through':_0x414e('0x189'),'as':_0x414e('0x17a')});db['FaxInteraction'][_0x414e('0x130')](db[_0x414e('0x92')],{'through':_0x414e('0x189'),'as':'ThroughTags'});db[_0x414e('0x52')][_0x414e('0x130')](db[_0x414e('0x11b')],{'as':_0x414e('0x17c'),'through':_0x414e('0x138'),'foreignKey':_0x414e('0x18a')});db[_0x414e('0x186')]['belongsTo'](db[_0x414e('0x11b')],{'onDelete':_0x414e('0x11d'),'as':_0x414e('0x11b')});db[_0x414e('0x186')][_0x414e('0x12d')](db[_0x414e('0x52')],{'as':_0x414e('0x18b'),'foreignKey':_0x414e('0x18a')});db[_0x414e('0x186')][_0x414e('0x12d')](db['CmContact'],{'onDelete':_0x414e('0x11d'),'as':_0x414e('0x16b')});db[_0x414e('0x186')][_0x414e('0x12d')](db['Attachment'],{'as':'Attachment','foreignKey':_0x414e('0x18c')});db[_0x414e('0x186')][_0x414e('0x12d')](db['FaxAccount'],{'as':_0x414e('0x176'),'foreignKey':_0x414e('0x184')});db['FaxQueue'][_0x414e('0x130')](db[_0x414e('0x11b')],{'as':_0x414e('0x163'),'through':'UserFaxQueue'});db[_0x414e('0x54')][_0x414e('0x130')](db[_0x414e('0xf0')],{'through':_0x414e('0x18d'),'as':_0x414e('0x164')});db[_0x414e('0x56')][_0x414e('0x12d')](db[_0x414e('0x4e')],{});db[_0x414e('0x56')][_0x414e('0x12d')](db[_0x414e('0x147')],{'as':'List','foreignKey':'ListId'});db[_0x414e('0x56')][_0x414e('0x12d')](db[_0x414e('0x131')],{'as':_0x414e('0x16b'),'foreignKey':_0x414e('0x177')});db[_0x414e('0x56')][_0x414e('0x12d')](db['FaxInteraction'],{});db[_0x414e('0x56')][_0x414e('0x12d')](db['FaxMessage'],{});db[_0x414e('0x56')][_0x414e('0x12d')](db[_0x414e('0x11b')],{});db[_0x414e('0x56')][_0x414e('0x12d')](db[_0x414e('0x54')],{});db[_0x414e('0x58')][_0x414e('0x11f')](db['Disposition'],{'as':_0x414e('0x183'),'foreignKey':'SmsAccountId','onDelete':_0x414e('0x11d')});db['SmsAccount'][_0x414e('0x11f')](db[_0x414e('0x85')],{'as':_0x414e('0x18e'),'foreignKey':_0x414e('0x18f')});db[_0x414e('0x58')]['hasMany'](db[_0x414e('0x5e')],{'as':_0x414e('0x174'),'foreignKey':_0x414e('0x18f')});db[_0x414e('0x58')][_0x414e('0x11f')](db[_0x414e('0x5c')],{'as':_0x414e('0x170')});db[_0x414e('0x58')][_0x414e('0x11f')](db[_0x414e('0x5a')],{'as':_0x414e('0x158')});db[_0x414e('0x58')][_0x414e('0x12d')](db['CmList'],{'as':_0x414e('0x181'),'foreignKey':'ListId'});db['SmsAccount']['belongsTo'](db['Pause'],{'as':_0x414e('0x162'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x414e('0x58')][_0x414e('0x130')](db[_0x414e('0x11b')],{'as':_0x414e('0x163'),'through':_0x414e('0x150')});db[_0x414e('0x5a')][_0x414e('0x12d')](db[_0x414e('0x11b')],{'onDelete':_0x414e('0x16e')});db[_0x414e('0x5a')]['belongsTo'](db[_0x414e('0x142')],{'onDelete':_0x414e('0x16e')});db[_0x414e('0x5a')][_0x414e('0x12d')](db['SmsAccount'],{'onDelete':'restrict'});db[_0x414e('0x5a')]['belongsTo'](db[_0x414e('0x161')],{'onDelete':_0x414e('0x16e'),'foreignKey':_0x414e('0x180')});db['SmsApplication'][_0x414e('0x12d')](db[_0x414e('0x92')],{'onDelete':'restrict','foreignKey':_0x414e('0x188')});db[_0x414e('0x5c')][_0x414e('0x11f')](db['SmsMessage'],{'as':_0x414e('0x174'),'onDelete':_0x414e('0x11d'),'foreignKey':'SmsInteractionId'});db['SmsInteraction'][_0x414e('0x12d')](db[_0x414e('0x58')],{'as':'Account','foreignKey':_0x414e('0x18f')});db[_0x414e('0x5c')][_0x414e('0x12d')](db[_0x414e('0x131')],{'as':_0x414e('0x16b'),'foreignKey':'ContactId'});db['SmsInteraction'][_0x414e('0x12d')](db['User'],{'as':'Owner','foreignKey':_0x414e('0x11e')});db[_0x414e('0x5c')][_0x414e('0x130')](db['Tag'],{'through':_0x414e('0x190'),'as':_0x414e('0x17a')});db[_0x414e('0x5c')]['belongsToMany'](db[_0x414e('0x92')],{'through':_0x414e('0x190'),'as':'ThroughTags'});db[_0x414e('0x5c')][_0x414e('0x130')](db[_0x414e('0x11b')],{'as':_0x414e('0x17c'),'through':_0x414e('0x191'),'foreignKey':_0x414e('0x192')});db['SmsMessage']['belongsTo'](db[_0x414e('0x11b')],{'as':_0x414e('0x11b')});db['SmsMessage'][_0x414e('0x12d')](db[_0x414e('0x131')],{'onDelete':_0x414e('0x11d'),'as':_0x414e('0x16b')});db[_0x414e('0x5e')][_0x414e('0x12d')](db['SmsInteraction'],{'onDelete':_0x414e('0x11d'),'as':_0x414e('0x18b'),'foreignKey':_0x414e('0x192')});db[_0x414e('0x5e')][_0x414e('0x12d')](db['SmsAccount'],{'as':_0x414e('0x176'),'foreignKey':_0x414e('0x18f')});db[_0x414e('0x142')][_0x414e('0x130')](db[_0x414e('0x11b')],{'as':_0x414e('0x163'),'through':'UserSmsQueue','foreignKey':'SmsQueueId'});db[_0x414e('0x142')][_0x414e('0x130')](db['Team'],{'through':_0x414e('0x193'),'as':_0x414e('0x164')});db[_0x414e('0x61')][_0x414e('0x11f')](db['Disposition'],{'as':_0x414e('0x183'),'foreignKey':_0x414e('0x194'),'onDelete':_0x414e('0x11d')});db['OpenchannelAccount'][_0x414e('0x11f')](db['CannedAnswer'],{'as':_0x414e('0x18e'),'foreignKey':_0x414e('0x194')});db[_0x414e('0x61')][_0x414e('0x11f')](db[_0x414e('0x65')],{'as':_0x414e('0x170'),'foreignKey':_0x414e('0x194')});db[_0x414e('0x61')][_0x414e('0x11f')](db[_0x414e('0x67')],{'as':_0x414e('0x174'),'foreignKey':_0x414e('0x194')});db['OpenchannelAccount'][_0x414e('0x11f')](db[_0x414e('0x63')],{'as':'Applications','foreignKey':_0x414e('0x194')});db[_0x414e('0x61')][_0x414e('0x12d')](db['CmList'],{'as':_0x414e('0x181'),'foreignKey':_0x414e('0x171')});db[_0x414e('0x61')][_0x414e('0x12d')](db[_0x414e('0x8a')],{'as':_0x414e('0x162'),'foreignKey':_0x414e('0x187')});db['OpenchannelAccount']['belongsToMany'](db[_0x414e('0x11b')],{'as':_0x414e('0x163'),'through':_0x414e('0x195')});db['OpenchannelApplication']['belongsTo'](db['User'],{'onDelete':_0x414e('0x16e')});db[_0x414e('0x63')][_0x414e('0x12d')](db['OpenchannelQueue'],{'onDelete':'restrict','foreignKey':_0x414e('0x196')});db['OpenchannelApplication'][_0x414e('0x12d')](db['OpenchannelAccount'],{'onDelete':_0x414e('0x16e'),'foreignKey':'OpenchannelAccountId'});db[_0x414e('0x63')][_0x414e('0x12d')](db[_0x414e('0x161')],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0x414e('0x63')][_0x414e('0x12d')](db[_0x414e('0x92')],{'onDelete':_0x414e('0x16e'),'foreignKey':'TagId'});db[_0x414e('0x65')]['hasMany'](db[_0x414e('0x67')],{'as':_0x414e('0x174'),'onDelete':_0x414e('0x11d'),'foreignKey':_0x414e('0x197')});db['OpenchannelInteraction']['belongsTo'](db['OpenchannelAccount'],{'as':_0x414e('0x176'),'foreignKey':'OpenchannelAccountId'});db[_0x414e('0x65')][_0x414e('0x12d')](db[_0x414e('0x131')],{'as':'Contact','foreignKey':_0x414e('0x177')});db[_0x414e('0x65')][_0x414e('0x12d')](db[_0x414e('0x11b')],{'as':_0x414e('0x178'),'foreignKey':_0x414e('0x11e')});db[_0x414e('0x65')][_0x414e('0x130')](db[_0x414e('0x92')],{'through':_0x414e('0x198'),'as':_0x414e('0x17a')});db[_0x414e('0x65')][_0x414e('0x130')](db['Tag'],{'through':_0x414e('0x198'),'as':_0x414e('0x17b')});db[_0x414e('0x65')][_0x414e('0x130')](db[_0x414e('0x11b')],{'as':_0x414e('0x17c'),'through':'user_has_openchannel_interactions','foreignKey':'OpenchannelInteractionId'});db[_0x414e('0x67')][_0x414e('0x12d')](db[_0x414e('0x11b')],{'onDelete':'cascade','as':'User'});db[_0x414e('0x67')][_0x414e('0x12d')](db[_0x414e('0x131')],{'onDelete':_0x414e('0x11d'),'as':_0x414e('0x16b')});db[_0x414e('0x67')][_0x414e('0x12d')](db[_0x414e('0x65')],{'onDelete':_0x414e('0x11d'),'as':_0x414e('0x18b'),'foreignKey':_0x414e('0x197')});db[_0x414e('0x67')][_0x414e('0x12d')](db['Attachment'],{'as':_0x414e('0xf6'),'foreignKey':'AttachmentId'});db['OpenchannelMessage'][_0x414e('0x12d')](db[_0x414e('0x61')],{'as':_0x414e('0x176'),'foreignKey':_0x414e('0x194')});db[_0x414e('0x69')][_0x414e('0x130')](db[_0x414e('0x11b')],{'as':'Agents','through':_0x414e('0x38'),'foreignKey':_0x414e('0x196')});db[_0x414e('0x69')][_0x414e('0x130')](db[_0x414e('0xf0')],{'through':_0x414e('0x199'),'as':_0x414e('0x164')});db[_0x414e('0x148')][_0x414e('0x11f')](db[_0x414e('0x86')],{'as':'Dispositions','foreignKey':_0x414e('0x17e'),'onDelete':_0x414e('0x11d')});db[_0x414e('0x148')]['hasMany'](db[_0x414e('0x85')],{'as':_0x414e('0x18e'),'foreignKey':'ChatWebsiteId'});db[_0x414e('0x148')][_0x414e('0x11f')](db[_0x414e('0x74')],{'as':'ProactiveActions'});db['ChatWebsite'][_0x414e('0x11f')](db[_0x414e('0x19a')],{'as':'Interactions'});db[_0x414e('0x148')][_0x414e('0x11f')](db[_0x414e('0x6e')],{'as':_0x414e('0x158')});db[_0x414e('0x148')][_0x414e('0x11f')](db[_0x414e('0x6f')],{'as':'Messages'});db[_0x414e('0x148')][_0x414e('0x12d')](db[_0x414e('0x147')],{'as':_0x414e('0x181'),'foreignKey':_0x414e('0x171')});db['ChatWebsite']['belongsTo'](db['Interval'],{'as':_0x414e('0x161'),'foreignKey':_0x414e('0x180')});db['ChatWebsite'][_0x414e('0x12d')](db[_0x414e('0x3f')],{'as':'MailAccount','foreignKey':_0x414e('0x16d')});db['ChatWebsite'][_0x414e('0x12d')](db[_0x414e('0x8a')],{'as':_0x414e('0x162'),'foreignKey':_0x414e('0x187')});db[_0x414e('0x148')]['belongsToMany'](db[_0x414e('0x11b')],{'as':_0x414e('0x163'),'through':_0x414e('0x14a')});db['OpenchannelQueueReport']['belongsTo'](db[_0x414e('0x61')],{});db[_0x414e('0x6c')][_0x414e('0x12d')](db[_0x414e('0x147')],{'as':_0x414e('0x181'),'foreignKey':_0x414e('0x171')});db[_0x414e('0x6c')][_0x414e('0x12d')](db[_0x414e('0x131')],{'as':_0x414e('0x16b'),'foreignKey':_0x414e('0x177')});db[_0x414e('0x6c')][_0x414e('0x12d')](db[_0x414e('0x65')],{});db[_0x414e('0x6c')][_0x414e('0x12d')](db[_0x414e('0x67')],{});db['OpenchannelQueueReport'][_0x414e('0x12d')](db['User'],{});db[_0x414e('0x6c')][_0x414e('0x12d')](db['OpenchannelQueue'],{});db[_0x414e('0x6e')]['belongsTo'](db[_0x414e('0x11b')],{'as':_0x414e('0x19b'),'foreignKey':_0x414e('0x11e'),'onDelete':_0x414e('0x16e')});db[_0x414e('0x6e')][_0x414e('0x12d')](db[_0x414e('0x73')],{'as':_0x414e('0x19c'),'foreignKey':_0x414e('0x19d'),'onDelete':'restrict'});db[_0x414e('0x6e')]['belongsTo'](db['ChatWebsite'],{'as':_0x414e('0x19e'),'foreignKey':'ChatWebsiteId','onDelete':_0x414e('0x16e')});db[_0x414e('0x6e')][_0x414e('0x12d')](db[_0x414e('0x92')],{'onDelete':_0x414e('0x16e'),'foreignKey':_0x414e('0x188')});db[_0x414e('0x19a')][_0x414e('0x11f')](db[_0x414e('0x6f')],{'as':_0x414e('0x174'),'onDelete':_0x414e('0x11d'),'foreignKey':_0x414e('0x19f')});db[_0x414e('0x19a')]['belongsTo'](db[_0x414e('0x148')],{'as':_0x414e('0x176'),'foreignKey':_0x414e('0x17e')});db[_0x414e('0x19a')][_0x414e('0x12d')](db[_0x414e('0x131')],{'as':_0x414e('0x16b'),'foreignKey':_0x414e('0x177')});db[_0x414e('0x19a')][_0x414e('0x12d')](db[_0x414e('0x11b')],{'as':_0x414e('0x178'),'foreignKey':_0x414e('0x11e')});db[_0x414e('0x19a')][_0x414e('0x130')](db[_0x414e('0x92')],{'through':_0x414e('0x1a0'),'as':_0x414e('0x17a')});db[_0x414e('0x19a')][_0x414e('0x130')](db[_0x414e('0x92')],{'through':_0x414e('0x1a0'),'as':_0x414e('0x17b')});db['ChatInteraction'][_0x414e('0x130')](db[_0x414e('0x11b')],{'as':_0x414e('0x17c'),'through':_0x414e('0x137'),'foreignKey':_0x414e('0x19f')});db[_0x414e('0x6f')][_0x414e('0x12d')](db['User'],{'onDelete':_0x414e('0x11d'),'as':_0x414e('0x11b')});db[_0x414e('0x6f')][_0x414e('0x12d')](db['CmContact'],{'onDelete':_0x414e('0x11d'),'as':'Contact','foreignKey':_0x414e('0x177')});db['ChatMessage']['belongsTo'](db[_0x414e('0x19a')],{'onDelete':_0x414e('0x11d'),'as':_0x414e('0x18b'),'foreignKey':_0x414e('0x19f')});db[_0x414e('0x6f')][_0x414e('0x12d')](db[_0x414e('0xf6')],{'as':'Attachment','foreignKey':_0x414e('0x18c')});db[_0x414e('0x6f')][_0x414e('0x12d')](db[_0x414e('0x148')],{'as':_0x414e('0x176'),'foreignKey':_0x414e('0x17e')});db[_0x414e('0x71')][_0x414e('0x11f')](db[_0x414e('0xf6')],{'as':_0x414e('0x17d'),'foreignKey':_0x414e('0x17f'),'onDelete':_0x414e('0x11d'),'hooks':!![]});db[_0x414e('0x71')][_0x414e('0x12d')](db[_0x414e('0x131')],{'onDelete':_0x414e('0x11d'),'as':_0x414e('0x16b'),'foreignKey':'ContactId'});db[_0x414e('0x71')][_0x414e('0x12d')](db['ChatWebsite'],{'as':_0x414e('0x176'),'foreignKey':_0x414e('0x17e')});db['ChatQueue'][_0x414e('0x130')](db[_0x414e('0x11b')],{'as':_0x414e('0x163'),'through':_0x414e('0x140'),'hooks':!![]});db[_0x414e('0x73')][_0x414e('0x130')](db[_0x414e('0xf0')],{'through':_0x414e('0x1a1'),'as':_0x414e('0x164')});db[_0x414e('0x1a2')][_0x414e('0x11f')](db[_0x414e('0x1a3')],{'as':_0x414e('0x174'),'foreignKey':_0x414e('0x1a4'),'onDelete':_0x414e('0x11d')});db[_0x414e('0x1a2')][_0x414e('0x130')](db[_0x414e('0x11b')],{'as':_0x414e('0x1a5'),'through':_0x414e('0x1a6')});db[_0x414e('0x74')][_0x414e('0x12d')](db['ChatWebsite'],{'as':_0x414e('0x19e'),'foreignKey':'ChatWebsiteId'});db[_0x414e('0x1a7')][_0x414e('0x11f')](db['CmContact'],{'as':_0x414e('0x132'),'foreignKey':_0x414e('0x1a8')});db['CmContact'][_0x414e('0x11f')](db[_0x414e('0x77')],{'as':_0x414e('0x1a9'),'foreignKey':_0x414e('0x177')});db['CmContact'][_0x414e('0x11f')](db[_0x414e('0x7a')],{'as':'HopperFinals','foreignKey':_0x414e('0x177')});db[_0x414e('0x131')][_0x414e('0x11f')](db[_0x414e('0x7c')],{'as':'HopperHistories','foreignKey':_0x414e('0x177')});db[_0x414e('0x131')]['hasMany'](db[_0x414e('0x7e')],{'as':_0x414e('0x7e'),'foreignKey':_0x414e('0x177')});db[_0x414e('0x131')][_0x414e('0x11f')](db['JscriptySessionReport'],{'as':'JscriptySessions','foreignKey':_0x414e('0x177')});db[_0x414e('0x131')][_0x414e('0x11f')](db[_0x414e('0x65')],{'as':_0x414e('0x123'),'foreignKey':_0x414e('0x177'),'onDelete':'restrict'});db[_0x414e('0x131')][_0x414e('0x11f')](db['ChatInteraction'],{'as':_0x414e('0x124'),'foreignKey':_0x414e('0x177'),'onDelete':'restrict'});db[_0x414e('0x131')][_0x414e('0x11f')](db[_0x414e('0x5c')],{'as':_0x414e('0x125'),'foreignKey':_0x414e('0x177'),'onDelete':_0x414e('0x16e')});db[_0x414e('0x131')]['hasMany'](db[_0x414e('0x52')],{'as':'FaxInteractions','foreignKey':'ContactId','onDelete':_0x414e('0x16e')});db[_0x414e('0x131')][_0x414e('0x11f')](db[_0x414e('0x127')],{'as':_0x414e('0x128'),'foreignKey':_0x414e('0x177'),'onDelete':_0x414e('0x16e')});db['CmContact']['belongsTo'](db[_0x414e('0x1a7')],{'as':_0x414e('0x1aa'),'foreignKey':_0x414e('0x1a8')});db[_0x414e('0x131')]['belongsTo'](db[_0x414e('0x147')],{'as':'List','foreignKey':_0x414e('0x171'),'onDelete':_0x414e('0x11d')});db['CmContact'][_0x414e('0x130')](db[_0x414e('0x11b')],{'as':_0x414e('0x17c'),'through':_0x414e('0x1ab')});db[_0x414e('0x131')][_0x414e('0x130')](db[_0x414e('0x92')],{'as':_0x414e('0x17a'),'through':_0x414e('0x1ac')});db[_0x414e('0x131')][_0x414e('0x130')](db[_0x414e('0x92')],{'through':_0x414e('0x1ac'),'as':'ThroughTags'});db[_0x414e('0x77')][_0x414e('0x12d')](db[_0x414e('0x131')],{'as':_0x414e('0x16b'),'foreignKey':_0x414e('0x177'),'onDelete':'cascade'});db[_0x414e('0x77')][_0x414e('0x12d')](db['CmList'],{'as':_0x414e('0x181'),'foreignKey':_0x414e('0x171'),'onDelete':'cascade'});db[_0x414e('0x77')]['belongsTo'](db[_0x414e('0x11b')],{'as':_0x414e('0x19b'),'foreignKey':'UserId'});db[_0x414e('0x77')][_0x414e('0x12d')](db[_0x414e('0x1a')],{'as':_0x414e('0x19c'),'foreignKey':'VoiceQueueId','onDelete':_0x414e('0x11d')});db[_0x414e('0x77')][_0x414e('0x12d')](db[_0x414e('0xf3')],{'as':_0x414e('0xf3'),'foreignKey':'CampaignId','onDelete':_0x414e('0x11d')});db[_0x414e('0x77')][_0x414e('0x12d')](db[_0x414e('0x11b')],{'as':'Owner','foreignKey':_0x414e('0x1ad')});db[_0x414e('0x78')]['belongsTo'](db[_0x414e('0x131')],{'as':_0x414e('0x16b'),'foreignKey':_0x414e('0x177'),'onDelete':_0x414e('0x11d')});db[_0x414e('0x78')][_0x414e('0x12d')](db[_0x414e('0x147')],{'as':'List','foreignKey':_0x414e('0x171'),'onDelete':_0x414e('0x11d')});db[_0x414e('0x78')][_0x414e('0x12d')](db[_0x414e('0x1a')],{'as':_0x414e('0x19c'),'foreignKey':_0x414e('0x15b'),'onDelete':_0x414e('0x11d')});db[_0x414e('0x78')][_0x414e('0x12d')](db[_0x414e('0xf3')],{'as':_0x414e('0xf3'),'foreignKey':_0x414e('0x1ae'),'onDelete':_0x414e('0x11d')});db[_0x414e('0x83')][_0x414e('0x11f')](db['Condition'],{'as':{'plural':'All','singular':_0x414e('0x1af')},'foreignKey':_0x414e('0x1b0'),'onDelete':_0x414e('0x11d'),'hooks':!![]});db[_0x414e('0x83')]['hasMany'](db[_0x414e('0x1b1')],{'as':{'plural':_0x414e('0x1b2'),'singular':'OneAny'},'foreignKey':'AutomationAnyId','onDelete':_0x414e('0x11d'),'hooks':!![]});db[_0x414e('0x83')][_0x414e('0x11f')](db[_0x414e('0x81')],{'as':_0x414e('0x1b3'),'foreignKey':_0x414e('0x1b4'),'onDelete':'cascade','hooks':!![]});db[_0x414e('0x86')][_0x414e('0x11f')](db['Disposition'],{'as':'Dispositions','foreignKey':_0x414e('0x1b5'),'onDelete':_0x414e('0x11d')});db[_0x414e('0x161')][_0x414e('0x11f')](db[_0x414e('0x161')],{'as':_0x414e('0x1b6'),'foreignKey':_0x414e('0x180'),'onDelete':_0x414e('0x11d'),'hooks':!![],'required':![]});db['Interval'][_0x414e('0x11f')](db['VoiceExtension'],{'as':'Extensions','foreignKey':_0x414e('0x180'),'onDelete':_0x414e('0x16e')});db[_0x414e('0x161')][_0x414e('0x11f')](db[_0x414e('0x46')],{'as':'MailApplications','foreignKey':_0x414e('0x180')});db[_0x414e('0x161')][_0x414e('0x11f')](db['ChatApplication'],{'as':_0x414e('0x1b7'),'foreignKey':_0x414e('0x180')});db[_0x414e('0x161')]['hasMany'](db['FaxApplication'],{'as':_0x414e('0x1b8'),'foreignKey':_0x414e('0x180')});db[_0x414e('0x161')]['hasMany'](db['SmsApplication'],{'as':'SmsApplications','foreignKey':_0x414e('0x180')});db[_0x414e('0x8f')][_0x414e('0x12d')](db[_0x414e('0x3f')],{});db[_0x414e('0x8f')][_0x414e('0x12d')](db[_0x414e('0x9e')],{'foreignKey':_0x414e('0x1b9')});db[_0x414e('0x8f')][_0x414e('0x12d')](db[_0x414e('0x9c')],{'foreignKey':_0x414e('0x1ba')});db['Sound'][_0x414e('0x130')](db[_0x414e('0x18')],{'as':_0x414e('0x1bb'),'through':_0x414e('0x1bc'),'onDelete':'restrict'});db[_0x414e('0x92')][_0x414e('0x130')](db['CmContact'],{'through':'cm_contact_has_tags'});db[_0x414e('0x92')][_0x414e('0x130')](db[_0x414e('0x19a')],{'through':'chat_interaction_has_tags'});db[_0x414e('0x92')][_0x414e('0x130')](db[_0x414e('0x127')],{'through':_0x414e('0x179')});db[_0x414e('0x92')][_0x414e('0x130')](db[_0x414e('0x5c')],{'through':_0x414e('0x190')});db[_0x414e('0x92')][_0x414e('0x130')](db[_0x414e('0x52')],{'through':_0x414e('0x189')});db['Tag'][_0x414e('0x130')](db['OpenchannelInteraction'],{'through':_0x414e('0x198')});db[_0x414e('0x92')]['belongsToMany'](db[_0x414e('0x1bd')],{'through':_0x414e('0x1be')});db[_0x414e('0x1bf')][_0x414e('0x11f')](db[_0x414e('0x1b1')],{'as':{'plural':_0x414e('0x1c0'),'singular':_0x414e('0x1c1')},'foreignKey':_0x414e('0x1c2'),'onDelete':_0x414e('0x11d'),'hooks':!![]});db[_0x414e('0x1bf')][_0x414e('0x11f')](db[_0x414e('0x1b1')],{'as':{'plural':_0x414e('0x1c3'),'singular':_0x414e('0x1c4')},'foreignKey':_0x414e('0x1c5'),'onDelete':_0x414e('0x11d'),'hooks':!![]});db['Trigger'][_0x414e('0x11f')](db[_0x414e('0x81')],{'as':_0x414e('0x1b3'),'foreignKey':'TriggerId','onDelete':_0x414e('0x11d'),'hooks':!![]});db[_0x414e('0x9c')][_0x414e('0x11f')](db[_0x414e('0x1c6')],{'as':_0x414e('0x1c7'),'onDelete':_0x414e('0x11d'),'foreignKey':'CustomReportId','hooks':!![]});db[_0x414e('0x9e')][_0x414e('0x11f')](db[_0x414e('0x1c6')],{'as':_0x414e('0x1c7'),'onDelete':_0x414e('0x11d'),'foreignKey':_0x414e('0x1b9')});db[_0x414e('0xa0')]['hasMany'](db['AnalyticFieldReport'],{'as':_0x414e('0x1c7'),'onDelete':_0x414e('0x11d'),'foreignKey':_0x414e('0x1c8')});db[_0x414e('0x1c6')]['belongsTo'](db['AnalyticMetric'],{'foreignKey':_0x414e('0x1c8')});db[_0x414e('0xa5')][_0x414e('0x11f')](db[_0x414e('0xa7')],{'as':'Configurations','onDelete':_0x414e('0x11d'),'foreignKey':'AccountId'});db[_0x414e('0xa7')][_0x414e('0x11f')](db[_0x414e('0xa8')],{'as':_0x414e('0x1c9'),'onDelete':_0x414e('0x11d'),'foreignKey':'SubjectId'});db[_0x414e('0xa7')][_0x414e('0x11f')](db[_0x414e('0xa8')],{'as':_0x414e('0x1ca'),'onDelete':_0x414e('0x11d'),'foreignKey':_0x414e('0x1cb')});db[_0x414e('0xa7')]['hasMany'](db[_0x414e('0xa8')],{'as':_0x414e('0x1c7'),'onDelete':_0x414e('0x11d'),'foreignKey':'FieldId'});db[_0x414e('0xa7')][_0x414e('0x12d')](db['SalesforceAccount'],{'as':_0x414e('0x176'),'foreignKey':_0x414e('0x1cc')});db[_0x414e('0xa8')][_0x414e('0x11f')](db['SalesforceField'],{'as':_0x414e('0x1cd'),'foreignKey':_0x414e('0x1ce')});db[_0x414e('0xa8')][_0x414e('0x11f')](db['SalesforceField'],{'as':_0x414e('0x1cf'),'foreignKey':_0x414e('0x1cb')});db[_0x414e('0xa8')]['hasMany'](db['SalesforceField'],{'as':_0x414e('0x1d0'),'foreignKey':'FieldId'});db['SalesforceField'][_0x414e('0x12d')](db[_0x414e('0x97')],{'as':'Variable','foreignKey':_0x414e('0x1d1')});db[_0x414e('0xa9')][_0x414e('0x11f')](db[_0x414e('0xaa')],{'as':_0x414e('0x1d2'),'onDelete':_0x414e('0x11d'),'foreignKey':_0x414e('0x1cc')});db['SugarcrmConfiguration'][_0x414e('0x11f')](db[_0x414e('0xac')],{'as':_0x414e('0x1c9'),'onDelete':_0x414e('0x11d'),'foreignKey':_0x414e('0x1ce')});db[_0x414e('0xaa')][_0x414e('0x11f')](db[_0x414e('0xac')],{'as':_0x414e('0x1ca'),'onDelete':'cascade','foreignKey':_0x414e('0x1cb')});db['SugarcrmConfiguration'][_0x414e('0x11f')](db['SugarcrmField'],{'as':_0x414e('0x1c7'),'onDelete':_0x414e('0x11d'),'foreignKey':_0x414e('0x1d3')});db['SugarcrmConfiguration'][_0x414e('0x12d')](db[_0x414e('0xa9')],{'as':_0x414e('0x176'),'foreignKey':_0x414e('0x1cc')});db['SugarcrmField'][_0x414e('0x11f')](db[_0x414e('0xac')],{'as':_0x414e('0x1cd'),'foreignKey':_0x414e('0x1ce')});db[_0x414e('0xac')]['hasMany'](db['SugarcrmField'],{'as':_0x414e('0x1cf'),'foreignKey':_0x414e('0x1cb')});db[_0x414e('0xac')][_0x414e('0x11f')](db[_0x414e('0xac')],{'as':_0x414e('0x1d0'),'foreignKey':'FieldId'});db['SugarcrmField'][_0x414e('0x12d')](db['Variable'],{'as':'Variable','foreignKey':_0x414e('0x1d1')});db[_0x414e('0xae')]['hasMany'](db['DeskConfiguration'],{'as':_0x414e('0x1d2'),'onDelete':_0x414e('0x11d'),'foreignKey':_0x414e('0x1cc')});db[_0x414e('0xb0')][_0x414e('0x11f')](db['DeskField'],{'as':_0x414e('0x1c9'),'onDelete':_0x414e('0x11d'),'foreignKey':_0x414e('0x1ce')});db['DeskConfiguration'][_0x414e('0x11f')](db[_0x414e('0xb2')],{'as':_0x414e('0x1ca'),'onDelete':_0x414e('0x11d'),'foreignKey':'DescriptionId'});db[_0x414e('0xb0')][_0x414e('0x11f')](db[_0x414e('0xb2')],{'as':_0x414e('0x1c7'),'onDelete':_0x414e('0x11d'),'foreignKey':_0x414e('0x1d3')});db['DeskConfiguration']['belongsTo'](db['DeskAccount'],{'as':'Account','foreignKey':'AccountId'});db[_0x414e('0xb0')][_0x414e('0x130')](db['Tag'],{'through':_0x414e('0x1d4')});db[_0x414e('0xb2')]['hasMany'](db[_0x414e('0xb2')],{'as':'Subject','foreignKey':_0x414e('0x1ce')});db[_0x414e('0xb2')]['hasMany'](db['DeskField'],{'as':_0x414e('0x1cf'),'foreignKey':_0x414e('0x1cb')});db['DeskField']['hasMany'](db[_0x414e('0xb2')],{'as':'Field','foreignKey':_0x414e('0x1d3')});db[_0x414e('0xb2')]['belongsTo'](db[_0x414e('0x97')],{'as':_0x414e('0x97'),'foreignKey':_0x414e('0x1d1')});db[_0x414e('0xb4')][_0x414e('0x11f')](db[_0x414e('0xb6')],{'as':'Configurations','onDelete':_0x414e('0x11d'),'foreignKey':_0x414e('0x1cc')});db[_0x414e('0xb6')]['hasMany'](db['ZohoField'],{'as':_0x414e('0x1c9'),'onDelete':_0x414e('0x11d'),'foreignKey':_0x414e('0x1ce')});db[_0x414e('0xb6')]['hasMany'](db[_0x414e('0xb8')],{'as':_0x414e('0x1ca'),'onDelete':_0x414e('0x11d'),'foreignKey':_0x414e('0x1cb')});db[_0x414e('0xb6')][_0x414e('0x11f')](db['ZohoField'],{'as':_0x414e('0x1c7'),'onDelete':_0x414e('0x11d'),'foreignKey':_0x414e('0x1d3')});db[_0x414e('0xb6')][_0x414e('0x12d')](db[_0x414e('0xb4')],{'as':'Account','foreignKey':_0x414e('0x1cc')});db[_0x414e('0xb8')]['hasMany'](db[_0x414e('0xb8')],{'as':'Subject','foreignKey':_0x414e('0x1ce')});db['ZohoField'][_0x414e('0x11f')](db[_0x414e('0xb8')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x414e('0xb8')][_0x414e('0x11f')](db[_0x414e('0xb8')],{'as':'Field','foreignKey':_0x414e('0x1d3')});db['ZohoField'][_0x414e('0x12d')](db[_0x414e('0x97')],{'as':_0x414e('0x97'),'foreignKey':_0x414e('0x1d1')});db[_0x414e('0xba')][_0x414e('0x11f')](db[_0x414e('0xbc')],{'as':_0x414e('0x1d2'),'onDelete':'cascade','foreignKey':_0x414e('0x1cc')});db[_0x414e('0xbc')][_0x414e('0x11f')](db[_0x414e('0x1d5')],{'as':'Subjects','foreignKey':_0x414e('0x1ce')});db[_0x414e('0xbc')][_0x414e('0x11f')](db[_0x414e('0x1d5')],{'as':_0x414e('0x1ca'),'foreignKey':_0x414e('0x1cb')});db[_0x414e('0xbc')][_0x414e('0x11f')](db['ZendeskField'],{'as':'Fields','foreignKey':'FieldId'});db[_0x414e('0xbc')]['belongsTo'](db[_0x414e('0xba')],{'as':_0x414e('0x176'),'foreignKey':_0x414e('0x1cc')});db['ZendeskConfiguration'][_0x414e('0x130')](db[_0x414e('0x92')],{'through':'int_zendesk_configuration_has_tags'});db['ZendeskField'][_0x414e('0x11f')](db[_0x414e('0x1d5')],{'as':_0x414e('0x1cd'),'foreignKey':_0x414e('0x1ce')});db[_0x414e('0x1d5')][_0x414e('0x11f')](db[_0x414e('0x1d5')],{'as':_0x414e('0x1cf'),'foreignKey':'DescriptionId'});db[_0x414e('0x1d5')][_0x414e('0x11f')](db[_0x414e('0x1d5')],{'as':_0x414e('0x1d0'),'foreignKey':_0x414e('0x1d3')});db[_0x414e('0x1d5')][_0x414e('0x12d')](db[_0x414e('0x97')],{'as':_0x414e('0x97'),'foreignKey':'VariableId'});db[_0x414e('0x1d6')]['hasMany'](db[_0x414e('0xc0')],{'as':_0x414e('0x1d2'),'onDelete':_0x414e('0x11d'),'foreignKey':_0x414e('0x1cc')});db[_0x414e('0xc0')][_0x414e('0x11f')](db['FreshdeskField'],{'as':_0x414e('0x1c9'),'onDelete':_0x414e('0x11d'),'foreignKey':_0x414e('0x1ce')});db[_0x414e('0xc0')]['hasMany'](db['FreshdeskField'],{'as':_0x414e('0x1ca'),'onDelete':_0x414e('0x11d'),'foreignKey':'DescriptionId'});db[_0x414e('0xc0')][_0x414e('0x11f')](db[_0x414e('0xc1')],{'as':_0x414e('0x1c7'),'onDelete':'cascade','foreignKey':_0x414e('0x1d3')});db['FreshdeskConfiguration'][_0x414e('0x12d')](db[_0x414e('0x1d6')],{'as':_0x414e('0x176'),'foreignKey':_0x414e('0x1cc')});db[_0x414e('0xc0')][_0x414e('0x130')](db[_0x414e('0x92')],{'through':_0x414e('0x1d7')});db[_0x414e('0xc1')]['hasMany'](db[_0x414e('0xc1')],{'as':_0x414e('0x1cd'),'foreignKey':'SubjectId'});db['FreshdeskField'][_0x414e('0x11f')](db[_0x414e('0xc1')],{'as':_0x414e('0x1cf'),'foreignKey':_0x414e('0x1cb')});db['FreshdeskField'][_0x414e('0x11f')](db['FreshdeskField'],{'as':_0x414e('0x1d0'),'foreignKey':_0x414e('0x1d3')});db[_0x414e('0xc1')][_0x414e('0x12d')](db['Variable'],{'as':'Variable','foreignKey':'VariableId'});db[_0x414e('0xc3')][_0x414e('0x11f')](db[_0x414e('0xc5')],{'as':_0x414e('0x1d2'),'onDelete':_0x414e('0x11d'),'foreignKey':'AccountId'});db['VtigerConfiguration'][_0x414e('0x11f')](db[_0x414e('0xc7')],{'as':'Subjects','foreignKey':_0x414e('0x1ce')});db[_0x414e('0xc5')][_0x414e('0x11f')](db[_0x414e('0xc7')],{'as':_0x414e('0x1ca'),'foreignKey':_0x414e('0x1cb')});db[_0x414e('0xc5')]['hasMany'](db[_0x414e('0xc7')],{'as':_0x414e('0x1c7'),'foreignKey':_0x414e('0x1d3')});db[_0x414e('0xc5')][_0x414e('0x12d')](db[_0x414e('0xc3')],{'as':_0x414e('0x176'),'foreignKey':_0x414e('0x1cc')});db[_0x414e('0xc7')][_0x414e('0x11f')](db['VtigerField'],{'as':_0x414e('0x1cd'),'foreignKey':_0x414e('0x1ce')});db['VtigerField']['hasMany'](db['VtigerField'],{'as':'Description','foreignKey':'DescriptionId'});db['VtigerField'][_0x414e('0x11f')](db[_0x414e('0xc7')],{'as':_0x414e('0x1d0'),'foreignKey':_0x414e('0x1d3')});db['VtigerField'][_0x414e('0x12d')](db['Variable'],{'as':_0x414e('0x97'),'foreignKey':_0x414e('0x1d1')});db[_0x414e('0xc9')][_0x414e('0x11f')](db[_0x414e('0x1d8')],{'as':'Configurations','onDelete':_0x414e('0x11d'),'foreignKey':'AccountId'});db['ServicenowConfiguration'][_0x414e('0x11f')](db[_0x414e('0xcb')],{'as':_0x414e('0x1c9'),'foreignKey':_0x414e('0x1ce')});db[_0x414e('0x1d8')][_0x414e('0x11f')](db[_0x414e('0xcb')],{'as':_0x414e('0x1ca'),'foreignKey':'DescriptionId'});db[_0x414e('0x1d8')][_0x414e('0x11f')](db[_0x414e('0xcb')],{'as':_0x414e('0x1c7'),'foreignKey':_0x414e('0x1d3')});db[_0x414e('0x1d8')][_0x414e('0x12d')](db[_0x414e('0xc9')],{'as':'Account','foreignKey':_0x414e('0x1cc')});db['ServicenowField'][_0x414e('0x11f')](db[_0x414e('0xcb')],{'as':_0x414e('0x1cd'),'foreignKey':_0x414e('0x1ce')});db[_0x414e('0xcb')]['hasMany'](db[_0x414e('0xcb')],{'as':_0x414e('0x1cf'),'foreignKey':'DescriptionId'});db[_0x414e('0xcb')][_0x414e('0x11f')](db[_0x414e('0xcb')],{'as':_0x414e('0x1d0'),'foreignKey':'FieldId'});db[_0x414e('0xcb')][_0x414e('0x12d')](db['Variable'],{'as':'Variable','foreignKey':_0x414e('0x1d1')});db[_0x414e('0xcd')]['hasMany'](db[_0x414e('0x1d9')],{'as':_0x414e('0x1d2'),'onDelete':_0x414e('0x11d'),'foreignKey':_0x414e('0x1cc')});db[_0x414e('0x1d9')][_0x414e('0x11f')](db[_0x414e('0xd0')],{'as':'Subjects','onDelete':'cascade','foreignKey':_0x414e('0x1ce')});db[_0x414e('0x1d9')]['hasMany'](db[_0x414e('0xd0')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0x414e('0x1cb')});db[_0x414e('0x1d9')][_0x414e('0x11f')](db['Dynamics365Field'],{'as':'Fields','onDelete':_0x414e('0x11d'),'foreignKey':'FieldId'});db[_0x414e('0x1d9')][_0x414e('0x12d')](db[_0x414e('0xcd')],{'as':'Account','foreignKey':_0x414e('0x1cc')});db['Dynamics365Field']['hasMany'](db['Dynamics365Field'],{'as':'Subject','foreignKey':_0x414e('0x1ce')});db['Dynamics365Field'][_0x414e('0x11f')](db[_0x414e('0xd0')],{'as':_0x414e('0x1cf'),'foreignKey':_0x414e('0x1cb')});db[_0x414e('0xd0')][_0x414e('0x11f')](db[_0x414e('0xd0')],{'as':_0x414e('0x1d0'),'foreignKey':_0x414e('0x1d3')});db[_0x414e('0xd0')][_0x414e('0x12d')](db[_0x414e('0x97')],{'as':_0x414e('0x97'),'foreignKey':_0x414e('0x1d1')});db['FreshsalesAccount']['hasMany'](db[_0x414e('0xd3')],{'as':_0x414e('0x1d2'),'onDelete':'cascade','foreignKey':_0x414e('0x1cc')});db['FreshsalesConfiguration'][_0x414e('0x11f')](db[_0x414e('0x1da')],{'as':_0x414e('0x1c9'),'foreignKey':_0x414e('0x1ce')});db['FreshsalesConfiguration'][_0x414e('0x11f')](db[_0x414e('0x1da')],{'as':_0x414e('0x1ca'),'foreignKey':'DescriptionId'});db['FreshsalesConfiguration'][_0x414e('0x11f')](db['FreshsalesField'],{'as':_0x414e('0x1c7'),'foreignKey':_0x414e('0x1d3')});db[_0x414e('0xd3')][_0x414e('0x12d')](db[_0x414e('0xd2')],{'as':_0x414e('0x176'),'foreignKey':_0x414e('0x1cc')});db[_0x414e('0x1da')][_0x414e('0x11f')](db[_0x414e('0x1da')],{'as':_0x414e('0x1cd'),'foreignKey':'SubjectId'});db[_0x414e('0x1da')][_0x414e('0x11f')](db[_0x414e('0x1da')],{'as':_0x414e('0x1cf'),'foreignKey':_0x414e('0x1cb')});db[_0x414e('0x1da')][_0x414e('0x11f')](db[_0x414e('0x1da')],{'as':'Field','foreignKey':_0x414e('0x1d3')});db[_0x414e('0x1da')][_0x414e('0x12d')](db['Variable'],{'as':_0x414e('0x97'),'foreignKey':_0x414e('0x1d1')});db[_0x414e('0xd9')]['belongsTo'](db[_0x414e('0x148')],{});db['ChatQueueReport'][_0x414e('0x12d')](db[_0x414e('0x147')],{'as':_0x414e('0x181'),'foreignKey':_0x414e('0x171')});db[_0x414e('0xd9')][_0x414e('0x12d')](db[_0x414e('0x131')],{'as':'Contact','foreignKey':'ContactId'});db[_0x414e('0xd9')][_0x414e('0x12d')](db[_0x414e('0x19a')],{});db[_0x414e('0xd9')]['belongsTo'](db[_0x414e('0x6f')],{});db['ChatQueueReport'][_0x414e('0x12d')](db[_0x414e('0x11b')],{});db[_0x414e('0xd9')][_0x414e('0x12d')](db[_0x414e('0x73')],{});db['ChatInternalMessage'][_0x414e('0x12d')](db[_0x414e('0x11b')],{'onDelete':'cascade','foreignKey':_0x414e('0x1db')});db[_0x414e('0x1a3')][_0x414e('0x12d')](db[_0x414e('0x11b')],{'onDelete':_0x414e('0x11d'),'foreignKey':_0x414e('0x1dc')});db[_0x414e('0xdf')][_0x414e('0x11f')](db[_0x414e('0xdd')],{'foreignKey':_0x414e('0x1dd'),'onDelete':_0x414e('0x11d')});db[_0x414e('0xdf')][_0x414e('0x11f')](db['JscriptyAnswerReport'],{'foreignKey':_0x414e('0x1dd'),'onDelete':'cascade'});db[_0x414e('0xe1')]['belongsTo'](db[_0x414e('0x58')],{});db['SmsQueueReport'][_0x414e('0x12d')](db['CmList'],{'as':_0x414e('0x181'),'foreignKey':_0x414e('0x171')});db[_0x414e('0xe1')]['belongsTo'](db['CmContact'],{'as':_0x414e('0x16b'),'foreignKey':_0x414e('0x177')});db[_0x414e('0xe1')][_0x414e('0x12d')](db['SmsInteraction'],{});db[_0x414e('0xe1')][_0x414e('0x12d')](db[_0x414e('0x5e')],{});db[_0x414e('0xe1')][_0x414e('0x12d')](db[_0x414e('0x11b')],{});db[_0x414e('0xe1')][_0x414e('0x12d')](db[_0x414e('0x142')],{});db[_0x414e('0x1de')][_0x414e('0x11f')](db[_0x414e('0xdf')],{'foreignKey':_0x414e('0x1df')});db[_0x414e('0x1de')][_0x414e('0x11f')](db['JscriptyQuestionReport'],{'foreignKey':_0x414e('0x1df')});db[_0x414e('0x1de')][_0x414e('0x11f')](db[_0x414e('0xdb')],{'foreignKey':_0x414e('0x1df')});db[_0x414e('0xea')][_0x414e('0x130')](db['User'],{'as':_0x414e('0x17c'),'through':_0x414e('0x155')});db[_0x414e('0xf0')][_0x414e('0x130')](db['User'],{'as':_0x414e('0x163'),'through':_0x414e('0x135')});db[_0x414e('0xf0')][_0x414e('0x130')](db[_0x414e('0x1a')],{'through':_0x414e('0x114'),'as':_0x414e('0x13b')});db[_0x414e('0xf0')][_0x414e('0x130')](db[_0x414e('0x40')],{'through':'team_has_mail_queues','as':_0x414e('0x13e')});db[_0x414e('0xf0')][_0x414e('0x130')](db[_0x414e('0x73')],{'through':_0x414e('0x1a1'),'as':_0x414e('0x13f')});db['Team'][_0x414e('0x130')](db[_0x414e('0x54')],{'through':_0x414e('0x18d'),'as':_0x414e('0x141')});db[_0x414e('0xf0')][_0x414e('0x130')](db['SmsQueue'],{'through':_0x414e('0x193'),'as':'SmsQueues'});db[_0x414e('0xf0')][_0x414e('0x130')](db[_0x414e('0x69')],{'through':_0x414e('0x199'),'as':_0x414e('0x145')});db[_0x414e('0xf0')]['belongsToMany'](db[_0x414e('0x110')],{'through':_0x414e('0x1e0'),'as':_0x414e('0x146')});db[_0x414e('0xf0')]['belongsToMany'](db[_0x414e('0xff')],{'through':_0x414e('0x116'),'as':'VoicePrefixes'});db[_0x414e('0xf3')][_0x414e('0x11f')](db[_0x414e('0x77')],{'as':'Hoppers','foreignKey':_0x414e('0x1ae')});db[_0x414e('0xf3')]['hasMany'](db[_0x414e('0x7a')],{'as':_0x414e('0x15c'),'foreignKey':'CampaignId'});db[_0x414e('0xf3')][_0x414e('0x11f')](db[_0x414e('0x7c')],{'as':_0x414e('0x15d'),'foreignKey':_0x414e('0x1ae')});db[_0x414e('0xf3')][_0x414e('0x11f')](db[_0x414e('0x78')],{'as':_0x414e('0x15e'),'foreignKey':_0x414e('0x1ae')});db[_0x414e('0xf3')]['belongsTo'](db[_0x414e('0x2d')],{'as':'Trunk','foreignKey':_0x414e('0x1e1')});db['Campaign'][_0x414e('0x12d')](db['Trunk'],{'as':_0x414e('0x160'),'foreignKey':'TrunkBackupId'});db[_0x414e('0xf3')][_0x414e('0x12d')](db['Interval'],{'as':'Interval','foreignKey':_0x414e('0x180')});db[_0x414e('0xf3')][_0x414e('0x12d')](db[_0x414e('0xea')],{'as':_0x414e('0xea'),'foreignKey':_0x414e('0x1e2')});db[_0x414e('0xf3')][_0x414e('0x130')](db['CmList'],{'as':_0x414e('0x133'),'through':'campaigns_has_cm_lists'});db[_0x414e('0xf3')][_0x414e('0x130')](db[_0x414e('0x147')],{'as':_0x414e('0x165'),'through':'campaigns_has_cm_blacklists'});db[_0x414e('0xf6')][_0x414e('0x12d')](db['ChatOfflineMessage'],{'as':_0x414e('0x71'),'foreignKey':_0x414e('0x17f')});db[_0x414e('0x1e3')]['belongsTo'](db['MailMessage'],{});db[_0x414e('0x1e3')][_0x414e('0x12d')](db['MailInteraction'],{});db[_0x414e('0x1e3')][_0x414e('0x12d')](db['MailAccount'],{'foreignKey':_0x414e('0x1e4'),'as':'FromAccount'});db[_0x414e('0x1e3')][_0x414e('0x12d')](db[_0x414e('0x11b')],{'foreignKey':_0x414e('0x1e5'),'as':_0x414e('0x1e6')});db['MailTransferReport']['belongsTo'](db[_0x414e('0x11b')],{'foreignKey':_0x414e('0x1e7'),'as':_0x414e('0x1e8')});db['MailTransferReport'][_0x414e('0x12d')](db['MailQueue'],{'foreignKey':_0x414e('0x1e9'),'as':'ToQueue'});db[_0x414e('0x1e3')]['belongsTo'](db[_0x414e('0x3f')],{'foreignKey':_0x414e('0x1ea'),'as':_0x414e('0x1eb')});db[_0x414e('0x1ec')][_0x414e('0x12d')](db[_0x414e('0x6f')],{});db[_0x414e('0x1ec')][_0x414e('0x12d')](db[_0x414e('0x19a')],{});db[_0x414e('0x1ec')][_0x414e('0x12d')](db[_0x414e('0x148')],{'foreignKey':'FromChatWebsiteId','as':_0x414e('0x1ed')});db[_0x414e('0x1ec')][_0x414e('0x12d')](db[_0x414e('0x11b')],{'foreignKey':_0x414e('0x1e5'),'as':_0x414e('0x1e6')});db['ChatTransferReport'][_0x414e('0x12d')](db[_0x414e('0x11b')],{'foreignKey':_0x414e('0x1e7'),'as':_0x414e('0x1e8')});db[_0x414e('0x1ec')][_0x414e('0x12d')](db[_0x414e('0x73')],{'foreignKey':_0x414e('0x1ee'),'as':_0x414e('0x1ef')});db[_0x414e('0x1ec')][_0x414e('0x12d')](db[_0x414e('0x148')],{'foreignKey':_0x414e('0x1f0'),'as':'ToAccount'});db[_0x414e('0x1f1')][_0x414e('0x12d')](db[_0x414e('0x186')],{});db['FaxTransferReport'][_0x414e('0x12d')](db[_0x414e('0x52')],{});db[_0x414e('0x1f1')][_0x414e('0x12d')](db['FaxAccount'],{'foreignKey':_0x414e('0x1f2'),'as':_0x414e('0x1ed')});db[_0x414e('0x1f1')][_0x414e('0x12d')](db['User'],{'foreignKey':_0x414e('0x1e5'),'as':'FromAgent'});db[_0x414e('0x1f1')]['belongsTo'](db['User'],{'foreignKey':_0x414e('0x1e7'),'as':_0x414e('0x1e8')});db[_0x414e('0x1f1')][_0x414e('0x12d')](db[_0x414e('0x54')],{'foreignKey':_0x414e('0x1f3'),'as':_0x414e('0x1ef')});db[_0x414e('0x1f1')][_0x414e('0x12d')](db[_0x414e('0x4e')],{'foreignKey':_0x414e('0x1f4'),'as':_0x414e('0x1eb')});db['OpenchannelTransferReport'][_0x414e('0x12d')](db[_0x414e('0x67')],{});db[_0x414e('0xfb')][_0x414e('0x12d')](db['OpenchannelInteraction'],{});db[_0x414e('0xfb')]['belongsTo'](db[_0x414e('0x61')],{'foreignKey':'FromOpenchannelAccountId','as':_0x414e('0x1ed')});db[_0x414e('0xfb')]['belongsTo'](db[_0x414e('0x11b')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0x414e('0xfb')][_0x414e('0x12d')](db[_0x414e('0x11b')],{'foreignKey':_0x414e('0x1e7'),'as':'ToAgent'});db['OpenchannelTransferReport'][_0x414e('0x12d')](db[_0x414e('0x69')],{'foreignKey':_0x414e('0x1f5'),'as':_0x414e('0x1ef')});db[_0x414e('0xfb')][_0x414e('0x12d')](db[_0x414e('0x61')],{'foreignKey':_0x414e('0x1f6'),'as':_0x414e('0x1eb')});db[_0x414e('0xfd')][_0x414e('0x12d')](db[_0x414e('0x5e')],{});db['SmsTransferReport'][_0x414e('0x12d')](db[_0x414e('0x5c')],{});db[_0x414e('0xfd')][_0x414e('0x12d')](db[_0x414e('0x58')],{'foreignKey':_0x414e('0x1f7'),'as':_0x414e('0x1ed')});db[_0x414e('0xfd')][_0x414e('0x12d')](db['User'],{'foreignKey':_0x414e('0x1e5'),'as':'FromAgent'});db[_0x414e('0xfd')][_0x414e('0x12d')](db[_0x414e('0x11b')],{'foreignKey':_0x414e('0x1e7'),'as':_0x414e('0x1e8')});db['SmsTransferReport'][_0x414e('0x12d')](db['SmsQueue'],{'foreignKey':_0x414e('0x1f8'),'as':_0x414e('0x1ef')});db[_0x414e('0xfd')][_0x414e('0x12d')](db['SmsAccount'],{'foreignKey':'ToSmsAccountId','as':_0x414e('0x1eb')});db['CmList'][_0x414e('0x11f')](db[_0x414e('0x86')],{'as':_0x414e('0x183'),'foreignKey':'ListId','onDelete':'cascade'});db['CmList'][_0x414e('0x11f')](db[_0x414e('0x1f9')],{'as':'CustomFields','foreignKey':_0x414e('0x171')});db[_0x414e('0x147')][_0x414e('0x11f')](db[_0x414e('0x131')],{'as':_0x414e('0x132'),'onDelete':'cascade','foreignKey':'ListId'});db[_0x414e('0x147')][_0x414e('0x11f')](db['CmHopperFinal'],{'as':_0x414e('0x15c'),'foreignKey':'ListId'});db['CmList'][_0x414e('0x11f')](db['CmHopperHistory'],{'as':'HopperHistory','foreignKey':_0x414e('0x171')});db[_0x414e('0x147')][_0x414e('0x11f')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0x414e('0x171')});db[_0x414e('0x147')][_0x414e('0x130')](db[_0x414e('0x1a')],{'as':_0x414e('0x1fa'),'through':_0x414e('0x1fb')});db[_0x414e('0x147')][_0x414e('0x130')](db['User'],{'as':_0x414e('0x163'),'through':_0x414e('0x134')});db[_0x414e('0xff')][_0x414e('0x11f')](db[_0x414e('0x120')],{'as':_0x414e('0x121'),'onDelete':'cascade'});db[_0x414e('0xff')]['belongsToMany'](db[_0x414e('0x11b')],{'as':_0x414e('0x163'),'through':_0x414e('0x118')});db['VoicePrefix'][_0x414e('0x130')](db['Team'],{'through':'TeamVoicePrefix','as':_0x414e('0x164')});db[_0x414e('0x12e')][_0x414e('0x11f')](db['User'],{'as':_0x414e('0x17c'),'foreignKey':_0x414e('0x12f')});db[_0x414e('0x12e')][_0x414e('0x11f')](db['UserProfileSection'],{'as':_0x414e('0x1fc'),'foreignKey':_0x414e('0x12f'),'onDelete':_0x414e('0x11d')});db[_0x414e('0x102')]['hasMany'](db[_0x414e('0x104')],{'as':'Resources','foreignKey':'sectionId','onDelete':_0x414e('0x11d')});db[_0x414e('0x151')][_0x414e('0x11f')](db[_0x414e('0x86')],{'as':_0x414e('0x183'),'foreignKey':_0x414e('0x1fd'),'onDelete':'cascade'});db[_0x414e('0x151')][_0x414e('0x11f')](db[_0x414e('0x85')],{'as':'Answers','foreignKey':'WhatsappAccountId'});db['WhatsappAccount'][_0x414e('0x11f')](db['WhatsappMessage'],{'as':_0x414e('0x174'),'foreignKey':_0x414e('0x1fd')});db[_0x414e('0x151')][_0x414e('0x11f')](db[_0x414e('0x1bd')],{'as':'Interactions'});db[_0x414e('0x151')][_0x414e('0x11f')](db[_0x414e('0x107')],{'as':'Applications'});db['WhatsappAccount'][_0x414e('0x12d')](db[_0x414e('0x147')],{'as':_0x414e('0x181'),'foreignKey':'ListId'});db[_0x414e('0x151')][_0x414e('0x12d')](db['Pause'],{'as':_0x414e('0x162'),'foreignKey':_0x414e('0x187')});db[_0x414e('0x151')][_0x414e('0x130')](db[_0x414e('0x11b')],{'as':'Agents','through':_0x414e('0x153')});db['WhatsappApplication'][_0x414e('0x12d')](db[_0x414e('0x11b')],{'onDelete':'restrict'});db[_0x414e('0x107')][_0x414e('0x12d')](db[_0x414e('0x110')],{'onDelete':_0x414e('0x16e')});db[_0x414e('0x107')][_0x414e('0x12d')](db['WhatsappAccount'],{'onDelete':_0x414e('0x16e')});db[_0x414e('0x107')]['belongsTo'](db[_0x414e('0x161')],{'onDelete':'restrict','foreignKey':_0x414e('0x180')});db['WhatsappApplication']['belongsTo'](db[_0x414e('0x92')],{'onDelete':_0x414e('0x16e'),'foreignKey':_0x414e('0x188')});db[_0x414e('0x1bd')][_0x414e('0x11f')](db[_0x414e('0x10a')],{'as':'Messages','onDelete':_0x414e('0x11d'),'foreignKey':_0x414e('0x1fe')});db[_0x414e('0x1bd')][_0x414e('0x12d')](db[_0x414e('0x151')],{'as':_0x414e('0x176'),'foreignKey':_0x414e('0x1fd')});db[_0x414e('0x1bd')][_0x414e('0x12d')](db[_0x414e('0x131')],{'as':'Contact','foreignKey':_0x414e('0x177')});db[_0x414e('0x1bd')][_0x414e('0x12d')](db['User'],{'as':'Owner','foreignKey':_0x414e('0x11e')});db[_0x414e('0x1bd')][_0x414e('0x130')](db[_0x414e('0x92')],{'through':'whatsapp_interaction_has_tags','as':_0x414e('0x17a')});db[_0x414e('0x1bd')]['belongsToMany'](db['Tag'],{'through':_0x414e('0x1be'),'as':'ThroughTags'});db['WhatsappInteraction'][_0x414e('0x130')](db[_0x414e('0x11b')],{'as':_0x414e('0x17c'),'through':_0x414e('0x13a'),'foreignKey':_0x414e('0x1fe')});db[_0x414e('0x10a')][_0x414e('0x12d')](db[_0x414e('0x11b')],{'as':'User'});db[_0x414e('0x10a')][_0x414e('0x12d')](db[_0x414e('0x131')],{'onDelete':_0x414e('0x11d'),'as':_0x414e('0x16b')});db[_0x414e('0x10a')][_0x414e('0x12d')](db['WhatsappInteraction'],{'onDelete':_0x414e('0x11d'),'as':_0x414e('0x18b'),'foreignKey':_0x414e('0x1fe')});db[_0x414e('0x10a')][_0x414e('0x12d')](db['WhatsappAccount'],{'as':_0x414e('0x176'),'foreignKey':_0x414e('0x1fd')});db[_0x414e('0x10c')]['belongsTo'](db['WhatsappAccount'],{});db['WhatsappQueueReport'][_0x414e('0x12d')](db[_0x414e('0x147')],{'as':_0x414e('0x181'),'foreignKey':_0x414e('0x171')});db['WhatsappQueueReport'][_0x414e('0x12d')](db[_0x414e('0x131')],{'as':_0x414e('0x16b'),'foreignKey':_0x414e('0x177')});db[_0x414e('0x10c')][_0x414e('0x12d')](db[_0x414e('0x1bd')],{});db['WhatsappQueueReport'][_0x414e('0x12d')](db[_0x414e('0x110')],{});db[_0x414e('0x10c')][_0x414e('0x12d')](db['WhatsappMessage'],{});db['WhatsappQueueReport'][_0x414e('0x12d')](db[_0x414e('0x11b')],{});db[_0x414e('0x10e')]['belongsTo'](db[_0x414e('0x10a')],{});db[_0x414e('0x10e')][_0x414e('0x12d')](db[_0x414e('0x1bd')],{});db[_0x414e('0x10e')][_0x414e('0x12d')](db[_0x414e('0x151')],{'foreignKey':_0x414e('0x1ff'),'as':_0x414e('0x1ed')});db[_0x414e('0x10e')][_0x414e('0x12d')](db[_0x414e('0x151')],{'foreignKey':_0x414e('0x200'),'as':_0x414e('0x1eb')});db[_0x414e('0x10e')][_0x414e('0x12d')](db[_0x414e('0x110')],{'foreignKey':_0x414e('0x201'),'as':'ToQueue'});db[_0x414e('0x10e')][_0x414e('0x12d')](db[_0x414e('0x11b')],{'foreignKey':_0x414e('0x1e5'),'as':_0x414e('0x1e6')});db[_0x414e('0x10e')][_0x414e('0x12d')](db[_0x414e('0x11b')],{'foreignKey':'ToUserId','as':_0x414e('0x1e8')});db[_0x414e('0x110')][_0x414e('0x130')](db['User'],{'as':'Agents','through':'UserWhatsappQueue','foreignKey':_0x414e('0x202')});db[_0x414e('0x110')][_0x414e('0x130')](db['Team'],{'through':_0x414e('0x1e0'),'as':'Teams'});db[_0x414e('0x203')][_0x414e('0x12d')](db[_0x414e('0x11b')],{'as':_0x414e('0x204'),'foreignKey':'UserId','onDelete':_0x414e('0x11d'),'hooks':!![]});db['CloudProvider'][_0x414e('0x11c')](db[_0x414e('0x3b')],{'as':_0x414e('0x16f'),'onDelete':'restrict'});db['CloudProvider'][_0x414e('0x11c')](db[_0x414e('0x3d')],{'as':_0x414e('0x205'),'onDelete':_0x414e('0x16e')});module[_0x414e('0x206')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x6629=['user_has_square_projects','SpiedAgents','Sounds','moh_has_sounds','UserVoiceQueueRt','VoiceQueueId','Hoppers','HopperFinals','HopperHistories','HopperBlacks','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','uniqueid','VoiceCallReport','AgentReports','Contact','MailAccountId','CloudProvider','CloudProviderId','restrict','MailServerOut','Imap','Smtp','Dispositions','CannedAnswer','Answers','Interactions','Applications','List','ListId','TemplateId','user_has_mail_accounts','team_has_mail_queues','MailInteractionId','Account','ContactId','Owner','Tag','mail_interaction_has_tags','ThroughTags','Users','user_has_mail_interactions','Attachments','ChatWebsiteId','ChatOfflineMessageId','Items','FaxAccountId','FaxApplication','TagId','FaxInteractionId','Tags','fax_interaction_has_tags','user_has_fax_interactions','Interaction','AttachmentId','SmsAccountId','SmsMessage','SmsInteractionId','sms_interaction_has_tags','user_has_sms_interactions','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelMessage','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ChatProactiveAction','ProactiveActions','Queue','ChatQueueId','Website','chat_interaction_has_tags','ChatInteractionId','team_has_chat_queues','ChatInternalMessage','ChatGroupId','ChatGroup','CompanyId','CmHopperHistory','JscriptySessions','Company','cm_user_has_contacts','cm_contact_has_tags','CampaignId','OwnerId','Automation','All','OneAll','Any','AutomationAnyId','AutomationId','ParentId','Intervals','Extensions','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','Mohs','whatsapp_interaction_has_tags','AllConditions','AllCondition','AnyConditions','TriggerAnyId','Actions','Fields','MetricId','SalesforceConfiguration','SalesforceField','Subjects','DescriptionId','Subject','SubjectId','Description','Field','FieldId','VariableId','AccountId','Descriptions','Configurations','int_desk_configuration_has_tags','ZohoField','int_zendesk_configuration_has_tags','FreshdeskField','int_freshdesk_configuration_has_tags','ServicenowAccount','ServicenowConfiguration','Dynamics365Field','FreshsalesAccount','ToId','JscriptyQuestionReport','SessionId','JscriptyProject','ProjectId','VoiceQueues','team_has_fax_queues','team_has_whatsapp_queues','WhatsappQueues','TeamVoicePrefix','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','ChatTransferReport','FromChatWebsiteId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','ToOpenchannelAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Queues','UserProfileSection','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappApplication','WhatsappInteractionId','WhatsappMessage','FromWhatsappAccountId','ToWhatsappAccountId','WhatsappQueueId','user','../config/environment','sequelize','jstz','determine','defaultsDeep','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','database','password','options','username','User','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/memberReport/memberReport.model','Trunk','../api/voiceTransferReport/voiceTransferReport.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserOpenchannelQueue','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','MailSubstatus','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','../api/smsInteraction/smsInteraction.model','../api/smsMessage/smsMessage.model','SmsQueue','OpenchannelAccount','OpenchannelApplication','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatGroup/chatGroup.model','../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','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','Action','../api/action/action.model','../api/automation/automation.model','Disposition','Condition','../api/condition/condition.model','Interval','Pause','../api/pause/pause.model','Cdr','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','../api/tag/tag.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','AnalyticCustomReport','AnalyticDefaultReport','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','../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','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','ZendeskField','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatQueueReport','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/jscriptyProject/jscriptyProject.model','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareMessage/squareMessage.model','../api/team/team.model','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','Plugin','../api/plugin/plugin.model','../api/mailTransferReport/mailTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','hasOne','UserId','userSetting','cascade','hasMany','Recordings','VoiceQueuesRt','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteractions','MailInteractions','belongsTo','userProfileId','belongsToMany','chat_group_has_users','Contacts','Lists','Team','user_has_chat_interactions','SmsInteraction','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoicePrefix','VoicePrefixes','MailQueues','UserMailQueue','ChatQueues','FaxQueues','SmsQueues','UserSmsQueue','OpenchannelQueues','cm_user_has_lists','ChatWebsites','user_has_chat_websites','user_has_fax_accounts','user_has_openchannel_accounts','SmsAccount','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects'];(function(_0x285cf1,_0x47e330){var _0x2fea93=function(_0x4129d6){while(--_0x4129d6){_0x285cf1['push'](_0x285cf1['shift']());}};_0x2fea93(++_0x47e330);}(_0x6629,0xc1));var _0x9662=function(_0x4c0fca,_0x17422c){_0x4c0fca=_0x4c0fca-0x0;var _0x15d3dc=_0x6629[_0x4c0fca];return _0x15d3dc;};'use strict';var config=require(_0x9662('0x0'));var Sequelize=require(_0x9662('0x1'));var _=require('lodash');var jstz=require(_0x9662('0x2'));var timezone=jstz[_0x9662('0x3')]();config[_0x9662('0x1')]=_[_0x9662('0x4')](config['sequelize'],{'database':'motion2','username':_0x9662('0x5'),'password':_0x9662('0x6'),'options':{'host':_0x9662('0x7'),'port':0xcea,'dialect':_0x9662('0x8'),'dialectOptions':{'charset':_0x9662('0x9')},'logging':![],'timezone':timezone[_0x9662('0xa')](),'define':{'charset':_0x9662('0xb'),'collate':_0x9662('0xc')}}});config[_0x9662('0xd')]=_[_0x9662('0x4')](config[_0x9662('0xd')],{'database':'motion2','username':_0x9662('0x5'),'password':'xC@LL1234','options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x9662('0x8'),'dialectOptions':{'charset':_0x9662('0x9')},'logging':![],'timezone':timezone[_0x9662('0xa')](),'define':{'charset':_0x9662('0xb'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x9662('0x1')][_0x9662('0xe')],config['sequelize']['username'],config['sequelize'][_0x9662('0xf')],config[_0x9662('0x1')][_0x9662('0x10')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x9662('0xd')][_0x9662('0xe')],config[_0x9662('0xd')][_0x9662('0x11')],config[_0x9662('0xd')][_0x9662('0xf')],config[_0x9662('0xd')][_0x9662('0x10')])};db[_0x9662('0x12')]=db['sequelize'][_0x9662('0x13')]('../api/user/user.model');db[_0x9662('0x14')]=db[_0x9662('0x1')]['import'](_0x9662('0x15'));db[_0x9662('0x16')]=db[_0x9662('0x1')][_0x9662('0x13')]('../api/voiceContext/voiceContext.model');db[_0x9662('0x17')]=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0x18'));db[_0x9662('0x19')]=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0x1a'));db[_0x9662('0x1b')]=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0x1c'));db[_0x9662('0x1d')]=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0x1e'));db[_0x9662('0x1f')]=db[_0x9662('0x1')]['import'](_0x9662('0x20'));db[_0x9662('0x21')]=db['sequelize'][_0x9662('0x13')](_0x9662('0x22'));db[_0x9662('0x23')]=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0x24'));db['VoiceCallReport']=db[_0x9662('0x1')]['import'](_0x9662('0x25'));db[_0x9662('0x26')]=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0x27'));db[_0x9662('0x28')]=db[_0x9662('0x1')]['import']('../api/voiceAgentReport/voiceAgentReport.model');db['VoiceQueueReport']=db[_0x9662('0x1')]['import']('../api/voiceQueueReport/voiceQueueReport.model');db['MemberReport']=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0x29'));db[_0x9662('0x2a')]=db[_0x9662('0x1')][_0x9662('0x13')]('../api/trunk/trunk.model');db['VoiceTransferReport']=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0x2b'));db['UserVoiceQueueRt']=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0x2c'));db[_0x9662('0x2d')]=db[_0x9662('0x1')]['import'](_0x9662('0x2e'));db[_0x9662('0x2f')]=db['sequelize'][_0x9662('0x13')](_0x9662('0x30'));db['UserMailQueue']=db['sequelize'][_0x9662('0x13')](_0x9662('0x31'));db[_0x9662('0x32')]=db['sequelize'][_0x9662('0x13')](_0x9662('0x33'));db['UserSmsQueue']=db['sequelize'][_0x9662('0x13')]('../api/userSmsQueue/userSmsQueue.model');db[_0x9662('0x34')]=db['sequelize']['import']('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0x9662('0x35')]=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0x36'));db[_0x9662('0x37')]=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0x38'));db['MailServerOut']=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0x39'));db[_0x9662('0x3a')]=db[_0x9662('0x1')][_0x9662('0x13')]('../api/mailAccount/mailAccount.model');db[_0x9662('0x3b')]=db[_0x9662('0x1')]['import']('../api/mailQueue/mailQueue.model');db[_0x9662('0x3c')]=db[_0x9662('0x1')][_0x9662('0x13')]('../api/mailSubstatus/mailSubstatus.model');db[_0x9662('0x3d')]=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0x3e'));db[_0x9662('0x3f')]=db['sequelize']['import'](_0x9662('0x40'));db[_0x9662('0x41')]=db['sequelize']['import']('../api/mailApplication/mailApplication.model');db[_0x9662('0x42')]=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0x43'));db[_0x9662('0x44')]=db['sequelize'][_0x9662('0x13')]('../api/dashboard/dashboard.model');db[_0x9662('0x45')]=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0x46'));db[_0x9662('0x47')]=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0x48'));db['FaxApplication']=db['sequelize'][_0x9662('0x13')](_0x9662('0x49'));db[_0x9662('0x4a')]=db['sequelize'][_0x9662('0x13')](_0x9662('0x4b'));db[_0x9662('0x4c')]=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0x4d'));db[_0x9662('0x4e')]=db[_0x9662('0x1')]['import']('../api/faxQueue/faxQueue.model');db[_0x9662('0x4f')]=db['sequelize']['import'](_0x9662('0x50'));db['SmsAccount']=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0x51'));db[_0x9662('0x52')]=db[_0x9662('0x1')]['import'](_0x9662('0x53'));db['SmsInteraction']=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0x54'));db['SmsMessage']=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0x55'));db[_0x9662('0x56')]=db[_0x9662('0x1')][_0x9662('0x13')]('../api/smsQueue/smsQueue.model');db[_0x9662('0x57')]=db[_0x9662('0x1')][_0x9662('0x13')]('../api/openchannelAccount/openchannelAccount.model');db[_0x9662('0x58')]=db[_0x9662('0x1')]['import']('../api/openchannelApplication/openchannelApplication.model');db[_0x9662('0x59')]=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0x5a'));db['OpenchannelMessage']=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0x5b'));db[_0x9662('0x5c')]=db['sequelize'][_0x9662('0x13')](_0x9662('0x5d'));db[_0x9662('0x5e')]=db[_0x9662('0x1')][_0x9662('0x13')]('../api/chatWebsite/chatWebsite.model');db[_0x9662('0x5f')]=db[_0x9662('0x1')]['import'](_0x9662('0x60'));db[_0x9662('0x61')]=db[_0x9662('0x1')][_0x9662('0x13')]('../api/chatApplication/chatApplication.model');db[_0x9662('0x62')]=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0x63'));db[_0x9662('0x64')]=db['sequelize'][_0x9662('0x13')](_0x9662('0x65'));db[_0x9662('0x66')]=db['sequelize'][_0x9662('0x13')](_0x9662('0x67'));db[_0x9662('0x68')]=db['sequelize'][_0x9662('0x13')]('../api/chatQueue/chatQueue.model');db['ChatGroup']=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0x69'));db['ChatProactiveAction']=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0x6a'));db[_0x9662('0x6b')]=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0x6c'));db[_0x9662('0x6d')]=db['sequelize'][_0x9662('0x13')](_0x9662('0x6e'));db[_0x9662('0x6f')]=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0x70'));db[_0x9662('0x71')]=db[_0x9662('0x1')][_0x9662('0x13')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0x9662('0x72')]=db['sequelize'][_0x9662('0x13')](_0x9662('0x73'));db['CmHopperHistory']=db[_0x9662('0x1')]['import'](_0x9662('0x74'));db[_0x9662('0x75')]=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0x76'));db[_0x9662('0x77')]=db[_0x9662('0x1')][_0x9662('0x13')]('../api/cmCustomField/cmCustomField.model');db[_0x9662('0x78')]=db['sequelize'][_0x9662('0x13')](_0x9662('0x79'));db['Automation']=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0x7a'));db['CannedAnswer']=db[_0x9662('0x1')][_0x9662('0x13')]('../api/cannedAnswer/cannedAnswer.model');db[_0x9662('0x7b')]=db['sequelize'][_0x9662('0x13')]('../api/disposition/disposition.model');db[_0x9662('0x7c')]=db['sequelize'][_0x9662('0x13')](_0x9662('0x7d'));db[_0x9662('0x7e')]=db[_0x9662('0x1')][_0x9662('0x13')]('../api/interval/interval.model');db[_0x9662('0x7f')]=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0x80'));db[_0x9662('0x81')]=db[_0x9662('0x1')][_0x9662('0x13')]('../api/cdr/cdr.model');db[_0x9662('0x82')]=db['sequelize']['import'](_0x9662('0x83'));db[_0x9662('0x84')]=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0x85'));db[_0x9662('0x86')]=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0x87'));db['Tag']=db[_0x9662('0x1')]['import'](_0x9662('0x88'));db[_0x9662('0x89')]=db[_0x9662('0x1')]['import'](_0x9662('0x8a'));db[_0x9662('0x8b')]=db['sequelize'][_0x9662('0x13')](_0x9662('0x8c'));db[_0x9662('0x8d')]=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0x8e'));db[_0x9662('0x8f')]=db[_0x9662('0x1')]['import'](_0x9662('0x90'));db[_0x9662('0x91')]=db[_0x9662('0x1')][_0x9662('0x13')]('../api/integrationReport/integrationReport.model');db[_0x9662('0x92')]=db[_0x9662('0x1')][_0x9662('0x13')]('../api/analyticCustomReport/analyticCustomReport.model');db[_0x9662('0x93')]=db[_0x9662('0x1')][_0x9662('0x13')]('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0x9662('0x94')]=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0x95'));db[_0x9662('0x96')]=db[_0x9662('0x1')]['import'](_0x9662('0x97'));db[_0x9662('0x98')]=db[_0x9662('0x1')][_0x9662('0x13')]('../api/analyticFieldReport/analyticFieldReport.model');db[_0x9662('0x99')]=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0x9a'));db[_0x9662('0x9b')]=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0x9c'));db['SalesforceConfiguration']=db['sequelize']['import'](_0x9662('0x9d'));db['SalesforceField']=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0x9e'));db[_0x9662('0x9f')]=db['sequelize'][_0x9662('0x13')](_0x9662('0xa0'));db[_0x9662('0xa1')]=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0xa2'));db[_0x9662('0xa3')]=db[_0x9662('0x1')]['import'](_0x9662('0xa4'));db['DeskAccount']=db['sequelize']['import'](_0x9662('0xa5'));db[_0x9662('0xa6')]=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0xa7'));db[_0x9662('0xa8')]=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0xa9'));db[_0x9662('0xaa')]=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0xab'));db[_0x9662('0xac')]=db[_0x9662('0x1')]['import'](_0x9662('0xad'));db['ZohoField']=db['sequelize'][_0x9662('0x13')]('../api/intZohoField/intZohoField.model');db[_0x9662('0xae')]=db['sequelize'][_0x9662('0x13')](_0x9662('0xaf'));db[_0x9662('0xb0')]=db[_0x9662('0x1')]['import']('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0x9662('0xb1')]=db[_0x9662('0x1')][_0x9662('0x13')]('../api/intZendeskField/intZendeskField.model');db[_0x9662('0xb2')]=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0xb3'));db[_0x9662('0xb4')]=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0xb5'));db['FreshdeskField']=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0xb6'));db[_0x9662('0xb7')]=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0xb8'));db[_0x9662('0xb9')]=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0xba'));db[_0x9662('0xbb')]=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0xbc'));db['ServicenowAccount']=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0xbd'));db['ServicenowConfiguration']=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0xbe'));db[_0x9662('0xbf')]=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0xc0'));db[_0x9662('0xc1')]=db[_0x9662('0x1')]['import'](_0x9662('0xc2'));db[_0x9662('0xc3')]=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0xc4'));db['Dynamics365Field']=db['sequelize']['import']('../api/intDynamics365Field/intDynamics365Field.model');db['FreshsalesAccount']=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0xc5'));db[_0x9662('0xc6')]=db[_0x9662('0x1')][_0x9662('0x13')]('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db[_0x9662('0xc7')]=db[_0x9662('0x1')]['import'](_0x9662('0xc8'));db[_0x9662('0x8f')]=db[_0x9662('0x1')][_0x9662('0x13')]('../api/integration/integration.model');db[_0x9662('0xc9')]=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0xca'));db[_0x9662('0xcb')]=db['sequelize']['import']('../api/chatQueueReport/chatQueueReport.model');db['ChatInternalMessage']=db['sequelize'][_0x9662('0x13')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x9662('0xcc')]=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0xcd'));db['JscriptyQuestionReport']=db['sequelize'][_0x9662('0x13')](_0x9662('0xce'));db[_0x9662('0xcf')]=db[_0x9662('0x1')][_0x9662('0x13')]('../api/jscriptySessionReport/jscriptySessionReport.model');db[_0x9662('0xd0')]=db['sequelize']['import'](_0x9662('0xd1'));db[_0x9662('0xd2')]=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0xd3'));db[_0x9662('0xd4')]=db[_0x9662('0x1')][_0x9662('0x13')]('../api/squareReportDetail/squareReportDetail.model');db['JscriptyProject']=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0xd5'));db['Setting']=db['sequelize']['import'](_0x9662('0xd6'));db[_0x9662('0xd7')]=db[_0x9662('0x1')]['import'](_0x9662('0xd8'));db[_0x9662('0xd9')]=db['sequelize'][_0x9662('0x13')](_0x9662('0xda'));db[_0x9662('0xdb')]=db[_0x9662('0x1')]['import']('../api/squareRecording/squareRecording.model');db['SquareMessage']=db[_0x9662('0x1')]['import'](_0x9662('0xdc'));db['Team']=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0xdd'));db['License']=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0xde'));db[_0x9662('0xdf')]=db[_0x9662('0x1')]['import'](_0x9662('0xe0'));db[_0x9662('0xe1')]=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0xe2'));db[_0x9662('0xe3')]=db[_0x9662('0x1')][_0x9662('0x13')]('../api/attachment/attachment.model');db[_0x9662('0xe4')]=db['sequelize'][_0x9662('0x13')](_0x9662('0xe5'));db['MailTransferReport']=db['sequelize']['import'](_0x9662('0xe6'));db['ChatTransferReport']=db[_0x9662('0x1')][_0x9662('0x13')]('../api/chatTransferReport/chatTransferReport.model');db[_0x9662('0xe7')]=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0xe8'));db[_0x9662('0xe9')]=db['sequelize'][_0x9662('0x13')](_0x9662('0xea'));db[_0x9662('0xeb')]=db['sequelize'][_0x9662('0x13')](_0x9662('0xec'));db[_0x9662('0xed')]=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0xee'));db['VoicePrefix']=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0xef'));db[_0x9662('0xf0')]=db['sequelize'][_0x9662('0x13')](_0x9662('0xf1'));db['UserProfileSection']=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0xf2'));db[_0x9662('0xf3')]=db['sequelize'][_0x9662('0x13')](_0x9662('0xf4'));db[_0x9662('0xf5')]=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0xf6'));db[_0x9662('0xf7')]=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0xf8'));db['WhatsappApplication']=db[_0x9662('0x1')]['import'](_0x9662('0xf9'));db[_0x9662('0xfa')]=db[_0x9662('0x1')][_0x9662('0x13')]('../api/whatsappInteraction/whatsappInteraction.model');db['WhatsappMessage']=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0xfb'));db[_0x9662('0xfc')]=db[_0x9662('0x1')][_0x9662('0x13')]('../api/whatsappQueueReport/whatsappQueueReport.model');db[_0x9662('0xfd')]=db[_0x9662('0x1')]['import'](_0x9662('0xfe'));db[_0x9662('0xff')]=db[_0x9662('0x1')]['import'](_0x9662('0x100'));db['CloudProvider']=db['sequelize'][_0x9662('0x13')](_0x9662('0x101'));db[_0x9662('0x102')]=db[_0x9662('0x1')]['import'](_0x9662('0x103'));db['TeamVoicePrefix']=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0x104'));db[_0x9662('0x105')]=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0x106'));db[_0x9662('0x107')]=db[_0x9662('0x1')][_0x9662('0x13')](_0x9662('0x108'));db['User'][_0x9662('0x109')](db[_0x9662('0x21')],{'as':'VoiceMail','onDelete':'cascade','foreignKey':_0x9662('0x10a')});db[_0x9662('0x12')]['hasOne'](db[_0x9662('0x107')],{'as':_0x9662('0x10b'),'onDelete':_0x9662('0x10c'),'foreignKey':_0x9662('0x10a')});db[_0x9662('0x12')][_0x9662('0x10d')](db['VoiceRecording'],{'as':_0x9662('0x10e'),'foreignKey':_0x9662('0x10a')});db['User'][_0x9662('0x10d')](db['UserVoiceQueueRt'],{'as':_0x9662('0x10f'),'foreignKey':_0x9662('0x10a')});db[_0x9662('0x12')][_0x9662('0x10d')](db[_0x9662('0x17')],{'as':'Extensions','onDelete':_0x9662('0x10c'),'hooks':!![]});db[_0x9662('0x12')][_0x9662('0x10d')](db[_0x9662('0x72')],{'as':'HopperFinals','foreignKey':_0x9662('0x10a')});db[_0x9662('0x12')]['hasMany'](db['CmHopperHistory'],{'as':'HopperHistory','foreignKey':_0x9662('0x10a')});db[_0x9662('0x12')][_0x9662('0x10d')](db[_0x9662('0x75')],{'as':_0x9662('0x75'),'foreignKey':'UserId'});db[_0x9662('0x12')]['hasMany'](db[_0x9662('0x59')],{'as':_0x9662('0x110'),'foreignKey':_0x9662('0x10a')});db[_0x9662('0x12')]['hasMany'](db[_0x9662('0x62')],{'as':_0x9662('0x111'),'foreignKey':_0x9662('0x10a')});db['User'][_0x9662('0x10d')](db['SmsInteraction'],{'as':_0x9662('0x112'),'foreignKey':_0x9662('0x10a')});db['User'][_0x9662('0x10d')](db[_0x9662('0x4a')],{'as':_0x9662('0x113'),'foreignKey':_0x9662('0x10a')});db[_0x9662('0x12')][_0x9662('0x10d')](db[_0x9662('0x3d')],{'as':_0x9662('0x114'),'foreignKey':_0x9662('0x10a')});db[_0x9662('0x12')]['hasMany'](db['WhatsappInteraction'],{'as':'WhatsappInteractions','foreignKey':_0x9662('0x10a')});db[_0x9662('0x12')][_0x9662('0x10d')](db[_0x9662('0xf5')],{'as':'UserNotifications','foreignKey':'SenderId'});db['User'][_0x9662('0x115')](db['UserProfile'],{'as':_0x9662('0xf0'),'foreignKey':_0x9662('0x116')});db[_0x9662('0x12')][_0x9662('0x117')](db['ChatGroup'],{'as':'Groups','through':_0x9662('0x118')});db['User']['belongsToMany'](db[_0x9662('0x6d')],{'as':_0x9662('0x119'),'through':'cm_user_has_contacts'});db[_0x9662('0x12')][_0x9662('0x117')](db[_0x9662('0xed')],{'as':_0x9662('0x11a'),'through':'cm_user_has_lists'});db[_0x9662('0x12')][_0x9662('0x117')](db[_0x9662('0x11b')],{'through':'user_has_teams'});db[_0x9662('0x12')][_0x9662('0x117')](db[_0x9662('0x3d')],{'as':_0x9662('0x114'),'through':'user_has_mail_interactions'});db[_0x9662('0x12')]['belongsToMany'](db[_0x9662('0x62')],{'as':'ChatInteractions','through':_0x9662('0x11c')});db[_0x9662('0x12')][_0x9662('0x117')](db[_0x9662('0x4a')],{'as':_0x9662('0x113'),'through':'user_has_fax_interactions'});db['User'][_0x9662('0x117')](db[_0x9662('0x11d')],{'as':_0x9662('0x112'),'through':'user_has_sms_interactions'});db[_0x9662('0x12')][_0x9662('0x117')](db[_0x9662('0x59')],{'as':_0x9662('0x110'),'through':_0x9662('0x11e')});db[_0x9662('0x12')][_0x9662('0x117')](db['WhatsappInteraction'],{'as':'WhatsappInteractions','through':_0x9662('0x11f')});db[_0x9662('0x12')][_0x9662('0x117')](db[_0x9662('0x1b')],{'as':'VoiceQueues','through':'UserVoiceQueue','required':![]});db[_0x9662('0x12')][_0x9662('0x117')](db[_0x9662('0x120')],{'as':_0x9662('0x121'),'through':_0x9662('0x105'),'required':![]});db[_0x9662('0x12')][_0x9662('0x117')](db[_0x9662('0x3b')],{'as':_0x9662('0x122'),'through':_0x9662('0x123'),'required':![]});db['User'][_0x9662('0x117')](db[_0x9662('0x68')],{'as':_0x9662('0x124'),'through':_0x9662('0x2f'),'required':![],'hooks':!![]});db[_0x9662('0x12')][_0x9662('0x117')](db[_0x9662('0x4e')],{'as':_0x9662('0x125'),'through':'UserFaxQueue','required':![]});db[_0x9662('0x12')][_0x9662('0x117')](db[_0x9662('0x56')],{'as':_0x9662('0x126'),'through':_0x9662('0x127'),'required':![]});db[_0x9662('0x12')][_0x9662('0x117')](db['OpenchannelQueue'],{'as':_0x9662('0x128'),'through':_0x9662('0x34'),'required':![]});db[_0x9662('0x12')][_0x9662('0x117')](db[_0x9662('0xff')],{'as':'WhatsappQueues','through':_0x9662('0x35'),'required':![]});db[_0x9662('0x12')][_0x9662('0x117')](db[_0x9662('0xed')],{'through':_0x9662('0x129')});db[_0x9662('0x12')]['belongsToMany'](db[_0x9662('0x5e')],{'as':_0x9662('0x12a'),'through':_0x9662('0x12b')});db[_0x9662('0x12')][_0x9662('0x117')](db[_0x9662('0x47')],{'as':'FaxAccounts','through':_0x9662('0x12c')});db[_0x9662('0x12')][_0x9662('0x117')](db[_0x9662('0x3a')],{'as':'MailAccounts','through':'user_has_mail_accounts'});db[_0x9662('0x12')]['belongsToMany'](db[_0x9662('0x57')],{'as':'OpenchannelAccounts','through':_0x9662('0x12d')});db['User'][_0x9662('0x117')](db[_0x9662('0x12e')],{'as':_0x9662('0x12f'),'through':_0x9662('0x130')});db[_0x9662('0x12')][_0x9662('0x117')](db[_0x9662('0xf7')],{'as':_0x9662('0x131'),'through':_0x9662('0x132')});db[_0x9662('0x12')][_0x9662('0x117')](db['SquareProject'],{'as':_0x9662('0x133'),'through':_0x9662('0x134')});db[_0x9662('0x14')][_0x9662('0x10d')](db['VoiceExtension'],{'as':_0x9662('0x135'),'onDelete':_0x9662('0x10c'),'foreignKey':'ChanSpyId'});db[_0x9662('0x16')][_0x9662('0x10d')](db[_0x9662('0x17')],{'onDelete':_0x9662('0x10c')});db[_0x9662('0x17')][_0x9662('0x10d')](db[_0x9662('0x17')],{'as':'Applications','onDelete':'cascade'});db[_0x9662('0x19')][_0x9662('0x117')](db['Sound'],{'as':_0x9662('0x136'),'through':_0x9662('0x137')});db[_0x9662('0x1b')][_0x9662('0x10d')](db[_0x9662('0x138')],{'as':'Members','foreignKey':_0x9662('0x139')});db[_0x9662('0x1b')][_0x9662('0x10d')](db[_0x9662('0x6f')],{'as':_0x9662('0x13a'),'foreignKey':_0x9662('0x139')});db[_0x9662('0x1b')][_0x9662('0x10d')](db['CmHopperFinal'],{'as':_0x9662('0x13b'),'foreignKey':_0x9662('0x139')});db[_0x9662('0x1b')][_0x9662('0x10d')](db['CmHopperHistory'],{'as':_0x9662('0x13c'),'foreignKey':'VoiceQueueId'});db[_0x9662('0x1b')]['hasMany'](db[_0x9662('0x75')],{'as':_0x9662('0x75'),'foreignKey':_0x9662('0x139')});db[_0x9662('0x1b')][_0x9662('0x10d')](db[_0x9662('0x71')],{'as':_0x9662('0x13d'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x9662('0x10d')](db[_0x9662('0xcf')],{'as':'JscriptySessions','foreignKey':_0x9662('0x139')});db[_0x9662('0x1b')]['belongsTo'](db[_0x9662('0x2a')],{'as':'Trunk','foreignKey':_0x9662('0x13e')});db[_0x9662('0x1b')][_0x9662('0x115')](db[_0x9662('0x2a')],{'as':_0x9662('0x13f'),'foreignKey':_0x9662('0x140')});db['VoiceQueue'][_0x9662('0x115')](db[_0x9662('0x7e')],{'as':_0x9662('0x7e'),'foreignKey':_0x9662('0x141')});db[_0x9662('0x1b')][_0x9662('0x115')](db['Pause'],{'as':_0x9662('0x142'),'foreignKey':_0x9662('0x143')});db[_0x9662('0x1b')][_0x9662('0x117')](db[_0x9662('0xed')],{'as':_0x9662('0x11a'),'through':_0x9662('0x144')});db[_0x9662('0x1b')]['belongsToMany'](db[_0x9662('0x12')],{'as':_0x9662('0x145'),'through':_0x9662('0x2d')});db['VoiceQueue'][_0x9662('0x117')](db[_0x9662('0x11b')],{'as':_0x9662('0x146'),'through':_0x9662('0x102')});db[_0x9662('0x1b')]['belongsToMany'](db[_0x9662('0xed')],{'as':_0x9662('0x147'),'through':_0x9662('0x148')});db[_0x9662('0x1d')]['belongsTo'](db['User'],{'as':_0x9662('0x12'),'foreignKey':_0x9662('0x10a')});db[_0x9662('0x1f')]['belongsTo'](db['User'],{'as':_0x9662('0x12'),'foreignKey':_0x9662('0x10a')});db[_0x9662('0x21')]['hasMany'](db[_0x9662('0x23')],{'as':_0x9662('0x149'),'onDelete':_0x9662('0x10c'),'foreignKey':_0x9662('0x14a'),'sourceKey':_0x9662('0x14b')});db[_0x9662('0x23')]['belongsTo'](db[_0x9662('0x21')],{'foreignKey':_0x9662('0x14a'),'targetKey':_0x9662('0x14b')});db['VoiceCallReport']['hasMany'](db['VoiceQueueReport'],{'as':'QueueCalls','foreignKey':_0x9662('0x14c'),'constraints':![]});db[_0x9662('0x14d')][_0x9662('0x10d')](db[_0x9662('0x28')],{'as':_0x9662('0x14e'),'foreignKey':'uniqueid','constraints':![]});db['VoiceCallReport']['belongsTo'](db[_0x9662('0x12')],{'as':_0x9662('0x12'),'foreignKey':_0x9662('0x10a')});db[_0x9662('0x14d')][_0x9662('0x115')](db[_0x9662('0x6d')],{'as':_0x9662('0x14f'),'foreignKey':'ContactId'});db[_0x9662('0x37')][_0x9662('0x115')](db[_0x9662('0x3a')],{'as':_0x9662('0x3a'),'foreignKey':_0x9662('0x150')});db[_0x9662('0x37')][_0x9662('0x115')](db[_0x9662('0x151')],{'as':_0x9662('0x151'),'foreignKey':_0x9662('0x152'),'onDelete':_0x9662('0x153')});db[_0x9662('0x154')]['belongsTo'](db[_0x9662('0x3a')],{'as':_0x9662('0x3a'),'foreignKey':_0x9662('0x150')});db[_0x9662('0x154')]['belongsTo'](db[_0x9662('0x151')],{'as':_0x9662('0x151'),'foreignKey':_0x9662('0x152'),'onDelete':_0x9662('0x153')});db['MailAccount'][_0x9662('0x109')](db[_0x9662('0x37')],{'as':_0x9662('0x155'),'onDelete':'cascade'});db['MailAccount'][_0x9662('0x109')](db[_0x9662('0x154')],{'as':_0x9662('0x156'),'onDelete':_0x9662('0x10c')});db[_0x9662('0x3a')][_0x9662('0x10d')](db[_0x9662('0x7b')],{'as':_0x9662('0x157'),'foreignKey':_0x9662('0x150'),'onDelete':_0x9662('0x10c')});db['MailAccount'][_0x9662('0x10d')](db[_0x9662('0x158')],{'as':_0x9662('0x159'),'foreignKey':'MailAccountId'});db[_0x9662('0x3a')][_0x9662('0x10d')](db[_0x9662('0x3f')],{'as':_0x9662('0x149'),'foreignKey':_0x9662('0x150')});db[_0x9662('0x3a')][_0x9662('0x10d')](db[_0x9662('0x3d')],{'as':_0x9662('0x15a')});db[_0x9662('0x3a')]['hasMany'](db[_0x9662('0x41')],{'as':_0x9662('0x15b')});db['MailAccount']['belongsTo'](db[_0x9662('0xed')],{'as':_0x9662('0x15c'),'foreignKey':_0x9662('0x15d')});db[_0x9662('0x3a')][_0x9662('0x115')](db[_0x9662('0x89')],{'as':'Template','foreignKey':_0x9662('0x15e')});db[_0x9662('0x3a')][_0x9662('0x115')](db['Pause'],{'as':_0x9662('0x142'),'foreignKey':_0x9662('0x143')});db[_0x9662('0x3a')][_0x9662('0x117')](db['User'],{'as':'Agents','through':_0x9662('0x15f')});db[_0x9662('0x3b')][_0x9662('0x117')](db[_0x9662('0x12')],{'as':_0x9662('0x145'),'through':_0x9662('0x123')});db[_0x9662('0x3b')][_0x9662('0x117')](db[_0x9662('0x11b')],{'through':_0x9662('0x160'),'as':_0x9662('0x146')});db[_0x9662('0x3d')][_0x9662('0x10d')](db['MailMessage'],{'as':_0x9662('0x149'),'onDelete':'cascade','foreignKey':_0x9662('0x161')});db[_0x9662('0x3d')]['belongsTo'](db[_0x9662('0x3a')],{'as':_0x9662('0x162'),'foreignKey':'MailAccountId'});db[_0x9662('0x3d')]['belongsTo'](db[_0x9662('0x6d')],{'as':_0x9662('0x14f'),'foreignKey':_0x9662('0x163')});db[_0x9662('0x3d')][_0x9662('0x115')](db[_0x9662('0x12')],{'as':_0x9662('0x164'),'foreignKey':'UserId'});db[_0x9662('0x3d')][_0x9662('0x117')](db[_0x9662('0x165')],{'through':_0x9662('0x166'),'as':'Tags'});db['MailInteraction'][_0x9662('0x117')](db[_0x9662('0x165')],{'through':_0x9662('0x166'),'as':_0x9662('0x167')});db['MailInteraction'][_0x9662('0x117')](db[_0x9662('0x12')],{'as':_0x9662('0x168'),'through':_0x9662('0x169'),'foreignKey':_0x9662('0x161')});db['MailMessage'][_0x9662('0x10d')](db[_0x9662('0xe3')],{'as':_0x9662('0x16a'),'onDelete':_0x9662('0x10c')});db[_0x9662('0x3f')]['belongsTo'](db[_0x9662('0x12')],{'as':_0x9662('0x12')});db[_0x9662('0x3f')]['belongsTo'](db[_0x9662('0x6d')],{'onDelete':_0x9662('0x10c'),'as':'Contact'});db[_0x9662('0x3f')][_0x9662('0x115')](db[_0x9662('0x3d')],{'as':'Interaction','foreignKey':_0x9662('0x161')});db[_0x9662('0x3f')][_0x9662('0x115')](db['MailAccount'],{'as':_0x9662('0x162'),'foreignKey':_0x9662('0x150')});db['MailMessage']['belongsTo'](db[_0x9662('0x5e')],{'as':_0x9662('0x5e'),'foreignKey':_0x9662('0x16b')});db[_0x9662('0x3f')]['belongsTo'](db[_0x9662('0x66')],{'as':_0x9662('0x66'),'foreignKey':_0x9662('0x16c')});db[_0x9662('0x41')][_0x9662('0x115')](db[_0x9662('0x12')],{'onDelete':'restrict'});db[_0x9662('0x41')][_0x9662('0x115')](db[_0x9662('0x3b')],{'onDelete':_0x9662('0x153')});db[_0x9662('0x41')][_0x9662('0x115')](db[_0x9662('0x3a')],{'onDelete':_0x9662('0x153')});db['MailApplication']['belongsTo'](db[_0x9662('0x7e')],{'onDelete':_0x9662('0x153'),'foreignKey':_0x9662('0x141')});db[_0x9662('0x41')][_0x9662('0x115')](db[_0x9662('0x165')],{'onDelete':_0x9662('0x153'),'foreignKey':'TagId'});db[_0x9662('0x42')][_0x9662('0x115')](db[_0x9662('0x3a')],{});db[_0x9662('0x42')]['belongsTo'](db[_0x9662('0xed')],{'as':_0x9662('0x15c'),'foreignKey':_0x9662('0x15d')});db[_0x9662('0x42')]['belongsTo'](db[_0x9662('0x6d')],{'as':_0x9662('0x14f'),'foreignKey':'ContactId'});db[_0x9662('0x42')]['belongsTo'](db['MailInteraction'],{});db[_0x9662('0x42')][_0x9662('0x115')](db[_0x9662('0x3f')],{});db[_0x9662('0x42')][_0x9662('0x115')](db[_0x9662('0x12')],{});db[_0x9662('0x42')][_0x9662('0x115')](db[_0x9662('0x3b')],{});db[_0x9662('0x44')]['hasMany'](db[_0x9662('0x45')],{'as':_0x9662('0x16d'),'onDelete':_0x9662('0x10c')});db[_0x9662('0x47')]['hasMany'](db[_0x9662('0x7b')],{'as':_0x9662('0x157'),'foreignKey':_0x9662('0x16e'),'onDelete':_0x9662('0x10c')});db[_0x9662('0x47')][_0x9662('0x10d')](db['CannedAnswer'],{'as':_0x9662('0x159'),'foreignKey':_0x9662('0x16e')});db[_0x9662('0x47')]['hasMany'](db[_0x9662('0x4a')],{'as':_0x9662('0x15a')});db['FaxAccount'][_0x9662('0x10d')](db[_0x9662('0x16f')],{'as':_0x9662('0x15b')});db[_0x9662('0x47')][_0x9662('0x10d')](db[_0x9662('0x17')],{'as':'Exntensions','onDelete':_0x9662('0x10c')});db[_0x9662('0x47')][_0x9662('0x10d')](db[_0x9662('0x4c')],{'as':_0x9662('0x149')});db[_0x9662('0x47')][_0x9662('0x115')](db[_0x9662('0x2a')],{'as':_0x9662('0x2a')});db[_0x9662('0x47')][_0x9662('0x115')](db['CmList'],{'as':_0x9662('0x15c'),'foreignKey':_0x9662('0x15d')});db[_0x9662('0x47')][_0x9662('0x115')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x9662('0x143')});db[_0x9662('0x47')][_0x9662('0x117')](db[_0x9662('0x12')],{'as':'Agents','through':'user_has_fax_accounts'});db['FaxApplication'][_0x9662('0x115')](db[_0x9662('0x12')],{'onDelete':_0x9662('0x153')});db[_0x9662('0x16f')][_0x9662('0x115')](db[_0x9662('0x4e')],{'onDelete':_0x9662('0x153')});db[_0x9662('0x16f')]['belongsTo'](db[_0x9662('0x47')],{'onDelete':_0x9662('0x153')});db[_0x9662('0x16f')][_0x9662('0x115')](db[_0x9662('0x165')],{'onDelete':_0x9662('0x153'),'foreignKey':_0x9662('0x170')});db[_0x9662('0x4a')]['hasMany'](db['FaxMessage'],{'as':_0x9662('0x149'),'onDelete':_0x9662('0x10c'),'foreignKey':_0x9662('0x171')});db[_0x9662('0x4a')][_0x9662('0x115')](db['FaxAccount'],{'as':_0x9662('0x162'),'foreignKey':_0x9662('0x16e')});db['FaxInteraction'][_0x9662('0x115')](db[_0x9662('0x6d')],{'as':_0x9662('0x14f'),'foreignKey':_0x9662('0x163')});db[_0x9662('0x4a')][_0x9662('0x115')](db[_0x9662('0x12')],{'as':_0x9662('0x164'),'foreignKey':_0x9662('0x10a')});db['FaxInteraction'][_0x9662('0x117')](db['Tag'],{'through':'fax_interaction_has_tags','as':_0x9662('0x172')});db[_0x9662('0x4a')]['belongsToMany'](db['Tag'],{'through':_0x9662('0x173'),'as':_0x9662('0x167')});db[_0x9662('0x4a')][_0x9662('0x117')](db['User'],{'as':_0x9662('0x168'),'through':_0x9662('0x174'),'foreignKey':'FaxInteractionId'});db['FaxMessage'][_0x9662('0x115')](db[_0x9662('0x12')],{'onDelete':_0x9662('0x10c'),'as':_0x9662('0x12')});db[_0x9662('0x4c')]['belongsTo'](db[_0x9662('0x4a')],{'as':_0x9662('0x175'),'foreignKey':_0x9662('0x171')});db[_0x9662('0x4c')][_0x9662('0x115')](db[_0x9662('0x6d')],{'onDelete':_0x9662('0x10c'),'as':_0x9662('0x14f')});db[_0x9662('0x4c')][_0x9662('0x115')](db[_0x9662('0xe3')],{'as':_0x9662('0xe3'),'foreignKey':_0x9662('0x176')});db['FaxMessage']['belongsTo'](db[_0x9662('0x47')],{'as':_0x9662('0x162'),'foreignKey':_0x9662('0x16e')});db[_0x9662('0x4e')][_0x9662('0x117')](db['User'],{'as':_0x9662('0x145'),'through':_0x9662('0x32')});db['FaxQueue'][_0x9662('0x117')](db[_0x9662('0x11b')],{'through':'team_has_fax_queues','as':_0x9662('0x146')});db[_0x9662('0x4f')][_0x9662('0x115')](db[_0x9662('0x47')],{});db[_0x9662('0x4f')][_0x9662('0x115')](db[_0x9662('0xed')],{'as':_0x9662('0x15c'),'foreignKey':'ListId'});db['FaxQueueReport'][_0x9662('0x115')](db[_0x9662('0x6d')],{'as':_0x9662('0x14f'),'foreignKey':_0x9662('0x163')});db[_0x9662('0x4f')][_0x9662('0x115')](db[_0x9662('0x4a')],{});db[_0x9662('0x4f')][_0x9662('0x115')](db[_0x9662('0x4c')],{});db[_0x9662('0x4f')][_0x9662('0x115')](db[_0x9662('0x12')],{});db[_0x9662('0x4f')][_0x9662('0x115')](db[_0x9662('0x4e')],{});db[_0x9662('0x12e')][_0x9662('0x10d')](db[_0x9662('0x7b')],{'as':_0x9662('0x157'),'foreignKey':_0x9662('0x177'),'onDelete':_0x9662('0x10c')});db[_0x9662('0x12e')]['hasMany'](db['CannedAnswer'],{'as':_0x9662('0x159'),'foreignKey':_0x9662('0x177')});db['SmsAccount']['hasMany'](db[_0x9662('0x178')],{'as':_0x9662('0x149'),'foreignKey':_0x9662('0x177')});db['SmsAccount']['hasMany'](db['SmsInteraction'],{'as':_0x9662('0x15a')});db[_0x9662('0x12e')][_0x9662('0x10d')](db[_0x9662('0x52')],{'as':'Applications'});db[_0x9662('0x12e')][_0x9662('0x115')](db['CmList'],{'as':_0x9662('0x15c'),'foreignKey':'ListId'});db['SmsAccount'][_0x9662('0x115')](db[_0x9662('0x7f')],{'as':_0x9662('0x142'),'foreignKey':_0x9662('0x143')});db['SmsAccount']['belongsToMany'](db[_0x9662('0x12')],{'as':_0x9662('0x145'),'through':_0x9662('0x130')});db[_0x9662('0x52')][_0x9662('0x115')](db['User'],{'onDelete':_0x9662('0x153')});db[_0x9662('0x52')][_0x9662('0x115')](db['SmsQueue'],{'onDelete':_0x9662('0x153')});db['SmsApplication']['belongsTo'](db[_0x9662('0x12e')],{'onDelete':_0x9662('0x153')});db['SmsApplication'][_0x9662('0x115')](db[_0x9662('0x7e')],{'onDelete':'restrict','foreignKey':'IntervalId'});db['SmsApplication'][_0x9662('0x115')](db['Tag'],{'onDelete':'restrict','foreignKey':_0x9662('0x170')});db[_0x9662('0x11d')]['hasMany'](db[_0x9662('0x178')],{'as':_0x9662('0x149'),'onDelete':_0x9662('0x10c'),'foreignKey':_0x9662('0x179')});db[_0x9662('0x11d')][_0x9662('0x115')](db[_0x9662('0x12e')],{'as':_0x9662('0x162'),'foreignKey':_0x9662('0x177')});db[_0x9662('0x11d')][_0x9662('0x115')](db['CmContact'],{'as':'Contact','foreignKey':_0x9662('0x163')});db[_0x9662('0x11d')][_0x9662('0x115')](db['User'],{'as':'Owner','foreignKey':'UserId'});db[_0x9662('0x11d')][_0x9662('0x117')](db['Tag'],{'through':_0x9662('0x17a'),'as':_0x9662('0x172')});db['SmsInteraction'][_0x9662('0x117')](db[_0x9662('0x165')],{'through':_0x9662('0x17a'),'as':_0x9662('0x167')});db[_0x9662('0x11d')][_0x9662('0x117')](db[_0x9662('0x12')],{'as':_0x9662('0x168'),'through':_0x9662('0x17b'),'foreignKey':'SmsInteractionId'});db[_0x9662('0x178')]['belongsTo'](db[_0x9662('0x12')],{'as':_0x9662('0x12')});db[_0x9662('0x178')]['belongsTo'](db[_0x9662('0x6d')],{'onDelete':_0x9662('0x10c'),'as':'Contact'});db[_0x9662('0x178')]['belongsTo'](db[_0x9662('0x11d')],{'onDelete':_0x9662('0x10c'),'as':_0x9662('0x175'),'foreignKey':_0x9662('0x179')});db[_0x9662('0x178')]['belongsTo'](db['SmsAccount'],{'as':'Account','foreignKey':_0x9662('0x177')});db['SmsQueue'][_0x9662('0x117')](db[_0x9662('0x12')],{'as':_0x9662('0x145'),'through':_0x9662('0x127'),'foreignKey':_0x9662('0x17c')});db[_0x9662('0x56')]['belongsToMany'](db[_0x9662('0x11b')],{'through':_0x9662('0x17d'),'as':_0x9662('0x146')});db[_0x9662('0x57')]['hasMany'](db['Disposition'],{'as':_0x9662('0x157'),'foreignKey':_0x9662('0x17e'),'onDelete':_0x9662('0x10c')});db[_0x9662('0x57')][_0x9662('0x10d')](db[_0x9662('0x158')],{'as':_0x9662('0x159'),'foreignKey':_0x9662('0x17e')});db[_0x9662('0x57')][_0x9662('0x10d')](db[_0x9662('0x59')],{'as':_0x9662('0x15a'),'foreignKey':_0x9662('0x17e')});db[_0x9662('0x57')][_0x9662('0x10d')](db[_0x9662('0x17f')],{'as':_0x9662('0x149'),'foreignKey':_0x9662('0x17e')});db[_0x9662('0x57')][_0x9662('0x10d')](db[_0x9662('0x58')],{'as':_0x9662('0x15b'),'foreignKey':'OpenchannelAccountId'});db[_0x9662('0x57')][_0x9662('0x115')](db[_0x9662('0xed')],{'as':_0x9662('0x15c'),'foreignKey':_0x9662('0x15d')});db[_0x9662('0x57')][_0x9662('0x115')](db[_0x9662('0x7f')],{'as':_0x9662('0x142'),'foreignKey':_0x9662('0x143')});db['OpenchannelAccount'][_0x9662('0x117')](db[_0x9662('0x12')],{'as':_0x9662('0x145'),'through':'user_has_openchannel_accounts'});db[_0x9662('0x58')][_0x9662('0x115')](db[_0x9662('0x12')],{'onDelete':_0x9662('0x153')});db[_0x9662('0x58')]['belongsTo'](db[_0x9662('0x5c')],{'onDelete':'restrict','foreignKey':_0x9662('0x180')});db[_0x9662('0x58')][_0x9662('0x115')](db['OpenchannelAccount'],{'onDelete':_0x9662('0x153'),'foreignKey':_0x9662('0x17e')});db['OpenchannelApplication']['belongsTo'](db['Interval'],{'onDelete':_0x9662('0x153'),'foreignKey':_0x9662('0x141')});db[_0x9662('0x58')]['belongsTo'](db['Tag'],{'onDelete':_0x9662('0x153'),'foreignKey':'TagId'});db[_0x9662('0x59')]['hasMany'](db[_0x9662('0x17f')],{'as':_0x9662('0x149'),'onDelete':'cascade','foreignKey':_0x9662('0x181')});db[_0x9662('0x59')][_0x9662('0x115')](db['OpenchannelAccount'],{'as':_0x9662('0x162'),'foreignKey':_0x9662('0x17e')});db[_0x9662('0x59')][_0x9662('0x115')](db[_0x9662('0x6d')],{'as':_0x9662('0x14f'),'foreignKey':_0x9662('0x163')});db[_0x9662('0x59')][_0x9662('0x115')](db[_0x9662('0x12')],{'as':'Owner','foreignKey':_0x9662('0x10a')});db[_0x9662('0x59')][_0x9662('0x117')](db[_0x9662('0x165')],{'through':_0x9662('0x182'),'as':'Tags'});db[_0x9662('0x59')][_0x9662('0x117')](db[_0x9662('0x165')],{'through':'openchannel_interaction_has_tags','as':_0x9662('0x167')});db[_0x9662('0x59')][_0x9662('0x117')](db[_0x9662('0x12')],{'as':_0x9662('0x168'),'through':_0x9662('0x11e'),'foreignKey':_0x9662('0x181')});db['OpenchannelMessage'][_0x9662('0x115')](db[_0x9662('0x12')],{'onDelete':_0x9662('0x10c'),'as':_0x9662('0x12')});db[_0x9662('0x17f')]['belongsTo'](db[_0x9662('0x6d')],{'onDelete':_0x9662('0x10c'),'as':_0x9662('0x14f')});db[_0x9662('0x17f')][_0x9662('0x115')](db[_0x9662('0x59')],{'onDelete':_0x9662('0x10c'),'as':'Interaction','foreignKey':_0x9662('0x181')});db[_0x9662('0x17f')][_0x9662('0x115')](db['Attachment'],{'as':_0x9662('0xe3'),'foreignKey':_0x9662('0x176')});db[_0x9662('0x17f')][_0x9662('0x115')](db['OpenchannelAccount'],{'as':'Account','foreignKey':_0x9662('0x17e')});db[_0x9662('0x5c')][_0x9662('0x117')](db[_0x9662('0x12')],{'as':_0x9662('0x145'),'through':'UserOpenchannelQueue','foreignKey':_0x9662('0x180')});db[_0x9662('0x5c')]['belongsToMany'](db['Team'],{'through':_0x9662('0x183'),'as':_0x9662('0x146')});db[_0x9662('0x5e')][_0x9662('0x10d')](db[_0x9662('0x7b')],{'as':_0x9662('0x157'),'foreignKey':_0x9662('0x16b'),'onDelete':'cascade'});db[_0x9662('0x5e')]['hasMany'](db['CannedAnswer'],{'as':_0x9662('0x159'),'foreignKey':_0x9662('0x16b')});db[_0x9662('0x5e')][_0x9662('0x10d')](db[_0x9662('0x184')],{'as':_0x9662('0x185')});db[_0x9662('0x5e')][_0x9662('0x10d')](db[_0x9662('0x62')],{'as':'Interactions'});db[_0x9662('0x5e')]['hasMany'](db[_0x9662('0x61')],{'as':_0x9662('0x15b')});db[_0x9662('0x5e')]['hasMany'](db[_0x9662('0x64')],{'as':_0x9662('0x149')});db['ChatWebsite'][_0x9662('0x115')](db[_0x9662('0xed')],{'as':_0x9662('0x15c'),'foreignKey':_0x9662('0x15d')});db[_0x9662('0x5e')][_0x9662('0x115')](db[_0x9662('0x7e')],{'as':_0x9662('0x7e'),'foreignKey':_0x9662('0x141')});db[_0x9662('0x5e')]['belongsTo'](db[_0x9662('0x3a')],{'as':'MailAccount','foreignKey':_0x9662('0x150')});db[_0x9662('0x5e')][_0x9662('0x115')](db[_0x9662('0x7f')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x9662('0x5e')][_0x9662('0x117')](db[_0x9662('0x12')],{'as':_0x9662('0x145'),'through':_0x9662('0x12b')});db['OpenchannelQueueReport'][_0x9662('0x115')](db[_0x9662('0x57')],{});db['OpenchannelQueueReport'][_0x9662('0x115')](db[_0x9662('0xed')],{'as':_0x9662('0x15c'),'foreignKey':'ListId'});db[_0x9662('0x5f')][_0x9662('0x115')](db[_0x9662('0x6d')],{'as':_0x9662('0x14f'),'foreignKey':'ContactId'});db[_0x9662('0x5f')][_0x9662('0x115')](db[_0x9662('0x59')],{});db[_0x9662('0x5f')][_0x9662('0x115')](db[_0x9662('0x17f')],{});db[_0x9662('0x5f')][_0x9662('0x115')](db[_0x9662('0x12')],{});db[_0x9662('0x5f')][_0x9662('0x115')](db[_0x9662('0x5c')],{});db['ChatApplication'][_0x9662('0x115')](db[_0x9662('0x12')],{'as':'Agent','foreignKey':_0x9662('0x10a'),'onDelete':_0x9662('0x153')});db[_0x9662('0x61')][_0x9662('0x115')](db[_0x9662('0x68')],{'as':_0x9662('0x186'),'foreignKey':_0x9662('0x187'),'onDelete':_0x9662('0x153')});db[_0x9662('0x61')][_0x9662('0x115')](db[_0x9662('0x5e')],{'as':_0x9662('0x188'),'foreignKey':'ChatWebsiteId','onDelete':_0x9662('0x153')});db[_0x9662('0x61')][_0x9662('0x115')](db[_0x9662('0x165')],{'onDelete':'restrict','foreignKey':'TagId'});db['ChatInteraction'][_0x9662('0x10d')](db['ChatMessage'],{'as':_0x9662('0x149'),'onDelete':_0x9662('0x10c'),'foreignKey':'ChatInteractionId'});db[_0x9662('0x62')][_0x9662('0x115')](db[_0x9662('0x5e')],{'as':_0x9662('0x162'),'foreignKey':_0x9662('0x16b')});db[_0x9662('0x62')][_0x9662('0x115')](db[_0x9662('0x6d')],{'as':_0x9662('0x14f'),'foreignKey':_0x9662('0x163')});db['ChatInteraction'][_0x9662('0x115')](db[_0x9662('0x12')],{'as':_0x9662('0x164'),'foreignKey':_0x9662('0x10a')});db['ChatInteraction'][_0x9662('0x117')](db[_0x9662('0x165')],{'through':_0x9662('0x189'),'as':_0x9662('0x172')});db[_0x9662('0x62')][_0x9662('0x117')](db[_0x9662('0x165')],{'through':_0x9662('0x189'),'as':_0x9662('0x167')});db[_0x9662('0x62')][_0x9662('0x117')](db[_0x9662('0x12')],{'as':'Users','through':'user_has_chat_interactions','foreignKey':_0x9662('0x18a')});db[_0x9662('0x64')][_0x9662('0x115')](db[_0x9662('0x12')],{'onDelete':_0x9662('0x10c'),'as':_0x9662('0x12')});db[_0x9662('0x64')][_0x9662('0x115')](db[_0x9662('0x6d')],{'onDelete':_0x9662('0x10c'),'as':_0x9662('0x14f'),'foreignKey':'ContactId'});db[_0x9662('0x64')][_0x9662('0x115')](db['ChatInteraction'],{'onDelete':_0x9662('0x10c'),'as':'Interaction','foreignKey':_0x9662('0x18a')});db[_0x9662('0x64')][_0x9662('0x115')](db['Attachment'],{'as':_0x9662('0xe3'),'foreignKey':'AttachmentId'});db[_0x9662('0x64')]['belongsTo'](db[_0x9662('0x5e')],{'as':_0x9662('0x162'),'foreignKey':'ChatWebsiteId'});db[_0x9662('0x66')][_0x9662('0x10d')](db[_0x9662('0xe3')],{'as':_0x9662('0x16a'),'foreignKey':_0x9662('0x16c'),'onDelete':_0x9662('0x10c'),'hooks':!![]});db[_0x9662('0x66')]['belongsTo'](db[_0x9662('0x6d')],{'onDelete':_0x9662('0x10c'),'as':_0x9662('0x14f'),'foreignKey':_0x9662('0x163')});db[_0x9662('0x66')]['belongsTo'](db[_0x9662('0x5e')],{'as':_0x9662('0x162'),'foreignKey':_0x9662('0x16b')});db[_0x9662('0x68')][_0x9662('0x117')](db['User'],{'as':_0x9662('0x145'),'through':_0x9662('0x2f'),'hooks':!![]});db[_0x9662('0x68')][_0x9662('0x117')](db[_0x9662('0x11b')],{'through':_0x9662('0x18b'),'as':_0x9662('0x146')});db['ChatGroup'][_0x9662('0x10d')](db[_0x9662('0x18c')],{'as':_0x9662('0x149'),'foreignKey':_0x9662('0x18d'),'onDelete':_0x9662('0x10c')});db[_0x9662('0x18e')][_0x9662('0x117')](db[_0x9662('0x12')],{'as':'Members','through':'chat_group_has_users'});db[_0x9662('0x184')][_0x9662('0x115')](db[_0x9662('0x5e')],{'as':_0x9662('0x188'),'foreignKey':_0x9662('0x16b')});db[_0x9662('0x6b')]['hasMany'](db['CmContact'],{'as':_0x9662('0x119'),'foreignKey':_0x9662('0x18f')});db['CmContact'][_0x9662('0x10d')](db[_0x9662('0x6f')],{'as':_0x9662('0x13a'),'foreignKey':_0x9662('0x163')});db[_0x9662('0x6d')][_0x9662('0x10d')](db[_0x9662('0x72')],{'as':_0x9662('0x13b'),'foreignKey':_0x9662('0x163')});db[_0x9662('0x6d')][_0x9662('0x10d')](db[_0x9662('0x190')],{'as':_0x9662('0x13c'),'foreignKey':'ContactId'});db[_0x9662('0x6d')][_0x9662('0x10d')](db[_0x9662('0x75')],{'as':_0x9662('0x75'),'foreignKey':_0x9662('0x163')});db['CmContact'][_0x9662('0x10d')](db[_0x9662('0xcf')],{'as':_0x9662('0x191'),'foreignKey':_0x9662('0x163')});db[_0x9662('0x6d')][_0x9662('0x10d')](db[_0x9662('0x59')],{'as':_0x9662('0x110'),'foreignKey':_0x9662('0x163'),'onDelete':'restrict'});db[_0x9662('0x6d')][_0x9662('0x10d')](db['ChatInteraction'],{'as':'ChatInteractions','foreignKey':_0x9662('0x163'),'onDelete':_0x9662('0x153')});db['CmContact'][_0x9662('0x10d')](db[_0x9662('0x11d')],{'as':'SmsInteractions','foreignKey':'ContactId','onDelete':_0x9662('0x153')});db[_0x9662('0x6d')][_0x9662('0x10d')](db[_0x9662('0x4a')],{'as':_0x9662('0x113'),'foreignKey':'ContactId','onDelete':_0x9662('0x153')});db[_0x9662('0x6d')][_0x9662('0x10d')](db[_0x9662('0x3d')],{'as':_0x9662('0x114'),'foreignKey':_0x9662('0x163'),'onDelete':_0x9662('0x153')});db['CmContact'][_0x9662('0x115')](db[_0x9662('0x6b')],{'as':_0x9662('0x192'),'foreignKey':_0x9662('0x18f')});db[_0x9662('0x6d')][_0x9662('0x115')](db[_0x9662('0xed')],{'as':_0x9662('0x15c'),'foreignKey':'ListId','onDelete':_0x9662('0x10c')});db[_0x9662('0x6d')]['belongsToMany'](db[_0x9662('0x12')],{'as':_0x9662('0x168'),'through':_0x9662('0x193')});db[_0x9662('0x6d')][_0x9662('0x117')](db['Tag'],{'as':_0x9662('0x172'),'through':_0x9662('0x194')});db[_0x9662('0x6d')]['belongsToMany'](db[_0x9662('0x165')],{'through':'cm_contact_has_tags','as':'ThroughTags'});db['CmHopper'][_0x9662('0x115')](db['CmContact'],{'as':_0x9662('0x14f'),'foreignKey':_0x9662('0x163'),'onDelete':_0x9662('0x10c')});db[_0x9662('0x6f')]['belongsTo'](db['CmList'],{'as':_0x9662('0x15c'),'foreignKey':_0x9662('0x15d'),'onDelete':_0x9662('0x10c')});db[_0x9662('0x6f')]['belongsTo'](db[_0x9662('0x12')],{'as':'Agent','foreignKey':_0x9662('0x10a')});db[_0x9662('0x6f')][_0x9662('0x115')](db[_0x9662('0x1b')],{'as':_0x9662('0x186'),'foreignKey':_0x9662('0x139'),'onDelete':'cascade'});db[_0x9662('0x6f')][_0x9662('0x115')](db[_0x9662('0xdf')],{'as':_0x9662('0xdf'),'foreignKey':_0x9662('0x195'),'onDelete':_0x9662('0x10c')});db[_0x9662('0x6f')]['belongsTo'](db[_0x9662('0x12')],{'as':_0x9662('0x164'),'foreignKey':_0x9662('0x196')});db[_0x9662('0x71')][_0x9662('0x115')](db['CmContact'],{'as':_0x9662('0x14f'),'foreignKey':_0x9662('0x163'),'onDelete':_0x9662('0x10c')});db[_0x9662('0x71')][_0x9662('0x115')](db[_0x9662('0xed')],{'as':_0x9662('0x15c'),'foreignKey':_0x9662('0x15d'),'onDelete':_0x9662('0x10c')});db[_0x9662('0x71')][_0x9662('0x115')](db['VoiceQueue'],{'as':_0x9662('0x186'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0x9662('0x71')][_0x9662('0x115')](db['Campaign'],{'as':_0x9662('0xdf'),'foreignKey':_0x9662('0x195'),'onDelete':_0x9662('0x10c')});db[_0x9662('0x197')]['hasMany'](db['Condition'],{'as':{'plural':_0x9662('0x198'),'singular':_0x9662('0x199')},'foreignKey':'AutomationAllId','onDelete':_0x9662('0x10c'),'hooks':!![]});db[_0x9662('0x197')][_0x9662('0x10d')](db[_0x9662('0x7c')],{'as':{'plural':_0x9662('0x19a'),'singular':'OneAny'},'foreignKey':_0x9662('0x19b'),'onDelete':_0x9662('0x10c'),'hooks':!![]});db[_0x9662('0x197')][_0x9662('0x10d')](db[_0x9662('0x78')],{'as':'Actions','foreignKey':_0x9662('0x19c'),'onDelete':_0x9662('0x10c'),'hooks':!![]});db['Disposition'][_0x9662('0x10d')](db[_0x9662('0x7b')],{'as':_0x9662('0x157'),'foreignKey':_0x9662('0x19d'),'onDelete':'cascade'});db[_0x9662('0x7e')][_0x9662('0x10d')](db[_0x9662('0x7e')],{'as':_0x9662('0x19e'),'foreignKey':'IntervalId','onDelete':_0x9662('0x10c'),'hooks':!![],'required':![]});db[_0x9662('0x7e')][_0x9662('0x10d')](db['VoiceExtension'],{'as':_0x9662('0x19f'),'foreignKey':_0x9662('0x141'),'onDelete':_0x9662('0x153')});db[_0x9662('0x7e')][_0x9662('0x10d')](db[_0x9662('0x41')],{'as':_0x9662('0x1a0'),'foreignKey':_0x9662('0x141')});db[_0x9662('0x7e')]['hasMany'](db[_0x9662('0x61')],{'as':_0x9662('0x1a1'),'foreignKey':_0x9662('0x141')});db[_0x9662('0x7e')]['hasMany'](db[_0x9662('0x16f')],{'as':_0x9662('0x1a2'),'foreignKey':_0x9662('0x141')});db['Interval'][_0x9662('0x10d')](db[_0x9662('0x52')],{'as':_0x9662('0x1a3'),'foreignKey':_0x9662('0x141')});db['Schedule']['belongsTo'](db['MailAccount'],{});db[_0x9662('0x84')][_0x9662('0x115')](db[_0x9662('0x93')],{'foreignKey':_0x9662('0x1a4')});db[_0x9662('0x84')][_0x9662('0x115')](db[_0x9662('0x92')],{'foreignKey':_0x9662('0x1a5')});db[_0x9662('0x86')][_0x9662('0x117')](db[_0x9662('0x19')],{'as':_0x9662('0x1a6'),'through':_0x9662('0x137'),'onDelete':_0x9662('0x153')});db[_0x9662('0x165')]['belongsToMany'](db[_0x9662('0x6d')],{'through':_0x9662('0x194')});db[_0x9662('0x165')][_0x9662('0x117')](db['ChatInteraction'],{'through':_0x9662('0x189')});db[_0x9662('0x165')][_0x9662('0x117')](db[_0x9662('0x3d')],{'through':_0x9662('0x166')});db['Tag']['belongsToMany'](db['SmsInteraction'],{'through':'sms_interaction_has_tags'});db[_0x9662('0x165')][_0x9662('0x117')](db[_0x9662('0x4a')],{'through':_0x9662('0x173')});db[_0x9662('0x165')][_0x9662('0x117')](db[_0x9662('0x59')],{'through':_0x9662('0x182')});db[_0x9662('0x165')][_0x9662('0x117')](db[_0x9662('0xfa')],{'through':_0x9662('0x1a7')});db[_0x9662('0x8b')][_0x9662('0x10d')](db[_0x9662('0x7c')],{'as':{'plural':_0x9662('0x1a8'),'singular':_0x9662('0x1a9')},'foreignKey':'TriggerAllId','onDelete':_0x9662('0x10c'),'hooks':!![]});db[_0x9662('0x8b')]['hasMany'](db[_0x9662('0x7c')],{'as':{'plural':_0x9662('0x1aa'),'singular':'AnyCondition'},'foreignKey':_0x9662('0x1ab'),'onDelete':'cascade','hooks':!![]});db['Trigger'][_0x9662('0x10d')](db[_0x9662('0x78')],{'as':_0x9662('0x1ac'),'foreignKey':'TriggerId','onDelete':_0x9662('0x10c'),'hooks':!![]});db[_0x9662('0x92')][_0x9662('0x10d')](db['AnalyticFieldReport'],{'as':_0x9662('0x1ad'),'onDelete':_0x9662('0x10c'),'foreignKey':_0x9662('0x1a5'),'hooks':!![]});db[_0x9662('0x93')][_0x9662('0x10d')](db[_0x9662('0x98')],{'as':'Fields','onDelete':'cascade','foreignKey':_0x9662('0x1a4')});db[_0x9662('0x96')][_0x9662('0x10d')](db['AnalyticFieldReport'],{'as':_0x9662('0x1ad'),'onDelete':_0x9662('0x10c'),'foreignKey':'MetricId'});db[_0x9662('0x98')][_0x9662('0x115')](db[_0x9662('0x96')],{'foreignKey':_0x9662('0x1ae')});db['SalesforceAccount']['hasMany'](db[_0x9662('0x1af')],{'as':'Configurations','onDelete':_0x9662('0x10c'),'foreignKey':'AccountId'});db['SalesforceConfiguration'][_0x9662('0x10d')](db[_0x9662('0x1b0')],{'as':_0x9662('0x1b1'),'onDelete':_0x9662('0x10c'),'foreignKey':'SubjectId'});db[_0x9662('0x1af')][_0x9662('0x10d')](db[_0x9662('0x1b0')],{'as':'Descriptions','onDelete':_0x9662('0x10c'),'foreignKey':_0x9662('0x1b2')});db[_0x9662('0x1af')]['hasMany'](db[_0x9662('0x1b0')],{'as':'Fields','onDelete':_0x9662('0x10c'),'foreignKey':'FieldId'});db[_0x9662('0x1af')][_0x9662('0x115')](db[_0x9662('0x9b')],{'as':_0x9662('0x162'),'foreignKey':'AccountId'});db[_0x9662('0x1b0')][_0x9662('0x10d')](db[_0x9662('0x1b0')],{'as':_0x9662('0x1b3'),'foreignKey':_0x9662('0x1b4')});db[_0x9662('0x1b0')][_0x9662('0x10d')](db[_0x9662('0x1b0')],{'as':_0x9662('0x1b5'),'foreignKey':'DescriptionId'});db[_0x9662('0x1b0')]['hasMany'](db[_0x9662('0x1b0')],{'as':_0x9662('0x1b6'),'foreignKey':_0x9662('0x1b7')});db[_0x9662('0x1b0')][_0x9662('0x115')](db[_0x9662('0x8d')],{'as':'Variable','foreignKey':_0x9662('0x1b8')});db[_0x9662('0x9f')]['hasMany'](db[_0x9662('0xa1')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x9662('0x1b9')});db[_0x9662('0xa1')]['hasMany'](db[_0x9662('0xa3')],{'as':_0x9662('0x1b1'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x9662('0xa1')]['hasMany'](db[_0x9662('0xa3')],{'as':_0x9662('0x1ba'),'onDelete':_0x9662('0x10c'),'foreignKey':'DescriptionId'});db[_0x9662('0xa1')][_0x9662('0x10d')](db[_0x9662('0xa3')],{'as':'Fields','onDelete':_0x9662('0x10c'),'foreignKey':_0x9662('0x1b7')});db[_0x9662('0xa1')]['belongsTo'](db['SugarcrmAccount'],{'as':_0x9662('0x162'),'foreignKey':_0x9662('0x1b9')});db[_0x9662('0xa3')][_0x9662('0x10d')](db[_0x9662('0xa3')],{'as':_0x9662('0x1b3'),'foreignKey':_0x9662('0x1b4')});db['SugarcrmField'][_0x9662('0x10d')](db[_0x9662('0xa3')],{'as':_0x9662('0x1b5'),'foreignKey':'DescriptionId'});db[_0x9662('0xa3')][_0x9662('0x10d')](db['SugarcrmField'],{'as':_0x9662('0x1b6'),'foreignKey':_0x9662('0x1b7')});db[_0x9662('0xa3')][_0x9662('0x115')](db[_0x9662('0x8d')],{'as':_0x9662('0x8d'),'foreignKey':_0x9662('0x1b8')});db['DeskAccount'][_0x9662('0x10d')](db[_0x9662('0xa6')],{'as':_0x9662('0x1bb'),'onDelete':_0x9662('0x10c'),'foreignKey':_0x9662('0x1b9')});db[_0x9662('0xa6')][_0x9662('0x10d')](db[_0x9662('0xa8')],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0x9662('0xa6')][_0x9662('0x10d')](db[_0x9662('0xa8')],{'as':_0x9662('0x1ba'),'onDelete':_0x9662('0x10c'),'foreignKey':_0x9662('0x1b2')});db[_0x9662('0xa6')][_0x9662('0x10d')](db['DeskField'],{'as':'Fields','onDelete':_0x9662('0x10c'),'foreignKey':_0x9662('0x1b7')});db['DeskConfiguration'][_0x9662('0x115')](db['DeskAccount'],{'as':_0x9662('0x162'),'foreignKey':'AccountId'});db['DeskConfiguration'][_0x9662('0x117')](db[_0x9662('0x165')],{'through':_0x9662('0x1bc')});db['DeskField'][_0x9662('0x10d')](db[_0x9662('0xa8')],{'as':_0x9662('0x1b3'),'foreignKey':_0x9662('0x1b4')});db['DeskField'][_0x9662('0x10d')](db[_0x9662('0xa8')],{'as':_0x9662('0x1b5'),'foreignKey':'DescriptionId'});db['DeskField'][_0x9662('0x10d')](db[_0x9662('0xa8')],{'as':_0x9662('0x1b6'),'foreignKey':_0x9662('0x1b7')});db[_0x9662('0xa8')][_0x9662('0x115')](db[_0x9662('0x8d')],{'as':_0x9662('0x8d'),'foreignKey':'VariableId'});db[_0x9662('0xaa')]['hasMany'](db[_0x9662('0xac')],{'as':_0x9662('0x1bb'),'onDelete':_0x9662('0x10c'),'foreignKey':_0x9662('0x1b9')});db[_0x9662('0xac')][_0x9662('0x10d')](db[_0x9662('0x1bd')],{'as':_0x9662('0x1b1'),'onDelete':'cascade','foreignKey':_0x9662('0x1b4')});db[_0x9662('0xac')]['hasMany'](db[_0x9662('0x1bd')],{'as':_0x9662('0x1ba'),'onDelete':_0x9662('0x10c'),'foreignKey':_0x9662('0x1b2')});db[_0x9662('0xac')]['hasMany'](db[_0x9662('0x1bd')],{'as':_0x9662('0x1ad'),'onDelete':_0x9662('0x10c'),'foreignKey':_0x9662('0x1b7')});db['ZohoConfiguration']['belongsTo'](db['ZohoAccount'],{'as':_0x9662('0x162'),'foreignKey':_0x9662('0x1b9')});db[_0x9662('0x1bd')][_0x9662('0x10d')](db[_0x9662('0x1bd')],{'as':_0x9662('0x1b3'),'foreignKey':_0x9662('0x1b4')});db[_0x9662('0x1bd')][_0x9662('0x10d')](db['ZohoField'],{'as':_0x9662('0x1b5'),'foreignKey':'DescriptionId'});db['ZohoField']['hasMany'](db[_0x9662('0x1bd')],{'as':'Field','foreignKey':'FieldId'});db[_0x9662('0x1bd')]['belongsTo'](db[_0x9662('0x8d')],{'as':_0x9662('0x8d'),'foreignKey':_0x9662('0x1b8')});db[_0x9662('0xae')]['hasMany'](db[_0x9662('0xb0')],{'as':_0x9662('0x1bb'),'onDelete':_0x9662('0x10c'),'foreignKey':_0x9662('0x1b9')});db[_0x9662('0xb0')]['hasMany'](db['ZendeskField'],{'as':'Subjects','foreignKey':'SubjectId'});db['ZendeskConfiguration'][_0x9662('0x10d')](db[_0x9662('0xb1')],{'as':_0x9662('0x1ba'),'foreignKey':_0x9662('0x1b2')});db['ZendeskConfiguration'][_0x9662('0x10d')](db['ZendeskField'],{'as':_0x9662('0x1ad'),'foreignKey':_0x9662('0x1b7')});db[_0x9662('0xb0')]['belongsTo'](db[_0x9662('0xae')],{'as':'Account','foreignKey':_0x9662('0x1b9')});db['ZendeskConfiguration']['belongsToMany'](db['Tag'],{'through':_0x9662('0x1be')});db[_0x9662('0xb1')][_0x9662('0x10d')](db[_0x9662('0xb1')],{'as':_0x9662('0x1b3'),'foreignKey':_0x9662('0x1b4')});db[_0x9662('0xb1')][_0x9662('0x10d')](db['ZendeskField'],{'as':_0x9662('0x1b5'),'foreignKey':'DescriptionId'});db['ZendeskField'][_0x9662('0x10d')](db[_0x9662('0xb1')],{'as':_0x9662('0x1b6'),'foreignKey':'FieldId'});db[_0x9662('0xb1')][_0x9662('0x115')](db[_0x9662('0x8d')],{'as':_0x9662('0x8d'),'foreignKey':'VariableId'});db[_0x9662('0xb2')][_0x9662('0x10d')](db[_0x9662('0xb4')],{'as':_0x9662('0x1bb'),'onDelete':'cascade','foreignKey':_0x9662('0x1b9')});db[_0x9662('0xb4')][_0x9662('0x10d')](db[_0x9662('0x1bf')],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0x9662('0xb4')][_0x9662('0x10d')](db[_0x9662('0x1bf')],{'as':_0x9662('0x1ba'),'onDelete':_0x9662('0x10c'),'foreignKey':_0x9662('0x1b2')});db[_0x9662('0xb4')][_0x9662('0x10d')](db[_0x9662('0x1bf')],{'as':_0x9662('0x1ad'),'onDelete':_0x9662('0x10c'),'foreignKey':_0x9662('0x1b7')});db[_0x9662('0xb4')][_0x9662('0x115')](db[_0x9662('0xb2')],{'as':_0x9662('0x162'),'foreignKey':_0x9662('0x1b9')});db[_0x9662('0xb4')][_0x9662('0x117')](db[_0x9662('0x165')],{'through':_0x9662('0x1c0')});db[_0x9662('0x1bf')]['hasMany'](db[_0x9662('0x1bf')],{'as':_0x9662('0x1b3'),'foreignKey':_0x9662('0x1b4')});db[_0x9662('0x1bf')][_0x9662('0x10d')](db[_0x9662('0x1bf')],{'as':_0x9662('0x1b5'),'foreignKey':_0x9662('0x1b2')});db['FreshdeskField'][_0x9662('0x10d')](db['FreshdeskField'],{'as':_0x9662('0x1b6'),'foreignKey':'FieldId'});db[_0x9662('0x1bf')][_0x9662('0x115')](db[_0x9662('0x8d')],{'as':_0x9662('0x8d'),'foreignKey':_0x9662('0x1b8')});db[_0x9662('0xb7')][_0x9662('0x10d')](db[_0x9662('0xb9')],{'as':'Configurations','onDelete':_0x9662('0x10c'),'foreignKey':'AccountId'});db[_0x9662('0xb9')][_0x9662('0x10d')](db[_0x9662('0xbb')],{'as':_0x9662('0x1b1'),'foreignKey':'SubjectId'});db[_0x9662('0xb9')][_0x9662('0x10d')](db['VtigerField'],{'as':_0x9662('0x1ba'),'foreignKey':_0x9662('0x1b2')});db[_0x9662('0xb9')][_0x9662('0x10d')](db['VtigerField'],{'as':_0x9662('0x1ad'),'foreignKey':_0x9662('0x1b7')});db[_0x9662('0xb9')][_0x9662('0x115')](db[_0x9662('0xb7')],{'as':_0x9662('0x162'),'foreignKey':'AccountId'});db[_0x9662('0xbb')]['hasMany'](db[_0x9662('0xbb')],{'as':_0x9662('0x1b3'),'foreignKey':_0x9662('0x1b4')});db['VtigerField']['hasMany'](db[_0x9662('0xbb')],{'as':_0x9662('0x1b5'),'foreignKey':'DescriptionId'});db['VtigerField'][_0x9662('0x10d')](db['VtigerField'],{'as':_0x9662('0x1b6'),'foreignKey':_0x9662('0x1b7')});db[_0x9662('0xbb')][_0x9662('0x115')](db['Variable'],{'as':_0x9662('0x8d'),'foreignKey':_0x9662('0x1b8')});db[_0x9662('0x1c1')][_0x9662('0x10d')](db['ServicenowConfiguration'],{'as':_0x9662('0x1bb'),'onDelete':_0x9662('0x10c'),'foreignKey':_0x9662('0x1b9')});db['ServicenowConfiguration'][_0x9662('0x10d')](db[_0x9662('0xbf')],{'as':_0x9662('0x1b1'),'foreignKey':'SubjectId'});db[_0x9662('0x1c2')][_0x9662('0x10d')](db[_0x9662('0xbf')],{'as':'Descriptions','foreignKey':_0x9662('0x1b2')});db[_0x9662('0x1c2')]['hasMany'](db[_0x9662('0xbf')],{'as':'Fields','foreignKey':_0x9662('0x1b7')});db[_0x9662('0x1c2')][_0x9662('0x115')](db[_0x9662('0x1c1')],{'as':_0x9662('0x162'),'foreignKey':_0x9662('0x1b9')});db['ServicenowField'][_0x9662('0x10d')](db[_0x9662('0xbf')],{'as':'Subject','foreignKey':_0x9662('0x1b4')});db[_0x9662('0xbf')][_0x9662('0x10d')](db[_0x9662('0xbf')],{'as':_0x9662('0x1b5'),'foreignKey':_0x9662('0x1b2')});db[_0x9662('0xbf')][_0x9662('0x10d')](db[_0x9662('0xbf')],{'as':'Field','foreignKey':'FieldId'});db['ServicenowField'][_0x9662('0x115')](db['Variable'],{'as':_0x9662('0x8d'),'foreignKey':_0x9662('0x1b8')});db[_0x9662('0xc1')]['hasMany'](db['Dynamics365Configuration'],{'as':'Configurations','onDelete':_0x9662('0x10c'),'foreignKey':_0x9662('0x1b9')});db[_0x9662('0xc3')][_0x9662('0x10d')](db['Dynamics365Field'],{'as':_0x9662('0x1b1'),'onDelete':_0x9662('0x10c'),'foreignKey':_0x9662('0x1b4')});db[_0x9662('0xc3')][_0x9662('0x10d')](db['Dynamics365Field'],{'as':_0x9662('0x1ba'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x9662('0xc3')]['hasMany'](db[_0x9662('0x1c3')],{'as':_0x9662('0x1ad'),'onDelete':_0x9662('0x10c'),'foreignKey':_0x9662('0x1b7')});db[_0x9662('0xc3')][_0x9662('0x115')](db[_0x9662('0xc1')],{'as':'Account','foreignKey':_0x9662('0x1b9')});db[_0x9662('0x1c3')][_0x9662('0x10d')](db['Dynamics365Field'],{'as':_0x9662('0x1b3'),'foreignKey':_0x9662('0x1b4')});db[_0x9662('0x1c3')][_0x9662('0x10d')](db['Dynamics365Field'],{'as':'Description','foreignKey':'DescriptionId'});db['Dynamics365Field']['hasMany'](db[_0x9662('0x1c3')],{'as':_0x9662('0x1b6'),'foreignKey':_0x9662('0x1b7')});db['Dynamics365Field'][_0x9662('0x115')](db[_0x9662('0x8d')],{'as':'Variable','foreignKey':_0x9662('0x1b8')});db[_0x9662('0x1c4')]['hasMany'](db[_0x9662('0xc6')],{'as':'Configurations','onDelete':_0x9662('0x10c'),'foreignKey':_0x9662('0x1b9')});db[_0x9662('0xc6')][_0x9662('0x10d')](db[_0x9662('0xc7')],{'as':_0x9662('0x1b1'),'foreignKey':_0x9662('0x1b4')});db[_0x9662('0xc6')][_0x9662('0x10d')](db['FreshsalesField'],{'as':_0x9662('0x1ba'),'foreignKey':'DescriptionId'});db[_0x9662('0xc6')][_0x9662('0x10d')](db[_0x9662('0xc7')],{'as':_0x9662('0x1ad'),'foreignKey':_0x9662('0x1b7')});db[_0x9662('0xc6')][_0x9662('0x115')](db['FreshsalesAccount'],{'as':'Account','foreignKey':_0x9662('0x1b9')});db[_0x9662('0xc7')]['hasMany'](db[_0x9662('0xc7')],{'as':_0x9662('0x1b3'),'foreignKey':_0x9662('0x1b4')});db[_0x9662('0xc7')][_0x9662('0x10d')](db['FreshsalesField'],{'as':'Description','foreignKey':_0x9662('0x1b2')});db['FreshsalesField'][_0x9662('0x10d')](db[_0x9662('0xc7')],{'as':'Field','foreignKey':_0x9662('0x1b7')});db[_0x9662('0xc7')][_0x9662('0x115')](db['Variable'],{'as':_0x9662('0x8d'),'foreignKey':_0x9662('0x1b8')});db[_0x9662('0xcb')][_0x9662('0x115')](db[_0x9662('0x5e')],{});db['ChatQueueReport'][_0x9662('0x115')](db[_0x9662('0xed')],{'as':'List','foreignKey':_0x9662('0x15d')});db['ChatQueueReport'][_0x9662('0x115')](db[_0x9662('0x6d')],{'as':_0x9662('0x14f'),'foreignKey':'ContactId'});db[_0x9662('0xcb')][_0x9662('0x115')](db[_0x9662('0x62')],{});db[_0x9662('0xcb')][_0x9662('0x115')](db['ChatMessage'],{});db[_0x9662('0xcb')][_0x9662('0x115')](db[_0x9662('0x12')],{});db['ChatQueueReport'][_0x9662('0x115')](db['ChatQueue'],{});db[_0x9662('0x18c')][_0x9662('0x115')](db[_0x9662('0x12')],{'onDelete':_0x9662('0x10c'),'foreignKey':'FromId'});db[_0x9662('0x18c')][_0x9662('0x115')](db[_0x9662('0x12')],{'onDelete':_0x9662('0x10c'),'foreignKey':_0x9662('0x1c5')});db['JscriptySessionReport'][_0x9662('0x10d')](db[_0x9662('0x1c6')],{'foreignKey':_0x9662('0x1c7'),'onDelete':_0x9662('0x10c')});db[_0x9662('0xcf')][_0x9662('0x10d')](db[_0x9662('0xcc')],{'foreignKey':_0x9662('0x1c7'),'onDelete':_0x9662('0x10c')});db[_0x9662('0xd0')][_0x9662('0x115')](db[_0x9662('0x12e')],{});db[_0x9662('0xd0')][_0x9662('0x115')](db[_0x9662('0xed')],{'as':_0x9662('0x15c'),'foreignKey':'ListId'});db['SmsQueueReport']['belongsTo'](db[_0x9662('0x6d')],{'as':'Contact','foreignKey':_0x9662('0x163')});db[_0x9662('0xd0')][_0x9662('0x115')](db[_0x9662('0x11d')],{});db[_0x9662('0xd0')][_0x9662('0x115')](db[_0x9662('0x178')],{});db[_0x9662('0xd0')][_0x9662('0x115')](db['User'],{});db['SmsQueueReport'][_0x9662('0x115')](db[_0x9662('0x56')],{});db[_0x9662('0x1c8')][_0x9662('0x10d')](db[_0x9662('0xcf')],{'foreignKey':_0x9662('0x1c9')});db[_0x9662('0x1c8')][_0x9662('0x10d')](db[_0x9662('0x1c6')],{'foreignKey':_0x9662('0x1c9')});db['JscriptyProject'][_0x9662('0x10d')](db[_0x9662('0xcc')],{'foreignKey':_0x9662('0x1c9')});db['SquareProject'][_0x9662('0x117')](db[_0x9662('0x12')],{'as':_0x9662('0x168'),'through':_0x9662('0x134')});db[_0x9662('0x11b')][_0x9662('0x117')](db['User'],{'as':_0x9662('0x145'),'through':'user_has_teams'});db[_0x9662('0x11b')]['belongsToMany'](db[_0x9662('0x1b')],{'through':_0x9662('0x102'),'as':_0x9662('0x1ca')});db[_0x9662('0x11b')][_0x9662('0x117')](db[_0x9662('0x3b')],{'through':'team_has_mail_queues','as':_0x9662('0x122')});db[_0x9662('0x11b')][_0x9662('0x117')](db[_0x9662('0x68')],{'through':_0x9662('0x18b'),'as':_0x9662('0x124')});db[_0x9662('0x11b')]['belongsToMany'](db[_0x9662('0x4e')],{'through':_0x9662('0x1cb'),'as':_0x9662('0x125')});db['Team']['belongsToMany'](db[_0x9662('0x56')],{'through':_0x9662('0x17d'),'as':_0x9662('0x126')});db[_0x9662('0x11b')][_0x9662('0x117')](db[_0x9662('0x5c')],{'through':'team_has_openchannel_queues','as':_0x9662('0x128')});db[_0x9662('0x11b')][_0x9662('0x117')](db[_0x9662('0xff')],{'through':_0x9662('0x1cc'),'as':_0x9662('0x1cd')});db[_0x9662('0x11b')][_0x9662('0x117')](db[_0x9662('0x120')],{'through':_0x9662('0x1ce'),'as':_0x9662('0x121')});db[_0x9662('0xdf')][_0x9662('0x10d')](db[_0x9662('0x6f')],{'as':_0x9662('0x13a'),'foreignKey':'CampaignId'});db[_0x9662('0xdf')][_0x9662('0x10d')](db[_0x9662('0x72')],{'as':_0x9662('0x13b'),'foreignKey':_0x9662('0x195')});db[_0x9662('0xdf')]['hasMany'](db[_0x9662('0x190')],{'as':'HopperHistories','foreignKey':'CampaignId'});db[_0x9662('0xdf')]['hasMany'](db['CmHopperBlack'],{'as':_0x9662('0x13d'),'foreignKey':_0x9662('0x195')});db[_0x9662('0xdf')][_0x9662('0x115')](db[_0x9662('0x2a')],{'as':_0x9662('0x2a'),'foreignKey':'TrunkId'});db[_0x9662('0xdf')][_0x9662('0x115')](db[_0x9662('0x2a')],{'as':_0x9662('0x13f'),'foreignKey':_0x9662('0x140')});db['Campaign'][_0x9662('0x115')](db[_0x9662('0x7e')],{'as':'Interval','foreignKey':_0x9662('0x141')});db[_0x9662('0xdf')]['belongsTo'](db[_0x9662('0xd9')],{'as':_0x9662('0xd9'),'foreignKey':_0x9662('0x1cf')});db[_0x9662('0xdf')][_0x9662('0x117')](db[_0x9662('0xed')],{'as':_0x9662('0x11a'),'through':_0x9662('0x1d0')});db[_0x9662('0xdf')][_0x9662('0x117')](db[_0x9662('0xed')],{'as':'BlackLists','through':_0x9662('0x1d1')});db['Attachment']['belongsTo'](db[_0x9662('0x66')],{'as':_0x9662('0x66'),'foreignKey':'ChatOfflineMessageId'});db[_0x9662('0x1d2')][_0x9662('0x115')](db[_0x9662('0x3f')],{});db[_0x9662('0x1d2')][_0x9662('0x115')](db[_0x9662('0x3d')],{});db['MailTransferReport'][_0x9662('0x115')](db['MailAccount'],{'foreignKey':_0x9662('0x1d3'),'as':_0x9662('0x1d4')});db[_0x9662('0x1d2')][_0x9662('0x115')](db[_0x9662('0x12')],{'foreignKey':_0x9662('0x1d5'),'as':_0x9662('0x1d6')});db[_0x9662('0x1d2')][_0x9662('0x115')](db[_0x9662('0x12')],{'foreignKey':_0x9662('0x1d7'),'as':_0x9662('0x1d8')});db[_0x9662('0x1d2')][_0x9662('0x115')](db[_0x9662('0x3b')],{'foreignKey':_0x9662('0x1d9'),'as':_0x9662('0x1da')});db['MailTransferReport'][_0x9662('0x115')](db[_0x9662('0x3a')],{'foreignKey':_0x9662('0x1db'),'as':_0x9662('0x1dc')});db[_0x9662('0x1dd')][_0x9662('0x115')](db[_0x9662('0x64')],{});db[_0x9662('0x1dd')][_0x9662('0x115')](db['ChatInteraction'],{});db[_0x9662('0x1dd')][_0x9662('0x115')](db['ChatWebsite'],{'foreignKey':_0x9662('0x1de'),'as':'FromAccount'});db[_0x9662('0x1dd')]['belongsTo'](db[_0x9662('0x12')],{'foreignKey':_0x9662('0x1d5'),'as':_0x9662('0x1d6')});db['ChatTransferReport'][_0x9662('0x115')](db[_0x9662('0x12')],{'foreignKey':_0x9662('0x1d7'),'as':_0x9662('0x1d8')});db[_0x9662('0x1dd')][_0x9662('0x115')](db[_0x9662('0x68')],{'foreignKey':_0x9662('0x1df'),'as':_0x9662('0x1da')});db[_0x9662('0x1dd')]['belongsTo'](db[_0x9662('0x5e')],{'foreignKey':_0x9662('0x1e0'),'as':_0x9662('0x1dc')});db['FaxTransferReport'][_0x9662('0x115')](db[_0x9662('0x4c')],{});db[_0x9662('0xe7')]['belongsTo'](db[_0x9662('0x4a')],{});db[_0x9662('0xe7')][_0x9662('0x115')](db[_0x9662('0x47')],{'foreignKey':_0x9662('0x1e1'),'as':_0x9662('0x1d4')});db[_0x9662('0xe7')][_0x9662('0x115')](db[_0x9662('0x12')],{'foreignKey':_0x9662('0x1d5'),'as':'FromAgent'});db[_0x9662('0xe7')][_0x9662('0x115')](db[_0x9662('0x12')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x9662('0xe7')]['belongsTo'](db[_0x9662('0x4e')],{'foreignKey':_0x9662('0x1e2'),'as':_0x9662('0x1da')});db[_0x9662('0xe7')][_0x9662('0x115')](db[_0x9662('0x47')],{'foreignKey':_0x9662('0x1e3'),'as':'ToAccount'});db[_0x9662('0xe9')][_0x9662('0x115')](db[_0x9662('0x17f')],{});db[_0x9662('0xe9')][_0x9662('0x115')](db[_0x9662('0x59')],{});db[_0x9662('0xe9')][_0x9662('0x115')](db[_0x9662('0x57')],{'foreignKey':'FromOpenchannelAccountId','as':_0x9662('0x1d4')});db[_0x9662('0xe9')]['belongsTo'](db[_0x9662('0x12')],{'foreignKey':_0x9662('0x1d5'),'as':_0x9662('0x1d6')});db[_0x9662('0xe9')][_0x9662('0x115')](db[_0x9662('0x12')],{'foreignKey':_0x9662('0x1d7'),'as':_0x9662('0x1d8')});db['OpenchannelTransferReport'][_0x9662('0x115')](db[_0x9662('0x5c')],{'foreignKey':'ToOpenchannelQueueId','as':'ToQueue'});db[_0x9662('0xe9')]['belongsTo'](db['OpenchannelAccount'],{'foreignKey':_0x9662('0x1e4'),'as':_0x9662('0x1dc')});db[_0x9662('0xeb')][_0x9662('0x115')](db['SmsMessage'],{});db[_0x9662('0xeb')][_0x9662('0x115')](db[_0x9662('0x11d')],{});db[_0x9662('0xeb')][_0x9662('0x115')](db[_0x9662('0x12e')],{'foreignKey':'FromSmsAccountId','as':_0x9662('0x1d4')});db[_0x9662('0xeb')]['belongsTo'](db[_0x9662('0x12')],{'foreignKey':_0x9662('0x1d5'),'as':_0x9662('0x1d6')});db[_0x9662('0xeb')][_0x9662('0x115')](db['User'],{'foreignKey':_0x9662('0x1d7'),'as':_0x9662('0x1d8')});db[_0x9662('0xeb')][_0x9662('0x115')](db[_0x9662('0x56')],{'foreignKey':_0x9662('0x1e5'),'as':_0x9662('0x1da')});db[_0x9662('0xeb')][_0x9662('0x115')](db['SmsAccount'],{'foreignKey':_0x9662('0x1e6'),'as':_0x9662('0x1dc')});db[_0x9662('0xed')][_0x9662('0x10d')](db[_0x9662('0x7b')],{'as':'Dispositions','foreignKey':_0x9662('0x15d'),'onDelete':_0x9662('0x10c')});db[_0x9662('0xed')][_0x9662('0x10d')](db['CmCustomField'],{'as':_0x9662('0x1e7'),'foreignKey':_0x9662('0x15d')});db['CmList'][_0x9662('0x10d')](db['CmContact'],{'as':_0x9662('0x119'),'onDelete':_0x9662('0x10c'),'foreignKey':_0x9662('0x15d')});db['CmList'][_0x9662('0x10d')](db[_0x9662('0x72')],{'as':'HopperFinals','foreignKey':'ListId'});db[_0x9662('0xed')][_0x9662('0x10d')](db[_0x9662('0x190')],{'as':'HopperHistory','foreignKey':_0x9662('0x15d')});db[_0x9662('0xed')]['hasMany'](db[_0x9662('0x75')],{'as':_0x9662('0x75'),'foreignKey':_0x9662('0x15d')});db[_0x9662('0xed')][_0x9662('0x117')](db[_0x9662('0x1b')],{'as':_0x9662('0x1e8'),'through':'voice_queues_has_cm_lists'});db['CmList'][_0x9662('0x117')](db[_0x9662('0x12')],{'as':'Agents','through':'cm_user_has_lists'});db[_0x9662('0x120')]['hasMany'](db[_0x9662('0x17')],{'as':_0x9662('0x19f'),'onDelete':_0x9662('0x10c')});db['VoicePrefix'][_0x9662('0x117')](db[_0x9662('0x12')],{'as':_0x9662('0x145'),'through':_0x9662('0x105')});db[_0x9662('0x120')]['belongsToMany'](db['Team'],{'through':_0x9662('0x1ce'),'as':_0x9662('0x146')});db[_0x9662('0xf0')][_0x9662('0x10d')](db['User'],{'as':_0x9662('0x168'),'foreignKey':_0x9662('0x116')});db[_0x9662('0xf0')][_0x9662('0x10d')](db[_0x9662('0x1e9')],{'as':_0x9662('0x1ea'),'foreignKey':'userProfileId','onDelete':'cascade'});db[_0x9662('0x1e9')][_0x9662('0x10d')](db['UserProfileResource'],{'as':_0x9662('0x1eb'),'foreignKey':_0x9662('0x1ec'),'onDelete':_0x9662('0x10c')});db[_0x9662('0xf7')][_0x9662('0x10d')](db[_0x9662('0x7b')],{'as':_0x9662('0x157'),'foreignKey':_0x9662('0x1ed'),'onDelete':_0x9662('0x10c')});db[_0x9662('0xf7')][_0x9662('0x10d')](db[_0x9662('0x158')],{'as':_0x9662('0x159'),'foreignKey':'WhatsappAccountId'});db[_0x9662('0xf7')][_0x9662('0x10d')](db['WhatsappMessage'],{'as':_0x9662('0x149'),'foreignKey':'WhatsappAccountId'});db[_0x9662('0xf7')][_0x9662('0x10d')](db[_0x9662('0xfa')],{'as':_0x9662('0x15a')});db[_0x9662('0xf7')][_0x9662('0x10d')](db[_0x9662('0x1ee')],{'as':_0x9662('0x15b')});db[_0x9662('0xf7')][_0x9662('0x115')](db['CmList'],{'as':'List','foreignKey':_0x9662('0x15d')});db[_0x9662('0xf7')][_0x9662('0x115')](db[_0x9662('0x7f')],{'as':_0x9662('0x142'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x9662('0xf7')][_0x9662('0x117')](db[_0x9662('0x12')],{'as':_0x9662('0x145'),'through':_0x9662('0x132')});db['WhatsappApplication'][_0x9662('0x115')](db[_0x9662('0x12')],{'onDelete':_0x9662('0x153')});db['WhatsappApplication'][_0x9662('0x115')](db[_0x9662('0xff')],{'onDelete':_0x9662('0x153')});db[_0x9662('0x1ee')]['belongsTo'](db['WhatsappAccount'],{'onDelete':_0x9662('0x153')});db[_0x9662('0x1ee')][_0x9662('0x115')](db[_0x9662('0x7e')],{'onDelete':_0x9662('0x153'),'foreignKey':'IntervalId'});db[_0x9662('0x1ee')][_0x9662('0x115')](db[_0x9662('0x165')],{'onDelete':'restrict','foreignKey':_0x9662('0x170')});db['WhatsappInteraction'][_0x9662('0x10d')](db['WhatsappMessage'],{'as':_0x9662('0x149'),'onDelete':'cascade','foreignKey':_0x9662('0x1ef')});db[_0x9662('0xfa')]['belongsTo'](db[_0x9662('0xf7')],{'as':_0x9662('0x162'),'foreignKey':'WhatsappAccountId'});db[_0x9662('0xfa')][_0x9662('0x115')](db[_0x9662('0x6d')],{'as':'Contact','foreignKey':_0x9662('0x163')});db['WhatsappInteraction'][_0x9662('0x115')](db[_0x9662('0x12')],{'as':_0x9662('0x164'),'foreignKey':_0x9662('0x10a')});db[_0x9662('0xfa')]['belongsToMany'](db[_0x9662('0x165')],{'through':_0x9662('0x1a7'),'as':_0x9662('0x172')});db['WhatsappInteraction'][_0x9662('0x117')](db[_0x9662('0x165')],{'through':_0x9662('0x1a7'),'as':_0x9662('0x167')});db['WhatsappInteraction'][_0x9662('0x117')](db[_0x9662('0x12')],{'as':_0x9662('0x168'),'through':_0x9662('0x11f'),'foreignKey':_0x9662('0x1ef')});db['WhatsappMessage'][_0x9662('0x115')](db[_0x9662('0x12')],{'as':'User'});db[_0x9662('0x1f0')][_0x9662('0x115')](db[_0x9662('0x6d')],{'onDelete':_0x9662('0x10c'),'as':'Contact'});db[_0x9662('0x1f0')][_0x9662('0x115')](db['WhatsappInteraction'],{'onDelete':_0x9662('0x10c'),'as':_0x9662('0x175'),'foreignKey':_0x9662('0x1ef')});db[_0x9662('0x1f0')][_0x9662('0x115')](db['WhatsappAccount'],{'as':_0x9662('0x162'),'foreignKey':'WhatsappAccountId'});db['WhatsappQueueReport'][_0x9662('0x115')](db['WhatsappAccount'],{});db[_0x9662('0xfc')]['belongsTo'](db['CmList'],{'as':_0x9662('0x15c'),'foreignKey':_0x9662('0x15d')});db[_0x9662('0xfc')][_0x9662('0x115')](db[_0x9662('0x6d')],{'as':_0x9662('0x14f'),'foreignKey':_0x9662('0x163')});db[_0x9662('0xfc')][_0x9662('0x115')](db[_0x9662('0xfa')],{});db[_0x9662('0xfc')]['belongsTo'](db[_0x9662('0xff')],{});db[_0x9662('0xfc')]['belongsTo'](db[_0x9662('0x1f0')],{});db[_0x9662('0xfc')][_0x9662('0x115')](db[_0x9662('0x12')],{});db[_0x9662('0xfd')][_0x9662('0x115')](db[_0x9662('0x1f0')],{});db[_0x9662('0xfd')][_0x9662('0x115')](db['WhatsappInteraction'],{});db[_0x9662('0xfd')][_0x9662('0x115')](db['WhatsappAccount'],{'foreignKey':_0x9662('0x1f1'),'as':'FromAccount'});db['WhatsappTransferReport'][_0x9662('0x115')](db['WhatsappAccount'],{'foreignKey':_0x9662('0x1f2'),'as':'ToAccount'});db['WhatsappTransferReport'][_0x9662('0x115')](db[_0x9662('0xff')],{'foreignKey':'ToQueueId','as':_0x9662('0x1da')});db[_0x9662('0xfd')]['belongsTo'](db[_0x9662('0x12')],{'foreignKey':_0x9662('0x1d5'),'as':_0x9662('0x1d6')});db[_0x9662('0xfd')][_0x9662('0x115')](db[_0x9662('0x12')],{'foreignKey':_0x9662('0x1d7'),'as':'ToAgent'});db['WhatsappQueue'][_0x9662('0x117')](db[_0x9662('0x12')],{'as':_0x9662('0x145'),'through':'UserWhatsappQueue','foreignKey':_0x9662('0x1f3')});db['WhatsappQueue']['belongsToMany'](db[_0x9662('0x11b')],{'through':_0x9662('0x1cc'),'as':'Teams'});db[_0x9662('0x107')][_0x9662('0x115')](db[_0x9662('0x12')],{'as':_0x9662('0x1f4'),'foreignKey':_0x9662('0x10a'),'onDelete':_0x9662('0x10c'),'hooks':!![]});db[_0x9662('0x151')][_0x9662('0x109')](db[_0x9662('0x37')],{'as':_0x9662('0x155'),'onDelete':'restrict'});db[_0x9662('0x151')][_0x9662('0x109')](db[_0x9662('0x154')],{'as':_0x9662('0x156'),'onDelete':_0x9662('0x153')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 2e305ce..a35fa5d 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbd50=['./api/intFreshdeskConfiguration','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','./api/intVtigerConfiguration','./api/intVtigerField','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','/api/jscripty/answers/reports','./api/jscriptyQuestionReport','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','/api/jscripty/projects','/api/settings','/api/square/odbc','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','./api/campaign','/api/migrations','./api/migration','/api/attachments','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/api/logs','/apidoc','static','join','root','/www','/demo','/snippet','snippet','3.0.0','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','resolve','get','appPath','/index.html','path','express','./errors','./utils/client-side-logger','setupLoggers','./api/client-side-logs','default','./api/user','use','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','./api/voiceCallReport','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','./api/mailInteraction','/api/mail/messages','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','/api/fax/queues','/api/fax/reports/queue','/api/sms/accounts','./api/smsAccount','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','/api/actions','/api/automations','./api/automation','/api/conditions','/api/intervals','./api/interval','/api/pauses','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','./api/sound','/api/tags','/api/templates','./api/template','/api/triggers','/api/variables','/api/integrations','./api/integration','/api/integrations/reports','/api/analytics/custom_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','/api/analytics/field_reports','./api/analyticFieldReport','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/fields','./api/intSalesforceField','./api/intSugarcrmAccount','./api/intSugarcrmConfiguration','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','./api/intDeskField','/api/integrations/zoho/accounts','/api/integrations/zoho/configurations','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xbd50,0x196));var _0x0bd5=function(_0x29d86e,_0x4fbf48){_0x29d86e=_0x29d86e-0x0;var _0xca253e=_0xbd50[_0x29d86e];return _0xca253e;};'use strict';var path=require(_0x0bd5('0x0'));var express=require(_0x0bd5('0x1'));var errors=require(_0x0bd5('0x2'));var config=require('./config/environment');var setupLoggers=require(_0x0bd5('0x3'))[_0x0bd5('0x4')];var clientSideLogs=require(_0x0bd5('0x5'));exports[_0x0bd5('0x6')]=function(_0x15620d){return setupLoggers(_0x15620d)['then'](function(){_0x15620d['use']('/api/users',require(_0x0bd5('0x7')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0x9'),require(_0x0bd5('0xa')));_0x15620d[_0x0bd5('0x8')]('/api/voice/contexts',require('./api/voiceContext'));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0xb'),require(_0x0bd5('0xc')));_0x15620d['use'](_0x0bd5('0xd'),require(_0x0bd5('0xe')));_0x15620d['use'](_0x0bd5('0xf'),require(_0x0bd5('0x10')));_0x15620d['use'](_0x0bd5('0x11'),require(_0x0bd5('0x12')));_0x15620d[_0x0bd5('0x8')]('/api/screen/recordings',require(_0x0bd5('0x13')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0x14'),require(_0x0bd5('0x15')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0x16'),require(_0x0bd5('0x17')));_0x15620d[_0x0bd5('0x8')]('/api/voice/calls/reports',require(_0x0bd5('0x18')));_0x15620d[_0x0bd5('0x8')]('/api/voice/dials/reports',require(_0x0bd5('0x19')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0x1a'),require(_0x0bd5('0x1b')));_0x15620d['use'](_0x0bd5('0x1c'),require(_0x0bd5('0x1d')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0x1e'),require(_0x0bd5('0x1f')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0x20'),require(_0x0bd5('0x21')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0x22'),require(_0x0bd5('0x23')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0x24'),require(_0x0bd5('0x25')));_0x15620d['use']('/api/mail/accounts',require('./api/mailAccount'));_0x15620d['use']('/api/mail/queues',require(_0x0bd5('0x26')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0x27'),require(_0x0bd5('0x28')));_0x15620d[_0x0bd5('0x8')]('/api/mail/interactions',require(_0x0bd5('0x29')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0x2a'),require('./api/mailMessage'));_0x15620d[_0x0bd5('0x8')]('/api/mail/applications',require('./api/mailApplication'));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0x2b'),require(_0x0bd5('0x2c')));_0x15620d['use'](_0x0bd5('0x2d'),require('./api/dashboard'));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0x2e'),require(_0x0bd5('0x2f')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0x30'),require(_0x0bd5('0x31')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0x32'),require(_0x0bd5('0x33')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0x34'),require(_0x0bd5('0x35')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0x36'),require('./api/faxMessage'));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0x37'),require('./api/faxQueue'));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0x38'),require('./api/faxQueueReport'));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0x39'),require(_0x0bd5('0x3a')));_0x15620d[_0x0bd5('0x8')]('/api/sms/applications',require(_0x0bd5('0x3b')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0x3c'),require(_0x0bd5('0x3d')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0x3e'),require('./api/smsMessage'));_0x15620d[_0x0bd5('0x8')]('/api/sms/queues',require(_0x0bd5('0x3f')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0x40'),require(_0x0bd5('0x41')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0x42'),require(_0x0bd5('0x43')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0x44'),require(_0x0bd5('0x45')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0x46'),require(_0x0bd5('0x47')));_0x15620d['use'](_0x0bd5('0x48'),require(_0x0bd5('0x49')));_0x15620d['use']('/api/chat/websites',require(_0x0bd5('0x4a')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0x4b'),require(_0x0bd5('0x4c')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0x4d'),require(_0x0bd5('0x4e')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0x4f'),require(_0x0bd5('0x50')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0x51'),require(_0x0bd5('0x52')));_0x15620d['use'](_0x0bd5('0x53'),require('./api/chatOfflineMessage'));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0x54'),require(_0x0bd5('0x55')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0x56'),require(_0x0bd5('0x57')));_0x15620d['use'](_0x0bd5('0x58'),require(_0x0bd5('0x59')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0x5a'),require(_0x0bd5('0x5b')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0x5c'),require(_0x0bd5('0x5d')));_0x15620d[_0x0bd5('0x8')]('/api/cm/hopper',require(_0x0bd5('0x5e')));_0x15620d['use'](_0x0bd5('0x5f'),require(_0x0bd5('0x60')));_0x15620d['use'](_0x0bd5('0x61'),require(_0x0bd5('0x62')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0x63'),require(_0x0bd5('0x64')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0x65'),require('./api/cmCustomField'));_0x15620d['use'](_0x0bd5('0x66'),require('./api/action'));_0x15620d['use'](_0x0bd5('0x67'),require(_0x0bd5('0x68')));_0x15620d['use']('/api/canned_answers',require('./api/cannedAnswer'));_0x15620d[_0x0bd5('0x8')]('/api/dispositions',require('./api/disposition'));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0x69'),require('./api/condition'));_0x15620d['use'](_0x0bd5('0x6a'),require(_0x0bd5('0x6b')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0x6c'),require('./api/pause'));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0x6d'),require(_0x0bd5('0x6e')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0x6f'),require(_0x0bd5('0x70')));_0x15620d['use'](_0x0bd5('0x71'),require(_0x0bd5('0x72')));_0x15620d[_0x0bd5('0x8')]('/api/sounds',require(_0x0bd5('0x73')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0x74'),require('./api/tag'));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0x75'),require(_0x0bd5('0x76')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0x77'),require('./api/trigger'));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0x78'),require('./api/variable'));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0x79'),require(_0x0bd5('0x7a')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0x7b'),require('./api/integrationReport'));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0x7c'),require('./api/analyticCustomReport'));_0x15620d[_0x0bd5('0x8')]('/api/analytics/default_reports',require(_0x0bd5('0x7d')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0x7e'),require(_0x0bd5('0x7f')));_0x15620d['use'](_0x0bd5('0x80'),require('./api/analyticMetric'));_0x15620d['use'](_0x0bd5('0x81'),require(_0x0bd5('0x82')));_0x15620d[_0x0bd5('0x8')]('/api/analytics/tree_reports',require(_0x0bd5('0x83')));_0x15620d['use'](_0x0bd5('0x84'),require(_0x0bd5('0x85')));_0x15620d[_0x0bd5('0x8')]('/api/integrations/salesforce/configurations',require('./api/intSalesforceConfiguration'));_0x15620d['use'](_0x0bd5('0x86'),require(_0x0bd5('0x87')));_0x15620d[_0x0bd5('0x8')]('/api/integrations/sugarcrm/accounts',require(_0x0bd5('0x88')));_0x15620d[_0x0bd5('0x8')]('/api/integrations/sugarcrm/configurations',require(_0x0bd5('0x89')));_0x15620d['use']('/api/integrations/sugarcrm/fields',require(_0x0bd5('0x8a')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0x8b'),require(_0x0bd5('0x8c')));_0x15620d['use'](_0x0bd5('0x8d'),require(_0x0bd5('0x8e')));_0x15620d[_0x0bd5('0x8')]('/api/integrations/desk/fields',require(_0x0bd5('0x8f')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0x90'),require('./api/intZohoAccount'));_0x15620d['use'](_0x0bd5('0x91'),require('./api/intZohoConfiguration'));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0x92'),require(_0x0bd5('0x93')));_0x15620d['use'](_0x0bd5('0x94'),require(_0x0bd5('0x95')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0x96'),require('./api/intZendeskConfiguration'));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0x97'),require(_0x0bd5('0x98')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0x99'),require('./api/intFreshdeskAccount'));_0x15620d[_0x0bd5('0x8')]('/api/integrations/freshdesk/configurations',require(_0x0bd5('0x9a')));_0x15620d['use']('/api/integrations/freshdesk/fields',require(_0x0bd5('0x9b')));_0x15620d['use'](_0x0bd5('0x9c'),require(_0x0bd5('0x9d')));_0x15620d[_0x0bd5('0x8')]('/api/integrations/vtiger/configurations',require(_0x0bd5('0x9e')));_0x15620d[_0x0bd5('0x8')]('/api/integrations/vtiger/fields',require(_0x0bd5('0x9f')));_0x15620d[_0x0bd5('0x8')]('/api/integrations/servicenow/accounts',require(_0x0bd5('0xa0')));_0x15620d['use'](_0x0bd5('0xa1'),require(_0x0bd5('0xa2')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0xa3'),require(_0x0bd5('0xa4')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0xa5'),require('./api/intDynamics365Account'));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0xa6'),require(_0x0bd5('0xa7')));_0x15620d['use']('/api/integrations/dynamics365/fields',require(_0x0bd5('0xa8')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0xa9'),require(_0x0bd5('0xaa')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0xab'),require(_0x0bd5('0xac')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0xad'),require(_0x0bd5('0xae')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0xaf'),require(_0x0bd5('0xb0')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0xb1'),require(_0x0bd5('0xb2')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0xb3'),require('./api/chatInternalMessage'));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0xb4'),require('./api/jscriptyAnswerReport'));_0x15620d[_0x0bd5('0x8')]('/api/jscripty/questions/reports',require(_0x0bd5('0xb5')));_0x15620d[_0x0bd5('0x8')]('/api/jscripty/sessions/reports',require(_0x0bd5('0xb6')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0xb7'),require(_0x0bd5('0xb8')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0xb9'),require(_0x0bd5('0xba')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0xbb'),require('./api/squareReportDetail'));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0xbc'),require('./api/jscriptyProject'));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0xbd'),require('./api/setting'));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0xbe'),require('./api/squareOdbc'));_0x15620d[_0x0bd5('0x8')]('/api/square/projects',require(_0x0bd5('0xbf')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0xc0'),require(_0x0bd5('0xc1')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0xc2'),require(_0x0bd5('0xc3')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0xc4'),require(_0x0bd5('0xc5')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0xc6'),require(_0x0bd5('0xc7')));_0x15620d[_0x0bd5('0x8')]('/api/campaigns',require(_0x0bd5('0xc8')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0xc9'),require(_0x0bd5('0xca')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0xcb'),require('./api/attachment'));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0xcc'),require(_0x0bd5('0xcd')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0xce'),require(_0x0bd5('0xcf')));_0x15620d[_0x0bd5('0x8')]('/api/chat/reports/transfer',require('./api/chatTransferReport'));_0x15620d['use'](_0x0bd5('0xd0'),require(_0x0bd5('0xd1')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0xd2'),require(_0x0bd5('0xd3')));_0x15620d['use'](_0x0bd5('0xd4'),require(_0x0bd5('0xd5')));_0x15620d['use'](_0x0bd5('0xd6'),require(_0x0bd5('0xd7')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0xd8'),require(_0x0bd5('0xd9')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0xda'),require(_0x0bd5('0xdb')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0xdc'),require(_0x0bd5('0xdd')));_0x15620d['use'](_0x0bd5('0xde'),require(_0x0bd5('0xdf')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0xe0'),require(_0x0bd5('0xe1')));_0x15620d['use'](_0x0bd5('0xe2'),require(_0x0bd5('0xe3')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0xe4'),require(_0x0bd5('0xe5')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0xe6'),require(_0x0bd5('0xe7')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0xe8'),require(_0x0bd5('0xe9')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0xea'),require(_0x0bd5('0xeb')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0xec'),require(_0x0bd5('0xed')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0xee'),require('./api/whatsappQueue'));_0x15620d['use'](_0x0bd5('0xef'),require(_0x0bd5('0xf0')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0xf1'),require(_0x0bd5('0xf2')));_0x15620d['use'](_0x0bd5('0xf3'),require(_0x0bd5('0xf4')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0xf5'),require(_0x0bd5('0xf6')));_0x15620d['use'](_0x0bd5('0xf7'),require(_0x0bd5('0xf8')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0xf9'),require(_0x0bd5('0xfa')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0xfb'),require(_0x0bd5('0xfc')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0xfd'),require(_0x0bd5('0xfe')));_0x15620d['use'](_0x0bd5('0xff'),require(_0x0bd5('0x100')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0x101'),require(_0x0bd5('0x102')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0x103'),require(_0x0bd5('0x104')));_0x15620d['use'](_0x0bd5('0x105'),require(_0x0bd5('0x106')));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0x107'),clientSideLogs);_0x15620d[_0x0bd5('0x8')](_0x0bd5('0x108'),express[_0x0bd5('0x109')](path[_0x0bd5('0x10a')](config[_0x0bd5('0x10b')],_0x0bd5('0x108'))));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0x10c'),express[_0x0bd5('0x109')](path[_0x0bd5('0x10a')](config[_0x0bd5('0x10b')],_0x0bd5('0x10c'))));_0x15620d['use'](_0x0bd5('0x10d'),express[_0x0bd5('0x109')](path[_0x0bd5('0x10a')](config[_0x0bd5('0x10b')],_0x0bd5('0x10d'))));_0x15620d[_0x0bd5('0x8')](_0x0bd5('0x10e'),express[_0x0bd5('0x109')](path[_0x0bd5('0x10a')](config['root'],_0x0bd5('0x10f'),_0x0bd5('0x110'))));_0x15620d[_0x0bd5('0x8')]('/plugins',express[_0x0bd5('0x109')](path[_0x0bd5('0x10a')](config[_0x0bd5('0x10b')],_0x0bd5('0x111'))));_0x15620d[_0x0bd5('0x112')](_0x0bd5('0x113'))['get'](errors[0x194]);_0x15620d[_0x0bd5('0x112')]('/*')['get'](function(_0x31427f,_0x527113){_0x527113['sendFile'](path[_0x0bd5('0x114')](_0x15620d[_0x0bd5('0x115')](_0x0bd5('0x116'))+_0x0bd5('0x117')));});return _0x15620d;});}; \ No newline at end of file +var _0x7fbe=['/api/voice/transfers/reports','./api/mailServerOut','/api/mail/accounts','/api/mail/queues','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','/api/fax/applications','./api/faxApplication','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','./api/faxQueueReport','/api/sms/accounts','/api/sms/applications','/api/sms/interactions','./api/smsInteraction','./api/smsMessage','/api/sms/queues','./api/smsQueue','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','/api/chat/groups','./api/chatGroup','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','./api/cmHopperBlack','/api/cm/hopper_final','/api/cm/hopper_history','/api/actions','./api/action','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','/api/templates','./api/template','/api/triggers','./api/trigger','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticMetric','/api/analytics/field_reports','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','./api/intSugarcrmField','/api/integrations/desk/accounts','/api/integrations/desk/configurations','./api/intDeskConfiguration','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','./api/intZendeskAccount','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','./api/intServicenowField','/api/integrations/dynamics365/accounts','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','./api/intFreshsalesConfiguration','./api/intFreshsalesField','./api/network','/api/chat/reports/queue','./api/chatQueueReport','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/sms/reports/queue','./api/smsQueueReport','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','./api/squareProject','/api/square/recordings','./api/squareRecording','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/migration','/api/attachments','./api/attachment','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','/api/userProfiles','./api/userProfile','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappApplication','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','./api/whatsappTransferReport','/api/cloudProviders','/api/realtime','./api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','/api/version','./api/version','/api/system','./api/system','./api/webbar','/apidoc','static','join','root','/www','/demo','snippet','3.0.0','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','resolve','appPath','/index.html','./errors','./config/environment','./utils/client-side-logger','setupLoggers','./api/client-side-logs','default','then','use','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','./api/voiceMailMessage','./api/voiceCallReport','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/memberReport','/api/trunks','./api/trunk'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x1ccc19,_0x2a5e47){_0x1ccc19=_0x1ccc19-0x0;var _0x393065=_0x7fbe[_0x1ccc19];return _0x393065;};'use strict';var path=require('path');var express=require('express');var errors=require(_0xe7fb('0x0'));var config=require(_0xe7fb('0x1'));var setupLoggers=require(_0xe7fb('0x2'))[_0xe7fb('0x3')];var clientSideLogs=require(_0xe7fb('0x4'));exports[_0xe7fb('0x5')]=function(_0x11d2c4){return setupLoggers(_0x11d2c4)[_0xe7fb('0x6')](function(){_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0x8'),require(_0xe7fb('0x9')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0xa'),require(_0xe7fb('0xb')));_0x11d2c4['use'](_0xe7fb('0xc'),require(_0xe7fb('0xd')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0xe'),require('./api/voiceExtension'));_0x11d2c4['use'](_0xe7fb('0xf'),require(_0xe7fb('0x10')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0x11'),require(_0xe7fb('0x12')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0x13'),require(_0xe7fb('0x14')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0x15'),require(_0xe7fb('0x16')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0x17'),require(_0xe7fb('0x18')));_0x11d2c4[_0xe7fb('0x7')]('/api/voice/mails/messages',require(_0xe7fb('0x19')));_0x11d2c4[_0xe7fb('0x7')]('/api/voice/calls/reports',require(_0xe7fb('0x1a')));_0x11d2c4[_0xe7fb('0x7')]('/api/voice/dials/reports',require(_0xe7fb('0x1b')));_0x11d2c4['use'](_0xe7fb('0x1c'),require(_0xe7fb('0x1d')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0x1e'),require('./api/voiceQueueReport'));_0x11d2c4[_0xe7fb('0x7')]('/api/members/reports',require(_0xe7fb('0x1f')));_0x11d2c4['use'](_0xe7fb('0x20'),require(_0xe7fb('0x21')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0x22'),require('./api/voiceTransferReport'));_0x11d2c4[_0xe7fb('0x7')]('/api/mail/out_servers',require(_0xe7fb('0x23')));_0x11d2c4['use'](_0xe7fb('0x24'),require('./api/mailAccount'));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0x25'),require('./api/mailQueue'));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0x26'),require(_0xe7fb('0x27')));_0x11d2c4['use'](_0xe7fb('0x28'),require(_0xe7fb('0x29')));_0x11d2c4['use']('/api/mail/messages',require('./api/mailMessage'));_0x11d2c4[_0xe7fb('0x7')]('/api/mail/applications',require('./api/mailApplication'));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0x2a'),require(_0xe7fb('0x2b')));_0x11d2c4['use'](_0xe7fb('0x2c'),require(_0xe7fb('0x2d')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0x2e'),require(_0xe7fb('0x2f')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0x30'),require('./api/faxAccount'));_0x11d2c4['use'](_0xe7fb('0x31'),require(_0xe7fb('0x32')));_0x11d2c4[_0xe7fb('0x7')]('/api/fax/interactions',require(_0xe7fb('0x33')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0x34'),require(_0xe7fb('0x35')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0x36'),require(_0xe7fb('0x37')));_0x11d2c4[_0xe7fb('0x7')]('/api/fax/reports/queue',require(_0xe7fb('0x38')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0x39'),require('./api/smsAccount'));_0x11d2c4['use'](_0xe7fb('0x3a'),require('./api/smsApplication'));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0x3b'),require(_0xe7fb('0x3c')));_0x11d2c4[_0xe7fb('0x7')]('/api/sms/messages',require(_0xe7fb('0x3d')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0x3e'),require(_0xe7fb('0x3f')));_0x11d2c4[_0xe7fb('0x7')]('/api/openchannel/accounts',require(_0xe7fb('0x40')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0x41'),require(_0xe7fb('0x42')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0x43'),require(_0xe7fb('0x44')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0x45'),require('./api/openchannelMessage'));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0x46'),require(_0xe7fb('0x47')));_0x11d2c4['use'](_0xe7fb('0x48'),require(_0xe7fb('0x49')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0x4a'),require(_0xe7fb('0x4b')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0x4c'),require(_0xe7fb('0x4d')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0x4e'),require(_0xe7fb('0x4f')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0x50'),require(_0xe7fb('0x51')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0x52'),require(_0xe7fb('0x53')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0x54'),require('./api/chatQueue'));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0x55'),require(_0xe7fb('0x56')));_0x11d2c4[_0xe7fb('0x7')]('/api/chat/proactive_actions',require(_0xe7fb('0x57')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0x58'),require(_0xe7fb('0x59')));_0x11d2c4['use'](_0xe7fb('0x5a'),require(_0xe7fb('0x5b')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0x5c'),require(_0xe7fb('0x5d')));_0x11d2c4[_0xe7fb('0x7')]('/api/cm/hopper_black',require(_0xe7fb('0x5e')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0x5f'),require('./api/cmHopperFinal'));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0x60'),require('./api/cmHopperHistory'));_0x11d2c4['use']('/api/cm/custom_fields',require('./api/cmCustomField'));_0x11d2c4['use'](_0xe7fb('0x61'),require(_0xe7fb('0x62')));_0x11d2c4[_0xe7fb('0x7')]('/api/automations',require(_0xe7fb('0x63')));_0x11d2c4['use'](_0xe7fb('0x64'),require(_0xe7fb('0x65')));_0x11d2c4['use'](_0xe7fb('0x66'),require(_0xe7fb('0x67')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0x68'),require('./api/condition'));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0x69'),require(_0xe7fb('0x6a')));_0x11d2c4['use'](_0xe7fb('0x6b'),require(_0xe7fb('0x6c')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0x6d'),require(_0xe7fb('0x6e')));_0x11d2c4['use'](_0xe7fb('0x6f'),require('./api/voiceQueuesLog'));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0x70'),require(_0xe7fb('0x71')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0x72'),require('./api/sound'));_0x11d2c4[_0xe7fb('0x7')]('/api/tags',require('./api/tag'));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0x73'),require(_0xe7fb('0x74')));_0x11d2c4['use'](_0xe7fb('0x75'),require(_0xe7fb('0x76')));_0x11d2c4['use']('/api/variables',require(_0xe7fb('0x77')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0x78'),require(_0xe7fb('0x79')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0x7a'),require(_0xe7fb('0x7b')));_0x11d2c4[_0xe7fb('0x7')]('/api/analytics/custom_reports',require(_0xe7fb('0x7c')));_0x11d2c4['use'](_0xe7fb('0x7d'),require(_0xe7fb('0x7e')));_0x11d2c4['use'](_0xe7fb('0x7f'),require('./api/analyticExtractedReport'));_0x11d2c4[_0xe7fb('0x7')]('/api/analytics/metrics',require(_0xe7fb('0x80')));_0x11d2c4['use'](_0xe7fb('0x81'),require('./api/analyticFieldReport'));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0x82'),require(_0xe7fb('0x83')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0x84'),require(_0xe7fb('0x85')));_0x11d2c4[_0xe7fb('0x7')]('/api/integrations/salesforce/configurations',require('./api/intSalesforceConfiguration'));_0x11d2c4[_0xe7fb('0x7')]('/api/integrations/salesforce/fields',require('./api/intSalesforceField'));_0x11d2c4['use']('/api/integrations/sugarcrm/accounts',require('./api/intSugarcrmAccount'));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0x86'),require(_0xe7fb('0x87')));_0x11d2c4[_0xe7fb('0x7')]('/api/integrations/sugarcrm/fields',require(_0xe7fb('0x88')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0x89'),require('./api/intDeskAccount'));_0x11d2c4['use'](_0xe7fb('0x8a'),require(_0xe7fb('0x8b')));_0x11d2c4[_0xe7fb('0x7')]('/api/integrations/desk/fields',require(_0xe7fb('0x8c')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0x8d'),require(_0xe7fb('0x8e')));_0x11d2c4['use']('/api/integrations/zoho/configurations',require(_0xe7fb('0x8f')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0x90'),require(_0xe7fb('0x91')));_0x11d2c4[_0xe7fb('0x7')]('/api/integrations/zendesk/accounts',require(_0xe7fb('0x92')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0x93'),require('./api/intZendeskConfiguration'));_0x11d2c4['use'](_0xe7fb('0x94'),require(_0xe7fb('0x95')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0x96'),require(_0xe7fb('0x97')));_0x11d2c4[_0xe7fb('0x7')]('/api/integrations/freshdesk/configurations',require(_0xe7fb('0x98')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0x99'),require(_0xe7fb('0x9a')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0x9b'),require('./api/intVtigerAccount'));_0x11d2c4[_0xe7fb('0x7')]('/api/integrations/vtiger/configurations',require(_0xe7fb('0x9c')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0x9d'),require(_0xe7fb('0x9e')));_0x11d2c4['use']('/api/integrations/servicenow/accounts',require(_0xe7fb('0x9f')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0xa0'),require(_0xe7fb('0xa1')));_0x11d2c4[_0xe7fb('0x7')]('/api/integrations/servicenow/fields',require(_0xe7fb('0xa2')));_0x11d2c4['use'](_0xe7fb('0xa3'),require('./api/intDynamics365Account'));_0x11d2c4['use'](_0xe7fb('0xa4'),require(_0xe7fb('0xa5')));_0x11d2c4[_0xe7fb('0x7')]('/api/integrations/dynamics365/fields',require(_0xe7fb('0xa6')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0xa7'),require(_0xe7fb('0xa8')));_0x11d2c4[_0xe7fb('0x7')]('/api/integrations/freshsales/configurations',require(_0xe7fb('0xa9')));_0x11d2c4[_0xe7fb('0x7')]('/api/integrations/freshsales/fields',require(_0xe7fb('0xaa')));_0x11d2c4[_0xe7fb('0x7')]('/api/networks',require(_0xe7fb('0xab')));_0x11d2c4['use'](_0xe7fb('0xac'),require(_0xe7fb('0xad')));_0x11d2c4[_0xe7fb('0x7')]('/api/chat/internal/messages',require(_0xe7fb('0xae')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0xaf'),require(_0xe7fb('0xb0')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0xb1'),require(_0xe7fb('0xb2')));_0x11d2c4[_0xe7fb('0x7')]('/api/jscripty/sessions/reports',require('./api/jscriptySessionReport'));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0xb3'),require(_0xe7fb('0xb4')));_0x11d2c4['use']('/api/square/reports',require(_0xe7fb('0xb5')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0xb6'),require(_0xe7fb('0xb7')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0xb8'),require(_0xe7fb('0xb9')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0xba'),require(_0xe7fb('0xbb')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0xbc'),require(_0xe7fb('0xbd')));_0x11d2c4['use']('/api/square/projects',require(_0xe7fb('0xbe')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0xbf'),require(_0xe7fb('0xc0')));_0x11d2c4[_0xe7fb('0x7')]('/api/square/messages',require(_0xe7fb('0xc1')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0xc2'),require(_0xe7fb('0xc3')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0xc4'),require(_0xe7fb('0xc5')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0xc6'),require('./api/campaign'));_0x11d2c4[_0xe7fb('0x7')]('/api/migrations',require(_0xe7fb('0xc7')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0xc8'),require(_0xe7fb('0xc9')));_0x11d2c4[_0xe7fb('0x7')]('/api/plugins',require(_0xe7fb('0xca')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0xcb'),require(_0xe7fb('0xcc')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0xcd'),require(_0xe7fb('0xce')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0xcf'),require(_0xe7fb('0xd0')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0xd1'),require(_0xe7fb('0xd2')));_0x11d2c4[_0xe7fb('0x7')]('/api/sms/reports/transfer',require('./api/smsTransferReport'));_0x11d2c4['use'](_0xe7fb('0xd3'),require(_0xe7fb('0xd4')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0xd5'),require('./api/voicePrefix'));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0xd6'),require(_0xe7fb('0xd7')));_0x11d2c4[_0xe7fb('0x7')]('/api/userProfile/sections',require(_0xe7fb('0xd8')));_0x11d2c4['use'](_0xe7fb('0xd9'),require(_0xe7fb('0xda')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0xdb'),require(_0xe7fb('0xdc')));_0x11d2c4['use'](_0xe7fb('0xdd'),require('./api/whatsappAccount'));_0x11d2c4[_0xe7fb('0x7')]('/api/whatsapp/applications',require(_0xe7fb('0xde')));_0x11d2c4[_0xe7fb('0x7')]('/api/whatsapp/interactions',require(_0xe7fb('0xdf')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0xe0'),require(_0xe7fb('0xe1')));_0x11d2c4['use'](_0xe7fb('0xe2'),require(_0xe7fb('0xe3')));_0x11d2c4[_0xe7fb('0x7')]('/api/whatsapp/reports/transfer',require(_0xe7fb('0xe4')));_0x11d2c4['use']('/api/whatsapp/queues',require('./api/whatsappQueue'));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0xe5'),require('./api/cloudProvider'));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0xe6'),require(_0xe7fb('0xe7')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0xe8'),require(_0xe7fb('0xe9')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0xea'),require(_0xe7fb('0xeb')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0xec'),require(_0xe7fb('0xed')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0xee'),require(_0xe7fb('0xef')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0xf0'),require(_0xe7fb('0xf1')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0xf2'),require('./api/rpc'));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0xf3'),require(_0xe7fb('0xf4')));_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0xf5'),require(_0xe7fb('0xf6')));_0x11d2c4[_0xe7fb('0x7')]('/api/pm2',require('./api/pm2'));_0x11d2c4[_0xe7fb('0x7')]('/api/webbar',require(_0xe7fb('0xf7')));_0x11d2c4[_0xe7fb('0x7')]('/api/logs',clientSideLogs);_0x11d2c4[_0xe7fb('0x7')](_0xe7fb('0xf8'),express[_0xe7fb('0xf9')](path[_0xe7fb('0xfa')](config[_0xe7fb('0xfb')],_0xe7fb('0xf8'))));_0x11d2c4['use'](_0xe7fb('0xfc'),express[_0xe7fb('0xf9')](path[_0xe7fb('0xfa')](config[_0xe7fb('0xfb')],_0xe7fb('0xfc'))));_0x11d2c4[_0xe7fb('0x7')]('/demo',express['static'](path['join'](config[_0xe7fb('0xfb')],_0xe7fb('0xfd'))));_0x11d2c4[_0xe7fb('0x7')]('/snippet',express[_0xe7fb('0xf9')](path['join'](config[_0xe7fb('0xfb')],_0xe7fb('0xfe'),_0xe7fb('0xff'))));_0x11d2c4[_0xe7fb('0x7')]('/plugins',express[_0xe7fb('0xf9')](path[_0xe7fb('0xfa')](config[_0xe7fb('0xfb')],_0xe7fb('0x100'))));_0x11d2c4[_0xe7fb('0x101')](_0xe7fb('0x102'))[_0xe7fb('0x103')](errors[0x194]);_0x11d2c4[_0xe7fb('0x101')]('/*')['get'](function(_0x48b588,_0x35f108){_0x35f108['sendFile'](path[_0xe7fb('0x104')](_0x11d2c4[_0xe7fb('0x103')](_0xe7fb('0x105'))+_0xe7fb('0x106')));});return _0x11d2c4;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index d9bc046..762fc8b 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x67e8=['../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/campaign/campaign.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','error','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/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/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/interval/interval.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReportDetail/squareReportDetail.rpc'];(function(_0x212348,_0x55415c){var _0x1696e9=function(_0x2b87cb){while(--_0x2b87cb){_0x212348['push'](_0x212348['shift']());}};_0x1696e9(++_0x55415c);}(_0x67e8,0xfa));var _0x867e=function(_0x173e00,_0x368436){_0x173e00=_0x173e00-0x0;var _0x5b0e56=_0x67e8[_0x173e00];return _0x5b0e56;};'use strict';var jayson=require(_0x867e('0x0'));var _=require('lodash');var config=require(_0x867e('0x1'));exports[_0x867e('0x2')]=function(){return new Promise(function(_0x52ea6b,_0xa318b){var _0x41266f={};_0x41266f=_[_0x867e('0x3')](_0x41266f,require(_0x867e('0x4')));_0x41266f=_[_0x867e('0x3')](_0x41266f,require(_0x867e('0x5')));_0x41266f=_[_0x867e('0x3')](_0x41266f,require(_0x867e('0x6')));_0x41266f=_[_0x867e('0x3')](_0x41266f,require(_0x867e('0x7')));_0x41266f=_[_0x867e('0x3')](_0x41266f,require(_0x867e('0x8')));_0x41266f=_[_0x867e('0x3')](_0x41266f,require(_0x867e('0x9')));_0x41266f=_[_0x867e('0x3')](_0x41266f,require(_0x867e('0xa')));_0x41266f=_['merge'](_0x41266f,require(_0x867e('0xb')));_0x41266f=_[_0x867e('0x3')](_0x41266f,require(_0x867e('0xc')));_0x41266f=_[_0x867e('0x3')](_0x41266f,require(_0x867e('0xd')));_0x41266f=_[_0x867e('0x3')](_0x41266f,require(_0x867e('0xe')));_0x41266f=_[_0x867e('0x3')](_0x41266f,require(_0x867e('0xf')));_0x41266f=_['merge'](_0x41266f,require(_0x867e('0x10')));_0x41266f=_[_0x867e('0x3')](_0x41266f,require(_0x867e('0x11')));_0x41266f=_[_0x867e('0x3')](_0x41266f,require('../api/mailQueue/mailQueue.rpc'));_0x41266f=_[_0x867e('0x3')](_0x41266f,require(_0x867e('0x12')));_0x41266f=_[_0x867e('0x3')](_0x41266f,require(_0x867e('0x13')));_0x41266f=_[_0x867e('0x3')](_0x41266f,require(_0x867e('0x14')));_0x41266f=_[_0x867e('0x3')](_0x41266f,require(_0x867e('0x15')));_0x41266f=_[_0x867e('0x3')](_0x41266f,require(_0x867e('0x16')));_0x41266f=_[_0x867e('0x3')](_0x41266f,require(_0x867e('0x17')));_0x41266f=_[_0x867e('0x3')](_0x41266f,require(_0x867e('0x18')));_0x41266f=_['merge'](_0x41266f,require(_0x867e('0x19')));_0x41266f=_['merge'](_0x41266f,require(_0x867e('0x1a')));_0x41266f=_[_0x867e('0x3')](_0x41266f,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x41266f=_[_0x867e('0x3')](_0x41266f,require(_0x867e('0x1b')));_0x41266f=_['merge'](_0x41266f,require(_0x867e('0x1c')));_0x41266f=_['merge'](_0x41266f,require(_0x867e('0x1d')));_0x41266f=_[_0x867e('0x3')](_0x41266f,require(_0x867e('0x1e')));_0x41266f=_[_0x867e('0x3')](_0x41266f,require(_0x867e('0x1f')));_0x41266f=_[_0x867e('0x3')](_0x41266f,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x41266f=_[_0x867e('0x3')](_0x41266f,require(_0x867e('0x20')));_0x41266f=_[_0x867e('0x3')](_0x41266f,require(_0x867e('0x21')));_0x41266f=_[_0x867e('0x3')](_0x41266f,require(_0x867e('0x22')));_0x41266f=_[_0x867e('0x3')](_0x41266f,require(_0x867e('0x23')));_0x41266f=_[_0x867e('0x3')](_0x41266f,require(_0x867e('0x24')));_0x41266f=_[_0x867e('0x3')](_0x41266f,require(_0x867e('0x25')));_0x41266f=_[_0x867e('0x3')](_0x41266f,require('../api/cmContact/cmContact.rpc'));_0x41266f=_[_0x867e('0x3')](_0x41266f,require('../api/cmHopper/cmHopper.rpc'));_0x41266f=_[_0x867e('0x3')](_0x41266f,require(_0x867e('0x26')));_0x41266f=_[_0x867e('0x3')](_0x41266f,require(_0x867e('0x27')));_0x41266f=_[_0x867e('0x3')](_0x41266f,require(_0x867e('0x28')));_0x41266f=_[_0x867e('0x3')](_0x41266f,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x41266f=_[_0x867e('0x3')](_0x41266f,require(_0x867e('0x29')));_0x41266f=_[_0x867e('0x3')](_0x41266f,require('../api/pause/pause.rpc'));_0x41266f=_[_0x867e('0x3')](_0x41266f,require(_0x867e('0x2a')));_0x41266f=_[_0x867e('0x3')](_0x41266f,require(_0x867e('0x2b')));_0x41266f=_['merge'](_0x41266f,require(_0x867e('0x2c')));_0x41266f=_[_0x867e('0x3')](_0x41266f,require('../api/variable/variable.rpc'));_0x41266f=_[_0x867e('0x3')](_0x41266f,require(_0x867e('0x2d')));_0x41266f=_[_0x867e('0x3')](_0x41266f,require(_0x867e('0x2e')));_0x41266f=_[_0x867e('0x3')](_0x41266f,require(_0x867e('0x2f')));_0x41266f=_[_0x867e('0x3')](_0x41266f,require(_0x867e('0x30')));_0x41266f=_['merge'](_0x41266f,require(_0x867e('0x31')));_0x41266f=_['merge'](_0x41266f,require(_0x867e('0x32')));_0x41266f=_['merge'](_0x41266f,require(_0x867e('0x33')));_0x41266f=_[_0x867e('0x3')](_0x41266f,require(_0x867e('0x34')));_0x41266f=_[_0x867e('0x3')](_0x41266f,require(_0x867e('0x35')));_0x41266f=_[_0x867e('0x3')](_0x41266f,require(_0x867e('0x36')));_0x41266f=_[_0x867e('0x3')](_0x41266f,require(_0x867e('0x37')));_0x41266f=_[_0x867e('0x3')](_0x41266f,require(_0x867e('0x38')));_0x41266f=_[_0x867e('0x3')](_0x41266f,require('../api/squareReport/squareReport.rpc'));_0x41266f=_[_0x867e('0x3')](_0x41266f,require(_0x867e('0x39')));_0x41266f=_['merge'](_0x41266f,require(_0x867e('0x3a')));_0x41266f=_[_0x867e('0x3')](_0x41266f,require(_0x867e('0x3b')));_0x41266f=_[_0x867e('0x3')](_0x41266f,require(_0x867e('0x3c')));_0x41266f=_[_0x867e('0x3')](_0x41266f,require(_0x867e('0x3d')));_0x41266f=_['merge'](_0x41266f,require('../api/squareMessage/squareMessage.rpc'));_0x41266f=_[_0x867e('0x3')](_0x41266f,require(_0x867e('0x3e')));_0x41266f=_[_0x867e('0x3')](_0x41266f,require('../api/attachment/attachment.rpc'));_0x41266f=_[_0x867e('0x3')](_0x41266f,require(_0x867e('0x3f')));_0x41266f=_[_0x867e('0x3')](_0x41266f,require(_0x867e('0x40')));_0x41266f=_['merge'](_0x41266f,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x41266f=_[_0x867e('0x3')](_0x41266f,require(_0x867e('0x41')));_0x41266f=_['merge'](_0x41266f,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x41266f=_[_0x867e('0x3')](_0x41266f,require(_0x867e('0x42')));var _0x202460=jayson[_0x867e('0x43')](_0x41266f)[_0x867e('0x44')]();var _0x520cba=config[_0x867e('0x45')]['port']||config[_0x867e('0x46')]+0x1;var _0x23ab8c=config['rpc']['ip']||_0x867e('0x47');_0x202460['on'](_0x867e('0x48'),function(_0x416531){return _0xa318b(_0x416531);});_0x202460[_0x867e('0x2')](_0x520cba,_0x23ab8c,function(){console['log'](_0x867e('0x49'),_0x23ab8c,_0x520cba);require(_0x867e('0x4a'))[_0x867e('0x4b')]();return _0x52ea6b(_0x867e('0x4c')+_0x23ab8c+':'+_0x520cba);});});}; \ No newline at end of file +var _0x7573=['../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','http','port','rpc','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','RPC\x20listening\x20on\x20','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/faxApplication/faxApplication.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/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatMessage/chatMessage.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc'];(function(_0xcafb2b,_0x2cc85e){var _0x539f9a=function(_0x9a96e6){while(--_0x9a96e6){_0xcafb2b['push'](_0xcafb2b['shift']());}};_0x539f9a(++_0x2cc85e);}(_0x7573,0x194));var _0x3757=function(_0x28e33c,_0x4fb639){_0x28e33c=_0x28e33c-0x0;var _0x18e3a3=_0x7573[_0x28e33c];return _0x18e3a3;};'use strict';var jayson=require('jayson/promise');var _=require(_0x3757('0x0'));var config=require(_0x3757('0x1'));exports[_0x3757('0x2')]=function(){return new Promise(function(_0x367a5c,_0x5ea6a8){var _0x1e7df2={};_0x1e7df2=_[_0x3757('0x3')](_0x1e7df2,require(_0x3757('0x4')));_0x1e7df2=_[_0x3757('0x3')](_0x1e7df2,require('../api/voiceExtension/voiceExtension.rpc'));_0x1e7df2=_[_0x3757('0x3')](_0x1e7df2,require(_0x3757('0x5')));_0x1e7df2=_['merge'](_0x1e7df2,require(_0x3757('0x6')));_0x1e7df2=_['merge'](_0x1e7df2,require(_0x3757('0x7')));_0x1e7df2=_['merge'](_0x1e7df2,require(_0x3757('0x8')));_0x1e7df2=_[_0x3757('0x3')](_0x1e7df2,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x1e7df2=_['merge'](_0x1e7df2,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x1e7df2=_[_0x3757('0x3')](_0x1e7df2,require('../api/memberReport/memberReport.rpc'));_0x1e7df2=_['merge'](_0x1e7df2,require('../api/trunk/trunk.rpc'));_0x1e7df2=_[_0x3757('0x3')](_0x1e7df2,require(_0x3757('0x9')));_0x1e7df2=_['merge'](_0x1e7df2,require(_0x3757('0xa')));_0x1e7df2=_[_0x3757('0x3')](_0x1e7df2,require(_0x3757('0xb')));_0x1e7df2=_[_0x3757('0x3')](_0x1e7df2,require(_0x3757('0xc')));_0x1e7df2=_['merge'](_0x1e7df2,require(_0x3757('0xd')));_0x1e7df2=_[_0x3757('0x3')](_0x1e7df2,require('../api/mailInteraction/mailInteraction.rpc'));_0x1e7df2=_[_0x3757('0x3')](_0x1e7df2,require('../api/mailMessage/mailMessage.rpc'));_0x1e7df2=_['merge'](_0x1e7df2,require('../api/mailApplication/mailApplication.rpc'));_0x1e7df2=_['merge'](_0x1e7df2,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x1e7df2=_[_0x3757('0x3')](_0x1e7df2,require('../api/faxAccount/faxAccount.rpc'));_0x1e7df2=_[_0x3757('0x3')](_0x1e7df2,require(_0x3757('0xe')));_0x1e7df2=_[_0x3757('0x3')](_0x1e7df2,require('../api/faxInteraction/faxInteraction.rpc'));_0x1e7df2=_[_0x3757('0x3')](_0x1e7df2,require('../api/faxMessage/faxMessage.rpc'));_0x1e7df2=_[_0x3757('0x3')](_0x1e7df2,require(_0x3757('0xf')));_0x1e7df2=_[_0x3757('0x3')](_0x1e7df2,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x1e7df2=_[_0x3757('0x3')](_0x1e7df2,require(_0x3757('0x10')));_0x1e7df2=_[_0x3757('0x3')](_0x1e7df2,require(_0x3757('0x11')));_0x1e7df2=_['merge'](_0x1e7df2,require(_0x3757('0x12')));_0x1e7df2=_['merge'](_0x1e7df2,require(_0x3757('0x13')));_0x1e7df2=_[_0x3757('0x3')](_0x1e7df2,require(_0x3757('0x14')));_0x1e7df2=_[_0x3757('0x3')](_0x1e7df2,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x1e7df2=_[_0x3757('0x3')](_0x1e7df2,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x1e7df2=_[_0x3757('0x3')](_0x1e7df2,require(_0x3757('0x15')));_0x1e7df2=_[_0x3757('0x3')](_0x1e7df2,require(_0x3757('0x16')));_0x1e7df2=_[_0x3757('0x3')](_0x1e7df2,require('../api/chatInteraction/chatInteraction.rpc'));_0x1e7df2=_[_0x3757('0x3')](_0x1e7df2,require(_0x3757('0x17')));_0x1e7df2=_[_0x3757('0x3')](_0x1e7df2,require('../api/chatQueue/chatQueue.rpc'));_0x1e7df2=_[_0x3757('0x3')](_0x1e7df2,require(_0x3757('0x18')));_0x1e7df2=_[_0x3757('0x3')](_0x1e7df2,require(_0x3757('0x19')));_0x1e7df2=_[_0x3757('0x3')](_0x1e7df2,require(_0x3757('0x1a')));_0x1e7df2=_[_0x3757('0x3')](_0x1e7df2,require(_0x3757('0x1b')));_0x1e7df2=_[_0x3757('0x3')](_0x1e7df2,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x1e7df2=_[_0x3757('0x3')](_0x1e7df2,require(_0x3757('0x1c')));_0x1e7df2=_['merge'](_0x1e7df2,require(_0x3757('0x1d')));_0x1e7df2=_['merge'](_0x1e7df2,require(_0x3757('0x1e')));_0x1e7df2=_[_0x3757('0x3')](_0x1e7df2,require(_0x3757('0x1f')));_0x1e7df2=_[_0x3757('0x3')](_0x1e7df2,require('../api/template/template.rpc'));_0x1e7df2=_['merge'](_0x1e7df2,require('../api/trigger/trigger.rpc'));_0x1e7df2=_[_0x3757('0x3')](_0x1e7df2,require('../api/variable/variable.rpc'));_0x1e7df2=_[_0x3757('0x3')](_0x1e7df2,require(_0x3757('0x20')));_0x1e7df2=_[_0x3757('0x3')](_0x1e7df2,require(_0x3757('0x21')));_0x1e7df2=_['merge'](_0x1e7df2,require(_0x3757('0x22')));_0x1e7df2=_[_0x3757('0x3')](_0x1e7df2,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x1e7df2=_['merge'](_0x1e7df2,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x1e7df2=_['merge'](_0x1e7df2,require(_0x3757('0x23')));_0x1e7df2=_[_0x3757('0x3')](_0x1e7df2,require(_0x3757('0x24')));_0x1e7df2=_[_0x3757('0x3')](_0x1e7df2,require(_0x3757('0x25')));_0x1e7df2=_[_0x3757('0x3')](_0x1e7df2,require(_0x3757('0x26')));_0x1e7df2=_['merge'](_0x1e7df2,require(_0x3757('0x27')));_0x1e7df2=_['merge'](_0x1e7df2,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x1e7df2=_['merge'](_0x1e7df2,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x1e7df2=_['merge'](_0x1e7df2,require('../api/squareReport/squareReport.rpc'));_0x1e7df2=_['merge'](_0x1e7df2,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x1e7df2=_[_0x3757('0x3')](_0x1e7df2,require('../api/setting/setting.rpc'));_0x1e7df2=_[_0x3757('0x3')](_0x1e7df2,require('../api/squareOdbc/squareOdbc.rpc'));_0x1e7df2=_[_0x3757('0x3')](_0x1e7df2,require(_0x3757('0x28')));_0x1e7df2=_[_0x3757('0x3')](_0x1e7df2,require(_0x3757('0x29')));_0x1e7df2=_[_0x3757('0x3')](_0x1e7df2,require('../api/squareMessage/squareMessage.rpc'));_0x1e7df2=_[_0x3757('0x3')](_0x1e7df2,require('../api/campaign/campaign.rpc'));_0x1e7df2=_['merge'](_0x1e7df2,require(_0x3757('0x2a')));_0x1e7df2=_[_0x3757('0x3')](_0x1e7df2,require(_0x3757('0x2b')));_0x1e7df2=_['merge'](_0x1e7df2,require(_0x3757('0x2c')));_0x1e7df2=_[_0x3757('0x3')](_0x1e7df2,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x1e7df2=_[_0x3757('0x3')](_0x1e7df2,require(_0x3757('0x2d')));_0x1e7df2=_[_0x3757('0x3')](_0x1e7df2,require(_0x3757('0x2e')));_0x1e7df2=_[_0x3757('0x3')](_0x1e7df2,require(_0x3757('0x2f')));var _0x1ff92e=jayson['server'](_0x1e7df2)[_0x3757('0x30')]();var _0x1f141f=config['rpc'][_0x3757('0x31')]||config['port']+0x1;var _0xd11f16=config[_0x3757('0x32')]['ip']||'localhost';_0x1ff92e['on'](_0x3757('0x33'),function(_0x22aed8){return _0x5ea6a8(_0x22aed8);});_0x1ff92e[_0x3757('0x2')](_0x1f141f,_0xd11f16,function(){console[_0x3757('0x34')](_0x3757('0x35'),_0xd11f16,_0x1f141f);require(_0x3757('0x36'))['default']();return _0x367a5c(_0x3757('0x37')+_0xd11f16+':'+_0x1f141f);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 7fc81ed..63fd197 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 _0x13c8=['join','setContext','SET\x20CONTEXT\x20%s','setExtension','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','toString','SAY\x20DIGITS\x20%s\x20%s','continueAt','extension','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','streamFile','agi','AGI','wait','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','./error','call','setEncoding','utf8','setTimeout','headers','emit','ready','toLowerCase','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','replace','substr','indexOf','startsWith','length','error','E_AGI_SOCKET_ERROR','code','close','timeout','E_AGI_SOCKET_TIMEOUT','command','destroy','inherits','prototype','sendRequest','ANSWER','getData','beep','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','exec','isArray','format','EXEC\x20%s\x20%s'];(function(_0x313381,_0x4ff5d9){var _0x4ea7ae=function(_0x11fda2){while(--_0x11fda2){_0x313381['push'](_0x313381['shift']());}};_0x4ea7ae(++_0x4ff5d9);}(_0x13c8,0xa0));var _0x813c=function(_0x5471ec,_0x1ce81a){_0x5471ec=_0x5471ec-0x0;var _0x121d4c=_0x13c8[_0x5471ec];return _0x121d4c;};'use strict';var util=require(_0x813c('0x0'));var _=require(_0x813c('0x1'));var EventEmitter=require(_0x813c('0x2'))['EventEmitter'];var AGIReply=require('./reply');var AGIError=require(_0x813c('0x3'));function AGIChannel(_0x1838fc){var _0x193021=this,_0x267c0b=new AGIReply(),_0x542451=![],_0x52f03f={};EventEmitter[_0x813c('0x4')](_0x193021);_0x1838fc[_0x813c('0x5')](_0x813c('0x6'));_0x1838fc[_0x813c('0x7')](0x8*0x3c*0x3c*0x3e8);_0x267c0b[_0x813c('0x5')](_0x813c('0x6'));_0x267c0b['on'](_0x813c('0x8'),function(_0x3b7af0){for(var _0x3d2d16 in _0x3b7af0){_0x193021[_0x3d2d16]=_0x3b7af0[_0x3d2d16];}_0x193021[_0x813c('0x9')](_0x813c('0xa'));});_0x267c0b['on']('line',function(_0x12bfa9){if(_0x12bfa9[_0x813c('0xb')]()==_0x813c('0xc')){_0x193021[_0x813c('0x9')](_0x813c('0xc'));return;}if(_0x12bfa9[_0x813c('0xd')](0x0,0xb)==_0x813c('0xe')){_0x542451=!![];}if(_0x542451){_0x52f03f['rx']+=_0x12bfa9+'\x0a';if(_0x12bfa9[_0x813c('0xf')](_0x813c('0x10'))!=-0x1){_0x542451=![];}}else{_0x52f03f['rx']=_0x12bfa9;}if(_0x542451){return;}if(typeof _0x52f03f['cb']==_0x813c('0x11')){var _0x41de68=_0x52f03f['rx'][_0x813c('0xd')](0x0,0x3),_0x4d5e23=null,_0x3a7ca5=null;_0x41de68=parseInt(_0x41de68);if(isNaN(_0x41de68)){_0x52f03f['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x41de68!=0xc8){_0x52f03f['cb'](null,{'code':_0x41de68,'result':-0x1,'extra':'KO'});return;}_0x4d5e23=_0x52f03f['rx']['substring'](0x4)[_0x813c('0x12')]('result=','');if(_0x4d5e23['indexOf']('\x20')!=-0x1){_0x4d5e23=_0x4d5e23[_0x813c('0x13')](0x0,_0x4d5e23[_0x813c('0x14')]('\x20'));}if(_[_0x813c('0x15')](_0x4d5e23,'-1')){_0x4d5e23=parseInt(_0x4d5e23);}_0x3a7ca5=_0x52f03f['rx']['split']('\x20');if(_0x3a7ca5['length']==0x3){_0x3a7ca5=_0x3a7ca5[0x2][_0x813c('0xd')](0x1,_0x3a7ca5[0x2][_0x813c('0x16')]-0x1);}else if(_0x3a7ca5[_0x813c('0x16')]>0x3){var _0x46e47c=/\((.+)\)/;var _0x1a1f50=_0x52f03f['rx']['match'](_0x46e47c);if(_0x1a1f50){_0x3a7ca5=_0x1a1f50[0x1];}else{_0x3a7ca5=null;}}else{_0x3a7ca5=null;}_0x52f03f['cb'](null,{'code':_0x41de68,'result':_0x4d5e23,'extra':_0x3a7ca5});}});_0x1838fc['on'](_0x813c('0x17'),function(_0x29e2e7){_0x193021[_0x813c('0x9')]('error',new AGIError(_0x813c('0x18'),_0x29e2e7[_0x813c('0x19')]));});_0x1838fc['on'](_0x813c('0x1a'),function(){_0x193021[_0x813c('0x9')](_0x813c('0x1a'),new AGIError('E_AGI_SOCKET_CLOSE'));});_0x1838fc['on'](_0x813c('0x1b'),function(){_0x193021[_0x813c('0x9')](_0x813c('0x1b'),new AGIError(_0x813c('0x1c')));_0x1838fc['destroy']();});_0x1838fc['pipe'](_0x267c0b);this[_0x813c('0x1d')]=function(_0xb8a96d,_0xed31e4){var _0xb8a96d=_0xb8a96d||'',_0xed31e4=typeof _0xed31e4=='function'?_0xed31e4:new Function();_0x52f03f={'tx':_0xb8a96d,'rx':'','cb':_0xed31e4};_0x1838fc['write'](_0xb8a96d+'\x0a');},this[_0x813c('0x1a')]=function(){_0x1838fc[_0x813c('0x1e')]();};}util[_0x813c('0x1f')](AGIChannel,EventEmitter);AGIChannel[_0x813c('0x20')]['sendRequest']=function(_0x23c72f){return this['command']['sync'](this,_0x23c72f);};AGIChannel['prototype']['answer']=function(){return this[_0x813c('0x21')](_0x813c('0x22'));};AGIChannel[_0x813c('0x20')][_0x813c('0x23')]=function(_0x5ddcf4,_0x4e678d,_0x2eaf90){_0x5ddcf4=_0x5ddcf4===undefined?_0x813c('0x24'):_0x5ddcf4;_0x4e678d=_0x4e678d===undefined?'5':_0x4e678d;_0x2eaf90=_0x2eaf90===undefined?'1':_0x2eaf90;return this[_0x813c('0x21')](util['format'](_0x813c('0x25'),_0x5ddcf4,_0x4e678d*0x3e8,_0x2eaf90));};AGIChannel[_0x813c('0x20')][_0x813c('0x26')]=function(_0x2cec99){_0x2cec99=_0x2cec99||_0x813c('0x27');return this[_0x813c('0x21')](util['format']('VERBOSE\x20\x22%s\x22',_0x2cec99));};AGIChannel[_0x813c('0x20')][_0x813c('0x28')]=function(_0x41d8c7,_0x13c4fa){if(_[_0x813c('0x29')](_0x13c4fa)){return this[_0x813c('0x21')](util[_0x813c('0x2a')](_0x813c('0x2b'),_0x41d8c7,_0x13c4fa[_0x813c('0x2c')](',')));}return this[_0x813c('0x21')](util[_0x813c('0x2a')](_0x813c('0x2b'),_0x41d8c7,_0x13c4fa));};AGIChannel[_0x813c('0x20')][_0x813c('0x2d')]=function(_0x3087b1){return this[_0x813c('0x21')](util['format'](_0x813c('0x2e'),_0x3087b1));};AGIChannel[_0x813c('0x20')][_0x813c('0x2f')]=function(_0x5bb74c){return this[_0x813c('0x21')](util['format']('SET\x20EXTENSION\x20%s',_0x5bb74c));};AGIChannel[_0x813c('0x20')][_0x813c('0x30')]=function(_0xbf0657){return this[_0x813c('0x21')](util[_0x813c('0x2a')](_0x813c('0x31'),_0xbf0657));};AGIChannel[_0x813c('0x20')]['hangup']=function(){return this[_0x813c('0x21')](_0x813c('0x32'));};AGIChannel[_0x813c('0x20')][_0x813c('0x33')]=function(_0x41bf9e,_0x11ce0a){var _0x9c8494=_[_0x813c('0x34')](_0x11ce0a)||_[_0x813c('0x35')](_0x11ce0a)?_0x11ce0a[_0x813c('0x36')]():_0x11ce0a;return this[_0x813c('0x21')](util['format']('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x41bf9e,_0x9c8494?_0x9c8494[_0x813c('0x36')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x813c('0x20')]['sayNumber']=function(_0x2e4331,_0x43592c){return this['sendRequest'](util[_0x813c('0x2a')]('SAY\x20NUMBER\x20%s\x20%s',_0x2e4331,_0x43592c));};AGIChannel['prototype']['sayDigits']=function(_0x2e5cc9,_0x1a9762){return this[_0x813c('0x21')](util[_0x813c('0x2a')](_0x813c('0x37'),_0x2e5cc9,_0x1a9762));};AGIChannel[_0x813c('0x20')]['sayPhonetic']=function(_0x261ecf,_0x41f992){return this[_0x813c('0x21')](util[_0x813c('0x2a')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x261ecf,_0x41f992));};AGIChannel[_0x813c('0x20')][_0x813c('0x38')]=function(_0x666ef9,_0x2b4078,_0x4d6cd2){_0x2b4078=_0x2b4078||this[_0x813c('0x39')];_0x4d6cd2=_0x4d6cd2||0x1;this[_0x813c('0x2d')](_0x666ef9);this[_0x813c('0x2f')](_0x2b4078);this['setPriority'](_0x4d6cd2);return this['noop'](util[_0x813c('0x2a')]('GOTO\x20%s\x20%s\x20%s',_0x666ef9,_0x2b4078,_0x4d6cd2));};AGIChannel['prototype'][_0x813c('0x3a')]=function(_0x553a15){return this[_0x813c('0x21')](util[_0x813c('0x2a')](_0x813c('0x3b'),_0x553a15));};AGIChannel[_0x813c('0x20')][_0x813c('0x3c')]=function(_0x61b51a,_0x29efae,_0x56d040,_0x126c4e,_0x1a4be9,_0x5c59aa){_0x29efae=_0x29efae||'wav';_0x56d040=_0x56d040||'';_0x126c4e=_0x126c4e===undefined?-0x1:_0x126c4e==='-1'?-0x1:_0x126c4e*0x3e8;_0x1a4be9=_0x1a4be9===undefined?'':'s='+_0x1a4be9;_0x5c59aa=_0x5c59aa?'BEEP':'';return this[_0x813c('0x21')](util['format']('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x61b51a,_0x29efae,_0x56d040,_0x126c4e,_0x5c59aa,_0x1a4be9));};AGIChannel[_0x813c('0x20')][_0x813c('0x3d')]=function(_0x3e40d2,_0x6b9ab4){_0x6b9ab4=_0x6b9ab4||'';return this[_0x813c('0x21')](util[_0x813c('0x2a')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x3e40d2,_0x6b9ab4));};AGIChannel[_0x813c('0x20')][_0x813c('0x3e')]=function(_0x14b34b){return this[_0x813c('0x28')](_0x813c('0x3f'),_0x14b34b);};AGIChannel[_0x813c('0x20')][_0x813c('0x40')]=function(_0x35c7c4){return this[_0x813c('0x28')]('WAIT',_0x35c7c4);};AGIChannel[_0x813c('0x20')]['error']=function(_0x5df684,_0x5ba577){this['noop'](util[_0x813c('0x2a')](_0x813c('0x41'),_0x5df684['id'],_0x5df684[_0x813c('0x42')],_0x5ba577));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x813c('0x43')]=AGIChannel; \ No newline at end of file +var _0xdbb1=['destroy','pipe','command','function','write','inherits','prototype','sendRequest','sync','beep','format','noop','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','HANGUP','setVariable','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','extension','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','util','./reply','utf8','setTimeout','setEncoding','ready','line','toLowerCase','hangup','emit','substring','520-Invalid','search','520\x20End\x20of\x20proper','replace','result=','indexOf','substr','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','timeout','E_AGI_SOCKET_TIMEOUT'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0xdbb1,0x105));var _0x1dbb=function(_0x257642,_0x270a80){_0x257642=_0x257642-0x0;var _0x3d813b=_0xdbb1[_0x257642];return _0x3d813b;};'use strict';var util=require(_0x1dbb('0x0'));var _=require('lodash');var EventEmitter=require('events')['EventEmitter'];var AGIReply=require(_0x1dbb('0x1'));var AGIError=require('./error');function AGIChannel(_0x566098){var _0x395788=this,_0x483e15=new AGIReply(),_0xa1e321=![],_0xd53e45={};EventEmitter['call'](_0x395788);_0x566098['setEncoding'](_0x1dbb('0x2'));_0x566098[_0x1dbb('0x3')](0x8*0x3c*0x3c*0x3e8);_0x483e15[_0x1dbb('0x4')](_0x1dbb('0x2'));_0x483e15['on']('headers',function(_0x3ffb54){for(var _0xf42424 in _0x3ffb54){_0x395788[_0xf42424]=_0x3ffb54[_0xf42424];}_0x395788['emit'](_0x1dbb('0x5'));});_0x483e15['on'](_0x1dbb('0x6'),function(_0x1e7ac5){if(_0x1e7ac5[_0x1dbb('0x7')]()==_0x1dbb('0x8')){_0x395788[_0x1dbb('0x9')](_0x1dbb('0x8'));return;}if(_0x1e7ac5[_0x1dbb('0xa')](0x0,0xb)==_0x1dbb('0xb')){_0xa1e321=!![];}if(_0xa1e321){_0xd53e45['rx']+=_0x1e7ac5+'\x0a';if(_0x1e7ac5[_0x1dbb('0xc')](_0x1dbb('0xd'))!=-0x1){_0xa1e321=![];}}else{_0xd53e45['rx']=_0x1e7ac5;}if(_0xa1e321){return;}if(typeof _0xd53e45['cb']=='function'){var _0x425fef=_0xd53e45['rx'][_0x1dbb('0xa')](0x0,0x3),_0x28c292=null,_0x332380=null;_0x425fef=parseInt(_0x425fef);if(isNaN(_0x425fef)){_0xd53e45['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x425fef!=0xc8){_0xd53e45['cb'](null,{'code':_0x425fef,'result':-0x1,'extra':'KO'});return;}_0x28c292=_0xd53e45['rx']['substring'](0x4)[_0x1dbb('0xe')](_0x1dbb('0xf'),'');if(_0x28c292[_0x1dbb('0x10')]('\x20')!=-0x1){_0x28c292=_0x28c292[_0x1dbb('0x11')](0x0,_0x28c292[_0x1dbb('0x10')]('\x20'));}if(_['startsWith'](_0x28c292,'-1')){_0x28c292=parseInt(_0x28c292);}_0x332380=_0xd53e45['rx'][_0x1dbb('0x12')]('\x20');if(_0x332380[_0x1dbb('0x13')]==0x3){_0x332380=_0x332380[0x2][_0x1dbb('0xa')](0x1,_0x332380[0x2]['length']-0x1);}else if(_0x332380[_0x1dbb('0x13')]>0x3){var _0x363224=/\((.+)\)/;var _0x5e78bd=_0xd53e45['rx'][_0x1dbb('0x14')](_0x363224);if(_0x5e78bd){_0x332380=_0x5e78bd[0x1];}else{_0x332380=null;}}else{_0x332380=null;}_0xd53e45['cb'](null,{'code':_0x425fef,'result':_0x28c292,'extra':_0x332380});}});_0x566098['on'](_0x1dbb('0x15'),function(_0x98b8d2){_0x395788[_0x1dbb('0x9')](_0x1dbb('0x15'),new AGIError(_0x1dbb('0x16'),_0x98b8d2[_0x1dbb('0x17')]));});_0x566098['on'](_0x1dbb('0x18'),function(){_0x395788['emit']('close',new AGIError('E_AGI_SOCKET_CLOSE'));});_0x566098['on'](_0x1dbb('0x19'),function(){_0x395788[_0x1dbb('0x9')]('timeout',new AGIError(_0x1dbb('0x1a')));_0x566098[_0x1dbb('0x1b')]();});_0x566098[_0x1dbb('0x1c')](_0x483e15);this[_0x1dbb('0x1d')]=function(_0x33bf12,_0x3ddd80){var _0x33bf12=_0x33bf12||'',_0x3ddd80=typeof _0x3ddd80==_0x1dbb('0x1e')?_0x3ddd80:new Function();_0xd53e45={'tx':_0x33bf12,'rx':'','cb':_0x3ddd80};_0x566098[_0x1dbb('0x1f')](_0x33bf12+'\x0a');},this[_0x1dbb('0x18')]=function(){_0x566098[_0x1dbb('0x1b')]();};}util[_0x1dbb('0x20')](AGIChannel,EventEmitter);AGIChannel[_0x1dbb('0x21')][_0x1dbb('0x22')]=function(_0x3dd89e){return this[_0x1dbb('0x1d')][_0x1dbb('0x23')](this,_0x3dd89e);};AGIChannel[_0x1dbb('0x21')]['answer']=function(){return this[_0x1dbb('0x22')]('ANSWER');};AGIChannel[_0x1dbb('0x21')]['getData']=function(_0x72cfed,_0x27fd18,_0x346372){_0x72cfed=_0x72cfed===undefined?_0x1dbb('0x24'):_0x72cfed;_0x27fd18=_0x27fd18===undefined?'5':_0x27fd18;_0x346372=_0x346372===undefined?'1':_0x346372;return this[_0x1dbb('0x22')](util[_0x1dbb('0x25')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x72cfed,_0x27fd18*0x3e8,_0x346372));};AGIChannel[_0x1dbb('0x21')][_0x1dbb('0x26')]=function(_0x2c2b99){_0x2c2b99=_0x2c2b99||'NO\x20MESSAGE';return this['sendRequest'](util[_0x1dbb('0x25')]('VERBOSE\x20\x22%s\x22',_0x2c2b99));};AGIChannel['prototype'][_0x1dbb('0x27')]=function(_0x27c844,_0x4511b3){if(_[_0x1dbb('0x28')](_0x4511b3)){return this[_0x1dbb('0x22')](util[_0x1dbb('0x25')](_0x1dbb('0x29'),_0x27c844,_0x4511b3[_0x1dbb('0x2a')](',')));}return this[_0x1dbb('0x22')](util['format']('EXEC\x20%s\x20%s',_0x27c844,_0x4511b3));};AGIChannel[_0x1dbb('0x21')][_0x1dbb('0x2b')]=function(_0xc3bab){return this['sendRequest'](util['format'](_0x1dbb('0x2c'),_0xc3bab));};AGIChannel[_0x1dbb('0x21')][_0x1dbb('0x2d')]=function(_0x4a90db){return this['sendRequest'](util[_0x1dbb('0x25')](_0x1dbb('0x2e'),_0x4a90db));};AGIChannel['prototype'][_0x1dbb('0x2f')]=function(_0x15d934){return this[_0x1dbb('0x22')](util[_0x1dbb('0x25')]('SET\x20PRIORITY\x20%s',_0x15d934));};AGIChannel[_0x1dbb('0x21')][_0x1dbb('0x8')]=function(){return this[_0x1dbb('0x22')](_0x1dbb('0x30'));};AGIChannel[_0x1dbb('0x21')][_0x1dbb('0x31')]=function(_0x4ec39a,_0x5a9c2){var _0x7b7bb2=_['isBoolean'](_0x5a9c2)||_[_0x1dbb('0x32')](_0x5a9c2)?_0x5a9c2[_0x1dbb('0x33')]():_0x5a9c2;return this[_0x1dbb('0x22')](util[_0x1dbb('0x25')](_0x1dbb('0x34'),_0x4ec39a,_0x7b7bb2?_0x7b7bb2['toString']()[_0x1dbb('0xe')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x1dbb('0x21')][_0x1dbb('0x35')]=function(_0x32b891,_0x15aed6){return this[_0x1dbb('0x22')](util['format'](_0x1dbb('0x36'),_0x32b891,_0x15aed6));};AGIChannel[_0x1dbb('0x21')]['sayDigits']=function(_0xb5c6ae,_0x41a81b){return this[_0x1dbb('0x22')](util[_0x1dbb('0x25')](_0x1dbb('0x37'),_0xb5c6ae,_0x41a81b));};AGIChannel[_0x1dbb('0x21')][_0x1dbb('0x38')]=function(_0x2356e6,_0xd5c225){return this[_0x1dbb('0x22')](util[_0x1dbb('0x25')](_0x1dbb('0x39'),_0x2356e6,_0xd5c225));};AGIChannel[_0x1dbb('0x21')]['continueAt']=function(_0x1b94ab,_0x142c74,_0x114ae4){_0x142c74=_0x142c74||this[_0x1dbb('0x3a')];_0x114ae4=_0x114ae4||0x1;this[_0x1dbb('0x2b')](_0x1b94ab);this[_0x1dbb('0x2d')](_0x142c74);this[_0x1dbb('0x2f')](_0x114ae4);return this[_0x1dbb('0x26')](util[_0x1dbb('0x25')](_0x1dbb('0x3b'),_0x1b94ab,_0x142c74,_0x114ae4));};AGIChannel[_0x1dbb('0x21')][_0x1dbb('0x3c')]=function(_0x139cb4){return this['sendRequest'](util[_0x1dbb('0x25')](_0x1dbb('0x3d'),_0x139cb4));};AGIChannel[_0x1dbb('0x21')][_0x1dbb('0x3e')]=function(_0x5db5fc,_0x3fa964,_0x2b3b1b,_0x12c16b,_0xf73796,_0x33b14f){_0x3fa964=_0x3fa964||_0x1dbb('0x3f');_0x2b3b1b=_0x2b3b1b||'';_0x12c16b=_0x12c16b===undefined?-0x1:_0x12c16b==='-1'?-0x1:_0x12c16b*0x3e8;_0xf73796=_0xf73796===undefined?'':'s='+_0xf73796;_0x33b14f=_0x33b14f?_0x1dbb('0x40'):'';return this[_0x1dbb('0x22')](util['format'](_0x1dbb('0x41'),_0x5db5fc,_0x3fa964,_0x2b3b1b,_0x12c16b,_0x33b14f,_0xf73796));};AGIChannel[_0x1dbb('0x21')][_0x1dbb('0x42')]=function(_0xe8f289,_0x11237e){_0x11237e=_0x11237e||'';return this[_0x1dbb('0x22')](util['format'](_0x1dbb('0x43'),_0xe8f289,_0x11237e));};AGIChannel['prototype'][_0x1dbb('0x44')]=function(_0xa2942d){return this['exec'](_0x1dbb('0x45'),_0xa2942d);};AGIChannel[_0x1dbb('0x21')][_0x1dbb('0x46')]=function(_0x13972d){return this[_0x1dbb('0x27')]('WAIT',_0x13972d);};AGIChannel[_0x1dbb('0x21')][_0x1dbb('0x15')]=function(_0x1406a4,_0x436b78){this[_0x1dbb('0x26')](util['format'](_0x1dbb('0x47'),_0x1406a4['id'],_0x1406a4['label'],_0x436b78));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index abaedaf..cc965e2 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 _0xff81=['message','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','push','apply'];(function(_0x3d2c0f,_0x6140ac){var _0x3ec6b4=function(_0x41e1a1){while(--_0x41e1a1){_0x3d2c0f['push'](_0x3d2c0f['shift']());}};_0x3ec6b4(++_0x6140ac);}(_0xff81,0x1b4));var _0x1ff8=function(_0x4c5c97,_0x4f85bf){_0x4c5c97=_0x4c5c97-0x0;var _0xd5d2cb=_0xff81[_0x4c5c97];return _0xd5d2cb;};'use strict';var util=require(_0x1ff8('0x0'));var error={'E_AGI_UNDEFINED':_0x1ff8('0x1'),'E_AGI_ARGUMENT_PORT':_0x1ff8('0x2'),'E_AGI_SERVER_ERROR':_0x1ff8('0x3'),'E_AGI_SERVER_CLOSE':_0x1ff8('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0x1ff8('0x5'),'E_AGI_SERVER_VOICE_DISABLED':_0x1ff8('0x6'),'E_AGI_SOCKET_ERROR':_0x1ff8('0x7'),'E_AGI_SOCKET_CLOSE':_0x1ff8('0x8'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0x1ff8('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x1ff8('0xa'),'E_AGI_IVR_ENTRY':_0x1ff8('0xb')};function AGIError(_0x206746){var _0x206746=_0x206746||null,_0x337a88=_0x337a88||[],_0x2a23a2=0x1,_0x10a164='';if(!error[_0x206746]){_0x206746='E_AGI_UNDEFINED';}_0x337a88[_0x1ff8('0xc')](error[_0x206746]);while(arguments[_0x2a23a2]){_0x337a88['push'](arguments[_0x2a23a2]);_0x2a23a2++;}_0x10a164=util['format'][_0x1ff8('0xd')](util,_0x337a88);this[_0x1ff8('0xe')]=_0x10a164;this['name']=_0x206746;}module['exports']=AGIError; \ No newline at end of file +var _0x9826=['Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply','message','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.'];(function(_0x55e9e9,_0x1afc74){var _0x39cb0c=function(_0x4c02f3){while(--_0x4c02f3){_0x55e9e9['push'](_0x55e9e9['shift']());}};_0x39cb0c(++_0x1afc74);}(_0x9826,0x114));var _0x6982=function(_0x4426c0,_0x20725b){_0x4426c0=_0x4426c0-0x0;var _0x508ace=_0x9826[_0x4426c0];return _0x508ace;};'use strict';var util=require(_0x6982('0x0'));var error={'E_AGI_UNDEFINED':_0x6982('0x1'),'E_AGI_ARGUMENT_PORT':_0x6982('0x2'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0x6982('0x3'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0x6982('0x4'),'E_AGI_SOCKET_CLOSE':_0x6982('0x5'),'E_AGI_SOCKET_TIMEOUT':_0x6982('0x6'),'E_AGI_COMMAND_EMPTY':_0x6982('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x6982('0x8'),'E_AGI_IVR_ENTRY':_0x6982('0x9')};function AGIError(_0x4343d4){var _0x4343d4=_0x4343d4||null,_0x223b2b=_0x223b2b||[],_0x58d4c6=0x1,_0x1155ae='';if(!error[_0x4343d4]){_0x4343d4=_0x6982('0xa');}_0x223b2b[_0x6982('0xb')](error[_0x4343d4]);while(arguments[_0x58d4c6]){_0x223b2b[_0x6982('0xb')](arguments[_0x58d4c6]);_0x58d4c6++;}_0x1155ae=util[_0x6982('0xc')][_0x6982('0xd')](util,_0x223b2b);this[_0x6982('0xe')]=_0x1155ae;this['name']=_0x4343d4;}module['exports']=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 150364b..8fa6eb5 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 _0xba87=['vertices','edges','numberOfEdges','addVertex','prototype','addEdge','push','size','relations','getVertex','traverseBFS','no\x20vertex\x20found','info','stop\x20traverse','length','condition','agicommand','vswitch','default','target','invalid','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','agi','menu','getdigits'];(function(_0x303e2c,_0x4aafae){var _0x400cd7=function(_0x1561ce){while(--_0x1561ce){_0x303e2c['push'](_0x303e2c['shift']());}};_0x400cd7(++_0x4aafae);}(_0xba87,0x92));var _0x7ba8=function(_0x228800,_0x1a89fe){_0x228800=_0x228800-0x0;var _0x5383f9=_0xba87[_0x228800];return _0x5383f9;};'use strict';var _=require(_0x7ba8('0x0'));var logger=require('../../../config/logger')(_0x7ba8('0x1'));var verticesWithRetry=[_0x7ba8('0x2'),_0x7ba8('0x3'),'getsecretdigits'];var Graph=function(){this[_0x7ba8('0x4')]={};this[_0x7ba8('0x5')]={};this[_0x7ba8('0x6')]=0x0;};Graph['prototype'][_0x7ba8('0x7')]=function(_0x5e31c1){this[_0x7ba8('0x4')][_0x5e31c1['id']]=_0x5e31c1;this[_0x7ba8('0x5')][_0x5e31c1['id']]=[];};Graph[_0x7ba8('0x8')][_0x7ba8('0x9')]=function(_0x3522be,_0x5ed38a,_0x4f7372){this[_0x7ba8('0x5')][_0x3522be][_0x7ba8('0xa')]({'target':_0x5ed38a,'condition':_0x4f7372});this[_0x7ba8('0x6')]+=0x1;};Graph[_0x7ba8('0x8')][_0x7ba8('0xb')]=function(){return _[_0x7ba8('0xb')](this[_0x7ba8('0x4')]);};Graph[_0x7ba8('0x8')][_0x7ba8('0xc')]=function(){return this[_0x7ba8('0x6')];};Graph[_0x7ba8('0x8')][_0x7ba8('0xd')]=function(_0x15430f){return this[_0x7ba8('0x4')][_0x15430f];};Graph['prototype'][_0x7ba8('0xe')]=function(_0x40586d,_0x44c8e0){if(!this[_0x7ba8('0x4')][_0x40586d]){return logger['info'](_0x7ba8('0xf'));}var _0x6a9f5d=_0x44c8e0(this[_0x7ba8('0x4')][_0x40586d]);if(!_0x6a9f5d){return logger[_0x7ba8('0x10')](_0x7ba8('0x11'));}if(this[_0x7ba8('0x5')][_0x40586d][_0x7ba8('0x12')]===0x0){return logger['info']('no\x20edge/s\x20available');}for(var _0x276b98=0x0,_0x409085=[],_0x309420=![];_0x276b98\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson','mxGraphModel','root','hasOwnProperty','retry','maxRetry','omit','mxCell','source','target','addEdge','then','catch','createSquareReport','indexOf','substring','inspect','debug','stringify','close','timeout','hangup','sync','production','start','joinAt','YYYY-MM-DD\x20HH:mm:ss','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','vertex','agicommand','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','isUndefined','toString','agicommand\x20not\x20found','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','finally','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20published','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]','connection','xml2json','lodash'];(function(_0x4ee508,_0xec5ce8){var _0x37981d=function(_0x3b857c){while(--_0x3b857c){_0x4ee508['push'](_0x4ee508['shift']());}};_0x37981d(++_0xec5ce8);}(_0xe64d,0x15a));var _0xde64=function(_0x4cbf20,_0x1bfa66){_0x4cbf20=_0x4cbf20-0x0;var _0x582ae4=_0xe64d[_0x4cbf20];return _0x582ae4;};'use strict';var parser=require(_0xde64('0x0'));var _=require(_0xde64('0x1'));var syncho=require('syncho');var util=require(_0xde64('0x2'));var moment=require(_0xde64('0x3'));var config=require(_0xde64('0x4'));var logger=require('../../config/logger')(_0xde64('0x5'));var utilLicense=require(_0xde64('0x6'));var rpc=require(_0xde64('0x7'));var mailRpc=require(_0xde64('0x8'));var Graph=require(_0xde64('0x9'));var Vertices=require(_0xde64('0xa'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xde64('0x5')]=_[_0xde64('0xb')](config[_0xde64('0x5')],{'ip':'127.0.0.1','port':0x11dd});function connectionHandler(_0x41a920){process[_0xde64('0xc')](function(){syncho(function(){try{setChannelVariables(_0x41a920);agiHandler(_0x41a920);}catch(_0x4517d5){logger[_0xde64('0xd')](_0x4517d5[_0xde64('0xe')]);}});});}function listeningHandler(){console[_0xde64('0xf')](_0xde64('0x10'),config[_0xde64('0x5')][_0xde64('0x11')]);logger[_0xde64('0x12')](util[_0xde64('0x13')](_0xde64('0x14'),config[_0xde64('0x5')]['ip'],config[_0xde64('0x5')]['port']));}function errorHandler(_0x4ba85b){if(_0x4ba85b&&_0x4ba85b[_0xde64('0x15')]&&_0x4ba85b['message']){logger[_0xde64('0xd')](util[_0xde64('0x13')](_0xde64('0x16'),_0x4ba85b[_0xde64('0x15')],_0x4ba85b[_0xde64('0x17')]));}else{logger[_0xde64('0xd')](util[_0xde64('0x13')]('[ERROR]\x20%s',_0x4ba85b[_0xde64('0xe')]));}}function closeHandler(){logger['info'](util[_0xde64('0x13')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xde64('0x18')],this[_0xde64('0x19')],this[_0xde64('0x1a')],this['dnid'],this[_0xde64('0x1b')]));try{createSquareReport(this);}catch(_0xd12e81){logger[_0xde64('0xd')](_0xd12e81[_0xde64('0xe')]);}}function timeoutHandler(){logger['info'](util[_0xde64('0x13')](_0xde64('0x1c'),this[_0xde64('0x18')],this['calleridname'],this[_0xde64('0x1a')],this[_0xde64('0x1d')],this['uniqueid']));}function hangupHandler(){logger['info'](util[_0xde64('0x13')](_0xde64('0x1e'),this[_0xde64('0x18')],this['calleridname'],this['callerid'],this[_0xde64('0x1d')],this[_0xde64('0x1b')]));this[_0xde64('0x1f')]=!![];}function getRoot(_0x315f9b){return parser[_0xde64('0x20')](_0x315f9b,{'object':!![]})[_0xde64('0x21')][_0xde64('0x22')];}function addVertex(_0x2917bb,_0x18b72f,_0x3c8746){_0x18b72f['agicommand']=_0x3c8746;if(_0x18b72f[_0xde64('0x23')](_0xde64('0x24'))){_0x18b72f[_0xde64('0x25')]=parseInt(_0x18b72f[_0xde64('0x24')],0xa);}_0x2917bb['addVertex'](_[_0xde64('0x26')](_0x18b72f,_0xde64('0x27')));}function initGraph(_0x49d665,_0x72cf02){var _0x4eea68=new Graph();for(var _0x5c8ca8 in _0x49d665){if(_0x49d665['hasOwnProperty'](_0x5c8ca8)){if(_['isArray'](_0x49d665[_0x5c8ca8])){for(var _0x558940=0x0;_0x558940<_0x49d665[_0x5c8ca8]['length'];_0x558940+=0x1){addVertex(_0x4eea68,_0x49d665[_0x5c8ca8][_0x558940],_0x5c8ca8);}}else{addVertex(_0x4eea68,_0x49d665[_0x5c8ca8],_0x5c8ca8);}}}for(var _0x517920=0x0;_0x517920<_0x72cf02['length'];_0x517920+=0x1){if(_0x72cf02[_0x517920][_0xde64('0x28')]&&_0x72cf02[_0x517920][_0xde64('0x29')]){_0x4eea68[_0xde64('0x2a')](_0x72cf02[_0x517920][_0xde64('0x28')],_0x72cf02[_0x517920][_0xde64('0x29')],_0x72cf02[_0x517920]['value']);}}return _0x4eea68;}function getSquareProject(_0x23a6b9,_0x437914){rpc['getSquareProject'](_0x23a6b9)[_0xde64('0x2b')](function(_0x4cc596){_0x437914(null,_0x4cc596);})[_0xde64('0x2c')](function(_0x32d6b7){_0x437914(null,_0x32d6b7);});}function createSquareReport(_0x3a5d14,_0x44792f){rpc[_0xde64('0x2d')](_0x3a5d14)['then'](function(_0x465d4a){if(_0x44792f){_0x44792f(null,_0x465d4a);}})[_0xde64('0x2c')](function(_0x1dc47f){if(_0x44792f){_0x44792f(null,_0x1dc47f);}});}function setChannelVariables(_0x4fea35){for(var _0x557700 in _0x4fea35){if(_0x4fea35[_0xde64('0x23')](_0x557700)){if(_0x557700[_0xde64('0x2e')]('agi_')===0x0){_0x4fea35[_0x557700[_0xde64('0x2f')](0x4)]=_0x4fea35[_0x557700];delete _0x4fea35[_0x557700];}}}}function getLogFromObject(_0xab79a3){return util[_0xde64('0x30')](_0xab79a3,{'showHidden':![],'depth':null});}function agiHandler(_0x3b1eaa){var _0xc77e00,_0x183052,_0x5a3dd3,_0x1dbf58,_0x2bed03;logger[_0xde64('0x31')]('variables',JSON[_0xde64('0x32')](_0x3b1eaa,null,0x2));logger[_0xde64('0x12')](util[_0xde64('0x13')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x3b1eaa['arg_1'],_0x3b1eaa[_0xde64('0x19')],_0x3b1eaa['callerid'],_0x3b1eaa['dnid'],_0x3b1eaa[_0xde64('0x1b')]));_0x3b1eaa['on'](_0xde64('0xd'),errorHandler);_0x3b1eaa['on'](_0xde64('0x33'),closeHandler);_0x3b1eaa['on'](_0xde64('0x34'),timeoutHandler);_0x3b1eaa[_0xde64('0x1f')]=![];_0x3b1eaa['on'](_0xde64('0x35'),hangupHandler);var _0xef3b8c=getSquareProject[_0xde64('0x36')](null,_0x3b1eaa[_0xde64('0x18')]);if(_0xef3b8c){if(_0xef3b8c[_0xde64('0x37')]){_0xc77e00=getRoot(_0xef3b8c[_0xde64('0x37')]);if(_0xc77e00&&_0xc77e00[_0xde64('0x38')]){logger['debug'](_0xde64('0x22'),JSON[_0xde64('0x32')](_0xc77e00,null,0x2));_0x3b1eaa[_0xde64('0x39')]=moment()['format'](_0xde64('0x3a'));_0x183052=initGraph(_[_0xde64('0x26')](_0xc77e00,'mxCell'),_0xc77e00['mxCell']);_0x5a3dd3=new Vertices(_0x3b1eaa,rpc,mailRpc);logger['info'](util[_0xde64('0x13')](_0xde64('0x3b'),_0x3b1eaa['arg_1'],_0x3b1eaa['calleridname'],_0x3b1eaa[_0xde64('0x1a')],_0x3b1eaa[_0xde64('0x1d')],_0x3b1eaa['uniqueid']));_0x183052[_0xde64('0x3c')](_0xc77e00[_0xde64('0x38')]['id'],function(_0x27e19a){try{_0x27e19a=_0x5a3dd3[_0xde64('0x3d')](_0x27e19a);logger[_0xde64('0x31')](_0xde64('0x3e'),JSON[_0xde64('0x32')](_0x27e19a,null,0x2));if(_0x27e19a[_0xde64('0x3f')]===_0xde64('0x40')){logger[_0xde64('0x12')](_0xde64('0x41'));_0x3b1eaa['context']=_0x27e19a[_0xde64('0x42')]||_0x3b1eaa['context'];_0x3b1eaa[_0xde64('0x43')]=_0x27e19a[_0xde64('0x43')];_0x3b1eaa[_0xde64('0x44')]=_0x27e19a[_0xde64('0x44')]?_0x27e19a['priority']-0x1:0x1;return null;}else if(_0x27e19a&&_0x5a3dd3[_0x27e19a[_0xde64('0x3f')]]){_0x2bed03=_0x5a3dd3[_0x27e19a[_0xde64('0x3f')]](_0x27e19a);logger[_0xde64('0x12')](_0xde64('0x45'),JSON['stringify'](_0x2bed03,null,0x2));if(_0x2bed03&&_0x2bed03[_0xde64('0x46')]===AGI_CODE_SUCCESS&&_0x2bed03[_0xde64('0x47')]!==AGI_RESULT_ERROR&&!_0x3b1eaa[_0xde64('0x1f')]){logger[_0xde64('0x31')]('response',getLogFromObject(_0x2bed03));return _[_0xde64('0x48')](_0x2bed03[_0xde64('0x47')])?null:_0x2bed03['result'][_0xde64('0x49')]();}else{logger[_0xde64('0xd')](_0xde64('0x45'),getLogFromObject(_0x2bed03));return null;}}else{logger[_0xde64('0xd')](_0xde64('0x4a'));return null;}}catch(_0x372857){logger[_0xde64('0xd')](_0x372857[_0xde64('0xe')]);return null;}});if(_0xc77e00['finally']){logger[_0xde64('0x12')](util['format'](_0xde64('0x4b'),_0x3b1eaa[_0xde64('0x18')],_0x3b1eaa[_0xde64('0x19')],_0x3b1eaa[_0xde64('0x1a')],_0x3b1eaa[_0xde64('0x1d')],_0x3b1eaa[_0xde64('0x1b')]));_0x183052[_0xde64('0x3c')](_0xc77e00[_0xde64('0x4c')]['id'],function(_0x40891e){try{_0x40891e=_0x5a3dd3[_0xde64('0x3d')](_0x40891e);logger[_0xde64('0x31')](_0xde64('0x3e'),JSON[_0xde64('0x32')](_0x40891e,null,0x2));if(_0x40891e&&_0x5a3dd3[_0x40891e[_0xde64('0x3f')]]){_0x2bed03=_0x5a3dd3[_0x40891e[_0xde64('0x3f')]](_0x40891e);if(_0x2bed03){logger[_0xde64('0x31')]('response',getLogFromObject(_0x2bed03));return _['isUndefined'](_0x2bed03[_0xde64('0x47')])?null:_0x2bed03['result']['toString']();}else{logger[_0xde64('0xd')]('response',getLogFromObject(_0x2bed03));return null;}}else{logger[_0xde64('0xd')](_0xde64('0x4a'));return null;}}catch(_0x1efd51){logger[_0xde64('0xd')](_0x1efd51[_0xde64('0xe')]);return null;}});}logger[_0xde64('0x12')](util[_0xde64('0x13')](_0xde64('0x4d'),_0x3b1eaa['arg_1'],_0x3b1eaa[_0xde64('0x19')],_0x3b1eaa['callerid'],_0x3b1eaa['dnid'],_0x3b1eaa[_0xde64('0x1b')]));logger[_0xde64('0x12')](util[_0xde64('0x13')](_0xde64('0x4e'),_0x3b1eaa[_0xde64('0x42')],_0x3b1eaa[_0xde64('0x43')],parseInt(_0x3b1eaa[_0xde64('0x44')],0xa)+0x1));_0x3b1eaa[_0xde64('0x4f')](_0x3b1eaa[_0xde64('0x42')],_0x3b1eaa[_0xde64('0x43')],parseInt(_0x3b1eaa[_0xde64('0x44')],0xa)+0x1);_0x3b1eaa[_0xde64('0x33')]();}}else{logger[_0xde64('0xd')](util['format'](_0xde64('0x50'),_0x3b1eaa['arg_1']));_0x3b1eaa[_0xde64('0x4f')](_0x3b1eaa[_0xde64('0x42')],_0x3b1eaa[_0xde64('0x43')],parseInt(_0x3b1eaa[_0xde64('0x44')],0xa)+0x1);_0x3b1eaa[_0xde64('0x33')]();}}else{logger['error'](util[_0xde64('0x13')]('Project\x20%s\x20not\x20found',_0x3b1eaa[_0xde64('0x18')]));_0x3b1eaa[_0xde64('0x4f')](_0x3b1eaa['context'],_0x3b1eaa[_0xde64('0x43')],parseInt(_0x3b1eaa[_0xde64('0x44')],0xa)+0x1);_0x3b1eaa['close']();}}function main(){var _0x131d04;return utilLicense['getLicense']()['then'](function(_0x4be1a5){if(_0x4be1a5){if(_0x4be1a5[_0xde64('0x51')]){if(_0x4be1a5['callysquare']&&_0x4be1a5[_0xde64('0x52')]>0x0){logger[_0xde64('0x12')](util['format'](_0xde64('0x53'),_0x4be1a5[_0xde64('0x52')]));_0x131d04=_0x4be1a5[_0xde64('0x52')];}else{logger['info'](_0xde64('0x54'));}}else{logger[_0xde64('0x12')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x131d04=-0x1;}}})['catch'](function(_0x458d4b){logger[_0xde64('0xd')](_0xde64('0x55'),_0x458d4b[_0xde64('0xe')]);})[_0xde64('0x4c')](function(){var _0x1d8b60=require('./server')(config[_0xde64('0x5')][_0xde64('0x11')],config[_0xde64('0x5')]['ip'],_0x131d04);_0x1d8b60['on'](_0xde64('0xd'),errorHandler);_0x1d8b60['on']('listening',listeningHandler);_0x1d8b60['on'](_0xde64('0x56'),connectionHandler);_0x1d8b60['on'](_0xde64('0x33'),closeHandler);});}main(); \ No newline at end of file +var _0x1b0a=['hangup','sync','production','start','root','joinAt','YYYY-MM-DD\x20HH:mm:ss','omit','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','clear','vertex','context','extension','priority','response','code','result','isUndefined','toString','agicommand\x20not\x20found','finally','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','catch','[LICENSE]','./server','listening','xml2json','lodash','syncho','util','moment','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./mailRpc','./graph','127.0.0.1','error','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[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','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','evtHangup','toJson','mxGraphModel','agicommand','hasOwnProperty','retry','addVertex','mxCell','isArray','length','target','addEdge','source','value','getSquareProject','createSquareReport','then','agi_','substring','inspect','debug','variables','stringify','close','timeout'];(function(_0x59be41,_0x3741fb){var _0x25edd1=function(_0x1b803a){while(--_0x1b803a){_0x59be41['push'](_0x59be41['shift']());}};_0x25edd1(++_0x3741fb);}(_0x1b0a,0x138));var _0xa1b0=function(_0x4d6cff,_0x1c40cd){_0x4d6cff=_0x4d6cff-0x0;var _0x468ea2=_0x1b0a[_0x4d6cff];return _0x468ea2;};'use strict';var parser=require(_0xa1b0('0x0'));var _=require(_0xa1b0('0x1'));var syncho=require(_0xa1b0('0x2'));var util=require(_0xa1b0('0x3'));var moment=require(_0xa1b0('0x4'));var config=require(_0xa1b0('0x5'));var logger=require(_0xa1b0('0x6'))(_0xa1b0('0x7'));var utilLicense=require(_0xa1b0('0x8'));var rpc=require(_0xa1b0('0x9'));var mailRpc=require(_0xa1b0('0xa'));var Graph=require(_0xa1b0('0xb'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xa1b0('0x7')]=_['defaults'](config[_0xa1b0('0x7')],{'ip':_0xa1b0('0xc'),'port':0x11dd});function connectionHandler(_0x59b126){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x59b126);agiHandler(_0x59b126);}catch(_0x4d96d3){logger[_0xa1b0('0xd')](_0x4d96d3[_0xa1b0('0xe')]);}});});}function listeningHandler(){console[_0xa1b0('0xf')](_0xa1b0('0x10'),config[_0xa1b0('0x7')][_0xa1b0('0x11')]);logger[_0xa1b0('0x12')](util[_0xa1b0('0x13')](_0xa1b0('0x14'),config[_0xa1b0('0x7')]['ip'],config['agi']['port']));}function errorHandler(_0x186811){if(_0x186811&&_0x186811[_0xa1b0('0x15')]&&_0x186811[_0xa1b0('0x16')]){logger[_0xa1b0('0xd')](util['format']('[%s]\x20%s',_0x186811[_0xa1b0('0x15')],_0x186811[_0xa1b0('0x16')]));}else{logger['error'](util[_0xa1b0('0x13')](_0xa1b0('0x17'),_0x186811['stack']));}}function closeHandler(){logger[_0xa1b0('0x12')](util[_0xa1b0('0x13')](_0xa1b0('0x18'),this[_0xa1b0('0x19')],this[_0xa1b0('0x1a')],this[_0xa1b0('0x1b')],this['dnid'],this[_0xa1b0('0x1c')]));try{createSquareReport(this);}catch(_0x312861){logger[_0xa1b0('0xd')](_0x312861['stack']);}}function timeoutHandler(){logger[_0xa1b0('0x12')](util[_0xa1b0('0x13')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xa1b0('0x19')],this[_0xa1b0('0x1a')],this[_0xa1b0('0x1b')],this['dnid'],this[_0xa1b0('0x1c')]));}function hangupHandler(){logger[_0xa1b0('0x12')](util[_0xa1b0('0x13')](_0xa1b0('0x1d'),this[_0xa1b0('0x19')],this[_0xa1b0('0x1a')],this[_0xa1b0('0x1b')],this[_0xa1b0('0x1e')],this[_0xa1b0('0x1c')]));this[_0xa1b0('0x1f')]=!![];}function getRoot(_0x51cf30){return parser[_0xa1b0('0x20')](_0x51cf30,{'object':!![]})[_0xa1b0('0x21')]['root'];}function addVertex(_0x47332c,_0x366927,_0x33c383){_0x366927[_0xa1b0('0x22')]=_0x33c383;if(_0x366927[_0xa1b0('0x23')](_0xa1b0('0x24'))){_0x366927['maxRetry']=parseInt(_0x366927[_0xa1b0('0x24')],0xa);}_0x47332c[_0xa1b0('0x25')](_['omit'](_0x366927,_0xa1b0('0x26')));}function initGraph(_0x4b5770,_0x4f1cec){var _0x215b1e=new Graph();for(var _0x3c4900 in _0x4b5770){if(_0x4b5770[_0xa1b0('0x23')](_0x3c4900)){if(_[_0xa1b0('0x27')](_0x4b5770[_0x3c4900])){for(var _0x31bdda=0x0;_0x31bdda<_0x4b5770[_0x3c4900][_0xa1b0('0x28')];_0x31bdda+=0x1){addVertex(_0x215b1e,_0x4b5770[_0x3c4900][_0x31bdda],_0x3c4900);}}else{addVertex(_0x215b1e,_0x4b5770[_0x3c4900],_0x3c4900);}}}for(var _0x5fed5=0x0;_0x5fed5<_0x4f1cec[_0xa1b0('0x28')];_0x5fed5+=0x1){if(_0x4f1cec[_0x5fed5]['source']&&_0x4f1cec[_0x5fed5][_0xa1b0('0x29')]){_0x215b1e[_0xa1b0('0x2a')](_0x4f1cec[_0x5fed5][_0xa1b0('0x2b')],_0x4f1cec[_0x5fed5][_0xa1b0('0x29')],_0x4f1cec[_0x5fed5][_0xa1b0('0x2c')]);}}return _0x215b1e;}function getSquareProject(_0x2869f9,_0x73d5c7){rpc[_0xa1b0('0x2d')](_0x2869f9)['then'](function(_0x806590){_0x73d5c7(null,_0x806590);})['catch'](function(_0x4b0175){_0x73d5c7(null,_0x4b0175);});}function createSquareReport(_0x2c1dd9,_0x1b0369){rpc[_0xa1b0('0x2e')](_0x2c1dd9)[_0xa1b0('0x2f')](function(_0x54ba8d){if(_0x1b0369){_0x1b0369(null,_0x54ba8d);}})['catch'](function(_0x336a08){if(_0x1b0369){_0x1b0369(null,_0x336a08);}});}function setChannelVariables(_0x1f1f17){for(var _0x1b4d1e in _0x1f1f17){if(_0x1f1f17[_0xa1b0('0x23')](_0x1b4d1e)){if(_0x1b4d1e['indexOf'](_0xa1b0('0x30'))===0x0){_0x1f1f17[_0x1b4d1e[_0xa1b0('0x31')](0x4)]=_0x1f1f17[_0x1b4d1e];delete _0x1f1f17[_0x1b4d1e];}}}}function getLogFromObject(_0x489ee1){return util[_0xa1b0('0x32')](_0x489ee1,{'showHidden':![],'depth':null});}function agiHandler(_0x4dbe36){var _0x14476c,_0x351064,_0x155e14,_0x1d0f1b,_0x5434a9;logger[_0xa1b0('0x33')](_0xa1b0('0x34'),JSON[_0xa1b0('0x35')](_0x4dbe36,null,0x2));logger[_0xa1b0('0x12')](util[_0xa1b0('0x13')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x4dbe36[_0xa1b0('0x19')],_0x4dbe36['calleridname'],_0x4dbe36[_0xa1b0('0x1b')],_0x4dbe36['dnid'],_0x4dbe36[_0xa1b0('0x1c')]));_0x4dbe36['on']('error',errorHandler);_0x4dbe36['on'](_0xa1b0('0x36'),closeHandler);_0x4dbe36['on'](_0xa1b0('0x37'),timeoutHandler);_0x4dbe36[_0xa1b0('0x1f')]=![];_0x4dbe36['on'](_0xa1b0('0x38'),hangupHandler);var _0x255b32=getSquareProject[_0xa1b0('0x39')](null,_0x4dbe36[_0xa1b0('0x19')]);if(_0x255b32){if(_0x255b32[_0xa1b0('0x3a')]){_0x14476c=getRoot(_0x255b32[_0xa1b0('0x3a')]);if(_0x14476c&&_0x14476c[_0xa1b0('0x3b')]){logger[_0xa1b0('0x33')](_0xa1b0('0x3c'),JSON[_0xa1b0('0x35')](_0x14476c,null,0x2));_0x4dbe36[_0xa1b0('0x3d')]=moment()['format'](_0xa1b0('0x3e'));_0x351064=initGraph(_[_0xa1b0('0x3f')](_0x14476c,_0xa1b0('0x26')),_0x14476c['mxCell']);_0x155e14=new Vertices(_0x4dbe36,rpc,mailRpc);logger[_0xa1b0('0x12')](util[_0xa1b0('0x13')](_0xa1b0('0x40'),_0x4dbe36[_0xa1b0('0x19')],_0x4dbe36[_0xa1b0('0x1a')],_0x4dbe36[_0xa1b0('0x1b')],_0x4dbe36[_0xa1b0('0x1e')],_0x4dbe36[_0xa1b0('0x1c')]));_0x351064['traverseBFS'](_0x14476c[_0xa1b0('0x3b')]['id'],function(_0x3247c1){try{_0x3247c1=_0x155e14[_0xa1b0('0x41')](_0x3247c1);logger[_0xa1b0('0x33')](_0xa1b0('0x42'),JSON[_0xa1b0('0x35')](_0x3247c1,null,0x2));if(_0x3247c1[_0xa1b0('0x22')]==='gotoc'){logger[_0xa1b0('0x12')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x4dbe36[_0xa1b0('0x43')]=_0x3247c1['context']||_0x4dbe36[_0xa1b0('0x43')];_0x4dbe36[_0xa1b0('0x44')]=_0x3247c1[_0xa1b0('0x44')];_0x4dbe36[_0xa1b0('0x45')]=_0x3247c1['priority']?_0x3247c1[_0xa1b0('0x45')]-0x1:0x1;return null;}else if(_0x3247c1&&_0x155e14[_0x3247c1[_0xa1b0('0x22')]]){_0x5434a9=_0x155e14[_0x3247c1[_0xa1b0('0x22')]](_0x3247c1);logger[_0xa1b0('0x12')](_0xa1b0('0x46'),JSON[_0xa1b0('0x35')](_0x5434a9,null,0x2));if(_0x5434a9&&_0x5434a9[_0xa1b0('0x47')]===AGI_CODE_SUCCESS&&_0x5434a9[_0xa1b0('0x48')]!==AGI_RESULT_ERROR&&!_0x4dbe36[_0xa1b0('0x1f')]){logger[_0xa1b0('0x33')](_0xa1b0('0x46'),getLogFromObject(_0x5434a9));return _[_0xa1b0('0x49')](_0x5434a9[_0xa1b0('0x48')])?null:_0x5434a9[_0xa1b0('0x48')][_0xa1b0('0x4a')]();}else{logger['error'](_0xa1b0('0x46'),getLogFromObject(_0x5434a9));return null;}}else{logger[_0xa1b0('0xd')](_0xa1b0('0x4b'));return null;}}catch(_0x3b27bc){logger[_0xa1b0('0xd')](_0x3b27bc[_0xa1b0('0xe')]);return null;}});if(_0x14476c[_0xa1b0('0x4c')]){logger[_0xa1b0('0x12')](util[_0xa1b0('0x13')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x4dbe36[_0xa1b0('0x19')],_0x4dbe36[_0xa1b0('0x1a')],_0x4dbe36[_0xa1b0('0x1b')],_0x4dbe36[_0xa1b0('0x1e')],_0x4dbe36['uniqueid']));_0x351064['traverseBFS'](_0x14476c[_0xa1b0('0x4c')]['id'],function(_0x522819){try{_0x522819=_0x155e14[_0xa1b0('0x41')](_0x522819);logger[_0xa1b0('0x33')](_0xa1b0('0x42'),JSON[_0xa1b0('0x35')](_0x522819,null,0x2));if(_0x522819&&_0x155e14[_0x522819[_0xa1b0('0x22')]]){_0x5434a9=_0x155e14[_0x522819[_0xa1b0('0x22')]](_0x522819);if(_0x5434a9){logger['debug'](_0xa1b0('0x46'),getLogFromObject(_0x5434a9));return _[_0xa1b0('0x49')](_0x5434a9[_0xa1b0('0x48')])?null:_0x5434a9[_0xa1b0('0x48')][_0xa1b0('0x4a')]();}else{logger[_0xa1b0('0xd')](_0xa1b0('0x46'),getLogFromObject(_0x5434a9));return null;}}else{logger['error'](_0xa1b0('0x4b'));return null;}}catch(_0x5cddd9){logger[_0xa1b0('0xd')](_0x5cddd9[_0xa1b0('0xe')]);return null;}});}logger[_0xa1b0('0x12')](util[_0xa1b0('0x13')](_0xa1b0('0x4d'),_0x4dbe36[_0xa1b0('0x19')],_0x4dbe36[_0xa1b0('0x1a')],_0x4dbe36[_0xa1b0('0x1b')],_0x4dbe36[_0xa1b0('0x1e')],_0x4dbe36[_0xa1b0('0x1c')]));logger[_0xa1b0('0x12')](util[_0xa1b0('0x13')](_0xa1b0('0x4e'),_0x4dbe36['context'],_0x4dbe36[_0xa1b0('0x44')],parseInt(_0x4dbe36['priority'],0xa)+0x1));_0x4dbe36[_0xa1b0('0x4f')](_0x4dbe36[_0xa1b0('0x43')],_0x4dbe36['extension'],parseInt(_0x4dbe36[_0xa1b0('0x45')],0xa)+0x1);_0x4dbe36['close']();}}else{logger[_0xa1b0('0xd')](util[_0xa1b0('0x13')](_0xa1b0('0x50'),_0x4dbe36[_0xa1b0('0x19')]));_0x4dbe36['continueAt'](_0x4dbe36['context'],_0x4dbe36['extension'],parseInt(_0x4dbe36[_0xa1b0('0x45')],0xa)+0x1);_0x4dbe36['close']();}}else{logger[_0xa1b0('0xd')](util[_0xa1b0('0x13')](_0xa1b0('0x51'),_0x4dbe36[_0xa1b0('0x19')]));_0x4dbe36[_0xa1b0('0x4f')](_0x4dbe36[_0xa1b0('0x43')],_0x4dbe36[_0xa1b0('0x44')],parseInt(_0x4dbe36[_0xa1b0('0x45')],0xa)+0x1);_0x4dbe36[_0xa1b0('0x36')]();}}function main(){var _0x403562;return utilLicense[_0xa1b0('0x52')]()[_0xa1b0('0x2f')](function(_0x375fd3){if(_0x375fd3){if(_0x375fd3[_0xa1b0('0x53')]){if(_0x375fd3[_0xa1b0('0x54')]&&_0x375fd3[_0xa1b0('0x54')]>0x0){logger['info'](util[_0xa1b0('0x13')](_0xa1b0('0x55'),_0x375fd3[_0xa1b0('0x54')]));_0x403562=_0x375fd3[_0xa1b0('0x54')];}else{logger[_0xa1b0('0x12')](_0xa1b0('0x56'));}}else{logger[_0xa1b0('0x12')](_0xa1b0('0x57'));_0x403562=-0x1;}}})[_0xa1b0('0x58')](function(_0x44340f){logger[_0xa1b0('0xd')](_0xa1b0('0x59'),_0x44340f['stack']);})[_0xa1b0('0x4c')](function(){var _0x215336=require(_0xa1b0('0x5a'))(config[_0xa1b0('0x7')][_0xa1b0('0x11')],config[_0xa1b0('0x7')]['ip'],_0x403562);_0x215336['on']('error',errorHandler);_0x215336['on'](_0xa1b0('0x5b'),listeningHandler);_0x215336['on']('connection',connectionHandler);_0x215336['on'](_0xa1b0('0x36'),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 39338ee..b4ed4b7 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 _0x162a=['error','result','sendMailMessage','SendMail','jayson/promise','http','request'];(function(_0x4ee585,_0x3aa9fa){var _0x561c7a=function(_0x4e16b1){while(--_0x4e16b1){_0x4ee585['push'](_0x4ee585['shift']());}};_0x561c7a(++_0x3aa9fa);}(_0x162a,0xe4));var _0xa162=function(_0x108d21,_0x175cc9){_0x108d21=_0x108d21-0x0;var _0x276df2=_0x162a[_0x108d21];return _0x276df2;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xa162('0x0'));var client=jayson['client'][_0xa162('0x1')]({'port':0x232b});function request(_0x5ce84c,_0x967e9d){return new BPromise(function(_0x278ec0,_0x55c38b){return client[_0xa162('0x2')](_0x5ce84c,_0x967e9d)['then'](function(_0x1b99f9){if(_0x1b99f9['error']){return _0x55c38b(_0x1b99f9[_0xa162('0x3')]['message']);}else{return _0x278ec0(_0x1b99f9[_0xa162('0x4')]);}})['catch'](function(_0x30d3ef){return _0x55c38b(_0x30d3ef);});});}exports[_0xa162('0x5')]=function(_0x58c898,_0xa01029){return request(_0xa162('0x6'),{'account':_0x58c898,'message':_0xa01029});}; \ No newline at end of file +var _0xfa92=['error','message','result','sendMailMessage','SendMail','bluebird','client','http','then'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0xfa92,0x164));var _0x2fa9=function(_0x28d7c5,_0x2c3295){_0x28d7c5=_0x28d7c5-0x0;var _0x5f3227=_0xfa92[_0x28d7c5];return _0x5f3227;};'use strict';var BPromise=require(_0x2fa9('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x2fa9('0x1')][_0x2fa9('0x2')]({'port':0x232b});function request(_0x536ea4,_0x6b2a4a){return new BPromise(function(_0x323819,_0x304095){return client['request'](_0x536ea4,_0x6b2a4a)[_0x2fa9('0x3')](function(_0x1f702e){if(_0x1f702e[_0x2fa9('0x4')]){return _0x304095(_0x1f702e['error'][_0x2fa9('0x5')]);}else{return _0x323819(_0x1f702e[_0x2fa9('0x6')]);}})['catch'](function(_0x4b6b8b){return _0x304095(_0x4b6b8b);});});}exports[_0x2fa9('0x7')]=function(_0x1de849,_0x81fc34){return request(_0x2fa9('0x8'),{'account':_0x1de849,'message':_0x81fc34});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 52d0535..5d03538 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 _0xf0cc=['inherits','\x0d\x0a\x0d\x0a','toString','_localBuffer','indexOf','substring','length','slice','trim','headers','emit','util','_inBody'];(function(_0x5dbb84,_0x1bbce9){var _0x1d6eae=function(_0xd93967){while(--_0xd93967){_0x5dbb84['push'](_0x5dbb84['shift']());}};_0x1d6eae(++_0x1bbce9);}(_0xf0cc,0xa7));var _0xcf0c=function(_0x246c27,_0x2697f6){_0x246c27=_0x246c27-0x0;var _0xcbcb6d=_0xf0cc[_0x246c27];return _0xcbcb6d;};'use strict';var util=require(_0xcf0c('0x0'));var Transform=require('stream')['Transform'];function AGIReply(_0x242eb2){Transform['call'](this,_0x242eb2);this['_localBuffer']='';this[_0xcf0c('0x1')]=![];}util[_0xcf0c('0x2')](AGIReply,Transform);AGIReply['prototype']['_transform']=function(_0x2c4b4a,_0x345773,_0x1a6003){var _0x497363='\x0a',_0x346cb0=['\x0a\x0a',_0xcf0c('0x3')],_0x1503f6=-0x1,_0x2cb15a=-0x1,_0x5d4cdb='',_0x54cef0=0x0,_0x3cf3cb='',_0x53a853='';this['_localBuffer']+=_0x2c4b4a[_0xcf0c('0x4')]();_0x3cf3cb=this[_0xcf0c('0x5')];if(!this[_0xcf0c('0x1')]){_0x54cef0=0x0;while(_0x346cb0[_0x54cef0]){while((_0x2cb15a=_0x3cf3cb[_0xcf0c('0x6')](_0x346cb0[_0x54cef0]))!=-0x1){_0x5d4cdb=_0x346cb0[_0x54cef0];_0x53a853=_0x3cf3cb[_0xcf0c('0x7')](0x0,_0x2cb15a);_0x3cf3cb=_0x3cf3cb[_0xcf0c('0x7')](_0x2cb15a+_0x5d4cdb[_0xcf0c('0x8')]);var _0x47a6c9=_0x53a853['split'](_0x497363),_0xfca99c=0x0,_0x1e9889={},_0x6dde21='',_0x34f74f='',_0x327f65=-0x1;while(_0x47a6c9[_0xfca99c]){_0x327f65=_0x47a6c9[_0xfca99c][_0xcf0c('0x6')](':');if(_0x327f65!=-0x1){_0x6dde21=_0x47a6c9[_0xfca99c][_0xcf0c('0x9')](0x0,_0x327f65)[_0xcf0c('0xa')]();_0x34f74f=_0x47a6c9[_0xfca99c]['slice'](_0x327f65+0x1)['trim']();if(_0x6dde21[_0xcf0c('0x8')]>0x0){_0x1e9889[_0x6dde21]=_0x34f74f;}}else{}_0xfca99c++;}this['emit'](_0xcf0c('0xb'),_0x1e9889);this[_0xcf0c('0x1')]=!![];}_0x54cef0++;}this['_localBuffer']=_0x3cf3cb;}else{while((_0x1503f6=_0x3cf3cb['indexOf'](_0x497363))!=-0x1){_0x53a853=_0x3cf3cb['substring'](0x0,_0x1503f6);this[_0xcf0c('0xc')]('line',_0x53a853);_0x3cf3cb=_0x3cf3cb[_0xcf0c('0x7')](_0x1503f6+_0x497363[_0xcf0c('0x8')]);}this['_localBuffer']=_0x3cf3cb;}_0x1a6003();};module['exports']=AGIReply; \ No newline at end of file +var _0xa90f=['util','stream','call','_localBuffer','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','toString','indexOf','substring','length','split','trim','slice','emit','headers','line','exports'];(function(_0x10d045,_0x7bfe7b){var _0x25b93f=function(_0x6a8c74){while(--_0x6a8c74){_0x10d045['push'](_0x10d045['shift']());}};_0x25b93f(++_0x7bfe7b);}(_0xa90f,0x1a4));var _0xfa90=function(_0x1d8f23,_0x1d4573){_0x1d8f23=_0x1d8f23-0x0;var _0x9499d7=_0xa90f[_0x1d8f23];return _0x9499d7;};'use strict';var util=require(_0xfa90('0x0'));var Transform=require(_0xfa90('0x1'))['Transform'];function AGIReply(_0x3da597){Transform[_0xfa90('0x2')](this,_0x3da597);this[_0xfa90('0x3')]='';this[_0xfa90('0x4')]=![];}util[_0xfa90('0x5')](AGIReply,Transform);AGIReply[_0xfa90('0x6')][_0xfa90('0x7')]=function(_0x379c31,_0x20eaca,_0x41d8ef){var _0x33eade='\x0a',_0x40f20d=['\x0a\x0a',_0xfa90('0x8')],_0x33cb90=-0x1,_0x548bb6=-0x1,_0x140fe1='',_0x3392d1=0x0,_0x4f6a14='',_0x12c874='';this[_0xfa90('0x3')]+=_0x379c31[_0xfa90('0x9')]();_0x4f6a14=this['_localBuffer'];if(!this[_0xfa90('0x4')]){_0x3392d1=0x0;while(_0x40f20d[_0x3392d1]){while((_0x548bb6=_0x4f6a14[_0xfa90('0xa')](_0x40f20d[_0x3392d1]))!=-0x1){_0x140fe1=_0x40f20d[_0x3392d1];_0x12c874=_0x4f6a14[_0xfa90('0xb')](0x0,_0x548bb6);_0x4f6a14=_0x4f6a14['substring'](_0x548bb6+_0x140fe1[_0xfa90('0xc')]);var _0x3b44b5=_0x12c874[_0xfa90('0xd')](_0x33eade),_0x399e92=0x0,_0x602df3={},_0x5a0b59='',_0x166ab4='',_0x44c11a=-0x1;while(_0x3b44b5[_0x399e92]){_0x44c11a=_0x3b44b5[_0x399e92][_0xfa90('0xa')](':');if(_0x44c11a!=-0x1){_0x5a0b59=_0x3b44b5[_0x399e92]['slice'](0x0,_0x44c11a)[_0xfa90('0xe')]();_0x166ab4=_0x3b44b5[_0x399e92][_0xfa90('0xf')](_0x44c11a+0x1)['trim']();if(_0x5a0b59[_0xfa90('0xc')]>0x0){_0x602df3[_0x5a0b59]=_0x166ab4;}}else{}_0x399e92++;}this[_0xfa90('0x10')](_0xfa90('0x11'),_0x602df3);this[_0xfa90('0x4')]=!![];}_0x3392d1++;}this[_0xfa90('0x3')]=_0x4f6a14;}else{while((_0x33cb90=_0x4f6a14[_0xfa90('0xa')](_0x33eade))!=-0x1){_0x12c874=_0x4f6a14[_0xfa90('0xb')](0x0,_0x33cb90);this['emit'](_0xfa90('0x12'),_0x12c874);_0x4f6a14=_0x4f6a14[_0xfa90('0xb')](_0x33cb90+_0x33eade[_0xfa90('0xc')]);}this[_0xfa90('0x3')]=_0x4f6a14;}_0x41d8ef();};module[_0xfa90('0x13')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index dec9be0..4a2342b 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 _0x535f=['getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','getUserById','ShowUser','getContactByPhone','GetContactByPhone','phone','getTrunkById','getSoundById','ShowSound','getIntervalById','getSmsAccountById','ShowSmsAccount','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','UnpauseUser','agentLogout','LogoutUser','moment','lodash','jayson/promise','client','http','request','then','error','result','catch','ShowSquareProject','ShowMailAccount','name','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue'];(function(_0x38f186,_0x3f2fe8){var _0x49f6eb=function(_0x4fe511){while(--_0x4fe511){_0x38f186['push'](_0x38f186['shift']());}};_0x49f6eb(++_0x3f2fe8);}(_0x535f,0x111));var _0xf535=function(_0x122e42,_0x222609){_0x122e42=_0x122e42-0x0;var _0x4c019e=_0x535f[_0x122e42];return _0x4c019e;};'use strict';var BPromise=require('bluebird');var moment=require(_0xf535('0x0'));var _=require(_0xf535('0x1'));var util=require('util');var jayson=require(_0xf535('0x2'));var client=jayson[_0xf535('0x3')][_0xf535('0x4')]({'port':0x2329});function request(_0x19ec32,_0x4ff0b3){return new BPromise(function(_0xd1ee93,_0x24a323){return client[_0xf535('0x5')](_0x19ec32,_0x4ff0b3)[_0xf535('0x6')](function(_0x41ca74){if(_0x41ca74[_0xf535('0x7')]){return _0x24a323(_0x41ca74['error']['message']);}else{return _0xd1ee93(_0x41ca74[_0xf535('0x8')]);}})[_0xf535('0x9')](function(_0x13bf04){return _0x24a323(_0x13bf04);});});}exports['getSquareProject']=function(_0x244189){return request(_0xf535('0xa'),{'options':{'raw':![],'where':{'name':_0x244189},'attributes':['production']}});};exports['getMailAccountById']=function(_0x56f05d){return request(_0xf535('0xb'),{'options':{'raw':![],'where':{'id':_0x56f05d},'include':[{'model':'MailServerOut','as':'Smtp'}],'attributes':['id',_0xf535('0xc'),_0xf535('0xd')]}});};exports[_0xf535('0xe')]=function(_0x2e628e){return request(_0xf535('0xa'),{'options':{'where':{'id':_0x2e628e},'attributes':['name']}});};exports[_0xf535('0xf')]=function(_0x27e116){return request(_0xf535('0x10'),{'options':{'where':{'id':_0x27e116},'attributes':[_0xf535('0xc')]}});};exports[_0xf535('0x11')]=function(_0x338f06){return request(_0xf535('0x12'),{'options':{'where':{'id':_0x338f06},'attributes':[_0xf535('0xc')]}});};exports[_0xf535('0x13')]=function(_0xb52d7f){return request(_0xf535('0x14'),{'options':{'where':{'id':_0xb52d7f},'attributes':['dsn']}});};exports[_0xf535('0x15')]=function(_0x1e3500){return request(_0xf535('0x16'),{'options':{'where':{'id':_0x1e3500},'attributes':[_0xf535('0xc')]}});};exports[_0xf535('0x17')]=function(_0x1fb901){return request(_0xf535('0x18'),{'options':{'where':{'phone':_0x1fb901[_0xf535('0x19')]},'attributes':['id']}});};exports[_0xf535('0x1a')]=function(_0x477c1d){return request('ShowTrunk',{'options':{'where':{'id':_0x477c1d},'attributes':[_0xf535('0xc')]}});};exports[_0xf535('0x1b')]=function(_0x6f757f){return request(_0xf535('0x1c'),{'options':{'where':{'id':_0x6f757f},'attributes':['save_name']}});};exports[_0xf535('0x1d')]=function(_0x1990b1){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x1990b1},'include':[{'model':'Interval','as':'Intervals'}]}});};exports[_0xf535('0x1e')]=function(_0x141267){return request(_0xf535('0x1f'),{'options':{'where':{'id':_0x141267},'attributes':['id','name']}});};exports['createSmsMessage']=function(_0x438cb1){return request(_0xf535('0x20'),{'body':_0x438cb1});};exports[_0xf535('0x21')]=function(_0x16bd23){return request(_0xf535('0x22'),{'body':_0x16bd23});};exports[_0xf535('0x23')]=function(_0x358c91){return request(_0xf535('0x24'),{'body':_[_0xf535('0x25')](_0x358c91,{'project_name':_0x358c91[_0xf535('0x26')],'prev_project_name':_0x358c91[_0xf535('0x27')]||'','is_subproject':_0x358c91['arg_2']?!![]:![],'leaveAt':moment()[_0xf535('0x28')](_0xf535('0x29'))})});};exports[_0xf535('0x2a')]=function(_0x46ce43){return request(_0xf535('0x2b'),{'body':_0x46ce43});};exports[_0xf535('0x2c')]=function(_0x351b3a){return request(_0xf535('0x2d'),{'body':_0x351b3a});};exports[_0xf535('0x2e')]=function(_0x60cb11){return request(_0xf535('0x2f'),{'options':{'raw':![],'where':{'phone':_0x60cb11[_0xf535('0x19')],'ListId':_0x60cb11['ListId']}}})['then'](function(_0x47151e){if(_0x47151e){return _0x47151e;}return request(_0xf535('0x30'),{'body':_0x60cb11});});};exports[_0xf535('0x31')]=function(_0x2fceb0){return request(_0xf535('0x32'),{'options':{'where':{'id':_0x2fceb0},'attributes':['name']}});};exports[_0xf535('0x33')]=function(_0x51c3fd,_0x508e77){return request(_0xf535('0x34'),{'body':{'interface':_0x508e77},'options':{'where':_0x51c3fd}});};exports[_0xf535('0x35')]=function(_0x1e432d,_0x3463da,_0x4137b2){return request(_0xf535('0x36'),{'body':{'type':_0x3463da,'uniqueid':_0x4137b2},'options':{'where':_0x1e432d}});};exports['agentUnpause']=function(_0x74da53){return request(_0xf535('0x37'),{'body':{},'options':{'where':_0x74da53}});};exports[_0xf535('0x38')]=function(_0x21e225){return request(_0xf535('0x39'),{'body':{},'options':{'where':_0x21e225}});}; \ No newline at end of file +var _0xfb82=['createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','UnpauseUser','agentLogout','LogoutUser','bluebird','moment','lodash','jayson/promise','client','request','then','error','message','catch','getSquareProject','ShowSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','email','getSquareProjectById','name','getVariableById','ShowVariable','ShowSquareOdbc','dsn','getUserById','getContactByPhone','GetContactByPhone','phone','getTrunkById','getSoundById','ShowSound','getIntervalById','ShowInterval','Interval','Intervals','ShowSmsAccount','CreateSmsMessage'];(function(_0x3a1bb0,_0x1764e1){var _0x38832e=function(_0x7ef24c){while(--_0x7ef24c){_0x3a1bb0['push'](_0x3a1bb0['shift']());}};_0x38832e(++_0x1764e1);}(_0xfb82,0x17f));var _0x2fb8=function(_0xf80b39,_0x4b2908){_0xf80b39=_0xf80b39-0x0;var _0x1266c7=_0xfb82[_0xf80b39];return _0x1266c7;};'use strict';var BPromise=require(_0x2fb8('0x0'));var moment=require(_0x2fb8('0x1'));var _=require(_0x2fb8('0x2'));var util=require('util');var jayson=require(_0x2fb8('0x3'));var client=jayson[_0x2fb8('0x4')]['http']({'port':0x2329});function request(_0x283c81,_0x8d8257){return new BPromise(function(_0x34535f,_0x2dffe6){return client[_0x2fb8('0x5')](_0x283c81,_0x8d8257)[_0x2fb8('0x6')](function(_0x3e6900){if(_0x3e6900[_0x2fb8('0x7')]){return _0x2dffe6(_0x3e6900[_0x2fb8('0x7')][_0x2fb8('0x8')]);}else{return _0x34535f(_0x3e6900['result']);}})[_0x2fb8('0x9')](function(_0x2b101f){return _0x2dffe6(_0x2b101f);});});}exports[_0x2fb8('0xa')]=function(_0x29be44){return request(_0x2fb8('0xb'),{'options':{'raw':![],'where':{'name':_0x29be44},'attributes':[_0x2fb8('0xc')]}});};exports[_0x2fb8('0xd')]=function(_0x2928ef){return request(_0x2fb8('0xe'),{'options':{'raw':![],'where':{'id':_0x2928ef},'include':[{'model':_0x2fb8('0xf'),'as':_0x2fb8('0x10')}],'attributes':['id','name',_0x2fb8('0x11')]}});};exports[_0x2fb8('0x12')]=function(_0x3f5a0e){return request(_0x2fb8('0xb'),{'options':{'where':{'id':_0x3f5a0e},'attributes':['name']}});};exports['getVoiceQueueById']=function(_0x35e23b){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x35e23b},'attributes':[_0x2fb8('0x13')]}});};exports[_0x2fb8('0x14')]=function(_0x5cb3ec){return request(_0x2fb8('0x15'),{'options':{'where':{'id':_0x5cb3ec},'attributes':[_0x2fb8('0x13')]}});};exports['getSquareOdbcById']=function(_0x59f271){return request(_0x2fb8('0x16'),{'options':{'where':{'id':_0x59f271},'attributes':[_0x2fb8('0x17')]}});};exports[_0x2fb8('0x18')]=function(_0x42a607){return request('ShowUser',{'options':{'where':{'id':_0x42a607},'attributes':[_0x2fb8('0x13')]}});};exports[_0x2fb8('0x19')]=function(_0x48296c){return request(_0x2fb8('0x1a'),{'options':{'where':{'phone':_0x48296c[_0x2fb8('0x1b')]},'attributes':['id']}});};exports[_0x2fb8('0x1c')]=function(_0x524c14){return request('ShowTrunk',{'options':{'where':{'id':_0x524c14},'attributes':[_0x2fb8('0x13')]}});};exports[_0x2fb8('0x1d')]=function(_0x428292){return request(_0x2fb8('0x1e'),{'options':{'where':{'id':_0x428292},'attributes':['save_name']}});};exports[_0x2fb8('0x1f')]=function(_0xffd9ec){return request(_0x2fb8('0x20'),{'options':{'raw':![],'where':{'id':_0xffd9ec},'include':[{'model':_0x2fb8('0x21'),'as':_0x2fb8('0x22')}]}});};exports['getSmsAccountById']=function(_0x2ffca4){return request(_0x2fb8('0x23'),{'options':{'where':{'id':_0x2ffca4},'attributes':['id',_0x2fb8('0x13')]}});};exports['createSmsMessage']=function(_0x4a4576){return request(_0x2fb8('0x24'),{'body':_0x4a4576});};exports[_0x2fb8('0x25')]=function(_0x1ea35b){return request(_0x2fb8('0x26'),{'body':_0x1ea35b});};exports[_0x2fb8('0x27')]=function(_0x4d6a94){return request(_0x2fb8('0x28'),{'body':_[_0x2fb8('0x29')](_0x4d6a94,{'project_name':_0x4d6a94[_0x2fb8('0x2a')],'prev_project_name':_0x4d6a94[_0x2fb8('0x2b')]||'','is_subproject':_0x4d6a94[_0x2fb8('0x2b')]?!![]:![],'leaveAt':moment()[_0x2fb8('0x2c')](_0x2fb8('0x2d'))})});};exports['createSquareRecording']=function(_0x42143a){return request('CreateSquareRecording',{'body':_0x42143a});};exports[_0x2fb8('0x2e')]=function(_0x3ad8cc){return request(_0x2fb8('0x2f'),{'body':_0x3ad8cc});};exports[_0x2fb8('0x30')]=function(_0x2054c9){return request(_0x2fb8('0x31'),{'options':{'raw':![],'where':{'phone':_0x2054c9[_0x2fb8('0x1b')],'ListId':_0x2054c9[_0x2fb8('0x32')]}}})[_0x2fb8('0x6')](function(_0xc644b7){if(_0xc644b7){return _0xc644b7;}return request(_0x2fb8('0x33'),{'body':_0x2054c9});});};exports[_0x2fb8('0x34')]=function(_0x462937){return request(_0x2fb8('0x35'),{'options':{'where':{'id':_0x462937},'attributes':[_0x2fb8('0x13')]}});};exports[_0x2fb8('0x36')]=function(_0x556cc0,_0x50d06c){return request(_0x2fb8('0x37'),{'body':{'interface':_0x50d06c},'options':{'where':_0x556cc0}});};exports[_0x2fb8('0x38')]=function(_0x50c07d,_0x5d6930,_0x384608){return request('PauseUser',{'body':{'type':_0x5d6930,'uniqueid':_0x384608},'options':{'where':_0x50c07d}});};exports['agentUnpause']=function(_0xd3e701){return request(_0x2fb8('0x39'),{'body':{},'options':{'where':_0xd3e701}});};exports[_0x2fb8('0x3a')]=function(_0xa80a91){return request(_0x2fb8('0x3b'),{'body':{},'options':{'where':_0xa80a91}});}; \ 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 d3c0643..d08fc74 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 _0x4753=['./lex','exports','./polly'];(function(_0x11946c,_0x12152c){var _0x383935=function(_0x61fce2){while(--_0x61fce2){_0x11946c['push'](_0x11946c['shift']());}};_0x383935(++_0x12152c);}(_0x4753,0x1f4));var _0x3475=function(_0x3693dd,_0x74cff6){_0x3693dd=_0x3693dd-0x0;var _0x196bf2=_0x4753[_0x3693dd];return _0x196bf2;};var polly=require(_0x3475('0x0'));var lex=require(_0x3475('0x1'));module[_0x3475('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x3baf=['exports','./polly','./lex'];(function(_0xef8146,_0x459c34){var _0x5a6cb0=function(_0x2f84ec){while(--_0x2f84ec){_0xef8146['push'](_0xef8146['shift']());}};_0x5a6cb0(++_0x459c34);}(_0x3baf,0xf7));var _0xf3ba=function(_0x3e25c1,_0x1d15f9){_0x3e25c1=_0x3e25c1-0x0;var _0x52e7f2=_0x3baf[_0x3e25c1];return _0x52e7f2;};var polly=require(_0xf3ba('0x0'));var lex=require(_0xf3ba('0x1'));module[_0xf3ba('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 1053611..63c6bdc 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 _0xa571=['exports','./lib/api'];(function(_0x9729d7,_0x1b79a8){var _0x3c4ac6=function(_0x401ba6){while(--_0x401ba6){_0x9729d7['push'](_0x9729d7['shift']());}};_0x3c4ac6(++_0x1b79a8);}(_0xa571,0x107));var _0x1a57=function(_0x21816c,_0x880c58){_0x21816c=_0x21816c-0x0;var _0x38c5dd=_0xa571[_0x21816c];return _0x38c5dd;};'use strict';var lex=require(_0x1a57('0x0'));module[_0x1a57('0x1')]=function(_0x206f1b,_0x1067d9,_0x48485e,_0x1a071f,_0x2eebaa,_0x4d5f7a){return lex(_0x206f1b,_0x1067d9,_0x48485e,_0x1a071f,_0x2eebaa,_0x4d5f7a);}; \ No newline at end of file +var _0x6e6c=['exports','./lib/api'];(function(_0x264d4d,_0x118fb5){var _0xc917e2=function(_0x21b9dc){while(--_0x21b9dc){_0x264d4d['push'](_0x264d4d['shift']());}};_0xc917e2(++_0x118fb5);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x6e6c[_0x2dafbe];return _0x58a45a;};'use strict';var lex=require(_0xc6e6('0x0'));module[_0xc6e6('0x1')]=function(_0x545f2c,_0x370b21,_0x1b63fe,_0x58f303,_0x550e47,_0x2e97f5){return lex(_0x545f2c,_0x370b21,_0x1b63fe,_0x58f303,_0x550e47,_0x2e97f5);}; \ 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 0d7e3ab..8459e6e 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(_0xac2e68,_0x425a13){var _0x1cb4a4=function(_0x2fa868){while(--_0x2fa868){_0xac2e68['push'](_0xac2e68['shift']());}};_0x1cb4a4(++_0x425a13);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'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(_0xd79933,_0x473821){var _0x1d8e45=function(_0x5dd966){while(--_0x5dd966){_0xd79933['push'](_0xd79933['shift']());}};_0x1d8e45(++_0x473821);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'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 9c23d7b..fd1e422 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 _0x9dc5=['./lib/api','exports'];(function(_0x456fc1,_0x191e3d){var _0x84fab3=function(_0x22fd2b){while(--_0x22fd2b){_0x456fc1['push'](_0x456fc1['shift']());}};_0x84fab3(++_0x191e3d);}(_0x9dc5,0x1d6));var _0x59dc=function(_0x32dcfd,_0x1ec0f3){_0x32dcfd=_0x32dcfd-0x0;var _0x472ad3=_0x9dc5[_0x32dcfd];return _0x472ad3;};'use strict';var polly=require(_0x59dc('0x0'));module[_0x59dc('0x1')]=function(_0x37c852,_0x13d8ce,_0x34f8e0,_0x55714d,_0x3f6cfb,_0x3d1a8a,_0x5e71d4){return polly(_0x37c852,_0x13d8ce,_0x34f8e0,_0x55714d,_0x3f6cfb,_0x3d1a8a,_0x5e71d4);}; \ No newline at end of file +var _0x3a43=['exports'];(function(_0x5807e8,_0x5d1910){var _0x2f7f36=function(_0x180798){while(--_0x180798){_0x5807e8['push'](_0x5807e8['shift']());}};_0x2f7f36(++_0x5d1910);}(_0x3a43,0x105));var _0x33a4=function(_0xa79977,_0x4f7f12){_0xa79977=_0xa79977-0x0;var _0x109f10=_0x3a43[_0xa79977];return _0x109f10;};'use strict';var polly=require('./lib/api');module[_0x33a4('0x0')]=function(_0x3a022b,_0x473ab4,_0x1b04ac,_0x1f3322,_0xdafa0a,_0x16aa04,_0x51ac1f){return polly(_0x3a022b,_0x473ab4,_0x1b04ac,_0x1f3322,_0xdafa0a,_0x16aa04,_0x51ac1f);}; \ 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 5469347..b041186 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 _0xc534=['text','mp3','path','bluebird','randomstring','aws-sdk','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly'];(function(_0x52ae57,_0xded61){var _0xb59a90=function(_0x1664a1){while(--_0x1664a1){_0x52ae57['push'](_0x52ae57['shift']());}};_0xb59a90(++_0xded61);}(_0xc534,0xe9));var _0x4c53=function(_0x34fe22,_0x4b0faa){_0x34fe22=_0x34fe22-0x0;var _0x126030=_0xc534[_0x34fe22];return _0x126030;};'use strict';var fs=require('fs');var path=require(_0x4c53('0x0'));var BPromise=require(_0x4c53('0x1'));var rs=require(_0x4c53('0x2'));var AWS=require(_0x4c53('0x3'));function pollyResult(_0x4df675,_0x1dcc49,_0x4af986){return new BPromise(function(_0xb6f94c,_0x427c27){_0x4df675['synthesizeSpeech'](_0x1dcc49,function(_0x50c0f9,_0x178d56){if(_0x50c0f9){_0x427c27(_0x50c0f9);}else if(_0x178d56){if(_0x178d56[_0x4c53('0x4')]instanceof Buffer){fs['writeFile'](_0x4af986,_0x178d56[_0x4c53('0x4')],function(_0x1ef61f){if(_0x1ef61f){_0x427c27(_0x1ef61f);}else{_0xb6f94c();}});}else{_0x427c27(new Error(_0x4c53('0x5')));}}else{_0x427c27(new Error(_0x4c53('0x6')));}});});}module[_0x4c53('0x7')]=function(_0x480c6a,_0x47bfa1,_0x3e8c39,_0x277f9f,_0x2ab37f,_0x48c7e3,_0x54f3df){var _0x2184f1=new AWS[(_0x4c53('0x8'))]({'accessKeyId':_0x480c6a,'secretAccessKey':_0x47bfa1,'region':_0x3e8c39});var _0x386f47={'Text':_0x2ab37f,'TextType':_0x48c7e3||_0x4c53('0x9'),'OutputFormat':_0x4c53('0xa'),'VoiceId':_0x277f9f};return pollyResult(_0x2184f1,_0x386f47,_0x54f3df);}; \ No newline at end of file +var _0x661c=['exports','Polly','text','path','randomstring','aws-sdk','synthesizeSpeech','AudioStream','writeFile','No\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x5ee5af,_0x52369f){var _0x1fdd47=function(_0x906004){while(--_0x906004){_0x5ee5af['push'](_0x5ee5af['shift']());}};_0x1fdd47(++_0x52369f);}(_0x661c,0xfd));var _0xc661=function(_0x17406a,_0x1e2320){_0x17406a=_0x17406a-0x0;var _0x1501ff=_0x661c[_0x17406a];return _0x1501ff;};'use strict';var fs=require('fs');var path=require(_0xc661('0x0'));var BPromise=require('bluebird');var rs=require(_0xc661('0x1'));var AWS=require(_0xc661('0x2'));function pollyResult(_0x4543e3,_0x3a86a1,_0x49f7e7){return new BPromise(function(_0x3bd600,_0x75cda8){_0x4543e3[_0xc661('0x3')](_0x3a86a1,function(_0xe2023d,_0x15621f){if(_0xe2023d){_0x75cda8(_0xe2023d);}else if(_0x15621f){if(_0x15621f[_0xc661('0x4')]instanceof Buffer){fs[_0xc661('0x5')](_0x49f7e7,_0x15621f[_0xc661('0x4')],function(_0x3765c0){if(_0x3765c0){_0x75cda8(_0x3765c0);}else{_0x3bd600();}});}else{_0x75cda8(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x75cda8(new Error(_0xc661('0x6')));}});});}module[_0xc661('0x7')]=function(_0x59a788,_0x3012cd,_0x4709ee,_0xe0a05b,_0x2f4b9d,_0x10fad1,_0x4ff238){var _0x12ca9a=new AWS[(_0xc661('0x8'))]({'accessKeyId':_0x59a788,'secretAccessKey':_0x3012cd,'region':_0x4709ee});var _0x200142={'Text':_0x2f4b9d,'TextType':_0x10fad1||_0xc661('0x9'),'OutputFormat':'mp3','VoiceId':_0xe0a05b};return pollyResult(_0x12ca9a,_0x200142,_0x4ff238);}; \ 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 637dc66..a85613f 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 _0x13a6=['exports'];(function(_0x56d1b5,_0x289333){var _0x4ad91e=function(_0x15f467){while(--_0x15f467){_0x56d1b5['push'](_0x56d1b5['shift']());}};_0x4ad91e(++_0x289333);}(_0x13a6,0x1b3));var _0x613a=function(_0x12067c,_0x44b263){_0x12067c=_0x12067c-0x0;var _0x3643d4=_0x13a6[_0x12067c];return _0x3643d4;};'use strict';var asr=require('./lib/api');module[_0x613a('0x0')]=function(_0x50edc2,_0x248dac,_0x2f0691,_0x569838){return asr(_0x50edc2,_0x248dac,_0x2f0691);}; \ No newline at end of file +var _0xf1b7=['exports'];(function(_0x25029b,_0x5c80a2){var _0x1e4dea=function(_0x51e7c5){while(--_0x51e7c5){_0x25029b['push'](_0x25029b['shift']());}};_0x1e4dea(++_0x5c80a2);}(_0xf1b7,0x139));var _0x7f1b=function(_0xb7b722,_0xe95ba7){_0xb7b722=_0xb7b722-0x0;var _0x217177=_0xf1b7[_0xb7b722];return _0x217177;};'use strict';var asr=require('./lib/api');module[_0x7f1b('0x0')]=function(_0x107412,_0x16973b,_0x292481,_0xc3c1cf){return asr(_0x107412,_0x16973b,_0x292481);}; \ 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 32488c1..112e59d 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 _0x80df=['https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','url','bluebird'];(function(_0x552890,_0x52079b){var _0x3e90e5=function(_0x1bfae1){while(--_0x1bfae1){_0x552890['push'](_0x552890['shift']());}};_0x3e90e5(++_0x52079b);}(_0x80df,0x17e));var _0xf80d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x80df[_0x20a584];return _0x4b41a8;};'use strict';var url=require(_0xf80d('0x0'));var BPromise=require(_0xf80d('0x1'));var fs=require('fs');var host=_0xf80d('0x2');module[_0xf80d('0x3')]=function(_0x5390c8,_0x3aee0a,_0x216488){return new BPromise(function(_0xfd239e,_0x21365c){var _0x15d302;if(typeof _0x5390c8!==_0xf80d('0x4')||_0x5390c8[_0xf80d('0x5')]===0x0){return _0x21365c(_0xf80d('0x6'));}if(typeof _0x3aee0a!==_0xf80d('0x4')||_0x3aee0a[_0xf80d('0x5')]===0x0){return _0x21365c('key\x20should\x20be\x20a\x20string');}if(typeof _0x216488!==_0xf80d('0x7')&&(typeof _0x216488!==_0xf80d('0x4')||_0x216488[_0xf80d('0x5')]===0x0)){return _0x21365c(_0xf80d('0x8'));}try{_0x15d302=fs[_0xf80d('0x9')](_0x5390c8)[_0xf80d('0xa')](_0xf80d('0xb'));}catch(_0x45d290){return _0x21365c(_0x45d290);}return _0xfd239e({'method':_0xf80d('0xc'),'uri':host+_0xf80d('0xd')+_0x3aee0a,'body':{'config':{'encoding':_0xf80d('0xe'),'sampleRateHertz':_0xf80d('0xf'),'languageCode':_0x216488},'audio':{'content':_0x15d302}},'json':!![]});});}; \ No newline at end of file +var _0xb205=['/v1/speech:recognize?key=','LINEAR16','url','bluebird','https://speech.googleapis.com','exports','string','filepath\x20should\x20be\x20a\x20string','length','undefined','readFileSync','toString','base64','POST'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xb205,0xf0));var _0x5b20=function(_0x44481a,_0xaae57e){_0x44481a=_0x44481a-0x0;var _0x33b72c=_0xb205[_0x44481a];return _0x33b72c;};'use strict';var url=require(_0x5b20('0x0'));var BPromise=require(_0x5b20('0x1'));var fs=require('fs');var host=_0x5b20('0x2');module[_0x5b20('0x3')]=function(_0x65c236,_0x5f4ec5,_0x5ccd5f){return new BPromise(function(_0x37fe91,_0x573200){var _0x17046a;if(typeof _0x65c236!==_0x5b20('0x4')||_0x65c236['length']===0x0){return _0x573200(_0x5b20('0x5'));}if(typeof _0x5f4ec5!==_0x5b20('0x4')||_0x5f4ec5[_0x5b20('0x6')]===0x0){return _0x573200('key\x20should\x20be\x20a\x20string');}if(typeof _0x5ccd5f!==_0x5b20('0x7')&&(typeof _0x5ccd5f!==_0x5b20('0x4')||_0x5ccd5f['length']===0x0)){return _0x573200('lang\x20should\x20be\x20a\x20string');}try{_0x17046a=fs[_0x5b20('0x8')](_0x65c236)[_0x5b20('0x9')](_0x5b20('0xa'));}catch(_0x19b2c0){return _0x573200(_0x19b2c0);}return _0x37fe91({'method':_0x5b20('0xb'),'uri':host+_0x5b20('0xc')+_0x5f4ec5,'body':{'config':{'encoding':_0x5b20('0xd'),'sampleRateHertz':'8000','languageCode':_0x5ccd5f},'audio':{'content':_0x17046a}},'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 7033269..a4a4bc0 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 _0x57a5=['exports','./asr'];(function(_0x3885d9,_0x4188f8){var _0x39d60a=function(_0x23e1e7){while(--_0x23e1e7){_0x3885d9['push'](_0x3885d9['shift']());}};_0x39d60a(++_0x4188f8);}(_0x57a5,0xfd));var _0x557a=function(_0x4bbbaf,_0x41dfb8){_0x4bbbaf=_0x4bbbaf-0x0;var _0x31cd96=_0x57a5[_0x4bbbaf];return _0x31cd96;};var asr=require(_0x557a('0x0'));module[_0x557a('0x1')]={'asr':asr}; \ No newline at end of file +var _0x861c=['./asr'];(function(_0x1795d9,_0x4ce819){var _0x5dd910=function(_0x10b850){while(--_0x10b850){_0x1795d9['push'](_0x1795d9['shift']());}};_0x5dd910(++_0x4ce819);}(_0x861c,0x142));var _0xc861=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x861c[_0x17d9e3];return _0x14192d;};var asr=require(_0xc861('0x0'));module['exports']={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index d187a0a..d66d2ae 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 _0x4679=['transcript','Tilde\x20ASR\x20confidence','polly','awsLex','lex','ispeechTTS','format','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','parse','sestekNDA','nda','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','https','path','querystring','request-promise','sox','google-tts-api','url','./aws','./google','./tilde','../../../config/logger','https://api.ispeech.org/api/rest','https:','host','WHAT_EVER','get','statusCode','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','error','download\x20error','pipe','end','data','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','writeFileSync','base64','chmodSync','googleCloudTTS','https://texttospeech.googleapis.com/v1/','ssml','input','MP3','POST','generate','.mp3','from','audioContent','writeFile','777','then','.wav','unlink','split','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','null','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','\x22\x20might\x20not\x20exist','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','googleDialogflow','textRequest','result','source','resolvedQuery','actionIncomplete','fulfillment','speech','score','metadata','googleDialogflowV2','replace','sessionPath','detectIntent','queryResult','action','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','responseId','intentDetectionConfidence','Tilde\x20ASR\x20transcription'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x4679,0x9b));var _0x9467=function(_0x5d0dfe,_0x1db853){_0x5d0dfe=_0x5d0dfe-0x0;var _0x259f73=_0x4679[_0x5d0dfe];return _0x259f73;};'use strict';var apiai=require(_0x9467('0x0'));var BPromise=require(_0x9467('0x1'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require('http');var https=require(_0x9467('0x2'));var md5=require('md5');var path=require(_0x9467('0x3'));var querystring=require(_0x9467('0x4'));var rp=require(_0x9467('0x5'));var rs=require('randomstring');var sox=require(_0x9467('0x6'));var tts=require(_0x9467('0x7'));var urlParse=require(_0x9467('0x8'))['parse'];var util=require('util');var aws=require(_0x9467('0x9'));var google=require(_0x9467('0xa'));var sestek=require('./sestek');var tilde=require(_0x9467('0xb'));var logger=require(_0x9467('0xc'))('agi');var ISPEECH_API=_0x9467('0xd');function downloadFile(_0x1f8895,_0x4eecd2){return new BPromise(function(_0x22e8ba,_0x12f2e1){var _0x3c1400=urlParse(_0x1f8895);var _0x21ac69=_0x3c1400['protocol']===_0x9467('0xe')?https:http;var _0x4e429e={'host':_0x3c1400[_0x9467('0xf')],'path':_0x3c1400[_0x9467('0x3')],'headers':{'user-agent':_0x9467('0x10')}};_0x21ac69[_0x9467('0x11')](_0x4e429e,function(_0x4b9c53){if(_0x4b9c53[_0x9467('0x12')]!==0xc8){logger['error'](_0x9467('0x13')+_0x1f8895+_0x9467('0x14')+_0x4b9c53[_0x9467('0x12')]+'\x20('+_0x4b9c53[_0x9467('0x15')]+')');_0x12f2e1(new Error('request\x20to\x20'+_0x1f8895+'\x20failed,\x20status\x20code\x20=\x20'+_0x4b9c53[_0x9467('0x12')]+'\x20('+_0x4b9c53[_0x9467('0x15')]+')'));return;}var _0x38c390=fs[_0x9467('0x16')](_0x4eecd2);_0x38c390['on'](_0x9467('0x17'),function(){logger[_0x9467('0x18')](_0x9467('0x19'));_0x38c390[_0x9467('0x1a')](_0x22e8ba);});_0x38c390['on'](_0x9467('0x1b'),function(_0x123344){fs['unlink'](_0x4eecd2);logger['error'](_0x9467('0x1c'),_0x123344);_0x12f2e1(_0x123344);});_0x4b9c53[_0x9467('0x1d')](_0x38c390);})['on'](_0x9467('0x1b'),function(_0x51d3a0){logger[_0x9467('0x1b')](_0x51d3a0);_0x12f2e1(_0x51d3a0);})[_0x9467('0x1e')]();});}function uploadFile(_0x56d6f0){return new BPromise(function(_0x5b2351,_0x587c61){var _0xa201ae=urlParse(_0x56d6f0);var _0x527a6f=_0xa201ae['protocol']==='https:'?https:http;var _0x2e6e43={'host':_0xa201ae[_0x9467('0xf')],'path':_0xa201ae[_0x9467('0x3')],'headers':{'user-agent':_0x9467('0x10')}};_0x527a6f['get'](_0x2e6e43,function(_0x4d58a9){if(_0x4d58a9[_0x9467('0x12')]!==0xc8){_0x587c61(new Error(_0x9467('0x13')+_0x56d6f0+_0x9467('0x14')+_0x4d58a9['statusCode']+'\x20('+_0x4d58a9[_0x9467('0x15')]+')'));return;}var _0x191fc7='';_0x4d58a9['on'](_0x9467('0x1f'),function(_0x4c59d5){_0x191fc7+=_0x4c59d5;});_0x4d58a9['on']('end',function(){_0x5b2351(_0x191fc7);});})['on'](_0x9467('0x1b'),function(_0x5bd0b8){_0x587c61(_0x5bd0b8);})[_0x9467('0x1e')]();});}function convertFile(_0x3c3af7,_0x47cb15){return new BPromise(function(_0x107787,_0x4ebc80){var _0x5bbb40=sox['transcode'](_0x3c3af7,_0x47cb15,{'sampleRate':0x1f40,'format':_0x9467('0x20'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x5bbb40['on']('error',function(_0x26692e){logger[_0x9467('0x1b')](_0x9467('0x21'),_0x26692e);_0x4ebc80(_0x26692e);});_0x5bbb40['on'](_0x9467('0x1e'),function(){logger[_0x9467('0x18')](_0x9467('0x22'));_0x107787();});_0x5bbb40[_0x9467('0x23')]();});}function base64Decode(_0x2896bc,_0x6b1d13){var _0x70f421=path[_0x9467('0x24')](__dirname,_0x9467('0x25'),rs['generate'](0x4)+'.wav');fs[_0x9467('0x26')](_0x70f421,_0x2896bc,_0x9467('0x27'));return convertFile(_0x70f421,_0x6b1d13)['then'](function(){try{fs['unlink'](_0x70f421);fs[_0x9467('0x28')](_0x6b1d13,'777');}catch(_0x5f4e97){logger[_0x9467('0x1b')](_0x5f4e97);}return _0x6b1d13['split']('.')[0x0];});}function base64Encode(_0x2bd283){var _0x5e0aa5=fs['readFileSync'](_0x2bd283);return new Buffer(_0x5e0aa5)['toString'](_0x9467('0x27'));}exports[_0x9467('0x29')]=function(_0x2da82f,_0x3b35f4,_0xf16ab9,_0x52fc5a,_0x1c00fc,_0x126b22){var _0x1493d4,_0xfce911;var _0x53b2d7=_0x9467('0x2a');var _0x4ef44a='?key='+_0x2da82f;var _0x46e21a={};if(_0x3b35f4===_0x9467('0x2b')){_0x46e21a[_0x9467('0x2c')]={'ssml':_0xf16ab9};}else{_0x46e21a[_0x9467('0x2c')]={'text':_0xf16ab9};};_0x46e21a['voice']={'languageCode':_0x52fc5a,'ssmlGender':_0x1c00fc};_0x46e21a['audioConfig']={'audioEncoding':_0x9467('0x2d'),'sampleRateHertz':0x1f40};var _0x1a125a={'url':_0x53b2d7+'text:synthesize'+_0x4ef44a,'method':_0x9467('0x2e'),'json':!![],'body':_0x46e21a};return rp(_0x1a125a)['then'](function(_0x43b8a7){return new BPromise(function(_0x4f792a,_0x59271f){_0x1493d4=path['resolve'](__dirname,_0x9467('0x25'),rs[_0x9467('0x2f')](0x4)+_0x9467('0x30'));var _0x5a61c8=Buffer[_0x9467('0x31')](_0x43b8a7[_0x9467('0x32')],_0x9467('0x27'));return fs[_0x9467('0x33')](_0x1493d4,_0x5a61c8,function(_0x1cbabf){_0x59271f(_0x1cbabf);},function(_0x25fe44){fs[_0x9467('0x28')](_0x1493d4,_0x9467('0x34'));_0x4f792a(_0x25fe44);});});})[_0x9467('0x35')](function(_0x7f1f73){_0xfce911=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+_0x9467('0x36'));return convertFile(_0x1493d4,_0xfce911);})[_0x9467('0x35')](function(){try{fs[_0x9467('0x37')](_0x1493d4);fs[_0x9467('0x28')](_0xfce911,'777');}catch(_0x2f7be9){logger['error'](_0x2f7be9);}logger[_0x9467('0x18')]('googleCloudTTS\x20path',_0xfce911[_0x9467('0x38')]('.')[0x0]);return _0xfce911[_0x9467('0x38')]('.')[0x0];});};exports[_0x9467('0x39')]=function(_0x3ef637,_0x2ccc67){var _0xe5d40e=_0x9467('0x3a');var _0x41857c,_0x51bfa4;var _0x3dd2ae;var _0xeb45b7={'encoding':_0x9467('0x3b'),'method':_0x9467('0x2e'),'timeout':0x2710,'url':_0xe5d40e,'headers':{'Content-Type':_0x9467('0x3c')},'body':_0x9467('0x3d')+encodeURIComponent(JSON[_0x9467('0x3e')]([[[_0x9467('0x3f'),JSON[_0x9467('0x3e')]([_0x3ef637,_0x2ccc67||'en',![],_0x9467('0x40')]),null,'generic']]]))};return rp(_0xeb45b7)[_0x9467('0x35')](function(_0x952b71){try{_0x3dd2ae=eval(_0x952b71[_0x9467('0x41')](0x5))[0x0][0x2];}catch(_0x4c897f){throw new Error(_0x9467('0x42')+_0x952b71[_0x9467('0x1f')]);}if(!_0x3dd2ae){if(_0x3ef637[_0x9467('0x43')]>0xc8){throw new Error(_0x9467('0x44'));}else{throw new Error('lang\x20\x22'+_0x2ccc67+_0x9467('0x45'));}}try{_0x3dd2ae=eval(_0x3dd2ae)[0x0];}catch(_0x3da549){throw new Error(_0x9467('0x42')+res[_0x9467('0x1f')]);}const _0x3d1cac=_0x3dd2ae;_0x41857c=path[_0x9467('0x24')](__dirname,'tmp',rs[_0x9467('0x2f')](0x4)+'.mp3');fs[_0x9467('0x26')](_0x41857c,_0x3dd2ae,{'encoding':_0x9467('0x27')});_0x51bfa4=path[_0x9467('0x24')](__dirname,_0x9467('0x25'),rs[_0x9467('0x2f')](0x4)+_0x9467('0x36'));return convertFile(_0x41857c,_0x51bfa4);})['then'](function(){try{fs[_0x9467('0x37')](_0x41857c);fs[_0x9467('0x28')](_0x51bfa4,_0x9467('0x34'));}catch(_0x42c962){logger[_0x9467('0x1b')](_0x42c962);}logger[_0x9467('0x18')](_0x9467('0x46'),_0x51bfa4['split']('.')[0x0]);return _0x51bfa4[_0x9467('0x38')]('.')[0x0];});};exports[_0x9467('0x47')]=function(_0x254102,_0x3452e6,_0x301add){return google[_0x9467('0x48')](_0x254102,_0x3452e6,_0x301add)[_0x9467('0x35')](function(_0x414aaa){logger[_0x9467('0x18')](_0x414aaa[_0x9467('0x49')]);return rp(_0x414aaa);})['then'](function(_0x5ba9c2){var _0x40599f='';var _0x68f30f=0x0;try{fs[_0x9467('0x37')](_0x254102);}catch(_0x9d1e13){logger['error'](_0x9d1e13);}if(_0x5ba9c2&&_0x5ba9c2[_0x9467('0x4a')]){_0x40599f=_0x5ba9c2[_0x9467('0x4a')][_0x9467('0x4b')](function(_0x11103b){return _0x11103b&&_0x11103b[_0x9467('0x4c')][0x0]&&_0x11103b[_0x9467('0x4c')][0x0]['transcript']?_0x11103b[_0x9467('0x4c')][0x0]['transcript']:'';})[_0x9467('0x4d')]('\x0a');_0x68f30f=_0x5ba9c2[_0x9467('0x4a')][_0x9467('0x4b')](function(_0x353b39){return _0x353b39&&_0x353b39[_0x9467('0x4c')][0x0]&&_0x353b39['alternatives'][0x0][_0x9467('0x4e')]?_0x353b39[_0x9467('0x4c')][0x0][_0x9467('0x4e')]:0x0;})[_0x9467('0x4d')]('\x0a');}logger[_0x9467('0x18')](_0x9467('0x4f'),_0x40599f);logger['info'](_0x9467('0x50'),_0x68f30f);return{'transcript':_0x40599f,'confidence':_0x68f30f};})[_0x9467('0x51')](function(_0x48dead){logger[_0x9467('0x1b')](_0x9467('0x52'),_0x48dead[_0x9467('0x12')],_0x48dead[_0x9467('0x53')],_0x48dead['message']);});};exports[_0x9467('0x54')]=function(_0x1f3bbc,_0x372a35,_0x1011a7,_0xc3f1ac){var _0x5da1a3=apiai(_0x372a35,{'language':_0xc3f1ac||'en'});return _0x5da1a3[_0x9467('0x55')](_0x1011a7,{'sessionId':md5(_0x1f3bbc)})['then'](function(_0x3cacff){logger[_0x9467('0x18')](JSON[_0x9467('0x3e')](_0x3cacff));return{'source':_0x3cacff[_0x9467('0x56')][_0x9467('0x57')],'resolvedQuery':_0x3cacff[_0x9467('0x56')][_0x9467('0x58')],'action':_0x3cacff[_0x9467('0x56')]['action'],'actionIncomplete':_0x3cacff[_0x9467('0x56')][_0x9467('0x59')],'speech':_0x3cacff[_0x9467('0x56')][_0x9467('0x5a')][_0x9467('0x5b')],'score':_0x3cacff[_0x9467('0x56')][_0x9467('0x5c')],'statusCode':_0x3cacff['status']['code'],'endConversation':_0x3cacff[_0x9467('0x56')][_0x9467('0x5d')]['endConversation']||![],'isFallbackIntent':_0x3cacff[_0x9467('0x56')][_0x9467('0x5d')]['isFallbackIntent']};});};exports[_0x9467('0x5e')]=function(_0x47223c,_0x3f25e1,_0x2f5568,_0x63cdf6,_0x4c7317,_0x51a03d){var _0x51ea0e=_0x63cdf6[_0x9467('0x5f')](/\\n/g,'\x0a');var _0x2a153b={'credentials':{'private_key':_0x51ea0e,'client_email':_0x2f5568}};var _0x34010d=new dialogflow['SessionsClient'](_0x2a153b);var _0x1c1035=_0x34010d[_0x9467('0x60')](_0x3f25e1,md5(_0x47223c));var _0x5a5690={'session':_0x1c1035,'queryInput':{'text':{'text':_0x4c7317,'languageCode':_0x51a03d}}};return _0x34010d[_0x9467('0x61')](_0x5a5690)[_0x9467('0x35')](function(_0x41cbd4){if(_0x41cbd4&&_0x41cbd4[_0x9467('0x43')]){logger['info']('Dialogflow\x20V2\x20response:',JSON[_0x9467('0x3e')](_0x41cbd4));var _0x4c1f33=_0x41cbd4[0x0];if(_0x4c1f33){var _0x3d7459={'action':_0x4c1f33[_0x9467('0x62')][_0x9467('0x63')],'allRequiredParamsPresent':_0x4c1f33[_0x9467('0x62')][_0x9467('0x64')],'endConversation':_0x4c1f33[_0x9467('0x62')][_0x9467('0x65')]&&_0x4c1f33['queryResult']['diagnosticInfo']['fields']?_0x4c1f33[_0x9467('0x62')]['diagnosticInfo'][_0x9467('0x66')][_0x9467('0x67')][_0x9467('0x68')]:![],'fulfillmentText':_0x4c1f33[_0x9467('0x62')][_0x9467('0x69')],'intentName':_0x4c1f33[_0x9467('0x62')][_0x9467('0x6a')][_0x9467('0x53')],'intentDisplayName':_0x4c1f33[_0x9467('0x62')][_0x9467('0x6a')][_0x9467('0x6b')],'isFallbackIntent':_0x4c1f33[_0x9467('0x62')]['intent'][_0x9467('0x6c')],'languageCode':_0x4c1f33[_0x9467('0x62')][_0x9467('0x6d')],'queryText':_0x4c1f33['queryResult']['queryText'],'responseId':_0x4c1f33[_0x9467('0x6e')],'score':_0x4c1f33['queryResult'][_0x9467('0x6f')],'speech':_0x4c1f33[_0x9467('0x62')][_0x9467('0x69')],'providerResponse':JSON[_0x9467('0x3e')](_0x41cbd4)};return _0x3d7459;}}});};exports['tildeASR']=function(_0x449777,_0x2026e4,_0x193257,_0x4de1ef){return tilde[_0x9467('0x48')](_0x449777,_0x2026e4,_0x193257,_0x4de1ef)['then'](function(_0xcf521c){try{fs[_0x9467('0x37')](_0x449777);}catch(_0x1bd148){logger[_0x9467('0x1b')](_0x1bd148);}logger['info'](_0x9467('0x70'),_0xcf521c[_0x9467('0x71')]);logger[_0x9467('0x18')](_0x9467('0x72'),_0xcf521c['confidence']);return _0xcf521c;});};exports['awsPolly']=function(_0x1eebb4,_0x52a45d,_0xf1dfbe,_0x3ce325,_0x5d3131,_0x5d8992){var _0x1d1531=path[_0x9467('0x24')](__dirname,_0x9467('0x25'),rs['generate'](0x4)+'.mp3');var _0x52bfdd;return aws[_0x9467('0x73')](_0x1eebb4,_0x52a45d,_0xf1dfbe,_0x3ce325,_0x5d3131,_0x5d8992,_0x1d1531)[_0x9467('0x35')](function(){_0x52bfdd=path['resolve'](__dirname,_0x9467('0x25'),rs[_0x9467('0x2f')](0x4)+'.wav');return convertFile(_0x1d1531,_0x52bfdd);})[_0x9467('0x35')](function(){try{fs[_0x9467('0x37')](_0x1d1531);fs['chmodSync'](_0x52bfdd,'777');}catch(_0x382711){logger[_0x9467('0x1b')](_0x382711);}return _0x52bfdd['split']('.')[0x0];});};exports[_0x9467('0x74')]=function(_0xa27082,_0x38fe0a,_0x4d5561,_0xb5c9ab,_0x537d6d,_0x823b31){return aws[_0x9467('0x75')](_0xa27082,_0x38fe0a,_0x4d5561,_0xb5c9ab,_0x537d6d,_0x823b31)[_0x9467('0x35')](function(_0x3da870){logger[_0x9467('0x18')](JSON[_0x9467('0x3e')](_0x3da870));return _0x3da870;});};exports[_0x9467('0x76')]=function(_0x18061e,_0x54fe96,_0x44e0a5,_0x32d361){var _0x493bf0=util[_0x9467('0x77')]('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x18061e,encodeURIComponent(_0x54fe96),_0x44e0a5,_0x32d361);var _0x265d13=path[_0x9467('0x24')](__dirname,_0x9467('0x25'),rs[_0x9467('0x2f')](0x4)+'.mp3');var _0x3959b1;return downloadFile(_0x493bf0,_0x265d13)[_0x9467('0x35')](function(){_0x3959b1=path['resolve'](__dirname,'tmp',rs[_0x9467('0x2f')](0x4)+_0x9467('0x36'));return convertFile(_0x265d13,_0x3959b1);})['then'](function(){try{fs[_0x9467('0x37')](_0x265d13);fs[_0x9467('0x28')](_0x3959b1,_0x9467('0x34'));}catch(_0x3942cf){logger[_0x9467('0x1b')](_0x3942cf);}return _0x3959b1[_0x9467('0x38')]('.')[0x0];});};exports[_0x9467('0x78')]=function(_0x557599,_0x1f46b1,_0x59fb29,_0x46eed7){var _0xadd841=util['format'](_0x9467('0x79'),ISPEECH_API,_0x1f46b1,_0x59fb29,base64Encode(_0x557599),_0x46eed7?util[_0x9467('0x77')](_0x9467('0x7a'),encodeURIComponent(_0x46eed7)):_0x9467('0x7b'));return uploadFile(_0xadd841)[_0x9467('0x35')](function(_0x3170a9){return querystring[_0x9467('0x7c')](_0x3170a9);});};exports[_0x9467('0x7d')]=function(_0x167b2c,_0x14630f){return sestek[_0x9467('0x7e')](_0x167b2c,_0x14630f)['then'](function(_0x19b1c0){logger[_0x9467('0x18')](JSON['stringify'](_0x19b1c0));var _0x1e6c13={'speech':_0x19b1c0['text'],'action':_0x19b1c0[_0x9467('0x7f')]?_0x19b1c0[_0x9467('0x7f')][_0x9467('0x80')]:undefined,'actiondata':_0x19b1c0[_0x9467('0x7f')]?_0x19b1c0[_0x9467('0x7f')][_0x9467('0x81')]:undefined};if(_0x19b1c0[_0x9467('0x7f')]&&_0x19b1c0[_0x9467('0x7f')][_0x9467('0x82')]){return base64Decode(_0x19b1c0['channelData']['AudioFromTts'][_0x9467('0x83')],path[_0x9467('0x24')](__dirname,_0x9467('0x25'),rs['generate'](0x4)+_0x9467('0x36')))[_0x9467('0x35')](function(_0x26d0d6){_0x1e6c13[_0x9467('0x84')]=_0x26d0d6;return _0x1e6c13;});}return _0x1e6c13;});};exports[_0x9467('0x85')]=function(){return __dirname;}; \ No newline at end of file +var _0xc1a2=['polly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','model=%s','freeform=3','sestekNDA','text','CustomAction','channelData','audiofile','dirName','dialogflow','http','md5','path','querystring','sox','google-tts-api','url','parse','util','./google','./sestek','./tilde','../../../config/logger','agi','protocol','https:','host','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','close','unlink','download\x20error','pipe','data','end','transcode','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','writeFileSync','then','chmodSync','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','audioConfig','MP3','text:synthesize','POST','.mp3','from','audioContent','base64','writeFile','777','googleCloudTTS\x20path','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','stringify','jQ1olc','null','slice','text\x20length\x20limit\x20reached','lang\x20\x22','info','goggleTTS\x20path','googleASR','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','message','googleDialogflow','result','source','action','actionIncomplete','fulfillment','score','status','code','metadata','endConversation','googleDialogflowV2','replace','sessionPath','detectIntent','length','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','intent','name','displayName','isFallback','languageCode','responseId','intentDetectionConfidence','fulfillmentText','asr','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly'];(function(_0x451bd9,_0xcf720c){var _0x4cc3cf=function(_0x16e6ea){while(--_0x16e6ea){_0x451bd9['push'](_0x451bd9['shift']());}};_0x4cc3cf(++_0xcf720c);}(_0xc1a2,0x119));var _0x2c1a=function(_0x1bcf84,_0x11b156){_0x1bcf84=_0x1bcf84-0x0;var _0x56d198=_0xc1a2[_0x1bcf84];return _0x56d198;};'use strict';var apiai=require('apiai-promise');var BPromise=require('bluebird');var dialogflow=require(_0x2c1a('0x0'));var fs=require('fs');var http=require(_0x2c1a('0x1'));var https=require('https');var md5=require(_0x2c1a('0x2'));var path=require(_0x2c1a('0x3'));var querystring=require(_0x2c1a('0x4'));var rp=require('request-promise');var rs=require('randomstring');var sox=require(_0x2c1a('0x5'));var tts=require(_0x2c1a('0x6'));var urlParse=require(_0x2c1a('0x7'))[_0x2c1a('0x8')];var util=require(_0x2c1a('0x9'));var aws=require('./aws');var google=require(_0x2c1a('0xa'));var sestek=require(_0x2c1a('0xb'));var tilde=require(_0x2c1a('0xc'));var logger=require(_0x2c1a('0xd'))(_0x2c1a('0xe'));var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x28b3ea,_0x4aed2e){return new BPromise(function(_0x477ad0,_0x521196){var _0x5cc46b=urlParse(_0x28b3ea);var _0x15a7f0=_0x5cc46b[_0x2c1a('0xf')]===_0x2c1a('0x10')?https:http;var _0x3610ae={'host':_0x5cc46b[_0x2c1a('0x11')],'path':_0x5cc46b['path'],'headers':{'user-agent':_0x2c1a('0x12')}};_0x15a7f0[_0x2c1a('0x13')](_0x3610ae,function(_0x57f026){if(_0x57f026[_0x2c1a('0x14')]!==0xc8){logger[_0x2c1a('0x15')](_0x2c1a('0x16')+_0x28b3ea+_0x2c1a('0x17')+_0x57f026[_0x2c1a('0x14')]+'\x20('+_0x57f026[_0x2c1a('0x18')]+')');_0x521196(new Error(_0x2c1a('0x16')+_0x28b3ea+_0x2c1a('0x17')+_0x57f026[_0x2c1a('0x14')]+'\x20('+_0x57f026[_0x2c1a('0x18')]+')'));return;}var _0x345a29=fs[_0x2c1a('0x19')](_0x4aed2e);_0x345a29['on'](_0x2c1a('0x1a'),function(){logger['info']('finish\x20download\x20file');_0x345a29[_0x2c1a('0x1b')](_0x477ad0);});_0x345a29['on'](_0x2c1a('0x15'),function(_0x17c58d){fs[_0x2c1a('0x1c')](_0x4aed2e);logger['error'](_0x2c1a('0x1d'),_0x17c58d);_0x521196(_0x17c58d);});_0x57f026[_0x2c1a('0x1e')](_0x345a29);})['on'](_0x2c1a('0x15'),function(_0x50cfcd){logger['error'](_0x50cfcd);_0x521196(_0x50cfcd);})['end']();});}function uploadFile(_0x1a0fe4){return new BPromise(function(_0x30e6f5,_0x39b9ec){var _0x448562=urlParse(_0x1a0fe4);var _0x13f630=_0x448562[_0x2c1a('0xf')]===_0x2c1a('0x10')?https:http;var _0x4823a7={'host':_0x448562['host'],'path':_0x448562[_0x2c1a('0x3')],'headers':{'user-agent':_0x2c1a('0x12')}};_0x13f630['get'](_0x4823a7,function(_0x46d64b){if(_0x46d64b[_0x2c1a('0x14')]!==0xc8){_0x39b9ec(new Error(_0x2c1a('0x16')+_0x1a0fe4+_0x2c1a('0x17')+_0x46d64b['statusCode']+'\x20('+_0x46d64b[_0x2c1a('0x18')]+')'));return;}var _0x381729='';_0x46d64b['on'](_0x2c1a('0x1f'),function(_0x50a6fc){_0x381729+=_0x50a6fc;});_0x46d64b['on'](_0x2c1a('0x20'),function(){_0x30e6f5(_0x381729);});})['on'](_0x2c1a('0x15'),function(_0xe7be8b){_0x39b9ec(_0xe7be8b);})[_0x2c1a('0x20')]();});}function convertFile(_0x433676,_0x5c055b){return new BPromise(function(_0x497148,_0x34e43c){var _0x2a1bd0=sox[_0x2c1a('0x21')](_0x433676,_0x5c055b,{'sampleRate':0x1f40,'format':_0x2c1a('0x22'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2a1bd0['on'](_0x2c1a('0x15'),function(_0x563ce4){logger[_0x2c1a('0x15')](_0x2c1a('0x23'),_0x563ce4);_0x34e43c(_0x563ce4);});_0x2a1bd0['on']('end',function(){logger['info'](_0x2c1a('0x24'));_0x497148();});_0x2a1bd0[_0x2c1a('0x25')]();});}function base64Decode(_0x564ba7,_0x2cef93){var _0x513be2=path[_0x2c1a('0x26')](__dirname,_0x2c1a('0x27'),rs[_0x2c1a('0x28')](0x4)+_0x2c1a('0x29'));fs[_0x2c1a('0x2a')](_0x513be2,_0x564ba7,'base64');return convertFile(_0x513be2,_0x2cef93)[_0x2c1a('0x2b')](function(){try{fs[_0x2c1a('0x1c')](_0x513be2);fs[_0x2c1a('0x2c')](_0x2cef93,'777');}catch(_0x494674){logger['error'](_0x494674);}return _0x2cef93[_0x2c1a('0x2d')]('.')[0x0];});}function base64Encode(_0xfae529){var _0x1d00e3=fs[_0x2c1a('0x2e')](_0xfae529);return new Buffer(_0x1d00e3)[_0x2c1a('0x2f')]('base64');}exports[_0x2c1a('0x30')]=function(_0x35387d,_0xa86438,_0xe361bd,_0x4392fc,_0x2681eb,_0x47cf9a){var _0x1df22c,_0x531e04;var _0x341d1f=_0x2c1a('0x31');var _0x350cfd=_0x2c1a('0x32')+_0x35387d;var _0x15c46e={};if(_0xa86438===_0x2c1a('0x33')){_0x15c46e[_0x2c1a('0x34')]={'ssml':_0xe361bd};}else{_0x15c46e[_0x2c1a('0x34')]={'text':_0xe361bd};};_0x15c46e['voice']={'languageCode':_0x4392fc,'ssmlGender':_0x2681eb};_0x15c46e[_0x2c1a('0x35')]={'audioEncoding':_0x2c1a('0x36'),'sampleRateHertz':0x1f40};var _0x4ee132={'url':_0x341d1f+_0x2c1a('0x37')+_0x350cfd,'method':_0x2c1a('0x38'),'json':!![],'body':_0x15c46e};return rp(_0x4ee132)[_0x2c1a('0x2b')](function(_0x5cd952){return new BPromise(function(_0x54386a,_0x4fae3b){_0x1df22c=path[_0x2c1a('0x26')](__dirname,_0x2c1a('0x27'),rs[_0x2c1a('0x28')](0x4)+_0x2c1a('0x39'));var _0x53e83a=Buffer[_0x2c1a('0x3a')](_0x5cd952[_0x2c1a('0x3b')],_0x2c1a('0x3c'));return fs[_0x2c1a('0x3d')](_0x1df22c,_0x53e83a,function(_0x218ae8){_0x4fae3b(_0x218ae8);},function(_0x392284){fs[_0x2c1a('0x2c')](_0x1df22c,_0x2c1a('0x3e'));_0x54386a(_0x392284);});});})['then'](function(_0x300daf){_0x531e04=path['resolve'](__dirname,_0x2c1a('0x27'),rs[_0x2c1a('0x28')](0x4)+'.wav');return convertFile(_0x1df22c,_0x531e04);})[_0x2c1a('0x2b')](function(){try{fs['unlink'](_0x1df22c);fs['chmodSync'](_0x531e04,'777');}catch(_0x3e54ac){logger[_0x2c1a('0x15')](_0x3e54ac);}logger['info'](_0x2c1a('0x3f'),_0x531e04[_0x2c1a('0x2d')]('.')[0x0]);return _0x531e04['split']('.')[0x0];});};exports['googleTTS']=function(_0x393397,_0x386ff9){var _0x10fc47=_0x2c1a('0x40');var _0x4de643,_0x31c592;var _0x5be679;var _0x35fb02={'encoding':'utf8','method':'POST','timeout':0x2710,'url':_0x10fc47,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':'f.req='+encodeURIComponent(JSON[_0x2c1a('0x41')]([[[_0x2c1a('0x42'),JSON[_0x2c1a('0x41')]([_0x393397,_0x386ff9||'en',![],_0x2c1a('0x43')]),null,'generic']]]))};return rp(_0x35fb02)[_0x2c1a('0x2b')](function(_0x5f53e6){try{_0x5be679=eval(_0x5f53e6[_0x2c1a('0x44')](0x5))[0x0][0x2];}catch(_0x504e76){throw new Error('parse\x20response\x20failed:\x0a'+_0x5f53e6[_0x2c1a('0x1f')]);}if(!_0x5be679){if(_0x393397['length']>0xc8){throw new Error(_0x2c1a('0x45'));}else{throw new Error(_0x2c1a('0x46')+_0x386ff9+'\x22\x20might\x20not\x20exist');}}try{_0x5be679=eval(_0x5be679)[0x0];}catch(_0xbf849a){throw new Error('parse\x20response\x20failed:\x0a'+res[_0x2c1a('0x1f')]);}const _0x2b2d99=_0x5be679;_0x4de643=path[_0x2c1a('0x26')](__dirname,_0x2c1a('0x27'),rs[_0x2c1a('0x28')](0x4)+'.mp3');fs['writeFileSync'](_0x4de643,_0x5be679,{'encoding':'base64'});_0x31c592=path['resolve'](__dirname,_0x2c1a('0x27'),rs['generate'](0x4)+_0x2c1a('0x29'));return convertFile(_0x4de643,_0x31c592);})[_0x2c1a('0x2b')](function(){try{fs[_0x2c1a('0x1c')](_0x4de643);fs[_0x2c1a('0x2c')](_0x31c592,_0x2c1a('0x3e'));}catch(_0x1f4c00){logger[_0x2c1a('0x15')](_0x1f4c00);}logger[_0x2c1a('0x47')](_0x2c1a('0x48'),_0x31c592[_0x2c1a('0x2d')]('.')[0x0]);return _0x31c592[_0x2c1a('0x2d')]('.')[0x0];});};exports[_0x2c1a('0x49')]=function(_0x2850b4,_0x512aab,_0x3d0327){return google['asr'](_0x2850b4,_0x512aab,_0x3d0327)[_0x2c1a('0x2b')](function(_0x168ab9){logger['info'](_0x168ab9[_0x2c1a('0x4a')]);return rp(_0x168ab9);})[_0x2c1a('0x2b')](function(_0x10cb03){var _0x2d23e8='';var _0x52bebd=0x0;try{fs[_0x2c1a('0x1c')](_0x2850b4);}catch(_0x331a9b){logger[_0x2c1a('0x15')](_0x331a9b);}if(_0x10cb03&&_0x10cb03['results']){_0x2d23e8=_0x10cb03[_0x2c1a('0x4b')][_0x2c1a('0x4c')](function(_0x35984b){return _0x35984b&&_0x35984b[_0x2c1a('0x4d')][0x0]&&_0x35984b['alternatives'][0x0][_0x2c1a('0x4e')]?_0x35984b[_0x2c1a('0x4d')][0x0]['transcript']:'';})[_0x2c1a('0x4f')]('\x0a');_0x52bebd=_0x10cb03[_0x2c1a('0x4b')]['map'](function(_0x2c5c8e){return _0x2c5c8e&&_0x2c5c8e[_0x2c1a('0x4d')][0x0]&&_0x2c5c8e[_0x2c1a('0x4d')][0x0][_0x2c1a('0x50')]?_0x2c5c8e[_0x2c1a('0x4d')][0x0]['confidence']:0x0;})['join']('\x0a');}logger['info'](_0x2c1a('0x51'),_0x2d23e8);logger[_0x2c1a('0x47')]('googleASR\x20confidence',_0x52bebd);return{'transcript':_0x2d23e8,'confidence':_0x52bebd};})['catch'](function(_0x3a3932){logger[_0x2c1a('0x15')]('[%s]\x20%s:%s',_0x3a3932[_0x2c1a('0x14')],_0x3a3932['name'],_0x3a3932[_0x2c1a('0x52')]);});};exports[_0x2c1a('0x53')]=function(_0x483409,_0x5f38cd,_0x551cb1,_0x2ef19f){var _0x4aa532=apiai(_0x5f38cd,{'language':_0x2ef19f||'en'});return _0x4aa532['textRequest'](_0x551cb1,{'sessionId':md5(_0x483409)})[_0x2c1a('0x2b')](function(_0x7ac798){logger[_0x2c1a('0x47')](JSON['stringify'](_0x7ac798));return{'source':_0x7ac798[_0x2c1a('0x54')][_0x2c1a('0x55')],'resolvedQuery':_0x7ac798[_0x2c1a('0x54')]['resolvedQuery'],'action':_0x7ac798[_0x2c1a('0x54')][_0x2c1a('0x56')],'actionIncomplete':_0x7ac798[_0x2c1a('0x54')][_0x2c1a('0x57')],'speech':_0x7ac798['result'][_0x2c1a('0x58')]['speech'],'score':_0x7ac798[_0x2c1a('0x54')][_0x2c1a('0x59')],'statusCode':_0x7ac798[_0x2c1a('0x5a')][_0x2c1a('0x5b')],'endConversation':_0x7ac798[_0x2c1a('0x54')][_0x2c1a('0x5c')][_0x2c1a('0x5d')]||![],'isFallbackIntent':_0x7ac798['result']['metadata']['isFallbackIntent']};});};exports[_0x2c1a('0x5e')]=function(_0x414f40,_0x33547e,_0x2a9d07,_0x47f0cb,_0x119a2b,_0x26683b){var _0x16e069=_0x47f0cb[_0x2c1a('0x5f')](/\\n/g,'\x0a');var _0x13e8dd={'credentials':{'private_key':_0x16e069,'client_email':_0x2a9d07}};var _0x158686=new dialogflow['SessionsClient'](_0x13e8dd);var _0x1338ea=_0x158686[_0x2c1a('0x60')](_0x33547e,md5(_0x414f40));var _0x3ef2b5={'session':_0x1338ea,'queryInput':{'text':{'text':_0x119a2b,'languageCode':_0x26683b}}};return _0x158686[_0x2c1a('0x61')](_0x3ef2b5)[_0x2c1a('0x2b')](function(_0x359d0a){if(_0x359d0a&&_0x359d0a[_0x2c1a('0x62')]){logger[_0x2c1a('0x47')](_0x2c1a('0x63'),JSON['stringify'](_0x359d0a));var _0xa91a52=_0x359d0a[0x0];if(_0xa91a52){var _0x2a404d={'action':_0xa91a52[_0x2c1a('0x64')][_0x2c1a('0x56')],'allRequiredParamsPresent':_0xa91a52[_0x2c1a('0x64')][_0x2c1a('0x65')],'endConversation':_0xa91a52[_0x2c1a('0x64')][_0x2c1a('0x66')]&&_0xa91a52[_0x2c1a('0x64')]['diagnosticInfo']['fields']?_0xa91a52[_0x2c1a('0x64')][_0x2c1a('0x66')][_0x2c1a('0x67')][_0x2c1a('0x68')][_0x2c1a('0x69')]:![],'fulfillmentText':_0xa91a52['queryResult']['fulfillmentText'],'intentName':_0xa91a52[_0x2c1a('0x64')][_0x2c1a('0x6a')][_0x2c1a('0x6b')],'intentDisplayName':_0xa91a52[_0x2c1a('0x64')][_0x2c1a('0x6a')][_0x2c1a('0x6c')],'isFallbackIntent':_0xa91a52[_0x2c1a('0x64')][_0x2c1a('0x6a')][_0x2c1a('0x6d')],'languageCode':_0xa91a52[_0x2c1a('0x64')][_0x2c1a('0x6e')],'queryText':_0xa91a52[_0x2c1a('0x64')]['queryText'],'responseId':_0xa91a52[_0x2c1a('0x6f')],'score':_0xa91a52[_0x2c1a('0x64')][_0x2c1a('0x70')],'speech':_0xa91a52['queryResult'][_0x2c1a('0x71')],'providerResponse':JSON[_0x2c1a('0x41')](_0x359d0a)};return _0x2a404d;}}});};exports['tildeASR']=function(_0x2a22c2,_0x4252f2,_0x4129f2,_0x37f73f){return tilde[_0x2c1a('0x72')](_0x2a22c2,_0x4252f2,_0x4129f2,_0x37f73f)[_0x2c1a('0x2b')](function(_0x1a4b51){try{fs['unlink'](_0x2a22c2);}catch(_0x3a3a54){logger[_0x2c1a('0x15')](_0x3a3a54);}logger['info'](_0x2c1a('0x73'),_0x1a4b51[_0x2c1a('0x4e')]);logger[_0x2c1a('0x47')](_0x2c1a('0x74'),_0x1a4b51[_0x2c1a('0x50')]);return _0x1a4b51;});};exports[_0x2c1a('0x75')]=function(_0x1230a6,_0x3b3b00,_0x27ad0d,_0x2df3b6,_0x391ab9,_0x167ef9){var _0x255548=path['resolve'](__dirname,_0x2c1a('0x27'),rs['generate'](0x4)+'.mp3');var _0x200f2f;return aws[_0x2c1a('0x76')](_0x1230a6,_0x3b3b00,_0x27ad0d,_0x2df3b6,_0x391ab9,_0x167ef9,_0x255548)['then'](function(){_0x200f2f=path[_0x2c1a('0x26')](__dirname,'tmp',rs[_0x2c1a('0x28')](0x4)+_0x2c1a('0x29'));return convertFile(_0x255548,_0x200f2f);})[_0x2c1a('0x2b')](function(){try{fs[_0x2c1a('0x1c')](_0x255548);fs[_0x2c1a('0x2c')](_0x200f2f,'777');}catch(_0x89d910){logger[_0x2c1a('0x15')](_0x89d910);}return _0x200f2f['split']('.')[0x0];});};exports[_0x2c1a('0x77')]=function(_0xb11a94,_0x2e1441,_0x50a5c4,_0x511ce0,_0x3b00fe,_0x1ec44b){return aws[_0x2c1a('0x78')](_0xb11a94,_0x2e1441,_0x50a5c4,_0x511ce0,_0x3b00fe,_0x1ec44b)[_0x2c1a('0x2b')](function(_0x2dcd07){logger['info'](JSON[_0x2c1a('0x41')](_0x2dcd07));return _0x2dcd07;});};exports[_0x2c1a('0x79')]=function(_0x100e5d,_0x2f5cde,_0x30f08b,_0x59bc85){var _0xc46ec3=util[_0x2c1a('0x7a')](_0x2c1a('0x7b'),ISPEECH_API,_0x100e5d,encodeURIComponent(_0x2f5cde),_0x30f08b,_0x59bc85);var _0x151d97=path[_0x2c1a('0x26')](__dirname,_0x2c1a('0x27'),rs[_0x2c1a('0x28')](0x4)+_0x2c1a('0x39'));var _0x5c3ffb;return downloadFile(_0xc46ec3,_0x151d97)[_0x2c1a('0x2b')](function(){_0x5c3ffb=path[_0x2c1a('0x26')](__dirname,'tmp',rs[_0x2c1a('0x28')](0x4)+'.wav');return convertFile(_0x151d97,_0x5c3ffb);})[_0x2c1a('0x2b')](function(){try{fs[_0x2c1a('0x1c')](_0x151d97);fs[_0x2c1a('0x2c')](_0x5c3ffb,_0x2c1a('0x3e'));}catch(_0x378611){logger[_0x2c1a('0x15')](_0x378611);}return _0x5c3ffb['split']('.')[0x0];});};exports[_0x2c1a('0x7c')]=function(_0x75bbb8,_0x5f0c9b,_0x2240b2,_0x1966c9){var _0x34e574=util[_0x2c1a('0x7a')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x5f0c9b,_0x2240b2,base64Encode(_0x75bbb8),_0x1966c9?util[_0x2c1a('0x7a')](_0x2c1a('0x7d'),encodeURIComponent(_0x1966c9)):_0x2c1a('0x7e'));return uploadFile(_0x34e574)[_0x2c1a('0x2b')](function(_0xf8e50){return querystring[_0x2c1a('0x8')](_0xf8e50);});};exports[_0x2c1a('0x7f')]=function(_0x4192b8,_0xaf3eb5){return sestek['nda'](_0x4192b8,_0xaf3eb5)[_0x2c1a('0x2b')](function(_0x19e664){logger[_0x2c1a('0x47')](JSON['stringify'](_0x19e664));var _0x3ea14e={'speech':_0x19e664[_0x2c1a('0x80')],'action':_0x19e664['channelData']?_0x19e664['channelData'][_0x2c1a('0x81')]:undefined,'actiondata':_0x19e664[_0x2c1a('0x82')]?_0x19e664[_0x2c1a('0x82')]['CustomActionData']:undefined};if(_0x19e664[_0x2c1a('0x82')]&&_0x19e664[_0x2c1a('0x82')]['AudioFromTts']){return base64Decode(_0x19e664[_0x2c1a('0x82')]['AudioFromTts']['Data'],path[_0x2c1a('0x26')](__dirname,_0x2c1a('0x27'),rs[_0x2c1a('0x28')](0x4)+_0x2c1a('0x29')))[_0x2c1a('0x2b')](function(_0x5bff07){_0x3ea14e[_0x2c1a('0x83')]=_0x5bff07;return _0x3ea14e;});}return _0x3ea14e;});};exports[_0x2c1a('0x84')]=function(){return __dirname;}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/index.js b/server/services/agi/scripts/sestek/index.js index aad4e95..3278b03 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 _0x2740=['./nda'];(function(_0x35da54,_0x47e8d6){var _0x19d34d=function(_0x38b602){while(--_0x38b602){_0x35da54['push'](_0x35da54['shift']());}};_0x19d34d(++_0x47e8d6);}(_0x2740,0x13a));var _0x0274=function(_0x24fce3,_0x5ee22f){_0x24fce3=_0x24fce3-0x0;var _0x5a973d=_0x2740[_0x24fce3];return _0x5a973d;};var nda=require(_0x0274('0x0'));module['exports']={'nda':nda}; \ No newline at end of file +var _0x5727=['./nda','exports'];(function(_0x5ebd28,_0x582afc){var _0xad868=function(_0x44706f){while(--_0x44706f){_0x5ebd28['push'](_0x5ebd28['shift']());}};_0xad868(++_0x582afc);}(_0x5727,0x1d0));var _0x7572=function(_0x55dd69,_0xeb01b6){_0x55dd69=_0x55dd69-0x0;var _0x7a71cd=_0x5727[_0x55dd69];return _0x7a71cd;};var nda=require(_0x7572('0x0'));module[_0x7572('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 76b7c01..01d0e62 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 _0x23a8=['project','channelData','ndagenerate_audio','body','audio/wav','custom_action','custom_action_data','CustomActionData','info','stringify','url','agi','POST','ndauth_url','/token','password','username','then','resolve','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','callerid','calleridname','dnid','extension','text','Bearer\x20','access_token'];(function(_0x108c79,_0x39e18a){var _0x44788f=function(_0x489a3e){while(--_0x489a3e){_0x108c79['push'](_0x108c79['shift']());}};_0x44788f(++_0x39e18a);}(_0x23a8,0x172));var _0x823a=function(_0x3684bc,_0x3e7243){_0x3684bc=_0x3684bc-0x0;var _0x33b2c5=_0x23a8[_0x3684bc];return _0x33b2c5;};'use strict';var rp=require('request-promise');var url=require(_0x823a('0x0'));var logger=require('../../../../../config/logger')(_0x823a('0x1'));module['exports']=function(_0x39a117,_0x413513){var _0x5a6cbc={'method':_0x823a('0x2'),'uri':url['resolve'](_0x413513[_0x823a('0x3')],_0x823a('0x4')),'form':{'grant_type':_0x823a('0x5'),'username':_0x413513[_0x823a('0x6')],'password':_0x413513['password']},'json':!![]};return rp(_0x5a6cbc)[_0x823a('0x7')](function(_0x3f35db){var _0x59866f={'method':_0x823a('0x2'),'uri':url[_0x823a('0x8')](_0x413513['ndassistant_url'],_0x823a('0x9')),'body':{'type':_0x413513[_0x823a('0xa')]||_0x823a('0xb'),'channelId':_0x823a('0xc'),'conversation':{'id':_0x39a117['uniqueid']},'from':{'id':_0x39a117[_0x823a('0xd')],'name':_0x39a117[_0x823a('0xe')]},'recipient':{'id':_0x39a117[_0x823a('0xf')],'name':_0x39a117[_0x823a('0x10')]},'text':_0x413513[_0x823a('0x11')],'channelData':{}},'headers':{'Authorization':_0x823a('0x12')+_0x3f35db[_0x823a('0x13')]},'json':!![]};if(_0x413513[_0x823a('0x14')]){_0x59866f['body'][_0x823a('0x15')]['ProjectName']=_0x413513[_0x823a('0x14')];}if(_0x413513[_0x823a('0x16')]=='1'){_0x59866f[_0x823a('0x17')]['channelData']['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x823a('0x18')};}if(_0x413513[_0x823a('0x19')]){_0x59866f[_0x823a('0x17')]['channelData']['CustomAction']=_0x413513['custom_action'];if(_0x413513[_0x823a('0x1a')]){_0x59866f[_0x823a('0x17')][_0x823a('0x15')][_0x823a('0x1b')]=_0x413513[_0x823a('0x1a')];}}logger[_0x823a('0x1c')](JSON[_0x823a('0x1d')](_0x59866f));return rp(_0x59866f);});}; \ No newline at end of file +var _0x50c1=['uniqueid','callerid','dnid','extension','text','access_token','channelData','ProjectName','project','ndagenerate_audio','body','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','info','stringify','request-promise','agi','exports','POST','resolve','ndauth_url','/token','password','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda'];(function(_0x14f08a,_0x12185b){var _0x1379d4=function(_0x35f85d){while(--_0x35f85d){_0x14f08a['push'](_0x14f08a['shift']());}};_0x1379d4(++_0x12185b);}(_0x50c1,0x1a5));var _0x150c=function(_0x5147c5,_0x311758){_0x5147c5=_0x5147c5-0x0;var _0xaec39a=_0x50c1[_0x5147c5];return _0xaec39a;};'use strict';var rp=require(_0x150c('0x0'));var url=require('url');var logger=require('../../../../../config/logger')(_0x150c('0x1'));module[_0x150c('0x2')]=function(_0xef6612,_0x1f68cd){var _0x24cd1b={'method':_0x150c('0x3'),'uri':url[_0x150c('0x4')](_0x1f68cd[_0x150c('0x5')],_0x150c('0x6')),'form':{'grant_type':'password','username':_0x1f68cd['username'],'password':_0x1f68cd[_0x150c('0x7')]},'json':!![]};return rp(_0x24cd1b)['then'](function(_0x5b10b4){var _0xb16344={'method':_0x150c('0x3'),'uri':url[_0x150c('0x4')](_0x1f68cd[_0x150c('0x8')],_0x150c('0x9')),'body':{'type':_0x1f68cd[_0x150c('0xa')]||_0x150c('0xb'),'channelId':_0x150c('0xc'),'conversation':{'id':_0xef6612[_0x150c('0xd')]},'from':{'id':_0xef6612[_0x150c('0xe')],'name':_0xef6612['calleridname']},'recipient':{'id':_0xef6612[_0x150c('0xf')],'name':_0xef6612[_0x150c('0x10')]},'text':_0x1f68cd[_0x150c('0x11')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x5b10b4[_0x150c('0x12')]},'json':!![]};if(_0x1f68cd['project']){_0xb16344['body'][_0x150c('0x13')][_0x150c('0x14')]=_0x1f68cd[_0x150c('0x15')];}if(_0x1f68cd[_0x150c('0x16')]=='1'){_0xb16344[_0x150c('0x17')][_0x150c('0x13')][_0x150c('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x150c('0x19')};}if(_0x1f68cd[_0x150c('0x1a')]){_0xb16344[_0x150c('0x17')][_0x150c('0x13')][_0x150c('0x1b')]=_0x1f68cd['custom_action'];if(_0x1f68cd[_0x150c('0x1c')]){_0xb16344['body'][_0x150c('0x13')]['CustomActionData']=_0x1f68cd['custom_action_data'];}}logger[_0x150c('0x1d')](JSON[_0x150c('0x1e')](_0xb16344));return rp(_0xb16344);});}; \ 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 910221d..72f4313 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 _0x1b7b=['./lib/api','exports'];(function(_0x4ffa64,_0x271035){var _0x5da001=function(_0x7d1940){while(--_0x7d1940){_0x4ffa64['push'](_0x4ffa64['shift']());}};_0x5da001(++_0x271035);}(_0x1b7b,0x104));var _0xb1b7=function(_0x567308,_0x128b4e){_0x567308=_0x567308-0x0;var _0x10407b=_0x1b7b[_0x567308];return _0x10407b;};'use strict';var asr=require(_0xb1b7('0x0'));module[_0xb1b7('0x1')]=function(_0x43c6ed,_0x11d96e,_0x47c330,_0x211495){return asr(_0x43c6ed,_0x11d96e,_0x47c330,_0x211495);}; \ No newline at end of file +var _0x1ea6=['exports'];(function(_0x457740,_0x8a8635){var _0x2a010d=function(_0x2ac0b5){while(--_0x2ac0b5){_0x457740['push'](_0x457740['shift']());}};_0x2a010d(++_0x8a8635);}(_0x1ea6,0x12f));var _0x61ea=function(_0x1e73b2,_0x3d4af2){_0x1e73b2=_0x1e73b2-0x0;var _0xcd3502=_0x1ea6[_0x1e73b2];return _0xcd3502;};'use strict';var asr=require('./lib/api');module[_0x61ea('0x0')]=function(_0x2363a4,_0x5c1861,_0x4167f4,_0x567e5d){return asr(_0x2363a4,_0x5c1861,_0x4167f4,_0x567e5d);}; \ 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 2170615..8111b64 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 _0xe6f2=['exports','info','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','stringify','terminate','parse','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','lodash','moment','crypto','agi'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0xe6f2,0xb5));var _0x2e6f=function(_0x2c487c,_0xcb60b5){_0x2c487c=_0x2c487c-0x0;var _0x15cf4b=_0xe6f2[_0x2c487c];return _0x15cf4b;};'use strict';var BPromise=require('bluebird');var _=require(_0x2e6f('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x2e6f('0x1'));var crypto=require(_0x2e6f('0x2'));var logger=require('../../../../../../config/logger')(_0x2e6f('0x3'));module[_0x2e6f('0x4')]=function(_0x109f8e,_0x1ef2c5,_0x292376,_0x202c0d){return new BPromise(function(_0x3b6b63,_0x36ed38){logger[_0x2e6f('0x5')]('Tilde\x20URI',_0x202c0d||_0x2e6f('0x6'));var _0x109573=new WebSocket(_0x202c0d||_0x2e6f('0x6'),{'perMessageDeflate':![]});var _0x3d7dfd='';var _0x47b33b='0';var _0x2fd11d='1';var _0x192feb=_0x2e6f('0x7');function _0x38b1b4(_0x4bcede){var _0x500ea8=crypto[_0x2e6f('0x8')]('sha1');_0x500ea8['update'](_0x4bcede);return _0x500ea8['digest'](_0x2e6f('0x9'));}function _0x1d5f0e(){try{logger[_0x2e6f('0x5')](_0x2e6f('0xa'));var _0x2e24bb=moment()[_0x2e6f('0xb')]();var _0x4a7522=_0x38b1b4(_0x2e24bb+_0x1ef2c5+_0x292376);_0x109573[_0x2e6f('0xc')](JSON['stringify']({'appID':_0x1ef2c5,'timestamp':_0x2e24bb,'appKey':_0x4a7522}));var _0x1e6073=fs['createReadStream'](_0x109f8e);_0x1e6073['on'](_0x2e6f('0xd'),function(_0x3df76b){_0x109573['send'](_0x3df76b);});_0x1e6073['on'](_0x2e6f('0xe'),function(){_0x109573[_0x2e6f('0xc')](_0x2e6f('0xf'));});}catch(_0x121152){logger[_0x2e6f('0x10')](_0x2e6f('0x11'),JSON[_0x2e6f('0x12')](_0x121152));_0x109573[_0x2e6f('0x13')]();}}function _0x438c23(_0xdf62cd){try{if(_0xdf62cd){var _0x54bbcd=JSON[_0x2e6f('0x14')](_0xdf62cd);switch(_0x54bbcd['status']){case 0x0:if(_0x54bbcd[_0x2e6f('0x15')]){if(_0x54bbcd['result'][_0x2e6f('0x16')]){logger['info'](_0x2e6f('0x17'),JSON[_0x2e6f('0x12')](_0x54bbcd['result']['hypotheses']));_0x3d7dfd=_0x54bbcd[_0x2e6f('0x15')][_0x2e6f('0x18')][0x0][_0x2e6f('0x19')];_0x47b33b=_0x54bbcd[_0x2e6f('0x15')][_0x2e6f('0x18')][0x0][_0x2e6f('0x1a')];_0x2fd11d='0';_0x192feb=_0x2e6f('0x1b');_0x109573[_0x2e6f('0x13')]();}}break;case 0x1:logger[_0x2e6f('0x5')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x2fd11d='1';_0x192feb=_0x2e6f('0x7');break;case 0x2:logger['info'](_0x2e6f('0x1c'));_0x2fd11d='2';_0x192feb=_0x2e6f('0x1c');break;case 0x9:logger[_0x2e6f('0x5')](_0x2e6f('0x1d'));_0x2fd11d='9';_0x192feb=_0x2e6f('0x1d');break;case 0xa:logger[_0x2e6f('0x5')](_0x2e6f('0x1e'));_0x2fd11d='10';_0x192feb=_0x2e6f('0x1e');break;case 0xb:logger[_0x2e6f('0x5')](_0x2e6f('0x1f'));_0x2fd11d='11';_0x192feb='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x3a8356){logger[_0x2e6f('0x10')](_0x2e6f('0x20'),JSON[_0x2e6f('0x12')](_0x3a8356));_0x109573[_0x2e6f('0x13')]();}}function _0x4f4ab7(){logger[_0x2e6f('0x5')]('Close\x20Tilde\x20ASR\x20socket');_0x3b6b63({'transcript':_0x3d7dfd,'confidence':_0x47b33b,'status':_0x2fd11d,'status_message':_0x192feb});}function _0x92385d(_0x3c7873){logger[_0x2e6f('0x10')](_0x2e6f('0x21'));if(!_[_0x2e6f('0x22')](_0x3c7873)){logger[_0x2e6f('0x10')](_[_0x2e6f('0x23')](_0x3c7873)?JSON[_0x2e6f('0x12')](_0x3c7873):_0x3c7873);}}_0x109573['on'](_0x2e6f('0x24'),_0x1d5f0e);_0x109573['on']('message',_0x438c23);_0x109573['on'](_0x2e6f('0xe'),_0x4f4ab7);_0x109573['on'](_0x2e6f('0x10'),_0x92385d);});}; \ No newline at end of file +var _0x1846=['createReadStream','data','close','EOS','error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','message','crypto','../../../../../../config/logger','exports','info','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','sha1','update','digest','hex','send','stringify'];(function(_0x2ba740,_0x62a305){var _0x358bda=function(_0x16cc07){while(--_0x16cc07){_0x2ba740['push'](_0x2ba740['shift']());}};_0x358bda(++_0x62a305);}(_0x1846,0x1d5));var _0x6184=function(_0x5ca52d,_0x3a4a22){_0x5ca52d=_0x5ca52d-0x0;var _0x89e54e=_0x1846[_0x5ca52d];return _0x89e54e;};'use strict';var BPromise=require('bluebird');var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0x6184('0x0'));var logger=require(_0x6184('0x1'))('agi');module[_0x6184('0x2')]=function(_0xa6e483,_0x537745,_0x279ab1,_0x53793e){return new BPromise(function(_0x565397,_0x55d3f7){logger[_0x6184('0x3')]('Tilde\x20URI',_0x53793e||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x2a6801=new WebSocket(_0x53793e||_0x6184('0x4'),{'perMessageDeflate':![]});var _0x3de1e1='';var _0x574ccf='0';var _0x4980c5='1';var _0x3f2121=_0x6184('0x5');function _0x5d8510(_0x224938){var _0x154bd4=crypto['createHash'](_0x6184('0x6'));_0x154bd4[_0x6184('0x7')](_0x224938);return _0x154bd4[_0x6184('0x8')](_0x6184('0x9'));}function _0x3f20f0(){try{logger['info']('Open\x20Tilde\x20ASR\x20socket');var _0x5db9d9=moment()['unix']();var _0x171e1b=_0x5d8510(_0x5db9d9+_0x537745+_0x279ab1);_0x2a6801[_0x6184('0xa')](JSON[_0x6184('0xb')]({'appID':_0x537745,'timestamp':_0x5db9d9,'appKey':_0x171e1b}));var _0x354f72=fs[_0x6184('0xc')](_0xa6e483);_0x354f72['on'](_0x6184('0xd'),function(_0xbd6da0){_0x2a6801['send'](_0xbd6da0);});_0x354f72['on'](_0x6184('0xe'),function(){_0x2a6801[_0x6184('0xa')](_0x6184('0xf'));});}catch(_0xfb8e42){logger[_0x6184('0x10')]('Tilde\x20ASR\x20send\x20error',JSON['stringify'](_0xfb8e42));_0x2a6801[_0x6184('0x11')]();}}function _0x46b7b2(_0x5c9502){try{if(_0x5c9502){var _0x142783=JSON[_0x6184('0x12')](_0x5c9502);switch(_0x142783[_0x6184('0x13')]){case 0x0:if(_0x142783[_0x6184('0x14')]){if(_0x142783['result'][_0x6184('0x15')]){logger[_0x6184('0x3')](_0x6184('0x16'),JSON[_0x6184('0xb')](_0x142783[_0x6184('0x14')][_0x6184('0x17')]));_0x3de1e1=_0x142783[_0x6184('0x14')][_0x6184('0x17')][0x0][_0x6184('0x18')];_0x574ccf=_0x142783[_0x6184('0x14')][_0x6184('0x17')][0x0][_0x6184('0x19')];_0x4980c5='0';_0x3f2121=_0x6184('0x1a');_0x2a6801['terminate']();}}break;case 0x1:logger[_0x6184('0x3')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x4980c5='1';_0x3f2121=_0x6184('0x5');break;case 0x2:logger['info'](_0x6184('0x1b'));_0x4980c5='2';_0x3f2121=_0x6184('0x1b');break;case 0x9:logger[_0x6184('0x3')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x4980c5='9';_0x3f2121=_0x6184('0x1c');break;case 0xa:logger[_0x6184('0x3')](_0x6184('0x1d'));_0x4980c5='10';_0x3f2121='Authentication\x20failed.';break;case 0xb:logger[_0x6184('0x3')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x4980c5='11';_0x3f2121=_0x6184('0x1e');}}}catch(_0x3db4c4){logger[_0x6184('0x10')](_0x6184('0x1f'),JSON[_0x6184('0xb')](_0x3db4c4));_0x2a6801[_0x6184('0x11')]();}}function _0x3509cd(){logger[_0x6184('0x3')](_0x6184('0x20'));_0x565397({'transcript':_0x3de1e1,'confidence':_0x574ccf,'status':_0x4980c5,'status_message':_0x3f2121});}function _0x4e2a3c(_0x32c00c){logger[_0x6184('0x10')](_0x6184('0x21'));if(!_[_0x6184('0x22')](_0x32c00c)){logger[_0x6184('0x10')](_[_0x6184('0x23')](_0x32c00c)?JSON[_0x6184('0xb')](_0x32c00c):_0x32c00c);}}_0x2a6801['on']('open',_0x3f20f0);_0x2a6801['on'](_0x6184('0x24'),_0x46b7b2);_0x2a6801['on'](_0x6184('0xe'),_0x3509cd);_0x2a6801['on']('error',_0x4e2a3c);});}; \ 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 2afeff4..3043c3e 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 _0x1a68=['exports'];(function(_0x101a9b,_0x12e7d8){var _0x285117=function(_0x190e24){while(--_0x190e24){_0x101a9b['push'](_0x101a9b['shift']());}};_0x285117(++_0x12e7d8);}(_0x1a68,0x18a));var _0x81a6=function(_0x2b0d25,_0x50d3f3){_0x2b0d25=_0x2b0d25-0x0;var _0x47406d=_0x1a68[_0x2b0d25];return _0x47406d;};var asr=require('./asr');module[_0x81a6('0x0')]={'asr':asr}; \ No newline at end of file +var _0x48d8=['exports','./asr'];(function(_0x346d45,_0x6db175){var _0x548330=function(_0x41e453){while(--_0x41e453){_0x346d45['push'](_0x346d45['shift']());}};_0x548330(++_0x6db175);}(_0x48d8,0x65));var _0x848d=function(_0x2ea33c,_0x26fe27){_0x2ea33c=_0x2ea33c-0x0;var _0x42e496=_0x48d8[_0x2ea33c];return _0x42e496;};var asr=require(_0x848d('0x0'));module[_0x848d('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 0e83dda..a102bb6 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 _0x73da=['call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','code','close','E_AGI_SERVER_CLOSE','inherits','util','net','events','EventEmitter','./channel','127.0.0.1'];(function(_0x27c77,_0x554973){var _0x2bb21b=function(_0x14f558){while(--_0x14f558){_0x27c77['push'](_0x27c77['shift']());}};_0x2bb21b(++_0x554973);}(_0x73da,0x1af));var _0xa73d=function(_0x1a3634,_0x3a5fe7){_0x1a3634=_0x1a3634-0x0;var _0x2338c7=_0x73da[_0x1a3634];return _0x2338c7;};'use strict';var util=require(_0xa73d('0x0'));var net=require(_0xa73d('0x1'));var EventEmitter=require(_0xa73d('0x2'))[_0xa73d('0x3')];var AGIError=require('./error');var AGIChannel=require(_0xa73d('0x4'));var AGIServer=function(_0x218400,_0x57372e,_0x3e1395){var _0x37b55f=this,_0x218400=_0x218400||0x11dd,_0x57372e=_0x57372e||_0xa73d('0x5'),_0x1eca35=null,_0x3e8523=0x0;EventEmitter[_0xa73d('0x6')](_0x37b55f);function _0xed8a52(){if(!_0x218400){_0x37b55f[_0xa73d('0x7')](_0xa73d('0x8'),new AGIError(_0xa73d('0x9')));return![];}_0x1eca35=net[_0xa73d('0xa')]();_0x1eca35[_0xa73d('0xb')](_0x218400,_0x57372e);_0x1eca35['on']('listening',function(){_0x37b55f[_0xa73d('0x7')]('listening');});_0x1eca35['on'](_0xa73d('0xc'),function(_0x1389a0){_0x1eca35[_0xa73d('0xd')](function(_0x4f59ac,_0x506336){if(_0x4f59ac){_0x37b55f['emit'](_0xa73d('0x8'),new AGIError(_0xa73d('0xe'),_0x4f59ac));}else if(_0x3e1395&&_0x3e1395<0x0){_0x37b55f[_0xa73d('0x7')](_0xa73d('0x8'),new AGIError(_0xa73d('0xf')));_0x1389a0[_0xa73d('0x10')]();}else if(_0x3e1395&&_0x3e1395>0x0&&_0x3e1395<_0x506336){_0x3e8523+=0x1;_0x37b55f[_0xa73d('0x7')]('error',new AGIError(_0xa73d('0x11'),_0x3e8523));_0x1389a0[_0xa73d('0x10')]();}else{var _0x57a8a4=new AGIChannel(_0x1389a0);_0x57a8a4['on'](_0xa73d('0x12'),function(){_0x37b55f[_0xa73d('0x7')](_0xa73d('0xc'),_0x57a8a4);});}});});_0x1eca35['on'](_0xa73d('0x8'),function(_0x5d49aa){_0x37b55f['emit'](_0xa73d('0x8'),new AGIError(_0xa73d('0xe'),_0x5d49aa[_0xa73d('0x13')]));});_0x1eca35['on'](_0xa73d('0x14'),function(){_0x37b55f['emit']('close',new AGIError(_0xa73d('0x15')));});}process['nextTick'](function(){_0xed8a52();});};util[_0xa73d('0x16')](AGIServer,EventEmitter);module['exports']=function(_0x29e23d,_0x48043a,_0x11b7f5){return new AGIServer(_0x29e23d,_0x48043a,_0x11b7f5);}; \ No newline at end of file +var _0x0495=['listening','error','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','connection','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','net','./error','./channel','127.0.0.1','call','emit','listen'];(function(_0x5d80de,_0x2cf15d){var _0x1c7556=function(_0x5bd806){while(--_0x5bd806){_0x5d80de['push'](_0x5d80de['shift']());}};_0x1c7556(++_0x2cf15d);}(_0x0495,0xd5));var _0x5049=function(_0x1f8d4d,_0x10a08b){_0x1f8d4d=_0x1f8d4d-0x0;var _0x5b27af=_0x0495[_0x1f8d4d];return _0x5b27af;};'use strict';var util=require('util');var net=require(_0x5049('0x0'));var EventEmitter=require('events')['EventEmitter'];var AGIError=require(_0x5049('0x1'));var AGIChannel=require(_0x5049('0x2'));var AGIServer=function(_0x538610,_0x2fc205,_0x77558d){var _0x505fb1=this,_0x538610=_0x538610||0x11dd,_0x2fc205=_0x2fc205||_0x5049('0x3'),_0x4ae2bb=null,_0x49684d=0x0;EventEmitter[_0x5049('0x4')](_0x505fb1);function _0x4009c6(){if(!_0x538610){_0x505fb1[_0x5049('0x5')]('error',new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x4ae2bb=net['createServer']();_0x4ae2bb[_0x5049('0x6')](_0x538610,_0x2fc205);_0x4ae2bb['on'](_0x5049('0x7'),function(){_0x505fb1[_0x5049('0x5')](_0x5049('0x7'));});_0x4ae2bb['on']('connection',function(_0x3765ec){_0x4ae2bb['getConnections'](function(_0x37bac9,_0x298704){if(_0x37bac9){_0x505fb1['emit'](_0x5049('0x8'),new AGIError('E_AGI_SERVER_ERROR',_0x37bac9));}else if(_0x77558d&&_0x77558d<0x0){_0x505fb1[_0x5049('0x5')](_0x5049('0x8'),new AGIError(_0x5049('0x9')));_0x3765ec[_0x5049('0xa')]();}else if(_0x77558d&&_0x77558d>0x0&&_0x77558d<_0x298704){_0x49684d+=0x1;_0x505fb1['emit'](_0x5049('0x8'),new AGIError(_0x5049('0xb'),_0x49684d));_0x3765ec[_0x5049('0xa')]();}else{var _0x1242b4=new AGIChannel(_0x3765ec);_0x1242b4['on']('ready',function(){_0x505fb1[_0x5049('0x5')](_0x5049('0xc'),_0x1242b4);});}});});_0x4ae2bb['on'](_0x5049('0x8'),function(_0x5b91a1){_0x505fb1[_0x5049('0x5')](_0x5049('0x8'),new AGIError(_0x5049('0xd'),_0x5b91a1[_0x5049('0xe')]));});_0x4ae2bb['on']('close',function(){_0x505fb1[_0x5049('0x5')](_0x5049('0xf'),new AGIError(_0x5049('0x10')));});}process[_0x5049('0x11')](function(){_0x4009c6();});};util[_0x5049('0x12')](AGIServer,EventEmitter);module[_0x5049('0x13')]=function(_0x4559cb,_0x338149,_0x148b39){return new AGIServer(_0x4559cb,_0x338149,_0x148b39);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index dc6f522..5d8777d 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 _0x6fad=['agentPause','agent','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','timeout','number','POST','PUT','method','toUpperCase','body','rawBody','parse','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','client_email','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','tildeASR','clear','includes','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','saveRestApiResult','%s.%s','setVariable','split','replaceAll','extra','toString','getAndSetVariable','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','retry','noop','result','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','grammar','no\x20grammar\x20configured','MRCPRecog','MRCP_RECOG_CONFIDENCE','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','wait','delay','scheduledAt','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','MRCPSynth','lumenvoxasr','RECOG_CONFIDENCE()','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','variable_id','forEach','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','SIP/%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','out','speech','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','private_key','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','end','Enter\x20in\x20END\x20(%s)\x20block','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','trunk_name','SIP/%s/%s','opts','Executed\x20command\x20%s','DIAL','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','no\x20file\x20audio\x20selected','getSound','file_id','no\x20file\x20audio\x20found','no\x20variable\x20selected\x20for\x20the\x20result','getData','response','maxdigit','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','getdigits','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','GOAL\x20%s','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','wav','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','appid','appsecret','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','gotoif','condition','no\x20condition\x20configured','true','EVAL\x20CONDITION\x20%s\x20%s','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20%s\x20file\x20created','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','Enter\x20in\x20LOGOUT\x20(%s)\x20block','no\x20find\x20by\x20configured','Enter\x20in\x20MATH\x20(%s)\x20block','operation','math\x20%s','no\x20variable\x20found','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','macro','position','QUEUE','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','statusMessage','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','getMailAccount','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','user','bcc','subject','service','host','port','secure','authentication','auth','pass','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','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','no\x20variable\x20selected','variable_value','yes','Answer','subproject','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','path','util','lodash','shelljs','randomstring','mustache','request-promise','../../config/logger','agi','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawHeaders','menu','getsecretdigits','channel','prototype','getVariable','rpc','getVoiceQueue','getVoiceQueueById','then','catch','getSquareProject','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getSoundById','save_name','getMailAccountById','mailRpc','sendMailMessage','getIntervals','getIntervalById','interval','Intervals','getSoundPath','format','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','arg_1','callerid','createSquareRecording','context','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','random','name','lastName','list_id','callback','callback_priority','has','dialTimezone','getContactByPhone','phone','timezones','utcOffset','scheduledat','minutes','insertContact','add','getPause','getPauseById'];(function(_0x1ff2e7,_0x32cf1b){var _0x3cb987=function(_0x1b7a21){while(--_0x1b7a21){_0x1ff2e7['push'](_0x1ff2e7['shift']());}};_0x3cb987(++_0x32cf1b);}(_0x6fad,0x174));var _0xd6fa=function(_0x2a1dc3,_0x2bcbcc){_0x2a1dc3=_0x2a1dc3-0x0;var _0x4f0d17=_0x6fad[_0x2a1dc3];return _0x4f0d17;};'use strict';var fs=require('fs');var path=require(_0xd6fa('0x0'));var util=require(_0xd6fa('0x1'));var _=require(_0xd6fa('0x2'));var sh=require(_0xd6fa('0x3'));var odbc=require('odbc')();var rs=require(_0xd6fa('0x4'));var moment=require('moment');var Mustache=require(_0xd6fa('0x5'));var rp=require(_0xd6fa('0x6'));var logger=require(_0xd6fa('0x7'))(_0xd6fa('0x8'));var config=require('../../config/environment');var shared=require(_0xd6fa('0x9'));var scripts=require(_0xd6fa('0xa'));var FILES_PATH=_0xd6fa('0xb');var recursiveMapAttributes=[_0xd6fa('0xc'),'rawBody'];var verticesWithRetry=[_0xd6fa('0xd'),'getdigits',_0xd6fa('0xe')];var AGIVertices=function(_0x45d73f,_0xeb17d2,_0x18b286){this[_0xd6fa('0xf')]=_0x45d73f;this['rpc']=_0xeb17d2;this['mailRpc']=_0x18b286;};AGIVertices[_0xd6fa('0x10')][_0xd6fa('0x11')]=function(_0x4e91f4,_0x410494){this[_0xd6fa('0x12')]['getVariableById'](_0x4e91f4)['then'](function(_0xd7341e){_0x410494(null,_0xd7341e?_0xd7341e['name']:![]);})['catch'](function(_0x33ee61){_0x410494(_0x33ee61);});};AGIVertices[_0xd6fa('0x10')][_0xd6fa('0x13')]=function(_0x40df7f,_0x3cd6fa){this[_0xd6fa('0x12')][_0xd6fa('0x14')](_0x40df7f)[_0xd6fa('0x15')](function(_0x45f777){_0x3cd6fa(null,_0x45f777?_0x45f777['name']:![]);})[_0xd6fa('0x16')](function(_0x4082c5){_0x3cd6fa(_0x4082c5);});};AGIVertices[_0xd6fa('0x10')][_0xd6fa('0x17')]=function(_0x47e70a,_0x497945){this['rpc']['getSquareProjectById'](_0x47e70a)['then'](function(_0xe458aa){_0x497945(null,_0xe458aa?_0xe458aa['name']:![]);})[_0xd6fa('0x16')](function(_0x4bf723){_0x497945(_0x4bf723);});};AGIVertices[_0xd6fa('0x10')][_0xd6fa('0x18')]=function(_0x2ee97a,_0x379e57){this[_0xd6fa('0x12')][_0xd6fa('0x19')](_0x2ee97a)[_0xd6fa('0x15')](function(_0x42f984){_0x379e57(null,_0x42f984?_0x42f984[_0xd6fa('0x1a')]:![]);})[_0xd6fa('0x16')](function(_0x20159f){_0x379e57(_0x20159f);});};AGIVertices[_0xd6fa('0x10')][_0xd6fa('0x1b')]=function(_0x26c329,_0x2f1f4e){this[_0xd6fa('0x12')][_0xd6fa('0x1c')](_0x26c329)[_0xd6fa('0x15')](function(_0x3fbab3){_0x2f1f4e(null,_0x3fbab3?_0x3fbab3['name']:![]);})['catch'](function(_0x3d3d7b){_0x2f1f4e(_0x3d3d7b);});};AGIVertices[_0xd6fa('0x10')][_0xd6fa('0x1d')]=function(_0x1eaf9a,_0x1c5af3){this[_0xd6fa('0x12')]['getTrunkById'](_0x1eaf9a)[_0xd6fa('0x15')](function(_0x1af27c){_0x1c5af3(null,_0x1af27c?_0x1af27c['name']:![]);})[_0xd6fa('0x16')](function(_0xdac7e1){_0x1c5af3(_0xdac7e1);});};AGIVertices[_0xd6fa('0x10')]['getSound']=function(_0x242294,_0x1be5fd){var _0x22e6db=this;this[_0xd6fa('0x12')][_0xd6fa('0x1e')](_0x242294)[_0xd6fa('0x15')](function(_0x42f145){_0x1be5fd(null,_0x42f145?_0x22e6db['getSoundPath'](_0x42f145[_0xd6fa('0x1f')]):![]);})['catch'](function(_0x2eaaef){_0x1be5fd(_0x2eaaef);});};AGIVertices[_0xd6fa('0x10')]['getMailAccount']=function(_0x3fc7f5,_0x2caae7){this[_0xd6fa('0x12')][_0xd6fa('0x20')](_0x3fc7f5)[_0xd6fa('0x15')](function(_0x3b0bab){_0x2caae7(null,_0x3b0bab?_0x3b0bab:![]);})[_0xd6fa('0x16')](function(_0x1e3de4){_0x2caae7(_0x1e3de4);});};AGIVertices[_0xd6fa('0x10')]['sendMailMessage']=function(_0x168269,_0x1072ec,_0x581bf2){this[_0xd6fa('0x21')][_0xd6fa('0x22')](_0x168269,_0x1072ec)[_0xd6fa('0x15')](function(){_0x581bf2(null);})[_0xd6fa('0x16')](function(_0x11bc59){_0x581bf2(_0x11bc59);});};AGIVertices[_0xd6fa('0x10')][_0xd6fa('0x23')]=function(_0x3ee42b,_0x2d6058){this[_0xd6fa('0x12')][_0xd6fa('0x24')](_0x3ee42b)['then'](function(_0x2d934d){if(_0x2d934d){if(_0x2d934d['IntervalId']){_0x2d6058(null,[_0x2d934d[_0xd6fa('0x25')]]);}else{_0x2d6058(null,_['map'](_0x2d934d[_0xd6fa('0x26')],_0xd6fa('0x25')));}}else{_0x2d6058(null,![]);}})['catch'](function(_0x84e6d4){_0x2d6058(_0x84e6d4);});};AGIVertices['prototype'][_0xd6fa('0x27')]=function(_0x1e7f70){return util[_0xd6fa('0x28')]('%s/sounds/converted/%s',FILES_PATH,_0x1e7f70);};AGIVertices['prototype'][_0xd6fa('0x29')]=function(_0x1bab9d,_0x25cdfb,_0x56e721){odbc[_0xd6fa('0x2a')](_0x1bab9d,function(_0x3feb5e){if(_0x3feb5e){logger[_0xd6fa('0x2b')](_0xd6fa('0x2c'),_0x3feb5e);_0x56e721(_0x3feb5e);}else{logger[_0xd6fa('0x2d')](_0xd6fa('0x2e'));odbc[_0xd6fa('0x2f')](_0x25cdfb,function(_0x534748,_0x465dbd){if(_0x534748){logger[_0xd6fa('0x2d')](_0xd6fa('0x30'),_0x25cdfb);_0x56e721(_0x534748);}else{logger[_0xd6fa('0x2d')](_0xd6fa('0x31'),_0x25cdfb);odbc[_0xd6fa('0x32')](function(_0x12e6b9){if(_0x12e6b9){logger[_0xd6fa('0x2b')]('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x12e6b9);}_0x56e721(null,_0x465dbd);});}});}});};AGIVertices[_0xd6fa('0x10')][_0xd6fa('0x33')]=function(_0x3816c3,_0x28c35b){this[_0xd6fa('0x12')][_0xd6fa('0x34')](_0x3816c3)[_0xd6fa('0x15')](function(_0x22ab6c){_0x28c35b(null,_0x22ab6c?_0x22ab6c:![]);})[_0xd6fa('0x16')](function(_0x4cc9b1){_0x28c35b(_0x4cc9b1);});};AGIVertices[_0xd6fa('0x10')][_0xd6fa('0x35')]=function(_0x2e4beb,_0x2f384f){this['rpc'][_0xd6fa('0x35')](_0x2e4beb)[_0xd6fa('0x15')](function(_0x12f652){_0x2f384f(null,_0x12f652);})[_0xd6fa('0x16')](function(_0x32ac34){_0x2f384f(_0x32ac34);});};AGIVertices[_0xd6fa('0x10')][_0xd6fa('0x36')]=function(_0x3af46b,_0x259715,_0x24c6a3){this[_0xd6fa('0x12')][_0xd6fa('0x36')]({'uniqueid':this[_0xd6fa('0xf')][_0xd6fa('0x37')],'node':_0x3af46b[_0xd6fa('0x38')],'application':_0x3af46b['agicommand'],'data':_0x259715||null,'project_name':this[_0xd6fa('0xf')][_0xd6fa('0x39')],'callerid':this['channel'][_0xd6fa('0x3a')]})[_0xd6fa('0x15')](function(_0x3ba8ac){if(_0x24c6a3){_0x24c6a3(null,_0x3ba8ac);}})[_0xd6fa('0x16')](function(_0xb92ea2){if(_0x24c6a3){_0x24c6a3(_0xb92ea2);}});};AGIVertices['prototype'][_0xd6fa('0x3b')]=function(_0x25bb88,_0x2790cf,_0x4e8a7b,_0x141897){this[_0xd6fa('0x12')][_0xd6fa('0x3b')]({'uniqueid':this['channel']['uniqueid'],'callerid':this[_0xd6fa('0xf')][_0xd6fa('0x3a')],'calleridname':this[_0xd6fa('0xf')]['calleridname'],'context':this['channel'][_0xd6fa('0x3c')],'extension':this[_0xd6fa('0xf')][_0xd6fa('0x3d')],'priority':this[_0xd6fa('0xf')][_0xd6fa('0x3e')],'accountcode':this[_0xd6fa('0xf')][_0xd6fa('0x3f')],'dnid':this[_0xd6fa('0xf')][_0xd6fa('0x40')],'projectName':this[_0xd6fa('0xf')][_0xd6fa('0x39')],'saveName':_0x2790cf,'filename':_0x25bb88[_0xd6fa('0x41')]||_0x2790cf,'savePath':_0x4e8a7b})[_0xd6fa('0x15')](function(_0xb7bf80){_0x141897(null,_0xb7bf80);})[_0xd6fa('0x16')](function(_0x177c27){_0x141897(_0x177c27);});};AGIVertices['prototype'][_0xd6fa('0x42')]=function(_0x5e8ff2,_0x127c0a,_0x1a1fcb,_0x4b4668,_0x4fa3ce){this[_0xd6fa('0x12')][_0xd6fa('0x42')]({'uniqueid':this['channel'][_0xd6fa('0x37')],'body':_0x5e8ff2,'direction':_0x127c0a,'providerName':_0x1a1fcb,'providerResponse':_0x4b4668})[_0xd6fa('0x15')](function(_0x1abd98){if(_0x4fa3ce){_0x4fa3ce(null,_0x1abd98);}})[_0xd6fa('0x16')](function(_0x3472e3){if(_0x4fa3ce){_0x4fa3ce(_0x3472e3);}});};AGIVertices[_0xd6fa('0x10')][_0xd6fa('0x43')]=function(_0x480ca6,_0xcf7583){var _0x2f55ff=this;var _0x39c8cf=0x0;var _0x304438={'firstName':_[_0xd6fa('0x44')](_0x480ca6['name'])||_[_0xd6fa('0x45')](_0x480ca6['name'])?'callback_'+Math[_0xd6fa('0x46')]():_0x480ca6[_0xd6fa('0x47')],'lastName':_[_0xd6fa('0x44')](_0x480ca6['lastName'])||_[_0xd6fa('0x45')](_0x480ca6[_0xd6fa('0x48')])?null:_0x480ca6['lastName'],'phone':_0x480ca6['phone'],'ListId':_0x480ca6[_0xd6fa('0x49')],'scheduledat':_0x480ca6['scheduledAt'],'callbackUniqueid':this[_0xd6fa('0xf')][_0xd6fa('0x37')],'tags':_0xd6fa('0x4a'),'description':'Callback\x20scheduled\x20at\x20'+_0x480ca6['scheduledAt']['toString'](),'priority':_0x480ca6[_0xd6fa('0x4b')]};if(_[_0xd6fa('0x4c')](_0x480ca6,_0xd6fa('0x4d'))){if(!_['isNil'](_0x480ca6['dialTimezone'])){var _0x215bd7=_0x480ca6[_0xd6fa('0x4d')];if(_0x480ca6[_0xd6fa('0x4d')]=='CALLERID(dialTimezone)'){this['rpc'][_0xd6fa('0x4e')]({'phone':_0x480ca6[_0xd6fa('0x4f')]})[_0xd6fa('0x15')](function(_0x180f99){if(!_[_0xd6fa('0x45')](_0x180f99)){var _0x1ad593=_0x180f99['dialTimezone'];if(!_['isNil'](_0x1ad593)){var _0x20b713=shared[_0xd6fa('0x50')][_0x1ad593];if(!_[_0xd6fa('0x45')](_0x20b713)){var _0x50d54b=-0x1*_0x20b713[_0xd6fa('0x51')];_0x304438['scheduledat']=moment(_0x480ca6[_0xd6fa('0x52')])['add'](_0x50d54b,_0xd6fa('0x53'));_0x2f55ff['insertContact'](_0x304438,_0x480ca6,_0xcf7583);}else{_0x2f55ff['insertContact'](_0x304438,_0x480ca6,_0xcf7583);}}else{_0x2f55ff[_0xd6fa('0x54')](_0x304438,_0x480ca6,_0xcf7583);}}else{_0x2f55ff[_0xd6fa('0x54')](_0x304438,_0x480ca6,_0xcf7583);}});}else{var _0x39c8cf=shared[_0xd6fa('0x50')][_0x215bd7];if(!_['isNil'](_0x39c8cf)){var _0x5bcb18=-0x1*_0x39c8cf[_0xd6fa('0x51')];_0x304438['scheduledat']=moment(_0x480ca6[_0xd6fa('0x52')])[_0xd6fa('0x55')](_0x5bcb18,_0xd6fa('0x53'));_0x2f55ff[_0xd6fa('0x54')](_0x304438,_0x480ca6,_0xcf7583);}else{_0x2f55ff[_0xd6fa('0x54')](_0x304438,_0x480ca6,_0xcf7583);}}}else{_0x2f55ff[_0xd6fa('0x54')](_0x304438,_0x480ca6,_0xcf7583);}}else{_0x2f55ff[_0xd6fa('0x54')](_0x304438,_0x480ca6,_0xcf7583);}};AGIVertices[_0xd6fa('0x10')][_0xd6fa('0x56')]=function(_0x5e5b55,_0x153a13){this[_0xd6fa('0x12')][_0xd6fa('0x57')](_0x5e5b55)[_0xd6fa('0x15')](function(_0x292eb5){_0x153a13(null,_0x292eb5?_0x292eb5[_0xd6fa('0x47')]:![]);})[_0xd6fa('0x16')](function(_0x53e634){_0x153a13(_0x53e634);});};AGIVertices[_0xd6fa('0x10')][_0xd6fa('0x58')]=function(_0x3e6a28,_0x5bea05,_0x5976df){var _0x4e6faf={'role':_0xd6fa('0x59')};_0x4e6faf[_0x3e6a28]=this['channel']['callerid'];this[_0xd6fa('0x12')][_0xd6fa('0x58')](_0x4e6faf,_0x5bea05,this[_0xd6fa('0xf')]['uniqueid'])['then'](function(_0xb0be17){_0x5976df(null,_['isNil'](_0xb0be17)?![]:!![]);})[_0xd6fa('0x16')](function(_0x369eaf){logger[_0xd6fa('0x2b')](_0x369eaf);_0x5976df(null,![]);});};AGIVertices[_0xd6fa('0x10')]['agentUnpause']=function(_0x2be821,_0x33934d){var _0x4736f0={'role':_0xd6fa('0x59')};_0x4736f0[_0x2be821]=this[_0xd6fa('0xf')][_0xd6fa('0x3a')];this[_0xd6fa('0x12')]['agentUnpause'](_0x4736f0)[_0xd6fa('0x15')](function(_0x2c5a19){_0x33934d(null,_[_0xd6fa('0x45')](_0x2c5a19)?![]:!![]);})[_0xd6fa('0x16')](function(_0x11a5e2){logger[_0xd6fa('0x2b')](_0x11a5e2);_0x33934d(null,![]);});};AGIVertices['prototype'][_0xd6fa('0x5a')]=function(_0x351147,_0x304600){var _0x4878de={'role':_0xd6fa('0x59')};_0x4878de[_0x351147]=this[_0xd6fa('0xf')][_0xd6fa('0x3a')];this[_0xd6fa('0x12')][_0xd6fa('0x5a')](_0x4878de)[_0xd6fa('0x15')](function(_0x16f284){_0x304600(null,_[_0xd6fa('0x45')](_0x16f284)?![]:!![]);})[_0xd6fa('0x16')](function(_0x533989){logger['error'](_0x533989);_0x304600(null,![]);});};AGIVertices[_0xd6fa('0x10')][_0xd6fa('0x5b')]=function(_0x476130,_0x3855b0){var _0x14007f={'role':_0xd6fa('0x59')};_0x14007f[_0x476130]=this[_0xd6fa('0xf')][_0xd6fa('0x3a')];var _0x4b3dc9=_0x476130!=_0xd6fa('0x5c')?util[_0xd6fa('0x28')](_0xd6fa('0x5d'),_0xd6fa('0x5e'),this['channel'][_0xd6fa('0x3a')]):undefined;this[_0xd6fa('0x12')][_0xd6fa('0x5b')](_0x14007f,_0x4b3dc9)[_0xd6fa('0x15')](function(_0x2add4e){_0x3855b0(null,_[_0xd6fa('0x45')](_0x2add4e)?![]:!![]);})[_0xd6fa('0x16')](function(_0x556042){logger[_0xd6fa('0x2b')](_0x556042);_0x3855b0(null,![]);});};AGIVertices[_0xd6fa('0x10')][_0xd6fa('0x5f')]=function(_0xa9f575,_0x141423){sh[_0xd6fa('0x60')](_[_0xd6fa('0x61')](_0xa9f575),function(_0x57f11a,_0x27fcdb){var _0x8b9ddb=_0x27fcdb[_0xd6fa('0x62')](/(\r\n|\n|\r)/gm,'');_0x141423(null,_0x8b9ddb);});};AGIVertices[_0xd6fa('0x10')][_0xd6fa('0x63')]=function(_0x18340d,_0xa52894){scripts[_0xd6fa('0x63')](_0x18340d[_0xd6fa('0x64')],_0x18340d[_0xd6fa('0x65')]||_0xd6fa('0x66'),_0x18340d['text'],_0x18340d[_0xd6fa('0x67')]||_0xd6fa('0x68'),_0x18340d[_0xd6fa('0x69')]||_0xd6fa('0x6a'),_0x18340d[_0xd6fa('0x6b')]||_0xd6fa('0x6c'))['then'](function(_0x5e6ee1){_0xa52894(null,_0x5e6ee1);})[_0xd6fa('0x16')](function(_0x57b4b2){_0xa52894(_0x57b4b2);});};AGIVertices['prototype'][_0xd6fa('0x6d')]=function(_0x5a5a22,_0x253ba8){scripts[_0xd6fa('0x6d')](_0x5a5a22[_0xd6fa('0x66')],_0x5a5a22[_0xd6fa('0x6e')]||'en',0x1)['then'](function(_0x4f4972){_0x253ba8(null,_0x4f4972);})['catch'](function(_0x2229b4){_0x253ba8(_0x2229b4);});};AGIVertices[_0xd6fa('0x10')][_0xd6fa('0x6f')]=function(_0x163dc7,_0x76f6ab){var _0x299041={'uri':_0x163dc7[_0xd6fa('0x70')],'method':_0x163dc7['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x163dc7[_0xd6fa('0x71')])===_0xd6fa('0x72')&&parseInt(_0x163dc7[_0xd6fa('0x71')])>=0x1?parseInt(_0x163dc7[_0xd6fa('0x71')])*0x3e8:0x5*0x3e8};if(_['includes']([_0xd6fa('0x73'),_0xd6fa('0x74')],_0x299041[_0xd6fa('0x75')][_0xd6fa('0x76')]())){try{_0x299041[_0xd6fa('0x77')]=_0x163dc7[_0xd6fa('0x78')]?JSON[_0xd6fa('0x79')](_0x163dc7[_0xd6fa('0x78')]):{};}catch(_0x3eb4bc){logger[_0xd6fa('0x2b')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x3eb4bc);}}try{_0x299041[_0xd6fa('0x7a')]=_0x163dc7[_0xd6fa('0xc')]?JSON[_0xd6fa('0x79')](_0x163dc7[_0xd6fa('0xc')]):{};}catch(_0x15c9dd){logger['error'](_0xd6fa('0x7b'),_0x15c9dd);}if(_0x163dc7[_0xd6fa('0x7c')]){try{var _0x2863dd=require(_0x163dc7['computedVariables'])[_0xd6fa('0x7d')](this,_0x299041);_0x299041[_0xd6fa('0x7e')]=Mustache[_0xd6fa('0x7f')](_0x163dc7[_0xd6fa('0x70')],_0x2863dd,{},['$$','$$']);if(_0x299041[_0xd6fa('0x7a')]){_0x299041[_0xd6fa('0x7a')]=JSON[_0xd6fa('0x79')](Mustache[_0xd6fa('0x7f')](JSON[_0xd6fa('0x80')](_0x299041[_0xd6fa('0x7a')]),_0x2863dd,{},['$$','$$']));}if(_0x299041['body']){_0x299041[_0xd6fa('0x77')]=JSON[_0xd6fa('0x79')](Mustache['render'](JSON[_0xd6fa('0x80')](_0x299041[_0xd6fa('0x77')]),_0x2863dd,{},['$$','$$']));}}catch(_0x3a2c34){logger[_0xd6fa('0x2b')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x3a2c34);}}rp(_0x299041)[_0xd6fa('0x15')](function(_0x41aafe){var _0x1481f7={'statusCode':_0x41aafe[_0xd6fa('0x81')]||0xc8,'statusMessage':_0x41aafe['statusMessage']||'OK','headers':_0x41aafe['headers']||{},'body':_0x41aafe['body']||{}};_0x76f6ab(null,_0x1481f7);})[_0xd6fa('0x16')](function(_0x56e1a8){var _0x257f48={'statusCode':_0x56e1a8['statusCode']||0x1f4,'statusMessage':_0x56e1a8[_0xd6fa('0x82')]||_0xd6fa('0x83'),'headers':_0x56e1a8[_0xd6fa('0x84')][_0xd6fa('0x7a')]||{},'body':_0x56e1a8['options']['body']||{}};_0x76f6ab(null,_0x257f48);});};AGIVertices[_0xd6fa('0x10')][_0xd6fa('0x85')]=function(_0x2fa40a,_0x726995){scripts[_0xd6fa('0x85')](this[_0xd6fa('0xf')]['uniqueid'],_0x2fa40a[_0xd6fa('0x86')],_0x2fa40a[_0xd6fa('0x66')],_0x2fa40a[_0xd6fa('0x87')]||'en')[_0xd6fa('0x15')](function(_0x5ee16f){_0x726995(null,_0x5ee16f);})['catch'](function(_0x1ea6d1){_0x726995(_0x1ea6d1);});};AGIVertices['prototype'][_0xd6fa('0x88')]=function(_0x515899,_0x2374cc){scripts[_0xd6fa('0x88')](this[_0xd6fa('0xf')]['uniqueid'],_0x515899[_0xd6fa('0x89')],_0x515899[_0xd6fa('0x8a')],_0x515899['private_key'],_0x515899[_0xd6fa('0x66')],_0x515899[_0xd6fa('0x8b')]||'en')[_0xd6fa('0x15')](function(_0xa85029){_0x2374cc(null,_0xa85029);})[_0xd6fa('0x16')](function(_0x2e6b50){_0x2374cc(_0x2e6b50);});};AGIVertices[_0xd6fa('0x10')][_0xd6fa('0x8c')]=function(_0x5ed17d,_0x17254b){scripts[_0xd6fa('0x8c')](this[_0xd6fa('0xf')],_0x5ed17d)[_0xd6fa('0x15')](function(_0x2fb1f1){_0x17254b(null,_0x2fb1f1);})[_0xd6fa('0x16')](function(_0xcc6bbb){_0x17254b(_0xcc6bbb);});};AGIVertices['prototype'][_0xd6fa('0x8d')]=function(_0x4d2fe3,_0x26c038){scripts[_0xd6fa('0x8d')](_0x4d2fe3[_0xd6fa('0x86')],_0x4d2fe3[_0xd6fa('0x66')],_0x4d2fe3[_0xd6fa('0x8e')]||_0xd6fa('0x68'),_0x4d2fe3[_0xd6fa('0x8f')])[_0xd6fa('0x15')](function(_0x1ca6c7){_0x26c038(null,_0x1ca6c7);})[_0xd6fa('0x16')](function(_0x1c7f75){_0x26c038(_0x1c7f75);});};AGIVertices[_0xd6fa('0x10')][_0xd6fa('0x90')]=function(_0x1eac4e,_0x220ac3,_0x5ebdfe){scripts[_0xd6fa('0x90')](_0x220ac3,_0x1eac4e[_0xd6fa('0x86')],_0x1eac4e['ispeech_asr_language']||_0xd6fa('0x68'),this[_0xd6fa('0x91')](_0x1eac4e[_0xd6fa('0x92')])?_0x1eac4e[_0xd6fa('0x92')]:undefined)[_0xd6fa('0x15')](function(_0x40f632){_0x5ebdfe(null,_0x40f632);})[_0xd6fa('0x16')](function(_0x51f615){_0x5ebdfe(_0x51f615);});};AGIVertices[_0xd6fa('0x10')]['awsPolly']=function(_0x3a82b2,_0x128183){scripts[_0xd6fa('0x93')](_0x3a82b2[_0xd6fa('0x94')],_0x3a82b2[_0xd6fa('0x95')],_0x3a82b2['aws_polly_region'],_0x3a82b2[_0xd6fa('0x96')]||_0xd6fa('0x97'),_0x3a82b2['text'],_0x3a82b2[_0xd6fa('0x98')]||_0xd6fa('0x66'))['then'](function(_0xd1c0fb){_0x128183(null,_0xd1c0fb);})[_0xd6fa('0x16')](function(_0x4514d7){_0x128183(_0x4514d7);});};AGIVertices[_0xd6fa('0x10')][_0xd6fa('0x99')]=function(_0x116b44,_0x584eb5){scripts['awsLex'](this[_0xd6fa('0xf')][_0xd6fa('0x37')],_0x116b44[_0xd6fa('0x94')],_0x116b44[_0xd6fa('0x95')],_0x116b44[_0xd6fa('0x9a')],_0x116b44[_0xd6fa('0x66')],_0x116b44[_0xd6fa('0x9b')])[_0xd6fa('0x15')](function(_0x2b5b11){_0x584eb5(null,_0x2b5b11);})[_0xd6fa('0x16')](function(_0x29451f){_0x584eb5(_0x29451f);});};AGIVertices[_0xd6fa('0x10')]['googleASR']=function(_0x49f582,_0x22f991,_0x293ca6){scripts[_0xd6fa('0x9c')](_0x22f991,_0x49f582[_0xd6fa('0x86')],_0x49f582['google_asr_language']||_0xd6fa('0x68'))['then'](function(_0x4b5cfd){_0x293ca6(null,_0x4b5cfd);})['catch'](function(_0x2798de){_0x293ca6(_0x2798de);});};AGIVertices[_0xd6fa('0x10')]['tildeASR']=function(_0x401a16,_0x1a0ce6,_0x17f299){scripts[_0xd6fa('0x9d')](_0x1a0ce6,_0x401a16['appid'],_0x401a16['appsecret'],_0x401a16[_0xd6fa('0x7e')])[_0xd6fa('0x15')](function(_0x2489df){_0x17f299(null,_0x2489df);})[_0xd6fa('0x16')](function(_0x260909){_0x17f299(_0x260909);});};AGIVertices[_0xd6fa('0x10')][_0xd6fa('0x9e')]=function(_0x10b779){var _0x125d78=_[_0xd6fa('0x9f')](verticesWithRetry,_0x10b779['agicommand'])?_0x10b779:_[_0xd6fa('0xa0')](_0x10b779);for(var _0x4a7030 in _0x125d78){if(_0x125d78[_0xd6fa('0xa1')](_0x4a7030)){if(_0x125d78[_0x4a7030]&&_[_0xd6fa('0xa2')](_0x125d78[_0x4a7030])){if(_[_0xd6fa('0x9f')](recursiveMapAttributes,_0x4a7030)){_0x125d78[_0x4a7030]=this[_0xd6fa('0xa3')](_0x125d78[_0x4a7030]);}else{_0x125d78[_0x4a7030]=this[_0xd6fa('0xa4')](_0x125d78[_0x4a7030]);}}}}return _0x125d78;};AGIVertices[_0xd6fa('0x10')][_0xd6fa('0xa5')]=function(_0x5014bf){for(var _0x537706 in _0x5014bf){if(_0x5014bf['hasOwnProperty'](_0x537706)){if(_[_0xd6fa('0xa6')](_0x5014bf[_0x537706])){this['recursiveNodeIndex'](_0x5014bf[_0x537706]);}else if(_[_0xd6fa('0xa7')](_0x5014bf[_0x537706])){for(var _0x2c7d94=0x0;_0x2c7d94<_0x5014bf[_0x537706][_0xd6fa('0xa8')];_0x2c7d94++){this[_0xd6fa('0xa5')](_0x5014bf[_0x537706][_0x2c7d94]);}}else if(_[_0xd6fa('0xa2')](_0x5014bf[_0x537706])){_0x5014bf[_0x537706]=this[_0xd6fa('0xa4')](_0x5014bf[_0x537706]);}}}};AGIVertices[_0xd6fa('0x10')]['saveRestApiResult']=function(_0x512dce,_0x27dfaf){for(var _0x2ed230 in _0x512dce){if(_0x512dce['hasOwnProperty'](_0x2ed230)){if(_[_0xd6fa('0xa6')](_0x512dce[_0x2ed230])){if(!_[_0xd6fa('0x44')](_0x512dce[_0x2ed230])){this[_0xd6fa('0xa9')](_0x512dce[_0x2ed230],util[_0xd6fa('0x28')]('%s.%s',_0x27dfaf,_0x2ed230));}}else if(_['isArray'](_0x512dce[_0x2ed230])){for(var _0x55beab=0x0;_0x55beab<_0x512dce[_0x2ed230]['length'];_0x55beab++){this[_0xd6fa('0xa9')](_0x512dce[_0x2ed230][_0x55beab],util['format'](_0xd6fa('0xaa'),_0x27dfaf,_0x2ed230+'['+_0x55beab+']'));}}else{if(!_['isNil'](_0x512dce[_0x2ed230])){this[_0xd6fa('0xf')][_0xd6fa('0xab')](util[_0xd6fa('0x28')](_0xd6fa('0xaa'),_0x27dfaf,_0x2ed230),_0x512dce[_0x2ed230]);}}}}};AGIVertices['prototype'][_0xd6fa('0xa3')]=function(_0x8d847b){try{var _0x5631fa=JSON['parse'](_0x8d847b);this['recursiveNodeIndex'](_0x5631fa);return JSON['stringify'](_0x5631fa);}catch(_0x5b2f13){return this['replaceAllVariables'](_0x8d847b);}};AGIVertices[_0xd6fa('0x10')]['replaceAllVariables']=function(_0x47ab0c){var _0x3fe8fe=_0x47ab0c[_0xd6fa('0xac')]('{');for(var _0x46f292=0x1;_0x46f292<_0x3fe8fe[_0xd6fa('0xa8')];_0x46f292+=0x1){var _0x22c919=_0x3fe8fe[_0x46f292][_0xd6fa('0xac')]('}');if(_0x22c919['length']>0x1){_0x47ab0c=_0x47ab0c[_0xd6fa('0xad')]('{'+_0x22c919[0x0]+'}',this['channel'][_0xd6fa('0x11')](_0x22c919[0x0])[_0xd6fa('0xae')]||_0x22c919[0x0]);}}if(_0x3fe8fe[_0xd6fa('0xa8')]===0x1){return _0x47ab0c[_0xd6fa('0xaf')]();}return this[_0xd6fa('0xa4')](_0x47ab0c);};AGIVertices['prototype'][_0xd6fa('0xb0')]=function(_0x2cfdf3,_0x1da141){var _0x420717=this[_0xd6fa('0xf')][_0xd6fa('0x11')](_0x2cfdf3);if(_0x420717['result']===-0x1){return _0x420717;}logger[_0xd6fa('0x2d')](util[_0xd6fa('0x28')](_0xd6fa('0xb1'),_0x1da141,_0x420717['extra']));return this['channel'][_0xd6fa('0xab')](_0x1da141,_0x420717[_0xd6fa('0xae')]);};AGIVertices[_0xd6fa('0x10')]['isConfigured']=function(_0x2b4c7b){return _0x2b4c7b&&_0x2b4c7b!=='0'&&_0x2b4c7b!=='-1'&&_0x2b4c7b!=='';};AGIVertices[_0xd6fa('0x10')][_0xd6fa('0xb2')]=function(_0x23c79c){this[_0xd6fa('0x36')][_0xd6fa('0x7d')](this,_0x23c79c,'-');_0x23c79c[_0xd6fa('0xb3')]=_0x23c79c['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices['prototype']['mrcpsynth']=function(_0x397cda){logger['info'](util[_0xd6fa('0x28')]('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x397cda['label']));if(!this[_0xd6fa('0x91')](_0x397cda[_0xd6fa('0x66')])){return this['channel'][_0xd6fa('0xb4')]('no\x20text\x20configured');}var _0x1b0634='\x22'+_0x397cda['text']+'\x22';if(this['isConfigured'](_0x397cda[_0xd6fa('0x84')])){_0x1b0634+=','+_0x397cda[_0xd6fa('0x84')];}var _0x126ef0=this[_0xd6fa('0xf')]['exec']('MRCPSynth',_0x1b0634);if(_0x126ef0[_0xd6fa('0xb5')]===-0x1){return _0x126ef0;}return this[_0xd6fa('0xf')][_0xd6fa('0xb4')](util['format'](_0xd6fa('0xb6'),_0x1b0634));};AGIVertices[_0xd6fa('0x10')][_0xd6fa('0xb7')]=function(_0x2af09e){logger['info'](util[_0xd6fa('0x28')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x2af09e[_0xd6fa('0x38')]));if(!this[_0xd6fa('0x91')](_0x2af09e[_0xd6fa('0xb8')])){return this[_0xd6fa('0xf')]['noop'](_0xd6fa('0xb9'));}var _0x31b69e=_0x2af09e[_0xd6fa('0xb8')];if(this[_0xd6fa('0x91')](_0x2af09e[_0xd6fa('0x84')])){_0x31b69e+=','+_0x2af09e[_0xd6fa('0x84')];}var _0x5a1cdb=this['channel'][_0xd6fa('0x60')](_0xd6fa('0xba'),_0x31b69e);if(_0x5a1cdb[_0xd6fa('0xb5')]===-0x1){return _0x5a1cdb;}var _0x2ed5c3=this[_0xd6fa('0xb0')]('RECOG_CONFIDENCE()',_0xd6fa('0xbb'));if(_0x2ed5c3[_0xd6fa('0xb5')]===-0x1){return _0x2ed5c3;}var _0x531dd7=this['getAndSetVariable']('RECOG_INPUT()',_0xd6fa('0xbc'));if(_0x531dd7['result']===-0x1){return _0x531dd7;}var _0x26bc5e=this[_0xd6fa('0xb0')](_0xd6fa('0xbd'),_0xd6fa('0xbe'));if(_0x26bc5e[_0xd6fa('0xb5')]===-0x1){return _0x26bc5e;}return this['channel']['noop'](util[_0xd6fa('0x28')](_0xd6fa('0xbf'),_0x31b69e));};AGIVertices[_0xd6fa('0x10')][_0xd6fa('0x8')]=function(_0x46c077){logger[_0xd6fa('0x2d')](util[_0xd6fa('0x28')](_0xd6fa('0xc0'),_0x46c077[_0xd6fa('0x38')]));return this[_0xd6fa('0xf')]['agi']([_0x46c077[_0xd6fa('0xc1')],_0x46c077['args']]);};AGIVertices[_0xd6fa('0x10')][_0xd6fa('0xc2')]=function(_0x35f9a5){logger[_0xd6fa('0x2d')](util[_0xd6fa('0x28')](_0xd6fa('0xc3'),_0x35f9a5[_0xd6fa('0x38')]));if(this[_0xd6fa('0x91')](_0x35f9a5['timeout'])){logger['info'](util['format']('Wait\x20%s\x20seconds\x20before\x20answer',_0x35f9a5[_0xd6fa('0x71')]));var _0x11afa9=this[_0xd6fa('0xf')][_0xd6fa('0xc4')](_0x35f9a5[_0xd6fa('0x71')]);if(_0x11afa9['result']===-0x1){return _0x11afa9;}}return this['channel'][_0xd6fa('0xc2')]();};AGIVertices[_0xd6fa('0x10')][_0xd6fa('0x4a')]=function(_0x5d7e25){logger['info'](util[_0xd6fa('0x28')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x5d7e25[_0xd6fa('0x38')]));if(!this['isConfigured'](_0x5d7e25[_0xd6fa('0x49')])){return this[_0xd6fa('0xf')][_0xd6fa('0x2b')](_0x5d7e25,'no\x20list\x20selected');}_0x5d7e25['scheduledAt']=moment();if(this[_0xd6fa('0x91')](_0x5d7e25[_0xd6fa('0xc5')])){_0x5d7e25['scheduledAt']=moment()['add'](_0x5d7e25['delay'],_0xd6fa('0x53'));}if(!this[_0xd6fa('0x91')](_0x5d7e25[_0xd6fa('0x4b')])){_0x5d7e25[_0xd6fa('0x4b')]=0x2;}this[_0xd6fa('0x43')][_0xd6fa('0x7d')](this,_0x5d7e25);return this[_0xd6fa('0xf')][_0xd6fa('0xb4')](util[_0xd6fa('0x28')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x5d7e25[_0xd6fa('0x4f')],_0x5d7e25[_0xd6fa('0x49')],_0x5d7e25[_0xd6fa('0xc6')]));};AGIVertices[_0xd6fa('0x10')][_0xd6fa('0xc7')]=function(_0x4adddd){logger[_0xd6fa('0x2d')](util[_0xd6fa('0x28')](_0xd6fa('0xc8'),_0x4adddd['label']));var _0x376c4d=this[_0xd6fa('0xf')]['exec'](_0x4adddd[_0xd6fa('0xc9')],_0x4adddd[_0xd6fa('0x84')]);if(_0x376c4d[_0xd6fa('0xb5')]===-0x1){return _0x376c4d;}return this[_0xd6fa('0xf')]['noop'](util['format'](_0xd6fa('0xca'),_0x4adddd[_0xd6fa('0xc9')],_0x4adddd['options']));};AGIVertices[_0xd6fa('0x10')][_0xd6fa('0xcb')]=function(_0x2ba79e){logger[_0xd6fa('0x2d')](util[_0xd6fa('0x28')](_0xd6fa('0xcc'),_0x2ba79e[_0xd6fa('0x38')]));if(!this[_0xd6fa('0x91')](_0x2ba79e['text'])){return this[_0xd6fa('0xf')][_0xd6fa('0xb4')](_0xd6fa('0xcd'));}var _0x34a35b='\x22'+_0x2ba79e[_0xd6fa('0x66')]+'\x22';if(this[_0xd6fa('0x91')](_0x2ba79e['options'])){_0x34a35b+=','+_0x2ba79e[_0xd6fa('0x84')];}var _0x5a0cd8=this[_0xd6fa('0xf')][_0xd6fa('0x60')]('MRCPSynth',_0x34a35b);if(_0x5a0cd8[_0xd6fa('0xb5')]===-0x1){return _0x5a0cd8;}return this['channel'][_0xd6fa('0xb4')](util['format']('Executed\x20command\x20MRCPSynth\x20%s',_0x34a35b));};AGIVertices[_0xd6fa('0x10')][_0xd6fa('0xce')]=function(_0x4ac692){logger[_0xd6fa('0x2d')](util[_0xd6fa('0x28')](_0xd6fa('0xcf'),_0x4ac692[_0xd6fa('0x38')]));if(!this['isConfigured'](_0x4ac692[_0xd6fa('0x66')])){return this[_0xd6fa('0xf')][_0xd6fa('0xb4')](_0xd6fa('0xcd'));}var _0x32cfe2='\x22'+_0x4ac692[_0xd6fa('0x66')]+'\x22';if(this[_0xd6fa('0x91')](_0x4ac692[_0xd6fa('0x84')])){_0x32cfe2+=','+_0x4ac692['options'];}var _0x45c84e=this['channel'][_0xd6fa('0x60')](_0xd6fa('0xd0'),_0x32cfe2);if(_0x45c84e['result']===-0x1){return _0x45c84e;}return this['channel'][_0xd6fa('0xb4')](util[_0xd6fa('0x28')](_0xd6fa('0xb6'),_0x32cfe2));};AGIVertices[_0xd6fa('0x10')][_0xd6fa('0xd1')]=function(_0x41ad4f){logger[_0xd6fa('0x2d')](util[_0xd6fa('0x28')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x41ad4f[_0xd6fa('0x38')]));if(!this[_0xd6fa('0x91')](_0x41ad4f[_0xd6fa('0xb8')])){return this['channel']['noop'](_0xd6fa('0xb9'));}var _0x52eb00=_0x41ad4f[_0xd6fa('0xb8')];if(this[_0xd6fa('0x91')](_0x41ad4f[_0xd6fa('0x84')])){_0x52eb00+=','+_0x41ad4f[_0xd6fa('0x84')];}var _0x4938a9=this[_0xd6fa('0xf')][_0xd6fa('0x60')](_0xd6fa('0xba'),_0x52eb00);if(_0x4938a9[_0xd6fa('0xb5')]===-0x1){return _0x4938a9;}var _0x6c1ffd=this['getAndSetVariable'](_0xd6fa('0xd2'),'LUMENVOX_ASR_CONFIDENCE');if(_0x6c1ffd[_0xd6fa('0xb5')]===-0x1){return _0x6c1ffd;}var _0x14f816=this[_0xd6fa('0xb0')](_0xd6fa('0xd3'),_0xd6fa('0xd4'));if(_0x14f816[_0xd6fa('0xb5')]===-0x1){return _0x14f816;}var _0x3ab46e=this[_0xd6fa('0xb0')](_0xd6fa('0xbd'),_0xd6fa('0xd5'));if(_0x3ab46e['result']===-0x1){return _0x3ab46e;}return this[_0xd6fa('0xf')][_0xd6fa('0xb4')](util[_0xd6fa('0x28')](_0xd6fa('0xbf'),_0x52eb00));};AGIVertices[_0xd6fa('0x10')]['sestekasr']=function(_0x5e8e90){logger['info'](util[_0xd6fa('0x28')](_0xd6fa('0xd6'),_0x5e8e90[_0xd6fa('0x38')]));if(!this['isConfigured'](_0x5e8e90[_0xd6fa('0xb8')])){return this[_0xd6fa('0xf')]['noop'](_0xd6fa('0xb9'));}var _0x4003ee=_0x5e8e90[_0xd6fa('0xb8')];if(this[_0xd6fa('0x91')](_0x5e8e90['options'])){_0x4003ee+=','+_0x5e8e90[_0xd6fa('0x84')];}var _0xee99a=this[_0xd6fa('0xf')][_0xd6fa('0x60')]('MRCPRecog',_0x4003ee);if(_0xee99a[_0xd6fa('0xb5')]===-0x1){return _0xee99a;}var _0x4fa9e3=this['getAndSetVariable'](_0xd6fa('0xd2'),_0xd6fa('0xd7'));if(_0x4fa9e3[_0xd6fa('0xb5')]===-0x1){return _0x4fa9e3;}var _0x546640=this[_0xd6fa('0xb0')]('RECOG_INPUT()','SESTEK_ASR_TRANSCRIPT');if(_0x546640[_0xd6fa('0xb5')]===-0x1){return _0x546640;}var _0x3c550f=this['getAndSetVariable'](_0xd6fa('0xbd'),_0xd6fa('0xd8'));if(_0x3c550f[_0xd6fa('0xb5')]===-0x1){return _0x3c550f;}return this[_0xd6fa('0xf')][_0xd6fa('0xb4')](util['format'](_0xd6fa('0xbf'),_0x4003ee));};AGIVertices[_0xd6fa('0x10')][_0xd6fa('0xd9')]=function(_0x52d1a1){logger[_0xd6fa('0x2d')](util[_0xd6fa('0x28')](_0xd6fa('0xda'),_0x52d1a1[_0xd6fa('0x38')]));if(!this[_0xd6fa('0x91')](_0x52d1a1[_0xd6fa('0xdb')])){return this['channel'][_0xd6fa('0x2b')](_0x52d1a1,_0xd6fa('0xdc'));}var _0x9a3c8e=this[_0xd6fa('0x18')][_0xd6fa('0x7d')](this,_0x52d1a1['odbc_id']);if(!_0x9a3c8e){return this['channel'][_0xd6fa('0x2b')](_0x52d1a1,_0xd6fa('0xdd'));}if(!this[_0xd6fa('0x91')](_0x52d1a1[_0xd6fa('0x2f')])){return this[_0xd6fa('0xf')]['error'](_0x52d1a1,'no\x20query\x20configured');}var _0x4d6bc4=_0x52d1a1[_0xd6fa('0x2f')][_0xd6fa('0x62')](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0xd6fa('0xb4')](util[_0xd6fa('0x28')]('query:\x20%s',_0x4d6bc4));var _0x4c89f7=this[_0xd6fa('0x29')][_0xd6fa('0x7d')](this,_0x9a3c8e,_0x4d6bc4);this[_0xd6fa('0x36')]['sync'](this,_0x52d1a1,_0x4d6bc4);if(!this['isConfigured'](_0x52d1a1[_0xd6fa('0xde')])){return this[_0xd6fa('0xf')][_0xd6fa('0xb4')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x192976=this[_0xd6fa('0x11')][_0xd6fa('0x7d')](this,_0x52d1a1[_0xd6fa('0xde')]);if(!_0x192976){return this[_0xd6fa('0xf')][_0xd6fa('0x2b')](_0x52d1a1,'no\x20variable\x20found');}var _0x109bcc=this;_0x4c89f7[_0xd6fa('0xdf')](function(_0x1bffb4,_0x18d4a2){Object['keys'](_0x1bffb4)['forEach'](function(_0x231cf1){_0x109bcc['channel'][_0xd6fa('0xab')](util['format'](_0xd6fa('0xe0'),_0x192976,_0x18d4a2,_0x231cf1),_0x1bffb4[_0x231cf1]);});});this[_0xd6fa('0xf')][_0xd6fa('0xab')](util[_0xd6fa('0x28')](_0xd6fa('0xe1'),_0x192976),_0x4c89f7[_0xd6fa('0xa8')]);return this[_0xd6fa('0xf')]['noop'](util['format'](_0xd6fa('0xe2'),_0x192976));};AGIVertices[_0xd6fa('0x10')][_0xd6fa('0xe3')]=function(_0x2db0b3){logger[_0xd6fa('0xe4')](util[_0xd6fa('0x28')](_0xd6fa('0xe5'),_0x2db0b3['label']));if(!this['isConfigured'](_0x2db0b3[_0xd6fa('0xe6')])){return this['channel'][_0xd6fa('0x2b')](_0x2db0b3,'no\x20user\x20selected');}var _0x1365d9=this['getUser']['sync'](this,_0x2db0b3[_0xd6fa('0xe6')]);if(!_0x1365d9){return this[_0xd6fa('0xf')][_0xd6fa('0x2b')](_0x2db0b3,'no\x20user\x20found');}var _0x358867=this[_0xd6fa('0xf')][_0xd6fa('0x60')]('DIAL',[util[_0xd6fa('0x28')](_0xd6fa('0xe7'),_0x1365d9),_0x2db0b3[_0xd6fa('0x71')],_0x2db0b3['opts'],_0x2db0b3[_0xd6fa('0x70')]]);if(_0x358867[_0xd6fa('0xb5')]===-0x1){return _0x358867;}return this[_0xd6fa('0xf')][_0xd6fa('0xb4')](util[_0xd6fa('0x28')]('Executed\x20command\x20%s','DIAL'));};AGIVertices[_0xd6fa('0x10')][_0xd6fa('0xe8')]=function(_0x3386c8){logger[_0xd6fa('0x2d')](util[_0xd6fa('0x28')](_0xd6fa('0xe9'),_0x3386c8[_0xd6fa('0x38')]));if(!this[_0xd6fa('0x91')](_0x3386c8[_0xd6fa('0x86')])){return this[_0xd6fa('0xf')][_0xd6fa('0xb4')](_0xd6fa('0xea'));}if(!this[_0xd6fa('0x91')](_0x3386c8['text'])){return this[_0xd6fa('0xf')][_0xd6fa('0xb4')](_0xd6fa('0xcd'));}this[_0xd6fa('0xf')][_0xd6fa('0xeb')]=!![];this[_0xd6fa('0x36')](_0x3386c8);this[_0xd6fa('0x42')](_0x3386c8[_0xd6fa('0x66')],'in','','');this[_0xd6fa('0xf')][_0xd6fa('0xb4')](util[_0xd6fa('0x28')](_0xd6fa('0xec'),_0x3386c8['text']));var _0x59c9ca=this[_0xd6fa('0x85')][_0xd6fa('0x7d')](this,_0x3386c8);if(_0x59c9ca){for(var _0x4127c2 in _0x59c9ca){if(_0x59c9ca[_0xd6fa('0xa1')](_0x4127c2)){this[_0xd6fa('0xf')][_0xd6fa('0xab')](util[_0xd6fa('0x28')](_0xd6fa('0xed'),_0x4127c2['toUpperCase']()),_0x59c9ca[_0x4127c2]);}}this[_0xd6fa('0x42')](_0x59c9ca['speech'],_0xd6fa('0xee'),_0xd6fa('0xe8'),'');return this[_0xd6fa('0xf')]['noop'](util[_0xd6fa('0x28')]('Dialogflow\x20Result\x20%s',_0x59c9ca[_0xd6fa('0xef')]));}return this[_0xd6fa('0xf')]['error'](_0x3386c8,_0xd6fa('0xf0'));};AGIVertices[_0xd6fa('0x10')][_0xd6fa('0xf1')]=function(_0x12413b){logger[_0xd6fa('0x2d')](util[_0xd6fa('0x28')](_0xd6fa('0xf2'),_0x12413b['label']));if(!this[_0xd6fa('0x91')](_0x12413b[_0xd6fa('0x89')])){return this[_0xd6fa('0xf')][_0xd6fa('0xb4')](_0xd6fa('0xf3'));}if(!this['isConfigured'](_0x12413b['client_email'])){return this[_0xd6fa('0xf')][_0xd6fa('0xb4')](_0xd6fa('0xf4'));}if(!this[_0xd6fa('0x91')](_0x12413b[_0xd6fa('0xf5')])){return this['channel'][_0xd6fa('0xb4')]('no\x20private_key\x20configured');}if(!this['isConfigured'](_0x12413b[_0xd6fa('0x8b')])){return this[_0xd6fa('0xf')][_0xd6fa('0xb4')]('no\x20anguage\x20configured');}if(!this['isConfigured'](_0x12413b['text'])){return this[_0xd6fa('0xf')][_0xd6fa('0xb4')]('no\x20text\x20configured');}this[_0xd6fa('0xf')][_0xd6fa('0xeb')]=!![];this['createSquareDetailsReport'](_0x12413b);this[_0xd6fa('0x42')](_0x12413b[_0xd6fa('0x66')],'in','','');this[_0xd6fa('0xf')][_0xd6fa('0xb4')](util[_0xd6fa('0x28')](_0xd6fa('0xf6'),_0x12413b[_0xd6fa('0x66')]));var _0x2ceb10=this[_0xd6fa('0x88')]['sync'](this,_0x12413b);if(_0x2ceb10){for(var _0x5395c5 in _0x2ceb10){if(_0x2ceb10['hasOwnProperty'](_0x5395c5)){if(_0x5395c5!==_0xd6fa('0xf7')){this['channel']['setVariable'](util[_0xd6fa('0x28')](_0xd6fa('0xed'),_0x5395c5[_0xd6fa('0x76')]()),_0x2ceb10[_0x5395c5]);}}}this[_0xd6fa('0x42')](_0x2ceb10['speech'],'out',_0xd6fa('0xf1'),_0x2ceb10[_0xd6fa('0xf7')]);return this[_0xd6fa('0xf')]['noop'](util[_0xd6fa('0x28')](_0xd6fa('0xf8'),_0x2ceb10[_0xd6fa('0xef')]));}return this[_0xd6fa('0xf')]['error'](_0x12413b,_0xd6fa('0xf9'));};AGIVertices['prototype'][_0xd6fa('0xfa')]=function(_0x1cc4e1){logger[_0xd6fa('0x2d')](util['format'](_0xd6fa('0xfb'),_0x1cc4e1[_0xd6fa('0x38')]));if(!this[_0xd6fa('0x91')](_0x1cc4e1[_0xd6fa('0xfc')])){return this[_0xd6fa('0xf')][_0xd6fa('0xb4')](_0xd6fa('0xfd'));}if(!this[_0xd6fa('0x91')](_0x1cc4e1[_0xd6fa('0xfe')])){return this[_0xd6fa('0xf')]['noop'](_0xd6fa('0xff'));}if(!this['isConfigured'](_0x1cc4e1[_0xd6fa('0x100')])){return this[_0xd6fa('0xf')][_0xd6fa('0xb4')]('no\x20password\x20configured');}if(!this[_0xd6fa('0x91')](_0x1cc4e1[_0xd6fa('0x101')])){return this['channel'][_0xd6fa('0xb4')](_0xd6fa('0xcd'));}this[_0xd6fa('0xf')][_0xd6fa('0xeb')]=!![];this[_0xd6fa('0x36')](_0x1cc4e1);this[_0xd6fa('0x42')](_0x1cc4e1[_0xd6fa('0x66')],'in','','');this[_0xd6fa('0xf')][_0xd6fa('0xb4')](util[_0xd6fa('0x28')](_0xd6fa('0x102'),_0x1cc4e1[_0xd6fa('0x66')]));var _0x31dd9d=this[_0xd6fa('0x8c')][_0xd6fa('0x7d')](this,_0x1cc4e1);if(_0x31dd9d){for(var _0x225d55 in _0x31dd9d){if(_0x31dd9d['hasOwnProperty'](_0x225d55)){this['channel'][_0xd6fa('0xab')](util['format'](_0xd6fa('0x103'),_0x225d55[_0xd6fa('0x76')]()),_0x31dd9d[_0x225d55]);}}this[_0xd6fa('0x42')](_0x31dd9d['speech'],_0xd6fa('0xee'),_0xd6fa('0xfa'),'');if(_0x31dd9d[_0xd6fa('0x104')]){this[_0xd6fa('0xf')]['noop'](util[_0xd6fa('0x28')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x31dd9d['audiofile']));var _0x5de579=this[_0xd6fa('0xf')][_0xd6fa('0x105')](_0x31dd9d[_0xd6fa('0x104')]);try{fs[_0xd6fa('0x106')](_0x31dd9d[_0xd6fa('0x104')]+_0xd6fa('0x107'));}catch(_0x2b6819){logger[_0xd6fa('0x2b')](_0x2b6819);}return _0x5de579;}else{return this['channel'][_0xd6fa('0xb4')](util[_0xd6fa('0x28')](_0xd6fa('0x108'),_0x31dd9d[_0xd6fa('0xef')]));}}return this['channel']['error'](_0x1cc4e1,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0xd6fa('0x10')][_0xd6fa('0x109')]=function(_0x5a4245){logger[_0xd6fa('0x2d')](util[_0xd6fa('0x28')](_0xd6fa('0x10a'),_0x5a4245[_0xd6fa('0x38')]));return this[_0xd6fa('0xf')][_0xd6fa('0xb4')](_0xd6fa('0x109'));};AGIVertices['prototype']['ext_dial']=function(_0xa21f6){logger[_0xd6fa('0x2d')](util[_0xd6fa('0x28')](_0xd6fa('0x10b'),_0xa21f6[_0xd6fa('0x38')]));var _0x4c0647='';if(_0xa21f6[_0xd6fa('0x10c')]){if(!this[_0xd6fa('0x91')](_0xa21f6[_0xd6fa('0x10c')])){return this[_0xd6fa('0xf')][_0xd6fa('0x2b')](_0xa21f6,'no\x20trunk\x20selected');}else{var _0x3d0361=parseInt(_0xa21f6[_0xd6fa('0x10c')],0xa);if(isNaN(_0x3d0361)){_0x4c0647=_0xa21f6['trunk_id'];}else{_0x4c0647=this[_0xd6fa('0x1d')][_0xd6fa('0x7d')](this,_0xa21f6[_0xd6fa('0x10c')]);if(!_0x4c0647){return this[_0xd6fa('0xf')]['error'](_0xa21f6,'no\x20trunk\x20found');}}}}else if(_0xa21f6[_0xd6fa('0x10d')]){_0x4c0647=_0xa21f6[_0xd6fa('0x10d')];}else{return this[_0xd6fa('0xf')][_0xd6fa('0x2b')](_0xa21f6,'no\x20trunk\x20selected');}var _0x227954=this[_0xd6fa('0xf')][_0xd6fa('0x60')]('DIAL',[util[_0xd6fa('0x28')](_0xd6fa('0x10e'),_0x4c0647,_0xa21f6['phone']),_0xa21f6['timeout'],_0xa21f6[_0xd6fa('0x10f')],_0xa21f6[_0xd6fa('0x70')]]);if(_0x227954[_0xd6fa('0xb5')]===-0x1){return _0x227954;}return this['channel'][_0xd6fa('0xb4')](util['format'](_0xd6fa('0x110'),_0xd6fa('0x111')));};AGIVertices[_0xd6fa('0x10')][_0xd6fa('0x112')]=function(_0x121911){logger['info'](util[_0xd6fa('0x28')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x121911[_0xd6fa('0x38')]));return this[_0xd6fa('0xf')]['noop'](_0xd6fa('0x112'));};AGIVertices['prototype']['getdigits']=function(_0x42bc0a){logger['info'](util[_0xd6fa('0x28')](_0xd6fa('0x113'),_0x42bc0a[_0xd6fa('0x38')]));if(_0x42bc0a[_0xd6fa('0xb3')]===0x0){return this[_0xd6fa('0xb2')](_0x42bc0a);}_0x42bc0a['retry']-=0x1;if(!this['isConfigured'](_0x42bc0a['file_id'])){return this[_0xd6fa('0xf')][_0xd6fa('0x2b')](_0x42bc0a,_0xd6fa('0x114'));}var _0x1a90bd=this[_0xd6fa('0x115')]['sync'](this,_0x42bc0a[_0xd6fa('0x116')]);if(!_0x1a90bd){return this['channel'][_0xd6fa('0x2b')](_0x42bc0a,_0xd6fa('0x117'));}if(!this[_0xd6fa('0x91')](_0x42bc0a[_0xd6fa('0xde')])){return this[_0xd6fa('0xf')][_0xd6fa('0x2b')](_0xd6fa('0x118'));}var _0xdf0b7b=this['channel'][_0xd6fa('0x119')](_0x1a90bd,_0x42bc0a[_0xd6fa('0x11a')],_0x42bc0a[_0xd6fa('0x11b')]);var _0x3459f0=_0xdf0b7b[_0xd6fa('0xb5')]?_0xdf0b7b[_0xd6fa('0xb5')][_0xd6fa('0xaf')]():'';logger[_0xd6fa('0x2d')](_0xd6fa('0x11c'),JSON[_0xd6fa('0x80')](_0xdf0b7b));if(_0xdf0b7b[_0xd6fa('0xb5')]===-0x1){this[_0xd6fa('0x36')][_0xd6fa('0x7d')](this,_0x42bc0a,_0x3459f0);return _0xdf0b7b;}else if(_0xdf0b7b[_0xd6fa('0xae')]===_0xd6fa('0x71')){_0xdf0b7b['result']=_0x3459f0[_0xd6fa('0xa8')]>=parseInt(_0x42bc0a[_0xd6fa('0x11d')])?'x':'i';}else{_0xdf0b7b[_0xd6fa('0xb5')]=_0x3459f0[_0xd6fa('0xa8')]>=parseInt(_0x42bc0a[_0xd6fa('0x11d')])&&_0x3459f0['length']<=parseInt(_0x42bc0a[_0xd6fa('0x11b')])?'x':'i';}var _0x3396a2=this['getVariable'][_0xd6fa('0x7d')](this,_0x42bc0a[_0xd6fa('0xde')]);if(!_0x3396a2){return this[_0xd6fa('0xf')][_0xd6fa('0x2b')](_0x42bc0a,'no\x20variable\x20found');}this[_0xd6fa('0xf')][_0xd6fa('0xab')](_0x3396a2,_0x3459f0);if(this[_0xd6fa('0x91')](_0x42bc0a[_0xd6fa('0x11e')])){var _0x2aac08=parseInt(_0x42bc0a['hiddendigitsnum'],0xa);var _0x158b31=rs[_0xd6fa('0x11f')]({'charset':'*','length':_0x2aac08});var _0x259c88=_0x3459f0[_0xd6fa('0xa8')];if(_0x259c88>0x0){if(_0x259c88>_0x2aac08){this['createSquareDetailsReport']['sync'](this,_0x42bc0a,_0x42bc0a[_0xd6fa('0x120')]===_0xd6fa('0x121')?_0x158b31+_0x3459f0[_0xd6fa('0x122')](_0x2aac08):_0x3459f0[_0xd6fa('0x122')](0x0,_0x259c88-_0x2aac08)+_0x158b31);}else{this[_0xd6fa('0x36')]['sync'](this,_0x42bc0a,rs[_0xd6fa('0x11f')]({'charset':'*','length':_0x259c88}));}}else{this[_0xd6fa('0x36')][_0xd6fa('0x7d')](this,_0x42bc0a,'');}}else{this[_0xd6fa('0x36')][_0xd6fa('0x7d')](this,_0x42bc0a,_0x3459f0);}return _0xdf0b7b;};AGIVertices[_0xd6fa('0x10')]['getsecretdigits']=function(_0x432f56){logger[_0xd6fa('0x2d')](util[_0xd6fa('0x28')](_0xd6fa('0x123'),_0x432f56['label']));return this[_0xd6fa('0x124')](_0x432f56);};AGIVertices['prototype'][_0xd6fa('0x125')]=function(_0x1b1f17){logger[_0xd6fa('0x2d')](util[_0xd6fa('0x28')](_0xd6fa('0x126'),_0x1b1f17[_0xd6fa('0x38')]));this[_0xd6fa('0x36')][_0xd6fa('0x7d')](this,_0x1b1f17,_0x1b1f17['goalname']);return this[_0xd6fa('0xf')][_0xd6fa('0xb4')](util['format'](_0xd6fa('0x127'),_0x1b1f17['goalname']));};AGIVertices[_0xd6fa('0x10')]['awspolly']=function(_0x31fde5){logger['info'](util[_0xd6fa('0x28')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x31fde5[_0xd6fa('0x38')]));if(!this[_0xd6fa('0x91')](_0x31fde5[_0xd6fa('0x94')])||!this[_0xd6fa('0x91')](_0x31fde5[_0xd6fa('0x95')])){return this[_0xd6fa('0xf')][_0xd6fa('0xb4')](_0xd6fa('0x128'));}if(!this['isConfigured'](_0x31fde5[_0xd6fa('0x66')])){return this[_0xd6fa('0xf')][_0xd6fa('0xb4')]('no\x20text\x20configured');}this['channel'][_0xd6fa('0xb4')](util[_0xd6fa('0x28')](_0xd6fa('0x129'),_0x31fde5[_0xd6fa('0x66')]));var _0x34df1e=this[_0xd6fa('0x93')]['sync'](this,_0x31fde5);if(_0x34df1e){this[_0xd6fa('0xf')][_0xd6fa('0xb4')](util[_0xd6fa('0x28')](_0xd6fa('0x12a'),_0x34df1e));var _0x5a5ed8=this[_0xd6fa('0xf')][_0xd6fa('0x105')](_0x34df1e);try{fs[_0xd6fa('0x106')](_0x34df1e+'.wav');}catch(_0x559f17){logger[_0xd6fa('0x2b')](_0x559f17);}return _0x5a5ed8;}return this[_0xd6fa('0xf')][_0xd6fa('0x2b')](_0x31fde5,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0xd6fa('0x10')][_0xd6fa('0x12b')]=function(_0x2d0f76){logger[_0xd6fa('0x2d')](util['format'](_0xd6fa('0x12c'),_0x2d0f76['label']));if(!this[_0xd6fa('0x91')](_0x2d0f76[_0xd6fa('0x94')])||!this[_0xd6fa('0x91')](_0x2d0f76[_0xd6fa('0x95')])){return this['channel'][_0xd6fa('0xb4')](_0xd6fa('0x128'));}if(!this[_0xd6fa('0x91')](_0x2d0f76[_0xd6fa('0x9b')])){return this[_0xd6fa('0xf')][_0xd6fa('0xb4')](_0xd6fa('0x12d'));}if(!this[_0xd6fa('0x91')](_0x2d0f76['text'])){return this['channel'][_0xd6fa('0xb4')](_0xd6fa('0xcd'));}this[_0xd6fa('0xf')]['bot']=!![];this[_0xd6fa('0x36')](_0x2d0f76);this['createSquareMessage'](_0x2d0f76[_0xd6fa('0x66')],'in','','');this['channel'][_0xd6fa('0xb4')](util[_0xd6fa('0x28')]('Trying\x20Amazon\x20Lex:\x20%s',_0x2d0f76['text']));var _0x125794=this[_0xd6fa('0x99')][_0xd6fa('0x7d')](this,_0x2d0f76);if(_0x125794){for(var _0x4e9b95 in _0x125794){if(_0x125794[_0xd6fa('0xa1')](_0x4e9b95)&&_[_0xd6fa('0xa2')](_0x125794[_0x4e9b95])){this['channel'][_0xd6fa('0xab')](util[_0xd6fa('0x28')](_0xd6fa('0x12e'),_0x4e9b95[_0xd6fa('0x76')]()),_0x125794[_0x4e9b95]);}}if(_[_0xd6fa('0x45')](_0x125794['message'])){return this['channel'][_0xd6fa('0xb4')](_0xd6fa('0x12f'));}else{this['createSquareMessage'](_0x125794['message'],'out',_0xd6fa('0x130'),'');return this['channel'][_0xd6fa('0xb4')](util['format'](_0xd6fa('0x131'),_0x125794[_0xd6fa('0x82')]));}}return this[_0xd6fa('0xf')][_0xd6fa('0x2b')](_0x2d0f76,_0xd6fa('0x132'));};AGIVertices[_0xd6fa('0x10')][_0xd6fa('0x133')]=function(_0x59847c){logger['info'](util[_0xd6fa('0x28')]('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x59847c[_0xd6fa('0x38')],_0x59847c[_0xd6fa('0x71')]));if(!this[_0xd6fa('0x91')](_0x59847c['key'])){return this['channel'][_0xd6fa('0xb4')]('no\x20key\x20configured');}var _0x4d4092=_0xd6fa('0x134');var _0x3bc2f6=util[_0xd6fa('0x28')](_0xd6fa('0x135'),FILES_PATH,rs[_0xd6fa('0x11f')](0x4));var _0x3b5751=util[_0xd6fa('0x28')](_0xd6fa('0xaa'),_0x3bc2f6,_0x4d4092);var _0xbdce1c=!![];if(_0x59847c[_0xd6fa('0x136')]===_0xd6fa('0x137')){_0xbdce1c=![];}var _0x3f8548=this['channel'][_0xd6fa('0x138')](_0x3bc2f6,_0x4d4092,_0x59847c[_0xd6fa('0x139')],_0x59847c[_0xd6fa('0x71')],undefined,_0xbdce1c);if(_0x3f8548['result']!==-0x1){this['channel'][_0xd6fa('0xb4')](util[_0xd6fa('0x28')](_0xd6fa('0x13a'),_0x3b5751));var _0x560e14=this[_0xd6fa('0x9c')][_0xd6fa('0x7d')](this,_0x59847c,_0x3b5751);if(_0x560e14){for(var _0x34b4ab in _0x560e14){if(_0x560e14[_0xd6fa('0xa1')](_0x34b4ab)){this[_0xd6fa('0xf')][_0xd6fa('0xab')](util[_0xd6fa('0x28')](_0xd6fa('0x13b'),_0x34b4ab['toUpperCase']()),_0x560e14[_0x34b4ab]);}}return this['channel'][_0xd6fa('0xb4')](util[_0xd6fa('0x28')](_0xd6fa('0x13c'),JSON['stringify'](_0x560e14)));}}return _0x3f8548;};AGIVertices['prototype'][_0xd6fa('0x13d')]=function(_0x33d851){logger[_0xd6fa('0x2d')](util[_0xd6fa('0x28')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x33d851['label']));if(!this[_0xd6fa('0x91')](_0x33d851[_0xd6fa('0x13e')])){return this[_0xd6fa('0xf')][_0xd6fa('0xb4')]('no\x20appid\x20configured');}if(!this[_0xd6fa('0x91')](_0x33d851[_0xd6fa('0x13f')])){return this[_0xd6fa('0xf')][_0xd6fa('0xb4')]('no\x20appsecret\x20configured');}var _0xa89cc7='wav';var _0x358f9e=util[_0xd6fa('0x28')]('%s/recordings/%s',FILES_PATH,rs[_0xd6fa('0x11f')](0x4));var _0x470eb8=util[_0xd6fa('0x28')](_0xd6fa('0xaa'),_0x358f9e,_0xa89cc7);var _0x22d8c7=!![];if(_0x33d851[_0xd6fa('0x136')]===_0xd6fa('0x137')){_0x22d8c7=![];}var _0x494e3a=this[_0xd6fa('0xf')][_0xd6fa('0x138')](_0x358f9e,_0xa89cc7,_0x33d851[_0xd6fa('0x139')],_0x33d851['timeout'],undefined,_0x22d8c7);if(_0x494e3a['result']!==-0x1){this[_0xd6fa('0xf')][_0xd6fa('0xb4')](util['format'](_0xd6fa('0x140'),_0x470eb8));var _0xc4e2e0=this['tildeASR']['sync'](this,_0x33d851,_0x470eb8);if(_0xc4e2e0){for(var _0x4aead4 in _0xc4e2e0){if(_0xc4e2e0[_0xd6fa('0xa1')](_0x4aead4)){this[_0xd6fa('0xf')][_0xd6fa('0xab')](util[_0xd6fa('0x28')](_0xd6fa('0x141'),_0x4aead4[_0xd6fa('0x76')]()),_0xc4e2e0[_0x4aead4]);}}return this[_0xd6fa('0xf')][_0xd6fa('0xb4')](util[_0xd6fa('0x28')]('TildeASR\x20Result\x20%s',JSON[_0xd6fa('0x80')](_0xc4e2e0)));}}return _0x494e3a;};AGIVertices[_0xd6fa('0x10')][_0xd6fa('0x142')]=function(_0x30e9e4){logger['info'](util['format'](_0xd6fa('0x143'),_0x30e9e4[_0xd6fa('0x38')]));return this[_0xd6fa('0xf')]['continueAt'](_0x30e9e4['context'],_0x30e9e4[_0xd6fa('0x3d')],_0x30e9e4[_0xd6fa('0x3e')]);};AGIVertices[_0xd6fa('0x10')][_0xd6fa('0x144')]=function(_0x2ad67f){logger['info'](util['format']('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x2ad67f[_0xd6fa('0x38')]));if(!this[_0xd6fa('0x91')](_0x2ad67f[_0xd6fa('0x145')])){return this[_0xd6fa('0xf')]['error'](_0x2ad67f,_0xd6fa('0x146'));}try{var _0x267ad3=eval(_0x2ad67f[_0xd6fa('0x145')])?_0xd6fa('0x147'):'false';this[_0xd6fa('0xf')]['noop'](util[_0xd6fa('0x28')](_0xd6fa('0x148'),_0x2ad67f[_0xd6fa('0x145')],_0x267ad3));return{'code':0xc8,'result':_0x267ad3};}catch(_0x128a40){return{'code':0xc8,'result':_0xd6fa('0x149')};}};AGIVertices[_0xd6fa('0x10')][_0xd6fa('0x14a')]=function(_0x3eb866){logger[_0xd6fa('0x2d')](util[_0xd6fa('0x28')](_0xd6fa('0x14b'),_0x3eb866[_0xd6fa('0x38')]));if(!this['isConfigured'](_0x3eb866['interval_id'])){return this[_0xd6fa('0xf')]['error'](_0x3eb866,_0xd6fa('0x14c'));}var _0x262046=this[_0xd6fa('0x23')][_0xd6fa('0x7d')](this,_0x3eb866['interval_id']);if(!_0x262046){return this[_0xd6fa('0xf')][_0xd6fa('0x2b')](_0x3eb866,_0xd6fa('0x14d'));}for(var _0x52df30=0x0;_0x52df30<_0x262046[_0xd6fa('0xa8')];_0x52df30+=0x1){var _0x1acbe9=this[_0xd6fa('0xf')][_0xd6fa('0x11')](util['format'](_0xd6fa('0x14e'),_0x262046[_0x52df30]));if(_0x1acbe9[_0xd6fa('0xb5')]===-0x1){return _0x1acbe9;}logger[_0xd6fa('0x2d')](util[_0xd6fa('0x28')]('IFTIME\x20%s\x20%s',_0x262046[_0x52df30],_0x1acbe9[_0xd6fa('0xae')]));if(_0x1acbe9['extra']===_0xd6fa('0x147')){logger[_0xd6fa('0x2d')](util[_0xd6fa('0x28')](_0xd6fa('0x14f'),_0x262046[_0x52df30],'true'));this[_0xd6fa('0xf')][_0xd6fa('0xb4')](util[_0xd6fa('0x28')]('IFTIME\x20%s\x20%s',_0x262046[_0x52df30],'true'));return{'code':0xc8,'result':_0xd6fa('0x147')};}else{logger[_0xd6fa('0x2d')](util[_0xd6fa('0x28')](_0xd6fa('0x14f'),_0x262046[_0x52df30],'false'));this[_0xd6fa('0xf')][_0xd6fa('0xb4')](util['format'](_0xd6fa('0x14f'),_0x262046[_0x52df30],'false'));}}return{'code':0xc8,'result':_0xd6fa('0x149')};};AGIVertices['prototype'][_0xd6fa('0x150')]=function(_0x453476){logger[_0xd6fa('0x2d')](util[_0xd6fa('0x28')](_0xd6fa('0x151'),_0x453476['label']));return this['channel']['hangup']();};AGIVertices['prototype'][_0xd6fa('0x152')]=function(_0x11f4f6){logger['info'](util[_0xd6fa('0x28')](_0xd6fa('0x153'),_0x11f4f6[_0xd6fa('0x38')]));if(!this[_0xd6fa('0x91')](_0x11f4f6[_0xd6fa('0x86')])){return this[_0xd6fa('0xf')][_0xd6fa('0xb4')]('no\x20key\x20configured');}var _0x853417=_0xd6fa('0x134');var _0x5ce1c9=util[_0xd6fa('0x28')](_0xd6fa('0x135'),FILES_PATH,rs['generate'](0x4));var _0x55fbfb=util['format'](_0xd6fa('0xaa'),_0x5ce1c9,_0x853417);var _0x217379=!![];if(_0x11f4f6[_0xd6fa('0x136')]===_0xd6fa('0x137')){_0x217379=![];}var _0x3d7d70=this[_0xd6fa('0xf')][_0xd6fa('0x138')](_0x5ce1c9,_0x853417,_0x11f4f6[_0xd6fa('0x139')],_0x11f4f6[_0xd6fa('0x71')],undefined,_0x217379);if(_0x3d7d70[_0xd6fa('0xb5')]!==-0x1){this[_0xd6fa('0xf')][_0xd6fa('0xb4')](util[_0xd6fa('0x28')]('ispeech\x20%s\x20file\x20created',_0x55fbfb));var _0x32915b=this[_0xd6fa('0x90')]['sync'](this,_0x11f4f6,_0x55fbfb);if(_0x32915b){for(var _0x3ca32f in _0x32915b){if(_0x32915b[_0xd6fa('0xa1')](_0x3ca32f)){this[_0xd6fa('0xf')][_0xd6fa('0xab')](util[_0xd6fa('0x28')]('ISPEECH_ASR_%s',_0x3ca32f['toUpperCase']()),_0x32915b[_0x3ca32f]);}}return this[_0xd6fa('0xf')][_0xd6fa('0xb4')](util['format']('IspeechASR\x20Result\x20%s',JSON[_0xd6fa('0x80')](_0x32915b)));}}return _0x3d7d70;};AGIVertices[_0xd6fa('0x10')][_0xd6fa('0x154')]=function(_0x5d7995){logger['info'](util[_0xd6fa('0x28')](_0xd6fa('0x155'),_0x5d7995[_0xd6fa('0x38')]));if(!this[_0xd6fa('0x91')](_0x5d7995[_0xd6fa('0x86')])){return this[_0xd6fa('0xf')]['noop'](_0xd6fa('0xea'));}if(!this['isConfigured'](_0x5d7995[_0xd6fa('0x66')])){return this[_0xd6fa('0xf')]['noop'](_0xd6fa('0xcd'));}this['channel']['noop'](util['format'](_0xd6fa('0x156'),_0x5d7995[_0xd6fa('0x66')]));var _0x48634e=this[_0xd6fa('0x8d')][_0xd6fa('0x7d')](this,_0x5d7995);if(_0x48634e){this[_0xd6fa('0xf')][_0xd6fa('0xb4')](util[_0xd6fa('0x28')](_0xd6fa('0x157'),_0x48634e));var _0x192cd2=this[_0xd6fa('0xf')]['streamFile'](_0x48634e,_0x5d7995[_0xd6fa('0x139')]);try{fs[_0xd6fa('0x106')](_0x48634e+_0xd6fa('0x107'));}catch(_0xa9b49){logger[_0xd6fa('0x2b')](_0xa9b49);}return _0x192cd2;}return this[_0xd6fa('0xf')][_0xd6fa('0x2b')](_0x5d7995,_0xd6fa('0x158'));};AGIVertices[_0xd6fa('0x10')][_0xd6fa('0x159')]=function(_0x363fd9){logger[_0xd6fa('0x2d')](util[_0xd6fa('0x28')](_0xd6fa('0x15a'),_0x363fd9['label']));if(!this[_0xd6fa('0x91')](_0x363fd9['findBy'])){return this[_0xd6fa('0xf')]['error'](_0x363fd9,'no\x20find\x20by\x20configured');}logger['info'](util[_0xd6fa('0x28')](_0xd6fa('0x15b'),this[_0xd6fa('0xf')][_0xd6fa('0x3a')],_0x363fd9[_0xd6fa('0x15c')]));var _0xe3d161=this[_0xd6fa('0x5b')]['sync'](this,_0x363fd9['findBy']);if(_0xe3d161){logger[_0xd6fa('0x2d')](util['format'](_0xd6fa('0x15d'),this[_0xd6fa('0xf')]['callerid'],_0x363fd9[_0xd6fa('0x15c')]));this[_0xd6fa('0xf')]['noop'](util[_0xd6fa('0x28')](_0xd6fa('0x15d'),this['channel']['callerid'],_0x363fd9[_0xd6fa('0x15c')]));return{'code':0xc8,'result':_0xd6fa('0x15e')};}else{logger[_0xd6fa('0x2d')](util[_0xd6fa('0x28')](_0xd6fa('0x15f'),this[_0xd6fa('0xf')][_0xd6fa('0x3a')],_0x363fd9[_0xd6fa('0x15c')]));this[_0xd6fa('0xf')][_0xd6fa('0xb4')](util[_0xd6fa('0x28')](_0xd6fa('0x15f'),this['channel']['callerid'],_0x363fd9[_0xd6fa('0x15c')]));return{'code':0xc8,'result':_0xd6fa('0x160')};}};AGIVertices[_0xd6fa('0x10')]['logout']=function(_0x14c837){logger[_0xd6fa('0x2d')](util[_0xd6fa('0x28')](_0xd6fa('0x161'),_0x14c837[_0xd6fa('0x38')]));if(!this[_0xd6fa('0x91')](_0x14c837[_0xd6fa('0x15c')])){return this[_0xd6fa('0xf')][_0xd6fa('0x2b')](_0x14c837,_0xd6fa('0x162'));}logger[_0xd6fa('0x2d')](util[_0xd6fa('0x28')](_0xd6fa('0x15b'),this[_0xd6fa('0xf')][_0xd6fa('0x3a')],_0x14c837[_0xd6fa('0x15c')]));var _0x453196=this[_0xd6fa('0x5a')][_0xd6fa('0x7d')](this,_0x14c837['findBy']);if(_0x453196){logger['info'](util[_0xd6fa('0x28')](_0xd6fa('0x15d'),this[_0xd6fa('0xf')][_0xd6fa('0x3a')],_0x14c837[_0xd6fa('0x15c')]));this[_0xd6fa('0xf')][_0xd6fa('0xb4')](util[_0xd6fa('0x28')](_0xd6fa('0x15d'),this[_0xd6fa('0xf')][_0xd6fa('0x3a')],_0x14c837['findBy']));return{'code':0xc8,'result':_0xd6fa('0x15e')};}else{logger['info'](util[_0xd6fa('0x28')](_0xd6fa('0x15f'),this['channel']['callerid'],_0x14c837[_0xd6fa('0x15c')]));this[_0xd6fa('0xf')]['noop'](util[_0xd6fa('0x28')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xd6fa('0xf')][_0xd6fa('0x3a')],_0x14c837[_0xd6fa('0x15c')]));return{'code':0xc8,'result':_0xd6fa('0x160')};}};AGIVertices[_0xd6fa('0x10')]['math']=function(_0x5dc004){logger[_0xd6fa('0x2d')](util[_0xd6fa('0x28')](_0xd6fa('0x163'),_0x5dc004[_0xd6fa('0x38')]));if(!this[_0xd6fa('0x91')](_0x5dc004[_0xd6fa('0x164')])){return this[_0xd6fa('0xf')][_0xd6fa('0x2b')](_0x5dc004,'no\x20operation\x20configured');}this[_0xd6fa('0xf')][_0xd6fa('0xb4')](util[_0xd6fa('0x28')](_0xd6fa('0x165'),_0x5dc004[_0xd6fa('0x164')]));var _0x3ab03b=eval(_0x5dc004[_0xd6fa('0x164')]);if(!this[_0xd6fa('0x91')](_0x5dc004[_0xd6fa('0xde')])){return this[_0xd6fa('0xf')]['noop'](_0xd6fa('0x118'));}var _0x1effe2=this[_0xd6fa('0x11')]['sync'](this,_0x5dc004[_0xd6fa('0xde')]);if(!_0x1effe2){return this['channel'][_0xd6fa('0x2b')](_0x5dc004,_0xd6fa('0x166'));}if(_[_0xd6fa('0xa7')](_0x3ab03b)){var _0x335d2a=this;_0x3ab03b['forEach'](function(_0x29bf9a,_0x332ec8){_0x335d2a[_0xd6fa('0xf')][_0xd6fa('0xab')](util[_0xd6fa('0x28')]('%s[%s]',_0x1effe2,_0x332ec8),_0x29bf9a);});return this[_0xd6fa('0xf')]['noop'](util[_0xd6fa('0x28')](_0xd6fa('0x167'),_0x1effe2));}else{return this[_0xd6fa('0xf')]['setVariable'](_0x1effe2,_0x3ab03b);}};AGIVertices['prototype'][_0xd6fa('0xd')]=function(_0x4cf618){logger[_0xd6fa('0x2d')](util[_0xd6fa('0x28')](_0xd6fa('0x168'),_0x4cf618[_0xd6fa('0x38')]));if(_0x4cf618[_0xd6fa('0xb3')]===0x0){return this['maxRetry'](_0x4cf618);}_0x4cf618['retry']-=0x1;if(!this[_0xd6fa('0x91')](_0x4cf618[_0xd6fa('0x116')])){return this[_0xd6fa('0xf')][_0xd6fa('0x2b')](_0x4cf618,_0xd6fa('0x114'));}var _0x1bf803=this['getSound'][_0xd6fa('0x7d')](this,_0x4cf618[_0xd6fa('0x116')]);if(!_0x1bf803){return this[_0xd6fa('0xf')][_0xd6fa('0x2b')](_0x4cf618,_0xd6fa('0x117'));}var _0x5f3660=this[_0xd6fa('0xf')]['getData'](_0x1bf803,_0x4cf618[_0xd6fa('0x11a')],_0x4cf618[_0xd6fa('0x169')]);var _0x26bdc=_0x5f3660[_0xd6fa('0xb5')];if(_0x5f3660['result']===-0x1){this['createSquareDetailsReport'][_0xd6fa('0x7d')](this,_0x4cf618,'-1');return _0x5f3660;}else if(_0x5f3660[_0xd6fa('0xae')]===_0xd6fa('0x71')){_0x5f3660[_0xd6fa('0xb5')]=_0x5f3660[_0xd6fa('0xb5')][_0xd6fa('0xa8')]>0x0?_0x5f3660['result']:'t';}else if(_['isEmpty'](_0x5f3660[_0xd6fa('0xb5')])){_0x5f3660[_0xd6fa('0xb5')]='#';_0x26bdc='#';}if(!this[_0xd6fa('0x91')](_0x4cf618[_0xd6fa('0xde')])){this[_0xd6fa('0xf')][_0xd6fa('0xb4')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x205a7f=this[_0xd6fa('0x11')][_0xd6fa('0x7d')](this,_0x4cf618[_0xd6fa('0xde')]);if(!_0x205a7f){return this[_0xd6fa('0xf')]['error'](_0x4cf618,_0xd6fa('0x166'));}this['channel'][_0xd6fa('0xab')](_0x205a7f,_0x26bdc);}this[_0xd6fa('0x36')]['sync'](this,_0x4cf618,_0x26bdc);return _0x5f3660;};AGIVertices[_0xd6fa('0x10')]['noop']=function(_0x18ed47){logger[_0xd6fa('0x2d')](util[_0xd6fa('0x28')](_0xd6fa('0x16a'),_0x18ed47[_0xd6fa('0x38')]));return this[_0xd6fa('0xf')]['noop'](_0x18ed47[_0xd6fa('0x16b')]||_0x18ed47[_0xd6fa('0x38')]);};AGIVertices[_0xd6fa('0x10')]['pause']=function(_0x5c9f20){logger[_0xd6fa('0x2d')](util[_0xd6fa('0x28')](_0xd6fa('0x16c'),_0x5c9f20[_0xd6fa('0x38')]));if(!this[_0xd6fa('0x91')](_0x5c9f20[_0xd6fa('0x15c')])){return this['channel'][_0xd6fa('0x2b')](_0x5c9f20,_0xd6fa('0x162'));}logger['info'](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xd6fa('0xf')]['callerid'],_0x5c9f20[_0xd6fa('0x15c')]));var _0x13e637=this['getPause'][_0xd6fa('0x7d')](this,_0x5c9f20[_0xd6fa('0x16d')]);var _0x558be2=this['agentPause'][_0xd6fa('0x7d')](this,_0x5c9f20['findBy'],_0x13e637);if(_0x558be2){logger[_0xd6fa('0x2d')](util[_0xd6fa('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xd6fa('0xf')][_0xd6fa('0x3a')],_0x5c9f20['findBy']));this[_0xd6fa('0xf')][_0xd6fa('0xb4')](util[_0xd6fa('0x28')](_0xd6fa('0x15d'),this['channel'][_0xd6fa('0x3a')],_0x5c9f20['findBy']));return{'code':0xc8,'result':_0xd6fa('0x15e')};}else{logger[_0xd6fa('0x2d')](util[_0xd6fa('0x28')](_0xd6fa('0x15f'),this[_0xd6fa('0xf')][_0xd6fa('0x3a')],_0x5c9f20['findBy']));this[_0xd6fa('0xf')][_0xd6fa('0xb4')](util[_0xd6fa('0x28')](_0xd6fa('0x15d'),this['channel'][_0xd6fa('0x3a')],_0x5c9f20[_0xd6fa('0x15c')]));return{'code':0xc8,'result':_0xd6fa('0x160')};}};AGIVertices[_0xd6fa('0x10')][_0xd6fa('0x16e')]=function(_0x4df2fd){logger[_0xd6fa('0x2d')](util[_0xd6fa('0x28')](_0xd6fa('0x16f'),_0x4df2fd['label']));if(!this[_0xd6fa('0x91')](_0x4df2fd[_0xd6fa('0x116')])){return this[_0xd6fa('0xf')][_0xd6fa('0x2b')](_0x4df2fd,_0xd6fa('0x114'));}var _0x24658e=this[_0xd6fa('0x115')][_0xd6fa('0x7d')](this,_0x4df2fd[_0xd6fa('0x116')]);if(!_0x24658e){return this[_0xd6fa('0xf')]['error'](_0x4df2fd,'no\x20file\x20audio\x20found');}var _0x2a54be=this['channel'][_0xd6fa('0x60')](_0xd6fa('0x170'),[_0x24658e,_0x4df2fd[_0xd6fa('0x10f')]]);if(_0x2a54be['result']===-0x1){return _0x2a54be;}return this[_0xd6fa('0xf')][_0xd6fa('0xb4')](util[_0xd6fa('0x28')]('Executed\x20command\x20%s\x20%s','PLAYBACK',_0x24658e));};AGIVertices[_0xd6fa('0x10')][_0xd6fa('0x171')]=function(_0x56ab7a){logger[_0xd6fa('0x2d')](util['format'](_0xd6fa('0x172'),_0x56ab7a['label']));if(!this[_0xd6fa('0x91')](_0x56ab7a['queue_id'])){return this[_0xd6fa('0xf')][_0xd6fa('0x2b')](_0x56ab7a,'no\x20queue\x20selected');}var _0x40a129='';var _0x32f495=parseInt(_0x56ab7a['queue_id'],0xa);if(isNaN(_0x32f495)){_0x40a129=_0x56ab7a[_0xd6fa('0x173')];}else{_0x40a129=this[_0xd6fa('0x13')][_0xd6fa('0x7d')](this,_0x56ab7a['queue_id']);if(!_0x40a129){return this[_0xd6fa('0xf')][_0xd6fa('0x2b')](_0x56ab7a,_0xd6fa('0x174'));}}var _0x65c348='';if(this['isConfigured'](_0x56ab7a[_0xd6fa('0x116')])){var _0x1ed0b1=this[_0xd6fa('0x115')][_0xd6fa('0x7d')](this,_0x56ab7a[_0xd6fa('0x116')]);if(_0x1ed0b1){_0x65c348=_0x1ed0b1;}}this[_0xd6fa('0x36')]['sync'](this,_0x56ab7a,_0x40a129);if(_0x56ab7a['opts'][_0xd6fa('0x175')]('x')<0x0){_0x56ab7a['opts']+='x';}if(_0x56ab7a[_0xd6fa('0x10f')][_0xd6fa('0x175')]('X')<0x0){_0x56ab7a[_0xd6fa('0x10f')]+='X';}this['channel'][_0xd6fa('0xab')](_0xd6fa('0x176'),_0x40a129?_0x40a129[_0xd6fa('0x177')]():'');var _0x342a4b=this[_0xd6fa('0xf')]['exec']('QUEUE',[_0x40a129,_0x56ab7a[_0xd6fa('0x10f')],_0x56ab7a[_0xd6fa('0x70')],_0x65c348,_0x56ab7a[_0xd6fa('0x71')],_0x56ab7a[_0xd6fa('0x8')],_0x56ab7a[_0xd6fa('0x178')],_0x56ab7a['gosub'],'',_0x56ab7a[_0xd6fa('0x179')]]);if(_0x342a4b['result']===-0x1){return _0x342a4b;}return this['channel'][_0xd6fa('0xb4')](util[_0xd6fa('0x28')](_0xd6fa('0xca'),_0xd6fa('0x17a'),_0x40a129));};AGIVertices['prototype'][_0xd6fa('0x17b')]=function(_0x52d9f5){logger[_0xd6fa('0x2d')](util[_0xd6fa('0x28')](_0xd6fa('0x17c'),_0x52d9f5['label']));var _0x41fdad=_0x52d9f5[_0xd6fa('0x17d')]||_0xd6fa('0x134');var _0x10d8c7=util[_0xd6fa('0x28')](_0xd6fa('0x17e'),this[_0xd6fa('0xf')]['uniqueid'],rs[_0xd6fa('0x11f')](0x5));var _0x3eba9f=util[_0xd6fa('0x28')]('%s/recordings/%s.%s',FILES_PATH,_0x10d8c7,_0x41fdad);var _0x354a37=util[_0xd6fa('0x28')](_0xd6fa('0x135'),FILES_PATH,_0x10d8c7);this['createSquareRecording'][_0xd6fa('0x7d')](this,_0x52d9f5,_0x10d8c7,_0x3eba9f);this['channel']['setVariable']('RECORDING_SAVENAME',_0x10d8c7);logger[_0xd6fa('0x2d')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x354a37,_0x41fdad,_0x52d9f5[_0xd6fa('0x17f')],_0x52d9f5[_0xd6fa('0x71')]);return this['channel']['recordFile'](_0x354a37,_0x41fdad,_0x52d9f5['escape_digits'],_0x52d9f5[_0xd6fa('0x71')],undefined,!![]);};AGIVertices[_0xd6fa('0x10')][_0xd6fa('0x180')]=function(_0x1266b8){logger['info'](util[_0xd6fa('0x28')](_0xd6fa('0x181'),_0x1266b8[_0xd6fa('0x38')]));if(!this[_0xd6fa('0x91')](_0x1266b8[_0xd6fa('0x70')])){return this[_0xd6fa('0xf')]['noop']('no\x20url\x20configured');}var _0xa7b3f6=this[_0xd6fa('0x6f')]['sync'](this,_0x1266b8);logger['info'](util[_0xd6fa('0x28')]('Response:',util['inspect'](_0xa7b3f6,{'showHidden':![],'depth':null})));if(!this[_0xd6fa('0x91')](_0x1266b8[_0xd6fa('0xde')])){return this['channel']['noop']('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x256a0d=this['getVariable']['sync'](this,_0x1266b8[_0xd6fa('0xde')]);if(!_0x256a0d){return this['channel'][_0xd6fa('0x2b')](_0x1266b8,'no\x20variable\x20found');}this[_0xd6fa('0xf')]['setVariable'](util[_0xd6fa('0x28')](_0xd6fa('0x182'),_0x256a0d),_0xa7b3f6[_0xd6fa('0x81')]?_0xa7b3f6[_0xd6fa('0x81')]:_0xd6fa('0x183'));this['channel'][_0xd6fa('0xab')](util[_0xd6fa('0x28')](_0xd6fa('0x184'),_0x256a0d),_0xa7b3f6[_0xd6fa('0x185')]?_0xa7b3f6[_0xd6fa('0x185')]:'OK');if(_0xa7b3f6['body']){try{this[_0xd6fa('0xa9')](_0xa7b3f6[_0xd6fa('0x77')],_0x256a0d);}catch(_0x555782){logger[_0xd6fa('0x2b')](util[_0xd6fa('0x28')](_0xd6fa('0x186'),_0x256a0d));}}return this[_0xd6fa('0xf')][_0xd6fa('0xb4')](util['format'](_0xd6fa('0xe2'),_0x256a0d));};AGIVertices['prototype'][_0xd6fa('0x187')]=function(_0x246044){logger[_0xd6fa('0x2d')](util[_0xd6fa('0x28')](_0xd6fa('0x188'),_0x246044['label']));return this[_0xd6fa('0xf')][_0xd6fa('0x189')](_0x246044[_0xd6fa('0x18a')][_0xd6fa('0x62')](/\s+/g,''),_0x246044[_0xd6fa('0x17f')]);};AGIVertices[_0xd6fa('0x10')][_0xd6fa('0x18b')]=function(_0x2bb3c2){logger['info'](util['format']('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x2bb3c2['label']));return this[_0xd6fa('0xf')]['sayNumber'](_0x2bb3c2['number']['replace'](/\s+/g,''),_0x2bb3c2[_0xd6fa('0x17f')]);};AGIVertices['prototype'][_0xd6fa('0x18c')]=function(_0x3227aa){logger[_0xd6fa('0x2d')](util[_0xd6fa('0x28')](_0xd6fa('0x18d'),_0x3227aa[_0xd6fa('0x38')]));return this['channel'][_0xd6fa('0x18e')](_0x3227aa['text'],_0x3227aa[_0xd6fa('0x17f')]);};AGIVertices['prototype'][_0xd6fa('0x18f')]=function(_0x11688d){logger[_0xd6fa('0x2d')](util[_0xd6fa('0x28')](_0xd6fa('0x190'),_0x11688d[_0xd6fa('0x38')]));if(!this[_0xd6fa('0x91')](_0x11688d[_0xd6fa('0x191')])){return this['channel']['noop'](_0xd6fa('0x192'));}var _0x212566=this[_0xd6fa('0x193')]['sync'](this,_0x11688d['account_id']);if(!_0x212566||!_0x212566[_0xd6fa('0x194')]){return this[_0xd6fa('0xf')][_0xd6fa('0x2b')](_0x11688d,_0xd6fa('0x195'));}var _0x3c214d={'from':util[_0xd6fa('0x28')](_0xd6fa('0x196'),_0x212566[_0xd6fa('0x47')],_0x212566['email']||_0x212566[_0xd6fa('0x194')][_0xd6fa('0x197')]),'to':_0x11688d['to']||'','cc':_0x11688d['cc']||'','bcc':_0x11688d[_0xd6fa('0x198')]||'','subject':_0x11688d[_0xd6fa('0x199')],'html':_0x11688d[_0xd6fa('0x66')],'text':_0x11688d[_0xd6fa('0x66')]};var _0x278964={'tls':{'rejectUnauthorized':![]}};if(_0x212566[_0xd6fa('0x194')][_0xd6fa('0x19a')]){_0x278964[_0xd6fa('0x19a')]=_0x212566[_0xd6fa('0x194')]['service'];}else{_0x278964[_0xd6fa('0x19b')]=_0x212566[_0xd6fa('0x194')][_0xd6fa('0x19b')];_0x278964[_0xd6fa('0x19c')]=_0x212566[_0xd6fa('0x194')][_0xd6fa('0x19c')];_0x278964[_0xd6fa('0x19d')]=_0x212566[_0xd6fa('0x194')][_0xd6fa('0x19d')];}if(_0x212566[_0xd6fa('0x194')][_0xd6fa('0x19e')]){_0x278964[_0xd6fa('0x19f')]={'user':_0x212566[_0xd6fa('0x194')][_0xd6fa('0x197')],'pass':_0x212566[_0xd6fa('0x194')][_0xd6fa('0x1a0')]};}if(this[_0xd6fa('0x91')](_0x11688d['template_id'])){}logger[_0xd6fa('0xe4')]('sendMail\x20message',JSON[_0xd6fa('0x80')](_0x3c214d));this['createSquareDetailsReport'][_0xd6fa('0x7d')](this,_0x11688d,_0x11688d[_0xd6fa('0x191')]);this[_0xd6fa('0xf')]['noop'](util[_0xd6fa('0x28')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x212566[_0xd6fa('0x47')]));this[_0xd6fa('0x22')][_0xd6fa('0x7d')](this,_0x278964,_0x3c214d);return this[_0xd6fa('0xf')][_0xd6fa('0xb4')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0xd6fa('0x10')][_0xd6fa('0x1a1')]=function(_0x37b56c){logger['info'](util['format'](_0xd6fa('0x1a2'),_0x37b56c[_0xd6fa('0x38')]));return this['channel']['noop'](_0xd6fa('0x1a3'));};AGIVertices[_0xd6fa('0x10')][_0xd6fa('0x1a4')]=function(_0x9d08ba){logger['info'](util[_0xd6fa('0x28')](_0xd6fa('0x1a5'),_0x9d08ba[_0xd6fa('0x38')]));if(!this[_0xd6fa('0x91')](_0x9d08ba[_0xd6fa('0x1a6')])){return this[_0xd6fa('0xf')][_0xd6fa('0xb4')](_0xd6fa('0x1a7'));}var _0xac6b9=this[_0xd6fa('0x33')][_0xd6fa('0x7d')](this,_0x9d08ba['sms_account_id']);if(!_0xac6b9){return this[_0xd6fa('0xf')][_0xd6fa('0x2b')](_0x9d08ba,_0xd6fa('0x1a8'));}var _0x5ee2ef={'body':_0x9d08ba[_0xd6fa('0x1a9')],'phone':_0x9d08ba['to']||'','SmsAccountId':_0xac6b9['id']};logger[_0xd6fa('0xe4')]('sendSMS\x20message',JSON[_0xd6fa('0x80')](_0x5ee2ef));this[_0xd6fa('0x36')][_0xd6fa('0x7d')](this,_0x9d08ba,_0x9d08ba['sms_account_id']);this[_0xd6fa('0xf')][_0xd6fa('0xb4')](util[_0xd6fa('0x28')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0xac6b9['name']));this['createSmsMessage']['sync'](this,_0x5ee2ef);return this[_0xd6fa('0xf')][_0xd6fa('0xb4')](_0xd6fa('0x1aa'));};AGIVertices[_0xd6fa('0x10')][_0xd6fa('0x1ab')]=function(_0x4b7ad4){logger['info'](util['format']('Enter\x20in\x20SET\x20(%s)\x20block',_0x4b7ad4[_0xd6fa('0x38')]));if(!this[_0xd6fa('0x91')](_0x4b7ad4[_0xd6fa('0xde')])){return this[_0xd6fa('0xf')][_0xd6fa('0x2b')](_0x4b7ad4,_0xd6fa('0x1ac'));}var _0x35fc41=this[_0xd6fa('0x11')][_0xd6fa('0x7d')](this,_0x4b7ad4['variable_id']);if(!_0x35fc41){return this[_0xd6fa('0xf')][_0xd6fa('0x2b')](_0x4b7ad4,_0xd6fa('0x166'));}return this[_0xd6fa('0xf')]['setVariable'](_0x35fc41,_0x4b7ad4[_0xd6fa('0x1ad')]);};AGIVertices['prototype']['start']=function(_0x486b76){logger['info'](util['format']('Enter\x20in\x20START\x20(%s)\x20block',_0x486b76['label']));this[_0xd6fa('0xf')][_0xd6fa('0xb4')]('START\x20CALLY\x20SQUARE');if(_0x486b76[_0xd6fa('0xc2')]===_0xd6fa('0x1ae')){this[_0xd6fa('0xf')][_0xd6fa('0xb4')](_0xd6fa('0x1af'));return this[_0xd6fa('0xf')][_0xd6fa('0xc2')]();}return this[_0xd6fa('0xf')][_0xd6fa('0xb4')]('Skipped\x20Answer');};AGIVertices[_0xd6fa('0x10')][_0xd6fa('0x1b0')]=function(_0x430dca){logger[_0xd6fa('0x2d')](util[_0xd6fa('0x28')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x430dca['label']));if(!this[_0xd6fa('0x91')](_0x430dca[_0xd6fa('0x1b1')])){return this[_0xd6fa('0xf')][_0xd6fa('0x2b')](_0x430dca,'no\x20subproject\x20selected');}var _0x12baf8=this[_0xd6fa('0x17')]['sync'](this,_0x430dca[_0xd6fa('0x1b1')]);if(!this[_0xd6fa('0x91')](_0x12baf8)){return this[_0xd6fa('0xf')][_0xd6fa('0x2b')](_0x430dca,util['format'](_0xd6fa('0x1b2'),_0x430dca[_0xd6fa('0x1b1')]));}if(_0x12baf8===this[_0xd6fa('0xf')][_0xd6fa('0x39')]){return this[_0xd6fa('0xf')][_0xd6fa('0x2b')](_0x430dca,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0xd6fa('0x36')]['sync'](this,_0x430dca,_0x12baf8);var _0x5c7525=this['channel'][_0xd6fa('0x60')](_0xd6fa('0x1b3'),util[_0xd6fa('0x28')](_0xd6fa('0x1b4'),config[_0xd6fa('0x8')]['host']||'127.0.0.1',_0x12baf8,this[_0xd6fa('0xf')]['arg_1']));if(_0x5c7525['result']===-0x1){return _0x5c7525;}return this[_0xd6fa('0xf')][_0xd6fa('0xb4')](util['format']('Executed\x20command\x20%s\x20%s',_0xd6fa('0x1b3'),_0x12baf8));};AGIVertices[_0xd6fa('0x10')][_0xd6fa('0x1b5')]=function(_0x748f4c){logger[_0xd6fa('0x2d')](util[_0xd6fa('0x28')](_0xd6fa('0x1b6'),_0x748f4c['label']));var _0xc3764e=this['shellCommand'][_0xd6fa('0x7d')](this,_0x748f4c[_0xd6fa('0xc1')]);this[_0xd6fa('0x36')][_0xd6fa('0x7d')](this,_0x748f4c,_0x748f4c[_0xd6fa('0xc1')]);if(this[_0xd6fa('0x91')](_0x748f4c['variable_id'])){var _0x50d412=this[_0xd6fa('0x11')][_0xd6fa('0x7d')](this,_0x748f4c[_0xd6fa('0xde')]);if(_0x50d412){this[_0xd6fa('0xf')][_0xd6fa('0xab')](_0x50d412,_0xc3764e);return this[_0xd6fa('0xf')][_0xd6fa('0xb4')](util['format'](_0xd6fa('0x1b7'),_0x748f4c[_0xd6fa('0xc1')],_0x50d412));}}return this['channel'][_0xd6fa('0xb4')](util[_0xd6fa('0x28')](_0xd6fa('0x1b8'),_0x748f4c['command']));};AGIVertices[_0xd6fa('0x10')][_0xd6fa('0x1b9')]=function(_0x5d0df9){logger[_0xd6fa('0x2d')](util[_0xd6fa('0x28')](_0xd6fa('0x1ba'),_0x5d0df9['label']));_0x5d0df9[_0xd6fa('0x66')]=_0x5d0df9[_0xd6fa('0x66')][_0xd6fa('0x62')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xd6fa('0x91')](_0x5d0df9[_0xd6fa('0x64')])){return this[_0xd6fa('0xf')]['noop']('no\x20apiKey\x20configured');}if(!this['isConfigured'](_0x5d0df9[_0xd6fa('0x66')])){return this[_0xd6fa('0xf')][_0xd6fa('0xb4')](_0xd6fa('0xcd'));}this[_0xd6fa('0xf')][_0xd6fa('0xb4')](util[_0xd6fa('0x28')](_0xd6fa('0x1bb'),_0x5d0df9['text']));var _0x48b5da=this[_0xd6fa('0x63')][_0xd6fa('0x7d')](this,_0x5d0df9);if(_0x48b5da){this[_0xd6fa('0xf')][_0xd6fa('0xb4')](util[_0xd6fa('0x28')](_0xd6fa('0x1bc'),_0x48b5da));var _0x3649f5=this[_0xd6fa('0xf')][_0xd6fa('0x105')](_0x48b5da);try{fs[_0xd6fa('0x106')](_0x48b5da+_0xd6fa('0x107'));}catch(_0x251089){logger[_0xd6fa('0x2b')](_0x251089);}return _0x3649f5;}return this[_0xd6fa('0xf')]['error'](_0x5d0df9,_0xd6fa('0x1bd'));};AGIVertices['prototype'][_0xd6fa('0x1be')]=function(_0x1c9110){logger[_0xd6fa('0x2d')](util[_0xd6fa('0x28')](_0xd6fa('0x1bf'),_0x1c9110[_0xd6fa('0x38')]));_0x1c9110[_0xd6fa('0x66')]=_0x1c9110[_0xd6fa('0x66')][_0xd6fa('0x62')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xd6fa('0x91')](_0x1c9110[_0xd6fa('0x66')])){return this['channel'][_0xd6fa('0xb4')](_0xd6fa('0xcd'));}this[_0xd6fa('0xf')][_0xd6fa('0xb4')](util[_0xd6fa('0x28')](_0xd6fa('0x1c0'),_0x1c9110[_0xd6fa('0x66')]));var _0xc371a=this[_0xd6fa('0x6d')][_0xd6fa('0x7d')](this,_0x1c9110);if(_0xc371a){this[_0xd6fa('0xf')][_0xd6fa('0xb4')](util[_0xd6fa('0x28')](_0xd6fa('0x1c1'),_0xc371a));var _0xaa7af1=this[_0xd6fa('0xf')][_0xd6fa('0x105')](_0xc371a);try{fs[_0xd6fa('0x106')](_0xc371a+'.wav');}catch(_0x302a12){logger[_0xd6fa('0x2b')](_0x302a12);}return _0xaa7af1;}return this[_0xd6fa('0xf')][_0xd6fa('0x2b')](_0x1c9110,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0xd6fa('0x10')][_0xd6fa('0x1c2')]=function(_0x28024f){logger[_0xd6fa('0x2d')](util['format'](_0xd6fa('0x1c3'),_0x28024f[_0xd6fa('0x38')]));if(!this[_0xd6fa('0x91')](_0x28024f[_0xd6fa('0x15c')])){return this['channel']['error'](_0x28024f,_0xd6fa('0x162'));}logger[_0xd6fa('0x2d')](util[_0xd6fa('0x28')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xd6fa('0xf')][_0xd6fa('0x3a')],_0x28024f['findBy']));var _0x2d67d7=this['agentUnpause'][_0xd6fa('0x7d')](this,_0x28024f[_0xd6fa('0x15c')]);if(_0x2d67d7){logger[_0xd6fa('0x2d')](util[_0xd6fa('0x28')](_0xd6fa('0x15d'),this['channel']['callerid'],_0x28024f[_0xd6fa('0x15c')]));this[_0xd6fa('0xf')][_0xd6fa('0xb4')](util[_0xd6fa('0x28')](_0xd6fa('0x15d'),this[_0xd6fa('0xf')][_0xd6fa('0x3a')],_0x28024f[_0xd6fa('0x15c')]));return{'code':0xc8,'result':_0xd6fa('0x15e')};}else{logger[_0xd6fa('0x2d')](util[_0xd6fa('0x28')](_0xd6fa('0x15f'),this[_0xd6fa('0xf')][_0xd6fa('0x3a')],_0x28024f['findBy']));this[_0xd6fa('0xf')][_0xd6fa('0xb4')](util[_0xd6fa('0x28')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xd6fa('0xf')]['callerid'],_0x28024f['findBy']));return{'code':0xc8,'result':_0xd6fa('0x160')};}};AGIVertices[_0xd6fa('0x10')][_0xd6fa('0x1c4')]=function(_0x8ebfd1){logger['info'](util[_0xd6fa('0x28')](_0xd6fa('0x1c5'),_0x8ebfd1[_0xd6fa('0x38')]));var _0x95ce69=this[_0xd6fa('0xf')][_0xd6fa('0x60')](_0xd6fa('0x1c6'),[_0x8ebfd1[_0xd6fa('0x1c7')],_0x8ebfd1['options']]);if(_0x95ce69[_0xd6fa('0xb5')]===-0x1){return _0x95ce69;}return this['channel'][_0xd6fa('0xb4')](util['format'](_0xd6fa('0xca'),_0xd6fa('0x1c6'),_0x8ebfd1[_0xd6fa('0x1c7')]));};AGIVertices['prototype'][_0xd6fa('0x1c8')]=function(_0x452f87){logger[_0xd6fa('0x2d')](util[_0xd6fa('0x28')](_0xd6fa('0x1c9'),_0x452f87['label']));if(!this[_0xd6fa('0x91')](_0x452f87[_0xd6fa('0xde')])){return this[_0xd6fa('0xf')][_0xd6fa('0x2b')](_0x452f87,_0xd6fa('0x1ac'));}var _0x356670=this['getVariable'][_0xd6fa('0x7d')](this,_0x452f87[_0xd6fa('0xde')]);if(!_0x356670){return this[_0xd6fa('0xf')]['error'](_0x452f87,'no\x20variable\x20found');}var _0x3237c4=this[_0xd6fa('0xf')][_0xd6fa('0x11')](_0x356670);return{'code':0xc8,'result':_0x3237c4[_0xd6fa('0xae')]?_0x3237c4['extra']:'-'};};String['prototype'][_0xd6fa('0xad')]=function(_0x5ad4ef,_0x61facb){return this['split'](_0x5ad4ef)[_0xd6fa('0x1ca')](_0x61facb);};module[_0xd6fa('0x1cb')]=AGIVertices; \ No newline at end of file +var _0x07c3=['getUser','getUserById','getTrunk','getSound','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','interval','Intervals','%s/sounds/converted/%s','getQueryOdbc','open','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','error','Error\x20closing\x20connection\x20to\x20odbc\x20%s','createSmsMessage','createSquareDetailsReport','uniqueid','agicommand','arg_1','callerid','createSquareRecording','calleridname','extension','priority','accountcode','file','createSquareMessage','callback_','isEmpty','lastName','phone','list_id','callback','scheduledAt','toString','callback_priority','has','isNil','dialTimezone','CALLERID(dialTimezone)','getContactByPhone','timezones','utcOffset','scheduledat','insertContact','minutes','getPauseById','agentPause','agentUnpause','agent','agentLogout','internal','format','LOCAL','agentLogin','shellCommand','exec','trim','replace','apiKey','google_cloud_tts_text_type','text','ssmlGender','MALE','audioEncoding','MP3','googleTTS','timeout','number','PUT','body','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','uri','render','url','parse','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','message','options','googleDialogflow','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','key','ispeech_tts_language','en-US','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_polly_region','aws_text_type','awsLex','aws_secret_access_key','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','includes','clone','replaceObjectAllVariables','replaceAllVariables','isPlainObject','recursiveNodeIndex','isArray','length','saveRestApiResult','hasOwnProperty','%s.%s','setVariable','split','getAndSetVariable','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','extra','maxRetry','MRCPSynth','result','noop','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','label','no\x20grammar\x20configured','grammar','MRCP_RECOG_CONFIDENCE','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','add','delay','createCmContact','sync','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','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','Executed\x20command\x20MRCPSynth\x20%s','sestektts','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','MRCPRecog','RECOG_CONFIDENCE()','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','odbc_id','no\x20odbc\x20database\x20found','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','forEach','keys','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','SIP/%s','opts','DIAL','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','DIALOGFLOW_%s','toUpperCase','out','dialogflow','Dialogflow\x20Result\x20%s','speech','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','password','no\x20password\x20configured','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','Sestek\x20NDA\x20%s\x20file\x20created','audiofile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','Executed\x20command\x20%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','file_id','no\x20file\x20audio\x20found','getData','response','maxdigit','test','mindigit','no\x20variable\x20found','hiddendigitsnum','hiddendigitspos','first','substr','generate','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','isString','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','context','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME\x20%s\x20%s','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','streamFile','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20NOT\x20FOUND\x20BY','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','AGENT\x20%s\x20FOUND\x20BY','success','failure','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20selected','digit','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','getPause','pause_id','playback','Enter\x20in\x20QUEUE\x20(%s)\x20block','no\x20queue\x20selected','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','macro','position','QUEUE','record','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','restapi','no\x20url\x20configured','restAPI','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','statusMessage','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','variable\x20%s\x20set','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','escape_digits','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','bcc','subject','service','host','secure','authentication','auth','user','pass','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','set','no\x20variable\x20selected','variable_value','start','yes','Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','no\x20subproject\x20selected','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','googleCloudTTS','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','VOICEMAIL','mailbox','vswitch','replaceAll','exports','path','util','lodash','shelljs','odbc','randomstring','moment','mustache','../../config/logger','agi','../../config/environment','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','getsecretdigits','channel','mailRpc','prototype','getVariable','getVariableById','name','getVoiceQueue','rpc','getVoiceQueueById','then','catch','getSquareProject','getSquareProjectById','getSquareOdbc'];(function(_0x44a3b0,_0x352810){var _0x39e6f6=function(_0x248002){while(--_0x248002){_0x44a3b0['push'](_0x44a3b0['shift']());}};_0x39e6f6(++_0x352810);}(_0x07c3,0x1bf));var _0x307c=function(_0x143cc6,_0xf94536){_0x143cc6=_0x143cc6-0x0;var _0x2cedba=_0x07c3[_0x143cc6];return _0x2cedba;};'use strict';var fs=require('fs');var path=require(_0x307c('0x0'));var util=require(_0x307c('0x1'));var _=require(_0x307c('0x2'));var sh=require(_0x307c('0x3'));var odbc=require(_0x307c('0x4'))();var rs=require(_0x307c('0x5'));var moment=require(_0x307c('0x6'));var Mustache=require(_0x307c('0x7'));var rp=require('request-promise');var logger=require(_0x307c('0x8'))(_0x307c('0x9'));var config=require(_0x307c('0xa'));var shared=require(_0x307c('0xb'));var scripts=require(_0x307c('0xc'));var FILES_PATH=_0x307c('0xd');var recursiveMapAttributes=[_0x307c('0xe'),_0x307c('0xf')];var verticesWithRetry=[_0x307c('0x10'),_0x307c('0x11'),_0x307c('0x12')];var AGIVertices=function(_0x2bd433,_0x1af97f,_0x352f5a){this[_0x307c('0x13')]=_0x2bd433;this['rpc']=_0x1af97f;this[_0x307c('0x14')]=_0x352f5a;};AGIVertices[_0x307c('0x15')][_0x307c('0x16')]=function(_0x2af63f,_0x4c1b82){this['rpc'][_0x307c('0x17')](_0x2af63f)['then'](function(_0x3c21fb){_0x4c1b82(null,_0x3c21fb?_0x3c21fb[_0x307c('0x18')]:![]);})['catch'](function(_0x2f69d6){_0x4c1b82(_0x2f69d6);});};AGIVertices[_0x307c('0x15')][_0x307c('0x19')]=function(_0x45ef78,_0x4193d8){this[_0x307c('0x1a')][_0x307c('0x1b')](_0x45ef78)[_0x307c('0x1c')](function(_0x65678e){_0x4193d8(null,_0x65678e?_0x65678e[_0x307c('0x18')]:![]);})[_0x307c('0x1d')](function(_0x424a74){_0x4193d8(_0x424a74);});};AGIVertices['prototype'][_0x307c('0x1e')]=function(_0x364441,_0x1aca09){this[_0x307c('0x1a')][_0x307c('0x1f')](_0x364441)[_0x307c('0x1c')](function(_0x3e05e2){_0x1aca09(null,_0x3e05e2?_0x3e05e2[_0x307c('0x18')]:![]);})[_0x307c('0x1d')](function(_0x5e03d0){_0x1aca09(_0x5e03d0);});};AGIVertices['prototype'][_0x307c('0x20')]=function(_0x4aa3c8,_0x409e5b){this['rpc']['getSquareOdbcById'](_0x4aa3c8)[_0x307c('0x1c')](function(_0x25a503){_0x409e5b(null,_0x25a503?_0x25a503['dsn']:![]);})[_0x307c('0x1d')](function(_0xa79b24){_0x409e5b(_0xa79b24);});};AGIVertices['prototype'][_0x307c('0x21')]=function(_0x45fe2,_0x574622){this[_0x307c('0x1a')][_0x307c('0x22')](_0x45fe2)[_0x307c('0x1c')](function(_0x519985){_0x574622(null,_0x519985?_0x519985[_0x307c('0x18')]:![]);})[_0x307c('0x1d')](function(_0x46b8a8){_0x574622(_0x46b8a8);});};AGIVertices[_0x307c('0x15')][_0x307c('0x23')]=function(_0x657402,_0x5da864){this[_0x307c('0x1a')]['getTrunkById'](_0x657402)['then'](function(_0x9a88a8){_0x5da864(null,_0x9a88a8?_0x9a88a8[_0x307c('0x18')]:![]);})[_0x307c('0x1d')](function(_0x332e81){_0x5da864(_0x332e81);});};AGIVertices[_0x307c('0x15')][_0x307c('0x24')]=function(_0x4fd125,_0x1fbdda){var _0x181fa2=this;this[_0x307c('0x1a')]['getSoundById'](_0x4fd125)[_0x307c('0x1c')](function(_0x1781ab){_0x1fbdda(null,_0x1781ab?_0x181fa2[_0x307c('0x25')](_0x1781ab[_0x307c('0x26')]):![]);})[_0x307c('0x1d')](function(_0x1e5da0){_0x1fbdda(_0x1e5da0);});};AGIVertices['prototype'][_0x307c('0x27')]=function(_0x1e448e,_0x27dba3){this[_0x307c('0x1a')][_0x307c('0x28')](_0x1e448e)[_0x307c('0x1c')](function(_0x672f68){_0x27dba3(null,_0x672f68?_0x672f68:![]);})[_0x307c('0x1d')](function(_0x12b5f4){_0x27dba3(_0x12b5f4);});};AGIVertices['prototype'][_0x307c('0x29')]=function(_0x1985fb,_0x325961,_0x1a706a){this[_0x307c('0x14')][_0x307c('0x29')](_0x1985fb,_0x325961)[_0x307c('0x1c')](function(){_0x1a706a(null);})[_0x307c('0x1d')](function(_0x2b3932){_0x1a706a(_0x2b3932);});};AGIVertices[_0x307c('0x15')][_0x307c('0x2a')]=function(_0x4ec200,_0x107518){this[_0x307c('0x1a')]['getIntervalById'](_0x4ec200)[_0x307c('0x1c')](function(_0x32523c){if(_0x32523c){if(_0x32523c['IntervalId']){_0x107518(null,[_0x32523c[_0x307c('0x2b')]]);}else{_0x107518(null,_['map'](_0x32523c[_0x307c('0x2c')],_0x307c('0x2b')));}}else{_0x107518(null,![]);}})[_0x307c('0x1d')](function(_0x2df561){_0x107518(_0x2df561);});};AGIVertices[_0x307c('0x15')][_0x307c('0x25')]=function(_0x345562){return util['format'](_0x307c('0x2d'),FILES_PATH,_0x345562);};AGIVertices[_0x307c('0x15')][_0x307c('0x2e')]=function(_0x1aa690,_0xc90593,_0x1b7575){odbc[_0x307c('0x2f')](_0x1aa690,function(_0x5da51b){if(_0x5da51b){logger['error']('Error\x20getting\x20ODBC\x20connection\x20%s',_0x5da51b);_0x1b7575(_0x5da51b);}else{logger[_0x307c('0x30')](_0x307c('0x31'));odbc[_0x307c('0x32')](_0xc90593,function(_0x4a29fe,_0x38c69e){if(_0x4a29fe){logger['info'](_0x307c('0x33'),_0xc90593);_0x1b7575(_0x4a29fe);}else{logger[_0x307c('0x30')](_0x307c('0x34'),_0xc90593);odbc[_0x307c('0x35')](function(_0x3b9301){if(_0x3b9301){logger[_0x307c('0x36')](_0x307c('0x37'),_0x3b9301);}_0x1b7575(null,_0x38c69e);});}});}});};AGIVertices[_0x307c('0x15')]['getSmsAccount']=function(_0x2d7544,_0x58a7d4){this[_0x307c('0x1a')]['getSmsAccountById'](_0x2d7544)[_0x307c('0x1c')](function(_0x4a802a){_0x58a7d4(null,_0x4a802a?_0x4a802a:![]);})[_0x307c('0x1d')](function(_0x3592c4){_0x58a7d4(_0x3592c4);});};AGIVertices[_0x307c('0x15')][_0x307c('0x38')]=function(_0x42c97e,_0x45cc33){this[_0x307c('0x1a')][_0x307c('0x38')](_0x42c97e)[_0x307c('0x1c')](function(_0x44400a){_0x45cc33(null,_0x44400a);})['catch'](function(_0x513cae){_0x45cc33(_0x513cae);});};AGIVertices[_0x307c('0x15')][_0x307c('0x39')]=function(_0x1f0fc3,_0x3e160d,_0x1afcb8){this[_0x307c('0x1a')]['createSquareDetailsReport']({'uniqueid':this['channel'][_0x307c('0x3a')],'node':_0x1f0fc3['label'],'application':_0x1f0fc3[_0x307c('0x3b')],'data':_0x3e160d||null,'project_name':this[_0x307c('0x13')][_0x307c('0x3c')],'callerid':this['channel'][_0x307c('0x3d')]})[_0x307c('0x1c')](function(_0x225cfb){if(_0x1afcb8){_0x1afcb8(null,_0x225cfb);}})[_0x307c('0x1d')](function(_0x3dd447){if(_0x1afcb8){_0x1afcb8(_0x3dd447);}});};AGIVertices['prototype'][_0x307c('0x3e')]=function(_0x32f0d0,_0x4d0aec,_0x3ca99f,_0x3287b5){this[_0x307c('0x1a')][_0x307c('0x3e')]({'uniqueid':this[_0x307c('0x13')][_0x307c('0x3a')],'callerid':this[_0x307c('0x13')]['callerid'],'calleridname':this[_0x307c('0x13')][_0x307c('0x3f')],'context':this[_0x307c('0x13')]['context'],'extension':this[_0x307c('0x13')][_0x307c('0x40')],'priority':this[_0x307c('0x13')][_0x307c('0x41')],'accountcode':this['channel'][_0x307c('0x42')],'dnid':this['channel']['dnid'],'projectName':this['channel'][_0x307c('0x3c')],'saveName':_0x4d0aec,'filename':_0x32f0d0[_0x307c('0x43')]||_0x4d0aec,'savePath':_0x3ca99f})[_0x307c('0x1c')](function(_0x1ab6a9){_0x3287b5(null,_0x1ab6a9);})['catch'](function(_0x444a7a){_0x3287b5(_0x444a7a);});};AGIVertices[_0x307c('0x15')][_0x307c('0x44')]=function(_0x2776b8,_0x136c17,_0x38730a,_0x420caa,_0x5b0b77){this['rpc'][_0x307c('0x44')]({'uniqueid':this[_0x307c('0x13')][_0x307c('0x3a')],'body':_0x2776b8,'direction':_0x136c17,'providerName':_0x38730a,'providerResponse':_0x420caa})[_0x307c('0x1c')](function(_0x4006da){if(_0x5b0b77){_0x5b0b77(null,_0x4006da);}})[_0x307c('0x1d')](function(_0x163f27){if(_0x5b0b77){_0x5b0b77(_0x163f27);}});};AGIVertices['prototype']['createCmContact']=function(_0x4540d1,_0x6d04b8){var _0x208e9a=this;var _0x32d199=0x0;var _0x46f257={'firstName':_['isEmpty'](_0x4540d1['name'])||_['isNil'](_0x4540d1[_0x307c('0x18')])?_0x307c('0x45')+Math['random']():_0x4540d1[_0x307c('0x18')],'lastName':_[_0x307c('0x46')](_0x4540d1[_0x307c('0x47')])||_['isNil'](_0x4540d1['lastName'])?null:_0x4540d1['lastName'],'phone':_0x4540d1[_0x307c('0x48')],'ListId':_0x4540d1[_0x307c('0x49')],'scheduledat':_0x4540d1['scheduledAt'],'callbackUniqueid':this['channel'][_0x307c('0x3a')],'tags':_0x307c('0x4a'),'description':'Callback\x20scheduled\x20at\x20'+_0x4540d1[_0x307c('0x4b')][_0x307c('0x4c')](),'priority':_0x4540d1[_0x307c('0x4d')]};if(_[_0x307c('0x4e')](_0x4540d1,'dialTimezone')){if(!_[_0x307c('0x4f')](_0x4540d1[_0x307c('0x50')])){var _0x44a83d=_0x4540d1[_0x307c('0x50')];if(_0x4540d1[_0x307c('0x50')]==_0x307c('0x51')){this[_0x307c('0x1a')][_0x307c('0x52')]({'phone':_0x4540d1['phone']})[_0x307c('0x1c')](function(_0x1e226c){if(!_[_0x307c('0x4f')](_0x1e226c)){var _0x55ecb7=_0x1e226c[_0x307c('0x50')];if(!_[_0x307c('0x4f')](_0x55ecb7)){var _0x26bcbd=shared[_0x307c('0x53')][_0x55ecb7];if(!_['isNil'](_0x26bcbd)){var _0x4d3407=-0x1*_0x26bcbd[_0x307c('0x54')];_0x46f257[_0x307c('0x55')]=moment(_0x4540d1['scheduledat'])['add'](_0x4d3407,'minutes');_0x208e9a[_0x307c('0x56')](_0x46f257,_0x4540d1,_0x6d04b8);}else{_0x208e9a[_0x307c('0x56')](_0x46f257,_0x4540d1,_0x6d04b8);}}else{_0x208e9a[_0x307c('0x56')](_0x46f257,_0x4540d1,_0x6d04b8);}}else{_0x208e9a[_0x307c('0x56')](_0x46f257,_0x4540d1,_0x6d04b8);}});}else{var _0x32d199=shared[_0x307c('0x53')][_0x44a83d];if(!_['isNil'](_0x32d199)){var _0x25da39=-0x1*_0x32d199[_0x307c('0x54')];_0x46f257[_0x307c('0x55')]=moment(_0x4540d1[_0x307c('0x55')])['add'](_0x25da39,_0x307c('0x57'));_0x208e9a['insertContact'](_0x46f257,_0x4540d1,_0x6d04b8);}else{_0x208e9a[_0x307c('0x56')](_0x46f257,_0x4540d1,_0x6d04b8);}}}else{_0x208e9a[_0x307c('0x56')](_0x46f257,_0x4540d1,_0x6d04b8);}}else{_0x208e9a['insertContact'](_0x46f257,_0x4540d1,_0x6d04b8);}};AGIVertices[_0x307c('0x15')]['getPause']=function(_0x2bacd3,_0x39f4f9){this['rpc'][_0x307c('0x58')](_0x2bacd3)[_0x307c('0x1c')](function(_0xe1ac18){_0x39f4f9(null,_0xe1ac18?_0xe1ac18['name']:![]);})['catch'](function(_0x543042){_0x39f4f9(_0x543042);});};AGIVertices[_0x307c('0x15')][_0x307c('0x59')]=function(_0x5d86ca,_0x75798,_0x376bab){var _0x580983={'role':'agent'};_0x580983[_0x5d86ca]=this[_0x307c('0x13')]['callerid'];this[_0x307c('0x1a')]['agentPause'](_0x580983,_0x75798,this[_0x307c('0x13')]['uniqueid'])[_0x307c('0x1c')](function(_0xa82555){_0x376bab(null,_['isNil'](_0xa82555)?![]:!![]);})[_0x307c('0x1d')](function(_0x12e471){logger['error'](_0x12e471);_0x376bab(null,![]);});};AGIVertices['prototype']['agentUnpause']=function(_0x27d0b2,_0x473396){var _0xd9593f={'role':'agent'};_0xd9593f[_0x27d0b2]=this[_0x307c('0x13')][_0x307c('0x3d')];this[_0x307c('0x1a')][_0x307c('0x5a')](_0xd9593f)[_0x307c('0x1c')](function(_0x26f58d){_0x473396(null,_[_0x307c('0x4f')](_0x26f58d)?![]:!![]);})[_0x307c('0x1d')](function(_0x43649f){logger[_0x307c('0x36')](_0x43649f);_0x473396(null,![]);});};AGIVertices['prototype']['agentLogout']=function(_0x37d691,_0x3dbc97){var _0x106e1a={'role':_0x307c('0x5b')};_0x106e1a[_0x37d691]=this['channel']['callerid'];this['rpc'][_0x307c('0x5c')](_0x106e1a)[_0x307c('0x1c')](function(_0x504768){_0x3dbc97(null,_['isNil'](_0x504768)?![]:!![]);})[_0x307c('0x1d')](function(_0x184f51){logger['error'](_0x184f51);_0x3dbc97(null,![]);});};AGIVertices[_0x307c('0x15')]['agentLogin']=function(_0x358440,_0x36ba26){var _0x585d9c={'role':_0x307c('0x5b')};_0x585d9c[_0x358440]=this[_0x307c('0x13')][_0x307c('0x3d')];var _0x5d6731=_0x358440!=_0x307c('0x5d')?util[_0x307c('0x5e')]('%s/%s@from-sip/n',_0x307c('0x5f'),this[_0x307c('0x13')]['callerid']):undefined;this[_0x307c('0x1a')][_0x307c('0x60')](_0x585d9c,_0x5d6731)['then'](function(_0xb6692e){_0x36ba26(null,_['isNil'](_0xb6692e)?![]:!![]);})[_0x307c('0x1d')](function(_0x764d61){logger[_0x307c('0x36')](_0x764d61);_0x36ba26(null,![]);});};AGIVertices['prototype'][_0x307c('0x61')]=function(_0x11aa62,_0x3c8788){sh[_0x307c('0x62')](_[_0x307c('0x63')](_0x11aa62),function(_0x90fe67,_0x39903c){var _0xb58a4d=_0x39903c[_0x307c('0x64')](/(\r\n|\n|\r)/gm,'');_0x3c8788(null,_0xb58a4d);});};AGIVertices['prototype']['googleCloudTTS']=function(_0x68ee03,_0x13d233){scripts['googleCloudTTS'](_0x68ee03[_0x307c('0x65')],_0x68ee03[_0x307c('0x66')]||_0x307c('0x67'),_0x68ee03['text'],_0x68ee03['languageCode']||'en-US',_0x68ee03[_0x307c('0x68')]||_0x307c('0x69'),_0x68ee03[_0x307c('0x6a')]||_0x307c('0x6b'))[_0x307c('0x1c')](function(_0x507a19){_0x13d233(null,_0x507a19);})[_0x307c('0x1d')](function(_0x190c23){_0x13d233(_0x190c23);});};AGIVertices['prototype']['googleTTS']=function(_0xccca6b,_0x44393d){scripts[_0x307c('0x6c')](_0xccca6b[_0x307c('0x67')],_0xccca6b['google_tts_language']||'en',0x1)[_0x307c('0x1c')](function(_0x2e7008){_0x44393d(null,_0x2e7008);})['catch'](function(_0x2fae48){_0x44393d(_0x2fae48);});};AGIVertices[_0x307c('0x15')]['restAPI']=function(_0x266afd,_0x268cea){var _0x4ee0a4={'uri':_0x266afd['url'],'method':_0x266afd['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x266afd[_0x307c('0x6d')])===_0x307c('0x6e')&&parseInt(_0x266afd[_0x307c('0x6d')])>=0x1?parseInt(_0x266afd[_0x307c('0x6d')])*0x3e8:0x5*0x3e8};if(_['includes'](['POST',_0x307c('0x6f')],_0x4ee0a4['method']['toUpperCase']())){try{_0x4ee0a4[_0x307c('0x70')]=_0x266afd[_0x307c('0xf')]?JSON['parse'](_0x266afd['rawBody']):{};}catch(_0x310c7e){logger['error'](_0x307c('0x71'),_0x310c7e);}}try{_0x4ee0a4[_0x307c('0x72')]=_0x266afd[_0x307c('0xe')]?JSON['parse'](_0x266afd['rawHeaders']):{};}catch(_0x240a8e){logger[_0x307c('0x36')](_0x307c('0x73'),_0x240a8e);}if(_0x266afd[_0x307c('0x74')]){try{var _0x26d658=require(_0x266afd[_0x307c('0x74')])['sync'](this,_0x4ee0a4);_0x4ee0a4[_0x307c('0x75')]=Mustache[_0x307c('0x76')](_0x266afd[_0x307c('0x77')],_0x26d658,{},['$$','$$']);if(_0x4ee0a4[_0x307c('0x72')]){_0x4ee0a4[_0x307c('0x72')]=JSON[_0x307c('0x78')](Mustache[_0x307c('0x76')](JSON[_0x307c('0x79')](_0x4ee0a4['headers']),_0x26d658,{},['$$','$$']));}if(_0x4ee0a4[_0x307c('0x70')]){_0x4ee0a4[_0x307c('0x70')]=JSON[_0x307c('0x78')](Mustache[_0x307c('0x76')](JSON[_0x307c('0x79')](_0x4ee0a4[_0x307c('0x70')]),_0x26d658,{},['$$','$$']));}}catch(_0x4cedbf){logger[_0x307c('0x36')](_0x307c('0x7a'),_0x4cedbf);}}rp(_0x4ee0a4)[_0x307c('0x1c')](function(_0x101bf0){var _0x1dceb2={'statusCode':_0x101bf0[_0x307c('0x7b')]||0xc8,'statusMessage':_0x101bf0['statusMessage']||'OK','headers':_0x101bf0[_0x307c('0x72')]||{},'body':_0x101bf0[_0x307c('0x70')]||{}};_0x268cea(null,_0x1dceb2);})[_0x307c('0x1d')](function(_0x239693){var _0x253939={'statusCode':_0x239693[_0x307c('0x7b')]||0x1f4,'statusMessage':_0x239693[_0x307c('0x7c')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x239693['options'][_0x307c('0x72')]||{},'body':_0x239693[_0x307c('0x7d')][_0x307c('0x70')]||{}};_0x268cea(null,_0x253939);});};AGIVertices[_0x307c('0x15')]['googleDialogflow']=function(_0x82506d,_0x511704){scripts[_0x307c('0x7e')](this[_0x307c('0x13')][_0x307c('0x3a')],_0x82506d['key'],_0x82506d[_0x307c('0x67')],_0x82506d['dialogflow_language']||'en')['then'](function(_0xd0bd4c){_0x511704(null,_0xd0bd4c);})['catch'](function(_0x186ae3){_0x511704(_0x186ae3);});};AGIVertices[_0x307c('0x15')][_0x307c('0x7f')]=function(_0x123187,_0x1422a2){scripts[_0x307c('0x7f')](this[_0x307c('0x13')][_0x307c('0x3a')],_0x123187[_0x307c('0x80')],_0x123187[_0x307c('0x81')],_0x123187[_0x307c('0x82')],_0x123187[_0x307c('0x67')],_0x123187[_0x307c('0x83')]||'en')[_0x307c('0x1c')](function(_0x2ff596){_0x1422a2(null,_0x2ff596);})[_0x307c('0x1d')](function(_0x3fc356){_0x1422a2(_0x3fc356);});};AGIVertices[_0x307c('0x15')][_0x307c('0x84')]=function(_0xf10bea,_0x3b8a70){scripts[_0x307c('0x84')](this[_0x307c('0x13')],_0xf10bea)[_0x307c('0x1c')](function(_0x5bc613){_0x3b8a70(null,_0x5bc613);})[_0x307c('0x1d')](function(_0x194f5c){_0x3b8a70(_0x194f5c);});};AGIVertices[_0x307c('0x15')]['ispeechTTS']=function(_0x3c9b7d,_0x56a740){scripts[_0x307c('0x85')](_0x3c9b7d[_0x307c('0x86')],_0x3c9b7d['text'],_0x3c9b7d[_0x307c('0x87')]||_0x307c('0x88'),_0x3c9b7d[_0x307c('0x89')])[_0x307c('0x1c')](function(_0x5cb764){_0x56a740(null,_0x5cb764);})[_0x307c('0x1d')](function(_0x2d28bf){_0x56a740(_0x2d28bf);});};AGIVertices[_0x307c('0x15')]['ispeechASR']=function(_0x40943e,_0x115c0b,_0x2861ff){scripts[_0x307c('0x8a')](_0x115c0b,_0x40943e[_0x307c('0x86')],_0x40943e[_0x307c('0x8b')]||_0x307c('0x88'),this[_0x307c('0x8c')](_0x40943e[_0x307c('0x8d')])?_0x40943e['model']:undefined)[_0x307c('0x1c')](function(_0x3bd78d){_0x2861ff(null,_0x3bd78d);})[_0x307c('0x1d')](function(_0x3980c0){_0x2861ff(_0x3980c0);});};AGIVertices[_0x307c('0x15')][_0x307c('0x8e')]=function(_0xe8031b,_0x4cd7aa){scripts['awsPolly'](_0xe8031b[_0x307c('0x8f')],_0xe8031b['aws_secret_access_key'],_0xe8031b[_0x307c('0x90')],_0xe8031b['aws_polly_voice']||'Amy',_0xe8031b['text'],_0xe8031b[_0x307c('0x91')]||'text')[_0x307c('0x1c')](function(_0x377558){_0x4cd7aa(null,_0x377558);})[_0x307c('0x1d')](function(_0x3a4d2c){_0x4cd7aa(_0x3a4d2c);});};AGIVertices[_0x307c('0x15')]['awsLex']=function(_0x4a8f0a,_0x31fdc2){scripts[_0x307c('0x92')](this[_0x307c('0x13')][_0x307c('0x3a')],_0x4a8f0a['aws_access_key_id'],_0x4a8f0a[_0x307c('0x93')],_0x4a8f0a[_0x307c('0x94')],_0x4a8f0a['text'],_0x4a8f0a[_0x307c('0x95')])['then'](function(_0xbf3d1b){_0x31fdc2(null,_0xbf3d1b);})[_0x307c('0x1d')](function(_0x145ca6){_0x31fdc2(_0x145ca6);});};AGIVertices[_0x307c('0x15')]['googleASR']=function(_0x28e2ea,_0x3957d9,_0x3fb1ba){scripts[_0x307c('0x96')](_0x3957d9,_0x28e2ea['key'],_0x28e2ea[_0x307c('0x97')]||'en-US')[_0x307c('0x1c')](function(_0x3d426e){_0x3fb1ba(null,_0x3d426e);})['catch'](function(_0x1398c3){_0x3fb1ba(_0x1398c3);});};AGIVertices[_0x307c('0x15')][_0x307c('0x98')]=function(_0x335b52,_0x2b8386,_0x248d7e){scripts[_0x307c('0x98')](_0x2b8386,_0x335b52[_0x307c('0x99')],_0x335b52[_0x307c('0x9a')],_0x335b52[_0x307c('0x75')])[_0x307c('0x1c')](function(_0x248ab4){_0x248d7e(null,_0x248ab4);})['catch'](function(_0x34f88a){_0x248d7e(_0x34f88a);});};AGIVertices[_0x307c('0x15')][_0x307c('0x9b')]=function(_0x1d5569){var _0x18fa7c=_[_0x307c('0x9c')](verticesWithRetry,_0x1d5569['agicommand'])?_0x1d5569:_[_0x307c('0x9d')](_0x1d5569);for(var _0x5624e8 in _0x18fa7c){if(_0x18fa7c['hasOwnProperty'](_0x5624e8)){if(_0x18fa7c[_0x5624e8]&&_['isString'](_0x18fa7c[_0x5624e8])){if(_[_0x307c('0x9c')](recursiveMapAttributes,_0x5624e8)){_0x18fa7c[_0x5624e8]=this[_0x307c('0x9e')](_0x18fa7c[_0x5624e8]);}else{_0x18fa7c[_0x5624e8]=this[_0x307c('0x9f')](_0x18fa7c[_0x5624e8]);}}}}return _0x18fa7c;};AGIVertices[_0x307c('0x15')]['recursiveNodeIndex']=function(_0x2aac39){for(var _0x78a1e5 in _0x2aac39){if(_0x2aac39['hasOwnProperty'](_0x78a1e5)){if(_[_0x307c('0xa0')](_0x2aac39[_0x78a1e5])){this[_0x307c('0xa1')](_0x2aac39[_0x78a1e5]);}else if(_[_0x307c('0xa2')](_0x2aac39[_0x78a1e5])){for(var _0x31f955=0x0;_0x31f955<_0x2aac39[_0x78a1e5][_0x307c('0xa3')];_0x31f955++){this[_0x307c('0xa1')](_0x2aac39[_0x78a1e5][_0x31f955]);}}else if(_['isString'](_0x2aac39[_0x78a1e5])){_0x2aac39[_0x78a1e5]=this[_0x307c('0x9f')](_0x2aac39[_0x78a1e5]);}}}};AGIVertices[_0x307c('0x15')][_0x307c('0xa4')]=function(_0x1eb209,_0x522550){for(var _0x4467b8 in _0x1eb209){if(_0x1eb209[_0x307c('0xa5')](_0x4467b8)){if(_[_0x307c('0xa0')](_0x1eb209[_0x4467b8])){if(!_['isEmpty'](_0x1eb209[_0x4467b8])){this[_0x307c('0xa4')](_0x1eb209[_0x4467b8],util[_0x307c('0x5e')](_0x307c('0xa6'),_0x522550,_0x4467b8));}}else if(_[_0x307c('0xa2')](_0x1eb209[_0x4467b8])){for(var _0x25d17a=0x0;_0x25d17a<_0x1eb209[_0x4467b8][_0x307c('0xa3')];_0x25d17a++){this[_0x307c('0xa4')](_0x1eb209[_0x4467b8][_0x25d17a],util[_0x307c('0x5e')](_0x307c('0xa6'),_0x522550,_0x4467b8+'['+_0x25d17a+']'));}}else{if(!_[_0x307c('0x4f')](_0x1eb209[_0x4467b8])){this[_0x307c('0x13')][_0x307c('0xa7')](util['format'](_0x307c('0xa6'),_0x522550,_0x4467b8),_0x1eb209[_0x4467b8]);}}}}};AGIVertices[_0x307c('0x15')][_0x307c('0x9e')]=function(_0x14dad0){try{var _0x1ff523=JSON[_0x307c('0x78')](_0x14dad0);this[_0x307c('0xa1')](_0x1ff523);return JSON[_0x307c('0x79')](_0x1ff523);}catch(_0x326d3f){return this['replaceAllVariables'](_0x14dad0);}};AGIVertices[_0x307c('0x15')][_0x307c('0x9f')]=function(_0x289519){var _0x4d4f90=_0x289519['split']('{');for(var _0x2c1fc5=0x1;_0x2c1fc5<_0x4d4f90[_0x307c('0xa3')];_0x2c1fc5+=0x1){var _0x33c6e4=_0x4d4f90[_0x2c1fc5][_0x307c('0xa8')]('}');if(_0x33c6e4['length']>0x1){_0x289519=_0x289519['replaceAll']('{'+_0x33c6e4[0x0]+'}',this[_0x307c('0x13')][_0x307c('0x16')](_0x33c6e4[0x0])['extra']||_0x33c6e4[0x0]);}}if(_0x4d4f90[_0x307c('0xa3')]===0x1){return _0x289519[_0x307c('0x4c')]();}return this[_0x307c('0x9f')](_0x289519);};AGIVertices[_0x307c('0x15')][_0x307c('0xa9')]=function(_0x3d8447,_0x266e82){var _0x95a261=this[_0x307c('0x13')][_0x307c('0x16')](_0x3d8447);if(_0x95a261['result']===-0x1){return _0x95a261;}logger[_0x307c('0x30')](util['format'](_0x307c('0xaa'),_0x266e82,_0x95a261[_0x307c('0xab')]));return this[_0x307c('0x13')][_0x307c('0xa7')](_0x266e82,_0x95a261['extra']);};AGIVertices[_0x307c('0x15')][_0x307c('0x8c')]=function(_0x215425){return _0x215425&&_0x215425!=='0'&&_0x215425!=='-1'&&_0x215425!=='';};AGIVertices[_0x307c('0x15')][_0x307c('0xac')]=function(_0x39568f){this[_0x307c('0x39')]['sync'](this,_0x39568f,'-');_0x39568f['retry']=_0x39568f[_0x307c('0xac')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x307c('0x15')]['mrcpsynth']=function(_0x31d17d){logger[_0x307c('0x30')](util['format']('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x31d17d['label']));if(!this[_0x307c('0x8c')](_0x31d17d['text'])){return this[_0x307c('0x13')]['noop']('no\x20text\x20configured');}var _0x1f51bd='\x22'+_0x31d17d[_0x307c('0x67')]+'\x22';if(this[_0x307c('0x8c')](_0x31d17d[_0x307c('0x7d')])){_0x1f51bd+=','+_0x31d17d[_0x307c('0x7d')];}var _0x2715f6=this[_0x307c('0x13')][_0x307c('0x62')](_0x307c('0xad'),_0x1f51bd);if(_0x2715f6[_0x307c('0xae')]===-0x1){return _0x2715f6;}return this[_0x307c('0x13')][_0x307c('0xaf')](util[_0x307c('0x5e')]('Executed\x20command\x20MRCPSynth\x20%s',_0x1f51bd));};AGIVertices[_0x307c('0x15')][_0x307c('0xb0')]=function(_0x2413c8){logger[_0x307c('0x30')](util['format'](_0x307c('0xb1'),_0x2413c8[_0x307c('0xb2')]));if(!this[_0x307c('0x8c')](_0x2413c8['grammar'])){return this[_0x307c('0x13')][_0x307c('0xaf')](_0x307c('0xb3'));}var _0x3c874a=_0x2413c8[_0x307c('0xb4')];if(this[_0x307c('0x8c')](_0x2413c8[_0x307c('0x7d')])){_0x3c874a+=','+_0x2413c8[_0x307c('0x7d')];}var _0x3b67d7=this['channel'][_0x307c('0x62')]('MRCPRecog',_0x3c874a);if(_0x3b67d7[_0x307c('0xae')]===-0x1){return _0x3b67d7;}var _0x221129=this[_0x307c('0xa9')]('RECOG_CONFIDENCE()',_0x307c('0xb5'));if(_0x221129[_0x307c('0xae')]===-0x1){return _0x221129;}var _0x2b3a0a=this['getAndSetVariable']('RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT');if(_0x2b3a0a[_0x307c('0xae')]===-0x1){return _0x2b3a0a;}var _0x86b99b=this[_0x307c('0xa9')]('RECOG_INSTANCE()',_0x307c('0xb6'));if(_0x86b99b[_0x307c('0xae')]===-0x1){return _0x86b99b;}return this[_0x307c('0x13')][_0x307c('0xaf')](util[_0x307c('0x5e')](_0x307c('0xb7'),_0x3c874a));};AGIVertices[_0x307c('0x15')][_0x307c('0x9')]=function(_0x2fe3ec){logger[_0x307c('0x30')](util[_0x307c('0x5e')](_0x307c('0xb8'),_0x2fe3ec[_0x307c('0xb2')]));return this[_0x307c('0x13')][_0x307c('0x9')]([_0x2fe3ec[_0x307c('0xb9')],_0x2fe3ec[_0x307c('0xba')]]);};AGIVertices['prototype'][_0x307c('0xbb')]=function(_0x4bbca8){logger['info'](util[_0x307c('0x5e')](_0x307c('0xbc'),_0x4bbca8[_0x307c('0xb2')]));if(this['isConfigured'](_0x4bbca8[_0x307c('0x6d')])){logger[_0x307c('0x30')](util[_0x307c('0x5e')](_0x307c('0xbd'),_0x4bbca8[_0x307c('0x6d')]));var _0x255af0=this[_0x307c('0x13')][_0x307c('0xbe')](_0x4bbca8[_0x307c('0x6d')]);if(_0x255af0['result']===-0x1){return _0x255af0;}}return this['channel'][_0x307c('0xbb')]();};AGIVertices['prototype'][_0x307c('0x4a')]=function(_0x3c9793){logger['info'](util[_0x307c('0x5e')](_0x307c('0xbf'),_0x3c9793[_0x307c('0xb2')]));if(!this['isConfigured'](_0x3c9793[_0x307c('0x49')])){return this[_0x307c('0x13')]['error'](_0x3c9793,_0x307c('0xc0'));}_0x3c9793[_0x307c('0x4b')]=moment();if(this[_0x307c('0x8c')](_0x3c9793['delay'])){_0x3c9793[_0x307c('0x4b')]=moment()[_0x307c('0xc1')](_0x3c9793[_0x307c('0xc2')],_0x307c('0x57'));}if(!this['isConfigured'](_0x3c9793[_0x307c('0x4d')])){_0x3c9793[_0x307c('0x4d')]=0x2;}this[_0x307c('0xc3')][_0x307c('0xc4')](this,_0x3c9793);return this[_0x307c('0x13')][_0x307c('0xaf')](util[_0x307c('0x5e')](_0x307c('0xc5'),_0x3c9793[_0x307c('0x48')],_0x3c9793[_0x307c('0x49')],_0x3c9793[_0x307c('0x4b')]));};AGIVertices[_0x307c('0x15')][_0x307c('0xc6')]=function(_0x1fed90){logger['info'](util[_0x307c('0x5e')](_0x307c('0xc7'),_0x1fed90['label']));var _0x15472f=this[_0x307c('0x13')][_0x307c('0x62')](_0x1fed90[_0x307c('0xc8')],_0x1fed90[_0x307c('0x7d')]);if(_0x15472f[_0x307c('0xae')]===-0x1){return _0x15472f;}return this[_0x307c('0x13')][_0x307c('0xaf')](util[_0x307c('0x5e')](_0x307c('0xc9'),_0x1fed90[_0x307c('0xc8')],_0x1fed90[_0x307c('0x7d')]));};AGIVertices[_0x307c('0x15')][_0x307c('0xca')]=function(_0x2aeec6){logger[_0x307c('0x30')](util[_0x307c('0x5e')](_0x307c('0xcb'),_0x2aeec6[_0x307c('0xb2')]));if(!this['isConfigured'](_0x2aeec6[_0x307c('0x67')])){return this[_0x307c('0x13')]['noop'](_0x307c('0xcc'));}var _0x3de510='\x22'+_0x2aeec6[_0x307c('0x67')]+'\x22';if(this[_0x307c('0x8c')](_0x2aeec6[_0x307c('0x7d')])){_0x3de510+=','+_0x2aeec6[_0x307c('0x7d')];}var _0x3490d2=this[_0x307c('0x13')][_0x307c('0x62')](_0x307c('0xad'),_0x3de510);if(_0x3490d2['result']===-0x1){return _0x3490d2;}return this['channel']['noop'](util[_0x307c('0x5e')](_0x307c('0xcd'),_0x3de510));};AGIVertices['prototype'][_0x307c('0xce')]=function(_0x5538d2){logger[_0x307c('0x30')](util[_0x307c('0x5e')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x5538d2['label']));if(!this['isConfigured'](_0x5538d2[_0x307c('0x67')])){return this['channel'][_0x307c('0xaf')](_0x307c('0xcc'));}var _0x30cb19='\x22'+_0x5538d2[_0x307c('0x67')]+'\x22';if(this[_0x307c('0x8c')](_0x5538d2[_0x307c('0x7d')])){_0x30cb19+=','+_0x5538d2[_0x307c('0x7d')];}var _0x28b118=this[_0x307c('0x13')][_0x307c('0x62')]('MRCPSynth',_0x30cb19);if(_0x28b118[_0x307c('0xae')]===-0x1){return _0x28b118;}return this[_0x307c('0x13')][_0x307c('0xaf')](util[_0x307c('0x5e')](_0x307c('0xcd'),_0x30cb19));};AGIVertices['prototype'][_0x307c('0xcf')]=function(_0x22afbd){logger[_0x307c('0x30')](util[_0x307c('0x5e')](_0x307c('0xd0'),_0x22afbd['label']));if(!this[_0x307c('0x8c')](_0x22afbd[_0x307c('0xb4')])){return this[_0x307c('0x13')]['noop']('no\x20grammar\x20configured');}var _0x5402bf=_0x22afbd['grammar'];if(this[_0x307c('0x8c')](_0x22afbd['options'])){_0x5402bf+=','+_0x22afbd[_0x307c('0x7d')];}var _0x138658=this[_0x307c('0x13')][_0x307c('0x62')]('MRCPRecog',_0x5402bf);if(_0x138658['result']===-0x1){return _0x138658;}var _0x537c19=this[_0x307c('0xa9')]('RECOG_CONFIDENCE()',_0x307c('0xd1'));if(_0x537c19[_0x307c('0xae')]===-0x1){return _0x537c19;}var _0x48ac27=this[_0x307c('0xa9')](_0x307c('0xd2'),_0x307c('0xd3'));if(_0x48ac27[_0x307c('0xae')]===-0x1){return _0x48ac27;}var _0x5b1310=this[_0x307c('0xa9')](_0x307c('0xd4'),_0x307c('0xd5'));if(_0x5b1310[_0x307c('0xae')]===-0x1){return _0x5b1310;}return this[_0x307c('0x13')][_0x307c('0xaf')](util[_0x307c('0x5e')](_0x307c('0xb7'),_0x5402bf));};AGIVertices[_0x307c('0x15')][_0x307c('0xd6')]=function(_0x4a8be9){logger[_0x307c('0x30')](util[_0x307c('0x5e')](_0x307c('0xd7'),_0x4a8be9[_0x307c('0xb2')]));if(!this[_0x307c('0x8c')](_0x4a8be9[_0x307c('0xb4')])){return this[_0x307c('0x13')][_0x307c('0xaf')](_0x307c('0xb3'));}var _0xbffd58=_0x4a8be9[_0x307c('0xb4')];if(this[_0x307c('0x8c')](_0x4a8be9['options'])){_0xbffd58+=','+_0x4a8be9['options'];}var _0x372955=this[_0x307c('0x13')]['exec'](_0x307c('0xd8'),_0xbffd58);if(_0x372955['result']===-0x1){return _0x372955;}var _0x54d00a=this['getAndSetVariable'](_0x307c('0xd9'),_0x307c('0xda'));if(_0x54d00a[_0x307c('0xae')]===-0x1){return _0x54d00a;}var _0x1467b2=this[_0x307c('0xa9')](_0x307c('0xd2'),_0x307c('0xdb'));if(_0x1467b2[_0x307c('0xae')]===-0x1){return _0x1467b2;}var _0x15a3a2=this['getAndSetVariable']('RECOG_INSTANCE()',_0x307c('0xdc'));if(_0x15a3a2[_0x307c('0xae')]===-0x1){return _0x15a3a2;}return this[_0x307c('0x13')][_0x307c('0xaf')](util[_0x307c('0x5e')]('Executed\x20command\x20MRCPRecog\x20%s',_0xbffd58));};AGIVertices[_0x307c('0x15')]['database']=function(_0x984435){logger[_0x307c('0x30')](util['format']('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x984435[_0x307c('0xb2')]));if(!this[_0x307c('0x8c')](_0x984435[_0x307c('0xdd')])){return this[_0x307c('0x13')][_0x307c('0x36')](_0x984435,'no\x20database\x20selected');}var _0x492623=this[_0x307c('0x20')][_0x307c('0xc4')](this,_0x984435[_0x307c('0xdd')]);if(!_0x492623){return this[_0x307c('0x13')][_0x307c('0x36')](_0x984435,_0x307c('0xde'));}if(!this[_0x307c('0x8c')](_0x984435[_0x307c('0x32')])){return this[_0x307c('0x13')][_0x307c('0x36')](_0x984435,'no\x20query\x20configured');}var _0x3bf7dd=_0x984435['query'][_0x307c('0x64')](/(\r\n|\n|\r)/gm,'\x20');this[_0x307c('0x13')][_0x307c('0xaf')](util['format'](_0x307c('0xdf'),_0x3bf7dd));var _0x1a4cfe=this[_0x307c('0x2e')][_0x307c('0xc4')](this,_0x492623,_0x3bf7dd);this[_0x307c('0x39')][_0x307c('0xc4')](this,_0x984435,_0x3bf7dd);if(!this[_0x307c('0x8c')](_0x984435[_0x307c('0xe0')])){return this[_0x307c('0x13')][_0x307c('0xaf')](_0x307c('0xe1'));}var _0x21f48a=this[_0x307c('0x16')][_0x307c('0xc4')](this,_0x984435['variable_id']);if(!_0x21f48a){return this[_0x307c('0x13')][_0x307c('0x36')](_0x984435,'no\x20variable\x20found');}var _0x29eb05=this;_0x1a4cfe[_0x307c('0xe2')](function(_0x2ef9ab,_0x53f587){Object[_0x307c('0xe3')](_0x2ef9ab)[_0x307c('0xe2')](function(_0x325e4d){_0x29eb05['channel'][_0x307c('0xa7')](util['format']('%s[%s][%s]',_0x21f48a,_0x53f587,_0x325e4d),_0x2ef9ab[_0x325e4d]);});});this[_0x307c('0x13')][_0x307c('0xa7')](util[_0x307c('0x5e')]('%s_ROWS_COUNT',_0x21f48a),_0x1a4cfe[_0x307c('0xa3')]);return this['channel'][_0x307c('0xaf')](util[_0x307c('0x5e')]('variable\x20%s\x20set',_0x21f48a));};AGIVertices[_0x307c('0x15')][_0x307c('0xe4')]=function(_0xa7d65c){logger[_0x307c('0xe5')](util[_0x307c('0x5e')](_0x307c('0xe6'),_0xa7d65c[_0x307c('0xb2')]));if(!this[_0x307c('0x8c')](_0xa7d65c[_0x307c('0xe7')])){return this[_0x307c('0x13')][_0x307c('0x36')](_0xa7d65c,_0x307c('0xe8'));}var _0x2fbc94=this[_0x307c('0x21')][_0x307c('0xc4')](this,_0xa7d65c['sip_id']);if(!_0x2fbc94){return this[_0x307c('0x13')]['error'](_0xa7d65c,_0x307c('0xe9'));}var _0x57eb9a=this[_0x307c('0x13')][_0x307c('0x62')]('DIAL',[util[_0x307c('0x5e')](_0x307c('0xea'),_0x2fbc94),_0xa7d65c['timeout'],_0xa7d65c[_0x307c('0xeb')],_0xa7d65c['url']]);if(_0x57eb9a[_0x307c('0xae')]===-0x1){return _0x57eb9a;}return this[_0x307c('0x13')]['noop'](util['format']('Executed\x20command\x20%s',_0x307c('0xec')));};AGIVertices[_0x307c('0x15')]['dialogflow']=function(_0x38069e){logger[_0x307c('0x30')](util[_0x307c('0x5e')](_0x307c('0xed'),_0x38069e['label']));if(!this[_0x307c('0x8c')](_0x38069e[_0x307c('0x86')])){return this[_0x307c('0x13')]['noop'](_0x307c('0xee'));}if(!this[_0x307c('0x8c')](_0x38069e[_0x307c('0x67')])){return this[_0x307c('0x13')][_0x307c('0xaf')]('no\x20text\x20configured');}this[_0x307c('0x13')][_0x307c('0xef')]=!![];this['createSquareDetailsReport'](_0x38069e);this['createSquareMessage'](_0x38069e[_0x307c('0x67')],'in','','');this[_0x307c('0x13')]['noop'](util[_0x307c('0x5e')]('Trying\x20Dialogflow:\x20%s',_0x38069e['text']));var _0x2a3d09=this[_0x307c('0x7e')][_0x307c('0xc4')](this,_0x38069e);if(_0x2a3d09){for(var _0x52cfcd in _0x2a3d09){if(_0x2a3d09['hasOwnProperty'](_0x52cfcd)){this[_0x307c('0x13')]['setVariable'](util[_0x307c('0x5e')](_0x307c('0xf0'),_0x52cfcd[_0x307c('0xf1')]()),_0x2a3d09[_0x52cfcd]);}}this[_0x307c('0x44')](_0x2a3d09['speech'],_0x307c('0xf2'),_0x307c('0xf3'),'');return this[_0x307c('0x13')][_0x307c('0xaf')](util[_0x307c('0x5e')](_0x307c('0xf4'),_0x2a3d09[_0x307c('0xf5')]));}return this['channel']['error'](_0x38069e,_0x307c('0xf6'));};AGIVertices[_0x307c('0x15')][_0x307c('0xf7')]=function(_0x357981){logger[_0x307c('0x30')](util[_0x307c('0x5e')](_0x307c('0xf8'),_0x357981[_0x307c('0xb2')]));if(!this[_0x307c('0x8c')](_0x357981[_0x307c('0x80')])){return this['channel'][_0x307c('0xaf')](_0x307c('0xf9'));}if(!this[_0x307c('0x8c')](_0x357981[_0x307c('0x81')])){return this[_0x307c('0x13')]['noop'](_0x307c('0xfa'));}if(!this['isConfigured'](_0x357981[_0x307c('0x82')])){return this[_0x307c('0x13')][_0x307c('0xaf')](_0x307c('0xfb'));}if(!this[_0x307c('0x8c')](_0x357981['dialogflowV2_language'])){return this[_0x307c('0x13')]['noop'](_0x307c('0xfc'));}if(!this['isConfigured'](_0x357981[_0x307c('0x67')])){return this[_0x307c('0x13')][_0x307c('0xaf')](_0x307c('0xcc'));}this['channel'][_0x307c('0xef')]=!![];this[_0x307c('0x39')](_0x357981);this[_0x307c('0x44')](_0x357981[_0x307c('0x67')],'in','','');this[_0x307c('0x13')][_0x307c('0xaf')](util['format'](_0x307c('0xfd'),_0x357981[_0x307c('0x67')]));var _0x1bd4a4=this[_0x307c('0x7f')]['sync'](this,_0x357981);if(_0x1bd4a4){for(var _0x5e6dd1 in _0x1bd4a4){if(_0x1bd4a4[_0x307c('0xa5')](_0x5e6dd1)){if(_0x5e6dd1!==_0x307c('0xfe')){this[_0x307c('0x13')][_0x307c('0xa7')](util[_0x307c('0x5e')]('DIALOGFLOW_%s',_0x5e6dd1['toUpperCase']()),_0x1bd4a4[_0x5e6dd1]);}}}this[_0x307c('0x44')](_0x1bd4a4['speech'],_0x307c('0xf2'),_0x307c('0xf7'),_0x1bd4a4[_0x307c('0xfe')]);return this[_0x307c('0x13')][_0x307c('0xaf')](util['format'](_0x307c('0xff'),_0x1bd4a4['speech']));}return this[_0x307c('0x13')]['error'](_0x357981,'DialogflowV2\x20is\x20unreachable');};AGIVertices[_0x307c('0x15')][_0x307c('0x100')]=function(_0x19d019){logger[_0x307c('0x30')](util[_0x307c('0x5e')](_0x307c('0x101'),_0x19d019[_0x307c('0xb2')]));if(!this[_0x307c('0x8c')](_0x19d019[_0x307c('0x102')])){return this[_0x307c('0x13')]['noop'](_0x307c('0x103'));}if(!this['isConfigured'](_0x19d019['username'])){return this[_0x307c('0x13')]['noop'](_0x307c('0x104'));}if(!this[_0x307c('0x8c')](_0x19d019[_0x307c('0x105')])){return this[_0x307c('0x13')]['noop'](_0x307c('0x106'));}if(!this[_0x307c('0x8c')](_0x19d019['ndassistant_url'])){return this[_0x307c('0x13')][_0x307c('0xaf')]('no\x20text\x20configured');}this[_0x307c('0x13')][_0x307c('0xef')]=!![];this[_0x307c('0x39')](_0x19d019);this[_0x307c('0x44')](_0x19d019['text'],'in','','');this['channel'][_0x307c('0xaf')](util[_0x307c('0x5e')](_0x307c('0x107'),_0x19d019[_0x307c('0x67')]));var _0x4d6149=this[_0x307c('0x84')][_0x307c('0xc4')](this,_0x19d019);if(_0x4d6149){for(var _0x423d8c in _0x4d6149){if(_0x4d6149['hasOwnProperty'](_0x423d8c)){this[_0x307c('0x13')][_0x307c('0xa7')](util[_0x307c('0x5e')](_0x307c('0x108'),_0x423d8c[_0x307c('0xf1')]()),_0x4d6149[_0x423d8c]);}}this[_0x307c('0x44')](_0x4d6149[_0x307c('0xf5')],_0x307c('0xf2'),_0x307c('0x100'),'');if(_0x4d6149['audiofile']){this['channel']['noop'](util[_0x307c('0x5e')](_0x307c('0x109'),_0x4d6149[_0x307c('0x10a')]));var _0x3817da=this['channel']['streamFile'](_0x4d6149['audiofile']);try{fs[_0x307c('0x10b')](_0x4d6149['audiofile']+_0x307c('0x10c'));}catch(_0x1f9401){logger[_0x307c('0x36')](_0x1f9401);}return _0x3817da;}else{return this[_0x307c('0x13')][_0x307c('0xaf')](util[_0x307c('0x5e')](_0x307c('0x10d'),_0x4d6149[_0x307c('0xf5')]));}}return this[_0x307c('0x13')][_0x307c('0x36')](_0x19d019,_0x307c('0x10e'));};AGIVertices['prototype'][_0x307c('0x10f')]=function(_0x2776fc){logger[_0x307c('0x30')](util['format'](_0x307c('0x110'),_0x2776fc[_0x307c('0xb2')]));return this[_0x307c('0x13')][_0x307c('0xaf')](_0x307c('0x10f'));};AGIVertices[_0x307c('0x15')][_0x307c('0x111')]=function(_0x1b6b20){logger['info'](util[_0x307c('0x5e')](_0x307c('0x112'),_0x1b6b20[_0x307c('0xb2')]));var _0x4f3803='';if(_0x1b6b20[_0x307c('0x113')]){if(!this['isConfigured'](_0x1b6b20['trunk_id'])){return this['channel'][_0x307c('0x36')](_0x1b6b20,_0x307c('0x114'));}else{var _0x25e805=parseInt(_0x1b6b20[_0x307c('0x113')],0xa);if(isNaN(_0x25e805)){_0x4f3803=_0x1b6b20['trunk_id'];}else{_0x4f3803=this[_0x307c('0x23')]['sync'](this,_0x1b6b20[_0x307c('0x113')]);if(!_0x4f3803){return this[_0x307c('0x13')][_0x307c('0x36')](_0x1b6b20,_0x307c('0x115'));}}}}else if(_0x1b6b20['trunk_name']){_0x4f3803=_0x1b6b20[_0x307c('0x116')];}else{return this[_0x307c('0x13')]['error'](_0x1b6b20,_0x307c('0x114'));}var _0x1c495d=this[_0x307c('0x13')][_0x307c('0x62')](_0x307c('0xec'),[util['format']('SIP/%s/%s',_0x4f3803,_0x1b6b20[_0x307c('0x48')]),_0x1b6b20[_0x307c('0x6d')],_0x1b6b20[_0x307c('0xeb')],_0x1b6b20[_0x307c('0x77')]]);if(_0x1c495d['result']===-0x1){return _0x1c495d;}return this[_0x307c('0x13')][_0x307c('0xaf')](util[_0x307c('0x5e')](_0x307c('0x117'),_0x307c('0xec')));};AGIVertices['prototype'][_0x307c('0x118')]=function(_0x2eb847){logger['info'](util[_0x307c('0x5e')](_0x307c('0x119'),_0x2eb847[_0x307c('0xb2')]));return this[_0x307c('0x13')]['noop'](_0x307c('0x118'));};AGIVertices[_0x307c('0x15')][_0x307c('0x11')]=function(_0x273308){logger[_0x307c('0x30')](util[_0x307c('0x5e')](_0x307c('0x11a'),_0x273308[_0x307c('0xb2')]));if(_0x273308[_0x307c('0x11b')]===0x0){return this[_0x307c('0xac')](_0x273308);}_0x273308[_0x307c('0x11b')]-=0x1;if(!this[_0x307c('0x8c')](_0x273308[_0x307c('0x11c')])){return this[_0x307c('0x13')]['error'](_0x273308,'no\x20file\x20audio\x20selected');}var _0x1ddff0=this[_0x307c('0x24')]['sync'](this,_0x273308['file_id']);if(!_0x1ddff0){return this[_0x307c('0x13')]['error'](_0x273308,_0x307c('0x11d'));}if(!this[_0x307c('0x8c')](_0x273308['variable_id'])){return this[_0x307c('0x13')]['error'](_0x307c('0xe1'));}var _0x2b36a9=this[_0x307c('0x13')][_0x307c('0x11e')](_0x1ddff0,_0x273308[_0x307c('0x11f')],_0x273308[_0x307c('0x120')]);var _0x2244c3=_0x2b36a9[_0x307c('0xae')]?_0x2b36a9[_0x307c('0xae')][_0x307c('0x4c')]():'';logger[_0x307c('0x30')](_0x307c('0x121'),JSON[_0x307c('0x79')](_0x2b36a9));if(_0x2b36a9[_0x307c('0xae')]===-0x1){this[_0x307c('0x39')][_0x307c('0xc4')](this,_0x273308,_0x2244c3);return _0x2b36a9;}else if(_0x2b36a9[_0x307c('0xab')]===_0x307c('0x6d')){_0x2b36a9[_0x307c('0xae')]=_0x2244c3[_0x307c('0xa3')]>=parseInt(_0x273308[_0x307c('0x122')])?'x':'i';}else{_0x2b36a9[_0x307c('0xae')]=_0x2244c3[_0x307c('0xa3')]>=parseInt(_0x273308[_0x307c('0x122')])&&_0x2244c3[_0x307c('0xa3')]<=parseInt(_0x273308['maxdigit'])?'x':'i';}var _0x12f639=this['getVariable'][_0x307c('0xc4')](this,_0x273308[_0x307c('0xe0')]);if(!_0x12f639){return this[_0x307c('0x13')][_0x307c('0x36')](_0x273308,_0x307c('0x123'));}this[_0x307c('0x13')][_0x307c('0xa7')](_0x12f639,_0x2244c3);if(this[_0x307c('0x8c')](_0x273308[_0x307c('0x124')])){var _0x4820a4=parseInt(_0x273308['hiddendigitsnum'],0xa);var _0x5ff2f0=rs['generate']({'charset':'*','length':_0x4820a4});var _0x549a10=_0x2244c3[_0x307c('0xa3')];if(_0x549a10>0x0){if(_0x549a10>_0x4820a4){this['createSquareDetailsReport'][_0x307c('0xc4')](this,_0x273308,_0x273308[_0x307c('0x125')]===_0x307c('0x126')?_0x5ff2f0+_0x2244c3[_0x307c('0x127')](_0x4820a4):_0x2244c3[_0x307c('0x127')](0x0,_0x549a10-_0x4820a4)+_0x5ff2f0);}else{this['createSquareDetailsReport'][_0x307c('0xc4')](this,_0x273308,rs[_0x307c('0x128')]({'charset':'*','length':_0x549a10}));}}else{this['createSquareDetailsReport'][_0x307c('0xc4')](this,_0x273308,'');}}else{this[_0x307c('0x39')][_0x307c('0xc4')](this,_0x273308,_0x2244c3);}return _0x2b36a9;};AGIVertices[_0x307c('0x15')][_0x307c('0x12')]=function(_0x1e296c){logger[_0x307c('0x30')](util[_0x307c('0x5e')](_0x307c('0x129'),_0x1e296c[_0x307c('0xb2')]));return this[_0x307c('0x11')](_0x1e296c);};AGIVertices[_0x307c('0x15')]['goal']=function(_0x23c2cc){logger[_0x307c('0x30')](util[_0x307c('0x5e')](_0x307c('0x12a'),_0x23c2cc[_0x307c('0xb2')]));this[_0x307c('0x39')][_0x307c('0xc4')](this,_0x23c2cc,_0x23c2cc[_0x307c('0x12b')]);return this[_0x307c('0x13')][_0x307c('0xaf')](util[_0x307c('0x5e')](_0x307c('0x12c'),_0x23c2cc['goalname']));};AGIVertices[_0x307c('0x15')]['awspolly']=function(_0x26d31e){logger[_0x307c('0x30')](util['format'](_0x307c('0x12d'),_0x26d31e[_0x307c('0xb2')]));if(!this[_0x307c('0x8c')](_0x26d31e['aws_access_key_id'])||!this[_0x307c('0x8c')](_0x26d31e[_0x307c('0x93')])){return this[_0x307c('0x13')][_0x307c('0xaf')](_0x307c('0x12e'));}if(!this['isConfigured'](_0x26d31e[_0x307c('0x67')])){return this[_0x307c('0x13')][_0x307c('0xaf')](_0x307c('0xcc'));}this[_0x307c('0x13')][_0x307c('0xaf')](util[_0x307c('0x5e')](_0x307c('0x12f'),_0x26d31e[_0x307c('0x67')]));var _0x158b52=this[_0x307c('0x8e')][_0x307c('0xc4')](this,_0x26d31e);if(_0x158b52){this[_0x307c('0x13')]['noop'](util[_0x307c('0x5e')](_0x307c('0x130'),_0x158b52));var _0x2bc279=this[_0x307c('0x13')]['streamFile'](_0x158b52);try{fs[_0x307c('0x10b')](_0x158b52+_0x307c('0x10c'));}catch(_0xc2bc62){logger[_0x307c('0x36')](_0xc2bc62);}return _0x2bc279;}return this[_0x307c('0x13')][_0x307c('0x36')](_0x26d31e,_0x307c('0x131'));};AGIVertices[_0x307c('0x15')][_0x307c('0x132')]=function(_0x30016b){logger[_0x307c('0x30')](util[_0x307c('0x5e')](_0x307c('0x133'),_0x30016b[_0x307c('0xb2')]));if(!this['isConfigured'](_0x30016b['aws_access_key_id'])||!this[_0x307c('0x8c')](_0x30016b[_0x307c('0x93')])){return this['channel'][_0x307c('0xaf')]('no\x20valid\x20credentials\x20configured');}if(!this['isConfigured'](_0x30016b[_0x307c('0x95')])){return this[_0x307c('0x13')][_0x307c('0xaf')](_0x307c('0x134'));}if(!this[_0x307c('0x8c')](_0x30016b['text'])){return this[_0x307c('0x13')][_0x307c('0xaf')]('no\x20text\x20configured');}this[_0x307c('0x13')][_0x307c('0xef')]=!![];this[_0x307c('0x39')](_0x30016b);this[_0x307c('0x44')](_0x30016b[_0x307c('0x67')],'in','','');this['channel'][_0x307c('0xaf')](util['format']('Trying\x20Amazon\x20Lex:\x20%s',_0x30016b[_0x307c('0x67')]));var _0x55b84b=this['awsLex'][_0x307c('0xc4')](this,_0x30016b);if(_0x55b84b){for(var _0x3a3949 in _0x55b84b){if(_0x55b84b[_0x307c('0xa5')](_0x3a3949)&&_[_0x307c('0x135')](_0x55b84b[_0x3a3949])){this[_0x307c('0x13')]['setVariable'](util[_0x307c('0x5e')](_0x307c('0x136'),_0x3a3949[_0x307c('0xf1')]()),_0x55b84b[_0x3a3949]);}}if(_[_0x307c('0x4f')](_0x55b84b['message'])){return this['channel'][_0x307c('0xaf')](_0x307c('0x137'));}else{this[_0x307c('0x44')](_0x55b84b['message'],_0x307c('0xf2'),_0x307c('0x138'),'');return this[_0x307c('0x13')][_0x307c('0xaf')](util[_0x307c('0x5e')](_0x307c('0x139'),_0x55b84b['message']));}}return this[_0x307c('0x13')][_0x307c('0x36')](_0x30016b,_0x307c('0x13a'));};AGIVertices[_0x307c('0x15')][_0x307c('0x13b')]=function(_0x2e9539){logger[_0x307c('0x30')](util[_0x307c('0x5e')](_0x307c('0x13c'),_0x2e9539['label'],_0x2e9539[_0x307c('0x6d')]));if(!this[_0x307c('0x8c')](_0x2e9539[_0x307c('0x86')])){return this['channel'][_0x307c('0xaf')](_0x307c('0xee'));}var _0x3a8202=_0x307c('0x13d');var _0x2de85d=util['format'](_0x307c('0x13e'),FILES_PATH,rs[_0x307c('0x128')](0x4));var _0x51b6dd=util[_0x307c('0x5e')](_0x307c('0xa6'),_0x2de85d,_0x3a8202);var _0x38ad4e=!![];if(_0x2e9539[_0x307c('0x13f')]===_0x307c('0x140')){_0x38ad4e=![];}var _0x5c28c4=this[_0x307c('0x13')][_0x307c('0x141')](_0x2de85d,_0x3a8202,_0x2e9539[_0x307c('0x142')],_0x2e9539[_0x307c('0x6d')],undefined,_0x38ad4e);if(_0x5c28c4['result']!==-0x1){this['channel'][_0x307c('0xaf')](util[_0x307c('0x5e')](_0x307c('0x143'),_0x51b6dd));var _0x5ad2ff=this['googleASR'][_0x307c('0xc4')](this,_0x2e9539,_0x51b6dd);if(_0x5ad2ff){for(var _0x542167 in _0x5ad2ff){if(_0x5ad2ff[_0x307c('0xa5')](_0x542167)){this[_0x307c('0x13')][_0x307c('0xa7')](util[_0x307c('0x5e')](_0x307c('0x144'),_0x542167[_0x307c('0xf1')]()),_0x5ad2ff[_0x542167]);}}return this[_0x307c('0x13')][_0x307c('0xaf')](util['format'](_0x307c('0x145'),JSON[_0x307c('0x79')](_0x5ad2ff)));}}return _0x5c28c4;};AGIVertices[_0x307c('0x15')][_0x307c('0x146')]=function(_0x28de74){logger[_0x307c('0x30')](util[_0x307c('0x5e')](_0x307c('0x147'),_0x28de74[_0x307c('0xb2')]));if(!this[_0x307c('0x8c')](_0x28de74['appid'])){return this[_0x307c('0x13')][_0x307c('0xaf')](_0x307c('0x148'));}if(!this[_0x307c('0x8c')](_0x28de74[_0x307c('0x9a')])){return this['channel'][_0x307c('0xaf')]('no\x20appsecret\x20configured');}var _0x45b309=_0x307c('0x13d');var _0x2514bc=util[_0x307c('0x5e')](_0x307c('0x13e'),FILES_PATH,rs[_0x307c('0x128')](0x4));var _0x16d2a7=util[_0x307c('0x5e')](_0x307c('0xa6'),_0x2514bc,_0x45b309);var _0x1fefb4=!![];if(_0x28de74['beep']===_0x307c('0x140')){_0x1fefb4=![];}var _0x12fdcf=this[_0x307c('0x13')]['recordFile'](_0x2514bc,_0x45b309,_0x28de74['intKey'],_0x28de74[_0x307c('0x6d')],undefined,_0x1fefb4);if(_0x12fdcf[_0x307c('0xae')]!==-0x1){this['channel']['noop'](util[_0x307c('0x5e')](_0x307c('0x149'),_0x16d2a7));var _0x57ceb3=this['tildeASR'][_0x307c('0xc4')](this,_0x28de74,_0x16d2a7);if(_0x57ceb3){for(var _0x207372 in _0x57ceb3){if(_0x57ceb3[_0x307c('0xa5')](_0x207372)){this['channel'][_0x307c('0xa7')](util['format'](_0x307c('0x14a'),_0x207372[_0x307c('0xf1')]()),_0x57ceb3[_0x207372]);}}return this[_0x307c('0x13')][_0x307c('0xaf')](util[_0x307c('0x5e')](_0x307c('0x14b'),JSON['stringify'](_0x57ceb3)));}}return _0x12fdcf;};AGIVertices[_0x307c('0x15')][_0x307c('0x14c')]=function(_0x191580){logger['info'](util[_0x307c('0x5e')](_0x307c('0x14d'),_0x191580[_0x307c('0xb2')]));return this['channel'][_0x307c('0x14e')](_0x191580[_0x307c('0x14f')],_0x191580[_0x307c('0x40')],_0x191580[_0x307c('0x41')]);};AGIVertices[_0x307c('0x15')][_0x307c('0x150')]=function(_0x22289b){logger[_0x307c('0x30')](util[_0x307c('0x5e')](_0x307c('0x151'),_0x22289b[_0x307c('0xb2')]));if(!this[_0x307c('0x8c')](_0x22289b[_0x307c('0x152')])){return this['channel'][_0x307c('0x36')](_0x22289b,_0x307c('0x153'));}try{var _0x502d1b=eval(_0x22289b['condition'])?_0x307c('0x154'):'false';this['channel'][_0x307c('0xaf')](util[_0x307c('0x5e')]('EVAL\x20CONDITION\x20%s\x20%s',_0x22289b[_0x307c('0x152')],_0x502d1b));return{'code':0xc8,'result':_0x502d1b};}catch(_0x143468){return{'code':0xc8,'result':_0x307c('0x155')};}};AGIVertices[_0x307c('0x15')]['gotoiftime']=function(_0x206d07){logger[_0x307c('0x30')](util[_0x307c('0x5e')](_0x307c('0x156'),_0x206d07[_0x307c('0xb2')]));if(!this[_0x307c('0x8c')](_0x206d07[_0x307c('0x157')])){return this[_0x307c('0x13')][_0x307c('0x36')](_0x206d07,_0x307c('0x158'));}var _0x44d7a5=this[_0x307c('0x2a')][_0x307c('0xc4')](this,_0x206d07[_0x307c('0x157')]);if(!_0x44d7a5){return this[_0x307c('0x13')][_0x307c('0x36')](_0x206d07,_0x307c('0x159'));}for(var _0xcd9c2d=0x0;_0xcd9c2d<_0x44d7a5['length'];_0xcd9c2d+=0x1){var _0x126fa3=this[_0x307c('0x13')][_0x307c('0x16')](util['format']('IFTIME(%s?true:false)',_0x44d7a5[_0xcd9c2d]));if(_0x126fa3[_0x307c('0xae')]===-0x1){return _0x126fa3;}logger[_0x307c('0x30')](util['format']('IFTIME\x20%s\x20%s',_0x44d7a5[_0xcd9c2d],_0x126fa3['extra']));if(_0x126fa3[_0x307c('0xab')]===_0x307c('0x154')){logger[_0x307c('0x30')](util[_0x307c('0x5e')](_0x307c('0x15a'),_0x44d7a5[_0xcd9c2d],_0x307c('0x154')));this['channel'][_0x307c('0xaf')](util[_0x307c('0x5e')](_0x307c('0x15a'),_0x44d7a5[_0xcd9c2d],_0x307c('0x154')));return{'code':0xc8,'result':'true'};}else{logger[_0x307c('0x30')](util['format']('IFTIME\x20%s\x20%s',_0x44d7a5[_0xcd9c2d],'false'));this['channel']['noop'](util[_0x307c('0x5e')](_0x307c('0x15a'),_0x44d7a5[_0xcd9c2d],'false'));}}return{'code':0xc8,'result':_0x307c('0x155')};};AGIVertices[_0x307c('0x15')][_0x307c('0x15b')]=function(_0x19bd40){logger[_0x307c('0x30')](util[_0x307c('0x5e')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x19bd40[_0x307c('0xb2')]));return this[_0x307c('0x13')][_0x307c('0x15b')]();};AGIVertices['prototype'][_0x307c('0x15c')]=function(_0x26e1c0){logger['info'](util['format'](_0x307c('0x15d'),_0x26e1c0[_0x307c('0xb2')]));if(!this[_0x307c('0x8c')](_0x26e1c0[_0x307c('0x86')])){return this[_0x307c('0x13')][_0x307c('0xaf')](_0x307c('0xee'));}var _0x180865=_0x307c('0x13d');var _0x40ccaf=util[_0x307c('0x5e')](_0x307c('0x13e'),FILES_PATH,rs['generate'](0x4));var _0x2e1b15=util['format']('%s.%s',_0x40ccaf,_0x180865);var _0x35dd5d=!![];if(_0x26e1c0[_0x307c('0x13f')]===_0x307c('0x140')){_0x35dd5d=![];}var _0x1171b9=this[_0x307c('0x13')][_0x307c('0x141')](_0x40ccaf,_0x180865,_0x26e1c0['intKey'],_0x26e1c0[_0x307c('0x6d')],undefined,_0x35dd5d);if(_0x1171b9[_0x307c('0xae')]!==-0x1){this['channel'][_0x307c('0xaf')](util[_0x307c('0x5e')](_0x307c('0x15e'),_0x2e1b15));var _0x1f6030=this[_0x307c('0x8a')]['sync'](this,_0x26e1c0,_0x2e1b15);if(_0x1f6030){for(var _0x1e8192 in _0x1f6030){if(_0x1f6030[_0x307c('0xa5')](_0x1e8192)){this[_0x307c('0x13')]['setVariable'](util[_0x307c('0x5e')]('ISPEECH_ASR_%s',_0x1e8192['toUpperCase']()),_0x1f6030[_0x1e8192]);}}return this['channel'][_0x307c('0xaf')](util[_0x307c('0x5e')](_0x307c('0x15f'),JSON[_0x307c('0x79')](_0x1f6030)));}}return _0x1171b9;};AGIVertices[_0x307c('0x15')][_0x307c('0x160')]=function(_0x103102){logger[_0x307c('0x30')](util[_0x307c('0x5e')](_0x307c('0x161'),_0x103102['label']));if(!this['isConfigured'](_0x103102['key'])){return this[_0x307c('0x13')][_0x307c('0xaf')]('no\x20key\x20configured');}if(!this['isConfigured'](_0x103102['text'])){return this[_0x307c('0x13')][_0x307c('0xaf')](_0x307c('0xcc'));}this[_0x307c('0x13')]['noop'](util[_0x307c('0x5e')]('Trying\x20ispeech\x20TTS\x20%s',_0x103102[_0x307c('0x67')]));var _0xb4d858=this[_0x307c('0x85')][_0x307c('0xc4')](this,_0x103102);if(_0xb4d858){this[_0x307c('0x13')][_0x307c('0xaf')](util['format'](_0x307c('0x15e'),_0xb4d858));var _0x42d8bf=this[_0x307c('0x13')][_0x307c('0x162')](_0xb4d858,_0x103102[_0x307c('0x142')]);try{fs[_0x307c('0x10b')](_0xb4d858+_0x307c('0x10c'));}catch(_0x505061){logger[_0x307c('0x36')](_0x505061);}return _0x42d8bf;}return this[_0x307c('0x13')][_0x307c('0x36')](_0x103102,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0x307c('0x15')][_0x307c('0x163')]=function(_0x409c06){logger[_0x307c('0x30')](util[_0x307c('0x5e')](_0x307c('0x164'),_0x409c06['label']));if(!this['isConfigured'](_0x409c06[_0x307c('0x165')])){return this['channel'][_0x307c('0x36')](_0x409c06,_0x307c('0x166'));}logger[_0x307c('0x30')](util['format'](_0x307c('0x167'),this[_0x307c('0x13')][_0x307c('0x3d')],_0x409c06[_0x307c('0x165')]));var _0x46d653=this[_0x307c('0x60')]['sync'](this,_0x409c06[_0x307c('0x165')]);if(_0x46d653){logger[_0x307c('0x30')](util[_0x307c('0x5e')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x307c('0x13')][_0x307c('0x3d')],_0x409c06[_0x307c('0x165')]));this['channel'][_0x307c('0xaf')](util[_0x307c('0x5e')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x307c('0x13')][_0x307c('0x3d')],_0x409c06['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0x307c('0x30')](util[_0x307c('0x5e')](_0x307c('0x168'),this[_0x307c('0x13')]['callerid'],_0x409c06[_0x307c('0x165')]));this[_0x307c('0x13')][_0x307c('0xaf')](util[_0x307c('0x5e')](_0x307c('0x168'),this[_0x307c('0x13')][_0x307c('0x3d')],_0x409c06[_0x307c('0x165')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x307c('0x15')][_0x307c('0x169')]=function(_0x5b2d95){logger[_0x307c('0x30')](util[_0x307c('0x5e')](_0x307c('0x16a'),_0x5b2d95[_0x307c('0xb2')]));if(!this[_0x307c('0x8c')](_0x5b2d95['findBy'])){return this[_0x307c('0x13')]['error'](_0x5b2d95,_0x307c('0x166'));}logger['info'](util[_0x307c('0x5e')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x307c('0x13')][_0x307c('0x3d')],_0x5b2d95[_0x307c('0x165')]));var _0x3011e4=this[_0x307c('0x5c')][_0x307c('0xc4')](this,_0x5b2d95[_0x307c('0x165')]);if(_0x3011e4){logger[_0x307c('0x30')](util[_0x307c('0x5e')](_0x307c('0x16b'),this[_0x307c('0x13')][_0x307c('0x3d')],_0x5b2d95['findBy']));this['channel']['noop'](util[_0x307c('0x5e')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x307c('0x13')][_0x307c('0x3d')],_0x5b2d95['findBy']));return{'code':0xc8,'result':_0x307c('0x16c')};}else{logger['info'](util['format'](_0x307c('0x168'),this['channel'][_0x307c('0x3d')],_0x5b2d95[_0x307c('0x165')]));this[_0x307c('0x13')][_0x307c('0xaf')](util[_0x307c('0x5e')](_0x307c('0x168'),this[_0x307c('0x13')]['callerid'],_0x5b2d95[_0x307c('0x165')]));return{'code':0xc8,'result':_0x307c('0x16d')};}};AGIVertices[_0x307c('0x15')][_0x307c('0x16e')]=function(_0x49c613){logger[_0x307c('0x30')](util[_0x307c('0x5e')](_0x307c('0x16f'),_0x49c613[_0x307c('0xb2')]));if(!this['isConfigured'](_0x49c613[_0x307c('0x170')])){return this[_0x307c('0x13')]['error'](_0x49c613,'no\x20operation\x20configured');}this[_0x307c('0x13')][_0x307c('0xaf')](util['format'](_0x307c('0x171'),_0x49c613[_0x307c('0x170')]));var _0x1ce297=eval(_0x49c613[_0x307c('0x170')]);if(!this[_0x307c('0x8c')](_0x49c613[_0x307c('0xe0')])){return this[_0x307c('0x13')][_0x307c('0xaf')](_0x307c('0xe1'));}var _0xdd9964=this[_0x307c('0x16')][_0x307c('0xc4')](this,_0x49c613[_0x307c('0xe0')]);if(!_0xdd9964){return this['channel']['error'](_0x49c613,_0x307c('0x123'));}if(_[_0x307c('0xa2')](_0x1ce297)){var _0x28b5b2=this;_0x1ce297[_0x307c('0xe2')](function(_0x3e8d09,_0x34d899){_0x28b5b2[_0x307c('0x13')][_0x307c('0xa7')](util['format'](_0x307c('0x172'),_0xdd9964,_0x34d899),_0x3e8d09);});return this[_0x307c('0x13')][_0x307c('0xaf')](util[_0x307c('0x5e')](_0x307c('0x173'),_0xdd9964));}else{return this['channel']['setVariable'](_0xdd9964,_0x1ce297);}};AGIVertices['prototype'][_0x307c('0x10')]=function(_0x5a1409){logger[_0x307c('0x30')](util['format'](_0x307c('0x174'),_0x5a1409['label']));if(_0x5a1409[_0x307c('0x11b')]===0x0){return this[_0x307c('0xac')](_0x5a1409);}_0x5a1409[_0x307c('0x11b')]-=0x1;if(!this[_0x307c('0x8c')](_0x5a1409[_0x307c('0x11c')])){return this[_0x307c('0x13')][_0x307c('0x36')](_0x5a1409,_0x307c('0x175'));}var _0x28afd3=this[_0x307c('0x24')][_0x307c('0xc4')](this,_0x5a1409[_0x307c('0x11c')]);if(!_0x28afd3){return this[_0x307c('0x13')][_0x307c('0x36')](_0x5a1409,'no\x20file\x20audio\x20found');}var _0x27f51e=this[_0x307c('0x13')][_0x307c('0x11e')](_0x28afd3,_0x5a1409[_0x307c('0x11f')],_0x5a1409[_0x307c('0x176')]);var _0x315d7f=_0x27f51e[_0x307c('0xae')];if(_0x27f51e['result']===-0x1){this[_0x307c('0x39')][_0x307c('0xc4')](this,_0x5a1409,'-1');return _0x27f51e;}else if(_0x27f51e[_0x307c('0xab')]===_0x307c('0x6d')){_0x27f51e[_0x307c('0xae')]=_0x27f51e[_0x307c('0xae')][_0x307c('0xa3')]>0x0?_0x27f51e['result']:'t';}else if(_[_0x307c('0x46')](_0x27f51e[_0x307c('0xae')])){_0x27f51e[_0x307c('0xae')]='#';_0x315d7f='#';}if(!this[_0x307c('0x8c')](_0x5a1409['variable_id'])){this[_0x307c('0x13')]['noop'](_0x307c('0xe1'));}else{var _0x100124=this[_0x307c('0x16')][_0x307c('0xc4')](this,_0x5a1409[_0x307c('0xe0')]);if(!_0x100124){return this[_0x307c('0x13')][_0x307c('0x36')](_0x5a1409,_0x307c('0x123'));}this[_0x307c('0x13')][_0x307c('0xa7')](_0x100124,_0x315d7f);}this[_0x307c('0x39')]['sync'](this,_0x5a1409,_0x315d7f);return _0x27f51e;};AGIVertices[_0x307c('0x15')][_0x307c('0xaf')]=function(_0x102ebd){logger['info'](util[_0x307c('0x5e')]('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x102ebd['label']));return this['channel'][_0x307c('0xaf')](_0x102ebd[_0x307c('0x177')]||_0x102ebd['label']);};AGIVertices[_0x307c('0x15')][_0x307c('0x178')]=function(_0x490722){logger[_0x307c('0x30')](util[_0x307c('0x5e')](_0x307c('0x179'),_0x490722[_0x307c('0xb2')]));if(!this[_0x307c('0x8c')](_0x490722[_0x307c('0x165')])){return this[_0x307c('0x13')][_0x307c('0x36')](_0x490722,_0x307c('0x166'));}logger[_0x307c('0x30')](util[_0x307c('0x5e')](_0x307c('0x167'),this['channel'][_0x307c('0x3d')],_0x490722[_0x307c('0x165')]));var _0x1bae3a=this[_0x307c('0x17a')][_0x307c('0xc4')](this,_0x490722[_0x307c('0x17b')]);var _0x58c730=this[_0x307c('0x59')][_0x307c('0xc4')](this,_0x490722[_0x307c('0x165')],_0x1bae3a);if(_0x58c730){logger[_0x307c('0x30')](util[_0x307c('0x5e')](_0x307c('0x16b'),this[_0x307c('0x13')][_0x307c('0x3d')],_0x490722[_0x307c('0x165')]));this[_0x307c('0x13')][_0x307c('0xaf')](util[_0x307c('0x5e')](_0x307c('0x16b'),this['channel']['callerid'],_0x490722[_0x307c('0x165')]));return{'code':0xc8,'result':_0x307c('0x16c')};}else{logger['info'](util[_0x307c('0x5e')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x307c('0x3d')],_0x490722[_0x307c('0x165')]));this[_0x307c('0x13')][_0x307c('0xaf')](util['format'](_0x307c('0x16b'),this[_0x307c('0x13')][_0x307c('0x3d')],_0x490722[_0x307c('0x165')]));return{'code':0xc8,'result':_0x307c('0x16d')};}};AGIVertices[_0x307c('0x15')][_0x307c('0x17c')]=function(_0x8f9bff){logger[_0x307c('0x30')](util['format']('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x8f9bff[_0x307c('0xb2')]));if(!this['isConfigured'](_0x8f9bff[_0x307c('0x11c')])){return this['channel'][_0x307c('0x36')](_0x8f9bff,'no\x20file\x20audio\x20selected');}var _0x331252=this[_0x307c('0x24')]['sync'](this,_0x8f9bff[_0x307c('0x11c')]);if(!_0x331252){return this[_0x307c('0x13')][_0x307c('0x36')](_0x8f9bff,'no\x20file\x20audio\x20found');}var _0x5054aa=this[_0x307c('0x13')][_0x307c('0x62')]('PLAYBACK',[_0x331252,_0x8f9bff[_0x307c('0xeb')]]);if(_0x5054aa[_0x307c('0xae')]===-0x1){return _0x5054aa;}return this[_0x307c('0x13')][_0x307c('0xaf')](util[_0x307c('0x5e')](_0x307c('0xc9'),'PLAYBACK',_0x331252));};AGIVertices[_0x307c('0x15')]['queue']=function(_0x781ddb){logger[_0x307c('0x30')](util[_0x307c('0x5e')](_0x307c('0x17d'),_0x781ddb[_0x307c('0xb2')]));if(!this[_0x307c('0x8c')](_0x781ddb['queue_id'])){return this[_0x307c('0x13')][_0x307c('0x36')](_0x781ddb,_0x307c('0x17e'));}var _0x1cef25='';var _0x429601=parseInt(_0x781ddb['queue_id'],0xa);if(isNaN(_0x429601)){_0x1cef25=_0x781ddb[_0x307c('0x17f')];}else{_0x1cef25=this['getVoiceQueue'][_0x307c('0xc4')](this,_0x781ddb[_0x307c('0x17f')]);if(!_0x1cef25){return this[_0x307c('0x13')][_0x307c('0x36')](_0x781ddb,_0x307c('0x180'));}}var _0x154d07='';if(this['isConfigured'](_0x781ddb[_0x307c('0x11c')])){var _0x537853=this[_0x307c('0x24')][_0x307c('0xc4')](this,_0x781ddb[_0x307c('0x11c')]);if(_0x537853){_0x154d07=_0x537853;}}this[_0x307c('0x39')][_0x307c('0xc4')](this,_0x781ddb,_0x1cef25);if(_0x781ddb[_0x307c('0xeb')][_0x307c('0x181')]('x')<0x0){_0x781ddb[_0x307c('0xeb')]+='x';}if(_0x781ddb[_0x307c('0xeb')][_0x307c('0x181')]('X')<0x0){_0x781ddb[_0x307c('0xeb')]+='X';}this[_0x307c('0x13')][_0x307c('0xa7')](_0x307c('0x182'),_0x1cef25?_0x1cef25[_0x307c('0x183')]():'');var _0x31e71a=this['channel'][_0x307c('0x62')]('QUEUE',[_0x1cef25,_0x781ddb[_0x307c('0xeb')],_0x781ddb[_0x307c('0x77')],_0x154d07,_0x781ddb[_0x307c('0x6d')],_0x781ddb[_0x307c('0x9')],_0x781ddb[_0x307c('0x184')],_0x781ddb['gosub'],'',_0x781ddb[_0x307c('0x185')]]);if(_0x31e71a['result']===-0x1){return _0x31e71a;}return this[_0x307c('0x13')][_0x307c('0xaf')](util['format'](_0x307c('0xc9'),_0x307c('0x186'),_0x1cef25));};AGIVertices['prototype'][_0x307c('0x187')]=function(_0x37d81e){logger['info'](util[_0x307c('0x5e')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x37d81e[_0x307c('0xb2')]));var _0x467f0c=_0x37d81e[_0x307c('0x188')]||_0x307c('0x13d');var _0x308bc8=util[_0x307c('0x5e')](_0x307c('0x189'),this['channel'][_0x307c('0x3a')],rs['generate'](0x5));var _0x9904c4=util[_0x307c('0x5e')](_0x307c('0x18a'),FILES_PATH,_0x308bc8,_0x467f0c);var _0x27ccfd=util[_0x307c('0x5e')](_0x307c('0x13e'),FILES_PATH,_0x308bc8);this[_0x307c('0x3e')][_0x307c('0xc4')](this,_0x37d81e,_0x308bc8,_0x9904c4);this[_0x307c('0x13')]['setVariable'](_0x307c('0x18b'),_0x308bc8);logger[_0x307c('0x30')](_0x307c('0x18c'),_0x27ccfd,_0x467f0c,_0x37d81e['escape_digits'],_0x37d81e['timeout']);return this['channel'][_0x307c('0x141')](_0x27ccfd,_0x467f0c,_0x37d81e['escape_digits'],_0x37d81e[_0x307c('0x6d')],undefined,!![]);};AGIVertices[_0x307c('0x15')][_0x307c('0x18d')]=function(_0x176260){logger['info'](util['format']('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x176260[_0x307c('0xb2')]));if(!this[_0x307c('0x8c')](_0x176260[_0x307c('0x77')])){return this[_0x307c('0x13')][_0x307c('0xaf')](_0x307c('0x18e'));}var _0x53aed4=this[_0x307c('0x18f')][_0x307c('0xc4')](this,_0x176260);logger[_0x307c('0x30')](util[_0x307c('0x5e')](_0x307c('0x190'),util[_0x307c('0x191')](_0x53aed4,{'showHidden':![],'depth':null})));if(!this[_0x307c('0x8c')](_0x176260['variable_id'])){return this[_0x307c('0x13')][_0x307c('0xaf')](_0x307c('0x192'));}var _0x2c9bd3=this['getVariable']['sync'](this,_0x176260['variable_id']);if(!_0x2c9bd3){return this[_0x307c('0x13')][_0x307c('0x36')](_0x176260,_0x307c('0x123'));}this[_0x307c('0x13')][_0x307c('0xa7')](util[_0x307c('0x5e')](_0x307c('0x193'),_0x2c9bd3),_0x53aed4[_0x307c('0x7b')]?_0x53aed4[_0x307c('0x7b')]:'200');this['channel'][_0x307c('0xa7')](util[_0x307c('0x5e')]('%s_STATUS_MESSAGE',_0x2c9bd3),_0x53aed4[_0x307c('0x194')]?_0x53aed4[_0x307c('0x194')]:'OK');if(_0x53aed4[_0x307c('0x70')]){try{this['saveRestApiResult'](_0x53aed4[_0x307c('0x70')],_0x2c9bd3);}catch(_0xcf0e7f){logger[_0x307c('0x36')](util['format'](_0x307c('0x195'),_0x2c9bd3));}}return this['channel'][_0x307c('0xaf')](util[_0x307c('0x5e')](_0x307c('0x196'),_0x2c9bd3));};AGIVertices[_0x307c('0x15')]['saydigits']=function(_0x49ab86){logger['info'](util[_0x307c('0x5e')](_0x307c('0x197'),_0x49ab86[_0x307c('0xb2')]));return this[_0x307c('0x13')][_0x307c('0x198')](_0x49ab86[_0x307c('0x199')][_0x307c('0x64')](/\s+/g,''),_0x49ab86['escape_digits']);};AGIVertices[_0x307c('0x15')][_0x307c('0x19a')]=function(_0x53cd6a){logger[_0x307c('0x30')](util['format'](_0x307c('0x19b'),_0x53cd6a[_0x307c('0xb2')]));return this[_0x307c('0x13')][_0x307c('0x19c')](_0x53cd6a[_0x307c('0x6e')][_0x307c('0x64')](/\s+/g,''),_0x53cd6a[_0x307c('0x19d')]);};AGIVertices['prototype']['sayphonetic']=function(_0x33d2a4){logger['info'](util[_0x307c('0x5e')](_0x307c('0x19e'),_0x33d2a4[_0x307c('0xb2')]));return this['channel'][_0x307c('0x19f')](_0x33d2a4[_0x307c('0x67')],_0x33d2a4[_0x307c('0x19d')]);};AGIVertices['prototype']['sendMail']=function(_0x1eb961){logger[_0x307c('0x30')](util[_0x307c('0x5e')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x1eb961[_0x307c('0xb2')]));if(!this['isConfigured'](_0x1eb961[_0x307c('0x1a0')])){return this[_0x307c('0x13')][_0x307c('0xaf')](_0x307c('0x1a1'));}var _0x321967=this['getMailAccount'][_0x307c('0xc4')](this,_0x1eb961['account_id']);if(!_0x321967||!_0x321967[_0x307c('0x1a2')]){return this[_0x307c('0x13')]['error'](_0x1eb961,_0x307c('0x1a3'));}var _0x2dee80={'from':util[_0x307c('0x5e')](_0x307c('0x1a4'),_0x321967[_0x307c('0x18')],_0x321967[_0x307c('0x1a5')]||_0x321967['Smtp']['user']),'to':_0x1eb961['to']||'','cc':_0x1eb961['cc']||'','bcc':_0x1eb961[_0x307c('0x1a6')]||'','subject':_0x1eb961[_0x307c('0x1a7')],'html':_0x1eb961['text'],'text':_0x1eb961['text']};var _0x2c7cdf={'tls':{'rejectUnauthorized':![]}};if(_0x321967[_0x307c('0x1a2')][_0x307c('0x1a8')]){_0x2c7cdf[_0x307c('0x1a8')]=_0x321967[_0x307c('0x1a2')][_0x307c('0x1a8')];}else{_0x2c7cdf[_0x307c('0x1a9')]=_0x321967[_0x307c('0x1a2')][_0x307c('0x1a9')];_0x2c7cdf['port']=_0x321967['Smtp']['port'];_0x2c7cdf[_0x307c('0x1aa')]=_0x321967[_0x307c('0x1a2')][_0x307c('0x1aa')];}if(_0x321967[_0x307c('0x1a2')][_0x307c('0x1ab')]){_0x2c7cdf[_0x307c('0x1ac')]={'user':_0x321967['Smtp'][_0x307c('0x1ad')],'pass':_0x321967[_0x307c('0x1a2')][_0x307c('0x1ae')]};}if(this[_0x307c('0x8c')](_0x1eb961[_0x307c('0x1af')])){}logger['debug'](_0x307c('0x1b0'),JSON[_0x307c('0x79')](_0x2dee80));this['createSquareDetailsReport'][_0x307c('0xc4')](this,_0x1eb961,_0x1eb961[_0x307c('0x1a0')]);this['channel']['noop'](util['format'](_0x307c('0x1b1'),_0x321967[_0x307c('0x18')]));this[_0x307c('0x29')][_0x307c('0xc4')](this,_0x2c7cdf,_0x2dee80);return this[_0x307c('0x13')][_0x307c('0xaf')](_0x307c('0x1b2'));};AGIVertices['prototype'][_0x307c('0x1b3')]=function(_0x409340){logger[_0x307c('0x30')](util[_0x307c('0x5e')](_0x307c('0x1b4'),_0x409340[_0x307c('0xb2')]));return this[_0x307c('0x13')][_0x307c('0xaf')](_0x307c('0x1b5'));};AGIVertices['prototype'][_0x307c('0x1b6')]=function(_0x4085ce){logger[_0x307c('0x30')](util[_0x307c('0x5e')](_0x307c('0x1b7'),_0x4085ce[_0x307c('0xb2')]));if(!this[_0x307c('0x8c')](_0x4085ce[_0x307c('0x1b8')])){return this[_0x307c('0x13')][_0x307c('0xaf')]('no\x20sms\x20account\x20configured');}var _0x27850f=this['getSmsAccount'][_0x307c('0xc4')](this,_0x4085ce[_0x307c('0x1b8')]);if(!_0x27850f){return this[_0x307c('0x13')][_0x307c('0x36')](_0x4085ce,_0x307c('0x1b9'));}var _0x9b4d5c={'body':_0x4085ce[_0x307c('0x1ba')],'phone':_0x4085ce['to']||'','SmsAccountId':_0x27850f['id']};logger[_0x307c('0xe5')](_0x307c('0x1bb'),JSON['stringify'](_0x9b4d5c));this[_0x307c('0x39')][_0x307c('0xc4')](this,_0x4085ce,_0x4085ce[_0x307c('0x1b8')]);this[_0x307c('0x13')][_0x307c('0xaf')](util['format'](_0x307c('0x1bc'),_0x27850f[_0x307c('0x18')]));this[_0x307c('0x38')]['sync'](this,_0x9b4d5c);return this[_0x307c('0x13')]['noop']('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices['prototype'][_0x307c('0x1bd')]=function(_0x3bb602){logger[_0x307c('0x30')](util['format']('Enter\x20in\x20SET\x20(%s)\x20block',_0x3bb602[_0x307c('0xb2')]));if(!this[_0x307c('0x8c')](_0x3bb602[_0x307c('0xe0')])){return this['channel'][_0x307c('0x36')](_0x3bb602,_0x307c('0x1be'));}var _0x1576c0=this['getVariable'][_0x307c('0xc4')](this,_0x3bb602[_0x307c('0xe0')]);if(!_0x1576c0){return this[_0x307c('0x13')]['error'](_0x3bb602,_0x307c('0x123'));}return this[_0x307c('0x13')][_0x307c('0xa7')](_0x1576c0,_0x3bb602[_0x307c('0x1bf')]);};AGIVertices[_0x307c('0x15')][_0x307c('0x1c0')]=function(_0x12c40f){logger[_0x307c('0x30')](util[_0x307c('0x5e')]('Enter\x20in\x20START\x20(%s)\x20block',_0x12c40f[_0x307c('0xb2')]));this[_0x307c('0x13')][_0x307c('0xaf')]('START\x20CALLY\x20SQUARE');if(_0x12c40f['answer']===_0x307c('0x1c1')){this[_0x307c('0x13')][_0x307c('0xaf')](_0x307c('0x1c2'));return this[_0x307c('0x13')][_0x307c('0xbb')]();}return this['channel']['noop']('Skipped\x20Answer');};AGIVertices['prototype'][_0x307c('0x1c3')]=function(_0x559d5b){logger[_0x307c('0x30')](util[_0x307c('0x5e')](_0x307c('0x1c4'),_0x559d5b['label']));if(!this['isConfigured'](_0x559d5b['project_id'])){return this['channel'][_0x307c('0x36')](_0x559d5b,_0x307c('0x1c5'));}var _0x48e7f4=this[_0x307c('0x1e')][_0x307c('0xc4')](this,_0x559d5b[_0x307c('0x1c6')]);if(!this['isConfigured'](_0x48e7f4)){return this['channel'][_0x307c('0x36')](_0x559d5b,util['format'](_0x307c('0x1c7'),_0x559d5b['project_id']));}if(_0x48e7f4===this[_0x307c('0x13')][_0x307c('0x3c')]){return this[_0x307c('0x13')]['error'](_0x559d5b,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0x307c('0x39')][_0x307c('0xc4')](this,_0x559d5b,_0x48e7f4);var _0x535d96=this[_0x307c('0x13')][_0x307c('0x62')](_0x307c('0x1c8'),util['format'](_0x307c('0x1c9'),config[_0x307c('0x9')][_0x307c('0x1a9')]||_0x307c('0x1ca'),_0x48e7f4,this[_0x307c('0x13')][_0x307c('0x3c')]));if(_0x535d96[_0x307c('0xae')]===-0x1){return _0x535d96;}return this[_0x307c('0x13')][_0x307c('0xaf')](util[_0x307c('0x5e')]('Executed\x20command\x20%s\x20%s',_0x307c('0x1c8'),_0x48e7f4));};AGIVertices[_0x307c('0x15')][_0x307c('0x1cb')]=function(_0x5596e4){logger[_0x307c('0x30')](util['format']('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x5596e4[_0x307c('0xb2')]));var _0x57dfaa=this[_0x307c('0x61')]['sync'](this,_0x5596e4[_0x307c('0xb9')]);this[_0x307c('0x39')][_0x307c('0xc4')](this,_0x5596e4,_0x5596e4[_0x307c('0xb9')]);if(this[_0x307c('0x8c')](_0x5596e4[_0x307c('0xe0')])){var _0x59d01c=this[_0x307c('0x16')][_0x307c('0xc4')](this,_0x5596e4[_0x307c('0xe0')]);if(_0x59d01c){this[_0x307c('0x13')][_0x307c('0xa7')](_0x59d01c,_0x57dfaa);return this['channel'][_0x307c('0xaf')](util[_0x307c('0x5e')](_0x307c('0x1cc'),_0x5596e4[_0x307c('0xb9')],_0x59d01c));}}return this[_0x307c('0x13')][_0x307c('0xaf')](util[_0x307c('0x5e')](_0x307c('0x1cd'),_0x5596e4['command']));};AGIVertices['prototype'][_0x307c('0x1ce')]=function(_0x12bef3){logger['info'](util[_0x307c('0x5e')](_0x307c('0x1cf'),_0x12bef3[_0x307c('0xb2')]));_0x12bef3[_0x307c('0x67')]=_0x12bef3['text'][_0x307c('0x64')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x307c('0x8c')](_0x12bef3['apiKey'])){return this[_0x307c('0x13')]['noop'](_0x307c('0x1d0'));}if(!this[_0x307c('0x8c')](_0x12bef3[_0x307c('0x67')])){return this[_0x307c('0x13')][_0x307c('0xaf')](_0x307c('0xcc'));}this[_0x307c('0x13')][_0x307c('0xaf')](util[_0x307c('0x5e')](_0x307c('0x1d1'),_0x12bef3[_0x307c('0x67')]));var _0xef95fb=this[_0x307c('0x1d2')][_0x307c('0xc4')](this,_0x12bef3);if(_0xef95fb){this[_0x307c('0x13')][_0x307c('0xaf')](util[_0x307c('0x5e')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0xef95fb));var _0x89ed3=this['channel'][_0x307c('0x162')](_0xef95fb);try{fs[_0x307c('0x10b')](_0xef95fb+_0x307c('0x10c'));}catch(_0x355f9d){logger['error'](_0x355f9d);}return _0x89ed3;}return this[_0x307c('0x13')][_0x307c('0x36')](_0x12bef3,_0x307c('0x1d3'));};AGIVertices[_0x307c('0x15')][_0x307c('0x1d4')]=function(_0x3afa40){logger['info'](util[_0x307c('0x5e')](_0x307c('0x1d5'),_0x3afa40[_0x307c('0xb2')]));_0x3afa40['text']=_0x3afa40[_0x307c('0x67')][_0x307c('0x64')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x307c('0x8c')](_0x3afa40[_0x307c('0x67')])){return this[_0x307c('0x13')][_0x307c('0xaf')]('no\x20text\x20configured');}this[_0x307c('0x13')]['noop'](util[_0x307c('0x5e')]('Trying\x20Google\x20TTS\x20%s',_0x3afa40['text']));var _0x21f27c=this[_0x307c('0x6c')][_0x307c('0xc4')](this,_0x3afa40);if(_0x21f27c){this['channel']['noop'](util[_0x307c('0x5e')](_0x307c('0x1d6'),_0x21f27c));var _0x552bf5=this['channel'][_0x307c('0x162')](_0x21f27c);try{fs['unlink'](_0x21f27c+_0x307c('0x10c'));}catch(_0x1a1e8f){logger['error'](_0x1a1e8f);}return _0x552bf5;}return this[_0x307c('0x13')][_0x307c('0x36')](_0x3afa40,_0x307c('0x1d7'));};AGIVertices['prototype'][_0x307c('0x1d8')]=function(_0x3bbb9e){logger[_0x307c('0x30')](util[_0x307c('0x5e')](_0x307c('0x1d9'),_0x3bbb9e[_0x307c('0xb2')]));if(!this[_0x307c('0x8c')](_0x3bbb9e[_0x307c('0x165')])){return this[_0x307c('0x13')][_0x307c('0x36')](_0x3bbb9e,'no\x20find\x20by\x20configured');}logger[_0x307c('0x30')](util[_0x307c('0x5e')](_0x307c('0x167'),this['channel'][_0x307c('0x3d')],_0x3bbb9e[_0x307c('0x165')]));var _0x5b8394=this[_0x307c('0x5a')]['sync'](this,_0x3bbb9e[_0x307c('0x165')]);if(_0x5b8394){logger['info'](util[_0x307c('0x5e')](_0x307c('0x16b'),this[_0x307c('0x13')][_0x307c('0x3d')],_0x3bbb9e[_0x307c('0x165')]));this['channel'][_0x307c('0xaf')](util['format'](_0x307c('0x16b'),this[_0x307c('0x13')][_0x307c('0x3d')],_0x3bbb9e[_0x307c('0x165')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0x307c('0x5e')](_0x307c('0x168'),this[_0x307c('0x13')][_0x307c('0x3d')],_0x3bbb9e[_0x307c('0x165')]));this[_0x307c('0x13')][_0x307c('0xaf')](util[_0x307c('0x5e')](_0x307c('0x168'),this['channel'][_0x307c('0x3d')],_0x3bbb9e['findBy']));return{'code':0xc8,'result':_0x307c('0x16d')};}};AGIVertices[_0x307c('0x15')][_0x307c('0x1da')]=function(_0x10af55){logger['info'](util[_0x307c('0x5e')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x10af55['label']));var _0x2509a4=this['channel'][_0x307c('0x62')](_0x307c('0x1db'),[_0x10af55[_0x307c('0x1dc')],_0x10af55[_0x307c('0x7d')]]);if(_0x2509a4[_0x307c('0xae')]===-0x1){return _0x2509a4;}return this['channel'][_0x307c('0xaf')](util[_0x307c('0x5e')](_0x307c('0xc9'),'VOICEMAIL',_0x10af55[_0x307c('0x1dc')]));};AGIVertices[_0x307c('0x15')][_0x307c('0x1dd')]=function(_0x1277ef){logger[_0x307c('0x30')](util[_0x307c('0x5e')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x1277ef[_0x307c('0xb2')]));if(!this[_0x307c('0x8c')](_0x1277ef['variable_id'])){return this['channel']['error'](_0x1277ef,'no\x20variable\x20selected');}var _0x13cef9=this['getVariable'][_0x307c('0xc4')](this,_0x1277ef['variable_id']);if(!_0x13cef9){return this['channel'][_0x307c('0x36')](_0x1277ef,'no\x20variable\x20found');}var _0x337aa2=this[_0x307c('0x13')]['getVariable'](_0x13cef9);return{'code':0xc8,'result':_0x337aa2[_0x307c('0xab')]?_0x337aa2[_0x307c('0xab')]:'-'};};String[_0x307c('0x15')][_0x307c('0x1de')]=function(_0x596de7,_0x10139c){return this['split'](_0x596de7)['join'](_0x10139c);};module[_0x307c('0x1df')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 932ae6e..750fd76 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 _0xc8ff=['syncHangupRequest','syncHangup','agentringnoanswer','blindtransfer','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','interface','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','timer','acwTimeout','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','updateAcw','update','catch','error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','message','saveUnpause','[%s][UPDATE][ERRORS:%s]','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','syncAgentConnect','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','syncAttendedTransfer','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','moment','../../../config/logger','acw','../rpc/user','voiceQueues','agents','timers','channels','bind','hanguprequest'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc8ff,0x96));var _0xfc8f=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0xc8ff[_0xb0f7c3];return _0x28ea68;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xfc8f('0x0'));var ami=require('../ami');var logger=require(_0xfc8f('0x1'))(_0xfc8f('0x2'));var RpcUser=require(_0xfc8f('0x3'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x2a1dd6){this[_0xfc8f('0x4')]=_0x2a1dd6['voiceQueues'];this['agents']=_0x2a1dd6[_0xfc8f('0x5')];this[_0xfc8f('0x6')]=_0x2a1dd6[_0xfc8f('0x6')];this[_0xfc8f('0x7')]={};ami['on']('agentconnect',this['syncAgentConnect'][_0xfc8f('0x8')](this));ami['on'](_0xfc8f('0x9'),this[_0xfc8f('0xa')][_0xfc8f('0x8')](this));ami['on']('hangup',this[_0xfc8f('0xb')]['bind'](this));ami['on'](_0xfc8f('0xc'),this['syncAgentRingNoAnswer'][_0xfc8f('0x8')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer']['bind'](this));ami['on'](_0xfc8f('0xd'),this['syncBlindTransfer'][_0xfc8f('0x8')](this));ami['on']('custom:agentConnectPreview',this[_0xfc8f('0xe')][_0xfc8f('0x8')](this));}function getDiff(_0x5cd89c){var _0x19763c=moment()[_0xfc8f('0xf')](0x0);var _0xce9bec=moment(_0x5cd89c)[_0xfc8f('0xf')](0x0);return _0x19763c[_0xfc8f('0x10')](_0xce9bec,_0xfc8f('0x11'));}Acw[_0xfc8f('0x12')][_0xfc8f('0x13')]=function(_0x521327){try{var _0x52dfa3=this;var _0x1dd0d5=this[_0xfc8f('0x7')][_0x521327][_0xfc8f('0x14')];var _0x3950a9=this[_0xfc8f('0x7')][_0x521327]['queue'];var _0x4ddd56=this[_0xfc8f('0x4')][_0x3950a9];var _0x3d3e90=![];var _0x1f0c75=_0xfc8f('0x15');if(_0x4ddd56[_0xfc8f('0x16')]){if(_0x4ddd56[_0xfc8f('0x17')][_0xfc8f('0x18')]){_0x3d3e90=!![];_0x1f0c75=_0x4ddd56[_0xfc8f('0x17')]['name'];}}ami[_0xfc8f('0x19')]({'action':_0xfc8f('0x1a'),'interface':_0x1dd0d5,'paused':!![],'reason':_0x1f0c75})[_0xfc8f('0x1b')](function(_0x461d1c){if(_0x52dfa3[_0xfc8f('0x5')][_0x1dd0d5]){return RpcUser[_0xfc8f('0x1c')](_0x52dfa3['agents'][_0x1dd0d5]['id'])[_0xfc8f('0x1b')](function(_0x36afef){if(_0x36afef&&!_0x36afef[_0xfc8f('0x1d')]){logger[_0xfc8f('0x1e')](_0xfc8f('0x1f'),_0x521327,_0x1dd0d5,_0x3950a9);var _0x159904=_0x52dfa3['channels'][_0x521327][_0xfc8f('0x20')]&&_0x52dfa3[_0xfc8f('0x7')][_0x521327]['destlinkedid']?_0x52dfa3[_0xfc8f('0x7')][_0x521327][_0xfc8f('0x21')]:_0x521327;return RpcUser[_0xfc8f('0x22')](_0x52dfa3[_0xfc8f('0x5')][_0x1dd0d5],_0x1f0c75,_0x159904)['then'](function(_0xb80f91){if(!_0x3d3e90){_0x52dfa3[_0xfc8f('0x6')][_0x1dd0d5]={};logger['info'](_0xfc8f('0x23'),_0x521327,_0x52dfa3[_0xfc8f('0x4')][_0x3950a9]['acwTimeout'],_0x1dd0d5,_0x3950a9);_0x52dfa3[_0xfc8f('0x6')][_0x1dd0d5][_0xfc8f('0x24')]=setTimeout(_0x52dfa3['stopAcw']['bind'](_0x52dfa3,_0x1dd0d5),_0x52dfa3[_0xfc8f('0x4')][_0x3950a9][_0xfc8f('0x25')]*0x3e8);_0x52dfa3[_0xfc8f('0x6')][_0x1dd0d5][_0xfc8f('0x26')]=moment()[_0xfc8f('0x27')](_0xfc8f('0x28'));_0x52dfa3[_0xfc8f('0x6')][_0x1dd0d5][_0xfc8f('0x29')]=_0x521327;_0x52dfa3[_0xfc8f('0x6')][_0x1dd0d5][_0xfc8f('0x2a')]=_0x3950a9;_0x52dfa3[_0xfc8f('0x6')][_0x1dd0d5][_0xfc8f('0x2b')]=function(){var _0x40fe57=getDiff(_0x52dfa3['timers'][_0x1dd0d5][_0xfc8f('0x26')]);clearTimeout(_0x52dfa3[_0xfc8f('0x6')][_0x1dd0d5][_0xfc8f('0x24')]);_0x52dfa3['timers'][_0x1dd0d5][_0xfc8f('0x24')]=![];RpcVoiceAgentReport[_0xfc8f('0x2c')]({'acwtime':_0x40fe57},_0x52dfa3[_0xfc8f('0x6')][_0x1dd0d5][_0xfc8f('0x29')],_0x1dd0d5)[_0xfc8f('0x1b')](function(_0x4a858c){logger['info']('[%s][UPDATE][ACWTIME:%s]',_0x521327,_0x40fe57,_0x4a858c);})[_0xfc8f('0x2d')](function(_0x554b98){logger[_0xfc8f('0x2e')]('[%s][UPDATE][ERRORS:%s]',_0x521327,_0x554b98);});delete _0x52dfa3['timers'][_0x1dd0d5];};}});}else{logger['info'](_0xfc8f('0x2f'),_0x521327,_0x1dd0d5,_0x3950a9);}});}})['catch'](function(_0x370cb5){logger[_0xfc8f('0x2e')](_0xfc8f('0x23'),_0x521327,_0x52dfa3['voiceQueues'][_0x3950a9][_0xfc8f('0x25')],_0x1dd0d5,_0x3950a9);})[_0xfc8f('0x30')](function(){delete _0x52dfa3[_0xfc8f('0x7')][_0x521327];});}catch(_0xeec715){logger[_0xfc8f('0x2e')](_0xfc8f('0x31'),_0xeec715[_0xfc8f('0x32')]);}};Acw[_0xfc8f('0x12')]['stopAcw']=function(_0x37db16){try{var _0x346dfa=this;if(_0x346dfa[_0xfc8f('0x6')][_0x37db16]){_0x346dfa[_0xfc8f('0x6')][_0x37db16]['timer']=![];var _0x2c74fe=_0x346dfa[_0xfc8f('0x6')][_0x37db16][_0xfc8f('0x29')];var _0x52966a=_0x346dfa[_0xfc8f('0x6')][_0x37db16][_0xfc8f('0x2a')];var _0x1d90d8=_0x346dfa[_0xfc8f('0x4')][_0x52966a][_0xfc8f('0x25')];logger['info']('[%s][TIMER][STOP][AGENT:%s]',_0x2c74fe,_0x37db16);RpcUser[_0xfc8f('0x33')](this['agents'][_0x37db16]);RpcVoiceAgentReport[_0xfc8f('0x2c')]({'acwtime':_0x1d90d8,'agentacw':!![]},_0x2c74fe,_0x37db16)[_0xfc8f('0x1b')](function(_0x1b407e){logger[_0xfc8f('0x1e')]('[%s][UPDATE][ACWTIME:%s]',_0x2c74fe,_0x1d90d8,_0x1b407e);})[_0xfc8f('0x2d')](function(_0x5f29e7){logger[_0xfc8f('0x2e')](_0xfc8f('0x34'),_0x2c74fe,_0x5f29e7);});}else{logger['error']('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x37db16);if(_0x346dfa[_0xfc8f('0x6')]){logger[_0xfc8f('0x1e')](_0xfc8f('0x35'),JSON[_0xfc8f('0x36')](_0x346dfa[_0xfc8f('0x6')]));}}}catch(_0x1c3d6f){logger['error'](_0xfc8f('0x37'),_0x1c3d6f['message']);}};Acw[_0xfc8f('0x12')][_0xfc8f('0x38')]=function(_0x411a00){try{if(this['voiceQueues'][_0x411a00['queue']]&&(this[_0xfc8f('0x4')][_0x411a00[_0xfc8f('0x2a')]][_0xfc8f('0x2')]||this['voiceQueues'][_0x411a00[_0xfc8f('0x2a')]][_0xfc8f('0x16')])){if(this[_0xfc8f('0x5')][_0x411a00[_0xfc8f('0x14')]]){this[_0xfc8f('0x7')][_0x411a00[_0xfc8f('0x29')]]={'queue':_0x411a00[_0xfc8f('0x2a')],'interface':_0x411a00[_0xfc8f('0x14')],'destlinkedid':_0x411a00['destlinkedid']};}}}catch(_0x33596f){logger[_0xfc8f('0x2e')]('[ACW][syncAgentConnect]\x20%s',_0x33596f['message']);}};Acw[_0xfc8f('0x12')][_0xfc8f('0xe')]=function(_0x37014b){try{if(this[_0xfc8f('0x4')][_0x37014b[_0xfc8f('0x2a')]]&&(this['voiceQueues'][_0x37014b[_0xfc8f('0x2a')]]['acw']||this[_0xfc8f('0x4')][_0x37014b[_0xfc8f('0x2a')]][_0xfc8f('0x16')])){if(this[_0xfc8f('0x5')][_0x37014b[_0xfc8f('0x14')]]){this[_0xfc8f('0x7')][_0x37014b['uniqueid']]={'queue':_0x37014b['queue'],'interface':_0x37014b[_0xfc8f('0x14')]};}}}catch(_0x26d04b){logger[_0xfc8f('0x2e')](_0xfc8f('0x39'),_0x26d04b['message']);}};Acw[_0xfc8f('0x12')][_0xfc8f('0xa')]=function(_0x5e2de6){try{if(this[_0xfc8f('0x7')][_0x5e2de6[_0xfc8f('0x29')]]&&_[_0xfc8f('0x3a')](this[_0xfc8f('0x7')][_0x5e2de6[_0xfc8f('0x29')]][_0xfc8f('0x20')])){logger[_0xfc8f('0x1e')](_0xfc8f('0x3b'),_0x5e2de6[_0xfc8f('0x29')]);this['startAcw'](_0x5e2de6[_0xfc8f('0x29')]);}else if(this[_0xfc8f('0x7')][_0x5e2de6[_0xfc8f('0x3c')]]&&_[_0xfc8f('0x3a')](this[_0xfc8f('0x7')][_0x5e2de6[_0xfc8f('0x3c')]][_0xfc8f('0x20')])){logger['info'](_0xfc8f('0x3d'),_0x5e2de6[_0xfc8f('0x3c')]);this[_0xfc8f('0x13')](_0x5e2de6[_0xfc8f('0x3c')]);}}catch(_0x1c573a){logger[_0xfc8f('0x2e')]('[ACW][syncHangupRequest]\x20%s',_0x1c573a[_0xfc8f('0x32')]);}};Acw[_0xfc8f('0x12')][_0xfc8f('0xb')]=function(_0x47d9ce){try{if(this[_0xfc8f('0x7')][_0x47d9ce[_0xfc8f('0x29')]]&&this[_0xfc8f('0x7')][_0x47d9ce['uniqueid']]['attended']){logger[_0xfc8f('0x1e')](_0xfc8f('0x3e'),_0x47d9ce[_0xfc8f('0x29')]);this[_0xfc8f('0x13')](_0x47d9ce[_0xfc8f('0x29')]);}else if(this[_0xfc8f('0x7')][_0x47d9ce['linkedid']]&&this[_0xfc8f('0x7')][_0x47d9ce['linkedid']][_0xfc8f('0x20')]){logger[_0xfc8f('0x1e')](_0xfc8f('0x3f'),_0x47d9ce['linkedid']);this[_0xfc8f('0x13')](_0x47d9ce['linkedid']);}}catch(_0x53a6cf){logger['error'](_0xfc8f('0x40'),_0x53a6cf[_0xfc8f('0x32')]);}};Acw['prototype'][_0xfc8f('0x41')]=function(_0x12972a){try{if(!_[_0xfc8f('0x42')](this[_0xfc8f('0x7')][_0x12972a['transfereeuniqueid']])){this[_0xfc8f('0x13')](_0x12972a[_0xfc8f('0x43')]);if(this[_0xfc8f('0x7')][_0x12972a[_0xfc8f('0x44')]]){this[_0xfc8f('0x7')][_0x12972a[_0xfc8f('0x44')]]['attended']=!![];this[_0xfc8f('0x7')][_0x12972a[_0xfc8f('0x45')]]=this['channels'][_0x12972a[_0xfc8f('0x44')]];delete this[_0xfc8f('0x7')][_0x12972a[_0xfc8f('0x44')]];}}else if(!_[_0xfc8f('0x42')](this['channels'][_0x12972a[_0xfc8f('0x45')]])){this['startAcw'](_0x12972a[_0xfc8f('0x45')]);if(this['channels'][_0x12972a[_0xfc8f('0x46')]]){this[_0xfc8f('0x7')][_0x12972a[_0xfc8f('0x46')]]['attended']=!![];this[_0xfc8f('0x7')][_0x12972a[_0xfc8f('0x43')]]=this[_0xfc8f('0x7')][_0x12972a['origtransfereruniqueid']];delete this[_0xfc8f('0x7')][_0x12972a[_0xfc8f('0x46')]];}}}catch(_0x59faf9){logger[_0xfc8f('0x2e')](_0xfc8f('0x47'),_0x59faf9[_0xfc8f('0x32')]);}};Acw[_0xfc8f('0x12')]['syncBlindTransfer']=function(_0xa97b59){try{if(this['channels'][_0xa97b59[_0xfc8f('0x48')]]){logger[_0xfc8f('0x1e')](_0xfc8f('0x49'),JSON[_0xfc8f('0x36')](_0xa97b59[_0xfc8f('0x48')]));this[_0xfc8f('0x13')](_0xa97b59[_0xfc8f('0x48')]);}else if(this[_0xfc8f('0x7')][_0xa97b59['transfererlinkedid']]){logger[_0xfc8f('0x1e')](_0xfc8f('0x4a'),JSON['stringify'](_0xa97b59['transfererlinkedid']));this[_0xfc8f('0x13')](_0xa97b59[_0xfc8f('0x4b')]);}}catch(_0x5d7af0){logger[_0xfc8f('0x2e')]('[ACW][syncBlindTransfer]\x20%s',_0x5d7af0[_0xfc8f('0x32')]);}};Acw[_0xfc8f('0x12')]['syncAgentRingNoAnswer']=function(_0x1bc166){try{if(this[_0xfc8f('0x4')][_0x1bc166[_0xfc8f('0x2a')]]&&this[_0xfc8f('0x4')][_0x1bc166[_0xfc8f('0x2a')]]['autopause']===_0xfc8f('0x4c')){if(this[_0xfc8f('0x5')][_0x1bc166[_0xfc8f('0x14')]]){logger['info'](_0xfc8f('0x4d'),_0x1bc166[_0xfc8f('0x29')],_0x1bc166[_0xfc8f('0x14')],_0x1bc166[_0xfc8f('0x2a')]);return RpcUser['savePause'](this[_0xfc8f('0x5')][_0x1bc166[_0xfc8f('0x14')]],_0xfc8f('0x4e'),_0x1bc166[_0xfc8f('0x29')]);}}}catch(_0x19f19b){logger[_0xfc8f('0x2e')](_0xfc8f('0x4f'),_0x19f19b[_0xfc8f('0x32')]);}};module['exports']=Acw; \ No newline at end of file +var _0x3abb=['[ACW][syncAgentConnectPreview]\x20%s','syncHangupRequest','isUndefined','[%s][HANGUP:UNIQUEID]','startAcw','linkedid','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','syncAttendedTransfer','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','moment','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','syncAgentConnect','bind','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','milliseconds','diff','seconds','prototype','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','voicePause','channels','attended','destlinkedid','savePause','info','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','update','catch','error','[%s][UPDATE][ERRORS:%s]','finally','[ACW][START]\x20%s','message','stopAcw','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','stringify','[ACW][syncAgentConnect]\x20%s','syncAgentConnectPreview'];(function(_0x118b1d,_0x4e83dc){var _0x5ccdef=function(_0x5b422d){while(--_0x5b422d){_0x118b1d['push'](_0x118b1d['shift']());}};_0x5ccdef(++_0x4e83dc);}(_0x3abb,0x6d));var _0xb3ab=function(_0x34843e,_0x4c4224){_0x34843e=_0x34843e-0x0;var _0x598f7f=_0x3abb[_0x34843e];return _0x598f7f;};'use strict';var util=require('util');var _=require(_0xb3ab('0x0'));var moment=require(_0xb3ab('0x1'));var ami=require('../ami');var logger=require(_0xb3ab('0x2'))(_0xb3ab('0x3'));var RpcUser=require(_0xb3ab('0x4'));var RpcVoiceAgentReport=require(_0xb3ab('0x5'));function Acw(_0x48457e){this['voiceQueues']=_0x48457e[_0xb3ab('0x6')];this[_0xb3ab('0x7')]=_0x48457e[_0xb3ab('0x7')];this[_0xb3ab('0x8')]=_0x48457e[_0xb3ab('0x8')];this['channels']={};ami['on']('agentconnect',this[_0xb3ab('0x9')][_0xb3ab('0xa')](this));ami['on']('hanguprequest',this['syncHangupRequest'][_0xb3ab('0xa')](this));ami['on'](_0xb3ab('0xb'),this[_0xb3ab('0xc')][_0xb3ab('0xa')](this));ami['on'](_0xb3ab('0xd'),this[_0xb3ab('0xe')]['bind'](this));ami['on'](_0xb3ab('0xf'),this['syncAttendedTransfer'][_0xb3ab('0xa')](this));ami['on'](_0xb3ab('0x10'),this[_0xb3ab('0x11')][_0xb3ab('0xa')](this));ami['on'](_0xb3ab('0x12'),this['syncAgentConnectPreview'][_0xb3ab('0xa')](this));}function getDiff(_0x19d6f0){var _0x42dc62=moment()[_0xb3ab('0x13')](0x0);var _0x98cf59=moment(_0x19d6f0)[_0xb3ab('0x13')](0x0);return _0x42dc62[_0xb3ab('0x14')](_0x98cf59,_0xb3ab('0x15'));}Acw[_0xb3ab('0x16')]['startAcw']=function(_0x53e85e){try{var _0x9f8597=this;var _0x796731=this['channels'][_0x53e85e][_0xb3ab('0x17')];var _0x48d5d7=this['channels'][_0x53e85e][_0xb3ab('0x18')];var _0x18e186=this[_0xb3ab('0x6')][_0x48d5d7];var _0x489239=![];var _0x492482=_0xb3ab('0x19');if(_0x18e186[_0xb3ab('0x1a')]){if(_0x18e186[_0xb3ab('0x1b')]['name']){_0x489239=!![];_0x492482=_0x18e186[_0xb3ab('0x1b')][_0xb3ab('0x1c')];}}ami[_0xb3ab('0x1d')]({'action':_0xb3ab('0x1e'),'interface':_0x796731,'paused':!![],'reason':_0x492482})[_0xb3ab('0x1f')](function(_0x119bdd){if(_0x9f8597[_0xb3ab('0x7')][_0x796731]){return RpcUser['getAgent'](_0x9f8597[_0xb3ab('0x7')][_0x796731]['id'])['then'](function(_0x3bac9e){if(_0x3bac9e&&!_0x3bac9e[_0xb3ab('0x20')]){logger['info']('[%s][START][AGENT:%s][QUEUE:%s]',_0x53e85e,_0x796731,_0x48d5d7);var _0x4be7dd=_0x9f8597[_0xb3ab('0x21')][_0x53e85e][_0xb3ab('0x22')]&&_0x9f8597[_0xb3ab('0x21')][_0x53e85e][_0xb3ab('0x23')]?_0x9f8597[_0xb3ab('0x21')][_0x53e85e][_0xb3ab('0x23')]:_0x53e85e;return RpcUser[_0xb3ab('0x24')](_0x9f8597[_0xb3ab('0x7')][_0x796731],_0x492482,_0x4be7dd)[_0xb3ab('0x1f')](function(_0x2f615b){if(!_0x489239){_0x9f8597['timers'][_0x796731]={};logger[_0xb3ab('0x25')](_0xb3ab('0x26'),_0x53e85e,_0x9f8597[_0xb3ab('0x6')][_0x48d5d7][_0xb3ab('0x27')],_0x796731,_0x48d5d7);_0x9f8597['timers'][_0x796731][_0xb3ab('0x28')]=setTimeout(_0x9f8597['stopAcw'][_0xb3ab('0xa')](_0x9f8597,_0x796731),_0x9f8597[_0xb3ab('0x6')][_0x48d5d7][_0xb3ab('0x27')]*0x3e8);_0x9f8597[_0xb3ab('0x8')][_0x796731][_0xb3ab('0x29')]=moment()[_0xb3ab('0x2a')](_0xb3ab('0x2b'));_0x9f8597['timers'][_0x796731][_0xb3ab('0x2c')]=_0x53e85e;_0x9f8597[_0xb3ab('0x8')][_0x796731][_0xb3ab('0x18')]=_0x48d5d7;_0x9f8597[_0xb3ab('0x8')][_0x796731][_0xb3ab('0x2d')]=function(){var _0x422f29=getDiff(_0x9f8597[_0xb3ab('0x8')][_0x796731][_0xb3ab('0x29')]);clearTimeout(_0x9f8597[_0xb3ab('0x8')][_0x796731][_0xb3ab('0x28')]);_0x9f8597[_0xb3ab('0x8')][_0x796731][_0xb3ab('0x28')]=![];RpcVoiceAgentReport[_0xb3ab('0x2e')]({'acwtime':_0x422f29},_0x9f8597['timers'][_0x796731][_0xb3ab('0x2c')],_0x796731)[_0xb3ab('0x1f')](function(_0xc1cffd){logger[_0xb3ab('0x25')]('[%s][UPDATE][ACWTIME:%s]',_0x53e85e,_0x422f29,_0xc1cffd);})[_0xb3ab('0x2f')](function(_0x452ab8){logger[_0xb3ab('0x30')](_0xb3ab('0x31'),_0x53e85e,_0x452ab8);});delete _0x9f8597[_0xb3ab('0x8')][_0x796731];};}});}else{logger[_0xb3ab('0x25')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x53e85e,_0x796731,_0x48d5d7);}});}})[_0xb3ab('0x2f')](function(_0x33c029){logger[_0xb3ab('0x30')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x53e85e,_0x9f8597[_0xb3ab('0x6')][_0x48d5d7][_0xb3ab('0x27')],_0x796731,_0x48d5d7);})[_0xb3ab('0x32')](function(){delete _0x9f8597['channels'][_0x53e85e];});}catch(_0x135ccf){logger[_0xb3ab('0x30')](_0xb3ab('0x33'),_0x135ccf[_0xb3ab('0x34')]);}};Acw[_0xb3ab('0x16')][_0xb3ab('0x35')]=function(_0x18f46f){try{var _0x3f7a1c=this;if(_0x3f7a1c[_0xb3ab('0x8')][_0x18f46f]){_0x3f7a1c[_0xb3ab('0x8')][_0x18f46f][_0xb3ab('0x28')]=![];var _0x32ef1a=_0x3f7a1c[_0xb3ab('0x8')][_0x18f46f]['uniqueid'];var _0x822b6=_0x3f7a1c[_0xb3ab('0x8')][_0x18f46f][_0xb3ab('0x18')];var _0x1190a1=_0x3f7a1c[_0xb3ab('0x6')][_0x822b6][_0xb3ab('0x27')];logger[_0xb3ab('0x25')]('[%s][TIMER][STOP][AGENT:%s]',_0x32ef1a,_0x18f46f);RpcUser[_0xb3ab('0x36')](this['agents'][_0x18f46f]);RpcVoiceAgentReport[_0xb3ab('0x2e')]({'acwtime':_0x1190a1,'agentacw':!![]},_0x32ef1a,_0x18f46f)['then'](function(_0x4f870e){logger['info']('[%s][UPDATE][ACWTIME:%s]',_0x32ef1a,_0x1190a1,_0x4f870e);})[_0xb3ab('0x2f')](function(_0x250fa6){logger['error'](_0xb3ab('0x31'),_0x32ef1a,_0x250fa6);});}else{logger['error'](_0xb3ab('0x37'),_0x18f46f);if(_0x3f7a1c[_0xb3ab('0x8')]){logger[_0xb3ab('0x25')]('[ACW][TIMERS]',JSON[_0xb3ab('0x38')](_0x3f7a1c[_0xb3ab('0x8')]));}}}catch(_0x2f0567){logger['error']('[ACW][STOP]\x20%s',_0x2f0567[_0xb3ab('0x34')]);}};Acw[_0xb3ab('0x16')][_0xb3ab('0x9')]=function(_0x49359c){try{if(this[_0xb3ab('0x6')][_0x49359c[_0xb3ab('0x18')]]&&(this[_0xb3ab('0x6')][_0x49359c[_0xb3ab('0x18')]][_0xb3ab('0x3')]||this[_0xb3ab('0x6')][_0x49359c[_0xb3ab('0x18')]]['mandatoryDisposition'])){if(this[_0xb3ab('0x7')][_0x49359c[_0xb3ab('0x17')]]){this[_0xb3ab('0x21')][_0x49359c[_0xb3ab('0x2c')]]={'queue':_0x49359c[_0xb3ab('0x18')],'interface':_0x49359c[_0xb3ab('0x17')],'destlinkedid':_0x49359c[_0xb3ab('0x23')]};}}}catch(_0x4c26fe){logger[_0xb3ab('0x30')](_0xb3ab('0x39'),_0x4c26fe[_0xb3ab('0x34')]);}};Acw[_0xb3ab('0x16')][_0xb3ab('0x3a')]=function(_0x202e42){try{if(this['voiceQueues'][_0x202e42['queue']]&&(this[_0xb3ab('0x6')][_0x202e42[_0xb3ab('0x18')]][_0xb3ab('0x3')]||this[_0xb3ab('0x6')][_0x202e42[_0xb3ab('0x18')]][_0xb3ab('0x1a')])){if(this[_0xb3ab('0x7')][_0x202e42[_0xb3ab('0x17')]]){this['channels'][_0x202e42[_0xb3ab('0x2c')]]={'queue':_0x202e42[_0xb3ab('0x18')],'interface':_0x202e42[_0xb3ab('0x17')]};}}}catch(_0xf2241c){logger[_0xb3ab('0x30')](_0xb3ab('0x3b'),_0xf2241c[_0xb3ab('0x34')]);}};Acw[_0xb3ab('0x16')][_0xb3ab('0x3c')]=function(_0x50f599){try{if(this[_0xb3ab('0x21')][_0x50f599[_0xb3ab('0x2c')]]&&_[_0xb3ab('0x3d')](this[_0xb3ab('0x21')][_0x50f599[_0xb3ab('0x2c')]][_0xb3ab('0x22')])){logger[_0xb3ab('0x25')](_0xb3ab('0x3e'),_0x50f599[_0xb3ab('0x2c')]);this[_0xb3ab('0x3f')](_0x50f599[_0xb3ab('0x2c')]);}else if(this[_0xb3ab('0x21')][_0x50f599[_0xb3ab('0x40')]]&&_['isUndefined'](this[_0xb3ab('0x21')][_0x50f599[_0xb3ab('0x40')]][_0xb3ab('0x22')])){logger[_0xb3ab('0x25')]('[%s][HANGUP:LINKEDID]',_0x50f599[_0xb3ab('0x40')]);this[_0xb3ab('0x3f')](_0x50f599[_0xb3ab('0x40')]);}}catch(_0x23627d){logger[_0xb3ab('0x30')](_0xb3ab('0x41'),_0x23627d[_0xb3ab('0x34')]);}};Acw['prototype'][_0xb3ab('0xc')]=function(_0x43bbfc){try{if(this[_0xb3ab('0x21')][_0x43bbfc[_0xb3ab('0x2c')]]&&this[_0xb3ab('0x21')][_0x43bbfc[_0xb3ab('0x2c')]][_0xb3ab('0x22')]){logger['info'](_0xb3ab('0x42'),_0x43bbfc[_0xb3ab('0x2c')]);this[_0xb3ab('0x3f')](_0x43bbfc[_0xb3ab('0x2c')]);}else if(this[_0xb3ab('0x21')][_0x43bbfc[_0xb3ab('0x40')]]&&this[_0xb3ab('0x21')][_0x43bbfc[_0xb3ab('0x40')]][_0xb3ab('0x22')]){logger[_0xb3ab('0x25')](_0xb3ab('0x43'),_0x43bbfc[_0xb3ab('0x40')]);this['startAcw'](_0x43bbfc[_0xb3ab('0x40')]);}}catch(_0x368ba4){logger['error'](_0xb3ab('0x44'),_0x368ba4[_0xb3ab('0x34')]);}};Acw['prototype'][_0xb3ab('0x45')]=function(_0x1f050a){try{if(!_[_0xb3ab('0x46')](this[_0xb3ab('0x21')][_0x1f050a['transfereeuniqueid']])){this[_0xb3ab('0x3f')](_0x1f050a[_0xb3ab('0x47')]);if(this[_0xb3ab('0x21')][_0x1f050a[_0xb3ab('0x48')]]){this[_0xb3ab('0x21')][_0x1f050a[_0xb3ab('0x48')]][_0xb3ab('0x22')]=!![];this[_0xb3ab('0x21')][_0x1f050a[_0xb3ab('0x49')]]=this[_0xb3ab('0x21')][_0x1f050a[_0xb3ab('0x48')]];delete this[_0xb3ab('0x21')][_0x1f050a['secondtransfereruniqueid']];}}else if(!_[_0xb3ab('0x46')](this[_0xb3ab('0x21')][_0x1f050a[_0xb3ab('0x49')]])){this['startAcw'](_0x1f050a[_0xb3ab('0x49')]);if(this[_0xb3ab('0x21')][_0x1f050a[_0xb3ab('0x4a')]]){this[_0xb3ab('0x21')][_0x1f050a[_0xb3ab('0x4a')]][_0xb3ab('0x22')]=!![];this[_0xb3ab('0x21')][_0x1f050a['transfereeuniqueid']]=this[_0xb3ab('0x21')][_0x1f050a[_0xb3ab('0x4a')]];delete this[_0xb3ab('0x21')][_0x1f050a['origtransfereruniqueid']];}}}catch(_0x384c60){logger[_0xb3ab('0x30')]('[ACW][syncAttendedTransfer]\x20%s',_0x384c60[_0xb3ab('0x34')]);}};Acw['prototype'][_0xb3ab('0x11')]=function(_0x35d792){try{if(this[_0xb3ab('0x21')][_0x35d792[_0xb3ab('0x4b')]]){logger[_0xb3ab('0x25')](_0xb3ab('0x4c'),JSON['stringify'](_0x35d792[_0xb3ab('0x4b')]));this[_0xb3ab('0x3f')](_0x35d792[_0xb3ab('0x4b')]);}else if(this[_0xb3ab('0x21')][_0x35d792['transfererlinkedid']]){logger[_0xb3ab('0x25')](_0xb3ab('0x4d'),JSON[_0xb3ab('0x38')](_0x35d792['transfererlinkedid']));this['startAcw'](_0x35d792[_0xb3ab('0x4e')]);}}catch(_0x5d4d00){logger[_0xb3ab('0x30')](_0xb3ab('0x4f'),_0x5d4d00[_0xb3ab('0x34')]);}};Acw[_0xb3ab('0x16')][_0xb3ab('0xe')]=function(_0x21bdf4){try{if(this[_0xb3ab('0x6')][_0x21bdf4[_0xb3ab('0x18')]]&&this['voiceQueues'][_0x21bdf4[_0xb3ab('0x18')]][_0xb3ab('0x50')]==='all'){if(this['agents'][_0x21bdf4[_0xb3ab('0x17')]]){logger[_0xb3ab('0x25')](_0xb3ab('0x51'),_0x21bdf4[_0xb3ab('0x2c')],_0x21bdf4[_0xb3ab('0x17')],_0x21bdf4[_0xb3ab('0x18')]);return RpcUser['savePause'](this[_0xb3ab('0x7')][_0x21bdf4[_0xb3ab('0x17')]],'Auto-Pause',_0x21bdf4['uniqueid']);}}}catch(_0x53c716){logger[_0xb3ab('0x30')](_0xb3ab('0x52'),_0x53c716[_0xb3ab('0x34')]);}};module[_0xb3ab('0x53')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index c34d9f1..1eec92d 100644 --- a/server/services/ami/ami.js +++ b/server/services/ami/ami.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7e7=['username','Action','devicestatelist','actionSipPeerStatus','sippeerstatus','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipShowRegistry','actionDeviceStateList','catch','[ami.js][fullybooted]','exports','asterisk-manager','moment','lodash','ami','asterisk','port','password','keepConnected','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s'];(function(_0x9e3314,_0x5f330c){var _0xf5f5d6=function(_0x1f82ff){while(--_0x1f82ff){_0x9e3314['push'](_0x9e3314['shift']());}};_0xf5f5d6(++_0x5f330c);}(_0xb7e7,0x121));var _0x7b7e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb7e7[_0x20a584];return _0x4b41a8;};'use strict';var Manager=require(_0x7b7e('0x0'));var BPromise=require('bluebird');var moment=require(_0x7b7e('0x1'));var util=require('util');var _=require(_0x7b7e('0x2'));var logger=require('../../config/logger')(_0x7b7e('0x3'));var config=require('../../config/environment');var ami=new Manager(config[_0x7b7e('0x4')][_0x7b7e('0x5')],config[_0x7b7e('0x4')]['ip'],config['asterisk']['username'],config[_0x7b7e('0x4')][_0x7b7e('0x6')],!![]);ami[_0x7b7e('0x7')]();ami['Action']=BPromise[_0x7b7e('0x8')](ami[_0x7b7e('0x9')]);function error(_0x2917f9){logger[_0x7b7e('0xa')](util[_0x7b7e('0xb')](_0x7b7e('0xc'),config[_0x7b7e('0x4')]['username'],config[_0x7b7e('0x4')]['ip'],config[_0x7b7e('0x4')][_0x7b7e('0x5')],util[_0x7b7e('0xd')](_0x2917f9,![],null)));}function close(){logger[_0x7b7e('0xa')](util[_0x7b7e('0xb')](_0x7b7e('0xe'),config[_0x7b7e('0x4')][_0x7b7e('0xf')],config['asterisk']['ip'],config[_0x7b7e('0x4')][_0x7b7e('0x5')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x7b7e('0x10')]({'action':'sipshowregistry'});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x7b7e('0x10')]({'action':_0x7b7e('0x11')});};};ami[_0x7b7e('0x12')]=function(){return function(){return ami[_0x7b7e('0x10')]({'action':_0x7b7e('0x13')});};};ami['actionQueueSummary']=function(){return function(){return ami['Action']({'action':_0x7b7e('0x14')});};};ami[_0x7b7e('0x15')]=function(){return function(){return ami[_0x7b7e('0x10')]({'action':_0x7b7e('0x16')});};};function connect(_0x2cc400){logger[_0x7b7e('0x17')](util[_0x7b7e('0xb')](_0x7b7e('0x18'),config[_0x7b7e('0x4')][_0x7b7e('0xf')],config[_0x7b7e('0x4')]['ip'],config[_0x7b7e('0x4')][_0x7b7e('0x5')]));ami[_0x7b7e('0x19')](_0x7b7e('0xa'),error);ami[_0x7b7e('0x19')](_0x7b7e('0x1a'),close);}ami['on']('connect',connect);ami['on'](_0x7b7e('0x1b'),function(_0x43db4f){logger[_0x7b7e('0x17')](util['format'](_0x7b7e('0x1c'),config[_0x7b7e('0x4')][_0x7b7e('0xf')],config[_0x7b7e('0x4')]['ip'],config[_0x7b7e('0x4')][_0x7b7e('0x5')],util[_0x7b7e('0xd')](_0x43db4f,![],null)));});ami['on'](_0x7b7e('0x1d'),function(_0x53bbb3){logger['info'](util['format'](_0x7b7e('0x1e'),config[_0x7b7e('0x4')][_0x7b7e('0xf')],config['asterisk']['ip'],config['asterisk']['port']));return BPromise[_0x7b7e('0x1f')]()[_0x7b7e('0x20')](ami[_0x7b7e('0x21')]())[_0x7b7e('0x20')](ami[_0x7b7e('0x22')]())['then'](ami[_0x7b7e('0x12')]())[_0x7b7e('0x20')](ami['actionQueueSummary']())['then'](ami['actionCoreShowChannels']())[_0x7b7e('0x23')](function(_0x423832){logger['error'](_0x7b7e('0x24'),util['inspect'](_0x423832,{'showHidden':![],'depth':null}));});});ami[_0x7b7e('0x19')](_0x7b7e('0xa'),error);ami[_0x7b7e('0x19')]('close',close);module[_0x7b7e('0x25')]=ami; \ No newline at end of file +var _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(_0x4da9fa,_0x5287d2){var _0x2be8c3=function(_0x390a0d){while(--_0x390a0d){_0x4da9fa['push'](_0x4da9fa['shift']());}};_0x2be8c3(++_0x5287d2);}(_0xb10b,0x12a));var _0xbb10=function(_0x5458a6,_0x1688c5){_0x5458a6=_0x5458a6-0x0;var _0x2669fc=_0xb10b[_0x5458a6];return _0x2669fc;};'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 diff --git a/server/services/ami/client.js b/server/services/ami/client.js index d9a6284..d62b44b 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 _0xe706=['result','catch','exports','jayson/promise','bluebird','../../config/logger','client','http','Request','request','then','debug','rpc','memberReport','error','message'];(function(_0x2f2360,_0x151089){var _0x1cc8d3=function(_0x5e356f){while(--_0x5e356f){_0x2f2360['push'](_0x2f2360['shift']());}};_0x1cc8d3(++_0x151089);}(_0xe706,0xa3));var _0x6e70=function(_0x160248,_0x2a57e6){_0x160248=_0x160248-0x0;var _0x4e589d=_0xe706[_0x160248];return _0x4e589d;};'use strict';var jayson=require(_0x6e70('0x0'));var BPromise=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('ami');var client=jayson[_0x6e70('0x3')][_0x6e70('0x4')]({'port':0x2329});client[_0x6e70('0x5')]=function(_0x7dfbc3,_0x142c27){return new BPromise(function(_0x2164a4,_0x376a8d){return client[_0x6e70('0x6')](_0x7dfbc3,_0x142c27)[_0x6e70('0x7')](function(_0x4381d1){logger[_0x6e70('0x8')](_0x6e70('0x9'),_0x6e70('0xa'),_0x7dfbc3,_0x142c27,_0x4381d1);if(_0x4381d1[_0x6e70('0xb')]){logger[_0x6e70('0xb')](_0x6e70('0x9'),_0x6e70('0xa'),_0x7dfbc3,_0x4381d1[_0x6e70('0xb')][_0x6e70('0xc')],_0x142c27);return _0x376a8d(_0x4381d1[_0x6e70('0xb')][_0x6e70('0xc')]);}else{return _0x2164a4(_0x4381d1[_0x6e70('0xd')]);}})[_0x6e70('0xe')](function(_0x4600f9){logger['error']('rpc',_0x6e70('0xa'),_0x7dfbc3,_0x4600f9,_0x142c27);return _0x376a8d(_0x4600f9);});});};module[_0x6e70('0xf')]=client; \ No newline at end of file +var _0xa9e0=['result','catch','exports','jayson/promise','bluebird','../../config/logger','http','request','debug','rpc','error','message'];(function(_0x28f3a5,_0x2a84af){var _0x1a60bc=function(_0x1cf0ef){while(--_0x1cf0ef){_0x28f3a5['push'](_0x28f3a5['shift']());}};_0x1a60bc(++_0x2a84af);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('ami');var client=jayson['client'][_0x0a9e('0x3')]({'port':0x2329});client['Request']=function(_0x333808,_0x432180){return new BPromise(function(_0x2ab90b,_0x991246){return client[_0x0a9e('0x4')](_0x333808,_0x432180)['then'](function(_0x219af0){logger[_0x0a9e('0x5')](_0x0a9e('0x6'),'memberReport',_0x333808,_0x432180,_0x219af0);if(_0x219af0['error']){logger[_0x0a9e('0x7')]('rpc','memberReport',_0x333808,_0x219af0[_0x0a9e('0x7')][_0x0a9e('0x8')],_0x432180);return _0x991246(_0x219af0[_0x0a9e('0x7')][_0x0a9e('0x8')]);}else{return _0x2ab90b(_0x219af0[_0x0a9e('0x9')]);}})[_0x0a9e('0xa')](function(_0x4a4c56){logger['error']('rpc','memberReport',_0x333808,_0x4a4c56,_0x432180);return _0x991246(_0x4a4c56);});});};module[_0x0a9e('0xb')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 2327999..a43456e 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 _0x2716=['idHopper','ContactFirstName','firstName','starttime','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','format','\x22%s\x22\x20<%s>','dialCutDigit','substring','exports','util','lodash','moment','isNil','string','voiceQueue','name','Contact','number','phone','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId'];(function(_0x4939b4,_0x2a61ce){var _0x423676=function(_0x16105a){while(--_0x16105a){_0x4939b4['push'](_0x4939b4['shift']());}};_0x423676(++_0x2a61ce);}(_0x2716,0xc5));var _0x6271=function(_0x4d04d6,_0x38ae19){_0x4d04d6=_0x4d04d6-0x0;var _0x2e937a=_0x2716[_0x4d04d6];return _0x2e937a;};'use strict';var util=require(_0x6271('0x0'));var _=require(_0x6271('0x1'));var moment=require(_0x6271('0x2'));function checkNameSurname(_0x35c983,_0x1c9c00,_0x5c9e5b){var _0x33aaa6='';if(!_[_0x6271('0x3')](_0x1c9c00)&&'string'===typeof _0x1c9c00){_0x33aaa6+=_0x1c9c00;}if(!_[_0x6271('0x3')](_0x5c9e5b)&&_0x6271('0x4')===typeof _0x5c9e5b){_0x33aaa6+='\x20'+_0x5c9e5b;}if(_0x33aaa6!==''){return _0x33aaa6;}return _0x35c983;}function Action(_0x12fbe1,_0x3d6e8d,_0x4bc37f){this[_0x6271('0x5')]=_0x12fbe1;this['uniqueid']=_0x4bc37f||undefined;this[_0x6271('0x6')]=checkNameSurname(_0x3d6e8d['Contact']['phone'],_0x3d6e8d[_0x6271('0x7')]['firstName'],_0x3d6e8d['Contact']['lastName']);this[_0x6271('0x8')]=_0x3d6e8d[_0x6271('0x7')][_0x6271('0x9')];this[_0x6271('0xa')]=_0x12fbe1[_0x6271('0x6')];this['active']=_0x3d6e8d[_0x6271('0xb')]||![];this[_0x6271('0xc')]=_0x12fbe1['type'];this[_0x6271('0xd')]=_0x12fbe1['dialQueueTimeout']||0x3;this[_0x6271('0xe')]=_0x3d6e8d['scheduledat'];this[_0x6271('0xf')]=_0x3d6e8d[_0x6271('0xf')];this[_0x6271('0x10')]=_0x3d6e8d[_0x6271('0x10')];this[_0x6271('0x11')]=_0x3d6e8d[_0x6271('0x11')];this[_0x6271('0x12')]=_0x3d6e8d[_0x6271('0x12')];this[_0x6271('0x13')]=_0x3d6e8d[_0x6271('0x13')];this[_0x6271('0x14')]=_0x3d6e8d[_0x6271('0x14')];this['countmachineretry']=_0x3d6e8d[_0x6271('0x15')];this['countagentrejectretry']=_0x3d6e8d[_0x6271('0x16')];this[_0x6271('0x17')]=_0x3d6e8d['ContactId'];this['ListId']=_0x3d6e8d[_0x6271('0x18')];this[_0x6271('0x19')]=_0x3d6e8d['UserId'];this[_0x6271('0x1a')]=_0x3d6e8d[_0x6271('0x1a')];this[_0x6271('0x1b')]=_0x3d6e8d['CampaignId'];this[_0x6271('0x1c')]=_0x3d6e8d['id'];this[_0x6271('0x1d')]=_0x3d6e8d[_0x6271('0x7')][_0x6271('0x1e')]||'';this[_0x6271('0x1f')]=moment()['format'](_0x6271('0x20'));this[_0x6271('0x21')]=_0x3d6e8d[_0x6271('0x21')];this['callbackuniqueid']=_0x3d6e8d[_0x6271('0x22')];this[_0x6271('0x23')]=_0x3d6e8d[_0x6271('0x23')];this[_0x6271('0x24')]=_0x3d6e8d[_0x6271('0x24')];this[_0x6271('0x25')]='';this[_0x6271('0x26')]='';}Action[_0x6271('0x27')]['getCaller']=function(){return util[_0x6271('0x28')](_0x6271('0x29'),this[_0x6271('0x6')],this[_0x6271('0x5')][_0x6271('0x2a')]>0x0?this[_0x6271('0x8')][_0x6271('0x2b')](this['voiceQueue'][_0x6271('0x2a')]):this['number']);};Action[_0x6271('0x27')]['getQueue']=function(){return this[_0x6271('0xa')];};module[_0x6271('0x2c')]=Action; \ No newline at end of file +var _0xfb0d=['string','uniqueid','name','phone','Contact','firstName','number','active','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ListId','UserId','VoiceQueueId','ContactFirstName','starttime','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','originatecalleridname','prototype','getCaller','format','\x22%s\x22\x20<%s>','voiceQueue','dialCutDigit','queue','util','lodash','moment','isNil'];(function(_0x1e6c19,_0x172e21){var _0xcda30a=function(_0xca0351){while(--_0xca0351){_0x1e6c19['push'](_0x1e6c19['shift']());}};_0xcda30a(++_0x172e21);}(_0xfb0d,0x1a9));var _0xdfb0=function(_0x2ec27c,_0x3ec8f8){_0x2ec27c=_0x2ec27c-0x0;var _0x31e322=_0xfb0d[_0x2ec27c];return _0x31e322;};'use strict';var util=require(_0xdfb0('0x0'));var _=require(_0xdfb0('0x1'));var moment=require(_0xdfb0('0x2'));function checkNameSurname(_0x1c0cd5,_0x28ee9d,_0x332b1a){var _0x49a202='';if(!_[_0xdfb0('0x3')](_0x28ee9d)&&_0xdfb0('0x4')===typeof _0x28ee9d){_0x49a202+=_0x28ee9d;}if(!_[_0xdfb0('0x3')](_0x332b1a)&&'string'===typeof _0x332b1a){_0x49a202+='\x20'+_0x332b1a;}if(_0x49a202!==''){return _0x49a202;}return _0x1c0cd5;}function Action(_0x1a1f1b,_0x2fc278,_0x1d1cb6){this['voiceQueue']=_0x1a1f1b;this[_0xdfb0('0x5')]=_0x1d1cb6||undefined;this[_0xdfb0('0x6')]=checkNameSurname(_0x2fc278['Contact'][_0xdfb0('0x7')],_0x2fc278[_0xdfb0('0x8')][_0xdfb0('0x9')],_0x2fc278['Contact']['lastName']);this[_0xdfb0('0xa')]=_0x2fc278[_0xdfb0('0x8')][_0xdfb0('0x7')];this['queue']=_0x1a1f1b['name'];this[_0xdfb0('0xb')]=_0x2fc278['active']||![];this['type']=_0x1a1f1b['type'];this[_0xdfb0('0xc')]=_0x1a1f1b[_0xdfb0('0xc')]||0x3;this[_0xdfb0('0xd')]=_0x2fc278[_0xdfb0('0xd')];this['countbusyretry']=_0x2fc278[_0xdfb0('0xe')];this[_0xdfb0('0xf')]=_0x2fc278['countcongestionretry'];this[_0xdfb0('0x10')]=_0x2fc278[_0xdfb0('0x10')];this[_0xdfb0('0x11')]=_0x2fc278['countnosuchnumberretry'];this[_0xdfb0('0x12')]=_0x2fc278[_0xdfb0('0x12')];this[_0xdfb0('0x13')]=_0x2fc278[_0xdfb0('0x13')];this['countmachineretry']=_0x2fc278[_0xdfb0('0x14')];this['countagentrejectretry']=_0x2fc278[_0xdfb0('0x15')];this['ContactId']=_0x2fc278['ContactId'];this[_0xdfb0('0x16')]=_0x2fc278[_0xdfb0('0x16')];this[_0xdfb0('0x17')]=_0x2fc278['UserId'];this[_0xdfb0('0x18')]=_0x2fc278[_0xdfb0('0x18')];this['CampaignId']=_0x2fc278['CampaignId'];this['idHopper']=_0x2fc278['id'];this[_0xdfb0('0x19')]=_0x2fc278[_0xdfb0('0x8')][_0xdfb0('0x9')]||'';this[_0xdfb0('0x1a')]=moment()['format'](_0xdfb0('0x1b'));this[_0xdfb0('0x1c')]=_0x2fc278[_0xdfb0('0x1c')];this['callbackuniqueid']=_0x2fc278[_0xdfb0('0x1d')];this[_0xdfb0('0x1e')]=_0x2fc278[_0xdfb0('0x1e')];this['recallme']=_0x2fc278['recallme'];this['originatecalleridnum']='';this[_0xdfb0('0x1f')]='';}Action[_0xdfb0('0x20')][_0xdfb0('0x21')]=function(){return util[_0xdfb0('0x22')](_0xdfb0('0x23'),this['name'],this[_0xdfb0('0x24')]['dialCutDigit']>0x0?this[_0xdfb0('0xa')]['substring'](this[_0xdfb0('0x24')][_0xdfb0('0x25')]):this[_0xdfb0('0xa')]);};Action[_0xdfb0('0x20')]['getQueue']=function(){return this[_0xdfb0('0x26')];};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 a1de9f1..386790d 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 _0x7752=['responsetime','answertime','endtime','format','ringtime','holdtime','talktime','reason','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','milliseconds','diff','seconds','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime'];(function(_0x202c61,_0x3673e0){var _0x540691=function(_0x409610){while(--_0x409610){_0x202c61['push'](_0x202c61['shift']());}};_0x540691(++_0x3673e0);}(_0x7752,0x92));var _0x2775=function(_0x23fb5b,_0x1b20ce){_0x23fb5b=_0x23fb5b-0x0;var _0x5630c0=_0x7752[_0x23fb5b];return _0x5630c0;};'use strict';var util=require(_0x2775('0x0'));var _=require(_0x2775('0x1'));var moment=require('moment');function getSeconds(_0x2d01a2,_0x205003){var _0x110e43=moment(_0x2d01a2)[_0x2775('0x2')](0x0);var _0x363e68=moment(_0x205003)[_0x2775('0x2')](0x0);return _0x110e43[_0x2775('0x3')](_0x363e68,_0x2775('0x4'));}function AgentComplete(_0x4066bc,_0x17792b){this['state']=0x4;this['statedesc']=_0x2775('0x5');this[_0x2775('0x6')]=_0x4066bc[_0x2775('0x6')];this[_0x2775('0x7')]=_0x4066bc[_0x2775('0x7')];this[_0x2775('0x8')]=_0x4066bc[_0x2775('0x7')]===_0x2775('0x9')?_0x2775('0xa'):_0x4066bc[_0x2775('0x7')];this[_0x2775('0xb')]=_0x4066bc[_0x2775('0xb')];this['countcongestionretry']=_0x4066bc[_0x2775('0xc')];this[_0x2775('0xd')]=_0x4066bc[_0x2775('0xd')];this[_0x2775('0xe')]=_0x4066bc['countbusyretry']+_0x4066bc[_0x2775('0xc')]+_0x4066bc[_0x2775('0xd')]+_0x4066bc[_0x2775('0xf')]+_0x4066bc[_0x2775('0x10')]+_0x4066bc[_0x2775('0x11')]+_0x4066bc[_0x2775('0x12')]+_0x4066bc[_0x2775('0x13')];this['countnosuchnumberretry']=_0x4066bc[_0x2775('0xf')];this[_0x2775('0x10')]=_0x4066bc[_0x2775('0x10')];this[_0x2775('0x11')]=_0x4066bc[_0x2775('0x11')];this[_0x2775('0x12')]=_0x4066bc[_0x2775('0x12')];this['countagentrejectretry']=_0x4066bc['countagentrejectretry'];this['uniqueid']=_0x17792b[_0x2775('0x14')];this[_0x2775('0x15')]=_0x4066bc[_0x2775('0x16')];this[_0x2775('0x17')]=_0x4066bc[_0x2775('0x18')];this[_0x2775('0x19')]=_0x4066bc[_0x2775('0x19')];this['responsetime']=_0x4066bc[_0x2775('0x1a')];this[_0x2775('0x1b')]=_0x4066bc[_0x2775('0x1b')];this[_0x2775('0x1c')]=moment()[_0x2775('0x1d')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x2775('0x1e')]=getSeconds(_0x4066bc['responsetime'],_0x4066bc[_0x2775('0x19')]);this[_0x2775('0x1f')]=getSeconds(_0x4066bc[_0x2775('0x1b')],_0x4066bc[_0x2775('0x1a')]);this[_0x2775('0x20')]=getSeconds(this[_0x2775('0x1c')],_0x4066bc['answertime']);this['queue']=_0x17792b[_0x2775('0xa')];this['membername']=_0x17792b['membername'];this['reason']=_0x17792b[_0x2775('0x21')];this['callback']=_0x4066bc['callback'];this[_0x2775('0x22')]=_0x4066bc['callbackuniqueid'];this[_0x2775('0x23')]=_0x4066bc[_0x2775('0x23')];this['recallme']=_0x4066bc[_0x2775('0x24')];this[_0x2775('0x25')]=_0x4066bc[_0x2775('0x25')];this[_0x2775('0x26')]=_0x4066bc['ListId'];this['UserId']=_0x4066bc['UserId'];this[_0x2775('0x27')]=_0x4066bc['VoiceQueueId'];this['CampaignId']=_0x4066bc[_0x2775('0x28')];this[_0x2775('0x29')]=_0x4066bc[_0x2775('0x29')]||'';this['originatecalleridname']=_0x4066bc[_0x2775('0x2a')]||'';}module['exports']=AgentComplete; \ No newline at end of file +var _0xadd8=['ringtime','holdtime','talktime','endtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','scheduledat','type','campaigntype','queue','countbusyretry','countnoanswerretry','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','answertime','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x509da1,_0x9e7178){var _0x2f5867=function(_0x1ce539){while(--_0x1ce539){_0x509da1['push'](_0x509da1['shift']());}};_0x2f5867(++_0x9e7178);}(_0xadd8,0x6e));var _0x8add=function(_0x2cb646,_0x1cb99e){_0x2cb646=_0x2cb646-0x0;var _0x6fe04d=_0xadd8[_0x2cb646];return _0x6fe04d;};'use strict';var util=require(_0x8add('0x0'));var _=require(_0x8add('0x1'));var moment=require(_0x8add('0x2'));function getSeconds(_0x4a9940,_0x2fdb07){var _0x2d041f=moment(_0x4a9940)[_0x8add('0x3')](0x0);var _0x516e05=moment(_0x2fdb07)[_0x8add('0x3')](0x0);return _0x2d041f[_0x8add('0x4')](_0x516e05,_0x8add('0x5'));}function AgentComplete(_0x34d392,_0x8136d9){this[_0x8add('0x6')]=0x4;this[_0x8add('0x7')]='Answer';this[_0x8add('0x8')]=_0x34d392['scheduledat'];this[_0x8add('0x9')]=_0x34d392['type'];this[_0x8add('0xa')]=_0x34d392[_0x8add('0x9')]==='outbound'?_0x8add('0xb'):_0x34d392[_0x8add('0x9')];this[_0x8add('0xc')]=_0x34d392[_0x8add('0xc')];this['countcongestionretry']=_0x34d392['countcongestionretry'];this[_0x8add('0xd')]=_0x34d392['countnoanswerretry'];this['countglobal']=_0x34d392[_0x8add('0xc')]+_0x34d392[_0x8add('0xe')]+_0x34d392[_0x8add('0xd')]+_0x34d392[_0x8add('0xf')]+_0x34d392[_0x8add('0x10')]+_0x34d392[_0x8add('0x11')]+_0x34d392[_0x8add('0x12')]+_0x34d392[_0x8add('0x13')];this[_0x8add('0xf')]=_0x34d392[_0x8add('0xf')];this['countdropretry']=_0x34d392[_0x8add('0x10')];this['countabandonedretry']=_0x34d392['countabandonedretry'];this[_0x8add('0x12')]=_0x34d392[_0x8add('0x12')];this[_0x8add('0x13')]=_0x34d392[_0x8add('0x13')];this['uniqueid']=_0x8136d9[_0x8add('0x14')];this[_0x8add('0x15')]=_0x34d392['name'];this[_0x8add('0x16')]=_0x34d392[_0x8add('0x17')];this[_0x8add('0x18')]=_0x34d392[_0x8add('0x18')];this[_0x8add('0x19')]=_0x34d392[_0x8add('0x19')];this[_0x8add('0x1a')]=_0x34d392[_0x8add('0x1a')];this['endtime']=moment()['format'](_0x8add('0x1b'));this[_0x8add('0x1c')]=getSeconds(_0x34d392['responsetime'],_0x34d392['starttime']);this[_0x8add('0x1d')]=getSeconds(_0x34d392[_0x8add('0x1a')],_0x34d392[_0x8add('0x19')]);this[_0x8add('0x1e')]=getSeconds(this[_0x8add('0x1f')],_0x34d392['answertime']);this[_0x8add('0xb')]=_0x8136d9['queue'];this['membername']=_0x8136d9[_0x8add('0x20')];this[_0x8add('0x21')]=_0x8136d9[_0x8add('0x21')];this[_0x8add('0x22')]=_0x34d392[_0x8add('0x22')];this['callbackuniqueid']=_0x34d392[_0x8add('0x23')];this['callbackat']=_0x34d392[_0x8add('0x24')];this[_0x8add('0x25')]=_0x34d392[_0x8add('0x25')];this[_0x8add('0x26')]=_0x34d392[_0x8add('0x26')];this[_0x8add('0x27')]=_0x34d392[_0x8add('0x27')];this[_0x8add('0x28')]=_0x34d392[_0x8add('0x28')];this[_0x8add('0x29')]=_0x34d392[_0x8add('0x29')];this[_0x8add('0x2a')]=_0x34d392['CampaignId'];this[_0x8add('0x2b')]=_0x34d392['originatecalleridnum']||'';this[_0x8add('0x2c')]=_0x34d392[_0x8add('0x2c')]||'';}module[_0x8add('0x2d')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 7e8f89c..d4fdfbd 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 _0xed95=['UserId','VoiceQueueId','CampaignId','originatecalleridnum','exports','util','lodash','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','queue','calleridname','calleridnum','responsetime','endtime','ringtime','holdtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId'];(function(_0xfb0cfd,_0x500179){var _0x2fd8aa=function(_0xccb501){while(--_0xccb501){_0xfb0cfd['push'](_0xfb0cfd['shift']());}};_0x2fd8aa(++_0x500179);}(_0xed95,0xb9));var _0x5ed9=function(_0x1a756e,_0x52cae9){_0x1a756e=_0x1a756e-0x0;var _0x51baa3=_0xed95[_0x1a756e];return _0x51baa3;};'use strict';var util=require(_0x5ed9('0x0'));var _=require(_0x5ed9('0x1'));var moment=require(_0x5ed9('0x2'));function getSeconds(_0x1f8d72,_0x43e62c){var _0x7b6960=moment(_0x1f8d72)[_0x5ed9('0x3')](0x0);var _0x3e2272=moment(_0x43e62c)[_0x5ed9('0x3')](0x0);return _0x7b6960[_0x5ed9('0x4')](_0x3e2272,_0x5ed9('0x5'));}function Final(_0x15b734){this['uniqueid']=_0x15b734['uniqueid'];this[_0x5ed9('0x6')]=_0x15b734[_0x5ed9('0x6')];this[_0x5ed9('0x7')]=_0x15b734[_0x5ed9('0x7')];this[_0x5ed9('0x8')]=_0x15b734[_0x5ed9('0x7')]==='outbound'?'queue':_0x15b734[_0x5ed9('0x7')];this[_0x5ed9('0x9')]=_0x15b734[_0x5ed9('0x9')];this[_0x5ed9('0xa')]=_0x15b734['countcongestionretry'];this['countnoanswerretry']=_0x15b734[_0x5ed9('0xb')];this[_0x5ed9('0xc')]=_0x15b734[_0x5ed9('0x9')]+_0x15b734[_0x5ed9('0xa')]+_0x15b734['countnoanswerretry']+_0x15b734[_0x5ed9('0xd')]+_0x15b734[_0x5ed9('0xe')]+_0x15b734[_0x5ed9('0xf')]+_0x15b734['countmachineretry']+_0x15b734['countagentrejectretry'];this[_0x5ed9('0xd')]=_0x15b734[_0x5ed9('0xd')];this['countdropretry']=_0x15b734[_0x5ed9('0xe')];this[_0x5ed9('0xf')]=_0x15b734['countabandonedretry'];this['countmachineretry']=_0x15b734[_0x5ed9('0x10')];this[_0x5ed9('0x11')]=_0x15b734['countagentrejectretry'];this[_0x5ed9('0x12')]=_0x15b734[_0x5ed9('0x12')];this['calleridname']=_0x15b734[_0x5ed9('0x13')];this[_0x5ed9('0x14')]=_0x15b734['calleridnum'];this['starttime']=_0x15b734['starttime'];this['responsetime']=_0x15b734[_0x5ed9('0x15')];this[_0x5ed9('0x16')]=_0x15b734[_0x5ed9('0x15')];this[_0x5ed9('0x17')]=_0x15b734['ringtime']||0x0;this[_0x5ed9('0x18')]=_0x15b734[_0x5ed9('0x18')]||0x0;this['talktime']=_0x15b734['talktime']||0x0;this['callback']=_0x15b734[_0x5ed9('0x19')];this[_0x5ed9('0x1a')]=_0x15b734['callbackuniqueid'];this[_0x5ed9('0x1b')]=_0x15b734[_0x5ed9('0x1b')];this[_0x5ed9('0x1c')]=_0x15b734[_0x5ed9('0x1c')];this['ContactId']=_0x15b734[_0x5ed9('0x1d')];this[_0x5ed9('0x1e')]=_0x15b734[_0x5ed9('0x1e')];this[_0x5ed9('0x1f')]=_0x15b734[_0x5ed9('0x1f')];this[_0x5ed9('0x20')]=_0x15b734['VoiceQueueId'];this['CampaignId']=_0x15b734[_0x5ed9('0x21')];this[_0x5ed9('0x22')]=_0x15b734[_0x5ed9('0x22')]||'';this['originatecalleridname']=_0x15b734['originatecalleridname']||'';}module[_0x5ed9('0x23')]=Final; \ No newline at end of file +var _0x032e=['countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry'];(function(_0x2009c3,_0x50f092){var _0x3e3dcf=function(_0x5ac4c7){while(--_0x5ac4c7){_0x2009c3['push'](_0x2009c3['shift']());}};_0x3e3dcf(++_0x50f092);}(_0x032e,0x124));var _0xe032=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x032e[_0x5b644e];return _0x49c6bf;};'use strict';var util=require(_0xe032('0x0'));var _=require('lodash');var moment=require(_0xe032('0x1'));function getSeconds(_0x1cf95c,_0x5ca562){var _0x4afba2=moment(_0x1cf95c)[_0xe032('0x2')](0x0);var _0x2ce001=moment(_0x5ca562)[_0xe032('0x2')](0x0);return _0x4afba2[_0xe032('0x3')](_0x2ce001,_0xe032('0x4'));}function Final(_0x420020){this[_0xe032('0x5')]=_0x420020[_0xe032('0x5')];this[_0xe032('0x6')]=_0x420020[_0xe032('0x6')];this[_0xe032('0x7')]=_0x420020[_0xe032('0x7')];this[_0xe032('0x8')]=_0x420020[_0xe032('0x7')]===_0xe032('0x9')?_0xe032('0xa'):_0x420020[_0xe032('0x7')];this[_0xe032('0xb')]=_0x420020['countbusyretry'];this[_0xe032('0xc')]=_0x420020[_0xe032('0xc')];this[_0xe032('0xd')]=_0x420020[_0xe032('0xd')];this[_0xe032('0xe')]=_0x420020[_0xe032('0xb')]+_0x420020[_0xe032('0xc')]+_0x420020['countnoanswerretry']+_0x420020[_0xe032('0xf')]+_0x420020[_0xe032('0x10')]+_0x420020[_0xe032('0x11')]+_0x420020[_0xe032('0x12')]+_0x420020['countagentrejectretry'];this[_0xe032('0xf')]=_0x420020[_0xe032('0xf')];this[_0xe032('0x10')]=_0x420020[_0xe032('0x10')];this[_0xe032('0x11')]=_0x420020[_0xe032('0x11')];this[_0xe032('0x12')]=_0x420020['countmachineretry'];this[_0xe032('0x13')]=_0x420020[_0xe032('0x13')];this[_0xe032('0xa')]=_0x420020[_0xe032('0xa')];this[_0xe032('0x14')]=_0x420020[_0xe032('0x14')];this['calleridnum']=_0x420020[_0xe032('0x15')];this[_0xe032('0x16')]=_0x420020[_0xe032('0x16')];this[_0xe032('0x17')]=_0x420020[_0xe032('0x17')];this['endtime']=_0x420020['responsetime'];this['ringtime']=_0x420020[_0xe032('0x18')]||0x0;this['holdtime']=_0x420020[_0xe032('0x19')]||0x0;this[_0xe032('0x1a')]=_0x420020[_0xe032('0x1a')]||0x0;this[_0xe032('0x1b')]=_0x420020[_0xe032('0x1b')];this[_0xe032('0x1c')]=_0x420020[_0xe032('0x1c')];this['callbackat']=_0x420020[_0xe032('0x1d')];this[_0xe032('0x1e')]=_0x420020[_0xe032('0x1e')];this[_0xe032('0x1f')]=_0x420020[_0xe032('0x1f')];this[_0xe032('0x20')]=_0x420020[_0xe032('0x20')];this[_0xe032('0x21')]=_0x420020['UserId'];this['VoiceQueueId']=_0x420020['VoiceQueueId'];this[_0xe032('0x22')]=_0x420020[_0xe032('0x22')];this[_0xe032('0x23')]=_0x420020[_0xe032('0x23')]||'';this[_0xe032('0x24')]=_0x420020[_0xe032('0x24')]||'';}module[_0xe032('0x25')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index e05a63b..2530d50 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 _0x7c8f=['Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','seconds','state','statedesc'];(function(_0x3f82bf,_0x56aea4){var _0x289395=function(_0x4efb38){while(--_0x4efb38){_0x3f82bf['push'](_0x3f82bf['shift']());}};_0x289395(++_0x56aea4);}(_0x7c8f,0x114));var _0xf7c8=function(_0x27c152,_0xfaae26){_0x27c152=_0x27c152-0x0;var _0x1fafa1=_0x7c8f[_0x27c152];return _0x1fafa1;};'use strict';var util=require(_0xf7c8('0x0'));var _=require(_0xf7c8('0x1'));var moment=require(_0xf7c8('0x2'));function getSeconds(_0x456371,_0x2f47c0){var _0x49ed38=moment(_0x456371)['milliseconds'](0x0);var _0x58d8f0=moment(_0x2f47c0)['milliseconds'](0x0);return _0x49ed38['diff'](_0x58d8f0,_0xf7c8('0x3'));}function Hangup(_0x312ca8,_0x392565){this[_0xf7c8('0x4')]=0x4;this[_0xf7c8('0x5')]=_0xf7c8('0x6');this['scheduledat']=_0x312ca8[_0xf7c8('0x7')];this[_0xf7c8('0x8')]=_0x312ca8[_0xf7c8('0x8')];this[_0xf7c8('0x9')]=_0x312ca8['type']===_0xf7c8('0xa')?_0xf7c8('0xb'):_0x312ca8[_0xf7c8('0x8')];this[_0xf7c8('0xc')]=_0x312ca8[_0xf7c8('0xc')];this[_0xf7c8('0xd')]=_0x312ca8[_0xf7c8('0xd')];this[_0xf7c8('0xe')]=_0x312ca8[_0xf7c8('0xe')];this[_0xf7c8('0xf')]=_0x312ca8[_0xf7c8('0xc')]+_0x312ca8[_0xf7c8('0xd')]+_0x312ca8['countnoanswerretry']+_0x312ca8[_0xf7c8('0x10')]+_0x312ca8[_0xf7c8('0x11')]+_0x312ca8[_0xf7c8('0x12')]+_0x312ca8[_0xf7c8('0x13')]+_0x312ca8[_0xf7c8('0x14')];this['countnosuchnumberretry']=_0x312ca8['countnosuchnumberretry'];this[_0xf7c8('0x11')]=_0x312ca8[_0xf7c8('0x11')];this['countabandonedretry']=_0x312ca8[_0xf7c8('0x12')];this[_0xf7c8('0x13')]=_0x312ca8[_0xf7c8('0x13')];this['countagentrejectretry']=_0x312ca8['countagentrejectretry'];this[_0xf7c8('0x15')]=_0x392565['uniqueid'];this[_0xf7c8('0x16')]=_0x312ca8[_0xf7c8('0x17')];this[_0xf7c8('0x18')]=_0x312ca8[_0xf7c8('0x19')];this[_0xf7c8('0x1a')]=_0x312ca8[_0xf7c8('0x1a')];this[_0xf7c8('0x1b')]=_0x312ca8[_0xf7c8('0x1b')];this[_0xf7c8('0x1c')]=moment()[_0xf7c8('0x1d')](_0xf7c8('0x1e'));this[_0xf7c8('0x1f')]=getSeconds(_0x312ca8[_0xf7c8('0x1b')],_0x312ca8[_0xf7c8('0x1a')]);this[_0xf7c8('0x20')]=0x0;this[_0xf7c8('0x21')]=getSeconds(this[_0xf7c8('0x1c')],_0x312ca8[_0xf7c8('0x1b')]);this['queue']=_0x312ca8[_0xf7c8('0xb')];this['membername']=_0xf7c8('0x22');this[_0xf7c8('0x23')]=_0x392565[_0xf7c8('0x24')];this[_0xf7c8('0x25')]=_0x312ca8[_0xf7c8('0x25')];this[_0xf7c8('0x26')]=_0x312ca8[_0xf7c8('0x26')];this[_0xf7c8('0x27')]=_0x312ca8[_0xf7c8('0x27')];this[_0xf7c8('0x28')]=_0x312ca8[_0xf7c8('0x28')];this[_0xf7c8('0x29')]=_0x312ca8[_0xf7c8('0x29')];this[_0xf7c8('0x2a')]=_0x312ca8[_0xf7c8('0x2a')];this[_0xf7c8('0x2b')]=_0x312ca8[_0xf7c8('0x2b')];this[_0xf7c8('0x2c')]=_0x312ca8[_0xf7c8('0x2c')];this[_0xf7c8('0x2d')]=_0x312ca8['CampaignId'];}module[_0xf7c8('0x2e')]=Hangup; \ No newline at end of file +var _0x9a4f=['campaigntype','outbound','queue','type','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','membername','IVR','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','state','statedesc','scheduledat'];(function(_0x11c573,_0x9e7c6e){var _0x6b72de=function(_0x2e8a61){while(--_0x2e8a61){_0x11c573['push'](_0x11c573['shift']());}};_0x6b72de(++_0x9e7c6e);}(_0x9a4f,0xa8));var _0xf9a4=function(_0xd3e16a,_0x28517e){_0xd3e16a=_0xd3e16a-0x0;var _0x449538=_0x9a4f[_0xd3e16a];return _0x449538;};'use strict';var util=require(_0xf9a4('0x0'));var _=require(_0xf9a4('0x1'));var moment=require(_0xf9a4('0x2'));function getSeconds(_0x207839,_0x3c4ffa){var _0x556374=moment(_0x207839)['milliseconds'](0x0);var _0x260fa2=moment(_0x3c4ffa)[_0xf9a4('0x3')](0x0);return _0x556374[_0xf9a4('0x4')](_0x260fa2,'seconds');}function Hangup(_0x30ed18,_0x5653cf){this[_0xf9a4('0x5')]=0x4;this[_0xf9a4('0x6')]='Answer';this[_0xf9a4('0x7')]=_0x30ed18[_0xf9a4('0x7')];this['type']=_0x30ed18['type'];this[_0xf9a4('0x8')]=_0x30ed18['type']===_0xf9a4('0x9')?_0xf9a4('0xa'):_0x30ed18[_0xf9a4('0xb')];this[_0xf9a4('0xc')]=_0x30ed18['countbusyretry'];this[_0xf9a4('0xd')]=_0x30ed18[_0xf9a4('0xd')];this[_0xf9a4('0xe')]=_0x30ed18['countnoanswerretry'];this[_0xf9a4('0xf')]=_0x30ed18['countbusyretry']+_0x30ed18[_0xf9a4('0xd')]+_0x30ed18[_0xf9a4('0xe')]+_0x30ed18[_0xf9a4('0x10')]+_0x30ed18[_0xf9a4('0x11')]+_0x30ed18['countabandonedretry']+_0x30ed18[_0xf9a4('0x12')]+_0x30ed18[_0xf9a4('0x13')];this[_0xf9a4('0x10')]=_0x30ed18[_0xf9a4('0x10')];this[_0xf9a4('0x11')]=_0x30ed18[_0xf9a4('0x11')];this['countabandonedretry']=_0x30ed18['countabandonedretry'];this[_0xf9a4('0x12')]=_0x30ed18[_0xf9a4('0x12')];this[_0xf9a4('0x13')]=_0x30ed18[_0xf9a4('0x13')];this[_0xf9a4('0x14')]=_0x5653cf['uniqueid'];this[_0xf9a4('0x15')]=_0x30ed18[_0xf9a4('0x16')];this[_0xf9a4('0x17')]=_0x30ed18[_0xf9a4('0x18')];this[_0xf9a4('0x19')]=_0x30ed18[_0xf9a4('0x19')];this[_0xf9a4('0x1a')]=_0x30ed18[_0xf9a4('0x1a')];this[_0xf9a4('0x1b')]=moment()['format'](_0xf9a4('0x1c'));this['ringtime']=getSeconds(_0x30ed18[_0xf9a4('0x1a')],_0x30ed18[_0xf9a4('0x19')]);this[_0xf9a4('0x1d')]=0x0;this[_0xf9a4('0x1e')]=getSeconds(this['endtime'],_0x30ed18['responsetime']);this['queue']=_0x30ed18['queue'];this[_0xf9a4('0x1f')]=_0xf9a4('0x20');this['reason']=_0x5653cf[_0xf9a4('0x21')];this[_0xf9a4('0x22')]=_0x30ed18[_0xf9a4('0x22')];this['callbackuniqueid']=_0x30ed18[_0xf9a4('0x23')];this['callbackat']=_0x30ed18[_0xf9a4('0x24')];this[_0xf9a4('0x25')]=_0x30ed18['recallme'];this[_0xf9a4('0x26')]=_0x30ed18[_0xf9a4('0x26')];this[_0xf9a4('0x27')]=_0x30ed18[_0xf9a4('0x27')];this[_0xf9a4('0x28')]=_0x30ed18[_0xf9a4('0x28')];this[_0xf9a4('0x29')]=_0x30ed18[_0xf9a4('0x29')];this[_0xf9a4('0x2a')]=_0x30ed18[_0xf9a4('0x2a')];}module[_0xf9a4('0x2b')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index c8f1be9..9b979ab 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 _0xb935=['UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId'];(function(_0x125092,_0x20b0ab){var _0x879f3e=function(_0x43232a){while(--_0x43232a){_0x125092['push'](_0x125092['shift']());}};_0x879f3e(++_0x20b0ab);}(_0xb935,0x1da));var _0x5b93=function(_0x1ef230,_0x24bdeb){_0x1ef230=_0x1ef230-0x0;var _0x2d57ba=_0xb935[_0x1ef230];return _0x2d57ba;};'use strict';var util=require('util');var _=require(_0x5b93('0x0'));var moment=require(_0x5b93('0x1'));function getSeconds(_0x2b556b,_0x9f4d66){var _0x1be7f=moment(_0x2b556b)[_0x5b93('0x2')](0x0);var _0x1a34f3=moment(_0x9f4d66)[_0x5b93('0x2')](0x0);return _0x1be7f[_0x5b93('0x3')](_0x1a34f3,_0x5b93('0x4'));}function History(_0x1f3157){this['uniqueid']=_0x1f3157['uniqueid'];this[_0x5b93('0x5')]=_0x1f3157['scheduledat']||undefined;this[_0x5b93('0x6')]=_0x1f3157[_0x5b93('0x6')];this[_0x5b93('0x7')]=_0x1f3157[_0x5b93('0x6')]===_0x5b93('0x8')?_0x5b93('0x9'):_0x1f3157[_0x5b93('0x6')];this[_0x5b93('0xa')]=_0x1f3157[_0x5b93('0xa')];this[_0x5b93('0xb')]=_0x1f3157[_0x5b93('0xb')];this['countnoanswerretry']=_0x1f3157[_0x5b93('0xc')];this['countglobal']=_0x1f3157['countbusyretry']+_0x1f3157[_0x5b93('0xb')]+_0x1f3157[_0x5b93('0xc')]+_0x1f3157[_0x5b93('0xd')]+_0x1f3157[_0x5b93('0xe')]+_0x1f3157['countabandonedretry']+_0x1f3157['countmachineretry']+_0x1f3157['countagentrejectretry'];this[_0x5b93('0xd')]=_0x1f3157[_0x5b93('0xd')];this[_0x5b93('0xe')]=_0x1f3157['countdropretry'];this['countabandonedretry']=_0x1f3157['countabandonedretry'];this[_0x5b93('0xf')]=_0x1f3157['countmachineretry'];this[_0x5b93('0x10')]=_0x1f3157[_0x5b93('0x10')];this[_0x5b93('0x9')]=_0x1f3157[_0x5b93('0x9')];this[_0x5b93('0x11')]=_0x1f3157['name'];this[_0x5b93('0x12')]=_0x1f3157['number'];this[_0x5b93('0x13')]=_0x1f3157[_0x5b93('0x13')];this[_0x5b93('0x14')]=_0x1f3157['responsetime'];this[_0x5b93('0x15')]=_0x1f3157['responsetime'];this[_0x5b93('0x16')]=getSeconds(_0x1f3157[_0x5b93('0x14')],_0x1f3157[_0x5b93('0x13')]);this[_0x5b93('0x17')]=0x0;this[_0x5b93('0x18')]=0x0;this['callback']=_0x1f3157[_0x5b93('0x19')];this['callbackuniqueid']=_0x1f3157[_0x5b93('0x1a')];this[_0x5b93('0x1b')]=_0x1f3157[_0x5b93('0x1b')];this[_0x5b93('0x1c')]=_0x1f3157[_0x5b93('0x1c')];this[_0x5b93('0x1d')]=_0x1f3157[_0x5b93('0x1d')];this['ListId']=_0x1f3157['ListId'];this['UserId']=_0x1f3157[_0x5b93('0x1e')];this[_0x5b93('0x1f')]=_0x1f3157[_0x5b93('0x1f')];this[_0x5b93('0x20')]=_0x1f3157[_0x5b93('0x20')];this[_0x5b93('0x21')]=_0x1f3157[_0x5b93('0x21')]||'';this[_0x5b93('0x22')]=_0x1f3157[_0x5b93('0x22')]||'';}module[_0x5b93('0x23')]=History; \ No newline at end of file +var _0x1305=['calleridname','calleridnum','number','responsetime','endtime','ringtime','starttime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','scheduledat','campaigntype','type','outbound','queue','countbusyretry','countnoanswerretry','countcongestionretry','countdropretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countabandonedretry'];(function(_0x5f3057,_0x4b72da){var _0x3f985d=function(_0x54b6e1){while(--_0x54b6e1){_0x5f3057['push'](_0x5f3057['shift']());}};_0x3f985d(++_0x4b72da);}(_0x1305,0x1aa));var _0x5130=function(_0x22b1af,_0x2b868d){_0x22b1af=_0x22b1af-0x0;var _0xca7ce1=_0x1305[_0x22b1af];return _0xca7ce1;};'use strict';var util=require(_0x5130('0x0'));var _=require(_0x5130('0x1'));var moment=require(_0x5130('0x2'));function getSeconds(_0x2f7fe4,_0x5bb4ef){var _0xb8d0b7=moment(_0x2f7fe4)[_0x5130('0x3')](0x0);var _0x5d5d15=moment(_0x5bb4ef)[_0x5130('0x3')](0x0);return _0xb8d0b7[_0x5130('0x4')](_0x5d5d15,'seconds');}function History(_0x41cdb1){this['uniqueid']=_0x41cdb1['uniqueid'];this['scheduledat']=_0x41cdb1[_0x5130('0x5')]||undefined;this['type']=_0x41cdb1['type'];this[_0x5130('0x6')]=_0x41cdb1[_0x5130('0x7')]===_0x5130('0x8')?_0x5130('0x9'):_0x41cdb1[_0x5130('0x7')];this[_0x5130('0xa')]=_0x41cdb1[_0x5130('0xa')];this['countcongestionretry']=_0x41cdb1['countcongestionretry'];this[_0x5130('0xb')]=_0x41cdb1['countnoanswerretry'];this['countglobal']=_0x41cdb1[_0x5130('0xa')]+_0x41cdb1[_0x5130('0xc')]+_0x41cdb1[_0x5130('0xb')]+_0x41cdb1['countnosuchnumberretry']+_0x41cdb1[_0x5130('0xd')]+_0x41cdb1['countabandonedretry']+_0x41cdb1[_0x5130('0xe')]+_0x41cdb1[_0x5130('0xf')];this[_0x5130('0x10')]=_0x41cdb1[_0x5130('0x10')];this[_0x5130('0xd')]=_0x41cdb1[_0x5130('0xd')];this['countabandonedretry']=_0x41cdb1[_0x5130('0x11')];this[_0x5130('0xe')]=_0x41cdb1[_0x5130('0xe')];this[_0x5130('0xf')]=_0x41cdb1['countagentrejectretry'];this['queue']=_0x41cdb1[_0x5130('0x9')];this[_0x5130('0x12')]=_0x41cdb1['name'];this[_0x5130('0x13')]=_0x41cdb1[_0x5130('0x14')];this['starttime']=_0x41cdb1['starttime'];this[_0x5130('0x15')]=_0x41cdb1[_0x5130('0x15')];this[_0x5130('0x16')]=_0x41cdb1['responsetime'];this[_0x5130('0x17')]=getSeconds(_0x41cdb1[_0x5130('0x15')],_0x41cdb1[_0x5130('0x18')]);this[_0x5130('0x19')]=0x0;this[_0x5130('0x1a')]=0x0;this[_0x5130('0x1b')]=_0x41cdb1[_0x5130('0x1b')];this[_0x5130('0x1c')]=_0x41cdb1[_0x5130('0x1c')];this[_0x5130('0x1d')]=_0x41cdb1['callbackat'];this['recallme']=_0x41cdb1[_0x5130('0x1e')];this[_0x5130('0x1f')]=_0x41cdb1[_0x5130('0x1f')];this['ListId']=_0x41cdb1['ListId'];this['UserId']=_0x41cdb1['UserId'];this[_0x5130('0x20')]=_0x41cdb1[_0x5130('0x20')];this[_0x5130('0x21')]=_0x41cdb1[_0x5130('0x21')];this['originatecalleridnum']=_0x41cdb1[_0x5130('0x22')]||'';this[_0x5130('0x23')]=_0x41cdb1['originatecalleridname']||'';}module[_0x5130('0x24')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 5998c02..03ba130 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 _0x0930=['emptyContact','notFound','saveInDb','pick','ContactId','ListId','UserId','VoiceQueueId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','SIP/%s','unmonitored','uniqueid','isNil','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','membername','AMD','custom:amd','buildObj','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','statedesc','Machine','countglobal','amd','[syncAgentComplete][createHistory][0]','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','reason\x2019\x20machine....','dialMachineRetryFrequency','YYYY-MM-DD\x20HH:mm:ss','CampaignId','[rescheduleContact][Machine]','HangupInAMD','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countbusyretry','createStateFinal','add','minutes','syncHangup','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AGI','cause-txt','Unknow','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','Drop','dropreason','TIMEOUT','countdropretry','dialDropRetryFrequency','starttime','endtime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','outboundDropCallsDayCallersExit','Abandoned','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','actionid','strategy','locked','paused','stateinterface','push','idHopper','queueStatusComplete','[booked][unlockQueueStatus]','run','_rr','unlockRR','[booked][RR]','Agent:\x20','[Catch][Preview][syncQueueStatusComplete]','contactAgent-idHopper:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','timezones','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','interval','content','indexOf','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','Timezone:\x20','checkDialMethod','dialMethod','power','handlePower','predictive','Queue','method\x20not\x20recognized','checkPreviewRecallReminder','handlePreviewRecallNotifications','user:dialPreviewRecallReminder','launchHandleIvr','handleIvr','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','[syncQueueSummary]','dialPreviewRecallmeReminder','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','actionOriginate','object','originate','Contact','phone','contact\x20is\x20undefine','getCaller','NONE','\x22agi://%s/square,%s\x22','\x22%s,%s%s,,,%s\x22','dialQueueOptions','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','XMD-AMDAFTERGREETINGSILENCE','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','createdAt','updatedAt','%s%s','dialOriginateCallerIdNumber','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','response','callProgressDetecting','[callProgressDetecting]\x20','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialDropMaxRetry','[rescheduleContact][Drop]','[rescheduleContact][Abandoned]','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','checkRetriveMax','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','dialBusyMaxRetry','reason\x205\x20busy','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','agentreject','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at',')\x20are\x20less\x20than\x20threshold\x20(','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','dialPredictiveOptimization','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','outboundQueuePauses','[CatchErlangB]','floor','one\x20call\x20every:','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','queueStatusComplete:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','scheduledat','Agent','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','Contact.phone','loggerHandler','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','reachable','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','exports','util','uuid','moment','../preview/util/util','../../../config/logger','dialer','booked','predictiveCalls','syncQueueSummary','../ami','redis','localhost','../rpc/cmHopper','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/setting','./action','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','enqueue','tail','finally','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','queueBooked','queueBookedRR','syncAgentConnect','bind','queuecallerabandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','getSettings','then','isUndefined','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','message','INTERVAL_IS_NULL','Intervals','\x20INTERVAL_IS_NULL','isEmpty','Error','stringify','milliseconds','diff','emit','type','outbound','answered','available','loggedIn','pTalking','sumBillable','sumDuration','unmanaged','waiting','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','md5','format','voice:queue:%s','ivr','campaign:ivr:%s','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\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','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','predictiveIntervalAvgHoldtime','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','preview','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','inspect','error','length','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','contactsRescheduled','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','talking','[syncQueueSummary]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','state','loopClearZombieChannels','clearZombieChannels','[uniqueid]','actions','sequence','Action','status','channel','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','resolve','countReScheduled','catch','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','unlockContact','[unlockContact]\x20','getContactDialer','temp','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','createHistory','[updateOriginated]\x20object\x20originated\x20is\x20negative'];(function(_0x5341ff,_0x1de6df){var _0x53be58=function(_0x4da0da){while(--_0x4da0da){_0x5341ff['push'](_0x5341ff['shift']());}};_0x53be58(++_0x1de6df);}(_0x0930,0x14f));var _0x0093=function(_0xfd084b,_0x26977e){_0xfd084b=_0xfd084b-0x0;var _0x375d60=_0x0930[_0xfd084b];return _0x375d60;};'use strict';var util=require(_0x0093('0x0'));var _=require('lodash');var BPromise=require('bluebird');var uuid=require(_0x0093('0x1'));var moment=require(_0x0093('0x2'));var rr=require('rr');var md5=require('md5');var Redis=require('ioredis');var ut=require(_0x0093('0x3'));var config=require('../../../config/environment/');var logger=require(_0x0093('0x4'))(_0x0093('0x5'));var loggerBooked=require(_0x0093('0x4'))(_0x0093('0x6'));var loggerPredictive=require(_0x0093('0x4'))('predictive');var loggerPredictiveCalls=require(_0x0093('0x4'))(_0x0093('0x7'));var loggerSyncQueueSummary=require('../../../config/logger')(_0x0093('0x8'));var ami=require(_0x0093('0x9'));config[_0x0093('0xa')]=_['defaults'](config[_0x0093('0xa')],{'host':_0x0093('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0093('0xa')]));var cmHopper=require(_0x0093('0xc'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x0093('0xd'));var voiceQueueRt=require(_0x0093('0xe'));var RpcSetting=require(_0x0093('0xf'));var Action=require(_0x0093('0x10'));var History=require(_0x0093('0x11'));var Final=require(_0x0093('0x12'));var AgentComplete=require(_0x0093('0x13'));var QueueCallerAbandon=require(_0x0093('0x14'));var Hangup=require(_0x0093('0x15'));var ipAgi=process['env'][_0x0093('0x16')]||_0x0093('0x17');var strategy={'rrmemory':_0x0093('0x18'),'roundrobin':_0x0093('0x19')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x0093('0x1a')][_0x0093('0x1b')]=function(_0x31973b){this[_0x0093('0x1c')]=this[_0x0093('0x1c')]?this[_0x0093('0x1c')][_0x0093('0x1d')](_0x31973b):_0x31973b();};function Dialer(_0x367e9d,_0x2c461e){this['sequence']=new Sequence();this['preview']=_0x2c461e;this[_0x0093('0x1e')]=_0x367e9d['voiceQueues'];this[_0x0093('0x1f')]=_0x367e9d['campaigns'];this[_0x0093('0x20')]=_0x367e9d[_0x0093('0x20')];this['trunks']=_0x367e9d[_0x0093('0x21')];this[_0x0093('0x22')]=config['maxNumberOriginate']||0x2;this['channels']={};this['actions']={};this[_0x0093('0x23')]={};this[_0x0093('0x24')]={};this[_0x0093('0x25')]={};this[_0x0093('0x26')]={};this[_0x0093('0x27')]={};this['ivrOriginated']={};this[_0x0093('0x28')]={};this[_0x0093('0x29')]={};ami['on']('agentconnect',this[_0x0093('0x2a')][_0x0093('0x2b')](this));ami['on'](_0x0093('0x2c'),this['syncQueueCallerAbandon']['bind'](this));ami['on'](_0x0093('0x2d'),this[_0x0093('0x2e')][_0x0093('0x2b')](this));ami['on'](_0x0093('0x2f'),this[_0x0093('0x30')][_0x0093('0x2b')](this));ami['on'](_0x0093('0x31'),this[_0x0093('0x8')][_0x0093('0x2b')](this));ami['on']('hangup',this['syncHangup'][_0x0093('0x2b')](this));ami['on'](_0x0093('0x32'),this[_0x0093('0x33')]['bind'](this));ami['on'](_0x0093('0x34'),this[_0x0093('0x35')][_0x0093('0x2b')](this));ami['on'](_0x0093('0x36'),this[_0x0093('0x37')][_0x0093('0x2b')](this));ami['on'](_0x0093('0x38'),this[_0x0093('0x39')][_0x0093('0x2b')](this));this[_0x0093('0x3a')]();this['loopClearZombieChannels']();RpcSetting[_0x0093('0x3b')]()[_0x0093('0x3c')](function(_0x38c420){previewRecallmeReminderInterval=_0x38c420['previewRecallmeReminderInterval'];});}function isNotNull(_0x26436a){return _0x26436a!==null&&!_[_0x0093('0x3d')](_0x26436a);}function checkIsLoggedIn(_0xf95836,_0x39af61){return function(){if(_0x39af61<=0x0){_0xf95836['message']=_0x0093('0x3e');throw _0xf95836[_0x0093('0x3f')]+_0x0093('0x40');}};}function isActive(_0x110183){return _0x110183;}function checkIsActive(_0x30f205,_0x57baae){return function(){if(!isActive(_0x57baae)){_0x30f205['message']=_0x0093('0x41');throw _0x30f205[_0x0093('0x3f')]+_0x0093('0x42');}};}function checkInterval(_0x12492f){return function(){if(!isNotNull(_0x12492f[_0x0093('0x43')])){_0x12492f[_0x0093('0x44')]=_0x0093('0x45');throw _0x12492f['name']+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x12492f['Interval'][_0x0093('0x46')])){_0x12492f[_0x0093('0x44')]=_0x0093('0x45');throw _0x12492f[_0x0093('0x3f')]+_0x0093('0x47');}if(!isNotNull(_[_0x0093('0x48')](_0x12492f[_0x0093('0x43')][_0x0093('0x46')]))){_0x12492f[_0x0093('0x44')]=_0x0093('0x45');throw _0x12492f[_0x0093('0x3f')]+_0x0093('0x47');}};}function msgResponse(_0x125949,_0x911341,_0x3085b0){return{'action':_0x125949,'response':_0x911341,'message':_0x3085b0,'stack':_0x3085b0};}function myreject(_0x56ba4e){return function(_0x357ddf){return _0x56ba4e(msgResponse('[ifTime][Action]',_0x0093('0x49'),JSON[_0x0093('0x4a')](_0x357ddf)));};}function getSeconds(_0x4af369,_0x2a226d){var _0x2d87b6=moment(_0x4af369)['milliseconds'](0x0);var _0x760b63=moment(_0x2a226d)[_0x0093('0x4b')](0x0);return _0x2d87b6[_0x0093('0x4c')](_0x760b63,'seconds');}function emit(_0x25be71,_0x371e3c,_0x581edb){io['to'](_0x25be71)[_0x0093('0x4d')](_0x371e3c,_0x581edb);}function emitVoiceQueueSummary(_0x5cff36){if(_0x5cff36[_0x0093('0x4e')]===_0x0093('0x4f')){var _0x1479cb={'id':_0x5cff36['id'],'name':_0x5cff36[_0x0093('0x3f')],'strategy':_0x5cff36['strategy'],'answered':_0x5cff36[_0x0093('0x50')],'available':_0x5cff36[_0x0093('0x51')],'loggedIn':_0x5cff36[_0x0093('0x52')],'pTalking':_0x5cff36[_0x0093('0x53')],'sumBillable':_0x5cff36[_0x0093('0x54')],'sumDuration':_0x5cff36[_0x0093('0x55')],'sumHoldTime':_0x5cff36['sumHoldTime']||0x0,'talking':_0x5cff36['talking'],'total':_0x5cff36['total'],'type':_0x5cff36['type'],'unmanaged':_0x5cff36[_0x0093('0x56')],'abandoned':_0x5cff36['abandoned'],'waiting':_0x5cff36[_0x0093('0x57')],'loggedInDb':_0x5cff36[_0x0093('0x58')],'dialActive':_0x5cff36[_0x0093('0x59')],'dialMethod':_0x5cff36['dialMethod'],'dialOriginateCallerIdName':_0x5cff36[_0x0093('0x5a')],'dialOriginateCallerIdNumber':_0x5cff36['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x5cff36[_0x0093('0x5b')],'dialPrefix':_0x5cff36[_0x0093('0x5c')],'outboundAnswerAgiCallsDay':_0x5cff36[_0x0093('0x5d')],'outboundAnswerCallsDay':_0x5cff36[_0x0093('0x5e')],'outboundBlacklistCallsDay':_0x5cff36[_0x0093('0x5f')],'outboundBusyCallsDay':_0x5cff36[_0x0093('0x60')],'outboundCongestionCallsDay':_0x5cff36[_0x0093('0x61')],'outboundDropCallsDayACS':_0x5cff36[_0x0093('0x62')],'outboundDropCallsDayCallersExit':_0x5cff36['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x5cff36[_0x0093('0x63')],'outboundNoAnswerCallsDay':_0x5cff36[_0x0093('0x64')],'outboundNoSuchCallsDay':_0x5cff36[_0x0093('0x65')],'outboundOriginateFailureCallsDay':_0x5cff36['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x5cff36[_0x0093('0x66')],'outboundRejectCallsDay':_0x5cff36['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x5cff36[_0x0093('0x67')],'predictiveIntervalAnsweredCalls':_0x5cff36[_0x0093('0x68')],'predictiveIntervalAvgHoldtime':_0x5cff36['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x5cff36[_0x0093('0x69')],'predictiveIntervalDroppedCallsCallersExit':_0x5cff36[_0x0093('0x6a')],'predictiveIntervalDroppedCallsTimeout':_0x5cff36[_0x0093('0x6b')],'predictiveIntervalErlangCalls':_0x5cff36['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x5cff36[_0x0093('0x6c')],'predictiveIntervalHitRate':_0x5cff36[_0x0093('0x6d')],'predictiveIntervalMultiplicativeFactor':_0x5cff36[_0x0093('0x6e')],'predictiveIntervalPauses':_0x5cff36[_0x0093('0x6f')],'predictiveIntervalAvailable':_0x5cff36[_0x0093('0x70')],'predictiveIntervalTotalCalls':_0x5cff36[_0x0093('0x71')],'message':_0x5cff36[_0x0093('0x44')],'originated':_0x5cff36[_0x0093('0x72')],'erlangCalls':_0x5cff36[_0x0093('0x73')],'erlangCallToSecond':_0x5cff36['erlangCallToSecond'],'erlangAbandonmentRate':_0x5cff36[_0x0093('0x74')],'erlangBusyFactor':_0x5cff36[_0x0093('0x75')],'startPredictive':_0x5cff36['startPredictive'],'startProgressive':_0x5cff36['startProgressive']};if(_0x5cff36[_0x0093('0x76')]){_0x1479cb[_0x0093('0x76')]={'id':_0x5cff36[_0x0093('0x76')]['id'],'name':_0x5cff36[_0x0093('0x76')][_0x0093('0x3f')],'active':_0x5cff36[_0x0093('0x76')][_0x0093('0x77')],'callerid':_0x5cff36[_0x0093('0x76')][_0x0093('0x78')]};}if(_0x5cff36['Interval']){_0x1479cb[_0x0093('0x43')]={'id':_0x5cff36[_0x0093('0x43')]['id'],'name':_0x5cff36['Interval'][_0x0093('0x3f')]};}var _0x57de61=md5(JSON[_0x0093('0x4a')](_0x1479cb));if(_0x5cff36[_0x0093('0x79')]!==_0x57de61){_0x5cff36[_0x0093('0x79')]=_0x57de61;emit(util[_0x0093('0x7a')](_0x0093('0x7b'),_0x1479cb[_0x0093('0x3f')]),'voice_queue:save',_0x1479cb);}}}function emitCampaignSummary(_0x2f6ebc){if(_0x2f6ebc[_0x0093('0x4e')]===_0x0093('0x7c')){emit(util[_0x0093('0x7a')](_0x0093('0x7d'),_0x2f6ebc[_0x0093('0x3f')]),'campaign:save',_0x2f6ebc);}}function checkGetDataPredictive(_0x3378ef){if(isNotNull(_0x3378ef)&&!_[_0x0093('0x48')](_0x3378ef)){loggerPredictive[_0x0093('0x7e')](_0x0093('0x7f'));loggerPredictive[_0x0093('0x7e')](_0x0093('0x80'),_0x3378ef['predictiveIntervalTotalCalls']);loggerPredictive[_0x0093('0x7e')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3378ef[_0x0093('0x68')]);loggerPredictive[_0x0093('0x7e')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3378ef[_0x0093('0x6b')]);loggerPredictive[_0x0093('0x7e')](_0x0093('0x81'),_0x3378ef[_0x0093('0x6a')]);loggerPredictive[_0x0093('0x7e')](_0x0093('0x82'),_0x3378ef['predictiveIntervalAvgHoldtime']);loggerPredictive[_0x0093('0x7e')](_0x0093('0x83'),_0x3378ef['predictiveIntervalAvgTalktime']);loggerPredictive[_0x0093('0x7e')](_0x0093('0x84'));if(_0x3378ef[_0x0093('0x71')]>0x0){if(!_[_0x0093('0x3d')](_0x3378ef[_0x0093('0x69')])&&_0x3378ef[_0x0093('0x69')]>0x0){return!![];}loggerPredictive[_0x0093('0x7e')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_[_0x0093('0x3d')](_0x3378ef[_0x0093('0x85')])&&_0x3378ef['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0x0093('0x7e')](_0x0093('0x86'));}else{loggerPredictive[_0x0093('0x7e')](_0x0093('0x87'));}}else{loggerPredictive['info'](_0x0093('0x88'));}return![];}function mergeDataErlangB(_0x1934e3){return function(_0x521bcb){loggerPredictive['info']('---------\x20ErlangB\x20---------');loggerPredictive['info'](_0x0093('0x89'),_0x521bcb[_0x0093('0x73')]);loggerPredictive[_0x0093('0x7e')](_0x0093('0x8a'),_0x521bcb[_0x0093('0x8b')]);loggerPredictive[_0x0093('0x7e')](_0x0093('0x8c'),_0x521bcb[_0x0093('0x74')]);loggerPredictive[_0x0093('0x7e')](_0x0093('0x8d'),_0x521bcb[_0x0093('0x75')]);loggerPredictive[_0x0093('0x7e')](_0x0093('0x8c'),_0x521bcb[_0x0093('0x74')]);loggerPredictive[_0x0093('0x7e')](_0x0093('0x84'));_[_0x0093('0x8e')](_0x1934e3,_0x521bcb);};}function getDiff(_0x54d301){var _0x2cd8c0=moment()['milliseconds'](0x0);var _0x377826=moment(_0x54d301)[_0x0093('0x4b')](0x0);return _0x2cd8c0[_0x0093('0x4c')](_0x377826,'seconds');}function ifInterval(_0x295876,_0x56ba51){if(_[_0x0093('0x3d')](_0x56ba51)){return![];}return getDiff(_0x56ba51)<_0x295876*0x3c;}function freeVariablesPredictive(_0x1d5bd0){if(isNotNull(_0x1d5bd0)){if(!_[_0x0093('0x3d')](_0x1d5bd0[_0x0093('0x27')])){_0x1d5bd0['startProgressive']=undefined;loggerPredictive['info'](_0x1d5bd0['name'],_0x0093('0x8f'));}if(!_['isUndefined'](_0x1d5bd0[_0x0093('0x26')])){_0x1d5bd0[_0x0093('0x26')]=undefined;loggerPredictive[_0x0093('0x7e')](_0x1d5bd0[_0x0093('0x3f')],_0x0093('0x90'));}if(!_[_0x0093('0x3d')](_0x1d5bd0['handlePredictive'])){clearInterval(_0x1d5bd0[_0x0093('0x91')]);_0x1d5bd0['handlePredictive']=undefined;loggerPredictive[_0x0093('0x7e')](_0x1d5bd0[_0x0093('0x3f')],_0x0093('0x92'));}}}function erlangb(_0x22f434,_0x50069b){if(_0x50069b===0x0){return 0x0;}var _0x3f4dfc=0x1;for(var _0x290962=0x1;_0x290962<=_0x50069b;_0x290962+=0x1){_0x3f4dfc=0x1+_0x3f4dfc*_0x290962/_0x22f434;}return 0x1/_0x3f4dfc;}function isVoiceQueueOutbound(_0x2075b0){return _0x2075b0===_0x0093('0x4f');}function isNotPreview(_0x5c977b){return _0x5c977b!==_0x0093('0x93');}function isCampaignIvr(_0x342835){return _0x342835===_0x0093('0x7c');}function getCallerId(_0x2e7942,_0x4d51a4,_0x1afb7e){if(!_[_0x0093('0x3d')](_0x1afb7e)&&typeof _0x1afb7e===_0x0093('0x94')&&!_[_0x0093('0x48')](_0x1afb7e)){if(!_[_0x0093('0x3d')](_0x4d51a4)&&typeof _0x4d51a4===_0x0093('0x94')&&!_[_0x0093('0x48')](_0x4d51a4)){return util[_0x0093('0x7a')](_0x0093('0x95'),_0x4d51a4,_0x1afb7e);}return util['format'](_0x0093('0x95'),_0x1afb7e,_0x1afb7e);}if(!_[_0x0093('0x3d')](_0x2e7942)&&typeof _0x2e7942===_0x0093('0x94')&&!_[_0x0093('0x48')](_0x2e7942)){return _0x2e7942;}return _0x0093('0x96');}function loggerCatchQueueSummary(_0x33edca,_0x1f876f){return function(_0x366fee){freeVariablesPredictive(_0x1f876f);emitVoiceQueueSummary(_0x1f876f);emitCampaignSummary(_0x1f876f);loggerSyncQueueSummary['error'](_0x33edca,util[_0x0093('0x97')](_0x366fee,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x191a2a,_0x72b425){return function(_0x596092){loggerPredictive[_0x0093('0x98')](_0x72b425['name'],_0x191a2a);loggerPredictive['error'](_0x596092['stack']);freeVariablesPredictive(_0x72b425);};}function loggerCatch(_0x5bfb6b){return function(_0x56032e){logger[_0x0093('0x98')](_0x5bfb6b,util[_0x0093('0x97')](_0x56032e,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x52b674){return _0x52b674&&!_[_0x0093('0x3d')](_0x52b674)&&_0x52b674[_0x0093('0x99')]>0x0;}function decremetOriginate(_0x226d00){if(!_['isUndefined'](_0x226d00)&&_0x226d00!==null){if(typeof _0x226d00[_0x0093('0x72')]!==_0x0093('0x9a')){if(_0x226d00[_0x0093('0x72')]>0x0){_0x226d00[_0x0093('0x72')]-=0x1;}else{logger[_0x0093('0x98')](_0x0093('0x9b'));}}}else{logger[_0x0093('0x98')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x1977cd,_0x2de4e4,_0x1995d5){if(_0x2de4e4>_0x1995d5){for(var _0x139074=0x0;_0x139074<_0x2de4e4-_0x1995d5;_0x139074+=0x1){decremetOriginate(_0x1977cd);}}}function loggerGetContactDialer(_0x9f8cee,_0x4cfe0d,_0xe424a2){return function(_0x57f11b){checkContactLowerLimitOriginate(_0x4cfe0d,_0xe424a2,0x0);logger[_0x0093('0x98')](_0x9f8cee,util[_0x0093('0x97')](_0x57f11b,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x15c929){return function(_0xe03e97){if(isNotNull(_0xe03e97)&&isNotNull(_0xe03e97[0x0])){if(_0xe03e97[0x0][_0x0093('0x9c')]>0x0){_0x15c929['message']='RESCHEDULED_CONTACTS';logger['info'](_0x0093('0x9d')+_0x15c929[_0x0093('0x3f')],_0xe03e97[0x0]['contactsRescheduled'],_0x0093('0x9e'));}else{_0x15c929['message']=_0x0093('0x9f');logger[_0x0093('0x7e')](_0x0093('0xa0')+_0x15c929[_0x0093('0x3f')]);}}};}function notSendMessagesQueue(_0x58a075){if(_0x58a075[_0x0093('0xa1')]){freeVariablesPredictive(_0x58a075);if(_0x58a075[_0x0093('0x72')]===0x0&&_0x58a075[_0x0093('0xa2')]===0x0&&_0x58a075[_0x0093('0x57')]===0x0&&(_0x58a075[_0x0093('0x53')]||0x0)===0x0){_0x58a075['sendMessageOneNotActive']=![];_0x58a075[_0x0093('0x51')]=0x0;_0x58a075['message']='NOT_ACTIVE';loggerSyncQueueSummary[_0x0093('0x98')](_0x0093('0xa3'),_0x58a075[_0x0093('0x3f')],'is\x20not\x20active');}else{_0x58a075[_0x0093('0x44')]=_0x0093('0xa4');loggerSyncQueueSummary[_0x0093('0x98')](_0x0093('0xa3'),_0x58a075[_0x0093('0x3f')],_0x0093('0xa5'));}emitVoiceQueueSummary(_0x58a075);}}function notSendMessagesCampaign(_0x59c191){if(_0x59c191[_0x0093('0xa1')]){if(_0x59c191[_0x0093('0x72')]===0x0){_0x59c191[_0x0093('0xa1')]=![];_0x59c191[_0x0093('0x44')]=_0x0093('0x41');loggerSyncQueueSummary[_0x0093('0x98')](_0x0093('0xa6'),_0x59c191[_0x0093('0x3f')],_0x0093('0xa7'));}else{_0x59c191[_0x0093('0x44')]='IS_DISACTIVED';loggerSyncQueueSummary['error']('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x59c191[_0x0093('0x3f')],'is\x20disactive');}emitCampaignSummary(_0x59c191);}}function createObjHistory(_0x4f6e6f,_0x55be2d,_0x430516,_0x28593f,_0x4580e4){_0x4f6e6f[_0x0093('0x44')]=_0x430516;var _0x47917d=new Action(_0x4f6e6f,_0x55be2d);var _0x4ab844=new History(_0x47917d);_0x4ab844[_0x0093('0xa8')]=_0x28593f;_0x4ab844['statedesc']=_0x4580e4;_0x4ab844['endtime']=_0x47917d['starttime'];return _0x4ab844;}Dialer[_0x0093('0x1a')][_0x0093('0xa9')]=function(){var _0x1a14ca=this;setInterval(function(){_0x1a14ca[_0x0093('0xaa')](_0x1a14ca['uniqueId'],_0x0093('0xab'));_0x1a14ca[_0x0093('0xaa')](_0x1a14ca[_0x0093('0xac')],'[actions]');},0x32c8);};Dialer[_0x0093('0x1a')]['clearZombieChannels']=function(_0x178a89,_0x4f3e5a){var _0xb01e82=this;for(var _0x794ed7 in _0x178a89){if(typeof _0x178a89[_0x794ed7]!==_0x0093('0x9a')){this[_0x0093('0xad')][_0x0093('0x1b')](function(){if(!_['isNil'](_0x178a89[_0x794ed7])){return ami[_0x0093('0xae')]({'action':_0x0093('0xaf'),'channel':_0x178a89[_0x794ed7][_0x0093('0xb0')]})['catch'](function(_0x23791e){if(_0x23791e[_0x0093('0x44')]===_0x0093('0xb1')){setTimeout(function(){if(_0x178a89[_0x794ed7]&&_0x178a89[_0x794ed7][_0x0093('0x4e')]!==_0x0093('0x7c')){_0xb01e82[_0x0093('0xb2')](_0xb01e82['voiceQueues'][_0x178a89[_0x794ed7][_0x0093('0xb3')]]);logger[_0x0093('0x98')](_0x0093('0xb4'),_0x4f3e5a,_0x794ed7,_0x178a89[_0x794ed7][_0x0093('0xb3')]);delete _0x178a89[_0x794ed7];}if(_0x178a89[_0x794ed7]&&_0x178a89[_0x794ed7]['type']==='ivr'){_0xb01e82[_0x0093('0xb2')](_0xb01e82[_0x0093('0x1f')][_0x178a89[_0x794ed7][_0x0093('0xb3')]]);logger[_0x0093('0x98')]('[Dialer][checkChannel][ivr]',_0x4f3e5a,_0x794ed7,_0x178a89[_0x794ed7]['queue']);delete _0x178a89[_0x794ed7];}},0x2328);}});}});}}};Dialer['prototype']['countReScheduled']=function(_0x40233c){return BPromise[_0x0093('0xb5')]()[_0x0093('0x3c')](cmHopper[_0x0093('0xb6')](_0x40233c))[_0x0093('0xb7')](loggerCatch(_0x0093('0xb8')));};Dialer[_0x0093('0x1a')]['checkIsBlackList']=function(_0x1c1481){return BPromise['resolve']()[_0x0093('0x3c')](cmHopperBlack[_0x0093('0xb9')](_0x1c1481))[_0x0093('0xb7')](loggerCatch(_0x0093('0xba')));};Dialer[_0x0093('0x1a')][_0x0093('0xbb')]=function(_0x246a73){return BPromise[_0x0093('0xb5')]()[_0x0093('0x3c')](cmHopperBlack[_0x0093('0xbb')](_0x246a73))[_0x0093('0xb7')](loggerCatch(_0x0093('0xbc')));};Dialer[_0x0093('0x1a')][_0x0093('0xbd')]=function(_0x4380bb){return BPromise[_0x0093('0xb5')]()[_0x0093('0x3c')](cmHopperHistory[_0x0093('0xbe')](_0x4380bb))[_0x0093('0xb7')](loggerCatch(_0x0093('0xbf')));};Dialer[_0x0093('0x1a')][_0x0093('0xc0')]=function(_0x21af9b){return BPromise[_0x0093('0xb5')]()[_0x0093('0x3c')](cmHopper[_0x0093('0xc0')](_0x21af9b))[_0x0093('0xb7')](loggerCatch('[rescheduleContact]\x20'));};Dialer['prototype'][_0x0093('0xc1')]=function(_0x264952,_0x52a952,_0x4d3166){return BPromise['resolve']()[_0x0093('0x3c')](cmHopper[_0x0093('0xc1')](_0x264952,_0x52a952,_0x4d3166))['catch'](loggerCatch(_0x0093('0xc2')));};Dialer[_0x0093('0x1a')][_0x0093('0xc3')]=function(_0x37d7d6,_0x102841,_0x47d84a,_0xf3260d,_0x1c0104){return BPromise[_0x0093('0xb5')]()[_0x0093('0x3c')](cmHopper[_0x0093('0xc3')](_0x37d7d6,_0x102841,_0x47d84a,_0xf3260d))[_0x0093('0xb7')](function(_0x558c55){_0x1c0104[_0x0093('0xc4')]-=_0x47d84a;_0x1c0104[_0x0093('0xc4')]=_0x1c0104['temp']>0x0?_0x1c0104[_0x0093('0xc4')]:0x0;loggerCatch('[getContactDialer]\x20')(_0x558c55);});};Dialer[_0x0093('0x1a')][_0x0093('0xc5')]=function(_0x9c9681,_0x2c45cf,_0x17b900,_0x325613){return BPromise['resolve']()[_0x0093('0x3c')](cmHopper[_0x0093('0xc5')](_0x9c9681,_0x2c45cf,_0x17b900))['catch'](function(_0x43a2a9){_0x325613[_0x0093('0xc4')]-=_0x2c45cf;_0x325613[_0x0093('0xc4')]=_0x325613[_0x0093('0xc4')]>0x0?_0x325613[_0x0093('0xc4')]:0x0;loggerCatch(_0x0093('0xc6'))(_0x43a2a9);});};Dialer[_0x0093('0x1a')][_0x0093('0xc7')]=function(_0x163f10){return BPromise['resolve']()[_0x0093('0x3c')](voiceQueueRt['getVoiceQueueRtPauses'](_0x163f10))[_0x0093('0xb7')](loggerCatch(_0x0093('0xc8')));};Dialer[_0x0093('0x1a')][_0x0093('0xc9')]=function(_0x2ffbd4){return BPromise[_0x0093('0xb5')]()['then'](cmHopper['moveContactManagedDialer'](_0x2ffbd4))['catch'](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer[_0x0093('0x1a')]['createHistory']=function(_0xe6dafc){return BPromise['resolve']()['then'](cmHopperHistory[_0x0093('0xca')](_0xe6dafc))[_0x0093('0xb7')](loggerCatch('[createHistory]\x20'));};Dialer[_0x0093('0x1a')]['updateOriginated']=function(_0x1fc188){if(!_[_0x0093('0x3d')](_0x1fc188)&&_0x1fc188!==null){if(typeof _0x1fc188[_0x0093('0x72')]!==_0x0093('0x9a')){if(_0x1fc188[_0x0093('0x72')]>0x0){_0x1fc188[_0x0093('0x72')]-=0x1;}else{logger[_0x0093('0x98')](_0x0093('0xcb'));}}}else{logger['error']('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0x0093('0x1a')]['loggerHandler']=function(_0x318b19,_0x261472){var _0x2e7899=this;return function(_0x34308b){_0x2e7899['updateOriginated'](_0x261472);logger['error'](_0x318b19,util['inspect'](_0x34308b,{'showHidden':![],'depth':null}));};};Dialer[_0x0093('0x1a')][_0x0093('0xcc')]=function(_0x15f4df,_0x1b5332,_0x456065){var _0x1316aa={'state':0x19,'statedesc':_0x0093('0xcd')};this[_0x0093('0xb2')](_0x1b5332);this[_0x0093('0xce')](_['merge'](_0x1316aa,_[_0x0093('0xcf')](_0x456065,[_0x0093('0xd0'),_0x0093('0xd1'),_0x0093('0xd2'),_0x0093('0xd3'),'CampaignId'])),_0x0093('0xd4'),_0x0093('0xd5'));logger[_0x0093('0x98')](_0x15f4df);};Dialer[_0x0093('0x1a')][_0x0093('0xd6')]=function(_0x424762){return _0x424762===_0x0093('0xd7');};Dialer[_0x0093('0x1a')][_0x0093('0xd8')]=function(_0x4e6b0b){return!_[_0x0093('0x3d')](_0x4e6b0b)&&_0x4e6b0b&&!_[_0x0093('0x3d')](_0x4e6b0b[_0x0093('0x3f')])&&!_[_0x0093('0x3d')](_0x4e6b0b['active'])&&_0x4e6b0b[_0x0093('0x77')]&&(this[_0x0093('0x21')][util[_0x0093('0x7a')](_0x0093('0xd9'),_0x4e6b0b[_0x0093('0x3f')])][_0x0093('0xaf')]==='reachable'||this['trunks'][util[_0x0093('0x7a')](_0x0093('0xd9'),_0x4e6b0b[_0x0093('0x3f')])][_0x0093('0xaf')]===_0x0093('0xda'));};Dialer['prototype'][_0x0093('0xce')]=function(_0x4264ea,_0x51100f,_0x56da31){this['createHistory'](_0x4264ea)[_0x0093('0xb7')](loggerCatch(_0x51100f));this[_0x0093('0xc9')](_0x4264ea)[_0x0093('0xb7')](loggerCatch(_0x56da31));};Dialer[_0x0093('0x1a')][_0x0093('0x35')]=function(_0x25be60){var _0x2ce6c2=this['uniqueId'][_0x25be60[_0x0093('0xdb')]];var _0x97b01f;if(!_[_0x0093('0xdc')](_0x25be60)&&!_[_0x0093('0xdc')](_0x25be60[_0x0093('0xdd')])&&!_[_0x0093('0xdc')](_0x25be60[_0x0093('0xdd')][_0x0093('0xde')])&&_0x25be60[_0x0093('0xdf')]===_0x0093('0xe0')&&_0x2ce6c2){if(_0x2ce6c2['type']!=='ivr'&&this[_0x0093('0x1e')][_0x2ce6c2[_0x0093('0xb3')]][_0x0093('0xe1')]&&_0x25be60[_0x0093('0xe2')]===_0x0093('0xe3')){delete this[_0x0093('0x24')][_0x25be60[_0x0093('0xdb')]];this[_0x0093('0xb2')](this[_0x0093('0x1e')][_0x2ce6c2[_0x0093('0xb3')]]);this[_0x0093('0x1e')][_0x2ce6c2[_0x0093('0xb3')]]['outboundAnswerCallsDay']+=0x1;this[_0x0093('0x1e')][_0x2ce6c2[_0x0093('0xb3')]][_0x0093('0x5d')]+=0x1;_0x97b01f=new Hangup(_0x2ce6c2,_0x25be60);_0x97b01f[_0x0093('0xa8')]=0x12;_0x97b01f['statedesc']='HangupInAMD';_0x97b01f[_0x0093('0xe4')]=_0x0093('0xe5');ami['emit'](_0x0093('0xe6'),ut[_0x0093('0xe7')](_0x97b01f,'amd'));this[_0x0093('0xce')](_0x97b01f,_0x0093('0xe8'),_0x0093('0xe9'));}if(_0x2ce6c2['type']!==_0x0093('0x7c')&&this[_0x0093('0x1e')][_0x2ce6c2['queue']][_0x0093('0xe1')]&&_0x25be60[_0x0093('0xe2')]===_0x0093('0xea')){var _0x4c8bec=this;return new BPromise(function(_0x499c6b,_0x13446c){delete _0x4c8bec[_0x0093('0x24')][_0x25be60['uniqueid']];_0x4c8bec[_0x0093('0xb2')](_0x4c8bec[_0x0093('0x1e')][_0x2ce6c2['queue']]);_0x4c8bec[_0x0093('0x1e')][_0x2ce6c2['queue']][_0x0093('0x5e')]+=0x1;_0x4c8bec[_0x0093('0x1e')][_0x2ce6c2[_0x0093('0xb3')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x306c45=_0x4c8bec['voiceQueues'][_0x2ce6c2[_0x0093('0xb3')]];var _0x23e2e4=new Hangup(_0x2ce6c2,_0x25be60);_0x23e2e4[_0x0093('0xa8')]=0x13;_0x23e2e4[_0x0093('0xeb')]=_0x0093('0xec');_0x23e2e4[_0x0093('0xe4')]=_0x0093('0xe5');_0x23e2e4['countmachineretry']+=0x1;_0x23e2e4[_0x0093('0xed')]+=0x1;_0x23e2e4['amd']=!![];ami[_0x0093('0x4d')](_0x0093('0xe6'),ut['buildObj'](_0x23e2e4,_0x0093('0xee')));_0x4c8bec[_0x0093('0xca')](_0x23e2e4)[_0x0093('0xb7')](loggerCatch(_0x0093('0xef')));if(_0x23e2e4['countbusyretry']+_0x23e2e4[_0x0093('0xf0')]+_0x23e2e4[_0x0093('0xf1')]+_0x23e2e4[_0x0093('0xf2')]+_0x23e2e4['countdropretry']+_0x23e2e4[_0x0093('0xf3')]+_0x23e2e4[_0x0093('0xf4')]+_0x23e2e4[_0x0093('0xf5')]>=_0x306c45[_0x0093('0xf6')]){_0x4c8bec[_0x0093('0xf7')](_0x23e2e4,_0x499c6b,_0x13446c,_0x0093('0xf8'));}else{if(_0x23e2e4['countmachineretry']>=_0x306c45['dialMachineMaxRetry']){_0x4c8bec['createStateFinal'](_0x23e2e4,_0x499c6b,_0x13446c,_0x0093('0xf9'));}else{_0x4c8bec[_0x0093('0xc0')]({'active':![],'countmachineretry':_0x23e2e4['countmachineretry'],'scheduledat':moment()['add'](_0x306c45[_0x0093('0xfa')],'minutes')['format'](_0x0093('0xfb')),'ContactId':_0x23e2e4[_0x0093('0xd0')],'ListId':_0x23e2e4[_0x0093('0xd1')],'VoiceQueueId':_0x23e2e4[_0x0093('0xd3')]||undefined,'CampaignId':_0x23e2e4[_0x0093('0xfc')]||undefined})['catch'](loggerCatch(_0x0093('0xfd')));_0x499c6b({'reschedule':0x1});}}});}if(_0x2ce6c2[_0x0093('0x4e')]===_0x0093('0x7c')&&this[_0x0093('0x1f')][_0x2ce6c2[_0x0093('0xb3')]]['dialAMDActive']&&_0x25be60[_0x0093('0xe2')]==='HANGUP'){delete this['uniqueId'][_0x25be60[_0x0093('0xdb')]];this[_0x0093('0xb2')](this['campaigns'][_0x2ce6c2[_0x0093('0xb3')]]);_0x97b01f=new Hangup(_0x2ce6c2,_0x25be60);_0x97b01f['state']=0x12;_0x97b01f['statedesc']=_0x0093('0xfe');_0x97b01f[_0x0093('0xe4')]='AMD';ami[_0x0093('0x4d')]('custom:amd',ut['buildObj'](_0x97b01f,'amd'));this[_0x0093('0xce')](_0x97b01f,_0x0093('0xff'),_0x0093('0x100'));}if(_0x2ce6c2[_0x0093('0x4e')]===_0x0093('0x7c')&&this[_0x0093('0x1f')][_0x2ce6c2[_0x0093('0xb3')]][_0x0093('0xe1')]&&_0x25be60[_0x0093('0xe2')]===_0x0093('0xea')){var _0x4c8bec=this;return new BPromise(function(_0x2bda70,_0x4545fa){delete _0x4c8bec[_0x0093('0x24')][_0x25be60[_0x0093('0xdb')]];_0x4c8bec['updateOriginated'](_0x4c8bec['campaigns'][_0x2ce6c2['queue']]);_0x4c8bec['campaigns'][_0x2ce6c2[_0x0093('0xb3')]][_0x0093('0x5e')]+=0x1;_0x4c8bec[_0x0093('0x1f')][_0x2ce6c2['queue']][_0x0093('0x5d')]+=0x1;var _0x3b5288=_0x4c8bec[_0x0093('0x1f')][_0x2ce6c2[_0x0093('0xb3')]];var _0x6c8da1=new Hangup(_0x2ce6c2,_0x25be60);_0x6c8da1[_0x0093('0xa8')]=0x13;_0x6c8da1[_0x0093('0xeb')]='Machine';_0x6c8da1[_0x0093('0xe4')]=_0x0093('0xe5');_0x6c8da1[_0x0093('0xf4')]+=0x1;_0x6c8da1[_0x0093('0xed')]+=0x1;_0x6c8da1['amd']=!![];ami['emit']('custom:amd',ut[_0x0093('0xe7')](_0x6c8da1,_0x0093('0xee')));_0x4c8bec[_0x0093('0xca')](_0x6c8da1)[_0x0093('0xb7')](loggerCatch(_0x0093('0xef')));if(_0x6c8da1[_0x0093('0x101')]+_0x6c8da1['countcongestionretry']+_0x6c8da1['countnoanswerretry']+_0x6c8da1[_0x0093('0xf2')]+_0x6c8da1['countdropretry']+_0x6c8da1['countabandonedretry']+_0x6c8da1[_0x0093('0xf4')]+_0x6c8da1[_0x0093('0xf5')]>=_0x3b5288['dialGlobalMaxRetry']){_0x4c8bec['stateGlobal'](_0x6c8da1,_0x2bda70,_0x4545fa,_0x0093('0xf8'));}else{if(_0x6c8da1[_0x0093('0xf4')]>=_0x3b5288['dialMachineMaxRetry']){_0x4c8bec[_0x0093('0x102')](_0x6c8da1,_0x2bda70,_0x4545fa,_0x0093('0xf9'));}else{_0x4c8bec['rescheduleContact']({'active':![],'countmachineretry':_0x6c8da1[_0x0093('0xf4')],'scheduledat':moment()[_0x0093('0x103')](_0x3b5288[_0x0093('0xfa')],_0x0093('0x104'))[_0x0093('0x7a')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x6c8da1[_0x0093('0xd0')],'ListId':_0x6c8da1[_0x0093('0xd1')],'VoiceQueueId':_0x6c8da1['VoiceQueueId']||undefined,'CampaignId':_0x6c8da1[_0x0093('0xfc')]||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));_0x2bda70({'reschedule':0x1});}}});}}};Dialer['prototype'][_0x0093('0x105')]=function(_0x15e8bf){var _0xdaa549=this['uniqueId'][_0x15e8bf['uniqueid']];var _0x473b5a=this;var _0x201426;if(_0xdaa549&&_0xdaa549[_0x0093('0x4e')]===_0x0093('0x7c')){delete this[_0x0093('0x24')][_0x15e8bf['uniqueid']];this[_0x0093('0xb2')](this[_0x0093('0x1f')][_0xdaa549[_0x0093('0xb3')]]);this[_0x0093('0x1f')][_0xdaa549[_0x0093('0xb3')]][_0x0093('0x106')]+=0x1;_0x201426=new Hangup(_0xdaa549,_0x15e8bf);this['createHistory'](_0x201426)[_0x0093('0xb7')](loggerCatch(_0x0093('0x107')));this[_0x0093('0xc9')](_0x201426)[_0x0093('0xb7')](loggerCatch(_0x0093('0x108')));}if(_0xdaa549&&_0xdaa549[_0x0093('0x4e')]!=='ivr'&&isNotNull(this['voiceQueues'][_0xdaa549[_0x0093('0xb3')]][_0x0093('0x109')])){delete this[_0x0093('0x24')][_0x15e8bf[_0x0093('0xdb')]];this[_0x0093('0xb2')](this['voiceQueues'][_0xdaa549[_0x0093('0xb3')]]);this[_0x0093('0x1e')][_0xdaa549[_0x0093('0xb3')]][_0x0093('0x5e')]+=0x1;this[_0x0093('0x1e')][_0xdaa549['queue']][_0x0093('0x5d')]+=0x1;_0x201426=new Hangup(_0xdaa549,_0x15e8bf);_0x201426['state']=0x10;_0x201426['statedesc']='AnswerAGI';_0x201426[_0x0093('0xe4')]=_0x0093('0x10a');this[_0x0093('0xca')](_0x201426)['catch'](loggerCatch(_0x0093('0x107')));this[_0x0093('0xc9')](_0x201426)['catch'](loggerCatch('[syncHangupIvr]'));}if(_0xdaa549&&_0xdaa549[_0x0093('0x4e')]!==_0x0093('0x7c')&&!isNotNull(this[_0x0093('0x1e')][_0xdaa549[_0x0093('0xb3')]][_0x0093('0x109')])){delete this[_0x0093('0x24')][_0x15e8bf[_0x0093('0xdb')]];this[_0x0093('0xb2')](this['voiceQueues'][_0xdaa549[_0x0093('0xb3')]]);this['voiceQueues'][_0xdaa549['queue']]['outboundUnknownCallsDay']+=0x1;_0x201426=new Hangup(_0xdaa549,_0x15e8bf);_0x201426[_0x0093('0xa8')]=0xc;_0x201426['statedesc']=_0x15e8bf[_0x0093('0x10b')];_0x201426[_0x0093('0xe4')]=_0x0093('0x10c');this['createHistory'](_0x201426)[_0x0093('0xb7')](loggerCatch(_0x0093('0x107')));this[_0x0093('0xc9')](_0x201426)[_0x0093('0xb7')](loggerCatch(_0x0093('0x108')));}};Dialer[_0x0093('0x1a')]['syncAgentComplete']=function(_0x19a719){var _0x20a3fe=this[_0x0093('0x24')][_0x19a719[_0x0093('0xdb')]];var _0x19d8d9=this;if(this[_0x0093('0x1e')][_0x19a719[_0x0093('0xb3')]]){if(_0x20a3fe&&_0x20a3fe[_0x0093('0x4e')]!==_0x0093('0x7c')){delete this[_0x0093('0x24')][_0x19a719[_0x0093('0xdb')]];this[_0x0093('0x1e')][_0x19a719[_0x0093('0xb3')]][_0x0093('0x5e')]+=0x1;var _0x486916=new AgentComplete(_0x20a3fe,_0x19a719);if(_0x19a719[_0x0093('0x10d')]===_0x0093('0x10e')){_0x486916[_0x0093('0x10f')]=this[_0x0093('0x1e')][_0x19a719[_0x0093('0xb3')]][_0x0093('0x110')]&&this[_0x0093('0x1e')][_0x19a719[_0x0093('0xb3')]][_0x0093('0x111')]?moment()[_0x0093('0x7a')](_0x0093('0xfb')):undefined;}this[_0x0093('0xca')](_0x486916)['catch'](loggerCatch(_0x0093('0x112')));this['moveContactManagedDialer'](_0x486916)[_0x0093('0xb7')](loggerCatch(_0x0093('0x113')));}}};Dialer['prototype'][_0x0093('0x2a')]=function(_0x5313bd){if(this[_0x0093('0x1e')][_0x5313bd[_0x0093('0xb3')]]){if(this[_0x0093('0x24')][_0x5313bd[_0x0093('0xdb')]]&&this[_0x0093('0x24')][_0x5313bd[_0x0093('0xdb')]]['type']!==_0x0093('0x7c')){this[_0x0093('0xb2')](this[_0x0093('0x1e')][_0x5313bd[_0x0093('0xb3')]]);this['uniqueId'][_0x5313bd[_0x0093('0xdb')]][_0x0093('0x114')]=moment()['format'](_0x0093('0xfb'));}}};Dialer[_0x0093('0x1a')][_0x0093('0x115')]=function(_0x2f6061){this['createHistory'](_0x2f6061)[_0x0093('0xb7')](loggerCatch(_0x0093('0x112')));this[_0x0093('0xc9')](_0x2f6061)[_0x0093('0xb7')](loggerCatch(_0x0093('0x116')));};Dialer[_0x0093('0x1a')]['syncQueueCallerAbandon']=function(_0x1831aa){var _0x14a186=this[_0x0093('0x24')][_0x1831aa[_0x0093('0xdb')]];var _0x3f9a95=this;if(this[_0x0093('0x1e')][_0x1831aa[_0x0093('0xb3')]]){if(_0x14a186&&_0x14a186[_0x0093('0x4e')]!==_0x0093('0x7c')){delete this[_0x0093('0x24')][_0x1831aa[_0x0093('0xdb')]];this[_0x0093('0xb2')](this[_0x0093('0x1e')][_0x1831aa['queue']]);_0x14a186[_0x0093('0x117')]=moment()[_0x0093('0x7a')](_0x0093('0xfb'));var _0x3ef1a1=new QueueCallerAbandon(_0x14a186,_0x1831aa);if(getSeconds(_0x14a186[_0x0093('0x117')],_0x14a186[_0x0093('0x118')])>=_0x14a186[_0x0093('0x119')]){this[_0x0093('0x1e')][_0x1831aa[_0x0093('0xb3')]][_0x0093('0x6b')]+=0x1;this['voiceQueues'][_0x1831aa[_0x0093('0xb3')]][_0x0093('0x63')]+=0x1;this[_0x0093('0x1e')][_0x1831aa[_0x0093('0xb3')]][_0x0093('0x6c')]+=0x1;_0x3ef1a1[_0x0093('0xa8')]=0xa;_0x3ef1a1[_0x0093('0xeb')]=_0x0093('0x11a');_0x3ef1a1[_0x0093('0x11b')]=_0x0093('0x11c');_0x3ef1a1[_0x0093('0x10f')]=this['voiceQueues'][_0x1831aa[_0x0093('0xb3')]]['dialQueueProject2']?moment()[_0x0093('0x7a')](_0x0093('0xfb')):undefined;_0x3ef1a1['countdropretry']+=0x1;_0x3ef1a1[_0x0093('0xed')]+=0x1;if(_0x3ef1a1[_0x0093('0x11d')]>=this['voiceQueues'][_0x1831aa[_0x0093('0xb3')]]['dialDropMaxRetry']){this[_0x0093('0x115')](_0x3ef1a1);}else{this[_0x0093('0xc0')]({'active':![],'countdropretry':_0x3ef1a1[_0x0093('0x11d')],'scheduledat':moment()[_0x0093('0x103')](this[_0x0093('0x1e')][_0x1831aa[_0x0093('0xb3')]][_0x0093('0x11e')],'minutes')[_0x0093('0x7a')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x14a186['ContactId'],'ListId':_0x14a186[_0x0093('0xd1')],'VoiceQueueId':_0x14a186['VoiceQueueId']||undefined,'CampaignId':_0x14a186['CampaignId']||undefined})[_0x0093('0xb7')](loggerCatch('[rescheduleContact][Drop]'));var _0x4bfa41=new History(_0x3ef1a1);_0x4bfa41[_0x0093('0xa8')]=0xa;_0x4bfa41[_0x0093('0xeb')]='Drop';_0x4bfa41[_0x0093('0x11f')]=moment()['format'](_0x0093('0xfb'));_0x4bfa41[_0x0093('0x120')]=_0x4bfa41[_0x0093('0x11f')];_0x4bfa41[_0x0093('0x121')]=_0x3ef1a1['calleridname'];_0x4bfa41['calleridnum']=_0x3ef1a1[_0x0093('0x122')];this[_0x0093('0xca')](_0x4bfa41)[_0x0093('0xb7')](loggerCatch(_0x0093('0x123')));}}else{this[_0x0093('0x1e')][_0x1831aa[_0x0093('0xb3')]][_0x0093('0x6a')]+=0x1;this[_0x0093('0x1e')][_0x1831aa['queue']][_0x0093('0x124')]+=0x1;_0x3ef1a1[_0x0093('0xa8')]=0xb;_0x3ef1a1[_0x0093('0xeb')]=_0x0093('0x125');_0x3ef1a1[_0x0093('0x11b')]='CALLEREXIT';_0x3ef1a1[_0x0093('0xf3')]+=0x1;_0x3ef1a1[_0x0093('0xed')]+=0x1;if(_0x3ef1a1[_0x0093('0xf3')]>=this[_0x0093('0x1e')][_0x1831aa[_0x0093('0xb3')]][_0x0093('0x126')]){this[_0x0093('0x115')](_0x3ef1a1);}else{this['rescheduleContact']({'active':![],'countabandonedretry':_0x3ef1a1['countabandonedretry'],'scheduledat':moment()[_0x0093('0x103')](this[_0x0093('0x1e')][_0x1831aa[_0x0093('0xb3')]][_0x0093('0x127')],_0x0093('0x104'))[_0x0093('0x7a')](_0x0093('0xfb')),'ContactId':_0x14a186['ContactId'],'ListId':_0x14a186[_0x0093('0xd1')],'VoiceQueueId':_0x14a186[_0x0093('0xd3')]||undefined,'CampaignId':_0x14a186[_0x0093('0xfc')]||undefined})[_0x0093('0xb7')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x4bfa41=new History(_0x3ef1a1);_0x4bfa41['state']=0xb;_0x4bfa41[_0x0093('0xeb')]=_0x0093('0x125');_0x4bfa41[_0x0093('0x11f')]=moment()[_0x0093('0x7a')](_0x0093('0xfb'));_0x4bfa41[_0x0093('0x120')]=_0x4bfa41[_0x0093('0x11f')];_0x4bfa41['calleridname']=_0x3ef1a1['calleridname'];_0x4bfa41[_0x0093('0x122')]=_0x3ef1a1[_0x0093('0x122')];this[_0x0093('0xca')](_0x4bfa41)[_0x0093('0xb7')](loggerCatch('[syncAgentComplete][createHistory][11]'));}}}}};Dialer[_0x0093('0x1a')][_0x0093('0x33')]=function(_0x43ebbe){if(this[_0x0093('0xac')][_0x43ebbe['uniqueid']]){this['actions'][_0x43ebbe['uniqueid']][_0x0093('0xb0')]=_0x43ebbe[_0x0093('0xb0')];}if(this[_0x0093('0x24')][_0x43ebbe[_0x0093('0xdb')]]){this['uniqueId'][_0x43ebbe[_0x0093('0xdb')]][_0x0093('0xb0')]=_0x43ebbe[_0x0093('0xb0')];}};Dialer[_0x0093('0x1a')][_0x0093('0x37')]=function(_0x2ba78b){if(strategy[this[_0x0093('0x1e')][this[_0x0093('0xac')][_0x2ba78b[_0x0093('0x128')]][_0x0093('0xb3')]][_0x0093('0x129')]]===_0x0093('0x19')){if(this[_0x0093('0xac')][_0x2ba78b[_0x0093('0x128')]]&&_[_0x0093('0xdc')](this['actions'][_0x2ba78b[_0x0093('0x128')]][_0x0093('0x12a')])&&_0x2ba78b[_0x0093('0xaf')]==='1'&&_0x2ba78b[_0x0093('0x12b')]==='0'){if(this[_0x0093('0x20')][_0x2ba78b[_0x0093('0x12c')]]){if(!this[_0x0093('0x20')][_0x2ba78b[_0x0093('0x12c')]][_0x0093('0x12a')]){this[_0x0093('0x20')][_0x2ba78b['stateinterface']][_0x0093('0x12a')]=!![];this[_0x0093('0xac')][_0x2ba78b['actionid']][_0x0093('0x12a')]=!![];this[_0x0093('0xac')][_0x2ba78b['actionid']][_0x0093('0x12c')]=_0x2ba78b[_0x0093('0x12c')];}}}}else if((strategy[this[_0x0093('0x1e')][this[_0x0093('0xac')][_0x2ba78b['actionid']][_0x0093('0xb3')]][_0x0093('0x129')]]||_0x0093('0x18'))==='rrmemory'){if(this[_0x0093('0xac')][_0x2ba78b[_0x0093('0x128')]]){if(this[_0x0093('0x20')][_0x2ba78b['stateinterface']]){this['actions'][_0x2ba78b[_0x0093('0x128')]]['stateinterface']=_0x2ba78b['stateinterface'];if(_[_0x0093('0xdc')](this[_0x0093('0x28')][this[_0x0093('0xac')][_0x2ba78b[_0x0093('0x128')]]['queue']])){this['queueBooked'][this[_0x0093('0xac')][_0x2ba78b[_0x0093('0x128')]][_0x0093('0xb3')]]=[];}this[_0x0093('0x28')][this[_0x0093('0xac')][_0x2ba78b[_0x0093('0x128')]][_0x0093('0xb3')]][_0x0093('0x12d')](_[_0x0093('0x8e')](_[_0x0093('0xcf')](this[_0x0093('0xac')][_0x2ba78b[_0x0093('0x128')]],[_0x0093('0x12e'),_0x0093('0x12c')]),{'status':_0x2ba78b[_0x0093('0xaf')],'paused':_0x2ba78b['paused']}));}}}};function unlockQueueStatus(_0x175396,_0x302a0f){setTimeout(function(){if(_[_0x0093('0x3d')](_0x175396[_0x0093('0x12f')])){loggerBooked[_0x0093('0x98')]('[unlockQueueStatus][undefined]',_0x302a0f);}_0x175396[_0x0093('0x12f')]=!![];loggerBooked[_0x0093('0x7e')](_0x0093('0x130'),_0x302a0f,JSON[_0x0093('0x4a')](_[_0x0093('0xcf')](_0x175396,[_0x0093('0x3f'),_0x0093('0x12f')])));},0x1f3);}Dialer[_0x0093('0x1a')]['syncQueueStatusComplete']=function(_0x3468ca){var _0x3b63de=this;var _0x622911=_0x3b63de[_0x0093('0x1e')][_0x3b63de[_0x0093('0xac')][_0x3468ca['actionid']]['queue']];if(strategy[this[_0x0093('0x1e')][this[_0x0093('0xac')][_0x3468ca[_0x0093('0x128')]]['queue']]['strategy']]==='roundrobin'){if(this[_0x0093('0xac')][_0x3468ca[_0x0093('0x128')]]&&this[_0x0093('0xac')][_0x3468ca[_0x0093('0x128')]][_0x0093('0x12c')]){this['preview'][_0x0093('0x131')](this[_0x0093('0xac')][_0x3468ca[_0x0093('0x128')]]['idHopper'],this[_0x0093('0xac')][_0x3468ca[_0x0093('0x128')]][_0x0093('0x12c')])[_0x0093('0xb7')](function(_0x890fd5){logger[_0x0093('0x98')]('[Catch][Preview][syncQueueStatusComplete]',util[_0x0093('0x97')](_0x890fd5,{'showHidden':![],'depth':null}));})['finally'](function(){_0x3b63de[_0x0093('0xb2')](_0x3b63de[_0x0093('0x1e')][_0x3b63de[_0x0093('0xac')][_0x3468ca[_0x0093('0x128')]][_0x0093('0xb3')]]);_0x3b63de[_0x0093('0x20')][_0x3b63de[_0x0093('0xac')][_0x3468ca[_0x0093('0x128')]]['stateinterface']]['locked']=![];delete _0x3b63de['actions'][_0x3468ca[_0x0093('0x128')]];unlockQueueStatus(_0x622911);});}else{this[_0x0093('0xb2')](this[_0x0093('0x1e')][this[_0x0093('0xac')][_0x3468ca[_0x0093('0x128')]]['queue']]);this[_0x0093('0xc0')]({'active':![],'ContactId':this[_0x0093('0xac')][_0x3468ca[_0x0093('0x128')]][_0x0093('0xd0')],'ListId':this['actions'][_0x3468ca[_0x0093('0x128')]][_0x0093('0xd1')],'VoiceQueueId':this['actions'][_0x3468ca[_0x0093('0x128')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x0093('0xac')][_0x3468ca['actionid']][_0x0093('0xfc')]||undefined})[_0x0093('0xb7')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0x0093('0xac')][_0x3468ca[_0x0093('0x128')]];unlockQueueStatus(_0x622911);}}else if((strategy[this[_0x0093('0x1e')][this['actions'][_0x3468ca['actionid']][_0x0093('0xb3')]][_0x0093('0x129')]]||_0x0093('0x18'))===_0x0093('0x18')){var _0x244715;if(this[_0x0093('0xac')][_0x3468ca[_0x0093('0x128')]]&&!_['isEmpty'](this[_0x0093('0x28')][this[_0x0093('0xac')][_0x3468ca[_0x0093('0x128')]][_0x0093('0xb3')]])){if(this[_0x0093('0x29')][_0x3b63de['actions'][_0x3468ca[_0x0093('0x128')]][_0x0093('0xb3')]]){this[_0x0093('0x29')][_0x3b63de[_0x0093('0xac')][_0x3468ca['actionid']]['queue']]=this['queueBookedRR'][this[_0x0093('0xac')][_0x3468ca[_0x0093('0x128')]][_0x0093('0xb3')]]?this[_0x0093('0x29')][this[_0x0093('0xac')][_0x3468ca[_0x0093('0x128')]]['queue']]:this[_0x0093('0x28')][this[_0x0093('0xac')][_0x3468ca[_0x0093('0x128')]][_0x0093('0xb3')]]?this['queueBooked'][this[_0x0093('0xac')][_0x3468ca[_0x0093('0x128')]][_0x0093('0xb3')]][_0x0093('0x132')]||0x0:0x0;}this[_0x0093('0x28')][this[_0x0093('0xac')][_0x3468ca[_0x0093('0x128')]][_0x0093('0xb3')]][_0x0093('0x132')]=this['queueBookedRR'][this[_0x0093('0xac')][_0x3468ca[_0x0093('0x128')]][_0x0093('0xb3')]];for(var _0x4bd22a=0x0;_0x4bd22a=0x0;})['catch'](myreject(_0x343252)));}}else{_0x180d9f[_0x0093('0x12d')](ami[_0x0093('0xae')]({'action':_0x0093('0x149'),'command':util['format'](_0x0093('0x14a'),_0x4c887a,!_[_0x0093('0x3d')](config['timezones'][_0x31feb3])?_0x31feb3:'')})['then'](function(_0x223582){return _0x223582['content'][_0x0093('0x14d')](_0x0093('0x14e'))>=0x0;})[_0x0093('0xb7')](myreject(_0x343252)));}BPromise[_0x0093('0x14f')](_0x180d9f)[_0x0093('0x3c')](function(_0x20586c){var _0x1227b5=_[_0x0093('0x150')](_0x20586c);if(_0x1227b5){return _0x34141e(_0x1227b5);}else{_0xc19dd6['message']=_0x5f1dcc?_0x0093('0x151'):_0x0093('0x152');return _0x343252(msgResponse(_0x0093('0x153'),_0x0093('0x143'),_0x0093('0x154')+_0x5f1dcc+'\x20'+_0x12ae1c+'\x20Interval\x20is\x20overtime:\x20'+util[_0x0093('0x97')](_0x4c887a,{'showHidden':![],'depth':null})+_0x0093('0x155')+_0x31feb3));}})[_0x0093('0xb7')](function(_0x51e300){return _0x343252(msgResponse(_0x0093('0x142'),_0x0093('0x143'),JSON[_0x0093('0x4a')](_0x51e300)));});});};Dialer[_0x0093('0x1a')][_0x0093('0x156')]=function(_0x4e4e0f){var _0x3a6363=this;return function(){switch(_0x4e4e0f[_0x0093('0x157')]){case'progressive':freeVariablesPredictive(_0x4e4e0f);_0x3a6363['handlePower'](_0x4e4e0f,0x1);break;case _0x0093('0x158'):freeVariablesPredictive(_0x4e4e0f);_0x3a6363[_0x0093('0x159')](_0x4e4e0f,_0x4e4e0f['dialPowerLevel']);break;case _0x0093('0x15a'):_0x3a6363[_0x0093('0x15a')](_0x4e4e0f);break;case _0x0093('0x6'):freeVariablesPredictive(_0x4e4e0f);_0x3a6363['handlePower'](_0x4e4e0f,0x1);break;default:freeVariablesPredictive(_0x4e4e0f);logger[_0x0093('0x98')](_0x0093('0x15b'),_0x4e4e0f[_0x0093('0x3f')],_0x0093('0x15c'));}};};Dialer['prototype'][_0x0093('0x15d')]=_['throttle'](function(_0x4c82b4){return BPromise['resolve']()[_0x0093('0x3c')](cmHopper[_0x0093('0x15e')](_0x4c82b4['id'],previewRecallmeReminderInterval))[_0x0093('0x3c')](function(_0x3e8273){for(var _0x533074=0x0;_0x533074<_0x3e8273['length'];_0x533074++){var _0x3ed365=_0x3e8273[_0x533074]['Agent']['name'];if(_0x3ed365)io['to'](util[_0x0093('0x7a')]('user:%s',_0x3ed365))[_0x0093('0x4d')](_0x0093('0x15f'),{'hopper':_0x3e8273[_0x533074]});}})[_0x0093('0xb7')](function(_0x13adf2){logger[_0x0093('0x98')](_0x0093('0x15d'),_0x13adf2);});},0x3c*0x3e8,{'leading':!![]});Dialer['prototype'][_0x0093('0x160')]=function(_0x286beb){var _0x419c7d=this;return function(){_0x419c7d[_0x0093('0x161')](_0x286beb);};};Dialer[_0x0093('0x1a')][_0x0093('0x8')]=function(_0x5a1649){var _0x58468e=this;if(isNotPreview(_0x5a1649[_0x0093('0x157')])){if(isVoiceQueueOutbound(_0x5a1649['type'])&&isActive(_0x5a1649[_0x0093('0x59')])){_0x5a1649['sendMessageOneNotActive']=!![];BPromise['resolve']()[_0x0093('0x3c')](checkIsLoggedIn(_0x5a1649,_0x5a1649['loggedIn']))['then'](checkIsActive(_0x5a1649,_0x5a1649['dialActive']))[_0x0093('0x3c')](checkInterval(_0x5a1649))[_0x0093('0x3c')](_0x58468e[_0x0093('0x162')](_0x5a1649))[_0x0093('0x3c')](_0x58468e[_0x0093('0x141')](_0x5a1649[_0x0093('0x163')],_0x5a1649[_0x0093('0x164')],_0x5a1649['name'],_0x5a1649))['then'](_0x58468e[_0x0093('0x165')](_0x5a1649[_0x0093('0x43')],_0x5a1649[_0x0093('0x164')],_0x5a1649[_0x0093('0x3f')],_0x5a1649))[_0x0093('0x3c')](_0x58468e[_0x0093('0x156')](_0x5a1649))[_0x0093('0xb7')](loggerCatchQueueSummary(_0x0093('0x166'),_0x5a1649));}else{notSendMessagesQueue(_0x5a1649);}}else{freeVariablesPredictive(_0x5a1649);if(_0x5a1649[_0x0093('0x167')]){_0x58468e['checkPreviewRecallReminder'](_0x5a1649);}}};Dialer['prototype'][_0x0093('0x13d')]=function(){var _0x48c811=this;var _0x164dbd;for(var _0x1c9b14 in this['campaigns']){if(typeof this[_0x0093('0x1f')][_0x1c9b14]!==_0x0093('0x9a')){_0x164dbd=this[_0x0093('0x1f')][_0x1c9b14];if(isCampaignIvr(_0x164dbd[_0x0093('0x4e')])&&isActive(_0x164dbd[_0x0093('0x77')])){_0x164dbd[_0x0093('0xa1')]=!![];BPromise['resolve']()['then'](checkIsActive(_0x164dbd,_0x164dbd[_0x0093('0x77')]))['then'](checkInterval(_0x164dbd))[_0x0093('0x3c')](_0x48c811[_0x0093('0x162')](_0x164dbd))['then'](_0x48c811[_0x0093('0x141')](_0x164dbd['dialGlobalInterval'],_0x164dbd['dialTimezone'],_0x164dbd[_0x0093('0x3f')],_0x164dbd))['then'](_0x48c811[_0x0093('0x165')](_0x164dbd[_0x0093('0x43')],_0x164dbd['dialTimezone'],_0x164dbd[_0x0093('0x3f')],_0x164dbd))['then'](_0x48c811['launchHandleIvr'](_0x164dbd))[_0x0093('0xb7')](loggerCatchQueueSummary(_0x0093('0x168'),_0x164dbd));}else{notSendMessagesCampaign(_0x164dbd);}}}};function getCallerIdRandom(_0x378725,_0x5a3b54){var _0x49c3ec;var _0x1c8fe0;var _0x1fbb3d;if(_0x5a3b54<=0x0){_0x5a3b54=0x1;}_0x49c3ec=new RegExp(_0x0093('0x169')+_0x5a3b54+'}$');_0x1c8fe0=Math[_0x0093('0x16a')](0xa,_0x5a3b54-0x1);_0x1fbb3d=Math[_0x0093('0x16a')](0xa,_0x5a3b54)-0x1;return util[_0x0093('0x7a')]('%s',_[_0x0093('0x16b')](_0x378725,_0x49c3ec,_[_0x0093('0x16c')](_0x1c8fe0,_0x1fbb3d)));}function extractCalleridName(_0xf09e69){var _0x16b322=_0xf09e69[_0x0093('0x16d')](/"(.*?)"/);return _0x16b322?_0x16b322[0x1]:_0xf09e69;}function extractCalleridNumber(_0xade30a){var _0x30627e=_0xade30a[_0x0093('0x16d')](/<(.*?)>/);return _0x30627e?_0x30627e[0x1]:_0xade30a;}Dialer['prototype'][_0x0093('0x16e')]=function(_0x41c767,_0x4e448a){var _0x51a037=this;var _0x3c90e0=uuid['v4']();this[_0x0093('0xac')][_0x3c90e0]=new Action(_0x41c767,_0x4e448a,_0x3c90e0);return new BPromise(function(_0x42e634,_0x4fd3c3){if(_[_0x0093('0x3d')](_0x41c767)&&typeof _0x41c767!==_0x0093('0x16f')){return _0x4fd3c3(msgResponse(_0x0093('0x170'),_0x0093('0x143'),'voiceQueue\x20is\x20undefine'));}if(_['isUndefined'](_0x4e448a['Contact']['phone'])||_0x4e448a[_0x0093('0x171')][_0x0093('0x172')]===null){return _0x4fd3c3(msgResponse(_0x0093('0x170'),_0x0093('0x143'),_0x0093('0x173')));}var _0x1fb447={'XMD-CALLERID':_0x51a037[_0x0093('0xac')][_0x3c90e0][_0x0093('0x174')](),'XMD-AGI':_0x41c767[_0x0093('0x109')]?util[_0x0093('0x7a')]('\x22agi://%s/square,%s\x22',ipAgi,_0x41c767[_0x0093('0x109')]):_0x0093('0x175'),'XMD-AGIAFTER':_0x41c767[_0x0093('0x110')]?util[_0x0093('0x7a')](_0x0093('0x176'),ipAgi,_0x41c767[_0x0093('0x110')]):_0x0093('0x175'),'XMD-QUEUE':_0x41c767[_0x0093('0x4e')]===_0x0093('0x4f')?util[_0x0093('0x7a')](_0x0093('0x177'),_0x41c767[_0x0093('0x3f')],_0x41c767[_0x0093('0x178')]||'',_0x41c767[_0x0093('0x111')]?'c':'',_0x41c767[_0x0093('0x119')]||0x3):'NONE','XMD-CONTACTID':_0x4e448a[_0x0093('0xd0')],'XMD-CDRTYPE':_0x0093('0x5'),'CALLERID(all)':_0x51a037['actions'][_0x3c90e0][_0x0093('0x174')](),'XMD-AMD':_0x41c767[_0x0093('0xe1')]?'ACTIVE':_0x0093('0x175'),'XMD-DESTINATION':_0x0093('0xe0')};if(_0x41c767[_0x0093('0xe1')]){_0x1fb447[_0x0093('0x179')]=_0x41c767[_0x0093('0x17a')]||0x9c4;_0x1fb447[_0x0093('0x17b')]=_0x41c767['dialAMDGreeting']||0x5dc;_0x1fb447[_0x0093('0x17c')]=_0x41c767['dialAMDAfterGreetingSilence']||0x320;_0x1fb447[_0x0093('0x17d')]=_0x41c767[_0x0093('0x17e')]||0x1388;_0x1fb447['XMD-AMDMINWORDLENGTH']=_0x41c767['dialAMDMinWordLength']||0x64;_0x1fb447['XMD-AMDBETWEENWORDSSILENCE']=_0x41c767[_0x0093('0x17f')]||0x32;_0x1fb447[_0x0093('0x180')]=_0x41c767[_0x0093('0x181')]||0x3;_0x1fb447[_0x0093('0x182')]=_0x41c767[_0x0093('0x183')]||0x100;_0x1fb447[_0x0093('0x184')]=_0x41c767[_0x0093('0x185')]||0x1388;}if(_0x41c767[_0x0093('0x4e')]===_0x0093('0x4f')){_0x1fb447[_0x0093('0x186')]=_0x4e448a[_0x0093('0xd3')];}else{_0x1fb447['XMD-CAMPAIGNID']=_0x4e448a[_0x0093('0xfc')];}for(var _0x1cb2dc in _0x4e448a[_0x0093('0x171')]){if(typeof _0x4e448a[_0x0093('0x171')][_0x1cb2dc]!==_0x0093('0x9a')){if(isNotNull(_0x4e448a['Contact'][_0x1cb2dc])&&_0x1cb2dc!=='id'&&_0x1cb2dc!=='tags'&&_0x1cb2dc!==_0x0093('0x187')&&_0x1cb2dc!==_0x0093('0x188')){_0x1fb447[util['format'](_0x0093('0x189'),'XMD-',_['toUpper'](_0x1cb2dc))]=_0x4e448a[_0x0093('0x171')][_0x1cb2dc];}}}var _0x3fe79b=_0x51a037['isTrunkReachable'](_0x41c767[_0x0093('0x76')])?getCallerId(_0x41c767[_0x0093('0x76')]['callerid'],_0x41c767[_0x0093('0x5a')],_0x41c767['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x41c767[_0x0093('0x18a')],_0x41c767['dialRandomLastDigitCallerIdNumber']):_0x41c767[_0x0093('0x18a')]):getCallerId(_[_0x0093('0xdc')](_0x41c767[_0x0093('0x13e')])?_0x41c767[_0x0093('0x76')][_0x0093('0x78')]:_0x41c767[_0x0093('0x13e')][_0x0093('0x78')],_0x41c767[_0x0093('0x5a')],_0x41c767[_0x0093('0x18b')]>0x0?getCallerIdRandom(_0x41c767['dialOriginateCallerIdNumber'],_0x41c767['dialRandomLastDigitCallerIdNumber']):_0x41c767[_0x0093('0x18a')]);if(_0x3fe79b){_0x1fb447[_0x0093('0x18c')]=_0x51a037['actions'][_0x3c90e0]['originatecalleridname']=extractCalleridName(_0x3fe79b);_0x1fb447[_0x0093('0x18d')]=_0x51a037[_0x0093('0xac')][_0x3c90e0][_0x0093('0x18e')]=extractCalleridNumber(_0x3fe79b);}return ami[_0x0093('0xae')]({'actionid':_0x3c90e0,'action':_0x0093('0x170'),'channel':_0x51a037[_0x0093('0xd8')](_0x41c767[_0x0093('0x76')])?util['format'](_0x0093('0x18f'),_0x41c767[_0x0093('0x76')][_0x0093('0x3f')],isNotNull(_0x41c767[_0x0093('0x5c')])?_0x41c767[_0x0093('0x5c')][_0x0093('0x190')]()||'':'',_0x41c767[_0x0093('0x191')]>0x0?_0x4e448a[_0x0093('0x171')][_0x0093('0x172')][_0x0093('0x192')](_0x41c767[_0x0093('0x191')]):_0x4e448a['Contact'][_0x0093('0x172')]):util[_0x0093('0x7a')]('SIP/%s/%s%s',_['isNil'](_0x41c767[_0x0093('0x13e')])?_0x41c767['Trunk'][_0x0093('0x3f')]:_0x41c767[_0x0093('0x13e')][_0x0093('0x3f')],isNotNull(_0x41c767[_0x0093('0x5c')])?_0x41c767['dialPrefix'][_0x0093('0x190')]()||'':'',_0x41c767[_0x0093('0x191')]>0x0?_0x4e448a[_0x0093('0x171')]['phone']['substring'](_0x41c767[_0x0093('0x191')]):_0x4e448a['Contact'][_0x0093('0x172')]),'callerid':_0x3fe79b,'Exten':'xcally-motion-dialer','Context':'from-sip','Priority':'1','variable':_0x1fb447,'timeout':(_0x41c767['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x3c90e0})[_0x0093('0x3c')](function(_0x470bfc){return _0x42e634(_0x470bfc);})[_0x0093('0xb7')](function(_0x4ec80b){_0x41c767[_0x0093('0x193')]+=0x1;var _0x59b5c1=new History(_0x51a037[_0x0093('0xac')][_0x3c90e0]);logger[_0x0093('0x98')](util[_0x0093('0x7a')](_0x0093('0x194'),JSON[_0x0093('0x4a')](_0x4ec80b)));_0x59b5c1['state']=0xe;_0x59b5c1['statedesc']=_0x0093('0x195');_0x59b5c1['starttime']=moment()[_0x0093('0x7a')](_0x0093('0xfb'));_0x59b5c1[_0x0093('0x120')]=_0x59b5c1[_0x0093('0x11f')];_0x51a037[_0x0093('0xca')](_0x59b5c1)[_0x0093('0xb7')](loggerCatch(_0x0093('0x196')));_0x51a037[_0x0093('0xc9')](_0x59b5c1)['catch'](loggerCatch(_0x0093('0x196')))[_0x0093('0x1d')](function(){delete _0x51a037[_0x0093('0xac')][_0x3c90e0];return _0x4fd3c3(msgResponse(_0x0093('0x170'),'Error','originate\x20action\x20Error'));});});});};Dialer[_0x0093('0x1a')][_0x0093('0x2e')]=function(_0x449425){var _0x1d5c41=this[_0x0093('0xac')][_0x449425['actionid']];if(_0x1d5c41){delete this[_0x0093('0xac')][_0x449425[_0x0093('0x128')]];_0x1d5c41['responsetime']=moment()[_0x0093('0x7a')]('YYYY-MM-DD\x20HH:mm:ss');var _0x2b6199=_0x1d5c41[_0x0093('0x4e')]==='ivr'?this[_0x0093('0x1f')][_0x1d5c41[_0x0093('0xb3')]]:this[_0x0093('0x1e')][_0x1d5c41['getQueue']()];if(!this[_0x0093('0xd6')](_0x449425[_0x0093('0x197')])){this[_0x0093('0xb2')](_0x2b6199);return this[_0x0093('0x198')](_0x1d5c41,_0x2b6199,_0x449425)[_0x0093('0xb7')](loggerCatch(_0x0093('0x199')));}this[_0x0093('0x24')][_0x449425[_0x0093('0xdb')]]=_0x1d5c41;}};Dialer['prototype']['checkRetriveMax']=function(_0x30ca2a,_0x20ce02,_0x51215a){var _0x256a11=new History(_0x20ce02);if(_0x256a11[_0x0093('0x101')]+_0x256a11[_0x0093('0xf0')]+_0x256a11['countnoanswerretry']+_0x256a11['countnosuchnumberretry']+_0x256a11[_0x0093('0x11d')]+_0x256a11['countabandonedretry']+_0x256a11['countmachineretry']+_0x256a11['countagentrejectretry']>=_0x51215a['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x30ca2a){case 0x3:if(_0x256a11[_0x0093('0xf1')]>=_0x51215a[_0x0093('0x19a')]-0x1){return!![];}this[_0x0093('0xc0')]({'active':![],'countnoanswerretry':_0x256a11[_0x0093('0xf1')]+=0x1,'scheduledat':moment()[_0x0093('0x103')](_0x51215a[_0x0093('0x19b')],_0x0093('0x104'))[_0x0093('0x7a')](_0x0093('0xfb')),'ContactId':_0x256a11['ContactId'],'ListId':_0x256a11['ListId'],'VoiceQueueId':_0x256a11['VoiceQueueId']||undefined,'CampaignId':_0x256a11['CampaignId']||undefined})['catch'](loggerCatch(_0x0093('0x19c')));break;case 0x5:if(_0x256a11[_0x0093('0x101')]>=_0x51215a['dialBusyMaxRetry']-0x1){return!![];}this[_0x0093('0xc0')]({'active':![],'countbusyretry':_0x256a11[_0x0093('0x101')]+=0x1,'scheduledat':moment()[_0x0093('0x103')](_0x51215a['dialBusyRetryFrequency'],_0x0093('0x104'))[_0x0093('0x7a')](_0x0093('0xfb')),'ContactId':_0x256a11[_0x0093('0xd0')],'ListId':_0x256a11[_0x0093('0xd1')],'VoiceQueueId':_0x256a11[_0x0093('0xd3')]||undefined,'CampaignId':_0x256a11[_0x0093('0xfc')]||undefined})[_0x0093('0xb7')](loggerCatch(_0x0093('0x19d')));break;case 0x8:if(_0x256a11['countcongestionretry']>=_0x51215a[_0x0093('0x19e')]-0x1){return!![];}this[_0x0093('0xc0')]({'active':![],'countcongestionretry':_0x256a11['countcongestionretry']+=0x1,'scheduledat':moment()['add'](_0x51215a[_0x0093('0x19f')],_0x0093('0x104'))[_0x0093('0x7a')](_0x0093('0xfb')),'ContactId':_0x256a11['ContactId'],'ListId':_0x256a11[_0x0093('0xd1')],'VoiceQueueId':_0x256a11[_0x0093('0xd3')]||undefined,'CampaignId':_0x256a11['CampaignId']||undefined})[_0x0093('0xb7')](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x256a11[_0x0093('0xf2')]>=_0x51215a[_0x0093('0x1a0')]-0x1){return!![];}else{this[_0x0093('0xc0')]({'active':![],'countnosuchnumberretry':_0x256a11[_0x0093('0xf2')]+=0x1,'scheduledat':moment()[_0x0093('0x103')](_0x51215a[_0x0093('0x1a1')],_0x0093('0x104'))[_0x0093('0x7a')](_0x0093('0xfb')),'ContactId':_0x256a11[_0x0093('0xd0')],'ListId':_0x256a11[_0x0093('0xd1')],'VoiceQueueId':_0x256a11[_0x0093('0xd3')]||undefined,'CampaignId':_0x256a11[_0x0093('0xfc')]||undefined})[_0x0093('0xb7')](loggerCatch(_0x0093('0x1a2')));}break;case 0xa:if(_0x256a11[_0x0093('0x11d')]>=_0x51215a[_0x0093('0x1a3')]-0x1){return!![];}this[_0x0093('0xc0')]({'active':![],'countdropretry':_0x256a11[_0x0093('0x11d')]+=0x1,'scheduledat':moment()[_0x0093('0x103')](_0x51215a['dialDropRetryFrequency'],_0x0093('0x104'))['format'](_0x0093('0xfb')),'ContactId':_0x256a11[_0x0093('0xd0')],'ListId':_0x256a11[_0x0093('0xd1')],'VoiceQueueId':_0x256a11[_0x0093('0xd3')]||undefined,'CampaignId':_0x256a11[_0x0093('0xfc')]||undefined})[_0x0093('0xb7')](loggerCatch(_0x0093('0x1a4')));break;case 0xb:if(_0x256a11['countabandonedretry']>=_0x51215a[_0x0093('0x126')]-0x1){return!![];}this[_0x0093('0xc0')]({'active':![],'countabandonedretry':_0x256a11[_0x0093('0xf3')]+=0x1,'scheduledat':moment()['add'](_0x51215a[_0x0093('0x127')],_0x0093('0x104'))['format'](_0x0093('0xfb')),'ContactId':_0x256a11[_0x0093('0xd0')],'ListId':_0x256a11[_0x0093('0xd1')],'VoiceQueueId':_0x256a11[_0x0093('0xd3')]||undefined,'CampaignId':_0x256a11[_0x0093('0xfc')]||undefined})[_0x0093('0xb7')](loggerCatch(_0x0093('0x1a5')));break;case 0x13:if(_0x256a11[_0x0093('0xf4')]>=_0x51215a[_0x0093('0x1a6')]-0x1){return!![];}this[_0x0093('0xc0')]({'active':![],'countmachineretry':_0x256a11[_0x0093('0xf4')]+=0x1,'scheduledat':moment()['add'](_0x51215a[_0x0093('0xfa')],'minutes')[_0x0093('0x7a')](_0x0093('0xfb')),'ContactId':_0x256a11['ContactId'],'ListId':_0x256a11[_0x0093('0xd1')],'VoiceQueueId':_0x256a11[_0x0093('0xd3')]||undefined,'CampaignId':_0x256a11['CampaignId']||undefined})[_0x0093('0xb7')](loggerCatch(_0x0093('0xfd')));break;case 0x14:if(_0x256a11[_0x0093('0xf5')]>=_0x51215a[_0x0093('0x1a7')]-0x1){return!![];}this[_0x0093('0xc0')]({'active':![],'countagentrejectretry':_0x256a11[_0x0093('0xf5')]+=0x1,'scheduledat':moment()['add'](_0x51215a[_0x0093('0x1a8')],_0x0093('0x104'))[_0x0093('0x7a')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x256a11[_0x0093('0xd0')],'ListId':_0x256a11['ListId'],'VoiceQueueId':_0x256a11[_0x0093('0xd3')]||undefined,'CampaignId':_0x256a11[_0x0093('0xfc')]||undefined})[_0x0093('0xb7')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0x0093('0x1a')][_0x0093('0x198')]=function(_0x52c67f,_0x3b4cfe,_0x4ce741){var _0x47eb1c=this;var _0x49557a=new History(_0x52c67f);return new BPromise(function(_0x4d30f2,_0x3071ba){if(_[_0x0093('0x3d')](_0x3b4cfe)&&typeof _0x3b4cfe!=='object'){return _0x3071ba(msgResponse(_0x0093('0x1a9'),_0x0093('0x143'),_0x0093('0x1aa')));}if(_[_0x0093('0x3d')](_0x4ce741)&&typeof _0x4ce741!==_0x0093('0x16f')){return _0x3071ba(msgResponse(_0x0093('0x1a9'),_0x0093('0x143'),_0x0093('0x1ab')));}switch(_0x4ce741[_0x0093('0x10d')]){case'0':_0x3b4cfe[_0x0093('0x65')]+=0x1;_0x49557a[_0x0093('0xa8')]=0x0;_0x49557a[_0x0093('0xeb')]=_0x0093('0x1ac');_0x49557a[_0x0093('0xf2')]+=0x1;_0x49557a[_0x0093('0xed')]+=0x1;ami['emit'](_0x0093('0x1ad'),ut[_0x0093('0xe7')](_0x52c67f,'nosuchnumber'));_0x47eb1c[_0x0093('0xca')](_0x49557a)[_0x0093('0xb7')](loggerCatch(_0x0093('0xef')));if(_0x47eb1c['checkRetriveMax'](0x0,_0x52c67f,_0x3b4cfe)){if(_0x49557a[_0x0093('0xf2')]>=_0x3b4cfe[_0x0093('0x1a0')]){_0x47eb1c[_0x0093('0x102')](_0x49557a,_0x4d30f2,_0x3071ba,_0x0093('0x1ae'));}else{_0x47eb1c[_0x0093('0xf7')](_0x49557a,_0x4d30f2,_0x3071ba,_0x0093('0x1ae'));}}break;case'3':_0x3b4cfe[_0x0093('0x64')]+=0x1;_0x49557a[_0x0093('0xa8')]=0x3;_0x49557a[_0x0093('0xeb')]=_0x0093('0x1af');_0x49557a['countnoanswerretry']+=0x1;_0x49557a[_0x0093('0xed')]+=0x1;ami[_0x0093('0x4d')]('custom:agentnoanswer',ut[_0x0093('0xe7')](_0x52c67f,'noanswer'));_0x47eb1c['createHistory'](_0x49557a)[_0x0093('0xb7')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x47eb1c[_0x0093('0x1b0')](0x3,_0x52c67f,_0x3b4cfe)){if(_0x49557a[_0x0093('0xf1')]>=_0x3b4cfe[_0x0093('0x19a')]){_0x47eb1c[_0x0093('0x102')](_0x49557a,_0x4d30f2,_0x3071ba,_0x0093('0x1b1'));}else{_0x47eb1c[_0x0093('0xf7')](_0x49557a,_0x4d30f2,_0x3071ba,_0x0093('0x1b1'));}}break;case'5':_0x3b4cfe[_0x0093('0x60')]+=0x1;_0x49557a[_0x0093('0xa8')]=0x5;_0x49557a[_0x0093('0xeb')]=_0x0093('0x1b2');_0x49557a[_0x0093('0x101')]+=0x1;_0x49557a[_0x0093('0xed')]+=0x1;ami[_0x0093('0x4d')](_0x0093('0x1b3'),ut[_0x0093('0xe7')](_0x52c67f,_0x0093('0x1b4')));_0x47eb1c[_0x0093('0xca')](_0x49557a)['catch'](loggerCatch(_0x0093('0x1b5')));if(_0x47eb1c[_0x0093('0x1b0')](0x5,_0x52c67f,_0x3b4cfe)){if(_0x49557a[_0x0093('0x101')]>=_0x3b4cfe[_0x0093('0x1b6')]){_0x47eb1c['createStateFinal'](_0x49557a,_0x4d30f2,_0x3071ba,'reason\x205\x20busy');}else{_0x47eb1c['stateGlobal'](_0x49557a,_0x4d30f2,_0x3071ba,_0x0093('0x1b7'));}}break;case'8':_0x3b4cfe[_0x0093('0x61')]+=0x1;_0x49557a[_0x0093('0xa8')]=0x8;_0x49557a[_0x0093('0xeb')]='Congestion';_0x49557a['countcongestionretry']+=0x1;_0x49557a[_0x0093('0xed')]+=0x1;ami[_0x0093('0x4d')]('custom:agentcongestion',ut[_0x0093('0xe7')](_0x52c67f,_0x0093('0x1b8')));_0x47eb1c[_0x0093('0xca')](_0x49557a)['catch'](loggerCatch(_0x0093('0x1b9')));if(_0x47eb1c['checkRetriveMax'](0x8,_0x52c67f,_0x3b4cfe)){if(_0x49557a['countcongestionretry']>=_0x3b4cfe['dialCongestionMaxRetry']){_0x47eb1c[_0x0093('0x102')](_0x49557a,_0x4d30f2,_0x3071ba,_0x0093('0x1ba'));}else{_0x47eb1c[_0x0093('0xf7')](_0x49557a,_0x4d30f2,_0x3071ba,_0x0093('0x1ba'));}}break;case'11':_0x3b4cfe[_0x0093('0x1bb')]+=0x1;_0x49557a[_0x0093('0xa8')]=0xb;_0x49557a[_0x0093('0xeb')]='Abandoned';_0x49557a[_0x0093('0xf3')]+=0x1;_0x49557a[_0x0093('0xed')]+=0x1;_0x47eb1c[_0x0093('0xca')](_0x49557a)['catch'](loggerCatch(_0x0093('0x1bc')));if(_0x47eb1c[_0x0093('0x1b0')](0xb,_0x52c67f,_0x3b4cfe)){if(_0x49557a[_0x0093('0xf3')]>=_0x3b4cfe['dialAbandonedMaxRetry']){_0x47eb1c[_0x0093('0x102')](_0x49557a,_0x4d30f2,_0x3071ba,_0x0093('0x1bd'));}else{_0x47eb1c[_0x0093('0xf7')](_0x49557a,_0x4d30f2,_0x3071ba,_0x0093('0x1bd'));}}break;case'20':_0x3b4cfe[_0x0093('0x1be')]+=0x1;_0x49557a[_0x0093('0xa8')]=0x14;_0x49557a[_0x0093('0xeb')]=_0x0093('0x1bf');_0x49557a[_0x0093('0xf5')]+=0x1;_0x49557a[_0x0093('0xed')]+=0x1;ami[_0x0093('0x4d')](_0x0093('0x1c0'),ut[_0x0093('0xe7')](_0x52c67f,_0x0093('0x1c1')));_0x47eb1c['createHistory'](_0x49557a)[_0x0093('0xb7')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x47eb1c[_0x0093('0x1b0')](0x14,_0x52c67f,_0x3b4cfe)){if(_0x49557a[_0x0093('0xf5')]>=_0x3b4cfe[_0x0093('0x1a7')]){_0x47eb1c[_0x0093('0x102')](_0x49557a,_0x4d30f2,_0x3071ba,_0x0093('0x1c2'));}else{_0x47eb1c[_0x0093('0xf7')](_0x49557a,_0x4d30f2,_0x3071ba,_0x0093('0x1c2'));}}break;default:_0x3b4cfe[_0x0093('0x67')]+=0x1;_0x49557a[_0x0093('0xa8')]=0xc;_0x49557a[_0x0093('0xeb')]=_0x4ce741['reason'];_0x47eb1c['createHistory'](_0x49557a)[_0x0093('0xb7')](loggerCatch(_0x0093('0x1c3')));if(_0x47eb1c[_0x0093('0x1b0')](_0x4ce741[_0x0093('0x10d')],_0x52c67f,_0x3b4cfe)){if(_0x49557a[_0x0093('0x101')]+_0x49557a['countcongestionretry']+_0x49557a[_0x0093('0xf1')]+_0x49557a[_0x0093('0xf2')]+_0x49557a['countdropretry']+_0x49557a[_0x0093('0xf3')]+_0x49557a[_0x0093('0xf4')]+_0x49557a[_0x0093('0xf5')]>=_0x3b4cfe[_0x0093('0xf6')]){_0x47eb1c[_0x0093('0xf7')](_0x49557a,_0x4d30f2,_0x3071ba,_0x4ce741[_0x0093('0x10d')]);}else{_0x47eb1c[_0x0093('0x102')](_0x49557a,_0x4d30f2,_0x3071ba,_0x4ce741[_0x0093('0x10d')]);}}}});};Dialer[_0x0093('0x1a')]['stateGlobal']=function(_0xffbb22,_0x587fef,_0x5b1945,_0x204441){var _0x6b2d18=new Final(_0xffbb22);_0x6b2d18[_0x0093('0xa8')]=0xf;_0x6b2d18['statedesc']=_0x0093('0x1c4');this['createStateFinal'](_0x6b2d18,_0x587fef,_0x5b1945,_0x204441);};Dialer['prototype']['createStateFinal']=function(_0x440569,_0x2b9a0c,_0x18cda8,_0x1b5c9b){this[_0x0093('0xc9')](_0x440569)[_0x0093('0x3c')](function(){return _0x2b9a0c(msgResponse(_0x0093('0x1a9'),_0x0093('0xd7'),_0x1b5c9b));})[_0x0093('0xb7')](function(){return _0x18cda8(msgResponse(_0x0093('0x1c5'),_0x0093('0x143'),'contact\x20not\x20moved'));});};Dialer[_0x0093('0x1a')][_0x0093('0x15a')]=function(_0x3ebef5){var _0x579d66=_0x3ebef5[_0x0093('0x1c6')]/0x64;var _0x599d24=_0x3ebef5[_0x0093('0x63')]/(_0x3ebef5[_0x0093('0x63')]+_0x3ebef5[_0x0093('0x5e')]);var _0x5cd93a=Math[_0x0093('0x1c7')](_0x3ebef5[_0x0093('0x70')]*(_0x3ebef5[_0x0093('0x1c8')]/0x64));var _0x496b48=Math['round'](_0x3ebef5['predictiveIntervalAvailable']*(_0x3ebef5[_0x0093('0x1c9')]/0x64));var _0x18351c=_0x3ebef5[_0x0093('0x51')]+_0x3ebef5[_0x0093('0xa2')];var _0x153c6e=Math['floor'](_0x3ebef5[_0x0093('0x73')]*_0x3ebef5[_0x0093('0x74')]*_0x3ebef5[_0x0093('0x6d')]*_0x3ebef5[_0x0093('0x6e')]);if(_[_0x0093('0x3d')](_0x3ebef5['startProgressive'])){if(!_[_0x0093('0x3d')](_0x3ebef5['startPredictive'])){_0x3ebef5[_0x0093('0x26')]=undefined;loggerPredictive[_0x0093('0x98')](_0x0093('0x1ca'),_0x0093('0x1cb'));}if(!_[_0x0093('0x3d')](_0x3ebef5[_0x0093('0x91')])){loggerPredictive[_0x0093('0x98')]('[startMethodPredictive][StartProgressive]',_0x0093('0x1cc'));clearInterval(_0x3ebef5['handlePredictive']);_0x3ebef5['handlePredictive']=undefined;}_0x3ebef5[_0x0093('0x27')]=moment()[_0x0093('0x7a')](_0x0093('0xfb'));loggerPredictive['info'](_0x3ebef5[_0x0093('0x3f')],_0x0093('0x1cd'),_0x3ebef5[_0x0093('0x27')]);this['handlePower'](_0x3ebef5,0x1);}else if(ifInterval(_0x3ebef5[_0x0093('0x1ce')],_0x3ebef5[_0x0093('0x27')])){this[_0x0093('0x159')](_0x3ebef5,0x1);loggerPredictiveCalls[_0x0093('0x7e')](_0x0093('0x1cf'),_0x3ebef5['startProgressive'],_0x3ebef5[_0x0093('0x3f')]);_0x3ebef5[_0x0093('0x73')]=0x0;_0x3ebef5[_0x0093('0x6c')]=0x0;}else if(_0x579d66<_0x599d24&&_0x3ebef5['dialPredictiveOptimization']===_0x0093('0x1d0')){freeVariablesPredictive(_0x3ebef5);loggerPredictive[_0x0093('0x7e')](_0x0093('0x1d1'),_0x0093('0x1d2'),_0x599d24,'startProgressive',_0x3ebef5[_0x0093('0x3f')]);}else if(_0x153c6e<_0x3ebef5[_0x0093('0x6c')]&&_0x3ebef5['dialPredictiveOptimization']===_0x0093('0x1d0')){freeVariablesPredictive(_0x3ebef5);loggerPredictive['info'](_0x0093('0x1d3'),_0x0093('0x1d4'),_0x153c6e,_0x0093('0x1d5'),_0x3ebef5[_0x0093('0x6c')],'startProgressive',_0x3ebef5[_0x0093('0x3f')]);}else if(!ifInterval(_0x3ebef5[_0x0093('0x1ce')],_0x3ebef5[_0x0093('0x27')])&&_['isUndefined'](_0x3ebef5[_0x0093('0x26')])&&!_[_0x0093('0x3d')](_0x3ebef5[_0x0093('0x27')])){_0x3ebef5[_0x0093('0x26')]=moment()[_0x0093('0x7a')](_0x0093('0xfb'));loggerPredictive[_0x0093('0x7e')](_0x3ebef5[_0x0093('0x3f')],'started\x20in\x20predictive\x20at',_0x3ebef5[_0x0093('0x26')]);this['averageHandleTime'](_0x3ebef5[_0x0093('0x1ce')])[_0x0093('0x3c')](this[_0x0093('0x1d6')](_0x3ebef5))[_0x0093('0x3c')](mergeDataErlangB(_0x3ebef5))[_0x0093('0x3c')](this[_0x0093('0x1d7')](_0x3ebef5))[_0x0093('0xb7')](loggerCatchPredictive(_0x0093('0x1d8'),_0x3ebef5));}else if(!ifInterval(_0x3ebef5[_0x0093('0x1ce')],_0x3ebef5[_0x0093('0x26')])){_0x3ebef5[_0x0093('0x6c')]=0x0;_0x3ebef5[_0x0093('0x26')]=moment()['format'](_0x0093('0xfb'));loggerPredictive[_0x0093('0x7e')](_0x3ebef5[_0x0093('0x3f')],_0x0093('0x1d9'),_0x3ebef5[_0x0093('0x26')]);clearInterval(_0x3ebef5[_0x0093('0x91')]);_0x3ebef5['handlePredictive']=undefined;this[_0x0093('0xbd')](_0x3ebef5[_0x0093('0x1ce')])[_0x0093('0x3c')](this['getDataPredictive'](_0x3ebef5))[_0x0093('0x3c')](mergeDataErlangB(_0x3ebef5))[_0x0093('0x3c')](this[_0x0093('0x1d7')](_0x3ebef5))[_0x0093('0xb7')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x3ebef5));}else if(_0x3ebef5[_0x0093('0x70')]&&_0x18351c<_0x3ebef5[_0x0093('0x70')]-_0x496b48){freeVariablesPredictive(_0x3ebef5);loggerPredictive[_0x0093('0x7e')](_0x3ebef5[_0x0093('0x3f')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x18351c,_0x0093('0x1da'),_0x3ebef5[_0x0093('0x70')],'-',_0x496b48,'=',_0x3ebef5[_0x0093('0x70')]-_0x496b48,')');}else if(_0x3ebef5[_0x0093('0x70')]&&_0x18351c>_0x3ebef5['predictiveIntervalAvailable']+_0x5cd93a){freeVariablesPredictive(_0x3ebef5);loggerPredictive['info'](_0x3ebef5[_0x0093('0x3f')],_0x0093('0x1db'),_0x18351c,_0x0093('0x1dc'),_0x3ebef5['predictiveIntervalAvailable'],'+',_0x5cd93a,'=',_0x3ebef5['predictiveIntervalAvailable']+_0x5cd93a,')');}};Dialer[_0x0093('0x1a')][_0x0093('0x1d6')]=function(_0x16ce4a){var _0x1398da=this;return function(_0x57a052){return new BPromise(function(_0x389b48,_0x194c53){_[_0x0093('0x8e')](_0x16ce4a,_0x57a052[0x0]);if(checkGetDataPredictive(_0x57a052[0x0])){var _0x36c5f0=_0x16ce4a[_0x0093('0x70')]=_0x16ce4a[_0x0093('0xa2')]+_0x16ce4a[_0x0093('0x51')];var _0x5cd0b1=_0x16ce4a[_0x0093('0x1ce')]*0x3c;var _0x5322a1=_0x57a052[0x0][_0x0093('0x69')]+_0x57a052[0x0][_0x0093('0x85')];var _0x173fde=(_0x57a052[0x0][_0x0093('0x68')]+_0x57a052[0x0][_0x0093('0x6b')]+_0x57a052[0x0][_0x0093('0x6a')])/_0x57a052[0x0][_0x0093('0x71')];_0x16ce4a[_0x0093('0x6d')]=_0x173fde>0x0?_0x173fde:0x1;switch(_0x16ce4a[_0x0093('0x1dd')]){case _0x0093('0x1d0'):var _0x3a99df=_0x16ce4a['dialPredictiveOptimizationPercentage']/0x64;return _0x1398da[_0x0093('0x1de')](_0x36c5f0,_0x5cd0b1,_0x5322a1,_0x173fde,_0x3a99df)[_0x0093('0x3c')](function(_0x480285){return _0x389b48(_0x480285);});case _0x0093('0x1df'):var _0x456275=_0x16ce4a['dialPredictiveOptimizationPercentage']/0x64;return _0x1398da[_0x0093('0x1e0')](_0x36c5f0,_0x5cd0b1,_0x5322a1,_0x173fde,_0x456275)['then'](function(_0x27f480){return _0x389b48(_0x27f480);});default:return _0x194c53(msgResponse(_0x0093('0x1e1'),_0x0093('0x143'),_0x0093('0x1e2')));}}else{return _0x194c53(msgResponse(_0x0093('0x1e1'),'Failure',_0x0093('0x1e3')));}});};};Dialer[_0x0093('0x1a')]['getDataPredictiveOld']=function(_0x5f4f5b){var _0x385c32=this;return function(_0x37974d){return new BPromise(function(_0x23b696,_0x3a94d8){_[_0x0093('0x8e')](_0x5f4f5b,_0x37974d[0x0]);if(checkGetDataPredictive(_0x37974d[0x0])){loggerPredictive[_0x0093('0x7e')](JSON[_0x0093('0x4a')](_0x37974d[0x0]));if(_0x5f4f5b['dialPredictiveOptimization']===_0x0093('0x1d0')){return _0x385c32[_0x0093('0xc7')](_0x5f4f5b['id'])[_0x0093('0x3c')](function(_0x19e6e7){var _0x47a2df=_0x5f4f5b[_0x0093('0x52')]-_0x19e6e7[0x0][_0x0093('0x1e4')];var _0xfd04d2=_0x5f4f5b[_0x0093('0x1ce')]*0x3c;var _0x495794=_0x37974d[0x0][_0x0093('0x69')]+_0x37974d[0x0][_0x0093('0x85')];var _0x47d075=(_0x37974d[0x0][_0x0093('0x68')]+_0x37974d[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x37974d[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x37974d[0x0]['predictiveIntervalTotalCalls'];var _0x141bf9=_0x5f4f5b[_0x0093('0x1c6')]/0x64;_0x5f4f5b[_0x0093('0x6f')]=_0x19e6e7[0x0][_0x0093('0x1e4')]||0x0;_0x5f4f5b[_0x0093('0x6d')]=_0x47d075>0x0?_0x47d075:0x1;return _0x385c32['abandonmentRate'](_0x47a2df,_0xfd04d2,_0x495794,_0x47d075,_0x141bf9);})[_0x0093('0x3c')](function(_0x377526){return _0x23b696(_0x377526);})[_0x0093('0xb7')](function(_0x377ca9){return _0x3a94d8(msgResponse(_0x0093('0x1e5'),_0x0093('0x143'),JSON['stringify'](_0x377ca9)));});}if(_0x5f4f5b[_0x0093('0x1dd')]===_0x0093('0x1df')){return _0x385c32[_0x0093('0xc7')](_0x5f4f5b['id'])[_0x0093('0x3c')](function(_0x5e5c03){var _0x1aebf9=_0x5f4f5b[_0x0093('0x52')]-_0x5e5c03[0x0]['outboundQueuePauses'];var _0x42dd27=_0x5f4f5b[_0x0093('0x1ce')]*0x3c;var _0x53b6c8=_0x37974d[0x0]['predictiveIntervalAvgTalktime']+_0x37974d[0x0][_0x0093('0x85')];var _0x4e432c=(_0x37974d[0x0]['predictiveIntervalAnsweredCalls']+_0x37974d[0x0][_0x0093('0x6b')]+_0x37974d[0x0][_0x0093('0x6a')])/_0x37974d[0x0][_0x0093('0x71')];var _0x4ea546=_0x5f4f5b[_0x0093('0x1c6')]/0x64;_0x5f4f5b[_0x0093('0x6f')]=_0x5e5c03[0x0][_0x0093('0x1e4')]||0x0;_0x5f4f5b[_0x0093('0x6d')]=_0x4e432c>0x0?_0x4e432c:0x1;return _0x385c32[_0x0093('0x1e0')](_0x1aebf9,_0x42dd27,_0x53b6c8,_0x4e432c,_0x4ea546);})[_0x0093('0x3c')](function(_0x317e80){return _0x23b696(_0x317e80);})[_0x0093('0xb7')](function(_0x404917){return _0x3a94d8(msgResponse(_0x0093('0x1e5'),_0x0093('0x143'),JSON[_0x0093('0x4a')](_0x404917)));});}}else{return _0x3a94d8(msgResponse(_0x0093('0x1e1'),_0x0093('0x143'),_0x0093('0x1e3')));}});};};Dialer['prototype']['startMethodPredictive']=function(_0x38245d){var _0x1c48a6=this;return function(){var _0x593d57=0x0;var _0x1c3069=Math[_0x0093('0x1e6')](_0x38245d[_0x0093('0x8b')]*0x3e8);if(_0x1c3069>0x0){_0x1c3069=_0x1c3069<0x64?0x64:_0x1c3069;loggerPredictive['info'](_0x38245d[_0x0093('0x3f')],_0x0093('0x1e7'),_0x1c3069,_0x0093('0x4b'));_0x38245d[_0x0093('0x91')]=setInterval(function(){_0x1c48a6[_0x0093('0x91')](_0x38245d);loggerPredictiveCalls[_0x0093('0x7e')]('[handlePredictive]',_0x593d57+=0x1);},_0x1c3069);}else{loggerPredictive[_0x0093('0x7e')](_0x38245d['name'],_0x0093('0x1e8'));}};};Dialer[_0x0093('0x1a')][_0x0093('0x1e9')]=function(_0x1ec1ef,_0x14ddf7){var _0x1e9963=this;return function(_0x589a88){if(_[_0x0093('0x48')](_0x589a88)){if(_[_0x0093('0xdc')](_0x14ddf7[_0x0093('0xd2')])||!_0x14ddf7[_0x0093('0x1ea')]){if(_0x1ec1ef[_0x0093('0x157')]===_0x0093('0x6')){_0x1ec1ef[_0x0093('0x12f')]=_[_0x0093('0x3d')](_0x1ec1ef[_0x0093('0x12f')])?!![]:_0x1ec1ef['queueStatusComplete'];var _0x478191=uuid['v4']();_0x1e9963[_0x0093('0xac')][_0x478191]=new Action(_0x1ec1ef,_0x14ddf7,_0x478191);loggerBooked[_0x0093('0x7e')]('[booked][checkContactBlack]',_0x478191,_0x0093('0x1eb'),JSON['stringify'](_0x1ec1ef[_0x0093('0x12f')]),'Queue:\x20',_0x1ec1ef[_0x0093('0x3f')]);if(_0x1ec1ef['queueStatusComplete']){_0x1ec1ef[_0x0093('0x12f')]=![];_0x1e9963[_0x0093('0x28')][_0x1e9963['actions'][_0x478191][_0x0093('0xb3')]]=[];ami[_0x0093('0xae')]({'actionid':_0x478191,'action':_0x0093('0x1ec'),'queue':_0x1ec1ef[_0x0093('0x3f')]})[_0x0093('0xb7')](function(){_0x1e9963[_0x0093('0xb2')](_0x1ec1ef);_0x1e9963[_0x0093('0xc0')]({'active':![],'ContactId':_0x1e9963[_0x0093('0xac')][_0x478191][_0x0093('0xd0')],'ListId':_0x1e9963[_0x0093('0xac')][_0x478191][_0x0093('0xd1')],'VoiceQueueId':_0x1e9963[_0x0093('0xac')][_0x478191]['VoiceQueueId']||undefined,'CampaignId':_0x1e9963['actions'][_0x478191][_0x0093('0xfc')]||undefined})['catch'](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x1e9963['actions'][_0x478191];});}else{loggerBooked[_0x0093('0x7e')]('[booked][checkContactBlack][else]',JSON[_0x0093('0x4a')](_0x1ec1ef[_0x0093('0x12f')]),'Queue:\x20',_0x1ec1ef[_0x0093('0x3f')]);_0x1e9963[_0x0093('0xb2')](_0x1ec1ef);_0x1e9963[_0x0093('0xc0')]({'active':![],'ContactId':_0x1e9963[_0x0093('0xac')][_0x478191][_0x0093('0xd0')],'ListId':_0x1e9963['actions'][_0x478191][_0x0093('0xd1')],'VoiceQueueId':_0x1e9963[_0x0093('0xac')][_0x478191][_0x0093('0xd3')]||undefined,'CampaignId':_0x1e9963[_0x0093('0xac')][_0x478191][_0x0093('0xfc')]||undefined})['catch'](loggerCatch(_0x0093('0x1ed')));delete _0x1e9963[_0x0093('0xac')][_0x478191];}}else{return _0x1e9963[_0x0093('0x16e')](_0x1ec1ef,_0x14ddf7);}}else{if(getDiff(_0x14ddf7[_0x0093('0x1ee')])<_0x1ec1ef['dialRecallMeTimeout']*0x3c){if(_0x14ddf7[_0x0093('0x1ef')]&&!_0x14ddf7[_0x0093('0x1ef')][_0x0093('0x1f0')]){_0x1e9963['preview'][_0x0093('0x131')](_0x14ddf7['id'])[_0x0093('0x1d')](function(){_0x1e9963[_0x0093('0xb2')](_0x1ec1ef);});}else{_0x1e9963[_0x0093('0xc1')]({'active':![]},_0x14ddf7['id'],0x1)[_0x0093('0x1d')](function(){_0x1e9963[_0x0093('0xb2')](_0x1ec1ef);});}}else{_0x1ec1ef[_0x0093('0x66')]+=0x1;_0x1e9963[_0x0093('0xb2')](_0x1ec1ef);if(_0x1ec1ef[_0x0093('0x1f1')]){_0x1e9963['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x14ddf7[_0x0093('0xd0')],'ListId':_0x14ddf7[_0x0093('0xd1')],'VoiceQueueId':_0x14ddf7[_0x0093('0xd3')]||undefined,'CampaignId':_0x14ddf7[_0x0093('0xfc')]||undefined})[_0x0093('0xb7')](loggerCatch(_0x0093('0x1f2')));_0x1e9963[_0x0093('0xca')](createObjHistory(_0x1ec1ef,_0x14ddf7,'RECALLINQUEUE',0x17,_0x0093('0x1f3')))['catch'](loggerCatch(_0x0093('0x1f4')));}else{_0x1e9963['saveInDb'](createObjHistory(_0x1ec1ef,_0x14ddf7,_0x0093('0x1f5'),0x16,_0x0093('0x1f6')),_0x0093('0x1f7'),_0x0093('0x1f8'));}}}}else{_0x1ec1ef['outboundBlacklistCallsDay']+=0x1;_0x1e9963['saveInDb'](createObjHistory(_0x1ec1ef,_0x14ddf7,'BLACKLIST',0xd,_0x0093('0x1f9')),_0x0093('0x1fa'),_0x0093('0x1fb'));throw _0x0093('0x1fc');}};};Dialer[_0x0093('0x1a')][_0x0093('0x161')]=function(_0x3edd06){var _0x16e37e=this;var _0x13dd72=_0x3edd06['limitCalls']-_0x3edd06[_0x0093('0x72')]-_0x3edd06[_0x0093('0xc4')];emitCampaignSummary(_0x3edd06);if(_0x13dd72>0x0){if(_0x13dd72>this[_0x0093('0x22')]){_0x13dd72=this[_0x0093('0x22')];}_0x3edd06[_0x0093('0xc4')]+=_0x13dd72;this[_0x0093('0xc5')](_0x3edd06['id'],_0x13dd72,_0x3edd06[_0x0093('0x1fd')],_0x3edd06)[_0x0093('0x3c')](function(_0x3c69d3){_0x3edd06[_0x0093('0xc4')]-=_0x13dd72;_0x3edd06[_0x0093('0xc4')]=_0x3edd06[_0x0093('0xc4')]>0x0?_0x3edd06[_0x0093('0xc4')]:0x0;if(!checkContactEmpty(_0x3c69d3)){_0x3edd06['message']=_0x0093('0x9f');logger[_0x0093('0x7e')](_0x0093('0x1fe')+_0x3edd06[_0x0093('0x3f')]);}else{_0x3edd06[_0x0093('0x72')]+=_0x3c69d3[_0x0093('0x99')];_0x3edd06['message']=_0x0093('0x1ff');for(var _0x3f0e52=0x0;_0x3f0e52<_0x3c69d3[_0x0093('0x99')];_0x3f0e52+=0x1){_0x3edd06[_0x0093('0x200')]+=0x1;if(_[_0x0093('0xdc')](_0x3c69d3[_0x3f0e52])||_[_0x0093('0xdc')](_0x3c69d3[_0x3f0e52][_0x0093('0x171')])||_[_0x0093('0xdc')](_0x3c69d3[_0x3f0e52][_0x0093('0x171')][_0x0093('0x172')])){_0x16e37e['emptyContact'](_0x0093('0x201'),_0x3edd06,_0x3c69d3[_0x3f0e52]);}else{_0x16e37e[_0x0093('0xbb')](_[_0x0093('0xcf')](_0x3c69d3[_0x3f0e52],[_0x0093('0xfc'),'Contact.phone']))[_0x0093('0x3c')](_0x16e37e[_0x0093('0x1e9')](_0x3edd06,_0x3c69d3[_0x3f0e52]))[_0x0093('0xb7')](_0x16e37e['loggerHandler'](_0x0093('0x202'),_0x3edd06));}}}})[_0x0093('0xb7')](loggerGetContactDialer(_0x0093('0x203'),_0x3edd06,_0x13dd72));}};Dialer['prototype'][_0x0093('0x159')]=function(_0x32356a,_0x19fbcf){var _0x30d2f7=this;var _0x35e1a7=[];var _0x5974c0=_0x19fbcf>=0x1?_0x19fbcf:0x1;if(_0x32356a[_0x0093('0x157')]==='booked'){_0x5974c0=0x1;}var _0x5cdd6c=Math[_0x0093('0x1e6')](_0x32356a['available']*_0x5974c0)-_0x32356a[_0x0093('0x72')]-_0x32356a[_0x0093('0xc4')];emitVoiceQueueSummary(_0x32356a);if(_0x32356a[_0x0093('0x204')]>0x0){var _0x3bc1f1=_0x32356a[_0x0093('0x204')]-_0x32356a[_0x0093('0x72')]-_0x32356a['talking']-_0x32356a[_0x0093('0xc4')]-_0x32356a['pTalking'];if(_0x5cdd6c>_0x3bc1f1){_0x5cdd6c=_0x3bc1f1;}}if(_0x5cdd6c>0x0){if(_0x32356a['dialMethod']===_0x0093('0x6')){_0x5cdd6c=0x1;}if(_0x5cdd6c>this[_0x0093('0x22')]){_0x5cdd6c=this[_0x0093('0x22')];}_0x32356a[_0x0093('0xc4')]+=_0x5cdd6c;for(var _0xf14772 in this[_0x0093('0x20')]){if(typeof this[_0x0093('0x20')][_0xf14772]!=='undefined'){if(this[_0x0093('0x20')][_0xf14772]['state']===_0x0093('0x205')&&this[_0x0093('0x20')][_0xf14772][_0x0093('0xaf')]==='reachable'){_0x35e1a7[_0x0093('0x12d')](this['agents'][_0xf14772]['id']);}}}this[_0x0093('0xc3')](_0x32356a['id'],_0x35e1a7,_0x5cdd6c,_0x32356a[_0x0093('0x1fd')],_0x32356a)[_0x0093('0x3c')](function(_0x53e2df){_0x32356a['temp']-=_0x5cdd6c;_0x32356a[_0x0093('0xc4')]=_0x32356a[_0x0093('0xc4')]>0x0?_0x32356a['temp']:0x0;if(!checkContactEmpty(_0x53e2df)){_0x30d2f7[_0x0093('0xb6')](_0x32356a)[_0x0093('0x3c')](sendMessageReschedule(_0x32356a))['catch'](loggerCatch(_0x0093('0xb8')));}else{_0x32356a['originated']+=_0x53e2df[_0x0093('0x99')];_0x32356a[_0x0093('0x44')]=_0x32356a[_0x0093('0x157')]===_0x0093('0x6')?'ACTIVE':'RUNNING';for(var _0x4db2bc=0x0;_0x4db2bc<_0x53e2df[_0x0093('0x99')];_0x4db2bc+=0x1){if(_[_0x0093('0xdc')](_0x53e2df[_0x4db2bc])||_[_0x0093('0xdc')](_0x53e2df[_0x4db2bc][_0x0093('0x171')])||_['isNil'](_0x53e2df[_0x4db2bc][_0x0093('0x171')][_0x0093('0x172')])){_0x30d2f7[_0x0093('0xcc')](_0x0093('0x201'),_0x32356a,_0x53e2df[_0x4db2bc]);}else{_0x30d2f7[_0x0093('0xb9')](_[_0x0093('0xcf')](_0x53e2df[_0x4db2bc],['VoiceQueueId',_0x0093('0x206')]))['then'](_0x30d2f7[_0x0093('0x1e9')](_0x32356a,_0x53e2df[_0x4db2bc]))[_0x0093('0xb7')](_0x30d2f7[_0x0093('0x207')](_0x0093('0x201'),_0x32356a));}}}})['catch'](loggerGetContactDialer(_0x0093('0x208'),_0x32356a,_0x5cdd6c));}};Dialer[_0x0093('0x1a')][_0x0093('0x91')]=function(_0x380a4d){if(_0x380a4d[_0x0093('0x204')]>0x0){var _0x2a392b=_0x380a4d[_0x0093('0x204')]-_0x380a4d[_0x0093('0x72')]-_0x380a4d['talking'];if(_0x2a392b>0x0){this[_0x0093('0x209')](_0x380a4d);}else{loggerPredictiveCalls['info'](_0x0093('0x20a'));}}else{this[_0x0093('0x209')](_0x380a4d);}};Dialer[_0x0093('0x1a')][_0x0093('0x209')]=function(_0x5ba575){var _0x483180=this;var _0x27bb64=[];_0x5ba575[_0x0093('0x72')]+=0x1;for(var _0x2de3ba in this['agents']){if(typeof this[_0x0093('0x20')][_0x2de3ba]!==_0x0093('0x9a')){if(this[_0x0093('0x20')][_0x2de3ba][_0x0093('0xa8')]===_0x0093('0x205')&&this[_0x0093('0x20')][_0x2de3ba][_0x0093('0xaf')]===_0x0093('0x20b')){_0x27bb64[_0x0093('0x12d')](this[_0x0093('0x20')][_0x2de3ba]['id']);}}}this[_0x0093('0xc3')](_0x5ba575['id'],_0x27bb64,0x1,_0x5ba575[_0x0093('0x1fd')],_0x5ba575)[_0x0093('0x3c')](function(_0x44d474){if(!checkContactEmpty(_0x44d474)){checkContactLowerLimitOriginate(_0x5ba575,0x1,0x0);_0x483180[_0x0093('0xb6')](_0x5ba575)[_0x0093('0x3c')](sendMessageReschedule(_0x5ba575))[_0x0093('0xb7')](loggerCatch(_0x0093('0xb8')));}else{_0x5ba575[_0x0093('0x44')]=_0x0093('0x1ff');if(_[_0x0093('0xdc')](_0x44d474[0x0])||_[_0x0093('0xdc')](_0x44d474[0x0]['Contact'])||_[_0x0093('0xdc')](_0x44d474[0x0]['Contact'][_0x0093('0x172')])){_0x483180[_0x0093('0xcc')](_0x0093('0x201'),_0x5ba575,_0x44d474[0x0]);}else{_0x483180['checkIsBlackList'](_[_0x0093('0xcf')](_0x44d474[0x0],[_0x0093('0xd3'),_0x0093('0x206')]))['then'](_0x483180[_0x0093('0x1e9')](_0x5ba575,_0x44d474[0x0]))['catch'](_0x483180['loggerHandler']('[actionOriginatePredictive]\x20',_0x5ba575));}}})['catch'](loggerGetContactDialer('[getContactDialerPredictive]',_0x5ba575,0x1));emitVoiceQueueSummary(_0x5ba575);};Dialer['prototype'][_0x0093('0x1de')]=function(_0x2bebdb,_0x3521fd,_0x24ec93,_0x54dcf7,_0x359859,_0x43ee5e){loggerPredictive[_0x0093('0x7e')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0x0093('0x7e')](_0x0093('0x20c'),_0x2bebdb);loggerPredictive[_0x0093('0x7e')](_0x0093('0x20d'),_0x3521fd);loggerPredictive[_0x0093('0x7e')](_0x0093('0x20e'),_0x24ec93);loggerPredictive['info']('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',_0x54dcf7);loggerPredictive['info'](_0x0093('0x20f'),_0x359859);loggerPredictive[_0x0093('0x7e')](_0x0093('0x84'));return new BPromise(function(_0x3191cd,_0x2bb82b){if(_0x2bebdb<=0x0||isNaN(_0x2bebdb)){return _0x2bb82b(msgResponse(_0x0093('0x210'),'Error',_0x0093('0x211')+_0x2bebdb));}if(_0x24ec93<=0x0||isNaN(_0x24ec93)){return _0x2bb82b(msgResponse(_0x0093('0x210'),_0x0093('0x49'),_0x0093('0x212')+_0x24ec93));}if(_0x54dcf7<=0x0||isNaN(_0x54dcf7)){return _0x2bb82b(msgResponse('[abandonmentRate]',_0x0093('0x49'),_0x0093('0x213')+_0x54dcf7));}if(_0x3521fd<=0x0||isNaN(_0x3521fd)){return _0x2bb82b(msgResponse(_0x0093('0x210'),_0x0093('0x49'),_0x0093('0x214')+_0x3521fd));}if(_0x359859<=0x0||isNaN(_0x359859)){return _0x2bb82b(msgResponse(_0x0093('0x210'),'Error',_0x0093('0x215')+_0x359859));}_0x43ee5e=_0x43ee5e||0x0;var _0x1077d7=0x1/_0x24ec93;var _0x368662=0x0;var _0x280474=0x0;var _0x2bb050=0x0;var _0x4c9509=0x0;for(var _0x3ad330=0x0;_0x2bb050<_0x359859;_0x3ad330+=0x1){_0x280474=_0x3ad330/_0x3521fd;_0x368662=(_0x54dcf7*_0x280474+_0x43ee5e)/_0x1077d7;_0x2bb050=erlangb(_0x368662,_0x2bebdb);_0x4c9509=_0x368662/_0x2bebdb*(0x1-erlangb(_0x368662,_0x2bebdb));}return _0x3191cd({'erlangCalls':_0x3ad330,'erlangCallToSecond':_0x3521fd/_0x3ad330,'erlangAbandonmentRate':_0x2bb050,'erlangBusyFactor':_0x4c9509});});};Dialer[_0x0093('0x1a')]['busyFactor']=function(_0x6719e7,_0x1df92e,_0x8b3ae1,_0x5f215f,_0x6162fe,_0x3b1556){loggerPredictive[_0x0093('0x7e')](_0x0093('0x216'));loggerPredictive[_0x0093('0x7e')]('M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x6719e7);loggerPredictive[_0x0093('0x7e')](_0x0093('0x20d'),_0x1df92e);loggerPredictive['info'](_0x0093('0x20e'),_0x8b3ae1);loggerPredictive['info']('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',_0x5f215f);loggerPredictive['info'](_0x0093('0x217'),_0x6162fe);loggerPredictive[_0x0093('0x7e')]('---------------------------');return new BPromise(function(_0x66b048,_0x181d10){if(_0x6719e7<=0x0||isNaN(_0x6719e7)){return _0x181d10(msgResponse(_0x0093('0x218'),_0x0093('0x49'),'m\x20=\x20'+_0x6719e7));}if(_0x8b3ae1<=0x0||isNaN(_0x8b3ae1)){return _0x181d10(msgResponse('[busyFactor]','Error','Ts\x20=\x20'+_0x8b3ae1));}if(_0x5f215f<=0x0||isNaN(_0x5f215f)){return _0x181d10(msgResponse(_0x0093('0x218'),_0x0093('0x49'),_0x0093('0x213')+_0x5f215f));}if(_0x1df92e<=0x0||isNaN(_0x1df92e)){return _0x181d10(msgResponse(_0x0093('0x218'),_0x0093('0x49'),'interval\x20=\x20'+_0x1df92e));}if(_0x6162fe<=0x0||isNaN(_0x6162fe)){return _0x181d10(msgResponse('[busyFactor]',_0x0093('0x49'),_0x0093('0x219')+_0x6162fe));}_0x3b1556=_0x3b1556||0x0;var _0x3fbe8d=0x1/_0x8b3ae1;var _0x5da2de=0x0;var _0x1f74a9=0x0;var _0x1bf802=0x0;var _0xecc871=0x0;for(var _0x476cdd=0x0;_0xecc871<_0x6162fe;_0x476cdd+=0x1){_0x1f74a9=_0x476cdd/_0x1df92e;_0x5da2de=(_0x5f215f*_0x1f74a9+_0x3b1556)/_0x3fbe8d;_0x1bf802=erlangb(_0x5da2de,_0x6719e7);_0xecc871=_0x5da2de/_0x6719e7*(0x1-erlangb(_0x5da2de,_0x6719e7));}return _0x66b048({'erlangCalls':_0x476cdd,'erlangCallToSecond':_0x1df92e/_0x476cdd,'erlangAbandonmentRate':_0x1bf802,'erlangBusyFactor':_0xecc871});});};module[_0x0093('0x21a')]=Dialer; \ No newline at end of file +var _0xca8b=['outbound','strategy','answered','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','loggedInDb','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','startProgressive','Trunk','md5','voice:queue:%s','ivr','campaign:ivr:%s','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','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','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','---------------------------','merge','diff','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','error','stack','length','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','NOT_ACTIVE','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','starttime','clearZombieChannels','[uniqueid]','[actions]','undefined','isNil','Action','status','channel','catch','No\x20such\x20channel','queue','updateOriginated','[Dialer][checkChannel][ivr]','countReScheduled','resolve','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','emptyContact','notFound','saveInDb','pick','ContactId','ListId','UserId','VoiceQueueId','[emptyContact][createHistory]','[emptyContact]','Success','isTrunkReachable','active','SIP/%s','reachable','unmonitored','syncVarSet','uniqueid','variable','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','HangupInAMD','membername','AMD','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','countmachineretry','countglobal','[syncAgentComplete][createHistory][0]','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','CampaignId','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','Machine','countbusyretry','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','AnswerAGI','AGI','dialQueueProject','Unknow','reason','agent','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','syncAgentConnect','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','dialQueueTimeout','Drop','dropreason','TIMEOUT','agiafterat','dialDropMaxRetry','dialDropRetryFrequency','[rescheduleContact][Drop]','calleridname','calleridnum','outboundDropCallsDayCallersExit','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','syncNewExten','syncQueueMember','actionid','roundrobin','paused','agents','stateinterface','locked','push','queueStatusComplete','[booked][unlockQueueStatus]','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','inspect','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','loopCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','INTERVAL_IS_EMPTY','Failure','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','interval','timezones','content','indexOf','true','command','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','Global:\x20','Timezone:\x20','checkDialMethod','handlePower','power','Queue','method\x20not\x20recognized','handlePreviewRecallNotifications','Agent','user:%s','checkPreviewRecallReminder','launchHandleIvr','handleIvr','dialActive','dialGlobalInterval','dialTimezone','[syncQueueSummary]','syncCampaigns','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','actionOriginate','object','voiceQueue\x20is\x20undefine','Contact','phone','originate','contact\x20is\x20undefine','getCaller','NONE','\x22agi://%s/square,%s\x22','\x22%s,%s%s,,,%s\x22','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','createdAt','updatedAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','callerid','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','trim','substring','dialCutDigit','SIP/%s/%s%s','from-sip','[originate][error]','Error','originate\x20action\x20Error','responsetime','getQueue','isSuccess','response','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Abandoned]','callProgressDetecting','[callProgressDetecting]','entity\x20is\x20undefine','NoSuchNumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','predictiveIntervalAvailable','round','predictiveIntervalMinThreshold','available','floor','[startMethodPredictive][StartProgressive]','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','averageHandleTime','dialPredictiveInterval','startMethodPredictive','recalculate\x20predictive\x20at','getDataPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','getDataPredictiveOld','getVoiceQueueRtPauses','[CatchErlangB]','outboundQueuePauses','check\x20failure','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallMeTimeout','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','AVAILABLE_CONTACTS_FINISHED','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','loggerHandler','[actionOriginateIvr]\x20','not_inuse','dialOrderByScheduledAt','[getContactDialer2]','dialLimitQueue','tryOriginatePredictive','[handlePredictive][limitChannel]','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','m\x20=\x20','[abandonmentRate]','Ts\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','p\x20=\x20','util','bluebird','uuid','moment','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','redis','localhost','socket.io-emitter','../rpc/cmHopperHistory','../rpc/cmHopperBlack','./action','./history','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','trunks','maxNumberOriginate','channels','actions','uniqueId','optionPredictive','startPredictive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','syncHangup','newexten','varset','queuemember','queuestatuscomplete','syncQueueStatusComplete','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','isUndefined','message','AGENTS_NOT_LOGGED','\x20AGENTS\x20NOT\x20LOGGED','name','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','[ifTime][Action]','stringify','milliseconds','seconds','emit','type'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xca8b,0x1db));var _0xbca8=function(_0x1da540,_0x5c4338){_0x1da540=_0x1da540-0x0;var _0x534ef9=_0xca8b[_0x1da540];return _0x534ef9;};'use strict';var util=require(_0xbca8('0x0'));var _=require('lodash');var BPromise=require(_0xbca8('0x1'));var uuid=require(_0xbca8('0x2'));var moment=require(_0xbca8('0x3'));var rr=require('rr');var md5=require('md5');var Redis=require('ioredis');var ut=require(_0xbca8('0x4'));var config=require(_0xbca8('0x5'));var logger=require(_0xbca8('0x6'))(_0xbca8('0x7'));var loggerBooked=require(_0xbca8('0x6'))(_0xbca8('0x8'));var loggerPredictive=require(_0xbca8('0x6'))(_0xbca8('0x9'));var loggerPredictiveCalls=require(_0xbca8('0x6'))(_0xbca8('0xa'));var loggerSyncQueueSummary=require(_0xbca8('0x6'))(_0xbca8('0xb'));var ami=require('../ami');config[_0xbca8('0xc')]=_['defaults'](config[_0xbca8('0xc')],{'host':_0xbca8('0xd'),'port':0x18eb});var io=require(_0xbca8('0xe'))(new Redis(config[_0xbca8('0xc')]));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0xbca8('0xf'));var cmHopperBlack=require(_0xbca8('0x10'));var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require('../rpc/setting');var Action=require(_0xbca8('0x11'));var History=require(_0xbca8('0x12'));var Final=require('./final');var AgentComplete=require(_0xbca8('0x13'));var QueueCallerAbandon=require(_0xbca8('0x14'));var Hangup=require(_0xbca8('0x15'));var ipAgi=process[_0xbca8('0x16')][_0xbca8('0x17')]||_0xbca8('0x18');var strategy={'rrmemory':_0xbca8('0x19'),'roundrobin':'roundrobin'};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0xbca8('0x1a')][_0xbca8('0x1b')]=function(_0x59ee65){this[_0xbca8('0x1c')]=this[_0xbca8('0x1c')]?this[_0xbca8('0x1c')][_0xbca8('0x1d')](_0x59ee65):_0x59ee65();};function Dialer(_0x374f97,_0x4a1941){this[_0xbca8('0x1e')]=new Sequence();this[_0xbca8('0x1f')]=_0x4a1941;this['voiceQueues']=_0x374f97[_0xbca8('0x20')];this[_0xbca8('0x21')]=_0x374f97[_0xbca8('0x21')];this['agents']=_0x374f97['agents'];this['trunks']=_0x374f97[_0xbca8('0x22')];this[_0xbca8('0x23')]=config[_0xbca8('0x23')]||0x2;this[_0xbca8('0x24')]={};this[_0xbca8('0x25')]={};this['contactsId']={};this[_0xbca8('0x26')]={};this[_0xbca8('0x27')]={};this[_0xbca8('0x28')]={};this['startProgressive']={};this[_0xbca8('0x29')]={};this[_0xbca8('0x2a')]={};this[_0xbca8('0x2b')]={};ami['on'](_0xbca8('0x2c'),this['syncAgentConnect'][_0xbca8('0x2d')](this));ami['on'](_0xbca8('0x2e'),this[_0xbca8('0x2f')]['bind'](this));ami['on'](_0xbca8('0x30'),this[_0xbca8('0x31')][_0xbca8('0x2d')](this));ami['on'](_0xbca8('0x32'),this[_0xbca8('0x33')]['bind'](this));ami['on'](_0xbca8('0x34'),this[_0xbca8('0xb')][_0xbca8('0x2d')](this));ami['on'](_0xbca8('0x35'),this[_0xbca8('0x36')][_0xbca8('0x2d')](this));ami['on'](_0xbca8('0x37'),this['syncNewExten'][_0xbca8('0x2d')](this));ami['on'](_0xbca8('0x38'),this['syncVarSet'][_0xbca8('0x2d')](this));ami['on'](_0xbca8('0x39'),this['syncQueueMember'][_0xbca8('0x2d')](this));ami['on'](_0xbca8('0x3a'),this[_0xbca8('0x3b')][_0xbca8('0x2d')](this));this['loopCampaigns']();this[_0xbca8('0x3c')]();RpcSetting[_0xbca8('0x3d')]()[_0xbca8('0x3e')](function(_0x1dc4b1){previewRecallmeReminderInterval=_0x1dc4b1[_0xbca8('0x3f')];});}function isNotNull(_0x29b771){return _0x29b771!==null&&!_[_0xbca8('0x40')](_0x29b771);}function checkIsLoggedIn(_0x2a6343,_0x46a76d){return function(){if(_0x46a76d<=0x0){_0x2a6343[_0xbca8('0x41')]=_0xbca8('0x42');throw _0x2a6343['name']+_0xbca8('0x43');}};}function isActive(_0x9ad85d){return _0x9ad85d;}function checkIsActive(_0x4dc1da,_0x5725f0){return function(){if(!isActive(_0x5725f0)){_0x4dc1da[_0xbca8('0x41')]='NOT_ACTIVE';throw _0x4dc1da[_0xbca8('0x44')]+_0xbca8('0x45');}};}function checkInterval(_0x370e3f){return function(){if(!isNotNull(_0x370e3f[_0xbca8('0x46')])){_0x370e3f[_0xbca8('0x41')]=_0xbca8('0x47');throw _0x370e3f[_0xbca8('0x44')]+_0xbca8('0x48');}if(!isNotNull(_0x370e3f['Interval'][_0xbca8('0x49')])){_0x370e3f['message']=_0xbca8('0x47');throw _0x370e3f[_0xbca8('0x44')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0xbca8('0x4a')](_0x370e3f[_0xbca8('0x46')][_0xbca8('0x49')]))){_0x370e3f['message']=_0xbca8('0x47');throw _0x370e3f[_0xbca8('0x44')]+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x5ea7b0,_0x77e29d,_0x278b96){return{'action':_0x5ea7b0,'response':_0x77e29d,'message':_0x278b96,'stack':_0x278b96};}function myreject(_0x55b30d){return function(_0x47fe2c){return _0x55b30d(msgResponse(_0xbca8('0x4b'),'Error',JSON[_0xbca8('0x4c')](_0x47fe2c)));};}function getSeconds(_0x3b1526,_0x361047){var _0x4e34e3=moment(_0x3b1526)[_0xbca8('0x4d')](0x0);var _0x6a490e=moment(_0x361047)[_0xbca8('0x4d')](0x0);return _0x4e34e3['diff'](_0x6a490e,_0xbca8('0x4e'));}function emit(_0x41e4b9,_0x32a821,_0x4a18b7){io['to'](_0x41e4b9)[_0xbca8('0x4f')](_0x32a821,_0x4a18b7);}function emitVoiceQueueSummary(_0x16d222){if(_0x16d222[_0xbca8('0x50')]===_0xbca8('0x51')){var _0x4c4d8e={'id':_0x16d222['id'],'name':_0x16d222[_0xbca8('0x44')],'strategy':_0x16d222[_0xbca8('0x52')],'answered':_0x16d222[_0xbca8('0x53')],'available':_0x16d222['available'],'loggedIn':_0x16d222[_0xbca8('0x54')],'pTalking':_0x16d222[_0xbca8('0x55')],'sumBillable':_0x16d222[_0xbca8('0x56')],'sumDuration':_0x16d222[_0xbca8('0x57')],'sumHoldTime':_0x16d222[_0xbca8('0x58')]||0x0,'talking':_0x16d222[_0xbca8('0x59')],'total':_0x16d222[_0xbca8('0x5a')],'type':_0x16d222['type'],'unmanaged':_0x16d222[_0xbca8('0x5b')],'abandoned':_0x16d222['abandoned'],'waiting':_0x16d222['waiting'],'loggedInDb':_0x16d222[_0xbca8('0x5c')],'dialActive':_0x16d222['dialActive'],'dialMethod':_0x16d222[_0xbca8('0x5d')],'dialOriginateCallerIdName':_0x16d222[_0xbca8('0x5e')],'dialOriginateCallerIdNumber':_0x16d222[_0xbca8('0x5f')],'dialOriginateTimeout':_0x16d222[_0xbca8('0x60')],'dialPrefix':_0x16d222[_0xbca8('0x61')],'outboundAnswerAgiCallsDay':_0x16d222[_0xbca8('0x62')],'outboundAnswerCallsDay':_0x16d222[_0xbca8('0x63')],'outboundBlacklistCallsDay':_0x16d222[_0xbca8('0x64')],'outboundBusyCallsDay':_0x16d222[_0xbca8('0x65')],'outboundCongestionCallsDay':_0x16d222['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x16d222[_0xbca8('0x66')],'outboundDropCallsDayCallersExit':_0x16d222['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x16d222[_0xbca8('0x67')],'outboundNoAnswerCallsDay':_0x16d222[_0xbca8('0x68')],'outboundNoSuchCallsDay':_0x16d222[_0xbca8('0x69')],'outboundOriginateFailureCallsDay':_0x16d222[_0xbca8('0x6a')],'outboundReCallsDay':_0x16d222[_0xbca8('0x6b')],'outboundRejectCallsDay':_0x16d222[_0xbca8('0x6c')],'outboundUnknownCallsDay':_0x16d222[_0xbca8('0x6d')],'predictiveIntervalAnsweredCalls':_0x16d222[_0xbca8('0x6e')],'predictiveIntervalAvgHoldtime':_0x16d222[_0xbca8('0x6f')],'predictiveIntervalAvgTalktime':_0x16d222[_0xbca8('0x70')],'predictiveIntervalDroppedCallsCallersExit':_0x16d222['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x16d222[_0xbca8('0x71')],'predictiveIntervalErlangCalls':_0x16d222[_0xbca8('0x72')],'predictiveIntervalErlangCallsDroppedCalls':_0x16d222[_0xbca8('0x73')],'predictiveIntervalHitRate':_0x16d222[_0xbca8('0x74')],'predictiveIntervalMultiplicativeFactor':_0x16d222[_0xbca8('0x75')],'predictiveIntervalPauses':_0x16d222[_0xbca8('0x76')],'predictiveIntervalAvailable':_0x16d222['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x16d222['predictiveIntervalTotalCalls'],'message':_0x16d222[_0xbca8('0x41')],'originated':_0x16d222[_0xbca8('0x77')],'erlangCalls':_0x16d222[_0xbca8('0x78')],'erlangCallToSecond':_0x16d222[_0xbca8('0x79')],'erlangAbandonmentRate':_0x16d222[_0xbca8('0x7a')],'erlangBusyFactor':_0x16d222['erlangBusyFactor'],'startPredictive':_0x16d222['startPredictive'],'startProgressive':_0x16d222[_0xbca8('0x7b')]};if(_0x16d222[_0xbca8('0x7c')]){_0x4c4d8e[_0xbca8('0x7c')]={'id':_0x16d222[_0xbca8('0x7c')]['id'],'name':_0x16d222[_0xbca8('0x7c')][_0xbca8('0x44')],'active':_0x16d222[_0xbca8('0x7c')]['active'],'callerid':_0x16d222['Trunk']['callerid']};}if(_0x16d222['Interval']){_0x4c4d8e['Interval']={'id':_0x16d222[_0xbca8('0x46')]['id'],'name':_0x16d222['Interval'][_0xbca8('0x44')]};}var _0xce7e5c=md5(JSON[_0xbca8('0x4c')](_0x4c4d8e));if(_0x16d222[_0xbca8('0x7d')]!==_0xce7e5c){_0x16d222[_0xbca8('0x7d')]=_0xce7e5c;emit(util['format'](_0xbca8('0x7e'),_0x4c4d8e[_0xbca8('0x44')]),'voice_queue:save',_0x4c4d8e);}}}function emitCampaignSummary(_0x243f1e){if(_0x243f1e['type']===_0xbca8('0x7f')){emit(util['format'](_0xbca8('0x80'),_0x243f1e[_0xbca8('0x44')]),'campaign:save',_0x243f1e);}}function checkGetDataPredictive(_0x3f7396){if(isNotNull(_0x3f7396)&&!_[_0xbca8('0x4a')](_0x3f7396)){loggerPredictive[_0xbca8('0x81')](_0xbca8('0x82'));loggerPredictive[_0xbca8('0x81')](_0xbca8('0x83'),_0x3f7396[_0xbca8('0x84')]);loggerPredictive[_0xbca8('0x81')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3f7396[_0xbca8('0x6e')]);loggerPredictive[_0xbca8('0x81')](_0xbca8('0x85'),_0x3f7396[_0xbca8('0x71')]);loggerPredictive[_0xbca8('0x81')](_0xbca8('0x86'),_0x3f7396[_0xbca8('0x87')]);loggerPredictive['info'](_0xbca8('0x88'),_0x3f7396['predictiveIntervalAvgHoldtime']);loggerPredictive[_0xbca8('0x81')](_0xbca8('0x89'),_0x3f7396[_0xbca8('0x70')]);loggerPredictive[_0xbca8('0x81')]('---------------------------');if(_0x3f7396[_0xbca8('0x84')]>0x0){if(!_[_0xbca8('0x40')](_0x3f7396['predictiveIntervalAvgTalktime'])&&_0x3f7396[_0xbca8('0x70')]>0x0){return!![];}loggerPredictive[_0xbca8('0x81')](_0xbca8('0x8a'));if(!_[_0xbca8('0x40')](_0x3f7396['predictiveIntervalAvgHoldtime'])&&_0x3f7396[_0xbca8('0x6f')]>0x0){return!![];}loggerPredictive[_0xbca8('0x81')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0xbca8('0x81')](_0xbca8('0x8b'));}}else{loggerPredictive[_0xbca8('0x81')](_0xbca8('0x8c'));}return![];}function mergeDataErlangB(_0x10ecad){return function(_0x187601){loggerPredictive[_0xbca8('0x81')]('---------\x20ErlangB\x20---------');loggerPredictive[_0xbca8('0x81')](_0xbca8('0x8d'),_0x187601[_0xbca8('0x78')]);loggerPredictive[_0xbca8('0x81')](_0xbca8('0x8e'),_0x187601[_0xbca8('0x79')]);loggerPredictive[_0xbca8('0x81')](_0xbca8('0x8f'),_0x187601[_0xbca8('0x7a')]);loggerPredictive[_0xbca8('0x81')](_0xbca8('0x90'),_0x187601[_0xbca8('0x91')]);loggerPredictive[_0xbca8('0x81')](_0xbca8('0x8f'),_0x187601[_0xbca8('0x7a')]);loggerPredictive[_0xbca8('0x81')](_0xbca8('0x92'));_[_0xbca8('0x93')](_0x10ecad,_0x187601);};}function getDiff(_0x4c1cc9){var _0xb499da=moment()[_0xbca8('0x4d')](0x0);var _0x2d9371=moment(_0x4c1cc9)[_0xbca8('0x4d')](0x0);return _0xb499da[_0xbca8('0x94')](_0x2d9371,'seconds');}function ifInterval(_0x2f2b74,_0x4ec7ce){if(_[_0xbca8('0x40')](_0x4ec7ce)){return![];}return getDiff(_0x4ec7ce)<_0x2f2b74*0x3c;}function freeVariablesPredictive(_0x2a511c){if(isNotNull(_0x2a511c)){if(!_[_0xbca8('0x40')](_0x2a511c['startProgressive'])){_0x2a511c[_0xbca8('0x7b')]=undefined;loggerPredictive[_0xbca8('0x81')](_0x2a511c[_0xbca8('0x44')],_0xbca8('0x95'));}if(!_['isUndefined'](_0x2a511c['startPredictive'])){_0x2a511c['startPredictive']=undefined;loggerPredictive[_0xbca8('0x81')](_0x2a511c[_0xbca8('0x44')],_0xbca8('0x96'));}if(!_['isUndefined'](_0x2a511c['handlePredictive'])){clearInterval(_0x2a511c[_0xbca8('0x97')]);_0x2a511c[_0xbca8('0x97')]=undefined;loggerPredictive[_0xbca8('0x81')](_0x2a511c[_0xbca8('0x44')],_0xbca8('0x98'));}}}function erlangb(_0x225742,_0x4e2476){if(_0x4e2476===0x0){return 0x0;}var _0x26441e=0x1;for(var _0x4b6a39=0x1;_0x4b6a39<=_0x4e2476;_0x4b6a39+=0x1){_0x26441e=0x1+_0x26441e*_0x4b6a39/_0x225742;}return 0x1/_0x26441e;}function isVoiceQueueOutbound(_0x24d3f6){return _0x24d3f6==='outbound';}function isNotPreview(_0x490e48){return _0x490e48!==_0xbca8('0x1f');}function isCampaignIvr(_0x5ca57a){return _0x5ca57a===_0xbca8('0x7f');}function getCallerId(_0x8f7eb4,_0x42b3b6,_0x1dcad9){if(!_['isUndefined'](_0x1dcad9)&&typeof _0x1dcad9==='string'&&!_['isEmpty'](_0x1dcad9)){if(!_[_0xbca8('0x40')](_0x42b3b6)&&typeof _0x42b3b6===_0xbca8('0x99')&&!_[_0xbca8('0x4a')](_0x42b3b6)){return util['format'](_0xbca8('0x9a'),_0x42b3b6,_0x1dcad9);}return util[_0xbca8('0x9b')]('\x22%s\x22\x20<%s>',_0x1dcad9,_0x1dcad9);}if(!_[_0xbca8('0x40')](_0x8f7eb4)&&typeof _0x8f7eb4==='string'&&!_['isEmpty'](_0x8f7eb4)){return _0x8f7eb4;}return _0xbca8('0x9c');}function loggerCatchQueueSummary(_0x1dfc13,_0x1f9cc0){return function(_0x1c0f2d){freeVariablesPredictive(_0x1f9cc0);emitVoiceQueueSummary(_0x1f9cc0);emitCampaignSummary(_0x1f9cc0);loggerSyncQueueSummary[_0xbca8('0x9d')](_0x1dfc13,util['inspect'](_0x1c0f2d,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0xe70b33,_0x433083){return function(_0x2c4f36){loggerPredictive[_0xbca8('0x9d')](_0x433083[_0xbca8('0x44')],_0xe70b33);loggerPredictive['error'](_0x2c4f36[_0xbca8('0x9e')]);freeVariablesPredictive(_0x433083);};}function loggerCatch(_0x30ee67){return function(_0x39817f){logger[_0xbca8('0x9d')](_0x30ee67,util['inspect'](_0x39817f,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x344c37){return _0x344c37&&!_['isUndefined'](_0x344c37)&&_0x344c37[_0xbca8('0x9f')]>0x0;}function decremetOriginate(_0x24bb85){if(!_[_0xbca8('0x40')](_0x24bb85)&&_0x24bb85!==null){if(typeof _0x24bb85[_0xbca8('0x77')]!=='undefined'){if(_0x24bb85[_0xbca8('0x77')]>0x0){_0x24bb85[_0xbca8('0x77')]-=0x1;}else{logger[_0xbca8('0x9d')](_0xbca8('0xa0'));}}}else{logger['error'](_0xbca8('0xa1'));}}function checkContactLowerLimitOriginate(_0x45857c,_0x396d0b,_0x279f5d){if(_0x396d0b>_0x279f5d){for(var _0x1b1b69=0x0;_0x1b1b69<_0x396d0b-_0x279f5d;_0x1b1b69+=0x1){decremetOriginate(_0x45857c);}}}function loggerGetContactDialer(_0x515901,_0x3f7b43,_0x3306d7){return function(_0x43364c){checkContactLowerLimitOriginate(_0x3f7b43,_0x3306d7,0x0);logger[_0xbca8('0x9d')](_0x515901,util['inspect'](_0x43364c,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x417b1b){return function(_0x43d84e){if(isNotNull(_0x43d84e)&&isNotNull(_0x43d84e[0x0])){if(_0x43d84e[0x0][_0xbca8('0xa2')]>0x0){_0x417b1b[_0xbca8('0x41')]=_0xbca8('0xa3');logger[_0xbca8('0x81')](_0xbca8('0xa4')+_0x417b1b['name'],_0x43d84e[0x0][_0xbca8('0xa2')],_0xbca8('0xa5'));}else{_0x417b1b[_0xbca8('0x41')]='AVAILABLE_CONTACTS_FINISHED';logger[_0xbca8('0x81')](_0xbca8('0xa6')+_0x417b1b[_0xbca8('0x44')]);}}};}function notSendMessagesQueue(_0x4408c3){if(_0x4408c3[_0xbca8('0xa7')]){freeVariablesPredictive(_0x4408c3);if(_0x4408c3[_0xbca8('0x77')]===0x0&&_0x4408c3[_0xbca8('0x59')]===0x0&&_0x4408c3['waiting']===0x0&&(_0x4408c3[_0xbca8('0x55')]||0x0)===0x0){_0x4408c3['sendMessageOneNotActive']=![];_0x4408c3['available']=0x0;_0x4408c3['message']='NOT_ACTIVE';loggerSyncQueueSummary['error'](_0xbca8('0xa8'),_0x4408c3['name'],_0xbca8('0xa9'));}else{_0x4408c3[_0xbca8('0x41')]=_0xbca8('0xaa');loggerSyncQueueSummary[_0xbca8('0x9d')](_0xbca8('0xa8'),_0x4408c3[_0xbca8('0x44')],_0xbca8('0xab'));}emitVoiceQueueSummary(_0x4408c3);}}function notSendMessagesCampaign(_0x3540f7){if(_0x3540f7['sendMessageOneNotActive']){if(_0x3540f7['originated']===0x0){_0x3540f7[_0xbca8('0xa7')]=![];_0x3540f7[_0xbca8('0x41')]=_0xbca8('0xac');loggerSyncQueueSummary[_0xbca8('0x9d')](_0xbca8('0xad'),_0x3540f7[_0xbca8('0x44')],_0xbca8('0xa9'));}else{_0x3540f7[_0xbca8('0x41')]=_0xbca8('0xaa');loggerSyncQueueSummary[_0xbca8('0x9d')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x3540f7[_0xbca8('0x44')],'is\x20disactive');}emitCampaignSummary(_0x3540f7);}}function createObjHistory(_0x4f404d,_0x5b76ab,_0x4accbf,_0x21ac47,_0x1e5615){_0x4f404d[_0xbca8('0x41')]=_0x4accbf;var _0x526372=new Action(_0x4f404d,_0x5b76ab);var _0x213b50=new History(_0x526372);_0x213b50[_0xbca8('0xae')]=_0x21ac47;_0x213b50[_0xbca8('0xaf')]=_0x1e5615;_0x213b50[_0xbca8('0xb0')]=_0x526372[_0xbca8('0xb1')];return _0x213b50;}Dialer['prototype'][_0xbca8('0x3c')]=function(){var _0x50968=this;setInterval(function(){_0x50968[_0xbca8('0xb2')](_0x50968[_0xbca8('0x26')],_0xbca8('0xb3'));_0x50968['clearZombieChannels'](_0x50968[_0xbca8('0x25')],_0xbca8('0xb4'));},0x32c8);};Dialer[_0xbca8('0x1a')][_0xbca8('0xb2')]=function(_0xaa085c,_0x5a15e3){var _0x22fd9f=this;for(var _0xaad1fd in _0xaa085c){if(typeof _0xaa085c[_0xaad1fd]!==_0xbca8('0xb5')){this[_0xbca8('0x1e')][_0xbca8('0x1b')](function(){if(!_[_0xbca8('0xb6')](_0xaa085c[_0xaad1fd])){return ami[_0xbca8('0xb7')]({'action':_0xbca8('0xb8'),'channel':_0xaa085c[_0xaad1fd][_0xbca8('0xb9')]})[_0xbca8('0xba')](function(_0x2bc8bb){if(_0x2bc8bb[_0xbca8('0x41')]===_0xbca8('0xbb')){setTimeout(function(){if(_0xaa085c[_0xaad1fd]&&_0xaa085c[_0xaad1fd][_0xbca8('0x50')]!==_0xbca8('0x7f')){_0x22fd9f['updateOriginated'](_0x22fd9f[_0xbca8('0x20')][_0xaa085c[_0xaad1fd][_0xbca8('0xbc')]]);logger[_0xbca8('0x9d')]('[Dialer][checkChannel]',_0x5a15e3,_0xaad1fd,_0xaa085c[_0xaad1fd][_0xbca8('0xbc')]);delete _0xaa085c[_0xaad1fd];}if(_0xaa085c[_0xaad1fd]&&_0xaa085c[_0xaad1fd][_0xbca8('0x50')]==='ivr'){_0x22fd9f[_0xbca8('0xbd')](_0x22fd9f[_0xbca8('0x21')][_0xaa085c[_0xaad1fd][_0xbca8('0xbc')]]);logger['error'](_0xbca8('0xbe'),_0x5a15e3,_0xaad1fd,_0xaa085c[_0xaad1fd][_0xbca8('0xbc')]);delete _0xaa085c[_0xaad1fd];}},0x2328);}});}});}}};Dialer[_0xbca8('0x1a')][_0xbca8('0xbf')]=function(_0x8a0739){return BPromise[_0xbca8('0xc0')]()[_0xbca8('0x3e')](cmHopper['countReScheduled'](_0x8a0739))['catch'](loggerCatch(_0xbca8('0xc1')));};Dialer[_0xbca8('0x1a')]['checkIsBlackList']=function(_0x42f550){return BPromise[_0xbca8('0xc0')]()['then'](cmHopperBlack[_0xbca8('0xc2')](_0x42f550))['catch'](loggerCatch(_0xbca8('0xc3')));};Dialer[_0xbca8('0x1a')][_0xbca8('0xc4')]=function(_0x12be55){return BPromise[_0xbca8('0xc0')]()[_0xbca8('0x3e')](cmHopperBlack[_0xbca8('0xc4')](_0x12be55))[_0xbca8('0xba')](loggerCatch(_0xbca8('0xc5')));};Dialer[_0xbca8('0x1a')]['averageHandleTime']=function(_0x530205){return BPromise[_0xbca8('0xc0')]()[_0xbca8('0x3e')](cmHopperHistory['avgHandleTime'](_0x530205))[_0xbca8('0xba')](loggerCatch(_0xbca8('0xc6')));};Dialer[_0xbca8('0x1a')]['rescheduleContact']=function(_0x33642c){return BPromise[_0xbca8('0xc0')]()['then'](cmHopper[_0xbca8('0xc7')](_0x33642c))[_0xbca8('0xba')](loggerCatch(_0xbca8('0xc8')));};Dialer[_0xbca8('0x1a')][_0xbca8('0xc9')]=function(_0x3eee09,_0x2441e7,_0x3e67ff){return BPromise['resolve']()['then'](cmHopper[_0xbca8('0xc9')](_0x3eee09,_0x2441e7,_0x3e67ff))[_0xbca8('0xba')](loggerCatch(_0xbca8('0xca')));};Dialer[_0xbca8('0x1a')][_0xbca8('0xcb')]=function(_0x14b9bc,_0x4b7828,_0x23d661,_0x28c3cf,_0x40f8a6){return BPromise[_0xbca8('0xc0')]()[_0xbca8('0x3e')](cmHopper['getContactDialer'](_0x14b9bc,_0x4b7828,_0x23d661,_0x28c3cf))['catch'](function(_0x38c4b1){_0x40f8a6[_0xbca8('0xcc')]-=_0x23d661;_0x40f8a6[_0xbca8('0xcc')]=_0x40f8a6[_0xbca8('0xcc')]>0x0?_0x40f8a6[_0xbca8('0xcc')]:0x0;loggerCatch(_0xbca8('0xcd'))(_0x38c4b1);});};Dialer[_0xbca8('0x1a')][_0xbca8('0xce')]=function(_0x26ad92,_0x4ce873,_0x266b10,_0x3bc867){return BPromise[_0xbca8('0xc0')]()[_0xbca8('0x3e')](cmHopper[_0xbca8('0xce')](_0x26ad92,_0x4ce873,_0x266b10))['catch'](function(_0x315042){_0x3bc867['temp']-=_0x4ce873;_0x3bc867[_0xbca8('0xcc')]=_0x3bc867[_0xbca8('0xcc')]>0x0?_0x3bc867[_0xbca8('0xcc')]:0x0;loggerCatch('[getContactDialerIvr]\x20')(_0x315042);});};Dialer['prototype']['getVoiceQueueRtPauses']=function(_0x32f12e){return BPromise[_0xbca8('0xc0')]()[_0xbca8('0x3e')](voiceQueueRt['getVoiceQueueRtPauses'](_0x32f12e))[_0xbca8('0xba')](loggerCatch(_0xbca8('0xcf')));};Dialer['prototype'][_0xbca8('0xd0')]=function(_0x5c66e2){return BPromise['resolve']()[_0xbca8('0x3e')](cmHopper[_0xbca8('0xd0')](_0x5c66e2))[_0xbca8('0xba')](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer[_0xbca8('0x1a')][_0xbca8('0xd1')]=function(_0x5431c0){return BPromise[_0xbca8('0xc0')]()[_0xbca8('0x3e')](cmHopperHistory['createHistory'](_0x5431c0))['catch'](loggerCatch(_0xbca8('0xd2')));};Dialer['prototype'][_0xbca8('0xbd')]=function(_0x3eabee){if(!_[_0xbca8('0x40')](_0x3eabee)&&_0x3eabee!==null){if(typeof _0x3eabee[_0xbca8('0x77')]!==_0xbca8('0xb5')){if(_0x3eabee[_0xbca8('0x77')]>0x0){_0x3eabee[_0xbca8('0x77')]-=0x1;}else{logger[_0xbca8('0x9d')](_0xbca8('0xd3'));}}}else{logger[_0xbca8('0x9d')](_0xbca8('0xd4'));}};Dialer[_0xbca8('0x1a')]['loggerHandler']=function(_0x3b8d77,_0x1dd32){var _0x9d2a2b=this;return function(_0x3a581d){_0x9d2a2b[_0xbca8('0xbd')](_0x1dd32);logger[_0xbca8('0x9d')](_0x3b8d77,util['inspect'](_0x3a581d,{'showHidden':![],'depth':null}));};};Dialer[_0xbca8('0x1a')][_0xbca8('0xd5')]=function(_0x27bb49,_0x442480,_0xd91ff0){var _0x290df7={'state':0x19,'statedesc':_0xbca8('0xd6')};this[_0xbca8('0xbd')](_0x442480);this[_0xbca8('0xd7')](_[_0xbca8('0x93')](_0x290df7,_[_0xbca8('0xd8')](_0xd91ff0,[_0xbca8('0xd9'),_0xbca8('0xda'),_0xbca8('0xdb'),_0xbca8('0xdc'),'CampaignId'])),_0xbca8('0xdd'),_0xbca8('0xde'));logger[_0xbca8('0x9d')](_0x27bb49);};Dialer[_0xbca8('0x1a')]['isSuccess']=function(_0x2cb556){return _0x2cb556===_0xbca8('0xdf');};Dialer[_0xbca8('0x1a')][_0xbca8('0xe0')]=function(_0x179e80){return!_[_0xbca8('0x40')](_0x179e80)&&_0x179e80&&!_[_0xbca8('0x40')](_0x179e80[_0xbca8('0x44')])&&!_[_0xbca8('0x40')](_0x179e80[_0xbca8('0xe1')])&&_0x179e80[_0xbca8('0xe1')]&&(this[_0xbca8('0x22')][util['format'](_0xbca8('0xe2'),_0x179e80[_0xbca8('0x44')])]['status']===_0xbca8('0xe3')||this[_0xbca8('0x22')][util[_0xbca8('0x9b')](_0xbca8('0xe2'),_0x179e80[_0xbca8('0x44')])][_0xbca8('0xb8')]===_0xbca8('0xe4'));};Dialer['prototype']['saveInDb']=function(_0xab2f8a,_0x3bba19,_0x3317cf){this[_0xbca8('0xd1')](_0xab2f8a)[_0xbca8('0xba')](loggerCatch(_0x3bba19));this['moveContactManagedDialer'](_0xab2f8a)[_0xbca8('0xba')](loggerCatch(_0x3317cf));};Dialer['prototype'][_0xbca8('0xe5')]=function(_0x51f5e7){var _0x237d3c=this[_0xbca8('0x26')][_0x51f5e7[_0xbca8('0xe6')]];var _0x3ffd23;if(!_['isNil'](_0x51f5e7)&&!_['isNil'](_0x51f5e7[_0xbca8('0xe7')])&&!_['isNil'](_0x51f5e7[_0xbca8('0xe7')]['amdstatus'])&&_0x51f5e7[_0xbca8('0xe8')]===_0xbca8('0xe9')&&_0x237d3c){if(_0x237d3c[_0xbca8('0x50')]!==_0xbca8('0x7f')&&this[_0xbca8('0x20')][_0x237d3c['queue']][_0xbca8('0xea')]&&_0x51f5e7[_0xbca8('0xeb')]===_0xbca8('0xec')){delete this['uniqueId'][_0x51f5e7[_0xbca8('0xe6')]];this['updateOriginated'](this[_0xbca8('0x20')][_0x237d3c[_0xbca8('0xbc')]]);this[_0xbca8('0x20')][_0x237d3c[_0xbca8('0xbc')]][_0xbca8('0x63')]+=0x1;this['voiceQueues'][_0x237d3c[_0xbca8('0xbc')]]['outboundAnswerAgiCallsDay']+=0x1;_0x3ffd23=new Hangup(_0x237d3c,_0x51f5e7);_0x3ffd23['state']=0x12;_0x3ffd23[_0xbca8('0xaf')]=_0xbca8('0xed');_0x3ffd23[_0xbca8('0xee')]=_0xbca8('0xef');ami['emit'](_0xbca8('0xf0'),ut[_0xbca8('0xf1')](_0x3ffd23,_0xbca8('0xf2')));this[_0xbca8('0xd7')](_0x3ffd23,_0xbca8('0xf3'),_0xbca8('0xf4'));}if(_0x237d3c[_0xbca8('0x50')]!==_0xbca8('0x7f')&&this[_0xbca8('0x20')][_0x237d3c[_0xbca8('0xbc')]][_0xbca8('0xea')]&&_0x51f5e7[_0xbca8('0xeb')]===_0xbca8('0xf5')){var _0x2293d5=this;return new BPromise(function(_0xf1caae,_0x289baa){delete _0x2293d5[_0xbca8('0x26')][_0x51f5e7[_0xbca8('0xe6')]];_0x2293d5[_0xbca8('0xbd')](_0x2293d5[_0xbca8('0x20')][_0x237d3c[_0xbca8('0xbc')]]);_0x2293d5['voiceQueues'][_0x237d3c['queue']][_0xbca8('0x63')]+=0x1;_0x2293d5['voiceQueues'][_0x237d3c[_0xbca8('0xbc')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x3ea32a=_0x2293d5[_0xbca8('0x20')][_0x237d3c[_0xbca8('0xbc')]];var _0x387bf7=new Hangup(_0x237d3c,_0x51f5e7);_0x387bf7[_0xbca8('0xae')]=0x13;_0x387bf7[_0xbca8('0xaf')]='Machine';_0x387bf7['membername']=_0xbca8('0xef');_0x387bf7[_0xbca8('0xf6')]+=0x1;_0x387bf7[_0xbca8('0xf7')]+=0x1;_0x387bf7[_0xbca8('0xf2')]=!![];ami[_0xbca8('0x4f')](_0xbca8('0xf0'),ut['buildObj'](_0x387bf7,_0xbca8('0xf2')));_0x2293d5[_0xbca8('0xd1')](_0x387bf7)[_0xbca8('0xba')](loggerCatch(_0xbca8('0xf8')));if(_0x387bf7['countbusyretry']+_0x387bf7[_0xbca8('0xf9')]+_0x387bf7[_0xbca8('0xfa')]+_0x387bf7[_0xbca8('0xfb')]+_0x387bf7[_0xbca8('0xfc')]+_0x387bf7[_0xbca8('0xfd')]+_0x387bf7[_0xbca8('0xf6')]+_0x387bf7[_0xbca8('0xfe')]>=_0x3ea32a[_0xbca8('0xff')]){_0x2293d5[_0xbca8('0x100')](_0x387bf7,_0xf1caae,_0x289baa,_0xbca8('0x101'));}else{if(_0x387bf7['countmachineretry']>=_0x3ea32a[_0xbca8('0x102')]){_0x2293d5[_0xbca8('0x103')](_0x387bf7,_0xf1caae,_0x289baa,_0xbca8('0x104'));}else{_0x2293d5['rescheduleContact']({'active':![],'countmachineretry':_0x387bf7[_0xbca8('0xf6')],'scheduledat':moment()[_0xbca8('0x105')](_0x3ea32a[_0xbca8('0x106')],_0xbca8('0x107'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x387bf7[_0xbca8('0xd9')],'ListId':_0x387bf7['ListId'],'VoiceQueueId':_0x387bf7[_0xbca8('0xdc')]||undefined,'CampaignId':_0x387bf7[_0xbca8('0x108')]||undefined})[_0xbca8('0xba')](loggerCatch('[rescheduleContact][Machine]'));_0xf1caae({'reschedule':0x1});}}});}if(_0x237d3c['type']===_0xbca8('0x7f')&&this[_0xbca8('0x21')][_0x237d3c['queue']][_0xbca8('0xea')]&&_0x51f5e7['value']===_0xbca8('0xec')){delete this[_0xbca8('0x26')][_0x51f5e7[_0xbca8('0xe6')]];this['updateOriginated'](this[_0xbca8('0x21')][_0x237d3c[_0xbca8('0xbc')]]);_0x3ffd23=new Hangup(_0x237d3c,_0x51f5e7);_0x3ffd23['state']=0x12;_0x3ffd23[_0xbca8('0xaf')]=_0xbca8('0xed');_0x3ffd23['membername']='AMD';ami['emit'](_0xbca8('0xf0'),ut[_0xbca8('0xf1')](_0x3ffd23,_0xbca8('0xf2')));this[_0xbca8('0xd7')](_0x3ffd23,_0xbca8('0x109'),_0xbca8('0x10a'));}if(_0x237d3c[_0xbca8('0x50')]===_0xbca8('0x7f')&&this['campaigns'][_0x237d3c['queue']][_0xbca8('0xea')]&&_0x51f5e7[_0xbca8('0xeb')]===_0xbca8('0xf5')){var _0x2293d5=this;return new BPromise(function(_0x2b71b3,_0x51c663){delete _0x2293d5[_0xbca8('0x26')][_0x51f5e7[_0xbca8('0xe6')]];_0x2293d5[_0xbca8('0xbd')](_0x2293d5[_0xbca8('0x21')][_0x237d3c[_0xbca8('0xbc')]]);_0x2293d5['campaigns'][_0x237d3c[_0xbca8('0xbc')]][_0xbca8('0x63')]+=0x1;_0x2293d5[_0xbca8('0x21')][_0x237d3c[_0xbca8('0xbc')]][_0xbca8('0x62')]+=0x1;var _0x276f8f=_0x2293d5[_0xbca8('0x21')][_0x237d3c[_0xbca8('0xbc')]];var _0x3b6575=new Hangup(_0x237d3c,_0x51f5e7);_0x3b6575[_0xbca8('0xae')]=0x13;_0x3b6575['statedesc']=_0xbca8('0x10b');_0x3b6575[_0xbca8('0xee')]=_0xbca8('0xef');_0x3b6575[_0xbca8('0xf6')]+=0x1;_0x3b6575['countglobal']+=0x1;_0x3b6575[_0xbca8('0xf2')]=!![];ami[_0xbca8('0x4f')](_0xbca8('0xf0'),ut[_0xbca8('0xf1')](_0x3b6575,_0xbca8('0xf2')));_0x2293d5[_0xbca8('0xd1')](_0x3b6575)[_0xbca8('0xba')](loggerCatch(_0xbca8('0xf8')));if(_0x3b6575[_0xbca8('0x10c')]+_0x3b6575[_0xbca8('0xf9')]+_0x3b6575[_0xbca8('0xfa')]+_0x3b6575[_0xbca8('0xfb')]+_0x3b6575[_0xbca8('0xfc')]+_0x3b6575['countabandonedretry']+_0x3b6575[_0xbca8('0xf6')]+_0x3b6575[_0xbca8('0xfe')]>=_0x276f8f[_0xbca8('0xff')]){_0x2293d5[_0xbca8('0x100')](_0x3b6575,_0x2b71b3,_0x51c663,_0xbca8('0x101'));}else{if(_0x3b6575[_0xbca8('0xf6')]>=_0x276f8f[_0xbca8('0x102')]){_0x2293d5['createStateFinal'](_0x3b6575,_0x2b71b3,_0x51c663,_0xbca8('0x104'));}else{_0x2293d5['rescheduleContact']({'active':![],'countmachineretry':_0x3b6575[_0xbca8('0xf6')],'scheduledat':moment()[_0xbca8('0x105')](_0x276f8f[_0xbca8('0x106')],_0xbca8('0x107'))['format'](_0xbca8('0x10d')),'ContactId':_0x3b6575[_0xbca8('0xd9')],'ListId':_0x3b6575['ListId'],'VoiceQueueId':_0x3b6575[_0xbca8('0xdc')]||undefined,'CampaignId':_0x3b6575['CampaignId']||undefined})['catch'](loggerCatch(_0xbca8('0x10e')));_0x2b71b3({'reschedule':0x1});}}});}}};Dialer['prototype']['syncHangup']=function(_0x16e6ad){var _0x3f138b=this[_0xbca8('0x26')][_0x16e6ad['uniqueid']];var _0x30592c=this;var _0x2d7b1f;if(_0x3f138b&&_0x3f138b[_0xbca8('0x50')]===_0xbca8('0x7f')){delete this[_0xbca8('0x26')][_0x16e6ad[_0xbca8('0xe6')]];this[_0xbca8('0xbd')](this[_0xbca8('0x21')][_0x3f138b['queue']]);this['campaigns'][_0x3f138b[_0xbca8('0xbc')]][_0xbca8('0x10f')]+=0x1;_0x2d7b1f=new Hangup(_0x3f138b,_0x16e6ad);this['createHistory'](_0x2d7b1f)[_0xbca8('0xba')](loggerCatch(_0xbca8('0x110')));this[_0xbca8('0xd0')](_0x2d7b1f)[_0xbca8('0xba')](loggerCatch(_0xbca8('0x111')));}if(_0x3f138b&&_0x3f138b[_0xbca8('0x50')]!==_0xbca8('0x7f')&&isNotNull(this[_0xbca8('0x20')][_0x3f138b[_0xbca8('0xbc')]]['dialQueueProject'])){delete this[_0xbca8('0x26')][_0x16e6ad[_0xbca8('0xe6')]];this[_0xbca8('0xbd')](this[_0xbca8('0x20')][_0x3f138b[_0xbca8('0xbc')]]);this['voiceQueues'][_0x3f138b[_0xbca8('0xbc')]]['outboundAnswerCallsDay']+=0x1;this[_0xbca8('0x20')][_0x3f138b['queue']][_0xbca8('0x62')]+=0x1;_0x2d7b1f=new Hangup(_0x3f138b,_0x16e6ad);_0x2d7b1f[_0xbca8('0xae')]=0x10;_0x2d7b1f['statedesc']=_0xbca8('0x112');_0x2d7b1f[_0xbca8('0xee')]=_0xbca8('0x113');this['createHistory'](_0x2d7b1f)[_0xbca8('0xba')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xbca8('0xd0')](_0x2d7b1f)['catch'](loggerCatch(_0xbca8('0x111')));}if(_0x3f138b&&_0x3f138b[_0xbca8('0x50')]!==_0xbca8('0x7f')&&!isNotNull(this['voiceQueues'][_0x3f138b['queue']][_0xbca8('0x114')])){delete this['uniqueId'][_0x16e6ad['uniqueid']];this[_0xbca8('0xbd')](this[_0xbca8('0x20')][_0x3f138b[_0xbca8('0xbc')]]);this[_0xbca8('0x20')][_0x3f138b[_0xbca8('0xbc')]]['outboundUnknownCallsDay']+=0x1;_0x2d7b1f=new Hangup(_0x3f138b,_0x16e6ad);_0x2d7b1f[_0xbca8('0xae')]=0xc;_0x2d7b1f[_0xbca8('0xaf')]=_0x16e6ad['cause-txt'];_0x2d7b1f[_0xbca8('0xee')]=_0xbca8('0x115');this[_0xbca8('0xd1')](_0x2d7b1f)['catch'](loggerCatch(_0xbca8('0x110')));this[_0xbca8('0xd0')](_0x2d7b1f)[_0xbca8('0xba')](loggerCatch(_0xbca8('0x111')));}};Dialer[_0xbca8('0x1a')][_0xbca8('0x33')]=function(_0x5d2093){var _0x29cecf=this['uniqueId'][_0x5d2093['uniqueid']];var _0x3f65ad=this;if(this[_0xbca8('0x20')][_0x5d2093[_0xbca8('0xbc')]]){if(_0x29cecf&&_0x29cecf[_0xbca8('0x50')]!==_0xbca8('0x7f')){delete this['uniqueId'][_0x5d2093[_0xbca8('0xe6')]];this[_0xbca8('0x20')][_0x5d2093[_0xbca8('0xbc')]]['outboundAnswerCallsDay']+=0x1;var _0x2c5a11=new AgentComplete(_0x29cecf,_0x5d2093);if(_0x5d2093[_0xbca8('0x116')]===_0xbca8('0x117')){_0x2c5a11['agiafterat']=this['voiceQueues'][_0x5d2093[_0xbca8('0xbc')]][_0xbca8('0x118')]&&this[_0xbca8('0x20')][_0x5d2093[_0xbca8('0xbc')]][_0xbca8('0x119')]?moment()[_0xbca8('0x9b')](_0xbca8('0x10d')):undefined;}this[_0xbca8('0xd1')](_0x2c5a11)['catch'](loggerCatch(_0xbca8('0x11a')));this[_0xbca8('0xd0')](_0x2c5a11)['catch'](loggerCatch(_0xbca8('0x11b')));}}};Dialer[_0xbca8('0x1a')][_0xbca8('0x11c')]=function(_0x5c24e6){if(this[_0xbca8('0x20')][_0x5c24e6[_0xbca8('0xbc')]]){if(this['uniqueId'][_0x5c24e6['uniqueid']]&&this[_0xbca8('0x26')][_0x5c24e6[_0xbca8('0xe6')]]['type']!==_0xbca8('0x7f')){this[_0xbca8('0xbd')](this[_0xbca8('0x20')][_0x5c24e6[_0xbca8('0xbc')]]);this[_0xbca8('0x26')][_0x5c24e6[_0xbca8('0xe6')]][_0xbca8('0x11d')]=moment()[_0xbca8('0x9b')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer['prototype'][_0xbca8('0x11e')]=function(_0x5f1745){this[_0xbca8('0xd1')](_0x5f1745)[_0xbca8('0xba')](loggerCatch(_0xbca8('0x11a')));this['moveContactManagedDialer'](_0x5f1745)[_0xbca8('0xba')](loggerCatch(_0xbca8('0x11f')));};Dialer[_0xbca8('0x1a')][_0xbca8('0x2f')]=function(_0x453dcb){var _0x47d22b=this[_0xbca8('0x26')][_0x453dcb[_0xbca8('0xe6')]];var _0x80ee5=this;if(this[_0xbca8('0x20')][_0x453dcb[_0xbca8('0xbc')]]){if(_0x47d22b&&_0x47d22b[_0xbca8('0x50')]!==_0xbca8('0x7f')){delete this[_0xbca8('0x26')][_0x453dcb[_0xbca8('0xe6')]];this[_0xbca8('0xbd')](this[_0xbca8('0x20')][_0x453dcb[_0xbca8('0xbc')]]);_0x47d22b[_0xbca8('0x120')]=moment()[_0xbca8('0x9b')]('YYYY-MM-DD\x20HH:mm:ss');var _0x253aad=new QueueCallerAbandon(_0x47d22b,_0x453dcb);if(getSeconds(_0x47d22b[_0xbca8('0x120')],_0x47d22b['responsetime'])>=_0x47d22b[_0xbca8('0x121')]){this['voiceQueues'][_0x453dcb['queue']][_0xbca8('0x71')]+=0x1;this['voiceQueues'][_0x453dcb['queue']]['outboundDropCallsDayTimeout']+=0x1;this[_0xbca8('0x20')][_0x453dcb[_0xbca8('0xbc')]][_0xbca8('0x73')]+=0x1;_0x253aad[_0xbca8('0xae')]=0xa;_0x253aad[_0xbca8('0xaf')]=_0xbca8('0x122');_0x253aad[_0xbca8('0x123')]=_0xbca8('0x124');_0x253aad[_0xbca8('0x125')]=this[_0xbca8('0x20')][_0x453dcb['queue']]['dialQueueProject2']?moment()[_0xbca8('0x9b')](_0xbca8('0x10d')):undefined;_0x253aad['countdropretry']+=0x1;_0x253aad[_0xbca8('0xf7')]+=0x1;if(_0x253aad['countdropretry']>=this['voiceQueues'][_0x453dcb[_0xbca8('0xbc')]][_0xbca8('0x126')]){this[_0xbca8('0x11e')](_0x253aad);}else{this[_0xbca8('0xc7')]({'active':![],'countdropretry':_0x253aad[_0xbca8('0xfc')],'scheduledat':moment()['add'](this[_0xbca8('0x20')][_0x453dcb[_0xbca8('0xbc')]][_0xbca8('0x127')],_0xbca8('0x107'))[_0xbca8('0x9b')](_0xbca8('0x10d')),'ContactId':_0x47d22b[_0xbca8('0xd9')],'ListId':_0x47d22b[_0xbca8('0xda')],'VoiceQueueId':_0x47d22b[_0xbca8('0xdc')]||undefined,'CampaignId':_0x47d22b[_0xbca8('0x108')]||undefined})[_0xbca8('0xba')](loggerCatch(_0xbca8('0x128')));var _0x539c5c=new History(_0x253aad);_0x539c5c[_0xbca8('0xae')]=0xa;_0x539c5c['statedesc']=_0xbca8('0x122');_0x539c5c[_0xbca8('0xb1')]=moment()[_0xbca8('0x9b')](_0xbca8('0x10d'));_0x539c5c[_0xbca8('0xb0')]=_0x539c5c[_0xbca8('0xb1')];_0x539c5c[_0xbca8('0x129')]=_0x253aad[_0xbca8('0x129')];_0x539c5c[_0xbca8('0x12a')]=_0x253aad[_0xbca8('0x12a')];this['createHistory'](_0x539c5c)[_0xbca8('0xba')](loggerCatch('[syncAgentComplete][createHistory][10]'));}}else{this[_0xbca8('0x20')][_0x453dcb['queue']]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this['voiceQueues'][_0x453dcb[_0xbca8('0xbc')]][_0xbca8('0x12b')]+=0x1;_0x253aad['state']=0xb;_0x253aad[_0xbca8('0xaf')]='Abandoned';_0x253aad[_0xbca8('0x123')]=_0xbca8('0x12c');_0x253aad[_0xbca8('0xfd')]+=0x1;_0x253aad[_0xbca8('0xf7')]+=0x1;if(_0x253aad[_0xbca8('0xfd')]>=this[_0xbca8('0x20')][_0x453dcb['queue']][_0xbca8('0x12d')]){this['queueCallerAbandonCreateState'](_0x253aad);}else{this[_0xbca8('0xc7')]({'active':![],'countabandonedretry':_0x253aad[_0xbca8('0xfd')],'scheduledat':moment()['add'](this['voiceQueues'][_0x453dcb['queue']][_0xbca8('0x12e')],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x47d22b[_0xbca8('0xd9')],'ListId':_0x47d22b[_0xbca8('0xda')],'VoiceQueueId':_0x47d22b[_0xbca8('0xdc')]||undefined,'CampaignId':_0x47d22b[_0xbca8('0x108')]||undefined})[_0xbca8('0xba')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x539c5c=new History(_0x253aad);_0x539c5c[_0xbca8('0xae')]=0xb;_0x539c5c[_0xbca8('0xaf')]='Abandoned';_0x539c5c['starttime']=moment()[_0xbca8('0x9b')]('YYYY-MM-DD\x20HH:mm:ss');_0x539c5c[_0xbca8('0xb0')]=_0x539c5c[_0xbca8('0xb1')];_0x539c5c[_0xbca8('0x129')]=_0x253aad[_0xbca8('0x129')];_0x539c5c[_0xbca8('0x12a')]=_0x253aad[_0xbca8('0x12a')];this[_0xbca8('0xd1')](_0x539c5c)[_0xbca8('0xba')](loggerCatch('[syncAgentComplete][createHistory][11]'));}}}}};Dialer[_0xbca8('0x1a')][_0xbca8('0x12f')]=function(_0x110ca3){if(this[_0xbca8('0x25')][_0x110ca3[_0xbca8('0xe6')]]){this[_0xbca8('0x25')][_0x110ca3['uniqueid']][_0xbca8('0xb9')]=_0x110ca3['channel'];}if(this[_0xbca8('0x26')][_0x110ca3[_0xbca8('0xe6')]]){this[_0xbca8('0x26')][_0x110ca3[_0xbca8('0xe6')]][_0xbca8('0xb9')]=_0x110ca3[_0xbca8('0xb9')];}};Dialer[_0xbca8('0x1a')][_0xbca8('0x130')]=function(_0x312382){if(strategy[this['voiceQueues'][this[_0xbca8('0x25')][_0x312382[_0xbca8('0x131')]][_0xbca8('0xbc')]][_0xbca8('0x52')]]===_0xbca8('0x132')){if(this[_0xbca8('0x25')][_0x312382['actionid']]&&_[_0xbca8('0xb6')](this[_0xbca8('0x25')][_0x312382['actionid']]['locked'])&&_0x312382[_0xbca8('0xb8')]==='1'&&_0x312382[_0xbca8('0x133')]==='0'){if(this[_0xbca8('0x134')][_0x312382[_0xbca8('0x135')]]){if(!this['agents'][_0x312382[_0xbca8('0x135')]][_0xbca8('0x136')]){this['agents'][_0x312382[_0xbca8('0x135')]]['locked']=!![];this[_0xbca8('0x25')][_0x312382[_0xbca8('0x131')]]['locked']=!![];this[_0xbca8('0x25')][_0x312382[_0xbca8('0x131')]]['stateinterface']=_0x312382[_0xbca8('0x135')];}}}}else if((strategy[this[_0xbca8('0x20')][this[_0xbca8('0x25')][_0x312382['actionid']][_0xbca8('0xbc')]][_0xbca8('0x52')]]||_0xbca8('0x19'))===_0xbca8('0x19')){if(this['actions'][_0x312382['actionid']]){if(this[_0xbca8('0x134')][_0x312382[_0xbca8('0x135')]]){this[_0xbca8('0x25')][_0x312382['actionid']][_0xbca8('0x135')]=_0x312382[_0xbca8('0x135')];if(_['isNil'](this[_0xbca8('0x2a')][this[_0xbca8('0x25')][_0x312382['actionid']]['queue']])){this[_0xbca8('0x2a')][this[_0xbca8('0x25')][_0x312382[_0xbca8('0x131')]]['queue']]=[];}this['queueBooked'][this[_0xbca8('0x25')][_0x312382[_0xbca8('0x131')]][_0xbca8('0xbc')]][_0xbca8('0x137')](_[_0xbca8('0x93')](_[_0xbca8('0xd8')](this[_0xbca8('0x25')][_0x312382[_0xbca8('0x131')]],['idHopper',_0xbca8('0x135')]),{'status':_0x312382[_0xbca8('0xb8')],'paused':_0x312382[_0xbca8('0x133')]}));}}}};function unlockQueueStatus(_0x326b79,_0x29d41e){setTimeout(function(){if(_[_0xbca8('0x40')](_0x326b79[_0xbca8('0x138')])){loggerBooked[_0xbca8('0x9d')]('[unlockQueueStatus][undefined]',_0x29d41e);}_0x326b79[_0xbca8('0x138')]=!![];loggerBooked[_0xbca8('0x81')](_0xbca8('0x139'),_0x29d41e,JSON['stringify'](_[_0xbca8('0xd8')](_0x326b79,[_0xbca8('0x44'),'queueStatusComplete'])));},0x1f3);}Dialer[_0xbca8('0x1a')][_0xbca8('0x3b')]=function(_0x1ab8e3){var _0x49c632=this;var _0x4c1b0e=_0x49c632[_0xbca8('0x20')][_0x49c632[_0xbca8('0x25')][_0x1ab8e3[_0xbca8('0x131')]][_0xbca8('0xbc')]];if(strategy[this['voiceQueues'][this[_0xbca8('0x25')][_0x1ab8e3[_0xbca8('0x131')]][_0xbca8('0xbc')]][_0xbca8('0x52')]]===_0xbca8('0x132')){if(this[_0xbca8('0x25')][_0x1ab8e3[_0xbca8('0x131')]]&&this[_0xbca8('0x25')][_0x1ab8e3[_0xbca8('0x131')]]['stateinterface']){this['preview'][_0xbca8('0x13a')](this[_0xbca8('0x25')][_0x1ab8e3[_0xbca8('0x131')]][_0xbca8('0x13b')],this[_0xbca8('0x25')][_0x1ab8e3[_0xbca8('0x131')]][_0xbca8('0x135')])[_0xbca8('0xba')](function(_0x408450){logger[_0xbca8('0x9d')](_0xbca8('0x13c'),util[_0xbca8('0x13d')](_0x408450,{'showHidden':![],'depth':null}));})[_0xbca8('0x1d')](function(){_0x49c632[_0xbca8('0xbd')](_0x49c632[_0xbca8('0x20')][_0x49c632['actions'][_0x1ab8e3[_0xbca8('0x131')]][_0xbca8('0xbc')]]);_0x49c632['agents'][_0x49c632['actions'][_0x1ab8e3[_0xbca8('0x131')]]['stateinterface']][_0xbca8('0x136')]=![];delete _0x49c632[_0xbca8('0x25')][_0x1ab8e3[_0xbca8('0x131')]];unlockQueueStatus(_0x4c1b0e);});}else{this['updateOriginated'](this[_0xbca8('0x20')][this['actions'][_0x1ab8e3[_0xbca8('0x131')]][_0xbca8('0xbc')]]);this[_0xbca8('0xc7')]({'active':![],'ContactId':this[_0xbca8('0x25')][_0x1ab8e3[_0xbca8('0x131')]]['ContactId'],'ListId':this['actions'][_0x1ab8e3[_0xbca8('0x131')]]['ListId'],'VoiceQueueId':this[_0xbca8('0x25')][_0x1ab8e3[_0xbca8('0x131')]]['VoiceQueueId']||undefined,'CampaignId':this[_0xbca8('0x25')][_0x1ab8e3[_0xbca8('0x131')]]['CampaignId']||undefined})[_0xbca8('0xba')](loggerCatch(_0xbca8('0x13e')));delete this[_0xbca8('0x25')][_0x1ab8e3[_0xbca8('0x131')]];unlockQueueStatus(_0x4c1b0e);}}else if((strategy[this[_0xbca8('0x20')][this[_0xbca8('0x25')][_0x1ab8e3['actionid']][_0xbca8('0xbc')]][_0xbca8('0x52')]]||_0xbca8('0x19'))===_0xbca8('0x19')){var _0x32bfb2;if(this['actions'][_0x1ab8e3[_0xbca8('0x131')]]&&!_[_0xbca8('0x4a')](this[_0xbca8('0x2a')][this[_0xbca8('0x25')][_0x1ab8e3[_0xbca8('0x131')]]['queue']])){if(this[_0xbca8('0x2b')][_0x49c632[_0xbca8('0x25')][_0x1ab8e3[_0xbca8('0x131')]][_0xbca8('0xbc')]]){this['queueBookedRR'][_0x49c632['actions'][_0x1ab8e3[_0xbca8('0x131')]][_0xbca8('0xbc')]]=this[_0xbca8('0x2b')][this[_0xbca8('0x25')][_0x1ab8e3['actionid']]['queue']]?this[_0xbca8('0x2b')][this[_0xbca8('0x25')][_0x1ab8e3[_0xbca8('0x131')]]['queue']]:this[_0xbca8('0x2a')][this[_0xbca8('0x25')][_0x1ab8e3[_0xbca8('0x131')]][_0xbca8('0xbc')]]?this[_0xbca8('0x2a')][this[_0xbca8('0x25')][_0x1ab8e3[_0xbca8('0x131')]][_0xbca8('0xbc')]][_0xbca8('0x13f')]||0x0:0x0;}this[_0xbca8('0x2a')][this['actions'][_0x1ab8e3[_0xbca8('0x131')]][_0xbca8('0xbc')]][_0xbca8('0x13f')]=this[_0xbca8('0x2b')][this[_0xbca8('0x25')][_0x1ab8e3[_0xbca8('0x131')]][_0xbca8('0xbc')]];for(var _0x1b9ba7=0x0;_0x1b9ba7=0x0;})['catch'](myreject(_0x46c770)));}}else{_0x289cda[_0xbca8('0x137')](ami['Action']({'action':_0xbca8('0x15a'),'command':util[_0xbca8('0x9b')]('iftime\x20%s,%s',_0x279d5f,!_[_0xbca8('0x40')](config[_0xbca8('0x156')][_0x1c697e])?_0x1c697e:'')})[_0xbca8('0x3e')](function(_0x4839ed){return _0x4839ed[_0xbca8('0x157')]['indexOf'](_0xbca8('0x159'))>=0x0;})[_0xbca8('0xba')](myreject(_0x46c770)));}BPromise['all'](_0x289cda)[_0xbca8('0x3e')](function(_0xd2bd66){var _0x4cda65=_[_0xbca8('0x15b')](_0xd2bd66);if(_0x4cda65){return _0x1209d2(_0x4cda65);}else{_0x58680a[_0xbca8('0x41')]=_0x21dd08?_0xbca8('0x15c'):_0xbca8('0x15d');return _0x46c770(msgResponse('[ifTime][promiseAll]','Failure',_0xbca8('0x15e')+_0x21dd08+'\x20'+_0x11b5ba+'\x20Interval\x20is\x20overtime:\x20'+util[_0xbca8('0x13d')](_0x279d5f,{'showHidden':![],'depth':null})+_0xbca8('0x15f')+_0x1c697e));}})['catch'](function(_0x59d64d){return _0x46c770(msgResponse(_0xbca8('0x14e'),'Failure',JSON['stringify'](_0x59d64d)));});});};Dialer[_0xbca8('0x1a')][_0xbca8('0x160')]=function(_0x14502c){var _0xe9da36=this;return function(){switch(_0x14502c[_0xbca8('0x5d')]){case'progressive':freeVariablesPredictive(_0x14502c);_0xe9da36[_0xbca8('0x161')](_0x14502c,0x1);break;case _0xbca8('0x162'):freeVariablesPredictive(_0x14502c);_0xe9da36[_0xbca8('0x161')](_0x14502c,_0x14502c['dialPowerLevel']);break;case _0xbca8('0x9'):_0xe9da36[_0xbca8('0x9')](_0x14502c);break;case _0xbca8('0x8'):freeVariablesPredictive(_0x14502c);_0xe9da36[_0xbca8('0x161')](_0x14502c,0x1);break;default:freeVariablesPredictive(_0x14502c);logger[_0xbca8('0x9d')](_0xbca8('0x163'),_0x14502c[_0xbca8('0x44')],_0xbca8('0x164'));}};};Dialer['prototype']['checkPreviewRecallReminder']=_['throttle'](function(_0x213b5c){return BPromise['resolve']()[_0xbca8('0x3e')](cmHopper[_0xbca8('0x165')](_0x213b5c['id'],previewRecallmeReminderInterval))[_0xbca8('0x3e')](function(_0x467218){for(var _0x2459e6=0x0;_0x2459e6<_0x467218[_0xbca8('0x9f')];_0x2459e6++){var _0x11fce5=_0x467218[_0x2459e6][_0xbca8('0x166')][_0xbca8('0x44')];if(_0x11fce5)io['to'](util[_0xbca8('0x9b')](_0xbca8('0x167'),_0x11fce5))[_0xbca8('0x4f')]('user:dialPreviewRecallReminder',{'hopper':_0x467218[_0x2459e6]});}})[_0xbca8('0xba')](function(_0x23a9e9){logger[_0xbca8('0x9d')](_0xbca8('0x168'),_0x23a9e9);});},0x3c*0x3e8,{'leading':!![]});Dialer[_0xbca8('0x1a')][_0xbca8('0x169')]=function(_0x455195){var _0x2cfd21=this;return function(){_0x2cfd21[_0xbca8('0x16a')](_0x455195);};};Dialer[_0xbca8('0x1a')]['syncQueueSummary']=function(_0x965162){var _0x3b3ed7=this;if(isNotPreview(_0x965162[_0xbca8('0x5d')])){if(isVoiceQueueOutbound(_0x965162[_0xbca8('0x50')])&&isActive(_0x965162[_0xbca8('0x16b')])){_0x965162[_0xbca8('0xa7')]=!![];BPromise[_0xbca8('0xc0')]()[_0xbca8('0x3e')](checkIsLoggedIn(_0x965162,_0x965162['loggedIn']))[_0xbca8('0x3e')](checkIsActive(_0x965162,_0x965162[_0xbca8('0x16b')]))['then'](checkInterval(_0x965162))[_0xbca8('0x3e')](_0x3b3ed7['checkIsTrunkReachable'](_0x965162))['then'](_0x3b3ed7[_0xbca8('0x14d')](_0x965162[_0xbca8('0x16c')],_0x965162[_0xbca8('0x16d')],_0x965162[_0xbca8('0x44')],_0x965162))[_0xbca8('0x3e')](_0x3b3ed7[_0xbca8('0x14f')](_0x965162[_0xbca8('0x46')],_0x965162[_0xbca8('0x16d')],_0x965162['name'],_0x965162))[_0xbca8('0x3e')](_0x3b3ed7[_0xbca8('0x160')](_0x965162))['catch'](loggerCatchQueueSummary(_0xbca8('0x16e'),_0x965162));}else{notSendMessagesQueue(_0x965162);}}else{freeVariablesPredictive(_0x965162);if(_0x965162['dialPreviewRecallmeReminder']){_0x3b3ed7[_0xbca8('0x168')](_0x965162);}}};Dialer[_0xbca8('0x1a')][_0xbca8('0x16f')]=function(){var _0x4653fd=this;var _0x1b1182;for(var _0x3fa399 in this[_0xbca8('0x21')]){if(typeof this[_0xbca8('0x21')][_0x3fa399]!==_0xbca8('0xb5')){_0x1b1182=this[_0xbca8('0x21')][_0x3fa399];if(isCampaignIvr(_0x1b1182['type'])&&isActive(_0x1b1182['active'])){_0x1b1182['sendMessageOneNotActive']=!![];BPromise['resolve']()[_0xbca8('0x3e')](checkIsActive(_0x1b1182,_0x1b1182[_0xbca8('0xe1')]))[_0xbca8('0x3e')](checkInterval(_0x1b1182))['then'](_0x4653fd[_0xbca8('0x149')](_0x1b1182))['then'](_0x4653fd['checkIfTime'](_0x1b1182[_0xbca8('0x16c')],_0x1b1182[_0xbca8('0x16d')],_0x1b1182['name'],_0x1b1182))['then'](_0x4653fd['checkIfTimeIntervals'](_0x1b1182[_0xbca8('0x46')],_0x1b1182[_0xbca8('0x16d')],_0x1b1182[_0xbca8('0x44')],_0x1b1182))[_0xbca8('0x3e')](_0x4653fd['launchHandleIvr'](_0x1b1182))['catch'](loggerCatchQueueSummary(_0xbca8('0x170'),_0x1b1182));}else{notSendMessagesCampaign(_0x1b1182);}}}};function getCallerIdRandom(_0x36b678,_0x38a7f1){var _0x22a768;var _0x543351;var _0x46a4a3;if(_0x38a7f1<=0x0){_0x38a7f1=0x1;}_0x22a768=new RegExp(_0xbca8('0x171')+_0x38a7f1+'}$');_0x543351=Math[_0xbca8('0x172')](0xa,_0x38a7f1-0x1);_0x46a4a3=Math[_0xbca8('0x172')](0xa,_0x38a7f1)-0x1;return util['format']('%s',_[_0xbca8('0x173')](_0x36b678,_0x22a768,_[_0xbca8('0x174')](_0x543351,_0x46a4a3)));}function extractCalleridName(_0x51acff){var _0x1ca1ff=_0x51acff['match'](/"(.*?)"/);return _0x1ca1ff?_0x1ca1ff[0x1]:_0x51acff;}function extractCalleridNumber(_0x3beea1){var _0x37fd1d=_0x3beea1[_0xbca8('0x175')](/<(.*?)>/);return _0x37fd1d?_0x37fd1d[0x1]:_0x3beea1;}Dialer[_0xbca8('0x1a')][_0xbca8('0x176')]=function(_0x59a16b,_0x405ee5){var _0x346f20=this;var _0x2e816f=uuid['v4']();this[_0xbca8('0x25')][_0x2e816f]=new Action(_0x59a16b,_0x405ee5,_0x2e816f);return new BPromise(function(_0x3c43c9,_0x150881){if(_['isUndefined'](_0x59a16b)&&typeof _0x59a16b!==_0xbca8('0x177')){return _0x150881(msgResponse('originate',_0xbca8('0x151'),_0xbca8('0x178')));}if(_[_0xbca8('0x40')](_0x405ee5[_0xbca8('0x179')][_0xbca8('0x17a')])||_0x405ee5[_0xbca8('0x179')]['phone']===null){return _0x150881(msgResponse(_0xbca8('0x17b'),_0xbca8('0x151'),_0xbca8('0x17c')));}var _0x423ed8={'XMD-CALLERID':_0x346f20[_0xbca8('0x25')][_0x2e816f][_0xbca8('0x17d')](),'XMD-AGI':_0x59a16b[_0xbca8('0x114')]?util[_0xbca8('0x9b')]('\x22agi://%s/square,%s\x22',ipAgi,_0x59a16b[_0xbca8('0x114')]):_0xbca8('0x17e'),'XMD-AGIAFTER':_0x59a16b[_0xbca8('0x118')]?util[_0xbca8('0x9b')](_0xbca8('0x17f'),ipAgi,_0x59a16b['dialQueueProject2']):_0xbca8('0x17e'),'XMD-QUEUE':_0x59a16b['type']===_0xbca8('0x51')?util[_0xbca8('0x9b')](_0xbca8('0x180'),_0x59a16b[_0xbca8('0x44')],_0x59a16b['dialQueueOptions']||'',_0x59a16b['dialAgiAfterHangupAgent']?'c':'',_0x59a16b[_0xbca8('0x121')]||0x3):_0xbca8('0x17e'),'XMD-CONTACTID':_0x405ee5['ContactId'],'XMD-CDRTYPE':_0xbca8('0x7'),'CALLERID(all)':_0x346f20[_0xbca8('0x25')][_0x2e816f][_0xbca8('0x17d')](),'XMD-AMD':_0x59a16b['dialAMDActive']?_0xbca8('0x181'):_0xbca8('0x17e'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x59a16b[_0xbca8('0xea')]){_0x423ed8[_0xbca8('0x182')]=_0x59a16b[_0xbca8('0x183')]||0x9c4;_0x423ed8['XMD-AMDGREETING']=_0x59a16b[_0xbca8('0x184')]||0x5dc;_0x423ed8[_0xbca8('0x185')]=_0x59a16b[_0xbca8('0x186')]||0x320;_0x423ed8[_0xbca8('0x187')]=_0x59a16b[_0xbca8('0x188')]||0x1388;_0x423ed8[_0xbca8('0x189')]=_0x59a16b['dialAMDMinWordLength']||0x64;_0x423ed8[_0xbca8('0x18a')]=_0x59a16b[_0xbca8('0x18b')]||0x32;_0x423ed8[_0xbca8('0x18c')]=_0x59a16b['dialAMDMaximumNumberOfWords']||0x3;_0x423ed8[_0xbca8('0x18d')]=_0x59a16b[_0xbca8('0x18e')]||0x100;_0x423ed8['XMD-AMDMAXIMUMWORDLENGTH']=_0x59a16b[_0xbca8('0x18f')]||0x1388;}if(_0x59a16b[_0xbca8('0x50')]===_0xbca8('0x51')){_0x423ed8[_0xbca8('0x190')]=_0x405ee5[_0xbca8('0xdc')];}else{_0x423ed8['XMD-CAMPAIGNID']=_0x405ee5[_0xbca8('0x108')];}for(var _0x26dc5d in _0x405ee5[_0xbca8('0x179')]){if(typeof _0x405ee5[_0xbca8('0x179')][_0x26dc5d]!=='undefined'){if(isNotNull(_0x405ee5[_0xbca8('0x179')][_0x26dc5d])&&_0x26dc5d!=='id'&&_0x26dc5d!=='tags'&&_0x26dc5d!==_0xbca8('0x191')&&_0x26dc5d!==_0xbca8('0x192')){_0x423ed8[util[_0xbca8('0x9b')](_0xbca8('0x193'),_0xbca8('0x194'),_[_0xbca8('0x195')](_0x26dc5d))]=_0x405ee5[_0xbca8('0x179')][_0x26dc5d];}}}var _0x391e24=_0x346f20[_0xbca8('0xe0')](_0x59a16b[_0xbca8('0x7c')])?getCallerId(_0x59a16b['Trunk']['callerid'],_0x59a16b[_0xbca8('0x5e')],_0x59a16b[_0xbca8('0x196')]>0x0?getCallerIdRandom(_0x59a16b[_0xbca8('0x5f')],_0x59a16b[_0xbca8('0x196')]):_0x59a16b['dialOriginateCallerIdNumber']):getCallerId(_['isNil'](_0x59a16b[_0xbca8('0x14a')])?_0x59a16b[_0xbca8('0x7c')][_0xbca8('0x197')]:_0x59a16b[_0xbca8('0x14a')]['callerid'],_0x59a16b[_0xbca8('0x5e')],_0x59a16b[_0xbca8('0x196')]>0x0?getCallerIdRandom(_0x59a16b[_0xbca8('0x5f')],_0x59a16b[_0xbca8('0x196')]):_0x59a16b[_0xbca8('0x5f')]);if(_0x391e24){_0x423ed8['XMD-ORIGINATECALLERIDNAME']=_0x346f20[_0xbca8('0x25')][_0x2e816f][_0xbca8('0x198')]=extractCalleridName(_0x391e24);_0x423ed8[_0xbca8('0x199')]=_0x346f20['actions'][_0x2e816f][_0xbca8('0x19a')]=extractCalleridNumber(_0x391e24);}return ami[_0xbca8('0xb7')]({'actionid':_0x2e816f,'action':_0xbca8('0x17b'),'channel':_0x346f20['isTrunkReachable'](_0x59a16b[_0xbca8('0x7c')])?util['format']('SIP/%s/%s%s',_0x59a16b[_0xbca8('0x7c')][_0xbca8('0x44')],isNotNull(_0x59a16b[_0xbca8('0x61')])?_0x59a16b[_0xbca8('0x61')][_0xbca8('0x19b')]()||'':'',_0x59a16b['dialCutDigit']>0x0?_0x405ee5[_0xbca8('0x179')][_0xbca8('0x17a')][_0xbca8('0x19c')](_0x59a16b[_0xbca8('0x19d')]):_0x405ee5[_0xbca8('0x179')]['phone']):util[_0xbca8('0x9b')](_0xbca8('0x19e'),_['isNil'](_0x59a16b['TrunkBackup'])?_0x59a16b[_0xbca8('0x7c')]['name']:_0x59a16b[_0xbca8('0x14a')][_0xbca8('0x44')],isNotNull(_0x59a16b[_0xbca8('0x61')])?_0x59a16b[_0xbca8('0x61')]['trim']()||'':'',_0x59a16b['dialCutDigit']>0x0?_0x405ee5[_0xbca8('0x179')][_0xbca8('0x17a')][_0xbca8('0x19c')](_0x59a16b[_0xbca8('0x19d')]):_0x405ee5['Contact'][_0xbca8('0x17a')]),'callerid':_0x391e24,'Exten':_0xbca8('0xe9'),'Context':_0xbca8('0x19f'),'Priority':'1','variable':_0x423ed8,'timeout':(_0x59a16b['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x2e816f})[_0xbca8('0x3e')](function(_0x127429){return _0x3c43c9(_0x127429);})[_0xbca8('0xba')](function(_0x34f6bd){_0x59a16b[_0xbca8('0x6a')]+=0x1;var _0x4c06fc=new History(_0x346f20[_0xbca8('0x25')][_0x2e816f]);logger[_0xbca8('0x9d')](util[_0xbca8('0x9b')]('[originateError]:\x20%s',JSON['stringify'](_0x34f6bd)));_0x4c06fc[_0xbca8('0xae')]=0xe;_0x4c06fc[_0xbca8('0xaf')]='OriginateError';_0x4c06fc['starttime']=moment()[_0xbca8('0x9b')](_0xbca8('0x10d'));_0x4c06fc[_0xbca8('0xb0')]=_0x4c06fc[_0xbca8('0xb1')];_0x346f20['createHistory'](_0x4c06fc)['catch'](loggerCatch(_0xbca8('0x1a0')));_0x346f20[_0xbca8('0xd0')](_0x4c06fc)[_0xbca8('0xba')](loggerCatch(_0xbca8('0x1a0')))['finally'](function(){delete _0x346f20[_0xbca8('0x25')][_0x2e816f];return _0x150881(msgResponse(_0xbca8('0x17b'),_0xbca8('0x1a1'),_0xbca8('0x1a2')));});});});};Dialer['prototype']['syncOriginateResponse']=function(_0x380105){var _0x3899a9=this[_0xbca8('0x25')][_0x380105[_0xbca8('0x131')]];if(_0x3899a9){delete this[_0xbca8('0x25')][_0x380105[_0xbca8('0x131')]];_0x3899a9[_0xbca8('0x1a3')]=moment()[_0xbca8('0x9b')](_0xbca8('0x10d'));var _0x4cdd4c=_0x3899a9[_0xbca8('0x50')]===_0xbca8('0x7f')?this[_0xbca8('0x21')][_0x3899a9[_0xbca8('0xbc')]]:this[_0xbca8('0x20')][_0x3899a9[_0xbca8('0x1a4')]()];if(!this[_0xbca8('0x1a5')](_0x380105[_0xbca8('0x1a6')])){this[_0xbca8('0xbd')](_0x4cdd4c);return this['callProgressDetecting'](_0x3899a9,_0x4cdd4c,_0x380105)[_0xbca8('0xba')](loggerCatch(_0xbca8('0x1a7')));}this['uniqueId'][_0x380105['uniqueid']]=_0x3899a9;}};Dialer[_0xbca8('0x1a')][_0xbca8('0x1a8')]=function(_0x45211e,_0x22e4d8,_0x10d194){var _0x190f7b=new History(_0x22e4d8);if(_0x190f7b[_0xbca8('0x10c')]+_0x190f7b['countcongestionretry']+_0x190f7b[_0xbca8('0xfa')]+_0x190f7b[_0xbca8('0xfb')]+_0x190f7b[_0xbca8('0xfc')]+_0x190f7b[_0xbca8('0xfd')]+_0x190f7b[_0xbca8('0xf6')]+_0x190f7b['countagentrejectretry']>=_0x10d194['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x45211e){case 0x3:if(_0x190f7b[_0xbca8('0xfa')]>=_0x10d194[_0xbca8('0x1a9')]-0x1){return!![];}this[_0xbca8('0xc7')]({'active':![],'countnoanswerretry':_0x190f7b[_0xbca8('0xfa')]+=0x1,'scheduledat':moment()[_0xbca8('0x105')](_0x10d194[_0xbca8('0x1aa')],_0xbca8('0x107'))[_0xbca8('0x9b')](_0xbca8('0x10d')),'ContactId':_0x190f7b[_0xbca8('0xd9')],'ListId':_0x190f7b[_0xbca8('0xda')],'VoiceQueueId':_0x190f7b['VoiceQueueId']||undefined,'CampaignId':_0x190f7b[_0xbca8('0x108')]||undefined})[_0xbca8('0xba')](loggerCatch(_0xbca8('0x1ab')));break;case 0x5:if(_0x190f7b[_0xbca8('0x10c')]>=_0x10d194[_0xbca8('0x1ac')]-0x1){return!![];}this[_0xbca8('0xc7')]({'active':![],'countbusyretry':_0x190f7b[_0xbca8('0x10c')]+=0x1,'scheduledat':moment()[_0xbca8('0x105')](_0x10d194[_0xbca8('0x1ad')],_0xbca8('0x107'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x190f7b[_0xbca8('0xd9')],'ListId':_0x190f7b[_0xbca8('0xda')],'VoiceQueueId':_0x190f7b[_0xbca8('0xdc')]||undefined,'CampaignId':_0x190f7b[_0xbca8('0x108')]||undefined})[_0xbca8('0xba')](loggerCatch(_0xbca8('0x1ae')));break;case 0x8:if(_0x190f7b[_0xbca8('0xf9')]>=_0x10d194[_0xbca8('0x1af')]-0x1){return!![];}this[_0xbca8('0xc7')]({'active':![],'countcongestionretry':_0x190f7b[_0xbca8('0xf9')]+=0x1,'scheduledat':moment()[_0xbca8('0x105')](_0x10d194[_0xbca8('0x1b0')],_0xbca8('0x107'))['format'](_0xbca8('0x10d')),'ContactId':_0x190f7b['ContactId'],'ListId':_0x190f7b[_0xbca8('0xda')],'VoiceQueueId':_0x190f7b[_0xbca8('0xdc')]||undefined,'CampaignId':_0x190f7b[_0xbca8('0x108')]||undefined})[_0xbca8('0xba')](loggerCatch(_0xbca8('0x1b1')));break;case 0x0:if(_0x190f7b[_0xbca8('0xfb')]>=_0x10d194[_0xbca8('0x1b2')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x190f7b[_0xbca8('0xfb')]+=0x1,'scheduledat':moment()['add'](_0x10d194[_0xbca8('0x1b3')],_0xbca8('0x107'))[_0xbca8('0x9b')](_0xbca8('0x10d')),'ContactId':_0x190f7b[_0xbca8('0xd9')],'ListId':_0x190f7b['ListId'],'VoiceQueueId':_0x190f7b[_0xbca8('0xdc')]||undefined,'CampaignId':_0x190f7b['CampaignId']||undefined})[_0xbca8('0xba')](loggerCatch(_0xbca8('0x1b4')));}break;case 0xa:if(_0x190f7b['countdropretry']>=_0x10d194[_0xbca8('0x126')]-0x1){return!![];}this[_0xbca8('0xc7')]({'active':![],'countdropretry':_0x190f7b[_0xbca8('0xfc')]+=0x1,'scheduledat':moment()[_0xbca8('0x105')](_0x10d194[_0xbca8('0x127')],_0xbca8('0x107'))[_0xbca8('0x9b')](_0xbca8('0x10d')),'ContactId':_0x190f7b[_0xbca8('0xd9')],'ListId':_0x190f7b['ListId'],'VoiceQueueId':_0x190f7b[_0xbca8('0xdc')]||undefined,'CampaignId':_0x190f7b['CampaignId']||undefined})[_0xbca8('0xba')](loggerCatch(_0xbca8('0x128')));break;case 0xb:if(_0x190f7b[_0xbca8('0xfd')]>=_0x10d194['dialAbandonedMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countabandonedretry':_0x190f7b[_0xbca8('0xfd')]+=0x1,'scheduledat':moment()[_0xbca8('0x105')](_0x10d194[_0xbca8('0x12e')],_0xbca8('0x107'))[_0xbca8('0x9b')](_0xbca8('0x10d')),'ContactId':_0x190f7b[_0xbca8('0xd9')],'ListId':_0x190f7b[_0xbca8('0xda')],'VoiceQueueId':_0x190f7b[_0xbca8('0xdc')]||undefined,'CampaignId':_0x190f7b[_0xbca8('0x108')]||undefined})[_0xbca8('0xba')](loggerCatch(_0xbca8('0x1b5')));break;case 0x13:if(_0x190f7b['countmachineretry']>=_0x10d194[_0xbca8('0x102')]-0x1){return!![];}this[_0xbca8('0xc7')]({'active':![],'countmachineretry':_0x190f7b[_0xbca8('0xf6')]+=0x1,'scheduledat':moment()[_0xbca8('0x105')](_0x10d194[_0xbca8('0x106')],'minutes')[_0xbca8('0x9b')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x190f7b[_0xbca8('0xd9')],'ListId':_0x190f7b[_0xbca8('0xda')],'VoiceQueueId':_0x190f7b[_0xbca8('0xdc')]||undefined,'CampaignId':_0x190f7b[_0xbca8('0x108')]||undefined})[_0xbca8('0xba')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x190f7b['countagentrejectretry']>=_0x10d194['dialAgentRejectMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countagentrejectretry':_0x190f7b[_0xbca8('0xfe')]+=0x1,'scheduledat':moment()[_0xbca8('0x105')](_0x10d194['dialAgentRejectRetryFrequency'],_0xbca8('0x107'))[_0xbca8('0x9b')](_0xbca8('0x10d')),'ContactId':_0x190f7b[_0xbca8('0xd9')],'ListId':_0x190f7b[_0xbca8('0xda')],'VoiceQueueId':_0x190f7b[_0xbca8('0xdc')]||undefined,'CampaignId':_0x190f7b['CampaignId']||undefined})[_0xbca8('0xba')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer['prototype'][_0xbca8('0x1b6')]=function(_0xee62bf,_0xabe59f,_0x502645){var _0x2e13fc=this;var _0xef56be=new History(_0xee62bf);return new BPromise(function(_0x4a2999,_0x575b72){if(_[_0xbca8('0x40')](_0xabe59f)&&typeof _0xabe59f!=='object'){return _0x575b72(msgResponse(_0xbca8('0x1b7'),_0xbca8('0x151'),_0xbca8('0x1b8')));}if(_[_0xbca8('0x40')](_0x502645)&&typeof _0x502645!=='object'){return _0x575b72(msgResponse(_0xbca8('0x1b7'),_0xbca8('0x151'),'evt\x20is\x20undefine'));}switch(_0x502645['reason']){case'0':_0xabe59f[_0xbca8('0x69')]+=0x1;_0xef56be[_0xbca8('0xae')]=0x0;_0xef56be[_0xbca8('0xaf')]=_0xbca8('0x1b9');_0xef56be[_0xbca8('0xfb')]+=0x1;_0xef56be['countglobal']+=0x1;ami['emit']('custom:agentnosuchnumber',ut['buildObj'](_0xee62bf,_0xbca8('0x1ba')));_0x2e13fc[_0xbca8('0xd1')](_0xef56be)['catch'](loggerCatch(_0xbca8('0xf8')));if(_0x2e13fc[_0xbca8('0x1a8')](0x0,_0xee62bf,_0xabe59f)){if(_0xef56be[_0xbca8('0xfb')]>=_0xabe59f[_0xbca8('0x1b2')]){_0x2e13fc[_0xbca8('0x103')](_0xef56be,_0x4a2999,_0x575b72,_0xbca8('0x1bb'));}else{_0x2e13fc['stateGlobal'](_0xef56be,_0x4a2999,_0x575b72,_0xbca8('0x1bb'));}}break;case'3':_0xabe59f['outboundNoAnswerCallsDay']+=0x1;_0xef56be[_0xbca8('0xae')]=0x3;_0xef56be[_0xbca8('0xaf')]='NoAnswer';_0xef56be[_0xbca8('0xfa')]+=0x1;_0xef56be[_0xbca8('0xf7')]+=0x1;ami['emit'](_0xbca8('0x1bc'),ut[_0xbca8('0xf1')](_0xee62bf,_0xbca8('0x1bd')));_0x2e13fc['createHistory'](_0xef56be)[_0xbca8('0xba')](loggerCatch(_0xbca8('0x1be')));if(_0x2e13fc[_0xbca8('0x1a8')](0x3,_0xee62bf,_0xabe59f)){if(_0xef56be[_0xbca8('0xfa')]>=_0xabe59f[_0xbca8('0x1a9')]){_0x2e13fc[_0xbca8('0x103')](_0xef56be,_0x4a2999,_0x575b72,'reason\x203\x20ringing\x20no\x20answer');}else{_0x2e13fc['stateGlobal'](_0xef56be,_0x4a2999,_0x575b72,_0xbca8('0x1bf'));}}break;case'5':_0xabe59f[_0xbca8('0x65')]+=0x1;_0xef56be[_0xbca8('0xae')]=0x5;_0xef56be[_0xbca8('0xaf')]=_0xbca8('0x1c0');_0xef56be[_0xbca8('0x10c')]+=0x1;_0xef56be[_0xbca8('0xf7')]+=0x1;ami[_0xbca8('0x4f')]('custom:agentbusy',ut['buildObj'](_0xee62bf,_0xbca8('0x1c1')));_0x2e13fc[_0xbca8('0xd1')](_0xef56be)[_0xbca8('0xba')](loggerCatch(_0xbca8('0x1c2')));if(_0x2e13fc[_0xbca8('0x1a8')](0x5,_0xee62bf,_0xabe59f)){if(_0xef56be['countbusyretry']>=_0xabe59f[_0xbca8('0x1ac')]){_0x2e13fc['createStateFinal'](_0xef56be,_0x4a2999,_0x575b72,_0xbca8('0x1c3'));}else{_0x2e13fc[_0xbca8('0x100')](_0xef56be,_0x4a2999,_0x575b72,_0xbca8('0x1c3'));}}break;case'8':_0xabe59f[_0xbca8('0x1c4')]+=0x1;_0xef56be[_0xbca8('0xae')]=0x8;_0xef56be[_0xbca8('0xaf')]=_0xbca8('0x1c5');_0xef56be[_0xbca8('0xf9')]+=0x1;_0xef56be['countglobal']+=0x1;ami[_0xbca8('0x4f')](_0xbca8('0x1c6'),ut['buildObj'](_0xee62bf,_0xbca8('0x1c7')));_0x2e13fc[_0xbca8('0xd1')](_0xef56be)[_0xbca8('0xba')](loggerCatch(_0xbca8('0x1c8')));if(_0x2e13fc['checkRetriveMax'](0x8,_0xee62bf,_0xabe59f)){if(_0xef56be[_0xbca8('0xf9')]>=_0xabe59f[_0xbca8('0x1af')]){_0x2e13fc['createStateFinal'](_0xef56be,_0x4a2999,_0x575b72,_0xbca8('0x1c9'));}else{_0x2e13fc[_0xbca8('0x100')](_0xef56be,_0x4a2999,_0x575b72,_0xbca8('0x1c9'));}}break;case'11':_0xabe59f[_0xbca8('0x1ca')]+=0x1;_0xef56be[_0xbca8('0xae')]=0xb;_0xef56be[_0xbca8('0xaf')]='Abandoned';_0xef56be[_0xbca8('0xfd')]+=0x1;_0xef56be[_0xbca8('0xf7')]+=0x1;_0x2e13fc['createHistory'](_0xef56be)['catch'](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x2e13fc[_0xbca8('0x1a8')](0xb,_0xee62bf,_0xabe59f)){if(_0xef56be['countabandonedretry']>=_0xabe59f[_0xbca8('0x12d')]){_0x2e13fc['createStateFinal'](_0xef56be,_0x4a2999,_0x575b72,_0xbca8('0x1cb'));}else{_0x2e13fc[_0xbca8('0x100')](_0xef56be,_0x4a2999,_0x575b72,'reason\x2011\x20abandoned');}}break;case'20':_0xabe59f['outboundRejectCallsDay']+=0x1;_0xef56be['state']=0x14;_0xef56be[_0xbca8('0xaf')]=_0xbca8('0x1cc');_0xef56be[_0xbca8('0xfe')]+=0x1;_0xef56be[_0xbca8('0xf7')]+=0x1;ami[_0xbca8('0x4f')](_0xbca8('0x1cd'),ut[_0xbca8('0xf1')](_0xee62bf,_0xbca8('0x1ce')));_0x2e13fc[_0xbca8('0xd1')](_0xef56be)[_0xbca8('0xba')](loggerCatch(_0xbca8('0x1cf')));if(_0x2e13fc[_0xbca8('0x1a8')](0x14,_0xee62bf,_0xabe59f)){if(_0xef56be['countagentrejectretry']>=_0xabe59f[_0xbca8('0x1d0')]){_0x2e13fc[_0xbca8('0x103')](_0xef56be,_0x4a2999,_0x575b72,_0xbca8('0x1d1'));}else{_0x2e13fc['stateGlobal'](_0xef56be,_0x4a2999,_0x575b72,_0xbca8('0x1d1'));}}break;default:_0xabe59f[_0xbca8('0x6d')]+=0x1;_0xef56be[_0xbca8('0xae')]=0xc;_0xef56be[_0xbca8('0xaf')]=_0x502645[_0xbca8('0x116')];_0x2e13fc[_0xbca8('0xd1')](_0xef56be)[_0xbca8('0xba')](loggerCatch(_0xbca8('0x1d2')));if(_0x2e13fc[_0xbca8('0x1a8')](_0x502645[_0xbca8('0x116')],_0xee62bf,_0xabe59f)){if(_0xef56be[_0xbca8('0x10c')]+_0xef56be[_0xbca8('0xf9')]+_0xef56be[_0xbca8('0xfa')]+_0xef56be[_0xbca8('0xfb')]+_0xef56be[_0xbca8('0xfc')]+_0xef56be[_0xbca8('0xfd')]+_0xef56be[_0xbca8('0xf6')]+_0xef56be[_0xbca8('0xfe')]>=_0xabe59f[_0xbca8('0xff')]){_0x2e13fc[_0xbca8('0x100')](_0xef56be,_0x4a2999,_0x575b72,_0x502645[_0xbca8('0x116')]);}else{_0x2e13fc['createStateFinal'](_0xef56be,_0x4a2999,_0x575b72,_0x502645[_0xbca8('0x116')]);}}}});};Dialer[_0xbca8('0x1a')][_0xbca8('0x100')]=function(_0xc8a12a,_0x347c6b,_0x24dde7,_0x222bc6){var _0x59a864=new Final(_0xc8a12a);_0x59a864['state']=0xf;_0x59a864[_0xbca8('0xaf')]=_0xbca8('0x1d3');this['createStateFinal'](_0x59a864,_0x347c6b,_0x24dde7,_0x222bc6);};Dialer[_0xbca8('0x1a')][_0xbca8('0x103')]=function(_0x377404,_0x1d6a39,_0x3259b6,_0x35ead7){this['moveContactManagedDialer'](_0x377404)[_0xbca8('0x3e')](function(){return _0x1d6a39(msgResponse('[callProgressDetecting]',_0xbca8('0xdf'),_0x35ead7));})[_0xbca8('0xba')](function(){return _0x3259b6(msgResponse(_0xbca8('0x1d4'),_0xbca8('0x151'),_0xbca8('0x1d5')));});};Dialer[_0xbca8('0x1a')][_0xbca8('0x9')]=function(_0x5b8943){var _0x28402e=_0x5b8943[_0xbca8('0x1d6')]/0x64;var _0x19ded2=_0x5b8943[_0xbca8('0x67')]/(_0x5b8943[_0xbca8('0x67')]+_0x5b8943['outboundAnswerCallsDay']);var _0x34c001=Math['round'](_0x5b8943[_0xbca8('0x1d7')]*(_0x5b8943['predictiveIntervalMaxThreshold']/0x64));var _0x2f2c2a=Math[_0xbca8('0x1d8')](_0x5b8943[_0xbca8('0x1d7')]*(_0x5b8943[_0xbca8('0x1d9')]/0x64));var _0x5bf74f=_0x5b8943[_0xbca8('0x1da')]+_0x5b8943[_0xbca8('0x59')];var _0x4fa0a4=Math[_0xbca8('0x1db')](_0x5b8943[_0xbca8('0x78')]*_0x5b8943[_0xbca8('0x7a')]*_0x5b8943[_0xbca8('0x74')]*_0x5b8943['predictiveIntervalMultiplicativeFactor']);if(_[_0xbca8('0x40')](_0x5b8943['startProgressive'])){if(!_['isUndefined'](_0x5b8943[_0xbca8('0x28')])){_0x5b8943['startPredictive']=undefined;loggerPredictive[_0xbca8('0x9d')](_0xbca8('0x1dc'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0xbca8('0x40')](_0x5b8943[_0xbca8('0x97')])){loggerPredictive[_0xbca8('0x9d')](_0xbca8('0x1dc'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x5b8943[_0xbca8('0x97')]);_0x5b8943[_0xbca8('0x97')]=undefined;}_0x5b8943[_0xbca8('0x7b')]=moment()[_0xbca8('0x9b')](_0xbca8('0x10d'));loggerPredictive[_0xbca8('0x81')](_0x5b8943[_0xbca8('0x44')],'collection\x20data\x20in\x20progressive\x20at',_0x5b8943[_0xbca8('0x7b')]);this[_0xbca8('0x161')](_0x5b8943,0x1);}else if(ifInterval(_0x5b8943['dialPredictiveInterval'],_0x5b8943[_0xbca8('0x7b')])){this[_0xbca8('0x161')](_0x5b8943,0x1);loggerPredictiveCalls[_0xbca8('0x81')]('[startMethodPredictive][StartProgressive][Loop]',_0x5b8943['startProgressive'],_0x5b8943[_0xbca8('0x44')]);_0x5b8943[_0xbca8('0x78')]=0x0;_0x5b8943['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x28402e<_0x19ded2&&_0x5b8943['dialPredictiveOptimization']==='dropRate'){freeVariablesPredictive(_0x5b8943);loggerPredictive[_0xbca8('0x81')](_0xbca8('0x1dd'),_0xbca8('0x1de'),_0x19ded2,'startProgressive',_0x5b8943[_0xbca8('0x44')]);}else if(_0x4fa0a4<_0x5b8943[_0xbca8('0x73')]&&_0x5b8943[_0xbca8('0x1df')]===_0xbca8('0x1e0')){freeVariablesPredictive(_0x5b8943);loggerPredictive['info'](_0xbca8('0x1e1'),'Max\x20Drop\x20',_0x4fa0a4,_0xbca8('0x1e2'),_0x5b8943[_0xbca8('0x73')],_0xbca8('0x7b'),_0x5b8943[_0xbca8('0x44')]);}else if(!ifInterval(_0x5b8943['dialPredictiveInterval'],_0x5b8943['startProgressive'])&&_[_0xbca8('0x40')](_0x5b8943[_0xbca8('0x28')])&&!_['isUndefined'](_0x5b8943[_0xbca8('0x7b')])){_0x5b8943['startPredictive']=moment()[_0xbca8('0x9b')](_0xbca8('0x10d'));loggerPredictive[_0xbca8('0x81')](_0x5b8943[_0xbca8('0x44')],_0xbca8('0x1e3'),_0x5b8943[_0xbca8('0x28')]);this[_0xbca8('0x1e4')](_0x5b8943[_0xbca8('0x1e5')])[_0xbca8('0x3e')](this['getDataPredictive'](_0x5b8943))[_0xbca8('0x3e')](mergeDataErlangB(_0x5b8943))[_0xbca8('0x3e')](this[_0xbca8('0x1e6')](_0x5b8943))[_0xbca8('0xba')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x5b8943));}else if(!ifInterval(_0x5b8943['dialPredictiveInterval'],_0x5b8943[_0xbca8('0x28')])){_0x5b8943[_0xbca8('0x73')]=0x0;_0x5b8943[_0xbca8('0x28')]=moment()[_0xbca8('0x9b')](_0xbca8('0x10d'));loggerPredictive[_0xbca8('0x81')](_0x5b8943['name'],_0xbca8('0x1e7'),_0x5b8943[_0xbca8('0x28')]);clearInterval(_0x5b8943[_0xbca8('0x97')]);_0x5b8943[_0xbca8('0x97')]=undefined;this[_0xbca8('0x1e4')](_0x5b8943[_0xbca8('0x1e5')])['then'](this[_0xbca8('0x1e8')](_0x5b8943))[_0xbca8('0x3e')](mergeDataErlangB(_0x5b8943))[_0xbca8('0x3e')](this[_0xbca8('0x1e6')](_0x5b8943))[_0xbca8('0xba')](loggerCatchPredictive(_0xbca8('0x1e9'),_0x5b8943));}else if(_0x5b8943['predictiveIntervalAvailable']&&_0x5bf74f<_0x5b8943[_0xbca8('0x1d7')]-_0x2f2c2a){freeVariablesPredictive(_0x5b8943);loggerPredictive[_0xbca8('0x81')](_0x5b8943[_0xbca8('0x44')],_0xbca8('0x1ea'),_0x5bf74f,_0xbca8('0x1eb'),_0x5b8943[_0xbca8('0x1d7')],'-',_0x2f2c2a,'=',_0x5b8943['predictiveIntervalAvailable']-_0x2f2c2a,')');}else if(_0x5b8943['predictiveIntervalAvailable']&&_0x5bf74f>_0x5b8943[_0xbca8('0x1d7')]+_0x34c001){freeVariablesPredictive(_0x5b8943);loggerPredictive[_0xbca8('0x81')](_0x5b8943['name'],_0xbca8('0x1ea'),_0x5bf74f,')\x20are\x20more\x20than\x20threshold\x20(',_0x5b8943['predictiveIntervalAvailable'],'+',_0x34c001,'=',_0x5b8943['predictiveIntervalAvailable']+_0x34c001,')');}};Dialer['prototype'][_0xbca8('0x1e8')]=function(_0x4eb4dd){var _0x5ab6fd=this;return function(_0x60abda){return new BPromise(function(_0x4965f4,_0x4fb2ec){_[_0xbca8('0x93')](_0x4eb4dd,_0x60abda[0x0]);if(checkGetDataPredictive(_0x60abda[0x0])){var _0x513948=_0x4eb4dd[_0xbca8('0x1d7')]=_0x4eb4dd['talking']+_0x4eb4dd[_0xbca8('0x1da')];var _0xbe3af1=_0x4eb4dd['dialPredictiveInterval']*0x3c;var _0x41b6b3=_0x60abda[0x0][_0xbca8('0x70')]+_0x60abda[0x0]['predictiveIntervalAvgHoldtime'];var _0x554ce9=(_0x60abda[0x0][_0xbca8('0x6e')]+_0x60abda[0x0][_0xbca8('0x71')]+_0x60abda[0x0][_0xbca8('0x87')])/_0x60abda[0x0][_0xbca8('0x84')];_0x4eb4dd[_0xbca8('0x74')]=_0x554ce9>0x0?_0x554ce9:0x1;switch(_0x4eb4dd[_0xbca8('0x1df')]){case _0xbca8('0x1e0'):var _0x4618ab=_0x4eb4dd[_0xbca8('0x1d6')]/0x64;return _0x5ab6fd[_0xbca8('0x1ec')](_0x513948,_0xbe3af1,_0x41b6b3,_0x554ce9,_0x4618ab)[_0xbca8('0x3e')](function(_0x5caf4c){return _0x4965f4(_0x5caf4c);});case _0xbca8('0x1ed'):var _0x4bfdf8=_0x4eb4dd[_0xbca8('0x1d6')]/0x64;return _0x5ab6fd[_0xbca8('0x1ee')](_0x513948,_0xbe3af1,_0x41b6b3,_0x554ce9,_0x4bfdf8)[_0xbca8('0x3e')](function(_0x28e714){return _0x4965f4(_0x28e714);});default:return _0x4fb2ec(msgResponse(_0xbca8('0x1ef'),_0xbca8('0x151'),_0xbca8('0x1f0')));}}else{return _0x4fb2ec(msgResponse('[getDataPredictive]',_0xbca8('0x151'),'check\x20failure'));}});};};Dialer['prototype'][_0xbca8('0x1f1')]=function(_0x336608){var _0xd246c9=this;return function(_0x1e7008){return new BPromise(function(_0x2d32c5,_0x238cc0){_['merge'](_0x336608,_0x1e7008[0x0]);if(checkGetDataPredictive(_0x1e7008[0x0])){loggerPredictive[_0xbca8('0x81')](JSON['stringify'](_0x1e7008[0x0]));if(_0x336608[_0xbca8('0x1df')]==='dropRate'){return _0xd246c9[_0xbca8('0x1f2')](_0x336608['id'])[_0xbca8('0x3e')](function(_0x1e9a9c){var _0x460816=_0x336608[_0xbca8('0x54')]-_0x1e9a9c[0x0]['outboundQueuePauses'];var _0x157c12=_0x336608['dialPredictiveInterval']*0x3c;var _0x2006e8=_0x1e7008[0x0]['predictiveIntervalAvgTalktime']+_0x1e7008[0x0][_0xbca8('0x6f')];var _0x4a363c=(_0x1e7008[0x0]['predictiveIntervalAnsweredCalls']+_0x1e7008[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x1e7008[0x0][_0xbca8('0x87')])/_0x1e7008[0x0][_0xbca8('0x84')];var _0x9fdb6d=_0x336608[_0xbca8('0x1d6')]/0x64;_0x336608[_0xbca8('0x76')]=_0x1e9a9c[0x0]['outboundQueuePauses']||0x0;_0x336608[_0xbca8('0x74')]=_0x4a363c>0x0?_0x4a363c:0x1;return _0xd246c9[_0xbca8('0x1ec')](_0x460816,_0x157c12,_0x2006e8,_0x4a363c,_0x9fdb6d);})[_0xbca8('0x3e')](function(_0x3bdef5){return _0x2d32c5(_0x3bdef5);})[_0xbca8('0xba')](function(_0x64f68c){return _0x238cc0(msgResponse(_0xbca8('0x1f3'),'Failure',JSON['stringify'](_0x64f68c)));});}if(_0x336608[_0xbca8('0x1df')]===_0xbca8('0x1ed')){return _0xd246c9[_0xbca8('0x1f2')](_0x336608['id'])[_0xbca8('0x3e')](function(_0x4d1fe3){var _0x511ebc=_0x336608['loggedIn']-_0x4d1fe3[0x0][_0xbca8('0x1f4')];var _0x27f550=_0x336608[_0xbca8('0x1e5')]*0x3c;var _0x5d2402=_0x1e7008[0x0]['predictiveIntervalAvgTalktime']+_0x1e7008[0x0][_0xbca8('0x6f')];var _0x369436=(_0x1e7008[0x0][_0xbca8('0x6e')]+_0x1e7008[0x0][_0xbca8('0x71')]+_0x1e7008[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x1e7008[0x0]['predictiveIntervalTotalCalls'];var _0x57c1ec=_0x336608['dialPredictiveOptimizationPercentage']/0x64;_0x336608[_0xbca8('0x76')]=_0x4d1fe3[0x0][_0xbca8('0x1f4')]||0x0;_0x336608['predictiveIntervalHitRate']=_0x369436>0x0?_0x369436:0x1;return _0xd246c9[_0xbca8('0x1ee')](_0x511ebc,_0x27f550,_0x5d2402,_0x369436,_0x57c1ec);})['then'](function(_0x2a77f0){return _0x2d32c5(_0x2a77f0);})[_0xbca8('0xba')](function(_0x12e1a8){return _0x238cc0(msgResponse(_0xbca8('0x1f3'),_0xbca8('0x151'),JSON[_0xbca8('0x4c')](_0x12e1a8)));});}}else{return _0x238cc0(msgResponse(_0xbca8('0x1ef'),_0xbca8('0x151'),_0xbca8('0x1f5')));}});};};Dialer[_0xbca8('0x1a')][_0xbca8('0x1e6')]=function(_0x46b6a7){var _0x44286a=this;return function(){var _0x2e85de=0x0;var _0x287563=Math[_0xbca8('0x1db')](_0x46b6a7['erlangCallToSecond']*0x3e8);if(_0x287563>0x0){_0x287563=_0x287563<0x64?0x64:_0x287563;loggerPredictive[_0xbca8('0x81')](_0x46b6a7[_0xbca8('0x44')],'one\x20call\x20every:',_0x287563,_0xbca8('0x4d'));_0x46b6a7[_0xbca8('0x97')]=setInterval(function(){_0x44286a[_0xbca8('0x97')](_0x46b6a7);loggerPredictiveCalls[_0xbca8('0x81')](_0xbca8('0x1f6'),_0x2e85de+=0x1);},_0x287563);}else{loggerPredictive['info'](_0x46b6a7['name'],_0xbca8('0x1f7'));}};};Dialer[_0xbca8('0x1a')][_0xbca8('0x1f8')]=function(_0x402ec4,_0x4fa070){var _0x161b10=this;return function(_0x29afa5){if(_['isEmpty'](_0x29afa5)){if(_['isNil'](_0x4fa070[_0xbca8('0xdb')])||!_0x4fa070[_0xbca8('0x1f9')]){if(_0x402ec4[_0xbca8('0x5d')]===_0xbca8('0x8')){_0x402ec4[_0xbca8('0x138')]=_[_0xbca8('0x40')](_0x402ec4['queueStatusComplete'])?!![]:_0x402ec4['queueStatusComplete'];var _0x3f88ae=uuid['v4']();_0x161b10[_0xbca8('0x25')][_0x3f88ae]=new Action(_0x402ec4,_0x4fa070,_0x3f88ae);loggerBooked[_0xbca8('0x81')](_0xbca8('0x1fa'),_0x3f88ae,_0xbca8('0x1fb'),JSON[_0xbca8('0x4c')](_0x402ec4['queueStatusComplete']),_0xbca8('0x1fc'),_0x402ec4[_0xbca8('0x44')]);if(_0x402ec4[_0xbca8('0x138')]){_0x402ec4['queueStatusComplete']=![];_0x161b10[_0xbca8('0x2a')][_0x161b10[_0xbca8('0x25')][_0x3f88ae][_0xbca8('0xbc')]]=[];ami['Action']({'actionid':_0x3f88ae,'action':_0xbca8('0x1fd'),'queue':_0x402ec4[_0xbca8('0x44')]})['catch'](function(){_0x161b10['updateOriginated'](_0x402ec4);_0x161b10[_0xbca8('0xc7')]({'active':![],'ContactId':_0x161b10['actions'][_0x3f88ae][_0xbca8('0xd9')],'ListId':_0x161b10['actions'][_0x3f88ae][_0xbca8('0xda')],'VoiceQueueId':_0x161b10['actions'][_0x3f88ae]['VoiceQueueId']||undefined,'CampaignId':_0x161b10[_0xbca8('0x25')][_0x3f88ae][_0xbca8('0x108')]||undefined})[_0xbca8('0xba')](loggerCatch(_0xbca8('0x1fe')));delete _0x161b10[_0xbca8('0x25')][_0x3f88ae];});}else{loggerBooked['info']('[booked][checkContactBlack][else]',JSON[_0xbca8('0x4c')](_0x402ec4[_0xbca8('0x138')]),_0xbca8('0x1fc'),_0x402ec4[_0xbca8('0x44')]);_0x161b10[_0xbca8('0xbd')](_0x402ec4);_0x161b10[_0xbca8('0xc7')]({'active':![],'ContactId':_0x161b10[_0xbca8('0x25')][_0x3f88ae][_0xbca8('0xd9')],'ListId':_0x161b10[_0xbca8('0x25')][_0x3f88ae][_0xbca8('0xda')],'VoiceQueueId':_0x161b10[_0xbca8('0x25')][_0x3f88ae][_0xbca8('0xdc')]||undefined,'CampaignId':_0x161b10[_0xbca8('0x25')][_0x3f88ae][_0xbca8('0x108')]||undefined})['catch'](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x161b10[_0xbca8('0x25')][_0x3f88ae];}}else{return _0x161b10[_0xbca8('0x176')](_0x402ec4,_0x4fa070);}}else{if(getDiff(_0x4fa070[_0xbca8('0x1ff')])<_0x402ec4[_0xbca8('0x200')]*0x3c){if(_0x4fa070['Agent']&&!_0x4fa070[_0xbca8('0x166')][_0xbca8('0x201')]){_0x161b10[_0xbca8('0x1f')][_0xbca8('0x13a')](_0x4fa070['id'])[_0xbca8('0x1d')](function(){_0x161b10['updateOriginated'](_0x402ec4);});}else{_0x161b10['unlockContact']({'active':![]},_0x4fa070['id'],0x1)[_0xbca8('0x1d')](function(){_0x161b10[_0xbca8('0xbd')](_0x402ec4);});}}else{_0x402ec4[_0xbca8('0x6b')]+=0x1;_0x161b10[_0xbca8('0xbd')](_0x402ec4);if(_0x402ec4[_0xbca8('0x202')]){_0x161b10['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x4fa070['ContactId'],'ListId':_0x4fa070[_0xbca8('0xda')],'VoiceQueueId':_0x4fa070[_0xbca8('0xdc')]||undefined,'CampaignId':_0x4fa070[_0xbca8('0x108')]||undefined})[_0xbca8('0xba')](loggerCatch(_0xbca8('0x203')));_0x161b10[_0xbca8('0xd1')](createObjHistory(_0x402ec4,_0x4fa070,_0xbca8('0x204'),0x17,_0xbca8('0x205')))[_0xbca8('0xba')](loggerCatch(_0xbca8('0x206')));}else{_0x161b10[_0xbca8('0xd7')](createObjHistory(_0x402ec4,_0x4fa070,'RECALLFAILEDTIMEOUT',0x16,_0xbca8('0x207')),_0xbca8('0x208'),_0xbca8('0x209'));}}}}else{_0x402ec4[_0xbca8('0x64')]+=0x1;_0x161b10[_0xbca8('0xd7')](createObjHistory(_0x402ec4,_0x4fa070,'BLACKLIST',0xd,_0xbca8('0x20a')),_0xbca8('0x20b'),_0xbca8('0x20c'));throw _0xbca8('0x20d');}};};Dialer[_0xbca8('0x1a')][_0xbca8('0x16a')]=function(_0x31f584){var _0x494435=this;var _0x34780a=_0x31f584[_0xbca8('0x20e')]-_0x31f584[_0xbca8('0x77')]-_0x31f584[_0xbca8('0xcc')];emitCampaignSummary(_0x31f584);if(_0x34780a>0x0){if(_0x34780a>this['maxNumberOriginate']){_0x34780a=this[_0xbca8('0x23')];}_0x31f584[_0xbca8('0xcc')]+=_0x34780a;this[_0xbca8('0xce')](_0x31f584['id'],_0x34780a,_0x31f584['dialOrderByScheduledAt'],_0x31f584)[_0xbca8('0x3e')](function(_0x511169){_0x31f584[_0xbca8('0xcc')]-=_0x34780a;_0x31f584[_0xbca8('0xcc')]=_0x31f584[_0xbca8('0xcc')]>0x0?_0x31f584[_0xbca8('0xcc')]:0x0;if(!checkContactEmpty(_0x511169)){_0x31f584[_0xbca8('0x41')]=_0xbca8('0x20f');logger['info'](_0xbca8('0x210')+_0x31f584[_0xbca8('0x44')]);}else{_0x31f584[_0xbca8('0x77')]+=_0x511169['length'];_0x31f584['message']=_0xbca8('0x211');for(var _0x56dc20=0x0;_0x56dc20<_0x511169['length'];_0x56dc20+=0x1){_0x31f584[_0xbca8('0x212')]+=0x1;if(_['isNil'](_0x511169[_0x56dc20])||_[_0xbca8('0xb6')](_0x511169[_0x56dc20][_0xbca8('0x179')])||_[_0xbca8('0xb6')](_0x511169[_0x56dc20]['Contact'][_0xbca8('0x17a')])){_0x494435[_0xbca8('0xd5')](_0xbca8('0x213'),_0x31f584,_0x511169[_0x56dc20]);}else{_0x494435[_0xbca8('0xc4')](_[_0xbca8('0xd8')](_0x511169[_0x56dc20],[_0xbca8('0x108'),_0xbca8('0x214')]))[_0xbca8('0x3e')](_0x494435[_0xbca8('0x1f8')](_0x31f584,_0x511169[_0x56dc20]))[_0xbca8('0xba')](_0x494435[_0xbca8('0x215')](_0xbca8('0x216'),_0x31f584));}}}})[_0xbca8('0xba')](loggerGetContactDialer('[getContactCampaign2]',_0x31f584,_0x34780a));}};Dialer[_0xbca8('0x1a')][_0xbca8('0x161')]=function(_0x595ae1,_0x543aeb){var _0x591c3f=this;var _0x2f5b1d=[];var _0x514f93=_0x543aeb>=0x1?_0x543aeb:0x1;if(_0x595ae1[_0xbca8('0x5d')]===_0xbca8('0x8')){_0x514f93=0x1;}var _0x59368f=Math[_0xbca8('0x1db')](_0x595ae1['available']*_0x514f93)-_0x595ae1[_0xbca8('0x77')]-_0x595ae1[_0xbca8('0xcc')];emitVoiceQueueSummary(_0x595ae1);if(_0x595ae1['dialLimitQueue']>0x0){var _0x340cd8=_0x595ae1['dialLimitQueue']-_0x595ae1[_0xbca8('0x77')]-_0x595ae1[_0xbca8('0x59')]-_0x595ae1[_0xbca8('0xcc')]-_0x595ae1[_0xbca8('0x55')];if(_0x59368f>_0x340cd8){_0x59368f=_0x340cd8;}}if(_0x59368f>0x0){if(_0x595ae1[_0xbca8('0x5d')]===_0xbca8('0x8')){_0x59368f=0x1;}if(_0x59368f>this[_0xbca8('0x23')]){_0x59368f=this['maxNumberOriginate'];}_0x595ae1[_0xbca8('0xcc')]+=_0x59368f;for(var _0xba1499 in this[_0xbca8('0x134')]){if(typeof this['agents'][_0xba1499]!==_0xbca8('0xb5')){if(this['agents'][_0xba1499][_0xbca8('0xae')]===_0xbca8('0x217')&&this[_0xbca8('0x134')][_0xba1499][_0xbca8('0xb8')]===_0xbca8('0xe3')){_0x2f5b1d[_0xbca8('0x137')](this[_0xbca8('0x134')][_0xba1499]['id']);}}}this[_0xbca8('0xcb')](_0x595ae1['id'],_0x2f5b1d,_0x59368f,_0x595ae1[_0xbca8('0x218')],_0x595ae1)['then'](function(_0xa68913){_0x595ae1[_0xbca8('0xcc')]-=_0x59368f;_0x595ae1[_0xbca8('0xcc')]=_0x595ae1[_0xbca8('0xcc')]>0x0?_0x595ae1[_0xbca8('0xcc')]:0x0;if(!checkContactEmpty(_0xa68913)){_0x591c3f[_0xbca8('0xbf')](_0x595ae1)[_0xbca8('0x3e')](sendMessageReschedule(_0x595ae1))[_0xbca8('0xba')](loggerCatch(_0xbca8('0xc1')));}else{_0x595ae1[_0xbca8('0x77')]+=_0xa68913[_0xbca8('0x9f')];_0x595ae1['message']=_0x595ae1['dialMethod']===_0xbca8('0x8')?'ACTIVE':_0xbca8('0x211');for(var _0x153716=0x0;_0x153716<_0xa68913['length'];_0x153716+=0x1){if(_[_0xbca8('0xb6')](_0xa68913[_0x153716])||_['isNil'](_0xa68913[_0x153716]['Contact'])||_[_0xbca8('0xb6')](_0xa68913[_0x153716][_0xbca8('0x179')][_0xbca8('0x17a')])){_0x591c3f['emptyContact']('[actionOriginate]\x20',_0x595ae1,_0xa68913[_0x153716]);}else{_0x591c3f['checkIsBlackList'](_['pick'](_0xa68913[_0x153716],['VoiceQueueId',_0xbca8('0x214')]))[_0xbca8('0x3e')](_0x591c3f[_0xbca8('0x1f8')](_0x595ae1,_0xa68913[_0x153716]))['catch'](_0x591c3f['loggerHandler'](_0xbca8('0x213'),_0x595ae1));}}}})[_0xbca8('0xba')](loggerGetContactDialer(_0xbca8('0x219'),_0x595ae1,_0x59368f));}};Dialer[_0xbca8('0x1a')][_0xbca8('0x97')]=function(_0x4cb639){if(_0x4cb639[_0xbca8('0x21a')]>0x0){var _0x3d2a29=_0x4cb639[_0xbca8('0x21a')]-_0x4cb639[_0xbca8('0x77')]-_0x4cb639[_0xbca8('0x59')];if(_0x3d2a29>0x0){this[_0xbca8('0x21b')](_0x4cb639);}else{loggerPredictiveCalls[_0xbca8('0x81')](_0xbca8('0x21c'));}}else{this[_0xbca8('0x21b')](_0x4cb639);}};Dialer[_0xbca8('0x1a')][_0xbca8('0x21b')]=function(_0x5b66a8){var _0x5ecfcc=this;var _0x1d06c8=[];_0x5b66a8[_0xbca8('0x77')]+=0x1;for(var _0x5aa9f9 in this[_0xbca8('0x134')]){if(typeof this['agents'][_0x5aa9f9]!=='undefined'){if(this[_0xbca8('0x134')][_0x5aa9f9][_0xbca8('0xae')]===_0xbca8('0x217')&&this[_0xbca8('0x134')][_0x5aa9f9][_0xbca8('0xb8')]===_0xbca8('0xe3')){_0x1d06c8['push'](this[_0xbca8('0x134')][_0x5aa9f9]['id']);}}}this['getContactDialer'](_0x5b66a8['id'],_0x1d06c8,0x1,_0x5b66a8['dialOrderByScheduledAt'],_0x5b66a8)[_0xbca8('0x3e')](function(_0x2bcdff){if(!checkContactEmpty(_0x2bcdff)){checkContactLowerLimitOriginate(_0x5b66a8,0x1,0x0);_0x5ecfcc['countReScheduled'](_0x5b66a8)[_0xbca8('0x3e')](sendMessageReschedule(_0x5b66a8))[_0xbca8('0xba')](loggerCatch(_0xbca8('0xc1')));}else{_0x5b66a8[_0xbca8('0x41')]=_0xbca8('0x211');if(_['isNil'](_0x2bcdff[0x0])||_['isNil'](_0x2bcdff[0x0]['Contact'])||_[_0xbca8('0xb6')](_0x2bcdff[0x0][_0xbca8('0x179')][_0xbca8('0x17a')])){_0x5ecfcc['emptyContact'](_0xbca8('0x213'),_0x5b66a8,_0x2bcdff[0x0]);}else{_0x5ecfcc[_0xbca8('0xc2')](_[_0xbca8('0xd8')](_0x2bcdff[0x0],['VoiceQueueId',_0xbca8('0x214')]))[_0xbca8('0x3e')](_0x5ecfcc[_0xbca8('0x1f8')](_0x5b66a8,_0x2bcdff[0x0]))[_0xbca8('0xba')](_0x5ecfcc[_0xbca8('0x215')]('[actionOriginatePredictive]\x20',_0x5b66a8));}}})[_0xbca8('0xba')](loggerGetContactDialer(_0xbca8('0x21d'),_0x5b66a8,0x1));emitVoiceQueueSummary(_0x5b66a8);};Dialer['prototype'][_0xbca8('0x1ec')]=function(_0x28f5c4,_0x4b34aa,_0x3c7ea6,_0x56c3b3,_0x2e4be2,_0x2e42d0){loggerPredictive[_0xbca8('0x81')](_0xbca8('0x21e'));loggerPredictive[_0xbca8('0x81')](_0xbca8('0x21f'),_0x28f5c4);loggerPredictive['info'](_0xbca8('0x220'),_0x4b34aa);loggerPredictive[_0xbca8('0x81')](_0xbca8('0x221'),_0x3c7ea6);loggerPredictive[_0xbca8('0x81')](_0xbca8('0x222'),_0x56c3b3);loggerPredictive['info']('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2e4be2);loggerPredictive['info'](_0xbca8('0x92'));return new BPromise(function(_0x1be101,_0x343d83){if(_0x28f5c4<=0x0||isNaN(_0x28f5c4)){return _0x343d83(msgResponse('[abandonmentRate]',_0xbca8('0x1a1'),_0xbca8('0x223')+_0x28f5c4));}if(_0x3c7ea6<=0x0||isNaN(_0x3c7ea6)){return _0x343d83(msgResponse(_0xbca8('0x224'),_0xbca8('0x1a1'),_0xbca8('0x225')+_0x3c7ea6));}if(_0x56c3b3<=0x0||isNaN(_0x56c3b3)){return _0x343d83(msgResponse('[abandonmentRate]','Error','p\x20=\x20'+_0x56c3b3));}if(_0x4b34aa<=0x0||isNaN(_0x4b34aa)){return _0x343d83(msgResponse(_0xbca8('0x224'),_0xbca8('0x1a1'),_0xbca8('0x226')+_0x4b34aa));}if(_0x2e4be2<=0x0||isNaN(_0x2e4be2)){return _0x343d83(msgResponse(_0xbca8('0x224'),_0xbca8('0x1a1'),_0xbca8('0x227')+_0x2e4be2));}_0x2e42d0=_0x2e42d0||0x0;var _0x40c48f=0x1/_0x3c7ea6;var _0x53da1b=0x0;var _0x2de7b3=0x0;var _0x4ed413=0x0;var _0x565a7b=0x0;for(var _0xb99b84=0x0;_0x4ed413<_0x2e4be2;_0xb99b84+=0x1){_0x2de7b3=_0xb99b84/_0x4b34aa;_0x53da1b=(_0x56c3b3*_0x2de7b3+_0x2e42d0)/_0x40c48f;_0x4ed413=erlangb(_0x53da1b,_0x28f5c4);_0x565a7b=_0x53da1b/_0x28f5c4*(0x1-erlangb(_0x53da1b,_0x28f5c4));}return _0x1be101({'erlangCalls':_0xb99b84,'erlangCallToSecond':_0x4b34aa/_0xb99b84,'erlangAbandonmentRate':_0x4ed413,'erlangBusyFactor':_0x565a7b});});};Dialer[_0xbca8('0x1a')]['busyFactor']=function(_0x11bd26,_0x34a1ad,_0x1ae61a,_0xd0f050,_0x5aeec6,_0xd7ff10){loggerPredictive[_0xbca8('0x81')](_0xbca8('0x228'));loggerPredictive['info'](_0xbca8('0x21f'),_0x11bd26);loggerPredictive[_0xbca8('0x81')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x34a1ad);loggerPredictive[_0xbca8('0x81')](_0xbca8('0x221'),_0x1ae61a);loggerPredictive[_0xbca8('0x81')]('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',_0xd0f050);loggerPredictive[_0xbca8('0x81')](_0xbca8('0x229'),_0x5aeec6);loggerPredictive[_0xbca8('0x81')](_0xbca8('0x92'));return new BPromise(function(_0x4850cf,_0x807f76){if(_0x11bd26<=0x0||isNaN(_0x11bd26)){return _0x807f76(msgResponse(_0xbca8('0x22a'),_0xbca8('0x1a1'),_0xbca8('0x223')+_0x11bd26));}if(_0x1ae61a<=0x0||isNaN(_0x1ae61a)){return _0x807f76(msgResponse('[busyFactor]','Error',_0xbca8('0x225')+_0x1ae61a));}if(_0xd0f050<=0x0||isNaN(_0xd0f050)){return _0x807f76(msgResponse(_0xbca8('0x22a'),_0xbca8('0x1a1'),_0xbca8('0x22b')+_0xd0f050));}if(_0x34a1ad<=0x0||isNaN(_0x34a1ad)){return _0x807f76(msgResponse(_0xbca8('0x22a'),_0xbca8('0x1a1'),'interval\x20=\x20'+_0x34a1ad));}if(_0x5aeec6<=0x0||isNaN(_0x5aeec6)){return _0x807f76(msgResponse(_0xbca8('0x22a'),_0xbca8('0x1a1'),'Umin\x20=\x20'+_0x5aeec6));}_0xd7ff10=_0xd7ff10||0x0;var _0x40ba35=0x1/_0x1ae61a;var _0x48d6f1=0x0;var _0x4a7aa0=0x0;var _0x4e0345=0x0;var _0x5e02e7=0x0;for(var _0x5b86ee=0x0;_0x5e02e7<_0x5aeec6;_0x5b86ee+=0x1){_0x4a7aa0=_0x5b86ee/_0x34a1ad;_0x48d6f1=(_0xd0f050*_0x4a7aa0+_0xd7ff10)/_0x40ba35;_0x4e0345=erlangb(_0x48d6f1,_0x11bd26);_0x5e02e7=_0x48d6f1/_0x11bd26*(0x1-erlangb(_0x48d6f1,_0x11bd26));}return _0x4850cf({'erlangCalls':_0x5b86ee,'erlangCallToSecond':_0x34a1ad/_0x5b86ee,'erlangAbandonmentRate':_0x4e0345,'erlangBusyFactor':_0x5e02e7});});};module['exports']=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index f5b321e..c3a5804 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 _0x8c40=['countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','calleridname','name','number','starttime','responsetime','droptime','endtime','ringtime','holdtime','queue','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal'];(function(_0x1758bb,_0x12cd7b){var _0x4c0054=function(_0x2f0c0f){while(--_0x2f0c0f){_0x1758bb['push'](_0x1758bb['shift']());}};_0x4c0054(++_0x12cd7b);}(_0x8c40,0x1a2));var _0x08c4=function(_0x4cf912,_0x576b18){_0x4cf912=_0x4cf912-0x0;var _0x19fdeb=_0x8c40[_0x4cf912];return _0x19fdeb;};'use strict';var util=require(_0x08c4('0x0'));var _=require(_0x08c4('0x1'));var moment=require('moment');function getSeconds(_0x309092,_0x574ad7){var _0x3a2ac9=moment(_0x309092)[_0x08c4('0x2')](0x0);var _0x37d9fe=moment(_0x574ad7)[_0x08c4('0x2')](0x0);return _0x3a2ac9[_0x08c4('0x3')](_0x37d9fe,'seconds');}function QueueCallerAbandon(_0x3e56d4,_0x27f1f3){this[_0x08c4('0x4')]=_0x3e56d4[_0x08c4('0x4')];this[_0x08c4('0x5')]=_0x3e56d4['type'];this[_0x08c4('0x6')]=_0x3e56d4['type']===_0x08c4('0x7')?'queue':_0x3e56d4[_0x08c4('0x5')];this['countbusyretry']=_0x3e56d4[_0x08c4('0x8')];this[_0x08c4('0x9')]=_0x3e56d4[_0x08c4('0x9')];this[_0x08c4('0xa')]=_0x3e56d4[_0x08c4('0xa')];this[_0x08c4('0xb')]=_0x3e56d4[_0x08c4('0x8')]+_0x3e56d4[_0x08c4('0x9')]+_0x3e56d4['countnoanswerretry']+_0x3e56d4['countnosuchnumberretry']+_0x3e56d4[_0x08c4('0xc')]+_0x3e56d4[_0x08c4('0xd')]+_0x3e56d4[_0x08c4('0xe')]+_0x3e56d4[_0x08c4('0xf')];this[_0x08c4('0x10')]=_0x3e56d4[_0x08c4('0x10')];this[_0x08c4('0xc')]=_0x3e56d4[_0x08c4('0xc')];this[_0x08c4('0xd')]=_0x3e56d4[_0x08c4('0xd')];this[_0x08c4('0xe')]=_0x3e56d4[_0x08c4('0xe')];this[_0x08c4('0xf')]=_0x3e56d4[_0x08c4('0xf')];this['uniqueid']=_0x27f1f3[_0x08c4('0x11')];this[_0x08c4('0x12')]=_0x3e56d4[_0x08c4('0x13')];this['calleridnum']=_0x3e56d4[_0x08c4('0x14')];this[_0x08c4('0x15')]=_0x3e56d4[_0x08c4('0x15')];this[_0x08c4('0x16')]=_0x3e56d4[_0x08c4('0x16')];this[_0x08c4('0x17')]=_0x3e56d4[_0x08c4('0x17')];this[_0x08c4('0x18')]=this['droptime'];this[_0x08c4('0x19')]=getSeconds(_0x3e56d4[_0x08c4('0x16')],_0x3e56d4[_0x08c4('0x15')]);this[_0x08c4('0x1a')]=getSeconds(this[_0x08c4('0x17')],_0x3e56d4[_0x08c4('0x16')]);this['talktime']=0x0;this[_0x08c4('0x1b')]=_0x27f1f3[_0x08c4('0x1b')];this[_0x08c4('0x1c')]=_0x27f1f3[_0x08c4('0x1d')];this[_0x08c4('0x1e')]=_0x27f1f3[_0x08c4('0x1e')];this['callback']=_0x3e56d4[_0x08c4('0x1f')];this[_0x08c4('0x20')]=_0x3e56d4[_0x08c4('0x20')];this[_0x08c4('0x21')]=_0x3e56d4[_0x08c4('0x21')];this[_0x08c4('0x22')]=_0x3e56d4[_0x08c4('0x22')];this[_0x08c4('0x23')]=_0x3e56d4[_0x08c4('0x23')];this['ListId']=_0x3e56d4[_0x08c4('0x24')];this[_0x08c4('0x25')]=_0x3e56d4[_0x08c4('0x25')];this[_0x08c4('0x26')]=_0x3e56d4[_0x08c4('0x26')];this[_0x08c4('0x27')]=_0x3e56d4[_0x08c4('0x27')];this['originatecalleridnum']=_0x3e56d4[_0x08c4('0x28')]||'';this[_0x08c4('0x29')]=_0x3e56d4[_0x08c4('0x29')]||'';}module[_0x08c4('0x2a')]=QueueCallerAbandon; \ No newline at end of file +var _0x60ed=['ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','endtime','talktime','reason','callbackuniqueid','callbackat','recallme'];(function(_0x174113,_0x316cc3){var _0x243cb7=function(_0x43e77a){while(--_0x43e77a){_0x174113['push'](_0x174113['shift']());}};_0x243cb7(++_0x316cc3);}(_0x60ed,0x73));var _0xd60e=function(_0x356e18,_0x4b0f90){_0x356e18=_0x356e18-0x0;var _0x5a420b=_0x60ed[_0x356e18];return _0x5a420b;};'use strict';var util=require(_0xd60e('0x0'));var _=require(_0xd60e('0x1'));var moment=require(_0xd60e('0x2'));function getSeconds(_0x2f38f6,_0x417f7a){var _0x2f65f3=moment(_0x2f38f6)['milliseconds'](0x0);var _0x2c2245=moment(_0x417f7a)['milliseconds'](0x0);return _0x2f65f3['diff'](_0x2c2245,'seconds');}function QueueCallerAbandon(_0x5a8941,_0x2da919){this[_0xd60e('0x3')]=_0x5a8941[_0xd60e('0x3')];this['type']=_0x5a8941[_0xd60e('0x4')];this[_0xd60e('0x5')]=_0x5a8941[_0xd60e('0x4')]==='outbound'?_0xd60e('0x6'):_0x5a8941[_0xd60e('0x4')];this[_0xd60e('0x7')]=_0x5a8941[_0xd60e('0x7')];this[_0xd60e('0x8')]=_0x5a8941[_0xd60e('0x8')];this[_0xd60e('0x9')]=_0x5a8941[_0xd60e('0x9')];this['countglobal']=_0x5a8941[_0xd60e('0x7')]+_0x5a8941[_0xd60e('0x8')]+_0x5a8941[_0xd60e('0x9')]+_0x5a8941[_0xd60e('0xa')]+_0x5a8941[_0xd60e('0xb')]+_0x5a8941[_0xd60e('0xc')]+_0x5a8941[_0xd60e('0xd')]+_0x5a8941['countagentrejectretry'];this[_0xd60e('0xa')]=_0x5a8941['countnosuchnumberretry'];this[_0xd60e('0xb')]=_0x5a8941[_0xd60e('0xb')];this[_0xd60e('0xc')]=_0x5a8941[_0xd60e('0xc')];this[_0xd60e('0xd')]=_0x5a8941[_0xd60e('0xd')];this[_0xd60e('0xe')]=_0x5a8941[_0xd60e('0xe')];this['uniqueid']=_0x2da919[_0xd60e('0xf')];this[_0xd60e('0x10')]=_0x5a8941[_0xd60e('0x11')];this[_0xd60e('0x12')]=_0x5a8941[_0xd60e('0x13')];this[_0xd60e('0x14')]=_0x5a8941['starttime'];this['responsetime']=_0x5a8941[_0xd60e('0x15')];this[_0xd60e('0x16')]=_0x5a8941[_0xd60e('0x16')];this[_0xd60e('0x17')]=this[_0xd60e('0x16')];this['ringtime']=getSeconds(_0x5a8941[_0xd60e('0x15')],_0x5a8941[_0xd60e('0x14')]);this['holdtime']=getSeconds(this[_0xd60e('0x16')],_0x5a8941[_0xd60e('0x15')]);this[_0xd60e('0x18')]=0x0;this[_0xd60e('0x6')]=_0x2da919['queue'];this['membername']=_0x2da919['connectedlinename'];this[_0xd60e('0x19')]=_0x2da919[_0xd60e('0x19')];this['callback']=_0x5a8941['callback'];this[_0xd60e('0x1a')]=_0x5a8941[_0xd60e('0x1a')];this[_0xd60e('0x1b')]=_0x5a8941[_0xd60e('0x1b')];this[_0xd60e('0x1c')]=_0x5a8941[_0xd60e('0x1c')];this[_0xd60e('0x1d')]=_0x5a8941[_0xd60e('0x1d')];this[_0xd60e('0x1e')]=_0x5a8941['ListId'];this[_0xd60e('0x1f')]=_0x5a8941[_0xd60e('0x1f')];this[_0xd60e('0x20')]=_0x5a8941[_0xd60e('0x20')];this[_0xd60e('0x21')]=_0x5a8941['CampaignId'];this[_0xd60e('0x22')]=_0x5a8941['originatecalleridnum']||'';this[_0xd60e('0x23')]=_0x5a8941['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 baa283c..d5d97ad 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(_0x5b95f2,_0x2adb49){var _0x376b33=function(_0x57c21b){while(--_0x57c21b){_0x5b95f2['push'](_0x5b95f2['shift']());}};_0x376b33(++_0x2adb49);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'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(_0x488dbd,_0x357ede){var _0x3144c2=function(_0x3be86d){while(--_0x3be86d){_0x488dbd['push'](_0x488dbd['shift']());}};_0x3144c2(++_0x357ede);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action; \ No newline at end of file diff --git a/server/services/ami/fax/index.js b/server/services/ami/fax/index.js index d808518..fd12523 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 _0x8603=['filename','calleridnum','message','create','parse','.pdf','application/pdf','then','notify','fax','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','pick','reason','AttachmentId','SENDING\x20FAILED\x20','[Fax][Message][Error][Updated]','logger','[Fax][Message][Error][NoUpdate2]','updateStatus','update','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','execOriginate','[Fax][execOriginate][success]','Fax\x20received','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','format','path','Action','variablesAction','addVariables','ext','isTrunkReachable','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','isNil','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','lodash','bluebird','uuid','tiff2pdf','./util/gs','../../../config/logger','../ami','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','faxAccounts','trunks','actions','syncNewchannel','bind','syncVarSet','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','exten','channels','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','operation','status','localstationid','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate'];(function(_0xefd70,_0x443899){var _0x4d9a13=function(_0xd0ff0e){while(--_0xd0ff0e){_0xefd70['push'](_0xefd70['shift']());}};_0x4d9a13(++_0x443899);}(_0x8603,0x190));var _0x3860=function(_0x277fbc,_0x133abf){_0x277fbc=_0x277fbc-0x0;var _0x9e7117=_0x8603[_0x277fbc];return _0x9e7117;};'use strict';var util=require('util');var _=require(_0x3860('0x0'));var BPromise=require(_0x3860('0x1'));var uuid=require(_0x3860('0x2'));var moment=require('moment');var path=require('path');var tiff2pdf=require(_0x3860('0x3'));var gs=require(_0x3860('0x4'));var logger=require(_0x3860('0x5'))('fax');var ami=require(_0x3860('0x6'));var rpcDb=require('./rpcDb');var Channel=require(_0x3860('0x7'));var ut=require(_0x3860('0x8'));var Action=require(_0x3860('0x9'));var faxAccount=require(_0x3860('0xa'));var attachment=require(_0x3860('0xb'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x5c7350){this['channels']={};this[_0x3860('0xc')]=_0x5c7350[_0x3860('0xc')];this['trunks']=_0x5c7350[_0x3860('0xd')];this[_0x3860('0xe')]={};ami['on']('newchannel',this[_0x3860('0xf')][_0x3860('0x10')](this));ami['on']('varset',this[_0x3860('0x11')][_0x3860('0x10')](this));ami['on']('newstate',this[_0x3860('0x12')][_0x3860('0x10')](this));ami['on'](_0x3860('0x13'),this[_0x3860('0x14')][_0x3860('0x10')](this));ami['on'](_0x3860('0x15'),this[_0x3860('0x16')][_0x3860('0x10')](this));ami['on'](_0x3860('0x17'),this[_0x3860('0x18')]['bind'](this));ami['on'](_0x3860('0x19'),this[_0x3860('0x1a')][_0x3860('0x10')](this));ami['on'](_0x3860('0x1b'),this[_0x3860('0x1c')][_0x3860('0x10')](this));}Fax[_0x3860('0x1d')][_0x3860('0xf')]=function(_0x311fdb){if(_0x311fdb[_0x3860('0x1e')]===_0x3860('0x1f')){for(var _0x45b799 in this['faxAccounts']){if(this['faxAccounts'][_0x3860('0x20')](_0x45b799)){if(_0x311fdb[_0x3860('0x21')]===this[_0x3860('0xc')][_0x45b799]['localstationid']){this[_0x3860('0x22')][_0x311fdb[_0x3860('0x23')]]={};this[_0x3860('0x22')][_0x311fdb[_0x3860('0x23')]][_0x3860('0x24')]=_0x311fdb[_0x3860('0x24')];this[_0x3860('0x22')][_0x311fdb[_0x3860('0x23')]]['id']=this[_0x3860('0xc')][_0x45b799]['id'];this[_0x3860('0x22')][_0x311fdb[_0x3860('0x23')]][_0x3860('0x25')]=this[_0x3860('0xc')][_0x45b799][_0x3860('0x25')];logger[_0x3860('0x26')](_0x311fdb['uniqueid'],_0x3860('0x27'));}}}}if(this[_0x3860('0xe')][_0x311fdb[_0x3860('0x23')]]){this[_0x3860('0x22')][_0x311fdb[_0x3860('0x23')]]={};this['channels'][_0x311fdb[_0x3860('0x23')]]['channel']=_0x311fdb['channel'];logger[_0x3860('0x26')](_0x311fdb[_0x3860('0x23')],'\x20syncNewchannel\x20');}};Fax['prototype']['syncVarSet']=function(_0x1b2e4d){if(this[_0x3860('0x22')][_0x1b2e4d[_0x3860('0x23')]]){for(var _0x371f3a in _0x1b2e4d[_0x3860('0x28')]){if(_0x1b2e4d[_0x3860('0x28')]['hasOwnProperty'](_0x371f3a)){this['channels'][_0x1b2e4d[_0x3860('0x23')]][_0x371f3a]=_0x1b2e4d[_0x3860('0x29')];}}}};Fax['prototype'][_0x3860('0x12')]=function(_0x3d5143){if(this[_0x3860('0x22')][_0x3d5143[_0x3860('0x23')]]){this[_0x3860('0x22')][_0x3d5143['uniqueid']][_0x3860('0x2a')]=_0x3d5143[_0x3860('0x2a')];this[_0x3860('0x22')][_0x3d5143['uniqueid']][_0x3860('0x2b')]=_0x3d5143['channelstatedesc'];}};Fax[_0x3860('0x1d')]['syncNewExten']=function(_0x1c498c){if(this[_0x3860('0x22')][_0x1c498c[_0x3860('0x23')]]){for(var _0x47e350 in _0x1c498c[_0x3860('0x28')]){if(_0x1c498c[_0x3860('0x28')]['hasOwnProperty'](_0x47e350)){this[_0x3860('0x22')][_0x1c498c['uniqueid']][_0x47e350]=_0x1c498c[_0x3860('0x29')];}}}};Fax[_0x3860('0x1d')][_0x3860('0x16')]=function(_0x2fc231){if(this[_0x3860('0x22')][_0x2fc231[_0x3860('0x23')]]){this[_0x3860('0x22')][_0x2fc231['uniqueid']][_0x3860('0x2c')]=_0x2fc231[_0x3860('0x2c')];this['channels'][_0x2fc231[_0x3860('0x23')]][_0x3860('0x2d')]=_0x2fc231[_0x3860('0x2d')];this['channels'][_0x2fc231['uniqueid']][_0x3860('0x2e')]=_0x2fc231[_0x3860('0x2e')];this[_0x3860('0x22')][_0x2fc231[_0x3860('0x23')]]['filename']=_0x2fc231['filename'];logger[_0x3860('0x26')](_0x2fc231[_0x3860('0x23')],_0x3860('0x2f'));}};Fax[_0x3860('0x1d')][_0x3860('0x18')]=function(_0x4df2a9){var _0x424424=this;if(this[_0x3860('0x22')][_0x4df2a9['uniqueid']]){var _0x59c662=this[_0x3860('0x22')][_0x4df2a9[_0x3860('0x23')]]['id'];this[_0x3860('0x22')][_0x4df2a9[_0x3860('0x23')]][_0x3860('0x30')]=_0x4df2a9['remotestationid'];this[_0x3860('0x22')][_0x4df2a9['uniqueid']][_0x3860('0x31')]=_0x4df2a9[_0x3860('0x31')];this['channels'][_0x4df2a9[_0x3860('0x23')]][_0x3860('0x2e')]=_0x4df2a9['localstationid'];this[_0x3860('0x22')][_0x4df2a9[_0x3860('0x23')]][_0x3860('0x32')]=_0x4df2a9[_0x3860('0x32')];this['channels'][_0x4df2a9[_0x3860('0x23')]][_0x3860('0x33')]=_0x4df2a9[_0x3860('0x33')];this['channels'][_0x4df2a9[_0x3860('0x23')]]['filename']=_0x4df2a9[_0x3860('0x34')];this[_0x3860('0x22')][_0x4df2a9[_0x3860('0x23')]][_0x3860('0x35')]=_0x4df2a9[_0x3860('0x35')];if(this[_0x3860('0x22')][_0x4df2a9['uniqueid']][_0x3860('0x31')]>0x0){tiff2pdf(_0x4df2a9[_0x3860('0x34')],'/var/opt/motion2/server/files/attachments/',function(_0x531402){logger[_0x3860('0x26')](_0x4df2a9[_0x3860('0x23')],'\x20result\x20conversion\x20file\x20',_0x531402[_0x3860('0x36')]);attachment[_0x3860('0x37')]({'name':path['parse'](_0x4df2a9[_0x3860('0x34')])[_0x3860('0x25')],'basename':path[_0x3860('0x38')](_0x4df2a9[_0x3860('0x34')])[_0x3860('0x25')]+_0x3860('0x39'),'type':_0x3860('0x3a')})[_0x3860('0x3b')](function(_0x1a3f39){faxAccount[_0x3860('0x3c')](_0x59c662,{'from':_0x4df2a9[_0x3860('0x35')],'mapKey':_0x3860('0x3d'),'body':path[_0x3860('0x38')](_0x4df2a9['filename'])[_0x3860('0x25')]+'.pdf','AttachmentId':_0x1a3f39['id']})[_0x3860('0x3e')](function(_0x770334){logger[_0x3860('0x3f')](_0x4df2a9[_0x3860('0x23')],_0x3860('0x40'),JSON[_0x3860('0x41')](_0x770334));});})[_0x3860('0x3e')](function(_0x27ef92){logger['error'](_0x4df2a9[_0x3860('0x23')],_0x3860('0x42'),JSON[_0x3860('0x41')](_0x27ef92));});});}logger['info'](_0x4df2a9[_0x3860('0x23')],_0x3860('0x42'));}};Fax[_0x3860('0x1d')][_0x3860('0x1c')]=function(_0x5ed2db){if(this['actions'][_0x5ed2db[_0x3860('0x23')]]){_['merge'](this[_0x3860('0x22')][_0x5ed2db[_0x3860('0x23')]],_[_0x3860('0x43')](_0x5ed2db,['response',_0x3860('0x44')]));}};function updateStatus(_0x5a019a){if(_0x5a019a[_0x3860('0x45')]){faxMessage['update'](_0x5a019a[_0x3860('0x45')],{'failMessage':_0x3860('0x46')})[_0x3860('0x3b')](function(_0x4b5790){ut['logger'](_0x3860('0x47'),_0x4b5790);})[_0x3860('0x3e')](function(_0x478dd9){ut[_0x3860('0x48')]('[Fax][Message][Error][NoUpdate1]',_0x478dd9);});}else{ut[_0x3860('0x48')](_0x3860('0x49'));}}Fax[_0x3860('0x1d')][_0x3860('0x4a')]=function(_0x426497,_0xe93a04,_0x3fad85){var _0x5a9987=this;var _0x2fb762={};if(_0xe93a04){_0x2fb762={'read':_0xe93a04};}else{_0x2fb762={'failMessage':_0x3fad85};}if(this[_0x3860('0xe')][_0x426497][_0x3860('0x45')]){faxMessage[_0x3860('0x4b')](this[_0x3860('0xe')][_0x426497][_0x3860('0x45')],_0x2fb762)['then'](function(_0x2cf48c){ut[_0x3860('0x48')](_0x3860('0x4c'),_0x2cf48c);})[_0x3860('0x3e')](function(_0x3a55e7){ut[_0x3860('0x48')](_0x3860('0x4d'),_0x3a55e7);})[_0x3860('0x4e')](function(){delete _0x5a9987['channels'][_0x426497];delete _0x5a9987[_0x3860('0xe')][_0x426497];});}else{ut[_0x3860('0x48')]('[Fax][Message][NoUpdate2]');delete this[_0x3860('0x22')][_0x426497];delete this[_0x3860('0xe')][_0x426497];}};Fax[_0x3860('0x1d')]['syncHangup']=function(_0x17d2df){var _0x5f4b87=this;if(this[_0x3860('0x22')][_0x17d2df[_0x3860('0x23')]]){if(this[_0x3860('0xe')][_0x17d2df[_0x3860('0x23')]]){this[_0x3860('0x22')][_0x17d2df[_0x3860('0x23')]]['id']=this[_0x3860('0xe')][_0x17d2df[_0x3860('0x23')]]['id'];this[_0x3860('0x22')][_0x17d2df[_0x3860('0x23')]][_0x3860('0x25')]=this[_0x3860('0xe')][_0x17d2df['uniqueid']]['name'];}logger['info'](_0x17d2df[_0x3860('0x23')],this['actions'][_0x17d2df['uniqueid']]?_0x3860('0x4f'):_0x3860('0x50'),JSON[_0x3860('0x41')](this[_0x3860('0x22')][_0x17d2df[_0x3860('0x23')]]));if(this[_0x3860('0xe')][_0x17d2df['uniqueid']]){if(this['channels'][_0x17d2df['uniqueid']][_0x3860('0x51')]>0x0&&this[_0x3860('0x22')][_0x17d2df[_0x3860('0x23')]]['faxstatus']===_0x3860('0x52')){this['updateStatus'](_0x17d2df[_0x3860('0x23')],!![]);}else{this[_0x3860('0x4a')](_0x17d2df['uniqueid'],![],this[_0x3860('0x22')][_0x17d2df[_0x3860('0x23')]][_0x3860('0x53')]?_0x3860('0x54')+this['channels'][_0x17d2df[_0x3860('0x23')]][_0x3860('0x53')]:_0x3860('0x55'));}}}};Fax['prototype']['send']=function(_0x26e54b){var _0x2ba958=this;return new BPromise(function(_0xe67023,_0x1ca0e7){_0x2ba958[_0x3860('0x56')](_0x26e54b,_0x2ba958[_0x3860('0xc')][_0x26e54b['FaxAccountId']])[_0x3860('0x3b')](function(_0x4fe4e8){ut['logger'](_0x3860('0x57'),_0x4fe4e8);_0xe67023(ut[_0x3860('0x36')](_0x3860('0x58')));})[_0x3860('0x3e')](function(_0x36431e){ut[_0x3860('0x48')]('[Fax][execOriginate][failure]',_0x36431e);updateStatus(_0x26e54b);_0x1ca0e7(ut[_0x3860('0x36')](_0x3860('0x59')));});});};Fax[_0x3860('0x1d')][_0x3860('0x5a')]=function(_0x1478d9){var _0x2a5c06=this;return new BPromise(function(_0x5f2c66,_0x1ae31b){var _0x81010b=_0x2a5c06[_0x3860('0x5b')](_0x2a5c06['faxAccounts'][_0x1478d9['FaxAccountId']][_0x3860('0x5c')],_0x1478d9);if(_0x81010b[_0x3860('0x5d')]){_0x5f2c66(ut[_0x3860('0x36')](_0x3860('0x5e')));}else{_0x1ae31b(ut[_0x3860('0x36')](_0x81010b['message']));}});};function originate(_0x48ade7,_0x2db53f,_0x393bc4){return new BPromise(function(_0x47e144,_0x5d9416){if(_0x393bc4){var _0x2fd2ec=util[_0x3860('0x5f')]('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[_0x3860('0x38')](_0x48ade7[_0x3860('0x60')])[_0x3860('0x25')],_0x48ade7[_0x3860('0x60')]);gs['execute'](_0x2fd2ec)[_0x3860('0x3b')](function(){_0x48ade7[_0x3860('0x60')]=util['format']('%s/%s.tif',path[_0x3860('0x38')](_0x48ade7[_0x3860('0x60')])['dir'],path[_0x3860('0x38')](_0x48ade7['path'])[_0x3860('0x25')]);_0x2db53f['XMF-PATH']=_0x48ade7['path'];ut[_0x3860('0x48')]('Convert\x20pdf\x20to\x20tif','');ami[_0x3860('0x61')](ut[_0x3860('0x62')](_0x48ade7,_0x2db53f))[_0x3860('0x3b')](function(_0x2fd2f4){_0x47e144(_0x2fd2f4);})[_0x3860('0x3e')](function(_0x43c5a1){_0x5d9416(_0x43c5a1);});})['catch'](function(_0x3756b3){_0x5d9416(_0x3756b3);});}else{ami[_0x3860('0x61')](ut[_0x3860('0x62')](_0x48ade7,_0x2db53f))['then'](function(_0x352a44){_0x47e144(_0x352a44);})['catch'](function(_0x30e093){_0x5d9416(_0x30e093);});}});}Fax[_0x3860('0x1d')]['execOriginate']=function(_0x73732c,_0x2cd731){var _0x1e94c4=this;return new BPromise(function(_0x5e3276,_0x572707){var _0x5a282a=uuid['v4']();var _0x4c0914=ut[_0x3860('0x63')](_0x73732c,_0x2cd731);_0x1e94c4[_0x3860('0xe')][_0x5a282a]=new Action(_0x5a282a,_0x2cd731,_0x73732c);var _0x3f8b7c=_0x1e94c4[_0x3860('0xe')][_0x5a282a];if(path['parse'](_0x73732c['path'])[_0x3860('0x64')]===_0x3860('0x39')){originate(_0x3f8b7c,_0x4c0914,!![])[_0x3860('0x3b')](function(_0x61798b){_0x5e3276(_0x61798b);})['catch'](function(_0x3a7c0c){_0x572707(_0x3a7c0c);});}else{originate(_0x3f8b7c,_0x4c0914,![])[_0x3860('0x3b')](function(_0x49a4e6){_0x5e3276(_0x49a4e6);})['catch'](function(_0x32cbe8){_0x572707(_0x32cbe8);});}});};Fax[_0x3860('0x1d')][_0x3860('0x65')]=function(_0x27894f){return!_['isNil'](_0x27894f)&&!_['isNil'](_0x27894f[_0x3860('0x25')])&&!_['isNil'](_0x27894f[_0x3860('0x66')])&&_0x27894f[_0x3860('0x66')]&&!_['isNil'](this['trunks'][util['format'](_0x3860('0x67'),_0x27894f[_0x3860('0x25')])])&&!_['isNil'](this[_0x3860('0xd')][util[_0x3860('0x5f')](_0x3860('0x67'),_0x27894f[_0x3860('0x25')])][_0x3860('0x2d')])&&(this['trunks'][util[_0x3860('0x5f')](_0x3860('0x67'),_0x27894f[_0x3860('0x25')])][_0x3860('0x2d')]===_0x3860('0x68')||this['trunks'][util[_0x3860('0x5f')](_0x3860('0x67'),_0x27894f[_0x3860('0x25')])][_0x3860('0x2d')]===_0x3860('0x69'));};Fax['prototype']['checkTrunk']=function(_0x196c50,_0x2f3eb6){if(!this[_0x3860('0x65')](_0x196c50)){ut[_0x3860('0x48')](_0x3860('0x6a'),_[_0x3860('0x6b')](_0x196c50)?'':_0x196c50[_0x3860('0x25')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x3860('0x6c')};}if(_[_0x3860('0x6b')](_0x2f3eb6['fax'])){ut[_0x3860('0x48')](_0x3860('0x6d'),JSON[_0x3860('0x41')](_0x2f3eb6));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x3860('0x6b')](_0x2f3eb6[_0x3860('0x60')])){ut['logger'](_0x3860('0x6e'),JSON['stringify'](_0x2f3eb6));return{'isValid':![],'message':_0x3860('0x6f')};}return{'isValid':!![],'message':_0x3860('0x70')};};module['exports']=Fax; \ No newline at end of file +var _0xe5b5=['.pdf','application/pdf','then','notify','error','\x20notify\x20','stringify','catch','\x20receiveFax\x20','response','reason','AttachmentId','update','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','logger','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','parse','dir','XMF-PATH','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','status','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','Empty\x20path','Is\x20Valid','exports','util','lodash','bluebird','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','syncNewchannel','bind','varset','syncVarSet','newexten','syncNewExten','faxstatus','syncFaxStatus','syncReceiveFax','syncHangup','syncOriginateResponse','prototype','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','syncNewState','channelstate','channelstatedesc','operation','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','message'];(function(_0x3831ef,_0x58fea6){var _0x32c7c6=function(_0x515d93){while(--_0x515d93){_0x3831ef['push'](_0x3831ef['shift']());}};_0x32c7c6(++_0x58fea6);}(_0xe5b5,0x12b));var _0x5e5b=function(_0xbb9dbf,_0x5dafa4){_0xbb9dbf=_0xbb9dbf-0x0;var _0x30223c=_0xe5b5[_0xbb9dbf];return _0x30223c;};'use strict';var util=require(_0x5e5b('0x0'));var _=require(_0x5e5b('0x1'));var BPromise=require(_0x5e5b('0x2'));var uuid=require(_0x5e5b('0x3'));var moment=require(_0x5e5b('0x4'));var path=require(_0x5e5b('0x5'));var tiff2pdf=require(_0x5e5b('0x6'));var gs=require(_0x5e5b('0x7'));var logger=require(_0x5e5b('0x8'))(_0x5e5b('0x9'));var ami=require(_0x5e5b('0xa'));var rpcDb=require(_0x5e5b('0xb'));var Channel=require(_0x5e5b('0xc'));var ut=require(_0x5e5b('0xd'));var Action=require(_0x5e5b('0xe'));var faxAccount=require(_0x5e5b('0xf'));var attachment=require(_0x5e5b('0x10'));var faxMessage=require(_0x5e5b('0x11'));function Fax(_0x258414){this[_0x5e5b('0x12')]={};this[_0x5e5b('0x13')]=_0x258414[_0x5e5b('0x13')];this[_0x5e5b('0x14')]=_0x258414['trunks'];this[_0x5e5b('0x15')]={};ami['on']('newchannel',this[_0x5e5b('0x16')][_0x5e5b('0x17')](this));ami['on'](_0x5e5b('0x18'),this[_0x5e5b('0x19')]['bind'](this));ami['on']('newstate',this['syncNewState'][_0x5e5b('0x17')](this));ami['on'](_0x5e5b('0x1a'),this[_0x5e5b('0x1b')][_0x5e5b('0x17')](this));ami['on'](_0x5e5b('0x1c'),this[_0x5e5b('0x1d')][_0x5e5b('0x17')](this));ami['on']('receivefax',this[_0x5e5b('0x1e')][_0x5e5b('0x17')](this));ami['on']('hangup',this[_0x5e5b('0x1f')]['bind'](this));ami['on']('originateresponse',this[_0x5e5b('0x20')][_0x5e5b('0x17')](this));}Fax[_0x5e5b('0x21')]['syncNewchannel']=function(_0x38fdcc){if(_0x38fdcc['context']===_0x5e5b('0x22')){for(var _0x45a091 in this['faxAccounts']){if(this[_0x5e5b('0x13')][_0x5e5b('0x23')](_0x45a091)){if(_0x38fdcc[_0x5e5b('0x24')]===this['faxAccounts'][_0x45a091][_0x5e5b('0x25')]){this[_0x5e5b('0x12')][_0x38fdcc['uniqueid']]={};this[_0x5e5b('0x12')][_0x38fdcc[_0x5e5b('0x26')]][_0x5e5b('0x27')]=_0x38fdcc[_0x5e5b('0x27')];this[_0x5e5b('0x12')][_0x38fdcc[_0x5e5b('0x26')]]['id']=this[_0x5e5b('0x13')][_0x45a091]['id'];this[_0x5e5b('0x12')][_0x38fdcc['uniqueid']]['name']=this[_0x5e5b('0x13')][_0x45a091][_0x5e5b('0x28')];logger[_0x5e5b('0x29')](_0x38fdcc[_0x5e5b('0x26')],_0x5e5b('0x2a'));}}}}if(this[_0x5e5b('0x15')][_0x38fdcc[_0x5e5b('0x26')]]){this[_0x5e5b('0x12')][_0x38fdcc[_0x5e5b('0x26')]]={};this[_0x5e5b('0x12')][_0x38fdcc[_0x5e5b('0x26')]]['channel']=_0x38fdcc[_0x5e5b('0x27')];logger[_0x5e5b('0x29')](_0x38fdcc[_0x5e5b('0x26')],'\x20syncNewchannel\x20');}};Fax[_0x5e5b('0x21')][_0x5e5b('0x19')]=function(_0x5ee866){if(this[_0x5e5b('0x12')][_0x5ee866[_0x5e5b('0x26')]]){for(var _0x39ce16 in _0x5ee866[_0x5e5b('0x2b')]){if(_0x5ee866[_0x5e5b('0x2b')][_0x5e5b('0x23')](_0x39ce16)){this[_0x5e5b('0x12')][_0x5ee866[_0x5e5b('0x26')]][_0x39ce16]=_0x5ee866[_0x5e5b('0x2c')];}}}};Fax[_0x5e5b('0x21')][_0x5e5b('0x2d')]=function(_0x28157a){if(this['channels'][_0x28157a['uniqueid']]){this[_0x5e5b('0x12')][_0x28157a[_0x5e5b('0x26')]][_0x5e5b('0x2e')]=_0x28157a[_0x5e5b('0x2e')];this[_0x5e5b('0x12')][_0x28157a['uniqueid']][_0x5e5b('0x2f')]=_0x28157a['channelstatedesc'];}};Fax[_0x5e5b('0x21')][_0x5e5b('0x1b')]=function(_0x11fa95){if(this[_0x5e5b('0x12')][_0x11fa95['uniqueid']]){for(var _0x22e906 in _0x11fa95[_0x5e5b('0x2b')]){if(_0x11fa95['variable'][_0x5e5b('0x23')](_0x22e906)){this[_0x5e5b('0x12')][_0x11fa95[_0x5e5b('0x26')]][_0x22e906]=_0x11fa95[_0x5e5b('0x2c')];}}}};Fax[_0x5e5b('0x21')][_0x5e5b('0x1d')]=function(_0x6b7977){if(this[_0x5e5b('0x12')][_0x6b7977['uniqueid']]){this[_0x5e5b('0x12')][_0x6b7977[_0x5e5b('0x26')]][_0x5e5b('0x30')]=_0x6b7977[_0x5e5b('0x30')];this[_0x5e5b('0x12')][_0x6b7977[_0x5e5b('0x26')]]['status']=_0x6b7977['status'];this[_0x5e5b('0x12')][_0x6b7977[_0x5e5b('0x26')]][_0x5e5b('0x25')]=_0x6b7977['localstationid'];this[_0x5e5b('0x12')][_0x6b7977[_0x5e5b('0x26')]][_0x5e5b('0x31')]=_0x6b7977[_0x5e5b('0x31')];logger['info'](_0x6b7977[_0x5e5b('0x26')],_0x5e5b('0x32'));}};Fax['prototype']['syncReceiveFax']=function(_0xe9c586){var _0x2c8b04=this;if(this[_0x5e5b('0x12')][_0xe9c586['uniqueid']]){var _0x18e181=this['channels'][_0xe9c586['uniqueid']]['id'];this[_0x5e5b('0x12')][_0xe9c586[_0x5e5b('0x26')]][_0x5e5b('0x33')]=_0xe9c586[_0x5e5b('0x33')];this[_0x5e5b('0x12')][_0xe9c586[_0x5e5b('0x26')]][_0x5e5b('0x34')]=_0xe9c586[_0x5e5b('0x34')];this[_0x5e5b('0x12')][_0xe9c586['uniqueid']][_0x5e5b('0x25')]=_0xe9c586[_0x5e5b('0x25')];this['channels'][_0xe9c586[_0x5e5b('0x26')]]['resolution']=_0xe9c586[_0x5e5b('0x35')];this[_0x5e5b('0x12')][_0xe9c586[_0x5e5b('0x26')]][_0x5e5b('0x36')]=_0xe9c586[_0x5e5b('0x36')];this[_0x5e5b('0x12')][_0xe9c586[_0x5e5b('0x26')]][_0x5e5b('0x31')]=_0xe9c586[_0x5e5b('0x31')];this[_0x5e5b('0x12')][_0xe9c586[_0x5e5b('0x26')]]['calleridnum']=_0xe9c586[_0x5e5b('0x37')];if(this[_0x5e5b('0x12')][_0xe9c586[_0x5e5b('0x26')]]['pagestransferred']>0x0){tiff2pdf(_0xe9c586[_0x5e5b('0x31')],_0x5e5b('0x38'),function(_0x4d9ec0){logger[_0x5e5b('0x29')](_0xe9c586[_0x5e5b('0x26')],'\x20result\x20conversion\x20file\x20',_0x4d9ec0[_0x5e5b('0x39')]);attachment['create']({'name':path['parse'](_0xe9c586['filename'])[_0x5e5b('0x28')],'basename':path['parse'](_0xe9c586[_0x5e5b('0x31')])['name']+_0x5e5b('0x3a'),'type':_0x5e5b('0x3b')})[_0x5e5b('0x3c')](function(_0x16d1db){faxAccount[_0x5e5b('0x3d')](_0x18e181,{'from':_0xe9c586[_0x5e5b('0x37')],'mapKey':_0x5e5b('0x9'),'body':path['parse'](_0xe9c586['filename'])[_0x5e5b('0x28')]+'.pdf','AttachmentId':_0x16d1db['id']})['catch'](function(_0x4e83eb){logger[_0x5e5b('0x3e')](_0xe9c586['uniqueid'],_0x5e5b('0x3f'),JSON[_0x5e5b('0x40')](_0x4e83eb));});})[_0x5e5b('0x41')](function(_0x3885b6){logger[_0x5e5b('0x3e')](_0xe9c586[_0x5e5b('0x26')],'\x20receiveFax\x20',JSON[_0x5e5b('0x40')](_0x3885b6));});});}logger[_0x5e5b('0x29')](_0xe9c586['uniqueid'],_0x5e5b('0x42'));}};Fax['prototype'][_0x5e5b('0x20')]=function(_0x36d8fa){if(this[_0x5e5b('0x15')][_0x36d8fa[_0x5e5b('0x26')]]){_['merge'](this[_0x5e5b('0x12')][_0x36d8fa[_0x5e5b('0x26')]],_['pick'](_0x36d8fa,[_0x5e5b('0x43'),_0x5e5b('0x44')]));}};function updateStatus(_0x1a1437){if(_0x1a1437[_0x5e5b('0x45')]){faxMessage[_0x5e5b('0x46')](_0x1a1437[_0x5e5b('0x45')],{'failMessage':'SENDING\x20FAILED\x20'})[_0x5e5b('0x3c')](function(_0x4b95fe){ut['logger'](_0x5e5b('0x47'),_0x4b95fe);})[_0x5e5b('0x41')](function(_0x417b63){ut['logger'](_0x5e5b('0x48'),_0x417b63);});}else{ut[_0x5e5b('0x49')](_0x5e5b('0x4a'));}}Fax['prototype'][_0x5e5b('0x4b')]=function(_0x2e04d6,_0x239804,_0x4a4e0f){var _0x4c74ea=this;var _0x3da13f={};if(_0x239804){_0x3da13f={'read':_0x239804};}else{_0x3da13f={'failMessage':_0x4a4e0f};}if(this['actions'][_0x2e04d6]['AttachmentId']){faxMessage[_0x5e5b('0x46')](this[_0x5e5b('0x15')][_0x2e04d6][_0x5e5b('0x45')],_0x3da13f)['then'](function(_0x3cb753){ut[_0x5e5b('0x49')](_0x5e5b('0x4c'),_0x3cb753);})[_0x5e5b('0x41')](function(_0x106716){ut[_0x5e5b('0x49')]('[Fax][Message][NoUpdate1]',_0x106716);})['finally'](function(){delete _0x4c74ea[_0x5e5b('0x12')][_0x2e04d6];delete _0x4c74ea[_0x5e5b('0x15')][_0x2e04d6];});}else{ut[_0x5e5b('0x49')](_0x5e5b('0x4d'));delete this['channels'][_0x2e04d6];delete this[_0x5e5b('0x15')][_0x2e04d6];}};Fax['prototype'][_0x5e5b('0x1f')]=function(_0x2fdeb5){var _0x3911f4=this;if(this[_0x5e5b('0x12')][_0x2fdeb5[_0x5e5b('0x26')]]){if(this[_0x5e5b('0x15')][_0x2fdeb5[_0x5e5b('0x26')]]){this[_0x5e5b('0x12')][_0x2fdeb5['uniqueid']]['id']=this[_0x5e5b('0x15')][_0x2fdeb5[_0x5e5b('0x26')]]['id'];this[_0x5e5b('0x12')][_0x2fdeb5[_0x5e5b('0x26')]][_0x5e5b('0x28')]=this['actions'][_0x2fdeb5[_0x5e5b('0x26')]][_0x5e5b('0x28')];}logger[_0x5e5b('0x29')](_0x2fdeb5[_0x5e5b('0x26')],this[_0x5e5b('0x15')][_0x2fdeb5['uniqueid']]?_0x5e5b('0x4e'):'\x20hangup\x20faxRiceive\x20',JSON[_0x5e5b('0x40')](this['channels'][_0x2fdeb5[_0x5e5b('0x26')]]));if(this[_0x5e5b('0x15')][_0x2fdeb5[_0x5e5b('0x26')]]){if(this[_0x5e5b('0x12')][_0x2fdeb5[_0x5e5b('0x26')]][_0x5e5b('0x4f')]>0x0&&this['channels'][_0x2fdeb5[_0x5e5b('0x26')]][_0x5e5b('0x1c')]===_0x5e5b('0x50')){this[_0x5e5b('0x4b')](_0x2fdeb5['uniqueid'],!![]);}else{this['updateStatus'](_0x2fdeb5[_0x5e5b('0x26')],![],this[_0x5e5b('0x12')][_0x2fdeb5['uniqueid']][_0x5e5b('0x51')]?_0x5e5b('0x52')+this[_0x5e5b('0x12')][_0x2fdeb5[_0x5e5b('0x26')]][_0x5e5b('0x51')]:'SENDING\x20FAILED');}}}};Fax[_0x5e5b('0x21')][_0x5e5b('0x53')]=function(_0x494b1d){var _0x4795a7=this;return new BPromise(function(_0x4a6ff6,_0x473f20){_0x4795a7[_0x5e5b('0x54')](_0x494b1d,_0x4795a7[_0x5e5b('0x13')][_0x494b1d[_0x5e5b('0x55')]])[_0x5e5b('0x3c')](function(_0x520b8c){ut[_0x5e5b('0x49')](_0x5e5b('0x56'),_0x520b8c);_0x4a6ff6(ut['message'](_0x5e5b('0x57')));})['catch'](function(_0x4c75a5){ut[_0x5e5b('0x49')](_0x5e5b('0x58'),_0x4c75a5);updateStatus(_0x494b1d);_0x473f20(ut[_0x5e5b('0x39')](_0x5e5b('0x59')));});});};Fax[_0x5e5b('0x21')][_0x5e5b('0x5a')]=function(_0x2dc365){var _0x55b389=this;return new BPromise(function(_0x37146f,_0x2fc931){var _0x548aa0=_0x55b389[_0x5e5b('0x5b')](_0x55b389[_0x5e5b('0x13')][_0x2dc365[_0x5e5b('0x55')]][_0x5e5b('0x5c')],_0x2dc365);if(_0x548aa0[_0x5e5b('0x5d')]){_0x37146f(ut[_0x5e5b('0x39')](_0x5e5b('0x5e')));}else{_0x2fc931(ut[_0x5e5b('0x39')](_0x548aa0['message']));}});};function originate(_0x2c8b25,_0x1a3d7b,_0x3c57ad){return new BPromise(function(_0x271af6,_0xc7171a){if(_0x3c57ad){var _0x4dcf17=util[_0x5e5b('0x5f')](_0x5e5b('0x60'),path[_0x5e5b('0x61')](_0x2c8b25[_0x5e5b('0x5')])[_0x5e5b('0x28')],_0x2c8b25[_0x5e5b('0x5')]);gs['execute'](_0x4dcf17)[_0x5e5b('0x3c')](function(){_0x2c8b25[_0x5e5b('0x5')]=util[_0x5e5b('0x5f')]('%s/%s.tif',path[_0x5e5b('0x61')](_0x2c8b25[_0x5e5b('0x5')])[_0x5e5b('0x62')],path[_0x5e5b('0x61')](_0x2c8b25[_0x5e5b('0x5')])[_0x5e5b('0x28')]);_0x1a3d7b[_0x5e5b('0x63')]=_0x2c8b25[_0x5e5b('0x5')];ut[_0x5e5b('0x49')]('Convert\x20pdf\x20to\x20tif','');ami[_0x5e5b('0x64')](ut['variablesAction'](_0x2c8b25,_0x1a3d7b))[_0x5e5b('0x3c')](function(_0xd054eb){_0x271af6(_0xd054eb);})['catch'](function(_0x49c74f){_0xc7171a(_0x49c74f);});})[_0x5e5b('0x41')](function(_0x2ac228){_0xc7171a(_0x2ac228);});}else{ami['Action'](ut[_0x5e5b('0x65')](_0x2c8b25,_0x1a3d7b))['then'](function(_0x5d1ca4){_0x271af6(_0x5d1ca4);})[_0x5e5b('0x41')](function(_0x5cb712){_0xc7171a(_0x5cb712);});}});}Fax[_0x5e5b('0x21')][_0x5e5b('0x54')]=function(_0x10aa6a,_0x4ff92a){var _0x39832f=this;return new BPromise(function(_0x14fd35,_0x6cc7aa){var _0x4964a8=uuid['v4']();var _0x131160=ut[_0x5e5b('0x66')](_0x10aa6a,_0x4ff92a);_0x39832f['actions'][_0x4964a8]=new Action(_0x4964a8,_0x4ff92a,_0x10aa6a);var _0x388dbe=_0x39832f['actions'][_0x4964a8];if(path['parse'](_0x10aa6a[_0x5e5b('0x5')])[_0x5e5b('0x67')]===_0x5e5b('0x3a')){originate(_0x388dbe,_0x131160,!![])[_0x5e5b('0x3c')](function(_0x1a7c5c){_0x14fd35(_0x1a7c5c);})['catch'](function(_0x29f49f){_0x6cc7aa(_0x29f49f);});}else{originate(_0x388dbe,_0x131160,![])[_0x5e5b('0x3c')](function(_0x5b75a4){_0x14fd35(_0x5b75a4);})['catch'](function(_0x39d354){_0x6cc7aa(_0x39d354);});}});};Fax[_0x5e5b('0x21')][_0x5e5b('0x68')]=function(_0x10fa87){return!_[_0x5e5b('0x69')](_0x10fa87)&&!_[_0x5e5b('0x69')](_0x10fa87['name'])&&!_[_0x5e5b('0x69')](_0x10fa87[_0x5e5b('0x6a')])&&_0x10fa87[_0x5e5b('0x6a')]&&!_['isNil'](this['trunks'][util[_0x5e5b('0x5f')](_0x5e5b('0x6b'),_0x10fa87[_0x5e5b('0x28')])])&&!_['isNil'](this[_0x5e5b('0x14')][util[_0x5e5b('0x5f')](_0x5e5b('0x6b'),_0x10fa87['name'])][_0x5e5b('0x6c')])&&(this[_0x5e5b('0x14')][util[_0x5e5b('0x5f')]('SIP/%s',_0x10fa87[_0x5e5b('0x28')])][_0x5e5b('0x6c')]===_0x5e5b('0x6d')||this[_0x5e5b('0x14')][util[_0x5e5b('0x5f')](_0x5e5b('0x6b'),_0x10fa87['name'])][_0x5e5b('0x6c')]===_0x5e5b('0x6e'));};Fax['prototype'][_0x5e5b('0x5b')]=function(_0x505d48,_0x47159c){if(!this[_0x5e5b('0x68')](_0x505d48)){ut[_0x5e5b('0x49')](_0x5e5b('0x6f'),_[_0x5e5b('0x69')](_0x505d48)?'':_0x505d48['name']+_0x5e5b('0x70'));return{'isValid':![],'message':_0x5e5b('0x71')};}if(_[_0x5e5b('0x69')](_0x47159c[_0x5e5b('0x9')])){ut[_0x5e5b('0x49')](_0x5e5b('0x72'),JSON['stringify'](_0x47159c));return{'isValid':![],'message':_0x5e5b('0x73')};}if(_['isNil'](_0x47159c[_0x5e5b('0x5')])){ut[_0x5e5b('0x49')]('[Fax][checkTrunk][Empty\x20path]',JSON['stringify'](_0x47159c));return{'isValid':![],'message':_0x5e5b('0x74')};}return{'isValid':!![],'message':_0x5e5b('0x75')};};module[_0x5e5b('0x76')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index e77c885..c2d6b48 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 _0xcb5f=['[Notify]\x20','util','bluebird','../../../config/logger','lodash','../rpc/faxAccount','resolve','then','notify','catch'];(function(_0x1bd3dd,_0x40a78a){var _0xe1a1d4=function(_0x24f68d){while(--_0x24f68d){_0x1bd3dd['push'](_0x1bd3dd['shift']());}};_0xe1a1d4(++_0x40a78a);}(_0xcb5f,0x169));var _0xfcb5=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xcb5f[_0x19950b];return _0x3c6b41;};'use strict';var util=require(_0xfcb5('0x0'));var BPromise=require(_0xfcb5('0x1'));var logger=require(_0xfcb5('0x2'))('preview');var _=require(_0xfcb5('0x3'));var faxAccount=require(_0xfcb5('0x4'));function loggerCatch(_0x24f57b){return function(_0x582fc3){logger['error'](_0x24f57b,util['inspect'](_0x582fc3,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x10a4ca,_0x2abb5d){return BPromise[_0xfcb5('0x5')]()[_0xfcb5('0x6')](faxAccount[_0xfcb5('0x7')](_0x10a4ca,_0x2abb5d))[_0xfcb5('0x8')](loggerCatch(_0xfcb5('0x9')));}; \ No newline at end of file +var _0xf488=['util','preview','../rpc/faxAccount','error','resolve','[Notify]\x20'];(function(_0x5341a3,_0x2b5a27){var _0x211d4d=function(_0x6b88bc){while(--_0x6b88bc){_0x5341a3['push'](_0x5341a3['shift']());}};_0x211d4d(++_0x2b5a27);}(_0xf488,0xe4));var _0x8f48=function(_0x7e3bb8,_0x27c048){_0x7e3bb8=_0x7e3bb8-0x0;var _0x44c887=_0xf488[_0x7e3bb8];return _0x44c887;};'use strict';var util=require(_0x8f48('0x0'));var BPromise=require('bluebird');var logger=require('../../../config/logger')(_0x8f48('0x1'));var _=require('lodash');var faxAccount=require(_0x8f48('0x2'));function loggerCatch(_0x471529){return function(_0x449215){logger[_0x8f48('0x3')](_0x471529,util['inspect'](_0x449215,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x1b41a8,_0x22be0e){return BPromise[_0x8f48('0x4')]()['then'](faxAccount['notify'](_0x1b41a8,_0x22be0e))['catch'](loggerCatch(_0x8f48('0x5')));}; \ 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 9c0faac..d185277 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 _0xb1b9=['Exec\x20gs','\x20Error\x20:','../../../../config/logger','exec','execute','info'];(function(_0x4852ff,_0x35118d){var _0x3ee92e=function(_0x37de82){while(--_0x37de82){_0x4852ff['push'](_0x4852ff['shift']());}};_0x3ee92e(++_0x35118d);}(_0xb1b9,0x122));var _0x9b1b=function(_0x5cb15d,_0x420dee){_0x5cb15d=_0x5cb15d-0x0;var _0x12d95d=_0xb1b9[_0x5cb15d];return _0x12d95d;};'use strict';var util=require('util');var logger=require(_0x9b1b('0x0'))('fax');var BPromise=require('bluebird');var exec=require('child_process')[_0x9b1b('0x1')];exports[_0x9b1b('0x2')]=function(_0x26ee1c){return new BPromise(function(_0x20d28e,_0x940c6c){exec(_0x26ee1c,function(_0x41db27,_0x45b268,_0x3583f3){logger[_0x9b1b('0x3')](_0x9b1b('0x4'),_0x45b268);if(_0x41db27){logger[_0x9b1b('0x3')](_0x9b1b('0x4'),_0x9b1b('0x5'),util['inspect'](_0x41db27,{'showHidden':![],'depth':null}),_0x45b268,_0x3583f3);_0x940c6c(_0x41db27);}_0x20d28e(_0x45b268);});});}; \ No newline at end of file +var _0xc1dd=['Exec\x20gs','info','util','fax','bluebird','child_process','execute'];(function(_0x856e86,_0x3f9c40){var _0x586a43=function(_0x433704){while(--_0x433704){_0x856e86['push'](_0x856e86['shift']());}};_0x586a43(++_0x3f9c40);}(_0xc1dd,0xc6));var _0xdc1d=function(_0x289e64,_0x5adb3c){_0x289e64=_0x289e64-0x0;var _0x30246c=_0xc1dd[_0x289e64];return _0x30246c;};'use strict';var util=require(_0xdc1d('0x0'));var logger=require('../../../../config/logger')(_0xdc1d('0x1'));var BPromise=require(_0xdc1d('0x2'));var exec=require(_0xdc1d('0x3'))['exec'];exports[_0xdc1d('0x4')]=function(_0x977bd2){return new BPromise(function(_0x2a29b9,_0xa4deb3){exec(_0x977bd2,function(_0x322288,_0x1fdec3,_0x4bb0b4){logger['info'](_0xdc1d('0x5'),_0x1fdec3);if(_0x322288){logger[_0xdc1d('0x6')](_0xdc1d('0x5'),'\x20Error\x20:',util['inspect'](_0x322288,{'showHidden':![],'depth':null}),_0x1fdec3,_0x4bb0b4);_0xa4deb3(_0x322288);}_0x2a29b9(_0x1fdec3);});});}; \ 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 b0490c7..b640137 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 _0x8f87=['inspect','addVariables','ecm','headerinfo','minrate','maxrate','\x22%s\x22','modem','faxdetect','t38timeout','localstationid','path','variablesAction','uniqueid','originate','channel','from-sip','format','\x22%s\x22\x20<%s>','lodash','../../../../config/logger','fax','message','logger'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0x8f87,0x17b));var _0x78f8=function(_0xbc2974,_0xec3342){_0xbc2974=_0xbc2974-0x0;var _0x3a5b4f=_0x8f87[_0xbc2974];return _0x3a5b4f;};'use strict';var util=require('util');var _=require(_0x78f8('0x0'));var moment=require('moment');var logger=require(_0x78f8('0x1'))(_0x78f8('0x2'));exports[_0x78f8('0x3')]=function(_0x15bfc8){return{'message':_0x15bfc8};};exports[_0x78f8('0x4')]=function(_0x230a15,_0x546f8f){logger['info'](_0x230a15,util[_0x78f8('0x5')](_0x546f8f,{'showHidden':![],'depth':null}));};exports[_0x78f8('0x6')]=function(_0x3d9d7e,_0x536bba){var _0x251382={'XMF-ECM':_0x536bba[_0x78f8('0x7')],'XMF-HEADERINFO':_0x536bba[_0x78f8('0x8')],'XMF-MINRATE':_0x536bba[_0x78f8('0x9')],'XMF-MAXRATE':_0x536bba[_0x78f8('0xa')],'XMF-MODEM':util['format'](_0x78f8('0xb'),_0x536bba[_0x78f8('0xc')]),'XMF-GATEWAY':_0x536bba['gateway'],'XMF-FAXDETECT':_0x536bba[_0x78f8('0xd')],'XMF-T38TIMEOUT':_0x536bba[_0x78f8('0xe')],'XMF-LOCALSTATIONID':_0x536bba[_0x78f8('0xf')],'XMF-PATH':_0x3d9d7e[_0x78f8('0x10')]};return _0x251382;};exports[_0x78f8('0x11')]=function(_0x4eff1f,_0x3cba22){return{'actionid':_0x4eff1f[_0x78f8('0x12')],'action':_0x78f8('0x13'),'channel':_0x4eff1f[_0x78f8('0x14')],'Exten':'xcally-motion-fax','Context':_0x78f8('0x15'),'Priority':'1','callerid':util[_0x78f8('0x16')](_0x78f8('0x17'),_0x4eff1f[_0x78f8('0x8')]?_0x4eff1f['headerinfo']:'',_0x4eff1f['localstationid']),'variable':_0x3cba22,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x4eff1f[_0x78f8('0x12')]};}; \ No newline at end of file +var _0xad43=['logger','info','inspect','addVariables','headerinfo','minrate','maxrate','\x22%s\x22','modem','t38timeout','localstationid','variablesAction','uniqueid','originate','from-sip','moment','../../../../config/logger','fax','message'];(function(_0x57b236,_0x30614e){var _0x4feb29=function(_0x26d3e6){while(--_0x26d3e6){_0x57b236['push'](_0x57b236['shift']());}};_0x4feb29(++_0x30614e);}(_0xad43,0xe0));var _0x3ad4=function(_0x2cce52,_0x5829c8){_0x2cce52=_0x2cce52-0x0;var _0x555e32=_0xad43[_0x2cce52];return _0x555e32;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x3ad4('0x0'));var logger=require(_0x3ad4('0x1'))(_0x3ad4('0x2'));exports[_0x3ad4('0x3')]=function(_0x223567){return{'message':_0x223567};};exports[_0x3ad4('0x4')]=function(_0xc5e7f9,_0x340e99){logger[_0x3ad4('0x5')](_0xc5e7f9,util[_0x3ad4('0x6')](_0x340e99,{'showHidden':![],'depth':null}));};exports[_0x3ad4('0x7')]=function(_0x1f243d,_0x69694e){var _0x79eed3={'XMF-ECM':_0x69694e['ecm'],'XMF-HEADERINFO':_0x69694e[_0x3ad4('0x8')],'XMF-MINRATE':_0x69694e[_0x3ad4('0x9')],'XMF-MAXRATE':_0x69694e[_0x3ad4('0xa')],'XMF-MODEM':util['format'](_0x3ad4('0xb'),_0x69694e[_0x3ad4('0xc')]),'XMF-GATEWAY':_0x69694e['gateway'],'XMF-FAXDETECT':_0x69694e['faxdetect'],'XMF-T38TIMEOUT':_0x69694e[_0x3ad4('0xd')],'XMF-LOCALSTATIONID':_0x69694e[_0x3ad4('0xe')],'XMF-PATH':_0x1f243d['path']};return _0x79eed3;};exports[_0x3ad4('0xf')]=function(_0x36721c,_0x26dea7){return{'actionid':_0x36721c[_0x3ad4('0x10')],'action':_0x3ad4('0x11'),'channel':_0x36721c['channel'],'Exten':'xcally-motion-fax','Context':_0x3ad4('0x12'),'Priority':'1','callerid':util['format']('\x22%s\x22\x20<%s>',_0x36721c['headerinfo']?_0x36721c[_0x3ad4('0x8')]:'',_0x36721c[_0x3ad4('0xe')]),'variable':_0x26dea7,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x36721c[_0x3ad4('0x10')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index f2b73ec..5dd47f2 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 _0xb870=['./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','resolve','then','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initFreshsalesAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','initVoiceExtensions','getFaxAccounts','initFaxAccounts','initVoiceQueueReports','getVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','[index.js][initParams]','inspect','listen','sync','[index.js][main]','bluebird','moment','./server','./realtime','./report','./trigger','./dialer','./preview','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales'];(function(_0x7634ab,_0x3ce0af){var _0x108d1d=function(_0x37887c){while(--_0x37887c){_0x7634ab['push'](_0x7634ab['shift']());}};_0x108d1d(++_0x3ce0af);}(_0xb870,0x7a));var _0x0b87=function(_0x23c02b,_0x411b4d){_0x23c02b=_0x23c02b-0x0;var _0x25efc5=_0xb870[_0x23c02b];return _0x25efc5;};'use strict';var BPromise=require(_0x0b87('0x0'));var util=require('util');var moment=require(_0x0b87('0x1'));var server=require(_0x0b87('0x2'));var Realtime=require(_0x0b87('0x3'));var Report=require(_0x0b87('0x4'));var Acw=require('./acw');var Trigger=require(_0x0b87('0x5'));var Dialer=require(_0x0b87('0x6'));var Preview=require(_0x0b87('0x7'));var Fax=require('./fax');var user=require(_0x0b87('0x8'));var voiceQueue=require(_0x0b87('0x9'));var voiceQueueReport=require(_0x0b87('0xa'));var voiceCallReport=require(_0x0b87('0xb'));var trunk=require(_0x0b87('0xc'));var trigger=require(_0x0b87('0xd'));var template=require('./rpc/template');var cmHopperHistory=require(_0x0b87('0xe'));var campaign=require(_0x0b87('0xf'));var voiceExtension=require(_0x0b87('0x10'));var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0x0b87('0x11'));var salesforce=require(_0x0b87('0x12'));var sugarcrm=require(_0x0b87('0x13'));var freshdesk=require(_0x0b87('0x14'));var desk=require('./rpc/integrations/desk');var zoho=require(_0x0b87('0x15'));var vtiger=require(_0x0b87('0x16'));var freshsales=require(_0x0b87('0x17'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require(_0x0b87('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(_0x0b87('0x19'))(_0x0b87('0x1a'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x0b87('0x1b')](_0x0b87('0x1c'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x0b87('0x1b')](_0x0b87('0x1c'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x0b87('0x1d')]()[_0x0b87('0x1e')](user['getAgents']())['then'](realtime[_0x0b87('0x1f')]())[_0x0b87('0x1e')](user[_0x0b87('0x20')]())[_0x0b87('0x1e')](realtime[_0x0b87('0x21')]())[_0x0b87('0x1e')](trunk[_0x0b87('0x22')]())[_0x0b87('0x1e')](realtime[_0x0b87('0x23')]())['then'](voiceQueue[_0x0b87('0x24')]())['then'](realtime[_0x0b87('0x25')]())[_0x0b87('0x1e')](trigger[_0x0b87('0x26')]())[_0x0b87('0x1e')](realtime[_0x0b87('0x27')]())[_0x0b87('0x1e')](template['getTemplates']())[_0x0b87('0x1e')](realtime[_0x0b87('0x28')]())[_0x0b87('0x1e')](zendesk[_0x0b87('0x29')]())[_0x0b87('0x1e')](realtime[_0x0b87('0x2a')]())[_0x0b87('0x1e')](salesforce[_0x0b87('0x2b')]())['then'](realtime[_0x0b87('0x2c')]())[_0x0b87('0x1e')](sugarcrm[_0x0b87('0x2d')]())[_0x0b87('0x1e')](realtime[_0x0b87('0x2e')]())[_0x0b87('0x1e')](freshdesk[_0x0b87('0x2f')]())['then'](realtime[_0x0b87('0x30')]())['then'](desk[_0x0b87('0x31')]())[_0x0b87('0x1e')](realtime[_0x0b87('0x32')]())[_0x0b87('0x1e')](zoho[_0x0b87('0x33')]())['then'](realtime['initZohoAccounts']())['then'](vtiger['getVtigerAccounts']())[_0x0b87('0x1e')](realtime['initVtigerAccounts']())[_0x0b87('0x1e')](freshsales['getFreshsalesAccounts']())[_0x0b87('0x1e')](realtime[_0x0b87('0x34')]())[_0x0b87('0x1e')](servicenow['getServicenowAccounts']())[_0x0b87('0x1e')](realtime['initServicenowAccounts']())[_0x0b87('0x1e')](dynamics365[_0x0b87('0x35')]())[_0x0b87('0x1e')](realtime[_0x0b87('0x36')]())[_0x0b87('0x1e')](campaign[_0x0b87('0x37')]())[_0x0b87('0x1e')](realtime[_0x0b87('0x38')]())['then'](voiceExtension['getVoiceExtensions']())['then'](realtime[_0x0b87('0x39')]())[_0x0b87('0x1e')](faxAccount[_0x0b87('0x3a')]())[_0x0b87('0x1e')](realtime[_0x0b87('0x3b')]())[_0x0b87('0x1e')](function(){return realtime;});}function initParams(){return BPromise[_0x0b87('0x1d')]()[_0x0b87('0x1e')](voiceQueueReport['getVoiceQueueReports']())[_0x0b87('0x1e')](realtime[_0x0b87('0x3c')]())['then'](cmHopperHistory[_0x0b87('0x3d')]())['then'](realtime['initVoiceQueueHopperHistory']())['then'](cmHopperHistory[_0x0b87('0x3e')]())[_0x0b87('0x1e')](realtime[_0x0b87('0x3f')]())[_0x0b87('0x1e')](voiceCallReport[_0x0b87('0x40')]())[_0x0b87('0x1e')](realtime[_0x0b87('0x41')]())[_0x0b87('0x42')](function(_0x3d49c3){logger[_0x0b87('0x43')](_0x0b87('0x44'),util[_0x0b87('0x45')](_0x3d49c3,{'showHidden':![],'depth':null}));});}function main(){return server[_0x0b87('0x46')](realtime,preview,fax)[_0x0b87('0x1e')](function(_0x249641){return initRealtime();})[_0x0b87('0x1e')](function(){return initParams();})[_0x0b87('0x1e')](function(){report[_0x0b87('0x47')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x25d4a0){logger[_0x0b87('0x43')](_0x0b87('0x48'),util[_0x0b87('0x45')](_0x25d4a0,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0xda4b=['getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','initVoiceExtensions','getFaxAccounts','initFaxAccounts','resolve','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','initVoiceCallReports','catch','error','inspect','listen','[index.js][main]','bluebird','moment','./server','./realtime','./trigger','./dialer','./preview','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trunk','./rpc/trigger','./rpc/cmHopperHistory','./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','initAgents','then','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','initTemplates','getZendeskAccounts','getSalesforceAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getFreshsalesAccounts','initFreshsalesAccounts'];(function(_0x3eb9a9,_0x67ee2d){var _0x4d78d1=function(_0x5e4efc){while(--_0x5e4efc){_0x3eb9a9['push'](_0x3eb9a9['shift']());}};_0x4d78d1(++_0x67ee2d);}(_0xda4b,0xdc));var _0xbda4=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xda4b[_0x4baae2];return _0x1a2285;};'use strict';var BPromise=require(_0xbda4('0x0'));var util=require('util');var moment=require(_0xbda4('0x1'));var server=require(_0xbda4('0x2'));var Realtime=require(_0xbda4('0x3'));var Report=require('./report');var Acw=require('./acw');var Trigger=require(_0xbda4('0x4'));var Dialer=require(_0xbda4('0x5'));var Preview=require(_0xbda4('0x6'));var Fax=require('./fax');var user=require(_0xbda4('0x7'));var voiceQueue=require(_0xbda4('0x8'));var voiceQueueReport=require(_0xbda4('0x9'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0xbda4('0xa'));var trigger=require(_0xbda4('0xb'));var template=require('./rpc/template');var cmHopperHistory=require(_0xbda4('0xc'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0xbda4('0xd'));var faxAccount=require(_0xbda4('0xe'));var zendesk=require(_0xbda4('0xf'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0xbda4('0x10'));var freshdesk=require(_0xbda4('0x11'));var desk=require(_0xbda4('0x12'));var zoho=require(_0xbda4('0x13'));var vtiger=require(_0xbda4('0x14'));var freshsales=require(_0xbda4('0x15'));var servicenow=require(_0xbda4('0x16'));var dynamics365=require(_0xbda4('0x17'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0xbda4('0x18'))(_0xbda4('0x19'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xbda4('0x1a')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get']('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()['then'](user['getAgents']())['then'](realtime[_0xbda4('0x1b')]())[_0xbda4('0x1c')](user['getTelephones']())[_0xbda4('0x1c')](realtime[_0xbda4('0x1d')]())[_0xbda4('0x1c')](trunk[_0xbda4('0x1e')]())[_0xbda4('0x1c')](realtime[_0xbda4('0x1f')]())[_0xbda4('0x1c')](voiceQueue[_0xbda4('0x20')]())[_0xbda4('0x1c')](realtime[_0xbda4('0x21')]())['then'](trigger[_0xbda4('0x22')]())[_0xbda4('0x1c')](realtime[_0xbda4('0x23')]())[_0xbda4('0x1c')](template['getTemplates']())['then'](realtime[_0xbda4('0x24')]())['then'](zendesk[_0xbda4('0x25')]())['then'](realtime['initZendeskAccounts']())[_0xbda4('0x1c')](salesforce[_0xbda4('0x26')]())['then'](realtime['initSalesforceAccounts']())['then'](sugarcrm['getSugarcrmAccounts']())['then'](realtime[_0xbda4('0x27')]())[_0xbda4('0x1c')](freshdesk[_0xbda4('0x28')]())[_0xbda4('0x1c')](realtime[_0xbda4('0x29')]())['then'](desk[_0xbda4('0x2a')]())[_0xbda4('0x1c')](realtime[_0xbda4('0x2b')]())[_0xbda4('0x1c')](zoho[_0xbda4('0x2c')]())[_0xbda4('0x1c')](realtime[_0xbda4('0x2d')]())[_0xbda4('0x1c')](vtiger['getVtigerAccounts']())['then'](realtime['initVtigerAccounts']())[_0xbda4('0x1c')](freshsales[_0xbda4('0x2e')]())[_0xbda4('0x1c')](realtime[_0xbda4('0x2f')]())[_0xbda4('0x1c')](servicenow['getServicenowAccounts']())[_0xbda4('0x1c')](realtime['initServicenowAccounts']())[_0xbda4('0x1c')](dynamics365[_0xbda4('0x30')]())['then'](realtime[_0xbda4('0x31')]())['then'](campaign[_0xbda4('0x32')]())[_0xbda4('0x1c')](realtime[_0xbda4('0x33')]())[_0xbda4('0x1c')](voiceExtension['getVoiceExtensions']())['then'](realtime[_0xbda4('0x34')]())[_0xbda4('0x1c')](faxAccount[_0xbda4('0x35')]())[_0xbda4('0x1c')](realtime[_0xbda4('0x36')]())['then'](function(){return realtime;});}function initParams(){return BPromise[_0xbda4('0x37')]()[_0xbda4('0x1c')](voiceQueueReport[_0xbda4('0x38')]())[_0xbda4('0x1c')](realtime[_0xbda4('0x39')]())[_0xbda4('0x1c')](cmHopperHistory[_0xbda4('0x3a')]())[_0xbda4('0x1c')](realtime['initVoiceQueueHopperHistory']())[_0xbda4('0x1c')](cmHopperHistory[_0xbda4('0x3b')]())[_0xbda4('0x1c')](realtime[_0xbda4('0x3c')]())[_0xbda4('0x1c')](voiceCallReport['getVoiceCallReports']())[_0xbda4('0x1c')](realtime[_0xbda4('0x3d')]())[_0xbda4('0x3e')](function(_0x1068f6){logger[_0xbda4('0x3f')]('[index.js][initParams]',util[_0xbda4('0x40')](_0x1068f6,{'showHidden':![],'depth':null}));});}function main(){return server[_0xbda4('0x41')](realtime,preview,fax)[_0xbda4('0x1c')](function(_0x1e4809){return initRealtime();})[_0xbda4('0x1c')](function(){return initParams();})[_0xbda4('0x1c')](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0xbda4('0x3e')](function(_0x3270fd){logger[_0xbda4('0x3f')](_0xbda4('0x42'),util['inspect'](_0x3270fd,{'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 8f3d05a..fa2adc6 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 _0x0713=['idle','inuse','talking','voiceStatusTime','toNumber','format','voiceStatusQueue','stringify','user:%s','emit','user:save','user:presence','exports','moment','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','email','accountcode','fullname','unknown','stateTime','status','address','mobile','interface','online','voiceStatus','voiceStatusCallerIdNumber','onhold','local','prototype','state','toLowerCase','not_inuse'];(function(_0x59b136,_0x36a76b){var _0x15c993=function(_0x48b403){while(--_0x48b403){_0x59b136['push'](_0x59b136['shift']());}};_0x15c993(++_0x36a76b);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var md5=require(_0x3071('0x1'));var Redis=require(_0x3071('0x2'));var config=require(_0x3071('0x3'));config[_0x3071('0x4')]=_['defaults'](config[_0x3071('0x4')],{'host':_0x3071('0x5'),'port':0x18eb});var io=require(_0x3071('0x6'))(new Redis(config[_0x3071('0x4')]));function Agent(_0xabd7b6){this['id']=_0xabd7b6['id']||0x0;this[_0x3071('0x7')]=_0xabd7b6[_0x3071('0x7')]||'';this[_0x3071('0x8')]=_0xabd7b6[_0x3071('0x8')]||'';this[_0x3071('0x9')]=_0xabd7b6[_0x3071('0x9')]||'';this[_0x3071('0xa')]=_0xabd7b6[_0x3071('0xa')]||'';this['state']=_0x3071('0xb');this[_0x3071('0xc')]=0x0;this[_0x3071('0xd')]=_0x3071('0xb');this[_0x3071('0xe')]='';this['phone']='';this[_0x3071('0xf')]='';this[_0x3071('0x10')]='';this[_0x3071('0x11')]=_0xabd7b6[_0x3071('0x11')]||![];this[_0x3071('0x12')]='unknown';this['voiceStatusTime']=0x0;this[_0x3071('0x13')]='';this['voiceStatusQueue']='';this[_0x3071('0x14')]=![];this[_0x3071('0x15')]=![];this['md5']='';}Agent[_0x3071('0x16')]['updateStatusRealtime']=function(_0x2fc15d){var _0x45c93b;if(_0x2fc15d&&_0x2fc15d[_0x3071('0x17')]){_0x45c93b=_0x2fc15d[_0x3071('0x17')][_0x3071('0x18')]();switch(_0x45c93b){case _0x3071('0x19'):_0x45c93b=_0x3071('0x1a');break;case _0x3071('0x1b'):_0x45c93b=_0x3071('0x1c');break;}}if(_0x45c93b&&this[_0x3071('0x12')]!==_0x45c93b||_0x2fc15d['statePause']){this[_0x3071('0x1d')]=_[_0x3071('0x1e')](moment()[_0x3071('0x1f')]('x'));}if(_0x45c93b){this[_0x3071('0x12')]=_0x45c93b;}var _0x3acf0e={'id':this['id'],'name':this[_0x3071('0x7')],'email':this[_0x3071('0x8')],'accountcode':this[_0x3071('0x9')],'fullname':this['fullname'],'state':this[_0x3071('0x17')],'stateTime':this[_0x3071('0xc')],'status':this[_0x3071('0xd')],'address':this['address'],'online':this[_0x3071('0x11')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x3071('0x1d')],'voiceStatusCallerIdNumber':this[_0x3071('0x13')],'voiceStatusQueue':this[_0x3071('0x20')],'interface':this[_0x3071('0x10')],'onhold':this[_0x3071('0x14')]};var _0x34c50e=md5(JSON[_0x3071('0x21')](_0x3acf0e));if(this[_0x3071('0x1')]!==_0x34c50e){this['md5']=_0x34c50e;io['to'](util['format'](_0x3071('0x22'),_0x3acf0e[_0x3071('0x7')]))[_0x3071('0x23')](_0x3071('0x24'),_0x3acf0e);io[_0x3071('0x23')](_0x3071('0x25'),_0x3acf0e);}};module[_0x3071('0x26')]=Agent; \ No newline at end of file +var _0x0713=['idle','inuse','talking','voiceStatusTime','toNumber','format','voiceStatusQueue','stringify','user:%s','emit','user:save','user:presence','exports','moment','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','email','accountcode','fullname','unknown','stateTime','status','address','mobile','interface','online','voiceStatus','voiceStatusCallerIdNumber','onhold','local','prototype','state','toLowerCase','not_inuse'];(function(_0x1c25a6,_0x3b2773){var _0x29082f=function(_0x45a95a){while(--_0x45a95a){_0x1c25a6['push'](_0x1c25a6['shift']());}};_0x29082f(++_0x3b2773);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var md5=require(_0x3071('0x1'));var Redis=require(_0x3071('0x2'));var config=require(_0x3071('0x3'));config[_0x3071('0x4')]=_['defaults'](config[_0x3071('0x4')],{'host':_0x3071('0x5'),'port':0x18eb});var io=require(_0x3071('0x6'))(new Redis(config[_0x3071('0x4')]));function Agent(_0xabd7b6){this['id']=_0xabd7b6['id']||0x0;this[_0x3071('0x7')]=_0xabd7b6[_0x3071('0x7')]||'';this[_0x3071('0x8')]=_0xabd7b6[_0x3071('0x8')]||'';this[_0x3071('0x9')]=_0xabd7b6[_0x3071('0x9')]||'';this[_0x3071('0xa')]=_0xabd7b6[_0x3071('0xa')]||'';this['state']=_0x3071('0xb');this[_0x3071('0xc')]=0x0;this[_0x3071('0xd')]=_0x3071('0xb');this[_0x3071('0xe')]='';this['phone']='';this[_0x3071('0xf')]='';this[_0x3071('0x10')]='';this[_0x3071('0x11')]=_0xabd7b6[_0x3071('0x11')]||![];this[_0x3071('0x12')]='unknown';this['voiceStatusTime']=0x0;this[_0x3071('0x13')]='';this['voiceStatusQueue']='';this[_0x3071('0x14')]=![];this[_0x3071('0x15')]=![];this['md5']='';}Agent[_0x3071('0x16')]['updateStatusRealtime']=function(_0x2fc15d){var _0x45c93b;if(_0x2fc15d&&_0x2fc15d[_0x3071('0x17')]){_0x45c93b=_0x2fc15d[_0x3071('0x17')][_0x3071('0x18')]();switch(_0x45c93b){case _0x3071('0x19'):_0x45c93b=_0x3071('0x1a');break;case _0x3071('0x1b'):_0x45c93b=_0x3071('0x1c');break;}}if(_0x45c93b&&this[_0x3071('0x12')]!==_0x45c93b||_0x2fc15d['statePause']){this[_0x3071('0x1d')]=_[_0x3071('0x1e')](moment()[_0x3071('0x1f')]('x'));}if(_0x45c93b){this[_0x3071('0x12')]=_0x45c93b;}var _0x3acf0e={'id':this['id'],'name':this[_0x3071('0x7')],'email':this[_0x3071('0x8')],'accountcode':this[_0x3071('0x9')],'fullname':this['fullname'],'state':this[_0x3071('0x17')],'stateTime':this[_0x3071('0xc')],'status':this[_0x3071('0xd')],'address':this['address'],'online':this[_0x3071('0x11')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x3071('0x1d')],'voiceStatusCallerIdNumber':this[_0x3071('0x13')],'voiceStatusQueue':this[_0x3071('0x20')],'interface':this[_0x3071('0x10')],'onhold':this[_0x3071('0x14')]};var _0x34c50e=md5(JSON[_0x3071('0x21')](_0x3acf0e));if(this[_0x3071('0x1')]!==_0x34c50e){this['md5']=_0x34c50e;io['to'](util['format'](_0x3071('0x22'),_0x3acf0e[_0x3071('0x7')]))[_0x3071('0x23')](_0x3071('0x24'),_0x3acf0e);io[_0x3071('0x23')](_0x3071('0x25'),_0x3acf0e);}};module[_0x3071('0x26')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 35c606d..6dbfabd 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 _0xd1b6=['dialBusyRetryFrequency','dialNoAnswerMaxRetry','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','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','originated','temp','ivrTotalCallsDays','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry'];(function(_0x103c4c,_0x285348){var _0x3fc15e=function(_0x40e0e6){while(--_0x40e0e6){_0x103c4c['push'](_0x103c4c['shift']());}};_0x3fc15e(++_0x285348);}(_0xd1b6,0xb4));var _0x6d1b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd1b6[_0x3dd15e];return _0x231fd0;};'use strict';function Campaign(_0x4062ff){this['id']=_0x4062ff['id']||0x0;this[_0x6d1b('0x0')]=_0x4062ff[_0x6d1b('0x0')]||'';this['type']=_0x4062ff[_0x6d1b('0x1')]||'campaign';this[_0x6d1b('0x2')]=0x0;this[_0x6d1b('0x3')]=0x0;this['ivrAnswerCallsDay']=0x0;this[_0x6d1b('0x4')]=0x0;this['message']='';this[_0x6d1b('0x5')]=!![];this[_0x6d1b('0x6')]=_0x4062ff[_0x6d1b('0x6')];this[_0x6d1b('0x7')]=_0x4062ff[_0x6d1b('0x7')];this[_0x6d1b('0x8')]=_0x4062ff['dialTimezone']||null;this[_0x6d1b('0x9')]=_0x4062ff['dialGlobalInterval']?_0x4062ff[_0x6d1b('0x9')]:null;this[_0x6d1b('0xa')]=_0x4062ff['dialOriginateCallerIdName'];this[_0x6d1b('0xb')]=_0x4062ff[_0x6d1b('0xb')];this['dialOriginateTimeout']=_0x4062ff[_0x6d1b('0xc')]||0x1e;this[_0x6d1b('0xd')]=_0x4062ff[_0x6d1b('0xd')];this['dialCongestionRetryFrequency']=_0x4062ff[_0x6d1b('0xe')];this[_0x6d1b('0xf')]=_0x4062ff[_0x6d1b('0xf')];this[_0x6d1b('0x10')]=_0x4062ff[_0x6d1b('0x10')];this[_0x6d1b('0x11')]=_0x4062ff['dialNoAnswerMaxRetry'];this['dialNoAnswerRetryFrequency']=_0x4062ff['dialNoAnswerRetryFrequency'];this[_0x6d1b('0x12')]=_0x4062ff[_0x6d1b('0x12')];this[_0x6d1b('0x13')]=_0x4062ff[_0x6d1b('0x13')]||0x3;this[_0x6d1b('0x14')]=_0x4062ff['dialNoSuchNumberRetryFrequency']||0x96;this[_0x6d1b('0x15')]=_0x4062ff[_0x6d1b('0x15')]||0x3;this['dialDropRetryFrequency']=_0x4062ff[_0x6d1b('0x16')]||0x96;this[_0x6d1b('0x17')]=_0x4062ff[_0x6d1b('0x17')]||0x3;this[_0x6d1b('0x18')]=_0x4062ff['dialAbandonedRetryFrequency']||0x96;this['dialMachineMaxRetry']=_0x4062ff[_0x6d1b('0x19')]||0x3;this[_0x6d1b('0x1a')]=_0x4062ff[_0x6d1b('0x1a')]||0x96;this[_0x6d1b('0x1b')]=_0x4062ff[_0x6d1b('0x1b')]||0x3;this[_0x6d1b('0x1c')]=_0x4062ff['dialAgentRejectRetryFrequency']||0x96;this[_0x6d1b('0x1d')]=_0x4062ff[_0x6d1b('0x1d')]||_0x6d1b('0x1e');this['dialPrefix']=_0x4062ff[_0x6d1b('0x1f')]||undefined;this[_0x6d1b('0x20')]=_0x4062ff[_0x6d1b('0x20')]||undefined;this[_0x6d1b('0x21')]=_0x4062ff[_0x6d1b('0x21')]||undefined;this['TrunkBackup']=_0x4062ff[_0x6d1b('0x22')]?_0x4062ff[_0x6d1b('0x22')]:undefined;this[_0x6d1b('0x23')]=_0x4062ff['Trunk']?_0x4062ff['Trunk']:undefined;this[_0x6d1b('0x24')]=_0x4062ff[_0x6d1b('0x24')]?_0x4062ff['Interval']:undefined;this[_0x6d1b('0x25')]=_0x4062ff[_0x6d1b('0x25')]?_0x4062ff[_0x6d1b('0x25')]:undefined;this[_0x6d1b('0x26')]=_0x4062ff[_0x6d1b('0x25')]?_0x4062ff['SquareProject'][_0x6d1b('0x0')]:undefined;this[_0x6d1b('0x27')]=_0x4062ff[_0x6d1b('0x27')]||![];this['dialAMDInitialSilence']=_0x4062ff[_0x6d1b('0x28')];this[_0x6d1b('0x29')]=_0x4062ff[_0x6d1b('0x29')];this[_0x6d1b('0x2a')]=_0x4062ff[_0x6d1b('0x2a')];this[_0x6d1b('0x2b')]=_0x4062ff['dialAMDTotalAnalysisTime'];this[_0x6d1b('0x2c')]=_0x4062ff[_0x6d1b('0x2c')];this['dialAMDBetweenWordsSilence']=_0x4062ff['dialAMDBetweenWordsSilence'];this[_0x6d1b('0x2d')]=_0x4062ff['dialAMDMaximumNumberOfWords'];this[_0x6d1b('0x2e')]=_0x4062ff['dialAMDSilenceThreshold'];this[_0x6d1b('0x2f')]=_0x4062ff['dialAMDMaximumWordLength'];}module[_0x6d1b('0x30')]=Campaign; \ No newline at end of file +var _0x5814=['dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry'];(function(_0x4fe5b5,_0x41efab){var _0x221fbe=function(_0x35fd94){while(--_0x35fd94){_0x4fe5b5['push'](_0x4fe5b5['shift']());}};_0x221fbe(++_0x41efab);}(_0x5814,0x1e8));var _0x4581=function(_0xda8087,_0x15b064){_0xda8087=_0xda8087-0x0;var _0x2756d4=_0x5814[_0xda8087];return _0x2756d4;};'use strict';function Campaign(_0x376947){this['id']=_0x376947['id']||0x0;this[_0x4581('0x0')]=_0x376947[_0x4581('0x0')]||'';this[_0x4581('0x1')]=_0x376947[_0x4581('0x1')]||_0x4581('0x2');this['originated']=0x0;this[_0x4581('0x3')]=0x0;this[_0x4581('0x4')]=0x0;this[_0x4581('0x5')]=0x0;this[_0x4581('0x6')]='';this[_0x4581('0x7')]=!![];this[_0x4581('0x8')]=_0x376947[_0x4581('0x8')];this[_0x4581('0x9')]=_0x376947['limitCalls'];this[_0x4581('0xa')]=_0x376947[_0x4581('0xa')]||null;this[_0x4581('0xb')]=_0x376947[_0x4581('0xb')]?_0x376947[_0x4581('0xb')]:null;this[_0x4581('0xc')]=_0x376947[_0x4581('0xc')];this[_0x4581('0xd')]=_0x376947[_0x4581('0xd')];this[_0x4581('0xe')]=_0x376947[_0x4581('0xe')]||0x1e;this[_0x4581('0xf')]=_0x376947[_0x4581('0xf')];this[_0x4581('0x10')]=_0x376947[_0x4581('0x10')];this[_0x4581('0x11')]=_0x376947['dialBusyMaxRetry'];this[_0x4581('0x12')]=_0x376947[_0x4581('0x12')];this['dialNoAnswerMaxRetry']=_0x376947[_0x4581('0x13')];this[_0x4581('0x14')]=_0x376947[_0x4581('0x14')];this[_0x4581('0x15')]=_0x376947[_0x4581('0x15')];this[_0x4581('0x16')]=_0x376947[_0x4581('0x16')]||0x3;this[_0x4581('0x17')]=_0x376947[_0x4581('0x17')]||0x96;this[_0x4581('0x18')]=_0x376947[_0x4581('0x18')]||0x3;this[_0x4581('0x19')]=_0x376947[_0x4581('0x19')]||0x96;this[_0x4581('0x1a')]=_0x376947['dialAbandonedMaxRetry']||0x3;this[_0x4581('0x1b')]=_0x376947['dialAbandonedRetryFrequency']||0x96;this[_0x4581('0x1c')]=_0x376947[_0x4581('0x1c')]||0x3;this['dialMachineRetryFrequency']=_0x376947[_0x4581('0x1d')]||0x96;this[_0x4581('0x1e')]=_0x376947[_0x4581('0x1e')]||0x3;this[_0x4581('0x1f')]=_0x376947['dialAgentRejectRetryFrequency']||0x96;this[_0x4581('0x20')]=_0x376947[_0x4581('0x20')]||_0x4581('0x21');this['dialPrefix']=_0x376947[_0x4581('0x22')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x376947[_0x4581('0x23')]||undefined;this[_0x4581('0x24')]=_0x376947[_0x4581('0x24')]||undefined;this[_0x4581('0x25')]=_0x376947[_0x4581('0x25')]?_0x376947[_0x4581('0x25')]:undefined;this[_0x4581('0x26')]=_0x376947[_0x4581('0x26')]?_0x376947[_0x4581('0x26')]:undefined;this['Interval']=_0x376947[_0x4581('0x27')]?_0x376947[_0x4581('0x27')]:undefined;this['SquareProject']=_0x376947[_0x4581('0x28')]?_0x376947[_0x4581('0x28')]:undefined;this['dialQueueProject']=_0x376947[_0x4581('0x28')]?_0x376947[_0x4581('0x28')][_0x4581('0x0')]:undefined;this[_0x4581('0x29')]=_0x376947[_0x4581('0x29')]||![];this[_0x4581('0x2a')]=_0x376947[_0x4581('0x2a')];this[_0x4581('0x2b')]=_0x376947[_0x4581('0x2b')];this['dialAMDAfterGreetingSilence']=_0x376947[_0x4581('0x2c')];this[_0x4581('0x2d')]=_0x376947['dialAMDTotalAnalysisTime'];this[_0x4581('0x2e')]=_0x376947[_0x4581('0x2e')];this['dialAMDBetweenWordsSilence']=_0x376947['dialAMDBetweenWordsSilence'];this[_0x4581('0x2f')]=_0x376947[_0x4581('0x2f')];this[_0x4581('0x30')]=_0x376947['dialAMDSilenceThreshold'];this[_0x4581('0x31')]=_0x376947[_0x4581('0x31')];}module[_0x4581('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 5a59adf..162910d 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 _0x3264=['lastapplication','lastdata','duration','billableseconds','holdtime','disposition','monitor','monitorFilename','queue','transferconnectedlinenum','mohtime','exports','channel','destinationchannel','calleridnum','calleridname','accountcode','linkedid','exten','answered','answertime','unmanaged','abandoned'];(function(_0x1c1a0e,_0x4b070e){var _0x14f996=function(_0x484653){while(--_0x484653){_0x1c1a0e['push'](_0x1c1a0e['shift']());}};_0x14f996(++_0x4b070e);}(_0x3264,0x7f));var _0x4326=function(_0x2261ce,_0x9ed8b6){_0x2261ce=_0x2261ce-0x0;var _0x524640=_0x3264[_0x2261ce];return _0x524640;};'use strict';function Channel(){this['starttime']=null;this[_0x4326('0x0')]='';this[_0x4326('0x1')]='';this[_0x4326('0x2')]=0x0;this[_0x4326('0x3')]='';this['connectedlinenum']=undefined;this['connectedlinename']=undefined;this[_0x4326('0x4')]=0x0;this['context']='';this['uniqueid']=0x0;this[_0x4326('0x5')]=0x0;this[_0x4326('0x6')]=0x0;this[_0x4326('0x7')]=![];this[_0x4326('0x8')]=null;this['endtime']=null;this[_0x4326('0x9')]=![];this[_0x4326('0xa')]=![];this[_0x4326('0xb')]='';this[_0x4326('0xc')]='';this[_0x4326('0xd')]=0x0;this[_0x4326('0xe')]=0x0;this[_0x4326('0xf')]=0x0;this['type']=null;this['tag']=null;this[_0x4326('0x10')]=null;this[_0x4326('0x11')]=![];this[_0x4326('0x12')]=null;this[_0x4326('0x13')]=null;this['monitors']=[];this['transfercalleridnum']=undefined;this[_0x4326('0x14')]=undefined;this['transferType']=undefined;this[_0x4326('0x15')]=0x0;}module[_0x4326('0x16')]=Channel; \ No newline at end of file +var _0x4547=['disposition','monitor','monitorFilename','queue','monitors','transferconnectedlinenum','transferType','mohtime','starttime','channel','calleridnum','calleridname','connectedlinename','accountcode','context','uniqueid','linkedid','exten','answered','endtime','abandoned','lastdata','billableseconds','holdtime','tag'];(function(_0x419550,_0x15cdf1){var _0x55f9ef=function(_0x44f707){while(--_0x44f707){_0x419550['push'](_0x419550['shift']());}};_0x55f9ef(++_0x15cdf1);}(_0x4547,0x11b));var _0x7454=function(_0x2bda14,_0x4fab1b){_0x2bda14=_0x2bda14-0x0;var _0xb5dd49=_0x4547[_0x2bda14];return _0xb5dd49;};'use strict';function Channel(){this[_0x7454('0x0')]=null;this[_0x7454('0x1')]='';this['destinationchannel']='';this[_0x7454('0x2')]=0x0;this[_0x7454('0x3')]='';this['connectedlinenum']=undefined;this[_0x7454('0x4')]=undefined;this[_0x7454('0x5')]=0x0;this[_0x7454('0x6')]='';this[_0x7454('0x7')]=0x0;this[_0x7454('0x8')]=0x0;this[_0x7454('0x9')]=0x0;this[_0x7454('0xa')]=![];this['answertime']=null;this[_0x7454('0xb')]=null;this['unmanaged']=![];this[_0x7454('0xc')]=![];this['lastapplication']='';this[_0x7454('0xd')]='';this['duration']=0x0;this[_0x7454('0xe')]=0x0;this[_0x7454('0xf')]=0x0;this['type']=null;this[_0x7454('0x10')]=null;this[_0x7454('0x11')]=null;this[_0x7454('0x12')]=![];this[_0x7454('0x13')]=null;this[_0x7454('0x14')]=null;this[_0x7454('0x15')]=[];this['transfercalleridnum']=undefined;this[_0x7454('0x16')]=undefined;this[_0x7454('0x17')]=undefined;this[_0x7454('0x18')]=0x0;}module['exports']=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index c677d5c..023eecb 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 _0xa501=['Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl'];(function(_0x4dba04,_0x4a4987){var _0x5d6f61=function(_0x128619){while(--_0x128619){_0x4dba04['push'](_0x4dba04['shift']());}};_0x5d6f61(++_0x4a4987);}(_0xa501,0x13a));var _0x1a50=function(_0x5e66c2,_0x3a3783){_0x5e66c2=_0x5e66c2-0x0;var _0x322e0d=_0xa501[_0x5e66c2];return _0x322e0d;};'use strict';function DeskAccount(_0x399f74){this['id']=_0x399f74['id']||0x0;this[_0x1a50('0x0')]=_0x399f74[_0x1a50('0x0')]||'';this[_0x1a50('0x1')]=_0x399f74[_0x1a50('0x1')]||'';this[_0x1a50('0x2')]=_0x399f74[_0x1a50('0x2')]||'';this['authType']=_0x399f74[_0x1a50('0x3')]||'';this[_0x1a50('0x4')]=_0x399f74[_0x1a50('0x4')]||'';this['consumerKey']=_0x399f74[_0x1a50('0x5')]||'';this[_0x1a50('0x6')]=_0x399f74['consumerSecret']||'';this['token']=_0x399f74[_0x1a50('0x7')]||'';this['tokenSecret']=_0x399f74[_0x1a50('0x8')]||'';this[_0x1a50('0x9')]=_0x399f74[_0x1a50('0x9')]||'';this[_0x1a50('0xa')]=_0x399f74[_0x1a50('0xa')]||'';this[_0x1a50('0xb')]=_0x399f74[_0x1a50('0xb')]||{};}module[_0x1a50('0xc')]=DeskAccount; \ No newline at end of file +var _0xe1a8=['type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerSecret','token'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xe1a8,0xeb));var _0x8e1a=function(_0x427b93,_0x364364){_0x427b93=_0x427b93-0x0;var _0x5416c3=_0xe1a8[_0x427b93];return _0x5416c3;};'use strict';function DeskAccount(_0x57fa1d){this['id']=_0x57fa1d['id']||0x0;this[_0x8e1a('0x0')]=_0x57fa1d['name']||'';this[_0x8e1a('0x1')]=_0x57fa1d[_0x8e1a('0x1')]||'';this[_0x8e1a('0x2')]=_0x57fa1d[_0x8e1a('0x2')]||'';this['authType']=_0x57fa1d[_0x8e1a('0x3')]||'';this[_0x8e1a('0x4')]=_0x57fa1d['password']||'';this['consumerKey']=_0x57fa1d['consumerKey']||'';this[_0x8e1a('0x5')]=_0x57fa1d[_0x8e1a('0x5')]||'';this['token']=_0x57fa1d[_0x8e1a('0x6')]||'';this['tokenSecret']=_0x57fa1d['tokenSecret']||'';this['type']=_0x57fa1d[_0x8e1a('0x7')]||'';this['serverUrl']=_0x57fa1d[_0x8e1a('0x8')]||'';this[_0x8e1a('0x9')]=_0x57fa1d[_0x8e1a('0x9')]||{};}module[_0x8e1a('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 0ae5e26..816e960 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 _0xa9e0=['clientSecret','serverUrl','Configurations','name','password','remoteUri','tenantId','clientId'];(function(_0xc3c429,_0x5903f3){var _0x3d3670=function(_0x52501a){while(--_0x52501a){_0xc3c429['push'](_0xc3c429['shift']());}};_0x3d3670(++_0x5903f3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'use strict';function Dynamics365Account(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['username']=_0x1f0015['username']||'';this[_0x0a9e('0x1')]=_0x1f0015['password']||'';this[_0x0a9e('0x2')]=_0x1f0015[_0x0a9e('0x2')]||'';this[_0x0a9e('0x3')]=_0x1f0015[_0x0a9e('0x3')]||'';this[_0x0a9e('0x4')]=_0x1f0015['clientId']||'';this[_0x0a9e('0x5')]=_0x1f0015[_0x0a9e('0x5')]||{};this[_0x0a9e('0x6')]=_0x1f0015['serverUrl']||'';this['Configurations']=_0x1f0015[_0x0a9e('0x7')]||{};}module['exports']=Dynamics365Account; \ No newline at end of file +var _0xb688=['remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations','exports','name','username','password'];(function(_0x4737d1,_0x3ef02c){var _0x9a5736=function(_0x3fdf0){while(--_0x3fdf0){_0x4737d1['push'](_0x4737d1['shift']());}};_0x9a5736(++_0x3ef02c);}(_0xb688,0xcf));var _0x8b68=function(_0x10962b,_0x54ac3d){_0x10962b=_0x10962b-0x0;var _0x3c28f8=_0xb688[_0x10962b];return _0x3c28f8;};'use strict';function Dynamics365Account(_0x185590){this['id']=_0x185590['id']||0x0;this[_0x8b68('0x0')]=_0x185590[_0x8b68('0x0')]||'';this[_0x8b68('0x1')]=_0x185590[_0x8b68('0x1')]||'';this[_0x8b68('0x2')]=_0x185590[_0x8b68('0x2')]||'';this['remoteUri']=_0x185590[_0x8b68('0x3')]||'';this[_0x8b68('0x4')]=_0x185590[_0x8b68('0x4')]||'';this[_0x8b68('0x5')]=_0x185590['clientId']||'';this[_0x8b68('0x6')]=_0x185590['clientSecret']||{};this[_0x8b68('0x7')]=_0x185590[_0x8b68('0x7')]||'';this[_0x8b68('0x8')]=_0x185590[_0x8b68('0x8')]||{};}module[_0x8b68('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 a7b56d2..d23226c 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 _0xa363=['gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','maxrate','modem','v17,v27,v29'];(function(_0x415242,_0x7806ef){var _0x49bb9b=function(_0x27ba20){while(--_0x27ba20){_0x415242['push'](_0x415242['shift']());}};_0x49bb9b(++_0x7806ef);}(_0xa363,0x1e5));var _0x3a36=function(_0x35a470,_0x1820a1){_0x35a470=_0x35a470-0x0;var _0x7349ff=_0xa363[_0x35a470];return _0x7349ff;};'use strict';function FaxAccount(_0xa2e3a5){this['id']=_0xa2e3a5['id']||0x0;this['name']=_0xa2e3a5[_0x3a36('0x0')]||'';this[_0x3a36('0x1')]=_0xa2e3a5[_0x3a36('0x1')];this[_0x3a36('0x2')]=_0xa2e3a5['ecm'];this[_0x3a36('0x3')]=_0xa2e3a5[_0x3a36('0x3')];this[_0x3a36('0x4')]=_0xa2e3a5['localstationid'];this['minrate']=_0xa2e3a5['minrate']||0x960;this['maxrate']=_0xa2e3a5[_0x3a36('0x5')]||0x3840;this['modem']=_0xa2e3a5[_0x3a36('0x6')]||_0x3a36('0x7');this[_0x3a36('0x8')]=_0xa2e3a5[_0x3a36('0x8')]||'no';this[_0x3a36('0x9')]=_0xa2e3a5[_0x3a36('0x9')]||'no';this[_0x3a36('0xa')]=_0xa2e3a5['t38timeout']||0x1388;this[_0x3a36('0xb')]=_0xa2e3a5['tech']||_0x3a36('0xc');this['Trunk']=_0xa2e3a5[_0x3a36('0xd')]?_0xa2e3a5[_0x3a36('0xd')]:undefined;this[_0x3a36('0xe')]=_0xa2e3a5[_0x3a36('0xe')];this[_0x3a36('0xf')]=_0xa2e3a5[_0x3a36('0xf')];}module[_0x3a36('0x10')]=FaxAccount; \ No newline at end of file +var _0xd30b=['gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29'];(function(_0x46e182,_0x1046a8){var _0x42ade0=function(_0xb5288f){while(--_0xb5288f){_0x46e182['push'](_0x46e182['shift']());}};_0x42ade0(++_0x1046a8);}(_0xd30b,0x99));var _0xbd30=function(_0x403c20,_0x4a7b99){_0x403c20=_0x403c20-0x0;var _0x2b271a=_0xd30b[_0x403c20];return _0x2b271a;};'use strict';function FaxAccount(_0x5d254a){this['id']=_0x5d254a['id']||0x0;this['name']=_0x5d254a[_0xbd30('0x0')]||'';this['description']=_0x5d254a[_0xbd30('0x1')];this[_0xbd30('0x2')]=_0x5d254a[_0xbd30('0x2')];this[_0xbd30('0x3')]=_0x5d254a[_0xbd30('0x3')];this[_0xbd30('0x4')]=_0x5d254a[_0xbd30('0x4')];this[_0xbd30('0x5')]=_0x5d254a[_0xbd30('0x5')]||0x960;this[_0xbd30('0x6')]=_0x5d254a[_0xbd30('0x6')]||0x3840;this[_0xbd30('0x7')]=_0x5d254a[_0xbd30('0x7')]||_0xbd30('0x8');this[_0xbd30('0x9')]=_0x5d254a[_0xbd30('0x9')]||'no';this[_0xbd30('0xa')]=_0x5d254a[_0xbd30('0xa')]||'no';this[_0xbd30('0xb')]=_0x5d254a[_0xbd30('0xb')]||0x1388;this[_0xbd30('0xc')]=_0x5d254a[_0xbd30('0xc')]||_0xbd30('0xd');this[_0xbd30('0xe')]=_0x5d254a['Trunk']?_0x5d254a['Trunk']:undefined;this[_0xbd30('0xf')]=_0x5d254a[_0xbd30('0xf')];this[_0xbd30('0x10')]=_0x5d254a['key'];}module[_0xbd30('0x11')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 67f11b9..7241009 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 _0x6e09=['token','remoteUri','serverUrl','Configurations','exports','name','username','apiKey'];(function(_0x300fa4,_0x4758df){var _0x4c352b=function(_0x26ed31){while(--_0x26ed31){_0x300fa4['push'](_0x300fa4['shift']());}};_0x4c352b(++_0x4758df);}(_0x6e09,0x1ad));var _0x96e0=function(_0x2c61a2,_0x40fe37){_0x2c61a2=_0x2c61a2-0x0;var _0x28bf7c=_0x6e09[_0x2c61a2];return _0x28bf7c;};'use strict';function FreshdeskAccount(_0x354005){this['id']=_0x354005['id']||0x0;this['name']=_0x354005[_0x96e0('0x0')]||'';this[_0x96e0('0x1')]=_0x354005['username']||'';this[_0x96e0('0x2')]=_0x354005[_0x96e0('0x3')]||'';this[_0x96e0('0x4')]=_0x354005['remoteUri']||'';this[_0x96e0('0x5')]=_0x354005[_0x96e0('0x5')]||'';this[_0x96e0('0x6')]=_0x354005[_0x96e0('0x6')]||{};}module[_0x96e0('0x7')]=FreshdeskAccount; \ No newline at end of file +var _0xa650=['exports','name','apiKey','token','remoteUri','serverUrl','Configurations'];(function(_0x1088a7,_0xc0e1f3){var _0x9caaad=function(_0x3d37d8){while(--_0x3d37d8){_0x1088a7['push'](_0x1088a7['shift']());}};_0x9caaad(++_0xc0e1f3);}(_0xa650,0x190));var _0x0a65=function(_0x13b81d,_0x3d71a8){_0x13b81d=_0x13b81d-0x0;var _0x2de98a=_0xa650[_0x13b81d];return _0x2de98a;};'use strict';function FreshdeskAccount(_0x386660){this['id']=_0x386660['id']||0x0;this[_0x0a65('0x0')]=_0x386660[_0x0a65('0x0')]||'';this['username']=_0x386660['username']||'';this[_0x0a65('0x1')]=_0x386660[_0x0a65('0x2')]||'';this[_0x0a65('0x3')]=_0x386660[_0x0a65('0x3')]||'';this[_0x0a65('0x4')]=_0x386660['serverUrl']||'';this[_0x0a65('0x5')]=_0x386660[_0x0a65('0x5')]||{};}module[_0x0a65('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 7d4e314..c1d0262 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 _0x539d=['exports','name','username','token','remoteUri','serverUrl','Configurations'];(function(_0x5dbeab,_0x5a482f){var _0x223051=function(_0x550265){while(--_0x550265){_0x5dbeab['push'](_0x5dbeab['shift']());}};_0x223051(++_0x5a482f);}(_0x539d,0x17b));var _0xd539=function(_0x368587,_0x1b6554){_0x368587=_0x368587-0x0;var _0x42d33c=_0x539d[_0x368587];return _0x42d33c;};'use strict';function FreshsalesAccount(_0x2df0ff){this['id']=_0x2df0ff['id']||0x0;this['name']=_0x2df0ff[_0xd539('0x0')]||'';this[_0xd539('0x1')]=_0x2df0ff['username']||'';this['apiKey']=_0x2df0ff[_0xd539('0x2')]||'';this[_0xd539('0x3')]=_0x2df0ff[_0xd539('0x3')]||'';this[_0xd539('0x4')]=_0x2df0ff[_0xd539('0x4')]||'';this['Configurations']=_0x2df0ff[_0xd539('0x5')]||{};}module[_0xd539('0x6')]=FreshsalesAccount; \ No newline at end of file +var _0x8a28=['token','remoteUri','serverUrl','Configurations','exports','name','username','apiKey'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x8a28,0xfd));var _0x88a2=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x8a28[_0x5bd426];return _0x23a7eb;};'use strict';function FreshsalesAccount(_0x1baa5e){this['id']=_0x1baa5e['id']||0x0;this[_0x88a2('0x0')]=_0x1baa5e[_0x88a2('0x0')]||'';this[_0x88a2('0x1')]=_0x1baa5e[_0x88a2('0x1')]||'';this[_0x88a2('0x2')]=_0x1baa5e[_0x88a2('0x3')]||'';this[_0x88a2('0x4')]=_0x1baa5e['remoteUri']||'';this[_0x88a2('0x5')]=_0x1baa5e[_0x88a2('0x5')]||'';this[_0x88a2('0x6')]=_0x1baa5e[_0x88a2('0x6')]||{};}module[_0x88a2('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 e9921a0..b441f0c 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 _0x6246=['assigned','motionChannel','mohtime','variables','exports','inbound','calleridname','queue','queuecallerjoinAt','position','count','queuecallerabandonAt','queuecallercomplete','queuecallerexit','queuecallerexitAt','originalposition','channel','context','priority'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x6246,0x181));var _0x6624=function(_0x1ed671,_0x67b18c){_0x1ed671=_0x1ed671-0x0;var _0x31b2d5=_0x6246[_0x1ed671];return _0x31b2d5;};'use strict';function QueueReport(){this['type']=_0x6624('0x0');this['uniqueid']='';this['calleridnum']='';this[_0x6624('0x1')]='';this[_0x6624('0x2')]='';this[_0x6624('0x3')]=null;this['queuecallerleaveAt']=null;this[_0x6624('0x4')]=0x1;this[_0x6624('0x5')]=0x1;this['queuecallerabandon']=![];this[_0x6624('0x6')]=null;this[_0x6624('0x7')]=![];this['queuecallercompleteAt']=null;this[_0x6624('0x8')]=![];this[_0x6624('0x9')]=null;this[_0x6624('0xa')]=0x1;this[_0x6624('0xb')]='';this['connectedlinenum']='';this['connectedlinename']='';this['accountcode']='';this[_0x6624('0xc')]='';this['exten']='';this[_0x6624('0xd')]='';this['holdtime']=0x0;this[_0x6624('0xe')]=![];this['lastAssignedTo']='';this[_0x6624('0xf')]='voice';this[_0x6624('0x10')]=0x0;this[_0x6624('0x11')]={};}module[_0x6624('0x12')]=QueueReport; \ No newline at end of file +var _0xb597=['queuecallerexit','originalposition','channel','connectedlinenum','connectedlinename','accountcode','context','assigned','motionChannel','mohtime','exports','type','inbound','uniqueid','calleridname','queue','queuecallerleaveAt','queuecallerabandonAt'];(function(_0x5e0005,_0x510d7d){var _0x9421f8=function(_0x56a9f3){while(--_0x56a9f3){_0x5e0005['push'](_0x5e0005['shift']());}};_0x9421f8(++_0x510d7d);}(_0xb597,0x77));var _0x7b59=function(_0x34e51c,_0x1f46b0){_0x34e51c=_0x34e51c-0x0;var _0x31643c=_0xb597[_0x34e51c];return _0x31643c;};'use strict';function QueueReport(){this[_0x7b59('0x0')]=_0x7b59('0x1');this[_0x7b59('0x2')]='';this['calleridnum']='';this[_0x7b59('0x3')]='';this[_0x7b59('0x4')]='';this['queuecallerjoinAt']=null;this[_0x7b59('0x5')]=null;this['position']=0x1;this['count']=0x1;this['queuecallerabandon']=![];this[_0x7b59('0x6')]=null;this['queuecallercomplete']=![];this['queuecallercompleteAt']=null;this[_0x7b59('0x7')]=![];this['queuecallerexitAt']=null;this[_0x7b59('0x8')]=0x1;this[_0x7b59('0x9')]='';this[_0x7b59('0xa')]='';this[_0x7b59('0xb')]='';this[_0x7b59('0xc')]='';this[_0x7b59('0xd')]='';this['exten']='';this['priority']='';this['holdtime']=0x0;this[_0x7b59('0xe')]=![];this['lastAssignedTo']='';this[_0x7b59('0xf')]='voice';this[_0x7b59('0x10')]=0x0;this['variables']={};}module[_0x7b59('0x11')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 1415949..1e67016 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 _0x8fc9=['Configurations','exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab'];(function(_0x1992f1,_0x5c61f0){var _0x413dfe=function(_0x2136e5){while(--_0x2136e5){_0x1992f1['push'](_0x1992f1['shift']());}};_0x413dfe(++_0x5c61f0);}(_0x8fc9,0xde));var _0x98fc=function(_0x874cf1,_0x2a4954){_0x874cf1=_0x874cf1-0x0;var _0x233579=_0x8fc9[_0x874cf1];return _0x233579;};'use strict';function SalesforceAccount(_0x2cdcfc){this['id']=_0x2cdcfc['id']||0x0;this['name']=_0x2cdcfc[_0x98fc('0x0')]||'';this[_0x98fc('0x1')]=_0x2cdcfc['username']||'';this[_0x98fc('0x2')]=_0x2cdcfc[_0x98fc('0x2')]||'';this[_0x98fc('0x3')]=_0x2cdcfc[_0x98fc('0x3')]||'';this['clientId']=_0x2cdcfc[_0x98fc('0x4')]||'';this[_0x98fc('0x5')]=_0x2cdcfc[_0x98fc('0x5')]||'';this[_0x98fc('0x6')]=_0x2cdcfc[_0x98fc('0x6')]||'';this[_0x98fc('0x7')]=_0x2cdcfc[_0x98fc('0x7')]||_0x98fc('0x8');this['serverUrl']=_0x2cdcfc['serverUrl']||'';this[_0x98fc('0x9')]=_0x2cdcfc[_0x98fc('0x9')]||{};}module[_0x98fc('0xa')]=SalesforceAccount; \ No newline at end of file +var _0xe5bb=['remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username'];(function(_0x2bca2d,_0x1d20f7){var _0x287d69=function(_0x25665e){while(--_0x25665e){_0x2bca2d['push'](_0x2bca2d['shift']());}};_0x287d69(++_0x1d20f7);}(_0xe5bb,0x166));var _0xbe5b=function(_0x4213d7,_0x38aed0){_0x4213d7=_0x4213d7-0x0;var _0x22843a=_0xe5bb[_0x4213d7];return _0x22843a;};'use strict';function SalesforceAccount(_0x5bcafb){this['id']=_0x5bcafb['id']||0x0;this[_0xbe5b('0x0')]=_0x5bcafb['name']||'';this[_0xbe5b('0x1')]=_0x5bcafb[_0xbe5b('0x1')]||'';this[_0xbe5b('0x2')]=_0x5bcafb[_0xbe5b('0x2')]||'';this['password']=_0x5bcafb[_0xbe5b('0x3')]||'';this[_0xbe5b('0x4')]=_0x5bcafb[_0xbe5b('0x4')]||'';this[_0xbe5b('0x5')]=_0x5bcafb['clientSecret']||'';this[_0xbe5b('0x6')]=_0x5bcafb[_0xbe5b('0x6')]||'';this[_0xbe5b('0x7')]=_0x5bcafb[_0xbe5b('0x7')]||_0xbe5b('0x8');this[_0xbe5b('0x9')]=_0x5bcafb['serverUrl']||'';this[_0xbe5b('0xa')]=_0x5bcafb[_0xbe5b('0xa')]||{};}module[_0xbe5b('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 61609bf..9305309 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 _0x3cdd=['password','remoteUri','serverUrl','exports','name','username'];(function(_0x57ff59,_0x4b9327){var _0x58e63f=function(_0x3b1072){while(--_0x3b1072){_0x57ff59['push'](_0x57ff59['shift']());}};_0x58e63f(++_0x4b9327);}(_0x3cdd,0x16c));var _0xd3cd=function(_0x77989a,_0x5eed53){_0x77989a=_0x77989a-0x0;var _0x551469=_0x3cdd[_0x77989a];return _0x551469;};'use strict';function ServicenowAccount(_0x2d0bcc){this['id']=_0x2d0bcc['id']||0x0;this[_0xd3cd('0x0')]=_0x2d0bcc[_0xd3cd('0x0')]||'';this[_0xd3cd('0x1')]=_0x2d0bcc[_0xd3cd('0x1')]||'';this[_0xd3cd('0x2')]=_0x2d0bcc[_0xd3cd('0x2')]||'';this[_0xd3cd('0x3')]=_0x2d0bcc[_0xd3cd('0x3')]||'';this[_0xd3cd('0x4')]=_0x2d0bcc[_0xd3cd('0x4')]||'';this['Configurations']=_0x2d0bcc['Configurations']||{};}module[_0xd3cd('0x5')]=ServicenowAccount; \ No newline at end of file +var _0x86fa=['password','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x3380a3,_0xd28e44){var _0x13f7f7=function(_0x13fac6){while(--_0x13fac6){_0x3380a3['push'](_0x3380a3['shift']());}};_0x13f7f7(++_0xd28e44);}(_0x86fa,0xd0));var _0xa86f=function(_0x499154,_0x5af5d5){_0x499154=_0x499154-0x0;var _0x9093e7=_0x86fa[_0x499154];return _0x9093e7;};'use strict';function ServicenowAccount(_0x5d7282){this['id']=_0x5d7282['id']||0x0;this[_0xa86f('0x0')]=_0x5d7282[_0xa86f('0x0')]||'';this[_0xa86f('0x1')]=_0x5d7282[_0xa86f('0x1')]||'';this[_0xa86f('0x2')]=_0x5d7282[_0xa86f('0x2')]||'';this[_0xa86f('0x3')]=_0x5d7282[_0xa86f('0x3')]||'';this['serverUrl']=_0x5d7282[_0xa86f('0x4')]||'';this['Configurations']=_0x5d7282[_0xa86f('0x5')]||{};}module[_0xa86f('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 29c7a4c..54e4fad 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 _0x7331=['serverUrl','Configurations','exports','name','username','password','remoteUri'];(function(_0x49ee2f,_0x5dd891){var _0x5ce606=function(_0x8e926c){while(--_0x8e926c){_0x49ee2f['push'](_0x49ee2f['shift']());}};_0x5ce606(++_0x5dd891);}(_0x7331,0xe3));var _0x1733=function(_0x12a590,_0x597436){_0x12a590=_0x12a590-0x0;var _0x2cfcce=_0x7331[_0x12a590];return _0x2cfcce;};'use strict';function SugarcrmAccount(_0x2b00ca){this['id']=_0x2b00ca['id']||0x0;this['name']=_0x2b00ca[_0x1733('0x0')]||'';this[_0x1733('0x1')]=_0x2b00ca['username']||'';this[_0x1733('0x2')]=_0x2b00ca['password']||'';this[_0x1733('0x3')]=_0x2b00ca[_0x1733('0x3')]||'';this[_0x1733('0x4')]=_0x2b00ca[_0x1733('0x4')]||'';this[_0x1733('0x5')]=_0x2b00ca[_0x1733('0x5')]||{};}module[_0x1733('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0xfda6=['remoteUri','serverUrl','Configurations','name'];(function(_0x26746a,_0x50f7b7){var _0x3c6bb4=function(_0x3d13fd){while(--_0x3d13fd){_0x26746a['push'](_0x26746a['shift']());}};_0x3c6bb4(++_0x50f7b7);}(_0xfda6,0x123));var _0x6fda=function(_0x58fc31,_0x393498){_0x58fc31=_0x58fc31-0x0;var _0x2858ce=_0xfda6[_0x58fc31];return _0x2858ce;};'use strict';function SugarcrmAccount(_0x369973){this['id']=_0x369973['id']||0x0;this[_0x6fda('0x0')]=_0x369973[_0x6fda('0x0')]||'';this['username']=_0x369973['username']||'';this['password']=_0x369973['password']||'';this[_0x6fda('0x1')]=_0x369973[_0x6fda('0x1')]||'';this['serverUrl']=_0x369973[_0x6fda('0x2')]||'';this[_0x6fda('0x3')]=_0x369973[_0x6fda('0x3')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 92fe891..6961ae9 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 _0xdcfc=['exports','name','state','unknown','stateTime','status','address'];(function(_0x4a419a,_0xba7cdd){var _0x4fac3e=function(_0x581cd4){while(--_0x581cd4){_0x4a419a['push'](_0x4a419a['shift']());}};_0x4fac3e(++_0xba7cdd);}(_0xdcfc,0x1c8));var _0xcdcf=function(_0x388550,_0x3fd74b){_0x388550=_0x388550-0x0;var _0x735860=_0xdcfc[_0x388550];return _0x735860;};'use strict';function Telephone(_0x4c5db7){this['id']=_0x4c5db7['id']||0x0;this[_0xcdcf('0x0')]=_0x4c5db7['name']||'';this['accountcode']=_0x4c5db7['accountcode']||'';this[_0xcdcf('0x1')]=_0xcdcf('0x2');this[_0xcdcf('0x3')]=0x0;this[_0xcdcf('0x4')]='unknown';this[_0xcdcf('0x5')]='';}module[_0xcdcf('0x6')]=Telephone; \ No newline at end of file +var _0x42cf=['stateTime','status','exports','name','accountcode','unknown'];(function(_0x1cfe58,_0x2fe259){var _0x3cf5a9=function(_0x403989){while(--_0x403989){_0x1cfe58['push'](_0x1cfe58['shift']());}};_0x3cf5a9(++_0x2fe259);}(_0x42cf,0x123));var _0xf42c=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0x42cf[_0x2aec52];return _0x3b8835;};'use strict';function Telephone(_0x39f6c8){this['id']=_0x39f6c8['id']||0x0;this[_0xf42c('0x0')]=_0x39f6c8['name']||'';this[_0xf42c('0x1')]=_0x39f6c8[_0xf42c('0x1')]||'';this['state']=_0xf42c('0x2');this[_0xf42c('0x3')]=0x0;this[_0xf42c('0x4')]=_0xf42c('0x2');this['address']='';}module[_0xf42c('0x5')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index bea919d..a83b803 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(_0x3e31e1,_0x241407){var _0x1f2f21=function(_0x5f04a7){while(--_0x5f04a7){_0x3e31e1['push'](_0x3e31e1['shift']());}};_0x1f2f21(++_0x241407);}(_0xb10b,0x12a));var _0xbb10=function(_0xdcca54,_0x4b2b61){_0xdcca54=_0xdcca54-0x0;var _0x453197=_0xb10b[_0xdcca54];return _0x453197;};'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(_0x4859d7,_0x541e5b){var _0x5c1ed5=function(_0x50925a){while(--_0x50925a){_0x4859d7['push'](_0x4859d7['shift']());}};_0x5c1ed5(++_0x541e5b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'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 3be7d51..982bbdf 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(_0x1b75ae,_0x223979){var _0x4832b7=function(_0xdbc46b){while(--_0xdbc46b){_0x1b75ae['push'](_0x1b75ae['shift']());}};_0x4832b7(++_0x223979);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x2d2766,_0x1fa172){_0x2d2766=_0x2d2766-0x0;var _0x25f785=_0x9ffd[_0x2d2766];return _0x25f785;};'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 _0xb7e7=['Actions','exports','name','channel','status','AllConditions','AnyConditions'];(function(_0x343b0a,_0x586263){var _0x3d8ff8=function(_0x53c629){while(--_0x53c629){_0x343b0a['push'](_0x343b0a['shift']());}};_0x3d8ff8(++_0x586263);}(_0xb7e7,0x121));var _0x7b7e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xb7e7[_0x5037ab];return _0x512adb;};'use strict';function Trigger(_0x2e5e07){this['id']=_0x2e5e07['id']||0x0;this['name']=_0x2e5e07[_0x7b7e('0x0')]||'';this['channel']=_0x2e5e07[_0x7b7e('0x1')]||'voice';this[_0x7b7e('0x2')]=_0x2e5e07['status']||![];this[_0x7b7e('0x3')]=_0x2e5e07[_0x7b7e('0x3')]||[];this[_0x7b7e('0x4')]=_0x2e5e07['AnyConditions']||[];this['Actions']=_0x2e5e07[_0x7b7e('0x5')]||[];}module[_0x7b7e('0x6')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index c8ab2b7..b97f15a 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 _0x9942=['defaultuser','exports','active','name','unknown','stateTime','status','registry','indexOf','host','domainport','stateRegistry','registrationtime'];(function(_0x58a4b5,_0x182439){var _0x51821d=function(_0x47c3c5){while(--_0x47c3c5){_0x58a4b5['push'](_0x58a4b5['shift']());}};_0x51821d(++_0x182439);}(_0x9942,0x154));var _0x2994=function(_0x5a852b,_0x1694c2){_0x5a852b=_0x5a852b-0x0;var _0xd74d84=_0x9942[_0x5a852b];return _0xd74d84;};'use strict';function Trunk(_0x2e0d7d){this['id']=_0x2e0d7d['id']||0x0;this[_0x2994('0x0')]=_0x2e0d7d[_0x2994('0x0')]||![];this[_0x2994('0x1')]=_0x2e0d7d[_0x2994('0x1')]||'';this['state']=_0x2994('0x2');this[_0x2994('0x3')]=0x0;this[_0x2994('0x4')]='unknown';this['registry']=_0x2e0d7d[_0x2994('0x5')]&&_0x2e0d7d[_0x2994('0x5')][_0x2994('0x6')](':')?_0x2e0d7d[_0x2994('0x5')]['split'](':')[0x0]:'';this[_0x2994('0x7')]='';this['port']='';this['domain']='';this[_0x2994('0x8')]='';this['refresh']='';this[_0x2994('0x9')]=_0x2994('0x2');this[_0x2994('0xa')]='';this['address']='';this[_0x2994('0xb')]=_0x2e0d7d[_0x2994('0xb')]||'';}module[_0x2994('0xc')]=Trunk; \ No newline at end of file +var _0xc4ab=['port','domain','domainport','stateRegistry','registrationtime','address','defaultuser','exports','active','state','unknown','stateTime','registry','indexOf','host'];(function(_0x5aabd6,_0x6fe236){var _0x3888e4=function(_0x105eae){while(--_0x105eae){_0x5aabd6['push'](_0x5aabd6['shift']());}};_0x3888e4(++_0x6fe236);}(_0xc4ab,0x1e8));var _0xbc4a=function(_0x4244c9,_0x5187ce){_0x4244c9=_0x4244c9-0x0;var _0x4794eb=_0xc4ab[_0x4244c9];return _0x4794eb;};'use strict';function Trunk(_0x2b6397){this['id']=_0x2b6397['id']||0x0;this[_0xbc4a('0x0')]=_0x2b6397[_0xbc4a('0x0')]||![];this['name']=_0x2b6397['name']||'';this[_0xbc4a('0x1')]=_0xbc4a('0x2');this[_0xbc4a('0x3')]=0x0;this['status']=_0xbc4a('0x2');this[_0xbc4a('0x4')]=_0x2b6397[_0xbc4a('0x4')]&&_0x2b6397[_0xbc4a('0x4')][_0xbc4a('0x5')](':')?_0x2b6397[_0xbc4a('0x4')]['split'](':')[0x0]:'';this[_0xbc4a('0x6')]='';this[_0xbc4a('0x7')]='';this[_0xbc4a('0x8')]='';this[_0xbc4a('0x9')]='';this['refresh']='';this[_0xbc4a('0xa')]=_0xbc4a('0x2');this[_0xbc4a('0xb')]='';this[_0xbc4a('0xc')]='';this[_0xbc4a('0xd')]=_0x2b6397['defaultuser']||'';}module[_0xbc4a('0xe')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 748e137..2d7c9fc 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 _0x562b=['mandatoryDisposition','exten','recordingFormat','none'];(function(_0x3e4285,_0x83a4f0){var _0xce09e7=function(_0x2f13ee){while(--_0x2f13ee){_0x3e4285['push'](_0x3e4285['shift']());}};_0xce09e7(++_0x83a4f0);}(_0x562b,0xbd));var _0xb562=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x562b[_0x279d37];return _0x530173;};'use strict';function voiceExtension(_0x4342b6){this['id']=_0x4342b6['id']||0x0;this[_0xb562('0x0')]=_0x4342b6[_0xb562('0x0')]||'';this[_0xb562('0x1')]=_0x4342b6[_0xb562('0x1')]||_0xb562('0x2');this[_0xb562('0x3')]=_0x4342b6[_0xb562('0x3')]||![];}module['exports']=voiceExtension; \ No newline at end of file +var _0x4d4a=['recordingFormat','none','mandatoryDisposition','exports','exten'];(function(_0x2b4895,_0x20c70a){var _0x569215=function(_0x26ddf4){while(--_0x26ddf4){_0x2b4895['push'](_0x2b4895['shift']());}};_0x569215(++_0x20c70a);}(_0x4d4a,0x1a3));var _0xa4d4=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x4d4a[_0x178e48];return _0x440d7e;};'use strict';function voiceExtension(_0x4da5bb){this['id']=_0x4da5bb['id']||0x0;this[_0xa4d4('0x0')]=_0x4da5bb[_0xa4d4('0x0')]||'';this[_0xa4d4('0x1')]=_0x4da5bb[_0xa4d4('0x1')]||_0xa4d4('0x2');this[_0xa4d4('0x3')]=_0x4da5bb[_0xa4d4('0x3')]||![];}module[_0xa4d4('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 1064587..3454201 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 _0x0f0b=['dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','startProgressive','startPredictive','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','inuse','invalid','ringing','ringinuse','onhold','wav','wav49','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','waiting','talking','total','answered','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry'];(function(_0x7a954a,_0xabba11){var _0x4b38b3=function(_0x1c71b2){while(--_0x1c71b2){_0x7a954a['push'](_0x7a954a['shift']());}};_0x4b38b3(++_0xabba11);}(_0x0f0b,0xae));var _0xb0f0=function(_0x3716a4,_0x30953b){_0x3716a4=_0x3716a4-0x0;var _0x2f4d19=_0x0f0b[_0x3716a4];return _0x2f4d19;};'use strict';var statusDesc=[_0xb0f0('0x0'),'not_inuse',_0xb0f0('0x1'),'busy',_0xb0f0('0x2'),'unavailable',_0xb0f0('0x3'),_0xb0f0('0x4'),_0xb0f0('0x5')];var monitorFormat={'wav':_0xb0f0('0x6'),'wav49':_0xb0f0('0x7'),'gsm':_0xb0f0('0x8')};var strategy={'rrmemory':_0xb0f0('0x9'),'roundrobin':_0xb0f0('0xa')};function VoiceQueue(_0x21dd46){this['id']=_0x21dd46['id']||0x0;this[_0xb0f0('0xb')]=_0x21dd46[_0xb0f0('0xb')]||'';this['monitor_format']=_0x21dd46[_0xb0f0('0xc')]||'';this['type']=_0x21dd46[_0xb0f0('0xd')]||_0xb0f0('0xe');this[_0xb0f0('0xf')]=0x0;this[_0xb0f0('0x10')]=0x0;this[_0xb0f0('0x11')]=0x0;this[_0xb0f0('0x12')]=0x0;this['sumDuration']=0x0;this[_0xb0f0('0x13')]=0x0;this[_0xb0f0('0x14')]=0x0;this[_0xb0f0('0x15')]=0x0;this[_0xb0f0('0x16')]=0x0;this[_0xb0f0('0x17')]=0x0;this[_0xb0f0('0x18')]=0x0;this[_0xb0f0('0x19')]=_0x21dd46['acw']||![];this[_0xb0f0('0x1a')]=_0x21dd46[_0xb0f0('0x1a')]||0xa;this[_0xb0f0('0x1b')]=_0x21dd46['autopause']||'no';this[_0xb0f0('0x1c')]=!![];this['message']='';this['originated']=0x0;this[_0xb0f0('0x1d')]=0x0;this[_0xb0f0('0x1e')]=_0x21dd46[_0xb0f0('0x1e')]||null;this[_0xb0f0('0x1f')]=_0x21dd46[_0xb0f0('0x1f')]?_0x21dd46[_0xb0f0('0x1f')]:null;this[_0xb0f0('0x20')]=_0x21dd46[_0xb0f0('0x20')];this[_0xb0f0('0x21')]=_0x21dd46[_0xb0f0('0x21')]||_0xb0f0('0x22');this['dialLimitChannel']=_0x21dd46['dialLimitChannel']||0x0;this['dialLimitQueue']=_0x21dd46[_0xb0f0('0x23')]||0x0;this['dialPowerLevel']=_0x21dd46[_0xb0f0('0x24')]||0x1;this[_0xb0f0('0x25')]=_0x21dd46[_0xb0f0('0x25')]||'dropRate';this[_0xb0f0('0x26')]=_0x21dd46[_0xb0f0('0x26')]||0.03;this[_0xb0f0('0x27')]=_0x21dd46[_0xb0f0('0x27')]||0x258;this['dialOriginateCallerIdName']=_0x21dd46['dialOriginateCallerIdName']||'anonymous';this[_0xb0f0('0x28')]=_0x21dd46[_0xb0f0('0x28')]||'anonymous';this[_0xb0f0('0x29')]=_0x21dd46[_0xb0f0('0x29')]||0x1e;this[_0xb0f0('0x2a')]=_0x21dd46[_0xb0f0('0x2a')]||'tTxX';this[_0xb0f0('0x2b')]=_0x21dd46[_0xb0f0('0x2b')]||0x3;this[_0xb0f0('0x2c')]=_0x21dd46[_0xb0f0('0x2c')]||undefined;this[_0xb0f0('0x2d')]=_0x21dd46[_0xb0f0('0x2d')]||0x3;this['dialCongestionRetryFrequency']=_0x21dd46[_0xb0f0('0x2e')]||0x96;this[_0xb0f0('0x2f')]=_0x21dd46[_0xb0f0('0x2f')]||0x3;this[_0xb0f0('0x30')]=_0x21dd46[_0xb0f0('0x30')]||0x96;this[_0xb0f0('0x31')]=_0x21dd46[_0xb0f0('0x31')]||0x3;this[_0xb0f0('0x32')]=_0x21dd46[_0xb0f0('0x32')]||0x96;this[_0xb0f0('0x33')]=_0x21dd46[_0xb0f0('0x33')]||0x3;this[_0xb0f0('0x34')]=_0x21dd46[_0xb0f0('0x34')]||0x96;this[_0xb0f0('0x35')]=_0x21dd46[_0xb0f0('0x35')]||0x3;this['dialDropRetryFrequency']=_0x21dd46[_0xb0f0('0x36')]||0x96;this[_0xb0f0('0x37')]=_0x21dd46[_0xb0f0('0x37')]||0x3;this[_0xb0f0('0x38')]=_0x21dd46[_0xb0f0('0x38')]||0x96;this[_0xb0f0('0x39')]=_0x21dd46[_0xb0f0('0x39')]||0x3;this[_0xb0f0('0x3a')]=_0x21dd46[_0xb0f0('0x3a')]||0x96;this[_0xb0f0('0x3b')]=_0x21dd46[_0xb0f0('0x3b')]||0x3;this[_0xb0f0('0x3c')]=_0x21dd46[_0xb0f0('0x3c')]||0x96;this[_0xb0f0('0x3d')]=_0x21dd46[_0xb0f0('0x3d')]||0x4;this[_0xb0f0('0x3e')]=_0x21dd46[_0xb0f0('0x3e')]?_0x21dd46[_0xb0f0('0x3e')]:undefined;this[_0xb0f0('0x3f')]=_0x21dd46[_0xb0f0('0x3f')]?_0x21dd46[_0xb0f0('0x3f')]:undefined;this[_0xb0f0('0x40')]=_0x21dd46['dialPrefix']||undefined;this['Interval']=_0x21dd46[_0xb0f0('0x41')]?_0x21dd46[_0xb0f0('0x41')]:undefined;this[_0xb0f0('0x42')]=_0x21dd46[_0xb0f0('0x42')]||'DESC';this['dialRandomLastDigitCallerIdNumber']=_0x21dd46[_0xb0f0('0x43')]||undefined;this['dialCutDigit']=_0x21dd46['dialCutDigit']||undefined;this[_0xb0f0('0x44')]=strategy[_0x21dd46[_0xb0f0('0x44')]]||'rrmemory';this['queueStatusComplete']=!![];this[_0xb0f0('0x45')]=_0x21dd46[_0xb0f0('0x45')]||![];this['dialAMDInitialSilence']=_0x21dd46[_0xb0f0('0x46')];this[_0xb0f0('0x47')]=_0x21dd46[_0xb0f0('0x47')];this[_0xb0f0('0x48')]=_0x21dd46['dialAMDAfterGreetingSilence'];this['dialAMDTotalAnalysisTime']=_0x21dd46[_0xb0f0('0x49')];this[_0xb0f0('0x4a')]=_0x21dd46[_0xb0f0('0x4a')];this[_0xb0f0('0x4b')]=_0x21dd46['dialAMDBetweenWordsSilence'];this[_0xb0f0('0x4c')]=_0x21dd46['dialAMDMaximumNumberOfWords'];this[_0xb0f0('0x4d')]=_0x21dd46[_0xb0f0('0x4d')];this['dialAMDMaximumWordLength']=_0x21dd46[_0xb0f0('0x4e')];this['outboundRejectCallsDay']=0x0;this['pTalking']=0x0;this[_0xb0f0('0x4f')]=_0x21dd46[_0xb0f0('0x4f')];this[_0xb0f0('0x50')]=0x0;this[_0xb0f0('0x51')]=0x0;this[_0xb0f0('0x52')]=0x0;this[_0xb0f0('0x53')]=0x0;this[_0xb0f0('0x54')]=0x0;this['outboundNoSuchCallsDay']=0x0;this['outboundUnknownCallsDay']=0x0;this['outboundBlacklistCallsDay']=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0xb0f0('0x55')]=0x0;this[_0xb0f0('0x56')]=0x0;this[_0xb0f0('0x57')]=0x0;this[_0xb0f0('0x58')]=0x0;this['outboundAbandonedDay']=0x0;this[_0xb0f0('0x59')]=undefined;this[_0xb0f0('0x5a')]=undefined;this['handlePredictive']=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0xb0f0('0x5b')]=0x0;this[_0xb0f0('0x5c')]=0x0;this[_0xb0f0('0x5d')]=0x0;this[_0xb0f0('0x5e')]=0x0;this[_0xb0f0('0x5f')]=0x0;this[_0xb0f0('0x60')]=0x0;this[_0xb0f0('0x61')]=0x0;this[_0xb0f0('0x62')]=0x0;this[_0xb0f0('0x63')]=_0x21dd46[_0xb0f0('0x64')]||0x14;this['predictiveIntervalMinThreshold']=_0x21dd46[_0xb0f0('0x64')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0xb0f0('0x65')]=0x0;this[_0xb0f0('0x66')]=0x1;this[_0xb0f0('0x67')]=0x0;this[_0xb0f0('0x68')]=0x0;this[_0xb0f0('0x69')]=0x0;this[_0xb0f0('0x6a')]=0x0;this[_0xb0f0('0x6b')]=_0x21dd46['dialRecallMeTimeout']||0x1e;this[_0xb0f0('0x6c')]=_0x21dd46['dialRecallInQueue']||![];this[_0xb0f0('0x6d')]=!!_0x21dd46[_0xb0f0('0x6d')]||![];this[_0xb0f0('0x6e')]=!!_0x21dd46['dialPreviewRecallmeReminder']||![];this['dialQueueProject2']=_0x21dd46['dialQueueProject2']||undefined;this[_0xb0f0('0x6f')]=_0x21dd46[_0xb0f0('0x6f')]||![];this[_0xb0f0('0x70')]=_0x21dd46[_0xb0f0('0x70')]||![];this[_0xb0f0('0xc')]=monitorFormat[_0x21dd46[_0xb0f0('0xc')]]?monitorFormat[_0x21dd46[_0xb0f0('0xc')]]:undefined;this[_0xb0f0('0x71')]=_0x21dd46['mandatoryDisposition']||![];this[_0xb0f0('0x72')]=_0x21dd46['mandatoryDispositionPause']?_0x21dd46[_0xb0f0('0x72')]:undefined;}module[_0xb0f0('0x73')]=VoiceQueue; \ No newline at end of file +var _0x5419=['dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','not_inuse','invalid','unavailable','ringinuse','onhold','wav','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','waiting','talking','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','available','acw','acwTimeout','autopause','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency'];(function(_0x2c10f2,_0x25b86f){var _0x42fbfe=function(_0x31944a){while(--_0x31944a){_0x2c10f2['push'](_0x2c10f2['shift']());}};_0x42fbfe(++_0x25b86f);}(_0x5419,0x139));var _0x9541=function(_0x16cce2,_0xf470d4){_0x16cce2=_0x16cce2-0x0;var _0x213186=_0x5419[_0x16cce2];return _0x213186;};'use strict';var statusDesc=['unknown',_0x9541('0x0'),'inuse','busy',_0x9541('0x1'),_0x9541('0x2'),'ringing',_0x9541('0x3'),_0x9541('0x4')];var monitorFormat={'wav':_0x9541('0x5'),'wav49':'wav49','gsm':_0x9541('0x6')};var strategy={'rrmemory':_0x9541('0x7'),'roundrobin':_0x9541('0x8')};function VoiceQueue(_0x3d91ab){this['id']=_0x3d91ab['id']||0x0;this[_0x9541('0x9')]=_0x3d91ab['name']||'';this[_0x9541('0xa')]=_0x3d91ab[_0x9541('0xa')]||'';this['type']=_0x3d91ab[_0x9541('0xb')]||_0x9541('0xc');this[_0x9541('0xd')]=0x0;this[_0x9541('0xe')]=0x0;this['total']=0x0;this[_0x9541('0xf')]=0x0;this[_0x9541('0x10')]=0x0;this[_0x9541('0x11')]=0x0;this[_0x9541('0x12')]=0x0;this[_0x9541('0x13')]=0x0;this[_0x9541('0x14')]=0x0;this['loggedIn']=0x0;this[_0x9541('0x15')]=0x0;this[_0x9541('0x16')]=_0x3d91ab[_0x9541('0x16')]||![];this[_0x9541('0x17')]=_0x3d91ab[_0x9541('0x17')]||0xa;this['autopause']=_0x3d91ab[_0x9541('0x18')]||'no';this['sendMessageOneNotActive']=!![];this[_0x9541('0x19')]='';this[_0x9541('0x1a')]=0x0;this[_0x9541('0x1b')]=0x0;this['dialTimezone']=_0x3d91ab[_0x9541('0x1c')]||null;this[_0x9541('0x1d')]=_0x3d91ab[_0x9541('0x1d')]?_0x3d91ab['dialGlobalInterval']:null;this[_0x9541('0x1e')]=_0x3d91ab['dialActive'];this['dialMethod']=_0x3d91ab[_0x9541('0x1f')]||_0x9541('0x20');this['dialLimitChannel']=_0x3d91ab[_0x9541('0x21')]||0x0;this[_0x9541('0x22')]=_0x3d91ab['dialLimitQueue']||0x0;this[_0x9541('0x23')]=_0x3d91ab[_0x9541('0x23')]||0x1;this[_0x9541('0x24')]=_0x3d91ab[_0x9541('0x24')]||_0x9541('0x25');this[_0x9541('0x26')]=_0x3d91ab[_0x9541('0x26')]||0.03;this['dialPredictiveInterval']=_0x3d91ab['dialPredictiveInterval']||0x258;this[_0x9541('0x27')]=_0x3d91ab[_0x9541('0x27')]||_0x9541('0x28');this[_0x9541('0x29')]=_0x3d91ab[_0x9541('0x29')]||_0x9541('0x28');this[_0x9541('0x2a')]=_0x3d91ab[_0x9541('0x2a')]||0x1e;this[_0x9541('0x2b')]=_0x3d91ab[_0x9541('0x2b')]||_0x9541('0x2c');this['dialQueueTimeout']=_0x3d91ab['dialQueueTimeout']||0x3;this[_0x9541('0x2d')]=_0x3d91ab[_0x9541('0x2d')]||undefined;this[_0x9541('0x2e')]=_0x3d91ab['dialCongestionMaxRetry']||0x3;this[_0x9541('0x2f')]=_0x3d91ab['dialCongestionRetryFrequency']||0x96;this[_0x9541('0x30')]=_0x3d91ab[_0x9541('0x30')]||0x3;this['dialBusyRetryFrequency']=_0x3d91ab[_0x9541('0x31')]||0x96;this['dialNoAnswerMaxRetry']=_0x3d91ab[_0x9541('0x32')]||0x3;this[_0x9541('0x33')]=_0x3d91ab[_0x9541('0x33')]||0x96;this[_0x9541('0x34')]=_0x3d91ab['dialNoSuchNumberMaxRetry']||0x3;this['dialNoSuchNumberRetryFrequency']=_0x3d91ab[_0x9541('0x35')]||0x96;this['dialDropMaxRetry']=_0x3d91ab[_0x9541('0x36')]||0x3;this[_0x9541('0x37')]=_0x3d91ab[_0x9541('0x37')]||0x96;this[_0x9541('0x38')]=_0x3d91ab[_0x9541('0x38')]||0x3;this[_0x9541('0x39')]=_0x3d91ab[_0x9541('0x39')]||0x96;this[_0x9541('0x3a')]=_0x3d91ab[_0x9541('0x3a')]||0x3;this[_0x9541('0x3b')]=_0x3d91ab[_0x9541('0x3b')]||0x96;this[_0x9541('0x3c')]=_0x3d91ab[_0x9541('0x3c')]||0x3;this[_0x9541('0x3d')]=_0x3d91ab['dialAgentRejectRetryFrequency']||0x96;this['dialGlobalMaxRetry']=_0x3d91ab['dialGlobalMaxRetry']||0x4;this[_0x9541('0x3e')]=_0x3d91ab[_0x9541('0x3e')]?_0x3d91ab[_0x9541('0x3e')]:undefined;this[_0x9541('0x3f')]=_0x3d91ab['TrunkBackup']?_0x3d91ab[_0x9541('0x3f')]:undefined;this[_0x9541('0x40')]=_0x3d91ab[_0x9541('0x40')]||undefined;this['Interval']=_0x3d91ab['Interval']?_0x3d91ab[_0x9541('0x41')]:undefined;this[_0x9541('0x42')]=_0x3d91ab[_0x9541('0x42')]||'DESC';this[_0x9541('0x43')]=_0x3d91ab[_0x9541('0x43')]||undefined;this[_0x9541('0x44')]=_0x3d91ab[_0x9541('0x44')]||undefined;this[_0x9541('0x45')]=strategy[_0x3d91ab['strategy']]||_0x9541('0x7');this[_0x9541('0x46')]=!![];this[_0x9541('0x47')]=_0x3d91ab['dialAMDActive']||![];this[_0x9541('0x48')]=_0x3d91ab[_0x9541('0x48')];this[_0x9541('0x49')]=_0x3d91ab[_0x9541('0x49')];this[_0x9541('0x4a')]=_0x3d91ab[_0x9541('0x4a')];this[_0x9541('0x4b')]=_0x3d91ab[_0x9541('0x4b')];this[_0x9541('0x4c')]=_0x3d91ab[_0x9541('0x4c')];this['dialAMDBetweenWordsSilence']=_0x3d91ab[_0x9541('0x4d')];this[_0x9541('0x4e')]=_0x3d91ab[_0x9541('0x4e')];this[_0x9541('0x4f')]=_0x3d91ab[_0x9541('0x4f')];this[_0x9541('0x50')]=_0x3d91ab[_0x9541('0x50')];this[_0x9541('0x51')]=0x0;this[_0x9541('0x52')]=0x0;this[_0x9541('0x53')]=_0x3d91ab[_0x9541('0x53')];this[_0x9541('0x54')]=0x0;this[_0x9541('0x55')]=0x0;this[_0x9541('0x56')]=0x0;this['outboundBusyCallsDay']=0x0;this[_0x9541('0x57')]=0x0;this[_0x9541('0x58')]=0x0;this[_0x9541('0x59')]=0x0;this[_0x9541('0x5a')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0x9541('0x5b')]=0x0;this[_0x9541('0x5c')]=0x0;this[_0x9541('0x5d')]=0x0;this[_0x9541('0x5e')]=0x0;this[_0x9541('0x5f')]=0x0;this[_0x9541('0x60')]=undefined;this[_0x9541('0x61')]=undefined;this['handlePredictive']=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0x9541('0x62')]=0x0;this[_0x9541('0x63')]=0x0;this[_0x9541('0x64')]=0x0;this[_0x9541('0x65')]=0x0;this[_0x9541('0x66')]=0x0;this[_0x9541('0x67')]=0x0;this['predictiveIntervalAvailable']=0x0;this['predictiveIntervalMaxThreshold']=_0x3d91ab['dialPredictiveIntervalMaxThreshold']||0x14;this[_0x9541('0x68')]=_0x3d91ab['dialPredictiveIntervalMaxThreshold']||0xa;this[_0x9541('0x69')]=0x0;this[_0x9541('0x6a')]=0x0;this[_0x9541('0x6b')]=0x1;this[_0x9541('0x6c')]=0x0;this[_0x9541('0x6d')]=0x0;this[_0x9541('0x6e')]=0x0;this['erlangBusyFactor']=0x0;this['dialRecallMeTimeout']=_0x3d91ab[_0x9541('0x6f')]||0x1e;this[_0x9541('0x70')]=_0x3d91ab[_0x9541('0x70')]||![];this[_0x9541('0x71')]=!!_0x3d91ab[_0x9541('0x71')]||![];this['dialPreviewRecallmeReminder']=!!_0x3d91ab[_0x9541('0x72')]||![];this[_0x9541('0x73')]=_0x3d91ab[_0x9541('0x73')]||undefined;this['dialAgiAfterHangupClient']=_0x3d91ab[_0x9541('0x74')]||![];this[_0x9541('0x75')]=_0x3d91ab[_0x9541('0x75')]||![];this[_0x9541('0xa')]=monitorFormat[_0x3d91ab['monitor_format']]?monitorFormat[_0x3d91ab['monitor_format']]:undefined;this[_0x9541('0x76')]=_0x3d91ab[_0x9541('0x76')]||![];this[_0x9541('0x77')]=_0x3d91ab['mandatoryDispositionPause']?_0x3d91ab[_0x9541('0x77')]:undefined;}module[_0x9541('0x78')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 03bcc01..c337651 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 _0x4627=['accessKey','remoteUri','serverUrl','Configurations','name','username'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x4627,0xa0));var _0x7462=function(_0x4a7631,_0x2c85b9){_0x4a7631=_0x4a7631-0x0;var _0x1a5a6f=_0x4627[_0x4a7631];return _0x1a5a6f;};'use strict';function VtigerAccount(_0x399904){this['id']=_0x399904['id']||0x0;this[_0x7462('0x0')]=_0x399904[_0x7462('0x0')]||'';this[_0x7462('0x1')]=_0x399904[_0x7462('0x1')]||'';this[_0x7462('0x2')]=_0x399904[_0x7462('0x2')]||'';this[_0x7462('0x3')]=_0x399904[_0x7462('0x3')]||'';this[_0x7462('0x4')]=_0x399904['serverUrl']||'';this[_0x7462('0x5')]=_0x399904[_0x7462('0x5')]||{};}module['exports']=VtigerAccount; \ No newline at end of file +var _0xd651=['Configurations','exports','name','username','accessKey','remoteUri','serverUrl'];(function(_0x3792e6,_0x32bd91){var _0x441e44=function(_0x357478){while(--_0x357478){_0x3792e6['push'](_0x3792e6['shift']());}};_0x441e44(++_0x32bd91);}(_0xd651,0x18a));var _0x1d65=function(_0x3780b8,_0x50b147){_0x3780b8=_0x3780b8-0x0;var _0x2310e0=_0xd651[_0x3780b8];return _0x2310e0;};'use strict';function VtigerAccount(_0x38df22){this['id']=_0x38df22['id']||0x0;this[_0x1d65('0x0')]=_0x38df22[_0x1d65('0x0')]||'';this['username']=_0x38df22[_0x1d65('0x1')]||'';this['accessKey']=_0x38df22[_0x1d65('0x2')]||'';this['remoteUri']=_0x38df22[_0x1d65('0x3')]||'';this[_0x1d65('0x4')]=_0x38df22[_0x1d65('0x4')]||'';this[_0x1d65('0x5')]=_0x38df22[_0x1d65('0x5')]||{};}module[_0x1d65('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 c8e765d..32470dd 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 _0x97b7=['remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports','name','username','password','token'];(function(_0x348ebf,_0x4c3267){var _0x5df8a9=function(_0x2cca5a){while(--_0x2cca5a){_0x348ebf['push'](_0x348ebf['shift']());}};_0x5df8a9(++_0x4c3267);}(_0x97b7,0x1e0));var _0x797b=function(_0x12acab,_0x3c700d){_0x12acab=_0x12acab-0x0;var _0x1179f4=_0x97b7[_0x12acab];return _0x1179f4;};'use strict';function ZendeskAccount(_0x5d1d60){this['id']=_0x5d1d60['id']||0x0;this['name']=_0x5d1d60[_0x797b('0x0')]||'';this[_0x797b('0x1')]=_0x5d1d60[_0x797b('0x1')]||'';this[_0x797b('0x2')]=_0x5d1d60[_0x797b('0x2')]||'';this[_0x797b('0x3')]=_0x5d1d60['token']||'';this[_0x797b('0x4')]=_0x5d1d60[_0x797b('0x4')]||'';this[_0x797b('0x5')]=_0x5d1d60[_0x797b('0x5')]||'';this[_0x797b('0x6')]=_0x5d1d60[_0x797b('0x6')]||_0x797b('0x7');this[_0x797b('0x8')]=_0x5d1d60[_0x797b('0x8')]||'';this[_0x797b('0x9')]=_0x5d1d60[_0x797b('0x9')]||{};}module[_0x797b('0xa')]=ZendeskAccount; \ No newline at end of file +var _0xef25=['remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports','name','username','password','token'];(function(_0x367e5b,_0x5721e4){var _0x4b909e=function(_0x22c6a4){while(--_0x22c6a4){_0x367e5b['push'](_0x367e5b['shift']());}};_0x4b909e(++_0x5721e4);}(_0xef25,0x6a));var _0x5ef2=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xef25[_0x4fc9e6];return _0x551d28;};'use strict';function ZendeskAccount(_0x25780c){this['id']=_0x25780c['id']||0x0;this['name']=_0x25780c[_0x5ef2('0x0')]||'';this[_0x5ef2('0x1')]=_0x25780c['username']||'';this[_0x5ef2('0x2')]=_0x25780c[_0x5ef2('0x2')]||'';this['token']=_0x25780c[_0x5ef2('0x3')]||'';this[_0x5ef2('0x4')]=_0x25780c[_0x5ef2('0x4')]||'';this['authType']=_0x25780c[_0x5ef2('0x5')]||'';this[_0x5ef2('0x6')]=_0x25780c['type']||_0x5ef2('0x7');this[_0x5ef2('0x8')]=_0x25780c[_0x5ef2('0x8')]||'';this[_0x5ef2('0x9')]=_0x25780c[_0x5ef2('0x9')]||{};}module[_0x5ef2('0xa')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index e15338c..d12dc95 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 _0x90ff=['clientSecret','serverUrl','code','refreshToken','Configurations','description','host','zone','clientId'];(function(_0xd02bb,_0x26e2d0){var _0x1cdf23=function(_0x18fd05){while(--_0x18fd05){_0xd02bb['push'](_0xd02bb['shift']());}};_0x1cdf23(++_0x26e2d0);}(_0x90ff,0xb0));var _0xf90f=function(_0x53dff3,_0x5e545e){_0x53dff3=_0x53dff3-0x0;var _0xbede82=_0x90ff[_0x53dff3];return _0xbede82;};'use strict';function ZohoAccount(_0x4faaf5){this['id']=_0x4faaf5['id']||0x0;this['name']=_0x4faaf5['name']||'';this[_0xf90f('0x0')]=_0x4faaf5['description']||'';this[_0xf90f('0x1')]=_0x4faaf5[_0xf90f('0x1')]||'';this[_0xf90f('0x2')]=_0x4faaf5['zone']||'';this[_0xf90f('0x3')]=_0x4faaf5[_0xf90f('0x3')]||'';this['clientSecret']=_0x4faaf5[_0xf90f('0x4')]||'';this[_0xf90f('0x5')]=_0x4faaf5[_0xf90f('0x5')]||'';this[_0xf90f('0x6')]=_0x4faaf5[_0xf90f('0x6')]||'';this[_0xf90f('0x7')]=_0x4faaf5['refreshToken']||'';this['Configurations']=_0x4faaf5[_0xf90f('0x8')]||{};}module['exports']=ZohoAccount; \ No newline at end of file +var _0xc8c0=['serverUrl','code','refreshToken','Configurations','exports','name','description','host','zone','clientId','clientSecret'];(function(_0x2664e0,_0x290ac2){var _0x387c70=function(_0x110d7e){while(--_0x110d7e){_0x2664e0['push'](_0x2664e0['shift']());}};_0x387c70(++_0x290ac2);}(_0xc8c0,0x7e));var _0x0c8c=function(_0xd5c4fd,_0x5216fd){_0xd5c4fd=_0xd5c4fd-0x0;var _0x415497=_0xc8c0[_0xd5c4fd];return _0x415497;};'use strict';function ZohoAccount(_0x173bff){this['id']=_0x173bff['id']||0x0;this['name']=_0x173bff[_0x0c8c('0x0')]||'';this[_0x0c8c('0x1')]=_0x173bff[_0x0c8c('0x1')]||'';this[_0x0c8c('0x2')]=_0x173bff['host']||'';this[_0x0c8c('0x3')]=_0x173bff[_0x0c8c('0x3')]||'';this[_0x0c8c('0x4')]=_0x173bff[_0x0c8c('0x4')]||'';this[_0x0c8c('0x5')]=_0x173bff[_0x0c8c('0x5')]||'';this[_0x0c8c('0x6')]=_0x173bff['serverUrl']||'';this[_0x0c8c('0x7')]=_0x173bff['code']||'';this[_0x0c8c('0x8')]=_0x173bff[_0x0c8c('0x8')]||'';this[_0x0c8c('0x9')]=_0x173bff[_0x0c8c('0x9')]||{};}module[_0x0c8c('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 9856e78..792533f 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 _0x6209=['uniqueid','idContact','queue','type','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','calleridname','Contact','phone','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','number','exports','util','lodash','moment','isNil','string'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x6209,0x163));var _0x9620=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x6209[_0x4154a6];return _0x3b2786;};'use strict';var util=require(_0x9620('0x0'));var _=require(_0x9620('0x1'));var moment=require(_0x9620('0x2'));function checkNameSurname(_0x1e23a8,_0x575737,_0x1d964a){var _0xb409b1='';if(!_[_0x9620('0x3')](_0x575737)&&_0x9620('0x4')===typeof _0x575737){_0xb409b1+=_0x575737;}if(!_[_0x9620('0x3')](_0x1d964a)&&_0x9620('0x4')===typeof _0x1d964a){_0xb409b1+='\x20'+_0x1d964a;}if(_0xb409b1!==''){return _0xb409b1;}return _0x1e23a8;}function Action(_0x2794c9,_0x678432,_0x2f29e9,_0x32b709,_0x3110c4){this[_0x9620('0x5')]=_0x2f29e9||undefined;this[_0x9620('0x6')]=_0x2794c9['id'];this[_0x9620('0x7')]=_0x678432['name'];this[_0x9620('0x8')]=_0x678432[_0x9620('0x8')];this['campaigntype']='queue';this[_0x9620('0x9')]=![];this[_0x9620('0xa')]=_[_0x9620('0x3')](_0x2794c9['Agent'])?undefined:_0x2794c9[_0x9620('0xb')]['name'];this[_0x9620('0xc')]=this[_0x9620('0xa')]?util[_0x9620('0xd')](_0x9620('0xe'),this[_0x9620('0xa')]):_0x32b709||undefined;this[_0x9620('0xf')]=checkNameSurname(_0x2794c9[_0x9620('0x10')][_0x9620('0x11')],_0x2794c9['Contact']['firstName'],_0x2794c9[_0x9620('0x10')][_0x9620('0x12')]);this['active']=_0x2794c9[_0x9620('0x13')]||![];this[_0x9620('0x14')]=_0x2794c9['Contact']['phone'];this[_0x9620('0x15')]=_0x2794c9[_0x9620('0x15')];this[_0x9620('0x16')]=_0x2794c9[_0x9620('0x16')]||0x0;this[_0x9620('0x17')]=_0x2794c9[_0x9620('0x17')]||0x0;this[_0x9620('0x18')]=_0x2794c9[_0x9620('0x18')]||0x0;this['countglobal']=(_0x2794c9['countbusyretry']||0x0)+(_0x2794c9[_0x9620('0x17')]||0x0)+(_0x2794c9['countnoanswerretry']||0x0)+(_0x2794c9[_0x9620('0x19')]||0x0)+(_0x2794c9['countdropretry']||0x0)+(_0x2794c9[_0x9620('0x1a')]||0x0)+(_0x2794c9[_0x9620('0x1b')]||0x0)+(_0x2794c9[_0x9620('0x1c')]||0x0);this[_0x9620('0x19')]=_0x2794c9['countnosuchnumberretry']||0x0;this[_0x9620('0x1d')]=_0x2794c9[_0x9620('0x1d')]||0x0;this['countabandonedretry']=_0x2794c9['countabandonedretry']||0x0;this[_0x9620('0x1b')]=_0x2794c9[_0x9620('0x1b')]||0x0;this[_0x9620('0x1c')]=_0x2794c9[_0x9620('0x1c')]||0x0;this[_0x9620('0x1e')]=_0x2794c9['callback'];this[_0x9620('0x1f')]=_0x2794c9[_0x9620('0x1f')];this[_0x9620('0x20')]=_0x2794c9[_0x9620('0x20')];this[_0x9620('0x21')]=_0x2794c9[_0x9620('0x21')];this[_0x9620('0x22')]=_0x2794c9['ContactId'];this[_0x9620('0x23')]=_0x2794c9[_0x9620('0x23')];this[_0x9620('0x24')]=_[_0x9620('0x3')](_0x2794c9[_0x9620('0xb')])?_0x2794c9[_0x9620('0x24')]:_0x2794c9[_0x9620('0xb')]['id'];this[_0x9620('0x25')]=_0x2794c9[_0x9620('0x25')];this[_0x9620('0x26')]='';this[_0x9620('0x27')]='';}Action[_0x9620('0x28')][_0x9620('0x29')]=function(){return util['format'](_0x9620('0x2a'),this[_0x9620('0xf')],this[_0x9620('0x2b')]);};module[_0x9620('0x2c')]=Action; \ No newline at end of file +var _0x3192=['originatecalleridname','prototype','\x22%s\x22\x20<%s>','number','exports','lodash','moment','string','isNil','uniqueid','idContact','queue','name','type','dialAnswer','membername','Agent','format','SIP/%s','calleridname','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countdropretry','countmachineretry','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum'];(function(_0x1b4b23,_0x5dd6d6){var _0x2a325b=function(_0x175462){while(--_0x175462){_0x1b4b23['push'](_0x1b4b23['shift']());}};_0x2a325b(++_0x5dd6d6);}(_0x3192,0x191));var _0x2319=function(_0x17e864,_0x321183){_0x17e864=_0x17e864-0x0;var _0x173f79=_0x3192[_0x17e864];return _0x173f79;};'use strict';var util=require('util');var _=require(_0x2319('0x0'));var moment=require(_0x2319('0x1'));function checkNameSurname(_0x4dbe86,_0x3bcda8,_0x11b85c){var _0x825067='';if(!_['isNil'](_0x3bcda8)&&_0x2319('0x2')===typeof _0x3bcda8){_0x825067+=_0x3bcda8;}if(!_[_0x2319('0x3')](_0x11b85c)&&'string'===typeof _0x11b85c){_0x825067+='\x20'+_0x11b85c;}if(_0x825067!==''){return _0x825067;}return _0x4dbe86;}function Action(_0x2441c5,_0x34177,_0x549d91,_0x2407e9,_0x5f2127){this[_0x2319('0x4')]=_0x549d91||undefined;this[_0x2319('0x5')]=_0x2441c5['id'];this[_0x2319('0x6')]=_0x34177[_0x2319('0x7')];this[_0x2319('0x8')]=_0x34177['type'];this['campaigntype']='queue';this[_0x2319('0x9')]=![];this[_0x2319('0xa')]=_[_0x2319('0x3')](_0x2441c5[_0x2319('0xb')])?undefined:_0x2441c5[_0x2319('0xb')][_0x2319('0x7')];this['channelAgent']=this[_0x2319('0xa')]?util[_0x2319('0xc')](_0x2319('0xd'),this[_0x2319('0xa')]):_0x2407e9||undefined;this[_0x2319('0xe')]=checkNameSurname(_0x2441c5[_0x2319('0xf')][_0x2319('0x10')],_0x2441c5[_0x2319('0xf')][_0x2319('0x11')],_0x2441c5[_0x2319('0xf')][_0x2319('0x12')]);this[_0x2319('0x13')]=_0x2441c5[_0x2319('0x13')]||![];this[_0x2319('0x14')]=_0x2441c5[_0x2319('0xf')][_0x2319('0x10')];this['scheduledat']=_0x2441c5[_0x2319('0x15')];this[_0x2319('0x16')]=_0x2441c5[_0x2319('0x16')]||0x0;this[_0x2319('0x17')]=_0x2441c5['countcongestionretry']||0x0;this['countnoanswerretry']=_0x2441c5['countnoanswerretry']||0x0;this[_0x2319('0x18')]=(_0x2441c5['countbusyretry']||0x0)+(_0x2441c5[_0x2319('0x17')]||0x0)+(_0x2441c5[_0x2319('0x19')]||0x0)+(_0x2441c5['countnosuchnumberretry']||0x0)+(_0x2441c5['countdropretry']||0x0)+(_0x2441c5[_0x2319('0x1a')]||0x0)+(_0x2441c5['countmachineretry']||0x0)+(_0x2441c5[_0x2319('0x1b')]||0x0);this[_0x2319('0x1c')]=_0x2441c5[_0x2319('0x1c')]||0x0;this[_0x2319('0x1d')]=_0x2441c5[_0x2319('0x1d')]||0x0;this['countabandonedretry']=_0x2441c5[_0x2319('0x1a')]||0x0;this[_0x2319('0x1e')]=_0x2441c5[_0x2319('0x1e')]||0x0;this[_0x2319('0x1b')]=_0x2441c5[_0x2319('0x1b')]||0x0;this['callback']=_0x2441c5[_0x2319('0x1f')];this['callbackuniqueid']=_0x2441c5['callbackuniqueid'];this[_0x2319('0x20')]=_0x2441c5[_0x2319('0x20')];this[_0x2319('0x21')]=_0x2441c5[_0x2319('0x21')];this[_0x2319('0x22')]=_0x2441c5[_0x2319('0x22')];this[_0x2319('0x23')]=_0x2441c5[_0x2319('0x23')];this[_0x2319('0x24')]=_[_0x2319('0x3')](_0x2441c5[_0x2319('0xb')])?_0x2441c5[_0x2319('0x24')]:_0x2441c5['Agent']['id'];this['VoiceQueueId']=_0x2441c5[_0x2319('0x25')];this[_0x2319('0x26')]='';this[_0x2319('0x27')]='';}Action[_0x2319('0x28')]['getCaller']=function(){return util[_0x2319('0xc')](_0x2319('0x29'),this[_0x2319('0xe')],this[_0x2319('0x2a')]);};module[_0x2319('0x2b')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 32c7073..032fbc5 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 _0xe0ae=['activeContact','linkedid','ANSWER','answertime','uniqueid','\x20Queue','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','[16]','[callProgressDetectingCustomer][logAnswerGlobal]','talktime','[syncHangup][talking][decrement]','BUSY','countbusyretry','Busy','busy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','dialBusyRetryFrequency','unlockAgent','NOANSWER','countnoanswerretry','NoAnswer','custom:agentnoanswer','noanswer','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','Congestion','custom:agentcongestion','congestion','cloneAction','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','CANCEL','countagentrejectretry','AgentReject','custom:agentreject','[syncHangupRequest][logAgentReject]','dialAgentRejectMaxRetry','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectRetryFrequency','ABANDONED','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','countabandonedretry','countmachineretry','cause-txt','dialstatus','amd','[callProgressDetectingCustomer][hangupInAMD]','custom:amd','[callProgressDetectingCustomer][machine]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[originated][decrement][callProgressDetectingCustomer]','originated:\x20','callProgressDetectingAgent','object','isUndefined','logAgent','createAgentHistory','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','checkInBlack','Contact','phone','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','idContact','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','Contact\x20in\x20black\x20List','SIP/%s','reachable','unmonitored','execRun','unlock','unlockContact','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20work','isActive','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','substring','callerid','getCallerIdRandom','getCallerId','dialRandomLastDigitCallerIdNumber','originatecalleridname','originatecalleridnum','extractCalleridNumber','addVariables','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','syncNewExten','actionid','logLookAgent','clone','responsetime','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','transfer','disableContact','[syncHangup][talking][transfer]','destlinkedid','variables','filterKey','keys','variable','value','error','[syncVarSet][Preview]','transfertargetlinkedid','transfererlinkedid','exports','bluebird','uuid','md5','../../../config/environment','../../../config/logger','./rpcDb','./action','./util/util','redis','prototype','enqueue','tail','finally','sequence','campaignsPreview','trunks','actions','agents','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','loopCampaigns','emit','type','outbound','name','answered','available','loggedIn','pTalking','sumDuration','sumHoldTime','talking','total','waiting','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','startPredictive','startProgressive','Trunk','active','Interval','stringify','format','voice:queue:%s','voice_queue:save','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_presence:remove','sendMessageOneNotActive','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','\x20is\x20disactive','syncCampaigns','clockClearZombieChannels','hasOwnProperty','preview','booked','clearZombieChannels','clearZombieChannel','[clearZombieChannels][talking]','Queue','queue','pTalking:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','status','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','info','[action]','size','getContactRecallMe','agentReadyId','then','isNil','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','setMessage','IsNotLoggedIn','AGENTS_NOT_LOGGED','dialActive','isTrunkReachable','TrunkBackup','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','Global','dialNoSuchNumberMaxRetry','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency'];(function(_0x380b14,_0x5ef1b6){var _0x2d3de8=function(_0x43303e){while(--_0x43303e){_0x380b14['push'](_0x380b14['shift']());}};_0x2d3de8(++_0x5ef1b6);}(_0xe0ae,0xa1));var _0xee0a=function(_0xd0a847,_0x72562b){_0xd0a847=_0xd0a847-0x0;var _0x2536ec=_0xe0ae[_0xd0a847];return _0x2536ec;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require(_0xee0a('0x0'));var uuid=require(_0xee0a('0x1'));var moment=require('moment');var md5=require(_0xee0a('0x2'));var Redis=require('ioredis');var config=require(_0xee0a('0x3'));var logger=require(_0xee0a('0x4'))('preview');var loggerAction=require(_0xee0a('0x4'))('actionPreview');var ami=require('../ami');var rpcDb=require(_0xee0a('0x5'));var Action=require(_0xee0a('0x6'));var ut=require(_0xee0a('0x7'));config[_0xee0a('0x8')]=_['defaults'](config[_0xee0a('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xee0a('0x8')]));var Sequence=function(){};Sequence[_0xee0a('0x9')][_0xee0a('0xa')]=function(_0x57d190){this[_0xee0a('0xb')]=this[_0xee0a('0xb')]?this['tail'][_0xee0a('0xc')](_0x57d190):_0x57d190();};function Preview(_0x4b3e49){this[_0xee0a('0xd')]=new Sequence();this[_0xee0a('0xe')]=_0x4b3e49['voiceQueues'];this[_0xee0a('0xf')]=_0x4b3e49['trunks'];this[_0xee0a('0x10')]={};this[_0xee0a('0x11')]=_0x4b3e49['agents'];this['clockClearZombieChannels']=0x0;ami['on'](_0xee0a('0x12'),this[_0xee0a('0x13')][_0xee0a('0x14')](this));ami['on'](_0xee0a('0x15'),this[_0xee0a('0x16')]['bind'](this));ami['on'](_0xee0a('0x17'),this[_0xee0a('0x18')]['bind'](this));ami['on'](_0xee0a('0x19'),this[_0xee0a('0x1a')][_0xee0a('0x14')](this));ami['on'](_0xee0a('0x1b'),this['syncNewExten'][_0xee0a('0x14')](this));ami['on'](_0xee0a('0x1c'),this[_0xee0a('0x1d')]['bind'](this));ami['on'](_0xee0a('0x1e'),this[_0xee0a('0x1f')][_0xee0a('0x14')](this));ami['on'](_0xee0a('0x20'),this['syncBlindTransfer'][_0xee0a('0x14')](this));this[_0xee0a('0x21')](this[_0xee0a('0xe')]);}function emit(_0x201d32,_0x5c981e,_0x2abfbd){io['to'](_0x201d32)[_0xee0a('0x22')](_0x5c981e,_0x2abfbd);}function emitCampaignPreview(_0x31e98a){if(_0x31e98a[_0xee0a('0x23')]===_0xee0a('0x24')){var _0x1eb176={'id':_0x31e98a['id'],'name':_0x31e98a[_0xee0a('0x25')],'strategy':_0x31e98a['strategy'],'answered':_0x31e98a[_0xee0a('0x26')],'available':_0x31e98a[_0xee0a('0x27')],'loggedIn':_0x31e98a[_0xee0a('0x28')],'pTalking':_0x31e98a[_0xee0a('0x29')],'sumBillable':_0x31e98a['sumBillable'],'sumDuration':_0x31e98a[_0xee0a('0x2a')],'sumHoldTime':_0x31e98a[_0xee0a('0x2b')]||0x0,'talking':_0x31e98a[_0xee0a('0x2c')],'total':_0x31e98a[_0xee0a('0x2d')],'type':_0x31e98a['type'],'unmanaged':_0x31e98a['unmanaged'],'abandoned':_0x31e98a['abandoned'],'waiting':_0x31e98a[_0xee0a('0x2e')],'loggedInDb':_0x31e98a['loggedInDb'],'dialActive':_0x31e98a['dialActive'],'dialMethod':_0x31e98a[_0xee0a('0x2f')],'dialOriginateCallerIdName':_0x31e98a[_0xee0a('0x30')],'dialOriginateCallerIdNumber':_0x31e98a[_0xee0a('0x31')],'dialOriginateTimeout':_0x31e98a['dialOriginateTimeout'],'dialPrefix':_0x31e98a[_0xee0a('0x32')],'outboundAnswerAgiCallsDay':_0x31e98a[_0xee0a('0x33')],'outboundAnswerCallsDay':_0x31e98a[_0xee0a('0x34')],'outboundBlacklistCallsDay':_0x31e98a[_0xee0a('0x35')],'outboundBusyCallsDay':_0x31e98a[_0xee0a('0x36')],'outboundCongestionCallsDay':_0x31e98a[_0xee0a('0x37')],'outboundDropCallsDayACS':_0x31e98a[_0xee0a('0x38')],'outboundDropCallsDayCallersExit':_0x31e98a[_0xee0a('0x39')],'outboundDropCallsDayTimeout':_0x31e98a[_0xee0a('0x3a')],'outboundNoAnswerCallsDay':_0x31e98a[_0xee0a('0x3b')],'outboundNoSuchCallsDay':_0x31e98a['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x31e98a[_0xee0a('0x3c')],'outboundReCallsDay':_0x31e98a[_0xee0a('0x3d')],'outboundRejectCallsDay':_0x31e98a[_0xee0a('0x3e')],'outboundUnknownCallsDay':_0x31e98a[_0xee0a('0x3f')],'outboundAbandonedCallsDay':_0x31e98a[_0xee0a('0x40')],'predictiveIntervalAnsweredCalls':_0x31e98a[_0xee0a('0x41')],'predictiveIntervalAvgHoldtime':_0x31e98a['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x31e98a[_0xee0a('0x42')],'predictiveIntervalDroppedCallsCallersExit':_0x31e98a[_0xee0a('0x43')],'predictiveIntervalDroppedCallsTimeout':_0x31e98a[_0xee0a('0x44')],'predictiveIntervalErlangCalls':_0x31e98a[_0xee0a('0x45')],'predictiveIntervalErlangCallsDroppedCalls':_0x31e98a['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x31e98a[_0xee0a('0x46')],'predictiveIntervalMultiplicativeFactor':_0x31e98a['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x31e98a[_0xee0a('0x47')],'predictiveIntervalAvailable':_0x31e98a[_0xee0a('0x48')],'predictiveIntervalTotalCalls':_0x31e98a[_0xee0a('0x49')],'message':_0x31e98a[_0xee0a('0x4a')],'originated':_0x31e98a[_0xee0a('0x4b')],'erlangCalls':_0x31e98a[_0xee0a('0x4c')],'erlangCallToSecond':_0x31e98a[_0xee0a('0x4d')],'erlangAbandonmentRate':_0x31e98a[_0xee0a('0x4e')],'erlangBusyFactor':_0x31e98a['erlangBusyFactor'],'startPredictive':_0x31e98a[_0xee0a('0x4f')],'startProgressive':_0x31e98a[_0xee0a('0x50')]};if(_0x31e98a['Trunk']){_0x1eb176[_0xee0a('0x51')]={'id':_0x31e98a[_0xee0a('0x51')]['id'],'name':_0x31e98a[_0xee0a('0x51')]['name'],'active':_0x31e98a[_0xee0a('0x51')][_0xee0a('0x52')],'callerid':_0x31e98a[_0xee0a('0x51')]['callerid']};}if(_0x31e98a[_0xee0a('0x53')]){_0x1eb176[_0xee0a('0x53')]={'id':_0x31e98a[_0xee0a('0x53')]['id'],'name':_0x31e98a['Interval']['name']};}var _0x7db483=md5(JSON[_0xee0a('0x54')](_0x1eb176));if(_0x31e98a[_0xee0a('0x2')]!==_0x7db483){_0x31e98a[_0xee0a('0x2')]=_0x7db483;emit(util[_0xee0a('0x55')](_0xee0a('0x56'),_0x1eb176[_0xee0a('0x25')]),_0xee0a('0x57'),_0x1eb176);}}}function emitVoiceQueueChannelRemove(_0x22d505){logger['info'](_0xee0a('0x58'),JSON[_0xee0a('0x54')](_0x22d505));emit(util['format'](_0xee0a('0x56'),_0x22d505[_0xee0a('0x25')]),'voice_queue_channel:remove',_0x22d505);io[_0xee0a('0x22')](_0xee0a('0x59'),_0x22d505);}function notSendMessagesQueue(_0x3a825e){if(_0x3a825e[_0xee0a('0x5a')]){if(_0x3a825e[_0xee0a('0x4b')]===0x0&&_0x3a825e[_0xee0a('0x29')]===0x0){_0x3a825e[_0xee0a('0x5a')]=![];_0x3a825e[_0xee0a('0x27')]=0x0;_0x3a825e[_0xee0a('0x5b')]=0x0;_0x3a825e['message']=_0xee0a('0x5c');ut[_0xee0a('0x5d')](_0xee0a('0x5e'),_0x3a825e[_0xee0a('0x25')]+'\x20is\x20not\x20active');}else{_0x3a825e['message']=_0xee0a('0x5f');ut[_0xee0a('0x5d')](_0xee0a('0x5e'),_0x3a825e[_0xee0a('0x25')]+_0xee0a('0x60'));}emitCampaignPreview(_0x3a825e);}}Preview[_0xee0a('0x9')][_0xee0a('0x21')]=function(){var _0x4c398c=this;setInterval(function(){_0x4c398c['syncCampaigns']();},0x7cf);};Preview[_0xee0a('0x9')][_0xee0a('0x61')]=function(){var _0x587ee3=this[_0xee0a('0xe')];this[_0xee0a('0x62')]+=0x1;for(var _0x5f2071 in _0x587ee3){if(_0x587ee3[_0xee0a('0x63')](_0x5f2071)&&(_0x587ee3[_0x5f2071][_0xee0a('0x2f')]===_0xee0a('0x64')||_0x587ee3[_0x5f2071][_0xee0a('0x2f')]===_0xee0a('0x65'))&&_0x587ee3[_0x5f2071][_0xee0a('0x23')]===_0xee0a('0x24')){if(this['clockClearZombieChannels']>0x7){this['clockClearZombieChannels']=0x0;this[_0xee0a('0x66')]();}}if(_0x587ee3['hasOwnProperty'](_0x5f2071)&&_0x587ee3[_0x5f2071]['dialMethod']==='preview'&&_0x587ee3[_0x5f2071][_0xee0a('0x23')]===_0xee0a('0x24')){if(_0x587ee3[_0x5f2071]['dialActive']){this['setMessage'](_0x587ee3[_0x5f2071]);if(_0x587ee3[_0x5f2071]['dialPreviewAutoRecallMe'])this['recallMe'](_0x587ee3[_0x5f2071]);}else{notSendMessagesQueue(_0x587ee3[_0x5f2071]);}}}};Preview[_0xee0a('0x9')][_0xee0a('0x67')]=function(_0x32fd2d){var _0x384986=this;this[_0xee0a('0xd')][_0xee0a('0xa')](function(){if(!_['isNil'](_0x384986[_0xee0a('0x10')][_0x32fd2d])){loggerAction['info'](_0xee0a('0x68'),_0x32fd2d,_0xee0a('0x69'),_0x384986[_0xee0a('0x10')][_0x32fd2d][_0xee0a('0x6a')],'originated:\x20',JSON[_0xee0a('0x54')](_0x384986[_0xee0a('0xe')][_0x384986[_0xee0a('0x10')][_0x32fd2d][_0xee0a('0x6a')]][_0xee0a('0x4b')]),_0xee0a('0x6b'),JSON[_0xee0a('0x54')](_0x384986['campaignsPreview'][_0x384986['actions'][_0x32fd2d][_0xee0a('0x6a')]][_0xee0a('0x29')]),JSON[_0xee0a('0x54')](_0x384986[_0xee0a('0x10')][_0x32fd2d][_0xee0a('0x6c')]),JSON[_0xee0a('0x54')](_[_0xee0a('0x6d')](_0x384986[_0xee0a('0x10')][_0x32fd2d],[_0xee0a('0x6e'),_0xee0a('0x6f'),_0xee0a('0x70'),_0xee0a('0x71')])));return ami['Action']({'action':_0xee0a('0x72'),'channel':_0x384986[_0xee0a('0x10')][_0x32fd2d][_0xee0a('0x73')]})[_0xee0a('0x74')](function(_0x29e137){if(_0x29e137['message']===_0xee0a('0x75')){setTimeout(function(){if(_0x384986[_0xee0a('0x10')][_0x32fd2d]){ut[_0xee0a('0x76')](_0x384986[_0xee0a('0xe')][_0x384986[_0xee0a('0x10')][_0x32fd2d]['queue']],_0xee0a('0x77'));if(_0x384986[_0xee0a('0x10')][_0x32fd2d][_0xee0a('0x6c')]===!![]){ut[_0xee0a('0x78')](_0x384986[_0xee0a('0xe')][_0x384986['actions'][_0x32fd2d][_0xee0a('0x6a')]],_0xee0a('0x77'));ut[_0xee0a('0x79')](_0xee0a('0x7a')+_0x32fd2d,_0x384986[_0xee0a('0x10')][_0x32fd2d][_0xee0a('0x6a')]);}ut[_0xee0a('0x79')](_0xee0a('0x7b')+_0x32fd2d,_0x384986[_0xee0a('0x10')][_0x32fd2d][_0xee0a('0x6a')]);delete _0x384986[_0xee0a('0x10')][_0x32fd2d];}},0x2328);}});}});};Preview[_0xee0a('0x9')][_0xee0a('0x66')]=function(){var _0x341f43=this;loggerAction[_0xee0a('0x7c')](_0xee0a('0x7d'),_[_0xee0a('0x7e')](this[_0xee0a('0x10')]));for(var _0x20d44a in this[_0xee0a('0x10')]){if(_0x341f43[_0xee0a('0x10')][_0xee0a('0x63')](_0x20d44a)){_0x341f43['clearZombieChannel'](_0x20d44a);}}};Preview['prototype']['recallMe']=function(_0x35eb93){var _0x557690=this;rpcDb[_0xee0a('0x7f')](_0x35eb93['id'],ut[_0xee0a('0x80')](this[_0xee0a('0x11')]))[_0xee0a('0x81')](function(_0x5d3b09){if(!_[_0xee0a('0x82')](_0x5d3b09)){for(var _0x27ae33=0x0;_0x27ae33<_0x5d3b09[_0xee0a('0x83')];_0x27ae33+=0x1){if(ut[_0xee0a('0x84')](_0x5d3b09[_0x27ae33][_0xee0a('0x85')])<_0x35eb93[_0xee0a('0x86')]*0x3c){if(_0x5d3b09[_0x27ae33][_0xee0a('0x87')]&&!_0x5d3b09[_0x27ae33][_0xee0a('0x87')][_0xee0a('0x88')]){_0x557690[_0xee0a('0x89')](_0x5d3b09[_0x27ae33]['id'])[_0xee0a('0x81')](ut[_0xee0a('0x8a')](_0xee0a('0x8b')))[_0xee0a('0x74')](ut['logger2'](_0xee0a('0x8b')));}else{rpcDb['disableContact'](_0x5d3b09[_0x27ae33]['id']);}}else{var _0x2dcfc5=new Action(_0x5d3b09[_0x27ae33],_0x35eb93);_0x2dcfc5[_0xee0a('0x8c')]=moment()['format'](_0xee0a('0x8d'));_0x35eb93['outboundReCallsDay']+=0x1;ut[_0xee0a('0x8e')](_0x2dcfc5,0x17,'RecallInQueue');if(_0x35eb93['dialRecallInQueue']){rpcDb['rescheduleContactInQueue'](ut[_0xee0a('0x8f')](_0x5d3b09[_0x27ae33]));rpcDb[_0xee0a('0x90')](_0x2dcfc5,_0xee0a('0x91'));}else{ut[_0xee0a('0x8e')](_0x2dcfc5,0x16,_0xee0a('0x92'));rpcDb[_0xee0a('0x90')](_0x2dcfc5,_0xee0a('0x93'));rpcDb[_0xee0a('0x94')](_0x2dcfc5,'[HistoryRecallClose]');}}}}})[_0xee0a('0x74')](ut['logger2']('[getContactRecallMe]'));};Preview[_0xee0a('0x9')][_0xee0a('0x95')]=function(_0x2aa5d3){_0x2aa5d3[_0xee0a('0x5a')]=!![];if(ut[_0xee0a('0x96')](_0x2aa5d3[_0xee0a('0x28')])){_0x2aa5d3[_0xee0a('0x4a')]=_0xee0a('0x97');}else if(!ut['isActive'](_0x2aa5d3[_0xee0a('0x98')])){_0x2aa5d3['message']=_0xee0a('0x5c');}else if(!this[_0xee0a('0x99')](_0x2aa5d3[_0xee0a('0x51')])){if(!this[_0xee0a('0x99')](_0x2aa5d3[_0xee0a('0x9a')])){_0x2aa5d3[_0xee0a('0x4a')]='TRUNK_IS_NOT_REACHABLE';}else{_0x2aa5d3[_0xee0a('0x4a')]=_0xee0a('0x9b');}}else{_0x2aa5d3[_0xee0a('0x4a')]='ACTIVE';}emitCampaignPreview(_0x2aa5d3);};Preview[_0xee0a('0x9')][_0xee0a('0x9c')]=function(_0x4d5c5b,_0x46e0b1,_0x4b76b9){var _0x491ea3=this;var _0x4d6583=this['actions'][_0x46e0b1];var _0x35e9f1=this['campaignsPreview'][_0x4d6583[_0xee0a('0x6a')]];var _0x5caa55;if(_0x35e9f1){switch(_0x4b76b9){case'1':_0x35e9f1[_0xee0a('0x9d')]+=0x1;_0x4d6583[_0xee0a('0x9e')]+=0x1;_0x4d6583[_0xee0a('0x9f')]=ut[_0xee0a('0xa0')](_0x4d6583);ut['logCustomer'](_0x4d6583,0x0,_0xee0a('0xa1'));ami[_0xee0a('0x22')](_0xee0a('0xa2'),ut[_0xee0a('0xa3')](_0x4d6583,_0xee0a('0xa4')));rpcDb['createCustomerHistory'](_0x4d6583,_0xee0a('0xa5'));if(ut[_0xee0a('0xa0')](_0x4d6583)>=_0x35e9f1[_0xee0a('0xa6')]){_0x5caa55=ut['cloneAction'](_0x4d6583,0xf,_0xee0a('0xa7'));rpcDb[_0xee0a('0x94')](_0x5caa55,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x4d6583[_0xee0a('0x9e')]>=_0x35e9f1[_0xee0a('0xa8')]){rpcDb[_0xee0a('0x94')](_0x4d6583,_0xee0a('0xa9'));}else{rpcDb[_0xee0a('0xaa')](ut[_0xee0a('0xab')](_0x4d6583,_0xee0a('0x9e'),_0x35e9f1[_0xee0a('0xac')]),_0x4d6583['unlockAgent'],_0x4d6583[_0xee0a('0xad')]);}}delete this[_0xee0a('0x10')][_0x4d5c5b[_0xee0a('0xae')]];break;case _0xee0a('0xaf'):var _0x8da3af=moment()[_0xee0a('0x55')](_0xee0a('0x8d'));_0x4d6583['responsetime']=_0x8da3af;_0x4d6583[_0xee0a('0xb0')]=_0x8da3af;_0x4d6583[_0xee0a('0x6c')]=!![];_0x35e9f1[_0xee0a('0x29')]+=0x1;logger[_0xee0a('0x7c')]('[syncHangup][talking][increment]',_0x4d6583[_0xee0a('0xb1')],_0xee0a('0xb2'),_0x35e9f1[_0xee0a('0x25')],_0xee0a('0x6b'),_0x35e9f1[_0xee0a('0x29')]);ami['emit']('custom:agentconnect',ut[_0xee0a('0xa3')](_0x4d6583,_0xee0a('0xb3'),this[_0xee0a('0xe')][_0x4d6583['queue']]));if(_0x35e9f1[_0xee0a('0xb4')]){ami[_0xee0a('0x22')](_0xee0a('0xb5'),ut[_0xee0a('0xb6')](_0x4d6583));}break;case'16':ami[_0xee0a('0x22')](_0xee0a('0xb7'),ut[_0xee0a('0xa3')](_0x4d6583,_0xee0a('0xb8'),this['campaignsPreview'][_0x4d6583[_0xee0a('0x6a')]]));emitVoiceQueueChannelRemove(ut[_0xee0a('0xa3')](_0x4d6583,_0xee0a('0xb8')));_0x35e9f1[_0xee0a('0x34')]+=0x1;_0x35e9f1[_0xee0a('0x2d')]+=0x1;_0x35e9f1['answered']+=0x1;ut[_0xee0a('0x78')](_0x35e9f1,_0xee0a('0xb9'));_0x4d6583[_0xee0a('0x9f')]=ut[_0xee0a('0xa0')](_0x4d6583);ut[_0xee0a('0x8e')](_0x4d6583,0x4,'Answer');rpcDb['createCustomerHistory'](_0x4d6583,'[callProgressDetectingCustomer][logAnswer]');rpcDb['createCustomerFinal'](_0x4d6583,_0xee0a('0xba'));rpcDb['crateCustomerReportQueue'](_0x4d6583);_0x35e9f1[_0xee0a('0x2a')]+=_0x4d6583[_0xee0a('0xbb')];_0x35e9f1['sumBillable']+=_0x4d6583[_0xee0a('0xbb')];logger['info'](_0xee0a('0xbc'),_0x4d6583[_0xee0a('0xb1')],_0xee0a('0xb2'),_0x35e9f1[_0xee0a('0x25')],'pTalking:\x20',_0x35e9f1[_0xee0a('0x29')]);delete this[_0xee0a('0x10')][_0x4d5c5b[_0xee0a('0xae')]];break;case _0xee0a('0xbd'):_0x35e9f1['outboundBusyCallsDay']+=0x1;_0x4d6583[_0xee0a('0xbe')]+=0x1;_0x4d6583[_0xee0a('0x9f')]=ut[_0xee0a('0xa0')](_0x4d6583);ut[_0xee0a('0x8e')](_0x4d6583,0x5,_0xee0a('0xbf'));ami[_0xee0a('0x22')]('custom:agentbusy',ut[_0xee0a('0xa3')](_0x4d6583,_0xee0a('0xc0')));rpcDb[_0xee0a('0x90')](_0x4d6583,_0xee0a('0xc1'));if(ut[_0xee0a('0xa0')](_0x4d6583)>=_0x35e9f1[_0xee0a('0xa6')]){_0x5caa55=ut['cloneAction'](_0x4d6583,0xf,_0xee0a('0xa7'));rpcDb[_0xee0a('0x94')](_0x5caa55,_0xee0a('0xc2'));}else{if(_0x4d6583[_0xee0a('0xbe')]>=_0x35e9f1[_0xee0a('0xc3')]){rpcDb[_0xee0a('0x94')](_0x4d6583,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0xee0a('0xaa')](ut[_0xee0a('0xab')](_0x4d6583,_0xee0a('0xbe'),_0x35e9f1[_0xee0a('0xc4')]),_0x4d6583[_0xee0a('0xc5')],_0x4d6583[_0xee0a('0xad')]);}}break;case _0xee0a('0xc6'):_0x35e9f1[_0xee0a('0x3b')]+=0x1;_0x4d6583[_0xee0a('0xc7')]+=0x1;_0x4d6583[_0xee0a('0x9f')]=ut[_0xee0a('0xa0')](_0x4d6583);ut[_0xee0a('0x8e')](_0x4d6583,0x3,_0xee0a('0xc8'));ami[_0xee0a('0x22')](_0xee0a('0xc9'),ut['buildObj'](_0x4d6583,_0xee0a('0xca')));rpcDb[_0xee0a('0x90')](_0x4d6583,'[callProgressDetectingCustomer][logNoAnswer]');if(ut[_0xee0a('0xa0')](_0x4d6583)>=_0x35e9f1[_0xee0a('0xa6')]){_0x5caa55=ut['cloneAction'](_0x4d6583,0xf,'Global');rpcDb[_0xee0a('0x94')](_0x5caa55,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x4d6583[_0xee0a('0xc7')]>=_0x35e9f1[_0xee0a('0xcb')]){rpcDb['createCustomerFinal'](_0x4d6583,_0xee0a('0xcc'));}else{rpcDb[_0xee0a('0xaa')](ut[_0xee0a('0xab')](_0x4d6583,_0xee0a('0xc7'),_0x35e9f1[_0xee0a('0xcd')]),_0x4d6583['unlockAgent'],_0x4d6583[_0xee0a('0xad')]);}}break;case _0xee0a('0xce'):_0x35e9f1[_0xee0a('0x37')]+=0x1;_0x4d6583[_0xee0a('0xcf')]+=0x1;_0x4d6583[_0xee0a('0x9f')]=ut[_0xee0a('0xa0')](_0x4d6583);ut[_0xee0a('0x8e')](_0x4d6583,0x8,_0xee0a('0xd0'));ami[_0xee0a('0x22')](_0xee0a('0xd1'),ut[_0xee0a('0xa3')](_0x4d6583,_0xee0a('0xd2')));rpcDb[_0xee0a('0x90')](_0x4d6583,'[callProgressDetectingCustomer][logCongestion]');if(ut[_0xee0a('0xa0')](_0x4d6583)>=_0x35e9f1['dialGlobalMaxRetry']){_0x5caa55=ut[_0xee0a('0xd3')](_0x4d6583,0xf,_0xee0a('0xa7'));rpcDb[_0xee0a('0x94')](_0x5caa55,_0xee0a('0xd4'));}else{if(_0x4d6583['countcongestionretry']>=_0x35e9f1[_0xee0a('0xd5')]){rpcDb['createCustomerFinal'](_0x4d6583,_0xee0a('0xd6'));}else{rpcDb[_0xee0a('0xaa')](ut['scheduledAt'](_0x4d6583,_0xee0a('0xcf'),_0x35e9f1[_0xee0a('0xc4')]),_0x4d6583[_0xee0a('0xc5')],_0x4d6583[_0xee0a('0xad')]);}}break;case _0xee0a('0xd7'):_0x35e9f1[_0xee0a('0x3e')]+=0x1;_0x4d6583[_0xee0a('0xd8')]+=0x1;_0x4d6583[_0xee0a('0x9f')]=ut['totalGlobal'](_0x4d6583);ut['logCustomer'](_0x4d6583,0x14,_0xee0a('0xd9'));ami[_0xee0a('0x22')](_0xee0a('0xda'),ut[_0xee0a('0xa3')](_0x4d6583,'agentreject'));rpcDb[_0xee0a('0x90')](_0x4d6583,_0xee0a('0xdb'));if(ut[_0xee0a('0xa0')](_0x4d6583)>=_0x35e9f1[_0xee0a('0xa6')]){_0x5caa55=ut[_0xee0a('0xd3')](_0x4d6583,0x14,_0xee0a('0xd9'));rpcDb['createCustomerFinal'](_0x5caa55,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x4d6583[_0xee0a('0xd8')]>=_0x35e9f1[_0xee0a('0xdc')]){rpcDb[_0xee0a('0x94')](_0x4d6583,_0xee0a('0xdd'));}else{rpcDb[_0xee0a('0xaa')](ut[_0xee0a('0xab')](_0x4d6583,_0xee0a('0xd8'),_0x35e9f1[_0xee0a('0xde')]),_0x4d6583['unlockAgent'],_0x4d6583[_0xee0a('0xad')]);}}break;case _0xee0a('0xdf'):_0x35e9f1['outboundAbandonedCallsDay']+=0x1;_0x4d6583['countabandonedretry']+=0x1;_0x4d6583[_0xee0a('0x9f')]=ut[_0xee0a('0xa0')](_0x4d6583);ut[_0xee0a('0x8e')](_0x4d6583,0xb,_0xee0a('0xe0'));rpcDb[_0xee0a('0x90')](_0x4d6583,'[callProgressDetectingCustomer][logAbandoned]');if(ut[_0xee0a('0xa0')](_0x4d6583)>=_0x35e9f1[_0xee0a('0xa6')]){_0x5caa55=ut['cloneAction'](_0x4d6583,0xf,_0xee0a('0xa7'));rpcDb['createCustomerFinal'](_0x5caa55,_0xee0a('0xe1'));}else{if(_0x4d6583[_0xee0a('0xe2')]>=_0x35e9f1[_0xee0a('0xe3')]){rpcDb['createCustomerFinal'](_0x4d6583,_0xee0a('0xe1'));}else{rpcDb[_0xee0a('0xaa')](ut[_0xee0a('0xab')](_0x4d6583,_0xee0a('0xe4'),_0x35e9f1['dialAbandonedRetryFrequency']),_0x4d6583['unlockAgent'],_0x4d6583['activeContact']);}}break;case'18':_0x35e9f1[_0xee0a('0x3f')]+=0x1;_0x4d6583[_0xee0a('0xe5')]+=0x1;_0x4d6583[_0xee0a('0x9f')]=ut['totalGlobal'](_0x4d6583);ut['logCustomer'](_0x4d6583,0x12,_0x4d5c5b[_0xee0a('0xe6')]||_0x4d5c5b[_0xee0a('0xe7')]);ami[_0xee0a('0x22')]('custom:amd',ut['buildObj'](_0x4d6583,_0xee0a('0xe8')));rpcDb['createCustomerHistory'](_0x4d6583,_0xee0a('0xe9'));if(ut[_0xee0a('0xa0')](_0x4d6583)>=_0x35e9f1[_0xee0a('0xa6')]){_0x5caa55=ut[_0xee0a('0xd3')](_0x4d6583,0xf,'Global');rpcDb[_0xee0a('0x94')](_0x5caa55,_0xee0a('0xe9'));}else{rpcDb[_0xee0a('0x94')](_0x4d6583,_0xee0a('0xe9'));}delete this[_0xee0a('0x10')][_0x4d5c5b[_0xee0a('0xae')]];break;case'19':_0x35e9f1[_0xee0a('0x3f')]+=0x1;_0x4d6583[_0xee0a('0x9f')]=ut[_0xee0a('0xa0')](_0x4d6583);ut[_0xee0a('0x8e')](_0x4d6583,0x13,_0x4d5c5b[_0xee0a('0xe6')]||_0x4d5c5b[_0xee0a('0xe7')]);ami['emit'](_0xee0a('0xea'),ut['buildObj'](_0x4d6583,_0xee0a('0xe8')));rpcDb[_0xee0a('0x90')](_0x4d6583,_0xee0a('0xeb'));if(ut[_0xee0a('0xa0')](_0x4d6583)>=_0x35e9f1[_0xee0a('0xa6')]){_0x5caa55=ut['cloneAction'](_0x4d6583,0xf,_0xee0a('0xa7'));rpcDb[_0xee0a('0x94')](_0x5caa55,'[callProgressDetectingCustomer][machine]');}else{rpcDb[_0xee0a('0x94')](_0x4d6583,_0xee0a('0xeb'));}delete this[_0xee0a('0x10')][_0x4d5c5b[_0xee0a('0xae')]];break;default:if(_0x4d6583[_0xee0a('0x6c')]){ut[_0xee0a('0x78')](_0x35e9f1,'[default]');ut[_0xee0a('0x79')](_0xee0a('0xec')+_0x35e9f1[_0xee0a('0x25')],_0x4d5c5b);}_0x35e9f1[_0xee0a('0x3f')]+=0x1;_0x4d6583[_0xee0a('0x9f')]=ut['totalGlobal'](_0x4d6583);ut[_0xee0a('0x8e')](_0x4d6583,0xc,_0x4d5c5b[_0xee0a('0xe6')]||_0x4d5c5b[_0xee0a('0xe7')]);rpcDb[_0xee0a('0x90')](_0x4d6583,_0xee0a('0xed'));if(ut[_0xee0a('0xa0')](_0x4d6583)>=_0x35e9f1['dialGlobalMaxRetry']){_0x5caa55=ut['cloneAction'](_0x4d6583,0xf,_0xee0a('0xa7'));rpcDb['createCustomerFinal'](_0x5caa55,_0xee0a('0xee'));}else{rpcDb[_0xee0a('0x94')](_0x4d6583,_0xee0a('0xee'));}delete this[_0xee0a('0x10')][_0x4d5c5b[_0xee0a('0xae')]];}if(!(_0x4d6583['dialAnswer']&&_0x4b76b9==='16')){ut[_0xee0a('0x76')](_0x35e9f1,'[callProgressDetectingCustomer]');logger[_0xee0a('0x7c')](_0xee0a('0xef'),_0x4d6583['uniqueid'],_0xee0a('0xb2'),_0x35e9f1[_0xee0a('0x25')],_0xee0a('0xf0'),_0x35e9f1['originated']);}if(_0x4b76b9!==_0xee0a('0xaf')){delete this[_0xee0a('0x10')][_0x4d5c5b[_0xee0a('0xae')]];delete this[_0xee0a('0x10')][_0x4d5c5b['destlinkedid']];}}};Preview[_0xee0a('0x9')][_0xee0a('0xf1')]=function(_0x5d64e4,_0x4f8c4e,_0x1991a3){if(_['isUndefined'](_0x4f8c4e)&&_0xee0a('0xf2')!==typeof _0x4f8c4e){return;}if(_[_0xee0a('0xf3')](_0x1991a3)&&_0xee0a('0xf2')!==typeof _0x1991a3){return;}switch(_0x1991a3['reason']){case'0':ut[_0xee0a('0xf4')](_0x5d64e4,0x0,_0xee0a('0xa1'));rpcDb[_0xee0a('0xf5')](_0x5d64e4,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut['logAgent'](_0x5d64e4,0x3,_0xee0a('0xc8'));rpcDb[_0xee0a('0xf5')](_0x5d64e4,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut[_0xee0a('0xf4')](_0x5d64e4,0x5,_0xee0a('0xbf'));rpcDb[_0xee0a('0xf5')](_0x5d64e4,_0xee0a('0xf6'));break;case'8':ut['logAgent'](_0x5d64e4,0x8,'Congestion');rpcDb[_0xee0a('0xf5')](_0x5d64e4,_0xee0a('0xf7'));break;case'22':ut[_0xee0a('0xf4')](_0x5d64e4,0x16,_0xee0a('0xf8'));rpcDb[_0xee0a('0xf5')](_0x5d64e4,_0xee0a('0xf9'));break;default:ut[_0xee0a('0xf4')](_0x5d64e4,0xc,_0x1991a3['reason']);rpcDb[_0xee0a('0xf5')](_0x5d64e4,'[callProgressDetectingAgent][logCongestion]');}ut[_0xee0a('0x76')](_0x4f8c4e,_0xee0a('0xfa'));logger[_0xee0a('0x7c')]('[originated][decrement][callProgressDetectingAgent]',_0x5d64e4[_0xee0a('0xb1')],_0xee0a('0xb2'),_0x4f8c4e[_0xee0a('0x25')],_0xee0a('0xf0'),_0x4f8c4e['originated']);delete this[_0xee0a('0x10')][_0x5d64e4[_0xee0a('0xb1')]];};Preview['prototype'][_0xee0a('0xfb')]=function(_0x42785e,_0x43eee5,_0x5afce7,_0x310487,_0x2c546f){var _0x27c900=this;return new BPromise(function(_0x323dca,_0x168ac6){if(_[_0xee0a('0x82')](_0x43eee5)||_[_0xee0a('0x82')](_0x43eee5[_0xee0a('0xfc')])||_[_0xee0a('0x82')](_0x43eee5[_0xee0a('0xfc')][_0xee0a('0xfd')])||_[_0xee0a('0x82')](_0x43eee5[_0xee0a('0x70')])){_0x168ac6(ut[_0xee0a('0x4a')]('Contact\x20is\x20undefined',_0x310487,_0x2c546f));return;}var _0x94eb26=uuid['v4']();var _0x33d0ad=_0x27c900['campaignsPreview'][_0x43eee5[_0xee0a('0x69')][_0xee0a('0x25')]];var _0x368678=_0x5afce7?_0x27c900['agents'][_0x5afce7]['id']:undefined;_0x27c900[_0xee0a('0x10')][_0x94eb26]=new Action(_0x43eee5,_0x33d0ad,_0x94eb26,_0x5afce7,_0x368678);var _0x15a09a=_0x27c900[_0xee0a('0x10')][_0x94eb26];_0x15a09a[_0xee0a('0xc5')]=_0x310487;_0x15a09a['activeContact']=_0x2c546f;_0x15a09a[_0xee0a('0xfe')]=_0x5afce7;if(_[_0xee0a('0xff')](_0x42785e)){_0x27c900[_0xee0a('0x100')](_0x15a09a,_0x33d0ad,_0x43eee5,_0x5afce7)['then'](function(_0x48d951){logger[_0xee0a('0x7c')](_0xee0a('0x101'),_0xee0a('0x102')+_0x15a09a[_0xee0a('0x6a')]+_0xee0a('0x103')+_0x15a09a[_0xee0a('0x104')],JSON[_0xee0a('0x54')](_0x48d951));ami[_0xee0a('0x22')](_0xee0a('0x105'),ut[_0xee0a('0xa3')](_0x15a09a,_0xee0a('0x106'),_0x27c900[_0xee0a('0xe')][_0x15a09a[_0xee0a('0x6a')]]));_0x323dca(ut[_0xee0a('0x4a')](_0xee0a('0x107')));})['catch'](function(_0x4db028){ut['logger'](_0xee0a('0x108'),_0x4db028);_0x168ac6(ut[_0xee0a('0x4a')](_0xee0a('0x109'),_0x310487,_0x2c546f));});}else{_0x33d0ad[_0xee0a('0x35')]+=0x1;ut[_0xee0a('0x10a')](_0x15a09a);rpcDb['createHistory'](_0x15a09a,'[Blacklist][error]');delete _0x27c900[_0xee0a('0x10')][_0x94eb26];_0x168ac6(ut['message'](_0xee0a('0x10b'),_0x310487,_0x2c546f));}});};Preview['prototype'][_0xee0a('0x99')]=function(_0x49cf8a){return!_[_0xee0a('0x82')](_0x49cf8a)&&!_[_0xee0a('0x82')](_0x49cf8a[_0xee0a('0x25')])&&!_[_0xee0a('0x82')](_0x49cf8a[_0xee0a('0x52')])&&_0x49cf8a[_0xee0a('0x52')]&&!_[_0xee0a('0x82')](this['trunks'][util[_0xee0a('0x55')](_0xee0a('0x10c'),_0x49cf8a[_0xee0a('0x25')])])&&!_[_0xee0a('0x82')](this[_0xee0a('0xf')][util['format'](_0xee0a('0x10c'),_0x49cf8a['name'])]['status'])&&(this[_0xee0a('0xf')][util[_0xee0a('0x55')]('SIP/%s',_0x49cf8a[_0xee0a('0x25')])][_0xee0a('0x72')]===_0xee0a('0x10d')||this['trunks'][util[_0xee0a('0x55')](_0xee0a('0x10c'),_0x49cf8a[_0xee0a('0x25')])]['status']===_0xee0a('0x10e'));};Preview[_0xee0a('0x9')]['run']=function(_0x55536a,_0x1ebc56){var _0x5c6b26=this;return new BPromise(function(_0x10f7c6,_0xbb16c5){_0x5c6b26[_0xee0a('0x10f')](_0x55536a,_0x1ebc56)[_0xee0a('0x81')](function(_0xc5c619){_0x10f7c6(_[_0xee0a('0x6d')](_0xc5c619,[_0xee0a('0x4a')]));})[_0xee0a('0x74')](function(_0x343ee3){if(_0x343ee3[_0xee0a('0x110')]){rpcDb[_0xee0a('0x111')](_0x55536a);}if(_0x343ee3[_0xee0a('0x52')]){rpcDb['disableContact'](_0x55536a);}_0xbb16c5(_[_0xee0a('0x6d')](_0x343ee3,[_0xee0a('0x4a')]));});});};Preview[_0xee0a('0x9')][_0xee0a('0x10f')]=function(_0x5ed20b,_0x2b330e){var _0x4379ad=this;return new BPromise(function(_0x10c3f4,_0x1b8053){var _0x1ce389,_0xc27a48;rpcDb['getContactPreview'](_0x5ed20b)['then'](function(_0x325c16){if(!_['isNil'](_0x325c16[0x0])){_0xc27a48=_0x325c16[0x0][_0xee0a('0x112')]?![]:!![];_0x1ce389=_0x325c16[0x0][_0xee0a('0x112')]?!![]:![];_0x1ce389=_0x2b330e?!![]:_0x1ce389;}var _0x2d6018=_0x4379ad[_0xee0a('0x113')](_0x325c16);if(_0x2d6018[_0xee0a('0x114')]){rpcDb[_0xee0a('0x115')](_[_0xee0a('0x6d')](_0x325c16[0x0],['VoiceQueueId',_0xee0a('0x116')]))[_0xee0a('0x81')](function(_0x2a1075){_0x4379ad[_0xee0a('0xfb')](_0x2a1075,_0x325c16[0x0],_0x2b330e,_0xc27a48,_0x1ce389)[_0xee0a('0x81')](function(_0x3d72f5){_0x10c3f4(_0x3d72f5);})['catch'](function(_0x435f72){_0x1b8053(_0x435f72);});})['catch'](function(_0x5ec2c7){ut[_0xee0a('0x5d')](_0xee0a('0x117'),_0x5ec2c7);_0x1b8053(ut[_0xee0a('0x4a')](_0xee0a('0x118'),_0xc27a48,_0x1ce389));});}else{_0x1b8053(ut[_0xee0a('0x4a')](_0x2d6018['message'],_0xc27a48,_0x1ce389));}})[_0xee0a('0x74')](function(_0x44b3eb){ut[_0xee0a('0x5d')](_0xee0a('0x119'),_0x44b3eb);_0x1b8053(ut[_0xee0a('0x4a')]('Call\x20unsuccessful',![],!![]));});});};Preview[_0xee0a('0x9')][_0xee0a('0x113')]=function(_0x150b6f){if(_['isNil'](_0x150b6f)||_['isEmpty'](_0x150b6f)||!_[_0xee0a('0x82')](_0x150b6f[0x0][_0xee0a('0x87')])&&_[_0xee0a('0x82')](_0x150b6f[0x0][_0xee0a('0x87')][_0xee0a('0x25')])){ut[_0xee0a('0x5d')]('[Preview][validateContact][Empty\x20Contact]',_0x150b6f);return{'isValid':![],'message':_0xee0a('0x11a')};}var _0x746b58=this[_0xee0a('0xe')][_0x150b6f[0x0]['Queue'][_0xee0a('0x25')]];_0x746b58[_0xee0a('0x4a')]=_0xee0a('0x9b');if(_['isNil'](_0x746b58)){ut[_0xee0a('0x5d')](_0xee0a('0x11b'),_0x746b58);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0xee0a('0x99')](_0x746b58[_0xee0a('0x51')])){ut['logger'](_0xee0a('0x11c'),_0xee0a('0x11d')+_0x746b58[_0xee0a('0x25')]+_0xee0a('0x11e'));if(!this['isTrunkReachable'](_0x746b58[_0xee0a('0x9a')])){ut['logger'](_0xee0a('0x11c'),_0x746b58[_0xee0a('0x25')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0xee0a('0x11f')};}}if(!ut[_0xee0a('0x120')](_0x746b58[_0xee0a('0x98')])){ut[_0xee0a('0x5d')](_0xee0a('0x121'),_0x746b58[_0xee0a('0x25')]+_0xee0a('0x122'));return{'isValid':![],'message':_0xee0a('0x11d')+_0x746b58[_0xee0a('0x25')]+_0xee0a('0x122')};}return{'isValid':!![],'message':_0xee0a('0x123')};};Preview['prototype'][_0xee0a('0x100')]=function(_0x384edc,_0x59b741,_0x15bb10,_0x509e7b){var _0xb7969d=this;return new BPromise(function(_0x314337,_0x5bf973){var _0x2277af=_0x384edc[_0xee0a('0xb1')];var _0x2d9c2e=_0xb7969d[_0xee0a('0x99')](_0x59b741[_0xee0a('0x51')])?util[_0xee0a('0x55')](_0xee0a('0x124'),_0x59b741[_0xee0a('0x51')][_0xee0a('0x25')],_[_0xee0a('0x82')](_0x59b741[_0xee0a('0x32')])?'':_0x59b741['dialPrefix'][_0xee0a('0x125')]()||'',_0x59b741[_0xee0a('0x126')]>0x0?_0x15bb10[_0xee0a('0xfc')][_0xee0a('0xfd')]['substring'](_0x59b741[_0xee0a('0x126')]):_0x15bb10[_0xee0a('0xfc')]['phone']):util[_0xee0a('0x55')](_0xee0a('0x124'),_[_0xee0a('0x82')](_0x59b741[_0xee0a('0x9a')])?_0x59b741['Trunk'][_0xee0a('0x25')]:_0x59b741[_0xee0a('0x9a')][_0xee0a('0x25')],_['isNil'](_0x59b741[_0xee0a('0x32')])?'':_0x59b741[_0xee0a('0x32')][_0xee0a('0x125')]()||'',_0x59b741['dialCutDigit']>0x0?_0x15bb10[_0xee0a('0xfc')]['phone'][_0xee0a('0x127')](_0x59b741[_0xee0a('0x126')]):_0x15bb10[_0xee0a('0xfc')][_0xee0a('0xfd')]);var _0x196a40=_0xb7969d[_0xee0a('0x99')](_0x59b741['Trunk'])?ut['getCallerId'](_0x59b741['Trunk'][_0xee0a('0x128')],_0x59b741[_0xee0a('0x30')],_0x59b741['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0xee0a('0x129')](_0x59b741[_0xee0a('0x31')],_0x59b741['dialRandomLastDigitCallerIdNumber']):_0x59b741[_0xee0a('0x31')]):ut[_0xee0a('0x12a')](_[_0xee0a('0x82')](_0x59b741[_0xee0a('0x9a')])?_0x59b741['Trunk'][_0xee0a('0x128')]:_0x59b741[_0xee0a('0x9a')][_0xee0a('0x128')],_0x59b741[_0xee0a('0x30')],_0x59b741[_0xee0a('0x12b')]>0x0?ut[_0xee0a('0x129')](_0x59b741['dialOriginateCallerIdNumber'],_0x59b741['dialRandomLastDigitCallerIdNumber']):_0x59b741[_0xee0a('0x31')]);if(_0x196a40){_0x384edc[_0xee0a('0x12c')]=ut['extractCalleridName'](_0x196a40);_0x384edc[_0xee0a('0x12d')]=ut[_0xee0a('0x12e')](_0x196a40);}var _0x23ad5f=ut[_0xee0a('0x12f')](_0x59b741,_0x15bb10,_0x2d9c2e,_0x196a40,_0x2277af,_0x384edc);_['merge'](_0x384edc,ut['toLowerVariables'](_0x23ad5f));_0x384edc[_0xee0a('0x8c')]=moment()[_0xee0a('0x55')](_0xee0a('0x8d'));ami['Action'](ut[_0xee0a('0x130')](_0x384edc,_0x59b741,_0x23ad5f,_0x384edc['activeContact'],_0x509e7b))[_0xee0a('0x81')](function(_0x2dada9){_0x59b741[_0xee0a('0x4b')]+=0x1;logger[_0xee0a('0x7c')](_0xee0a('0x131'),_0x2277af,_0xee0a('0xb2'),_0x59b741[_0xee0a('0x25')],_0xee0a('0xf0'),_0x59b741[_0xee0a('0x4b')]);_0x314337(_0x2dada9);})[_0xee0a('0x74')](function(_0x5e3794){ut[_0xee0a('0xf4')](_0x384edc,0xe,_0xee0a('0x132'));rpcDb['createAgentHistory'](_0x384edc,_0xee0a('0x133'));_0x5bf973(_0x5e3794);});});};Preview[_0xee0a('0x9')][_0xee0a('0x134')]=function(_0x1ab4b6){if(this[_0xee0a('0x10')][_0x1ab4b6[_0xee0a('0xae')]]){this[_0xee0a('0x10')][_0x1ab4b6['linkedid']][_0xee0a('0x73')]=_0x1ab4b6[_0xee0a('0x73')];}};Preview[_0xee0a('0x9')]['syncOriginateResponse']=function(_0x5d430f){var _0x15308d=this;var _0x309582=this[_0xee0a('0x10')][_0x5d430f[_0xee0a('0x135')]];if(_0x309582){if(_0x309582['lookAgent']&&this[_0xee0a('0x11')][_0x309582[_0xee0a('0xfe')]]){ut[_0xee0a('0x136')](_0x309582,this[_0xee0a('0x11')][_0x309582['lookAgent']][_0xee0a('0x25')],this[_0xee0a('0x11')][_0x309582[_0xee0a('0xfe')]]['id']);}var _0xe89b7f=_[_0xee0a('0x137')](_0x309582);_0xe89b7f[_0xee0a('0x138')]=moment()[_0xee0a('0x55')]('YYYY-MM-DD\x20HH:mm:ss');var _0x532c59=_0x15308d[_0xee0a('0xe')][_0x309582['queue']];if(ut['isFailure'](_0x5d430f['response'])){if(_0x309582[_0xee0a('0xc5')]){rpcDb[_0xee0a('0x111')](_0x309582['idContact']);}if(_0x309582[_0xee0a('0xad')]){rpcDb['disableContact'](_0x309582['idContact']);}ami['emit'](_0xee0a('0x139'),ut[_0xee0a('0xa3')](_0x309582,_0xee0a('0x13a'),this[_0xee0a('0xe')][_0x309582[_0xee0a('0x6a')]]));this[_0xee0a('0xf1')](_0xe89b7f,_0x532c59,_0x5d430f);}else{_0x309582['starttime']=moment()[_0xee0a('0x55')](_0xee0a('0x8d'));ut[_0xee0a('0xf4')](_0xe89b7f,0x4,'Answer');rpcDb[_0xee0a('0xf5')](_0xe89b7f,_0xee0a('0x13b'));}}};Preview[_0xee0a('0x9')]['syncHangup']=function(_0x3e9cc7){var _0x54f144=this;var _0x31c277=this['actions'][_0x3e9cc7[_0xee0a('0xae')]];var _0x32d8c5;if(_0x31c277){_0x32d8c5=this['campaignsPreview'][_0x31c277[_0xee0a('0x6a')]];logger[_0xee0a('0x7c')](_0xee0a('0x13c'),_0x3e9cc7[_0xee0a('0xae')],'\x20Queue',_0x32d8c5[_0xee0a('0x25')],_0xee0a('0x6b'),_0x32d8c5['pTalking']);}if(this[_0xee0a('0x10')][_0x3e9cc7[_0xee0a('0xae')]]&&_0x3e9cc7[_0xee0a('0xae')]!==_0x3e9cc7[_0xee0a('0xb1')]){if(_0x3e9cc7[_0xee0a('0x13d')]==='16'&&this['actions'][_0x3e9cc7['linkedid']][_0xee0a('0x6c')]){this[_0xee0a('0x9c')](_0x3e9cc7,_0x3e9cc7[_0xee0a('0xae')],_0x3e9cc7[_0xee0a('0x13d')]);}else if(this[_0xee0a('0x10')][_0x3e9cc7[_0xee0a('0xae')]]['dialAnswer']){logger[_0xee0a('0x7c')](_0xee0a('0x13e'),_0x3e9cc7[_0xee0a('0xae')],_0x3e9cc7['cause'],_0xee0a('0xb2'),_0x32d8c5[_0xee0a('0x25')],_0xee0a('0x6b'),_0x32d8c5[_0xee0a('0x29')]);this['callProgressDetectingCustomer'](_0x3e9cc7,_0x3e9cc7[_0xee0a('0xae')],_0x3e9cc7[_0xee0a('0x13d')]);}}else if(_0x31c277&&_['isNil'](_0x31c277[_0xee0a('0x13f')])&&_0x32d8c5['dialQueueProject']&&_0x3e9cc7['linkedid']===_0x3e9cc7[_0xee0a('0xb1')]&&_['isNil'](_0x3e9cc7['reason'])&&_0x3e9cc7[_0xee0a('0x13d')]==='16'&&_0x3e9cc7['channelstate']==='6'&&_[_0xee0a('0xf3')](_0x31c277[_0xee0a('0x140')])){if(_0x31c277[_0xee0a('0xc5')]){rpcDb[_0xee0a('0x111')](_0x31c277[_0xee0a('0x104')]);}if(_0x31c277[_0xee0a('0xad')]){rpcDb[_0xee0a('0x141')](_0x31c277[_0xee0a('0x104')]);}_0x3e9cc7['reason']='22';this['callProgressDetectingAgent'](_0x31c277,_0x32d8c5,_0x3e9cc7);}else if(_0x31c277&&_0x31c277['transfer']){if(_0x3e9cc7[_0xee0a('0x13d')]==='16'&&this[_0xee0a('0x10')][_0x3e9cc7[_0xee0a('0xae')]][_0xee0a('0x6c')]){logger[_0xee0a('0x7c')](_0xee0a('0x142'),_0x3e9cc7[_0xee0a('0xae')],_0x3e9cc7[_0xee0a('0x13d')],_0xee0a('0xb2'),_0x32d8c5[_0xee0a('0x25')],_0xee0a('0x6b'),_0x32d8c5['pTalking']);this['callProgressDetectingCustomer'](_0x3e9cc7,_0x3e9cc7[_0xee0a('0xae')],_0x3e9cc7[_0xee0a('0x13d')]);}else if(this[_0xee0a('0x10')][_0x3e9cc7[_0xee0a('0xae')]][_0xee0a('0x6c')]){logger['info']('[syncHangup][talking][cause]',_0x3e9cc7[_0xee0a('0xae')],_0x3e9cc7['cause'],_0xee0a('0xb2'),_0x32d8c5[_0xee0a('0x25')],_0xee0a('0x6b'),_0x32d8c5[_0xee0a('0x29')]);this['callProgressDetectingCustomer'](_0x3e9cc7,_0x3e9cc7[_0xee0a('0xae')],_0x3e9cc7['cause']);}}};Preview[_0xee0a('0x9')][_0xee0a('0x1a')]=function(_0xd0001e){if(this[_0xee0a('0x10')][_0xd0001e[_0xee0a('0x143')]]&&_0xd0001e[_0xee0a('0x143')]!==_0xd0001e['destuniqueid']){this[_0xee0a('0x9c')](_0xd0001e,_0xd0001e[_0xee0a('0x143')],_0xd0001e[_0xee0a('0xe7')]);}};Preview['prototype'][_0xee0a('0x18')]=function(_0x5bebad){if(this[_0xee0a('0x10')][_0x5bebad[_0xee0a('0xae')]]&&_0x5bebad[_0xee0a('0xae')]!==_0x5bebad['uniqueid']&&!this[_0xee0a('0x10')][_0x5bebad[_0xee0a('0xae')]][_0xee0a('0x6c')]){if(_0x5bebad[_0xee0a('0x13d')]==='1'){this[_0xee0a('0x9c')](_0x5bebad,_0x5bebad[_0xee0a('0xae')],_0x5bebad[_0xee0a('0x13d')]);}}};Preview[_0xee0a('0x9')]['addVariable']=function(_0xcd80be,_0x4a00dd,_0x3faf3e){if(this['actions'][_0xcd80be]){if(_['isNil'](this[_0xee0a('0x10')][_0xcd80be]['variables'])){this[_0xee0a('0x10')][_0xcd80be][_0xee0a('0x144')]={};}this[_0xee0a('0x10')][_0xcd80be][_0xee0a('0x144')][_0x4a00dd]=_0x3faf3e;}};Preview[_0xee0a('0x9')][_0xee0a('0x1d')]=function(_0x339bd3){try{if(!_[_0xee0a('0x82')](_0x339bd3)){if(ut[_0xee0a('0x145')](_[_0xee0a('0x146')](_0x339bd3['variable'])[0x0])){this['addVariable'](_0x339bd3[_0xee0a('0xb1')],_[_0xee0a('0x146')](_0x339bd3[_0xee0a('0x147')])[0x0],_0x339bd3[_0xee0a('0x148')]);}}}catch(_0x1247ea){logger[_0xee0a('0x149')](_0xee0a('0x14a'),util['inspect'](_0x1247ea,{'showHidden':![],'depth':null}));}};Preview[_0xee0a('0x9')]['syncAttendedTransfer']=function(_0x560016){if(_0x560016){if(this[_0xee0a('0x10')][_0x560016[_0xee0a('0x14b')]]){this[_0xee0a('0x10')][_0x560016[_0xee0a('0x14b')]][_0xee0a('0x140')]=!![];}}};Preview[_0xee0a('0x9')]['syncBlindTransfer']=function(_0x200cd2){if(_0x200cd2){if(this['actions'][_0x200cd2[_0xee0a('0x14c')]]){this[_0xee0a('0x10')][_0x200cd2[_0xee0a('0x14c')]][_0xee0a('0x140')]=!![];}}};module[_0xee0a('0x14d')]=Preview; \ No newline at end of file +var _0x0fda=['[originated][decrement][callProgressDetectingAgent]','Contact','phone','lookAgent','execCall','[Preview][execCall][success]','\x20IdHopper:\x20','idContact','custom:agentcalled','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','trunks','SIP/%s','status','reachable','unmonitored','execRun','unlock','unlockContact','disableContact','validateContact','isValid','Contact.phone','checkInBlack','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','isEmpty','[Preview][validateContact][Empty\x20Contact]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialPrefix','dialCutDigit','substring','trim','getCallerId','getCallerIdRandom','dialOriginateCallerIdNumber','dialRandomLastDigitCallerIdNumber','originatecalleridname','originatecalleridnum','merge','Action','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','logLookAgent','clone','isFailure','response','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','syncDialEnd','destuniqueid','addVariable','variables','keys','variable','value','error','[syncVarSet][Preview]','transfertargetlinkedid','transfererlinkedid','util','bluebird','uuid','moment','md5','ioredis','../../../config/environment','../../../config/logger','actionPreview','./action','./util/util','redis','defaults','localhost','socket.io-emitter','prototype','tail','finally','sequence','campaignsPreview','voiceQueues','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','syncHangupRequest','newexten','varset','syncVarSet','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','type','outbound','name','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','talking','total','unmanaged','abandoned','dialActive','dialMethod','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalHitRate','predictiveIntervalAvailable','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','stringify','format','voice:queue:%s','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','syncCampaigns','hasOwnProperty','preview','booked','clearZombieChannels','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','enqueue','isNil','Queue','queue','originated:\x20','pTalking:\x20','pick','contactId','UserId','VoiceQueueId','channel','catch','No\x20such\x20channel','[clearZombieChannel]','dialAnswer','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','size','agentReadyId','then','length','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','connect','acw','custom:agentConnectPreview','custom:agentcomplete','complete','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','talktime','[syncHangup][talking][decrement]','linkedid','countbusyretry','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','dialBusyMaxRetry','scheduledAt','dialBusyRetryFrequency','NOANSWER','countnoanswerretry','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswerGlobal]','[callProgressDetectingCustomer][logNoAnswer]','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','CANCEL','countagentrejectretry','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','AgentReject','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedRetryFrequency','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','NoAnswer','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent][logAnswerAGI]','reason','[callProgressDetectingAgent]'];(function(_0x364040,_0x2661d5){var _0x4328dc=function(_0x29a477){while(--_0x29a477){_0x364040['push'](_0x364040['shift']());}};_0x4328dc(++_0x2661d5);}(_0x0fda,0x1a0));var _0xa0fd=function(_0x4819c3,_0x15fd76){_0x4819c3=_0x4819c3-0x0;var _0xf64757=_0x0fda[_0x4819c3];return _0xf64757;};'use strict';var util=require(_0xa0fd('0x0'));var _=require('lodash');var BPromise=require(_0xa0fd('0x1'));var uuid=require(_0xa0fd('0x2'));var moment=require(_0xa0fd('0x3'));var md5=require(_0xa0fd('0x4'));var Redis=require(_0xa0fd('0x5'));var config=require(_0xa0fd('0x6'));var logger=require(_0xa0fd('0x7'))('preview');var loggerAction=require('../../../config/logger')(_0xa0fd('0x8'));var ami=require('../ami');var rpcDb=require('./rpcDb');var Action=require(_0xa0fd('0x9'));var ut=require(_0xa0fd('0xa'));config[_0xa0fd('0xb')]=_[_0xa0fd('0xc')](config['redis'],{'host':_0xa0fd('0xd'),'port':0x18eb});var io=require(_0xa0fd('0xe'))(new Redis(config[_0xa0fd('0xb')]));var Sequence=function(){};Sequence[_0xa0fd('0xf')]['enqueue']=function(_0x31088d){this[_0xa0fd('0x10')]=this[_0xa0fd('0x10')]?this['tail'][_0xa0fd('0x11')](_0x31088d):_0x31088d();};function Preview(_0x332e66){this[_0xa0fd('0x12')]=new Sequence();this[_0xa0fd('0x13')]=_0x332e66[_0xa0fd('0x14')];this['trunks']=_0x332e66['trunks'];this[_0xa0fd('0x15')]={};this[_0xa0fd('0x16')]=_0x332e66['agents'];this[_0xa0fd('0x17')]=0x0;ami['on'](_0xa0fd('0x18'),this[_0xa0fd('0x19')][_0xa0fd('0x1a')](this));ami['on'](_0xa0fd('0x1b'),this[_0xa0fd('0x1c')][_0xa0fd('0x1a')](this));ami['on']('hanguprequest',this[_0xa0fd('0x1d')][_0xa0fd('0x1a')](this));ami['on']('dialend',this['syncDialEnd'][_0xa0fd('0x1a')](this));ami['on'](_0xa0fd('0x1e'),this['syncNewExten'][_0xa0fd('0x1a')](this));ami['on'](_0xa0fd('0x1f'),this[_0xa0fd('0x20')]['bind'](this));ami['on']('attendedtransfer',this[_0xa0fd('0x21')]['bind'](this));ami['on'](_0xa0fd('0x22'),this[_0xa0fd('0x23')][_0xa0fd('0x1a')](this));this[_0xa0fd('0x24')](this[_0xa0fd('0x13')]);}function emit(_0x2273f4,_0x113059,_0x515b0d){io['to'](_0x2273f4)[_0xa0fd('0x25')](_0x113059,_0x515b0d);}function emitCampaignPreview(_0x24cfe9){if(_0x24cfe9[_0xa0fd('0x26')]===_0xa0fd('0x27')){var _0x26e3a4={'id':_0x24cfe9['id'],'name':_0x24cfe9[_0xa0fd('0x28')],'strategy':_0x24cfe9[_0xa0fd('0x29')],'answered':_0x24cfe9[_0xa0fd('0x2a')],'available':_0x24cfe9[_0xa0fd('0x2b')],'loggedIn':_0x24cfe9[_0xa0fd('0x2c')],'pTalking':_0x24cfe9[_0xa0fd('0x2d')],'sumBillable':_0x24cfe9[_0xa0fd('0x2e')],'sumDuration':_0x24cfe9[_0xa0fd('0x2f')],'sumHoldTime':_0x24cfe9['sumHoldTime']||0x0,'talking':_0x24cfe9[_0xa0fd('0x30')],'total':_0x24cfe9[_0xa0fd('0x31')],'type':_0x24cfe9['type'],'unmanaged':_0x24cfe9[_0xa0fd('0x32')],'abandoned':_0x24cfe9[_0xa0fd('0x33')],'waiting':_0x24cfe9['waiting'],'loggedInDb':_0x24cfe9['loggedInDb'],'dialActive':_0x24cfe9[_0xa0fd('0x34')],'dialMethod':_0x24cfe9[_0xa0fd('0x35')],'dialOriginateCallerIdName':_0x24cfe9['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x24cfe9['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x24cfe9['dialOriginateTimeout'],'dialPrefix':_0x24cfe9['dialPrefix'],'outboundAnswerAgiCallsDay':_0x24cfe9[_0xa0fd('0x36')],'outboundAnswerCallsDay':_0x24cfe9['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x24cfe9[_0xa0fd('0x37')],'outboundBusyCallsDay':_0x24cfe9[_0xa0fd('0x38')],'outboundCongestionCallsDay':_0x24cfe9[_0xa0fd('0x39')],'outboundDropCallsDayACS':_0x24cfe9['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x24cfe9[_0xa0fd('0x3a')],'outboundDropCallsDayTimeout':_0x24cfe9[_0xa0fd('0x3b')],'outboundNoAnswerCallsDay':_0x24cfe9[_0xa0fd('0x3c')],'outboundNoSuchCallsDay':_0x24cfe9[_0xa0fd('0x3d')],'outboundOriginateFailureCallsDay':_0x24cfe9[_0xa0fd('0x3e')],'outboundReCallsDay':_0x24cfe9['outboundReCallsDay'],'outboundRejectCallsDay':_0x24cfe9[_0xa0fd('0x3f')],'outboundUnknownCallsDay':_0x24cfe9[_0xa0fd('0x40')],'outboundAbandonedCallsDay':_0x24cfe9[_0xa0fd('0x41')],'predictiveIntervalAnsweredCalls':_0x24cfe9[_0xa0fd('0x42')],'predictiveIntervalAvgHoldtime':_0x24cfe9['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x24cfe9[_0xa0fd('0x43')],'predictiveIntervalDroppedCallsCallersExit':_0x24cfe9[_0xa0fd('0x44')],'predictiveIntervalDroppedCallsTimeout':_0x24cfe9['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x24cfe9['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x24cfe9['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x24cfe9[_0xa0fd('0x45')],'predictiveIntervalMultiplicativeFactor':_0x24cfe9['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x24cfe9['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x24cfe9[_0xa0fd('0x46')],'predictiveIntervalTotalCalls':_0x24cfe9['predictiveIntervalTotalCalls'],'message':_0x24cfe9[_0xa0fd('0x47')],'originated':_0x24cfe9[_0xa0fd('0x48')],'erlangCalls':_0x24cfe9[_0xa0fd('0x49')],'erlangCallToSecond':_0x24cfe9[_0xa0fd('0x4a')],'erlangAbandonmentRate':_0x24cfe9[_0xa0fd('0x4b')],'erlangBusyFactor':_0x24cfe9[_0xa0fd('0x4c')],'startPredictive':_0x24cfe9[_0xa0fd('0x4d')],'startProgressive':_0x24cfe9[_0xa0fd('0x4e')]};if(_0x24cfe9['Trunk']){_0x26e3a4[_0xa0fd('0x4f')]={'id':_0x24cfe9['Trunk']['id'],'name':_0x24cfe9[_0xa0fd('0x4f')]['name'],'active':_0x24cfe9['Trunk'][_0xa0fd('0x50')],'callerid':_0x24cfe9['Trunk'][_0xa0fd('0x51')]};}if(_0x24cfe9[_0xa0fd('0x52')]){_0x26e3a4[_0xa0fd('0x52')]={'id':_0x24cfe9[_0xa0fd('0x52')]['id'],'name':_0x24cfe9['Interval'][_0xa0fd('0x28')]};}var _0x329452=md5(JSON[_0xa0fd('0x53')](_0x26e3a4));if(_0x24cfe9[_0xa0fd('0x4')]!==_0x329452){_0x24cfe9[_0xa0fd('0x4')]=_0x329452;emit(util[_0xa0fd('0x54')](_0xa0fd('0x55'),_0x26e3a4['name']),'voice_queue:save',_0x26e3a4);}}}function emitVoiceQueueChannelRemove(_0x2aa6a8){logger[_0xa0fd('0x56')](_0xa0fd('0x57'),JSON[_0xa0fd('0x53')](_0x2aa6a8));emit(util['format'](_0xa0fd('0x55'),_0x2aa6a8[_0xa0fd('0x28')]),_0xa0fd('0x58'),_0x2aa6a8);io[_0xa0fd('0x25')](_0xa0fd('0x59'),_0x2aa6a8);}function notSendMessagesQueue(_0x5d5fdd){if(_0x5d5fdd[_0xa0fd('0x5a')]){if(_0x5d5fdd[_0xa0fd('0x48')]===0x0&&_0x5d5fdd['pTalking']===0x0){_0x5d5fdd['sendMessageOneNotActive']=![];_0x5d5fdd[_0xa0fd('0x2b')]=0x0;_0x5d5fdd[_0xa0fd('0x5b')]=0x0;_0x5d5fdd[_0xa0fd('0x47')]=_0xa0fd('0x5c');ut[_0xa0fd('0x5d')](_0xa0fd('0x5e'),_0x5d5fdd[_0xa0fd('0x28')]+_0xa0fd('0x5f'));}else{_0x5d5fdd[_0xa0fd('0x47')]=_0xa0fd('0x60');ut[_0xa0fd('0x5d')](_0xa0fd('0x5e'),_0x5d5fdd[_0xa0fd('0x28')]+_0xa0fd('0x61'));}emitCampaignPreview(_0x5d5fdd);}}Preview[_0xa0fd('0xf')]['loopCampaigns']=function(){var _0x5caafc=this;setInterval(function(){_0x5caafc['syncCampaigns']();},0x7cf);};Preview[_0xa0fd('0xf')][_0xa0fd('0x62')]=function(){var _0x399eb1=this['campaignsPreview'];this[_0xa0fd('0x17')]+=0x1;for(var _0x43ade9 in _0x399eb1){if(_0x399eb1[_0xa0fd('0x63')](_0x43ade9)&&(_0x399eb1[_0x43ade9]['dialMethod']===_0xa0fd('0x64')||_0x399eb1[_0x43ade9][_0xa0fd('0x35')]===_0xa0fd('0x65'))&&_0x399eb1[_0x43ade9][_0xa0fd('0x26')]===_0xa0fd('0x27')){if(this[_0xa0fd('0x17')]>0x7){this['clockClearZombieChannels']=0x0;this[_0xa0fd('0x66')]();}}if(_0x399eb1[_0xa0fd('0x63')](_0x43ade9)&&_0x399eb1[_0x43ade9][_0xa0fd('0x35')]===_0xa0fd('0x64')&&_0x399eb1[_0x43ade9][_0xa0fd('0x26')]===_0xa0fd('0x27')){if(_0x399eb1[_0x43ade9]['dialActive']){this[_0xa0fd('0x67')](_0x399eb1[_0x43ade9]);if(_0x399eb1[_0x43ade9][_0xa0fd('0x68')])this[_0xa0fd('0x69')](_0x399eb1[_0x43ade9]);}else{notSendMessagesQueue(_0x399eb1[_0x43ade9]);}}}};Preview[_0xa0fd('0xf')][_0xa0fd('0x6a')]=function(_0x508747){var _0x5a6824=this;this[_0xa0fd('0x12')][_0xa0fd('0x6b')](function(){if(!_[_0xa0fd('0x6c')](_0x5a6824[_0xa0fd('0x15')][_0x508747])){loggerAction[_0xa0fd('0x56')]('[clearZombieChannels][talking]',_0x508747,_0xa0fd('0x6d'),_0x5a6824[_0xa0fd('0x15')][_0x508747][_0xa0fd('0x6e')],_0xa0fd('0x6f'),JSON[_0xa0fd('0x53')](_0x5a6824[_0xa0fd('0x13')][_0x5a6824['actions'][_0x508747]['queue']]['originated']),_0xa0fd('0x70'),JSON['stringify'](_0x5a6824['campaignsPreview'][_0x5a6824[_0xa0fd('0x15')][_0x508747]['queue']][_0xa0fd('0x2d')]),JSON[_0xa0fd('0x53')](_0x5a6824['actions'][_0x508747]['dialAnswer']),JSON[_0xa0fd('0x53')](_[_0xa0fd('0x71')](_0x5a6824[_0xa0fd('0x15')][_0x508747],[_0xa0fd('0x72'),_0xa0fd('0x73'),_0xa0fd('0x74'),'ListId'])));return ami['Action']({'action':'status','channel':_0x5a6824['actions'][_0x508747][_0xa0fd('0x75')]})[_0xa0fd('0x76')](function(_0x220255){if(_0x220255[_0xa0fd('0x47')]===_0xa0fd('0x77')){setTimeout(function(){if(_0x5a6824['actions'][_0x508747]){ut['updateOriginated'](_0x5a6824['campaignsPreview'][_0x5a6824['actions'][_0x508747]['queue']],_0xa0fd('0x78'));if(_0x5a6824[_0xa0fd('0x15')][_0x508747][_0xa0fd('0x79')]===!![]){ut[_0xa0fd('0x7a')](_0x5a6824[_0xa0fd('0x13')][_0x5a6824[_0xa0fd('0x15')][_0x508747][_0xa0fd('0x6e')]],_0xa0fd('0x78'));ut[_0xa0fd('0x7b')](_0xa0fd('0x7c')+_0x508747,_0x5a6824['actions'][_0x508747]['queue']);}ut[_0xa0fd('0x7b')](_0xa0fd('0x7d')+_0x508747,_0x5a6824[_0xa0fd('0x15')][_0x508747][_0xa0fd('0x6e')]);delete _0x5a6824['actions'][_0x508747];}},0x2328);}});}});};Preview[_0xa0fd('0xf')][_0xa0fd('0x66')]=function(){var _0x5f294e=this;loggerAction[_0xa0fd('0x56')]('[action]',_[_0xa0fd('0x7e')](this[_0xa0fd('0x15')]));for(var _0x55cf17 in this[_0xa0fd('0x15')]){if(_0x5f294e[_0xa0fd('0x15')][_0xa0fd('0x63')](_0x55cf17)){_0x5f294e[_0xa0fd('0x6a')](_0x55cf17);}}};Preview[_0xa0fd('0xf')][_0xa0fd('0x69')]=function(_0x47675b){var _0x21edc7=this;rpcDb['getContactRecallMe'](_0x47675b['id'],ut[_0xa0fd('0x7f')](this['agents']))[_0xa0fd('0x80')](function(_0x4205ac){if(!_[_0xa0fd('0x6c')](_0x4205ac)){for(var _0x1483d5=0x0;_0x1483d5<_0x4205ac[_0xa0fd('0x81')];_0x1483d5+=0x1){if(ut['getDiff'](_0x4205ac[_0x1483d5][_0xa0fd('0x82')])<_0x47675b[_0xa0fd('0x83')]*0x3c){if(_0x4205ac[_0x1483d5]['Agent']&&!_0x4205ac[_0x1483d5][_0xa0fd('0x84')][_0xa0fd('0x85')]){_0x21edc7[_0xa0fd('0x86')](_0x4205ac[_0x1483d5]['id'])['then'](ut[_0xa0fd('0x87')]('[RecallMe]'))[_0xa0fd('0x76')](ut['logger2'](_0xa0fd('0x88')));}else{rpcDb['disableContact'](_0x4205ac[_0x1483d5]['id']);}}else{var _0x1a4da0=new Action(_0x4205ac[_0x1483d5],_0x47675b);_0x1a4da0[_0xa0fd('0x89')]=moment()[_0xa0fd('0x54')](_0xa0fd('0x8a'));_0x47675b[_0xa0fd('0x8b')]+=0x1;ut[_0xa0fd('0x8c')](_0x1a4da0,0x17,_0xa0fd('0x8d'));if(_0x47675b['dialRecallInQueue']){rpcDb[_0xa0fd('0x8e')](ut[_0xa0fd('0x8f')](_0x4205ac[_0x1483d5]));rpcDb[_0xa0fd('0x90')](_0x1a4da0,_0xa0fd('0x91'));}else{ut[_0xa0fd('0x8c')](_0x1a4da0,0x16,'RecallFailedTimeout');rpcDb['createCustomerHistory'](_0x1a4da0,'[HistoryRecallClose]');rpcDb[_0xa0fd('0x92')](_0x1a4da0,'[HistoryRecallClose]');}}}}})[_0xa0fd('0x76')](ut['logger2'](_0xa0fd('0x93')));};Preview[_0xa0fd('0xf')][_0xa0fd('0x67')]=function(_0x1532a5){_0x1532a5[_0xa0fd('0x5a')]=!![];if(ut[_0xa0fd('0x94')](_0x1532a5[_0xa0fd('0x2c')])){_0x1532a5[_0xa0fd('0x47')]=_0xa0fd('0x95');}else if(!ut[_0xa0fd('0x96')](_0x1532a5[_0xa0fd('0x34')])){_0x1532a5[_0xa0fd('0x47')]='NOT_ACTIVE';}else if(!this['isTrunkReachable'](_0x1532a5[_0xa0fd('0x4f')])){if(!this[_0xa0fd('0x97')](_0x1532a5[_0xa0fd('0x98')])){_0x1532a5[_0xa0fd('0x47')]=_0xa0fd('0x99');}else{_0x1532a5[_0xa0fd('0x47')]=_0xa0fd('0x9a');}}else{_0x1532a5[_0xa0fd('0x47')]='ACTIVE';}emitCampaignPreview(_0x1532a5);};Preview[_0xa0fd('0xf')][_0xa0fd('0x9b')]=function(_0x27f29f,_0x392322,_0xe41454){var _0xe3d82c=this;var _0x45f7df=this[_0xa0fd('0x15')][_0x392322];var _0x319e80=this[_0xa0fd('0x13')][_0x45f7df[_0xa0fd('0x6e')]];var _0x8c9b92;if(_0x319e80){switch(_0xe41454){case'1':_0x319e80['outboundNoSuchCallsDay']+=0x1;_0x45f7df[_0xa0fd('0x9c')]+=0x1;_0x45f7df[_0xa0fd('0x9d')]=ut[_0xa0fd('0x9e')](_0x45f7df);ut[_0xa0fd('0x8c')](_0x45f7df,0x0,_0xa0fd('0x9f'));ami[_0xa0fd('0x25')](_0xa0fd('0xa0'),ut[_0xa0fd('0xa1')](_0x45f7df,_0xa0fd('0xa2')));rpcDb[_0xa0fd('0x90')](_0x45f7df,'[callProgressDetectingCustomer][logNoSuch]');if(ut[_0xa0fd('0x9e')](_0x45f7df)>=_0x319e80[_0xa0fd('0xa3')]){_0x8c9b92=ut[_0xa0fd('0xa4')](_0x45f7df,0xf,_0xa0fd('0xa5'));rpcDb[_0xa0fd('0x92')](_0x8c9b92,_0xa0fd('0xa6'));}else{if(_0x45f7df[_0xa0fd('0x9c')]>=_0x319e80[_0xa0fd('0xa7')]){rpcDb['createCustomerFinal'](_0x45f7df,_0xa0fd('0xa6'));}else{rpcDb[_0xa0fd('0xa8')](ut['scheduledAt'](_0x45f7df,_0xa0fd('0x9c'),_0x319e80[_0xa0fd('0xa9')]),_0x45f7df[_0xa0fd('0xaa')],_0x45f7df[_0xa0fd('0xab')]);}}delete this[_0xa0fd('0x15')][_0x27f29f['linkedid']];break;case _0xa0fd('0xac'):var _0x306ca1=moment()[_0xa0fd('0x54')](_0xa0fd('0x8a'));_0x45f7df[_0xa0fd('0xad')]=_0x306ca1;_0x45f7df[_0xa0fd('0xae')]=_0x306ca1;_0x45f7df[_0xa0fd('0x79')]=!![];_0x319e80[_0xa0fd('0x2d')]+=0x1;logger[_0xa0fd('0x56')](_0xa0fd('0xaf'),_0x45f7df[_0xa0fd('0xb0')],_0xa0fd('0xb1'),_0x319e80[_0xa0fd('0x28')],_0xa0fd('0x70'),_0x319e80[_0xa0fd('0x2d')]);ami[_0xa0fd('0x25')](_0xa0fd('0xb2'),ut[_0xa0fd('0xa1')](_0x45f7df,_0xa0fd('0xb3'),this['campaignsPreview'][_0x45f7df[_0xa0fd('0x6e')]]));if(_0x319e80[_0xa0fd('0xb4')]){ami[_0xa0fd('0x25')](_0xa0fd('0xb5'),ut['buildAcw'](_0x45f7df));}break;case'16':ami[_0xa0fd('0x25')](_0xa0fd('0xb6'),ut[_0xa0fd('0xa1')](_0x45f7df,_0xa0fd('0xb7'),this[_0xa0fd('0x13')][_0x45f7df['queue']]));emitVoiceQueueChannelRemove(ut[_0xa0fd('0xa1')](_0x45f7df,_0xa0fd('0xb7')));_0x319e80['outboundAnswerCallsDay']+=0x1;_0x319e80['total']+=0x1;_0x319e80[_0xa0fd('0x2a')]+=0x1;ut['decrementTalkink'](_0x319e80,'[16]');_0x45f7df[_0xa0fd('0x9d')]=ut[_0xa0fd('0x9e')](_0x45f7df);ut['logCustomer'](_0x45f7df,0x4,_0xa0fd('0xb8'));rpcDb[_0xa0fd('0x90')](_0x45f7df,_0xa0fd('0xb9'));rpcDb[_0xa0fd('0x92')](_0x45f7df,_0xa0fd('0xba'));rpcDb['crateCustomerReportQueue'](_0x45f7df);_0x319e80[_0xa0fd('0x2f')]+=_0x45f7df[_0xa0fd('0xbb')];_0x319e80['sumBillable']+=_0x45f7df[_0xa0fd('0xbb')];logger[_0xa0fd('0x56')](_0xa0fd('0xbc'),_0x45f7df['uniqueid'],_0xa0fd('0xb1'),_0x319e80['name'],_0xa0fd('0x70'),_0x319e80[_0xa0fd('0x2d')]);delete this[_0xa0fd('0x15')][_0x27f29f[_0xa0fd('0xbd')]];break;case'BUSY':_0x319e80[_0xa0fd('0x38')]+=0x1;_0x45f7df[_0xa0fd('0xbe')]+=0x1;_0x45f7df[_0xa0fd('0x9d')]=ut[_0xa0fd('0x9e')](_0x45f7df);ut[_0xa0fd('0x8c')](_0x45f7df,0x5,_0xa0fd('0xbf'));ami['emit'](_0xa0fd('0xc0'),ut[_0xa0fd('0xa1')](_0x45f7df,_0xa0fd('0xc1')));rpcDb[_0xa0fd('0x90')](_0x45f7df,_0xa0fd('0xc2'));if(ut[_0xa0fd('0x9e')](_0x45f7df)>=_0x319e80['dialGlobalMaxRetry']){_0x8c9b92=ut['cloneAction'](_0x45f7df,0xf,_0xa0fd('0xa5'));rpcDb[_0xa0fd('0x92')](_0x8c9b92,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x45f7df[_0xa0fd('0xbe')]>=_0x319e80[_0xa0fd('0xc3')]){rpcDb[_0xa0fd('0x92')](_0x45f7df,_0xa0fd('0xc2'));}else{rpcDb[_0xa0fd('0xa8')](ut[_0xa0fd('0xc4')](_0x45f7df,_0xa0fd('0xbe'),_0x319e80[_0xa0fd('0xc5')]),_0x45f7df[_0xa0fd('0xaa')],_0x45f7df['activeContact']);}}break;case _0xa0fd('0xc6'):_0x319e80[_0xa0fd('0x3c')]+=0x1;_0x45f7df[_0xa0fd('0xc7')]+=0x1;_0x45f7df['countglobal']=ut[_0xa0fd('0x9e')](_0x45f7df);ut[_0xa0fd('0x8c')](_0x45f7df,0x3,'NoAnswer');ami['emit'](_0xa0fd('0xc8'),ut[_0xa0fd('0xa1')](_0x45f7df,_0xa0fd('0xc9')));rpcDb[_0xa0fd('0x90')](_0x45f7df,'[callProgressDetectingCustomer][logNoAnswer]');if(ut['totalGlobal'](_0x45f7df)>=_0x319e80[_0xa0fd('0xa3')]){_0x8c9b92=ut[_0xa0fd('0xa4')](_0x45f7df,0xf,_0xa0fd('0xa5'));rpcDb[_0xa0fd('0x92')](_0x8c9b92,_0xa0fd('0xca'));}else{if(_0x45f7df['countnoanswerretry']>=_0x319e80['dialNoAnswerMaxRetry']){rpcDb[_0xa0fd('0x92')](_0x45f7df,_0xa0fd('0xcb'));}else{rpcDb[_0xa0fd('0xa8')](ut[_0xa0fd('0xc4')](_0x45f7df,_0xa0fd('0xc7'),_0x319e80[_0xa0fd('0xcc')]),_0x45f7df[_0xa0fd('0xaa')],_0x45f7df[_0xa0fd('0xab')]);}}break;case _0xa0fd('0xcd'):_0x319e80[_0xa0fd('0x39')]+=0x1;_0x45f7df[_0xa0fd('0xce')]+=0x1;_0x45f7df[_0xa0fd('0x9d')]=ut[_0xa0fd('0x9e')](_0x45f7df);ut[_0xa0fd('0x8c')](_0x45f7df,0x8,'Congestion');ami[_0xa0fd('0x25')](_0xa0fd('0xcf'),ut[_0xa0fd('0xa1')](_0x45f7df,_0xa0fd('0xd0')));rpcDb['createCustomerHistory'](_0x45f7df,'[callProgressDetectingCustomer][logCongestion]');if(ut[_0xa0fd('0x9e')](_0x45f7df)>=_0x319e80['dialGlobalMaxRetry']){_0x8c9b92=ut[_0xa0fd('0xa4')](_0x45f7df,0xf,_0xa0fd('0xa5'));rpcDb[_0xa0fd('0x92')](_0x8c9b92,_0xa0fd('0xd1'));}else{if(_0x45f7df['countcongestionretry']>=_0x319e80['dialCongestionMaxRetry']){rpcDb['createCustomerFinal'](_0x45f7df,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x45f7df,_0xa0fd('0xce'),_0x319e80[_0xa0fd('0xc5')]),_0x45f7df[_0xa0fd('0xaa')],_0x45f7df['activeContact']);}}break;case _0xa0fd('0xd2'):_0x319e80['outboundRejectCallsDay']+=0x1;_0x45f7df[_0xa0fd('0xd3')]+=0x1;_0x45f7df[_0xa0fd('0x9d')]=ut[_0xa0fd('0x9e')](_0x45f7df);ut[_0xa0fd('0x8c')](_0x45f7df,0x14,'AgentReject');ami[_0xa0fd('0x25')](_0xa0fd('0xd4'),ut[_0xa0fd('0xa1')](_0x45f7df,_0xa0fd('0xd5')));rpcDb[_0xa0fd('0x90')](_0x45f7df,_0xa0fd('0xd6'));if(ut['totalGlobal'](_0x45f7df)>=_0x319e80[_0xa0fd('0xa3')]){_0x8c9b92=ut[_0xa0fd('0xa4')](_0x45f7df,0x14,_0xa0fd('0xd7'));rpcDb[_0xa0fd('0x92')](_0x8c9b92,_0xa0fd('0xd8'));}else{if(_0x45f7df[_0xa0fd('0xd3')]>=_0x319e80[_0xa0fd('0xd9')]){rpcDb[_0xa0fd('0x92')](_0x45f7df,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0xa0fd('0xa8')](ut['scheduledAt'](_0x45f7df,_0xa0fd('0xd3'),_0x319e80[_0xa0fd('0xda')]),_0x45f7df[_0xa0fd('0xaa')],_0x45f7df['activeContact']);}}break;case _0xa0fd('0xdb'):_0x319e80[_0xa0fd('0x41')]+=0x1;_0x45f7df[_0xa0fd('0xdc')]+=0x1;_0x45f7df[_0xa0fd('0x9d')]=ut['totalGlobal'](_0x45f7df);ut['logCustomer'](_0x45f7df,0xb,_0xa0fd('0xdd'));rpcDb['createCustomerHistory'](_0x45f7df,_0xa0fd('0xde'));if(ut[_0xa0fd('0x9e')](_0x45f7df)>=_0x319e80[_0xa0fd('0xa3')]){_0x8c9b92=ut['cloneAction'](_0x45f7df,0xf,_0xa0fd('0xa5'));rpcDb[_0xa0fd('0x92')](_0x8c9b92,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x45f7df[_0xa0fd('0xdf')]>=_0x319e80['dialAbandonedMaxRety']){rpcDb['createCustomerFinal'](_0x45f7df,_0xa0fd('0xde'));}else{rpcDb[_0xa0fd('0xa8')](ut[_0xa0fd('0xc4')](_0x45f7df,'countabandonedretry',_0x319e80[_0xa0fd('0xe0')]),_0x45f7df['unlockAgent'],_0x45f7df[_0xa0fd('0xab')]);}}break;case'18':_0x319e80[_0xa0fd('0x40')]+=0x1;_0x45f7df[_0xa0fd('0xe1')]+=0x1;_0x45f7df[_0xa0fd('0x9d')]=ut[_0xa0fd('0x9e')](_0x45f7df);ut['logCustomer'](_0x45f7df,0x12,_0x27f29f[_0xa0fd('0xe2')]||_0x27f29f[_0xa0fd('0xe3')]);ami[_0xa0fd('0x25')](_0xa0fd('0xe4'),ut[_0xa0fd('0xa1')](_0x45f7df,_0xa0fd('0xe5')));rpcDb[_0xa0fd('0x90')](_0x45f7df,'[callProgressDetectingCustomer][hangupInAMD]');if(ut[_0xa0fd('0x9e')](_0x45f7df)>=_0x319e80[_0xa0fd('0xa3')]){_0x8c9b92=ut[_0xa0fd('0xa4')](_0x45f7df,0xf,_0xa0fd('0xa5'));rpcDb[_0xa0fd('0x92')](_0x8c9b92,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb[_0xa0fd('0x92')](_0x45f7df,_0xa0fd('0xe6'));}delete this[_0xa0fd('0x15')][_0x27f29f[_0xa0fd('0xbd')]];break;case'19':_0x319e80['outboundUnknownCallsDay']+=0x1;_0x45f7df['countglobal']=ut[_0xa0fd('0x9e')](_0x45f7df);ut['logCustomer'](_0x45f7df,0x13,_0x27f29f[_0xa0fd('0xe2')]||_0x27f29f[_0xa0fd('0xe3')]);ami['emit'](_0xa0fd('0xe4'),ut['buildObj'](_0x45f7df,_0xa0fd('0xe5')));rpcDb[_0xa0fd('0x90')](_0x45f7df,'[callProgressDetectingCustomer][machine]');if(ut['totalGlobal'](_0x45f7df)>=_0x319e80[_0xa0fd('0xa3')]){_0x8c9b92=ut['cloneAction'](_0x45f7df,0xf,_0xa0fd('0xa5'));rpcDb['createCustomerFinal'](_0x8c9b92,_0xa0fd('0xe7'));}else{rpcDb['createCustomerFinal'](_0x45f7df,_0xa0fd('0xe7'));}delete this[_0xa0fd('0x15')][_0x27f29f[_0xa0fd('0xbd')]];break;default:if(_0x45f7df[_0xa0fd('0x79')]){ut['decrementTalkink'](_0x319e80,_0xa0fd('0xe8'));ut[_0xa0fd('0x7b')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x319e80[_0xa0fd('0x28')],_0x27f29f);}_0x319e80[_0xa0fd('0x40')]+=0x1;_0x45f7df['countglobal']=ut[_0xa0fd('0x9e')](_0x45f7df);ut[_0xa0fd('0x8c')](_0x45f7df,0xc,_0x27f29f['cause-txt']||_0x27f29f[_0xa0fd('0xe3')]);rpcDb[_0xa0fd('0x90')](_0x45f7df,_0xa0fd('0xe9'));if(ut[_0xa0fd('0x9e')](_0x45f7df)>=_0x319e80[_0xa0fd('0xa3')]){_0x8c9b92=ut[_0xa0fd('0xa4')](_0x45f7df,0xf,_0xa0fd('0xa5'));rpcDb[_0xa0fd('0x92')](_0x8c9b92,_0xa0fd('0xea'));}else{rpcDb['createCustomerFinal'](_0x45f7df,_0xa0fd('0xea'));}delete this[_0xa0fd('0x15')][_0x27f29f['linkedid']];}if(!(_0x45f7df['dialAnswer']&&_0xe41454==='16')){ut[_0xa0fd('0xeb')](_0x319e80,_0xa0fd('0xec'));logger[_0xa0fd('0x56')](_0xa0fd('0xed'),_0x45f7df[_0xa0fd('0xb0')],'\x20Queue',_0x319e80[_0xa0fd('0x28')],_0xa0fd('0x6f'),_0x319e80[_0xa0fd('0x48')]);}if(_0xe41454!=='ANSWER'){delete this['actions'][_0x27f29f[_0xa0fd('0xbd')]];delete this[_0xa0fd('0x15')][_0x27f29f[_0xa0fd('0xee')]];}}};Preview[_0xa0fd('0xf')][_0xa0fd('0xef')]=function(_0x4e8af2,_0x277c01,_0xd532df){if(_[_0xa0fd('0xf0')](_0x277c01)&&_0xa0fd('0xf1')!==typeof _0x277c01){return;}if(_[_0xa0fd('0xf0')](_0xd532df)&&_0xa0fd('0xf1')!==typeof _0xd532df){return;}switch(_0xd532df['reason']){case'0':ut[_0xa0fd('0xf2')](_0x4e8af2,0x0,_0xa0fd('0x9f'));rpcDb[_0xa0fd('0xf3')](_0x4e8af2,_0xa0fd('0xf4'));break;case'3':ut[_0xa0fd('0xf2')](_0x4e8af2,0x3,_0xa0fd('0xf5'));rpcDb[_0xa0fd('0xf3')](_0x4e8af2,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut[_0xa0fd('0xf2')](_0x4e8af2,0x5,'Busy');rpcDb['createAgentHistory'](_0x4e8af2,'[callProgressDetectingAgent][logBusy]');break;case'8':ut['logAgent'](_0x4e8af2,0x8,'Congestion');rpcDb['createAgentHistory'](_0x4e8af2,_0xa0fd('0xf6'));break;case'22':ut[_0xa0fd('0xf2')](_0x4e8af2,0x16,'AnswerAGI');rpcDb[_0xa0fd('0xf3')](_0x4e8af2,_0xa0fd('0xf7'));break;default:ut[_0xa0fd('0xf2')](_0x4e8af2,0xc,_0xd532df[_0xa0fd('0xf8')]);rpcDb['createAgentHistory'](_0x4e8af2,_0xa0fd('0xf6'));}ut[_0xa0fd('0xeb')](_0x277c01,_0xa0fd('0xf9'));logger[_0xa0fd('0x56')](_0xa0fd('0xfa'),_0x4e8af2[_0xa0fd('0xb0')],'\x20Queue',_0x277c01[_0xa0fd('0x28')],_0xa0fd('0x6f'),_0x277c01[_0xa0fd('0x48')]);delete this[_0xa0fd('0x15')][_0x4e8af2[_0xa0fd('0xb0')]];};Preview[_0xa0fd('0xf')]['checkInBlack']=function(_0x38bb97,_0x39b77e,_0x4bbe91,_0x57c1ce,_0x4c933c){var _0x464067=this;return new BPromise(function(_0x5baa13,_0x53e215){if(_[_0xa0fd('0x6c')](_0x39b77e)||_[_0xa0fd('0x6c')](_0x39b77e[_0xa0fd('0xfb')])||_[_0xa0fd('0x6c')](_0x39b77e[_0xa0fd('0xfb')][_0xa0fd('0xfc')])||_[_0xa0fd('0x6c')](_0x39b77e['VoiceQueueId'])){_0x53e215(ut[_0xa0fd('0x47')]('Contact\x20is\x20undefined',_0x57c1ce,_0x4c933c));return;}var _0x24a8e0=uuid['v4']();var _0x59e16f=_0x464067[_0xa0fd('0x13')][_0x39b77e[_0xa0fd('0x6d')][_0xa0fd('0x28')]];var _0x417721=_0x4bbe91?_0x464067[_0xa0fd('0x16')][_0x4bbe91]['id']:undefined;_0x464067['actions'][_0x24a8e0]=new Action(_0x39b77e,_0x59e16f,_0x24a8e0,_0x4bbe91,_0x417721);var _0x3743fa=_0x464067['actions'][_0x24a8e0];_0x3743fa[_0xa0fd('0xaa')]=_0x57c1ce;_0x3743fa['activeContact']=_0x4c933c;_0x3743fa[_0xa0fd('0xfd')]=_0x4bbe91;if(_['isEmpty'](_0x38bb97)){_0x464067[_0xa0fd('0xfe')](_0x3743fa,_0x59e16f,_0x39b77e,_0x4bbe91)['then'](function(_0x37e435){logger['info'](_0xa0fd('0xff'),'Queue:\x20'+_0x3743fa['queue']+_0xa0fd('0x100')+_0x3743fa[_0xa0fd('0x101')],JSON['stringify'](_0x37e435));ami[_0xa0fd('0x25')](_0xa0fd('0x102'),ut['buildObj'](_0x3743fa,'called',_0x464067[_0xa0fd('0x13')][_0x3743fa['queue']]));_0x5baa13(ut['message'](_0xa0fd('0x103')));})['catch'](function(_0x31bbeb){ut[_0xa0fd('0x5d')](_0xa0fd('0x104'),_0x31bbeb);_0x53e215(ut['message'](_0xa0fd('0x105'),_0x57c1ce,_0x4c933c));});}else{_0x59e16f[_0xa0fd('0x37')]+=0x1;ut[_0xa0fd('0x106')](_0x3743fa);rpcDb[_0xa0fd('0x107')](_0x3743fa,_0xa0fd('0x108'));delete _0x464067[_0xa0fd('0x15')][_0x24a8e0];_0x53e215(ut[_0xa0fd('0x47')](_0xa0fd('0x109'),_0x57c1ce,_0x4c933c));}});};Preview[_0xa0fd('0xf')][_0xa0fd('0x97')]=function(_0x52e4c8){return!_[_0xa0fd('0x6c')](_0x52e4c8)&&!_[_0xa0fd('0x6c')](_0x52e4c8[_0xa0fd('0x28')])&&!_['isNil'](_0x52e4c8[_0xa0fd('0x50')])&&_0x52e4c8['active']&&!_[_0xa0fd('0x6c')](this[_0xa0fd('0x10a')][util[_0xa0fd('0x54')](_0xa0fd('0x10b'),_0x52e4c8['name'])])&&!_[_0xa0fd('0x6c')](this[_0xa0fd('0x10a')][util[_0xa0fd('0x54')](_0xa0fd('0x10b'),_0x52e4c8['name'])][_0xa0fd('0x10c')])&&(this[_0xa0fd('0x10a')][util[_0xa0fd('0x54')]('SIP/%s',_0x52e4c8['name'])][_0xa0fd('0x10c')]===_0xa0fd('0x10d')||this[_0xa0fd('0x10a')][util[_0xa0fd('0x54')](_0xa0fd('0x10b'),_0x52e4c8[_0xa0fd('0x28')])][_0xa0fd('0x10c')]===_0xa0fd('0x10e'));};Preview[_0xa0fd('0xf')][_0xa0fd('0x86')]=function(_0x354420,_0x28c46c){var _0x2849bc=this;return new BPromise(function(_0xf51324,_0x5dede6){_0x2849bc[_0xa0fd('0x10f')](_0x354420,_0x28c46c)[_0xa0fd('0x80')](function(_0x1806ae){_0xf51324(_[_0xa0fd('0x71')](_0x1806ae,[_0xa0fd('0x47')]));})['catch'](function(_0x39bf06){if(_0x39bf06[_0xa0fd('0x110')]){rpcDb[_0xa0fd('0x111')](_0x354420);}if(_0x39bf06[_0xa0fd('0x50')]){rpcDb[_0xa0fd('0x112')](_0x354420);}_0x5dede6(_[_0xa0fd('0x71')](_0x39bf06,[_0xa0fd('0x47')]));});});};Preview[_0xa0fd('0xf')][_0xa0fd('0x10f')]=function(_0xa1cc7,_0x3fab51){var _0x235bd8=this;return new BPromise(function(_0x31776b,_0x3afe1a){var _0x44acb5,_0x551b72;rpcDb['getContactPreview'](_0xa1cc7)[_0xa0fd('0x80')](function(_0x160b0c){if(!_[_0xa0fd('0x6c')](_0x160b0c[0x0])){_0x551b72=_0x160b0c[0x0]['recallme']?![]:!![];_0x44acb5=_0x160b0c[0x0]['recallme']?!![]:![];_0x44acb5=_0x3fab51?!![]:_0x44acb5;}var _0x4b4e00=_0x235bd8[_0xa0fd('0x113')](_0x160b0c);if(_0x4b4e00[_0xa0fd('0x114')]){rpcDb['checkIsBlackList'](_[_0xa0fd('0x71')](_0x160b0c[0x0],[_0xa0fd('0x74'),_0xa0fd('0x115')]))[_0xa0fd('0x80')](function(_0x69c1f1){_0x235bd8[_0xa0fd('0x116')](_0x69c1f1,_0x160b0c[0x0],_0x3fab51,_0x551b72,_0x44acb5)[_0xa0fd('0x80')](function(_0x211d4f){_0x31776b(_0x211d4f);})[_0xa0fd('0x76')](function(_0x2185d6){_0x3afe1a(_0x2185d6);});})[_0xa0fd('0x76')](function(_0x329d1c){ut['logger'](_0xa0fd('0x117'),_0x329d1c);_0x3afe1a(ut[_0xa0fd('0x47')](_0xa0fd('0x118'),_0x551b72,_0x44acb5));});}else{_0x3afe1a(ut[_0xa0fd('0x47')](_0x4b4e00[_0xa0fd('0x47')],_0x551b72,_0x44acb5));}})[_0xa0fd('0x76')](function(_0x41f3b9){ut[_0xa0fd('0x5d')](_0xa0fd('0x119'),_0x41f3b9);_0x3afe1a(ut[_0xa0fd('0x47')]('Call\x20unsuccessful',![],!![]));});});};Preview[_0xa0fd('0xf')]['validateContact']=function(_0x582997){if(_['isNil'](_0x582997)||_[_0xa0fd('0x11a')](_0x582997)||!_[_0xa0fd('0x6c')](_0x582997[0x0][_0xa0fd('0x84')])&&_['isNil'](_0x582997[0x0]['Agent'][_0xa0fd('0x28')])){ut[_0xa0fd('0x5d')](_0xa0fd('0x11b'),_0x582997);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x2aefbd=this[_0xa0fd('0x13')][_0x582997[0x0][_0xa0fd('0x6d')][_0xa0fd('0x28')]];_0x2aefbd[_0xa0fd('0x47')]=_0xa0fd('0x9a');if(_[_0xa0fd('0x6c')](_0x2aefbd)){ut['logger']('[Preview][validateContact][Empty\x20Campaign]',_0x2aefbd);return{'isValid':![],'message':_0xa0fd('0x11c')};}if(!this[_0xa0fd('0x97')](_0x2aefbd[_0xa0fd('0x4f')])){ut['logger']('[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20'+_0x2aefbd[_0xa0fd('0x28')]+'\x20Trunk\x20is\x20not\x20active');if(!this[_0xa0fd('0x97')](_0x2aefbd[_0xa0fd('0x98')])){ut['logger'](_0xa0fd('0x11d'),_0x2aefbd[_0xa0fd('0x28')]+_0xa0fd('0x11e'));return{'isValid':![],'message':_0xa0fd('0x11f')};}}if(!ut[_0xa0fd('0x96')](_0x2aefbd['dialActive'])){ut[_0xa0fd('0x5d')](_0xa0fd('0x120'),_0x2aefbd[_0xa0fd('0x28')]+_0xa0fd('0x121'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x2aefbd[_0xa0fd('0x28')]+_0xa0fd('0x121')};}return{'isValid':!![],'message':_0xa0fd('0x122')};};Preview[_0xa0fd('0xf')][_0xa0fd('0xfe')]=function(_0x31a190,_0x54a9d8,_0x338ed6,_0x38235a){var _0x54c8cb=this;return new BPromise(function(_0x53acd3,_0x4d53b6){var _0x2ac843=_0x31a190[_0xa0fd('0xb0')];var _0xb43220=_0x54c8cb[_0xa0fd('0x97')](_0x54a9d8['Trunk'])?util[_0xa0fd('0x54')](_0xa0fd('0x123'),_0x54a9d8[_0xa0fd('0x4f')][_0xa0fd('0x28')],_['isNil'](_0x54a9d8['dialPrefix'])?'':_0x54a9d8[_0xa0fd('0x124')]['trim']()||'',_0x54a9d8[_0xa0fd('0x125')]>0x0?_0x338ed6[_0xa0fd('0xfb')][_0xa0fd('0xfc')][_0xa0fd('0x126')](_0x54a9d8[_0xa0fd('0x125')]):_0x338ed6[_0xa0fd('0xfb')][_0xa0fd('0xfc')]):util['format'](_0xa0fd('0x123'),_[_0xa0fd('0x6c')](_0x54a9d8[_0xa0fd('0x98')])?_0x54a9d8[_0xa0fd('0x4f')]['name']:_0x54a9d8[_0xa0fd('0x98')][_0xa0fd('0x28')],_[_0xa0fd('0x6c')](_0x54a9d8[_0xa0fd('0x124')])?'':_0x54a9d8[_0xa0fd('0x124')][_0xa0fd('0x127')]()||'',_0x54a9d8[_0xa0fd('0x125')]>0x0?_0x338ed6[_0xa0fd('0xfb')]['phone'][_0xa0fd('0x126')](_0x54a9d8[_0xa0fd('0x125')]):_0x338ed6[_0xa0fd('0xfb')][_0xa0fd('0xfc')]);var _0x32b705=_0x54c8cb['isTrunkReachable'](_0x54a9d8[_0xa0fd('0x4f')])?ut[_0xa0fd('0x128')](_0x54a9d8[_0xa0fd('0x4f')]['callerid'],_0x54a9d8['dialOriginateCallerIdName'],_0x54a9d8['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0xa0fd('0x129')](_0x54a9d8[_0xa0fd('0x12a')],_0x54a9d8[_0xa0fd('0x12b')]):_0x54a9d8['dialOriginateCallerIdNumber']):ut[_0xa0fd('0x128')](_['isNil'](_0x54a9d8[_0xa0fd('0x98')])?_0x54a9d8['Trunk']['callerid']:_0x54a9d8['TrunkBackup']['callerid'],_0x54a9d8['dialOriginateCallerIdName'],_0x54a9d8[_0xa0fd('0x12b')]>0x0?ut[_0xa0fd('0x129')](_0x54a9d8[_0xa0fd('0x12a')],_0x54a9d8['dialRandomLastDigitCallerIdNumber']):_0x54a9d8[_0xa0fd('0x12a')]);if(_0x32b705){_0x31a190[_0xa0fd('0x12c')]=ut['extractCalleridName'](_0x32b705);_0x31a190[_0xa0fd('0x12d')]=ut['extractCalleridNumber'](_0x32b705);}var _0x2ffbf7=ut['addVariables'](_0x54a9d8,_0x338ed6,_0xb43220,_0x32b705,_0x2ac843,_0x31a190);_[_0xa0fd('0x12e')](_0x31a190,ut['toLowerVariables'](_0x2ffbf7));_0x31a190[_0xa0fd('0x89')]=moment()['format'](_0xa0fd('0x8a'));ami[_0xa0fd('0x12f')](ut[_0xa0fd('0x130')](_0x31a190,_0x54a9d8,_0x2ffbf7,_0x31a190[_0xa0fd('0xab')],_0x38235a))['then'](function(_0x3d0c63){_0x54a9d8[_0xa0fd('0x48')]+=0x1;logger[_0xa0fd('0x56')](_0xa0fd('0x131'),_0x2ac843,_0xa0fd('0xb1'),_0x54a9d8[_0xa0fd('0x28')],_0xa0fd('0x6f'),_0x54a9d8['originated']);_0x53acd3(_0x3d0c63);})[_0xa0fd('0x76')](function(_0x4546f2){ut['logAgent'](_0x31a190,0xe,_0xa0fd('0x132'));rpcDb[_0xa0fd('0xf3')](_0x31a190,_0xa0fd('0x133'));_0x4d53b6(_0x4546f2);});});};Preview[_0xa0fd('0xf')]['syncNewExten']=function(_0xf13741){if(this[_0xa0fd('0x15')][_0xf13741[_0xa0fd('0xbd')]]){this[_0xa0fd('0x15')][_0xf13741[_0xa0fd('0xbd')]][_0xa0fd('0x75')]=_0xf13741[_0xa0fd('0x75')];}};Preview['prototype'][_0xa0fd('0x19')]=function(_0x484031){var _0x1c98a9=this;var _0x5b921c=this['actions'][_0x484031['actionid']];if(_0x5b921c){if(_0x5b921c[_0xa0fd('0xfd')]&&this['agents'][_0x5b921c[_0xa0fd('0xfd')]]){ut[_0xa0fd('0x134')](_0x5b921c,this[_0xa0fd('0x16')][_0x5b921c[_0xa0fd('0xfd')]][_0xa0fd('0x28')],this[_0xa0fd('0x16')][_0x5b921c['lookAgent']]['id']);}var _0x4d2500=_[_0xa0fd('0x135')](_0x5b921c);_0x4d2500[_0xa0fd('0xad')]=moment()[_0xa0fd('0x54')]('YYYY-MM-DD\x20HH:mm:ss');var _0x389d2f=_0x1c98a9['campaignsPreview'][_0x5b921c[_0xa0fd('0x6e')]];if(ut[_0xa0fd('0x136')](_0x484031[_0xa0fd('0x137')])){if(_0x5b921c[_0xa0fd('0xaa')]){rpcDb[_0xa0fd('0x111')](_0x5b921c[_0xa0fd('0x101')]);}if(_0x5b921c[_0xa0fd('0xab')]){rpcDb[_0xa0fd('0x112')](_0x5b921c[_0xa0fd('0x101')]);}ami[_0xa0fd('0x25')](_0xa0fd('0x138'),ut[_0xa0fd('0xa1')](_0x5b921c,_0xa0fd('0x139'),this['campaignsPreview'][_0x5b921c['queue']]));this[_0xa0fd('0xef')](_0x4d2500,_0x389d2f,_0x484031);}else{_0x5b921c[_0xa0fd('0x89')]=moment()[_0xa0fd('0x54')](_0xa0fd('0x8a'));ut[_0xa0fd('0xf2')](_0x4d2500,0x4,_0xa0fd('0xb8'));rpcDb['createAgentHistory'](_0x4d2500,_0xa0fd('0x13a'));}}};Preview[_0xa0fd('0xf')]['syncHangup']=function(_0x1aa212){var _0x418dbf=this;var _0x24beca=this[_0xa0fd('0x15')][_0x1aa212[_0xa0fd('0xbd')]];var _0x374621;if(_0x24beca){_0x374621=this[_0xa0fd('0x13')][_0x24beca[_0xa0fd('0x6e')]];logger[_0xa0fd('0x56')](_0xa0fd('0x13b'),_0x1aa212[_0xa0fd('0xbd')],_0xa0fd('0xb1'),_0x374621[_0xa0fd('0x28')],_0xa0fd('0x70'),_0x374621[_0xa0fd('0x2d')]);}if(this['actions'][_0x1aa212['linkedid']]&&_0x1aa212[_0xa0fd('0xbd')]!==_0x1aa212[_0xa0fd('0xb0')]){if(_0x1aa212[_0xa0fd('0x13c')]==='16'&&this[_0xa0fd('0x15')][_0x1aa212['linkedid']]['dialAnswer']){this[_0xa0fd('0x9b')](_0x1aa212,_0x1aa212[_0xa0fd('0xbd')],_0x1aa212[_0xa0fd('0x13c')]);}else if(this[_0xa0fd('0x15')][_0x1aa212['linkedid']][_0xa0fd('0x79')]){logger[_0xa0fd('0x56')](_0xa0fd('0x13d'),_0x1aa212[_0xa0fd('0xbd')],_0x1aa212[_0xa0fd('0x13c')],'\x20Queue',_0x374621[_0xa0fd('0x28')],'pTalking:\x20',_0x374621[_0xa0fd('0x2d')]);this['callProgressDetectingCustomer'](_0x1aa212,_0x1aa212[_0xa0fd('0xbd')],_0x1aa212[_0xa0fd('0x13c')]);}}else if(_0x24beca&&_[_0xa0fd('0x6c')](_0x24beca['statedesc'])&&_0x374621[_0xa0fd('0x13e')]&&_0x1aa212[_0xa0fd('0xbd')]===_0x1aa212[_0xa0fd('0xb0')]&&_[_0xa0fd('0x6c')](_0x1aa212[_0xa0fd('0xf8')])&&_0x1aa212[_0xa0fd('0x13c')]==='16'&&_0x1aa212[_0xa0fd('0x13f')]==='6'&&_[_0xa0fd('0xf0')](_0x24beca['transfer'])){if(_0x24beca[_0xa0fd('0xaa')]){rpcDb[_0xa0fd('0x111')](_0x24beca['idContact']);}if(_0x24beca[_0xa0fd('0xab')]){rpcDb[_0xa0fd('0x112')](_0x24beca[_0xa0fd('0x101')]);}_0x1aa212[_0xa0fd('0xf8')]='22';this[_0xa0fd('0xef')](_0x24beca,_0x374621,_0x1aa212);}else if(_0x24beca&&_0x24beca[_0xa0fd('0x140')]){if(_0x1aa212[_0xa0fd('0x13c')]==='16'&&this[_0xa0fd('0x15')][_0x1aa212[_0xa0fd('0xbd')]][_0xa0fd('0x79')]){logger['info'](_0xa0fd('0x141'),_0x1aa212[_0xa0fd('0xbd')],_0x1aa212[_0xa0fd('0x13c')],_0xa0fd('0xb1'),_0x374621[_0xa0fd('0x28')],_0xa0fd('0x70'),_0x374621['pTalking']);this[_0xa0fd('0x9b')](_0x1aa212,_0x1aa212[_0xa0fd('0xbd')],_0x1aa212['cause']);}else if(this[_0xa0fd('0x15')][_0x1aa212['linkedid']][_0xa0fd('0x79')]){logger[_0xa0fd('0x56')](_0xa0fd('0x13d'),_0x1aa212[_0xa0fd('0xbd')],_0x1aa212[_0xa0fd('0x13c')],_0xa0fd('0xb1'),_0x374621[_0xa0fd('0x28')],_0xa0fd('0x70'),_0x374621[_0xa0fd('0x2d')]);this[_0xa0fd('0x9b')](_0x1aa212,_0x1aa212[_0xa0fd('0xbd')],_0x1aa212[_0xa0fd('0x13c')]);}}};Preview[_0xa0fd('0xf')][_0xa0fd('0x142')]=function(_0x531f21){if(this['actions'][_0x531f21[_0xa0fd('0xee')]]&&_0x531f21[_0xa0fd('0xee')]!==_0x531f21[_0xa0fd('0x143')]){this['callProgressDetectingCustomer'](_0x531f21,_0x531f21[_0xa0fd('0xee')],_0x531f21[_0xa0fd('0xe3')]);}};Preview['prototype'][_0xa0fd('0x1d')]=function(_0x4fdb57){if(this[_0xa0fd('0x15')][_0x4fdb57[_0xa0fd('0xbd')]]&&_0x4fdb57[_0xa0fd('0xbd')]!==_0x4fdb57[_0xa0fd('0xb0')]&&!this[_0xa0fd('0x15')][_0x4fdb57[_0xa0fd('0xbd')]][_0xa0fd('0x79')]){if(_0x4fdb57[_0xa0fd('0x13c')]==='1'){this[_0xa0fd('0x9b')](_0x4fdb57,_0x4fdb57['linkedid'],_0x4fdb57['cause']);}}};Preview['prototype'][_0xa0fd('0x144')]=function(_0x2d9f86,_0x128b59,_0x17e53b){if(this['actions'][_0x2d9f86]){if(_['isNil'](this['actions'][_0x2d9f86][_0xa0fd('0x145')])){this[_0xa0fd('0x15')][_0x2d9f86][_0xa0fd('0x145')]={};}this[_0xa0fd('0x15')][_0x2d9f86][_0xa0fd('0x145')][_0x128b59]=_0x17e53b;}};Preview['prototype'][_0xa0fd('0x20')]=function(_0x4b453f){try{if(!_[_0xa0fd('0x6c')](_0x4b453f)){if(ut['filterKey'](_[_0xa0fd('0x146')](_0x4b453f[_0xa0fd('0x147')])[0x0])){this[_0xa0fd('0x144')](_0x4b453f['uniqueid'],_[_0xa0fd('0x146')](_0x4b453f['variable'])[0x0],_0x4b453f[_0xa0fd('0x148')]);}}}catch(_0x47ac8f){logger[_0xa0fd('0x149')](_0xa0fd('0x14a'),util['inspect'](_0x47ac8f,{'showHidden':![],'depth':null}));}};Preview[_0xa0fd('0xf')][_0xa0fd('0x21')]=function(_0x37cc78){if(_0x37cc78){if(this[_0xa0fd('0x15')][_0x37cc78[_0xa0fd('0x14b')]]){this[_0xa0fd('0x15')][_0x37cc78[_0xa0fd('0x14b')]][_0xa0fd('0x140')]=!![];}}};Preview[_0xa0fd('0xf')][_0xa0fd('0x23')]=function(_0x158f0b){if(_0x158f0b){if(this[_0xa0fd('0x15')][_0x158f0b['transfererlinkedid']]){this['actions'][_0x158f0b[_0xa0fd('0x14c')]][_0xa0fd('0x140')]=!![];}}};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 38d2de3..ffbb40d 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 _0xb86b=['queuecallerleaveAt','queuecallercomplete','endtime','membername','context','from-sip','exten','holdtime','assigned','lastAssignedTo','COMPLETED','create','getContactRecallMe','[GetContactRecallMe]\x20','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','then','createHistory','catch','[createHistory]\x20','resolve','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','createAgentHistory','createCustomerFinal','rescheduleContact','UserId','active','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','queue','queuecallerjoinAt','answertime'];(function(_0x499668,_0x101569){var _0x499bb7=function(_0x71c7f1){while(--_0x71c7f1){_0x499668['push'](_0x499668['shift']());}};_0x499bb7(++_0x101569);}(_0xb86b,0xb4));var _0xbb86=function(_0x552fce,_0x3f24bc){_0x552fce=_0x552fce-0x0;var _0x3e27a2=_0xb86b[_0x552fce];return _0x3e27a2;};'use strict';var util=require(_0xbb86('0x0'));var BPromise=require(_0xbb86('0x1'));var logger=require(_0xbb86('0x2'))(_0xbb86('0x3'));var _=require(_0xbb86('0x4'));var cmHopper=require(_0xbb86('0x5'));var cmHopperFinal=require(_0xbb86('0x6'));var cmHopperHistory=require(_0xbb86('0x7'));var cmHopperBlack=require(_0xbb86('0x8'));var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require(_0xbb86('0x9'));var voiceQueueReport=require(_0xbb86('0xa'));function loggerCatch(_0x472466){return function(_0x1d315b){logger[_0xbb86('0xb')](_0x472466,util[_0xbb86('0xc')](_0x1d315b,{'showHidden':![],'depth':null}));};}function create(_0x222d37){return BPromise['resolve']()[_0xbb86('0xd')](cmHopperHistory[_0xbb86('0xe')](_0x222d37))[_0xbb86('0xf')](loggerCatch(_0xbb86('0x10')));}function createAgent(_0x313e31){return BPromise['resolve']()[_0xbb86('0xd')](agentReportPreview[_0xbb86('0xe')](_0x313e31))[_0xbb86('0xf')](loggerCatch(_0xbb86('0x10')));}function moveContact(_0x54b87f){return BPromise[_0xbb86('0x11')]()[_0xbb86('0xd')](cmHopper[_0xbb86('0x12')](_0x54b87f,!![]))[_0xbb86('0xf')](loggerCatch(_0xbb86('0x13')));}exports[_0xbb86('0x14')]=function(_0x268fe6){return BPromise[_0xbb86('0x11')]()['then'](cmHopperBlack[_0xbb86('0x14')](_0x268fe6))[_0xbb86('0xf')](loggerCatch(_0xbb86('0x15')));};exports['getContactPreview']=function(_0x2f383d){return BPromise['resolve']()[_0xbb86('0xd')](cmHopper['getContactPreview'](_0x2f383d))[_0xbb86('0xf')](loggerCatch('[getContactPreview]\x20'));};exports[_0xbb86('0xe')]=function(_0x2e7840,_0x58371b){create(_0x2e7840)['catch'](loggerCatch(_0x58371b));moveContact(_0x2e7840)[_0xbb86('0xf')](loggerCatch(_0x58371b));};exports[_0xbb86('0x16')]=function(_0x50eed6,_0x5588c8){createAgent(_0x50eed6)[_0xbb86('0xf')](loggerCatch(_0x5588c8));};exports['createCustomerHistory']=function(_0x179030,_0x317d58){create(_0x179030)['catch'](loggerCatch(_0x317d58));};exports[_0xbb86('0x17')]=function(_0x1c36b3,_0x8d9221){moveContact(_0x1c36b3)[_0xbb86('0xf')](loggerCatch(_0x8d9221));};exports[_0xbb86('0x18')]=function(_0x1b88dc,_0x367ec2,_0x410a8e){if(_0x367ec2){_0x1b88dc[_0xbb86('0x19')]=null;}if(_0x410a8e){_0x1b88dc[_0xbb86('0x1a')]=![];}return BPromise[_0xbb86('0x11')]()[_0xbb86('0xd')](cmHopper[_0xbb86('0x18')](_0x1b88dc))['catch'](loggerCatch('[rescheduleContact]\x20'));};exports[_0xbb86('0x1b')]=function(_0x24abcc){return BPromise[_0xbb86('0x11')]()['then'](cmHopper[_0xbb86('0x1b')](_0x24abcc))['catch'](loggerCatch(_0xbb86('0x1c')));};exports[_0xbb86('0x1d')]=function(_0xb7ae7c){return BPromise[_0xbb86('0x11')]()['then'](cmHopper[_0xbb86('0x1d')]({'UserId':null},_0xb7ae7c,0x1))[_0xbb86('0xf')](loggerCatch(_0xbb86('0x1e')));};exports[_0xbb86('0x1f')]=function(_0x39c087){return BPromise[_0xbb86('0x11')]()[_0xbb86('0xd')](cmHopper['unlockContact']({'active':![]},_0x39c087,0x1))[_0xbb86('0xf')](loggerCatch(_0xbb86('0x20')));};exports[_0xbb86('0x21')]=function(_0x444dc3){var _0x2a09aa={};_0x2a09aa['type']=_0x444dc3[_0xbb86('0x22')];_0x2a09aa['uniqueid']=_0x444dc3[_0xbb86('0x23')];_0x2a09aa[_0xbb86('0x24')]=_0x444dc3[_0xbb86('0x24')];_0x2a09aa['calleridname']=_0x444dc3['calleridname'];_0x2a09aa[_0xbb86('0x25')]=_0x444dc3[_0xbb86('0x25')];_0x2a09aa[_0xbb86('0x26')]=_0x444dc3[_0xbb86('0x27')];_0x2a09aa[_0xbb86('0x28')]=_0x444dc3[_0xbb86('0x27')];_0x2a09aa[_0xbb86('0x29')]=0x1;_0x2a09aa['queuecallercompleteAt']=_0x444dc3[_0xbb86('0x2a')];_0x2a09aa['connectedlinename']=_0x444dc3[_0xbb86('0x2b')];_0x2a09aa[_0xbb86('0x2c')]=_0xbb86('0x2d');_0x2a09aa[_0xbb86('0x2e')]='xcally-motion-preview';_0x2a09aa[_0xbb86('0x2f')]=0x0;_0x2a09aa[_0xbb86('0x30')]=0x1;_0x2a09aa[_0xbb86('0x31')]=_0x444dc3[_0xbb86('0x2b')];_0x2a09aa['queuecallerexitreason']=_0xbb86('0x32');return BPromise['resolve']()[_0xbb86('0xd')](voiceQueueReport[_0xbb86('0x33')](_0x2a09aa))[_0xbb86('0xf')](loggerCatch('[voiceQueueReport]\x20'));};exports['getContactRecallMe']=function(_0x5ac266,_0x36213c){return BPromise['resolve']()['then'](cmHopper[_0xbb86('0x34')](_0x5ac266,_0x36213c))[_0xbb86('0xf')](loggerCatch(_0xbb86('0x35')));};exports['rescheduleContactInQueue']=function(_0x1e5738){return BPromise['resolve']()[_0xbb86('0xd')](cmHopper[_0xbb86('0x18')](_0x1e5738,!![],!![]))[_0xbb86('0xf')](loggerCatch(_0xbb86('0x36')));}; \ No newline at end of file +var _0x0328=['createCustomerFinal','rescheduleContact','UserId','active','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','membername','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','[voiceQueueReport]\x20','getContactRecallMe','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','inspect','then','createHistory','catch','[createHistory]\x20','resolve','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createCustomerHistory'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0328,0x15e));var _0x8032=function(_0x4785aa,_0xf67432){_0x4785aa=_0x4785aa-0x0;var _0x474c10=_0x0328[_0x4785aa];return _0x474c10;};'use strict';var util=require(_0x8032('0x0'));var BPromise=require(_0x8032('0x1'));var logger=require(_0x8032('0x2'))('preview');var _=require(_0x8032('0x3'));var cmHopper=require(_0x8032('0x4'));var cmHopperFinal=require(_0x8032('0x5'));var cmHopperHistory=require(_0x8032('0x6'));var cmHopperBlack=require(_0x8032('0x7'));var voiceQueueRt=require(_0x8032('0x8'));var agentReportPreview=require(_0x8032('0x9'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x58ffa7){return function(_0x3acc20){logger['error'](_0x58ffa7,util[_0x8032('0xa')](_0x3acc20,{'showHidden':![],'depth':null}));};}function create(_0x150e57){return BPromise['resolve']()[_0x8032('0xb')](cmHopperHistory[_0x8032('0xc')](_0x150e57))[_0x8032('0xd')](loggerCatch(_0x8032('0xe')));}function createAgent(_0x47a5b0){return BPromise[_0x8032('0xf')]()[_0x8032('0xb')](agentReportPreview['createHistory'](_0x47a5b0))[_0x8032('0xd')](loggerCatch(_0x8032('0xe')));}function moveContact(_0xba2462){return BPromise['resolve']()[_0x8032('0xb')](cmHopper['moveContactManagedDialer'](_0xba2462,!![]))[_0x8032('0xd')](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0x8032('0x10')]=function(_0x12b673){return BPromise[_0x8032('0xf')]()[_0x8032('0xb')](cmHopperBlack['checkIsBlackList'](_0x12b673))[_0x8032('0xd')](loggerCatch(_0x8032('0x11')));};exports[_0x8032('0x12')]=function(_0x14ade6){return BPromise['resolve']()[_0x8032('0xb')](cmHopper[_0x8032('0x12')](_0x14ade6))[_0x8032('0xd')](loggerCatch(_0x8032('0x13')));};exports['createHistory']=function(_0x2feb22,_0x5edb6d){create(_0x2feb22)[_0x8032('0xd')](loggerCatch(_0x5edb6d));moveContact(_0x2feb22)[_0x8032('0xd')](loggerCatch(_0x5edb6d));};exports['createAgentHistory']=function(_0x3c72e4,_0x33aade){createAgent(_0x3c72e4)[_0x8032('0xd')](loggerCatch(_0x33aade));};exports[_0x8032('0x14')]=function(_0x3f88cf,_0x3046a3){create(_0x3f88cf)['catch'](loggerCatch(_0x3046a3));};exports[_0x8032('0x15')]=function(_0x4815de,_0x47ff60){moveContact(_0x4815de)[_0x8032('0xd')](loggerCatch(_0x47ff60));};exports[_0x8032('0x16')]=function(_0x361eaf,_0x6616c6,_0x443eb8){if(_0x6616c6){_0x361eaf[_0x8032('0x17')]=null;}if(_0x443eb8){_0x361eaf[_0x8032('0x18')]=![];}return BPromise['resolve']()['then'](cmHopper[_0x8032('0x16')](_0x361eaf))['catch'](loggerCatch('[rescheduleContact]\x20'));};exports[_0x8032('0x19')]=function(_0x3c2f79){return BPromise[_0x8032('0xf')]()[_0x8032('0xb')](cmHopper[_0x8032('0x19')](_0x3c2f79))['catch'](loggerCatch(_0x8032('0x1a')));};exports[_0x8032('0x1b')]=function(_0x16be0a){return BPromise['resolve']()[_0x8032('0xb')](cmHopper['unlockContact']({'UserId':null},_0x16be0a,0x1))['catch'](loggerCatch(_0x8032('0x1c')));};exports['disableContact']=function(_0x2a25f1){return BPromise[_0x8032('0xf')]()[_0x8032('0xb')](cmHopper[_0x8032('0x1b')]({'active':![]},_0x2a25f1,0x1))['catch'](loggerCatch(_0x8032('0x1d')));};exports[_0x8032('0x1e')]=function(_0x46eccf){var _0xda116b={};_0xda116b[_0x8032('0x1f')]=_0x46eccf['type'];_0xda116b[_0x8032('0x20')]=_0x46eccf[_0x8032('0x20')];_0xda116b[_0x8032('0x21')]=_0x46eccf['calleridnum'];_0xda116b[_0x8032('0x22')]=_0x46eccf[_0x8032('0x22')];_0xda116b[_0x8032('0x23')]=_0x46eccf[_0x8032('0x23')];_0xda116b['queuecallerjoinAt']=_0x46eccf[_0x8032('0x24')];_0xda116b[_0x8032('0x25')]=_0x46eccf[_0x8032('0x24')];_0xda116b[_0x8032('0x26')]=0x1;_0xda116b[_0x8032('0x27')]=_0x46eccf['endtime'];_0xda116b['connectedlinename']=_0x46eccf[_0x8032('0x28')];_0xda116b[_0x8032('0x29')]=_0x8032('0x2a');_0xda116b[_0x8032('0x2b')]=_0x8032('0x2c');_0xda116b[_0x8032('0x2d')]=0x0;_0xda116b[_0x8032('0x2e')]=0x1;_0xda116b[_0x8032('0x2f')]=_0x46eccf['membername'];_0xda116b[_0x8032('0x30')]='COMPLETED';return BPromise[_0x8032('0xf')]()[_0x8032('0xb')](voiceQueueReport['create'](_0xda116b))[_0x8032('0xd')](loggerCatch(_0x8032('0x31')));};exports[_0x8032('0x32')]=function(_0x1b2fc9,_0x244b37){return BPromise[_0x8032('0xf')]()[_0x8032('0xb')](cmHopper[_0x8032('0x32')](_0x1b2fc9,_0x244b37))[_0x8032('0xd')](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0x8032('0x33')]=function(_0x388826){return BPromise[_0x8032('0xf')]()[_0x8032('0xb')](cmHopper[_0x8032('0x16')](_0x388826,!![],!![]))['catch'](loggerCatch(_0x8032('0x34')));}; \ 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 ea8e4b2..55ac5af 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 _0x18c1=['buildAcw','agentReadyId','status','reachable','push','getDiff','milliseconds','seconds','createBody','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','active','countglobal','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-dialurl','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosbridged','rtpaudioqosloss','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','random','extractCalleridName','match','extractCalleridNumber','util','lodash','moment','../../../../config/logger','preview','XCALLY_IP_AGI','diff','loggerCatch','inspect','logger','info','loggerError','logger2','message','getCallerId','isUndefined','string','format','\x22%s\x22\x20<%s>','isEmpty','\x22\x22\x20<>','isActive','addVariables','Queue','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','NONE','originatecalleridname','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','isNil','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','hasOwnProperty','originated','error','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','statedesc','Blacklist','responsetime','endtime','ringtime','starttime','logLookAgent','membername','UserId','logCustomer','state','talktime','answertime','isFailure','Failure','variablesAction','RECALL','calleridname','BOOKED','uniqueid','originate','calleridnum','xcally-motion-preview','from-sip','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','cloneAction','clone','scheduledAt','scheduledat','add','minutes','ContactId','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','name','queue','interface','channelAgent','voice','mandatoryDisposition'];(function(_0x32b122,_0x1ad490){var _0x4ad25a=function(_0x590ee6){while(--_0x590ee6){_0x32b122['push'](_0x32b122['shift']());}};_0x4ad25a(++_0x1ad490);}(_0x18c1,0x1ee));var _0x118c=function(_0x1dbb6e,_0x4e6a3f){_0x1dbb6e=_0x1dbb6e-0x0;var _0x89b7a1=_0x18c1[_0x1dbb6e];return _0x89b7a1;};'use strict';var util=require(_0x118c('0x0'));var _=require(_0x118c('0x1'));var moment=require(_0x118c('0x2'));var logger=require(_0x118c('0x3'))(_0x118c('0x4'));var ipAgi=process['env'][_0x118c('0x5')]||'127.0.0.1';function getSeconds(_0x518ba4,_0x394557){var _0x589c84=moment(_0x518ba4)['milliseconds'](0x0);var _0x3bcec1=moment(_0x394557)['milliseconds'](0x0);return _0x589c84[_0x118c('0x6')](_0x3bcec1,'seconds');}exports[_0x118c('0x7')]=function(_0xff7cde){return function(_0x2d15c5){logger['error'](_0xff7cde,util[_0x118c('0x8')](_0x2d15c5,{'showHidden':![],'depth':null}));};};exports[_0x118c('0x9')]=function(_0x2bf856,_0x254ba7){logger[_0x118c('0xa')](_0x2bf856,util[_0x118c('0x8')](_0x254ba7,{'showHidden':![],'depth':null}));};exports[_0x118c('0xb')]=function(_0x51872c,_0x40d7bd){logger['error'](_0x51872c,util['inspect'](_0x40d7bd,{'showHidden':![],'depth':null}));};exports[_0x118c('0xc')]=function(_0x7bb6fe){return function(_0x5136fd){logger['info'](_0x7bb6fe,util['inspect'](_0x5136fd,{'showHidden':![],'depth':null}));};};exports[_0x118c('0xd')]=function(_0x12f0a1,_0x3504a1,_0x23c7f6){return{'message':_0x12f0a1,'unlock':_0x3504a1,'active':_0x23c7f6};};exports[_0x118c('0xe')]=function(_0xf7b936,_0x1a5c57,_0x50e923){if(!_[_0x118c('0xf')](_0x50e923)&&_0x118c('0x10')===typeof _0x50e923&&!_['isEmpty'](_0x50e923)){if(!_[_0x118c('0xf')](_0x1a5c57)&&_0x118c('0x10')===typeof _0x1a5c57&&!_['isEmpty'](_0x1a5c57)){return util[_0x118c('0x11')](_0x118c('0x12'),_0x1a5c57,_0x50e923);}return util[_0x118c('0x11')](_0x118c('0x12'),_0x50e923,_0x50e923);}if(!_['isUndefined'](_0xf7b936)&&_0x118c('0x10')===typeof _0xf7b936&&!_[_0x118c('0x13')](_0xf7b936)){return _0xf7b936;}return _0x118c('0x14');};exports[_0x118c('0x15')]=function(_0x41ed7c){if(_['isNil'](_0x41ed7c)){return![];}return _0x41ed7c;};exports[_0x118c('0x16')]=function(_0x1d52df,_0x45ec9f,_0x153e03,_0x496dec,_0xef6f53,_0x3704e8){var _0x15d9c8={'XMD-QUEUE':_0x45ec9f[_0x118c('0x17')]?_0x45ec9f[_0x118c('0x17')]['name']:'','XMD-CALLERID':_0x496dec,'XMD-CALLERID-PREVIEW':_0x3704e8?util[_0x118c('0x11')]('\x22%s\x22\x20<%s>',_0x3704e8['calleridname'],_0x3704e8['calleridnum']):_0x496dec,'XMD-DIALID':_0xef6f53,'XMD-CONTACTID':_0x45ec9f['ContactId'],'XMD-CDRTYPE':_0x118c('0x18'),'CALLERID(all)':_0x496dec,'XMD-VOICEQUEUEID':_0x45ec9f[_0x118c('0x19')],'XMD-DIALCHANNEL':_0x153e03,'XMD-DIALTIMEOUT':_0x1d52df[_0x118c('0x1a')]||0x1e,'XMD-DIALOPTIONS':util[_0x118c('0x11')](_0x118c('0x1b'),_0x1d52df[_0x118c('0x1c')]?'g':'',_[_0x118c('0x13')](_0x1d52df[_0x118c('0x1d')])?'':_0x118c('0x1e')),'XMD-DIALURL':_0x1d52df[_0x118c('0x1f')]||'','XMD-AGI':_0x1d52df[_0x118c('0x20')]?util[_0x118c('0x11')]('\x22agi://%s/square,%s\x22',ipAgi,_0x1d52df[_0x118c('0x20')]):_0x118c('0x21'),'XMD-AGIAFTER':_0x1d52df[_0x118c('0x1c')]?util[_0x118c('0x11')]('\x22agi://%s/square,%s\x22',ipAgi,_0x1d52df[_0x118c('0x1c')]):_0x118c('0x21'),'XMD-ORIGINATECALLERIDNUM':_0x3704e8?_0x3704e8['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x3704e8?_0x3704e8[_0x118c('0x22')]:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':_0x118c('0x23')};if(!_['isEmpty'](_0x1d52df['monitor_format'])){_0x15d9c8[util[_0x118c('0x11')]('%s',_0x118c('0x24'))]=_0x1d52df[_0x118c('0x1d')];_0x15d9c8[util[_0x118c('0x11')]('%s',_0x118c('0x25'))]=_0xef6f53;}if(_0x45ec9f&&_0x45ec9f[_0x118c('0x26')]){for(var _0x4e3130 in _0x45ec9f[_0x118c('0x26')]){if(_0x45ec9f[_0x118c('0x26')]['hasOwnProperty'](_0x4e3130)){if(!_[_0x118c('0x27')](_0x45ec9f[_0x118c('0x26')][_0x4e3130])&&_0x4e3130!=='id'&&_0x4e3130!==_0x118c('0x28')&&_0x4e3130!==_0x118c('0x29')&&_0x4e3130!==_0x118c('0x2a')){_0x15d9c8[util[_0x118c('0x11')](_0x118c('0x2b'),_0x118c('0x2c'),_[_0x118c('0x2d')](_0x4e3130))]=_0x45ec9f[_0x118c('0x26')][_0x4e3130];}}}}return _0x15d9c8;};exports[_0x118c('0x2e')]=function(_0x34ffe1){var _0x17c4e4={};for(var _0xfe8c40 in _0x34ffe1){if(_0x34ffe1['hasOwnProperty'](_0xfe8c40)){_0x17c4e4[util[_0x118c('0x11')]('%s',_[_0x118c('0x2f')](_0xfe8c40))]=_0x34ffe1[_0xfe8c40];}}return{'variables':_0x17c4e4};};exports[_0x118c('0x30')]=function(_0x146eba,_0x40ebb9){if(!_['isNil'](_0x146eba)){if(_0x146eba[_0x118c('0x31')](_0x118c('0x32'))){if(_0x146eba['originated']>0x0){_0x146eba['originated']-=0x1;}else{logger[_0x118c('0x33')](_0x118c('0x34'),_0x40ebb9);}}}else{logger[_0x118c('0x33')](_0x118c('0x35'),_0x40ebb9);}};exports[_0x118c('0x36')]=function(_0x17983e){var _0x229679=moment()[_0x118c('0x11')](_0x118c('0x37'));_0x17983e['state']=0xd;_0x17983e[_0x118c('0x38')]=_0x118c('0x39');_0x17983e['starttime']=_0x229679;_0x17983e[_0x118c('0x3a')]=_0x229679;_0x17983e[_0x118c('0x3b')]=_0x229679;};exports['logAgent']=function(_0x1bc06c,_0x587303,_0x404ebc){var _0x1087e1=moment()[_0x118c('0x11')](_0x118c('0x37'));_0x1bc06c['state']=_0x587303;_0x1bc06c[_0x118c('0x38')]=_0x404ebc;_0x1bc06c[_0x118c('0x3a')]=_0x1087e1;_0x1bc06c[_0x118c('0x3c')]=getSeconds(_0x1bc06c[_0x118c('0x3a')],_0x1bc06c[_0x118c('0x3d')]);};exports[_0x118c('0x3e')]=function(_0xdfb7fd,_0x4531cf,_0x3505f1){_0xdfb7fd[_0x118c('0x3f')]=_0x4531cf;_0xdfb7fd[_0x118c('0x40')]=_0x3505f1;};exports[_0x118c('0x41')]=function(_0x4926e1,_0x4181e6,_0x141b2b){var _0x97c2bc=moment()[_0x118c('0x11')](_0x118c('0x37'));_0x4926e1[_0x118c('0x42')]=_0x4181e6;_0x4926e1[_0x118c('0x38')]=_0x141b2b;_0x4926e1[_0x118c('0x3a')]=_0x4926e1['responsetime']?_0x4926e1['responsetime']:_0x97c2bc;_0x4926e1[_0x118c('0x3b')]=_0x4926e1['endtime']?_0x4926e1[_0x118c('0x3b')]:_0x97c2bc;_0x4926e1[_0x118c('0x3c')]=getSeconds(_0x4926e1[_0x118c('0x3a')]||0x0,_0x4926e1[_0x118c('0x3d')]||0x0);_0x4926e1[_0x118c('0x43')]=_0x4926e1['answertime']?getSeconds(_0x4926e1[_0x118c('0x3b')],_0x4926e1[_0x118c('0x44')]):0x0;};exports[_0x118c('0x45')]=function(_0x1dd0c4){return _0x1dd0c4===_0x118c('0x46');};exports[_0x118c('0x47')]=function(_0x4a8d48,_0x536f39,_0xfed96,_0x33ca3e,_0x48c60f){var _0x1f1aa3=_0x33ca3e?_0x118c('0x48'):_0x4a8d48[_0x118c('0x49')];_0x1f1aa3=_0x48c60f?_0x118c('0x4a'):_0x1f1aa3;return{'actionid':_0x4a8d48[_0x118c('0x4b')],'action':_0x118c('0x4c'),'channel':_0x4a8d48['channelAgent'],'callerid':util[_0x118c('0x11')]('\x22%s\x22\x20<%s>',_0x1f1aa3,_0x4a8d48[_0x118c('0x4d')]),'Exten':_0x118c('0x4e'),'Context':_0x118c('0x4f'),'Priority':'1','variable':_0xfed96,'timeout':(_0x536f39['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x4a8d48['uniqueid']};};exports[_0x118c('0x50')]=function(_0x4779b6){return _0x4779b6[_0x118c('0x51')]+_0x4779b6[_0x118c('0x52')]+_0x4779b6[_0x118c('0x53')]+_0x4779b6[_0x118c('0x54')]+_0x4779b6['countnosuchnumberretry'];};exports[_0x118c('0x55')]=function(_0x35e482){var _0x1300c5=_[_0x118c('0x56')](_0x35e482);_0x1300c5[_0x118c('0x42')]=0xf;_0x1300c5[_0x118c('0x38')]='Global';return _0x1300c5;};exports[_0x118c('0x57')]=function(_0x16b1a8,_0x187bb5,_0x1373e0){var _0x4f1df6={};_0x4f1df6[_0x187bb5]=_0x16b1a8[_0x187bb5];_0x4f1df6['active']=![];_0x4f1df6[_0x118c('0x58')]=moment()[_0x118c('0x59')](_0x1373e0,_0x118c('0x5a'))[_0x118c('0x11')](_0x118c('0x37'));_0x4f1df6[_0x118c('0x5b')]=_0x16b1a8[_0x118c('0x5b')];_0x4f1df6['ListId']=_0x16b1a8[_0x118c('0x5c')];_0x4f1df6[_0x118c('0x19')]=_0x16b1a8[_0x118c('0x19')]||undefined;return _0x4f1df6;};exports[_0x118c('0x5d')]=function(_0x1e5004,_0x1b1037){if(!_[_0x118c('0x27')](_0x1e5004)){if(_0x1e5004[_0x118c('0x5e')]>0x0){_0x1e5004[_0x118c('0x5e')]-=0x1;}else{logger[_0x118c('0x33')](_0x1b1037,_0x118c('0x5f'));}}else{logger[_0x118c('0x33')](_0x1b1037,_0x118c('0x60'));}};exports[_0x118c('0x61')]=function(_0x1ac102){if(_0x1ac102<=0x0){return!![];}return![];};exports[_0x118c('0x62')]=function(_0xa1a29e,_0x466306,_0x5aa3de){_0xa1a29e[_0x118c('0x63')]=_0x466306;_0xa1a29e[_0x118c('0x64')]=_0xa1a29e[_0x118c('0x65')];_0xa1a29e[_0x118c('0x66')]=_0xa1a29e[_0x118c('0x67')];_0xa1a29e['motionChannel']=_0x118c('0x68');if(_0x5aa3de){_0xa1a29e[_0x118c('0x69')]=_0x5aa3de[_0x118c('0x69')];}return _0xa1a29e;};exports[_0x118c('0x6a')]=function(_0x366398){var _0x407326={};_0x407326[_0x118c('0x65')]=_0x366398['queue'];_0x407326[_0x118c('0x66')]=_0x366398['channelAgent'];_0x407326[_0x118c('0x4b')]=_0x366398[_0x118c('0x4b')];return _0x407326;};exports[_0x118c('0x6b')]=function(_0x1536c8){var _0x35b62c=[];for(var _0x11a33e in _0x1536c8){if(_0x1536c8[_0x118c('0x31')](_0x11a33e)){if(!_[_0x118c('0x27')](_0x1536c8[_0x11a33e])&&_0x1536c8[_0x11a33e][_0x118c('0x42')]==='not_inuse'&&_0x1536c8[_0x11a33e][_0x118c('0x6c')]===_0x118c('0x6d')){_0x35b62c[_0x118c('0x6e')](_0x1536c8[_0x11a33e]['id']);}}}return _0x35b62c;};exports[_0x118c('0x6f')]=function(_0x3a2f39){var _0x32195b=moment()[_0x118c('0x70')](0x0);var _0x4fb325=moment(_0x3a2f39)[_0x118c('0x70')](0x0);return _0x32195b[_0x118c('0x6')](_0x4fb325,_0x118c('0x71'));};exports[_0x118c('0x72')]=function(_0xe76579){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0xe76579['ContactId'],'ListId':_0xe76579[_0x118c('0x5c')],'VoiceQueueId':_0xe76579[_0x118c('0x19')]||undefined,'CampaignId':_0xe76579[_0x118c('0x73')]||undefined};};exports[_0x118c('0x74')]=function(_0x18d37b){if(_0x18d37b===_0x118c('0x4b')||_0x18d37b===_0x118c('0x75')||_0x18d37b===_0x118c('0x65')||_0x18d37b===_0x118c('0x76')||_0x18d37b===_0x118c('0x77')||_0x18d37b===_0x118c('0x78')||_0x18d37b==='membername'||_0x18d37b==='channelAgent'||_0x18d37b===_0x118c('0x49')||_0x18d37b===_0x118c('0x79')||_0x18d37b===_0x118c('0x4d')||_0x18d37b===_0x118c('0x58')||_0x18d37b===_0x118c('0x51')||_0x18d37b===_0x118c('0x52')||_0x18d37b===_0x118c('0x53')||_0x18d37b===_0x118c('0x7a')||_0x18d37b==='callback'||_0x18d37b==='callbackuniqueid'||_0x18d37b===_0x118c('0x7b')||_0x18d37b===_0x118c('0x7c')||_0x18d37b===_0x118c('0x5b')||_0x18d37b===_0x118c('0x5c')||_0x18d37b==='UserId'||_0x18d37b===_0x118c('0x19')||_0x18d37b===_0x118c('0x7d')||_0x18d37b===_0x118c('0x7e')||_0x18d37b===_0x118c('0x7f')||_0x18d37b==='xmd-phone'||_0x18d37b==='xmd-listid'||_0x18d37b===_0x118c('0x80')||_0x18d37b==='xmd-dialtimeout'||_0x18d37b===_0x118c('0x81')||_0x18d37b===_0x118c('0x82')||_0x18d37b===_0x118c('0x83')||_0x18d37b==='xmd-contactid'||_0x18d37b==='xmd-cdrtype'||_0x18d37b==='xmd-callerid'||_0x18d37b===_0x118c('0x84')||_0x18d37b===_0x118c('0x85')||_0x18d37b===_0x118c('0x86')||_0x18d37b==='rtpaudioqosbridged'||_0x18d37b===_0x118c('0x87')||_0x18d37b===_0x118c('0x88')||_0x18d37b==='rtpaudioqosloss'||_0x18d37b===_0x118c('0x89')||_0x18d37b===_0x118c('0x8a')||_0x18d37b===_0x118c('0x8b')||_0x18d37b===_0x118c('0x86')||_0x18d37b===_0x118c('0x8c')||_0x18d37b===_0x118c('0x87')||_0x18d37b===_0x118c('0x88')||_0x18d37b===_0x118c('0x8d')||_0x18d37b==='rtpaudioqoslossbridged'||_0x18d37b===_0x118c('0x8a')||_0x18d37b===_0x118c('0x8b')||_0x18d37b===_0x118c('0x8e')||_0x18d37b===_0x118c('0x8f')||_0x18d37b===_0x118c('0x42')||_0x18d37b===_0x118c('0x38')){return![];}return!![];};exports[_0x118c('0x90')]=function(_0x54e0ce,_0x398c5b){var _0x3a46cc,_0x566db7,_0x21dbf1;if(_0x398c5b<=0x0){_0x398c5b=0x1;}_0x3a46cc=new RegExp(_0x118c('0x91')+_0x398c5b+'}$');_0x566db7=Math['pow'](0xa,_0x398c5b-0x1);_0x21dbf1=Math['pow'](0xa,_0x398c5b)-0x1;return util[_0x118c('0x11')]('%s',_['replace'](_0x54e0ce,_0x3a46cc,_[_0x118c('0x92')](_0x566db7,_0x21dbf1)));};exports[_0x118c('0x93')]=function(_0x18b8a9){var _0x14cce5=_0x18b8a9[_0x118c('0x94')](/"(.*?)"/);return _0x14cce5?_0x14cce5[0x1]:_0x18b8a9;};exports[_0x118c('0x95')]=function(_0x387235){var _0x4b0266=_0x387235['match'](/<(.*?)>/);return _0x4b0266?_0x4b0266[0x1]:_0x387235;}; \ No newline at end of file +var _0x9f39=['XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','inspect','info','loggerError','logger2','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridnum','ContactId','dialer','dialOriginateTimeout','\x22rtTxX%s%s\x22','\x22agi://%s/square,%s\x22','dialQueueProject','NONE','dialQueueProject2','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','monitor_format','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','%s%s','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','starttime','responsetime','ringtime','logLookAgent','membername','UserId','logCustomer','endtime','talktime','answertime','isFailure','Failure','variablesAction','RECALL','calleridname','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countnoanswerretry','countnosuchnumberretry','clone','scheduledAt','active','scheduledat','add','ListId','VoiceQueueId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','queue','interface','voice','mandatoryDisposition','buildAcw','agentReadyId','not_inuse','reachable','createBody','CampaignId','filterKey','idContact','type','campaigntype','countcongestionretry','countglobal','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-dialurl','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','\x5cw{0,','pow','replace','random','match','extractCalleridNumber','lodash','preview','env'];(function(_0x2bd88d,_0x2d5dc3){var _0x5516d4=function(_0x1272c8){while(--_0x1272c8){_0x2bd88d['push'](_0x2bd88d['shift']());}};_0x5516d4(++_0x2d5dc3);}(_0x9f39,0x115));var _0x99f3=function(_0x286b51,_0x5ac1f4){_0x286b51=_0x286b51-0x0;var _0x526358=_0x9f39[_0x286b51];return _0x526358;};'use strict';var util=require('util');var _=require(_0x99f3('0x0'));var moment=require('moment');var logger=require('../../../../config/logger')(_0x99f3('0x1'));var ipAgi=process[_0x99f3('0x2')][_0x99f3('0x3')]||_0x99f3('0x4');function getSeconds(_0x443720,_0x213978){var _0x469a39=moment(_0x443720)[_0x99f3('0x5')](0x0);var _0x4f653e=moment(_0x213978)[_0x99f3('0x5')](0x0);return _0x469a39[_0x99f3('0x6')](_0x4f653e,_0x99f3('0x7'));}exports[_0x99f3('0x8')]=function(_0x4daea9){return function(_0x413084){logger[_0x99f3('0x9')](_0x4daea9,util[_0x99f3('0xa')](_0x413084,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x324ffd,_0x975295){logger[_0x99f3('0xb')](_0x324ffd,util['inspect'](_0x975295,{'showHidden':![],'depth':null}));};exports[_0x99f3('0xc')]=function(_0x4ca4f3,_0x5e5a38){logger[_0x99f3('0x9')](_0x4ca4f3,util[_0x99f3('0xa')](_0x5e5a38,{'showHidden':![],'depth':null}));};exports[_0x99f3('0xd')]=function(_0x599b2e){return function(_0x82713f){logger[_0x99f3('0xb')](_0x599b2e,util[_0x99f3('0xa')](_0x82713f,{'showHidden':![],'depth':null}));};};exports['message']=function(_0xa15f18,_0x1d8baf,_0x1eea4f){return{'message':_0xa15f18,'unlock':_0x1d8baf,'active':_0x1eea4f};};exports[_0x99f3('0xe')]=function(_0x391b2a,_0x47f79c,_0x419686){if(!_[_0x99f3('0xf')](_0x419686)&&_0x99f3('0x10')===typeof _0x419686&&!_[_0x99f3('0x11')](_0x419686)){if(!_[_0x99f3('0xf')](_0x47f79c)&&'string'===typeof _0x47f79c&&!_[_0x99f3('0x11')](_0x47f79c)){return util['format']('\x22%s\x22\x20<%s>',_0x47f79c,_0x419686);}return util[_0x99f3('0x12')](_0x99f3('0x13'),_0x419686,_0x419686);}if(!_[_0x99f3('0xf')](_0x391b2a)&&_0x99f3('0x10')===typeof _0x391b2a&&!_[_0x99f3('0x11')](_0x391b2a)){return _0x391b2a;}return _0x99f3('0x14');};exports[_0x99f3('0x15')]=function(_0x208bd7){if(_[_0x99f3('0x16')](_0x208bd7)){return![];}return _0x208bd7;};exports[_0x99f3('0x17')]=function(_0x57c507,_0x3b377d,_0x4509b6,_0x2e57a9,_0x3d9aa3,_0x581f7d){var _0x5b7d10={'XMD-QUEUE':_0x3b377d[_0x99f3('0x18')]?_0x3b377d['Queue'][_0x99f3('0x19')]:'','XMD-CALLERID':_0x2e57a9,'XMD-CALLERID-PREVIEW':_0x581f7d?util[_0x99f3('0x12')](_0x99f3('0x13'),_0x581f7d['calleridname'],_0x581f7d[_0x99f3('0x1a')]):_0x2e57a9,'XMD-DIALID':_0x3d9aa3,'XMD-CONTACTID':_0x3b377d[_0x99f3('0x1b')],'XMD-CDRTYPE':_0x99f3('0x1c'),'CALLERID(all)':_0x2e57a9,'XMD-VOICEQUEUEID':_0x3b377d['VoiceQueueId'],'XMD-DIALCHANNEL':_0x4509b6,'XMD-DIALTIMEOUT':_0x57c507[_0x99f3('0x1d')]||0x1e,'XMD-DIALOPTIONS':util[_0x99f3('0x12')](_0x99f3('0x1e'),_0x57c507['dialQueueProject2']?'g':'',_[_0x99f3('0x11')](_0x57c507['monitor_format'])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x57c507['dialPreviewUrl']||'','XMD-AGI':_0x57c507['dialQueueProject']?util[_0x99f3('0x12')](_0x99f3('0x1f'),ipAgi,_0x57c507[_0x99f3('0x20')]):_0x99f3('0x21'),'XMD-AGIAFTER':_0x57c507[_0x99f3('0x22')]?util[_0x99f3('0x12')](_0x99f3('0x1f'),ipAgi,_0x57c507[_0x99f3('0x22')]):_0x99f3('0x21'),'XMD-ORIGINATECALLERIDNUM':_0x581f7d?_0x581f7d['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x581f7d?_0x581f7d[_0x99f3('0x23')]:'','XMD-DESTINATION':_0x99f3('0x24'),'SIPADDHEADER':_0x99f3('0x25')};if(!_['isEmpty'](_0x57c507[_0x99f3('0x26')])){_0x5b7d10[util[_0x99f3('0x12')]('%s',_0x99f3('0x27'))]=_0x57c507[_0x99f3('0x26')];_0x5b7d10[util[_0x99f3('0x12')]('%s',_0x99f3('0x28'))]=_0x3d9aa3;}if(_0x3b377d&&_0x3b377d[_0x99f3('0x29')]){for(var _0x225c1f in _0x3b377d[_0x99f3('0x29')]){if(_0x3b377d[_0x99f3('0x29')][_0x99f3('0x2a')](_0x225c1f)){if(!_[_0x99f3('0x16')](_0x3b377d['Contact'][_0x225c1f])&&_0x225c1f!=='id'&&_0x225c1f!==_0x99f3('0x2b')&&_0x225c1f!=='createdAt'&&_0x225c1f!=='updatedAt'){_0x5b7d10[util[_0x99f3('0x12')](_0x99f3('0x2c'),_0x99f3('0x2d'),_[_0x99f3('0x2e')](_0x225c1f))]=_0x3b377d[_0x99f3('0x29')][_0x225c1f];}}}}return _0x5b7d10;};exports[_0x99f3('0x2f')]=function(_0x578fcc){var _0x170803={};for(var _0x3cad8d in _0x578fcc){if(_0x578fcc[_0x99f3('0x2a')](_0x3cad8d)){_0x170803[util[_0x99f3('0x12')]('%s',_[_0x99f3('0x30')](_0x3cad8d))]=_0x578fcc[_0x3cad8d];}}return{'variables':_0x170803};};exports[_0x99f3('0x31')]=function(_0x1db2d9,_0x440195){if(!_['isNil'](_0x1db2d9)){if(_0x1db2d9[_0x99f3('0x2a')](_0x99f3('0x32'))){if(_0x1db2d9['originated']>0x0){_0x1db2d9[_0x99f3('0x32')]-=0x1;}else{logger[_0x99f3('0x9')](_0x99f3('0x33'),_0x440195);}}}else{logger[_0x99f3('0x9')](_0x99f3('0x34'),_0x440195);}};exports['logBlacklist']=function(_0x51f85e){var _0x189339=moment()[_0x99f3('0x12')](_0x99f3('0x35'));_0x51f85e[_0x99f3('0x36')]=0xd;_0x51f85e[_0x99f3('0x37')]='Blacklist';_0x51f85e[_0x99f3('0x38')]=_0x189339;_0x51f85e[_0x99f3('0x39')]=_0x189339;_0x51f85e['endtime']=_0x189339;};exports['logAgent']=function(_0x18b9c2,_0x559343,_0x10ef66){var _0x3d74ac=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x18b9c2[_0x99f3('0x36')]=_0x559343;_0x18b9c2[_0x99f3('0x37')]=_0x10ef66;_0x18b9c2[_0x99f3('0x39')]=_0x3d74ac;_0x18b9c2[_0x99f3('0x3a')]=getSeconds(_0x18b9c2['responsetime'],_0x18b9c2[_0x99f3('0x38')]);};exports[_0x99f3('0x3b')]=function(_0x2190c1,_0x126453,_0x2488a7){_0x2190c1[_0x99f3('0x3c')]=_0x126453;_0x2190c1[_0x99f3('0x3d')]=_0x2488a7;};exports[_0x99f3('0x3e')]=function(_0x20a647,_0x2b6a0c,_0x49b158){var _0x3e8b57=moment()[_0x99f3('0x12')]('YYYY-MM-DD\x20HH:mm:ss');_0x20a647[_0x99f3('0x36')]=_0x2b6a0c;_0x20a647[_0x99f3('0x37')]=_0x49b158;_0x20a647[_0x99f3('0x39')]=_0x20a647[_0x99f3('0x39')]?_0x20a647['responsetime']:_0x3e8b57;_0x20a647[_0x99f3('0x3f')]=_0x20a647['endtime']?_0x20a647[_0x99f3('0x3f')]:_0x3e8b57;_0x20a647[_0x99f3('0x3a')]=getSeconds(_0x20a647[_0x99f3('0x39')]||0x0,_0x20a647[_0x99f3('0x38')]||0x0);_0x20a647[_0x99f3('0x40')]=_0x20a647['answertime']?getSeconds(_0x20a647[_0x99f3('0x3f')],_0x20a647[_0x99f3('0x41')]):0x0;};exports[_0x99f3('0x42')]=function(_0x1b5df0){return _0x1b5df0===_0x99f3('0x43');};exports[_0x99f3('0x44')]=function(_0x2a2504,_0x1d7f76,_0x44d910,_0x3550c7,_0x2276ef){var _0x29cea5=_0x3550c7?_0x99f3('0x45'):_0x2a2504[_0x99f3('0x46')];_0x29cea5=_0x2276ef?'BOOKED':_0x29cea5;return{'actionid':_0x2a2504[_0x99f3('0x47')],'action':_0x99f3('0x48'),'channel':_0x2a2504[_0x99f3('0x49')],'callerid':util[_0x99f3('0x12')](_0x99f3('0x13'),_0x29cea5,_0x2a2504['calleridnum']),'Exten':_0x99f3('0x24'),'Context':_0x99f3('0x4a'),'Priority':'1','variable':_0x44d910,'timeout':(_0x1d7f76[_0x99f3('0x4b')]||0x1e)*0x3e8,'async':!![],'channelid':_0x2a2504[_0x99f3('0x47')]};};exports[_0x99f3('0x4c')]=function(_0x1e2c3f){return _0x1e2c3f['countbusyretry']+_0x1e2c3f['countcongestionretry']+_0x1e2c3f[_0x99f3('0x4d')]+_0x1e2c3f['countagentrejectretry']+_0x1e2c3f[_0x99f3('0x4e')];};exports['cloneAction']=function(_0x55c769){var _0x2bfe13=_[_0x99f3('0x4f')](_0x55c769);_0x2bfe13[_0x99f3('0x36')]=0xf;_0x2bfe13[_0x99f3('0x37')]='Global';return _0x2bfe13;};exports[_0x99f3('0x50')]=function(_0x205dcc,_0x3d6cc6,_0x593752){var _0x457a3c={};_0x457a3c[_0x3d6cc6]=_0x205dcc[_0x3d6cc6];_0x457a3c[_0x99f3('0x51')]=![];_0x457a3c[_0x99f3('0x52')]=moment()[_0x99f3('0x53')](_0x593752,'minutes')['format'](_0x99f3('0x35'));_0x457a3c[_0x99f3('0x1b')]=_0x205dcc['ContactId'];_0x457a3c[_0x99f3('0x54')]=_0x205dcc[_0x99f3('0x54')];_0x457a3c[_0x99f3('0x55')]=_0x205dcc[_0x99f3('0x55')]||undefined;return _0x457a3c;};exports[_0x99f3('0x56')]=function(_0x42c11c,_0x32a814){if(!_[_0x99f3('0x16')](_0x42c11c)){if(_0x42c11c[_0x99f3('0x57')]>0x0){_0x42c11c[_0x99f3('0x57')]-=0x1;}else{logger[_0x99f3('0x9')](_0x32a814,_0x99f3('0x58'));}}else{logger[_0x99f3('0x9')](_0x32a814,_0x99f3('0x59'));}};exports[_0x99f3('0x5a')]=function(_0x318912){if(_0x318912<=0x0){return!![];}return![];};exports[_0x99f3('0x5b')]=function(_0x2b39b8,_0x259746,_0x5d1bd2){_0x2b39b8[_0x99f3('0x5c')]=_0x259746;_0x2b39b8[_0x99f3('0x19')]=_0x2b39b8[_0x99f3('0x5d')];_0x2b39b8[_0x99f3('0x5e')]=_0x2b39b8['channelAgent'];_0x2b39b8['motionChannel']=_0x99f3('0x5f');if(_0x5d1bd2){_0x2b39b8['mandatoryDisposition']=_0x5d1bd2[_0x99f3('0x60')];}return _0x2b39b8;};exports[_0x99f3('0x61')]=function(_0x2af29c){var _0x4069bc={};_0x4069bc[_0x99f3('0x5d')]=_0x2af29c[_0x99f3('0x5d')];_0x4069bc[_0x99f3('0x5e')]=_0x2af29c[_0x99f3('0x49')];_0x4069bc[_0x99f3('0x47')]=_0x2af29c[_0x99f3('0x47')];return _0x4069bc;};exports[_0x99f3('0x62')]=function(_0x1957ca){var _0x4f578f=[];for(var _0x4bffb4 in _0x1957ca){if(_0x1957ca[_0x99f3('0x2a')](_0x4bffb4)){if(!_[_0x99f3('0x16')](_0x1957ca[_0x4bffb4])&&_0x1957ca[_0x4bffb4][_0x99f3('0x36')]===_0x99f3('0x63')&&_0x1957ca[_0x4bffb4]['status']===_0x99f3('0x64')){_0x4f578f['push'](_0x1957ca[_0x4bffb4]['id']);}}}return _0x4f578f;};exports['getDiff']=function(_0x296f98){var _0x4ee57d=moment()[_0x99f3('0x5')](0x0);var _0x403d60=moment(_0x296f98)[_0x99f3('0x5')](0x0);return _0x4ee57d['diff'](_0x403d60,_0x99f3('0x7'));};exports[_0x99f3('0x65')]=function(_0x525970){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x525970[_0x99f3('0x1b')],'ListId':_0x525970[_0x99f3('0x54')],'VoiceQueueId':_0x525970[_0x99f3('0x55')]||undefined,'CampaignId':_0x525970[_0x99f3('0x66')]||undefined};};exports[_0x99f3('0x67')]=function(_0x375f68){if(_0x375f68===_0x99f3('0x47')||_0x375f68===_0x99f3('0x68')||_0x375f68===_0x99f3('0x5d')||_0x375f68===_0x99f3('0x69')||_0x375f68===_0x99f3('0x6a')||_0x375f68==='dialAnswer'||_0x375f68===_0x99f3('0x3c')||_0x375f68===_0x99f3('0x49')||_0x375f68==='calleridname'||_0x375f68==='active'||_0x375f68===_0x99f3('0x1a')||_0x375f68===_0x99f3('0x52')||_0x375f68==='countbusyretry'||_0x375f68===_0x99f3('0x6b')||_0x375f68===_0x99f3('0x4d')||_0x375f68===_0x99f3('0x6c')||_0x375f68==='callback'||_0x375f68===_0x99f3('0x6d')||_0x375f68===_0x99f3('0x6e')||_0x375f68===_0x99f3('0x6f')||_0x375f68===_0x99f3('0x1b')||_0x375f68===_0x99f3('0x54')||_0x375f68===_0x99f3('0x3d')||_0x375f68===_0x99f3('0x55')||_0x375f68===_0x99f3('0x70')||_0x375f68===_0x99f3('0x71')||_0x375f68===_0x99f3('0x72')||_0x375f68===_0x99f3('0x73')||_0x375f68==='xmd-listid'||_0x375f68===_0x99f3('0x74')||_0x375f68==='xmd-dialtimeout'||_0x375f68===_0x99f3('0x75')||_0x375f68===_0x99f3('0x76')||_0x375f68===_0x99f3('0x77')||_0x375f68===_0x99f3('0x78')||_0x375f68===_0x99f3('0x79')||_0x375f68==='xmd-callerid'||_0x375f68===_0x99f3('0x7a')||_0x375f68===_0x99f3('0x7b')||_0x375f68===_0x99f3('0x7c')||_0x375f68===_0x99f3('0x7d')||_0x375f68===_0x99f3('0x7e')||_0x375f68===_0x99f3('0x7f')||_0x375f68===_0x99f3('0x80')||_0x375f68===_0x99f3('0x81')||_0x375f68===_0x99f3('0x82')||_0x375f68===_0x99f3('0x83')||_0x375f68===_0x99f3('0x7c')||_0x375f68==='rtpaudioqosbridged'||_0x375f68===_0x99f3('0x7e')||_0x375f68==='rtpaudioqosjitterbridged'||_0x375f68===_0x99f3('0x80')||_0x375f68==='rtpaudioqoslossbridged'||_0x375f68===_0x99f3('0x82')||_0x375f68===_0x99f3('0x83')||_0x375f68===_0x99f3('0x84')||_0x375f68===_0x99f3('0x85')||_0x375f68===_0x99f3('0x36')||_0x375f68==='statedesc'){return![];}return!![];};exports['getCallerIdRandom']=function(_0x90edaf,_0x1af915){var _0x5d991d,_0x2be516,_0x4b7bf5;if(_0x1af915<=0x0){_0x1af915=0x1;}_0x5d991d=new RegExp(_0x99f3('0x86')+_0x1af915+'}$');_0x2be516=Math['pow'](0xa,_0x1af915-0x1);_0x4b7bf5=Math[_0x99f3('0x87')](0xa,_0x1af915)-0x1;return util[_0x99f3('0x12')]('%s',_[_0x99f3('0x88')](_0x90edaf,_0x5d991d,_[_0x99f3('0x89')](_0x2be516,_0x4b7bf5)));};exports['extractCalleridName']=function(_0x11d06b){var _0x39e96e=_0x11d06b[_0x99f3('0x8a')](/"(.*?)"/);return _0x39e96e?_0x39e96e[0x1]:_0x11d06b;};exports[_0x99f3('0x8b')]=function(_0x5cf133){var _0x408c3f=_0x5cf133['match'](/<(.*?)>/);return _0x408c3f?_0x408c3f[0x1]:_0x5cf133;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index ed2493d..2b57647 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 _0x30da=['queueremove','queuepause','reload','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','string','number','boolean'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x30da,0x180));var _0xa30d=function(_0x4769cf,_0x260108){_0x4769cf=_0x4769cf-0x0;var _0x4405cc=_0x30da[_0x4769cf];return _0x4405cc;};'use strict';exports['queueadd']={'queue':{'type':_0xa30d('0x0'),'required':!![]},'interface':{'type':_0xa30d('0x0'),'required':!![]},'membername':{'type':_0xa30d('0x0'),'required':!![]},'penalty':{'type':_0xa30d('0x1'),'required':![]},'paused':{'type':_0xa30d('0x2'),'required':![]}};exports[_0xa30d('0x3')]={'queue':{'type':_0xa30d('0x0'),'required':!![]},'interface':{'type':'string','required':!![]}};exports[_0xa30d('0x4')]={'interface':{'type':'string','required':!![]},'paused':{'type':_0xa30d('0x2')},'reason':{'type':_0xa30d('0x0'),'required':![]}};exports[_0xa30d('0x5')]={'module':{'type':_0xa30d('0x0'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0xa30d('0x0'),'required':!![]}};exports[_0xa30d('0x6')]={'uniqueid':{'type':_0xa30d('0x0'),'required':!![]},'filename':{'type':_0xa30d('0x0')},'format':{'type':_0xa30d('0x0')},'mixmonitorid':{'type':_0xa30d('0x0')}};exports[_0xa30d('0x7')]={'uniqueid':{'type':_0xa30d('0x0'),'required':!![]}};exports[_0xa30d('0x8')]={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0xa30d('0x0'),'required':!![]},'context':{'type':_0xa30d('0x0')}}; \ No newline at end of file +var _0xd7e8=['reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','queueadd','string','number','boolean','queuepause'];(function(_0x50993c,_0x186d2a){var _0x143663=function(_0x1a150a){while(--_0x1a150a){_0x50993c['push'](_0x50993c['shift']());}};_0x143663(++_0x186d2a);}(_0xd7e8,0x1bd));var _0x8d7e=function(_0x2c7448,_0x3aa359){_0x2c7448=_0x2c7448-0x0;var _0x4e9fba=_0xd7e8[_0x2c7448];return _0x4e9fba;};'use strict';exports[_0x8d7e('0x0')]={'queue':{'type':_0x8d7e('0x1'),'required':!![]},'interface':{'type':_0x8d7e('0x1'),'required':!![]},'membername':{'type':_0x8d7e('0x1'),'required':!![]},'penalty':{'type':_0x8d7e('0x2'),'required':![]},'paused':{'type':_0x8d7e('0x3'),'required':![]}};exports['queueremove']={'queue':{'type':'string','required':!![]},'interface':{'type':_0x8d7e('0x1'),'required':!![]}};exports[_0x8d7e('0x4')]={'interface':{'type':_0x8d7e('0x1'),'required':!![]},'paused':{'type':_0x8d7e('0x3')},'reason':{'type':_0x8d7e('0x1'),'required':![]}};exports[_0x8d7e('0x5')]={'module':{'type':_0x8d7e('0x1'),'required':![]}};exports[_0x8d7e('0x6')]={'uniqueid':{'type':_0x8d7e('0x1'),'required':!![]}};exports[_0x8d7e('0x7')]={'uniqueid':{'type':_0x8d7e('0x1'),'required':!![]},'filename':{'type':_0x8d7e('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':_0x8d7e('0x1')}};exports[_0x8d7e('0x8')]={'uniqueid':{'type':'string','required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0x8d7e('0x1'),'required':!![]},'exten':{'type':_0x8d7e('0x1'),'required':!![]},'context':{'type':_0x8d7e('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 4ee6dad..5b4b6b4 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 _0x2aa2=['initFreshdeskAccounts','zohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initDynamics365Accounts','freshsalesAccounts','initVoiceQueueHopperHistory','merge','groupBy','queue','queuecallerexit','queuecallerleaveAt','diff','queuecallerjoinAt','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','seconds','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject','initCampaignHopperHistory','initFaxAccounts','bluebird','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','voiceQueues','triggers','campaigns','templates','outbound','voiceExtensions','channels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','faxAccounts','mapKeys','hasOwnProperty','format','name','isNil','interface','SIP/%s','total','answered','sumHoldTime','sumDuration','sumBillable','ivrTotalCallsDays','ivrAnswerCallsDay','isEmpty','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','length','isUndefined','initTelephones','initVoiceQueues','initTriggers','initTemplates','initZendeskAccounts','initSalesforceAccounts'];(function(_0x41bc2a,_0x5d16b8){var _0xe0e3d9=function(_0x28ebf6){while(--_0x28ebf6){_0x41bc2a['push'](_0x41bc2a['shift']());}};_0xe0e3d9(++_0x5d16b8);}(_0x2aa2,0x1d4));var _0x22aa=function(_0x5887f2,_0x23a73c){_0x5887f2=_0x5887f2-0x0;var _0x489c62=_0x2aa2[_0x5887f2];return _0x489c62;};'use strict';var BPromise=require(_0x22aa('0x0'));var util=require('util');var _=require(_0x22aa('0x1'));var moment=require(_0x22aa('0x2'));var Agent=require(_0x22aa('0x3'));var Telephone=require(_0x22aa('0x4'));var Trunk=require(_0x22aa('0x5'));var VoiceQueue=require(_0x22aa('0x6'));var Trigger=require(_0x22aa('0x7'));var Template=require('../model/template');var Campaign=require('../model/campaign');var VoiceExtension=require(_0x22aa('0x8'));var ZendeskAccount=require(_0x22aa('0x9'));var SalesforceAccount=require(_0x22aa('0xa'));var FreshdeskAccount=require(_0x22aa('0xb'));var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0x22aa('0xc'));var DeskAccount=require(_0x22aa('0xd'));var VtigerAccount=require(_0x22aa('0xe'));var ServicenowAccount=require(_0x22aa('0xf'));var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require(_0x22aa('0x10'));var FaxAccount=require(_0x22aa('0x11'));var Realtime=function(){this[_0x22aa('0x12')]={};this[_0x22aa('0x13')]={};this[_0x22aa('0x14')]={};this[_0x22aa('0x15')]={};this[_0x22aa('0x16')]={};this[_0x22aa('0x17')]={};this[_0x22aa('0x18')]={};this[_0x22aa('0x19')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x22aa('0x1a')]={};this[_0x22aa('0x1b')]={};this['queueChannels']={};this[_0x22aa('0x1c')]={};this[_0x22aa('0x1d')]={};this[_0x22aa('0x1e')]={};this[_0x22aa('0x1f')]={};this[_0x22aa('0x20')]={};this[_0x22aa('0x21')]={};this[_0x22aa('0x22')]={};this['zohoAccounts']={};this[_0x22aa('0x23')]={};this[_0x22aa('0x24')]={};this['servicenowAccounts']={};this[_0x22aa('0x25')]={};this['freshsalesAccounts']={};this[_0x22aa('0x26')]={};};function freeIsNotKey(_0x45e450,_0x118d20,_0x27e164){var _0x4ea031=_[_0x22aa('0x27')](_0x45e450,function(_0x21e4ea,_0x2865d2){return _0x21e4ea[_0x27e164];});for(var _0xb4fa64 in _0x118d20){if(_0x118d20[_0x22aa('0x28')](_0xb4fa64)){if(!_0x4ea031[_0xb4fa64]){delete _0x118d20[_0xb4fa64];}}}}function freeIsNotKeySip(_0x569110,_0x5acdae){var _0x9b6fcb=_['mapKeys'](_0x569110,function(_0x590a4d,_0x5b5d92){return util[_0x22aa('0x29')]('SIP/%s',_0x590a4d[_0x22aa('0x2a')]);});for(var _0x29caf5 in _0x5acdae){if(_0x5acdae[_0x22aa('0x28')](_0x29caf5)){if(!_0x9b6fcb[_0x29caf5]){delete _0x5acdae[_0x29caf5];}}}}function freeIsNotKeyAgent(_0x18bf3e,_0x4f80bc){var _0x1a74fb=_[_0x22aa('0x27')](_0x18bf3e,function(_0x348775,_0x51070b){var _0x1e9ce3=_[_0x22aa('0x2b')](_0x348775[_0x22aa('0x2c')])?util[_0x22aa('0x29')](_0x22aa('0x2d'),_0x348775['name']):_0x348775[_0x22aa('0x2c')];return _0x1e9ce3;});for(var _0x623922 in _0x4f80bc){if(_0x4f80bc[_0x22aa('0x28')](_0x623922)){if(!_0x1a74fb[_0x623922]){delete _0x4f80bc[_0x623922];}}}}function clearVoiceCallReports(_0x527f18){_0x527f18[_0x22aa('0x2e')]=0x0;_0x527f18[_0x22aa('0x2f')]=0x0;_0x527f18[_0x22aa('0x30')]=0x0;_0x527f18[_0x22aa('0x31')]=0x0;_0x527f18[_0x22aa('0x32')]=0x0;}function clearCampaigns(_0x212e93){if(!_['isEmpty'](_0x212e93)){for(var _0x43cf87 in _0x212e93){if(_0x212e93[_0x22aa('0x28')](_0x43cf87)){_0x212e93[_0x43cf87][_0x22aa('0x33')]=0x0;_0x212e93[_0x43cf87][_0x22aa('0x34')]=0x0;}}}}function clearVoiceQueues(_0x3db982){if(!_[_0x22aa('0x35')](_0x3db982)){for(var _0x29a396 in _0x3db982){if(_0x3db982['hasOwnProperty'](_0x29a396)){_0x3db982[_0x29a396][_0x22aa('0x2e')]=0x0;_0x3db982[_0x29a396][_0x22aa('0x2f')]=0x0;_0x3db982[_0x29a396][_0x22aa('0x36')]=0x0;_0x3db982[_0x29a396][_0x22aa('0x37')]=0x0;_0x3db982[_0x29a396][_0x22aa('0x30')]=0x0;_0x3db982[_0x29a396][_0x22aa('0x31')]=0x0;_0x3db982[_0x29a396][_0x22aa('0x32')]=0x0;_0x3db982[_0x29a396][_0x22aa('0x38')]=0x0;_0x3db982[_0x29a396][_0x22aa('0x39')]=0x0;_0x3db982[_0x29a396]['outboundBusyCallsDay']=0x0;_0x3db982[_0x29a396][_0x22aa('0x3a')]=0x0;_0x3db982[_0x29a396][_0x22aa('0x3b')]=0x0;_0x3db982[_0x29a396][_0x22aa('0x3c')]=0x0;_0x3db982[_0x29a396][_0x22aa('0x3d')]=0x0;_0x3db982[_0x29a396]['outboundDropCallsDayCallersExit']=0x0;_0x3db982[_0x29a396][_0x22aa('0x3e')]=0x0;_0x3db982[_0x29a396][_0x22aa('0x3f')]=0x0;_0x3db982[_0x29a396]['outboundRejectCallsDay']=0x0;_0x3db982[_0x29a396][_0x22aa('0x40')]=0x0;_0x3db982[_0x29a396]['outboundAnswerAgiCallsDay']=0x0;_0x3db982[_0x29a396]['outboundAnswerCallsDay']=0x0;_0x3db982[_0x29a396][_0x22aa('0x41')]=!![];}}}}Realtime[_0x22aa('0x42')][_0x22aa('0x43')]=function(_0x1b8937,_0x5e0188){for(var _0x4d9c74 in _0x5e0188){if(_0x1b8937['hasOwnProperty'](_0x4d9c74)){_0x1b8937[_0x4d9c74]=_0x5e0188[_0x4d9c74];}}};Realtime[_0x22aa('0x42')][_0x22aa('0x44')]=function(){var _0x1df347=this;return function(_0x37f834){if(_0x37f834){freeIsNotKeyAgent(_0x37f834,_0x1df347[_0x22aa('0x12')]);for(var _0x28cb8b=0x0,_0xbe1b8f={},_0x384752={};_0x28cb8b<_0x37f834[_0x22aa('0x45')];_0x28cb8b+=0x1){_0xbe1b8f=_0x37f834[_0x28cb8b];var _0x425904=_['isNil'](_0xbe1b8f['interface'])?util[_0x22aa('0x29')](_0x22aa('0x2d'),_0xbe1b8f[_0x22aa('0x2a')]):_0xbe1b8f[_0x22aa('0x2c')];if(_[_0x22aa('0x46')](_0x1df347[_0x22aa('0x12')][_0x425904])){_0x1df347[_0x22aa('0x12')][_0x425904]=new Agent(_0xbe1b8f);}else{_0x1df347[_0x22aa('0x43')](_0x1df347[_0x22aa('0x12')][_0x425904],_0xbe1b8f);}}}return _0x1df347[_0x22aa('0x12')];};};Realtime['prototype'][_0x22aa('0x47')]=function(){var _0x15fb9e=this;return function(_0x2b3d8b){if(_0x2b3d8b){freeIsNotKeySip(_0x2b3d8b,_0x15fb9e[_0x22aa('0x13')]);for(var _0x465f9e=0x0,_0x196d61={},_0x2fabbd={};_0x465f9e<_0x2b3d8b['length'];_0x465f9e+=0x1){_0x196d61=_0x2b3d8b[_0x465f9e];if(_[_0x22aa('0x46')](_0x15fb9e[_0x22aa('0x13')][util['format']('SIP/%s',_0x196d61[_0x22aa('0x2a')])])){_0x15fb9e['telephones'][util['format']('SIP/%s',_0x196d61[_0x22aa('0x2a')])]=new Telephone(_0x196d61);}else{_0x15fb9e[_0x22aa('0x43')](_0x15fb9e[_0x22aa('0x13')][util[_0x22aa('0x29')](_0x22aa('0x2d'),_0x196d61[_0x22aa('0x2a')])],_0x196d61);}}}return _0x15fb9e[_0x22aa('0x13')];};};Realtime[_0x22aa('0x42')]['initTrunks']=function(){var _0x3b4a07=this;return function(_0x283ff8){if(_0x283ff8){freeIsNotKeySip(_0x283ff8,_0x3b4a07['trunks']);for(var _0x4bb373=0x0,_0x795771={},_0x41203b={};_0x4bb373<_0x283ff8['length'];_0x4bb373+=0x1){_0x795771=_0x283ff8[_0x4bb373];if(_[_0x22aa('0x46')](_0x3b4a07[_0x22aa('0x14')][util[_0x22aa('0x29')](_0x22aa('0x2d'),_0x795771[_0x22aa('0x2a')])])){_0x3b4a07[_0x22aa('0x14')][util[_0x22aa('0x29')](_0x22aa('0x2d'),_0x795771[_0x22aa('0x2a')])]=new Trunk(_0x795771);}else{_0x3b4a07['mergeFromDatabase'](_0x3b4a07[_0x22aa('0x14')][util[_0x22aa('0x29')]('SIP/%s',_0x795771[_0x22aa('0x2a')])],_0x795771);}}}return _0x3b4a07[_0x22aa('0x14')];};};Realtime[_0x22aa('0x42')][_0x22aa('0x48')]=function(){var _0x5a36fc=this;return function(_0x5165ba){if(_0x5165ba){freeIsNotKey(_0x5165ba,_0x5a36fc[_0x22aa('0x15')],_0x22aa('0x2a'));for(var _0x4b1969=0x0,_0x5768ee={},_0x3ab141={};_0x4b1969<_0x5165ba[_0x22aa('0x45')];_0x4b1969+=0x1){_0x5768ee=_0x5165ba[_0x4b1969];if(_[_0x22aa('0x46')](_0x5a36fc['voiceQueues'][_0x5768ee[_0x22aa('0x2a')]])){_0x5a36fc[_0x22aa('0x15')][_0x5768ee[_0x22aa('0x2a')]]=new VoiceQueue(_0x5768ee);}else{_0x5a36fc['mergeFromDatabase'](_0x5a36fc[_0x22aa('0x15')][_0x5768ee[_0x22aa('0x2a')]],_0x5768ee);}}}return _0x5a36fc[_0x22aa('0x15')];};};Realtime[_0x22aa('0x42')][_0x22aa('0x49')]=function(){var _0x512768=this;return function(_0x4b3aff){if(_0x4b3aff){freeIsNotKey(_0x4b3aff,_0x512768['triggers'],'id');for(var _0x203fdd=0x0,_0x50ee04={},_0x67bb85={};_0x203fdd<_0x4b3aff[_0x22aa('0x45')];_0x203fdd+=0x1){_0x50ee04=_0x4b3aff[_0x203fdd];if(_[_0x22aa('0x46')](_0x512768[_0x22aa('0x16')][_0x50ee04['id']])){_0x512768['triggers'][_0x50ee04['id']]=new Trigger(_0x50ee04);}else{_0x512768[_0x22aa('0x43')](_0x512768['triggers'][_0x50ee04['id']],_0x50ee04);}}}return _0x512768[_0x22aa('0x16')];};};Realtime[_0x22aa('0x42')][_0x22aa('0x4a')]=function(){var _0x2ecfa0=this;return function(_0x47da52){if(_0x47da52){freeIsNotKey(_0x47da52,_0x2ecfa0['templates'],'id');for(var _0x361d4b=0x0,_0x36a5d8={},_0x12648a={};_0x361d4b<_0x47da52['length'];_0x361d4b+=0x1){_0x36a5d8=_0x47da52[_0x361d4b];if(_[_0x22aa('0x46')](_0x2ecfa0['templates'][_0x36a5d8['id']])){_0x2ecfa0['templates'][_0x36a5d8['id']]=new Template(_0x36a5d8);}else{_0x2ecfa0['mergeFromDatabase'](_0x2ecfa0[_0x22aa('0x18')][_0x36a5d8['id']],_0x36a5d8);}}}return _0x2ecfa0['templates'];};};Realtime['prototype'][_0x22aa('0x4b')]=function(){var _0x349a1e=this;return function(_0x4b536f){if(_0x4b536f){freeIsNotKey(_0x4b536f,_0x349a1e[_0x22aa('0x1f')],'id');for(var _0x75702d=0x0,_0x6debdb={},_0x6726cf={};_0x75702d<_0x4b536f[_0x22aa('0x45')];_0x75702d+=0x1){_0x6debdb=_0x4b536f[_0x75702d];if(_[_0x22aa('0x46')](_0x349a1e[_0x22aa('0x1f')][_0x6debdb['id']])){_0x349a1e[_0x22aa('0x1f')][_0x6debdb['id']]=new ZendeskAccount(_0x6debdb);}else{_0x349a1e[_0x22aa('0x43')](_0x349a1e[_0x22aa('0x1f')][_0x6debdb['id']],_0x6debdb);}}}return _0x349a1e['zendeskAccounts'];};};Realtime[_0x22aa('0x42')][_0x22aa('0x4c')]=function(){var _0x45b1b6=this;return function(_0x40b88c){if(_0x40b88c){freeIsNotKey(_0x40b88c,_0x45b1b6[_0x22aa('0x20')],'id');for(var _0x46fd39=0x0,_0x212e09={},_0x586fc7={};_0x46fd39<_0x40b88c[_0x22aa('0x45')];_0x46fd39+=0x1){_0x212e09=_0x40b88c[_0x46fd39];if(_[_0x22aa('0x46')](_0x45b1b6[_0x22aa('0x20')][_0x212e09['id']])){_0x45b1b6[_0x22aa('0x20')][_0x212e09['id']]=new SalesforceAccount(_0x212e09);}else{_0x45b1b6['mergeFromDatabase'](_0x45b1b6[_0x22aa('0x20')][_0x212e09['id']],_0x212e09);}}}return _0x45b1b6['salesforceAccounts'];};};Realtime[_0x22aa('0x42')][_0x22aa('0x4d')]=function(){var _0x21ce6d=this;return function(_0x1afca8){if(_0x1afca8){freeIsNotKey(_0x1afca8,_0x21ce6d[_0x22aa('0x22')],'id');for(var _0x50e7d8=0x0,_0x58d2ef={},_0x188106={};_0x50e7d8<_0x1afca8[_0x22aa('0x45')];_0x50e7d8+=0x1){_0x58d2ef=_0x1afca8[_0x50e7d8];if(_[_0x22aa('0x46')](_0x21ce6d[_0x22aa('0x22')][_0x58d2ef['id']])){_0x21ce6d[_0x22aa('0x22')][_0x58d2ef['id']]=new FreshdeskAccount(_0x58d2ef);}else{_0x21ce6d[_0x22aa('0x43')](_0x21ce6d[_0x22aa('0x22')][_0x58d2ef['id']],_0x58d2ef);}}}return _0x21ce6d[_0x22aa('0x22')];};};Realtime[_0x22aa('0x42')]['initZohoAccounts']=function(){var _0xc8988c=this;return function(_0xc73d5){if(_0xc73d5){freeIsNotKey(_0xc73d5,_0xc8988c['zohoAccounts'],'id');for(var _0x172856=0x0,_0x55218e={},_0x135fba={};_0x172856<_0xc73d5['length'];_0x172856+=0x1){_0x55218e=_0xc73d5[_0x172856];if(_[_0x22aa('0x46')](_0xc8988c['zohoAccounts'][_0x55218e['id']])){_0xc8988c[_0x22aa('0x4e')][_0x55218e['id']]=new ZohoAccount(_0x55218e);}else{_0xc8988c['mergeFromDatabase'](_0xc8988c['zohoAccounts'][_0x55218e['id']],_0x55218e);}}}return _0xc8988c['zohoAccounts'];};};Realtime[_0x22aa('0x42')][_0x22aa('0x4f')]=function(){var _0x6078e8=this;return function(_0x2d9468){if(_0x2d9468){freeIsNotKey(_0x2d9468,_0x6078e8[_0x22aa('0x23')],'id');for(var _0x4a7fd5=0x0,_0x327e9f={},_0x38a4d3={};_0x4a7fd5<_0x2d9468['length'];_0x4a7fd5+=0x1){_0x327e9f=_0x2d9468[_0x4a7fd5];if(_['isUndefined'](_0x6078e8[_0x22aa('0x23')][_0x327e9f['id']])){_0x6078e8[_0x22aa('0x23')][_0x327e9f['id']]=new DeskAccount(_0x327e9f);}else{_0x6078e8[_0x22aa('0x43')](_0x6078e8['deskAccounts'][_0x327e9f['id']],_0x327e9f);}}}return _0x6078e8[_0x22aa('0x23')];};};Realtime[_0x22aa('0x42')][_0x22aa('0x50')]=function(){var _0x500b2a=this;return function(_0x52bd40){if(_0x52bd40){freeIsNotKey(_0x52bd40,_0x500b2a['sugarcrmAccounts'],'id');for(var _0x1d1b64=0x0,_0x1cc678={},_0x2a7d99={};_0x1d1b64<_0x52bd40[_0x22aa('0x45')];_0x1d1b64+=0x1){_0x1cc678=_0x52bd40[_0x1d1b64];if(_[_0x22aa('0x46')](_0x500b2a['sugarcrmAccounts'][_0x1cc678['id']])){_0x500b2a['sugarcrmAccounts'][_0x1cc678['id']]=new SugarcrmAccount(_0x1cc678);}else{_0x500b2a[_0x22aa('0x43')](_0x500b2a[_0x22aa('0x21')][_0x1cc678['id']],_0x1cc678);}}}return _0x500b2a[_0x22aa('0x21')];};};Realtime[_0x22aa('0x42')][_0x22aa('0x51')]=function(){var _0x5bc078=this;return function(_0x4aff6b){if(_0x4aff6b){freeIsNotKey(_0x4aff6b,_0x5bc078['vtigerAccounts'],'id');for(var _0x2c99e7=0x0,_0x19a742={},_0x2e3bb1={};_0x2c99e7<_0x4aff6b['length'];_0x2c99e7+=0x1){_0x19a742=_0x4aff6b[_0x2c99e7];if(_[_0x22aa('0x46')](_0x5bc078[_0x22aa('0x24')][_0x19a742['id']])){_0x5bc078[_0x22aa('0x24')][_0x19a742['id']]=new VtigerAccount(_0x19a742);}else{_0x5bc078['mergeFromDatabase'](_0x5bc078[_0x22aa('0x24')][_0x19a742['id']],_0x19a742);}}}return _0x5bc078[_0x22aa('0x24')];};};Realtime['prototype'][_0x22aa('0x52')]=function(){var _0x96066b=this;return function(_0x385e9d){if(_0x385e9d){freeIsNotKey(_0x385e9d,_0x96066b['servicenowAccounts'],'id');for(var _0x4a72c6=0x0,_0x2aa78e={},_0x3c0ac={};_0x4a72c6<_0x385e9d[_0x22aa('0x45')];_0x4a72c6+=0x1){_0x2aa78e=_0x385e9d[_0x4a72c6];if(_['isUndefined'](_0x96066b['servicenowAccounts'][_0x2aa78e['id']])){_0x96066b['servicenowAccounts'][_0x2aa78e['id']]=new ServicenowAccount(_0x2aa78e);}else{_0x96066b['mergeFromDatabase'](_0x96066b[_0x22aa('0x53')][_0x2aa78e['id']],_0x2aa78e);}}}return _0x96066b[_0x22aa('0x53')];};};Realtime[_0x22aa('0x42')][_0x22aa('0x54')]=function(){var _0x39f715=this;return function(_0x4bb2cd){if(_0x4bb2cd){freeIsNotKey(_0x4bb2cd,_0x39f715[_0x22aa('0x25')],'id');for(var _0x2d4291=0x0,_0x1defe6={},_0x572802={};_0x2d4291<_0x4bb2cd['length'];_0x2d4291+=0x1){_0x1defe6=_0x4bb2cd[_0x2d4291];if(_[_0x22aa('0x46')](_0x39f715['dynamics365Accounts'][_0x1defe6['id']])){_0x39f715[_0x22aa('0x25')][_0x1defe6['id']]=new Dynamics365Account(_0x1defe6);}else{_0x39f715[_0x22aa('0x43')](_0x39f715['dynamics365Accounts'][_0x1defe6['id']],_0x1defe6);}}}return _0x39f715['dynamics365Accounts'];};};Realtime[_0x22aa('0x42')]['initFreshsalesAccounts']=function(){var _0x26ab37=this;return function(_0x505025){if(_0x505025){freeIsNotKey(_0x505025,_0x26ab37['freshsalesAccounts'],'id');for(var _0x4add0d=0x0,_0x2bc5fe={},_0x250766={};_0x4add0d<_0x505025[_0x22aa('0x45')];_0x4add0d+=0x1){_0x2bc5fe=_0x505025[_0x4add0d];if(_[_0x22aa('0x46')](_0x26ab37[_0x22aa('0x55')][_0x2bc5fe['id']])){_0x26ab37[_0x22aa('0x55')][_0x2bc5fe['id']]=new FreshsalesAccount(_0x2bc5fe);}else{_0x26ab37['mergeFromDatabase'](_0x26ab37[_0x22aa('0x55')][_0x2bc5fe['id']],_0x2bc5fe);}}}return _0x26ab37[_0x22aa('0x55')];};};Realtime[_0x22aa('0x42')][_0x22aa('0x56')]=function(){var _0x3f1ac3=this;return function(_0xc68499){for(var _0xc3ec8f=0x0;_0xc3ec8f<_0xc68499['length'];_0xc3ec8f+=0x1){_[_0x22aa('0x57')](_0x3f1ac3[_0x22aa('0x15')][_0xc68499[_0xc3ec8f][_0x22aa('0x2a')]],_0xc68499[_0xc3ec8f]);}return _0x3f1ac3[_0x22aa('0x15')];};};Realtime[_0x22aa('0x42')]['initVoiceQueueReports']=function(){var _0x4bed91=this;return function(_0x317bf4){clearVoiceQueues(_0x4bed91[_0x22aa('0x15')]);if(_0x317bf4){_0x317bf4=_[_0x22aa('0x58')](_0x317bf4,'uniqueid');for(var _0x5130d5 in _0x317bf4){if(_0x317bf4[_0x22aa('0x28')](_0x5130d5)){var _0x11ca86={};for(var _0x1ea0ca=0x0;_0x1ea0ca<_0x317bf4[_0x5130d5][_0x22aa('0x45')];_0x1ea0ca+=0x1){var _0xb9a9dd=_0x317bf4[_0x5130d5][_0x1ea0ca][_0x22aa('0x59')];if(_0x4bed91['voiceQueues'][_0xb9a9dd]){if(_0x317bf4[_0x5130d5][_0x1ea0ca][_0x22aa('0x5a')]){_0x4bed91['voiceQueues'][_0xb9a9dd]['unmanaged']+=0x1;}if(_0x317bf4[_0x5130d5][_0x1ea0ca]['queuecallerabandon']){_0x4bed91['voiceQueues'][_0xb9a9dd][_0x22aa('0x37')]+=0x1;}_0x4bed91[_0x22aa('0x15')][_0xb9a9dd]['sumHoldTime']+=moment(_0x317bf4[_0x5130d5][_0x1ea0ca][_0x22aa('0x5b')])[_0x22aa('0x5c')](moment(_0x317bf4[_0x5130d5][_0x1ea0ca][_0x22aa('0x5d')]),'seconds')||0x0;if(_0x1ea0ca===_0x317bf4[_0x5130d5][_0x22aa('0x45')]-0x1){_0x4bed91[_0x22aa('0x15')][_0xb9a9dd][_0x22aa('0x31')]+=moment(_0x317bf4[_0x5130d5][_0x1ea0ca][_0x22aa('0x5e')]||_0x317bf4[_0x5130d5][_0x1ea0ca][_0x22aa('0x5f')]||_0x317bf4[_0x5130d5][_0x1ea0ca][_0x22aa('0x60')])[_0x22aa('0x5c')](moment(_0x317bf4[_0x5130d5][_0x1ea0ca][_0x22aa('0x5d')]),'seconds')||0x0;_0x4bed91[_0x22aa('0x15')][_0xb9a9dd][_0x22aa('0x2e')]+=0x1;if(_0x317bf4[_0x5130d5][_0x1ea0ca][_0x22aa('0x61')]){_0x4bed91[_0x22aa('0x15')][_0xb9a9dd]['answered']+=0x1;_0x4bed91['voiceQueues'][_0xb9a9dd]['sumBillable']+=moment(_0x317bf4[_0x5130d5][_0x1ea0ca][_0x22aa('0x5e')])[_0x22aa('0x5c')](moment(_0x317bf4[_0x5130d5][_0x1ea0ca][_0x22aa('0x5b')]),_0x22aa('0x62'))||0x0;}}else{_0x4bed91[_0x22aa('0x15')][_0xb9a9dd][_0x22aa('0x31')]+=_0x4bed91['voiceQueues'][_0xb9a9dd][_0x22aa('0x30')]||0x0;}}}}}}return _0x4bed91['voiceQueues'];};};Realtime[_0x22aa('0x42')][_0x22aa('0x63')]=function(){var _0x5f4e3b=this;return function(_0x58d97d){clearVoiceCallReports(_0x5f4e3b['outbound']);if(_0x58d97d){for(var _0x299e0b=0x0;_0x299e0b<_0x58d97d[_0x22aa('0x45')];_0x299e0b+=0x1){_0x5f4e3b[_0x22aa('0x19')]['total']+=0x1;_0x5f4e3b[_0x22aa('0x19')][_0x22aa('0x31')]+=_0x58d97d[_0x299e0b][_0x22aa('0x64')];if(_0x58d97d[_0x299e0b][_0x22aa('0x65')]===_0x22aa('0x66')){_0x5f4e3b['outbound'][_0x22aa('0x2f')]+=0x1;_0x5f4e3b['outbound']['sumHoldTime']+=_0x58d97d[_0x299e0b][_0x22aa('0x64')]-_0x58d97d[_0x299e0b][_0x22aa('0x67')]||0x0;_0x5f4e3b[_0x22aa('0x19')][_0x22aa('0x32')]+=_0x58d97d[_0x299e0b][_0x22aa('0x67')];}}}return _0x5f4e3b[_0x22aa('0x19')];};};Realtime[_0x22aa('0x42')][_0x22aa('0x68')]=function(){var _0x592bdb=this;return function(_0x3cb444){if(_0x3cb444){freeIsNotKey(_0x3cb444,_0x592bdb['campaigns'],_0x22aa('0x2a'));for(var _0x5916a8=0x0,_0x40d87a={};_0x5916a8<_0x3cb444['length'];_0x5916a8+=0x1){_0x40d87a=_0x3cb444[_0x5916a8];if(_['isUndefined'](_0x592bdb['campaigns'][_0x40d87a[_0x22aa('0x2a')]])){_0x592bdb[_0x22aa('0x17')][_0x40d87a[_0x22aa('0x2a')]]=new Campaign(_0x40d87a);}else{_0x592bdb['mergeFromDatabase'](_0x592bdb['campaigns'][_0x40d87a['name']],_0x40d87a);_0x592bdb[_0x22aa('0x17')][_0x40d87a[_0x22aa('0x2a')]][_0x22aa('0x69')]=_0x40d87a[_0x22aa('0x6a')]?_0x40d87a[_0x22aa('0x6a')][_0x22aa('0x2a')]:undefined;}}}return _0x592bdb[_0x22aa('0x17')];};};Realtime['prototype']['initVoiceExtensions']=function(){var _0x322f27=this;return function(_0x702659){if(_0x702659){freeIsNotKey(_0x702659,_0x322f27[_0x22aa('0x1a')],'id');for(var _0x1eb78c=0x0,_0x20a01a={};_0x1eb78c<_0x702659['length'];_0x1eb78c+=0x1){_0x20a01a=_0x702659[_0x1eb78c];if(_['isUndefined'](_0x322f27[_0x22aa('0x1a')][_0x20a01a['id']])){_0x322f27[_0x22aa('0x1a')][_0x20a01a['id']]=new VoiceExtension(_0x20a01a);}else{_0x322f27['mergeFromDatabase'](_0x322f27['voiceExtensions'][_0x20a01a['id']],_0x20a01a);}}}return _0x322f27[_0x22aa('0x1a')];};};Realtime[_0x22aa('0x42')][_0x22aa('0x6b')]=function(){var _0x449412=this;return function(_0x4bf963){clearCampaigns(_0x449412[_0x22aa('0x17')]);for(var _0xb3a253=0x0;_0xb3a253<_0x4bf963['length'];_0xb3a253+=0x1){_[_0x22aa('0x57')](_0x449412['campaigns'][_0x4bf963[_0xb3a253][_0x22aa('0x2a')]],_0x4bf963[_0xb3a253]);}return _0x449412['campaigns'];};};Realtime[_0x22aa('0x42')][_0x22aa('0x6c')]=function(){var _0x4900df=this;return function(_0x4656a3){if(_0x4656a3){freeIsNotKey(_0x4656a3,_0x4900df[_0x22aa('0x26')],'id');for(var _0x48b0ea=0x0,_0x46ed96={},_0x3249fb={};_0x48b0ea<_0x4656a3[_0x22aa('0x45')];_0x48b0ea+=0x1){_0x46ed96=_0x4656a3[_0x48b0ea];if(_[_0x22aa('0x46')](_0x4900df[_0x22aa('0x26')][_0x46ed96['id']])){_0x4900df['faxAccounts'][_0x46ed96['id']]=new FaxAccount(_0x46ed96);}else{_0x4900df[_0x22aa('0x43')](_0x4900df[_0x22aa('0x26')][_0x46ed96['id']],_0x46ed96);}}}return _0x4900df[_0x22aa('0x26')];};};module['exports']=Realtime; \ No newline at end of file +var _0xe966=['../model/sugarcrmAccount','../model/zohoAccount','../model/vtigerAccount','../model/servicenowAccount','../model/faxAccount','agents','telephones','trunks','triggers','templates','voiceExtensions','channels','queueChannels','timers','settings','sugarcrmAccounts','freshdeskAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','name','interface','total','sumHoldTime','sumBillable','ivrAnswerCallsDay','isEmpty','unmanaged','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerAgiCallsDay','queueStatusComplete','prototype','initAgents','length','isNil','SIP/%s','mergeFromDatabase','isUndefined','initVoiceQueues','voiceQueues','initTriggers','initZendeskAccounts','zendeskAccounts','initSalesforceAccounts','salesforceAccounts','initZohoAccounts','zohoAccounts','initDeskAccounts','initSugarcrmAccounts','initServicenowAccounts','dynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','abandoned','diff','sumDuration','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallerjoinAt','seconds','queuecallercomplete','answered','outbound','duration','disposition','ANSWERED','billableseconds','initCampaigns','campaigns','SquareProject','initVoiceExtensions','initFaxAccounts','util','lodash','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/template','../model/campaign','../model/voiceExtension','../model/freshdeskAccount'];(function(_0x478e45,_0x4e60ca){var _0x1eb234=function(_0xec5244){while(--_0xec5244){_0x478e45['push'](_0x478e45['shift']());}};_0x1eb234(++_0x4e60ca);}(_0xe966,0x192));var _0x6e96=function(_0x2b9ade,_0x206f0a){_0x2b9ade=_0x2b9ade-0x0;var _0x51e015=_0xe966[_0x2b9ade];return _0x51e015;};'use strict';var BPromise=require('bluebird');var util=require(_0x6e96('0x0'));var _=require(_0x6e96('0x1'));var moment=require('moment');var Agent=require(_0x6e96('0x2'));var Telephone=require(_0x6e96('0x3'));var Trunk=require(_0x6e96('0x4'));var VoiceQueue=require(_0x6e96('0x5'));var Trigger=require('../model/trigger');var Template=require(_0x6e96('0x6'));var Campaign=require(_0x6e96('0x7'));var VoiceExtension=require(_0x6e96('0x8'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0x6e96('0x9'));var SugarcrmAccount=require(_0x6e96('0xa'));var ZohoAccount=require(_0x6e96('0xb'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0x6e96('0xc'));var ServicenowAccount=require(_0x6e96('0xd'));var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0x6e96('0xe'));var Realtime=function(){this[_0x6e96('0xf')]={};this[_0x6e96('0x10')]={};this[_0x6e96('0x11')]={};this['voiceQueues']={};this[_0x6e96('0x12')]={};this['campaigns']={};this[_0x6e96('0x13')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x6e96('0x14')]={};this[_0x6e96('0x15')]={};this[_0x6e96('0x16')]={};this['outboundChannels']={};this[_0x6e96('0x17')]={};this[_0x6e96('0x18')]={};this['zendeskAccounts']={};this['salesforceAccounts']={};this[_0x6e96('0x19')]={};this[_0x6e96('0x1a')]={};this['zohoAccounts']={};this[_0x6e96('0x1b')]={};this[_0x6e96('0x1c')]={};this[_0x6e96('0x1d')]={};this['dynamics365Accounts']={};this[_0x6e96('0x1e')]={};this[_0x6e96('0x1f')]={};};function freeIsNotKey(_0x18c550,_0x1ea1ee,_0x886eeb){var _0x3453c3=_[_0x6e96('0x20')](_0x18c550,function(_0x50cf93,_0x42a789){return _0x50cf93[_0x886eeb];});for(var _0x15e5f1 in _0x1ea1ee){if(_0x1ea1ee[_0x6e96('0x21')](_0x15e5f1)){if(!_0x3453c3[_0x15e5f1]){delete _0x1ea1ee[_0x15e5f1];}}}}function freeIsNotKeySip(_0x436298,_0x3a4d56){var _0x50348f=_[_0x6e96('0x20')](_0x436298,function(_0xd672f2,_0x232399){return util[_0x6e96('0x22')]('SIP/%s',_0xd672f2[_0x6e96('0x23')]);});for(var _0x1822c0 in _0x3a4d56){if(_0x3a4d56[_0x6e96('0x21')](_0x1822c0)){if(!_0x50348f[_0x1822c0]){delete _0x3a4d56[_0x1822c0];}}}}function freeIsNotKeyAgent(_0x52782b,_0x1bcc53){var _0xf7202b=_[_0x6e96('0x20')](_0x52782b,function(_0x2259f3,_0xbc3d84){var _0x1dc1d2=_['isNil'](_0x2259f3[_0x6e96('0x24')])?util[_0x6e96('0x22')]('SIP/%s',_0x2259f3['name']):_0x2259f3[_0x6e96('0x24')];return _0x1dc1d2;});for(var _0x5ac526 in _0x1bcc53){if(_0x1bcc53['hasOwnProperty'](_0x5ac526)){if(!_0xf7202b[_0x5ac526]){delete _0x1bcc53[_0x5ac526];}}}}function clearVoiceCallReports(_0x34463a){_0x34463a[_0x6e96('0x25')]=0x0;_0x34463a['answered']=0x0;_0x34463a[_0x6e96('0x26')]=0x0;_0x34463a['sumDuration']=0x0;_0x34463a[_0x6e96('0x27')]=0x0;}function clearCampaigns(_0x1a28ed){if(!_['isEmpty'](_0x1a28ed)){for(var _0x1c4a06 in _0x1a28ed){if(_0x1a28ed[_0x6e96('0x21')](_0x1c4a06)){_0x1a28ed[_0x1c4a06]['ivrTotalCallsDays']=0x0;_0x1a28ed[_0x1c4a06][_0x6e96('0x28')]=0x0;}}}}function clearVoiceQueues(_0x5aef92){if(!_[_0x6e96('0x29')](_0x5aef92)){for(var _0xc326b5 in _0x5aef92){if(_0x5aef92[_0x6e96('0x21')](_0xc326b5)){_0x5aef92[_0xc326b5][_0x6e96('0x25')]=0x0;_0x5aef92[_0xc326b5]['answered']=0x0;_0x5aef92[_0xc326b5][_0x6e96('0x2a')]=0x0;_0x5aef92[_0xc326b5]['abandoned']=0x0;_0x5aef92[_0xc326b5]['sumHoldTime']=0x0;_0x5aef92[_0xc326b5]['sumDuration']=0x0;_0x5aef92[_0xc326b5][_0x6e96('0x27')]=0x0;_0x5aef92[_0xc326b5]['outboundAnswerAgiCallsDay']=0x0;_0x5aef92[_0xc326b5][_0x6e96('0x2b')]=0x0;_0x5aef92[_0xc326b5][_0x6e96('0x2c')]=0x0;_0x5aef92[_0xc326b5]['outboundCongestionCallsDay']=0x0;_0x5aef92[_0xc326b5][_0x6e96('0x2d')]=0x0;_0x5aef92[_0xc326b5][_0x6e96('0x2e')]=0x0;_0x5aef92[_0xc326b5][_0x6e96('0x2f')]=0x0;_0x5aef92[_0xc326b5][_0x6e96('0x30')]=0x0;_0x5aef92[_0xc326b5][_0x6e96('0x31')]=0x0;_0x5aef92[_0xc326b5][_0x6e96('0x32')]=0x0;_0x5aef92[_0xc326b5][_0x6e96('0x33')]=0x0;_0x5aef92[_0xc326b5]['outboundReCallsDay']=0x0;_0x5aef92[_0xc326b5][_0x6e96('0x34')]=0x0;_0x5aef92[_0xc326b5]['outboundAnswerCallsDay']=0x0;_0x5aef92[_0xc326b5][_0x6e96('0x35')]=!![];}}}}Realtime['prototype']['mergeFromDatabase']=function(_0x3456d2,_0x292688){for(var _0x5016c5 in _0x292688){if(_0x3456d2['hasOwnProperty'](_0x5016c5)){_0x3456d2[_0x5016c5]=_0x292688[_0x5016c5];}}};Realtime[_0x6e96('0x36')][_0x6e96('0x37')]=function(){var _0x5d43ef=this;return function(_0x486d15){if(_0x486d15){freeIsNotKeyAgent(_0x486d15,_0x5d43ef[_0x6e96('0xf')]);for(var _0x560625=0x0,_0x378be3={},_0xe74b64={};_0x560625<_0x486d15[_0x6e96('0x38')];_0x560625+=0x1){_0x378be3=_0x486d15[_0x560625];var _0x1009a4=_[_0x6e96('0x39')](_0x378be3[_0x6e96('0x24')])?util[_0x6e96('0x22')](_0x6e96('0x3a'),_0x378be3[_0x6e96('0x23')]):_0x378be3['interface'];if(_['isUndefined'](_0x5d43ef[_0x6e96('0xf')][_0x1009a4])){_0x5d43ef[_0x6e96('0xf')][_0x1009a4]=new Agent(_0x378be3);}else{_0x5d43ef[_0x6e96('0x3b')](_0x5d43ef['agents'][_0x1009a4],_0x378be3);}}}return _0x5d43ef['agents'];};};Realtime[_0x6e96('0x36')]['initTelephones']=function(){var _0x2ebb90=this;return function(_0x46016d){if(_0x46016d){freeIsNotKeySip(_0x46016d,_0x2ebb90[_0x6e96('0x10')]);for(var _0x44c6fd=0x0,_0x25a78e={},_0x17d8e1={};_0x44c6fd<_0x46016d[_0x6e96('0x38')];_0x44c6fd+=0x1){_0x25a78e=_0x46016d[_0x44c6fd];if(_[_0x6e96('0x3c')](_0x2ebb90[_0x6e96('0x10')][util[_0x6e96('0x22')](_0x6e96('0x3a'),_0x25a78e[_0x6e96('0x23')])])){_0x2ebb90['telephones'][util['format'](_0x6e96('0x3a'),_0x25a78e['name'])]=new Telephone(_0x25a78e);}else{_0x2ebb90[_0x6e96('0x3b')](_0x2ebb90[_0x6e96('0x10')][util[_0x6e96('0x22')]('SIP/%s',_0x25a78e[_0x6e96('0x23')])],_0x25a78e);}}}return _0x2ebb90[_0x6e96('0x10')];};};Realtime['prototype']['initTrunks']=function(){var _0x25738b=this;return function(_0x1c1b12){if(_0x1c1b12){freeIsNotKeySip(_0x1c1b12,_0x25738b[_0x6e96('0x11')]);for(var _0x128bd1=0x0,_0xdabc6b={},_0x59eafd={};_0x128bd1<_0x1c1b12[_0x6e96('0x38')];_0x128bd1+=0x1){_0xdabc6b=_0x1c1b12[_0x128bd1];if(_[_0x6e96('0x3c')](_0x25738b[_0x6e96('0x11')][util[_0x6e96('0x22')](_0x6e96('0x3a'),_0xdabc6b[_0x6e96('0x23')])])){_0x25738b[_0x6e96('0x11')][util[_0x6e96('0x22')]('SIP/%s',_0xdabc6b[_0x6e96('0x23')])]=new Trunk(_0xdabc6b);}else{_0x25738b[_0x6e96('0x3b')](_0x25738b[_0x6e96('0x11')][util[_0x6e96('0x22')](_0x6e96('0x3a'),_0xdabc6b[_0x6e96('0x23')])],_0xdabc6b);}}}return _0x25738b[_0x6e96('0x11')];};};Realtime[_0x6e96('0x36')][_0x6e96('0x3d')]=function(){var _0x5e41cc=this;return function(_0x523dce){if(_0x523dce){freeIsNotKey(_0x523dce,_0x5e41cc[_0x6e96('0x3e')],_0x6e96('0x23'));for(var _0x18a9cd=0x0,_0x4da7b5={},_0x18ad79={};_0x18a9cd<_0x523dce[_0x6e96('0x38')];_0x18a9cd+=0x1){_0x4da7b5=_0x523dce[_0x18a9cd];if(_[_0x6e96('0x3c')](_0x5e41cc[_0x6e96('0x3e')][_0x4da7b5[_0x6e96('0x23')]])){_0x5e41cc[_0x6e96('0x3e')][_0x4da7b5[_0x6e96('0x23')]]=new VoiceQueue(_0x4da7b5);}else{_0x5e41cc[_0x6e96('0x3b')](_0x5e41cc[_0x6e96('0x3e')][_0x4da7b5['name']],_0x4da7b5);}}}return _0x5e41cc[_0x6e96('0x3e')];};};Realtime[_0x6e96('0x36')][_0x6e96('0x3f')]=function(){var _0x2768c1=this;return function(_0x43d407){if(_0x43d407){freeIsNotKey(_0x43d407,_0x2768c1['triggers'],'id');for(var _0x1e9520=0x0,_0x260568={},_0x28b42f={};_0x1e9520<_0x43d407[_0x6e96('0x38')];_0x1e9520+=0x1){_0x260568=_0x43d407[_0x1e9520];if(_['isUndefined'](_0x2768c1['triggers'][_0x260568['id']])){_0x2768c1[_0x6e96('0x12')][_0x260568['id']]=new Trigger(_0x260568);}else{_0x2768c1[_0x6e96('0x3b')](_0x2768c1['triggers'][_0x260568['id']],_0x260568);}}}return _0x2768c1['triggers'];};};Realtime[_0x6e96('0x36')]['initTemplates']=function(){var _0x587565=this;return function(_0x201f0e){if(_0x201f0e){freeIsNotKey(_0x201f0e,_0x587565[_0x6e96('0x13')],'id');for(var _0x54f7d5=0x0,_0x41f359={},_0x4bf72e={};_0x54f7d5<_0x201f0e[_0x6e96('0x38')];_0x54f7d5+=0x1){_0x41f359=_0x201f0e[_0x54f7d5];if(_['isUndefined'](_0x587565['templates'][_0x41f359['id']])){_0x587565['templates'][_0x41f359['id']]=new Template(_0x41f359);}else{_0x587565[_0x6e96('0x3b')](_0x587565[_0x6e96('0x13')][_0x41f359['id']],_0x41f359);}}}return _0x587565[_0x6e96('0x13')];};};Realtime[_0x6e96('0x36')][_0x6e96('0x40')]=function(){var _0x43dd8b=this;return function(_0x47e368){if(_0x47e368){freeIsNotKey(_0x47e368,_0x43dd8b[_0x6e96('0x41')],'id');for(var _0x280d7f=0x0,_0x429099={},_0xe423b9={};_0x280d7f<_0x47e368['length'];_0x280d7f+=0x1){_0x429099=_0x47e368[_0x280d7f];if(_[_0x6e96('0x3c')](_0x43dd8b[_0x6e96('0x41')][_0x429099['id']])){_0x43dd8b[_0x6e96('0x41')][_0x429099['id']]=new ZendeskAccount(_0x429099);}else{_0x43dd8b['mergeFromDatabase'](_0x43dd8b[_0x6e96('0x41')][_0x429099['id']],_0x429099);}}}return _0x43dd8b['zendeskAccounts'];};};Realtime[_0x6e96('0x36')][_0x6e96('0x42')]=function(){var _0x142ac8=this;return function(_0x2693b2){if(_0x2693b2){freeIsNotKey(_0x2693b2,_0x142ac8[_0x6e96('0x43')],'id');for(var _0x23dbc7=0x0,_0x301508={},_0x2f0361={};_0x23dbc7<_0x2693b2['length'];_0x23dbc7+=0x1){_0x301508=_0x2693b2[_0x23dbc7];if(_['isUndefined'](_0x142ac8[_0x6e96('0x43')][_0x301508['id']])){_0x142ac8['salesforceAccounts'][_0x301508['id']]=new SalesforceAccount(_0x301508);}else{_0x142ac8['mergeFromDatabase'](_0x142ac8[_0x6e96('0x43')][_0x301508['id']],_0x301508);}}}return _0x142ac8[_0x6e96('0x43')];};};Realtime[_0x6e96('0x36')]['initFreshdeskAccounts']=function(){var _0x3e1fb4=this;return function(_0x807579){if(_0x807579){freeIsNotKey(_0x807579,_0x3e1fb4[_0x6e96('0x1a')],'id');for(var _0xc66398=0x0,_0x1d3b9={},_0x5700c7={};_0xc66398<_0x807579[_0x6e96('0x38')];_0xc66398+=0x1){_0x1d3b9=_0x807579[_0xc66398];if(_['isUndefined'](_0x3e1fb4[_0x6e96('0x1a')][_0x1d3b9['id']])){_0x3e1fb4[_0x6e96('0x1a')][_0x1d3b9['id']]=new FreshdeskAccount(_0x1d3b9);}else{_0x3e1fb4[_0x6e96('0x3b')](_0x3e1fb4[_0x6e96('0x1a')][_0x1d3b9['id']],_0x1d3b9);}}}return _0x3e1fb4[_0x6e96('0x1a')];};};Realtime[_0x6e96('0x36')][_0x6e96('0x44')]=function(){var _0x4c4cc4=this;return function(_0x374b01){if(_0x374b01){freeIsNotKey(_0x374b01,_0x4c4cc4[_0x6e96('0x45')],'id');for(var _0x426753=0x0,_0x213895={},_0x4019a4={};_0x426753<_0x374b01[_0x6e96('0x38')];_0x426753+=0x1){_0x213895=_0x374b01[_0x426753];if(_[_0x6e96('0x3c')](_0x4c4cc4['zohoAccounts'][_0x213895['id']])){_0x4c4cc4[_0x6e96('0x45')][_0x213895['id']]=new ZohoAccount(_0x213895);}else{_0x4c4cc4[_0x6e96('0x3b')](_0x4c4cc4[_0x6e96('0x45')][_0x213895['id']],_0x213895);}}}return _0x4c4cc4['zohoAccounts'];};};Realtime['prototype'][_0x6e96('0x46')]=function(){var _0x4bd0ef=this;return function(_0x42d860){if(_0x42d860){freeIsNotKey(_0x42d860,_0x4bd0ef['deskAccounts'],'id');for(var _0x45885b=0x0,_0x493b4e={},_0x596167={};_0x45885b<_0x42d860[_0x6e96('0x38')];_0x45885b+=0x1){_0x493b4e=_0x42d860[_0x45885b];if(_[_0x6e96('0x3c')](_0x4bd0ef[_0x6e96('0x1b')][_0x493b4e['id']])){_0x4bd0ef[_0x6e96('0x1b')][_0x493b4e['id']]=new DeskAccount(_0x493b4e);}else{_0x4bd0ef[_0x6e96('0x3b')](_0x4bd0ef[_0x6e96('0x1b')][_0x493b4e['id']],_0x493b4e);}}}return _0x4bd0ef[_0x6e96('0x1b')];};};Realtime[_0x6e96('0x36')][_0x6e96('0x47')]=function(){var _0x3cec86=this;return function(_0x3cbafa){if(_0x3cbafa){freeIsNotKey(_0x3cbafa,_0x3cec86[_0x6e96('0x19')],'id');for(var _0x57513c=0x0,_0x390b9e={},_0x3c3211={};_0x57513c<_0x3cbafa[_0x6e96('0x38')];_0x57513c+=0x1){_0x390b9e=_0x3cbafa[_0x57513c];if(_[_0x6e96('0x3c')](_0x3cec86[_0x6e96('0x19')][_0x390b9e['id']])){_0x3cec86[_0x6e96('0x19')][_0x390b9e['id']]=new SugarcrmAccount(_0x390b9e);}else{_0x3cec86[_0x6e96('0x3b')](_0x3cec86[_0x6e96('0x19')][_0x390b9e['id']],_0x390b9e);}}}return _0x3cec86[_0x6e96('0x19')];};};Realtime[_0x6e96('0x36')]['initVtigerAccounts']=function(){var _0x1353e6=this;return function(_0x180278){if(_0x180278){freeIsNotKey(_0x180278,_0x1353e6[_0x6e96('0x1c')],'id');for(var _0x332603=0x0,_0x26fa8f={},_0xcb989a={};_0x332603<_0x180278['length'];_0x332603+=0x1){_0x26fa8f=_0x180278[_0x332603];if(_[_0x6e96('0x3c')](_0x1353e6[_0x6e96('0x1c')][_0x26fa8f['id']])){_0x1353e6['vtigerAccounts'][_0x26fa8f['id']]=new VtigerAccount(_0x26fa8f);}else{_0x1353e6[_0x6e96('0x3b')](_0x1353e6[_0x6e96('0x1c')][_0x26fa8f['id']],_0x26fa8f);}}}return _0x1353e6[_0x6e96('0x1c')];};};Realtime['prototype'][_0x6e96('0x48')]=function(){var _0xd5acd5=this;return function(_0x295fa2){if(_0x295fa2){freeIsNotKey(_0x295fa2,_0xd5acd5[_0x6e96('0x1d')],'id');for(var _0x4b0478=0x0,_0x4aa2ad={},_0x41b50a={};_0x4b0478<_0x295fa2[_0x6e96('0x38')];_0x4b0478+=0x1){_0x4aa2ad=_0x295fa2[_0x4b0478];if(_['isUndefined'](_0xd5acd5['servicenowAccounts'][_0x4aa2ad['id']])){_0xd5acd5[_0x6e96('0x1d')][_0x4aa2ad['id']]=new ServicenowAccount(_0x4aa2ad);}else{_0xd5acd5[_0x6e96('0x3b')](_0xd5acd5['servicenowAccounts'][_0x4aa2ad['id']],_0x4aa2ad);}}}return _0xd5acd5[_0x6e96('0x1d')];};};Realtime['prototype']['initDynamics365Accounts']=function(){var _0x2fd654=this;return function(_0xc60cf3){if(_0xc60cf3){freeIsNotKey(_0xc60cf3,_0x2fd654['dynamics365Accounts'],'id');for(var _0xe044b=0x0,_0xcbad02={},_0x3e38ff={};_0xe044b<_0xc60cf3[_0x6e96('0x38')];_0xe044b+=0x1){_0xcbad02=_0xc60cf3[_0xe044b];if(_['isUndefined'](_0x2fd654[_0x6e96('0x49')][_0xcbad02['id']])){_0x2fd654['dynamics365Accounts'][_0xcbad02['id']]=new Dynamics365Account(_0xcbad02);}else{_0x2fd654[_0x6e96('0x3b')](_0x2fd654[_0x6e96('0x49')][_0xcbad02['id']],_0xcbad02);}}}return _0x2fd654[_0x6e96('0x49')];};};Realtime['prototype'][_0x6e96('0x4a')]=function(){var _0x36d3f3=this;return function(_0x14b58f){if(_0x14b58f){freeIsNotKey(_0x14b58f,_0x36d3f3[_0x6e96('0x1e')],'id');for(var _0x1161c8=0x0,_0x18a9bd={},_0xf46db6={};_0x1161c8<_0x14b58f[_0x6e96('0x38')];_0x1161c8+=0x1){_0x18a9bd=_0x14b58f[_0x1161c8];if(_[_0x6e96('0x3c')](_0x36d3f3[_0x6e96('0x1e')][_0x18a9bd['id']])){_0x36d3f3['freshsalesAccounts'][_0x18a9bd['id']]=new FreshsalesAccount(_0x18a9bd);}else{_0x36d3f3[_0x6e96('0x3b')](_0x36d3f3[_0x6e96('0x1e')][_0x18a9bd['id']],_0x18a9bd);}}}return _0x36d3f3[_0x6e96('0x1e')];};};Realtime[_0x6e96('0x36')][_0x6e96('0x4b')]=function(){var _0x2bd90b=this;return function(_0x2c1a2d){for(var _0x22142b=0x0;_0x22142b<_0x2c1a2d[_0x6e96('0x38')];_0x22142b+=0x1){_[_0x6e96('0x4c')](_0x2bd90b['voiceQueues'][_0x2c1a2d[_0x22142b][_0x6e96('0x23')]],_0x2c1a2d[_0x22142b]);}return _0x2bd90b[_0x6e96('0x3e')];};};Realtime['prototype'][_0x6e96('0x4d')]=function(){var _0x5d20e4=this;return function(_0x2c6e7e){clearVoiceQueues(_0x5d20e4[_0x6e96('0x3e')]);if(_0x2c6e7e){_0x2c6e7e=_[_0x6e96('0x4e')](_0x2c6e7e,_0x6e96('0x4f'));for(var _0x261972 in _0x2c6e7e){if(_0x2c6e7e['hasOwnProperty'](_0x261972)){var _0x14b38f={};for(var _0x45836e=0x0;_0x45836e<_0x2c6e7e[_0x261972][_0x6e96('0x38')];_0x45836e+=0x1){var _0x5c0ed8=_0x2c6e7e[_0x261972][_0x45836e][_0x6e96('0x50')];if(_0x5d20e4[_0x6e96('0x3e')][_0x5c0ed8]){if(_0x2c6e7e[_0x261972][_0x45836e][_0x6e96('0x51')]){_0x5d20e4[_0x6e96('0x3e')][_0x5c0ed8][_0x6e96('0x2a')]+=0x1;}if(_0x2c6e7e[_0x261972][_0x45836e][_0x6e96('0x52')]){_0x5d20e4['voiceQueues'][_0x5c0ed8][_0x6e96('0x53')]+=0x1;}_0x5d20e4[_0x6e96('0x3e')][_0x5c0ed8]['sumHoldTime']+=moment(_0x2c6e7e[_0x261972][_0x45836e]['queuecallerleaveAt'])[_0x6e96('0x54')](moment(_0x2c6e7e[_0x261972][_0x45836e]['queuecallerjoinAt']),'seconds')||0x0;if(_0x45836e===_0x2c6e7e[_0x261972][_0x6e96('0x38')]-0x1){_0x5d20e4[_0x6e96('0x3e')][_0x5c0ed8][_0x6e96('0x55')]+=moment(_0x2c6e7e[_0x261972][_0x45836e][_0x6e96('0x56')]||_0x2c6e7e[_0x261972][_0x45836e][_0x6e96('0x57')]||_0x2c6e7e[_0x261972][_0x45836e][_0x6e96('0x58')])[_0x6e96('0x54')](moment(_0x2c6e7e[_0x261972][_0x45836e][_0x6e96('0x59')]),_0x6e96('0x5a'))||0x0;_0x5d20e4[_0x6e96('0x3e')][_0x5c0ed8]['total']+=0x1;if(_0x2c6e7e[_0x261972][_0x45836e][_0x6e96('0x5b')]){_0x5d20e4['voiceQueues'][_0x5c0ed8][_0x6e96('0x5c')]+=0x1;_0x5d20e4['voiceQueues'][_0x5c0ed8][_0x6e96('0x27')]+=moment(_0x2c6e7e[_0x261972][_0x45836e][_0x6e96('0x56')])[_0x6e96('0x54')](moment(_0x2c6e7e[_0x261972][_0x45836e]['queuecallerleaveAt']),_0x6e96('0x5a'))||0x0;}}else{_0x5d20e4[_0x6e96('0x3e')][_0x5c0ed8]['sumDuration']+=_0x5d20e4[_0x6e96('0x3e')][_0x5c0ed8]['sumHoldTime']||0x0;}}}}}}return _0x5d20e4[_0x6e96('0x3e')];};};Realtime[_0x6e96('0x36')]['initVoiceCallReports']=function(){var _0x34b1d4=this;return function(_0x14581a){clearVoiceCallReports(_0x34b1d4[_0x6e96('0x5d')]);if(_0x14581a){for(var _0x25317c=0x0;_0x25317c<_0x14581a['length'];_0x25317c+=0x1){_0x34b1d4[_0x6e96('0x5d')][_0x6e96('0x25')]+=0x1;_0x34b1d4[_0x6e96('0x5d')][_0x6e96('0x55')]+=_0x14581a[_0x25317c][_0x6e96('0x5e')];if(_0x14581a[_0x25317c][_0x6e96('0x5f')]===_0x6e96('0x60')){_0x34b1d4['outbound']['answered']+=0x1;_0x34b1d4[_0x6e96('0x5d')][_0x6e96('0x26')]+=_0x14581a[_0x25317c][_0x6e96('0x5e')]-_0x14581a[_0x25317c][_0x6e96('0x61')]||0x0;_0x34b1d4[_0x6e96('0x5d')]['sumBillable']+=_0x14581a[_0x25317c][_0x6e96('0x61')];}}}return _0x34b1d4[_0x6e96('0x5d')];};};Realtime['prototype'][_0x6e96('0x62')]=function(){var _0xd8c91c=this;return function(_0x107a26){if(_0x107a26){freeIsNotKey(_0x107a26,_0xd8c91c['campaigns'],_0x6e96('0x23'));for(var _0x547beb=0x0,_0x1b19dd={};_0x547beb<_0x107a26[_0x6e96('0x38')];_0x547beb+=0x1){_0x1b19dd=_0x107a26[_0x547beb];if(_[_0x6e96('0x3c')](_0xd8c91c['campaigns'][_0x1b19dd[_0x6e96('0x23')]])){_0xd8c91c[_0x6e96('0x63')][_0x1b19dd['name']]=new Campaign(_0x1b19dd);}else{_0xd8c91c['mergeFromDatabase'](_0xd8c91c[_0x6e96('0x63')][_0x1b19dd['name']],_0x1b19dd);_0xd8c91c[_0x6e96('0x63')][_0x1b19dd['name']]['dialQueueProject']=_0x1b19dd[_0x6e96('0x64')]?_0x1b19dd[_0x6e96('0x64')][_0x6e96('0x23')]:undefined;}}}return _0xd8c91c['campaigns'];};};Realtime[_0x6e96('0x36')][_0x6e96('0x65')]=function(){var _0x290d9d=this;return function(_0x3e6521){if(_0x3e6521){freeIsNotKey(_0x3e6521,_0x290d9d[_0x6e96('0x14')],'id');for(var _0xbbebcf=0x0,_0x3847dd={};_0xbbebcf<_0x3e6521[_0x6e96('0x38')];_0xbbebcf+=0x1){_0x3847dd=_0x3e6521[_0xbbebcf];if(_['isUndefined'](_0x290d9d['voiceExtensions'][_0x3847dd['id']])){_0x290d9d[_0x6e96('0x14')][_0x3847dd['id']]=new VoiceExtension(_0x3847dd);}else{_0x290d9d[_0x6e96('0x3b')](_0x290d9d[_0x6e96('0x14')][_0x3847dd['id']],_0x3847dd);}}}return _0x290d9d['voiceExtensions'];};};Realtime[_0x6e96('0x36')]['initCampaignHopperHistory']=function(){var _0x6af5ca=this;return function(_0x580793){clearCampaigns(_0x6af5ca['campaigns']);for(var _0x583e7b=0x0;_0x583e7b<_0x580793[_0x6e96('0x38')];_0x583e7b+=0x1){_[_0x6e96('0x4c')](_0x6af5ca[_0x6e96('0x63')][_0x580793[_0x583e7b][_0x6e96('0x23')]],_0x580793[_0x583e7b]);}return _0x6af5ca['campaigns'];};};Realtime[_0x6e96('0x36')][_0x6e96('0x66')]=function(){var _0x103bd5=this;return function(_0x23b27c){if(_0x23b27c){freeIsNotKey(_0x23b27c,_0x103bd5['faxAccounts'],'id');for(var _0x18769b=0x0,_0x3882d3={},_0x2ef17d={};_0x18769b<_0x23b27c[_0x6e96('0x38')];_0x18769b+=0x1){_0x3882d3=_0x23b27c[_0x18769b];if(_[_0x6e96('0x3c')](_0x103bd5[_0x6e96('0x1f')][_0x3882d3['id']])){_0x103bd5[_0x6e96('0x1f')][_0x3882d3['id']]=new FaxAccount(_0x3882d3);}else{_0x103bd5[_0x6e96('0x3b')](_0x103bd5['faxAccounts'][_0x3882d3['id']],_0x3882d3);}}}return _0x103bd5[_0x6e96('0x1f')];};};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 5a93857..897761d 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 _0x0429=['custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','blindTransfer','attendedtransfer','findAgent','find','accountcode','name','interface','format','SIP/%s','length','connectedlinenum','assigned','lastAssignedTo','isNil','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','getAgentByInternal','keys','getCallType','channel','split','destination','exten','type','lastapplication','queue','lastdata','context','from-voip-provider','callerid','from-sip','originatecalleridnum','destinationchannel','calleridpreview','calleridnum','disposition','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','UserId','monitor','monitors','filename','createdAt','connectedlinename','membername','voiceDialReport','Local','substring','indexOf','mobile','lastIndexOf','transfererlinkedid','attendedTransfer','exports','moment','util','../../../config/environment','../ami','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/voiceQueueReport','../rpc/voiceRecording','./voiceCallReport','./voiceAgentReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport'];(function(_0xdec230,_0x4b3c25){var _0x2fe253=function(_0xeacc88){while(--_0xeacc88){_0xdec230['push'](_0xdec230['shift']());}};_0x2fe253(++_0x4b3c25);}(_0x0429,0xec));var _0x9042=function(_0x94a6d2,_0x426b40){_0x94a6d2=_0x94a6d2-0x0;var _0xbf55c3=_0x0429[_0x94a6d2];return _0xbf55c3;};'use strict';var _=require('lodash');var moment=require(_0x9042('0x0'));var util=require(_0x9042('0x1'));var config=require(_0x9042('0x2'));var ami=require(_0x9042('0x3'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0x9042('0x4'));var RpcVoiceDialReport=require(_0x9042('0x5'));var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0x9042('0x6'));var RpcVoiceRecording=require(_0x9042('0x7'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0x9042('0x8'));var VoiceAgentReport=require(_0x9042('0x9'));var VoiceDialReport=require('./voiceDialReport');var UserReport=require(_0x9042('0xa'));function Report(_0x130275){this[_0x9042('0xb')]=_0x130275;this[_0x9042('0xc')]=_0x130275[_0x9042('0xc')];this[_0x9042('0xd')]=_0x130275[_0x9042('0xd')];}Report[_0x9042('0xe')][_0x9042('0xf')]=function(_0x5e94e3){var _0x2376df=new VoiceQueueReport(this[_0x9042('0xb')]);var _0xcad992=new VoiceAgentReport(this[_0x9042('0xb')]);var _0x1867f9=new VoiceDialReport(this['realtime']);var _0x58ca71=new VoiceCallReport(this['realtime']);var _0x44c737=new UserReport(this[_0x9042('0xb')]);if(config[_0x9042('0x10')]&&config[_0x9042('0x10')][_0x9042('0x11')]){ami['on'](_0x9042('0x12'),this[_0x9042('0x13')][_0x9042('0x14')](this));ami['on'](_0x9042('0x15'),this['voiceCallReport'][_0x9042('0x14')](this));ami['on'](_0x9042('0x16'),this[_0x9042('0x17')][_0x9042('0x14')](this));ami['on'](_0x9042('0x18'),this['voiceDialReport'][_0x9042('0x14')](this));ami['on']('blindtransfer',this[_0x9042('0x19')]['bind'](this));ami['on'](_0x9042('0x1a'),this['attendedTransfer']['bind'](this));}};Report[_0x9042('0xe')][_0x9042('0x1b')]=function(_0x23d021){var _0x3fcec9;_0x3fcec9=_[_0x9042('0x1c')](this[_0x9042('0xc')],function(_0x519e7f){return _0x519e7f[_0x9042('0x1d')]==_0x23d021||_0x519e7f[_0x9042('0x1e')]==_0x23d021;});if(_['isNil'](_0x3fcec9)){var _0x532dd1=_[_0x9042('0x1c')](this[_0x9042('0xd')],function(_0x1371b9){return _0x1371b9['accountcode']==_0x23d021||_0x1371b9[_0x9042('0x1e')]==_0x23d021;});if(_0x532dd1){_0x3fcec9=_[_0x9042('0x1c')](this[_0x9042('0xc')],function(_0xe34b4d){return _0xe34b4d[_0x9042('0x1f')]==util[_0x9042('0x20')](_0x9042('0x21'),_0x532dd1[_0x9042('0x1e')]);});}}return _0x3fcec9;};Report[_0x9042('0xe')]['voiceQueueReport']=function(_0x37114e){for(var _0x1a6780=0x0;_0x1a6780<_0x37114e[_0x9042('0x22')];_0x1a6780+=0x1){var _0x35c3f=this[_0x9042('0x1b')](_0x37114e[_0x1a6780][_0x9042('0x23')]);if(_0x35c3f){_0x37114e[_0x1a6780]['accountcode']=_0x35c3f[_0x9042('0x1d')];_0x37114e[_0x1a6780][_0x9042('0x24')]=!![];_0x37114e[_0x1a6780][_0x9042('0x25')]=_0x35c3f[_0x9042('0x1e')];_0x37114e[_0x1a6780]['interface']=_[_0x9042('0x26')](_0x35c3f[_0x9042('0x1f')])?util['format'](_0x9042('0x21'),_0x35c3f[_0x9042('0x1e')]):_0x35c3f[_0x9042('0x1f')];if(_0x37114e[_0x1a6780]['queuecallercomplete']){_0x37114e[_0x1a6780][_0x9042('0x27')]=moment()[_0x9042('0x20')](_0x9042('0x28'));}if(_0x37114e[_0x1a6780][_0x9042('0x29')]){_0x37114e[_0x1a6780][_0x9042('0x2a')]=moment()['format'](_0x9042('0x28'));}RpcMemberReport[_0x9042('0x13')](_0x37114e[_0x1a6780]);}RpcVoiceQueueReport[_0x9042('0x2b')](_0x37114e[_0x1a6780]);}};function extractCalleridNumber(_0x5bbaaf){var _0x575428=_0x5bbaaf[_0x9042('0x2c')](/<(.*?)>/);return _0x575428?_0x575428[0x1]:_0x5bbaaf;}Report[_0x9042('0xe')][_0x9042('0x2d')]=function(_0x5dc992){for(var _0x9fd390=0x0;_0x9fd390',_0x5516ff[_0x9042('0x41')],_0x5516ff[_0x9042('0x3f')]);}if(RpcVoiceTransferReport[_0x9042('0x42')][_0x5516ff[_0x9042('0x43')]]){var _0x38a21e=RpcVoiceTransferReport[_0x9042('0x42')][_0x5516ff[_0x9042('0x43')]];_0x38a21e[_0x9042('0x44')]=_0x5516ff[_0x9042('0x45')];RpcVoiceTransferReport[_0x9042('0x19')](_0x38a21e);delete RpcVoiceTransferReport[_0x9042('0x42')][_0x5516ff[_0x9042('0x43')]];}if(_[_0x9042('0x26')](_0x5516ff['type'])){_0x5516ff['type']=this[_0x9042('0x2f')](_0x5516ff);}if(_['isNil'](_0x5516ff[_0x9042('0x46')])){var _0x2b41a5=_0x5516ff[_0x9042('0x30')][_0x9042('0x31')]('-')[0x0];var _0x2aa2da=this[_0x9042('0xc')][_0x2b41a5];if(!_0x2aa2da)_0x2aa2da=this['getAgentByInternal'](_0x5516ff[_0x9042('0x1d')]);if(_0x2aa2da){_0x5516ff['UserId']=_0x2aa2da['id'];_0x5516ff['membername']=_0x2aa2da[_0x9042('0x1e')];}}RpcVoiceCallReport['create'](_0x5516ff);if(_0x5516ff[_0x9042('0x47')]){for(var _0x6c75cf=0x0;_0x6c75cf<_0x5516ff[_0x9042('0x48')][_0x9042('0x22')];_0x6c75cf+=0x1){_0x5516ff['monitorFilename']=_0x5516ff['monitors'][_0x6c75cf][_0x9042('0x49')];_0x5516ff[_0x9042('0x4a')]=_0x5516ff[_0x9042('0x48')][_0x6c75cf][_0x9042('0x4a')];if(_0x5516ff['exten']=='xcally-motion-preview'){_0x5516ff['calleridnum']=_0x5516ff[_0x9042('0x23')];_0x5516ff[_0x9042('0x41')]=_0x5516ff['connectedlinename'];_0x5516ff[_0x9042('0x23')]=_0x5516ff[_0x9042('0x1d')];_0x5516ff[_0x9042('0x4b')]=_0x5516ff[_0x9042('0x4c')];_0x5516ff['exten']=_0x5516ff['originatecalleridnum'];}else if(_0x5516ff[_0x9042('0x33')]=='xcally-motion-dialer'){_0x5516ff[_0x9042('0x3f')]=_0x5516ff[_0x9042('0x32')];_0x5516ff[_0x9042('0x33')]=_0x5516ff[_0x9042('0x3c')];}RpcVoiceRecording[_0x9042('0x2b')](_0x5516ff);}}};Report[_0x9042('0xe')][_0x9042('0x17')]=function(_0x329fe5){if(_['isArray'](_0x329fe5)){_0x329fe5['forEach'](function(_0x56068f){RpcVoiceAgentReport[_0x9042('0x2b')](_0x56068f);});}else{RpcVoiceAgentReport['create'](_0x329fe5);}};Report['prototype'][_0x9042('0x4d')]=function(_0xaa5323){RpcVoiceDialReport['create'](_0xaa5323);var _0x351105;var _0x44c91f;var _0x313f54=_0xaa5323[_0x9042('0x30')];if(_['startsWith'](_0x313f54,_0x9042('0x4e'))){_0x44c91f=_0x313f54[_0x9042('0x4f')](_0x313f54[_0x9042('0x50')]('/')+0x1,_0x313f54[_0x9042('0x50')]('@'));_0x351105=_[_0x9042('0x1c')](this[_0x9042('0xc')],function(_0x1c2c7a){return _0x1c2c7a[_0x9042('0x51')]==_0x44c91f||_0x1c2c7a['phone']==_0x44c91f||_0x1c2c7a[_0x9042('0x1d')]==_0x44c91f;});}else{_0x44c91f=_0x313f54[_0x9042('0x4f')](_0x313f54[_0x9042('0x50')]('/')+0x1,_0x313f54[_0x9042('0x52')]('-'));_0x351105=this[_0x9042('0x1b')](_0x44c91f);}if(_0x351105){_0xaa5323[_0x9042('0x1f')]=_[_0x9042('0x26')](_0x351105[_0x9042('0x1f')])?util['format'](_0x9042('0x21'),_0x351105[_0x9042('0x1e')]):_0x351105[_0x9042('0x1f')];_0xaa5323[_0x9042('0x4c')]=_0x351105[_0x9042('0x1e')];_0xaa5323['accountcode']=_0x351105[_0x9042('0x1d')];RpcMemberReport[_0x9042('0x4d')](_0xaa5323);}};Report[_0x9042('0xe')]['blindTransfer']=function(_0x54d196){RpcVoiceTransferReport[_0x9042('0x42')][_0x54d196[_0x9042('0x53')]]=_0x54d196;};Report[_0x9042('0xe')][_0x9042('0x54')]=function(_0x1003b8){RpcVoiceTransferReport[_0x9042('0x54')](_0x1003b8);};module[_0x9042('0x55')]=Report; \ No newline at end of file +var _0xdc10=['internal','destination','exten','lastapplication','queue','lastdata','context','from-voip-provider','callerid','from-sip','calleridpreview','originatecalleridnum','ANSWERED','calleridname','transfers','linkedid','uniqueid','type','UserId','split','membername','create','monitor','monitors','filename','createdAt','xcally-motion-preview','connectedlinenum','connectedlinename','xcally-motion-dialer','channel','startsWith','Local','indexOf','phone','substring','lastIndexOf','transfererlinkedid','exports','moment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','voiceCallReport','bind','custom:voiceAgentReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','find','accountcode','isNil','SIP/%s','name','length','findAgent','assigned','interface','format','queuecallercomplete','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','match','prototype','getAgentByInternal','getCallType','calleridnum','outbound'];(function(_0x2e0520,_0x231044){var _0x8a60f3=function(_0x389c9b){while(--_0x389c9b){_0x2e0520['push'](_0x2e0520['shift']());}};_0x8a60f3(++_0x231044);}(_0xdc10,0x183));var _0x0dc1=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0xdc10[_0x5a776b];return _0xbbef59;};'use strict';var _=require('lodash');var moment=require(_0x0dc1('0x0'));var util=require('util');var config=require('../../../config/environment');var ami=require(_0x0dc1('0x1'));var RpcVoiceAgentReport=require(_0x0dc1('0x2'));var RpcVoiceCallReport=require(_0x0dc1('0x3'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0x0dc1('0x4'));var RpcVoiceQueueReport=require(_0x0dc1('0x5'));var RpcVoiceRecording=require(_0x0dc1('0x6'));var RpcVoiceTransferReport=require(_0x0dc1('0x7'));var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0x0dc1('0x8'));var VoiceAgentReport=require(_0x0dc1('0x9'));var VoiceDialReport=require(_0x0dc1('0xa'));var UserReport=require(_0x0dc1('0xb'));function Report(_0x35f45e){this[_0x0dc1('0xc')]=_0x35f45e;this[_0x0dc1('0xd')]=_0x35f45e[_0x0dc1('0xd')];this[_0x0dc1('0xe')]=_0x35f45e['telephones'];}Report['prototype'][_0x0dc1('0xf')]=function(_0x2776c1){var _0x53b9e9=new VoiceQueueReport(this['realtime']);var _0x431e1e=new VoiceAgentReport(this['realtime']);var _0x241bf6=new VoiceDialReport(this[_0x0dc1('0xc')]);var _0x1b8686=new VoiceCallReport(this[_0x0dc1('0xc')]);var _0x3b06d5=new UserReport(this[_0x0dc1('0xc')]);if(config['xdr']&&config[_0x0dc1('0x10')][_0x0dc1('0x11')]){ami['on'](_0x0dc1('0x12'),this[_0x0dc1('0x13')]['bind'](this));ami['on']('custom:voiceCallReport',this[_0x0dc1('0x14')][_0x0dc1('0x15')](this));ami['on'](_0x0dc1('0x16'),this['voiceAgentReport'][_0x0dc1('0x15')](this));ami['on']('custom:voiceDialReport',this[_0x0dc1('0x17')][_0x0dc1('0x15')](this));ami['on'](_0x0dc1('0x18'),this[_0x0dc1('0x19')][_0x0dc1('0x15')](this));ami['on'](_0x0dc1('0x1a'),this[_0x0dc1('0x1b')][_0x0dc1('0x15')](this));}};Report['prototype']['findAgent']=function(_0xd8b8bf){var _0x4d12bf;_0x4d12bf=_[_0x0dc1('0x1c')](this[_0x0dc1('0xd')],function(_0x4f8d1b){return _0x4f8d1b[_0x0dc1('0x1d')]==_0xd8b8bf||_0x4f8d1b['name']==_0xd8b8bf;});if(_[_0x0dc1('0x1e')](_0x4d12bf)){var _0x19effa=_[_0x0dc1('0x1c')](this[_0x0dc1('0xe')],function(_0x4dab61){return _0x4dab61['accountcode']==_0xd8b8bf||_0x4dab61['name']==_0xd8b8bf;});if(_0x19effa){_0x4d12bf=_[_0x0dc1('0x1c')](this['agents'],function(_0x2ed9eb){return _0x2ed9eb['interface']==util['format'](_0x0dc1('0x1f'),_0x19effa[_0x0dc1('0x20')]);});}}return _0x4d12bf;};Report['prototype']['voiceQueueReport']=function(_0x3b885b){for(var _0x193a88=0x0;_0x193a88<_0x3b885b[_0x0dc1('0x21')];_0x193a88+=0x1){var _0x686fe0=this[_0x0dc1('0x22')](_0x3b885b[_0x193a88]['connectedlinenum']);if(_0x686fe0){_0x3b885b[_0x193a88][_0x0dc1('0x1d')]=_0x686fe0[_0x0dc1('0x1d')];_0x3b885b[_0x193a88][_0x0dc1('0x23')]=!![];_0x3b885b[_0x193a88]['lastAssignedTo']=_0x686fe0[_0x0dc1('0x20')];_0x3b885b[_0x193a88]['interface']=_['isNil'](_0x686fe0[_0x0dc1('0x24')])?util[_0x0dc1('0x25')](_0x0dc1('0x1f'),_0x686fe0['name']):_0x686fe0[_0x0dc1('0x24')];if(_0x3b885b[_0x193a88][_0x0dc1('0x26')]){_0x3b885b[_0x193a88]['queuecallercompleteAt']=moment()['format'](_0x0dc1('0x27'));}if(_0x3b885b[_0x193a88][_0x0dc1('0x28')]){_0x3b885b[_0x193a88][_0x0dc1('0x29')]=moment()[_0x0dc1('0x25')](_0x0dc1('0x27'));}RpcMemberReport[_0x0dc1('0x13')](_0x3b885b[_0x193a88]);}RpcVoiceQueueReport['create'](_0x3b885b[_0x193a88]);}};function extractCalleridNumber(_0x597e34){var _0x116bcd=_0x597e34[_0x0dc1('0x2a')](/<(.*?)>/);return _0x116bcd?_0x116bcd[0x1]:_0x597e34;}Report[_0x0dc1('0x2b')][_0x0dc1('0x2c')]=function(_0x496606){for(var _0x202dfe=0x0;_0x202dfe',_0x33f300[_0x0dc1('0x3d')],_0x33f300[_0x0dc1('0x2e')]);}if(RpcVoiceTransferReport[_0x0dc1('0x3e')][_0x33f300['linkedid']]){var _0x2a437f=RpcVoiceTransferReport[_0x0dc1('0x3e')][_0x33f300[_0x0dc1('0x3f')]];_0x2a437f['transfereelinkedid']=_0x33f300[_0x0dc1('0x40')];RpcVoiceTransferReport[_0x0dc1('0x19')](_0x2a437f);delete RpcVoiceTransferReport['transfers'][_0x33f300[_0x0dc1('0x3f')]];}if(_[_0x0dc1('0x1e')](_0x33f300['type'])){_0x33f300[_0x0dc1('0x41')]=this[_0x0dc1('0x2d')](_0x33f300);}if(_['isNil'](_0x33f300[_0x0dc1('0x42')])){var _0x31ab13=_0x33f300['channel'][_0x0dc1('0x43')]('-')[0x0];var _0x18eb9f=this['agents'][_0x31ab13];if(!_0x18eb9f)_0x18eb9f=this['getAgentByInternal'](_0x33f300[_0x0dc1('0x1d')]);if(_0x18eb9f){_0x33f300['UserId']=_0x18eb9f['id'];_0x33f300[_0x0dc1('0x44')]=_0x18eb9f['name'];}}RpcVoiceCallReport[_0x0dc1('0x45')](_0x33f300);if(_0x33f300[_0x0dc1('0x46')]){for(var _0x20c7ad=0x0;_0x20c7ad<_0x33f300[_0x0dc1('0x47')]['length'];_0x20c7ad+=0x1){_0x33f300['monitorFilename']=_0x33f300[_0x0dc1('0x47')][_0x20c7ad][_0x0dc1('0x48')];_0x33f300[_0x0dc1('0x49')]=_0x33f300[_0x0dc1('0x47')][_0x20c7ad]['createdAt'];if(_0x33f300['exten']==_0x0dc1('0x4a')){_0x33f300[_0x0dc1('0x2e')]=_0x33f300[_0x0dc1('0x4b')];_0x33f300[_0x0dc1('0x3d')]=_0x33f300[_0x0dc1('0x4c')];_0x33f300[_0x0dc1('0x4b')]=_0x33f300[_0x0dc1('0x1d')];_0x33f300[_0x0dc1('0x4c')]=_0x33f300[_0x0dc1('0x44')];_0x33f300[_0x0dc1('0x32')]=_0x33f300[_0x0dc1('0x3b')];}else if(_0x33f300[_0x0dc1('0x32')]==_0x0dc1('0x4d')){_0x33f300['calleridnum']=_0x33f300['destination'];_0x33f300['exten']=_0x33f300[_0x0dc1('0x3b')];}RpcVoiceRecording[_0x0dc1('0x45')](_0x33f300);}}};Report[_0x0dc1('0x2b')]['voiceAgentReport']=function(_0x4f5984){if(_['isArray'](_0x4f5984)){_0x4f5984['forEach'](function(_0x2f3fa3){RpcVoiceAgentReport['create'](_0x2f3fa3);});}else{RpcVoiceAgentReport[_0x0dc1('0x45')](_0x4f5984);}};Report['prototype'][_0x0dc1('0x17')]=function(_0x593349){RpcVoiceDialReport[_0x0dc1('0x45')](_0x593349);var _0x358841;var _0x263f4a;var _0x455ae7=_0x593349[_0x0dc1('0x4e')];if(_[_0x0dc1('0x4f')](_0x455ae7,_0x0dc1('0x50'))){_0x263f4a=_0x455ae7['substring'](_0x455ae7['indexOf']('/')+0x1,_0x455ae7[_0x0dc1('0x51')]('@'));_0x358841=_['find'](this['agents'],function(_0xdec859){return _0xdec859['mobile']==_0x263f4a||_0xdec859[_0x0dc1('0x52')]==_0x263f4a||_0xdec859[_0x0dc1('0x1d')]==_0x263f4a;});}else{_0x263f4a=_0x455ae7[_0x0dc1('0x53')](_0x455ae7[_0x0dc1('0x51')]('/')+0x1,_0x455ae7[_0x0dc1('0x54')]('-'));_0x358841=this[_0x0dc1('0x22')](_0x263f4a);}if(_0x358841){_0x593349[_0x0dc1('0x24')]=_[_0x0dc1('0x1e')](_0x358841[_0x0dc1('0x24')])?util[_0x0dc1('0x25')]('SIP/%s',_0x358841[_0x0dc1('0x20')]):_0x358841[_0x0dc1('0x24')];_0x593349[_0x0dc1('0x44')]=_0x358841[_0x0dc1('0x20')];_0x593349[_0x0dc1('0x1d')]=_0x358841[_0x0dc1('0x1d')];RpcMemberReport['voiceDialReport'](_0x593349);}};Report[_0x0dc1('0x2b')][_0x0dc1('0x19')]=function(_0x37c26f){RpcVoiceTransferReport[_0x0dc1('0x3e')][_0x37c26f[_0x0dc1('0x55')]]=_0x37c26f;};Report['prototype'][_0x0dc1('0x1b')]=function(_0x46d339){RpcVoiceTransferReport[_0x0dc1('0x1b')](_0x46d339);};module[_0x0dc1('0x56')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index b79d213..5c9fb8d 100644 --- a/server/services/ami/report/userReport.js +++ b/server/services/ami/report/userReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1a1b=['defaults','redis','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','bind','syncRegistry','devicestatechange','syncDeviceState','syncRealtimeShow','resolve','actionSipShowRegistry','catch','error','[userReport][sipshowregistry]','inspect','then','actionDeviceStateList','[userReport][devicestatelist]','actionSipPeerStatus','prototype','isNotNull','isUndefined','emit','[userReport][registry]\x20registry:%s\x20state:%s','username','debug','[userReport][registry]','find','stateRegistry','merge','omit','event','state','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:%s','name','trunk:save','info','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','local','inuse','toLowerCase','stateTime','toNumber','updateStatusRealtime','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','Local','indexOf','mobile','phone','accountcode','syncPeerStatus','peerstatus','peer','address','[userReport][peerstatus]','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','telephone:save','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','lodash','ioredis','bluebird','../../../config/environment','../../../config/logger','ami','../ami'];(function(_0x1c4c24,_0x154c79){var _0x1c033d=function(_0x155415){while(--_0x155415){_0x1c4c24['push'](_0x1c4c24['shift']());}};_0x1c033d(++_0x154c79);}(_0x1a1b,0x1c1));var _0xb1a1=function(_0x401936,_0x4acf75){_0x401936=_0x401936-0x0;var _0x350b85=_0x1a1b[_0x401936];return _0x350b85;};'use strict';var _=require(_0xb1a1('0x0'));var moment=require('moment');var util=require('util');var Redis=require(_0xb1a1('0x1'));var BPromise=require(_0xb1a1('0x2'));var config=require(_0xb1a1('0x3'));var logger=require(_0xb1a1('0x4'))(_0xb1a1('0x5'));var ami=require(_0xb1a1('0x6'));config['redis']=_[_0xb1a1('0x7')](config[_0xb1a1('0x8')],{'host':_0xb1a1('0x9'),'port':0x18eb});var io=require(_0xb1a1('0xa'))(new Redis(config[_0xb1a1('0x8')]));function UserReport(_0x3e37eb){this[_0xb1a1('0xb')]=_0x3e37eb[_0xb1a1('0xb')];this['agents']=_0x3e37eb[_0xb1a1('0xc')];this[_0xb1a1('0xd')]=_0x3e37eb[_0xb1a1('0xd')];ami['on'](_0xb1a1('0xe'),this['syncRegistry'][_0xb1a1('0xf')](this));ami['on']('registry',this[_0xb1a1('0x10')]['bind'](this));ami['on'](_0xb1a1('0x11'),this[_0xb1a1('0x12')][_0xb1a1('0xf')](this));ami['on']('peerstatus',this['syncPeerStatus'][_0xb1a1('0xf')](this));return this[_0xb1a1('0x13')]();}function showSipRegistrations(){Promise[_0xb1a1('0x14')]()['then'](ami[_0xb1a1('0x15')]())[_0xb1a1('0x16')](function(_0x29be97){logger[_0xb1a1('0x17')](_0xb1a1('0x18'),util[_0xb1a1('0x19')](_0x29be97,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise['resolve']()[_0xb1a1('0x1a')](ami[_0xb1a1('0x1b')]())[_0xb1a1('0x16')](function(_0x23ac29){logger[_0xb1a1('0x17')](_0xb1a1('0x1c'),util[_0xb1a1('0x19')](_0x23ac29,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0xb1a1('0x14')]()[_0xb1a1('0x1a')](ami[_0xb1a1('0x1d')]())['catch'](function(_0x55c968){logger[_0xb1a1('0x17')]('[userReport][sippeerstatus]',util[_0xb1a1('0x19')](_0x55c968,{'showHidden':![],'depth':null}));});}UserReport[_0xb1a1('0x1e')][_0xb1a1('0x13')]=function(){setInterval(function(){BPromise['resolve']()[_0xb1a1('0x1a')](showSipRegistrations())[_0xb1a1('0x1a')](listDeviceStates())[_0xb1a1('0x1a')](showPeersStatus());},0x32c8);};UserReport[_0xb1a1('0x1e')][_0xb1a1('0x1f')]=function(_0x224b6d){return _0x224b6d!==null&&!_[_0xb1a1('0x20')](_0x224b6d);};UserReport[_0xb1a1('0x1e')][_0xb1a1('0x21')]=function(_0x2fbbaa,_0x396ce4,_0x1020fe){io['to'](_0x2fbbaa)['emit'](_0x396ce4,_0x1020fe);};UserReport[_0xb1a1('0x1e')][_0xb1a1('0x10')]=function(_0x562ff1){try{if(this[_0xb1a1('0x1f')](_0x562ff1)){logger['info'](_0xb1a1('0x22'),_0x562ff1[_0xb1a1('0x23')],_0x562ff1['state']);logger[_0xb1a1('0x24')](_0xb1a1('0x25'),util[_0xb1a1('0x19')](_0x562ff1,{'showHidden':![],'depth':null}));var _0x578169=_[_0xb1a1('0x26')](this[_0xb1a1('0xb')],{'defaultuser':_0x562ff1[_0xb1a1('0x23')]});if(_0x578169){_0x562ff1[_0xb1a1('0x27')]=_0x562ff1['state'];_[_0xb1a1('0x28')](_0x578169,_[_0xb1a1('0x29')](_0x562ff1,[_0xb1a1('0x2a'),'actionid',_0xb1a1('0x23'),_0xb1a1('0x2b')]));logger[_0xb1a1('0x24')](_0xb1a1('0x2c'),util[_0xb1a1('0x19')](_0x578169,{'showHidden':![],'depth':null}));this[_0xb1a1('0x21')](util[_0xb1a1('0x2d')](_0xb1a1('0x2e'),_0x578169[_0xb1a1('0x2f')]),_0xb1a1('0x30'),_0x578169);}}}catch(_0x1070a8){logger[_0xb1a1('0x17')](_0xb1a1('0x25'),util[_0xb1a1('0x19')](_0x1070a8,{'showHidden':![],'depth':null}));}};UserReport[_0xb1a1('0x1e')][_0xb1a1('0x12')]=function(_0x26046e){try{if(this[_0xb1a1('0x1f')](_0x26046e)){logger[_0xb1a1('0x31')](_0xb1a1('0x32'),_0x26046e[_0xb1a1('0x33')],_0x26046e[_0xb1a1('0x2b')]);logger[_0xb1a1('0x24')]('[userReport][devicestatechange]',util['inspect'](_0x26046e,{'showHidden':![],'depth':null}));if(this['agents'][_0x26046e[_0xb1a1('0x33')]]){if(!this[_0xb1a1('0xc')][_0x26046e[_0xb1a1('0x33')]][_0xb1a1('0x34')]||_0x26046e[_0xb1a1('0x2b')]['toLowerCase']()==_0xb1a1('0x35')){this[_0xb1a1('0xc')][_0x26046e[_0xb1a1('0x33')]]['local']=![];if(this[_0xb1a1('0xc')][_0x26046e[_0xb1a1('0x33')]][_0xb1a1('0x2b')]!==_0x26046e['state'][_0xb1a1('0x36')]()){this[_0xb1a1('0xc')][_0x26046e['device']][_0xb1a1('0x37')]=_[_0xb1a1('0x38')](moment()[_0xb1a1('0x2d')]('x'));}this[_0xb1a1('0xc')][_0x26046e[_0xb1a1('0x33')]]['state']=_0x26046e[_0xb1a1('0x2b')][_0xb1a1('0x36')]();this[_0xb1a1('0xc')][_0x26046e[_0xb1a1('0x33')]][_0xb1a1('0x39')](_0x26046e);}}else if(this[_0xb1a1('0xd')][_0x26046e[_0xb1a1('0x33')]]){if(this[_0xb1a1('0xd')][_0x26046e['device']]['state']!==_0x26046e[_0xb1a1('0x2b')][_0xb1a1('0x36')]()){this['telephones'][_0x26046e[_0xb1a1('0x33')]][_0xb1a1('0x37')]=_[_0xb1a1('0x38')](moment()['format']('x'));}this[_0xb1a1('0xd')][_0x26046e[_0xb1a1('0x33')]][_0xb1a1('0x2b')]=_0x26046e[_0xb1a1('0x2b')]['toLowerCase']();logger[_0xb1a1('0x24')](_0xb1a1('0x3a'),util['inspect'](this[_0xb1a1('0xd')][_0x26046e[_0xb1a1('0x33')]],{'showHidden':![],'depth':null}));this['emit'](util[_0xb1a1('0x2d')](_0xb1a1('0x3b'),this[_0xb1a1('0xd')][_0x26046e['device']]['name']),'telephone:save',this[_0xb1a1('0xd')][_0x26046e['device']]);}else if(this['trunks'][_0x26046e[_0xb1a1('0x33')]]){if(this['trunks'][_0x26046e[_0xb1a1('0x33')]][_0xb1a1('0x2b')]!==_0x26046e[_0xb1a1('0x2b')][_0xb1a1('0x36')]()){this[_0xb1a1('0xb')][_0x26046e[_0xb1a1('0x33')]][_0xb1a1('0x37')]=_[_0xb1a1('0x38')](moment()['format']('x'));}this[_0xb1a1('0xb')][_0x26046e[_0xb1a1('0x33')]]['state']=_0x26046e[_0xb1a1('0x2b')]['toLowerCase']();logger['debug'](_0xb1a1('0x3c'),util[_0xb1a1('0x19')](this[_0xb1a1('0xb')][_0x26046e['device']],{'showHidden':![],'depth':null}));this['emit'](util[_0xb1a1('0x2d')](_0xb1a1('0x2e'),this[_0xb1a1('0xb')][_0x26046e[_0xb1a1('0x33')]][_0xb1a1('0x2f')]),'trunk:save',this[_0xb1a1('0xb')][_0x26046e['device']]);}else if(_['startsWith'](_0x26046e['device'],_0xb1a1('0x3d'))){var _0x554e51=_0x26046e[_0xb1a1('0x33')];var _0x3fae03=_0x554e51['substring'](_0x554e51[_0xb1a1('0x3e')]('/')+0x1,_0x554e51['indexOf']('@'));var _0x1836cf=_[_0xb1a1('0x26')](this['agents'],function(_0x118fbb){return _0x118fbb[_0xb1a1('0x3f')]==_0x3fae03||_0x118fbb[_0xb1a1('0x40')]==_0x3fae03||_0x118fbb[_0xb1a1('0x41')]==_0x3fae03;});if(_0x1836cf){if(_0x1836cf[_0xb1a1('0x2b')]!==_0x26046e[_0xb1a1('0x2b')][_0xb1a1('0x36')]()){_0x1836cf['stateTime']=_[_0xb1a1('0x38')](moment()[_0xb1a1('0x2d')]('x'));}_0x1836cf[_0xb1a1('0x2b')]=_0x26046e['state'][_0xb1a1('0x36')]();_0x1836cf['local']=!![];_0x1836cf[_0xb1a1('0x39')](_0x26046e);}}}}catch(_0x12ad34){logger[_0xb1a1('0x17')]('[userReport][devicestatechange]',util['inspect'](_0x12ad34,{'showHidden':![],'depth':null}));}};UserReport[_0xb1a1('0x1e')][_0xb1a1('0x42')]=function(_0x3ba354){try{if(this['isNotNull'](_0x3ba354)&&this[_0xb1a1('0x1f')](_0x3ba354[_0xb1a1('0x43')])){logger[_0xb1a1('0x31')]('[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s',_0x3ba354[_0xb1a1('0x44')],_0x3ba354[_0xb1a1('0x45')],_0x3ba354[_0xb1a1('0x43')]);logger[_0xb1a1('0x24')](_0xb1a1('0x46'),util['inspect'](_0x3ba354,{'showHidden':![],'depth':null}));if(this['agents'][_0x3ba354[_0xb1a1('0x44')]]){if(!this[_0xb1a1('0xc')][_0x3ba354['peer']]['local']||_0x3ba354[_0xb1a1('0x43')][_0xb1a1('0x36')]()=='registered'){this['agents'][_0x3ba354[_0xb1a1('0x44')]]['local']=![];this[_0xb1a1('0xc')][_0x3ba354[_0xb1a1('0x44')]][_0xb1a1('0x47')]=_0x3ba354['peerstatus'][_0xb1a1('0x36')]();this[_0xb1a1('0xc')][_0x3ba354[_0xb1a1('0x44')]][_0xb1a1('0x45')]=_0x3ba354[_0xb1a1('0x45')];this[_0xb1a1('0xc')][_0x3ba354['peer']][_0xb1a1('0x39')](_0x3ba354);}}else if(this['telephones'][_0x3ba354[_0xb1a1('0x44')]]){this['telephones'][_0x3ba354['peer']][_0xb1a1('0x47')]=_0x3ba354[_0xb1a1('0x43')][_0xb1a1('0x36')]();this[_0xb1a1('0xd')][_0x3ba354['peer']][_0xb1a1('0x45')]=_0x3ba354[_0xb1a1('0x45')];logger[_0xb1a1('0x24')](_0xb1a1('0x48'),util['inspect'](this[_0xb1a1('0xd')][_0x3ba354[_0xb1a1('0x44')]],{'showHidden':![],'depth':null}));this[_0xb1a1('0x21')](util['format'](_0xb1a1('0x3b'),this[_0xb1a1('0xd')][_0x3ba354[_0xb1a1('0x44')]][_0xb1a1('0x2f')]),_0xb1a1('0x49'),this[_0xb1a1('0xd')][_0x3ba354[_0xb1a1('0x44')]]);}else if(this[_0xb1a1('0xb')][_0x3ba354[_0xb1a1('0x44')]]){this[_0xb1a1('0xb')][_0x3ba354[_0xb1a1('0x44')]]['status']=_0x3ba354[_0xb1a1('0x43')][_0xb1a1('0x36')]();this['trunks'][_0x3ba354[_0xb1a1('0x44')]][_0xb1a1('0x45')]=_0x3ba354[_0xb1a1('0x45')];logger[_0xb1a1('0x24')](_0xb1a1('0x4a'),util['inspect'](this[_0xb1a1('0xb')][_0x3ba354[_0xb1a1('0x44')]],{'showHidden':![],'depth':null}));this[_0xb1a1('0x21')](util[_0xb1a1('0x2d')](_0xb1a1('0x2e'),this['trunks'][_0x3ba354[_0xb1a1('0x44')]][_0xb1a1('0x2f')]),_0xb1a1('0x30'),this[_0xb1a1('0xb')][_0x3ba354[_0xb1a1('0x44')]]);}}}catch(_0x24dc37){logger[_0xb1a1('0x17')](_0xb1a1('0x46'),util[_0xb1a1('0x19')](_0x24dc37,{'showHidden':![],'depth':null}));}};module[_0xb1a1('0x4b')]=UserReport; \ No newline at end of file +var _0xfc96=['prototype','isNotNull','isUndefined','emit','username','debug','find','stateRegistry','state','merge','omit','format','trunk:%s','name','[userReport][registry]','info','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','local','toLowerCase','inuse','toNumber','stateTime','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','telephone:save','trunk:save','startsWith','Local','substring','indexOf','mobile','phone','peerstatus','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','[userReport][peerstatus]','registered','status','address','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','lodash','moment','util','bluebird','ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','registry','devicestatechange','syncDeviceState','syncPeerStatus','syncRealtimeShow','resolve','catch','[userReport][sipshowregistry]','inspect','error','[userReport][devicestatelist]','then','actionSipPeerStatus','[userReport][sippeerstatus]'];(function(_0x9fd42f,_0x57080f){var _0x11f7b6=function(_0xaacd91){while(--_0xaacd91){_0x9fd42f['push'](_0x9fd42f['shift']());}};_0x11f7b6(++_0x57080f);}(_0xfc96,0xbe));var _0x6fc9=function(_0x4f29ce,_0x4f6939){_0x4f29ce=_0x4f29ce-0x0;var _0x3b14c0=_0xfc96[_0x4f29ce];return _0x3b14c0;};'use strict';var _=require(_0x6fc9('0x0'));var moment=require(_0x6fc9('0x1'));var util=require(_0x6fc9('0x2'));var Redis=require('ioredis');var BPromise=require(_0x6fc9('0x3'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x6fc9('0x4'));var ami=require('../ami');config[_0x6fc9('0x5')]=_[_0x6fc9('0x6')](config[_0x6fc9('0x5')],{'host':_0x6fc9('0x7'),'port':0x18eb});var io=require(_0x6fc9('0x8'))(new Redis(config['redis']));function UserReport(_0x23d8b8){this[_0x6fc9('0x9')]=_0x23d8b8[_0x6fc9('0x9')];this[_0x6fc9('0xa')]=_0x23d8b8[_0x6fc9('0xa')];this[_0x6fc9('0xb')]=_0x23d8b8[_0x6fc9('0xb')];ami['on'](_0x6fc9('0xc'),this[_0x6fc9('0xd')][_0x6fc9('0xe')](this));ami['on'](_0x6fc9('0xf'),this[_0x6fc9('0xd')][_0x6fc9('0xe')](this));ami['on'](_0x6fc9('0x10'),this[_0x6fc9('0x11')][_0x6fc9('0xe')](this));ami['on']('peerstatus',this[_0x6fc9('0x12')]['bind'](this));return this[_0x6fc9('0x13')]();}function showSipRegistrations(){Promise[_0x6fc9('0x14')]()['then'](ami['actionSipShowRegistry']())[_0x6fc9('0x15')](function(_0x39f47d){logger['error'](_0x6fc9('0x16'),util[_0x6fc9('0x17')](_0x39f47d,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x6fc9('0x14')]()['then'](ami['actionDeviceStateList']())[_0x6fc9('0x15')](function(_0x3ba517){logger[_0x6fc9('0x18')](_0x6fc9('0x19'),util[_0x6fc9('0x17')](_0x3ba517,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x6fc9('0x14')]()[_0x6fc9('0x1a')](ami[_0x6fc9('0x1b')]())['catch'](function(_0x20f4a1){logger[_0x6fc9('0x18')](_0x6fc9('0x1c'),util[_0x6fc9('0x17')](_0x20f4a1,{'showHidden':![],'depth':null}));});}UserReport[_0x6fc9('0x1d')][_0x6fc9('0x13')]=function(){setInterval(function(){BPromise[_0x6fc9('0x14')]()[_0x6fc9('0x1a')](showSipRegistrations())[_0x6fc9('0x1a')](listDeviceStates())[_0x6fc9('0x1a')](showPeersStatus());},0x32c8);};UserReport[_0x6fc9('0x1d')][_0x6fc9('0x1e')]=function(_0x241364){return _0x241364!==null&&!_[_0x6fc9('0x1f')](_0x241364);};UserReport[_0x6fc9('0x1d')]['emit']=function(_0x4bf1eb,_0x1b689c,_0x335bc3){io['to'](_0x4bf1eb)[_0x6fc9('0x20')](_0x1b689c,_0x335bc3);};UserReport[_0x6fc9('0x1d')]['syncRegistry']=function(_0x57b781){try{if(this['isNotNull'](_0x57b781)){logger['info']('[userReport][registry]\x20registry:%s\x20state:%s',_0x57b781[_0x6fc9('0x21')],_0x57b781['state']);logger[_0x6fc9('0x22')]('[userReport][registry]',util[_0x6fc9('0x17')](_0x57b781,{'showHidden':![],'depth':null}));var _0x52b7f7=_[_0x6fc9('0x23')](this[_0x6fc9('0x9')],{'defaultuser':_0x57b781[_0x6fc9('0x21')]});if(_0x52b7f7){_0x57b781[_0x6fc9('0x24')]=_0x57b781[_0x6fc9('0x25')];_[_0x6fc9('0x26')](_0x52b7f7,_[_0x6fc9('0x27')](_0x57b781,['event','actionid',_0x6fc9('0x21'),_0x6fc9('0x25')]));logger['debug']('[userReport][registry]\x20sending\x20trunk:save\x20event:',util[_0x6fc9('0x17')](_0x52b7f7,{'showHidden':![],'depth':null}));this[_0x6fc9('0x20')](util[_0x6fc9('0x28')](_0x6fc9('0x29'),_0x52b7f7[_0x6fc9('0x2a')]),'trunk:save',_0x52b7f7);}}}catch(_0x10b49e){logger[_0x6fc9('0x18')](_0x6fc9('0x2b'),util[_0x6fc9('0x17')](_0x10b49e,{'showHidden':![],'depth':null}));}};UserReport[_0x6fc9('0x1d')][_0x6fc9('0x11')]=function(_0x209139){try{if(this[_0x6fc9('0x1e')](_0x209139)){logger[_0x6fc9('0x2c')](_0x6fc9('0x2d'),_0x209139[_0x6fc9('0x2e')],_0x209139['state']);logger['debug'](_0x6fc9('0x2f'),util['inspect'](_0x209139,{'showHidden':![],'depth':null}));if(this[_0x6fc9('0xa')][_0x209139[_0x6fc9('0x2e')]]){if(!this[_0x6fc9('0xa')][_0x209139[_0x6fc9('0x2e')]][_0x6fc9('0x30')]||_0x209139[_0x6fc9('0x25')][_0x6fc9('0x31')]()==_0x6fc9('0x32')){this[_0x6fc9('0xa')][_0x209139['device']][_0x6fc9('0x30')]=![];if(this[_0x6fc9('0xa')][_0x209139[_0x6fc9('0x2e')]]['state']!==_0x209139[_0x6fc9('0x25')][_0x6fc9('0x31')]()){this['agents'][_0x209139[_0x6fc9('0x2e')]]['stateTime']=_[_0x6fc9('0x33')](moment()[_0x6fc9('0x28')]('x'));}this['agents'][_0x209139[_0x6fc9('0x2e')]][_0x6fc9('0x25')]=_0x209139[_0x6fc9('0x25')]['toLowerCase']();this[_0x6fc9('0xa')][_0x209139[_0x6fc9('0x2e')]]['updateStatusRealtime'](_0x209139);}}else if(this['telephones'][_0x209139['device']]){if(this['telephones'][_0x209139[_0x6fc9('0x2e')]][_0x6fc9('0x25')]!==_0x209139[_0x6fc9('0x25')][_0x6fc9('0x31')]()){this['telephones'][_0x209139[_0x6fc9('0x2e')]][_0x6fc9('0x34')]=_[_0x6fc9('0x33')](moment()[_0x6fc9('0x28')]('x'));}this[_0x6fc9('0xb')][_0x209139['device']][_0x6fc9('0x25')]=_0x209139[_0x6fc9('0x25')]['toLowerCase']();logger['debug'](_0x6fc9('0x35'),util['inspect'](this[_0x6fc9('0xb')][_0x209139[_0x6fc9('0x2e')]],{'showHidden':![],'depth':null}));this[_0x6fc9('0x20')](util[_0x6fc9('0x28')](_0x6fc9('0x36'),this[_0x6fc9('0xb')][_0x209139[_0x6fc9('0x2e')]][_0x6fc9('0x2a')]),_0x6fc9('0x37'),this[_0x6fc9('0xb')][_0x209139[_0x6fc9('0x2e')]]);}else if(this[_0x6fc9('0x9')][_0x209139[_0x6fc9('0x2e')]]){if(this['trunks'][_0x209139[_0x6fc9('0x2e')]]['state']!==_0x209139[_0x6fc9('0x25')][_0x6fc9('0x31')]()){this['trunks'][_0x209139[_0x6fc9('0x2e')]][_0x6fc9('0x34')]=_[_0x6fc9('0x33')](moment()['format']('x'));}this[_0x6fc9('0x9')][_0x209139['device']]['state']=_0x209139['state'][_0x6fc9('0x31')]();logger['debug']('[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:',util['inspect'](this[_0x6fc9('0x9')][_0x209139[_0x6fc9('0x2e')]],{'showHidden':![],'depth':null}));this[_0x6fc9('0x20')](util[_0x6fc9('0x28')]('trunk:%s',this[_0x6fc9('0x9')][_0x209139[_0x6fc9('0x2e')]][_0x6fc9('0x2a')]),_0x6fc9('0x38'),this['trunks'][_0x209139['device']]);}else if(_[_0x6fc9('0x39')](_0x209139[_0x6fc9('0x2e')],_0x6fc9('0x3a'))){var _0x57bf58=_0x209139['device'];var _0x2ae56d=_0x57bf58[_0x6fc9('0x3b')](_0x57bf58[_0x6fc9('0x3c')]('/')+0x1,_0x57bf58[_0x6fc9('0x3c')]('@'));var _0x4e415f=_[_0x6fc9('0x23')](this[_0x6fc9('0xa')],function(_0x3d4ea6){return _0x3d4ea6[_0x6fc9('0x3d')]==_0x2ae56d||_0x3d4ea6[_0x6fc9('0x3e')]==_0x2ae56d||_0x3d4ea6['accountcode']==_0x2ae56d;});if(_0x4e415f){if(_0x4e415f['state']!==_0x209139[_0x6fc9('0x25')][_0x6fc9('0x31')]()){_0x4e415f[_0x6fc9('0x34')]=_[_0x6fc9('0x33')](moment()['format']('x'));}_0x4e415f[_0x6fc9('0x25')]=_0x209139[_0x6fc9('0x25')][_0x6fc9('0x31')]();_0x4e415f[_0x6fc9('0x30')]=!![];_0x4e415f['updateStatusRealtime'](_0x209139);}}}}catch(_0xada2aa){logger[_0x6fc9('0x18')](_0x6fc9('0x2f'),util['inspect'](_0xada2aa,{'showHidden':![],'depth':null}));}};UserReport[_0x6fc9('0x1d')]['syncPeerStatus']=function(_0x20418f){try{if(this[_0x6fc9('0x1e')](_0x20418f)&&this['isNotNull'](_0x20418f[_0x6fc9('0x3f')])){logger[_0x6fc9('0x2c')](_0x6fc9('0x40'),_0x20418f[_0x6fc9('0x41')],_0x20418f['address'],_0x20418f[_0x6fc9('0x3f')]);logger[_0x6fc9('0x22')](_0x6fc9('0x42'),util[_0x6fc9('0x17')](_0x20418f,{'showHidden':![],'depth':null}));if(this['agents'][_0x20418f['peer']]){if(!this[_0x6fc9('0xa')][_0x20418f[_0x6fc9('0x41')]][_0x6fc9('0x30')]||_0x20418f['peerstatus'][_0x6fc9('0x31')]()==_0x6fc9('0x43')){this['agents'][_0x20418f[_0x6fc9('0x41')]][_0x6fc9('0x30')]=![];this['agents'][_0x20418f[_0x6fc9('0x41')]][_0x6fc9('0x44')]=_0x20418f['peerstatus'][_0x6fc9('0x31')]();this[_0x6fc9('0xa')][_0x20418f['peer']]['address']=_0x20418f['address'];this[_0x6fc9('0xa')][_0x20418f['peer']]['updateStatusRealtime'](_0x20418f);}}else if(this[_0x6fc9('0xb')][_0x20418f[_0x6fc9('0x41')]]){this[_0x6fc9('0xb')][_0x20418f[_0x6fc9('0x41')]][_0x6fc9('0x44')]=_0x20418f[_0x6fc9('0x3f')]['toLowerCase']();this[_0x6fc9('0xb')][_0x20418f[_0x6fc9('0x41')]][_0x6fc9('0x45')]=_0x20418f[_0x6fc9('0x45')];logger[_0x6fc9('0x22')](_0x6fc9('0x46'),util['inspect'](this[_0x6fc9('0xb')][_0x20418f[_0x6fc9('0x41')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x6fc9('0x28')]('telephone:%s',this[_0x6fc9('0xb')][_0x20418f[_0x6fc9('0x41')]][_0x6fc9('0x2a')]),_0x6fc9('0x37'),this['telephones'][_0x20418f[_0x6fc9('0x41')]]);}else if(this[_0x6fc9('0x9')][_0x20418f[_0x6fc9('0x41')]]){this[_0x6fc9('0x9')][_0x20418f[_0x6fc9('0x41')]][_0x6fc9('0x44')]=_0x20418f[_0x6fc9('0x3f')][_0x6fc9('0x31')]();this[_0x6fc9('0x9')][_0x20418f['peer']]['address']=_0x20418f[_0x6fc9('0x45')];logger['debug'](_0x6fc9('0x47'),util[_0x6fc9('0x17')](this[_0x6fc9('0x9')][_0x20418f[_0x6fc9('0x41')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x6fc9('0x28')]('trunk:%s',this[_0x6fc9('0x9')][_0x20418f[_0x6fc9('0x41')]][_0x6fc9('0x2a')]),_0x6fc9('0x38'),this['trunks'][_0x20418f['peer']]);}}}catch(_0x449c5a){logger['error'](_0x6fc9('0x42'),util[_0x6fc9('0x17')](_0x449c5a,{'showHidden':![],'depth':null}));}};module[_0x6fc9('0x48')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index 7953462..18ca498 100644 --- a/server/services/ami/report/voiceAgentReport.js +++ b/server/services/ami/report/voiceAgentReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['musiconholdstop','attendedtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','info','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','uniqueid','YYYY-MM-DD\x20HH:mm:ss','queue','mandatoryDisposition','type','inbound','voice','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','interface','calleridnum','extravar','format','user:%s','error','[%s][voiceAgentReport][agentcalled]','syncAgentConnect','[%s][voiceAgentReport][agentconnect]\x20event:','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','connect','voiceChannels','routealias','merge','pick','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','user:agentconnect','agentringnoanswer','agentringnoanswerAt','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','lastevent','rejected','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','hasOwnProperty','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20event:','agentcompleteAt','complete','agent','talktime','acw','acwtime','acwTimeout','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','destaccountcode','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','transfer','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','syncAttendedTransfer','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','syncMusicOnHoldStop','lastIndexOf','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','exports','lodash','moment','util','../../../config/logger','../ami','redis','defaults','localhost','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','syncMusicOnHoldStart'];(function(_0x29b90d,_0x1f5a49){var _0x38ef15=function(_0x46c617){while(--_0x46c617){_0x29b90d['push'](_0x29b90d['shift']());}};_0x38ef15(++_0x1f5a49);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'use strict';var _=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x0a9e('0x3'))('ami');var ami=require(_0x0a9e('0x4'));config[_0x0a9e('0x5')]=_[_0x0a9e('0x6')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x5')]));function VoiceAgentReport(_0x441e3a){this[_0x0a9e('0x8')]={};this['voiceChannels']=_0x441e3a['channels'];this[_0x0a9e('0x9')]=_0x441e3a['voiceQueues'];this['agents']=_0x441e3a[_0x0a9e('0xa')];this[_0x0a9e('0xb')]={};ami['on'](_0x0a9e('0xc'),this[_0x0a9e('0xd')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0xf'),this['syncAgentConnect']['bind'](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x10'),this[_0x0a9e('0x11')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x12'),this[_0x0a9e('0x13')]['bind'](this));ami['on'](_0x0a9e('0x14'),this[_0x0a9e('0x15')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0xe')](this));ami['on']('musiconholdstart',this[_0x0a9e('0x18')]['bind'](this));ami['on'](_0x0a9e('0x19'),this['syncMusicOnHoldStop'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x1a'),this['syncAttendedTransfer'][_0x0a9e('0xe')](this));ami['on']('blindtransfer',this[_0x0a9e('0x1b')][_0x0a9e('0xe')](this));}VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1d')]=function(_0x31b1ca,_0x2eb11f,_0x530eb7){io['to'](_0x31b1ca)[_0x0a9e('0x1d')](_0x2eb11f,_0x530eb7);};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1e')]=function(_0x1c696a){return _0x1c696a!==null&&!_[_0x0a9e('0x1f')](_0x1c696a);};VoiceAgentReport['prototype'][_0x0a9e('0xd')]=function(_0x155cce){try{if(this['isNotNull'](_0x155cce)){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x155cce['uniqueid'],_0x155cce[_0x0a9e('0x21')],_0x155cce[_0x0a9e('0x22')]);logger[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x155cce,{'showHidden':![],'depth':null}));if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]]={};}if(_[_0x0a9e('0x1f')](this['channels'][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]={'agentcalledAt':moment()['format'](_0x0a9e('0x27')),'lastevent':'called','mandatoryDisposition':this[_0x0a9e('0x9')][_0x155cce['queue']]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x29')]||![]:![],'type':this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x2a')]||'inbound':_0x0a9e('0x2b'),'variables':this[_0x0a9e('0xb')][_0x155cce[_0x0a9e('0x26')]],'motionChannel':_0x0a9e('0x2c')};}_['merge'](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],_[_0x0a9e('0x2d')](_0x155cce,[_0x0a9e('0x2e'),_0x0a9e('0x2f')]));logger[_0x0a9e('0x23')](_0x0a9e('0x30'),_0x155cce[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x31'),this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce['destuniqueid']]);var _0x66c1d2={'id':this[_0x0a9e('0xa')][_0x155cce[_0x0a9e('0x32')]]['id'],'calleridnum':this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0x33')],'queue':this[_0x0a9e('0x8')][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]]['queue'],'extravar':this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0xb')]?this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0xb')][_0x0a9e('0x34')]:undefined};logger['debug']('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:',_0x155cce[_0x0a9e('0x26')],util['inspect'](_0x66c1d2,{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')](_0x0a9e('0x36'),_0x155cce[_0x0a9e('0x21')]),'user:called',_0x66c1d2);}}catch(_0x31916f){logger[_0x0a9e('0x37')](_0x0a9e('0x38'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x31916f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x39')]=function(_0x4c1c0e){try{if(this['isNotNull'](_0x4c1c0e)){if(this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]]){logger['debug'](_0x0a9e('0x3a'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4c1c0e,{'showHidden':![],'depth':null}));for(var _0x148f55 in this['channels'][_0x4c1c0e['uniqueid']]){if(this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]]['hasOwnProperty'](_0x148f55)){if(_0x4c1c0e[_0x0a9e('0x22')]===_0x148f55){logger[_0x0a9e('0x20')](_0x0a9e('0x3b'),_0x4c1c0e['uniqueid'],_0x4c1c0e[_0x0a9e('0x21')],_0x4c1c0e[_0x0a9e('0x22')]);this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3c')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3d')]=_0x4c1c0e[_0x0a9e('0x3d')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3e')]=_0x4c1c0e[_0x0a9e('0x3e')];this['channels'][_0x4c1c0e['uniqueid']][_0x148f55][_0x0a9e('0x3f')]=_0x4c1c0e[_0x0a9e('0x3f')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x40')]=_0x4c1c0e[_0x0a9e('0x40')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x41')]=_0x4c1c0e[_0x0a9e('0x41')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['lastevent']=_0x0a9e('0x42');if(this[_0x0a9e('0x43')][this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x26')]]){var _0xbe9d19=this[_0x0a9e('0x43')][this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x148f55][_0x0a9e('0x26')]]['routealias'];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x44')]=_0xbe9d19;_0x4c1c0e['routealias']=_0xbe9d19;}_[_0x0a9e('0x45')](this[_0x0a9e('0xa')][_0x4c1c0e[_0x0a9e('0x32')]],_[_0x0a9e('0x46')](_0x4c1c0e,[_0x0a9e('0x28'),_0x0a9e('0x47'),_0x0a9e('0x44')]));logger['debug'](_0x0a9e('0x48'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x4c1c0e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x49'),this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x4c1c0e[_0x0a9e('0x22')]]);logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:',_0x4c1c0e['uniqueid'],util['inspect'](this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x4c1c0e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')](_0x0a9e('0x36'),_0x4c1c0e[_0x0a9e('0x21')]),_0x0a9e('0x4a'),this['channels'][_0x4c1c0e['uniqueid']][_0x4c1c0e['destuniqueid']]);}else if(!this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4b')]&&!this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere',_0x4c1c0e[_0x0a9e('0x26')],this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['membername'],_0x148f55);this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4b')]=!![];this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['answeredelsewheredestinationuniqueid']=_0x4c1c0e[_0x0a9e('0x22')];this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['answeredelsewheremembername']=_0x4c1c0e[_0x0a9e('0x21')];this['channels'][_0x4c1c0e['uniqueid']][_0x148f55]['lastevent']=_0x0a9e('0x4d');this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4e')]=_0x0a9e('0x4d');logger[_0x0a9e('0x23')](_0x0a9e('0x4f'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x148f55],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x50'),this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]);}}}}}}catch(_0xb83dfd){logger[_0x0a9e('0x37')]('[%s][voiceAgentReport][agentconnect]',_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xb83dfd,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x51')]=function(_0x5cc8fb){try{if(this[_0x0a9e('0x1e')](_0x5cc8fb)){logger['debug']('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x5cc8fb['uniqueid'],util[_0x0a9e('0x25')](_0x5cc8fb,{'showHidden':![],'depth':null}));if(this['channels'][_0x5cc8fb[_0x0a9e('0x26')]]&&this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]){logger[_0x0a9e('0x20')](_0x0a9e('0x52'),_0x5cc8fb['uniqueid'],_0x5cc8fb[_0x0a9e('0x21')],_0x5cc8fb['destuniqueid']);this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]][_0x0a9e('0x4c')]=moment()['format'](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x5cc8fb['uniqueid']][_0x5cc8fb[_0x0a9e('0x22')]][_0x0a9e('0x53')]=_0x0a9e('0x54');this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb['destuniqueid']][_0x0a9e('0x4e')]=_0x0a9e('0x54');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:',_0x5cc8fb[_0x0a9e('0x26')],util['inspect'](this['channels'][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x55'),this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]);}}}catch(_0x54a37d){logger[_0x0a9e('0x37')](_0x0a9e('0x56'),_0x5cc8fb[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x54a37d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x11')]=function(_0x320898){try{if(this[_0x0a9e('0x1e')](_0x320898)){logger[_0x0a9e('0x23')](_0x0a9e('0x57'),_0x320898['uniqueid'],util[_0x0a9e('0x25')](_0x320898,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]]){for(var _0x4edbb0 in this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]]){if(this['channels'][_0x320898[_0x0a9e('0x26')]][_0x0a9e('0x58')](_0x4edbb0)&&!this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4b')]&&!this['channels'][_0x320898['uniqueid']][_0x4edbb0]['agentcomplete']){logger[_0x0a9e('0x20')](_0x0a9e('0x59'),_0x320898[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x21')],_0x4edbb0);this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4c')]=moment()['format'](_0x0a9e('0x27'));this['channels'][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x53')]='abandoned';this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4e')]=_0x0a9e('0x5a');logger['debug'](_0x0a9e('0x5b'),_0x320898[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x320898['uniqueid']][_0x4edbb0],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x5c'),this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0]);}}}}}catch(_0x4abc8f){logger[_0x0a9e('0x37')](_0x0a9e('0x5d'),_0x320898[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4abc8f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x13')]=function(_0x40fc56){try{if(this[_0x0a9e('0x1e')](_0x40fc56)){logger[_0x0a9e('0x23')](_0x0a9e('0x5e'),_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x40fc56,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]]){for(var _0x5b35db in this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x40fc56['uniqueid']][_0x0a9e('0x58')](_0x5b35db)){if(this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x3c')]&&!this['channels'][_0x40fc56['uniqueid']][_0x5b35db][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x40fc56[_0x0a9e('0x26')],this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x21')],_0x5b35db);this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x53')]=_0x0a9e('0x60');this[_0x0a9e('0x8')][_0x40fc56['uniqueid']][_0x5b35db][_0x0a9e('0x4e')]=_0x40fc56[_0x0a9e('0x4e')]=='transfer'?_0x0a9e('0x61'):_0x40fc56['reason'];this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x62')]=_0x40fc56[_0x0a9e('0x62')];if(this['voiceQueues'][_0x40fc56['queue']]&&this[_0x0a9e('0x9')][_0x40fc56[_0x0a9e('0x28')]][_0x0a9e('0x63')]){this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x64')]=this['voiceQueues'][_0x40fc56['queue']][_0x0a9e('0x65')];this['channels'][_0x40fc56['uniqueid']][_0x5b35db]['agentacw']=!![];}this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]]=_[_0x0a9e('0x2d')](this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]],[_0x0a9e('0x28'),'destconnectedlinenum']);logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db],{'showHidden':![],'depth':null}));ami['emit'](_0x0a9e('0x66'),this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db]);logger['debug'](_0x0a9e('0x67'),_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')]({'id':this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]]['id'],'destaccountcode':_0x40fc56[_0x0a9e('0x68')]},{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')]('user:%s',_0x40fc56[_0x0a9e('0x21')]),_0x0a9e('0x69'),{'id':this['agents'][_0x40fc56[_0x0a9e('0x32')]]['id'],'destaccountcode':_0x40fc56[_0x0a9e('0x68')]});}}}}}}catch(_0x3a1974){logger['error'](_0x0a9e('0x6a'),_0x40fc56['uniqueid'],util[_0x0a9e('0x25')](_0x3a1974,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x15')]=function(_0x1f29bd){try{if(this[_0x0a9e('0x1e')](_0x1f29bd)){logger[_0x0a9e('0x23')](_0x0a9e('0x6b'),_0x1f29bd[_0x0a9e('0x26')],util['inspect'](_0x1f29bd,{'showHidden':![],'depth':null}));this[_0x0a9e('0x6c')](_0x1f29bd[_0x0a9e('0x26')],_[_0x0a9e('0x6d')](_0x1f29bd[_0x0a9e('0x6e')])[0x0],_0x1f29bd[_0x0a9e('0x6f')]);if(this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]]){for(var _0x33f0c9 in this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x0a9e('0x58')](_0x33f0c9)){logger['info'](_0x0a9e('0x70'),_0x1f29bd[_0x0a9e('0x26')],_0x33f0c9,_[_0x0a9e('0x6d')](_0x1f29bd[_0x0a9e('0x6e')])[0x0],_0x1f29bd[_0x0a9e('0x6f')]);if(_['isUndefined'](this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x33f0c9]['variables'])){this[_0x0a9e('0x8')][_0x1f29bd['uniqueid']][_0x33f0c9][_0x0a9e('0xb')]={};}this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x33f0c9][_0x0a9e('0xb')]=this['variables'][_0x1f29bd[_0x0a9e('0x26')]];}}}}}catch(_0x4cf72d){logger[_0x0a9e('0x37')](_0x0a9e('0x71'),_0x1f29bd['uniqueid'],util[_0x0a9e('0x25')](_0x4cf72d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x6c')]=function(_0x4ab276,_0x4c788f,_0x1b82b7){var _0x6ba2be=[_0x0a9e('0x72'),_0x0a9e('0x73'),_0x0a9e('0x74'),_0x0a9e('0x75'),_0x0a9e('0x76'),_0x0a9e('0x77'),_0x0a9e('0x78'),'rtpaudioqosrttbridged',_0x0a9e('0x79'),'sipuri',_0x0a9e('0x7a'),_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x0a9e('0x7d'),_0x0a9e('0x7e'),'memberlastcall',_0x0a9e('0x21'),_0x0a9e('0x7f'),_0x0a9e('0x80')];if(!_[_0x0a9e('0x81')](_0x4c788f)&&!_[_0x0a9e('0x82')](_0x6ba2be,_0x4c788f)){if(_['isUndefined'](this['variables'][_0x4ab276])){this[_0x0a9e('0xb')][_0x4ab276]={};}this['variables'][_0x4ab276][_0x4c788f]=_0x1b82b7;}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x17')]=function(_0x4672e1){try{if(this[_0x0a9e('0x1e')](_0x4672e1)){logger[_0x0a9e('0x23')](_0x0a9e('0x83'),_0x4672e1['uniqueid'],util['inspect'](_0x4672e1,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x4672e1['uniqueid']]){for(var _0x2469d1 in this['channels'][_0x4672e1[_0x0a9e('0x26')]]){if(this['channels'][_0x4672e1['uniqueid']][_0x0a9e('0x58')](_0x2469d1)){if(this[_0x0a9e('0x8')][_0x4672e1['uniqueid']][_0x2469d1][_0x0a9e('0x4e')]==_0x0a9e('0x84')&&this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]][_0x2469d1][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x4672e1[_0x0a9e('0x26')],_0x2469d1);this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]][_0x2469d1][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger[_0x0a9e('0x23')](_0x0a9e('0x85'),_0x4672e1['uniqueid'],util[_0x0a9e('0x25')](_[_0x0a9e('0x86')](this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]]),{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x87'),_[_0x0a9e('0x86')](this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]]));delete this[_0x0a9e('0x8')][_0x4672e1['uniqueid']];}if(this[_0x0a9e('0xb')][_0x4672e1[_0x0a9e('0x26')]]){delete this[_0x0a9e('0xb')][_0x4672e1[_0x0a9e('0x26')]];}}}catch(_0x1d0b02){logger['error']('[%s][voiceAgentReport][hangup]',_0x4672e1[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x1d0b02,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x88')]=function(_0x34f7b5){try{if(this['isNotNull'](_0x34f7b5)){logger[_0x0a9e('0x23')](_0x0a9e('0x89'),_0x34f7b5[_0x0a9e('0x26')],util['inspect'](_0x34f7b5,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']]){for(var _0x2144ca in this['channels'][_0x34f7b5[_0x0a9e('0x8a')]]){if(this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]]['hasOwnProperty'](_0x2144ca)){if(_0x34f7b5[_0x0a9e('0x8b')]===_0x2144ca){logger['info'](_0x0a9e('0x8c'),_0x34f7b5[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x21')],_0x2144ca);var _0x1bee04=moment();this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca]['lastevent']='complete';this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']][_0x2144ca][_0x0a9e('0x4e')]=_0x0a9e('0x84');this['channels'][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x62')]=_0x1bee04[_0x0a9e('0x8d')](this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']][_0x2144ca][_0x0a9e('0x3c')],_0x0a9e('0x8e'));}}}}if(this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8f')]]){var _0x5d0e1f=this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8f')]];this[_0x0a9e('0x8')][_0x34f7b5['secondtransfereruniqueid']]=this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]];this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']]=_0x5d0e1f;}}}catch(_0x303f75){logger[_0x0a9e('0x37')](_0x0a9e('0x90'),_0x34f7b5[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x303f75,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x1b')]=function(_0x289e65){try{if(this['isNotNull'](_0x289e65)){logger[_0x0a9e('0x23')](_0x0a9e('0x91'),_0x289e65[_0x0a9e('0x26')],util['inspect'](_0x289e65,{'showHidden':![],'depth':null}));if(this['channels'][_0x289e65['transfereeuniqueid']]){for(var _0x1015aa in this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']]){if(this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x0a9e('0x58')](_0x1015aa)){if(_0x289e65['transfereruniqueid']===_0x1015aa){logger[_0x0a9e('0x20')](_0x0a9e('0x92'),_0x289e65[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x21')],_0x1015aa);var _0x40e6e7=moment();this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']][_0x1015aa][_0x0a9e('0x5f')]=_0x40e6e7;this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x53')]=_0x0a9e('0x60');this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']][_0x1015aa][_0x0a9e('0x4e')]=_0x0a9e('0x84');this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa]['talktime']=_0x40e6e7[_0x0a9e('0x8d')](this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x3c')],_0x0a9e('0x8e'));}}}}}}catch(_0x2be526){logger[_0x0a9e('0x37')](_0x0a9e('0x93'),_0x289e65[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2be526,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x18')]=function(_0x88b25f){var _0x2ff265='';try{if(this[_0x0a9e('0x1e')](_0x88b25f)){logger[_0x0a9e('0x23')](_0x0a9e('0x94'),_0x88b25f[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x88b25f,{'showHidden':![],'depth':null}));if(_0x88b25f['channel']){_0x2ff265=_0x88b25f[_0x0a9e('0x95')][_0x0a9e('0x96')](0x0,_0x88b25f[_0x0a9e('0x95')]['lastIndexOf']('-'));if(this[_0x0a9e('0xa')][_0x2ff265]){logger[_0x0a9e('0x20')](_0x0a9e('0x97'),_0x88b25f[_0x0a9e('0x26')],_0x2ff265);this[_0x0a9e('0xa')][_0x2ff265][_0x0a9e('0x98')]=!![];}}}}catch(_0x424f1b){logger[_0x0a9e('0x37')](_0x0a9e('0x99'),_0x88b25f[_0x0a9e('0x26')],util['inspect'](_0x424f1b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x9a')]=function(_0x15a9ed){var _0x3db98f='';try{if(this[_0x0a9e('0x1e')](_0x15a9ed)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][musiconholdstop]\x20event:',_0x15a9ed[_0x0a9e('0x26')],util['inspect'](_0x15a9ed,{'showHidden':![],'depth':null}));if(_0x15a9ed['channel']){_0x3db98f=_0x15a9ed['channel'][_0x0a9e('0x96')](0x0,_0x15a9ed[_0x0a9e('0x95')][_0x0a9e('0x9b')]('-'));if(this[_0x0a9e('0xa')][_0x3db98f]){logger['info'](_0x0a9e('0x9c'),_0x15a9ed[_0x0a9e('0x26')],_0x3db98f);this[_0x0a9e('0xa')][_0x3db98f][_0x0a9e('0x98')]=![];}}}}catch(_0x2c8d1d){logger['error']('[%s][voiceAgentReport][musiconholdstop]',_0x15a9ed[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2c8d1d,{'showHidden':![],'depth':null}));}};module[_0x0a9e('0x9d')]=VoiceAgentReport; \ No newline at end of file +var _0xa9e0=['musiconholdstop','attendedtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','info','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','uniqueid','YYYY-MM-DD\x20HH:mm:ss','queue','mandatoryDisposition','type','inbound','voice','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','interface','calleridnum','extravar','format','user:%s','error','[%s][voiceAgentReport][agentcalled]','syncAgentConnect','[%s][voiceAgentReport][agentconnect]\x20event:','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','connect','voiceChannels','routealias','merge','pick','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','user:agentconnect','agentringnoanswer','agentringnoanswerAt','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','lastevent','rejected','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','hasOwnProperty','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20event:','agentcompleteAt','complete','agent','talktime','acw','acwtime','acwTimeout','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','destaccountcode','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','transfer','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','syncAttendedTransfer','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','syncMusicOnHoldStop','lastIndexOf','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','exports','lodash','moment','util','../../../config/logger','../ami','redis','defaults','localhost','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','syncMusicOnHoldStart'];(function(_0x4e4af8,_0x1a204c){var _0x2f5132=function(_0x9729a9){while(--_0x9729a9){_0x4e4af8['push'](_0x4e4af8['shift']());}};_0x2f5132(++_0x1a204c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'use strict';var _=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x0a9e('0x3'))('ami');var ami=require(_0x0a9e('0x4'));config[_0x0a9e('0x5')]=_[_0x0a9e('0x6')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x5')]));function VoiceAgentReport(_0x441e3a){this[_0x0a9e('0x8')]={};this['voiceChannels']=_0x441e3a['channels'];this[_0x0a9e('0x9')]=_0x441e3a['voiceQueues'];this['agents']=_0x441e3a[_0x0a9e('0xa')];this[_0x0a9e('0xb')]={};ami['on'](_0x0a9e('0xc'),this[_0x0a9e('0xd')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0xf'),this['syncAgentConnect']['bind'](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x10'),this[_0x0a9e('0x11')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x12'),this[_0x0a9e('0x13')]['bind'](this));ami['on'](_0x0a9e('0x14'),this[_0x0a9e('0x15')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0xe')](this));ami['on']('musiconholdstart',this[_0x0a9e('0x18')]['bind'](this));ami['on'](_0x0a9e('0x19'),this['syncMusicOnHoldStop'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x1a'),this['syncAttendedTransfer'][_0x0a9e('0xe')](this));ami['on']('blindtransfer',this[_0x0a9e('0x1b')][_0x0a9e('0xe')](this));}VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1d')]=function(_0x31b1ca,_0x2eb11f,_0x530eb7){io['to'](_0x31b1ca)[_0x0a9e('0x1d')](_0x2eb11f,_0x530eb7);};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1e')]=function(_0x1c696a){return _0x1c696a!==null&&!_[_0x0a9e('0x1f')](_0x1c696a);};VoiceAgentReport['prototype'][_0x0a9e('0xd')]=function(_0x155cce){try{if(this['isNotNull'](_0x155cce)){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x155cce['uniqueid'],_0x155cce[_0x0a9e('0x21')],_0x155cce[_0x0a9e('0x22')]);logger[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x155cce,{'showHidden':![],'depth':null}));if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]]={};}if(_[_0x0a9e('0x1f')](this['channels'][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]={'agentcalledAt':moment()['format'](_0x0a9e('0x27')),'lastevent':'called','mandatoryDisposition':this[_0x0a9e('0x9')][_0x155cce['queue']]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x29')]||![]:![],'type':this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x2a')]||'inbound':_0x0a9e('0x2b'),'variables':this[_0x0a9e('0xb')][_0x155cce[_0x0a9e('0x26')]],'motionChannel':_0x0a9e('0x2c')};}_['merge'](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],_[_0x0a9e('0x2d')](_0x155cce,[_0x0a9e('0x2e'),_0x0a9e('0x2f')]));logger[_0x0a9e('0x23')](_0x0a9e('0x30'),_0x155cce[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x31'),this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce['destuniqueid']]);var _0x66c1d2={'id':this[_0x0a9e('0xa')][_0x155cce[_0x0a9e('0x32')]]['id'],'calleridnum':this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0x33')],'queue':this[_0x0a9e('0x8')][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]]['queue'],'extravar':this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0xb')]?this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0xb')][_0x0a9e('0x34')]:undefined};logger['debug']('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:',_0x155cce[_0x0a9e('0x26')],util['inspect'](_0x66c1d2,{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')](_0x0a9e('0x36'),_0x155cce[_0x0a9e('0x21')]),'user:called',_0x66c1d2);}}catch(_0x31916f){logger[_0x0a9e('0x37')](_0x0a9e('0x38'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x31916f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x39')]=function(_0x4c1c0e){try{if(this['isNotNull'](_0x4c1c0e)){if(this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]]){logger['debug'](_0x0a9e('0x3a'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4c1c0e,{'showHidden':![],'depth':null}));for(var _0x148f55 in this['channels'][_0x4c1c0e['uniqueid']]){if(this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]]['hasOwnProperty'](_0x148f55)){if(_0x4c1c0e[_0x0a9e('0x22')]===_0x148f55){logger[_0x0a9e('0x20')](_0x0a9e('0x3b'),_0x4c1c0e['uniqueid'],_0x4c1c0e[_0x0a9e('0x21')],_0x4c1c0e[_0x0a9e('0x22')]);this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3c')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3d')]=_0x4c1c0e[_0x0a9e('0x3d')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3e')]=_0x4c1c0e[_0x0a9e('0x3e')];this['channels'][_0x4c1c0e['uniqueid']][_0x148f55][_0x0a9e('0x3f')]=_0x4c1c0e[_0x0a9e('0x3f')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x40')]=_0x4c1c0e[_0x0a9e('0x40')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x41')]=_0x4c1c0e[_0x0a9e('0x41')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['lastevent']=_0x0a9e('0x42');if(this[_0x0a9e('0x43')][this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x26')]]){var _0xbe9d19=this[_0x0a9e('0x43')][this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x148f55][_0x0a9e('0x26')]]['routealias'];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x44')]=_0xbe9d19;_0x4c1c0e['routealias']=_0xbe9d19;}_[_0x0a9e('0x45')](this[_0x0a9e('0xa')][_0x4c1c0e[_0x0a9e('0x32')]],_[_0x0a9e('0x46')](_0x4c1c0e,[_0x0a9e('0x28'),_0x0a9e('0x47'),_0x0a9e('0x44')]));logger['debug'](_0x0a9e('0x48'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x4c1c0e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x49'),this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x4c1c0e[_0x0a9e('0x22')]]);logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:',_0x4c1c0e['uniqueid'],util['inspect'](this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x4c1c0e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')](_0x0a9e('0x36'),_0x4c1c0e[_0x0a9e('0x21')]),_0x0a9e('0x4a'),this['channels'][_0x4c1c0e['uniqueid']][_0x4c1c0e['destuniqueid']]);}else if(!this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4b')]&&!this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere',_0x4c1c0e[_0x0a9e('0x26')],this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['membername'],_0x148f55);this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4b')]=!![];this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['answeredelsewheredestinationuniqueid']=_0x4c1c0e[_0x0a9e('0x22')];this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['answeredelsewheremembername']=_0x4c1c0e[_0x0a9e('0x21')];this['channels'][_0x4c1c0e['uniqueid']][_0x148f55]['lastevent']=_0x0a9e('0x4d');this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4e')]=_0x0a9e('0x4d');logger[_0x0a9e('0x23')](_0x0a9e('0x4f'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x148f55],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x50'),this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]);}}}}}}catch(_0xb83dfd){logger[_0x0a9e('0x37')]('[%s][voiceAgentReport][agentconnect]',_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xb83dfd,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x51')]=function(_0x5cc8fb){try{if(this[_0x0a9e('0x1e')](_0x5cc8fb)){logger['debug']('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x5cc8fb['uniqueid'],util[_0x0a9e('0x25')](_0x5cc8fb,{'showHidden':![],'depth':null}));if(this['channels'][_0x5cc8fb[_0x0a9e('0x26')]]&&this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]){logger[_0x0a9e('0x20')](_0x0a9e('0x52'),_0x5cc8fb['uniqueid'],_0x5cc8fb[_0x0a9e('0x21')],_0x5cc8fb['destuniqueid']);this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]][_0x0a9e('0x4c')]=moment()['format'](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x5cc8fb['uniqueid']][_0x5cc8fb[_0x0a9e('0x22')]][_0x0a9e('0x53')]=_0x0a9e('0x54');this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb['destuniqueid']][_0x0a9e('0x4e')]=_0x0a9e('0x54');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:',_0x5cc8fb[_0x0a9e('0x26')],util['inspect'](this['channels'][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x55'),this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]);}}}catch(_0x54a37d){logger[_0x0a9e('0x37')](_0x0a9e('0x56'),_0x5cc8fb[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x54a37d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x11')]=function(_0x320898){try{if(this[_0x0a9e('0x1e')](_0x320898)){logger[_0x0a9e('0x23')](_0x0a9e('0x57'),_0x320898['uniqueid'],util[_0x0a9e('0x25')](_0x320898,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]]){for(var _0x4edbb0 in this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]]){if(this['channels'][_0x320898[_0x0a9e('0x26')]][_0x0a9e('0x58')](_0x4edbb0)&&!this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4b')]&&!this['channels'][_0x320898['uniqueid']][_0x4edbb0]['agentcomplete']){logger[_0x0a9e('0x20')](_0x0a9e('0x59'),_0x320898[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x21')],_0x4edbb0);this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4c')]=moment()['format'](_0x0a9e('0x27'));this['channels'][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x53')]='abandoned';this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4e')]=_0x0a9e('0x5a');logger['debug'](_0x0a9e('0x5b'),_0x320898[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x320898['uniqueid']][_0x4edbb0],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x5c'),this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0]);}}}}}catch(_0x4abc8f){logger[_0x0a9e('0x37')](_0x0a9e('0x5d'),_0x320898[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4abc8f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x13')]=function(_0x40fc56){try{if(this[_0x0a9e('0x1e')](_0x40fc56)){logger[_0x0a9e('0x23')](_0x0a9e('0x5e'),_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x40fc56,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]]){for(var _0x5b35db in this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x40fc56['uniqueid']][_0x0a9e('0x58')](_0x5b35db)){if(this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x3c')]&&!this['channels'][_0x40fc56['uniqueid']][_0x5b35db][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x40fc56[_0x0a9e('0x26')],this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x21')],_0x5b35db);this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x53')]=_0x0a9e('0x60');this[_0x0a9e('0x8')][_0x40fc56['uniqueid']][_0x5b35db][_0x0a9e('0x4e')]=_0x40fc56[_0x0a9e('0x4e')]=='transfer'?_0x0a9e('0x61'):_0x40fc56['reason'];this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x62')]=_0x40fc56[_0x0a9e('0x62')];if(this['voiceQueues'][_0x40fc56['queue']]&&this[_0x0a9e('0x9')][_0x40fc56[_0x0a9e('0x28')]][_0x0a9e('0x63')]){this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x64')]=this['voiceQueues'][_0x40fc56['queue']][_0x0a9e('0x65')];this['channels'][_0x40fc56['uniqueid']][_0x5b35db]['agentacw']=!![];}this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]]=_[_0x0a9e('0x2d')](this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]],[_0x0a9e('0x28'),'destconnectedlinenum']);logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db],{'showHidden':![],'depth':null}));ami['emit'](_0x0a9e('0x66'),this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db]);logger['debug'](_0x0a9e('0x67'),_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')]({'id':this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]]['id'],'destaccountcode':_0x40fc56[_0x0a9e('0x68')]},{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')]('user:%s',_0x40fc56[_0x0a9e('0x21')]),_0x0a9e('0x69'),{'id':this['agents'][_0x40fc56[_0x0a9e('0x32')]]['id'],'destaccountcode':_0x40fc56[_0x0a9e('0x68')]});}}}}}}catch(_0x3a1974){logger['error'](_0x0a9e('0x6a'),_0x40fc56['uniqueid'],util[_0x0a9e('0x25')](_0x3a1974,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x15')]=function(_0x1f29bd){try{if(this[_0x0a9e('0x1e')](_0x1f29bd)){logger[_0x0a9e('0x23')](_0x0a9e('0x6b'),_0x1f29bd[_0x0a9e('0x26')],util['inspect'](_0x1f29bd,{'showHidden':![],'depth':null}));this[_0x0a9e('0x6c')](_0x1f29bd[_0x0a9e('0x26')],_[_0x0a9e('0x6d')](_0x1f29bd[_0x0a9e('0x6e')])[0x0],_0x1f29bd[_0x0a9e('0x6f')]);if(this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]]){for(var _0x33f0c9 in this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x0a9e('0x58')](_0x33f0c9)){logger['info'](_0x0a9e('0x70'),_0x1f29bd[_0x0a9e('0x26')],_0x33f0c9,_[_0x0a9e('0x6d')](_0x1f29bd[_0x0a9e('0x6e')])[0x0],_0x1f29bd[_0x0a9e('0x6f')]);if(_['isUndefined'](this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x33f0c9]['variables'])){this[_0x0a9e('0x8')][_0x1f29bd['uniqueid']][_0x33f0c9][_0x0a9e('0xb')]={};}this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x33f0c9][_0x0a9e('0xb')]=this['variables'][_0x1f29bd[_0x0a9e('0x26')]];}}}}}catch(_0x4cf72d){logger[_0x0a9e('0x37')](_0x0a9e('0x71'),_0x1f29bd['uniqueid'],util[_0x0a9e('0x25')](_0x4cf72d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x6c')]=function(_0x4ab276,_0x4c788f,_0x1b82b7){var _0x6ba2be=[_0x0a9e('0x72'),_0x0a9e('0x73'),_0x0a9e('0x74'),_0x0a9e('0x75'),_0x0a9e('0x76'),_0x0a9e('0x77'),_0x0a9e('0x78'),'rtpaudioqosrttbridged',_0x0a9e('0x79'),'sipuri',_0x0a9e('0x7a'),_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x0a9e('0x7d'),_0x0a9e('0x7e'),'memberlastcall',_0x0a9e('0x21'),_0x0a9e('0x7f'),_0x0a9e('0x80')];if(!_[_0x0a9e('0x81')](_0x4c788f)&&!_[_0x0a9e('0x82')](_0x6ba2be,_0x4c788f)){if(_['isUndefined'](this['variables'][_0x4ab276])){this[_0x0a9e('0xb')][_0x4ab276]={};}this['variables'][_0x4ab276][_0x4c788f]=_0x1b82b7;}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x17')]=function(_0x4672e1){try{if(this[_0x0a9e('0x1e')](_0x4672e1)){logger[_0x0a9e('0x23')](_0x0a9e('0x83'),_0x4672e1['uniqueid'],util['inspect'](_0x4672e1,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x4672e1['uniqueid']]){for(var _0x2469d1 in this['channels'][_0x4672e1[_0x0a9e('0x26')]]){if(this['channels'][_0x4672e1['uniqueid']][_0x0a9e('0x58')](_0x2469d1)){if(this[_0x0a9e('0x8')][_0x4672e1['uniqueid']][_0x2469d1][_0x0a9e('0x4e')]==_0x0a9e('0x84')&&this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]][_0x2469d1][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x4672e1[_0x0a9e('0x26')],_0x2469d1);this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]][_0x2469d1][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger[_0x0a9e('0x23')](_0x0a9e('0x85'),_0x4672e1['uniqueid'],util[_0x0a9e('0x25')](_[_0x0a9e('0x86')](this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]]),{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x87'),_[_0x0a9e('0x86')](this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]]));delete this[_0x0a9e('0x8')][_0x4672e1['uniqueid']];}if(this[_0x0a9e('0xb')][_0x4672e1[_0x0a9e('0x26')]]){delete this[_0x0a9e('0xb')][_0x4672e1[_0x0a9e('0x26')]];}}}catch(_0x1d0b02){logger['error']('[%s][voiceAgentReport][hangup]',_0x4672e1[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x1d0b02,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x88')]=function(_0x34f7b5){try{if(this['isNotNull'](_0x34f7b5)){logger[_0x0a9e('0x23')](_0x0a9e('0x89'),_0x34f7b5[_0x0a9e('0x26')],util['inspect'](_0x34f7b5,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']]){for(var _0x2144ca in this['channels'][_0x34f7b5[_0x0a9e('0x8a')]]){if(this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]]['hasOwnProperty'](_0x2144ca)){if(_0x34f7b5[_0x0a9e('0x8b')]===_0x2144ca){logger['info'](_0x0a9e('0x8c'),_0x34f7b5[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x21')],_0x2144ca);var _0x1bee04=moment();this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca]['lastevent']='complete';this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']][_0x2144ca][_0x0a9e('0x4e')]=_0x0a9e('0x84');this['channels'][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x62')]=_0x1bee04[_0x0a9e('0x8d')](this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']][_0x2144ca][_0x0a9e('0x3c')],_0x0a9e('0x8e'));}}}}if(this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8f')]]){var _0x5d0e1f=this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8f')]];this[_0x0a9e('0x8')][_0x34f7b5['secondtransfereruniqueid']]=this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]];this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']]=_0x5d0e1f;}}}catch(_0x303f75){logger[_0x0a9e('0x37')](_0x0a9e('0x90'),_0x34f7b5[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x303f75,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x1b')]=function(_0x289e65){try{if(this['isNotNull'](_0x289e65)){logger[_0x0a9e('0x23')](_0x0a9e('0x91'),_0x289e65[_0x0a9e('0x26')],util['inspect'](_0x289e65,{'showHidden':![],'depth':null}));if(this['channels'][_0x289e65['transfereeuniqueid']]){for(var _0x1015aa in this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']]){if(this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x0a9e('0x58')](_0x1015aa)){if(_0x289e65['transfereruniqueid']===_0x1015aa){logger[_0x0a9e('0x20')](_0x0a9e('0x92'),_0x289e65[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x21')],_0x1015aa);var _0x40e6e7=moment();this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']][_0x1015aa][_0x0a9e('0x5f')]=_0x40e6e7;this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x53')]=_0x0a9e('0x60');this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']][_0x1015aa][_0x0a9e('0x4e')]=_0x0a9e('0x84');this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa]['talktime']=_0x40e6e7[_0x0a9e('0x8d')](this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x3c')],_0x0a9e('0x8e'));}}}}}}catch(_0x2be526){logger[_0x0a9e('0x37')](_0x0a9e('0x93'),_0x289e65[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2be526,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x18')]=function(_0x88b25f){var _0x2ff265='';try{if(this[_0x0a9e('0x1e')](_0x88b25f)){logger[_0x0a9e('0x23')](_0x0a9e('0x94'),_0x88b25f[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x88b25f,{'showHidden':![],'depth':null}));if(_0x88b25f['channel']){_0x2ff265=_0x88b25f[_0x0a9e('0x95')][_0x0a9e('0x96')](0x0,_0x88b25f[_0x0a9e('0x95')]['lastIndexOf']('-'));if(this[_0x0a9e('0xa')][_0x2ff265]){logger[_0x0a9e('0x20')](_0x0a9e('0x97'),_0x88b25f[_0x0a9e('0x26')],_0x2ff265);this[_0x0a9e('0xa')][_0x2ff265][_0x0a9e('0x98')]=!![];}}}}catch(_0x424f1b){logger[_0x0a9e('0x37')](_0x0a9e('0x99'),_0x88b25f[_0x0a9e('0x26')],util['inspect'](_0x424f1b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x9a')]=function(_0x15a9ed){var _0x3db98f='';try{if(this[_0x0a9e('0x1e')](_0x15a9ed)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][musiconholdstop]\x20event:',_0x15a9ed[_0x0a9e('0x26')],util['inspect'](_0x15a9ed,{'showHidden':![],'depth':null}));if(_0x15a9ed['channel']){_0x3db98f=_0x15a9ed['channel'][_0x0a9e('0x96')](0x0,_0x15a9ed[_0x0a9e('0x95')][_0x0a9e('0x9b')]('-'));if(this[_0x0a9e('0xa')][_0x3db98f]){logger['info'](_0x0a9e('0x9c'),_0x15a9ed[_0x0a9e('0x26')],_0x3db98f);this[_0x0a9e('0xa')][_0x3db98f][_0x0a9e('0x98')]=![];}}}}catch(_0x2c8d1d){logger['error']('[%s][voiceAgentReport][musiconholdstop]',_0x15a9ed[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2c8d1d,{'showHidden':![],'depth':null}));}};module[_0x0a9e('0x9d')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index 19b3940..0040871 100644 --- a/server/services/ami/report/voiceCallReport.js +++ b/server/services/ami/report/voiceCallReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2398=['linkedid','merge','pick','keys','from-sip','split','exten','xcally-motion-preview','channel','destconnectedlinenum','connectedlinenum','user:%s','name','user:agentconnect','[%s][voiceCallReport][newcallerid]','syncNewChannel','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','context','format','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','accountcode','[%s][voiceCallReport][newchannel]','application','applicationdata','startsWith','CDR(routeAlias)','appdata','toLowerCase','starttime','duration','subtract','seconds','lastapplication','lastdata','cdr(','match','type','isNil','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','calleridnum','answered','answertime','holdtime','diff','connectedlinename','destinationchannel','membername','UserId','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','replace','.WAV','monitorFilename','find','monitors','push','[%s][voiceCallReport][mixMonitorFilename]','syncVarSet','[%s][voiceCallReport][varset]\x20event:','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','xmd-phone','variable','xmd-callerid','callerid','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','originatecalleridnum','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','mixmonitor_filename','parse','sipcalllinkedid','[%s][voiceCallReport][varset]','syncHangup','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','billableseconds','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','length','resolve','then','transferType','undefined','isEmpty','getSettings','stopRecordingOnTransfer','Action','StopMixMonitor','catch','finally','webbar:stopmonitors','event','BlindTransfer','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][hangup]','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','secondtransfereruniqueid','ATTENDED','transfertargetuniqueid','transferconnectedlinenum','origtransfereruniqueid','origtransfererlinkedid','outbound','routeid','syncBlindTransfer','transfereecalleridnum','extension','[%s][voiceCallReport][blindtransfer]\x20event:','BLIND','transfereruniqueid','transfererchannel','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','mohtime','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','exports','lodash','moment','util','path','../../../config/environment','ami','../ami','../model/channel','../rpc/setting','set','queue','agi','dial','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','defaults','localhost','socket.io-emitter','channels','agents','blindTransfers','syncNewExten','bind','syncNewState','hangup','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','info','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','error','inspect','prototype','isNotNull','isUndefined','emit','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridname','debug','[%s][voiceCallReport][newcallerid]\x20event:'];(function(_0x57caec,_0x280eec){var _0x3c5c65=function(_0x233747){while(--_0x233747){_0x57caec['push'](_0x57caec['shift']());}};_0x3c5c65(++_0x280eec);}(_0x2398,0x91));var _0x8239=function(_0x1e1a39,_0x9f43a1){_0x1e1a39=_0x1e1a39-0x0;var _0x10b76c=_0x2398[_0x1e1a39];return _0x10b76c;};'use strict';var _=require(_0x8239('0x0'));var moment=require(_0x8239('0x1'));var util=require(_0x8239('0x2'));var path=require(_0x8239('0x3'));var Redis=require('ioredis');var config=require(_0x8239('0x4'));var logger=require('../../../config/logger')(_0x8239('0x5'));var ami=require(_0x8239('0x6'));var Channel=require(_0x8239('0x7'));var RpcSetting=require(_0x8239('0x8'));var applications=[_0x8239('0x9'),_0x8239('0xa'),_0x8239('0xb'),_0x8239('0xc'),'playback',_0x8239('0xd')];var dispositions=[_0x8239('0xe'),'FAILED',_0x8239('0xf'),'NO\x20ANSWER',_0x8239('0xe'),'NO\x20ANSWER',_0x8239('0x10'),_0x8239('0x11'),_0x8239('0xf'),'FAILED',_0x8239('0xf')];config[_0x8239('0x12')]=_[_0x8239('0x13')](config[_0x8239('0x12')],{'host':_0x8239('0x14'),'port':0x18eb});var io=require(_0x8239('0x15'))(new Redis(config[_0x8239('0x12')]));function VoiceCallReport(_0x53b14d){this[_0x8239('0x16')]=_0x53b14d[_0x8239('0x16')];this[_0x8239('0x17')]=_0x53b14d['agents'];this[_0x8239('0x18')]={};ami['on']('coreshowchannel',this[_0x8239('0x19')][_0x8239('0x1a')](this));ami['on']('newexten',this[_0x8239('0x19')][_0x8239('0x1a')](this));ami['on']('newchannel',this['syncNewChannel']['bind'](this));ami['on']('newstate',this[_0x8239('0x1b')]['bind'](this));ami['on']('varset',this['syncVarSet'][_0x8239('0x1a')](this));ami['on'](_0x8239('0x1c'),this['syncHangup']['bind'](this));ami['on'](_0x8239('0x1d'),this[_0x8239('0x1e')][_0x8239('0x1a')](this));ami['on'](_0x8239('0x1f'),this[_0x8239('0x20')][_0x8239('0x1a')](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0x8239('0x1a')](this));ami['on'](_0x8239('0x21'),this[_0x8239('0x22')][_0x8239('0x1a')](this));ami['on'](_0x8239('0x23'),this[_0x8239('0x24')][_0x8239('0x1a')](this));try{logger[_0x8239('0x25')](_0x8239('0x26'));ami[_0x8239('0x27')]();}catch(_0x3385cd){logger[_0x8239('0x28')]('[voiceCallReport][coreshowchannels]',util[_0x8239('0x29')](_0x3385cd,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x8239('0x2a')][_0x8239('0x2b')]=function(_0x488425){return _0x488425!==null&&!_[_0x8239('0x2c')](_0x488425);};VoiceCallReport['prototype'][_0x8239('0x2d')]=function(_0x389dd1,_0x37fa87,_0x1bfdb7){io['to'](_0x389dd1)[_0x8239('0x2d')](_0x37fa87,_0x1bfdb7);};VoiceCallReport[_0x8239('0x2a')][_0x8239('0x1e')]=function(_0x150067){try{if(this[_0x8239('0x2b')](_0x150067)){logger[_0x8239('0x25')](_0x8239('0x2e'),_0x150067[_0x8239('0x2f')],_0x150067[_0x8239('0x30')],_0x150067['calleridnum']);logger[_0x8239('0x31')](_0x8239('0x32'),_0x150067['uniqueid'],util['inspect'](_0x150067,{'showHidden':![],'depth':null}));if(_0x150067[_0x8239('0x2f')]===_0x150067[_0x8239('0x33')]){if(!_[_0x8239('0x2c')](this['channels'][_0x150067[_0x8239('0x2f')]])){_[_0x8239('0x34')](this[_0x8239('0x16')][_0x150067[_0x8239('0x2f')]],_[_0x8239('0x35')](_0x150067,_[_0x8239('0x36')](this[_0x8239('0x16')][_0x150067[_0x8239('0x2f')]])));}}if(_0x150067['context']===_0x8239('0x37')){if(this[_0x8239('0x17')][_0x150067['channel'][_0x8239('0x38')]('-')[0x0]]){if(_0x150067[_0x8239('0x39')]==_0x8239('0x3a')){this['agents'][_0x150067[_0x8239('0x3b')]['split']('-')[0x0]][_0x8239('0x3c')]=_0x150067[_0x8239('0x3d')];this[_0x8239('0x2d')](util['format'](_0x8239('0x3e'),this['agents'][_0x150067[_0x8239('0x3b')][_0x8239('0x38')]('-')[0x0]][_0x8239('0x3f')]),_0x8239('0x40'),{'destaccountcode':this[_0x8239('0x17')][_0x150067[_0x8239('0x3b')]['split']('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x150067[_0x8239('0x3d')]});}}}}}catch(_0x33accb){logger['error'](_0x8239('0x41'),_0x150067[_0x8239('0x2f')],util[_0x8239('0x29')](_0x33accb,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8239('0x2a')][_0x8239('0x42')]=function(_0x5d25e2){try{if(this[_0x8239('0x2b')](_0x5d25e2)){logger['debug'](_0x8239('0x43'),_0x5d25e2['uniqueid'],util[_0x8239('0x29')](_0x5d25e2,{'showHidden':![],'depth':null}));if(this['channels'][_0x5d25e2[_0x8239('0x2f')]])return;if(_0x5d25e2[_0x8239('0x3b')]===_0x8239('0x44'))return;if(_0x5d25e2[_0x8239('0x2f')]!==_0x5d25e2[_0x8239('0x33')]&&!this[_0x8239('0x18')][_0x5d25e2[_0x8239('0x33')]])return;logger[_0x8239('0x25')](_0x8239('0x45'),_0x5d25e2[_0x8239('0x2f')],_0x5d25e2[_0x8239('0x46')],_0x5d25e2[_0x8239('0x39')]);this['channels'][_0x5d25e2[_0x8239('0x2f')]]=new Channel();this['channels'][_0x5d25e2[_0x8239('0x2f')]]['starttime']=moment()[_0x8239('0x47')](_0x8239('0x48'));this[_0x8239('0x16')][_0x5d25e2[_0x8239('0x2f')]][_0x8239('0x49')]=dispositions[_[_0x8239('0x4a')](_0x5d25e2[_0x8239('0x4b')])];_['merge'](this['channels'][_0x5d25e2[_0x8239('0x2f')]],_['pick'](_0x5d25e2,_[_0x8239('0x36')](this['channels'][_0x5d25e2[_0x8239('0x2f')]])));if(_0x5d25e2[_0x8239('0x46')]===_0x8239('0x37')){if(this['agents'][_0x5d25e2[_0x8239('0x3b')][_0x8239('0x38')]('-')[0x0]]){if(_[_0x8239('0x2c')](this[_0x8239('0x17')][_0x5d25e2[_0x8239('0x3b')][_0x8239('0x38')]('-')[0x0]][_0x8239('0x3c')])){this[_0x8239('0x17')][_0x5d25e2['channel'][_0x8239('0x38')]('-')[0x0]][_0x8239('0x3c')]=_0x5d25e2['exten'];logger[_0x8239('0x31')](_0x8239('0x4c'),_0x5d25e2['uniqueid'],util[_0x8239('0x29')]({'id':this[_0x8239('0x17')][_0x5d25e2[_0x8239('0x3b')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0x8239('0x17')][_0x5d25e2[_0x8239('0x3b')][_0x8239('0x38')]('-')[0x0]][_0x8239('0x4d')],'destconnectedlinenum':_0x5d25e2[_0x8239('0x39')]},{'showHidden':![],'depth':null}));this[_0x8239('0x2d')](util[_0x8239('0x47')](_0x8239('0x3e'),this['agents'][_0x5d25e2['channel'][_0x8239('0x38')]('-')[0x0]][_0x8239('0x3f')]),'user:agentconnect',{'id':this[_0x8239('0x17')][_0x5d25e2[_0x8239('0x3b')]['split']('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x5d25e2[_0x8239('0x3b')][_0x8239('0x38')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x5d25e2[_0x8239('0x39')]});}}}}}catch(_0x2537e0){logger['error'](_0x8239('0x4e'),_0x5d25e2[_0x8239('0x2f')],util[_0x8239('0x29')](_0x2537e0,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8239('0x2a')][_0x8239('0x19')]=function(_0x28bec8){try{if(this['isNotNull'](_0x28bec8)){logger[_0x8239('0x31')]('[%s][voiceCallReport][newexten]\x20event:',_0x28bec8[_0x8239('0x2f')],util[_0x8239('0x29')](_0x28bec8,{'showHidden':![],'depth':null}));if(_0x28bec8[_0x8239('0x3b')]==='OutgoingSpoolFailed'||_0x28bec8[_0x8239('0x39')]==='h')return;if(_0x28bec8[_0x8239('0x2f')]===_0x28bec8['linkedid']||this[_0x8239('0x18')][_0x28bec8[_0x8239('0x33')]]){_0x28bec8[_0x8239('0x4f')]=_0x28bec8['application']['toLowerCase']();_0x28bec8[_0x8239('0x50')]=_0x28bec8['appdata']&&_0x28bec8['appdata'][_0x8239('0x51')](_0x8239('0x52'))?_0x28bec8['appdata']:(_0x28bec8[_0x8239('0x53')]||_0x28bec8[_0x8239('0x50')])[_0x8239('0x54')]();logger[_0x8239('0x25')]('[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s',_0x28bec8[_0x8239('0x2f')],_0x28bec8[_0x8239('0x4f')],_0x28bec8['applicationdata']);if(_[_0x8239('0x2c')](this[_0x8239('0x16')][_0x28bec8[_0x8239('0x2f')]])){this['channels'][_0x28bec8[_0x8239('0x2f')]]=new Channel();this[_0x8239('0x16')][_0x28bec8[_0x8239('0x2f')]][_0x8239('0x55')]=_0x28bec8[_0x8239('0x56')]?moment()[_0x8239('0x57')](moment['duration'](_0x28bec8[_0x8239('0x56')])[_0x8239('0x58')](),_0x8239('0x58'))['format'](_0x8239('0x48')):moment()[_0x8239('0x47')](_0x8239('0x48'));this['channels'][_0x28bec8[_0x8239('0x2f')]][_0x8239('0x49')]=_0x8239('0xe');}_['merge'](this[_0x8239('0x16')][_0x28bec8[_0x8239('0x2f')]],_[_0x8239('0x35')](_0x28bec8,_[_0x8239('0x36')](this[_0x8239('0x16')][_0x28bec8['uniqueid']])));if(_['includes'](applications,_0x28bec8['application'])){this[_0x8239('0x16')][_0x28bec8['uniqueid']][_0x8239('0x59')]=_0x28bec8['application'];this[_0x8239('0x16')][_0x28bec8[_0x8239('0x2f')]][_0x8239('0x5a')]=_0x28bec8['applicationdata'];if(_0x28bec8['application']==='set'&&_['startsWith'](_0x28bec8['applicationdata'][_0x8239('0x54')](),_0x8239('0x5b'))){var _0x44151c=_0x28bec8['applicationdata'][_0x8239('0x38')]('=');var _0x43d477=_0x44151c[0x0][_0x8239('0x54')]()[_0x8239('0x5c')](/cdr\((.*)\)/);if(_0x43d477){if(_0x43d477[0x1]===_0x8239('0x5d')&&!_[_0x8239('0x5e')](this[_0x8239('0x16')][_0x28bec8[_0x8239('0x2f')]][_0x43d477[0x1]]))return;this[_0x8239('0x16')][_0x28bec8[_0x8239('0x2f')]][_0x43d477[0x1]]=_0x44151c[0x1];}}else if(_0x28bec8['application']===_0x8239('0xa')){this['channels'][_0x28bec8[_0x8239('0x2f')]][_0x8239('0xa')]=_0x28bec8[_0x8239('0x50')]['split'](',')[0x0];}}}}}catch(_0x428743){logger['error'](_0x8239('0x5f'),_0x28bec8[_0x8239('0x2f')],util[_0x8239('0x29')](_0x428743,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x8239('0x1b')]=function(_0xe1e86){try{if(this[_0x8239('0x2b')](_0xe1e86)){logger['info'](_0x8239('0x60'),_0xe1e86[_0x8239('0x2f')],_0xe1e86[_0x8239('0x33')],_0xe1e86[_0x8239('0x30')],_0xe1e86[_0x8239('0x61')]);logger['debug']('[%s][voiceCallReport][newstate]\x20event:',_0xe1e86[_0x8239('0x2f')],util[_0x8239('0x29')](_0xe1e86,{'showHidden':![],'depth':null}));if(_0xe1e86[_0x8239('0x4b')]!=='6')return;if(_0xe1e86['uniqueid']!==_0xe1e86[_0x8239('0x33')]){var _0x2cccd4=moment();if(this[_0x8239('0x16')][_0xe1e86['linkedid']]){if(!this[_0x8239('0x16')][_0xe1e86[_0x8239('0x33')]][_0x8239('0x62')]){this[_0x8239('0x16')][_0xe1e86[_0x8239('0x33')]][_0x8239('0x62')]=!![];this[_0x8239('0x16')][_0xe1e86[_0x8239('0x33')]][_0x8239('0x63')]=_0x2cccd4[_0x8239('0x47')](_0x8239('0x48'));if(this[_0x8239('0x16')][_0xe1e86[_0x8239('0x33')]][_0x8239('0x55')]){this[_0x8239('0x16')][_0xe1e86[_0x8239('0x33')]][_0x8239('0x64')]=_0x2cccd4[_0x8239('0x65')](this[_0x8239('0x16')][_0xe1e86['linkedid']][_0x8239('0x55')],_0x8239('0x58'));}}this[_0x8239('0x16')][_0xe1e86[_0x8239('0x33')]][_0x8239('0x33')]=_0xe1e86[_0x8239('0x2f')];if(_0xe1e86['calleridnum']!=='xcally-motion-preview'){this['channels'][_0xe1e86[_0x8239('0x33')]][_0x8239('0x3d')]=_0xe1e86[_0x8239('0x61')];}this[_0x8239('0x16')][_0xe1e86[_0x8239('0x33')]][_0x8239('0x66')]=_0xe1e86[_0x8239('0x30')];this['channels'][_0xe1e86[_0x8239('0x33')]][_0x8239('0x67')]=_0xe1e86[_0x8239('0x3b')];this[_0x8239('0x16')][_0xe1e86['linkedid']][_0x8239('0x49')]=dispositions[_[_0x8239('0x4a')](_0xe1e86['channelstate'])];if(this[_0x8239('0x17')][_0xe1e86[_0x8239('0x3b')][_0x8239('0x38')]('-')[0x0]]){this[_0x8239('0x16')][_0xe1e86[_0x8239('0x33')]]['UserId']=this[_0x8239('0x17')][_0xe1e86[_0x8239('0x3b')][_0x8239('0x38')]('-')[0x0]]['id'];this[_0x8239('0x16')][_0xe1e86['linkedid']][_0x8239('0x68')]=this[_0x8239('0x17')][_0xe1e86[_0x8239('0x3b')][_0x8239('0x38')]('-')[0x0]][_0x8239('0x3f')];}}if(this[_0x8239('0x16')][_0xe1e86['uniqueid']]){if(!this['channels'][_0xe1e86[_0x8239('0x2f')]]['answered']){this[_0x8239('0x16')][_0xe1e86['uniqueid']]['answered']=!![];this['channels'][_0xe1e86[_0x8239('0x2f')]][_0x8239('0x63')]=_0x2cccd4[_0x8239('0x47')]('YYYY-MM-DD\x20HH:mm:ss');if(this[_0x8239('0x16')][_0xe1e86[_0x8239('0x2f')]][_0x8239('0x55')]){this['channels'][_0xe1e86[_0x8239('0x2f')]][_0x8239('0x64')]=_0x2cccd4[_0x8239('0x65')](this[_0x8239('0x16')][_0xe1e86[_0x8239('0x2f')]][_0x8239('0x55')],_0x8239('0x58'));}}if(_0xe1e86[_0x8239('0x61')]!==_0x8239('0x3a')){this['channels'][_0xe1e86[_0x8239('0x2f')]][_0x8239('0x3d')]=_0xe1e86[_0x8239('0x61')];}this['channels'][_0xe1e86[_0x8239('0x2f')]][_0x8239('0x66')]=_0xe1e86[_0x8239('0x30')];this['channels'][_0xe1e86[_0x8239('0x2f')]][_0x8239('0x67')]=_0xe1e86['channel'];this[_0x8239('0x16')][_0xe1e86['uniqueid']][_0x8239('0x49')]=dispositions[_['toNumber'](_0xe1e86[_0x8239('0x4b')])];}}else{if(this[_0x8239('0x16')][_0xe1e86[_0x8239('0x2f')]]){if(this[_0x8239('0x17')][_0xe1e86['channel'][_0x8239('0x38')]('-')[0x0]]){this[_0x8239('0x16')][_0xe1e86[_0x8239('0x2f')]][_0x8239('0x69')]=this[_0x8239('0x17')][_0xe1e86[_0x8239('0x3b')][_0x8239('0x38')]('-')[0x0]]['id'];this[_0x8239('0x16')][_0xe1e86['uniqueid']][_0x8239('0x68')]=this['agents'][_0xe1e86[_0x8239('0x3b')][_0x8239('0x38')]('-')[0x0]][_0x8239('0x3f')];}}}if(_0xe1e86[_0x8239('0x46')]===_0x8239('0x37')){if(this[_0x8239('0x17')][_0xe1e86[_0x8239('0x3b')][_0x8239('0x38')]('-')[0x0]]){this['agents'][_0xe1e86[_0x8239('0x3b')]['split']('-')[0x0]]['destconnectedlinenum']=_0xe1e86['exten'];var _0x33eec7,_0x58309a;if(this['channels'][_0xe1e86[_0x8239('0x2f')]]){_0x33eec7=this[_0x8239('0x16')][_0xe1e86[_0x8239('0x2f')]][_0x8239('0x6a')];_0x58309a=this[_0x8239('0x16')][_0xe1e86['uniqueid']][_0x8239('0xa')];}else if(this['channels'][_0xe1e86[_0x8239('0x33')]]){_0x33eec7=this[_0x8239('0x16')][_0xe1e86['linkedid']]['routealias'];_0x58309a=this[_0x8239('0x16')][_0xe1e86[_0x8239('0x33')]][_0x8239('0xa')];}logger[_0x8239('0x31')](_0x8239('0x6b'),_0xe1e86[_0x8239('0x2f')],util['inspect']({'id':this[_0x8239('0x17')][_0xe1e86[_0x8239('0x3b')][_0x8239('0x38')]('-')[0x0]]['id'],'destaccountcode':this[_0x8239('0x17')][_0xe1e86[_0x8239('0x3b')][_0x8239('0x38')]('-')[0x0]][_0x8239('0x4d')],'destconnectedlinenum':_0xe1e86['exten'],'routealias':_0x33eec7,'queue':_0x58309a||undefined},{'showHidden':![],'depth':null}));this['emit'](util[_0x8239('0x47')](_0x8239('0x3e'),this[_0x8239('0x17')][_0xe1e86['channel'][_0x8239('0x38')]('-')[0x0]]['name']),_0x8239('0x40'),{'id':this[_0x8239('0x17')][_0xe1e86[_0x8239('0x3b')]['split']('-')[0x0]]['id'],'agentconnected':!![],'destaccountcode':this[_0x8239('0x17')][_0xe1e86['channel'][_0x8239('0x38')]('-')[0x0]][_0x8239('0x4d')],'destconnectedlinenum':_0xe1e86['exten'],'routealias':_0x33eec7,'queue':_0x58309a||undefined});}}}}catch(_0x27a71d){logger[_0x8239('0x28')](_0x8239('0x6c'),_0xe1e86[_0x8239('0x2f')],util['inspect'](_0x27a71d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8239('0x2a')][_0x8239('0x6d')]=function(_0x358e4c,_0x4bdb7a){try{if(this[_0x8239('0x16')][_0x358e4c]){logger['info']('[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s',_0x358e4c,_0x4bdb7a);this[_0x8239('0x16')][_0x358e4c]['monitor']=!![];if(_['endsWith'](_0x4bdb7a,'.wav49')){_0x4bdb7a=_0x4bdb7a[_0x8239('0x6e')]('.wav49',_0x8239('0x6f'));}this['channels'][_0x358e4c][_0x8239('0x70')]=_0x4bdb7a;var _0x4e1d25=_[_0x8239('0x71')](this[_0x8239('0x16')][_0x358e4c][_0x8239('0x72')],{'filename':_0x4bdb7a});if(_[_0x8239('0x5e')](_0x4e1d25)){this[_0x8239('0x16')][_0x358e4c]['monitors'][_0x8239('0x73')]({'filename':_0x4bdb7a,'createdAt':moment()[_0x8239('0x47')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':'','status':'rec'});}}}catch(_0x442c84){logger[_0x8239('0x28')](_0x8239('0x74'),_0x358e4c,util['inspect'](_0x442c84,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8239('0x2a')][_0x8239('0x75')]=function(_0x3fd9bc){try{if(this['isNotNull'](_0x3fd9bc)){logger[_0x8239('0x31')](_0x8239('0x76'),_0x3fd9bc[_0x8239('0x2f')],util['inspect'](_0x3fd9bc,{'showHidden':![],'depth':null}));if(this['channels'][_0x3fd9bc['uniqueid']]&&_0x3fd9bc['channel']!=_0x8239('0x44')){if(this[_0x8239('0x2b')](_0x3fd9bc['variable'])){if(this[_0x8239('0x2b')](_0x3fd9bc['variable']['mixmonitor_filename'])){logger[_0x8239('0x25')](_0x8239('0x77'),_0x3fd9bc['uniqueid'],_0x3fd9bc['value']);this[_0x8239('0x6d')](_0x3fd9bc[_0x8239('0x2f')],_0x3fd9bc[_0x8239('0x78')]);}else if(this[_0x8239('0x2b')](_0x3fd9bc['variable'][_0x8239('0x79')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s',_0x3fd9bc[_0x8239('0x2f')],_0x3fd9bc[_0x8239('0x78')]);this[_0x8239('0x16')][_0x3fd9bc[_0x8239('0x2f')]][_0x8239('0x61')]=_0x3fd9bc[_0x8239('0x78')];}else if(this[_0x8239('0x2b')](_0x3fd9bc[_0x8239('0x7a')][_0x8239('0x7b')])){logger[_0x8239('0x25')]('[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s',_0x3fd9bc[_0x8239('0x2f')],_0x3fd9bc['value']);this[_0x8239('0x16')][_0x3fd9bc['uniqueid']][_0x8239('0x7c')]=_0x3fd9bc[_0x8239('0x78')];}else if(this[_0x8239('0x2b')](_0x3fd9bc[_0x8239('0x7a')][_0x8239('0x7d')])){logger['info'](_0x8239('0x7e'),_0x3fd9bc['uniqueid'],_0x3fd9bc[_0x8239('0x78')]);this['channels'][_0x3fd9bc[_0x8239('0x2f')]][_0x8239('0x5d')]=_0x3fd9bc[_0x8239('0x78')];}else if(this['isNotNull'](_0x3fd9bc['variable']['xmd-queue'])){logger[_0x8239('0x25')](_0x8239('0x7f'),_0x3fd9bc[_0x8239('0x2f')],_0x3fd9bc[_0x8239('0x78')][_0x8239('0x38')](',')[0x0]);this['channels'][_0x3fd9bc[_0x8239('0x2f')]][_0x8239('0xa')]=_0x3fd9bc[_0x8239('0x78')]['split'](',')[0x0];}else if(this[_0x8239('0x2b')](_0x3fd9bc[_0x8239('0x7a')][_0x8239('0x80')])){logger[_0x8239('0x25')]('[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x3fd9bc[_0x8239('0x2f')],_0x3fd9bc[_0x8239('0x78')]);this['channels'][_0x3fd9bc['uniqueid']][_0x8239('0x81')]=_0x3fd9bc[_0x8239('0x78')];}else if(this[_0x8239('0x2b')](_0x3fd9bc[_0x8239('0x7a')]['xmd-destination'])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s',_0x3fd9bc[_0x8239('0x2f')],_0x3fd9bc[_0x8239('0x78')]);this[_0x8239('0x16')][_0x3fd9bc[_0x8239('0x2f')]][_0x8239('0x82')]=_0x3fd9bc[_0x8239('0x78')];}else if(this[_0x8239('0x2b')](_0x3fd9bc[_0x8239('0x7a')][_0x8239('0x83')])){logger['info'](_0x8239('0x84'),_0x3fd9bc[_0x8239('0x2f')],_0x3fd9bc['value']);this[_0x8239('0x16')][_0x3fd9bc['uniqueid']][_0x8239('0x85')]=_0x3fd9bc[_0x8239('0x78')];}else if(this[_0x8239('0x2b')](_0x3fd9bc['variable'][_0x8239('0x86')])){logger['info'](_0x8239('0x87'),_0x3fd9bc[_0x8239('0x2f')],_0x3fd9bc[_0x8239('0x78')]);this[_0x8239('0x16')][_0x3fd9bc[_0x8239('0x2f')]][_0x8239('0xa')]=_0x3fd9bc[_0x8239('0x78')];}else if(this[_0x8239('0x2b')](_0x3fd9bc[_0x8239('0x7a')][_0x8239('0x88')])){logger[_0x8239('0x25')](_0x8239('0x89'),_0x3fd9bc[_0x8239('0x2f')],_0x3fd9bc[_0x8239('0x78')]);this['channels'][_0x3fd9bc[_0x8239('0x2f')]][_0x8239('0x8a')]=_0x3fd9bc[_0x8239('0x78')];}}}else if(this['isNotNull'](_0x3fd9bc[_0x8239('0x7a')][_0x8239('0x8b')])){if(_0x3fd9bc[_0x8239('0x78')]){var _0x1b2745=path[_0x8239('0x8c')](_0x3fd9bc[_0x8239('0x78')])[_0x8239('0x3f')];logger[_0x8239('0x25')]('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x1b2745,_0x3fd9bc[_0x8239('0x78')]);this[_0x8239('0x6d')](_0x1b2745,_0x3fd9bc[_0x8239('0x78')]);}}else if(this[_0x8239('0x16')][_0x3fd9bc['linkedid']]){if(this['isNotNull'](_0x3fd9bc[_0x8239('0x7a')])){if(this['isNotNull'](_0x3fd9bc[_0x8239('0x7a')][_0x8239('0x88')])){logger[_0x8239('0x25')](_0x8239('0x89'),_0x3fd9bc[_0x8239('0x33')],_0x3fd9bc[_0x8239('0x78')]);this[_0x8239('0x16')][_0x3fd9bc[_0x8239('0x33')]][_0x8239('0x8d')]=_0x3fd9bc[_0x8239('0x78')];}}}}}catch(_0x5d2082){logger[_0x8239('0x28')](_0x8239('0x8e'),_0x3fd9bc[_0x8239('0x2f')],util[_0x8239('0x29')](_0x5d2082,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8239('0x2a')][_0x8239('0x8f')]=function(_0x5a7c87){try{if(this['isNotNull'](_0x5a7c87)){logger[_0x8239('0x31')](_0x8239('0x90'),_0x5a7c87[_0x8239('0x2f')],util[_0x8239('0x29')](_0x5a7c87,{'showHidden':![],'depth':null}));if(this['blindTransfers'][_0x5a7c87[_0x8239('0x33')]]){if(this[_0x8239('0x16')][this[_0x8239('0x18')][_0x5a7c87[_0x8239('0x33')]][_0x8239('0x33')]]){this['channels'][this[_0x8239('0x18')][_0x5a7c87['linkedid']][_0x8239('0x33')]][_0x8239('0x2f')]=_0x5a7c87['uniqueid'];this[_0x8239('0x16')][this[_0x8239('0x18')][_0x5a7c87[_0x8239('0x33')]][_0x8239('0x33')]][_0x8239('0x62')]=this[_0x8239('0x16')][_0x5a7c87[_0x8239('0x2f')]][_0x8239('0x62')];this['channels'][this['blindTransfers'][_0x5a7c87[_0x8239('0x33')]][_0x8239('0x33')]][_0x8239('0x63')]=this[_0x8239('0x16')][_0x5a7c87[_0x8239('0x2f')]]['answertime'];this['channels'][this[_0x8239('0x18')][_0x5a7c87[_0x8239('0x33')]][_0x8239('0x33')]][_0x8239('0x67')]=this[_0x8239('0x16')][this['blindTransfers'][_0x5a7c87[_0x8239('0x33')]][_0x8239('0x33')]][_0x8239('0x3b')];this[_0x8239('0x16')][this[_0x8239('0x18')][_0x5a7c87['linkedid']][_0x8239('0x33')]][_0x8239('0x49')]=this[_0x8239('0x16')][_0x5a7c87[_0x8239('0x2f')]][_0x8239('0x49')];this[_0x8239('0x16')][_0x5a7c87['uniqueid']]=this['channels'][this[_0x8239('0x18')][_0x5a7c87[_0x8239('0x33')]]['linkedid']];delete this[_0x8239('0x16')][this[_0x8239('0x18')][_0x5a7c87[_0x8239('0x33')]][_0x8239('0x33')]];}else if(this[_0x8239('0x16')][this[_0x8239('0x18')][_0x5a7c87[_0x8239('0x33')]][_0x8239('0x2f')]]){this[_0x8239('0x16')][this[_0x8239('0x18')][_0x5a7c87[_0x8239('0x33')]][_0x8239('0x2f')]]['uniqueid']=[this[_0x8239('0x16')][this[_0x8239('0x18')][_0x5a7c87[_0x8239('0x33')]]['uniqueid']][_0x8239('0x33')],this[_0x8239('0x16')][this[_0x8239('0x18')][_0x5a7c87[_0x8239('0x33')]][_0x8239('0x2f')]][_0x8239('0x33')]=this[_0x8239('0x16')][this['blindTransfers'][_0x5a7c87[_0x8239('0x33')]][_0x8239('0x2f')]]['uniqueid']][0x0];this[_0x8239('0x16')][this[_0x8239('0x18')][_0x5a7c87[_0x8239('0x33')]][_0x8239('0x2f')]][_0x8239('0x62')]=this[_0x8239('0x16')][_0x5a7c87[_0x8239('0x2f')]][_0x8239('0x62')];this[_0x8239('0x16')][this['blindTransfers'][_0x5a7c87[_0x8239('0x33')]][_0x8239('0x2f')]][_0x8239('0x63')]=this['channels'][_0x5a7c87[_0x8239('0x2f')]]['answertime'];this['channels'][this[_0x8239('0x18')][_0x5a7c87[_0x8239('0x33')]][_0x8239('0x2f')]][_0x8239('0x67')]=this[_0x8239('0x16')][this[_0x8239('0x18')][_0x5a7c87[_0x8239('0x33')]][_0x8239('0x2f')]][_0x8239('0x3b')];this['channels'][this[_0x8239('0x18')][_0x5a7c87[_0x8239('0x33')]][_0x8239('0x2f')]][_0x8239('0x49')]=this[_0x8239('0x16')][_0x5a7c87[_0x8239('0x2f')]][_0x8239('0x49')];this[_0x8239('0x16')][_0x5a7c87[_0x8239('0x2f')]]=this[_0x8239('0x16')][this[_0x8239('0x18')][_0x5a7c87[_0x8239('0x33')]][_0x8239('0x2f')]];delete this[_0x8239('0x16')][this[_0x8239('0x18')][_0x5a7c87[_0x8239('0x33')]][_0x8239('0x2f')]];}}if(this[_0x8239('0x16')][_0x5a7c87[_0x8239('0x2f')]]){logger[_0x8239('0x25')](_0x8239('0x91'),_0x5a7c87[_0x8239('0x2f')],_0x5a7c87[_0x8239('0x92')]);var _0x84bb88=moment();this[_0x8239('0x16')][_0x5a7c87['uniqueid']]['endtime']=_0x84bb88['format'](_0x8239('0x48'));this[_0x8239('0x16')][_0x5a7c87['uniqueid']]['duration']=_0x84bb88[_0x8239('0x65')](this[_0x8239('0x16')][_0x5a7c87[_0x8239('0x2f')]][_0x8239('0x55')],_0x8239('0x58'));if(this[_0x8239('0x16')][_0x5a7c87[_0x8239('0x2f')]]['answered']){this[_0x8239('0x16')][_0x5a7c87['uniqueid']][_0x8239('0x93')]=_0x84bb88[_0x8239('0x65')](this[_0x8239('0x16')][_0x5a7c87[_0x8239('0x2f')]][_0x8239('0x63')],'seconds');this[_0x8239('0x16')][_0x5a7c87[_0x8239('0x2f')]]['holdtime']=this[_0x8239('0x16')][_0x5a7c87[_0x8239('0x2f')]][_0x8239('0x56')]-this['channels'][_0x5a7c87[_0x8239('0x2f')]][_0x8239('0x93')];}if(_0x5a7c87[_0x8239('0x46')]===_0x8239('0x37')){if(this[_0x8239('0x17')][_0x5a7c87[_0x8239('0x3b')][_0x8239('0x38')]('-')[0x0]]){this[_0x8239('0x17')][_0x5a7c87[_0x8239('0x3b')][_0x8239('0x38')]('-')[0x0]]=_[_0x8239('0x94')](this[_0x8239('0x17')][_0x5a7c87['channel']['split']('-')[0x0]],[_0x8239('0x3c')]);logger['debug'](_0x8239('0x95'),_0x5a7c87[_0x8239('0x2f')],util[_0x8239('0x29')]({'id':this[_0x8239('0x17')][_0x5a7c87['channel'][_0x8239('0x38')]('-')[0x0]]['id'],'destaccountcode':this[_0x8239('0x17')][_0x5a7c87[_0x8239('0x3b')][_0x8239('0x38')]('-')[0x0]][_0x8239('0x4d')]},{'showHidden':![],'depth':null}));this[_0x8239('0x2d')](util[_0x8239('0x47')](_0x8239('0x3e'),this['agents'][_0x5a7c87['channel']['split']('-')[0x0]]['name']),_0x8239('0x96'),{'id':this[_0x8239('0x17')][_0x5a7c87[_0x8239('0x3b')][_0x8239('0x38')]('-')[0x0]]['id'],'destaccountcode':this[_0x8239('0x17')][_0x5a7c87['channel'][_0x8239('0x38')]('-')[0x0]][_0x8239('0x4d')]});for(var _0x1f4a2c=0x0;_0x1f4a2c0x0?_0x54e856:0x0;this[_0xa24c('0x10')][_0x133567['queue']][_0xa24c('0x6a')]=this[_0xa24c('0x10')][_0x133567[_0xa24c('0x62')]]['talking']>_[_0xa24c('0x68')](_0x133567['loggedin'])?_[_0xa24c('0x68')](_0x133567[_0xa24c('0x6b')]):this[_0xa24c('0x10')][_0x133567['queue']][_0xa24c('0x6a')];this['emitVoiceQueueSummary'](this[_0xa24c('0x10')][_0x133567[_0xa24c('0x62')]],'queuesummary');}logger[_0xa24c('0x42')](_0xa24c('0x6c'),util['inspect'](this[_0xa24c('0x10')][_0x133567[_0xa24c('0x62')]],{'showHidden':![],'depth':null}));ami[_0xa24c('0x40')](_0xa24c('0x6d'),this[_0xa24c('0x10')][_0x133567[_0xa24c('0x62')]]);}}}catch(_0x3c98bb){logger[_0xa24c('0x37')]('[voiceQueueReport][queuesummary]',util['inspect'](_0x3c98bb,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa24c('0x2d')]['syncQueueSummaryComplete']=function(_0x3d0174){logger[_0xa24c('0x42')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util['inspect'](_0x3d0174,{'showHidden':![],'depth':null}));this['flagQueueSummary']=!![];};VoiceQueueReport[_0xa24c('0x2d')][_0xa24c('0x19')]=function(_0x3e3898){try{if(this[_0xa24c('0x61')](_0x3e3898)){logger[_0xa24c('0x42')](_0xa24c('0x6e'),_0x3e3898[_0xa24c('0x45')],util[_0xa24c('0x38')](_0x3e3898,{'showHidden':![],'depth':null}));if(_[_0xa24c('0x5e')](this['queueReports'][_0x3e3898['uniqueid']]))this['queueReports'][_0x3e3898[_0xa24c('0x45')]]=[];if(_['isUndefined'](this[_0xa24c('0xe')][_0x3e3898['uniqueid']]))this[_0xa24c('0xe')][_0x3e3898[_0xa24c('0x45')]]={};var _0x4d57e3=new QueueReport();_0x4d57e3[_0xa24c('0x47')]=_0x3e3898[_0xa24c('0x62')];_0x4d57e3[_0xa24c('0x4e')]=this[_0xa24c('0x10')][_0x4d57e3['name']]&&this[_0xa24c('0x10')][_0x4d57e3[_0xa24c('0x47')]][_0xa24c('0x4e')]?this[_0xa24c('0x10')][_0x4d57e3[_0xa24c('0x47')]][_0xa24c('0x4e')]||'inbound':'inbound';_0x4d57e3[_0xa24c('0x62')]=_0x3e3898[_0xa24c('0x62')];_0x4d57e3[_0xa24c('0x6f')]=moment()[_0xa24c('0x46')](_0xa24c('0x70'));_0x4d57e3[_0xa24c('0x71')]=_0x3e3898[_0xa24c('0x71')];_0x4d57e3['count']=_0x3e3898[_0xa24c('0x72')];_0x4d57e3['uniqueid']=_0x3e3898[_0xa24c('0x45')];_0x4d57e3['routealias']=this[_0xa24c('0xe')][_0x3e3898[_0xa24c('0x45')]][_0xa24c('0x73')];logger[_0xa24c('0x64')](_0xa24c('0x74'),_0x4d57e3[_0xa24c('0x47')],_0x4d57e3[_0xa24c('0x4e')]);_[_0xa24c('0x75')](_0x4d57e3,_[_0xa24c('0x76')](_0x3e3898,_[_0xa24c('0x77')](_0x4d57e3)));this[_0xa24c('0xc')][_0x3e3898[_0xa24c('0x45')]][_0xa24c('0x78')](_0x4d57e3);this[_0xa24c('0xe')][_0x3e3898[_0xa24c('0x45')]]=_0x4d57e3;this[_0xa24c('0x41')](_0x4d57e3,_0xa24c('0x18'));}}catch(_0x3215af){logger[_0xa24c('0x37')](_0xa24c('0x6e'),_0x3e3898[_0xa24c('0x45')],util[_0xa24c('0x38')](_0x3215af,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa24c('0x2d')][_0xa24c('0x79')]=function(_0x387296){try{if(this[_0xa24c('0x61')](_0x387296)){logger[_0xa24c('0x42')](_0xa24c('0x7a'),_0x387296[_0xa24c('0x45')],util['inspect'](_0x387296,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x387296[_0xa24c('0x45')]]){var _0x5806d6=_['last'](this[_0xa24c('0xc')][_0x387296[_0xa24c('0x45')]]);_0x5806d6[_0xa24c('0x7b')]=![];_0x5806d6['queuecallercompleteAt']=null;_0x5806d6[_0xa24c('0x7c')]=_0x387296[_0xa24c('0x7c')];_0x5806d6['originalposition']=_0x387296['originalposition'];_0x5806d6[_0xa24c('0x1a')]=!![];_0x5806d6[_0xa24c('0x7d')]=moment()[_0xa24c('0x46')]('YYYY-MM-DD\x20HH:mm:ss');_0x5806d6['queuecallerexitreason']=_0xa24c('0x7e');_0x5806d6[_0xa24c('0x7f')]=null;logger['info'](_0xa24c('0x80'),_0x5806d6['name'],_0x5806d6[_0xa24c('0x4e')]);this[_0xa24c('0xe')][_0x387296[_0xa24c('0x45')]]=_0x5806d6;this[_0xa24c('0x3e')](_0x5806d6,'queuecallerabandon');}}}catch(_0x23b61f){logger[_0xa24c('0x37')]('[%s][voiceQueueReport][queuecallerabandon]',_0x387296[_0xa24c('0x45')],util[_0xa24c('0x38')](_0x23b61f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa24c('0x2d')]['syncQueueCallerLeave']=function(_0x6cd71f){try{if(this[_0xa24c('0x61')](_0x6cd71f)){logger[_0xa24c('0x42')](_0xa24c('0x81'),_0x6cd71f['uniqueid'],util['inspect'](_0x6cd71f,{'showHidden':![],'depth':null}));if(this[_0xa24c('0xc')][_0x6cd71f[_0xa24c('0x45')]]){var _0x26df19=_[_0xa24c('0x82')](this[_0xa24c('0xc')][_0x6cd71f[_0xa24c('0x45')]]);_0x26df19['queuecallerleaveAt']=moment()[_0xa24c('0x46')](_0xa24c('0x70'));_0x26df19['connectedlinenum']=_0x6cd71f[_0xa24c('0x83')];_0x26df19['connectedlinename']=_0x6cd71f['connectedlinename'];logger[_0xa24c('0x64')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x26df19[_0xa24c('0x47')],_0x26df19[_0xa24c('0x4e')],_0x6cd71f[_0xa24c('0x83')],_0x6cd71f[_0xa24c('0x84')]);this[_0xa24c('0xe')][_0x6cd71f[_0xa24c('0x45')]]=_0x26df19;this[_0xa24c('0x41')](_0x26df19,'queuecallerleave');}}}catch(_0x2a7598){logger[_0xa24c('0x37')]('[%s][voiceQueueReport][queuecallerleave]',_0x6cd71f[_0xa24c('0x45')],util[_0xa24c('0x38')](_0x2a7598,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa24c('0x2d')][_0xa24c('0x85')]=function(_0x3025f4){try{if(this[_0xa24c('0x61')](_0x3025f4)){logger[_0xa24c('0x42')](_0xa24c('0x86'),_0x3025f4[_0xa24c('0x45')],util[_0xa24c('0x38')](_0x3025f4,{'showHidden':![],'depth':null}));if(this[_0xa24c('0xc')][_0x3025f4[_0xa24c('0x45')]]){var _0x237aae=_['last'](this[_0xa24c('0xc')][_0x3025f4[_0xa24c('0x45')]]);_0x237aae['queuecallercomplete']=!![];_0x237aae['queuecallerexitreason']=_0xa24c('0x87');logger['info']('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x237aae[_0xa24c('0x47')],_0x237aae['type']);}}}catch(_0x5100ed){logger[_0xa24c('0x37')](_0xa24c('0x86'),_0x3025f4[_0xa24c('0x45')],util[_0xa24c('0x38')](_0x5100ed,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa24c('0x2d')][_0xa24c('0x88')]=function(_0x4eef23){try{if(this[_0xa24c('0x61')](_0x4eef23)){logger[_0xa24c('0x42')](_0xa24c('0x89'),_0x4eef23[_0xa24c('0x45')],util[_0xa24c('0x38')](_0x4eef23,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x4eef23[_0xa24c('0x45')]]){var _0x960fe3=_['last'](this[_0xa24c('0xc')][_0x4eef23[_0xa24c('0x45')]]);_0x960fe3[_0xa24c('0x1a')]=![];_0x960fe3[_0xa24c('0x7d')]=null;_0x960fe3[_0xa24c('0x8a')]=!![];_0x960fe3[_0xa24c('0x7f')]=_0x4eef23[_0xa24c('0x8b')];_0x960fe3[_0xa24c('0x7c')]=_0x4eef23[_0xa24c('0x7c')];_0x960fe3['queuecallercomplete']=!![];_0x960fe3[_0xa24c('0x8c')]=![];_0x960fe3['queuecallerexitAt']=null;if(!_0x960fe3[_0xa24c('0x8d')]){if(_0x4eef23['reason']==_0xa24c('0x8d')){_0x960fe3[_0xa24c('0x8e')]='COMPLETED';logger['info'](_0xa24c('0x8f'),_0x960fe3[_0xa24c('0x47')],_0x960fe3[_0xa24c('0x4e')]);}else{if(_[_0xa24c('0x90')](_0x4eef23[_0xa24c('0x33')][_0xa24c('0x91')](),_0xa24c('0x92'))){if(this[_0xa24c('0xc')][_0x4eef23['linkedid']]){var _0xafd6=_['last'](this['queueReports'][_0x4eef23[_0xa24c('0x93')]]);_0xafd6[_0xa24c('0x7b')]=![];_0xafd6[_0xa24c('0x8c')]=!![];_0xafd6[_0xa24c('0x94')]=moment(_0x960fe3[_0xa24c('0x6f')])[_0xa24c('0x95')](_0x4eef23[_0xa24c('0x7c')],_0xa24c('0x96'))[_0xa24c('0x46')](_0xa24c('0x70'));_0xafd6[_0xa24c('0x8e')]=_0xa24c('0x97');_0xafd6[_0xa24c('0x8d')]=!![];_0xafd6[_0xa24c('0x98')]=_0xa24c('0x99');_0xafd6[_0xa24c('0x9a')]=_0x4eef23[_0xa24c('0x9b')];_0xafd6[_0xa24c('0x9c')]=_0x4eef23[_0xa24c('0x45')];logger[_0xa24c('0x64')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0xafd6[_0xa24c('0x47')],_0xafd6[_0xa24c('0x4e')]);var _0x17850a=this[_0xa24c('0xc')][_0x4eef23[_0xa24c('0x93')]];this[_0xa24c('0xc')][_0x4eef23[_0xa24c('0x93')]]=this[_0xa24c('0xc')][_0x4eef23[_0xa24c('0x45')]];this[_0xa24c('0xc')][_0x4eef23[_0xa24c('0x45')]]=_0x17850a;}}else{_0x960fe3[_0xa24c('0x8e')]=_0xa24c('0x9d')+_0x4eef23[_0xa24c('0x9e')][_0xa24c('0x9f')]();logger[_0xa24c('0x64')](_0xa24c('0xa0'),_0x960fe3[_0xa24c('0x47')],_0x960fe3[_0xa24c('0x4e')],_0x960fe3[_0xa24c('0x8e')]);}}}this['channels'][_0x4eef23[_0xa24c('0x45')]]=_0x960fe3;this[_0xa24c('0x3e')](_0x960fe3,_0xa24c('0x1c'));}}}catch(_0x4d3e75){logger[_0xa24c('0x37')](_0xa24c('0x89'),_0x4eef23['uniqueid'],util['inspect'](_0x4d3e75,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa24c('0x2d')][_0xa24c('0x1e')]=function(_0x11107a){try{if(this[_0xa24c('0x61')](_0x11107a)){logger[_0xa24c('0x42')]('[%s][voiceQueueReport][varset]',_0x11107a[_0xa24c('0x45')],util[_0xa24c('0x38')](_0x11107a,{'showHidden':![],'depth':null}));this[_0xa24c('0xa1')](_0x11107a[_0xa24c('0x45')],_['keys'](_0x11107a['variable'])[0x0],_0x11107a['value']);if(this[_0xa24c('0xc')][_0x11107a[_0xa24c('0x45')]]){var _0x49a71b=_[_0xa24c('0x82')](this['queueReports'][_0x11107a[_0xa24c('0x45')]]);if(_0x49a71b){if(this['isNotNull'](_0x11107a[_0xa24c('0xa2')])&&this[_0xa24c('0x61')](_0x11107a[_0xa24c('0xa2')][_0xa24c('0xa3')])){switch(_0x11107a['value']){case _0xa24c('0xa4'):_0x49a71b[_0xa24c('0x8c')]=![];_0x49a71b[_0xa24c('0x94')]=null;break;case _0xa24c('0xa5'):_0x49a71b['lastevent']=_0xa24c('0xa6');_0x49a71b['queuecallerexit']=!![];_0x49a71b[_0xa24c('0x94')]=moment()['format'](_0xa24c('0x70'));_0x49a71b[_0xa24c('0xa7')]=moment()[_0xa24c('0x46')](_0xa24c('0x70'));logger[_0xa24c('0x42')](_0xa24c('0xa8'),_0x11107a[_0xa24c('0x45')],util[_0xa24c('0x38')](_0x49a71b,{'showHidden':![],'depth':null}));ami[_0xa24c('0x40')]('custom:timeout',_0x49a71b);break;default:_0x49a71b[_0xa24c('0x8c')]=!![];_0x49a71b[_0xa24c('0x94')]=moment()['format'](_0xa24c('0x70'));_0x49a71b[_0xa24c('0xa7')]=moment()[_0xa24c('0x46')](_0xa24c('0x70'));}_0x49a71b[_0xa24c('0x1a')]=![];_0x49a71b['queuecallerabandonAt']=null;_0x49a71b[_0xa24c('0x8e')]=_0x11107a[_0xa24c('0xa9')];this[_0xa24c('0xe')][_0x11107a[_0xa24c('0x45')]]=_0x49a71b;this[_0xa24c('0x3e')](_0x49a71b,_0xa24c('0xaa'));}else if(this[_0xa24c('0x61')](_0x11107a[_0xa24c('0xa2')])&&this[_0xa24c('0x61')](_0x11107a[_0xa24c('0xa2')]['queueposition'])){if(!_0x49a71b[_0xa24c('0x1a')]){_0x49a71b[_0xa24c('0x8c')]=!![];_0x49a71b['queuecallerexitAt']=moment()[_0xa24c('0x46')](_0xa24c('0x70'));_0x49a71b['queuecallerexitreason']=_0xa24c('0xab');_0x49a71b[_0xa24c('0xa7')]=moment()['format'](_0xa24c('0x70'));this['channels'][_0x11107a[_0xa24c('0x45')]]=_0x49a71b;}}logger[_0xa24c('0x64')](_0xa24c('0xac'),_0x11107a[_0xa24c('0x45')],_0x49a71b['name'],_0x49a71b[_0xa24c('0x4e')],_[_0xa24c('0x77')](_0x11107a['variable'])[0x0],_0x11107a[_0xa24c('0xa9')]);_0x49a71b['variables']=this['variables'][_0x11107a[_0xa24c('0x45')]];}}}}catch(_0x534472){logger[_0xa24c('0x37')](_0xa24c('0xad'),_0x11107a[_0xa24c('0x45')],util[_0xa24c('0x38')](_0x534472,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa24c('0x2d')]['addVariable']=function(_0x5b3317,_0x212b92,_0xd20364){var _0x363d79=['rtpaudioqos','rtpaudioqosbridged',_0xa24c('0xae'),_0xa24c('0xaf'),_0xa24c('0xb0'),_0xa24c('0xb1'),'rtpaudioqosrtt',_0xa24c('0xb2'),_0xa24c('0xb3'),_0xa24c('0xb4'),_0xa24c('0xb5'),_0xa24c('0xb6'),_0xa24c('0xb7'),'memberdynamic',_0xa24c('0xb8'),_0xa24c('0xb9'),'membername','memberpenalty',_0xa24c('0xba')];if(!_[_0xa24c('0x30')](_0x212b92)&&!_[_0xa24c('0xbb')](_0x363d79,_0x212b92)){if(_[_0xa24c('0x5e')](this[_0xa24c('0x3a')][_0x5b3317])){this[_0xa24c('0x3a')][_0x5b3317]={};}this[_0xa24c('0x3a')][_0x5b3317][_0x212b92]=_0xd20364;}};VoiceQueueReport[_0xa24c('0x2d')][_0xa24c('0x20')]=function(_0x12eb9e){try{if(this[_0xa24c('0x61')](_0x12eb9e)){logger[_0xa24c('0x42')](_0xa24c('0xbc'),_0x12eb9e['uniqueid'],util[_0xa24c('0x38')](_0x12eb9e,{'showHidden':![],'depth':null}));if(this[_0xa24c('0xc')][_0x12eb9e[_0xa24c('0x45')]]){for(var _0x31ee65=0x0,_0x8473a0={};_0x31ee650x0?_0x3c1acb:0x0;this['voiceQueues'][_0x4dec7b['queue']][_0xa059('0x33')]=this['voiceQueues'][_0x4dec7b[_0xa059('0x66')]][_0xa059('0x33')]>_[_0xa059('0x6c')](_0x4dec7b[_0xa059('0x6e')])?_['toNumber'](_0x4dec7b['loggedin']):this[_0xa059('0x11')][_0x4dec7b[_0xa059('0x66')]][_0xa059('0x33')];this[_0xa059('0x51')](this['voiceQueues'][_0x4dec7b['queue']],'queuesummary');}logger['debug'](_0xa059('0x70'),util['inspect'](this[_0xa059('0x11')][_0x4dec7b['queue']],{'showHidden':![],'depth':null}));ami['emit']('custom:queuesummary',this[_0xa059('0x11')][_0x4dec7b[_0xa059('0x66')]]);}}}catch(_0x46615a){logger[_0xa059('0x3f')](_0xa059('0x65'),util[_0xa059('0x41')](_0x46615a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa059('0x38')]['syncQueueSummaryComplete']=function(_0x5d707e){logger[_0xa059('0x60')](_0xa059('0x71'),util[_0xa059('0x41')](_0x5d707e,{'showHidden':![],'depth':null}));this[_0xa059('0x12')]=!![];};VoiceQueueReport['prototype'][_0xa059('0x1b')]=function(_0x4f8e08){try{if(this[_0xa059('0x61')](_0x4f8e08)){logger[_0xa059('0x60')](_0xa059('0x72'),_0x4f8e08[_0xa059('0x49')],util['inspect'](_0x4f8e08,{'showHidden':![],'depth':null}));if(_[_0xa059('0x62')](this[_0xa059('0xe')][_0x4f8e08[_0xa059('0x49')]]))this[_0xa059('0xe')][_0x4f8e08[_0xa059('0x49')]]=[];if(_[_0xa059('0x62')](this[_0xa059('0x3b')][_0x4f8e08[_0xa059('0x49')]]))this[_0xa059('0x3b')][_0x4f8e08[_0xa059('0x49')]]={};var _0x1d0e87=new QueueReport();_0x1d0e87[_0xa059('0x4b')]=_0x4f8e08[_0xa059('0x66')];_0x1d0e87['type']=this[_0xa059('0x11')][_0x1d0e87[_0xa059('0x4b')]]&&this[_0xa059('0x11')][_0x1d0e87[_0xa059('0x4b')]][_0xa059('0x52')]?this[_0xa059('0x11')][_0x1d0e87[_0xa059('0x4b')]][_0xa059('0x52')]||_0xa059('0x53'):'inbound';_0x1d0e87[_0xa059('0x66')]=_0x4f8e08[_0xa059('0x66')];_0x1d0e87[_0xa059('0x73')]=moment()[_0xa059('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');_0x1d0e87[_0xa059('0x74')]=_0x4f8e08['position'];_0x1d0e87[_0xa059('0x75')]=_0x4f8e08[_0xa059('0x75')];_0x1d0e87[_0xa059('0x49')]=_0x4f8e08['uniqueid'];_0x1d0e87['routealias']=this['channels'][_0x4f8e08[_0xa059('0x49')]][_0xa059('0x76')];logger[_0xa059('0x68')](_0xa059('0x77'),_0x1d0e87[_0xa059('0x4b')],_0x1d0e87[_0xa059('0x52')]);_[_0xa059('0x78')](_0x1d0e87,_[_0xa059('0x79')](_0x4f8e08,_[_0xa059('0x7a')](_0x1d0e87)));this[_0xa059('0xe')][_0x4f8e08[_0xa059('0x49')]][_0xa059('0x7b')](_0x1d0e87);this[_0xa059('0x3b')][_0x4f8e08[_0xa059('0x49')]]=_0x1d0e87;this['emitVoiceQueueChannelSave'](_0x1d0e87,_0xa059('0x1a'));}}catch(_0x4d763f){logger['error'](_0xa059('0x72'),_0x4f8e08[_0xa059('0x49')],util[_0xa059('0x41')](_0x4d763f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa059('0x38')][_0xa059('0x1d')]=function(_0x5dbf13){try{if(this['isNotNull'](_0x5dbf13)){logger[_0xa059('0x60')]('[%s][voiceQueueReport][queuecallerabandon]',_0x5dbf13[_0xa059('0x49')],util[_0xa059('0x41')](_0x5dbf13,{'showHidden':![],'depth':null}));if(this[_0xa059('0xe')][_0x5dbf13['uniqueid']]){var _0x50ea3a=_[_0xa059('0x7c')](this[_0xa059('0xe')][_0x5dbf13[_0xa059('0x49')]]);_0x50ea3a['queuecallercomplete']=![];_0x50ea3a[_0xa059('0x7d')]=null;_0x50ea3a[_0xa059('0x7e')]=_0x5dbf13[_0xa059('0x7e')];_0x50ea3a[_0xa059('0x7f')]=_0x5dbf13[_0xa059('0x7f')];_0x50ea3a['queuecallerabandon']=!![];_0x50ea3a[_0xa059('0x80')]=moment()['format'](_0xa059('0x81'));_0x50ea3a['queuecallerexitreason']=_0xa059('0x82');_0x50ea3a[_0xa059('0x83')]=null;logger[_0xa059('0x68')](_0xa059('0x84'),_0x50ea3a[_0xa059('0x4b')],_0x50ea3a[_0xa059('0x52')]);this['channels'][_0x5dbf13[_0xa059('0x49')]]=_0x50ea3a;this['emitVoiceQueueChannelRemove'](_0x50ea3a,_0xa059('0x1c'));}}}catch(_0x1e56cf){logger[_0xa059('0x3f')](_0xa059('0x85'),_0x5dbf13[_0xa059('0x49')],util[_0xa059('0x41')](_0x1e56cf,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xa059('0x86')]=function(_0x43c2c1){try{if(this[_0xa059('0x61')](_0x43c2c1)){logger[_0xa059('0x60')](_0xa059('0x87'),_0x43c2c1['uniqueid'],util['inspect'](_0x43c2c1,{'showHidden':![],'depth':null}));if(this[_0xa059('0xe')][_0x43c2c1['uniqueid']]){var _0x42167f=_['last'](this['queueReports'][_0x43c2c1['uniqueid']]);_0x42167f[_0xa059('0x88')]=moment()[_0xa059('0x4e')](_0xa059('0x81'));_0x42167f[_0xa059('0x89')]=_0x43c2c1['connectedlinenum'];_0x42167f[_0xa059('0x8a')]=_0x43c2c1[_0xa059('0x8a')];logger[_0xa059('0x68')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x42167f['name'],_0x42167f[_0xa059('0x52')],_0x43c2c1[_0xa059('0x89')],_0x43c2c1[_0xa059('0x8a')]);this[_0xa059('0x3b')][_0x43c2c1['uniqueid']]=_0x42167f;this[_0xa059('0x46')](_0x42167f,_0xa059('0x1e'));}}}catch(_0xd8fe19){logger[_0xa059('0x3f')]('[%s][voiceQueueReport][queuecallerleave]',_0x43c2c1[_0xa059('0x49')],util['inspect'](_0xd8fe19,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa059('0x38')]['syncAgentConnect']=function(_0x1f2515){try{if(this['isNotNull'](_0x1f2515)){logger[_0xa059('0x60')](_0xa059('0x8b'),_0x1f2515[_0xa059('0x49')],util[_0xa059('0x41')](_0x1f2515,{'showHidden':![],'depth':null}));if(this[_0xa059('0xe')][_0x1f2515[_0xa059('0x49')]]){var _0x19dd16=_[_0xa059('0x7c')](this[_0xa059('0xe')][_0x1f2515[_0xa059('0x49')]]);_0x19dd16[_0xa059('0x8c')]=!![];_0x19dd16[_0xa059('0x8d')]=_0xa059('0x8e');logger[_0xa059('0x68')](_0xa059('0x8f'),_0x19dd16['name'],_0x19dd16[_0xa059('0x52')]);}}}catch(_0x10ad41){logger[_0xa059('0x3f')](_0xa059('0x8b'),_0x1f2515[_0xa059('0x49')],util[_0xa059('0x41')](_0x10ad41,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa059('0x38')][_0xa059('0x20')]=function(_0x46df66){try{if(this[_0xa059('0x61')](_0x46df66)){logger['debug'](_0xa059('0x90'),_0x46df66[_0xa059('0x49')],util['inspect'](_0x46df66,{'showHidden':![],'depth':null}));if(this[_0xa059('0xe')][_0x46df66[_0xa059('0x49')]]){var _0xb397d6=_[_0xa059('0x7c')](this[_0xa059('0xe')][_0x46df66[_0xa059('0x49')]]);_0xb397d6['queuecallerabandon']=![];_0xb397d6[_0xa059('0x80')]=null;_0xb397d6[_0xa059('0x91')]=!![];_0xb397d6[_0xa059('0x83')]=_0x46df66[_0xa059('0x92')];_0xb397d6['holdtime']=_0x46df66[_0xa059('0x7e')];_0xb397d6[_0xa059('0x8c')]=!![];_0xb397d6[_0xa059('0x93')]=![];_0xb397d6[_0xa059('0x94')]=null;if(!_0xb397d6[_0xa059('0x95')]){if(_0x46df66['reason']==_0xa059('0x95')){_0xb397d6[_0xa059('0x8d')]=_0xa059('0x96');logger[_0xa059('0x68')](_0xa059('0x97'),_0xb397d6['name'],_0xb397d6[_0xa059('0x52')]);}else{if(_[_0xa059('0x98')](_0x46df66[_0xa059('0x3e')][_0xa059('0x99')](),'local/')){if(this[_0xa059('0xe')][_0x46df66[_0xa059('0x9a')]]){var _0x56e797=_[_0xa059('0x7c')](this[_0xa059('0xe')][_0x46df66[_0xa059('0x9a')]]);_0x56e797['queuecallercomplete']=![];_0x56e797[_0xa059('0x93')]=!![];_0x56e797[_0xa059('0x94')]=moment(_0xb397d6[_0xa059('0x73')])[_0xa059('0x9b')](_0x46df66[_0xa059('0x7e')],_0xa059('0x9c'))['format']('YYYY-MM-DD\x20HH:mm:ss');_0x56e797[_0xa059('0x8d')]='FORWARDTRANSFER';_0x56e797['transfer']=!![];_0x56e797['transfertype']=_0xa059('0x9d');_0x56e797[_0xa059('0x9e')]=_0x46df66[_0xa059('0x9f')];_0x56e797['transferuniqueid']=_0x46df66[_0xa059('0x49')];logger['info'](_0xa059('0xa0'),_0x56e797[_0xa059('0x4b')],_0x56e797[_0xa059('0x52')]);var _0x448309=this['queueReports'][_0x46df66[_0xa059('0x9a')]];this[_0xa059('0xe')][_0x46df66[_0xa059('0x9a')]]=this[_0xa059('0xe')][_0x46df66['uniqueid']];this[_0xa059('0xe')][_0x46df66[_0xa059('0x49')]]=_0x448309;}}else{_0xb397d6[_0xa059('0x8d')]='COMPLETEDBY'+_0x46df66[_0xa059('0xa1')][_0xa059('0xa2')]();logger[_0xa059('0x68')](_0xa059('0xa3'),_0xb397d6[_0xa059('0x4b')],_0xb397d6[_0xa059('0x52')],_0xb397d6[_0xa059('0x8d')]);}}}this[_0xa059('0x3b')][_0x46df66['uniqueid']]=_0xb397d6;this[_0xa059('0x44')](_0xb397d6,'agentcomplete');}}}catch(_0x23c4ac){logger[_0xa059('0x3f')](_0xa059('0x90'),_0x46df66[_0xa059('0x49')],util['inspect'](_0x23c4ac,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa059('0x38')][_0xa059('0x23')]=function(_0x2b1637){try{if(this[_0xa059('0x61')](_0x2b1637)){logger[_0xa059('0x60')](_0xa059('0xa4'),_0x2b1637['uniqueid'],util[_0xa059('0x41')](_0x2b1637,{'showHidden':![],'depth':null}));this[_0xa059('0xa5')](_0x2b1637[_0xa059('0x49')],_[_0xa059('0x7a')](_0x2b1637['variable'])[0x0],_0x2b1637[_0xa059('0xa6')]);if(this[_0xa059('0xe')][_0x2b1637[_0xa059('0x49')]]){var _0x43f4cb=_['last'](this[_0xa059('0xe')][_0x2b1637[_0xa059('0x49')]]);if(_0x43f4cb){if(this['isNotNull'](_0x2b1637[_0xa059('0xa7')])&&this[_0xa059('0x61')](_0x2b1637[_0xa059('0xa7')][_0xa059('0xa8')])){switch(_0x2b1637[_0xa059('0xa6')]){case'CONTINUE':_0x43f4cb[_0xa059('0x93')]=![];_0x43f4cb[_0xa059('0x94')]=null;break;case _0xa059('0xa9'):_0x43f4cb[_0xa059('0xaa')]='timeout';_0x43f4cb[_0xa059('0x93')]=!![];_0x43f4cb[_0xa059('0x94')]=moment()['format'](_0xa059('0x81'));_0x43f4cb[_0xa059('0x88')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');logger[_0xa059('0x60')]('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x2b1637[_0xa059('0x49')],util[_0xa059('0x41')](_0x43f4cb,{'showHidden':![],'depth':null}));ami[_0xa059('0x4c')](_0xa059('0xab'),_0x43f4cb);break;default:_0x43f4cb['queuecallerexit']=!![];_0x43f4cb['queuecallerexitAt']=moment()[_0xa059('0x4e')](_0xa059('0x81'));_0x43f4cb['queuecallerleaveAt']=moment()[_0xa059('0x4e')](_0xa059('0x81'));}_0x43f4cb[_0xa059('0x1c')]=![];_0x43f4cb[_0xa059('0x80')]=null;_0x43f4cb[_0xa059('0x8d')]=_0x2b1637[_0xa059('0xa6')];this[_0xa059('0x3b')][_0x2b1637[_0xa059('0x49')]]=_0x43f4cb;this['emitVoiceQueueChannelRemove'](_0x43f4cb,_0xa059('0x22'));}else if(this[_0xa059('0x61')](_0x2b1637[_0xa059('0xa7')])&&this[_0xa059('0x61')](_0x2b1637[_0xa059('0xa7')][_0xa059('0xac')])){if(!_0x43f4cb[_0xa059('0x1c')]){_0x43f4cb[_0xa059('0x93')]=!![];_0x43f4cb[_0xa059('0x94')]=moment()[_0xa059('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');_0x43f4cb[_0xa059('0x8d')]=_0xa059('0xad');_0x43f4cb[_0xa059('0x88')]=moment()[_0xa059('0x4e')](_0xa059('0x81'));this['channels'][_0x2b1637[_0xa059('0x49')]]=_0x43f4cb;}}logger[_0xa059('0x68')](_0xa059('0xae'),_0x2b1637['uniqueid'],_0x43f4cb[_0xa059('0x4b')],_0x43f4cb[_0xa059('0x52')],_[_0xa059('0x7a')](_0x2b1637[_0xa059('0xa7')])[0x0],_0x2b1637[_0xa059('0xa6')]);_0x43f4cb[_0xa059('0x14')]=this[_0xa059('0x14')][_0x2b1637['uniqueid']];}}}}catch(_0x430040){logger['error'](_0xa059('0xa4'),_0x2b1637[_0xa059('0x49')],util[_0xa059('0x41')](_0x430040,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa059('0x38')][_0xa059('0xa5')]=function(_0x5660db,_0x308a35,_0x3a090b){var _0x21e9ee=['rtpaudioqos',_0xa059('0xaf'),_0xa059('0xb0'),_0xa059('0xb1'),_0xa059('0xb2'),_0xa059('0xb3'),_0xa059('0xb4'),_0xa059('0xb5'),_0xa059('0xb6'),_0xa059('0xb7'),_0xa059('0xb8'),'bridgepvtcallid',_0xa059('0xb9'),'memberdynamic',_0xa059('0xba'),_0xa059('0xbb'),_0xa059('0x92'),_0xa059('0xbc'),'memberrealtime'];if(!_[_0xa059('0xbd')](_0x308a35)&&!_[_0xa059('0xbe')](_0x21e9ee,_0x308a35)){if(_['isUndefined'](this[_0xa059('0x14')][_0x5660db])){this[_0xa059('0x14')][_0x5660db]={};}this[_0xa059('0x14')][_0x5660db][_0x308a35]=_0x3a090b;}};VoiceQueueReport[_0xa059('0x38')][_0xa059('0xbf')]=function(_0x250227){try{if(this[_0xa059('0x61')](_0x250227)){logger['debug'](_0xa059('0xc0'),_0x250227[_0xa059('0x49')],util[_0xa059('0x41')](_0x250227,{'showHidden':![],'depth':null}));if(this[_0xa059('0xe')][_0x250227[_0xa059('0x49')]]){for(var _0xcd4ca1=0x0,_0x24c534={};_0xcd4ca1=0x0?moment(_0x399e49[_0xff0f('0x15')])['diff'](_0x399e49[_0xff0f('0x14')],_0xff0f('0xc')):null,'data1':'outbound','data2':_0x399e49[_0xff0f('0x11')],'data3':_0x399e49['exten'],'data4':_0x399e49['dialstring']||null,'role':_0xff0f('0x10'),'internal':_0x399e49[_0xff0f('0x11')]?_['toNumber'](_0x399e49[_0xff0f('0x11')]):undefined,'uniqueid':_0x399e49[_0xff0f('0x17')]},'log':'CreateMemberReport'});}; \ No newline at end of file +var _0x5804=['queuecallercompleteAt','queuecallerexitAt','Request','voice','lastAssignedTo','isNil','interface','format','SIP/%s','TALKING','queuecallerleaveAt','diff','seconds','inbound','calleridnum','agent','accountcode','uniqueid','CreateMemberReport','voiceDialReport','starttime','endtime','exten','dialstring','toNumber','lodash','util','../client','voiceQueueReport'];(function(_0x52cbe0,_0x332b2e){var _0x4bb9da=function(_0x4f8008){while(--_0x4f8008){_0x52cbe0['push'](_0x52cbe0['shift']());}};_0x4bb9da(++_0x332b2e);}(_0x5804,0x8d));var _0x4580=function(_0x303064,_0x12f0c2){_0x303064=_0x303064-0x0;var _0x5a1d3d=_0x5804[_0x303064];return _0x5a1d3d;};'use strict';var moment=require('moment');var _=require(_0x4580('0x0'));var util=require(_0x4580('0x1'));var client=require(_0x4580('0x2'));exports[_0x4580('0x3')]=function(_0x29f00f){var _0x482612=_0x29f00f[_0x4580('0x4')]||_0x29f00f[_0x4580('0x5')];return client[_0x4580('0x6')]('CreateMemberReport',{'body':{'channel':_0x4580('0x7'),'membername':_0x29f00f[_0x4580('0x8')],'interface':_[_0x4580('0x9')](_0x29f00f[_0x4580('0xa')])?util[_0x4580('0xb')](_0x4580('0xc'),_0x29f00f[_0x4580('0x8')]):_0x29f00f[_0x4580('0xa')],'type':_0x4580('0xd'),'enterAt':_0x29f00f[_0x4580('0xe')],'exitAt':_0x482612,'duration':moment(_0x482612)[_0x4580('0xf')](_0x29f00f['queuecallerleaveAt'],_0x4580('0x10')),'data1':_0x4580('0x11'),'data2':_0x29f00f[_0x4580('0x12')],'data3':_0x29f00f['exten'],'data4':null,'data5':_0x29f00f['queue'],'role':_0x4580('0x13'),'internal':_0x29f00f[_0x4580('0x14')]?_['toNumber'](_0x29f00f[_0x4580('0x14')]):undefined,'uniqueid':_0x29f00f[_0x4580('0x15')]},'log':_0x4580('0x16')});};exports[_0x4580('0x17')]=function(_0x5b3067){return client[_0x4580('0x6')]('CreateMemberReport',{'body':{'channel':_0x4580('0x7'),'membername':_0x5b3067['membername'],'interface':_0x5b3067[_0x4580('0xa')],'type':_0x4580('0xd'),'enterAt':_0x5b3067[_0x4580('0x18')],'exitAt':_0x5b3067[_0x4580('0x19')],'duration':moment(_0x5b3067[_0x4580('0x19')])[_0x4580('0xf')](_0x5b3067['starttime'],_0x4580('0x10'))>=0x0?moment(_0x5b3067[_0x4580('0x19')])[_0x4580('0xf')](_0x5b3067['starttime'],_0x4580('0x10')):null,'data1':'outbound','data2':_0x5b3067['accountcode'],'data3':_0x5b3067[_0x4580('0x1a')],'data4':_0x5b3067[_0x4580('0x1b')]||null,'role':_0x4580('0x13'),'internal':_0x5b3067[_0x4580('0x14')]?_[_0x4580('0x1c')](_0x5b3067[_0x4580('0x14')]):undefined,'uniqueid':_0x5b3067[_0x4580('0x15')]},'log':_0x4580('0x16')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index f1464e3..9c8e4ff 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 _0x8048=['ShowSetting','previewRecallmeReminderInterval','GetSettings','getSettings','Request'];(function(_0x50c4eb,_0x5a3123){var _0x1bfa43=function(_0x78880){while(--_0x78880){_0x50c4eb['push'](_0x50c4eb['shift']());}};_0x1bfa43(++_0x5a3123);}(_0x8048,0x166));var _0x8804=function(_0x3554de,_0x1c1680){_0x3554de=_0x3554de-0x0;var _0x469d4b=_0x8048[_0x3554de];return _0x469d4b;};'use strict';var client=require('../client');exports[_0x8804('0x0')]=function(){return client[_0x8804('0x1')](_0x8804('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer',_0x8804('0x3')]},'log':_0x8804('0x4')});}; \ No newline at end of file +var _0x68b7=['../client','Request','ShowSetting','stopRecordingOnTransfer','GetSettings'];(function(_0x5b05a7,_0xe0e196){var _0xe210f2=function(_0x7bafff){while(--_0x7bafff){_0x5b05a7['push'](_0x5b05a7['shift']());}};_0xe210f2(++_0xe0e196);}(_0x68b7,0x8c));var _0x768b=function(_0x366e4b,_0xb07e79){_0x366e4b=_0x366e4b-0x0;var _0x2d2420=_0x68b7[_0x366e4b];return _0x2d2420;};'use strict';var client=require(_0x768b('0x0'));exports['getSettings']=function(){return client[_0x768b('0x1')](_0x768b('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x768b('0x3'),'previewRecallmeReminderInterval']},'log':_0x768b('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 6dfa9a1..3e8b7fa 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 _0x8286=['../client','getTemplates','Request','GetTemplate','name','html'];(function(_0x3f9b16,_0x2e96ee){var _0x10354c=function(_0x2025da){while(--_0x2025da){_0x3f9b16['push'](_0x3f9b16['shift']());}};_0x10354c(++_0x2e96ee);}(_0x8286,0x66));var _0x6828=function(_0x1f0842,_0x24d1f8){_0x1f0842=_0x1f0842-0x0;var _0x5dd60f=_0x8286[_0x1f0842];return _0x5dd60f;};'use strict';var client=require(_0x6828('0x0'));exports[_0x6828('0x1')]=function(_0x3859e1){return function(_0x24e248){return client[_0x6828('0x2')](_0x6828('0x3'),{'options':{'raw':!![],'attributes':['id',_0x6828('0x4'),_0x6828('0x5')]},'log':_0x6828('0x3')});};}; \ No newline at end of file +var _0x4a14=['GetTemplate','html','../client','getTemplates','Request'];(function(_0x282a1f,_0x49a6ef){var _0x296ea7=function(_0x4bac68){while(--_0x4bac68){_0x282a1f['push'](_0x282a1f['shift']());}};_0x296ea7(++_0x49a6ef);}(_0x4a14,0x115));var _0x44a1=function(_0x31213d,_0x3aab87){_0x31213d=_0x31213d-0x0;var _0x115578=_0x4a14[_0x31213d];return _0x115578;};'use strict';var client=require(_0x44a1('0x0'));exports[_0x44a1('0x1')]=function(_0x2e6b25){return function(_0xbeb148){return client[_0x44a1('0x2')](_0x44a1('0x3'),{'options':{'raw':!![],'attributes':['id','name',_0x44a1('0x4')]},'log':_0x44a1('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 2e63b06..607ee9d 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 _0x56d6=['Condition','AnyConditions','Action','data1','data2','data3','data5','data7','../client','getTriggers','Request','GetTrigger','name','channel','AllConditions','field','operator','value'];(function(_0x7d0219,_0x407576){var _0xb10a40=function(_0x17fd47){while(--_0x17fd47){_0x7d0219['push'](_0x7d0219['shift']());}};_0xb10a40(++_0x407576);}(_0x56d6,0xf2));var _0x656d=function(_0x44db18,_0x3e9447){_0x44db18=_0x44db18-0x0;var _0x4d4496=_0x56d6[_0x44db18];return _0x4d4496;};'use strict';var client=require(_0x656d('0x0'));exports[_0x656d('0x1')]=function(_0x587681){return function(_0xea740f){return client[_0x656d('0x2')](_0x656d('0x3'),{'options':{'raw':![],'attributes':['id',_0x656d('0x4'),_0x656d('0x5'),'status'],'include':[{'model':'Condition','as':_0x656d('0x6'),'attributes':['id',_0x656d('0x7'),_0x656d('0x8'),_0x656d('0x9')]},{'model':_0x656d('0xa'),'as':_0x656d('0xb'),'attributes':['id',_0x656d('0x7'),'operator',_0x656d('0x9')]},{'model':_0x656d('0xc'),'as':'Actions','attributes':['id','action',_0x656d('0xd'),_0x656d('0xe'),_0x656d('0xf'),'data4',_0x656d('0x10'),'data6',_0x656d('0x11')]}]},'log':_0x656d('0x3')});};}; \ No newline at end of file +var _0xab6a=['value','AnyConditions','Actions','action','data3','data4','data5','data6','data7','GetTrigger','../client','getTriggers','Request','name','status','Condition','AllConditions','field','operator'];(function(_0x59b09b,_0x188900){var _0x29f686=function(_0x20f2dc){while(--_0x20f2dc){_0x59b09b['push'](_0x59b09b['shift']());}};_0x29f686(++_0x188900);}(_0xab6a,0xee));var _0xaab6=function(_0x4e5ceb,_0x222af9){_0x4e5ceb=_0x4e5ceb-0x0;var _0x4916c8=_0xab6a[_0x4e5ceb];return _0x4916c8;};'use strict';var client=require(_0xaab6('0x0'));exports[_0xaab6('0x1')]=function(_0x293a6b){return function(_0x2cb09a){return client[_0xaab6('0x2')]('GetTrigger',{'options':{'raw':![],'attributes':['id',_0xaab6('0x3'),'channel',_0xaab6('0x4')],'include':[{'model':_0xaab6('0x5'),'as':_0xaab6('0x6'),'attributes':['id',_0xaab6('0x7'),_0xaab6('0x8'),_0xaab6('0x9')]},{'model':'Condition','as':_0xaab6('0xa'),'attributes':['id','field',_0xaab6('0x8'),_0xaab6('0x9')]},{'model':'Action','as':_0xaab6('0xb'),'attributes':['id',_0xaab6('0xc'),'data1','data2',_0xaab6('0xd'),_0xaab6('0xe'),_0xaab6('0xf'),_0xaab6('0x10'),_0xaab6('0x11')]}]},'log':_0xaab6('0x12')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index d0390a1..6884e1f 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 _0x34e8=['../client','getTrunks','GetTrunk','name','registry','defaultuser'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x34e8,0x12c));var _0x834e=function(_0x3f809a,_0x7dba1a){_0x3f809a=_0x3f809a-0x0;var _0x10aaa8=_0x34e8[_0x3f809a];return _0x10aaa8;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(_0x8b339){return function(_0x35e6fb){return client['Request'](_0x834e('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x834e('0x3'),_0x834e('0x4'),_0x834e('0x5')]},'log':_0x834e('0x2')});};}; \ No newline at end of file +var _0x406e=['Request','GetTrunk','registry','../client'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0x406e,0x16b));var _0xe406=function(_0x47ab49,_0xa90550){_0x47ab49=_0x47ab49-0x0;var _0x152a96=_0x406e[_0x47ab49];return _0x152a96;};'use strict';var client=require(_0xe406('0x0'));exports['getTrunks']=function(_0xa64460){return function(_0x5797ff){return client[_0xe406('0x1')](_0xe406('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0xe406('0x3'),'defaultuser']},'log':_0xe406('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 33c6454..9f808fd 100644 --- a/server/services/ami/rpc/user.js +++ b/server/services/ami/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['agent','lastPauseAt','interface','../client','getAgents','Request','name','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','phone','mobile','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'lastPauseAt',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'interface']},'log':'getAgents'});};};exports[_0x0a9e('0xc')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':!![],'where':{'role':_0x0a9e('0xd')},'attributes':['id',_0x0a9e('0x3'),_0x0a9e('0x4'),_0x0a9e('0xe')]},'log':_0x0a9e('0xc')});};};exports[_0x0a9e('0xf')]=function(_0x4a4c56,_0x50dfb2,_0x527cdd){return client['Request'](_0x0a9e('0x10'),{'body':{'type':_0x50dfb2,'uniqueid':_0x527cdd},'options':{'where':{'id':_0x4a4c56['id']}},'log':_0x0a9e('0xf')});};exports[_0x0a9e('0x11')]=function(_0x26d672){return client[_0x0a9e('0x2')](_0x0a9e('0x12'),{'body':{},'options':{'where':{'id':_0x26d672['id']}},'log':'savePause'});};exports[_0x0a9e('0x13')]=function(_0x239b12){return client[_0x0a9e('0x2')](_0x0a9e('0x14'),{'options':{'raw':![],'where':{'role':_0x0a9e('0x15'),'id':_0x239b12},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),'fullname',_0x0a9e('0x6'),'lastLoginAt',_0x0a9e('0x8'),_0x0a9e('0x16'),'voicePause',_0x0a9e('0x17')]},'log':'getAgent'});}; \ No newline at end of file +var _0x70e0=['getAgents','Request','name','email','accountcode','fullname','lastLoginAt','lastPauseAt','interface','getTelephones','GetUser','telephone','savePause','PauseUser','saveUnpause','getAgent','agent','online','pauseType','../client'];(function(_0x197062,_0x19fa90){var _0x281046=function(_0x22bd7a){while(--_0x22bd7a){_0x197062['push'](_0x197062['shift']());}};_0x281046(++_0x19fa90);}(_0x70e0,0x17b));var _0x070e=function(_0x4b6f19,_0x301c32){_0x4b6f19=_0x4b6f19-0x0;var _0x49b085=_0x70e0[_0x4b6f19];return _0x49b085;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5'),_0x070e('0x6'),'online',_0x070e('0x7'),'pauseType',_0x070e('0x8'),'voicePause','phone','mobile',_0x070e('0x9')]},'log':_0x070e('0x1')});};};exports[_0x070e('0xa')]=function(){return function(){return client[_0x070e('0x2')](_0x070e('0xb'),{'options':{'raw':!![],'where':{'role':_0x070e('0xc')},'attributes':['id',_0x070e('0x3'),'accountcode','internal']},'log':_0x070e('0xa')});};};exports[_0x070e('0xd')]=function(_0x12bb37,_0xb8d819,_0xa927a2){return client[_0x070e('0x2')](_0x070e('0xe'),{'body':{'type':_0xb8d819,'uniqueid':_0xa927a2},'options':{'where':{'id':_0x12bb37['id']}},'log':_0x070e('0xd')});};exports[_0x070e('0xf')]=function(_0x5bf079){return client[_0x070e('0x2')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5bf079['id']}},'log':'savePause'});};exports[_0x070e('0x10')]=function(_0x56c7ba){return client['Request']('ShowUser',{'options':{'raw':![],'where':{'role':_0x070e('0x11'),'id':_0x56c7ba},'attributes':['id',_0x070e('0x3'),'email','accountcode',_0x070e('0x6'),_0x070e('0x12'),_0x070e('0x7'),_0x070e('0x13'),'lastPauseAt','voicePause',_0x070e('0x9')]},'log':_0x070e('0x10')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index d96206d..da04e3c 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 _0xceaf=['../client','create','Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport'];(function(_0x4dab14,_0x164ea0){var _0xf41aa=function(_0x305d50){while(--_0x305d50){_0x4dab14['push'](_0x4dab14['shift']());}};_0xf41aa(++_0x164ea0);}(_0xceaf,0x72));var _0xfcea=function(_0x562197,_0x194fcf){_0x562197=_0x562197-0x0;var _0x2a57be=_0xceaf[_0x562197];return _0x2a57be;};'use strict';var client=require(_0xfcea('0x0'));exports[_0xfcea('0x1')]=function(_0x3ae9e0){return client[_0xfcea('0x2')](_0xfcea('0x3'),{'body':_0x3ae9e0,'log':_0xfcea('0x3')});};exports[_0xfcea('0x4')]=function(_0x14d984,_0x13286f,_0x2049a6){return client[_0xfcea('0x2')](_0xfcea('0x5'),{'body':_0x14d984,'options':{'where':{'uniqueid':_0x13286f,'interface':_0x2049a6,'agentcomplete':!![]}},'log':_0xfcea('0x5')});}; \ No newline at end of file +var _0xf644=['create','CreateVoiceAgentReport','Request','UpdateVoiceAgentReport','../client'];(function(_0x326b16,_0x4f499f){var _0xe13f1b=function(_0x585d9a){while(--_0x585d9a){_0x326b16['push'](_0x326b16['shift']());}};_0xe13f1b(++_0x4f499f);}(_0xf644,0x1f3));var _0x4f64=function(_0x31e99a,_0x5c082f){_0x31e99a=_0x31e99a-0x0;var _0x2fa767=_0xf644[_0x31e99a];return _0x2fa767;};'use strict';var client=require(_0x4f64('0x0'));exports[_0x4f64('0x1')]=function(_0x14b43c){return client['Request'](_0x4f64('0x2'),{'body':_0x14b43c,'log':_0x4f64('0x2')});};exports['update']=function(_0x586bdc,_0x499610,_0x4a347e){return client[_0x4f64('0x3')](_0x4f64('0x4'),{'body':_0x586bdc,'options':{'where':{'uniqueid':_0x499610,'interface':_0x4a347e,'agentcomplete':!![]}},'log':_0x4f64('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index c90ed32..3d425e2 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 _0x218f=['create','CreateVoiceCallReport','merge','calleridnum','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','disposition','duration','billableseconds','GetVoiceCallReports','moment','util'];(function(_0x2bd2d5,_0x2f5564){var _0x4e016f=function(_0x120709){while(--_0x120709){_0x2bd2d5['push'](_0x2bd2d5['shift']());}};_0x4e016f(++_0x2f5564);}(_0x218f,0x152));var _0xf218=function(_0x1042aa,_0x4fff7c){_0x1042aa=_0x1042aa-0x0;var _0x35fb56=_0x218f[_0x1042aa];return _0x35fb56;};'use strict';var moment=require(_0xf218('0x0'));var util=require(_0xf218('0x1'));var _=require('lodash');var client=require('../client');exports[_0xf218('0x2')]=function(_0x571ac0){return client['Request'](_0xf218('0x3'),{'body':_[_0xf218('0x4')](_0x571ac0,{'source':_0x571ac0[_0xf218('0x5')],'destinationcontext':_0x571ac0['context'],'callerid':_0x571ac0[_0xf218('0x6')],'amaflags':_0xf218('0x7')}),'log':_0xf218('0x3')});};exports[_0xf218('0x8')]=function(){return function(){return client['Request'](_0xf218('0x9'),{'options':{'where':{'type':[_0xf218('0xa')],'createdAt':{'$between':[moment()[_0xf218('0xb')](_0xf218('0xc'))[_0xf218('0xd')](_0xf218('0xe')),moment()[_0xf218('0xf')]('day')[_0xf218('0xd')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':['type',_0xf218('0x10'),_0xf218('0x11'),_0xf218('0x12')]},'log':_0xf218('0x13')});};}; \ No newline at end of file +var _0x8194=['disposition','duration','billableseconds','GetVoiceCallReports','moment','util','lodash','../client','create','Request','CreateVoiceCallReport','context','callerid','DOCUMENTATION','GetVoiceCallReport','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0x8194,0x1e7));var _0x4819=function(_0x22887c,_0x59e7df){_0x22887c=_0x22887c-0x0;var _0x4d3caa=_0x8194[_0x22887c];return _0x4d3caa;};'use strict';var moment=require(_0x4819('0x0'));var util=require(_0x4819('0x1'));var _=require(_0x4819('0x2'));var client=require(_0x4819('0x3'));exports[_0x4819('0x4')]=function(_0x37a25e){return client[_0x4819('0x5')](_0x4819('0x6'),{'body':_['merge'](_0x37a25e,{'source':_0x37a25e['calleridnum'],'destinationcontext':_0x37a25e[_0x4819('0x7')],'callerid':_0x37a25e[_0x4819('0x8')],'amaflags':_0x4819('0x9')}),'log':_0x4819('0x6')});};exports['getVoiceCallReports']=function(){return function(){return client['Request'](_0x4819('0xa'),{'options':{'where':{'type':[_0x4819('0xb')],'createdAt':{'$between':[moment()[_0x4819('0xc')](_0x4819('0xd'))[_0x4819('0xe')](_0x4819('0xf')),moment()[_0x4819('0x10')](_0x4819('0xd'))['format'](_0x4819('0xf'))]}},'attributes':['type',_0x4819('0x11'),_0x4819('0x12'),_0x4819('0x13')]},'log':_0x4819('0x14')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 43049f3..6f24273 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 _0x630a=['CreateVoiceDialReport','../client','create','Request'];(function(_0x3ca4b0,_0x6fe3bd){var _0x20416d=function(_0x5a6a2c){while(--_0x5a6a2c){_0x3ca4b0['push'](_0x3ca4b0['shift']());}};_0x20416d(++_0x6fe3bd);}(_0x630a,0x18d));var _0xa630=function(_0x25fc41,_0x250864){_0x25fc41=_0x25fc41-0x0;var _0x1371d1=_0x630a[_0x25fc41];return _0x1371d1;};'use strict';var client=require(_0xa630('0x0'));exports[_0xa630('0x1')]=function(_0x2c8ca6){return client[_0xa630('0x2')](_0xa630('0x3'),{'body':_0x2c8ca6,'log':'CreateVoiceDialReport'});}; \ No newline at end of file +var _0x4304=['CreateVoiceDialReport','create','Request'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x4304,0xe5));var _0x4430=function(_0x51604c,_0x463aa9){_0x51604c=_0x51604c-0x0;var _0x3e7541=_0x4304[_0x51604c];return _0x3e7541;};'use strict';var client=require('../client');exports[_0x4430('0x0')]=function(_0x4dc69c){return client[_0x4430('0x1')](_0x4430('0x2'),{'body':_0x4dc69c,'log':_0x4430('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 215345b..a144511 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 _0x54ef=['getVoiceExtensions','Request','exten','recordingFormat','../client'];(function(_0x14e9f0,_0x287f90){var _0xa63f7e=function(_0x4829d6){while(--_0x4829d6){_0x14e9f0['push'](_0x14e9f0['shift']());}};_0xa63f7e(++_0x287f90);}(_0x54ef,0x112));var _0xf54e=function(_0x11481a,_0x300a6d){_0x11481a=_0x11481a-0x0;var _0x328895=_0x54ef[_0x11481a];return _0x328895;};'use strict';var client=require(_0xf54e('0x0'));exports[_0xf54e('0x1')]=function(){return function(){return client[_0xf54e('0x2')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0xf54e('0x3'),_0xf54e('0x4')],'where':{'VoiceExtensionId':null}},'log':_0xf54e('0x1')});};}; \ No newline at end of file +var _0xd66c=['exten','recordingFormat','../client','Request','GetVoiceExtension'];(function(_0x352e21,_0x97e2b){var _0x1966e5=function(_0x430062){while(--_0x430062){_0x352e21['push'](_0x352e21['shift']());}};_0x1966e5(++_0x97e2b);}(_0xd66c,0x106));var _0xcd66=function(_0x428785,_0x4dea91){_0x428785=_0x428785-0x0;var _0xc84047=_0xd66c[_0x428785];return _0xc84047;};'use strict';var client=require(_0xcd66('0x0'));exports['getVoiceExtensions']=function(){return function(){return client[_0xcd66('0x1')](_0xcd66('0x2'),{'options':{'raw':!![],'attributes':['id',_0xcd66('0x3'),_0xcd66('0x4')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index dc41591..bfac3b7 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 _0x43c4=['dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewRecallmeReminder','Trunk','callerid','active','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','../client','getVoiceQueues','name','autopause','monitor_format','dialActive','dialMethod','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry'];(function(_0x2fd8d6,_0x54834d){var _0x5d2a6f=function(_0x4ba749){while(--_0x4ba749){_0x2fd8d6['push'](_0x2fd8d6['shift']());}};_0x5d2a6f(++_0x54834d);}(_0x43c4,0x8b));var _0x443c=function(_0x23908a,_0x241fb9){_0x23908a=_0x23908a-0x0;var _0x3f8c0a=_0x43c4[_0x23908a];return _0x3f8c0a;};'use strict';var client=require(_0x443c('0x0'));exports[_0x443c('0x1')]=function(){return function(){return client['Request']('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0x443c('0x2'),'acw','acwTimeout',_0x443c('0x3'),_0x443c('0x4'),'type',_0x443c('0x5'),_0x443c('0x6'),_0x443c('0x7'),'dialLimitQueue',_0x443c('0x8'),_0x443c('0x9'),_0x443c('0xa'),'dialPredictiveInterval',_0x443c('0xb'),_0x443c('0xc'),_0x443c('0xd'),_0x443c('0xe'),_0x443c('0xf'),_0x443c('0x10'),_0x443c('0x11'),'dialCongestionRetryFrequency',_0x443c('0x12'),'dialBusyRetryFrequency',_0x443c('0x13'),_0x443c('0x14'),_0x443c('0x15'),'dialTimezone',_0x443c('0x16'),_0x443c('0x17'),_0x443c('0x18'),_0x443c('0x19'),_0x443c('0x1a'),_0x443c('0x1b'),'dialAMDAfterGreetingSilence',_0x443c('0x1c'),'dialAMDMinWordLength',_0x443c('0x1d'),'dialAMDMaximumNumberOfWords',_0x443c('0x1e'),_0x443c('0x1f'),_0x443c('0x20'),_0x443c('0x21'),_0x443c('0x22'),_0x443c('0x23'),_0x443c('0x24'),_0x443c('0x25'),_0x443c('0x26'),'monitor_format',_0x443c('0x27'),_0x443c('0x28'),_0x443c('0x29'),_0x443c('0x2a'),_0x443c('0x2b'),_0x443c('0x2c'),_0x443c('0x2d'),_0x443c('0x2e'),_0x443c('0x2f'),_0x443c('0x30'),'dialMachineRetryFrequency',_0x443c('0x31'),_0x443c('0x32'),_0x443c('0x33'),_0x443c('0x34'),_0x443c('0x35'),'dialPreviewAutoRecallMe',_0x443c('0x36')],'include':[{'model':_0x443c('0x37'),'as':_0x443c('0x37'),'attributes':['id','name',_0x443c('0x38'),_0x443c('0x39')]},{'model':'Pause','as':_0x443c('0x3a'),'attributes':['id',_0x443c('0x2')]},{'model':_0x443c('0x37'),'as':_0x443c('0x3b'),'attributes':['id',_0x443c('0x2'),_0x443c('0x38'),_0x443c('0x39')]},{'model':_0x443c('0x3c'),'as':_0x443c('0x3c'),'attributes':['id',_0x443c('0x2')],'include':[{'model':_0x443c('0x3c'),'as':_0x443c('0x3d'),'attributes':['id','name','interval']}]}]},'log':_0x443c('0x1')});};}; \ No newline at end of file +var _0xcc56=['dialLimitChannel','dialLimitQueue','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialCheckDuplicateType','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','callerid','active','Pause','mandatoryDispositionPause','Interval','interval','getVoiceQueues','GetVoiceQueue','name','acwTimeout','autopause','monitor_format','type','dialActive'];(function(_0x3804ea,_0x47dcd7){var _0xf1e766=function(_0x2beac1){while(--_0x2beac1){_0x3804ea['push'](_0x3804ea['shift']());}};_0xf1e766(++_0x47dcd7);}(_0xcc56,0x76));var _0x6cc5=function(_0x4f2b8c,_0x4012c8){_0x4f2b8c=_0x4f2b8c-0x0;var _0x1226ae=_0xcc56[_0x4f2b8c];return _0x1226ae;};'use strict';var client=require('../client');exports[_0x6cc5('0x0')]=function(){return function(){return client['Request'](_0x6cc5('0x1'),{'options':{'raw':![],'attributes':['id',_0x6cc5('0x2'),'acw',_0x6cc5('0x3'),_0x6cc5('0x4'),_0x6cc5('0x5'),_0x6cc5('0x6'),_0x6cc5('0x7'),'dialMethod',_0x6cc5('0x8'),_0x6cc5('0x9'),'dialPowerLevel',_0x6cc5('0xa'),_0x6cc5('0xb'),_0x6cc5('0xc'),'dialOriginateCallerIdName',_0x6cc5('0xd'),_0x6cc5('0xe'),_0x6cc5('0xf'),_0x6cc5('0x10'),_0x6cc5('0x11'),'dialCongestionMaxRetry',_0x6cc5('0x12'),_0x6cc5('0x13'),_0x6cc5('0x14'),'dialNoAnswerMaxRetry',_0x6cc5('0x15'),_0x6cc5('0x16'),_0x6cc5('0x17'),_0x6cc5('0x18'),'dialPrefix',_0x6cc5('0x19'),_0x6cc5('0x1a'),'dialAMDInitialSilence',_0x6cc5('0x1b'),_0x6cc5('0x1c'),_0x6cc5('0x1d'),_0x6cc5('0x1e'),_0x6cc5('0x1f'),_0x6cc5('0x20'),_0x6cc5('0x21'),_0x6cc5('0x22'),_0x6cc5('0x23'),_0x6cc5('0x24'),_0x6cc5('0x25'),_0x6cc5('0x26'),_0x6cc5('0x27'),_0x6cc5('0x28'),_0x6cc5('0x29'),_0x6cc5('0x5'),'strategy',_0x6cc5('0x2a'),_0x6cc5('0x2b'),_0x6cc5('0x2c'),_0x6cc5('0x2d'),'dialDropMaxRetry',_0x6cc5('0x2e'),_0x6cc5('0x2f'),_0x6cc5('0x30'),_0x6cc5('0x31'),'dialMachineRetryFrequency',_0x6cc5('0x32'),_0x6cc5('0x33'),_0x6cc5('0x34'),_0x6cc5('0x35'),'dialPredictiveIntervalMinThreshold',_0x6cc5('0x36'),_0x6cc5('0x37')],'include':[{'model':'Trunk','as':_0x6cc5('0x38'),'attributes':['id','name',_0x6cc5('0x39'),_0x6cc5('0x3a')]},{'model':_0x6cc5('0x3b'),'as':_0x6cc5('0x3c'),'attributes':['id',_0x6cc5('0x2')]},{'model':_0x6cc5('0x38'),'as':'TrunkBackup','attributes':['id',_0x6cc5('0x2'),_0x6cc5('0x39'),_0x6cc5('0x3a')]},{'model':_0x6cc5('0x3d'),'as':_0x6cc5('0x3d'),'attributes':['id',_0x6cc5('0x2')],'include':[{'model':_0x6cc5('0x3d'),'as':'Intervals','attributes':['id',_0x6cc5('0x2'),_0x6cc5('0x3e')]}]}]},'log':_0x6cc5('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 11eacf0..07452b4 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(_0x537a42,_0x1e6a99){var _0x2ed48b=function(_0x32d0fb){while(--_0x32d0fb){_0x537a42['push'](_0x537a42['shift']());}};_0x2ed48b(++_0x1e6a99);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'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(_0x320fb7,_0x58b0e9){var _0x2d1b2a=function(_0xf2e511){while(--_0xf2e511){_0x320fb7['push'](_0x320fb7['shift']());}};_0x2d1b2a(++_0x58b0e9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'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 17e4345..ea882f8 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 _0x4c25=['../client','getVoiceQueueRtPauses','GetVoiceQueueRtPauses'];(function(_0x50c2fc,_0x523d92){var _0x206ffd=function(_0x28cc3d){while(--_0x28cc3d){_0x50c2fc['push'](_0x50c2fc['shift']());}};_0x206ffd(++_0x523d92);}(_0x4c25,0xc9));var _0x54c2=function(_0xab2afb,_0x546bfb){_0xab2afb=_0xab2afb-0x0;var _0x25262b=_0x4c25[_0xab2afb];return _0x25262b;};'use strict';var client=require(_0x54c2('0x0'));exports[_0x54c2('0x1')]=function(_0x719263){return function(){return client['Request'](_0x54c2('0x2'),{'options':{'where':{'VoiceQueueId':_0x719263,'paused':!![]},'raw':!![]},'log':_0x54c2('0x1')});};}; \ No newline at end of file +var _0x7ef6=['Request','GetVoiceQueueRtPauses','getVoiceQueueRtPauses'];(function(_0x19a206,_0x1d7556){var _0x7514ac=function(_0xaddeaa){while(--_0xaddeaa){_0x19a206['push'](_0x19a206['shift']());}};_0x7514ac(++_0x1d7556);}(_0x7ef6,0x19a));var _0x67ef=function(_0x11d58c,_0x1ae5ce){_0x11d58c=_0x11d58c-0x0;var _0xeb167d=_0x7ef6[_0x11d58c];return _0xeb167d;};'use strict';var client=require('../client');exports[_0x67ef('0x0')]=function(_0xb7fc34){return function(){return client[_0x67ef('0x1')](_0x67ef('0x2'),{'options':{'where':{'VoiceQueueId':_0xb7fc34,'paused':!![]},'raw':!![]},'log':_0x67ef('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index c355f7b..0e1fb42 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 _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0xdea54c,_0x2d64f1){var _0xbb5438=function(_0xe78620){while(--_0xe78620){_0xdea54c['push'](_0xdea54c['shift']());}};_0xbb5438(++_0x2d64f1);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file +var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x38d70b,_0x2ef19b){var _0xea58f1=function(_0x3c65fe){while(--_0x3c65fe){_0x38d70b['push'](_0x38d70b['shift']());}};_0xea58f1(++_0x2ef19b);}(_0x7a54,0x106));var _0x47a5=function(_0x4c5530,_0x10ff1e){_0x4c5530=_0x4c5530-0x0;var _0x4d9b44=_0x7a54[_0x4c5530];return _0x4d9b44;};'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 8285690..bcba42f 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 _0x3f02=['transfereelinkedid','isexternal','context','extension','blind','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinename','origtransferercontext','origtransfererexten','attended','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x3f02,0x171));var _0x23f0=function(_0xc0638b,_0x2fccf4){_0xc0638b=_0xc0638b-0x0;var _0xd57dfa=_0x3f02[_0xc0638b];return _0xd57dfa;};'use strict';var client=require(_0x23f0('0x0'));exports[_0x23f0('0x1')]={};exports[_0x23f0('0x2')]=function(_0x145ac5){return client[_0x23f0('0x3')](_0x23f0('0x4'),{'body':{'result':_0x145ac5[_0x23f0('0x5')],'transfererchannel':_0x145ac5['transfererchannel'],'transferercalleridnum':_0x145ac5['transferercalleridnum'],'transferercalleridname':_0x145ac5[_0x23f0('0x6')],'transfererconnectedlinenum':_0x145ac5[_0x23f0('0x7')],'transfererconnectedlinename':_0x145ac5[_0x23f0('0x8')],'transfereraccountcode':_0x145ac5[_0x23f0('0x9')],'transferercontext':_0x145ac5[_0x23f0('0xa')],'transfererexten':_0x145ac5[_0x23f0('0xb')],'transfererlinkedid':_0x145ac5[_0x23f0('0xc')],'transfereechannel':_0x145ac5[_0x23f0('0xd')],'transfereecalleridnum':_0x145ac5[_0x23f0('0xe')],'transfereecalleridname':_0x145ac5[_0x23f0('0xf')],'transfereeconnectedlinenum':_0x145ac5[_0x23f0('0x10')],'transfereeconnectedlinename':_0x145ac5[_0x23f0('0x11')],'transfereeaccountcode':_0x145ac5[_0x23f0('0x12')],'transfereecontext':_0x145ac5[_0x23f0('0x13')],'transfereeexten':_0x145ac5[_0x23f0('0x14')],'transfereelinkedid':_0x145ac5[_0x23f0('0x15')],'isexternal':_0x145ac5[_0x23f0('0x16')],'context':_0x145ac5[_0x23f0('0x17')],'extension':_0x145ac5[_0x23f0('0x18')],'type':_0x23f0('0x19')},'log':_0x23f0('0x4')});};exports['attendedTransfer']=function(_0x13ff1a){return client[_0x23f0('0x3')](_0x23f0('0x4'),{'body':{'result':_0x13ff1a[_0x23f0('0x5')],'transfererchannel':_0x13ff1a['origtransfererchannel'],'transferercalleridnum':_0x13ff1a[_0x23f0('0x1a')],'transferercalleridname':_0x13ff1a[_0x23f0('0x1b')],'transfererconnectedlinenum':_0x13ff1a['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x13ff1a[_0x23f0('0x1c')],'transfereraccountcode':_0x13ff1a[_0x23f0('0x1d')],'transferercontext':_0x13ff1a['secondtransferercontext'],'transfererexten':_0x13ff1a[_0x23f0('0x1e')],'transfererlinkedid':_0x13ff1a[_0x23f0('0x1f')],'transfereechannel':_0x13ff1a[_0x23f0('0x20')],'transfereecalleridnum':_0x13ff1a[_0x23f0('0x21')],'transfereecalleridname':_0x13ff1a[_0x23f0('0x22')],'transfereeconnectedlinenum':_0x13ff1a['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x13ff1a[_0x23f0('0x23')],'transfereeaccountcode':_0x13ff1a['transfertargetaccountcode'],'transfereecontext':_0x13ff1a['transfertargetcontext'],'transfereeexten':_0x13ff1a['transfertargetexten'],'transfereelinkedid':_0x13ff1a['transfertargetlinkedid'],'isexternal':_0x13ff1a[_0x23f0('0x16')],'context':_0x13ff1a[_0x23f0('0x24')],'extension':_0x13ff1a[_0x23f0('0x25')],'type':_0x23f0('0x26')},'log':_0x23f0('0x4')});}; \ No newline at end of file +var _0xc64e=['transfererchannel','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinename','transfereeaccountcode','transfereeexten','transfereelinkedid','isexternal','context','attendedTransfer','Request','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetlinkedid','origtransferercontext','origtransfererexten','CreateVoiceTransferReport','../client'];(function(_0x7d5c7a,_0x12c749){var _0x14b416=function(_0x1efc35){while(--_0x1efc35){_0x7d5c7a['push'](_0x7d5c7a['shift']());}};_0x14b416(++_0x12c749);}(_0xc64e,0x180));var _0xec64=function(_0x10bebb,_0x2f25ed){_0x10bebb=_0x10bebb-0x0;var _0x1240f6=_0xc64e[_0x10bebb];return _0x1240f6;};'use strict';var client=require(_0xec64('0x0'));exports['transfers']={};exports['blindTransfer']=function(_0x166201){return client['Request']('CreateVoiceTransferReport',{'body':{'result':_0x166201['result'],'transfererchannel':_0x166201[_0xec64('0x1')],'transferercalleridnum':_0x166201['transferercalleridnum'],'transferercalleridname':_0x166201[_0xec64('0x2')],'transfererconnectedlinenum':_0x166201[_0xec64('0x3')],'transfererconnectedlinename':_0x166201[_0xec64('0x4')],'transfereraccountcode':_0x166201[_0xec64('0x5')],'transferercontext':_0x166201[_0xec64('0x6')],'transfererexten':_0x166201[_0xec64('0x7')],'transfererlinkedid':_0x166201['transfererlinkedid'],'transfereechannel':_0x166201[_0xec64('0x8')],'transfereecalleridnum':_0x166201[_0xec64('0x9')],'transfereecalleridname':_0x166201[_0xec64('0xa')],'transfereeconnectedlinenum':_0x166201['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x166201[_0xec64('0xb')],'transfereeaccountcode':_0x166201[_0xec64('0xc')],'transfereecontext':_0x166201['transfereecontext'],'transfereeexten':_0x166201[_0xec64('0xd')],'transfereelinkedid':_0x166201[_0xec64('0xe')],'isexternal':_0x166201[_0xec64('0xf')],'context':_0x166201[_0xec64('0x10')],'extension':_0x166201['extension'],'type':'blind'},'log':'CreateVoiceTransferReport'});};exports[_0xec64('0x11')]=function(_0x20b23d){return client[_0xec64('0x12')]('CreateVoiceTransferReport',{'body':{'result':_0x20b23d['result'],'transfererchannel':_0x20b23d[_0xec64('0x13')],'transferercalleridnum':_0x20b23d[_0xec64('0x14')],'transferercalleridname':_0x20b23d['origtransferercalleridname'],'transfererconnectedlinenum':_0x20b23d[_0xec64('0x15')],'transfererconnectedlinename':_0x20b23d[_0xec64('0x16')],'transfereraccountcode':_0x20b23d[_0xec64('0x17')],'transferercontext':_0x20b23d['secondtransferercontext'],'transfererexten':_0x20b23d[_0xec64('0x18')],'transfererlinkedid':_0x20b23d[_0xec64('0x19')],'transfereechannel':_0x20b23d[_0xec64('0x1a')],'transfereecalleridnum':_0x20b23d[_0xec64('0x1b')],'transfereecalleridname':_0x20b23d['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x20b23d[_0xec64('0x1c')],'transfereeconnectedlinename':_0x20b23d[_0xec64('0x1d')],'transfereeaccountcode':_0x20b23d['transfertargetaccountcode'],'transfereecontext':_0x20b23d[_0xec64('0x1e')],'transfereeexten':_0x20b23d['transfertargetexten'],'transfereelinkedid':_0x20b23d[_0xec64('0x1f')],'isexternal':_0x20b23d[_0xec64('0xf')],'context':_0x20b23d[_0xec64('0x20')],'extension':_0x20b23d[_0xec64('0x21')],'type':'attended'},'log':_0xec64('0x22')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 367d86d..db8c658 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 _0x13f5=['predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','push','length','find','undefined','channels','uniqueid','channel','format','%s.%s','filename','wav','MixMonitor','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','voicechannel','map','resolve','StopMixMonitor','catch','destinationchannel','monitors','stop','StopMixMonitor\x20Success','values','queueChannels','voicequeuechannel','exten','context','telephones','outbound','campaigns','run','emit','event','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','moment','../ami','listen','%s/%s','SIP','name','timers','timer','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','username','join','keys','module','action','Reload','Action','message','ami\x20disconnected','command','Command','then','voiceQueues','answered','available','pTalking','sumHoldTime','talking','total','type','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate'];(function(_0x5e5ae4,_0xb1052d){var _0x230242=function(_0x1ac4ae){while(--_0x1ac4ae){_0x5e5ae4['push'](_0x5e5ae4['shift']());}};_0x230242(++_0xb1052d);}(_0x13f5,0xc3));var _0x513f=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x13f5[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0x513f('0x0'));var util=require(_0x513f('0x1'));var jayson=require(_0x513f('0x2'));var schema=require(_0x513f('0x3'));var BPromise=require('bluebird');var moment=require(_0x513f('0x4'));var config=require('../../../config/environment');var properties=require('../properties');var ami=require(_0x513f('0x5'));exports[_0x513f('0x6')]=function(_0x3a9531,_0x3a6320,_0x8d019b){return new BPromise(function(_0x579681,_0x2be368){var _0x6e5b15={'QueuePause':function(_0x2c75a3){return new Promise(function(_0x42951f,_0x1975b5){var _0x4755cb=util['format'](_0x513f('0x7'),_0x513f('0x8'),_0x2c75a3[_0x513f('0x9')]);if(_0x3a9531[_0x513f('0xa')]&&_0x3a9531[_0x513f('0xa')][_0x4755cb]&&_0x3a9531['timers'][_0x4755cb][_0x513f('0xb')]){_0x3a9531[_0x513f('0xa')][_0x4755cb]['updateAcw']();}if(_0x3a9531[_0x513f('0xc')][_0x4755cb]){_0x3a9531[_0x513f('0xc')][_0x4755cb][_0x513f('0xd')]({'statePause':_0x2c75a3[_0x513f('0xe')]?!![]:![]});}_0x42951f({'code':0xc8,'message':_0x513f('0xf')});});},'Reload':function(_0xfb8469){var _0x2a0e99=this;return new Promise(function(_0x265cd7,_0x23153b){if(ami[_0x513f('0x10')]()==![]){return _0x23153b(_0x2a0e99[_0x513f('0x11')](0x1f4,[config[_0x513f('0x12')]['ip'],config[_0x513f('0x12')][_0x513f('0x13')],'ami\x20disconnected'][_0x513f('0x14')]('\x20')));}_0xfb8469=_['pick'](_0xfb8469,_[_0x513f('0x15')](properties[_0x513f('0x16')]));_0xfb8469[_0x513f('0x17')]=_0x513f('0x18');return ami[_0x513f('0x19')](_0xfb8469)['then'](function(_0x4e7dd3){_0x265cd7({'code':0xc8,'message':_0x4e7dd3[_0x513f('0x1a')]});})['catch'](function(_0x186121){_0x23153b(_0x2a0e99['error'](0x1f5,_0x186121[_0x513f('0x1a')]));});});},'Command':function(_0x1d4462){var _0x511ae0=this;return new Promise(function(_0x2a461f,_0x37ccea){if(ami[_0x513f('0x10')]()==![]){return _0x37ccea(_0x511ae0[_0x513f('0x11')](0x1f4,[config[_0x513f('0x12')]['ip'],config[_0x513f('0x12')]['username'],_0x513f('0x1b')][_0x513f('0x14')]('\x20')));}_0x1d4462=_['pick'](_0x1d4462,_0x513f('0x1c'));_0x1d4462[_0x513f('0x17')]=_0x513f('0x1d');return ami[_0x513f('0x19')](_0x1d4462)[_0x513f('0x1e')](function(_0x1eb0f4){_0x2a461f({'code':0xc8,'message':_0x1eb0f4['content']});})['catch'](function(_0x59de20){_0x37ccea(_0x511ae0[_0x513f('0x11')](0x1f5,_0x59de20[_0x513f('0x1a')]));});});},'VoiceQueues':function(_0xc3fa6f){return new Promise(function(_0x1069d4,_0x2191d4){var _0xabb40b=[];for(var _0x1624d2 in _0x3a9531[_0x513f('0x1f')]){if(_0x3a9531[_0x513f('0x1f')]['hasOwnProperty'](_0x1624d2)){var _0x509e63=_0x3a9531[_0x513f('0x1f')][_0x1624d2];var _0x27136f={'id':_0x509e63['id'],'name':_0x509e63[_0x513f('0x9')],'strategy':_0x509e63['strategy'],'answered':_0x509e63[_0x513f('0x20')],'available':_0x509e63[_0x513f('0x21')],'loggedIn':_0x509e63['loggedIn'],'pTalking':_0x509e63[_0x513f('0x22')],'sumBillable':_0x509e63['sumBillable'],'sumDuration':_0x509e63['sumDuration'],'sumHoldTime':_0x509e63[_0x513f('0x23')]||0x0,'talking':_0x509e63[_0x513f('0x24')],'total':_0x509e63[_0x513f('0x25')],'type':_0x509e63[_0x513f('0x26')],'unmanaged':_0x509e63['unmanaged'],'abandoned':_0x509e63[_0x513f('0x27')],'waiting':_0x509e63[_0x513f('0x28')],'loggedInDb':_0x509e63[_0x513f('0x29')]};if(_0x509e63[_0x513f('0x26')]==='outbound'){_0x27136f[_0x513f('0x2a')]=_0x509e63[_0x513f('0x2a')];_0x27136f[_0x513f('0x2b')]=_0x509e63[_0x513f('0x2b')];_0x27136f[_0x513f('0x2c')]=_0x509e63[_0x513f('0x2c')];_0x27136f['dialOriginateCallerIdNumber']=_0x509e63['dialOriginateCallerIdNumber'];_0x27136f[_0x513f('0x2d')]=_0x509e63[_0x513f('0x2d')];_0x27136f['dialPrefix']=_0x509e63['dialPrefix'];_0x27136f[_0x513f('0x2e')]=_0x509e63[_0x513f('0x2e')];_0x27136f[_0x513f('0x2f')]=_0x509e63['outboundAnswerAgiCallsDay'];_0x27136f[_0x513f('0x30')]=_0x509e63[_0x513f('0x30')];_0x27136f['outboundBlacklistCallsDay']=_0x509e63[_0x513f('0x31')];_0x27136f[_0x513f('0x32')]=_0x509e63[_0x513f('0x32')];_0x27136f[_0x513f('0x33')]=_0x509e63[_0x513f('0x33')];_0x27136f[_0x513f('0x34')]=_0x509e63[_0x513f('0x34')];_0x27136f[_0x513f('0x35')]=_0x509e63[_0x513f('0x35')];_0x27136f['outboundDropCallsDayTimeout']=_0x509e63[_0x513f('0x36')];_0x27136f['outboundNoAnswerCallsDay']=_0x509e63['outboundNoAnswerCallsDay'];_0x27136f[_0x513f('0x37')]=_0x509e63['outboundNoSuchCallsDay'];_0x27136f[_0x513f('0x38')]=_0x509e63[_0x513f('0x38')];_0x27136f['outboundReCallsDay']=_0x509e63[_0x513f('0x39')];_0x27136f['outboundRejectCallsDay']=_0x509e63['outboundRejectCallsDay'];_0x27136f[_0x513f('0x3a')]=_0x509e63[_0x513f('0x3a')];_0x27136f[_0x513f('0x3b')]=_0x509e63[_0x513f('0x3b')];_0x27136f[_0x513f('0x3c')]=_0x509e63['predictiveIntervalAvgHoldtime'];_0x27136f[_0x513f('0x3d')]=_0x509e63[_0x513f('0x3d')];_0x27136f['predictiveIntervalDroppedCallsCallersExit']=_0x509e63[_0x513f('0x3e')];_0x27136f[_0x513f('0x3f')]=_0x509e63[_0x513f('0x3f')];_0x27136f[_0x513f('0x40')]=_0x509e63[_0x513f('0x40')];_0x27136f['predictiveIntervalErlangCallsDroppedCalls']=_0x509e63[_0x513f('0x41')];_0x27136f[_0x513f('0x42')]=_0x509e63[_0x513f('0x42')];_0x27136f[_0x513f('0x43')]=_0x509e63['predictiveIntervalMultiplicativeFactor'];_0x27136f['predictiveIntervalPauses']=_0x509e63[_0x513f('0x44')];_0x27136f[_0x513f('0x45')]=_0x509e63[_0x513f('0x45')];_0x27136f[_0x513f('0x46')]=_0x509e63['predictiveIntervalTotalCalls'];_0x27136f['message']=_0x509e63[_0x513f('0x1a')];_0x27136f[_0x513f('0x47')]=_0x509e63[_0x513f('0x47')];_0x27136f[_0x513f('0x48')]=_0x509e63[_0x513f('0x48')];_0x27136f['erlangCallToSecond']=_0x509e63[_0x513f('0x49')];_0x27136f[_0x513f('0x4a')]=_0x509e63[_0x513f('0x4a')];_0x27136f['erlangBusyFactor']=_0x509e63[_0x513f('0x4b')];_0x27136f[_0x513f('0x4c')]=_0x509e63['startPredictive'];_0x27136f[_0x513f('0x4d')]=_0x509e63[_0x513f('0x4d')];}if(_0x509e63[_0x513f('0x4e')]){_0x27136f[_0x513f('0x4e')]={'id':_0x509e63[_0x513f('0x4e')]['id'],'name':_0x509e63['Trunk'][_0x513f('0x9')],'active':_0x509e63[_0x513f('0x4e')][_0x513f('0x4f')],'callerid':_0x509e63[_0x513f('0x4e')]['callerid']};}if(_0x509e63['Interval']){_0x27136f[_0x513f('0x50')]={'id':_0x509e63[_0x513f('0x50')]['id'],'name':_0x509e63[_0x513f('0x50')][_0x513f('0x9')]};}_0xabb40b[_0x513f('0x51')](_0x27136f);}}_0x1069d4({'count':_0xabb40b[_0x513f('0x52')],'rows':_0xabb40b});});},'UpdateVoiceQueue':function(_0x25b71b){return new Promise(function(_0x5a8988,_0x3dc022){var _0xa06dcb=_[_0x513f('0x53')](_0x3a9531['voiceQueues'],{'id':parseInt(_0x25b71b['id'])});var _0x1f21d2=_['omit'](_0x25b71b,['id']);if(_0xa06dcb){for(var _0x45263f in _0x1f21d2){if(typeof _0x1f21d2[_0x45263f]!=='undefined'&&typeof _0xa06dcb[_0x45263f]!==_0x513f('0x54')){_0xa06dcb[_0x45263f]=_0x1f21d2[_0x45263f];}}_0x5a8988(_0xa06dcb);}else{_0x3dc022();}});},'VoiceChannels':function(_0x4d2489){return new Promise(function(_0x202fa4,_0x43be3e){var _0x5e1076=_['values'](_0x3a9531[_0x513f('0x55')]);_0x202fa4({'count':_0x5e1076['length'],'rows':_0x5e1076});});},'VoiceChannelMixMonitor':function(_0x3495b2){var _0x216cb4=this;return new Promise(function(_0x52af64,_0x236ae6){if(ami[_0x513f('0x10')]()==![]){return _0x236ae6(_0x216cb4['error'](0x1f4,[config[_0x513f('0x12')]['ip'],config[_0x513f('0x12')]['username'],_0x513f('0x1b')]['join']('\x20')));}var _0x1a3d47=schema(properties['voicechannel'])[_0x513f('0x3')](_0x3495b2);if(_0x1a3d47['length']>0x0){return _0x236ae6(_0x216cb4[_0x513f('0x11')](0x1f4,_['map'](_0x1a3d47,_0x513f('0x1a'))['join'](',\x20')));}var _0xd7cf8=_['find'](_0x3a9531['channels'],{'uniqueid':_0x3495b2[_0x513f('0x56')]});if(_0xd7cf8&&_0xd7cf8[_0x513f('0x57')]){var _0x4a3b48=util[_0x513f('0x58')](_0x513f('0x59'),_0x3495b2[_0x513f('0x5a')]||_0x3495b2['uniqueid'],_0x3495b2[_0x513f('0x58')]||_0x513f('0x5b'));return ami[_0x513f('0x19')]({'action':_0x513f('0x5c'),'channel':_0xd7cf8['channel'],'file':_0x4a3b48,'options':_0x513f('0x5d')})[_0x513f('0x1e')](function(_0x4e8fe1){var _0x3d8649=_[_0x513f('0x53')](_0xd7cf8['monitors'],{'filename':_0x513f('0x5e')+_0x4a3b48[_0x513f('0x5f')]()});if(_['isNil'](_0x3d8649)){_0xd7cf8['monitors']['push']({'filename':_0x513f('0x5e')+_0x4a3b48['toLowerCase'](),'createdAt':moment()['format'](_0x513f('0x60')),'mixmonitorid':_0x4e8fe1[_0x513f('0x61')],'status':_0x513f('0x62')});}else{_0x3d8649[_0x513f('0x61')]=_0x4e8fe1[_0x513f('0x61')];_0x3d8649[_0x513f('0x63')]=_0x513f('0x62');}_0x52af64({'code':0xc8,'message':[_0x3495b2['uniqueid'],_0x513f('0x64'),_0x4e8fe1[_0x513f('0x61')]][_0x513f('0x14')]('\x20'),'mixmonitorid':_0x4e8fe1['mixmonitorid']});})['catch'](function(_0x1b273b){_0x236ae6(_0x216cb4[_0x513f('0x11')](0x1f5,[_0x3495b2[_0x513f('0x56')],_0x1b273b[_0x513f('0x1a')][_0x513f('0x5f')]()]['join']('\x20')));});}else{return _0x236ae6(_0x216cb4[_0x513f('0x11')](0x1f5,_0x513f('0x65')));}});},'VoiceChannelStopMixMonitor':function(_0x13b307){var _0xbbd05e=this;return new Promise(function(_0x17e9e1,_0x4dc7e8){if(ami['isConnected']()==![]){return _0x4dc7e8(_0xbbd05e[_0x513f('0x11')](0x1f4,[config[_0x513f('0x12')]['ip'],config[_0x513f('0x12')][_0x513f('0x13')],_0x513f('0x1b')]['join']('\x20')));}var _0x265cd9=schema(properties[_0x513f('0x66')])['validate'](_0x13b307);if(_0x265cd9[_0x513f('0x52')]>0x0){return _0x4dc7e8(_0xbbd05e[_0x513f('0x11')](0x1f4,_[_0x513f('0x67')](_0x265cd9,_0x513f('0x1a'))[_0x513f('0x14')](',\x20')));}var _0x5cedfb=_['find'](_0x3a9531[_0x513f('0x55')],{'uniqueid':_0x13b307[_0x513f('0x56')]});if(_0x5cedfb){return BPromise[_0x513f('0x68')]()[_0x513f('0x1e')](function(){if(_0x5cedfb[_0x513f('0x57')]){return ami[_0x513f('0x19')]({'action':_0x513f('0x69'),'channel':_0x5cedfb[_0x513f('0x57')],'mixmonitorid':_0x13b307[_0x513f('0x61')]})[_0x513f('0x6a')](function(_0x38b746){});}})[_0x513f('0x1e')](function(){if(_0x5cedfb[_0x513f('0x6b')]){return ami[_0x513f('0x19')]({'action':_0x513f('0x69'),'channel':_0x5cedfb[_0x513f('0x6b')],'mixmonitorid':_0x13b307[_0x513f('0x61')]})[_0x513f('0x6a')](function(_0x4a6122){});}})[_0x513f('0x1e')](function(_0xfaa42f){var _0x31ef24=_[_0x513f('0x53')](_0x5cedfb['monitors'],{'mixmonitorid':_0x13b307[_0x513f('0x61')]});if(_0x31ef24){_0x31ef24[_0x513f('0x63')]='stop';}})[_0x513f('0x1e')](function(){var _0x2c238b=util['format']('%s.%s',_0x13b307[_0x513f('0x5a')]||_0x13b307['uniqueid'],_0x13b307[_0x513f('0x58')]||'wav');var _0x20ee10=_[_0x513f('0x53')](_0x5cedfb[_0x513f('0x6c')],{'filename':_0x513f('0x5e')+_0x2c238b[_0x513f('0x5f')]()});if(_0x20ee10){_0x20ee10['status']=_0x513f('0x6d');}})['then'](function(){_0x17e9e1({'code':0xc8,'message':[_0x13b307[_0x513f('0x56')],_0x513f('0x6e')]['join']('\x20')});})[_0x513f('0x6a')](function(_0x13352b){_0x4dc7e8(_0xbbd05e[_0x513f('0x11')](0x1f5,[_0x13b307[_0x513f('0x56')],_0x13352b['message']['toLowerCase']()][_0x513f('0x14')]('\x20')));});}else{return _0x4dc7e8(_0xbbd05e['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0x2f025b){return new Promise(function(_0x5c2352,_0x235daa){var _0x3d8012=_[_0x513f('0x6f')](_0x3a9531[_0x513f('0x70')]);_0x5c2352({'count':_0x3d8012[_0x513f('0x52')],'rows':_0x3d8012});});},'VoiceQueuesChannel':function(_0x1fdb84){var _0x1c56e4=this;return new Promise(function(_0x23cf6c,_0x4e6af3){var _0x135337=schema(properties[_0x513f('0x71')])[_0x513f('0x3')](_0x1fdb84);if(_0x135337[_0x513f('0x52')]>0x0){return _0x4e6af3(_0x1c56e4['error'](0x1f4,_[_0x513f('0x67')](_0x135337,_0x513f('0x1a'))[_0x513f('0x14')](',\x20')));}var _0x17de07=_[_0x513f('0x53')](_0x3a9531[_0x513f('0x70')],{'uniqueid':_0x1fdb84[_0x513f('0x56')]});if(_0x17de07){_0x23cf6c(_0x17de07);}else{return _0x4e6af3(_0x1c56e4[_0x513f('0x11')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x2be7cc){var _0x167620=this;return new Promise(function(_0x1eb9af,_0x33c93b){if(ami['isConnected']()==![]){return _0x33c93b(_0x167620[_0x513f('0x11')](0x1f4,[config[_0x513f('0x12')]['ip'],config[_0x513f('0x12')][_0x513f('0x13')],_0x513f('0x1b')][_0x513f('0x14')]('\x20')));}var _0x29e93e=schema(properties['voicequeuechannelhangup'])['validate'](_0x2be7cc);if(_0x29e93e[_0x513f('0x52')]>0x0){return _0x33c93b(_0x167620['error'](0x1f4,_[_0x513f('0x67')](_0x29e93e,_0x513f('0x1a'))[_0x513f('0x14')](',\x20')));}var _0xfdf4b2=_[_0x513f('0x53')](_0x3a9531[_0x513f('0x70')],{'uniqueid':_0x2be7cc[_0x513f('0x56')]});if(_0xfdf4b2&&_0xfdf4b2[_0x513f('0x57')]){return ami[_0x513f('0x19')]({'action':'Hangup','channel':_0xfdf4b2[_0x513f('0x57')]})[_0x513f('0x1e')](function(_0x2a30e7){_0x1eb9af({'code':0xc8,'message':[_0x2be7cc[_0x513f('0x56')],_0x2a30e7[_0x513f('0x1a')][_0x513f('0x5f')]()][_0x513f('0x14')]('\x20')});})['catch'](function(_0x183894){_0x33c93b(_0x167620[_0x513f('0x11')](0x1f5,[_0x2be7cc[_0x513f('0x56')],_0x183894[_0x513f('0x1a')][_0x513f('0x5f')]()][_0x513f('0x14')]('\x20')));});}else{return _0x33c93b(_0x167620[_0x513f('0x11')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x5d570e){var _0x218d01=this;return new Promise(function(_0x471969,_0x42f6f2){if(ami['isConnected']()==![]){return _0x42f6f2(_0x218d01['error'](0x1f4,[config[_0x513f('0x12')]['ip'],config[_0x513f('0x12')]['username'],_0x513f('0x1b')][_0x513f('0x14')]('\x20')));}var _0x4ca855=schema(properties['voicequeuechannelredirect'])[_0x513f('0x3')](_0x5d570e);if(_0x4ca855['length']>0x0){return _0x42f6f2(_0x218d01[_0x513f('0x11')](0x1f4,_[_0x513f('0x67')](_0x4ca855,_0x513f('0x1a'))[_0x513f('0x14')](',\x20')));}var _0x46e1ea=_[_0x513f('0x53')](_0x3a9531[_0x513f('0x70')],{'uniqueid':_0x5d570e[_0x513f('0x56')]});if(_0x46e1ea&&_0x46e1ea[_0x513f('0x57')]){return ami[_0x513f('0x19')]({'action':'Redirect','channel':_0x46e1ea['channel'],'exten':_0x5d570e[_0x513f('0x72')],'context':_0x5d570e[_0x513f('0x73')]||_0x46e1ea[_0x513f('0x73')],'priority':0x1})[_0x513f('0x1e')](function(_0x5f3307){_0x471969({'code':0xc8,'message':[_0x5d570e[_0x513f('0x56')],_0x5f3307['message']['toLowerCase']()][_0x513f('0x14')]('\x20')});})[_0x513f('0x6a')](function(_0x573dc8){_0x42f6f2(_0x218d01[_0x513f('0x11')](0x1f5,[_0x5d570e[_0x513f('0x56')],_0x573dc8[_0x513f('0x1a')][_0x513f('0x5f')]()][_0x513f('0x14')]('\x20')));});}else{return _0x42f6f2(_0x218d01[_0x513f('0x11')](0x1f5,_0x513f('0x65')));}});},'Agents':function(_0xf66559){return new Promise(function(_0x334569,_0x46bd24){var _0x1f5eab=_['values'](_0x3a9531[_0x513f('0xc')]);_0x334569({'count':_0x1f5eab[_0x513f('0x52')],'rows':_0x1f5eab});});},'Telephones':function(_0x2b8579){return new Promise(function(_0x5d9981,_0x4b420d){var _0xc6403a=_['values'](_0x3a9531[_0x513f('0x74')]);_0x5d9981({'count':_0xc6403a['length'],'rows':_0xc6403a});});},'Trunks':function(_0x285f0c){return new Promise(function(_0x57f9a9,_0x51c5b9){var _0x335d82=_['values'](_0x3a9531['trunks']);_0x57f9a9({'count':_0x335d82['length'],'rows':_0x335d82});});},'OutboundChannels':function(_0x58f4e7){return new Promise(function(_0x3c81c5,_0x1788cc){var _0x58f6fb=_[_0x513f('0x6f')](_0x3a9531['outboundChannels']);_0x3c81c5({'count':_0x58f6fb['length'],'rows':_0x58f6fb});});},'Outbound':function(_0x5f3368){return new Promise(function(_0x3aee80,_0x4b7351){_0x3aee80(_0x3a9531[_0x513f('0x75')]);});},'Campaigns':function(_0x22675c){return new Promise(function(_0x5289f8,_0xb7657f){var _0x2cfac4=_[_0x513f('0x6f')](_0x3a9531[_0x513f('0x76')]);_0x5289f8({'count':_0x2cfac4[_0x513f('0x52')],'rows':_0x2cfac4});});},'VoiceQueuesPreview':function(_0x491a06){var _0x3a8797=this;return new Promise(function(_0x58918c,_0x5bc9cf){_0x3a6320[_0x513f('0x77')](_0x491a06['id'])[_0x513f('0x1e')](function(_0xa08bac){_0x58918c({'code':0xc8,'message':_0xa08bac[_0x513f('0x1a')]});})['catch'](function(_0x11aafc){_0x5bc9cf(_0x3a8797[_0x513f('0x11')](0x1f4,_0x11aafc['message']));});});},'EventManager':function(_0x3075f2){var _0xa64988=this;return new Promise(function(_0x1b0f54,_0x251911){if(!_0x3075f2['event']){return _0x251911(_0xa64988[_0x513f('0x11')](0x1f4,'Event\x20name\x20mandatory'));}ami[_0x513f('0x78')]('custom:'+_0x3075f2[_0x513f('0x79')],_0x3075f2[_0x513f('0x1a')]);_0x1b0f54({'code':0xc8,'message':_0x3075f2});});},'FaxAccounts':function(_0x7b6de1){return new Promise(function(_0x40d7ba,_0x20b2f5){var _0x791c0a=_[_0x513f('0x6f')](_0x3a9531[_0x513f('0x7a')]);_0x40d7ba({'count':_0x791c0a[_0x513f('0x52')],'rows':_0x791c0a});});},'SendFax':function(_0x21bae1){var _0x4735e9=this;return new Promise(function(_0x3eae3d,_0x5dd87c){_0x8d019b[_0x513f('0x7b')](_0x21bae1)[_0x513f('0x1e')](function(_0x4efad6){_0x3eae3d({'code':0xc8,'message':_0x4efad6[_0x513f('0x1a')]});})[_0x513f('0x6a')](function(_0x10671f){_0x5dd87c(_0x4735e9[_0x513f('0x11')](0x1f4,_0x10671f[_0x513f('0x1a')]));});});},'CheckAfterSend':function(_0x1d91fc){var _0x5d558a=this;return new Promise(function(_0x162786,_0xd42fe0){_0x8d019b[_0x513f('0x7c')](_0x1d91fc)[_0x513f('0x1e')](function(_0x2834a2){_0x162786({'code':0xc8,'message':_0x2834a2[_0x513f('0x1a')]});})[_0x513f('0x6a')](function(_0x42267c){_0xd42fe0(_0x5d558a[_0x513f('0x11')](0x1f4,_0x42267c[_0x513f('0x1a')]));});});}};var _0x46b4b8=jayson[_0x513f('0x7d')](_0x6e5b15)[_0x513f('0x7e')]();_0x46b4b8['on'](_0x513f('0x11'),function(_0x220ff4){return _0x2be368(_0x220ff4);});_0x46b4b8[_0x513f('0x6')](0x232a,_0x513f('0x7f'),function(){console[_0x513f('0x80')](_0x513f('0x81'),0x232a);return _0x579681(_0x513f('0x82')+0x232a);});});}; \ No newline at end of file +var _0x5232=['predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','length','find','omit','undefined','values','channels','voicechannel','uniqueid','channel','%s.%s','filename','wav','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','push','mixmonitorid','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','map','StopMixMonitor','destinationchannel','stop','status','StopMixMonitor\x20Success','queueChannels','voicequeuechannelredirect','exten','context','trunks','outboundChannels','outbound','campaigns','run','event','emit','custom:','send','checkAfterSend','server','http','127.0.0.1','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','bluebird','../properties','../ami','format','%s/%s','name','timers','timer','agents','updateStatusRealtime','pause','isConnected','error','asterisk','username','join','pick','keys','module','Reload','Action','then','message','catch','ami\x20disconnected','command','action','content','voiceQueues','hasOwnProperty','strategy','answered','loggedIn','pTalking','sumDuration','type','abandoned','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay'];(function(_0x1073b4,_0x1721c2){var _0x578d71=function(_0x3c60c0){while(--_0x3c60c0){_0x1073b4['push'](_0x1073b4['shift']());}};_0x578d71(++_0x1721c2);}(_0x5232,0x1c9));var _0x2523=function(_0x377a6e,_0x59b99d){_0x377a6e=_0x377a6e-0x0;var _0x37f751=_0x5232[_0x377a6e];return _0x37f751;};'use strict';var _=require(_0x2523('0x0'));var util=require(_0x2523('0x1'));var jayson=require(_0x2523('0x2'));var schema=require(_0x2523('0x3'));var BPromise=require(_0x2523('0x4'));var moment=require('moment');var config=require('../../../config/environment');var properties=require(_0x2523('0x5'));var ami=require(_0x2523('0x6'));exports['listen']=function(_0x1fe9de,_0x3cf8c0,_0x1c3b74){return new BPromise(function(_0x45ae69,_0x3ab139){var _0x36f3d5={'QueuePause':function(_0x3d8e51){return new Promise(function(_0x22440b,_0x251973){var _0x39dca8=util[_0x2523('0x7')](_0x2523('0x8'),'SIP',_0x3d8e51[_0x2523('0x9')]);if(_0x1fe9de[_0x2523('0xa')]&&_0x1fe9de[_0x2523('0xa')][_0x39dca8]&&_0x1fe9de[_0x2523('0xa')][_0x39dca8][_0x2523('0xb')]){_0x1fe9de[_0x2523('0xa')][_0x39dca8]['updateAcw']();}if(_0x1fe9de[_0x2523('0xc')][_0x39dca8]){_0x1fe9de[_0x2523('0xc')][_0x39dca8][_0x2523('0xd')]({'statePause':_0x3d8e51[_0x2523('0xe')]?!![]:![]});}_0x22440b({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x37f270){var _0x9fa814=this;return new Promise(function(_0x5e1e1d,_0x38d786){if(ami[_0x2523('0xf')]()==![]){return _0x38d786(_0x9fa814[_0x2523('0x10')](0x1f4,[config[_0x2523('0x11')]['ip'],config['asterisk'][_0x2523('0x12')],'ami\x20disconnected'][_0x2523('0x13')]('\x20')));}_0x37f270=_[_0x2523('0x14')](_0x37f270,_[_0x2523('0x15')](properties[_0x2523('0x16')]));_0x37f270['action']=_0x2523('0x17');return ami[_0x2523('0x18')](_0x37f270)[_0x2523('0x19')](function(_0x367bae){_0x5e1e1d({'code':0xc8,'message':_0x367bae[_0x2523('0x1a')]});})[_0x2523('0x1b')](function(_0x4f2a85){_0x38d786(_0x9fa814[_0x2523('0x10')](0x1f5,_0x4f2a85[_0x2523('0x1a')]));});});},'Command':function(_0x540ec8){var _0x2819aa=this;return new Promise(function(_0x189c94,_0x3f29f6){if(ami[_0x2523('0xf')]()==![]){return _0x3f29f6(_0x2819aa['error'](0x1f4,[config['asterisk']['ip'],config['asterisk']['username'],_0x2523('0x1c')][_0x2523('0x13')]('\x20')));}_0x540ec8=_[_0x2523('0x14')](_0x540ec8,_0x2523('0x1d'));_0x540ec8[_0x2523('0x1e')]='Command';return ami['Action'](_0x540ec8)['then'](function(_0x50e34e){_0x189c94({'code':0xc8,'message':_0x50e34e[_0x2523('0x1f')]});})[_0x2523('0x1b')](function(_0x4fc304){_0x3f29f6(_0x2819aa['error'](0x1f5,_0x4fc304[_0x2523('0x1a')]));});});},'VoiceQueues':function(_0xc9eaf9){return new Promise(function(_0x307838,_0x393956){var _0xd47858=[];for(var _0x5495f4 in _0x1fe9de[_0x2523('0x20')]){if(_0x1fe9de[_0x2523('0x20')][_0x2523('0x21')](_0x5495f4)){var _0x1a8b0c=_0x1fe9de[_0x2523('0x20')][_0x5495f4];var _0x23941b={'id':_0x1a8b0c['id'],'name':_0x1a8b0c[_0x2523('0x9')],'strategy':_0x1a8b0c[_0x2523('0x22')],'answered':_0x1a8b0c[_0x2523('0x23')],'available':_0x1a8b0c['available'],'loggedIn':_0x1a8b0c[_0x2523('0x24')],'pTalking':_0x1a8b0c[_0x2523('0x25')],'sumBillable':_0x1a8b0c['sumBillable'],'sumDuration':_0x1a8b0c[_0x2523('0x26')],'sumHoldTime':_0x1a8b0c['sumHoldTime']||0x0,'talking':_0x1a8b0c['talking'],'total':_0x1a8b0c['total'],'type':_0x1a8b0c[_0x2523('0x27')],'unmanaged':_0x1a8b0c['unmanaged'],'abandoned':_0x1a8b0c[_0x2523('0x28')],'waiting':_0x1a8b0c['waiting'],'loggedInDb':_0x1a8b0c[_0x2523('0x29')]};if(_0x1a8b0c[_0x2523('0x27')]==='outbound'){_0x23941b[_0x2523('0x2a')]=_0x1a8b0c['dialActive'];_0x23941b[_0x2523('0x2b')]=_0x1a8b0c[_0x2523('0x2b')];_0x23941b[_0x2523('0x2c')]=_0x1a8b0c[_0x2523('0x2c')];_0x23941b[_0x2523('0x2d')]=_0x1a8b0c[_0x2523('0x2d')];_0x23941b['dialOriginateTimeout']=_0x1a8b0c[_0x2523('0x2e')];_0x23941b[_0x2523('0x2f')]=_0x1a8b0c[_0x2523('0x2f')];_0x23941b['temp']=_0x1a8b0c[_0x2523('0x30')];_0x23941b['outboundAnswerAgiCallsDay']=_0x1a8b0c[_0x2523('0x31')];_0x23941b[_0x2523('0x32')]=_0x1a8b0c[_0x2523('0x32')];_0x23941b[_0x2523('0x33')]=_0x1a8b0c[_0x2523('0x33')];_0x23941b[_0x2523('0x34')]=_0x1a8b0c[_0x2523('0x34')];_0x23941b['outboundCongestionCallsDay']=_0x1a8b0c[_0x2523('0x35')];_0x23941b[_0x2523('0x36')]=_0x1a8b0c[_0x2523('0x36')];_0x23941b[_0x2523('0x37')]=_0x1a8b0c[_0x2523('0x37')];_0x23941b['outboundDropCallsDayTimeout']=_0x1a8b0c[_0x2523('0x38')];_0x23941b[_0x2523('0x39')]=_0x1a8b0c[_0x2523('0x39')];_0x23941b[_0x2523('0x3a')]=_0x1a8b0c['outboundNoSuchCallsDay'];_0x23941b[_0x2523('0x3b')]=_0x1a8b0c['outboundOriginateFailureCallsDay'];_0x23941b[_0x2523('0x3c')]=_0x1a8b0c['outboundReCallsDay'];_0x23941b[_0x2523('0x3d')]=_0x1a8b0c[_0x2523('0x3d')];_0x23941b[_0x2523('0x3e')]=_0x1a8b0c[_0x2523('0x3e')];_0x23941b[_0x2523('0x3f')]=_0x1a8b0c[_0x2523('0x3f')];_0x23941b[_0x2523('0x40')]=_0x1a8b0c[_0x2523('0x40')];_0x23941b['predictiveIntervalAvgTalktime']=_0x1a8b0c[_0x2523('0x41')];_0x23941b[_0x2523('0x42')]=_0x1a8b0c[_0x2523('0x42')];_0x23941b[_0x2523('0x43')]=_0x1a8b0c[_0x2523('0x43')];_0x23941b['predictiveIntervalErlangCalls']=_0x1a8b0c[_0x2523('0x44')];_0x23941b[_0x2523('0x45')]=_0x1a8b0c['predictiveIntervalErlangCallsDroppedCalls'];_0x23941b['predictiveIntervalHitRate']=_0x1a8b0c[_0x2523('0x46')];_0x23941b['predictiveIntervalMultiplicativeFactor']=_0x1a8b0c[_0x2523('0x47')];_0x23941b[_0x2523('0x48')]=_0x1a8b0c[_0x2523('0x48')];_0x23941b[_0x2523('0x49')]=_0x1a8b0c['predictiveIntervalAvailable'];_0x23941b['predictiveIntervalTotalCalls']=_0x1a8b0c[_0x2523('0x4a')];_0x23941b[_0x2523('0x1a')]=_0x1a8b0c[_0x2523('0x1a')];_0x23941b[_0x2523('0x4b')]=_0x1a8b0c[_0x2523('0x4b')];_0x23941b['erlangCalls']=_0x1a8b0c['erlangCalls'];_0x23941b['erlangCallToSecond']=_0x1a8b0c[_0x2523('0x4c')];_0x23941b[_0x2523('0x4d')]=_0x1a8b0c[_0x2523('0x4d')];_0x23941b['erlangBusyFactor']=_0x1a8b0c[_0x2523('0x4e')];_0x23941b[_0x2523('0x4f')]=_0x1a8b0c['startPredictive'];_0x23941b[_0x2523('0x50')]=_0x1a8b0c[_0x2523('0x50')];}if(_0x1a8b0c[_0x2523('0x51')]){_0x23941b[_0x2523('0x51')]={'id':_0x1a8b0c[_0x2523('0x51')]['id'],'name':_0x1a8b0c['Trunk'][_0x2523('0x9')],'active':_0x1a8b0c[_0x2523('0x51')][_0x2523('0x52')],'callerid':_0x1a8b0c[_0x2523('0x51')]['callerid']};}if(_0x1a8b0c[_0x2523('0x53')]){_0x23941b[_0x2523('0x53')]={'id':_0x1a8b0c[_0x2523('0x53')]['id'],'name':_0x1a8b0c[_0x2523('0x53')]['name']};}_0xd47858['push'](_0x23941b);}}_0x307838({'count':_0xd47858[_0x2523('0x54')],'rows':_0xd47858});});},'UpdateVoiceQueue':function(_0x5079df){return new Promise(function(_0x2b90ea,_0x292801){var _0x37e33f=_[_0x2523('0x55')](_0x1fe9de[_0x2523('0x20')],{'id':parseInt(_0x5079df['id'])});var _0x575fc9=_[_0x2523('0x56')](_0x5079df,['id']);if(_0x37e33f){for(var _0x383f9e in _0x575fc9){if(typeof _0x575fc9[_0x383f9e]!=='undefined'&&typeof _0x37e33f[_0x383f9e]!==_0x2523('0x57')){_0x37e33f[_0x383f9e]=_0x575fc9[_0x383f9e];}}_0x2b90ea(_0x37e33f);}else{_0x292801();}});},'VoiceChannels':function(_0x33c52e){return new Promise(function(_0x3c7232,_0x52af8a){var _0x337993=_[_0x2523('0x58')](_0x1fe9de[_0x2523('0x59')]);_0x3c7232({'count':_0x337993[_0x2523('0x54')],'rows':_0x337993});});},'VoiceChannelMixMonitor':function(_0x293e43){var _0x4b765e=this;return new Promise(function(_0x17109e,_0x183e67){if(ami['isConnected']()==![]){return _0x183e67(_0x4b765e[_0x2523('0x10')](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0x2523('0x12')],_0x2523('0x1c')][_0x2523('0x13')]('\x20')));}var _0x3e7ddd=schema(properties[_0x2523('0x5a')])[_0x2523('0x3')](_0x293e43);if(_0x3e7ddd[_0x2523('0x54')]>0x0){return _0x183e67(_0x4b765e['error'](0x1f4,_['map'](_0x3e7ddd,'message')[_0x2523('0x13')](',\x20')));}var _0x12d72d=_['find'](_0x1fe9de[_0x2523('0x59')],{'uniqueid':_0x293e43[_0x2523('0x5b')]});if(_0x12d72d&&_0x12d72d[_0x2523('0x5c')]){var _0x4b6b45=util[_0x2523('0x7')](_0x2523('0x5d'),_0x293e43[_0x2523('0x5e')]||_0x293e43['uniqueid'],_0x293e43['format']||_0x2523('0x5f'));return ami[_0x2523('0x18')]({'action':'MixMonitor','channel':_0x12d72d[_0x2523('0x5c')],'file':_0x4b6b45,'options':_0x2523('0x60')})[_0x2523('0x19')](function(_0x409b66){var _0x4f661a=_[_0x2523('0x55')](_0x12d72d[_0x2523('0x61')],{'filename':_0x2523('0x62')+_0x4b6b45[_0x2523('0x63')]()});if(_[_0x2523('0x64')](_0x4f661a)){_0x12d72d[_0x2523('0x61')][_0x2523('0x65')]({'filename':_0x2523('0x62')+_0x4b6b45[_0x2523('0x63')](),'createdAt':moment()[_0x2523('0x7')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x409b66[_0x2523('0x66')],'status':'rec'});}else{_0x4f661a[_0x2523('0x66')]=_0x409b66[_0x2523('0x66')];_0x4f661a['status']='rec';}_0x17109e({'code':0xc8,'message':[_0x293e43[_0x2523('0x5b')],_0x2523('0x67'),_0x409b66['mixmonitorid']][_0x2523('0x13')]('\x20'),'mixmonitorid':_0x409b66[_0x2523('0x66')]});})['catch'](function(_0x5c338f){_0x183e67(_0x4b765e[_0x2523('0x10')](0x1f5,[_0x293e43['uniqueid'],_0x5c338f[_0x2523('0x1a')][_0x2523('0x63')]()][_0x2523('0x13')]('\x20')));});}else{return _0x183e67(_0x4b765e[_0x2523('0x10')](0x1f5,_0x2523('0x68')));}});},'VoiceChannelStopMixMonitor':function(_0x1aa560){var _0x5a5119=this;return new Promise(function(_0x2783fb,_0x4136f0){if(ami['isConnected']()==![]){return _0x4136f0(_0x5a5119[_0x2523('0x10')](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0x2523('0x12')],'ami\x20disconnected']['join']('\x20')));}var _0x30a910=schema(properties[_0x2523('0x5a')])[_0x2523('0x3')](_0x1aa560);if(_0x30a910[_0x2523('0x54')]>0x0){return _0x4136f0(_0x5a5119[_0x2523('0x10')](0x1f4,_[_0x2523('0x69')](_0x30a910,_0x2523('0x1a'))['join'](',\x20')));}var _0x56df26=_[_0x2523('0x55')](_0x1fe9de[_0x2523('0x59')],{'uniqueid':_0x1aa560[_0x2523('0x5b')]});if(_0x56df26){return BPromise['resolve']()[_0x2523('0x19')](function(){if(_0x56df26[_0x2523('0x5c')]){return ami['Action']({'action':_0x2523('0x6a'),'channel':_0x56df26[_0x2523('0x5c')],'mixmonitorid':_0x1aa560[_0x2523('0x66')]})[_0x2523('0x1b')](function(_0x490e9d){});}})[_0x2523('0x19')](function(){if(_0x56df26[_0x2523('0x6b')]){return ami[_0x2523('0x18')]({'action':_0x2523('0x6a'),'channel':_0x56df26[_0x2523('0x6b')],'mixmonitorid':_0x1aa560[_0x2523('0x66')]})[_0x2523('0x1b')](function(_0x2af3d2){});}})[_0x2523('0x19')](function(_0x3b23e7){var _0x35f8b3=_[_0x2523('0x55')](_0x56df26[_0x2523('0x61')],{'mixmonitorid':_0x1aa560[_0x2523('0x66')]});if(_0x35f8b3){_0x35f8b3['status']=_0x2523('0x6c');}})[_0x2523('0x19')](function(){var _0x39c259=util[_0x2523('0x7')](_0x2523('0x5d'),_0x1aa560[_0x2523('0x5e')]||_0x1aa560['uniqueid'],_0x1aa560[_0x2523('0x7')]||'wav');var _0x120bf6=_[_0x2523('0x55')](_0x56df26[_0x2523('0x61')],{'filename':'/var/spool/asterisk/monitor/'+_0x39c259[_0x2523('0x63')]()});if(_0x120bf6){_0x120bf6[_0x2523('0x6d')]=_0x2523('0x6c');}})[_0x2523('0x19')](function(){_0x2783fb({'code':0xc8,'message':[_0x1aa560[_0x2523('0x5b')],_0x2523('0x6e')][_0x2523('0x13')]('\x20')});})[_0x2523('0x1b')](function(_0x44706e){_0x4136f0(_0x5a5119[_0x2523('0x10')](0x1f5,[_0x1aa560[_0x2523('0x5b')],_0x44706e['message'][_0x2523('0x63')]()]['join']('\x20')));});}else{return _0x4136f0(_0x5a5119[_0x2523('0x10')](0x1f5,_0x2523('0x68')));}});},'VoiceQueuesChannels':function(_0x2a5e97){return new Promise(function(_0xcc1b79,_0x392b00){var _0x3e80b9=_['values'](_0x1fe9de[_0x2523('0x6f')]);_0xcc1b79({'count':_0x3e80b9[_0x2523('0x54')],'rows':_0x3e80b9});});},'VoiceQueuesChannel':function(_0xb772fe){var _0xcb3fc5=this;return new Promise(function(_0x5d8178,_0x173b3e){var _0x2cc28f=schema(properties['voicequeuechannel'])[_0x2523('0x3')](_0xb772fe);if(_0x2cc28f['length']>0x0){return _0x173b3e(_0xcb3fc5['error'](0x1f4,_['map'](_0x2cc28f,'message')[_0x2523('0x13')](',\x20')));}var _0x573bb5=_[_0x2523('0x55')](_0x1fe9de[_0x2523('0x6f')],{'uniqueid':_0xb772fe[_0x2523('0x5b')]});if(_0x573bb5){_0x5d8178(_0x573bb5);}else{return _0x173b3e(_0xcb3fc5[_0x2523('0x10')](0x1f5,_0x2523('0x68')));}});},'VoiceQueuesChannelHangup':function(_0x1c1e75){var _0x59eafd=this;return new Promise(function(_0x4fa2c8,_0x43611e){if(ami[_0x2523('0xf')]()==![]){return _0x43611e(_0x59eafd[_0x2523('0x10')](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0x2523('0x12')],_0x2523('0x1c')][_0x2523('0x13')]('\x20')));}var _0x2617f1=schema(properties['voicequeuechannelhangup'])[_0x2523('0x3')](_0x1c1e75);if(_0x2617f1[_0x2523('0x54')]>0x0){return _0x43611e(_0x59eafd[_0x2523('0x10')](0x1f4,_['map'](_0x2617f1,_0x2523('0x1a'))[_0x2523('0x13')](',\x20')));}var _0x56918e=_['find'](_0x1fe9de[_0x2523('0x6f')],{'uniqueid':_0x1c1e75[_0x2523('0x5b')]});if(_0x56918e&&_0x56918e[_0x2523('0x5c')]){return ami[_0x2523('0x18')]({'action':'Hangup','channel':_0x56918e[_0x2523('0x5c')]})[_0x2523('0x19')](function(_0x3c11a1){_0x4fa2c8({'code':0xc8,'message':[_0x1c1e75[_0x2523('0x5b')],_0x3c11a1[_0x2523('0x1a')]['toLowerCase']()]['join']('\x20')});})['catch'](function(_0x418855){_0x43611e(_0x59eafd[_0x2523('0x10')](0x1f5,[_0x1c1e75[_0x2523('0x5b')],_0x418855['message'][_0x2523('0x63')]()][_0x2523('0x13')]('\x20')));});}else{return _0x43611e(_0x59eafd[_0x2523('0x10')](0x1f5,_0x2523('0x68')));}});},'VoiceQueuesChannelRedirect':function(_0x20fc96){var _0x48d559=this;return new Promise(function(_0x47e5ce,_0x28b2eb){if(ami['isConnected']()==![]){return _0x28b2eb(_0x48d559['error'](0x1f4,[config[_0x2523('0x11')]['ip'],config[_0x2523('0x11')][_0x2523('0x12')],'ami\x20disconnected'][_0x2523('0x13')]('\x20')));}var _0x124693=schema(properties[_0x2523('0x70')])[_0x2523('0x3')](_0x20fc96);if(_0x124693[_0x2523('0x54')]>0x0){return _0x28b2eb(_0x48d559[_0x2523('0x10')](0x1f4,_['map'](_0x124693,_0x2523('0x1a'))[_0x2523('0x13')](',\x20')));}var _0x2ab35b=_[_0x2523('0x55')](_0x1fe9de[_0x2523('0x6f')],{'uniqueid':_0x20fc96[_0x2523('0x5b')]});if(_0x2ab35b&&_0x2ab35b['channel']){return ami[_0x2523('0x18')]({'action':'Redirect','channel':_0x2ab35b[_0x2523('0x5c')],'exten':_0x20fc96[_0x2523('0x71')],'context':_0x20fc96[_0x2523('0x72')]||_0x2ab35b[_0x2523('0x72')],'priority':0x1})[_0x2523('0x19')](function(_0x33cec3){_0x47e5ce({'code':0xc8,'message':[_0x20fc96[_0x2523('0x5b')],_0x33cec3['message'][_0x2523('0x63')]()][_0x2523('0x13')]('\x20')});})['catch'](function(_0x2814a7){_0x28b2eb(_0x48d559[_0x2523('0x10')](0x1f5,[_0x20fc96['uniqueid'],_0x2814a7[_0x2523('0x1a')][_0x2523('0x63')]()][_0x2523('0x13')]('\x20')));});}else{return _0x28b2eb(_0x48d559[_0x2523('0x10')](0x1f5,_0x2523('0x68')));}});},'Agents':function(_0x20b6c0){return new Promise(function(_0x3f3af9,_0x62e4ef){var _0x29003a=_[_0x2523('0x58')](_0x1fe9de[_0x2523('0xc')]);_0x3f3af9({'count':_0x29003a['length'],'rows':_0x29003a});});},'Telephones':function(_0x28f53e){return new Promise(function(_0x4168ae,_0x57e29c){var _0x5b2fd6=_['values'](_0x1fe9de['telephones']);_0x4168ae({'count':_0x5b2fd6[_0x2523('0x54')],'rows':_0x5b2fd6});});},'Trunks':function(_0xd275c8){return new Promise(function(_0x13af4b,_0x369752){var _0x12f8b3=_['values'](_0x1fe9de[_0x2523('0x73')]);_0x13af4b({'count':_0x12f8b3[_0x2523('0x54')],'rows':_0x12f8b3});});},'OutboundChannels':function(_0x45db5e){return new Promise(function(_0x299712,_0x13d119){var _0x3675d8=_[_0x2523('0x58')](_0x1fe9de[_0x2523('0x74')]);_0x299712({'count':_0x3675d8[_0x2523('0x54')],'rows':_0x3675d8});});},'Outbound':function(_0x2ac9c9){return new Promise(function(_0x2d9a96,_0x3f922b){_0x2d9a96(_0x1fe9de[_0x2523('0x75')]);});},'Campaigns':function(_0x2aeab5){return new Promise(function(_0x787029,_0x1d79e8){var _0x443cf5=_[_0x2523('0x58')](_0x1fe9de[_0x2523('0x76')]);_0x787029({'count':_0x443cf5[_0x2523('0x54')],'rows':_0x443cf5});});},'VoiceQueuesPreview':function(_0x4c804f){var _0x99f6e7=this;return new Promise(function(_0x400f5d,_0x4fec63){_0x3cf8c0[_0x2523('0x77')](_0x4c804f['id'])['then'](function(_0x2295dd){_0x400f5d({'code':0xc8,'message':_0x2295dd['message']});})['catch'](function(_0x5cf89c){_0x4fec63(_0x99f6e7['error'](0x1f4,_0x5cf89c['message']));});});},'EventManager':function(_0x39982e){var _0x5f49a5=this;return new Promise(function(_0x482b17,_0x405d63){if(!_0x39982e[_0x2523('0x78')]){return _0x405d63(_0x5f49a5['error'](0x1f4,'Event\x20name\x20mandatory'));}ami[_0x2523('0x79')](_0x2523('0x7a')+_0x39982e[_0x2523('0x78')],_0x39982e['message']);_0x482b17({'code':0xc8,'message':_0x39982e});});},'FaxAccounts':function(_0xf12825){return new Promise(function(_0x383904,_0x5269ec){var _0x173357=_['values'](_0x1fe9de['faxAccounts']);_0x383904({'count':_0x173357[_0x2523('0x54')],'rows':_0x173357});});},'SendFax':function(_0x148633){var _0x2253c0=this;return new Promise(function(_0x4ef95d,_0x2e11fd){_0x1c3b74[_0x2523('0x7b')](_0x148633)['then'](function(_0x326503){_0x4ef95d({'code':0xc8,'message':_0x326503['message']});})[_0x2523('0x1b')](function(_0x1eb294){_0x2e11fd(_0x2253c0[_0x2523('0x10')](0x1f4,_0x1eb294[_0x2523('0x1a')]));});});},'CheckAfterSend':function(_0x519a9d){var _0x24e346=this;return new Promise(function(_0x4bf99e,_0x692fd1){_0x1c3b74[_0x2523('0x7c')](_0x519a9d)[_0x2523('0x19')](function(_0x1ba312){_0x4bf99e({'code':0xc8,'message':_0x1ba312[_0x2523('0x1a')]});})['catch'](function(_0x2c0427){_0x692fd1(_0x24e346[_0x2523('0x10')](0x1f4,_0x2c0427[_0x2523('0x1a')]));});});}};var _0x4bb2ce=jayson[_0x2523('0x7d')](_0x36f3d5)[_0x2523('0x7e')]();_0x4bb2ce['on'](_0x2523('0x10'),function(_0x19f7bd){return _0x3ab139(_0x19f7bd);});_0x4bb2ce['listen'](0x232a,_0x2523('0x7f'),function(){console['log'](_0x2523('0x80'),0x232a);return _0x45ae69(_0x2523('0x81')+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 4dc84ef..b519dc1 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 _0xeec6=['destcalleridnum','calleridnum','lastName','phone','mobile','fax','createdAt','updatedAt','union','resolve','then','getContacts','isEmpty','length','info','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','map','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','routeId','firstName','calleridname','','Unknown','destcalleridname','createContact','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','push','name','format','trigger:%s','action','toLowerCase','lodash','bluebird','ioredis','util','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','socket.io-emitter','[CM][%s][%s]','stringify','emit','data1','data2','isNil','data5','xmd-contactid','ListId','data3','split','$or'];(function(_0x2e584e,_0xfb1ab8){var _0x44e53a=function(_0xed31d2){while(--_0xed31d2){_0x2e584e['push'](_0x2e584e['shift']());}};_0x44e53a(++_0xfb1ab8);}(_0xeec6,0x1c2));var _0x6eec=function(_0x279368,_0x41c002){_0x279368=_0x279368-0x0;var _0x40b6d0=_0xeec6[_0x279368];return _0x40b6d0;};'use strict';var _=require(_0x6eec('0x0'));var BPromise=require(_0x6eec('0x1'));var Redis=require(_0x6eec('0x2'));var util=require(_0x6eec('0x3'));var config=require('../../../../config/environment');var logger=require(_0x6eec('0x4'))(_0x6eec('0x5'));var cmContactRpc=require(_0x6eec('0x6'));config[_0x6eec('0x7')]=_[_0x6eec('0x8')](config[_0x6eec('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x6eec('0x9'))(new Redis(config[_0x6eec('0x7')]));function emit(_0x48064a,_0x5a5e47,_0x1c810e,_0x3443c2,_0x834c2){logger['info'](_0x6eec('0xa'),_0x48064a,_0x5a5e47['id'],_0x1c810e,_0x3443c2,JSON[_0x6eec('0xb')](_0x834c2));io['to'](_0x1c810e)[_0x6eec('0xc')](_0x3443c2,_0x834c2);}exports['exec']=function(_0x595dd4,_0x5e8aba,_0x295cae,_0xfbcfa1){var _0x51a9e3,_0x4b8de1;var _0x1cc8d3={};var _0x485b5b=Number(_0x295cae[_0x6eec('0xd')]);var _0x3387c2=_0x295cae[_0x6eec('0xe')]?Boolean(Number(_0x295cae[_0x6eec('0xe')])):![];var _0x3fe3bc;var _0x49fccb=![];if(!_[_0x6eec('0xf')](_0x295cae[_0x6eec('0x10')])){if(_0x295cae[_0x6eec('0x10')]=='1')_0x49fccb=!![];}if(!_0x49fccb){if(_0xfbcfa1[_0x6eec('0x11')]){_0x1cc8d3['id']=_0xfbcfa1[_0x6eec('0x11')];}}if(!_0x1cc8d3['id']){_0x1cc8d3[_0x6eec('0x12')]=_0x485b5b;_0x3fe3bc=_0x295cae[_0x6eec('0x13')]&&_0x295cae[_0x6eec('0x13')]!=='0'?_0x295cae[_0x6eec('0x13')][_0x6eec('0x14')](','):['phone'];_0x1cc8d3[_0x6eec('0x15')]=_['map'](_0x3fe3bc,function(_0x38c9a4){var _0x45aa3f={};_0x45aa3f[_0x38c9a4]=_0xfbcfa1['routeId']?_0xfbcfa1[_0x6eec('0x16')]:_0xfbcfa1[_0x6eec('0x17')];return _0x45aa3f;});}var _0xb1eab7=['id','firstName',_0x6eec('0x18'),_0x6eec('0x19'),_0x6eec('0x1a'),_0x6eec('0x1b'),_0x6eec('0x12'),_0x6eec('0x1c'),'scheduledAt',_0x6eec('0x1d')];var _0x2f843e=_[_0x6eec('0x1e')](_0xb1eab7,_0x3fe3bc);BPromise[_0x6eec('0x1f')]()[_0x6eec('0x20')](cmContactRpc[_0x6eec('0x21')]({'attributes':_0x2f843e,'where':_0x1cc8d3}))['then'](function(_0x6e40b3){_0x4b8de1=_0x6e40b3;if(!_[_0x6eec('0x22')](_0x4b8de1)){if(_0x4b8de1[_0x6eec('0x23')]===0x1){_0x51a9e3=_0x4b8de1[0x0];logger[_0x6eec('0x24')](_0x6eec('0x25'),_0xfbcfa1[_0x6eec('0x26')],_0x5e8aba['id'],_0x51a9e3['id']);}else{logger['info'](_0x6eec('0x27'),_0xfbcfa1[_0x6eec('0x26')],_0x5e8aba['id'],_[_0x6eec('0x28')](_0x4b8de1,'id')[_0x6eec('0x29')](','));}return;}else{logger[_0x6eec('0x24')](_0x6eec('0x2a'),_0xfbcfa1[_0x6eec('0x26')],_0x5e8aba['id']);var _0x20bed3={'ListId':_0x485b5b};var _0x316317=_0x295cae['data4']&&_0x295cae[_0x6eec('0x2b')]!=='0'?_0x295cae[_0x6eec('0x2b')]:_0x6eec('0x19');if(_0x3387c2){logger[_0x6eec('0x24')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0xfbcfa1[_0x6eec('0x26')],_0x5e8aba['id']);_0x20bed3[_0x316317]=_[_0x6eec('0xf')](_0xfbcfa1['routeId'])?_0xfbcfa1['calleridnum']:_0xfbcfa1[_0x6eec('0x16')];if(_['isNil'](_0xfbcfa1[_0x6eec('0x2c')])){_0x20bed3[_0x6eec('0x2d')]=_0xfbcfa1[_0x6eec('0x2e')]&&_0xfbcfa1[_0x6eec('0x2e')]!==_0x6eec('0x2f')?_0xfbcfa1[_0x6eec('0x2e')]:_0x6eec('0x30');}else{_0x20bed3[_0x6eec('0x2d')]=_0xfbcfa1[_0x6eec('0x31')]&&_0xfbcfa1[_0x6eec('0x31')]!==''?_0xfbcfa1[_0x6eec('0x31')]:'Unknown';}return BPromise[_0x6eec('0x1f')]()[_0x6eec('0x20')](cmContactRpc[_0x6eec('0x32')](_0x20bed3))['then'](function(_0x57b40b){_0x51a9e3=_0x57b40b;_0x4b8de1['push'](_0x57b40b);if(_0x51a9e3){logger[_0x6eec('0x24')](_0x6eec('0x33'),_0xfbcfa1[_0x6eec('0x26')],_0x5e8aba['id'],_0x51a9e3['id']);}return;});}else{logger[_0x6eec('0x24')](_0x6eec('0x34'),_0xfbcfa1[_0x6eec('0x26')],_0x5e8aba['id']);_0x20bed3[_0x316317]=_[_0x6eec('0xf')](_0xfbcfa1[_0x6eec('0x2c')])?_0xfbcfa1[_0x6eec('0x17')]:_0xfbcfa1[_0x6eec('0x16')];if(_[_0x6eec('0xf')](_0xfbcfa1[_0x6eec('0x2c')])){_0x20bed3['firstName']=_0xfbcfa1[_0x6eec('0x2e')]&&_0xfbcfa1[_0x6eec('0x2e')]!==_0x6eec('0x2f')?_0xfbcfa1['calleridname']:_0x6eec('0x30');}else{_0x20bed3[_0x6eec('0x2d')]=_0xfbcfa1[_0x6eec('0x31')]&&_0xfbcfa1[_0x6eec('0x31')]!==_0x6eec('0x2f')?_0xfbcfa1[_0x6eec('0x31')]:'Unknown';}_0x51a9e3=_0x20bed3;_0x4b8de1[_0x6eec('0x35')](_0x20bed3);return;}}})[_0x6eec('0x20')](function(){if(_0x595dd4){emit(_0xfbcfa1[_0x6eec('0x26')],_0x5e8aba,util['format']('user:%s',_0x595dd4[_0x6eec('0x36')]),util[_0x6eec('0x37')](_0x6eec('0x38'),_0x295cae[_0x6eec('0x39')][_0x6eec('0x3a')]()),{'evt':_['merge'](_0xfbcfa1,{'autoCreate':_0x3387c2}),'contact':_0x51a9e3===undefined?{}:_0x51a9e3,'contacts':_0x4b8de1[_0x6eec('0x23')]===0x0?undefined:_0x4b8de1});}});}; \ No newline at end of file +var _0xb821=['routeId','destcalleridnum','calleridname','Unknown','destcalleridname','','push','format','name','trigger:%s','action','toLowerCase','merge','length','bluebird','ioredis','../../../../config/logger','redis','defaults','localhost','info','[CM][%s][%s]','stringify','exec','data1','data2','data5','xmd-contactid','ListId','data3','phone','map','calleridnum','firstName','lastName','fax','createdAt','scheduledAt','updatedAt','union','resolve','then','getContacts','isEmpty','[CM][%s][%s]\x20Contact\x20found:%s','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','uniqueid','join','data4','[CM][%s][%s]\x20Autocreate\x20enabled','isNil'];(function(_0x838813,_0x448f0f){var _0x2bd32d=function(_0x57b589){while(--_0x57b589){_0x838813['push'](_0x838813['shift']());}};_0x2bd32d(++_0x448f0f);}(_0xb821,0xa7));var _0x1b82=function(_0x11366a,_0x4af33b){_0x11366a=_0x11366a-0x0;var _0x2082fe=_0xb821[_0x11366a];return _0x2082fe;};'use strict';var _=require('lodash');var BPromise=require(_0x1b82('0x0'));var Redis=require(_0x1b82('0x1'));var util=require('util');var config=require('../../../../config/environment');var logger=require(_0x1b82('0x2'))('trigger');var cmContactRpc=require('../../rpc/cmContact');config[_0x1b82('0x3')]=_[_0x1b82('0x4')](config[_0x1b82('0x3')],{'host':_0x1b82('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1b82('0x3')]));function emit(_0x192434,_0x202a5f,_0x3632dd,_0x18f45f,_0x7b87e8){logger[_0x1b82('0x6')](_0x1b82('0x7'),_0x192434,_0x202a5f['id'],_0x3632dd,_0x18f45f,JSON[_0x1b82('0x8')](_0x7b87e8));io['to'](_0x3632dd)['emit'](_0x18f45f,_0x7b87e8);}exports[_0x1b82('0x9')]=function(_0x30c6ee,_0x44dfd4,_0x14c57a,_0xcffb87){var _0x17a96b,_0x739f99;var _0x1ce719={};var _0x5f521f=Number(_0x14c57a[_0x1b82('0xa')]);var _0x241d11=_0x14c57a[_0x1b82('0xb')]?Boolean(Number(_0x14c57a[_0x1b82('0xb')])):![];var _0x50aed7;var _0x1a6285=![];if(!_['isNil'](_0x14c57a['data5'])){if(_0x14c57a[_0x1b82('0xc')]=='1')_0x1a6285=!![];}if(!_0x1a6285){if(_0xcffb87['xmd-contactid']){_0x1ce719['id']=_0xcffb87[_0x1b82('0xd')];}}if(!_0x1ce719['id']){_0x1ce719[_0x1b82('0xe')]=_0x5f521f;_0x50aed7=_0x14c57a['data3']&&_0x14c57a[_0x1b82('0xf')]!=='0'?_0x14c57a['data3']['split'](','):[_0x1b82('0x10')];_0x1ce719['$or']=_[_0x1b82('0x11')](_0x50aed7,function(_0x25228b){var _0xf42818={};_0xf42818[_0x25228b]=_0xcffb87['routeId']?_0xcffb87['destcalleridnum']:_0xcffb87[_0x1b82('0x12')];return _0xf42818;});}var _0x5d66c3=['id',_0x1b82('0x13'),_0x1b82('0x14'),_0x1b82('0x10'),'mobile',_0x1b82('0x15'),_0x1b82('0xe'),_0x1b82('0x16'),_0x1b82('0x17'),_0x1b82('0x18')];var _0x47e99b=_[_0x1b82('0x19')](_0x5d66c3,_0x50aed7);BPromise[_0x1b82('0x1a')]()[_0x1b82('0x1b')](cmContactRpc[_0x1b82('0x1c')]({'attributes':_0x47e99b,'where':_0x1ce719}))[_0x1b82('0x1b')](function(_0x31fd64){_0x739f99=_0x31fd64;if(!_[_0x1b82('0x1d')](_0x739f99)){if(_0x739f99['length']===0x1){_0x17a96b=_0x739f99[0x0];logger[_0x1b82('0x6')](_0x1b82('0x1e'),_0xcffb87['uniqueid'],_0x44dfd4['id'],_0x17a96b['id']);}else{logger[_0x1b82('0x6')](_0x1b82('0x1f'),_0xcffb87[_0x1b82('0x20')],_0x44dfd4['id'],_['map'](_0x739f99,'id')[_0x1b82('0x21')](','));}return;}else{logger['info']('[CM][%s][%s]\x20Contact\x20not\x20found',_0xcffb87['uniqueid'],_0x44dfd4['id']);var _0xf2e556={'ListId':_0x5f521f};var _0x149d0f=_0x14c57a[_0x1b82('0x22')]&&_0x14c57a[_0x1b82('0x22')]!=='0'?_0x14c57a['data4']:_0x1b82('0x10');if(_0x241d11){logger[_0x1b82('0x6')](_0x1b82('0x23'),_0xcffb87[_0x1b82('0x20')],_0x44dfd4['id']);_0xf2e556[_0x149d0f]=_[_0x1b82('0x24')](_0xcffb87[_0x1b82('0x25')])?_0xcffb87[_0x1b82('0x12')]:_0xcffb87[_0x1b82('0x26')];if(_[_0x1b82('0x24')](_0xcffb87[_0x1b82('0x25')])){_0xf2e556[_0x1b82('0x13')]=_0xcffb87[_0x1b82('0x27')]&&_0xcffb87[_0x1b82('0x27')]!==''?_0xcffb87[_0x1b82('0x27')]:_0x1b82('0x28');}else{_0xf2e556[_0x1b82('0x13')]=_0xcffb87[_0x1b82('0x29')]&&_0xcffb87[_0x1b82('0x29')]!==_0x1b82('0x2a')?_0xcffb87[_0x1b82('0x29')]:_0x1b82('0x28');}return BPromise[_0x1b82('0x1a')]()[_0x1b82('0x1b')](cmContactRpc['createContact'](_0xf2e556))[_0x1b82('0x1b')](function(_0x29a31e){_0x17a96b=_0x29a31e;_0x739f99[_0x1b82('0x2b')](_0x29a31e);if(_0x17a96b){logger[_0x1b82('0x6')]('[CM][%s][%s]\x20Contact\x20created:%s',_0xcffb87[_0x1b82('0x20')],_0x44dfd4['id'],_0x17a96b['id']);}return;});}else{logger[_0x1b82('0x6')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0xcffb87[_0x1b82('0x20')],_0x44dfd4['id']);_0xf2e556[_0x149d0f]=_[_0x1b82('0x24')](_0xcffb87[_0x1b82('0x25')])?_0xcffb87['calleridnum']:_0xcffb87['destcalleridnum'];if(_[_0x1b82('0x24')](_0xcffb87['routeId'])){_0xf2e556['firstName']=_0xcffb87[_0x1b82('0x27')]&&_0xcffb87[_0x1b82('0x27')]!==_0x1b82('0x2a')?_0xcffb87['calleridname']:_0x1b82('0x28');}else{_0xf2e556[_0x1b82('0x13')]=_0xcffb87[_0x1b82('0x29')]&&_0xcffb87[_0x1b82('0x29')]!==''?_0xcffb87[_0x1b82('0x29')]:_0x1b82('0x28');}_0x17a96b=_0xf2e556;_0x739f99[_0x1b82('0x2b')](_0xf2e556);return;}}})['then'](function(){if(_0x30c6ee){emit(_0xcffb87['uniqueid'],_0x44dfd4,util[_0x1b82('0x2c')]('user:%s',_0x30c6ee[_0x1b82('0x2d')]),util[_0x1b82('0x2c')](_0x1b82('0x2e'),_0x14c57a[_0x1b82('0x2f')][_0x1b82('0x30')]()),{'evt':_[_0x1b82('0x31')](_0xcffb87,{'autoCreate':_0x241d11}),'contact':_0x17a96b===undefined?{}:_0x17a96b,'contacts':_0x739f99[_0x1b82('0x32')]===0x0?undefined:_0x739f99});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index c2f5971..dfcd374 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 _0xc7b3=['TemplateId','data2','html','template\x20not\x20found','uri','data3','isNil','location','windowWidth','data5','800','windowHeight','data6','render','winArguments','format','user:%s','name','trigger:%s:%s','jscripty','trigger:%s','exec','queue','urlforward','script','buildUri','parse','query','search','replace','channel','AllConditions','every','checkConditions','AnyConditions','some','field','account','chat','ChatWebsiteId','operator','value','upperFirst','AccountId','interaction','message','event','agent','membername','lastevent','routeId','mailSubstatus','null','substatus','offlineMessage','created','equals','exports','util','lodash','mustache','ioredis','./urlforward','./integration','./cmContact','./script','../../../config/logger','trigger','../ami','defaults','redis','socket.io-emitter','url','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','bind','custom:agentconnect','syncCustomEvent','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:amd','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:substatus','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','prototype','info','stringify','emit','clone','undefined','motionChannel','voice','checkTriggers','interface','status','checkTrigger','merge','variables','Actions','length','action','toLowerCase','contactmanager','data1','popup'];(function(_0x28e655,_0xb50ac){var _0x267f07=function(_0x5d0757){while(--_0x5d0757){_0x28e655['push'](_0x28e655['shift']());}};_0x267f07(++_0xb50ac);}(_0xc7b3,0x1c6));var _0x3c7b=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xc7b3[_0x53ccf2];return _0x5a2964;};'use strict';var util=require(_0x3c7b('0x0'));var _=require(_0x3c7b('0x1'));var url=require('url');var Mustache=require(_0x3c7b('0x2'));var Redis=require(_0x3c7b('0x3'));var urlforward=require(_0x3c7b('0x4'));var integration=require(_0x3c7b('0x5'));var cmContact=require(_0x3c7b('0x6'));var script=require(_0x3c7b('0x7'));var config=require('../../../config/environment');var logger=require(_0x3c7b('0x8'))(_0x3c7b('0x9'));var ami=require(_0x3c7b('0xa'));config['redis']=_[_0x3c7b('0xb')](config[_0x3c7b('0xc')],{'host':'localhost','port':0x18eb});var io=require(_0x3c7b('0xd'))(new Redis(config[_0x3c7b('0xc')]));var operators={'equals':function(_0x5cf03b,_0x43a1b3){return _0x5cf03b==_0x43a1b3;},'not_equals':function(_0x16968c,_0x3d8744){return _0x16968c!=_0x3d8744;}};var barAndWebActions=['popup',_0x3c7b('0xe'),'winapp'];function Trigger(_0x86188c){this[_0x3c7b('0xf')]=_0x86188c['triggers'];this[_0x3c7b('0x10')]=_0x86188c[_0x3c7b('0x10')];this[_0x3c7b('0x11')]=_0x86188c[_0x3c7b('0x11')];this[_0x3c7b('0x12')]=_0x86188c[_0x3c7b('0x12')];this['voiceExtensions']=_0x86188c[_0x3c7b('0x13')];this['zendeskAccounts']=_0x86188c[_0x3c7b('0x14')];this[_0x3c7b('0x15')]=_0x86188c[_0x3c7b('0x15')];this[_0x3c7b('0x16')]=_0x86188c[_0x3c7b('0x16')];this[_0x3c7b('0x17')]=_0x86188c[_0x3c7b('0x17')];this[_0x3c7b('0x18')]=_0x86188c[_0x3c7b('0x18')];this[_0x3c7b('0x19')]=_0x86188c[_0x3c7b('0x19')];this[_0x3c7b('0x1a')]=_0x86188c['vtigerAccounts'];this[_0x3c7b('0x1b')]=_0x86188c[_0x3c7b('0x1b')];this[_0x3c7b('0x1c')]=_0x86188c[_0x3c7b('0x1c')];this[_0x3c7b('0x1d')]=_0x86188c[_0x3c7b('0x1d')];this[_0x3c7b('0x1e')]={'zendesk':this[_0x3c7b('0x14')],'salesforce':this[_0x3c7b('0x16')],'freshdesk':this[_0x3c7b('0x15')],'sugarcrm':this[_0x3c7b('0x17')],'zoho':this[_0x3c7b('0x18')],'desk':this[_0x3c7b('0x19')],'vtiger':this[_0x3c7b('0x1a')],'dynamics365':this[_0x3c7b('0x1c')],'freshsales':this[_0x3c7b('0x1d')],'servicenow':this[_0x3c7b('0x1b')]};ami['on'](_0x3c7b('0x1f'),this['syncCustomEvent'][_0x3c7b('0x20')](this));ami['on'](_0x3c7b('0x21'),this[_0x3c7b('0x22')][_0x3c7b('0x20')](this));ami['on'](_0x3c7b('0x23'),this[_0x3c7b('0x22')][_0x3c7b('0x20')](this));ami['on'](_0x3c7b('0x24'),this[_0x3c7b('0x22')][_0x3c7b('0x20')](this));ami['on'](_0x3c7b('0x25'),this[_0x3c7b('0x22')][_0x3c7b('0x20')](this));ami['on'](_0x3c7b('0x26'),this['syncCustomEvent']['bind'](this));ami['on'](_0x3c7b('0x27'),this[_0x3c7b('0x22')]['bind'](this));ami['on'](_0x3c7b('0x28'),this[_0x3c7b('0x22')][_0x3c7b('0x20')](this));ami['on'](_0x3c7b('0x29'),this[_0x3c7b('0x22')][_0x3c7b('0x20')](this));ami['on'](_0x3c7b('0x2a'),this[_0x3c7b('0x22')][_0x3c7b('0x20')](this));ami['on']('custom:queuecallerabandon',this['syncCustomEvent'][_0x3c7b('0x20')](this));ami['on'](_0x3c7b('0x2b'),this[_0x3c7b('0x22')][_0x3c7b('0x20')](this));ami['on'](_0x3c7b('0x2c'),this[_0x3c7b('0x2d')][_0x3c7b('0x20')](this));ami['on'](_0x3c7b('0x2e'),this['syncAgentDial'][_0x3c7b('0x20')](this));ami['on'](_0x3c7b('0x2f'),this[_0x3c7b('0x2d')]['bind'](this));ami['on'](_0x3c7b('0x30'),this[_0x3c7b('0x22')][_0x3c7b('0x20')](this));ami['on']('custom:closedinteraction',this[_0x3c7b('0x22')][_0x3c7b('0x20')](this));ami['on'](_0x3c7b('0x31'),this['syncCustomEvent'][_0x3c7b('0x20')](this));ami['on'](_0x3c7b('0x32'),this['syncCustomEvent'][_0x3c7b('0x20')](this));ami['on'](_0x3c7b('0x33'),this[_0x3c7b('0x22')]['bind'](this));ami['on'](_0x3c7b('0x34'),this[_0x3c7b('0x22')]['bind'](this));ami['on']('custom:rejectmessage',this[_0x3c7b('0x22')][_0x3c7b('0x20')](this));ami['on']('custom:offlineMessage',this[_0x3c7b('0x22')][_0x3c7b('0x20')](this));}Trigger[_0x3c7b('0x35')]['emit']=function(_0x423a9d,_0x181a2f,_0x1b8022){logger[_0x3c7b('0x36')](_0x423a9d,_0x181a2f,JSON[_0x3c7b('0x37')](_0x1b8022));io['to'](_0x423a9d)[_0x3c7b('0x38')](_0x181a2f,_0x1b8022);};Trigger[_0x3c7b('0x35')][_0x3c7b('0x22')]=function(_0x18f250){var _0x42350b=_[_0x3c7b('0x39')](_0x18f250);if(typeof _0x42350b['motionChannel']===_0x3c7b('0x3a')){_0x42350b[_0x3c7b('0x3b')]=_0x3c7b('0x3c');}this[_0x3c7b('0x3d')](_0x42350b);};Trigger['prototype']['syncAgentDial']=function(_0xe8a18a){if(this[_0x3c7b('0x10')][_0xe8a18a[_0x3c7b('0x3e')]]){this[_0x3c7b('0x22')](_0xe8a18a);}};Trigger[_0x3c7b('0x35')][_0x3c7b('0x3d')]=function(_0x2c9b5c){var _0xb9e7a0;for(var _0x12b8e3 in this[_0x3c7b('0xf')]){if(this[_0x3c7b('0xf')]['hasOwnProperty'](_0x12b8e3)){if(this[_0x3c7b('0xf')][_0x12b8e3][_0x3c7b('0x3f')]){_0xb9e7a0=this[_0x3c7b('0x40')](this['triggers'][_0x12b8e3],_0x2c9b5c);if(_0xb9e7a0){_[_0x3c7b('0x41')](_0x2c9b5c,_0x2c9b5c[_0x3c7b('0x42')]);for(var _0x3e4d54=0x0,_0x4f54b7,_0x5207f8,_0x432246;_0x3e4d540x0){_0x57001c=_[_0x35fc('0x26')](_0x274208,_0x1a5d92);}return _0x57001c;}function getCustomFields(_0x383837,_0x9f3c8a){var _0x3735da=[];var _0x134dfa={'custom_fields':{}};if(_0x383837[_0x35fc('0x25')]>0x0){_[_0x35fc('0x27')](_0x383837,function(_0x54aedc){if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc['type'])&&_0x54aedc[_0x35fc('0x2b')]&&!_0x54aedc[_0x35fc('0x2c')]){_0x134dfa[_0x54aedc[_0x35fc('0x2b')][_0x35fc('0x2d')]()]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc[_0x35fc('0x2f')])&&_0x54aedc['idField']&&_0x54aedc['customField']){_0x134dfa[_0x35fc('0x30')][_0x54aedc['idField']]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_0x54aedc[_0x35fc('0x2f')]===_0x35fc('0x31')&&_0x54aedc[_0x35fc('0x32')]&&_0x54aedc[_0x35fc('0x33')]&&_0x54aedc['customField']){_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]][_0x35fc('0x1e')]());}else if(_0x54aedc[_0x35fc('0x2f')]==='customVariable'&&_0x54aedc[_0x35fc('0x34')]&&_0x54aedc[_0x35fc('0x34')][_0x35fc('0x35')]&&_0x54aedc['idField']&&_0x54aedc[_0x35fc('0x2c')]){_0x9f3c8a[_0x54aedc['Variable'][_0x35fc('0x35')][_0x35fc('0x2d')]()]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc['Variable']['name']['toLowerCase']()][_0x35fc('0x1e')]());}});}if(_0x134dfa['priority']){_0x134dfa[_0x35fc('0x36')]=Number(_0x134dfa['priority']);}return _0x134dfa;}function getTicket(_0x9c6b65,_0x1f2d66,_0x2ca9ac,_0x22b724,_0x1c10e0){logger[_0x35fc('0xb')](_0x35fc('0x37'));var _0x4ec0dc=_[_0x35fc('0x38')]({'subject':intUtil[_0x35fc('0x39')](_0x22b724['Subjects'],_0x1c10e0,'\x20'),'type':_0x35fc('0x3a'),'status':_0x35fc('0x3b'),'labels':[_0x35fc('0x3c'),_0x35fc('0x3d'),_0x35fc('0x3e')][_0x35fc('0x3f')](getTags(_0x22b724['Tags'],_0x35fc('0x35'))),'description':intUtil[_0x35fc('0x39')](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0x35fc('0x41'),_0x1f2d66['id']),'class':_0x35fc('0x42')}},'message':{'direction':'in','body':intUtil['getString'](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a')}},getCustomFields(_0x22b724[_0x35fc('0x43')],_0x1c10e0));return request({'uri':util[_0x35fc('0x14')](_0x35fc('0x44'),_0x9c6b65[_0x35fc('0xe')],_0x2ca9ac['id']),'method':_0x35fc('0x24'),'body':_0x4ec0dc});}exports[_0x35fc('0x45')]=function(_0x3ec51f,_0x5a7e9e,_0x596e83,_0x210d5d,_0x36fcf9,_0x4fdc6d){var _0x5c2e5c,_0x4ff202;_0x4fdc6d[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x4fdc6d['remoteUri']);_0x4fdc6d[_0x35fc('0x47')]=intUtil[_0x35fc('0x46')](_0x4fdc6d[_0x35fc('0x47')]);if(_0x36fcf9&&_0x36fcf9[_0x35fc('0x48')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x5a7e9e['recordingURL']=util['format'](_0x35fc('0x49'),_0x4fdc6d[_0x35fc('0x47')],_0x5a7e9e['uniqueid'],md5(_0x5a7e9e[_0x35fc('0x4a')]));}else{_0x5a7e9e['recordingURL']='';}headers[_0x35fc('0x4b')]=getAuth(_0x4fdc6d);return getUser(_0x4fdc6d,_0x210d5d[_0x35fc('0x4c')])[_0x35fc('0x21')](function(_0x2de5d1){_0x5c2e5c=_0x2de5d1;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x5c2e5c['id']);return getEndUser(_0x4fdc6d,_0x5a7e9e[_0x35fc('0x4d')],_0x5a7e9e[_0x35fc('0x4e')]);})['then'](function(_0x18181b){_0x4ff202=_0x18181b;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x4ff202['id']);return getTicket(_0x4fdc6d,_0x5c2e5c,_0x4ff202,_0x596e83,_0x5a7e9e);})[_0x35fc('0x21')](function(_0x5bc8c3){if(_0x5bc8c3){logger[_0x35fc('0xb')]('Ticket\x20created!');logger['info'](_0x35fc('0x50'),_0x5bc8c3['id']);switch(_0x4fdc6d[_0x35fc('0x2f')]){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x53'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d['name']),_0x35fc('0x55'),{'recordId':_0x5bc8c3['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d[_0x35fc('0x35')]),_0x35fc('0x58'),{'uri':util[_0x35fc('0x14')](_0x35fc('0x59'),_0x5bc8c3['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x52'),_0x35fc('0x5b'));}}})['catch'](function(_0x553ed6){console[_0x35fc('0x5a')](_0x553ed6);logger[_0x35fc('0x5a')](_0x35fc('0x52'),JSON[_0x35fc('0x17')](_0x553ed6));});};exports[_0x35fc('0x5c')]=function(_0x3e6494,_0x4a4798,_0x4f024c,_0x388521,_0x19b2ce,_0x395d63,_0x38bc78){var _0x5b2595,_0x467980;_0x395d63[_0x35fc('0xe')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0xe')]);_0x395d63[_0x35fc('0x47')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0x47')]);if(_0x38bc78&&_0x38bc78[_0x35fc('0x5d')]&&_0x38bc78[_0x35fc('0x5d')]!==_0x35fc('0x5e')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x4a4798[_0x35fc('0x5f')]=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x395d63[_0x35fc('0x47')],_0x4a4798[_0x35fc('0x4a')],md5(_0x4a4798[_0x35fc('0x4a')]));}headers[_0x35fc('0x4b')]=getAuth(_0x395d63);return getUser(_0x395d63,_0x388521[_0x35fc('0x4c')])['then'](function(_0x2d9d45){_0x5b2595=_0x2d9d45;logger[_0x35fc('0xb')](_0x35fc('0x60'),_0x5b2595['id']);return getEndUser(_0x395d63,_0x4a4798['destcalleridname'],_0x4a4798[_0x35fc('0x61')]);})[_0x35fc('0x21')](function(_0x47fb1a){_0x467980=_0x47fb1a;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x467980['id']);return getTicket(_0x395d63,_0x5b2595,_0x467980,_0x4f024c,_0x4a4798);})[_0x35fc('0x21')](function(_0x1c4c33){if(_0x1c4c33){logger[_0x35fc('0xb')](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x1c4c33['id']);switch(_0x395d63['type']){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:desk:display',{'recordId':_0x1c4c33['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:browser:url',{'uri':util['format']('%s/agent/tickets/%s',_0x395d63[_0x35fc('0xe')],_0x1c4c33['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x63'),_0x35fc('0x5b'));}}})['catch'](function(_0x458eb8){logger[_0x35fc('0x5a')](_0x35fc('0x63'),JSON[_0x35fc('0x17')](_0x458eb8));});};exports[_0x35fc('0x64')]=function(_0x1d0e53,_0x27071b,_0x2127e0,_0x462ceb,_0x4c3ace,_0x35d7c8){var _0x47c75f,_0xfbd737;_0x35d7c8[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x35d7c8[_0x35fc('0xe')]);_0x35d7c8['serverUrl']=intUtil[_0x35fc('0x46')](_0x35d7c8['serverUrl']);if(_0x4c3ace&&_0x4c3ace['monitor_format']){logger['info']('['+_0x27071b[_0x35fc('0x65')]['toUpperCase']()+']',_0x35fc('0x66'));_0x27071b['recordingURL']=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x35d7c8[_0x35fc('0x47')],_0x27071b[_0x35fc('0x4a')],md5(_0x27071b[_0x35fc('0x4a')]));}else{_0x27071b[_0x35fc('0x5f')]='';}headers['Authorization']=getAuth(_0x35d7c8);return getUser(_0x35d7c8)[_0x35fc('0x21')](function(_0x1e2214){_0x47c75f=_0x1e2214;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x47c75f['id']);return getEndUser(_0x35d7c8,_0x27071b[_0x35fc('0x4d')],_0x27071b[_0x35fc('0x4e')]);})[_0x35fc('0x21')](function(_0x3c1b56){_0xfbd737=_0x3c1b56;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0xfbd737['id']);return getTicket(_0x35d7c8,_0x47c75f,_0xfbd737,_0x2127e0,_0x27071b);})[_0x35fc('0x21')](function(_0x4464d5){if(_0x4464d5){logger['info'](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x4464d5['id']);}})['catch'](function(_0x1c88d8){logger[_0x35fc('0x5a')]('['+_0x27071b['lastevent']['toUpperCase']()+']',JSON[_0x35fc('0x17')](_0x1c88d8));});}; \ No newline at end of file +var _0x7217=['format','%s/users','remoteUri','then','total_entries','find','entries','info','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','debug','stringify','GET','authType','basic','%s:%s','username','password','token','Basic\x20%s','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','_embedded','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','length','map','forEach','string','picklist','nameField','customField','content','toString','includes','idField','custom_fields','variable','variableName','type','customVariable','Variable','name','toLowerCase','priority','Creating\x20new\x20ticket...','merge','getString','new','xCALLY','Motion','CTI','Tags','Descriptions','user','%s/customers/%d/cases','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','integrationTab','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','catch','outbound','recordingFormat','none','[OUTBOUND]','uniqueid','The\x20Ticket\x20ID\x20is:','%s/agent/tickets/%s','unmanaged','lastevent','toUpperCase','calleridname','lodash','md5','util','ioredis','./util','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','emit','application/json','validateEmail','Getting\x20agent\x20with\x20email'];(function(_0x50c065,_0x56a1f6){var _0x24a377=function(_0x1c28e1){while(--_0x1c28e1){_0x50c065['push'](_0x50c065['shift']());}};_0x24a377(++_0x56a1f6);}(_0x7217,0x19e));var _0x7721=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0x7217[_0x4c7fb5];return _0x2e10ac;};'use strict';var _=require(_0x7721('0x0'));var rp=require('request-promise');var md5=require(_0x7721('0x1'));var util=require(_0x7721('0x2'));var Redis=require(_0x7721('0x3'));var intUtil=require(_0x7721('0x4'));var config=require(_0x7721('0x5'));var logger=require('../../../../config/logger')('desk');config[_0x7721('0x6')]=_[_0x7721('0x7')](config[_0x7721('0x6')],{'host':_0x7721('0x8'),'port':0x18eb});var io=require(_0x7721('0x9'))(new Redis(config[_0x7721('0x6')]));function emit(_0x18ab6b,_0x21f680,_0x225610){io['to'](_0x18ab6b)[_0x7721('0xa')](_0x21f680,_0x225610);}var headers={'Content-Type':_0x7721('0xb'),'Accept':_0x7721('0xb')};function getUser(_0xfa8835,_0x138740){if(intUtil[_0x7721('0xc')](_0x138740)===!![]){logger['info'](_0x7721('0xd'),_0x138740);return request({'uri':util[_0x7721('0xe')](_0x7721('0xf'),_0xfa8835[_0x7721('0x10')])})[_0x7721('0x11')](function(_0x409b37){if(_0x409b37[_0x7721('0x12')]){return _[_0x7721('0x13')](_0x409b37['_embedded'][_0x7721('0x14')],{'email':_0x138740});}})[_0x7721('0x11')](function(_0x57ff6d){if(_0x57ff6d){logger[_0x7721('0x15')](_0x7721('0x16'));return _0x57ff6d;}else{logger[_0x7721('0x15')](_0x7721('0x17'));return request({'uri':util['format'](_0x7721('0x18'),_0xfa8835[_0x7721('0x10')])});}});}else{logger['info']('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0x7721('0x18'),_0xfa8835[_0x7721('0x10')])});}}function request(_0x3cc909){logger[_0x7721('0x19')]('[HTTP]',JSON[_0x7721('0x1a')](_0x3cc909));return rp(_['defaults'](_0x3cc909,{'method':_0x7721('0x1b'),'headers':headers,'json':!![]}));}function getAuth(_0x5cb0e6){var _0xfec626;if(_0x5cb0e6[_0x7721('0x1c')]===_0x7721('0x1d')){_0xfec626=util[_0x7721('0xe')](_0x7721('0x1e'),_0x5cb0e6[_0x7721('0x1f')],_0x5cb0e6[_0x7721('0x20')]);}else if(_0x5cb0e6[_0x7721('0x1c')]===_0x7721('0x21')){_0xfec626=util[_0x7721('0xe')]('%s/token:%s',_0x5cb0e6[_0x7721('0x1f')],_0x5cb0e6[_0x7721('0x21')]);}return util[_0x7721('0xe')](_0x7721('0x22'),new Buffer(_0xfec626)['toString'](_0x7721('0x23')));}function getEndUser(_0x512f31,_0xb9e9dd,_0x288e3a){logger[_0x7721('0x15')](_0x7721('0x24'),_0x288e3a);return request({'uri':util[_0x7721('0xe')](_0x7721('0x25'),_0x512f31[_0x7721('0x10')]),'qs':{'phone':_0x288e3a}})['then'](function(_0x216f20){if(_0x216f20[_0x7721('0x12')]){logger[_0x7721('0x15')](_0x7721('0x26'));return _0x216f20[_0x7721('0x27')][_0x7721('0x14')][0x0];}else{logger[_0x7721('0x15')](_0x7721('0x28'));return request({'uri':util[_0x7721('0xe')]('%s/customers',_0x512f31[_0x7721('0x10')]),'method':'POST','body':{'first_name':_0xb9e9dd,'title':_0xb9e9dd,'phone_numbers':[{'type':'work','value':_0x288e3a}]}});}});}function getTags(_0x315202,_0x343c19){var _0x53c904=[];if(_0x315202&&_0x315202[_0x7721('0x29')]>0x0){_0x53c904=_[_0x7721('0x2a')](_0x315202,_0x343c19);}return _0x53c904;}function getCustomFields(_0x37b9f0,_0xd7d703){var _0x1da2d8=[];var _0x5c54f0={'custom_fields':{}};if(_0x37b9f0[_0x7721('0x29')]>0x0){_[_0x7721('0x2b')](_0x37b9f0,function(_0x497f9f){if(_['includes']([_0x7721('0x2c'),_0x7721('0x2d')],_0x497f9f['type'])&&_0x497f9f[_0x7721('0x2e')]&&!_0x497f9f[_0x7721('0x2f')]){_0x5c54f0[_0x497f9f[_0x7721('0x2e')]['toLowerCase']()]=_0x497f9f[_0x7721('0x30')][_0x7721('0x31')]();}else if(_[_0x7721('0x32')]([_0x7721('0x2c'),_0x7721('0x2d')],_0x497f9f['type'])&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f[_0x7721('0x2f')]){_0x5c54f0[_0x7721('0x34')][_0x497f9f['idField']]=_0x497f9f[_0x7721('0x30')][_0x7721('0x31')]();}else if(_0x497f9f['type']===_0x7721('0x35')&&_0x497f9f['variableName']&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f[_0x7721('0x2f')]){_0xd7d703[_0x497f9f[_0x7721('0x36')]]&&(_0x5c54f0[_0x7721('0x34')][_0x497f9f[_0x7721('0x33')]]=_0xd7d703[_0x497f9f[_0x7721('0x36')]][_0x7721('0x31')]());}else if(_0x497f9f[_0x7721('0x37')]===_0x7721('0x38')&&_0x497f9f[_0x7721('0x39')]&&_0x497f9f[_0x7721('0x39')]['name']&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f['customField']){_0xd7d703[_0x497f9f[_0x7721('0x39')][_0x7721('0x3a')][_0x7721('0x3b')]()]&&(_0x5c54f0[_0x7721('0x34')][_0x497f9f[_0x7721('0x33')]]=_0xd7d703[_0x497f9f[_0x7721('0x39')]['name']['toLowerCase']()]['toString']());}});}if(_0x5c54f0['priority']){_0x5c54f0[_0x7721('0x3c')]=Number(_0x5c54f0[_0x7721('0x3c')]);}return _0x5c54f0;}function getTicket(_0x1acc72,_0x22ef35,_0x4a90ce,_0xa389fa,_0x4cf659){logger[_0x7721('0x15')](_0x7721('0x3d'));var _0x5a278e=_[_0x7721('0x3e')]({'subject':intUtil[_0x7721('0x3f')](_0xa389fa['Subjects'],_0x4cf659,'\x20'),'type':'phone','status':_0x7721('0x40'),'labels':[_0x7721('0x41'),_0x7721('0x42'),_0x7721('0x43')]['concat'](getTags(_0xa389fa[_0x7721('0x44')],_0x7721('0x3a'))),'description':intUtil[_0x7721('0x3f')](_0xa389fa[_0x7721('0x45')],_0x4cf659,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7721('0xe')]('/api/v2/users/%d',_0x22ef35['id']),'class':_0x7721('0x46')}},'message':{'direction':'in','body':intUtil['getString'](_0xa389fa[_0x7721('0x45')],_0x4cf659,'\x0a')}},getCustomFields(_0xa389fa['Fields'],_0x4cf659));return request({'uri':util[_0x7721('0xe')](_0x7721('0x47'),_0x1acc72[_0x7721('0x10')],_0x4a90ce['id']),'method':'POST','body':_0x5a278e});}exports[_0x7721('0x48')]=function(_0x11d853,_0x1ad315,_0x481fa8,_0x9f7b1d,_0x754071,_0xdb3033){var _0x2d5f35,_0x135dbc;_0xdb3033[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0xdb3033['remoteUri']);_0xdb3033['serverUrl']=intUtil[_0x7721('0x49')](_0xdb3033[_0x7721('0x4a')]);if(_0x754071&&_0x754071[_0x7721('0x4b')]){logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x4d'));_0x1ad315[_0x7721('0x4e')]=util[_0x7721('0xe')](_0x7721('0x4f'),_0xdb3033[_0x7721('0x4a')],_0x1ad315['uniqueid'],md5(_0x1ad315['uniqueid']));}else{_0x1ad315[_0x7721('0x4e')]='';}headers[_0x7721('0x50')]=getAuth(_0xdb3033);return getUser(_0xdb3033,_0x9f7b1d[_0x7721('0x51')])[_0x7721('0x11')](function(_0x589e95){_0x2d5f35=_0x589e95;logger[_0x7721('0x15')](_0x7721('0x52'),_0x2d5f35['id']);return getEndUser(_0xdb3033,_0x1ad315['calleridname'],_0x1ad315[_0x7721('0x53')]);})['then'](function(_0x2682b1){_0x135dbc=_0x2682b1;logger['info'](_0x7721('0x54'),_0x135dbc['id']);return getTicket(_0xdb3033,_0x2d5f35,_0x135dbc,_0x481fa8,_0x1ad315);})[_0x7721('0x11')](function(_0xf17c40){if(_0xf17c40){logger['info'](_0x7721('0x55'));logger[_0x7721('0x15')]('The\x20Ticket\x20ID\x20is:',_0xf17c40['id']);switch(_0xdb3033[_0x7721('0x37')]){case _0x7721('0x56'):logger[_0x7721('0x15')]('[QUEUE]',_0x7721('0x57'));emit(util['format'](_0x7721('0x58'),_0x9f7b1d[_0x7721('0x3a')]),_0x7721('0x59'),{'recordId':_0xf17c40['id']});break;case _0x7721('0x5a'):logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x5b'));emit(util[_0x7721('0xe')](_0x7721('0x58'),_0x9f7b1d[_0x7721('0x3a')]),_0x7721('0x5c'),{'uri':util[_0x7721('0xe')](_0x7721('0x5d'),_0xf17c40['id'])});break;default:logger[_0x7721('0x5e')](_0x7721('0x4c'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x7721('0x5f')](function(_0x2f6f30){console[_0x7721('0x5e')](_0x2f6f30);logger[_0x7721('0x5e')](_0x7721('0x4c'),JSON[_0x7721('0x1a')](_0x2f6f30));});};exports[_0x7721('0x60')]=function(_0x57484c,_0x234bee,_0x17036e,_0x134908,_0x3b7382,_0x1f1e84,_0x9c0d4){var _0x7fbd6c,_0x33287d;_0x1f1e84[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0x1f1e84[_0x7721('0x10')]);_0x1f1e84['serverUrl']=intUtil[_0x7721('0x49')](_0x1f1e84[_0x7721('0x4a')]);if(_0x9c0d4&&_0x9c0d4[_0x7721('0x61')]&&_0x9c0d4[_0x7721('0x61')]!==_0x7721('0x62')){logger[_0x7721('0x15')](_0x7721('0x63'),_0x7721('0x4d'));_0x234bee[_0x7721('0x4e')]=util[_0x7721('0xe')](_0x7721('0x4f'),_0x1f1e84[_0x7721('0x4a')],_0x234bee[_0x7721('0x64')],md5(_0x234bee[_0x7721('0x64')]));}headers[_0x7721('0x50')]=getAuth(_0x1f1e84);return getUser(_0x1f1e84,_0x134908['email'])['then'](function(_0x4e112e){_0x7fbd6c=_0x4e112e;logger[_0x7721('0x15')]('The\x20User\x20ID\x20is:',_0x7fbd6c['id']);return getEndUser(_0x1f1e84,_0x234bee['destcalleridname'],_0x234bee['destcalleridnum']);})['then'](function(_0x47925a){_0x33287d=_0x47925a;logger[_0x7721('0x15')](_0x7721('0x54'),_0x33287d['id']);return getTicket(_0x1f1e84,_0x7fbd6c,_0x33287d,_0x17036e,_0x234bee);})['then'](function(_0x5181d7){if(_0x5181d7){logger['info']('Ticket\x20created!');logger['info'](_0x7721('0x65'),_0x5181d7['id']);switch(_0x1f1e84['type']){case'integrationTab':logger['info'](_0x7721('0x4c'),_0x7721('0x57'));emit(util[_0x7721('0xe')]('user:%s',_0x134908[_0x7721('0x3a')]),_0x7721('0x59'),{'recordId':_0x5181d7['id']});break;case _0x7721('0x5a'):logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x5b'));emit(util[_0x7721('0xe')](_0x7721('0x58'),_0x134908[_0x7721('0x3a')]),_0x7721('0x5c'),{'uri':util[_0x7721('0xe')](_0x7721('0x66'),_0x1f1e84[_0x7721('0x10')],_0x5181d7['id'])});break;default:logger[_0x7721('0x5e')](_0x7721('0x63'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x7721('0x5f')](function(_0x2c93b0){logger[_0x7721('0x5e')](_0x7721('0x63'),JSON['stringify'](_0x2c93b0));});};exports[_0x7721('0x67')]=function(_0x104f05,_0x4c8284,_0x3e7df3,_0x5d37ad,_0x1f508d,_0x4bfb48){var _0x36a3a6,_0x3f9eaa;_0x4bfb48[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0x4bfb48[_0x7721('0x10')]);_0x4bfb48[_0x7721('0x4a')]=intUtil[_0x7721('0x49')](_0x4bfb48['serverUrl']);if(_0x1f508d&&_0x1f508d[_0x7721('0x4b')]){logger[_0x7721('0x15')]('['+_0x4c8284[_0x7721('0x68')][_0x7721('0x69')]()+']',_0x7721('0x4d'));_0x4c8284[_0x7721('0x4e')]=util[_0x7721('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4bfb48[_0x7721('0x4a')],_0x4c8284[_0x7721('0x64')],md5(_0x4c8284['uniqueid']));}else{_0x4c8284[_0x7721('0x4e')]='';}headers['Authorization']=getAuth(_0x4bfb48);return getUser(_0x4bfb48)[_0x7721('0x11')](function(_0x382800){_0x36a3a6=_0x382800;logger[_0x7721('0x15')](_0x7721('0x52'),_0x36a3a6['id']);return getEndUser(_0x4bfb48,_0x4c8284[_0x7721('0x6a')],_0x4c8284[_0x7721('0x53')]);})[_0x7721('0x11')](function(_0x5dca04){_0x3f9eaa=_0x5dca04;logger[_0x7721('0x15')](_0x7721('0x54'),_0x3f9eaa['id']);return getTicket(_0x4bfb48,_0x36a3a6,_0x3f9eaa,_0x3e7df3,_0x4c8284);})[_0x7721('0x11')](function(_0x5f08cc){if(_0x5f08cc){logger['info']('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x5f08cc['id']);}})[_0x7721('0x5f')](function(_0x2645dd){logger['error']('['+_0x4c8284[_0x7721('0x68')][_0x7721('0x69')]()+']',JSON[_0x7721('0x1a')](_0x2645dd));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index c72398a..78968bd 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 _0x665c=['format',']\x20The\x20%s\x20ID\x20is:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','lodash','bluebird','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','localhost','socket.io-emitter','redis','POST','clientId','remoteUri','username','password','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','systemusers?$select=internalemailaddress,isdisabled,systemuserid','4.0','value','isNil','validateEmail','email','userEmail','length','isdisabled','info',']\x20Agent\x20found\x20','userId','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','internalemailaddress','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','Bearer\x20','headers','odata-entityid','substring','lastIndexOf','enduserId','GET','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','%2b','telephone1','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing','forEach','includes','string','picklist','type','nameField','customField','idField','indexOf','ticketType','incident','getString','Subjects','Descriptions','/contacts(','phonecall','callDirection','queue','phonecalls','assign','Fields','ticketId','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','stripTrailingSlash','serverUrl','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingFormat','[OUTBOUND]','recordingURL',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate',']\x20The\x20Enduser\x20ID\x20is:'];(function(_0x52f66c,_0xf5eb54){var _0x36e755=function(_0x269e4e){while(--_0x269e4e){_0x52f66c['push'](_0x52f66c['shift']());}};_0x36e755(++_0xf5eb54);}(_0x665c,0x1a9));var _0xc665=function(_0x68efb,_0xa385ec){_0x68efb=_0x68efb-0x0;var _0xdabd2a=_0x665c[_0x68efb];return _0xdabd2a;};'use strict';var _=require(_0xc665('0x0'));var BPromise=require(_0xc665('0x1'));var rp=require(_0xc665('0x2'));var util=require(_0xc665('0x3'));var intUtil=require(_0xc665('0x4'));var md5=require(_0xc665('0x5'));var Redis=require(_0xc665('0x6'));var logger=require(_0xc665('0x7'))(_0xc665('0x8'));var config=require(_0xc665('0x9'));config['redis']=_['defaults'](config['redis'],{'host':_0xc665('0xa'),'port':0x18eb});var io=require(_0xc665('0xb'))(new Redis(config[_0xc665('0xc')]));function getAuthToken(_0x5d7ef4,_0x5cf283,_0x3acce4){var _0x189ad9={'method':_0xc665('0xd'),'uri':_0x5cf283,'form':{'client_id':_0x5d7ef4[_0xc665('0xe')],'resource':_0x5d7ef4[_0xc665('0xf')],'username':_0x5d7ef4[_0xc665('0x10')],'password':_0x5d7ef4[_0xc665('0x11')],'grant_type':_0xc665('0x11'),'client_secret':_0x5d7ef4['clientSecret']},'json':!![]};return rp(_0x189ad9)[_0xc665('0x12')](function(_0x5a305d){return _0x5a305d[_0xc665('0x13')];})[_0xc665('0x14')](function(_0x15c749){logger[_0xc665('0x15')]('['+[_0x3acce4[_0xc665('0x16')]()]+_0xc665('0x17'));return _0x15c749[_0xc665('0x18')];});}function getUser(_0x5a5f19,_0xf60e4d,_0x452dcf,_0x33d93d,_0x4b4884,_0x17adf7){return new BPromise(function(_0x1d9d9,_0x2ef898){return getAuthToken(_0xf60e4d,_0x33d93d,_0x17adf7)[_0xc665('0x12')](function(_0x25e33a){var _0x104a82={'method':'GET','uri':_0x4b4884+_0xc665('0x19'),'headers':{'Authorization':'Bearer\x20'+_0x25e33a,'OData-Version':_0xc665('0x1a')},'json':!![]};return rp(_0x104a82);})[_0xc665('0x12')](function(_0xc64d3b){var _0x55433a=_0xc64d3b[_0xc665('0x1b')];var _0x41aede=![];var _0x3cc5c8=null;if(!_[_0xc665('0x1c')](_0x452dcf)){if(intUtil[_0xc665('0x1d')](_0x452dcf[_0xc665('0x1e')])){_0x5a5f19[_0xc665('0x1f')]=_0x452dcf[_0xc665('0x1e')];for(_0x3cc5c8=0x0;_0x3cc5c8<_0x55433a[_0xc665('0x20')];_0x3cc5c8++){if(_0x55433a[_0x3cc5c8]['internalemailaddress']===_0x452dcf['email']&&!_0x55433a[_0x3cc5c8][_0xc665('0x21')]){_0x41aede=!![];logger[_0xc665('0x22')]('['+[_0x17adf7[_0xc665('0x16')]()]+_0xc665('0x23')+_0x55433a[_0x3cc5c8]['systemuserid']+'!');_0x5a5f19[_0xc665('0x24')]=_0x55433a[_0x3cc5c8][_0xc665('0x25')];}}}}if(!_0x41aede){logger['info']('['+[_0x17adf7[_0xc665('0x16')]()]+_0xc665('0x26'));_0x5a5f19[_0xc665('0x1f')]=_0xf60e4d[_0xc665('0x10')];for(_0x3cc5c8=0x0;_0x3cc5c8<_0x55433a[_0xc665('0x20')];_0x3cc5c8++){if(_0x55433a[_0x3cc5c8][_0xc665('0x27')]===_0xf60e4d[_0xc665('0x10')]){_0x5a5f19[_0xc665('0x24')]=_0x55433a[_0x3cc5c8]['systemuserid'];}}}_0x1d9d9(_0x5a5f19);})['catch'](function(_0x48faf0){_0x2ef898(_0x48faf0['message']);});});}function createEndUser(_0xc6c59f,_0x1a08db,_0x183b8e,_0x2bd5fb,_0x33b2d0,_0x2a7ca4){return new BPromise(function(_0x2d07fb,_0x3d23d4){return getAuthToken(_0x1a08db,_0x183b8e,_0x2a7ca4)['then'](function(_0x3ef750){var _0x52f140=_0x2a7ca4[_0xc665('0x28')]()===_0xc665('0x29')?_0x33b2d0[_0xc665('0x2a')]:_0x33b2d0[_0xc665('0x2b')];var _0x1ea57f={'method':_0xc665('0xd'),'uri':_0x2bd5fb+_0xc665('0x2c'),'body':{'telephone1':_0x52f140,'fullname':_0x52f140,'firstname':_0x52f140,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xc665('0x2d')+_0xc6c59f['userId']+')'},'headers':{'Authorization':_0xc665('0x2e')+_0x3ef750,'OData-Version':_0xc665('0x1a')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x1ea57f);})[_0xc665('0x12')](function(_0x342aa9){var _0x22df26=_0x342aa9[_0xc665('0x2f')][_0xc665('0x30')];var _0x3c4ade=_0x22df26[_0xc665('0x31')](_0x22df26[_0xc665('0x32')]('(')+0x1,_0x22df26[_0xc665('0x32')](')'));_0xc6c59f[_0xc665('0x33')]=_0x3c4ade;_0x2d07fb(_0xc6c59f);})['catch'](function(_0x5b3d43){_0x3d23d4(_0x5b3d43['message']);});});}function getEndUser(_0x239350,_0x5958ad,_0x542428,_0x2bd58a,_0x3bb1e0,_0x26459f,_0x110974){var _0x50f740=_0x26459f['toLowerCase']()===_0xc665('0x29')?_0x3bb1e0[_0xc665('0x2a')]:_0x3bb1e0[_0xc665('0x2b')];return getAuthToken(_0x5958ad,_0x542428,_0x26459f)['then'](function(_0x542300){var _0x2a9a9e={'method':_0xc665('0x34'),'uri':_0x2bd58a+_0xc665('0x35')+_0x50f740[_0xc665('0x36')]('+',_0xc665('0x37'))+'\x27','headers':{'Authorization':_0xc665('0x2e')+_0x542300,'If-None-Match':null,'OData-Version':_0xc665('0x1a')},'json':!![]};return rp(_0x2a9a9e);})[_0xc665('0x12')](function(_0x2be6bd){var _0x8d8705=![];if(!_0x2be6bd)return _0x8d8705;var _0x539ca1=_0x2be6bd[_0xc665('0x1b')];for(var _0x3e5707=0x0;_0x3e5707<_0x539ca1['length'];_0x3e5707++){if(_0x539ca1[_0x3e5707][_0xc665('0x38')]===_0x50f740){_0x8d8705=!![];_0x239350[_0xc665('0x33')]=_0x539ca1[_0x3e5707][_0xc665('0x39')];}}return _0x8d8705;})[_0xc665('0x12')](function(_0x35b05a){if(_0x35b05a)return _0x239350;if(_0x110974===_0xc665('0x3a')){logger['info']('['+[_0x26459f[_0xc665('0x16')]()]+_0xc665('0x3b'));return _0x239350;}return createEndUser(_0x239350,_0x5958ad,_0x542428,_0x2bd58a,_0x3bb1e0,_0x26459f)[_0xc665('0x12')](function(_0x5e4560){logger['info']('['+[_0x26459f[_0xc665('0x16')]()]+']\x20Enduser\x20created!',_0x5e4560[_0xc665('0x33')]);return _0x5e4560;});});}function getCustomFields(_0x457940,_0x1ff995,_0xcbafcc){var _0x41abcc={};if(_0x457940[_0xc665('0x20')]>0x0){_[_0xc665('0x3c')](_0x457940,function(_0x2f4e54){if(_[_0xc665('0x3d')]([_0xc665('0x3e'),_0xc665('0x3f')],_0x2f4e54[_0xc665('0x40')])&&_0x2f4e54[_0xc665('0x41')]&&!_0x2f4e54[_0xc665('0x42')]){var _0x34bda7=_0x2f4e54[_0xc665('0x43')][_0xc665('0x28')]();var _0x5d229c=_0x34bda7[_0xc665('0x31')](0x0,_0x34bda7[_0xc665('0x44')]('_'));var _0x7adbb4=_0x34bda7[_0xc665('0x31')](_0x34bda7['indexOf']('_')+0x1);if(_0x5d229c===_0xcbafcc){_0x41abcc[_0x7adbb4]=_0x2f4e54['content'];}}});}return _0x41abcc;}function getTicket(_0x2ba2e5,_0x1d422a,_0x170a20,_0x3584a4,_0x58d464,_0x2885f4,_0x2259b1){return new BPromise(function(_0x2e5087,_0x1f96da){var _0x1acc39;return getAuthToken(_0x1d422a,_0x170a20,_0x2259b1)[_0xc665('0x12')](function(_0x3f964f){if(_0x2885f4[_0xc665('0x45')]===_0xc665('0x46')){_0x1acc39={'method':_0xc665('0xd'),'uri':_0x3584a4+'incidents','body':Object['assign']({},{'title':intUtil[_0xc665('0x47')](_0x2885f4[_0xc665('0x48')],_0x58d464,'\x20'),'description':intUtil[_0xc665('0x47')](_0x2885f4[_0xc665('0x49')],_0x58d464,'\x0a'),'customerid_contact@odata.bind':_0x2ba2e5['enduserId']?_0xc665('0x4a')+_0x2ba2e5[_0xc665('0x33')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x2ba2e5['userId']+')','caseorigincode':'1'},getCustomFields(_0x2885f4['Fields'],_0x58d464,_0x2885f4[_0xc665('0x45')])),'headers':{'Authorization':'Bearer\x20'+_0x3f964f,'OData-Version':_0xc665('0x1a')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x2885f4[_0xc665('0x45')]===_0xc665('0x4b')){var _0x44b431=_0x2ba2e5[_0xc665('0x33')]?[{'partyid_systemuser@odata.bind':_0xc665('0x2d')+_0x2ba2e5['userId']+')','participationtypemask':_0x2ba2e5[_0xc665('0x4c')]===_0xc665('0x4d')?0x2:0x1},{'partyid_contact@odata.bind':_0xc665('0x4a')+_0x2ba2e5[_0xc665('0x33')]+')','participationtypemask':_0x2ba2e5[_0xc665('0x4c')]==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':'/systemusers('+_0x2ba2e5[_0xc665('0x24')]+')','participationtypemask':_0x2ba2e5[_0xc665('0x4c')]==='queue'?0x2:0x1}];_0x1acc39={'method':_0xc665('0xd'),'uri':_0x3584a4+_0xc665('0x4e'),'body':Object[_0xc665('0x4f')]({},{'subject':intUtil[_0xc665('0x47')](_0x2885f4[_0xc665('0x48')],_0x58d464,'\x20'),'phonenumber':String(_0x58d464[_0xc665('0x2b')]),'description':intUtil['getString'](_0x2885f4['Descriptions'],_0x58d464,'\x0a'),'regardingobjectid_contact@odata.bind':_0x2ba2e5[_0xc665('0x33')]?_0xc665('0x4a')+_0x2ba2e5['enduserId']+')':undefined,'ownerid@odata.bind':_0xc665('0x2d')+_0x2ba2e5['userId']+')','directioncode':_0x2ba2e5[_0xc665('0x4c')]===_0xc665('0x4d')?![]:!![],'phonecall_activity_parties':_0x44b431},getCustomFields(_0x2885f4[_0xc665('0x50')],_0x58d464,_0x2885f4[_0xc665('0x45')])),'headers':{'Authorization':_0xc665('0x2e')+_0x3f964f,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x1acc39);})[_0xc665('0x12')](function(_0x3aefd2){var _0x2332f9=_0x3aefd2[_0xc665('0x2f')]['odata-entityid'];var _0x1a128a=_0x2332f9['substring'](_0x2332f9[_0xc665('0x32')]('(')+0x1,_0x2332f9['lastIndexOf'](')'));_0x2ba2e5[_0xc665('0x51')]=_0x1a128a;_0x2e5087(_0x2ba2e5);})[_0xc665('0x14')](function(_0x1d229f){_0x1f96da(_0x1d229f[_0xc665('0x18')]);});});}function emit(_0x2e0f2b,_0x6aff3f,_0x2dab0d,_0x91ce96){var _0x39ef5d={'uri':util['format'](_0xc665('0x52'),_0x2e0f2b,_0x2dab0d,_0x91ce96)};io['to'](util['format'](_0xc665('0x53'),_0x6aff3f))[_0xc665('0x54')]('trigger:browser:url',_0x39ef5d);}exports['cs']=function(_0x1b9902,_0x2d2145,_0x9825ca,_0x64efbf,_0x15b8fa,_0x1a8f25,_0xa4be2a,_0x2d1fee){var _0x2c3d49={};_0x1a8f25[_0xc665('0xf')]=intUtil[_0xc665('0x55')](_0x1a8f25['remoteUri']);_0x1a8f25[_0xc665('0x56')]=intUtil[_0xc665('0x55')](_0x1a8f25['serverUrl']);_0x2c3d49[_0xc665('0x4c')]=_0x2d1fee===_0xc665('0x4d')||_0x2d1fee==='unmanaged'?_0xc665('0x4d'):_0xc665('0x29');var _0x473ee0=util['format']('%s/api/data/v9.0/',_0x1a8f25[_0xc665('0xf')]);var _0x5082fa=util['format'](_0xc665('0x57'),_0x1a8f25[_0xc665('0x58')]);var _0x492bc3=util['format'](_0xc665('0x59'),_0x1a8f25[_0xc665('0x56')],_0x2d2145[_0xc665('0x5a')],md5(_0x2d2145[_0xc665('0x5a')]));if(_0x15b8fa&&_0x15b8fa[_0xc665('0x5b')]){logger[_0xc665('0x22')]('[QUEUE]',_0xc665('0x5c'));_0x2d2145['recordingURL']=_0x492bc3;}else if(_0xa4be2a&&_0xa4be2a[_0xc665('0x5d')]&&_0xa4be2a['recordingFormat']!=='none'){logger['info'](_0xc665('0x5e'),'Recording\x20is\x20enabled!');_0x2d2145[_0xc665('0x5f')]=_0x492bc3;}else{_0x2d2145['recordingURL']='';}return getUser(_0x2c3d49,_0x1a8f25,_0x64efbf,_0x5082fa,_0x473ee0,_0x2d1fee)[_0xc665('0x12')](function(_0x3b0933){logger[_0xc665('0x22')]('['+_0x2d1fee[_0xc665('0x16')]()+_0xc665('0x60'),_0x3b0933[_0xc665('0x24')]);logger[_0xc665('0x22')]('['+_0x2d1fee['toUpperCase']()+_0xc665('0x61'),_0x3b0933[_0xc665('0x1f')]);return getEndUser(_0x3b0933,_0x1a8f25,_0x5082fa,_0x473ee0,_0x2d2145,_0x2d1fee,_0x9825ca[_0xc665('0x62')]);})['then'](function(_0x1d61ee){logger[_0xc665('0x22')]('['+_0x2d1fee[_0xc665('0x16')]()+_0xc665('0x63'),_0x1d61ee['enduserId']);logger[_0xc665('0x22')]('['+_0x2d1fee[_0xc665('0x16')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x2d2145[_0xc665('0x2b')]);return getTicket(_0x1d61ee,_0x1a8f25,_0x5082fa,_0x473ee0,_0x2d2145,_0x9825ca,_0x2d1fee);})[_0xc665('0x12')](function(_0x36a5ca){logger[_0xc665('0x22')](util[_0xc665('0x64')]('['+_0x2d1fee[_0xc665('0x16')]()+_0xc665('0x65'),_0x9825ca[_0xc665('0x45')],_0x36a5ca[_0xc665('0x51')]));logger[_0xc665('0x22')](util[_0xc665('0x64')]('['+_0x2d1fee[_0xc665('0x16')]()+']\x20Call\x20direction:\x20%s',_0x2d1fee));if(_0x2d1fee!==_0xc665('0x66')){logger[_0xc665('0x22')]('['+_0x2d1fee[_0xc665('0x16')]()+']',_0xc665('0x67'));emit(_0x1a8f25['remoteUri'],_0x64efbf[_0xc665('0x68')],_0x9825ca[_0xc665('0x45')],_0x36a5ca[_0xc665('0x51')]);}})[_0xc665('0x14')](function(_0x17acfc){logger[_0xc665('0x15')]('['+_0x2d1fee[_0xc665('0x16')]()+']\x20Error\x20running\x20Dynamics365\x20integration',util['inspect'](_0x17acfc,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x1c03=['format','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','none','[OUTBOUND]','recordingURL',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','ticketId',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','bluebird','request-promise','util','./util','../../../../config/logger','dynamics365','redis','defaults','localhost','socket.io-emitter','POST','remoteUri','username','password','clientSecret','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','then','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','4.0','value','isNil','userEmail','email','internalemailaddress','isdisabled',']\x20Agent\x20found\x20','userId','systemuserid','info','length','calleridnum','/systemusers(','Bearer\x20','headers','odata-entityid','substring','lastIndexOf','enduserId','toLowerCase','outbound','destcalleridnum','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','%2b','telephone1','contactid',']\x20Enduser\x20created!','includes','picklist','type','nameField','customField','content','ticketType','incident','incidents','assign','getString','Subjects','Descriptions','/contacts(','Fields','phonecall','callDirection','queue','phonecalls','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x1c03,0xdd));var _0x31c0=function(_0x1e500e,_0x2c9d74){_0x1e500e=_0x1e500e-0x0;var _0x10dc5e=_0x1c03[_0x1e500e];return _0x10dc5e;};'use strict';var _=require(_0x31c0('0x0'));var BPromise=require(_0x31c0('0x1'));var rp=require(_0x31c0('0x2'));var util=require(_0x31c0('0x3'));var intUtil=require(_0x31c0('0x4'));var md5=require('md5');var Redis=require('ioredis');var logger=require(_0x31c0('0x5'))(_0x31c0('0x6'));var config=require('../../../../config/environment');config[_0x31c0('0x7')]=_[_0x31c0('0x8')](config['redis'],{'host':_0x31c0('0x9'),'port':0x18eb});var io=require(_0x31c0('0xa'))(new Redis(config[_0x31c0('0x7')]));function getAuthToken(_0x51c381,_0x1af610,_0x2ca258){var _0x2da46f={'method':_0x31c0('0xb'),'uri':_0x1af610,'form':{'client_id':_0x51c381['clientId'],'resource':_0x51c381[_0x31c0('0xc')],'username':_0x51c381[_0x31c0('0xd')],'password':_0x51c381[_0x31c0('0xe')],'grant_type':'password','client_secret':_0x51c381[_0x31c0('0xf')]},'json':!![]};return rp(_0x2da46f)['then'](function(_0x53ca1d){return _0x53ca1d[_0x31c0('0x10')];})[_0x31c0('0x11')](function(_0x1223f4){logger[_0x31c0('0x12')]('['+[_0x2ca258[_0x31c0('0x13')]()]+_0x31c0('0x14'));return _0x1223f4[_0x31c0('0x15')];});}function getUser(_0x549a1e,_0x16fed9,_0x4c8945,_0x2ef476,_0x393ac0,_0xaaa2b6){return new BPromise(function(_0x45c371,_0x45c20e){return getAuthToken(_0x16fed9,_0x2ef476,_0xaaa2b6)[_0x31c0('0x16')](function(_0x16024a){var _0x56401f={'method':_0x31c0('0x17'),'uri':_0x393ac0+_0x31c0('0x18'),'headers':{'Authorization':'Bearer\x20'+_0x16024a,'OData-Version':_0x31c0('0x19')},'json':!![]};return rp(_0x56401f);})[_0x31c0('0x16')](function(_0x46ba83){var _0x3dae2d=_0x46ba83[_0x31c0('0x1a')];var _0x408ead=![];var _0x1f5336=null;if(!_[_0x31c0('0x1b')](_0x4c8945)){if(intUtil['validateEmail'](_0x4c8945['email'])){_0x549a1e[_0x31c0('0x1c')]=_0x4c8945[_0x31c0('0x1d')];for(_0x1f5336=0x0;_0x1f5336<_0x3dae2d['length'];_0x1f5336++){if(_0x3dae2d[_0x1f5336][_0x31c0('0x1e')]===_0x4c8945['email']&&!_0x3dae2d[_0x1f5336][_0x31c0('0x1f')]){_0x408ead=!![];logger['info']('['+[_0xaaa2b6[_0x31c0('0x13')]()]+_0x31c0('0x20')+_0x3dae2d[_0x1f5336]['systemuserid']+'!');_0x549a1e[_0x31c0('0x21')]=_0x3dae2d[_0x1f5336][_0x31c0('0x22')];}}}}if(!_0x408ead){logger[_0x31c0('0x23')]('['+[_0xaaa2b6[_0x31c0('0x13')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x549a1e[_0x31c0('0x1c')]=_0x16fed9[_0x31c0('0xd')];for(_0x1f5336=0x0;_0x1f5336<_0x3dae2d[_0x31c0('0x24')];_0x1f5336++){if(_0x3dae2d[_0x1f5336][_0x31c0('0x1e')]===_0x16fed9[_0x31c0('0xd')]){_0x549a1e[_0x31c0('0x21')]=_0x3dae2d[_0x1f5336]['systemuserid'];}}}_0x45c371(_0x549a1e);})['catch'](function(_0x1acce9){_0x45c20e(_0x1acce9[_0x31c0('0x15')]);});});}function createEndUser(_0x10ac2c,_0x481bde,_0xad961,_0xbec42e,_0x5ebf4d,_0x514f1e){return new BPromise(function(_0x2cd7d6,_0x16786f){return getAuthToken(_0x481bde,_0xad961,_0x514f1e)['then'](function(_0x297e2a){var _0x447d8a=_0x514f1e['toLowerCase']()==='outbound'?_0x5ebf4d['destcalleridnum']:_0x5ebf4d[_0x31c0('0x25')];var _0x396eab={'method':_0x31c0('0xb'),'uri':_0xbec42e+'contacts','body':{'telephone1':_0x447d8a,'fullname':_0x447d8a,'firstname':_0x447d8a,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x31c0('0x26')+_0x10ac2c[_0x31c0('0x21')]+')'},'headers':{'Authorization':_0x31c0('0x27')+_0x297e2a,'OData-Version':_0x31c0('0x19')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x396eab);})[_0x31c0('0x16')](function(_0x441358){var _0x4ee647=_0x441358[_0x31c0('0x28')][_0x31c0('0x29')];var _0x406d2c=_0x4ee647[_0x31c0('0x2a')](_0x4ee647[_0x31c0('0x2b')]('(')+0x1,_0x4ee647[_0x31c0('0x2b')](')'));_0x10ac2c[_0x31c0('0x2c')]=_0x406d2c;_0x2cd7d6(_0x10ac2c);})[_0x31c0('0x11')](function(_0x3065a9){_0x16786f(_0x3065a9[_0x31c0('0x15')]);});});}function getEndUser(_0x521df9,_0x3f6363,_0x595c89,_0x2b82ee,_0x3dfcd2,_0x58433c,_0x147f50){var _0x290911=_0x58433c[_0x31c0('0x2d')]()===_0x31c0('0x2e')?_0x3dfcd2[_0x31c0('0x2f')]:_0x3dfcd2[_0x31c0('0x25')];return getAuthToken(_0x3f6363,_0x595c89,_0x58433c)[_0x31c0('0x16')](function(_0x57cd55){var _0x2a4b59={'method':'GET','uri':_0x2b82ee+_0x31c0('0x30')+_0x290911[_0x31c0('0x31')]('+',_0x31c0('0x32'))+'\x27','headers':{'Authorization':_0x31c0('0x27')+_0x57cd55,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x2a4b59);})[_0x31c0('0x16')](function(_0x166337){var _0x2ac100=![];if(!_0x166337)return _0x2ac100;var _0xcd4456=_0x166337[_0x31c0('0x1a')];for(var _0x30e385=0x0;_0x30e385<_0xcd4456['length'];_0x30e385++){if(_0xcd4456[_0x30e385][_0x31c0('0x33')]===_0x290911){_0x2ac100=!![];_0x521df9[_0x31c0('0x2c')]=_0xcd4456[_0x30e385][_0x31c0('0x34')];}}return _0x2ac100;})[_0x31c0('0x16')](function(_0x3497ed){if(_0x3497ed)return _0x521df9;if(_0x147f50==='nothing'){logger[_0x31c0('0x23')]('['+[_0x58433c[_0x31c0('0x13')]()]+']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing');return _0x521df9;}return createEndUser(_0x521df9,_0x3f6363,_0x595c89,_0x2b82ee,_0x3dfcd2,_0x58433c)[_0x31c0('0x16')](function(_0x28a548){logger['info']('['+[_0x58433c[_0x31c0('0x13')]()]+_0x31c0('0x35'),_0x28a548[_0x31c0('0x2c')]);return _0x28a548;});});}function getCustomFields(_0x2d8127,_0x2f7563,_0x3c605b){var _0x1aab7f={};if(_0x2d8127[_0x31c0('0x24')]>0x0){_['forEach'](_0x2d8127,function(_0x21a157){if(_[_0x31c0('0x36')](['string',_0x31c0('0x37')],_0x21a157[_0x31c0('0x38')])&&_0x21a157[_0x31c0('0x39')]&&!_0x21a157[_0x31c0('0x3a')]){var _0x489941=_0x21a157['idField']['toLowerCase']();var _0x5267a3=_0x489941[_0x31c0('0x2a')](0x0,_0x489941['indexOf']('_'));var _0x99cc7c=_0x489941[_0x31c0('0x2a')](_0x489941['indexOf']('_')+0x1);if(_0x5267a3===_0x3c605b){_0x1aab7f[_0x99cc7c]=_0x21a157[_0x31c0('0x3b')];}}});}return _0x1aab7f;}function getTicket(_0x2083af,_0x211810,_0x307dd9,_0x5a7fb1,_0x41836e,_0x1fc5d3,_0x3a421c){return new BPromise(function(_0x20c5c9,_0x50bb57){var _0x69f2a;return getAuthToken(_0x211810,_0x307dd9,_0x3a421c)[_0x31c0('0x16')](function(_0x508469){if(_0x1fc5d3[_0x31c0('0x3c')]===_0x31c0('0x3d')){_0x69f2a={'method':_0x31c0('0xb'),'uri':_0x5a7fb1+_0x31c0('0x3e'),'body':Object[_0x31c0('0x3f')]({},{'title':intUtil[_0x31c0('0x40')](_0x1fc5d3[_0x31c0('0x41')],_0x41836e,'\x20'),'description':intUtil['getString'](_0x1fc5d3[_0x31c0('0x42')],_0x41836e,'\x0a'),'customerid_contact@odata.bind':_0x2083af[_0x31c0('0x2c')]?_0x31c0('0x43')+_0x2083af['enduserId']+')':undefined,'ownerid@odata.bind':_0x31c0('0x26')+_0x2083af[_0x31c0('0x21')]+')','caseorigincode':'1'},getCustomFields(_0x1fc5d3[_0x31c0('0x44')],_0x41836e,_0x1fc5d3[_0x31c0('0x3c')])),'headers':{'Authorization':_0x31c0('0x27')+_0x508469,'OData-Version':_0x31c0('0x19')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x1fc5d3[_0x31c0('0x3c')]===_0x31c0('0x45')){var _0x2fc1fd=_0x2083af[_0x31c0('0x2c')]?[{'partyid_systemuser@odata.bind':_0x31c0('0x26')+_0x2083af[_0x31c0('0x21')]+')','participationtypemask':_0x2083af[_0x31c0('0x46')]===_0x31c0('0x47')?0x2:0x1},{'partyid_contact@odata.bind':_0x31c0('0x43')+_0x2083af[_0x31c0('0x2c')]+')','participationtypemask':_0x2083af[_0x31c0('0x46')]===_0x31c0('0x47')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x31c0('0x26')+_0x2083af[_0x31c0('0x21')]+')','participationtypemask':_0x2083af[_0x31c0('0x46')]===_0x31c0('0x47')?0x2:0x1}];_0x69f2a={'method':_0x31c0('0xb'),'uri':_0x5a7fb1+_0x31c0('0x48'),'body':Object['assign']({},{'subject':intUtil[_0x31c0('0x40')](_0x1fc5d3['Subjects'],_0x41836e,'\x20'),'phonenumber':String(_0x41836e[_0x31c0('0x25')]),'description':intUtil[_0x31c0('0x40')](_0x1fc5d3['Descriptions'],_0x41836e,'\x0a'),'regardingobjectid_contact@odata.bind':_0x2083af[_0x31c0('0x2c')]?'/contacts('+_0x2083af[_0x31c0('0x2c')]+')':undefined,'ownerid@odata.bind':_0x31c0('0x26')+_0x2083af[_0x31c0('0x21')]+')','directioncode':_0x2083af[_0x31c0('0x46')]==='queue'?![]:!![],'phonecall_activity_parties':_0x2fc1fd},getCustomFields(_0x1fc5d3['Fields'],_0x41836e,_0x1fc5d3[_0x31c0('0x3c')])),'headers':{'Authorization':'Bearer\x20'+_0x508469,'OData-Version':_0x31c0('0x19')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x69f2a);})['then'](function(_0x2dfad0){var _0x3d0dab=_0x2dfad0[_0x31c0('0x28')][_0x31c0('0x29')];var _0xd83a8d=_0x3d0dab[_0x31c0('0x2a')](_0x3d0dab[_0x31c0('0x2b')]('(')+0x1,_0x3d0dab[_0x31c0('0x2b')](')'));_0x2083af['ticketId']=_0xd83a8d;_0x20c5c9(_0x2083af);})[_0x31c0('0x11')](function(_0x4ccc08){_0x50bb57(_0x4ccc08[_0x31c0('0x15')]);});});}function emit(_0x3f783f,_0x113895,_0x4c20fd,_0x25dbb7){var _0x17732b={'uri':util['format'](_0x31c0('0x49'),_0x3f783f,_0x4c20fd,_0x25dbb7)};io['to'](util['format']('user:%s',_0x113895))[_0x31c0('0x4a')](_0x31c0('0x4b'),_0x17732b);}exports['cs']=function(_0x496885,_0x1af3e5,_0x3f9e00,_0x2359af,_0x4abaf5,_0x56fd3f,_0x4e1154,_0x19c2da){var _0x2953af={};_0x56fd3f['remoteUri']=intUtil[_0x31c0('0x4c')](_0x56fd3f['remoteUri']);_0x56fd3f['serverUrl']=intUtil['stripTrailingSlash'](_0x56fd3f[_0x31c0('0x4d')]);_0x2953af[_0x31c0('0x46')]=_0x19c2da===_0x31c0('0x47')||_0x19c2da===_0x31c0('0x4e')?_0x31c0('0x47'):_0x31c0('0x2e');var _0x51cecd=util[_0x31c0('0x4f')]('%s/api/data/v9.0/',_0x56fd3f['remoteUri']);var _0x4f5b75=util[_0x31c0('0x4f')](_0x31c0('0x50'),_0x56fd3f[_0x31c0('0x51')]);var _0x48fec7=util[_0x31c0('0x4f')](_0x31c0('0x52'),_0x56fd3f[_0x31c0('0x4d')],_0x1af3e5[_0x31c0('0x53')],md5(_0x1af3e5[_0x31c0('0x53')]));if(_0x4abaf5&&_0x4abaf5[_0x31c0('0x54')]){logger[_0x31c0('0x23')](_0x31c0('0x55'),'Recording\x20is\x20enabled!');_0x1af3e5['recordingURL']=_0x48fec7;}else if(_0x4e1154&&_0x4e1154['recordingFormat']&&_0x4e1154['recordingFormat']!==_0x31c0('0x56')){logger[_0x31c0('0x23')](_0x31c0('0x57'),'Recording\x20is\x20enabled!');_0x1af3e5['recordingURL']=_0x48fec7;}else{_0x1af3e5[_0x31c0('0x58')]='';}return getUser(_0x2953af,_0x56fd3f,_0x2359af,_0x4f5b75,_0x51cecd,_0x19c2da)[_0x31c0('0x16')](function(_0x2a87a9){logger[_0x31c0('0x23')]('['+_0x19c2da[_0x31c0('0x13')]()+_0x31c0('0x59'),_0x2a87a9[_0x31c0('0x21')]);logger[_0x31c0('0x23')]('['+_0x19c2da[_0x31c0('0x13')]()+_0x31c0('0x5a'),_0x2a87a9[_0x31c0('0x1c')]);return getEndUser(_0x2a87a9,_0x56fd3f,_0x4f5b75,_0x51cecd,_0x1af3e5,_0x19c2da,_0x3f9e00['moduleCreate']);})[_0x31c0('0x16')](function(_0x29dbf2){logger[_0x31c0('0x23')]('['+_0x19c2da['toUpperCase']()+_0x31c0('0x5b'),_0x29dbf2[_0x31c0('0x2c')]);logger[_0x31c0('0x23')]('['+_0x19c2da[_0x31c0('0x13')]()+_0x31c0('0x5c'),_0x1af3e5[_0x31c0('0x25')]);return getTicket(_0x29dbf2,_0x56fd3f,_0x4f5b75,_0x51cecd,_0x1af3e5,_0x3f9e00,_0x19c2da);})[_0x31c0('0x16')](function(_0x2bef92){logger[_0x31c0('0x23')](util[_0x31c0('0x4f')]('['+_0x19c2da['toUpperCase']()+_0x31c0('0x5d'),_0x3f9e00[_0x31c0('0x3c')],_0x2bef92['ticketId']));logger['info'](util['format']('['+_0x19c2da['toUpperCase']()+_0x31c0('0x5e'),_0x19c2da));if(_0x19c2da!==_0x31c0('0x4e')){logger[_0x31c0('0x23')]('['+_0x19c2da[_0x31c0('0x13')]()+']',_0x31c0('0x5f'));emit(_0x56fd3f['remoteUri'],_0x2359af[_0x31c0('0x60')],_0x3f9e00['ticketType'],_0x2bef92[_0x31c0('0x61')]);}})[_0x31c0('0x11')](function(_0x2cd8a4){logger['error']('['+_0x19c2da[_0x31c0('0x13')]()+_0x31c0('0x62'),util[_0x31c0('0x63')](_0x2cd8a4,{'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 38b5b22..a50917c 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 _0x75e8=['POST','then','Ticket\x20created!','validateEmail','length','find','contact','email','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/api/v2/contacts','Basic\x20%s','apiKey','toString','base64','[HTTP]','stringify','defaults','GET','map','includes','string','picklist','type','customField','nameField','toLowerCase','content','idField','push','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','The\x20Ticket\x20ID\x20is:','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','error','outbound','none','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','%s/helpdesk/tickets/%d','catch','unmanaged','toUpperCase','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridnum','getString','Descriptions','
','name','Fields','custom_fields','mapValues','value','%s/api/v2/tickets','remoteUri'];(function(_0x2678ff,_0x34838b){var _0x23a374=function(_0x104387){while(--_0x104387){_0x2678ff['push'](_0x2678ff['shift']());}};_0x23a374(++_0x34838b);}(_0x75e8,0x9e));var _0x875e=function(_0x44d258,_0x325a85){_0x44d258=_0x44d258-0x0;var _0x3baac9=_0x75e8[_0x44d258];return _0x3baac9;};'use strict';var _=require(_0x875e('0x0'));var rp=require(_0x875e('0x1'));var md5=require(_0x875e('0x2'));var util=require(_0x875e('0x3'));var Redis=require(_0x875e('0x4'));var intUtil=require(_0x875e('0x5'));var config=require(_0x875e('0x6'));var logger=require(_0x875e('0x7'))(_0x875e('0x8'));config[_0x875e('0x9')]=_['defaults'](config[_0x875e('0x9')],{'host':_0x875e('0xa'),'port':0x18eb});var io=require(_0x875e('0xb'))(new Redis(config[_0x875e('0x9')]));var headers={'Content-Type':_0x875e('0xc'),'Accept':_0x875e('0xc')};function emit(_0xd241fb,_0x5437ea,_0x1943ba){io['to'](_0xd241fb)[_0x875e('0xd')](_0x5437ea,_0x1943ba);}function getTicket(_0x19d01f,_0x4ca0f2,_0xc31358,_0x59f2b9,_0x1eecc8){logger[_0x875e('0xe')](_0x875e('0xf'));var _0x14508f=_[_0x875e('0x10')]({'responder_id':_0x4ca0f2['id'],'requester_id':_0xc31358['id'],'name':util[_0x875e('0x11')](_0x875e('0x12'),_0x1eecc8['calleridname']),'phone':_0x1eecc8[_0x875e('0x13')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x59f2b9['Subjects'],_0x1eecc8,'\x20'),'description':intUtil[_0x875e('0x14')](_0x59f2b9[_0x875e('0x15')],_0x1eecc8,_0x875e('0x16')),'tags':getTags(_0x59f2b9['Tags'],_0x875e('0x17'))},getCustomFields(_0x59f2b9[_0x875e('0x18')],_0x1eecc8));_0x14508f[_0x875e('0x19')]=_[_0x875e('0x1a')](_['keyBy'](_0x14508f[_0x875e('0x19')],'id'),_0x875e('0x1b'));return request({'uri':util['format'](_0x875e('0x1c'),_0x19d01f[_0x875e('0x1d')]),'method':_0x875e('0x1e'),'body':_0x14508f})[_0x875e('0x1f')](function(_0x3cbda7){logger[_0x875e('0xe')](_0x875e('0x20'));return _0x3cbda7;});}function getUser(_0x4ff5b3,_0x1f3419){if(intUtil[_0x875e('0x21')](_0x1f3419)){return request({'uri':util[_0x875e('0x11')]('%s/api/v2/agents',_0x4ff5b3[_0x875e('0x1d')]),'qs':{'email':_0x1f3419}})[_0x875e('0x1f')](function(_0x3d8266){if(_0x3d8266[_0x875e('0x22')]){logger['info']('Agent\x20found!');return _[_0x875e('0x23')](_0x3d8266,function(_0x45fd90){return _0x45fd90[_0x875e('0x24')][_0x875e('0x25')]===_0x1f3419;});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x875e('0x11')](_0x875e('0x26'),_0x4ff5b3[_0x875e('0x1d')])})[_0x875e('0x1f')](function(_0x2e7daa){logger['info'](_0x875e('0x27'));return _0x2e7daa;});}});}else{logger[_0x875e('0xe')](_0x875e('0x28'));return request({'uri':util[_0x875e('0x11')](_0x875e('0x26'),_0x4ff5b3[_0x875e('0x1d')])})[_0x875e('0x1f')](function(_0x51db62){logger[_0x875e('0xe')](_0x875e('0x27'));return _0x51db62;});}}function getEndUser(_0x285d0c,_0x499e09,_0x2f3f7f){logger[_0x875e('0xe')](_0x875e('0x29'),_0x2f3f7f);return request({'uri':util['format']('%s/api/v2/contacts',_0x285d0c[_0x875e('0x1d')]),'qs':{'phone':_0x2f3f7f}})[_0x875e('0x1f')](function(_0x450a75){if(_0x450a75['length']){logger[_0x875e('0xe')](_0x875e('0x2a'));return _['find'](_0x450a75,{'phone':_0x2f3f7f});}else{logger['info'](_0x875e('0x2b'));return request({'uri':util[_0x875e('0x11')](_0x875e('0x2c'),_0x285d0c['remoteUri']),'method':_0x875e('0x1e'),'body':{'name':_0x499e09,'phone':_0x2f3f7f}})['then'](function(_0xcb24d1){logger[_0x875e('0xe')]('Enduser\x20created.');return _0xcb24d1;});}});}function getAuth(_0x3cf255){return util[_0x875e('0x11')](_0x875e('0x2d'),new Buffer(_0x3cf255[_0x875e('0x2e')]+':X')[_0x875e('0x2f')](_0x875e('0x30')));}function request(_0x24abc8){logger['debug'](_0x875e('0x31'),JSON[_0x875e('0x32')](_0x24abc8));return rp(_[_0x875e('0x33')](_0x24abc8,{'method':_0x875e('0x34'),'headers':headers,'json':!![]}));}function getTags(_0x3448ae,_0x2e320c){var _0x4dee0e=[];if(_0x3448ae&&_0x3448ae['length']>0x0){_0x4dee0e=_[_0x875e('0x35')](_0x3448ae,_0x2e320c);}return _0x4dee0e;}function getCustomFields(_0x2ef49f,_0x28f7d5){var _0xd302a5=[];var _0x16cbe3={'custom_fields':[]};if(_0x2ef49f[_0x875e('0x22')]>0x0){_['forEach'](_0x2ef49f,function(_0x5a347f){if(_[_0x875e('0x36')]([_0x875e('0x37'),_0x875e('0x38')],_0x5a347f[_0x875e('0x39')])&&_0x5a347f['nameField']&&!_0x5a347f[_0x875e('0x3a')]){_0x16cbe3[_0x5a347f[_0x875e('0x3b')][_0x875e('0x3c')]()]=_0x5a347f[_0x875e('0x3d')]['toString']();}else if(_[_0x875e('0x36')]([_0x875e('0x37'),_0x875e('0x38')],_0x5a347f[_0x875e('0x39')])&&_0x5a347f[_0x875e('0x3e')]&&_0x5a347f['customField']){_0x16cbe3['custom_fields'][_0x875e('0x3f')]({'id':_0x5a347f[_0x875e('0x3e')],'value':_0x5a347f[_0x875e('0x3d')][_0x875e('0x2f')]()});}else if(_0x5a347f[_0x875e('0x39')]===_0x875e('0x40')&&_0x5a347f[_0x875e('0x41')]&&_0x5a347f[_0x875e('0x3e')]&&_0x5a347f[_0x875e('0x3a')]){_0x28f7d5[_0x5a347f[_0x875e('0x41')]]&&_0x16cbe3[_0x875e('0x19')]['push']({'id':_0x5a347f['idField'],'value':_0x28f7d5[_0x5a347f[_0x875e('0x41')]][_0x875e('0x2f')]()});}else if(_0x5a347f['type']===_0x875e('0x42')&&_0x5a347f[_0x875e('0x43')]&&_0x5a347f[_0x875e('0x43')][_0x875e('0x17')]&&_0x5a347f[_0x875e('0x3e')]&&_0x5a347f[_0x875e('0x3a')]){_0x28f7d5[_0x5a347f[_0x875e('0x43')]['name']['toLowerCase']()]&&_0x16cbe3[_0x875e('0x19')][_0x875e('0x3f')]({'id':_0x5a347f[_0x875e('0x3e')],'value':_0x28f7d5[_0x5a347f[_0x875e('0x43')][_0x875e('0x17')][_0x875e('0x3c')]()][_0x875e('0x2f')]()});}});}return _0x16cbe3;}exports[_0x875e('0x44')]=function(_0x2f5944,_0xe5aec9,_0x550860,_0x35e398,_0x45a5d4,_0x47f421){var _0x46ea98,_0x1edaf6;_0x47f421[_0x875e('0x1d')]=intUtil[_0x875e('0x45')](_0x47f421['remoteUri']);_0x47f421[_0x875e('0x46')]=intUtil[_0x875e('0x45')](_0x47f421['serverUrl']);if(_0x45a5d4&&_0x45a5d4[_0x875e('0x47')]){logger[_0x875e('0xe')]('[QUEUE]',_0x875e('0x48'));_0xe5aec9[_0x875e('0x49')]=util[_0x875e('0x11')](_0x875e('0x4a'),_0x47f421['serverUrl'],_0xe5aec9[_0x875e('0x4b')],md5(_0xe5aec9[_0x875e('0x4b')]));}else{_0xe5aec9[_0x875e('0x49')]='';}headers['Authorization']=getAuth(_0x47f421);return getUser(_0x47f421,_0x35e398[_0x875e('0x25')])['then'](function(_0x395b96){_0x46ea98=_0x395b96;logger[_0x875e('0xe')](_0x875e('0x4c'),_0x46ea98['id']);return getEndUser(_0x47f421,_0xe5aec9[_0x875e('0x4d')],_0xe5aec9['calleridnum']);})['then'](function(_0x8656e4){_0x1edaf6=_0x8656e4;logger[_0x875e('0xe')]('The\x20Enduser\x20ID\x20is:',_0x1edaf6['id']);return getTicket(_0x47f421,_0x46ea98,_0x1edaf6,_0x550860,_0xe5aec9);})[_0x875e('0x1f')](function(_0x2154ac){if(_0x2154ac&&_0x2154ac['id']){logger[_0x875e('0xe')](_0x875e('0x20'));logger[_0x875e('0xe')](_0x875e('0x4e'),_0x2154ac['id']);logger[_0x875e('0xe')](_0x875e('0x4f'),_0x875e('0x50'));emit(util[_0x875e('0x11')](_0x875e('0x51'),_0x35e398[_0x875e('0x17')]),_0x875e('0x52'),{'uri':util['format']('%s/helpdesk/tickets/%d',_0x47f421[_0x875e('0x1d')],_0x2154ac['id'])});}})['catch'](function(_0x5b6493){logger[_0x875e('0x53')]('[QUEUE]',JSON[_0x875e('0x32')](_0x5b6493));});};exports[_0x875e('0x54')]=function(_0x3b04f0,_0x56c682,_0x5b8cbd,_0x348d6a,_0x455d18,_0x104dcf,_0x4d5b81){var _0x493463,_0x9487fc;_0x104dcf[_0x875e('0x1d')]=intUtil[_0x875e('0x45')](_0x104dcf['remoteUri']);_0x104dcf['serverUrl']=intUtil[_0x875e('0x45')](_0x104dcf['serverUrl']);if(_0x4d5b81&&_0x4d5b81['recordingFormat']&&_0x4d5b81['recordingFormat']!==_0x875e('0x55')){logger[_0x875e('0xe')](_0x875e('0x56'),'Recording\x20is\x20enabled!');_0x56c682[_0x875e('0x49')]=util[_0x875e('0x11')](_0x875e('0x4a'),_0x104dcf['serverUrl'],_0x56c682[_0x875e('0x4b')],md5(_0x56c682[_0x875e('0x4b')]));}headers['Authorization']=getAuth(_0x104dcf);return getUser(_0x104dcf,_0x348d6a[_0x875e('0x25')])[_0x875e('0x1f')](function(_0x5194bf){_0x493463=_0x5194bf;logger[_0x875e('0xe')]('The\x20User\x20ID\x20is:',_0x493463['id']);return getEndUser(_0x104dcf,_0x56c682[_0x875e('0x57')],_0x56c682[_0x875e('0x58')]);})[_0x875e('0x1f')](function(_0x4d810){_0x9487fc=_0x4d810;logger[_0x875e('0xe')](_0x875e('0x59'),_0x9487fc['id']);return getTicket(_0x104dcf,_0x493463,_0x9487fc,_0x5b8cbd,_0x56c682);})[_0x875e('0x1f')](function(_0x8a83d0){if(_0x8a83d0&&_0x8a83d0['id']){logger[_0x875e('0xe')](_0x875e('0x20'));logger[_0x875e('0xe')](_0x875e('0x4e'),_0x8a83d0['id']);logger[_0x875e('0xe')](_0x875e('0x56'),_0x875e('0x50'));emit(util[_0x875e('0x11')](_0x875e('0x51'),_0x348d6a[_0x875e('0x17')]),_0x875e('0x52'),{'uri':util[_0x875e('0x11')](_0x875e('0x5a'),_0x104dcf[_0x875e('0x1d')],_0x8a83d0['id'])});}})[_0x875e('0x5b')](function(_0x1cbeab){logger[_0x875e('0x53')]('[OUTBOUND]',JSON[_0x875e('0x32')](_0x1cbeab));});};exports[_0x875e('0x5c')]=function(_0x4b6bc7,_0x457350,_0x5abd61,_0x211b24,_0x3dc1a3,_0x2973e7){var _0x15cceb,_0x5c40de;_0x2973e7[_0x875e('0x1d')]=intUtil[_0x875e('0x45')](_0x2973e7[_0x875e('0x1d')]);_0x2973e7[_0x875e('0x46')]=intUtil[_0x875e('0x45')](_0x2973e7['serverUrl']);if(_0x3dc1a3&&_0x3dc1a3[_0x875e('0x47')]){logger['info']('['+_0x457350['lastevent'][_0x875e('0x5d')]()+']','Recording\x20is\x20enabled!');_0x457350['recordingURL']=util[_0x875e('0x11')](_0x875e('0x4a'),_0x2973e7['serverUrl'],_0x457350['uniqueid'],md5(_0x457350[_0x875e('0x4b')]));}else{_0x457350[_0x875e('0x49')]='';}headers['Authorization']=getAuth(_0x2973e7);return getUser(_0x2973e7,'')['then'](function(_0x54423d){_0x15cceb=_0x54423d;logger['info'](_0x875e('0x4c'),_0x15cceb['id']);return getEndUser(_0x2973e7,_0x457350['calleridname'],_0x457350[_0x875e('0x13')]);})['then'](function(_0x1ce4a5){_0x5c40de=_0x1ce4a5;logger[_0x875e('0xe')]('The\x20Enduser\x20ID\x20is:',_0x5c40de['id']);return getTicket(_0x2973e7,_0x15cceb,_0x5c40de,_0x5abd61,_0x457350);})[_0x875e('0x1f')](function(_0x244679){if(_0x244679){logger[_0x875e('0xe')](_0x875e('0x20'));logger[_0x875e('0xe')](_0x875e('0x4e'),_0x244679['id']);}})[_0x875e('0x5b')](function(_0x68eef9){logger['error']('['+_0x457350['lastevent']['toUpperCase']()+']',JSON['stringify'](_0x68eef9));});}; \ No newline at end of file +var _0x15dc=['lastevent','request-promise','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','Creating\x20new\x20ticket...','merge','format','calleridname','calleridnum','getString','Subjects','Descriptions','
','Tags','name','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','POST','then','info','Ticket\x20created!','validateEmail','%s/api/v2/agents','remoteUri','length','Agent\x20found!','find','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/api/v2/contacts','Enduser\x20created.','Basic\x20%s','apiKey','base64','debug','stringify','GET','map','forEach','includes','picklist','nameField','customField','toLowerCase','string','type','idField','toString','variable','variableName','push','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','uniqueid','recordingURL','Authorization','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','[OUTBOUND]','unmanaged','toUpperCase'];(function(_0xc0a3d3,_0x2c8d00){var _0x3386e8=function(_0x3f9df4){while(--_0x3f9df4){_0xc0a3d3['push'](_0xc0a3d3['shift']());}};_0x3386e8(++_0x2c8d00);}(_0x15dc,0x189));var _0xc15d=function(_0x5d6a7e,_0x2bdb71){_0x5d6a7e=_0x5d6a7e-0x0;var _0x1b0fe8=_0x15dc[_0x5d6a7e];return _0x1b0fe8;};'use strict';var _=require('lodash');var rp=require(_0xc15d('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0xc15d('0x1'));var intUtil=require(_0xc15d('0x2'));var config=require(_0xc15d('0x3'));var logger=require(_0xc15d('0x4'))(_0xc15d('0x5'));config[_0xc15d('0x6')]=_[_0xc15d('0x7')](config[_0xc15d('0x6')],{'host':_0xc15d('0x8'),'port':0x18eb});var io=require(_0xc15d('0x9'))(new Redis(config[_0xc15d('0x6')]));var headers={'Content-Type':_0xc15d('0xa'),'Accept':_0xc15d('0xa')};function emit(_0x10adb8,_0x4f2c80,_0x13ff04){io['to'](_0x10adb8)[_0xc15d('0xb')](_0x4f2c80,_0x13ff04);}function getTicket(_0x3a9907,_0x16cbfa,_0x7af348,_0x462c99,_0x3b0f40){logger['info'](_0xc15d('0xc'));var _0xca94a5=_[_0xc15d('0xd')]({'responder_id':_0x16cbfa['id'],'requester_id':_0x7af348['id'],'name':util[_0xc15d('0xe')]('Caller\x20-\x20%s',_0x3b0f40[_0xc15d('0xf')]),'phone':_0x3b0f40[_0xc15d('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xc15d('0x11')](_0x462c99[_0xc15d('0x12')],_0x3b0f40,'\x20'),'description':intUtil[_0xc15d('0x11')](_0x462c99[_0xc15d('0x13')],_0x3b0f40,_0xc15d('0x14')),'tags':getTags(_0x462c99[_0xc15d('0x15')],_0xc15d('0x16'))},getCustomFields(_0x462c99[_0xc15d('0x17')],_0x3b0f40));_0xca94a5[_0xc15d('0x18')]=_[_0xc15d('0x19')](_[_0xc15d('0x1a')](_0xca94a5[_0xc15d('0x18')],'id'),_0xc15d('0x1b'));return request({'uri':util['format'](_0xc15d('0x1c'),_0x3a9907['remoteUri']),'method':_0xc15d('0x1d'),'body':_0xca94a5})[_0xc15d('0x1e')](function(_0x52bde6){logger[_0xc15d('0x1f')](_0xc15d('0x20'));return _0x52bde6;});}function getUser(_0x536f76,_0x127f24){if(intUtil[_0xc15d('0x21')](_0x127f24)){return request({'uri':util[_0xc15d('0xe')](_0xc15d('0x22'),_0x536f76[_0xc15d('0x23')]),'qs':{'email':_0x127f24}})[_0xc15d('0x1e')](function(_0x4ebaff){if(_0x4ebaff[_0xc15d('0x24')]){logger['info'](_0xc15d('0x25'));return _[_0xc15d('0x26')](_0x4ebaff,function(_0x29dcf0){return _0x29dcf0['contact'][_0xc15d('0x27')]===_0x127f24;});}else{logger['info'](_0xc15d('0x28'));return request({'uri':util[_0xc15d('0xe')](_0xc15d('0x29'),_0x536f76[_0xc15d('0x23')])})[_0xc15d('0x1e')](function(_0x70c69d){logger[_0xc15d('0x1f')](_0xc15d('0x2a'));return _0x70c69d;});}});}else{logger[_0xc15d('0x1f')](_0xc15d('0x2b'));return request({'uri':util[_0xc15d('0xe')]('%s/api/v2/agents/me',_0x536f76[_0xc15d('0x23')])})[_0xc15d('0x1e')](function(_0x2fd300){logger[_0xc15d('0x1f')](_0xc15d('0x2a'));return _0x2fd300;});}}function getEndUser(_0x3363b2,_0x80456b,_0x43c75f){logger[_0xc15d('0x1f')](_0xc15d('0x2c'),_0x43c75f);return request({'uri':util['format']('%s/api/v2/contacts',_0x3363b2[_0xc15d('0x23')]),'qs':{'phone':_0x43c75f}})[_0xc15d('0x1e')](function(_0x2e3aee){if(_0x2e3aee[_0xc15d('0x24')]){logger[_0xc15d('0x1f')](_0xc15d('0x2d'));return _[_0xc15d('0x26')](_0x2e3aee,{'phone':_0x43c75f});}else{logger[_0xc15d('0x1f')](_0xc15d('0x2e'));return request({'uri':util['format'](_0xc15d('0x2f'),_0x3363b2[_0xc15d('0x23')]),'method':_0xc15d('0x1d'),'body':{'name':_0x80456b,'phone':_0x43c75f}})[_0xc15d('0x1e')](function(_0x38ca18){logger[_0xc15d('0x1f')](_0xc15d('0x30'));return _0x38ca18;});}});}function getAuth(_0x48728e){return util['format'](_0xc15d('0x31'),new Buffer(_0x48728e[_0xc15d('0x32')]+':X')['toString'](_0xc15d('0x33')));}function request(_0x1f22ac){logger[_0xc15d('0x34')]('[HTTP]',JSON[_0xc15d('0x35')](_0x1f22ac));return rp(_['defaults'](_0x1f22ac,{'method':_0xc15d('0x36'),'headers':headers,'json':!![]}));}function getTags(_0x4b26e2,_0x5544da){var _0x187119=[];if(_0x4b26e2&&_0x4b26e2[_0xc15d('0x24')]>0x0){_0x187119=_[_0xc15d('0x37')](_0x4b26e2,_0x5544da);}return _0x187119;}function getCustomFields(_0x26230a,_0x152b28){var _0x38951d=[];var _0x3861a1={'custom_fields':[]};if(_0x26230a[_0xc15d('0x24')]>0x0){_[_0xc15d('0x38')](_0x26230a,function(_0x4a34dc){if(_[_0xc15d('0x39')](['string',_0xc15d('0x3a')],_0x4a34dc['type'])&&_0x4a34dc[_0xc15d('0x3b')]&&!_0x4a34dc[_0xc15d('0x3c')]){_0x3861a1[_0x4a34dc[_0xc15d('0x3b')][_0xc15d('0x3d')]()]=_0x4a34dc['content']['toString']();}else if(_[_0xc15d('0x39')]([_0xc15d('0x3e'),_0xc15d('0x3a')],_0x4a34dc[_0xc15d('0x3f')])&&_0x4a34dc[_0xc15d('0x40')]&&_0x4a34dc[_0xc15d('0x3c')]){_0x3861a1[_0xc15d('0x18')]['push']({'id':_0x4a34dc[_0xc15d('0x40')],'value':_0x4a34dc['content'][_0xc15d('0x41')]()});}else if(_0x4a34dc[_0xc15d('0x3f')]===_0xc15d('0x42')&&_0x4a34dc['variableName']&&_0x4a34dc[_0xc15d('0x40')]&&_0x4a34dc[_0xc15d('0x3c')]){_0x152b28[_0x4a34dc[_0xc15d('0x43')]]&&_0x3861a1[_0xc15d('0x18')][_0xc15d('0x44')]({'id':_0x4a34dc['idField'],'value':_0x152b28[_0x4a34dc[_0xc15d('0x43')]][_0xc15d('0x41')]()});}else if(_0x4a34dc[_0xc15d('0x3f')]===_0xc15d('0x45')&&_0x4a34dc['Variable']&&_0x4a34dc['Variable'][_0xc15d('0x16')]&&_0x4a34dc[_0xc15d('0x40')]&&_0x4a34dc[_0xc15d('0x3c')]){_0x152b28[_0x4a34dc[_0xc15d('0x46')]['name'][_0xc15d('0x3d')]()]&&_0x3861a1[_0xc15d('0x18')][_0xc15d('0x44')]({'id':_0x4a34dc['idField'],'value':_0x152b28[_0x4a34dc['Variable'][_0xc15d('0x16')][_0xc15d('0x3d')]()][_0xc15d('0x41')]()});}});}return _0x3861a1;}exports[_0xc15d('0x47')]=function(_0x326caf,_0x1ee5ab,_0x5f95f2,_0x6ac55c,_0x31b1dd,_0x1f259f){var _0x2c4760,_0x108f60;_0x1f259f['remoteUri']=intUtil[_0xc15d('0x48')](_0x1f259f[_0xc15d('0x23')]);_0x1f259f[_0xc15d('0x49')]=intUtil['stripTrailingSlash'](_0x1f259f[_0xc15d('0x49')]);if(_0x31b1dd&&_0x31b1dd[_0xc15d('0x4a')]){logger[_0xc15d('0x1f')](_0xc15d('0x4b'),'Recording\x20is\x20enabled!');_0x1ee5ab['recordingURL']=util[_0xc15d('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1f259f[_0xc15d('0x49')],_0x1ee5ab['uniqueid'],md5(_0x1ee5ab[_0xc15d('0x4c')]));}else{_0x1ee5ab[_0xc15d('0x4d')]='';}headers[_0xc15d('0x4e')]=getAuth(_0x1f259f);return getUser(_0x1f259f,_0x6ac55c[_0xc15d('0x27')])[_0xc15d('0x1e')](function(_0x5322a4){_0x2c4760=_0x5322a4;logger[_0xc15d('0x1f')]('The\x20User\x20ID\x20is:',_0x2c4760['id']);return getEndUser(_0x1f259f,_0x1ee5ab['calleridname'],_0x1ee5ab[_0xc15d('0x10')]);})[_0xc15d('0x1e')](function(_0x496f14){_0x108f60=_0x496f14;logger[_0xc15d('0x1f')](_0xc15d('0x4f'),_0x108f60['id']);return getTicket(_0x1f259f,_0x2c4760,_0x108f60,_0x5f95f2,_0x1ee5ab);})[_0xc15d('0x1e')](function(_0x1e993d){if(_0x1e993d&&_0x1e993d['id']){logger[_0xc15d('0x1f')]('Ticket\x20created!');logger[_0xc15d('0x1f')]('The\x20Ticket\x20ID\x20is:',_0x1e993d['id']);logger[_0xc15d('0x1f')](_0xc15d('0x4b'),_0xc15d('0x50'));emit(util[_0xc15d('0xe')](_0xc15d('0x51'),_0x6ac55c[_0xc15d('0x16')]),_0xc15d('0x52'),{'uri':util[_0xc15d('0xe')](_0xc15d('0x53'),_0x1f259f[_0xc15d('0x23')],_0x1e993d['id'])});}})[_0xc15d('0x54')](function(_0x373795){logger[_0xc15d('0x55')](_0xc15d('0x4b'),JSON[_0xc15d('0x35')](_0x373795));});};exports[_0xc15d('0x56')]=function(_0x4fa458,_0xedb29f,_0x4bcffc,_0x129eea,_0x580aac,_0x422a1d,_0x47b402){var _0x45b4bf,_0x579c27;_0x422a1d[_0xc15d('0x23')]=intUtil[_0xc15d('0x48')](_0x422a1d[_0xc15d('0x23')]);_0x422a1d[_0xc15d('0x49')]=intUtil['stripTrailingSlash'](_0x422a1d['serverUrl']);if(_0x47b402&&_0x47b402[_0xc15d('0x57')]&&_0x47b402[_0xc15d('0x57')]!=='none'){logger['info']('[OUTBOUND]',_0xc15d('0x58'));_0xedb29f[_0xc15d('0x4d')]=util['format'](_0xc15d('0x59'),_0x422a1d['serverUrl'],_0xedb29f[_0xc15d('0x4c')],md5(_0xedb29f[_0xc15d('0x4c')]));}headers['Authorization']=getAuth(_0x422a1d);return getUser(_0x422a1d,_0x129eea[_0xc15d('0x27')])['then'](function(_0x5fd4a){_0x45b4bf=_0x5fd4a;logger[_0xc15d('0x1f')](_0xc15d('0x5a'),_0x45b4bf['id']);return getEndUser(_0x422a1d,_0xedb29f[_0xc15d('0x5b')],_0xedb29f[_0xc15d('0x5c')]);})[_0xc15d('0x1e')](function(_0x42d14e){_0x579c27=_0x42d14e;logger[_0xc15d('0x1f')](_0xc15d('0x4f'),_0x579c27['id']);return getTicket(_0x422a1d,_0x45b4bf,_0x579c27,_0x4bcffc,_0xedb29f);})[_0xc15d('0x1e')](function(_0xce679e){if(_0xce679e&&_0xce679e['id']){logger[_0xc15d('0x1f')](_0xc15d('0x20'));logger[_0xc15d('0x1f')](_0xc15d('0x5d'),_0xce679e['id']);logger[_0xc15d('0x1f')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xc15d('0xe')]('user:%s',_0x129eea[_0xc15d('0x16')]),_0xc15d('0x52'),{'uri':util['format'](_0xc15d('0x53'),_0x422a1d[_0xc15d('0x23')],_0xce679e['id'])});}})['catch'](function(_0x18211a){logger[_0xc15d('0x55')](_0xc15d('0x5e'),JSON[_0xc15d('0x35')](_0x18211a));});};exports[_0xc15d('0x5f')]=function(_0x26a093,_0x682b9e,_0x1c2542,_0x552e82,_0x11b247,_0x796ad6){var _0x46f8ae,_0x3f91d2;_0x796ad6[_0xc15d('0x23')]=intUtil['stripTrailingSlash'](_0x796ad6['remoteUri']);_0x796ad6[_0xc15d('0x49')]=intUtil[_0xc15d('0x48')](_0x796ad6[_0xc15d('0x49')]);if(_0x11b247&&_0x11b247[_0xc15d('0x4a')]){logger[_0xc15d('0x1f')]('['+_0x682b9e['lastevent'][_0xc15d('0x60')]()+']',_0xc15d('0x58'));_0x682b9e[_0xc15d('0x4d')]=util[_0xc15d('0xe')](_0xc15d('0x59'),_0x796ad6['serverUrl'],_0x682b9e[_0xc15d('0x4c')],md5(_0x682b9e['uniqueid']));}else{_0x682b9e[_0xc15d('0x4d')]='';}headers[_0xc15d('0x4e')]=getAuth(_0x796ad6);return getUser(_0x796ad6,'')[_0xc15d('0x1e')](function(_0xd4a365){_0x46f8ae=_0xd4a365;logger[_0xc15d('0x1f')]('The\x20User\x20ID\x20is:',_0x46f8ae['id']);return getEndUser(_0x796ad6,_0x682b9e[_0xc15d('0xf')],_0x682b9e[_0xc15d('0x10')]);})['then'](function(_0x1a4e51){_0x3f91d2=_0x1a4e51;logger['info'](_0xc15d('0x4f'),_0x3f91d2['id']);return getTicket(_0x796ad6,_0x46f8ae,_0x3f91d2,_0x1c2542,_0x682b9e);})['then'](function(_0x152d78){if(_0x152d78){logger['info'](_0xc15d('0x20'));logger['info'](_0xc15d('0x5d'),_0x152d78['id']);}})[_0xc15d('0x54')](function(_0x22ff80){logger[_0xc15d('0x55')]('['+_0x682b9e[_0xc15d('0x61')][_0xc15d('0x60')]()+']',JSON[_0xc15d('0x35')](_0x22ff80));});}; \ 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 2d5348e..f23137d 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 _0xdc04=['remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','destcalleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','name','inspect','lodash','request-promise','md5','util','moment','bluebird','./util','../../../../config/environment','../../../../config/logger','freshsales','localhost','GET','/api/selector/owners','info','users','length','adminEmail','Admin\x20found:','adminId','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','headers','agentEmail','Getting\x20user\x20with\x20email','email','userId','userEmail','&f=','&entities=contact','then','contacts','format','contactNumber','mobile_number','Contact\x20found\x20mobile_number:','Contact\x20found\x20work_number:','POST','/api/contacts','endUserId','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','YYYY-MM-DDTHH:mm:ss','add','ticketId','task','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','apiKey'];(function(_0x52b3f5,_0x46609e){var _0x3d52aa=function(_0x523ac5){while(--_0x523ac5){_0x52b3f5['push'](_0x52b3f5['shift']());}};_0x3d52aa(++_0x46609e);}(_0xdc04,0x64));var _0x4dc0=function(_0x5456c5,_0x1c0f4b){_0x5456c5=_0x5456c5-0x0;var _0x45cd5b=_0xdc04[_0x5456c5];return _0x45cd5b;};'use strict';var _=require(_0x4dc0('0x0'));var rp=require(_0x4dc0('0x1'));var md5=require(_0x4dc0('0x2'));var util=require(_0x4dc0('0x3'));var moment=require(_0x4dc0('0x4'));var Promise=require(_0x4dc0('0x5'));var Redis=require('ioredis');var intUtil=require(_0x4dc0('0x6'));var config=require(_0x4dc0('0x7'));var logger=require(_0x4dc0('0x8'))(_0x4dc0('0x9'));config['redis']=_['defaults'](config['redis'],{'host':_0x4dc0('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAdminId(_0x15a06b,_0x10edb2,_0x5ad8cd,_0x3f5996){return new Promise(function(_0x3adeee,_0x2ca6f0){var _0x58b116=![];var _0x13d336={'method':_0x4dc0('0xb'),'uri':_0x3f5996+_0x4dc0('0xc'),'json':!![]};_0x13d336['headers']=_0x5ad8cd;logger[_0x4dc0('0xd')]('Getting\x20admin\x20information');return rp(_0x13d336)['then'](function(_0x5a23c3){if(_0x5a23c3){var _0x4ed909=_0x5a23c3[_0x4dc0('0xe')];var _0x27b91c=null;for(_0x27b91c=0x0;_0x27b91c<_0x4ed909[_0x4dc0('0xf')];_0x27b91c++){if(_0x4ed909[_0x27b91c]['email']===_0x15a06b[_0x4dc0('0x10')]){_0x15a06b['adminId']=_0x4ed909[_0x27b91c]['id'];_0x58b116=!![];}}if(_0x58b116){logger[_0x4dc0('0xd')](_0x4dc0('0x11'),_0x15a06b[_0x4dc0('0x12')]);_0x3adeee(_0x15a06b);}else{_0x2ca6f0({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x2ca6f0({'statusCode':0x194,'message':_0x4dc0('0x13')});}})[_0x4dc0('0x14')](function(_0xdb23b9){logger[_0x4dc0('0x15')]('['+[_0x10edb2[_0x4dc0('0x16')]()]+']',_0xdb23b9[_0x4dc0('0x17')]);_0x2ca6f0(_0xdb23b9);});});}function getUser(_0x2c5adb,_0x2e8940,_0x24d35a){return function(_0x4d86ec){return new Promise(function(_0x3ce759,_0x43e449){var _0x169e32={'method':_0x4dc0('0xb'),'uri':_0x24d35a+_0x4dc0('0xc'),'json':!![]};_0x169e32[_0x4dc0('0x18')]=_0x2e8940;logger['info']('Getting\x20user\x20list');return rp(_0x169e32)['then'](function(_0x516ab0){if(_0x516ab0){var _0x318d12=_0x516ab0['users'];var _0x163269=![];var _0x5f2a30=null;if(_0x4d86ec[_0x4dc0('0x19')]!==null){logger['info'](_0x4dc0('0x1a'),_0x4d86ec[_0x4dc0('0x19')]);_0x4d86ec['userEmail']=_0x4d86ec[_0x4dc0('0x19')];for(_0x5f2a30=0x0;_0x5f2a30<_0x318d12[_0x4dc0('0xf')];_0x5f2a30++){if(_0x318d12[_0x5f2a30][_0x4dc0('0x1b')]===_0x4d86ec[_0x4dc0('0x19')]){_0x163269=!![];_0x4d86ec['userId']=_0x318d12[_0x5f2a30]['id'];logger['info']('User\x20found:',_0x4d86ec[_0x4dc0('0x1c')]);}}}if(!_0x163269){logger[_0x4dc0('0xd')]('Admin\x20selected');_0x4d86ec[_0x4dc0('0x1d')]=_0x4d86ec[_0x4dc0('0x10')];_0x4d86ec['userId']=_0x4d86ec['adminId'];_0x163269=!![];}if(_0x163269){_0x3ce759(_0x4d86ec);}else{_0x43e449({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x43e449({'statusCode':0x194,'message':_0x4dc0('0x13')});}})[_0x4dc0('0x14')](function(_0x4e0772){logger[_0x4dc0('0x15')]('['+[_0x2c5adb[_0x4dc0('0x16')]()]+']',_0x4e0772['message']);_0x43e449(_0x4e0772);});});};}function searchContact(_0x9e6436,_0x5d6bcd,_0x47e969,_0x1bf1d6){return new Promise(function(_0x269f0e,_0x5a5edd){var _0x38a2e0={'method':_0x4dc0('0xb'),'headers':_0x5d6bcd,'uri':_0x9e6436+'/api/lookup?q='+_0x1bf1d6+_0x4dc0('0x1e')+_0x47e969+_0x4dc0('0x1f'),'json':!![]};rp(_0x38a2e0)[_0x4dc0('0x20')](function(_0x33993e){var _0x500220=_['find'](_0x33993e[_0x4dc0('0x21')][_0x4dc0('0x21')],[_0x47e969,_0x1bf1d6]);_0x269f0e(_0x500220);})[_0x4dc0('0x14')](function(_0x473a90){_0x5a5edd(_0x473a90);});});}function getEndUser(_0x3fd790,_0x55f984,_0x315c88){return function(_0x5324fc){return new Promise(function(_0x17be45,_0x210109){logger[_0x4dc0('0xd')](util[_0x4dc0('0x22')]('Searching\x20contact\x20with\x20phone\x20%s',_0x5324fc[_0x4dc0('0x23')]));searchContact(_0x315c88,_0x55f984,_0x4dc0('0x24'),_0x5324fc[_0x4dc0('0x23')])[_0x4dc0('0x20')](function(_0x448ec7){if(_0x448ec7){_0x5324fc['endUserId']=_0x448ec7['id'];logger[_0x4dc0('0xd')](_0x4dc0('0x25'),_0x5324fc['endUserId']);return _0x17be45(_0x5324fc);}searchContact(_0x315c88,_0x55f984,'work_number',_0x5324fc[_0x4dc0('0x23')])['then'](function(_0x34a753){if(_0x34a753){_0x5324fc['endUserId']=_0x34a753['id'];logger['info'](_0x4dc0('0x26'),_0x5324fc['endUserId']);return _0x17be45(_0x5324fc);}createEndUser(_0x5324fc,_0x3fd790,_0x55f984,_0x315c88)[_0x4dc0('0x20')](function(_0x3a15db){logger[_0x4dc0('0xd')]('Contact\x20created:',_0x3a15db['endUserId']);return _0x17be45(_0x3a15db);});});})['catch'](function(_0x2717d5){_0x210109(_0x2717d5);});});};}function createEndUser(_0xa5e2e4,_0x1eca07,_0x33a973,_0x14bdc2){return new Promise(function(_0x3258be,_0x1b3ab6){var _0x34afdc=moment();var _0x1fa5ce={'method':_0x4dc0('0x27'),'uri':_0x14bdc2+_0x4dc0('0x28'),'body':{'contact':{'last_name':_0xa5e2e4[_0x4dc0('0x23')],'work_number':_0xa5e2e4[_0x4dc0('0x23')],'mobile_number':_0xa5e2e4[_0x4dc0('0x23')],'owner_id':_0xa5e2e4['userId'],'created_at':_0x34afdc['format']('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x1fa5ce[_0x4dc0('0x18')]=_0x33a973;logger[_0x4dc0('0xd')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x1fa5ce)[_0x4dc0('0x20')](function(_0x56be13){_0xa5e2e4[_0x4dc0('0x29')]=_0x56be13[_0x4dc0('0x2a')]['id'];_0x3258be(_0xa5e2e4);})[_0x4dc0('0x14')](function(_0x357992){logger['error']('['+[_0x1eca07['toUpperCase']()]+']',_0x357992[_0x4dc0('0x17')]);_0x1b3ab6(_0x357992[_0x4dc0('0x17')]);});});}function getTicket(_0x398b00,_0xeeef1c,_0x1287c5,_0x43dd78,_0x195172){return function(_0x270115){logger['info'](_0x4dc0('0x2b'));return new Promise(function(_0x51a062,_0x557229){var _0x175506=moment();var _0x188e53={'method':_0x4dc0('0x27'),'uri':_0x1287c5+_0x4dc0('0x2c'),'body':{'title':intUtil[_0x4dc0('0x2d')](_0x43dd78[_0x4dc0('0x2e')],_0x195172,'\x20'),'description':intUtil[_0x4dc0('0x2d')](_0x43dd78[_0x4dc0('0x2f')],_0x195172,'\x0a'),'owner_id':_0x270115[_0x4dc0('0x1c')],'creater_id':_0x270115[_0x4dc0('0x12')],'targetable_id':_0x270115[_0x4dc0('0x29')],'targetable_type':'Contact','created_at':_0x175506['format'](_0x4dc0('0x30')),'due_date':_0x175506[_0x4dc0('0x31')](0x1e,'m')['format'](_0x4dc0('0x30'))},'json':!![]};_0x188e53['headers']=_0xeeef1c;return rp(_0x188e53)['then'](function(_0x175e1f){_0x270115[_0x4dc0('0x32')]=_0x175e1f[_0x4dc0('0x33')]['id'];logger[_0x4dc0('0xd')](_0x4dc0('0x34'),_0x270115['ticketId']);_0x51a062(_0x270115);})[_0x4dc0('0x14')](function(_0x391717){logger['error']('['+[_0x398b00[_0x4dc0('0x16')]()]+']',_0x391717[_0x4dc0('0x17')]);_0x557229(_0x391717[_0x4dc0('0x17')]);});});};}function emit(_0x4fc19d,_0x633001,_0x56a163){var _0x5ac47d={'uri':_0x4fc19d+_0x4dc0('0x35')+_0x56a163};io['to'](util[_0x4dc0('0x22')](_0x4dc0('0x36'),_0x633001))[_0x4dc0('0x37')](_0x4dc0('0x38'),_0x5ac47d);}exports['cs']=function(_0x35edac,_0x3daf49,_0x286401,_0x1124da,_0x30fc97,_0x51dc9e,_0x29b437,_0x2fec34){var _0x3d27c7={};var _0xc0a3e0={'Authorization':'Token\x20token='+_0x51dc9e[_0x4dc0('0x39')]};_0x51dc9e['remoteUri']=intUtil['stripTrailingSlash'](_0x51dc9e[_0x4dc0('0x3a')]);_0x51dc9e['serverUrl']=intUtil[_0x4dc0('0x3b')](_0x51dc9e[_0x4dc0('0x3c')]);var _0x4be2b3=_0x51dc9e[_0x4dc0('0x3a')];_0x3d27c7[_0x4dc0('0x10')]=_0x51dc9e[_0x4dc0('0x3d')];_0x3d27c7['contactNumber']=_0x2fec34[_0x4dc0('0x3e')]()===_0x4dc0('0x3f')?_0x3daf49[_0x4dc0('0x40')]:_0x3daf49['calleridnum'];_0x3d27c7[_0x4dc0('0x41')]=_0x2fec34===_0x4dc0('0x42')||_0x2fec34===_0x4dc0('0x43')?_0x4dc0('0x42'):_0x4dc0('0x3f');if(_0x1124da){_0x3d27c7[_0x4dc0('0x19')]=_0x1124da[_0x4dc0('0x1b')];}var _0x4ec45e=util['format'](_0x4dc0('0x44'),_0x51dc9e[_0x4dc0('0x3c')],_0x3daf49[_0x4dc0('0x45')],md5(_0x3daf49['uniqueid']));if(_0x30fc97&&_0x30fc97[_0x4dc0('0x46')]){logger[_0x4dc0('0xd')](_0x4dc0('0x47'),_0x4dc0('0x48'));_0x3daf49['recordingURL']=_0x4ec45e;}else if(_0x29b437&&_0x29b437['recordingFormat']&&_0x29b437[_0x4dc0('0x49')]!==_0x4dc0('0x4a')){logger[_0x4dc0('0xd')](_0x4dc0('0x4b'),_0x4dc0('0x48'));_0x3daf49[_0x4dc0('0x4c')]=_0x4ec45e;}else{_0x3daf49[_0x4dc0('0x4c')]='';}return getAdminId(_0x3d27c7,_0x2fec34,_0xc0a3e0,_0x4be2b3)['then'](getUser(_0x2fec34,_0xc0a3e0,_0x4be2b3))['then'](getEndUser(_0x2fec34,_0xc0a3e0,_0x4be2b3))['then'](getTicket(_0x2fec34,_0xc0a3e0,_0x4be2b3,_0x286401,_0x3daf49))[_0x4dc0('0x20')](function(_0x2d2a70){logger[_0x4dc0('0xd')](util['format']('The\x20ticket\x20ID\x20is:\x20%s',_0x2d2a70[_0x4dc0('0x32')]));if(_0x2fec34!==_0x4dc0('0x43')){logger[_0x4dc0('0xd')]('['+[_0x2fec34[_0x4dc0('0x16')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x4be2b3,_0x1124da[_0x4dc0('0x4d')],_0x2d2a70['endUserId']);}})['catch'](function(_0x22e2b0){logger['error']('['+[_0x2fec34[_0x4dc0('0x16')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0x4dc0('0x4e')](_0x22e2b0,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x91de=['contactNumber','mobile_number','endUserId','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','format','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/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','username','toLowerCase','destcalleridnum','calleridnum','callDirection','queue','unmanaged','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name','inspect','lodash','request-promise','md5','util','moment','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','/api/selector/owners','headers','info','then','users','length','email','adminEmail','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','GET','Getting\x20user\x20list','agentEmail','userEmail','userId','User\x20found:','Admin\x20selected','adminId','error','toUpperCase','message','/api/lookup?q=','&f=','&entities=contact','find','contacts','Searching\x20contact\x20with\x20phone\x20%s'];(function(_0x4dbdb6,_0x5b78e4){var _0x450fb1=function(_0x33fceb){while(--_0x33fceb){_0x4dbdb6['push'](_0x4dbdb6['shift']());}};_0x450fb1(++_0x5b78e4);}(_0x91de,0x8b));var _0xe91d=function(_0x145da2,_0x3b7b44){_0x145da2=_0x145da2-0x0;var _0xc55834=_0x91de[_0x145da2];return _0xc55834;};'use strict';var _=require(_0xe91d('0x0'));var rp=require(_0xe91d('0x1'));var md5=require(_0xe91d('0x2'));var util=require(_0xe91d('0x3'));var moment=require(_0xe91d('0x4'));var Promise=require(_0xe91d('0x5'));var Redis=require(_0xe91d('0x6'));var intUtil=require(_0xe91d('0x7'));var config=require(_0xe91d('0x8'));var logger=require(_0xe91d('0x9'))('freshsales');config[_0xe91d('0xa')]=_['defaults'](config[_0xe91d('0xa')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe91d('0xa')]));function getAdminId(_0x26e902,_0x135a99,_0x46f5d3,_0xc4cdda){return new Promise(function(_0x36b654,_0x2060ad){var _0x5a5645=![];var _0x5ab768={'method':'GET','uri':_0xc4cdda+_0xe91d('0xb'),'json':!![]};_0x5ab768[_0xe91d('0xc')]=_0x46f5d3;logger[_0xe91d('0xd')]('Getting\x20admin\x20information');return rp(_0x5ab768)[_0xe91d('0xe')](function(_0xf54fff){if(_0xf54fff){var _0x59c7c8=_0xf54fff[_0xe91d('0xf')];var _0x442f57=null;for(_0x442f57=0x0;_0x442f57<_0x59c7c8[_0xe91d('0x10')];_0x442f57++){if(_0x59c7c8[_0x442f57][_0xe91d('0x11')]===_0x26e902[_0xe91d('0x12')]){_0x26e902['adminId']=_0x59c7c8[_0x442f57]['id'];_0x5a5645=!![];}}if(_0x5a5645){logger[_0xe91d('0xd')](_0xe91d('0x13'),_0x26e902['adminId']);_0x36b654(_0x26e902);}else{_0x2060ad({'statusCode':0x194,'message':_0xe91d('0x14')});}}else{_0x2060ad({'statusCode':0x194,'message':_0xe91d('0x14')});}})[_0xe91d('0x15')](function(_0x5aff03){logger['error']('['+[_0x135a99['toUpperCase']()]+']',_0x5aff03['message']);_0x2060ad(_0x5aff03);});});}function getUser(_0x5889e9,_0x35a704,_0x4c952a){return function(_0x1538ea){return new Promise(function(_0x453624,_0x4bb81f){var _0x5c9091={'method':_0xe91d('0x16'),'uri':_0x4c952a+_0xe91d('0xb'),'json':!![]};_0x5c9091[_0xe91d('0xc')]=_0x35a704;logger['info'](_0xe91d('0x17'));return rp(_0x5c9091)[_0xe91d('0xe')](function(_0x493b1d){if(_0x493b1d){var _0x237791=_0x493b1d[_0xe91d('0xf')];var _0x144ed3=![];var _0x3fb177=null;if(_0x1538ea[_0xe91d('0x18')]!==null){logger['info']('Getting\x20user\x20with\x20email',_0x1538ea[_0xe91d('0x18')]);_0x1538ea[_0xe91d('0x19')]=_0x1538ea[_0xe91d('0x18')];for(_0x3fb177=0x0;_0x3fb177<_0x237791[_0xe91d('0x10')];_0x3fb177++){if(_0x237791[_0x3fb177][_0xe91d('0x11')]===_0x1538ea[_0xe91d('0x18')]){_0x144ed3=!![];_0x1538ea[_0xe91d('0x1a')]=_0x237791[_0x3fb177]['id'];logger[_0xe91d('0xd')](_0xe91d('0x1b'),_0x1538ea[_0xe91d('0x1a')]);}}}if(!_0x144ed3){logger[_0xe91d('0xd')](_0xe91d('0x1c'));_0x1538ea[_0xe91d('0x19')]=_0x1538ea['adminEmail'];_0x1538ea[_0xe91d('0x1a')]=_0x1538ea[_0xe91d('0x1d')];_0x144ed3=!![];}if(_0x144ed3){_0x453624(_0x1538ea);}else{_0x4bb81f({'statusCode':0x194,'message':_0xe91d('0x14')});}}else{_0x4bb81f({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0xe91d('0x15')](function(_0x4b5686){logger[_0xe91d('0x1e')]('['+[_0x5889e9[_0xe91d('0x1f')]()]+']',_0x4b5686[_0xe91d('0x20')]);_0x4bb81f(_0x4b5686);});});};}function searchContact(_0x32087b,_0x1ce69b,_0x5a1411,_0x594ae6){return new Promise(function(_0x476bfe,_0x40ed72){var _0x343358={'method':_0xe91d('0x16'),'headers':_0x1ce69b,'uri':_0x32087b+_0xe91d('0x21')+_0x594ae6+_0xe91d('0x22')+_0x5a1411+_0xe91d('0x23'),'json':!![]};rp(_0x343358)[_0xe91d('0xe')](function(_0x3f35a){var _0x1b29ff=_[_0xe91d('0x24')](_0x3f35a['contacts'][_0xe91d('0x25')],[_0x5a1411,_0x594ae6]);_0x476bfe(_0x1b29ff);})[_0xe91d('0x15')](function(_0x18a3f7){_0x40ed72(_0x18a3f7);});});}function getEndUser(_0x5b8bf8,_0x4881ab,_0x133d73){return function(_0x102431){return new Promise(function(_0x2c61eb,_0x50e7f9){logger[_0xe91d('0xd')](util['format'](_0xe91d('0x26'),_0x102431[_0xe91d('0x27')]));searchContact(_0x133d73,_0x4881ab,_0xe91d('0x28'),_0x102431[_0xe91d('0x27')])[_0xe91d('0xe')](function(_0xbaaf61){if(_0xbaaf61){_0x102431[_0xe91d('0x29')]=_0xbaaf61['id'];logger[_0xe91d('0xd')]('Contact\x20found\x20mobile_number:',_0x102431[_0xe91d('0x29')]);return _0x2c61eb(_0x102431);}searchContact(_0x133d73,_0x4881ab,_0xe91d('0x2a'),_0x102431['contactNumber'])[_0xe91d('0xe')](function(_0x37c083){if(_0x37c083){_0x102431[_0xe91d('0x29')]=_0x37c083['id'];logger[_0xe91d('0xd')](_0xe91d('0x2b'),_0x102431[_0xe91d('0x29')]);return _0x2c61eb(_0x102431);}createEndUser(_0x102431,_0x5b8bf8,_0x4881ab,_0x133d73)['then'](function(_0x271018){logger[_0xe91d('0xd')](_0xe91d('0x2c'),_0x271018['endUserId']);return _0x2c61eb(_0x271018);});});})[_0xe91d('0x15')](function(_0x45abde){_0x50e7f9(_0x45abde);});});};}function createEndUser(_0x3750e9,_0x55db14,_0x315b23,_0x510393){return new Promise(function(_0x22c353,_0x3062f1){var _0xf0cd5e=moment();var _0xa787bd={'method':_0xe91d('0x2d'),'uri':_0x510393+_0xe91d('0x2e'),'body':{'contact':{'last_name':_0x3750e9[_0xe91d('0x27')],'work_number':_0x3750e9['contactNumber'],'mobile_number':_0x3750e9[_0xe91d('0x27')],'owner_id':_0x3750e9['userId'],'created_at':_0xf0cd5e[_0xe91d('0x2f')](_0xe91d('0x30'))}},'json':!![]};_0xa787bd[_0xe91d('0xc')]=_0x315b23;logger[_0xe91d('0xd')](_0xe91d('0x31'));return rp(_0xa787bd)[_0xe91d('0xe')](function(_0x1483ac){_0x3750e9['endUserId']=_0x1483ac[_0xe91d('0x32')]['id'];_0x22c353(_0x3750e9);})[_0xe91d('0x15')](function(_0xf44a53){logger[_0xe91d('0x1e')]('['+[_0x55db14[_0xe91d('0x1f')]()]+']',_0xf44a53['message']);_0x3062f1(_0xf44a53[_0xe91d('0x20')]);});});}function getTicket(_0x2c4fa3,_0x3d3aec,_0x3e84bd,_0x2115ae,_0x2babdf){return function(_0x204a5c){logger[_0xe91d('0xd')]('Creating\x20new\x20task');return new Promise(function(_0x5964fb,_0x1174a3){var _0x4b43f6=moment();var _0x2894a2={'method':_0xe91d('0x2d'),'uri':_0x3e84bd+_0xe91d('0x33'),'body':{'title':intUtil[_0xe91d('0x34')](_0x2115ae[_0xe91d('0x35')],_0x2babdf,'\x20'),'description':intUtil[_0xe91d('0x34')](_0x2115ae[_0xe91d('0x36')],_0x2babdf,'\x0a'),'owner_id':_0x204a5c[_0xe91d('0x1a')],'creater_id':_0x204a5c[_0xe91d('0x1d')],'targetable_id':_0x204a5c[_0xe91d('0x29')],'targetable_type':_0xe91d('0x37'),'created_at':_0x4b43f6[_0xe91d('0x2f')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x4b43f6[_0xe91d('0x38')](0x1e,'m')['format'](_0xe91d('0x30'))},'json':!![]};_0x2894a2[_0xe91d('0xc')]=_0x3d3aec;return rp(_0x2894a2)[_0xe91d('0xe')](function(_0x4bae9c){_0x204a5c[_0xe91d('0x39')]=_0x4bae9c[_0xe91d('0x3a')]['id'];logger[_0xe91d('0xd')](_0xe91d('0x3b'),_0x204a5c['ticketId']);_0x5964fb(_0x204a5c);})['catch'](function(_0x2b8f68){logger['error']('['+[_0x2c4fa3[_0xe91d('0x1f')]()]+']',_0x2b8f68[_0xe91d('0x20')]);_0x1174a3(_0x2b8f68[_0xe91d('0x20')]);});});};}function emit(_0x2fe674,_0x274d1c,_0x3edac1){var _0xb4c8d2={'uri':_0x2fe674+_0xe91d('0x3c')+_0x3edac1};io['to'](util[_0xe91d('0x2f')](_0xe91d('0x3d'),_0x274d1c))[_0xe91d('0x3e')](_0xe91d('0x3f'),_0xb4c8d2);}exports['cs']=function(_0x329720,_0x107e53,_0xbd24f4,_0x1c1c52,_0x1ef5b9,_0x4b08d2,_0x3892f0,_0x279672){var _0xc5ee19={};var _0x22b72b={'Authorization':_0xe91d('0x40')+_0x4b08d2[_0xe91d('0x41')]};_0x4b08d2[_0xe91d('0x42')]=intUtil[_0xe91d('0x43')](_0x4b08d2[_0xe91d('0x42')]);_0x4b08d2['serverUrl']=intUtil[_0xe91d('0x43')](_0x4b08d2['serverUrl']);var _0x1fb6a8=_0x4b08d2[_0xe91d('0x42')];_0xc5ee19[_0xe91d('0x12')]=_0x4b08d2[_0xe91d('0x44')];_0xc5ee19[_0xe91d('0x27')]=_0x279672[_0xe91d('0x45')]()==='outbound'?_0x107e53[_0xe91d('0x46')]:_0x107e53[_0xe91d('0x47')];_0xc5ee19[_0xe91d('0x48')]=_0x279672===_0xe91d('0x49')||_0x279672===_0xe91d('0x4a')?'queue':_0xe91d('0x4b');if(_0x1c1c52){_0xc5ee19[_0xe91d('0x18')]=_0x1c1c52['email'];}var _0x5385ad=util[_0xe91d('0x2f')](_0xe91d('0x4c'),_0x4b08d2[_0xe91d('0x4d')],_0x107e53[_0xe91d('0x4e')],md5(_0x107e53['uniqueid']));if(_0x1ef5b9&&_0x1ef5b9[_0xe91d('0x4f')]){logger['info'](_0xe91d('0x50'),_0xe91d('0x51'));_0x107e53[_0xe91d('0x52')]=_0x5385ad;}else if(_0x3892f0&&_0x3892f0['recordingFormat']&&_0x3892f0['recordingFormat']!==_0xe91d('0x53')){logger[_0xe91d('0xd')](_0xe91d('0x54'),_0xe91d('0x51'));_0x107e53[_0xe91d('0x52')]=_0x5385ad;}else{_0x107e53['recordingURL']='';}return getAdminId(_0xc5ee19,_0x279672,_0x22b72b,_0x1fb6a8)[_0xe91d('0xe')](getUser(_0x279672,_0x22b72b,_0x1fb6a8))['then'](getEndUser(_0x279672,_0x22b72b,_0x1fb6a8))[_0xe91d('0xe')](getTicket(_0x279672,_0x22b72b,_0x1fb6a8,_0xbd24f4,_0x107e53))[_0xe91d('0xe')](function(_0x5998cf){logger['info'](util['format'](_0xe91d('0x55'),_0x5998cf['ticketId']));if(_0x279672!==_0xe91d('0x4a')){logger[_0xe91d('0xd')]('['+[_0x279672[_0xe91d('0x1f')]()]+']',_0xe91d('0x56'));emit(_0x1fb6a8,_0x1c1c52[_0xe91d('0x57')],_0x5998cf[_0xe91d('0x29')]);}})[_0xe91d('0x15')](function(_0x263322){logger[_0xe91d('0x1e')]('['+[_0x279672[_0xe91d('0x1f')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0xe91d('0x58')](_0x263322,{'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 cf60f1c..cab5a0c 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 _0x7185=['[EXEC]','%s\x20configuration\x20#%s\x20not\x20found','error','format','%s\x20account\x20#%s\x20not\x20found','lodash','./zendesk','./salesforce','./zoho','./desk','./vtiger','./servicenow','./dynamics365','zendesk','salesforce','freshdesk','zoho','vtiger','dynamics365','freshsales','servicenow','exec','includes','data1','toLowerCase','data2','find','Configurations','data3','queue','routeId','log','EVENT\x20UNKNOWN','unmanaged','sugarcrm','desk','unknown\x20integration','../../../../config/logger'];(function(_0x127530,_0x54a9be){var _0x405622=function(_0x36210c){while(--_0x36210c){_0x127530['push'](_0x127530['shift']());}};_0x405622(++_0x54a9be);}(_0x7185,0x9d));var _0x5718=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x7185[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x5718('0x0'));var util=require('util');var zendesk=require(_0x5718('0x1'));var salesforce=require(_0x5718('0x2'));var sugarcrm=require('./sugarcrm');var freshdesk=require('./freshdesk');var zoho=require(_0x5718('0x3'));var desk=require(_0x5718('0x4'));var vtiger=require(_0x5718('0x5'));var servicenow=require(_0x5718('0x6'));var dynamics365=require(_0x5718('0x7'));var freshsales=require('./freshsales');var integrations=[_0x5718('0x8'),_0x5718('0x9'),'sugarcrm',_0x5718('0xa'),_0x5718('0xb'),'desk',_0x5718('0xc'),_0x5718('0xd'),_0x5718('0xe'),_0x5718('0xf')];exports[_0x5718('0x10')]=function(_0x149e42,_0x1e4e01,_0x2e1e12,_0x335594,_0x1f552c,_0x5a3618){if(_0x2e1e12){if(_[_0x5718('0x11')](integrations,_0x149e42[_0x5718('0x12')][_0x5718('0x13')]())){try{var _0x30a930=null;var _0x1f6aa3='';var _0x27d6a5=_0x2e1e12[_0x149e42[_0x5718('0x12')][_0x5718('0x13')]()];if(_0x27d6a5){var _0x29d10a=_0x27d6a5[_0x149e42[_0x5718('0x14')]];if(_0x29d10a){var _0x9027af=_[_0x5718('0x15')](_0x29d10a[_0x5718('0x16')],{'id':parseInt(_0x149e42[_0x5718('0x17')],0xa)});if(_0x9027af){if(_0x335594){if(_0x1f552c&&_0x1e4e01['queue']){_0x1f6aa3=_0x5718('0x18');}else if(_0x1e4e01[_0x5718('0x19')]){_0x1f6aa3='outbound';}else{console[_0x5718('0x1a')](_0x5718('0x1b'),_0x1e4e01);}}else{_0x1f6aa3=_0x5718('0x1c');}switch(_0x149e42[_0x5718('0x12')][_0x5718('0x13')]()){case _0x5718('0x8'):zendesk[_0x1f6aa3](_0x149e42,_0x1e4e01,_0x9027af,_0x335594,_0x1f552c,_0x29d10a,_0x5a3618);break;case _0x5718('0x9'):salesforce[_0x1f6aa3](_0x149e42,_0x1e4e01,_0x9027af,_0x335594,_0x1f552c,_0x29d10a,_0x5a3618);break;case _0x5718('0x1d'):sugarcrm[_0x1f6aa3](_0x149e42,_0x1e4e01,_0x9027af,_0x335594,_0x1f552c,_0x29d10a,_0x5a3618);break;case _0x5718('0xa'):freshdesk[_0x1f6aa3](_0x149e42,_0x1e4e01,_0x9027af,_0x335594,_0x1f552c,_0x29d10a,_0x5a3618);break;case _0x5718('0xb'):zoho[_0x1f6aa3](_0x149e42,_0x1e4e01,_0x9027af,_0x335594,_0x1f552c,_0x29d10a,_0x5a3618);break;case _0x5718('0x1e'):desk[_0x1f6aa3](_0x149e42,_0x1e4e01,_0x9027af,_0x335594,_0x1f552c,_0x29d10a,_0x5a3618);break;case'vtiger':vtiger[_0x1f6aa3](_0x149e42,_0x1e4e01,_0x9027af,_0x335594,_0x1f552c,_0x29d10a,_0x5a3618);break;case'freshsales':freshsales['cs'](_0x149e42,_0x1e4e01,_0x9027af,_0x335594,_0x1f552c,_0x29d10a,_0x5a3618,_0x1f6aa3);break;case _0x5718('0xf'):servicenow['cs'](_0x149e42,_0x1e4e01,_0x9027af,_0x335594,_0x1f552c,_0x29d10a,_0x5a3618,_0x1f6aa3);break;case _0x5718('0xd'):dynamics365['cs'](_0x149e42,_0x1e4e01,_0x9027af,_0x335594,_0x1f552c,_0x29d10a,_0x5a3618,_0x1f6aa3);break;default:console[_0x5718('0x1a')](_0x5718('0x1f'));}}else{_0x30a930=require(_0x5718('0x20'))(_0x149e42[_0x5718('0x12')]['toLowerCase']());_0x30a930['error'](_0x5718('0x21'),util['format'](_0x5718('0x22'),_0x149e42[_0x5718('0x12')][_0x5718('0x13')](),_0x149e42[_0x5718('0x17')]));}}else{_0x30a930=require('../../../../config/logger')(_0x149e42[_0x5718('0x12')][_0x5718('0x13')]());_0x30a930[_0x5718('0x23')](_0x5718('0x21'),util[_0x5718('0x24')](_0x5718('0x25'),_0x149e42[_0x5718('0x12')][_0x5718('0x13')](),_0x149e42[_0x5718('0x14')]));}}else{}}catch(_0x57969d){console['error'](_0x57969d);}}}}; \ No newline at end of file +var _0xaf1e=['freshsales','exec','data1','toLowerCase','data2','Configurations','data3','queue','outbound','EVENT\x20UNKNOWN','unmanaged','salesforce','vtiger','servicenow','dynamics365','log','unknown\x20integration','../../../../config/logger','error','format','%s\x20configuration\x20#%s\x20not\x20found','[EXEC]','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./dynamics365','./freshsales','sugarcrm','freshdesk','zoho','desk'];(function(_0x38b8c6,_0x541f91){var _0x3104d6=function(_0x4215ee){while(--_0x4215ee){_0x38b8c6['push'](_0x38b8c6['shift']());}};_0x3104d6(++_0x541f91);}(_0xaf1e,0xab));var _0xeaf1=function(_0x38b887,_0xb71329){_0x38b887=_0x38b887-0x0;var _0x4844ca=_0xaf1e[_0x38b887];return _0x4844ca;};'use strict';var _=require(_0xeaf1('0x0'));var util=require(_0xeaf1('0x1'));var zendesk=require(_0xeaf1('0x2'));var salesforce=require(_0xeaf1('0x3'));var sugarcrm=require(_0xeaf1('0x4'));var freshdesk=require(_0xeaf1('0x5'));var zoho=require(_0xeaf1('0x6'));var desk=require(_0xeaf1('0x7'));var vtiger=require('./vtiger');var servicenow=require('./servicenow');var dynamics365=require(_0xeaf1('0x8'));var freshsales=require(_0xeaf1('0x9'));var integrations=['zendesk','salesforce',_0xeaf1('0xa'),_0xeaf1('0xb'),_0xeaf1('0xc'),_0xeaf1('0xd'),'vtiger','dynamics365',_0xeaf1('0xe'),'servicenow'];exports[_0xeaf1('0xf')]=function(_0x25eed7,_0x3670e8,_0x21bb09,_0x5dea06,_0x351ee5,_0x1ca45d){if(_0x21bb09){if(_['includes'](integrations,_0x25eed7[_0xeaf1('0x10')][_0xeaf1('0x11')]())){try{var _0x54e5af=null;var _0x3a2f0c='';var _0x19e18c=_0x21bb09[_0x25eed7[_0xeaf1('0x10')][_0xeaf1('0x11')]()];if(_0x19e18c){var _0x35b3a5=_0x19e18c[_0x25eed7[_0xeaf1('0x12')]];if(_0x35b3a5){var _0x9798a7=_['find'](_0x35b3a5[_0xeaf1('0x13')],{'id':parseInt(_0x25eed7[_0xeaf1('0x14')],0xa)});if(_0x9798a7){if(_0x5dea06){if(_0x351ee5&&_0x3670e8['queue']){_0x3a2f0c=_0xeaf1('0x15');}else if(_0x3670e8['routeId']){_0x3a2f0c=_0xeaf1('0x16');}else{console['log'](_0xeaf1('0x17'),_0x3670e8);}}else{_0x3a2f0c=_0xeaf1('0x18');}switch(_0x25eed7[_0xeaf1('0x10')]['toLowerCase']()){case'zendesk':zendesk[_0x3a2f0c](_0x25eed7,_0x3670e8,_0x9798a7,_0x5dea06,_0x351ee5,_0x35b3a5,_0x1ca45d);break;case _0xeaf1('0x19'):salesforce[_0x3a2f0c](_0x25eed7,_0x3670e8,_0x9798a7,_0x5dea06,_0x351ee5,_0x35b3a5,_0x1ca45d);break;case _0xeaf1('0xa'):sugarcrm[_0x3a2f0c](_0x25eed7,_0x3670e8,_0x9798a7,_0x5dea06,_0x351ee5,_0x35b3a5,_0x1ca45d);break;case'freshdesk':freshdesk[_0x3a2f0c](_0x25eed7,_0x3670e8,_0x9798a7,_0x5dea06,_0x351ee5,_0x35b3a5,_0x1ca45d);break;case _0xeaf1('0xc'):zoho[_0x3a2f0c](_0x25eed7,_0x3670e8,_0x9798a7,_0x5dea06,_0x351ee5,_0x35b3a5,_0x1ca45d);break;case _0xeaf1('0xd'):desk[_0x3a2f0c](_0x25eed7,_0x3670e8,_0x9798a7,_0x5dea06,_0x351ee5,_0x35b3a5,_0x1ca45d);break;case _0xeaf1('0x1a'):vtiger[_0x3a2f0c](_0x25eed7,_0x3670e8,_0x9798a7,_0x5dea06,_0x351ee5,_0x35b3a5,_0x1ca45d);break;case _0xeaf1('0xe'):freshsales['cs'](_0x25eed7,_0x3670e8,_0x9798a7,_0x5dea06,_0x351ee5,_0x35b3a5,_0x1ca45d,_0x3a2f0c);break;case _0xeaf1('0x1b'):servicenow['cs'](_0x25eed7,_0x3670e8,_0x9798a7,_0x5dea06,_0x351ee5,_0x35b3a5,_0x1ca45d,_0x3a2f0c);break;case _0xeaf1('0x1c'):dynamics365['cs'](_0x25eed7,_0x3670e8,_0x9798a7,_0x5dea06,_0x351ee5,_0x35b3a5,_0x1ca45d,_0x3a2f0c);break;default:console[_0xeaf1('0x1d')](_0xeaf1('0x1e'));}}else{_0x54e5af=require(_0xeaf1('0x1f'))(_0x25eed7[_0xeaf1('0x10')][_0xeaf1('0x11')]());_0x54e5af[_0xeaf1('0x20')]('[EXEC]',util[_0xeaf1('0x21')](_0xeaf1('0x22'),_0x25eed7[_0xeaf1('0x10')][_0xeaf1('0x11')](),_0x25eed7['data3']));}}else{_0x54e5af=require(_0xeaf1('0x1f'))(_0x25eed7['data1'][_0xeaf1('0x11')]());_0x54e5af[_0xeaf1('0x20')](_0xeaf1('0x23'),util[_0xeaf1('0x21')](_0xeaf1('0x24'),_0x25eed7['data1'][_0xeaf1('0x11')](),_0x25eed7[_0xeaf1('0x12')]));}}else{}}catch(_0x417c3f){console[_0xeaf1('0x20')](_0x417c3f);}}}}; \ 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 2ff3bfb..14d8137 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 _0xb879=['[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','name','integrationTab','newTab','user:%s','trigger:browser:url','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','outbound','recordingFormat','none','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','Fields','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:salesforce:display','[OUTBOUND]','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','localhost','socket.io-emitter','emit','getString','Subjects','Descriptions','ticketType','Task','ActivityDate','IsRecurrence','endUserType','lead','account','WhatId','Case','contact','AccountId','info','create','isNil','validateEmail','sobject','User','find','execute','then','Email','resolve','identity','user_id','display_name','contact_lead','cloneDeep','additionalSearchContact','merge','$or','length','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','Contact','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','No\x20Company','upperFirst','forEach','includes','string','picklist','idField','content','variable','variableName','toString','customVariable','Variable','password','securityToken','Connection','https://login.salesforce.com','clientSecret','Connection\x20established.','queue','serverUrl','stripTrailingSlash','remoteUri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','email','calleridname','calleridnum','[QUEUE]\x20Ticket\x20%s\x20created'];(function(_0x115534,_0x45f40c){var _0x1f53c2=function(_0x36f0b1){while(--_0x36f0b1){_0x115534['push'](_0x115534['shift']());}};_0x1f53c2(++_0x45f40c);}(_0xb879,0x10f));var _0x9b87=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xb879[_0xfae23b];return _0x200640;};'use strict';var _=require('lodash');var rp=require(_0x9b87('0x0'));var moment=require('moment');var BPromise=require('bluebird');var md5=require(_0x9b87('0x1'));var jsforce=require('jsforce');var util=require(_0x9b87('0x2'));var Redis=require(_0x9b87('0x3'));var intUtil=require(_0x9b87('0x4'));var config=require(_0x9b87('0x5'));var logger=require(_0x9b87('0x6'))(_0x9b87('0x7'));config[_0x9b87('0x8')]=_['defaults'](config[_0x9b87('0x8')],{'host':_0x9b87('0x9'),'port':0x18eb});var io=require(_0x9b87('0xa'))(new Redis(config['redis']));function emit(_0x2cb2ad,_0x22c1b8,_0x3116d0){io['to'](_0x2cb2ad)[_0x9b87('0xb')](_0x22c1b8,_0x3116d0);}function getTicket(_0x44135a,_0x5de2f8,_0x8cb399,_0x92c530,_0x47e584,_0x11ffc6,_0x17396e,_0x47c844){var _0x3524e2=Object['assign']({},{'OwnerId':_0x5de2f8['id'],'Subject':intUtil[_0x9b87('0xc')](_0x92c530[_0x9b87('0xd')],_0x47e584,'\x20'),'Description':intUtil[_0x9b87('0xc')](_0x92c530[_0x9b87('0xe')],_0x47e584,'\x0a')},getCustomFields(_0x11ffc6,_0x47e584));if(_0x8cb399){if(_0x92c530[_0x9b87('0xf')]===_0x9b87('0x10')){_0x3524e2[_0x9b87('0x11')]=moment['utc']();_0x3524e2['IsReminderSet']=![];_0x3524e2[_0x9b87('0x12')]=![];if(_0x8cb399['endUserType']==='contact'||_0x8cb399[_0x9b87('0x13')]===_0x9b87('0x14')){_0x3524e2['WhoId']=_0x8cb399['id'];}else if(_0x8cb399[_0x9b87('0x13')]===_0x9b87('0x15')){_0x3524e2[_0x9b87('0x16')]=_0x8cb399['id'];}}else if(_0x92c530['ticketType']===_0x9b87('0x17')){if(_0x8cb399['endUserType']===_0x9b87('0x18')){_0x3524e2['ContactId']=_0x8cb399['id'];}else if(_0x8cb399[_0x9b87('0x13')]===_0x9b87('0x15')){_0x3524e2[_0x9b87('0x19')]=_0x8cb399['id'];}else if(_0x8cb399[_0x9b87('0x13')]===_0x9b87('0x14')&&_0x92c530['leadId']){_0x3524e2[_0x92c530['leadId']]=_0x8cb399['id'];}else{logger[_0x9b87('0x1a')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x17396e['sobject'](_0x92c530[_0x9b87('0xf')])[_0x9b87('0x1b')](_0x3524e2);}function getUser(_0x9e4830,_0x1991a2,_0x203fb4){if(!_[_0x9b87('0x1c')](_0x1991a2)&&intUtil[_0x9b87('0x1d')](_0x1991a2)){var _0x388f11={'Email':_0x1991a2};var _0x2d43a2={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x203fb4[_0x9b87('0x1e')](_0x9b87('0x1f'))[_0x9b87('0x20')](_0x388f11,_0x2d43a2)[_0x9b87('0x21')]()[_0x9b87('0x22')](function(_0xb89a0e){if(_0xb89a0e['length']){var _0x2a66e5=_[_0x9b87('0x20')](_0xb89a0e,function(_0x52b3ec){return _0x52b3ec[_0x9b87('0x23')]===_0x1991a2;});if(_0x2a66e5){logger[_0x9b87('0x1a')]('Agent\x20%s\x20found.',_0x1991a2);return BPromise[_0x9b87('0x24')]({'id':_0x2a66e5['Id'],'name':_0x2a66e5['Name']});}}else{logger[_0x9b87('0x1a')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x1991a2);return _0x203fb4[_0x9b87('0x25')]()[_0x9b87('0x22')](function(_0x5d1eef){return BPromise['resolve']({'id':_0x5d1eef[_0x9b87('0x26')],'name':_0x5d1eef['display_name']});});}});}else{logger[_0x9b87('0x1a')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x1991a2);return _0x203fb4[_0x9b87('0x25')]()[_0x9b87('0x22')](function(_0x404058){return BPromise[_0x9b87('0x24')]({'id':_0x404058[_0x9b87('0x26')],'name':_0x404058[_0x9b87('0x27')]});});}}function getEndUser(_0x2c6f7e,_0x5bea0d,_0x4b1e34,_0x50d490,_0xb766cf){var _0x5811fb={'$or':{'Phone':_0x50d490}};var _0x1b6101={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0x9b87('0x22')](function(){logger[_0x9b87('0x1a')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x50d490,_0x5bea0d['moduleSearch']);switch(_0x5bea0d['moduleSearch']){case _0x9b87('0x28'):var _0x44d592=_[_0x9b87('0x29')](_0x5811fb);if(_0x5bea0d['additionalSearchContact']){var _0x550e69={};_0x550e69[_0x5bea0d[_0x9b87('0x2a')]]=_0x50d490;_[_0x9b87('0x2b')](_0x44d592[_0x9b87('0x2c')],_0x550e69);}return _0xb766cf[_0x9b87('0x1e')]('Contact')['find'](_0x44d592,_0x1b6101)[_0x9b87('0x21')]()[_0x9b87('0x22')](function(_0x299096){if(_0x299096&&_0x299096[_0x9b87('0x2d')]){return _0x299096;}else{var _0x9be764=_['cloneDeep'](_0x5811fb);if(_0x5bea0d['additionalSearchLead']){var _0x3857ab={};_0x3857ab[_0x5bea0d[_0x9b87('0x2e')]]=_0x50d490;_[_0x9b87('0x2b')](_0x9be764['$or'],_0x3857ab);}return _0xb766cf[_0x9b87('0x1e')](_0x9b87('0x2f'))[_0x9b87('0x20')](_0x9be764,_0x1b6101);}});case _0x9b87('0x30'):var _0x3259b2=_[_0x9b87('0x29')](_0x5811fb);if(_0x5bea0d[_0x9b87('0x31')]){var _0x550e69={};_0x550e69[_0x5bea0d[_0x9b87('0x31')]]=_0x50d490;_[_0x9b87('0x2b')](_0x3259b2[_0x9b87('0x2c')],_0x550e69);}return _0xb766cf[_0x9b87('0x1e')](_0x9b87('0x32'))[_0x9b87('0x20')](_0x3259b2,_0x1b6101)[_0x9b87('0x21')]()['then'](function(_0x1676e1){if(_0x1676e1&&_0x1676e1[_0x9b87('0x2d')]){return _0x1676e1;}else{var _0x3e5f94=_[_0x9b87('0x29')](_0x5811fb);if(_0x5bea0d[_0x9b87('0x2a')]){var _0x2bb5e4={};_0x2bb5e4[_0x5bea0d[_0x9b87('0x2a')]]=_0x50d490;_[_0x9b87('0x2b')](_0x3e5f94['$or'],_0x2bb5e4);}return _0xb766cf[_0x9b87('0x1e')](_0x9b87('0x33'))['find'](_0x3e5f94,_0x1b6101)[_0x9b87('0x22')](function(_0x5b66e5){if(_0x5b66e5&&_0x5b66e5[_0x9b87('0x2d')]){return _0x5b66e5;}else{var _0x160dd0=_[_0x9b87('0x29')](_0x5811fb);if(_0x5bea0d[_0x9b87('0x2e')]){var _0x4c0511={};_0x4c0511[_0x5bea0d[_0x9b87('0x2e')]]=_0x50d490;_['merge'](_0x160dd0['$or'],_0x4c0511);}return _0xb766cf[_0x9b87('0x1e')](_0x9b87('0x2f'))['find'](_0x160dd0,_0x1b6101);}});}});case _0x9b87('0x18'):var _0x44d592=_[_0x9b87('0x29')](_0x5811fb);if(_0x5bea0d['additionalSearchContact']){var _0x550e69={};_0x550e69[_0x5bea0d[_0x9b87('0x2a')]]=_0x50d490;_[_0x9b87('0x2b')](_0x44d592['$or'],_0x550e69);}return _0xb766cf[_0x9b87('0x1e')]('Contact')['find'](_0x44d592,_0x1b6101)[_0x9b87('0x21')]();case _0x9b87('0x14'):var _0x402bda=_[_0x9b87('0x29')](_0x5811fb);if(_0x5bea0d[_0x9b87('0x2e')]){var _0x550e69={};_0x550e69[_0x5bea0d[_0x9b87('0x2e')]]=_0x50d490;_[_0x9b87('0x2b')](_0x402bda['$or'],_0x550e69);}return _0xb766cf[_0x9b87('0x1e')](_0x9b87('0x2f'))[_0x9b87('0x20')](_0x402bda,_0x1b6101);case _0x9b87('0x15'):var _0x3259b2=_['cloneDeep'](_0x5811fb);if(_0x5bea0d[_0x9b87('0x31')]){var _0x550e69={};_0x550e69[_0x5bea0d[_0x9b87('0x31')]]=_0x50d490;_['merge'](_0x3259b2[_0x9b87('0x2c')],_0x550e69);}return _0xb766cf['sobject'](_0x9b87('0x32'))['find'](_0x3259b2,_0x1b6101);default:return null;}})['then'](function(_0x17b594){if(_0x17b594&&_0x17b594[_0x9b87('0x2d')]){var _0x126d45=_[_0x9b87('0x34')](_0x17b594);if(_0x126d45){return BPromise[_0x9b87('0x24')]({'id':_0x126d45['Id'],'name':_0x126d45[_0x9b87('0x35')],'phone':_0x126d45[_0x9b87('0x36')],'endUserType':_0x126d45[_0x9b87('0x37')][_0x9b87('0x38')][_0x9b87('0x39')]()});}}})[_0x9b87('0x22')](function(_0x5ad700){if(_0x5ad700){logger['info'](_0x9b87('0x3a'),_0x5ad700['endUserType'],_0x50d490);return BPromise[_0x9b87('0x24')](_0x5ad700);}else{logger[_0x9b87('0x1a')](_0x9b87('0x3b'),_0x50d490);var _0x5c799a={'Phone':_0x50d490};if(_0x5bea0d['moduleCreate']){if(_0x5bea0d[_0x9b87('0x3c')]===_0x9b87('0x18')){logger[_0x9b87('0x1a')](_0x9b87('0x3d'),_0x50d490,_0x5bea0d[_0x9b87('0x3c')]);_0x5c799a[_0x9b87('0x3e')]=_0x4b1e34!==_0x9b87('0x3f')?_0x4b1e34:util[_0x9b87('0x40')](_0x9b87('0x41'),_0x50d490);}else if(_0x5bea0d['moduleCreate']===_0x9b87('0x14')){logger[_0x9b87('0x1a')](_0x9b87('0x3d'),_0x50d490,_0x5bea0d[_0x9b87('0x3c')]);_0x5c799a[_0x9b87('0x3e')]=_0x4b1e34!==_0x9b87('0x3f')?_0x4b1e34:util['format']('Caller\x20-\x20%s',_0x50d490);_0x5c799a['Company']=_0x9b87('0x42');}else if(_0x5bea0d[_0x9b87('0x3c')]===_0x9b87('0x15')){logger[_0x9b87('0x1a')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x50d490,_0x5bea0d[_0x9b87('0x3c')]);_0x5c799a[_0x9b87('0x35')]=_0x4b1e34!==_0x9b87('0x3f')?_0x4b1e34:util[_0x9b87('0x40')](_0x9b87('0x41'),_0x50d490);}else{return null;}}return _0xb766cf[_0x9b87('0x1e')](_[_0x9b87('0x43')](_0x5bea0d[_0x9b87('0x3c')]))[_0x9b87('0x1b')](_0x5c799a)['then'](function(_0x170e1f){return BPromise[_0x9b87('0x24')]({'id':_0x170e1f['id'],'endUserType':_0x5bea0d[_0x9b87('0x3c')]});});}});}function getCustomFields(_0x586fdd,_0x2ac281){var _0x343ae5={};if(_0x586fdd[_0x9b87('0x2d')]>0x0){_[_0x9b87('0x44')](_0x586fdd,function(_0x2ee83f){if(_[_0x9b87('0x45')]([_0x9b87('0x46'),_0x9b87('0x47')],_0x2ee83f[_0x9b87('0x38')])&&_0x2ee83f['idField']){_0x343ae5[_0x2ee83f[_0x9b87('0x48')]]=_0x2ee83f[_0x9b87('0x49')]['toString']();}else if(_0x2ee83f['type']===_0x9b87('0x4a')&&_0x2ee83f['variableName']&&_0x2ee83f[_0x9b87('0x48')]){_0x2ac281[_0x2ee83f[_0x9b87('0x4b')]]&&(_0x343ae5[_0x2ee83f[_0x9b87('0x48')]]=_0x2ac281[_0x2ee83f[_0x9b87('0x4b')]][_0x9b87('0x4c')]());}else if(_0x2ee83f[_0x9b87('0x38')]===_0x9b87('0x4d')&&_0x2ee83f[_0x9b87('0x4e')]&&_0x2ee83f['Variable']['name']&&_0x2ee83f[_0x9b87('0x48')]){_0x2ac281[_0x2ee83f[_0x9b87('0x4e')]['name'][_0x9b87('0x39')]()]&&(_0x343ae5[_0x2ee83f[_0x9b87('0x48')]]=_0x2ac281[_0x2ee83f[_0x9b87('0x4e')]['name'][_0x9b87('0x39')]()][_0x9b87('0x4c')]());}});}return _0x343ae5;}function getConnection(_0xb3ef7d){var _0x327981=_0xb3ef7d[_0x9b87('0x4f')]['concat'](_0xb3ef7d[_0x9b87('0x50')]);var _0x46e8ef=new jsforce[(_0x9b87('0x51'))]({'oauth2':{'loginUrl':_0xb3ef7d['remoteUri']||_0x9b87('0x52'),'clientId':_0xb3ef7d['clientId'],'clientSecret':_0xb3ef7d[_0x9b87('0x53')]}});return _0x46e8ef['login'](_0xb3ef7d['username'],_0x327981)[_0x9b87('0x22')](function(){logger[_0x9b87('0x1a')](_0x9b87('0x54'));return _0x46e8ef;});}exports[_0x9b87('0x55')]=function(_0x1b2b5c,_0x3326c5,_0x432957,_0x5195c7,_0x42f0b0,_0x4d1726){var _0x5243b3,_0x156c3e,_0x4ee825,_0x459ca5;_0x4d1726[_0x9b87('0x56')]=intUtil[_0x9b87('0x57')](_0x4d1726['serverUrl']);_0x4d1726[_0x9b87('0x58')]=intUtil[_0x9b87('0x57')](_0x4d1726[_0x9b87('0x58')]);if(_0x42f0b0&&_0x42f0b0[_0x9b87('0x59')]){logger[_0x9b87('0x1a')](_0x9b87('0x5a'),_0x9b87('0x5b'));_0x3326c5[_0x9b87('0x5c')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4d1726[_0x9b87('0x56')],_0x3326c5[_0x9b87('0x5d')],md5(_0x3326c5[_0x9b87('0x5d')]));}else{_0x3326c5['recordingURL']='';}return getConnection(_0x4d1726)[_0x9b87('0x22')](function(_0xca9377){_0x459ca5=_0xca9377;return getUser(_0x4d1726,_0x5195c7[_0x9b87('0x5e')],_0x459ca5);})[_0x9b87('0x22')](function(_0x355f89){_0x5243b3=_0x355f89;return getEndUser(_0x4d1726,_0x432957,_0x3326c5[_0x9b87('0x5f')],_0x3326c5[_0x9b87('0x60')],_0x459ca5);})[_0x9b87('0x22')](function(_0x31eba6){_0x156c3e=_0x31eba6;return getTicket(_0x4d1726,_0x5243b3,_0x156c3e,_0x432957,_0x3326c5,_0x432957['Fields'],_0x459ca5,_0x9b87('0x55'));})['then'](function(_0x30e13d){_0x4ee825=_0x30e13d;logger['info'](_0x9b87('0x61'),_0x4ee825['id']);logger[_0x9b87('0x1a')](_0x9b87('0x62'),_0x4ee825['id'],_0x5195c7[_0x9b87('0x63')],_0x4d1726['type']);switch(_0x4d1726[_0x9b87('0x38')]){case _0x9b87('0x64'):emit(util['format']('user:%s',_0x5195c7[_0x9b87('0x63')]),'trigger:salesforce:display',{'recordId':_0x4ee825['id']});break;case _0x9b87('0x65'):emit(util['format'](_0x9b87('0x66'),_0x5195c7[_0x9b87('0x63')]),_0x9b87('0x67'),{'uri':util['format']('%s/%s/e',_0x459ca5[_0x9b87('0x68')],_0x4ee825['id'])});break;default:logger[_0x9b87('0x69')](_0x9b87('0x6a'));}})['catch'](function(_0x5104a8){logger['error']('[QUEUE]',_0x5104a8);});};exports[_0x9b87('0x6b')]=function(_0x1c3878,_0x4ba091,_0x26bae5,_0x44eae7,_0x2be918,_0x61666,_0x5ab20c){var _0x548abc,_0x59187c,_0x55dbf2,_0xaee312;_0x61666[_0x9b87('0x56')]=intUtil[_0x9b87('0x57')](_0x61666['serverUrl']);_0x61666['remoteUri']=intUtil[_0x9b87('0x57')](_0x61666[_0x9b87('0x58')]);if(_0x5ab20c&&_0x5ab20c[_0x9b87('0x6c')]&&_0x5ab20c['recordingFormat']!==_0x9b87('0x6d')){logger['info']('[OUTBOUND]',_0x9b87('0x5b'));_0x4ba091[_0x9b87('0x5c')]=util[_0x9b87('0x40')](_0x9b87('0x6e'),_0x61666[_0x9b87('0x56')],_0x4ba091[_0x9b87('0x5d')],md5(_0x4ba091[_0x9b87('0x5d')]));}return getConnection(_0x61666)[_0x9b87('0x22')](function(_0x379acc){_0xaee312=_0x379acc;return getUser(_0x61666,_0x44eae7[_0x9b87('0x5e')],_0xaee312);})[_0x9b87('0x22')](function(_0x5f3037){_0x548abc=_0x5f3037;return getEndUser(_0x61666,_0x26bae5,_0x4ba091[_0x9b87('0x6f')],_0x4ba091['destcalleridnum'],_0xaee312);})[_0x9b87('0x22')](function(_0x44a13a){_0x59187c=_0x44a13a;return getTicket(_0x61666,_0x548abc,_0x59187c,_0x26bae5,_0x4ba091,_0x26bae5[_0x9b87('0x70')],_0xaee312,_0x9b87('0x6b'));})[_0x9b87('0x22')](function(_0x2da21c){_0x55dbf2=_0x2da21c;logger[_0x9b87('0x1a')](_0x9b87('0x71'),_0x55dbf2['id']);logger[_0x9b87('0x1a')](_0x9b87('0x72'),_0x55dbf2['id'],_0x44eae7['name'],_0x61666[_0x9b87('0x38')]);switch(_0x61666[_0x9b87('0x38')]){case'integrationTab':emit(util[_0x9b87('0x40')](_0x9b87('0x66'),_0x44eae7[_0x9b87('0x63')]),_0x9b87('0x73'),{'recordId':_0x55dbf2['id']});break;case _0x9b87('0x65'):emit(util[_0x9b87('0x40')]('user:%s',_0x44eae7['name']),_0x9b87('0x67'),{'uri':util[_0x9b87('0x40')]('%s/%s/e',_0xaee312[_0x9b87('0x68')],_0x55dbf2['id'])});break;default:logger[_0x9b87('0x69')](_0x9b87('0x74'),_0x9b87('0x75'));}})['catch'](function(_0x11bf7f){logger['error']('[OUTBOUND]',_0x11bf7f);});};exports[_0x9b87('0x76')]=function(_0x50ea6a,_0xafbf5d,_0x144570,_0x3aa3d1,_0x3752aa,_0x24a856){var _0x172675,_0x4bf38b,_0x5bfa98,_0x3c24ac;_0x24a856[_0x9b87('0x56')]=intUtil['stripTrailingSlash'](_0x24a856[_0x9b87('0x56')]);_0x24a856[_0x9b87('0x58')]=intUtil[_0x9b87('0x57')](_0x24a856[_0x9b87('0x58')]);if(_0x3752aa&&_0x3752aa[_0x9b87('0x59')]){logger[_0x9b87('0x1a')]('['+_0xafbf5d[_0x9b87('0x77')][_0x9b87('0x78')]()+']',_0x9b87('0x5b'));_0xafbf5d['recordingURL']=util[_0x9b87('0x40')](_0x9b87('0x6e'),_0x24a856['serverUrl'],_0xafbf5d[_0x9b87('0x5d')],md5(_0xafbf5d[_0x9b87('0x5d')]));}else{_0xafbf5d[_0x9b87('0x5c')]='';}return getConnection(_0x24a856)[_0x9b87('0x22')](function(_0x2482da){_0x3c24ac=_0x2482da;if(!_[_0x9b87('0x1c')](_0x3aa3d1)){return getUser(_0x24a856,_0x3aa3d1[_0x9b87('0x63')],_0x3c24ac);}else{return getUser(_0x24a856,null,_0x3c24ac);}})['then'](function(_0xf8b6d4){_0x172675=_0xf8b6d4;return getEndUser(_0x24a856,_0x144570,_0xafbf5d['calleridname'],_0xafbf5d[_0x9b87('0x60')],_0x3c24ac);})[_0x9b87('0x22')](function(_0x43c8db){_0x4bf38b=_0x43c8db;return getTicket(_0x24a856,_0x172675,_0x4bf38b,_0x144570,_0xafbf5d,_0x144570[_0x9b87('0x70')],_0x3c24ac);})[_0x9b87('0x22')](function(_0xd3fcce){_0x5bfa98=_0xd3fcce;logger[_0x9b87('0x1a')]('['+_0xafbf5d[_0x9b87('0x77')][_0x9b87('0x78')]()+_0x9b87('0x79'),_0x5bfa98['id']);logger[_0x9b87('0x1a')]('['+_0xafbf5d[_0x9b87('0x77')][_0x9b87('0x78')]()+_0x9b87('0x7a'),_0x24a856[_0x9b87('0x38')]);})['catch'](function(_0x2e3969){logger[_0x9b87('0x69')]('['+_0xafbf5d[_0x9b87('0x77')]['toUpperCase']()+']',_0x2e3969);});}; \ No newline at end of file +var _0xfca7=['Phone','attributes','type','toLowerCase','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','format','Caller\x20-\x20%s','Company','No\x20Company','upperFirst','forEach','includes','string','picklist','idField','content','toString','variable','variableName','customVariable','Variable','name','concat','securityToken','Connection','remoteUri','clientId','clientSecret','login','Connection\x20established.','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:salesforce:display','newTab','user:%s','%s/%s/e','instanceUrl','error','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','outbound','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:browser:url','catch','unmanaged','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','bluebird','md5','util','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','assign','Subjects','getString','Descriptions','ticketType','Task','ActivityDate','IsReminderSet','IsRecurrence','endUserType','contact','lead','WhatId','Case','ContactId','AccountId','leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','User','find','execute','length','Email','resolve','Name','info','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','user_id','identity','then','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','additionalSearchContact','$or','cloneDeep','additionalSearchLead','merge','Lead','additionalSearchAccount','Account','account','first'];(function(_0x515bea,_0x4a59ef){var _0x8e643b=function(_0x5768d1){while(--_0x5768d1){_0x515bea['push'](_0x515bea['shift']());}};_0x8e643b(++_0x4a59ef);}(_0xfca7,0x1cf));var _0x7fca=function(_0xd6f94,_0x57f718){_0xd6f94=_0xd6f94-0x0;var _0x1c4901=_0xfca7[_0xd6f94];return _0x1c4901;};'use strict';var _=require(_0x7fca('0x0'));var rp=require(_0x7fca('0x1'));var moment=require('moment');var BPromise=require(_0x7fca('0x2'));var md5=require(_0x7fca('0x3'));var jsforce=require('jsforce');var util=require(_0x7fca('0x4'));var Redis=require('ioredis');var intUtil=require(_0x7fca('0x5'));var config=require(_0x7fca('0x6'));var logger=require(_0x7fca('0x7'))(_0x7fca('0x8'));config[_0x7fca('0x9')]=_[_0x7fca('0xa')](config[_0x7fca('0x9')],{'host':_0x7fca('0xb'),'port':0x18eb});var io=require(_0x7fca('0xc'))(new Redis(config[_0x7fca('0x9')]));function emit(_0x2d16c7,_0x44c148,_0xdec208){io['to'](_0x2d16c7)['emit'](_0x44c148,_0xdec208);}function getTicket(_0x30cf03,_0xf63c69,_0x5662ab,_0x44c68b,_0x5750ae,_0x11695b,_0x226b60,_0x388619){var _0x316a87=Object[_0x7fca('0xd')]({},{'OwnerId':_0xf63c69['id'],'Subject':intUtil['getString'](_0x44c68b[_0x7fca('0xe')],_0x5750ae,'\x20'),'Description':intUtil[_0x7fca('0xf')](_0x44c68b[_0x7fca('0x10')],_0x5750ae,'\x0a')},getCustomFields(_0x11695b,_0x5750ae));if(_0x5662ab){if(_0x44c68b[_0x7fca('0x11')]===_0x7fca('0x12')){_0x316a87[_0x7fca('0x13')]=moment['utc']();_0x316a87[_0x7fca('0x14')]=![];_0x316a87[_0x7fca('0x15')]=![];if(_0x5662ab[_0x7fca('0x16')]===_0x7fca('0x17')||_0x5662ab[_0x7fca('0x16')]===_0x7fca('0x18')){_0x316a87['WhoId']=_0x5662ab['id'];}else if(_0x5662ab[_0x7fca('0x16')]==='account'){_0x316a87[_0x7fca('0x19')]=_0x5662ab['id'];}}else if(_0x44c68b['ticketType']===_0x7fca('0x1a')){if(_0x5662ab[_0x7fca('0x16')]==='contact'){_0x316a87[_0x7fca('0x1b')]=_0x5662ab['id'];}else if(_0x5662ab[_0x7fca('0x16')]==='account'){_0x316a87[_0x7fca('0x1c')]=_0x5662ab['id'];}else if(_0x5662ab[_0x7fca('0x16')]===_0x7fca('0x18')&&_0x44c68b[_0x7fca('0x1d')]){_0x316a87[_0x44c68b['leadId']]=_0x5662ab['id'];}else{logger['info'](_0x7fca('0x1e'));}}}return _0x226b60[_0x7fca('0x1f')](_0x44c68b['ticketType'])[_0x7fca('0x20')](_0x316a87);}function getUser(_0x771a32,_0x29361c,_0x1abf3a){if(!_[_0x7fca('0x21')](_0x29361c)&&intUtil[_0x7fca('0x22')](_0x29361c)){var _0x14b7ba={'Email':_0x29361c};var _0x7aa211={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x1abf3a[_0x7fca('0x1f')](_0x7fca('0x23'))[_0x7fca('0x24')](_0x14b7ba,_0x7aa211)[_0x7fca('0x25')]()['then'](function(_0x40ed3e){if(_0x40ed3e[_0x7fca('0x26')]){var _0x37c2ec=_['find'](_0x40ed3e,function(_0x325f44){return _0x325f44[_0x7fca('0x27')]===_0x29361c;});if(_0x37c2ec){logger['info']('Agent\x20%s\x20found.',_0x29361c);return BPromise[_0x7fca('0x28')]({'id':_0x37c2ec['Id'],'name':_0x37c2ec[_0x7fca('0x29')]});}}else{logger[_0x7fca('0x2a')](_0x7fca('0x2b'),_0x29361c);return _0x1abf3a['identity']()['then'](function(_0x4c43dc){return BPromise[_0x7fca('0x28')]({'id':_0x4c43dc[_0x7fca('0x2c')],'name':_0x4c43dc['display_name']});});}});}else{logger[_0x7fca('0x2a')](_0x7fca('0x2b'),_0x29361c);return _0x1abf3a[_0x7fca('0x2d')]()[_0x7fca('0x2e')](function(_0xea38db){return BPromise[_0x7fca('0x28')]({'id':_0xea38db[_0x7fca('0x2c')],'name':_0xea38db[_0x7fca('0x2f')]});});}}function getEndUser(_0x5a00e7,_0xf1400,_0x3c4bb0,_0x41f1ee,_0x34d80f){var _0x5be469={'$or':{'Phone':_0x41f1ee}};var _0x2f9d40={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0x7fca('0x2e')](function(){logger[_0x7fca('0x2a')](_0x7fca('0x30'),_0x41f1ee,_0xf1400[_0x7fca('0x31')]);switch(_0xf1400[_0x7fca('0x31')]){case _0x7fca('0x32'):var _0x3d1da6=_['cloneDeep'](_0x5be469);if(_0xf1400['additionalSearchContact']){var _0x5ccd48={};_0x5ccd48[_0xf1400[_0x7fca('0x33')]]=_0x41f1ee;_['merge'](_0x3d1da6[_0x7fca('0x34')],_0x5ccd48);}return _0x34d80f[_0x7fca('0x1f')]('Contact')[_0x7fca('0x24')](_0x3d1da6,_0x2f9d40)[_0x7fca('0x25')]()[_0x7fca('0x2e')](function(_0x59b6b0){if(_0x59b6b0&&_0x59b6b0[_0x7fca('0x26')]){return _0x59b6b0;}else{var _0x395487=_[_0x7fca('0x35')](_0x5be469);if(_0xf1400[_0x7fca('0x36')]){var _0x161d41={};_0x161d41[_0xf1400[_0x7fca('0x36')]]=_0x41f1ee;_[_0x7fca('0x37')](_0x395487['$or'],_0x161d41);}return _0x34d80f[_0x7fca('0x1f')](_0x7fca('0x38'))[_0x7fca('0x24')](_0x395487,_0x2f9d40);}});case'account_contact_lead':var _0x1ab55e=_[_0x7fca('0x35')](_0x5be469);if(_0xf1400[_0x7fca('0x39')]){var _0x5ccd48={};_0x5ccd48[_0xf1400[_0x7fca('0x39')]]=_0x41f1ee;_[_0x7fca('0x37')](_0x1ab55e[_0x7fca('0x34')],_0x5ccd48);}return _0x34d80f[_0x7fca('0x1f')](_0x7fca('0x3a'))[_0x7fca('0x24')](_0x1ab55e,_0x2f9d40)[_0x7fca('0x25')]()['then'](function(_0x4d2cf0){if(_0x4d2cf0&&_0x4d2cf0[_0x7fca('0x26')]){return _0x4d2cf0;}else{var _0x569ef2=_[_0x7fca('0x35')](_0x5be469);if(_0xf1400[_0x7fca('0x33')]){var _0x14b308={};_0x14b308[_0xf1400['additionalSearchContact']]=_0x41f1ee;_[_0x7fca('0x37')](_0x569ef2[_0x7fca('0x34')],_0x14b308);}return _0x34d80f['sobject']('Contact')[_0x7fca('0x24')](_0x569ef2,_0x2f9d40)[_0x7fca('0x2e')](function(_0x33c43d){if(_0x33c43d&&_0x33c43d['length']){return _0x33c43d;}else{var _0x50ab4a=_[_0x7fca('0x35')](_0x5be469);if(_0xf1400[_0x7fca('0x36')]){var _0xa00db5={};_0xa00db5[_0xf1400[_0x7fca('0x36')]]=_0x41f1ee;_[_0x7fca('0x37')](_0x50ab4a[_0x7fca('0x34')],_0xa00db5);}return _0x34d80f['sobject'](_0x7fca('0x38'))[_0x7fca('0x24')](_0x50ab4a,_0x2f9d40);}});}});case'contact':var _0x3d1da6=_['cloneDeep'](_0x5be469);if(_0xf1400[_0x7fca('0x33')]){var _0x5ccd48={};_0x5ccd48[_0xf1400[_0x7fca('0x33')]]=_0x41f1ee;_['merge'](_0x3d1da6[_0x7fca('0x34')],_0x5ccd48);}return _0x34d80f[_0x7fca('0x1f')]('Contact')[_0x7fca('0x24')](_0x3d1da6,_0x2f9d40)[_0x7fca('0x25')]();case _0x7fca('0x18'):var _0xc64b21=_[_0x7fca('0x35')](_0x5be469);if(_0xf1400[_0x7fca('0x36')]){var _0x5ccd48={};_0x5ccd48[_0xf1400['additionalSearchLead']]=_0x41f1ee;_[_0x7fca('0x37')](_0xc64b21[_0x7fca('0x34')],_0x5ccd48);}return _0x34d80f[_0x7fca('0x1f')](_0x7fca('0x38'))[_0x7fca('0x24')](_0xc64b21,_0x2f9d40);case _0x7fca('0x3b'):var _0x1ab55e=_[_0x7fca('0x35')](_0x5be469);if(_0xf1400['additionalSearchAccount']){var _0x5ccd48={};_0x5ccd48[_0xf1400[_0x7fca('0x39')]]=_0x41f1ee;_[_0x7fca('0x37')](_0x1ab55e[_0x7fca('0x34')],_0x5ccd48);}return _0x34d80f[_0x7fca('0x1f')](_0x7fca('0x3a'))[_0x7fca('0x24')](_0x1ab55e,_0x2f9d40);default:return null;}})[_0x7fca('0x2e')](function(_0x53cf06){if(_0x53cf06&&_0x53cf06[_0x7fca('0x26')]){var _0x13ce15=_[_0x7fca('0x3c')](_0x53cf06);if(_0x13ce15){return BPromise[_0x7fca('0x28')]({'id':_0x13ce15['Id'],'name':_0x13ce15['Name'],'phone':_0x13ce15[_0x7fca('0x3d')],'endUserType':_0x13ce15[_0x7fca('0x3e')][_0x7fca('0x3f')][_0x7fca('0x40')]()});}}})[_0x7fca('0x2e')](function(_0x21956b){if(_0x21956b){logger[_0x7fca('0x2a')]('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x21956b[_0x7fca('0x16')],_0x41f1ee);return BPromise['resolve'](_0x21956b);}else{logger[_0x7fca('0x2a')](_0x7fca('0x41'),_0x41f1ee);var _0x26b389={'Phone':_0x41f1ee};if(_0xf1400[_0x7fca('0x42')]){if(_0xf1400[_0x7fca('0x42')]===_0x7fca('0x17')){logger[_0x7fca('0x2a')](_0x7fca('0x43'),_0x41f1ee,_0xf1400[_0x7fca('0x42')]);_0x26b389[_0x7fca('0x44')]=_0x3c4bb0!==''?_0x3c4bb0:util[_0x7fca('0x45')](_0x7fca('0x46'),_0x41f1ee);}else if(_0xf1400['moduleCreate']===_0x7fca('0x18')){logger[_0x7fca('0x2a')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x41f1ee,_0xf1400[_0x7fca('0x42')]);_0x26b389['LastName']=_0x3c4bb0!==''?_0x3c4bb0:util[_0x7fca('0x45')](_0x7fca('0x46'),_0x41f1ee);_0x26b389[_0x7fca('0x47')]=_0x7fca('0x48');}else if(_0xf1400['moduleCreate']===_0x7fca('0x3b')){logger[_0x7fca('0x2a')](_0x7fca('0x43'),_0x41f1ee,_0xf1400[_0x7fca('0x42')]);_0x26b389['Name']=_0x3c4bb0!==''?_0x3c4bb0:util[_0x7fca('0x45')]('Caller\x20-\x20%s',_0x41f1ee);}else{return null;}}return _0x34d80f['sobject'](_[_0x7fca('0x49')](_0xf1400['moduleCreate']))[_0x7fca('0x20')](_0x26b389)[_0x7fca('0x2e')](function(_0x21f203){return BPromise[_0x7fca('0x28')]({'id':_0x21f203['id'],'endUserType':_0xf1400[_0x7fca('0x42')]});});}});}function getCustomFields(_0x364621,_0xc2e2c4){var _0x327b93={};if(_0x364621[_0x7fca('0x26')]>0x0){_[_0x7fca('0x4a')](_0x364621,function(_0x5f43a6){if(_[_0x7fca('0x4b')]([_0x7fca('0x4c'),_0x7fca('0x4d')],_0x5f43a6[_0x7fca('0x3f')])&&_0x5f43a6[_0x7fca('0x4e')]){_0x327b93[_0x5f43a6['idField']]=_0x5f43a6[_0x7fca('0x4f')][_0x7fca('0x50')]();}else if(_0x5f43a6[_0x7fca('0x3f')]===_0x7fca('0x51')&&_0x5f43a6[_0x7fca('0x52')]&&_0x5f43a6[_0x7fca('0x4e')]){_0xc2e2c4[_0x5f43a6[_0x7fca('0x52')]]&&(_0x327b93[_0x5f43a6[_0x7fca('0x4e')]]=_0xc2e2c4[_0x5f43a6['variableName']]['toString']());}else if(_0x5f43a6[_0x7fca('0x3f')]===_0x7fca('0x53')&&_0x5f43a6[_0x7fca('0x54')]&&_0x5f43a6[_0x7fca('0x54')]['name']&&_0x5f43a6[_0x7fca('0x4e')]){_0xc2e2c4[_0x5f43a6[_0x7fca('0x54')][_0x7fca('0x55')][_0x7fca('0x40')]()]&&(_0x327b93[_0x5f43a6[_0x7fca('0x4e')]]=_0xc2e2c4[_0x5f43a6[_0x7fca('0x54')][_0x7fca('0x55')][_0x7fca('0x40')]()][_0x7fca('0x50')]());}});}return _0x327b93;}function getConnection(_0x511a40){var _0x31899f=_0x511a40['password'][_0x7fca('0x56')](_0x511a40[_0x7fca('0x57')]);var _0x82edc3=new jsforce[(_0x7fca('0x58'))]({'oauth2':{'loginUrl':_0x511a40[_0x7fca('0x59')]||'https://login.salesforce.com','clientId':_0x511a40[_0x7fca('0x5a')],'clientSecret':_0x511a40[_0x7fca('0x5b')]}});return _0x82edc3[_0x7fca('0x5c')](_0x511a40['username'],_0x31899f)[_0x7fca('0x2e')](function(){logger[_0x7fca('0x2a')](_0x7fca('0x5d'));return _0x82edc3;});}exports[_0x7fca('0x5e')]=function(_0x223381,_0x295d7c,_0xc3cc56,_0x5a8182,_0x2d37e5,_0x4464d1){var _0x32e911,_0x530303,_0x3713d5,_0x43a69a;_0x4464d1['serverUrl']=intUtil[_0x7fca('0x5f')](_0x4464d1[_0x7fca('0x60')]);_0x4464d1[_0x7fca('0x59')]=intUtil[_0x7fca('0x5f')](_0x4464d1[_0x7fca('0x59')]);if(_0x2d37e5&&_0x2d37e5[_0x7fca('0x61')]){logger[_0x7fca('0x2a')](_0x7fca('0x62'),_0x7fca('0x63'));_0x295d7c[_0x7fca('0x64')]=util[_0x7fca('0x45')](_0x7fca('0x65'),_0x4464d1[_0x7fca('0x60')],_0x295d7c[_0x7fca('0x66')],md5(_0x295d7c[_0x7fca('0x66')]));}else{_0x295d7c['recordingURL']='';}return getConnection(_0x4464d1)[_0x7fca('0x2e')](function(_0x3d2cd8){_0x43a69a=_0x3d2cd8;return getUser(_0x4464d1,_0x5a8182[_0x7fca('0x67')],_0x43a69a);})[_0x7fca('0x2e')](function(_0x5ef4b7){_0x32e911=_0x5ef4b7;return getEndUser(_0x4464d1,_0xc3cc56,_0x295d7c[_0x7fca('0x68')],_0x295d7c[_0x7fca('0x69')],_0x43a69a);})[_0x7fca('0x2e')](function(_0x15271b){_0x530303=_0x15271b;return getTicket(_0x4464d1,_0x32e911,_0x530303,_0xc3cc56,_0x295d7c,_0xc3cc56[_0x7fca('0x6a')],_0x43a69a,'queue');})[_0x7fca('0x2e')](function(_0x397650){_0x3713d5=_0x397650;logger[_0x7fca('0x2a')](_0x7fca('0x6b'),_0x3713d5['id']);logger[_0x7fca('0x2a')](_0x7fca('0x6c'),_0x3713d5['id'],_0x5a8182['name'],_0x4464d1[_0x7fca('0x3f')]);switch(_0x4464d1['type']){case'integrationTab':emit(util['format']('user:%s',_0x5a8182[_0x7fca('0x55')]),_0x7fca('0x6d'),{'recordId':_0x3713d5['id']});break;case _0x7fca('0x6e'):emit(util[_0x7fca('0x45')](_0x7fca('0x6f'),_0x5a8182[_0x7fca('0x55')]),'trigger:browser:url',{'uri':util[_0x7fca('0x45')](_0x7fca('0x70'),_0x43a69a[_0x7fca('0x71')],_0x3713d5['id'])});break;default:logger[_0x7fca('0x72')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})['catch'](function(_0x81c4cf){logger[_0x7fca('0x72')](_0x7fca('0x62'),_0x81c4cf);});};exports['outbound']=function(_0x592190,_0x3a2ed1,_0x132e22,_0x22d761,_0x1a140f,_0x303d3d,_0x2f6f6d){var _0x37e291,_0x6eb18e,_0x5ba34d,_0x3be3a4;_0x303d3d['serverUrl']=intUtil[_0x7fca('0x5f')](_0x303d3d[_0x7fca('0x60')]);_0x303d3d[_0x7fca('0x59')]=intUtil[_0x7fca('0x5f')](_0x303d3d[_0x7fca('0x59')]);if(_0x2f6f6d&&_0x2f6f6d[_0x7fca('0x73')]&&_0x2f6f6d[_0x7fca('0x73')]!==_0x7fca('0x74')){logger[_0x7fca('0x2a')](_0x7fca('0x75'),_0x7fca('0x63'));_0x3a2ed1[_0x7fca('0x64')]=util[_0x7fca('0x45')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x303d3d[_0x7fca('0x60')],_0x3a2ed1[_0x7fca('0x66')],md5(_0x3a2ed1[_0x7fca('0x66')]));}return getConnection(_0x303d3d)[_0x7fca('0x2e')](function(_0x3d517e){_0x3be3a4=_0x3d517e;return getUser(_0x303d3d,_0x22d761['email'],_0x3be3a4);})[_0x7fca('0x2e')](function(_0x386a54){_0x37e291=_0x386a54;return getEndUser(_0x303d3d,_0x132e22,_0x3a2ed1[_0x7fca('0x76')],_0x3a2ed1[_0x7fca('0x77')],_0x3be3a4);})['then'](function(_0x488db8){_0x6eb18e=_0x488db8;return getTicket(_0x303d3d,_0x37e291,_0x6eb18e,_0x132e22,_0x3a2ed1,_0x132e22['Fields'],_0x3be3a4,_0x7fca('0x78'));})['then'](function(_0x4e21ab){_0x5ba34d=_0x4e21ab;logger['info'](_0x7fca('0x79'),_0x5ba34d['id']);logger[_0x7fca('0x2a')](_0x7fca('0x7a'),_0x5ba34d['id'],_0x22d761[_0x7fca('0x55')],_0x303d3d[_0x7fca('0x3f')]);switch(_0x303d3d[_0x7fca('0x3f')]){case _0x7fca('0x7b'):emit(util[_0x7fca('0x45')]('user:%s',_0x22d761['name']),_0x7fca('0x6d'),{'recordId':_0x5ba34d['id']});break;case _0x7fca('0x6e'):emit(util[_0x7fca('0x45')](_0x7fca('0x6f'),_0x22d761['name']),_0x7fca('0x7c'),{'uri':util[_0x7fca('0x45')](_0x7fca('0x70'),_0x3be3a4[_0x7fca('0x71')],_0x5ba34d['id'])});break;default:logger[_0x7fca('0x72')](_0x7fca('0x75'),'Salesforce\x20account\x20type\x20not\x20recognized');}})[_0x7fca('0x7d')](function(_0x523d57){logger[_0x7fca('0x72')](_0x7fca('0x75'),_0x523d57);});};exports[_0x7fca('0x7e')]=function(_0x432615,_0xed4fc5,_0x1d724e,_0x504751,_0x3ef3bf,_0xe14508){var _0x57df37,_0x1e6877,_0x11a40d,_0x4185de;_0xe14508[_0x7fca('0x60')]=intUtil['stripTrailingSlash'](_0xe14508[_0x7fca('0x60')]);_0xe14508['remoteUri']=intUtil['stripTrailingSlash'](_0xe14508[_0x7fca('0x59')]);if(_0x3ef3bf&&_0x3ef3bf[_0x7fca('0x61')]){logger['info']('['+_0xed4fc5[_0x7fca('0x7f')][_0x7fca('0x80')]()+']',_0x7fca('0x63'));_0xed4fc5[_0x7fca('0x64')]=util[_0x7fca('0x45')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xe14508[_0x7fca('0x60')],_0xed4fc5[_0x7fca('0x66')],md5(_0xed4fc5[_0x7fca('0x66')]));}else{_0xed4fc5[_0x7fca('0x64')]='';}return getConnection(_0xe14508)[_0x7fca('0x2e')](function(_0x2d6d32){_0x4185de=_0x2d6d32;if(!_[_0x7fca('0x21')](_0x504751)){return getUser(_0xe14508,_0x504751[_0x7fca('0x55')],_0x4185de);}else{return getUser(_0xe14508,null,_0x4185de);}})[_0x7fca('0x2e')](function(_0xfa6184){_0x57df37=_0xfa6184;return getEndUser(_0xe14508,_0x1d724e,_0xed4fc5[_0x7fca('0x68')],_0xed4fc5[_0x7fca('0x69')],_0x4185de);})[_0x7fca('0x2e')](function(_0x22ed68){_0x1e6877=_0x22ed68;return getTicket(_0xe14508,_0x57df37,_0x1e6877,_0x1d724e,_0xed4fc5,_0x1d724e[_0x7fca('0x6a')],_0x4185de);})[_0x7fca('0x2e')](function(_0x4c48e5){_0x11a40d=_0x4c48e5;logger[_0x7fca('0x2a')]('['+_0xed4fc5[_0x7fca('0x7f')][_0x7fca('0x80')]()+_0x7fca('0x81'),_0x11a40d['id']);logger[_0x7fca('0x2a')]('['+_0xed4fc5[_0x7fca('0x7f')][_0x7fca('0x80')]()+_0x7fca('0x82'),_0xe14508[_0x7fca('0x3f')]);})[_0x7fca('0x7d')](function(_0x43a4e3){logger['error']('['+_0xed4fc5[_0x7fca('0x7f')][_0x7fca('0x80')]()+']',_0x43a4e3);});}; \ 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 7bf7f92..18e8f62 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 _0x8311=['Incident\x20-\x20','ticketNumber','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','push','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','email','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','none','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','bluebird','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','result','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','true','userId','adminEmail',']\x20using\x20admin\x20profile','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','length','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','type','customField','nameField','toLowerCase','content','toString','includes','idField','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','endUserId','POST','incident','assign','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','number',']\x20getTicket\x20crm','label','label_entry'];(function(_0x46ad9e,_0x138238){var _0x2e05eb=function(_0x4dc108){while(--_0x4dc108){_0x46ad9e['push'](_0x46ad9e['shift']());}};_0x2e05eb(++_0x138238);}(_0x8311,0x169));var _0x1831=function(_0x43644b,_0xeee395){_0x43644b=_0x43644b-0x0;var _0x46627c=_0x8311[_0x43644b];return _0x46627c;};'use strict';var _=require('lodash');var Promise=require(_0x1831('0x0'));var rp=require('request-promise');var util=require(_0x1831('0x1'));var md5=require(_0x1831('0x2'));var Redis=require(_0x1831('0x3'));var intUtil=require(_0x1831('0x4'));var config=require(_0x1831('0x5'));var logger=require(_0x1831('0x6'))(_0x1831('0x7'));config[_0x1831('0x8')]=_[_0x1831('0x9')](config[_0x1831('0x8')],{'host':_0x1831('0xa'),'port':0x18eb});var io=require(_0x1831('0xb'))(new Redis(config['redis']));function getAdminUser(_0x410648,_0x2497e1,_0x5cb345,_0x421d10,_0x109696,_0x46bfbf){return new Promise(function(_0x46dce3,_0x31b722){var _0x34cf52={'method':_0x1831('0xc'),'uri':_0x421d10+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x109696+'&'+_0x46bfbf,'auth':_0x2497e1,'json':!![]};return rp(_0x34cf52)['then'](function(_0x5abc0f){if(_0x5abc0f[_0x1831('0xd')]['length']>0x0){_0x5cb345[_0x1831('0xe')]=_0x5abc0f[_0x1831('0xd')][0x0][_0x1831('0xf')];}logger[_0x1831('0x10')]('['+[_0x410648[_0x1831('0x11')]()]+_0x1831('0x12'),_0x5cb345);_0x46dce3(_0x5cb345);})[_0x1831('0x13')](function(_0x2860fe){logger[_0x1831('0x14')]('['+[_0x410648[_0x1831('0x11')]()]+']',_0x2860fe[_0x1831('0x15')]);_0x31b722(_0x2860fe[_0x1831('0x15')]);});});}function getUser(_0x463668,_0x5b95ac,_0x3d35d6,_0x46027d,_0x4aa73e){return function(_0x583091){logger[_0x1831('0x10')]('['+[_0x463668[_0x1831('0x11')]()]+_0x1831('0x16'),_0x583091);return new Promise(function(_0x56dde2,_0x111026){if(intUtil[_0x1831('0x17')](_0x583091[_0x1831('0x18')])){var _0xea5a73={'method':_0x1831('0xc'),'uri':_0x3d35d6+_0x1831('0x19')+_0x583091['userEmail']+'&'+_0x46027d+'&'+_0x4aa73e,'auth':_0x5b95ac,'json':!![]};logger[_0x1831('0x10')]('['+[_0x463668[_0x1831('0x11')]()]+_0x1831('0x1a'),_0xea5a73);return rp(_0xea5a73)[_0x1831('0x1b')](function(_0x3e18bf){logger[_0x1831('0x10')]('['+[_0x463668[_0x1831('0x11')]()]+'],\x20getUser\x20entity',_0x3e18bf);if(_0x3e18bf[_0x1831('0xd')]['length']>0x0&&String(_0x3e18bf[_0x1831('0xd')][0x0]['active'])===_0x1831('0x1c')){_0x583091[_0x1831('0x1d')]=_0x3e18bf[_0x1831('0xd')][0x0][_0x1831('0xf')];}else{_0x583091['userId']=_0x583091['adminId'];_0x583091[_0x1831('0x18')]=_0x583091[_0x1831('0x1e')];}logger[_0x1831('0x10')]('['+[_0x463668[_0x1831('0x11')]()]+'],\x20getUser\x20crm',_0x583091);_0x56dde2(_0x583091);})['catch'](function(_0x1c0f16){logger[_0x1831('0x14')]('['+[_0x463668['toUpperCase']()]+']',_0x1c0f16[_0x1831('0x15')]);_0x111026(_0x1c0f16['message']);});}else{logger[_0x1831('0x10')]('['+[_0x463668[_0x1831('0x11')]()]+_0x1831('0x1f'));_0x583091['userId']=_0x583091[_0x1831('0xe')];_0x583091['userEmail']=_0x583091[_0x1831('0x1e')];_0x56dde2(_0x583091);}});};}function createEndUser(_0xa4a993,_0x149f48,_0x58d0a4,_0x280877,_0x4458c8){logger[_0x1831('0x10')]('['+[_0xa4a993[_0x1831('0x11')]()]+'],\x20createEndUser\x20input\x20crm',_0x58d0a4);return new Promise(function(_0x51491d,_0x3b58a3){var _0xdfd579={'method':'POST','uri':_0x280877+_0x1831('0x20')+_0x4458c8,'body':{'user_name':_0x58d0a4[_0x1831('0x21')],'roles':_0x1831('0x22'),'first_name':_0x58d0a4['endUserNumber'],'active':_0x1831('0x1c'),'date_format':_0x1831('0x23'),'phone':_0x58d0a4[_0x1831('0x21')]},'auth':_0x149f48,'json':!![]};return rp(_0xdfd579)[_0x1831('0x1b')](function(_0x296259){logger[_0x1831('0x10')]('['+[_0xa4a993[_0x1831('0x11')]()]+_0x1831('0x24'),_0x296259[_0x1831('0xd')]);_0x58d0a4['endUserId']=_0x296259[_0x1831('0xd')]['sys_id'];_0x51491d(_0x58d0a4);})[_0x1831('0x13')](function(_0x1d4ca1){logger['error']('['+[_0xa4a993[_0x1831('0x11')]()]+']',_0x1d4ca1[_0x1831('0x15')]);_0x3b58a3(_0x1d4ca1[_0x1831('0x15')]);});});}function getEndUser(_0x114443,_0x1ac35a,_0x35784f,_0x2e7eba,_0x398db6){return function(_0x4ac3d2){logger[_0x1831('0x10')]('['+[_0x114443[_0x1831('0x11')]()]+_0x1831('0x25'),_0x4ac3d2);return new Promise(function(_0x77f511,_0x263c88){var _0x4ff5b1={'method':_0x1831('0xc'),'uri':_0x35784f+_0x1831('0x26')+_0x4ac3d2['endUserNumber']+'&'+_0x2e7eba+'&'+_0x398db6,'auth':_0x1ac35a,'json':!![]};return rp(_0x4ff5b1)['then'](function(_0x4ddd67){if(_0x4ddd67['result'][_0x1831('0x27')]>0x0){_0x4ac3d2['endUserId']=_0x4ddd67[_0x1831('0xd')][0x0][_0x1831('0xf')];logger[_0x1831('0x10')]('['+[_0x114443[_0x1831('0x11')]()]+_0x1831('0x28'),_0x4ac3d2);_0x77f511(_0x4ac3d2);}else{return createEndUser(_0x114443,_0x1ac35a,_0x4ac3d2,_0x35784f,_0x2e7eba)[_0x1831('0x1b')](function(_0x55bd78){logger[_0x1831('0x10')]('['+[_0x114443['toUpperCase']()]+_0x1831('0x29'),_0x55bd78);_0x77f511(_0x55bd78);});}})[_0x1831('0x13')](function(_0x137b0e){logger['error']('['+[_0x114443[_0x1831('0x11')]()]+']',_0x137b0e[_0x1831('0x15')]);_0x263c88(_0x137b0e[_0x1831('0x15')]);});});};}function getCustomFields(_0x4da33b,_0x522a86){var _0x4d4e8b={};if(_0x4da33b['length']>0x0){_[_0x1831('0x2a')](_0x4da33b,function(_0x3fe380){if(_['includes'](['string','picklist'],_0x3fe380[_0x1831('0x2b')])&&_0x3fe380['nameField']&&!_0x3fe380[_0x1831('0x2c')]){_0x4d4e8b[_0x3fe380[_0x1831('0x2d')][_0x1831('0x2e')]()]=_0x3fe380[_0x1831('0x2f')][_0x1831('0x30')]();}else if(_[_0x1831('0x31')](['string','picklist'],_0x3fe380[_0x1831('0x2b')])&&_0x3fe380[_0x1831('0x32')]&&_0x3fe380['customField']){_0x4d4e8b[_0x3fe380[_0x1831('0x32')][_0x1831('0x2e')]()]=_0x3fe380['content'][_0x1831('0x30')]();}else if(_0x3fe380[_0x1831('0x2b')]==='variable'&&_0x3fe380['variableName']&&_0x3fe380[_0x1831('0x32')]&&_0x3fe380[_0x1831('0x2c')]){_0x4d4e8b[_0x3fe380[_0x1831('0x32')][_0x1831('0x2e')]()]=_0x522a86[_0x3fe380[_0x1831('0x33')]]['toString']();}else if(_0x3fe380['type']===_0x1831('0x34')&&_0x3fe380[_0x1831('0x35')]&&_0x3fe380['Variable']['name']&&_0x3fe380[_0x1831('0x32')]&&_0x3fe380['customField']){_0x4d4e8b[_0x3fe380[_0x1831('0x32')][_0x1831('0x2e')]()]=_0x522a86[_0x3fe380[_0x1831('0x35')][_0x1831('0x36')][_0x1831('0x2e')]()][_0x1831('0x30')]();}});}return _0x4d4e8b;}function getTicket(_0xcfb06c,_0x532747,_0x3319b2,_0x201660,_0x3b459c,_0x58864d){return function(_0x465bec){logger[_0x1831('0x10')]('['+[_0xcfb06c[_0x1831('0x11')]()]+_0x1831('0x37'),_0x465bec);return new Promise(function(_0x10243d,_0x203829){var _0x2f2afa=_0xcfb06c[_0x1831('0x2e')]()===_0x1831('0x38')?_0x465bec[_0x1831('0x1d')]:_0x465bec[_0x1831('0x39')];var _0x185235={'method':_0x1831('0x3a'),'uri':_0x3319b2+_0x1831('0x3b')+'?'+_0x58864d,'body':Object[_0x1831('0x3c')]({},{'active':_0x1831('0x1c'),'caller_id':_0x2f2afa,'assigned_to':_0x465bec['userId'],'short_description':intUtil[_0x1831('0x3d')](_0x201660[_0x1831('0x3e')],_0x3b459c,'\x20'),'description':intUtil[_0x1831('0x3d')](_0x201660[_0x1831('0x3f')],_0x3b459c,'\x0a')},getCustomFields(_0x201660[_0x1831('0x40')],_0x3b459c)),'auth':_0x532747,'json':!![]};return rp(_0x185235)[_0x1831('0x1b')](function(_0x4f8a2b){logger[_0x1831('0x10')]('['+[_0xcfb06c[_0x1831('0x11')]()]+_0x1831('0x41'),_0x4f8a2b[_0x1831('0xd')]);_0x465bec[_0x1831('0x42')]=_0x4f8a2b[_0x1831('0xd')][_0x1831('0xf')];_0x465bec['ticketNumber']=_0x4f8a2b['result'][_0x1831('0x43')];logger[_0x1831('0x10')]('['+[_0xcfb06c[_0x1831('0x11')]()]+_0x1831('0x44'),_0x465bec);_0x10243d(_0x465bec);})[_0x1831('0x13')](function(_0x278a86){logger[_0x1831('0x14')]('['+[_0xcfb06c[_0x1831('0x11')]()]+']',_0x278a86['message']);_0x203829(_0x278a86[_0x1831('0x15')]);});});};}function createRemoteTag(_0x3f6b46,_0x42a627,_0x48e924,_0x1317b4){return new Promise(function(_0x15f6f8,_0x488cdc){var _0x1e7f83={'method':_0x1831('0x3a'),'uri':_0x48e924+'label'+'?'+_0x1317b4,'body':{'short_description':_0x3f6b46,'global':!![],'active':!![],'name':_0x3f6b46},'auth':_0x42a627,'json':!![]};return rp(_0x1e7f83)[_0x1831('0x1b')](function(_0x2afd1f){var _0x5b8800=_0x2afd1f['result'][_0x1831('0xf')];_0x15f6f8(_0x5b8800);});});}function getRemoteTag(_0x18fa52,_0x1acf77,_0x58c25b,_0x1ca668,_0x587b22){return new Promise(function(_0x375b08,_0x2ad6b1){var _0x38b781={'method':_0x1831('0xc'),'uri':_0x58c25b+_0x1831('0x45')+'?sysparm_query=name%3D'+_0x18fa52+'&'+_0x1ca668,'auth':_0x1acf77,'json':!![]};return rp(_0x38b781)[_0x1831('0x1b')](function(_0x279a10){if(_0x279a10[_0x1831('0xd')][_0x1831('0x27')]>0x0){var _0x2f6706=_0x279a10[_0x1831('0xd')][0x0][_0x1831('0xf')];_0x375b08(_0x2f6706);}else{return createRemoteTag(_0x18fa52,_0x1acf77,_0x58c25b,_0x1ca668)[_0x1831('0x1b')](function(_0x4f267e){_0x375b08(_0x4f267e);});}});});}function assignTagToIncident(_0xa6e7ab,_0x550c71,_0x18c21e,_0xa96305,_0x40ef89){return new Promise(function(_0x59dab5,_0xca712){var _0x406221={'method':_0x1831('0x3a'),'uri':_0x18c21e+_0x1831('0x46')+'?'+_0x40ef89,'body':{'label':_0xa6e7ab,'table':_0x1831('0x3b'),'id_type':'Incident','table_key':_0xa96305[_0x1831('0x42')],'title':_0x1831('0x47')+_0xa96305[_0x1831('0x48')],'id_display':_0xa96305[_0x1831('0x48')]},'auth':_0x550c71,'json':!![]};return rp(_0x406221)[_0x1831('0x1b')](function(_0x22f507){_0x59dab5();})['catch'](function(){_0x59dab5();});});}function manageTags(_0x2c6dd3,_0x5b7657,_0x5e1326,_0x4ad8a4,_0x44f776,_0x71c605,_0x12ee8d){return new Promise(function(_0x563267,_0x270858){var _0x1dc7b1=[];_0x5b7657['forEach'](function(_0x2a1ab8){_0x1dc7b1['push'](getRemoteTag(_0x2a1ab8,_0x5e1326,_0x4ad8a4,_0x71c605,_0x12ee8d));});return Promise[_0x1831('0x49')](_0x1dc7b1)['then'](function(_0x1923b8){if(_0x1923b8[_0x1831('0x27')]){logger['info']('['+[_0x2c6dd3[_0x1831('0x11')]()]+_0x1831('0x4a'),_0x1923b8);var _0x3b209a=[];_0x1923b8[_0x1831('0x2a')](function(_0x70aa05){_0x3b209a[_0x1831('0x4b')](assignTagToIncident(_0x70aa05,_0x5e1326,_0x4ad8a4,_0x44f776,_0x71c605));});return Promise[_0x1831('0x49')](_0x3b209a)[_0x1831('0x1b')](function(){_0x563267();})[_0x1831('0x13')](function(){_0x563267();});}else{_0x563267();}});});}function getTags(_0x20452d,_0x256258,_0x2a1628,_0x269b43,_0x40a24c,_0x408987){return function(_0x40b6ae){return new Promise(function(_0x3d6c9c,_0x295059){var _0x3d0a11=[];var _0x4958da=_0x269b43[_0x1831('0x4c')];if(_0x4958da&&_0x4958da['length']>0x0){_0x3d0a11=_[_0x1831('0x4d')](_0x4958da,_0x1831('0x36'));}if(_0x3d0a11['length']>0x0){return manageTags(_0x20452d,_0x3d0a11,_0x256258,_0x2a1628,_0x40b6ae,_0x40a24c,_0x408987)['then'](function(){_0x3d6c9c(_0x40b6ae);});}else{_0x3d6c9c(_0x40b6ae);}});};}function emit(_0x1864d3,_0x4ae0de,_0x461a97){var _0x4e786f=_0x1831('0x4e')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0x1831('0x4f')+_0x1831('0x50');var _0x2e59c5={'uri':_0x1864d3+_0x1831('0x51')+_0x461a97+_0x4e786f};io['to'](util[_0x1831('0x52')](_0x1831('0x53'),_0x4ae0de))[_0x1831('0x54')]('trigger:browser:url',_0x2e59c5);}exports['cs']=function(_0x2c9f3f,_0x1cd68e,_0x24d121,_0xe987ac,_0x2276e0,_0x71acb0,_0x8ba13e,_0x54f7be){var _0xf0e49a={};var _0x2626dd={'user':_0x71acb0['username'],'pass':_0x71acb0[_0x1831('0x55')]};var _0x21ffcd=_0x1831('0x56');var _0x1284a0=_0x1831('0x57');_0x71acb0[_0x1831('0x58')]=intUtil[_0x1831('0x59')](_0x71acb0['remoteUri']);_0x71acb0['serverUrl']=intUtil['stripTrailingSlash'](_0x71acb0[_0x1831('0x5a')]);var _0x28d25d=util[_0x1831('0x52')]('%s/api/now/table/',_0x71acb0[_0x1831('0x58')]);_0xf0e49a[_0x1831('0x18')]=!_['isNil'](_0xe987ac)?_0xe987ac[_0x1831('0x5b')]:null;_0xf0e49a[_0x1831('0x1e')]=_0x71acb0[_0x1831('0x5b')];_0xf0e49a[_0x1831('0x21')]=_0x54f7be[_0x1831('0x2e')]()===_0x1831('0x38')?_0x1cd68e[_0x1831('0x5c')]:_0x1cd68e[_0x1831('0x5d')];_0xf0e49a[_0x1831('0x5e')]=_0x54f7be===_0x1831('0x5f')||_0x54f7be===_0x1831('0x60')?_0x1831('0x5f'):_0x1831('0x38');var _0x56cd33=util[_0x1831('0x52')](_0x1831('0x61'),_0x71acb0['serverUrl'],_0x1cd68e[_0x1831('0x62')],md5(_0x1cd68e['uniqueid']));if(_0x2276e0&&_0x2276e0[_0x1831('0x63')]){logger[_0x1831('0x10')](_0x1831('0x64'),_0x1831('0x65'));_0x1cd68e[_0x1831('0x66')]=_0x56cd33;}else if(_0x8ba13e&&_0x8ba13e['recordingFormat']&&_0x8ba13e['recordingFormat']!==_0x1831('0x67')){logger[_0x1831('0x10')]('[OUTBOUND]',_0x1831('0x65'));_0x1cd68e[_0x1831('0x66')]=_0x56cd33;}else{_0x1cd68e[_0x1831('0x66')]='';}return getAdminUser(_0x54f7be,_0x2626dd,_0xf0e49a,_0x28d25d,_0x1284a0,_0x21ffcd)['then'](getUser(_0x54f7be,_0x2626dd,_0x28d25d,_0x1284a0,_0x21ffcd))['then'](getEndUser(_0x54f7be,_0x2626dd,_0x28d25d,_0x1284a0,_0x21ffcd))['then'](getTicket(_0x54f7be,_0x2626dd,_0x28d25d,_0x24d121,_0x1cd68e,_0x1284a0))['then'](function(_0x341b44){logger[_0x1831('0x10')](util['format']('The\x20ticket\x20ID\x20is:\x20%s',_0x341b44['ticketId']));logger[_0x1831('0x10')](util[_0x1831('0x52')](_0x1831('0x68'),_0x54f7be));if(_0x54f7be!==_0x1831('0x60')){logger['info']('['+[_0x54f7be['toUpperCase']()]+']',_0x1831('0x69'));emit(_0x71acb0[_0x1831('0x58')],_0xe987ac['name'],_0x341b44[_0x1831('0x42')]);}})[_0x1831('0x13')](function(_0x51fa93){logger['error']('['+[_0x54f7be[_0x1831('0x11')]()]+_0x1831('0x6a'),util[_0x1831('0x6b')](_0x51fa93,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xdb80=['customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','Subjects','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','label_entry','Incident','Incident\x20-\x20','forEach','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','map','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','user:%s','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','format','isNil','email','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','socket.io-emitter','GET','then','result','length','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','error','message','],\x20getUser\x20input\x20crm','validateEmail','],\x20getUser\x20entity','true','userEmail','adminEmail','],\x20getUser\x20crm','catch',']\x20using\x20admin\x20profile','userId','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','System','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','string','picklist','nameField','customField','toLowerCase','content','toString','includes','idField','type','variable','variableName'];(function(_0xdc0e74,_0x4ab035){var _0x222685=function(_0x526e56){while(--_0x526e56){_0xdc0e74['push'](_0xdc0e74['shift']());}};_0x222685(++_0x4ab035);}(_0xdb80,0x1f0));var _0x0db8=function(_0xcee2fd,_0x5b52e5){_0xcee2fd=_0xcee2fd-0x0;var _0x140b80=_0xdb80[_0xcee2fd];return _0x140b80;};'use strict';var _=require(_0x0db8('0x0'));var Promise=require(_0x0db8('0x1'));var rp=require(_0x0db8('0x2'));var util=require(_0x0db8('0x3'));var md5=require(_0x0db8('0x4'));var Redis=require(_0x0db8('0x5'));var intUtil=require(_0x0db8('0x6'));var config=require(_0x0db8('0x7'));var logger=require(_0x0db8('0x8'))('servicenow');config[_0x0db8('0x9')]=_[_0x0db8('0xa')](config[_0x0db8('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x0db8('0xb'))(new Redis(config[_0x0db8('0x9')]));function getAdminUser(_0x1223e6,_0x430df1,_0x7868f0,_0x1e87b9,_0xfd687a,_0x334cb4){return new Promise(function(_0x5f37bd,_0x487a27){var _0x4020cb={'method':_0x0db8('0xc'),'uri':_0x1e87b9+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0xfd687a+'&'+_0x334cb4,'auth':_0x430df1,'json':!![]};return rp(_0x4020cb)[_0x0db8('0xd')](function(_0x159b00){if(_0x159b00[_0x0db8('0xe')][_0x0db8('0xf')]>0x0){_0x7868f0[_0x0db8('0x10')]=_0x159b00[_0x0db8('0xe')][0x0][_0x0db8('0x11')];}logger[_0x0db8('0x12')]('['+[_0x1223e6[_0x0db8('0x13')]()]+_0x0db8('0x14'),_0x7868f0);_0x5f37bd(_0x7868f0);})['catch'](function(_0x4f3221){logger[_0x0db8('0x15')]('['+[_0x1223e6[_0x0db8('0x13')]()]+']',_0x4f3221[_0x0db8('0x16')]);_0x487a27(_0x4f3221[_0x0db8('0x16')]);});});}function getUser(_0x4a2254,_0x4020a5,_0x4de175,_0x4e2845,_0x705f09){return function(_0x27281f){logger[_0x0db8('0x12')]('['+[_0x4a2254[_0x0db8('0x13')]()]+_0x0db8('0x17'),_0x27281f);return new Promise(function(_0x2d8050,_0x9709c){if(intUtil[_0x0db8('0x18')](_0x27281f['userEmail'])){var _0x5387b2={'method':_0x0db8('0xc'),'uri':_0x4de175+'sys_user?sysparm_query=email%3D'+_0x27281f['userEmail']+'&'+_0x4e2845+'&'+_0x705f09,'auth':_0x4020a5,'json':!![]};logger[_0x0db8('0x12')]('['+[_0x4a2254[_0x0db8('0x13')]()]+'],\x20getUser\x20rp\x20obj',_0x5387b2);return rp(_0x5387b2)[_0x0db8('0xd')](function(_0x255b2d){logger['info']('['+[_0x4a2254[_0x0db8('0x13')]()]+_0x0db8('0x19'),_0x255b2d);if(_0x255b2d[_0x0db8('0xe')][_0x0db8('0xf')]>0x0&&String(_0x255b2d['result'][0x0]['active'])===_0x0db8('0x1a')){_0x27281f['userId']=_0x255b2d[_0x0db8('0xe')][0x0][_0x0db8('0x11')];}else{_0x27281f['userId']=_0x27281f[_0x0db8('0x10')];_0x27281f[_0x0db8('0x1b')]=_0x27281f[_0x0db8('0x1c')];}logger[_0x0db8('0x12')]('['+[_0x4a2254[_0x0db8('0x13')]()]+_0x0db8('0x1d'),_0x27281f);_0x2d8050(_0x27281f);})[_0x0db8('0x1e')](function(_0x2b2f94){logger[_0x0db8('0x15')]('['+[_0x4a2254[_0x0db8('0x13')]()]+']',_0x2b2f94[_0x0db8('0x16')]);_0x9709c(_0x2b2f94['message']);});}else{logger[_0x0db8('0x12')]('['+[_0x4a2254[_0x0db8('0x13')]()]+_0x0db8('0x1f'));_0x27281f[_0x0db8('0x20')]=_0x27281f[_0x0db8('0x10')];_0x27281f[_0x0db8('0x1b')]=_0x27281f[_0x0db8('0x1c')];_0x2d8050(_0x27281f);}});};}function createEndUser(_0x38580d,_0x454942,_0x1ff441,_0x5ae021,_0x23797b){logger['info']('['+[_0x38580d[_0x0db8('0x13')]()]+_0x0db8('0x21'),_0x1ff441);return new Promise(function(_0x234f87,_0x229832){var _0x51891b={'method':_0x0db8('0x22'),'uri':_0x5ae021+_0x0db8('0x23')+_0x23797b,'body':{'user_name':_0x1ff441[_0x0db8('0x24')],'roles':_0x0db8('0x25'),'first_name':_0x1ff441[_0x0db8('0x24')],'active':_0x0db8('0x1a'),'date_format':_0x0db8('0x26'),'phone':_0x1ff441[_0x0db8('0x24')]},'auth':_0x454942,'json':!![]};return rp(_0x51891b)[_0x0db8('0xd')](function(_0x3204ff){logger['info']('['+[_0x38580d['toUpperCase']()]+'],\x20EndUser\x20schema',_0x3204ff[_0x0db8('0xe')]);_0x1ff441[_0x0db8('0x27')]=_0x3204ff[_0x0db8('0xe')]['sys_id'];_0x234f87(_0x1ff441);})[_0x0db8('0x1e')](function(_0x580148){logger[_0x0db8('0x15')]('['+[_0x38580d[_0x0db8('0x13')]()]+']',_0x580148[_0x0db8('0x16')]);_0x229832(_0x580148[_0x0db8('0x16')]);});});}function getEndUser(_0x12276e,_0x316e08,_0x3251c4,_0x1442d2,_0x420bea){return function(_0x2ba214){logger[_0x0db8('0x12')]('['+[_0x12276e[_0x0db8('0x13')]()]+_0x0db8('0x28'),_0x2ba214);return new Promise(function(_0x14ebcb,_0x182208){var _0x12a459={'method':_0x0db8('0xc'),'uri':_0x3251c4+_0x0db8('0x29')+_0x2ba214[_0x0db8('0x24')]+'&'+_0x1442d2+'&'+_0x420bea,'auth':_0x316e08,'json':!![]};return rp(_0x12a459)['then'](function(_0x11c389){if(_0x11c389['result']['length']>0x0){_0x2ba214[_0x0db8('0x27')]=_0x11c389[_0x0db8('0xe')][0x0][_0x0db8('0x11')];logger[_0x0db8('0x12')]('['+[_0x12276e['toUpperCase']()]+'],\x20getEndUser\x20crm',_0x2ba214);_0x14ebcb(_0x2ba214);}else{return createEndUser(_0x12276e,_0x316e08,_0x2ba214,_0x3251c4,_0x1442d2)[_0x0db8('0xd')](function(_0xa1671c){logger[_0x0db8('0x12')]('['+[_0x12276e[_0x0db8('0x13')]()]+'],\x20createEndUser\x20crm',_0xa1671c);_0x14ebcb(_0xa1671c);});}})[_0x0db8('0x1e')](function(_0x87b7bc){logger[_0x0db8('0x15')]('['+[_0x12276e['toUpperCase']()]+']',_0x87b7bc[_0x0db8('0x16')]);_0x182208(_0x87b7bc[_0x0db8('0x16')]);});});};}function getCustomFields(_0x60f39b,_0x136f28){var _0x851acf={};if(_0x60f39b['length']>0x0){_['forEach'](_0x60f39b,function(_0x35cd24){if(_['includes']([_0x0db8('0x2a'),_0x0db8('0x2b')],_0x35cd24['type'])&&_0x35cd24[_0x0db8('0x2c')]&&!_0x35cd24[_0x0db8('0x2d')]){_0x851acf[_0x35cd24[_0x0db8('0x2c')][_0x0db8('0x2e')]()]=_0x35cd24[_0x0db8('0x2f')][_0x0db8('0x30')]();}else if(_[_0x0db8('0x31')]([_0x0db8('0x2a'),_0x0db8('0x2b')],_0x35cd24['type'])&&_0x35cd24[_0x0db8('0x32')]&&_0x35cd24[_0x0db8('0x2d')]){_0x851acf[_0x35cd24[_0x0db8('0x32')][_0x0db8('0x2e')]()]=_0x35cd24[_0x0db8('0x2f')][_0x0db8('0x30')]();}else if(_0x35cd24[_0x0db8('0x33')]===_0x0db8('0x34')&&_0x35cd24[_0x0db8('0x35')]&&_0x35cd24[_0x0db8('0x32')]&&_0x35cd24[_0x0db8('0x2d')]){_0x851acf[_0x35cd24[_0x0db8('0x32')]['toLowerCase']()]=_0x136f28[_0x35cd24[_0x0db8('0x35')]]['toString']();}else if(_0x35cd24[_0x0db8('0x33')]===_0x0db8('0x36')&&_0x35cd24[_0x0db8('0x37')]&&_0x35cd24['Variable'][_0x0db8('0x38')]&&_0x35cd24[_0x0db8('0x32')]&&_0x35cd24[_0x0db8('0x2d')]){_0x851acf[_0x35cd24[_0x0db8('0x32')][_0x0db8('0x2e')]()]=_0x136f28[_0x35cd24['Variable']['name']['toLowerCase']()][_0x0db8('0x30')]();}});}return _0x851acf;}function getTicket(_0x2ac515,_0x5b5e62,_0x3f660a,_0x8e49be,_0x235692,_0x961739){return function(_0x316177){logger[_0x0db8('0x12')]('['+[_0x2ac515[_0x0db8('0x13')]()]+_0x0db8('0x39'),_0x316177);return new Promise(function(_0x100bf0,_0x41bacf){var _0x141315=_0x2ac515[_0x0db8('0x2e')]()===_0x0db8('0x3a')?_0x316177['userId']:_0x316177[_0x0db8('0x27')];var _0x687007={'method':_0x0db8('0x22'),'uri':_0x3f660a+_0x0db8('0x3b')+'?'+_0x961739,'body':Object['assign']({},{'active':_0x0db8('0x1a'),'caller_id':_0x141315,'assigned_to':_0x316177[_0x0db8('0x20')],'short_description':intUtil['getString'](_0x8e49be[_0x0db8('0x3c')],_0x235692,'\x20'),'description':intUtil[_0x0db8('0x3d')](_0x8e49be[_0x0db8('0x3e')],_0x235692,'\x0a')},getCustomFields(_0x8e49be[_0x0db8('0x3f')],_0x235692)),'auth':_0x5b5e62,'json':!![]};return rp(_0x687007)[_0x0db8('0xd')](function(_0x5263fb){logger[_0x0db8('0x12')]('['+[_0x2ac515[_0x0db8('0x13')]()]+_0x0db8('0x40'),_0x5263fb[_0x0db8('0xe')]);_0x316177[_0x0db8('0x41')]=_0x5263fb[_0x0db8('0xe')][_0x0db8('0x11')];_0x316177[_0x0db8('0x42')]=_0x5263fb[_0x0db8('0xe')][_0x0db8('0x43')];logger[_0x0db8('0x12')]('['+[_0x2ac515[_0x0db8('0x13')]()]+_0x0db8('0x44'),_0x316177);_0x100bf0(_0x316177);})[_0x0db8('0x1e')](function(_0x225b21){logger[_0x0db8('0x15')]('['+[_0x2ac515['toUpperCase']()]+']',_0x225b21[_0x0db8('0x16')]);_0x41bacf(_0x225b21[_0x0db8('0x16')]);});});};}function createRemoteTag(_0xea61ad,_0x2341bf,_0x12dab7,_0x2dc40d){return new Promise(function(_0x237204,_0x41c3a0){var _0x46b507={'method':_0x0db8('0x22'),'uri':_0x12dab7+_0x0db8('0x45')+'?'+_0x2dc40d,'body':{'short_description':_0xea61ad,'global':!![],'active':!![],'name':_0xea61ad},'auth':_0x2341bf,'json':!![]};return rp(_0x46b507)[_0x0db8('0xd')](function(_0x3ecfd6){var _0x24e5ec=_0x3ecfd6[_0x0db8('0xe')]['sys_id'];_0x237204(_0x24e5ec);});});}function getRemoteTag(_0x4b7130,_0x1c4c13,_0xde8a76,_0x4139ee,_0x4ebf25){return new Promise(function(_0x3478a9,_0x3cae80){var _0x35ffe={'method':_0x0db8('0xc'),'uri':_0xde8a76+_0x0db8('0x45')+'?sysparm_query=name%3D'+_0x4b7130+'&'+_0x4139ee,'auth':_0x1c4c13,'json':!![]};return rp(_0x35ffe)['then'](function(_0x5c2cbf){if(_0x5c2cbf[_0x0db8('0xe')][_0x0db8('0xf')]>0x0){var _0x25ea5f=_0x5c2cbf[_0x0db8('0xe')][0x0][_0x0db8('0x11')];_0x3478a9(_0x25ea5f);}else{return createRemoteTag(_0x4b7130,_0x1c4c13,_0xde8a76,_0x4139ee)['then'](function(_0x2edb39){_0x3478a9(_0x2edb39);});}});});}function assignTagToIncident(_0x1a9789,_0x4a48ee,_0x1771eb,_0xfbb7cd,_0x3c0f5c){return new Promise(function(_0x4a70bb,_0x7671c3){var _0x397614={'method':'POST','uri':_0x1771eb+_0x0db8('0x46')+'?'+_0x3c0f5c,'body':{'label':_0x1a9789,'table':_0x0db8('0x3b'),'id_type':_0x0db8('0x47'),'table_key':_0xfbb7cd[_0x0db8('0x41')],'title':_0x0db8('0x48')+_0xfbb7cd[_0x0db8('0x42')],'id_display':_0xfbb7cd[_0x0db8('0x42')]},'auth':_0x4a48ee,'json':!![]};return rp(_0x397614)[_0x0db8('0xd')](function(_0x22d981){_0x4a70bb();})['catch'](function(){_0x4a70bb();});});}function manageTags(_0x2b35a7,_0x26fc45,_0x3589c6,_0x58bff5,_0x45754c,_0x57fef2,_0x2f66e9){return new Promise(function(_0x368f08,_0x301366){var _0x5264f9=[];_0x26fc45[_0x0db8('0x49')](function(_0x16d995){_0x5264f9[_0x0db8('0x4a')](getRemoteTag(_0x16d995,_0x3589c6,_0x58bff5,_0x57fef2,_0x2f66e9));});return Promise[_0x0db8('0x4b')](_0x5264f9)[_0x0db8('0xd')](function(_0x393194){if(_0x393194[_0x0db8('0xf')]){logger[_0x0db8('0x12')]('['+[_0x2b35a7[_0x0db8('0x13')]()]+_0x0db8('0x4c'),_0x393194);var _0x55613c=[];_0x393194['forEach'](function(_0x142af2){_0x55613c[_0x0db8('0x4a')](assignTagToIncident(_0x142af2,_0x3589c6,_0x58bff5,_0x45754c,_0x57fef2));});return Promise[_0x0db8('0x4b')](_0x55613c)[_0x0db8('0xd')](function(){_0x368f08();})['catch'](function(){_0x368f08();});}else{_0x368f08();}});});}function getTags(_0x5aa13b,_0x5d964a,_0x194cc2,_0x2490f1,_0x283189,_0x3da464){return function(_0x2f076b){return new Promise(function(_0x3fdff2,_0x5c50aa){var _0x182cb6=[];var _0x5d295c=_0x2490f1['Tags'];if(_0x5d295c&&_0x5d295c[_0x0db8('0xf')]>0x0){_0x182cb6=_[_0x0db8('0x4d')](_0x5d295c,'name');}if(_0x182cb6[_0x0db8('0xf')]>0x0){return manageTags(_0x5aa13b,_0x182cb6,_0x5d964a,_0x194cc2,_0x2f076b,_0x283189,_0x3da464)[_0x0db8('0xd')](function(){_0x3fdff2(_0x2f076b);});}else{_0x3fdff2(_0x2f076b);}});};}function emit(_0x4fadf0,_0x335f04,_0x22d931){var _0x163702='%26sysparm_record_target%3Dincident'+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0x0db8('0x4e')+_0x0db8('0x4f');var _0x29ad30={'uri':_0x4fadf0+_0x0db8('0x50')+_0x22d931+_0x163702};io['to'](util['format'](_0x0db8('0x51'),_0x335f04))['emit'](_0x0db8('0x52'),_0x29ad30);}exports['cs']=function(_0x5828a2,_0x18f2e5,_0x36d716,_0xb3f535,_0x320a66,_0x5ac034,_0x3c20cb,_0x4a2f15){var _0x2dfb45={};var _0x436940={'user':_0x5ac034[_0x0db8('0x53')],'pass':_0x5ac034[_0x0db8('0x54')]};var _0x7b1506=_0x0db8('0x55');var _0x3c46bf=_0x0db8('0x56');_0x5ac034[_0x0db8('0x57')]=intUtil[_0x0db8('0x58')](_0x5ac034['remoteUri']);_0x5ac034[_0x0db8('0x59')]=intUtil[_0x0db8('0x58')](_0x5ac034['serverUrl']);var _0x379ff2=util[_0x0db8('0x5a')]('%s/api/now/table/',_0x5ac034['remoteUri']);_0x2dfb45[_0x0db8('0x1b')]=!_[_0x0db8('0x5b')](_0xb3f535)?_0xb3f535['email']:null;_0x2dfb45[_0x0db8('0x1c')]=_0x5ac034[_0x0db8('0x5c')];_0x2dfb45[_0x0db8('0x24')]=_0x4a2f15[_0x0db8('0x2e')]()===_0x0db8('0x3a')?_0x18f2e5[_0x0db8('0x5d')]:_0x18f2e5[_0x0db8('0x5e')];_0x2dfb45[_0x0db8('0x5f')]=_0x4a2f15===_0x0db8('0x60')||_0x4a2f15===_0x0db8('0x61')?_0x0db8('0x60'):_0x0db8('0x3a');var _0x4b77fc=util[_0x0db8('0x5a')](_0x0db8('0x62'),_0x5ac034['serverUrl'],_0x18f2e5['uniqueid'],md5(_0x18f2e5['uniqueid']));if(_0x320a66&&_0x320a66[_0x0db8('0x63')]){logger[_0x0db8('0x12')](_0x0db8('0x64'),_0x0db8('0x65'));_0x18f2e5[_0x0db8('0x66')]=_0x4b77fc;}else if(_0x3c20cb&&_0x3c20cb[_0x0db8('0x67')]&&_0x3c20cb['recordingFormat']!==_0x0db8('0x68')){logger[_0x0db8('0x12')](_0x0db8('0x69'),_0x0db8('0x65'));_0x18f2e5[_0x0db8('0x66')]=_0x4b77fc;}else{_0x18f2e5[_0x0db8('0x66')]='';}return getAdminUser(_0x4a2f15,_0x436940,_0x2dfb45,_0x379ff2,_0x3c46bf,_0x7b1506)[_0x0db8('0xd')](getUser(_0x4a2f15,_0x436940,_0x379ff2,_0x3c46bf,_0x7b1506))['then'](getEndUser(_0x4a2f15,_0x436940,_0x379ff2,_0x3c46bf,_0x7b1506))[_0x0db8('0xd')](getTicket(_0x4a2f15,_0x436940,_0x379ff2,_0x36d716,_0x18f2e5,_0x3c46bf))['then'](function(_0xa9a9db){logger[_0x0db8('0x12')](util[_0x0db8('0x5a')](_0x0db8('0x6a'),_0xa9a9db[_0x0db8('0x41')]));logger[_0x0db8('0x12')](util['format']('call\x20direction:\x20%s',_0x4a2f15));if(_0x4a2f15!=='unmanaged'){logger[_0x0db8('0x12')]('['+[_0x4a2f15['toUpperCase']()]+']',_0x0db8('0x6b'));emit(_0x5ac034[_0x0db8('0x57')],_0xb3f535[_0x0db8('0x38')],_0xa9a9db['ticketId']);}})[_0x0db8('0x1e')](function(_0x472e9a){logger[_0x0db8('0x15')]('['+[_0x4a2f15['toUpperCase']()]+_0x0db8('0x6c'),util[_0x0db8('0x6d')](_0x472e9a,{'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 9643a42..06038e3 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 _0x94da=['Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','error','outbound','recordingFormat','[OUTBOUND]','uniqueid','destcalleridname','destcalleridnum','Outbound','catch','unmanaged','uri','lastevent','toUpperCase','recordingURL','calleridname','lodash','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','emit','info','name','getString','assigned_user_id','created_by','description','Descriptions','date_start','slice','replace','duration_hours','parent_id','parent_type','Contacts','direction','length','forEach','variableName','push','idField','JSON','stringify','Calls','format','Basic\x20%s','toString','base64','isNil','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','then','entry_list','find','name_value_list','user_name','value','Agent\x20found!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','resolve','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','set_entry','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','map','type','string','toLowerCase','content','custom_fields','variable','customField','customVariable','Variable','login','username','password','PLAIN','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','stripTrailingSlash','remoteUri','serverUrl','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','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'];(function(_0x273200,_0x44d899){var _0x2a9ca4=function(_0x3e3edf){while(--_0x3e3edf){_0x273200['push'](_0x273200['shift']());}};_0x2a9ca4(++_0x44d899);}(_0x94da,0x10a));var _0xa94d=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0x94da[_0xaa0309];return _0x5de7ce;};'use strict';var _=require(_0xa94d('0x0'));var rp=require(_0xa94d('0x1'));var BPromise=require(_0xa94d('0x2'));var md5=require('md5');var util=require(_0xa94d('0x3'));var Redis=require(_0xa94d('0x4'));var intUtil=require(_0xa94d('0x5'));var config=require(_0xa94d('0x6'));var logger=require('../../../../config/logger')(_0xa94d('0x7'));config[_0xa94d('0x8')]=_[_0xa94d('0x9')](config[_0xa94d('0x8')],{'host':_0xa94d('0xa'),'port':0x18eb});var io=require(_0xa94d('0xb'))(new Redis(config[_0xa94d('0x8')]));var def={'method':_0xa94d('0xc'),'json':!![]};function emit(_0x1fa0c4,_0x759f3b,_0x5b34fd){io['to'](_0x1fa0c4)[_0xa94d('0xd')](_0x759f3b,_0x5b34fd);}function getTicket(_0x357ba4,_0x5533a5,_0x134582,_0x462c22,_0xdcfcdd,_0x52d5ba,_0x4f475f,_0x401d2d){logger[_0xa94d('0xe')]('Creating\x20new\x20ticket...');var _0x201e15=new Date();var _0x16399b=[{'name':_0xa94d('0xf'),'value':intUtil[_0xa94d('0x10')](_0x462c22['Subjects'],_0xdcfcdd,'\x20')},{'name':_0xa94d('0x11'),'value':_0x5533a5['id']},{'name':_0xa94d('0x12'),'value':_0x5533a5['id']},{'name':_0xa94d('0x13'),'value':intUtil['getString'](_0x462c22[_0xa94d('0x14')],_0xdcfcdd,'\x0a')},{'name':_0xa94d('0x15'),'value':_0x201e15['toISOString']()[_0xa94d('0x16')](0x0,0x13)[_0xa94d('0x17')]('T','\x20')},{'name':_0xa94d('0x18'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0xa94d('0x19'),'value':_0x134582['id']},{'name':_0xa94d('0x1a'),'value':_0xa94d('0x1b')},{'name':'parent_name','value':_0x134582[_0xa94d('0xf')]},{'name':_0xa94d('0x1c'),'value':_0x401d2d}];if(_0x52d5ba[_0xa94d('0x1d')]){_[_0xa94d('0x1e')](_0x52d5ba,function(_0x36555a){if(_0xdcfcdd[_0x36555a[_0xa94d('0x1f')]]){_0x16399b[_0xa94d('0x20')]({'name':_0x36555a[_0xa94d('0x21')],'value':_0xdcfcdd[_0x36555a[_0xa94d('0x1f')]]});}});}return request({'form':{'method':'set_entry','input_type':_0xa94d('0x22'),'response_type':'JSON','rest_data':JSON[_0xa94d('0x23')]({'session':_0x4f475f['id'],'module_name':_0xa94d('0x24'),'name_value_list':_0x16399b})}});}function getAuth(_0x8cd1b8){return util[_0xa94d('0x25')](_0xa94d('0x26'),new Buffer(_0x8cd1b8['apiKey']+':X')[_0xa94d('0x27')](_0xa94d('0x28')));}function getServerInfo(_0x34090f){return request({'form':{'method':'get_server_info','input_type':_0xa94d('0x22'),'response_type':_0xa94d('0x22'),'rest_data':JSON[_0xa94d('0x23')]({'session':_0x34090f['id']})}});}function getUser(_0x3db3af,_0x2a4d40,_0x2a1bab){if(!_[_0xa94d('0x29')](_0x2a4d40)){logger[_0xa94d('0xe')]('Getting\x20agent\x20with\x20name',_0x2a4d40);return request({'form':{'method':_0xa94d('0x2a'),'input_type':_0xa94d('0x22'),'response_type':_0xa94d('0x22'),'rest_data':JSON[_0xa94d('0x23')]({'session':_0x2a1bab['id'],'module_name':_0xa94d('0x2b'),'query':util['format'](_0xa94d('0x2c'),_0x2a4d40),'order_by':'','offset':'0','select_fields':['id','name','user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xa94d('0x2d')](function(_0x2662fc){if(_0x2662fc[_0xa94d('0x2e')]['length']){var _0xff15ee=_[_0xa94d('0x2f')](_0x2662fc['entry_list'],function(_0x1913ae){return _0x1913ae[_0xa94d('0x30')][_0xa94d('0x31')][_0xa94d('0x32')]===_0x2a4d40;});if(_0xff15ee){logger[_0xa94d('0xe')](_0xa94d('0x33'));return BPromise['resolve']({'id':_0xff15ee[_0xa94d('0x30')]['id'][_0xa94d('0x32')],'name':_0xff15ee[_0xa94d('0x30')][_0xa94d('0xf')][_0xa94d('0x32')]});}}logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x2a1bab[_0xa94d('0x30')][_0xa94d('0x34')]['value'],'name':_0x2a1bab['name_value_list'][_0xa94d('0x31')][_0xa94d('0x32')]});});}else{logger[_0xa94d('0xe')](_0xa94d('0x35'));return BPromise['resolve']({'id':_0x2a1bab[_0xa94d('0x30')][_0xa94d('0x34')][_0xa94d('0x32')],'name':_0x2a1bab[_0xa94d('0x30')][_0xa94d('0x31')][_0xa94d('0x32')]});}}function getEndUser(_0x131bf4,_0x54c207,_0x429e6c,_0x4e39c5){logger[_0xa94d('0xe')](_0xa94d('0x36'),_0x429e6c);return request({'form':{'method':_0xa94d('0x2a'),'input_type':_0xa94d('0x22'),'response_type':'JSON','rest_data':JSON[_0xa94d('0x23')]({'session':_0x4e39c5['id'],'module_name':_0xa94d('0x1b'),'query':util['format'](_0xa94d('0x37'),_0x429e6c),'order_by':'','offset':'0','select_fields':['id',_0xa94d('0xf'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xa94d('0x2d')](function(_0x5f290c){if(_0x5f290c[_0xa94d('0x2e')]['length']){var _0x356ba9=_['find'](_0x5f290c[_0xa94d('0x2e')],function(_0x223454){return _0x223454[_0xa94d('0x30')][_0xa94d('0x38')][_0xa94d('0x32')]===_0x429e6c;});if(_0x356ba9){logger[_0xa94d('0xe')](_0xa94d('0x39'));return BPromise[_0xa94d('0x3a')]({'id':_0x356ba9['name_value_list']['id'][_0xa94d('0x32')],'name':_0x356ba9[_0xa94d('0x30')][_0xa94d('0xf')][_0xa94d('0x32')],'phone':_0x356ba9[_0xa94d('0x30')]['phone_home'][_0xa94d('0x32')]});}}else{logger['info'](_0xa94d('0x3b'));return request({'form':{'method':_0xa94d('0x3c'),'input_type':_0xa94d('0x22'),'response_type':'JSON','rest_data':JSON[_0xa94d('0x23')]({'session':_0x4e39c5['id'],'module_name':_0xa94d('0x1b'),'name_value_list':[{'name':_0xa94d('0x3d'),'value':_0x54c207!==_0xa94d('0x3e')?_0x54c207:util[_0xa94d('0x25')](_0xa94d('0x3f'),_0x429e6c)},{'name':'phone_home','value':_0x429e6c}]})}})[_0xa94d('0x2d')](function(_0x119c72){logger[_0xa94d('0xe')](_0xa94d('0x40'));return BPromise[_0xa94d('0x3a')]({'id':_0x119c72['id'],'name':_0x119c72[_0xa94d('0x2e')][_0xa94d('0x3d')][_0xa94d('0x32')],'phone':_0x119c72[_0xa94d('0x2e')]['phone_home'][_0xa94d('0x32')]});});}});}function request(_0xb3f3bc){logger[_0xa94d('0x41')](_0xa94d('0x42'),JSON[_0xa94d('0x23')](_0xb3f3bc));return rp(_[_0xa94d('0x43')](def,_0xb3f3bc));}function getTags(_0x539f22,_0x37d4e0){var _0x20eb51=[];if(_0x539f22&&_0x539f22[_0xa94d('0x1d')]>0x0){_0x20eb51=_[_0xa94d('0x44')](_0x539f22,_0x37d4e0);}return _0x20eb51;}function getCustomFields(_0x2afd3d,_0x93cb8){var _0x64b821=[];var _0x42ce27={'custom_fields':[]};if(_0x2afd3d[_0xa94d('0x1d')]>0x0){_[_0xa94d('0x1e')](_0x2afd3d,function(_0x765e64){if(_0x765e64[_0xa94d('0x45')]===_0xa94d('0x46')&&_0x765e64['nameField']&&!_0x765e64['customField']){_0x42ce27[_0x765e64['nameField'][_0xa94d('0x47')]()]=_0x765e64[_0xa94d('0x48')]['toString']();}else if(_0x765e64[_0xa94d('0x45')]==='string'&&_0x765e64[_0xa94d('0x21')]&&_0x765e64['customField']){_0x42ce27[_0xa94d('0x49')][_0xa94d('0x20')]({'id':_0x765e64[_0xa94d('0x21')],'value':_0x765e64[_0xa94d('0x48')][_0xa94d('0x27')]()});}else if(_0x765e64[_0xa94d('0x45')]===_0xa94d('0x4a')&&_0x765e64[_0xa94d('0x1f')]&&_0x765e64['idField']&&_0x765e64[_0xa94d('0x4b')]){_0x93cb8[_0x765e64['variableName']]&&_0x42ce27[_0xa94d('0x49')][_0xa94d('0x20')]({'id':_0x765e64[_0xa94d('0x21')],'value':_0x93cb8[_0x765e64[_0xa94d('0x1f')]][_0xa94d('0x27')]()});}else if(_0x765e64['type']===_0xa94d('0x4c')&&_0x765e64[_0xa94d('0x4d')]&&_0x765e64[_0xa94d('0x4d')]['name']&&_0x765e64['idField']&&_0x765e64['customField']){_0x93cb8[_0x765e64[_0xa94d('0x4d')][_0xa94d('0xf')][_0xa94d('0x47')]()]&&_0x42ce27[_0xa94d('0x49')]['push']({'id':_0x765e64[_0xa94d('0x21')],'value':_0x93cb8[_0x765e64[_0xa94d('0x4d')][_0xa94d('0xf')][_0xa94d('0x47')]()][_0xa94d('0x27')]()});}});}return _0x42ce27;}function getConnection(_0x25ab58){return request({'method':_0xa94d('0xc'),'form':{'method':_0xa94d('0x4e'),'input_type':'JSON','response_type':_0xa94d('0x22'),'rest_data':JSON[_0xa94d('0x23')]({'user_auth':{'user_name':_0x25ab58[_0xa94d('0x4f')],'password':_0x25ab58[_0xa94d('0x50')],'encryption':_0xa94d('0x51')},'application':'xCALLY\x20Motion\x20integration'})}})[_0xa94d('0x2d')](function(_0x18d2a8){var _0x3106be=_0x18d2a8;if(_0x3106be['id']){def['sessionID']=_0x3106be['id'];return BPromise[_0xa94d('0x3a')](_0x3106be);}else{throw new Error(util[_0xa94d('0x25')](_0xa94d('0x52'),_0x25ab58['id']));}});}function setRelationship(_0x13b2c9,_0x51f2c9,_0x2283c3,_0x335e03){return request({'form':{'method':_0xa94d('0x53'),'input_type':_0xa94d('0x22'),'response_type':_0xa94d('0x22'),'rest_data':JSON[_0xa94d('0x23')]({'session':_0x13b2c9['id'],'module_name':'Calls','module_id':_0x2283c3['id'],'link_field_name':_0x335e03,'related_ids':[_0x51f2c9['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xa94d('0x54')]=function(_0x2e5223,_0x37be37,_0x402d19,_0x218d6f,_0x4afe29,_0x248e98){var _0x5f4c2e,_0x4a476c,_0x371b74,_0x3042b0;_0x248e98['remoteUri']=intUtil[_0xa94d('0x55')](_0x248e98[_0xa94d('0x56')]);_0x248e98[_0xa94d('0x57')]=intUtil[_0xa94d('0x55')](_0x248e98['serverUrl']);def['uri']=util['format'](_0xa94d('0x58'),_0x248e98[_0xa94d('0x56')]);if(_0x4afe29&&_0x4afe29[_0xa94d('0x59')]){logger[_0xa94d('0xe')](_0xa94d('0x5a'),_0xa94d('0x5b'));_0x37be37['recordingURL']=util[_0xa94d('0x25')](_0xa94d('0x5c'),_0x248e98[_0xa94d('0x57')],_0x37be37['uniqueid'],md5(_0x37be37['uniqueid']));}else{_0x37be37['recordingURL']='';}return getConnection(_0x248e98)[_0xa94d('0x2d')](function(_0x379a36){_0x3042b0=_0x379a36;return getUser(_0x248e98,_0x218d6f[_0xa94d('0xf')],_0x3042b0);})[_0xa94d('0x2d')](function(_0x383191){_0x5f4c2e=_0x383191;logger[_0xa94d('0xe')](_0xa94d('0x5d'),_0x5f4c2e['id']);return getEndUser(_0x248e98,_0x37be37['calleridname'],_0x37be37[_0xa94d('0x5e')],_0x3042b0);})[_0xa94d('0x2d')](function(_0x55e10f){_0x4a476c=_0x55e10f;logger[_0xa94d('0xe')](_0xa94d('0x5f'),_0x4a476c['id']);return getTicket(_0x248e98,_0x5f4c2e,_0x4a476c,_0x402d19,_0x37be37,_0x402d19[_0xa94d('0x60')],_0x3042b0,_0xa94d('0x61'));})['then'](function(_0x3c6e77){_0x371b74=_0x3c6e77;logger['info'](_0xa94d('0x62'));logger[_0xa94d('0xe')](_0xa94d('0x63'),_0x371b74['id']);return setRelationship(_0x3042b0,_0x5f4c2e,_0x371b74,_0xa94d('0x64'));})[_0xa94d('0x2d')](function(){return setRelationship(_0x3042b0,_0x4a476c,_0x371b74,_0xa94d('0x65'));})[_0xa94d('0x2d')](function(){return getServerInfo(_0x3042b0);})['then'](function(_0xc9c9d7){var _0x3ae6fd=parseInt(_0xc9c9d7[_0xa94d('0x66')][_0xa94d('0x67')](0x0));var _0x3c80ca=util['format'](_0xa94d('0x68'),_0x248e98[_0xa94d('0x56')],_0x371b74['id']);if(_0x3ae6fd>0x6){_0x3c80ca=util[_0xa94d('0x25')](_0xa94d('0x69'),_0x248e98[_0xa94d('0x56')],_0x371b74['id']);}logger[_0xa94d('0xe')](_0xa94d('0x5a'),_0xa94d('0x6a'));emit(util[_0xa94d('0x25')](_0xa94d('0x6b'),_0x218d6f[_0xa94d('0xf')]),_0xa94d('0x6c'),{'uri':_0x3c80ca});})['catch'](function(_0x3e550c){logger[_0xa94d('0x6d')](_0xa94d('0x5a'),JSON['stringify'](_0x3e550c));});};exports[_0xa94d('0x6e')]=function(_0x49fd84,_0x1f2437,_0x5815ff,_0x2f20e5,_0x44fe1c,_0x3e5f8f,_0x4a12d5){var _0xdf2a9,_0x521bc2,_0x21c3ae,_0x469b09;_0x3e5f8f[_0xa94d('0x56')]=intUtil['stripTrailingSlash'](_0x3e5f8f[_0xa94d('0x56')]);_0x3e5f8f['serverUrl']=intUtil[_0xa94d('0x55')](_0x3e5f8f[_0xa94d('0x57')]);def['uri']=util[_0xa94d('0x25')](_0xa94d('0x58'),_0x3e5f8f[_0xa94d('0x56')]);if(_0x4a12d5&&_0x4a12d5[_0xa94d('0x6f')]&&_0x4a12d5['recordingFormat']!=='none'){logger[_0xa94d('0xe')](_0xa94d('0x70'),'Recording\x20is\x20enabled!');_0x1f2437['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3e5f8f['serverUrl'],_0x1f2437['uniqueid'],md5(_0x1f2437[_0xa94d('0x71')]));}return getConnection(_0x3e5f8f)[_0xa94d('0x2d')](function(_0xc006ad){_0x469b09=_0xc006ad;return getUser(_0x3e5f8f,_0x2f20e5[_0xa94d('0xf')],_0x469b09);})['then'](function(_0x322957){_0xdf2a9=_0x322957;logger[_0xa94d('0xe')](_0xa94d('0x5d'),_0xdf2a9['id']);return getEndUser(_0x3e5f8f,_0x1f2437[_0xa94d('0x72')],_0x1f2437[_0xa94d('0x73')],_0x469b09);})['then'](function(_0x1be6a7){_0x521bc2=_0x1be6a7;logger[_0xa94d('0xe')]('The\x20Enduser\x20ID\x20is:',_0x521bc2['id']);return getTicket(_0x3e5f8f,_0xdf2a9,_0x521bc2,_0x5815ff,_0x1f2437,_0x5815ff['Fields'],_0x469b09,_0xa94d('0x74'));})['then'](function(_0x511d6){_0x21c3ae=_0x511d6;logger[_0xa94d('0xe')](_0xa94d('0x62'));logger[_0xa94d('0xe')]('The\x20Ticket\x20ID\x20is:',_0x21c3ae['id']);return setRelationship(_0x469b09,_0xdf2a9,_0x21c3ae,_0xa94d('0x64'));})[_0xa94d('0x2d')](function(){return setRelationship(_0x469b09,_0x521bc2,_0x21c3ae,'contacts');})[_0xa94d('0x2d')](function(){return getServerInfo(_0x469b09);})[_0xa94d('0x2d')](function(_0x401368){var _0x51811d=parseInt(_0x401368[_0xa94d('0x66')][_0xa94d('0x67')](0x0));var _0x706597=util['format'](_0xa94d('0x68'),_0x3e5f8f['remoteUri'],_0x21c3ae['id']);if(_0x51811d>0x6){_0x706597=util[_0xa94d('0x25')](_0xa94d('0x69'),_0x3e5f8f[_0xa94d('0x56')],_0x21c3ae['id']);}logger['info'](_0xa94d('0x70'),_0xa94d('0x6a'));emit(util[_0xa94d('0x25')](_0xa94d('0x6b'),_0x2f20e5[_0xa94d('0xf')]),'trigger:browser:url',{'uri':_0x706597});})[_0xa94d('0x75')](function(_0x21efb9){logger['error']('[OUTBOUND]',JSON[_0xa94d('0x23')](_0x21efb9));});};exports[_0xa94d('0x76')]=function(_0xe2f15c,_0x596d5,_0x3ad57a,_0x5984e7,_0x2d12d9,_0x5d79ec){var _0x2215db,_0x14731e,_0x339bf8,_0x45fbf5;_0x5d79ec[_0xa94d('0x56')]=intUtil[_0xa94d('0x55')](_0x5d79ec[_0xa94d('0x56')]);_0x5d79ec['serverUrl']=intUtil[_0xa94d('0x55')](_0x5d79ec['serverUrl']);def[_0xa94d('0x77')]=util['format'](_0xa94d('0x58'),_0x5d79ec['remoteUri']);if(_0x2d12d9&&_0x2d12d9[_0xa94d('0x59')]){logger['info']('['+_0x596d5[_0xa94d('0x78')][_0xa94d('0x79')]()+']','Recording\x20is\x20enabled!');_0x596d5[_0xa94d('0x7a')]=util[_0xa94d('0x25')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5d79ec[_0xa94d('0x57')],_0x596d5[_0xa94d('0x71')],md5(_0x596d5[_0xa94d('0x71')]));}else{_0x596d5[_0xa94d('0x7a')]='';}return getConnection(_0x5d79ec)[_0xa94d('0x2d')](function(_0x3cde7e){_0x45fbf5=_0x3cde7e;if(!_[_0xa94d('0x29')](_0x5984e7)){return getUser(_0x5d79ec,_0x5984e7[_0xa94d('0xf')],_0x45fbf5);}else{return getUser(_0x5d79ec,null,_0x45fbf5);}})[_0xa94d('0x2d')](function(_0x40fe91){_0x2215db=_0x40fe91;logger[_0xa94d('0xe')]('The\x20User\x20ID\x20is:',_0x2215db['id']);return getEndUser(_0x5d79ec,_0x596d5[_0xa94d('0x7b')],_0x596d5[_0xa94d('0x5e')],_0x45fbf5);})[_0xa94d('0x2d')](function(_0x2c417f){_0x14731e=_0x2c417f;logger['info'](_0xa94d('0x5f'),_0x14731e['id']);return getTicket(_0x5d79ec,_0x2215db,_0x14731e,_0x3ad57a,_0x596d5,_0x3ad57a[_0xa94d('0x60')],_0x45fbf5,_0xa94d('0x61'));})[_0xa94d('0x2d')](function(_0x570ae1){_0x339bf8=_0x570ae1;logger[_0xa94d('0xe')]('Ticket\x20created!');logger[_0xa94d('0xe')](_0xa94d('0x63'),_0x339bf8['id']);return setRelationship(_0x45fbf5,_0x2215db,_0x339bf8,_0xa94d('0x64'));})[_0xa94d('0x2d')](function(){return setRelationship(_0x45fbf5,_0x14731e,_0x339bf8,_0xa94d('0x65'));})[_0xa94d('0x2d')](function(){return getServerInfo(_0x45fbf5);})[_0xa94d('0x75')](function(_0x4c4399){logger[_0xa94d('0x6d')]('['+_0x596d5[_0xa94d('0x78')][_0xa94d('0x79')]()+']',JSON[_0xa94d('0x23')](_0x4c4399));});}; \ No newline at end of file +var _0x76f7=['variableName','push','idField','set_entry','JSON','stringify','Calls','format','apiKey','toString','get_server_info','Getting\x20agent\x20with\x20name','get_entry_list','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','length','name_value_list','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','user_id','contacts.phone_home\x20=\x20\x22%s\x22','find','phone_home','Enduser\x20found!','first_name','','Caller\x20-\x20%s','debug','[HTTP]','merge','map','forEach','type','string','nameField','customField','toLowerCase','content','custom_fields','variable','Variable','login','username','password','xCALLY\x20Motion\x20integration','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','serverUrl','stripTrailingSlash','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','version','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','catch','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Outbound','contacts','trigger:browser:url','error','unmanaged','uri','lastevent','toUpperCase','The\x20Enduser\x20ID\x20is:','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','sugarcrm','defaults','redis','localhost','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','description','Descriptions','date_start','slice','replace','duration_minutes','parent_id','Contacts','direction'];(function(_0x3f457f,_0x248ce9){var _0x5a7bc7=function(_0x383985){while(--_0x383985){_0x3f457f['push'](_0x3f457f['shift']());}};_0x5a7bc7(++_0x248ce9);}(_0x76f7,0x1ca));var _0x776f=function(_0x4d2ce3,_0x5d05bd){_0x4d2ce3=_0x4d2ce3-0x0;var _0x110771=_0x76f7[_0x4d2ce3];return _0x110771;};'use strict';var _=require('lodash');var rp=require(_0x776f('0x0'));var BPromise=require(_0x776f('0x1'));var md5=require(_0x776f('0x2'));var util=require(_0x776f('0x3'));var Redis=require(_0x776f('0x4'));var intUtil=require(_0x776f('0x5'));var config=require(_0x776f('0x6'));var logger=require('../../../../config/logger')(_0x776f('0x7'));config['redis']=_[_0x776f('0x8')](config[_0x776f('0x9')],{'host':_0x776f('0xa'),'port':0x18eb});var io=require(_0x776f('0xb'))(new Redis(config[_0x776f('0x9')]));var def={'method':_0x776f('0xc'),'json':!![]};function emit(_0x1f3fc1,_0x1ce8ca,_0x53beff){io['to'](_0x1f3fc1)[_0x776f('0xd')](_0x1ce8ca,_0x53beff);}function getTicket(_0x2dcee2,_0x5caced,_0x4d62ef,_0x15df2a,_0x1a1ff1,_0x1403ed,_0x156845,_0x159744){logger[_0x776f('0xe')](_0x776f('0xf'));var _0x513ba3=new Date();var _0x12b718=[{'name':_0x776f('0x10'),'value':intUtil[_0x776f('0x11')](_0x15df2a[_0x776f('0x12')],_0x1a1ff1,'\x20')},{'name':_0x776f('0x13'),'value':_0x5caced['id']},{'name':_0x776f('0x14'),'value':_0x5caced['id']},{'name':_0x776f('0x15'),'value':intUtil[_0x776f('0x11')](_0x15df2a[_0x776f('0x16')],_0x1a1ff1,'\x0a')},{'name':_0x776f('0x17'),'value':_0x513ba3['toISOString']()[_0x776f('0x18')](0x0,0x13)[_0x776f('0x19')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0x776f('0x1a'),'value':'15'},{'name':_0x776f('0x1b'),'value':_0x4d62ef['id']},{'name':'parent_type','value':_0x776f('0x1c')},{'name':'parent_name','value':_0x4d62ef['name']},{'name':_0x776f('0x1d'),'value':_0x159744}];if(_0x1403ed['length']){_['forEach'](_0x1403ed,function(_0x448844){if(_0x1a1ff1[_0x448844[_0x776f('0x1e')]]){_0x12b718[_0x776f('0x1f')]({'name':_0x448844[_0x776f('0x20')],'value':_0x1a1ff1[_0x448844[_0x776f('0x1e')]]});}});}return request({'form':{'method':_0x776f('0x21'),'input_type':_0x776f('0x22'),'response_type':_0x776f('0x22'),'rest_data':JSON[_0x776f('0x23')]({'session':_0x156845['id'],'module_name':_0x776f('0x24'),'name_value_list':_0x12b718})}});}function getAuth(_0x3f491b){return util[_0x776f('0x25')]('Basic\x20%s',new Buffer(_0x3f491b[_0x776f('0x26')]+':X')[_0x776f('0x27')]('base64'));}function getServerInfo(_0x363f2a){return request({'form':{'method':_0x776f('0x28'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x776f('0x23')]({'session':_0x363f2a['id']})}});}function getUser(_0x3a3dc3,_0x42621d,_0x5485fe){if(!_['isNil'](_0x42621d)){logger[_0x776f('0xe')](_0x776f('0x29'),_0x42621d);return request({'form':{'method':_0x776f('0x2a'),'input_type':_0x776f('0x22'),'response_type':_0x776f('0x22'),'rest_data':JSON[_0x776f('0x23')]({'session':_0x5485fe['id'],'module_name':'Employees','query':util[_0x776f('0x25')](_0x776f('0x2b'),_0x42621d),'order_by':'','offset':'0','select_fields':['id',_0x776f('0x10'),_0x776f('0x2c')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x776f('0x2d')](function(_0x49b1e4){if(_0x49b1e4[_0x776f('0x2e')][_0x776f('0x2f')]){var _0x453bc5=_['find'](_0x49b1e4[_0x776f('0x2e')],function(_0x4769b7){return _0x4769b7[_0x776f('0x30')][_0x776f('0x2c')][_0x776f('0x31')]===_0x42621d;});if(_0x453bc5){logger[_0x776f('0xe')](_0x776f('0x32'));return BPromise[_0x776f('0x33')]({'id':_0x453bc5[_0x776f('0x30')]['id'][_0x776f('0x31')],'name':_0x453bc5[_0x776f('0x30')][_0x776f('0x10')][_0x776f('0x31')]});}}logger['info'](_0x776f('0x34'));return BPromise[_0x776f('0x33')]({'id':_0x5485fe[_0x776f('0x30')]['user_id']['value'],'name':_0x5485fe[_0x776f('0x30')][_0x776f('0x2c')]['value']});});}else{logger[_0x776f('0xe')](_0x776f('0x35'));return BPromise[_0x776f('0x33')]({'id':_0x5485fe[_0x776f('0x30')][_0x776f('0x36')][_0x776f('0x31')],'name':_0x5485fe[_0x776f('0x30')][_0x776f('0x2c')]['value']});}}function getEndUser(_0xf8b673,_0x1f86ba,_0x3e0aea,_0x13eb68){logger[_0x776f('0xe')]('Searching\x20enduser\x20with\x20phone',_0x3e0aea);return request({'form':{'method':'get_entry_list','input_type':_0x776f('0x22'),'response_type':_0x776f('0x22'),'rest_data':JSON[_0x776f('0x23')]({'session':_0x13eb68['id'],'module_name':'Contacts','query':util[_0x776f('0x25')](_0x776f('0x37'),_0x3e0aea),'order_by':'','offset':'0','select_fields':['id',_0x776f('0x10'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x776f('0x2d')](function(_0x535d12){if(_0x535d12[_0x776f('0x2e')][_0x776f('0x2f')]){var _0x50db62=_[_0x776f('0x38')](_0x535d12[_0x776f('0x2e')],function(_0x50e54e){return _0x50e54e[_0x776f('0x30')][_0x776f('0x39')][_0x776f('0x31')]===_0x3e0aea;});if(_0x50db62){logger['info'](_0x776f('0x3a'));return BPromise[_0x776f('0x33')]({'id':_0x50db62['name_value_list']['id']['value'],'name':_0x50db62[_0x776f('0x30')][_0x776f('0x10')]['value'],'phone':_0x50db62[_0x776f('0x30')][_0x776f('0x39')]['value']});}}else{logger[_0x776f('0xe')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0x776f('0x21'),'input_type':_0x776f('0x22'),'response_type':'JSON','rest_data':JSON[_0x776f('0x23')]({'session':_0x13eb68['id'],'module_name':_0x776f('0x1c'),'name_value_list':[{'name':_0x776f('0x3b'),'value':_0x1f86ba!==_0x776f('0x3c')?_0x1f86ba:util[_0x776f('0x25')](_0x776f('0x3d'),_0x3e0aea)},{'name':_0x776f('0x39'),'value':_0x3e0aea}]})}})[_0x776f('0x2d')](function(_0x2e072e){logger[_0x776f('0xe')]('Enduser\x20created.');return BPromise[_0x776f('0x33')]({'id':_0x2e072e['id'],'name':_0x2e072e[_0x776f('0x2e')][_0x776f('0x3b')][_0x776f('0x31')],'phone':_0x2e072e['entry_list'][_0x776f('0x39')]['value']});});}});}function request(_0x1ea4cf){logger[_0x776f('0x3e')](_0x776f('0x3f'),JSON['stringify'](_0x1ea4cf));return rp(_[_0x776f('0x40')](def,_0x1ea4cf));}function getTags(_0x1e92d9,_0x359bbc){var _0x47667e=[];if(_0x1e92d9&&_0x1e92d9[_0x776f('0x2f')]>0x0){_0x47667e=_[_0x776f('0x41')](_0x1e92d9,_0x359bbc);}return _0x47667e;}function getCustomFields(_0x23d20e,_0x15f4c5){var _0x3cbcda=[];var _0x3b2d15={'custom_fields':[]};if(_0x23d20e['length']>0x0){_[_0x776f('0x42')](_0x23d20e,function(_0xcee6d6){if(_0xcee6d6[_0x776f('0x43')]===_0x776f('0x44')&&_0xcee6d6[_0x776f('0x45')]&&!_0xcee6d6[_0x776f('0x46')]){_0x3b2d15[_0xcee6d6[_0x776f('0x45')][_0x776f('0x47')]()]=_0xcee6d6[_0x776f('0x48')][_0x776f('0x27')]();}else if(_0xcee6d6[_0x776f('0x43')]===_0x776f('0x44')&&_0xcee6d6['idField']&&_0xcee6d6[_0x776f('0x46')]){_0x3b2d15[_0x776f('0x49')][_0x776f('0x1f')]({'id':_0xcee6d6[_0x776f('0x20')],'value':_0xcee6d6[_0x776f('0x48')][_0x776f('0x27')]()});}else if(_0xcee6d6[_0x776f('0x43')]===_0x776f('0x4a')&&_0xcee6d6[_0x776f('0x1e')]&&_0xcee6d6[_0x776f('0x20')]&&_0xcee6d6[_0x776f('0x46')]){_0x15f4c5[_0xcee6d6[_0x776f('0x1e')]]&&_0x3b2d15[_0x776f('0x49')]['push']({'id':_0xcee6d6[_0x776f('0x20')],'value':_0x15f4c5[_0xcee6d6['variableName']][_0x776f('0x27')]()});}else if(_0xcee6d6[_0x776f('0x43')]==='customVariable'&&_0xcee6d6[_0x776f('0x4b')]&&_0xcee6d6[_0x776f('0x4b')][_0x776f('0x10')]&&_0xcee6d6[_0x776f('0x20')]&&_0xcee6d6['customField']){_0x15f4c5[_0xcee6d6[_0x776f('0x4b')][_0x776f('0x10')][_0x776f('0x47')]()]&&_0x3b2d15[_0x776f('0x49')][_0x776f('0x1f')]({'id':_0xcee6d6[_0x776f('0x20')],'value':_0x15f4c5[_0xcee6d6[_0x776f('0x4b')][_0x776f('0x10')]['toLowerCase']()]['toString']()});}});}return _0x3b2d15;}function getConnection(_0x149b9a){return request({'method':_0x776f('0xc'),'form':{'method':_0x776f('0x4c'),'input_type':_0x776f('0x22'),'response_type':_0x776f('0x22'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x149b9a[_0x776f('0x4d')],'password':_0x149b9a[_0x776f('0x4e')],'encryption':'PLAIN'},'application':_0x776f('0x4f')})}})[_0x776f('0x2d')](function(_0x36a6fb){var _0x611b26=_0x36a6fb;if(_0x611b26['id']){def['sessionID']=_0x611b26['id'];return BPromise['resolve'](_0x611b26);}else{throw new Error(util['format'](_0x776f('0x50'),_0x149b9a['id']));}});}function setRelationship(_0x3cf245,_0x24ec67,_0x51ccf0,_0x2fff5c){return request({'form':{'method':_0x776f('0x51'),'input_type':_0x776f('0x22'),'response_type':_0x776f('0x22'),'rest_data':JSON[_0x776f('0x23')]({'session':_0x3cf245['id'],'module_name':_0x776f('0x24'),'module_id':_0x51ccf0['id'],'link_field_name':_0x2fff5c,'related_ids':[_0x24ec67['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x776f('0x52')]=function(_0x41f10a,_0x2e511c,_0x5ed162,_0x569057,_0x6c7562,_0x547efe){var _0x5632f1,_0x25318a,_0x106b96,_0xfe4792;_0x547efe[_0x776f('0x53')]=intUtil['stripTrailingSlash'](_0x547efe[_0x776f('0x53')]);_0x547efe[_0x776f('0x54')]=intUtil[_0x776f('0x55')](_0x547efe[_0x776f('0x54')]);def['uri']=util[_0x776f('0x25')](_0x776f('0x56'),_0x547efe[_0x776f('0x53')]);if(_0x6c7562&&_0x6c7562[_0x776f('0x57')]){logger[_0x776f('0xe')](_0x776f('0x58'),_0x776f('0x59'));_0x2e511c[_0x776f('0x5a')]=util[_0x776f('0x25')](_0x776f('0x5b'),_0x547efe['serverUrl'],_0x2e511c[_0x776f('0x5c')],md5(_0x2e511c['uniqueid']));}else{_0x2e511c[_0x776f('0x5a')]='';}return getConnection(_0x547efe)[_0x776f('0x2d')](function(_0x375127){_0xfe4792=_0x375127;return getUser(_0x547efe,_0x569057['name'],_0xfe4792);})[_0x776f('0x2d')](function(_0x5088a5){_0x5632f1=_0x5088a5;logger['info']('The\x20User\x20ID\x20is:',_0x5632f1['id']);return getEndUser(_0x547efe,_0x2e511c[_0x776f('0x5d')],_0x2e511c[_0x776f('0x5e')],_0xfe4792);})['then'](function(_0x5669ba){_0x25318a=_0x5669ba;logger[_0x776f('0xe')]('The\x20Enduser\x20ID\x20is:',_0x25318a['id']);return getTicket(_0x547efe,_0x5632f1,_0x25318a,_0x5ed162,_0x2e511c,_0x5ed162[_0x776f('0x5f')],_0xfe4792,_0x776f('0x60'));})[_0x776f('0x2d')](function(_0x55d962){_0x106b96=_0x55d962;logger[_0x776f('0xe')](_0x776f('0x61'));logger['info'](_0x776f('0x62'),_0x106b96['id']);return setRelationship(_0xfe4792,_0x5632f1,_0x106b96,_0x776f('0x63'));})['then'](function(){return setRelationship(_0xfe4792,_0x25318a,_0x106b96,'contacts');})[_0x776f('0x2d')](function(){return getServerInfo(_0xfe4792);})[_0x776f('0x2d')](function(_0x4987eb){var _0x2e3388=parseInt(_0x4987eb[_0x776f('0x64')]['charAt'](0x0));var _0xaefdb1=util['format'](_0x776f('0x65'),_0x547efe[_0x776f('0x53')],_0x106b96['id']);if(_0x2e3388>0x6){_0xaefdb1=util[_0x776f('0x25')](_0x776f('0x66'),_0x547efe[_0x776f('0x53')],_0x106b96['id']);}logger['info'](_0x776f('0x58'),_0x776f('0x67'));emit(util[_0x776f('0x25')](_0x776f('0x68'),_0x569057[_0x776f('0x10')]),'trigger:browser:url',{'uri':_0xaefdb1});})[_0x776f('0x69')](function(_0x304d9e){logger['error']('[QUEUE]',JSON[_0x776f('0x23')](_0x304d9e));});};exports[_0x776f('0x6a')]=function(_0xfbf786,_0x42afd2,_0x493f6d,_0x1d5b3a,_0x2c1ea3,_0x4fdc21,_0x16a41a){var _0x34aa2a,_0x388659,_0x25f771,_0x363b0f;_0x4fdc21[_0x776f('0x53')]=intUtil[_0x776f('0x55')](_0x4fdc21[_0x776f('0x53')]);_0x4fdc21[_0x776f('0x54')]=intUtil[_0x776f('0x55')](_0x4fdc21[_0x776f('0x54')]);def['uri']=util[_0x776f('0x25')](_0x776f('0x56'),_0x4fdc21[_0x776f('0x53')]);if(_0x16a41a&&_0x16a41a[_0x776f('0x6b')]&&_0x16a41a[_0x776f('0x6b')]!==_0x776f('0x6c')){logger[_0x776f('0xe')](_0x776f('0x6d'),_0x776f('0x59'));_0x42afd2[_0x776f('0x5a')]=util[_0x776f('0x25')](_0x776f('0x5b'),_0x4fdc21[_0x776f('0x54')],_0x42afd2['uniqueid'],md5(_0x42afd2[_0x776f('0x5c')]));}return getConnection(_0x4fdc21)[_0x776f('0x2d')](function(_0x5e9c09){_0x363b0f=_0x5e9c09;return getUser(_0x4fdc21,_0x1d5b3a[_0x776f('0x10')],_0x363b0f);})[_0x776f('0x2d')](function(_0xb5015b){_0x34aa2a=_0xb5015b;logger[_0x776f('0xe')](_0x776f('0x6e'),_0x34aa2a['id']);return getEndUser(_0x4fdc21,_0x42afd2[_0x776f('0x6f')],_0x42afd2[_0x776f('0x70')],_0x363b0f);})['then'](function(_0x3d2874){_0x388659=_0x3d2874;logger[_0x776f('0xe')]('The\x20Enduser\x20ID\x20is:',_0x388659['id']);return getTicket(_0x4fdc21,_0x34aa2a,_0x388659,_0x493f6d,_0x42afd2,_0x493f6d[_0x776f('0x5f')],_0x363b0f,_0x776f('0x71'));})[_0x776f('0x2d')](function(_0x448759){_0x25f771=_0x448759;logger[_0x776f('0xe')](_0x776f('0x61'));logger[_0x776f('0xe')](_0x776f('0x62'),_0x25f771['id']);return setRelationship(_0x363b0f,_0x34aa2a,_0x25f771,_0x776f('0x63'));})[_0x776f('0x2d')](function(){return setRelationship(_0x363b0f,_0x388659,_0x25f771,_0x776f('0x72'));})[_0x776f('0x2d')](function(){return getServerInfo(_0x363b0f);})[_0x776f('0x2d')](function(_0x2e8c76){var _0x372aaa=parseInt(_0x2e8c76[_0x776f('0x64')]['charAt'](0x0));var _0x29f924=util['format'](_0x776f('0x65'),_0x4fdc21[_0x776f('0x53')],_0x25f771['id']);if(_0x372aaa>0x6){_0x29f924=util['format']('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x4fdc21[_0x776f('0x53')],_0x25f771['id']);}logger[_0x776f('0xe')](_0x776f('0x6d'),_0x776f('0x67'));emit(util['format'](_0x776f('0x68'),_0x1d5b3a[_0x776f('0x10')]),_0x776f('0x73'),{'uri':_0x29f924});})[_0x776f('0x69')](function(_0x1b9fc4){logger[_0x776f('0x74')](_0x776f('0x6d'),JSON[_0x776f('0x23')](_0x1b9fc4));});};exports[_0x776f('0x75')]=function(_0x3fa017,_0x37a2f4,_0x5504f1,_0xe71624,_0x20fa6f,_0x32a052){var _0x5441b8,_0x3857f3,_0x514f4e,_0x26cc8e;_0x32a052[_0x776f('0x53')]=intUtil[_0x776f('0x55')](_0x32a052[_0x776f('0x53')]);_0x32a052[_0x776f('0x54')]=intUtil[_0x776f('0x55')](_0x32a052[_0x776f('0x54')]);def[_0x776f('0x76')]=util[_0x776f('0x25')](_0x776f('0x56'),_0x32a052[_0x776f('0x53')]);if(_0x20fa6f&&_0x20fa6f['monitor_format']){logger[_0x776f('0xe')]('['+_0x37a2f4[_0x776f('0x77')][_0x776f('0x78')]()+']',_0x776f('0x59'));_0x37a2f4[_0x776f('0x5a')]=util[_0x776f('0x25')](_0x776f('0x5b'),_0x32a052[_0x776f('0x54')],_0x37a2f4[_0x776f('0x5c')],md5(_0x37a2f4[_0x776f('0x5c')]));}else{_0x37a2f4[_0x776f('0x5a')]='';}return getConnection(_0x32a052)[_0x776f('0x2d')](function(_0x146a72){_0x26cc8e=_0x146a72;if(!_['isNil'](_0xe71624)){return getUser(_0x32a052,_0xe71624[_0x776f('0x10')],_0x26cc8e);}else{return getUser(_0x32a052,null,_0x26cc8e);}})['then'](function(_0x1f3873){_0x5441b8=_0x1f3873;logger['info']('The\x20User\x20ID\x20is:',_0x5441b8['id']);return getEndUser(_0x32a052,_0x37a2f4[_0x776f('0x5d')],_0x37a2f4['calleridnum'],_0x26cc8e);})[_0x776f('0x2d')](function(_0x5a3ed4){_0x3857f3=_0x5a3ed4;logger[_0x776f('0xe')](_0x776f('0x79'),_0x3857f3['id']);return getTicket(_0x32a052,_0x5441b8,_0x3857f3,_0x5504f1,_0x37a2f4,_0x5504f1[_0x776f('0x5f')],_0x26cc8e,_0x776f('0x60'));})[_0x776f('0x2d')](function(_0x3799a4){_0x514f4e=_0x3799a4;logger[_0x776f('0xe')](_0x776f('0x61'));logger[_0x776f('0xe')](_0x776f('0x62'),_0x514f4e['id']);return setRelationship(_0x26cc8e,_0x5441b8,_0x514f4e,'users');})[_0x776f('0x2d')](function(){return setRelationship(_0x26cc8e,_0x3857f3,_0x514f4e,_0x776f('0x72'));})[_0x776f('0x2d')](function(){return getServerInfo(_0x26cc8e);})[_0x776f('0x69')](function(_0x2574c1){logger[_0x776f('0x74')]('['+_0x37a2f4['lastevent'][_0x776f('0x78')]()+']',JSON[_0x776f('0x23')](_0x2574c1));});}; \ 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 52b7299..17fe5e6 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 _0xfeae=['%s:\x20%s','keyContent','customVariable','join','stripTrailingSlash','slice','substring','isNil','test','lodash','util','getString','sortBy','length','type','string','push','variable','variableName','Variable','name','toLowerCase','toString','keyValue','keyType','key','format'];(function(_0x269e00,_0x5ed8d3){var _0x47e11a=function(_0x5c5a27){while(--_0x5c5a27){_0x269e00['push'](_0x269e00['shift']());}};_0x47e11a(++_0x5ed8d3);}(_0xfeae,0x132));var _0xefea=function(_0x20e4ac,_0x5f52c2){_0x20e4ac=_0x20e4ac-0x0;var _0x1548ce=_0xfeae[_0x20e4ac];return _0x1548ce;};'use strict';var _=require(_0xefea('0x0'));var util=require(_0xefea('0x1'));exports[_0xefea('0x2')]=function(_0x1899c6,_0x4dd396,_0x36f0b0){var _0x9e3197=[];if(_0x1899c6['length']>0x0){var _0x17c87f=_[_0xefea('0x3')](_0x1899c6,['id']);for(var _0x3a4f1c=0x0;_0x3a4f1c<_0x17c87f[_0xefea('0x4')];_0x3a4f1c++){var _0x5bd5b2=_0x17c87f[_0x3a4f1c];if(_0x5bd5b2[_0xefea('0x5')]===_0xefea('0x6')){_0x9e3197[_0xefea('0x7')](_0x5bd5b2['content']);}else if(_0x5bd5b2[_0xefea('0x5')]===_0xefea('0x8')&&_0x5bd5b2[_0xefea('0x9')]){_0x4dd396[_0x5bd5b2[_0xefea('0x9')]]&&_0x9e3197['push'](_0x4dd396[_0x5bd5b2[_0xefea('0x9')]]['toString']());}else if(_0x5bd5b2[_0xefea('0x5')]==='customVariable'&&_0x5bd5b2[_0xefea('0xa')]&&_0x5bd5b2[_0xefea('0xa')]['name']){_0x4dd396[_0x5bd5b2['Variable'][_0xefea('0xb')][_0xefea('0xc')]()]&&_0x9e3197[_0xefea('0x7')](_0x4dd396[_0x5bd5b2[_0xefea('0xa')][_0xefea('0xb')][_0xefea('0xc')]()][_0xefea('0xd')]());}else if(_0x5bd5b2['type']===_0xefea('0xe')){if(_0x5bd5b2[_0xefea('0xf')]===_0xefea('0x6')&&_0x5bd5b2[_0xefea('0x10')]){_0x9e3197[_0xefea('0x7')](util[_0xefea('0x11')](_0xefea('0x12'),_0x5bd5b2[_0xefea('0x10')],_0x5bd5b2[_0xefea('0x13')]));}else if(_0x5bd5b2['keyType']===_0xefea('0x8')&&_0x5bd5b2['variableName']&&_0x5bd5b2[_0xefea('0x10')]){_0x4dd396[_0x5bd5b2[_0xefea('0x9')]]&&_0x9e3197[_0xefea('0x7')](util[_0xefea('0x11')]('%s:\x20%s',_0x5bd5b2[_0xefea('0x10')],_0x4dd396[_0x5bd5b2['variableName']]));}else if(_0x5bd5b2[_0xefea('0xf')]===_0xefea('0x14')&&_0x5bd5b2[_0xefea('0xa')]&&_0x5bd5b2[_0xefea('0xa')][_0xefea('0xb')]&&_0x5bd5b2[_0xefea('0x10')]){_0x4dd396[_0x5bd5b2[_0xefea('0xa')][_0xefea('0xb')][_0xefea('0xc')]()]&&_0x9e3197['push'](util[_0xefea('0x11')](_0xefea('0x12'),_0x5bd5b2['key'],_0x4dd396[_0x5bd5b2['Variable'][_0xefea('0xb')]['toLowerCase']()]));}}}}return _0x9e3197[_0xefea('0x15')](_0x36f0b0);};exports[_0xefea('0x16')]=function(_0x1905b2){var _0x26e84b=_0x1905b2[_0xefea('0x17')](-0x1);if(_0x26e84b==='/'){_0x1905b2=_0x1905b2[_0xefea('0x18')](0x0,_0x1905b2['lastIndexOf'](_0x26e84b));}return _0x1905b2;};exports['validateEmail']=function(_0x5b4edf){if(!_[_0xefea('0x19')](_0x5b4edf)&&_0x5b4edf!==''){var _0x50a1a3=/^(([^<>()\[\]\\.,;:\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 _0x50a1a3[_0xefea('0x1a')](String(_0x5b4edf)['toLowerCase']());}else{return![];}}; \ No newline at end of file +var _0xaa2f=['keyContent','keyType','push','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','isNil','test','lodash','util','getString','length','type','content','variable','variableName','customVariable','Variable','name','toLowerCase','toString','string','key','format','%s:\x20%s'];(function(_0x8d614a,_0x42b849){var _0x5b37a3=function(_0x516960){while(--_0x516960){_0x8d614a['push'](_0x8d614a['shift']());}};_0x5b37a3(++_0x42b849);}(_0xaa2f,0x76));var _0xfaa2=function(_0xc350,_0x2fb0f8){_0xc350=_0xc350-0x0;var _0x126021=_0xaa2f[_0xc350];return _0x126021;};'use strict';var _=require(_0xfaa2('0x0'));var util=require(_0xfaa2('0x1'));exports[_0xfaa2('0x2')]=function(_0x1dd079,_0x2c5c9a,_0x151170){var _0x58687c=[];if(_0x1dd079[_0xfaa2('0x3')]>0x0){var _0x2d696a=_['sortBy'](_0x1dd079,['id']);for(var _0x4ddbbb=0x0;_0x4ddbbb<_0x2d696a['length'];_0x4ddbbb++){var _0x2a3036=_0x2d696a[_0x4ddbbb];if(_0x2a3036[_0xfaa2('0x4')]==='string'){_0x58687c['push'](_0x2a3036[_0xfaa2('0x5')]);}else if(_0x2a3036[_0xfaa2('0x4')]===_0xfaa2('0x6')&&_0x2a3036[_0xfaa2('0x7')]){_0x2c5c9a[_0x2a3036['variableName']]&&_0x58687c['push'](_0x2c5c9a[_0x2a3036[_0xfaa2('0x7')]]['toString']());}else if(_0x2a3036[_0xfaa2('0x4')]===_0xfaa2('0x8')&&_0x2a3036[_0xfaa2('0x9')]&&_0x2a3036[_0xfaa2('0x9')][_0xfaa2('0xa')]){_0x2c5c9a[_0x2a3036[_0xfaa2('0x9')][_0xfaa2('0xa')][_0xfaa2('0xb')]()]&&_0x58687c['push'](_0x2c5c9a[_0x2a3036['Variable'][_0xfaa2('0xa')][_0xfaa2('0xb')]()][_0xfaa2('0xc')]());}else if(_0x2a3036[_0xfaa2('0x4')]==='keyValue'){if(_0x2a3036['keyType']===_0xfaa2('0xd')&&_0x2a3036[_0xfaa2('0xe')]){_0x58687c['push'](util[_0xfaa2('0xf')](_0xfaa2('0x10'),_0x2a3036['key'],_0x2a3036[_0xfaa2('0x11')]));}else if(_0x2a3036[_0xfaa2('0x12')]===_0xfaa2('0x6')&&_0x2a3036[_0xfaa2('0x7')]&&_0x2a3036['key']){_0x2c5c9a[_0x2a3036['variableName']]&&_0x58687c[_0xfaa2('0x13')](util[_0xfaa2('0xf')](_0xfaa2('0x10'),_0x2a3036['key'],_0x2c5c9a[_0x2a3036[_0xfaa2('0x7')]]));}else if(_0x2a3036[_0xfaa2('0x12')]==='customVariable'&&_0x2a3036['Variable']&&_0x2a3036['Variable'][_0xfaa2('0xa')]&&_0x2a3036[_0xfaa2('0xe')]){_0x2c5c9a[_0x2a3036['Variable'][_0xfaa2('0xa')][_0xfaa2('0xb')]()]&&_0x58687c[_0xfaa2('0x13')](util['format']('%s:\x20%s',_0x2a3036[_0xfaa2('0xe')],_0x2c5c9a[_0x2a3036['Variable']['name']['toLowerCase']()]));}}}}return _0x58687c['join'](_0x151170);};exports[_0xfaa2('0x14')]=function(_0x30d377){var _0x465ca5=_0x30d377[_0xfaa2('0x15')](-0x1);if(_0x465ca5==='/'){_0x30d377=_0x30d377[_0xfaa2('0x16')](0x0,_0x30d377[_0xfaa2('0x17')](_0x465ca5));}return _0x30d377;};exports[_0xfaa2('0x18')]=function(_0x54a87f){if(!_[_0xfaa2('0x19')](_0x54a87f)&&_0x54a87f!==''){var _0x5d8916=/^(([^<>()\[\]\\.,;:\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 _0x5d8916[_0xfaa2('0x1a')](String(_0x54a87f)[_0xfaa2('0xb')]());}else{return![];}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js index 9064fcf..10fdbd3 100644 --- a/server/services/ami/trigger/integration/vtiger.js +++ b/server/services/ami/trigger/integration/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['stringify','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','admin','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridnum','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','forEach','string','picklist','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','POST','remoteUri','create','username','sessionName','then','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s'];(function(_0x36c8a8,_0x261777){var _0x4d5838=function(_0x13a2b0){while(--_0x13a2b0){_0x36c8a8['push'](_0x36c8a8['shift']());}};_0x4d5838(++_0x261777);}(_0x9c44,0x178));var _0x49c4=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x9c44[_0x17b6e3];return _0x3906f3;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var util=require(_0x49c4('0x2'));var Redis=require(_0x49c4('0x3'));var intUtil=require(_0x49c4('0x4'));var config=require(_0x49c4('0x5'));var logger=require('../../../../config/logger')('vTiger');config[_0x49c4('0x6')]=_['defaults'](config[_0x49c4('0x6')],{'host':_0x49c4('0x7'),'port':0x18eb});var io=require(_0x49c4('0x8'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x436234,_0x511d53,_0x11c586){io['to'](_0x436234)[_0x49c4('0x9')](_0x511d53,_0x11c586);}function getCustomFields(_0x1d13fb,_0x4487ca){var _0x4c7d3a={};if(_0x1d13fb['length']>0x0){_[_0x49c4('0xa')](_0x1d13fb,function(_0x313e73){if(_['includes']([_0x49c4('0xb'),_0x49c4('0xc')],_0x313e73['type'])&&_0x313e73['idField']){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x313e73[_0x49c4('0xe')]['toString']();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x10')&&_0x313e73['variableName']&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x11')]]){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x4487ca[_0x313e73[_0x49c4('0x11')]][_0x49c4('0x12')]();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x13')&&_0x313e73[_0x49c4('0x14')]&&_0x313e73['Variable'][_0x49c4('0x15')]&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')][_0x49c4('0x16')]()]){_0x4c7d3a[_0x313e73['idField']]=_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')]['toLowerCase']()]['toString']();}});}return _0x4c7d3a;}function createTicket(_0x3c782d,_0x2f82d5,_0x3addb2,_0x59f29b,_0x24856d,_0x50b151,_0x2cbd50){logger[_0x49c4('0x17')](_0x49c4('0x18'));var _0x291526=_[_0x49c4('0x19')]({'parent_id':'','assigned_user_id':_0x2f82d5['id'],'ticketpriorities':_0x49c4('0x1a'),'ticketstatus':_0x49c4('0x1b'),'ticket_title':intUtil[_0x49c4('0x1c')](_0x59f29b[_0x49c4('0x1d')],_0x24856d,'\x20'),'description':intUtil['getString'](_0x59f29b['Descriptions'],_0x24856d,'\x0a'),'contact_id':_0x3addb2['id']},getCustomFields(_0x50b151,_0x24856d));var _0x57f502={'method':_0x49c4('0x1e'),'uri':util['format']('%s/webservice.php',_0x3c782d[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x20'),'username':_0x3c782d[_0x49c4('0x21')],'sessionName':_0x2cbd50[_0x49c4('0x22')],'elementType':'HelpDesk','element':JSON['stringify'](_0x291526)},'json':!![]};return request(_0x57f502)[_0x49c4('0x23')](function(_0x9cb797){if(_0x9cb797['success']){return BPromise[_0x49c4('0x24')]({'id':_0x9cb797[_0x49c4('0x25')]['id']});}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x27'),JSON['stringify'](_0x9cb797['error'])));}})[_0x49c4('0x28')](function(_0x53c199){var _0x3800b7=_0x53c199[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'createTicket',_0x3800b7,JSON[_0x49c4('0x2c')](_0x53c199));});}function getUser(_0x2b2793,_0x46e04d,_0x4f28a2){if(intUtil[_0x49c4('0x2d')](_0x46e04d)){logger[_0x49c4('0x17')](_0x49c4('0x2e'),_0x46e04d);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2b2793[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x2b2793['username'],'sessionName':_0x4f28a2['sessionName'],'query':util[_0x49c4('0x26')](_0x49c4('0x31'),_0x46e04d)},'json':!![]})[_0x49c4('0x23')](function(_0x27e467){if(_0x27e467[_0x49c4('0x32')]&&_0x27e467['result'][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x34'));return BPromise[_0x49c4('0x24')]({'id':_0x27e467['result'][0x0]['id'],'email':_0x27e467['result'][0x0][_0x49c4('0x35')],'name':_0x27e467[_0x49c4('0x25')][0x0][_0x49c4('0x36')]+'\x20'+_0x27e467[_0x49c4('0x25')][_0x49c4('0x37')]});}else{logger['info'](_0x49c4('0x38'));return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2[_0x49c4('0x39')],'email':_0x2b2793['username'],'name':'admin'});}})[_0x49c4('0x28')](function(_0x1991e9){var _0x3bec0a=_0x1991e9[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x3a'),_0x3bec0a,JSON[_0x49c4('0x2c')](_0x1991e9));});}else{logger[_0x49c4('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2['userId'],'email':_0x2b2793[_0x49c4('0x21')],'name':_0x49c4('0x3b')})[_0x49c4('0x28')](function(_0x1c2830){var _0x4ed4f8=_0x1c2830[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'getUser',_0x4ed4f8,JSON[_0x49c4('0x2c')](_0x1c2830));});}}function getEndUser(_0x21d8c7,_0x178987,_0x5e5366,_0x1ba7a0){logger[_0x49c4('0x17')](_0x49c4('0x3c'),_0x5e5366);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x21d8c7[_0x49c4('0x21')],'sessionName':_0x1ba7a0[_0x49c4('0x22')],'query':util[_0x49c4('0x26')](_0x49c4('0x3d'),_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366)},'json':!![]})[_0x49c4('0x23')](function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x32')]&&_0x29dd5d[_0x49c4('0x25')][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x3e'));return BPromise[_0x49c4('0x24')]({'id':_0x29dd5d[_0x49c4('0x25')][0x0]['id'],'name':_0x29dd5d['result'][0x0][_0x49c4('0x3f')]+'\x20'+_0x29dd5d['result'][0x0][_0x49c4('0x40')],'phone':_0x5e5366});}else{logger[_0x49c4('0x17')](_0x49c4('0x41'));return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7['remoteUri']),'form':{'operation':'create','sessionName':_0x1ba7a0[_0x49c4('0x22')],'elementType':_0x49c4('0x42'),'element':JSON[_0x49c4('0x2c')]({'lastname':_0x178987,'phone':_0x5e5366,'assigned_user_id':'\x20'})},'json':!![]})[_0x49c4('0x23')](function(_0x490823){logger[_0x49c4('0x17')](_0x49c4('0x43'));return BPromise[_0x49c4('0x24')]({'id':_0x490823[_0x49c4('0x25')]['id'],'name':_0x490823[_0x49c4('0x25')][_0x49c4('0x40')],'phone':_0x490823[_0x49c4('0x25')][_0x49c4('0x44')]});})[_0x49c4('0x28')](function(_0x5640d3){var _0x2ad771=_0x5640d3['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x45'),_0x2ad771,JSON[_0x49c4('0x2c')](_0x5640d3));});}});}function getConnection(_0x2d93d8){var _0x5b296d=_0x2d93d8[_0x49c4('0x21')];var _0x15b674=_0x2d93d8[_0x49c4('0x46')];return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'qs':{'operation':'getchallenge','username':_0x5b296d},'json':!![]})[_0x49c4('0x23')](function(_0x5cfff9){if(_0x5cfff9[_0x49c4('0x32')]){return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x47'),'username':_0x5b296d,'accessKey':md5(_0x5cfff9[_0x49c4('0x25')]['token']+_0x15b674)},'json':!![]});}})[_0x49c4('0x23')](function(_0x3feaf0){if(_0x3feaf0['success']){return BPromise[_0x49c4('0x24')](_0x3feaf0[_0x49c4('0x25')]);}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x48'),_0x2d93d8['id']));}})['catch'](function(_0x5d8bf0){var _0x144fd2=_0x5d8bf0['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x49'),_0x144fd2,JSON[_0x49c4('0x2c')](_0x5d8bf0));});}function request(_0x240c20){logger[_0x49c4('0x17')](_0x49c4('0x4a'),JSON['stringify'](_0x240c20));return rp(_0x240c20);}exports[_0x49c4('0x4b')]=function(_0x1550ce,_0x3936d3,_0x3d944c,_0x17ef75,_0x2644c0,_0x156748){var _0x25d174,_0x1e0b4f,_0x1856be,_0x5b822f;_0x156748['remoteUri']=intUtil[_0x49c4('0x4c')](_0x156748[_0x49c4('0x1f')]);if(_0x2644c0&&_0x2644c0['monitor_format']){logger['info'](_0x49c4('0x4d'),'Recording\x20is\x20enabled!');_0x3936d3['recordingURL']=util[_0x49c4('0x26')](_0x49c4('0x4e'),_0x156748[_0x49c4('0x4f')],_0x3936d3[_0x49c4('0x50')],md5(_0x3936d3[_0x49c4('0x50')]));}else{_0x3936d3[_0x49c4('0x51')]='';}return getConnection(_0x156748)[_0x49c4('0x23')](function(_0x50798e){_0x5b822f=_0x50798e;return getUser(_0x156748,_0x17ef75[_0x49c4('0x52')],_0x5b822f);})[_0x49c4('0x23')](function(_0x207572){_0x25d174=_0x207572;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x25d174['id']);return getEndUser(_0x156748,_0x3936d3[_0x49c4('0x54')],_0x3936d3['calleridnum'],_0x5b822f);})['then'](function(_0x1ef0c1){_0x1e0b4f=_0x1ef0c1;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0x1e0b4f['id']);return createTicket(_0x156748,_0x25d174,_0x1e0b4f,_0x3d944c,_0x3936d3,_0x3d944c[_0x49c4('0x56')],_0x5b822f);})[_0x49c4('0x23')](function(_0x6b2592){_0x1856be=_0x6b2592;logger[_0x49c4('0x17')]('Ticket\x20created!');logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x1856be['id']);var _0x4ba4eb=util[_0x49c4('0x26')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x156748[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x1856be['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x4d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x17ef75[_0x49c4('0x15')]),'trigger:browser:url',{'uri':_0x4ba4eb});})[_0x49c4('0x28')](function(_0x27b9c2){logger['error'](_0x49c4('0x4d'),JSON[_0x49c4('0x2c')](_0x27b9c2));});};exports['outbound']=function(_0x39c455,_0x42e0e6,_0x4f50bf,_0x4dc54d,_0x589484,_0x513879,_0xc43386){var _0x54947d,_0xb20a5d,_0x32f344,_0x515240;_0x513879[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x513879['remoteUri']);_0x513879[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x513879[_0x49c4('0x4f')]);if(_0xc43386&&_0xc43386[_0x49c4('0x5b')]&&_0xc43386['recordingFormat']!==_0x49c4('0x5c')){logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x5e'));_0x42e0e6['recordingURL']=util[_0x49c4('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x513879['serverUrl'],_0x42e0e6['uniqueid'],md5(_0x42e0e6['uniqueid']));}return getConnection(_0x513879)[_0x49c4('0x23')](function(_0x32eaef){_0x515240=_0x32eaef;return getUser(_0x513879,_0x4dc54d[_0x49c4('0x52')],_0x515240);})[_0x49c4('0x23')](function(_0x5b056e){_0x54947d=_0x5b056e;logger['info'](_0x49c4('0x53'),_0x54947d['id']);return getEndUser(_0x513879,_0x42e0e6[_0x49c4('0x5f')],_0x42e0e6[_0x49c4('0x60')],_0x515240);})[_0x49c4('0x23')](function(_0x102c15){_0xb20a5d=_0x102c15;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0xb20a5d['id']);return createTicket(_0x513879,_0x54947d,_0xb20a5d,_0x4f50bf,_0x42e0e6,_0x4f50bf[_0x49c4('0x56')],_0x515240);})['then'](function(_0x2276db){_0x32f344=_0x2276db;logger['info'](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x32f344['id']);var _0x1ea1b4=util[_0x49c4('0x26')](_0x49c4('0x62'),_0x513879[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x32f344['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x4dc54d[_0x49c4('0x15')]),_0x49c4('0x63'),{'uri':_0x1ea1b4});})[_0x49c4('0x28')](function(_0x371e49){logger[_0x49c4('0x2a')]('[OUTBOUND]',JSON['stringify'](_0x371e49));});};exports[_0x49c4('0x64')]=function(_0x16b3e8,_0x4af680,_0x1a15f3,_0x38ad50,_0x2939fd,_0x16e7b1){var _0x4d6aaa,_0x5a14a5,_0x4a85d4,_0x2e90d8;_0x16e7b1[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x1f')]);_0x16e7b1[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x4f')]);if(_0x2939fd&&_0x2939fd[_0x49c4('0x65')]){logger[_0x49c4('0x17')]('['+_0x4af680['lastevent'][_0x49c4('0x66')]()+']',_0x49c4('0x5e'));_0x4af680[_0x49c4('0x51')]=util['format'](_0x49c4('0x4e'),_0x16e7b1[_0x49c4('0x4f')],_0x4af680[_0x49c4('0x50')],md5(_0x4af680[_0x49c4('0x50')]));}else{_0x4af680[_0x49c4('0x51')]='';}return getConnection(_0x16e7b1)[_0x49c4('0x23')](function(_0x35fa39){_0x2e90d8=_0x35fa39;return getUser(_0x16e7b1,'',_0x2e90d8);})[_0x49c4('0x23')](function(_0x4ba198){_0x4d6aaa=_0x4ba198;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x4d6aaa['id']);return getEndUser(_0x16e7b1,_0x4af680[_0x49c4('0x54')],_0x4af680[_0x49c4('0x67')],_0x2e90d8);})[_0x49c4('0x23')](function(_0x4a204d){_0x5a14a5=_0x4a204d;logger['info'](_0x49c4('0x55'),_0x5a14a5['id']);return createTicket(_0x16e7b1,_0x4d6aaa,_0x5a14a5,_0x1a15f3,_0x4af680,_0x1a15f3['Fields'],_0x2e90d8);})[_0x49c4('0x23')](function(_0x558880){_0x4a85d4=_0x558880;logger[_0x49c4('0x17')](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x4a85d4['id']);})['catch'](function(_0x123060){logger[_0x49c4('0x2a')]('['+_0x4af680[_0x49c4('0x68')][_0x49c4('0x66')]()+']',JSON[_0x49c4('0x2c')](_0x123060));});}; \ No newline at end of file +var _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index 738dcc9..5cd7c75 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 _0xc865=['The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/agent/tickets/%s','replace','/api/v2','catch','error','inspect','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','email','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','integrationTab','newTab','trigger:browser:url','Zendesk\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','request-promise','md5','util','ioredis','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','Tags','name','getString','Subjects','Descriptions','Fields','Ticket\x20created!','ticket','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','count','find','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','then','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','results','filter','end-user','first','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Enduser\x20created.','authType','password','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','[HTTP]','stringify','length','map','includes','picklist','type','nameField','customField','toLowerCase','idField','custom_fields','content','variable','variableName','Variable','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization'];(function(_0x348548,_0x56bd89){var _0xb529e5=function(_0x3420c2){while(--_0x3420c2){_0x348548['push'](_0x348548['shift']());}};_0xb529e5(++_0x56bd89);}(_0xc865,0xf9));var _0x5c86=function(_0x334562,_0x1ff5d8){_0x334562=_0x334562-0x0;var _0x2c1d2b=_0xc865[_0x334562];return _0x2c1d2b;};'use strict';var _=require('lodash');var rp=require(_0x5c86('0x0'));var md5=require(_0x5c86('0x1'));var util=require(_0x5c86('0x2'));var Redis=require(_0x5c86('0x3'));var intUtil=require('./util');var config=require(_0x5c86('0x4'));var logger=require(_0x5c86('0x5'))(_0x5c86('0x6'));config[_0x5c86('0x7')]=_[_0x5c86('0x8')](config[_0x5c86('0x7')],{'host':_0x5c86('0x9'),'port':0x18eb});var io=require(_0x5c86('0xa'))(new Redis(config[_0x5c86('0x7')]));function emit(_0x20c499,_0x4df25c,_0x497cf9){io['to'](_0x20c499)[_0x5c86('0xb')](_0x4df25c,_0x497cf9);}var headers={'Content-Type':_0x5c86('0xc'),'Accept':_0x5c86('0xc')};function getTicket(_0x15b53f,_0x13633f,_0x26eca6,_0x17793f,_0x19d3f2){logger[_0x5c86('0xd')](_0x5c86('0xe'));return request({'uri':util[_0x5c86('0xf')](_0x5c86('0x10'),_0x15b53f[_0x5c86('0x11')]),'method':_0x5c86('0x12'),'body':{'ticket':_['merge']({'requester_id':_0x26eca6['id'],'submitter_id':_0x13633f?_0x13633f['id']:undefined,'assignee_id':_0x13633f?_0x13633f['id']:undefined,'tags':getTags(_0x17793f[_0x5c86('0x13')],_0x5c86('0x14')),'subject':intUtil[_0x5c86('0x15')](_0x17793f[_0x5c86('0x16')],_0x19d3f2,'\x20'),'description':intUtil['getString'](_0x17793f[_0x5c86('0x17')],_0x19d3f2,'\x0a'),'comment':{'public':![],'body':intUtil[_0x5c86('0x15')](_0x17793f['Descriptions'],_0x19d3f2,'\x0a')}},getCustomFields(_0x17793f[_0x5c86('0x18')],_0x19d3f2))}})['then'](function(_0x3bb9f1){logger['info'](_0x5c86('0x19'));return _0x3bb9f1[_0x5c86('0x1a')];});}function getUser(_0x40f6dc,_0xe5e2b){if(intUtil['validateEmail'](_0xe5e2b)){logger['info'](_0x5c86('0x1b'),_0xe5e2b);return request({'uri':util[_0x5c86('0xf')](_0x5c86('0x1c'),_0x40f6dc[_0x5c86('0x11')]),'qs':{'query':util[_0x5c86('0xf')](_0x5c86('0x1d'),_0xe5e2b)}})['then'](function(_0x24dde6){if(_0x24dde6[_0x5c86('0x1e')]){logger['info']('Agent\x20found!');return _[_0x5c86('0x1f')](_0x24dde6['results'],{'email':_0xe5e2b,'role':_0x5c86('0x20')});}else{logger[_0x5c86('0xd')](_0x5c86('0x21'));return request({'uri':util[_0x5c86('0xf')](_0x5c86('0x22'),_0x40f6dc[_0x5c86('0x11')])})[_0x5c86('0x23')](function(_0xb201a3){logger[_0x5c86('0xd')](_0x5c86('0x24'));return _0xb201a3[_0x5c86('0x25')];});}});}else{logger[_0x5c86('0xd')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x5c86('0xf')](_0x5c86('0x22'),_0x40f6dc[_0x5c86('0x11')])})[_0x5c86('0x23')](function(_0x178e95){logger['info'](_0x5c86('0x24'));return _0x178e95['user'];});}}function getEndUser(_0x5129c0,_0x32666b,_0x4afde7){logger[_0x5c86('0xd')](_0x5c86('0x26'),_0x4afde7);return request({'uri':util[_0x5c86('0xf')](_0x5c86('0x1c'),_0x5129c0[_0x5c86('0x11')]),'qs':{'query':util[_0x5c86('0xf')]('type:user\x20role:end-user\x20phone:%s',_0x4afde7)}})[_0x5c86('0x23')](function(_0x581641){var _0xfd19f6;if(_0x581641['results']['length']){_0x581641[_0x5c86('0x27')]=_[_0x5c86('0x28')](_0x581641[_0x5c86('0x27')],{'suspended':![],'role':_0x5c86('0x29')});if(_0x581641[_0x5c86('0x27')]['length']){_0xfd19f6=_[_0x5c86('0x2a')](_0x581641[_0x5c86('0x27')]);}}if(_0xfd19f6){logger['info']('Enduser\x20found!');return _0xfd19f6;}else{logger[_0x5c86('0xd')](_0x5c86('0x2b'));return request({'uri':util[_0x5c86('0xf')](_0x5c86('0x2c'),_0x5129c0['remoteUri']),'method':_0x5c86('0x12'),'body':{'user':{'role':_0x5c86('0x29'),'name':util[_0x5c86('0xf')]('Caller\x20-\x20%s',_0x32666b||_0x4afde7),'phone':_0x4afde7}}})['then'](function(_0x5147af){logger[_0x5c86('0xd')](_0x5c86('0x2d'));return _0x5147af[_0x5c86('0x25')];});}});}function getAuth(_0x22afc1){var _0x32ce05;if(_0x22afc1[_0x5c86('0x2e')]===_0x5c86('0x2f')){_0x32ce05=util[_0x5c86('0xf')](_0x5c86('0x30'),_0x22afc1[_0x5c86('0x31')],_0x22afc1['password']);}else if(_0x22afc1[_0x5c86('0x2e')]===_0x5c86('0x32')){_0x32ce05=util[_0x5c86('0xf')](_0x5c86('0x33'),_0x22afc1[_0x5c86('0x31')],_0x22afc1[_0x5c86('0x32')]);}return util[_0x5c86('0xf')](_0x5c86('0x34'),new Buffer(_0x32ce05)[_0x5c86('0x35')]('base64'));}function request(_0x1cd515){logger['debug'](_0x5c86('0x36'),JSON[_0x5c86('0x37')](_0x1cd515));return rp(_['defaults'](_0x1cd515,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x49f6e0,_0x12118c){var _0x439b14=[];if(_0x49f6e0&&_0x49f6e0[_0x5c86('0x38')]>0x0){_0x439b14=_[_0x5c86('0x39')](_0x49f6e0,_0x12118c);}return _0x439b14;}function getCustomFields(_0x46faf1,_0x310fd7){var _0x353369=[];var _0x89136b={'custom_fields':[]};if(_0x46faf1[_0x5c86('0x38')]>0x0){_['forEach'](_0x46faf1,function(_0x2e8489){if(_[_0x5c86('0x3a')](['string',_0x5c86('0x3b')],_0x2e8489[_0x5c86('0x3c')])&&_0x2e8489[_0x5c86('0x3d')]&&!_0x2e8489[_0x5c86('0x3e')]){_0x89136b[_0x2e8489[_0x5c86('0x3d')][_0x5c86('0x3f')]()]=_0x2e8489['content'][_0x5c86('0x35')]();}else if(_[_0x5c86('0x3a')](['string',_0x5c86('0x3b')],_0x2e8489[_0x5c86('0x3c')])&&_0x2e8489[_0x5c86('0x40')]&&_0x2e8489['customField']){_0x89136b[_0x5c86('0x41')]['push']({'id':_0x2e8489['idField'],'value':_0x2e8489[_0x5c86('0x42')][_0x5c86('0x35')]()});}else if(_0x2e8489[_0x5c86('0x3c')]===_0x5c86('0x43')&&_0x2e8489[_0x5c86('0x44')]&&_0x2e8489[_0x5c86('0x40')]&&_0x2e8489['customField']){_0x310fd7[_0x2e8489['variableName']]&&_0x89136b[_0x5c86('0x41')]['push']({'id':_0x2e8489[_0x5c86('0x40')],'value':_0x310fd7[_0x2e8489[_0x5c86('0x44')]]['toString']()});}else if(_0x2e8489['type']==='customVariable'&&_0x2e8489[_0x5c86('0x45')]&&_0x2e8489[_0x5c86('0x45')][_0x5c86('0x14')]&&_0x2e8489[_0x5c86('0x40')]&&_0x2e8489[_0x5c86('0x3e')]){_0x310fd7[_0x2e8489['Variable']['name'][_0x5c86('0x3f')]()]&&_0x89136b[_0x5c86('0x41')]['push']({'id':_0x2e8489[_0x5c86('0x40')],'value':_0x310fd7[_0x2e8489['Variable'][_0x5c86('0x14')][_0x5c86('0x3f')]()]['toString']()});}});}return _0x89136b;}exports['queue']=function(_0x4c832a,_0x379f9b,_0xe639d5,_0x4aff0b,_0x481736,_0x5d0ed9){var _0x4e7e0b,_0x3e2fc6;_0x5d0ed9[_0x5c86('0x11')]=intUtil[_0x5c86('0x46')](_0x5d0ed9['remoteUri']);_0x5d0ed9[_0x5c86('0x47')]=intUtil[_0x5c86('0x46')](_0x5d0ed9[_0x5c86('0x47')]);if(_0x481736&&_0x481736[_0x5c86('0x48')]){logger[_0x5c86('0xd')](_0x5c86('0x49'),'Recording\x20is\x20enabled!');_0x379f9b[_0x5c86('0x4a')]=util['format'](_0x5c86('0x4b'),_0x5d0ed9[_0x5c86('0x47')],_0x379f9b[_0x5c86('0x4c')],md5(_0x379f9b[_0x5c86('0x4c')]));}else{_0x379f9b['recordingURL']='';}headers[_0x5c86('0x4d')]=getAuth(_0x5d0ed9);return getUser(_0x5d0ed9,_0x4aff0b['email'])[_0x5c86('0x23')](function(_0x1d2e60){_0x4e7e0b=_0x1d2e60;logger[_0x5c86('0xd')](_0x5c86('0x4e'),_0x4e7e0b['id']);return getEndUser(_0x5d0ed9,_0x379f9b[_0x5c86('0x4f')],_0x379f9b[_0x5c86('0x50')]);})[_0x5c86('0x23')](function(_0x2a10c7){_0x3e2fc6=_0x2a10c7;logger[_0x5c86('0xd')](_0x5c86('0x51'),_0x3e2fc6['id']);return getTicket(_0x5d0ed9,_0x4e7e0b,_0x3e2fc6,_0xe639d5,_0x379f9b);})['then'](function(_0x51e15a){if(_0x51e15a){logger[_0x5c86('0xd')]('The\x20Ticket\x20ID\x20is:',_0x51e15a['id']);switch(_0x5d0ed9[_0x5c86('0x3c')]){case'integrationTab':logger[_0x5c86('0xd')]('[QUEUE]',_0x5c86('0x52'));return request({'uri':util[_0x5c86('0xf')](_0x5c86('0x53'),_0x5d0ed9[_0x5c86('0x11')],_0x4e7e0b['id'],_0x51e15a['id']),'method':_0x5c86('0x12')});case'newTab':logger[_0x5c86('0xd')](_0x5c86('0x49'),_0x5c86('0x54'));emit(util[_0x5c86('0xf')](_0x5c86('0x55'),_0x4aff0b[_0x5c86('0x14')]),'trigger:browser:url',{'uri':util[_0x5c86('0xf')](_0x5c86('0x56'),_0x5d0ed9[_0x5c86('0x11')][_0x5c86('0x57')](_0x5c86('0x58'),''),_0x51e15a['id'])});break;default:logger['error'](_0x5c86('0x49'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x5c86('0x59')](function(_0x36f91d){logger[_0x5c86('0x5a')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0x5c86('0x5b')](_0x36f91d,{'showHidden':!![],'depth':null}));});};exports[_0x5c86('0x5c')]=function(_0x25566d,_0x3dc10c,_0x2bf9a3,_0x44ef86,_0x2d6291,_0xaedd44,_0x440551){var _0x771ded,_0x48858f;_0xaedd44[_0x5c86('0x11')]=intUtil['stripTrailingSlash'](_0xaedd44[_0x5c86('0x11')]);_0xaedd44[_0x5c86('0x47')]=intUtil[_0x5c86('0x46')](_0xaedd44[_0x5c86('0x47')]);if(_0x440551&&_0x440551[_0x5c86('0x5d')]&&_0x440551[_0x5c86('0x5d')]!==_0x5c86('0x5e')){logger[_0x5c86('0xd')](_0x5c86('0x5f'),_0x5c86('0x60'));_0x3dc10c[_0x5c86('0x4a')]=util['format'](_0x5c86('0x4b'),_0xaedd44[_0x5c86('0x47')],_0x3dc10c[_0x5c86('0x4c')],md5(_0x3dc10c[_0x5c86('0x4c')]));}headers[_0x5c86('0x4d')]=getAuth(_0xaedd44);return getUser(_0xaedd44,_0x44ef86[_0x5c86('0x61')])['then'](function(_0xed888c){_0x771ded=_0xed888c;logger[_0x5c86('0xd')]('The\x20User\x20ID\x20is:',_0x771ded['id']);return getEndUser(_0xaedd44,_0x3dc10c[_0x5c86('0x62')],_0x3dc10c[_0x5c86('0x63')]);})[_0x5c86('0x23')](function(_0x439f2b){_0x48858f=_0x439f2b;logger['info']('The\x20Enduser\x20ID\x20is:',_0x48858f['id']);return getTicket(_0xaedd44,_0x771ded,_0x48858f,_0x2bf9a3,_0x3dc10c);})[_0x5c86('0x23')](function(_0x8f0392){if(_0x8f0392){logger[_0x5c86('0xd')](_0x5c86('0x64'),_0x8f0392['id']);switch(_0xaedd44[_0x5c86('0x3c')]){case _0x5c86('0x65'):logger[_0x5c86('0xd')]('[OUTBOUND]',_0x5c86('0x52'));return request({'uri':util[_0x5c86('0xf')](_0x5c86('0x53'),_0xaedd44[_0x5c86('0x11')],_0x771ded['id'],_0x8f0392['id']),'method':_0x5c86('0x12')});case _0x5c86('0x66'):logger[_0x5c86('0xd')](_0x5c86('0x5f'),_0x5c86('0x54'));emit(util[_0x5c86('0xf')](_0x5c86('0x55'),_0x44ef86[_0x5c86('0x14')]),_0x5c86('0x67'),{'uri':util[_0x5c86('0xf')]('%s/agent/tickets/%s',_0xaedd44[_0x5c86('0x11')][_0x5c86('0x57')](_0x5c86('0x58'),''),_0x8f0392['id'])});break;default:logger[_0x5c86('0x5a')](_0x5c86('0x5f'),_0x5c86('0x68'));}}})[_0x5c86('0x59')](function(_0x3d655a){logger[_0x5c86('0x5a')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x3d655a,{'showHidden':!![],'depth':null}));});};exports[_0x5c86('0x69')]=function(_0x2d0f7f,_0x2c5195,_0x293684,_0x576e44,_0x58cbe5,_0x35e2d7){var _0x3a0209,_0x575962;_0x35e2d7[_0x5c86('0x11')]=intUtil['stripTrailingSlash'](_0x35e2d7[_0x5c86('0x11')]);_0x35e2d7[_0x5c86('0x47')]=intUtil[_0x5c86('0x46')](_0x35e2d7[_0x5c86('0x47')]);if(_0x58cbe5&&_0x58cbe5['monitor_format']){logger[_0x5c86('0xd')]('['+_0x2c5195[_0x5c86('0x6a')][_0x5c86('0x6b')]()+']','Recording\x20is\x20enabled!');_0x2c5195[_0x5c86('0x4a')]=util[_0x5c86('0xf')](_0x5c86('0x4b'),_0x35e2d7[_0x5c86('0x47')],_0x2c5195[_0x5c86('0x4c')],md5(_0x2c5195['uniqueid']));}else{_0x2c5195[_0x5c86('0x4a')]='';}headers['Authorization']=getAuth(_0x35e2d7);return getUser(_0x35e2d7)[_0x5c86('0x23')](function(_0x1697d5){_0x3a0209=_0x1697d5;logger[_0x5c86('0xd')](_0x5c86('0x4e'),_0x3a0209['id']);return getEndUser(_0x35e2d7,_0x2c5195[_0x5c86('0x4f')],_0x2c5195[_0x5c86('0x50')]);})[_0x5c86('0x23')](function(_0x4b7302){_0x575962=_0x4b7302;logger[_0x5c86('0xd')](_0x5c86('0x51'),_0x575962['id']);return getTicket(_0x35e2d7,_0x3a0209,_0x575962,_0x293684,_0x2c5195);})[_0x5c86('0x23')](function(_0x281bf5){if(_0x281bf5){logger[_0x5c86('0xd')](_0x5c86('0x64'),_0x281bf5['id']);}})['catch'](function(_0x410046){logger[_0x5c86('0x5a')]('['+_0x2c5195['lastevent']['toUpperCase']()+']'+_0x5c86('0x6c'),util['inspect'](_0x410046,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xf202=['custom_fields','push','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','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...','user:%s','trigger:browser:url','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','inspect','recordingFormat','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','%s/agent/tickets/%s','replace','catch','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','calleridname','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','ioredis','./util','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','remoteUri','merge','Tags','name','Subjects','getString','Descriptions','then','Ticket\x20created!','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','end-user','length','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','POST','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','%s/token:%s','Basic\x20%s','toString','base64','[HTTP]','GET','map','forEach','string','type','nameField','toLowerCase','content','includes','picklist','idField','customField','variable','variableName'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xf202,0x17a));var _0x2f20=function(_0x406341,_0x3ac078){_0x406341=_0x406341-0x0;var _0x21659f=_0xf202[_0x406341];return _0x21659f;};'use strict';var _=require(_0x2f20('0x0'));var rp=require(_0x2f20('0x1'));var md5=require(_0x2f20('0x2'));var util=require(_0x2f20('0x3'));var Redis=require(_0x2f20('0x4'));var intUtil=require(_0x2f20('0x5'));var config=require('../../../../config/environment');var logger=require(_0x2f20('0x6'))(_0x2f20('0x7'));config[_0x2f20('0x8')]=_[_0x2f20('0x9')](config[_0x2f20('0x8')],{'host':_0x2f20('0xa'),'port':0x18eb});var io=require(_0x2f20('0xb'))(new Redis(config[_0x2f20('0x8')]));function emit(_0xdad71e,_0x154a70,_0x5a8087){io['to'](_0xdad71e)[_0x2f20('0xc')](_0x154a70,_0x5a8087);}var headers={'Content-Type':_0x2f20('0xd'),'Accept':_0x2f20('0xd')};function getTicket(_0x2586eb,_0x12135b,_0x17807a,_0x8936d5,_0xcf83b3){logger[_0x2f20('0xe')](_0x2f20('0xf'));return request({'uri':util[_0x2f20('0x10')]('%s/tickets.json',_0x2586eb[_0x2f20('0x11')]),'method':'POST','body':{'ticket':_[_0x2f20('0x12')]({'requester_id':_0x17807a['id'],'submitter_id':_0x12135b?_0x12135b['id']:undefined,'assignee_id':_0x12135b?_0x12135b['id']:undefined,'tags':getTags(_0x8936d5[_0x2f20('0x13')],_0x2f20('0x14')),'subject':intUtil['getString'](_0x8936d5[_0x2f20('0x15')],_0xcf83b3,'\x20'),'description':intUtil[_0x2f20('0x16')](_0x8936d5['Descriptions'],_0xcf83b3,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x8936d5[_0x2f20('0x17')],_0xcf83b3,'\x0a')}},getCustomFields(_0x8936d5['Fields'],_0xcf83b3))}})[_0x2f20('0x18')](function(_0x326c22){logger[_0x2f20('0xe')](_0x2f20('0x19'));return _0x326c22['ticket'];});}function getUser(_0x2f5b99,_0x2a6721){if(intUtil[_0x2f20('0x1a')](_0x2a6721)){logger[_0x2f20('0xe')](_0x2f20('0x1b'),_0x2a6721);return request({'uri':util[_0x2f20('0x10')](_0x2f20('0x1c'),_0x2f5b99['remoteUri']),'qs':{'query':util[_0x2f20('0x10')](_0x2f20('0x1d'),_0x2a6721)}})['then'](function(_0x3d71c6){if(_0x3d71c6['count']){logger[_0x2f20('0xe')]('Agent\x20found!');return _[_0x2f20('0x1e')](_0x3d71c6[_0x2f20('0x1f')],{'email':_0x2a6721,'role':_0x2f20('0x20')});}else{logger[_0x2f20('0xe')](_0x2f20('0x21'));return request({'uri':util[_0x2f20('0x10')](_0x2f20('0x22'),_0x2f5b99[_0x2f20('0x11')])})[_0x2f20('0x18')](function(_0x37d22a){logger[_0x2f20('0xe')](_0x2f20('0x23'));return _0x37d22a[_0x2f20('0x24')];});}});}else{logger[_0x2f20('0xe')](_0x2f20('0x21'));return request({'uri':util[_0x2f20('0x10')](_0x2f20('0x22'),_0x2f5b99[_0x2f20('0x11')])})[_0x2f20('0x18')](function(_0x3cb142){logger[_0x2f20('0xe')](_0x2f20('0x23'));return _0x3cb142[_0x2f20('0x24')];});}}function getEndUser(_0x2d7d51,_0x1d2785,_0x3d2ac1){logger[_0x2f20('0xe')](_0x2f20('0x25'),_0x3d2ac1);return request({'uri':util['format'](_0x2f20('0x1c'),_0x2d7d51['remoteUri']),'qs':{'query':util['format']('type:user\x20role:end-user\x20phone:%s',_0x3d2ac1)}})['then'](function(_0x58a24d){var _0x26c79d;if(_0x58a24d['results']['length']){_0x58a24d[_0x2f20('0x1f')]=_['filter'](_0x58a24d[_0x2f20('0x1f')],{'suspended':![],'role':_0x2f20('0x26')});if(_0x58a24d[_0x2f20('0x1f')][_0x2f20('0x27')]){_0x26c79d=_[_0x2f20('0x28')](_0x58a24d['results']);}}if(_0x26c79d){logger['info'](_0x2f20('0x29'));return _0x26c79d;}else{logger[_0x2f20('0xe')](_0x2f20('0x2a'));return request({'uri':util[_0x2f20('0x10')](_0x2f20('0x2b'),_0x2d7d51[_0x2f20('0x11')]),'method':_0x2f20('0x2c'),'body':{'user':{'role':_0x2f20('0x26'),'name':util[_0x2f20('0x10')](_0x2f20('0x2d'),_0x1d2785||_0x3d2ac1),'phone':_0x3d2ac1}}})['then'](function(_0x568208){logger['info'](_0x2f20('0x2e'));return _0x568208[_0x2f20('0x24')];});}});}function getAuth(_0x4f37cb){var _0x19db06;if(_0x4f37cb[_0x2f20('0x2f')]===_0x2f20('0x30')){_0x19db06=util[_0x2f20('0x10')](_0x2f20('0x31'),_0x4f37cb[_0x2f20('0x32')],_0x4f37cb[_0x2f20('0x30')]);}else if(_0x4f37cb[_0x2f20('0x2f')]==='token'){_0x19db06=util['format'](_0x2f20('0x33'),_0x4f37cb['username'],_0x4f37cb['token']);}return util[_0x2f20('0x10')](_0x2f20('0x34'),new Buffer(_0x19db06)[_0x2f20('0x35')](_0x2f20('0x36')));}function request(_0x791525){logger['debug'](_0x2f20('0x37'),JSON['stringify'](_0x791525));return rp(_['defaults'](_0x791525,{'method':_0x2f20('0x38'),'headers':headers,'json':!![]}));}function getTags(_0x3e6507,_0x3ed17d){var _0xbb9251=[];if(_0x3e6507&&_0x3e6507[_0x2f20('0x27')]>0x0){_0xbb9251=_[_0x2f20('0x39')](_0x3e6507,_0x3ed17d);}return _0xbb9251;}function getCustomFields(_0x3810aa,_0x2133ab){var _0x49beb9=[];var _0x307c07={'custom_fields':[]};if(_0x3810aa[_0x2f20('0x27')]>0x0){_[_0x2f20('0x3a')](_0x3810aa,function(_0x540272){if(_['includes']([_0x2f20('0x3b'),'picklist'],_0x540272[_0x2f20('0x3c')])&&_0x540272[_0x2f20('0x3d')]&&!_0x540272['customField']){_0x307c07[_0x540272[_0x2f20('0x3d')][_0x2f20('0x3e')]()]=_0x540272[_0x2f20('0x3f')][_0x2f20('0x35')]();}else if(_[_0x2f20('0x40')]([_0x2f20('0x3b'),_0x2f20('0x41')],_0x540272[_0x2f20('0x3c')])&&_0x540272[_0x2f20('0x42')]&&_0x540272[_0x2f20('0x43')]){_0x307c07['custom_fields']['push']({'id':_0x540272[_0x2f20('0x42')],'value':_0x540272['content']['toString']()});}else if(_0x540272[_0x2f20('0x3c')]===_0x2f20('0x44')&&_0x540272[_0x2f20('0x45')]&&_0x540272[_0x2f20('0x42')]&&_0x540272[_0x2f20('0x43')]){_0x2133ab[_0x540272[_0x2f20('0x45')]]&&_0x307c07[_0x2f20('0x46')][_0x2f20('0x47')]({'id':_0x540272[_0x2f20('0x42')],'value':_0x2133ab[_0x540272[_0x2f20('0x45')]][_0x2f20('0x35')]()});}else if(_0x540272[_0x2f20('0x3c')]==='customVariable'&&_0x540272[_0x2f20('0x48')]&&_0x540272['Variable'][_0x2f20('0x14')]&&_0x540272[_0x2f20('0x42')]&&_0x540272['customField']){_0x2133ab[_0x540272[_0x2f20('0x48')][_0x2f20('0x14')][_0x2f20('0x3e')]()]&&_0x307c07[_0x2f20('0x46')][_0x2f20('0x47')]({'id':_0x540272[_0x2f20('0x42')],'value':_0x2133ab[_0x540272['Variable'][_0x2f20('0x14')][_0x2f20('0x3e')]()][_0x2f20('0x35')]()});}});}return _0x307c07;}exports[_0x2f20('0x49')]=function(_0x327223,_0xc6a692,_0x84e5e,_0x4e6d49,_0x565163,_0x4c9729){var _0x87c67e,_0x53cf98;_0x4c9729[_0x2f20('0x11')]=intUtil[_0x2f20('0x4a')](_0x4c9729[_0x2f20('0x11')]);_0x4c9729[_0x2f20('0x4b')]=intUtil[_0x2f20('0x4a')](_0x4c9729[_0x2f20('0x4b')]);if(_0x565163&&_0x565163[_0x2f20('0x4c')]){logger[_0x2f20('0xe')](_0x2f20('0x4d'),_0x2f20('0x4e'));_0xc6a692[_0x2f20('0x4f')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4c9729[_0x2f20('0x4b')],_0xc6a692[_0x2f20('0x50')],md5(_0xc6a692[_0x2f20('0x50')]));}else{_0xc6a692[_0x2f20('0x4f')]='';}headers[_0x2f20('0x51')]=getAuth(_0x4c9729);return getUser(_0x4c9729,_0x4e6d49[_0x2f20('0x52')])[_0x2f20('0x18')](function(_0x3c291b){_0x87c67e=_0x3c291b;logger['info'](_0x2f20('0x53'),_0x87c67e['id']);return getEndUser(_0x4c9729,_0xc6a692['calleridname'],_0xc6a692[_0x2f20('0x54')]);})[_0x2f20('0x18')](function(_0x2d87a6){_0x53cf98=_0x2d87a6;logger[_0x2f20('0xe')](_0x2f20('0x55'),_0x53cf98['id']);return getTicket(_0x4c9729,_0x87c67e,_0x53cf98,_0x84e5e,_0xc6a692);})['then'](function(_0x558c56){if(_0x558c56){logger[_0x2f20('0xe')](_0x2f20('0x56'),_0x558c56['id']);switch(_0x4c9729[_0x2f20('0x3c')]){case _0x2f20('0x57'):logger[_0x2f20('0xe')](_0x2f20('0x4d'),_0x2f20('0x58'));return request({'uri':util[_0x2f20('0x10')](_0x2f20('0x59'),_0x4c9729[_0x2f20('0x11')],_0x87c67e['id'],_0x558c56['id']),'method':_0x2f20('0x2c')});case _0x2f20('0x5a'):logger[_0x2f20('0xe')](_0x2f20('0x4d'),_0x2f20('0x5b'));emit(util[_0x2f20('0x10')](_0x2f20('0x5c'),_0x4e6d49[_0x2f20('0x14')]),_0x2f20('0x5d'),{'uri':util[_0x2f20('0x10')]('%s/agent/tickets/%s',_0x4c9729[_0x2f20('0x11')]['replace'](_0x2f20('0x5e'),''),_0x558c56['id'])});break;default:logger[_0x2f20('0x5f')](_0x2f20('0x4d'),_0x2f20('0x60'));}}})['catch'](function(_0x438d1b){logger[_0x2f20('0x5f')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0x2f20('0x61')](_0x438d1b,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x32ef2d,_0xd36cda,_0x5c0916,_0x44344b,_0x24e89f,_0x39d077,_0x2874f9){var _0x4250ab,_0x44a91d;_0x39d077['remoteUri']=intUtil[_0x2f20('0x4a')](_0x39d077[_0x2f20('0x11')]);_0x39d077[_0x2f20('0x4b')]=intUtil[_0x2f20('0x4a')](_0x39d077['serverUrl']);if(_0x2874f9&&_0x2874f9[_0x2f20('0x62')]&&_0x2874f9['recordingFormat']!=='none'){logger[_0x2f20('0xe')](_0x2f20('0x63'),_0x2f20('0x4e'));_0xd36cda['recordingURL']=util[_0x2f20('0x10')](_0x2f20('0x64'),_0x39d077[_0x2f20('0x4b')],_0xd36cda[_0x2f20('0x50')],md5(_0xd36cda[_0x2f20('0x50')]));}headers[_0x2f20('0x51')]=getAuth(_0x39d077);return getUser(_0x39d077,_0x44344b[_0x2f20('0x52')])[_0x2f20('0x18')](function(_0x365f78){_0x4250ab=_0x365f78;logger[_0x2f20('0xe')](_0x2f20('0x53'),_0x4250ab['id']);return getEndUser(_0x39d077,_0xd36cda[_0x2f20('0x65')],_0xd36cda[_0x2f20('0x66')]);})[_0x2f20('0x18')](function(_0x10ea6f){_0x44a91d=_0x10ea6f;logger['info']('The\x20Enduser\x20ID\x20is:',_0x44a91d['id']);return getTicket(_0x39d077,_0x4250ab,_0x44a91d,_0x5c0916,_0xd36cda);})['then'](function(_0x3c4931){if(_0x3c4931){logger[_0x2f20('0xe')](_0x2f20('0x56'),_0x3c4931['id']);switch(_0x39d077[_0x2f20('0x3c')]){case _0x2f20('0x57'):logger[_0x2f20('0xe')](_0x2f20('0x63'),_0x2f20('0x58'));return request({'uri':util[_0x2f20('0x10')](_0x2f20('0x59'),_0x39d077[_0x2f20('0x11')],_0x4250ab['id'],_0x3c4931['id']),'method':_0x2f20('0x2c')});case _0x2f20('0x5a'):logger[_0x2f20('0xe')]('[OUTBOUND]',_0x2f20('0x5b'));emit(util[_0x2f20('0x10')](_0x2f20('0x5c'),_0x44344b[_0x2f20('0x14')]),'trigger:browser:url',{'uri':util[_0x2f20('0x10')](_0x2f20('0x67'),_0x39d077[_0x2f20('0x11')][_0x2f20('0x68')]('/api/v2',''),_0x3c4931['id'])});break;default:logger['error']('[OUTBOUND]',_0x2f20('0x60'));}}})[_0x2f20('0x69')](function(_0x2f396a){logger['error'](_0x2f20('0x6a'),util[_0x2f20('0x61')](_0x2f396a,{'showHidden':!![],'depth':null}));});};exports[_0x2f20('0x6b')]=function(_0x1c9832,_0x147e20,_0x3b4e8a,_0x3bec82,_0x2c68ad,_0x32d883){var _0x3db3cf,_0x4d3862;_0x32d883[_0x2f20('0x11')]=intUtil[_0x2f20('0x4a')](_0x32d883['remoteUri']);_0x32d883[_0x2f20('0x4b')]=intUtil['stripTrailingSlash'](_0x32d883[_0x2f20('0x4b')]);if(_0x2c68ad&&_0x2c68ad[_0x2f20('0x4c')]){logger[_0x2f20('0xe')]('['+_0x147e20[_0x2f20('0x6c')][_0x2f20('0x6d')]()+']','Recording\x20is\x20enabled!');_0x147e20[_0x2f20('0x4f')]=util[_0x2f20('0x10')](_0x2f20('0x64'),_0x32d883['serverUrl'],_0x147e20['uniqueid'],md5(_0x147e20[_0x2f20('0x50')]));}else{_0x147e20[_0x2f20('0x4f')]='';}headers[_0x2f20('0x51')]=getAuth(_0x32d883);return getUser(_0x32d883)[_0x2f20('0x18')](function(_0x3e53b3){_0x3db3cf=_0x3e53b3;logger[_0x2f20('0xe')](_0x2f20('0x53'),_0x3db3cf['id']);return getEndUser(_0x32d883,_0x147e20[_0x2f20('0x6e')],_0x147e20[_0x2f20('0x54')]);})[_0x2f20('0x18')](function(_0x508701){_0x4d3862=_0x508701;logger[_0x2f20('0xe')]('The\x20Enduser\x20ID\x20is:',_0x4d3862['id']);return getTicket(_0x32d883,_0x3db3cf,_0x4d3862,_0x3b4e8a,_0x147e20);})[_0x2f20('0x18')](function(_0x20e58d){if(_0x20e58d){logger[_0x2f20('0xe')](_0x2f20('0x56'),_0x20e58d['id']);}})[_0x2f20('0x69')](function(_0xbf6b41){logger[_0x2f20('0x5f')]('['+_0x147e20[_0x2f20('0x6c')][_0x2f20('0x6d')]()+']'+_0x2f20('0x6f'),util['inspect'](_0xbf6b41,{'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 1800962..6955e6c 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 _0x3b36=['contact','lead','Creating\x20new\x20call...','Owner','first_name','Subject','getString','Description','Descriptions','Who_Id','First_Name','Last_Name','What_Id','Full_Name','$se_module','Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','starttime','format','lastevent','called','Call_Result','Called','complete','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','SUCCESS','err','log','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','/api/voice/recordings/','uniqueid','com','The\x20User\x20ID\x20is:','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','/downloads?type=uniqueid&token=','zoho.eu','destcalleridname','destcalleridnum','Outbound','unmanaged','toUpperCase','calleridname','request-promise','util','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','emit','[HTTP]','length','includes','string','type','idField','content','variableName','toString','Variable','name','toLowerCase','indexOf','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','POST','refreshToken','clientSecret','refresh_token','then','add','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','stringify','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','startCase','moduleCreate','role','last_name','Error:\x20','CREATE\x20ERROR','GET','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing'];(function(_0x13bc3a,_0x417a75){var _0x505b02=function(_0x840a26){while(--_0x840a26){_0x13bc3a['push'](_0x13bc3a['shift']());}};_0x505b02(++_0x417a75);}(_0x3b36,0x181));var _0x63b3=function(_0x256abf,_0x629a07){_0x256abf=_0x256abf-0x0;var _0x1dfc9e=_0x3b36[_0x256abf];return _0x1dfc9e;};'use strict';var _=require('lodash');var rp=require(_0x63b3('0x0'));var md5=require('md5');var util=require(_0x63b3('0x1'));var intUtil=require(_0x63b3('0x2'));var moment=require(_0x63b3('0x3'));var Redis=require(_0x63b3('0x4'));var BPromise=require(_0x63b3('0x5'));var config=require(_0x63b3('0x6'));var logger=require(_0x63b3('0x7'))(_0x63b3('0x8'));config[_0x63b3('0x9')]=_[_0x63b3('0xa')](config[_0x63b3('0x9')],{'host':_0x63b3('0xb'),'port':0x18eb});var io=require(_0x63b3('0xc'))(new Redis(config[_0x63b3('0x9')]));function emit(_0x408454,_0x284f41,_0x446aea){io['to'](_0x408454)[_0x63b3('0xd')](_0x284f41,_0x446aea);}function request(_0xb1016){logger['debug'](_0x63b3('0xe'),JSON['stringify'](_0xb1016));return rp(_0xb1016);}function getCustomFields(_0x2eff4b,_0x1da9d7){var _0x2ad7ef={};if(_0x2eff4b[_0x63b3('0xf')]>0x0){_['forEach'](_0x2eff4b,function(_0x53a0a6){if(_[_0x63b3('0x10')]([_0x63b3('0x11'),'picklist'],_0x53a0a6[_0x63b3('0x12')])&&_0x53a0a6[_0x63b3('0x13')]){_0x2ad7ef[_0x53a0a6[_0x63b3('0x13')]]=_0x53a0a6[_0x63b3('0x14')]['toString']();}else if(_0x53a0a6[_0x63b3('0x12')]==='variable'&&_0x53a0a6[_0x63b3('0x15')]&&_0x53a0a6[_0x63b3('0x13')]&&_0x1da9d7[_0x53a0a6[_0x63b3('0x15')]]){_0x2ad7ef[_0x53a0a6[_0x63b3('0x13')]]=_0x1da9d7[_0x53a0a6[_0x63b3('0x15')]][_0x63b3('0x16')]();}else if(_0x53a0a6['type']==='customVariable'&&_0x53a0a6[_0x63b3('0x17')]&&_0x53a0a6['Variable'][_0x63b3('0x18')]&&_0x53a0a6[_0x63b3('0x13')]&&_0x1da9d7[_0x53a0a6['Variable'][_0x63b3('0x18')][_0x63b3('0x19')]()]){_0x2ad7ef[_0x53a0a6[_0x63b3('0x13')]]=_0x1da9d7[_0x53a0a6[_0x63b3('0x17')][_0x63b3('0x18')][_0x63b3('0x19')]()][_0x63b3('0x16')]();}});}return _0x2ad7ef;}function getName(_0x5950b6){if(_0x5950b6[_0x63b3('0x1a')]('\x20')>0x0){var _0x2206c7=_0x5950b6['split'](/ (.+)/);if(_0x2206c7[0x1]){return _0x2206c7;}}return[_0x5950b6,_0x5950b6];}var accountsTokens={};function getAccessToken(_0x33c02f){return new Promise(function(_0x18fedd,_0x372004){if(!_[_0x63b3('0x1b')](accountsTokens[_0x33c02f['id']])&&!_[_0x63b3('0x1b')](accountsTokens[_0x33c02f['id']][_0x63b3('0x1c')])){if(moment()[_0x63b3('0x1d')](accountsTokens[_0x33c02f['id']][_0x63b3('0x1e')])){_0x18fedd(accountsTokens[_0x33c02f['id']]['access_token']);}}var _0x328fc1;switch(_0x33c02f[_0x63b3('0x1f')]){case'US':_0x328fc1=_0x63b3('0x20');break;case'AU':_0x328fc1=_0x63b3('0x21');break;case'EU':_0x328fc1=_0x63b3('0x22');break;case'IN':_0x328fc1=_0x63b3('0x23');break;case'CN':_0x328fc1='https://accounts.zoho.com.cn';break;default:_0x328fc1=_0x63b3('0x22');break;}var _0xfd34ae={'method':_0x63b3('0x24'),'uri':_0x328fc1+'/oauth/v2/token','qs':{'refresh_token':_0x33c02f[_0x63b3('0x25')],'client_id':_0x33c02f['clientId'],'client_secret':_0x33c02f[_0x63b3('0x26')],'grant_type':_0x63b3('0x27')},'json':!![]};return rp(_0xfd34ae)[_0x63b3('0x28')](function(_0x130451){accountsTokens[_0x33c02f['id']]={'access_token':_0x130451[_0x63b3('0x1c')],'expires_in':moment()[_0x63b3('0x29')](_0x130451[_0x63b3('0x1e')],_0x63b3('0x2a'))};_0x18fedd(_0x130451['access_token']);})[_0x63b3('0x2b')](function(_0x1e1518){logger[_0x63b3('0x2c')](_0x63b3('0x2d'),_0x1e1518[_0x63b3('0x2e')]);_0x372004(_0x1e1518);});});}function getUser(_0x28518e,_0x3a6de7,_0xcf2b8d,_0x1c0d0d){logger[_0x63b3('0x2f')]('Search\x20user');return request({'method':'GET','uri':util['format'](_0x63b3('0x30'),_0x3a6de7),'qs':{'type':_0x63b3('0x31')},'headers':{'Authorization':_0x63b3('0x32')+_0x28518e},'json':!![]})[_0x63b3('0x28')](function(_0x210a7d){if(_0x210a7d[_0x63b3('0x33')]){var _0xf878c2=-0x1;if(_[_0x63b3('0x34')](_0x210a7d[_0x63b3('0x33')])){if(!_[_0x63b3('0x1b')](_0x1c0d0d)){_0xf878c2=_[_0x63b3('0x35')](_0x210a7d[_0x63b3('0x33')],function(_0x3843d4){return _0x3843d4[_0x63b3('0x36')]===_0x1c0d0d;});}if(_0xf878c2>=0x0){logger[_0x63b3('0x2f')](_0x63b3('0x37'));}else{logger[_0x63b3('0x2f')](_0x63b3('0x38'));_0xf878c2=_['findIndex'](_0x210a7d[_0x63b3('0x33')],function(_0xd56332){return _0xd56332[_0x63b3('0x39')][_0x63b3('0x18')]===_0x63b3('0x3a');});}return _0x210a7d[_0x63b3('0x33')][_0xf878c2];}else{if(_0x210a7d[_0x63b3('0x3b')][_0x63b3('0x39')][_0x63b3('0x18')]==='Administrator'){logger['info'](_0x63b3('0x38'));user=_0x210a7d['user'];return user;}else{logger[_0x63b3('0x2c')](_0x63b3('0x3c'),JSON[_0x63b3('0x3d')](_0x210a7d));throw new Error(_0x63b3('0x3e')+JSON[_0x63b3('0x3d')](_0x210a7d));}}}else{logger[_0x63b3('0x2c')](_0x63b3('0x3c'),JSON[_0x63b3('0x3d')](_0x210a7d));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x63b3('0x3d')](_0x210a7d));}})[_0x63b3('0x2b')](function(_0x19bc68){console[_0x63b3('0x2c')](_0x19bc68);});}function getZohoUser(_0x482e91,_0x3f8cb7){return new BPromise(function(_0x1a17d3,_0x4a1dc2){request(_0x482e91)[_0x63b3('0x28')](function(_0x449bd8){var _0x13fdea=null;if(_0x449bd8){_0x13fdea=_0x449bd8[_0x63b3('0x3f')][0x0];_0x13fdea[_0x63b3('0x40')]=_0x3f8cb7;}_0x1a17d3(_0x13fdea);})[_0x63b3('0x2b')](function(_0x342044){_0x4a1dc2(_0x342044);});});}function createEndUser(_0x396bf3,_0x52efcb,_0x29ed23,_0x345718,_0x396a27,_0x24ef58){var _0x29ed23=getName(_0x29ed23);return request({'method':_0x63b3('0x24'),'uri':_0x63b3('0x41')+_0x52efcb+'/crm/v2/'+_[_0x63b3('0x42')](_0x24ef58[_0x63b3('0x43')])+'s','body':{'data':[{'Last_Name':_0x29ed23[0x1],'First_Name':_0x29ed23[0x0],'Phone':_0x345718,'Owner':{'name':!_['isNil'](_0x396a27['role'][_0x63b3('0x18')])?_0x396a27[_0x63b3('0x44')][_0x63b3('0x18')]:!_['isNil'](_0x396a27['first_name'])?_0x396a27['first_name']+'\x20'+_0x396a27[_0x63b3('0x45')]:_0x396a27[_0x63b3('0x45')],'id':_0x396a27['id']}}]},'headers':{'Authorization':_0x63b3('0x32')+_0x396bf3},'json':!![]})['then'](function(_0x1d8c74){if(_0x1d8c74&&_0x1d8c74[_0x63b3('0x3f')][0x0]['code']==='SUCCESS'){var _0x5f0e66=_0x1d8c74[_0x63b3('0x3f')][0x0]['details'];_0x5f0e66[_0x63b3('0x40')]=_[_0x63b3('0x42')](_0x24ef58[_0x63b3('0x43')])+'s';return _0x5f0e66;}logger['error']('The\x20failing\x20result\x20is',JSON[_0x63b3('0x3d')](data));throw new Error(_0x63b3('0x46')+JSON[_0x63b3('0x3d')](data));})[_0x63b3('0x2b')](function(_0x34c6bd){console['log'](_0x63b3('0x47'),_0x34c6bd);});}function getEndUser(_0x26f09d,_0x3c7769,_0x1695ed,_0x3c8170,_0x1f28d4,_0x5b6a39,_0x5fad0c){var _0xefea1e={'method':_0x63b3('0x48'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x26f09d},'json':!![]};switch(_0x5fad0c['moduleSearch']){case _0x63b3('0x49'):_0xefea1e[_0x63b3('0x4a')]='https://www.zohoapis.'+_0x3c7769+_0x63b3('0x4b')+_0x1f28d4+'))';return getZohoUser(_0xefea1e,_0x63b3('0x4c'))[_0x63b3('0x28')](function(_0x27fce7){if(_0x27fce7)return _0x27fce7;_0xefea1e[_0x63b3('0x4a')]='https://www.zohoapis.'+_0x3c7769+_0x63b3('0x4d')+_0x1f28d4+'))';return getZohoUser(_0xefea1e,_0x63b3('0x4e'))[_0x63b3('0x28')](function(_0x7e8064){if(_0x7e8064)return _0x7e8064;if(_0x5fad0c[_0x63b3('0x43')]!=_0x63b3('0x4f')){return createEndUser(_0x26f09d,_0x3c7769,_0x3c8170,_0x1f28d4,_0x5b6a39,_0x5fad0c);}else{return{};}});});break;case _0x63b3('0x50'):_0xefea1e[_0x63b3('0x4a')]=_0x63b3('0x41')+_0x3c7769+_0x63b3('0x4b')+_0x1f28d4+'))';return getZohoUser(_0xefea1e,'Contacts')['then'](function(_0x41dc85){if(_0x41dc85)return _0x41dc85;if(_0x5fad0c['moduleCreate']!='nothing'){return createEndUser(_0x26f09d,_0x3c7769,_0x3c8170,_0x1f28d4,_0x5b6a39,_0x5fad0c);}else{return{};}});break;case _0x63b3('0x51'):_0xefea1e[_0x63b3('0x4a')]=_0x63b3('0x41')+_0x3c7769+_0x63b3('0x4d')+_0x1f28d4+'))';return getZohoUser(_0xefea1e,_0x63b3('0x4e'))[_0x63b3('0x28')](function(_0x102a7f){if(_0x102a7f)return _0x102a7f;if(_0x5fad0c[_0x63b3('0x43')]!=_0x63b3('0x4f')){return createEndUser(_0x26f09d,_0x3c7769,_0x3c8170,_0x1f28d4,_0x5b6a39,_0x5fad0c);}else{return{};}});break;}}function getCall(_0x47b0d1,_0x520fa8,_0x4ac9e5,_0x5f1e98,_0x2adbfd,_0x45ed34,_0x1a4bfc,_0x3d1ea0){logger[_0x63b3('0x2f')](_0x63b3('0x52'));var _0x43d4e7={};_0x43d4e7[_0x63b3('0x53')]={'name':!_['isNil'](_0x5f1e98[_0x63b3('0x44')]['name'])&&!_['isNil'](_0x5f1e98[_0x63b3('0x39')][_0x63b3('0x18')])&&_0x5f1e98['profile'][_0x63b3('0x18')]==='administrator'?_0x5f1e98[_0x63b3('0x44')][_0x63b3('0x18')]:!_[_0x63b3('0x1b')](_0x5f1e98[_0x63b3('0x54')])?_0x5f1e98['first_name']+'\x20'+_0x5f1e98[_0x63b3('0x45')]:_0x5f1e98[_0x63b3('0x45')],'id':_0x5f1e98['id']};_0x43d4e7[_0x63b3('0x55')]=intUtil[_0x63b3('0x56')](_0x45ed34['Subjects'],_0x1a4bfc,'\x20');_0x43d4e7[_0x63b3('0x57')]=intUtil[_0x63b3('0x56')](_0x45ed34[_0x63b3('0x58')],_0x1a4bfc,'\x0a');if(_0x2adbfd[_0x63b3('0x40')]===_0x63b3('0x4c')){_0x43d4e7[_0x63b3('0x59')]={'name':!_['isNil'](_0x2adbfd['Full_Name'])?_0x2adbfd['Full_Name']:!_[_0x63b3('0x1b')](_0x2adbfd[_0x63b3('0x5a')])?_0x2adbfd[_0x63b3('0x5a')]+'\x20'+_0x2adbfd[_0x63b3('0x5b')]:_0x2adbfd[_0x63b3('0x5b')],'id':_0x2adbfd['id']};}if(_0x2adbfd[_0x63b3('0x40')]===_0x63b3('0x4e')){_0x43d4e7[_0x63b3('0x5c')]={'name':!_[_0x63b3('0x1b')](_0x2adbfd[_0x63b3('0x5d')])?_0x2adbfd[_0x63b3('0x5d')]:!_[_0x63b3('0x1b')](_0x2adbfd[_0x63b3('0x5a')])?_0x2adbfd[_0x63b3('0x5a')]+'\x20'+_0x2adbfd['Last_Name']:_0x2adbfd[_0x63b3('0x5b')],'id':_0x2adbfd['id']};_0x43d4e7[_0x63b3('0x5e')]=_[_0x63b3('0x42')](_0x2adbfd[_0x63b3('0x40')]);}if(_0x1a4bfc['talktime']){_0x43d4e7[_0x63b3('0x5f')]=moment[_0x63b3('0x60')](parseInt(_0x1a4bfc['talktime'])*0x3e8)['format'](_0x63b3('0x61'));}else if(_0x1a4bfc[_0x63b3('0x62')]&&_0x1a4bfc[_0x63b3('0x63')]){_0x43d4e7[_0x63b3('0x5f')]=moment[_0x63b3('0x60')](moment(_0x1a4bfc[_0x63b3('0x63')],_0x63b3('0x64'))['diff'](moment(_0x1a4bfc[_0x63b3('0x65')],_0x63b3('0x64'))))[_0x63b3('0x66')](_0x63b3('0x61'));}switch(_0x1a4bfc[_0x63b3('0x67')]){case _0x63b3('0x68'):_0x43d4e7[_0x63b3('0x69')]=_0x63b3('0x6a');break;case _0x63b3('0x6b'):case'connect':_0x43d4e7[_0x63b3('0x69')]=_0x63b3('0x6c');break;case _0x63b3('0x6d'):_0x43d4e7['Call_Result']=_0x63b3('0x6e');break;case _0x63b3('0x6f'):_0x43d4e7[_0x63b3('0x69')]=_0x63b3('0x70');break;case _0x63b3('0x71'):_0x43d4e7[_0x63b3('0x69')]=_0x63b3('0x72');default:}_0x43d4e7[_0x63b3('0x73')]=(_0x3d1ea0===_0x63b3('0x74')?moment(_0x1a4bfc[_0x63b3('0x65')])[_0x63b3('0x66')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x1a4bfc[_0x63b3('0x75')])[_0x63b3('0x66')](_0x63b3('0x64')))||moment()[_0x63b3('0x66')](_0x63b3('0x64'));_0x43d4e7[_0x63b3('0x76')]=_0x3d1ea0||_0x63b3('0x77');_0x43d4e7=_[_0x63b3('0x78')](_0x43d4e7,getCustomFields(_0x45ed34[_0x63b3('0x79')],_0x1a4bfc));return request({'method':_0x63b3('0x24'),'uri':_0x63b3('0x41')+_0x520fa8+_0x63b3('0x7a'),'headers':{'Authorization':_0x63b3('0x32')+_0x47b0d1},'body':{'data':[_0x43d4e7]},'json':!![]})['then'](function(_0x5c66b8){if(_0x5c66b8&&_0x5c66b8[_0x63b3('0x3f')][0x0]['code']===_0x63b3('0x7b')){logger['info']('Call\x20created!');return{'id':_0x5c66b8[_0x63b3('0x3f')][0x0]['details']['id']};}})['catch'](function(_0x59ef97){logger[_0x63b3('0x2f')](_0x63b3('0x7c'),_0x59ef97[_0x63b3('0x2e')]);console[_0x63b3('0x7d')]('err',_0x59ef97);});}exports[_0x63b3('0x7e')]=function(_0x1fc499,_0x15948e,_0x5f4c2e,_0x2368e9,_0x545707,_0x2f4cd7){var _0xac2fd1,_0x25fe32,_0x10278f;_0x2f4cd7[_0x63b3('0x7f')]=intUtil[_0x63b3('0x80')](_0x2f4cd7['host']);_0x2f4cd7['serverUrl']=intUtil['stripTrailingSlash'](_0x2f4cd7[_0x63b3('0x81')]);if(_0x545707&&_0x545707[_0x63b3('0x82')]){logger[_0x63b3('0x2f')](_0x63b3('0x83'),'Recording\x20is\x20enabled!');_0x15948e[_0x63b3('0x84')]=_0x2f4cd7[_0x63b3('0x81')]+_0x63b3('0x85')+_0x15948e['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x15948e[_0x63b3('0x86')]);}else{_0x15948e[_0x63b3('0x84')]='';}var _0x27b1fe=_0x2f4cd7[_0x63b3('0x7f')]==='zoho.eu'?'eu':_0x63b3('0x87');return getAccessToken(_0x2f4cd7)[_0x63b3('0x28')](function(_0x4dfe21){_0x10278f=_0x4dfe21;return getUser(_0x10278f,_0x27b1fe,_0x2f4cd7,_0x2368e9[_0x63b3('0x36')]);})[_0x63b3('0x28')](function(_0x5a444f){_0xac2fd1=_0x5a444f;logger[_0x63b3('0x2f')](_0x63b3('0x88'),_0xac2fd1['id']);return getEndUser(_0x10278f,_0x27b1fe,_0x2f4cd7,_0x15948e['calleridname'],_0x15948e[_0x63b3('0x89')],_0xac2fd1,_0x5f4c2e);})['then'](function(_0x449141){_0x25fe32=_0x449141;return getCall(_0x10278f,_0x27b1fe,_0x2f4cd7,_0xac2fd1,_0x25fe32,_0x5f4c2e,_0x15948e,_0x63b3('0x77'));})[_0x63b3('0x28')](function(_0x5759ca){if(_0x5759ca){logger[_0x63b3('0x2f')](_0x63b3('0x8a'),_0x5759ca['id']);logger[_0x63b3('0x2f')]('[QUEUE]',_0x63b3('0x8b'));emit(util[_0x63b3('0x66')](_0x63b3('0x8c'),_0x2368e9[_0x63b3('0x18')]),_0x63b3('0x8d'),{'uri':_0x63b3('0x8e')+_0x2f4cd7[_0x63b3('0x7f')]+'/crm/EntityInfo.do?module=Calls&id='+_0x5759ca['id']});}})[_0x63b3('0x2b')](function(_0x592195){logger['error'](_0x63b3('0x83'),JSON[_0x63b3('0x3d')](_0x592195));});};exports[_0x63b3('0x74')]=function(_0x5216a3,_0x474389,_0x5d8533,_0x253203,_0x36e279,_0x351d81,_0x1716e8){var _0x42775f,_0x364e2b,_0x31668e;_0x351d81['host']=intUtil[_0x63b3('0x80')](_0x351d81[_0x63b3('0x7f')]);_0x351d81['serverUrl']=intUtil[_0x63b3('0x80')](_0x351d81[_0x63b3('0x81')]);if(_0x1716e8&&_0x1716e8['recordingFormat']&&_0x1716e8[_0x63b3('0x8f')]!==_0x63b3('0x90')){logger[_0x63b3('0x2f')](_0x63b3('0x91'),_0x63b3('0x92'));_0x474389[_0x63b3('0x84')]=_0x351d81[_0x63b3('0x81')]+_0x63b3('0x85')+_0x474389[_0x63b3('0x86')]+_0x63b3('0x93')+md5(_0x474389[_0x63b3('0x86')]);}var _0x350662=_0x351d81[_0x63b3('0x7f')]===_0x63b3('0x94')?'eu':_0x63b3('0x87');return getAccessToken(_0x351d81)[_0x63b3('0x28')](function(_0x5765f5){_0x31668e=_0x5765f5;return getUser(_0x31668e,_0x350662,_0x351d81,_0x253203['email']);})[_0x63b3('0x28')](function(_0x182d28){_0x42775f=_0x182d28;logger[_0x63b3('0x2f')](_0x63b3('0x88'),_0x42775f['id']);return getEndUser(_0x31668e,_0x350662,_0x351d81,_0x474389[_0x63b3('0x95')],_0x474389[_0x63b3('0x96')],_0x42775f,_0x5d8533);})[_0x63b3('0x28')](function(_0x1170b9){_0x364e2b=_0x1170b9;return getCall(_0x31668e,_0x350662,_0x351d81,_0x42775f,_0x364e2b,_0x5d8533,_0x474389,_0x63b3('0x97'));})[_0x63b3('0x28')](function(_0x412d94){if(_0x412d94){logger[_0x63b3('0x2f')](_0x63b3('0x8a'),_0x412d94['id']);logger[_0x63b3('0x2f')](_0x63b3('0x91'),_0x63b3('0x8b'));emit(util[_0x63b3('0x66')](_0x63b3('0x8c'),_0x253203['name']),_0x63b3('0x8d'),{'uri':_0x63b3('0x8e')+_0x351d81[_0x63b3('0x7f')]+'/crm/EntityInfo.do?module=Calls&id='+_0x412d94['id']});}})[_0x63b3('0x2b')](function(_0x50b965){logger['error'](_0x63b3('0x91'),JSON['stringify'](_0x50b965));});};exports[_0x63b3('0x98')]=function(_0x19cccd,_0x2adf78,_0x5207e0,_0x5dd783,_0x3d435d,_0xcd8e8f){var _0x248559,_0x1f465c,_0x59eae4;_0xcd8e8f[_0x63b3('0x7f')]=intUtil[_0x63b3('0x80')](_0xcd8e8f[_0x63b3('0x7f')]);_0xcd8e8f[_0x63b3('0x81')]=intUtil[_0x63b3('0x80')](_0xcd8e8f[_0x63b3('0x81')]);if(_0x3d435d&&_0x3d435d[_0x63b3('0x82')]){logger['info']('['+_0x2adf78[_0x63b3('0x67')][_0x63b3('0x99')]()+']','Recording\x20is\x20enabled!');_0x2adf78['recordingURL']=_0xcd8e8f['serverUrl']+_0x63b3('0x85')+_0x2adf78[_0x63b3('0x86')]+_0x63b3('0x93')+md5(_0x2adf78[_0x63b3('0x86')]);}else{_0x2adf78[_0x63b3('0x84')]='';}var _0x4d8de3=_0xcd8e8f[_0x63b3('0x7f')]===_0x63b3('0x94')?'eu':_0x63b3('0x87');return getAccessToken(_0xcd8e8f)[_0x63b3('0x28')](function(_0x5579da){_0x59eae4=_0x5579da;return getUser(_0x59eae4,_0x4d8de3,_0xcd8e8f);})[_0x63b3('0x28')](function(_0xb69f62){_0x248559=_0xb69f62;logger['info'](_0x63b3('0x88'),_0x248559['id']);return getEndUser(_0x59eae4,_0x4d8de3,_0xcd8e8f,_0x2adf78[_0x63b3('0x9a')],_0x2adf78[_0x63b3('0x89')],_0x248559,_0x5207e0);})[_0x63b3('0x28')](function(_0xe710af){_0x1f465c=_0xe710af;return getCall(_0x59eae4,_0x4d8de3,_0xcd8e8f,_0x248559,_0x1f465c,_0x5207e0,_0x2adf78,'Inbound');})['then'](function(_0xddd026){if(_0xddd026){logger[_0x63b3('0x2f')](_0x63b3('0x8a'),_0xddd026['id']);}})['catch'](function(_0x32139f){logger[_0x63b3('0x2c')]('['+_0x2adf78[_0x63b3('0x67')][_0x63b3('0x99')]()+']',JSON[_0x63b3('0x3d')](_0x32139f));});}; \ No newline at end of file +var _0x552d=['abandoned','Abandoned','timeout','Call_Start_Time','outbound','YYYY-MM-DDTHH:mm:ss','agentcalledAt','Call_Type','Inbound','merge','Fields','code','Call\x20created!','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','uniqueid','/downloads?type=uniqueid&token=','recordingURL','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','The\x20Call\x20ID\x20is:','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','/api/voice/recordings/','Outbound','toUpperCase','calleridnum','lodash','util','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','localhost','socket.io-emitter','emit','debug','stringify','length','forEach','includes','string','picklist','idField','type','variable','variableName','toString','Variable','name','toLowerCase','indexOf','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','email','findIndex','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','role','first_name','last_name','SUCCESS','details','moduleCreate','Error:\x20','log','GET','moduleSearch','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','contact','Contacts','lead','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','$se_module','talktime','utc','mm:ss','answertime','endtime','Call_Duration','diff','starttime','lastevent','Call_Result','Called','complete','Answered'];(function(_0x5530a9,_0x48e4c2){var _0x1c69f4=function(_0x2577e0){while(--_0x2577e0){_0x5530a9['push'](_0x5530a9['shift']());}};_0x1c69f4(++_0x48e4c2);}(_0x552d,0xbe));var _0xd552=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x552d[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0xd552('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0xd552('0x1'));var intUtil=require(_0xd552('0x2'));var moment=require(_0xd552('0x3'));var Redis=require(_0xd552('0x4'));var BPromise=require(_0xd552('0x5'));var config=require(_0xd552('0x6'));var logger=require(_0xd552('0x7'))(_0xd552('0x8'));config[_0xd552('0x9')]=_['defaults'](config[_0xd552('0x9')],{'host':_0xd552('0xa'),'port':0x18eb});var io=require(_0xd552('0xb'))(new Redis(config[_0xd552('0x9')]));function emit(_0x28f31f,_0x80186d,_0x553655){io['to'](_0x28f31f)[_0xd552('0xc')](_0x80186d,_0x553655);}function request(_0x19b1ad){logger[_0xd552('0xd')]('[HTTP]',JSON[_0xd552('0xe')](_0x19b1ad));return rp(_0x19b1ad);}function getCustomFields(_0x356cc2,_0x588e21){var _0x22e3b1={};if(_0x356cc2[_0xd552('0xf')]>0x0){_[_0xd552('0x10')](_0x356cc2,function(_0x5de50d){if(_[_0xd552('0x11')]([_0xd552('0x12'),_0xd552('0x13')],_0x5de50d['type'])&&_0x5de50d[_0xd552('0x14')]){_0x22e3b1[_0x5de50d[_0xd552('0x14')]]=_0x5de50d['content']['toString']();}else if(_0x5de50d[_0xd552('0x15')]===_0xd552('0x16')&&_0x5de50d[_0xd552('0x17')]&&_0x5de50d['idField']&&_0x588e21[_0x5de50d[_0xd552('0x17')]]){_0x22e3b1[_0x5de50d[_0xd552('0x14')]]=_0x588e21[_0x5de50d['variableName']][_0xd552('0x18')]();}else if(_0x5de50d[_0xd552('0x15')]==='customVariable'&&_0x5de50d[_0xd552('0x19')]&&_0x5de50d[_0xd552('0x19')][_0xd552('0x1a')]&&_0x5de50d[_0xd552('0x14')]&&_0x588e21[_0x5de50d[_0xd552('0x19')][_0xd552('0x1a')][_0xd552('0x1b')]()]){_0x22e3b1[_0x5de50d['idField']]=_0x588e21[_0x5de50d['Variable']['name'][_0xd552('0x1b')]()]['toString']();}});}return _0x22e3b1;}function getName(_0x240c11){if(_0x240c11[_0xd552('0x1c')]('\x20')>0x0){var _0x207d0e=_0x240c11['split'](/ (.+)/);if(_0x207d0e[0x1]){return _0x207d0e;}}return[_0x240c11,_0x240c11];}var accountsTokens={};function getAccessToken(_0x497ca5){return new Promise(function(_0x578c0a,_0x44765f){if(!_[_0xd552('0x1d')](accountsTokens[_0x497ca5['id']])&&!_['isNil'](accountsTokens[_0x497ca5['id']][_0xd552('0x1e')])){if(moment()[_0xd552('0x1f')](accountsTokens[_0x497ca5['id']][_0xd552('0x20')])){_0x578c0a(accountsTokens[_0x497ca5['id']][_0xd552('0x1e')]);}}var _0x4f63d1;switch(_0x497ca5[_0xd552('0x21')]){case'US':_0x4f63d1=_0xd552('0x22');break;case'AU':_0x4f63d1='https://accounts.zoho.com.au';break;case'EU':_0x4f63d1=_0xd552('0x23');break;case'IN':_0x4f63d1=_0xd552('0x24');break;case'CN':_0x4f63d1='https://accounts.zoho.com.cn';break;default:_0x4f63d1=_0xd552('0x23');break;}var _0x25b80c={'method':_0xd552('0x25'),'uri':_0x4f63d1+_0xd552('0x26'),'qs':{'refresh_token':_0x497ca5[_0xd552('0x27')],'client_id':_0x497ca5[_0xd552('0x28')],'client_secret':_0x497ca5[_0xd552('0x29')],'grant_type':_0xd552('0x2a')},'json':!![]};return rp(_0x25b80c)[_0xd552('0x2b')](function(_0x26fd0c){accountsTokens[_0x497ca5['id']]={'access_token':_0x26fd0c[_0xd552('0x1e')],'expires_in':moment()['add'](_0x26fd0c['expires_in'],'seconds')};_0x578c0a(_0x26fd0c[_0xd552('0x1e')]);})[_0xd552('0x2c')](function(_0x406722){logger[_0xd552('0x2d')](_0xd552('0x2e'),_0x406722[_0xd552('0x2f')]);_0x44765f(_0x406722);});});}function getUser(_0x1efc1a,_0x36f095,_0x3deba0,_0x1490ef){logger[_0xd552('0x30')](_0xd552('0x31'));return request({'method':'GET','uri':util[_0xd552('0x32')](_0xd552('0x33'),_0x36f095),'qs':{'type':_0xd552('0x34')},'headers':{'Authorization':_0xd552('0x35')+_0x1efc1a},'json':!![]})[_0xd552('0x2b')](function(_0x4b7f2d){if(_0x4b7f2d[_0xd552('0x36')]){var _0x5eade8=-0x1;if(_['isArrayLikeObject'](_0x4b7f2d[_0xd552('0x36')])){if(!_['isNil'](_0x1490ef)){_0x5eade8=_['findIndex'](_0x4b7f2d[_0xd552('0x36')],function(_0x2da395){return _0x2da395[_0xd552('0x37')]===_0x1490ef;});}if(_0x5eade8>=0x0){logger['info']('Agent\x20found!');}else{logger[_0xd552('0x30')]('Using\x20the\x20admin\x20account!');_0x5eade8=_[_0xd552('0x38')](_0x4b7f2d[_0xd552('0x36')],function(_0x4e2497){return _0x4e2497[_0xd552('0x39')][_0xd552('0x1a')]===_0xd552('0x3a');});}return _0x4b7f2d['users'][_0x5eade8];}else{if(_0x4b7f2d['user']['profile'][_0xd552('0x1a')]===_0xd552('0x3a')){logger[_0xd552('0x30')]('Using\x20the\x20admin\x20account!');user=_0x4b7f2d[_0xd552('0x3b')];return user;}else{logger[_0xd552('0x2d')](_0xd552('0x3c'),JSON[_0xd552('0xe')](_0x4b7f2d));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON['stringify'](_0x4b7f2d));}}}else{logger[_0xd552('0x2d')](_0xd552('0x3c'),JSON[_0xd552('0xe')](_0x4b7f2d));throw new Error(_0xd552('0x3d')+JSON['stringify'](_0x4b7f2d));}})[_0xd552('0x2c')](function(_0x1d173c){console[_0xd552('0x2d')](_0x1d173c);});}function getZohoUser(_0x466229,_0x5b29c9){return new BPromise(function(_0x56e6bf,_0x2970ee){request(_0x466229)[_0xd552('0x2b')](function(_0x43ff6e){var _0x5a7646=null;if(_0x43ff6e){_0x5a7646=_0x43ff6e[_0xd552('0x3e')][0x0];_0x5a7646[_0xd552('0x3f')]=_0x5b29c9;}_0x56e6bf(_0x5a7646);})[_0xd552('0x2c')](function(_0x2da73c){_0x2970ee(_0x2da73c);});});}function createEndUser(_0x3edf65,_0x4fe999,_0x558e59,_0x4c640c,_0x548c9d,_0x52b31c){var _0x558e59=getName(_0x558e59);return request({'method':_0xd552('0x25'),'uri':_0xd552('0x40')+_0x4fe999+_0xd552('0x41')+_[_0xd552('0x42')](_0x52b31c['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x558e59[0x1],'First_Name':_0x558e59[0x0],'Phone':_0x4c640c,'Owner':{'name':!_['isNil'](_0x548c9d[_0xd552('0x43')][_0xd552('0x1a')])?_0x548c9d[_0xd552('0x43')][_0xd552('0x1a')]:!_[_0xd552('0x1d')](_0x548c9d[_0xd552('0x44')])?_0x548c9d['first_name']+'\x20'+_0x548c9d[_0xd552('0x45')]:_0x548c9d['last_name'],'id':_0x548c9d['id']}}]},'headers':{'Authorization':_0xd552('0x35')+_0x3edf65},'json':!![]})[_0xd552('0x2b')](function(_0x281ce4){if(_0x281ce4&&_0x281ce4['data'][0x0]['code']===_0xd552('0x46')){var _0x2ddb5c=_0x281ce4[_0xd552('0x3e')][0x0][_0xd552('0x47')];_0x2ddb5c[_0xd552('0x3f')]=_[_0xd552('0x42')](_0x52b31c[_0xd552('0x48')])+'s';return _0x2ddb5c;}logger[_0xd552('0x2d')]('The\x20failing\x20result\x20is',JSON[_0xd552('0xe')](data));throw new Error(_0xd552('0x49')+JSON[_0xd552('0xe')](data));})[_0xd552('0x2c')](function(_0x20b0cc){console[_0xd552('0x4a')]('CREATE\x20ERROR',_0x20b0cc);});}function getEndUser(_0x4e0bee,_0x151ffa,_0x5d9d99,_0x303da7,_0x41e270,_0x325109,_0x2e54f4){var _0x267d67={'method':_0xd552('0x4b'),'uri':'','headers':{'Authorization':_0xd552('0x35')+_0x4e0bee},'json':!![]};switch(_0x2e54f4[_0xd552('0x4c')]){case'contact_lead':_0x267d67[_0xd552('0x4d')]=_0xd552('0x40')+_0x151ffa+_0xd552('0x4e')+_0x41e270+'))';return getZohoUser(_0x267d67,'Contacts')[_0xd552('0x2b')](function(_0x32cc73){if(_0x32cc73)return _0x32cc73;_0x267d67['uri']=_0xd552('0x40')+_0x151ffa+_0xd552('0x4f')+_0x41e270+'))';return getZohoUser(_0x267d67,_0xd552('0x50'))[_0xd552('0x2b')](function(_0x279830){if(_0x279830)return _0x279830;if(_0x2e54f4[_0xd552('0x48')]!='nothing'){return createEndUser(_0x4e0bee,_0x151ffa,_0x303da7,_0x41e270,_0x325109,_0x2e54f4);}else{return{};}});});break;case _0xd552('0x51'):_0x267d67[_0xd552('0x4d')]=_0xd552('0x40')+_0x151ffa+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x41e270+'))';return getZohoUser(_0x267d67,_0xd552('0x52'))['then'](function(_0x10dc32){if(_0x10dc32)return _0x10dc32;if(_0x2e54f4['moduleCreate']!='nothing'){return createEndUser(_0x4e0bee,_0x151ffa,_0x303da7,_0x41e270,_0x325109,_0x2e54f4);}else{return{};}});break;case _0xd552('0x53'):_0x267d67['uri']=_0xd552('0x40')+_0x151ffa+_0xd552('0x4f')+_0x41e270+'))';return getZohoUser(_0x267d67,'Leads')['then'](function(_0x3ebfaf){if(_0x3ebfaf)return _0x3ebfaf;if(_0x2e54f4[_0xd552('0x48')]!='nothing'){return createEndUser(_0x4e0bee,_0x151ffa,_0x303da7,_0x41e270,_0x325109,_0x2e54f4);}else{return{};}});break;}}function getCall(_0x98aefe,_0x1783d5,_0x5a25a6,_0x54c649,_0xe42c75,_0x260159,_0xa71d78,_0x3cbcaa){logger[_0xd552('0x30')](_0xd552('0x54'));var _0x5dfcb2={};_0x5dfcb2[_0xd552('0x55')]={'name':!_[_0xd552('0x1d')](_0x54c649[_0xd552('0x43')][_0xd552('0x1a')])&&!_[_0xd552('0x1d')](_0x54c649['profile'][_0xd552('0x1a')])&&_0x54c649['profile'][_0xd552('0x1a')]===_0xd552('0x56')?_0x54c649[_0xd552('0x43')][_0xd552('0x1a')]:!_['isNil'](_0x54c649['first_name'])?_0x54c649[_0xd552('0x44')]+'\x20'+_0x54c649[_0xd552('0x45')]:_0x54c649[_0xd552('0x45')],'id':_0x54c649['id']};_0x5dfcb2[_0xd552('0x57')]=intUtil[_0xd552('0x58')](_0x260159[_0xd552('0x59')],_0xa71d78,'\x20');_0x5dfcb2[_0xd552('0x5a')]=intUtil[_0xd552('0x58')](_0x260159[_0xd552('0x5b')],_0xa71d78,'\x0a');if(_0xe42c75[_0xd552('0x3f')]===_0xd552('0x52')){_0x5dfcb2[_0xd552('0x5c')]={'name':!_[_0xd552('0x1d')](_0xe42c75['Full_Name'])?_0xe42c75[_0xd552('0x5d')]:!_[_0xd552('0x1d')](_0xe42c75[_0xd552('0x5e')])?_0xe42c75[_0xd552('0x5e')]+'\x20'+_0xe42c75[_0xd552('0x5f')]:_0xe42c75[_0xd552('0x5f')],'id':_0xe42c75['id']};}if(_0xe42c75[_0xd552('0x3f')]===_0xd552('0x50')){_0x5dfcb2['What_Id']={'name':!_['isNil'](_0xe42c75[_0xd552('0x5d')])?_0xe42c75[_0xd552('0x5d')]:!_[_0xd552('0x1d')](_0xe42c75['First_Name'])?_0xe42c75[_0xd552('0x5e')]+'\x20'+_0xe42c75['Last_Name']:_0xe42c75['Last_Name'],'id':_0xe42c75['id']};_0x5dfcb2[_0xd552('0x60')]=_[_0xd552('0x42')](_0xe42c75[_0xd552('0x3f')]);}if(_0xa71d78[_0xd552('0x61')]){_0x5dfcb2['Call_Duration']=moment[_0xd552('0x62')](parseInt(_0xa71d78[_0xd552('0x61')])*0x3e8)[_0xd552('0x32')](_0xd552('0x63'));}else if(_0xa71d78[_0xd552('0x64')]&&_0xa71d78[_0xd552('0x65')]){_0x5dfcb2[_0xd552('0x66')]=moment[_0xd552('0x62')](moment(_0xa71d78['endtime'],'YYYY-MM-DDTHH:mm:ss')[_0xd552('0x67')](moment(_0xa71d78[_0xd552('0x68')],'YYYY-MM-DDTHH:mm:ss')))['format'](_0xd552('0x63'));}switch(_0xa71d78[_0xd552('0x69')]){case'called':_0x5dfcb2[_0xd552('0x6a')]=_0xd552('0x6b');break;case _0xd552('0x6c'):case'connect':_0x5dfcb2[_0xd552('0x6a')]=_0xd552('0x6d');break;case'rejected':_0x5dfcb2[_0xd552('0x6a')]='Rejected';break;case _0xd552('0x6e'):_0x5dfcb2['Call_Result']=_0xd552('0x6f');break;case _0xd552('0x70'):_0x5dfcb2[_0xd552('0x6a')]='Timeout';default:}_0x5dfcb2[_0xd552('0x71')]=(_0x3cbcaa===_0xd552('0x72')?moment(_0xa71d78[_0xd552('0x68')])[_0xd552('0x32')](_0xd552('0x73')):moment(_0xa71d78[_0xd552('0x74')])[_0xd552('0x32')](_0xd552('0x73')))||moment()[_0xd552('0x32')](_0xd552('0x73'));_0x5dfcb2[_0xd552('0x75')]=_0x3cbcaa||_0xd552('0x76');_0x5dfcb2=_[_0xd552('0x77')](_0x5dfcb2,getCustomFields(_0x260159[_0xd552('0x78')],_0xa71d78));return request({'method':_0xd552('0x25'),'uri':'https://www.zohoapis.'+_0x1783d5+'/crm/v2/Calls','headers':{'Authorization':_0xd552('0x35')+_0x98aefe},'body':{'data':[_0x5dfcb2]},'json':!![]})['then'](function(_0x542903){if(_0x542903&&_0x542903[_0xd552('0x3e')][0x0][_0xd552('0x79')]===_0xd552('0x46')){logger[_0xd552('0x30')](_0xd552('0x7a'));return{'id':_0x542903[_0xd552('0x3e')][0x0]['details']['id']};}})[_0xd552('0x2c')](function(_0x18fa10){logger[_0xd552('0x30')](_0xd552('0x7b'),_0x18fa10['stack']);console['log'](_0xd552('0x7b'),_0x18fa10);});}exports[_0xd552('0x7c')]=function(_0x1ec95c,_0x2a2f18,_0x3d82a6,_0x1903cb,_0xeb5582,_0x447d58){var _0x59b73c,_0x172ee3,_0x43176e;_0x447d58[_0xd552('0x7d')]=intUtil[_0xd552('0x7e')](_0x447d58['host']);_0x447d58['serverUrl']=intUtil[_0xd552('0x7e')](_0x447d58[_0xd552('0x7f')]);if(_0xeb5582&&_0xeb5582[_0xd552('0x80')]){logger[_0xd552('0x30')](_0xd552('0x81'),_0xd552('0x82'));_0x2a2f18['recordingURL']=_0x447d58[_0xd552('0x7f')]+'/api/voice/recordings/'+_0x2a2f18[_0xd552('0x83')]+_0xd552('0x84')+md5(_0x2a2f18[_0xd552('0x83')]);}else{_0x2a2f18[_0xd552('0x85')]='';}var _0x5bfe14=_0x447d58[_0xd552('0x7d')]===_0xd552('0x86')?'eu':_0xd552('0x87');return getAccessToken(_0x447d58)[_0xd552('0x2b')](function(_0x51607b){_0x43176e=_0x51607b;return getUser(_0x43176e,_0x5bfe14,_0x447d58,_0x1903cb[_0xd552('0x37')]);})[_0xd552('0x2b')](function(_0x436b8a){_0x59b73c=_0x436b8a;logger[_0xd552('0x30')](_0xd552('0x88'),_0x59b73c['id']);return getEndUser(_0x43176e,_0x5bfe14,_0x447d58,_0x2a2f18[_0xd552('0x89')],_0x2a2f18['calleridnum'],_0x59b73c,_0x3d82a6);})[_0xd552('0x2b')](function(_0x45df56){_0x172ee3=_0x45df56;return getCall(_0x43176e,_0x5bfe14,_0x447d58,_0x59b73c,_0x172ee3,_0x3d82a6,_0x2a2f18,'Inbound');})[_0xd552('0x2b')](function(_0xe4cbd5){if(_0xe4cbd5){logger[_0xd552('0x30')](_0xd552('0x8a'),_0xe4cbd5['id']);logger[_0xd552('0x30')](_0xd552('0x81'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xd552('0x32')](_0xd552('0x8b'),_0x1903cb[_0xd552('0x1a')]),_0xd552('0x8c'),{'uri':_0xd552('0x8d')+_0x447d58[_0xd552('0x7d')]+_0xd552('0x8e')+_0xe4cbd5['id']});}})[_0xd552('0x2c')](function(_0x3b734b){logger[_0xd552('0x2d')]('[QUEUE]',JSON[_0xd552('0xe')](_0x3b734b));});};exports['outbound']=function(_0x3af568,_0x39530c,_0x57eff7,_0x2065ed,_0x286d27,_0x57a887,_0x5f6109){var _0x708c81,_0xfd97cf,_0xf102b9;_0x57a887[_0xd552('0x7d')]=intUtil[_0xd552('0x7e')](_0x57a887['host']);_0x57a887[_0xd552('0x7f')]=intUtil[_0xd552('0x7e')](_0x57a887['serverUrl']);if(_0x5f6109&&_0x5f6109[_0xd552('0x8f')]&&_0x5f6109[_0xd552('0x8f')]!==_0xd552('0x90')){logger[_0xd552('0x30')](_0xd552('0x91'),'Recording\x20is\x20enabled!');_0x39530c[_0xd552('0x85')]=_0x57a887['serverUrl']+_0xd552('0x92')+_0x39530c[_0xd552('0x83')]+_0xd552('0x84')+md5(_0x39530c['uniqueid']);}var _0x3e1d33=_0x57a887[_0xd552('0x7d')]===_0xd552('0x86')?'eu':'com';return getAccessToken(_0x57a887)[_0xd552('0x2b')](function(_0x10a07e){_0xf102b9=_0x10a07e;return getUser(_0xf102b9,_0x3e1d33,_0x57a887,_0x2065ed[_0xd552('0x37')]);})[_0xd552('0x2b')](function(_0x480471){_0x708c81=_0x480471;logger[_0xd552('0x30')]('The\x20User\x20ID\x20is:',_0x708c81['id']);return getEndUser(_0xf102b9,_0x3e1d33,_0x57a887,_0x39530c['destcalleridname'],_0x39530c['destcalleridnum'],_0x708c81,_0x57eff7);})[_0xd552('0x2b')](function(_0x25c921){_0xfd97cf=_0x25c921;return getCall(_0xf102b9,_0x3e1d33,_0x57a887,_0x708c81,_0xfd97cf,_0x57eff7,_0x39530c,_0xd552('0x93'));})[_0xd552('0x2b')](function(_0x50056e){if(_0x50056e){logger[_0xd552('0x30')](_0xd552('0x8a'),_0x50056e['id']);logger['info'](_0xd552('0x91'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xd552('0x32')]('user:%s',_0x2065ed[_0xd552('0x1a')]),'trigger:browser:url',{'uri':_0xd552('0x8d')+_0x57a887[_0xd552('0x7d')]+_0xd552('0x8e')+_0x50056e['id']});}})['catch'](function(_0xeea0c3){logger[_0xd552('0x2d')](_0xd552('0x91'),JSON[_0xd552('0xe')](_0xeea0c3));});};exports['unmanaged']=function(_0x48c239,_0x513138,_0x5a643e,_0x4dbb1e,_0x1e8b84,_0x12cb7a){var _0x455672,_0x26a6fc,_0xd2be20;_0x12cb7a[_0xd552('0x7d')]=intUtil[_0xd552('0x7e')](_0x12cb7a[_0xd552('0x7d')]);_0x12cb7a[_0xd552('0x7f')]=intUtil[_0xd552('0x7e')](_0x12cb7a[_0xd552('0x7f')]);if(_0x1e8b84&&_0x1e8b84[_0xd552('0x80')]){logger['info']('['+_0x513138[_0xd552('0x69')][_0xd552('0x94')]()+']',_0xd552('0x82'));_0x513138['recordingURL']=_0x12cb7a[_0xd552('0x7f')]+_0xd552('0x92')+_0x513138[_0xd552('0x83')]+_0xd552('0x84')+md5(_0x513138['uniqueid']);}else{_0x513138['recordingURL']='';}var _0x419879=_0x12cb7a[_0xd552('0x7d')]===_0xd552('0x86')?'eu':_0xd552('0x87');return getAccessToken(_0x12cb7a)[_0xd552('0x2b')](function(_0x11a014){_0xd2be20=_0x11a014;return getUser(_0xd2be20,_0x419879,_0x12cb7a);})[_0xd552('0x2b')](function(_0x5131f9){_0x455672=_0x5131f9;logger[_0xd552('0x30')](_0xd552('0x88'),_0x455672['id']);return getEndUser(_0xd2be20,_0x419879,_0x12cb7a,_0x513138[_0xd552('0x89')],_0x513138[_0xd552('0x95')],_0x455672,_0x5a643e);})['then'](function(_0x190000){_0x26a6fc=_0x190000;return getCall(_0xd2be20,_0x419879,_0x12cb7a,_0x455672,_0x26a6fc,_0x5a643e,_0x513138,_0xd552('0x76'));})[_0xd552('0x2b')](function(_0x518ded){if(_0x518ded){logger[_0xd552('0x30')](_0xd552('0x8a'),_0x518ded['id']);}})['catch'](function(_0x23c834){logger[_0xd552('0x2d')]('['+_0x513138[_0xd552('0x69')]['toUpperCase']()+']',JSON[_0xd552('0xe')](_0x23c834));});}; \ 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 b32aa8b..4ed2fbf 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 _0x0f7b=['data3','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache','../../../../config/logger','exec','data2'];(function(_0xa656ef,_0x3d31df){var _0x20e81=function(_0x128119){while(--_0x128119){_0xa656ef['push'](_0xa656ef['shift']());}};_0x20e81(++_0x3d31df);}(_0x0f7b,0x66));var _0xb0f7=function(_0x307d86,_0x9264f2){_0x307d86=_0x307d86-0x0;var _0x361745=_0x0f7b[_0x307d86];return _0x361745;};'use strict';var util=require(_0xb0f7('0x0'));var sh=require(_0xb0f7('0x1'));var Mustache=require(_0xb0f7('0x2'));var logger=require(_0xb0f7('0x3'))('trigger');exports[_0xb0f7('0x4')]=function(_0x5c81b1,_0x6e430a){var _0x37f33b=_0x5c81b1[_0xb0f7('0x5')]?_0x5c81b1[_0xb0f7('0x5')]:'Script';var _0x21d1cd=_0x5c81b1['data3']?Mustache['render'](_0x5c81b1[_0xb0f7('0x6')],_0x6e430a):_0x6e430a;sh['exec'](_0x21d1cd,function(_0x7c2568,_0x8d48b2,_0xa1ca36){if(_0x7c2568!==0x0){logger[_0xb0f7('0x7')](util[_0xb0f7('0x8')](_0xb0f7('0x9'),_0x37f33b,_0x21d1cd,_0x7c2568,_0xa1ca36));}else{logger[_0xb0f7('0xa')](util[_0xb0f7('0x8')](_0xb0f7('0xb'),_0x37f33b,_0x21d1cd,_0x8d48b2));}});}; \ No newline at end of file +var _0x78d3=['format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache','trigger','data2','Script','data3','exec'];(function(_0xfe3235,_0x3b8a96){var _0x5dbab7=function(_0x1e8f40){while(--_0x1e8f40){_0xfe3235['push'](_0xfe3235['shift']());}};_0x5dbab7(++_0x3b8a96);}(_0x78d3,0xc4));var _0x378d=function(_0x119e9f,_0x3f08a1){_0x119e9f=_0x119e9f-0x0;var _0x365410=_0x78d3[_0x119e9f];return _0x365410;};'use strict';var util=require(_0x378d('0x0'));var sh=require(_0x378d('0x1'));var Mustache=require(_0x378d('0x2'));var logger=require('../../../../config/logger')(_0x378d('0x3'));exports['exec']=function(_0x57e803,_0x4cfc79){var _0x4ef5f7=_0x57e803[_0x378d('0x4')]?_0x57e803[_0x378d('0x4')]:_0x378d('0x5');var _0x316c59=_0x57e803[_0x378d('0x6')]?Mustache['render'](_0x57e803[_0x378d('0x6')],_0x4cfc79):_0x4cfc79;sh[_0x378d('0x7')](_0x316c59,function(_0x466688,_0x9ef970,_0x3f1db){if(_0x466688!==0x0){logger['error'](util[_0x378d('0x8')](_0x378d('0x9'),_0x4ef5f7,_0x316c59,_0x466688,_0x3f1db));}else{logger[_0x378d('0xa')](util[_0x378d('0x8')](_0x378d('0xb'),_0x4ef5f7,_0x316c59,_0x9ef970));}});}; \ 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 0948096..73dd86e 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 _0xc1b2=['name','message','request-promise','util','lodash','trigger','exec','toUpperCase','render','data2','number','data5','data6','error','stack','data1','GET','DELETE','POST','PUT','data7','parse','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','then',',\x20request\x20body:\x20','object','stringify','info','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','catch','statusCode'];(function(_0x18e5fc,_0x3cdb1e){var _0x5ada80=function(_0x372019){while(--_0x372019){_0x18e5fc['push'](_0x18e5fc['shift']());}};_0x5ada80(++_0x3cdb1e);}(_0xc1b2,0x1bc));var _0x2c1b=function(_0x4b5b2c,_0x356dc3){_0x4b5b2c=_0x4b5b2c-0x0;var _0x32f5b4=_0xc1b2[_0x4b5b2c];return _0x32f5b4;};'use strict';var rp=require(_0x2c1b('0x0'));var util=require(_0x2c1b('0x1'));var _=require(_0x2c1b('0x2'));var Mustache=require('mustache');var logger=require('../../../../config/logger')(_0x2c1b('0x3'));exports[_0x2c1b('0x4')]=function(_0x5a796c,_0x408190){var _0x821006,_0x4a4534;var _0x2a04cb={'method':_0x5a796c['data1'][_0x2c1b('0x5')](),'uri':Mustache[_0x2c1b('0x6')](_0x5a796c[_0x2c1b('0x7')],_0x408190),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x5a796c['data5'])===_0x2c1b('0x8')&&parseInt(_0x5a796c['data5'])>=0x1&&parseInt(_0x5a796c[_0x2c1b('0x9')])<=0xa?parseInt(_0x5a796c['data5'])*0x3e8:0x5*0x3e8};try{_0x2a04cb['headers']=_0x5a796c[_0x2c1b('0xa')]?JSON['parse'](Mustache[_0x2c1b('0x6')](_0x5a796c[_0x2c1b('0xa')],_0x408190)):{};}catch(_0x1204a8){logger[_0x2c1b('0xb')](_0x1204a8[_0x2c1b('0xc')]);}switch(_0x5a796c[_0x2c1b('0xd')][_0x2c1b('0x5')]()){case _0x2c1b('0xe'):case _0x2c1b('0xf'):_0x821006=null;_0x2a04cb['qs']=_0x408190;break;case _0x2c1b('0x10'):case _0x2c1b('0x11'):if(_0x5a796c[_0x2c1b('0x12')]){try{_0x821006=JSON[_0x2c1b('0x13')](Mustache[_0x2c1b('0x6')](_0x5a796c[_0x2c1b('0x12')],_0x408190));_0x2a04cb[_0x2c1b('0x14')]=_0x821006;}catch(_0x497321){logger[_0x2c1b('0xb')](_0x497321[_0x2c1b('0xc')]);logger[_0x2c1b('0xb')](_0x2c1b('0x15'));}}else{_0x821006=_0x408190;_0x2a04cb[_0x2c1b('0x14')]=_0x821006;}break;}logger['info'](util[_0x2c1b('0x16')](_0x2c1b('0x17'),_0x5a796c['data1'],_0x5a796c[_0x2c1b('0x7')],JSON['stringify'](_0x2a04cb)));rp(_0x2a04cb)[_0x2c1b('0x18')](function(_0x117d4a){_0x821006=!_['isNil'](_0x821006)?_0x2c1b('0x19')+_0x821006:'';_0x4a4534=typeof _0x117d4a[_0x2c1b('0x14')]===_0x2c1b('0x1a')?JSON[_0x2c1b('0x1b')](_0x117d4a[_0x2c1b('0x14')]):_0x117d4a[_0x2c1b('0x14')];logger[_0x2c1b('0x1c')](util['format'](_0x2c1b('0x1d'),_0x5a796c[_0x2c1b('0xd')],_0x5a796c[_0x2c1b('0x7')],_0x117d4a['statusCode'],_0x4a4534));})[_0x2c1b('0x1e')](function(_0x1fb00d){logger[_0x2c1b('0xb')](util[_0x2c1b('0x16')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x5a796c[_0x2c1b('0xd')],_0x5a796c[_0x2c1b('0x7')],_0x1fb00d[_0x2c1b('0x1f')],_0x1fb00d[_0x2c1b('0x20')],_0x1fb00d[_0x2c1b('0x21')]));});}; \ No newline at end of file +var _0x8ff4=['isNil','object','info','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','message','request-promise','util','lodash','mustache','../../../../config/logger','trigger','exec','render','data2','number','data5','headers','data6','error','stack','data1','GET','DELETE','POST','data7','parse','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then'];(function(_0x3121cb,_0x55b697){var _0xf9cc66=function(_0x4a16e1){while(--_0x4a16e1){_0x3121cb['push'](_0x3121cb['shift']());}};_0xf9cc66(++_0x55b697);}(_0x8ff4,0x6d));var _0x48ff=function(_0xf3f58c,_0x38b821){_0xf3f58c=_0xf3f58c-0x0;var _0x53d7b6=_0x8ff4[_0xf3f58c];return _0x53d7b6;};'use strict';var rp=require(_0x48ff('0x0'));var util=require(_0x48ff('0x1'));var _=require(_0x48ff('0x2'));var Mustache=require(_0x48ff('0x3'));var logger=require(_0x48ff('0x4'))(_0x48ff('0x5'));exports[_0x48ff('0x6')]=function(_0xac899e,_0x2759d5){var _0x11f704,_0x407cab;var _0x203feb={'method':_0xac899e['data1']['toUpperCase'](),'uri':Mustache[_0x48ff('0x7')](_0xac899e[_0x48ff('0x8')],_0x2759d5),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0xac899e['data5'])===_0x48ff('0x9')&&parseInt(_0xac899e[_0x48ff('0xa')])>=0x1&&parseInt(_0xac899e[_0x48ff('0xa')])<=0xa?parseInt(_0xac899e[_0x48ff('0xa')])*0x3e8:0x5*0x3e8};try{_0x203feb[_0x48ff('0xb')]=_0xac899e[_0x48ff('0xc')]?JSON['parse'](Mustache[_0x48ff('0x7')](_0xac899e[_0x48ff('0xc')],_0x2759d5)):{};}catch(_0x25820e){logger[_0x48ff('0xd')](_0x25820e[_0x48ff('0xe')]);}switch(_0xac899e[_0x48ff('0xf')]['toUpperCase']()){case _0x48ff('0x10'):case _0x48ff('0x11'):_0x11f704=null;_0x203feb['qs']=_0x2759d5;break;case _0x48ff('0x12'):case'PUT':if(_0xac899e[_0x48ff('0x13')]){try{_0x11f704=JSON[_0x48ff('0x14')](Mustache[_0x48ff('0x7')](_0xac899e[_0x48ff('0x13')],_0x2759d5));_0x203feb[_0x48ff('0x15')]=_0x11f704;}catch(_0x59aa36){logger[_0x48ff('0xd')](_0x59aa36['stack']);logger['error'](_0x48ff('0x16'));}}else{_0x11f704=_0x2759d5;_0x203feb['body']=_0x11f704;}break;}logger['info'](util[_0x48ff('0x17')](_0x48ff('0x18'),_0xac899e[_0x48ff('0xf')],_0xac899e[_0x48ff('0x8')],JSON[_0x48ff('0x19')](_0x203feb)));rp(_0x203feb)[_0x48ff('0x1a')](function(_0x2dc6d4){_0x11f704=!_[_0x48ff('0x1b')](_0x11f704)?',\x20request\x20body:\x20'+_0x11f704:'';_0x407cab=typeof _0x2dc6d4[_0x48ff('0x15')]===_0x48ff('0x1c')?JSON[_0x48ff('0x19')](_0x2dc6d4[_0x48ff('0x15')]):_0x2dc6d4[_0x48ff('0x15')];logger[_0x48ff('0x1d')](util[_0x48ff('0x17')](_0x48ff('0x1e'),_0xac899e[_0x48ff('0xf')],_0xac899e[_0x48ff('0x8')],_0x2dc6d4[_0x48ff('0x1f')],_0x407cab));})['catch'](function(_0x15076d){logger[_0x48ff('0xd')](util['format'](_0x48ff('0x20'),_0xac899e['data1'],_0xac899e[_0x48ff('0x8')],_0x15076d[_0x48ff('0x1f')],_0x15076d['name'],_0x15076d[_0x48ff('0x21')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 4eba4b8..f2fc7ee 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 _0x9c05=['catch','jayson/promise','bluebird','../../config/logger','routing','client','Request','request','debug','rpc','error','message','result'];(function(_0x502051,_0x22f68e){var _0x948075=function(_0x311dd0){while(--_0x311dd0){_0x502051['push'](_0x502051['shift']());}};_0x948075(++_0x22f68e);}(_0x9c05,0x1ae));var _0x59c0=function(_0x5591ff,_0x2236d2){_0x5591ff=_0x5591ff-0x0;var _0x2b7c7e=_0x9c05[_0x5591ff];return _0x2b7c7e;};'use strict';var jayson=require(_0x59c0('0x0'));var BPromise=require(_0x59c0('0x1'));var logger=require(_0x59c0('0x2'))(_0x59c0('0x3'));var client=jayson[_0x59c0('0x4')]['http']({'port':0x2329});client[_0x59c0('0x5')]=function(_0x3ebba1,_0x3ad0a3){return new BPromise(function(_0x1c2812,_0x409794){return client[_0x59c0('0x6')](_0x3ebba1,_0x3ad0a3)['then'](function(_0x11f1c3){logger[_0x59c0('0x7')](_0x59c0('0x8'),_0x59c0('0x3'),_0x3ebba1,_0x3ad0a3,_0x11f1c3);if(_0x11f1c3['error']){logger[_0x59c0('0x9')]('rpc',_0x59c0('0x3'),_0x3ebba1,_0x11f1c3[_0x59c0('0x9')]['message'],_0x3ad0a3);return _0x409794(_0x11f1c3[_0x59c0('0x9')][_0x59c0('0xa')]);}else{return _0x1c2812(_0x11f1c3[_0x59c0('0xb')]);}})[_0x59c0('0xc')](function(_0x3b5b95){logger[_0x59c0('0x9')]('rpc',_0x59c0('0x3'),_0x3ebba1,_0x3b5b95,_0x3ad0a3);return _0x409794(_0x3b5b95);});});};module['exports']=client; \ No newline at end of file +var _0x58a3=['debug','rpc','routing','error','message','result','catch','exports','jayson/promise','../../config/logger','client','http','request'];(function(_0x5ee84d,_0x236593){var _0x57ed4a=function(_0x2aebd8){while(--_0x2aebd8){_0x5ee84d['push'](_0x5ee84d['shift']());}};_0x57ed4a(++_0x236593);}(_0x58a3,0xff));var _0x358a=function(_0x2fff83,_0x29d5fe){_0x2fff83=_0x2fff83-0x0;var _0xa2a722=_0x58a3[_0x2fff83];return _0xa2a722;};'use strict';var jayson=require(_0x358a('0x0'));var BPromise=require('bluebird');var logger=require(_0x358a('0x1'))('routing');var client=jayson[_0x358a('0x2')][_0x358a('0x3')]({'port':0x2329});client['Request']=function(_0x14a040,_0x4ed70a){return new BPromise(function(_0xf549a0,_0x220e4c){return client[_0x358a('0x4')](_0x14a040,_0x4ed70a)['then'](function(_0x3e36cf){logger[_0x358a('0x5')](_0x358a('0x6'),_0x358a('0x7'),_0x14a040,_0x4ed70a,_0x3e36cf);if(_0x3e36cf[_0x358a('0x8')]){logger[_0x358a('0x8')](_0x358a('0x6'),_0x358a('0x7'),_0x14a040,_0x3e36cf[_0x358a('0x8')][_0x358a('0x9')],_0x4ed70a);return _0x220e4c(_0x3e36cf[_0x358a('0x8')][_0x358a('0x9')]);}else{return _0xf549a0(_0x3e36cf[_0x358a('0xa')]);}})[_0x358a('0xb')](function(_0x51364e){logger['error'](_0x358a('0x6'),_0x358a('0x7'),_0x14a040,_0x51364e,_0x4ed70a);return _0x220e4c(_0x51364e);});});};module[_0x358a('0xc')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 6160b7b..2d8a19b 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 _0xc6b7=['email','resolve','then','getMailAccounts','initMailAccounts','refresh','mailAccounts','getSettings','loginMailFrequency','error','Email\x20service\x20initialization','./server','./realtime','./lib/email','./rpc/mailAccount'];(function(_0x366ca4,_0x2f8bd6){var _0x5c025d=function(_0x658e4a){while(--_0x658e4a){_0x366ca4['push'](_0x366ca4['shift']());}};_0x5c025d(++_0x2f8bd6);}(_0xc6b7,0x1cd));var _0x7c6b=function(_0x279ab4,_0x68df8c){_0x279ab4=_0x279ab4-0x0;var _0x6952f8=_0xc6b7[_0x279ab4];return _0x6952f8;};'use strict';var server=require(_0x7c6b('0x0'));var Realtime=require(_0x7c6b('0x1'));var EmailChannel=require(_0x7c6b('0x2'));var mailAccount=require(_0x7c6b('0x3'));var setting=require('./rpc/setting');var logger=require('../../config/logger')(_0x7c6b('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x7c6b('0x5')]()[_0x7c6b('0x6')](mailAccount[_0x7c6b('0x7')]())[_0x7c6b('0x6')](realtime[_0x7c6b('0x8')]())['then'](function(){email[_0x7c6b('0x9')](realtime[_0x7c6b('0xa')]);return realtime;});}function main(){return server['listen'](realtime,email)[_0x7c6b('0x6')](function(){return initRealtime();})[_0x7c6b('0x6')](function(){return setting[_0x7c6b('0xb')]();})['then'](function(_0x43a305){return setInterval(initRealtime,_0x43a305[_0x7c6b('0xc')]*0x3e8);})['catch'](function(_0x100651){logger[_0x7c6b('0xd')](_0x7c6b('0xe'),_0x100651);});}main(); \ No newline at end of file +var _0x5e0a=['loginMailFrequency','Email\x20service\x20initialization','./server','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger','email','then','initMailAccounts','refresh','mailAccounts'];(function(_0x393940,_0x5da3e7){var _0x3dcffc=function(_0x290584){while(--_0x290584){_0x393940['push'](_0x393940['shift']());}};_0x3dcffc(++_0x5da3e7);}(_0x5e0a,0x195));var _0xa5e0=function(_0x1d9bcd,_0x259c97){_0x1d9bcd=_0x1d9bcd-0x0;var _0x528625=_0x5e0a[_0x1d9bcd];return _0x528625;};'use strict';var server=require(_0xa5e0('0x0'));var Realtime=require(_0xa5e0('0x1'));var EmailChannel=require(_0xa5e0('0x2'));var mailAccount=require(_0xa5e0('0x3'));var setting=require(_0xa5e0('0x4'));var logger=require(_0xa5e0('0x5'))(_0xa5e0('0x6'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise['resolve']()[_0xa5e0('0x7')](mailAccount['getMailAccounts']())[_0xa5e0('0x7')](realtime[_0xa5e0('0x8')]())[_0xa5e0('0x7')](function(){email[_0xa5e0('0x9')](realtime[_0xa5e0('0xa')]);return realtime;});}function main(){return server['listen'](realtime,email)[_0xa5e0('0x7')](function(){return initRealtime();})[_0xa5e0('0x7')](function(){return setting['getSettings']();})['then'](function(_0x48aa46){return setInterval(initRealtime,_0x48aa46[_0xa5e0('0xb')]*0x3e8);})['catch'](function(_0x386bf6){logger['error'](_0xa5e0('0xc'),_0x386bf6);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index a776e38..59ce8a2 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 _0xcc5e=['email','defaults','redis','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','prototype','emit','name','key','active','Imap','status','messageStatus','total','isNil','mailAccount:update','service','custom','provider','hasOwnProperty','box','handleImapBox','bind','handleImapEmail','end','handleImapEnd','error','disabled','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','then','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','lastSync','handleImapError','sendMail','smtp','send','verifySmtp','Smtp','verify','exports','lodash','bluebird','md5','ioredis','../../../config/environment','../../../config/logger'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0xcc5e,0x12b));var _0xecc5=function(_0x40348a,_0x5c0bb3){_0x40348a=_0x40348a-0x0;var _0x290d46=_0xcc5e[_0x40348a];return _0x290d46;};'use strict';var _=require(_0xecc5('0x0'));var moment=require('moment');var BPromise=require(_0xecc5('0x1'));var md5=require(_0xecc5('0x2'));var Redis=require(_0xecc5('0x3'));var config=require(_0xecc5('0x4'));var logger=require(_0xecc5('0x5'))(_0xecc5('0x6'));config['redis']=_[_0xecc5('0x7')](config[_0xecc5('0x8')],{'host':_0xecc5('0x9'),'port':0x18eb});var io=require(_0xecc5('0xa'))(new Redis(config[_0xecc5('0x8')]));var EmailImap=require(_0xecc5('0xb'));var EmailSmtp=require(_0xecc5('0xc'));var mailAccount=require(_0xecc5('0xd'));var md5Accounts={};function EmailChannel(_0x3ab37f){logger[_0xecc5('0xe')](_0xecc5('0xf'));this['mailAccounts']=_0x3ab37f[_0xecc5('0x10')];this[_0xecc5('0x11')]={};this['smtp']=new EmailSmtp();}EmailChannel[_0xecc5('0x12')][_0xecc5('0x13')]=function(_0x9945e6){var _0x330a8c=this[_0xecc5('0x10')][_0x9945e6];var _0x6e64a5={'id':_0x330a8c['id'],'name':_0x330a8c[_0xecc5('0x14')],'key':_0x330a8c[_0xecc5('0x15')],'active':_0x330a8c[_0xecc5('0x16')],'Imap':{'status':_0x330a8c[_0xecc5('0x17')][_0xecc5('0x18')],'messageStatus':_0x330a8c[_0xecc5('0x17')][_0xecc5('0x19')],'total':_0x330a8c[_0xecc5('0x17')][_0xecc5('0x1a')]}};if(_[_0xecc5('0x1b')](md5Accounts[_0x9945e6])){md5Accounts[_0x9945e6]={};}var _0x17610c=md5(JSON['stringify'](_0x6e64a5));if(md5Accounts[_0x9945e6]['md5']!==_0x17610c){md5Accounts[_0x9945e6]['md5']=_0x17610c;io[_0xecc5('0x13')](_0xecc5('0x1c'),_0x6e64a5);}};EmailChannel[_0xecc5('0x12')]['refresh']=function(_0xdbf347){for(var _0x30cee1 in _0xdbf347){if(_0xdbf347['hasOwnProperty'](_0x30cee1)){if(_0xdbf347[_0x30cee1][_0xecc5('0x17')]&&_0xdbf347[_0x30cee1]['active']){var _0x168019=_0xdbf347[_0x30cee1][_0xecc5('0x17')];if(!_0x168019[_0xecc5('0x1d')]&&_0xdbf347[_0x30cee1]['provider']!==_0xecc5('0x1e'))_0x168019['service']=_0xdbf347[_0x30cee1][_0xecc5('0x1f')];if(!this[_0xecc5('0x11')][_0xecc5('0x20')](_0x168019['id'])){this[_0xecc5('0x11')][_0x168019['id']]=new EmailImap(_0x168019,_0xdbf347[_0x30cee1][_0xecc5('0x6')]);this[_0xecc5('0x11')][_0x168019['id']]['on'](_0xecc5('0x21'),this[_0xecc5('0x22')][_0xecc5('0x23')](this,_0x30cee1));this[_0xecc5('0x11')][_0x168019['id']]['on'](_0xecc5('0x6'),this[_0xecc5('0x24')][_0xecc5('0x23')](this,_0x30cee1));this[_0xecc5('0x11')][_0x168019['id']]['on'](_0xecc5('0x25'),this[_0xecc5('0x26')][_0xecc5('0x23')](this,_0x30cee1));this['imapAccounts'][_0x168019['id']]['on'](_0xecc5('0x27'),this['handleImapError'][_0xecc5('0x23')](this,_0x30cee1));}}else{if(_['isNil'](this[_0xecc5('0x10')][_0x30cee1][_0xecc5('0x17')])){this['mailAccounts'][_0x30cee1]['Imap']={};}this[_0xecc5('0x10')][_0x30cee1]['Imap']['status']=_0xecc5('0x28');this[_0xecc5('0x10')][_0x30cee1]['Imap']['messageStatus']='';this[_0xecc5('0x13')](_0x30cee1);}}}};EmailChannel[_0xecc5('0x12')][_0xecc5('0x22')]=function(_0x345f02,_0x194a31){if(this[_0xecc5('0x10')][_0x345f02]){this[_0xecc5('0x10')][_0x345f02]['Imap'][_0xecc5('0x18')]=_0xecc5('0x29');this['mailAccounts'][_0x345f02][_0xecc5('0x17')][_0xecc5('0x19')]=_0x194a31['name'];if(_0x194a31[_0xecc5('0x2a')]){this[_0xecc5('0x10')][_0x345f02]['Imap'][_0xecc5('0x1a')]=_0x194a31[_0xecc5('0x2a')][_0xecc5('0x1a')];}return this[_0xecc5('0x13')](_0x345f02);}};EmailChannel['prototype'][_0xecc5('0x24')]=function(_0x5c8ae5,_0x572d74){logger[_0xecc5('0xe')](_0xecc5('0x2b'),_0x572d74[_0xecc5('0x2c')],_0x572d74[_0xecc5('0x2d')],_0x572d74[_0xecc5('0x2e')],_0x5c8ae5);if(this[_0xecc5('0x10')][_0x5c8ae5]){return mailAccount[_0xecc5('0x2f')](_0x5c8ae5,_0x572d74)[_0xecc5('0x30')](function(_0xd3f219){if(_0xd3f219){logger[_0xecc5('0xe')]('Mail\x20accepted\x20from\x20routing');}})[_0xecc5('0x31')](function(_0x4f6e21){logger['error'](_0xecc5('0x32'),JSON[_0xecc5('0x33')](_0x4f6e21));});}};EmailChannel['prototype'][_0xecc5('0x26')]=function(_0x1b90c1){if(this['mailAccounts'][_0x1b90c1]&&this['mailAccounts'][_0x1b90c1]['Imap']){if(this[_0xecc5('0x11')][this[_0xecc5('0x10')][_0x1b90c1]['Imap']['id']]){delete this[_0xecc5('0x11')][this['mailAccounts'][_0x1b90c1][_0xecc5('0x17')]['id']];}this[_0xecc5('0x10')][_0x1b90c1][_0xecc5('0x17')][_0xecc5('0x34')]=moment();this[_0xecc5('0x13')](_0x1b90c1);}};EmailChannel['prototype'][_0xecc5('0x35')]=function(_0x2ee4dc,_0x1fa3a4){if(this[_0xecc5('0x10')][_0x2ee4dc]){this['mailAccounts'][_0x2ee4dc][_0xecc5('0x17')][_0xecc5('0x18')]=_0xecc5('0x27');this['mailAccounts'][_0x2ee4dc]['Imap'][_0xecc5('0x19')]=_0x1fa3a4;return this[_0xecc5('0x13')](_0x2ee4dc);}};EmailChannel[_0xecc5('0x12')][_0xecc5('0x36')]=function(_0x5ba115,_0x58cf98){return this[_0xecc5('0x37')][_0xecc5('0x38')](_0x5ba115,_0x58cf98);};EmailChannel['prototype'][_0xecc5('0x39')]=function(_0x4bd25c){var _0xd28549=this;if(this[_0xecc5('0x10')][_0x4bd25c['id']]){if(_[_0xecc5('0x1b')](this[_0xecc5('0x10')][_0x4bd25c['id']][_0xecc5('0x3a')])){this[_0xecc5('0x10')][_0x4bd25c['id']][_0xecc5('0x3a')]={};}this[_0xecc5('0x10')][_0x4bd25c['id']][_0xecc5('0x3a')][_0xecc5('0x34')]=moment();return new BPromise(function(_0x1de791,_0x1d8414){return _0xd28549['smtp']['verify'](_0x4bd25c)[_0xecc5('0x30')](function(_0x1af099){_0xd28549[_0xecc5('0x10')][_0x4bd25c['id']][_0xecc5('0x3a')]['status']='verified';_0xd28549[_0xecc5('0x10')][_0x4bd25c['id']][_0xecc5('0x3a')][_0xecc5('0x19')]='';_0xd28549[_0xecc5('0x13')](_0x4bd25c['id']);_0x1de791(_0x1af099);})[_0xecc5('0x31')](function(_0x7902aa){_0xd28549['mailAccounts'][_0x4bd25c['id']][_0xecc5('0x3a')][_0xecc5('0x18')]=_0xecc5('0x27');_0xd28549[_0xecc5('0x10')][_0x4bd25c['id']][_0xecc5('0x3a')]['messageStatus']=_0x7902aa;_0xd28549[_0xecc5('0x13')](_0x4bd25c['id']);_0x1d8414(_0x7902aa);});});}return this[_0xecc5('0x37')][_0xecc5('0x3b')](_0x4bd25c);};module[_0xecc5('0x3c')]=EmailChannel; \ No newline at end of file +var _0x0034=['notify','then','Mail\x20accepted\x20from\x20routing','Mail\x20not\x20accepted\x20from\x20routing\x20%s','send','Smtp','lastSync','verify','verified','catch','moment','bluebird','ioredis','../../../config/environment','../../../config/logger','email','redis','defaults','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','Imap','status','total','stringify','md5','mailAccount:update','hasOwnProperty','active','service','provider','custom','box','bind','handleImapEmail','handleImapEnd','error','handleImapError','isNil','disabled','handleImapBox','messageStatus','messages','from'];(function(_0x454335,_0x3e5fd8){var _0x477d7b=function(_0x1c8584){while(--_0x1c8584){_0x454335['push'](_0x454335['shift']());}};_0x477d7b(++_0x3e5fd8);}(_0x0034,0xac));var _0x4003=function(_0x3ea5e1,_0x17c486){_0x3ea5e1=_0x3ea5e1-0x0;var _0x1b81d7=_0x0034[_0x3ea5e1];return _0x1b81d7;};'use strict';var _=require('lodash');var moment=require(_0x4003('0x0'));var BPromise=require(_0x4003('0x1'));var md5=require('md5');var Redis=require(_0x4003('0x2'));var config=require(_0x4003('0x3'));var logger=require(_0x4003('0x4'))(_0x4003('0x5'));config[_0x4003('0x6')]=_[_0x4003('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x4003('0x8'))(new Redis(config[_0x4003('0x6')]));var EmailImap=require(_0x4003('0x9'));var EmailSmtp=require(_0x4003('0xa'));var mailAccount=require(_0x4003('0xb'));var md5Accounts={};function EmailChannel(_0x33fed1){logger[_0x4003('0xc')](_0x4003('0xd'));this[_0x4003('0xe')]=_0x33fed1[_0x4003('0xe')];this[_0x4003('0xf')]={};this[_0x4003('0x10')]=new EmailSmtp();}EmailChannel[_0x4003('0x11')][_0x4003('0x12')]=function(_0xc871f1){var _0x1325ae=this[_0x4003('0xe')][_0xc871f1];var _0x4cf172={'id':_0x1325ae['id'],'name':_0x1325ae[_0x4003('0x13')],'key':_0x1325ae[_0x4003('0x14')],'active':_0x1325ae['active'],'Imap':{'status':_0x1325ae[_0x4003('0x15')][_0x4003('0x16')],'messageStatus':_0x1325ae['Imap']['messageStatus'],'total':_0x1325ae[_0x4003('0x15')][_0x4003('0x17')]}};if(_['isNil'](md5Accounts[_0xc871f1])){md5Accounts[_0xc871f1]={};}var _0x314ae2=md5(JSON[_0x4003('0x18')](_0x4cf172));if(md5Accounts[_0xc871f1][_0x4003('0x19')]!==_0x314ae2){md5Accounts[_0xc871f1][_0x4003('0x19')]=_0x314ae2;io[_0x4003('0x12')](_0x4003('0x1a'),_0x4cf172);}};EmailChannel[_0x4003('0x11')]['refresh']=function(_0x572f67){for(var _0x3849b9 in _0x572f67){if(_0x572f67[_0x4003('0x1b')](_0x3849b9)){if(_0x572f67[_0x3849b9][_0x4003('0x15')]&&_0x572f67[_0x3849b9][_0x4003('0x1c')]){var _0x2870c6=_0x572f67[_0x3849b9][_0x4003('0x15')];if(!_0x2870c6[_0x4003('0x1d')]&&_0x572f67[_0x3849b9][_0x4003('0x1e')]!==_0x4003('0x1f'))_0x2870c6['service']=_0x572f67[_0x3849b9][_0x4003('0x1e')];if(!this[_0x4003('0xf')][_0x4003('0x1b')](_0x2870c6['id'])){this['imapAccounts'][_0x2870c6['id']]=new EmailImap(_0x2870c6,_0x572f67[_0x3849b9][_0x4003('0x5')]);this[_0x4003('0xf')][_0x2870c6['id']]['on'](_0x4003('0x20'),this['handleImapBox'][_0x4003('0x21')](this,_0x3849b9));this['imapAccounts'][_0x2870c6['id']]['on']('email',this[_0x4003('0x22')]['bind'](this,_0x3849b9));this['imapAccounts'][_0x2870c6['id']]['on']('end',this[_0x4003('0x23')][_0x4003('0x21')](this,_0x3849b9));this['imapAccounts'][_0x2870c6['id']]['on'](_0x4003('0x24'),this[_0x4003('0x25')][_0x4003('0x21')](this,_0x3849b9));}}else{if(_[_0x4003('0x26')](this[_0x4003('0xe')][_0x3849b9][_0x4003('0x15')])){this[_0x4003('0xe')][_0x3849b9][_0x4003('0x15')]={};}this[_0x4003('0xe')][_0x3849b9][_0x4003('0x15')][_0x4003('0x16')]=_0x4003('0x27');this['mailAccounts'][_0x3849b9]['Imap']['messageStatus']='';this[_0x4003('0x12')](_0x3849b9);}}}};EmailChannel[_0x4003('0x11')][_0x4003('0x28')]=function(_0x280430,_0x50dabc){if(this[_0x4003('0xe')][_0x280430]){this[_0x4003('0xe')][_0x280430][_0x4003('0x15')]['status']='connected';this['mailAccounts'][_0x280430]['Imap'][_0x4003('0x29')]=_0x50dabc['name'];if(_0x50dabc[_0x4003('0x2a')]){this[_0x4003('0xe')][_0x280430][_0x4003('0x15')][_0x4003('0x17')]=_0x50dabc[_0x4003('0x2a')]['total'];}return this['emit'](_0x280430);}};EmailChannel[_0x4003('0x11')][_0x4003('0x22')]=function(_0x357a3d,_0x554a91){logger[_0x4003('0xc')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x554a91['firstName'],_0x554a91['lastName'],_0x554a91[_0x4003('0x2b')],_0x357a3d);if(this[_0x4003('0xe')][_0x357a3d]){return mailAccount[_0x4003('0x2c')](_0x357a3d,_0x554a91)[_0x4003('0x2d')](function(_0x30d7f1){if(_0x30d7f1){logger['info'](_0x4003('0x2e'));}})['catch'](function(_0x5cdfdd){logger[_0x4003('0x24')](_0x4003('0x2f'),JSON[_0x4003('0x18')](_0x5cdfdd));});}};EmailChannel[_0x4003('0x11')]['handleImapEnd']=function(_0x47c865){if(this[_0x4003('0xe')][_0x47c865]&&this[_0x4003('0xe')][_0x47c865][_0x4003('0x15')]){if(this[_0x4003('0xf')][this['mailAccounts'][_0x47c865][_0x4003('0x15')]['id']]){delete this[_0x4003('0xf')][this['mailAccounts'][_0x47c865][_0x4003('0x15')]['id']];}this[_0x4003('0xe')][_0x47c865][_0x4003('0x15')]['lastSync']=moment();this[_0x4003('0x12')](_0x47c865);}};EmailChannel[_0x4003('0x11')]['handleImapError']=function(_0x17e3f5,_0x19268f){if(this[_0x4003('0xe')][_0x17e3f5]){this['mailAccounts'][_0x17e3f5]['Imap'][_0x4003('0x16')]=_0x4003('0x24');this['mailAccounts'][_0x17e3f5][_0x4003('0x15')][_0x4003('0x29')]=_0x19268f;return this[_0x4003('0x12')](_0x17e3f5);}};EmailChannel[_0x4003('0x11')]['sendMail']=function(_0x2bbf6b,_0x16fdbf){return this[_0x4003('0x10')][_0x4003('0x30')](_0x2bbf6b,_0x16fdbf);};EmailChannel[_0x4003('0x11')]['verifySmtp']=function(_0x37cca9){var _0x21a706=this;if(this[_0x4003('0xe')][_0x37cca9['id']]){if(_['isNil'](this[_0x4003('0xe')][_0x37cca9['id']][_0x4003('0x31')])){this['mailAccounts'][_0x37cca9['id']][_0x4003('0x31')]={};}this[_0x4003('0xe')][_0x37cca9['id']]['Smtp'][_0x4003('0x32')]=moment();return new BPromise(function(_0x274f3c,_0x52d60f){return _0x21a706[_0x4003('0x10')][_0x4003('0x33')](_0x37cca9)[_0x4003('0x2d')](function(_0x48aff3){_0x21a706[_0x4003('0xe')][_0x37cca9['id']][_0x4003('0x31')][_0x4003('0x16')]=_0x4003('0x34');_0x21a706[_0x4003('0xe')][_0x37cca9['id']]['Smtp'][_0x4003('0x29')]='';_0x21a706[_0x4003('0x12')](_0x37cca9['id']);_0x274f3c(_0x48aff3);})[_0x4003('0x35')](function(_0x3b15b7){_0x21a706[_0x4003('0xe')][_0x37cca9['id']]['Smtp'][_0x4003('0x16')]=_0x4003('0x24');_0x21a706[_0x4003('0xe')][_0x37cca9['id']]['Smtp'][_0x4003('0x29')]=_0x3b15b7;_0x21a706['emit'](_0x37cca9['id']);_0x52d60f(_0x3b15b7);});});}return this[_0x4003('0x10')][_0x4003('0x33')](_0x37cca9);};module['exports']=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 2ad79db..d147183 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 _0x31f0=['end','handleEnd','error','handleError','connect','inherits','connTimeout','authTimeout','isNil','service','authentication','user','password','host','port','tls','autotls','required','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','email','anonymous@xcally.com','openBox','handleOpenBox','prototype','emit','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchError','closeBox','attributes','handleMessageAttributes','handleMessageEnd','handleMessageBody','handleSimpleParser','parser','handleFetchEnd','stringify','textCode','hasOwnProperty','upperFirst','exports','lodash','imap','simpleParser','iconv','Iconv','events','./utils','../../../config/logger','mailbox','account','getAccount','once','ready','handleReady','bind'];(function(_0x311765,_0x58201f){var _0x266f3b=function(_0x451b59){while(--_0x451b59){_0x311765['push'](_0x311765['shift']());}};_0x266f3b(++_0x58201f);}(_0x31f0,0xb7));var _0x031f=function(_0x260fe8,_0x515021){_0x260fe8=_0x260fe8-0x0;var _0x1a8321=_0x31f0[_0x260fe8];return _0x1a8321;};'use strict';var _=require(_0x031f('0x0'));var util=require('util');var Imap=require(_0x031f('0x1'));var simpleParser=require('mailparser')[_0x031f('0x2')];var Iconv=require(_0x031f('0x3'))[_0x031f('0x4')];var EventEmitter=require(_0x031f('0x5'))['EventEmitter'];var utils=require(_0x031f('0x6'));var logger=require(_0x031f('0x7'))('email');function EmailImap(_0x4c0f94,_0x56328c){this[_0x031f('0x8')]='INBOX';this[_0x031f('0x9')]=this[_0x031f('0xa')](_0x4c0f94,_0x56328c);this[_0x031f('0x1')]=new Imap(this[_0x031f('0x9')]);this['imap'][_0x031f('0xb')](_0x031f('0xc'),this[_0x031f('0xd')][_0x031f('0xe')](this));this[_0x031f('0x1')][_0x031f('0xb')](_0x031f('0xf'),this[_0x031f('0x10')]['bind'](this));this[_0x031f('0x1')]['on'](_0x031f('0x11'),this[_0x031f('0x12')][_0x031f('0xe')](this));this[_0x031f('0x1')][_0x031f('0x13')]();}util[_0x031f('0x14')](EmailImap,EventEmitter);EmailImap['prototype'][_0x031f('0xa')]=function(_0x23b40c,_0x17a699){var _0x2e3dfe={'connTimeout':_0x23b40c[_0x031f('0x15')]?_0x23b40c['connTimeout']*0x3e8:0x2710,'authTimeout':_0x23b40c['authTimeout']?_0x23b40c[_0x031f('0x16')]*0x3e8:0x1388};if(_[_0x031f('0x17')](_0x23b40c[_0x031f('0x18')])){if(_0x23b40c[_0x031f('0x19')]){_0x2e3dfe['user']=_0x23b40c[_0x031f('0x1a')];_0x2e3dfe[_0x031f('0x1b')]=_0x23b40c['password'];}_0x2e3dfe[_0x031f('0x1c')]=_0x23b40c['host'];_0x2e3dfe[_0x031f('0x1d')]=_0x23b40c[_0x031f('0x1d')]||0x3e1;if(_0x23b40c[_0x031f('0x1e')]){_0x2e3dfe[_0x031f('0x1e')]=!![];}else{_0x2e3dfe[_0x031f('0x1e')]=![];_0x2e3dfe[_0x031f('0x1f')]=_0x031f('0x20');}}else{if(_0x23b40c[_0x031f('0x21')]){_0x2e3dfe[_0x031f('0x22')]=utils[_0x031f('0x23')](_0x23b40c[_0x031f('0x24')]['data5'],_0x23b40c[_0x031f('0x1a')]);_0x2e3dfe[_0x031f('0x1a')]=_0x23b40c[_0x031f('0x1a')];}else{_0x2e3dfe['user']=_0x23b40c['user'];_0x2e3dfe[_0x031f('0x1b')]=_0x23b40c['password'];}_0x2e3dfe[_0x031f('0x1c')]=utils['getHost'](_0x23b40c['service']);_0x2e3dfe['port']=0x3e1;_0x2e3dfe[_0x031f('0x1e')]=!![];}_0x2e3dfe[_0x031f('0x25')]=_0x17a699||_0x23b40c[_0x031f('0x1a')]||_0x031f('0x26');return _0x2e3dfe;};EmailImap['prototype'][_0x031f('0xd')]=function(){this['imap'][_0x031f('0x27')](this[_0x031f('0x8')],![],this[_0x031f('0x28')]['bind'](this));};EmailImap[_0x031f('0x29')][_0x031f('0x28')]=function(_0x54b44e,_0x3847b2){if(_0x54b44e){this[_0x031f('0x12')](_0x54b44e,!![]);}else{this[_0x031f('0x2a')]('box',_0x3847b2);this[_0x031f('0x2b')]();}};EmailImap[_0x031f('0x29')][_0x031f('0x2c')]=function(_0xaf5bea){if(_0xaf5bea){this[_0x031f('0x12')](_0xaf5bea,!![]);}else{this[_0x031f('0x1')]['end']();}};EmailImap[_0x031f('0x29')][_0x031f('0x2b')]=function(){this[_0x031f('0x1')][_0x031f('0x2d')]([_0x031f('0x2e')],this[_0x031f('0x2f')][_0x031f('0xe')](this));};EmailImap[_0x031f('0x29')][_0x031f('0x2f')]=function(_0xfc4a89,_0x2cf3a8){if(_0xfc4a89){this['handleError'](_0xfc4a89,!![]);}else{if(_0x2cf3a8[_0x031f('0x30')]){try{var _0xe5f11c=this[_0x031f('0x1')][_0x031f('0x31')](_0x2cf3a8,{'bodies':'','markSeen':!![]});_0xe5f11c['on'](_0x031f('0x32'),this[_0x031f('0x33')][_0x031f('0xe')](this));_0xe5f11c[_0x031f('0xb')](_0x031f('0x11'),this[_0x031f('0x34')][_0x031f('0xe')](this));_0xe5f11c[_0x031f('0xb')](_0x031f('0xf'),this['handleFetchEnd'][_0x031f('0xe')](this));}catch(_0xd0ce3b){logger['error'](_0xd0ce3b);}}else{this[_0x031f('0x1')][_0x031f('0x35')](!![],this['handleCloseBox'][_0x031f('0xe')](this));}}};EmailImap[_0x031f('0x29')][_0x031f('0x33')]=function(_0x3ef166){_0x3ef166['on']('body',this['handleMessageBody'][_0x031f('0xe')](this));_0x3ef166['once'](_0x031f('0x36'),this[_0x031f('0x37')][_0x031f('0xe')](this));_0x3ef166['once']('end',this[_0x031f('0x38')]['bind'](this));};EmailImap['prototype'][_0x031f('0x39')]=function(_0x45e3a4){simpleParser(_0x45e3a4,{'Iconv':Iconv},this[_0x031f('0x3a')][_0x031f('0xe')](this));};EmailImap[_0x031f('0x29')][_0x031f('0x37')]=function(){};EmailImap[_0x031f('0x29')]['handleMessageEnd']=function(){};EmailImap[_0x031f('0x29')][_0x031f('0x3a')]=function(_0xb3b188,_0x1e9302){if(_0xb3b188){logger['error'](_0xb3b188);}else{var _0x2be5d1=this;utils[_0x031f('0x3b')](this[_0x031f('0x9')],_0x1e9302,function(_0x5895f6){_0x2be5d1[_0x031f('0x2a')](_0x031f('0x25'),_0x5895f6);});}};EmailImap['prototype'][_0x031f('0x3c')]=function(){this[_0x031f('0x1')]['closeBox'](!![],this['handleCloseBox'][_0x031f('0xe')](this));};EmailImap[_0x031f('0x29')][_0x031f('0x34')]=function(_0x46885f){this[_0x031f('0x12')](_0x46885f);this[_0x031f('0x1')][_0x031f('0x35')](!![],this['handleCloseBox'][_0x031f('0xe')](this));};EmailImap[_0x031f('0x29')]['handleEnd']=function(){this[_0x031f('0x2a')]('end');};EmailImap[_0x031f('0x29')][_0x031f('0x12')]=function(_0x56dd24,_0x1b9b2e){logger[_0x031f('0x11')](_0x031f('0x12'),this['account'][_0x031f('0x25')],JSON[_0x031f('0x3d')](_0x56dd24));var _0x1d3324='';if(_0x56dd24){if(_0x56dd24[_0x031f('0x3e')]){_0x1d3324=_0x56dd24[_0x031f('0x3e')];}else{for(var _0x193b8f in _0x56dd24){if(_0x56dd24[_0x031f('0x3f')](_0x193b8f)){_0x1d3324+=_[_0x031f('0x40')](_0x193b8f)+':\x20'+_0x56dd24[_0x193b8f]+'\x0a';}}}}if(_0x1b9b2e){this[_0x031f('0x1')]['end']();}else{this[_0x031f('0x2a')](_0x031f('0x11'),_0x1d3324);this[_0x031f('0x2a')](_0x031f('0xf'));}};module[_0x031f('0x41')]=EmailImap; \ No newline at end of file +var _0x33af=['service','user','password','host','port','tls','autotls','required','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','data5','getHost','anonymous@xcally.com','prototype','openBox','emit','readUnseen','handleCloseBox','end','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchError','handleFetchEnd','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','closeBox','stringify','textCode','hasOwnProperty','exports','util','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','../../../config/logger','email','mailbox','INBOX','account','getAccount','imap','once','ready','handleReady','bind','handleEnd','error','handleError','connect','connTimeout','authTimeout'];(function(_0x3e7b67,_0x2f6f3f){var _0x40de5f=function(_0x38792c){while(--_0x38792c){_0x3e7b67['push'](_0x3e7b67['shift']());}};_0x40de5f(++_0x2f6f3f);}(_0x33af,0xec));var _0xf33a=function(_0x1fd4d7,_0x2feafd){_0x1fd4d7=_0x1fd4d7-0x0;var _0x7efe8a=_0x33af[_0x1fd4d7];return _0x7efe8a;};'use strict';var _=require('lodash');var util=require(_0xf33a('0x0'));var Imap=require('imap');var simpleParser=require(_0xf33a('0x1'))[_0xf33a('0x2')];var Iconv=require(_0xf33a('0x3'))[_0xf33a('0x4')];var EventEmitter=require(_0xf33a('0x5'))[_0xf33a('0x6')];var utils=require('./utils');var logger=require(_0xf33a('0x7'))(_0xf33a('0x8'));function EmailImap(_0x583e54,_0xc0dd13){this[_0xf33a('0x9')]=_0xf33a('0xa');this[_0xf33a('0xb')]=this[_0xf33a('0xc')](_0x583e54,_0xc0dd13);this[_0xf33a('0xd')]=new Imap(this['account']);this[_0xf33a('0xd')][_0xf33a('0xe')](_0xf33a('0xf'),this[_0xf33a('0x10')][_0xf33a('0x11')](this));this[_0xf33a('0xd')]['once']('end',this[_0xf33a('0x12')][_0xf33a('0x11')](this));this[_0xf33a('0xd')]['on'](_0xf33a('0x13'),this[_0xf33a('0x14')]['bind'](this));this[_0xf33a('0xd')][_0xf33a('0x15')]();}util['inherits'](EmailImap,EventEmitter);EmailImap['prototype'][_0xf33a('0xc')]=function(_0x1b3bf0,_0x17043){var _0x153bda={'connTimeout':_0x1b3bf0[_0xf33a('0x16')]?_0x1b3bf0[_0xf33a('0x16')]*0x3e8:0x2710,'authTimeout':_0x1b3bf0[_0xf33a('0x17')]?_0x1b3bf0[_0xf33a('0x17')]*0x3e8:0x1388};if(_['isNil'](_0x1b3bf0[_0xf33a('0x18')])){if(_0x1b3bf0['authentication']){_0x153bda[_0xf33a('0x19')]=_0x1b3bf0[_0xf33a('0x19')];_0x153bda['password']=_0x1b3bf0[_0xf33a('0x1a')];}_0x153bda[_0xf33a('0x1b')]=_0x1b3bf0['host'];_0x153bda[_0xf33a('0x1c')]=_0x1b3bf0[_0xf33a('0x1c')]||0x3e1;if(_0x1b3bf0[_0xf33a('0x1d')]){_0x153bda[_0xf33a('0x1d')]=!![];}else{_0x153bda['tls']=![];_0x153bda[_0xf33a('0x1e')]=_0xf33a('0x1f');}}else{if(_0x1b3bf0[_0xf33a('0x20')]){_0x153bda[_0xf33a('0x21')]=utils[_0xf33a('0x22')](_0x1b3bf0[_0xf33a('0x23')][_0xf33a('0x24')],_0x1b3bf0[_0xf33a('0x19')]);_0x153bda[_0xf33a('0x19')]=_0x1b3bf0[_0xf33a('0x19')];}else{_0x153bda['user']=_0x1b3bf0[_0xf33a('0x19')];_0x153bda[_0xf33a('0x1a')]=_0x1b3bf0[_0xf33a('0x1a')];}_0x153bda[_0xf33a('0x1b')]=utils[_0xf33a('0x25')](_0x1b3bf0['service']);_0x153bda[_0xf33a('0x1c')]=0x3e1;_0x153bda['tls']=!![];}_0x153bda[_0xf33a('0x8')]=_0x17043||_0x1b3bf0[_0xf33a('0x19')]||_0xf33a('0x26');return _0x153bda;};EmailImap[_0xf33a('0x27')][_0xf33a('0x10')]=function(){this['imap'][_0xf33a('0x28')](this[_0xf33a('0x9')],![],this['handleOpenBox']['bind'](this));};EmailImap[_0xf33a('0x27')]['handleOpenBox']=function(_0x5cf981,_0x38eba2){if(_0x5cf981){this['handleError'](_0x5cf981,!![]);}else{this[_0xf33a('0x29')]('box',_0x38eba2);this[_0xf33a('0x2a')]();}};EmailImap[_0xf33a('0x27')][_0xf33a('0x2b')]=function(_0x729fca){if(_0x729fca){this[_0xf33a('0x14')](_0x729fca,!![]);}else{this[_0xf33a('0xd')][_0xf33a('0x2c')]();}};EmailImap[_0xf33a('0x27')][_0xf33a('0x2a')]=function(){this[_0xf33a('0xd')][_0xf33a('0x2d')]([_0xf33a('0x2e')],this[_0xf33a('0x2f')][_0xf33a('0x11')](this));};EmailImap[_0xf33a('0x27')]['handleReadUnseen']=function(_0x627fd2,_0x293cb5){if(_0x627fd2){this[_0xf33a('0x14')](_0x627fd2,!![]);}else{if(_0x293cb5[_0xf33a('0x30')]){try{var _0x4ee492=this[_0xf33a('0xd')][_0xf33a('0x31')](_0x293cb5,{'bodies':'','markSeen':!![]});_0x4ee492['on'](_0xf33a('0x32'),this[_0xf33a('0x33')][_0xf33a('0x11')](this));_0x4ee492[_0xf33a('0xe')]('error',this[_0xf33a('0x34')][_0xf33a('0x11')](this));_0x4ee492[_0xf33a('0xe')](_0xf33a('0x2c'),this[_0xf33a('0x35')]['bind'](this));}catch(_0x578998){logger[_0xf33a('0x13')](_0x578998);}}else{this['imap']['closeBox'](!![],this['handleCloseBox'][_0xf33a('0x11')](this));}}};EmailImap[_0xf33a('0x27')]['handleFetchMessage']=function(_0x21f250){_0x21f250['on']('body',this[_0xf33a('0x36')][_0xf33a('0x11')](this));_0x21f250[_0xf33a('0xe')](_0xf33a('0x37'),this[_0xf33a('0x38')][_0xf33a('0x11')](this));_0x21f250['once'](_0xf33a('0x2c'),this[_0xf33a('0x39')]['bind'](this));};EmailImap[_0xf33a('0x27')][_0xf33a('0x36')]=function(_0x3e0a98){simpleParser(_0x3e0a98,{'Iconv':Iconv},this['handleSimpleParser'][_0xf33a('0x11')](this));};EmailImap[_0xf33a('0x27')][_0xf33a('0x38')]=function(){};EmailImap[_0xf33a('0x27')][_0xf33a('0x39')]=function(){};EmailImap[_0xf33a('0x27')][_0xf33a('0x3a')]=function(_0x128baf,_0xd488ef){if(_0x128baf){logger['error'](_0x128baf);}else{var _0x31028b=this;utils[_0xf33a('0x3b')](this['account'],_0xd488ef,function(_0x1e8800){_0x31028b['emit']('email',_0x1e8800);});}};EmailImap[_0xf33a('0x27')][_0xf33a('0x35')]=function(){this['imap'][_0xf33a('0x3c')](!![],this[_0xf33a('0x2b')][_0xf33a('0x11')](this));};EmailImap['prototype'][_0xf33a('0x34')]=function(_0x21b8da){this['handleError'](_0x21b8da);this[_0xf33a('0xd')][_0xf33a('0x3c')](!![],this[_0xf33a('0x2b')][_0xf33a('0x11')](this));};EmailImap[_0xf33a('0x27')]['handleEnd']=function(){this[_0xf33a('0x29')](_0xf33a('0x2c'));};EmailImap[_0xf33a('0x27')][_0xf33a('0x14')]=function(_0x253f21,_0x5ef2b8){logger[_0xf33a('0x13')](_0xf33a('0x14'),this[_0xf33a('0xb')]['email'],JSON[_0xf33a('0x3d')](_0x253f21));var _0x43889e='';if(_0x253f21){if(_0x253f21[_0xf33a('0x3e')]){_0x43889e=_0x253f21[_0xf33a('0x3e')];}else{for(var _0x2e36f2 in _0x253f21){if(_0x253f21[_0xf33a('0x3f')](_0x2e36f2)){_0x43889e+=_['upperFirst'](_0x2e36f2)+':\x20'+_0x253f21[_0x2e36f2]+'\x0a';}}}}if(_0x5ef2b8){this[_0xf33a('0xd')][_0xf33a('0x2c')]();}else{this[_0xf33a('0x29')](_0xf33a('0x13'),_0x43889e);this[_0xf33a('0x29')]('end');}};module[_0xf33a('0x40')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 8b05b1e..e575eb5 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 _0x23f9=['verify','Not\x20verifired','exports','nodemailer','nodemailer-plugin-inline-base64','send','createTransport','use','compile','toString','prototype'];(function(_0x28dc07,_0xc7cbe5){var _0x4ce5e6=function(_0x43e93d){while(--_0x43e93d){_0x28dc07['push'](_0x28dc07['shift']());}};_0x4ce5e6(++_0xc7cbe5);}(_0x23f9,0x14d));var _0x923f=function(_0x1a6f19,_0x2ac3d3){_0x1a6f19=_0x1a6f19-0x0;var _0x5d07e9=_0x23f9[_0x1a6f19];return _0x5d07e9;};'use strict';var nodemailer=require(_0x923f('0x0'));var inlineBase64=require(_0x923f('0x1'));function EmailSmtp(){}EmailSmtp['prototype'][_0x923f('0x2')]=function(_0x9e4d13,_0x152854){return new Promise(function(_0x88d3ae,_0x5a8dfa){var _0x158deb=nodemailer[_0x923f('0x3')](_0x9e4d13);_0x158deb[_0x923f('0x4')](_0x923f('0x5'),inlineBase64());_0x158deb['sendMail'](_0x152854,function(_0x2cce6a,_0x16d117){if(_0x2cce6a){_0x5a8dfa(_0x2cce6a[_0x923f('0x6')]());}else{_0x88d3ae(_0x16d117);}});});};EmailSmtp[_0x923f('0x7')][_0x923f('0x8')]=function(_0x47c05b){return new Promise(function(_0x2fdaf8,_0x2af579){var _0x48e2f1=nodemailer[_0x923f('0x3')](_0x47c05b);_0x48e2f1[_0x923f('0x8')](function(_0x230e9d,_0x13726f){if(_0x230e9d){_0x2af579(_0x230e9d['toString']());}else{if(_0x13726f){_0x2fdaf8(_0x13726f);}else{_0x2af579(_0x923f('0x9'));}}});});};module[_0x923f('0xa')]=EmailSmtp; \ No newline at end of file +var _0x0c98=['send','compile','sendMail','toString','verify','createTransport','exports','nodemailer','nodemailer-plugin-inline-base64','prototype'];(function(_0x4427b1,_0x3a8371){var _0x532904=function(_0x540389){while(--_0x540389){_0x4427b1['push'](_0x4427b1['shift']());}};_0x532904(++_0x3a8371);}(_0x0c98,0xd9));var _0x80c9=function(_0xfe9c6d,_0x2a839f){_0xfe9c6d=_0xfe9c6d-0x0;var _0x5cd878=_0x0c98[_0xfe9c6d];return _0x5cd878;};'use strict';var nodemailer=require(_0x80c9('0x0'));var inlineBase64=require(_0x80c9('0x1'));function EmailSmtp(){}EmailSmtp[_0x80c9('0x2')][_0x80c9('0x3')]=function(_0x2ccf11,_0x1c1272){return new Promise(function(_0x31c5f3,_0x4a8152){var _0x2a28b2=nodemailer['createTransport'](_0x2ccf11);_0x2a28b2['use'](_0x80c9('0x4'),inlineBase64());_0x2a28b2[_0x80c9('0x5')](_0x1c1272,function(_0x337b8c,_0x16cb88){if(_0x337b8c){_0x4a8152(_0x337b8c[_0x80c9('0x6')]());}else{_0x31c5f3(_0x16cb88);}});});};EmailSmtp[_0x80c9('0x2')][_0x80c9('0x7')]=function(_0x557921){return new Promise(function(_0x2a2239,_0x254482){var _0x294daa=nodemailer[_0x80c9('0x8')](_0x557921);_0x294daa[_0x80c9('0x7')](function(_0x242d28,_0x49261e){if(_0x242d28){_0x254482(_0x242d28['toString']());}else{if(_0x49261e){_0x2a2239(_0x49261e);}else{_0x254482('Not\x20verifired');}}});});};module[_0x80c9('0x9')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index ba2a63f..425ee3b 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 _0x9319=['pop','@xcally.com','html','test','replace','includes','\x20[Attachment:\x20','\x20]','body','textAsHtml','Empty\x20message

','Attachments','Title','Data','getHost','gmail','yahoo','imap.mail.yahoo.com','hotmail','outlook365','127.0.0.1','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','toString','base64','lodash','moment','path','util','node-tnef','email','../../../config/environment','head','value','address','anonymous','generate','name','substring','indexOf','split','slice','join','Anonymous','length'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x9319,0xee));var _0x9931=function(_0x58e86c,_0x54691f){_0x58e86c=_0x58e86c-0x0;var _0x6720d7=_0x9319[_0x58e86c];return _0x6720d7;};'use strict';var _=require(_0x9931('0x0'));var moment=require(_0x9931('0x1'));var random=require('randomstring');var fs=require('fs');var path=require(_0x9931('0x2'));var util=require(_0x9931('0x3'));var tnef=require(_0x9931('0x4'));var logger=require('../../../config/logger')(_0x9931('0x5'));var config=require(_0x9931('0x6'));function getAddress(_0xd26ac){var _0x365376=_[_0x9931('0x7')](_0xd26ac[_0x9931('0x8')]);return _0x365376&&_0x365376[_0x9931('0x9')]?_0x365376[_0x9931('0x9')]:_0x9931('0xa')+random[_0x9931('0xb')](0x6)+'@xcally.com';}function getFirstName(_0x438221){var _0x3a7331=_['head'](_0x438221[_0x9931('0x8')]);if(_0x3a7331&&_0x3a7331[_0x9931('0xc')]){if(_0x3a7331[_0x9931('0xc')]==_0x3a7331[_0x9931('0x9')]){return _0x3a7331[_0x9931('0xc')][_0x9931('0xd')](0x0,_0x3a7331[_0x9931('0xc')][_0x9931('0xe')]('@'));}var _0x17538e=_0x3a7331[_0x9931('0xc')][_0x9931('0xf')](/\s+/);return _0x17538e['length']>0x1?_0x17538e[_0x9931('0x10')](0x0,-0x1)[_0x9931('0x11')]('\x20'):_0x3a7331[_0x9931('0xc')];}return _0x9931('0x12');}function getLastName(_0x34fe86){var _0x5b78ac=_['head'](_0x34fe86['value']);if(_0x5b78ac&&_0x5b78ac[_0x9931('0xc')]){var _0x47314d=_0x5b78ac[_0x9931('0xc')][_0x9931('0xf')](/\s+/);return _0x47314d[_0x9931('0x13')]>0x1?_0x47314d[_0x9931('0x14')]():'';}return'';}function getMails(_0x53bb4c,_0x210802){var _0x78d5b3='';for(var _0x522a25=0x0;_0x522a25<_0x210802['value'][_0x9931('0x13')];_0x522a25+=0x1){if(_0x210802[_0x9931('0x8')][_0x522a25][_0x9931('0x9')]!==_0x53bb4c){if(!_['isEmpty'](_0x78d5b3)){_0x78d5b3+=',';}_0x78d5b3+=_0x210802[_0x9931('0x8')][_0x522a25]['name']||_0x210802['value'][_0x522a25][_0x9931('0x9')]||'';_0x78d5b3+='\x20<';_0x78d5b3+=_0x210802[_0x9931('0x8')][_0x522a25][_0x9931('0x9')]?_0x210802['value'][_0x522a25][_0x9931('0x9')]:_0x9931('0xa')+random['generate'](0x6)+_0x9931('0x15');_0x78d5b3+='>';}}return _0x78d5b3;}function parseEmail(_0x1b6dd7,_0x529094,_0x4fb464){if(_0x529094[_0x9931('0x16')]){var _0x215cfb=/)<[^<]*)*<\/script>/gi;while(_0x215cfb[_0x9931('0x17')](_0x529094[_0x9931('0x16')])){_0x529094[_0x9931('0x16')]=_0x529094[_0x9931('0x16')][_0x9931('0x18')](_0x215cfb,'');}if(_0x529094[_0x9931('0x16')][_0x9931('0x19')](_0x9931('0x1a'))){var _0x269a55=[];_0x529094[_0x9931('0x1b')]['forEach'](_0x480c0e=>{_0x269a55[_0x9931('0x1c')](_0x480c0e['filename']);});var _0x3ceea2=/]+>/g;var _0x5c157f=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x47b4a2=_0x529094['html'][_0x9931('0x18')](_0x5c157f,_0x9931('0x1d'));var _0x16f86a=_0x47b4a2[_0x9931('0x18')](_0x3ceea2,_0x9931('0x1e'));for(let _0x969f04=0x0;_0x969f04<_0x269a55[_0x9931('0x13')];_0x969f04++){var _0x4d65b6=_0x16f86a[_0x9931('0x18')](_0x9931('0x1e'),_0x9931('0x1f')+_0x269a55[_0x969f04]+_0x9931('0x20'));_0x16f86a=_0x4d65b6;}_0x529094['html']=_0x16f86a;}_0x4fb464['body']=_0x529094[_0x9931('0x16')];}else{_0x4fb464[_0x9931('0x21')]=_0x529094[_0x9931('0x22')];}if(_0x4fb464['body']){_0x4fb464['body']=_0x4fb464[_0x9931('0x21')][_0x9931('0x18')](/0x0){var _0x496d0b=[_0x9931('0x34'),'X-Auto-Response-Suppress:\x20All',_0x9931('0x35')];for(var _0x5a5c13=0x0;_0x5a5c13<_0x529094['headerLines'][_0x9931('0x13')];_0x5a5c13++){var _0x2a2263=_[_0x9931('0xe')](_0x496d0b,_0x529094[_0x9931('0x33')][_0x5a5c13][_0x9931('0x36')]);if(_0x2a2263>=0x0){_0x4fb464['isAutoreply']=!![];}}}return _0x4fb464;}exports[_0x9931('0x37')]=function(_0x28b392,_0x2580bf,_0x240dbc){var _0x47d924={'from':getAddress(_0x2580bf[_0x9931('0x38')]),'firstName':getFirstName(_0x2580bf[_0x9931('0x38')]),'lastName':getLastName(_0x2580bf[_0x9931('0x38')]),'mapKey':_0x9931('0x5'),'message':{'from':getMails(_0x28b392[_0x9931('0x5')],_0x2580bf[_0x9931('0x38')]),'to':_0x28b392[_0x9931('0x5')],'cc':'','subject':_0x2580bf[_0x9931('0x39')]||'','messageId':_0x2580bf[_0x9931('0x3a')],'inReplyTo':_0x2580bf[_0x9931('0x3b')],'sentAt':moment(_0x2580bf[_0x9931('0x3c')])[_0x9931('0x2e')](_0x9931('0x3d')),'attach':![],'attachments':[]}};if(!_0x2580bf[_0x9931('0x16')]&&!_0x2580bf[_0x9931('0x22')]){var _0x227e77=_[_0x9931('0x3e')](_0x2580bf[_0x9931('0x1b')],{'contentType':_0x9931('0x3f')});if(_0x227e77[_0x9931('0x13')]){logger[_0x9931('0x40')](util[_0x9931('0x2e')](_0x9931('0x41'),_0x2580bf[_0x9931('0x3a')]));tnef[_0x9931('0x42')](_[_0x9931('0x43')](_0x227e77)[_0x9931('0x31')],function(_0x5b5e6e,_0xb1832b){if(_0xb1832b){_0x2580bf[_0x9931('0x16')]=_0xb1832b[_0x9931('0x44')]||_0x9931('0x45');if(_0xb1832b[_0x9931('0x46')]){for(var _0x3db1ac=0x0;_0x3db1ac<_0xb1832b[_0x9931('0x46')]['length'];_0x3db1ac++){var _0x5ebdc5=_0xb1832b[_0x9931('0x46')][_0x3db1ac];_0x47d924[_0x9931('0x24')][_0x9931('0x1b')][_0x9931('0x1c')]({'filename':_0x5ebdc5[_0x9931('0x47')],'content':Buffer[_0x9931('0x38')](_0x5ebdc5[_0x9931('0x48')])});}}}_0x240dbc(parseEmail(_0x28b392,_0x2580bf,_0x47d924));});}else{_0x2580bf[_0x9931('0x16')]=_0x9931('0x45');_0x240dbc(parseEmail(_0x28b392,_0x2580bf,_0x47d924));}}else{_0x240dbc(parseEmail(_0x28b392,_0x2580bf,_0x47d924));}};exports[_0x9931('0x49')]=function(_0x36b133){switch(_0x36b133){case _0x9931('0x4a'):return'imap.gmail.com';case _0x9931('0x4b'):return _0x9931('0x4c');case _0x9931('0x4d'):return'imap-mail.outlook.com';case _0x9931('0x4e'):return'outlook.office365.com';}return _0x9931('0x4f');};exports[_0x9931('0x50')]=function(_0x353655,_0xdebb8d){var _0x4d5bc8=[_0x9931('0x51')+(_0xdebb8d||''),_0x9931('0x52')+_0x353655,'',''];return Buffer['from'](_0x4d5bc8['join'](''),_0x9931('0x53'))[_0x9931('0x54')](_0x9931('0x55'));}; \ No newline at end of file +var _0x484b=['%s-%s','now','join','root','server/files/attachments/','content','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','indexOf','isAutoreply','parser','from','subject','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','BodyHTML','

Empty\x20message

','Attachments','Data','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','../../../config/environment','head','value','address','anonymous','generate','name','split','length','pop','@xcally.com','html','replace','includes','\x20[Attachment:\x20','\x20]','body','textAsHtml','0x1?_0x57fe8a['slice'](0x0,-0x1)['join']('\x20'):_0x3f9a4f[_0xb484('0xd')];}return'Anonymous';}function getLastName(_0xaa0e87){var _0x441a1f=_[_0xb484('0x8')](_0xaa0e87[_0xb484('0x9')]);if(_0x441a1f&&_0x441a1f['name']){var _0x5bf58a=_0x441a1f[_0xb484('0xd')][_0xb484('0xe')](/\s+/);return _0x5bf58a[_0xb484('0xf')]>0x1?_0x5bf58a[_0xb484('0x10')]():'';}return'';}function getMails(_0x431914,_0x3a5eb3){var _0x46864f='';for(var _0x7f310a=0x0;_0x7f310a<_0x3a5eb3[_0xb484('0x9')][_0xb484('0xf')];_0x7f310a+=0x1){if(_0x3a5eb3[_0xb484('0x9')][_0x7f310a][_0xb484('0xa')]!==_0x431914){if(!_['isEmpty'](_0x46864f)){_0x46864f+=',';}_0x46864f+=_0x3a5eb3[_0xb484('0x9')][_0x7f310a][_0xb484('0xd')]||_0x3a5eb3[_0xb484('0x9')][_0x7f310a][_0xb484('0xa')]||'';_0x46864f+='\x20<';_0x46864f+=_0x3a5eb3[_0xb484('0x9')][_0x7f310a][_0xb484('0xa')]?_0x3a5eb3[_0xb484('0x9')][_0x7f310a]['address']:_0xb484('0xb')+random[_0xb484('0xc')](0x6)+_0xb484('0x11');_0x46864f+='>';}}return _0x46864f;}function parseEmail(_0x2e826a,_0x3855dd,_0x5dd5a0){if(_0x3855dd['html']){var _0x7fc35=/)<[^<]*)*<\/script>/gi;while(_0x7fc35['test'](_0x3855dd[_0xb484('0x12')])){_0x3855dd[_0xb484('0x12')]=_0x3855dd[_0xb484('0x12')][_0xb484('0x13')](_0x7fc35,'');}if(_0x3855dd['html'][_0xb484('0x14')](_0xb484('0x15'))){var _0x323c7f=[];_0x3855dd[_0xb484('0x16')][_0xb484('0x17')](_0x3e6b56=>{_0x323c7f[_0xb484('0x18')](_0x3e6b56['filename']);});var _0x2409d3=/]+>/g;var _0x4f9814=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x2e5ec3=_0x3855dd['html'][_0xb484('0x13')](_0x4f9814,_0xb484('0x19'));var _0x4064c6=_0x2e5ec3[_0xb484('0x13')](_0x2409d3,_0xb484('0x1a'));for(let _0x2cace9=0x0;_0x2cace9<_0x323c7f['length'];_0x2cace9++){var _0x54c146=_0x4064c6[_0xb484('0x13')](_0xb484('0x1a'),_0xb484('0x1b')+_0x323c7f[_0x2cace9]+_0xb484('0x1c'));_0x4064c6=_0x54c146;}_0x3855dd['html']=_0x4064c6;}_0x5dd5a0[_0xb484('0x1d')]=_0x3855dd[_0xb484('0x12')];}else{_0x5dd5a0[_0xb484('0x1d')]=_0x3855dd[_0xb484('0x1e')];}if(_0x5dd5a0[_0xb484('0x1d')]){_0x5dd5a0[_0xb484('0x1d')]=_0x5dd5a0['body'][_0xb484('0x13')](/0x0){var _0x4ad7e2=[_0xb484('0x33'),_0xb484('0x34'),'Precedence:\x20auto_reply'];for(var _0x34b4c1=0x0;_0x34b4c1<_0x3855dd[_0xb484('0x32')][_0xb484('0xf')];_0x34b4c1++){var _0x471c87=_[_0xb484('0x35')](_0x4ad7e2,_0x3855dd['headerLines'][_0x34b4c1]['line']);if(_0x471c87>=0x0){_0x5dd5a0[_0xb484('0x36')]=!![];}}}return _0x5dd5a0;}exports[_0xb484('0x37')]=function(_0x8de618,_0x29aac1,_0x500e60){var _0x12ee8c={'from':getAddress(_0x29aac1[_0xb484('0x38')]),'firstName':getFirstName(_0x29aac1[_0xb484('0x38')]),'lastName':getLastName(_0x29aac1['from']),'mapKey':_0xb484('0x24'),'message':{'from':getMails(_0x8de618[_0xb484('0x24')],_0x29aac1['from']),'to':_0x8de618[_0xb484('0x24')],'cc':'','subject':_0x29aac1[_0xb484('0x39')]||'','messageId':_0x29aac1['messageId'],'inReplyTo':_0x29aac1[_0xb484('0x3a')],'sentAt':moment(_0x29aac1[_0xb484('0x3b')])['format'](_0xb484('0x3c')),'attach':![],'attachments':[]}};if(!_0x29aac1[_0xb484('0x12')]&&!_0x29aac1['textAsHtml']){var _0x301d6a=_[_0xb484('0x3d')](_0x29aac1[_0xb484('0x16')],{'contentType':_0xb484('0x3e')});if(_0x301d6a[_0xb484('0xf')]){logger[_0xb484('0x3f')](util[_0xb484('0x2a')](_0xb484('0x40'),_0x29aac1['messageId']));tnef[_0xb484('0x41')](_[_0xb484('0x42')](_0x301d6a)[_0xb484('0x30')],function(_0x46a3fc,_0x3019eb){if(_0x3019eb){_0x29aac1[_0xb484('0x12')]=_0x3019eb[_0xb484('0x43')]||_0xb484('0x44');if(_0x3019eb[_0xb484('0x45')]){for(var _0x4bb612=0x0;_0x4bb612<_0x3019eb[_0xb484('0x45')][_0xb484('0xf')];_0x4bb612++){var _0x800cf7=_0x3019eb[_0xb484('0x45')][_0x4bb612];_0x12ee8c[_0xb484('0x20')]['attachments'][_0xb484('0x18')]({'filename':_0x800cf7['Title'],'content':Buffer['from'](_0x800cf7[_0xb484('0x46')])});}}}_0x500e60(parseEmail(_0x8de618,_0x29aac1,_0x12ee8c));});}else{_0x29aac1['html']=_0xb484('0x44');_0x500e60(parseEmail(_0x8de618,_0x29aac1,_0x12ee8c));}}else{_0x500e60(parseEmail(_0x8de618,_0x29aac1,_0x12ee8c));}};exports['getHost']=function(_0x1a8fd2){switch(_0x1a8fd2){case _0xb484('0x47'):return _0xb484('0x48');case _0xb484('0x49'):return _0xb484('0x4a');case _0xb484('0x4b'):return _0xb484('0x4c');case _0xb484('0x4d'):return _0xb484('0x4e');}return _0xb484('0x4f');};exports['generateXOAuth2Token']=function(_0x50b247,_0x596ab9){var _0x543965=['user='+(_0x596ab9||''),'auth=Bearer\x20'+_0x50b247,'',''];return Buffer[_0xb484('0x38')](_0x543965[_0xb484('0x2d')](''),'utf-8')['toString']('base64');}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index e8ea532..ece8a2d 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 _0x3413=['exports','lodash','name','Service','key','SERV','active','Imap','Smtp'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x3413,0x145));var _0x3341=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3413[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3341('0x0'));function MailAccount(_0x27e8b4){this['id']=_0x27e8b4['id']||0x0;this[_0x3341('0x1')]=_0x27e8b4[_0x3341('0x1')]||_0x3341('0x2');this['key']=_0x27e8b4[_0x3341('0x3')]||_0x3341('0x4');this[_0x3341('0x5')]=_0x27e8b4[_0x3341('0x5')]||![];this[_0x3341('0x6')]=_0x27e8b4[_0x3341('0x6')]||[];this[_0x3341('0x7')]=_0x27e8b4[_0x3341('0x7')]||[];}module[_0x3341('0x8')]=MailAccount; \ No newline at end of file +var _0x5a3d=['name','Service','key','SERV','active','Imap','Smtp','lodash'];(function(_0x34d3c3,_0x122bb9){var _0x19b256=function(_0x409be5){while(--_0x409be5){_0x34d3c3['push'](_0x34d3c3['shift']());}};_0x19b256(++_0x122bb9);}(_0x5a3d,0x19f));var _0xd5a3=function(_0x2a6144,_0x52a046){_0x2a6144=_0x2a6144-0x0;var _0x3f9619=_0x5a3d[_0x2a6144];return _0x3f9619;};'use strict';var _=require(_0xd5a3('0x0'));function MailAccount(_0x4f6e1a){this['id']=_0x4f6e1a['id']||0x0;this[_0xd5a3('0x1')]=_0x4f6e1a[_0xd5a3('0x1')]||_0xd5a3('0x2');this['key']=_0x4f6e1a[_0xd5a3('0x3')]||_0xd5a3('0x4');this[_0xd5a3('0x5')]=_0x4f6e1a[_0xd5a3('0x5')]||![];this[_0xd5a3('0x6')]=_0x4f6e1a[_0xd5a3('0x6')]||[];this[_0xd5a3('0x7')]=_0x4f6e1a['Smtp']||[];}module['exports']=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 3d30d5e..f240ed6 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 _0x4ca2=['mergeFromDatabase','initMailAccounts','isUndefined','mailAccounts','merge','exports','lodash','mapKeys','hasOwnProperty'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x4ca2,0x16e));var _0x24ca=function(_0xc3127b,_0x44dbe7){_0xc3127b=_0xc3127b-0x0;var _0x50de6b=_0x4ca2[_0xc3127b];return _0x50de6b;};'use strict';var _=require(_0x24ca('0x0'));var MailAccount=require('../model/mailAccount');var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x3da6d3,_0x25865c,_0x62928d){var _0x2a8ac5=_[_0x24ca('0x1')](_0x3da6d3,function(_0x573f12,_0x3db31a){return _0x573f12[_0x62928d];});for(var _0x39084f in _0x25865c){if(_0x25865c[_0x24ca('0x2')](_0x39084f)){if(!_0x2a8ac5[_0x39084f]){delete _0x25865c[_0x39084f];}}}}Realtime['prototype'][_0x24ca('0x3')]=function(_0x15f0da,_0x52d86b){for(var _0x4523dd in _0x52d86b){if(_0x15f0da[_0x24ca('0x2')](_0x4523dd)){_0x15f0da[_0x4523dd]=_0x52d86b[_0x4523dd];}}};Realtime['prototype'][_0x24ca('0x4')]=function(){var _0x3fd7bf=this;return function(_0x3d4e99){if(_0x3d4e99){freeIsNotKey(_0x3d4e99,_0x3fd7bf['mailAccounts'],'id');for(var _0x28e317=0x0,_0x1486de={},_0x18e57f={};_0x28e317<_0x3d4e99['length'];_0x28e317+=0x1){_0x1486de=_0x3d4e99[_0x28e317];if(_[_0x24ca('0x5')](_0x3fd7bf[_0x24ca('0x6')][_0x1486de['id']])){_0x3fd7bf[_0x24ca('0x6')][_0x1486de['id']]=new MailAccount(_0x1486de);}else{_[_0x24ca('0x7')](_0x3fd7bf[_0x24ca('0x6')][_0x1486de['id']],_0x1486de);}}}return _0x3fd7bf[_0x24ca('0x6')];};};module[_0x24ca('0x8')]=Realtime; \ No newline at end of file +var _0xcbd3=['mapKeys','prototype','mergeFromDatabase','length','isUndefined','merge','exports','lodash','../model/mailAccount','mailAccounts'];(function(_0x3393a1,_0x3ba2de){var _0x13beeb=function(_0x5a8553){while(--_0x5a8553){_0x3393a1['push'](_0x3393a1['shift']());}};_0x13beeb(++_0x3ba2de);}(_0xcbd3,0x1ab));var _0x3cbd=function(_0x3d4b53,_0x1eb3d9){_0x3d4b53=_0x3d4b53-0x0;var _0x5416ae=_0xcbd3[_0x3d4b53];return _0x5416ae;};'use strict';var _=require(_0x3cbd('0x0'));var MailAccount=require(_0x3cbd('0x1'));var Realtime=function(){this[_0x3cbd('0x2')]={};};function freeIsNotKey(_0x3a90ec,_0x27acd2,_0x74cf4){var _0x557444=_[_0x3cbd('0x3')](_0x3a90ec,function(_0x7aef3b,_0x54867b){return _0x7aef3b[_0x74cf4];});for(var _0xc1fc1e in _0x27acd2){if(_0x27acd2['hasOwnProperty'](_0xc1fc1e)){if(!_0x557444[_0xc1fc1e]){delete _0x27acd2[_0xc1fc1e];}}}}Realtime[_0x3cbd('0x4')][_0x3cbd('0x5')]=function(_0x9ad0d0,_0x314f90){for(var _0x4625db in _0x314f90){if(_0x9ad0d0['hasOwnProperty'](_0x4625db)){_0x9ad0d0[_0x4625db]=_0x314f90[_0x4625db];}}};Realtime['prototype']['initMailAccounts']=function(){var _0x1ac805=this;return function(_0x14b56a){if(_0x14b56a){freeIsNotKey(_0x14b56a,_0x1ac805[_0x3cbd('0x2')],'id');for(var _0x19b7d8=0x0,_0x43e536={},_0x45676f={};_0x19b7d8<_0x14b56a[_0x3cbd('0x6')];_0x19b7d8+=0x1){_0x43e536=_0x14b56a[_0x19b7d8];if(_[_0x3cbd('0x7')](_0x1ac805['mailAccounts'][_0x43e536['id']])){_0x1ac805[_0x3cbd('0x2')][_0x43e536['id']]=new MailAccount(_0x43e536);}else{_[_0x3cbd('0x8')](_0x1ac805[_0x3cbd('0x2')][_0x43e536['id']],_0x43e536);}}}return _0x1ac805[_0x3cbd('0x2')];};};module[_0x3cbd('0x9')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index d9176d9..9493611 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 _0x1f2d=['TemplateId','MailServerIn','Imap','CloudProvider','name','type','data5','MailServerOut','Smtp','getMailAccount','notify','NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','provider','service','email','active','key','ListId'];(function(_0x1e33c2,_0x450f43){var _0x3a19f0=function(_0x11cd7f){while(--_0x11cd7f){_0x1e33c2['push'](_0x1e33c2['shift']());}};_0x3a19f0(++_0x450f43);}(_0x1f2d,0x1c4));var _0xd1f2=function(_0x3fa296,_0x2bd315){_0x3fa296=_0x3fa296-0x0;var _0x10b19f=_0x1f2d[_0x3fa296];return _0x10b19f;};'use strict';var client=require(_0xd1f2('0x0'));exports[_0xd1f2('0x1')]=function(){return function(){return client[_0xd1f2('0x2')](_0xd1f2('0x3'),{'options':{'attributes':['id','name',_0xd1f2('0x4'),_0xd1f2('0x5'),_0xd1f2('0x6'),_0xd1f2('0x7'),_0xd1f2('0x8'),_0xd1f2('0x9'),_0xd1f2('0xa')],'raw':![],'include':[{'model':_0xd1f2('0xb'),'as':_0xd1f2('0xc'),'include':[{'model':_0xd1f2('0xd'),'attributes':['id',_0xd1f2('0xe'),_0xd1f2('0x5'),_0xd1f2('0xf'),_0xd1f2('0x10')],'as':_0xd1f2('0xd')}]},{'model':_0xd1f2('0x11'),'as':_0xd1f2('0x12'),'include':[{'model':'CloudProvider','attributes':['id',_0xd1f2('0xe'),_0xd1f2('0x5'),_0xd1f2('0xf'),_0xd1f2('0x10')],'as':'CloudProvider'}]}]},'log':_0xd1f2('0x13')});};};exports[_0xd1f2('0x14')]=function(_0x9b89e1,_0x57bc60){return client[_0xd1f2('0x2')](_0xd1f2('0x15'),{'account':{'id':_0x9b89e1},'body':_0x57bc60,'log':_0xd1f2('0x15')});}; \ No newline at end of file +var _0x1921=['notify','NotifyMailAccount','../client','Request','GetMailAccount','name','provider','service','email','active','key','ListId','TemplateId','MailServerIn','type','data5','CloudProvider','MailServerOut','Smtp','getMailAccount'];(function(_0x5a2949,_0xe59ab1){var _0x4113c5=function(_0x58e80a){while(--_0x58e80a){_0x5a2949['push'](_0x5a2949['shift']());}};_0x4113c5(++_0xe59ab1);}(_0x1921,0xf2));var _0x1192=function(_0x4a5b8e,_0x2d6a42){_0x4a5b8e=_0x4a5b8e-0x0;var _0x1e75ef=_0x1921[_0x4a5b8e];return _0x1e75ef;};'use strict';var client=require(_0x1192('0x0'));exports['getMailAccounts']=function(){return function(){return client[_0x1192('0x1')](_0x1192('0x2'),{'options':{'attributes':['id',_0x1192('0x3'),_0x1192('0x4'),_0x1192('0x5'),_0x1192('0x6'),_0x1192('0x7'),_0x1192('0x8'),_0x1192('0x9'),_0x1192('0xa')],'raw':![],'include':[{'model':_0x1192('0xb'),'as':'Imap','include':[{'model':'CloudProvider','attributes':['id',_0x1192('0x3'),_0x1192('0x5'),_0x1192('0xc'),_0x1192('0xd')],'as':_0x1192('0xe')}]},{'model':_0x1192('0xf'),'as':_0x1192('0x10'),'include':[{'model':_0x1192('0xe'),'attributes':['id','name','service',_0x1192('0xc'),_0x1192('0xd')],'as':_0x1192('0xe')}]}]},'log':_0x1192('0x11')});};};exports[_0x1192('0x12')]=function(_0x1b7422,_0x428541){return client['Request'](_0x1192('0x13'),{'account':{'id':_0x1b7422},'body':_0x428541,'log':'NotifyMailAccount'});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index e98e725..dc5e113 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 _0x1dc2=['getSettings','Request','ShowSetting','loginMailFrequency','GetSettings'];(function(_0x288237,_0x242392){var _0x23c6d0=function(_0x2d4efc){while(--_0x2d4efc){_0x288237['push'](_0x288237['shift']());}};_0x23c6d0(++_0x242392);}(_0x1dc2,0x19f));var _0x21dc=function(_0x15c8be,_0xff590c){_0x15c8be=_0x15c8be-0x0;var _0x1ecfdf=_0x1dc2[_0x15c8be];return _0x1ecfdf;};'use strict';var client=require('../client');exports[_0x21dc('0x0')]=function(){return client[_0x21dc('0x1')](_0x21dc('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x21dc('0x3')]},'log':_0x21dc('0x4')});}; \ No newline at end of file +var _0x09bd=['GetSettings','../client','getSettings','ShowSetting','loginMailFrequency'];(function(_0x218c80,_0x2f2999){var _0x3848d4=function(_0x43784b){while(--_0x43784b){_0x218c80['push'](_0x218c80['shift']());}};_0x3848d4(++_0x2f2999);}(_0x09bd,0x74));var _0xd09b=function(_0x4d5308,_0x268d72){_0x4d5308=_0x4d5308-0x0;var _0x56635a=_0x09bd[_0x4d5308];return _0x56635a;};'use strict';var client=require(_0xd09b('0x0'));exports[_0xd09b('0x1')]=function(){return client['Request'](_0xd09b('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xd09b('0x3')]},'log':_0xd09b('0x4')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 26e6c11..f4af34e 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(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'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(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'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 f953850..784abf2 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 _0x9a1b=['listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','express','sticky-session','ioredis','../../config/environment','timeout','listen','port','socket.io','websocket','polling','redis','localhost','../../config/triggers','default','../../config/socketio'];(function(_0x1f5887,_0x2fa1f1){var _0x21774b=function(_0x48a7e5){while(--_0x48a7e5){_0x1f5887['push'](_0x1f5887['shift']());}};_0x21774b(++_0x2fa1f1);}(_0x9a1b,0x194));var _0xb9a1=function(_0x4cabed,_0x4e8a8c){_0x4cabed=_0x4cabed-0x0;var _0x369697=_0x9a1b[_0x4cabed];return _0x369697;};'use strict';var _=require(_0xb9a1('0x0'));var http=require('http');var express=require(_0xb9a1('0x1'));var sticky=require(_0xb9a1('0x2'));var Redis=require(_0xb9a1('0x3'));var config=require(_0xb9a1('0x4'));var app=express();var server=http['createServer'](app);server[_0xb9a1('0x5')]=0xdbba0;if(sticky[_0xb9a1('0x6')](server,config[_0xb9a1('0x7')])){var socketio=require(_0xb9a1('0x8'))(server,{'transports':[_0xb9a1('0x9'),_0xb9a1('0xa')]});config['redis']=_['defaults'](config[_0xb9a1('0xb')],{'host':_0xb9a1('0xc'),'port':0x18eb});socketio['adapter'](require('socket.io-redis')({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0xb9a1('0xb')])}));require(_0xb9a1('0xd'))[_0xb9a1('0xe')]();require(_0xb9a1('0xf'))[_0xb9a1('0xe')](socketio);require('../../config/express')[_0xb9a1('0xe')](app);require('../../routes')[_0xb9a1('0xe')](app);}else{server['once'](_0xb9a1('0x10'),function(){console[_0xb9a1('0x11')](_0xb9a1('0x12'),config['port']);});}exports=module[_0xb9a1('0x13')]=app; \ No newline at end of file +var _0x135b=['default','../../config/express','../../routes','once','log','port','lodash','express','sticky-session','../../config/environment','createServer','socket.io','websocket','polling','redis','localhost','adapter','socket.io-redis','../../config/triggers','../../config/socketio'];(function(_0x25a60c,_0x3fd6a7){var _0x4e6306=function(_0x4e14f1){while(--_0x4e14f1){_0x25a60c['push'](_0x25a60c['shift']());}};_0x4e6306(++_0x3fd6a7);}(_0x135b,0x7e));var _0xb135=function(_0x26a01b,_0x596242){_0x26a01b=_0x26a01b-0x0;var _0x2b43f1=_0x135b[_0x26a01b];return _0x2b43f1;};'use strict';var _=require(_0xb135('0x0'));var http=require('http');var express=require(_0xb135('0x1'));var sticky=require(_0xb135('0x2'));var Redis=require('ioredis');var config=require(_0xb135('0x3'));var app=express();var server=http[_0xb135('0x4')](app);server['timeout']=0xdbba0;if(sticky['listen'](server,config['port'])){var socketio=require(_0xb135('0x5'))(server,{'transports':[_0xb135('0x6'),_0xb135('0x7')]});config[_0xb135('0x8')]=_['defaults'](config[_0xb135('0x8')],{'host':_0xb135('0x9'),'port':0x18eb});socketio[_0xb135('0xa')](require(_0xb135('0xb'))({'pubClient':new Redis(config[_0xb135('0x8')]),'subClient':new Redis(config[_0xb135('0x8')])}));require(_0xb135('0xc'))['default']();require(_0xb135('0xd'))[_0xb135('0xe')](socketio);require(_0xb135('0xf'))['default'](app);require(_0xb135('0x10'))[_0xb135('0xe')](app);}else{server[_0xb135('0x11')]('listening',function(){console[_0xb135('0x12')]('Express\x20server\x20listening\x20on\x20port\x20%d!',config[_0xb135('0x13')]);});}exports=module['exports']=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index e9d05ca..79baea6 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 _0x25c3=['error','message','result','catch','exports','bluebird','../../config/logger','routing','http','Request','then','debug','rpc'];(function(_0xf1f37e,_0x159a20){var _0x2e3a6d=function(_0x4163cd){while(--_0x4163cd){_0xf1f37e['push'](_0xf1f37e['shift']());}};_0x2e3a6d(++_0x159a20);}(_0x25c3,0xd5));var _0x325c=function(_0x4b80de,_0x163b7d){_0x4b80de=_0x4b80de-0x0;var _0x27756b=_0x25c3[_0x4b80de];return _0x27756b;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x325c('0x0'));var logger=require(_0x325c('0x1'))(_0x325c('0x2'));var client=jayson['client'][_0x325c('0x3')]({'port':0x2329});client[_0x325c('0x4')]=function(_0x351bc7,_0x7bb49c){return new BPromise(function(_0x2b5b14,_0x31ba16){return client['request'](_0x351bc7,_0x7bb49c)[_0x325c('0x5')](function(_0x2b592e){logger[_0x325c('0x6')](_0x325c('0x7'),'routing',_0x351bc7,_0x7bb49c,_0x2b592e);if(_0x2b592e[_0x325c('0x8')]){logger['error'](_0x325c('0x7'),_0x325c('0x2'),_0x351bc7,_0x2b592e[_0x325c('0x8')][_0x325c('0x9')],_0x7bb49c);return _0x31ba16(_0x2b592e[_0x325c('0x8')][_0x325c('0x9')]);}else{return _0x2b5b14(_0x2b592e[_0x325c('0xa')]);}})[_0x325c('0xb')](function(_0x29016c){logger[_0x325c('0x8')]('rpc',_0x325c('0x2'),_0x351bc7,_0x29016c,_0x7bb49c);return _0x31ba16(_0x29016c);});});};module[_0x325c('0xc')]=client; \ No newline at end of file +var _0xb57a=['jayson/promise','bluebird','../../config/logger','routing','client','http','request','rpc','error','message','result','catch'];(function(_0x4017b0,_0x4347db){var _0x5ed4f7=function(_0x706c26){while(--_0x706c26){_0x4017b0['push'](_0x4017b0['shift']());}};_0x5ed4f7(++_0x4347db);}(_0xb57a,0x84));var _0xab57=function(_0x583e1b,_0x1affbf){_0x583e1b=_0x583e1b-0x0;var _0x386cc1=_0xb57a[_0x583e1b];return _0x386cc1;};'use strict';var jayson=require(_0xab57('0x0'));var BPromise=require(_0xab57('0x1'));var logger=require(_0xab57('0x2'))(_0xab57('0x3'));var client=jayson[_0xab57('0x4')][_0xab57('0x5')]({'port':0x2329});client['Request']=function(_0x1b7488,_0x4b52c8){return new BPromise(function(_0x2fc6dd,_0x570a01){return client[_0xab57('0x6')](_0x1b7488,_0x4b52c8)['then'](function(_0x3b90d1){logger['debug'](_0xab57('0x7'),_0xab57('0x3'),_0x1b7488,_0x4b52c8,_0x3b90d1);if(_0x3b90d1[_0xab57('0x8')]){logger[_0xab57('0x8')](_0xab57('0x7'),_0xab57('0x3'),_0x1b7488,_0x3b90d1[_0xab57('0x8')]['message'],_0x4b52c8);return _0x570a01(_0x3b90d1[_0xab57('0x8')][_0xab57('0x9')]);}else{return _0x2fc6dd(_0x3b90d1[_0xab57('0xa')]);}})[_0xab57('0xb')](function(_0x5c34b5){logger['error'](_0xab57('0x7'),'routing',_0x1b7488,_0x5c34b5,_0x4b52c8);return _0x570a01(_0x5c34b5);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 4e0cd89..a90d591 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 _0x8a93=['./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','then','initAgents','getIntervals','initIntervals','initOpenchannelQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','log','bluebird','./server','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x8a93,0xdb));var _0x38a9=function(_0x2fe5a8,_0x36dfc3){_0x2fe5a8=_0x2fe5a8-0x0;var _0x5cf27c=_0x8a93[_0x2fe5a8];return _0x5cf27c;};'use strict';var BPromise=require(_0x38a9('0x0'));var server=require(_0x38a9('0x1'));var Realtime=require('./realtime');var user=require(_0x38a9('0x2'));var interval=require(_0x38a9('0x3'));var openchannelQueue=require(_0x38a9('0x4'));var chatQueue=require(_0x38a9('0x5'));var smsQueue=require(_0x38a9('0x6'));var mailQueue=require(_0x38a9('0x7'));var faxQueue=require(_0x38a9('0x8'));var whatsappQueue=require(_0x38a9('0x9'));var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()[_0x38a9('0xa')](user['getAgents']())[_0x38a9('0xa')](realtime[_0x38a9('0xb')]())[_0x38a9('0xa')](interval[_0x38a9('0xc')]())[_0x38a9('0xa')](realtime[_0x38a9('0xd')]())[_0x38a9('0xa')](openchannelQueue['getOpenchannelQueues']())['then'](realtime[_0x38a9('0xe')]())['then'](chatQueue['getChatQueues']())[_0x38a9('0xa')](realtime[_0x38a9('0xf')]())[_0x38a9('0xa')](smsQueue[_0x38a9('0x10')]())[_0x38a9('0xa')](realtime[_0x38a9('0x11')]())[_0x38a9('0xa')](mailQueue[_0x38a9('0x12')]())[_0x38a9('0xa')](realtime['initMailQueues']())[_0x38a9('0xa')](faxQueue['getFaxQueues']())[_0x38a9('0xa')](realtime[_0x38a9('0x13')]())[_0x38a9('0xa')](whatsappQueue[_0x38a9('0x14')]())[_0x38a9('0xa')](realtime[_0x38a9('0x15')]())[_0x38a9('0xa')](function(){return realtime;});}function main(){return server[_0x38a9('0x16')](realtime)[_0x38a9('0xa')](function(_0x375f2a){return initRealtime();})[_0x38a9('0xa')](function(_0x5a6c76){return setInterval(initRealtime,0x1388);})[_0x38a9('0x17')](function(_0x1f9f1c){console[_0x38a9('0x18')](_0x1f9f1c);});}main(); \ No newline at end of file +var _0x1de2=['getSmsQueues','initSmsQueues','getMailQueues','initFaxQueues','listen','catch','log','bluebird','./rpc/interval','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','initAgents','getIntervals','then','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues'];(function(_0x1e4e76,_0x55d81a){var _0x2b9b53=function(_0x85b25c){while(--_0x85b25c){_0x1e4e76['push'](_0x1e4e76['shift']());}};_0x2b9b53(++_0x55d81a);}(_0x1de2,0xa1));var _0x21de=function(_0x374ccf,_0xa945c4){_0x374ccf=_0x374ccf-0x0;var _0x443cde=_0x1de2[_0x374ccf];return _0x443cde;};'use strict';var BPromise=require(_0x21de('0x0'));var server=require('./server');var Realtime=require('./realtime');var user=require('./rpc/user');var interval=require(_0x21de('0x1'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require('./rpc/chatQueue');var smsQueue=require(_0x21de('0x2'));var mailQueue=require(_0x21de('0x3'));var faxQueue=require(_0x21de('0x4'));var whatsappQueue=require(_0x21de('0x5'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x21de('0x6')]()['then'](user['getAgents']())['then'](realtime[_0x21de('0x7')]())['then'](interval[_0x21de('0x8')]())[_0x21de('0x9')](realtime[_0x21de('0xa')]())[_0x21de('0x9')](openchannelQueue[_0x21de('0xb')]())[_0x21de('0x9')](realtime[_0x21de('0xc')]())['then'](chatQueue[_0x21de('0xd')]())[_0x21de('0x9')](realtime[_0x21de('0xe')]())[_0x21de('0x9')](smsQueue[_0x21de('0xf')]())[_0x21de('0x9')](realtime[_0x21de('0x10')]())['then'](mailQueue[_0x21de('0x11')]())[_0x21de('0x9')](realtime['initMailQueues']())['then'](faxQueue['getFaxQueues']())[_0x21de('0x9')](realtime[_0x21de('0x12')]())[_0x21de('0x9')](whatsappQueue['getWhatsappQueues']())[_0x21de('0x9')](realtime['initWhatsappQueues']())[_0x21de('0x9')](function(){return realtime;});}function main(){return server[_0x21de('0x13')](realtime)['then'](function(_0x4ea920){return initRealtime();})['then'](function(_0x2dfe4c){return setInterval(initRealtime,0x1388);})[_0x21de('0x14')](function(_0x2d137c){console[_0x21de('0x15')](_0x2d137c);});}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 f44ac7c..82633b9 100644 --- a/server/services/routing/lib/rule-engine.js +++ b/server/services/routing/lib/rule-engine.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fc3=['lodash','util','EventEmitter','init','isNil','ignoreFactChanges','inherits','activeRules','prototype','register','isArray','rules','isObject','sync','orderBy','asc','execute','clone','ruleRef','name','index_','push','call','nextTick','next','isEqual','restart','length','condition','matchPath','noop','findRules','filter','prioritize','priority','toJSON','map','consequence','toString','fromJSON','isString','parse'];(function(_0x3af0d0,_0xee84f9){var _0x5533a7=function(_0xe0d1c7){while(--_0xe0d1c7){_0x3af0d0['push'](_0x3af0d0['shift']());}};_0x5533a7(++_0xee84f9);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x5fc3[_0x3511d3];return _0x5d6321;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var EventEmitter=require('events')[_0x35fc('0x2')];function RuleEngine(_0x2ac6da,_0x196bc2){this[_0x35fc('0x3')]();if(!_[_0x35fc('0x4')](_0x2ac6da)){this['register'](_0x2ac6da);}if(_0x196bc2){this[_0x35fc('0x5')]=_0x196bc2[_0x35fc('0x5')];}return this;}util[_0x35fc('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x19a0d1){this['rules']=[];this[_0x35fc('0x7')]=[];};RuleEngine[_0x35fc('0x8')][_0x35fc('0x9')]=function(_0x1e5f90){if(Array[_0x35fc('0xa')](_0x1e5f90)){this[_0x35fc('0xb')]=this[_0x35fc('0xb')]['concat'](_0x1e5f90);}else if(_0x1e5f90!==null&&_[_0x35fc('0xc')](_0x1e5f90)){this[_0x35fc('0xb')]['push'](_0x1e5f90);}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')]['sync']=function(){this[_0x35fc('0x7')]=this[_0x35fc('0xb')]['filter'](function(_0x4cbe74){if(_[_0x35fc('0x4')](_0x4cbe74['on'])){_0x4cbe74['on']=!![];}if(_0x4cbe74['on']===!![]){return _0x4cbe74;}});this['activeRules']=_[_0x35fc('0xe')](this[_0x35fc('0x7')],['p'],[_0x35fc('0xf')]);};RuleEngine[_0x35fc('0x8')][_0x35fc('0x10')]=function(_0x5cfe94,_0x59507a){var _0x5eac0f=![];_0x5cfe94['result']=!![];var _0x398b67=_[_0x35fc('0x11')](_0x5cfe94);var _0x53b898=_[_0x35fc('0x11')](_0x5cfe94);var _0x227a49=this[_0x35fc('0x7')];var _0x480851=[];var _0x26ba54=this[_0x35fc('0x5')];(function FnRuleLoop(_0x553677){var _0x41e165={'rules':function(){return _0x227a49;},'rule':function(){return _0x227a49[_0x553677];},'when':function(_0x363e47){if(_0x363e47){var _0x2e513b=_0x227a49[_0x553677]['consequence'];_0x2e513b[_0x35fc('0x12')]=_0x227a49[_0x553677]['id']||_0x227a49[_0x553677][_0x35fc('0x13')]||_0x35fc('0x14')+_0x553677;process['nextTick'](function(){_0x480851[_0x35fc('0x15')](_0x2e513b[_0x35fc('0x12')]);_0x2e513b[_0x35fc('0x16')](_0x398b67,_0x41e165);});}else{process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x5eac0f=!![];return FnRuleLoop(0x0);},'next':function(_0x21f1a9){if(!_0x26ba54&&!_[_0x35fc('0x19')](_0x53b898,_0x398b67)){_0x53b898=_[_0x35fc('0x11')](_0x398b67);process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x1a')]();});}else{process['nextTick'](function(){if(_[_0x35fc('0x4')](_0x21f1a9)){return FnRuleLoop(_0x553677+0x1);}else{return FnRuleLoop(_0x21f1a9);}});}}};if(_0x553677<_0x227a49[_0x35fc('0x1b')]&&_0x5eac0f===![]){var _0x257719=_0x227a49[_0x553677][_0x35fc('0x1c')];_0x257719[_0x35fc('0x16')](_0x398b67,_0x41e165);}else{process['nextTick'](function(){_0x398b67[_0x35fc('0x1d')]=_0x480851;return _0x59507a?_0x59507a(_0x398b67):_[_0x35fc('0x1e')]();});}}(0x0));};RuleEngine['prototype'][_0x35fc('0x1f')]=function(_0x5a93df){if(_[_0x35fc('0x4')](_0x5a93df)){return this['rules'];}else{var _0x4086e9=_['matches'](_0x5a93df);return _[_0x35fc('0x20')](this[_0x35fc('0xb')],_0x4086e9);}};RuleEngine['prototype']['turn']=function(_0x47774c,_0x58edb6){var _0x274208=_0x47774c==='on'||_0x47774c==='ON'?!![]:![];var _0x1a5d92=this['findRules'](_0x58edb6);for(var _0x26b7cb=0x0,_0x645eac=_0x1a5d92[_0x35fc('0x1b')];_0x26b7cb<_0x645eac;_0x26b7cb+=0x1){_0x1a5d92[_0x26b7cb]['on']=_0x274208;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x21')]=function(_0x11ccdb,_0x451f0c){_0x11ccdb=parseInt(_0x11ccdb,0xa);var _0x54aedc=this[_0x35fc('0x1f')](_0x451f0c);for(var _0x220931=0x0,_0x22af18=_0x54aedc['length'];_0x220931<_0x22af18;_0x220931+=0x1){_0x54aedc[_0x220931][_0x35fc('0x22')]=_0x11ccdb;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x23')]=function(){var _0xd8a4ca=this[_0x35fc('0xb')];if(_0xd8a4ca instanceof Array){_0xd8a4ca=_0xd8a4ca[_0x35fc('0x24')](function(_0x37b435){_0x37b435[_0x35fc('0x1c')]=_0x37b435[_0x35fc('0x1c')]['toString']();_0x37b435['consequence']=_0x37b435[_0x35fc('0x25')]['toString']();return _0x37b435;});}else if(!_[_0x35fc('0x4')](_0xd8a4ca)){_0xd8a4ca[_0x35fc('0x1c')]=_0xd8a4ca[_0x35fc('0x1c')][_0x35fc('0x26')]();_0xd8a4ca[_0x35fc('0x25')]=_0xd8a4ca[_0x35fc('0x25')]['toString']();}return _0xd8a4ca;};RuleEngine[_0x35fc('0x8')][_0x35fc('0x27')]=function(_0x46b9ef){this[_0x35fc('0x3')]();if(_[_0x35fc('0x28')](_0x46b9ef)){_0x46b9ef=JSON[_0x35fc('0x29')](_0x46b9ef);}if(_0x46b9ef instanceof Array){_0x46b9ef=_0x46b9ef['map'](function(_0x2483be){_0x2483be[_0x35fc('0x1c')]=eval('('+_0x2483be[_0x35fc('0x1c')]+')');_0x2483be['consequence']=eval('('+_0x2483be[_0x35fc('0x25')]+')');return _0x2483be;});}else if(_0x46b9ef!==null&&typeof _0x46b9ef=='object'){_0x46b9ef[_0x35fc('0x1c')]=eval('('+_0x46b9ef[_0x35fc('0x1c')]+')');_0x46b9ef[_0x35fc('0x25')]=eval('('+_0x46b9ef[_0x35fc('0x25')]+')');}this['register'](_0x46b9ef);};module['exports']=RuleEngine; \ No newline at end of file +var _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(_0x49acc0,_0x350083){var _0x99c851=function(_0x44f535){while(--_0x44f535){_0x49acc0['push'](_0x49acc0['shift']());}};_0x99c851(++_0x350083);}(_0x7a54,0x106));var _0x47a5=function(_0x1927a1,_0x324e02){_0x1927a1=_0x1927a1-0x0;var _0x3970b3=_0x7a54[_0x1927a1];return _0x3970b3;};'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 diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index a5b82c0..da8846e 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 _0x791e=['result','catch','sendMailMessage','SendMail','jayson/promise','client','http','then','error','message'];(function(_0x512136,_0x2ec76d){var _0x255195=function(_0x20ea61){while(--_0x20ea61){_0x512136['push'](_0x512136['shift']());}};_0x255195(++_0x2ec76d);}(_0x791e,0xae));var _0xe791=function(_0x5934f1,_0x597286){_0x5934f1=_0x5934f1-0x0;var _0x194a46=_0x791e[_0x5934f1];return _0x194a46;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xe791('0x0'));var client=jayson[_0xe791('0x1')][_0xe791('0x2')]({'port':0x232b});function request(_0x4f35e4,_0x30cf2b){return new BPromise(function(_0x4aa8d7,_0x4819ea){return client['request'](_0x4f35e4,_0x30cf2b)[_0xe791('0x3')](function(_0x36488b){if(_0x36488b[_0xe791('0x4')]){return _0x4819ea(_0x36488b['error'][_0xe791('0x5')]);}else{return _0x4aa8d7(_0x36488b[_0xe791('0x6')]);}})[_0xe791('0x7')](function(_0x4fe48e){return _0x4819ea(_0x4fe48e);});});}exports[_0xe791('0x8')]=function(_0xfe288a,_0x453f9a){return request(_0xe791('0x9'),{'account':_0xfe288a,'message':_0x453f9a});}; \ No newline at end of file +var _0xf796=['catch','SendMail','jayson/promise','client','http','error','message','result'];(function(_0x38d6fb,_0x21df02){var _0x3f4470=function(_0x5b59d7){while(--_0x5b59d7){_0x38d6fb['push'](_0x38d6fb['shift']());}};_0x3f4470(++_0x21df02);}(_0xf796,0x13a));var _0x6f79=function(_0x109b2b,_0x1f8249){_0x109b2b=_0x109b2b-0x0;var _0x448eab=_0xf796[_0x109b2b];return _0x448eab;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x6f79('0x0'));var client=jayson[_0x6f79('0x1')][_0x6f79('0x2')]({'port':0x232b});function request(_0x4e06c5,_0x5ca211){return new BPromise(function(_0x319d14,_0x18c895){return client['request'](_0x4e06c5,_0x5ca211)['then'](function(_0x266e8d){if(_0x266e8d[_0x6f79('0x3')]){return _0x18c895(_0x266e8d[_0x6f79('0x3')][_0x6f79('0x4')]);}else{return _0x319d14(_0x266e8d[_0x6f79('0x5')]);}})[_0x6f79('0x6')](function(_0x1c0af6){return _0x18c895(_0x1c0af6);});});}exports['sendMailMessage']=function(_0x2d3d9a,_0x1c2f2b){return request(_0x6f79('0x7'),{'account':_0x2d3d9a,'message':_0x1c2f2b});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 868c067..799a4f7 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 _0x6a27=['faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','openchannelCapacity','openchannelCurrentCapacity','busyQueue','md5','updateRealtime','prototype','Capacity','CurrentCapacity','maxcapacity','working','idle','chat','openchannel','length','StatusTime','toNumber','format','Status','voicePause','faxStatusTime','whatsappCurrentCapacity','openchannelStatusTime','busy','stringify','emit','user:save','lodash','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','online','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailCapacity','mailCurrentCapacity','faxStatus'];(function(_0x4c9f6a,_0xcb2cb2){var _0x5df5b9=function(_0x303cf2){while(--_0x303cf2){_0x4c9f6a['push'](_0x4c9f6a['shift']());}};_0x5df5b9(++_0xcb2cb2);}(_0x6a27,0x97));var _0x76a2=function(_0x523ed5,_0x2e9c31){_0x523ed5=_0x523ed5-0x0;var _0x2e0f40=_0x6a27[_0x523ed5];return _0x2e0f40;};'use strict';var _=require(_0x76a2('0x0'));var moment=require('moment');var md5=require('md5');var Redis=require(_0x76a2('0x1'));var config=require(_0x76a2('0x2'));config[_0x76a2('0x3')]=_[_0x76a2('0x4')](config[_0x76a2('0x3')],{'host':_0x76a2('0x5'),'port':0x18eb});var io=require(_0x76a2('0x6'))(new Redis(config[_0x76a2('0x3')]));function Agent(_0x9cf6db){this['id']=_0x9cf6db['id']||0x0;this[_0x76a2('0x7')]=_0x9cf6db[_0x76a2('0x7')]||'';this[_0x76a2('0x8')]=_0x9cf6db[_0x76a2('0x8')]||!![];this['voicePause']=_0x9cf6db['voicePause']||![];this['chatPause']=_0x9cf6db[_0x76a2('0x9')]||![];this[_0x76a2('0xa')]=_0x9cf6db['mailPause']||![];this[_0x76a2('0xb')]=_0x9cf6db[_0x76a2('0xb')]||![];this[_0x76a2('0xc')]=_0x9cf6db['smsPause']||![];this[_0x76a2('0xd')]=_0x9cf6db[_0x76a2('0xd')]||![];this[_0x76a2('0xe')]=_0x76a2('0xf');this[_0x76a2('0x10')]=0x0;this[_0x76a2('0x11')]=_0x9cf6db['chatCapacity']||0x0;this[_0x76a2('0x12')]=0x0;this[_0x76a2('0x13')]=_0x76a2('0xf');this['mailStatusTime']=0x0;this[_0x76a2('0x14')]=_0x9cf6db[_0x76a2('0x14')]||0x0;this[_0x76a2('0x15')]=0x0;this[_0x76a2('0x16')]=_0x76a2('0xf');this['faxStatusTime']=0x0;this['faxCapacity']=_0x9cf6db[_0x76a2('0x17')]||0x0;this[_0x76a2('0x18')]=0x0;this[_0x76a2('0x19')]='unknown';this[_0x76a2('0x1a')]=0x0;this[_0x76a2('0x1b')]=_0x9cf6db[_0x76a2('0x1b')]||0x0;this[_0x76a2('0x1c')]=0x0;this[_0x76a2('0x1d')]=_0x76a2('0xf');this[_0x76a2('0x1e')]=0x0;this[_0x76a2('0x1f')]=_0x9cf6db['whatsappCapacity']||0x0;this['whatsappCurrentCapacity']=0x0;this['openchannelStatus']=_0x76a2('0xf');this['openchannelStatusTime']=0x0;this[_0x76a2('0x20')]=_0x9cf6db[_0x76a2('0x20')]||0x0;this[_0x76a2('0x21')]=0x0;this['busy']=![];this[_0x76a2('0x22')]=undefined;this[_0x76a2('0x23')]='';this[_0x76a2('0x24')]();}Agent[_0x76a2('0x25')]['getChannelStatus']=function(_0x1e389d){if(this[_0x1e389d+'CurrentCapacity']>0x0){if(this[_0x1e389d+_0x76a2('0x26')]>0x0&&this[_0x1e389d+_0x76a2('0x27')]>=this[_0x1e389d+_0x76a2('0x26')]){return _0x76a2('0x28');}else{return _0x76a2('0x29');}}else{return _0x76a2('0x2a');}};Agent['prototype'][_0x76a2('0x24')]=function(){var _0x4773c2=['mail',_0x76a2('0x2b'),_0x76a2('0x2c'),'fax','sms','whatsapp'];for(var _0x19d658=0x0;_0x19d658<_0x4773c2[_0x76a2('0x2d')];_0x19d658+=0x1){var _0x4c6931=this['getChannelStatus'](_0x4773c2[_0x19d658]);if(this[_0x4773c2[_0x19d658]+'Status']!==_0x4c6931){this[_0x4773c2[_0x19d658]+_0x76a2('0x2e')]=_[_0x76a2('0x2f')](moment()[_0x76a2('0x30')]('x'));}this[_0x4773c2[_0x19d658]+_0x76a2('0x31')]=_0x4c6931;}var _0x1f4999={'id':this['id'],'name':this['name'],'online':this[_0x76a2('0x8')],'voicePause':this[_0x76a2('0x32')],'chatPause':this['chatPause'],'mailPause':this[_0x76a2('0xa')],'smsPause':this['smsPause'],'faxPause':this[_0x76a2('0xb')],'openchannelPause':this['openchannelPause'],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0x76a2('0x10')],'chatCapacity':this[_0x76a2('0x11')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0x76a2('0x13')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0x76a2('0x14')],'mailCurrentCapacity':this[_0x76a2('0x15')],'faxStatus':this[_0x76a2('0x16')],'faxStatusTime':this[_0x76a2('0x33')],'faxCapacity':this[_0x76a2('0x17')],'faxCurrentCapacity':this[_0x76a2('0x18')],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0x76a2('0x1a')],'smsCapacity':this[_0x76a2('0x1b')],'smsCurrentCapacity':this[_0x76a2('0x1c')],'whatsappStatus':this[_0x76a2('0x1d')],'whatsappStatusTime':this[_0x76a2('0x1e')],'whatsappCapacity':this[_0x76a2('0x1f')],'whatsappCurrentCapacity':this[_0x76a2('0x34')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0x76a2('0x35')],'openchannelCapacity':this[_0x76a2('0x20')],'openchannelCurrentCapacity':this[_0x76a2('0x21')],'busy':this[_0x76a2('0x36')],'busyQueue':this[_0x76a2('0x22')]};var _0x59a50a=md5(JSON[_0x76a2('0x37')](_0x1f4999));if(this[_0x76a2('0x23')]!==_0x59a50a){this['md5']=_0x59a50a;io[_0x76a2('0x38')](_0x76a2('0x39'),_0x1f4999);}};module['exports']=Agent; \ No newline at end of file +var _0xa4b2=['lodash','moment','md5','../../../config/environment','redis','localhost','socket.io-emitter','name','online','voicePause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','unknown','mailStatusTime','mailCapacity','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','updateRealtime','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','prototype','mail','chat','openchannel','fax','sms','whatsapp','length','Status','StatusTime','toNumber','format','chatPause','mailCurrentCapacity','faxStatus','openchannelStatus','stringify','user:save','exports'];(function(_0x1bf7c3,_0x10253c){var _0xe823de=function(_0x4647f7){while(--_0x4647f7){_0x1bf7c3['push'](_0x1bf7c3['shift']());}};_0xe823de(++_0x10253c);}(_0xa4b2,0x80));var _0x2a4b=function(_0x25668d,_0x2c7ede){_0x25668d=_0x25668d-0x0;var _0x2247ac=_0xa4b2[_0x25668d];return _0x2247ac;};'use strict';var _=require(_0x2a4b('0x0'));var moment=require(_0x2a4b('0x1'));var md5=require(_0x2a4b('0x2'));var Redis=require('ioredis');var config=require(_0x2a4b('0x3'));config[_0x2a4b('0x4')]=_['defaults'](config[_0x2a4b('0x4')],{'host':_0x2a4b('0x5'),'port':0x18eb});var io=require(_0x2a4b('0x6'))(new Redis(config[_0x2a4b('0x4')]));function Agent(_0x579250){this['id']=_0x579250['id']||0x0;this[_0x2a4b('0x7')]=_0x579250['name']||'';this[_0x2a4b('0x8')]=_0x579250[_0x2a4b('0x8')]||!![];this[_0x2a4b('0x9')]=_0x579250['voicePause']||![];this['chatPause']=_0x579250['chatPause']||![];this[_0x2a4b('0xa')]=_0x579250[_0x2a4b('0xa')]||![];this[_0x2a4b('0xb')]=_0x579250[_0x2a4b('0xb')]||![];this[_0x2a4b('0xc')]=_0x579250[_0x2a4b('0xc')]||![];this[_0x2a4b('0xd')]=_0x579250['openchannelPause']||![];this[_0x2a4b('0xe')]='unknown';this[_0x2a4b('0xf')]=0x0;this[_0x2a4b('0x10')]=_0x579250['chatCapacity']||0x0;this[_0x2a4b('0x11')]=0x0;this[_0x2a4b('0x12')]=_0x2a4b('0x13');this[_0x2a4b('0x14')]=0x0;this[_0x2a4b('0x15')]=_0x579250[_0x2a4b('0x15')]||0x0;this['mailCurrentCapacity']=0x0;this['faxStatus']=_0x2a4b('0x13');this[_0x2a4b('0x16')]=0x0;this['faxCapacity']=_0x579250[_0x2a4b('0x17')]||0x0;this[_0x2a4b('0x18')]=0x0;this[_0x2a4b('0x19')]='unknown';this[_0x2a4b('0x1a')]=0x0;this[_0x2a4b('0x1b')]=_0x579250['smsCapacity']||0x0;this[_0x2a4b('0x1c')]=0x0;this[_0x2a4b('0x1d')]='unknown';this[_0x2a4b('0x1e')]=0x0;this[_0x2a4b('0x1f')]=_0x579250[_0x2a4b('0x1f')]||0x0;this[_0x2a4b('0x20')]=0x0;this['openchannelStatus']=_0x2a4b('0x13');this[_0x2a4b('0x21')]=0x0;this[_0x2a4b('0x22')]=_0x579250[_0x2a4b('0x22')]||0x0;this[_0x2a4b('0x23')]=0x0;this[_0x2a4b('0x24')]=![];this[_0x2a4b('0x25')]=undefined;this[_0x2a4b('0x2')]='';this[_0x2a4b('0x26')]();}Agent['prototype'][_0x2a4b('0x27')]=function(_0x3c8182){if(this[_0x3c8182+_0x2a4b('0x28')]>0x0){if(this[_0x3c8182+'Capacity']>0x0&&this[_0x3c8182+_0x2a4b('0x28')]>=this[_0x3c8182+_0x2a4b('0x29')]){return _0x2a4b('0x2a');}else{return _0x2a4b('0x2b');}}else{return _0x2a4b('0x2c');}};Agent[_0x2a4b('0x2d')][_0x2a4b('0x26')]=function(){var _0xa41bad=[_0x2a4b('0x2e'),_0x2a4b('0x2f'),_0x2a4b('0x30'),_0x2a4b('0x31'),_0x2a4b('0x32'),_0x2a4b('0x33')];for(var _0x6e39d3=0x0;_0x6e39d3<_0xa41bad[_0x2a4b('0x34')];_0x6e39d3+=0x1){var _0x52a0f5=this[_0x2a4b('0x27')](_0xa41bad[_0x6e39d3]);if(this[_0xa41bad[_0x6e39d3]+_0x2a4b('0x35')]!==_0x52a0f5){this[_0xa41bad[_0x6e39d3]+_0x2a4b('0x36')]=_[_0x2a4b('0x37')](moment()[_0x2a4b('0x38')]('x'));}this[_0xa41bad[_0x6e39d3]+_0x2a4b('0x35')]=_0x52a0f5;}var _0x362e8d={'id':this['id'],'name':this[_0x2a4b('0x7')],'online':this[_0x2a4b('0x8')],'voicePause':this[_0x2a4b('0x9')],'chatPause':this[_0x2a4b('0x39')],'mailPause':this['mailPause'],'smsPause':this[_0x2a4b('0xc')],'faxPause':this['faxPause'],'openchannelPause':this[_0x2a4b('0xd')],'chatStatus':this[_0x2a4b('0xe')],'chatStatusTime':this[_0x2a4b('0xf')],'chatCapacity':this[_0x2a4b('0x10')],'chatCurrentCapacity':this[_0x2a4b('0x11')],'mailStatus':this[_0x2a4b('0x12')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0x2a4b('0x3a')],'faxStatus':this[_0x2a4b('0x3b')],'faxStatusTime':this[_0x2a4b('0x16')],'faxCapacity':this[_0x2a4b('0x17')],'faxCurrentCapacity':this[_0x2a4b('0x18')],'smsStatus':this[_0x2a4b('0x19')],'smsStatusTime':this[_0x2a4b('0x1a')],'smsCapacity':this[_0x2a4b('0x1b')],'smsCurrentCapacity':this[_0x2a4b('0x1c')],'whatsappStatus':this[_0x2a4b('0x1d')],'whatsappStatusTime':this[_0x2a4b('0x1e')],'whatsappCapacity':this[_0x2a4b('0x1f')],'whatsappCurrentCapacity':this[_0x2a4b('0x20')],'openchannelStatus':this[_0x2a4b('0x3c')],'openchannelStatusTime':this[_0x2a4b('0x21')],'openchannelCapacity':this[_0x2a4b('0x22')],'openchannelCurrentCapacity':this[_0x2a4b('0x23')],'busy':this['busy'],'busyQueue':this[_0x2a4b('0x25')]};var _0x269680=md5(JSON[_0x2a4b('0x3d')](_0x362e8d));if(this['md5']!==_0x269680){this['md5']=_0x269680;io['emit'](_0x2a4b('0x3e'),_0x362e8d);}};module[_0x2a4b('0x3f')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index bb7da9e..6235b49 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 _0x6218=['paused','length','online','chatPause','available','stringify','md5','emit','chat_queue:save','exports','lodash','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','prototype','updateRouting','mapAgentsId','_rr','map','updateRealtime','loggedIn'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6218,0x136));var _0x8621=function(_0x2c4d22,_0x4ca120){_0x2c4d22=_0x2c4d22-0x0;var _0x1f0537=_0x6218[_0x2c4d22];return _0x1f0537;};'use strict';var _=require(_0x8621('0x0'));var md5=require('md5');var util=require(_0x8621('0x1'));var Redis=require('ioredis');var config=require(_0x8621('0x2'));config[_0x8621('0x3')]=_[_0x8621('0x4')](config[_0x8621('0x3')],{'host':_0x8621('0x5'),'port':0x18eb});var io=require(_0x8621('0x6'))(new Redis(config[_0x8621('0x3')]));function ChatQueue(_0x1e2961){this['id']=_0x1e2961['id']||0x0;this['name']=_0x1e2961[_0x8621('0x7')]||'';this[_0x8621('0x8')]=_0x1e2961['timeout']||0xa;this[_0x8621('0x9')]=_0x1e2961[_0x8621('0x9')]||_0x8621('0xa');this[_0x8621('0xb')]=_0x1e2961[_0x8621('0xb')];this['mapAgentsId']={};this[_0x8621('0xc')]=0x0;this['md5']='';this['updateRouting']();this['updateRealtime']();}ChatQueue[_0x8621('0xd')][_0x8621('0xe')]=function(){var _0x11ec92=this[_0x8621('0xf')][_0x8621('0x10')];this['mapAgentsId']=_[_0x8621('0x11')](this[_0x8621('0xb')],'id');this[_0x8621('0xf')][_0x8621('0x10')]=_0x11ec92;};ChatQueue['prototype'][_0x8621('0x12')]=function(){this[_0x8621('0x13')]=0x0;this[_0x8621('0x14')]=0x0;for(var _0x512b3d=0x0;_0x512b3d=0x0?this[_0x8621('0x18')]:0x0;var _0x3fe5a9={'id':this['id'],'available':this[_0x8621('0x18')],'loggedIn':this[_0x8621('0x13')],'name':this[_0x8621('0x7')],'paused':this[_0x8621('0x14')],'waiting':this['waiting']};var _0x180e12=md5(JSON[_0x8621('0x19')](_0x3fe5a9));if(this[_0x8621('0x1a')]!==_0x180e12){this[_0x8621('0x1a')]=_0x180e12;io['to'](util['format']('chat:queue:%s',_0x3fe5a9['name']))[_0x8621('0x1b')](_0x8621('0x1c'),_0x3fe5a9);}};module[_0x8621('0x1d')]=ChatQueue; \ No newline at end of file +var _0x0d17=['strategy','beepall','Agents','waiting','updateRealtime','updateRouting','mapAgentsId','_rr','map','prototype','loggedIn','paused','length','online','chatPause','available','stringify','chat:queue:%s','emit','chat_queue:save','exports','md5','util','redis','localhost','socket.io-emitter','name','timeout'];(function(_0x499d15,_0x5376c1){var _0x189291=function(_0x52884f){while(--_0x52884f){_0x499d15['push'](_0x499d15['shift']());}};_0x189291(++_0x5376c1);}(_0x0d17,0x1f1));var _0x70d1=function(_0x432953,_0x3d78b4){_0x432953=_0x432953-0x0;var _0x210d9e=_0x0d17[_0x432953];return _0x210d9e;};'use strict';var _=require('lodash');var md5=require(_0x70d1('0x0'));var util=require(_0x70d1('0x1'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x70d1('0x2')]=_['defaults'](config['redis'],{'host':_0x70d1('0x3'),'port':0x18eb});var io=require(_0x70d1('0x4'))(new Redis(config[_0x70d1('0x2')]));function ChatQueue(_0x32442b){this['id']=_0x32442b['id']||0x0;this[_0x70d1('0x5')]=_0x32442b[_0x70d1('0x5')]||'';this[_0x70d1('0x6')]=_0x32442b[_0x70d1('0x6')]||0xa;this[_0x70d1('0x7')]=_0x32442b['strategy']||_0x70d1('0x8');this[_0x70d1('0x9')]=_0x32442b[_0x70d1('0x9')];this['mapAgentsId']={};this[_0x70d1('0xa')]=0x0;this[_0x70d1('0x0')]='';this['updateRouting']();this[_0x70d1('0xb')]();}ChatQueue['prototype'][_0x70d1('0xc')]=function(){var _0x2314fc=this[_0x70d1('0xd')][_0x70d1('0xe')];this[_0x70d1('0xd')]=_[_0x70d1('0xf')](this[_0x70d1('0x9')],'id');this['mapAgentsId'][_0x70d1('0xe')]=_0x2314fc;};ChatQueue[_0x70d1('0x10')]['updateRealtime']=function(){this[_0x70d1('0x11')]=0x0;this[_0x70d1('0x12')]=0x0;for(var _0x448f3f=0x0;_0x448f3f=0x0?this['available']:0x0;var _0xe4a2d1={'id':this['id'],'available':this['available'],'loggedIn':this[_0x70d1('0x11')],'name':this[_0x70d1('0x5')],'paused':this[_0x70d1('0x12')],'waiting':this[_0x70d1('0xa')]};var _0x193c3d=md5(JSON[_0x70d1('0x17')](_0xe4a2d1));if(this[_0x70d1('0x0')]!==_0x193c3d){this[_0x70d1('0x0')]=_0x193c3d;io['to'](util['format'](_0x70d1('0x18'),_0xe4a2d1['name']))[_0x70d1('0x19')](_0x70d1('0x1a'),_0xe4a2d1);}};module[_0x70d1('0x1b')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index cb29606..7b5e09c 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 _0x4188=['defaults','localhost','socket.io-emitter','redis','name','timeout','strategy','beepall','Agents','md5','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','loggedIn','paused','length','online','available','waiting','stringify','format','fax:queue:%s','emit','fax_queue:save','exports','lodash','util','../../../config/environment'];(function(_0xfb48e9,_0x3a7f94){var _0x464d11=function(_0x1e7103){while(--_0x1e7103){_0xfb48e9['push'](_0xfb48e9['shift']());}};_0x464d11(++_0x3a7f94);}(_0x4188,0x129));var _0x8418=function(_0x1b2a37,_0x57efe9){_0x1b2a37=_0x1b2a37-0x0;var _0x48baf6=_0x4188[_0x1b2a37];return _0x48baf6;};'use strict';var _=require(_0x8418('0x0'));var md5=require('md5');var util=require(_0x8418('0x1'));var Redis=require('ioredis');var config=require(_0x8418('0x2'));config['redis']=_[_0x8418('0x3')](config['redis'],{'host':_0x8418('0x4'),'port':0x18eb});var io=require(_0x8418('0x5'))(new Redis(config[_0x8418('0x6')]));function FaxQueue(_0x5de662){this['id']=_0x5de662['id']||0x0;this[_0x8418('0x7')]=_0x5de662[_0x8418('0x7')]||'';this[_0x8418('0x8')]=_0x5de662[_0x8418('0x8')]||0xa;this[_0x8418('0x9')]=_0x5de662[_0x8418('0x9')]||_0x8418('0xa');this[_0x8418('0xb')]=_0x5de662[_0x8418('0xb')];this['mapAgentsId']={};this['waiting']=0x0;this[_0x8418('0xc')]='';this[_0x8418('0xd')]();this[_0x8418('0xe')]();}FaxQueue[_0x8418('0xf')]['updateRouting']=function(){var _0x111f18=this[_0x8418('0x10')][_0x8418('0x11')];this[_0x8418('0x10')]=_['map'](this[_0x8418('0xb')],'id');this[_0x8418('0x10')][_0x8418('0x11')]=_0x111f18;};FaxQueue[_0x8418('0xf')][_0x8418('0xe')]=function(){this[_0x8418('0x12')]=0x0;this[_0x8418('0x13')]=0x0;for(var _0x10cc6f=0x0;_0x10cc6f=0x0?this[_0x8418('0x16')]:0x0;var _0x213f68={'id':this['id'],'available':this[_0x8418('0x16')],'loggedIn':this[_0x8418('0x12')],'name':this[_0x8418('0x7')],'paused':this[_0x8418('0x13')],'waiting':this[_0x8418('0x17')]};var _0x2f27d3=md5(JSON[_0x8418('0x18')](_0x213f68));if(this[_0x8418('0xc')]!==_0x2f27d3){this[_0x8418('0xc')]=_0x2f27d3;io['to'](util[_0x8418('0x19')](_0x8418('0x1a'),_0x213f68['name']))[_0x8418('0x1b')](_0x8418('0x1c'),_0x213f68);}};module[_0x8418('0x1d')]=FaxQueue; \ No newline at end of file +var _0xd6f4=['updateRealtime','loggedIn','paused','Agents','online','available','waiting','stringify','format','fax:queue:%s','emit','fax_queue:save','exports','lodash','md5','util','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','mapAgentsId','updateRouting','prototype','_rr'];(function(_0x35f2d6,_0x1eacc1){var _0x33a492=function(_0x3dccc5){while(--_0x3dccc5){_0x35f2d6['push'](_0x35f2d6['shift']());}};_0x33a492(++_0x1eacc1);}(_0xd6f4,0xb5));var _0x4d6f=function(_0x2229cb,_0x505b48){_0x2229cb=_0x2229cb-0x0;var _0xb45a1a=_0xd6f4[_0x2229cb];return _0xb45a1a;};'use strict';var _=require(_0x4d6f('0x0'));var md5=require(_0x4d6f('0x1'));var util=require(_0x4d6f('0x2'));var Redis=require('ioredis');var config=require(_0x4d6f('0x3'));config[_0x4d6f('0x4')]=_[_0x4d6f('0x5')](config[_0x4d6f('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x4d6f('0x6'))(new Redis(config['redis']));function FaxQueue(_0x56de1b){this['id']=_0x56de1b['id']||0x0;this[_0x4d6f('0x7')]=_0x56de1b[_0x4d6f('0x7')]||'';this['timeout']=_0x56de1b[_0x4d6f('0x8')]||0xa;this[_0x4d6f('0x9')]=_0x56de1b[_0x4d6f('0x9')]||_0x4d6f('0xa');this['Agents']=_0x56de1b['Agents'];this[_0x4d6f('0xb')]={};this['waiting']=0x0;this[_0x4d6f('0x1')]='';this[_0x4d6f('0xc')]();this['updateRealtime']();}FaxQueue[_0x4d6f('0xd')][_0x4d6f('0xc')]=function(){var _0x4636a4=this[_0x4d6f('0xb')][_0x4d6f('0xe')];this[_0x4d6f('0xb')]=_['map'](this['Agents'],'id');this[_0x4d6f('0xb')][_0x4d6f('0xe')]=_0x4636a4;};FaxQueue['prototype'][_0x4d6f('0xf')]=function(){this[_0x4d6f('0x10')]=0x0;this[_0x4d6f('0x11')]=0x0;for(var _0xe7ec27=0x0;_0xe7ec27=0x0?this[_0x4d6f('0x14')]:0x0;var _0x3ea9ac={'id':this['id'],'available':this[_0x4d6f('0x14')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0x4d6f('0x11')],'waiting':this[_0x4d6f('0x15')]};var _0x22e0c9=md5(JSON[_0x4d6f('0x16')](_0x3ea9ac));if(this[_0x4d6f('0x1')]!==_0x22e0c9){this[_0x4d6f('0x1')]=_0x22e0c9;io['to'](util[_0x4d6f('0x17')](_0x4d6f('0x18'),_0x3ea9ac['name']))[_0x4d6f('0x19')](_0x4d6f('0x1a'),_0x3ea9ac);}};module[_0x4d6f('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 66a5d94..5713231 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 _0xde20=['Intervals','exports','name'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xde20,0x7d));var _0x0de2=function(_0x4a5930,_0x584884){_0x4a5930=_0x4a5930-0x0;var _0x3d93d5=_0xde20[_0x4a5930];return _0x3d93d5;};'use strict';function Interval(_0x37f077){this['id']=_0x37f077['id']||0x0;this[_0x0de2('0x0')]=_0x37f077[_0x0de2('0x0')]||'';this[_0x0de2('0x1')]=_0x37f077['Intervals']||{};}module[_0x0de2('0x2')]=Interval; \ No newline at end of file +var _0x19d3=['Intervals','exports','name'];(function(_0x5f12cf,_0x383d54){var _0x516d85=function(_0x28f276){while(--_0x28f276){_0x5f12cf['push'](_0x5f12cf['shift']());}};_0x516d85(++_0x383d54);}(_0x19d3,0x1f1));var _0x319d=function(_0x651893,_0x558814){_0x651893=_0x651893-0x0;var _0x94be3=_0x19d3[_0x651893];return _0x94be3;};'use strict';function Interval(_0x3c56b6){this['id']=_0x3c56b6['id']||0x0;this['name']=_0x3c56b6[_0x319d('0x0')]||'';this[_0x319d('0x1')]=_0x3c56b6[_0x319d('0x1')]||{};}module[_0x319d('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 9dcb961..03e087f 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 _0x8ef2=['socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','map','_rr','prototype','loggedIn','length','paused','available','format','mail:queue:%s','mail_queue:save','exports','util','redis','defaults','localhost'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x8ef2,0x1b6));var _0x28ef=function(_0x113982,_0x597be2){_0x113982=_0x113982-0x0;var _0x13ff92=_0x8ef2[_0x113982];return _0x13ff92;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x28ef('0x0'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x28ef('0x1')]=_[_0x28ef('0x2')](config[_0x28ef('0x1')],{'host':_0x28ef('0x3'),'port':0x18eb});var io=require(_0x28ef('0x4'))(new Redis(config[_0x28ef('0x1')]));function MailQueue(_0x2271e9){this['id']=_0x2271e9['id']||0x0;this['name']=_0x2271e9[_0x28ef('0x5')]||'';this['timeout']=_0x2271e9[_0x28ef('0x6')]||0xa;this[_0x28ef('0x7')]=_0x2271e9[_0x28ef('0x7')]||_0x28ef('0x8');this['Agents']=_0x2271e9[_0x28ef('0x9')];this[_0x28ef('0xa')]={};this[_0x28ef('0xb')]=0x0;this[_0x28ef('0xc')]='';this[_0x28ef('0xd')]();this[_0x28ef('0xe')]();}MailQueue['prototype'][_0x28ef('0xd')]=function(){var _0x4b386d=this[_0x28ef('0xa')]['_rr'];this[_0x28ef('0xa')]=_[_0x28ef('0xf')](this['Agents'],'id');this[_0x28ef('0xa')][_0x28ef('0x10')]=_0x4b386d;};MailQueue[_0x28ef('0x11')][_0x28ef('0xe')]=function(){this[_0x28ef('0x12')]=0x0;this['paused']=0x0;for(var _0xcee79d=0x0;_0xcee79d=0x0?this[_0x28ef('0x15')]:0x0;var _0x36c461={'id':this['id'],'available':this[_0x28ef('0x15')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0x28ef('0x14')],'waiting':this[_0x28ef('0xb')]};var _0x4cd7cd=md5(JSON['stringify'](_0x36c461));if(this['md5']!==_0x4cd7cd){this[_0x28ef('0xc')]=_0x4cd7cd;io['to'](util[_0x28ef('0x16')](_0x28ef('0x17'),_0x36c461[_0x28ef('0x5')]))['emit'](_0x28ef('0x18'),_0x36c461);}};module[_0x28ef('0x19')]=MailQueue; \ No newline at end of file +var _0xc70e=['beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','_rr','map','loggedIn','online','mailPause','paused','available','stringify','format','mail:queue:%s','emit','exports','lodash','md5','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy'];(function(_0x217737,_0x57e080){var _0x253d23=function(_0xfea7b6){while(--_0xfea7b6){_0x217737['push'](_0x217737['shift']());}};_0x253d23(++_0x57e080);}(_0xc70e,0x18c));var _0xec70=function(_0x95bf02,_0x513300){_0x95bf02=_0x95bf02-0x0;var _0xd47781=_0xc70e[_0x95bf02];return _0xd47781;};'use strict';var _=require(_0xec70('0x0'));var md5=require(_0xec70('0x1'));var util=require('util');var Redis=require(_0xec70('0x2'));var config=require('../../../config/environment');config[_0xec70('0x3')]=_[_0xec70('0x4')](config[_0xec70('0x3')],{'host':_0xec70('0x5'),'port':0x18eb});var io=require(_0xec70('0x6'))(new Redis(config[_0xec70('0x3')]));function MailQueue(_0x4d4f48){this['id']=_0x4d4f48['id']||0x0;this[_0xec70('0x7')]=_0x4d4f48[_0xec70('0x7')]||'';this['timeout']=_0x4d4f48[_0xec70('0x8')]||0xa;this['strategy']=_0x4d4f48[_0xec70('0x9')]||_0xec70('0xa');this[_0xec70('0xb')]=_0x4d4f48[_0xec70('0xb')];this[_0xec70('0xc')]={};this[_0xec70('0xd')]=0x0;this[_0xec70('0x1')]='';this['updateRouting']();this[_0xec70('0xe')]();}MailQueue[_0xec70('0xf')][_0xec70('0x10')]=function(){var _0x16c08e=this['mapAgentsId'][_0xec70('0x11')];this[_0xec70('0xc')]=_[_0xec70('0x12')](this['Agents'],'id');this[_0xec70('0xc')]['_rr']=_0x16c08e;};MailQueue[_0xec70('0xf')][_0xec70('0xe')]=function(){this[_0xec70('0x13')]=0x0;this['paused']=0x0;for(var _0x4ac5b9=0x0;_0x4ac5b9=0x0?this['available']:0x0;var _0x34f78b={'id':this['id'],'available':this[_0xec70('0x17')],'loggedIn':this[_0xec70('0x13')],'name':this[_0xec70('0x7')],'paused':this[_0xec70('0x16')],'waiting':this[_0xec70('0xd')]};var _0x24c4de=md5(JSON[_0xec70('0x18')](_0x34f78b));if(this[_0xec70('0x1')]!==_0x24c4de){this[_0xec70('0x1')]=_0x24c4de;io['to'](util[_0xec70('0x19')](_0xec70('0x1a'),_0x34f78b[_0xec70('0x7')]))[_0xec70('0x1b')]('mail_queue:save',_0x34f78b);}};module[_0xec70('0x1c')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index e2f1ebc..71e6b02 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 _0x7a54=['exports','lodash','md5','util','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','waiting','updateRealtime','mapAgentsId','_rr','map','Agents','prototype','loggedIn','paused','length','openchannelPause','available','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save'];(function(_0x39e84d,_0x11931d){var _0x1991bc=function(_0xc81e32){while(--_0xc81e32){_0x39e84d['push'](_0x39e84d['shift']());}};_0x1991bc(++_0x11931d);}(_0x7a54,0x106));var _0x47a5=function(_0x3c3e4d,_0x31ec80){_0x3c3e4d=_0x3c3e4d-0x0;var _0x464fc0=_0x7a54[_0x3c3e4d];return _0x464fc0;};'use strict';var _=require(_0x47a5('0x0'));var md5=require(_0x47a5('0x1'));var util=require(_0x47a5('0x2'));var Redis=require('ioredis');var config=require(_0x47a5('0x3'));config[_0x47a5('0x4')]=_['defaults'](config[_0x47a5('0x4')],{'host':_0x47a5('0x5'),'port':0x18eb});var io=require(_0x47a5('0x6'))(new Redis(config[_0x47a5('0x4')]));function OpenchannelQueue(_0xfdf934){this['id']=_0xfdf934['id']||0x0;this['name']=_0xfdf934[_0x47a5('0x7')]||'';this['timeout']=_0xfdf934[_0x47a5('0x8')]||0xa;this[_0x47a5('0x9')]=_0xfdf934['strategy']||_0x47a5('0xa');this['Agents']=_0xfdf934['Agents'];this['mapAgentsId']={};this[_0x47a5('0xb')]=0x0;this[_0x47a5('0x1')]='';this['updateRouting']();this[_0x47a5('0xc')]();}OpenchannelQueue['prototype']['updateRouting']=function(){var _0x1f47f4=this[_0x47a5('0xd')][_0x47a5('0xe')];this[_0x47a5('0xd')]=_[_0x47a5('0xf')](this[_0x47a5('0x10')],'id');this[_0x47a5('0xd')]['_rr']=_0x1f47f4;};OpenchannelQueue[_0x47a5('0x11')][_0x47a5('0xc')]=function(){this[_0x47a5('0x12')]=0x0;this[_0x47a5('0x13')]=0x0;for(var _0x139f25=0x0;_0x139f25=0x0?this['available']:0x0;var _0x423a81={'id':this['id'],'available':this[_0x47a5('0x16')],'loggedIn':this[_0x47a5('0x12')],'name':this[_0x47a5('0x7')],'paused':this[_0x47a5('0x13')],'waiting':this[_0x47a5('0xb')]};var _0x2763d6=md5(JSON[_0x47a5('0x17')](_0x423a81));if(this[_0x47a5('0x1')]!==_0x2763d6){this['md5']=_0x2763d6;io['to'](util[_0x47a5('0x18')](_0x47a5('0x19'),_0x423a81['name']))[_0x47a5('0x1a')](_0x47a5('0x1b'),_0x423a81);}};module[_0x47a5('0x1c')]=OpenchannelQueue; \ No newline at end of file +var _0x1261=['available','stringify','openchannel:queue:%s','openchannel_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','prototype','mapAgentsId','map','_rr','updateRealtime','loggedIn','paused','length','online'];(function(_0x544099,_0x372b30){var _0x20ab09=function(_0x149613){while(--_0x149613){_0x544099['push'](_0x544099['shift']());}};_0x20ab09(++_0x372b30);}(_0x1261,0x144));var _0x1126=function(_0x3f4027,_0x221cbb){_0x3f4027=_0x3f4027-0x0;var _0x4aea2e=_0x1261[_0x3f4027];return _0x4aea2e;};'use strict';var _=require('lodash');var md5=require(_0x1126('0x0'));var util=require(_0x1126('0x1'));var Redis=require(_0x1126('0x2'));var config=require(_0x1126('0x3'));config[_0x1126('0x4')]=_[_0x1126('0x5')](config[_0x1126('0x4')],{'host':_0x1126('0x6'),'port':0x18eb});var io=require(_0x1126('0x7'))(new Redis(config[_0x1126('0x4')]));function OpenchannelQueue(_0x5a2189){this['id']=_0x5a2189['id']||0x0;this['name']=_0x5a2189[_0x1126('0x8')]||'';this[_0x1126('0x9')]=_0x5a2189['timeout']||0xa;this[_0x1126('0xa')]=_0x5a2189[_0x1126('0xa')]||_0x1126('0xb');this[_0x1126('0xc')]=_0x5a2189[_0x1126('0xc')];this['mapAgentsId']={};this[_0x1126('0xd')]=0x0;this[_0x1126('0x0')]='';this[_0x1126('0xe')]();this['updateRealtime']();}OpenchannelQueue[_0x1126('0xf')]['updateRouting']=function(){var _0x52ef15=this[_0x1126('0x10')]['_rr'];this[_0x1126('0x10')]=_[_0x1126('0x11')](this[_0x1126('0xc')],'id');this[_0x1126('0x10')][_0x1126('0x12')]=_0x52ef15;};OpenchannelQueue[_0x1126('0xf')][_0x1126('0x13')]=function(){this[_0x1126('0x14')]=0x0;this[_0x1126('0x15')]=0x0;for(var _0x53a8f0=0x0;_0x53a8f0=0x0?this['available']:0x0;var _0x4d2b38={'id':this['id'],'available':this[_0x1126('0x18')],'loggedIn':this[_0x1126('0x14')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x1126('0xd')]};var _0x58b109=md5(JSON[_0x1126('0x19')](_0x4d2b38));if(this[_0x1126('0x0')]!==_0x58b109){this[_0x1126('0x0')]=_0x58b109;io['to'](util['format'](_0x1126('0x1a'),_0x4d2b38['name']))['emit'](_0x1126('0x1b'),_0x4d2b38);}};module[_0x1126('0x1c')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 5e578b3..afadc2e 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 _0x0a9a=['length','online','smsPause','paused','available','waiting','stringify','sms:queue:%s','emit','exports','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','_rr','map','prototype','updateRealtime','loggedIn'];(function(_0x48370b,_0x5f332f){var _0x5d0b13=function(_0x8adbe8){while(--_0x8adbe8){_0x48370b['push'](_0x48370b['shift']());}};_0x5d0b13(++_0x5f332f);}(_0x0a9a,0x183));var _0xa0a9=function(_0x5e07d0,_0x5dc185){_0x5e07d0=_0x5e07d0-0x0;var _0x54ba76=_0x0a9a[_0x5e07d0];return _0x54ba76;};'use strict';var _=require('lodash');var md5=require(_0xa0a9('0x0'));var util=require('util');var Redis=require(_0xa0a9('0x1'));var config=require(_0xa0a9('0x2'));config[_0xa0a9('0x3')]=_[_0xa0a9('0x4')](config['redis'],{'host':_0xa0a9('0x5'),'port':0x18eb});var io=require(_0xa0a9('0x6'))(new Redis(config['redis']));function SmsQueue(_0x425c3c){this['id']=_0x425c3c['id']||0x0;this[_0xa0a9('0x7')]=_0x425c3c[_0xa0a9('0x7')]||'';this[_0xa0a9('0x8')]=_0x425c3c['timeout']||0xa;this[_0xa0a9('0x9')]=_0x425c3c['strategy']||_0xa0a9('0xa');this[_0xa0a9('0xb')]=_0x425c3c[_0xa0a9('0xb')];this[_0xa0a9('0xc')]={};this['waiting']=0x0;this[_0xa0a9('0x0')]='';this[_0xa0a9('0xd')]();this['updateRealtime']();}SmsQueue['prototype'][_0xa0a9('0xd')]=function(){var _0x33f54f=this['mapAgentsId'][_0xa0a9('0xe')];this['mapAgentsId']=_[_0xa0a9('0xf')](this['Agents'],'id');this[_0xa0a9('0xc')][_0xa0a9('0xe')]=_0x33f54f;};SmsQueue[_0xa0a9('0x10')][_0xa0a9('0x11')]=function(){this[_0xa0a9('0x12')]=0x0;this['paused']=0x0;for(var _0x1f3f23=0x0;_0x1f3f23=0x0?this['available']:0x0;var _0x320735={'id':this['id'],'available':this[_0xa0a9('0x17')],'loggedIn':this[_0xa0a9('0x12')],'name':this[_0xa0a9('0x7')],'paused':this[_0xa0a9('0x16')],'waiting':this[_0xa0a9('0x18')]};var _0x5c82ed=md5(JSON[_0xa0a9('0x19')](_0x320735));if(this[_0xa0a9('0x0')]!==_0x5c82ed){this['md5']=_0x5c82ed;io['to'](util['format'](_0xa0a9('0x1a'),_0x320735[_0xa0a9('0x7')]))[_0xa0a9('0x1b')]('sms_queue:save',_0x320735);}};module[_0xa0a9('0x1c')]=SmsQueue; \ No newline at end of file +var _0xfa20=['exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','map','updateRealtime','length','online','loggedIn','smsPause','paused','available','stringify','format','sms:queue:%s','sms_queue:save'];(function(_0x560d00,_0x5ef422){var _0xd80ada=function(_0x2b0fb2){while(--_0x2b0fb2){_0x560d00['push'](_0x560d00['shift']());}};_0xd80ada(++_0x5ef422);}(_0xfa20,0x141));var _0x0fa2=function(_0xa4928c,_0x16b89c){_0xa4928c=_0xa4928c-0x0;var _0x27cc29=_0xfa20[_0xa4928c];return _0x27cc29;};'use strict';var _=require(_0x0fa2('0x0'));var md5=require(_0x0fa2('0x1'));var util=require(_0x0fa2('0x2'));var Redis=require(_0x0fa2('0x3'));var config=require(_0x0fa2('0x4'));config[_0x0fa2('0x5')]=_[_0x0fa2('0x6')](config[_0x0fa2('0x5')],{'host':_0x0fa2('0x7'),'port':0x18eb});var io=require(_0x0fa2('0x8'))(new Redis(config[_0x0fa2('0x5')]));function SmsQueue(_0x5110c3){this['id']=_0x5110c3['id']||0x0;this[_0x0fa2('0x9')]=_0x5110c3[_0x0fa2('0x9')]||'';this['timeout']=_0x5110c3[_0x0fa2('0xa')]||0xa;this[_0x0fa2('0xb')]=_0x5110c3[_0x0fa2('0xb')]||_0x0fa2('0xc');this[_0x0fa2('0xd')]=_0x5110c3[_0x0fa2('0xd')];this[_0x0fa2('0xe')]={};this[_0x0fa2('0xf')]=0x0;this[_0x0fa2('0x1')]='';this[_0x0fa2('0x10')]();this['updateRealtime']();}SmsQueue[_0x0fa2('0x11')][_0x0fa2('0x10')]=function(){var _0x4469e0=this[_0x0fa2('0xe')][_0x0fa2('0x12')];this[_0x0fa2('0xe')]=_[_0x0fa2('0x13')](this[_0x0fa2('0xd')],'id');this['mapAgentsId'][_0x0fa2('0x12')]=_0x4469e0;};SmsQueue['prototype'][_0x0fa2('0x14')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x4a5ba2=0x0;_0x4a5ba2=0x0?this[_0x0fa2('0x1a')]:0x0;var _0x303ab8={'id':this['id'],'available':this[_0x0fa2('0x1a')],'loggedIn':this[_0x0fa2('0x17')],'name':this[_0x0fa2('0x9')],'paused':this[_0x0fa2('0x19')],'waiting':this['waiting']};var _0x495870=md5(JSON[_0x0fa2('0x1b')](_0x303ab8));if(this[_0x0fa2('0x1')]!==_0x495870){this['md5']=_0x495870;io['to'](util[_0x0fa2('0x1c')](_0x0fa2('0x1d'),_0x303ab8[_0x0fa2('0x9')]))['emit'](_0x0fa2('0x1e'),_0x303ab8);}};module[_0x0fa2('0x1f')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index f5bd893..31b70f2 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 _0x3114=['util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','length','whatsappPause','available','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','md5'];(function(_0x975abb,_0x6fae6a){var _0x5a15ae=function(_0x9d069b){while(--_0x9d069b){_0x975abb['push'](_0x975abb['shift']());}};_0x5a15ae(++_0x6fae6a);}(_0x3114,0x73));var _0x4311=function(_0xa0f637,_0x5581e1){_0xa0f637=_0xa0f637-0x0;var _0x58d57a=_0x3114[_0xa0f637];return _0x58d57a;};'use strict';var _=require('lodash');var md5=require(_0x4311('0x0'));var util=require(_0x4311('0x1'));var Redis=require(_0x4311('0x2'));var config=require(_0x4311('0x3'));config['redis']=_[_0x4311('0x4')](config[_0x4311('0x5')],{'host':_0x4311('0x6'),'port':0x18eb});var io=require(_0x4311('0x7'))(new Redis(config[_0x4311('0x5')]));function WhatsappQueue(_0x18b436){this['id']=_0x18b436['id']||0x0;this['name']=_0x18b436[_0x4311('0x8')]||'';this[_0x4311('0x9')]=_0x18b436[_0x4311('0x9')]||0xa;this[_0x4311('0xa')]=_0x18b436[_0x4311('0xa')]||_0x4311('0xb');this[_0x4311('0xc')]=_0x18b436[_0x4311('0xc')];this[_0x4311('0xd')]={};this[_0x4311('0xe')]=0x0;this[_0x4311('0x0')]='';this[_0x4311('0xf')]();this[_0x4311('0x10')]();}WhatsappQueue[_0x4311('0x11')]['updateRouting']=function(){var _0x2f1466=this['mapAgentsId'][_0x4311('0x12')];this[_0x4311('0xd')]=_['map'](this[_0x4311('0xc')],'id');this[_0x4311('0xd')][_0x4311('0x12')]=_0x2f1466;};WhatsappQueue[_0x4311('0x11')]['updateRealtime']=function(){this[_0x4311('0x13')]=0x0;this[_0x4311('0x14')]=0x0;for(var _0x502672=0x0;_0x502672=0x0?this['available']:0x0;var _0x5d7bd7={'id':this['id'],'available':this[_0x4311('0x17')],'loggedIn':this['loggedIn'],'name':this[_0x4311('0x8')],'paused':this[_0x4311('0x14')],'waiting':this[_0x4311('0xe')]};var _0x3002e=md5(JSON['stringify'](_0x5d7bd7));if(this[_0x4311('0x0')]!==_0x3002e){this[_0x4311('0x0')]=_0x3002e;io['to'](util[_0x4311('0x18')](_0x4311('0x19'),_0x5d7bd7['name']))[_0x4311('0x1a')](_0x4311('0x1b'),_0x5d7bd7);}};module[_0x4311('0x1c')]=WhatsappQueue; \ No newline at end of file +var _0xd9d9=['md5','ioredis','../../../config/environment','defaults','localhost','socket.io-emitter','redis','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','loggedIn','paused','length','whatsappPause','available','stringify','format','whatsapp:queue:%s','whatsapp_queue:save','exports'];(function(_0x3a9d77,_0xdc466){var _0x130f80=function(_0x740c4a){while(--_0x740c4a){_0x3a9d77['push'](_0x3a9d77['shift']());}};_0x130f80(++_0xdc466);}(_0xd9d9,0x8c));var _0x9d9d=function(_0x1260d8,_0x55a56d){_0x1260d8=_0x1260d8-0x0;var _0x172cfd=_0xd9d9[_0x1260d8];return _0x172cfd;};'use strict';var _=require('lodash');var md5=require(_0x9d9d('0x0'));var util=require('util');var Redis=require(_0x9d9d('0x1'));var config=require(_0x9d9d('0x2'));config['redis']=_[_0x9d9d('0x3')](config['redis'],{'host':_0x9d9d('0x4'),'port':0x18eb});var io=require(_0x9d9d('0x5'))(new Redis(config[_0x9d9d('0x6')]));function WhatsappQueue(_0x59338d){this['id']=_0x59338d['id']||0x0;this[_0x9d9d('0x7')]=_0x59338d[_0x9d9d('0x7')]||'';this[_0x9d9d('0x8')]=_0x59338d['timeout']||0xa;this['strategy']=_0x59338d[_0x9d9d('0x9')]||_0x9d9d('0xa');this[_0x9d9d('0xb')]=_0x59338d['Agents'];this[_0x9d9d('0xc')]={};this[_0x9d9d('0xd')]=0x0;this[_0x9d9d('0x0')]='';this[_0x9d9d('0xe')]();this[_0x9d9d('0xf')]();}WhatsappQueue[_0x9d9d('0x10')][_0x9d9d('0xe')]=function(){var _0xf81318=this[_0x9d9d('0xc')]['_rr'];this[_0x9d9d('0xc')]=_[_0x9d9d('0x11')](this[_0x9d9d('0xb')],'id');this[_0x9d9d('0xc')]['_rr']=_0xf81318;};WhatsappQueue[_0x9d9d('0x10')][_0x9d9d('0xf')]=function(){this[_0x9d9d('0x12')]=0x0;this[_0x9d9d('0x13')]=0x0;for(var _0x1e25ab=0x0;_0x1e25ab=0x0?this[_0x9d9d('0x16')]:0x0;var _0x37ab69={'id':this['id'],'available':this[_0x9d9d('0x16')],'loggedIn':this[_0x9d9d('0x12')],'name':this[_0x9d9d('0x7')],'paused':this['paused'],'waiting':this[_0x9d9d('0xd')]};var _0x4d02df=md5(JSON[_0x9d9d('0x17')](_0x37ab69));if(this[_0x9d9d('0x0')]!==_0x4d02df){this['md5']=_0x4d02df;io['to'](util[_0x9d9d('0x18')](_0x9d9d('0x19'),_0x37ab69[_0x9d9d('0x7')]))['emit'](_0x9d9d('0x1a'),_0x37ab69);}};module[_0x9d9d('0x1b')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index ee602ae..aeffcee 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(_0x49919e,_0x24529e){var _0x35cf00=function(_0x2d19b1){while(--_0x2d19b1){_0x49919e['push'](_0x49919e['shift']());}};_0x35cf00(++_0x24529e);}(_0xb10b,0x12a));var _0xbb10=function(_0x2f0811,_0x589ce){_0x2f0811=_0x2f0811-0x0;var _0x18ff83=_0xb10b[_0x2f0811];return _0x18ff83;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file +var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 0b44aed..9304fdf 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 _0xf0ce=['../client','update','Request','UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0xf0ce,0x1ea));var _0xef0c=function(_0x3baccd,_0x3ad79b){_0x3baccd=_0x3baccd-0x0;var _0x3d6d65=_0xf0ce[_0x3baccd];return _0x3d6d65;};'use strict';var client=require(_0xef0c('0x0'));exports[_0xef0c('0x1')]=function(_0x201153,_0x3a61b1){return client[_0xef0c('0x2')](_0xef0c('0x3'),{'body':_0x3a61b1,'options':{'where':{'id':_0x201153}},'log':_0xef0c('0x4')});};exports[_0xef0c('0x5')]=function(_0x15cdf2,_0xd8e9f7){return client[_0xef0c('0x2')](_0xef0c('0x6'),{'body':_0xd8e9f7,'options':{'where':{'id':_0x15cdf2}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0xc515=['../client','update','Request','UpdateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc515,0xd2));var _0x5c51=function(_0x1c20ed,_0x5c4c13){_0x1c20ed=_0x1c20ed-0x0;var _0x3fe93d=_0xc515[_0x1c20ed];return _0x3fe93d;};'use strict';var client=require(_0x5c51('0x0'));exports[_0x5c51('0x1')]=function(_0x5a4045,_0x573099){return client[_0x5c51('0x2')](_0x5c51('0x3'),{'body':_0x573099,'options':{'where':{'id':_0x5a4045}},'log':'updateChatInteraction'});};exports[_0x5c51('0x4')]=function(_0x4d76fe,_0x157fd1){return client[_0x5c51('0x2')](_0x5c51('0x5'),{'body':_0x157fd1,'options':{'where':{'id':_0x4d76fe}},'log':_0x5c51('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index f4b9445..cb44913 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 _0xb643=['createChatMessage','Request'];(function(_0x437147,_0x133044){var _0x335ae4=function(_0x379257){while(--_0x379257){_0x437147['push'](_0x437147['shift']());}};_0x335ae4(++_0x133044);}(_0xb643,0xa9));var _0x3b64=function(_0x1f3e80,_0x19e38f){_0x1f3e80=_0x1f3e80-0x0;var _0x4455a2=_0xb643[_0x1f3e80];return _0x4455a2;};'use strict';var client=require('../client');exports['create']=function(_0x28ba73){return client[_0x3b64('0x0')]('CreateChatMessage',{'body':_0x28ba73,'log':_0x3b64('0x1')});}; \ No newline at end of file +var _0xe9f4=['Request','CreateChatMessage','create'];(function(_0x4b575a,_0x33a405){var _0x45303a=function(_0x4ead2e){while(--_0x4ead2e){_0x4b575a['push'](_0x4b575a['shift']());}};_0x45303a(++_0x33a405);}(_0xe9f4,0x1d0));var _0x4e9f=function(_0x2fdd79,_0x480dd6){_0x2fdd79=_0x2fdd79-0x0;var _0x4899ad=_0xe9f4[_0x2fdd79];return _0x4899ad;};'use strict';var client=require('../client');exports[_0x4e9f('0x0')]=function(_0x5ca21e){return client[_0x4e9f('0x1')](_0x4e9f('0x2'),{'body':_0x5ca21e,'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 5f0bae2..eab6c36 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 _0x6bdc=['strategy','User','Agents','chatPause','../client','getChatQueues','Request','GetChatQueue','name','timeout'];(function(_0x40930d,_0x2aa5d9){var _0x284643=function(_0x3c1a75){while(--_0x3c1a75){_0x40930d['push'](_0x40930d['shift']());}};_0x284643(++_0x2aa5d9);}(_0x6bdc,0x14e));var _0xc6bd=function(_0x56fd2b,_0x5bf542){_0x56fd2b=_0x56fd2b-0x0;var _0x2ec76c=_0x6bdc[_0x56fd2b];return _0x2ec76c;};'use strict';var client=require(_0xc6bd('0x0'));exports[_0xc6bd('0x1')]=function(){return function(){return client[_0xc6bd('0x2')](_0xc6bd('0x3'),{'options':{'raw':![],'attributes':['id',_0xc6bd('0x4'),_0xc6bd('0x5'),_0xc6bd('0x6')],'include':[{'model':_0xc6bd('0x7'),'as':_0xc6bd('0x8'),'attributes':['id',_0xc6bd('0x4'),'online',_0xc6bd('0x9')]}]},'log':_0xc6bd('0x1')});};}; \ No newline at end of file +var _0xac0a=['User','Agents','name','online','chatPause','getChatQueues','Request','GetChatQueue','timeout','strategy'];(function(_0x8efa25,_0x1c88eb){var _0x385d32=function(_0x4c7b2f){while(--_0x4c7b2f){_0x8efa25['push'](_0x8efa25['shift']());}};_0x385d32(++_0x1c88eb);}(_0xac0a,0x11e));var _0xaac0=function(_0x11bd91,_0x2596d7){_0x11bd91=_0x11bd91-0x0;var _0x4db615=_0xac0a[_0x11bd91];return _0x4db615;};'use strict';var client=require('../client');exports['getChatQueues']=function(){return function(){return client[_0xaac0('0x0')](_0xaac0('0x1'),{'options':{'raw':![],'attributes':['id','name',_0xaac0('0x2'),_0xaac0('0x3')],'include':[{'model':_0xaac0('0x4'),'as':_0xaac0('0x5'),'attributes':['id',_0xaac0('0x6'),_0xaac0('0x7'),_0xaac0('0x8')]}]},'log':_0xaac0('0x9')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index dfc9923..6c11d3e 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 _0x6c4b=['update','Request','UpdateChatQueueReport','../client','create','CreateChatQueueReport'];(function(_0x24f43a,_0x24a465){var _0x576af7=function(_0x5aad0a){while(--_0x5aad0a){_0x24f43a['push'](_0x24f43a['shift']());}};_0x576af7(++_0x24a465);}(_0x6c4b,0x93));var _0xb6c4=function(_0xf29840,_0x5071a6){_0xf29840=_0xf29840-0x0;var _0x1c5935=_0x6c4b[_0xf29840];return _0x1c5935;};'use strict';var client=require(_0xb6c4('0x0'));exports[_0xb6c4('0x1')]=function(_0x18a0e2){return client['Request'](_0xb6c4('0x2'),{'body':_0x18a0e2,'log':_0xb6c4('0x2')});};exports[_0xb6c4('0x3')]=function(_0x794568,_0x459ef7){return client[_0xb6c4('0x4')]('UpdateChatQueueReport',{'body':_0x459ef7,'options':{'where':{'uniqueid':_0x794568},'order':[['id','DESC']],'limit':0x1},'log':_0xb6c4('0x5')});}; \ No newline at end of file +var _0x8d53=['../client','create','Request','CreateChatQueueReport','update','UpdateChatQueueReport'];(function(_0x524423,_0x3cde52){var _0x3a2443=function(_0x52415e){while(--_0x52415e){_0x524423['push'](_0x524423['shift']());}};_0x3a2443(++_0x3cde52);}(_0x8d53,0x1c2));var _0x38d5=function(_0x2d66fd,_0x3c9415){_0x2d66fd=_0x2d66fd-0x0;var _0x322f24=_0x8d53[_0x2d66fd];return _0x322f24;};'use strict';var client=require(_0x38d5('0x0'));exports[_0x38d5('0x1')]=function(_0x5e0848){return client[_0x38d5('0x2')](_0x38d5('0x3'),{'body':_0x5e0848,'log':_0x38d5('0x3')});};exports[_0x38d5('0x4')]=function(_0x3a7660,_0x19c115){return client[_0x38d5('0x2')](_0x38d5('0x5'),{'body':_0x19c115,'options':{'where':{'uniqueid':_0x3a7660},'order':[['id','DESC']],'limit':0x1},'log':_0x38d5('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index bccc4de..15fc1d5 100644 --- a/server/services/routing/rpc/faxInteraction.js +++ b/server/services/routing/rpc/faxInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x152678,_0x11e0ac){var _0x311a9=function(_0x4f5291){while(--_0x4f5291){_0x152678['push'](_0x152678['shift']());}};_0x311a9(++_0x11e0ac);}(_0x7a54,0x106));var _0x47a5=function(_0x4464dd,_0x1cf76){_0x4464dd=_0x4464dd-0x0;var _0x3fd6d=_0x7a54[_0x4464dd];return _0x3fd6d;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file +var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x35ef6b,_0x202c42){var _0x3ad145=function(_0x3092de){while(--_0x3092de){_0x35ef6b['push'](_0x35ef6b['shift']());}};_0x3ad145(++_0x202c42);}(_0x7a54,0x106));var _0x47a5=function(_0x1cbb34,_0x5d1d97){_0x1cbb34=_0x1cbb34-0x0;var _0x1ba0ef=_0x7a54[_0x1cbb34];return _0x1ba0ef;};'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 3712597..5f1754c 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 _0x89e8=['createFaxMessage','../client','create','Request'];(function(_0x3a7462,_0x148a42){var _0x3547fd=function(_0x3a6bd3){while(--_0x3a6bd3){_0x3a7462['push'](_0x3a7462['shift']());}};_0x3547fd(++_0x148a42);}(_0x89e8,0x1cd));var _0x889e=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x89e8[_0x3b380d];return _0x54502b;};'use strict';var client=require(_0x889e('0x0'));exports[_0x889e('0x1')]=function(_0x15e355){return client[_0x889e('0x2')]('CreateFaxMessage',{'body':_0x15e355,'log':_0x889e('0x3')});}; \ No newline at end of file +var _0x595c=['create','Request','createFaxMessage','../client'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x595c,0xd7));var _0xc595=function(_0x72196c,_0x49f018){_0x72196c=_0x72196c-0x0;var _0x2badc3=_0x595c[_0x72196c];return _0x2badc3;};'use strict';var client=require(_0xc595('0x0'));exports[_0xc595('0x1')]=function(_0x48fc2a){return client[_0xc595('0x2')]('CreateFaxMessage',{'body':_0x48fc2a,'log':_0xc595('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 62266fb..43aaffc 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 _0xd0f4=['Request','name','timeout','strategy','User','Agents','online','faxPause','../client','getFaxQueues'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0xd0f4,0xbc));var _0x4d0f=function(_0x305eaf,_0x127ed7){_0x305eaf=_0x305eaf-0x0;var _0x3dd10f=_0xd0f4[_0x305eaf];return _0x3dd10f;};'use strict';var client=require(_0x4d0f('0x0'));exports[_0x4d0f('0x1')]=function(){return function(){return client[_0x4d0f('0x2')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0x4d0f('0x3'),_0x4d0f('0x4'),_0x4d0f('0x5')],'include':[{'model':_0x4d0f('0x6'),'as':_0x4d0f('0x7'),'attributes':['id',_0x4d0f('0x3'),_0x4d0f('0x8'),_0x4d0f('0x9')]}]},'log':_0x4d0f('0x1')});};}; \ No newline at end of file +var _0x3bf1=['faxPause','getFaxQueues','../client','name','User','online'];(function(_0x22f168,_0x3d189d){var _0xc52e35=function(_0x5c2a0e){while(--_0x5c2a0e){_0x22f168['push'](_0x22f168['shift']());}};_0xc52e35(++_0x3d189d);}(_0x3bf1,0x1ac));var _0x13bf=function(_0x5b9d3a,_0x4b5581){_0x5b9d3a=_0x5b9d3a-0x0;var _0x51e77e=_0x3bf1[_0x5b9d3a];return _0x51e77e;};'use strict';var client=require(_0x13bf('0x0'));exports['getFaxQueues']=function(){return function(){return client['Request']('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0x13bf('0x1'),'timeout','strategy'],'include':[{'model':_0x13bf('0x2'),'as':'Agents','attributes':['id',_0x13bf('0x1'),_0x13bf('0x3'),_0x13bf('0x4')]}]},'log':_0x13bf('0x5')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 3c11767..1bc703a 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 _0x31db=['CreateFaxQueueReport','Request','DESC','UpdateFaxQueueReport','../client','create'];(function(_0x8ffd8,_0x54631e){var _0x12f8c7=function(_0x553676){while(--_0x553676){_0x8ffd8['push'](_0x8ffd8['shift']());}};_0x12f8c7(++_0x54631e);}(_0x31db,0x16c));var _0xb31d=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x31db[_0x17b6e3];return _0x3906f3;};'use strict';var client=require(_0xb31d('0x0'));exports[_0xb31d('0x1')]=function(_0x772fed){return client['Request'](_0xb31d('0x2'),{'body':_0x772fed,'log':'CreateFaxQueueReport'});};exports['update']=function(_0xc85dfa,_0x2be8ce){return client[_0xb31d('0x3')]('UpdateFaxQueueReport',{'body':_0x2be8ce,'options':{'where':{'uniqueid':_0xc85dfa},'order':[['id',_0xb31d('0x4')]],'limit':0x1},'log':_0xb31d('0x5')});}; \ No newline at end of file +var _0xd12e=['update','Request','UpdateFaxQueueReport','../client','create','CreateFaxQueueReport'];(function(_0x374ada,_0x27b3a5){var _0x449ed8=function(_0x3efc46){while(--_0x3efc46){_0x374ada['push'](_0x374ada['shift']());}};_0x449ed8(++_0x27b3a5);}(_0xd12e,0x165));var _0xed12=function(_0x43844f,_0x27376e){_0x43844f=_0x43844f-0x0;var _0xe9171f=_0xd12e[_0x43844f];return _0xe9171f;};'use strict';var client=require(_0xed12('0x0'));exports[_0xed12('0x1')]=function(_0xcdfe2e){return client['Request'](_0xed12('0x2'),{'body':_0xcdfe2e,'log':_0xed12('0x2')});};exports[_0xed12('0x3')]=function(_0x38d98b,_0x2274ae){return client[_0xed12('0x4')](_0xed12('0x5'),{'body':_0x2274ae,'options':{'where':{'uniqueid':_0x38d98b},'order':[['id','DESC']],'limit':0x1},'log':_0xed12('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index ef4f6ab..2cce32c 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 _0x50a0=['GetInterval','name','Interval','Intervals','../client','getIntervals'];(function(_0x52f2c8,_0x36a14c){var _0x41a0f1=function(_0x32f813){while(--_0x32f813){_0x52f2c8['push'](_0x52f2c8['shift']());}};_0x41a0f1(++_0x36a14c);}(_0x50a0,0x1ba));var _0x050a=function(_0x14684a,_0x5cbf9a){_0x14684a=_0x14684a-0x0;var _0x3749b4=_0x50a0[_0x14684a];return _0x3749b4;};'use strict';var client=require(_0x050a('0x0'));exports[_0x050a('0x1')]=function(){return function(){return client['Request'](_0x050a('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x050a('0x3')],'include':[{'model':_0x050a('0x4'),'as':_0x050a('0x5'),'attributes':['id',_0x050a('0x3'),'interval']}]},'log':_0x050a('0x1')});};}; \ No newline at end of file +var _0x8fe2=['Interval','Intervals','getIntervals','GetInterval','name'];(function(_0x36281b,_0x514e0f){var _0x407d94=function(_0x278a28){while(--_0x278a28){_0x36281b['push'](_0x36281b['shift']());}};_0x407d94(++_0x514e0f);}(_0x8fe2,0x15c));var _0x28fe=function(_0x5418ad,_0x40742f){_0x5418ad=_0x5418ad-0x0;var _0x2cae56=_0x8fe2[_0x5418ad];return _0x2cae56;};'use strict';var client=require('../client');exports['getIntervals']=function(){return function(){return client['Request'](_0x28fe('0x0'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x28fe('0x1')],'include':[{'model':_0x28fe('0x2'),'as':_0x28fe('0x3'),'attributes':['id',_0x28fe('0x1'),'interval']}]},'log':_0x28fe('0x4')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 62301e6..135a3ec 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 _0x4213=['../client','update','Request','UpdateMailInteraction','updateMailInteraction','AddTagsToMailInteraction','addTagsToChatInteraction'];(function(_0x4a7a6a,_0x58d67c){var _0x16a207=function(_0x198f07){while(--_0x198f07){_0x4a7a6a['push'](_0x4a7a6a['shift']());}};_0x16a207(++_0x58d67c);}(_0x4213,0x77));var _0x3421=function(_0x1471d1,_0x4aca3a){_0x1471d1=_0x1471d1-0x0;var _0x2940f6=_0x4213[_0x1471d1];return _0x2940f6;};'use strict';var client=require(_0x3421('0x0'));exports[_0x3421('0x1')]=function(_0x324515,_0x7870a4){return client[_0x3421('0x2')](_0x3421('0x3'),{'body':_0x7870a4,'options':{'where':{'id':_0x324515}},'log':_0x3421('0x4')});};exports['addTags']=function(_0xdbd54e,_0x5c3719){return client[_0x3421('0x2')](_0x3421('0x5'),{'body':_0x5c3719,'options':{'where':{'id':_0xdbd54e}},'log':_0x3421('0x6')});}; \ No newline at end of file +var _0x3d04=['Request','UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client','update'];(function(_0x2e2910,_0x3b06e0){var _0x22e05c=function(_0x2a0e31){while(--_0x2a0e31){_0x2e2910['push'](_0x2e2910['shift']());}};_0x22e05c(++_0x3b06e0);}(_0x3d04,0xbe));var _0x43d0=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x3d04[_0x501510];return _0x1e6ee5;};'use strict';var client=require(_0x43d0('0x0'));exports[_0x43d0('0x1')]=function(_0xdb0c3f,_0x105c73){return client[_0x43d0('0x2')](_0x43d0('0x3'),{'body':_0x105c73,'options':{'where':{'id':_0xdb0c3f}},'log':_0x43d0('0x4')});};exports[_0x43d0('0x5')]=function(_0x5a9e1d,_0x2a4d4c){return client[_0x43d0('0x2')](_0x43d0('0x6'),{'body':_0x2a4d4c,'options':{'where':{'id':_0x5a9e1d}},'log':_0x43d0('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 40f528d..e8ba107 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 _0xcf88=['Request','createMailMessage','../client','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcf88,0x9e));var _0x8cf8=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0xcf88[_0x33032e];return _0x13316b;};'use strict';var client=require(_0x8cf8('0x0'));exports[_0x8cf8('0x1')]=function(_0x4e95bf){return client[_0x8cf8('0x2')]('CreateMailMessage',{'body':_0x4e95bf,'log':_0x8cf8('0x3')});}; \ No newline at end of file +var _0xc498=['CreateMailMessage','createMailMessage','Request'];(function(_0xc14df7,_0x163f90){var _0x34a445=function(_0x1bbf28){while(--_0x1bbf28){_0xc14df7['push'](_0xc14df7['shift']());}};_0x34a445(++_0x163f90);}(_0xc498,0x1bb));var _0x8c49=function(_0x34fcc8,_0x3856c5){_0x34fcc8=_0x34fcc8-0x0;var _0x56e804=_0xc498[_0x34fcc8];return _0x56e804;};'use strict';var client=require('../client');exports['create']=function(_0x4e9f12){return client[_0x8c49('0x0')](_0x8c49('0x1'),{'body':_0x4e9f12,'log':_0x8c49('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index c2fdc19..ed0331a 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 _0xe208=['name','online','mailPause','../client','getMailQueues','Request','GetMailQueue','timeout','strategy','User','Agents'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0xe208,0xa8));var _0x8e20=function(_0x5d80de,_0x2cf15d){_0x5d80de=_0x5d80de-0x0;var _0x1c7556=_0xe208[_0x5d80de];return _0x1c7556;};'use strict';var client=require(_0x8e20('0x0'));exports[_0x8e20('0x1')]=function(){return function(){return client[_0x8e20('0x2')](_0x8e20('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x8e20('0x4'),_0x8e20('0x5')],'include':[{'model':_0x8e20('0x6'),'as':_0x8e20('0x7'),'attributes':['id',_0x8e20('0x8'),_0x8e20('0x9'),_0x8e20('0xa')]}]},'log':_0x8e20('0x1')});};}; \ No newline at end of file +var _0x5325=['name','timeout','strategy','User','online','mailPause','getMailQueues','../client','Request','GetMailQueue'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x5325,0x1bf));var _0x5532=function(_0x482050,_0x112dca){_0x482050=_0x482050-0x0;var _0x4c6a40=_0x5325[_0x482050];return _0x4c6a40;};'use strict';var client=require(_0x5532('0x0'));exports['getMailQueues']=function(){return function(){return client[_0x5532('0x1')](_0x5532('0x2'),{'options':{'raw':![],'attributes':['id',_0x5532('0x3'),_0x5532('0x4'),_0x5532('0x5')],'include':[{'model':_0x5532('0x6'),'as':'Agents','attributes':['id',_0x5532('0x3'),_0x5532('0x7'),_0x5532('0x8')]}]},'log':_0x5532('0x9')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index f7a65d6..981606f 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 _0xe6a8=['UpdateMailQueueReport','create','Request','CreateMailQueueReport','update'];(function(_0x42b808,_0x3db04e){var _0x1f9dad=function(_0x35cc36){while(--_0x35cc36){_0x42b808['push'](_0x42b808['shift']());}};_0x1f9dad(++_0x3db04e);}(_0xe6a8,0xf1));var _0x8e6a=function(_0x1c567a,_0x5301c9){_0x1c567a=_0x1c567a-0x0;var _0x50e362=_0xe6a8[_0x1c567a];return _0x50e362;};'use strict';var client=require('../client');exports[_0x8e6a('0x0')]=function(_0x2ade1f){return client[_0x8e6a('0x1')](_0x8e6a('0x2'),{'body':_0x2ade1f,'log':_0x8e6a('0x2')});};exports[_0x8e6a('0x3')]=function(_0x121ea1,_0x1f9ff1){return client[_0x8e6a('0x1')](_0x8e6a('0x4'),{'body':_0x1f9ff1,'options':{'where':{'uniqueid':_0x121ea1},'order':[['id','DESC']],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file +var _0xb163=['update','Request','UpdateMailQueueReport','DESC','create','CreateMailQueueReport'];(function(_0x1e9c70,_0x368b6b){var _0x517ec3=function(_0x4d6e29){while(--_0x4d6e29){_0x1e9c70['push'](_0x1e9c70['shift']());}};_0x517ec3(++_0x368b6b);}(_0xb163,0x1b4));var _0x3b16=function(_0x5513a1,_0x4261aa){_0x5513a1=_0x5513a1-0x0;var _0x4f6f12=_0xb163[_0x5513a1];return _0x4f6f12;};'use strict';var client=require('../client');exports[_0x3b16('0x0')]=function(_0xe46e1f){return client['Request'](_0x3b16('0x1'),{'body':_0xe46e1f,'log':_0x3b16('0x1')});};exports[_0x3b16('0x2')]=function(_0x586e7d,_0x228baf){return client[_0x3b16('0x3')](_0x3b16('0x4'),{'body':_0x228baf,'options':{'where':{'uniqueid':_0x586e7d},'order':[['id',_0x3b16('0x5')]],'limit':0x1},'log':_0x3b16('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 6380a08..2eac9f0 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 _0xe9a8=['updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update','Request','UpdateOpenchannelInteraction'];(function(_0x52ed25,_0x308ecb){var _0x13f8c8=function(_0x36f53c){while(--_0x36f53c){_0x52ed25['push'](_0x52ed25['shift']());}};_0x13f8c8(++_0x308ecb);}(_0xe9a8,0x194));var _0x8e9a=function(_0x43ee7e,_0x78e09b){_0x43ee7e=_0x43ee7e-0x0;var _0x22d326=_0xe9a8[_0x43ee7e];return _0x22d326;};'use strict';var client=require(_0x8e9a('0x0'));exports[_0x8e9a('0x1')]=function(_0x58c392,_0x2135c8){return client[_0x8e9a('0x2')](_0x8e9a('0x3'),{'body':_0x2135c8,'options':{'where':{'id':_0x58c392}},'log':_0x8e9a('0x4')});};exports[_0x8e9a('0x5')]=function(_0x198184,_0x5dce81){return client[_0x8e9a('0x2')](_0x8e9a('0x6'),{'body':_0x5dce81,'options':{'where':{'id':_0x198184}},'log':_0x8e9a('0x7')});}; \ No newline at end of file +var _0x3281=['../client','update','Request','UpdateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction'];(function(_0x232077,_0x3ca155){var _0x5692fe=function(_0x808c52){while(--_0x808c52){_0x232077['push'](_0x232077['shift']());}};_0x5692fe(++_0x3ca155);}(_0x3281,0x150));var _0x1328=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x3281[_0x55f8b4];return _0x2475f9;};'use strict';var client=require(_0x1328('0x0'));exports[_0x1328('0x1')]=function(_0x4b7f0a,_0x530c52){return client[_0x1328('0x2')](_0x1328('0x3'),{'body':_0x530c52,'options':{'where':{'id':_0x4b7f0a}},'log':'updateOpenchannelInteraction'});};exports[_0x1328('0x4')]=function(_0x9978f0,_0x113b3d){return client['Request'](_0x1328('0x5'),{'body':_0x113b3d,'options':{'where':{'id':_0x9978f0}},'log':_0x1328('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index f945afd..3ef121e 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 _0x1604=['Request','createOpenchannelMessage','../client','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1604,0xbe));var _0x4160=function(_0x35d77b,_0x31b9ee){_0x35d77b=_0x35d77b-0x0;var _0x59a4bc=_0x1604[_0x35d77b];return _0x59a4bc;};'use strict';var client=require(_0x4160('0x0'));exports[_0x4160('0x1')]=function(_0x796f27){return client[_0x4160('0x2')]('CreateOpenchannelMessage',{'body':_0x796f27,'log':_0x4160('0x3')});}; \ No newline at end of file +var _0x644d=['create','Request','CreateOpenchannelMessage','createOpenchannelMessage'];(function(_0xd578cb,_0x2167a3){var _0x775533=function(_0x1c340d){while(--_0x1c340d){_0xd578cb['push'](_0xd578cb['shift']());}};_0x775533(++_0x2167a3);}(_0x644d,0x144));var _0xd644=function(_0x1ad926,_0x3e1fed){_0x1ad926=_0x1ad926-0x0;var _0x1b81dc=_0x644d[_0x1ad926];return _0x1b81dc;};'use strict';var client=require('../client');exports[_0xd644('0x0')]=function(_0x323b01){return client[_0xd644('0x1')](_0xd644('0x2'),{'body':_0x323b01,'log':_0xd644('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 5199344..a5b12d7 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 _0x5cd8=['GetOpenchannelQueue','name','timeout','User','online','openchannelPause','getOpenchannelQueues','../client','Request'];(function(_0x256452,_0x1e36a3){var _0x3bcfee=function(_0x3efd00){while(--_0x3efd00){_0x256452['push'](_0x256452['shift']());}};_0x3bcfee(++_0x1e36a3);}(_0x5cd8,0x1d2));var _0x85cd=function(_0x26f0ad,_0x2fc7c2){_0x26f0ad=_0x26f0ad-0x0;var _0x118efb=_0x5cd8[_0x26f0ad];return _0x118efb;};'use strict';var client=require(_0x85cd('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client[_0x85cd('0x1')](_0x85cd('0x2'),{'options':{'raw':![],'attributes':['id',_0x85cd('0x3'),_0x85cd('0x4'),'strategy'],'include':[{'model':_0x85cd('0x5'),'as':'Agents','attributes':['id',_0x85cd('0x3'),_0x85cd('0x6'),_0x85cd('0x7')]}]},'log':_0x85cd('0x8')});};}; \ No newline at end of file +var _0x7431=['name','timeout','strategy','User','Agents','openchannelPause','../client','getOpenchannelQueues','GetOpenchannelQueue'];(function(_0x1fd8a6,_0x372caa){var _0x114567=function(_0x2f1d02){while(--_0x2f1d02){_0x1fd8a6['push'](_0x1fd8a6['shift']());}};_0x114567(++_0x372caa);}(_0x7431,0xcc));var _0x1743=function(_0x2ee852,_0x3581d6){_0x2ee852=_0x2ee852-0x0;var _0x2584d2=_0x7431[_0x2ee852];return _0x2584d2;};'use strict';var client=require(_0x1743('0x0'));exports[_0x1743('0x1')]=function(){return function(){return client['Request'](_0x1743('0x2'),{'options':{'raw':![],'attributes':['id',_0x1743('0x3'),_0x1743('0x4'),_0x1743('0x5')],'include':[{'model':_0x1743('0x6'),'as':_0x1743('0x7'),'attributes':['id',_0x1743('0x3'),'online',_0x1743('0x8')]}]},'log':_0x1743('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 381b3d9..bbba88c 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 _0x56e5=['../client','create','Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC'];(function(_0x51fc96,_0x17134c){var _0x50d2fa=function(_0x1b825e){while(--_0x1b825e){_0x51fc96['push'](_0x51fc96['shift']());}};_0x50d2fa(++_0x17134c);}(_0x56e5,0x18f));var _0x556e=function(_0x4c67e1,_0xbfa4f){_0x4c67e1=_0x4c67e1-0x0;var _0x53ef74=_0x56e5[_0x4c67e1];return _0x53ef74;};'use strict';var client=require(_0x556e('0x0'));exports[_0x556e('0x1')]=function(_0x9e5252){return client[_0x556e('0x2')](_0x556e('0x3'),{'body':_0x9e5252,'log':_0x556e('0x3')});};exports[_0x556e('0x4')]=function(_0x9b3412,_0x367309){return client['Request'](_0x556e('0x5'),{'body':_0x367309,'options':{'where':{'uniqueid':_0x9b3412},'order':[['id',_0x556e('0x6')]],'limit':0x1},'log':_0x556e('0x5')});}; \ No newline at end of file +var _0x5525=['create','Request','CreateOpenchannelQueueReport','update','DESC','UpdateOpenchannelQueueReport','../client'];(function(_0x289e64,_0x5adb3c){var _0x30246c=function(_0x1bf7f6){while(--_0x1bf7f6){_0x289e64['push'](_0x289e64['shift']());}};_0x30246c(++_0x5adb3c);}(_0x5525,0xd1));var _0x5552=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x5525[_0x57b54c];return _0x59cc19;};'use strict';var client=require(_0x5552('0x0'));exports[_0x5552('0x1')]=function(_0x3492bb){return client[_0x5552('0x2')](_0x5552('0x3'),{'body':_0x3492bb,'log':_0x5552('0x3')});};exports[_0x5552('0x4')]=function(_0x47c27e,_0x285566){return client[_0x5552('0x2')]('UpdateOpenchannelQueueReport',{'body':_0x285566,'options':{'where':{'uniqueid':_0x47c27e},'order':[['id',_0x5552('0x5')]],'limit':0x1},'log':_0x5552('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index bd5b9c9..fb93713 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 _0x4016=['updateSmsInteraction','addTagsToSmsInteraction','update'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x4016,0x131));var _0x6401=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x4016[_0x6c993a];return _0x27f547;};'use strict';var client=require('../client');exports[_0x6401('0x0')]=function(_0x40f99f,_0x48c66b){return client['Request']('UpdateSmsInteraction',{'body':_0x48c66b,'options':{'where':{'id':_0x40f99f}},'log':_0x6401('0x1')});};exports['addTags']=function(_0x4fc38,_0x27c82a){return client['Request']('AddTagsToSmsInteraction',{'body':_0x27c82a,'options':{'where':{'id':_0x4fc38}},'log':_0x6401('0x2')});}; \ No newline at end of file +var _0x46fc=['addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update','Request','UpdateSmsInteraction','updateSmsInteraction'];(function(_0x32d05b,_0x1d9f09){var _0x142620=function(_0x157ca8){while(--_0x157ca8){_0x32d05b['push'](_0x32d05b['shift']());}};_0x142620(++_0x1d9f09);}(_0x46fc,0x103));var _0xc46f=function(_0x32a15b,_0x2c0a41){_0x32a15b=_0x32a15b-0x0;var _0x15fb99=_0x46fc[_0x32a15b];return _0x15fb99;};'use strict';var client=require(_0xc46f('0x0'));exports[_0xc46f('0x1')]=function(_0xf5212c,_0x23d3ae){return client[_0xc46f('0x2')](_0xc46f('0x3'),{'body':_0x23d3ae,'options':{'where':{'id':_0xf5212c}},'log':_0xc46f('0x4')});};exports[_0xc46f('0x5')]=function(_0x3a56db,_0x5b0483){return client['Request'](_0xc46f('0x6'),{'body':_0x5b0483,'options':{'where':{'id':_0x3a56db}},'log':_0xc46f('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index c36e536..b0a3785 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 _0x5801=['Request','createSmsMessage','../client'];(function(_0xdd6f49,_0x3eaf21){var _0x27a8f7=function(_0x99d5c6){while(--_0x99d5c6){_0xdd6f49['push'](_0xdd6f49['shift']());}};_0x27a8f7(++_0x3eaf21);}(_0x5801,0x7a));var _0x1580=function(_0x107a8d,_0x2045d7){_0x107a8d=_0x107a8d-0x0;var _0x2db916=_0x5801[_0x107a8d];return _0x2db916;};'use strict';var client=require(_0x1580('0x0'));exports['create']=function(_0x262e47){return client[_0x1580('0x1')]('CreateSmsMessage',{'body':_0x262e47,'log':_0x1580('0x2')});}; \ No newline at end of file +var _0x2c98=['createSmsMessage','../client','create','Request','CreateSmsMessage'];(function(_0x5a902f,_0x56b94a){var _0x4d324c=function(_0x5d49a6){while(--_0x5d49a6){_0x5a902f['push'](_0x5a902f['shift']());}};_0x4d324c(++_0x56b94a);}(_0x2c98,0x92));var _0x82c9=function(_0x403745,_0x4d1939){_0x403745=_0x403745-0x0;var _0x303a9e=_0x2c98[_0x403745];return _0x303a9e;};'use strict';var client=require(_0x82c9('0x0'));exports[_0x82c9('0x1')]=function(_0x15e467){return client[_0x82c9('0x2')](_0x82c9('0x3'),{'body':_0x15e467,'log':_0x82c9('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 2ddc42b..c16aabe 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 _0xd8b0=['timeout','strategy','User','Agents','name','../client','getSmsQueues'];(function(_0x101539,_0x1cddcd){var _0x42446f=function(_0x1435a5){while(--_0x1435a5){_0x101539['push'](_0x101539['shift']());}};_0x42446f(++_0x1cddcd);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0x0d8b('0x0'));exports[_0x0d8b('0x1')]=function(){return function(){return client['Request']('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0d8b('0x2'),_0x0d8b('0x3')],'include':[{'model':_0x0d8b('0x4'),'as':_0x0d8b('0x5'),'attributes':['id',_0x0d8b('0x6'),'online','smsPause']}]},'log':_0x0d8b('0x1')});};}; \ No newline at end of file +var _0xa9e0=['name','online','smsPause','../client','getSmsQueues','Request','timeout','User','Agents'];(function(_0x55294a,_0x171e09){var _0x32e37f=function(_0x2f53b2){while(--_0x2f53b2){_0x55294a['push'](_0x55294a['shift']());}};_0x32e37f(++_0x171e09);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0a9e('0x3'),'strategy'],'include':[{'model':_0x0a9e('0x4'),'as':_0x0a9e('0x5'),'attributes':['id',_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8')]}]},'log':'getSmsQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 9f4d1b2..6335b09 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(_0x2f16e5,_0x2e75e0){var _0x5d082a=function(_0x13873b){while(--_0x13873b){_0x2f16e5['push'](_0x2f16e5['shift']());}};_0x5d082a(++_0x2e75e0);}(_0x008c,0x188));var _0xc008=function(_0x1f063b,_0x321a3c){_0x1f063b=_0x1f063b-0x0;var _0x4d864b=_0x008c[_0x1f063b];return _0x4d864b;};'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 _0x70e0=['create','CreateSmsQueueReport','update','UpdateSmsQueueReport','../client'];(function(_0x5950f4,_0x2a1816){var _0x21f517=function(_0x2bf355){while(--_0x2bf355){_0x5950f4['push'](_0x5950f4['shift']());}};_0x21f517(++_0x2a1816);}(_0x70e0,0x17b));var _0x070e=function(_0x2e3a0f,_0x87c1c1){_0x2e3a0f=_0x2e3a0f-0x0;var _0x5c4649=_0x70e0[_0x2e3a0f];return _0x5c4649;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(_0x198c2e){return client['Request']('CreateSmsQueueReport',{'body':_0x198c2e,'log':_0x070e('0x2')});};exports[_0x070e('0x3')]=function(_0x277d32,_0x2593e5){return client['Request'](_0x070e('0x4'),{'body':_0x2593e5,'options':{'where':{'uniqueid':_0x277d32},'order':[['id','DESC']],'limit':0x1},'log':_0x070e('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 3cfe0fa..617265c 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(_0x3bc15e,_0x872aff){var _0x49087c=function(_0x3dbf7a){while(--_0x3dbf7a){_0x3bc15e['push'](_0x3bc15e['shift']());}};_0x49087c(++_0x872aff);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'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(_0x36cb22,_0x340b23){var _0x5f8af7=function(_0x5d395f){while(--_0x5d395f){_0x36cb22['push'](_0x36cb22['shift']());}};_0x5f8af7(++_0x340b23);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'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 8e58f71..c294cd6 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 _0xbd0a=['Request','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','updateWhatsappInteraction','addTags'];(function(_0x19ad35,_0x145d41){var _0x3327c9=function(_0x306f9d){while(--_0x306f9d){_0x19ad35['push'](_0x19ad35['shift']());}};_0x3327c9(++_0x145d41);}(_0xbd0a,0x1b9));var _0xabd0=function(_0x666779,_0x5d9927){_0x666779=_0x666779-0x0;var _0x482d9d=_0xbd0a[_0x666779];return _0x482d9d;};'use strict';var client=require(_0xabd0('0x0'));exports['update']=function(_0x3b0fc0,_0x48c569){return client['Request']('UpdateWhatsappInteraction',{'body':_0x48c569,'options':{'where':{'id':_0x3b0fc0}},'log':_0xabd0('0x1')});};exports[_0xabd0('0x2')]=function(_0x41e52b,_0x3d1138){return client[_0xabd0('0x3')](_0xabd0('0x4'),{'body':_0x3d1138,'options':{'where':{'id':_0x41e52b}},'log':_0xabd0('0x5')});}; \ No newline at end of file +var _0xe08b=['addTags','Request','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','UpdateWhatsappInteraction','updateWhatsappInteraction'];(function(_0x259be6,_0x291c94){var _0x4a93c4=function(_0x16e82c){while(--_0x16e82c){_0x259be6['push'](_0x259be6['shift']());}};_0x4a93c4(++_0x291c94);}(_0xe08b,0x10e));var _0xbe08=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xe08b[_0x1b828b];return _0x98da1a;};'use strict';var client=require(_0xbe08('0x0'));exports['update']=function(_0x35038b,_0x41c652){return client['Request'](_0xbe08('0x1'),{'body':_0x41c652,'options':{'where':{'id':_0x35038b}},'log':_0xbe08('0x2')});};exports[_0xbe08('0x3')]=function(_0x469522,_0x41edfb){return client[_0xbe08('0x4')](_0xbe08('0x5'),{'body':_0x41edfb,'options':{'where':{'id':_0x469522}},'log':_0xbe08('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 037868e..b7818f9 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 _0x8cf0=['createWhatsappMessage','../client','create','Request','CreateWhatsappMessage'];(function(_0x36f243,_0x188505){var _0x426436=function(_0x1c8622){while(--_0x1c8622){_0x36f243['push'](_0x36f243['shift']());}};_0x426436(++_0x188505);}(_0x8cf0,0xa1));var _0x08cf=function(_0x430658,_0x4d42e3){_0x430658=_0x430658-0x0;var _0x3507cc=_0x8cf0[_0x430658];return _0x3507cc;};'use strict';var client=require(_0x08cf('0x0'));exports[_0x08cf('0x1')]=function(_0x18a922){return client[_0x08cf('0x2')](_0x08cf('0x3'),{'body':_0x18a922,'log':_0x08cf('0x4')});}; \ No newline at end of file +var _0x84ec=['CreateWhatsappMessage','createWhatsappMessage','../client','create'];(function(_0x60004,_0x1a53fd){var _0x1b4b52=function(_0x59cb0d){while(--_0x59cb0d){_0x60004['push'](_0x60004['shift']());}};_0x1b4b52(++_0x1a53fd);}(_0x84ec,0xda));var _0xc84e=function(_0xc43eab,_0x10aa5c){_0xc43eab=_0xc43eab-0x0;var _0x19b091=_0x84ec[_0xc43eab];return _0x19b091;};'use strict';var client=require(_0xc84e('0x0'));exports[_0xc84e('0x1')]=function(_0x4f1d2d){return client['Request'](_0xc84e('0x2'),{'body':_0x4f1d2d,'log':_0xc84e('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 7ecb58c..ba495cf 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 _0x3c41=['strategy','Agents','online','getWhatsappQueues','../client','Request','GetWhatsappQueue','name','timeout'];(function(_0x2ab802,_0x5ee80e){var _0x31fa4a=function(_0x2d6ec5){while(--_0x2d6ec5){_0x2ab802['push'](_0x2ab802['shift']());}};_0x31fa4a(++_0x5ee80e);}(_0x3c41,0x190));var _0x13c4=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x3c41[_0x397e5f];return _0x5302b8;};'use strict';var client=require(_0x13c4('0x0'));exports['getWhatsappQueues']=function(){return function(){return client[_0x13c4('0x1')](_0x13c4('0x2'),{'options':{'raw':![],'attributes':['id',_0x13c4('0x3'),_0x13c4('0x4'),_0x13c4('0x5')],'include':[{'model':'User','as':_0x13c4('0x6'),'attributes':['id','name',_0x13c4('0x7'),'whatsappPause']}]},'log':_0x13c4('0x8')});};}; \ No newline at end of file +var _0x48ff=['strategy','User','Agents','online','whatsappPause','../client','getWhatsappQueues','GetWhatsappQueue','name','timeout'];(function(_0x53fee3,_0x26dbbb){var _0xb525a2=function(_0x3ad518){while(--_0x3ad518){_0x53fee3['push'](_0x53fee3['shift']());}};_0xb525a2(++_0x26dbbb);}(_0x48ff,0x91));var _0xf48f=function(_0x4b2490,_0x50fedb){_0x4b2490=_0x4b2490-0x0;var _0x74aff7=_0x48ff[_0x4b2490];return _0x74aff7;};'use strict';var client=require(_0xf48f('0x0'));exports[_0xf48f('0x1')]=function(){return function(){return client['Request'](_0xf48f('0x2'),{'options':{'raw':![],'attributes':['id',_0xf48f('0x3'),_0xf48f('0x4'),_0xf48f('0x5')],'include':[{'model':_0xf48f('0x6'),'as':_0xf48f('0x7'),'attributes':['id','name',_0xf48f('0x8'),_0xf48f('0x9')]}]},'log':'getWhatsappQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index d26c083..56f5679 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 _0xa8c6=['CreateWhatsappQueueReport','UpdateWhatsappQueueReport','DESC','create','Request'];(function(_0x1303f6,_0x35ba3d){var _0x412b46=function(_0x508bc0){while(--_0x508bc0){_0x1303f6['push'](_0x1303f6['shift']());}};_0x412b46(++_0x35ba3d);}(_0xa8c6,0x9e));var _0x6a8c=function(_0x3998ff,_0x58f511){_0x3998ff=_0x3998ff-0x0;var _0xfd997d=_0xa8c6[_0x3998ff];return _0xfd997d;};'use strict';var client=require('../client');exports[_0x6a8c('0x0')]=function(_0x337f7c){return client[_0x6a8c('0x1')](_0x6a8c('0x2'),{'body':_0x337f7c,'log':_0x6a8c('0x2')});};exports['update']=function(_0x1a975b,_0x40a2be){return client[_0x6a8c('0x1')](_0x6a8c('0x3'),{'body':_0x40a2be,'options':{'where':{'uniqueid':_0x1a975b},'order':[['id',_0x6a8c('0x4')]],'limit':0x1},'log':_0x6a8c('0x3')});}; \ No newline at end of file +var _0xe6b0=['CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','Request'];(function(_0x3d70f7,_0x254b37){var _0x12c4f0=function(_0x2e5e6f){while(--_0x2e5e6f){_0x3d70f7['push'](_0x3d70f7['shift']());}};_0x12c4f0(++_0x254b37);}(_0xe6b0,0xc3));var _0x0e6b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe6b0[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['create']=function(_0x2176e5){return client[_0x0e6b('0x0')](_0x0e6b('0x1'),{'body':_0x2176e5,'log':_0x0e6b('0x1')});};exports[_0x0e6b('0x2')]=function(_0x1f3180,_0x3bf731){return client[_0x0e6b('0x0')](_0x0e6b('0x3'),{'body':_0x3bf731,'options':{'where':{'uniqueid':_0x1f3180},'order':[['id','DESC']],'limit':0x1},'log':_0x0e6b('0x3')});}; \ 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 bd60550..377c055 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 _0xfd09=['info','[%s][AGENT]\x20ROUTING\x20STOPPED','stop','complete','close','next','agent','log','[%s][QUEUE]\x20%s','stack','lodash','util','seq-queue','../../../../config/logger','routing','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','validate','length','error','[%s][AGENT]\x20%s','map','join','find','agents','createQueue','atimeout','channel','rules','end'];(function(_0x1fdeac,_0x337b01){var _0x3b45ec=function(_0x8b0e74){while(--_0x8b0e74){_0x1fdeac['push'](_0x1fdeac['shift']());}};_0x3b45ec(++_0x337b01);}(_0xfd09,0x9a));var _0x9fd0=function(_0x3e8930,_0x154364){_0x3e8930=_0x3e8930-0x0;var _0x15b38f=_0xfd09[_0x3e8930];return _0x15b38f;};'use strict';var schema=require('validate');var _=require(_0x9fd0('0x0'));var util=require(_0x9fd0('0x1'));var seqqueue=require(_0x9fd0('0x2'));var logger=require(_0x9fd0('0x3'))(_0x9fd0('0x4'));var strategy=require('./strategy');var queue=schema({'name':{'type':_0x9fd0('0x5'),'required':!![],'message':_0x9fd0('0x6')},'timeout':{'type':_0x9fd0('0x7'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x284be1,_0x180032,_0x52e65b){return logger['info'](util[_0x9fd0('0x8')](_0x9fd0('0x9'),_0x284be1,_0x180032[_0x9fd0('0xa')],_0x52e65b));}function handleFindAgent(_0x1d8988){return function(_0x79ca54){return _0x79ca54[_0x9fd0('0xa')][_0x9fd0('0xb')]()===_0x1d8988[_0x9fd0('0xb')]();};}exports[_0x9fd0('0xc')]=function(_0x334ccd,_0x7fc714,_0x3dde79,_0x43a439){return function(_0x4424da){try{var _0x5a5b33={'name':_0x7fc714[0x0],'timeout':_0x7fc714[0x1]};var _0x51bb26=queue[_0x9fd0('0xd')](_0x5a5b33,{'typecast':!![]});if(_0x51bb26[_0x9fd0('0xe')]){logger[_0x9fd0('0xf')](_0x9fd0('0x10'),_0x334ccd,_[_0x9fd0('0x11')](_0x51bb26,'message')[_0x9fd0('0x12')](',\x20'));_0x4424da['stop']();}else{var _0x438b76=_[_0x9fd0('0x13')](_0x3dde79[_0x9fd0('0x14')],handleFindAgent(_0x5a5b33[_0x9fd0('0xa')]));if(_0x438b76){var _0x1a79ba=(_0x5a5b33['timeout']||0xa)*0x3e8;var _0x34a5bc,_0x2cc48;var _0x206753=seqqueue[_0x9fd0('0x15')](_0x1a79ba);_0x206753['id']=_0x334ccd;_0x206753[_0x9fd0('0x16')]=_0x1a79ba;_0x206753[_0x9fd0('0x17')]=_0x43a439[_0x9fd0('0x17')];writeLog(_0x334ccd,_0x438b76,util[_0x9fd0('0x8')]('START:%s',_0x1a79ba));_0x3dde79[_0x9fd0('0x18')][_0x334ccd]['on'](_0x9fd0('0x19'),function(){logger[_0x9fd0('0x1a')](_0x9fd0('0x1b'),_0x334ccd);clearTimeout(_0x2cc48);_0x2cc48=undefined;_0x206753['close']();if(_0x3dde79[_0x9fd0('0x18')][_0x334ccd]){delete _0x3dde79[_0x9fd0('0x18')][_0x334ccd];}_0x4424da[_0x9fd0('0x1c')]();});_0x3dde79[_0x9fd0('0x18')][_0x334ccd]['on'](_0x9fd0('0x1d'),function(){if(_0x3dde79[_0x9fd0('0x18')][_0x334ccd]){delete _0x3dde79[_0x9fd0('0x18')][_0x334ccd];}});_0x2cc48=setTimeout(function(){logger[_0x9fd0('0x1a')]('[%s][AGENT]\x20ROUTING\x20END',_0x334ccd);clearTimeout(_0x2cc48);_0x206753[_0x9fd0('0x1e')]();_0x4424da[_0x9fd0('0x1f')]();},_0x1a79ba);strategy[_0x9fd0('0x20')](_0x206753,_0x438b76,_0x3dde79,_0x43a439);}else{logger[_0x9fd0('0xf')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x334ccd,_0x5a5b33[_0x9fd0('0xa')]);_0x4424da[_0x9fd0('0x1c')]();}}}catch(_0x2276ec){console[_0x9fd0('0x21')](_0x2276ec);logger[_0x9fd0('0xf')](_0x9fd0('0x22'),_0x334ccd,_0x2276ec[_0x9fd0('0x23')]);_0x4424da[_0x9fd0('0x1c')]();}};}; \ No newline at end of file +var _0xf899=['map','message','join','stop','find','agents','createQueue','channel','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','rules','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','[%s][QUEUE]\x20%s','util','../../../../config/logger','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','validate','length','error'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xf899,0x19d));var _0x9f89=function(_0x7e6a8a,_0x1ced01){_0x7e6a8a=_0x7e6a8a-0x0;var _0x3df0f0=_0xf899[_0x7e6a8a];return _0x3df0f0;};'use strict';var schema=require('validate');var _=require('lodash');var util=require(_0x9f89('0x0'));var seqqueue=require('seq-queue');var logger=require(_0x9f89('0x1'))('routing');var strategy=require(_0x9f89('0x2'));var queue=schema({'name':{'type':_0x9f89('0x3'),'required':!![],'message':_0x9f89('0x4')},'timeout':{'type':_0x9f89('0x5'),'message':_0x9f89('0x6')}});function writeLog(_0x21f59d,_0x56b324,_0x45349f){return logger[_0x9f89('0x7')](util[_0x9f89('0x8')](_0x9f89('0x9'),_0x21f59d,_0x56b324[_0x9f89('0xa')],_0x45349f));}function handleFindAgent(_0x1d6083){return function(_0x44ba59){return _0x44ba59[_0x9f89('0xa')][_0x9f89('0xb')]()===_0x1d6083[_0x9f89('0xb')]();};}exports[_0x9f89('0xc')]=function(_0x4792fe,_0x3b7921,_0x4c851d,_0x3b7b56){return function(_0x2f45b8){try{var _0x317237={'name':_0x3b7921[0x0],'timeout':_0x3b7921[0x1]};var _0x4e9c2a=queue[_0x9f89('0xd')](_0x317237,{'typecast':!![]});if(_0x4e9c2a[_0x9f89('0xe')]){logger[_0x9f89('0xf')]('[%s][AGENT]\x20%s',_0x4792fe,_[_0x9f89('0x10')](_0x4e9c2a,_0x9f89('0x11'))[_0x9f89('0x12')](',\x20'));_0x2f45b8[_0x9f89('0x13')]();}else{var _0x4a5205=_[_0x9f89('0x14')](_0x4c851d[_0x9f89('0x15')],handleFindAgent(_0x317237['name']));if(_0x4a5205){var _0x17e33b=(_0x317237['timeout']||0xa)*0x3e8;var _0x415c7c,_0x5e70cf;var _0x1cedd9=seqqueue[_0x9f89('0x16')](_0x17e33b);_0x1cedd9['id']=_0x4792fe;_0x1cedd9['atimeout']=_0x17e33b;_0x1cedd9[_0x9f89('0x17')]=_0x3b7b56['channel'];writeLog(_0x4792fe,_0x4a5205,util[_0x9f89('0x8')]('START:%s',_0x17e33b));_0x4c851d['rules'][_0x4792fe]['on'](_0x9f89('0x18'),function(){logger['info'](_0x9f89('0x19'),_0x4792fe);clearTimeout(_0x5e70cf);_0x5e70cf=undefined;_0x1cedd9[_0x9f89('0x1a')]();if(_0x4c851d[_0x9f89('0x1b')][_0x4792fe]){delete _0x4c851d[_0x9f89('0x1b')][_0x4792fe];}_0x2f45b8[_0x9f89('0x13')]();});_0x4c851d[_0x9f89('0x1b')][_0x4792fe]['on']('complete',function(){if(_0x4c851d[_0x9f89('0x1b')][_0x4792fe]){delete _0x4c851d[_0x9f89('0x1b')][_0x4792fe];}});_0x5e70cf=setTimeout(function(){logger[_0x9f89('0x7')](_0x9f89('0x1c'),_0x4792fe);clearTimeout(_0x5e70cf);_0x1cedd9['close']();_0x2f45b8[_0x9f89('0x1d')]();},_0x17e33b);strategy[_0x9f89('0x1e')](_0x1cedd9,_0x4a5205,_0x4c851d,_0x3b7b56);}else{logger[_0x9f89('0xf')](_0x9f89('0x1f'),_0x4792fe,_0x317237['name']);_0x2f45b8[_0x9f89('0x13')]();}}}catch(_0x5687dc){console['log'](_0x5687dc);logger[_0x9f89('0xf')](_0x9f89('0x20'),_0x4792fe,_0x5687dc['stack']);_0x2f45b8[_0x9f89('0x13')]();}};}; \ 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 d0dd426..a007676 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 _0xeca0=['moment','aws-sdk','./utils','../../../../config/logger','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','isNil','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','YYYY-MM-DD\x20HH:mm:ss','channel','sms','whatsapp','phone','interaction','chat','upperFirst','account','InteractionId','created','isEmpty','getMustacheRender','Message','create','then','info','body','catch','error','stringify','finally','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','message','toString','postText','amazonlex','providerName','providerResponse','dialogState','Failed','lodash'];(function(_0x3740fe,_0x6c543c){var _0x55492b=function(_0x1f851f){while(--_0x1f851f){_0x3740fe['push'](_0x3740fe['shift']());}};_0x55492b(++_0x6c543c);}(_0xeca0,0xb7));var _0x0eca=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xeca0[_0x2160a9];return _0xa88cf7;};'use strict';var _=require(_0x0eca('0x0'));var moment=require(_0x0eca('0x1'));var AWS=require(_0x0eca('0x2'));var utils=require(_0x0eca('0x3'));var logger=require(_0x0eca('0x4'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x0eca('0x5')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x0eca('0x6'))};exports[_0x0eca('0x7')]=function(_0x41c806,_0x1c22d6){return function(_0x5ab227){try{if(!_[_0x0eca('0x8')](this['interaction']['UserId'])){logger['info'](_0x0eca('0x9'),_0x41c806,_0x0eca('0xa'));return _0x5ab227[_0x0eca('0xb')]();}var _0x1dd235={'ContactId':this[_0x0eca('0xc')]['id'],'sentAt':moment()['format'](_0x0eca('0xd')),'direction':'out'};if(this[_0x0eca('0xe')]===_0x0eca('0xf')||this['channel']===_0x0eca('0x10')){_0x1dd235[_0x0eca('0x11')]=this[_0x0eca('0x12')][_0x0eca('0x11')];}var _0x66bcb4=this[_0x0eca('0xe')];if(_0x66bcb4===_0x0eca('0x13')){_0x1dd235['ChatWebsiteId']=this['account']['id'];}else{_0x1dd235[_[_0x0eca('0x14')](_0x66bcb4)+'AccountId']=this[_0x0eca('0x15')]['id'];}_0x1dd235[_[_0x0eca('0x14')](_0x66bcb4)+_0x0eca('0x16')]=this[_0x0eca('0x12')]['id'];if(this[_0x0eca('0x12')][_0x0eca('0x17')]){var _0x308c1e=_0x1c22d6[0x4];if(!_[_0x0eca('0x18')](_0x308c1e)){_0x1dd235['body']=utils[_0x0eca('0x19')](_0x308c1e,this);return rpc[_0x66bcb4+_0x0eca('0x1a')][_0x0eca('0x1b')](_0x1dd235)[_0x0eca('0x1c')](function(_0x5bf633){logger[_0x0eca('0x1d')](_0x0eca('0x9'),_0x41c806,_0x1dd235[_0x0eca('0x1e')]);})[_0x0eca('0x1f')](function(_0xbafde0){logger[_0x0eca('0x20')]('[%s][AMAZONLEX]\x20%s',_0x41c806,JSON[_0x0eca('0x21')](_0xbafde0));})[_0x0eca('0x22')](function(){logger[_0x0eca('0x1d')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x41c806);_0x5ab227[_0x0eca('0x23')]();});}else{logger[_0x0eca('0x1d')](_0x0eca('0x24'),_0x41c806);_0x5ab227[_0x0eca('0x23')]();}}else{var _0x3c518d=this;var _0x717ba9=new AWS[(_0x0eca('0x25'))]({'accessKeyId':_0x1c22d6[0x0],'secretAccessKey':_0x1c22d6[0x1],'region':_0x1c22d6[0x2]});var _0x8b7421={'botAlias':'$LATEST','botName':_0x1c22d6[0x3],'inputText':this[_0x0eca('0x26')]['body'],'userId':this[_0x0eca('0xe')]+':'+this[_0x0eca('0x12')]['id'][_0x0eca('0x27')]()};_0x717ba9[_0x0eca('0x28')](_0x8b7421,function(_0x34d372,_0x472986){if(_0x34d372){logger[_0x0eca('0x20')](_0x0eca('0x9'),_0x41c806,_0x34d372['message']);_0x5ab227[_0x0eca('0xb')]();}else if(_0x472986&&_0x472986[_0x0eca('0x26')]){_0x3c518d['body'][_0x0eca('0x29')]=_0x472986;_0x1dd235[_0x0eca('0x1e')]=_0x472986['message'];_0x1dd235[_0x0eca('0x2a')]=_0x0eca('0x29');_0x1dd235[_0x0eca('0x2b')]=JSON[_0x0eca('0x21')](_0x472986);return rpc[_0x66bcb4+_0x0eca('0x1a')][_0x0eca('0x1b')](_0x1dd235)[_0x0eca('0x1c')](function(_0x1a5d4a){logger[_0x0eca('0x1d')](_0x0eca('0x9'),_0x41c806,_0x1dd235[_0x0eca('0x1e')]);if(_0x472986[_0x0eca('0x2c')]==_0x0eca('0x2d')){_0x5ab227[_0x0eca('0xb')]();}else{_0x5ab227[_0x0eca('0x23')]();}})[_0x0eca('0x1f')](function(_0x2aef37){logger[_0x0eca('0x20')](_0x0eca('0x9'),_0x41c806,JSON[_0x0eca('0x21')](_0x2aef37));_0x5ab227['next']();});}else{_0x5ab227[_0x0eca('0xb')]();}});}}catch(_0xc251ef){logger[_0x0eca('0x20')](_0x0eca('0x9'),_0x41c806,JSON[_0x0eca('0x21')](_0xc251ef));_0x5ab227['stop']();}};}; \ No newline at end of file +var _0x96a1=['message','toString','postText','providerName','amazonlex','providerResponse','stringify','dialogState','lodash','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','isNil','interaction','UserId','info','next','contact','format','out','channel','sms','whatsapp','phone','chat','account','upperFirst','AccountId','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','then','[%s][AMAZONLEX]\x20%s','catch','error','finally','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST'];(function(_0x3e0fb7,_0xc39928){var _0x3b3358=function(_0x5a990c){while(--_0x5a990c){_0x3e0fb7['push'](_0x3e0fb7['shift']());}};_0x3b3358(++_0xc39928);}(_0x96a1,0x166));var _0x196a=function(_0x33cf66,_0x30e414){_0x33cf66=_0x33cf66-0x0;var _0x3a400b=_0x96a1[_0x33cf66];return _0x3a400b;};'use strict';var _=require(_0x196a('0x0'));var moment=require(_0x196a('0x1'));var AWS=require(_0x196a('0x2'));var utils=require(_0x196a('0x3'));var logger=require(_0x196a('0x4'))(_0x196a('0x5'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x196a('0x6')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x196a('0x7')),'faxMessage':require(_0x196a('0x8')),'whatsappMessage':require(_0x196a('0x9'))};exports['consequence']=function(_0x4ef9e2,_0x23a6ac){return function(_0x161e2d){try{if(!_[_0x196a('0xa')](this[_0x196a('0xb')][_0x196a('0xc')])){logger[_0x196a('0xd')]('[%s][AMAZONLEX]\x20%s',_0x4ef9e2,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x161e2d[_0x196a('0xe')]();}var _0x4771e2={'ContactId':this[_0x196a('0xf')]['id'],'sentAt':moment()[_0x196a('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x196a('0x11')};if(this[_0x196a('0x12')]===_0x196a('0x13')||this[_0x196a('0x12')]===_0x196a('0x14')){_0x4771e2[_0x196a('0x15')]=this[_0x196a('0xb')][_0x196a('0x15')];}var _0xa5c9b=this[_0x196a('0x12')];if(_0xa5c9b===_0x196a('0x16')){_0x4771e2['ChatWebsiteId']=this[_0x196a('0x17')]['id'];}else{_0x4771e2[_[_0x196a('0x18')](_0xa5c9b)+_0x196a('0x19')]=this[_0x196a('0x17')]['id'];}_0x4771e2[_['upperFirst'](_0xa5c9b)+_0x196a('0x1a')]=this[_0x196a('0xb')]['id'];if(this['interaction'][_0x196a('0x1b')]){var _0x9e1a91=_0x23a6ac[0x4];if(!_[_0x196a('0x1c')](_0x9e1a91)){_0x4771e2[_0x196a('0x1d')]=utils[_0x196a('0x1e')](_0x9e1a91,this);return rpc[_0xa5c9b+_0x196a('0x1f')][_0x196a('0x20')](_0x4771e2)[_0x196a('0x21')](function(_0x3c4056){logger[_0x196a('0xd')](_0x196a('0x22'),_0x4ef9e2,_0x4771e2[_0x196a('0x1d')]);})[_0x196a('0x23')](function(_0xa81b57){logger[_0x196a('0x24')](_0x196a('0x22'),_0x4ef9e2,JSON['stringify'](_0xa81b57));})[_0x196a('0x25')](function(){logger['info']('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x4ef9e2);_0x161e2d[_0x196a('0x26')]();});}else{logger['info'](_0x196a('0x27'),_0x4ef9e2);_0x161e2d[_0x196a('0x26')]();}}else{var _0x5027a8=this;var _0x3c4f77=new AWS[(_0x196a('0x28'))]({'accessKeyId':_0x23a6ac[0x0],'secretAccessKey':_0x23a6ac[0x1],'region':_0x23a6ac[0x2]});var _0x21e3b4={'botAlias':_0x196a('0x29'),'botName':_0x23a6ac[0x3],'inputText':this[_0x196a('0x2a')]['body'],'userId':this[_0x196a('0x12')]+':'+this['interaction']['id'][_0x196a('0x2b')]()};_0x3c4f77[_0x196a('0x2c')](_0x21e3b4,function(_0x3966db,_0x2f19a6){if(_0x3966db){logger['error'](_0x196a('0x22'),_0x4ef9e2,_0x3966db[_0x196a('0x2a')]);_0x161e2d[_0x196a('0xe')]();}else if(_0x2f19a6&&_0x2f19a6['message']){_0x5027a8[_0x196a('0x1d')]['amazonlex']=_0x2f19a6;_0x4771e2[_0x196a('0x1d')]=_0x2f19a6[_0x196a('0x2a')];_0x4771e2[_0x196a('0x2d')]=_0x196a('0x2e');_0x4771e2[_0x196a('0x2f')]=JSON[_0x196a('0x30')](_0x2f19a6);return rpc[_0xa5c9b+_0x196a('0x1f')]['create'](_0x4771e2)['then'](function(_0x27e15f){logger[_0x196a('0xd')]('[%s][AMAZONLEX]\x20%s',_0x4ef9e2,_0x4771e2[_0x196a('0x1d')]);if(_0x2f19a6[_0x196a('0x31')]=='Failed'){_0x161e2d['next']();}else{_0x161e2d[_0x196a('0x26')]();}})['catch'](function(_0x40221){logger[_0x196a('0x24')](_0x196a('0x22'),_0x4ef9e2,JSON[_0x196a('0x30')](_0x40221));_0x161e2d[_0x196a('0xe')]();});}else{_0x161e2d[_0x196a('0xe')]();}});}}catch(_0x3ac0ff){logger['error'](_0x196a('0x22'),_0x4ef9e2,JSON[_0x196a('0x30')](_0x3ac0ff));_0x161e2d[_0x196a('0x26')]();}};}; \ 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 61e2c29..73181a3 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 _0xf75c=['then','[%s][AUTOREPLY]\x20SMTP\x20SENT','[%s][AUTOREPLY]\x20%s','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','resolve','update','finally','Interaction','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','moment','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../mailRpc','consequence','channel','mail','info','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','created','interaction','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','format','out','body','getMustacheRender','message','from','phone','subject','startsWith','Re:','Re:\x20','ChatWebsiteId','account','upperFirst','AccountId','Message','Smtp','service','host','port','secure','auth','user','pass','messageId','html','','replace','','headers','All','auto_reply','sendMailMessage'];(function(_0x24392f,_0x15a3e5){var _0x591e33=function(_0xe0ccea){while(--_0xe0ccea){_0x24392f['push'](_0x24392f['shift']());}};_0x591e33(++_0x15a3e5);}(_0xf75c,0x16f));var _0xcf75=function(_0x251120,_0x553a5d){_0x251120=_0x251120-0x0;var _0x5d9b42=_0xf75c[_0x251120];return _0x5d9b42;};'use strict';var _=require('lodash');var moment=require(_0xcf75('0x0'));var utils=require(_0xcf75('0x1'));var logger=require(_0xcf75('0x2'))(_0xcf75('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xcf75('0x4')),'mailMessage':require(_0xcf75('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xcf75('0x6')),'chatInteraction':require(_0xcf75('0x7')),'openchannelInteraction':require(_0xcf75('0x8')),'mailInteraction':require(_0xcf75('0x9')),'smsInteraction':require(_0xcf75('0xa')),'faxInteraction':require(_0xcf75('0xb')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require(_0xcf75('0xc'));exports[_0xcf75('0xd')]=function(_0x59cc5d,_0x1c8dc7,_0x544bca,_0x2ec9b3){return function(_0x5666b8){try{var _0x508223=this[_0xcf75('0xe')];if(_0x508223===_0xcf75('0xf')&&_0x2ec9b3['body']['isAutoreply']){logger[_0xcf75('0x10')]('[%s][AUTOREPLY]\x20%s',_0x59cc5d,_0xcf75('0x11'));return _0x5666b8[_0xcf75('0x12')]();}if(_0x1c8dc7[0x0]==='1'&&(_[_0xcf75('0x13')](this['interaction'][_0xcf75('0x14')])||!this[_0xcf75('0x15')][_0xcf75('0x14')])){logger[_0xcf75('0x10')]('[%s][AUTOREPLY]\x20%s',_0x59cc5d,_0xcf75('0x16'));return _0x5666b8[_0xcf75('0x12')]();}if(_0x1c8dc7[0x0]==='2'&&this['interaction'][_0xcf75('0x17')]){logger['info'](_0xcf75('0x18'),_0x59cc5d,'One\x20Time\x20already\x20sent');return _0x5666b8[_0xcf75('0x12')]();}var _0xbb47d6={'ContactId':this['contact']['id'],'sentAt':moment()[_0xcf75('0x19')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xcf75('0x1a')};if(this['channel']===_0xcf75('0xf')){_0xbb47d6[_0xcf75('0x1b')]=utils[_0xcf75('0x1c')](_0x1c8dc7[0x2],this);}else{_0xbb47d6['body']=utils[_0xcf75('0x1c')](_0x1c8dc7[0x1],this);}if(this[_0xcf75('0x1d')]){_0xbb47d6['to']=this[_0xcf75('0x1d')]['from']||'';if(this[_0xcf75('0xe')]==='mail'&&_0x1c8dc7[0x1]==='1'){_0xbb47d6['cc']=this[_0xcf75('0x1d')]['cc']||'';}_0xbb47d6[_0xcf75('0x1e')]=this['message']['to']||'';_0xbb47d6[_0xcf75('0x1f')]=this[_0xcf75('0x1d')][_0xcf75('0x1f')]||'';_0xbb47d6['read']=!![];if(this[_0xcf75('0x1d')][_0xcf75('0x20')]){_0xbb47d6[_0xcf75('0x20')]='';_0xbb47d6[_0xcf75('0x20')]+=_[_0xcf75('0x21')](this[_0xcf75('0x1d')][_0xcf75('0x20')],_0xcf75('0x22'))?'':_0xcf75('0x23');_0xbb47d6[_0xcf75('0x20')]+=this[_0xcf75('0x1d')][_0xcf75('0x20')];}}if(this[_0xcf75('0xe')]==='chat'){_0xbb47d6[_0xcf75('0x24')]=this[_0xcf75('0x25')]['id'];}else{_0xbb47d6[_[_0xcf75('0x26')](this['channel'])+_0xcf75('0x27')]=this[_0xcf75('0x25')]['id'];}_0xbb47d6[_[_0xcf75('0x26')](this[_0xcf75('0xe')])+'InteractionId']=this[_0xcf75('0x15')]['id'];var _0x2f8431=this[_0xcf75('0x15')];if(rpc[this[_0xcf75('0xe')]+_0xcf75('0x28')]){if(this[_0xcf75('0xe')]===_0xcf75('0xf')){var _0x296e78={'tls':{'rejectUnauthorized':![]}};if(this[_0xcf75('0x25')][_0xcf75('0x29')][_0xcf75('0x2a')]){_0x296e78[_0xcf75('0x2a')]=this[_0xcf75('0x25')][_0xcf75('0x29')]['service'];}else{_0x296e78[_0xcf75('0x2b')]=this[_0xcf75('0x25')][_0xcf75('0x29')][_0xcf75('0x2b')];_0x296e78[_0xcf75('0x2c')]=this['account'][_0xcf75('0x29')][_0xcf75('0x2c')];_0x296e78[_0xcf75('0x2d')]=this['account'][_0xcf75('0x29')][_0xcf75('0x2d')];}if(this[_0xcf75('0x25')][_0xcf75('0x29')]['authentication']){_0x296e78[_0xcf75('0x2e')]={'user':this['account']['Smtp'][_0xcf75('0x2f')],'pass':this[_0xcf75('0x25')][_0xcf75('0x29')][_0xcf75('0x30')]};}_0xbb47d6['inReplyTo']=this[_0xcf75('0x1d')][_0xcf75('0x31')];_0xbb47d6[_0xcf75('0x32')]=_0xcf75('0x33')+_[_0xcf75('0x34')](_0xbb47d6['body'],_0xcf75('0x35'),'','headers','auto-replied','All','auto_reply','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify','error','finally','resolve','autoreplyExecuted','Interaction','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','[%s][AUTOREPLY]\x20%s','catch','stop','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../mailRpc','mail','body','isAutoreply','info','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','created','interaction','Autoreply\x20already\x20sent','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','getMustacheRender','message','from','phone','read','subject','startsWith','Re:','Re:\x20','chat','ChatWebsiteId','account'];(function(_0x79b649,_0x2115b3){var _0x1af9b1=function(_0x153c9f){while(--_0x153c9f){_0x79b649['push'](_0x79b649['shift']());}};_0x1af9b1(++_0x2115b3);}(_0x11de,0xc5));var _0xe11d=function(_0x1d05e1,_0x5c7853){_0x1d05e1=_0x1d05e1-0x0;var _0x5e9c13=_0x11de[_0x1d05e1];return _0x5e9c13;};'use strict';var _=require('lodash');var moment=require(_0xe11d('0x0'));var utils=require(_0xe11d('0x1'));var logger=require(_0xe11d('0x2'))(_0xe11d('0x3'));var rpc={'chatMessage':require(_0xe11d('0x4')),'openchannelMessage':require(_0xe11d('0x5')),'mailMessage':require(_0xe11d('0x6')),'smsMessage':require(_0xe11d('0x7')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xe11d('0x8')),'chatInteraction':require(_0xe11d('0x9')),'openchannelInteraction':require(_0xe11d('0xa')),'mailInteraction':require(_0xe11d('0xb')),'smsInteraction':require(_0xe11d('0xc')),'faxInteraction':require(_0xe11d('0xd')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require(_0xe11d('0xe'));exports['consequence']=function(_0x278778,_0x17c945,_0x8e55ca,_0x178481){return function(_0x3e8dc1){try{var _0x4c4755=this['channel'];if(_0x4c4755===_0xe11d('0xf')&&_0x178481[_0xe11d('0x10')][_0xe11d('0x11')]){logger[_0xe11d('0x12')]('[%s][AUTOREPLY]\x20%s',_0x278778,_0xe11d('0x13'));return _0x3e8dc1[_0xe11d('0x14')]();}if(_0x17c945[0x0]==='1'&&(_['isNil'](this['interaction'][_0xe11d('0x15')])||!this[_0xe11d('0x16')][_0xe11d('0x15')])){logger[_0xe11d('0x12')]('[%s][AUTOREPLY]\x20%s',_0x278778,_0xe11d('0x17'));return _0x3e8dc1[_0xe11d('0x14')]();}if(_0x17c945[0x0]==='2'&&this[_0xe11d('0x16')]['autoreplyExecuted']){logger[_0xe11d('0x12')](_0xe11d('0x18'),_0x278778,_0xe11d('0x19'));return _0x3e8dc1['next']();}var _0x2d54e4={'ContactId':this[_0xe11d('0x1a')]['id'],'sentAt':moment()[_0xe11d('0x1b')](_0xe11d('0x1c')),'direction':_0xe11d('0x1d')};if(this[_0xe11d('0x1e')]===_0xe11d('0xf')){_0x2d54e4['body']=utils[_0xe11d('0x1f')](_0x17c945[0x2],this);}else{_0x2d54e4['body']=utils[_0xe11d('0x1f')](_0x17c945[0x1],this);}if(this[_0xe11d('0x20')]){_0x2d54e4['to']=this['message'][_0xe11d('0x21')]||'';if(this['channel']===_0xe11d('0xf')&&_0x17c945[0x1]==='1'){_0x2d54e4['cc']=this[_0xe11d('0x20')]['cc']||'';}_0x2d54e4[_0xe11d('0x21')]=this[_0xe11d('0x20')]['to']||'';_0x2d54e4[_0xe11d('0x22')]=this['message'][_0xe11d('0x22')]||'';_0x2d54e4[_0xe11d('0x23')]=!![];if(this[_0xe11d('0x20')][_0xe11d('0x24')]){_0x2d54e4[_0xe11d('0x24')]='';_0x2d54e4[_0xe11d('0x24')]+=_[_0xe11d('0x25')](this[_0xe11d('0x20')][_0xe11d('0x24')],_0xe11d('0x26'))?'':_0xe11d('0x27');_0x2d54e4[_0xe11d('0x24')]+=this['message'][_0xe11d('0x24')];}}if(this['channel']===_0xe11d('0x28')){_0x2d54e4[_0xe11d('0x29')]=this[_0xe11d('0x2a')]['id'];}else{_0x2d54e4[_[_0xe11d('0x2b')](this[_0xe11d('0x1e')])+_0xe11d('0x2c')]=this[_0xe11d('0x2a')]['id'];}_0x2d54e4[_[_0xe11d('0x2b')](this['channel'])+_0xe11d('0x2d')]=this[_0xe11d('0x16')]['id'];var _0x5eb421=this[_0xe11d('0x16')];if(rpc[this[_0xe11d('0x1e')]+_0xe11d('0x2e')]){if(this[_0xe11d('0x1e')]===_0xe11d('0xf')){var _0x2ac96b={'tls':{'rejectUnauthorized':![]}};if(this[_0xe11d('0x2a')]['Smtp'][_0xe11d('0x2f')]){_0x2ac96b['service']=this[_0xe11d('0x2a')][_0xe11d('0x30')][_0xe11d('0x2f')];}else{_0x2ac96b[_0xe11d('0x31')]=this[_0xe11d('0x2a')][_0xe11d('0x30')][_0xe11d('0x31')];_0x2ac96b[_0xe11d('0x32')]=this[_0xe11d('0x2a')][_0xe11d('0x30')]['port'];_0x2ac96b[_0xe11d('0x33')]=this['account'][_0xe11d('0x30')][_0xe11d('0x33')];}if(this[_0xe11d('0x2a')][_0xe11d('0x30')][_0xe11d('0x34')]){_0x2ac96b[_0xe11d('0x35')]={'user':this[_0xe11d('0x2a')][_0xe11d('0x30')][_0xe11d('0x36')],'pass':this[_0xe11d('0x2a')]['Smtp']['pass']};}_0x2d54e4[_0xe11d('0x37')]=this['message'][_0xe11d('0x38')];_0x2d54e4[_0xe11d('0x39')]=''+_[_0xe11d('0x3a')](_0x2d54e4[_0xe11d('0x10')],']+(>|$)/g,''),'priorityTrue':_0xbcb542[0x1],'priorityFalse':_0xbcb542[0x2]};var _0x11d261=gotoif[_0xdb9c('0x0')](_0x2eb027,{'typecast':!![]});if(_0x11d261[_0xdb9c('0xd')]){logger[_0xdb9c('0xe')](_0xdb9c('0xf'),_0x426852,_['map'](_0x11d261,_0xdb9c('0x10'))['join'](',\x20'));_0x3cf7a3[_0xdb9c('0x11')]();}else{try{var _0x48670f=eval('('+_0x2eb027['condition']+')');var _0x23b36f=_0x48670f?_0x2eb027[_0xdb9c('0x12')]:_0x2eb027[_0xdb9c('0x13')];logger[_0xdb9c('0x14')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x426852,_0x2eb027[_0xdb9c('0x15')],_0x48670f,_0x23b36f||_0xdb9c('0x16'));if(_0x23b36f){var _0x5c325b=_['findIndex'](_0x3cf7a3[_0xdb9c('0x17')](),{'p':_0x23b36f});if(_0x5c325b>=0x0){logger[_0xdb9c('0x14')](_0xdb9c('0x18'),_0x426852,_0x23b36f||_0xdb9c('0x16'),_0x5c325b);_0x3cf7a3[_0xdb9c('0x16')](_0x5c325b);}else{logger[_0xdb9c('0x14')](_0xdb9c('0x19'),_0x426852,_0x23b36f||_0xdb9c('0x16'));_0x3cf7a3[_0xdb9c('0x11')]();}}else{_0x3cf7a3['next']();}}catch(_0x172a61){logger['error'](_0xdb9c('0x1a'),_0x426852,_0x172a61[_0xdb9c('0x10')]);_0x3cf7a3['stop']();}}}catch(_0x47af0c){logger[_0xdb9c('0xe')](_0xdb9c('0xf'),_0x426852,JSON[_0xdb9c('0x1b')](_0x47af0c));_0x3cf7a3['stop']();}};}; \ No newline at end of file +var _0x6dcb=['[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20%s','stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','priority\x20true\x20is\x20a\x20number','number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','length','error','message','join','stop','priorityTrue','priorityFalse','info','condition','next','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s'];(function(_0x433ae7,_0x2176a7){var _0x2ef7cb=function(_0x491d46){while(--_0x491d46){_0x433ae7['push'](_0x433ae7['shift']());}};_0x2ef7cb(++_0x2176a7);}(_0x6dcb,0x189));var _0xb6dc=function(_0xb0081b,_0x1e20dd){_0xb0081b=_0xb0081b-0x0;var _0x48ea8f=_0x6dcb[_0xb0081b];return _0x48ea8f;};'use strict';var schema=require(_0xb6dc('0x0'));var _=require(_0xb6dc('0x1'));var htmlToText=require(_0xb6dc('0x2'));var utils=require(_0xb6dc('0x3'));var logger=require(_0xb6dc('0x4'))(_0xb6dc('0x5'));var gotoif=schema({'condition':{'type':_0xb6dc('0x6'),'required':!![],'message':_0xb6dc('0x7')},'priorityTrue':{'type':'number','message':_0xb6dc('0x8')},'priorityFalse':{'type':_0xb6dc('0x9'),'message':_0xb6dc('0xa')}});exports[_0xb6dc('0xb')]=function(_0x488308,_0x14f281){return function(_0x1070ac){try{var _0x1d9bf4={'condition':htmlToText[_0xb6dc('0xc')](utils[_0xb6dc('0xd')](_0x14f281[0x0],this),{'wordwrap':![]})[_0xb6dc('0xe')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x14f281[0x1],'priorityFalse':_0x14f281[0x2]};var _0x4ed5ab=gotoif[_0xb6dc('0x0')](_0x1d9bf4,{'typecast':!![]});if(_0x4ed5ab[_0xb6dc('0xf')]){logger[_0xb6dc('0x10')]('[%s][GOTOIF]\x20%s',_0x488308,_['map'](_0x4ed5ab,_0xb6dc('0x11'))[_0xb6dc('0x12')](',\x20'));_0x1070ac[_0xb6dc('0x13')]();}else{try{var _0x33d561=eval('('+_0x1d9bf4['condition']+')');var _0x36ff07=_0x33d561?_0x1d9bf4[_0xb6dc('0x14')]:_0x1d9bf4[_0xb6dc('0x15')];logger[_0xb6dc('0x16')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x488308,_0x1d9bf4[_0xb6dc('0x17')],_0x33d561,_0x36ff07||_0xb6dc('0x18'));if(_0x36ff07){var _0x3b5820=_['findIndex'](_0x1070ac[_0xb6dc('0x19')](),{'p':_0x36ff07});if(_0x3b5820>=0x0){logger[_0xb6dc('0x16')](_0xb6dc('0x1a'),_0x488308,_0x36ff07||_0xb6dc('0x18'),_0x3b5820);_0x1070ac[_0xb6dc('0x18')](_0x3b5820);}else{logger[_0xb6dc('0x16')](_0xb6dc('0x1b'),_0x488308,_0x36ff07||_0xb6dc('0x18'));_0x1070ac[_0xb6dc('0x13')]();}}else{_0x1070ac[_0xb6dc('0x18')]();}}catch(_0x66e37f){logger[_0xb6dc('0x10')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x488308,_0x66e37f['message']);_0x1070ac[_0xb6dc('0x13')]();}}}catch(_0x150eb6){logger[_0xb6dc('0x10')](_0xb6dc('0x1c'),_0x488308,JSON[_0xb6dc('0x1d')](_0x150eb6));_0x1070ac[_0xb6dc('0x13')]();}};}; \ 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 606dd3f..c4f8dcc 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 _0x1e23=['[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','../../../../config/logger','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s','map','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next'];(function(_0x199e9d,_0x1a119c){var _0x594ef1=function(_0x572fd0){while(--_0x572fd0){_0x199e9d['push'](_0x199e9d['shift']());}};_0x594ef1(++_0x1a119c);}(_0x1e23,0x178));var _0x31e2=function(_0x38b607,_0x20b1ad){_0x38b607=_0x38b607-0x0;var _0x4c6de7=_0x1e23[_0x38b607];return _0x4c6de7;};'use strict';var schema=require(_0x31e2('0x0'));var _=require(_0x31e2('0x1'));var logger=require(_0x31e2('0x2'))('routing');var gotop=schema({'priority':{'type':_0x31e2('0x3'),'required':!![],'message':_0x31e2('0x4')}});exports[_0x31e2('0x5')]=function(_0x3311b3,_0x45e9b8){return function(_0x501170){try{var _0x221a55={'priority':_0x45e9b8[0x0]};var _0x23e8af=gotop['validate'](_0x221a55,{'typecast':!![]});if(_0x23e8af[_0x31e2('0x6')]){logger[_0x31e2('0x7')](_0x31e2('0x8'),_0x3311b3,_[_0x31e2('0x9')](_0x23e8af,_0x31e2('0xa'))[_0x31e2('0xb')](',\x20'));_0x501170[_0x31e2('0xc')]();}else{logger[_0x31e2('0xd')](_0x31e2('0xe'),_0x3311b3,_0x221a55[_0x31e2('0xf')]);if(_0x221a55[_0x31e2('0xf')]){var _0xe9ba7d=_[_0x31e2('0x10')](_0x501170[_0x31e2('0x11')](),{'p':_0x221a55[_0x31e2('0xf')]});if(_0xe9ba7d>=0x0){logger['info'](_0x31e2('0x12'),_0x3311b3,_0x221a55[_0x31e2('0xf')]||_0x31e2('0x13'),_0xe9ba7d);_0x501170[_0x31e2('0x13')](_0xe9ba7d);}else{logger[_0x31e2('0xd')](_0x31e2('0x14'),_0x3311b3,_0x221a55[_0x31e2('0xf')]||_0x31e2('0x13'));_0x501170[_0x31e2('0xc')]();}}else{_0x501170[_0x31e2('0x13')]();}}}catch(_0x53d27b){logger[_0x31e2('0x7')](_0x31e2('0x8'),_0x3311b3,JSON[_0x31e2('0x15')](_0x53d27b));_0x501170[_0x31e2('0xc')]();}};}; \ No newline at end of file +var _0x2aee=['length','error','map','message','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','info','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','[%s][GOTOP]\x20%s','stop','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','validate'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0x2aee,0xfe));var _0xe2ae=function(_0x2c32fb,_0x45b9a8){_0x2c32fb=_0x2c32fb-0x0;var _0x1f2836=_0x2aee[_0x2c32fb];return _0x1f2836;};'use strict';var schema=require('validate');var _=require('lodash');var logger=require(_0xe2ae('0x0'))(_0xe2ae('0x1'));var gotop=schema({'priority':{'type':_0xe2ae('0x2'),'required':!![],'message':_0xe2ae('0x3')}});exports[_0xe2ae('0x4')]=function(_0xb47a2d,_0x1969a9){return function(_0x8ec8e8){try{var _0xd17a18={'priority':_0x1969a9[0x0]};var _0x51800d=gotop[_0xe2ae('0x5')](_0xd17a18,{'typecast':!![]});if(_0x51800d[_0xe2ae('0x6')]){logger[_0xe2ae('0x7')]('[%s][GOTOP]\x20%s',_0xb47a2d,_[_0xe2ae('0x8')](_0x51800d,_0xe2ae('0x9'))['join'](',\x20'));_0x8ec8e8['stop']();}else{logger['info'](_0xe2ae('0xa'),_0xb47a2d,_0xd17a18[_0xe2ae('0xb')]);if(_0xd17a18[_0xe2ae('0xb')]){var _0x4477db=_[_0xe2ae('0xc')](_0x8ec8e8[_0xe2ae('0xd')](),{'p':_0xd17a18[_0xe2ae('0xb')]});if(_0x4477db>=0x0){logger['info'](_0xe2ae('0xe'),_0xb47a2d,_0xd17a18[_0xe2ae('0xb')]||_0xe2ae('0xf'),_0x4477db);_0x8ec8e8[_0xe2ae('0xf')](_0x4477db);}else{logger[_0xe2ae('0x10')](_0xe2ae('0x11'),_0xb47a2d,_0xd17a18[_0xe2ae('0xb')]||'next');_0x8ec8e8['stop']();}}else{_0x8ec8e8[_0xe2ae('0xf')]();}}}catch(_0x3106ff){logger[_0xe2ae('0x7')](_0xe2ae('0x12'),_0xb47a2d,JSON['stringify'](_0x3106ff));_0x8ec8e8[_0xe2ae('0x13')]();}};}; \ 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 169b3b8..3e75e87 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 _0xf29f=['../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','getMustacheRender','channel','chat','ChatWebsiteId','account','upperFirst','InteractionId','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','body','next','error','stringify','stop','./utils','../../../../config/logger','routing'];(function(_0x48588f,_0x53557c){var _0x180303=function(_0x4efda0){while(--_0x4efda0){_0x48588f['push'](_0x48588f['shift']());}};_0x180303(++_0x53557c);}(_0xf29f,0x18d));var _0xff29=function(_0x4a016a,_0x255608){_0x4a016a=_0x4a016a-0x0;var _0x1cd33a=_0xf29f[_0x4a016a];return _0x1cd33a;};'use strict';var _=require('lodash');var utils=require(_0xff29('0x0'));var logger=require(_0xff29('0x1'))(_0xff29('0x2'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xff29('0x3')),'mailMessage':require(_0xff29('0x4')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xff29('0x5')),'whatsappMessage':require(_0xff29('0x6'))};exports['consequence']=function(_0x3c5aa4,_0xbbe36b){return function(_0x4c814b){try{var _0x566021={'body':utils[_0xff29('0x7')](_0xbbe36b[0x0],this),'ContactId':this['contact']['id']};if(this[_0xff29('0x8')]===_0xff29('0x9')){_0x566021[_0xff29('0xa')]=this[_0xff29('0xb')]['id'];}else{_0x566021[_[_0xff29('0xc')](this[_0xff29('0x8')])+'AccountId']=this['account']['id'];}_0x566021[_[_0xff29('0xc')](this[_0xff29('0x8')])+_0xff29('0xd')]=this[_0xff29('0xe')]['id'];if(rpc[this[_0xff29('0x8')]+_0xff29('0xf')]){return rpc[this[_0xff29('0x8')]+_0xff29('0xf')][_0xff29('0x10')](_0x566021)[_0xff29('0x11')](function(_0xf67040){logger[_0xff29('0x12')](_0xff29('0x13'),_0x3c5aa4,_0x566021[_0xff29('0x14')]);_0x4c814b[_0xff29('0x15')]();})['catch'](function(_0x1ff15e){logger[_0xff29('0x16')]('[%s][MESSAGE]\x20%s',_0x3c5aa4,JSON[_0xff29('0x17')](_0x1ff15e));_0x4c814b[_0xff29('0x18')]();});}}catch(_0x24567d){logger[_0xff29('0x16')](_0xff29('0x13'),_0x3c5aa4,JSON[_0xff29('0x17')](_0x24567d));_0x4c814b[_0xff29('0x18')]();}};}; \ No newline at end of file +var _0xbca8=['info','[%s][MESSAGE]\x20%s','catch','error','stringify','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','contact','channel','chat','ChatWebsiteId','account','upperFirst','Message','then'];(function(_0x5c6fc4,_0x17ac58){var _0x46ab76=function(_0x598124){while(--_0x598124){_0x5c6fc4['push'](_0x5c6fc4['shift']());}};_0x46ab76(++_0x17ac58);}(_0xbca8,0xcc));var _0x8bca=function(_0x50a19c,_0x34483b){_0x50a19c=_0x50a19c-0x0;var _0x53b784=_0xbca8[_0x50a19c];return _0x53b784;};'use strict';var _=require(_0x8bca('0x0'));var utils=require(_0x8bca('0x1'));var logger=require(_0x8bca('0x2'))(_0x8bca('0x3'));var rpc={'chatMessage':require(_0x8bca('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x8bca('0x5')),'smsMessage':require(_0x8bca('0x6')),'faxMessage':require(_0x8bca('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x1753ad,_0x2ecf60){return function(_0x318474){try{var _0x348ddd={'body':utils['getMustacheRender'](_0x2ecf60[0x0],this),'ContactId':this[_0x8bca('0x8')]['id']};if(this[_0x8bca('0x9')]===_0x8bca('0xa')){_0x348ddd[_0x8bca('0xb')]=this[_0x8bca('0xc')]['id'];}else{_0x348ddd[_[_0x8bca('0xd')](this[_0x8bca('0x9')])+'AccountId']=this['account']['id'];}_0x348ddd[_[_0x8bca('0xd')](this[_0x8bca('0x9')])+'InteractionId']=this['interaction']['id'];if(rpc[this[_0x8bca('0x9')]+'Message']){return rpc[this[_0x8bca('0x9')]+_0x8bca('0xe')]['create'](_0x348ddd)[_0x8bca('0xf')](function(_0x1fe1b5){logger[_0x8bca('0x10')](_0x8bca('0x11'),_0x1753ad,_0x348ddd['body']);_0x318474['next']();})[_0x8bca('0x12')](function(_0x59b65b){logger[_0x8bca('0x13')](_0x8bca('0x11'),_0x1753ad,JSON[_0x8bca('0x14')](_0x59b65b));_0x318474[_0x8bca('0x15')]();});}}catch(_0x1c3590){logger[_0x8bca('0x13')]('[%s][MESSAGE]\x20%s',_0x1753ad,JSON['stringify'](_0x1c3590));_0x318474[_0x8bca('0x15')]();}};}; \ 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 692d814..5085c95 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 _0x24d6=['error','[%s][NOOP]\x20%s','stringify','stop','routing','consequence','getMustacheRender','next'];(function(_0x5328dd,_0x15180f){var _0x57b966=function(_0x5f2014){while(--_0x5f2014){_0x5328dd['push'](_0x5328dd['shift']());}};_0x57b966(++_0x15180f);}(_0x24d6,0x19c));var _0x624d=function(_0x516927,_0xb4aad0){_0x516927=_0x516927-0x0;var _0x30749b=_0x24d6[_0x516927];return _0x30749b;};'use strict';var utils=require('./utils');var logger=require('../../../../config/logger')(_0x624d('0x0'));exports[_0x624d('0x1')]=function(_0x3f27db,_0x4a01e2){return function(_0x3d25ff){try{logger['info']('[%s][NOOP]\x20%s',_0x3f27db,utils[_0x624d('0x2')](_0x4a01e2[0x0],this));_0x3d25ff[_0x624d('0x3')]();}catch(_0x463583){logger[_0x624d('0x4')](_0x624d('0x5'),_0x3f27db,JSON[_0x624d('0x6')](_0x463583));_0x3d25ff[_0x624d('0x7')]();}};}; \ No newline at end of file +var _0xad1c=['stop','../../../../config/logger','info','[%s][NOOP]\x20%s','getMustacheRender'];(function(_0x550e29,_0x4047f){var _0x3515b6=function(_0x303fe2){while(--_0x303fe2){_0x550e29['push'](_0x550e29['shift']());}};_0x3515b6(++_0x4047f);}(_0xad1c,0x1c8));var _0xcad1=function(_0x1eda20,_0x1149f4){_0x1eda20=_0x1eda20-0x0;var _0x31b953=_0xad1c[_0x1eda20];return _0x31b953;};'use strict';var utils=require('./utils');var logger=require(_0xcad1('0x0'))('routing');exports['consequence']=function(_0x3273cb,_0x1db454){return function(_0x28e8e8){try{logger[_0xcad1('0x1')](_0xcad1('0x2'),_0x3273cb,utils[_0xcad1('0x3')](_0x1db454[0x0],this));_0x28e8e8['next']();}catch(_0x4cc5ba){logger['error']('[%s][NOOP]\x20%s',_0x3273cb,JSON['stringify'](_0x4cc5ba));_0x28e8e8[_0xcad1('0x4')]();}};}; \ 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 c3be98f..2e3a07d 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 _0x691a=['[%s][QUEUE]\x20ROUTING\x20STOPPED','close','rules','stop','[%s][QUEUE]\x20APPLICATION\x20END','next','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','lodash','util','seq-queue','moment','../../../../config/environment','../../../../config/logger','./strategy','defaults','redis','localhost','queue_id','account','queue','from','joinAt','clone','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/whatsappQueueReport','string','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','list','upperFirst','channel','QueueId','InteractionId','interaction','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','[%s][QUEUE]\x20%s','map','join','Queues','createQueue','atimeout','qtimeout','end'];(function(_0x3b7f94,_0x4815db){var _0x5ba12f=function(_0x380d2f){while(--_0x380d2f){_0x3b7f94['push'](_0x3b7f94['shift']());}};_0x5ba12f(++_0x4815db);}(_0x691a,0xfb));var _0xa691=function(_0x3e277e,_0x2ca76c){_0x3e277e=_0x3e277e-0x0;var _0x383619=_0x691a[_0x3e277e];return _0x383619;};'use strict';var schema=require(_0xa691('0x0'));var _=require(_0xa691('0x1'));var util=require(_0xa691('0x2'));var seqqueue=require(_0xa691('0x3'));var moment=require(_0xa691('0x4'));var Redis=require('ioredis');var config=require(_0xa691('0x5'));var logger=require(_0xa691('0x6'))('routing');var strategy=require(_0xa691('0x7'));config['redis']=_[_0xa691('0x8')](config[_0xa691('0x9')],{'host':_0xa691('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa691('0x9')]));var attributes=['id',_0xa691('0xb'),_0xa691('0xc'),_0xa691('0xd'),_0xa691('0xe'),_0xa691('0xf')];function emit(_0x41a061,_0xa0d2d7,_0x2bed93){io['to'](_0x41a061)['emit'](_0xa0d2d7,_0x2bed93);}function emitChannelQueueInteraction(_0x5d485d,_0x41a438,_0x378dd2,_0x1ae17f,_0x5c712a,_0x4ae99a,_0x17d983,_0x4273b8){var _0x46e416=_[_0xa691('0x10')](_0x378dd2);_0x46e416[_0xa691('0xb')]=_0x4273b8;_0x46e416[_0xa691('0xd')]=_0x41a438;_0x46e416[_0xa691('0xc')]=_0x1ae17f;_0x46e416['id']=_0x5c712a;if(_0x4ae99a){_0x17d983[util[_0xa691('0x11')](_0xa691('0x12'),_0x5d485d)][_0x5c712a]=_[_0xa691('0x13')](_0x46e416,attributes);}else{delete _0x17d983[util[_0xa691('0x11')](_0xa691('0x12'),_0x5d485d)][_0x5c712a];}emit(util[_0xa691('0x11')](_0xa691('0x14'),_0x5d485d,_0x41a438),util[_0xa691('0x11')](_0xa691('0x15'),_0x5d485d,_0x4ae99a?_0xa691('0x16'):_0xa691('0x17')),_[_0xa691('0x13')](_0x46e416,attributes));}var rpc={'openchannelQueueReport':require(_0xa691('0x18')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0xa691('0x19')),'smsQueueReport':require(_0xa691('0x1a')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require(_0xa691('0x1b'))};var queue=schema({'name':{'type':_0xa691('0x1c'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0xa691('0x1d'),'message':_0xa691('0x1e')}});function startRouting(_0x19d173,_0x7d3302,_0x107710,_0x26361a){if(_0x19d173&&_0x7d3302&&_0x107710){_0x7d3302[_0xa691('0x1f')]+=0x1;var _0x263802={'uniqueid':_0x19d173,'from':_0x107710[_0xa691('0x20')]?_0x107710['body'][_0xa691('0xe')]:'','joinAt':moment()[_0xa691('0x11')](_0xa691('0x21')),'ContactId':_0x107710['contact']?_0x107710['contact']['id']:null,'ListId':_0x107710[_0xa691('0x22')]?_0x107710[_0xa691('0x22')]['id']:null};_0x263802[_[_0xa691('0x23')](_0x107710[_0xa691('0x24')])+_0xa691('0x25')]=_0x7d3302['id']||null;_0x263802[_['upperFirst'](_0x107710[_0xa691('0x24')])+_0xa691('0x26')]=_0x107710['interaction']?_0x107710[_0xa691('0x27')]['id']:null;_0x263802[_['upperFirst'](_0x107710[_0xa691('0x24')])+_0xa691('0x28')]=_0x107710['message']?_0x107710[_0xa691('0x29')]['id']:null;_0x263802[_[_0xa691('0x23')](_0x107710[_0xa691('0x24')])+(_0x107710[_0xa691('0x24')]!==_0xa691('0x2a')?_0xa691('0x2b'):_0xa691('0x2c'))]=_0x107710[_0xa691('0xc')]?_0x107710[_0xa691('0xc')]['id']:null;logger[_0xa691('0x2d')](util[_0xa691('0x11')](_0xa691('0x2e'),_0x19d173,_0x7d3302[_0xa691('0x2f')]));emitChannelQueueInteraction(_0x107710[_0xa691('0x24')],_0x7d3302[_0xa691('0x2f')],_0x263802,_0x107710[_0xa691('0xc')][_0xa691('0x2f')],_0x107710[_0xa691('0x29')]['id'],!![],_0x26361a,_0x7d3302['id']);if(rpc[_0x107710['channel']+_0xa691('0x30')]){return rpc[_0x107710['channel']+_0xa691('0x30')][_0xa691('0x31')](_0x263802)[_0xa691('0x32')](function(_0x15f6a7){logger[_0xa691('0x33')](_0xa691('0x34'));});}}}function stopRouting(_0x92ef7d,_0x1e1f15,_0xaa4a07,_0x9aa10b){if(_0x92ef7d&&_0x1e1f15){_0x1e1f15[_0xa691('0x1f')]-=0x1;var _0x576ddf={'leaveAt':moment()['format'](_0xa691('0x21')),'acceptAt':moment()[_0xa691('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xa691('0x35')};logger['info'](util[_0xa691('0x11')](_0xa691('0x36'),_0x92ef7d,_0x1e1f15[_0xa691('0x2f')]));emitChannelQueueInteraction(_0xaa4a07[_0xa691('0x24')],_0x1e1f15[_0xa691('0x2f')],_0xaa4a07['body'],_0xaa4a07[_0xa691('0xc')][_0xa691('0x2f')],_0xaa4a07[_0xa691('0x29')]['id'],![],_0x9aa10b,_0x1e1f15['id']);if(rpc[_0xaa4a07[_0xa691('0x24')]+_0xa691('0x30')]){return rpc[_0xaa4a07[_0xa691('0x24')]+_0xa691('0x30')][_0xa691('0x37')](_0x92ef7d,_0x576ddf)['catch'](function(_0x39a4d1){logger[_0xa691('0x33')](_0xa691('0x38'));});}}}function endRouting(_0x49f671,_0x5c4028,_0x5086fa,_0x29cfa9){if(_0x49f671&&_0x5c4028){_0x5c4028[_0xa691('0x1f')]-=0x1;var _0x209f7c={'leaveAt':moment()[_0xa691('0x11')](_0xa691('0x21')),'exitAt':moment()[_0xa691('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xa691('0x39')};logger[_0xa691('0x2d')](util['format'](_0xa691('0x3a'),_0x49f671,_0x5c4028['name']));emitChannelQueueInteraction(_0x5086fa['channel'],_0x5c4028['name'],_0x5086fa['body'],_0x5086fa[_0xa691('0xc')][_0xa691('0x2f')],_0x5086fa[_0xa691('0x29')]['id'],![],_0x29cfa9);if(rpc[_0x5086fa['channel']+_0xa691('0x30')]){return rpc[_0x5086fa[_0xa691('0x24')]+'QueueReport']['update'](_0x49f671,_0x209f7c)['catch'](function(_0xff44dd){logger['error']('update\x20queue\x20report');});}}}function handleFindQueue(_0x513a51){return function(_0x142b24){return _0x142b24[_0xa691('0x2f')][_0xa691('0x3b')]()===_0x513a51[_0xa691('0x3b')]();};}exports[_0xa691('0x3c')]=function(_0x43a017,_0x40d6c8,_0x4f1459,_0x1e200b){return function(_0x27fb2a){try{var _0x17b15f={'name':_0x40d6c8[0x0],'timeout':_0x40d6c8[0x1]};var _0x48bb04=queue[_0xa691('0x0')](_0x17b15f,{'typecast':!![]});if(_0x48bb04['length']){logger['error'](_0xa691('0x3d'),_0x43a017,_[_0xa691('0x3e')](_0x48bb04,_0xa691('0x29'))[_0xa691('0x3f')](',\x20'));_0x27fb2a['stop']();}else{var _0x2d3727=_['find'](_0x4f1459[_0x1e200b['channel']+_0xa691('0x40')],handleFindQueue(_0x17b15f[_0xa691('0x2f')]));if(_0x2d3727){startRouting(_0x43a017,_0x2d3727,_0x1e200b,_0x4f1459);var _0x45542d=(_0x2d3727[_0xa691('0x39')]||0xa)*0x3e8;var _0x4439ef=(_0x17b15f[_0xa691('0x39')]||0x14)*0x3e8;var _0x356a7a,_0x10153b;if(_0x45542d>_0x4439ef){_0x4439ef=_0x45542d;}var _0x153620=seqqueue[_0xa691('0x41')](_0x45542d);_0x153620['id']=_0x43a017;_0x153620[_0xa691('0x42')]=_0x45542d;_0x153620[_0xa691('0x43')]=_0x4439ef;_0x153620[_0xa691('0x24')]=_0x1e200b[_0xa691('0x24')];_0x4f1459['rules'][_0x43a017]['on'](_0xa691('0x44'),function(){logger[_0xa691('0x2d')](_0xa691('0x45'),_0x43a017);stopRouting(_0x43a017,_0x2d3727,_0x1e200b,_0x4f1459);clearTimeout(_0x356a7a);_0x356a7a=undefined;_0x153620[_0xa691('0x46')](!![]);if(_0x4f1459[_0xa691('0x47')][_0x43a017]){delete _0x4f1459[_0xa691('0x47')][_0x43a017];}_0x27fb2a[_0xa691('0x48')]();});_0x4f1459[_0xa691('0x47')][_0x43a017]['on']('complete',function(){if(_0x4f1459['rules'][_0x43a017]){delete _0x4f1459['rules'][_0x43a017];}});_0x356a7a=setTimeout(function(){logger['info'](_0xa691('0x49'),_0x43a017);endRouting(_0x43a017,_0x2d3727,_0x1e200b,_0x4f1459);clearTimeout(_0x356a7a);_0x153620['close'](!![]);_0x27fb2a[_0xa691('0x4a')]();},_0x4439ef);switch(_0x2d3727['strategy']){case _0xa691('0x4b'):strategy[_0xa691('0x4b')](_0x153620,_0x2d3727,_0x4f1459,_0x1e200b);break;default:strategy[_0xa691('0x4c')](_0x153620,_0x2d3727,_0x4f1459,_0x1e200b);}}else{logger['error'](_0xa691('0x4d'),_0x43a017,_0x17b15f[_0xa691('0x2f')]);_0x27fb2a[_0xa691('0x48')]();}}}catch(_0x8392bf){console[_0xa691('0x4e')](_0x8392bf);logger[_0xa691('0x33')](_0xa691('0x3d'),_0x43a017,_0x8392bf[_0xa691('0x4f')]);_0x27fb2a['stop']();}};}; \ No newline at end of file +var _0x81e8=['%sQueuesWaitingInteractions','pick','%s:queue:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','number','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','interaction','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','create\x20queue\x20report','waiting','accepted','update','catch','error','update\x20queue\x20report','[%s][END:QUEUE][NAME:%s]','length','[%s][QUEUE]\x20%s','join','stop','find','timeout','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','socket.io-emitter','account','queue','from','joinAt','emit','clone','format'];(function(_0x5a7aad,_0x256674){var _0x459885=function(_0x6b02f9){while(--_0x6b02f9){_0x5a7aad['push'](_0x5a7aad['shift']());}};_0x459885(++_0x256674);}(_0x81e8,0x1db));var _0x881e=function(_0x54a894,_0x49ef1b){_0x54a894=_0x54a894-0x0;var _0x124aa3=_0x81e8[_0x54a894];return _0x124aa3;};'use strict';var schema=require('validate');var _=require('lodash');var util=require(_0x881e('0x0'));var seqqueue=require(_0x881e('0x1'));var moment=require(_0x881e('0x2'));var Redis=require(_0x881e('0x3'));var config=require(_0x881e('0x4'));var logger=require(_0x881e('0x5'))(_0x881e('0x6'));var strategy=require('./strategy');config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x881e('0x7'))(new Redis(config['redis']));var attributes=['id','queue_id',_0x881e('0x8'),_0x881e('0x9'),_0x881e('0xa'),_0x881e('0xb')];function emit(_0x499f80,_0xf44d27,_0x2db310){io['to'](_0x499f80)[_0x881e('0xc')](_0xf44d27,_0x2db310);}function emitChannelQueueInteraction(_0x21c0e3,_0x160470,_0x114915,_0x264f29,_0xcb74fd,_0x5e4f9e,_0x4b8ff9,_0x47b9b9){var _0xe06af6=_[_0x881e('0xd')](_0x114915);_0xe06af6['queue_id']=_0x47b9b9;_0xe06af6[_0x881e('0x9')]=_0x160470;_0xe06af6[_0x881e('0x8')]=_0x264f29;_0xe06af6['id']=_0xcb74fd;if(_0x5e4f9e){_0x4b8ff9[util[_0x881e('0xe')](_0x881e('0xf'),_0x21c0e3)][_0xcb74fd]=_[_0x881e('0x10')](_0xe06af6,attributes);}else{delete _0x4b8ff9[util[_0x881e('0xe')](_0x881e('0xf'),_0x21c0e3)][_0xcb74fd];}emit(util[_0x881e('0xe')](_0x881e('0x11'),_0x21c0e3,_0x160470),util[_0x881e('0xe')]('%s_queue_waiting_interaction:%s',_0x21c0e3,_0x5e4f9e?_0x881e('0x12'):_0x881e('0x13')),_[_0x881e('0x10')](_0xe06af6,attributes));}var rpc={'openchannelQueueReport':require(_0x881e('0x14')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0x881e('0x15')),'smsQueueReport':require(_0x881e('0x16')),'faxQueueReport':require(_0x881e('0x17')),'whatsappQueueReport':require(_0x881e('0x18'))};var queue=schema({'name':{'type':_0x881e('0x19'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x881e('0x1a'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x310ed3,_0x240906,_0x214847,_0x32c90f){if(_0x310ed3&&_0x240906&&_0x214847){_0x240906['waiting']+=0x1;var _0x36b30={'uniqueid':_0x310ed3,'from':_0x214847[_0x881e('0x1b')]?_0x214847[_0x881e('0x1b')]['from']:'','joinAt':moment()[_0x881e('0xe')](_0x881e('0x1c')),'ContactId':_0x214847['contact']?_0x214847[_0x881e('0x1d')]['id']:null,'ListId':_0x214847[_0x881e('0x1e')]?_0x214847[_0x881e('0x1e')]['id']:null};_0x36b30[_[_0x881e('0x1f')](_0x214847[_0x881e('0x20')])+_0x881e('0x21')]=_0x240906['id']||null;_0x36b30[_[_0x881e('0x1f')](_0x214847[_0x881e('0x20')])+'InteractionId']=_0x214847[_0x881e('0x22')]?_0x214847['interaction']['id']:null;_0x36b30[_[_0x881e('0x1f')](_0x214847[_0x881e('0x20')])+_0x881e('0x23')]=_0x214847[_0x881e('0x24')]?_0x214847[_0x881e('0x24')]['id']:null;_0x36b30[_['upperFirst'](_0x214847['channel'])+(_0x214847[_0x881e('0x20')]!==_0x881e('0x25')?_0x881e('0x26'):_0x881e('0x27'))]=_0x214847[_0x881e('0x8')]?_0x214847['account']['id']:null;logger[_0x881e('0x28')](util[_0x881e('0xe')](_0x881e('0x29'),_0x310ed3,_0x240906[_0x881e('0x2a')]));emitChannelQueueInteraction(_0x214847['channel'],_0x240906[_0x881e('0x2a')],_0x36b30,_0x214847['account']['name'],_0x214847[_0x881e('0x24')]['id'],!![],_0x32c90f,_0x240906['id']);if(rpc[_0x214847[_0x881e('0x20')]+_0x881e('0x2b')]){return rpc[_0x214847[_0x881e('0x20')]+_0x881e('0x2b')][_0x881e('0x2c')](_0x36b30)['catch'](function(_0x54f24f){logger['error'](_0x881e('0x2d'));});}}}function stopRouting(_0x227df6,_0x1b8d6f,_0x57094e,_0x5840bb){if(_0x227df6&&_0x1b8d6f){_0x1b8d6f[_0x881e('0x2e')]-=0x1;var _0x2b3b3a={'leaveAt':moment()[_0x881e('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0x881e('0xe')](_0x881e('0x1c')),'reason':_0x881e('0x2f')};logger[_0x881e('0x28')](util[_0x881e('0xe')]('[%s][STOP:QUEUE][NAME:%s]',_0x227df6,_0x1b8d6f[_0x881e('0x2a')]));emitChannelQueueInteraction(_0x57094e[_0x881e('0x20')],_0x1b8d6f[_0x881e('0x2a')],_0x57094e[_0x881e('0x1b')],_0x57094e[_0x881e('0x8')][_0x881e('0x2a')],_0x57094e[_0x881e('0x24')]['id'],![],_0x5840bb,_0x1b8d6f['id']);if(rpc[_0x57094e['channel']+'QueueReport']){return rpc[_0x57094e[_0x881e('0x20')]+_0x881e('0x2b')][_0x881e('0x30')](_0x227df6,_0x2b3b3a)[_0x881e('0x31')](function(_0x373ef8){logger[_0x881e('0x32')](_0x881e('0x33'));});}}}function endRouting(_0x1d98f3,_0x182f5d,_0x51198a,_0x553c23){if(_0x1d98f3&&_0x182f5d){_0x182f5d[_0x881e('0x2e')]-=0x1;var _0x369c07={'leaveAt':moment()[_0x881e('0xe')](_0x881e('0x1c')),'exitAt':moment()[_0x881e('0xe')](_0x881e('0x1c')),'reason':'timeout'};logger[_0x881e('0x28')](util[_0x881e('0xe')](_0x881e('0x34'),_0x1d98f3,_0x182f5d[_0x881e('0x2a')]));emitChannelQueueInteraction(_0x51198a[_0x881e('0x20')],_0x182f5d[_0x881e('0x2a')],_0x51198a[_0x881e('0x1b')],_0x51198a['account']['name'],_0x51198a[_0x881e('0x24')]['id'],![],_0x553c23);if(rpc[_0x51198a[_0x881e('0x20')]+'QueueReport']){return rpc[_0x51198a['channel']+_0x881e('0x2b')][_0x881e('0x30')](_0x1d98f3,_0x369c07)[_0x881e('0x31')](function(_0x355542){logger[_0x881e('0x32')]('update\x20queue\x20report');});}}}function handleFindQueue(_0x41012e){return function(_0x429753){return _0x429753[_0x881e('0x2a')]['toLowerCase']()===_0x41012e['toLowerCase']();};}exports['consequence']=function(_0x518782,_0x2c04d1,_0x221980,_0x35afa4){return function(_0x280a37){try{var _0x15589f={'name':_0x2c04d1[0x0],'timeout':_0x2c04d1[0x1]};var _0x2a7329=queue['validate'](_0x15589f,{'typecast':!![]});if(_0x2a7329[_0x881e('0x35')]){logger[_0x881e('0x32')](_0x881e('0x36'),_0x518782,_['map'](_0x2a7329,_0x881e('0x24'))[_0x881e('0x37')](',\x20'));_0x280a37[_0x881e('0x38')]();}else{var _0x5a8504=_[_0x881e('0x39')](_0x221980[_0x35afa4[_0x881e('0x20')]+'Queues'],handleFindQueue(_0x15589f[_0x881e('0x2a')]));if(_0x5a8504){startRouting(_0x518782,_0x5a8504,_0x35afa4,_0x221980);var _0x14ed57=(_0x5a8504[_0x881e('0x3a')]||0xa)*0x3e8;var _0x354bde=(_0x15589f[_0x881e('0x3a')]||0x14)*0x3e8;var _0x4ab1c9,_0x1610c4;if(_0x14ed57>_0x354bde){_0x354bde=_0x14ed57;}var _0x495395=seqqueue[_0x881e('0x3b')](_0x14ed57);_0x495395['id']=_0x518782;_0x495395[_0x881e('0x3c')]=_0x14ed57;_0x495395[_0x881e('0x3d')]=_0x354bde;_0x495395[_0x881e('0x20')]=_0x35afa4[_0x881e('0x20')];_0x221980[_0x881e('0x3e')][_0x518782]['on'](_0x881e('0x3f'),function(){logger[_0x881e('0x28')](_0x881e('0x40'),_0x518782);stopRouting(_0x518782,_0x5a8504,_0x35afa4,_0x221980);clearTimeout(_0x4ab1c9);_0x4ab1c9=undefined;_0x495395[_0x881e('0x41')](!![]);if(_0x221980[_0x881e('0x3e')][_0x518782]){delete _0x221980['rules'][_0x518782];}_0x280a37[_0x881e('0x38')]();});_0x221980['rules'][_0x518782]['on']('complete',function(){if(_0x221980[_0x881e('0x3e')][_0x518782]){delete _0x221980[_0x881e('0x3e')][_0x518782];}});_0x4ab1c9=setTimeout(function(){logger[_0x881e('0x28')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x518782);endRouting(_0x518782,_0x5a8504,_0x35afa4,_0x221980);clearTimeout(_0x4ab1c9);_0x495395['close'](!![]);_0x280a37['next']();},_0x354bde);switch(_0x5a8504[_0x881e('0x42')]){case _0x881e('0x43'):strategy[_0x881e('0x43')](_0x495395,_0x5a8504,_0x221980,_0x35afa4);break;default:strategy[_0x881e('0x44')](_0x495395,_0x5a8504,_0x221980,_0x35afa4);}}else{logger[_0x881e('0x32')](_0x881e('0x45'),_0x518782,_0x15589f[_0x881e('0x2a')]);_0x280a37['stop']();}}}catch(_0x113846){console['log'](_0x113846);logger['error'](_0x881e('0x36'),_0x518782,_0x113846['stack']);_0x280a37[_0x881e('0x38')]();}};}; \ 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 c9cffdf..45e8fe9 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 _0xe570=['busyQueue','showNotification','writeLog','hideNotification','busy','STOP','TIMEOUT','uuid','../../../../../config/logger','routing','notificationId','squeue','push','handleRun','handleTimeout','timeout','bind','drained','prototype','handleDrained','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','realtime','agents','agent','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel'];(function(_0x50a561,_0x268a0e){var _0x15407e=function(_0x2a1442){while(--_0x2a1442){_0x50a561['push'](_0x50a561['shift']());}};_0x15407e(++_0x268a0e);}(_0xe570,0x1ab));var _0x0e57=function(_0x176845,_0x58f338){_0x176845=_0x176845-0x0;var _0x289308=_0xe570[_0x176845];return _0x289308;};'use strict';var _=require('lodash');var uuid=require(_0x0e57('0x0'));var util=require('./util');var logger=require(_0x0e57('0x1'))(_0x0e57('0x2'));var Agent=function(_0x2f2726,_0x38ed05,_0x448f42,_0x3155ee){this[_0x0e57('0x3')]=uuid['v4']();this[_0x0e57('0x4')]=_0x2f2726;this['agent']=_0x38ed05;this['realtime']=_0x448f42;this[_0x0e57('0x2')]=_0x3155ee;this[_0x0e57('0x4')][_0x0e57('0x5')](this[_0x0e57('0x6')]['bind'](this),this[_0x0e57('0x7')]['bind'](this));this[_0x0e57('0x4')]['on'](_0x0e57('0x8'),this[_0x0e57('0x7')][_0x0e57('0x9')](this));this[_0x0e57('0x4')]['on'](_0x0e57('0xa'),this['handleDrained'][_0x0e57('0x9')](this));};Agent[_0x0e57('0xb')]['push']=function(){this[_0x0e57('0x4')][_0x0e57('0x5')](this['handleRun'][_0x0e57('0x9')](this),this['handleTimeout']['bind'](this));};Agent[_0x0e57('0xb')][_0x0e57('0xc')]=function(){this[_0x0e57('0x7')](!![]);};Agent[_0x0e57('0xb')]['handleRun']=function(_0x1af835){logger[_0x0e57('0xd')](_0x0e57('0xe'),this[_0x0e57('0x4')]['id'],this['agent']['id']);if(_[_0x0e57('0xf')](this[_0x0e57('0x10')][_0x0e57('0x11')][this[_0x0e57('0x12')]['id']])){logger['info'](_0x0e57('0x13'),this['squeue']['id'],this[_0x0e57('0x12')]['id']);setTimeout(this[_0x0e57('0x5')][_0x0e57('0x9')](this),0x3e8);}else{if(this[_0x0e57('0x2')][_0x0e57('0x14')]||util[_0x0e57('0x15')](this['squeue']['id'],this['realtime'][_0x0e57('0x11')][this[_0x0e57('0x12')]['id']],this[_0x0e57('0x4')][_0x0e57('0x16')],![])){this[_0x0e57('0x10')][_0x0e57('0x11')][this['agent']['id']]['busy']=!![];this[_0x0e57('0x10')]['agents'][this[_0x0e57('0x12')]['id']][_0x0e57('0x17')]=undefined;util[_0x0e57('0x18')](this[_0x0e57('0x3')],this[_0x0e57('0x4')]['id'],this['realtime'][_0x0e57('0x11')][this['agent']['id']],null,this[_0x0e57('0x2')]);util[_0x0e57('0x19')](this[_0x0e57('0x4')]['id'],this[_0x0e57('0x10')]['agents'][this[_0x0e57('0x12')]['id']],'RINGING'+(this[_0x0e57('0x2')]['forcedOwnership']?':FORCED':''));}else{logger['info']('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0x0e57('0x4')]['id'],this[_0x0e57('0x12')]['id']);setTimeout(this[_0x0e57('0x5')]['bind'](this),0x3e8);}}};Agent[_0x0e57('0xb')][_0x0e57('0x7')]=function(_0x36ef07){if(_['isNil'](this[_0x0e57('0x10')][_0x0e57('0x11')][this[_0x0e57('0x12')]['id']])){return logger[_0x0e57('0xd')](_0x0e57('0x13'),this[_0x0e57('0x4')]['id'],this['agent']['id']);}else{logger[_0x0e57('0xd')]('[%s][AGENT]\x20timeout\x20with\x20%s',this['squeue']['id'],this[_0x0e57('0x12')]['id']);util[_0x0e57('0x1a')](this[_0x0e57('0x3')],this[_0x0e57('0x4')]['id'],this[_0x0e57('0x10')][_0x0e57('0x11')][this['agent']['id']],null,this[_0x0e57('0x2')]);this['realtime']['agents'][this[_0x0e57('0x12')]['id']][_0x0e57('0x1b')]=![];this[_0x0e57('0x10')][_0x0e57('0x11')][this[_0x0e57('0x12')]['id']][_0x0e57('0x17')]=undefined;util['writeLog'](this[_0x0e57('0x4')]['id'],this[_0x0e57('0x10')][_0x0e57('0x11')][this[_0x0e57('0x12')]['id']],_0x36ef07?_0x0e57('0x1c'):_0x0e57('0x1d'));}if(!_0x36ef07){setTimeout(this['push']['bind'](this),0x3e8);}};function agent(_0x1730a0,_0x3fa477,_0xb01085,_0x1b5cb5){return new Agent(_0x1730a0,_0x3fa477,_0xb01085,_0x1b5cb5);}module['exports']=agent; \ No newline at end of file +var _0x7884=['[%s][AGENT]\x20timeout\x20with\x20%s','busyQueue','writeLog','STOP','exports','lodash','uuid','./util','notificationId','agent','realtime','routing','squeue','handleRun','handleTimeout','bind','timeout','drained','handleDrained','prototype','push','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','isAgentAvailable','channel','busy','showNotification','RINGING','forcedOwnership',':FORCED','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s'];(function(_0x273f77,_0xe5b0cb){var _0x71e147=function(_0x564056){while(--_0x564056){_0x273f77['push'](_0x273f77['shift']());}};_0x71e147(++_0xe5b0cb);}(_0x7884,0x10d));var _0x4788=function(_0x256973,_0x3cdbd4){_0x256973=_0x256973-0x0;var _0x4bf1d8=_0x7884[_0x256973];return _0x4bf1d8;};'use strict';var _=require(_0x4788('0x0'));var uuid=require(_0x4788('0x1'));var util=require(_0x4788('0x2'));var logger=require('../../../../../config/logger')('routing');var Agent=function(_0x33c79f,_0x3052cc,_0xae356,_0xc371f9){this[_0x4788('0x3')]=uuid['v4']();this['squeue']=_0x33c79f;this[_0x4788('0x4')]=_0x3052cc;this[_0x4788('0x5')]=_0xae356;this[_0x4788('0x6')]=_0xc371f9;this[_0x4788('0x7')]['push'](this[_0x4788('0x8')]['bind'](this),this[_0x4788('0x9')][_0x4788('0xa')](this));this['squeue']['on'](_0x4788('0xb'),this['handleTimeout'][_0x4788('0xa')](this));this['squeue']['on'](_0x4788('0xc'),this[_0x4788('0xd')]['bind'](this));};Agent[_0x4788('0xe')][_0x4788('0xf')]=function(){this[_0x4788('0x7')][_0x4788('0xf')](this[_0x4788('0x8')][_0x4788('0xa')](this),this[_0x4788('0x9')][_0x4788('0xa')](this));};Agent[_0x4788('0xe')][_0x4788('0xd')]=function(){this[_0x4788('0x9')](!![]);};Agent[_0x4788('0xe')][_0x4788('0x8')]=function(_0x4a8072){logger[_0x4788('0x10')](_0x4788('0x11'),this[_0x4788('0x7')]['id'],this['agent']['id']);if(_[_0x4788('0x12')](this[_0x4788('0x5')][_0x4788('0x13')][this[_0x4788('0x4')]['id']])){logger['info']('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x4788('0x7')]['id'],this[_0x4788('0x4')]['id']);setTimeout(this[_0x4788('0xf')][_0x4788('0xa')](this),0x3e8);}else{if(this[_0x4788('0x6')]['forcedOwnership']||util[_0x4788('0x14')](this[_0x4788('0x7')]['id'],this['realtime'][_0x4788('0x13')][this[_0x4788('0x4')]['id']],this[_0x4788('0x7')][_0x4788('0x15')],![])){this[_0x4788('0x5')]['agents'][this['agent']['id']][_0x4788('0x16')]=!![];this[_0x4788('0x5')][_0x4788('0x13')][this[_0x4788('0x4')]['id']]['busyQueue']=undefined;util[_0x4788('0x17')](this[_0x4788('0x3')],this[_0x4788('0x7')]['id'],this['realtime'][_0x4788('0x13')][this[_0x4788('0x4')]['id']],null,this[_0x4788('0x6')]);util['writeLog'](this[_0x4788('0x7')]['id'],this[_0x4788('0x5')]['agents'][this[_0x4788('0x4')]['id']],_0x4788('0x18')+(this[_0x4788('0x6')][_0x4788('0x19')]?_0x4788('0x1a'):''));}else{logger[_0x4788('0x10')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0x4788('0x7')]['id'],this['agent']['id']);setTimeout(this[_0x4788('0xf')][_0x4788('0xa')](this),0x3e8);}}};Agent[_0x4788('0xe')][_0x4788('0x9')]=function(_0x85cbaa){if(_[_0x4788('0x12')](this[_0x4788('0x5')][_0x4788('0x13')][this[_0x4788('0x4')]['id']])){return logger[_0x4788('0x10')](_0x4788('0x1b'),this[_0x4788('0x7')]['id'],this[_0x4788('0x4')]['id']);}else{logger['info'](_0x4788('0x1c'),this[_0x4788('0x7')]['id'],this[_0x4788('0x4')]['id']);util['hideNotification'](this['notificationId'],this[_0x4788('0x7')]['id'],this[_0x4788('0x5')][_0x4788('0x13')][this[_0x4788('0x4')]['id']],null,this['routing']);this[_0x4788('0x5')][_0x4788('0x13')][this[_0x4788('0x4')]['id']][_0x4788('0x16')]=![];this[_0x4788('0x5')]['agents'][this[_0x4788('0x4')]['id']][_0x4788('0x1d')]=undefined;util[_0x4788('0x1e')](this[_0x4788('0x7')]['id'],this[_0x4788('0x5')][_0x4788('0x13')][this['agent']['id']],_0x85cbaa?_0x4788('0x1f'):'TIMEOUT');}if(!_0x85cbaa){setTimeout(this[_0x4788('0xf')][_0x4788('0xa')](this),0x3e8);}};function agent(_0x1fbd0c,_0x10d6c7,_0x4a5b50,_0x115f0a){return new Agent(_0x1fbd0c,_0x10d6c7,_0x4a5b50,_0x115f0a);}module[_0x4788('0x20')]=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 38525cd..9e31bc3 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 _0x51f2=['../../../../../config/logger','routing','squeue','queue','realtime','handleRun','bind','handleTimeout','timeout','handleDrained','prototype','push','isNil','Agents','length','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','agents','busyQueue','name','showNotification','notificationId','info','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification','writeLog','STOP','TIMEOUT','busy','exports','lodash','uuid','./util'];(function(_0x5ce03b,_0x3e523d){var _0x33869e=function(_0x23eb4a){while(--_0x23eb4a){_0x5ce03b['push'](_0x5ce03b['shift']());}};_0x33869e(++_0x3e523d);}(_0x51f2,0xeb));var _0x251f=function(_0x3ef1a1,_0x166380){_0x3ef1a1=_0x3ef1a1-0x0;var _0x587770=_0x51f2[_0x3ef1a1];return _0x587770;};'use strict';var _=require(_0x251f('0x0'));var uuid=require(_0x251f('0x1'));var util=require(_0x251f('0x2'));var logger=require(_0x251f('0x3'))(_0x251f('0x4'));var Beepall=function(_0x243816,_0x1d0c48,_0xb17464,_0x1dd1c9){this['notificationId']=uuid['v4']();this[_0x251f('0x5')]=_0x243816;this[_0x251f('0x6')]=_0x1d0c48;this[_0x251f('0x7')]=_0xb17464;this[_0x251f('0x4')]=_0x1dd1c9;this[_0x251f('0x5')]['push'](this[_0x251f('0x8')][_0x251f('0x9')](this),this[_0x251f('0xa')][_0x251f('0x9')](this));this['squeue']['on'](_0x251f('0xb'),this[_0x251f('0xa')][_0x251f('0x9')](this));this[_0x251f('0x5')]['on']('drained',this[_0x251f('0xc')][_0x251f('0x9')](this));};Beepall[_0x251f('0xd')][_0x251f('0xe')]=function(){this['squeue'][_0x251f('0xe')](this[_0x251f('0x8')][_0x251f('0x9')](this),this[_0x251f('0xa')][_0x251f('0x9')](this));};Beepall[_0x251f('0xd')][_0x251f('0xc')]=function(_0x2d1d3a){this[_0x251f('0xa')](!![]);};Beepall[_0x251f('0xd')][_0x251f('0x8')]=function(_0x575ee5){var _0x1f6333=!![];if(!_[_0x251f('0xf')](this['queue'])&&!_[_0x251f('0xf')](this[_0x251f('0x6')][_0x251f('0x10')])&&this[_0x251f('0x6')][_0x251f('0x10')]['length']>0x0){for(var _0x5d34b2=0x0,_0x27ed41;_0x5d34b20x0){for(var _0x286cf3=0x0,_0x4935db;_0x286cf30x0&&_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 +var _0xc2c7=['redis','localhost','socket.io-emitter','emit','format','user:%s','name','user:save','split','\x20interaction','account','notificationSound','notificationShake','body','queue','getMustacheRender','notificationTemplate','msg','I\x20can\x27t\x20render\x20your\x20template','error','[%s][QUEUE]\x20%s','message','notification:%s','remove','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','online','OFFLINE','Pause','Capacity','hasOwnProperty','CurrentCapacity','toUpperCase','showNotification','hideNotification','writeLog','util','../utils','mustache','ioredis','../../../../../config/environment','../../../../../config/logger','routing'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xc2c7,0x134));var _0x7c2c=function(_0x4248ce,_0x5968e5){_0x4248ce=_0x4248ce-0x0;var _0x498d30=_0xc2c7[_0x4248ce];return _0x498d30;};'use strict';var _=require('lodash');var util=require(_0x7c2c('0x0'));var utils=require(_0x7c2c('0x1'));var Mustache=require(_0x7c2c('0x2'));var Redis=require(_0x7c2c('0x3'));var config=require(_0x7c2c('0x4'));var logger=require(_0x7c2c('0x5'))(_0x7c2c('0x6'));config[_0x7c2c('0x7')]=_['defaults'](config['redis'],{'host':_0x7c2c('0x8'),'port':0x18eb});var io=require(_0x7c2c('0x9'))(new Redis(config[_0x7c2c('0x7')]));function emit(_0x54f027,_0x4abe93,_0x5a1027){io['to'](_0x54f027)[_0x7c2c('0xa')](_0x4abe93,_0x5a1027);}function sendNotification(_0x29638d,_0x3e668f,_0x3b780b,_0x279cff,_0x57b107,_0x3093d2){io['to'](util[_0x7c2c('0xb')](_0x7c2c('0xc'),_0x279cff[_0x7c2c('0xd')]))[_0x7c2c('0xa')](_0x7c2c('0xe'),_0x279cff);var _0x2cb057=_0x3093d2||{};var _0x38fc25=_0x3b780b[_0x7c2c('0xf')]('.');var _0x3e627f={'uniqueid':_0x3e668f,'channel':_0x38fc25[0x0],'id':_0x38fc25[0x1],'title':_0x38fc25[0x0]+_0x7c2c('0x10'),'interactionId':_0x38fc25[0x2],'queue':_0x57b107?_0x57b107[_0x7c2c('0xd')]:null,'sound':_0x2cb057[_0x7c2c('0x11')][_0x7c2c('0x12')],'shake':_0x2cb057[_0x7c2c('0x11')][_0x7c2c('0x13')]};try{if(!_0x2cb057['body']){_0x2cb057['body']={};}if(_0x57b107){_0x2cb057[_0x7c2c('0x14')][_0x7c2c('0x15')]=_0x57b107;}else if(_0x2cb057[_0x7c2c('0x14')]['queue']){delete _0x2cb057[_0x7c2c('0x14')][_0x7c2c('0x15')];}_0x3e627f['msg']=utils[_0x7c2c('0x16')](_0x2cb057['account'][_0x7c2c('0x17')],_0x2cb057);}catch(_0x51b73c){_0x3e627f[_0x7c2c('0x18')]=_0x7c2c('0x19');logger[_0x7c2c('0x1a')](util[_0x7c2c('0xb')](_0x7c2c('0x1b'),_0x3e668f,_0x51b73c[_0x7c2c('0x1c')]));}io['to'](util[_0x7c2c('0xb')](_0x7c2c('0xc'),_0x279cff[_0x7c2c('0xd')]))[_0x7c2c('0xa')](util[_0x7c2c('0xb')](_0x7c2c('0x1d'),_0x29638d?'save':_0x7c2c('0x1e')),_0x3e627f);}function writeLog(_0x4adb62,_0x506d47,_0x15ae33){return logger[_0x7c2c('0x1f')](util[_0x7c2c('0xb')](_0x7c2c('0x20'),_0x4adb62,_0x506d47[_0x7c2c('0xd')],_0x15ae33));}exports[_0x7c2c('0x21')]=function(_0xa84620,_0x541368,_0x10c356,_0x4dedd8){if(_0x541368[_0x7c2c('0x22')]){writeLog(_0xa84620,_0x541368,'BUSY');return![];}if(!_0x541368[_0x7c2c('0x23')]){writeLog(_0xa84620,_0x541368,_0x7c2c('0x24'));return![];}if(_0x541368[_0x10c356+_0x7c2c('0x25')]){writeLog(_0xa84620,_0x541368,'PAUSE');return![];}if(_0x4dedd8&&_0x541368['hasOwnProperty'](_0x10c356+_0x7c2c('0x26'))&&_0x541368[_0x7c2c('0x27')](_0x10c356+_0x7c2c('0x28'))){if(_0x541368[_0x10c356+_0x7c2c('0x26')]>0x0&&_0x541368[_0x10c356+_0x7c2c('0x28')]>=_0x541368[_0x10c356+_0x7c2c('0x26')]){writeLog(_0xa84620,_0x541368,_0x10c356[_0x7c2c('0x29')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0x7c2c('0x2a')]=function(_0xf39941,_0x3b2652,_0x22d03f,_0x145788,_0x1f8846){return sendNotification(!![],_0xf39941,_0x3b2652,_0x22d03f,_0x145788,_0x1f8846);};exports[_0x7c2c('0x2b')]=function(_0x26f472,_0xa040ff,_0x5769ec,_0x465ad6,_0x3a3730){return sendNotification(![],_0x26f472,_0xa040ff,_0x5769ec,_0x465ad6,_0x3a3730);};exports[_0x7c2c('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 4afc1e7..09b8c9c 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 _0x1b6d=['isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','validate','lodash','../../../../config/logger','routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','message','join','info','next','getMustacheRender','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil'];(function(_0x53b4dc,_0x51f549){var _0x3b2b68=function(_0x532722){while(--_0x532722){_0x53b4dc['push'](_0x53b4dc['shift']());}};_0x3b2b68(++_0x51f549);}(_0x1b6d,0x1e6));var _0xd1b6=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x1b6d[_0x27af45];return _0x18df21;};'use strict';var schema=require(_0xd1b6('0x0'));var sh=require('shelljs');var _=require(_0xd1b6('0x1'));var utils=require('./utils');var logger=require(_0xd1b6('0x2'))(_0xd1b6('0x3'));var system=schema({'command':{'type':'string','required':!![],'message':_0xd1b6('0x4')}});exports[_0xd1b6('0x5')]=function(_0x1b5bbd,_0x2752c3){return function(_0x48a273){try{var _0x206666={'command':_0x2752c3[0x0]};var _0x4c053c=system['validate'](_0x206666,{'typecast':!![]});if(_0x4c053c[_0xd1b6('0x6')]){logger[_0xd1b6('0x7')]('[%s][SYSTEM]\x20%s',_0x1b5bbd,_['map'](_0x4c053c,_0xd1b6('0x8'))[_0xd1b6('0x9')](',\x20'));logger[_0xd1b6('0xa')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x1b5bbd);_0x48a273[_0xd1b6('0xb')]();}else{var _0x12149b=this;var _0x20cef7=utils[_0xd1b6('0xc')](_0x2752c3[0x0],this);logger[_0xd1b6('0xa')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x1b5bbd,_0x20cef7);sh[_0xd1b6('0xd')](_[_0xd1b6('0xe')](_0x20cef7),function(_0x55068d,_0x5d0e08){logger['info'](_0xd1b6('0xf'),_0x1b5bbd,_0x55068d);if(_0x55068d==0x0){var _0x3359a7=_0x5d0e08[_0xd1b6('0x10')](/(\r\n|\n|\r)/gm,'');if(_[_0xd1b6('0x11')](_0x2752c3[0x1])||_[_0xd1b6('0x12')](_0x2752c3[0x1])){logger[_0xd1b6('0xa')](_0xd1b6('0x13'),_0x1b5bbd);_0x12149b[_0xd1b6('0x14')][_0x2752c3[0x1]]=_0x3359a7;}else{logger[_0xd1b6('0xa')](_0xd1b6('0x15'),_0x1b5bbd,_0x2752c3[0x1],_0x3359a7);_0x12149b[_0xd1b6('0x14')][_0x2752c3[0x1]]=_0x3359a7;}}_0x48a273[_0xd1b6('0xb')]();});}}catch(_0x1ceb0f){logger['error']('[%s][SYSTEM]\x20%s',_0x1b5bbd,_[_0xd1b6('0x16')](_0x1ceb0f)?JSON[_0xd1b6('0x17')](_0x1ceb0f):_0x1ceb0f);logger[_0xd1b6('0xa')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x1b5bbd);_0x48a273[_0xd1b6('0xb')]();}};}; \ No newline at end of file +var _0xbaae=['string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','map','message','join','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','info','[%s][SYSTEM]\x20commnad:\x20%s','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','isObject','stringify','validate','shelljs','lodash','routing'];(function(_0x1cc3a5,_0x59850b){var _0x4bf8b7=function(_0x3588ff){while(--_0x3588ff){_0x1cc3a5['push'](_0x1cc3a5['shift']());}};_0x4bf8b7(++_0x59850b);}(_0xbaae,0x182));var _0xebaa=function(_0x4847fb,_0x1d282a){_0x4847fb=_0x4847fb-0x0;var _0x27b3ce=_0xbaae[_0x4847fb];return _0x27b3ce;};'use strict';var schema=require(_0xebaa('0x0'));var sh=require(_0xebaa('0x1'));var _=require(_0xebaa('0x2'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0xebaa('0x3'));var system=schema({'command':{'type':_0xebaa('0x4'),'required':!![],'message':_0xebaa('0x5')}});exports[_0xebaa('0x6')]=function(_0xeffa24,_0x33af59){return function(_0x55c77e){try{var _0x39e80f={'command':_0x33af59[0x0]};var _0x25a87b=system[_0xebaa('0x0')](_0x39e80f,{'typecast':!![]});if(_0x25a87b[_0xebaa('0x7')]){logger[_0xebaa('0x8')](_0xebaa('0x9'),_0xeffa24,_[_0xebaa('0xa')](_0x25a87b,_0xebaa('0xb'))[_0xebaa('0xc')](',\x20'));logger['info'](_0xebaa('0xd'),_0xeffa24);_0x55c77e[_0xebaa('0xe')]();}else{var _0x30cc0e=this;var _0xfc08e4=utils['getMustacheRender'](_0x33af59[0x0],this);logger[_0xebaa('0xf')](_0xebaa('0x10'),_0xeffa24,_0xfc08e4);sh['exec'](_[_0xebaa('0x11')](_0xfc08e4),function(_0x261707,_0x5c668b){logger['info'](_0xebaa('0x12'),_0xeffa24,_0x261707);if(_0x261707==0x0){var _0x489624=_0x5c668b[_0xebaa('0x13')](/(\r\n|\n|\r)/gm,'');if(_[_0xebaa('0x14')](_0x33af59[0x1])||_[_0xebaa('0x15')](_0x33af59[0x1])){logger[_0xebaa('0xf')](_0xebaa('0x16'),_0xeffa24);_0x30cc0e[_0xebaa('0x17')][_0x33af59[0x1]]=_0x489624;}else{logger['info']('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0xeffa24,_0x33af59[0x1],_0x489624);_0x30cc0e[_0xebaa('0x17')][_0x33af59[0x1]]=_0x489624;}}_0x55c77e[_0xebaa('0xe')]();});}}catch(_0x2866d6){logger[_0xebaa('0x8')](_0xebaa('0x9'),_0xeffa24,_[_0xebaa('0x18')](_0x2866d6)?JSON[_0xebaa('0x19')](_0x2866d6):_0x2866d6);logger[_0xebaa('0xf')](_0xebaa('0xd'),_0xeffa24);_0x55c77e[_0xebaa('0xe')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tag.js b/server/services/routing/server/applications/tag.js index 4553ca5..be954b5 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 _0x93d3=['lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','[%s][TAG]\x20%s','map','message','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','interaction','then','catch','stringify','finally','error','isObject','validate'];(function(_0x631a3c,_0x1b61b6){var _0x2bdfa3=function(_0x21711b){while(--_0x21711b){_0x631a3c['push'](_0x631a3c['shift']());}};_0x2bdfa3(++_0x1b61b6);}(_0x93d3,0xbc));var _0x393d=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x93d3[_0x8c43de];return _0xa6591b;};'use strict';var schema=require(_0x393d('0x0'));var _=require(_0x393d('0x1'));var rpc={'chatInteraction':require(_0x393d('0x2')),'openchannelInteraction':require(_0x393d('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x393d('0x4')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x393d('0x5'))};var logger=require(_0x393d('0x6'))(_0x393d('0x7'));var tag=schema({'tag':{'type':_0x393d('0x8'),'required':!![],'message':_0x393d('0x9')}});exports[_0x393d('0xa')]=function(_0x6f953c,_0x38581a,_0xdb8504,_0x1e8084){return function(_0x5ef543){try{var _0x31a79c={'tag':_0x38581a[0x0]};var _0x4978f9=tag['validate'](_0x31a79c,{'typecast':!![]});if(_0x4978f9[_0x393d('0xb')]){logger['error'](_0x393d('0xc'),_0x6f953c,_[_0x393d('0xd')](_0x4978f9,_0x393d('0xe'))['join'](',\x20'));logger[_0x393d('0xf')](_0x393d('0x10'),_0x6f953c);_0x5ef543[_0x393d('0x11')]();}else{var _0x113f60={'ids':[_0x38581a[0x0]]};if(rpc[_0x1e8084[_0x393d('0x12')]+_0x393d('0x13')]){rpc[_0x1e8084[_0x393d('0x12')]+'Interaction']['addTags'](_0x1e8084[_0x393d('0x14')]['id'],_0x113f60)[_0x393d('0x15')](function(_0xe61e96){logger[_0x393d('0xf')]('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x6f953c,_0x38581a[0x1],_0x1e8084[_0x393d('0x12')],_0x1e8084[_0x393d('0x14')]['id']);})[_0x393d('0x16')](function(_0x59e43f){logger['error'](_0x393d('0xc'),_0x6f953c,JSON[_0x393d('0x17')](_0x59e43f));logger['info'](_0x393d('0x10'),_0x6f953c);})[_0x393d('0x18')](function(){_0x5ef543[_0x393d('0x11')]();});}}}catch(_0x14c8a9){logger[_0x393d('0x19')](_0x393d('0xc'),_0x6f953c,_[_0x393d('0x1a')](_0x14c8a9)?JSON['stringify'](_0x14c8a9):_0x14c8a9);logger[_0x393d('0xf')](_0x393d('0x10'),_0x6f953c);_0x5ef543[_0x393d('0x11')]();}};}; \ No newline at end of file +var _0x1c4c=['number','length','[%s][TAG]\x20%s','map','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','Interaction','channel','addTags','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','error','stringify','next','isObject','validate','lodash','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing'];(function(_0xc69f39,_0x2ce0cf){var _0x93be41=function(_0xd66056){while(--_0xd66056){_0xc69f39['push'](_0xc69f39['shift']());}};_0x93be41(++_0x2ce0cf);}(_0x1c4c,0x1b2));var _0xc1c4=function(_0x4c7d8b,_0x572388){_0x4c7d8b=_0x4c7d8b-0x0;var _0x187158=_0x1c4c[_0x4c7d8b];return _0x187158;};'use strict';var schema=require(_0xc1c4('0x0'));var _=require(_0xc1c4('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xc1c4('0x2')),'smsInteraction':require(_0xc1c4('0x3')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0xc1c4('0x4')),'whatsappInteraction':require(_0xc1c4('0x5'))};var logger=require(_0xc1c4('0x6'))(_0xc1c4('0x7'));var tag=schema({'tag':{'type':_0xc1c4('0x8'),'required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x42d363,_0x3355a5,_0x2e22d0,_0x57ce47){return function(_0x23e014){try{var _0x262748={'tag':_0x3355a5[0x0]};var _0x39f85b=tag[_0xc1c4('0x0')](_0x262748,{'typecast':!![]});if(_0x39f85b[_0xc1c4('0x9')]){logger['error'](_0xc1c4('0xa'),_0x42d363,_[_0xc1c4('0xb')](_0x39f85b,_0xc1c4('0xc'))[_0xc1c4('0xd')](',\x20'));logger[_0xc1c4('0xe')](_0xc1c4('0xf'),_0x42d363);_0x23e014['next']();}else{var _0x57a677={'ids':[_0x3355a5[0x0]]};if(rpc[_0x57ce47['channel']+_0xc1c4('0x10')]){rpc[_0x57ce47[_0xc1c4('0x11')]+'Interaction'][_0xc1c4('0x12')](_0x57ce47[_0xc1c4('0x13')]['id'],_0x57a677)[_0xc1c4('0x14')](function(_0x49ee2f){logger['info'](_0xc1c4('0x15'),_0x42d363,_0x3355a5[0x1],_0x57ce47['channel'],_0x57ce47[_0xc1c4('0x13')]['id']);})['catch'](function(_0x214bea){logger[_0xc1c4('0x16')](_0xc1c4('0xa'),_0x42d363,JSON[_0xc1c4('0x17')](_0x214bea));logger[_0xc1c4('0xe')](_0xc1c4('0xf'),_0x42d363);})['finally'](function(){_0x23e014[_0xc1c4('0x18')]();});}}}catch(_0x2cde46){logger['error'](_0xc1c4('0xa'),_0x42d363,_[_0xc1c4('0x19')](_0x2cde46)?JSON[_0xc1c4('0x17')](_0x2cde46):_0x2cde46);logger['info'](_0xc1c4('0xf'),_0x42d363);_0x23e014[_0xc1c4('0x18')]();}};}; \ 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 32e2295..6701b1a 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 _0xaa09=['info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','error','[%s][TVOX]\x20%s','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','routing','lodash','consequence','replace','\x20-\x20','includes','push','?params=','urlOnRing','title','2.0','method','params','stringify','utf8','POST','application/json-rpc','then','parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&sessionId=','&data='];(function(_0x11e05d,_0x3a4491){var _0x335588=function(_0x35ec3f){while(--_0x35ec3f){_0x11e05d['push'](_0x11e05d['shift']());}};_0x335588(++_0x3a4491);}(_0xaa09,0x118));var _0x9aa0=function(_0x443259,_0x3b87aa){_0x443259=_0x443259-0x0;var _0x4c8af9=_0xaa09[_0x443259];return _0x4c8af9;};'use strict';var rp=require(_0x9aa0('0x0'));var logger=require('../../../../config/logger')(_0x9aa0('0x1'));var _=require(_0x9aa0('0x2'));var arr=[];exports[_0x9aa0('0x3')]=function(_0x181314,_0x3d134e){return function(_0x7e052){var _0x48677f=_0x3d134e[0xa];var _0x1914e7=_0x3d134e[0xb];var _0x13eae6=_0x3d134e[0xc];var _0x4c5e5e=_0x3d134e[0xd];var _0x4dc623=_0x3d134e[0xe];var _0x547538=_0x3d134e[0xf][_0x9aa0('0x4')](/\n/g,_0x9aa0('0x5'));var _0x367628=_0x3d134e[0x10][_0x9aa0('0x4')](/\n/g,'\x20');if(!arr[_0x9aa0('0x6')](_0x1914e7)){arr[_0x9aa0('0x7')](_0x1914e7);var _0x11f488=_0x3d134e[0x3];var _0x3bd33c=_0x3d134e[0x4];var _0x1b4b22=_0x3d134e[0x1];var _0x488ef7=_0x3d134e[0x0];var _0xedd1db={};_0xedd1db['urlOnAnswer']=_0x3d134e[0x8]+_0x9aa0('0x8')+_0x13eae6+'|'+_0x48677f+'|'+_0x4c5e5e+'|'+_0x1914e7+'|'+_0x4dc623;_0xedd1db[_0x9aa0('0x9')]=_0x3d134e[0x7]+'?params='+_0x13eae6+'|'+_0x48677f+'|'+_0x4c5e5e+'|'+_0x1914e7+'|'+_0x4dc623+'|'+_0x547538+'|'+_0x367628;_0xedd1db[_0x9aa0('0xa')]=_0x3d134e[0x9];var _0x230f6f={};_0x230f6f['jsonrpc']=_0x9aa0('0xb');_0x230f6f[_0x9aa0('0xc')]='login';var _0x5a1ee9=[];_0x5a1ee9[_0x9aa0('0x7')](_0x3d134e[0x2]);_0x5a1ee9[_0x9aa0('0x7')](_0x3d134e[0x5]);_0x5a1ee9[_0x9aa0('0x7')](_0x3d134e[0x6]);_0x230f6f[_0x9aa0('0xd')]=_0x5a1ee9;_0x230f6f['id']=0x1;var _0x33dc07=JSON[_0x9aa0('0xe')](_0x230f6f);var _0x3d4f90={'encoding':_0x9aa0('0xf'),'method':_0x9aa0('0x10'),'timeout':0x2710,'url':_0x11f488,'headers':{'Content-Type':_0x9aa0('0x11')},'body':_0x33dc07};return rp(_0x3d4f90)[_0x9aa0('0x12')](function(_0x19260e){const _0x58ce70=JSON[_0x9aa0('0x13')](_0x19260e);if(!_0x58ce70[_0x9aa0('0x14')][_0x9aa0('0x15')]){throw new Error(_0x9aa0('0x16'));}var _0x2582de=_0x1914e7;var _0x157e1d=_0x9aa0('0x17')+_0x1b4b22+'&serviceId='+_0x488ef7+_0x9aa0('0x18')+_0x2582de+_0x9aa0('0x19')+JSON[_0x9aa0('0xe')](_0xedd1db);var _0x5a2508=_0x3bd33c+'?'+_0x157e1d;return rp(_0x5a2508);})['then'](function(_0x5c0e70){logger[_0x9aa0('0x1a')](_0x9aa0('0x1b'),_0x181314,_0x5c0e70);_0x7e052[_0x9aa0('0x1c')]();})[_0x9aa0('0x1d')](function(_0x2e16a1){logger[_0x9aa0('0x1e')](_0x9aa0('0x1f'),_0x181314,_['isObject'](_0x2e16a1)?JSON[_0x9aa0('0xe')](_0x2e16a1):_0x2e16a1);_0x7e052[_0x9aa0('0x1c')]();});}else{logger[_0x9aa0('0x1a')](_0x9aa0('0x20'),_0x181314);_0x7e052[_0x9aa0('0x21')]();}};}; \ No newline at end of file +var _0xf34b=['title','jsonrpc','method','login','params','POST','parse','result','logged','&serviceId=','&data=','stringify','then','stop','catch','[%s][TVOX]\x20%s','isObject','info','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','routing','consequence','replace','\x20-\x20','includes','push','urlOnAnswer','urlOnRing','?params='];(function(_0x151dee,_0x3f620f){var _0x36879b=function(_0x5a7c23){while(--_0x5a7c23){_0x151dee['push'](_0x151dee['shift']());}};_0x36879b(++_0x3f620f);}(_0xf34b,0xc8));var _0xbf34=function(_0x3dc472,_0x4d510a){_0x3dc472=_0x3dc472-0x0;var _0x2ab231=_0xf34b[_0x3dc472];return _0x2ab231;};'use strict';var rp=require(_0xbf34('0x0'));var logger=require('../../../../config/logger')(_0xbf34('0x1'));var _=require('lodash');var arr=[];exports[_0xbf34('0x2')]=function(_0x1951f3,_0x4e61e1){return function(_0x9b19fa){var _0x42dd65=_0x4e61e1[0xa];var _0x354930=_0x4e61e1[0xb];var _0x407dca=_0x4e61e1[0xc];var _0xf4ece9=_0x4e61e1[0xd];var _0x3ee970=_0x4e61e1[0xe];var _0x594a7f=_0x4e61e1[0xf][_0xbf34('0x3')](/\n/g,_0xbf34('0x4'));var _0xa4d70b=_0x4e61e1[0x10][_0xbf34('0x3')](/\n/g,'\x20');if(!arr[_0xbf34('0x5')](_0x354930)){arr[_0xbf34('0x6')](_0x354930);var _0x485432=_0x4e61e1[0x3];var _0x56ee5c=_0x4e61e1[0x4];var _0x37212f=_0x4e61e1[0x1];var _0x1548c4=_0x4e61e1[0x0];var _0x49ee4e={};_0x49ee4e[_0xbf34('0x7')]=_0x4e61e1[0x8]+'?params='+_0x407dca+'|'+_0x42dd65+'|'+_0xf4ece9+'|'+_0x354930+'|'+_0x3ee970;_0x49ee4e[_0xbf34('0x8')]=_0x4e61e1[0x7]+_0xbf34('0x9')+_0x407dca+'|'+_0x42dd65+'|'+_0xf4ece9+'|'+_0x354930+'|'+_0x3ee970+'|'+_0x594a7f+'|'+_0xa4d70b;_0x49ee4e[_0xbf34('0xa')]=_0x4e61e1[0x9];var _0x4bbb8f={};_0x4bbb8f[_0xbf34('0xb')]='2.0';_0x4bbb8f[_0xbf34('0xc')]=_0xbf34('0xd');var _0x40db9e=[];_0x40db9e[_0xbf34('0x6')](_0x4e61e1[0x2]);_0x40db9e['push'](_0x4e61e1[0x5]);_0x40db9e[_0xbf34('0x6')](_0x4e61e1[0x6]);_0x4bbb8f[_0xbf34('0xe')]=_0x40db9e;_0x4bbb8f['id']=0x1;var _0x777819=JSON['stringify'](_0x4bbb8f);var _0xa75040={'encoding':'utf8','method':_0xbf34('0xf'),'timeout':0x2710,'url':_0x485432,'headers':{'Content-Type':'application/json-rpc'},'body':_0x777819};return rp(_0xa75040)['then'](function(_0x5c86b5){const _0xa9dc99=JSON[_0xbf34('0x10')](_0x5c86b5);if(!_0xa9dc99[_0xbf34('0x11')][_0xbf34('0x12')]){throw new Error('Unable\x20to\x20login\x20with\x20TVox\x20application');}var _0x9fe33b=_0x354930;var _0x494c11='channelId='+_0x37212f+_0xbf34('0x13')+_0x1548c4+'&sessionId='+_0x9fe33b+_0xbf34('0x14')+JSON[_0xbf34('0x15')](_0x49ee4e);var _0x841411=_0x56ee5c+'?'+_0x494c11;return rp(_0x841411);})[_0xbf34('0x16')](function(_0x2f187b){logger['info']('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x1951f3,_0x2f187b);_0x9b19fa[_0xbf34('0x17')]();})[_0xbf34('0x18')](function(_0x91d778){logger['error'](_0xbf34('0x19'),_0x1951f3,_[_0xbf34('0x1a')](_0x91d778)?JSON['stringify'](_0x91d778):_0x91d778);_0x9b19fa[_0xbf34('0x17')]();});}else{logger[_0xbf34('0x1b')](_0xbf34('0x1c'),_0x1951f3);_0x9b19fa[_0xbf34('0x1d')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/utils.js b/server/services/routing/server/applications/utils.js index 5019ed5..f15388f 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 _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x2d7bb1,_0x1f1433){var _0x1695f1=function(_0x45d259){while(--_0x45d259){_0x2d7bb1['push'](_0x2d7bb1['shift']());}};_0x1695f1(++_0x1f1433);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}}; \ No newline at end of file +var _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x538e81,_0x3029e3){var _0x1b139e=function(_0x17c2ab){while(--_0x17c2ab){_0x538e81['push'](_0x538e81['shift']());}};_0x1b139e(++_0x3029e3);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 47d5507..a09e00f 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 _0x3140=['toLowerCase','autoreply','appdata','channel','mail','push','slice','split','amazonlex','TagId','tvox','getMustacheRender','notificationTemplate','ContactId','body','format','condition','intervals','./applications/','consequence','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','Please\x20create\x20a\x20new\x20file\x20under','.js','execute','stringify','matchPath','emit','complete','No\x20applications\x20to\x20execute','stack','error','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','./applications/utils','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','isNil','IntervalId','Intervals','map','interval','listen','rules','message','interaction','applications','length','existsSync','join','app'];(function(_0x510595,_0x408467){var _0x36fdb8=function(_0x16483d){while(--_0x16483d){_0x510595['push'](_0x510595['shift']());}};_0x36fdb8(++_0x408467);}(_0x3140,0xaf));var _0x0314=function(_0x40dc7e,_0x322488){_0x40dc7e=_0x40dc7e-0x0;var _0x31f6d4=_0x3140[_0x40dc7e];return _0x31f6d4;};'use strict';var _=require(_0x0314('0x0'));var util=require(_0x0314('0x1'));var path=require(_0x0314('0x2'));var fs=require('fs');var jayson=require(_0x0314('0x3'));var BPromise=require('bluebird');var uuid=require('uuid');var utils=require(_0x0314('0x4'));var config=require(_0x0314('0x5'));var logger=require(_0x0314('0x6'))(_0x0314('0x7'));var rpc={'openchannelQueueReport':require(_0x0314('0x8')),'mailQueueReport':require(_0x0314('0x9')),'chatQueueReport':require(_0x0314('0xa')),'smsQueueReport':require(_0x0314('0xb')),'faxQueueReport':require(_0x0314('0xc')),'whatsappQueueReport':require(_0x0314('0xd'))};var RuleEngine=require(_0x0314('0xe'));function getId(_0x495b27,_0x26031f,_0x2d87d2){return util['format']('%s.%s.%s',_0x495b27,_0x26031f||0x0,_0x2d87d2||0x0);}function getIntervals(_0xf2561e,_0x4e6545){var _0x17bde3=[];if(!_[_0x0314('0xf')](_0x4e6545[_0x0314('0x10')])&&!_[_0x0314('0xf')](_0xf2561e[_0x4e6545[_0x0314('0x10')]])&&!_[_0x0314('0xf')](_0xf2561e[_0x4e6545['IntervalId']][_0x0314('0x11')])){_0x17bde3=_[_0x0314('0x12')](_0xf2561e[_0x4e6545[_0x0314('0x10')]][_0x0314('0x11')],_0x0314('0x13'));}else if(!_[_0x0314('0xf')](_0x4e6545[_0x0314('0x13')])){_0x17bde3=[_0x4e6545['interval']];}return _0x17bde3;}exports[_0x0314('0x14')]=function(_0xbe0b07){_0xbe0b07[_0x0314('0x15')]={};return new BPromise(function(_0x12d026,_0x40566e){var _0x398c91={'Start':function(_0x413bfa){var _0x3ea356=this;return new Promise(function(_0x5e460f,_0xb9730b){if(_0x413bfa){try{var _0x24cd42=[];var _0x1f23c6=getId(_0x413bfa['channel'],_0x413bfa[_0x0314('0x16')]?_0x413bfa['message']['id']:0x0,_0x413bfa['interaction']?_0x413bfa[_0x0314('0x17')]['id']:0x0);if(_0x413bfa[_0x0314('0x18')]&&_['isArray'](_0x413bfa[_0x0314('0x18')])&&_0x413bfa[_0x0314('0x18')]['length']){for(var _0x1a25cf=0x0;_0x1a25cf<_0x413bfa['applications'][_0x0314('0x19')];_0x1a25cf+=0x1){var _0x41f75e=_0x413bfa[_0x0314('0x18')][_0x1a25cf];if(fs[_0x0314('0x1a')](path[_0x0314('0x1b')](__dirname,_0x0314('0x18'),_0x41f75e['app']+'.js'))){var _0x20305b=[];switch(_0x41f75e[_0x0314('0x1c')][_0x0314('0x1d')]()){case _0x0314('0x1e'):var _0x3ec03d=_0x41f75e[_0x0314('0x1f')]['split'](',');if(_0x413bfa[_0x0314('0x20')]===_0x0314('0x21')){_0x20305b['push'](_0x3ec03d[0x0]);_0x20305b[_0x0314('0x22')](_0x3ec03d[0x1]);_0x20305b[_0x0314('0x22')](_0x3ec03d[_0x0314('0x23')](0x2,_0x3ec03d[_0x0314('0x19')])[_0x0314('0x1b')](','));}else{_0x20305b[_0x0314('0x22')](_0x3ec03d[0x0]);_0x20305b['push'](_0x3ec03d[_0x0314('0x23')](0x1,_0x3ec03d[_0x0314('0x19')])[_0x0314('0x1b')](','));}break;case'dialogflow':var _0x29b4b5=_0x41f75e[_0x0314('0x1f')]['split'](',');_0x20305b['push'](_0x29b4b5[0x0]);_0x20305b[_0x0314('0x22')](_0x29b4b5[0x1]);_0x20305b[_0x0314('0x22')](_0x29b4b5['slice'](0x2,_0x29b4b5[_0x0314('0x19')])[_0x0314('0x1b')](','));break;case'dialogflowv2':var _0x547ab3=_0x41f75e[_0x0314('0x1f')][_0x0314('0x24')](',');_0x20305b['push'](_0x547ab3[0x0]);_0x20305b[_0x0314('0x22')](_0x547ab3[0x1]);_0x20305b[_0x0314('0x22')](_0x547ab3[0x2]);_0x20305b[_0x0314('0x22')](_0x547ab3[0x3]);_0x20305b['push'](_0x547ab3[_0x0314('0x23')](0x4,_0x547ab3[_0x0314('0x19')])[_0x0314('0x1b')](','));break;case _0x0314('0x25'):var _0x549b0b=_0x41f75e[_0x0314('0x1f')]['split'](',');_0x20305b['push'](_0x549b0b[0x0]);_0x20305b[_0x0314('0x22')](_0x549b0b[0x1]);_0x20305b[_0x0314('0x22')](_0x549b0b[0x2]);_0x20305b[_0x0314('0x22')](_0x549b0b[0x3]);_0x20305b['push'](_0x549b0b[_0x0314('0x23')](0x4,_0x549b0b['length'])[_0x0314('0x1b')](','));break;case'message':_0x20305b['push'](_0x41f75e[_0x0314('0x1f')]);break;case'tag':_0x20305b[_0x0314('0x22')](_0x41f75e[_0x0314('0x26')]);_0x20305b[_0x0314('0x22')](_0x41f75e[_0x0314('0x1f')]);break;case _0x0314('0x27'):var _0x1a9ff7=utils[_0x0314('0x28')](_0x413bfa['account'][_0x0314('0x29')],_0x413bfa);var _0x28c6d0=_0x41f75e[_0x0314('0x1f')][_0x0314('0x24')](',');_0x20305b[_0x0314('0x22')](_0x28c6d0[0x0]);_0x20305b[_0x0314('0x22')](_0x28c6d0[0x1]);_0x20305b['push'](_0x28c6d0[0x2]);_0x20305b[_0x0314('0x22')](_0x28c6d0[0x3]);_0x20305b['push'](_0x28c6d0[0x4]);_0x20305b[_0x0314('0x22')](_0x28c6d0[0x5]);_0x20305b['push'](_0x28c6d0[0x6]);_0x20305b[_0x0314('0x22')](_0x28c6d0[0x7]);_0x20305b['push'](_0x28c6d0[0x8]);_0x20305b['push'](_0x28c6d0[0x9]);_0x20305b['push'](_0x28c6d0[0xa]);_0x20305b[_0x0314('0x22')](_0x413bfa[_0x0314('0x17')]['id']);_0x20305b[_0x0314('0x22')](_0x413bfa[_0x0314('0x16')]['id']);_0x20305b[_0x0314('0x22')](_0x41f75e['ChatWebsiteId']);_0x20305b[_0x0314('0x22')](_0x413bfa[_0x0314('0x17')][_0x0314('0x2a')]);_0x20305b['push'](_0x413bfa[_0x0314('0x2b')]['body']);_0x20305b[_0x0314('0x22')](_0x1a9ff7);break;default:_0x20305b=_['isNil'](_0x41f75e[_0x0314('0x1f')])?[]:_0x41f75e['appdata']['split'](',');}var _0x370539={'id':util[_0x0314('0x2c')]('%s:%s:%s',_0x1f23c6,_0x41f75e['id'],_0x41f75e[_0x0314('0x1c')]),'condition':require('./interval')[_0x0314('0x2d')](_0x1f23c6,getIntervals(_0xbe0b07[_0x0314('0x2e')],_0x41f75e),_0xbe0b07),'consequence':require(_0x0314('0x2f')+_0x41f75e[_0x0314('0x1c')])[_0x0314('0x30')](_0x1f23c6,_0x20305b,_0xbe0b07,_0x413bfa),'p':_0x41f75e['priority']||0x0};logger[_0x0314('0x31')](_0x0314('0x32'),_0x370539['id'],_0x0314('0x33'),getIntervals(_0xbe0b07['intervals'],_0x41f75e)[_0x0314('0x1b')](_0x0314('0x34')));_0x24cd42[_0x0314('0x22')](_0x370539);}else{logger['error'](_0x0314('0x35'),path['join'](__dirname,_0x0314('0x18'),_0x41f75e[_0x0314('0x1c')]+_0x0314('0x36')));}}_0xbe0b07['rules'][_0x1f23c6]=new RuleEngine(_0x24cd42);_0xbe0b07[_0x0314('0x15')][_0x1f23c6][_0x0314('0x37')](_0x413bfa,function(_0x588e65){logger['info']('Applications\x20executed',JSON[_0x0314('0x38')](_0x588e65[_0x0314('0x39')]));if(_0xbe0b07[_0x0314('0x15')][_0x1f23c6]){_0xbe0b07['rules'][_0x1f23c6][_0x0314('0x3a')](_0x0314('0x3b'));}});return _0x5e460f({'code':0xc8,'message':_0x413bfa});}else{logger[_0x0314('0x31')](_0x0314('0x3c'));return _0x5e460f({'code':0xc8,'message':_0x413bfa});}}catch(_0x3896cb){logger['error'](_0x3896cb[_0x0314('0x3d')]);return _0xb9730b(_0x3ea356[_0x0314('0x3e')](0x1f4,_0x3896cb));}}return _0xb9730b(_0x0314('0x3f'));});},'AcceptMessage':function(_0x192b74){var _0x1b7292=this;return new Promise(function(_0x209ea9,_0x186181){if(_0x192b74['agent']&&_0x192b74[_0x0314('0x40')]['id']){if(_0xbe0b07[_0x0314('0x41')][_0x192b74['agent']['id']]){_0xbe0b07[_0x0314('0x41')][_0x192b74[_0x0314('0x40')]['id']][_0x0314('0x42')]=![];_0xbe0b07['agents'][_0x192b74['agent']['id']][_0x0314('0x43')]=undefined;}}if(_0x192b74[_0x0314('0x16')]&&_0x192b74[_0x0314('0x16')]['id']){try{var _0x44c467=getId(_0x192b74[_0x0314('0x20')],_0x192b74[_0x0314('0x16')]?_0x192b74[_0x0314('0x16')]['id']:0x0,_0x192b74['interaction']?_0x192b74[_0x0314('0x17')]['id']:0x0);if(_0xbe0b07['rules'][_0x44c467]){_0xbe0b07[_0x0314('0x15')][_0x44c467][_0x0314('0x3a')](_0x0314('0x44'));if(rpc[_0x192b74[_0x0314('0x20')]+_0x0314('0x45')]){rpc[_0x192b74['channel']+'QueueReport'][_0x0314('0x46')](_0x44c467,{'UserId':_0x192b74[_0x0314('0x16')][_0x0314('0x47')]})[_0x0314('0x48')](function(_0x5b3c49){logger[_0x0314('0x3e')](_0x0314('0x49'));});}}return _0x209ea9({'code':0xc8,'message':_0x192b74});}catch(_0x2b601a){logger[_0x0314('0x3e')](_0x2b601a[_0x0314('0x3d')]);return _0x186181(_0x1b7292[_0x0314('0x3e')](0x1f4,_0x2b601a));}}logger[_0x0314('0x3e')]('message\x20is\x20empty');return _0x186181(_0x1b7292[_0x0314('0x3e')](0x1f4,_0x0314('0x4a')));});},'RejectMessage':function(_0x2fed7d){var _0x577a91=this;return new Promise(function(_0x123916,_0x11695d){if(_0x2fed7d['agent']&&_0x2fed7d[_0x0314('0x40')]['id']){try{if(_0xbe0b07[_0x0314('0x41')][_0x2fed7d[_0x0314('0x40')]['id']]){_0xbe0b07[_0x0314('0x41')][_0x2fed7d['agent']['id']][_0x0314('0x42')]=![];_0xbe0b07[_0x0314('0x41')][_0x2fed7d[_0x0314('0x40')]['id']][_0x0314('0x43')]=undefined;}return _0x123916({'code':0xc8,'message':_0x2fed7d});}catch(_0x227ee1){logger[_0x0314('0x3e')](_0x227ee1[_0x0314('0x3d')]);return _0x11695d(_0x577a91[_0x0314('0x3e')](0x1f4,_0x227ee1));}}logger[_0x0314('0x3e')](_0x0314('0x4a'));return _0x11695d(_0x577a91['error'](0x1f4,_0x0314('0x4a')));});},'AbandonInteraction':function(_0x305568){var _0xf29a33=this;return new Promise(function(_0x176b9f,_0x1da12b){if(_0x305568[_0x0314('0x20')]&&_0x305568[_0x0314('0x17')]&&_0x305568['interaction']['id']){try{var _0x5c4e26=getId(_0x305568['channel'],_0x305568[_0x0314('0x16')]?_0x305568[_0x0314('0x16')]['id']:0x0,_0x305568['interaction']?_0x305568[_0x0314('0x17')]['id']:0x0);if(_0xbe0b07[_0x0314('0x15')][_0x5c4e26]){_0xbe0b07[_0x0314('0x15')][_0x5c4e26]['emit']('end');}return _0x176b9f({'code':0xc8,'message':_0x305568});}catch(_0x2e29ce){logger[_0x0314('0x3e')](_0x2e29ce['stack']);return _0x1da12b(_0xf29a33[_0x0314('0x3e')](0x1f4,_0x2e29ce));}}logger['error'](_0x0314('0x4a'));return _0x1da12b(_0xf29a33[_0x0314('0x3e')](0x1f4,_0x0314('0x4a')));});},'AgentCapacity':function(_0x37764f){var _0x4c4420=this;return new Promise(function(_0x9c35f1,_0x3fc295){if(_0xbe0b07[_0x0314('0x41')]['hasOwnProperty'](_0x37764f['id'])){for(var _0x59ae7f in _0x37764f[_0x0314('0x4b')]){if(_0x37764f[_0x0314('0x4b')][_0x0314('0x4c')](_0x59ae7f)){if(_0xbe0b07[_0x0314('0x41')][_0x37764f['id']][_0x0314('0x4c')](_0x59ae7f+_0x0314('0x4d'))){_0xbe0b07['agents'][_0x37764f['id']][_0x59ae7f+_0x0314('0x4d')]=parseInt(_0x37764f['capacity'][_0x59ae7f],0xa);}}}_0xbe0b07['agents'][_0x37764f['id']][_0x0314('0x4e')]();return _0x9c35f1({'code':0xc8,'message':_0xbe0b07['agents'][_0x37764f['id']]});}else{return _0x3fc295(_0x4c4420[_0x0314('0x3e')](0x1f4,_0x0314('0x4f')));}});},'Agents':function(_0x26c174){return new Promise(function(_0x3b25cb,_0x2a7b05){var _0x308985=_[_0x0314('0x50')](_0xbe0b07[_0x0314('0x41')]);_0x3b25cb({'count':_0x308985['length'],'rows':_0x308985});});},'ChatQueues':function(_0x545bd8){return new Promise(function(_0x524fce,_0x277979){var _0xf480fe=[];for(var _0x582451 in _0xbe0b07['chatQueues']){if(_0xbe0b07['chatQueues'][_0x0314('0x4c')](_0x582451)){var _0x17dbb9=_0xbe0b07['chatQueues'][_0x582451];var _0x273dc6={'id':_0x17dbb9['id'],'available':_0x17dbb9[_0x0314('0x51')],'loggedIn':_0x17dbb9[_0x0314('0x52')],'name':_0x17dbb9[_0x0314('0x53')],'paused':_0x17dbb9[_0x0314('0x54')],'waiting':_0x17dbb9[_0x0314('0x55')]};_0xf480fe['push'](_0x273dc6);}}_0x524fce({'count':_0xf480fe[_0x0314('0x19')],'rows':_0xf480fe});});},'MailQueues':function(_0x274845){return new Promise(function(_0x15b523,_0x5a69ac){var _0x1adb61=[];for(var _0x23b551 in _0xbe0b07[_0x0314('0x56')]){if(_0xbe0b07['mailQueues'][_0x0314('0x4c')](_0x23b551)){var _0x1aabca=_0xbe0b07['mailQueues'][_0x23b551];var _0x3cada6={'id':_0x1aabca['id'],'available':_0x1aabca[_0x0314('0x51')],'loggedIn':_0x1aabca[_0x0314('0x52')],'name':_0x1aabca[_0x0314('0x53')],'paused':_0x1aabca[_0x0314('0x54')],'waiting':_0x1aabca['waiting']};_0x1adb61[_0x0314('0x22')](_0x3cada6);}}_0x15b523({'count':_0x1adb61[_0x0314('0x19')],'rows':_0x1adb61});});},'OpenchannelQueues':function(_0x47a93f){return new Promise(function(_0x58f666,_0x186dde){var _0x381a5d=[];for(var _0x30726f in _0xbe0b07[_0x0314('0x57')]){if(_0xbe0b07[_0x0314('0x57')][_0x0314('0x4c')](_0x30726f)){var _0x2c96e1=_0xbe0b07['openchannelQueues'][_0x30726f];var _0x76f0b9={'id':_0x2c96e1['id'],'available':_0x2c96e1[_0x0314('0x51')],'loggedIn':_0x2c96e1[_0x0314('0x52')],'name':_0x2c96e1[_0x0314('0x53')],'paused':_0x2c96e1['paused'],'waiting':_0x2c96e1[_0x0314('0x55')]};_0x381a5d[_0x0314('0x22')](_0x76f0b9);}}_0x58f666({'count':_0x381a5d['length'],'rows':_0x381a5d});});},'SmsQueues':function(_0xf38fa4){return new Promise(function(_0x24a6a5,_0x557eb2){var _0x50f6fa=[];for(var _0x138bf9 in _0xbe0b07[_0x0314('0x58')]){if(_0xbe0b07[_0x0314('0x58')]['hasOwnProperty'](_0x138bf9)){var _0x5f0d0d=_0xbe0b07[_0x0314('0x58')][_0x138bf9];var _0xdb6ce7={'id':_0x5f0d0d['id'],'available':_0x5f0d0d[_0x0314('0x51')],'loggedIn':_0x5f0d0d[_0x0314('0x52')],'name':_0x5f0d0d[_0x0314('0x53')],'paused':_0x5f0d0d['paused'],'waiting':_0x5f0d0d[_0x0314('0x55')]};_0x50f6fa[_0x0314('0x22')](_0xdb6ce7);}}_0x24a6a5({'count':_0x50f6fa[_0x0314('0x19')],'rows':_0x50f6fa});});},'FaxQueues':function(_0x403d3f){return new Promise(function(_0x197653,_0x2f08db){var _0x144929=[];for(var _0x68ac7f in _0xbe0b07[_0x0314('0x59')]){if(_0xbe0b07['faxQueues'][_0x0314('0x4c')](_0x68ac7f)){var _0x1f1464=_0xbe0b07[_0x0314('0x59')][_0x68ac7f];var _0x453bf7={'id':_0x1f1464['id'],'available':_0x1f1464[_0x0314('0x51')],'loggedIn':_0x1f1464[_0x0314('0x52')],'name':_0x1f1464[_0x0314('0x53')],'paused':_0x1f1464[_0x0314('0x54')],'waiting':_0x1f1464[_0x0314('0x55')]};_0x144929[_0x0314('0x22')](_0x453bf7);}}_0x197653({'count':_0x144929[_0x0314('0x19')],'rows':_0x144929});});},'WhatsappQueues':function(_0x55a6f2){return new Promise(function(_0x2238e8,_0x2b1493){var _0x4b50f6=[];for(var _0x53aa21 in _0xbe0b07[_0x0314('0x5a')]){if(_0xbe0b07[_0x0314('0x5a')][_0x0314('0x4c')](_0x53aa21)){var _0x2ff22c=_0xbe0b07[_0x0314('0x5a')][_0x53aa21];var _0x987585={'id':_0x2ff22c['id'],'available':_0x2ff22c[_0x0314('0x51')],'loggedIn':_0x2ff22c[_0x0314('0x52')],'name':_0x2ff22c[_0x0314('0x53')],'paused':_0x2ff22c[_0x0314('0x54')],'waiting':_0x2ff22c[_0x0314('0x55')]};_0x4b50f6['push'](_0x987585);}}_0x2238e8({'count':_0x4b50f6[_0x0314('0x19')],'rows':_0x4b50f6});});},'ChatQueuesWaitingInteractions':function(_0x17e2bd){return new Promise(function(_0x44ff6f,_0x110212){var _0x2da3db=_['values'](_0xbe0b07[_0x0314('0x5b')]);_0x44ff6f({'count':_0x2da3db['length'],'rows':_0x2da3db});});},'MailQueuesWaitingInteractions':function(_0x3b2b6a){return new Promise(function(_0x59d100,_0x4ddec0){var _0x40074f=_['values'](_0xbe0b07[_0x0314('0x5c')]);_0x59d100({'count':_0x40074f[_0x0314('0x19')],'rows':_0x40074f});});},'OpenchannelQueuesWaitingInteractions':function(_0x6ece9a){return new Promise(function(_0x12789d,_0x4fca70){var _0x1bb95f=_[_0x0314('0x50')](_0xbe0b07['openchannelQueuesWaitingInteractions']);_0x12789d({'count':_0x1bb95f[_0x0314('0x19')],'rows':_0x1bb95f});});},'SmsQueuesWaitingInteractions':function(_0x5acfa3){return new Promise(function(_0x3688c7,_0x410bd6){var _0x230cd6=_[_0x0314('0x50')](_0xbe0b07[_0x0314('0x5d')]);_0x3688c7({'count':_0x230cd6[_0x0314('0x19')],'rows':_0x230cd6});});},'FaxQueuesWaitingInteractions':function(_0x4c3bb4){return new Promise(function(_0x2bd970,_0x4561ed){var _0x2c87d5=_[_0x0314('0x50')](_0xbe0b07[_0x0314('0x5e')]);_0x2bd970({'count':_0x2c87d5[_0x0314('0x19')],'rows':_0x2c87d5});});},'WhatsappQueuesWaitingInteractions':function(_0x3d0b71){return new Promise(function(_0x3f7f87,_0x259faa){var _0x5cd3bb=_[_0x0314('0x50')](_0xbe0b07[_0x0314('0x5f')]);_0x3f7f87({'count':_0x5cd3bb[_0x0314('0x19')],'rows':_0x5cd3bb});});}};var _0x182909=jayson[_0x0314('0x60')](_0x398c91)[_0x0314('0x61')]();_0x182909['on']('error',function(_0x353a37){logger['error'](JSON[_0x0314('0x38')](_0x353a37));return _0x40566e(_0x353a37);});_0x182909[_0x0314('0x14')](0x232c,_0x0314('0x62'),function(){console[_0x0314('0x63')](_0x0314('0x64'),0x232c);return _0x12d026(_0x0314('0x65')+0x232c);});});}; \ No newline at end of file +var _0xd3d1=['mail','push','slice','dialogflow','dialogflowv2','amazonlex','split','TagId','tvox','getMustacheRender','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','intervals','./applications/','consequence','priority','Push\x20new\x20rule','on\x20interval','error','Please\x20create\x20a\x20new\x20file\x20under','rules','execute','info','stringify','emit','complete','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busyQueue','end','QueueReport','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','updateRealtime','agent\x20not\x20found','values','chatQueues','loggedIn','paused','mailQueues','available','name','openchannelQueues','waiting','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','bluebird','uuid','./applications/utils','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','isNil','IntervalId','Intervals','map','interval','listen','message','interaction','applications','length','existsSync','join','app','.js','toLowerCase','autoreply','appdata','channel'];(function(_0x3ffa5a,_0x545137){var _0x42f72f=function(_0x5d7e9a){while(--_0x5d7e9a){_0x3ffa5a['push'](_0x3ffa5a['shift']());}};_0x42f72f(++_0x545137);}(_0xd3d1,0x172));var _0x1d3d=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0xd3d1[_0x5f3f88];return _0xd08119;};'use strict';var _=require(_0x1d3d('0x0'));var util=require(_0x1d3d('0x1'));var path=require('path');var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require(_0x1d3d('0x2'));var uuid=require(_0x1d3d('0x3'));var utils=require(_0x1d3d('0x4'));var config=require(_0x1d3d('0x5'));var logger=require(_0x1d3d('0x6'))(_0x1d3d('0x7'));var rpc={'openchannelQueueReport':require(_0x1d3d('0x8')),'mailQueueReport':require(_0x1d3d('0x9')),'chatQueueReport':require(_0x1d3d('0xa')),'smsQueueReport':require(_0x1d3d('0xb')),'faxQueueReport':require(_0x1d3d('0xc')),'whatsappQueueReport':require(_0x1d3d('0xd'))};var RuleEngine=require(_0x1d3d('0xe'));function getId(_0x2c377c,_0xbea61e,_0x2ba122){return util[_0x1d3d('0xf')]('%s.%s.%s',_0x2c377c,_0xbea61e||0x0,_0x2ba122||0x0);}function getIntervals(_0x2d967e,_0x44d950){var _0x32d5da=[];if(!_[_0x1d3d('0x10')](_0x44d950[_0x1d3d('0x11')])&&!_[_0x1d3d('0x10')](_0x2d967e[_0x44d950[_0x1d3d('0x11')]])&&!_[_0x1d3d('0x10')](_0x2d967e[_0x44d950[_0x1d3d('0x11')]][_0x1d3d('0x12')])){_0x32d5da=_[_0x1d3d('0x13')](_0x2d967e[_0x44d950['IntervalId']][_0x1d3d('0x12')],_0x1d3d('0x14'));}else if(!_['isNil'](_0x44d950['interval'])){_0x32d5da=[_0x44d950[_0x1d3d('0x14')]];}return _0x32d5da;}exports[_0x1d3d('0x15')]=function(_0x1a8035){_0x1a8035['rules']={};return new BPromise(function(_0x4098a9,_0x4dcc22){var _0x1d54f3={'Start':function(_0x33e7d9){var _0x3491e4=this;return new Promise(function(_0x24bb8c,_0x21c2e4){if(_0x33e7d9){try{var _0x1bdbdc=[];var _0x3dcb67=getId(_0x33e7d9['channel'],_0x33e7d9['message']?_0x33e7d9[_0x1d3d('0x16')]['id']:0x0,_0x33e7d9[_0x1d3d('0x17')]?_0x33e7d9['interaction']['id']:0x0);if(_0x33e7d9[_0x1d3d('0x18')]&&_['isArray'](_0x33e7d9[_0x1d3d('0x18')])&&_0x33e7d9[_0x1d3d('0x18')][_0x1d3d('0x19')]){for(var _0x2d6dfb=0x0;_0x2d6dfb<_0x33e7d9['applications'][_0x1d3d('0x19')];_0x2d6dfb+=0x1){var _0x56db7a=_0x33e7d9['applications'][_0x2d6dfb];if(fs[_0x1d3d('0x1a')](path[_0x1d3d('0x1b')](__dirname,_0x1d3d('0x18'),_0x56db7a[_0x1d3d('0x1c')]+_0x1d3d('0x1d')))){var _0xe4afa2=[];switch(_0x56db7a[_0x1d3d('0x1c')][_0x1d3d('0x1e')]()){case _0x1d3d('0x1f'):var _0x18f234=_0x56db7a[_0x1d3d('0x20')]['split'](',');if(_0x33e7d9[_0x1d3d('0x21')]===_0x1d3d('0x22')){_0xe4afa2['push'](_0x18f234[0x0]);_0xe4afa2[_0x1d3d('0x23')](_0x18f234[0x1]);_0xe4afa2['push'](_0x18f234[_0x1d3d('0x24')](0x2,_0x18f234[_0x1d3d('0x19')])[_0x1d3d('0x1b')](','));}else{_0xe4afa2[_0x1d3d('0x23')](_0x18f234[0x0]);_0xe4afa2[_0x1d3d('0x23')](_0x18f234[_0x1d3d('0x24')](0x1,_0x18f234[_0x1d3d('0x19')])[_0x1d3d('0x1b')](','));}break;case _0x1d3d('0x25'):var _0x2df7b7=_0x56db7a[_0x1d3d('0x20')]['split'](',');_0xe4afa2[_0x1d3d('0x23')](_0x2df7b7[0x0]);_0xe4afa2['push'](_0x2df7b7[0x1]);_0xe4afa2[_0x1d3d('0x23')](_0x2df7b7[_0x1d3d('0x24')](0x2,_0x2df7b7['length'])[_0x1d3d('0x1b')](','));break;case _0x1d3d('0x26'):var _0x3cb011=_0x56db7a[_0x1d3d('0x20')]['split'](',');_0xe4afa2[_0x1d3d('0x23')](_0x3cb011[0x0]);_0xe4afa2[_0x1d3d('0x23')](_0x3cb011[0x1]);_0xe4afa2['push'](_0x3cb011[0x2]);_0xe4afa2[_0x1d3d('0x23')](_0x3cb011[0x3]);_0xe4afa2['push'](_0x3cb011[_0x1d3d('0x24')](0x4,_0x3cb011[_0x1d3d('0x19')])['join'](','));break;case _0x1d3d('0x27'):var _0x192f60=_0x56db7a[_0x1d3d('0x20')][_0x1d3d('0x28')](',');_0xe4afa2[_0x1d3d('0x23')](_0x192f60[0x0]);_0xe4afa2[_0x1d3d('0x23')](_0x192f60[0x1]);_0xe4afa2[_0x1d3d('0x23')](_0x192f60[0x2]);_0xe4afa2[_0x1d3d('0x23')](_0x192f60[0x3]);_0xe4afa2[_0x1d3d('0x23')](_0x192f60['slice'](0x4,_0x192f60[_0x1d3d('0x19')])[_0x1d3d('0x1b')](','));break;case _0x1d3d('0x16'):_0xe4afa2[_0x1d3d('0x23')](_0x56db7a['appdata']);break;case'tag':_0xe4afa2[_0x1d3d('0x23')](_0x56db7a[_0x1d3d('0x29')]);_0xe4afa2['push'](_0x56db7a[_0x1d3d('0x20')]);break;case _0x1d3d('0x2a'):var _0x2888f9=utils[_0x1d3d('0x2b')](_0x33e7d9['account']['notificationTemplate'],_0x33e7d9);var _0x29fa6c=_0x56db7a['appdata'][_0x1d3d('0x28')](',');_0xe4afa2[_0x1d3d('0x23')](_0x29fa6c[0x0]);_0xe4afa2[_0x1d3d('0x23')](_0x29fa6c[0x1]);_0xe4afa2[_0x1d3d('0x23')](_0x29fa6c[0x2]);_0xe4afa2[_0x1d3d('0x23')](_0x29fa6c[0x3]);_0xe4afa2[_0x1d3d('0x23')](_0x29fa6c[0x4]);_0xe4afa2[_0x1d3d('0x23')](_0x29fa6c[0x5]);_0xe4afa2[_0x1d3d('0x23')](_0x29fa6c[0x6]);_0xe4afa2['push'](_0x29fa6c[0x7]);_0xe4afa2[_0x1d3d('0x23')](_0x29fa6c[0x8]);_0xe4afa2['push'](_0x29fa6c[0x9]);_0xe4afa2[_0x1d3d('0x23')](_0x29fa6c[0xa]);_0xe4afa2[_0x1d3d('0x23')](_0x33e7d9['interaction']['id']);_0xe4afa2[_0x1d3d('0x23')](_0x33e7d9[_0x1d3d('0x16')]['id']);_0xe4afa2[_0x1d3d('0x23')](_0x56db7a[_0x1d3d('0x2c')]);_0xe4afa2['push'](_0x33e7d9['interaction'][_0x1d3d('0x2d')]);_0xe4afa2['push'](_0x33e7d9[_0x1d3d('0x2e')][_0x1d3d('0x2e')]);_0xe4afa2['push'](_0x2888f9);break;default:_0xe4afa2=_[_0x1d3d('0x10')](_0x56db7a[_0x1d3d('0x20')])?[]:_0x56db7a['appdata'][_0x1d3d('0x28')](',');}var _0x40f8ca={'id':util[_0x1d3d('0xf')](_0x1d3d('0x2f'),_0x3dcb67,_0x56db7a['id'],_0x56db7a[_0x1d3d('0x1c')]),'condition':require(_0x1d3d('0x30'))['condition'](_0x3dcb67,getIntervals(_0x1a8035[_0x1d3d('0x31')],_0x56db7a),_0x1a8035),'consequence':require(_0x1d3d('0x32')+_0x56db7a[_0x1d3d('0x1c')])[_0x1d3d('0x33')](_0x3dcb67,_0xe4afa2,_0x1a8035,_0x33e7d9),'p':_0x56db7a[_0x1d3d('0x34')]||0x0};logger['info'](_0x1d3d('0x35'),_0x40f8ca['id'],_0x1d3d('0x36'),getIntervals(_0x1a8035[_0x1d3d('0x31')],_0x56db7a)[_0x1d3d('0x1b')]('\x20|\x20'));_0x1bdbdc[_0x1d3d('0x23')](_0x40f8ca);}else{logger[_0x1d3d('0x37')](_0x1d3d('0x38'),path[_0x1d3d('0x1b')](__dirname,_0x1d3d('0x18'),_0x56db7a['app']+'.js'));}}_0x1a8035[_0x1d3d('0x39')][_0x3dcb67]=new RuleEngine(_0x1bdbdc);_0x1a8035[_0x1d3d('0x39')][_0x3dcb67][_0x1d3d('0x3a')](_0x33e7d9,function(_0x66efd){logger[_0x1d3d('0x3b')]('Applications\x20executed',JSON[_0x1d3d('0x3c')](_0x66efd['matchPath']));if(_0x1a8035[_0x1d3d('0x39')][_0x3dcb67]){_0x1a8035[_0x1d3d('0x39')][_0x3dcb67][_0x1d3d('0x3d')](_0x1d3d('0x3e'));}});return _0x24bb8c({'code':0xc8,'message':_0x33e7d9});}else{logger['info'](_0x1d3d('0x3f'));return _0x24bb8c({'code':0xc8,'message':_0x33e7d9});}}catch(_0x29b89b){logger[_0x1d3d('0x37')](_0x29b89b[_0x1d3d('0x40')]);return _0x21c2e4(_0x3491e4[_0x1d3d('0x37')](0x1f4,_0x29b89b));}}return _0x21c2e4(_0x1d3d('0x41'));});},'AcceptMessage':function(_0x3a3389){var _0x55aa8a=this;return new Promise(function(_0x3c5ccf,_0x5891cc){if(_0x3a3389[_0x1d3d('0x42')]&&_0x3a3389[_0x1d3d('0x42')]['id']){if(_0x1a8035['agents'][_0x3a3389[_0x1d3d('0x42')]['id']]){_0x1a8035['agents'][_0x3a3389[_0x1d3d('0x42')]['id']]['busy']=![];_0x1a8035[_0x1d3d('0x43')][_0x3a3389[_0x1d3d('0x42')]['id']][_0x1d3d('0x44')]=undefined;}}if(_0x3a3389[_0x1d3d('0x16')]&&_0x3a3389[_0x1d3d('0x16')]['id']){try{var _0x14d5c6=getId(_0x3a3389[_0x1d3d('0x21')],_0x3a3389[_0x1d3d('0x16')]?_0x3a3389['message']['id']:0x0,_0x3a3389['interaction']?_0x3a3389['interaction']['id']:0x0);if(_0x1a8035[_0x1d3d('0x39')][_0x14d5c6]){_0x1a8035[_0x1d3d('0x39')][_0x14d5c6][_0x1d3d('0x3d')](_0x1d3d('0x45'));if(rpc[_0x3a3389[_0x1d3d('0x21')]+_0x1d3d('0x46')]){rpc[_0x3a3389['channel']+'QueueReport']['update'](_0x14d5c6,{'UserId':_0x3a3389['message'][_0x1d3d('0x47')]})[_0x1d3d('0x48')](function(_0x89a16a){logger[_0x1d3d('0x37')](_0x1d3d('0x49'));});}}return _0x3c5ccf({'code':0xc8,'message':_0x3a3389});}catch(_0x363f4c){logger[_0x1d3d('0x37')](_0x363f4c[_0x1d3d('0x40')]);return _0x5891cc(_0x55aa8a[_0x1d3d('0x37')](0x1f4,_0x363f4c));}}logger[_0x1d3d('0x37')](_0x1d3d('0x4a'));return _0x5891cc(_0x55aa8a[_0x1d3d('0x37')](0x1f4,_0x1d3d('0x4a')));});},'RejectMessage':function(_0x212929){var _0x311b05=this;return new Promise(function(_0x5ce0d3,_0x465e97){if(_0x212929[_0x1d3d('0x42')]&&_0x212929[_0x1d3d('0x42')]['id']){try{if(_0x1a8035[_0x1d3d('0x43')][_0x212929['agent']['id']]){_0x1a8035[_0x1d3d('0x43')][_0x212929['agent']['id']]['busy']=![];_0x1a8035[_0x1d3d('0x43')][_0x212929[_0x1d3d('0x42')]['id']]['busyQueue']=undefined;}return _0x5ce0d3({'code':0xc8,'message':_0x212929});}catch(_0x332c30){logger[_0x1d3d('0x37')](_0x332c30['stack']);return _0x465e97(_0x311b05[_0x1d3d('0x37')](0x1f4,_0x332c30));}}logger[_0x1d3d('0x37')](_0x1d3d('0x4a'));return _0x465e97(_0x311b05[_0x1d3d('0x37')](0x1f4,_0x1d3d('0x4a')));});},'AbandonInteraction':function(_0x267586){var _0x213b0b=this;return new Promise(function(_0x2e6f8a,_0x11bd33){if(_0x267586['channel']&&_0x267586[_0x1d3d('0x17')]&&_0x267586['interaction']['id']){try{var _0x482c31=getId(_0x267586['channel'],_0x267586['message']?_0x267586[_0x1d3d('0x16')]['id']:0x0,_0x267586[_0x1d3d('0x17')]?_0x267586[_0x1d3d('0x17')]['id']:0x0);if(_0x1a8035[_0x1d3d('0x39')][_0x482c31]){_0x1a8035['rules'][_0x482c31][_0x1d3d('0x3d')]('end');}return _0x2e6f8a({'code':0xc8,'message':_0x267586});}catch(_0x44273d){logger[_0x1d3d('0x37')](_0x44273d['stack']);return _0x11bd33(_0x213b0b[_0x1d3d('0x37')](0x1f4,_0x44273d));}}logger[_0x1d3d('0x37')]('message\x20is\x20empty');return _0x11bd33(_0x213b0b[_0x1d3d('0x37')](0x1f4,_0x1d3d('0x4a')));});},'AgentCapacity':function(_0x295145){var _0x1abb53=this;return new Promise(function(_0x3bac7f,_0x16e757){if(_0x1a8035['agents'][_0x1d3d('0x4b')](_0x295145['id'])){for(var _0x31b07c in _0x295145[_0x1d3d('0x4c')]){if(_0x295145[_0x1d3d('0x4c')][_0x1d3d('0x4b')](_0x31b07c)){if(_0x1a8035['agents'][_0x295145['id']][_0x1d3d('0x4b')](_0x31b07c+'CurrentCapacity')){_0x1a8035[_0x1d3d('0x43')][_0x295145['id']][_0x31b07c+'CurrentCapacity']=parseInt(_0x295145[_0x1d3d('0x4c')][_0x31b07c],0xa);}}}_0x1a8035[_0x1d3d('0x43')][_0x295145['id']][_0x1d3d('0x4d')]();return _0x3bac7f({'code':0xc8,'message':_0x1a8035[_0x1d3d('0x43')][_0x295145['id']]});}else{return _0x16e757(_0x1abb53[_0x1d3d('0x37')](0x1f4,_0x1d3d('0x4e')));}});},'Agents':function(_0x104a06){return new Promise(function(_0x495945,_0x3a5a65){var _0x3b30cb=_[_0x1d3d('0x4f')](_0x1a8035[_0x1d3d('0x43')]);_0x495945({'count':_0x3b30cb[_0x1d3d('0x19')],'rows':_0x3b30cb});});},'ChatQueues':function(_0x44243d){return new Promise(function(_0x4e395b,_0x17771b){var _0x2ca216=[];for(var _0xa8891a in _0x1a8035[_0x1d3d('0x50')]){if(_0x1a8035[_0x1d3d('0x50')]['hasOwnProperty'](_0xa8891a)){var _0xe83c1d=_0x1a8035[_0x1d3d('0x50')][_0xa8891a];var _0x22022a={'id':_0xe83c1d['id'],'available':_0xe83c1d['available'],'loggedIn':_0xe83c1d[_0x1d3d('0x51')],'name':_0xe83c1d['name'],'paused':_0xe83c1d[_0x1d3d('0x52')],'waiting':_0xe83c1d['waiting']};_0x2ca216[_0x1d3d('0x23')](_0x22022a);}}_0x4e395b({'count':_0x2ca216[_0x1d3d('0x19')],'rows':_0x2ca216});});},'MailQueues':function(_0x191f19){return new Promise(function(_0x56cb47,_0x389330){var _0x15de4f=[];for(var _0xfafb77 in _0x1a8035['mailQueues']){if(_0x1a8035[_0x1d3d('0x53')][_0x1d3d('0x4b')](_0xfafb77)){var _0x1755ce=_0x1a8035['mailQueues'][_0xfafb77];var _0x336263={'id':_0x1755ce['id'],'available':_0x1755ce[_0x1d3d('0x54')],'loggedIn':_0x1755ce[_0x1d3d('0x51')],'name':_0x1755ce[_0x1d3d('0x55')],'paused':_0x1755ce[_0x1d3d('0x52')],'waiting':_0x1755ce['waiting']};_0x15de4f[_0x1d3d('0x23')](_0x336263);}}_0x56cb47({'count':_0x15de4f[_0x1d3d('0x19')],'rows':_0x15de4f});});},'OpenchannelQueues':function(_0x25f4e0){return new Promise(function(_0x550a95,_0x2869ea){var _0x2b377d=[];for(var _0x32b183 in _0x1a8035[_0x1d3d('0x56')]){if(_0x1a8035[_0x1d3d('0x56')]['hasOwnProperty'](_0x32b183)){var _0x21f8ac=_0x1a8035[_0x1d3d('0x56')][_0x32b183];var _0x545484={'id':_0x21f8ac['id'],'available':_0x21f8ac[_0x1d3d('0x54')],'loggedIn':_0x21f8ac[_0x1d3d('0x51')],'name':_0x21f8ac['name'],'paused':_0x21f8ac[_0x1d3d('0x52')],'waiting':_0x21f8ac[_0x1d3d('0x57')]};_0x2b377d[_0x1d3d('0x23')](_0x545484);}}_0x550a95({'count':_0x2b377d[_0x1d3d('0x19')],'rows':_0x2b377d});});},'SmsQueues':function(_0x4c59a0){return new Promise(function(_0x3fc022,_0x1b7741){var _0x27b78d=[];for(var _0x1377d9 in _0x1a8035['smsQueues']){if(_0x1a8035['smsQueues'][_0x1d3d('0x4b')](_0x1377d9)){var _0xc40b25=_0x1a8035[_0x1d3d('0x58')][_0x1377d9];var _0x14e615={'id':_0xc40b25['id'],'available':_0xc40b25[_0x1d3d('0x54')],'loggedIn':_0xc40b25[_0x1d3d('0x51')],'name':_0xc40b25[_0x1d3d('0x55')],'paused':_0xc40b25['paused'],'waiting':_0xc40b25[_0x1d3d('0x57')]};_0x27b78d[_0x1d3d('0x23')](_0x14e615);}}_0x3fc022({'count':_0x27b78d['length'],'rows':_0x27b78d});});},'FaxQueues':function(_0x164b5d){return new Promise(function(_0x310d27,_0x3ab561){var _0x5d951f=[];for(var _0x4079ca in _0x1a8035[_0x1d3d('0x59')]){if(_0x1a8035[_0x1d3d('0x59')][_0x1d3d('0x4b')](_0x4079ca)){var _0x5b909b=_0x1a8035[_0x1d3d('0x59')][_0x4079ca];var _0x300ce9={'id':_0x5b909b['id'],'available':_0x5b909b[_0x1d3d('0x54')],'loggedIn':_0x5b909b[_0x1d3d('0x51')],'name':_0x5b909b['name'],'paused':_0x5b909b[_0x1d3d('0x52')],'waiting':_0x5b909b[_0x1d3d('0x57')]};_0x5d951f[_0x1d3d('0x23')](_0x300ce9);}}_0x310d27({'count':_0x5d951f['length'],'rows':_0x5d951f});});},'WhatsappQueues':function(_0x2bbdfa){return new Promise(function(_0x3a66d2,_0x4d3d48){var _0x1d31be=[];for(var _0x5c2879 in _0x1a8035[_0x1d3d('0x5a')]){if(_0x1a8035[_0x1d3d('0x5a')]['hasOwnProperty'](_0x5c2879)){var _0x559666=_0x1a8035[_0x1d3d('0x5a')][_0x5c2879];var _0x111da2={'id':_0x559666['id'],'available':_0x559666['available'],'loggedIn':_0x559666[_0x1d3d('0x51')],'name':_0x559666[_0x1d3d('0x55')],'paused':_0x559666[_0x1d3d('0x52')],'waiting':_0x559666[_0x1d3d('0x57')]};_0x1d31be['push'](_0x111da2);}}_0x3a66d2({'count':_0x1d31be[_0x1d3d('0x19')],'rows':_0x1d31be});});},'ChatQueuesWaitingInteractions':function(_0x2b7c79){return new Promise(function(_0x2db082,_0x5b75df){var _0x216a42=_[_0x1d3d('0x4f')](_0x1a8035[_0x1d3d('0x5b')]);_0x2db082({'count':_0x216a42['length'],'rows':_0x216a42});});},'MailQueuesWaitingInteractions':function(_0x14f5f3){return new Promise(function(_0x434d65,_0x3fd82a){var _0x939714=_[_0x1d3d('0x4f')](_0x1a8035[_0x1d3d('0x5c')]);_0x434d65({'count':_0x939714['length'],'rows':_0x939714});});},'OpenchannelQueuesWaitingInteractions':function(_0x1dd488){return new Promise(function(_0x2b5ff2,_0x5cedcf){var _0x360a3c=_[_0x1d3d('0x4f')](_0x1a8035[_0x1d3d('0x5d')]);_0x2b5ff2({'count':_0x360a3c['length'],'rows':_0x360a3c});});},'SmsQueuesWaitingInteractions':function(_0x327a8b){return new Promise(function(_0x54837d,_0x49ab17){var _0x49d1e7=_[_0x1d3d('0x4f')](_0x1a8035['smsQueuesWaitingInteractions']);_0x54837d({'count':_0x49d1e7[_0x1d3d('0x19')],'rows':_0x49d1e7});});},'FaxQueuesWaitingInteractions':function(_0x3ac4bd){return new Promise(function(_0x15fbb5,_0x175e7f){var _0x4f2e0e=_['values'](_0x1a8035[_0x1d3d('0x5e')]);_0x15fbb5({'count':_0x4f2e0e[_0x1d3d('0x19')],'rows':_0x4f2e0e});});},'WhatsappQueuesWaitingInteractions':function(_0x5dc159){return new Promise(function(_0x11688f,_0x3c8356){var _0x5be307=_[_0x1d3d('0x4f')](_0x1a8035[_0x1d3d('0x5f')]);_0x11688f({'count':_0x5be307['length'],'rows':_0x5be307});});}};var _0x329748=jayson['server'](_0x1d54f3)[_0x1d3d('0x60')]();_0x329748['on'](_0x1d3d('0x37'),function(_0x312b40){logger[_0x1d3d('0x37')](JSON[_0x1d3d('0x3c')](_0x312b40));return _0x4dcc22(_0x312b40);});_0x329748['listen'](0x232c,_0x1d3d('0x61'),function(){console[_0x1d3d('0x62')](_0x1d3d('0x63'),0x232c);return _0x4098a9(_0x1d3d('0x64')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 08dec35..7078d88 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 _0x982f=['info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','iftime\x20%s','message','indexOf','true','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','\x20|\x20','log','join','stack','util','bluebird','jayson/promise','lodash','../../../config/logger','client','http','request','then','error','catch','condition','rules'];(function(_0x25662e,_0x4cec68){var _0x59b7bc=function(_0xafb159){while(--_0xafb159){_0x25662e['push'](_0x25662e['shift']());}};_0x59b7bc(++_0x4cec68);}(_0x982f,0x1f1));var _0xf982=function(_0x363a85,_0x31e8b9){_0x363a85=_0x363a85-0x0;var _0x2a0904=_0x982f[_0x363a85];return _0x2a0904;};'use strict';var util=require(_0xf982('0x0'));var BPromise=require(_0xf982('0x1'));var jayson=require(_0xf982('0x2'));var _=require(_0xf982('0x3'));var logger=require(_0xf982('0x4'))('routing');var client=jayson[_0xf982('0x5')][_0xf982('0x6')]({'port':0x232a});function request(_0x544194,_0x41aea8){return new BPromise(function(_0x46f38b,_0x3558d1){return client[_0xf982('0x7')](_0x544194,_0x41aea8)[_0xf982('0x8')](function(_0x3af4b4){if(_0x3af4b4[_0xf982('0x9')]){return _0x3558d1(_0x3af4b4['error']['message']);}else{return _0x46f38b(_0x3af4b4['result']);}})[_0xf982('0xa')](function(_0x239275){return _0x3558d1(_0x239275);});});}exports[_0xf982('0xb')]=function(_0x1ed01a,_0x65ed6c,_0x5099a1){return function(_0x2e9d3d){if(_0x5099a1[_0xf982('0xc')]&&!_0x5099a1['rules'][_0x1ed01a]){logger[_0xf982('0xd')](_0xf982('0xe'),_0x1ed01a);return _0x2e9d3d[_0xf982('0xf')]();}var _0x1ccd06=[];for(var _0x416d61=0x0;_0x416d61<_0x65ed6c[_0xf982('0x10')];_0x416d61+=0x1){_0x1ccd06[_0xf982('0x11')](request('Command',{'command':util['format'](_0xf982('0x12'),_0x65ed6c[_0x416d61])})[_0xf982('0x8')](function(_0x3c54d5){return _0x3c54d5&&_0x3c54d5[_0xf982('0x13')]&&_0x3c54d5[_0xf982('0x13')][_0xf982('0x14')](_0xf982('0x15'))>=0x0?!![]:![];})['catch'](function(_0x97aee7){logger[_0xf982('0x9')](_0xf982('0x16'),_0x1ed01a,_0x65ed6c[_0x416d61]);}));}BPromise[_0xf982('0x17')](_0x1ccd06)['then'](function(_0x169360){var _0x209f30=_[_0xf982('0x18')](_0x169360);logger[_0xf982('0xd')](_0xf982('0x19'),_0x1ed01a,_0x65ed6c['join'](_0xf982('0x1a')),_0x209f30);_0x2e9d3d['when'](_0x209f30);})[_0xf982('0xa')](function(_0xc27c44){console[_0xf982('0x1b')](_0xc27c44);logger[_0xf982('0x9')](_0xf982('0x19'),_0x1ed01a,_0x65ed6c[_0xf982('0x1c')](_0xf982('0x1a')),_0xc27c44[_0xf982('0x1d')]);_0x2e9d3d[_0xf982('0xf')]();});};}; \ No newline at end of file +var _0x3651=['iftime\x20%s','message','true','[%s][INTERVAL]\x20%s','all','some','info','[%s][INTERVAL]\x20%s\x20%s','join','when','\x20|\x20','util','bluebird','lodash','../../../config/logger','client','http','then','error','result','catch','condition','rules','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','format'];(function(_0x2c939a,_0x55fd92){var _0x3141ad=function(_0x406de9){while(--_0x406de9){_0x2c939a['push'](_0x2c939a['shift']());}};_0x3141ad(++_0x55fd92);}(_0x3651,0x1a1));var _0x1365=function(_0x2d4d6d,_0x440070){_0x2d4d6d=_0x2d4d6d-0x0;var _0xcc293a=_0x3651[_0x2d4d6d];return _0xcc293a;};'use strict';var util=require(_0x1365('0x0'));var BPromise=require(_0x1365('0x1'));var jayson=require('jayson/promise');var _=require(_0x1365('0x2'));var logger=require(_0x1365('0x3'))('routing');var client=jayson[_0x1365('0x4')][_0x1365('0x5')]({'port':0x232a});function request(_0x1b6cc8,_0x406749){return new BPromise(function(_0x2828da,_0xef6adc){return client['request'](_0x1b6cc8,_0x406749)[_0x1365('0x6')](function(_0xbbcddd){if(_0xbbcddd[_0x1365('0x7')]){return _0xef6adc(_0xbbcddd[_0x1365('0x7')]['message']);}else{return _0x2828da(_0xbbcddd[_0x1365('0x8')]);}})[_0x1365('0x9')](function(_0x5295f0){return _0xef6adc(_0x5295f0);});});}exports[_0x1365('0xa')]=function(_0x27b27a,_0x4327f5,_0x239ae5){return function(_0x5651f4){if(_0x239ae5[_0x1365('0xb')]&&!_0x239ae5[_0x1365('0xb')][_0x27b27a]){logger['info'](_0x1365('0xc'),_0x27b27a);return _0x5651f4[_0x1365('0xd')]();}var _0x466e7c=[];for(var _0x1ae6f6=0x0;_0x1ae6f6<_0x4327f5[_0x1365('0xe')];_0x1ae6f6+=0x1){_0x466e7c[_0x1365('0xf')](request(_0x1365('0x10'),{'command':util[_0x1365('0x11')](_0x1365('0x12'),_0x4327f5[_0x1ae6f6])})[_0x1365('0x6')](function(_0x4dd1ea){return _0x4dd1ea&&_0x4dd1ea[_0x1365('0x13')]&&_0x4dd1ea['message']['indexOf'](_0x1365('0x14'))>=0x0?!![]:![];})['catch'](function(_0x508aa0){logger['error'](_0x1365('0x15'),_0x27b27a,_0x4327f5[_0x1ae6f6]);}));}BPromise[_0x1365('0x16')](_0x466e7c)[_0x1365('0x6')](function(_0x4362fc){var _0x3072e7=_[_0x1365('0x17')](_0x4362fc);logger[_0x1365('0x18')](_0x1365('0x19'),_0x27b27a,_0x4327f5[_0x1365('0x1a')]('\x20|\x20'),_0x3072e7);_0x5651f4[_0x1365('0x1b')](_0x3072e7);})[_0x1365('0x9')](function(_0x8c6e1){console['log'](_0x8c6e1);logger[_0x1365('0x7')](_0x1365('0x19'),_0x27b27a,_0x4327f5[_0x1365('0x1a')](_0x1365('0x1c')),_0x8c6e1['stack']);_0x5651f4[_0x1365('0xd')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 8e1ba47..3c948d1 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 _0x69d3=['isNil','[%s][agents][agentringnoanswer]','agentringnoanswerAt','timeout','reason','holdtime','ringtime','talktime','push','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','answered_elsewhere','answeredelsewheremembername','agentcompleteAt','diffTime','complete','[%s][agents][agentcomplete]','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','transfer','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','origtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','ATTENDED','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','transfertargetuniqueid','[%s][agents][attendedtransfer]','hangup','[%s][agents][hangup]','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','splice','agent','lodash','util','./utils','info','uniqueid','membername','interface','calleridnum','connectedlinenum','lastevent','queue','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwTimeout','request','CreateVoiceAgentReport','agentcalled','debug','format','[%s][agents][agentcalled]','agentcalledAt','now','destuniqueid','called','connectedlinename','error','agentringnoanswer'];(function(_0x1807bb,_0x12a17a){var _0x303b1f=function(_0x31d2d2){while(--_0x31d2d2){_0x1807bb['push'](_0x1807bb['shift']());}};_0x303b1f(++_0x12a17a);}(_0x69d3,0xda));var _0x369d=function(_0x109cf6,_0x221c9d){_0x109cf6=_0x109cf6-0x0;var _0x427a19=_0x69d3[_0x109cf6];return _0x427a19;};'use strict';var _=require(_0x369d('0x0'));var util=require(_0x369d('0x1'));var utils=require(_0x369d('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x52c3ba,_0x47591f){utils[_0x369d('0x3')](util['format']('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x52c3ba[_0x369d('0x4')],_0x52c3ba['channel'],_0x52c3ba['queue'],_0x52c3ba[_0x369d('0x5')],_0x52c3ba[_0x369d('0x6')],_0x52c3ba[_0x369d('0x7')],_0x52c3ba[_0x369d('0x8')],_0x52c3ba[_0x369d('0x9')]));if(_0x52c3ba[_0x369d('0xa')]){utils[_0x369d('0xb')](_0x52c3ba[_0x369d('0xa')])[_0x369d('0xc')](function(_0x580727){if(_0x580727){_0x52c3ba['type']=_0x580727[_0x369d('0xd')];_0x52c3ba[_0x369d('0xe')]=_0x52c3ba[_0x369d('0xf')]?_0x580727[_0x369d('0x10')]:![];_0x52c3ba['acwtime']=_0x52c3ba['agentacw']?_0x580727[_0x369d('0x11')]:0x0;}utils[_0x369d('0x12')](_0x369d('0x13'),_0x52c3ba);});}else{utils[_0x369d('0x12')](_0x369d('0x13'),_0x52c3ba);}if(_0x47591f){delete transfers[_0x52c3ba[_0x369d('0x4')]];}else{delete agents[_0x52c3ba['destuniqueid']];}}exports[_0x369d('0x14')]=function(_0x9d016){try{utils[_0x369d('0x15')](util[_0x369d('0x16')](_0x369d('0x17'),_0x9d016['uniqueid']),_0x9d016);agents[_0x9d016['destuniqueid']]=_0x9d016;agents[_0x9d016['destuniqueid']][_0x369d('0x18')]=utils[_0x369d('0x19')]();agents[_0x9d016[_0x369d('0x1a')]]['lastevent']=_0x369d('0x1b');agents[_0x9d016[_0x369d('0x1a')]][_0x369d('0x8')]=null;agents[_0x9d016['destuniqueid']][_0x369d('0x1c')]=null;utils[_0x369d('0x3')](util['format']('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x9d016['uniqueid'],agents[_0x9d016[_0x369d('0x1a')]][_0x369d('0x5')],_0x9d016[_0x369d('0x1a')]));}catch(_0x4ddcb2){utils[_0x369d('0x1d')](util[_0x369d('0x16')](_0x369d('0x17'),_0x9d016[_0x369d('0x4')]),_0x4ddcb2);}};exports[_0x369d('0x1e')]=function(_0x538ca4){try{if(!_[_0x369d('0x1f')](agents[_0x538ca4[_0x369d('0x1a')]])){utils[_0x369d('0x15')](util[_0x369d('0x16')](_0x369d('0x20'),_0x538ca4[_0x369d('0x4')]),_0x538ca4);utils[_0x369d('0x3')](util[_0x369d('0x16')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x538ca4['uniqueid'],agents[_0x538ca4[_0x369d('0x1a')]][_0x369d('0x5')],_0x538ca4[_0x369d('0x1a')]));agents[_0x538ca4[_0x369d('0x1a')]][_0x369d('0x1e')]=!![];agents[_0x538ca4[_0x369d('0x1a')]][_0x369d('0x21')]=utils['now']();agents[_0x538ca4['destuniqueid']][_0x369d('0x9')]=_0x369d('0x22');agents[_0x538ca4[_0x369d('0x1a')]][_0x369d('0x23')]=_0x369d('0x22');agents[_0x538ca4[_0x369d('0x1a')]][_0x369d('0x24')]=_0x538ca4['ringtime']?parseInt(_0x538ca4[_0x369d('0x25')])/0x3e8:0x0;agents[_0x538ca4[_0x369d('0x1a')]][_0x369d('0x26')]=0x0;unanswered[_0x369d('0x27')](_0x538ca4[_0x369d('0x1a')]);}}catch(_0x41367a){utils[_0x369d('0x1d')](util['format'](_0x369d('0x20'),_0x538ca4['uniqueid']),_0x41367a);}};exports['queuecallerabandon']=function(_0x38feda){try{_[_0x369d('0x28')](agents,function(_0x5844c7,_0x104540){if(_0x5844c7['uniqueid']==_0x38feda[_0x369d('0x4')]&&!_[_0x369d('0x29')](unanswered,_0x5844c7[_0x369d('0x1a')])){utils[_0x369d('0x15')](util[_0x369d('0x16')](_0x369d('0x2a'),_0x38feda[_0x369d('0x4')]),_0x38feda);utils['info'](util[_0x369d('0x16')](_0x369d('0x2b'),_0x38feda[_0x369d('0x4')],_0x5844c7[_0x369d('0x5')],_0x5844c7[_0x369d('0x1a')]));_0x5844c7[_0x369d('0x1e')]=!![];_0x5844c7[_0x369d('0x21')]=utils[_0x369d('0x19')]();_0x5844c7['lastevent']=_0x369d('0x2c');_0x5844c7[_0x369d('0x23')]=_0x369d('0x2c');_0x5844c7[_0x369d('0x24')]=_0x38feda[_0x369d('0x24')];_0x5844c7['talktime']=0x0;writeDB(_0x5844c7);}});}catch(_0x35f326){utils[_0x369d('0x1d')](util[_0x369d('0x16')](_0x369d('0x2a'),_0x38feda[_0x369d('0x4')]),_0x35f326);}};exports[_0x369d('0x2d')]=function(_0x50c033){try{if(agents[_0x50c033[_0x369d('0x1a')]]){utils[_0x369d('0x15')](util[_0x369d('0x16')](_0x369d('0x2e'),_0x50c033[_0x369d('0x4')]),_0x50c033);utils[_0x369d('0x3')](util[_0x369d('0x16')](_0x369d('0x2f'),_0x50c033[_0x369d('0x4')],agents[_0x50c033[_0x369d('0x1a')]][_0x369d('0x5')],_0x50c033[_0x369d('0x1a')]));agents[_0x50c033[_0x369d('0x1a')]][_0x369d('0x30')]=utils[_0x369d('0x19')]();agents[_0x50c033[_0x369d('0x1a')]][_0x369d('0x8')]=_0x50c033[_0x369d('0x8')];agents[_0x50c033[_0x369d('0x1a')]][_0x369d('0x1c')]=_0x50c033[_0x369d('0x1c')];agents[_0x50c033[_0x369d('0x1a')]][_0x369d('0x24')]=_0x50c033[_0x369d('0x25')];agents[_0x50c033['destuniqueid']]['lastevent']=_0x369d('0x31');_[_0x369d('0x28')](agents,function(_0x8a1ef5,_0x401bc7){if(_0x8a1ef5[_0x369d('0x1a')]!=_0x50c033[_0x369d('0x1a')]&&_0x8a1ef5[_0x369d('0x4')]==_0x50c033[_0x369d('0x4')]){_0x8a1ef5[_0x369d('0x26')]=0x0;_0x8a1ef5['holdtime']=_0x50c033[_0x369d('0x25')];_0x8a1ef5[_0x369d('0x1e')]=!![];_0x8a1ef5[_0x369d('0x21')]=utils[_0x369d('0x19')]();_0x8a1ef5[_0x369d('0x9')]=_0x369d('0x32');_0x8a1ef5[_0x369d('0x23')]=_0x369d('0x32');_0x8a1ef5['answeredelsewheredestinationuniqueid']=_0x50c033['destuniqueid'];_0x8a1ef5[_0x369d('0x33')]=_0x50c033[_0x369d('0x5')];writeDB(_0x8a1ef5);}});}}catch(_0x30909a){utils['error'](util['format']('[%s][agents][agentconnect]',_0x50c033[_0x369d('0x4')]),_0x30909a);}};exports[_0x369d('0xf')]=function(_0x55dfde){try{if(!_[_0x369d('0x1f')](agents[_0x55dfde[_0x369d('0x1a')]])){utils[_0x369d('0x15')](util[_0x369d('0x16')]('[%s][agents][agentcomplete]',_0x55dfde[_0x369d('0x4')]),_0x55dfde);utils['info'](util[_0x369d('0x16')]('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x55dfde[_0x369d('0x4')],agents[_0x55dfde[_0x369d('0x1a')]][_0x369d('0x5')],_0x55dfde['destuniqueid']));agents[_0x55dfde['destuniqueid']][_0x369d('0xf')]=!![];agents[_0x55dfde[_0x369d('0x1a')]][_0x369d('0x34')]=utils['now']();agents[_0x55dfde[_0x369d('0x1a')]][_0x369d('0x26')]=utils[_0x369d('0x35')](agents[_0x55dfde[_0x369d('0x1a')]][_0x369d('0x34')],agents[_0x55dfde[_0x369d('0x1a')]][_0x369d('0x30')]);agents[_0x55dfde[_0x369d('0x1a')]][_0x369d('0x23')]=_0x55dfde['reason'];agents[_0x55dfde[_0x369d('0x1a')]][_0x369d('0x9')]=_0x369d('0x36');writeDB(agents[_0x55dfde[_0x369d('0x1a')]]);}}catch(_0x27e2c7){utils[_0x369d('0x1d')](util['format'](_0x369d('0x37'),_0x55dfde[_0x369d('0x4')]),_0x27e2c7);}};exports[_0x369d('0x38')]=function(_0x44a357){try{if(!_[_0x369d('0x1f')](agents[_0x44a357[_0x369d('0x39')]])){utils[_0x369d('0x15')](util[_0x369d('0x16')](_0x369d('0x3a'),_0x44a357[_0x369d('0x4')]),_0x44a357);utils[_0x369d('0x3')](util[_0x369d('0x16')]('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x44a357[_0x369d('0x4')],agents[_0x44a357[_0x369d('0x39')]][_0x369d('0x5')],agents[_0x44a357[_0x369d('0x39')]][_0x369d('0x4')]));agents[_0x44a357['transfereruniqueid']][_0x369d('0x3b')]=!![];agents[_0x44a357['transfereruniqueid']][_0x369d('0x3c')]=_0x369d('0x3d');agents[_0x44a357[_0x369d('0x39')]][_0x369d('0x3e')]=_0x44a357[_0x369d('0x3f')];agents[_0x44a357[_0x369d('0x39')]][_0x369d('0x40')]=agents[_0x44a357[_0x369d('0x39')]][_0x369d('0x4')];}}catch(_0x9f1544){utils['error'](util['format'](_0x369d('0x3a'),_0x44a357[_0x369d('0x4')]),_0x9f1544);}};exports[_0x369d('0x41')]=function(_0x4226de){try{utils[_0x369d('0x15')](util['format']('[%s][agents][attendedtransfer]',_0x4226de[_0x369d('0x42')]),_0x4226de);if(_0x4226de[_0x369d('0x42')]==_0x4226de['origtransfererlinkedid']){if(!_[_0x369d('0x1f')](agents[_0x4226de['secondtransfereruniqueid']])){utils[_0x369d('0x3')](util[_0x369d('0x16')](_0x369d('0x43'),_0x4226de['origtransfereruniqueid'],agents[_0x4226de[_0x369d('0x44')]][_0x369d('0x5')]));agents[_0x4226de[_0x369d('0x44')]][_0x369d('0x3b')]=!![];agents[_0x4226de['secondtransfereruniqueid']]['transfertype']=_0x369d('0x45');agents[_0x4226de[_0x369d('0x44')]][_0x369d('0x3e')]=_0x4226de['origtransfererexten'];agents[_0x4226de[_0x369d('0x44')]][_0x369d('0x40')]=_0x4226de[_0x369d('0x42')];}if(_0x4226de['transfereeuniqueid']&&agents[_0x4226de['transfereeuniqueid']]){agents[_0x4226de[_0x369d('0x46')]][_0x369d('0x47')]=0x1;transfers[_0x4226de[_0x369d('0x46')]]=_[_0x369d('0x48')](agents[_0x4226de['transfereeuniqueid']]);transfers[_0x4226de[_0x369d('0x46')]][_0x369d('0x7')]=agents[_0x4226de[_0x369d('0x44')]][_0x369d('0x7')];transfers[_0x4226de[_0x369d('0x46')]]['calleridname']=agents[_0x4226de[_0x369d('0x44')]][_0x369d('0x49')];transfers[_0x4226de[_0x369d('0x46')]]['agentcalledAt']=utils[_0x369d('0x19')]();transfers[_0x4226de['transfereeuniqueid']][_0x369d('0x30')]=utils['now']();transfers[_0x4226de['transfereeuniqueid']]['holdtime']=0x0;transfers[_0x4226de['transfereeuniqueid']][_0x369d('0x47')]=0x2;}}else if(_0x4226de['secondtransfereruniqueid']==_0x4226de[_0x369d('0x4a')]){if(!_['isNil'](agents[_0x4226de[_0x369d('0x42')]])){utils[_0x369d('0x3')](util[_0x369d('0x16')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x4226de[_0x369d('0x42')],agents[_0x4226de[_0x369d('0x42')]][_0x369d('0x5')]));agents[_0x4226de[_0x369d('0x42')]][_0x369d('0x3b')]=!![];agents[_0x4226de[_0x369d('0x42')]]['transfertype']=_0x369d('0x45');agents[_0x4226de['origtransfereruniqueid']]['transferexten']=_0x4226de['secondtransfererexten'];agents[_0x4226de[_0x369d('0x42')]][_0x369d('0x40')]=_0x4226de[_0x369d('0x44')];}if(_0x4226de[_0x369d('0x4b')]&&agents[_0x4226de[_0x369d('0x4b')]]){agents[_0x4226de[_0x369d('0x4b')]][_0x369d('0x47')]=0x1;transfers[_0x4226de[_0x369d('0x4b')]]=_[_0x369d('0x48')](agents[_0x4226de[_0x369d('0x4b')]]);transfers[_0x4226de[_0x369d('0x4b')]][_0x369d('0x7')]=agents[_0x4226de[_0x369d('0x42')]][_0x369d('0x7')];transfers[_0x4226de[_0x369d('0x4b')]][_0x369d('0x49')]=agents[_0x4226de['origtransfereruniqueid']][_0x369d('0x49')];transfers[_0x4226de['transfertargetuniqueid']][_0x369d('0x18')]=utils[_0x369d('0x19')]();transfers[_0x4226de[_0x369d('0x4b')]][_0x369d('0x30')]=utils[_0x369d('0x19')]();transfers[_0x4226de['transfertargetuniqueid']][_0x369d('0x24')]=0x0;transfers[_0x4226de['transfertargetuniqueid']]['agententerreason']=0x2;}}}catch(_0x3ee715){utils[_0x369d('0x1d')](util[_0x369d('0x16')](_0x369d('0x4c'),_0x4226de[_0x369d('0x42')]),_0x3ee715);}};exports[_0x369d('0x4d')]=function(_0x341d93){try{utils[_0x369d('0x15')](util['format'](_0x369d('0x4e'),_0x341d93[_0x369d('0x4')]),_0x341d93);if(agents[_0x341d93['uniqueid']]&&agents[_0x341d93[_0x369d('0x4')]][_0x369d('0x23')]===_0x369d('0x22')){if(_0x341d93['cause']==='21'){agents[_0x341d93[_0x369d('0x4')]]['reason']=_0x369d('0x4f');agents[_0x341d93[_0x369d('0x4')]][_0x369d('0x9')]=_0x369d('0x4f');}utils[_0x369d('0x3')](util[_0x369d('0x16')](_0x369d('0x50'),_0x341d93['uniqueid'],agents[_0x341d93[_0x369d('0x4')]][_0x369d('0x5')],agents[_0x341d93['uniqueid']][_0x369d('0x23')],agents[_0x341d93['uniqueid']][_0x369d('0x9')]));writeDB(agents[_0x341d93[_0x369d('0x4')]]);var _0x2b7897=unanswered['indexOf'](_0x341d93[_0x369d('0x4')]);if(_0x2b7897>-0x1){unanswered[_0x369d('0x51')](_0x2b7897,0x1);}}if(transfers[_0x341d93['uniqueid']]){transfers[_0x341d93[_0x369d('0x4')]][_0x369d('0xf')]=!![];transfers[_0x341d93[_0x369d('0x4')]]['agentcompleteAt']=utils[_0x369d('0x19')]();transfers[_0x341d93[_0x369d('0x4')]][_0x369d('0x26')]=utils[_0x369d('0x35')](transfers[_0x341d93[_0x369d('0x4')]]['agentcompleteAt'],transfers[_0x341d93[_0x369d('0x4')]][_0x369d('0x30')]);transfers[_0x341d93[_0x369d('0x4')]][_0x369d('0x23')]=_0x369d('0x52');transfers[_0x341d93['uniqueid']]['lastevent']=_0x369d('0x36');utils[_0x369d('0x3')](util[_0x369d('0x16')](_0x369d('0x50'),_0x341d93[_0x369d('0x4')],transfers[_0x341d93[_0x369d('0x4')]]['membername'],transfers[_0x341d93[_0x369d('0x4')]][_0x369d('0x23')],transfers[_0x341d93['uniqueid']][_0x369d('0x9')]));writeDB(transfers[_0x341d93['uniqueid']],!![]);}if(agents[_0x341d93[_0x369d('0x4')]]&&agents[_0x341d93['uniqueid']][_0x369d('0x30')]){agents[_0x341d93[_0x369d('0x4')]]['agentcomplete']=!![];agents[_0x341d93[_0x369d('0x4')]]['agentcompleteAt']=utils[_0x369d('0x19')]();agents[_0x341d93['uniqueid']]['talktime']=utils[_0x369d('0x35')](agents[_0x341d93[_0x369d('0x4')]][_0x369d('0x34')],agents[_0x341d93[_0x369d('0x4')]][_0x369d('0x30')]);agents[_0x341d93['uniqueid']][_0x369d('0x23')]=agents[_0x341d93[_0x369d('0x4')]][_0x369d('0x3b')]?_0x369d('0x3b'):_0x369d('0x52');agents[_0x341d93[_0x369d('0x4')]][_0x369d('0x9')]=_0x369d('0x36');utils[_0x369d('0x3')](util['format'](_0x369d('0x50'),_0x341d93[_0x369d('0x4')],agents[_0x341d93[_0x369d('0x4')]][_0x369d('0x5')],agents[_0x341d93['uniqueid']][_0x369d('0x23')],agents[_0x341d93['uniqueid']][_0x369d('0x9')]));writeDB(agents[_0x341d93[_0x369d('0x4')]]);}}catch(_0x34a225){utils[_0x369d('0x1d')](util[_0x369d('0x16')](_0x369d('0x4e'),_0x341d93[_0x369d('0x4')]),_0x34a225);}}; \ No newline at end of file +var _0x4522=['agent','./utils','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentcomplete','agentacw','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalledAt','called','info','error','[%s][agents][agentcalled]','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','now','reason','timeout','holdtime','ringtime','talktime','queuecallerabandon','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','agentconnect','debug','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connect','forIn','answered_elsewhere','answeredelsewheremembername','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','complete','[%s][agents][agentcomplete]','blindtransfer','transfereruniqueid','transfer','transfertype','extension','transferuniqueid','[%s][agents][blindtransfer]','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','transferexten','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','splice','agentcompleteAt'];(function(_0x1d502b,_0x183fbe){var _0x50dbf2=function(_0x2f6bd2){while(--_0x2f6bd2){_0x1d502b['push'](_0x1d502b['shift']());}};_0x50dbf2(++_0x183fbe);}(_0x4522,0x1a0));var _0x2452=function(_0x17d82f,_0x5d9172){_0x17d82f=_0x17d82f-0x0;var _0x58137b=_0x4522[_0x17d82f];return _0x58137b;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x2452('0x0'));var agents={};var transfers={};var unanswered=[];function writeDB(_0xa5f6b7,_0x4a08d4){utils['info'](util[_0x2452('0x1')](_0x2452('0x2'),_0xa5f6b7[_0x2452('0x3')],_0xa5f6b7[_0x2452('0x4')],_0xa5f6b7[_0x2452('0x5')],_0xa5f6b7[_0x2452('0x6')],_0xa5f6b7[_0x2452('0x7')],_0xa5f6b7[_0x2452('0x8')],_0xa5f6b7[_0x2452('0x9')],_0xa5f6b7[_0x2452('0xa')]));if(_0xa5f6b7[_0x2452('0x5')]){utils[_0x2452('0xb')](_0xa5f6b7[_0x2452('0x5')])[_0x2452('0xc')](function(_0x2e5caa){if(_0x2e5caa){_0xa5f6b7[_0x2452('0xd')]=_0x2e5caa['type'];_0xa5f6b7['agentacw']=_0xa5f6b7[_0x2452('0xe')]?_0x2e5caa['acw']:![];_0xa5f6b7['acwtime']=_0xa5f6b7[_0x2452('0xf')]?_0x2e5caa[_0x2452('0x10')]:0x0;}utils[_0x2452('0x11')](_0x2452('0x12'),_0xa5f6b7);});}else{utils[_0x2452('0x11')](_0x2452('0x12'),_0xa5f6b7);}if(_0x4a08d4){delete transfers[_0xa5f6b7[_0x2452('0x3')]];}else{delete agents[_0xa5f6b7[_0x2452('0x13')]];}}exports['agentcalled']=function(_0x529fb2){try{utils['debug'](util[_0x2452('0x1')]('[%s][agents][agentcalled]',_0x529fb2[_0x2452('0x3')]),_0x529fb2);agents[_0x529fb2['destuniqueid']]=_0x529fb2;agents[_0x529fb2[_0x2452('0x13')]][_0x2452('0x14')]=utils['now']();agents[_0x529fb2[_0x2452('0x13')]]['lastevent']=_0x2452('0x15');agents[_0x529fb2[_0x2452('0x13')]][_0x2452('0x9')]=null;agents[_0x529fb2[_0x2452('0x13')]]['connectedlinename']=null;utils[_0x2452('0x16')](util[_0x2452('0x1')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x529fb2['uniqueid'],agents[_0x529fb2[_0x2452('0x13')]][_0x2452('0x6')],_0x529fb2[_0x2452('0x13')]));}catch(_0x57cb03){utils[_0x2452('0x17')](util[_0x2452('0x1')](_0x2452('0x18'),_0x529fb2[_0x2452('0x3')]),_0x57cb03);}};exports[_0x2452('0x19')]=function(_0x1c70cb){try{if(!_[_0x2452('0x1a')](agents[_0x1c70cb[_0x2452('0x13')]])){utils['debug'](util['format'](_0x2452('0x1b'),_0x1c70cb[_0x2452('0x3')]),_0x1c70cb);utils['info'](util[_0x2452('0x1')](_0x2452('0x1c'),_0x1c70cb[_0x2452('0x3')],agents[_0x1c70cb[_0x2452('0x13')]][_0x2452('0x6')],_0x1c70cb[_0x2452('0x13')]));agents[_0x1c70cb[_0x2452('0x13')]]['agentringnoanswer']=!![];agents[_0x1c70cb[_0x2452('0x13')]][_0x2452('0x1d')]=utils[_0x2452('0x1e')]();agents[_0x1c70cb[_0x2452('0x13')]][_0x2452('0xa')]='timeout';agents[_0x1c70cb['destuniqueid']][_0x2452('0x1f')]=_0x2452('0x20');agents[_0x1c70cb[_0x2452('0x13')]][_0x2452('0x21')]=_0x1c70cb[_0x2452('0x22')]?parseInt(_0x1c70cb['ringtime'])/0x3e8:0x0;agents[_0x1c70cb[_0x2452('0x13')]][_0x2452('0x23')]=0x0;unanswered['push'](_0x1c70cb['destuniqueid']);}}catch(_0x332878){utils[_0x2452('0x17')](util[_0x2452('0x1')](_0x2452('0x1b'),_0x1c70cb[_0x2452('0x3')]),_0x332878);}};exports[_0x2452('0x24')]=function(_0x504162){try{_['forIn'](agents,function(_0x46b611,_0x454e0a){if(_0x46b611[_0x2452('0x3')]==_0x504162['uniqueid']&&!_[_0x2452('0x25')](unanswered,_0x46b611[_0x2452('0x13')])){utils['debug'](util[_0x2452('0x1')](_0x2452('0x26'),_0x504162[_0x2452('0x3')]),_0x504162);utils[_0x2452('0x16')](util[_0x2452('0x1')](_0x2452('0x27'),_0x504162[_0x2452('0x3')],_0x46b611[_0x2452('0x6')],_0x46b611[_0x2452('0x13')]));_0x46b611[_0x2452('0x19')]=!![];_0x46b611[_0x2452('0x1d')]=utils[_0x2452('0x1e')]();_0x46b611[_0x2452('0xa')]='abandoned';_0x46b611[_0x2452('0x1f')]=_0x2452('0x28');_0x46b611['holdtime']=_0x504162[_0x2452('0x21')];_0x46b611['talktime']=0x0;writeDB(_0x46b611);}});}catch(_0x2c6843){utils[_0x2452('0x17')](util['format'](_0x2452('0x26'),_0x504162[_0x2452('0x3')]),_0x2c6843);}};exports[_0x2452('0x29')]=function(_0x5ce5fb){try{if(agents[_0x5ce5fb[_0x2452('0x13')]]){utils[_0x2452('0x2a')](util['format'](_0x2452('0x2b'),_0x5ce5fb[_0x2452('0x3')]),_0x5ce5fb);utils[_0x2452('0x16')](util[_0x2452('0x1')](_0x2452('0x2c'),_0x5ce5fb['uniqueid'],agents[_0x5ce5fb['destuniqueid']]['membername'],_0x5ce5fb[_0x2452('0x13')]));agents[_0x5ce5fb[_0x2452('0x13')]][_0x2452('0x2d')]=utils[_0x2452('0x1e')]();agents[_0x5ce5fb[_0x2452('0x13')]]['connectedlinenum']=_0x5ce5fb[_0x2452('0x9')];agents[_0x5ce5fb['destuniqueid']]['connectedlinename']=_0x5ce5fb[_0x2452('0x2e')];agents[_0x5ce5fb['destuniqueid']][_0x2452('0x21')]=_0x5ce5fb[_0x2452('0x22')];agents[_0x5ce5fb['destuniqueid']][_0x2452('0xa')]=_0x2452('0x2f');_[_0x2452('0x30')](agents,function(_0x34d7f9,_0x2babbe){if(_0x34d7f9[_0x2452('0x13')]!=_0x5ce5fb[_0x2452('0x13')]&&_0x34d7f9[_0x2452('0x3')]==_0x5ce5fb['uniqueid']){_0x34d7f9[_0x2452('0x23')]=0x0;_0x34d7f9['holdtime']=_0x5ce5fb[_0x2452('0x22')];_0x34d7f9[_0x2452('0x19')]=!![];_0x34d7f9['agentringnoanswerAt']=utils[_0x2452('0x1e')]();_0x34d7f9[_0x2452('0xa')]=_0x2452('0x31');_0x34d7f9[_0x2452('0x1f')]=_0x2452('0x31');_0x34d7f9['answeredelsewheredestinationuniqueid']=_0x5ce5fb[_0x2452('0x13')];_0x34d7f9[_0x2452('0x32')]=_0x5ce5fb['membername'];writeDB(_0x34d7f9);}});}}catch(_0xfabbd8){utils[_0x2452('0x17')](util[_0x2452('0x1')](_0x2452('0x2b'),_0x5ce5fb['uniqueid']),_0xfabbd8);}};exports[_0x2452('0xe')]=function(_0x304942){try{if(!_[_0x2452('0x1a')](agents[_0x304942[_0x2452('0x13')]])){utils[_0x2452('0x2a')](util[_0x2452('0x1')]('[%s][agents][agentcomplete]',_0x304942[_0x2452('0x3')]),_0x304942);utils['info'](util[_0x2452('0x1')](_0x2452('0x33'),_0x304942['uniqueid'],agents[_0x304942['destuniqueid']]['membername'],_0x304942['destuniqueid']));agents[_0x304942[_0x2452('0x13')]]['agentcomplete']=!![];agents[_0x304942[_0x2452('0x13')]]['agentcompleteAt']=utils[_0x2452('0x1e')]();agents[_0x304942[_0x2452('0x13')]]['talktime']=utils['diffTime'](agents[_0x304942[_0x2452('0x13')]]['agentcompleteAt'],agents[_0x304942[_0x2452('0x13')]][_0x2452('0x2d')]);agents[_0x304942[_0x2452('0x13')]][_0x2452('0x1f')]=_0x304942['reason'];agents[_0x304942['destuniqueid']][_0x2452('0xa')]=_0x2452('0x34');writeDB(agents[_0x304942[_0x2452('0x13')]]);}}catch(_0x2d06f2){utils[_0x2452('0x17')](util['format'](_0x2452('0x35'),_0x304942['uniqueid']),_0x2d06f2);}};exports[_0x2452('0x36')]=function(_0x53fd05){try{if(!_[_0x2452('0x1a')](agents[_0x53fd05[_0x2452('0x37')]])){utils['debug'](util[_0x2452('0x1')]('[%s][agents][blindtransfer]',_0x53fd05[_0x2452('0x3')]),_0x53fd05);utils['info'](util['format']('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x53fd05[_0x2452('0x3')],agents[_0x53fd05[_0x2452('0x37')]][_0x2452('0x6')],agents[_0x53fd05['transfereruniqueid']][_0x2452('0x3')]));agents[_0x53fd05[_0x2452('0x37')]][_0x2452('0x38')]=!![];agents[_0x53fd05[_0x2452('0x37')]][_0x2452('0x39')]='blind';agents[_0x53fd05[_0x2452('0x37')]]['transferexten']=_0x53fd05[_0x2452('0x3a')];agents[_0x53fd05[_0x2452('0x37')]][_0x2452('0x3b')]=agents[_0x53fd05[_0x2452('0x37')]][_0x2452('0x3')];}}catch(_0x2096e2){utils[_0x2452('0x17')](util[_0x2452('0x1')](_0x2452('0x3c'),_0x53fd05['uniqueid']),_0x2096e2);}};exports[_0x2452('0x3d')]=function(_0x595f9f){try{utils[_0x2452('0x2a')](util['format'](_0x2452('0x3e'),_0x595f9f[_0x2452('0x3f')]),_0x595f9f);if(_0x595f9f['origtransfereruniqueid']==_0x595f9f[_0x2452('0x40')]){if(!_[_0x2452('0x1a')](agents[_0x595f9f[_0x2452('0x41')]])){utils[_0x2452('0x16')](util[_0x2452('0x1')](_0x2452('0x42'),_0x595f9f[_0x2452('0x3f')],agents[_0x595f9f[_0x2452('0x41')]][_0x2452('0x6')]));agents[_0x595f9f[_0x2452('0x41')]][_0x2452('0x38')]=!![];agents[_0x595f9f['secondtransfereruniqueid']][_0x2452('0x39')]='ATTENDED';agents[_0x595f9f[_0x2452('0x41')]]['transferexten']=_0x595f9f[_0x2452('0x43')];agents[_0x595f9f[_0x2452('0x41')]][_0x2452('0x3b')]=_0x595f9f[_0x2452('0x3f')];}if(_0x595f9f[_0x2452('0x44')]&&agents[_0x595f9f[_0x2452('0x44')]]){agents[_0x595f9f[_0x2452('0x44')]][_0x2452('0x45')]=0x1;transfers[_0x595f9f[_0x2452('0x44')]]=_[_0x2452('0x46')](agents[_0x595f9f[_0x2452('0x44')]]);transfers[_0x595f9f['transfereeuniqueid']][_0x2452('0x8')]=agents[_0x595f9f[_0x2452('0x41')]][_0x2452('0x8')];transfers[_0x595f9f[_0x2452('0x44')]][_0x2452('0x47')]=agents[_0x595f9f[_0x2452('0x41')]]['calleridname'];transfers[_0x595f9f[_0x2452('0x44')]][_0x2452('0x14')]=utils['now']();transfers[_0x595f9f[_0x2452('0x44')]][_0x2452('0x2d')]=utils[_0x2452('0x1e')]();transfers[_0x595f9f[_0x2452('0x44')]][_0x2452('0x21')]=0x0;transfers[_0x595f9f[_0x2452('0x44')]][_0x2452('0x45')]=0x2;}}else if(_0x595f9f[_0x2452('0x41')]==_0x595f9f[_0x2452('0x48')]){if(!_[_0x2452('0x1a')](agents[_0x595f9f[_0x2452('0x3f')]])){utils['info'](util['format'](_0x2452('0x42'),_0x595f9f['origtransfereruniqueid'],agents[_0x595f9f[_0x2452('0x3f')]][_0x2452('0x6')]));agents[_0x595f9f[_0x2452('0x3f')]][_0x2452('0x38')]=!![];agents[_0x595f9f[_0x2452('0x3f')]][_0x2452('0x39')]='ATTENDED';agents[_0x595f9f['origtransfereruniqueid']][_0x2452('0x49')]=_0x595f9f['secondtransfererexten'];agents[_0x595f9f[_0x2452('0x3f')]]['transferuniqueid']=_0x595f9f[_0x2452('0x41')];}if(_0x595f9f[_0x2452('0x4a')]&&agents[_0x595f9f[_0x2452('0x4a')]]){agents[_0x595f9f[_0x2452('0x4a')]]['agententerreason']=0x1;transfers[_0x595f9f['transfertargetuniqueid']]=_['clone'](agents[_0x595f9f[_0x2452('0x4a')]]);transfers[_0x595f9f[_0x2452('0x4a')]]['calleridnum']=agents[_0x595f9f['origtransfereruniqueid']]['calleridnum'];transfers[_0x595f9f['transfertargetuniqueid']]['calleridname']=agents[_0x595f9f[_0x2452('0x3f')]]['calleridname'];transfers[_0x595f9f['transfertargetuniqueid']][_0x2452('0x14')]=utils[_0x2452('0x1e')]();transfers[_0x595f9f[_0x2452('0x4a')]][_0x2452('0x2d')]=utils[_0x2452('0x1e')]();transfers[_0x595f9f[_0x2452('0x4a')]]['holdtime']=0x0;transfers[_0x595f9f[_0x2452('0x4a')]][_0x2452('0x45')]=0x2;}}}catch(_0x45c850){utils['error'](util['format'](_0x2452('0x3e'),_0x595f9f[_0x2452('0x3f')]),_0x45c850);}};exports[_0x2452('0x4b')]=function(_0x1dec54){try{utils[_0x2452('0x2a')](util[_0x2452('0x1')](_0x2452('0x4c'),_0x1dec54[_0x2452('0x3')]),_0x1dec54);if(agents[_0x1dec54['uniqueid']]&&agents[_0x1dec54[_0x2452('0x3')]][_0x2452('0x1f')]===_0x2452('0x20')){if(_0x1dec54[_0x2452('0x4d')]==='21'){agents[_0x1dec54['uniqueid']][_0x2452('0x1f')]=_0x2452('0x4e');agents[_0x1dec54['uniqueid']][_0x2452('0xa')]=_0x2452('0x4e');}utils[_0x2452('0x16')](util[_0x2452('0x1')](_0x2452('0x4f'),_0x1dec54[_0x2452('0x3')],agents[_0x1dec54[_0x2452('0x3')]][_0x2452('0x6')],agents[_0x1dec54['uniqueid']]['reason'],agents[_0x1dec54[_0x2452('0x3')]][_0x2452('0xa')]));writeDB(agents[_0x1dec54[_0x2452('0x3')]]);var _0x1530fe=unanswered['indexOf'](_0x1dec54[_0x2452('0x3')]);if(_0x1530fe>-0x1){unanswered[_0x2452('0x50')](_0x1530fe,0x1);}}if(transfers[_0x1dec54[_0x2452('0x3')]]){transfers[_0x1dec54[_0x2452('0x3')]]['agentcomplete']=!![];transfers[_0x1dec54[_0x2452('0x3')]][_0x2452('0x51')]=utils[_0x2452('0x1e')]();transfers[_0x1dec54[_0x2452('0x3')]]['talktime']=utils['diffTime'](transfers[_0x1dec54[_0x2452('0x3')]][_0x2452('0x51')],transfers[_0x1dec54['uniqueid']][_0x2452('0x2d')]);transfers[_0x1dec54[_0x2452('0x3')]][_0x2452('0x1f')]=_0x2452('0x52');transfers[_0x1dec54[_0x2452('0x3')]][_0x2452('0xa')]=_0x2452('0x34');utils[_0x2452('0x16')](util[_0x2452('0x1')](_0x2452('0x4f'),_0x1dec54[_0x2452('0x3')],transfers[_0x1dec54[_0x2452('0x3')]][_0x2452('0x6')],transfers[_0x1dec54[_0x2452('0x3')]][_0x2452('0x1f')],transfers[_0x1dec54[_0x2452('0x3')]]['lastevent']));writeDB(transfers[_0x1dec54[_0x2452('0x3')]],!![]);}if(agents[_0x1dec54[_0x2452('0x3')]]&&agents[_0x1dec54[_0x2452('0x3')]]['agentconnectAt']){agents[_0x1dec54['uniqueid']]['agentcomplete']=!![];agents[_0x1dec54[_0x2452('0x3')]][_0x2452('0x51')]=utils[_0x2452('0x1e')]();agents[_0x1dec54[_0x2452('0x3')]]['talktime']=utils['diffTime'](agents[_0x1dec54['uniqueid']][_0x2452('0x51')],agents[_0x1dec54['uniqueid']][_0x2452('0x2d')]);agents[_0x1dec54['uniqueid']][_0x2452('0x1f')]=agents[_0x1dec54['uniqueid']][_0x2452('0x38')]?'transfer':_0x2452('0x52');agents[_0x1dec54[_0x2452('0x3')]][_0x2452('0xa')]=_0x2452('0x34');utils[_0x2452('0x16')](util['format'](_0x2452('0x4f'),_0x1dec54[_0x2452('0x3')],agents[_0x1dec54[_0x2452('0x3')]][_0x2452('0x6')],agents[_0x1dec54[_0x2452('0x3')]][_0x2452('0x1f')],agents[_0x1dec54[_0x2452('0x3')]][_0x2452('0xa')]));writeDB(agents[_0x1dec54[_0x2452('0x3')]]);}}catch(_0x3b681c){utils[_0x2452('0x17')](util['format'](_0x2452('0x4c'),_0x1dec54['uniqueid']),_0x3b681c);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 5112285..699e632 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 _0xf963=['systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','toNumber','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','diffTime','starttime','answertime','endtime','attendedtransfer','[%s][calls][attendedtransfer]','origtransfereruniqueid','localtwolinkedid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','[%s][calls][musiconholdstop]\x20mohtime:%s','mohtime','varset','variable','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','\x22\x20<','xmd-callerid-preview','xmd-callerid','xmd-queue','xmcs-queue','[%s][calls][varset]\x20variable:%s\x20value:%s','lastapplication','Queue','lastdata','xmd-contactid','xmd-cdrtype','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','startsWith','cdr','split','substring','lastIndexOf','hangup','noop','execif','set','gotoif','lodash','./transfers.controller','NO\x20ANSWER','ANSWERED','FAILED','uniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','membername','interface','calleridnum','connectedlinenum','accountcode','then','request','blinds','recording','newchannel','debug','[%s][calls][newchannel]','linkedid','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','error','newstate','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s'];(function(_0x100274,_0x3608d8){var _0x4345d8=function(_0x4e7873){while(--_0x4e7873){_0x100274['push'](_0x100274['shift']());}};_0x4345d8(++_0x3608d8);}(_0xf963,0x11d));var _0x3f96=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xf963[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x3f96('0x0'));var util=require('util');var utils=require('./utils');var transfers=require(_0x3f96('0x1'));var dispositions=[_0x3f96('0x2'),'FAILED','FAILED',_0x3f96('0x2'),_0x3f96('0x2'),_0x3f96('0x2'),_0x3f96('0x3'),'BUSY',_0x3f96('0x4'),'FAILED',_0x3f96('0x4')];var channels={};function writeDB(_0x43633b){var _0x422ffd;if(transfers['blinds'][_0x43633b[_0x3f96('0x5')]]){_0x422ffd=_0x43633b[_0x3f96('0x5')];_0x43633b['uniqueid']=transfers['blinds'][_0x43633b['uniqueid']]['transfereeuniqueid'];}utils[_0x3f96('0x6')](util[_0x3f96('0x7')](_0x3f96('0x8'),_0x43633b[_0x3f96('0x5')],_0x43633b[_0x3f96('0x9')],_0x43633b['queue'],_0x43633b[_0x3f96('0xa')],_0x43633b[_0x3f96('0xb')],_0x43633b[_0x3f96('0xc')],_0x43633b[_0x3f96('0xd')],_0x43633b['lastevent']));if(_0x43633b[_0x3f96('0xe')]){utils['getUserByInternal'](_0x43633b[_0x3f96('0xe')])[_0x3f96('0xf')](function(_0xdf9325){if(_0xdf9325){_0x43633b['UserId']=_0xdf9325['id'];}utils[_0x3f96('0x10')]('CreateVoiceCallReport',_0x43633b);});}else{utils[_0x3f96('0x10')]('CreateVoiceCallReport',_0x43633b);}if(channels[_0x43633b['uniqueid']]){delete channels[_0x43633b['uniqueid']];}else if(_0x422ffd&&channels[_0x422ffd]){if(!transfers[_0x3f96('0x11')][_0x422ffd][_0x3f96('0x12')])delete transfers[_0x3f96('0x11')][_0x422ffd];delete channels[_0x422ffd];}}exports[_0x3f96('0x13')]=function(_0x569d2e){try{utils[_0x3f96('0x14')](util[_0x3f96('0x7')](_0x3f96('0x15'),_0x569d2e['uniqueid']),_0x569d2e);if(_0x569d2e[_0x3f96('0x5')]==_0x569d2e[_0x3f96('0x16')]&&_0x569d2e[_0x3f96('0x9')]!='OutgoingSpoolFailed'){utils[_0x3f96('0x6')](util[_0x3f96('0x7')](_0x3f96('0x17'),_0x569d2e[_0x3f96('0x5')],_0x569d2e[_0x3f96('0x18')],_0x569d2e[_0x3f96('0x19')]));channels[_0x569d2e['uniqueid']]={'uniqueid':_0x569d2e[_0x3f96('0x5')],'accountcode':_0x569d2e['accountcode'],'source':_0x569d2e[_0x3f96('0xc')],'destination':_0x569d2e[_0x3f96('0x19')],'destinationcontext':_0x569d2e['context'],'channel':_0x569d2e[_0x3f96('0x9')],'starttime':utils[_0x3f96('0x1a')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0x3f96('0x1b')};}}catch(_0x3bde31){utils[_0x3f96('0x1c')](util[_0x3f96('0x7')](_0x3f96('0x15'),_0x569d2e[_0x3f96('0x5')]),_0x3bde31);}};exports[_0x3f96('0x1d')]=function(_0x4fbcd9){try{utils['debug'](util[_0x3f96('0x7')]('[%s][calls][newstate]',_0x4fbcd9['uniqueid']),_0x4fbcd9);if(!_[_0x3f96('0x1e')](channels[_0x4fbcd9['uniqueid']])&&_0x4fbcd9[_0x3f96('0x1f')]==0x6){utils['info'](util[_0x3f96('0x7')](_0x3f96('0x20'),_0x4fbcd9[_0x3f96('0x5')],_0x4fbcd9[_0x3f96('0x18')],_0x4fbcd9[_0x3f96('0x9')]));if(_[_0x3f96('0x1e')](channels[_0x4fbcd9['uniqueid']][_0x3f96('0x21')])){channels[_0x4fbcd9[_0x3f96('0x5')]]['systemanswertime']=utils[_0x3f96('0x1a')]();}}else if(!_[_0x3f96('0x1e')](channels[_0x4fbcd9['linkedid']])&&_0x4fbcd9[_0x3f96('0x1f')]==0x6&&_0x4fbcd9['context']!=_0x3f96('0x22')){utils['info'](util[_0x3f96('0x7')](_0x3f96('0x23'),_0x4fbcd9[_0x3f96('0x5')],_0x4fbcd9[_0x3f96('0x16')],_0x4fbcd9[_0x3f96('0x18')],_0x4fbcd9[_0x3f96('0x9')]));channels[_0x4fbcd9[_0x3f96('0x16')]][_0x3f96('0xe')]=_0x4fbcd9[_0x3f96('0xe')];channels[_0x4fbcd9[_0x3f96('0x16')]][_0x3f96('0x24')]=_0x4fbcd9[_0x3f96('0x9')];if(_[_0x3f96('0x1e')](channels[_0x4fbcd9['linkedid']]['answertime'])){channels[_0x4fbcd9[_0x3f96('0x16')]]['answertime']=utils[_0x3f96('0x1a')]();}channels[_0x4fbcd9[_0x3f96('0x16')]]['disposition']=dispositions[_[_0x3f96('0x25')](_0x4fbcd9['channelstate'])]||_0x3f96('0x3');}}catch(_0x4d5019){utils[_0x3f96('0x1c')](util[_0x3f96('0x7')]('[%s][calls][newstate]',_0x4fbcd9[_0x3f96('0x5')]),_0x4d5019);}};exports['hangup']=function(_0x7a2d24){try{if(!_['isNil'](channels[_0x7a2d24[_0x3f96('0x5')]])){utils[_0x3f96('0x14')](util[_0x3f96('0x7')](_0x3f96('0x26'),_0x7a2d24[_0x3f96('0x5')]),_0x7a2d24);if(_['isNil'](channels[_0x7a2d24[_0x3f96('0x5')]][_0x3f96('0x27')])){channels[_0x7a2d24[_0x3f96('0x5')]][_0x3f96('0x27')]=_0x7a2d24[_0x3f96('0x28')]+'\x20<'+_0x7a2d24[_0x3f96('0xc')]+'>';}utils['info'](util[_0x3f96('0x7')](_0x3f96('0x29'),_0x7a2d24['uniqueid'],channels[_0x7a2d24[_0x3f96('0x5')]][_0x3f96('0x27')],_0x7a2d24[_0x3f96('0x2a')]));channels[_0x7a2d24[_0x3f96('0x5')]]['endtime']=utils[_0x3f96('0x1a')]();channels[_0x7a2d24[_0x3f96('0x5')]]['duration']=utils[_0x3f96('0x2b')](channels[_0x7a2d24['uniqueid']]['endtime'],channels[_0x7a2d24[_0x3f96('0x5')]][_0x3f96('0x2c')]);channels[_0x7a2d24[_0x3f96('0x5')]]['billableseconds']=channels[_0x7a2d24[_0x3f96('0x5')]][_0x3f96('0x2d')]?utils['diffTime'](channels[_0x7a2d24[_0x3f96('0x5')]][_0x3f96('0x2e')],channels[_0x7a2d24[_0x3f96('0x5')]]['answertime']):0x0;writeDB(channels[_0x7a2d24[_0x3f96('0x5')]]);}}catch(_0x2c8a5b){utils[_0x3f96('0x1c')](util[_0x3f96('0x7')](_0x3f96('0x26'),_0x7a2d24['uniqueid']),_0x2c8a5b);}};exports[_0x3f96('0x2f')]=function(_0x415fa5){try{if(!_[_0x3f96('0x1e')](channels[_0x415fa5['localtwolinkedid']])){utils['debug'](util['format'](_0x3f96('0x30'),_0x415fa5[_0x3f96('0x31')]),_0x415fa5);if(channels[_0x415fa5[_0x3f96('0x32')]]['channel']==_0x415fa5[_0x3f96('0x33')]){utils['info'](util[_0x3f96('0x7')](_0x3f96('0x34'),_0x415fa5[_0x3f96('0x31')],_0x415fa5[_0x3f96('0x32')],_0x415fa5[_0x3f96('0x35')]));channels[_0x415fa5[_0x3f96('0x32')]][_0x3f96('0x24')]=_0x415fa5[_0x3f96('0x35')];channels[_0x415fa5[_0x3f96('0x32')]][_0x3f96('0x36')]=_0x3f96('0x37');}else if(channels[_0x415fa5[_0x3f96('0x32')]][_0x3f96('0x9')]=_0x415fa5[_0x3f96('0x38')]){utils['info'](util[_0x3f96('0x7')](_0x3f96('0x34'),_0x415fa5[_0x3f96('0x31')],_0x415fa5['localtwolinkedid'],_0x415fa5[_0x3f96('0x39')]));channels[_0x415fa5[_0x3f96('0x32')]][_0x3f96('0x24')]=_0x415fa5['origtransfererchannel'];channels[_0x415fa5[_0x3f96('0x32')]][_0x3f96('0x36')]=_0x3f96('0x37');}}}catch(_0x12fb89){utils[_0x3f96('0x1c')](util[_0x3f96('0x7')](_0x3f96('0x30'),_0x415fa5[_0x3f96('0x31')]),_0x12fb89);}};exports[_0x3f96('0x3a')]=function(_0x40a455){try{if(!_['isNil'](channels[_0x40a455['uniqueid']])){utils[_0x3f96('0x14')](util[_0x3f96('0x7')](_0x3f96('0x3b'),_0x40a455[_0x3f96('0x5')]),_0x40a455);channels[_0x40a455['uniqueid']][_0x3f96('0x3c')]=utils[_0x3f96('0x1a')]();utils[_0x3f96('0x6')](util[_0x3f96('0x7')](_0x3f96('0x3d'),_0x40a455[_0x3f96('0x5')],channels[_0x40a455[_0x3f96('0x5')]][_0x3f96('0x3c')]));}}catch(_0x233f5c){utils['error'](util['format']('[%s][calls][musiconholdstart]',_0x40a455[_0x3f96('0x5')]),_0x233f5c);}};exports[_0x3f96('0x3e')]=function(_0x1a2505){try{if(!_['isNil'](channels[_0x1a2505[_0x3f96('0x5')]])){utils['debug'](util[_0x3f96('0x7')](_0x3f96('0x3f'),_0x1a2505[_0x3f96('0x5')]),_0x1a2505);if(!_[_0x3f96('0x1e')](channels[_0x1a2505['uniqueid']][_0x3f96('0x3c')])){channels[_0x1a2505['uniqueid']]['mohtime']+=utils[_0x3f96('0x2b')](utils['now'](),channels[_0x1a2505[_0x3f96('0x5')]][_0x3f96('0x3c')]);utils[_0x3f96('0x6')](util['format'](_0x3f96('0x40'),_0x1a2505[_0x3f96('0x5')],channels[_0x1a2505[_0x3f96('0x5')]][_0x3f96('0x41')]));delete channels[_0x1a2505[_0x3f96('0x5')]][_0x3f96('0x3c')];}}}catch(_0x1a5d4f){utils[_0x3f96('0x1c')](util[_0x3f96('0x7')]('[%s][calls][musiconholdstop]',_0x1a2505[_0x3f96('0x5')]),_0x1a5d4f);}};exports[_0x3f96('0x42')]=function(_0x26e140){try{if(!_['isNil'](channels[_0x26e140[_0x3f96('0x5')]])){utils['debug'](util[_0x3f96('0x7')]('[%s][calls][varset]',_0x26e140[_0x3f96('0x5')]),_0x26e140);if(!_['isNil'](_0x26e140[_0x3f96('0x43')]['xmd-originatecalleridnum'])){utils[_0x3f96('0x6')](util['format'](_0x3f96('0x44'),_0x26e140[_0x3f96('0x5')],_0x26e140[_0x3f96('0x45')]));channels[_0x26e140[_0x3f96('0x5')]][_0x3f96('0x46')]=_0x26e140[_0x3f96('0x45')];}if(!_[_0x3f96('0x1e')](_0x26e140[_0x3f96('0x43')][_0x3f96('0x47')])){utils[_0x3f96('0x6')](util['format'](_0x3f96('0x48'),_0x26e140['uniqueid'],_0x26e140[_0x3f96('0x45')]));channels[_0x26e140[_0x3f96('0x5')]]['destination']=_0x26e140[_0x3f96('0x45')];channels[_0x26e140[_0x3f96('0x5')]][_0x3f96('0x27')]='\x22'+_0x26e140[_0x3f96('0x45')]+_0x3f96('0x49')+_0x26e140[_0x3f96('0x45')]+'>';}if(!_['isNil'](_0x26e140[_0x3f96('0x43')]['xmd-callerid-preview'])||!_[_0x3f96('0x1e')](_0x26e140[_0x3f96('0x43')]['xmd-callerid'])){utils['info'](util['format']('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x26e140[_0x3f96('0x5')],!_['isNil'](_0x26e140[_0x3f96('0x43')]['xmd-callerid-preview'])?_0x3f96('0x4a'):_0x3f96('0x4b'),_0x26e140[_0x3f96('0x45')]));channels[_0x26e140[_0x3f96('0x5')]][_0x3f96('0x27')]=_0x26e140[_0x3f96('0x45')];}if(!_[_0x3f96('0x1e')](_0x26e140[_0x3f96('0x43')][_0x3f96('0x4c')])||!_[_0x3f96('0x1e')](_0x26e140[_0x3f96('0x43')][_0x3f96('0x4d')])){utils[_0x3f96('0x6')](util['format'](_0x3f96('0x4e'),_0x26e140[_0x3f96('0x5')],!_[_0x3f96('0x1e')](_0x26e140['variable']['xmd-queue'])?_0x3f96('0x4c'):_0x3f96('0x4d'),_0x26e140[_0x3f96('0x45')]));channels[_0x26e140[_0x3f96('0x5')]][_0x3f96('0x4f')]=_0x3f96('0x50');channels[_0x26e140[_0x3f96('0x5')]][_0x3f96('0x51')]=_0x26e140[_0x3f96('0x45')];channels[_0x26e140[_0x3f96('0x5')]]['queue']=!![];}if(!_[_0x3f96('0x1e')](_0x26e140[_0x3f96('0x43')][_0x3f96('0x52')])){utils['info'](util['format']('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0x26e140[_0x3f96('0x5')],_0x26e140[_0x3f96('0x45')]));channels[_0x26e140['uniqueid']]['ContactId']=_0x26e140['value'];}if(!_['isNil'](_0x26e140[_0x3f96('0x43')][_0x3f96('0x53')])){utils[_0x3f96('0x6')](util['format']('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x26e140[_0x3f96('0x5')],_0x26e140[_0x3f96('0x45')]));channels[_0x26e140[_0x3f96('0x5')]][_0x3f96('0x54')]=_0x26e140[_0x3f96('0x45')];}if(!_[_0x3f96('0x1e')](_0x26e140[_0x3f96('0x43')][_0x3f96('0x55')])){utils[_0x3f96('0x6')](util['format'](_0x3f96('0x56'),_0x26e140['uniqueid'],_0x26e140['value']));channels[_0x26e140[_0x3f96('0x5')]][_0x3f96('0x57')]=_0x26e140[_0x3f96('0x45')];}if(!_['isNil'](_0x26e140['variable'][_0x3f96('0x58')])){utils[_0x3f96('0x6')](util['format'](_0x3f96('0x59'),_0x26e140[_0x3f96('0x5')],_0x26e140[_0x3f96('0x45')]));channels[_0x26e140['uniqueid']][_0x3f96('0x58')]=_0x26e140[_0x3f96('0x45')];}}}catch(_0x100826){utils[_0x3f96('0x1c')](util[_0x3f96('0x7')]('[%s][calls][varset]',_0x26e140[_0x3f96('0x5')]),_0x100826);}};exports[_0x3f96('0x5a')]=function(_0x4f12bd){try{if(!_[_0x3f96('0x1e')](channels[_0x4f12bd['uniqueid']])){utils['debug'](util['format'](_0x3f96('0x5b'),_0x4f12bd[_0x3f96('0x5')]),_0x4f12bd);utils[_0x3f96('0x6')](util[_0x3f96('0x7')](_0x3f96('0x5c'),_0x4f12bd[_0x3f96('0x5')],_0x4f12bd[_0x3f96('0x5d')],_0x4f12bd[_0x3f96('0x5e')]));if(_0x4f12bd[_0x3f96('0x5d')][_0x3f96('0x5f')]()=='set'&&_[_0x3f96('0x60')](_0x4f12bd['appdata'][_0x3f96('0x5f')](),_0x3f96('0x61'))){var _0x2a7370=_0x4f12bd['appdata'][_0x3f96('0x62')]('=');var _0x220873=_0x2a7370[0x0][_0x3f96('0x63')](_0x2a7370[0x0][_0x3f96('0x64')]('(')+0x1,_0x2a7370[0x0][_0x3f96('0x64')](')'));var _0x4fbbcf=_0x2a7370[0x1];channels[_0x4f12bd[_0x3f96('0x5')]][_0x220873]=_0x4fbbcf;}if(!_['includes']([_0x3f96('0x65'),_0x3f96('0x66'),_0x3f96('0x67'),_0x3f96('0x68'),_0x3f96('0x69')],_0x4f12bd[_0x3f96('0x5d')][_0x3f96('0x5f')]())){channels[_0x4f12bd[_0x3f96('0x5')]][_0x3f96('0x4f')]=_0x4f12bd['application'];channels[_0x4f12bd[_0x3f96('0x5')]][_0x3f96('0x51')]=_0x4f12bd[_0x3f96('0x5e')];}}}catch(_0x5a7808){utils[_0x3f96('0x1c')](util[_0x3f96('0x7')](_0x3f96('0x5b'),_0x4f12bd['uniqueid']),_0x5a7808);}}; \ No newline at end of file +var _0xa777=['transfertargetchannel','origtransfererchannel','_attended','[%s][calls][attendedtransfer]','musiconholdstart','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','[%s][calls][musiconholdstart]','musiconholdstop','[%s][calls][musiconholdstop]','musiconholdstartAt','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','source','value','variable','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','\x22\x20<','xmd-callerid-preview','xmd-callerid','xmd-queue','xmcs-queue','[%s][calls][varset]\x20variable:%s\x20value:%s','lastapplication','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][newexten]','application','toLowerCase','set','appdata','cdr','split','substring','lastIndexOf','includes','noop','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','queue','membername','interface','calleridnum','connectedlinenum','accountcode','then','UserId','request','CreateVoiceCallReport','linkedid','channel','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','newstate','debug','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','error','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','diffTime','answertime','attendedtransfer','localtwolinkedid','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield'];(function(_0x257b97,_0x1339de){var _0x26e3ff=function(_0x237d07){while(--_0x237d07){_0x257b97['push'](_0x257b97['shift']());}};_0x26e3ff(++_0x1339de);}(_0xa777,0x102));var _0x7a77=function(_0x210d9b,_0x1c3f64){_0x210d9b=_0x210d9b-0x0;var _0x4d2c71=_0xa777[_0x210d9b];return _0x4d2c71;};'use strict';var _=require('lodash');var util=require(_0x7a77('0x0'));var utils=require(_0x7a77('0x1'));var transfers=require(_0x7a77('0x2'));var dispositions=[_0x7a77('0x3'),_0x7a77('0x4'),'FAILED',_0x7a77('0x3'),_0x7a77('0x3'),_0x7a77('0x3'),_0x7a77('0x5'),_0x7a77('0x6'),'FAILED',_0x7a77('0x4'),_0x7a77('0x4')];var channels={};function writeDB(_0x500859){var _0x5b73ea;if(transfers[_0x7a77('0x7')][_0x500859[_0x7a77('0x8')]]){_0x5b73ea=_0x500859['uniqueid'];_0x500859[_0x7a77('0x8')]=transfers[_0x7a77('0x7')][_0x500859[_0x7a77('0x8')]][_0x7a77('0x9')];}utils[_0x7a77('0xa')](util[_0x7a77('0xb')](_0x7a77('0xc'),_0x500859[_0x7a77('0x8')],_0x500859['channel'],_0x500859[_0x7a77('0xd')],_0x500859[_0x7a77('0xe')],_0x500859[_0x7a77('0xf')],_0x500859[_0x7a77('0x10')],_0x500859[_0x7a77('0x11')],_0x500859['lastevent']));if(_0x500859[_0x7a77('0x12')]){utils['getUserByInternal'](_0x500859[_0x7a77('0x12')])[_0x7a77('0x13')](function(_0x4e11ea){if(_0x4e11ea){_0x500859[_0x7a77('0x14')]=_0x4e11ea['id'];}utils[_0x7a77('0x15')]('CreateVoiceCallReport',_0x500859);});}else{utils[_0x7a77('0x15')](_0x7a77('0x16'),_0x500859);}if(channels[_0x500859[_0x7a77('0x8')]]){delete channels[_0x500859[_0x7a77('0x8')]];}else if(_0x5b73ea&&channels[_0x5b73ea]){if(!transfers['blinds'][_0x5b73ea]['recording'])delete transfers[_0x7a77('0x7')][_0x5b73ea];delete channels[_0x5b73ea];}}exports['newchannel']=function(_0x4b761c){try{utils['debug'](util[_0x7a77('0xb')]('[%s][calls][newchannel]',_0x4b761c[_0x7a77('0x8')]),_0x4b761c);if(_0x4b761c['uniqueid']==_0x4b761c[_0x7a77('0x17')]&&_0x4b761c[_0x7a77('0x18')]!=_0x7a77('0x19')){utils['info'](util[_0x7a77('0xb')](_0x7a77('0x1a'),_0x4b761c[_0x7a77('0x8')],_0x4b761c[_0x7a77('0x1b')],_0x4b761c[_0x7a77('0x1c')]));channels[_0x4b761c[_0x7a77('0x8')]]={'uniqueid':_0x4b761c[_0x7a77('0x8')],'accountcode':_0x4b761c[_0x7a77('0x12')],'source':_0x4b761c[_0x7a77('0x10')],'destination':_0x4b761c[_0x7a77('0x1c')],'destinationcontext':_0x4b761c[_0x7a77('0x1b')],'channel':_0x4b761c[_0x7a77('0x18')],'starttime':utils[_0x7a77('0x1d')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x7a77('0x3'),'amaflags':_0x7a77('0x1e')};}}catch(_0x4e5f1d){utils['error'](util[_0x7a77('0xb')]('[%s][calls][newchannel]',_0x4b761c['uniqueid']),_0x4e5f1d);}};exports[_0x7a77('0x1f')]=function(_0x1c927e){try{utils[_0x7a77('0x20')](util['format']('[%s][calls][newstate]',_0x1c927e[_0x7a77('0x8')]),_0x1c927e);if(!_[_0x7a77('0x21')](channels[_0x1c927e[_0x7a77('0x8')]])&&_0x1c927e[_0x7a77('0x22')]==0x6){utils[_0x7a77('0xa')](util[_0x7a77('0xb')](_0x7a77('0x23'),_0x1c927e[_0x7a77('0x8')],_0x1c927e['context'],_0x1c927e['channel']));if(_['isNil'](channels[_0x1c927e[_0x7a77('0x8')]][_0x7a77('0x24')])){channels[_0x1c927e[_0x7a77('0x8')]]['systemanswertime']=utils[_0x7a77('0x1d')]();}}else if(!_['isNil'](channels[_0x1c927e[_0x7a77('0x17')]])&&_0x1c927e[_0x7a77('0x22')]==0x6&&_0x1c927e[_0x7a77('0x1b')]!=_0x7a77('0x25')){utils[_0x7a77('0xa')](util[_0x7a77('0xb')](_0x7a77('0x26'),_0x1c927e[_0x7a77('0x8')],_0x1c927e[_0x7a77('0x17')],_0x1c927e['context'],_0x1c927e[_0x7a77('0x18')]));channels[_0x1c927e[_0x7a77('0x17')]]['accountcode']=_0x1c927e[_0x7a77('0x12')];channels[_0x1c927e['linkedid']][_0x7a77('0x27')]=_0x1c927e[_0x7a77('0x18')];if(_[_0x7a77('0x21')](channels[_0x1c927e['linkedid']]['answertime'])){channels[_0x1c927e['linkedid']]['answertime']=utils[_0x7a77('0x1d')]();}channels[_0x1c927e['linkedid']]['disposition']=dispositions[_['toNumber'](_0x1c927e[_0x7a77('0x22')])]||_0x7a77('0x5');}}catch(_0x1b2206){utils[_0x7a77('0x28')](util[_0x7a77('0xb')]('[%s][calls][newstate]',_0x1c927e['uniqueid']),_0x1b2206);}};exports[_0x7a77('0x29')]=function(_0x1605c8){try{if(!_['isNil'](channels[_0x1605c8[_0x7a77('0x8')]])){utils[_0x7a77('0x20')](util['format'](_0x7a77('0x2a'),_0x1605c8[_0x7a77('0x8')]),_0x1605c8);if(_[_0x7a77('0x21')](channels[_0x1605c8[_0x7a77('0x8')]][_0x7a77('0x2b')])){channels[_0x1605c8[_0x7a77('0x8')]][_0x7a77('0x2b')]=_0x1605c8[_0x7a77('0x2c')]+'\x20<'+_0x1605c8[_0x7a77('0x10')]+'>';}utils[_0x7a77('0xa')](util[_0x7a77('0xb')](_0x7a77('0x2d'),_0x1605c8[_0x7a77('0x8')],channels[_0x1605c8[_0x7a77('0x8')]]['callerid'],_0x1605c8[_0x7a77('0x2e')]));channels[_0x1605c8[_0x7a77('0x8')]][_0x7a77('0x2f')]=utils[_0x7a77('0x1d')]();channels[_0x1605c8[_0x7a77('0x8')]]['duration']=utils[_0x7a77('0x30')](channels[_0x1605c8['uniqueid']][_0x7a77('0x2f')],channels[_0x1605c8[_0x7a77('0x8')]]['starttime']);channels[_0x1605c8[_0x7a77('0x8')]]['billableseconds']=channels[_0x1605c8[_0x7a77('0x8')]]['answertime']?utils[_0x7a77('0x30')](channels[_0x1605c8[_0x7a77('0x8')]][_0x7a77('0x2f')],channels[_0x1605c8[_0x7a77('0x8')]][_0x7a77('0x31')]):0x0;writeDB(channels[_0x1605c8['uniqueid']]);}}catch(_0x3d22e5){utils[_0x7a77('0x28')](util[_0x7a77('0xb')](_0x7a77('0x2a'),_0x1605c8[_0x7a77('0x8')]),_0x3d22e5);}};exports[_0x7a77('0x32')]=function(_0x10476a){try{if(!_[_0x7a77('0x21')](channels[_0x10476a[_0x7a77('0x33')]])){utils[_0x7a77('0x20')](util[_0x7a77('0xb')]('[%s][calls][attendedtransfer]',_0x10476a[_0x7a77('0x34')]),_0x10476a);if(channels[_0x10476a[_0x7a77('0x33')]]['channel']==_0x10476a[_0x7a77('0x35')]){utils[_0x7a77('0xa')](util['format'](_0x7a77('0x36'),_0x10476a[_0x7a77('0x34')],_0x10476a[_0x7a77('0x33')],_0x10476a[_0x7a77('0x37')]));channels[_0x10476a[_0x7a77('0x33')]][_0x7a77('0x27')]=_0x10476a['secondtransfererchannel'];channels[_0x10476a['localtwolinkedid']][_0x7a77('0x38')]='_attended';}else if(channels[_0x10476a[_0x7a77('0x33')]][_0x7a77('0x18')]=_0x10476a[_0x7a77('0x39')]){utils[_0x7a77('0xa')](util[_0x7a77('0xb')](_0x7a77('0x36'),_0x10476a[_0x7a77('0x34')],_0x10476a[_0x7a77('0x33')],_0x10476a['origtransfererchannel']));channels[_0x10476a[_0x7a77('0x33')]][_0x7a77('0x27')]=_0x10476a[_0x7a77('0x3a')];channels[_0x10476a['localtwolinkedid']]['userfield']=_0x7a77('0x3b');}}}catch(_0x3996b2){utils[_0x7a77('0x28')](util[_0x7a77('0xb')](_0x7a77('0x3c'),_0x10476a['origtransfereruniqueid']),_0x3996b2);}};exports[_0x7a77('0x3d')]=function(_0x30a0bb){try{if(!_[_0x7a77('0x21')](channels[_0x30a0bb[_0x7a77('0x8')]])){utils[_0x7a77('0x20')](util[_0x7a77('0xb')]('[%s][calls][musiconholdstart]',_0x30a0bb[_0x7a77('0x8')]),_0x30a0bb);channels[_0x30a0bb[_0x7a77('0x8')]]['musiconholdstartAt']=utils[_0x7a77('0x1d')]();utils[_0x7a77('0xa')](util[_0x7a77('0xb')](_0x7a77('0x3e'),_0x30a0bb[_0x7a77('0x8')],channels[_0x30a0bb['uniqueid']]['musiconholdstartAt']));}}catch(_0x936f26){utils[_0x7a77('0x28')](util[_0x7a77('0xb')](_0x7a77('0x3f'),_0x30a0bb[_0x7a77('0x8')]),_0x936f26);}};exports[_0x7a77('0x40')]=function(_0x258858){try{if(!_[_0x7a77('0x21')](channels[_0x258858['uniqueid']])){utils[_0x7a77('0x20')](util[_0x7a77('0xb')](_0x7a77('0x41'),_0x258858[_0x7a77('0x8')]),_0x258858);if(!_[_0x7a77('0x21')](channels[_0x258858[_0x7a77('0x8')]][_0x7a77('0x42')])){channels[_0x258858[_0x7a77('0x8')]][_0x7a77('0x43')]+=utils[_0x7a77('0x30')](utils[_0x7a77('0x1d')](),channels[_0x258858[_0x7a77('0x8')]]['musiconholdstartAt']);utils['info'](util['format'](_0x7a77('0x44'),_0x258858[_0x7a77('0x8')],channels[_0x258858[_0x7a77('0x8')]]['mohtime']));delete channels[_0x258858['uniqueid']]['musiconholdstartAt'];}}}catch(_0x132564){utils[_0x7a77('0x28')](util['format'](_0x7a77('0x41'),_0x258858[_0x7a77('0x8')]),_0x132564);}};exports[_0x7a77('0x45')]=function(_0x8051da){try{if(!_['isNil'](channels[_0x8051da[_0x7a77('0x8')]])){utils['debug'](util['format'](_0x7a77('0x46'),_0x8051da['uniqueid']),_0x8051da);if(!_[_0x7a77('0x21')](_0x8051da['variable'][_0x7a77('0x47')])){utils[_0x7a77('0xa')](util['format'](_0x7a77('0x48'),_0x8051da[_0x7a77('0x8')],_0x8051da['value']));channels[_0x8051da[_0x7a77('0x8')]][_0x7a77('0x49')]=_0x8051da[_0x7a77('0x4a')];}if(!_[_0x7a77('0x21')](_0x8051da[_0x7a77('0x4b')]['xmd-phone'])){utils['info'](util[_0x7a77('0xb')](_0x7a77('0x4c'),_0x8051da[_0x7a77('0x8')],_0x8051da[_0x7a77('0x4a')]));channels[_0x8051da['uniqueid']]['destination']=_0x8051da[_0x7a77('0x4a')];channels[_0x8051da[_0x7a77('0x8')]][_0x7a77('0x2b')]='\x22'+_0x8051da[_0x7a77('0x4a')]+_0x7a77('0x4d')+_0x8051da[_0x7a77('0x4a')]+'>';}if(!_[_0x7a77('0x21')](_0x8051da[_0x7a77('0x4b')][_0x7a77('0x4e')])||!_[_0x7a77('0x21')](_0x8051da['variable']['xmd-callerid'])){utils[_0x7a77('0xa')](util[_0x7a77('0xb')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x8051da['uniqueid'],!_[_0x7a77('0x21')](_0x8051da[_0x7a77('0x4b')][_0x7a77('0x4e')])?_0x7a77('0x4e'):_0x7a77('0x4f'),_0x8051da[_0x7a77('0x4a')]));channels[_0x8051da[_0x7a77('0x8')]][_0x7a77('0x2b')]=_0x8051da[_0x7a77('0x4a')];}if(!_[_0x7a77('0x21')](_0x8051da[_0x7a77('0x4b')][_0x7a77('0x50')])||!_['isNil'](_0x8051da[_0x7a77('0x4b')][_0x7a77('0x51')])){utils[_0x7a77('0xa')](util[_0x7a77('0xb')](_0x7a77('0x52'),_0x8051da['uniqueid'],!_[_0x7a77('0x21')](_0x8051da[_0x7a77('0x4b')][_0x7a77('0x50')])?'xmd-queue':_0x7a77('0x51'),_0x8051da[_0x7a77('0x4a')]));channels[_0x8051da['uniqueid']][_0x7a77('0x53')]=_0x7a77('0x54');channels[_0x8051da[_0x7a77('0x8')]][_0x7a77('0x55')]=_0x8051da[_0x7a77('0x4a')];channels[_0x8051da[_0x7a77('0x8')]][_0x7a77('0xd')]=!![];}if(!_['isNil'](_0x8051da['variable'][_0x7a77('0x56')])){utils[_0x7a77('0xa')](util[_0x7a77('0xb')](_0x7a77('0x57'),_0x8051da[_0x7a77('0x8')],_0x8051da[_0x7a77('0x4a')]));channels[_0x8051da['uniqueid']][_0x7a77('0x58')]=_0x8051da[_0x7a77('0x4a')];}if(!_[_0x7a77('0x21')](_0x8051da[_0x7a77('0x4b')][_0x7a77('0x59')])){utils[_0x7a77('0xa')](util[_0x7a77('0xb')](_0x7a77('0x5a'),_0x8051da[_0x7a77('0x8')],_0x8051da[_0x7a77('0x4a')]));channels[_0x8051da[_0x7a77('0x8')]][_0x7a77('0x5b')]=_0x8051da[_0x7a77('0x4a')];}if(!_['isNil'](_0x8051da[_0x7a77('0x4b')]['outboundrouteid'])){utils[_0x7a77('0xa')](util[_0x7a77('0xb')](_0x7a77('0x5c'),_0x8051da[_0x7a77('0x8')],_0x8051da['value']));channels[_0x8051da['uniqueid']]['routeid']=_0x8051da[_0x7a77('0x4a')];}if(!_[_0x7a77('0x21')](_0x8051da['variable']['sipcallid'])){utils[_0x7a77('0xa')](util[_0x7a77('0xb')](_0x7a77('0x5d'),_0x8051da[_0x7a77('0x8')],_0x8051da[_0x7a77('0x4a')]));channels[_0x8051da[_0x7a77('0x8')]]['sipcallid']=_0x8051da[_0x7a77('0x4a')];}}}catch(_0x588545){utils[_0x7a77('0x28')](util[_0x7a77('0xb')](_0x7a77('0x46'),_0x8051da[_0x7a77('0x8')]),_0x588545);}};exports['newexten']=function(_0x3c8476){try{if(!_[_0x7a77('0x21')](channels[_0x3c8476[_0x7a77('0x8')]])){utils[_0x7a77('0x20')](util[_0x7a77('0xb')](_0x7a77('0x5e'),_0x3c8476[_0x7a77('0x8')]),_0x3c8476);utils[_0x7a77('0xa')](util[_0x7a77('0xb')]('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x3c8476[_0x7a77('0x8')],_0x3c8476[_0x7a77('0x5f')],_0x3c8476['appdata']));if(_0x3c8476[_0x7a77('0x5f')][_0x7a77('0x60')]()==_0x7a77('0x61')&&_['startsWith'](_0x3c8476[_0x7a77('0x62')][_0x7a77('0x60')](),_0x7a77('0x63'))){var _0x24baac=_0x3c8476[_0x7a77('0x62')][_0x7a77('0x64')]('=');var _0x333e25=_0x24baac[0x0][_0x7a77('0x65')](_0x24baac[0x0]['lastIndexOf']('(')+0x1,_0x24baac[0x0][_0x7a77('0x66')](')'));var _0x17868c=_0x24baac[0x1];channels[_0x3c8476[_0x7a77('0x8')]][_0x333e25]=_0x17868c;}if(!_[_0x7a77('0x67')]([_0x7a77('0x29'),_0x7a77('0x68'),'execif',_0x7a77('0x61'),'gotoif'],_0x3c8476[_0x7a77('0x5f')]['toLowerCase']())){channels[_0x3c8476[_0x7a77('0x8')]][_0x7a77('0x53')]=_0x3c8476['application'];channels[_0x3c8476[_0x7a77('0x8')]]['lastdata']=_0x3c8476[_0x7a77('0x62')];}}}catch(_0x1347a9){utils[_0x7a77('0x28')](util[_0x7a77('0xb')]('[%s][calls][newexten]',_0x3c8476['uniqueid']),_0x1347a9);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index f796d3a..18de176 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 _0xafbc=['[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','close','[core]\x20close','managerevent','./utils','info'];(function(_0x24d1fc,_0x114691){var _0xcc71e4=function(_0x1c32d1){while(--_0x1c32d1){_0x24d1fc['push'](_0x24d1fc['shift']());}};_0xcc71e4(++_0x114691);}(_0xafbc,0xa6));var _0xcafb=function(_0x106ce0,_0x53c1d4){_0x106ce0=_0x106ce0-0x0;var _0x4c42dd=_0xafbc[_0x106ce0];return _0x4c42dd;};'use strict';var utils=require(_0xcafb('0x0'));exports['connect']=function(){utils[_0xcafb('0x1')](_0xcafb('0x2'));};exports[_0xcafb('0x3')]=function(){utils[_0xcafb('0x1')](_0xcafb('0x4'));};exports[_0xcafb('0x5')]=function(){utils[_0xcafb('0x1')](_0xcafb('0x6'));};exports[_0xcafb('0x7')]=function(_0x501c6f){utils['error'](_0xcafb('0x8'),_0x501c6f);};exports[_0xcafb('0x9')]=function(){utils['info'](_0xcafb('0xa'));};exports[_0xcafb('0xb')]=function(_0xc36343){}; \ No newline at end of file +var _0x0aae=['[core]\x20close','./utils','connect','info','[core]\x20connected','shutdown','[core]\x20shutdown','error','[core]\x20error'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0aae,0x1c3));var _0xe0aa=function(_0x4d9be9,_0x1d8314){_0x4d9be9=_0x4d9be9-0x0;var _0x1f0c61=_0x0aae[_0x4d9be9];return _0x1f0c61;};'use strict';var utils=require(_0xe0aa('0x0'));exports[_0xe0aa('0x1')]=function(){utils[_0xe0aa('0x2')](_0xe0aa('0x3'));};exports[_0xe0aa('0x4')]=function(){utils[_0xe0aa('0x2')](_0xe0aa('0x5'));};exports['fullybooted']=function(){utils[_0xe0aa('0x2')]('[core]\x20fullybooted');};exports[_0xe0aa('0x6')]=function(_0x22da2a){utils[_0xe0aa('0x6')](_0xe0aa('0x7'),_0x22da2a);};exports['close']=function(){utils[_0xe0aa('0x2')](_0xe0aa('0x8'));};exports['managerevent']=function(_0x554c84){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 00158d8..02168dd 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 _0x2bdb=['[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','[%s][dials][dialbegin]','assign','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialend]','ANSWER','answertime','now','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','complete','duration','diffTime','endtime','starttime','holdtime','lodash','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','appdata','cdr(routeid)','split','error','debug','[%s][dials][varset]','isNil','variable','outboundrouteid'];(function(_0x19ac7c,_0x2d0d9d){var _0x1d641f=function(_0x397246){while(--_0x397246){_0x19ac7c['push'](_0x19ac7c['shift']());}};_0x1d641f(++_0x2d0d9d);}(_0x2bdb,0xac));var _0xb2bd=function(_0x49cfc7,_0x3a8634){_0x49cfc7=_0x49cfc7-0x0;var _0x108050=_0x2bdb[_0x49cfc7];return _0x108050;};'use strict';var _=require(_0xb2bd('0x0'));var util=require('util');var utils=require(_0xb2bd('0x1'));var dials={};function writeDB(_0x1809d3){utils[_0xb2bd('0x2')](util[_0xb2bd('0x3')](_0xb2bd('0x4'),_0x1809d3[_0xb2bd('0x5')],_0x1809d3[_0xb2bd('0x6')],_0x1809d3[_0xb2bd('0x7')],_0x1809d3[_0xb2bd('0x8')],_0x1809d3[_0xb2bd('0x9')],_0x1809d3[_0xb2bd('0xa')]));utils[_0xb2bd('0xb')](_0xb2bd('0xc'),_0x1809d3);delete dials[_0x1809d3['uniqueid']];}exports[_0xb2bd('0xd')]=function(_0x3baf86){try{utils['debug'](util['format'](_0xb2bd('0xe'),_0x3baf86[_0xb2bd('0x5')]),_0x3baf86);utils['info'](util[_0xb2bd('0x3')](_0xb2bd('0xf'),_0x3baf86[_0xb2bd('0x5')],_0x3baf86[_0xb2bd('0x10')],_0x3baf86['appdata']));if(_0x3baf86['application'][_0xb2bd('0x11')]()==_0xb2bd('0x12')&&_['startsWith'](_0x3baf86[_0xb2bd('0x13')][_0xb2bd('0x11')](),_0xb2bd('0x14'))){var _0x4f5431=_0x3baf86['appdata'][_0xb2bd('0x15')]('=');dials[_0x3baf86[_0xb2bd('0x5')]]={'routeId':_0x4f5431[0x1]};}}catch(_0x4ce81f){utils[_0xb2bd('0x16')](util[_0xb2bd('0x3')](_0xb2bd('0xe'),_0x3baf86[_0xb2bd('0x5')]),_0x4ce81f);}};exports['varset']=function(_0x3741a9){try{utils[_0xb2bd('0x17')](util[_0xb2bd('0x3')](_0xb2bd('0x18'),_0x3741a9[_0xb2bd('0x5')]),_0x3741a9);if(!_[_0xb2bd('0x19')](_0x3741a9[_0xb2bd('0x1a')][_0xb2bd('0x1b')])){utils[_0xb2bd('0x2')](util['format'](_0xb2bd('0x1c'),_0x3741a9[_0xb2bd('0x5')],_0x3741a9[_0xb2bd('0x1d')]));dials[_0x3741a9['uniqueid']]={'routeId':_0x3741a9['value']};}}catch(_0x2125ee){utils[_0xb2bd('0x16')](util['format'](_0xb2bd('0x18'),_0x3741a9['uniqueid']),_0x2125ee);}};exports['dialbegin']=function(_0x5911bf){try{if(!_[_0xb2bd('0x19')](dials[_0x5911bf[_0xb2bd('0x5')]])){utils['debug'](util[_0xb2bd('0x3')](_0xb2bd('0x1e'),_0x5911bf[_0xb2bd('0x5')]),_0x5911bf);dials[_0x5911bf[_0xb2bd('0x5')]]=_[_0xb2bd('0x1f')](dials[_0x5911bf[_0xb2bd('0x5')]],_0x5911bf);dials[_0x5911bf[_0xb2bd('0x5')]]['starttime']=utils['now']();dials[_0x5911bf[_0xb2bd('0x5')]][_0xb2bd('0x20')]=_0xb2bd('0x21');utils[_0xb2bd('0x2')](util[_0xb2bd('0x3')](_0xb2bd('0x22'),_0x5911bf['uniqueid'],dials[_0x5911bf[_0xb2bd('0x5')]]['starttime']));}}catch(_0x4e6fba){utils[_0xb2bd('0x16')](util[_0xb2bd('0x3')](_0xb2bd('0x1e'),_0x5911bf[_0xb2bd('0x5')]),_0x4e6fba);}};exports['dialend']=function(_0x16fd34){try{if(!_[_0xb2bd('0x19')](dials[_0x16fd34[_0xb2bd('0x5')]])){utils[_0xb2bd('0x17')](util['format'](_0xb2bd('0x23'),_0x16fd34[_0xb2bd('0x5')]),_0x16fd34);dials[_0x16fd34[_0xb2bd('0x5')]][_0xb2bd('0xa')]=_0x16fd34[_0xb2bd('0xa')];if(_0x16fd34[_0xb2bd('0xa')]==_0xb2bd('0x24')){dials[_0x16fd34[_0xb2bd('0x5')]]=_[_0xb2bd('0x1f')](dials[_0x16fd34['uniqueid']],_0x16fd34);dials[_0x16fd34['uniqueid']][_0xb2bd('0x25')]=utils[_0xb2bd('0x26')]();dials[_0x16fd34['uniqueid']][_0xb2bd('0x20')]=_0xb2bd('0x27');utils[_0xb2bd('0x2')](util[_0xb2bd('0x3')](_0xb2bd('0x28'),_0x16fd34[_0xb2bd('0x5')],_0x16fd34[_0xb2bd('0xa')],dials[_0x16fd34[_0xb2bd('0x5')]][_0xb2bd('0x25')]));}else{utils['info'](util[_0xb2bd('0x3')](_0xb2bd('0x29'),_0x16fd34['uniqueid'],_0x16fd34['dialstatus']));}}}catch(_0x119e21){utils[_0xb2bd('0x16')](util[_0xb2bd('0x3')](_0xb2bd('0x23'),_0x16fd34['uniqueid']),_0x119e21);}};exports[_0xb2bd('0x2a')]=function(_0x102e38){try{if(!_[_0xb2bd('0x19')](dials[_0x102e38['uniqueid']])){utils[_0xb2bd('0x17')](util[_0xb2bd('0x3')](_0xb2bd('0x2b'),_0x102e38[_0xb2bd('0x5')]),_0x102e38);utils[_0xb2bd('0x2')](util[_0xb2bd('0x3')]('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x102e38[_0xb2bd('0x5')],_0x102e38[_0xb2bd('0x8')],_0x102e38['calleridname'],_0x102e38['cause-txt']));dials[_0x102e38[_0xb2bd('0x5')]]=_[_0xb2bd('0x1f')](dials[_0x102e38[_0xb2bd('0x5')]],{'endtime':utils['now'](),'lastevent':_0xb2bd('0x2c')});dials[_0x102e38[_0xb2bd('0x5')]][_0xb2bd('0x2d')]=utils[_0xb2bd('0x2e')](dials[_0x102e38['uniqueid']][_0xb2bd('0x2f')],dials[_0x102e38[_0xb2bd('0x5')]][_0xb2bd('0x30')]);dials[_0x102e38[_0xb2bd('0x5')]][_0xb2bd('0x31')]=utils[_0xb2bd('0x2e')](dials[_0x102e38[_0xb2bd('0x5')]]['answertime']||dials[_0x102e38[_0xb2bd('0x5')]]['endtime'],dials[_0x102e38[_0xb2bd('0x5')]][_0xb2bd('0x30')]);dials[_0x102e38[_0xb2bd('0x5')]]['billableseconds']=dials[_0x102e38[_0xb2bd('0x5')]]['answertime']?utils[_0xb2bd('0x2e')](dials[_0x102e38['uniqueid']][_0xb2bd('0x2f')],dials[_0x102e38[_0xb2bd('0x5')]][_0xb2bd('0x25')]):0x0;writeDB(dials[_0x102e38[_0xb2bd('0x5')]]);}}catch(_0x15a657){utils[_0xb2bd('0x16')](util[_0xb2bd('0x3')](_0xb2bd('0x2b'),_0x102e38['uniqueid']),_0x15a657);}}; \ No newline at end of file +var _0x7cc9=['calleridnum','connectedlinenum','dialstatus','request','uniqueid','newexten','[%s][dials][newexten]','appdata','application','toLowerCase','set','startsWith','split','error','varset','debug','isNil','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','assign','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialbegin]','dialend','[%s][dials][dialend]','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','cause-txt','complete','duration','diffTime','endtime','holdtime','billableseconds','lodash','util','./utils','info','format','channel','dialstring'];(function(_0x53ab0a,_0x3737be){var _0x31ded6=function(_0x45128a){while(--_0x45128a){_0x53ab0a['push'](_0x53ab0a['shift']());}};_0x31ded6(++_0x3737be);}(_0x7cc9,0x15e));var _0x97cc=function(_0xd308f,_0x3d0a33){_0xd308f=_0xd308f-0x0;var _0x24595c=_0x7cc9[_0xd308f];return _0x24595c;};'use strict';var _=require(_0x97cc('0x0'));var util=require(_0x97cc('0x1'));var utils=require(_0x97cc('0x2'));var dials={};function writeDB(_0x2b1f94){utils[_0x97cc('0x3')](util[_0x97cc('0x4')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x2b1f94['uniqueid'],_0x2b1f94[_0x97cc('0x5')],_0x2b1f94[_0x97cc('0x6')],_0x2b1f94[_0x97cc('0x7')],_0x2b1f94[_0x97cc('0x8')],_0x2b1f94[_0x97cc('0x9')]));utils[_0x97cc('0xa')]('CreateVoiceDialReport',_0x2b1f94);delete dials[_0x2b1f94[_0x97cc('0xb')]];}exports[_0x97cc('0xc')]=function(_0x1e72fc){try{utils['debug'](util[_0x97cc('0x4')](_0x97cc('0xd'),_0x1e72fc[_0x97cc('0xb')]),_0x1e72fc);utils[_0x97cc('0x3')](util[_0x97cc('0x4')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x1e72fc[_0x97cc('0xb')],_0x1e72fc['application'],_0x1e72fc[_0x97cc('0xe')]));if(_0x1e72fc[_0x97cc('0xf')][_0x97cc('0x10')]()==_0x97cc('0x11')&&_[_0x97cc('0x12')](_0x1e72fc[_0x97cc('0xe')][_0x97cc('0x10')](),'cdr(routeid)')){var _0x52eb12=_0x1e72fc[_0x97cc('0xe')][_0x97cc('0x13')]('=');dials[_0x1e72fc[_0x97cc('0xb')]]={'routeId':_0x52eb12[0x1]};}}catch(_0x519d57){utils[_0x97cc('0x14')](util[_0x97cc('0x4')](_0x97cc('0xd'),_0x1e72fc[_0x97cc('0xb')]),_0x519d57);}};exports[_0x97cc('0x15')]=function(_0xad399e){try{utils[_0x97cc('0x16')](util[_0x97cc('0x4')]('[%s][dials][varset]',_0xad399e[_0x97cc('0xb')]),_0xad399e);if(!_[_0x97cc('0x17')](_0xad399e['variable'][_0x97cc('0x18')])){utils[_0x97cc('0x3')](util['format'](_0x97cc('0x19'),_0xad399e[_0x97cc('0xb')],_0xad399e[_0x97cc('0x1a')]));dials[_0xad399e[_0x97cc('0xb')]]={'routeId':_0xad399e[_0x97cc('0x1a')]};}}catch(_0x4a9a02){utils[_0x97cc('0x14')](util['format']('[%s][dials][varset]',_0xad399e['uniqueid']),_0x4a9a02);}};exports[_0x97cc('0x1b')]=function(_0xe86099){try{if(!_['isNil'](dials[_0xe86099[_0x97cc('0xb')]])){utils[_0x97cc('0x16')](util[_0x97cc('0x4')]('[%s][dials][dialbegin]',_0xe86099[_0x97cc('0xb')]),_0xe86099);dials[_0xe86099[_0x97cc('0xb')]]=_[_0x97cc('0x1c')](dials[_0xe86099[_0x97cc('0xb')]],_0xe86099);dials[_0xe86099[_0x97cc('0xb')]][_0x97cc('0x1d')]=utils[_0x97cc('0x1e')]();dials[_0xe86099[_0x97cc('0xb')]][_0x97cc('0x1f')]=_0x97cc('0x20');utils['info'](util[_0x97cc('0x4')](_0x97cc('0x21'),_0xe86099[_0x97cc('0xb')],dials[_0xe86099[_0x97cc('0xb')]][_0x97cc('0x1d')]));}}catch(_0x3e85fd){utils['error'](util[_0x97cc('0x4')](_0x97cc('0x22'),_0xe86099[_0x97cc('0xb')]),_0x3e85fd);}};exports[_0x97cc('0x23')]=function(_0x2b3912){try{if(!_[_0x97cc('0x17')](dials[_0x2b3912[_0x97cc('0xb')]])){utils['debug'](util[_0x97cc('0x4')](_0x97cc('0x24'),_0x2b3912[_0x97cc('0xb')]),_0x2b3912);dials[_0x2b3912[_0x97cc('0xb')]][_0x97cc('0x9')]=_0x2b3912[_0x97cc('0x9')];if(_0x2b3912['dialstatus']==_0x97cc('0x25')){dials[_0x2b3912[_0x97cc('0xb')]]=_[_0x97cc('0x1c')](dials[_0x2b3912[_0x97cc('0xb')]],_0x2b3912);dials[_0x2b3912[_0x97cc('0xb')]][_0x97cc('0x26')]=utils[_0x97cc('0x1e')]();dials[_0x2b3912[_0x97cc('0xb')]][_0x97cc('0x1f')]=_0x97cc('0x27');utils['info'](util['format'](_0x97cc('0x28'),_0x2b3912['uniqueid'],_0x2b3912[_0x97cc('0x9')],dials[_0x2b3912[_0x97cc('0xb')]]['answertime']));}else{utils['info'](util[_0x97cc('0x4')](_0x97cc('0x29'),_0x2b3912[_0x97cc('0xb')],_0x2b3912[_0x97cc('0x9')]));}}}catch(_0x1da676){utils[_0x97cc('0x14')](util[_0x97cc('0x4')](_0x97cc('0x24'),_0x2b3912[_0x97cc('0xb')]),_0x1da676);}};exports[_0x97cc('0x2a')]=function(_0x587914){try{if(!_['isNil'](dials[_0x587914[_0x97cc('0xb')]])){utils[_0x97cc('0x16')](util[_0x97cc('0x4')](_0x97cc('0x2b'),_0x587914[_0x97cc('0xb')]),_0x587914);utils[_0x97cc('0x3')](util[_0x97cc('0x4')]('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x587914[_0x97cc('0xb')],_0x587914['calleridnum'],_0x587914['calleridname'],_0x587914[_0x97cc('0x2c')]));dials[_0x587914[_0x97cc('0xb')]]=_[_0x97cc('0x1c')](dials[_0x587914[_0x97cc('0xb')]],{'endtime':utils[_0x97cc('0x1e')](),'lastevent':_0x97cc('0x2d')});dials[_0x587914[_0x97cc('0xb')]][_0x97cc('0x2e')]=utils[_0x97cc('0x2f')](dials[_0x587914[_0x97cc('0xb')]][_0x97cc('0x30')],dials[_0x587914[_0x97cc('0xb')]][_0x97cc('0x1d')]);dials[_0x587914[_0x97cc('0xb')]][_0x97cc('0x31')]=utils[_0x97cc('0x2f')](dials[_0x587914[_0x97cc('0xb')]][_0x97cc('0x26')]||dials[_0x587914[_0x97cc('0xb')]][_0x97cc('0x30')],dials[_0x587914[_0x97cc('0xb')]][_0x97cc('0x1d')]);dials[_0x587914[_0x97cc('0xb')]][_0x97cc('0x32')]=dials[_0x587914[_0x97cc('0xb')]][_0x97cc('0x26')]?utils[_0x97cc('0x2f')](dials[_0x587914[_0x97cc('0xb')]][_0x97cc('0x30')],dials[_0x587914['uniqueid']][_0x97cc('0x26')]):0x0;writeDB(dials[_0x587914[_0x97cc('0xb')]]);}}catch(_0x2f48b1){utils[_0x97cc('0x14')](util[_0x97cc('0x4')](_0x97cc('0x2b'),_0x587914[_0x97cc('0xb')]),_0x2f48b1);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 92ec31e..32c3fcd 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 _0x017e=['./members.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','device','format','[%s][index][devicestatechange]','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','[%s][index][newstate]','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]','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','./utils','xdr','disabled','env','production','asterisk','port','password','keepConnected','info','XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller','./recordings.controller'];(function(_0x935a04,_0x3bc5be){var _0x102e74=function(_0x3bd581){while(--_0x3bd581){_0x935a04['push'](_0x935a04['shift']());}};_0x102e74(++_0x3bc5be);}(_0x017e,0x10c));var _0xe017=function(_0xbb7389,_0x12b29d){_0xbb7389=_0xbb7389-0x0;var _0x12537b=_0x017e[_0xbb7389];return _0x12537b;};var AsteriskManager=require(_0xe017('0x0'));var config=require('../../config/environment');var utils=require(_0xe017('0x1'));var util=require('util');var isXDREnabled=config[_0xe017('0x2')]&&!config[_0xe017('0x2')][_0xe017('0x3')];var isProduction=config[_0xe017('0x4')]===_0xe017('0x5')||![];var isLocalAsterisk=config['xdr']&&config[_0xe017('0x2')]['local']===!![]||![];var ami=new AsteriskManager(config[_0xe017('0x6')][_0xe017('0x7')],config[_0xe017('0x6')]['ip'],config[_0xe017('0x6')]['username'],config[_0xe017('0x6')][_0xe017('0x8')],!![]);ami[_0xe017('0x9')]();if(!isXDREnabled){utils[_0xe017('0xa')](_0xe017('0xb'));}else if(!isProduction&&!isLocalAsterisk){utils[_0xe017('0xa')]('Asterisk\x20disabled\x20on\x20localhost');}else{var agents=require(_0xe017('0xc'));var calls=require(_0xe017('0xd'));var queues=require(_0xe017('0xe'));var recordings=require(_0xe017('0xf'));var members=require(_0xe017('0x10'));var dials=require('./dials.controller');var transfers=require(_0xe017('0x11'));var core=require(_0xe017('0x12'));ami['on'](_0xe017('0x13'),core[_0xe017('0x13')]);ami['on'](_0xe017('0x14'),core['shutdown']);ami['on'](_0xe017('0x15'),core[_0xe017('0x15')]);ami['on'](_0xe017('0x16'),core[_0xe017('0x16')]);ami['on'](_0xe017('0x17'),core[_0xe017('0x17')]);ami['on'](_0xe017('0x18'),core[_0xe017('0x18')]);ami['on'](_0xe017('0x19'),function(_0x204132){try{utils[_0xe017('0x1a')](util['format']('[%s][index][devicestatechange]',_0x204132[_0xe017('0x1b')]),_0x204132);members['devicestatechange'](_0x204132);}catch(_0x3d2cda){utils['error'](util[_0xe017('0x1c')](_0xe017('0x1d'),_0x204132[_0xe017('0x1b')]),_0x3d2cda);}});ami['on'](_0xe017('0x1e'),function(_0x3aa40b){try{utils['debug'](util[_0xe017('0x1c')](_0xe017('0x1f'),_0x3aa40b[_0xe017('0x20')]),_0x3aa40b);agents[_0xe017('0x1e')](_0x3aa40b);}catch(_0x5f598a){utils[_0xe017('0x16')](util[_0xe017('0x1c')](_0xe017('0x1f'),_0x3aa40b[_0xe017('0x20')]),_0x5f598a);}});ami['on'](_0xe017('0x21'),function(_0x3335c6){try{utils['debug'](util[_0xe017('0x1c')](_0xe017('0x22'),_0x3335c6[_0xe017('0x20')]),_0x3335c6);agents[_0xe017('0x21')](_0x3335c6);}catch(_0x5299d1){utils[_0xe017('0x16')](util['format'](_0xe017('0x22'),_0x3335c6[_0xe017('0x20')]),_0x5299d1);}});ami['on']('agentconnect',function(_0x46965a){try{utils[_0xe017('0x1a')](util['format']('[%s][index][agentconnect]',_0x46965a[_0xe017('0x20')]),_0x46965a);agents[_0xe017('0x23')](_0x46965a);queues[_0xe017('0x23')](_0x46965a);}catch(_0x50414a){utils[_0xe017('0x16')](util[_0xe017('0x1c')](_0xe017('0x24'),_0x46965a[_0xe017('0x20')]),_0x50414a);}});ami['on'](_0xe017('0x25'),function(_0x3e7a70){try{utils[_0xe017('0x1a')](util['format'](_0xe017('0x26'),_0x3e7a70[_0xe017('0x20')]),_0x3e7a70);agents[_0xe017('0x25')](_0x3e7a70);queues[_0xe017('0x25')](_0x3e7a70);members[_0xe017('0x25')](_0x3e7a70);}catch(_0x2f4bc0){utils[_0xe017('0x16')](util[_0xe017('0x1c')](_0xe017('0x26'),_0x3e7a70[_0xe017('0x20')]),_0x2f4bc0);}});ami['on'](_0xe017('0x27'),function(_0x2ffd1c){try{utils['debug'](util[_0xe017('0x1c')](_0xe017('0x28'),_0x2ffd1c[_0xe017('0x20')]),_0x2ffd1c);agents[_0xe017('0x27')](_0x2ffd1c);queues[_0xe017('0x27')](_0x2ffd1c);}catch(_0x2b3efc){utils['error'](util['format']('[%s][index][queuecallerabandon]',_0x2ffd1c[_0xe017('0x20')]),_0x2b3efc);}});ami['on'](_0xe017('0x29'),function(_0x19dc31){try{utils['debug'](util[_0xe017('0x1c')]('[%s][index][queuecallerjoin]',_0x19dc31[_0xe017('0x20')]),_0x19dc31);queues['queuecallerjoin'](_0x19dc31);recordings['queuecallerjoin'](_0x19dc31);}catch(_0x28c005){utils[_0xe017('0x16')](util[_0xe017('0x1c')](_0xe017('0x2a'),_0x19dc31['uniqueid']),_0x28c005);}});ami['on'](_0xe017('0x2b'),function(_0x162919){try{utils['debug'](util['format'](_0xe017('0x2c'),_0x162919[_0xe017('0x20')]),_0x162919);queues[_0xe017('0x2b')](_0x162919);}catch(_0x4dd17f){utils[_0xe017('0x16')](util[_0xe017('0x1c')](_0xe017('0x2c'),_0x162919[_0xe017('0x20')]),_0x4dd17f);}});ami['on'](_0xe017('0x2d'),function(_0x4dbff6){try{utils['debug'](util[_0xe017('0x1c')](_0xe017('0x2e'),_0x4dbff6[_0xe017('0x20')]),_0x4dbff6);queues['musiconholdstart'](_0x4dbff6);calls['musiconholdstart'](_0x4dbff6);}catch(_0x4f7e9c){utils[_0xe017('0x16')](util['format'](_0xe017('0x2e'),_0x4dbff6[_0xe017('0x20')]),_0x4f7e9c);}});ami['on'](_0xe017('0x2f'),function(_0xabf03c){try{utils['debug'](util[_0xe017('0x1c')](_0xe017('0x30'),_0xabf03c[_0xe017('0x20')]),_0xabf03c);queues[_0xe017('0x2f')](_0xabf03c);calls['musiconholdstop'](_0xabf03c);}catch(_0x4089e2){utils[_0xe017('0x16')](util[_0xe017('0x1c')](_0xe017('0x30'),_0xabf03c['uniqueid']),_0x4089e2);}});ami['on']('newstate',function(_0x13d147){try{utils[_0xe017('0x1a')](util[_0xe017('0x1c')](_0xe017('0x31'),_0x13d147[_0xe017('0x20')]),_0x13d147);calls[_0xe017('0x32')](_0x13d147);recordings['newstate'](_0x13d147);}catch(_0x5eefdb){utils[_0xe017('0x16')](util[_0xe017('0x1c')]('[%s][index][newstate]',_0x13d147['uniqueid']),_0x5eefdb);}});ami['on'](_0xe017('0x33'),function(_0x3921ab){try{utils[_0xe017('0x1a')](util[_0xe017('0x1c')](_0xe017('0x34'),_0x3921ab[_0xe017('0x20')]),_0x3921ab);calls[_0xe017('0x33')](_0x3921ab);recordings['hangup'](_0x3921ab);dials['hangup'](_0x3921ab);agents[_0xe017('0x33')](_0x3921ab);queues['hangup'](_0x3921ab);}catch(_0x2602ab){utils[_0xe017('0x16')](util[_0xe017('0x1c')](_0xe017('0x34'),_0x3921ab[_0xe017('0x20')]),_0x2602ab);}});ami['on']('cdr',function(_0xa26ee4){try{utils[_0xe017('0x1a')](util['format'](_0xe017('0x35'),_0xa26ee4[_0xe017('0x20')]),_0xa26ee4);members[_0xe017('0x36')](_0xa26ee4);}catch(_0x42382a){utils['error'](util['format'](_0xe017('0x35'),_0xa26ee4['uniqueid']),_0x42382a);}});ami['on'](_0xe017('0x37'),function(_0x5e4e67){try{utils[_0xe017('0x1a')](util[_0xe017('0x1c')](_0xe017('0x38'),_0x5e4e67['uniqueid']),_0x5e4e67);queues['blindtransfer'](_0x5e4e67);agents[_0xe017('0x37')](_0x5e4e67);transfers[_0xe017('0x37')](_0x5e4e67);recordings[_0xe017('0x37')](_0x5e4e67);}catch(_0x4648f3){utils['error'](util['format']('[%s][index][blindtransfer]',_0x5e4e67[_0xe017('0x20')]),_0x4648f3);}});ami['on'](_0xe017('0x39'),function(_0x5a3b21){try{utils[_0xe017('0x1a')](util[_0xe017('0x1c')](_0xe017('0x3a'),_0x5a3b21['origtransfereruniqueid']),_0x5a3b21);queues[_0xe017('0x39')](_0x5a3b21);transfers[_0xe017('0x39')](_0x5a3b21);agents[_0xe017('0x39')](_0x5a3b21);calls[_0xe017('0x39')](_0x5a3b21);}catch(_0x164184){utils[_0xe017('0x16')](util[_0xe017('0x1c')](_0xe017('0x3a'),_0x5a3b21[_0xe017('0x3b')]),_0x164184);}});ami['on'](_0xe017('0x3c'),function(_0xfcf5d8){try{utils[_0xe017('0x1a')](util[_0xe017('0x1c')](_0xe017('0x3d'),_0xfcf5d8[_0xe017('0x20')]),_0xfcf5d8);queues[_0xe017('0x3c')](_0xfcf5d8);recordings['varset'](_0xfcf5d8);calls['varset'](_0xfcf5d8);dials[_0xe017('0x3c')](_0xfcf5d8);}catch(_0x59fa18){utils[_0xe017('0x16')](util[_0xe017('0x1c')](_0xe017('0x3d'),_0xfcf5d8['uniqueid']),_0x59fa18);}});ami['on'](_0xe017('0x3e'),function(_0x308900){try{utils['debug'](util[_0xe017('0x1c')](_0xe017('0x3f'),_0x308900[_0xe017('0x20')]),_0x308900);calls[_0xe017('0x3e')](_0x308900);recordings[_0xe017('0x3e')](_0x308900);dials['newexten'](_0x308900);}catch(_0x457371){utils['error'](util[_0xe017('0x1c')](_0xe017('0x3f'),_0x308900[_0xe017('0x20')]),_0x457371);}});ami['on'](_0xe017('0x40'),function(_0x5fc719){try{utils[_0xe017('0x1a')](util[_0xe017('0x1c')](_0xe017('0x41'),_0x5fc719[_0xe017('0x20')]),_0x5fc719);calls[_0xe017('0x40')](_0x5fc719);recordings[_0xe017('0x40')](_0x5fc719);}catch(_0x32b125){utils['error'](util[_0xe017('0x1c')](_0xe017('0x41'),_0x5fc719[_0xe017('0x20')]),_0x32b125);}});ami['on']('dialbegin',function(_0x5eab3b){try{utils[_0xe017('0x1a')](util[_0xe017('0x1c')](_0xe017('0x42'),_0x5eab3b[_0xe017('0x20')]),_0x5eab3b);dials[_0xe017('0x43')](_0x5eab3b);}catch(_0x540461){utils[_0xe017('0x16')](util[_0xe017('0x1c')](_0xe017('0x44'),_0x5eab3b[_0xe017('0x20')]),_0x540461);}});ami['on'](_0xe017('0x45'),function(_0xc1d2fd){try{utils['debug'](util[_0xe017('0x1c')](_0xe017('0x46'),_0xc1d2fd[_0xe017('0x20')]),_0xc1d2fd);dials[_0xe017('0x45')](_0xc1d2fd);}catch(_0x1a37e6){utils[_0xe017('0x16')](util[_0xe017('0x1c')](_0xe017('0x46'),_0xc1d2fd[_0xe017('0x20')]),_0x1a37e6);}});} \ No newline at end of file +var _0xaccc=['[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','xdr','env','production','asterisk','username','password','keepConnected','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./recordings.controller','./members.controller','./transfers.controller','./core.controller','connect','fullybooted','error','close','managerevent','debug','format','[%s][index][devicestatechange]','device','devicestatechange','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','[%s][index][musiconholdstop]','musiconholdstop','newstate','[%s][index][newstate]','[%s][index][hangup]','hangup','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten'];(function(_0x2b60bd,_0x49418d){var _0x3d9523=function(_0x460f6b){while(--_0x460f6b){_0x2b60bd['push'](_0x2b60bd['shift']());}};_0x3d9523(++_0x49418d);}(_0xaccc,0xda));var _0xcacc=function(_0x47fd36,_0x41535d){_0x47fd36=_0x47fd36-0x0;var _0x21a0fc=_0xaccc[_0x47fd36];return _0x21a0fc;};var AsteriskManager=require(_0xcacc('0x0'));var config=require(_0xcacc('0x1'));var utils=require(_0xcacc('0x2'));var util=require(_0xcacc('0x3'));var isXDREnabled=config[_0xcacc('0x4')]&&!config[_0xcacc('0x4')]['disabled'];var isProduction=config[_0xcacc('0x5')]===_0xcacc('0x6')||![];var isLocalAsterisk=config[_0xcacc('0x4')]&&config[_0xcacc('0x4')]['local']===!![]||![];var ami=new AsteriskManager(config[_0xcacc('0x7')]['port'],config[_0xcacc('0x7')]['ip'],config[_0xcacc('0x7')][_0xcacc('0x8')],config[_0xcacc('0x7')][_0xcacc('0x9')],!![]);ami[_0xcacc('0xa')]();if(!isXDREnabled){utils[_0xcacc('0xb')](_0xcacc('0xc'));}else if(!isProduction&&!isLocalAsterisk){utils[_0xcacc('0xb')](_0xcacc('0xd'));}else{var agents=require(_0xcacc('0xe'));var calls=require(_0xcacc('0xf'));var queues=require('./queues.controller');var recordings=require(_0xcacc('0x10'));var members=require(_0xcacc('0x11'));var dials=require('./dials.controller');var transfers=require(_0xcacc('0x12'));var core=require(_0xcacc('0x13'));ami['on'](_0xcacc('0x14'),core[_0xcacc('0x14')]);ami['on']('shutdown',core['shutdown']);ami['on'](_0xcacc('0x15'),core[_0xcacc('0x15')]);ami['on']('error',core[_0xcacc('0x16')]);ami['on'](_0xcacc('0x17'),core[_0xcacc('0x17')]);ami['on'](_0xcacc('0x18'),core['managerevent']);ami['on']('devicestatechange',function(_0x3e5319){try{utils[_0xcacc('0x19')](util[_0xcacc('0x1a')](_0xcacc('0x1b'),_0x3e5319[_0xcacc('0x1c')]),_0x3e5319);members[_0xcacc('0x1d')](_0x3e5319);}catch(_0x37a0a8){utils[_0xcacc('0x16')](util['format'](_0xcacc('0x1b'),_0x3e5319[_0xcacc('0x1c')]),_0x37a0a8);}});ami['on'](_0xcacc('0x1e'),function(_0x56f2e7){try{utils[_0xcacc('0x19')](util[_0xcacc('0x1a')](_0xcacc('0x1f'),_0x56f2e7['uniqueid']),_0x56f2e7);agents[_0xcacc('0x1e')](_0x56f2e7);}catch(_0x94dd05){utils[_0xcacc('0x16')](util[_0xcacc('0x1a')](_0xcacc('0x1f'),_0x56f2e7[_0xcacc('0x20')]),_0x94dd05);}});ami['on'](_0xcacc('0x21'),function(_0x306c2c){try{utils[_0xcacc('0x19')](util['format'](_0xcacc('0x22'),_0x306c2c[_0xcacc('0x20')]),_0x306c2c);agents[_0xcacc('0x21')](_0x306c2c);}catch(_0x17e94f){utils[_0xcacc('0x16')](util['format'](_0xcacc('0x22'),_0x306c2c[_0xcacc('0x20')]),_0x17e94f);}});ami['on'](_0xcacc('0x23'),function(_0x4bb5a1){try{utils[_0xcacc('0x19')](util[_0xcacc('0x1a')](_0xcacc('0x24'),_0x4bb5a1[_0xcacc('0x20')]),_0x4bb5a1);agents[_0xcacc('0x23')](_0x4bb5a1);queues['agentconnect'](_0x4bb5a1);}catch(_0x371440){utils[_0xcacc('0x16')](util[_0xcacc('0x1a')](_0xcacc('0x24'),_0x4bb5a1[_0xcacc('0x20')]),_0x371440);}});ami['on'](_0xcacc('0x25'),function(_0x2b2fb3){try{utils[_0xcacc('0x19')](util['format'](_0xcacc('0x26'),_0x2b2fb3[_0xcacc('0x20')]),_0x2b2fb3);agents['agentcomplete'](_0x2b2fb3);queues['agentcomplete'](_0x2b2fb3);members[_0xcacc('0x25')](_0x2b2fb3);}catch(_0x236efb){utils[_0xcacc('0x16')](util[_0xcacc('0x1a')](_0xcacc('0x26'),_0x2b2fb3[_0xcacc('0x20')]),_0x236efb);}});ami['on']('queuecallerabandon',function(_0x46fb21){try{utils['debug'](util[_0xcacc('0x1a')](_0xcacc('0x27'),_0x46fb21[_0xcacc('0x20')]),_0x46fb21);agents['queuecallerabandon'](_0x46fb21);queues['queuecallerabandon'](_0x46fb21);}catch(_0x124977){utils[_0xcacc('0x16')](util['format'](_0xcacc('0x27'),_0x46fb21[_0xcacc('0x20')]),_0x124977);}});ami['on'](_0xcacc('0x28'),function(_0x5917a4){try{utils['debug'](util[_0xcacc('0x1a')]('[%s][index][queuecallerjoin]',_0x5917a4[_0xcacc('0x20')]),_0x5917a4);queues[_0xcacc('0x28')](_0x5917a4);recordings[_0xcacc('0x28')](_0x5917a4);}catch(_0x25d105){utils[_0xcacc('0x16')](util['format'](_0xcacc('0x29'),_0x5917a4[_0xcacc('0x20')]),_0x25d105);}});ami['on'](_0xcacc('0x2a'),function(_0x10e6c9){try{utils[_0xcacc('0x19')](util['format'](_0xcacc('0x2b'),_0x10e6c9[_0xcacc('0x20')]),_0x10e6c9);queues[_0xcacc('0x2a')](_0x10e6c9);}catch(_0x285b5e){utils[_0xcacc('0x16')](util['format'](_0xcacc('0x2b'),_0x10e6c9[_0xcacc('0x20')]),_0x285b5e);}});ami['on']('musiconholdstart',function(_0x553b94){try{utils['debug'](util['format']('[%s][index][musiconholdstart]',_0x553b94['uniqueid']),_0x553b94);queues[_0xcacc('0x2c')](_0x553b94);calls[_0xcacc('0x2c')](_0x553b94);}catch(_0x2d730e){utils[_0xcacc('0x16')](util[_0xcacc('0x1a')](_0xcacc('0x2d'),_0x553b94[_0xcacc('0x20')]),_0x2d730e);}});ami['on']('musiconholdstop',function(_0x27accb){try{utils['debug'](util[_0xcacc('0x1a')](_0xcacc('0x2e'),_0x27accb[_0xcacc('0x20')]),_0x27accb);queues[_0xcacc('0x2f')](_0x27accb);calls[_0xcacc('0x2f')](_0x27accb);}catch(_0x9ce21e){utils[_0xcacc('0x16')](util[_0xcacc('0x1a')](_0xcacc('0x2e'),_0x27accb['uniqueid']),_0x9ce21e);}});ami['on'](_0xcacc('0x30'),function(_0x5a82ef){try{utils[_0xcacc('0x19')](util[_0xcacc('0x1a')]('[%s][index][newstate]',_0x5a82ef['uniqueid']),_0x5a82ef);calls['newstate'](_0x5a82ef);recordings[_0xcacc('0x30')](_0x5a82ef);}catch(_0x22527a){utils[_0xcacc('0x16')](util[_0xcacc('0x1a')](_0xcacc('0x31'),_0x5a82ef['uniqueid']),_0x22527a);}});ami['on']('hangup',function(_0x24b3ff){try{utils[_0xcacc('0x19')](util[_0xcacc('0x1a')](_0xcacc('0x32'),_0x24b3ff['uniqueid']),_0x24b3ff);calls[_0xcacc('0x33')](_0x24b3ff);recordings[_0xcacc('0x33')](_0x24b3ff);dials[_0xcacc('0x33')](_0x24b3ff);agents[_0xcacc('0x33')](_0x24b3ff);queues[_0xcacc('0x33')](_0x24b3ff);}catch(_0x4e15fd){utils[_0xcacc('0x16')](util['format']('[%s][index][hangup]',_0x24b3ff[_0xcacc('0x20')]),_0x4e15fd);}});ami['on'](_0xcacc('0x34'),function(_0x6d3ee2){try{utils['debug'](util[_0xcacc('0x1a')](_0xcacc('0x35'),_0x6d3ee2[_0xcacc('0x20')]),_0x6d3ee2);members[_0xcacc('0x34')](_0x6d3ee2);}catch(_0x5cf023){utils[_0xcacc('0x16')](util[_0xcacc('0x1a')](_0xcacc('0x35'),_0x6d3ee2['uniqueid']),_0x5cf023);}});ami['on'](_0xcacc('0x36'),function(_0x200157){try{utils[_0xcacc('0x19')](util[_0xcacc('0x1a')]('[%s][index][blindtransfer]',_0x200157[_0xcacc('0x20')]),_0x200157);queues['blindtransfer'](_0x200157);agents[_0xcacc('0x36')](_0x200157);transfers[_0xcacc('0x36')](_0x200157);recordings[_0xcacc('0x36')](_0x200157);}catch(_0x33c340){utils[_0xcacc('0x16')](util[_0xcacc('0x1a')](_0xcacc('0x37'),_0x200157['uniqueid']),_0x33c340);}});ami['on'](_0xcacc('0x38'),function(_0x3519bf){try{utils[_0xcacc('0x19')](util[_0xcacc('0x1a')](_0xcacc('0x39'),_0x3519bf[_0xcacc('0x3a')]),_0x3519bf);queues[_0xcacc('0x38')](_0x3519bf);transfers[_0xcacc('0x38')](_0x3519bf);agents[_0xcacc('0x38')](_0x3519bf);calls[_0xcacc('0x38')](_0x3519bf);}catch(_0x492fec){utils['error'](util[_0xcacc('0x1a')](_0xcacc('0x39'),_0x3519bf['origtransfereruniqueid']),_0x492fec);}});ami['on'](_0xcacc('0x3b'),function(_0x139264){try{utils['debug'](util['format'](_0xcacc('0x3c'),_0x139264[_0xcacc('0x20')]),_0x139264);queues['varset'](_0x139264);recordings['varset'](_0x139264);calls['varset'](_0x139264);dials[_0xcacc('0x3b')](_0x139264);}catch(_0x2b41a5){utils[_0xcacc('0x16')](util[_0xcacc('0x1a')](_0xcacc('0x3c'),_0x139264[_0xcacc('0x20')]),_0x2b41a5);}});ami['on'](_0xcacc('0x3d'),function(_0x428686){try{utils[_0xcacc('0x19')](util[_0xcacc('0x1a')](_0xcacc('0x3e'),_0x428686[_0xcacc('0x20')]),_0x428686);calls['newexten'](_0x428686);recordings[_0xcacc('0x3d')](_0x428686);dials[_0xcacc('0x3d')](_0x428686);}catch(_0x2249ff){utils[_0xcacc('0x16')](util['format'](_0xcacc('0x3e'),_0x428686['uniqueid']),_0x2249ff);}});ami['on'](_0xcacc('0x3f'),function(_0x63e69e){try{utils[_0xcacc('0x19')](util[_0xcacc('0x1a')]('[%s][index][newchannel]',_0x63e69e['uniqueid']),_0x63e69e);calls[_0xcacc('0x3f')](_0x63e69e);recordings[_0xcacc('0x3f')](_0x63e69e);}catch(_0xe05fc3){utils[_0xcacc('0x16')](util[_0xcacc('0x1a')](_0xcacc('0x40'),_0x63e69e[_0xcacc('0x20')]),_0xe05fc3);}});ami['on'](_0xcacc('0x41'),function(_0x4a56e0){try{utils['debug'](util[_0xcacc('0x1a')](_0xcacc('0x42'),_0x4a56e0['uniqueid']),_0x4a56e0);dials[_0xcacc('0x41')](_0x4a56e0);}catch(_0x5708ac){utils[_0xcacc('0x16')](util[_0xcacc('0x1a')](_0xcacc('0x43'),_0x4a56e0[_0xcacc('0x20')]),_0x5708ac);}});ami['on'](_0xcacc('0x44'),function(_0x1adab9){try{utils[_0xcacc('0x19')](util[_0xcacc('0x1a')](_0xcacc('0x45'),_0x1adab9['uniqueid']),_0x1adab9);dials['dialend'](_0x1adab9);}catch(_0x491b59){utils['error'](util[_0xcacc('0x1a')](_0xcacc('0x45'),_0x1adab9[_0xcacc('0x20')]),_0x491b59);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 5d403f9..dabb0a0 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 _0x7a0a=['./utils','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','type','getUserByInterface','then','internal','request','CreateMemberReport','getUserByName','split','membername','name','catch','error','[%s][members][writeDB]','startsWith','debug','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','BUSY','voice','TALKING','now','agent','isNil','exitAt','duration','enterAt','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','[%s][members][cdr]','source','data3','destination','data1','destinationchannel','lodash','util'];(function(_0x59c6da,_0x5da044){var _0x599cc6=function(_0x265519){while(--_0x265519){_0x59c6da['push'](_0x59c6da['shift']());}};_0x599cc6(++_0x5da044);}(_0x7a0a,0xc6));var _0xa7a0=function(_0x16fcfe,_0x15434b){_0x16fcfe=_0x16fcfe-0x0;var _0x123068=_0x7a0a[_0x16fcfe];return _0x123068;};'use strict';var _=require(_0xa7a0('0x0'));var util=require(_0xa7a0('0x1'));var utils=require(_0xa7a0('0x2'));var members={};var exclude=[_0xa7a0('0x3'),_0xa7a0('0x4')];function writeDB(_0x2accf4){utils[_0xa7a0('0x5')](util[_0xa7a0('0x6')](_0xa7a0('0x7'),_0x2accf4[_0xa7a0('0x8')],_0x2accf4[_0xa7a0('0x9')],_0x2accf4[_0xa7a0('0xa')],_0x2accf4[_0xa7a0('0xb')],_0x2accf4['membername'],_0x2accf4[_0xa7a0('0xc')]));if(_0x2accf4[_0xa7a0('0x9')]){utils[_0xa7a0('0xd')](_0x2accf4[_0xa7a0('0x9')])[_0xa7a0('0xe')](function(_0x583208){if(_0x583208){_0x2accf4['membername']=_0x583208['name'];_0x2accf4['internal']=_0x583208[_0xa7a0('0xf')];utils[_0xa7a0('0x10')](_0xa7a0('0x11'),_0x2accf4);}else{utils[_0xa7a0('0x12')](_0x2accf4[_0xa7a0('0x9')][_0xa7a0('0x13')]('/')[0x1])[_0xa7a0('0xe')](function(_0x543ab5){if(_0x543ab5){_0x2accf4[_0xa7a0('0x14')]=_0x543ab5[_0xa7a0('0x15')];_0x2accf4[_0xa7a0('0xf')]=_0x543ab5[_0xa7a0('0xf')];utils[_0xa7a0('0x10')]('CreateMemberReport',_0x2accf4);}});}})[_0xa7a0('0x16')](function(_0x27eb8b){utils[_0xa7a0('0x17')](util[_0xa7a0('0x6')](_0xa7a0('0x18'),_0x2accf4[_0xa7a0('0x8')]),_0x27eb8b);});}delete members[_0x2accf4[_0xa7a0('0x9')]];}function startsWith(_0x37c1b6,_0x2dca94){return _['some'](_0x37c1b6,function(_0x20bf85){return _[_0xa7a0('0x19')](_0x2dca94,_0x20bf85);});}exports['devicestatechange']=function(_0x1f6e18){try{utils[_0xa7a0('0x1a')](util[_0xa7a0('0x6')]('[%s][members][devicestatechange]',members[_0x1f6e18[_0xa7a0('0x1b')]]?members[_0x1f6e18[_0xa7a0('0x1b')]][_0xa7a0('0x8')]:_0x1f6e18[_0xa7a0('0x1b')]),_0x1f6e18);utils['info'](util['format'](_0xa7a0('0x1c'),members[_0x1f6e18['device']]?members[_0x1f6e18[_0xa7a0('0x1b')]][_0xa7a0('0x8')]:_0x1f6e18[_0xa7a0('0x1b')],_0x1f6e18[_0xa7a0('0x1d')],_0x1f6e18[_0xa7a0('0x1b')]));switch(_0x1f6e18['state']){case'INUSE':case _0xa7a0('0x1e'):if(!startsWith(exclude,_0x1f6e18[_0xa7a0('0x1b')])){members[_0x1f6e18[_0xa7a0('0x1b')]]={'channel':_0xa7a0('0x1f'),'interface':_0x1f6e18[_0xa7a0('0x1b')],'type':_0xa7a0('0x20'),'enterAt':utils[_0xa7a0('0x21')](),'role':_0xa7a0('0x22')};}break;case'NOT_INUSE':if(!_[_0xa7a0('0x23')](members[_0x1f6e18['device']])){members[_0x1f6e18['device']][_0xa7a0('0x24')]=utils[_0xa7a0('0x21')]();members[_0x1f6e18[_0xa7a0('0x1b')]][_0xa7a0('0x25')]=utils['diffTime'](members[_0x1f6e18[_0xa7a0('0x1b')]]['exitAt'],members[_0x1f6e18['device']][_0xa7a0('0x26')]);if(members[_0x1f6e18[_0xa7a0('0x1b')]][_0xa7a0('0x8')]){writeDB(members[_0x1f6e18['device']]);}}break;default:break;}}catch(_0x5f45b4){utils['error'](util[_0xa7a0('0x6')]('[%s][members][devicestatechange]',members[_0x1f6e18[_0xa7a0('0x1b')]]?members[_0x1f6e18['device']]['uniqueid']:_0x1f6e18[_0xa7a0('0x1b')]),_0x5f45b4);}};exports['agentcomplete']=function(_0x2a8c5d){try{if(!_[_0xa7a0('0x23')](members[_0x2a8c5d['interface']])){utils[_0xa7a0('0x1a')](util[_0xa7a0('0x6')](_0xa7a0('0x27'),_0x2a8c5d[_0xa7a0('0x8')]),_0x2a8c5d);utils[_0xa7a0('0x5')](util['format'](_0xa7a0('0x28'),_0x2a8c5d[_0xa7a0('0x8')],_0x2a8c5d[_0xa7a0('0x9')],_0x2a8c5d[_0xa7a0('0x29')]));members[_0x2a8c5d[_0xa7a0('0x9')]]=_[_0xa7a0('0x2a')](members[_0x2a8c5d[_0xa7a0('0x9')]],{'data4':_0x2a8c5d[_0xa7a0('0x29')],'uniqueid':_0x2a8c5d[_0xa7a0('0x8')]});}}catch(_0xaf5cd7){utils['error'](util['format']('[%s][members][agentcomplete]',_0x2a8c5d[_0xa7a0('0x8')]),_0xaf5cd7);}};exports[_0xa7a0('0x2b')]=function(_0x463c14){try{utils[_0xa7a0('0x1a')](util[_0xa7a0('0x6')](_0xa7a0('0x2c'),_0x463c14['uniqueid']),_0x463c14);if(_0x463c14['channel']){var _0x4f6dc2=_0x463c14['channel'][_0xa7a0('0x13')]('-')[0x0];if(!_[_0xa7a0('0x23')](members[_0x4f6dc2])){members[_0x4f6dc2]=_[_0xa7a0('0x2a')](members[_0x4f6dc2],{'data1':members[_0x4f6dc2]['data1']||_0x463c14['type'],'data2':members[_0x4f6dc2][_0xa7a0('0xb')]||_0x463c14[_0xa7a0('0x2d')],'data3':members[_0x4f6dc2][_0xa7a0('0x2e')]||_0x463c14[_0xa7a0('0x2f')],'uniqueid':members[_0x4f6dc2]['uniqueid']||_0x463c14[_0xa7a0('0x8')]});utils['info'](util[_0xa7a0('0x6')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x463c14[_0xa7a0('0x8')],members[_0x4f6dc2][_0xa7a0('0x30')],members[_0x4f6dc2]['data2'],members[_0x4f6dc2][_0xa7a0('0x2e')]));if(members[_0x4f6dc2][_0xa7a0('0x24')]){writeDB(members[_0x4f6dc2]);}}}if(_0x463c14[_0xa7a0('0x31')]){var _0x4fdf32=_0x463c14['destinationchannel'][_0xa7a0('0x13')]('-')[0x0];if(!_[_0xa7a0('0x23')](members[_0x4fdf32])){members[_0x4fdf32]=_[_0xa7a0('0x2a')](members[_0x4fdf32],{'data1':members[_0x4fdf32][_0xa7a0('0x30')]||_0x463c14[_0xa7a0('0xc')],'data2':members[_0x4fdf32][_0xa7a0('0xb')]||_0x463c14['source'],'data3':members[_0x4fdf32][_0xa7a0('0x2e')]||_0x463c14[_0xa7a0('0x2f')],'uniqueid':members[_0x4fdf32][_0xa7a0('0x8')]||_0x463c14['uniqueid']});utils[_0xa7a0('0x5')](util[_0xa7a0('0x6')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x463c14[_0xa7a0('0x8')],members[_0x4fdf32][_0xa7a0('0x30')],members[_0x4fdf32][_0xa7a0('0xb')],members[_0x4fdf32][_0xa7a0('0x2e')]));if(members[_0x4fdf32]['exitAt']){writeDB(members[_0x4fdf32]);}}}}catch(_0x59cb02){utils[_0xa7a0('0x17')](util[_0xa7a0('0x6')]('[%s][members][cdr]',_0x463c14['uniqueid']),_0x59cb02);}}; \ No newline at end of file +var _0x8aa5=['assign','cdr','[%s][members][cdr]','data1','source','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data3','lodash','util','./utils','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','channel','data2','membername','type','getUserByInterface','interface','then','name','internal','request','CreateMemberReport','getUserByName','split','catch','error','[%s][members][writeDB]','some','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','now','agent','NOT_INUSE','isNil','exitAt','duration','enterAt','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue'];(function(_0x1a57cb,_0x5ec459){var _0x4d59c8=function(_0x2afc92){while(--_0x2afc92){_0x1a57cb['push'](_0x1a57cb['shift']());}};_0x4d59c8(++_0x5ec459);}(_0x8aa5,0x78));var _0x58aa=function(_0x4c4a3d,_0x2cccd0){_0x4c4a3d=_0x4c4a3d-0x0;var _0x2ac148=_0x8aa5[_0x4c4a3d];return _0x2ac148;};'use strict';var _=require(_0x58aa('0x0'));var util=require(_0x58aa('0x1'));var utils=require(_0x58aa('0x2'));var members={};var exclude=[_0x58aa('0x3'),_0x58aa('0x4')];function writeDB(_0x50a98f){utils[_0x58aa('0x5')](util[_0x58aa('0x6')](_0x58aa('0x7'),_0x50a98f[_0x58aa('0x8')],_0x50a98f['interface'],_0x50a98f[_0x58aa('0x9')],_0x50a98f[_0x58aa('0xa')],_0x50a98f[_0x58aa('0xb')],_0x50a98f[_0x58aa('0xc')]));if(_0x50a98f['interface']){utils[_0x58aa('0xd')](_0x50a98f[_0x58aa('0xe')])[_0x58aa('0xf')](function(_0x584f5e){if(_0x584f5e){_0x50a98f[_0x58aa('0xb')]=_0x584f5e[_0x58aa('0x10')];_0x50a98f[_0x58aa('0x11')]=_0x584f5e[_0x58aa('0x11')];utils[_0x58aa('0x12')](_0x58aa('0x13'),_0x50a98f);}else{utils[_0x58aa('0x14')](_0x50a98f[_0x58aa('0xe')][_0x58aa('0x15')]('/')[0x1])[_0x58aa('0xf')](function(_0x53edb7){if(_0x53edb7){_0x50a98f[_0x58aa('0xb')]=_0x53edb7['name'];_0x50a98f[_0x58aa('0x11')]=_0x53edb7['internal'];utils[_0x58aa('0x12')](_0x58aa('0x13'),_0x50a98f);}});}})[_0x58aa('0x16')](function(_0x45fe62){utils[_0x58aa('0x17')](util[_0x58aa('0x6')](_0x58aa('0x18'),_0x50a98f[_0x58aa('0x8')]),_0x45fe62);});}delete members[_0x50a98f[_0x58aa('0xe')]];}function startsWith(_0x3c0993,_0x58d4e2){return _[_0x58aa('0x19')](_0x3c0993,function(_0x2c1691){return _[_0x58aa('0x1a')](_0x58d4e2,_0x2c1691);});}exports[_0x58aa('0x1b')]=function(_0x1baffc){try{utils[_0x58aa('0x1c')](util[_0x58aa('0x6')](_0x58aa('0x1d'),members[_0x1baffc['device']]?members[_0x1baffc['device']][_0x58aa('0x8')]:_0x1baffc[_0x58aa('0x1e')]),_0x1baffc);utils[_0x58aa('0x5')](util[_0x58aa('0x6')](_0x58aa('0x1f'),members[_0x1baffc[_0x58aa('0x1e')]]?members[_0x1baffc[_0x58aa('0x1e')]][_0x58aa('0x8')]:_0x1baffc[_0x58aa('0x1e')],_0x1baffc[_0x58aa('0x20')],_0x1baffc[_0x58aa('0x1e')]));switch(_0x1baffc[_0x58aa('0x20')]){case _0x58aa('0x21'):case _0x58aa('0x22'):if(!startsWith(exclude,_0x1baffc[_0x58aa('0x1e')])){members[_0x1baffc[_0x58aa('0x1e')]]={'channel':_0x58aa('0x23'),'interface':_0x1baffc[_0x58aa('0x1e')],'type':_0x58aa('0x24'),'enterAt':utils[_0x58aa('0x25')](),'role':_0x58aa('0x26')};}break;case _0x58aa('0x27'):if(!_[_0x58aa('0x28')](members[_0x1baffc['device']])){members[_0x1baffc['device']][_0x58aa('0x29')]=utils[_0x58aa('0x25')]();members[_0x1baffc[_0x58aa('0x1e')]][_0x58aa('0x2a')]=utils['diffTime'](members[_0x1baffc[_0x58aa('0x1e')]]['exitAt'],members[_0x1baffc[_0x58aa('0x1e')]][_0x58aa('0x2b')]);if(members[_0x1baffc[_0x58aa('0x1e')]][_0x58aa('0x8')]){writeDB(members[_0x1baffc[_0x58aa('0x1e')]]);}}break;default:break;}}catch(_0x4ec396){utils['error'](util['format'](_0x58aa('0x1d'),members[_0x1baffc['device']]?members[_0x1baffc['device']][_0x58aa('0x8')]:_0x1baffc[_0x58aa('0x1e')]),_0x4ec396);}};exports[_0x58aa('0x2c')]=function(_0x4c672b){try{if(!_[_0x58aa('0x28')](members[_0x4c672b[_0x58aa('0xe')]])){utils[_0x58aa('0x1c')](util[_0x58aa('0x6')](_0x58aa('0x2d'),_0x4c672b[_0x58aa('0x8')]),_0x4c672b);utils['info'](util[_0x58aa('0x6')](_0x58aa('0x2e'),_0x4c672b[_0x58aa('0x8')],_0x4c672b[_0x58aa('0xe')],_0x4c672b[_0x58aa('0x2f')]));members[_0x4c672b[_0x58aa('0xe')]]=_[_0x58aa('0x30')](members[_0x4c672b[_0x58aa('0xe')]],{'data4':_0x4c672b['queue'],'uniqueid':_0x4c672b[_0x58aa('0x8')]});}}catch(_0x1243fa){utils[_0x58aa('0x17')](util[_0x58aa('0x6')](_0x58aa('0x2d'),_0x4c672b[_0x58aa('0x8')]),_0x1243fa);}};exports[_0x58aa('0x31')]=function(_0x118bd1){try{utils[_0x58aa('0x1c')](util[_0x58aa('0x6')](_0x58aa('0x32'),_0x118bd1['uniqueid']),_0x118bd1);if(_0x118bd1['channel']){var _0x548cae=_0x118bd1[_0x58aa('0x9')][_0x58aa('0x15')]('-')[0x0];if(!_['isNil'](members[_0x548cae])){members[_0x548cae]=_[_0x58aa('0x30')](members[_0x548cae],{'data1':members[_0x548cae][_0x58aa('0x33')]||_0x118bd1[_0x58aa('0xc')],'data2':members[_0x548cae][_0x58aa('0xa')]||_0x118bd1[_0x58aa('0x34')],'data3':members[_0x548cae]['data3']||_0x118bd1[_0x58aa('0x35')],'uniqueid':members[_0x548cae][_0x58aa('0x8')]||_0x118bd1['uniqueid']});utils[_0x58aa('0x5')](util[_0x58aa('0x6')](_0x58aa('0x36'),_0x118bd1[_0x58aa('0x8')],members[_0x548cae][_0x58aa('0x33')],members[_0x548cae][_0x58aa('0xa')],members[_0x548cae][_0x58aa('0x37')]));if(members[_0x548cae][_0x58aa('0x29')]){writeDB(members[_0x548cae]);}}}if(_0x118bd1['destinationchannel']){var _0x442751=_0x118bd1['destinationchannel'][_0x58aa('0x15')]('-')[0x0];if(!_[_0x58aa('0x28')](members[_0x442751])){members[_0x442751]=_['assign'](members[_0x442751],{'data1':members[_0x442751][_0x58aa('0x33')]||_0x118bd1[_0x58aa('0xc')],'data2':members[_0x442751][_0x58aa('0xa')]||_0x118bd1[_0x58aa('0x34')],'data3':members[_0x442751]['data3']||_0x118bd1[_0x58aa('0x35')],'uniqueid':members[_0x442751][_0x58aa('0x8')]||_0x118bd1[_0x58aa('0x8')]});utils['info'](util['format'](_0x58aa('0x36'),_0x118bd1[_0x58aa('0x8')],members[_0x442751]['data1'],members[_0x442751]['data2'],members[_0x442751][_0x58aa('0x37')]));if(members[_0x442751]['exitAt']){writeDB(members[_0x442751]);}}}}catch(_0xa2844c){utils[_0x58aa('0x17')](util['format'](_0x58aa('0x32'),_0x118bd1[_0x58aa('0x8')]),_0xa2844c);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index aee23a3..6d5afb4 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 _0x1dd3=['[%s][queues][varset]','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','holdtime','diffTime','queuecallerjoinAt','position','count','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','queuecallerexitAt','assigned','agentcomplete','[%s][queues][agentcomplete]','reason','transfer','TRANSFER','COMPLETEDBY','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','BLIND','extension','[%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','origtransfererexten','transfertype','transferuniqueid','ATTENDEDTRANSFER','transfereelinkedid','transfertargetuniqueid','calleridnum','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','transferexten','secondtransfererexten','transfertargetlinkedid','clone','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','lastAssignedTo','accountcode','then','type','CreateVoiceQueueReport','request','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','info','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','queue','assign','error','hangup','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','now','queuecallerexitreason','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','queuecallerenterreason','[%s][queues][hangup]','varset','isNil','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandonAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s'];(function(_0x365ea3,_0x1ce969){var _0x3c95a8=function(_0x3b5fce){while(--_0x3b5fce){_0x365ea3['push'](_0x365ea3['shift']());}};_0x3c95a8(++_0x1ce969);}(_0x1dd3,0x184));var _0x31dd=function(_0x405d00,_0x395604){_0x405d00=_0x405d00-0x0;var _0xfa3103=_0x1dd3[_0x405d00];return _0xfa3103;};'use strict';var _=require(_0x31dd('0x0'));var util=require(_0x31dd('0x1'));var utils=require('./utils');var queues={};function writeDB(_0x4dc51b){utils['info'](util[_0x31dd('0x2')](_0x31dd('0x3'),_0x4dc51b[_0x31dd('0x4')],_0x4dc51b[_0x31dd('0x5')],_0x4dc51b['queue'],_0x4dc51b[_0x31dd('0x6')],_0x4dc51b['calleridnum'],_0x4dc51b[_0x31dd('0x7')],_0x4dc51b['queuecallerexitreason']));if(_0x4dc51b['queue']){utils['getVoiceQueueByName'](_0x4dc51b['queue'])[_0x31dd('0x8')](function(_0x370f65){if(_0x370f65){_0x4dc51b[_0x31dd('0x9')]=_0x370f65['type'];}utils['request'](_0x31dd('0xa'),_0x4dc51b);});}else{utils[_0x31dd('0xb')](_0x31dd('0xa'),_0x4dc51b);}if(_0x4dc51b[_0x31dd('0xc')]){delete queues[_0x4dc51b[_0x31dd('0xc')]];}else{delete queues[_0x4dc51b[_0x31dd('0x4')]];}}exports[_0x31dd('0xd')]=function(_0x1e3b84){try{utils[_0x31dd('0xe')](util[_0x31dd('0x2')](_0x31dd('0xf'),_0x1e3b84[_0x31dd('0x4')]),_0x1e3b84);utils[_0x31dd('0x10')](util['format'](_0x31dd('0x11'),_0x1e3b84[_0x31dd('0x4')],_0x1e3b84[_0x31dd('0x12')],_0x1e3b84['position']));queues[_0x1e3b84[_0x31dd('0x4')]]=_[_0x31dd('0x13')](_0x1e3b84,{'originalposition':_0x1e3b84['position'],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x3e3add){utils[_0x31dd('0x14')](util[_0x31dd('0x2')](_0x31dd('0xf'),_0x1e3b84[_0x31dd('0x4')]),_0x3e3add);}};exports[_0x31dd('0x15')]=function(_0x2a00e5){try{if(!_['isNil'](queues[_0x2a00e5[_0x31dd('0x4')]])){utils[_0x31dd('0xe')](util[_0x31dd('0x2')]('[%s][queues][hangup]',_0x2a00e5[_0x31dd('0x4')]),_0x2a00e5);if(queues[_0x2a00e5[_0x31dd('0x4')]][_0x31dd('0x16')]){if(!queues[_0x2a00e5[_0x31dd('0x4')]][_0x31dd('0x17')]&&!queues[_0x2a00e5[_0x31dd('0x4')]][_0x31dd('0x18')]){queues[_0x2a00e5[_0x31dd('0x4')]][_0x31dd('0x19')]=!![];queues[_0x2a00e5['uniqueid']][_0x31dd('0x1a')]=utils[_0x31dd('0x1b')]();queues[_0x2a00e5['uniqueid']][_0x31dd('0x1c')]=_0x31dd('0x1d');}utils['info'](util[_0x31dd('0x2')](_0x31dd('0x1e'),_0x2a00e5[_0x31dd('0x4')],queues[_0x2a00e5['uniqueid']][_0x31dd('0x1f')],queues[_0x2a00e5[_0x31dd('0x4')]][_0x31dd('0x1c')]));writeDB(queues[_0x2a00e5[_0x31dd('0x4')]]);}else if(queues[_0x2a00e5[_0x31dd('0x4')]][_0x31dd('0xc')]){utils[_0x31dd('0x10')](util['format']('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x2a00e5[_0x31dd('0x4')],queues[_0x2a00e5[_0x31dd('0x4')]][_0x31dd('0x1f')],queues[_0x2a00e5[_0x31dd('0x4')]][_0x31dd('0xc')]));queues[queues[_0x2a00e5[_0x31dd('0x4')]][_0x31dd('0xc')]]=queues[_0x2a00e5[_0x31dd('0x4')]];queues[queues[_0x2a00e5[_0x31dd('0x4')]][_0x31dd('0xc')]][_0x31dd('0x20')]=0x2;delete queues[_0x2a00e5[_0x31dd('0x4')]];}}}catch(_0x47da9c){utils[_0x31dd('0x14')](util[_0x31dd('0x2')](_0x31dd('0x21'),_0x2a00e5['uniqueid']),_0x47da9c);}};exports[_0x31dd('0x22')]=function(_0x7844a7){try{utils[_0x31dd('0xe')](util['format']('[%s][queues][varset]',_0x7844a7[_0x31dd('0x4')]),_0x7844a7);if(!_[_0x31dd('0x23')](_0x7844a7['variable'][_0x31dd('0x24')])&&_0x7844a7[_0x31dd('0x25')][_0x31dd('0x26')]()!==_0x31dd('0x27')){if(!_[_0x31dd('0x23')](queues[_0x7844a7['uniqueid']])){queues[_0x7844a7[_0x31dd('0x4')]]['queuecallerabandon']=![];queues[_0x7844a7[_0x31dd('0x4')]][_0x31dd('0x28')]=null;queues[_0x7844a7[_0x31dd('0x4')]][_0x31dd('0x18')]=!![];queues[_0x7844a7['uniqueid']]['queuecallerexitAt']=utils[_0x31dd('0x1b')]();queues[_0x7844a7['uniqueid']][_0x31dd('0x1c')]=_0x7844a7[_0x31dd('0x25')][_0x31dd('0x26')]();utils[_0x31dd('0x10')](util[_0x31dd('0x2')](_0x31dd('0x29'),_0x7844a7[_0x31dd('0x4')],queues[_0x7844a7[_0x31dd('0x4')]]['name'],_0x7844a7[_0x31dd('0x25')],queues[_0x7844a7['uniqueid']][_0x31dd('0x1c')]));writeDB(queues[_0x7844a7[_0x31dd('0x4')]]);}}else if(!_['isNil'](_0x7844a7['variable'][_0x31dd('0x2a')])){if(!_[_0x31dd('0x23')](queues[_0x7844a7['uniqueid']])&&!queues[_0x7844a7[_0x31dd('0x4')]][_0x31dd('0x17')]){queues[_0x7844a7[_0x31dd('0x4')]][_0x31dd('0x17')]=![];queues[_0x7844a7[_0x31dd('0x4')]]['queuecallerabandonAt']=null;queues[_0x7844a7[_0x31dd('0x4')]][_0x31dd('0x18')]=!![];queues[_0x7844a7[_0x31dd('0x4')]]['queuecallerexitAt']=utils['now']();queues[_0x7844a7[_0x31dd('0x4')]]['queuecallerexitreason']='EXITWITHKEY';utils['info'](util[_0x31dd('0x2')](_0x31dd('0x2b'),_0x7844a7['uniqueid'],queues[_0x7844a7['uniqueid']][_0x31dd('0x1f')],_0x7844a7['value'],queues[_0x7844a7[_0x31dd('0x4')]]['queuecallerexitreason']));}}}catch(_0x18ab11){utils['error'](util['format'](_0x31dd('0x2c'),_0x7844a7['uniqueid']),_0x18ab11);}};exports[_0x31dd('0x17')]=function(_0x5f46b8){try{if(!_[_0x31dd('0x23')](queues[_0x5f46b8[_0x31dd('0x4')]])){utils[_0x31dd('0xe')](util['format'](_0x31dd('0x2d'),_0x5f46b8['uniqueid']),_0x5f46b8);queues[_0x5f46b8['uniqueid']][_0x31dd('0x18')]=![];queues[_0x5f46b8[_0x31dd('0x4')]]['queuecallerexitAt']=null;queues[_0x5f46b8[_0x31dd('0x4')]]['queuecallerabandon']=!![];queues[_0x5f46b8[_0x31dd('0x4')]][_0x31dd('0x28')]=utils[_0x31dd('0x1b')]();queues[_0x5f46b8['uniqueid']]['queuecallerexitreason']=_0x31dd('0x2e');utils['info'](util[_0x31dd('0x2')](_0x31dd('0x2f'),_0x5f46b8[_0x31dd('0x4')],queues[_0x5f46b8[_0x31dd('0x4')]][_0x31dd('0x1f')],queues[_0x5f46b8[_0x31dd('0x4')]][_0x31dd('0x1c')]));}}catch(_0x7aaf3f){utils[_0x31dd('0x14')](util[_0x31dd('0x2')](_0x31dd('0x2d'),_0x5f46b8[_0x31dd('0x4')]),_0x7aaf3f);}};exports[_0x31dd('0x30')]=function(_0x2cac80){try{if(!_[_0x31dd('0x23')](queues[_0x2cac80[_0x31dd('0x4')]])){utils[_0x31dd('0xe')](util[_0x31dd('0x2')](_0x31dd('0x31'),_0x2cac80[_0x31dd('0x4')]),_0x2cac80);utils[_0x31dd('0x10')](util[_0x31dd('0x2')](_0x31dd('0x32'),_0x2cac80[_0x31dd('0x4')],queues[_0x2cac80[_0x31dd('0x4')]]['name'],_0x2cac80[_0x31dd('0x33')],_0x2cac80[_0x31dd('0x34')]));queues[_0x2cac80[_0x31dd('0x4')]][_0x31dd('0x30')]=!![];queues[_0x2cac80[_0x31dd('0x4')]][_0x31dd('0x16')]=utils['now']();queues[_0x2cac80[_0x31dd('0x4')]][_0x31dd('0x35')]=utils[_0x31dd('0x36')](queues[_0x2cac80[_0x31dd('0x4')]]['queuecallerleaveAt'],queues[_0x2cac80[_0x31dd('0x4')]][_0x31dd('0x37')]);queues[_0x2cac80[_0x31dd('0x4')]][_0x31dd('0x38')]=_0x2cac80[_0x31dd('0x38')];queues[_0x2cac80['uniqueid']][_0x31dd('0x39')]=_0x2cac80[_0x31dd('0x39')];queues[_0x2cac80['uniqueid']][_0x31dd('0x33')]=_0x2cac80[_0x31dd('0x33')];queues[_0x2cac80['uniqueid']][_0x31dd('0x34')]=_0x2cac80[_0x31dd('0x34')];}}catch(_0x23c82a){utils['error'](util[_0x31dd('0x2')]('[%s][queues][queuecallerleave]',_0x2cac80[_0x31dd('0x4')]),_0x23c82a);}};exports[_0x31dd('0x3a')]=function(_0x3b004f){try{if(!_[_0x31dd('0x23')](queues[_0x3b004f['uniqueid']])){utils[_0x31dd('0xe')](util[_0x31dd('0x2')](_0x31dd('0x3b'),_0x3b004f[_0x31dd('0x4')]),_0x3b004f);utils[_0x31dd('0x10')](util[_0x31dd('0x2')](_0x31dd('0x3c'),_0x3b004f[_0x31dd('0x4')],queues[_0x3b004f['uniqueid']][_0x31dd('0x1f')],_0x3b004f[_0x31dd('0x3d')],_0x3b004f[_0x31dd('0x3e')]));queues[_0x3b004f['uniqueid']][_0x31dd('0x17')]=![];queues[_0x3b004f[_0x31dd('0x4')]]['queuecallerabandon']=![];queues[_0x3b004f[_0x31dd('0x4')]][_0x31dd('0x28')]=null;queues[_0x3b004f[_0x31dd('0x4')]][_0x31dd('0x18')]=![];queues[_0x3b004f['uniqueid']][_0x31dd('0x1c')]=null;queues[_0x3b004f[_0x31dd('0x4')]][_0x31dd('0x3f')]=null;queues[_0x3b004f[_0x31dd('0x4')]][_0x31dd('0x40')]=!![];queues[_0x3b004f[_0x31dd('0x4')]][_0x31dd('0x7')]=_0x3b004f[_0x31dd('0x3e')];queues[_0x3b004f[_0x31dd('0x4')]][_0x31dd('0x6')]=_0x3b004f['membername'];}}catch(_0xeb75d2){utils[_0x31dd('0x14')](util[_0x31dd('0x2')](_0x31dd('0x3b'),_0x3b004f[_0x31dd('0x4')]),_0xeb75d2);}};exports[_0x31dd('0x41')]=function(_0xd37ff6){try{if(!_[_0x31dd('0x23')](queues[_0xd37ff6[_0x31dd('0x4')]])){if(queues[_0xd37ff6['uniqueid']][_0x31dd('0x16')]){utils[_0x31dd('0xe')](util[_0x31dd('0x2')](_0x31dd('0x42'),_0xd37ff6['uniqueid']),_0xd37ff6);queues[_0xd37ff6['uniqueid']][_0x31dd('0x17')]=![];queues[_0xd37ff6['uniqueid']][_0x31dd('0x17')]=![];queues[_0xd37ff6[_0x31dd('0x4')]][_0x31dd('0x28')]=null;queues[_0xd37ff6[_0x31dd('0x4')]][_0x31dd('0x18')]=![];queues[_0xd37ff6[_0x31dd('0x4')]]['queuecallerexitAt']=null;queues[_0xd37ff6[_0x31dd('0x4')]][_0x31dd('0x40')]=!![];queues[_0xd37ff6[_0x31dd('0x4')]]['lastAssignedTo']=_0xd37ff6[_0x31dd('0x3d')];queues[_0xd37ff6[_0x31dd('0x4')]][_0x31dd('0x19')]=!![];queues[_0xd37ff6[_0x31dd('0x4')]][_0x31dd('0x1a')]=utils[_0x31dd('0x1b')]();if(_0xd37ff6[_0x31dd('0x43')]==_0x31dd('0x44')){if(!queues[_0xd37ff6[_0x31dd('0x4')]][_0x31dd('0x44')]){queues[_0xd37ff6[_0x31dd('0x4')]]['queuecallerexitreason']=_0x31dd('0x45');}}else{queues[_0xd37ff6[_0x31dd('0x4')]][_0x31dd('0x1c')]=_0x31dd('0x46')+_0xd37ff6[_0x31dd('0x43')]['toUpperCase']();}utils[_0x31dd('0x10')](util['format']('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0xd37ff6['uniqueid'],queues[_0xd37ff6[_0x31dd('0x4')]][_0x31dd('0x1f')],_0xd37ff6['membername'],queues[_0xd37ff6[_0x31dd('0x4')]][_0x31dd('0x1c')]));writeDB(queues[_0xd37ff6[_0x31dd('0x4')]]);}}}catch(_0x49d5f3){utils[_0x31dd('0x14')](util[_0x31dd('0x2')](_0x31dd('0x42'),_0xd37ff6[_0x31dd('0x4')]),_0x49d5f3);}};exports[_0x31dd('0x47')]=function(_0x4f8421){try{if(!_['isNil'](queues[_0x4f8421[_0x31dd('0x48')]])){utils[_0x31dd('0xe')](util[_0x31dd('0x2')](_0x31dd('0x49'),_0x4f8421[_0x31dd('0x4')]),_0x4f8421);queues[_0x4f8421[_0x31dd('0x48')]][_0x31dd('0x44')]=!![];queues[_0x4f8421[_0x31dd('0x48')]]['transfertype']=_0x31dd('0x4a');queues[_0x4f8421[_0x31dd('0x48')]]['transferexten']=_0x4f8421[_0x31dd('0x4b')];queues[_0x4f8421[_0x31dd('0x48')]]['transferuniqueid']=_0x4f8421[_0x31dd('0x48')];queues[_0x4f8421[_0x31dd('0x48')]][_0x31dd('0x1c')]='BLINDTRANSFER';utils['info'](util['format'](_0x31dd('0x4c'),_0x4f8421[_0x31dd('0x4')],queues[_0x4f8421[_0x31dd('0x48')]]['name'],_0x4f8421[_0x31dd('0x48')],_0x4f8421[_0x31dd('0x4b')]));}}catch(_0x8e62e3){utils[_0x31dd('0x14')](util[_0x31dd('0x2')](_0x31dd('0x49'),_0x4f8421[_0x31dd('0x4')]),_0x8e62e3);}};exports[_0x31dd('0x4d')]=function(_0x28f241){try{utils[_0x31dd('0xe')](util[_0x31dd('0x2')](_0x31dd('0x4e'),_0x28f241[_0x31dd('0x4f')]),_0x28f241);if(_0x28f241[_0x31dd('0x4f')]==_0x28f241[_0x31dd('0x50')]){if(!_[_0x31dd('0x23')](queues[_0x28f241[_0x31dd('0x51')]])){utils['info'](util[_0x31dd('0x2')](_0x31dd('0x52'),_0x28f241[_0x31dd('0x4f')],queues[_0x28f241[_0x31dd('0x51')]][_0x31dd('0x1f')],_0x28f241[_0x31dd('0x53')]));queues[_0x28f241[_0x31dd('0x51')]][_0x31dd('0x44')]=!![];queues[_0x28f241['secondtransfererlinkedid']][_0x31dd('0x54')]='ATTENDED';queues[_0x28f241[_0x31dd('0x51')]]['transferexten']=_0x28f241[_0x31dd('0x53')];queues[_0x28f241[_0x31dd('0x51')]][_0x31dd('0x55')]=_0x28f241[_0x31dd('0x4f')];queues[_0x28f241[_0x31dd('0x51')]][_0x31dd('0x1c')]=_0x31dd('0x56');}if(!_[_0x31dd('0x23')](queues[_0x28f241[_0x31dd('0x50')]])){if(_0x28f241['transfereelinkedid']&&queues[_0x28f241[_0x31dd('0x57')]]){queues[_0x28f241['transfereelinkedid']][_0x31dd('0x20')]=0x1;queues[_0x28f241[_0x31dd('0x48')]]=_['clone'](queues[_0x28f241[_0x31dd('0x57')]]);queues[_0x28f241[_0x31dd('0x48')]][_0x31dd('0xc')]=_0x28f241[_0x31dd('0x58')];queues[_0x28f241[_0x31dd('0x48')]][_0x31dd('0x20')]=0x2;queues[_0x28f241[_0x31dd('0x48')]][_0x31dd('0x59')]=queues[_0x28f241['secondtransfererlinkedid']][_0x31dd('0x59')];queues[_0x28f241[_0x31dd('0x48')]][_0x31dd('0x5a')]=queues[_0x28f241['secondtransfererlinkedid']][_0x31dd('0x5a')];queues[_0x28f241[_0x31dd('0x48')]]['queuecallerjoinAt']=utils['now']();queues[_0x28f241[_0x31dd('0x48')]][_0x31dd('0x16')]=utils['now']();queues[_0x28f241[_0x31dd('0x48')]]['holdtime']=0x0;queues[_0x28f241[_0x31dd('0x48')]][_0x31dd('0x5b')]=0x0;utils[_0x31dd('0x10')](util[_0x31dd('0x2')](_0x31dd('0x5c'),_0x28f241[_0x31dd('0x4f')],queues[_0x28f241['transfereeuniqueid']][_0x31dd('0x1f')],queues[_0x28f241[_0x31dd('0x48')]]['calleridnum'],queues[_0x28f241[_0x31dd('0x48')]]['calleridname']));}else{utils[_0x31dd('0x10')](util[_0x31dd('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x28f241[_0x31dd('0x4f')],queues[_0x28f241[_0x31dd('0x50')]][_0x31dd('0x1f')],_0x28f241[_0x31dd('0x51')]));queues[_0x28f241['origtransfererlinkedid']]['transfereduniqueid']=_0x28f241['secondtransfererlinkedid'];}}}else if(_0x28f241[_0x31dd('0x5d')]==_0x28f241[_0x31dd('0x51')]){if(!_[_0x31dd('0x23')](queues[_0x28f241[_0x31dd('0x50')]])){utils[_0x31dd('0x10')](util[_0x31dd('0x2')](_0x31dd('0x5e'),_0x28f241[_0x31dd('0x4f')],queues[_0x28f241['origtransfererlinkedid']][_0x31dd('0x1f')],_0x28f241[_0x31dd('0x5d')],_0x28f241['secondtransfererexten']));queues[_0x28f241['origtransfererlinkedid']][_0x31dd('0x44')]=!![];queues[_0x28f241[_0x31dd('0x50')]][_0x31dd('0x54')]='ATTENDED';queues[_0x28f241['origtransfererlinkedid']][_0x31dd('0x5f')]=_0x28f241[_0x31dd('0x60')];queues[_0x28f241[_0x31dd('0x50')]][_0x31dd('0x55')]=_0x28f241['secondtransfereruniqueid'];queues[_0x28f241[_0x31dd('0x50')]]['queuecallerexitreason']=_0x31dd('0x56');}if(!_['isNil'](queues[_0x28f241[_0x31dd('0x51')]])){if(_0x28f241['transfertargetlinkedid']&&queues[_0x28f241[_0x31dd('0x61')]]){queues[_0x28f241[_0x31dd('0x61')]][_0x31dd('0x20')]=0x1;queues[_0x28f241[_0x31dd('0x58')]]=_[_0x31dd('0x62')](queues[_0x28f241[_0x31dd('0x61')]]);queues[_0x28f241[_0x31dd('0x58')]][_0x31dd('0xc')]=_0x28f241['transfertargetuniqueid'];queues[_0x28f241['transfertargetuniqueid']][_0x31dd('0x20')]=0x2;queues[_0x28f241[_0x31dd('0x58')]][_0x31dd('0x59')]=queues[_0x28f241[_0x31dd('0x50')]][_0x31dd('0x59')];queues[_0x28f241[_0x31dd('0x58')]][_0x31dd('0x5a')]=queues[_0x28f241[_0x31dd('0x50')]]['calleridname'];queues[_0x28f241[_0x31dd('0x58')]]['queuecallerjoinAt']=utils[_0x31dd('0x1b')]();queues[_0x28f241[_0x31dd('0x58')]][_0x31dd('0x16')]=utils[_0x31dd('0x1b')]();queues[_0x28f241[_0x31dd('0x58')]][_0x31dd('0x35')]=0x0;queues[_0x28f241[_0x31dd('0x58')]]['mohtime']=0x0;utils[_0x31dd('0x10')](util[_0x31dd('0x2')](_0x31dd('0x63'),_0x28f241[_0x31dd('0x4f')],queues[_0x28f241['transfertargetuniqueid']][_0x31dd('0x1f')],queues[_0x28f241['transfertargetuniqueid']]['transfereduniqueid'],queues[_0x28f241[_0x31dd('0x58')]][_0x31dd('0x59')],queues[_0x28f241[_0x31dd('0x58')]][_0x31dd('0x5a')]));}else{utils['info'](util[_0x31dd('0x2')](_0x31dd('0x64'),_0x28f241['origtransfereruniqueid'],queues[_0x28f241[_0x31dd('0x51')]][_0x31dd('0x1f')],_0x28f241['origtransfererlinkedid']));queues[_0x28f241[_0x31dd('0x51')]][_0x31dd('0xc')]=_0x28f241[_0x31dd('0x50')];}}}}catch(_0x5eb370){utils['error'](util[_0x31dd('0x2')](_0x31dd('0x4e'),_0x28f241[_0x31dd('0x4f')]),_0x5eb370);}};exports[_0x31dd('0x65')]=function(_0x2f1c4e){try{if(!_['isNil'](queues[_0x2f1c4e[_0x31dd('0x4')]])){utils[_0x31dd('0xe')](util[_0x31dd('0x2')](_0x31dd('0x66'),_0x2f1c4e[_0x31dd('0x4')]),_0x2f1c4e);queues[_0x2f1c4e[_0x31dd('0x4')]][_0x31dd('0x67')]=utils[_0x31dd('0x1b')]();utils[_0x31dd('0x10')](util['format'](_0x31dd('0x68'),_0x2f1c4e[_0x31dd('0x4')],queues[_0x2f1c4e[_0x31dd('0x4')]]['name'],queues[_0x2f1c4e['uniqueid']]['musiconholdstartAt']));}}catch(_0x503e8a){utils[_0x31dd('0x14')](util['format']('[%s][queues][musiconholdstart]',_0x2f1c4e['uniqueid']),_0x503e8a);}};exports[_0x31dd('0x69')]=function(_0x277f88){try{if(!_[_0x31dd('0x23')](queues[_0x277f88['uniqueid']])){if(!_[_0x31dd('0x23')](queues[_0x277f88[_0x31dd('0x4')]]['musiconholdstartAt'])){utils['debug'](util[_0x31dd('0x2')](_0x31dd('0x6a'),_0x277f88[_0x31dd('0x4')]),_0x277f88);queues[_0x277f88[_0x31dd('0x4')]][_0x31dd('0x5b')]+=utils['diffTime'](utils[_0x31dd('0x1b')](),queues[_0x277f88[_0x31dd('0x4')]][_0x31dd('0x67')]);utils[_0x31dd('0x10')](util[_0x31dd('0x2')](_0x31dd('0x6b'),_0x277f88[_0x31dd('0x4')],queues[_0x277f88[_0x31dd('0x4')]][_0x31dd('0x1f')],queues[_0x277f88[_0x31dd('0x4')]][_0x31dd('0x5b')]));delete queues[_0x277f88[_0x31dd('0x4')]][_0x31dd('0x67')];}}}catch(_0x365902){utils[_0x31dd('0x14')](util[_0x31dd('0x2')](_0x31dd('0x6a'),_0x277f88[_0x31dd('0x4')]),_0x365902);}}; \ No newline at end of file +var _0x3262=['musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','queue','lastAssignedTo','calleridnum','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','uniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','assign','position','error','hangup','[%s][queues][hangup]','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','now','COMPLETEDBYAGENT','info','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','name','queuecallerenterreason','varset','[%s][queues][varset]','isNil','queuestatus','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','variable','value','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','queuecallerleaveAt','holdtime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','assigned','accountcode','membername','[%s][queues][agentconnect]','agentcomplete','[%s][queues][agentcomplete]','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','transferuniqueid','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','extension','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','origtransfererexten','ATTENDED','transferexten','ATTENDEDTRANSFER','transfereelinkedid','calleridname','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','transfertargetuniqueid','clone','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s'];(function(_0x4782ac,_0x47975f){var _0x51f823=function(_0x229dd4){while(--_0x229dd4){_0x4782ac['push'](_0x4782ac['shift']());}};_0x51f823(++_0x47975f);}(_0x3262,0x1ab));var _0x2326=function(_0x41c99a,_0x12414d){_0x41c99a=_0x41c99a-0x0;var _0x303bf9=_0x3262[_0x41c99a];return _0x303bf9;};'use strict';var _=require(_0x2326('0x0'));var util=require(_0x2326('0x1'));var utils=require(_0x2326('0x2'));var queues={};function writeDB(_0x3595be){utils['info'](util[_0x2326('0x3')](_0x2326('0x4'),_0x3595be['uniqueid'],_0x3595be['channel'],_0x3595be[_0x2326('0x5')],_0x3595be[_0x2326('0x6')],_0x3595be[_0x2326('0x7')],_0x3595be['accountcode'],_0x3595be[_0x2326('0x8')]));if(_0x3595be[_0x2326('0x5')]){utils[_0x2326('0x9')](_0x3595be['queue'])[_0x2326('0xa')](function(_0x3288f4){if(_0x3288f4){_0x3595be['type']=_0x3288f4[_0x2326('0xb')];}utils[_0x2326('0xc')](_0x2326('0xd'),_0x3595be);});}else{utils[_0x2326('0xc')](_0x2326('0xd'),_0x3595be);}if(_0x3595be[_0x2326('0xe')]){delete queues[_0x3595be[_0x2326('0xe')]];}else{delete queues[_0x3595be[_0x2326('0xf')]];}}exports[_0x2326('0x10')]=function(_0x17a8d9){try{utils[_0x2326('0x11')](util['format'](_0x2326('0x12'),_0x17a8d9['uniqueid']),_0x17a8d9);utils['info'](util[_0x2326('0x3')](_0x2326('0x13'),_0x17a8d9['uniqueid'],_0x17a8d9['queue'],_0x17a8d9['position']));queues[_0x17a8d9[_0x2326('0xf')]]=_[_0x2326('0x14')](_0x17a8d9,{'originalposition':_0x17a8d9[_0x2326('0x15')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x2e4dc7){utils[_0x2326('0x16')](util['format'](_0x2326('0x12'),_0x17a8d9[_0x2326('0xf')]),_0x2e4dc7);}};exports[_0x2326('0x17')]=function(_0x596bc7){try{if(!_['isNil'](queues[_0x596bc7[_0x2326('0xf')]])){utils['debug'](util['format'](_0x2326('0x18'),_0x596bc7['uniqueid']),_0x596bc7);if(queues[_0x596bc7[_0x2326('0xf')]]['queuecallerleaveAt']){if(!queues[_0x596bc7[_0x2326('0xf')]][_0x2326('0x19')]&&!queues[_0x596bc7[_0x2326('0xf')]][_0x2326('0x1a')]){queues[_0x596bc7[_0x2326('0xf')]][_0x2326('0x1b')]=!![];queues[_0x596bc7[_0x2326('0xf')]][_0x2326('0x1c')]=utils[_0x2326('0x1d')]();queues[_0x596bc7[_0x2326('0xf')]][_0x2326('0x8')]=_0x2326('0x1e');}utils[_0x2326('0x1f')](util[_0x2326('0x3')](_0x2326('0x20'),_0x596bc7['uniqueid'],queues[_0x596bc7[_0x2326('0xf')]]['name'],queues[_0x596bc7[_0x2326('0xf')]][_0x2326('0x8')]));writeDB(queues[_0x596bc7[_0x2326('0xf')]]);}else if(queues[_0x596bc7['uniqueid']][_0x2326('0xe')]){utils[_0x2326('0x1f')](util['format'](_0x2326('0x21'),_0x596bc7[_0x2326('0xf')],queues[_0x596bc7['uniqueid']][_0x2326('0x22')],queues[_0x596bc7[_0x2326('0xf')]]['transfereduniqueid']));queues[queues[_0x596bc7[_0x2326('0xf')]][_0x2326('0xe')]]=queues[_0x596bc7[_0x2326('0xf')]];queues[queues[_0x596bc7[_0x2326('0xf')]][_0x2326('0xe')]][_0x2326('0x23')]=0x2;delete queues[_0x596bc7[_0x2326('0xf')]];}}}catch(_0xc34a69){utils[_0x2326('0x16')](util[_0x2326('0x3')](_0x2326('0x18'),_0x596bc7[_0x2326('0xf')]),_0xc34a69);}};exports[_0x2326('0x24')]=function(_0x28bd45){try{utils[_0x2326('0x11')](util[_0x2326('0x3')](_0x2326('0x25'),_0x28bd45['uniqueid']),_0x28bd45);if(!_[_0x2326('0x26')](_0x28bd45['variable'][_0x2326('0x27')])&&_0x28bd45['value'][_0x2326('0x28')]()!==_0x2326('0x29')){if(!_['isNil'](queues[_0x28bd45[_0x2326('0xf')]])){queues[_0x28bd45['uniqueid']]['queuecallerabandon']=![];queues[_0x28bd45['uniqueid']][_0x2326('0x2a')]=null;queues[_0x28bd45['uniqueid']][_0x2326('0x1a')]=!![];queues[_0x28bd45[_0x2326('0xf')]][_0x2326('0x2b')]=utils['now']();queues[_0x28bd45['uniqueid']][_0x2326('0x8')]=_0x28bd45['value'][_0x2326('0x28')]();utils[_0x2326('0x1f')](util[_0x2326('0x3')](_0x2326('0x2c'),_0x28bd45['uniqueid'],queues[_0x28bd45['uniqueid']][_0x2326('0x22')],_0x28bd45['value'],queues[_0x28bd45[_0x2326('0xf')]][_0x2326('0x8')]));writeDB(queues[_0x28bd45['uniqueid']]);}}else if(!_[_0x2326('0x26')](_0x28bd45[_0x2326('0x2d')]['queueposition'])){if(!_['isNil'](queues[_0x28bd45[_0x2326('0xf')]])&&!queues[_0x28bd45['uniqueid']][_0x2326('0x19')]){queues[_0x28bd45[_0x2326('0xf')]][_0x2326('0x19')]=![];queues[_0x28bd45['uniqueid']][_0x2326('0x2a')]=null;queues[_0x28bd45[_0x2326('0xf')]][_0x2326('0x1a')]=!![];queues[_0x28bd45[_0x2326('0xf')]][_0x2326('0x2b')]=utils[_0x2326('0x1d')]();queues[_0x28bd45[_0x2326('0xf')]][_0x2326('0x8')]='EXITWITHKEY';utils[_0x2326('0x1f')](util[_0x2326('0x3')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x28bd45['uniqueid'],queues[_0x28bd45[_0x2326('0xf')]]['name'],_0x28bd45[_0x2326('0x2e')],queues[_0x28bd45[_0x2326('0xf')]][_0x2326('0x8')]));}}}catch(_0x4c5768){utils[_0x2326('0x16')](util[_0x2326('0x3')]('[%s][queues][varset]',_0x28bd45[_0x2326('0xf')]),_0x4c5768);}};exports['queuecallerabandon']=function(_0x11ac19){try{if(!_[_0x2326('0x26')](queues[_0x11ac19[_0x2326('0xf')]])){utils[_0x2326('0x11')](util['format']('[%s][queues][queuecallerabandon]',_0x11ac19[_0x2326('0xf')]),_0x11ac19);queues[_0x11ac19['uniqueid']][_0x2326('0x1a')]=![];queues[_0x11ac19[_0x2326('0xf')]][_0x2326('0x2b')]=null;queues[_0x11ac19['uniqueid']]['queuecallerabandon']=!![];queues[_0x11ac19[_0x2326('0xf')]][_0x2326('0x2a')]=utils[_0x2326('0x1d')]();queues[_0x11ac19[_0x2326('0xf')]]['queuecallerexitreason']=_0x2326('0x2f');utils['info'](util['format'](_0x2326('0x30'),_0x11ac19['uniqueid'],queues[_0x11ac19[_0x2326('0xf')]]['name'],queues[_0x11ac19[_0x2326('0xf')]][_0x2326('0x8')]));}}catch(_0x24a995){utils[_0x2326('0x16')](util['format'](_0x2326('0x31'),_0x11ac19['uniqueid']),_0x24a995);}};exports[_0x2326('0x32')]=function(_0xe0ed3f){try{if(!_[_0x2326('0x26')](queues[_0xe0ed3f['uniqueid']])){utils[_0x2326('0x11')](util[_0x2326('0x3')](_0x2326('0x33'),_0xe0ed3f[_0x2326('0xf')]),_0xe0ed3f);utils['info'](util[_0x2326('0x3')](_0x2326('0x34'),_0xe0ed3f['uniqueid'],queues[_0xe0ed3f[_0x2326('0xf')]][_0x2326('0x22')],_0xe0ed3f[_0x2326('0x35')],_0xe0ed3f[_0x2326('0x36')]));queues[_0xe0ed3f[_0x2326('0xf')]][_0x2326('0x32')]=!![];queues[_0xe0ed3f[_0x2326('0xf')]][_0x2326('0x37')]=utils[_0x2326('0x1d')]();queues[_0xe0ed3f[_0x2326('0xf')]][_0x2326('0x38')]=utils['diffTime'](queues[_0xe0ed3f['uniqueid']][_0x2326('0x37')],queues[_0xe0ed3f[_0x2326('0xf')]][_0x2326('0x39')]);queues[_0xe0ed3f['uniqueid']]['position']=_0xe0ed3f[_0x2326('0x15')];queues[_0xe0ed3f[_0x2326('0xf')]][_0x2326('0x3a')]=_0xe0ed3f['count'];queues[_0xe0ed3f[_0x2326('0xf')]]['connectedlinenum']=_0xe0ed3f[_0x2326('0x35')];queues[_0xe0ed3f[_0x2326('0xf')]][_0x2326('0x36')]=_0xe0ed3f[_0x2326('0x36')];}}catch(_0x5de54f){utils[_0x2326('0x16')](util[_0x2326('0x3')](_0x2326('0x33'),_0xe0ed3f['uniqueid']),_0x5de54f);}};exports[_0x2326('0x3b')]=function(_0x4f94fc){try{if(!_['isNil'](queues[_0x4f94fc['uniqueid']])){utils[_0x2326('0x11')](util[_0x2326('0x3')]('[%s][queues][agentconnect]',_0x4f94fc[_0x2326('0xf')]),_0x4f94fc);utils['info'](util[_0x2326('0x3')](_0x2326('0x3c'),_0x4f94fc[_0x2326('0xf')],queues[_0x4f94fc['uniqueid']][_0x2326('0x22')],_0x4f94fc['membername'],_0x4f94fc['destaccountcode']));queues[_0x4f94fc[_0x2326('0xf')]][_0x2326('0x19')]=![];queues[_0x4f94fc[_0x2326('0xf')]][_0x2326('0x19')]=![];queues[_0x4f94fc[_0x2326('0xf')]]['queuecallerabandonAt']=null;queues[_0x4f94fc[_0x2326('0xf')]][_0x2326('0x1a')]=![];queues[_0x4f94fc['uniqueid']][_0x2326('0x8')]=null;queues[_0x4f94fc['uniqueid']][_0x2326('0x2b')]=null;queues[_0x4f94fc[_0x2326('0xf')]][_0x2326('0x3d')]=!![];queues[_0x4f94fc[_0x2326('0xf')]][_0x2326('0x3e')]=_0x4f94fc['destaccountcode'];queues[_0x4f94fc['uniqueid']][_0x2326('0x6')]=_0x4f94fc[_0x2326('0x3f')];}}catch(_0x164997){utils[_0x2326('0x16')](util[_0x2326('0x3')](_0x2326('0x40'),_0x4f94fc[_0x2326('0xf')]),_0x164997);}};exports[_0x2326('0x41')]=function(_0x4e188f){try{if(!_[_0x2326('0x26')](queues[_0x4e188f['uniqueid']])){if(queues[_0x4e188f[_0x2326('0xf')]][_0x2326('0x37')]){utils['debug'](util[_0x2326('0x3')](_0x2326('0x42'),_0x4e188f[_0x2326('0xf')]),_0x4e188f);queues[_0x4e188f[_0x2326('0xf')]]['queuecallerabandon']=![];queues[_0x4e188f[_0x2326('0xf')]][_0x2326('0x19')]=![];queues[_0x4e188f[_0x2326('0xf')]][_0x2326('0x2a')]=null;queues[_0x4e188f[_0x2326('0xf')]]['queuecallerexit']=![];queues[_0x4e188f['uniqueid']]['queuecallerexitAt']=null;queues[_0x4e188f[_0x2326('0xf')]][_0x2326('0x3d')]=!![];queues[_0x4e188f[_0x2326('0xf')]][_0x2326('0x6')]=_0x4e188f[_0x2326('0x3f')];queues[_0x4e188f[_0x2326('0xf')]][_0x2326('0x1b')]=!![];queues[_0x4e188f[_0x2326('0xf')]]['queuecallercompleteAt']=utils[_0x2326('0x1d')]();if(_0x4e188f[_0x2326('0x43')]==_0x2326('0x44')){if(!queues[_0x4e188f['uniqueid']][_0x2326('0x44')]){queues[_0x4e188f['uniqueid']][_0x2326('0x8')]=_0x2326('0x45');}}else{queues[_0x4e188f[_0x2326('0xf')]][_0x2326('0x8')]=_0x2326('0x46')+_0x4e188f[_0x2326('0x43')][_0x2326('0x28')]();}utils[_0x2326('0x1f')](util[_0x2326('0x3')](_0x2326('0x47'),_0x4e188f[_0x2326('0xf')],queues[_0x4e188f[_0x2326('0xf')]]['name'],_0x4e188f[_0x2326('0x3f')],queues[_0x4e188f['uniqueid']][_0x2326('0x8')]));writeDB(queues[_0x4e188f[_0x2326('0xf')]]);}}}catch(_0x50658c){utils[_0x2326('0x16')](util['format'](_0x2326('0x42'),_0x4e188f[_0x2326('0xf')]),_0x50658c);}};exports[_0x2326('0x48')]=function(_0x45caa1){try{if(!_['isNil'](queues[_0x45caa1[_0x2326('0x49')]])){utils[_0x2326('0x11')](util[_0x2326('0x3')](_0x2326('0x4a'),_0x45caa1['uniqueid']),_0x45caa1);queues[_0x45caa1[_0x2326('0x49')]][_0x2326('0x44')]=!![];queues[_0x45caa1[_0x2326('0x49')]][_0x2326('0x4b')]='BLIND';queues[_0x45caa1[_0x2326('0x49')]]['transferexten']=_0x45caa1['extension'];queues[_0x45caa1[_0x2326('0x49')]][_0x2326('0x4c')]=_0x45caa1[_0x2326('0x49')];queues[_0x45caa1[_0x2326('0x49')]]['queuecallerexitreason']='BLINDTRANSFER';utils['info'](util['format'](_0x2326('0x4d'),_0x45caa1['uniqueid'],queues[_0x45caa1['transfereeuniqueid']][_0x2326('0x22')],_0x45caa1[_0x2326('0x49')],_0x45caa1[_0x2326('0x4e')]));}}catch(_0x57d216){utils['error'](util[_0x2326('0x3')](_0x2326('0x4a'),_0x45caa1['uniqueid']),_0x57d216);}};exports[_0x2326('0x4f')]=function(_0x1e8474){try{utils['debug'](util[_0x2326('0x3')](_0x2326('0x50'),_0x1e8474['origtransfereruniqueid']),_0x1e8474);if(_0x1e8474[_0x2326('0x51')]==_0x1e8474[_0x2326('0x52')]){if(!_[_0x2326('0x26')](queues[_0x1e8474[_0x2326('0x53')]])){utils[_0x2326('0x1f')](util[_0x2326('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x1e8474[_0x2326('0x51')],queues[_0x1e8474[_0x2326('0x53')]][_0x2326('0x22')],_0x1e8474[_0x2326('0x54')]));queues[_0x1e8474['secondtransfererlinkedid']]['transfer']=!![];queues[_0x1e8474[_0x2326('0x53')]][_0x2326('0x4b')]=_0x2326('0x55');queues[_0x1e8474[_0x2326('0x53')]][_0x2326('0x56')]=_0x1e8474[_0x2326('0x54')];queues[_0x1e8474[_0x2326('0x53')]]['transferuniqueid']=_0x1e8474[_0x2326('0x51')];queues[_0x1e8474[_0x2326('0x53')]]['queuecallerexitreason']=_0x2326('0x57');}if(!_[_0x2326('0x26')](queues[_0x1e8474[_0x2326('0x52')]])){if(_0x1e8474[_0x2326('0x58')]&&queues[_0x1e8474[_0x2326('0x58')]]){queues[_0x1e8474[_0x2326('0x58')]][_0x2326('0x23')]=0x1;queues[_0x1e8474[_0x2326('0x49')]]=_['clone'](queues[_0x1e8474[_0x2326('0x58')]]);queues[_0x1e8474[_0x2326('0x49')]][_0x2326('0xe')]=_0x1e8474['transfertargetuniqueid'];queues[_0x1e8474[_0x2326('0x49')]]['queuecallerenterreason']=0x2;queues[_0x1e8474[_0x2326('0x49')]][_0x2326('0x7')]=queues[_0x1e8474[_0x2326('0x53')]][_0x2326('0x7')];queues[_0x1e8474[_0x2326('0x49')]]['calleridname']=queues[_0x1e8474[_0x2326('0x53')]][_0x2326('0x59')];queues[_0x1e8474[_0x2326('0x49')]]['queuecallerjoinAt']=utils[_0x2326('0x1d')]();queues[_0x1e8474['transfereeuniqueid']][_0x2326('0x37')]=utils['now']();queues[_0x1e8474[_0x2326('0x49')]][_0x2326('0x38')]=0x0;queues[_0x1e8474['transfereeuniqueid']]['mohtime']=0x0;utils[_0x2326('0x1f')](util['format'](_0x2326('0x5a'),_0x1e8474[_0x2326('0x51')],queues[_0x1e8474[_0x2326('0x49')]][_0x2326('0x22')],queues[_0x1e8474['transfereeuniqueid']][_0x2326('0x7')],queues[_0x1e8474['transfereeuniqueid']][_0x2326('0x59')]));}else{utils['info'](util[_0x2326('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x1e8474['origtransfereruniqueid'],queues[_0x1e8474['origtransfererlinkedid']][_0x2326('0x22')],_0x1e8474['secondtransfererlinkedid']));queues[_0x1e8474[_0x2326('0x52')]][_0x2326('0xe')]=_0x1e8474[_0x2326('0x53')];}}}else if(_0x1e8474['secondtransfereruniqueid']==_0x1e8474[_0x2326('0x53')]){if(!_[_0x2326('0x26')](queues[_0x1e8474['origtransfererlinkedid']])){utils[_0x2326('0x1f')](util[_0x2326('0x3')](_0x2326('0x5b'),_0x1e8474['origtransfereruniqueid'],queues[_0x1e8474[_0x2326('0x52')]][_0x2326('0x22')],_0x1e8474['secondtransfereruniqueid'],_0x1e8474[_0x2326('0x5c')]));queues[_0x1e8474['origtransfererlinkedid']][_0x2326('0x44')]=!![];queues[_0x1e8474[_0x2326('0x52')]]['transfertype']='ATTENDED';queues[_0x1e8474['origtransfererlinkedid']]['transferexten']=_0x1e8474[_0x2326('0x5c')];queues[_0x1e8474[_0x2326('0x52')]]['transferuniqueid']=_0x1e8474['secondtransfereruniqueid'];queues[_0x1e8474['origtransfererlinkedid']]['queuecallerexitreason']=_0x2326('0x57');}if(!_[_0x2326('0x26')](queues[_0x1e8474[_0x2326('0x53')]])){if(_0x1e8474[_0x2326('0x5d')]&&queues[_0x1e8474[_0x2326('0x5d')]]){queues[_0x1e8474['transfertargetlinkedid']]['queuecallerenterreason']=0x1;queues[_0x1e8474[_0x2326('0x5e')]]=_[_0x2326('0x5f')](queues[_0x1e8474[_0x2326('0x5d')]]);queues[_0x1e8474['transfertargetuniqueid']]['transfereduniqueid']=_0x1e8474[_0x2326('0x5e')];queues[_0x1e8474[_0x2326('0x5e')]][_0x2326('0x23')]=0x2;queues[_0x1e8474[_0x2326('0x5e')]][_0x2326('0x7')]=queues[_0x1e8474[_0x2326('0x52')]][_0x2326('0x7')];queues[_0x1e8474[_0x2326('0x5e')]][_0x2326('0x59')]=queues[_0x1e8474[_0x2326('0x52')]][_0x2326('0x59')];queues[_0x1e8474['transfertargetuniqueid']]['queuecallerjoinAt']=utils['now']();queues[_0x1e8474['transfertargetuniqueid']][_0x2326('0x37')]=utils[_0x2326('0x1d')]();queues[_0x1e8474[_0x2326('0x5e')]][_0x2326('0x38')]=0x0;queues[_0x1e8474[_0x2326('0x5e')]][_0x2326('0x60')]=0x0;utils[_0x2326('0x1f')](util[_0x2326('0x3')](_0x2326('0x61'),_0x1e8474[_0x2326('0x51')],queues[_0x1e8474[_0x2326('0x5e')]][_0x2326('0x22')],queues[_0x1e8474[_0x2326('0x5e')]]['transfereduniqueid'],queues[_0x1e8474[_0x2326('0x5e')]][_0x2326('0x7')],queues[_0x1e8474[_0x2326('0x5e')]][_0x2326('0x59')]));}else{utils[_0x2326('0x1f')](util[_0x2326('0x3')](_0x2326('0x62'),_0x1e8474['origtransfereruniqueid'],queues[_0x1e8474[_0x2326('0x53')]][_0x2326('0x22')],_0x1e8474[_0x2326('0x52')]));queues[_0x1e8474[_0x2326('0x53')]][_0x2326('0xe')]=_0x1e8474[_0x2326('0x52')];}}}}catch(_0x6751d9){utils['error'](util['format'](_0x2326('0x50'),_0x1e8474[_0x2326('0x51')]),_0x6751d9);}};exports[_0x2326('0x63')]=function(_0x1d900f){try{if(!_['isNil'](queues[_0x1d900f[_0x2326('0xf')]])){utils['debug'](util[_0x2326('0x3')](_0x2326('0x64'),_0x1d900f['uniqueid']),_0x1d900f);queues[_0x1d900f[_0x2326('0xf')]][_0x2326('0x65')]=utils[_0x2326('0x1d')]();utils[_0x2326('0x1f')](util[_0x2326('0x3')](_0x2326('0x66'),_0x1d900f[_0x2326('0xf')],queues[_0x1d900f[_0x2326('0xf')]][_0x2326('0x22')],queues[_0x1d900f[_0x2326('0xf')]][_0x2326('0x65')]));}}catch(_0x3eefde){utils['error'](util[_0x2326('0x3')](_0x2326('0x64'),_0x1d900f[_0x2326('0xf')]),_0x3eefde);}};exports[_0x2326('0x67')]=function(_0x3d4a68){try{if(!_[_0x2326('0x26')](queues[_0x3d4a68[_0x2326('0xf')]])){if(!_[_0x2326('0x26')](queues[_0x3d4a68[_0x2326('0xf')]][_0x2326('0x65')])){utils[_0x2326('0x11')](util[_0x2326('0x3')](_0x2326('0x68'),_0x3d4a68[_0x2326('0xf')]),_0x3d4a68);queues[_0x3d4a68[_0x2326('0xf')]][_0x2326('0x60')]+=utils['diffTime'](utils[_0x2326('0x1d')](),queues[_0x3d4a68[_0x2326('0xf')]][_0x2326('0x65')]);utils[_0x2326('0x1f')](util[_0x2326('0x3')](_0x2326('0x69'),_0x3d4a68[_0x2326('0xf')],queues[_0x3d4a68[_0x2326('0xf')]]['name'],queues[_0x3d4a68['uniqueid']][_0x2326('0x60')]));delete queues[_0x3d4a68[_0x2326('0xf')]][_0x2326('0x65')];}}}catch(_0x52afef){utils['error'](util[_0x2326('0x3')](_0x2326('0x68'),_0x3d4a68['uniqueid']),_0x52afef);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 97450f0..1c95d2f 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 _0x5f20=['[%s][recordings][newexten]','application','toLowerCase','set','appdata','split','substring','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','recording','lodash','util','./utils','./transfers.controller','info','format','uniqueid','blinds','transfereeuniqueid','accountcode','getUserByInternal','then','membername','name','UserId','request','CreateVoiceRecording','debug','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','newstate','[%s][recordings][newstate]','isNil','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','[%s][recordings][varset]','value','endsWith','replace','.WAV','find','monitors','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','forEach','clone'];(function(_0x4dedee,_0x36d78b){var _0x5bcd62=function(_0x4457b6){while(--_0x4457b6){_0x4dedee['push'](_0x4dedee['shift']());}};_0x5bcd62(++_0x36d78b);}(_0x5f20,0x176));var _0x05f2=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0x5f20[_0x474bc0];return _0x4b24cf;};'use strict';var _=require(_0x05f2('0x0'));var util=require(_0x05f2('0x1'));var utils=require(_0x05f2('0x2'));var transfers=require(_0x05f2('0x3'));var recordings={};function writeDB(_0x466d4e){var _0x344285;utils[_0x05f2('0x4')](util[_0x05f2('0x5')]('[%s][recordings][writeDB]',_0x466d4e[_0x05f2('0x6')]));if(transfers[_0x05f2('0x7')][_0x466d4e[_0x05f2('0x6')]]){_0x344285=_0x466d4e[_0x05f2('0x6')];_0x466d4e[_0x05f2('0x6')]=transfers[_0x05f2('0x7')][_0x466d4e[_0x05f2('0x6')]][_0x05f2('0x8')];}if(_0x466d4e[_0x05f2('0x9')]){utils[_0x05f2('0xa')](_0x466d4e[_0x05f2('0x9')])[_0x05f2('0xb')](function(_0x57380f){if(_0x57380f){_0x466d4e[_0x05f2('0xc')]=_0x57380f[_0x05f2('0xd')];_0x466d4e[_0x05f2('0xe')]=_0x57380f['id'];}utils[_0x05f2('0xf')](_0x05f2('0x10'),_0x466d4e);});}else{utils[_0x05f2('0xf')](_0x05f2('0x10'),_0x466d4e);}if(_0x344285)delete transfers[_0x05f2('0x7')][_0x344285];}exports['newchannel']=function(_0x5c50fd){try{utils[_0x05f2('0x11')](util[_0x05f2('0x5')](_0x05f2('0x12'),_0x5c50fd['uniqueid']),_0x5c50fd);if(_0x5c50fd[_0x05f2('0x6')]==_0x5c50fd[_0x05f2('0x13')]){utils[_0x05f2('0x4')](util[_0x05f2('0x5')](_0x05f2('0x14'),_0x5c50fd[_0x05f2('0x6')],_0x5c50fd[_0x05f2('0x15')],_0x5c50fd[_0x05f2('0x16')]));recordings[_0x5c50fd[_0x05f2('0x6')]]={'uniqueid':_0x5c50fd[_0x05f2('0x6')],'accountcode':_0x5c50fd['accountcode'],'exten':_0x5c50fd[_0x05f2('0x16')],'context':_0x5c50fd[_0x05f2('0x15')],'channel':_0x5c50fd[_0x05f2('0x17')],'monitors':[]};}}catch(_0x10fcc3){utils[_0x05f2('0x18')](util[_0x05f2('0x5')]('[%s][recordings][newchannel]',_0x5c50fd['uniqueid']),_0x10fcc3);}};exports[_0x05f2('0x19')]=function(_0x3e2480){try{utils[_0x05f2('0x11')](util[_0x05f2('0x5')](_0x05f2('0x1a'),_0x3e2480[_0x05f2('0x6')]),_0x3e2480);if(!_[_0x05f2('0x1b')](recordings[_0x3e2480[_0x05f2('0x6')]])&&_0x3e2480['channelstate']==0x6){utils[_0x05f2('0x4')](util[_0x05f2('0x5')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x3e2480[_0x05f2('0x6')],_0x3e2480[_0x05f2('0x15')],_0x3e2480['channel']));}else if(!_[_0x05f2('0x1b')](recordings[_0x3e2480[_0x05f2('0x13')]])&&_0x3e2480['channelstate']==0x6&&_0x3e2480[_0x05f2('0x15')]!=_0x05f2('0x1c')){utils[_0x05f2('0x4')](util[_0x05f2('0x5')](_0x05f2('0x1d'),_0x3e2480[_0x05f2('0x6')],_0x3e2480[_0x05f2('0x13')],_0x3e2480[_0x05f2('0x15')],_0x3e2480['channel']));recordings[_0x3e2480['linkedid']]['accountcode']=_0x3e2480[_0x05f2('0x9')];}}catch(_0x15fc48){utils[_0x05f2('0x18')](util['format'](_0x05f2('0x1a'),_0x3e2480[_0x05f2('0x6')]),_0x15fc48);}};exports[_0x05f2('0x1e')]=function(_0x3cde24){try{if(!_['isNil'](_0x3cde24[_0x05f2('0x1f')])&&!_[_0x05f2('0x1b')](_0x3cde24[_0x05f2('0x1f')][_0x05f2('0x20')])){utils[_0x05f2('0x11')](util[_0x05f2('0x5')](_0x05f2('0x21'),_0x3cde24[_0x05f2('0x6')]),_0x3cde24);utils[_0x05f2('0x4')](util['format']('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x3cde24[_0x05f2('0x6')],_0x3cde24[_0x05f2('0x1f')],_0x3cde24[_0x05f2('0x22')]));if(_[_0x05f2('0x23')](_0x3cde24[_0x05f2('0x22')],'.wav49')){_0x3cde24['value']=_0x3cde24[_0x05f2('0x22')][_0x05f2('0x24')]('.wav49',_0x05f2('0x25'));}if(recordings[_0x3cde24[_0x05f2('0x13')]]){var _0xa98855=_[_0x05f2('0x26')](recordings[_0x3cde24['linkedid']]['monitors'],{'value':_0x3cde24['value']});if(_[_0x05f2('0x1b')](_0xa98855)){recordings[_0x3cde24[_0x05f2('0x13')]][_0x05f2('0x27')][_0x05f2('0x28')]({'value':_0x3cde24[_0x05f2('0x22')]});}}}}catch(_0x2c20cd){utils[_0x05f2('0x18')](util[_0x05f2('0x5')](_0x05f2('0x21'),_0x3cde24[_0x05f2('0x6')]),_0x2c20cd);}};exports[_0x05f2('0x29')]=function(_0xd7649){try{if(!_[_0x05f2('0x1b')](recordings[_0xd7649[_0x05f2('0x6')]])){utils[_0x05f2('0x11')](util[_0x05f2('0x5')](_0x05f2('0x2a'),_0xd7649['uniqueid']),_0xd7649);utils[_0x05f2('0x4')](util[_0x05f2('0x5')](_0x05f2('0x2b'),_0xd7649[_0x05f2('0x6')],_0xd7649[_0x05f2('0x2c')],_0xd7649[_0x05f2('0x2d')],_0xd7649[_0x05f2('0x2e')]));recordings[_0xd7649[_0x05f2('0x6')]][_0x05f2('0x2c')]=_0xd7649[_0x05f2('0x2c')];recordings[_0xd7649[_0x05f2('0x6')]]['calleridname']=_0xd7649['calleridname'];recordings[_0xd7649['uniqueid']][_0x05f2('0x2f')]=_0xd7649['connectedlinenum'];recordings[_0xd7649['uniqueid']]['connectedlinename']=_0xd7649[_0x05f2('0x30')];if(recordings[_0xd7649['uniqueid']][_0x05f2('0x31')]=='outbound'&&recordings[_0xd7649[_0x05f2('0x6')]][_0x05f2('0x9')]){recordings[_0xd7649[_0x05f2('0x6')]][_0x05f2('0x2f')]=recordings[_0xd7649['uniqueid']][_0x05f2('0x9')];recordings[_0xd7649['uniqueid']][_0x05f2('0x30')]='';}recordings[_0xd7649['uniqueid']]['monitors'][_0x05f2('0x32')](function(_0x497cff){var _0x31178a=_[_0x05f2('0x33')](recordings[_0xd7649['uniqueid']]);_0x31178a[_0x05f2('0x22')]=_0x497cff[_0x05f2('0x22')];writeDB(_0x31178a);});delete recordings[_0xd7649[_0x05f2('0x6')]];}}catch(_0x29c802){utils['error'](util[_0x05f2('0x5')](_0x05f2('0x2a'),_0xd7649[_0x05f2('0x6')]),_0x29c802);}};exports['newexten']=function(_0x2aedfb){try{if(!_['isNil'](recordings[_0x2aedfb[_0x05f2('0x6')]])){utils[_0x05f2('0x11')](util['format'](_0x05f2('0x34'),_0x2aedfb[_0x05f2('0x6')]),_0x2aedfb);utils[_0x05f2('0x4')](util[_0x05f2('0x5')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x2aedfb[_0x05f2('0x6')],_0x2aedfb[_0x05f2('0x35')],_0x2aedfb['appdata']));if(_0x2aedfb[_0x05f2('0x35')][_0x05f2('0x36')]()==_0x05f2('0x37')&&_['startsWith'](_0x2aedfb[_0x05f2('0x38')][_0x05f2('0x36')](),'cdr')){var _0x56b457=_0x2aedfb[_0x05f2('0x38')][_0x05f2('0x39')]('=');var _0x2eead2=_0x56b457[0x0][_0x05f2('0x3a')](_0x56b457[0x0]['lastIndexOf']('(')+0x1,_0x56b457[0x0]['lastIndexOf'](')'));var _0x21b225=_0x56b457[0x1];recordings[_0x2aedfb[_0x05f2('0x6')]][_0x2eead2]=_0x21b225;}}}catch(_0x3c6e78){utils[_0x05f2('0x18')](util[_0x05f2('0x5')](_0x05f2('0x34'),_0x2aedfb[_0x05f2('0x6')]),_0x3c6e78);}};exports['queuecallerjoin']=function(_0x12e958){try{if(!_[_0x05f2('0x1b')](recordings[_0x12e958['uniqueid']])){utils[_0x05f2('0x11')](util['format'](_0x05f2('0x3b'),_0x12e958[_0x05f2('0x6')]),_0x12e958);utils[_0x05f2('0x4')](util[_0x05f2('0x5')](_0x05f2('0x3c'),_0x12e958[_0x05f2('0x6')],_0x12e958[_0x05f2('0x3d')]));recordings[_0x12e958[_0x05f2('0x6')]][_0x05f2('0x3d')]=_0x12e958[_0x05f2('0x3d')];}}catch(_0x3f9ab7){utils[_0x05f2('0x18')](util[_0x05f2('0x5')](_0x05f2('0x3b'),_0x12e958['uniqueid']),_0x3f9ab7);}};exports[_0x05f2('0x3e')]=function(_0x3fc2b5){try{utils[_0x05f2('0x11')](util[_0x05f2('0x5')](_0x05f2('0x3f'),_0x3fc2b5[_0x05f2('0x6')]),_0x3fc2b5);utils[_0x05f2('0x4')](util[_0x05f2('0x5')](_0x05f2('0x40'),_0x3fc2b5[_0x05f2('0x6')],_0x3fc2b5[_0x05f2('0x41')],_0x3fc2b5[_0x05f2('0x42')],_0x3fc2b5[_0x05f2('0x43')],_0x3fc2b5[_0x05f2('0x44')]));if(recordings[_0x3fc2b5['transfereruniqueid']]&&transfers[_0x05f2('0x7')][_0x3fc2b5['transfereruniqueid']]){transfers[_0x05f2('0x7')][_0x3fc2b5[_0x05f2('0x45')]][_0x05f2('0x46')]=!![];}}catch(_0x37642f){utils[_0x05f2('0x18')](util[_0x05f2('0x5')]('[%s][recordings][blindtransfer]',_0x3fc2b5[_0x05f2('0x6')]),_0x37642f);}}; \ No newline at end of file +var _0xf2c7=['transfereeuniqueid','accountcode','getUserByInternal','then','membername','name','UserId','request','CreateVoiceRecording','newchannel','format','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','[%s][recordings][newchannel]','debug','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','[%s][recordings][newstate]','varset','variable','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','.wav49','replace','.WAV','find','monitors','push','[%s][recordings][hangup]','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','outbound','forEach','newexten','[%s][recordings][newexten]','application','toLowerCase','startsWith','cdr','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereecalleridnum','transfereecalleridname','transfereruniqueid','recording','lodash','util','./utils','./transfers.controller','info','[%s][recordings][writeDB]','blinds','uniqueid'];(function(_0x2514c7,_0x4a12a4){var _0x1480ff=function(_0x174459){while(--_0x174459){_0x2514c7['push'](_0x2514c7['shift']());}};_0x1480ff(++_0x4a12a4);}(_0xf2c7,0x1ae));var _0x7f2c=function(_0x3042c5,_0x36cb88){_0x3042c5=_0x3042c5-0x0;var _0x7cd140=_0xf2c7[_0x3042c5];return _0x7cd140;};'use strict';var _=require(_0x7f2c('0x0'));var util=require(_0x7f2c('0x1'));var utils=require(_0x7f2c('0x2'));var transfers=require(_0x7f2c('0x3'));var recordings={};function writeDB(_0x53dc7b){var _0x282dbe;utils[_0x7f2c('0x4')](util['format'](_0x7f2c('0x5'),_0x53dc7b['uniqueid']));if(transfers[_0x7f2c('0x6')][_0x53dc7b[_0x7f2c('0x7')]]){_0x282dbe=_0x53dc7b[_0x7f2c('0x7')];_0x53dc7b[_0x7f2c('0x7')]=transfers[_0x7f2c('0x6')][_0x53dc7b[_0x7f2c('0x7')]][_0x7f2c('0x8')];}if(_0x53dc7b[_0x7f2c('0x9')]){utils[_0x7f2c('0xa')](_0x53dc7b[_0x7f2c('0x9')])[_0x7f2c('0xb')](function(_0x1868c8){if(_0x1868c8){_0x53dc7b[_0x7f2c('0xc')]=_0x1868c8[_0x7f2c('0xd')];_0x53dc7b[_0x7f2c('0xe')]=_0x1868c8['id'];}utils[_0x7f2c('0xf')](_0x7f2c('0x10'),_0x53dc7b);});}else{utils[_0x7f2c('0xf')](_0x7f2c('0x10'),_0x53dc7b);}if(_0x282dbe)delete transfers[_0x7f2c('0x6')][_0x282dbe];}exports[_0x7f2c('0x11')]=function(_0x305dff){try{utils['debug'](util[_0x7f2c('0x12')]('[%s][recordings][newchannel]',_0x305dff[_0x7f2c('0x7')]),_0x305dff);if(_0x305dff['uniqueid']==_0x305dff[_0x7f2c('0x13')]){utils[_0x7f2c('0x4')](util[_0x7f2c('0x12')](_0x7f2c('0x14'),_0x305dff[_0x7f2c('0x7')],_0x305dff[_0x7f2c('0x15')],_0x305dff['exten']));recordings[_0x305dff[_0x7f2c('0x7')]]={'uniqueid':_0x305dff[_0x7f2c('0x7')],'accountcode':_0x305dff[_0x7f2c('0x9')],'exten':_0x305dff[_0x7f2c('0x16')],'context':_0x305dff[_0x7f2c('0x15')],'channel':_0x305dff[_0x7f2c('0x17')],'monitors':[]};}}catch(_0x136dc7){utils[_0x7f2c('0x18')](util[_0x7f2c('0x12')](_0x7f2c('0x19'),_0x305dff['uniqueid']),_0x136dc7);}};exports['newstate']=function(_0x2b505a){try{utils[_0x7f2c('0x1a')](util['format']('[%s][recordings][newstate]',_0x2b505a['uniqueid']),_0x2b505a);if(!_[_0x7f2c('0x1b')](recordings[_0x2b505a[_0x7f2c('0x7')]])&&_0x2b505a[_0x7f2c('0x1c')]==0x6){utils[_0x7f2c('0x4')](util[_0x7f2c('0x12')](_0x7f2c('0x1d'),_0x2b505a[_0x7f2c('0x7')],_0x2b505a[_0x7f2c('0x15')],_0x2b505a[_0x7f2c('0x17')]));}else if(!_[_0x7f2c('0x1b')](recordings[_0x2b505a[_0x7f2c('0x13')]])&&_0x2b505a[_0x7f2c('0x1c')]==0x6&&_0x2b505a['context']!=_0x7f2c('0x1e')){utils[_0x7f2c('0x4')](util['format'](_0x7f2c('0x1f'),_0x2b505a['uniqueid'],_0x2b505a['linkedid'],_0x2b505a[_0x7f2c('0x15')],_0x2b505a[_0x7f2c('0x17')]));recordings[_0x2b505a['linkedid']][_0x7f2c('0x9')]=_0x2b505a[_0x7f2c('0x9')];}}catch(_0x562776){utils[_0x7f2c('0x18')](util[_0x7f2c('0x12')](_0x7f2c('0x20'),_0x2b505a[_0x7f2c('0x7')]),_0x562776);}};exports[_0x7f2c('0x21')]=function(_0x2e7a45){try{if(!_[_0x7f2c('0x1b')](_0x2e7a45['variable'])&&!_[_0x7f2c('0x1b')](_0x2e7a45[_0x7f2c('0x22')]['mixmonitor_filename'])){utils[_0x7f2c('0x1a')](util['format'](_0x7f2c('0x23'),_0x2e7a45['uniqueid']),_0x2e7a45);utils[_0x7f2c('0x4')](util['format'](_0x7f2c('0x24'),_0x2e7a45[_0x7f2c('0x7')],_0x2e7a45[_0x7f2c('0x22')],_0x2e7a45[_0x7f2c('0x25')]));if(_['endsWith'](_0x2e7a45[_0x7f2c('0x25')],_0x7f2c('0x26'))){_0x2e7a45[_0x7f2c('0x25')]=_0x2e7a45['value'][_0x7f2c('0x27')](_0x7f2c('0x26'),_0x7f2c('0x28'));}if(recordings[_0x2e7a45[_0x7f2c('0x13')]]){var _0xeb2083=_[_0x7f2c('0x29')](recordings[_0x2e7a45[_0x7f2c('0x13')]][_0x7f2c('0x2a')],{'value':_0x2e7a45[_0x7f2c('0x25')]});if(_[_0x7f2c('0x1b')](_0xeb2083)){recordings[_0x2e7a45['linkedid']]['monitors'][_0x7f2c('0x2b')]({'value':_0x2e7a45[_0x7f2c('0x25')]});}}}}catch(_0x3ff858){utils[_0x7f2c('0x18')](util[_0x7f2c('0x12')]('[%s][recordings][varset]',_0x2e7a45[_0x7f2c('0x7')]),_0x3ff858);}};exports['hangup']=function(_0x4166b7){try{if(!_[_0x7f2c('0x1b')](recordings[_0x4166b7[_0x7f2c('0x7')]])){utils[_0x7f2c('0x1a')](util[_0x7f2c('0x12')](_0x7f2c('0x2c'),_0x4166b7[_0x7f2c('0x7')]),_0x4166b7);utils[_0x7f2c('0x4')](util['format']('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x4166b7['uniqueid'],_0x4166b7[_0x7f2c('0x2d')],_0x4166b7[_0x7f2c('0x2e')],_0x4166b7[_0x7f2c('0x2f')]));recordings[_0x4166b7[_0x7f2c('0x7')]][_0x7f2c('0x2d')]=_0x4166b7['calleridnum'];recordings[_0x4166b7['uniqueid']]['calleridname']=_0x4166b7['calleridname'];recordings[_0x4166b7[_0x7f2c('0x7')]]['connectedlinenum']=_0x4166b7[_0x7f2c('0x30')];recordings[_0x4166b7[_0x7f2c('0x7')]][_0x7f2c('0x31')]=_0x4166b7[_0x7f2c('0x31')];if(recordings[_0x4166b7[_0x7f2c('0x7')]][_0x7f2c('0x32')]==_0x7f2c('0x33')&&recordings[_0x4166b7[_0x7f2c('0x7')]]['accountcode']){recordings[_0x4166b7[_0x7f2c('0x7')]][_0x7f2c('0x30')]=recordings[_0x4166b7[_0x7f2c('0x7')]][_0x7f2c('0x9')];recordings[_0x4166b7[_0x7f2c('0x7')]]['connectedlinename']='';}recordings[_0x4166b7[_0x7f2c('0x7')]][_0x7f2c('0x2a')][_0x7f2c('0x34')](function(_0x2ee21f){var _0x2461e5=_['clone'](recordings[_0x4166b7[_0x7f2c('0x7')]]);_0x2461e5[_0x7f2c('0x25')]=_0x2ee21f[_0x7f2c('0x25')];writeDB(_0x2461e5);});delete recordings[_0x4166b7[_0x7f2c('0x7')]];}}catch(_0x55f960){utils[_0x7f2c('0x18')](util['format'](_0x7f2c('0x2c'),_0x4166b7[_0x7f2c('0x7')]),_0x55f960);}};exports[_0x7f2c('0x35')]=function(_0x45449d){try{if(!_[_0x7f2c('0x1b')](recordings[_0x45449d['uniqueid']])){utils[_0x7f2c('0x1a')](util[_0x7f2c('0x12')](_0x7f2c('0x36'),_0x45449d[_0x7f2c('0x7')]),_0x45449d);utils[_0x7f2c('0x4')](util[_0x7f2c('0x12')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x45449d[_0x7f2c('0x7')],_0x45449d['application'],_0x45449d['appdata']));if(_0x45449d[_0x7f2c('0x37')][_0x7f2c('0x38')]()=='set'&&_[_0x7f2c('0x39')](_0x45449d['appdata'][_0x7f2c('0x38')](),_0x7f2c('0x3a'))){var _0x16b5ba=_0x45449d['appdata']['split']('=');var _0x425be3=_0x16b5ba[0x0][_0x7f2c('0x3b')](_0x16b5ba[0x0]['lastIndexOf']('(')+0x1,_0x16b5ba[0x0][_0x7f2c('0x3c')](')'));var _0x367d9f=_0x16b5ba[0x1];recordings[_0x45449d['uniqueid']][_0x425be3]=_0x367d9f;}}}catch(_0x221e80){utils['error'](util[_0x7f2c('0x12')](_0x7f2c('0x36'),_0x45449d[_0x7f2c('0x7')]),_0x221e80);}};exports[_0x7f2c('0x3d')]=function(_0x38a6dd){try{if(!_['isNil'](recordings[_0x38a6dd[_0x7f2c('0x7')]])){utils[_0x7f2c('0x1a')](util[_0x7f2c('0x12')](_0x7f2c('0x3e'),_0x38a6dd['uniqueid']),_0x38a6dd);utils[_0x7f2c('0x4')](util[_0x7f2c('0x12')](_0x7f2c('0x3f'),_0x38a6dd['uniqueid'],_0x38a6dd[_0x7f2c('0x40')]));recordings[_0x38a6dd['uniqueid']][_0x7f2c('0x40')]=_0x38a6dd[_0x7f2c('0x40')];}}catch(_0x280f62){utils[_0x7f2c('0x18')](util[_0x7f2c('0x12')]('[%s][recordings][queuecallerjoin]',_0x38a6dd[_0x7f2c('0x7')]),_0x280f62);}};exports[_0x7f2c('0x41')]=function(_0x271b0e){try{utils[_0x7f2c('0x1a')](util[_0x7f2c('0x12')](_0x7f2c('0x42'),_0x271b0e['uniqueid']),_0x271b0e);utils[_0x7f2c('0x4')](util[_0x7f2c('0x12')](_0x7f2c('0x43'),_0x271b0e[_0x7f2c('0x7')],_0x271b0e[_0x7f2c('0x44')],_0x271b0e['transferercalleridname'],_0x271b0e[_0x7f2c('0x45')],_0x271b0e[_0x7f2c('0x46')]));if(recordings[_0x271b0e[_0x7f2c('0x47')]]&&transfers[_0x7f2c('0x6')][_0x271b0e['transfereruniqueid']]){transfers[_0x7f2c('0x6')][_0x271b0e['transfereruniqueid']][_0x7f2c('0x48')]=!![];}}catch(_0x2afb78){utils[_0x7f2c('0x18')](util[_0x7f2c('0x12')](_0x7f2c('0x42'),_0x271b0e['uniqueid']),_0x2afb78);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index c38d3f4..d81d877 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 _0xd57b=['transfereecalleridname','blind','transfereruniqueid','error','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','lodash','util','./utils','format','type','attended','origtransfereruniqueid','request','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]','uniqueid','info','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum'];(function(_0x509f32,_0x1ddd4f){var _0x48be5c=function(_0x249e1c){while(--_0x249e1c){_0x509f32['push'](_0x509f32['shift']());}};_0x48be5c(++_0x1ddd4f);}(_0xd57b,0x114));var _0xbd57=function(_0xbb14db,_0x3ee8c6){_0xbb14db=_0xbb14db-0x0;var _0x36bed7=_0xd57b[_0xbb14db];return _0x36bed7;};'use strict';var _=require(_0xbd57('0x0'));var util=require(_0xbd57('0x1'));var utils=require(_0xbd57('0x2'));function writeDB(_0x26ed67){utils['info'](util[_0xbd57('0x3')]('[%s][transfers][writeDB]\x20type:%s',_0x26ed67[_0xbd57('0x4')]===_0xbd57('0x5')?_0x26ed67[_0xbd57('0x6')]:_0x26ed67['uniqueid'],_0x26ed67[_0xbd57('0x4')]));utils[_0xbd57('0x7')]('CreateVoiceTransferReport',_0x26ed67);}exports[_0xbd57('0x8')]={};exports[_0xbd57('0x9')]=function(_0x23bd0c){try{utils[_0xbd57('0xa')](util[_0xbd57('0x3')](_0xbd57('0xb'),_0x23bd0c[_0xbd57('0xc')]),_0x23bd0c);utils[_0xbd57('0xd')](util['format'](_0xbd57('0xe'),_0x23bd0c['uniqueid'],_0x23bd0c[_0xbd57('0xf')],_0x23bd0c[_0xbd57('0x10')],_0x23bd0c[_0xbd57('0x11')],_0x23bd0c[_0xbd57('0x12')]));_0x23bd0c[_0xbd57('0x4')]=_0xbd57('0x13');exports[_0xbd57('0x8')][_0x23bd0c[_0xbd57('0x14')]]=_0x23bd0c;writeDB(_0x23bd0c);}catch(_0xdacb3c){utils[_0xbd57('0x15')](util[_0xbd57('0x3')](_0xbd57('0xb'),_0x23bd0c[_0xbd57('0xc')]),_0xdacb3c);}};exports['attendedtransfer']=function(_0x528e07){try{utils[_0xbd57('0xa')](util[_0xbd57('0x3')](_0xbd57('0x16'),_0x528e07[_0xbd57('0x6')]),_0x528e07);utils['info'](util[_0xbd57('0x3')](_0xbd57('0x17'),_0x528e07[_0xbd57('0x6')],_0x528e07['origtransferercalleridnum'],_0x528e07[_0xbd57('0x18')],_0x528e07[_0xbd57('0x19')],_0x528e07[_0xbd57('0x1a')]));_0x528e07=_[_0xbd57('0x1b')](_0x528e07,{'transfererchannel':_0x528e07['origtransfererchannel'],'transferercalleridnum':_0x528e07[_0xbd57('0x1c')],'transferercalleridname':_0x528e07[_0xbd57('0x18')],'transfererconnectedlinenum':_0x528e07[_0xbd57('0x1d')],'transfererconnectedlinename':_0x528e07[_0xbd57('0x1e')],'transfereraccountcode':_0x528e07[_0xbd57('0x1f')],'transferercontext':_0x528e07[_0xbd57('0x20')],'transfererexten':_0x528e07[_0xbd57('0x21')],'transfererlinkedid':_0x528e07[_0xbd57('0x22')],'context':_0x528e07['origtransferercontext'],'extension':_0x528e07[_0xbd57('0x23')],'type':_0xbd57('0x5')});if(_[_0xbd57('0x24')](_0x528e07[_0xbd57('0x25')])){_0x528e07=_['assign'](_0x528e07,{'transfereechannel':_0x528e07[_0xbd57('0x26')],'transfereecalleridnum':_0x528e07['transfertargetcalleridnum'],'transfereecalleridname':_0x528e07[_0xbd57('0x1a')],'transfereeconnectedlinenum':_0x528e07['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x528e07['transfertargetconnectedlinename'],'transfereeaccountcode':_0x528e07[_0xbd57('0x27')],'transfereecontext':_0x528e07['transfertargetcontext'],'transfereeexten':_0x528e07[_0xbd57('0x28')],'transfereelinkedid':_0x528e07[_0xbd57('0x29')]});}writeDB(_0x528e07);}catch(_0x3e79b0){utils[_0xbd57('0x15')](util[_0xbd57('0x3')](_0xbd57('0x16'),_0x528e07[_0xbd57('0x6')]),_0x3e79b0);}}; \ No newline at end of file +var _0xf1d9=['origtransfereruniqueid','uniqueid','request','blindtransfer','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','blinds','transfereruniqueid','[%s][transfers][attendedtransfer]','origtransferercalleridname','transfertargetcalleridname','assign','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','isNil','transfereechannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','error','lodash','./utils','info','format','type','attended'];(function(_0x166e10,_0x5467bc){var _0x91ebcb=function(_0x5661eb){while(--_0x5661eb){_0x166e10['push'](_0x166e10['shift']());}};_0x91ebcb(++_0x5467bc);}(_0xf1d9,0x142));var _0x9f1d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf1d9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9f1d('0x0'));var util=require('util');var utils=require(_0x9f1d('0x1'));function writeDB(_0x1305a0){utils[_0x9f1d('0x2')](util[_0x9f1d('0x3')]('[%s][transfers][writeDB]\x20type:%s',_0x1305a0[_0x9f1d('0x4')]===_0x9f1d('0x5')?_0x1305a0[_0x9f1d('0x6')]:_0x1305a0[_0x9f1d('0x7')],_0x1305a0[_0x9f1d('0x4')]));utils[_0x9f1d('0x8')]('CreateVoiceTransferReport',_0x1305a0);}exports['blinds']={};exports[_0x9f1d('0x9')]=function(_0x33c123){try{utils[_0x9f1d('0xa')](util[_0x9f1d('0x3')](_0x9f1d('0xb'),_0x33c123['uniqueid']),_0x33c123);utils[_0x9f1d('0x2')](util[_0x9f1d('0x3')](_0x9f1d('0xc'),_0x33c123[_0x9f1d('0x7')],_0x33c123[_0x9f1d('0xd')],_0x33c123[_0x9f1d('0xe')],_0x33c123[_0x9f1d('0xf')],_0x33c123[_0x9f1d('0x10')]));_0x33c123[_0x9f1d('0x4')]=_0x9f1d('0x11');exports[_0x9f1d('0x12')][_0x33c123[_0x9f1d('0x13')]]=_0x33c123;writeDB(_0x33c123);}catch(_0x27e359){utils['error'](util[_0x9f1d('0x3')](_0x9f1d('0xb'),_0x33c123[_0x9f1d('0x7')]),_0x27e359);}};exports['attendedtransfer']=function(_0xc865f){try{utils[_0x9f1d('0xa')](util[_0x9f1d('0x3')](_0x9f1d('0x14'),_0xc865f[_0x9f1d('0x6')]),_0xc865f);utils[_0x9f1d('0x2')](util['format']('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0xc865f[_0x9f1d('0x6')],_0xc865f['origtransferercalleridnum'],_0xc865f[_0x9f1d('0x15')],_0xc865f['transfertargetcalleridnum'],_0xc865f[_0x9f1d('0x16')]));_0xc865f=_[_0x9f1d('0x17')](_0xc865f,{'transfererchannel':_0xc865f['origtransfererchannel'],'transferercalleridnum':_0xc865f[_0x9f1d('0x18')],'transferercalleridname':_0xc865f['origtransferercalleridname'],'transfererconnectedlinenum':_0xc865f[_0x9f1d('0x19')],'transfererconnectedlinename':_0xc865f[_0x9f1d('0x1a')],'transfereraccountcode':_0xc865f[_0x9f1d('0x1b')],'transferercontext':_0xc865f[_0x9f1d('0x1c')],'transfererexten':_0xc865f[_0x9f1d('0x1d')],'transfererlinkedid':_0xc865f[_0x9f1d('0x1e')],'context':_0xc865f[_0x9f1d('0x1f')],'extension':_0xc865f['origtransfererexten'],'type':_0x9f1d('0x5')});if(_[_0x9f1d('0x20')](_0xc865f[_0x9f1d('0x21')])){_0xc865f=_[_0x9f1d('0x17')](_0xc865f,{'transfereechannel':_0xc865f['transfertargetchannel'],'transfereecalleridnum':_0xc865f[_0x9f1d('0x22')],'transfereecalleridname':_0xc865f[_0x9f1d('0x16')],'transfereeconnectedlinenum':_0xc865f[_0x9f1d('0x23')],'transfereeconnectedlinename':_0xc865f[_0x9f1d('0x24')],'transfereeaccountcode':_0xc865f[_0x9f1d('0x25')],'transfereecontext':_0xc865f['transfertargetcontext'],'transfereeexten':_0xc865f[_0x9f1d('0x26')],'transfereelinkedid':_0xc865f[_0x9f1d('0x27')]});}writeDB(_0xc865f);}catch(_0x46ee47){utils[_0x9f1d('0x28')](util[_0x9f1d('0x3')](_0x9f1d('0x14'),_0xc865f['origtransfereruniqueid']),_0x46ee47);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 7a85a42..2828e96 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 _0xc165=['catch','internal','name','interface','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]','GetVoiceQueue','type','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','now','isAfter','isBefore','bluebird','jayson/promise','moment','util','client','http','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s'];(function(_0xa06077,_0x153ab4){var _0x372015=function(_0x496ef1){while(--_0x496ef1){_0xa06077['push'](_0xa06077['shift']());}};_0x372015(++_0x153ab4);}(_0xc165,0x199));var _0x5c16=function(_0x3f9024,_0x48d0e5){_0x3f9024=_0x3f9024-0x0;var _0x3c931c=_0xc165[_0x3f9024];return _0x3c931c;};'use strict';var BPromise=require(_0x5c16('0x0'));var jayson=require(_0x5c16('0x1'));var moment=require(_0x5c16('0x2'));var util=require(_0x5c16('0x3'));var client=jayson[_0x5c16('0x4')][_0x5c16('0x5')]({'port':0x2329});var logger=require('../../config/logger')(_0x5c16('0x6'));exports[_0x5c16('0x7')]=function(_0x549c80,_0x5db36f){logger[_0x5c16('0x7')](_0x549c80,_0x5db36f?util[_0x5c16('0x8')](_0x5db36f,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0x27ba5b,_0x31702d){logger[_0x5c16('0x9')](_0x27ba5b,_0x31702d?util[_0x5c16('0x8')](_0x31702d,{'showHidden':![],'depth':null}):'');};exports[_0x5c16('0xa')]=function(_0x5351a4,_0x30eaa2){logger[_0x5c16('0xa')](_0x5351a4,_0x30eaa2?util[_0x5c16('0x8')](_0x30eaa2,{'showHidden':![],'depth':null}):'');};exports[_0x5c16('0xb')]=function(_0x342dac,_0x500576){return client[_0x5c16('0xb')](_0x342dac,{'body':_0x500576})[_0x5c16('0xc')](function(_0x4ff4f6){logger[_0x5c16('0x9')](_0x5c16('0xd'),_0x342dac,_0x4ff4f6?util['inspect'](_0x4ff4f6,{'showHidden':![],'depth':null}):'');})[_0x5c16('0xe')](function(_0x115b6a){logger['error'](_0x5c16('0xd'),_0x342dac,_0x115b6a?util[_0x5c16('0x8')](_0x115b6a,{'showHidden':![],'depth':null}):'');});};function getUser(_0xedc838){return client[_0x5c16('0xb')]('GetUser',{'options':{'raw':!![],'attributes':['id',_0x5c16('0xf'),_0x5c16('0x10'),_0x5c16('0x11')],'where':_0xedc838,'limit':0x1}})[_0x5c16('0xc')](function(_0x5e4512){logger[_0x5c16('0x9')](_0x5c16('0x12'),JSON[_0x5c16('0x13')](_0xedc838),_0x5e4512?util[_0x5c16('0x8')](_0x5e4512,{'showHidden':![],'depth':null}):'');return _0x5e4512[_0x5c16('0x14')][_0x5c16('0x15')]?_0x5e4512[_0x5c16('0x14')][0x0]:null;});}exports[_0x5c16('0x16')]=function(_0x523146){return new BPromise(function(_0x3d54b0,_0x328288){if(_0x523146){return getUser({'internal':_0x523146})[_0x5c16('0xc')](function(_0x438e6c){logger['info'](_0x5c16('0x17'),_0x523146,_0x438e6c?_0x5c16('0x18'):_0x5c16('0x19'));return _0x3d54b0(_0x438e6c);})[_0x5c16('0xe')](function(_0x33b68a){logger['error'](_0x5c16('0x1a'),_0x33b68a?util[_0x5c16('0x8')](_0x33b68a,{'showHidden':![],'depth':null}):'');return _0x3d54b0(null);});}return _0x3d54b0(null);});};exports[_0x5c16('0x1b')]=function(_0x1fb45a){return new BPromise(function(_0x4dca0c,_0x5b3929){if(_0x1fb45a){return getUser({'interface':_0x1fb45a})[_0x5c16('0xc')](function(_0x163441){logger[_0x5c16('0x7')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x1fb45a,_0x163441?_0x5c16('0x18'):'notfound');return _0x4dca0c(_0x163441);})[_0x5c16('0xe')](function(_0x3df05b){logger[_0x5c16('0xa')](_0x5c16('0x1c'),_0x3df05b?util[_0x5c16('0x8')](_0x3df05b,{'showHidden':![],'depth':null}):'');return _0x4dca0c(null);});}return _0x4dca0c(null);});};exports[_0x5c16('0x1d')]=function(_0x12cfc4){return new BPromise(function(_0x1b1520,_0x8a9247){if(_0x12cfc4){return getUser({'name':_0x12cfc4})[_0x5c16('0xc')](function(_0x2a1393){logger[_0x5c16('0x7')]('[utils][getUserByName]\x20name:%s\x20%s',_0x12cfc4,_0x2a1393?'found':_0x5c16('0x19'));return _0x1b1520(_0x2a1393);})[_0x5c16('0xe')](function(_0x4d04b6){logger['error'](_0x5c16('0x1e'),_0x4d04b6?util[_0x5c16('0x8')](_0x4d04b6,{'showHidden':![],'depth':null}):'');return _0x1b1520(null);});}return _0x1b1520(null);});};exports['getVoiceQueueByName']=function(_0x444757){return new BPromise(function(_0x5f1079,_0x39e21b){if(_0x444757){return client[_0x5c16('0xb')](_0x5c16('0x1f'),{'options':{'raw':!![],'attributes':['id',_0x5c16('0x10'),_0x5c16('0x20'),'acw','acwTimeout'],'where':{'name':_0x444757},'limit':0x1}})[_0x5c16('0xc')](function(_0x535fd1){logger[_0x5c16('0x9')](_0x5c16('0x21'),_0x444757,_0x535fd1?util[_0x5c16('0x8')](_0x535fd1,{'showHidden':![],'depth':null}):'');logger[_0x5c16('0x7')](_0x5c16('0x22'),_0x444757,_0x535fd1?'found':'notfound');return _0x5f1079(_0x535fd1[_0x5c16('0x14')][_0x5c16('0x15')]?_0x535fd1['result'][0x0]:null);})[_0x5c16('0xe')](function(_0x458d69){logger[_0x5c16('0xa')](_0x5c16('0x23'),_0x458d69?util[_0x5c16('0x8')](_0x458d69,{'showHidden':![],'depth':null}):'');return _0x5f1079(null);});}return _0x5f1079(null);});};exports[_0x5c16('0x24')]=function(_0x2d1b6a,_0x3c53eb){return moment(_0x2d1b6a)[_0x5c16('0x25')](_0x3c53eb,_0x5c16('0x26'))[_0x5c16('0x27')](_0x5c16('0x28'));};exports[_0x5c16('0x29')]=function(_0x4040f8,_0x3f8253){return moment(_0x4040f8)[_0x5c16('0x2a')](_0x3f8253,_0x5c16('0x26'))[_0x5c16('0x27')](_0x5c16('0x28'));};exports[_0x5c16('0x2b')]=function(_0x5782c4,_0x5206c4){return moment(_0x5782c4)['diff'](moment(_0x5206c4),_0x5c16('0x26'));};exports['sumTime']=function(_0x19f7b4,_0x49960c){return parseInt(_0x19f7b4,0xa)+parseInt(_0x49960c,0xa);};exports[_0x5c16('0x2c')]=function(){return moment()[_0x5c16('0x27')](_0x5c16('0x28'));};exports[_0x5c16('0x2d')]=function(_0x5ae7a2,_0x339f2a){if(_0x339f2a){return moment(_0x5ae7a2)[_0x5c16('0x2d')](_0x339f2a);}return!![];};exports[_0x5c16('0x2e')]=function(_0x418f1f,_0x2ce4c4){if(_0x2ce4c4){return moment(_0x418f1f)[_0x5c16('0x2e')](_0x2ce4c4);}else if(_0x418f1f){return!![];}return![];}; \ No newline at end of file +var _0xa42e=['[utils][getUserByInterface]','getUserByName','[utils][getUserByName]','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','notfound','result','[utils][getVoiceQueueByName]','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','diffTime','diff','sumTime','isAfter','isBefore','bluebird','jayson/promise','moment','util','client','http','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','catch','GetUser','internal','name','[utils][getUser]\x20where:%s','stringify','[utils][getUserByInternal]\x20internal:%s\x20%s','[utils][getUserByInterface]\x20interface:%s\x20%s','found'];(function(_0x2d5304,_0x19ab82){var _0x42e39a=function(_0x5dd9de){while(--_0x5dd9de){_0x2d5304['push'](_0x2d5304['shift']());}};_0x42e39a(++_0x19ab82);}(_0xa42e,0xec));var _0xea42=function(_0x3e1ea5,_0x6a2af0){_0x3e1ea5=_0x3e1ea5-0x0;var _0x299f7a=_0xa42e[_0x3e1ea5];return _0x299f7a;};'use strict';var BPromise=require(_0xea42('0x0'));var jayson=require(_0xea42('0x1'));var moment=require(_0xea42('0x2'));var util=require(_0xea42('0x3'));var client=jayson[_0xea42('0x4')][_0xea42('0x5')]({'port':0x2329});var logger=require('../../config/logger')('xdr');exports['info']=function(_0x139389,_0x31a5cc){logger[_0xea42('0x6')](_0x139389,_0x31a5cc?util[_0xea42('0x7')](_0x31a5cc,{'showHidden':![],'depth':null}):'');};exports[_0xea42('0x8')]=function(_0x4f6063,_0x39a02a){logger[_0xea42('0x8')](_0x4f6063,_0x39a02a?util[_0xea42('0x7')](_0x39a02a,{'showHidden':![],'depth':null}):'');};exports[_0xea42('0x9')]=function(_0xf09a70,_0xfe1d53){logger[_0xea42('0x9')](_0xf09a70,_0xfe1d53?util[_0xea42('0x7')](_0xfe1d53,{'showHidden':![],'depth':null}):'');};exports[_0xea42('0xa')]=function(_0x3139c5,_0x2d46cf){return client[_0xea42('0xa')](_0x3139c5,{'body':_0x2d46cf})[_0xea42('0xb')](function(_0x2a5a60){logger['debug'](_0xea42('0xc'),_0x3139c5,_0x2a5a60?util[_0xea42('0x7')](_0x2a5a60,{'showHidden':![],'depth':null}):'');})[_0xea42('0xd')](function(_0x56a42f){logger['error']('[utils][request]\x20name:%s',_0x3139c5,_0x56a42f?util[_0xea42('0x7')](_0x56a42f,{'showHidden':![],'depth':null}):'');});};function getUser(_0x316c87){return client[_0xea42('0xa')](_0xea42('0xe'),{'options':{'raw':!![],'attributes':['id',_0xea42('0xf'),_0xea42('0x10'),'interface'],'where':_0x316c87,'limit':0x1}})[_0xea42('0xb')](function(_0x3ebb02){logger[_0xea42('0x8')](_0xea42('0x11'),JSON[_0xea42('0x12')](_0x316c87),_0x3ebb02?util[_0xea42('0x7')](_0x3ebb02,{'showHidden':![],'depth':null}):'');return _0x3ebb02['result']['length']?_0x3ebb02['result'][0x0]:null;});}exports['getUserByInternal']=function(_0x17da56){return new BPromise(function(_0x217a56,_0xcd77af){if(_0x17da56){return getUser({'internal':_0x17da56})[_0xea42('0xb')](function(_0x147632){logger[_0xea42('0x6')](_0xea42('0x13'),_0x17da56,_0x147632?'found':'notfound');return _0x217a56(_0x147632);})['catch'](function(_0x2c112e){logger[_0xea42('0x9')]('[utils][getUserByInternal]',_0x2c112e?util[_0xea42('0x7')](_0x2c112e,{'showHidden':![],'depth':null}):'');return _0x217a56(null);});}return _0x217a56(null);});};exports['getUserByInterface']=function(_0x577adc){return new BPromise(function(_0x10dd12,_0xa94fe6){if(_0x577adc){return getUser({'interface':_0x577adc})[_0xea42('0xb')](function(_0x2b9242){logger['info'](_0xea42('0x14'),_0x577adc,_0x2b9242?_0xea42('0x15'):'notfound');return _0x10dd12(_0x2b9242);})[_0xea42('0xd')](function(_0x27bcb9){logger[_0xea42('0x9')](_0xea42('0x16'),_0x27bcb9?util[_0xea42('0x7')](_0x27bcb9,{'showHidden':![],'depth':null}):'');return _0x10dd12(null);});}return _0x10dd12(null);});};exports[_0xea42('0x17')]=function(_0x4c50b5){return new BPromise(function(_0x5c92cf,_0x54eb1a){if(_0x4c50b5){return getUser({'name':_0x4c50b5})[_0xea42('0xb')](function(_0x479f5d){logger[_0xea42('0x6')]('[utils][getUserByName]\x20name:%s\x20%s',_0x4c50b5,_0x479f5d?_0xea42('0x15'):'notfound');return _0x5c92cf(_0x479f5d);})[_0xea42('0xd')](function(_0xc5276d){logger[_0xea42('0x9')](_0xea42('0x18'),_0xc5276d?util[_0xea42('0x7')](_0xc5276d,{'showHidden':![],'depth':null}):'');return _0x5c92cf(null);});}return _0x5c92cf(null);});};exports['getVoiceQueueByName']=function(_0x1b719b){return new BPromise(function(_0x48e9ea,_0x4e59ba){if(_0x1b719b){return client[_0xea42('0xa')]('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id',_0xea42('0x10'),_0xea42('0x19'),_0xea42('0x1a'),_0xea42('0x1b')],'where':{'name':_0x1b719b},'limit':0x1}})[_0xea42('0xb')](function(_0x26545c){logger[_0xea42('0x8')](_0xea42('0x1c'),_0x1b719b,_0x26545c?util[_0xea42('0x7')](_0x26545c,{'showHidden':![],'depth':null}):'');logger[_0xea42('0x6')](_0xea42('0x1d'),_0x1b719b,_0x26545c?_0xea42('0x15'):_0xea42('0x1e'));return _0x48e9ea(_0x26545c[_0xea42('0x1f')]['length']?_0x26545c[_0xea42('0x1f')][0x0]:null);})[_0xea42('0xd')](function(_0x1dda69){logger[_0xea42('0x9')](_0xea42('0x20'),_0x1dda69?util[_0xea42('0x7')](_0x1dda69,{'showHidden':![],'depth':null}):'');return _0x48e9ea(null);});}return _0x48e9ea(null);});};exports['addTime']=function(_0x556198,_0x5d3f37){return moment(_0x556198)[_0xea42('0x21')](_0x5d3f37,_0xea42('0x22'))[_0xea42('0x23')](_0xea42('0x24'));};exports[_0xea42('0x25')]=function(_0x56ca38,_0x36a771){return moment(_0x56ca38)['subtract'](_0x36a771,'seconds')[_0xea42('0x23')](_0xea42('0x24'));};exports[_0xea42('0x26')]=function(_0x238fc8,_0x1e2e6c){return moment(_0x238fc8)[_0xea42('0x27')](moment(_0x1e2e6c),'seconds');};exports[_0xea42('0x28')]=function(_0x1f4d02,_0x3bd30d){return parseInt(_0x1f4d02,0xa)+parseInt(_0x3bd30d,0xa);};exports['now']=function(){return moment()[_0xea42('0x23')](_0xea42('0x24'));};exports[_0xea42('0x29')]=function(_0x4bc983,_0x375951){if(_0x375951){return moment(_0x4bc983)[_0xea42('0x29')](_0x375951);}return!![];};exports[_0xea42('0x2a')]=function(_0x430057,_0x3f8fa5){if(_0x3f8fa5){return moment(_0x430057)[_0xea42('0x2a')](_0x3f8fa5);}else if(_0x430057){return!![];}return![];}; \ No newline at end of file diff --git a/server/utils/client-side-logger.js b/server/utils/client-side-logger.js index 8bd2c8f..cdac0b3 100644 --- a/server/utils/client-side-logger.js +++ b/server/utils/client-side-logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x41c9=['./safe-template','safeTemplate','./mask-sensitive-data','maskSensitiveData','join','log','client','role','name','ensureDir','then','catch','user','no-user','data','timestamp','error','api','set','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','\x20body=%s','format','method','headers','x-forwarded-for','connection','url','statusCode','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','body','device','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','remoteAddress','other','agent_id','agent_name','test','setupLoggers','fs-extra','lodash','path','util','./loggers'];(function(_0x5a5092,_0x87124d){var _0xe1ec05=function(_0x2e91f8){while(--_0x2e91f8){_0x5a5092['push'](_0x5a5092['shift']());}};_0xe1ec05(++_0x87124d);}(_0x41c9,0xb3));var _0x941c=function(_0x108e48,_0x2626e6){_0x108e48=_0x108e48-0x0;var _0x25e6bb=_0x41c9[_0x108e48];return _0x25e6bb;};var fs=require(_0x941c('0x0'));var _=require(_0x941c('0x1'));var ewinston=require('express-winston');var path=require(_0x941c('0x2'));var util=require(_0x941c('0x3'));var fileLogger=require(_0x941c('0x4'))['fileLogger'];var safeTemplate=require(_0x941c('0x5'))[_0x941c('0x6')];var maskSensitiveData=require(_0x941c('0x7'))[_0x941c('0x8')];function ClientSideLogger(){function _0x3749af(_0x2b1d73){var _0x2cfd16=path[_0x941c('0x9')]('/var',_0x941c('0xa'),'xcally');var _0xbfefd2=path['join'](_0x941c('0xb'),_0x2b1d73[_0x941c('0xc')]+'-'+_0x2b1d73[_0x941c('0xd')]);return fs[_0x941c('0xe')](path[_0x941c('0x9')](_0x2cfd16,_0xbfefd2))[_0x941c('0xf')](function(){var _0x2af9ff=fileLogger(_0x941c('0xb'),path[_0x941c('0x9')](_0x2cfd16,_0xbfefd2));return _0x2af9ff;})[_0x941c('0x10')](function(_0x3dec85){throw _0x3dec85;});}this[_0x941c('0xa')]=function(_0x7253cd,_0x37c5fc,_0x3b7d27,_0x45bb1d){return _0x3749af(_0x7253cd[_0x941c('0x11')])[_0x941c('0xf')](function(_0x504520){var _0xfb9d05=_0x504520[_0x37c5fc];return _0xfb9d05;})[_0x941c('0xf')](function(_0x518421){var _0x327413=_0x7253cd['user']?_0x7253cd[_0x941c('0x11')]['id']:_0x941c('0x12');var _0x214559=_0x45bb1d[_0x941c('0x13')];var _0x5d2c5c=_0x45bb1d[_0x941c('0x14')];var _0x2d269a=new Date(Number(_0x5d2c5c));return _0x518421(_0x327413,_0x2d269a,_0x3b7d27,_0x214559);})[_0x941c('0x10')](function(_0x36b705){fileLogger(_0x941c('0xb'))[_0x941c('0x15')](_0x36b705);});};}function setupLoggers(_0x4517d0){return new Promise(function(_0x6dd487){var _0x2d7dfe=new ClientSideLogger();var _0xf2a079=fileLogger(_0x941c('0x16'));var _0x1d4b86=fileLogger('auth');_0x4517d0[_0x941c('0x17')]('client-side-logger',_0x2d7dfe);_0x4517d0[_0x941c('0x18')](ewinston[_0x941c('0x19')]({'winstonInstance':_0xf2a079,'meta':![],'statusLevels':!![],'msg':function(_0x378766,_0x1e91ef){var _0x180f86=_0x941c('0x1a');if(!_[_0x941c('0x1b')](_0x378766['body'])){_0x180f86+=_0x941c('0x1c');var _0x251018=_0x378766['body'];maskSensitiveData(_0x251018);}return safeTemplate(util[_0x941c('0x1d')](_0x180f86,_0x378766[_0x941c('0x1e')],_0x378766[_0x941c('0x1f')][_0x941c('0x20')]?_0x378766[_0x941c('0x1f')][_0x941c('0x20')]:_0x378766[_0x941c('0x21')]['remoteAddress']||_0x378766['ip'],_0x378766[_0x941c('0x22')],_0x1e91ef[_0x941c('0x23')],_0x1e91ef['responseTime'],_0x378766[_0x941c('0x11')]?_0x378766[_0x941c('0x11')]['id']:null,_0x378766['user']?_0x378766[_0x941c('0x11')][_0x941c('0xd')]:null,_0x378766[_0x941c('0x11')]?_0x378766[_0x941c('0x11')][_0x941c('0xc')]:null,_0x251018?util['inspect'](_0x251018,![],null):''));}}));_0x4517d0['use'](ewinston['logger']({'winstonInstance':_0x1d4b86,'meta':![],'statusLevels':!![],'msg':function(_0x889819,_0x561f5a){var _0x59e2ec=_0x941c('0x24');if(_0x889819['body']&&_0x889819[_0x941c('0x25')][_0x941c('0x26')]&&_0x889819[_0x941c('0x25')]['agent_id']){_0x59e2ec=_0x941c('0x27');}return util[_0x941c('0x1d')](_0x59e2ec,_0x889819[_0x941c('0x1e')],_0x889819[_0x941c('0x1f')][_0x941c('0x20')]?_0x889819[_0x941c('0x1f')][_0x941c('0x20')]:_0x889819[_0x941c('0x21')][_0x941c('0x28')]||_0x889819['ip'],_0x889819['url'],_0x561f5a[_0x941c('0x23')],_0x561f5a['responseTime'],_0x889819[_0x941c('0x11')]?_0x889819[_0x941c('0x11')]['id']:null,_0x889819[_0x941c('0x11')]?_0x889819[_0x941c('0x11')][_0x941c('0xd')]:null,_0x889819[_0x941c('0x11')]?_0x889819[_0x941c('0x11')][_0x941c('0xc')]:null,_0x889819[_0x941c('0x25')]&&_0x889819[_0x941c('0x25')]['device']?_0x889819[_0x941c('0x25')][_0x941c('0x26')]:_0x941c('0x29'),_0x889819[_0x941c('0x25')]&&_0x889819[_0x941c('0x25')][_0x941c('0x2a')]?_0x889819['body'][_0x941c('0x2a')]:'',_0x889819[_0x941c('0x25')]&&_0x889819['body']['agent_name']?_0x889819['body'][_0x941c('0x2b')]:'');},'ignoreRoute':function(_0x1579cc){var _0x135a1d=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x135a1d[_0x941c('0x2c')](_0x1579cc['url']);}}));return _0x6dd487();});}exports[_0x941c('0x2d')]=setupLoggers; \ No newline at end of file +var _0xb9f6=['./loggers','./safe-template','safeTemplate','./mask-sensitive-data','maskSensitiveData','join','/var','log','xcally','client','role','name','ensureDir','catch','user','then','no-user','timestamp','api','auth','set','client-side-logger','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','\x20body=%s','body','format','headers','connection','remoteAddress','url','statusCode','responseTime','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','x-forwarded-for','other','agent_name','test','setupLoggers','fs-extra','lodash','express-winston','path'];(function(_0x2d4421,_0x15a84f){var _0x2d3b01=function(_0xb9e94c){while(--_0xb9e94c){_0x2d4421['push'](_0x2d4421['shift']());}};_0x2d3b01(++_0x15a84f);}(_0xb9f6,0xc0));var _0x6b9f=function(_0x674c70,_0x2df442){_0x674c70=_0x674c70-0x0;var _0x5a104c=_0xb9f6[_0x674c70];return _0x5a104c;};var fs=require(_0x6b9f('0x0'));var _=require(_0x6b9f('0x1'));var ewinston=require(_0x6b9f('0x2'));var path=require(_0x6b9f('0x3'));var util=require('util');var fileLogger=require(_0x6b9f('0x4'))['fileLogger'];var safeTemplate=require(_0x6b9f('0x5'))[_0x6b9f('0x6')];var maskSensitiveData=require(_0x6b9f('0x7'))[_0x6b9f('0x8')];function ClientSideLogger(){function _0x24c4ba(_0x3839c6){var _0x38ee25=path[_0x6b9f('0x9')](_0x6b9f('0xa'),_0x6b9f('0xb'),_0x6b9f('0xc'));var _0x218623=path[_0x6b9f('0x9')](_0x6b9f('0xd'),_0x3839c6[_0x6b9f('0xe')]+'-'+_0x3839c6[_0x6b9f('0xf')]);return fs[_0x6b9f('0x10')](path[_0x6b9f('0x9')](_0x38ee25,_0x218623))['then'](function(){var _0x461917=fileLogger('client',path[_0x6b9f('0x9')](_0x38ee25,_0x218623));return _0x461917;})[_0x6b9f('0x11')](function(_0x35ce59){throw _0x35ce59;});}this[_0x6b9f('0xb')]=function(_0x6c7823,_0x19e562,_0x31a7bc,_0x5702e6){return _0x24c4ba(_0x6c7823[_0x6b9f('0x12')])[_0x6b9f('0x13')](function(_0x45b6ec){var _0x5d351e=_0x45b6ec[_0x19e562];return _0x5d351e;})[_0x6b9f('0x13')](function(_0x1c2df9){var _0x53a8ac=_0x6c7823[_0x6b9f('0x12')]?_0x6c7823[_0x6b9f('0x12')]['id']:_0x6b9f('0x14');var _0x1caa5a=_0x5702e6['data'];var _0x20a7b9=_0x5702e6[_0x6b9f('0x15')];var _0xbd0369=new Date(Number(_0x20a7b9));return _0x1c2df9(_0x53a8ac,_0xbd0369,_0x31a7bc,_0x1caa5a);})[_0x6b9f('0x11')](function(_0x199299){fileLogger('client')['error'](_0x199299);});};}function setupLoggers(_0x1f5a8b){return new Promise(function(_0x520b6c){var _0x558984=new ClientSideLogger();var _0x10678d=fileLogger(_0x6b9f('0x16'));var _0x44326a=fileLogger(_0x6b9f('0x17'));_0x1f5a8b[_0x6b9f('0x18')](_0x6b9f('0x19'),_0x558984);_0x1f5a8b[_0x6b9f('0x1a')](ewinston[_0x6b9f('0x1b')]({'winstonInstance':_0x10678d,'meta':![],'statusLevels':!![],'msg':function(_0x39f51f,_0x3c0a4c){var _0x1a2503=_0x6b9f('0x1c');if(!_[_0x6b9f('0x1d')](_0x39f51f['body'])){_0x1a2503+=_0x6b9f('0x1e');var _0x510be3=_0x39f51f[_0x6b9f('0x1f')];maskSensitiveData(_0x510be3);}return safeTemplate(util[_0x6b9f('0x20')](_0x1a2503,_0x39f51f['method'],_0x39f51f['headers']['x-forwarded-for']?_0x39f51f[_0x6b9f('0x21')]['x-forwarded-for']:_0x39f51f[_0x6b9f('0x22')][_0x6b9f('0x23')]||_0x39f51f['ip'],_0x39f51f[_0x6b9f('0x24')],_0x3c0a4c[_0x6b9f('0x25')],_0x3c0a4c[_0x6b9f('0x26')],_0x39f51f[_0x6b9f('0x12')]?_0x39f51f[_0x6b9f('0x12')]['id']:null,_0x39f51f['user']?_0x39f51f[_0x6b9f('0x12')][_0x6b9f('0xf')]:null,_0x39f51f[_0x6b9f('0x12')]?_0x39f51f['user'][_0x6b9f('0xe')]:null,_0x510be3?util[_0x6b9f('0x27')](_0x510be3,![],null):''));}}));_0x1f5a8b[_0x6b9f('0x1a')](ewinston[_0x6b9f('0x1b')]({'winstonInstance':_0x44326a,'meta':![],'statusLevels':!![],'msg':function(_0x3a253d,_0x4ddfec){var _0x446be5=_0x6b9f('0x28');if(_0x3a253d[_0x6b9f('0x1f')]&&_0x3a253d['body'][_0x6b9f('0x29')]&&_0x3a253d[_0x6b9f('0x1f')][_0x6b9f('0x2a')]){_0x446be5=_0x6b9f('0x2b');}return util[_0x6b9f('0x20')](_0x446be5,_0x3a253d['method'],_0x3a253d[_0x6b9f('0x21')][_0x6b9f('0x2c')]?_0x3a253d['headers'][_0x6b9f('0x2c')]:_0x3a253d[_0x6b9f('0x22')][_0x6b9f('0x23')]||_0x3a253d['ip'],_0x3a253d[_0x6b9f('0x24')],_0x4ddfec[_0x6b9f('0x25')],_0x4ddfec[_0x6b9f('0x26')],_0x3a253d[_0x6b9f('0x12')]?_0x3a253d[_0x6b9f('0x12')]['id']:null,_0x3a253d['user']?_0x3a253d[_0x6b9f('0x12')]['name']:null,_0x3a253d[_0x6b9f('0x12')]?_0x3a253d[_0x6b9f('0x12')][_0x6b9f('0xe')]:null,_0x3a253d['body']&&_0x3a253d['body'][_0x6b9f('0x29')]?_0x3a253d[_0x6b9f('0x1f')][_0x6b9f('0x29')]:_0x6b9f('0x2d'),_0x3a253d[_0x6b9f('0x1f')]&&_0x3a253d['body'][_0x6b9f('0x2a')]?_0x3a253d[_0x6b9f('0x1f')]['agent_id']:'',_0x3a253d['body']&&_0x3a253d[_0x6b9f('0x1f')][_0x6b9f('0x2e')]?_0x3a253d[_0x6b9f('0x1f')][_0x6b9f('0x2e')]:'');},'ignoreRoute':function(_0x415b9e){var _0x4677ec=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x4677ec[_0x6b9f('0x2f')](_0x415b9e[_0x6b9f('0x24')]);}}));return _0x520b6c();});}exports[_0x6b9f('0x30')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index afec6f5..22c1792 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8530=['[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','toUpperCase','Logger','transports','Console','File','%s-%s','error','consoleLogger','fileLogger','path','util','moment','../config/environment','debugLevel','toLowerCase','info','redBG\x20white','bold\x20yellow','bold\x20white','bold\x20green','gray','bold\x20blue','bold\x20cyan','addColors','/var/log/xcally','join','format','message','replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','meta','keys','length','stringify'];(function(_0xd37208,_0x1d0391){var _0x5d70e0=function(_0x2b5755){while(--_0x2b5755){_0xd37208['push'](_0xd37208['shift']());}};_0x5d70e0(++_0x1d0391);}(_0x8530,0x11b));var _0x0853=function(_0x4ca423,_0x2ee54f){_0x4ca423=_0x4ca423-0x0;var _0x1db20e=_0x8530[_0x4ca423];return _0x1db20e;};'use strict';var path=require(_0x0853('0x0'));var util=require(_0x0853('0x1'));var moment=require(_0x0853('0x2'));var winston=require('winston');var config=require(_0x0853('0x3'));var debugLevel=config[_0x0853('0x4')]?config[_0x0853('0x4')][_0x0853('0x5')]():_0x0853('0x6');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0x0853('0x7'),'error':'red','warn':_0x0853('0x8'),'info':'white','print':_0x0853('0x9'),'success':_0x0853('0xa'),'http':_0x0853('0xb'),'verbose':'bold\x20magenta','debug':_0x0853('0xc'),'silly':_0x0853('0xd')};winston[_0x0853('0xe')](XC_LOG_COLORS);function getLogFileName(_0x965f49,_0x26aef5,_0xa2d89e){var _0x3ca43a=_0x965f49||_0x0853('0xf');return path[_0x0853('0x10')](_0x3ca43a,util[_0x0853('0x11')]('%s-%s.log',_0x26aef5,_0xa2d89e));}function formatter(_0x5861ed,_0x5c2b53){_0x5c2b53[_0x0853('0x12')]=_0x5c2b53[_0x0853('0x12')][_0x0853('0x13')](/@@{/g,_0x0853('0x14'))[_0x0853('0x13')](/}@@/g,_0x0853('0x15'))['replace'](/@{/g,'{{')['replace'](/}@/g,'}}');return util['format'](_0x0853('0x16'),moment()[_0x0853('0x11')](_0x0853('0x17')),_0x5c2b53[_0x0853('0x18')]['toUpperCase'](),_0x5861ed,_0x5c2b53[_0x0853('0x12')]);}function fileFormat(_0x5b6d1f,_0x152dfe){_0x152dfe[_0x0853('0x12')]=_0x152dfe[_0x0853('0x12')][_0x0853('0x13')](/@@{/g,'{{{')[_0x0853('0x13')](/}@@/g,_0x0853('0x15'))[_0x0853('0x13')](/@{/g,'{{')[_0x0853('0x13')](/}@/g,'}}');var _0x3e8c41=_0x152dfe[_0x0853('0x19')]&&Object[_0x0853('0x1a')](_0x152dfe[_0x0853('0x19')])[_0x0853('0x1b')]?'\x0a\x09'+JSON[_0x0853('0x1c')](_0x152dfe['meta']):'';return util['format'](_0x0853('0x1d'),moment()[_0x0853('0x11')](_0x0853('0x17')),_0x152dfe[_0x0853('0x18')][_0x0853('0x1e')](),_0x5b6d1f,_0x152dfe[_0x0853('0x12')],_0x3e8c41);}function consoleLogger(){var _0x2ff155=new winston[(_0x0853('0x1f'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x0853('0x20'))][(_0x0853('0x21'))]({'level':'warn','json':![],'formatter':function(_0x51aabf){return formatter('',_0x51aabf);}})]});return _0x2ff155;}function fileLogger(_0x1eec46,_0x319636){var _0x2f5419=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x0853('0x20'))][(_0x0853('0x22'))]({'name':util[_0x0853('0x11')](_0x0853('0x23'),_0x1eec46,_0x0853('0x24')),'filename':getLogFileName(_0x319636,_0x1eec46,'error'),'level':_0x0853('0x24'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x46be04){return fileFormat(_0x1eec46,_0x46be04);}}),new winston[(_0x0853('0x20'))][(_0x0853('0x22'))]({'name':util[_0x0853('0x11')](_0x0853('0x23'),_0x1eec46,debugLevel),'filename':getLogFileName(_0x319636,_0x1eec46,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4fb0da){return fileFormat(_0x1eec46,_0x4fb0da);}}),new winston['transports'][(_0x0853('0x21'))]({'level':'warn','json':![],'formatter':function(_0x189110){return fileFormat(_0x1eec46,_0x189110);}})]});return _0x2f5419;}exports[_0x0853('0x25')]=consoleLogger;exports[_0x0853('0x26')]=fileLogger; \ No newline at end of file +var _0xb63a=['stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','Logger','Console','warn','transports','error','%s-%s','fileLogger','path','util','moment','winston','debugLevel','toLowerCase','info','red','bold\x20yellow','white','bold\x20white','bold\x20green','gray','bold\x20magenta','bold\x20blue','bold\x20cyan','join','format','%s-%s.log','message','{{{','replace','level','keys','meta','length'];(function(_0x3ca925,_0x3f5932){var _0x45a30e=function(_0x4f4b2d){while(--_0x4f4b2d){_0x3ca925['push'](_0x3ca925['shift']());}};_0x45a30e(++_0x3f5932);}(_0xb63a,0x158));var _0xab63=function(_0x32bb6b,_0x1a5fbe){_0x32bb6b=_0x32bb6b-0x0;var _0x58dcb4=_0xb63a[_0x32bb6b];return _0x58dcb4;};'use strict';var path=require(_0xab63('0x0'));var util=require(_0xab63('0x1'));var moment=require(_0xab63('0x2'));var winston=require(_0xab63('0x3'));var config=require('../config/environment');var debugLevel=config[_0xab63('0x4')]?config['debugLevel'][_0xab63('0x5')]():_0xab63('0x6');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':'redBG\x20white','error':_0xab63('0x7'),'warn':_0xab63('0x8'),'info':_0xab63('0x9'),'print':_0xab63('0xa'),'success':_0xab63('0xb'),'http':_0xab63('0xc'),'verbose':_0xab63('0xd'),'debug':_0xab63('0xe'),'silly':_0xab63('0xf')};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x2a1c46,_0xd73cad,_0x1a144a){var _0x5e47d3=_0x2a1c46||'/var/log/xcally';return path[_0xab63('0x10')](_0x5e47d3,util[_0xab63('0x11')](_0xab63('0x12'),_0xd73cad,_0x1a144a));}function formatter(_0x42ab72,_0x3394e7){_0x3394e7[_0xab63('0x13')]=_0x3394e7[_0xab63('0x13')]['replace'](/@@{/g,_0xab63('0x14'))[_0xab63('0x15')](/}@@/g,'}}}')[_0xab63('0x15')](/@{/g,'{{')[_0xab63('0x15')](/}@/g,'}}');return util[_0xab63('0x11')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0xab63('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),_0x3394e7[_0xab63('0x16')]['toUpperCase'](),_0x42ab72,_0x3394e7[_0xab63('0x13')]);}function fileFormat(_0xe141fb,_0x47eb8d){_0x47eb8d[_0xab63('0x13')]=_0x47eb8d[_0xab63('0x13')][_0xab63('0x15')](/@@{/g,_0xab63('0x14'))['replace'](/}@@/g,'}}}')[_0xab63('0x15')](/@{/g,'{{')[_0xab63('0x15')](/}@/g,'}}');var _0x1939a1=_0x47eb8d['meta']&&Object[_0xab63('0x17')](_0x47eb8d[_0xab63('0x18')])[_0xab63('0x19')]?'\x0a\x09'+JSON[_0xab63('0x1a')](_0x47eb8d[_0xab63('0x18')]):'';return util[_0xab63('0x11')](_0xab63('0x1b'),moment()[_0xab63('0x11')](_0xab63('0x1c')),_0x47eb8d[_0xab63('0x16')][_0xab63('0x1d')](),_0xe141fb,_0x47eb8d[_0xab63('0x13')],_0x1939a1);}function consoleLogger(){var _0x586008=new winston[(_0xab63('0x1e'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0xab63('0x1f'))]({'level':_0xab63('0x20'),'json':![],'formatter':function(_0xff290){return formatter('',_0xff290);}})]});return _0x586008;}function fileLogger(_0x240343,_0x4f8863){var _0x507dc6=new winston[(_0xab63('0x1e'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xab63('0x21'))]['File']({'name':util['format']('%s-%s',_0x240343,_0xab63('0x22')),'filename':getLogFileName(_0x4f8863,_0x240343,_0xab63('0x22')),'level':_0xab63('0x22'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2310ea){return fileFormat(_0x240343,_0x2310ea);}}),new winston[(_0xab63('0x21'))]['File']({'name':util[_0xab63('0x11')](_0xab63('0x23'),_0x240343,debugLevel),'filename':getLogFileName(_0x4f8863,_0x240343,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x75425d){return fileFormat(_0x240343,_0x75425d);}}),new winston[(_0xab63('0x21'))][(_0xab63('0x1f'))]({'level':'warn','json':![],'formatter':function(_0x4af410){return fileFormat(_0x240343,_0x4af410);}})]});return _0x507dc6;}exports['consoleLogger']=consoleLogger;exports[_0xab63('0x24')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index 6bd25b0..3514b19 100644 --- a/server/utils/mask-sensitive-data.js +++ b/server/utils/mask-sensitive-data.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1967=['secret','registry','isPlainObject','isArray','length','isString','replace','@@{','}@@','includes','exports','username','password','newPassword','apiKey','firstName','lastName','street','phone','mobile','fax','clientId','clientSecret','securityToken','code','accessKey','tenantId','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','key','user','pass','localstationid','dsn'];(function(_0x28669c,_0x1f62c4){var _0x4a3af6=function(_0x3e25d5){while(--_0x3e25d5){_0x28669c['push'](_0x28669c['shift']());}};_0x4a3af6(++_0x1f62c4);}(_0x1967,0x173));var _0x7196=function(_0x4cc803,_0x3d656c){_0x4cc803=_0x4cc803-0x0;var _0x3bda19=_0x1967[_0x4cc803];return _0x3bda19;};var _=require('lodash');var sensitiveFields=[_0x7196('0x0'),_0x7196('0x1'),_0x7196('0x2'),_0x7196('0x3'),_0x7196('0x4'),_0x7196('0x5'),_0x7196('0x6'),_0x7196('0x7'),_0x7196('0x8'),_0x7196('0x9'),'email',_0x7196('0xa'),_0x7196('0xb'),_0x7196('0xc'),_0x7196('0xd'),_0x7196('0xe'),_0x7196('0xf'),'token',_0x7196('0x10'),_0x7196('0x11'),_0x7196('0x12'),_0x7196('0x13'),_0x7196('0x14'),'consumerSecret','membername',_0x7196('0x15'),_0x7196('0x16'),_0x7196('0x17'),_0x7196('0x18'),_0x7196('0x19'),_0x7196('0x1a'),_0x7196('0x1b'),_0x7196('0x1c'),_0x7196('0x1d'),_0x7196('0x1e'),_0x7196('0x1f'),'accountSid',_0x7196('0x20'),_0x7196('0x21'),_0x7196('0x22'),_0x7196('0x23'),'oldPassword'];function maskSensitiveData(_0x31c778){const _0x539414=/(?!^)[\s\S](?!$)/g;if(_[_0x7196('0x24')](_0x31c778)){for(const _0x2590a6 in _0x31c778){if(_[_0x7196('0x25')](_0x31c778[_0x2590a6])){for(let _0x3ed1ad=0x0;_0x3ed1ad<_0x31c778[_0x2590a6][_0x7196('0x26')];_0x3ed1ad++){maskSensitiveData(_0x31c778[_0x2590a6][_0x3ed1ad]);}}else if(_[_0x7196('0x24')](_0x31c778[_0x2590a6])){maskSensitiveData(_0x31c778[_0x2590a6]);}else if(_[_0x7196('0x27')](_0x31c778[_0x2590a6])){_0x31c778[_0x2590a6]=_0x31c778[_0x2590a6][_0x7196('0x28')](/{{{/g,_0x7196('0x29'))[_0x7196('0x28')](/}}}/g,_0x7196('0x2a'))['replace'](/{{/g,'@{')['replace'](/}}/g,'}@');if(_[_0x7196('0x2b')](sensitiveFields,_0x2590a6)){_0x31c778[_0x2590a6]=_0x31c778[_0x2590a6][_0x7196('0x28')](_0x539414,'*');}}}}}module[_0x7196('0x2c')]['maskSensitiveData']=maskSensitiveData; \ No newline at end of file +var _0x0295=['length','isString','replace','}@@','includes','exports','lodash','newPassword','lastName','street','phone','mobile','fax','email','clientId','clientSecret','securityToken','token','accessToken','authToken','consumerSecret','membername','calleridname','exten','vidaooApiKey','clientEmail','accesskeyid','secretaccesskey','localstationid','dsn','secret','registry','oldPassword','isPlainObject','isArray'];(function(_0x3ff685,_0x304b9e){var _0x2046c9=function(_0x7a10e9){while(--_0x7a10e9){_0x3ff685['push'](_0x3ff685['shift']());}};_0x2046c9(++_0x304b9e);}(_0x0295,0x1f0));var _0x5029=function(_0x2955be,_0x17e9c4){_0x2955be=_0x2955be-0x0;var _0x27604b=_0x0295[_0x2955be];return _0x27604b;};var _=require(_0x5029('0x0'));var sensitiveFields=['username','password',_0x5029('0x1'),'apiKey','firstName',_0x5029('0x2'),_0x5029('0x3'),_0x5029('0x4'),_0x5029('0x5'),_0x5029('0x6'),_0x5029('0x7'),_0x5029('0x8'),_0x5029('0x9'),_0x5029('0xa'),'code','accessKey','tenantId',_0x5029('0xb'),'channelSecret',_0x5029('0xc'),'accessTokenSecret',_0x5029('0xd'),'consumerKey',_0x5029('0xe'),_0x5029('0xf'),_0x5029('0x10'),'calleridnum',_0x5029('0x11'),_0x5029('0x12'),_0x5029('0x13'),'privateKey',_0x5029('0x14'),_0x5029('0x15'),'key','user','pass','accountSid',_0x5029('0x16'),_0x5029('0x17'),_0x5029('0x18'),_0x5029('0x19'),_0x5029('0x1a')];function maskSensitiveData(_0x11c24b){const _0xe278b7=/(?!^)[\s\S](?!$)/g;if(_[_0x5029('0x1b')](_0x11c24b)){for(const _0x10bf55 in _0x11c24b){if(_[_0x5029('0x1c')](_0x11c24b[_0x10bf55])){for(let _0x457c73=0x0;_0x457c73<_0x11c24b[_0x10bf55][_0x5029('0x1d')];_0x457c73++){maskSensitiveData(_0x11c24b[_0x10bf55][_0x457c73]);}}else if(_[_0x5029('0x1b')](_0x11c24b[_0x10bf55])){maskSensitiveData(_0x11c24b[_0x10bf55]);}else if(_[_0x5029('0x1e')](_0x11c24b[_0x10bf55])){_0x11c24b[_0x10bf55]=_0x11c24b[_0x10bf55][_0x5029('0x1f')](/{{{/g,'@@{')[_0x5029('0x1f')](/}}}/g,_0x5029('0x20'))[_0x5029('0x1f')](/{{/g,'@{')[_0x5029('0x1f')](/}}/g,'}@');if(_[_0x5029('0x21')](sensitiveFields,_0x10bf55)){_0x11c24b[_0x10bf55]=_0x11c24b[_0x10bf55][_0x5029('0x1f')](_0xe278b7,'*');}}}}}module[_0x5029('0x22')]['maskSensitiveData']=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index e6601a4..577068d 100644 --- a/server/utils/safe-template.js +++ b/server/utils/safe-template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9354=['map','isPlainObject','keys','reduce','exports','safeTemplate','{\x20{\x20','string','replace'];(function(_0x37b544,_0x4f6d1d){var _0x5dc42=function(_0x562614){while(--_0x562614){_0x37b544['push'](_0x37b544['shift']());}};_0x5dc42(++_0x4f6d1d);}(_0x9354,0x96));var _0x4935=function(_0x46884f,_0x2b5c5a){_0x46884f=_0x46884f-0x0;var _0x78c6c0=_0x9354[_0x46884f];return _0x78c6c0;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x42d9d9){return _0x42d9d9==='{{'?_0x4935('0x0'):'\x20}\x20}';}function safeTemplate(_0x263dd5){var _0x2a4993=_0x263dd5;if(typeof _0x263dd5===_0x4935('0x1')){_0x2a4993=_0x263dd5[_0x4935('0x2')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x263dd5)){_0x2a4993=_0x263dd5[_0x4935('0x3')](function(_0x2d509b){return safeTemplate(_0x2d509b);});}else if(_[_0x4935('0x4')](_0x263dd5)){_0x2a4993=Object[_0x4935('0x5')](_0x263dd5)[_0x4935('0x6')](function(_0x2e47bd,_0x118d36){_0x2e47bd[_0x118d36]=safeTemplate(_0x263dd5[_0x118d36]);return _0x2e47bd;},{});}return _0x2a4993;}module[_0x4935('0x7')][_0x4935('0x8')]=safeTemplate; \ No newline at end of file +var _0x34b7=['string','replace','isPlainObject','keys','reduce','safeTemplate','{\x20{\x20','\x20}\x20}'];(function(_0x2d5887,_0xace828){var _0x257084=function(_0x457e3a){while(--_0x457e3a){_0x2d5887['push'](_0x2d5887['shift']());}};_0x257084(++_0xace828);}(_0x34b7,0x196));var _0x734b=function(_0x3f0c12,_0xea4b1d){_0x3f0c12=_0x3f0c12-0x0;var _0x2b90e0=_0x34b7[_0x3f0c12];return _0x2b90e0;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x57123d){return _0x57123d==='{{'?_0x734b('0x0'):_0x734b('0x1');}function safeTemplate(_0x6e4318){var _0x354f96=_0x6e4318;if(typeof _0x6e4318===_0x734b('0x2')){_0x354f96=_0x6e4318[_0x734b('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x6e4318)){_0x354f96=_0x6e4318['map'](function(_0x303067){return safeTemplate(_0x303067);});}else if(_[_0x734b('0x4')](_0x6e4318)){_0x354f96=Object[_0x734b('0x5')](_0x6e4318)[_0x734b('0x6')](function(_0x28918a,_0x35d685){_0x28918a[_0x35d685]=safeTemplate(_0x6e4318[_0x35d685]);return _0x28918a;},{});}return _0x354f96;}module['exports'][_0x734b('0x7')]=safeTemplate; \ No newline at end of file -- 1.7.1